summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/darwin/XDarwin.man205
-rw-r--r--hw/darwin/bundle/Dutch.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/Dutch.lproj/Localizable.stringsbin0 -> 1420 bytes
-rw-r--r--hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nibbin0 -> 21843 bytes
-rw-r--r--hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp1
-rw-r--r--hw/darwin/bundle/English.lproj/Credits.rtf138
-rw-r--r--hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp5
-rw-r--r--hw/darwin/bundle/English.lproj/Localizable.strings23
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nibbin0 -> 20327 bytes
-rw-r--r--hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp103
-rw-r--r--hw/darwin/bundle/French.lproj/Credits.rtf123
-rw-r--r--hw/darwin/bundle/French.lproj/Localizable.stringsbin0 -> 1486 bytes
-rw-r--r--hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nibbin0 -> 22289 bytes
-rw-r--r--hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp107
-rw-r--r--hw/darwin/bundle/German.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/German.lproj/Localizable.stringsbin0 -> 1452 bytes
-rw-r--r--hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nibbin0 -> 22218 bytes
-rw-r--r--hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp90
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Credits.rtf135
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Localizable.stringsbin0 -> 1146 bytes
-rw-r--r--hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nibbin0 -> 21423 bytes
-rw-r--r--hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp149
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Credits.rtf139
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Localizable.stringsbin0 -> 1498 bytes
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nibbin0 -> 20861 bytes
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp216
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Localizable.stringsbin0 -> 1474 bytes
-rw-r--r--hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nibbin0 -> 21989 bytes
-rw-r--r--hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp116
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Localizable.stringsbin0 -> 1458 bytes
-rw-r--r--hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nibbin0 -> 20444 bytes
-rw-r--r--hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp108
-rw-r--r--hw/darwin/bundle/XDarwin.icnsbin0 -> 35134 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/Credits.rtf124
-rw-r--r--hw/darwin/bundle/ko.lproj/Localizable.stringsbin0 -> 1326 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib64
-rw-r--r--hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nibbin0 -> 21010 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp103
-rw-r--r--hw/darwin/bundle/startXClients.cpp24
-rw-r--r--hw/darwin/darwin.c1025
-rw-r--r--hw/darwin/darwin.h106
-rw-r--r--hw/darwin/darwinClut8.h532
-rw-r--r--hw/darwin/darwinEvents.c438
-rw-r--r--hw/darwin/darwinKeyboard.c805
-rw-r--r--hw/darwin/quartz/Preferences.h107
-rw-r--r--hw/darwin/quartz/Preferences.m530
-rw-r--r--hw/darwin/quartz/XApplication.h47
-rw-r--r--hw/darwin/quartz/XApplication.m47
-rw-r--r--hw/darwin/quartz/XDarwin.pbproj/project.pbxproj1683
-rw-r--r--hw/darwin/quartz/XDarwinStartup.c165
-rw-r--r--hw/darwin/quartz/XDarwinStartup.man75
-rw-r--r--hw/darwin/quartz/XServer.h112
-rw-r--r--hw/darwin/quartz/XServer.m1029
-rw-r--r--hw/darwin/quartz/pseudoramiX.c420
-rw-r--r--hw/darwin/quartz/pseudoramiX.h10
-rw-r--r--hw/darwin/quartz/quartz.c305
-rw-r--r--hw/darwin/quartz/quartz.h50
-rw-r--r--hw/darwin/quartz/quartzAudio.c342
-rw-r--r--hw/darwin/quartz/quartzAudio.h41
-rw-r--r--hw/darwin/quartz/quartzCocoa.m198
-rw-r--r--hw/darwin/quartz/quartzCommon.h98
-rw-r--r--hw/darwin/quartz/quartzCursor.c653
-rw-r--r--hw/darwin/quartz/quartzCursor.h43
-rw-r--r--hw/darwin/quartz/quartzPasteboard.c150
-rw-r--r--hw/darwin/quartz/quartzPasteboard.h45
-rw-r--r--hw/darwin/quartz/quartzStartup.c233
-rw-r--r--hw/darwin/utils/README.txt111
-rw-r--r--hw/darwin/utils/dumpkeymap.c1453
-rw-r--r--hw/darwin/utils/dumpkeymap.man1004
-rw-r--r--hw/xfree86/Options409
-rw-r--r--hw/xfree86/common/extramodes33
-rw-r--r--hw/xfree86/common/fourcc.h130
-rw-r--r--hw/xfree86/common/modeline2c.pl79
-rw-r--r--hw/xfree86/common/vesamodes111
-rw-r--r--hw/xfree86/common/xf86Bus.c3205
-rw-r--r--hw/xfree86/common/xf86Bus.h135
-rw-r--r--hw/xfree86/common/xf86Config.h27
-rw-r--r--hw/xfree86/common/xf86Configure.c997
-rw-r--r--hw/xfree86/common/xf86DGA.c1181
-rw-r--r--hw/xfree86/common/xf86DPMS.c175
-rw-r--r--hw/xfree86/common/xf86Date.h7
-rw-r--r--hw/xfree86/common/xf86Debug.c162
-rw-r--r--hw/xfree86/common/xf86DefModes.c153
-rw-r--r--hw/xfree86/common/xf86DoProbe.c83
-rw-r--r--hw/xfree86/common/xf86DoScanPci.c97
-rw-r--r--hw/xfree86/common/xf86Globals.c224
-rw-r--r--hw/xfree86/common/xf86Helper.c2994
-rw-r--r--hw/xfree86/common/xf86InPriv.h17
-rw-r--r--hw/xfree86/common/xf86MiscExt.c612
-rw-r--r--hw/xfree86/common/xf86Mode.c1999
-rw-r--r--hw/xfree86/common/xf86Module.h203
-rw-r--r--hw/xfree86/common/xf86Opt.h82
-rw-r--r--hw/xfree86/common/xf86Option.c777
-rw-r--r--hw/xfree86/common/xf86PM.c188
-rw-r--r--hw/xfree86/common/xf86PciInfo.h573
-rw-r--r--hw/xfree86/common/xf86Privstr.h234
-rw-r--r--hw/xfree86/common/xf86RandR.c280
-rw-r--r--hw/xfree86/common/xf86Resources.h113
-rw-r--r--hw/xfree86/common/xf86VidMode.c683
-rw-r--r--hw/xfree86/common/xf86cmap.c1081
-rw-r--r--hw/xfree86/common/xf86cmap.h62
-rw-r--r--hw/xfree86/common/xf86fbBus.c70
-rw-r--r--hw/xfree86/common/xf86fbman.c1236
-rw-r--r--hw/xfree86/common/xf86fbman.h193
-rw-r--r--hw/xfree86/common/xf86isaBus.c115
-rw-r--r--hw/xfree86/common/xf86noBus.c48
-rw-r--r--hw/xfree86/common/xf86pciBus.c3493
-rw-r--r--hw/xfree86/common/xf86pciBus.h72
-rw-r--r--hw/xfree86/common/xf86sbusBus.c705
-rw-r--r--hw/xfree86/common/xf86sbusBus.h98
-rw-r--r--hw/xfree86/common/xf86str.h1029
-rw-r--r--hw/xfree86/common/xf86xv.c1935
-rw-r--r--hw/xfree86/common/xf86xv.h272
-rw-r--r--hw/xfree86/common/xf86xvmc.c201
-rw-r--r--hw/xfree86/common/xf86xvmc.h134
-rw-r--r--hw/xfree86/common/xisb.c172
-rw-r--r--hw/xfree86/common/xisb.h64
-rw-r--r--hw/xfree86/ddc/DDC.HOWTO97
-rw-r--r--hw/xfree86/ddc/ddcPriv.h9
-rw-r--r--hw/xfree86/ddc/ddcProperty.c160
-rw-r--r--hw/xfree86/ddc/edid.c137
-rw-r--r--hw/xfree86/ddc/edid.h424
-rw-r--r--hw/xfree86/ddc/interpret_edid.c226
-rw-r--r--hw/xfree86/ddc/interpret_vdif.c129
-rw-r--r--hw/xfree86/ddc/print_edid.c286
-rw-r--r--hw/xfree86/ddc/print_vdif.c222
-rw-r--r--hw/xfree86/ddc/vdif.h174
-rw-r--r--hw/xfree86/ddc/xf86DDC.c379
-rw-r--r--hw/xfree86/ddc/xf86DDC.h61
-rw-r--r--hw/xfree86/dixmods/GLcoremodule.c60
-rw-r--r--hw/xfree86/dixmods/afbmodule.c49
-rw-r--r--hw/xfree86/dixmods/bitmapmod.c72
-rw-r--r--hw/xfree86/dixmods/cfb16module.c59
-rw-r--r--hw/xfree86/dixmods/cfb24module.c59
-rw-r--r--hw/xfree86/dixmods/cfb32module.c59
-rw-r--r--hw/xfree86/dixmods/cfbmodule.c59
-rw-r--r--hw/xfree86/dixmods/dbemodule.c43
-rw-r--r--hw/xfree86/dixmods/extmod/dgaproc.h147
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c362
-rw-r--r--hw/xfree86/dixmods/extmod/vidmodeproc.h74
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga.c302
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga2.c773
-rw-r--r--hw/xfree86/dixmods/extmod/xf86misc.c767
-rw-r--r--hw/xfree86/dixmods/extmod/xf86miscproc.h64
-rw-r--r--hw/xfree86/dixmods/extmod/xvmod.c20
-rw-r--r--hw/xfree86/dixmods/extmod/xvmodproc.h10
-rw-r--r--hw/xfree86/dixmods/fbmodule.c49
-rw-r--r--hw/xfree86/dixmods/ftmodule.c72
-rw-r--r--hw/xfree86/dixmods/glxmodule.c1253
-rw-r--r--hw/xfree86/dixmods/laymodule.c56
-rw-r--r--hw/xfree86/dixmods/mfbmodule.c48
-rw-r--r--hw/xfree86/dixmods/recordmod.c42
-rw-r--r--hw/xfree86/dixmods/shmodule.c56
-rw-r--r--hw/xfree86/dixmods/type1mod.c87
-rw-r--r--hw/xfree86/dixmods/xf86XTrapModule.c47
-rw-r--r--hw/xfree86/doc/README.DRI1257
-rw-r--r--hw/xfree86/doc/README.fonts1146
-rw-r--r--hw/xfree86/doc/README.rapidaccess48
-rw-r--r--hw/xfree86/doc/changelogs/CHANGELOG16588
-rw-r--r--hw/xfree86/doc/changelogs/CHANGELOG.ND418
-rw-r--r--hw/xfree86/doc/changelogs/CHANGELOG.R51249
-rw-r--r--hw/xfree86/doc/devel/DebuggingHints192
-rw-r--r--hw/xfree86/doc/devel/Domain.note159
-rw-r--r--hw/xfree86/doc/devel/RAC.Notes696
-rw-r--r--hw/xfree86/doc/devel/README.DRIcomp543
-rw-r--r--hw/xfree86/doc/devel/Registry410
-rw-r--r--hw/xfree86/doc/sgml/DESIGN.sgml7415
-rw-r--r--hw/xfree86/dri/dri.c2117
-rw-r--r--hw/xfree86/dri/dri.h330
-rw-r--r--hw/xfree86/dri/drimodule.c121
-rw-r--r--hw/xfree86/dri/dristruct.h104
-rw-r--r--hw/xfree86/dri/sarea.h80
-rw-r--r--hw/xfree86/dri/xf86dri.c710
-rw-r--r--hw/xfree86/dummylib/README7
-rw-r--r--hw/xfree86/dummylib/dummylib.h8
-rw-r--r--hw/xfree86/dummylib/fatalerror.c23
-rw-r--r--hw/xfree86/dummylib/getvalidbios.c16
-rw-r--r--hw/xfree86/dummylib/pcitestmulti.c17
-rw-r--r--hw/xfree86/dummylib/verrorf.c17
-rw-r--r--hw/xfree86/dummylib/xalloc.c92
-rw-r--r--hw/xfree86/dummylib/xf86addrestolist.c21
-rw-r--r--hw/xfree86/dummylib/xf86allocscripi.c17
-rw-r--r--hw/xfree86/dummylib/xf86drvmsg.c22
-rw-r--r--hw/xfree86/dummylib/xf86drvmsgverb.c22
-rw-r--r--hw/xfree86/dummylib/xf86errorf.c31
-rw-r--r--hw/xfree86/dummylib/xf86errorfverb.c22
-rw-r--r--hw/xfree86/dummylib/xf86getpagesize.c19
-rw-r--r--hw/xfree86/dummylib/xf86getverb.c17
-rw-r--r--hw/xfree86/dummylib/xf86info.c10
-rw-r--r--hw/xfree86/dummylib/xf86msg.c22
-rw-r--r--hw/xfree86/dummylib/xf86msgverb.c22
-rw-r--r--hw/xfree86/dummylib/xf86opt.c22
-rw-r--r--hw/xfree86/dummylib/xf86screens.c10
-rw-r--r--hw/xfree86/dummylib/xf86servisinit.c17
-rw-r--r--hw/xfree86/dummylib/xf86verbose.c10
-rw-r--r--hw/xfree86/fbdevhw/README16
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c870
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.h52
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.man.pre21
-rw-r--r--hw/xfree86/fbdevhw/fbdevhwstub.c170
-rw-r--r--hw/xfree86/fbdevhw/fbpriv.h262
-rw-r--r--hw/xfree86/i2c/xf86i2c.c863
-rw-r--r--hw/xfree86/i2c/xf86i2c.h93
-rw-r--r--hw/xfree86/i2c/xf86i2cmodule.c34
-rw-r--r--hw/xfree86/int10/INT10.HOWTO344
-rw-r--r--hw/xfree86/int10/generic.c552
-rw-r--r--hw/xfree86/int10/helper_exec.c603
-rw-r--r--hw/xfree86/int10/helper_mem.c333
-rw-r--r--hw/xfree86/int10/pci.c51
-rw-r--r--hw/xfree86/int10/stub.c66
-rw-r--r--hw/xfree86/int10/xf86int10.c787
-rw-r--r--hw/xfree86/int10/xf86int10.h198
-rw-r--r--hw/xfree86/int10/xf86int10module.c63
-rw-r--r--hw/xfree86/int10/xf86x86emu.c88
-rw-r--r--hw/xfree86/int10/xf86x86emu.h51
-rw-r--r--hw/xfree86/loader/SparcMulDiv.S87
-rw-r--r--hw/xfree86/loader/aout.h232
-rw-r--r--hw/xfree86/loader/aoutloader.c858
-rw-r--r--hw/xfree86/loader/aoutloader.h31
-rw-r--r--hw/xfree86/loader/ar.h77
-rw-r--r--hw/xfree86/loader/coff.h244
-rw-r--r--hw/xfree86/loader/coffloader.c1358
-rw-r--r--hw/xfree86/loader/coffloader.h34
-rw-r--r--hw/xfree86/loader/dixsym.c367
-rw-r--r--hw/xfree86/loader/dlloader.c191
-rw-r--r--hw/xfree86/loader/dlloader.h32
-rw-r--r--hw/xfree86/loader/elf.h710
-rw-r--r--hw/xfree86/loader/elfloader.c3024
-rw-r--r--hw/xfree86/loader/elfloader.h34
-rw-r--r--hw/xfree86/loader/extsym.c79
-rw-r--r--hw/xfree86/loader/fontsym.c79
-rw-r--r--hw/xfree86/loader/hash.c364
-rw-r--r--hw/xfree86/loader/hash.h36
-rw-r--r--hw/xfree86/loader/loader.c1412
-rw-r--r--hw/xfree86/loader/loader.h269
-rw-r--r--hw/xfree86/loader/loaderProcs.h96
-rw-r--r--hw/xfree86/loader/loadext.c419
-rw-r--r--hw/xfree86/loader/loadfont.c53
-rw-r--r--hw/xfree86/loader/loadmod.c1296
-rw-r--r--hw/xfree86/loader/misym.c180
-rw-r--r--hw/xfree86/loader/os.c49
-rw-r--r--hw/xfree86/loader/sym.h46
-rw-r--r--hw/xfree86/loader/xf86sym.c1133
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c709
-rw-r--r--hw/xfree86/os-support/bsd/arm_video.c677
-rw-r--r--hw/xfree86/os-support/bsd/bsdResource.c190
-rw-r--r--hw/xfree86/os-support/bsd/bsd_KbdMap.c1075
-rw-r--r--hw/xfree86/os-support/bsd/bsd_apm.c137
-rw-r--r--hw/xfree86/os-support/bsd/bsd_axp.c69
-rw-r--r--hw/xfree86/os-support/bsd/bsd_ev56.c87
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kbd.c536
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kbd.h5
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kmod.c27
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kqueue_apm.c199
-rw-r--r--hw/xfree86/os-support/bsd/bsd_mouse.c594
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c877
-rw-r--r--hw/xfree86/os-support/bsd/libusb/data.c91
-rw-r--r--hw/xfree86/os-support/bsd/libusb/descr.c72
-rw-r--r--hw/xfree86/os-support/bsd/libusb/parse.c400
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usage.c195
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usb.3191
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usb.h95
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usb_hid_usages1079
-rw-r--r--hw/xfree86/os-support/bsd/libusb/usbvar.h34
-rw-r--r--hw/xfree86/os-support/bsd/memrange.h68
-rw-r--r--hw/xfree86/os-support/bsd/ppc_video.c130
-rw-r--r--hw/xfree86/os-support/bsd/sparc64_video.c106
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.c451
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.h36
-rw-r--r--hw/xfree86/os-support/bus/Pci.c1456
-rw-r--r--hw/xfree86/os-support/bus/Pci.h403
-rw-r--r--hw/xfree86/os-support/bus/Sbus.c624
-rw-r--r--hw/xfree86/os-support/bus/axpPci.c474
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.c54
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.h36
-rw-r--r--hw/xfree86/os-support/bus/freebsdPci.c167
-rw-r--r--hw/xfree86/os-support/bus/ix86Pci.c690
-rw-r--r--hw/xfree86/os-support/bus/linuxPci.c584
-rw-r--r--hw/xfree86/os-support/bus/netbsdPci.c127
-rw-r--r--hw/xfree86/os-support/bus/ppcPci.c212
-rw-r--r--hw/xfree86/os-support/bus/sparcPci.c1048
-rw-r--r--hw/xfree86/os-support/bus/xf86Pci.h787
-rw-r--r--hw/xfree86/os-support/bus/xf86Sbus.h59
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.c1047
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.h36
-rw-r--r--hw/xfree86/os-support/drm/drmmodule.c56
-rw-r--r--hw/xfree86/os-support/int10Defines.h60
-rw-r--r--hw/xfree86/os-support/linux/int10/linux.c627
-rw-r--r--hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c292
-rw-r--r--hw/xfree86/os-support/linux/lnx.h44
-rw-r--r--hw/xfree86/os-support/linux/lnxResource.c286
-rw-r--r--hw/xfree86/os-support/linux/lnx_KbdMap.c603
-rw-r--r--hw/xfree86/os-support/linux/lnx_agp.c342
-rw-r--r--hw/xfree86/os-support/linux/lnx_apm.c166
-rw-r--r--hw/xfree86/os-support/linux/lnx_axp.c196
-rw-r--r--hw/xfree86/os-support/linux/lnx_ev56.c147
-rw-r--r--hw/xfree86/os-support/linux/lnx_kbd.c523
-rw-r--r--hw/xfree86/os-support/linux/lnx_kbd.h5
-rw-r--r--hw/xfree86/os-support/linux/lnx_kmod.c109
-rw-r--r--hw/xfree86/os-support/linux/lnx_mouse.c29
-rw-r--r--hw/xfree86/os-support/linux/lnx_pci.c85
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_mouse.c30
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_noinline.c174
-rw-r--r--hw/xfree86/os-support/lynxos/lynx_ppc.c52
-rw-r--r--hw/xfree86/os-support/misc/BUSmemcpy.S156
-rw-r--r--hw/xfree86/os-support/misc/BUSmemcpy.c409
-rw-r--r--hw/xfree86/os-support/misc/Delay.c37
-rw-r--r--hw/xfree86/os-support/misc/IODelay.S53
-rw-r--r--hw/xfree86/os-support/misc/IODelay.c24
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.S108
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.c107
-rw-r--r--hw/xfree86/os-support/sco/sco_iop.c124
-rw-r--r--hw/xfree86/os-support/shared/agp_noop.c69
-rw-r--r--hw/xfree86/os-support/shared/at_scancode.c74
-rw-r--r--hw/xfree86/os-support/shared/bios_mmap.c160
-rw-r--r--hw/xfree86/os-support/shared/inout.S111
-rw-r--r--hw/xfree86/os-support/shared/kbd.c13
-rw-r--r--hw/xfree86/os-support/shared/kmod_noop.c8
-rw-r--r--hw/xfree86/os-support/shared/libc_wrapper.c2015
-rw-r--r--hw/xfree86/os-support/shared/pm_noop.c18
-rw-r--r--hw/xfree86/os-support/shared/sigio.c277
-rw-r--r--hw/xfree86/os-support/shared/sigiostubs.c54
-rw-r--r--hw/xfree86/os-support/shared/stdPci.c19
-rw-r--r--hw/xfree86/os-support/shared/stdResource.c146
-rw-r--r--hw/xfree86/os-support/shared/vidmem.c270
-rw-r--r--hw/xfree86/os-support/shared/xf86Axp.c20
-rw-r--r--hw/xfree86/os-support/shared/xf86Axp.h32
-rw-r--r--hw/xfree86/os-support/solaris/apSolaris.shar768
-rw-r--r--hw/xfree86/os-support/solaris/sun_bios.c100
-rw-r--r--hw/xfree86/os-support/solaris/sun_init.c375
-rw-r--r--hw/xfree86/os-support/solaris/sun_inout.s124
-rw-r--r--hw/xfree86/os-support/solaris/sun_io.c64
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbd.c112
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbdEv.c672
-rw-r--r--hw/xfree86/os-support/solaris/sun_mouse.c322
-rw-r--r--hw/xfree86/os-support/solaris/sun_vid.c229
-rw-r--r--hw/xfree86/os-support/sysv/sysv_mouse.c60
-rw-r--r--hw/xfree86/os-support/sysv/xqueue.h8
-rw-r--r--hw/xfree86/os-support/xf86OSKbd.h92
-rw-r--r--hw/xfree86/os-support/xf86OSmouse.h181
-rw-r--r--hw/xfree86/os-support/xf86OSpriv.h27
-rw-r--r--hw/xfree86/os-support/xf86_ansic.h352
-rw-r--r--hw/xfree86/os-support/xf86_libc.h672
-rw-r--r--hw/xfree86/parser/Configint.h195
-rw-r--r--hw/xfree86/parser/DRI.c183
-rw-r--r--hw/xfree86/parser/Device.c372
-rw-r--r--hw/xfree86/parser/Files.c264
-rw-r--r--hw/xfree86/parser/Flags.c494
-rw-r--r--hw/xfree86/parser/Input.c184
-rw-r--r--hw/xfree86/parser/Keyboard.c275
-rw-r--r--hw/xfree86/parser/Layout.c482
-rw-r--r--hw/xfree86/parser/Module.c230
-rw-r--r--hw/xfree86/parser/Monitor.c874
-rw-r--r--hw/xfree86/parser/Pointer.c205
-rw-r--r--hw/xfree86/parser/Screen.c555
-rw-r--r--hw/xfree86/parser/Vendor.c227
-rw-r--r--hw/xfree86/parser/Video.c267
-rw-r--r--hw/xfree86/parser/configProcs.h98
-rw-r--r--hw/xfree86/parser/cpconfig.c119
-rw-r--r--hw/xfree86/parser/read.c283
-rw-r--r--hw/xfree86/parser/scan.c1073
-rw-r--r--hw/xfree86/parser/write.c187
-rw-r--r--hw/xfree86/parser/xf86Optrec.h82
-rw-r--r--hw/xfree86/parser/xf86Parser.h444
-rw-r--r--hw/xfree86/parser/xf86tokens.h249
-rw-r--r--hw/xfree86/rac/xf86RAC.c1256
-rw-r--r--hw/xfree86/rac/xf86RAC.h18
-rw-r--r--hw/xfree86/rac/xf86RACmodule.c21
-rw-r--r--hw/xfree86/ramdac/BT.c163
-rw-r--r--hw/xfree86/ramdac/BT.h33
-rw-r--r--hw/xfree86/ramdac/BTPriv.h17
-rw-r--r--hw/xfree86/ramdac/CURSOR.NOTES191
-rw-r--r--hw/xfree86/ramdac/IBM.c633
-rw-r--r--hw/xfree86/ramdac/IBM.h383
-rw-r--r--hw/xfree86/ramdac/IBMPriv.h24
-rw-r--r--hw/xfree86/ramdac/TI.c713
-rw-r--r--hw/xfree86/ramdac/TI.h93
-rw-r--r--hw/xfree86/ramdac/TIPriv.h26
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.c437
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.h49
-rw-r--r--hw/xfree86/ramdac/xf86CursorPriv.h48
-rw-r--r--hw/xfree86/ramdac/xf86HWCurs.c516
-rw-r--r--hw/xfree86/ramdac/xf86RamDac.c160
-rw-r--r--hw/xfree86/ramdac/xf86RamDac.h124
-rw-r--r--hw/xfree86/ramdac/xf86RamDacCmap.c72
-rw-r--r--hw/xfree86/ramdac/xf86RamDacMod.c45
-rw-r--r--hw/xfree86/ramdac/xf86RamDacPriv.h10
-rw-r--r--hw/xfree86/scanpci/extrapci.ids45
-rw-r--r--hw/xfree86/scanpci/pci.ids7299
-rw-r--r--hw/xfree86/scanpci/pciid2c.pl362
-rw-r--r--hw/xfree86/scanpci/xf86PciData.h51
-rw-r--r--hw/xfree86/scanpci/xf86PciStdIds.h80800
-rw-r--r--hw/xfree86/scanpci/xf86PciStr.h41
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.c389
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.h21
-rw-r--r--hw/xfree86/shadowfb/sfbmodule.c24
-rw-r--r--hw/xfree86/shadowfb/shadow.c1820
-rw-r--r--hw/xfree86/shadowfb/shadowfb.h44
-rw-r--r--hw/xfree86/utils/gtf/gtf.c743
-rw-r--r--hw/xfree86/utils/gtf/gtf.man.pre45
-rw-r--r--hw/xfree86/utils/ioport/ioport.c493
-rw-r--r--hw/xfree86/utils/pcitweak/pcitweak.c217
-rw-r--r--hw/xfree86/utils/pcitweak/pcitweak.man.pre64
-rw-r--r--hw/xfree86/utils/scanpci/scanpci.man.pre42
-rw-r--r--hw/xfree86/utils/xorgcfg/TODO33
-rw-r--r--hw/xfree86/utils/xorgcfg/accessx.c682
-rw-r--r--hw/xfree86/utils/xorgcfg/card-cfg.c434
-rw-r--r--hw/xfree86/utils/xorgcfg/card-cfg.h44
-rw-r--r--hw/xfree86/utils/xorgcfg/card.xbm59
-rw-r--r--hw/xfree86/utils/xorgcfg/card.xpm81
-rw-r--r--hw/xfree86/utils/xorgcfg/cards.c693
-rw-r--r--hw/xfree86/utils/xorgcfg/cards.h90
-rw-r--r--hw/xfree86/utils/xorgcfg/computer.xpm91
-rw-r--r--hw/xfree86/utils/xorgcfg/config.c302
-rw-r--r--hw/xfree86/utils/xorgcfg/config.h227
-rw-r--r--hw/xfree86/utils/xorgcfg/down.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/expert.c4860
-rw-r--r--hw/xfree86/utils/xorgcfg/help.c1786
-rw-r--r--hw/xfree86/utils/xorgcfg/help.h42
-rw-r--r--hw/xfree86/utils/xorgcfg/interface.c2280
-rw-r--r--hw/xfree86/utils/xorgcfg/keyboard-cfg.c1379
-rw-r--r--hw/xfree86/utils/xorgcfg/keyboard-cfg.h74
-rw-r--r--hw/xfree86/utils/xorgcfg/keyboard.xbm59
-rw-r--r--hw/xfree86/utils/xorgcfg/keyboard.xpm66
-rw-r--r--hw/xfree86/utils/xorgcfg/left.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/loader.c396
-rw-r--r--hw/xfree86/utils/xorgcfg/loader.h171
-rw-r--r--hw/xfree86/utils/xorgcfg/loadmod.c658
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor-cfg.c449
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor-cfg.h48
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor.xbm59
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor.xpm79
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse-cfg.c450
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse-cfg.h44
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse.xbm59
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse.xpm76
-rw-r--r--hw/xfree86/utils/xorgcfg/narrower.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/options.c788
-rw-r--r--hw/xfree86/utils/xorgcfg/options.h51
-rw-r--r--hw/xfree86/utils/xorgcfg/right.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/screen-cfg.c552
-rw-r--r--hw/xfree86/utils/xorgcfg/screen-cfg.h44
-rw-r--r--hw/xfree86/utils/xorgcfg/screen.c984
-rw-r--r--hw/xfree86/utils/xorgcfg/screen.h52
-rw-r--r--hw/xfree86/utils/xorgcfg/shorter.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/startx.c150
-rw-r--r--hw/xfree86/utils/xorgcfg/stubs.c65
-rw-r--r--hw/xfree86/utils/xorgcfg/stubs.h43
-rw-r--r--hw/xfree86/utils/xorgcfg/taller.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/text-mode.c3353
-rw-r--r--hw/xfree86/utils/xorgcfg/up.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/vidmode.c1357
-rw-r--r--hw/xfree86/utils/xorgcfg/vidmode.h64
-rw-r--r--hw/xfree86/utils/xorgcfg/wider.xbm8
-rw-r--r--hw/xfree86/utils/xorgcfg/xf86config.c980
-rw-r--r--hw/xfree86/utils/xorgcfg/xf86config.h111
-rw-r--r--hw/xfree86/utils/xorgconfig/Cards98647
-rw-r--r--hw/xfree86/vbe/vbe.c1072
-rw-r--r--hw/xfree86/vbe/vbe.h328
-rw-r--r--hw/xfree86/vbe/vbeModes.c477
-rw-r--r--hw/xfree86/vbe/vbeModes.h91
-rw-r--r--hw/xfree86/vbe/vbe_module.c50
-rw-r--r--hw/xfree86/vgahw/vgaCmap.c301
-rw-r--r--hw/xfree86/vgahw/vgaHW.c2021
-rw-r--r--hw/xfree86/vgahw/vgaHW.h228
-rw-r--r--hw/xfree86/vgahw/vgaHWmodule.c27
-rw-r--r--hw/xfree86/x86emu/debug.c430
-rw-r--r--hw/xfree86/x86emu/decode.c1073
-rw-r--r--hw/xfree86/x86emu/fpu.c945
-rw-r--r--hw/xfree86/x86emu/ops.c11675
-rw-r--r--hw/xfree86/x86emu/ops2.c2803
-rw-r--r--hw/xfree86/x86emu/prim_ops.c2914
-rw-r--r--hw/xfree86/x86emu/sys.c603
-rw-r--r--hw/xfree86/x86emu/validate.c765
-rw-r--r--hw/xfree86/x86emu/x86emu.h194
-rw-r--r--hw/xfree86/x86emu/x86emu/debug.h211
-rw-r--r--hw/xfree86/x86emu/x86emu/decode.h89
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu.h61
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu_regs.h115
-rw-r--r--hw/xfree86/x86emu/x86emu/ops.h45
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_asm.h971
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_ops.h231
-rw-r--r--hw/xfree86/x86emu/x86emu/regs.h334
-rw-r--r--hw/xfree86/x86emu/x86emu/types.h106
-rw-r--r--hw/xfree86/x86emu/x86emu/x86emui.h105
-rw-r--r--hw/xfree86/xaa/XAA.HOWTO1427
-rw-r--r--hw/xfree86/xaa/xaa.h1362
-rw-r--r--hw/xfree86/xaa/xaaBitBlt.c219
-rw-r--r--hw/xfree86/xaa/xaaBitOrder.c13
-rw-r--r--hw/xfree86/xaa/xaaBitmap.c475
-rw-r--r--hw/xfree86/xaa/xaaCpyArea.c385
-rw-r--r--hw/xfree86/xaa/xaaCpyPlane.c206
-rw-r--r--hw/xfree86/xaa/xaaCpyWin.c80
-rw-r--r--hw/xfree86/xaa/xaaDashLine.c329
-rw-r--r--hw/xfree86/xaa/xaaFallback.c352
-rw-r--r--hw/xfree86/xaa/xaaFillArc.c213
-rw-r--r--hw/xfree86/xaa/xaaFillPoly.c956
-rw-r--r--hw/xfree86/xaa/xaaFillRect.c1093
-rw-r--r--hw/xfree86/xaa/xaaGC.c653
-rw-r--r--hw/xfree86/xaa/xaaGCmisc.c426
-rw-r--r--hw/xfree86/xaa/xaaImage.c520
-rw-r--r--hw/xfree86/xaa/xaaInit.c762
-rw-r--r--hw/xfree86/xaa/xaaInitAccel.c1513
-rw-r--r--hw/xfree86/xaa/xaaLine.c390
-rw-r--r--hw/xfree86/xaa/xaaLineMisc.c148
-rw-r--r--hw/xfree86/xaa/xaaNonTEGlyph.c198
-rw-r--r--hw/xfree86/xaa/xaaNonTEText.c588
-rw-r--r--hw/xfree86/xaa/xaaOffscreen.c160
-rw-r--r--hw/xfree86/xaa/xaaOverlay.c306
-rw-r--r--hw/xfree86/xaa/xaaOverlayDF.c1154
-rw-r--r--hw/xfree86/xaa/xaaPCache.c2366
-rw-r--r--hw/xfree86/xaa/xaaPaintWin.c198
-rw-r--r--hw/xfree86/xaa/xaaPict.c683
-rw-r--r--hw/xfree86/xaa/xaaROP.c164
-rw-r--r--hw/xfree86/xaa/xaaRect.c134
-rw-r--r--hw/xfree86/xaa/xaaSpans.c880
-rw-r--r--hw/xfree86/xaa/xaaStateChange.c1677
-rw-r--r--hw/xfree86/xaa/xaaStipple.c843
-rw-r--r--hw/xfree86/xaa/xaaTEGlyph.c1072
-rw-r--r--hw/xfree86/xaa/xaaTEGlyphBlt.S964
-rw-r--r--hw/xfree86/xaa/xaaTEText.c293
-rw-r--r--hw/xfree86/xaa/xaaTables.c88
-rw-r--r--hw/xfree86/xaa/xaaWideLine.c941
-rw-r--r--hw/xfree86/xaa/xaacexp.h124
-rw-r--r--hw/xfree86/xaa/xaalocal.h1756
-rw-r--r--hw/xfree86/xaa/xaarop.h307
-rw-r--r--hw/xfree86/xaa/xaawrap.h78
-rw-r--r--hw/xfree86/xf1bpp/mfbmap.h109
-rw-r--r--hw/xfree86/xf1bpp/mfbmap.sh25
-rw-r--r--hw/xfree86/xf1bpp/mfbmodule.c48
-rw-r--r--hw/xfree86/xf1bpp/mfbunmap.h109
-rw-r--r--hw/xfree86/xf1bpp/mfbunmap.sh23
-rw-r--r--hw/xfree86/xf1bpp/xf1bpp.h37
-rw-r--r--hw/xfree86/xf4bpp/NOTES194
-rw-r--r--hw/xfree86/xf4bpp/OScompiler.h57
-rw-r--r--hw/xfree86/xf4bpp/emulOpStip.c100
-rw-r--r--hw/xfree86/xf4bpp/emulRepAre.c67
-rw-r--r--hw/xfree86/xf4bpp/emulTile.c352
-rw-r--r--hw/xfree86/xf4bpp/ibmTrace.h10
-rw-r--r--hw/xfree86/xf4bpp/mfbbres.c162
-rw-r--r--hw/xfree86/xf4bpp/mfbbresd.c203
-rw-r--r--hw/xfree86/xf4bpp/mfbfillarc.c299
-rw-r--r--hw/xfree86/xf4bpp/mfbhrzvert.c133
-rw-r--r--hw/xfree86/xf4bpp/mfbimggblt.c501
-rw-r--r--hw/xfree86/xf4bpp/mfbline.c982
-rw-r--r--hw/xfree86/xf4bpp/mfbzerarc.c266
-rw-r--r--hw/xfree86/xf4bpp/offscreen.c359
-rw-r--r--hw/xfree86/xf4bpp/ppcArea.c95
-rw-r--r--hw/xfree86/xf4bpp/ppcBStore.c153
-rw-r--r--hw/xfree86/xf4bpp/ppcCReduce.c236
-rw-r--r--hw/xfree86/xf4bpp/ppcClip.c153
-rw-r--r--hw/xfree86/xf4bpp/ppcCpArea.c494
-rw-r--r--hw/xfree86/xf4bpp/ppcDepth.c52
-rw-r--r--hw/xfree86/xf4bpp/ppcFillRct.c221
-rw-r--r--hw/xfree86/xf4bpp/ppcGC.c458
-rw-r--r--hw/xfree86/xf4bpp/ppcGCstr.h95
-rw-r--r--hw/xfree86/xf4bpp/ppcGetSp.c139
-rw-r--r--hw/xfree86/xf4bpp/ppcIO.c252
-rw-r--r--hw/xfree86/xf4bpp/ppcImg.c118
-rw-r--r--hw/xfree86/xf4bpp/ppcPixFS.c502
-rw-r--r--hw/xfree86/xf4bpp/ppcPixmap.c144
-rw-r--r--hw/xfree86/xf4bpp/ppcPntWin.c218
-rw-r--r--hw/xfree86/xf4bpp/ppcPolyPnt.c141
-rw-r--r--hw/xfree86/xf4bpp/ppcPolyRec.c127
-rw-r--r--hw/xfree86/xf4bpp/ppcQuery.c44
-rw-r--r--hw/xfree86/xf4bpp/ppcRslvC.c176
-rw-r--r--hw/xfree86/xf4bpp/ppcSetSp.c315
-rw-r--r--hw/xfree86/xf4bpp/ppcSpMcro.h45
-rw-r--r--hw/xfree86/xf4bpp/ppcWinFS.c278
-rw-r--r--hw/xfree86/xf4bpp/ppcWindow.c224
-rw-r--r--hw/xfree86/xf4bpp/vgaBitBlt.c763
-rw-r--r--hw/xfree86/xf4bpp/vgaGC.c216
-rw-r--r--hw/xfree86/xf4bpp/vgaImages.c457
-rw-r--r--hw/xfree86/xf4bpp/vgaReg.h136
-rw-r--r--hw/xfree86/xf4bpp/vgaSolid.c569
-rw-r--r--hw/xfree86/xf4bpp/vgaStipple.c715
-rw-r--r--hw/xfree86/xf4bpp/vgaVideo.h92
-rw-r--r--hw/xfree86/xf4bpp/vgamodule.c57
-rw-r--r--hw/xfree86/xf4bpp/wm3.c207
-rw-r--r--hw/xfree86/xf4bpp/wm3.h77
-rw-r--r--hw/xfree86/xf4bpp/xf4bpp.h804
-rw-r--r--hw/xfree86/xf8_16bpp/cfb8_16.h69
-rw-r--r--hw/xfree86/xf8_16bpp/cfb8_16module.c37
-rw-r--r--hw/xfree86/xf8_16bpp/cfbscrinit.c370
-rw-r--r--hw/xfree86/xf8_16bpp/cfbwindow.c177
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32.h226
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32module.c38
-rw-r--r--hw/xfree86/xf8_32bpp/cfbbstore.c102
-rw-r--r--hw/xfree86/xf8_32bpp/cfbcpyarea.c540
-rw-r--r--hw/xfree86/xf8_32bpp/cfbcpyplane.c39
-rw-r--r--hw/xfree86/xf8_32bpp/cfbgc.c663
-rw-r--r--hw/xfree86/xf8_32bpp/cfbgcmisc.c146
-rw-r--r--hw/xfree86/xf8_32bpp/cfbgcunder.c636
-rw-r--r--hw/xfree86/xf8_32bpp/cfbimage.c168
-rw-r--r--hw/xfree86/xf8_32bpp/cfbpntwin.c177
-rw-r--r--hw/xfree86/xf8_32bpp/cfbscrinit.c309
-rw-r--r--hw/xfree86/xf8_32bpp/cfbwindow.c116
-rw-r--r--hw/xfree86/xf8_32bpp/xf86overlay.c1258
-rw-r--r--hw/xfree86/xf8_32wid/cfb8_32wid.h93
-rw-r--r--hw/xfree86/xf8_32wid/cfb8_32widmodule.c46
-rw-r--r--hw/xfree86/xf8_32wid/cfbscrinit.c382
-rw-r--r--hw/xfree86/xf8_32wid/cfbwid.c147
-rw-r--r--hw/xfree86/xf8_32wid/cfbwindow.c284
-rw-r--r--hw/xnest/XNCursor.h38
-rw-r--r--hw/xnest/XNPixmap.h44
-rw-r--r--hw/xnest/os2Stub.c387
-rw-r--r--hw/xwin/InitInput.c148
-rw-r--r--hw/xwin/InitOutput.c1261
-rw-r--r--hw/xwin/X.icobin0 -> 4710 bytes
-rw-r--r--hw/xwin/XWin.man129
-rw-r--r--hw/xwin/XWin.rc60
-rw-r--r--hw/xwin/ddraw.h2094
-rw-r--r--hw/xwin/win.h1427
-rw-r--r--hw/xwin/winallpriv.c181
-rw-r--r--hw/xwin/winblock.c76
-rw-r--r--hw/xwin/winclip.c40
-rw-r--r--hw/xwin/winclipboard.h158
-rw-r--r--hw/xwin/winclipboardinit.c117
-rw-r--r--hw/xwin/winclipboardtextconv.c153
-rw-r--r--hw/xwin/winclipboardthread.c463
-rw-r--r--hw/xwin/winclipboardunicode.c68
-rw-r--r--hw/xwin/winclipboardwndproc.c86
-rw-r--r--hw/xwin/winclipboardxevents.c722
-rw-r--r--hw/xwin/wincmap.c631
-rw-r--r--hw/xwin/winconfig.c949
-rw-r--r--hw/xwin/winconfig.h332
-rw-r--r--hw/xwin/wincreatewnd.c541
-rw-r--r--hw/xwin/wincursor.c84
-rw-r--r--hw/xwin/winengine.c309
-rw-r--r--hw/xwin/winerror.c73
-rw-r--r--hw/xwin/winfillsp.c537
-rw-r--r--hw/xwin/winfont.c50
-rw-r--r--hw/xwin/wingc.c418
-rw-r--r--hw/xwin/wingetsp.c164
-rw-r--r--hw/xwin/winkeybd.c707
-rw-r--r--hw/xwin/winkeybd.h398
-rw-r--r--hw/xwin/winmisc.c147
-rw-r--r--hw/xwin/winmouse.c295
-rw-r--r--hw/xwin/winms.h61
-rw-r--r--hw/xwin/winmsg.c119
-rw-r--r--hw/xwin/winmsg.h72
-rw-r--r--hw/xwin/winmultiwindowwindow.c1574
-rw-r--r--hw/xwin/winmultiwindowwm.c907
-rw-r--r--hw/xwin/winnativegdi.c454
-rw-r--r--hw/xwin/winpfbdd.c636
-rw-r--r--hw/xwin/winpixmap.c206
-rw-r--r--hw/xwin/winpntwin.c45
-rw-r--r--hw/xwin/winpolyline.c43
-rw-r--r--hw/xwin/winregistry.c66
-rw-r--r--hw/xwin/winscrinit.c739
-rw-r--r--hw/xwin/winsetsp.c344
-rw-r--r--hw/xwin/winshaddd.c1362
-rw-r--r--hw/xwin/winshadddnl.c1288
-rw-r--r--hw/xwin/winshadgdi.c1158
-rw-r--r--hw/xwin/winwakeup.c57
-rw-r--r--hw/xwin/winwindow.c463
-rw-r--r--hw/xwin/winwindow.h118
-rw-r--r--hw/xwin/winwndproc.c1131
668 files changed, 357023 insertions, 0 deletions
diff --git a/hw/darwin/XDarwin.man b/hw/darwin/XDarwin.man
new file mode 100644
index 000000000..a718e41ce
--- /dev/null
+++ b/hw/darwin/XDarwin.man
@@ -0,0 +1,205 @@
+.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.4 2002/01/09 18:01:58 torrey Exp $
+.\"
+.TH XDARWIN 1 __vendorversion__
+.SH NAME
+XDarwin \- X window system server for Darwin operating system
+.SH SYNOPSIS
+.B XDarwin
+[ options ] ...
+.SH DESCRIPTION
+#ifdef DARWIN_WITH_QUARTZ
+.I XDarwin
+is the X window server for Mac OS X and the Darwin operating system
+provided by the XFree86 Project.
+.I XDarwin
+can run in three different modes. On Mac OS X,
+.I XDarwin
+runs in parallel with Aqua in full screen or rootless modes. These modes
+are called Quartz modes, named after the Quartz 2D compositing engine used
+by Aqua. XDarwin can also be run from the Darwin text console in IOKit mode.
+.PP
+When running from the console,
+.I XDarwin
+acts as the window server and uses IOKit services to access the display
+framebuffer, mouse and keyboard and to provide a layer of hardware
+abstraction. In console mode,
+.I XDarwin
+will normally be started by the \fIxdm(1)\fP display manager or by a script
+that runs the program \fIxinit(1)\fP.
+.PP
+When running with the Mac OS X Aqua GUI,
+.I XDarwin
+will normally be started by launching from the Finder, but it may also be
+started from the command line with the \fB\-quartz\fP, \fB\-fullscreen\fP, or
+\fB\-rootless\fP options. Note that the defaults for various command line
+options are set by the
+.I XDarwin
+application preferences in the Quartz modes.
+.PP
+In full screen Quartz mode, when the X Window System is active, it takes over
+the entire screen. CoreGraphics is used to capture and draw to the screen. The
+.I XDarwin
+application allows easy switching between the Mac OS X and X window
+desktops. More information is available in the Help menu of the
+.I XDarwin
+application.
+.PP
+In rootless mode, the X window system and Aqua share your display. The root
+window of the X11 display is the size of the screen and contains all the
+other windows. The X11 root window is not displayed in rootless mode as Aqua
+handles the desktop background.
+#else
+.I XDarwin
+is the X window server for Mac OS X and the Darwin operating system
+provided by the XFree86 Project. This version of
+.I XDarwin
+can only be started from the Darwin text console. The Mac OS X Aqua GUI, if
+present, must be shut down.
+.I XDarwin
+uses IOKit services to access the display
+framebuffer, mouse and keyboard and to provide a layer of hardware
+abstraction.
+.I XDarwin
+will normally be started by the \fIxdm(1)\fP display manager or by a script
+that runs the program \fIxinit(1)\fP.
+#endif
+.SH OPTIONS
+.PP
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXDarwin\fP accepts the following command line switches:
+.TP 8
+.B \-fakebuttons
+Emulates a 3 button mouse using modifier keys. By default, the Command modifier
+is used to emulate button 2 and Option is used for button 3. Thus, clicking the
+first mouse button while holding down Command will act like clicking
+button 2. Holding down Option will simulate button 3.
+.TP 8
+.B \-nofakebuttons
+Do not emulate a 3 button mouse. This is the default.
+.TP 8
+.B "\-fakemouse2 \fImodifiers\fP"
+Change the modifier keys used to emulate the second mouse button. By default,
+Command is used to emulate the second button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse2 """Option,Shift""
+will set holding Option, Shift and clicking on button one as equivalent to
+clicking the second mouse button.
+.TP 8
+.B "\-fakemouse3 \fImodifiers\fP"
+Change the modifier keys used to emulate the third mouse button. By default,
+Option is used to emulate the third button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse3 """Control,Shift""
+will set holding Control, Shift and clicking on button one as equivalent to
+clicking the third mouse button.
+.TP 8
+.B "\-keymap \fIfile\fP"
+On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap.
+The default is to read this keymapping from USA.keymapping. With this option
+the keymapping will be read from \fIfile\fP instead. If the file's path is
+not specified, it will be searched for in Library/Keyboards/ underneath the
+following directories (in order): ~, /, /Network, /System.
+.TP 8
+.B \-nokeymap
+On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap.
+With this option XDarwin queries the kernel for the current keymapping
+instead of reading it from a file. This will often fail on newer kernels.
+#ifdef DARWIN_WITH_QUARTZ
+.TP 8
+.B "\-size \fIwidth\fP \fIheight\fP"
+Sets the screen resolution for the X server to use.
+Ignored in rootless mode.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
+per pixel are supported.
+Ignored in rootless mode.
+.TP 8
+.B "\-refresh \fIrate\fP"
+Gives the refresh rate to use in Hz. For LCD displays this should be 0.
+Ignored in rootless mode.
+.TP 8
+.B \-fullscreen
+Run full screen in parallel with Mac OS X Aqua GUI.
+.TP 8
+.B \-rootless
+Run rootless inside Mac OS X Aqua GUI.
+.TP 8
+.B \-quartz
+Run in parallel with the Mac OS X Aqua GUI using the default mode.
+#else
+.TP 8
+.B "\-size \fIwidth\fP \fIheight\fP"
+Sets the screen resolution for the X server to use.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits
+per pixel are supported.
+.TP 8
+.B "\-refresh \fIrate\fP"
+Gives the refresh rate to use in Hz. For LCD displays this should be 0.
+#endif
+.TP 8
+.B \-showconfig
+Print out the server version and patchlevel.
+.TP 8
+.B \-version
+Same as \fB\-showconfig\fP.
+.SH "SEE ALSO"
+.PP
+X(__miscmansuffix__), XFree86(1), Xserver(1), xdm(1), xinit(1)
+.SH BUGS
+.I XDarwin
+and this man page still have many limitations. Some of the more obvious
+ones are:
+.br
+- The display mode cannot be changed once the X server has started.
+.br
+- A screen saver is not supported.
+.PP
+.SH AUTHORS
+XFree86 was originally ported to Mac OS X Server by John Carmack. Dave
+Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0.
+Torrey T. Lyons improved and integrated this code into the XFree86
+Project's mainline for the 4.0.2 release.
+.PP
+The following members of the XonX Team contributed to the following
+releases (in alphabetical order):
+.TP 4
+XFree86 4.1.0:
+.br
+Rob Braun - Darwin x86 support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - Cocoa version of XDarwin front end
+.br
+Gregory Robert Parker - Original Quartz implementation
+.br
+Christoph Pfisterer - Dynamic shared X libraries
+.br
+Toshimitsu Tanaka - Japanese localization
+.TP 4
+XFree86 4.2.0:
+.br
+Rob Braun - Darwin x86 support
+.br
+Pablo Di Noto - Spanish localization
+.br
+Paul Edens - Dutch localization
+.br
+Kyunghwan Kim - Korean localization
+.br
+Mario Klebsch - Non-US keyboard support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - German localization
+.br
+Patrik Montgomery - Swedish localization
+.br
+Greg Parker - Rootless support
+.br
+Toshimitsu Tanaka - Japanese localization
+.br
+Olivier Verdier - French localization
diff --git a/hw/darwin/bundle/Dutch.lproj/Credits.rtf b/hw/darwin/bundle/Dutch.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Dutch.lproj/Localizable.strings b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
new file mode 100644
index 000000000..22d7683eb
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..034396156
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..e7ca52c2c
--- /dev/null
+++ b/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Dutch.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/19 01:21:32 torrey Exp $ --> #include "xf86Version.h" #ifndef PRE_RELEASE #define PRE_RELEASE XF86_VERSION_SNAP #endif <html> <head> <title>XFree86 voor Mac OS X</title> </head> <body> <center> <h1>XFree86 voor Darwin en Mac OS X</h1> XFree86 XF86_VERSION<br> Release Date: XF86_REL_DATE </center> <h2>Inhoud</h2> <ol> <li><A HREF="#notice">Belangrijke Informatie</A></li> <li><A HREF="#usage">Gebruik</A></li> <li><A HREF="#path">Instellen van het Path</A></li> <li><A HREF="#prefs">Voorkeursinstellingen</A></li> <li><A HREF="#license">Licentie</A></li> </ol> <center> <h2><a NAME="notice">Belangrijke Informatie</a></h2> </center> <blockquote> #if PRE_RELEASE Dit is een pre-release van XFree86, waarvoor geen ondersteuning beschikbaar is. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. Kijk alvorens een bug te rapporteren in een pre-release eerst of een nieuwe versie beschikbaar is bij <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> of in de <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>. #else Als de server ouder is dan 6-12 maanden, of als uw hardware nieuwer is dan de bovenstaande datum, kijk dan of een nieuwe versie beschikbaar is voor u een probleem aanmeldt. Rapporteren van bugs en aanleveren van patches kan op de <A HREF="http://sourceforge.net/projects/xonx/">XonX project pagina</A> bij SourceForge. #endif </blockquote> <blockquote> Deze software is beschikbaar gesteld onder de voorwaarden van de <A HREF="#license">MIT X11 / X Consortium Licentie</A> en is beschikbaar 'AS IS',zonder enige garantie. Lees s.v.p. de <A HREF="#license">Licentie</A> voor gebruik.</blockquote> <h2><a NAME="usage">Gebruik</a></h2> <p>XFree86 is een open-source uitvoering van het <a HREF="http://www.x.org/">X Window Systeem</a>, verzorgd door <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a>, die vrij verspreid mag worden. De X window server voor Darwin en Mac OS X verzorgd door XFree86 heet XDarwin. XDarwin werkt op Mac OS X in schermvullende of rootless modus.</p> <p>Het X window systeem in schermvullende modus neemt het hele beeldscherm in beslag. U schakelt terug naar de Mac OS X desktop door de toesten Command-Option-A in te drukken. Deze toetsencombinatie kunt u veranderen in de Voorkeuren. Op de Mac OS X desktop klikt u op de XDarwin icoon in de Dock om weer naar het X window systeem te schakelen. (In de Voorkeuren kunt er voor kiezen om een apart XDarwin schakelpaneel te gebruiken op de Mac OS X desktop.)</p> <p>In rootless modus verschijnen het X window systeem en Aqua (de Mac OS X desktop) tegelijk op het scherm. Het achtergrondscherm van X11, waarbinnen alle X11 vensters vallen, is net zo groot als het gehele scherm, maar het achtergrondscherm zelf is onzichtbaar.</p> <h3>Meerknopsmuis emulatie</h3> <p>Voor veel X11 programma's hebt u een 3-knops muis nodig. Met een 1-knops muis kunt u een 3-knops muis nabootsen door een toets in te drukken terwijl u klikt met de muis. Het instellen hiervan kan bij Voorkeuren, "Meerknopsmuis emulatie" in "Algemeen". Emulatie is standaard ingeschakeld: ingedrukt houden van de "command" toets terwijl u klikt emuleert knop 2, ingedrukt houden van "option" emuleert knop 3. Deze toetsen kunt u dus wijzigen in de Voorkeuren. Let op: als u xmodmap gebruikt om de indeling van het toetsenbord te wijzigen, moet u toch de oorspronkelijke toetsen op het toetsenbord gebruiken voor deze functie.</p> <h2><a NAME="path">Instellen van het Path</a></h2> <p>Het path is de lijst van directories waarin gezocht wordt naar commando's. De X11 commando's staan in de directory <code>/usr/X11R6/bin</code>, die dus aan uw path moet worden toegevoegd. XDarwin doet dit automatisch voor u en kan extra directories toevoegen waarin u commando's hebt ge&iuml;nstalleerd.</p> <p>Ervaren gebruikers zullen het path al correct hebben ingesteld in de configuratiebestanden voor hun shell. In dat geval kunt u XDarwin via de Voorkeuren vertellen het path niet te wijzigen. XDarwin start de eerste X11 clients binnen de standaard login shell van de gebruiker (bij de Voorkeuren kunt u een afwijkende shell opgeven). Het instellen van het path is afhankelijk van de shell. Zie hiervoor de man pages voor de shell.</p> <p>Het kan handig zijn de man pages voor XFree86 toe te voegen aan de lijst waarin gezocht wordt als u documentatie opvraagt. De manualpages voor X11 staan in <code>/usr/X11R6/man</code> en de <code>MANPATH</code> environment variable bevat de lijst van directories waarin naar documentatie wordt gezocht.</p> <h2><a NAME="prefs">Voorkeursinstellingen</a></h2> <p>Een aantal instellingen kan worden gewijzigd door "Voorkeuren..." te kiezen in het "XDarwin" menu. Wijzigingen van de instellingen genoemd onder "Start" gaan pas in als u XDarwin opnieuw hebt gestart. Een wijziging van de overige instellingen is direct effectief. Hier onder vindt u de verschillende mogelijkheden beschreven:</p> <h3>Algemeen</h3> <ul> <li><b>Gebruik systeempiep voor X11:</b> Als u dit inschakelt wordt het Mac OS X waarschuwingssignaal ook gebruikt door X11, anders gebruikt X11 een simpele pieptoon (dit is de standaardinstelling).</li> <li><b>Wijzigen muis-versnelling door X11 mogelijk:</b> In een standaard X window systeem kan de window manager de muis-versnelling aanpassen. Dit kan verwarrend zijn omdat de snelheid onder X11 dan verschillend kan zijn van de snelheid die u in Mac OS X bij Systeemvoorkeuren hebt ingesteld. Om verwarring te voorkomen is de standaardinstelling dat X11 de versnelling niet kan wijzigen.</li> <li><b>Meerknopsmuis emulatie:</b> Dit is hierboven beschreven bij <a HREF="#usage">Gebruik</a>. Als emulatie is ingeschakeld moet u de gekozen toetsen ingedrukt houden terwijl u met de muis klikt om de tweede en derde muisknop na te bootsen.</li> </ul> <h3>Start</h3> <ul> <li><b>Standaard modus:</b> Hier kiest u de standaard scherm-modus: schermvullend of rootless (hierboven beschreven bij <a HREF="#usage">Gebruik</a>). U kunt ook kiezen tijdens het starten van XDarwin, zie de optie hieronder.</li> <li><b>Kies scherm-modus tijdens start:</b> Dit is standaard ingeschakeld zodat u tijdens het starten van XDarwin kunt kiezen tussen schermvullend en rootless scherm-modus. Als u dit uitschakelt start XDarwin in de standaard modus zonder u iets te vragen.</li> <li><b>X11 scherm nummer:</b> Met X11 kunnen meerdere schermen worden aangestuurd door verschillende X servers op dezelfde computer. Als u meerdere X servers tegelijk wilt gebruiken stelt u hier het scherm nummer in dat door XDarwin wordt gebruikt.</li> <li><b>Xinerama multi-monitor ondersteuning mogelijk:</b> XDarwin ondersteunt het gebruik van meerdere monitoren met Xinerama, waarbij elke monitor wordt gezien als deel van &eacute;&eacute;n groot rechthoekig scherm. U kunt Xinerama hier uitschakelen, maar XDarwin werkt op dit moment zonder Xinerama niet goed met meerdere monitoren. Als u maar 1 monitor gebruikt is deze instelling automatisch uitgeschakeld.</li> <li><b>Toetsenbordindeling-bestand:</b> Een toetsenbordindeling-bestand wordt bij het starten geladen en omgezet naar een X11 toetsenbordindeling. Voor verschillende talen vindt u toetsenbordindelingen in de directory <code>/System/Library/Keyboards</code>.</li> <li><b>Bij starten eerste X11 clients:</b> Als XDarwin start, wordt <code>xinit</code> uitgevoerd om de X window manager en andere X clients te starten (zie "<code>man xinit</code>"). Voordat XDarwin <code>xinit</code> uitvoert voegt het de opgegeven directories toe aan het path. Standaard wordt alleen <code>/usr/X11R6/bin</code> toegevoegd. U kunt meerdere directories opgeven, gescheiden door een dubbelepunt. X clients worden gestart met de standaard login shell van de gebruiker met gebruik van de configuratiebestanden voor die shell. U kunt een afwijkende shell opgeven.</li> </ul> <h3>Schermvullend</h3> <ul> <li><b>Toetscombinatie knop:</b> Klik op deze knop om de toetscombinatie te wijzigen waarmee u tussen de Mac OS X desktop en X11 schakelt. Als toetscombinatie kunt u elke combinatie gebruiken van de shift, control, command en option toetsen samen met &eacute;&eacute;n normale toets.</li> <li><b>Klikken op icoon in Dock schakelt naar X11:</b> Hiermee is een klik op de XDarwin icoon in de Dock voldoende om naar X11 te schakelen. In sommige versies van Mac OS X verdwijnt soms de cursor als u deze mogelijkheid gebruikt en daarna terugkeert naar de Mac OS X desktop.</li> <li><b>Toon help bij schermvullend starten:</b> Hiermee wordt een inleidend scherm getoond als XDarwin schermvullend start.</li> <li><b>Kleurdiepte:</b> In de schermvullende modus kan X11 een andere kleurdiepte gebruiken dan Aqua (en de Mac OS X desktop). Als u "Huidig" kiest, neemt XDarwin bij het starten de kleurdiepte over van Aqua. U kunt ook kiezen voor 8, 15 of 24 bits.</li> </ul> <h2><a NAME="license">Licentie</a></h2> The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86 License page</A>. <H3><A NAME="3"></A>X Consortium License</H3> <p>Copyright (C) 1996 X Consortium</p> <p>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:</p> <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> <p>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 X CONSORTIUM 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.</p> <p>Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium.</p> <p>X Window System is a trademark of X Consortium, Inc.</p> </body> </html> \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/Credits.rtf b/hw/darwin/bundle/English.lproj/Credits.rtf
new file mode 100644
index 000000000..4e2fad42c
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/Credits.rtf
@@ -0,0 +1,138 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2.99.x:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Fabr\'92cio Luis de Castro\
+
+\f2\i Portuguese localization
+\f1\i0 \
+Michael Oland\
+
+\f2\i New XDarwin icon
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp b/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
new file mode 100644
index 000000000..99211244e
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp
@@ -0,0 +1,5 @@
+/* English versions of the Info.plist keys; used by most localizations. */
+/* Most of these are set in the target application settings. */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.4 2003/01/15 02:34:04 torrey Exp $ */
+
+NSHumanReadableCopyright = __quote__XFree86 XF86_VERSION\nCopyright 2003 XFree86 Project, Inc.__quote__;
diff --git a/hw/darwin/bundle/English.lproj/Localizable.strings b/hw/darwin/bundle/English.lproj/Localizable.strings
new file mode 100644
index 000000000..6025a2469
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/Localizable.strings
@@ -0,0 +1,23 @@
+/* English localized versions of strings used by the Mac OS X front end. */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.3 2002/01/30 06:50:46 torrey Exp $ */
+
+/* Title of alert panel */
+"Quit X server?" = "Quit X server?";
+
+/* Text of alert panel */
+"Quitting the X server will terminate any running X Window System programs." = "Quitting the X server will terminate any running X Window System programs.";
+
+/* Quit */
+"Quit" = "Quit";
+
+/* Cancel */
+"Cancel" = "Cancel";
+
+/* Default keymapping file */
+"USA.keymapping" = "USA.keymapping"
+
+/* Default switch string */
+"Cmd-Opt-a" = "Cmd-Opt-a"
+
+/* Button title when changing switch key */
+"Press key" = "Press key"
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..7aedf01c2
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..fc11e26d3
--- /dev/null
+++ b/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,103 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/04 07:02:28 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 for Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Contents</h2>
+<ol>
+ <li><A HREF="#notice">Important Notice</A></li>
+ <li><A HREF="#usage">Usage</A></li>
+ <li><A HREF="#path">Setting Your Path</A></li>
+ <li><A HREF="#prefs">User Preferences</A></li>
+ <li><A HREF="#license">License</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Important Notice</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
+#else
+If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
+#endif
+</blockquote>
+<blockquote>
+This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
+
+<h2><a NAME="usage">Usage</a></h2>
+<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
+="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> The X window server for Darwin and Mac OS X provided by XFree86 is called XDarwin. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
+<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
+<p>In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.</p>
+<h3>Multi-Button Mouse Emulation</h3>
+<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
+
+<h2><a NAME="path">Setting Your Path</a></h2>
+<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
+<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
+<p>In addition you may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
+
+<h2><a NAME="prefs">User Preferences</a></h2>
+<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
+<h3>General</h3>
+<ul>
+ <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
+ <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
+ <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
+</ul>
+<h3>Start Up</h3>
+<ul>
+ <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
+ <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
+ <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
+ <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
+ <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
+</ul>
+<h3>Full Screen</h3>
+<ul>
+ <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
+ <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
+ <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
+ <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
+</ul>
+
+<h2><a NAME="license">License</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>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:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>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 X CONSORTIUM 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.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/French.lproj/Credits.rtf b/hw/darwin/bundle/French.lproj/Credits.rtf
new file mode 100644
index 000000000..5e52d1177
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/Credits.rtf
@@ -0,0 +1,123 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 Participants \'88 XonX pour XFree86 4.2 :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Version pour Darwin x86
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Traduction en espagnol
+\f1\i0 \
+Paul Edens\
+
+\f2\i Traduction en allemand
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Traduction en cor\'8een
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Claviers non-US
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Direction du projet
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Traduction en allemand
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Traduction en su\'8edois
+\f1\i0 \
+Greg Parker\
+
+\f2\i Version \'c7 rootless \'c8
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Traduction en japonais
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i Traduction en fran\'8dais
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Remerciements :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman et Zero G Software, Inc.\
+
+\f2\i Installeur
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Participants \'88 XonX pour XFree86 4.2 :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Version pour Darwin x86
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Direction du projet
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Version Cocoa de l'interface de XDarwin
+\f1\i0 \
+Greg Parker\
+
+\f2\i Impl\'8ementation initiale sur Quartz
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Librairies partag\'8ees dynamiquement
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Traduction en japonais
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Remerciements :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+ Ic\'99ne
+\f2\i XDarwin
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Historique :
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Premi\'8fre adaptation de XFree86 sur Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i Adaptation de Free86 4.0 pour Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Int\'8egration dans le projet XFree86 pour la version 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/French.lproj/Localizable.strings b/hw/darwin/bundle/French.lproj/Localizable.strings
new file mode 100644
index 000000000..591f73cae
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..ef15f00f1
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..0fdfb01fb
--- /dev/null
+++ b/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,107 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/French.lproj/XDarwinHelp.html.cpp,v 1.2 2001/12/20 06:42:20 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
+<title>XFree86 pour Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 pour Darwin et Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Date : XF86_REL_DATE
+</center>
+<h2>Sommaire</h2>
+<ol>
+ <li><A HREF="#notice">Avertissement</A></li>
+ <li><A HREF="#usage">Utilisation</A></li>
+ <li><A HREF="#path">Chemins d'accès</A></li>
+ <li><A HREF="#prefs">Préférences</A></li>
+ <li><A HREF="#license">Licence</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Avertissement</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+Ceci est une pré-version de XFree86 et ne fait par conséquent l'objet d'aucun support client. Les bogues peuvent être signalés et des patches peuvent être soumis sur la
+<A HREF="http://sourceforge.net/projects/xonx/">page du projet XonX</A> chez SourceForge. Veuillez prendre connaissance de la dernière version sur <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ou sur le <A HREF="http://www.XFree86.Org/cvs">répertoire CVS de XFree86</A> avant de signaler un bogue d'une pré-version.
+#else
+Si le serveur date de plus de 6-12 mois ou si votre matériel est plus récent que la date indiquée ci-dessus, veuillez vous procurer une version plus récente avant de signaler toute anomalie. Les bogues peuvent être signalés et des patches peuvent être soumis sur la <A HREF="http://sourceforge.net/projects/xonx/">page du projet XonX</A> chez SourceForge.
+#endif
+</blockquote>
+<blockquote>
+Ce logiciel est distribué sous la
+<A HREF="#license">Licence du Consortium X/X11 du MIT</A> et est fourni TEL QUEL, sans garanties. Veuillez prendre connaissance de la <A HREF="#license">Licence</A> avant toute utilisation.</blockquote>
+
+<h2><a NAME="usage">Utilisation</a></h2>
+<p>XFree86 est une implémentation libre et distribuable sans contrainte du <a HREF
+="http://www.x.org/">X Window System</a> produit par <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> Le serveur X window pour Darwin et Mac OS X fourni par XFree86 se nomme XDarwin. XDarwin fonctionne sous Mac OS X en mode « rootless » ou plein écran.</p>
+<p>Lorsque le système X window est actif en mode plein écran, il prend en charge la totalité de l'écran. Il est possible de revenir sur le bureau de Mac OS X en appuyant sur Commande-Option-A. Cette combinaison de touches peut être modifiée dans les préférences. Pour revenir dans X window, cliquer sur l'icône de XDarwin dans le Dock de Mac OS X. (Un réglage des préférences permet d'effectuer cette opération en cliquant dans une fenêtre flottante au lieu de l'icône du Dock)</p>
+<p>En mode « rootless », X window system et Aqua utilisent le même affichage. La fenêtre-mère de l'affichage X11 est de la taille de l'écran et contient toutes les autre fenêtres. En mode « rootless » cette fenêtre-mère n'est pas affichée car Aqua gère le fond d'écran.</p>
+<h3>Émulation de souris à plusieurs boutons</h3>
+<p>Le fonctionnement de la plupart des applications X11 repose sur l'utilisation d'une souris à 3 boutons. Il est possible d'émuler une souris à 3 boutons avec un seul bouton en appuyant sur des touches de modification. Ceci est réglé dans la section "Émulation de souris à plusieurs boutons" de l'onglet "Général" des préférences. L'émulation est activée par défaut. Dans ce cas, cliquer en appuyant simultanément sur la touche "commande" simulera le bouton du milieu. Cliquer en appuyant simultanément sur la touche "option" simulera le bouton de droite. Les préférences permettent de régler n'importe quelle combinaison de touches de modification pour émuler les boutons du milieu et de droite. Notez que même si les touches de modifications sont mises en correspondance avec d'autres touches par xmodmap, ce sont les touches originelles spécifiées dans les préférences qui assureront l'émulation d'une souris à plusieurs boutons.
+
+<h2><a NAME="path">Réglage du chemin d'accès</a></h2>
+<p>Le chemin d'accès est une liste de répertoires utilisés pour la recherche d'exécutables. Les commandes X11 sont situées dans <code>/usr/X11R6/bin</code>, qui doit être ajouté à votre chemin d'accès. XDarwin fait cela par défaut, et peut également ajouter d'autres répertoires dans lesquels vous auriez installé d'autre commandes unix.</p>
+<p>Les utilisateurs plus expérimentés auront déjà réglé leur chemin d'accès correctement par le biais des fichiers d'initialisation de leur shell. Dans ce cas, il est possible de demander à XDarwin de ne pas modifier le chemin d'accès initial. XDarwin lance les premiers clients X11 dans le shell d'ouverture de session par défaut. (Un shell de remplacement peut être spécifié dans les préférences.) La façon de régler le chemin d'accès dépend du shell utilisé. Ceci est documenté dans les pages "man" du shell.</p>
+<p>De plus, il est possible d'ajouter les pages "man" de XFree86 à la liste des pages recherchées pour la documentation "man". Les pages "man" X11 se trouvent dans <code>/usr/X11R6/man</code> et la variable d'environnement <code>MANPATH</code> contient la liste des répertoires dans lesquels chercher.</p>
+
+
+<h2><a NAME="prefs">Préférences</a></h2>
+<p>Un certain nombre d'options peuvent être réglées dans les préférences. On accède aux préférences en choisissant "Préférences..." dans le menu "XDarwin". Les options décrites comme options de démarrage ne prendront pas effet avant le redémarrage de XDarwin. Les autres options prennent immédiatement effet. Les différentes options sont détaillées ci-après :</p>
+<h3>Général</h3>
+<ul>
+ <li><b>Utiliser le bip d'alerte Système dans X11 :</b> Cocher cette option pour que le son d'alerte standard de Mac OS X soit utilisé à la place du son d'alerte de X11. L'option n'est pas cochée ar défaut. Dans ce cas, un simple signal sonore est utilisé.</li>
+ <li><b>Autoriser X11 à changer la vitesse de la souris :</b> Dans une implémentation classique du sytème X window, le gestionnaire de fenêtres peut modifier la vitesse de la souris. Cela peut s'avérer déroutant puisque le réglage de la vitesse de la souris peut être différent dans les préférences de Mac OS X et dans le gestionnaire X window. Par défaut, X11 n'est pas autorisé à changer la vitesse de la souris.</li>
+ <li><b>Émulation de souris à plusieurs boutons :</b> Ceci est décrit ci-dessus à la rubrique <a HREF="#usage">Usage</a>. Lorsque l'émulation est activée, il suffit d'appuyer simultanément sur les touches modificatrices sélectionnées et sur le bouton de la souris afin d'émuler les boutons du milieu et de droite.</li>
+</ul>
+<h3>Démarrage</h3>
+<ul>
+ <li><b>Mode par défaut :</b> Le mode spécifié à cet endroit sera utilisé si l'utilisateur ne l'indique pas au démarrage.</li>
+ <li><b>Choix du mode d'affichage au démarrage</b> Par défaut, une fenêtre de dialogue est affichée au démarrage de XDarwin pour permettre à l'utilisateur de choisir entre le mode plein écran et le mode « rootless ». Si cette option est désactivée, le mode par défaut sera automatiquement utilisé.</li>
+ <li><b>Numéro d'affichage (Display)</b> X11 offre la possibilité de plusieurs serveurs X sur un ordinateur. L'utilisateur doit spécifier ici le numéro d'affichage utilisé par XDarwin dans le cas où plusieurs serveurs X seraient en service simultanément.</li>
+ <li><b>Autoriser la prise en charge Xinerama de plusieurs moniteurs :</b> XDarwin peut être utilisé avec plusieurs moniteur avec Xinerama, qui considère les différents moniteurs comme des parties d'un écran rectugulaire plus grand. Cette option permet de désactiver Xinerama mais XDarwin ne prend alors pour l'instant pas correctement en charge l'affichage sur plusieurs écrans. Si il n'y a qu'un seul moniteur, Xinerama est automatiquement désactivé.</li>
+ <li><b>Fichier clavier :</b> Un fichier de correspondance de clavier est lu au démarrage puis transformé en un fihcier de correspondance clavier pour X11. Les fichiers de correspondance clavier, disponibles pour de nombreuses langues, se trouvent dans <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Démarrage des premiers clients X11 :</b> Lorsque XDarwin est démarré à partir du Finder, il lance <code>xinit</code> qui lance à son tour le gestionnaire X window ainsi que d'autres clients X. (Voir "<code>man xinit</code>" pour plus d'informations.) Avant de lancer <code>xinit</code>, XDarwin ajoute les répertoires ainsi spécifiés au chemin d'accès de l'utilisateur. Par défaut, seul <code>/usr/X11R6/bin</code> est ajouté. Il est possible d'ajouter d'autres répertoires en les séparants à l'aide de deux points (<code>:</code>). Les clients X sont démarrés à partir du shell par défaut de l'utilisateur. Ainsi, le fichier d'initialisation de shell de l'utilisateur est lu. Un autre shell peut éventuellement être spécifié.</li>
+</ul>
+<h3>Plein écran</h3>
+<ul>
+ <li><b>Combinaison de touches :</b> Appuyer sur ce bouton, puis appuyer sur une ou plusieurs touches modificatrices suivies d'une touche ordinaire. Cette combinaison de touche servira à commuter entre Aqua et X11.</li>
+ <li><b>Basculer dans X11 en cliquant sur l'icône du Dock :</b> Cette option permet de passer dans X11 en cliquant dans l'icône de XDarwin dans le Dock. Sur certaines versions de Mac OS X, la commutation en utilisant le Dock peut faire disparaître le curseur lors du retour dans Aqua.</li>
+ <li><b>Afficher l'aide du mode plein écran au démarrage :</b> Permet l'affichage d'une fenêtre d'introduction lorsque XDarwin est démarré en mode plein écran.</li>
+ <li><b>Profondeur de couleur :</b> En mode plein écran, l'affichage X11 peut utiliser une autre profondeur de couleur que celle employée par Aqua. Si "Actuelle" est choisi, XDarwin utilisera la même profondeur de couleur qu'Aqua. Les autres choix sont 8 (256 couleurs), 15 (milliers de couleurs) et 24 bits (millions de couleurs). </li>
+</ul>
+
+<h2><a NAME="license">Licence</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>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:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>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 X CONSORTIUM 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.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
+
diff --git a/hw/darwin/bundle/German.lproj/Credits.rtf b/hw/darwin/bundle/German.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/German.lproj/Localizable.strings b/hw/darwin/bundle/German.lproj/Localizable.strings
new file mode 100644
index 000000000..365cc291a
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..d3e7c5d57
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..6b1b91f5c
--- /dev/null
+++ b/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,90 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/German.lproj/XDarwinHelp.html.cpp,v 1.1 2001/11/03 00:25:34 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 for Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Contents</h2>
+<ol>
+ <li><A HREF="#notice">Important Notice</A></li>
+ <li><A HREF="#usage">Usage</A></li>
+ <li><A HREF="#path">Setting Your Path</A></li>
+ <li><A HREF="#prefs">User Preferences</A></li>
+ <li><A HREF="#license">License</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Important Notice</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
+#else
+If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
+#endif
+</blockquote>
+<blockquote>
+This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
+<h2><a NAME="usage">Usage</a></h2>
+<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
+="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> XFree86 runs on Mac OS X in full screen mode. When the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, just click on the XDarwin icon in the floating switch window to switch back to the X window system. You can change this behavior in the user preferences so that clicking on the XDarwin icon in the Dock switches as well.</p>
+<h3>Multi-Button Mouse Emulation</h3>
+<p>Many X11 applications rely on the use of a 3-button mouse. To emulate a 3-button mouse with a single button, select "Enable emulation of multiple mouse buttons" in the Preferences. When emulating a 3-button mouse, holding down the left command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the left option key and clicking will simulate the third button.</p>
+<p>Notes:</p>
+<ul>
+ <li>With most keyboards the left and right command and option keys are not differentiated so either will work.
+ <li>Even with command and/or option keys mapped to some other key with xmodmap, you still must use the original command and option keys for multibutton mouse emulation.
+ <li>The only way to simulate holding down the left command key and clicking the second mouse button is to map some other key to be the left command key. The same is true for simulating holding down the left option key and clicking the third mouse button.
+</ul>
+<h2><a NAME="path">Setting Your Path</a></h2>
+<p>The X11 binaries are located in /usr/X11R6/bin, which you may need to add to your path. Your path is the list of directories to be searched for executable commands. The way to do this depends on the shell you are using. The following directions are for tcsh, which is the default shell on Darwin and Mac OS X.</p>
+<p>You can check your path by typing "printenv PATH". You should see /usr/X11R6/bin listed as one of the directories. If not, you should add it to your default path. To do so, you can add the following line to the file ~/Library/init/tcsh/path: (You may need to create this file and directory path if it does not exist already.)</p>
+<blockquote>setenv PATH "${PATH}:/usr/X11R6/bin"</blockquote>
+<p>Note that if you have created a .cshrc or .tcshrc file, these files will override your settings in ~/Library/init/tcsh/ and you will need to change one of these files instead. These changes will not take effect until you open a new Terminal window. You may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.</p>
+<h2><a NAME="prefs">User Preferences</a></h2>
+<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed under Startup Options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
+<ul>
+ <li>Key combination button: Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
+ <li>Use System beep for X11: When enabled the standard Mac OS X alert sound is used as X11 bell. When disabled (default) a simple tone is used.</li>
+ <li>Click on icon in Dock switches to X11: Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
+ <li>Show help on startup: This will show the introductory splash screen when XDarwin is launched.</li>
+ <li>Display number: This sets what X display number XDarwin should assign to the display. Note that XDarwin always takes over the main display when showing X11.</li>
+ <li>Keymapping: By default, XDarwin loads the keymapping from the Darwin kernel on startup. On portables, this keymapping is sometimes empty so that the keyboard will appear to be dead in X11. If "Load from file" is selected, XDarwin will load the keymapping from the specified file instead.</li>
+</ul>
+<h2><a NAME="license">License</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which doesn't impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>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:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>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 X CONSORTIUM 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.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/Japanese.lproj/Credits.rtf b/hw/darwin/bundle/Japanese.lproj/Credits.rtf
new file mode 100644
index 000000000..6b1f82d8a
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/Credits.rtf
@@ -0,0 +1,135 @@
+{\rtf1\mac\ansicpg10001\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+\f3\fnil\fcharset78 HiraKakuPro-W3;}
+{\colortbl;\red255\green255\blue255;}
+\vieww13980\viewh11160\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+ Darwin x86
+\f2\i
+\f3\i0 \'83\'54\'83\'7c\'81\'5b\'83\'67
+\f1 \
+Pablo Di Noto\
+
+\f2\i
+\f3\i0 \'83\'58\'83\'79\'83\'43\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Paul Edens\
+
+\f2\i
+\f3\i0 \'83\'49\'83\'89\'83\'93\'83\'5f\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Kyunghwan Kim\
+
+\f2\i
+\f3\i0 \'8a\'d8\'8d\'91\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Mario Klebsch\
+
+\f3 \'94\'f1US\'83\'4c\'81\'5b\'83\'7b\'81\'5b\'83\'68 \'83\'54\'83\'7c\'81\'5b\'83\'67
+\f1 \
+Torrey T. Lyons\
+
+\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b
+\f1 \
+Andreas Monitzer\
+
+\f3 \'83\'68\'83\'43\'83\'63\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Patrik Montgomery\
+
+\f2\i
+\f3\i0 \'83\'58\'83\'45\'83\'46\'81\'5b\'83\'66\'83\'93\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Greg Parker\
+
+\f3 \'83\'8b\'81\'5b\'83\'67\'83\'8c\'83\'58 \'83\'54\'83\'7c\'81\'5b\'83\'67
+\f1 \
+
+\f3 \'93\'63\'92\'86 \'8f\'72\'8c\'f5
+\f1 \
+
+\f3 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+Olivier Verdier\
+
+\f2\i
+\f3\i0 \'83\'74\'83\'89\'83\'93\'83\'58\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i
+\f3\i0 \'83\'43\'83\'93\'83\'58\'83\'67\'81\'5b\'83\'89
+\f1 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+ Darwin x86
+\f3 \'83\'54\'83\'7c\'81\'5b\'83\'67
+\f1 \
+Torrey T. Lyons\
+
+\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67 \'83\'8a\'81\'5b\'83\'5f\'81\'5b
+\f1 \
+Andreas Monitzer\
+ Cocoa
+\f3 \'94\'c5 XDarwin \'83\'74\'83\'8d\'83\'93\'83\'67\'83\'47\'83\'93\'83\'68
+\f1 \
+Greg Parker\
+
+\f3 \'8d\'c5\'8f\'89\'82\'cc Quartz \'83\'43\'83\'93\'83\'76\'83\'8a\'83\'81\'83\'93\'83\'67
+\f1 \
+Christoph Pfisterer\
+
+\f3 \'8b\'a4\'97\'4c\'83\'89\'83\'43\'83\'75\'83\'89\'83\'8a
+\f1 \
+
+\f3 \'93\'63\'92\'86 \'8f\'72\'8c\'f5
+\f1 \
+
+\f3 \'93\'fa\'96\'7b\'8c\'ea\'83\'8d\'81\'5b\'83\'4a\'83\'89\'83\'43\'83\'59
+\f1 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+ XDarwin
+\f3 \'83\'41\'83\'43\'83\'52\'83\'93
+\f1 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f3 XFree86 \'82\'cc Mac OS X Server \'82\'d6\'82\'cc\'8d\'c5\'8f\'89\'82\'cc\'88\'da\'90\'41
+\f1 \
+Dave Zarzycki\
+ XFree86 4.0
+\f3 \'82\'f0 Darwin 1.0 \'82\'c9\'88\'da\'90\'41
+\f1 \
+Torrey T. Lyons\
+ XFree86 4.0.2
+\f3 \'83\'76\'83\'8d\'83\'57\'83\'46\'83\'4e\'83\'67\'82\'d6\'82\'cc\'93\'9d\'8d\'87} \ No newline at end of file
diff --git a/hw/darwin/bundle/Japanese.lproj/Localizable.strings b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
new file mode 100644
index 000000000..091138dd5
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..fbfb4dd42
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..2065d43d4
--- /dev/null
+++ b/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,149 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp,v 1.5 2002/05/04 01:25:40 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
+<title>
+XFree86 for Mac OS X</title></head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Ìܼ¡</h2>
+<ol>
+ <li><A HREF="#notice">Ãí°Õ»ö¹à</A></li>
+ <li><A HREF="#usage">»ÈÍÑË¡</A></li>
+ <li><A HREF="#path">¥Ñ¥¹¤ÎÀßÄê</A></li>
+ <li><A HREF="#prefs">´Ä¶­ÀßÄê</A></li>
+ <li><A HREF="#license">¥é¥¤¥»¥ó¥¹</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Ãí°Õ»ö¹à</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+¤³¤ì¤Ï¡¤XFree86 ¤Î¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¤¤¤¤«¤Ê¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£
+¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëÁ°¤Ë¡¤<A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤Þ¤¿¤Ï <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS ¥ê¥Ý¥¸¥È¥ê</A>¤ÇºÇ¿·ÈǤΥÁ¥§¥Ã¥¯¤ò¤·¤Æ²¼¤µ¤¤¡£
+#else
+¤â¤·¡¤¥µ¡¼¥Ð¡¼¤¬ 6 -12 ¥ö·î°Ê¾åÁ°¤Î¤â¤Î¤«¡¤¤Þ¤¿¤Ï¤¢¤Ê¤¿¤Î¥Ï¡¼¥É¥¦¥§¥¢¤¬¾åµ­¤ÎÆüÉÕ¤è¤ê¤â¿·¤·¤¤¤â¤Î¤Ê¤é¤Ð¡¤ÌäÂê¤òÊó¹ð¤¹¤ëÁ°¤Ë¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤òõ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
+¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+#endif
+</blockquote>
+<blockquote>
+ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¤<A HREF="#license">MIT X11/X Consortium License</A> ¤Î¾ò·ï¤Ë´ð¤Å¤­¡¤ÌµÊݾڤǡ¤¡Ö¤½¤Î¤Þ¤Þ¡×¤Î·Á¤Ç¶¡µë¤µ¤ì¤Þ¤¹¡£
+¤´»ÈÍѤˤʤëÁ°¤Ë¡¤<A HREF="#license">¥é¥¤¥»¥ó¥¹¾ò·ï</A>¤ò¤ªÆɤ߲¼¤µ¤¤¡£
+</blockquote>
+
+<h2><a NAME="usage">»ÈÍÑË¡</a></h2>
+<p>XFree86 ¤Ï¡¤<a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a>¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¡¤ºÆÇÛÉÛ²Äǽ¤Ê¥ª¡¼¥×¥ó¥½¡¼¥¹¤Î <a HREF="http://www.x.org/">X Window System</a> ¤Î¼ÂÁõ¤Ç¤¹¡£
+XFree86 ¤Ë¤è¤Ã¤ÆÄ󶡤µ¤ì¤ë Darwin ¤È Mac OS X ¤Î¤¿¤á¤Î X Window ¥µ¡¼¥Ð¡¼¤ò XDarwin ¤È¸Æ¤Ó¤Þ¤¹¡£
+XDarwin ¤Ï¡¤Mac OS X ¾å¤Ç¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤ÇÆ°ºî¤·¤Þ¤¹¡£</p>
+
+<p>¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ¡¤¤½¤ì¤ÏÁ´²èÌ̤òÀêÍ­¤·¤Þ¤¹¡£
+¤¢¤Ê¤¿¤Ï¡¤Command-Option-A ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¥­¡¼¤ÎÁȤ߹ç¤ï¤»¤Ï¡¤´Ä¶­ÀßÄê¤ÇÊѹ¹²Äǽ¤Ç¤¹¡£
+Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤«¤é X Window System ¤ØÀÚ¤êÂؤ¨¤ë¾ì¹ç¤Ï¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ²¼¤µ¤¤¡£
+¡Ê´Ä¶­ÀßÄê¤Ç¡¤¥Õ¥í¡¼¥Æ¥£¥ó¥°¡¦¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤è¤¦¤ËÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë</p>
+
+<p>¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ï¡¤X Window System ¤È Aqua ¤Ï²èÌ̤ò¶¦Í­¤·¤Þ¤¹¡£
+X11 ¤¬É½¼¨¤¹¤ë¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï²èÌ̤Υµ¥¤¥º¤Ç¤¢¤ê¡¤Â¾¤ÎÁ´¤Æ¤Î¥¦¥£¥ó¥É¥¦¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
+Aqua ¤¬¥Ç¥¹¥¯¥È¥Ã¥×¤ÎÇطʤòÀ©¸æ¤¹¤ë¤Î¤Ç¡¤X11 ¤Î¥ë¡¼¥È¥¦¥£¥ó¥É¥¦¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Ç¤Ïɽ¼¨¤µ¤ì¤Þ¤»¤ó¡£</p>
+
+<h3>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó</h3>
+<p>¿¤¯¤Î X11 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¤3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤òɬÍפȤ·¤Þ¤¹¡£
+¤¢¤Ê¤¿¤Ï¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ÈƱ»þ¤Ë¤¤¤¯¤Ä¤«¤Î½¤¾þ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¤°ì¤Ä¤Î¥Ü¥¿¥ó¤Ç 3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¤³¤ì¤Ï¡¤´Ä¶­ÀßÄê¤Î¡Ö°ìÈÌÀßÄê¡×¤Î¡ÖÊ£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¡×¥»¥¯¥·¥ç¥ó¤ÇÀßÄꤷ¤Þ¤¹¡£
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤ÏÍ­¸ú¤Ç¡¤¥³¥Þ¥ó¥É¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
+¥ª¥×¥·¥ç¥ó¥­¡¼¤ò²¡¤·¤Ê¤¬¤é¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£
+¤¢¤Ê¤¿¤Ï¡¤´Ä¶­ÀßÄê¤Ç¥Ü¥¿¥ó 2 ¤È 3 ¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë½¤¾þ¥­¡¼¤ÎÁȹ礻¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+Ãí¡§½¤¾þ¥­¡¼¤ò xmodmap ¤Ç¾¤Î¥­¡¼¤Ë³ä¤êÅö¤Æ¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¤Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤ÏËÜÍè¤Î¥³¥Þ¥ó¥É¥­¡¼¤ä¥ª¥×¥·¥ç¥ó¥­¡¼¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£</p>
+
+<h2><a NAME="path">¥Ñ¥¹¤ÎÀßÄê</a></h2>
+<p>¥Ñ¥¹¤Ï¡¤ ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤Ç¤¹¡£
+X11 ¥Ð¥¤¥Ê¥ê¤Ï¡¤<code>/usr/X11R6/bin</code> ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ñ¥¹¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
+XDarwin ¤Ï¡¤¤³¤ì¤ò¥Ç¥Õ¥©¥ë¥È¤Ç¹Ô¤¤¤Þ¤¹¡£¤Þ¤¿¡¤¤¢¤Ê¤¿¤¬¥³¥Þ¥ó¥É¥é¥¤¥ó¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ÄɲäΥǥ£¥ì¥¯¥È¥ê¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</p>
+
+<p>·Ð¸³Ë­¤«¤Ê¥æ¡¼¥¶¡¼¤Ï¡¤¤¹¤Ç¤Ë¼«¤é¤Î¥·¥§¥ë¤Î¤¿¤á¤Ë½é´ü²½¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Æ¥Ñ¥¹¤òÀßÄꤷ¤Æ¤¤¤ë¤Ç¤·¤ç¤¦¡£
+¤³¤Î¾ì¹ç¡¤¤¢¤Ê¤¿¤Ï´Ä¶­ÀßÄê¤Ç XDarwin ¤¬¤¢¤Ê¤¿¤Î¥Ñ¥¹¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+XDarwin ¤Ï¡¤¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤ÇºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤ò³«»Ï¤·¤Þ¤¹¡£
+¡Ê´Ä¶­ÀßÄê¤ÇÂå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡Ë
+¥Ñ¥¹¤òÀßÄꤹ¤ëÊýË¡¤Ï¡¤¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤Ë°Í¸¤·¤Þ¤¹¡£
+¤³¤ì¤Ï¡¤¥·¥§¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥É¥­¥å¥á¥ó¥È¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
+
+<p>¤Þ¤¿¡¤¤¢¤Ê¤¿¤Ï¥É¥­¥å¥á¥ó¥È¤òõ¤·¤Æ¤¤¤ë»þ¡¤XFree86 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤µ¤ì¤ë¥Ú¡¼¥¸¤Î¥ê¥¹¥È¤ËÄɲä·¤¿¤¤¤È»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£
+X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï <code>/usr/X11R6/man</code> ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤½¤·¤Æ <code>MANPATH</code> ´Ä¶­ÊÑ¿ô¤Ï¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£</p>
+
+<h2><a NAME="prefs">´Ä¶­ÀßÄê</a></h2>
+<p>¡ÖXDarwin¡×¥á¥Ë¥å¡¼¤Î¡Ö´Ä¶­ÀßÄê...¡×¥á¥Ë¥å¡¼¹àÌܤ«¤é¥¢¥¯¥»¥¹¤Ç¤­¤ë´Ä¶­ÀßÄê¥Ñ¥Í¥ë¤Ç¡¤¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+¡Öµ¯Æ°¥ª¥×¥·¥ç¥ó¡×¤ÎÆâÍƤϡ¤XDarwin ¤òºÆµ¯Æ°¤¹¤ë¤Þ¤ÇÍ­¸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£
+¾¤ÎÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ÎÆâÍƤϡ¤Ä¾¤Á¤ËÍ­¸ú¤È¤Ê¤ê¤Þ¤¹¡£
+°Ê²¼¡¤¤½¤ì¤¾¤ì¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹:</p>
+
+<h3>°ìÈÌÀßÄê</h3>
+<ul>
+ <li><b>X11 ¤Ç¥·¥¹¥Æ¥à¤Î¥Ó¡¼¥×²»¤ò»ÈÍѤ¹¤ë:</b> ¥ª¥ó¤Î¾ì¹ç¡¤Mac OS X ¤Î¥Ó¡¼¥×²»¤¬ X11 ¤Î¥Ù¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£¥ª¥Õ¤Î¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡¤¥·¥ó¥×¥ë ¥È¡¼¥ó¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
+ <li><b>X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤Ë¤¹¤ë:</b> ɸ½àŪ¤Ê X Window System ¤Î¼ÂÁõ¤Ç¤Ï¡¤¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤Ï¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+ ¥Þ¥¦¥¹¤Î²Ã®ÅÙ¤Ë Mac OS X ¤Î¥·¥¹¥Æ¥à´Ä¶­ÀßÄê¤È X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤¬°Û¤Ê¤ëÃͤòÀßÄꤷ¤¿¾ì¹ç¡¤¤³¤ì¤Ïº®Íð¤ò¾·¤­¤Þ¤¹¡£
+ ¤³¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¡¤¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï X11 ¤Î¥Þ¥¦¥¹¥¢¥¯¥»¥é¥ì¡¼¥·¥ç¥ó¤òÍ­¸ú¤È¤·¤Þ¤»¤ó¡£</li>
+ <li><b>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó:</b> <a HREF="#usage">»ÈÍÑË¡</a>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¥ª¥ó¤Î¾ì¹ç¡¤¥Þ¥¦¥¹¥Ü¥¿¥ó¤¬Âè 2 ¤Þ¤¿¤ÏÂè 3 ¤Î¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¨¥ß¥å¥ì¡¼¥È¤¹¤ë»þ¤Ë¡¤ÁªÂò¤·¤¿½¤¾þ¥­¡¼¤òƱ»þ¤Ë²¡¤·¤Þ¤¹¡£</li>
+</ul>
+
+<h3>µ¯Æ°¥ª¥×¥·¥ç¥ó</h3>
+<ul>
+ <li><b>²èÌ̥⡼¥É:</b> ¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¤¤³¤³¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤¬»È¤ï¤ì¤Þ¤¹¡£</li>
+ <li><b>µ¯Æ°»þ¤Ë¥â¡¼¥ÉÁªÂò¥Ñ¥Í¥ë¤òɽ¼¨¤¹¤ë:</b> ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤XDarwin ¤Îµ¯Æ°»þ¤Ë¥æ¡¼¥¶¡¼¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Þ¤¿¤Ï¥ë¡¼¥È¥ì¥¹¥â¡¼¥É¤Î¤É¤Á¤é¤ò»ÈÍѤ¹¤ë¤«¤òÁªÂò¤¹¤ë¥Ñ¥Í¥ë¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¥ª¥Õ¤Î¾ì¹ç¡¤²èÌ̥⡼¥É¤Ç»ØÄꤷ¤¿¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£</li>
+ <li><b>X11 ¥Ç¥£¥¹¥×¥ì¥¤ÈÖ¹æ:</b> X11¤Ï¡¤°ì¤Ä¤Î¥³¥ó¥Ô¥å¡¼¥¿¾å¤ÇÊÌ¡¹¤Î X ¥µ¡¼¥Ð¡¼¤¬´ÉÍý¤¹¤ëÊ£¿ô¤Î¥Ç¥£¥¹¥×¥ì¥¤¤¬Â¸ºß¤¹¤ë¤³¤È¤òµö¤·¤Þ¤¹¡£Ê£¿ô¤Î X ¥µ¡¼¥Ð¡¼¤¬Æ±»þ¤Ë¼Â¹Ô¤·¤Æ¤¤¤ë»þ¡¤XDarwin ¤¬»ÈÍѤ¹¤ë¥Ç¥£¥¹¥×¥ì¥¤¤ÎÈÖ¹æ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
+ <li><b>Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¥µ¥Ý¡¼¥È¤òÍ­¸ú¤Ë¤¹¤ë:</b> XDarwin ¤Ï¡¤Xinerama ¥Þ¥ë¥Á¥â¥Ë¥¿¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£¤½¤ì¤ÏÁ´¤Æ¤Î¥â¥Ë¥¿¤ò°ì¤Ä¤ÎÂ礭¤Ê²èÌ̤ΰìÉô¤È¤ß¤Ê¤·¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç Xinerama ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¤¸½ºß XDarwin ¤Ï¤½¤ì̵¤·¤ÇÀµ¤·¤¯Ê£¿ô¤Î¥â¥Ë¥¿¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤â¤·¡¤¤¢¤Ê¤¿¤¬°ì¤Ä¤Î¥â¥Ë¥¿¤ò»È¤¦¤À¤±¤Ê¤é¤Ð¡¤Xinerama ¤Ï¼«Æ°Åª¤Ë̵¸ú¤È¤Ê¤ê¤Þ¤¹¡£</li>
+ <li><b>¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë:</b> ¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ïµ¯Æ°»þ¤ËÆɤ߹þ¤Þ¤ì¡¤X11 ¥­¡¼¥Þ¥Ã¥×¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£Â¾¸À¸ì¤ËÂбþ¤·¤¿¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¥Õ¥¡¥¤¥ë¤Ï <code>/System/Library/Keyboards</code> ¤Ë¤¢¤ê¤Þ¤¹¡£¡ÊÌõÃí¡§¥­¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ç Japanese ¤òÁªÂò¤¹¤ë¤È¡¤°ìÉô¤Î¥­¡¼¤¬¸ú¤«¤Ê¤¤Åù¤ÎÉÔ¶ñ¹ç¤¬È¯À¸¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Ï USA ¤òÁªÂò¤·¤¿¾å¤Ç ~/.Xmodmap ¤òŬÍѤ·¤Æ²¼¤µ¤¤¡£¡Ë</li>
+ <li><b>ºÇ½é¤Î X11 ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°:</b> XDarwin ¤¬ Finder¤«¤éµ¯Æ°¤¹¤ë»þ¡¤X ¥¦¥£¥ó¥É¥¦¥Þ¥Í¡¼¥¸¥ã¡¼¤È X ¥¯¥é¥¤¥¢¥ó¥È¤Îµ¯Æ°¤Ï <code>xinit</code> ¤ò¼Â¹Ô¤·¤Þ¤¹¡£¡Ê¾ÜºÙ¤Ï "<code>man xinit</code>" ¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£¡ËXDarwin ¤Ï <code>xinit</code> ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¤»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¤ËÄɲä·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï <code>/usr/X11R6/bin</code> ¤À¤±¤òÄɲä·¤Þ¤¹¡£Â¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÄɲä·¤¿¤¤¾ì¹ç¤Ï¡¤¥³¥í¥ó¤Ç¶èÀڤäƻØÄꤷ¤Þ¤¹¡£¥æ¡¼¥¶¡¼¤Î¥·¥§¥ë½é´ü²½¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤¿¤á¤Ë¡¤X ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥æ¡¼¥¶¡¼¤Î¥Ç¥Õ¥©¥ë¥È¥í¥°¥¤¥ó¥·¥§¥ë¤Çµ¯Æ°¤µ¤ì¤Þ¤¹¡£É¬ÍפǤ¢¤ì¤Ð¡¤Âå¤ï¤ê¤Î¥·¥§¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
+</ul>
+
+<h3>¥Õ¥ë¥¹¥¯¥ê¡¼¥ó</h3>
+<ul>
+ <li><b>¥­¡¼ÀßÄê¥Ü¥¿¥ó:</b> X11 ¤È Aqua ¤òÀÚ¤êÂؤ¨¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¥Ü¥¿¥ó¤ÎÁȤ߹ç¤ï¤»¤ò»ØÄꤷ¤Þ¤¹¡£
+ ¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¤Ç¤°Õ¤Î¿ô¤Î½¤¾þ¥­¡¼¤Ë³¤¤¤ÆÄ̾ï¤Î¥­¡¼¤ò²¡¤·¤Þ¤¹¡£</li>
+ <li><b>¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤ËÌá¤ë:</b> ¥ª¥ó¤Î¾ì¹ç¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤Ø¤ÎÀڤ괹¤¨¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£Mac OS X ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¤¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç Aqua ¤ËÌá¤Ã¤¿»þ¡¤¥«¡¼¥½¥ë¤¬¾Ã¼º¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£</li>
+ <li><b>µ¯Æ°»þ¤Ë¥Ø¥ë¥×¤òɽ¼¨¤¹¤ë:</b> XDarwin ¤¬¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Çµ¯Æ°¤¹¤ë»þ¡¤¥¹¥×¥é¥Ã¥·¥å¥¹¥¯¥ê¡¼¥ó¤òɽ¼¨¤·¤Þ¤¹¡£</li>
+ <li><b>¿§¿¼ÅÙ:</b> ¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Ç¤Ï¡¤X11 ¥Ç¥£¥¹¥×¥ì¥¤¤¬ Aqua ¤È°Û¤Ê¤ë¿§¿¼ÅÙ¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¡ÖÊѹ¹¤Ê¤·¡×¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤XDarwin ¤Ï Aqua ¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¿§¿¼ÅÙ¤ò»È¤¤¤Þ¤¹¡£¤³¤ì°Ê³°¤Ë 8¡¤15 ¤Þ¤¿¤Ï24 ¥Ó¥Ã¥È¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</li>
+</ul>
+
+<h2>
+<a NAME="license">¥é¥¤¥»¥ó¥¹</a>
+</h2>
+XFree86 Project ¤Ï¡¤¼«Í³¤ËºÆÇÛÉÛ²Äǽ¤Ê¥Ð¥¤¥Ê¥ê¤È¥½¡¼¥¹¥³¡¼¥É¤òÄ󶡤¹¤ë¤³¤È¤Ë¥³¥ß¥Ã¥È¤·¤Æ¤¤¤Þ¤¹¡£
+»ä¤¿¤Á¤¬»ÈÍѤ¹¤ë¼ç¤Ê¥é¥¤¥»¥ó¥¹¤Ï¡¤ÅÁÅýŪ¤Ê MIT X11/X Consortium License ¤Ë´ð¤Å¤¯¤â¤Î¤Ç¤¹¡£
+¤½¤·¤Æ¡¤¤½¤ì¤Ï½¤Àµ¤Þ¤¿¤ÏºÆÇÛÉÛ¤µ¤ì¤ë¥½¡¼¥¹¥³¡¼¥É¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥ê¤Ë¡¤¤½¤Î Copyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤¬¤½¤Î¤Þ¤Þ»Ä¤µ¤ì¤ë¤³¤È¤òÍ׵᤹¤ë°Ê³°¤Î¾ò·ï¤ò¶¯À©¤·¤Þ¤»¤ó¡£
+¤è¤ê¿¤¯¤Î¾ðÊó¤È¡¤¥³¡¼¥É¤Î°ìÉô¤ò¥«¥Ð¡¼¤¹¤ëÄɲäΠCopyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤Î¤¿¤á¤Ë¡¤<A HREF="http://www.xfree86.org/legal/licence.html">XFree86 ¤Î License ¥Ú¡¼¥¸</A>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
+<H3>
+<A NAME="3"></A>
+X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>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:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>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 X CONSORTIUM 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.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/Portuguese.lproj/Credits.rtf b/hw/darwin/bundle/Portuguese.lproj/Credits.rtf
new file mode 100644
index 000000000..cbf13779f
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/Credits.rtf
@@ -0,0 +1,139 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5340\viewh4520\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 Contribuidores do XonX ao XFree86 4.2.99.x:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Fabr\'92cio Luis de Castro
+\f0\b \
+
+\f2\i\b0 Localiza\'8d\'8bo para o Portugu\'90s\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\i0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Contribuidores do XonX ao XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Suporte para o Darwin x86\
+
+\f1\i0 Pablo Di Noto\
+
+\f2\i Localiza\'8d\'8bo para o Espanhol
+\f1\i0 \
+Paul Edens\
+
+\f2\i Localiza\'8d\'8bo para o Holand\'90s
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Localiza\'8d\'8bo para o Coreano
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Suporte para teclados Non-US
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i L\'92der de Projeto
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Localiza\'8d\'8bo para o Alem\'8bo
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Localiza\'8d\'8bo para o Sueco
+\f1\i0 \
+Greg Parker\
+
+\f2\i Suporte ao modo Compartilhado (Rootless)
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Localiza\'8d\'8bo para o Japon\'90s
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i Localiza\'8d\'8bo para o Fran\'8d\'90s
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Agradecimentos Especiais:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Instalador
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Membros do Time XonX\
+Contribuindo com o XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Suporte ao Darwin x86\
+
+\f1\i0 Torrey T. Lyons\
+
+\f2\i L\'92der de Projeto
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Vers\'8bo Cocoa da interface XDarwin
+\f1\i0 \
+Greg Parker\
+
+\f2\i Implementa\'8d\'8bo Original
+\f1\i0
+\f2\i ao Quartz \
+
+\f1\i0 Christoph Pfisterer\
+
+\f2\i Bibliotecas Din\'89micas Compartilhadas
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Localiza\'8d\'8bo para o Japon\'90s
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Agradecimento Especial:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i \'eacone do XDarwin
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Hist\'97rico:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Suporte Original do XFree86 no Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i Suporte ao
+\f1\i0
+\f2\i XFree86 4.0 no Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integra\'8d\'8bo dentro do Projeto XFree86 na vers\'8bo 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
new file mode 100644
index 000000000..b3edbb41d
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..4b7736a12
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..37502eac6
--- /dev/null
+++ b/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,216 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Portuguese.lproj/XDarwinHelp.html.cpp,v 1.1 2002/01/25 06:46:46 torrey Exp $ --><html><body>
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+
+<head>
+<title>XFree86 para Mac OS X</title>
+</head>
+
+<center>
+
+ <h1>XFree86 para Darwin e Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>&Iacute;ndice</h2>
+<ol>
+ <li><A HREF="#notice">Notas importantes</A></li>
+ <li><A HREF="#usage">Uso</A></li>
+ <li><A HREF="#path">Ajustando seu Path</A></li>
+
+ <li><A HREF="#prefs">Prefer&ecirc;ncias do usu&aacute;rio</A></li>
+ <li><A HREF="#license">Licen&ccedil;a</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Notas importantes</a></h2>
+</center>
+<blockquote> #if PRE_RELEASE Essa &eacute; uma vers&atilde;o pr&eacute;-lancamento
+ do XFree86, e ela n&atilde;o &eacute; suportada de nenhuma forma. Bugs podem
+ ser reportados e corre&ccedil;&otilde;es podem ser enviadas para <A HREF="http://sourceforge.net/projects/xonx/">P&aacute;gina
+ do projeto XonX</A> no SourceForge. Antes de informar bugs em vers&otilde;es
+ pr&eacute;-lancamento, por favor verifique a þltima vers&atilde;o em <A HREF="http://sourceforge.net/projects/xonx/">XonX</A>
+ or no <A HREF="http://www.XFree86.Org/cvs">Reposit&oacute;rio CVS do XFree86</A>.
+ #else Se o servidor &eacute; mais velho que 6-12 semanas, ou seu hardware &eacute;
+ mais novo que a data acima, procure por uma nova vers&atilde;o antes de informar
+ problemas. Bugs podem ser reportados e corre&ccedil;&otilde;es podem ser enviadas
+ para a <A HREF="http://sourceforge.net/projects/xonx/">P&aacute;gina do projeto
+ XonX</A> na SourceForge. #endif </blockquote>
+<blockquote> Este software &eacute; distribu&iacute;do sob os termos da <a href="#license">licen&ccedil;a
+ MIT X11 / X Consortium</a> e &eacute; provido, sem nenhuma garantia. Por favor
+ leia a <a href="#license">Licen&ccedil;a</a> antes de come&ccedil;ar a usar
+ o programa.</blockquote>
+
+<h2><a NAME="usage">Uso</a></h2>
+<p>O XFree86 &eacute; uma aplica&ccedil;&atilde;o &quot;open-source&quot; livremente
+ redistribu&iacute;da do <a HREF
+="http://www.x.org/">Sistema X Window</a> produzido pelo <a HREF="http://www.XFree86.Org/">XFree86
+ Project, Inc.</a> O servidor X window para o Darwin e Mac OS X provido pelo
+ XFree86 &eacute; chamado XDarwin. XDarwin roda sobre Mac OS X no modo Tela Cheia
+ ou no modo Compartilhado.</p>
+<p>No modo Tela Cheia, quando o sistema X window est&aacute; ativo, ele ocupa
+ a tela toda. Voc&ecirc; pode voltar ao desktop do Mac OS X clicando Command-Option-A.
+ Essa combina&ccedil;&atilde;o de teclas pode ser mudada nas prefer&ecirc;ncias.
+ Pelo desktop Mac OS X, clique no &iacute;cone XDarwin no Dock para voltar ao
+ sistema X window. (Voc&ecirc; pode mudar esse comportamento nas prefer&ecirc;ncias
+ da&iacute; voc&ecirc; dever&aacute; clicar no &iacute;cone XDarwin na janela
+ flutuante que aparecer&aacute;.)</p>
+<p>No modo Compartilhado, o sistema X window e Aqua dividem a mesma tela. A janela
+ raiz da tela X11 est&aacute; do tamanho da tela (monitor) e cont&eacute;m todas
+ as outras janelas. A janela raiz do X11 no modo compartilhado n&atilde;o &eacute;
+ mostrada pois o Aqua controla o fundo de tela.</p>
+<h3>Emula&ccedil;&atilde;o de Mouse Multi-Bot&otilde;es</h3>
+<p>Muitas aplica&ccedil;&otilde;es X11 insistem em usar um mouse de 3 bot&otilde;es.
+ Voc&ecirc; pode emular um mouse de 3 bot&otilde;es com um simples bot&atilde;o,
+ mantendo pressionando teclas modificadoras enquanto voc&ecirc; clica no bot&atilde;o
+ do mouse. Isto &eacute; controlado pela configura&ccedil;&atilde;o da &quot;Emula&ccedil;&atilde;o
+ de Mouse Multi-Bot&otilde;es&quot; da prefer&ecirc;ncia &quot;Geral&quot;. Por
+ padr&atilde;o, a emula&ccedil;&atilde;o est&aacute; habilitada e mantendo pressionada
+ a tecla Command e clicando no bot&atilde;o do mouse ele simular&aacute; o clique
+ no segundo bot&atilde;o do mouse. Mantendo pressionada a tecla Option e clicando
+ no bot&atilde;o do mouse ele simular&aacute; o terceiro bot&atilde;o. Voc&ecirc;
+ pode mudar a combina&ccedil;&atilde;o de teclas modificadoras para emular os
+ bot&otilde;es dois e tr&ecirc;s nas prefer&ecirc;ncias. Nota, se a tecla modificadora
+ foi mapeada para alguma outra tecla no xmodmap, voc&ecirc; ainda ter&aacute;
+ que usar a tecla atual especificada nas prefer&ecirc;ncias para a emula&ccedil;&atilde;o
+ do mouse multi-bot&otilde;es.</p>
+<h2><a NAME="path">Ajustando seu Path</a></h2>
+<p>Seu path &eacute; a lista de diret&oacute;rios a serem procurados por arquivos
+ execut&aacute;veis. O comando X11 est&aacute; localizado em <code>/usr/X11R6/bin</code>,
+ que precisa ser adicionado ao seu path. XDarwin faz isso para voc&ecirc; por
+ padr&atilde;o e pode-se tamb&eacute;m adicionar diret&oacute;rios onde voc&ecirc;
+ instalou aplica&ccedil;&otilde;es de linha de comando.</p>
+<p>Usu&aacute;rios experientes j&aacute; ter&atilde;o configurado corretamente
+ seu path usando arquivos de inicializa&ccedil;&atilde;o de seu shell. Neste
+ caso, voc&ecirc; pode informar o XDarwin para n&atilde;o modificar seu path
+ nas prefer&ecirc;ncias. O XDarwin inicia o cliente inicial X11 no shell padr&atilde;o
+ do usu&aacute;rio corrente. (Um shell alternativo pode ser tamb&eacute;m expecificado
+ nas prefer&ecirc;ncias.) O modo para ajustar o path depende do shell que voc&ecirc;
+ est&aacute; usando. Isto &eacute; descrito na man page do seu shell.</p>
+<p>Voc&ecirc; pode tamb&eacute;m querer adicionar as man pages do XFree86 para
+ a lista de p&aacute;ginas a serem procuradas quando voc&ecirc; est&aacute; procurando
+ por documenta&ccedil;&atilde;o. As man pages do X11 est&atilde;o localizadas
+ em <code>/usr/X11R6/man</code> e a vari&aacute;vel de ambiente <code>MANPATH</code>
+ cont&eacute;m a lista de diret&oacute;rios a buscar.</p>
+<h2><a NAME="prefs">Prefer&ecirc;ncias do Usu&aacute;rio</a></h2>
+<p>V&aacute;rias op&ccedil;&otilde;es podem ser ajustadas nas prefer&ecirc;ncias
+ do usu&aacute;rio, acess&iacute;vel pelo item &quot;Prefer&ecirc;ncias...&quot;
+ no menu &quot;XDarwin&quot;. As op&ccedil;&otilde;es listadas como op&ccedil;&otilde;es
+ de inicializa&ccedil;&atilde;o, n&atilde;o ter&atilde;o efeito at&eacute; voc&ecirc;
+ reiniciar o XDarwin. Todas as outras op&ccedil;&otilde;es ter&atilde;o efeito
+ imediatamente. V&aacute;rias das op&ccedil;&otilde;es est&atilde;o descritas
+ abaixo:</p>
+<h3>Geral</h3>
+<ul>
+ <li><b>Usar o Beep do Sistema para o X11: </b>Quando habilitado som de alerta
+ padr&atilde;o do Mac OS X ser&aacute; usado como alerta no X11. Quando desabilitado
+ (padr&atilde;o) um tom simples ser&aacute; usado.</li>
+ <li><b>Permitir o X11 mudar a acelera&ccedil;&atilde;o do mouse: </b>Por implementa&ccedil;&atilde;o
+ padr&atilde;o no sistema X window, o gerenciador de janelas pode mudar a acelera&ccedil;&atilde;o
+ do mouse. Isso pode gerar uma confus&atilde;o pois a acelera&ccedil;&atilde;o
+ do mouse pode ser ajustada diferentemente nas prefer&ecirc;ncias do Mac OS
+ X e nas prefer&ecirc;ncias do X window. Por padr&atilde;o, o X11 n&atilde;o
+ est&aacute; habilitado a mudar a acelera&ccedil;&atilde;o do mouse para evitar
+ este problema.</li>
+ <li><b>Emula&ccedil;&atilde;o de Mouse de Multi-Bot&otilde;es: </b>Esta op&ccedil;&atilde;o
+ est&aacute; escrita acima em <a href="#usage">Uso</a>. Quando a emula&ccedil;&atilde;o
+ est&aacute; habilitada as teclas modificadoras selecionadas tem que estar
+ pressionadas quando o bot&atilde;o do mouse for pressionado, para emular o
+ segundo e terceiro bot&otilde;es.</li>
+</ul>
+<h3>Inicial</h3>
+<ul>
+ <li><b>Modo Padr&atilde;o: </b>Se o usu&aacute;rio n&atilde;o indicar qual modo
+ de exibi&ccedil;&atilde;o quer usar (Tela Cheia ou Compartilhado) o modo especificado
+ aqui ser&aacute; usado .</li>
+ <li><b>Mostrar o painel de escolha na inicializa&ccedil;&atilde;o: </b> Por
+ padr&atilde;o, uma painel &eacute; mostrado quando o XDarwin &eacute;
+ iniciado para permitir que o usu&aacute;rio escolha ente o modo tela cheia
+ ou modo compartilhado. Se esta op&ccedil;&atilde;o estiver desligada, o modo
+ padr&atilde;o ser&aacute; inicializado automaticamente.</li>
+ <li><b>N&uacute;mero do Monitor X11: </b>O X11 permite ser administrado em multiplos
+ monitores por servidores X separados num mesmo computador. O usu&aacute;rio
+ pode indicar o n&uacute;mero do monitor para o XDarwin usar se mais de um
+ servidor X se estiver rodando simultaneamente.</li>
+ <li><b>Habilitar suporte a m&uacute;ltiplos monitores pelo Xinerama: </b>o XDarwin
+ suporta m&uacute;ltiplos monitores com o Xinerama, que trata todos os monitores
+ como parte de uma grande e retangular tela. Voc&ecirc; pode desabilitar o
+ Xinerama com est&aacute; op&ccedil;&atilde;o, mas normalmente o XDarwin n&atilde;o
+ controla m&uacute;ltiplos monitores corretamente sem est&aacute; op&ccedil;&atilde;o.
+ Se voc&ecirc; s&oacute; tiver um monotor, Xinerama &eacute; automaticamente
+ desabilitado. </li>
+ <li><b>Arquivo de Mapa de Teclado: </b> O mapa de teclado &eacute; lido na inicializa&ccedil;&atilde;o
+ e traduzido para um mapa de teclado X11. Arquivos de mapa de teclado, est&atilde;o
+ dispon&iacute;veis numa grande variedade de l&iacute;nguas e s&atilde;o encontradas
+ em <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Iniciando Clientes X11 primeiro: </b>Quando o XDrawin &eacute; inicializado
+ pelo Finder, ele ir&aacute; rodar o <code>xinit</code> para abrir o controlador
+ X window e outros clientes X. (Veja o manual "<code>man xinit</code>" para
+ mais informa&ccedil;&otilde;es.) Antes do XDarwin rodar o <code>xinit</code>
+ ele ir&aacute; adicionar espec&iacute;ficos diret&oacute;rios a seu path.
+ Por padr&atilde;o somente o <code>/usr/X11R6/bin</code> &eacute; adicionado.
+ separado por um ponto-e-v&iacute;rgula. Os clientes X s&atilde;o inicializados
+ no shell padr&atilde;o do usu&aacute;rio e os arquivos de inicializa&ccedil;&atilde;o
+ do shell ser&atilde;o lidos. Se desejado, um shell alternativo pode ser especificado.</li>
+</ul>
+<h3>Tela Cheia</h3>
+<ul>
+ <li><b>Bot&atilde;o de Combina&ccedil;&atilde;o de Teclas: </b> Clique no bot&atilde;o
+ e pressione qualquer quantidade de teclas modificadoras seguidas por uma tecla
+ padr&atilde;o para modificar a combina&ccedil;&atilde;o quando se quer mudar
+ entre o Aqua e X11.</li>
+ <li><b>Clique no &Iacute;cone no Dock para mudar para o X11: </b>Habilitando
+ esta op&ccedil;&atilde;o voc&ecirc; ir&aacute; ativar a mudan&ccedil;a para
+ o X11 clicando no &iacute;cone do XDarwin no Dock. Em algumas vers&otilde;es
+ do Mac OS X, mudando pelo clique no Dock pode causar o desaparecimento do
+ cursor quando retornar ao Aqua.</li>
+ <li><b>Mostrar a Ajuda na inicializa&ccedil;&atilde;o: </b>Isto ir&aacute; mostrar
+ uma tela introdut&oacute;ria quando o XDarwin for inicializado no modo Tela
+ Cheia. </li>
+ <li><b>Profundidade de Cores em bits: </b> No modo Tela Cheia, a tela do X11
+ pode usar uma profundiadde de cor diferente da usada no Aqua. Se a op&ccedil;&atilde;o
+ &quot;Atual&quot; est&aacute; especificada, a profundidade usada pelo Aqua
+ quando o XDarwin iniciar ser&aacute; a mesma. Al&eacute;m das op&ccedil;&otilde;es
+ 8, 15 ou 24 bits que podem ser especificadas.</li>
+</ul>
+
+<h2><a NAME="license">Licen&ccedil;a</a></h2>
+<p>O projeto XFree86 &eacute; designado a prover e a ser livremente redistribu&iacute;do
+ as vers&otilde;es bin&aacute;rias e souce (c&oacute;digo-fonte). A licen&ccedil;a
+ principal n&oacute;s usamos uma baseada na licen&ccedil;a tradicional MIT X11
+ / X Consortium, que n&atilde;o imp&otilde;e nenhuma condi&ccedil;&atilde;o sobre
+ modifica&ccedil;&otilde;es ou redistribui&ccedil;&atilde;o do c&oacute;digo-fonte
+ ou dos bin&aacute;rios desde que o copyright/licen&ccedil;a sejam mantidos intactos.
+ Para mais informa&ccedil;&otilde;es e not&iacute;cias adicionais de copyright/licensing
+ em algumas se&ccedil;&atilde;o do c&oacute;digo, por favor visite a <a href="http://www.xfree86.org/legal/licence.html">p&aacute;gina
+ de licen&ccedil;as do XFree86</a>.</p>
+<H3><A NAME="3"></A>Licen&ccedil;a do X Consortium</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Permiss&otilde;es s&atilde;o em virtude garantidas, livre de mudan&ccedil;as,
+ para qualquer pessoa que possua uma c&oacute;pia deste software e aos arquivos
+ de documenta&ccedil;&atilde;o associada (o &quot;Software&quot;), para lidar
+ com o software sem restri&ccedil;&otilde;es, incluindo limita&ccedil;&otilde;es
+ dos direitos de uso, c&oacute;pia, modifica&ccedil;&atilde;o, inclus&atilde;o,
+ publica&ccedil;&atilde;o, distribui&ccedil;&atilde;o, sub licen&ccedil;a, e/ou
+ venda de c&oacute;pias deste Software, e permitir pessoas to whom o Software
+ &eacute; fornecido para ser desta forma, verifique as seguintes condi&ccedil;&otilde;es:</p>
+<p>O nota de copyright abaixo e a permiss&atilde;o dever&atilde;o ser inclu&iacute;das
+ em todas as c&oacute;pias ou substanciais por&ccedil;&otilde;es do Software.</p>
+<p>O SOFTWARE 'E PROVIDO &quot;COMO TAL&quot;, SEM GARANTIAS DE NENHUM TIPO, EXPLICITA
+ OU IMPLICITA, INCLUINDO MAS N&Atilde;O LIMITADO NOS AVISOS DE COM&Eacute;RCIO,
+ TAMANHO OU PARA PROPOSTAS PARTICULARES E N&Atilde;O INFRA&Ccedil;&Atilde;O.
+ EM NENHUM ACONTECIMENTO O X CONSORTIUM SER&Aacute; RESPONSAV&Eacute;L POR NENHUMA
+ RECLAMA&Ccedil;&Atilde;O, DANOS OU OUTRAS RESPONSABILIDADES, SE NUMA A&Ccedil;&Atilde;O
+ DE CONTRATO, OU OUTRA COISA, SURGINDO DE, FORA DE OU EM CONEX&Atilde;O COM O
+ SOFTWARE OU O USO OU OUTRO MODO DE LIDAR COM O SOFTWARE.</p>
+<p>Exceto o contido nesta nota, o nome do X Consortium n&atilde;o pode ser usado
+ em propagandas ou outra forma de promo&ccedil;&atilde;o de vendas, uso ou outro
+ modo de lidar com este Software sem ter recebido uma autoriza&ccedil;&atilde;o
+ escrita pelo X Consortium.</p>
+<p>O Sistema X Window &eacute; marca registrada do X Consortium, Inc.</p>
+</body>
+</html>
+
diff --git a/hw/darwin/bundle/Spanish.lproj/Credits.rtf b/hw/darwin/bundle/Spanish.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Spanish.lproj/Localizable.strings b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
new file mode 100644
index 000000000..06eb0e5fb
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..83647d675
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..3e0710a2c
--- /dev/null
+++ b/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,116 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Spanish.lproj/XDarwinHelp.html.cpp,v 1.2 2001/12/30 03:52:27 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 para Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 en Darwin y Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Fecha de release: XF86_REL_DATE
+</center>
+<h2>Contenido</h2>
+<ol>
+ <li><A HREF="#notice">Aviso Importante</A></li>
+ <li><A HREF="#usage">Modo de uso</A></li>
+ <li><A HREF="#path">Configurando su Path</A></li>
+ <li><A HREF="#prefs">Preferencias del Usuario</A></li>
+ <li><A HREF="#license">Licencia</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Aviso Importante</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+Esta es una versi&oacuten pre-release de XFree86, y no tiene ning&uacuten soporte. Patches y reportes de error pueden ser enviados a la <A HREF="http://sourceforge.net/projects/xonx/">p&aacutegina del proyecto XonX</A> en SourceForge. Antes de reportar errores en versiones pre-release, por favor verifique la ultima versi&oacuten en <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> o bien en el <A HREF="http://www.XFree86.Org/cvs">repositorio CVS de XFree86</A>.
+#else
+Si el server el m&aacutes antiguo que 6 a 12 meses, o si su hardware es posterior a la fecha indicada m&aacutes arriba, por favor verifique la &uacuteltima versi&oacuten antes de reportar problemas. Patches y reportes de error pueden ser enviados a la <A HREF="http://sourceforge.net/projects/xonx/">p&aacutegina del proyecto XonX</A> en SourceForge.
+#endif
+</blockquote>
+<blockquote>
+Este software es distribuido bajo los t&eacuterminos de la <A HREF="#license">Licencia MIT X11 / X Consortium</A> y es provisto sin garant&iacutea alguna y en el estado en que se encuentra. Por favor lea la <A HREF="#license">Licencia</A> antes de utilizarlo.</blockquote>
+
+<h2><a NAME="usage">Modo de uso</a></h2>
+<p>XFree86 es una implementaci&oacuten open-source de distribuci&oacuten libre del <a HREF
+="http://www.x.org/">X Window System</a> producido por <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> El window server para Darwin y Mac OS X provisto por XFree86 se llama XDarwin. XDarwin funciona en Mac OS X en modo pantalla completa o en modo rootless (integrado al escritorio).</p>
+<p>En modo pantalla completa, el X window system toma control total de la pantalla mientras esta activo. Presionando Command-Option-A puede regresar al Escritorio de Mac OS X. Esta combinaci&oacuten de teclas puede cambiarse en las Preferencias de Usuario. Desde el Escritorio de Mac OS X, haga click en &iacutecono de XDarwin en el Dock para volver al X window system. (Puede cambiar esta comportamiento en las Preferencias de Usuario y configurar que XDarwin vuelva al X window system haciendo click en la ventana flotante con el logo X.)</p>
+<p>En modo rootless, el X window system comparte la pantalla con Aqua. La ventana root de X11 es del tama&ntildeo de la pantalla y contiene a todas las dem&aacutes ventanas. La ventana root de X11 no se muestra en este modo, ya que Aqua maneja el fondo de pantalla.</p>
+<h3>Emulaci&oacuten de mouse multi-bot&oacuten</h3>
+<p>Muchas aplicaciones X11 requieren del uso de un mouse de 3 botones. Es posible emular un mouse de 3 botones con un mouse de solo un bot&oacuten presionando teclas modificadoras mientras hace click. Esto es controlado en de la seccion "Emulaci&oacuten mouse" dentro de la secci&oacuten "General" de las Preferencias del Usuario. Por defecto, la emulaci&oacuten est&aacute activa y utiliza la tecla Command para simular el 2do bot&oacuten y la tecla Option para simlar el 3er bot&oacuten. La conbinaci&oacuten para simular el 2do y 3er bot&oacuten pueden ser modificada por cualquier combinaci&oacuten de teclas modificadoras dentro de las Preferencias del Usuario. Tenga en cuenta que aunque las teclas modificadoras hayan sido mapeadas a otras teclas con xmodmap, las teclas configuradas en las Preferencias del Usuario seguir&aacuten siendo las utilizadas por la emulaci&oacuten de mouse multi-bot&oacuten.</p>
+
+<h2><a NAME="path">Configurando su Path</a></h2>
+<p>El path es la lista de directorios donde se buscar&aacuten los comandos ejecutables. Los comandos de X11 se encuentran en <code>/usr/X11R6/bin</code>, y &eacuteste necesita estar dentro de su path. XDarwin hace &eacutesto autom&aacuteticamente por defecto, y puede adem&aacutes agregar directorios adicionales donde tenga otros comandos de l&iacutenea.</p>
+<p>Usuarios experimentados pueden tener su path correctamente configurado mediante los archivos de inicio de su interprete de comandos. En este caso, puede informarle a XDarwin en las Preferencias de Usuario para que no modifique su path. XDarwin arrancar&aacute los clientes X11 iniciales usando el int&eacuterprete de comandos del usuario, seg&uacuten su configuraci&oacuten de login. Un int&eacuterprete de comandos alternativo puede ser especificado en las Preferencias del Usuario. La manera de configurar el path de su int&eacuterprete de comandos depende de cual est&aacute usando, y es generalmente descripta en las p&aacuteginas man del mismo.</p>
+<p>Adem&aacutes, Ud. puede agregar las p&aacuteginas man de XFree86 a la lista de p&aacuteginas que son consultadas. Estas est&aacuten ubicadas en <code>/usr/X11R6/man</code> y <code>MANPATH</code> es la variable de entorno que contiene los directorios que son consultados.</p>
+
+<h2><a NAME="prefs">Preferencias del Usuario</a></h2>
+<p>Ciertas opciones pueden definirse dentro de "Preferencias...", en el men&uacute de XDarwin. Las opciones dentro de de "Inicio" no surtir&aacuten efecto hasta que la aplicaci&oacuten se reinicie. Las restantes opciones surten efecto inmediatamente. Las diferentes opciones se describen a continuaci&oacuten:</p>
+<h3>General</h3>
+<ul>
+ <li><b>Usar beep del sistema en X11:</b> Cuando esta opci&oacuten est&aacute activa, el sonido de alerta est&aacutendar de Mac OS X se usar&aacute como alerta de X11. Cuando est&aacute desactivada, un simple tono es utilizado (esta es la opci&oacuten por defecto).</li>
+ <li><b>Permitir que X11 cambie la aceleraci&oacuten del mouse:</b> En una implementaci&oacuten est&aacutendard de X11, el window manager puede cambiar la aceleraci&oacuten del mouse. Esto puede llevar a una gran confusi&oacuten si la aceleraci&oacuten es diferente en XDarwin y en Mac OS X. Por defecto, no se le permite a X11 alterar la aceleraci&oacuten para evitar este inconveniente.</li>
+ <li><b>Emulaci&oacuten de mouse multi-bot&oacuten:</b> Esta opci&oacuten es descripta m&aacutes arriba bajo <a HREF="#usage">Modo de Uso</a>. Cuando esta emulaci&oacuten est&aacute activa los modificadores seleccionados deben ser presionados cuando se hace click para emular el bot&oacuten 2 o el bot&oacuten 3.</li>
+</ul>
+<h3>Inicio</h3>
+<ul>
+ <li><b>Modo inicial:</b> Si el usuario no indica si desea utilizar la Pantalla Completa o el modo Rootless, el modo especificado aqu&iacute ser&aacute el usado.</li>
+ <li><b>Mostrar panel de selecci&oacuten al inicio:</b> Por defecto, un di&aacutelogo permite al usuario elegir entre Pantalla Completa o Rootless al inicio. Si esta opci&oacuten esta desactivada, XDarwin arrancar&aacute utilizando el modo por defecto sin consultar al usuario.</li>
+ <li><b>N&uacutemero de display X11:</b> X11 permite que existan m&uacuteltiples pantallas manejadas por servidores X11 separados funcionando en una misma computadora. El usuario puede especificar aqui un n&uacutemero entero para indicar el n&uacutemero de pantalla (display) que XDarwin utilizar&aacute si m&aacutes de un servidor X funciona en forma simult&aacutenea.</li>
+ <li><b>Habilitar soporte Xinerama para m&uacuteltipes monitores:</b> XDarwin suporta m&uacuteltiple monitores con Xinerama, que maneja todos los monitores como si fueran parte de una gran pantalla rectangular. Puede deshabilitar Xinerama con esta opci&oacuten, pero XDarwin no maneja m&uacuteltiples monitores en forma correcta sin esta opci&oacuten habilitada. Si tiene solo un monitor, Xinerama es autom&aacuteticamente deshabilitado.</li>
+ <li><b>Archivo de mapa de teclado:</b> Un archivo de mapa de teclas es le&iacutedo al inicio y es traducido a un keymap X11 (un archivo est&aacutendard de X11 para especificar la funci&oacuten de cada tecla). Estos archivos, disponibles para una amplia variedad de lenguajes, pueden encontrarse en <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Al iniciar clientes X11:</b> Cuando XDarwin arranca desde el Finder, &eacuteste ejecutar&aacute <code>xinit</code> para a su vez arrancar el window manager y otros clientes. (Vea en "<code>man xinit</code>" para mayor informaci&oacuten). Antes de ejecutar <code>xinit</code> XDarwin agregar&aacute los directorios especificados al path del usuario. Por defecto, solo <code>/usr/X11R6/bin</code> es agregado. Otros directorios adicionales puede agregarse separados por dos puntos (:). Los clientes X son ejecutados con el int&eacuterprete de comandos del usuario, por lo que los archivos de inicio de &eacuteste son le&iacutedos. Si se desea, un int&eacuterprete de comandos diferente puede ser especificado.</li>
+</ul>
+<h3>Pantalla Completa</h3>
+<ul>
+ <li><b>Bot&oacuten para definir combinaci&oacuten de teclas:</b> Haga click en este bot&oacuten y luego presione cualquier combinaci&oacuten de modificadores seguidos de una tecla convencional para definir que combinaci&oacuten usar&aacute para intercambiar entre X11 y Aqua.</li>
+ <li><b>Click en el &iacutecono del Dock cambia a X11:</b> Habilite esta opci&oacuten para volver a X11 al hacer click en &iacutecono de XDarwin en el Dock. En algunas versiones de Mac OS X, al volver haciendo click en el Dock puede causar al desaparci&oacuten del cursor al volver a Aqua.</li>
+ <li><b>Mostrar ayuda al inicio:</b> Esta opci&oacuten habilitada har&aacute que una pantalla inicial de introducci&oacuten aparezca cuando XDarwin es arrancado en modo Pantalla Completa.</li>
+ <li><b>Profundidad de color (bits):</b> En modo Pantalla Completa, el display X11 puede utilizar una profundidad de color diferente de la utilizada por Aqua. Si se especifica "Actual", la misma profundidad de color que Aqua utiliza ser&aacute adoptada por X11. Al contrario, puede especificar 8, 15, o 24 bits.</li>
+</ul>
+
+<h2><a NAME="license">Licencia</a></h2>
+El XFree86 Project esta comprometido en proveer versiones binarias y en c&oacutedigo fuente de distribuci&oacuten libre. La licencia principal que utilizamos es una basada en la Licencia MIT X11 tradicional, que no impone condiciones a la modificaci&oacuten o redistribuci&oacuten del c&oacutedigo fuente o de archivos binarios m&aacutes all&aacute de requerir que los mensajes de Licencia y Copyright se mantengan intactos. Para mayor informaci&oacuten y para mensajes adicionales de Licencia y Copyright que cubren algunas secciones del c&oacutedigo fuente, por favor consulte la <A HREF="http://www.xfree86.org/legal/licence.html">P&aacutegina de Licencia de XFree86</A>.
+<H3><A NAME="3"></A>Licencia del X Consortium</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>Se otorga aqui permiso, libre de costo, a toda persona que obtenga una copia de este Software y los archivos de documentaci&oacuten asociados (el "Software"),
+para utilizar el Software sin restricciones, incluyendo sin l&iacutemites los derechos de usar, copiar, modificar, integrar con otros productos, publicar, distribuir, sub-licenciar y/o comercializar copias del Software, y de permitir a las personas que lo reciben para hacer lo propio, sujeto a las siguientes condiciones:</p>
+<p>El mensaje de Copyright indicado m&aacutes arriba y este permiso ser&aacute inclu&iacutedo en todas las copias o porciones sustanciales del Software.</p>
+<p>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 X CONSORTIUM 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.</p>
+<p>Excepto lo indicado en este mensaje, el nombre del X Consortium no ser&aacute utilizado en propaganda o como medio de promoci&oacuten para la venta, utilizaci&oacuten u otros manejos de este Software sin previa autorizaci&oacuten escrita del X Consortium.</p>
+<p>X Window System es una marca registrada de X Consortium, Inc.</p>
+<H3><A NAME="3"></A>X Consortium License (English)</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>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:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>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 X CONSORTIUM 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.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/Swedish.lproj/Credits.rtf b/hw/darwin/bundle/Swedish.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/Swedish.lproj/Localizable.strings b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
new file mode 100644
index 000000000..7ade67d55
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..230436b31
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..ee099d1a0
--- /dev/null
+++ b/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,108 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Swedish.lproj/XDarwinHelp.html.cpp,v 1.2 2001/11/07 22:43:27 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 f&ouml;r Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 f&ouml;r Darwin och Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ F&auml;rdigst&auml;llt: XF86_REL_DATE
+</center>
+<h2>Inneh&aring;ll</h2>
+<ol>
+ <li><A HREF="#notice">Viktigt!</A></li>
+ <li><A HREF="#usage">Anv&auml;ndande</A></li>
+ <li><A HREF="#path">Att st&auml;lla in sin s&ouml;kv&auml;g</A></li>
+ <li><A HREF="#prefs">Inst&auml;llningar</A></li>
+ <li><A HREF="#license">Licens</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Viktigt!</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+Detta &auml;r en testversion av XFree86, och du kan inte garranteras n&aring;gon som helst support f&ouml;r den. Buggar och fel kan rapporteras och f&ouml;rslag till fixar kan skickas till <A HREF="http://sourceforge.net/projects/xonx/">XonX-projektets sida</A> p&aring; SourceForge. Innan du rapporterar buggar i testversioner, var god pr&ouml;va den senaste versionen fr&aring;n <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> eller i <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS-arkiv</A>.
+#else
+Om servern &auml;r &auml;ldre &auml;n 6-12 m&aring;nader, eller om din h&aring;rdvara &auml;r nyare &auml;n datumet ovan, leta efter en nyare version innan du rapporterar fel. Buggar och fel kan rapporteras och f&ouml;rslag till fixar kan skickas till <A HREF="http://sourceforge.net/projects/xonx/">XonX-projektets sida</A> p&aring; SourceForge.
+#endif
+</blockquote>
+<blockquote>
+Denna programvara distrubueras i enlighet med <A HREF="#license">MIT X11 / X Consortium License</A> och tilhandh&aring;lls som den &auml;r, helt utan garantier. Var god l&auml;s igenom <A HREF="#license">licensdokumentet (engelska)</A> innan du anv&auml;nder programmet.</blockquote>
+
+<h2><a NAME="usage">Anv&auml;ndande</a></h2>
+<p>XFree86 &auml;r en fritt spridd implemenation av <a HREF
+="http://www.x.org/">X Window-systemet</a> producerad av <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc</a>, med &ouml;ppen k&auml;llkod. Den X Window-server f&ouml;r Darwin och Mac OS X som tillhandah&aring;lls av XFree86 kallas XDarwin. XDarwin kan k&ouml;ras p&aring; Mac OS X i fullsk&auml;rmsl&auml;ge eller rotl&ouml;st l&auml;ge.</p>
+<p>I fullsk&auml;rmsl&auml;ge kommer X window-systemet att ta &ouml;ver hela sk&auml;rmen n&auml;r det &auml;r aktivt. Du kan byta tillbaka till Mac OS Xs skrivbord genom att trycka Kommando-Alt-A. Denna tangentkombination kan &auml;ndra i inst&auml;llningarna. N&auml;r du &auml;r p&aring; Mac OS Xs skrivbord kan du klicka p&aring; XDarwin-ikonen i dockan f&ouml;r att byta tillbaka till X Window-systemet. (Du kan f&ouml;r&auml;ndra detta beteende i inst&auml;llningarna s&aring; att du ist&auml;llet m&aring;ste klicka i det fltande bytesf&ouml;nstret ist&auml;llet.)</p>
+<p>I rotl&ouml;stl&auml;ge delar X11 och Aqua p&aring; din sk&auml;rm. Rotf&ouml;nstret p&aring; X11-sk&auml;rmen &auml;r av samma storlek som hela sk&auml;rmen och inneh&aring;ller alla andra f&ouml;nster - det fungerar som bakgrund. I rotl&ouml;stl&auml;ge visas inte detta rotf&ouml;nster, eftersom Aqua hanterar skrvbordbakgrunden.</p>
+
+<h3>Emulering av flerknapparsmus</h3>
+<p>M&aring;nga X11-program utnyttjar en treknapparsmus. Du kan emulera en treknapparsmus med en knapp genom att h&aring;lla ner olika knappar p&aring; tangentbordet medan du klickar med musens enda knapp. Denna funktion styrs av inst&auml;llningarna i "Emulera flerknapparsmus" under fliken "Diverse" i inst&auml;llningarna. Grundinst&auml;llningen &auml;r att emulationen &auml;r aktiv och att ett kommando-klick (H&aring;ll ner kommando och klicka) simulerar den andra musknappen. Den tredje musknappen f&aring;s genom att h&aring;lla ner alt och klicka. Du kan &auml;ndra detta till n&aring;gon annan kombination av de fem tangenterna kommando, alt, kontrol, skift och fn (Powerbook/iBook). Notera att om dessa knappar har flyttats med hj&auml;lp av kommandot xmodmap kommer denna f&ouml;r&auml;ndring inte att p&aring;verka vilka knappar som anv&auml;nds vid flerknappsemulationen.</p>
+
+<h2><a NAME="path">Att st&auml;lla in sin s&ouml;kv&auml;g</a></h2>
+<p>Din s&ouml;kv&auml;g &auml;r en lista av kataloger som s&ouml;ks igenom n&auml;r terminalen letar efter kommandon att exekvera. Kommandon som h&ouml;r till X11 ligger i <code>/usr/X11R6/bin</code>, en katalog som inte ligger i din s&ouml;kv&auml;g fr&aring;n b&ouml;rjan. XDarwin l&auml;gger till denna katalog &aring;t dig, och du kan ocks&aring; l&auml;gga till ytterligare kataloger i vilka du lagt program som skall k&ouml;ras fr&aring;n kommandoraden.</p>
+<p>Mer erfarna anv&auml;ndare har antagligen redan st&auml;llt in sin s&ouml;kv&auml;g i skalets inst&auml;llningsfiler. Om detta g&auml;ller dig kan st&auml;lla in XDarwin s&aring; att din s&ouml;kv&auml;g inte modifieras. XDarwin startar de f&ouml;rsta X11-klienterna i anv&auml;ndarens inloggningsskal (Vill du anv&auml;nda ett alternativt skall, kan du specificera detta i inst&auml;llningarna). Hur du st&auml;ller in din s&ouml;kv&auml;g beror p&aring; vilket skal du anv&auml;nder. Exakt hur beskrivs i skalets man-sidor.</p>
+
+<p>Ut&ouml;ver detta kan du ocks&aring; vilja l&auml;gga till XFree86s man-sidor (dokumentation) till listan &auml;ver sidor som som skall s&ouml;kas n&auml;r du vill l&auml;sa efter dokumentationen. X11s man-sidor ligger i <code>/usr/X11R6/man</code> och listan &auml;ver kataloger att s&ouml;ka best&auml;mms av variabeln<code>MANPATH</code>.</p>
+
+<h2><a NAME="prefs">Inst&auml;llningar</a></h2>
+<p>I inst&auml;llningarna finns ett antal alternativ d&auml;r du kan p&aring;verka hur XDarwin beter sig i vissa fall. Inst&auml;llningarna kommer du till genom att v&auml;lja "Inst&auml;llningar..." i menyn "XDarwin". De alternativ som finns under fliken "Starta" tr&auml;der inte i kraft f&ouml;rr&auml;n du startat om programmet. Alla andra alternativ tr&auml;der i kraft omedelbart. De olika alternativen beskrivs nedan:</p>
+<h3>Diverse</h3>
+<ul>
+ <li><b>Anv&auml;nd Mac OS varningsljud i X11:</b> N&auml;r detta alternativ &auml;r valt anv&auml;nds Mac OS vanliga varningsljud &auml;r X11s varningsljud (bell). N&auml;r detta alternativ inte &auml;r valt (f&ouml;rvalt) anv&auml;nds en vanlig ton.</li>
+ <li><b>Till&aring;t X11 att &auml;ndra musens acceleration:</b> I ett vanligt X11-system kan f&ouml;nsterhanteraren &auml;ndra musens acceleration. Detta kan vara f&ouml;rvirrande eftersom musens acceleration kan vara olika i Mac OS Xs System Preferences och i f&ouml;nsterhanteraren i X11. F&ouml;rvalet &auml;r att X11 inte kan &auml;ndra musens acceleration f&ouml;r att p&aring; detta s&auml;tt undvika detta problem.</li>
+ <li><b>Emulera flerknapparsmus:</b> Detta beskrivs ovan under <a HREF="#usage">Anv&auml;ndande</a>. N&auml;r emulationen &auml;r aktiv m&aring;ste du h&aring;lla ner de valda knapparna f&ouml;r att emulera en andra eller tredje musknapp.</li>
+</ul>
+<h3>Starta</h3>
+<ul>
+ <li><b>F&ouml;rvalt l&auml;ge:</b> Om anv&auml;ndaren inte p&aring; annat s&auml;tt v&auml;ljer vilket l&auml;ge som skall anv&auml;ndas kommer alternativet h&auml;r att anv&auml;ndas.</li>
+ <li><b>Visa val av sk&auml;rml&auml;ge vid start:</b> F&ouml;rvalet &auml;r att visa ett f&ouml;nster n&auml;r XDarwin startar som l&aring;ter anv&auml;ndaren v&auml;lja mellan fullsk&auml;rmsl&auml;ge och rotl&ouml;st l&auml;ge. Om detta alternativ inte &auml;r aktivt kommer XDarwin automatiskt att startas i det l&auml;ge som valts ovan.</li>
+ <li><b>Sk&auml;rmnummer i X11:</b> X11 till&aring;ter att det finns flera sk&auml;rmar styrda av varsin X-server p&aring; en och samma dator. Anv&auml;ndaren kan ange vilket nummer XDarwin skall anv&auml;nda om mer &auml;n en X-server skall anv&auml;ndas samtidigt.</li>
+ <li><b>Aktivera Xinerama (st&ouml;d f&ouml;r flera sk&auml;rmar):</b> XDarwin st&ouml;djer flera sk&auml;rmar genom Xinerama, vilket hanterar alla skr&auml;mar som delar av en enda stor rektangul&auml;r sk&auml;rm. Du kan anv&auml;nda detta alternativ f&ouml;r att st&auml;nga av Xinerama, men f&ouml;r n&auml;rvarande kan inte XDarwin hantera flera sk&auml;rmar utan det. Om du bara har en sk&auml;rm kommer Xinerama automatiskt att deaktiveras.</li>
+ <li><b>Fil med tangentbordsupps&auml;ttning:</b> En fil som anger tangentbordsupps&auml;ttning l&auml;ses vid start och &ouml;vers&auml;tts till en tangentborsupps&auml;ttningsfil f&ouml;r X11. Filer med tangentbordsupps&auml;ttningar f&ouml;r ett stort antal spr&aring;k finns i <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Startar f&ouml;rsta X11-klienterna:</b> N&auml;r X11 startas fr&aring;n Finder kommer det att exekvera filen <code>xinit</code> f&ouml;r att starta f&ouml;nsterhanteraren i X11 och andra program. (Se "<code>man xinit</code>" f&ouml;r mer information.) Innan XDarwin k&ouml;r xinit kommer det att l&auml;gga till katalogern h&auml;r till anv&auml;ndarens s&ouml;kv&auml;g. F&ouml;rvalet &auml;r att endast l&auml;gga till katalogen <code>/usr/X11R6/bin</code>. Ytterligare kataloger kan l&auml;ggas till - separera dem med kolon. X11-klienterna startas i anv&auml;ndarens inloggningsskal s&aring; att anv&auml;ndarens inst&auml;llningsfiler i skalet l&auml;ses. Om s&aring; &ouml;nskas kan de startas i ett annat skal.</li>
+</ul>
+<h3>Fullsk&auml;rm</h3>
+<ul>
+ <li><b>Tangentkombinationsknappen:</b> Tryck p&aring; denna knapp och en tangentkombination f&ouml;r att &auml;ndra den tangentkombination som anv&auml;nds f&ouml;r att byta mellan X11 och Aqua.</li>
+ <li><b>Klick p&aring; ikonen i dockan byter till X11:</b> Aktivera detta alternativ f&ouml;r att byta till X11 genom att klicka p&aring; ikonen i dockan. I vissa versioner av Mac OS X kommer ett bte p&aring; detta s&auml;tt att g&ouml;mma pekaren n&auml;r du &aring;terv&auml;nder till Aqua.</li>
+ <li><b>Visa fullsk&auml;rmshj&auml;lp vid start:</b> Detta kommer att visa en informationsruta n&auml;r XDarwin startas i fullsk&auml;rmsl&auml;ge.</li>
+ <li><b>F&auml;rgdjup:</b> I fullsk&auml;rmsl&auml;ge kan X11 anv&auml;nda ett annat f&auml;rgdjup &auml;n Aquas. Om du v&auml;jer "Nuvarande" kommer X11 att anv&auml;nda det f&auml;rgdjup som Aqua har just d&aring;. Annars kan du v&auml;lja 8, 15, eller 24 bitare f&auml;rg.</li>
+</ul>
+
+<h2><a NAME="license">Licens (svenska)</a></h2>
+<p>XFree86-projektet &aring;tar sig att tillhandah&aring;lla programvara och k&auml;llkod i format som fritt kan spridas vidare. Den huvudsakliga licens vi anv&auml;nder oss av &auml;r baserad p&aring; den traditionella MIT X11 / XConsortium-licensen, vilken inte p&aring; n&aring;got s&auml;tt begr&auml;nsar f&ouml;r&auml;ndringar eller vidarespridning av vare sig k&auml;llkod eller kompilerad programvara annat &auml;n genom att kr&auml;va att delarna som r&ouml;r copyright och licensiering l&auml;mnas intakta. F&ouml;r mer information och ytterligare copyright/licensieringsinfromation r&ouml;rande vissa speciella delar av koden, se <A HREF="http://www.xfree86.org/legal/licence.html">XFree86-licenssida</A> (engelska).</p>
+
+<h3>Licence (english)</h3>
+<p>The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86 License page</A>.</p>
+
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>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:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>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 X CONSORTIUM 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.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/XDarwin.icns b/hw/darwin/bundle/XDarwin.icns
new file mode 100644
index 000000000..31dc1bdf9
--- /dev/null
+++ b/hw/darwin/bundle/XDarwin.icns
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/Credits.rtf b/hw/darwin/bundle/ko.lproj/Credits.rtf
new file mode 100644
index 000000000..3cd250116
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/Credits.rtf
@@ -0,0 +1,124 @@
+{\rtf1\mac\ansicpg10000\cocoartf100
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+\vieww5160\viewh4480\viewkind0
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b\fs24 \cf0 XonX Contributors to XFree86 4.2:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Pablo Di Noto\
+
+\f2\i Spanish localization
+\f1\i0 \
+Paul Edens\
+
+\f2\i Dutch localization
+\f1\i0 \
+Kyunghwan Kim\
+
+\f2\i Korean localization
+\f1\i0 \
+Mario Klebsch\
+
+\f2\i Non-US keyboard support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i German localization
+\f1\i0 \
+Patrik Montgomery\
+
+\f2\i Swedish localization
+\f1\i0 \
+Greg Parker\
+
+\f2\i Rootless support
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+Olivier Verdier\
+
+\f2\i French localization
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Devin Poolman and Zero G Software, Inc.\
+
+\f2\i Installer
+\f1\i0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+
+\f0\b \cf0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+\cf0 XonX Team Members\
+Contributing to XFree86 4.1:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Rob Braun\
+
+\f2\i Darwin x86 support
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Project Lead
+\f1\i0 \
+Andreas Monitzer\
+
+\f2\i Cocoa version of XDarwin front end
+\f1\i0 \
+Greg Parker\
+
+\f2\i Original Quartz implementation
+\f1\i0 \
+Christoph Pfisterer\
+
+\f2\i Dynamic shared libraries
+\f1\i0 \
+Toshimitsu Tanaka\
+
+\f2\i Japanese localization
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 Special Thanks:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 Tiago Ribeiro\
+
+\f2\i XDarwin icon
+\f1\i0 \
+\
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc
+
+\f0\b \cf0 History:
+\f1\b0 \
+\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
+\cf0 John Carmack\
+
+\f2\i Original XFree86 port to Mac OS X Server
+\f1\i0 \
+Dave Zarzycki\
+
+\f2\i XFree86 4.0 port to Darwin 1.0
+\f1\i0 \
+Torrey T. Lyons\
+
+\f2\i Integration into XFree86 Project for 4.0.2} \ No newline at end of file
diff --git a/hw/darwin/bundle/ko.lproj/Localizable.strings b/hw/darwin/bundle/ko.lproj/Localizable.strings
new file mode 100644
index 000000000..2e7137b05
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 000000000..ba1e3a206
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,64 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {showHelp = id; };
+ CLASS = FirstResponder;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {close = id; pickFile = id; saveChanges = id; setKey = id; };
+ CLASS = Preferences;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ addToPathButton = id;
+ addToPathField = id;
+ button2ModifiersMatrix = id;
+ button3ModifiersMatrix = id;
+ depthButton = id;
+ displayField = id;
+ dockSwitchButton = id;
+ fakeButton = id;
+ keymapFileField = id;
+ modeMatrix = id;
+ modeWindowButton = id;
+ mouseAccelChangeButton = id;
+ startupHelpButton = id;
+ switchKeyButton = id;
+ systemBeepButton = id;
+ useDefaultShellMatrix = id;
+ useOtherShellField = id;
+ useXineramaButton = id;
+ window = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {
+ CLASS = XApplication;
+ LANGUAGE = ObjC;
+ OUTLETS = {preferences = id; xserver = id; };
+ SUPERCLASS = NSApplication;
+ },
+ {
+ ACTIONS = {
+ closeHelpAndShow = id;
+ showAction = id;
+ startFullScreen = id;
+ startRootless = id;
+ };
+ CLASS = XServer;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ helpWindow = NSWindow;
+ modeWindow = NSWindow;
+ startFullScreenButton = NSButton;
+ startRootlessButton = NSButton;
+ startupHelpButton = NSButton;
+ startupModeButton = NSButton;
+ switchWindow = NSPanel;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib
new file mode 100644
index 000000000..e35148d76
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp b/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp
new file mode 100644
index 000000000..4c83fe278
--- /dev/null
+++ b/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp
@@ -0,0 +1,103 @@
+<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/ko.lproj/XDarwinHelp.html.cpp,v 1.1 2001/12/04 03:36:39 torrey Exp $ -->
+
+#include "xf86Version.h"
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+<html>
+<head>
+<title>XFree86 for Mac OS X</title>
+</head>
+<body>
+<center>
+ <h1>XFree86 on Darwin and Mac OS X</h1>
+ XFree86 XF86_VERSION<br>
+ Release Date: XF86_REL_DATE
+</center>
+<h2>Contents</h2>
+<ol>
+ <li><A HREF="#notice">Important Notice</A></li>
+ <li><A HREF="#usage">Usage</A></li>
+ <li><A HREF="#path">Setting Your Path</A></li>
+ <li><A HREF="#prefs">User Preferences</A></li>
+ <li><A HREF="#license">License</A></li>
+</ol>
+<center>
+ <h2><a NAME="notice">Important Notice</a></h2>
+</center>
+<blockquote>
+#if PRE_RELEASE
+This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>.
+#else
+If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge.
+#endif
+</blockquote>
+<blockquote>
+This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote>
+
+<h2><a NAME="usage">Usage</a></h2>
+<p>XFree86 is a freely redistributable open-source implementation of the <a HREF
+="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> The X window server for Darwin and Mac OS X provided by XFree86 is called XDarwin. XDarwin runs on Mac OS X in full screen or rootless modes.</p>
+<p>In full screen mode, when the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, click on the XDarwin icon in the Dock to switch back to the X window system. (You can change this behavior in the user preferences so that you must click the XDarwin icon in the floating switch window instead.)</p>
+<p>In rootless mode, the X window system and Aqua share your display. The root window of the X11 display is the size of the screen and contains all the other windows. The X11 root window is not displayed in rootless mode as Aqua handles the desktop background.</p>
+<h3>Multi-Button Mouse Emulation</h3>
+<p>Many X11 applications rely on the use of a 3-button mouse. You can emulate a 3-button mouse with a single button by holding down various modifier keys while you click the mouse button. This is controlled by settings in the "Multi-Button Mouse Emulation" section of the "General" preferences. By default, emulation is on and holding down the command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the option key and clicking will simulate the third button. You can change to any combination of modifiers to emulate buttons two and three in the preferences. Note, even if the modifiers keys are mapped to some other key with xmodmap, you still must use the actual keys specified in the preferences for multi-button mouse emulation.</p>
+
+<h2><a NAME="path">Setting Your Path</a></h2>
+<p>Your path is the list of directories to be searched for executable commands. The X11 commands are located in <code>/usr/X11R6/bin</code>, which needs to be added to your path. XDarwin does this for you by default and can also add additional directories where you have installed command line applications.</p>
+<p>More experienced users will have already set their path correctly using the initialization files for their shell. In this case, you can inform XDarwin not to modify your path in the preferences. XDarwin launches the initial X11 clients in the user's default login shell. (An alternate shell can also be specified in the preferences.) The way to set the path depends on the shell you are using. This is described in the man page documentation for the shell.</p>
+<p>In addition you may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in <code>/usr/X11R6/man</code> and the <code>MANPATH</code> environment variable contains the list of directories to search.</p>
+
+<h2><a NAME="prefs">User Preferences</a></h2>
+<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed as start up options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p>
+<h3>General</h3>
+<ul>
+ <li><b>Use System beep for X11:</b> When enabled the standard Mac OS X alert sound is used as the X11 bell. When disabled (default) a simple tone is used.</li>
+ <li><b>Allow X11 to change mouse acceleration:</b> In a standard X window system implementation, the window manager can change the mouse acceleration. This can lead to confusion as the mouse acceleration may be set to different values by the Mac OS X System Preferences and the X window manager. By default, X11 is not allowed to change the mouse acceleration to avoid this problem.</li>
+ <li><b>Multi-Button Mouse Emulation:</b> This is described above under <a HREF="#usage">Usage</a>. When emulation is enabled the selected modifiers must be held down when the mouse button is pushed to emulate the second or third mouse buttons.</li>
+</ul>
+<h3>Start Up</h3>
+<ul>
+ <li><b>Default Mode:</b> If the user does not indicate whether to run in full screen or rootless mode, the mode specified here will be used.</li>
+ <li><b>Show mode pick panel on startup:</b> By default, a panel is displayed when XDarwin is started to allow the user to choose between full screen or rootless mode. If this option is turned off, the default mode will be started automatically.</li>
+ <li><b>X11 Display number:</b> X11 allows there to be multiple displays managed by separate X servers on a single computer. The user may specify an integer display number for XDarwin to use if more than one X server is going to be run simultaneously.</li>
+ <li><b>Allow Xinerama multiple monitor support:</b> XDarwin supports multiple monitors with Xinerama, which treats all monitors as being part of one large rectangular screen. You can disable Xinerama with this option, but currently XDarwin does not handle multiple monitors correctly without it. If you only have a single monitor, Xinerama is automatically disabled.</li>
+ <li><b>Keymapping File:</b> A keymapping file is read at startup and translated to an X11 keymap. Keymapping files, available for a wide variety of languages, are found in <code>/System/Library/Keyboards</code>.</li>
+ <li><b>Starting First X11 Clients:</b> When XDarwin is started from the Finder, it will run <code>xinit</code> to launch the X window manager and other X clients. (See "<code>man xinit</code>" for more information.) Before XDarwin runs <code>xinit</code> it will add the specified directories to the user's path. By default only <code>/usr/X11R6/bin</code> is added. Additional directories may added, separated by a colon. The X clients are started in the user's default login shell so that the user's shell initialization files are read. If desired, an alternate shell may be specified.</li>
+</ul>
+<h3>Full Screen</h3>
+<ul>
+ <li><b>Key combination button:</b> Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li>
+ <li><b>Click on icon in Dock switches to X11:</b> Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li>
+ <li><b>Show help on startup:</b> This will show an introductory splash screen when XDarwin is started in full screen mode.</li>
+ <li><b>Color bit depth:</b> In full screen mode, the X11 display can use a different color bit depth than is used by Aqua. If "Current" is specified, the depth used by Aqua when XDarwin starts will be used. Otherwise 8, 15, or 24 bits may be specified.</li>
+</ul>
+
+<h2><a NAME="license">License</a></h2>
+The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which does not impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86
+License page</A>.
+<H3><A NAME="3"></A>X Consortium License</H3>
+<p>Copyright (C) 1996 X Consortium</p>
+<p>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:</p>
+<p>The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.</p>
+<p>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 X CONSORTIUM 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.</p>
+<p>Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization from
+the X Consortium.</p>
+<p>X Window System is a trademark of X Consortium, Inc.</p>
+</body>
+</html>
diff --git a/hw/darwin/bundle/startXClients.cpp b/hw/darwin/bundle/startXClients.cpp
new file mode 100644
index 000000000..b27ad46fe
--- /dev/null
+++ b/hw/darwin/bundle/startXClients.cpp
@@ -0,0 +1,24 @@
+XCOMM!/bin/sh
+
+XCOMM This script is used by XDarwin to start X clients when XDarwin is
+XCOMM launched from the Finder.
+XCOMM
+XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/startXClients.cpp,v 1.1 2001/10/18 05:03:42 torrey Exp $
+
+userclientrc=$HOME/.xinitrc
+sysclientrc=XINITDIR/xinitrc
+clientargs=""
+
+if [ -f $userclientrc ]; then
+ clientargs=$userclientrc
+else if [ -f $sysclientrc ]; then
+ clientargs=$sysclientrc
+fi
+fi
+
+if [ "x$2" != "x" ]; then
+ PATH="$PATH:$2"
+ export PATH
+fi
+
+exec xinit $clientargs -- XBINDIR/XDarwinStartup "$1" -idle
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
new file mode 100644
index 000000000..ff5ae1b33
--- /dev/null
+++ b/hw/darwin/darwin.c
@@ -0,0 +1,1025 @@
+/**************************************************************
+ *
+ * Shared code for the Darwin X Server
+ * running with Quartz or the IOKit
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001-2002 Torrey T. Lyons. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.50 2003/02/26 09:21:33 dawes Exp $ */
+
+#include "X.h"
+#include "Xproto.h"
+#include "os.h"
+#include "servermd.h"
+#include "inputstr.h"
+#include "scrnintstr.h"
+#include "mibstore.h" // mi backing store implementation
+#include "mipointer.h" // mi software cursor
+#include "micmap.h" // mi colormap code
+#include "fb.h" // fb framebuffer code
+#include "site.h"
+#include "globals.h"
+#include "xf86Version.h"
+#include "xf86Date.h"
+#include "dix.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/syslimits.h>
+#include <stdio.h>
+#include <fcntl.h>
+
+#define NO_CFPLUGIN
+#include <IOKit/IOKitLib.h>
+#include <IOKit/hidsystem/IOHIDLib.h>
+#include <IOKit/hidsystem/ev_keymap.h>
+
+#include "darwin.h"
+#include "darwinClut8.h"
+#include "quartz/quartz.h"
+#include "xfIOKit.h"
+
+/*
+ * X server shared global variables
+ */
+int darwinScreensFound = 0;
+int darwinScreenIndex = 0;
+io_connect_t darwinParamConnect = 0;
+int darwinEventFD = -1;
+Bool quartz = FALSE;
+int quartzMouseAccelChange = 1;
+int darwinFakeButtons = 0;
+
+// location of X11's (0,0) point in global screen coordinates
+int darwinMainScreenX = 0;
+int darwinMainScreenY = 0;
+
+// parameters read from the command line or user preferences
+unsigned int darwinDesiredWidth = 0, darwinDesiredHeight = 0;
+int darwinDesiredDepth = -1;
+int darwinDesiredRefresh = -1;
+char *darwinKeymapFile = "USA.keymapping";
+
+// modifier masks for faking mouse buttons
+int darwinFakeMouse2Mask = NX_COMMANDMASK;
+int darwinFakeMouse3Mask = NX_ALTERNATEMASK;
+
+static DeviceIntPtr darwinPointer;
+static DeviceIntPtr darwinKeyboard;
+
+// Common pixmap formats
+static PixmapFormatRec formats[] = {
+ { 1, 1, BITMAP_SCANLINE_PAD },
+ { 4, 8, BITMAP_SCANLINE_PAD },
+ { 8, 8, BITMAP_SCANLINE_PAD },
+ { 15, 16, BITMAP_SCANLINE_PAD },
+ { 16, 16, BITMAP_SCANLINE_PAD },
+ { 24, 32, BITMAP_SCANLINE_PAD },
+ { 32, 32, BITMAP_SCANLINE_PAD }
+};
+const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
+
+#ifndef OSNAME
+#define OSNAME " Darwin"
+#endif
+#ifndef OSVENDOR
+#define OSVENDOR ""
+#endif
+#ifndef PRE_RELEASE
+#define PRE_RELEASE XF86_VERSION_SNAP
+#endif
+
+static void
+DarwinPrintBanner()
+{
+#if PRE_RELEASE
+ ErrorF("\n"
+ "This is a pre-release version of XFree86, and is not supported in any\n"
+ "way. Bugs may be reported to XFree86@XFree86.Org and patches submitted\n"
+ "to fixes@XFree86.Org. Before reporting bugs in pre-release versions,\n"
+ "please check the latest version in the XFree86 CVS repository\n"
+ "(http://www.XFree86.Org/cvs)\n");
+#endif
+ ErrorF("\nXFree86 Version %d.%d.%d", XF86_VERSION_MAJOR, XF86_VERSION_MINOR,
+ XF86_VERSION_PATCH);
+#if XF86_VERSION_SNAP > 0
+ ErrorF(".%d", XF86_VERSION_SNAP);
+#endif
+
+#if XF86_VERSION_SNAP >= 900
+ ErrorF(" (%d.%d.0 RC %d)", XF86_VERSION_MAJOR, XF86_VERSION_MINOR + 1,
+ XF86_VERSION_SNAP - 900);
+#endif
+
+#ifdef XF86_CUSTOM_VERSION
+ ErrorF(" (%s)", XF86_CUSTOM_VERSION);
+#endif
+ ErrorF(" / X Window System\n");
+ ErrorF("(protocol Version %d, revision %d, vendor release %d)\n",
+ X_PROTOCOL, X_PROTOCOL_REVISION, VENDOR_RELEASE );
+ ErrorF("Release Date: %s\n", XF86_DATE);
+ ErrorF("\tIf the server is older than 6-12 months, or if your hardware is\n"
+ "\tnewer than the above date, look for a newer version before\n"
+ "\treporting problems. (See http://www.XFree86.Org/FAQ)\n");
+ ErrorF("Operating System:%s%s\n", OSNAME, OSVENDOR);
+#if defined(BUILDERSTRING)
+ ErrorF("%s \n",BUILDERSTRING);
+#endif
+}
+
+
+/*
+ * DarwinSaveScreen
+ * X screensaver support. Not implemented.
+ */
+static Bool DarwinSaveScreen(ScreenPtr pScreen, int on)
+{
+ // FIXME
+ if (on == SCREEN_SAVER_FORCER) {
+ } else if (on == SCREEN_SAVER_ON) {
+ } else {
+ }
+ return TRUE;
+}
+
+
+/*
+ * DarwinAddScreen
+ * This is a callback from dix during AddScreen() from InitOutput().
+ * Initialize the screen and communicate information about it back to dix.
+ */
+static Bool DarwinAddScreen(
+ int index,
+ ScreenPtr pScreen,
+ int argc,
+ char **argv )
+{
+ int bitsPerRGB, i, dpi;
+ static int foundIndex = 0;
+ Bool ret;
+ VisualPtr visual;
+ ColormapPtr pmap;
+ DarwinFramebufferPtr dfb;
+
+ // reset index of found screens for each server generation
+ if (index == 0) foundIndex = 0;
+
+ // allocate space for private per screen storage
+ dfb = xalloc(sizeof(DarwinFramebufferRec));
+ SCREEN_PRIV(pScreen) = dfb;
+
+ // setup hardware/mode specific details
+ if (quartz) {
+ ret = QuartzAddScreen(foundIndex, pScreen);
+ } else {
+ ret = XFIOKitAddScreen(foundIndex, pScreen);
+ }
+ foundIndex++;
+ if (! ret)
+ return FALSE;
+
+ bitsPerRGB = dfb->bitsPerComponent;
+
+ // reset the visual list
+ miClearVisualTypes();
+
+ // setup a single visual appropriate for our pixel type
+ if (dfb->colorType == TrueColor) {
+ if (!miSetVisualTypes( dfb->colorBitsPerPixel, TrueColorMask,
+ bitsPerRGB, TrueColor )) {
+ return FALSE;
+ }
+ } else if (dfb->colorType == PseudoColor) {
+ if (!miSetVisualTypes( dfb->colorBitsPerPixel, PseudoColorMask,
+ bitsPerRGB, PseudoColor )) {
+ return FALSE;
+ }
+ } else if (dfb->colorType == StaticColor) {
+ if (!miSetVisualTypes( dfb->colorBitsPerPixel, StaticColorMask,
+ bitsPerRGB, StaticColor )) {
+ return FALSE;
+ }
+ } else {
+ return FALSE;
+ }
+
+ miSetPixmapDepths();
+
+ // machine independent screen init
+ // setup _Screen structure in pScreen
+ if (monitorResolution)
+ dpi = monitorResolution;
+ else
+ dpi = 75;
+
+ // initialize fb
+ if (! fbScreenInit(pScreen,
+ dfb->framebuffer, // pointer to screen bitmap
+ dfb->width, dfb->height, // screen size in pixels
+ dpi, dpi, // dots per inch
+ dfb->pitch/(dfb->bitsPerPixel/8), // pixel width of framebuffer
+ dfb->bitsPerPixel)) // bits per pixel for screen
+ {
+ return FALSE;
+ }
+
+ // set the RGB order correctly for TrueColor
+ if (dfb->bitsPerPixel > 8) {
+ for (i = 0, visual = pScreen->visuals; // someday we may have more than 1
+ i < pScreen->numVisuals; i++, visual++) {
+ if (visual->class == TrueColor) {
+ visual->offsetRed = bitsPerRGB * 2;
+ visual->offsetGreen = bitsPerRGB;
+ visual->offsetBlue = 0;
+ visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed;
+ visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen;
+ visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue;
+ }
+ }
+ }
+
+#ifdef RENDER
+ if (! fbPictureInit(pScreen, 0, 0)) {
+ return FALSE;
+ }
+#endif
+
+#ifdef MITSHM
+ ShmRegisterFbFuncs(pScreen);
+#endif
+
+ // this must be initialized (why doesn't X have a default?)
+ pScreen->SaveScreen = DarwinSaveScreen;
+
+ // finish mode dependent screen setup including cursor support
+ if (quartz) {
+ if (! QuartzSetupScreen(index, pScreen)) {
+ return FALSE;
+ }
+ } else {
+ if (! XFIOKitSetupScreen(index, pScreen)) {
+ return FALSE;
+ }
+ }
+
+ // create and install the default colormap and
+ // set pScreen->blackPixel / pScreen->white
+ if (!miCreateDefColormap( pScreen )) {
+ return FALSE;
+ }
+
+ /* Set the colormap to the statically defined one if we're in 8 bit
+ * mode and we're using a fixed color map. Essentially this translates
+ * to Darwin/x86 in 8-bit mode.
+ */
+ if( (dfb->colorBitsPerPixel == 8) &&
+ (dfb->colorType == StaticColor) )
+ {
+ pmap = miInstalledMaps[pScreen->myNum];
+ visual = pmap->pVisual;
+ for( i = 0; i < visual->ColormapEntries; i++ ) {
+ pmap->red[i].co.local.red = darwinClut8[i].red;
+ pmap->red[i].co.local.green = darwinClut8[i].green;
+ pmap->red[i].co.local.blue = darwinClut8[i].blue;
+ }
+ }
+
+ dixScreenOrigins[index].x = dfb->x;
+ dixScreenOrigins[index].y = dfb->y;
+
+ ErrorF("Screen %d added: %dx%d @ (%d,%d)\n",
+ index, dfb->width, dfb->height, dfb->x, dfb->y);
+
+ return TRUE;
+}
+
+/*
+ =============================================================================
+
+ mouse and keyboard callbacks
+
+ =============================================================================
+*/
+
+/*
+ * DarwinChangePointerControl
+ * Set mouse acceleration and thresholding
+ * FIXME: We currently ignore the threshold in ctrl->threshold.
+ */
+static void DarwinChangePointerControl(
+ DeviceIntPtr device,
+ PtrCtrl *ctrl )
+{
+ kern_return_t kr;
+ double acceleration;
+
+ if (!quartzMouseAccelChange)
+ return;
+
+ acceleration = ctrl->num / ctrl->den;
+ kr = IOHIDSetMouseAcceleration( darwinParamConnect, acceleration );
+ if (kr != KERN_SUCCESS)
+ ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr );
+}
+
+
+/*
+ * DarwinMouseProc
+ * Handle the initialization, etc. of a mouse
+ */
+static int DarwinMouseProc(
+ DeviceIntPtr pPointer,
+ int what )
+{
+ char map[6];
+
+ switch (what) {
+
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ // Set button map.
+ map[1] = 1;
+ map[2] = 2;
+ map[3] = 3;
+ map[4] = 4;
+ map[5] = 5;
+ InitPointerDeviceStruct( (DevicePtr)pPointer,
+ map,
+ 5, // numbuttons (4 & 5 are scroll wheel)
+ miPointerGetMotionEvents,
+ DarwinChangePointerControl,
+ 0 );
+ break;
+
+ case DEVICE_ON:
+ pPointer->public.on = TRUE;
+ AddEnabledDevice( darwinEventFD );
+ return Success;
+
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pPointer->public.on = FALSE;
+ RemoveEnabledDevice( darwinEventFD );
+ return Success;
+ }
+
+ return Success;
+}
+
+
+/*
+ * DarwinKeybdProc
+ * Callback from X
+ */
+static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
+{
+ switch ( onoff ) {
+ case DEVICE_INIT:
+ DarwinKeyboardInit( pDev );
+ break;
+ case DEVICE_ON:
+ pDev->public.on = TRUE;
+ AddEnabledDevice( darwinEventFD );
+ break;
+ case DEVICE_OFF:
+ pDev->public.on = FALSE;
+ RemoveEnabledDevice( darwinEventFD );
+ break;
+ case DEVICE_CLOSE:
+ break;
+ }
+
+ return Success;
+}
+
+/*
+===========================================================================
+
+ Utility routines
+
+===========================================================================
+*/
+
+/*
+ * DarwinFindLibraryFile
+ * Search for a file in the standard Library paths, which are (in order):
+ *
+ * ~/Library/ user specific
+ * /Library/ host specific
+ * /Network/Library/ LAN specific
+ * /System/Library/ OS specific
+ *
+ * A sub-path can be specified to search in below the various Library
+ * directories. Returns a new character string (owned by the caller)
+ * containing the full path to the first file found.
+ */
+static char * DarwinFindLibraryFile(
+ const char *file,
+ const char *pathext )
+{
+ // Library search paths
+ char *pathList[] = {
+ "",
+ "/Network",
+ "/System",
+ NULL
+ };
+ char *home;
+ char *fullPath;
+ int i = 0;
+
+ // Return the file name as is if it is already a fully qualified path.
+ if (!access(file, F_OK)) {
+ fullPath = xalloc(strlen(file)+1);
+ strcpy(fullPath, file);
+ return fullPath;
+ }
+
+ fullPath = xalloc(PATH_MAX);
+
+ home = getenv("HOME");
+ if (home) {
+ snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", home, pathext, file);
+ if (!access(fullPath, F_OK))
+ return fullPath;
+ }
+
+ while (pathList[i]) {
+ snprintf(fullPath, PATH_MAX, "%s/Library/%s/%s", pathList[i++],
+ pathext, file);
+ if (!access(fullPath, F_OK))
+ return fullPath;
+ }
+
+ xfree(fullPath);
+ return NULL;
+}
+
+
+/*
+ * DarwinParseModifierList
+ * Parse a list of modifier names and return a corresponding modifier mask
+ */
+static int DarwinParseModifierList(
+ const char *constmodifiers) // string containing list of modifier names
+{
+ int result = 0;
+
+ if (constmodifiers) {
+ char *modifiers = strdup(constmodifiers);
+ char *modifier;
+ int nxkey;
+ char *p = modifiers;
+
+ while (p) {
+ modifier = strsep(&p, " ,+&|/"); // allow lots of separators
+ nxkey = DarwinModifierStringToNXKey(modifier);
+ if (nxkey != -1)
+ result |= DarwinModifierNXKeyToNXMask(nxkey);
+ else
+ ErrorF("fakebuttons: Unknown modifier \"%s\"\n", modifier);
+ }
+ free(modifiers);
+ }
+ return result;
+}
+
+/*
+===========================================================================
+
+ Functions needed to link against device independent X
+
+===========================================================================
+*/
+
+/*
+ * InitInput
+ * Register the keyboard and mouse devices
+ */
+void InitInput( int argc, char **argv )
+{
+ darwinPointer = AddInputDevice(DarwinMouseProc, TRUE);
+ RegisterPointerDevice( darwinPointer );
+
+ darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
+ RegisterKeyboardDevice( darwinKeyboard );
+
+ DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
+
+ if (quartz) {
+ QuartzInitInput(argc, argv);
+ } else {
+ XFIOKitInitInput(argc, argv);
+ }
+}
+
+
+/*
+ * InitOutput
+ * Initialize screenInfo for all actually accessible framebuffers.
+ *
+ * The display mode dependent code gets called three times. The mode
+ * specific InitOutput routines are expected to discover the number
+ * of potentially useful screens and cache routes to them internally.
+ * Inside DarwinAddScreen are two other mode specific calls.
+ * A mode specific AddScreen routine is called for each screen to
+ * actually initialize the screen with the ScreenPtr structure.
+ * After other screen setup has been done, a mode specific
+ * SetupScreen function can be called to finalize screen setup.
+ */
+void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
+{
+ int i, left, top;
+ static unsigned long generation = 0;
+
+ pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
+ pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
+
+ // List how we want common pixmap formats to be padded
+ pScreenInfo->numPixmapFormats = NUMFORMATS;
+ for (i = 0; i < NUMFORMATS; i++)
+ pScreenInfo->formats[i] = formats[i];
+
+ // Allocate private storage for each screen's Darwin specific info
+ if (generation != serverGeneration) {
+ darwinScreenIndex = AllocateScreenPrivateIndex();
+ generation = serverGeneration;
+ }
+
+ // Discover screens and do mode specific initialization
+ if (quartz) {
+ QuartzInitOutput(argc, argv);
+ } else {
+ XFIOKitInitOutput(argc, argv);
+ }
+
+ // Add screens
+ for (i = 0; i < darwinScreensFound; i++) {
+ AddScreen( DarwinAddScreen, argc, argv );
+ }
+
+ // Shift all screens so the X11 (0, 0) coordinate is at the top left
+ // of the global screen coordinates.
+ // Screens can be arranged so the top left isn't on any screen,
+ // so instead use the top left of the leftmost screen as (0,0).
+ // This may mean some screen space is in -y, but it's better
+ // that (0,0) be onscreen, or else default xterms disappear.
+ // It's better that -y be used than -x, because when popup
+ // menus are forced "onscreen" by dumb window managers like twm,
+ // they'll shift the menus down instead of left, which still looks
+ // funny but is an easier target to hit.
+ left = dixScreenOrigins[0].x;
+ top = dixScreenOrigins[0].y;
+
+ // Find leftmost screen. If there's a tie, take the topmost of the two.
+ for (i = 1; i < pScreenInfo->numScreens; i++) {
+ if (dixScreenOrigins[i].x < left ||
+ (dixScreenOrigins[i].x == left &&
+ dixScreenOrigins[i].y < top))
+ {
+ left = dixScreenOrigins[i].x;
+ top = dixScreenOrigins[i].y;
+ }
+ }
+
+ darwinMainScreenX = left;
+ darwinMainScreenY = top;
+
+ // Shift all screens so that there is a screen whose top left
+ // is at X11 (0,0) and at global screen coordinate
+ // (darwinMainScreenX, darwinMainScreenY).
+ if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
+ for (i = 0; i < pScreenInfo->numScreens; i++) {
+ dixScreenOrigins[i].x -= darwinMainScreenX;
+ dixScreenOrigins[i].y -= darwinMainScreenY;
+ ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n",
+ i, dixScreenOrigins[i].x, dixScreenOrigins[i].y);
+ }
+ }
+}
+
+
+/*
+ * OsVendorFataError
+ */
+void OsVendorFatalError( void )
+{
+ ErrorF( " OsVendorFatalError\n" );
+}
+
+
+/*
+ * OsVendorInit
+ * Initialization of Darwin OS support.
+ */
+void OsVendorInit(void)
+{
+ if (serverGeneration == 1) {
+ DarwinPrintBanner();
+ }
+
+ // Find the full path to the keymapping file.
+ if ( darwinKeymapFile ) {
+ char *tempStr = DarwinFindLibraryFile(darwinKeymapFile, "Keyboards");
+ if ( !tempStr )
+ FatalError("Could not find keymapping file %s.\n",
+ darwinKeymapFile);
+ darwinKeymapFile = tempStr;
+ ErrorF("Using keymapping provided in %s.\n", darwinKeymapFile);
+ } else {
+ ErrorF("Reading keymapping from the kernel.\n");
+ }
+}
+
+
+/*
+ * ddxProcessArgument --
+ * Process device-dependent command line args. Returns 0 if argument is
+ * not device dependent, otherwise Count of number of elements of argv
+ * that are part of a device dependent commandline option.
+ */
+int ddxProcessArgument( int argc, char *argv[], int i )
+{
+#ifdef DARWIN_WITH_QUARTZ
+ int numDone;
+
+ if ((numDone = QuartzProcessArgument( argc, argv, i )))
+ return numDone;
+#endif
+
+ if ( !strcmp( argv[i], "-fakebuttons" ) ) {
+ darwinFakeButtons = TRUE;
+ ErrorF( "Faking a three button mouse\n" );
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-nofakebuttons" ) ) {
+ darwinFakeButtons = FALSE;
+ ErrorF( "Not faking a three button mouse\n" );
+ return 1;
+ }
+
+ if (!strcmp( argv[i], "-fakemouse2" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-fakemouse2 must be followed by a modifer list\n" );
+ }
+ if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
+ darwinFakeMouse2Mask = 0;
+ else
+ darwinFakeMouse2Mask = DarwinParseModifierList(argv[i+1]);
+ ErrorF("Modifier mask to fake mouse button 2 = 0x%x\n",
+ darwinFakeMouse2Mask);
+ return 2;
+ }
+
+ if (!strcmp( argv[i], "-fakemouse3" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-fakemouse3 must be followed by a modifer list\n" );
+ }
+ if (!strcasecmp(argv[i+1], "none") || !strcmp(argv[i+1], ""))
+ darwinFakeMouse3Mask = 0;
+ else
+ darwinFakeMouse3Mask = DarwinParseModifierList(argv[i+1]);
+ ErrorF("Modifier mask to fake mouse button 3 = 0x%x\n",
+ darwinFakeMouse3Mask);
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-keymap" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-keymap must be followed by a filename\n" );
+ }
+ darwinKeymapFile = argv[i+1];
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-nokeymap" ) ) {
+ darwinKeymapFile = NULL;
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-size" ) ) {
+ if ( i >= argc-2 ) {
+ FatalError( "-size must be followed by two numbers\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n" );
+#else
+ darwinDesiredWidth = atoi( argv[i+1] );
+ darwinDesiredHeight = atoi( argv[i+2] );
+ ErrorF( "Attempting to use width x height = %i x %i\n",
+ darwinDesiredWidth, darwinDesiredHeight );
+#endif
+ return 3;
+ }
+
+ if ( !strcmp( argv[i], "-depth" ) ) {
+ int bitDepth;
+
+ if ( i == argc-1 ) {
+ FatalError( "-depth must be followed by a number\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n");
+#else
+ bitDepth = atoi( argv[i+1] );
+ if (bitDepth == 8)
+ darwinDesiredDepth = 0;
+ else if (bitDepth == 15)
+ darwinDesiredDepth = 1;
+ else if (bitDepth == 24)
+ darwinDesiredDepth = 2;
+ else
+ FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits\n" );
+ ErrorF( "Attempting to use pixel depth of %i\n", bitDepth );
+#endif
+ return 2;
+ }
+
+ if ( !strcmp( argv[i], "-refresh" ) ) {
+ if ( i == argc-1 ) {
+ FatalError( "-refresh must be followed by a number\n" );
+ }
+#ifdef OLD_POWERBOOK_G3
+ ErrorF( "Ignoring unsupported -refresh option on old PowerBook G3\n");
+#else
+ darwinDesiredRefresh = atoi( argv[i+1] );
+ ErrorF( "Attempting to use refresh rate of %i\n", darwinDesiredRefresh );
+#endif
+ return 2;
+ }
+
+ if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
+ DarwinPrintBanner();
+ exit(0);
+ }
+
+ // XDarwinStartup uses this argument to indicate the IOKit X server
+ // should be started. Ignore it here.
+ if ( !strcmp( argv[i], "-iokit" ) ) {
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/*
+ * ddxUseMsg --
+ * Print out correct use of device dependent commandline options.
+ * Maybe the user now knows what really to do ...
+ */
+void ddxUseMsg( void )
+{
+ ErrorF("\n");
+ ErrorF("\n");
+ ErrorF("Device Dependent Usage:\n");
+ ErrorF("\n");
+ ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n");
+ ErrorF("-nofakebuttons : don't fake a three button mouse.\n");
+ ErrorF("-fakemouse2 <modifiers> : fake middle mouse button with modifier keys.\n");
+ ErrorF("-fakemouse3 <modifiers> : fake right mouse button with modifier keys.\n");
+ ErrorF(" ex: -fakemouse2 \"option,shift\" = option-shift-click is middle button.\n");
+ ErrorF("-keymap <file> : read the keymapping from a file instead of the kernel.\n");
+ ErrorF("-version : show the server version.\n");
+ ErrorF("\n");
+#ifdef DARWIN_WITH_QUARTZ
+ ErrorF("Quartz modes:\n");
+ ErrorF("-fullscreen : run full screen in parallel with Mac OS X window server.\n");
+ ErrorF("-rootless : run rootless inside Mac OS X window server.\n");
+ ErrorF("-quartz : use default Mac OS X window server mode\n");
+ ErrorF("\n");
+ ErrorF("Options ignored in rootless mode:\n");
+#endif
+ ErrorF("-size <height> <width> : use a screen resolution of <height> x <width>.\n");
+ ErrorF("-depth <8,15,24> : use this bit depth.\n");
+ ErrorF("-refresh <rate> : use a monitor refresh rate of <rate> Hz.\n");
+ ErrorF("\n");
+}
+
+
+/*
+ * ddxGiveUp --
+ * Device dependent cleanup. Called by dix before normal server death.
+ */
+void ddxGiveUp( void )
+{
+ ErrorF( "Quitting XDarwin...\n" );
+
+ if (quartz) {
+ QuartzGiveUp();
+ } else {
+ XFIOKitGiveUp();
+ }
+}
+
+
+/*
+ * AbortDDX --
+ * DDX - specific abort routine. Called by AbortServer(). The attempt is
+ * made to restore all original setting of the displays. Also all devices
+ * are closed.
+ */
+void AbortDDX( void )
+{
+ ErrorF( " AbortDDX\n" );
+ /*
+ * This is needed for a abnormal server exit, since the normal exit stuff
+ * MUST also be performed (i.e. the vt must be left in a defined state)
+ */
+ ddxGiveUp();
+}
+
+
+#ifdef DPMSExtension
+/*
+ * DPMS extension stubs
+ */
+Bool DPMSSupported(void)
+{
+ return FALSE;
+}
+
+void DPMSSet(int level)
+{
+}
+
+int DPMSGet(int *level)
+{
+ return -1;
+}
+#endif
+
+
+#include "mivalidate.h" // for union _Validate used by windowstr.h
+#include "windowstr.h" // for struct _Window
+#include "scrnintstr.h" // for struct _Screen
+
+// This is copied from Xserver/hw/xfree86/common/xf86Helper.c.
+// Quartz mode uses this when switching in and out of Quartz.
+// Quartz or IOKit can use this when waking from sleep.
+// Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+
+/*
+ * xf86SetRootClip --
+ * Enable or disable rendering to the screen by
+ * setting the root clip list and revalidating
+ * all of the windows
+ */
+
+void
+xf86SetRootClip (ScreenPtr pScreen, BOOL enable)
+{
+ WindowPtr pWin = WindowTable[pScreen->myNum];
+ WindowPtr pChild;
+ Bool WasViewable = (Bool)(pWin->viewable);
+ Bool anyMarked = TRUE;
+ RegionPtr pOldClip = NULL, bsExposed;
+#ifdef DO_SAVE_UNDERS
+ Bool dosave = FALSE;
+#endif
+ WindowPtr pLayerWin;
+ BoxRec box;
+
+ if (WasViewable)
+ {
+ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
+ {
+ (void) (*pScreen->MarkOverlappedWindows)(pChild,
+ pChild,
+ &pLayerWin);
+ }
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ if (pWin->valdata)
+ {
+ if (HasBorder (pWin))
+ {
+ RegionPtr borderVisible;
+
+ borderVisible = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_SUBTRACT(pScreen, borderVisible,
+ &pWin->borderClip, &pWin->winSize);
+ pWin->valdata->before.borderVisible = borderVisible;
+ }
+ pWin->valdata->before.resized = TRUE;
+ }
+ }
+
+ /*
+ * Use REGION_BREAK to avoid optimizations in ValidateTree
+ * that assume the root borderClip can't change well, normally
+ * it doesn't...)
+ */
+ if (enable)
+ {
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pScreen->width;
+ box.y2 = pScreen->height;
+ REGION_RESET(pScreen, &pWin->borderClip, &box);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+ else
+ {
+ REGION_EMPTY(pScreen, &pWin->borderClip);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+
+ ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
+
+ if (WasViewable)
+ {
+ if (pWin->backStorage)
+ {
+ pOldClip = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_COPY(pScreen, pOldClip, &pWin->clipList);
+ }
+
+ if (pWin->firstChild)
+ {
+ anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
+ pWin->firstChild,
+ (WindowPtr *)NULL);
+ }
+ else
+ {
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ }
+
+#ifdef DO_SAVE_UNDERS
+ if (DO_SAVE_UNDERS(pWin))
+ {
+ dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
+ }
+#endif /* DO_SAVE_UNDERS */
+
+ if (anyMarked)
+ (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
+ }
+
+ if (pWin->backStorage &&
+ ((pWin->backingStore == Always) || WasViewable))
+ {
+ if (!WasViewable)
+ pOldClip = &pWin->clipList; /* a convenient empty region */
+ bsExposed = (*pScreen->TranslateBackingStore)
+ (pWin, 0, 0, pOldClip,
+ pWin->drawable.x, pWin->drawable.y);
+ if (WasViewable)
+ REGION_DESTROY(pScreen, pOldClip);
+ if (bsExposed)
+ {
+ RegionPtr valExposed = NullRegion;
+
+ if (pWin->valdata)
+ valExposed = &pWin->valdata->after.exposed;
+ (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
+ if (valExposed)
+ REGION_EMPTY(pScreen, valExposed);
+ REGION_DESTROY(pScreen, bsExposed);
+ }
+ }
+ if (WasViewable)
+ {
+ if (anyMarked)
+ (*pScreen->HandleExposures)(pWin);
+#ifdef DO_SAVE_UNDERS
+ if (dosave)
+ (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
+#endif /* DO_SAVE_UNDERS */
+ if (anyMarked && pScreen->PostValidateTree)
+ (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
+ }
+ if (pWin->realized)
+ WindowsRestructured ();
+ FlushAllOutput ();
+}
diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h
new file mode 100644
index 000000000..62698d74a
--- /dev/null
+++ b/hw/darwin/darwin.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2001-2002 Torrey T. Lyons. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.15 2002/12/10 00:00:38 torrey Exp $ */
+
+#ifndef _DARWIN_H
+#define _DARWIN_H
+
+#include <IOKit/IOTypes.h>
+#include "inputstr.h"
+#include "screenint.h"
+#include "extensions/XKB.h"
+#include "quartz/quartzShared.h"
+
+typedef struct {
+ void *framebuffer;
+ int x;
+ int y;
+ int width;
+ int height;
+ int pitch;
+ int colorType;
+ int bitsPerPixel;
+ int colorBitsPerPixel;
+ int bitsPerComponent;
+} DarwinFramebufferRec, *DarwinFramebufferPtr;
+
+
+void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
+
+// From darwinEvents.c
+Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr);
+void DarwinEQEnqueue(const xEvent *e);
+void DarwinEQPointerPost(xEvent *e);
+void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX);
+
+// From darwinKeyboard.c
+int DarwinModifierNXKeyToNXKeycode(int key, int side);
+void DarwinKeyboardInit(DeviceIntPtr pDev);
+int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide);
+int DarwinModifierNXKeyToNXMask(int key);
+int DarwinModifierNXMaskToNXKey(int mask);
+int DarwinModifierStringToNXKey(const char *string);
+
+#undef assert
+#define assert(x) { if ((x) == 0) \
+ FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
+#define kern_assert(x) { if ((x) != KERN_SUCCESS) \
+ FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \
+ __LINE__, __FILE__, x); }
+#define SCREEN_PRIV(pScreen) \
+ ((DarwinFramebufferPtr)pScreen->devPrivates[darwinScreenIndex].ptr)
+
+
+#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
+
+/*
+ * Global variables from darwin.c
+ */
+extern int darwinScreenIndex; // index into pScreen.devPrivates
+extern int darwinScreensFound;
+extern io_connect_t darwinParamConnect;
+extern int darwinEventFD;
+extern Bool quartz;
+
+/*
+ * Special ddx events understood by the X server
+ */
+enum {
+ kXDarwinUpdateModifiers // update all modifier keys
+ = LASTEvent+1, // (from X.h list of event names)
+ kXDarwinUpdateButtons, // update state of mouse buttons 2 and up
+ kXDarwinScrollWheel, // scroll wheel event
+ kXDarwinShow, // vt switch to X server;
+ // recapture screen and restore X drawing
+ kXDarwinHide, // vt switch away from X server;
+ // release screen and clip X drawing
+ kXDarwinSetRootClip, // enable or disable drawing to the X screen
+ kXDarwinQuit, // kill the X server and release the display
+ kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
+ kXDarwinWritePasteboard // copy X cut buffer onto Mac OS X pasteboard
+};
+
+#endif /* _DARWIN_H */
diff --git a/hw/darwin/darwinClut8.h b/hw/darwin/darwinClut8.h
new file mode 100644
index 000000000..06e7b71c5
--- /dev/null
+++ b/hw/darwin/darwinClut8.h
@@ -0,0 +1,532 @@
+/*
+ * Darwin default 8-bit Colormap for StaticColor
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.1.8.1 2003/03/04 01:31:43 torrey Exp $ */
+
+#ifndef _DARWIN_CLUT8_
+#define _DARWIN_CLUT8_
+
+#ifdef USE_NEW_CLUT
+
+static xColorItem darwinClut8[] = {
+ { 0, 0xffff, 0xffff, 0xffff, 0, 0 },
+ { 1, 0xfefe, 0xfefe, 0xfefe, 0, 0 },
+ { 2, 0xfdfd, 0xfdfd, 0xfdfd, 0, 0 },
+ { 3, 0xb8b8, 0x2727, 0x2b2b, 0, 0 },
+ { 4, 0xfcfc, 0xfcfc, 0xfcfc, 0, 0 },
+ { 5, 0xffff, 0xffff, 0x0, 0, 0 },
+ { 6, 0xfafa, 0xfafa, 0xfafa, 0, 0 },
+ { 7, 0xf9f9, 0xf9f9, 0xf9f9, 0, 0 },
+ { 8, 0xf8f8, 0xf8f8, 0xf8f8, 0, 0 },
+ { 9, 0xf7f7, 0xf7f7, 0xf7f7, 0, 0 },
+ { 10, 0xf6f6, 0xf6f6, 0xf6f6, 0, 0 },
+ { 11, 0xf5f5, 0xf5f5, 0xf5f5, 0, 0 },
+ { 12, 0xf4f4, 0xf4f4, 0xf4f4, 0, 0 },
+ { 13, 0xf2f2, 0xf2f2, 0xf2f2, 0, 0 },
+ { 14, 0xf1f1, 0xf1f1, 0xf1f1, 0, 0 },
+ { 15, 0x0, 0x0, 0x0, 0, 0 },
+ { 16, 0xefef, 0xefef, 0xefef, 0, 0 },
+ { 17, 0xeeee, 0xeeee, 0xeeee, 0, 0 },
+ { 18, 0xeded, 0xeded, 0xeded, 0, 0 },
+ { 19, 0xebeb, 0xebeb, 0xebeb, 0, 0 },
+ { 20, 0xe8e8, 0xe8e8, 0xe8e8, 0, 0 },
+ { 21, 0xe7e7, 0xe7e7, 0xe7e7, 0, 0 },
+ { 22, 0xc9c9, 0x3838, 0x3e3e, 0, 0 },
+ { 23, 0xe5e5, 0xe5e5, 0xe5e5, 0, 0 },
+ { 24, 0xffff, 0x0, 0xffff, 0, 0 },
+ { 25, 0xfbfb, 0xfbfb, 0xfbfb, 0, 0 },
+ { 26, 0xdede, 0x6c6c, 0x7272, 0, 0 },
+ { 27, 0xe0e0, 0xe0e0, 0xe0e0, 0, 0 },
+ { 28, 0xe8e8, 0x8686, 0x9090, 0, 0 },
+ { 29, 0xdede, 0xdede, 0xdede, 0, 0 },
+ { 30, 0xdddd, 0xdddd, 0xdddd, 0, 0 },
+ { 31, 0xd3d3, 0x7e7e, 0x8d8d, 0, 0 },
+ { 32, 0xd9d9, 0xd9d9, 0xd9d9, 0, 0 },
+ { 33, 0xf3f3, 0x9696, 0xa6a6, 0, 0 },
+ { 34, 0xb1b1, 0x1c1c, 0x3939, 0, 0 },
+ { 35, 0xffff, 0x0, 0x0, 0, 0 },
+ { 36, 0xbebe, 0x5e5e, 0x7272, 0, 0 },
+ { 37, 0xd3d3, 0xd3d3, 0xd3d3, 0, 0 },
+ { 38, 0xc6c6, 0x2e2e, 0x6767, 0, 0 },
+ { 39, 0xd1d1, 0xd1d1, 0xd1d1, 0, 0 },
+ { 40, 0xa3a3, 0x606, 0x4545, 0, 0 },
+ { 41, 0xcece, 0xcece, 0xcece, 0, 0 },
+ { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 },
+ { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 },
+ { 44, 0xc6c6, 0x8f8f, 0xa7a7, 0, 0 },
+ { 45, 0xe1e1, 0xd3d3, 0xd9d9, 0, 0 },
+ { 46, 0xcece, 0x9e9e, 0xb4b4, 0, 0 },
+ { 47, 0xcaca, 0xcaca, 0xcaca, 0, 0 },
+ { 48, 0xbfbf, 0x3f3f, 0x7d7d, 0, 0 },
+ { 49, 0xc9c9, 0xc9c9, 0xc9c9, 0, 0 },
+ { 50, 0xf4f4, 0x8989, 0xbebe, 0, 0 },
+ { 51, 0xc6c6, 0xc6c6, 0xc6c6, 0, 0 },
+ { 52, 0xd6d6, 0x5151, 0x9797, 0, 0 },
+ { 53, 0xc9c9, 0x2c2c, 0x8484, 0, 0 },
+ { 54, 0x9696, 0x1a1a, 0x6a6a, 0, 0 },
+ { 55, 0xc2c2, 0xc2c2, 0xc2c2, 0, 0 },
+ { 56, 0xf3f3, 0x6f6f, 0xc6c6, 0, 0 },
+ { 57, 0xe5e5, 0x4c4c, 0xbbbb, 0, 0 },
+ { 58, 0xb7b7, 0x5a5a, 0x9c9c, 0, 0 },
+ { 59, 0xbfbf, 0xbfbf, 0xbfbf, 0, 0 },
+ { 60, 0xbebe, 0xbebe, 0xbebe, 0, 0 },
+ { 61, 0xbdbd, 0xbdbd, 0xbdbd, 0, 0 },
+ { 62, 0xb8b8, 0x2121, 0xa2a2, 0, 0 },
+ { 63, 0xd3d3, 0x4444, 0xc0c0, 0, 0 },
+ { 64, 0xc2c2, 0x6666, 0xb7b7, 0, 0 },
+ { 65, 0xf4f4, 0x6666, 0xe6e6, 0, 0 },
+ { 66, 0xfcfc, 0x7373, 0xfdfd, 0, 0 },
+ { 67, 0xb9b9, 0xb9b9, 0xb9b9, 0, 0 },
+ { 68, 0xeaea, 0xdfdf, 0xeaea, 0, 0 },
+ { 69, 0xd4d4, 0x7171, 0xd5d5, 0, 0 },
+ { 70, 0xf9f9, 0x8b8b, 0xffff, 0, 0 },
+ { 71, 0xf5f5, 0xadad, 0xffff, 0, 0 },
+ { 72, 0xbcbc, 0x9292, 0xc2c2, 0, 0 },
+ { 73, 0xc7c7, 0x4f4f, 0xd9d9, 0, 0 },
+ { 74, 0xa0a0, 0x4444, 0xafaf, 0, 0 },
+ { 75, 0xc8c8, 0x8c8c, 0xd5d5, 0, 0 },
+ { 76, 0xd7d7, 0x7474, 0xf7f7, 0, 0 },
+ { 77, 0xb4b4, 0xb4b4, 0xb4b4, 0, 0 },
+ { 78, 0xdada, 0x9595, 0xf9f9, 0, 0 },
+ { 79, 0xeded, 0xcbcb, 0xffff, 0, 0 },
+ { 80, 0xb2b2, 0xb2b2, 0xb2b2, 0, 0 },
+ { 81, 0xa1a1, 0x6161, 0xd7d7, 0, 0 },
+ { 82, 0xb2b2, 0x8585, 0xe2e2, 0, 0 },
+ { 83, 0x5959, 0x2626, 0x9c9c, 0, 0 },
+ { 84, 0x7c7c, 0x5151, 0xcccc, 0, 0 },
+ { 85, 0xb0b0, 0xb0b0, 0xb0b0, 0, 0 },
+ { 86, 0xb4b4, 0x8e8e, 0xfcfc, 0, 0 },
+ { 87, 0xd5d5, 0xc0c0, 0xffff, 0, 0 },
+ { 88, 0x5d5d, 0x3232, 0xcccc, 0, 0 },
+ { 89, 0x7b7b, 0x5c5c, 0xe5e5, 0, 0 },
+ { 90, 0xc0c0, 0xb0b0, 0xfdfd, 0, 0 },
+ { 91, 0x6060, 0x5353, 0xadad, 0, 0 },
+ { 92, 0x1212, 0xc0c, 0x7e7e, 0, 0 },
+ { 93, 0x2e2e, 0x2929, 0x9999, 0, 0 },
+ { 94, 0x7979, 0x7878, 0xe9e9, 0, 0 },
+ { 95, 0x5b5b, 0x5c5c, 0xd0d0, 0, 0 },
+ { 96, 0x6969, 0x6a6a, 0xcccc, 0, 0 },
+ { 97, 0x9393, 0x9494, 0xf8f8, 0, 0 },
+ { 98, 0x9292, 0x9292, 0xc3c3, 0, 0 },
+ { 99, 0x4141, 0x4444, 0xbaba, 0, 0 },
+ { 100, 0xa8a8, 0xabab, 0xffff, 0, 0 },
+ { 101, 0xa3a3, 0xa3a3, 0xa3a3, 0, 0 },
+ { 102, 0xdbdb, 0xdddd, 0xeaea, 0, 0 },
+ { 103, 0x3131, 0x4949, 0xaaaa, 0, 0 },
+ { 104, 0x7070, 0x8f8f, 0xf9f9, 0, 0 },
+ { 105, 0x4848, 0x6666, 0xc1c1, 0, 0 },
+ { 106, 0x5c5c, 0x7e7e, 0xe9e9, 0, 0 },
+ { 107, 0xe2e2, 0xe5e5, 0xebeb, 0, 0 },
+ { 108, 0xb0b0, 0xcdcd, 0xffff, 0, 0 },
+ { 109, 0x6c6c, 0x8989, 0xb7b7, 0, 0 },
+ { 110, 0x3434, 0x6565, 0xafaf, 0, 0 },
+ { 111, 0x8c8c, 0xb9b9, 0xffff, 0, 0 },
+ { 112, 0x3737, 0x7979, 0xd4d4, 0, 0 },
+ { 113, 0x5a5a, 0x9999, 0xeaea, 0, 0 },
+ { 114, 0xe0e, 0x4c4c, 0x9595, 0, 0 },
+ { 115, 0x7979, 0xb9b9, 0xffff, 0, 0 },
+ { 116, 0x8a8a, 0xa3a3, 0xbcbc, 0, 0 },
+ { 117, 0x2020, 0x6161, 0x9d9d, 0, 0 },
+ { 118, 0x8f8f, 0xaeae, 0xcaca, 0, 0 },
+ { 119, 0xa0a, 0x6060, 0xa8a8, 0, 0 },
+ { 120, 0x3f3f, 0x9494, 0xd9d9, 0, 0 },
+ { 121, 0x6363, 0xb5b5, 0xf9f9, 0, 0 },
+ { 122, 0xe2e2, 0xe8e8, 0xeded, 0, 0 },
+ { 123, 0x2828, 0x6a6a, 0x9999, 0, 0 },
+ { 124, 0x5555, 0xb2b2, 0xe7e7, 0, 0 },
+ { 125, 0x3232, 0x8989, 0xa9a9, 0, 0 },
+ { 126, 0xcfcf, 0xdada, 0xdede, 0, 0 },
+ { 127, 0x2929, 0xa1a1, 0xc7c7, 0, 0 },
+ { 128, 0x8686, 0xa9a9, 0xb4b4, 0, 0 },
+ { 129, 0x0, 0x5f5f, 0x7979, 0, 0 },
+ { 130, 0xc0c, 0x7777, 0x8e8e, 0, 0 },
+ { 131, 0x1212, 0x8f8f, 0xabab, 0, 0 },
+ { 132, 0x4141, 0xbaba, 0xd5d5, 0, 0 },
+ { 133, 0x2424, 0x8282, 0x8383, 0, 0 },
+ { 134, 0x2c2c, 0xc4c4, 0xc3c3, 0, 0 },
+ { 135, 0x1a1a, 0xabab, 0xa6a6, 0, 0 },
+ { 136, 0x4b4b, 0xa8a8, 0xa2a2, 0, 0 },
+ { 137, 0xa0a, 0x9393, 0x8585, 0, 0 },
+ { 138, 0xd0d, 0xa5a5, 0x9696, 0, 0 },
+ { 139, 0x2626, 0xbcbc, 0xacac, 0, 0 },
+ { 140, 0x404, 0x8181, 0x7272, 0, 0 },
+ { 141, 0x1919, 0xb3b3, 0x8686, 0, 0 },
+ { 142, 0x2929, 0xc1c1, 0x9494, 0, 0 },
+ { 143, 0x2121, 0x9c9c, 0x7171, 0, 0 },
+ { 144, 0x202, 0x8c8c, 0x5050, 0, 0 },
+ { 145, 0x3535, 0xd0d0, 0x8989, 0, 0 },
+ { 146, 0x4646, 0xa5a5, 0x7676, 0, 0 },
+ { 147, 0x202, 0x7d7d, 0x3939, 0, 0 },
+ { 148, 0x2929, 0xc9c9, 0x7171, 0, 0 },
+ { 149, 0x5757, 0xd6d6, 0x8f8f, 0, 0 },
+ { 150, 0xa2a2, 0xb5b5, 0xaaaa, 0, 0 },
+ { 151, 0x101, 0x8888, 0x2a2a, 0, 0 },
+ { 152, 0x7474, 0xbebe, 0x8a8a, 0, 0 },
+ { 153, 0x1919, 0xb6b6, 0x4747, 0, 0 },
+ { 154, 0x2d2d, 0xc6c6, 0x5151, 0, 0 },
+ { 155, 0x3838, 0xdede, 0x5d5d, 0, 0 },
+ { 156, 0x4c4c, 0xf4f4, 0x6f6f, 0, 0 },
+ { 157, 0x9191, 0x9c9c, 0x9393, 0, 0 },
+ { 158, 0x0, 0x8e8e, 0x1919, 0, 0 },
+ { 159, 0x1010, 0xafaf, 0x2828, 0, 0 },
+ { 160, 0xe3e3, 0xe3e3, 0xe3e3, 0, 0 },
+ { 161, 0x808, 0xa1a1, 0x1a1a, 0, 0 },
+ { 162, 0x5959, 0xc2c2, 0x6161, 0, 0 },
+ { 163, 0xf0f0, 0xf0f0, 0xf0f0, 0, 0 },
+ { 164, 0x8f8f, 0x9c9c, 0x9090, 0, 0 },
+ { 165, 0x2323, 0xcece, 0x2a2a, 0, 0 },
+ { 166, 0x1212, 0xbaba, 0x1717, 0, 0 },
+ { 167, 0x101, 0x8a8a, 0x202, 0, 0 },
+ { 168, 0x303, 0x9a9a, 0x202, 0, 0 },
+ { 169, 0x4040, 0xe4e4, 0x4040, 0, 0 },
+ { 170, 0x808, 0xb2b2, 0x505, 0, 0 },
+ { 171, 0x1313, 0xcccc, 0xf0f, 0, 0 },
+ { 172, 0x3636, 0xd7d7, 0x3232, 0, 0 },
+ { 173, 0x2828, 0xe9e9, 0x1f1f, 0, 0 },
+ { 174, 0x5353, 0xfbfb, 0x4c4c, 0, 0 },
+ { 175, 0x6f6f, 0xafaf, 0x6a6a, 0, 0 },
+ { 176, 0x7171, 0xe0e0, 0x6767, 0, 0 },
+ { 177, 0x3232, 0xc0c0, 0x1212, 0, 0 },
+ { 178, 0x2929, 0xa5a5, 0x808, 0, 0 },
+ { 179, 0x5c5c, 0xdddd, 0x3535, 0, 0 },
+ { 180, 0x0, 0xffff, 0xffff, 0, 0 },
+ { 181, 0x6363, 0xc8c8, 0x4545, 0, 0 },
+ { 182, 0x8686, 0xfdfd, 0x5b5b, 0, 0 },
+ { 183, 0x7171, 0xf6f6, 0x3939, 0, 0 },
+ { 184, 0x5555, 0xcccc, 0x1515, 0, 0 },
+ { 185, 0x0, 0xffff, 0x0, 0, 0 },
+ { 186, 0x9090, 0xcaca, 0x6e6e, 0, 0 },
+ { 187, 0x4343, 0xa7a7, 0x101, 0, 0 },
+ { 188, 0x8d8d, 0xe4e4, 0x3737, 0, 0 },
+ { 189, 0xb3b3, 0xf0f0, 0x6464, 0, 0 },
+ { 190, 0x8585, 0x8e8e, 0x7a7a, 0, 0 },
+ { 191, 0xb0b0, 0xfafa, 0x4d4d, 0, 0 },
+ { 192, 0xd6d6, 0xd6d6, 0xd6d6, 0, 0 },
+ { 193, 0x8888, 0xd0d0, 0x1a1a, 0, 0 },
+ { 194, 0x6a6a, 0xa7a7, 0x303, 0, 0 },
+ { 195, 0x9898, 0xbfbf, 0x4141, 0, 0 },
+ { 196, 0xcdcd, 0xf8f8, 0x5151, 0, 0 },
+ { 197, 0x9494, 0xa4a4, 0x5555, 0, 0 },
+ { 198, 0x9191, 0xb0b0, 0xa0a, 0, 0 },
+ { 199, 0xdada, 0xf1f1, 0x3c3c, 0, 0 },
+ { 200, 0xbaba, 0xcaca, 0x5353, 0, 0 },
+ { 201, 0xb9b9, 0xc3c3, 0x2828, 0, 0 },
+ { 202, 0xb1b1, 0xbaba, 0x1212, 0, 0 },
+ { 203, 0xd2d2, 0xd9d9, 0x2626, 0, 0 },
+ { 204, 0xe8e8, 0xecec, 0x2d2d, 0, 0 },
+ { 205, 0x9898, 0x9696, 0x202, 0, 0 },
+ { 206, 0xadad, 0xadad, 0x5c5c, 0, 0 },
+ { 207, 0xe2e2, 0xd8d8, 0x3838, 0, 0 },
+ { 208, 0xd9d9, 0xc4c4, 0x3838, 0, 0 },
+ { 209, 0xa8a8, 0x9a9a, 0x5050, 0, 0 },
+ { 210, 0x0, 0x0, 0xffff, 0, 0 },
+ { 211, 0xbebe, 0xaeae, 0x5e5e, 0, 0 },
+ { 212, 0x9a9a, 0x9898, 0x8e8e, 0, 0 },
+ { 213, 0xacac, 0x8d8d, 0xd0d, 0, 0 },
+ { 214, 0xc5c5, 0xa0a0, 0x2b2b, 0, 0 },
+ { 215, 0xdbdb, 0xb5b5, 0x4848, 0, 0 },
+ { 216, 0xdddd, 0x0, 0x0, 0, 0 },
+ { 217, 0x9c9c, 0x6d6d, 0x303, 0, 0 },
+ { 218, 0xd4d4, 0xa8a8, 0x4747, 0, 0 },
+ { 219, 0xb7b7, 0x7171, 0x1717, 0, 0 },
+ { 220, 0xdcdc, 0xa1a1, 0x5a5a, 0, 0 },
+ { 221, 0xb9b9, 0x9c9c, 0x7c7c, 0, 0 },
+ { 222, 0xb4b4, 0xabab, 0xa2a2, 0, 0 },
+ { 223, 0x9e9e, 0x4b4b, 0x101, 0, 0 },
+ { 224, 0xc8c8, 0x7878, 0x3535, 0, 0 },
+ { 225, 0xd2d2, 0x8d8d, 0x5151, 0, 0 },
+ { 226, 0xadad, 0x5252, 0xf0f, 0, 0 },
+ { 227, 0x0, 0xbbbb, 0x0, 0, 0 },
+ { 228, 0xb2b2, 0x6666, 0x3838, 0, 0 },
+ { 229, 0xb1b1, 0xa6a6, 0x9f9f, 0, 0 },
+ { 230, 0xb1b1, 0x8787, 0x6f6f, 0, 0 },
+ { 231, 0xa4a4, 0x3434, 0x303, 0, 0 },
+ { 232, 0xeeee, 0x9e9e, 0x8585, 0, 0 },
+ { 233, 0xc9c9, 0x7373, 0x5a5a, 0, 0 },
+ { 234, 0xe6e6, 0x9494, 0x7c7c, 0, 0 },
+ { 235, 0xa9a9, 0x2222, 0x606, 0, 0 },
+ { 236, 0xdbdb, 0x8787, 0x7474, 0, 0 },
+ { 237, 0xb0b0, 0x2e2e, 0x1515, 0, 0 },
+ { 238, 0xb7b7, 0x5a5a, 0x5050, 0, 0 },
+ { 239, 0xb2b2, 0x4242, 0x3b3b, 0, 0 },
+ { 240, 0xcdcd, 0x7373, 0x6e6e, 0, 0 },
+ { 241, 0xd9d9, 0x5858, 0x5858, 0, 0 },
+ { 242, 0xacac, 0xacac, 0xacac, 0, 0 },
+ { 243, 0xa0a0, 0xa0a0, 0xa0a0, 0, 0 },
+ { 244, 0x9a9a, 0x9a9a, 0x9a9a, 0, 0 },
+ { 245, 0x9292, 0x9292, 0x9292, 0, 0 },
+ { 246, 0x8e8e, 0x8e8e, 0x8e8e, 0, 0 },
+ { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 },
+ { 248, 0x8181, 0x8181, 0x8181, 0, 0 },
+ { 249, 0x8888, 0x8888, 0x8888, 0, 0 },
+ { 250, 0x7777, 0x7777, 0x7777, 0, 0 },
+ { 251, 0x5555, 0x5555, 0x5555, 0, 0 },
+ { 252, 0x4444, 0x4444, 0x4444, 0, 0 },
+ { 253, 0x2222, 0x2222, 0x2222, 0, 0 },
+ { 254, 0x7b7b, 0x7b7b, 0x7b7b, 0, 0 },
+ { 255, 0x0, 0x0, 0x0, 0, 0 },
+};
+
+#else /* !USE_NEW_CLUT */
+
+static xColorItem darwinClut8[] = {
+ { 0, 0x0000, 0x0000, 0x0000, 0, 0 },
+ { 1, 0xffff, 0xffff, 0xcccc, 0, 0 },
+ { 2, 0xffff, 0xffff, 0x9999, 0, 0 },
+ { 3, 0xffff, 0xffff, 0x6666, 0, 0 },
+ { 4, 0xffff, 0xffff, 0x3333, 0, 0 },
+ { 5, 0xffff, 0xffff, 0x0000, 0, 0 },
+ { 6, 0xffff, 0xcccc, 0xffff, 0, 0 },
+ { 7, 0xffff, 0xcccc, 0xcccc, 0, 0 },
+ { 8, 0xffff, 0xcccc, 0x9999, 0, 0 },
+ { 9, 0xffff, 0xcccc, 0x6666, 0, 0 },
+ { 10, 0xffff, 0xcccc, 0x3333, 0, 0 },
+ { 11, 0xffff, 0xcccc, 0x0000, 0, 0 },
+ { 12, 0xffff, 0x9999, 0xffff, 0, 0 },
+ { 13, 0xffff, 0x9999, 0xcccc, 0, 0 },
+ { 14, 0xffff, 0x9999, 0x9999, 0, 0 },
+ { 15, 0xffff, 0x9999, 0x6666, 0, 0 },
+ { 16, 0xffff, 0x9999, 0x3333, 0, 0 },
+ { 17, 0xffff, 0x9999, 0x0000, 0, 0 },
+ { 18, 0xffff, 0x6666, 0xffff, 0, 0 },
+ { 19, 0xffff, 0x6666, 0xcccc, 0, 0 },
+ { 20, 0xffff, 0x6666, 0x9999, 0, 0 },
+ { 21, 0xffff, 0x6666, 0x6666, 0, 0 },
+ { 22, 0xffff, 0x6666, 0x3333, 0, 0 },
+ { 23, 0xffff, 0x6666, 0x0000, 0, 0 },
+ { 24, 0xffff, 0x3333, 0xffff, 0, 0 },
+ { 25, 0xffff, 0x3333, 0xcccc, 0, 0 },
+ { 26, 0xffff, 0x3333, 0x9999, 0, 0 },
+ { 27, 0xffff, 0x3333, 0x6666, 0, 0 },
+ { 28, 0xffff, 0x3333, 0x3333, 0, 0 },
+ { 29, 0xffff, 0x3333, 0x0000, 0, 0 },
+ { 30, 0xffff, 0x0000, 0xffff, 0, 0 },
+ { 31, 0xffff, 0x0000, 0xcccc, 0, 0 },
+ { 32, 0xffff, 0x0000, 0x9999, 0, 0 },
+ { 33, 0xffff, 0x0000, 0x6666, 0, 0 },
+ { 34, 0xffff, 0x0000, 0x3333, 0, 0 },
+ { 35, 0xffff, 0x0000, 0x0000, 0, 0 },
+ { 36, 0xcccc, 0xffff, 0xffff, 0, 0 },
+ { 37, 0xcccc, 0xffff, 0xcccc, 0, 0 },
+ { 38, 0xcccc, 0xffff, 0x9999, 0, 0 },
+ { 39, 0xcccc, 0xffff, 0x6666, 0, 0 },
+ { 40, 0xcccc, 0xffff, 0x3333, 0, 0 },
+ { 41, 0xcccc, 0xffff, 0x0000, 0, 0 },
+ { 42, 0xcccc, 0xcccc, 0xffff, 0, 0 },
+ { 43, 0xcccc, 0xcccc, 0xcccc, 0, 0 },
+ { 44, 0xcccc, 0xcccc, 0x9999, 0, 0 },
+ { 45, 0xcccc, 0xcccc, 0x6666, 0, 0 },
+ { 46, 0xcccc, 0xcccc, 0x3333, 0, 0 },
+ { 47, 0xcccc, 0xcccc, 0x0000, 0, 0 },
+ { 48, 0xcccc, 0x9999, 0xffff, 0, 0 },
+ { 49, 0xcccc, 0x9999, 0xcccc, 0, 0 },
+ { 50, 0xcccc, 0x9999, 0x9999, 0, 0 },
+ { 51, 0xcccc, 0x9999, 0x6666, 0, 0 },
+ { 52, 0xcccc, 0x9999, 0x3333, 0, 0 },
+ { 53, 0xcccc, 0x9999, 0x0000, 0, 0 },
+ { 54, 0xcccc, 0x6666, 0xffff, 0, 0 },
+ { 55, 0xcccc, 0x6666, 0xcccc, 0, 0 },
+ { 56, 0xcccc, 0x6666, 0x9999, 0, 0 },
+ { 57, 0xcccc, 0x6666, 0x6666, 0, 0 },
+ { 58, 0xcccc, 0x6666, 0x3333, 0, 0 },
+ { 59, 0xcccc, 0x6666, 0x0000, 0, 0 },
+ { 60, 0xcccc, 0x3333, 0xffff, 0, 0 },
+ { 61, 0xcccc, 0x3333, 0xcccc, 0, 0 },
+ { 62, 0xcccc, 0x3333, 0x9999, 0, 0 },
+ { 63, 0xcccc, 0x3333, 0x6666, 0, 0 },
+ { 64, 0xcccc, 0x3333, 0x3333, 0, 0 },
+ { 65, 0xcccc, 0x3333, 0x0000, 0, 0 },
+ { 66, 0xcccc, 0x0000, 0xffff, 0, 0 },
+ { 67, 0xcccc, 0x0000, 0xcccc, 0, 0 },
+ { 68, 0xcccc, 0x0000, 0x9999, 0, 0 },
+ { 69, 0xcccc, 0x0000, 0x6666, 0, 0 },
+ { 70, 0xcccc, 0x0000, 0x3333, 0, 0 },
+ { 71, 0xcccc, 0x0000, 0x0000, 0, 0 },
+ { 72, 0x9999, 0xffff, 0xffff, 0, 0 },
+ { 73, 0x9999, 0xffff, 0xcccc, 0, 0 },
+ { 74, 0x9999, 0xffff, 0x9999, 0, 0 },
+ { 75, 0x9999, 0xffff, 0x6666, 0, 0 },
+ { 76, 0x9999, 0xffff, 0x3333, 0, 0 },
+ { 77, 0x9999, 0xffff, 0x0000, 0, 0 },
+ { 78, 0x9999, 0xcccc, 0xffff, 0, 0 },
+ { 79, 0x9999, 0xcccc, 0xcccc, 0, 0 },
+ { 80, 0x9999, 0xcccc, 0x9999, 0, 0 },
+ { 81, 0x9999, 0xcccc, 0x6666, 0, 0 },
+ { 82, 0x9999, 0xcccc, 0x3333, 0, 0 },
+ { 83, 0x9999, 0xcccc, 0x0000, 0, 0 },
+ { 84, 0x9999, 0x9999, 0xffff, 0, 0 },
+ { 85, 0x9999, 0x9999, 0xcccc, 0, 0 },
+ { 86, 0x9999, 0x9999, 0x9999, 0, 0 },
+ { 87, 0x9999, 0x9999, 0x6666, 0, 0 },
+ { 88, 0x9999, 0x9999, 0x3333, 0, 0 },
+ { 89, 0x9999, 0x9999, 0x0000, 0, 0 },
+ { 90, 0x9999, 0x6666, 0xffff, 0, 0 },
+ { 91, 0x9999, 0x6666, 0xcccc, 0, 0 },
+ { 92, 0x9999, 0x6666, 0x9999, 0, 0 },
+ { 93, 0x9999, 0x6666, 0x6666, 0, 0 },
+ { 94, 0x9999, 0x6666, 0x3333, 0, 0 },
+ { 95, 0x9999, 0x6666, 0x0000, 0, 0 },
+ { 96, 0x9999, 0x3333, 0xffff, 0, 0 },
+ { 97, 0x9999, 0x3333, 0xcccc, 0, 0 },
+ { 98, 0x9999, 0x3333, 0x9999, 0, 0 },
+ { 99, 0x9999, 0x3333, 0x6666, 0, 0 },
+ { 100, 0x9999, 0x3333, 0x3333, 0, 0 },
+ { 101, 0x9999, 0x3333, 0x0000, 0, 0 },
+ { 102, 0x9999, 0x0000, 0xffff, 0, 0 },
+ { 103, 0x9999, 0x0000, 0xcccc, 0, 0 },
+ { 104, 0x9999, 0x0000, 0x9999, 0, 0 },
+ { 105, 0x9999, 0x0000, 0x6666, 0, 0 },
+ { 106, 0x9999, 0x0000, 0x3333, 0, 0 },
+ { 107, 0x9999, 0x0000, 0x0000, 0, 0 },
+ { 108, 0x6666, 0xffff, 0xffff, 0, 0 },
+ { 109, 0x6666, 0xffff, 0xcccc, 0, 0 },
+ { 110, 0x6666, 0xffff, 0x9999, 0, 0 },
+ { 111, 0x6666, 0xffff, 0x6666, 0, 0 },
+ { 112, 0x6666, 0xffff, 0x3333, 0, 0 },
+ { 113, 0x6666, 0xffff, 0x0000, 0, 0 },
+ { 114, 0x6666, 0xcccc, 0xffff, 0, 0 },
+ { 115, 0x6666, 0xcccc, 0xcccc, 0, 0 },
+ { 116, 0x6666, 0xcccc, 0x9999, 0, 0 },
+ { 117, 0x6666, 0xcccc, 0x6666, 0, 0 },
+ { 118, 0x6666, 0xcccc, 0x3333, 0, 0 },
+ { 119, 0x6666, 0xcccc, 0x0000, 0, 0 },
+ { 120, 0x6666, 0x9999, 0xffff, 0, 0 },
+ { 121, 0x6666, 0x9999, 0xcccc, 0, 0 },
+ { 122, 0x6666, 0x9999, 0x9999, 0, 0 },
+ { 123, 0x6666, 0x9999, 0x6666, 0, 0 },
+ { 124, 0x6666, 0x9999, 0x3333, 0, 0 },
+ { 125, 0x6666, 0x9999, 0x0000, 0, 0 },
+ { 126, 0x6666, 0x6666, 0xffff, 0, 0 },
+ { 127, 0x6666, 0x6666, 0xcccc, 0, 0 },
+ { 128, 0x6666, 0x6666, 0x9999, 0, 0 },
+ { 129, 0x6666, 0x6666, 0x6666, 0, 0 },
+ { 130, 0x6666, 0x6666, 0x3333, 0, 0 },
+ { 131, 0x6666, 0x6666, 0x0000, 0, 0 },
+ { 132, 0x6666, 0x3333, 0xffff, 0, 0 },
+ { 133, 0x6666, 0x3333, 0xcccc, 0, 0 },
+ { 134, 0x6666, 0x3333, 0x9999, 0, 0 },
+ { 135, 0x6666, 0x3333, 0x6666, 0, 0 },
+ { 136, 0x6666, 0x3333, 0x3333, 0, 0 },
+ { 137, 0x6666, 0x3333, 0x0000, 0, 0 },
+ { 138, 0x6666, 0x0000, 0xffff, 0, 0 },
+ { 139, 0x6666, 0x0000, 0xcccc, 0, 0 },
+ { 140, 0x6666, 0x0000, 0x9999, 0, 0 },
+ { 141, 0x6666, 0x0000, 0x6666, 0, 0 },
+ { 142, 0x6666, 0x0000, 0x3333, 0, 0 },
+ { 143, 0x6666, 0x0000, 0x0000, 0, 0 },
+ { 144, 0x3333, 0xffff, 0xffff, 0, 0 },
+ { 145, 0x3333, 0xffff, 0xcccc, 0, 0 },
+ { 146, 0x3333, 0xffff, 0x9999, 0, 0 },
+ { 147, 0x3333, 0xffff, 0x6666, 0, 0 },
+ { 148, 0x3333, 0xffff, 0x3333, 0, 0 },
+ { 149, 0x3333, 0xffff, 0x0000, 0, 0 },
+ { 150, 0x3333, 0xcccc, 0xffff, 0, 0 },
+ { 151, 0x3333, 0xcccc, 0xcccc, 0, 0 },
+ { 152, 0x3333, 0xcccc, 0x9999, 0, 0 },
+ { 153, 0x3333, 0xcccc, 0x6666, 0, 0 },
+ { 154, 0x3333, 0xcccc, 0x3333, 0, 0 },
+ { 155, 0x3333, 0xcccc, 0x0000, 0, 0 },
+ { 156, 0x3333, 0x9999, 0xffff, 0, 0 },
+ { 157, 0x3333, 0x9999, 0xcccc, 0, 0 },
+ { 158, 0x3333, 0x9999, 0x9999, 0, 0 },
+ { 159, 0x3333, 0x9999, 0x6666, 0, 0 },
+ { 160, 0x3333, 0x9999, 0x3333, 0, 0 },
+ { 161, 0x3333, 0x9999, 0x0000, 0, 0 },
+ { 162, 0x3333, 0x6666, 0xffff, 0, 0 },
+ { 163, 0x3333, 0x6666, 0xcccc, 0, 0 },
+ { 164, 0x3333, 0x6666, 0x9999, 0, 0 },
+ { 165, 0x3333, 0x6666, 0x6666, 0, 0 },
+ { 166, 0x3333, 0x6666, 0x3333, 0, 0 },
+ { 167, 0x3333, 0x6666, 0x0000, 0, 0 },
+ { 168, 0x3333, 0x3333, 0xffff, 0, 0 },
+ { 169, 0x3333, 0x3333, 0xcccc, 0, 0 },
+ { 170, 0x3333, 0x3333, 0x9999, 0, 0 },
+ { 171, 0x3333, 0x3333, 0x6666, 0, 0 },
+ { 172, 0x3333, 0x3333, 0x3333, 0, 0 },
+ { 173, 0x3333, 0x3333, 0x0000, 0, 0 },
+ { 174, 0x3333, 0x0000, 0xffff, 0, 0 },
+ { 175, 0x3333, 0x0000, 0xcccc, 0, 0 },
+ { 176, 0x3333, 0x0000, 0x9999, 0, 0 },
+ { 177, 0x3333, 0x0000, 0x6666, 0, 0 },
+ { 178, 0x3333, 0x0000, 0x3333, 0, 0 },
+ { 179, 0x3333, 0x0000, 0x0000, 0, 0 },
+ { 180, 0x0000, 0xffff, 0xffff, 0, 0 },
+ { 181, 0x0000, 0xffff, 0xcccc, 0, 0 },
+ { 182, 0x0000, 0xffff, 0x9999, 0, 0 },
+ { 183, 0x0000, 0xffff, 0x6666, 0, 0 },
+ { 184, 0x0000, 0xffff, 0x3333, 0, 0 },
+ { 185, 0x0000, 0xffff, 0x0000, 0, 0 },
+ { 186, 0x0000, 0xcccc, 0xffff, 0, 0 },
+ { 187, 0x0000, 0xcccc, 0xcccc, 0, 0 },
+ { 188, 0x0000, 0xcccc, 0x9999, 0, 0 },
+ { 189, 0x0000, 0xcccc, 0x6666, 0, 0 },
+ { 190, 0x0000, 0xcccc, 0x3333, 0, 0 },
+ { 191, 0x0000, 0xcccc, 0x0000, 0, 0 },
+ { 192, 0x0000, 0x9999, 0xffff, 0, 0 },
+ { 193, 0x0000, 0x9999, 0xcccc, 0, 0 },
+ { 194, 0x0000, 0x9999, 0x9999, 0, 0 },
+ { 195, 0x0000, 0x9999, 0x6666, 0, 0 },
+ { 196, 0x0000, 0x9999, 0x3333, 0, 0 },
+ { 197, 0x0000, 0x9999, 0x0000, 0, 0 },
+ { 198, 0x0000, 0x6666, 0xffff, 0, 0 },
+ { 199, 0x0000, 0x6666, 0xcccc, 0, 0 },
+ { 200, 0x0000, 0x6666, 0x9999, 0, 0 },
+ { 201, 0x0000, 0x6666, 0x6666, 0, 0 },
+ { 202, 0x0000, 0x6666, 0x3333, 0, 0 },
+ { 203, 0x0000, 0x6666, 0x0000, 0, 0 },
+ { 204, 0x0000, 0x3333, 0xffff, 0, 0 },
+ { 205, 0x0000, 0x3333, 0xcccc, 0, 0 },
+ { 206, 0x0000, 0x3333, 0x9999, 0, 0 },
+ { 207, 0x0000, 0x3333, 0x6666, 0, 0 },
+ { 208, 0x0000, 0x3333, 0x3333, 0, 0 },
+ { 209, 0x0000, 0x3333, 0x0000, 0, 0 },
+ { 210, 0x0000, 0x0000, 0xffff, 0, 0 },
+ { 211, 0x0000, 0x0000, 0xcccc, 0, 0 },
+ { 212, 0x0000, 0x0000, 0x9999, 0, 0 },
+ { 213, 0x0000, 0x0000, 0x6666, 0, 0 },
+ { 214, 0x0000, 0x0000, 0x3333, 0, 0 },
+ { 215, 0xeeee, 0x0000, 0x0000, 0, 0 },
+ { 216, 0xdddd, 0x0000, 0x0000, 0, 0 },
+ { 217, 0xbbbb, 0x0000, 0x0000, 0, 0 },
+ { 218, 0xaaaa, 0x0000, 0x0000, 0, 0 },
+ { 219, 0x8888, 0x0000, 0x0000, 0, 0 },
+ { 220, 0x7777, 0x0000, 0x0000, 0, 0 },
+ { 221, 0x5555, 0x0000, 0x0000, 0, 0 },
+ { 222, 0x4444, 0x0000, 0x0000, 0, 0 },
+ { 223, 0x2222, 0x0000, 0x0000, 0, 0 },
+ { 224, 0x1111, 0x0000, 0x0000, 0, 0 },
+ { 225, 0x0000, 0xeeee, 0x0000, 0, 0 },
+ { 226, 0x0000, 0xdddd, 0x0000, 0, 0 },
+ { 227, 0x0000, 0xbbbb, 0x0000, 0, 0 },
+ { 228, 0x0000, 0xaaaa, 0x0000, 0, 0 },
+ { 229, 0x0000, 0x8888, 0x0000, 0, 0 },
+ { 230, 0x0000, 0x7777, 0x0000, 0, 0 },
+ { 231, 0x0000, 0x5555, 0x0000, 0, 0 },
+ { 232, 0x0000, 0x4444, 0x0000, 0, 0 },
+ { 233, 0x0000, 0x2222, 0x0000, 0, 0 },
+ { 234, 0x0000, 0x1111, 0x0000, 0, 0 },
+ { 235, 0x0000, 0x0000, 0xeeee, 0, 0 },
+ { 236, 0x0000, 0x0000, 0xdddd, 0, 0 },
+ { 237, 0x0000, 0x0000, 0xbbbb, 0, 0 },
+ { 238, 0x0000, 0x0000, 0xaaaa, 0, 0 },
+ { 239, 0x0000, 0x0000, 0x8888, 0, 0 },
+ { 240, 0x0000, 0x0000, 0x7777, 0, 0 },
+ { 241, 0x0000, 0x0000, 0x5555, 0, 0 },
+ { 242, 0x0000, 0x0000, 0x4444, 0, 0 },
+ { 243, 0x0000, 0x0000, 0x2222, 0, 0 },
+ { 244, 0x0000, 0x0000, 0x1111, 0, 0 },
+ { 245, 0xeeee, 0xeeee, 0xeeee, 0, 0 },
+ { 246, 0xdddd, 0xdddd, 0xdddd, 0, 0 },
+ { 247, 0xbbbb, 0xbbbb, 0xbbbb, 0, 0 },
+ { 248, 0xaaaa, 0xaaaa, 0xaaaa, 0, 0 },
+ { 249, 0x8888, 0x8888, 0x8888, 0, 0 },
+ { 250, 0x7777, 0x7777, 0x7777, 0, 0 },
+ { 251, 0x5555, 0x5555, 0x5555, 0, 0 },
+ { 252, 0x4444, 0x4444, 0x4444, 0, 0 },
+ { 253, 0x2222, 0x2222, 0x2222, 0, 0 },
+ { 254, 0x1111, 0x1111, 0x1111, 0, 0 },
+ { 255, 0xffff, 0xffff, 0xffff, 0, 0 }
+};
+#endif /* USE_NEW_CLUT */
+
+#endif /* _DARWIN_CLUT8_ */
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
new file mode 100644
index 000000000..72d7eff05
--- /dev/null
+++ b/hw/darwin/darwinEvents.c
@@ -0,0 +1,438 @@
+/*
+ * Darwin event queue and event handling
+ */
+/*
+Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved.
+
+This file is based on mieq.c by Keith Packard,
+which contains the following copyright:
+Copyright 1990, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+
+#define NEED_EVENTS
+#include "X.h"
+#include "Xmd.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "inputstr.h"
+#include "mi.h"
+#include "scrnintstr.h"
+#include "mipointer.h"
+
+#include "darwin.h"
+#include "quartz/quartz.h"
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <unistd.h>
+#include <IOKit/hidsystem/IOLLEvent.h>
+
+/* Fake button press/release for scroll wheel move. */
+#define SCROLLWHEELUPFAKE 4
+#define SCROLLWHEELDOWNFAKE 5
+
+#define QUEUE_SIZE 256
+
+typedef struct _Event {
+ xEvent event;
+ ScreenPtr pScreen;
+} EventRec, *EventPtr;
+
+typedef struct _EventQueue {
+ HWEventQueueType head, tail; /* long for SetInputCheck */
+ CARD32 lastEventTime; /* to avoid time running backwards */
+ Bool lastMotion;
+ EventRec events[QUEUE_SIZE]; /* static allocation for signals */
+ DevicePtr pKbd, pPtr; /* device pointer, to get funcs */
+ ScreenPtr pEnqueueScreen; /* screen events are being delivered to */
+ ScreenPtr pDequeueScreen; /* screen events are being dispatched to */
+} EventQueueRec, *EventQueuePtr;
+
+static EventQueueRec darwinEventQueue;
+
+
+/*
+ * DarwinPressModifierMask
+ * Press or release the given modifier key, specified by its mask.
+ */
+static void DarwinPressModifierMask(
+ xEvent *xe, // must already have type, time and mouse location
+ int mask) // one of NX_*MASK constants
+{
+ int key = DarwinModifierNXMaskToNXKey(mask);
+
+ if (key != -1) {
+ int keycode = DarwinModifierNXKeyToNXKeycode(key, 0);
+ if (keycode != 0) {
+ xe->u.u.detail = keycode + MIN_KEYCODE;
+ (*darwinEventQueue.pKbd->processInputProc)(xe,
+ (DeviceIntPtr)darwinEventQueue.pKbd, 1);
+ }
+ }
+}
+
+
+/*
+ * DarwinUpdateModifiers
+ * Send events to update the modifier state.
+ */
+static void DarwinUpdateModifiers(
+ xEvent *xe, // event template with time and mouse position set
+ int pressed, // KeyPress or KeyRelease
+ int flags ) // modifier flags that have changed
+{
+ xe->u.u.type = pressed;
+ if (flags & NX_ALPHASHIFTMASK) {
+ DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK);
+ }
+ if (flags & NX_COMMANDMASK) {
+ DarwinPressModifierMask(xe, NX_COMMANDMASK);
+ }
+ if (flags & NX_CONTROLMASK) {
+ DarwinPressModifierMask(xe, NX_CONTROLMASK);
+ }
+ if (flags & NX_ALTERNATEMASK) {
+ DarwinPressModifierMask(xe, NX_ALTERNATEMASK);
+ }
+ if (flags & NX_SHIFTMASK) {
+ DarwinPressModifierMask(xe, NX_SHIFTMASK);
+ }
+ if (flags & NX_SECONDARYFNMASK) {
+ DarwinPressModifierMask(xe, NX_SECONDARYFNMASK);
+ }
+}
+
+
+/*
+ * DarwinSimulateMouseClick
+ * Send a mouse click to X when multiple mouse buttons are simulated
+ * with modifier-clicks, such as command-click for button 2. The dix
+ * layer is told that the previously pressed modifier key(s) are
+ * released, the simulated click event is sent. After the mouse button
+ * is released, the modifier keys are reverted to their actual state,
+ * which may or may not be pressed at that point. This is usually
+ * closest to what the user wants. Ie. the user typically wants to
+ * simulate a button 2 press instead of Command-button 2.
+ */
+static void DarwinSimulateMouseClick(
+ xEvent *xe, // event template with time and
+ // mouse position filled in
+ int whichButton, // mouse button to be pressed
+ int modifierMask) // modifiers used for the fake click
+{
+ // first fool X into forgetting about the keys
+ DarwinUpdateModifiers(xe, KeyRelease, modifierMask);
+
+ // push the mouse button
+ xe->u.u.type = ButtonPress;
+ xe->u.u.detail = whichButton;
+ (*darwinEventQueue.pPtr->processInputProc)
+ (xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+}
+
+
+Bool
+DarwinEQInit(
+ DevicePtr pKbd,
+ DevicePtr pPtr)
+{
+ darwinEventQueue.head = darwinEventQueue.tail = 0;
+ darwinEventQueue.lastEventTime = GetTimeInMillis ();
+ darwinEventQueue.pKbd = pKbd;
+ darwinEventQueue.pPtr = pPtr;
+ darwinEventQueue.pEnqueueScreen = screenInfo.screens[0];
+ darwinEventQueue.pDequeueScreen = darwinEventQueue.pEnqueueScreen;
+ SetInputCheck (&darwinEventQueue.head, &darwinEventQueue.tail);
+ return TRUE;
+}
+
+
+/*
+ * DarwinEQEnqueue
+ * Must be thread safe with ProcessInputEvents.
+ * DarwinEQEnqueue - called from event gathering thread
+ * ProcessInputEvents - called from X server thread
+ * DarwinEQEnqueue should never be called from more than one thread.
+ */
+void
+DarwinEQEnqueue(
+ const xEvent *e)
+{
+ HWEventQueueType oldtail, newtail;
+
+ oldtail = darwinEventQueue.tail;
+
+ // mieqEnqueue() collapses successive motion events into one event.
+ // This is difficult to do in a thread-safe way and rarely useful.
+
+ newtail = oldtail + 1;
+ if (newtail == QUEUE_SIZE)
+ newtail = 0;
+ /* Toss events which come in late */
+ if (newtail == darwinEventQueue.head)
+ return;
+
+ darwinEventQueue.events[oldtail].event = *e;
+ /*
+ * Make sure that event times don't go backwards - this
+ * is "unnecessary", but very useful
+ */
+ if (e->u.keyButtonPointer.time < darwinEventQueue.lastEventTime &&
+ darwinEventQueue.lastEventTime - e->u.keyButtonPointer.time < 10000)
+ {
+ darwinEventQueue.events[oldtail].event.u.keyButtonPointer.time =
+ darwinEventQueue.lastEventTime;
+ }
+ darwinEventQueue.events[oldtail].pScreen = darwinEventQueue.pEnqueueScreen;
+
+ // Update the tail after the event is prepared
+ darwinEventQueue.tail = newtail;
+}
+
+
+/*
+ * DarwinEQPointerPost
+ * Post a pointer event. Used by the mipointer.c routines.
+ */
+void
+DarwinEQPointerPost(
+ xEvent *e)
+{
+ (*darwinEventQueue.pPtr->processInputProc)
+ (e, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+}
+
+
+void
+DarwinEQSwitchScreen(
+ ScreenPtr pScreen,
+ Bool fromDIX)
+{
+ darwinEventQueue.pEnqueueScreen = pScreen;
+ if (fromDIX)
+ darwinEventQueue.pDequeueScreen = pScreen;
+}
+
+
+/*
+ * ProcessInputEvents
+ * Read and process events from the event queue until it is empty.
+ */
+void ProcessInputEvents(void)
+{
+ EventRec *e;
+ int x, y;
+ xEvent xe;
+ static int old_flags = 0; // last known modifier state
+ // button number and modifier mask of currently pressed fake button
+ static int darwinFakeMouseButtonDown = 0;
+ static int darwinFakeMouseButtonMask = 0;
+
+ // Empty the signaling pipe
+ x = sizeof(xe);
+ while (x == sizeof(xe)) {
+ x = read(darwinEventFD, &xe, sizeof(xe));
+ }
+
+ while (darwinEventQueue.head != darwinEventQueue.tail)
+ {
+ if (screenIsSaved == SCREEN_SAVER_ON)
+ SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset);
+
+ e = &darwinEventQueue.events[darwinEventQueue.head];
+ xe = e->event;
+
+ // Shift from global screen coordinates to coordinates relative to
+ // the origin of the current screen.
+ xe.u.keyButtonPointer.rootX -= darwinMainScreenX +
+ dixScreenOrigins[miPointerCurrentScreen()->myNum].x;
+ xe.u.keyButtonPointer.rootY -= darwinMainScreenY +
+ dixScreenOrigins[miPointerCurrentScreen()->myNum].y;
+
+ /*
+ * Assumption - screen switching can only occur on motion events
+ */
+ if (e->pScreen != darwinEventQueue.pDequeueScreen)
+ {
+ darwinEventQueue.pDequeueScreen = e->pScreen;
+ x = xe.u.keyButtonPointer.rootX;
+ y = xe.u.keyButtonPointer.rootY;
+ if (darwinEventQueue.head == QUEUE_SIZE - 1)
+ darwinEventQueue.head = 0;
+ else
+ ++darwinEventQueue.head;
+ NewCurrentScreen (darwinEventQueue.pDequeueScreen, x, y);
+ }
+ else
+ {
+ if (darwinEventQueue.head == QUEUE_SIZE - 1)
+ darwinEventQueue.head = 0;
+ else
+ ++darwinEventQueue.head;
+ switch (xe.u.u.type)
+ {
+ case KeyPress:
+ case KeyRelease:
+ xe.u.u.detail += MIN_KEYCODE;
+ (*darwinEventQueue.pKbd->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pKbd, 1);
+ break;
+
+ case ButtonPress:
+ miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
+ xe.u.keyButtonPointer.rootY,
+ xe.u.keyButtonPointer.time);
+ if (darwinFakeButtons && xe.u.u.detail == 1) {
+ // Mimic multi-button mouse with modifier-clicks
+ // If both sets of modifiers are pressed,
+ // button 2 is clicked.
+ if ((old_flags & darwinFakeMouse2Mask) ==
+ darwinFakeMouse2Mask)
+ {
+ DarwinSimulateMouseClick(&xe, 2, darwinFakeMouse2Mask);
+ darwinFakeMouseButtonDown = 2;
+ darwinFakeMouseButtonMask = darwinFakeMouse2Mask;
+ break;
+ }
+ else if ((old_flags & darwinFakeMouse3Mask) ==
+ darwinFakeMouse3Mask)
+ {
+ DarwinSimulateMouseClick(&xe, 3, darwinFakeMouse3Mask);
+ darwinFakeMouseButtonDown = 3;
+ darwinFakeMouseButtonMask = darwinFakeMouse3Mask;
+ break;
+ }
+ }
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ break;
+
+ case ButtonRelease:
+ miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
+ xe.u.keyButtonPointer.rootY,
+ xe.u.keyButtonPointer.time);
+ if (darwinFakeButtons && xe.u.u.detail == 1 &&
+ darwinFakeMouseButtonDown)
+ {
+ // If last mousedown was a fake click, don't check for
+ // mouse modifiers here. The user may have released the
+ // modifiers before the mouse button.
+ xe.u.u.detail = darwinFakeMouseButtonDown;
+ darwinFakeMouseButtonDown = 0;
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+
+ // Bring modifiers back up to date
+ DarwinUpdateModifiers(&xe, KeyPress,
+ darwinFakeMouseButtonMask & old_flags);
+ darwinFakeMouseButtonMask = 0;
+ } else {
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ }
+ break;
+
+ case MotionNotify:
+ miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX,
+ xe.u.keyButtonPointer.rootY,
+ xe.u.keyButtonPointer.time);
+ break;
+
+ case kXDarwinUpdateModifiers:
+ {
+ // Update modifier state.
+ // Any amount of modifiers may have changed.
+ int flags = xe.u.clientMessage.u.l.longs0;
+ DarwinUpdateModifiers(&xe, KeyRelease,
+ old_flags & ~flags);
+ DarwinUpdateModifiers(&xe, KeyPress,
+ ~old_flags & flags);
+ old_flags = flags;
+ break;
+ }
+
+ case kXDarwinUpdateButtons:
+ {
+ long hwDelta = xe.u.clientMessage.u.l.longs0;
+ long hwButtons = xe.u.clientMessage.u.l.longs1;
+ int i;
+
+ for (i = 1; i < 5; i++) {
+ if (hwDelta & (1 << i)) {
+ // IOKit and X have different numbering for the
+ // middle and right mouse buttons.
+ if (i == 1) {
+ xe.u.u.detail = 3;
+ } else if (i == 2) {
+ xe.u.u.detail = 2;
+ } else {
+ xe.u.u.detail = i + 1;
+ }
+ if (hwButtons & (1 << i)) {
+ xe.u.u.type = ButtonPress;
+ } else {
+ xe.u.u.type = ButtonRelease;
+ }
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ }
+ }
+ break;
+ }
+
+ case kXDarwinScrollWheel:
+ {
+ short count = xe.u.clientMessage.u.s.shorts0;
+
+ if (count > 0) {
+ xe.u.u.detail = SCROLLWHEELUPFAKE;
+ } else {
+ xe.u.u.detail = SCROLLWHEELDOWNFAKE;
+ count = -count;
+ }
+
+ for (; count; --count) {
+ xe.u.u.type = ButtonPress;
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ xe.u.u.type = ButtonRelease;
+ (*darwinEventQueue.pPtr->processInputProc)
+ (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1);
+ }
+ break;
+ }
+
+ default:
+ if (quartz) {
+ QuartzProcessEvent(&xe);
+ } else {
+ ErrorF("Unknown X event caught: %d\n", xe.u.u.type);
+ }
+ }
+ }
+ }
+
+ miPointerUpdate();
+}
diff --git a/hw/darwin/darwinKeyboard.c b/hw/darwin/darwinKeyboard.c
new file mode 100644
index 000000000..4113bacba
--- /dev/null
+++ b/hw/darwin/darwinKeyboard.c
@@ -0,0 +1,805 @@
+//=============================================================================
+//
+// Keyboard support for the Darwin X Server
+//
+// Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+//
+// The code to parse the Darwin keymap is derived from dumpkeymap.c
+// by Eric Sunshine, which includes the following copyright:
+//
+// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.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.
+// 3. 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.
+//
+//=============================================================================
+
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.17 2002/12/10 00:00:38 torrey Exp $ */
+
+/*
+===========================================================================
+
+ An X keyCode must be in the range XkbMinLegalKeyCode (8) to
+ XkbMaxLegalKeyCode(255).
+
+ The keyCodes we get from the kernel range from 0 to 127, so we need to
+ offset the range before passing the keyCode to X.
+
+ An X KeySym is an extended ascii code that is device independent.
+
+ The modifier map is accessed by the keyCode, but the normal map is
+ accessed by keyCode - MIN_KEYCODE. Sigh.
+
+===========================================================================
+*/
+
+// Define this to get a diagnostic output to stderr which is helpful
+// in determining how the X server is interpreting the Darwin keymap.
+#undef DUMP_DARWIN_KEYMAP
+
+#include <drivers/event_status_driver.h>
+#include <IOKit/hidsystem/ev_keymap.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <architecture/byte_order.h> // For the NXSwap*
+#include "darwin.h"
+#include "xfIOKit.h"
+#include "quartz/quartzAudio.h"
+#include "quartz/quartzShared.h"
+
+#define XK_TECHNICAL // needed to get XK_Escape
+#define XK_PUBLISHING
+#include "keysym.h"
+
+// Each key can generate 4 glyphs. They are, in order:
+// unshifted, shifted, modeswitch unshifted, modeswitch shifted
+#define GLYPHS_PER_KEY 4
+#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better
+#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1
+
+#define AltMask Mod1Mask
+#define MetaMask Mod2Mask
+#define FunctionMask Mod3Mask
+
+// FIXME: It would be nice to support some of the extra keys in XF86keysym.h,
+// at least the volume controls that now ship on every Apple keyboard.
+
+#define UK(a) NoSymbol // unknown symbol
+
+static KeySym const next_to_x[256] = {
+ NoSymbol, NoSymbol, NoSymbol, XK_KP_Enter,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+ NoSymbol, XK_Return, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+ XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+ XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+ XK_comma, XK_minus, XK_period, XK_slash,
+ XK_0, XK_1, XK_2, XK_3,
+ XK_4, XK_5, XK_6, XK_7,
+ XK_8, XK_9, XK_colon, XK_semicolon,
+ XK_less, XK_equal, XK_greater, XK_question,
+ XK_at, XK_A, XK_B, XK_C,
+ XK_D, XK_E, XK_F, XK_G,
+ XK_H, XK_I, XK_J, XK_K,
+ XK_L, XK_M, XK_N, XK_O,
+ XK_P, XK_Q, XK_R, XK_S,
+ XK_T, XK_U, XK_V, XK_W,
+ XK_X, XK_Y, XK_Z, XK_bracketleft,
+ XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
+ XK_grave, XK_a, XK_b, XK_c,
+ XK_d, XK_e, XK_f, XK_g,
+ XK_h, XK_i, XK_j, XK_k,
+ XK_l, XK_m, XK_n, XK_o,
+ XK_p, XK_q, XK_r, XK_s,
+ XK_t, XK_u, XK_v, XK_w,
+ XK_x, XK_y, XK_z, XK_braceleft,
+ XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
+// 128
+ NoSymbol, XK_Agrave, XK_Aacute, XK_Acircumflex,
+ XK_Atilde, XK_Adiaeresis, XK_Aring, XK_Ccedilla,
+ XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
+ XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
+// 144
+ XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
+ XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_Ugrave,
+ XK_Uacute, XK_Ucircumflex, XK_Udiaeresis, XK_Yacute,
+ XK_THORN, XK_mu, XK_multiply, XK_division,
+// 160
+ XK_copyright, XK_exclamdown, XK_cent, XK_sterling,
+ UK(fraction), XK_yen, UK(fhook), XK_section,
+ XK_currency, XK_rightsinglequotemark,
+ XK_leftdoublequotemark,
+ XK_guillemotleft,
+ XK_leftanglebracket,
+ XK_rightanglebracket,
+ UK(filigature), UK(flligature),
+// 176
+ XK_registered, XK_endash, XK_dagger, XK_doubledagger,
+ XK_periodcentered,XK_brokenbar, XK_paragraph, UK(bullet),
+ XK_singlelowquotemark,
+ XK_doublelowquotemark,
+ XK_rightdoublequotemark,
+ XK_guillemotright,
+ XK_ellipsis, UK(permille), XK_notsign, XK_questiondown,
+// 192
+ XK_onesuperior, XK_dead_grave, XK_dead_acute, XK_dead_circumflex,
+ XK_dead_tilde, XK_dead_macron, XK_dead_breve, XK_dead_abovedot,
+ XK_dead_diaeresis,
+ XK_twosuperior, XK_dead_abovering,
+ XK_dead_cedilla,
+ XK_threesuperior,
+ XK_dead_doubleacute,
+ XK_dead_ogonek, XK_dead_caron,
+// 208
+ XK_emdash, XK_plusminus, XK_onequarter, XK_onehalf,
+ XK_threequarters,
+ XK_agrave, XK_aacute, XK_acircumflex,
+ XK_atilde, XK_adiaeresis, XK_aring, XK_ccedilla,
+ XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
+// 224
+ XK_igrave, XK_AE, XK_iacute, XK_ordfeminine,
+ XK_icircumflex, XK_idiaeresis, XK_eth, XK_ntilde,
+ XK_Lstroke, XK_Ooblique, XK_OE, XK_masculine,
+ XK_ograve, XK_oacute, XK_ocircumflex, XK_otilde,
+// 240
+ XK_odiaeresis, XK_ae, XK_ugrave, XK_uacute,
+ XK_ucircumflex, XK_idotless, XK_udiaeresis, XK_ygrave,
+ XK_lstroke, XK_ooblique, XK_oe, XK_ssharp,
+ XK_thorn, XK_ydiaeresis, NoSymbol, NoSymbol,
+ };
+
+#define MIN_SYMBOL 0xAC
+static KeySym const symbol_to_x[] = {
+ XK_Left, XK_Up, XK_Right, XK_Down
+ };
+int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]);
+
+#define MIN_FUNCKEY 0x20
+static KeySym const funckey_to_x[] = {
+ XK_F1, XK_F2, XK_F3, XK_F4,
+ XK_F5, XK_F6, XK_F7, XK_F8,
+ XK_F9, XK_F10, XK_F11, XK_F12,
+ XK_Insert, XK_Delete, XK_Home, XK_End,
+ XK_Page_Up, XK_Page_Down, XK_F13, XK_F14,
+ XK_F15
+ };
+int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]);
+
+typedef struct {
+ KeySym normalSym;
+ KeySym keypadSym;
+} darwinKeyPad_t;
+
+static darwinKeyPad_t const normal_to_keypad[] = {
+ { XK_0, XK_KP_0 },
+ { XK_1, XK_KP_1 },
+ { XK_2, XK_KP_2 },
+ { XK_3, XK_KP_3 },
+ { XK_4, XK_KP_4 },
+ { XK_5, XK_KP_5 },
+ { XK_6, XK_KP_6 },
+ { XK_7, XK_KP_7 },
+ { XK_8, XK_KP_8 },
+ { XK_9, XK_KP_9 },
+ { XK_equal, XK_KP_Equal },
+ { XK_asterisk, XK_KP_Multiply },
+ { XK_plus, XK_KP_Add },
+ { XK_comma, XK_KP_Separator },
+ { XK_minus, XK_KP_Subtract },
+ { XK_period, XK_KP_Decimal },
+ { XK_slash, XK_KP_Divide }
+};
+int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]);
+
+static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl )
+{
+ // keyclick, bell volume / pitch, autorepead, LED's
+}
+
+static CARD8 modMap[MAP_LENGTH];
+static KeySym map[MAP_LENGTH * GLYPHS_PER_KEY];
+static unsigned char modifierKeycodes[NX_NUMMODIFIERS][2];
+static FILE *fref = NULL;
+static char *inBuffer = NULL;
+
+//-----------------------------------------------------------------------------
+// Data Stream Object
+// Can be configured to treat embedded "numbers" as being composed of
+// either 1, 2, or 4 bytes, apiece.
+//-----------------------------------------------------------------------------
+typedef struct _DataStream
+{
+ unsigned char const *data;
+ unsigned char const *data_end;
+ short number_size; // Size in bytes of a "number" in the stream.
+} DataStream;
+
+static DataStream* new_data_stream( unsigned char const* data, int size )
+{
+ DataStream* s = (DataStream*)xalloc( sizeof(DataStream) );
+ s->data = data;
+ s->data_end = data + size;
+ s->number_size = 1; // Default to byte-sized numbers.
+ return s;
+}
+
+static void destroy_data_stream( DataStream* s )
+{
+ xfree(s);
+}
+
+static unsigned char get_byte( DataStream* s )
+{
+ assert(s->data + 1 <= s->data_end);
+ return *s->data++;
+}
+
+static short get_word( DataStream* s )
+{
+ short hi, lo;
+ assert(s->data + 2 <= s->data_end);
+ hi = *s->data++;
+ lo = *s->data++;
+ return ((hi << 8) | lo);
+}
+
+static int get_dword( DataStream* s )
+{
+ int b1, b2, b3, b4;
+ assert(s->data + 4 <= s->data_end);
+ b4 = *s->data++;
+ b3 = *s->data++;
+ b2 = *s->data++;
+ b1 = *s->data++;
+ return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
+}
+
+static int get_number( DataStream* s )
+{
+ switch (s->number_size) {
+ case 4: return get_dword(s);
+ case 2: return get_word(s);
+ default: return get_byte(s);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Utility functions to help parse Darwin keymap
+//-----------------------------------------------------------------------------
+
+/*
+ * bits_set
+ * Calculate number of bits set in the modifier mask.
+ */
+static short bits_set( short mask )
+{
+ short n = 0;
+
+ for ( ; mask != 0; mask >>= 1)
+ if ((mask & 0x01) != 0)
+ n++;
+ return n;
+}
+
+/*
+ * parse_next_char_code
+ * Read the next character code from the Darwin keymapping
+ * and write it to the X keymap.
+ */
+static void parse_next_char_code(
+ DataStream *s,
+ KeySym *k )
+{
+ const short charSet = get_number(s);
+ const short charCode = get_number(s);
+
+ if (charSet == 0) { // ascii character
+ if (charCode >= 0 && charCode < 256)
+ *k = next_to_x[charCode];
+ } else if (charSet == 0x01) { // symbol character
+ if (charCode >= MIN_SYMBOL &&
+ charCode <= MIN_SYMBOL + NUM_SYMBOL)
+ *k = symbol_to_x[charCode - MIN_SYMBOL];
+ } else if (charSet == 0xFE) { // function key
+ if (charCode >= MIN_FUNCKEY &&
+ charCode <= MIN_FUNCKEY + NUM_FUNCKEY)
+ *k = funckey_to_x[charCode - MIN_FUNCKEY];
+ }
+}
+
+
+/*
+ * DarwinReadKeymapFile
+ * Read the appropriate keymapping from a keymapping file.
+ */
+Bool DarwinReadKeymapFile(
+ NXKeyMapping *keyMap)
+{
+ struct stat st;
+ NXEventSystemDevice info[20];
+ int interface = 0, handler_id = 0;
+ int map_interface, map_handler_id, map_size = 0;
+ unsigned int i, size;
+ int *bufferEnd;
+ union km_tag {
+ int *intP;
+ char *charP;
+ } km;
+
+ fref = fopen( darwinKeymapFile, "rb" );
+ if (fref == NULL) {
+ ErrorF("Unable to open keymapping file '%s' (errno %d).\n",
+ darwinKeymapFile, errno);
+ return FALSE;
+ }
+ if (fstat(fileno(fref), &st) == -1) {
+ ErrorF("Could not stat keymapping file '%s' (errno %d).\n",
+ darwinKeymapFile, errno);
+ return FALSE;
+ }
+
+ // check to make sure we don't crash later
+ if (st.st_size <= 16*sizeof(int)) {
+ ErrorF("Keymapping file '%s' is invalid (too small).\n",
+ darwinKeymapFile);
+ return FALSE;
+ }
+
+ inBuffer = (char*) xalloc( st.st_size );
+ bufferEnd = (int *) (inBuffer + st.st_size);
+ if (fread(inBuffer, st.st_size, 1, fref) != 1) {
+ ErrorF("Could not read %qd bytes from keymapping file '%s' (errno %d).\n",
+ st.st_size, darwinKeymapFile, errno);
+ return FALSE;
+ }
+
+ if (strncmp( inBuffer, "KYM1", 4 ) == 0) {
+ // Magic number OK.
+ } else if (strncmp( inBuffer, "KYMP", 4 ) == 0) {
+ ErrorF("Keymapping file '%s' is intended for use with the original NeXT keyboards and cannot be used by XDarwin.\n", darwinKeymapFile);
+ return FALSE;
+ } else {
+ ErrorF("Keymapping file '%s' has a bad magic number and cannot be used by XDarwin.\n", darwinKeymapFile);
+ return FALSE;
+ }
+
+ // find the keyboard interface and handler id
+ size = sizeof( info ) / sizeof( int );
+ if (!NXEventSystemInfo( darwinParamConnect, NX_EVS_DEVICE_INFO,
+ (NXEventSystemInfoType) info, &size )) {
+ ErrorF("Error reading event status driver info.\n");
+ return FALSE;
+ }
+
+ size = size * sizeof( int ) / sizeof( info[0] );
+ for( i = 0; i < size; i++) {
+ if (info[i].dev_type == NX_EVS_DEVICE_TYPE_KEYBOARD) {
+ Bool hasInterface = FALSE;
+ Bool hasMatch = FALSE;
+
+ interface = info[i].interface;
+ handler_id = info[i].id;
+
+ // Find an appropriate keymapping:
+ // The first time we try to match both interface and handler_id.
+ // If we can't match both, we take the first match for interface.
+
+ do {
+ km.charP = inBuffer;
+ km.intP++;
+ while (km.intP+3 < bufferEnd) {
+ map_interface = NXSwapBigIntToHost(*(km.intP++));
+ map_handler_id = NXSwapBigIntToHost(*(km.intP++));
+ map_size = NXSwapBigIntToHost(*(km.intP++));
+ if (map_interface == interface) {
+ if (map_handler_id == handler_id || hasInterface) {
+ hasMatch = TRUE;
+ break;
+ } else {
+ hasInterface = TRUE;
+ }
+ }
+ km.charP += map_size;
+ }
+ } while (hasInterface && !hasMatch);
+
+ if (hasMatch) {
+ // fill in NXKeyMapping structure
+ keyMap->size = map_size;
+ keyMap->mapping = (char*) xalloc(map_size);
+ memcpy(keyMap->mapping, km.charP, map_size);
+ return TRUE;
+ }
+ } // if dev_id == keyboard device
+ } // foreach info struct
+
+ // The keymapping file didn't match any of the info structs
+ // returned by NXEventSystemInfo.
+ ErrorF("Keymapping file '%s' did not contain appropriate keyboard interface.\n", darwinKeymapFile);
+ return FALSE;
+}
+
+
+/*
+ * DarwinKeyboardInit
+ * Get the Darwin keyboard map and compute an equivalent
+ * X keyboard map and modifier map. Set the new keyboard
+ * device structure.
+ */
+void DarwinKeyboardInit(
+ DeviceIntPtr pDev )
+{
+ KeySym *k;
+ int i;
+ short numMods, numKeys, numPadKeys = 0;
+ KeySymsRec keySyms;
+ NXKeyMapping keyMap;
+ DataStream *keyMapStream;
+ unsigned char const *numPadStart = 0;
+ BellProcPtr bellProc;
+ Bool haveKeymap = FALSE;
+
+ memset( modMap, NoSymbol, sizeof( modMap ) );
+ memset( map, 0, sizeof( map ) );
+ for (i = 0; i < NX_NUMMODIFIERS; i++) {
+ modifierKeycodes[i][0] = modifierKeycodes[i][1] = 0;
+ }
+
+ // Open a shared connection to the HID System.
+ // Note that the Event Status Driver is really just a wrapper
+ // for a kIOHIDParamConnectType connection.
+ assert( darwinParamConnect = NXOpenEventStatus() );
+
+ if (darwinKeymapFile) {
+ haveKeymap = DarwinReadKeymapFile(&keyMap);
+ if (fref)
+ fclose(fref);
+ if (inBuffer)
+ xfree(inBuffer);
+ if (!haveKeymap) {
+ ErrorF("Reverting to kernel keymapping.\n");
+ }
+ }
+
+ if (!haveKeymap) {
+ // get the Darwin keyboard map
+ keyMap.size = NXKeyMappingLength( darwinParamConnect );
+ keyMap.mapping = (char*) xalloc( keyMap.size );
+ if (!NXGetKeyMapping( darwinParamConnect, &keyMap )) {
+ FatalError("Could not get kernel keymapping! Load keymapping from file instead.\n");
+ }
+ }
+
+ keyMapStream = new_data_stream( (unsigned char const*)keyMap.mapping,
+ keyMap.size );
+
+ // check the type of map
+ if (get_word(keyMapStream)) {
+ keyMapStream->number_size = 2;
+ ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n");
+ }
+
+ // Compute the modifier map and
+ // insert X modifier KeySyms into keyboard map.
+ // Store modifier keycodes in modifierKeycodes.
+ numMods = get_number(keyMapStream);
+ while (numMods-- > 0) {
+ int left = 1; // first keycode is left
+ short const charCode = get_number(keyMapStream);
+ short numKeyCodes = get_number(keyMapStream);
+
+ // This is just a marker, not a real modifier.
+ // Store numeric keypad keys for later.
+ if (charCode == NX_MODIFIERKEY_NUMERICPAD) {
+ numPadStart = keyMapStream->data;
+ numPadKeys = numKeyCodes;
+ }
+
+ while (numKeyCodes-- > 0) {
+ const short keyCode = get_number(keyMapStream);
+ if (charCode != NX_MODIFIERKEY_NUMERICPAD) {
+ modifierKeycodes[charCode][1-left] = keyCode;
+ switch (charCode) {
+ case NX_MODIFIERKEY_ALPHALOCK:
+ modMap[keyCode + MIN_KEYCODE] = LockMask;
+ map[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock;
+ break;
+ case NX_MODIFIERKEY_SHIFT:
+ modMap[keyCode + MIN_KEYCODE] = ShiftMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Shift_L : XK_Shift_R);
+ break;
+ case NX_MODIFIERKEY_CONTROL:
+ modMap[keyCode + MIN_KEYCODE] = ControlMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Control_L : XK_Control_R);
+ break;
+ case NX_MODIFIERKEY_ALTERNATE:
+ modMap[keyCode + MIN_KEYCODE] = AltMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Mode_switch : XK_Alt_R);
+ break;
+ case NX_MODIFIERKEY_COMMAND:
+ modMap[keyCode + MIN_KEYCODE] = MetaMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Meta_L : XK_Meta_R);
+ break;
+ case NX_MODIFIERKEY_SECONDARYFN:
+ modMap[keyCode + MIN_KEYCODE] = FunctionMask;
+ map[keyCode * GLYPHS_PER_KEY] =
+ (left ? XK_Control_L : XK_Control_R);
+ break;
+ case NX_MODIFIERKEY_HELP:
+ // Help is not an X11 modifier; treat as normal key
+ map[keyCode * GLYPHS_PER_KEY] = XK_Help;
+ break;
+ }
+ }
+ left = 0;
+ }
+ }
+
+ // Convert the Darwin keyboard map to an X keyboard map.
+ // A key can have a different character code for each combination of
+ // modifiers. We currently ignore all modifier combinations except
+ // those with Shift, AlphaLock, and Alt.
+ numKeys = get_number(keyMapStream);
+ for (i = 0, k = map; i < numKeys; i++, k += GLYPHS_PER_KEY) {
+ short const charGenMask = get_number(keyMapStream);
+ if (charGenMask != 0xFF) { // is key bound?
+ short numKeyCodes = 1 << bits_set(charGenMask);
+
+ // Record unmodified case
+ parse_next_char_code( keyMapStream, k );
+ numKeyCodes--;
+
+ // If AlphaLock and Shift modifiers produce different codes,
+ // we record the Shift case since X handles AlphaLock.
+ if (charGenMask & 0x01) { // AlphaLock
+ parse_next_char_code( keyMapStream, k+1 );
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Shift
+ parse_next_char_code( keyMapStream, k+1 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Shift-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+
+ // Skip the Control cases
+ if (charGenMask & 0x04) { // Control
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Control-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Control-Shift
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Shift-Control-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+ }
+
+ // Process Alt cases
+ if (charGenMask & 0x08) { // Alt
+ parse_next_char_code( keyMapStream, k+2 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Alt-AlphaLock
+ parse_next_char_code( keyMapStream, k+3 );
+ numKeyCodes--;
+ }
+
+ if (charGenMask & 0x02) { // Alt-Shift
+ parse_next_char_code( keyMapStream, k+3 );
+ numKeyCodes--;
+
+ if (charGenMask & 0x01) { // Alt-Shift-AlphaLock
+ get_number(keyMapStream); get_number(keyMapStream);
+ numKeyCodes--;
+ }
+ }
+ }
+
+ while (numKeyCodes-- > 0) {
+ get_number(keyMapStream); get_number(keyMapStream);
+ }
+
+ if (k[3] == k[2]) k[3] = NoSymbol;
+ if (k[2] == k[1]) k[2] = NoSymbol;
+ if (k[1] == k[0]) k[1] = NoSymbol;
+ if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
+ }
+ }
+
+ // Now we have to go back through the list of keycodes that are on the
+ // numeric keypad and update the X keymap.
+ keyMapStream->data = numPadStart;
+ while(numPadKeys-- > 0) {
+ const short keyCode = get_number(keyMapStream);
+ k = &map[keyCode * GLYPHS_PER_KEY];
+ for (i = 0; i < NUM_KEYPAD; i++) {
+ if (*k == normal_to_keypad[i].normalSym) {
+ k[0] = normal_to_keypad[i].keypadSym;
+ break;
+ }
+ }
+ }
+
+ // free Darwin keyboard map
+ destroy_data_stream( keyMapStream );
+ xfree( keyMap.mapping );
+
+#ifdef DUMP_DARWIN_KEYMAP
+ ErrorF("Darwin -> X converted keyboard map\n");
+ for (i = 0, k = map; i < NX_NUMKEYCODES; i++, k += GLYPHS_PER_KEY) {
+ int j;
+ ErrorF("0x%02x:", i);
+ for (j = 0; j < GLYPHS_PER_KEY; j++) {
+ if (k[j] == NoSymbol) {
+ ErrorF("\tNoSym");
+ } else {
+ ErrorF("\t0x%x", k[j]);
+ }
+ }
+ ErrorF("\n");
+ }
+#endif
+
+ keySyms.map = map;
+ keySyms.mapWidth = GLYPHS_PER_KEY;
+ keySyms.minKeyCode = MIN_KEYCODE;
+ keySyms.maxKeyCode = MAX_KEYCODE;
+
+ if (quartz)
+ bellProc = QuartzBell;
+ else
+ bellProc = XFIOKitBell;
+
+ assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, modMap,
+ bellProc,
+ DarwinChangeKeyboardControl ));
+}
+
+//-----------------------------------------------------------------------------
+// Modifier translation functions
+//
+// There are three different ways to specify a Mac modifier key:
+// keycode - specifies hardware key, read from keymapping
+// key - NX_MODIFIERKEY_*, really an index
+// mask - NX_*MASK, mask for modifier flags in event record
+// Left and right side have different keycodes but the same key and mask.
+//-----------------------------------------------------------------------------
+
+/*
+ * DarwinModifierNXKeyToNXKeycode
+ * Return the keycode for an NX_MODIFIERKEY_* modifier.
+ * side = 0 for left or 1 for right.
+ * Returns 0 if key+side is not a known modifier.
+ */
+int DarwinModifierNXKeyToNXKeycode(int key, int side)
+{
+ return modifierKeycodes[key][side];
+}
+
+/*
+ * DarwinModifierNXKeycodeToNXKey
+ * Returns -1 if keycode+side is not a modifier key
+ * outSide may be NULL, else it gets 0 for left and 1 for right.
+ */
+int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide)
+{
+ int key, side;
+
+ keycode += MIN_KEYCODE;
+ // search modifierKeycodes for this keycode+side
+ for (key = 0; key < NX_NUMMODIFIERS; key++) {
+ for (side = 0; side <= 1; side++) {
+ if (modifierKeycodes[key][side] == keycode) break;
+ }
+ }
+ if (key == NX_NUMMODIFIERS) return -1;
+ if (outSide) *outSide = side;
+ return key;
+}
+
+/*
+ * DarwinModifierNXMaskToNXKey
+ * Returns -1 if mask is not a known modifier mask.
+ */
+int DarwinModifierNXMaskToNXKey(int mask)
+{
+ switch (mask) {
+ case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK;
+ case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT;
+ case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL;
+ case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE;
+ case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND;
+ case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD;
+ case NX_HELPMASK: return NX_MODIFIERKEY_HELP;
+ case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN;
+ }
+ return -1;
+}
+
+/*
+ * DarwinModifierNXKeyToNXMask
+ * Returns 0 if key is not a known modifier key.
+ */
+int DarwinModifierNXKeyToNXMask(int key)
+{
+ switch (key) {
+ case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK;
+ case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK;
+ case NX_MODIFIERKEY_CONTROL: return NX_CONTROLMASK;
+ case NX_MODIFIERKEY_ALTERNATE: return NX_ALTERNATEMASK;
+ case NX_MODIFIERKEY_COMMAND: return NX_COMMANDMASK;
+ case NX_MODIFIERKEY_NUMERICPAD: return NX_NUMERICPADMASK;
+ case NX_MODIFIERKEY_HELP: return NX_HELPMASK;
+ case NX_MODIFIERKEY_SECONDARYFN: return NX_SECONDARYFNMASK;
+ }
+ return 0;
+}
+
+/*
+ * DarwinModifierStringToNXKey
+ * Returns -1 if string is not a known modifier.
+ */
+int DarwinModifierStringToNXKey(const char *str)
+{
+ if (!strcasecmp(str, "shift")) return NX_MODIFIERKEY_SHIFT;
+ else if (!strcasecmp(str, "control")) return NX_MODIFIERKEY_CONTROL;
+ else if (!strcasecmp(str, "option")) return NX_MODIFIERKEY_ALTERNATE;
+ else if (!strcasecmp(str, "command")) return NX_MODIFIERKEY_COMMAND;
+ else if (!strcasecmp(str, "fn")) return NX_MODIFIERKEY_SECONDARYFN;
+ else return -1;
+}
+
+/*
+ * LegalModifier
+ * This allows the ddx layer to prevent some keys from being remapped
+ * as modifier keys.
+ */
+Bool LegalModifier(unsigned int key, DevicePtr pDev)
+{
+ return 1;
+}
diff --git a/hw/darwin/quartz/Preferences.h b/hw/darwin/quartz/Preferences.h
new file mode 100644
index 000000000..2c0d6756b
--- /dev/null
+++ b/hw/darwin/quartz/Preferences.h
@@ -0,0 +1,107 @@
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.2 2003/01/15 02:34:05 torrey Exp $ */
+
+#import <Cocoa/Cocoa.h>
+
+@interface Preferences : NSObject
+{
+ IBOutlet NSPanel *window;
+ IBOutlet id displayField;
+ IBOutlet id dockSwitchButton;
+ IBOutlet id fakeButton;
+ IBOutlet id button2ModifiersMatrix;
+ IBOutlet id button3ModifiersMatrix;
+ IBOutlet id switchKeyButton;
+ IBOutlet id keymapFileField;
+ IBOutlet id modeMatrix;
+ IBOutlet id modeWindowButton;
+ IBOutlet id startupHelpButton;
+ IBOutlet id systemBeepButton;
+ IBOutlet id mouseAccelChangeButton;
+ IBOutlet id useXineramaButton;
+ IBOutlet id addToPathButton;
+ IBOutlet id addToPathField;
+ IBOutlet id useDefaultShellMatrix;
+ IBOutlet id useOtherShellField;
+ IBOutlet id depthButton;
+
+ BOOL isGettingKeyCode;
+ int keyCode;
+ int modifiers;
+ NSMutableString *switchString;
+}
+
+- (IBAction)close:(id)sender;
+- (IBAction)pickFile:(id)sender;
+- (IBAction)saveChanges:(id)sender;
+- (IBAction)setKey:(id)sender;
+
+- (BOOL)sendEvent:(NSEvent*)anEvent;
+
+- (void)awakeFromNib;
+- (void)windowWillClose:(NSNotification *)aNotification;
+
++ (void)setUseKeymapFile:(BOOL)newUseKeymapFile;
++ (void)setKeymapFile:(NSString*)newFile;
++ (void)setSwitchString:(NSString*)newString;
++ (void)setKeyCode:(int)newKeyCode;
++ (void)setModifiers:(int)newModifiers;
++ (void)setDisplay:(int)newDisplay;
++ (void)setDockSwitch:(BOOL)newDockSwitch;
++ (void)setFakeButtons:(BOOL)newFakeButtons;
++ (void)setButton2Mask:(int)newFakeMask;
++ (void)setButton3Mask:(int)newFakeMask;
++ (void)setMouseAccelChange:(BOOL)newMouseAccelChange;
++ (void)setUseQDCursor:(int)newUseQDCursor;
++ (void)setRootless:(BOOL)newRootless;
++ (void)setUseAGL:(BOOL)newUseAGL;
++ (void)setModeWindow:(BOOL)newModeWindow;
++ (void)setStartupHelp:(BOOL)newStartupHelp;
++ (void)setSystemBeep:(BOOL)newSystemBeep;
++ (void)setXinerama:(BOOL)newXinerama;
++ (void)setAddToPath:(BOOL)newAddToPath;
++ (void)setAddToPathString:(NSString*)newAddToPathString;
++ (void)setUseDefaultShell:(BOOL)newUseDefaultShell;
++ (void)setShellString:(NSString*)newShellString;
++ (void)setDepth:(int)newDepth;
++ (void)saveToDisk;
+
++ (BOOL)useKeymapFile;
++ (NSString*)keymapFile;
++ (NSString*)switchString;
++ (unsigned int)keyCode;
++ (unsigned int)modifiers;
++ (int)display;
++ (BOOL)dockSwitch;
++ (BOOL)fakeButtons;
++ (int)button2Mask;
++ (int)button3Mask;
++ (BOOL)mouseAccelChange;
++ (int)useQDCursor;
++ (BOOL)rootless;
++ (BOOL)useAGL;
++ (BOOL)modeWindow;
++ (BOOL)startupHelp;
++ (BOOL)systemBeep;
++ (BOOL)xinerama;
++ (BOOL)addToPath;
++ (NSString*)addToPathString;
++ (BOOL)useDefaultShell;
++ (NSString*)shellString;
++ (int)depth;
+
+@end
+
+// Possible settings for useQDCursor
+enum {
+ qdCursor_Never, // never use QuickDraw cursor
+ qdCursor_Not8Bit, // don't try to use QuickDraw with 8-bit depth
+ qdCursor_Always // always try to use QuickDraw cursor
+};
+
+// Possible settings for depth
+enum {
+ depth_Current,
+ depth_8Bit,
+ depth_15Bit,
+ depth_24Bit
+};
diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m
new file mode 100644
index 000000000..4f8dacbf0
--- /dev/null
+++ b/hw/darwin/quartz/Preferences.m
@@ -0,0 +1,530 @@
+//
+// Preferences.m
+//
+// This class keeps track of the user preferences.
+//
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.2 2003/01/15 02:34:06 torrey Exp $ */
+
+#import "Preferences.h"
+#import "quartzCommon.h"
+#include <IOKit/hidsystem/IOLLEvent.h> // for modifier masks
+
+// Macros to build the path name
+#ifndef XBINDIR
+#define XBINDIR /usr/X11R6/bin
+#endif
+#define STR(s) #s
+#define XSTRPATH(s) STR(s)
+
+
+@implementation Preferences
+
++ (void)initialize
+{
+ // Provide user defaults if needed
+ NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithInt:0], @"Display",
+ @"YES", @"FakeButtons",
+ [NSNumber numberWithInt:NX_COMMANDMASK], @"Button2Mask",
+ [NSNumber numberWithInt:NX_ALTERNATEMASK], @"Button3Mask",
+ NSLocalizedString(@"USA.keymapping",@""), @"KeymappingFile",
+ @"YES", @"UseKeymappingFile",
+ NSLocalizedString(@"Cmd-Opt-a",@""), @"SwitchString",
+ @"YES", @"UseRootlessMode",
+ @"YES", @"UseAGLforGLX",
+ @"YES", @"ShowModePickWindow",
+ @"YES", @"ShowStartupHelp",
+ [NSNumber numberWithInt:0], @"SwitchKeyCode",
+ [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
+ @"SwitchModifiers", @"NO", @"UseSystemBeep",
+ @"YES", @"DockSwitch",
+ @"NO", @"AllowMouseAccelChange",
+ [NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor",
+ @"YES", @"Xinerama",
+ @"YES", @"AddToPath",
+ [NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString",
+ @"YES", @"UseDefaultShell",
+ @"/bin/tcsh", @"Shell",
+ [NSNumber numberWithInt:depth_Current], @"Depth", nil];
+
+ [super initialize];
+ [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
+}
+
+// Initialize internal state info of switch key button
+- (void)initSwitchKey
+{
+ keyCode = [Preferences keyCode];
+ modifiers = [Preferences modifiers];
+ [switchString setString:[Preferences switchString]];
+}
+
+- (id)init
+{
+ self = [super init];
+
+ isGettingKeyCode=NO;
+ switchString=[[NSMutableString alloc] init];
+ [self initSwitchKey];
+
+ return self;
+}
+
+// Set a modifiers checkbox matrix to match a modifier mask
+- (void)resetMatrix:(NSMatrix *)aMatrix withMask:(int)aMask
+{
+ [aMatrix setState:(aMask & NX_SHIFTMASK) atRow:0 column:0];
+ [aMatrix setState:(aMask & NX_CONTROLMASK) atRow:1 column:0];
+ [aMatrix setState:(aMask & NX_COMMANDMASK) atRow:2 column:0];
+ [aMatrix setState:(aMask & NX_ALTERNATEMASK) atRow:3 column:0];
+ [aMatrix setState:(aMask & NX_SECONDARYFNMASK) atRow:4 column:0];
+}
+
+// Generate a modifiers mask from a modifiers checkbox matrix
+- (int)getMaskFromMatrix:(NSMatrix *)aMatrix
+{
+ int theMask = 0;
+
+ if ([[aMatrix cellAtRow:0 column:0] state])
+ theMask |= NX_SHIFTMASK;
+ if ([[aMatrix cellAtRow:1 column:0] state])
+ theMask |= NX_CONTROLMASK;
+ if ([[aMatrix cellAtRow:2 column:0] state])
+ theMask |= NX_COMMANDMASK;
+ if ([[aMatrix cellAtRow:3 column:0] state])
+ theMask |= NX_ALTERNATEMASK;
+ if ([[aMatrix cellAtRow:4 column:0] state])
+ theMask |= NX_SECONDARYFNMASK;
+
+ return theMask;
+}
+
+// Set the window controls to the state in user defaults
+- (void)resetWindow
+{
+ if ([Preferences keymapFile] == nil)
+ [keymapFileField setStringValue:@" "];
+ else
+ [keymapFileField setStringValue:[Preferences keymapFile]];
+
+ if ([Preferences switchString] == nil)
+ [switchKeyButton setTitle:@"--"];
+ else
+ [switchKeyButton setTitle:[Preferences switchString]];
+
+ [displayField setIntValue:[Preferences display]];
+ [dockSwitchButton setIntValue:[Preferences dockSwitch]];
+ [fakeButton setIntValue:[Preferences fakeButtons]];
+ [self resetMatrix:button2ModifiersMatrix
+ withMask:[Preferences button2Mask]];
+ [self resetMatrix:button3ModifiersMatrix
+ withMask:[Preferences button3Mask]];
+ [modeMatrix setState:[Preferences rootless] atRow:0 column:1];
+ [startupHelpButton setIntValue:[Preferences startupHelp]];
+ [modeWindowButton setIntValue:[Preferences modeWindow]];
+ [systemBeepButton setIntValue:[Preferences systemBeep]];
+ [mouseAccelChangeButton setIntValue:[Preferences mouseAccelChange]];
+ [useXineramaButton setIntValue:[Preferences xinerama]];
+ [addToPathButton setIntValue:[Preferences addToPath]];
+ [addToPathField setStringValue:[Preferences addToPathString]];
+ [useDefaultShellMatrix setState:![Preferences useDefaultShell]
+ atRow:1 column:0];
+ [useOtherShellField setStringValue:[Preferences shellString]];
+ [depthButton selectItemAtIndex:[Preferences depth]];
+}
+
+- (void)awakeFromNib
+{
+ [self resetWindow];
+}
+
+// Preference window delegate
+- (void)windowWillClose:(NSNotification *)aNotification
+{
+ [self resetWindow];
+ [self initSwitchKey];
+}
+
+// User cancelled the changes
+- (IBAction)close:(id)sender
+{
+ [window orderOut:nil];
+ [self resetWindow]; // reset window controls
+ [self initSwitchKey]; // reset switch key state
+}
+
+// Pick keymapping file
+- (IBAction)pickFile:(id)sender
+{
+ int result;
+ NSArray *fileTypes = [NSArray arrayWithObject:@"keymapping"];
+ NSOpenPanel *oPanel = [NSOpenPanel openPanel];
+
+ [oPanel setAllowsMultipleSelection:NO];
+ result = [oPanel runModalForDirectory:@"/System/Library/Keyboards"
+ file:nil types:fileTypes];
+ if (result == NSOKButton) {
+ [keymapFileField setStringValue:[oPanel filename]];
+ }
+}
+
+// User saved changes
+- (IBAction)saveChanges:(id)sender
+{
+ [Preferences setKeyCode:keyCode];
+ [Preferences setModifiers:modifiers];
+ [Preferences setSwitchString:switchString];
+ [Preferences setKeymapFile:[keymapFileField stringValue]];
+ [Preferences setUseKeymapFile:YES];
+ [Preferences setDisplay:[displayField intValue]];
+ [Preferences setDockSwitch:[dockSwitchButton intValue]];
+ [Preferences setFakeButtons:[fakeButton intValue]];
+ [Preferences setButton2Mask:
+ [self getMaskFromMatrix:button2ModifiersMatrix]];
+ [Preferences setButton3Mask:
+ [self getMaskFromMatrix:button3ModifiersMatrix]];
+ [Preferences setRootless:[[modeMatrix cellAtRow:0 column:1] state]];
+ [Preferences setModeWindow:[modeWindowButton intValue]];
+ [Preferences setStartupHelp:[startupHelpButton intValue]];
+ [Preferences setSystemBeep:[systemBeepButton intValue]];
+ [Preferences setMouseAccelChange:[mouseAccelChangeButton intValue]];
+ [Preferences setXinerama:[useXineramaButton intValue]];
+ [Preferences setAddToPath:[addToPathButton intValue]];
+ [Preferences setAddToPathString:[addToPathField stringValue]];
+ [Preferences setUseDefaultShell:
+ [[useDefaultShellMatrix cellAtRow:0 column:0] state]];
+ [Preferences setShellString:[useOtherShellField stringValue]];
+ [Preferences setDepth:[depthButton indexOfSelectedItem]];
+ [Preferences saveToDisk];
+
+ [window orderOut:nil];
+}
+
+- (IBAction)setKey:(id)sender
+{
+ [switchKeyButton setTitle:NSLocalizedString(@"Press key",@"")];
+ isGettingKeyCode=YES;
+ [switchString setString:@""];
+}
+
+- (BOOL)sendEvent:(NSEvent*)anEvent
+{
+ if(isGettingKeyCode) {
+ if([anEvent type]==NSKeyDown) // wait for keyup
+ return YES;
+ if([anEvent type]!=NSKeyUp)
+ return NO;
+
+ if([anEvent modifierFlags] & NSCommandKeyMask)
+ [switchString appendString:@"Cmd-"];
+ if([anEvent modifierFlags] & NSControlKeyMask)
+ [switchString appendString:@"Ctrl-"];
+ if([anEvent modifierFlags] & NSAlternateKeyMask)
+ [switchString appendString:@"Opt-"];
+ if([anEvent modifierFlags] & NSNumericPadKeyMask) // doesn't work
+ [switchString appendString:@"Num-"];
+ if([anEvent modifierFlags] & NSHelpKeyMask)
+ [switchString appendString:@"Help-"];
+ if([anEvent modifierFlags] & NSFunctionKeyMask) // powerbooks only
+ [switchString appendString:@"Fn-"];
+
+ [switchString appendString:[anEvent charactersIgnoringModifiers]];
+ [switchKeyButton setTitle:switchString];
+
+ keyCode = [anEvent keyCode];
+ modifiers = [anEvent modifierFlags];
+ isGettingKeyCode=NO;
+
+ return YES;
+ }
+ return NO;
+}
+
++ (void)setKeymapFile:(NSString*)newFile
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newFile
+ forKey:@"KeymappingFile"];
+}
+
++ (void)setUseKeymapFile:(BOOL)newUseKeymapFile
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newUseKeymapFile
+ forKey:@"UseKeymappingFile"];
+}
+
++ (void)setSwitchString:(NSString*)newString
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newString
+ forKey:@"SwitchString"];
+}
+
++ (void)setKeyCode:(int)newKeyCode
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newKeyCode
+ forKey:@"SwitchKeyCode"];
+}
+
++ (void)setModifiers:(int)newModifiers
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newModifiers
+ forKey:@"SwitchModifiers"];
+}
+
++ (void)setDisplay:(int)newDisplay
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newDisplay
+ forKey:@"Display"];
+}
+
++ (void)setDockSwitch:(BOOL)newDockSwitch
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch
+ forKey:@"DockSwitch"];
+}
+
++ (void)setFakeButtons:(BOOL)newFakeButtons
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newFakeButtons
+ forKey:@"FakeButtons"];
+ // Update the setting used by the X server thread
+ darwinFakeButtons = newFakeButtons;
+}
+
++ (void)setButton2Mask:(int)newFakeMask
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
+ forKey:@"Button2Mask"];
+ // Update the setting used by the X server thread
+ darwinFakeMouse2Mask = newFakeMask;
+}
+
++ (void)setButton3Mask:(int)newFakeMask
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newFakeMask
+ forKey:@"Button3Mask"];
+ // Update the setting used by the X server thread
+ darwinFakeMouse3Mask = newFakeMask;
+}
+
++ (void)setMouseAccelChange:(BOOL)newMouseAccelChange
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange
+ forKey:@"AllowMouseAccelChange"];
+ // Update the setting used by the X server thread
+ quartzMouseAccelChange = newMouseAccelChange;
+}
+
++ (void)setUseQDCursor:(int)newUseQDCursor
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newUseQDCursor
+ forKey:@"UseQDCursor"];
+}
+
++ (void)setModeWindow:(BOOL)newModeWindow
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newModeWindow
+ forKey:@"ShowModePickWindow"];
+}
+
++ (void)setRootless:(BOOL)newRootless
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newRootless
+ forKey:@"UseRootlessMode"];
+}
+
++ (void)setUseAGL:(BOOL)newUseAGL
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newUseAGL
+ forKey:@"UseAGLforGLX"];
+}
+
++ (void)setStartupHelp:(BOOL)newStartupHelp
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newStartupHelp
+ forKey:@"ShowStartupHelp"];
+}
+
++ (void)setSystemBeep:(BOOL)newSystemBeep
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newSystemBeep
+ forKey:@"UseSystemBeep"];
+ // Update the setting used by the X server thread
+ quartzUseSysBeep = newSystemBeep;
+}
+
++ (void)setXinerama:(BOOL)newXinerama
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newXinerama
+ forKey:@"Xinerama"];
+}
+
++ (void)setAddToPath:(BOOL)newAddToPath
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newAddToPath
+ forKey:@"AddToPath"];
+}
+
++ (void)setAddToPathString:(NSString*)newAddToPathString
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newAddToPathString
+ forKey:@"AddToPathString"];
+}
+
++ (void)setUseDefaultShell:(BOOL)newUseDefaultShell
+{
+ [[NSUserDefaults standardUserDefaults] setBool:newUseDefaultShell
+ forKey:@"UseDefaultShell"];
+}
+
++ (void)setShellString:(NSString*)newShellString
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newShellString
+ forKey:@"Shell"];
+}
+
++ (void)setDepth:(int)newDepth
+{
+ [[NSUserDefaults standardUserDefaults] setInteger:newDepth
+ forKey:@"Depth"];
+}
+
++ (void)saveToDisk
+{
+ [[NSUserDefaults standardUserDefaults] synchronize];
+}
+
++ (BOOL)useKeymapFile
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"UseKeymappingFile"];
+}
+
++ (NSString*)keymapFile
+{
+ return [[NSUserDefaults standardUserDefaults]
+ stringForKey:@"KeymappingFile"];
+}
+
++ (NSString*)switchString
+{
+ return [[NSUserDefaults standardUserDefaults]
+ stringForKey:@"SwitchString"];
+}
+
++ (unsigned int)keyCode
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"SwitchKeyCode"];
+}
+
++ (unsigned int)modifiers
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"SwitchModifiers"];
+}
+
++ (int)display
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"Display"];
+}
+
++ (BOOL)dockSwitch
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"];
+}
+
++ (BOOL)fakeButtons
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"];
+}
+
++ (int)button2Mask
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"Button2Mask"];
+}
+
++ (int)button3Mask
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"Button3Mask"];
+}
+
++ (BOOL)mouseAccelChange
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"AllowMouseAccelChange"];
+}
+
++ (int)useQDCursor
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"UseQDCursor"];
+}
+
++ (BOOL)rootless
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"UseRootlessMode"];
+}
+
++ (BOOL)useAGL
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"UseAGLforGLX"];
+}
+
++ (BOOL)modeWindow
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"ShowModePickWindow"];
+}
+
++ (BOOL)startupHelp
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"ShowStartupHelp"];
+}
+
++ (BOOL)systemBeep
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"UseSystemBeep"];
+}
+
++ (BOOL)xinerama
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"Xinerama"];
+}
+
++ (BOOL)addToPath
+{
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"];
+}
+
++ (NSString*)addToPathString
+{
+ return [[NSUserDefaults standardUserDefaults]
+ stringForKey:@"AddToPathString"];
+}
+
++ (BOOL)useDefaultShell
+{
+ return [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"UseDefaultShell"];
+}
+
++ (NSString*)shellString
+{
+ return [[NSUserDefaults standardUserDefaults]
+ stringForKey:@"Shell"];
+}
+
++ (int)depth
+{
+ return [[NSUserDefaults standardUserDefaults]
+ integerForKey:@"Depth"];
+}
+
+
+@end
diff --git a/hw/darwin/quartz/XApplication.h b/hw/darwin/quartz/XApplication.h
new file mode 100644
index 000000000..3d3e96dab
--- /dev/null
+++ b/hw/darwin/quartz/XApplication.h
@@ -0,0 +1,47 @@
+//
+// XApplication.h
+//
+// Created by Andreas Monitzer on January 6, 2001.
+//
+/*
+ * Copyright (c) 2001 Andreas Monitzer. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XApplication.h,v 1.2 2002/10/12 00:32:45 torrey Exp $ */
+
+#import <Cocoa/Cocoa.h>
+
+#import "XServer.h"
+#import "Preferences.h"
+
+@interface XApplication : NSApplication {
+ IBOutlet XServer *xserver;
+ IBOutlet Preferences *preferences;
+}
+
+- (void)sendEvent:(NSEvent *)anEvent;
+
+@end
diff --git a/hw/darwin/quartz/XApplication.m b/hw/darwin/quartz/XApplication.m
new file mode 100644
index 000000000..9b81bbee0
--- /dev/null
+++ b/hw/darwin/quartz/XApplication.m
@@ -0,0 +1,47 @@
+//
+// XApplication.m
+//
+// Created by Andreas Monitzer on January 6, 2001.
+//
+/*
+ * Copyright (c) 2001 Andreas Monitzer. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XApplication.m,v 1.2 2002/10/12 00:32:45 torrey Exp $ */
+
+#import "XApplication.h"
+
+
+@implementation XApplication
+
+- (void)sendEvent:(NSEvent *)anEvent {
+ if (![xserver translateEvent:anEvent]) {
+ if (![preferences sendEvent:anEvent])
+ [super sendEvent:anEvent];
+ }
+}
+
+@end
diff --git a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
new file mode 100644
index 000000000..574ce5f18
--- /dev/null
+++ b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
@@ -0,0 +1,1683 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 38;
+ objects = {
+ 01279092000747AA0A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XServer.m;
+ refType = 4;
+ };
+ 0127909600074AF60A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XApplication.m;
+ refType = 4;
+ };
+ 0127909800074B1A0A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XApplication.h;
+ refType = 4;
+ };
+ 014C68ED00ED6A9D7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XView.h;
+ refType = 4;
+ };
+ 014C68EE00ED6A9D7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XView.m;
+ refType = 4;
+ };
+ 014C68F200ED7AD67F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = fakeBoxRec.h;
+ refType = 4;
+ };
+ 014C68F300EE5AB97F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessCommon.c;
+ refType = 4;
+ };
+ 014C68F400EE5AB97F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessCommon.h;
+ refType = 4;
+ };
+ 014C68F700EE678F7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessWindow.c;
+ refType = 4;
+ };
+ 014C68F800EE678F7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessWindow.h;
+ refType = 4;
+ };
+ 015698ED003DF345CE6F79C2 = {
+ isa = PBXFileReference;
+ path = XDarwin.icns;
+ refType = 4;
+ };
+ 0157A37D002CF6D7CE6F79C2 = {
+ children = (
+ F533214601A4B45401000001,
+ 0157A37E002CF6D7CE6F79C2,
+ F58D65DF018F79B101000001,
+ F533213D0193CBE001000001,
+ 43B962E200617B93416877C2,
+ F5ACD263C5BE031F01000001,
+ F51BF62E02026E3501000001,
+ F5ACD25CC5B5E96601000001,
+ F587E16401924C6901000001,
+ );
+ isa = PBXVariantGroup;
+ name = Credits.rtf;
+ path = "";
+ refType = 4;
+ };
+ 0157A37E002CF6D7CE6F79C2 = {
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/Credits.rtf;
+ refType = 4;
+ };
+ 015EDCEA004203A8CE6F79C2 = {
+ isa = PBXFrameworkReference;
+ name = IOKit.framework;
+ path = /System/Library/Frameworks/IOKit.framework;
+ refType = 0;
+ };
+ 017D6F4400E861FB7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessGC.c;
+ refType = 4;
+ };
+ 017D6F4500E861FB7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessScreen.c;
+ refType = 4;
+ };
+ 018F40F2003E1902CE6F79C2 = {
+ children = (
+ 018F40F3003E1916CE6F79C2,
+ 021D6BA9003E1BACCE6F79C2,
+ 3E74E03600863F047F000001,
+ F5A94EF10314BAC70100011B,
+ 018F40F6003E1974CE6F79C2,
+ );
+ isa = PBXGroup;
+ name = "X Server";
+ path = ..;
+ refType = 4;
+ };
+ 018F40F3003E1916CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwin.c;
+ refType = 4;
+ };
+ 018F40F6003E1974CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwinKeyboard.c;
+ refType = 4;
+ };
+ 018F40F8003E1979CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartz.c;
+ refType = 4;
+ };
+ 018F40FA003E197ECE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartz.h;
+ refType = 4;
+ };
+ 018F40FC003E1983CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xfIOKit.c;
+ refType = 4;
+ };
+ 018F40FE003E1988CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xfIOKit.h;
+ refType = 4;
+ };
+ 018F4100003E19E4CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xfIOKitCursor.c;
+ refType = 4;
+ };
+//010
+//011
+//012
+//013
+//014
+//020
+//021
+//022
+//023
+//024
+ 021D6BA9003E1BACCE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwin.h;
+ refType = 4;
+ };
+ 02A1FEA6006D34BE416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xfIOKitStartup.c;
+ refType = 4;
+ };
+ 02A1FEA8006D38F0416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzStartup.c;
+ refType = 4;
+ };
+ 02E03CA000348209CE6F79C2 = {
+ children = (
+ F533214701A4B48301000001,
+ 02E03CA100348209CE6F79C2,
+ F58D65E0018F79C001000001,
+ F533213E0193CBF401000001,
+ 43B962E300617B93416877C2,
+ F5ACD268C5BE046401000001,
+ F51BF62F02026E5C01000001,
+ F5ACD261C5B5EA2001000001,
+ F587E16501924C7401000001,
+ );
+ isa = PBXVariantGroup;
+ name = XDarwinHelp.html;
+ path = "";
+ refType = 4;
+ };
+ 02E03CA100348209CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+//020
+//021
+//022
+//023
+//024
+//030
+//031
+//032
+//033
+//034
+ 0338412F0083BFE57F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzCursor.h;
+ refType = 4;
+ };
+//030
+//031
+//032
+//033
+//034
+//040
+//041
+//042
+//043
+//044
+ 04329610000763920A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = Preferences.m;
+ refType = 4;
+ };
+ 04329611000763920A000002 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = Preferences.h;
+ refType = 4;
+ };
+//040
+//041
+//042
+//043
+//044
+//060
+//061
+//062
+//063
+//064
+ 06EB6C3B004099E7CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzShared.h;
+ refType = 4;
+ };
+//060
+//061
+//062
+//063
+//064
+//080
+//081
+//082
+//083
+//084
+ 080E96DDFE201D6D7F000001 = {
+ children = (
+ 04329610000763920A000002,
+ 04329611000763920A000002,
+ 0127909600074AF60A000002,
+ 0127909800074B1A0A000002,
+ 01279092000747AA0A000002,
+ 1C4A3109004D8F24CE6F79C2,
+ 014C68EE00ED6A9D7F000001,
+ 014C68ED00ED6A9D7F000001,
+ );
+ isa = PBXGroup;
+ name = Classes;
+ refType = 4;
+ };
+ 089C165CFE840E0CC02AAC07 = {
+ children = (
+ F533214301A4B3F001000001,
+ 089C165DFE840E0CC02AAC07,
+ F58D65DD018F798F01000001,
+ F533213A0193CBA201000001,
+ 43B962E100617B49416877C2,
+ F5ACD269C5BE049301000001,
+ F51BF62B02026DDA01000001,
+ F5ACD262C5B5EA4D01000001,
+ F587E16101924C2F01000001,
+ );
+ isa = PBXVariantGroup;
+ name = InfoPlist.strings;
+ refType = 4;
+ };
+ 089C165DFE840E0CC02AAC07 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+//080
+//081
+//082
+//083
+//084
+//0A0
+//0A1
+//0A2
+//0A3
+//0A4
+ 0A79E19E004499A1CE6F79C2 = {
+ isa = PBXApplicationReference;
+ path = XDarwin.app;
+ refType = 3;
+ };
+ 0A79E19F004499A1CE6F79C2 = {
+ buildPhases = (
+ 0A79E1A0004499A1CE6F79C2,
+ 0A79E1A1004499A1CE6F79C2,
+ 0A79E1A2004499A1CE6F79C2,
+ 0A79E1A3004499A1CE6F79C2,
+ 0A79E1A4004499A1CE6F79C2,
+ );
+ buildSettings = {
+ INSTALL_PATH = /;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = XDarwin;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = app;
+ };
+ dependencies = (
+ 6EF065C903D4F0CA006877C2,
+ 6EF065C703D4EE19006877C2,
+ );
+ isa = PBXApplicationTarget;
+ name = XDarwin;
+ productInstallPath = /;
+ productName = XDarwin;
+ productReference = 0A79E19E004499A1CE6F79C2;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>XDarwin</string>
+ <key>CFBundleGetInfoString</key>
+ <string>XDarwin 1.2.0, ©2001-2003 XFree86 Project, Inc.</string>
+ <key>CFBundleIconFile</key>
+ <string>XDarwin.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.xfree86.XDarwin</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>XDarwin</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>XDarwin 1.2.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string></string>
+ <key>NSHelpFile</key>
+ <string>XDarwinHelp.html</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>XApplication</string>
+</dict>
+</plist>
+";
+ };
+ 0A79E1A0004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A1004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ 0A79E1A600449EB2CE6F79C2,
+ 0A79E1A700449EB2CE6F79C2,
+ 0A79E1A800449EB2CE6F79C2,
+ 0A79E1A900449EB2CE6F79C2,
+ 0A79E1AA00449EB2CE6F79C2,
+ 1220774500712D2D416877C2,
+ F54BF6ED017D506E01000001,
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A2004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A3004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A4004499A1CE6F79C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 0A79E1A600449EB2CE6F79C2 = {
+ fileRef = 29B97318FDCFA39411CA2CEA;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 0A79E1A700449EB2CE6F79C2 = {
+ fileRef = 089C165CFE840E0CC02AAC07;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 0A79E1A800449EB2CE6F79C2 = {
+ fileRef = 0157A37D002CF6D7CE6F79C2;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 0A79E1A900449EB2CE6F79C2 = {
+ fileRef = 02E03CA000348209CE6F79C2;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 0A79E1AA00449EB2CE6F79C2 = {
+ fileRef = 015698ED003DF345CE6F79C2;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+//0A0
+//0A1
+//0A2
+//0A3
+//0A4
+//100
+//101
+//102
+//103
+//104
+ 1058C7A0FEA54F0111CA2CBB = {
+ children = (
+ F53321400193CCF001000001,
+ 1BE4F84D0006C9890A000002,
+ 1058C7A1FEA54F0111CA2CBB,
+ F53321410193CCF001000001,
+ 015EDCEA004203A8CE6F79C2,
+ );
+ isa = PBXGroup;
+ name = "Linked Frameworks";
+ refType = 4;
+ };
+ 1058C7A1FEA54F0111CA2CBB = {
+ isa = PBXFrameworkReference;
+ name = Cocoa.framework;
+ path = /System/Library/Frameworks/Cocoa.framework;
+ refType = 0;
+ };
+ 1058C7A2FEA54F0111CA2CBB = {
+ children = (
+ 29B97325FDCFA39411CA2CEA,
+ 29B97324FDCFA39411CA2CEA,
+ );
+ isa = PBXGroup;
+ name = "Other Frameworks";
+ refType = 4;
+ };
+//100
+//101
+//102
+//103
+//104
+//120
+//121
+//122
+//123
+//124
+ 1220774300712D2D416877C2 = {
+ children = (
+ F533214501A4B42501000001,
+ 1220774400712D2D416877C2,
+ F58D65DE018F79A001000001,
+ F533213C0193CBC901000001,
+ 1220774600712D75416877C2,
+ F5ACD266C5BE03C501000001,
+ F51BF62D02026E1C01000001,
+ F5ACD25FC5B5E9AA01000001,
+ F587E16301924C5E01000001,
+ );
+ isa = PBXVariantGroup;
+ name = Localizable.strings;
+ path = "";
+ refType = 4;
+ };
+ 1220774400712D2D416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/Localizable.strings;
+ refType = 4;
+ };
+ 1220774500712D2D416877C2 = {
+ fileRef = 1220774300712D2D416877C2;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 1220774600712D75416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/Localizable.strings;
+ refType = 4;
+ };
+//120
+//121
+//122
+//123
+//124
+//170
+//171
+//172
+//173
+//174
+ 170DFAFF00729A35416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XDarwinStartup.c;
+ refType = 4;
+ };
+ 170DFB0000729C86416877C2 = {
+ children = (
+ 018F40FC003E1983CE6F79C2,
+ 018F40FE003E1988CE6F79C2,
+ 018F4100003E19E4CE6F79C2,
+ 02A1FEA6006D34BE416877C2,
+ );
+ isa = PBXGroup;
+ name = IOKit;
+ path = ..;
+ refType = 4;
+ };
+//170
+//171
+//172
+//173
+//174
+//190
+//191
+//192
+//193
+//194
+ 19C28FACFE9D520D11CA2CBB = {
+ children = (
+ 0A79E19E004499A1CE6F79C2,
+ 6EF7C58703D3BC6D00000104,
+ 6EF065C603D4EE19006877C2,
+ );
+ isa = PBXGroup;
+ name = Products;
+ refType = 4;
+ };
+//190
+//191
+//192
+//193
+//194
+//1B0
+//1B1
+//1B2
+//1B3
+//1B4
+ 1BD8DE4200B8A3567F000001 = {
+ children = (
+ F533214401A4B40F01000001,
+ 1BD8DE4300B8A3567F000001,
+ F58D65DC018F794D01000001,
+ F533213B0193CBB401000001,
+ 1BD8DE4700B8A3C77F000001,
+ F5ACD264C5BE035B01000001,
+ F51BF62C02026E0601000001,
+ F5ACD25DC5B5E97701000001,
+ F587E16201924C5301000001,
+ );
+ isa = PBXVariantGroup;
+ name = InfoPlist.strings.cpp;
+ path = "";
+ refType = 4;
+ };
+ 1BD8DE4300B8A3567F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ 1BD8DE4400B8A38E7F000001 = {
+ children = (
+ F533214801A4B4D701000001,
+ 1BD8DE4500B8A38E7F000001,
+ F58D65E1018F79E001000001,
+ F533213F0193CC2501000001,
+ 1BD8DE4800B8A4167F000001,
+ F5ACD267C5BE03FC01000001,
+ F51BF63002026E8D01000001,
+ F5ACD260C5B5E9DF01000001,
+ F587E16601924C9D01000001,
+ );
+ isa = PBXVariantGroup;
+ name = XDarwinHelp.html.cpp;
+ path = "";
+ refType = 4;
+ };
+ 1BD8DE4500B8A38E7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ 1BD8DE4700B8A3C77F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ 1BD8DE4800B8A4167F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ 1BE4F84D0006C9890A000002 = {
+ isa = PBXFrameworkReference;
+ name = Carbon.framework;
+ path = /System/Library/Frameworks/Carbon.framework;
+ refType = 0;
+ };
+//1B0
+//1B1
+//1B2
+//1B3
+//1B4
+//1C0
+//1C1
+//1C2
+//1C3
+//1C4
+ 1C4A3109004D8F24CE6F79C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XServer.h;
+ refType = 4;
+ };
+//1C0
+//1C1
+//1C2
+//1C3
+//1C4
+//230
+//231
+//232
+//233
+//234
+ 237A34C10076E37E7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzAudio.c;
+ refType = 4;
+ };
+ 237A34C20076E37E7F000001 = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ OPTIMIZATION_CFLAGS = "-O0";
+ };
+ isa = PBXBuildStyle;
+ name = Development;
+ };
+ 237A34C30076E37E7F000001 = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ };
+ isa = PBXBuildStyle;
+ name = Deployment;
+ };
+ 237A34C40076F4F07F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzAudio.h;
+ refType = 4;
+ };
+//230
+//231
+//232
+//233
+//234
+//290
+//291
+//292
+//293
+//294
+ 29B97313FDCFA39411CA2CEA = {
+ buildStyles = (
+ 237A34C20076E37E7F000001,
+ 237A34C30076E37E7F000001,
+ );
+ hasScannedForEncodings = 1;
+ isa = PBXProject;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ Swedish,
+ Dutch,
+ Spanish,
+ ko,
+ Portuguese,
+ );
+ mainGroup = 29B97314FDCFA39411CA2CEA;
+ projectDirPath = "";
+ targets = (
+ 0A79E19F004499A1CE6F79C2,
+ 6EF7C58603D3BC6D00000104,
+ 6EF065C503D4EE19006877C2,
+ );
+ };
+ 29B97314FDCFA39411CA2CEA = {
+ children = (
+ 080E96DDFE201D6D7F000001,
+ 018F40F2003E1902CE6F79C2,
+ 170DFB0000729C86416877C2,
+ 43B962CE00617089416877C2,
+ F5614B3D025112D901000114,
+ 32FEE13C00E07C3E7F000001,
+ 29B97315FDCFA39411CA2CEA,
+ 29B97317FDCFA39411CA2CEA,
+ 29B97323FDCFA39411CA2CEA,
+ 19C28FACFE9D520D11CA2CBB,
+ );
+ isa = PBXGroup;
+ name = "Xmaster-Cocoa";
+ path = "";
+ refType = 4;
+ };
+ 29B97315FDCFA39411CA2CEA = {
+ children = (
+ 170DFAFF00729A35416877C2,
+ );
+ isa = PBXGroup;
+ name = "Other Sources";
+ path = "";
+ refType = 2;
+ };
+ 29B97317FDCFA39411CA2CEA = {
+ children = (
+ 29B97318FDCFA39411CA2CEA,
+ 089C165CFE840E0CC02AAC07,
+ 1BD8DE4200B8A3567F000001,
+ 1220774300712D2D416877C2,
+ 0157A37D002CF6D7CE6F79C2,
+ 02E03CA000348209CE6F79C2,
+ 1BD8DE4400B8A38E7F000001,
+ 015698ED003DF345CE6F79C2,
+ F54BF6EA017D500901000001,
+ F54BF6EC017D506E01000001,
+ );
+ isa = PBXGroup;
+ name = Resources;
+ path = ../bundle;
+ refType = 4;
+ };
+ 29B97318FDCFA39411CA2CEA = {
+ children = (
+ F533214201A4B3CE01000001,
+ 29B97319FDCFA39411CA2CEA,
+ F58D65DB018F793801000001,
+ F53321390193CB6A01000001,
+ 43B962E000617B49416877C2,
+ F5ACD265C5BE038601000001,
+ F51BF62A02026DAF01000001,
+ F5ACD25EC5B5E98D01000001,
+ F587E16001924C1D01000001,
+ );
+ isa = PBXVariantGroup;
+ name = MainMenu.nib;
+ path = "";
+ refType = 4;
+ };
+ 29B97319FDCFA39411CA2CEA = {
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ 29B97323FDCFA39411CA2CEA = {
+ children = (
+ 1058C7A0FEA54F0111CA2CBB,
+ 1058C7A2FEA54F0111CA2CBB,
+ );
+ isa = PBXGroup;
+ name = Frameworks;
+ path = "";
+ refType = 4;
+ };
+ 29B97324FDCFA39411CA2CEA = {
+ isa = PBXFrameworkReference;
+ name = AppKit.framework;
+ path = /System/Library/Frameworks/AppKit.framework;
+ refType = 0;
+ };
+ 29B97325FDCFA39411CA2CEA = {
+ isa = PBXFrameworkReference;
+ name = Foundation.framework;
+ path = /System/Library/Frameworks/Foundation.framework;
+ refType = 0;
+ };
+//290
+//291
+//292
+//293
+//294
+//320
+//321
+//322
+//323
+//324
+ 32FEE13C00E07C3E7F000001 = {
+ children = (
+ F56CBD0D02EB84A801129B8A,
+ F56CBD0E02EB84A801129B8A,
+ F56CBD0F02EBDCFC01129B8A,
+ 014C68F200ED7AD67F000001,
+ F5269C2D01D5BC3501000001,
+ F5269C2E01D5BC3501000001,
+ 32FEE13E00E07CBE7F000001,
+ 32FEE13F00E07CBE7F000001,
+ 32FEE14000E07CBE7F000001,
+ 32FEE14100E07CBE7F000001,
+ 32FEE14200E07CBE7F000001,
+ 014C68F300EE5AB97F000001,
+ 014C68F400EE5AB97F000001,
+ 017D6F4400E861FB7F000001,
+ 017D6F4500E861FB7F000001,
+ 014C68F700EE678F7F000001,
+ 014C68F800EE678F7F000001,
+ 32FEE14900E07D317F000001,
+ );
+ isa = PBXGroup;
+ name = Rootless;
+ path = "";
+ refType = 4;
+ };
+ 32FEE13E00E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootless.h;
+ refType = 4;
+ };
+ 32FEE13F00E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessAqua.h;
+ refType = 4;
+ };
+ 32FEE14000E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessAquaGlue.c;
+ refType = 4;
+ };
+ 32FEE14100E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessAquaImp.h;
+ refType = 4;
+ };
+ 32FEE14200E07CBE7F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessAquaImp.m;
+ refType = 4;
+ };
+ 32FEE14900E07D317F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessValTree.c;
+ refType = 4;
+ };
+//320
+//321
+//322
+//323
+//324
+//350
+//351
+//352
+//353
+//354
+ 3576829A0077B8F17F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzCursor.c;
+ refType = 4;
+ };
+//350
+//351
+//352
+//353
+//354
+//3E0
+//3E1
+//3E2
+//3E3
+//3E4
+ 3E74E03600863F047F000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwinClut8.h;
+ refType = 4;
+ };
+//3E0
+//3E1
+//3E2
+//3E3
+//3E4
+//430
+//431
+//432
+//433
+//434
+ 43B962CE00617089416877C2 = {
+ children = (
+ 018F40F8003E1979CE6F79C2,
+ 018F40FA003E197ECE6F79C2,
+ 237A34C10076E37E7F000001,
+ 237A34C40076F4F07F000001,
+ 3576829A0077B8F17F000001,
+ 0338412F0083BFE57F000001,
+ 43B962D000617089416877C2,
+ 43B962D100617089416877C2,
+ 43B962CF00617089416877C2,
+ F5582948015DAD3B01000001,
+ 06EB6C3B004099E7CE6F79C2,
+ 02A1FEA8006D38F0416877C2,
+ );
+ isa = PBXGroup;
+ name = Quartz;
+ path = "";
+ refType = 4;
+ };
+ 43B962CF00617089416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzCocoa.m;
+ refType = 4;
+ };
+ 43B962D000617089416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzPasteboard.c;
+ refType = 4;
+ };
+ 43B962D100617089416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzPasteboard.h;
+ refType = 4;
+ };
+ 43B962E000617B49416877C2 = {
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ 43B962E100617B49416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ 43B962E200617B93416877C2 = {
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/Credits.rtf;
+ refType = 4;
+ };
+ 43B962E300617B93416877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Japanese;
+ path = Japanese.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+//430
+//431
+//432
+//433
+//434
+//6E0
+//6E1
+//6E2
+//6E3
+//6E4
+ 6EF065C003D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C103D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C203D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C303D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C403D4EE19006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF065C503D4EE19006877C2 = {
+ buildPhases = (
+ 6EF065C003D4EE19006877C2,
+ 6EF065C103D4EE19006877C2,
+ 6EF065C203D4EE19006877C2,
+ 6EF065C303D4EE19006877C2,
+ 6EF065C403D4EE19006877C2,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = glxMesa;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = bundle;
+ };
+ dependencies = (
+ );
+ isa = PBXBundleTarget;
+ name = glxMesa;
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = glxMesa;
+ productReference = 6EF065C603D4EE19006877C2;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>glxMesa</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>GLX bundle with Mesa</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.1</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.1</string>
+</dict>
+</plist>
+";
+ };
+ 6EF065C603D4EE19006877C2 = {
+ isa = PBXBundleReference;
+ path = glxMesa.bundle;
+ refType = 3;
+ };
+ 6EF065C703D4EE19006877C2 = {
+ isa = PBXTargetDependency;
+ target = 6EF065C503D4EE19006877C2;
+ };
+ 6EF065C903D4F0CA006877C2 = {
+ isa = PBXTargetDependency;
+ target = 6EF7C58603D3BC6D00000104;
+ };
+ 6EF7C58103D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58203D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58303D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58403D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58503D3BC6D00000104 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6EF7C58603D3BC6D00000104 = {
+ buildPhases = (
+ 6EF7C58103D3BC6D00000104,
+ 6EF7C58203D3BC6D00000104,
+ 6EF7C58303D3BC6D00000104,
+ 6EF7C58403D3BC6D00000104,
+ 6EF7C58503D3BC6D00000104,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = glxAGL;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = bundle;
+ };
+ dependencies = (
+ );
+ isa = PBXBundleTarget;
+ name = glxAGL;
+ productName = glxAqua;
+ productReference = 6EF7C58703D3BC6D00000104;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>glxAGL</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>GLX bundle with AGL</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.1</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.1</string>
+</dict>
+</plist>
+";
+ };
+ 6EF7C58703D3BC6D00000104 = {
+ isa = PBXBundleReference;
+ path = glxAGL.bundle;
+ refType = 3;
+ };
+//6E0
+//6E1
+//6E2
+//6E3
+//6E4
+//F50
+//F51
+//F52
+//F53
+//F54
+ F51BF62A02026DAF01000001 = {
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F51BF62B02026DDA01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F51BF62C02026E0601000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F51BF62D02026E1C01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F51BF62E02026E3501000001 = {
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F51BF62F02026E5C01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F51BF63002026E8D01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Portuguese;
+ path = Portuguese.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F5269C2D01D5BC3501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = pseudoramiX.c;
+ refType = 4;
+ };
+ F5269C2E01D5BC3501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = pseudoramiX.h;
+ refType = 4;
+ };
+ F53321390193CB6A01000001 = {
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F533213A0193CBA201000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F533213B0193CBB401000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F533213C0193CBC901000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F533213D0193CBE001000001 = {
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F533213E0193CBF401000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F533213F0193CC2501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = German;
+ path = German.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F53321400193CCF001000001 = {
+ isa = PBXFrameworkReference;
+ name = ApplicationServices.framework;
+ path = /System/Library/Frameworks/ApplicationServices.framework;
+ refType = 0;
+ };
+ F53321410193CCF001000001 = {
+ isa = PBXFrameworkReference;
+ name = CoreAudio.framework;
+ path = /System/Library/Frameworks/CoreAudio.framework;
+ refType = 0;
+ };
+ F533214201A4B3CE01000001 = {
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F533214301A4B3F001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F533214401A4B40F01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F533214501A4B42501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F533214601A4B45401000001 = {
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F533214701A4B48301000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F533214801A4B4D701000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Dutch;
+ path = Dutch.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F54BF6EA017D500901000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = startXClients.cpp;
+ refType = 4;
+ };
+ F54BF6EC017D506E01000001 = {
+ isa = PBXFileReference;
+ path = startXClients;
+ refType = 4;
+ };
+ F54BF6ED017D506E01000001 = {
+ fileRef = F54BF6EC017D506E01000001;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5582948015DAD3B01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzCommon.h;
+ refType = 4;
+ };
+ F5614B3B0251124C01000114 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = fullscreen.c;
+ refType = 4;
+ };
+ F5614B3C0251124C01000114 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = fullscreen.h;
+ refType = 4;
+ };
+ F5614B3D025112D901000114 = {
+ children = (
+ F5614B3B0251124C01000114,
+ F5614B3C0251124C01000114,
+ );
+ isa = PBXGroup;
+ name = "Full Screen";
+ path = "";
+ refType = 4;
+ };
+ F56CBD0D02EB84A801129B8A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = aqua.h;
+ refType = 4;
+ };
+ F56CBD0E02EB84A801129B8A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = aquaPicture.c;
+ refType = 4;
+ };
+ F56CBD0F02EBDCFC01129B8A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = aquaWindow.c;
+ refType = 4;
+ };
+ F587E16001924C1D01000001 = {
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F587E16101924C2F01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F587E16201924C5301000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F587E16301924C5E01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F587E16401924C6901000001 = {
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F587E16501924C7401000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F587E16601924C9D01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Swedish;
+ path = Swedish.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F58D65DB018F793801000001 = {
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F58D65DC018F794D01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F58D65DD018F798F01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F58D65DE018F79A001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F58D65DF018F79B101000001 = {
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F58D65E0018F79C001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F58D65E1018F79E001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = French;
+ path = French.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F5A94EF10314BAC70100011B = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwinEvents.c;
+ refType = 4;
+ };
+ F5ACD25CC5B5E96601000001 = {
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F5ACD25DC5B5E97701000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F5ACD25EC5B5E98D01000001 = {
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F5ACD25FC5B5E9AA01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F5ACD260C5B5E9DF01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F5ACD261C5B5EA2001000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F5ACD262C5B5EA4D01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = Spanish;
+ path = Spanish.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ F5ACD263C5BE031F01000001 = {
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/Credits.rtf;
+ refType = 4;
+ };
+ F5ACD264C5BE035B01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/InfoPlist.strings.cpp;
+ refType = 4;
+ };
+ F5ACD265C5BE038601000001 = {
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/MainMenu.nib;
+ refType = 4;
+ };
+ F5ACD266C5BE03C501000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/Localizable.strings;
+ refType = 4;
+ };
+ F5ACD267C5BE03FC01000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/XDarwinHelp.html.cpp;
+ refType = 4;
+ };
+ F5ACD268C5BE046401000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/XDarwinHelp.html;
+ refType = 4;
+ };
+ F5ACD269C5BE049301000001 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ name = ko;
+ path = ko.lproj/InfoPlist.strings;
+ refType = 4;
+ };
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA;
+}
diff --git a/hw/darwin/quartz/XDarwinStartup.c b/hw/darwin/quartz/XDarwinStartup.c
new file mode 100644
index 000000000..53343aa1e
--- /dev/null
+++ b/hw/darwin/quartz/XDarwinStartup.c
@@ -0,0 +1,165 @@
+/**************************************************************
+ *
+ * Startup program for Darwin X servers
+ *
+ * This program selects the appropriate X server to launch:
+ * XDarwin IOKit X server (default)
+ * XDarwinQuartz A soft link to the Quartz X server
+ * executable (-quartz etc. option)
+ *
+ * If told to idle, the program will simply pause and not
+ * launch any X server. This is to support startx being
+ * run by XDarwin.app.
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001-2002 Torrey T. Lyons. 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 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
+ * TORREY T. LYONS 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.
+ *
+ * Except as contained in this notice, the name of Torrey T. Lyons shall not
+ * be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Torrey T. Lyons.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/syslimits.h>
+#include <ApplicationServices/ApplicationServices.h>
+
+extern int errno;
+
+// Macros to build the path name
+#ifndef XBINDIR
+#define XBINDIR /usr/X11R6/bin
+#endif
+#define STR(s) #s
+#define XSTRPATH(s) STR(s) "/"
+#define XPATH(file) XSTRPATH(XBINDIR) STR(file)
+
+int main(
+ int argc,
+ char *argv[] )
+{
+ int i, j, quartzMode = -1;
+ char **newargv;
+
+ // Check if we are going to run in Quartz mode or idle
+ // to support startx from the Quartz server. The last
+ // parameter in the list is the one used.
+ for (i = argc-1; i; i--) {
+ if (!strcmp(argv[i], "-idle")) {
+ pause();
+ return 0;
+
+ } else if (!strcmp(argv[i], "-quartz") ||
+ !strcmp(argv[i], "-rootless") ||
+ !strcmp(argv[i], "-fullscreen"))
+ {
+ quartzMode = 1;
+ break;
+
+ } else if (!strcmp(argv[i], "-iokit")) {
+ quartzMode = 0;
+ break;
+ }
+ }
+
+ if (quartzMode == -1) {
+#ifdef HAS_CG_MACH_PORT
+ // Check if the CoreGraphics window server is running.
+ // Mike Paquette says this is the fastest way to determine if it is running.
+ CFMachPortRef cgMachPortRef = CGWindowServerCFMachPort();
+ if (cgMachPortRef == NULL)
+ quartzMode = 0;
+ else
+ quartzMode = 1;
+#else
+ // On older systems we assume IOKit mode.
+ quartzMode = 0;
+#endif
+ }
+
+ if (quartzMode) {
+ // Launch the X server for the quartz modes
+
+ char quartzPath[PATH_MAX+1];
+ int pathLength;
+ OSStatus theStatus;
+ CFURLRef appURL;
+ CFStringRef appPath;
+ Boolean success;
+
+ // Build the new argument list
+ newargv = (char **) malloc((argc+2) * sizeof(char *));
+ for (j = argc; j; j--)
+ newargv[j] = argv[j];
+ newargv[argc] = "-nostartx";
+ newargv[argc+1] = NULL;
+
+ // Use the XDarwinQuartz soft link if it is valid
+ pathLength = readlink(XPATH(XDarwinQuartz), quartzPath, PATH_MAX);
+ if (pathLength != -1) {
+ quartzPath[pathLength] = '\0';
+ newargv[0] = quartzPath;
+ execv(newargv[0], newargv);
+ }
+
+ // Otherwise query LaunchServices for the location of the XDarwin application
+ theStatus = LSFindApplicationForInfo(kLSUnknownCreator,
+ CFSTR("org.xfree86.XDarwin"),
+ NULL, NULL, &appURL);
+ if (theStatus) {
+ fprintf(stderr, "Could not find the XDarwin application. (Error = 0x%lx)\n", theStatus);
+ fprintf(stderr, "Launch XDarwin once from the Finder.\n");
+ return theStatus;
+ }
+
+ appPath = CFURLCopyFileSystemPath (appURL, kCFURLPOSIXPathStyle);
+ success = CFStringGetCString(appPath, quartzPath, PATH_MAX, CFStringGetSystemEncoding());
+ if (! success) {
+ fprintf(stderr, "Could not find path to XDarwin application.\n");
+ return success;
+ }
+
+ // Launch the XDarwin application
+ strncat(quartzPath, "/Contents/MacOS/XDarwin", PATH_MAX);
+ newargv[0] = quartzPath;
+ execv(newargv[0], newargv);
+ fprintf(stderr, "Could not start XDarwin application at %s.\n", newargv[0]);
+ return errno;
+
+ } else {
+
+ // Build the new argument list
+ newargv = (char **) malloc((argc+1) * sizeof(char *));
+ for (j = argc; j; j--)
+ newargv[j] = argv[j];
+ newargv[0] = "XDarwin";
+ newargv[argc] = NULL;
+
+ // Launch the IOKit X server
+ execvp(newargv[0], newargv);
+ fprintf(stderr, "Could not start XDarwin IOKit X server.\n");
+ return errno;
+ }
+}
diff --git a/hw/darwin/quartz/XDarwinStartup.man b/hw/darwin/quartz/XDarwinStartup.man
new file mode 100644
index 000000000..312f4b88b
--- /dev/null
+++ b/hw/darwin/quartz/XDarwinStartup.man
@@ -0,0 +1,75 @@
+.\" $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.man,v 1.1 2002/03/28 02:21:18 torrey Exp $
+.TH XDarwinStartup 1
+.SH NAME
+XDarwinStartup - Startup program for the XDarwin X window server
+.SH SYNOPSIS
+.B XDarwinStartup
+[\fI-iokit\fP]
+[\fI-fullscreen\fP]
+[\fI-rootless\fP]
+[\fI-quartz\fP]
+[\fI-idle\fP]
+[\fIoptions\fP]
+.SH DESCRIPTION
+The \fIXDarwin(1)\fP X window server can be run in a variety of different
+modes and is actually two different executables. The IOKit X server,
+XDarwin, is used when running from the console. It is most commonly
+located in __XBinDir__. The Quartz X server, for running in parallel with
+Aqua, is a full-fledged Mac OS X application that can be started from
+the Finder. Its application bundle is XDarwin.app, which is typically
+located in /Applications.
+.I XDarwinStartup
+allows easy switching between these X servers and auto-detection of the
+appropriate one to use when launching from the command line.
+When run without any arguments,
+.I XDarwinStartup
+will start the Quartz X server if the Core Graphics window server
+is currently running. Otherwise it will start the IOKit X server.
+.PP
+To locate the Quartz X server,
+.I XDarwinStartup
+will try to read the soft link at __XBinDir__/XDarwinQuartz.
+This is typically a soft link to the executable of the XDarwin.app
+application. If this fails,
+.I XDarwinStartup
+will call Launch Services to locate XDarwin.app.
+.PP
+To start the IOKit X server,
+.I XDarwinStartup
+will run the XDarwin execuatable, which should be present in the
+user's path.
+.SH OPTIONS
+.I XDarwinStartup
+accepts and passes on all options to the X server it
+launches. In addition the following options have specific effects:
+.TP 8
+.B \-iokit
+Launch the IOKit X server.
+.TP 8
+.B \-fullscreen
+Launch the Quartz X server to run in full screen mode.
+.TP 8
+.B \-rootless
+Launch the Quartz X server to run in rootless mode.
+.TP 8
+.B \-quartz
+Launch the Quartz X server.
+.TP 8
+.B \-idle
+Pause and do nothing. This option is used by XDarwin.app when it is
+started from the Finder.
+.SH FILES
+.TP 30
+__XBinDir__/XDarwin
+IOKit mode X server
+.TP 30
+/Applications/XDarwin.app
+Quartz mode X server
+.TP 30
+__XBinDir__/XDarwinQuartz
+Soft link to Quartz mode X server executable
+.SH SEE ALSO
+XDarwin(1)
+.SH BUGS
+The path to XDarwinQuartz should not be hard coded.
+
diff --git a/hw/darwin/quartz/XServer.h b/hw/darwin/quartz/XServer.h
new file mode 100644
index 000000000..3eadd650e
--- /dev/null
+++ b/hw/darwin/quartz/XServer.h
@@ -0,0 +1,112 @@
+//
+// XServer.h
+//
+/*
+ * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
+ * Copyright (c) 2002-2003 Torrey T. Lyons. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.8 2003/01/23 00:34:26 torrey Exp $ */
+
+#define BOOL xBOOL
+#include "Xproto.h"
+#undef BOOL
+
+#import <Cocoa/Cocoa.h>
+
+@interface XServer : NSObject {
+ // server state
+ int serverState;
+ NSRecursiveLock *serverLock;
+ BOOL serverVisible;
+ BOOL rootlessMenuBarVisible;
+ BOOL queueShowServer;
+ UInt32 mouseState;
+ Class windowClass;
+
+ // server event queue
+ BOOL sendServerEvents;
+ int eventWriteFD;
+
+ // Aqua interface
+ IBOutlet NSWindow *modeWindow;
+ IBOutlet NSButton *startupModeButton;
+ IBOutlet NSButton *startFullScreenButton;
+ IBOutlet NSButton *startRootlessButton;
+ IBOutlet NSWindow *helpWindow;
+ IBOutlet NSButton *startupHelpButton;
+ IBOutlet NSPanel *switchWindow;
+}
+
+- (id)init;
+
+- (BOOL)translateEvent:(NSEvent *)anEvent;
+- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent;
+
++ (void)append:(NSString *)value toEnv:(NSString *)name;
+
+- (void)startX;
+- (void)finishStartX;
+- (BOOL)startXClients;
+- (void)run;
+- (void)toggle;
+- (void)showServer:(BOOL)show;
+- (void)forceShowServer:(BOOL)show;
+- (void)setRootClip:(BOOL)enable;
+- (void)readPasteboard;
+- (void)writePasteboard;
+- (void)quitServer;
+- (void)sendXEvent:(xEvent *)xe;
+- (void)sendShowHide:(BOOL)show;
+- (void)clientProcessDone:(int)clientStatus;
+
+// Aqua interface actions
+- (IBAction)startFullScreen:(id)sender;
+- (IBAction)startRootless:(id)sender;
+- (IBAction)closeHelpAndShow:(id)sender;
+- (IBAction)showAction:(id)sender;
+
+// NSApplication delegate
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
+- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
+- (void)applicationWillResignActive:(NSNotification *)aNotification;
+- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
+
+// NSPort delegate
+- (void)handlePortMessage:(NSPortMessage *)portMessage;
+
+@end
+
+// X server states
+enum {
+ server_NotStarted,
+ server_Starting,
+ server_Running,
+ server_Quitting,
+ server_Done
+};
+
diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m
new file mode 100644
index 000000000..c57defd53
--- /dev/null
+++ b/hw/darwin/quartz/XServer.m
@@ -0,0 +1,1029 @@
+//
+// XServer.m
+//
+// This class handles the interaction between the Cocoa front-end
+// and the Darwin X server thread.
+//
+// Created by Andreas Monitzer on January 6, 2001.
+//
+/*
+ * Copyright (c) 2001 Andreas Monitzer. All Rights Reserved.
+ * Copyright (c) 2002-2003 Torrey T. Lyons. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.8 2003/01/23 00:34:26 torrey Exp $ */
+
+#include "quartzCommon.h"
+
+#define BOOL xBOOL
+#include "X.h"
+#include "Xproto.h"
+#include "os.h"
+#include "darwin.h"
+#undef BOOL
+
+#import "XServer.h"
+#import "Preferences.h"
+
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/syslimits.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <pwd.h>
+#include <signal.h>
+#include <fcntl.h>
+
+// For power management notifications
+#import <mach/mach_port.h>
+#import <mach/mach_interface.h>
+#import <mach/mach_init.h>
+#import <IOKit/pwr_mgt/IOPMLib.h>
+#import <IOKit/IOMessage.h>
+
+#define ENQUEUE(xe) \
+{ \
+ char byte = 0; \
+ DarwinEQEnqueue(xe); \
+ /* signal there is an event ready to handle */ \
+ write(eventWriteFD, &byte, 1); \
+}
+
+// Types of shells
+enum {
+ shell_Unknown,
+ shell_Bourne,
+ shell_C
+};
+
+typedef struct {
+ char *name;
+ int type;
+} shellList_t;
+
+static shellList_t const shellList[] = {
+ { "csh", shell_C }, // standard C shell
+ { "tcsh", shell_C }, // ... needs no introduction
+ { "sh", shell_Bourne }, // standard Bourne shell
+ { "zsh", shell_Bourne }, // Z shell
+ { "bash", shell_Bourne }, // GNU Bourne again shell
+ { NULL, shell_Unknown }
+};
+
+extern int argcGlobal;
+extern char **argvGlobal;
+extern char **envpGlobal;
+extern int main(int argc, char *argv[], char *envp[]);
+extern void HideMenuBar(void);
+extern void ShowMenuBar(void);
+extern void QuartzReallySetCursor();
+static void childDone(int sig);
+static void powerDidChange(void *x, io_service_t y, natural_t messageType,
+ void *messageArgument);
+
+static NSPort *signalPort;
+static NSPort *returnPort;
+static NSPortMessage *signalMessage;
+static pid_t clientPID;
+static XServer *oneXServer;
+static NSRect aquaMenuBarBox;
+static io_connect_t root_port;
+
+
+@implementation XServer
+
+- (id)init
+{
+ self = [super init];
+ oneXServer = self;
+
+ serverState = server_NotStarted;
+ serverLock = [[NSRecursiveLock alloc] init];
+ clientPID = 0;
+ sendServerEvents = NO;
+ serverVisible = NO;
+ rootlessMenuBarVisible = YES;
+ queueShowServer = YES;
+ quartzServerQuitting = NO;
+ mouseState = 0;
+ eventWriteFD = quartzEventWriteFD;
+ windowClass = [NSWindow class];
+
+ // set up a port to safely send messages to main thread from server thread
+ signalPort = [[NSPort port] retain];
+ returnPort = [[NSPort port] retain];
+ signalMessage = [[NSPortMessage alloc] initWithSendPort:signalPort
+ receivePort:returnPort components:nil];
+
+ // set up receiving end
+ [signalPort setDelegate:self];
+ [[NSRunLoop currentRunLoop] addPort:signalPort
+ forMode:NSDefaultRunLoopMode];
+ [[NSRunLoop currentRunLoop] addPort:signalPort
+ forMode:NSModalPanelRunLoopMode];
+
+ return self;
+}
+
+- (NSApplicationTerminateReply)
+ applicationShouldTerminate:(NSApplication *)sender
+{
+ // Quit if the X server is not running
+ if ([serverLock tryLock]) {
+ quartzServerQuitting = YES;
+ serverState = server_Done;
+ if (clientPID != 0)
+ kill(clientPID, SIGINT);
+ return NSTerminateNow;
+ }
+
+ // Hide the X server and stop sending it events
+ [self showServer:NO];
+ sendServerEvents = NO;
+
+ if (clientPID != 0 || !quartzStartClients) {
+ int but;
+
+ but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""),
+ NSLocalizedString(@"Quitting the X server will terminate any running X Window System programs.",@""),
+ NSLocalizedString(@"Quit",@""),
+ NSLocalizedString(@"Cancel",@""),
+ nil);
+
+ switch (but) {
+ case NSAlertDefaultReturn: // quit
+ break;
+ case NSAlertAlternateReturn: // cancel
+ if (serverState == server_Running)
+ sendServerEvents = YES;
+ return NSTerminateCancel;
+ }
+ }
+
+ quartzServerQuitting = YES;
+ if (clientPID != 0)
+ kill(clientPID, SIGINT);
+
+ // At this point the X server is either running or starting.
+ if (serverState == server_Starting) {
+ // Quit will be queued later when server is running
+ return NSTerminateLater;
+ } else if (serverState == server_Running) {
+ [self quitServer];
+ }
+
+ return NSTerminateNow;
+}
+
+// Ensure that everything has quit cleanly
+- (void)applicationWillTerminate:(NSNotification *)aNotification
+{
+ // Make sure the client process has finished
+ if (clientPID != 0) {
+ NSLog(@"Waiting on client process...");
+ sleep(2);
+
+ // If the client process hasn't finished yet, kill it off
+ if (clientPID != 0) {
+ int clientStatus;
+ NSLog(@"Killing client process...");
+ killpg(clientPID, SIGKILL);
+ waitpid(clientPID, &clientStatus, 0);
+ }
+ }
+
+ // Wait until the X server thread quits
+ [serverLock lock];
+}
+
+// returns YES when event was handled
+- (BOOL)translateEvent:(NSEvent *)anEvent
+{
+ xEvent xe;
+ static BOOL mouse1Pressed = NO;
+ NSEventType type;
+ unsigned int flags;
+
+ if (!sendServerEvents) {
+ return NO;
+ }
+
+ type = [anEvent type];
+ flags = [anEvent modifierFlags];
+
+ if (!quartzRootless) {
+ // Check for switch keypress
+ if ((type == NSKeyDown) && (![anEvent isARepeat]) &&
+ ([anEvent keyCode] == [Preferences keyCode]))
+ {
+ unsigned int switchFlags = [Preferences modifiers];
+
+ // Switch if all the switch modifiers are pressed, while none are
+ // pressed that should not be, except for caps lock.
+ if (((flags & switchFlags) == switchFlags) &&
+ ((flags & ~(switchFlags | NSAlphaShiftKeyMask)) == 0))
+ {
+ [self toggle];
+ return YES;
+ }
+ }
+
+ if (!serverVisible)
+ return NO;
+ }
+
+ memset(&xe, 0, sizeof(xe));
+
+ switch (type) {
+ case NSLeftMouseUp:
+ [self getMousePosition:&xe fromEvent:anEvent];
+ if (quartzRootless && !mouse1Pressed) {
+ // MouseUp after MouseDown in menu - ignore
+ return NO;
+ }
+ mouse1Pressed = NO;
+ xe.u.u.type = ButtonRelease;
+ xe.u.u.detail = 1;
+ break;
+ case NSLeftMouseDown:
+ [self getMousePosition:&xe fromEvent:anEvent];
+ if (quartzRootless &&
+ ! ([anEvent window] &&
+ [[anEvent window] isKindOfClass:windowClass])) {
+ // Click in non X window - ignore
+ return NO;
+ }
+ mouse1Pressed = YES;
+ xe.u.u.type = ButtonPress;
+ xe.u.u.detail = 1;
+ break;
+ case NSMouseMoved:
+ case NSLeftMouseDragged:
+ case NSRightMouseDragged:
+ case NSOtherMouseDragged:
+ [self getMousePosition:&xe fromEvent:anEvent];
+ xe.u.u.type = MotionNotify;
+ break;
+ case NSSystemDefined:
+ {
+ long hwButtons = [anEvent data2];
+
+ if (![anEvent subtype]==7)
+ return NO; // we only use multibutton mouse events
+ if (mouseState == hwButtons)
+ return NO; // ignore double events
+ mouseState = hwButtons;
+
+ [self getMousePosition:&xe fromEvent:anEvent];
+ xe.u.u.type = kXDarwinUpdateButtons;
+ xe.u.clientMessage.u.l.longs0 = [anEvent data1];
+ xe.u.clientMessage.u.l.longs1 =[anEvent data2];
+ break;
+ }
+ case NSScrollWheel:
+ [self getMousePosition:&xe fromEvent:anEvent];
+ xe.u.u.type = kXDarwinScrollWheel;
+ xe.u.clientMessage.u.s.shorts0 = [anEvent deltaY];
+ break;
+ case NSKeyDown:
+ case NSKeyUp:
+ // If the mouse is not on the valid X display area,
+ // we don't send the X server key events.
+ if (![self getMousePosition:&xe fromEvent:nil])
+ return NO;
+ if (type == NSKeyDown)
+ xe.u.u.type = KeyPress;
+ else
+ xe.u.u.type = KeyRelease;
+ xe.u.u.detail = [anEvent keyCode];
+ break;
+ case NSFlagsChanged:
+ [self getMousePosition:&xe fromEvent:nil];
+ xe.u.u.type = kXDarwinUpdateModifiers;
+ xe.u.clientMessage.u.l.longs0 = flags;
+ break;
+ case NSOtherMouseDown: // undocumented MouseDown
+ case NSOtherMouseUp: // undocumented MouseUp
+ // Hide these from AppKit to avoid its log messages
+ return YES;
+ default:
+ return NO;
+ }
+
+ [self sendXEvent:&xe];
+
+ // Rootless: Send first NSLeftMouseDown to windows and views so window
+ // ordering can be suppressed.
+ // Don't pass further events - they (incorrectly?) bring the window
+ // forward no matter what.
+ if (quartzRootless &&
+ (type == NSLeftMouseDown || type == NSLeftMouseUp) &&
+ [anEvent clickCount] == 1 &&
+ [[anEvent window] isKindOfClass:windowClass])
+ {
+ return NO;
+ }
+
+ return YES;
+}
+
+// Return mouse coordinates, inverting y coordinate.
+// The coordinates are extracted from an event or the current mouse position.
+// For rootless mode, the menu bar is treated as not part of the usable
+// X display area and the cursor position is adjusted accordingly.
+// Returns YES if the cursor is not in the menu bar.
+- (BOOL)getMousePosition:(xEvent *)xe fromEvent:(NSEvent *)anEvent
+{
+ NSPoint pt;
+
+ if (anEvent) {
+ NSWindow *eventWindow = [anEvent window];
+
+ if (eventWindow) {
+ pt = [anEvent locationInWindow];
+ pt.x += [eventWindow frame].origin.x;
+ pt.y += [eventWindow frame].origin.y;
+ } else {
+ pt = [NSEvent mouseLocation];
+ }
+ } else {
+ pt = [NSEvent mouseLocation];
+ }
+
+ xe->u.keyButtonPointer.rootX = (int)(pt.x);
+
+ if (quartzRootless && NSMouseInRect(pt, aquaMenuBarBox, NO)) {
+ // mouse in menu bar - tell X11 that it's just below instead
+ xe->u.keyButtonPointer.rootY = aquaMenuBarHeight;
+ return NO;
+ } else {
+ xe->u.keyButtonPointer.rootY =
+ NSHeight([[NSScreen mainScreen] frame]) - (int)(pt.y);
+ return YES;
+ }
+}
+
+// Append a string to the given enviroment variable
++ (void)append:(NSString*)value toEnv:(NSString*)name
+{
+ setenv([name cString],
+ [[[NSString stringWithCString:getenv([name cString])]
+ stringByAppendingString:value] cString],1);
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+ // Block SIGPIPE
+ // SIGPIPE repeatably killed the (rootless) server when closing a
+ // dozen xterms in rapid succession. Those SIGPIPEs should have been
+ // sent to the X server thread, which ignores them, but somehow they
+ // ended up in this thread instead.
+ {
+ sigset_t set;
+ sigemptyset(&set);
+ sigaddset(&set, SIGPIPE);
+ // pthread_sigmask not implemented yet
+ // pthread_sigmask(SIG_BLOCK, &set, NULL);
+ sigprocmask(SIG_BLOCK, &set, NULL);
+ }
+
+ if (quartzRootless == -1) {
+ // The display mode was not set from the command line.
+ // Show mode pick panel?
+ if ([Preferences modeWindow]) {
+ if ([Preferences rootless])
+ [startRootlessButton setKeyEquivalent:@"\r"];
+ else
+ [startFullScreenButton setKeyEquivalent:@"\r"];
+ [modeWindow makeKeyAndOrderFront:nil];
+ } else {
+ // Otherwise use default mode
+ quartzRootless = [Preferences rootless];
+ [self startX];
+ }
+ } else {
+ [self startX];
+ }
+}
+
+// Start the X server thread and the client process
+- (void)startX
+{
+ NSDictionary *appDictionary;
+ NSString *appVersion;
+
+ [modeWindow close];
+
+ // Calculate the height of the menu bar so rootless mode can avoid it
+ if (quartzRootless) {
+ aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) -
+ NSMaxY([[NSScreen mainScreen] visibleFrame]) - 1;
+ aquaMenuBarBox =
+ NSMakeRect(0, NSMaxY([[NSScreen mainScreen] visibleFrame]) + 1,
+ NSWidth([[NSScreen mainScreen] frame]),
+ aquaMenuBarHeight);
+ }
+
+ // Write the XDarwin version to the console log
+ appDictionary = [[NSBundle mainBundle] infoDictionary];
+ appVersion = [appDictionary objectForKey:@"CFBundleShortVersionString"];
+ if (appVersion)
+ NSLog(@"\n%@", appVersion);
+ else
+ NSLog(@"No version");
+
+ // Start the X server thread
+ serverState = server_Starting;
+ [NSThread detachNewThreadSelector:@selector(run) toTarget:self
+ withObject:nil];
+
+ // Start the X clients if started from GUI
+ if (quartzStartClients) {
+ [self startXClients];
+ }
+
+ if (quartzRootless) {
+ // There is no help window for rootless; just start
+ [helpWindow close];
+ helpWindow = nil;
+ } else {
+ IONotificationPortRef notify;
+ io_object_t anIterator;
+
+ // Register for system power notifications
+ root_port = IORegisterForSystemPower(0, &notify, powerDidChange,
+ &anIterator);
+ if (root_port) {
+ CFRunLoopAddSource([[NSRunLoop currentRunLoop] getCFRunLoop],
+ IONotificationPortGetRunLoopSource(notify),
+ kCFRunLoopDefaultMode);
+ } else {
+ NSLog(@"Failed to register for system power notifications.");
+ }
+
+ // Show the X switch window if not using dock icon switching
+ if (![Preferences dockSwitch])
+ [switchWindow orderFront:nil];
+
+ if ([Preferences startupHelp]) {
+ // display the full screen mode help
+ [helpWindow makeKeyAndOrderFront:nil];
+ queueShowServer = NO;
+ } else {
+ // start running full screen and make sure X is visible
+ ShowMenuBar();
+ [self closeHelpAndShow:nil];
+ }
+ }
+}
+
+// Finish starting the X server thread
+// This includes anything that must be done after the X server is
+// ready to process events.
+- (void)finishStartX
+{
+ sendServerEvents = YES;
+ serverState = server_Running;
+
+ if (quartzRootless) {
+ [self forceShowServer:[NSApp isActive]];
+ } else {
+ [self forceShowServer:queueShowServer];
+ }
+
+ if (quartzServerQuitting) {
+ [self quitServer];
+ [NSApp replyToApplicationShouldTerminate:YES];
+ }
+}
+
+// Start the first X clients in a separate process
+- (BOOL)startXClients
+{
+ struct passwd *passwdUser;
+ NSString *shellPath, *dashShellName, *commandStr, *startXPath;
+ NSMutableString *safeStartXPath;
+ NSRange aRange;
+ NSBundle *thisBundle;
+ const char *shellPathStr, *newargv[3], *shellNameStr;
+ int fd[2], outFD, length, shellType, i;
+
+ // Register to catch the signal when the client processs finishes
+ signal(SIGCHLD, childDone);
+
+ // Get user's password database entry
+ passwdUser = getpwuid(getuid());
+
+ // Find the shell to use
+ if ([Preferences useDefaultShell])
+ shellPath = [NSString stringWithCString:passwdUser->pw_shell];
+ else
+ shellPath = [Preferences shellString];
+
+ dashShellName = [NSString stringWithFormat:@"-%@",
+ [shellPath lastPathComponent]];
+ shellPathStr = [shellPath cString];
+ shellNameStr = [[shellPath lastPathComponent] cString];
+
+ if (access(shellPathStr, X_OK)) {
+ NSLog(@"Shell %s is not valid!", shellPathStr);
+ return NO;
+ }
+
+ // Find the type of shell
+ for (i = 0; shellList[i].name; i++) {
+ if (!strcmp(shellNameStr, shellList[i].name))
+ break;
+ }
+ shellType = shellList[i].type;
+
+ newargv[0] = [dashShellName cString];
+ if (shellType == shell_Bourne) {
+ // Bourne shells need to be told they are interactive to make
+ // sure they read all their initialization files.
+ newargv[1] = "-i";
+ newargv[2] = NULL;
+ } else {
+ newargv[1] = NULL;
+ }
+
+ // Create a pipe to communicate with the X client process
+ NSAssert(pipe(fd) == 0, @"Could not create new pipe.");
+
+ // Open a file descriptor for writing to stdout and stderr
+ outFD = open("/dev/console", O_WRONLY, 0);
+ if (outFD == -1) {
+ outFD = open("/dev/null", O_WRONLY, 0);
+ NSAssert(outFD != -1, @"Could not open shell output.");
+ }
+
+ // Fork process to start X clients in user's default shell
+ // Sadly we can't use NSTask because we need to start a login shell.
+ // Login shells are started by passing "-" as the first character of
+ // argument 0. NSTask forces argument 0 to be the shell's name.
+ clientPID = vfork();
+ if (clientPID == 0) {
+
+ // Inside the new process:
+ if (fd[0] != STDIN_FILENO) {
+ dup2(fd[0], STDIN_FILENO); // Take stdin from pipe
+ close(fd[0]);
+ }
+ close(fd[1]); // Close write end of pipe
+ if (outFD == STDOUT_FILENO) { // Setup stdout and stderr
+ dup2(outFD, STDERR_FILENO);
+ } else if (outFD == STDERR_FILENO) {
+ dup2(outFD, STDOUT_FILENO);
+ } else {
+ dup2(outFD, STDERR_FILENO);
+ dup2(outFD, STDOUT_FILENO);
+ close(outFD);
+ }
+
+ // Setup environment
+ setenv("HOME", passwdUser->pw_dir, 1);
+ setenv("SHELL", shellPathStr, 1);
+ setenv("LOGNAME", passwdUser->pw_name, 1);
+ setenv("USER", passwdUser->pw_name, 1);
+ setenv("TERM", "unknown", 1);
+ if (chdir(passwdUser->pw_dir)) // Change to user's home dir
+ NSLog(@"Could not change to user's home directory.");
+
+ execv(shellPathStr, (char * const *)newargv); // Start user's shell
+
+ NSLog(@"Could not start X client process with errno = %i.", errno);
+ _exit(127);
+ }
+
+ // In parent process:
+ close(fd[0]); // Close read end of pipe
+ close(outFD); // Close output file descriptor
+
+ thisBundle = [NSBundle bundleForClass:[self class]];
+ startXPath = [thisBundle pathForResource:@"startXClients" ofType:nil];
+ if (!startXPath) {
+ NSLog(@"Could not find startXClients in application bundle!");
+ return NO;
+ }
+
+ // We will run the startXClients script with the path in single quotes
+ // in case there are problematic characters in the path. We still have
+ // to worry about there being single quotes in the path. So, replace
+ // all instances of the ' character in startXPath with '\''.
+ safeStartXPath = [NSMutableString stringWithString:startXPath];
+ aRange = NSMakeRange(0, [safeStartXPath length]);
+ while (aRange.length) {
+ aRange = [safeStartXPath rangeOfString:@"'" options:0 range:aRange];
+ if (!aRange.length)
+ break;
+ [safeStartXPath replaceCharactersInRange:aRange
+ withString:@"\'\\'\'"];
+ aRange.location += 4;
+ aRange.length = [safeStartXPath length] - aRange.location;
+ }
+
+ if ([Preferences addToPath]) {
+ commandStr = [NSString stringWithFormat:@"'%@' :%d %@\n",
+ safeStartXPath, [Preferences display],
+ [Preferences addToPathString]];
+ } else {
+ commandStr = [NSString stringWithFormat:@"'%@' :%d\n",
+ safeStartXPath, [Preferences display]];
+ }
+
+ length = [commandStr cStringLength];
+ if (write(fd[1], [commandStr cString], length) != length) {
+ NSLog(@"Write to X client process failed.");
+ return NO;
+ }
+
+ // Close the pipe so that shell will terminate when xinit quits
+ close(fd[1]);
+
+ return YES;
+}
+
+// Run the X server thread
+- (void)run
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ [serverLock lock];
+ main(argcGlobal, argvGlobal, envpGlobal);
+ serverVisible = NO;
+ [pool release];
+ [serverLock unlock];
+ QuartzMessageMainThread(kQuartzServerDied, nil, 0);
+}
+
+// Full screen mode was picked in the mode pick panel
+- (IBAction)startFullScreen:(id)sender
+{
+ [Preferences setModeWindow:[startupModeButton intValue]];
+ [Preferences saveToDisk];
+ quartzRootless = FALSE;
+ [self startX];
+}
+
+// Rootless mode was picked in the mode pick panel
+- (IBAction)startRootless:(id)sender
+{
+ [Preferences setModeWindow:[startupModeButton intValue]];
+ [Preferences saveToDisk];
+ quartzRootless = TRUE;
+ [self startX];
+}
+
+// Close the help splash screen and show the X server
+- (IBAction)closeHelpAndShow:(id)sender
+{
+ if (sender) {
+ int helpVal = [startupHelpButton intValue];
+ [Preferences setStartupHelp:helpVal];
+ [Preferences saveToDisk];
+ }
+ [helpWindow close];
+ helpWindow = nil;
+
+ [self forceShowServer:YES];
+ [NSApp activateIgnoringOtherApps:YES];
+}
+
+// Show the X server when sent message from GUI
+- (IBAction)showAction:(id)sender
+{
+ [self forceShowServer:YES];
+}
+
+// Show or hide the X server or menu bar in rootless mode
+- (void)toggle
+{
+ if (quartzRootless) {
+#if 0
+ // FIXME: Remove or add option to not dodge menubar
+ if (rootlessMenuBarVisible)
+ HideMenuBar();
+ else
+ ShowMenuBar();
+ rootlessMenuBarVisible = !rootlessMenuBarVisible;
+#endif
+ } else {
+ [self showServer:!serverVisible];
+ }
+}
+
+// Show or hide the X server on screen
+- (void)showServer:(BOOL)show
+{
+ // Do not show or hide multiple times in a row
+ if (serverVisible == show)
+ return;
+
+ if (sendServerEvents) {
+ [self sendShowHide:show];
+ } else if (serverState == server_Starting) {
+ queueShowServer = show;
+ }
+}
+
+// Show or hide the X server irregardless of the current state
+- (void)forceShowServer:(BOOL)show
+{
+ serverVisible = !show;
+ [self showServer:show];
+}
+
+// Tell the X server to show or hide itself.
+// This ignores the current X server visible state.
+//
+// In full screen mode, the order we do things is important and must be
+// preserved between the threads. X drawing operations have to be performed
+// in the X server thread. It appears that we have the additional
+// constraint that we must hide and show the menu bar in the main thread.
+//
+// To show the X server:
+// 1. Capture the displays. (Main thread)
+// 2. Hide the menu bar. (Must be in main thread)
+// 3. Send event to X server thread to redraw X screen.
+// 4. Redraw the X screen. (Must be in X server thread)
+//
+// To hide the X server:
+// 1. Send event to X server thread to stop drawing.
+// 2. Stop drawing to the X screen. (Must be in X server thread)
+// 3. Message main thread that drawing is stopped.
+// 4. If main thread still wants X server hidden:
+// a. Release the displays. (Main thread)
+// b. Unhide the menu bar. (Must be in main thread)
+// Otherwise we have already queued an event to start drawing again.
+//
+- (void)sendShowHide:(BOOL)show
+{
+ xEvent xe;
+
+ [self getMousePosition:&xe fromEvent:nil];
+
+ if (show) {
+ if (!quartzRootless) {
+ QuartzFSCapture();
+ HideMenuBar();
+ }
+ xe.u.u.type = kXDarwinShow;
+ [self sendXEvent:&xe];
+
+ // the mouse location will have moved; track it
+ xe.u.u.type = MotionNotify;
+ [self sendXEvent:&xe];
+
+ // inform the X server of the current modifier state
+ xe.u.u.type = kXDarwinUpdateModifiers;
+ xe.u.clientMessage.u.l.longs0 = [[NSApp currentEvent] modifierFlags];
+ [self sendXEvent:&xe];
+
+ // put the pasteboard into the X cut buffer
+ [self readPasteboard];
+ } else {
+ // put the X cut buffer on the pasteboard
+ [self writePasteboard];
+
+ xe.u.u.type = kXDarwinHide;
+ [self sendXEvent:&xe];
+ }
+
+ serverVisible = show;
+}
+
+// Enable or disable rendering to the X screen
+- (void)setRootClip:(BOOL)enable
+{
+ xEvent xe;
+
+ xe.u.u.type = kXDarwinSetRootClip;
+ xe.u.clientMessage.u.l.longs0 = enable;
+ [self sendXEvent:&xe];
+}
+
+// Tell the X server to read from the pasteboard into the X cut buffer
+- (void)readPasteboard
+{
+ xEvent xe;
+
+ xe.u.u.type = kXDarwinReadPasteboard;
+ [self sendXEvent:&xe];
+}
+
+// Tell the X server to write the X cut buffer into the pasteboard
+- (void)writePasteboard
+{
+ xEvent xe;
+
+ xe.u.u.type = kXDarwinWritePasteboard;
+ [self sendXEvent:&xe];
+}
+
+- (void)quitServer
+{
+ xEvent xe;
+
+ xe.u.u.type = kXDarwinQuit;
+ [self sendXEvent:&xe];
+
+ // Revert to the Mac OS X arrow cursor. The main thread sets the cursor
+ // and it won't be responding to future requests to change it.
+ [[NSCursor arrowCursor] set];
+
+ serverState = server_Quitting;
+}
+
+- (void)sendXEvent:(xEvent *)xe
+{
+ // This field should be filled in for every event
+ xe->u.keyButtonPointer.time = GetTimeInMillis();
+
+#if 0
+ // FIXME: Really?
+ if (quartzRootless &&
+ (ev->type == NSLeftMouseDown || ev->type == NSLeftMouseUp ||
+ (ev->type == NSSystemDefined && ev->data.compound.subType == 7)))
+ {
+ // mouse button event - send mouseMoved to this position too
+ // X gets confused if it gets a click that isn't at the last
+ // reported mouse position.
+ xEvent moveEvent = *ev;
+ xe.u.u.type = NSMouseMoved;
+ [self sendXEvent:&moveEvent];
+ }
+#endif
+
+ ENQUEUE(xe);
+}
+
+// Handle messages from the X server thread
+- (void)handlePortMessage:(NSPortMessage *)portMessage
+{
+ unsigned msg = [portMessage msgid];
+
+ switch(msg) {
+ case kQuartzServerHidden:
+ // Make sure the X server wasn't queued to be shown again while
+ // the hide was pending.
+ if (!quartzRootless && !serverVisible) {
+ QuartzFSRelease();
+ ShowMenuBar();
+ }
+ break;
+
+ case kQuartzServerStarted:
+ [self finishStartX];
+ break;
+
+ case kQuartzServerDied:
+ sendServerEvents = NO;
+ serverState = server_Done;
+ if (!quartzServerQuitting) {
+ [NSApp terminate:nil]; // quit if we aren't already
+ }
+ break;
+
+ case kQuartzCursorUpdate:
+ QuartzReallySetCursor();
+ break;
+
+ case kQuartzPostEvent:
+ {
+ const xEvent *xe = [[[portMessage components] lastObject] bytes];
+ ENQUEUE(xe);
+ break;
+ }
+
+ default:
+ NSLog(@"Unknown message from server thread.");
+ }
+}
+
+// Quit the X server when the X client process finishes
+- (void)clientProcessDone:(int)clientStatus
+{
+ if (WIFEXITED(clientStatus)) {
+ int exitStatus = WEXITSTATUS(clientStatus);
+ if (exitStatus != 0)
+ NSLog(@"X client process terminated with status %i.", exitStatus);
+ } else {
+ NSLog(@"X client process terminated abnormally.");
+ }
+
+ if (!quartzServerQuitting) {
+ [NSApp terminate:nil]; // quit if we aren't already
+ }
+}
+
+// Called when the user clicks the application icon,
+// but not when Cmd-Tab is used.
+// Rootless: Don't switch until applicationWillBecomeActive.
+- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
+ hasVisibleWindows:(BOOL)flag
+{
+ if ([Preferences dockSwitch] && !quartzRootless) {
+ [self showServer:YES];
+ }
+ return NO;
+}
+
+- (void)applicationWillResignActive:(NSNotification *)aNotification
+{
+ [self showServer:NO];
+}
+
+- (void)applicationWillBecomeActive:(NSNotification *)aNotification
+{
+ if (quartzRootless)
+ [self showServer:YES];
+}
+
+@end
+
+
+// Send a message to the main thread, which calls handlePortMessage in
+// response. Must only be called from the X server thread because
+// NSPort is not thread safe.
+void QuartzMessageMainThread(unsigned msg, void *data, unsigned length)
+{
+ if (msg == kQuartzPostEvent) {
+ NSData *eventData = [NSData dataWithBytes:data length:length];
+ NSArray *eventArray = [NSArray arrayWithObject:eventData];
+ NSPortMessage *newMessage =
+ [[NSPortMessage alloc]
+ initWithSendPort:signalPort
+ receivePort:returnPort components:eventArray];
+ [newMessage setMsgid:msg];
+ [newMessage sendBeforeDate:[NSDate distantPast]];
+ [newMessage release];
+ } else {
+ [signalMessage setMsgid:msg];
+ [signalMessage sendBeforeDate:[NSDate distantPast]];
+ }
+}
+
+// Handle SIGCHLD signals
+static void childDone(int sig)
+{
+ int clientStatus;
+
+ if (clientPID == 0)
+ return;
+
+ // Make sure it was the client task that finished
+ if (waitpid(clientPID, &clientStatus, WNOHANG) == clientPID) {
+ if (WIFSTOPPED(clientStatus))
+ return;
+ clientPID = 0;
+ [oneXServer clientProcessDone:clientStatus];
+ }
+}
+
+static void powerDidChange(
+ void *x,
+ io_service_t y,
+ natural_t messageType,
+ void *messageArgument)
+{
+ switch (messageType) {
+ case kIOMessageSystemWillSleep:
+ if (!quartzRootless) {
+ [oneXServer setRootClip:FALSE];
+ }
+ IOAllowPowerChange(root_port, (long)messageArgument);
+ break;
+ case kIOMessageCanSystemSleep:
+ IOAllowPowerChange(root_port, (long)messageArgument);
+ break;
+ case kIOMessageSystemHasPoweredOn:
+ if (!quartzRootless) {
+ [oneXServer setRootClip:TRUE];
+ }
+ break;
+ }
+
+}
diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c
new file mode 100644
index 000000000..e55aabd6f
--- /dev/null
+++ b/hw/darwin/quartz/pseudoramiX.c
@@ -0,0 +1,420 @@
+/*
+ * Minimal implementation of PanoramiX/Xinerama
+ *
+ * This is used in rootless mode where the underlying window server
+ * already provides an abstracted view of multiple screens as one
+ * large screen area.
+ *
+ * This code is largely based on panoramiX.c, which contains the
+ * following copyright notice:
+ */
+/*****************************************************************
+Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
+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.
+
+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
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+******************************************************************/
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.2 2002/10/16 21:13:33 dawes Exp $ */
+
+#include "pseudoramiX.h"
+
+#include "extnsionst.h"
+#include "dixstruct.h"
+#include "window.h"
+#include "panoramiXproto.h"
+#include "globals.h"
+
+extern int ProcPanoramiXQueryVersion (ClientPtr client);
+
+static void PseudoramiXResetProc(ExtensionEntry *extEntry);
+
+static int ProcPseudoramiXQueryVersion(ClientPtr client);
+static int ProcPseudoramiXGetState(ClientPtr client);
+static int ProcPseudoramiXGetScreenCount(ClientPtr client);
+static int ProcPseudoramiXGetScreenSize(ClientPtr client);
+static int ProcPseudoramiXIsActive(ClientPtr client);
+static int ProcPseudoramiXQueryScreens(ClientPtr client);
+static int ProcPseudoramiXDispatch(ClientPtr client);
+
+static int SProcPseudoramiXQueryVersion(ClientPtr client);
+static int SProcPseudoramiXGetState(ClientPtr client);
+static int SProcPseudoramiXGetScreenCount(ClientPtr client);
+static int SProcPseudoramiXGetScreenSize(ClientPtr client);
+static int SProcPseudoramiXIsActive(ClientPtr client);
+static int SProcPseudoramiXQueryScreens(ClientPtr client);
+static int SProcPseudoramiXDispatch(ClientPtr client);
+
+
+typedef struct {
+ int x;
+ int y;
+ int w;
+ int h;
+} PseudoramiXScreenRec;
+
+static PseudoramiXScreenRec *pseudoramiXScreens = NULL;
+static int pseudoramiXScreensAllocated = 0;
+static int pseudoramiXNumScreens = 0;
+static unsigned long pseudoramiXGeneration = 0;
+
+
+// Add a PseudoramiX screen.
+// The rest of the X server will know nothing about this screen.
+// Can be called before or after extension init.
+// Screens must be re-added once per generation.
+void
+PseudoramiXAddScreen(int x, int y, int w, int h)
+{
+ PseudoramiXScreenRec *s;
+
+ if (noPseudoramiXExtension) return;
+
+ if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
+ pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
+ pseudoramiXScreens = xrealloc(pseudoramiXScreens,
+ pseudoramiXScreensAllocated *
+ sizeof(PseudoramiXScreenRec));
+ }
+
+ s = &pseudoramiXScreens[pseudoramiXNumScreens++];
+ s->x = x;
+ s->y = y;
+ s->w = w;
+ s->h = h;
+}
+
+
+// Initialize PseudoramiX.
+// Copied from PanoramiXExtensionInit
+void PseudoramiXExtensionInit(int argc, char *argv[])
+{
+ Bool success = FALSE;
+ ExtensionEntry *extEntry;
+
+ if (noPseudoramiXExtension) return;
+
+ if (pseudoramiXNumScreens == 1 || aquaNumScreens == 1) {
+ // Only one screen - disable Xinerama extension.
+ noPseudoramiXExtension = TRUE;
+ return;
+ }
+
+ // The server must not run the PanoramiX operations.
+ noPanoramiXExtension = TRUE;
+
+ if (pseudoramiXGeneration != serverGeneration) {
+ extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
+ ProcPseudoramiXDispatch,
+ SProcPseudoramiXDispatch,
+ PseudoramiXResetProc,
+ StandardMinorOpcode);
+ if (!extEntry) {
+ ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n");
+ } else {
+ pseudoramiXGeneration = serverGeneration;
+ success = TRUE;
+ }
+ }
+
+ if (!success) {
+ ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
+ PANORAMIX_PROTOCOL_NAME);
+ return;
+ }
+}
+
+
+static void PseudoramiXResetProc(ExtensionEntry *extEntry)
+{
+ pseudoramiXNumScreens = 0;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXQueryVersion(ClientPtr client)
+{
+ return ProcPanoramiXQueryVersion(client);
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetState(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetStateReq);
+ WindowPtr pWin;
+ xPanoramiXGetStateReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ pWin = LookupWindow (stuff->window, client);
+ if (!pWin)
+ return BadWindow;
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = !noPseudoramiXExtension;
+ if (client->swapped) {
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swaps (&rep.state, n);
+ }
+ WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
+ return client->noClientException;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetScreenCount(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenCountReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenCountReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ pWin = LookupWindow (stuff->window, client);
+ if (!pWin)
+ return BadWindow;
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.ScreenCount = pseudoramiXNumScreens;
+ if (client->swapped) {
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swaps (&rep.ScreenCount, n);
+ }
+ WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
+ return client->noClientException;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetScreenSize(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenSizeReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenSizeReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ pWin = LookupWindow (stuff->window, client);
+ if (!pWin)
+ return BadWindow;
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ /* screen dimensions */
+ rep.width = pseudoramiXScreens[stuff->screen].w;
+ // was panoramiXdataPtr[stuff->screen].width;
+ rep.height = pseudoramiXScreens[stuff->screen].h;
+ // was panoramiXdataPtr[stuff->screen].height;
+ if (client->swapped) {
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swaps (&rep.width, n);
+ swaps (&rep.height, n);
+ }
+ WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
+ return client->noClientException;
+}
+
+
+// was Xinerama
+static int ProcPseudoramiXIsActive(ClientPtr client)
+{
+ /* REQUEST(xXineramaIsActiveReq); */
+ xXineramaIsActiveReply rep;
+
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = !noPseudoramiXExtension;
+ if (client->swapped) {
+ register int n;
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swapl (&rep.state, n);
+ }
+ WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
+ return client->noClientException;
+}
+
+
+// was Xinerama
+static int ProcPseudoramiXQueryScreens(ClientPtr client)
+{
+ /* REQUEST(xXineramaQueryScreensReq); */
+ xXineramaQueryScreensReply rep;
+
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
+ rep.length = rep.number * sz_XineramaScreenInfo >> 2;
+ if (client->swapped) {
+ register int n;
+ swaps (&rep.sequenceNumber, n);
+ swapl (&rep.length, n);
+ swapl (&rep.number, n);
+ }
+ WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
+
+ if (!noPseudoramiXExtension) {
+ xXineramaScreenInfo scratch;
+ int i;
+
+ for(i = 0; i < pseudoramiXNumScreens; i++) {
+ scratch.x_org = pseudoramiXScreens[i].x;
+ scratch.y_org = pseudoramiXScreens[i].y;
+ scratch.width = pseudoramiXScreens[i].w;
+ scratch.height = pseudoramiXScreens[i].h;
+
+ if(client->swapped) {
+ register int n;
+ swaps (&scratch.x_org, n);
+ swaps (&scratch.y_org, n);
+ swaps (&scratch.width, n);
+ swaps (&scratch.height, n);
+ }
+ WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
+ }
+ }
+
+ return client->noClientException;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXDispatch (ClientPtr client)
+{ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_PanoramiXQueryVersion:
+ return ProcPseudoramiXQueryVersion(client);
+ case X_PanoramiXGetState:
+ return ProcPseudoramiXGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return ProcPseudoramiXGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return ProcPseudoramiXGetScreenSize(client);
+ case X_XineramaIsActive:
+ return ProcPseudoramiXIsActive(client);
+ case X_XineramaQueryScreens:
+ return ProcPseudoramiXQueryScreens(client);
+ }
+ return BadRequest;
+}
+
+
+
+static int
+SProcPseudoramiXQueryVersion (ClientPtr client)
+{
+ REQUEST(xPanoramiXQueryVersionReq);
+ register int n;
+
+ swaps(&stuff->length,n);
+ REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
+ return ProcPseudoramiXQueryVersion(client);
+}
+
+static int
+SProcPseudoramiXGetState(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetStateReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ return ProcPseudoramiXGetState(client);
+}
+
+static int
+SProcPseudoramiXGetScreenCount(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenCountReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ return ProcPseudoramiXGetScreenCount(client);
+}
+
+static int
+SProcPseudoramiXGetScreenSize(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenSizeReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ return ProcPseudoramiXGetScreenSize(client);
+}
+
+
+static int
+SProcPseudoramiXIsActive(ClientPtr client)
+{
+ REQUEST(xXineramaIsActiveReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+ return ProcPseudoramiXIsActive(client);
+}
+
+
+static int
+SProcPseudoramiXQueryScreens(ClientPtr client)
+{
+ REQUEST(xXineramaQueryScreensReq);
+ register int n;
+
+ swaps (&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+ return ProcPseudoramiXQueryScreens(client);
+}
+
+
+static int
+SProcPseudoramiXDispatch (ClientPtr client)
+{ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_PanoramiXQueryVersion:
+ return SProcPseudoramiXQueryVersion(client);
+ case X_PanoramiXGetState:
+ return SProcPseudoramiXGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return SProcPseudoramiXGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return SProcPseudoramiXGetScreenSize(client);
+ case X_XineramaIsActive:
+ return SProcPseudoramiXIsActive(client);
+ case X_XineramaQueryScreens:
+ return SProcPseudoramiXQueryScreens(client);
+ }
+ return BadRequest;
+}
diff --git a/hw/darwin/quartz/pseudoramiX.h b/hw/darwin/quartz/pseudoramiX.h
new file mode 100644
index 000000000..d0d596686
--- /dev/null
+++ b/hw/darwin/quartz/pseudoramiX.h
@@ -0,0 +1,10 @@
+/*
+ * Minimal implementation of PanoramiX/Xinerama
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.1 2002/03/28 02:21:18 torrey Exp $ */
+
+extern int noPseudoramiXExtension;
+extern int aquaNumScreens;
+
+void PseudoramiXAddScreen(int x, int y, int w, int h);
+void PseudoramiXExtensionInit(int argc, char *argv[]);
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
new file mode 100644
index 000000000..592a0e4a0
--- /dev/null
+++ b/hw/darwin/quartz/quartz.c
@@ -0,0 +1,305 @@
+/**************************************************************
+ *
+ * Quartz-specific support for the Darwin X Server
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
+ * 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.7 2003/01/23 00:34:26 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "quartz.h"
+#include "darwin.h"
+#include "quartzAudio.h"
+#include "quartzCursor.h"
+#include "fullscreen.h"
+#include "rootlessAqua.h"
+#include "pseudoramiX.h"
+
+// X headers
+#include "scrnintstr.h"
+#include "colormapst.h"
+
+// System headers
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <IOKit/pwr_mgt/IOPMLib.h>
+
+// Shared global variables for Quartz modes
+int quartzEventWriteFD = -1;
+int quartzStartClients = 1;
+int quartzRootless = -1;
+int quartzUseSysBeep = 0;
+int quartzUseAGL = 1;
+int quartzServerVisible = TRUE;
+int quartzServerQuitting = FALSE;
+int quartzScreenIndex = 0;
+int aquaMenuBarHeight = 0;
+int noPseudoramiXExtension = TRUE;
+int aquaNumScreens = 0;
+
+
+/*
+===========================================================================
+
+ Screen functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzAddScreen
+ * Do mode dependent initialization of each screen for Quartz.
+ */
+Bool QuartzAddScreen(
+ int index,
+ ScreenPtr pScreen)
+{
+ // allocate space for private per screen Quartz specific storage
+ QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1);
+ QUARTZ_PRIV(pScreen) = displayInfo;
+
+ // do full screen or rootless specific initialization
+ if (quartzRootless) {
+ return AquaAddScreen(index, pScreen);
+ } else {
+ return QuartzFSAddScreen(index, pScreen);
+ }
+}
+
+
+/*
+ * QuartzSetupScreen
+ * Finalize mode specific setup of each screen.
+ */
+Bool QuartzSetupScreen(
+ int index,
+ ScreenPtr pScreen)
+{
+ // do full screen or rootless specific setup
+ if (quartzRootless) {
+ if (! AquaSetupScreen(index, pScreen))
+ return FALSE;
+ } else {
+ if (! QuartzFSSetupScreen(index, pScreen))
+ return FALSE;
+ }
+
+ // setup cursor support
+ if (! QuartzInitCursor(pScreen))
+ return FALSE;
+
+ return TRUE;
+}
+
+
+/*
+ * QuartzInitOutput
+ * Quartz display initialization.
+ */
+void QuartzInitOutput(
+ int argc,
+ char **argv )
+{
+ static unsigned long generation = 0;
+
+ // Allocate private storage for each screen's Quartz specific info
+ if (generation != serverGeneration) {
+ quartzScreenIndex = AllocateScreenPrivateIndex();
+ generation = serverGeneration;
+ }
+
+ if (serverGeneration == 0) {
+ QuartzAudioInit();
+ }
+
+ if (!RegisterBlockAndWakeupHandlers(QuartzBlockHandler,
+ QuartzWakeupHandler,
+ NULL))
+ {
+ FatalError("Could not register block and wakeup handlers.");
+ }
+
+ if (quartzRootless) {
+ ErrorF("Display mode: Rootless Quartz\n");
+ AquaDisplayInit();
+ } else {
+ ErrorF("Display mode: Full screen Quartz\n");
+ QuartzFSDisplayInit();
+ }
+
+ // Init PseudoramiX implementation of Xinerama.
+ // This should be in InitExtensions, but that causes link errors
+ // for servers that don't link in pseudoramiX.c.
+ if (!noPseudoramiXExtension) {
+ PseudoramiXExtensionInit(argc, argv);
+ }
+}
+
+
+/*
+ * QuartzInitInput
+ * Inform the main thread the X server is ready to handle events.
+ */
+void QuartzInitInput(
+ int argc,
+ char **argv )
+{
+ QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
+}
+
+
+/*
+ * QuartzShow
+ * Show the X server on screen. Does nothing if already shown.
+ * Restore the X clip regions and the X server cursor state.
+ */
+static void QuartzShow(
+ int x, // cursor location
+ int y )
+{
+ int i;
+
+ if (!quartzServerVisible) {
+ quartzServerVisible = TRUE;
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (screenInfo.screens[i]) {
+ QuartzResumeXCursor(screenInfo.screens[i], x, y);
+ if (!quartzRootless)
+ xf86SetRootClip(screenInfo.screens[i], TRUE);
+ }
+ }
+ }
+}
+
+
+/*
+ * QuartzHide
+ * Remove the X server display from the screen. Does nothing if already
+ * hidden. Set X clip regions to prevent drawing, and restore the Aqua
+ * cursor.
+ */
+static void QuartzHide(void)
+{
+ int i;
+
+ if (quartzServerVisible) {
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (screenInfo.screens[i]) {
+ QuartzSuspendXCursor(screenInfo.screens[i]);
+ if (!quartzRootless)
+ xf86SetRootClip(screenInfo.screens[i], FALSE);
+ }
+ }
+ }
+ quartzServerVisible = FALSE;
+ QuartzMessageMainThread(kQuartzServerHidden, NULL, 0);
+}
+
+
+/*
+ * QuartzSetRootClip
+ * Enable or disable rendering to the X screen.
+ */
+static void QuartzSetRootClip(
+ BOOL enable)
+{
+ int i;
+
+ if (!quartzServerVisible)
+ return;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (screenInfo.screens[i]) {
+ xf86SetRootClip(screenInfo.screens[i], enable);
+ }
+ }
+}
+
+
+/*
+ * QuartzProcessEvent
+ * Process Quartz specific events.
+ */
+void QuartzProcessEvent(
+ xEvent *xe)
+{
+ switch (xe->u.u.type) {
+
+ case kXDarwinShow:
+ QuartzShow(xe->u.keyButtonPointer.rootX,
+ xe->u.keyButtonPointer.rootY);
+ break;
+
+ case kXDarwinHide:
+ QuartzHide();
+ break;
+
+ case kXDarwinSetRootClip:
+ QuartzSetRootClip((BOOL)xe->u.clientMessage.u.l.longs0);
+ break;
+
+ case kXDarwinQuit:
+ GiveUp(0);
+ break;
+
+ case kXDarwinReadPasteboard:
+ QuartzReadPasteboard();
+ break;
+
+ case kXDarwinWritePasteboard:
+ QuartzWritePasteboard();
+ break;
+
+ default:
+ ErrorF("Unknown application defined event.\n");
+ }
+}
+
+
+/*
+ * QuartzGiveUp
+ * Cleanup before X server shutdown
+ * Release the screen and restore the Aqua cursor.
+ */
+void QuartzGiveUp(void)
+{
+#if 0
+// Trying to switch cursors when quitting causes deadlock
+ int i;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (screenInfo.screens[i]) {
+ QuartzSuspendXCursor(screenInfo.screens[i]);
+ }
+ }
+#endif
+
+ if (!quartzRootless)
+ QuartzFSRelease();
+}
diff --git a/hw/darwin/quartz/quartz.h b/hw/darwin/quartz/quartz.h
new file mode 100644
index 000000000..cd4f732f3
--- /dev/null
+++ b/hw/darwin/quartz/quartz.h
@@ -0,0 +1,50 @@
+/*
+ * quartz.h
+ *
+ * External interface of the Quartz modes seen by the generic, mode
+ * independent parts of the Darwin X server.
+ */
+/*
+ * Copyright (c) 2001-2002 Greg Parker and Torrey T. Lyons.
+ * 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.4 2002/11/20 23:51:58 torrey Exp $ */
+
+#ifndef _QUARTZ_H
+#define _QUARTZ_H
+
+#include "screenint.h"
+#include "Xproto.h"
+#include "quartzPasteboard.h"
+
+int QuartzProcessArgument(int argc, char *argv[], int i);
+void QuartzInitOutput(int argc, char **argv);
+void QuartzInitInput(int argc, char **argv);
+Bool QuartzAddScreen(int index, ScreenPtr pScreen);
+Bool QuartzSetupScreen(int index, ScreenPtr pScreen);
+void QuartzGiveUp(void);
+void QuartzProcessEvent(xEvent *xe);
+
+#endif
diff --git a/hw/darwin/quartz/quartzAudio.c b/hw/darwin/quartz/quartzAudio.c
new file mode 100644
index 000000000..2dfb313b7
--- /dev/null
+++ b/hw/darwin/quartz/quartzAudio.c
@@ -0,0 +1,342 @@
+//
+// QuartzAudio.m
+//
+// X Window bell support using CoreAudio or AppKit.
+// Greg Parker gparker@cs.stanford.edu 19 Feb 2001
+//
+// Info about sine wave sound playback:
+// CoreAudio code derived from macosx-dev posting by Tim Wood
+// http://www.omnigroup.com/mailman/archive/macosx-dev/2000-May/002004.html
+// Smoothing transitions between sounds
+// http://www.wam.umd.edu/~mphoenix/dss/dss.html
+//
+/*
+ * Copyright (c) 2001 Greg Parker. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "quartzAudio.h"
+
+#include <CoreAudio/CoreAudio.h>
+#include <pthread.h>
+
+#include "inputstr.h"
+#include "extensions/XI.h"
+
+void NSBeep();
+
+typedef struct QuartzAudioRec {
+ double frequency;
+ double amplitude;
+
+ UInt32 curFrame;
+ UInt32 remainingFrames;
+ UInt32 totalFrames;
+ UInt32 bytesPerFrame;
+ double sampleRate;
+ UInt32 fadeLength;
+
+ UInt32 bufferByteCount;
+ Boolean playing;
+ pthread_mutex_t lock;
+
+ // used to fade out interrupted sound and avoid 'pop'
+ double prevFrequency;
+ double prevAmplitude;
+ UInt32 prevFrame;
+} QuartzAudioRec;
+
+static AudioDeviceID quartzAudioDevice = kAudioDeviceUnknown;
+static QuartzAudioRec data;
+
+
+/*
+ * QuartzAudioEnvelope
+ * Fade sound in and out to avoid pop.
+ * Sounds with shorter duration will never reach full amplitude. Deal.
+ */
+static double QuartzAudioEnvelope(
+ UInt32 curFrame,
+ UInt32 totalFrames,
+ UInt32 fadeLength )
+{
+ double fadeFrames = min(fadeLength, totalFrames / 2);
+ if (fadeFrames < 1) return 0;
+
+ if (curFrame < fadeFrames) {
+ return curFrame / fadeFrames;
+ } else if (curFrame > totalFrames - fadeFrames) {
+ return (totalFrames-curFrame) / fadeFrames;
+ } else {
+ return 1.0;
+ }
+}
+
+
+/*
+ * QuartzFillBuffer
+ * Fill this buffer with data and update the data position.
+ * FIXME: this is ugly
+ */
+static void QuartzFillBuffer(
+ AudioBuffer *audiobuffer,
+ QuartzAudioRec *data )
+{
+ float *buffer, *b;
+ unsigned int frame, frameCount;
+ unsigned int bufferFrameCount;
+ float multiplier, v;
+ int i;
+
+ buffer = (float *)audiobuffer->mData;
+ bufferFrameCount = audiobuffer->mDataByteSize / data->bytesPerFrame;
+
+ frameCount = min(bufferFrameCount, data->remainingFrames);
+
+ // Fade out previous sine wave, if any.
+ b = buffer;
+ if (data->prevFrame) {
+ multiplier = 2*M_PI*(data->prevFrequency/data->sampleRate);
+ for (frame = 0; frame < data->fadeLength; frame++) {
+ v = data->prevAmplitude *
+ QuartzAudioEnvelope(frame+data->fadeLength,
+ 2*data->fadeLength,
+ data->fadeLength) *
+ sin(multiplier * (data->prevFrame+frame));
+ for (i = 0; i < audiobuffer->mNumberChannels; i++) {
+ *b++ = v;
+ }
+ }
+ // no more prev fade
+ data->prevFrame = 0;
+
+ // adjust for space eaten by prev fade
+ buffer += audiobuffer->mNumberChannels*frame;
+ bufferFrameCount -= frame;
+ frameCount = min(bufferFrameCount, data->remainingFrames);
+ }
+
+ // Write a sine wave with the specified frequency and amplitude
+ multiplier = 2*M_PI*(data->frequency/data->sampleRate);
+ for (frame = 0; frame < frameCount; frame++) {
+ v = data->amplitude *
+ QuartzAudioEnvelope(data->curFrame+frame, data->totalFrames,
+ data->fadeLength) *
+ sin(multiplier * (data->curFrame+frame));
+ for (i = 0; i < audiobuffer->mNumberChannels; i++) {
+ *b++ = v;
+ }
+ }
+
+ // Zero out the rest of the buffer, if any
+ memset(b, 0, sizeof(float) * audiobuffer->mNumberChannels *
+ (bufferFrameCount-frame));
+
+ data->curFrame += frameCount;
+ data->remainingFrames -= frameCount;
+ if (data->remainingFrames == 0) {
+ data->playing = FALSE;
+ data->curFrame = 0;
+ }
+}
+
+
+/*
+ * QuartzAudioIOProc
+ * Callback function for audio playback.
+ * FIXME: use inOutputTime to correct for skipping
+ */
+static OSStatus
+QuartzAudioIOProc(
+ AudioDeviceID inDevice,
+ const AudioTimeStamp *inNow,
+ const AudioBufferList *inInputData,
+ const AudioTimeStamp *inInputTime,
+ AudioBufferList *outOutputData,
+ const AudioTimeStamp *inOutputTime,
+ void *inClientData )
+{
+ QuartzAudioRec *data = (QuartzAudioRec *)inClientData;
+ int i;
+ Boolean wasPlaying;
+
+ pthread_mutex_lock(&data->lock);
+ wasPlaying = data->playing;
+ for (i = 0; i < outOutputData->mNumberBuffers; i++) {
+ if (data->playing) {
+ QuartzFillBuffer(outOutputData->mBuffers+i, data);
+ }
+ else {
+ memset(outOutputData->mBuffers[i].mData, 0,
+ outOutputData->mBuffers[i].mDataByteSize);
+ }
+ }
+ if (wasPlaying && !data->playing) {
+ OSStatus err;
+ err = AudioDeviceStop(inDevice, QuartzAudioIOProc);
+ }
+ pthread_mutex_unlock(&data->lock);
+ return 0;
+}
+
+
+/*
+ * QuartzCoreAudioBell
+ * Play a tone using the CoreAudio API
+ */
+static void QuartzCoreAudioBell(
+ int volume, // volume is % of max
+ int pitch, // pitch is Hz
+ int duration ) // duration is milliseconds
+{
+ if (quartzAudioDevice == kAudioDeviceUnknown) return;
+
+ pthread_mutex_lock(&data.lock);
+
+ // fade previous sound, if any
+ data.prevFrequency = data.frequency;
+ data.prevAmplitude = data.amplitude;
+ data.prevFrame = data.curFrame;
+
+ // set new sound
+ data.frequency = pitch;
+ data.amplitude = volume / 100.0;
+ data.curFrame = 0;
+ data.totalFrames = (int)(data.sampleRate * duration / 1000.0);
+ data.remainingFrames = data.totalFrames;
+
+ if (! data.playing) {
+ OSStatus status;
+ status = AudioDeviceStart(quartzAudioDevice, QuartzAudioIOProc);
+ if (status) {
+ ErrorF("QuartzAudioBell: AudioDeviceStart returned %d\n", status);
+ } else {
+ data.playing = TRUE;
+ }
+ }
+ pthread_mutex_unlock(&data.lock);
+}
+
+
+/*
+ * QuartzBell
+ * Ring the bell
+ */
+void QuartzBell(
+ int volume, // volume in percent of max
+ DeviceIntPtr pDevice,
+ pointer ctrl,
+ int class )
+{
+ int pitch; // pitch in Hz
+ int duration; // duration in milliseconds
+
+ if (class == BellFeedbackClass) {
+ pitch = ((BellCtrl*)ctrl)->pitch;
+ duration = ((BellCtrl*)ctrl)->duration;
+ } else if (class == KbdFeedbackClass) {
+ pitch = ((KeybdCtrl*)ctrl)->bell_pitch;
+ duration = ((KeybdCtrl*)ctrl)->bell_duration;
+ } else {
+ ErrorF("QuartzBell: bad bell class %d\n", class);
+ return;
+ }
+
+ if (quartzUseSysBeep) {
+ if (volume)
+ NSBeep();
+ } else {
+ QuartzCoreAudioBell(volume, pitch, duration);
+ }
+}
+
+
+/*
+ * QuartzAudioInit
+ * Prepare to play the bell with the CoreAudio API
+ */
+void QuartzAudioInit(void)
+{
+ UInt32 propertySize;
+ OSStatus status;
+ AudioDeviceID outputDevice;
+ AudioStreamBasicDescription outputStreamDescription;
+ double sampleRate;
+
+ // Get the default output device
+ propertySize = sizeof(outputDevice);
+ status = AudioHardwareGetProperty(
+ kAudioHardwarePropertyDefaultOutputDevice,
+ &propertySize, &outputDevice);
+ if (status) {
+ ErrorF("QuartzAudioInit: AudioHardwareGetProperty returned %d\n",
+ status);
+ return;
+ }
+ if (outputDevice == kAudioDeviceUnknown) {
+ ErrorF("QuartzAudioInit: No audio output devices available.\n");
+ return;
+ }
+
+ // Get the basic device description
+ propertySize = sizeof(outputStreamDescription);
+ status = AudioDeviceGetProperty(outputDevice, 0, FALSE,
+ kAudioDevicePropertyStreamFormat,
+ &propertySize, &outputStreamDescription);
+ if (status) {
+ ErrorF("QuartzAudioInit: GetProperty(stream format) returned %d\n",
+ status);
+ return;
+ }
+ sampleRate = outputStreamDescription.mSampleRate;
+
+ // Fill in the playback data
+ data.frequency = 0;
+ data.amplitude = 0;
+ data.curFrame = 0;
+ data.remainingFrames = 0;
+ data.bytesPerFrame = outputStreamDescription.mBytesPerFrame;
+ data.sampleRate = sampleRate;
+ // data.bufferByteCount = bufferByteCount;
+ data.playing = FALSE;
+ data.prevAmplitude = 0;
+ data.prevFrame = 0;
+ data.prevFrequency = 0;
+ data.fadeLength = data.sampleRate / 200;
+ pthread_mutex_init(&data.lock, NULL); // fixme error check
+
+ // fixme assert fadeLength<framesPerBuffer
+
+ // Prepare for playback
+ status = AudioDeviceAddIOProc(outputDevice, QuartzAudioIOProc, &data);
+ if (status) {
+ ErrorF("QuartzAudioInit: AddIOProc returned %d\n", status);
+ return;
+ }
+
+ // success!
+ quartzAudioDevice = outputDevice;
+}
diff --git a/hw/darwin/quartz/quartzAudio.h b/hw/darwin/quartz/quartzAudio.h
new file mode 100644
index 000000000..1d213e36a
--- /dev/null
+++ b/hw/darwin/quartz/quartzAudio.h
@@ -0,0 +1,41 @@
+//
+// QuartzAudio.h
+//
+// X Window bell support using CoreAudio or AppKit.
+// Greg Parker gparker@cs.stanford.edu 19 Feb 2001
+/*
+ * Copyright (c) 2001 Greg Parker. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.h,v 1.1 2002/03/28 02:21:19 torrey Exp $ */
+
+#ifndef _QUARTZAUDIO_H
+#define _QUARTZAUDIO_H
+
+#include "input.h"
+
+void QuartzAudioInit(void);
+void QuartzBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
+
+#endif
diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m
new file mode 100644
index 000000000..d6d9bbe32
--- /dev/null
+++ b/hw/darwin/quartz/quartzCocoa.m
@@ -0,0 +1,198 @@
+/**************************************************************
+ *
+ * Quartz-specific support for the Darwin X Server
+ * that requires Cocoa and Objective-C.
+ *
+ * This file is separate from the parts of Quartz support
+ * that use X include files to avoid symbol collisions.
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
+ * 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.3 2003/01/19 06:52:54 torrey Exp $ */
+
+#include <Cocoa/Cocoa.h>
+
+#import "Preferences.h"
+#include "quartzCommon.h"
+#include "pseudoramiX.h"
+
+extern void FatalError(const char *, ...);
+extern char *display;
+extern int noPanoramiXExtension;
+
+
+/*
+ * QuartzReadPreferences
+ * Read the user preferences from the Cocoa front end.
+ */
+void QuartzReadPreferences(void)
+{
+ char *fileString;
+
+ darwinFakeButtons = [Preferences fakeButtons];
+ darwinFakeMouse2Mask = [Preferences button2Mask];
+ darwinFakeMouse3Mask = [Preferences button3Mask];
+ quartzMouseAccelChange = [Preferences mouseAccelChange];
+ quartzUseSysBeep = [Preferences systemBeep];
+
+ // quartzRootless has already been set
+ if (quartzRootless) {
+ // Use PseudoramiX instead of Xinerama
+ noPanoramiXExtension = TRUE;
+ noPseudoramiXExtension = ![Preferences xinerama];
+
+ quartzUseAGL = [Preferences useAGL];
+ } else {
+ noPanoramiXExtension = ![Preferences xinerama];
+ noPseudoramiXExtension = TRUE;
+
+ // Full screen can't use AGL for GLX
+ quartzUseAGL = FALSE;
+ }
+
+ if ([Preferences useKeymapFile]) {
+ fileString = (char *) [[Preferences keymapFile] lossyCString];
+ darwinKeymapFile = (char *) malloc(strlen(fileString)+1);
+ if (! darwinKeymapFile)
+ FatalError("malloc failed in QuartzReadPreferences()!\n");
+ strcpy(darwinKeymapFile, fileString);
+ }
+
+ display = (char *) malloc(8);
+ if (! display)
+ FatalError("malloc failed in QuartzReadPreferences()!\n");
+ snprintf(display, 8, "%i", [Preferences display]);
+
+ darwinDesiredDepth = [Preferences depth] - 1;
+}
+
+
+/*
+ * QuartzWriteCocoaPasteboard
+ * Write text to the Mac OS X pasteboard.
+ */
+void QuartzWriteCocoaPasteboard(
+ char *text)
+{
+ NSPasteboard *pasteboard;
+ NSArray *pasteboardTypes;
+ NSString *string;
+
+ if (! text) return;
+ pasteboard = [NSPasteboard generalPasteboard];
+ if (! pasteboard) return;
+ string = [NSString stringWithCString:text];
+ if (! string) return;
+ pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
+
+ // nil owner because we don't provide type translations
+ [pasteboard declareTypes:pasteboardTypes owner:nil];
+ [pasteboard setString:string forType:NSStringPboardType];
+}
+
+
+/*
+ * QuartzReadCocoaPasteboard
+ * Read text from the Mac OS X pasteboard and return it as a heap string.
+ * The caller must free the string.
+ */
+char *QuartzReadCocoaPasteboard(void)
+{
+ NSPasteboard *pasteboard;
+ NSArray *pasteboardTypes;
+ NSString *existingType;
+ char *text = NULL;
+
+ pasteboardTypes = [NSArray arrayWithObject:NSStringPboardType];
+ pasteboard = [NSPasteboard generalPasteboard];
+ if (! pasteboard) return NULL;
+
+ existingType = [pasteboard availableTypeFromArray:pasteboardTypes];
+ if (existingType) {
+ NSString *string = [pasteboard stringForType:existingType];
+ char *buffer;
+
+ if (! string) return NULL;
+ buffer = (char *) [string lossyCString];
+ text = (char *) malloc(strlen(buffer)+1);
+ if (text)
+ strcpy(text, buffer);
+ }
+
+ return text;
+}
+
+
+/*
+ * QuartzFSUseQDCursor
+ * Return whether the screen should use a QuickDraw cursor.
+ */
+int QuartzFSUseQDCursor(
+ int depth) // screen depth
+{
+ switch ([Preferences useQDCursor]) {
+ case qdCursor_Always:
+ return TRUE;
+ case qdCursor_Never:
+ return FALSE;
+ case qdCursor_Not8Bit:
+ if (depth > 8)
+ return TRUE;
+ else
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/*
+ * QuartzBlockHandler
+ * Clean out any autoreleased objects.
+ */
+void QuartzBlockHandler(
+ void *blockData,
+ void *pTimeout,
+ void *pReadmask)
+{
+ static NSAutoreleasePool *aPool = nil;
+
+ [aPool release];
+ aPool = [[NSAutoreleasePool alloc] init];
+}
+
+
+/*
+ * QuartzWakeupHandler
+ */
+void QuartzWakeupHandler(
+ void *blockData,
+ int result,
+ void *pReadmask)
+{
+ // nothing here
+}
diff --git a/hw/darwin/quartz/quartzCommon.h b/hw/darwin/quartz/quartzCommon.h
new file mode 100644
index 000000000..6c375bd04
--- /dev/null
+++ b/hw/darwin/quartz/quartzCommon.h
@@ -0,0 +1,98 @@
+/*
+ * quartzCommon.h
+ *
+ * Common definitions used internally by all Quartz modes
+ *
+ * This file should be included before any X11 or IOKit headers
+ * so that it can avoid symbol conflicts.
+ *
+ * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
+ * 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.8 2003/01/23 00:34:26 torrey Exp $ */
+
+#ifndef _QUARTZCOMMON_H
+#define _QUARTZCOMMON_H
+
+// QuickDraw in ApplicationServices has the following conflicts with
+// the basic X server headers. Use QD_<name> to use the QuickDraw
+// definition of any of these symbols, or the normal name for the
+// X11 definition.
+#define Cursor QD_Cursor
+#define WindowPtr QD_WindowPtr
+#define Picture QD_Picture
+#include <ApplicationServices/ApplicationServices.h>
+#undef Cursor
+#undef WindowPtr
+#undef Picture
+
+#include "quartzShared.h"
+
+// Quartz specific per screen storage structure
+typedef struct {
+ // List of CoreGraphics displays that this X11 screen covers.
+ // This is more than one CG display for video mirroring and
+ // rootless PseudoramiX mode.
+ // No CG display will be covered by more than one X11 screen.
+ int displayCount;
+ CGDirectDisplayID *displayIDs;
+} QuartzScreenRec, *QuartzScreenPtr;
+
+#define QUARTZ_PRIV(pScreen) \
+ ((QuartzScreenPtr)pScreen->devPrivates[quartzScreenIndex].ptr)
+
+// Data stored at startup for Cocoa front end
+extern int quartzEventWriteFD;
+extern int quartzStartClients;
+
+// User preferences used by Quartz modes
+extern int quartzRootless;
+extern int quartzUseSysBeep;
+extern int quartzUseAGL;
+
+// Other shared data
+extern int quartzServerVisible;
+extern int quartzServerQuitting;
+extern int quartzScreenIndex;
+extern int aquaMenuBarHeight;
+
+void QuartzReadPreferences(void);
+void QuartzMessageMainThread(unsigned msg, void *data, unsigned length);
+void QuartzFSCapture(void);
+void QuartzFSRelease(void);
+int QuartzFSUseQDCursor(int depth);
+void QuartzBlockHandler(void *blockData, void *pTimeout, void *pReadmask);
+void QuartzWakeupHandler(void *blockData, int result, void *pReadmask);
+
+// Messages that can be sent to the main thread.
+enum {
+ kQuartzServerHidden,
+ kQuartzServerStarted,
+ kQuartzServerDied,
+ kQuartzCursorUpdate,
+ kQuartzPostEvent
+};
+
+#endif /* _QUARTZCOMMON_H */
diff --git a/hw/darwin/quartz/quartzCursor.c b/hw/darwin/quartz/quartzCursor.c
new file mode 100644
index 000000000..8abce2318
--- /dev/null
+++ b/hw/darwin/quartz/quartzCursor.c
@@ -0,0 +1,653 @@
+/**************************************************************
+ *
+ * Support for using the Quartz Window Manager cursor
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001-2003 Torrey T. Lyons and Greg Parker.
+ * 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCursor.c,v 1.5 2003/01/23 00:34:26 torrey Exp $ */
+
+#include "quartzCommon.h"
+#include "quartzCursor.h"
+#include "darwin.h"
+
+#include <pthread.h>
+
+#include "mi.h"
+#include "scrnintstr.h"
+#include "cursorstr.h"
+#include "mipointrst.h"
+#include "globals.h"
+
+// Size of the QuickDraw cursor
+#define CURSORWIDTH 16
+#define CURSORHEIGHT 16
+
+typedef struct {
+ int qdCursorMode;
+ int qdCursorVisible;
+ int useQDCursor;
+ QueryBestSizeProcPtr QueryBestSize;
+ miPointerSpriteFuncPtr spriteFuncs;
+} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
+
+static int darwinCursorScreenIndex = -1;
+static unsigned long darwinCursorGeneration = 0;
+static CursorPtr quartzLatentCursor = NULL;
+static QD_Cursor gQDArrow; // QuickDraw arrow cursor
+
+// Cursor for the main thread to set (NULL = arrow cursor).
+static CCrsrHandle currentCursor = NULL;
+static pthread_mutex_t cursorMutex;
+static pthread_cond_t cursorCondition;
+
+#define CURSOR_PRIV(pScreen) \
+ ((QuartzCursorScreenPtr)pScreen->devPrivates[darwinCursorScreenIndex].ptr)
+
+#define HIDE_QD_CURSOR(pScreen, visible) \
+ if (visible) { \
+ int ix; \
+ for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
+ CGDisplayHideCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
+ } \
+ visible = FALSE; \
+ } ((void)0)
+
+#define SHOW_QD_CURSOR(pScreen, visible) \
+ { \
+ int ix; \
+ for (ix = 0; ix < QUARTZ_PRIV(pScreen)->displayCount; ix++) { \
+ CGDisplayShowCursor(QUARTZ_PRIV(pScreen)->displayIDs[ix]); \
+ } \
+ visible = TRUE; \
+ } ((void)0)
+
+#define CHANGE_QD_CURSOR(cursorH) \
+ if (!quartzServerQuitting) { \
+ /* Acquire lock and tell the main thread to change cursor */ \
+ pthread_mutex_lock(&cursorMutex); \
+ currentCursor = (CCrsrHandle) (cursorH); \
+ QuartzMessageMainThread(kQuartzCursorUpdate, NULL, 0); \
+ \
+ /* Wait for the main thread to change the cursor */ \
+ pthread_cond_wait(&cursorCondition, &cursorMutex); \
+ pthread_mutex_unlock(&cursorMutex); \
+ } ((void)0)
+
+
+/*
+ * MakeQDCursor helpers: CTAB_ENTER, interleave
+ */
+
+// Add a color entry to a ctab
+#define CTAB_ENTER(ctab, index, r, g, b) \
+ ctab->ctTable[index].value = index; \
+ ctab->ctTable[index].rgb.red = r; \
+ ctab->ctTable[index].rgb.green = g; \
+ ctab->ctTable[index].rgb.blue = b
+
+// Make an unsigned short by interleaving the bits of bytes c1 and c2.
+// High bit of c1 is first; low bit of c2 is last.
+// Interleave is a built-in INTERCAL operator.
+static unsigned short
+interleave(
+ unsigned char c1,
+ unsigned char c2 )
+{
+ return
+ ((c1 & 0x80) << 8) | ((c2 & 0x80) << 7) |
+ ((c1 & 0x40) << 7) | ((c2 & 0x40) << 6) |
+ ((c1 & 0x20) << 6) | ((c2 & 0x20) << 5) |
+ ((c1 & 0x10) << 5) | ((c2 & 0x10) << 4) |
+ ((c1 & 0x08) << 4) | ((c2 & 0x08) << 3) |
+ ((c1 & 0x04) << 3) | ((c2 & 0x04) << 2) |
+ ((c1 & 0x02) << 2) | ((c2 & 0x02) << 1) |
+ ((c1 & 0x01) << 1) | ((c2 & 0x01) << 0) ;
+}
+
+/*
+ * MakeQDCursor
+ * Make a QuickDraw color cursor from the given X11 cursor.
+ * Warning: This code is nasty. Color cursors were meant to be read
+ * from resources; constructing the structures programmatically is messy.
+ */
+/*
+ QuickDraw cursor representation:
+ Our color cursor is a 2 bit per pixel pixmap.
+ Each pixel's bits are (source<<1 | mask) from the original X cursor pixel.
+ The cursor's color table maps the colors like this:
+ (2-bit value | X result | colortable | Mac result)
+ 00 | transparent | white | transparent (white outside mask)
+ 01 | back color | back color | back color
+ 10 | undefined | black | invert background (just for fun)
+ 11 | fore color | fore color | fore color
+*/
+static CCrsrHandle
+MakeQDCursor(
+ CursorPtr pCursor )
+{
+ CCrsrHandle result;
+ CCrsrPtr curs;
+ int i, w, h;
+ unsigned short rowMask;
+ PixMap *pix;
+ ColorTable *ctab;
+ unsigned short *image;
+
+ result = (CCrsrHandle) NewHandleClear(sizeof(CCrsr));
+ if (!result) return NULL;
+ HLock((Handle)result);
+ curs = *result;
+
+ // Initialize CCrsr
+ curs->crsrType = 0x8001; // 0x8000 = b&w, 0x8001 = color
+ curs->crsrMap = (PixMapHandle) NewHandleClear(sizeof(PixMap));
+ if (!curs->crsrMap) goto pixAllocFailed;
+ HLock((Handle)curs->crsrMap);
+ pix = *curs->crsrMap;
+ curs->crsrData = NULL; // raw cursor image data (set below)
+ curs->crsrXData = NULL; // QD's processed data
+ curs->crsrXValid = 0; // zero means QD must re-process cursor data
+ curs->crsrXHandle = NULL; // reserved
+ memset(curs->crsr1Data, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w data
+ memset(curs->crsrMask, 0, CURSORWIDTH*CURSORHEIGHT/8); // b&w & color mask
+ curs->crsrHotSpot.h = min(CURSORWIDTH, pCursor->bits->xhot); // hot spot
+ curs->crsrHotSpot.v = min(CURSORHEIGHT, pCursor->bits->yhot); // hot spot
+ curs->crsrXTable = 0; // reserved
+ curs->crsrID = GetCTSeed(); // unique ID from Color Manager
+
+ // Set the b&w data and mask
+ w = min(pCursor->bits->width, CURSORWIDTH);
+ h = min(pCursor->bits->height, CURSORHEIGHT);
+ rowMask = ~((1 << (CURSORWIDTH - w)) - 1);
+ for (i = 0; i < h; i++) {
+ curs->crsr1Data[i] = rowMask &
+ ((pCursor->bits->source[i*4]<<8) | pCursor->bits->source[i*4+1]);
+ curs->crsrMask[i] = rowMask &
+ ((pCursor->bits->mask[i*4]<<8) | pCursor->bits->mask[i*4+1]);
+ }
+
+ // Set the color data and mask
+ // crsrMap: defines bit depth and size and colortable only
+ pix->rowBytes = (CURSORWIDTH * 2 / 8) | 0x8000; // last bit on means PixMap
+ SetRect(&pix->bounds, 0, 0, CURSORWIDTH, CURSORHEIGHT); // see TN 1020
+ pix->pixelSize = 2;
+ pix->cmpCount = 1;
+ pix->cmpSize = 2;
+ // pix->pmTable set below
+
+ // crsrData is the pixel data. crsrMap's baseAddr is not used.
+ curs->crsrData = NewHandleClear(CURSORWIDTH*CURSORHEIGHT * 2 / 8);
+ if (!curs->crsrData) goto imageAllocFailed;
+ HLock((Handle)curs->crsrData);
+ image = (unsigned short *) *curs->crsrData;
+ // Pixel data is just 1-bit data and mask interleaved (see above)
+ for (i = 0; i < h; i++) {
+ unsigned char s, m;
+ s = pCursor->bits->source[i*4] & (rowMask >> 8);
+ m = pCursor->bits->mask[i*4] & (rowMask >> 8);
+ image[2*i] = interleave(s, m);
+ s = pCursor->bits->source[i*4+1] & (rowMask & 0x00ff);
+ m = pCursor->bits->mask[i*4+1] & (rowMask & 0x00ff);
+ image[2*i+1] = interleave(s, m);
+ }
+
+ // Build the color table (entries described above)
+ // NewPixMap allocates a color table handle.
+ pix->pmTable = (CTabHandle) NewHandleClear(sizeof(ColorTable) + 3
+ * sizeof(ColorSpec));
+ if (!pix->pmTable) goto ctabAllocFailed;
+ HLock((Handle)pix->pmTable);
+ ctab = *pix->pmTable;
+ ctab->ctSeed = GetCTSeed();
+ ctab->ctFlags = 0;
+ ctab->ctSize = 3; // color count - 1
+ CTAB_ENTER(ctab, 0, 0xffff, 0xffff, 0xffff);
+ CTAB_ENTER(ctab, 1, pCursor->backRed, pCursor->backGreen,
+ pCursor->backBlue);
+ CTAB_ENTER(ctab, 2, 0x0000, 0x0000, 0x0000);
+ CTAB_ENTER(ctab, 3, pCursor->foreRed, pCursor->foreGreen,
+ pCursor->foreBlue);
+
+ HUnlock((Handle)pix->pmTable); // ctab
+ HUnlock((Handle)curs->crsrData); // image data
+ HUnlock((Handle)curs->crsrMap); // pix
+ HUnlock((Handle)result); // cursor
+
+ return result;
+
+ // "What we have here is a failure to allocate"
+ctabAllocFailed:
+ HUnlock((Handle)curs->crsrData);
+ DisposeHandle((Handle)curs->crsrData);
+imageAllocFailed:
+ HUnlock((Handle)curs->crsrMap);
+ DisposeHandle((Handle)curs->crsrMap);
+pixAllocFailed:
+ HUnlock((Handle)result);
+ DisposeHandle((Handle)result);
+ return NULL;
+}
+
+
+/*
+ * FreeQDCursor
+ * Destroy a QuickDraw color cursor created with MakeQDCursor().
+ * The cursor must not currently be on screen.
+ */
+static void FreeQDCursor(CCrsrHandle cursHandle)
+{
+ CCrsrPtr curs;
+ PixMap *pix;
+
+ HLock((Handle)cursHandle);
+ curs = *cursHandle;
+ HLock((Handle)curs->crsrMap);
+ pix = *curs->crsrMap;
+ DisposeHandle((Handle)pix->pmTable);
+ HUnlock((Handle)curs->crsrMap);
+ DisposeHandle((Handle)curs->crsrMap);
+ DisposeHandle((Handle)curs->crsrData);
+ HUnlock((Handle)cursHandle);
+ DisposeHandle((Handle)cursHandle);
+}
+
+
+/*
+===========================================================================
+
+ Pointer sprite functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzRealizeCursor
+ * Convert the X cursor representation to QuickDraw format if possible.
+ */
+Bool
+QuartzRealizeCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor )
+{
+ CCrsrHandle qdCursor;
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if(!pCursor || !pCursor->bits)
+ return FALSE;
+
+ // if the cursor is too big we use a software cursor
+ if ((pCursor->bits->height > CURSORHEIGHT) ||
+ (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
+ {
+ if (quartzRootless) {
+ // rootless can't use a software cursor
+ return TRUE;
+ } else {
+ return (*ScreenPriv->spriteFuncs->RealizeCursor)
+ (pScreen, pCursor);
+ }
+ }
+
+ // make new cursor image
+ qdCursor = MakeQDCursor(pCursor);
+ if (!qdCursor) return FALSE;
+
+ // save the result
+ pCursor->devPriv[pScreen->myNum] = (pointer) qdCursor;
+
+ return TRUE;
+}
+
+
+/*
+ * QuartzUnrealizeCursor
+ * Free the storage space associated with a realized cursor.
+ */
+Bool
+QuartzUnrealizeCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor )
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if ((pCursor->bits->height > CURSORHEIGHT) ||
+ (pCursor->bits->width > CURSORWIDTH) || !ScreenPriv->useQDCursor)
+ {
+ if (quartzRootless) {
+ return TRUE;
+ } else {
+ return (*ScreenPriv->spriteFuncs->UnrealizeCursor)
+ (pScreen, pCursor);
+ }
+ } else {
+ CCrsrHandle oldCursor = (CCrsrHandle) pCursor->devPriv[pScreen->myNum];
+
+ if (currentCursor != oldCursor) {
+ // This should only fail when quitting, in which case we just leak.
+ FreeQDCursor(oldCursor);
+ }
+ pCursor->devPriv[pScreen->myNum] = NULL;
+ return TRUE;
+ }
+}
+
+
+/*
+ * QuartzSetCursor
+ * Set the cursor sprite and position.
+ * Use QuickDraw cursor if possible.
+ */
+static void
+QuartzSetCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCursor,
+ int x,
+ int y)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ quartzLatentCursor = pCursor;
+
+ // Don't touch Mac OS cursor if X is hidden!
+ if (!quartzServerVisible)
+ return;
+
+ if (!pCursor) {
+ // Remove the cursor completely.
+ HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+ if (! ScreenPriv->qdCursorMode)
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
+ }
+ else if ((pCursor->bits->height <= CURSORHEIGHT) &&
+ (pCursor->bits->width <= CURSORWIDTH) && ScreenPriv->useQDCursor)
+ {
+ // Cursor is small enough to use QuickDraw directly.
+ if (! ScreenPriv->qdCursorMode) // remove the X cursor
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y);
+ ScreenPriv->qdCursorMode = TRUE;
+
+ CHANGE_QD_CURSOR(pCursor->devPriv[pScreen->myNum]);
+ SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+ }
+ else if (quartzRootless) {
+ // Rootless can't use a software cursor, so we just use Mac OS arrow.
+ CHANGE_QD_CURSOR(NULL);
+ SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+ }
+ else {
+ // Cursor is too big for QuickDraw. Use X software cursor.
+ HIDE_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+ ScreenPriv->qdCursorMode = FALSE;
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y);
+ }
+}
+
+
+/*
+ * QuartzReallySetCursor
+ * Set the QuickDraw cursor. Called from the main thread since changing the
+ * cursor with QuickDraw is not thread safe on dual processor machines.
+ */
+void
+QuartzReallySetCursor()
+{
+ pthread_mutex_lock(&cursorMutex);
+
+ if (currentCursor) {
+ SetCCursor(currentCursor);
+ } else {
+ SetCursor(&gQDArrow);
+ }
+
+ pthread_cond_signal(&cursorCondition);
+ pthread_mutex_unlock(&cursorMutex);
+}
+
+
+/*
+ * QuartzMoveCursor
+ * Move the cursor. This is a noop for QuickDraw.
+ */
+static void
+QuartzMoveCursor(
+ ScreenPtr pScreen,
+ int x,
+ int y)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ // only the X cursor needs to be explicitly moved
+ if (!ScreenPriv->qdCursorMode)
+ (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
+}
+
+
+static miPointerSpriteFuncRec quartzSpriteFuncsRec = {
+ QuartzRealizeCursor,
+ QuartzUnrealizeCursor,
+ QuartzSetCursor,
+ QuartzMoveCursor
+};
+
+
+/*
+===========================================================================
+
+ Pointer screen functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzCursorOffScreen
+ */
+static Bool QuartzCursorOffScreen(ScreenPtr *pScreen, int *x, int *y)
+{
+ return FALSE;
+}
+
+
+/*
+ * QuartzCrossScreen
+ */
+static void QuartzCrossScreen(ScreenPtr pScreen, Bool entering)
+{
+ return;
+}
+
+
+/*
+ * QuartzWarpCursor
+ * Change the cursor position without generating an event or motion history.
+ * The input coordinates (x,y) are in pScreen-local X11 coordinates.
+ *
+ */
+static void
+QuartzWarpCursor(
+ ScreenPtr pScreen,
+ int x,
+ int y)
+{
+ static int neverMoved = TRUE;
+
+ if (neverMoved) {
+ // Don't move the cursor the first time. This is the jump-to-center
+ // initialization, and it's annoying because we may still be in MacOS.
+ neverMoved = FALSE;
+ return;
+ }
+
+ if (quartzServerVisible) {
+ CGDisplayErr cgErr;
+ CGPoint cgPoint;
+ // Only need to do this for one display. Any display will do.
+ CGDirectDisplayID cgID = QUARTZ_PRIV(pScreen)->displayIDs[0];
+ CGRect cgRect = CGDisplayBounds(cgID);
+
+ // Convert (x,y) to CoreGraphics screen-local CG coordinates.
+ // This is necessary because the X11 screen and CG screen may not
+ // coincide. (e.g. X11 screen may be moved to dodge the menu bar)
+
+ // Make point in X11 global coordinates
+ cgPoint = CGPointMake(x + dixScreenOrigins[pScreen->myNum].x,
+ y + dixScreenOrigins[pScreen->myNum].y);
+ // Shift to CoreGraphics global screen coordinates
+ cgPoint.x += darwinMainScreenX;
+ cgPoint.y += darwinMainScreenY;
+ // Shift to CoreGraphics screen-local coordinates
+ cgPoint.x -= cgRect.origin.x;
+ cgPoint.y -= cgRect.origin.y;
+
+ cgErr = CGDisplayMoveCursorToPoint(cgID, cgPoint);
+ if (cgErr != CGDisplayNoErr) {
+ ErrorF("Could not set cursor position with error code 0x%x.\n",
+ cgErr);
+ }
+ }
+
+ miPointerWarpCursor(pScreen, x, y);
+ miPointerUpdate();
+}
+
+
+static miPointerScreenFuncRec quartzScreenFuncsRec = {
+ QuartzCursorOffScreen,
+ QuartzCrossScreen,
+ QuartzWarpCursor,
+ DarwinEQPointerPost,
+ DarwinEQSwitchScreen
+};
+
+
+/*
+===========================================================================
+
+ Other screen functions
+
+===========================================================================
+*/
+
+/*
+ * QuartzCursorQueryBestSize
+ * Handle queries for best cursor size
+ */
+static void
+QuartzCursorQueryBestSize(
+ int class,
+ unsigned short *width,
+ unsigned short *height,
+ ScreenPtr pScreen)
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ if (class == CursorShape) {
+ *width = CURSORWIDTH;
+ *height = CURSORHEIGHT;
+ } else {
+ (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
+ }
+}
+
+
+/*
+ * QuartzInitCursor
+ * Initialize cursor support
+ */
+Bool
+QuartzInitCursor(
+ ScreenPtr pScreen )
+{
+ QuartzCursorScreenPtr ScreenPriv;
+ miPointerScreenPtr PointPriv;
+ DarwinFramebufferPtr dfb = SCREEN_PRIV(pScreen);
+
+ // initialize software cursor handling (always needed as backup)
+ if (!miDCInitialize(pScreen, &quartzScreenFuncsRec)) {
+ return FALSE;
+ }
+
+ // allocate private storage for this screen's QuickDraw cursor info
+ if (darwinCursorGeneration != serverGeneration) {
+ if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ darwinCursorGeneration = serverGeneration;
+ }
+
+ ScreenPriv = xcalloc( 1, sizeof(QuartzCursorScreenRec) );
+ if (!ScreenPriv) return FALSE;
+
+ CURSOR_PRIV(pScreen) = ScreenPriv;
+
+ // override some screen procedures
+ ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
+ pScreen->QueryBestSize = QuartzCursorQueryBestSize;
+
+ // initialize QuickDraw cursor handling
+ GetQDGlobalsArrow(&gQDArrow);
+ PointPriv = (miPointerScreenPtr)
+ pScreen->devPrivates[miPointerScreenIndex].ptr;
+
+ ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
+ PointPriv->spriteFuncs = &quartzSpriteFuncsRec;
+
+ if (!quartzRootless)
+ ScreenPriv->useQDCursor = QuartzFSUseQDCursor(dfb->colorBitsPerPixel);
+ else
+ ScreenPriv->useQDCursor = TRUE;
+ ScreenPriv->qdCursorMode = TRUE;
+ ScreenPriv->qdCursorVisible = TRUE;
+
+ // initialize cursor mutex lock
+ pthread_mutex_init(&cursorMutex, NULL);
+
+ // initialize condition for waiting
+ pthread_cond_init(&cursorCondition, NULL);
+
+ return TRUE;
+}
+
+
+// X server is hiding. Restore the Aqua cursor.
+void QuartzSuspendXCursor(
+ ScreenPtr pScreen )
+{
+ QuartzCursorScreenPtr ScreenPriv = CURSOR_PRIV(pScreen);
+
+ CHANGE_QD_CURSOR(NULL);
+ SHOW_QD_CURSOR(pScreen, ScreenPriv->qdCursorVisible);
+}
+
+
+// X server is showing. Restore the X cursor.
+void QuartzResumeXCursor(
+ ScreenPtr pScreen,
+ int x,
+ int y )
+{
+ QuartzSetCursor(pScreen, quartzLatentCursor, x, y);
+}
diff --git a/hw/darwin/quartz/quartzCursor.h b/hw/darwin/quartz/quartzCursor.h
new file mode 100644
index 000000000..9710d4be2
--- /dev/null
+++ b/hw/darwin/quartz/quartzCursor.h
@@ -0,0 +1,43 @@
+/*
+ * quartzCursor.h
+ *
+ * External interface for Quartz hardware cursor
+ */
+/*
+ * Copyright (c) 2001 Torrey T. Lyons and Greg Parker.
+ * 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCursor.h,v 1.1 2002/03/28 02:21:19 torrey Exp $ */
+
+#ifndef QUARTZCURSOR_H
+#define QUARTZCURSOR_H
+
+#include "screenint.h"
+
+Bool QuartzInitCursor(ScreenPtr pScreen);
+void QuartzSuspendXCursor(ScreenPtr pScreen);
+void QuartzResumeXCursor(ScreenPtr pScreen, int x, int y);
+
+#endif
diff --git a/hw/darwin/quartz/quartzPasteboard.c b/hw/darwin/quartz/quartzPasteboard.c
new file mode 100644
index 000000000..658832aa1
--- /dev/null
+++ b/hw/darwin/quartz/quartzPasteboard.c
@@ -0,0 +1,150 @@
+/**************************************************************
+ * quartzPasteboard.c
+ *
+ * Aqua pasteboard <-> X cut buffer
+ * Greg Parker gparker@cs.stanford.edu March 8, 2001
+ **************************************************************/
+/*
+ * Copyright (c) 2001 Greg Parker. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.c,v 1.1 2002/03/28 02:21:19 torrey Exp $ */
+
+#include "quartzPasteboard.h"
+
+#include "Xatom.h"
+#include "windowstr.h"
+#include "propertyst.h"
+#include "scrnintstr.h"
+#include "selection.h"
+#include "globals.h"
+
+extern Selection *CurrentSelections;
+extern int NumCurrentSelections;
+
+
+// Helper function to read the X11 cut buffer
+// FIXME: What about multiple screens? Currently, this reads the first
+// CUT_BUFFER0 from the first screen where the buffer content is a string.
+// Returns a string on the heap that the caller must free.
+// Returns NULL if there is no cut text or there is not enough memory.
+static char * QuartzReadCutBuffer(void)
+{
+ int i;
+ char *text = NULL;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ PropertyPtr pProp;
+
+ pProp = wUserProps (WindowTable[pScreen->myNum]);
+ while (pProp && pProp->propertyName != XA_CUT_BUFFER0) {
+ pProp = pProp->next;
+ }
+ if (! pProp) continue;
+ if (pProp->type != XA_STRING) continue;
+ if (pProp->format != 8) continue;
+
+ text = xalloc(1 + pProp->size);
+ if (! text) continue;
+ memcpy(text, pProp->data, pProp->size);
+ text[pProp->size] = '\0';
+ return text;
+ }
+
+ // didn't find any text
+ return NULL;
+}
+
+// Write X cut buffer to Mac OS X pasteboard
+// Called by ProcessInputEvents() in response to request from X server thread.
+void QuartzWritePasteboard(void)
+{
+ char *text;
+ text = QuartzReadCutBuffer();
+ if (text) {
+ QuartzWriteCocoaPasteboard(text);
+ free(text);
+ }
+}
+
+#define strequal(a, b) (0 == strcmp((a), (b)))
+
+// Read Mac OS X pasteboard into X cut buffer
+// Called by ProcessInputEvents() in response to request from X server thread.
+void QuartzReadPasteboard(void)
+{
+ char *oldText = QuartzReadCutBuffer();
+ char *text = QuartzReadCocoaPasteboard();
+
+ // Compare text with current cut buffer contents.
+ // Change the buffer if both exist and are different
+ // OR if there is new text but no old text.
+ // Otherwise, don't clear the selection unnecessarily.
+
+ if ((text && oldText && !strequal(text, oldText)) ||
+ (text && !oldText)) {
+ int scrn, sel;
+
+ for (scrn = 0; scrn < screenInfo.numScreens; scrn++) {
+ ScreenPtr pScreen = screenInfo.screens[scrn];
+ // Set the cut buffers on each screen
+ // fixme really on each screen?
+ ChangeWindowProperty(WindowTable[pScreen->myNum], XA_CUT_BUFFER0,
+ XA_STRING, 8, PropModeReplace,
+ strlen(text), (pointer)text, TRUE);
+ }
+
+ // Undo any current X selection (similar to code in dispatch.c)
+ // FIXME: what about secondary selection?
+ // FIXME: only touch first XA_PRIMARY selection?
+ sel = 0;
+ while ((sel < NumCurrentSelections) &&
+ CurrentSelections[sel].selection != XA_PRIMARY)
+ sel++;
+ if (sel < NumCurrentSelections) {
+ // Notify client if necessary
+ if (CurrentSelections[sel].client) {
+ xEvent event;
+
+ event.u.u.type = SelectionClear;
+ event.u.selectionClear.time = GetTimeInMillis();
+ event.u.selectionClear.window = CurrentSelections[sel].window;
+ event.u.selectionClear.atom = CurrentSelections[sel].selection;
+ TryClientEvents(CurrentSelections[sel].client, &event, 1,
+ NoEventMask, NoEventMask /*CantBeFiltered*/,
+ NullGrab);
+ }
+
+ // Erase it
+ // FIXME: need to erase .selection too? dispatch.c doesn't
+ CurrentSelections[sel].pWin = NullWindow;
+ CurrentSelections[sel].window = None;
+ CurrentSelections[sel].client = NullClient;
+ }
+ }
+
+ if (text) free(text);
+ if (oldText) free(oldText);
+}
diff --git a/hw/darwin/quartz/quartzPasteboard.h b/hw/darwin/quartz/quartzPasteboard.h
new file mode 100644
index 000000000..fef375493
--- /dev/null
+++ b/hw/darwin/quartz/quartzPasteboard.h
@@ -0,0 +1,45 @@
+/*
+ QuartzPasteboard.h
+
+ Mac OS X pasteboard <-> X cut buffer
+ Greg Parker gparker@cs.stanford.edu March 8, 2001
+*/
+/*
+ * Copyright (c) 2001 Greg Parker. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzPasteboard.h,v 1.1 2002/03/28 02:21:19 torrey Exp $ */
+
+#ifndef _QUARTZPASTEBOARD_H
+#define _QUARTZPASTEBOARD_H
+
+// Aqua->X
+void QuartzReadPasteboard();
+char * QuartzReadCocoaPasteboard(void); // caller must free string
+
+// X->Aqua
+void QuartzWritePasteboard();
+void QuartzWriteCocoaPasteboard(char *text);
+
+#endif /* _QUARTZPASTEBOARD_H */ \ No newline at end of file
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
new file mode 100644
index 000000000..dfa7b8166
--- /dev/null
+++ b/hw/darwin/quartz/quartzStartup.c
@@ -0,0 +1,233 @@
+/**************************************************************
+ *
+ * Startup code for the Quartz Darwin X Server
+ *
+ **************************************************************/
+/*
+ * Copyright (c) 2001-2003 Torrey T. Lyons. 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 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 ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * Except as contained in this notice, the name(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c,v 1.3 2003/01/19 06:35:13 torrey Exp $ */
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include "quartzCommon.h"
+#include "darwin.h"
+#include "opaque.h"
+#include "micmap.h"
+
+int NSApplicationMain(int argc, char *argv[]);
+
+char **envpGlobal; // argcGlobal and argvGlobal
+ // are from dix/globals.c
+
+// GLX bundle function pointers
+typedef void (*GlxExtensionInitPtr)(void);
+static GlxExtensionInitPtr GlxExtensionInit = NULL;
+
+typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *);
+static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL;
+
+
+/*
+ * DarwinHandleGUI
+ * This function is called first from main(). The first time
+ * it is called we start the Mac OS X front end. The front end
+ * will call main() again from another thread to run the X
+ * server. On the second call this function loads the user
+ * preferences set by the Mac OS X front end.
+ */
+void DarwinHandleGUI(
+ int argc,
+ char *argv[],
+ char *envp[] )
+{
+ static Bool been_here = FALSE;
+ int main_exit, i;
+ int fd[2];
+
+ if (been_here) {
+ QuartzReadPreferences();
+ return;
+ }
+ been_here = TRUE;
+
+ // Make a pipe to pass events
+ assert( pipe(fd) == 0 );
+ darwinEventFD = fd[0];
+ quartzEventWriteFD = fd[1];
+ fcntl(darwinEventFD, F_SETFL, O_NONBLOCK);
+
+ // Store command line arguments to pass back to main()
+ argcGlobal = argc;
+ argvGlobal = argv;
+ envpGlobal = envp;
+
+ // Determine if we need to start X clients
+ // and what display mode to use
+ quartzStartClients = 1;
+ for (i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "-nostartx")) {
+ quartzStartClients = 0;
+ } else if (!strcmp( argv[i], "-fullscreen")) {
+ quartzRootless = 0;
+ } else if (!strcmp( argv[i], "-rootless")) {
+ quartzRootless = 1;
+ }
+ }
+
+ quartz = TRUE;
+ main_exit = NSApplicationMain(argc, argv);
+ exit(main_exit);
+}
+
+
+/*
+ * LoadGlxBundle
+ * The Quartz mode X server needs to dynamically load the appropriate
+ * bundle before initializing GLX.
+ */
+static void LoadGlxBundle(void)
+{
+ CFBundleRef mainBundle;
+ CFStringRef bundleName;
+ CFURLRef bundleURL;
+ CFBundleRef glxBundle;
+
+ // Get the main bundle for the application
+ mainBundle = CFBundleGetMainBundle();
+
+ // Choose the bundle to load
+ ErrorF("Loading GLX bundle ");
+ if (quartzUseAGL) {
+ bundleName = CFSTR("glxAGL.bundle");
+ ErrorF("glxAGL.bundle (using Apple's OpenGL)\n");
+ } else {
+ bundleName = CFSTR("glxMesa.bundle");
+ ErrorF("glxMesa.bundle (using Mesa)\n");
+ }
+
+ // Look for the appropriate GLX bundle in the main bundle by name
+ bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
+ NULL, NULL);
+ if (!bundleURL) {
+ FatalError("Could not find GLX bundle.");
+ }
+
+ // Make a bundle instance using the URLRef
+ glxBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
+
+ if (!CFBundleLoadExecutable(glxBundle)) {
+ FatalError("Could not load GLX bundle.");
+ }
+
+ // Find the GLX init functions
+ GlxExtensionInit = (void *) CFBundleGetFunctionPointerForName(
+ glxBundle, CFSTR("GlxExtensionInit"));
+
+ GlxWrapInitVisuals = (void *) CFBundleGetFunctionPointerForName(
+ glxBundle, CFSTR("GlxWrapInitVisuals"));
+
+ if (!GlxExtensionInit || !GlxWrapInitVisuals) {
+ FatalError("Could not initialize GLX bundle.");
+ }
+
+ // Release the CF objects
+ CFRelease(mainBundle);
+ CFRelease(bundleURL);
+}
+
+
+/*
+ * DarwinGlxExtensionInit
+ * Initialize the GLX extension.
+ */
+void DarwinGlxExtensionInit(void)
+{
+ if (!GlxExtensionInit)
+ LoadGlxBundle();
+
+ GlxExtensionInit();
+}
+
+
+/*
+ * DarwinGlxWrapInitVisuals
+ */
+void DarwinGlxWrapInitVisuals(
+ miInitVisualsProcPtr *procPtr)
+{
+ if (!GlxWrapInitVisuals)
+ LoadGlxBundle();
+
+ GlxWrapInitVisuals(procPtr);
+}
+
+
+int QuartzProcessArgument( int argc, char *argv[], int i )
+{
+ // fullscreen: CoreGraphics full-screen mode
+ // rootless: Cocoa rootless mode
+ // quartz: Default, either fullscreen or rootless
+
+ if ( !strcmp( argv[i], "-fullscreen" ) ) {
+ ErrorF( "Running full screen in parallel with Mac OS X Quartz window server.\n" );
+#ifdef QUARTZ_SAFETY_DELAY
+ ErrorF( "Quitting in %d seconds if no controller is found.\n",
+ QUARTZ_SAFETY_DELAY );
+#endif
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-rootless" ) ) {
+ ErrorF( "Running rootless inside Mac OS X window server.\n" );
+#ifdef QUARTZ_SAFETY_DELAY
+ ErrorF( "Quitting in %d seconds if no controller is found.\n",
+ QUARTZ_SAFETY_DELAY );
+#endif
+ return 1;
+ }
+
+ if ( !strcmp( argv[i], "-quartz" ) ) {
+ ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
+#ifdef QUARTZ_SAFETY_DELAY
+ ErrorF( "Quitting in %d seconds if no controller is found.\n",
+ QUARTZ_SAFETY_DELAY );
+#endif
+ return 1;
+ }
+
+ // The Mac OS X front end uses this argument, which we just ignore here.
+ if ( !strcmp( argv[i], "-nostartx" ) ) {
+ return 1;
+ }
+
+ // This command line arg is passed when launched from the Aqua GUI.
+ if ( !strncmp( argv[i], "-psn_", 5 ) ) {
+ return 1;
+ }
+
+ return 0;
+} \ No newline at end of file
diff --git a/hw/darwin/utils/README.txt b/hw/darwin/utils/README.txt
new file mode 100644
index 000000000..94d61b1f0
--- /dev/null
+++ b/hw/darwin/utils/README.txt
@@ -0,0 +1,111 @@
+dumpkeymap - Diagnostic dump and detailed description of .keymapping files
+Version 4
+
+Copyright (C)1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
+Eric Sunshine, 1 December 2000
+
+OVERVIEW
+========
+This package contains the diagnostic utility dumpkeymap, as well as highly
+detailed documentation describing the internal layout of the Apple/NeXT
+.keymapping file.
+
+The dumpkeymap utility displays detailed information about each .keymapping
+file mentioned on the command-line. On Apple and NeXT platforms, if no
+.keymapping files are mentioned on the command-line, then it will instead
+dissect the key mapping currently in use by the WindowServer and AppKit.
+
+Documentation includes a thorough and detailed description of the internal
+layout of the .keymapping file, as well as an explanation of how to interpret
+the output of dumpkeymap.
+
+The complete set of documentation is available for perusal via dumpkeymap's
+manual page (dumpkeymap.1), as well as via the command-line options described
+below.
+
+ --help
+ Usage summary.
+ --help-keymapping
+ Detailed discussion of the internal format of a .keymapping file.
+ --help-output
+ Explanation of dumpkeymap's output.
+ --help-files
+ List of key mapping-related files and directories.
+ --help-diagnostics
+ Explanation of diagnostic messages.
+
+Once the manual page is been installed, documentation can also be accessed
+with the Unix `man' command:
+
+ % man dumpkeymap
+
+
+COMPILATION
+===========
+MacOS/X, Darwin
+
+ cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit
+
+MacOS/X DP4 (Developer Preview 4)
+
+ cc -Wall -o dumpkeymap dumpkeymap.c -FKernel -framework IOKit
+
+MacOS/X Server, OpenStep, NextStep
+
+ cc -Wall -o dumpkeymap dumpkeymap.c
+
+By default, dumpkeymap is configured to interface with the HID driver (Apple)
+or event-status driver (NeXT), thus allowing it to dump the key mapping which
+is currently in use by the WindowServer and AppKit. However, these facilities
+are specific to Apple/NeXT. In order to build dumpkeymap for non-Apple/NeXT
+platforms, you must define the DUMPKEYMAP_FILE_ONLY flag when compiling the
+program. This flag inhibits use of the HID and event-status drivers and
+configures dumpkeymap to work strictly with raw key mapping files.
+
+For example, to compile for Linux:
+
+ gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c
+
+
+INSTALLATION
+============
+Install the dumpkeymap executable image in a location mentioned in the PATH
+environment variable. Typicall locations for executable files are:
+
+ /usr/local/bin
+ $(HOME)/bin
+
+Install the manual page, dumpkeymap.1, in the `man1' subdirectory one of the
+standard manual page locations or in any other location mentioned by the
+MANPATH environment variable.
+
+Typical locations for manual pages on most Unix platforms are:
+
+ /usr/local/man/man1
+
+Typical locations for manual pages on MacOS/X, Darwin, and MacOS/X Server are:
+
+ /usr/local/man/man1
+ /Local/Documentation/ManPages/man1
+ /Network/Documentation/ManPages/man1
+
+Typical locations for manual pages on OpenStep and NextStep are:
+
+ /usr/local/man/man1
+ /LocalLibrary/Documentation/ManPages/man1
+ /LocalDeveloper/Documentation/ManPages/man1
+
+
+CONCLUSION
+==========
+This program and its accompanying documentation were written by Eric Sunshine
+and are copyright (C)1999,2000 by Eric Sunshine <sunshine@sunshineco.com>.
+
+The implementation of dumpkeymap is based upon information gathered on
+September 3, 1997 by Eric Sunshine <sunshine@sunshineco.com> and Paul S.
+McCarthy <zarnuk@zarnuk.com> during an effort to reverse engineer the format
+of the NeXT .keymapping file.
+
+
+
+$XFree86: xc/programs/Xserver/hw/darwin/utils/README.txt,v 1.2 2000/12/05 21:18:34 dawes Exp $
diff --git a/hw/darwin/utils/dumpkeymap.c b/hw/darwin/utils/dumpkeymap.c
new file mode 100644
index 000000000..c1b6ea15b
--- /dev/null
+++ b/hw/darwin/utils/dumpkeymap.c
@@ -0,0 +1,1453 @@
+// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.3 2000/12/05 21:18:34 dawes Exp $
+//=============================================================================
+//
+// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.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.
+// 3. 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.
+//
+//=============================================================================
+//-----------------------------------------------------------------------------
+// dumpkeymap.c
+//
+// Prints a textual representation of each Apple/NeXT .keymapping file
+// mentioned on the command-line. If no files are mentioned and if the
+// local machine is an Apple or NeXT installation, then the key mapping
+// currently in use by the WindowServer and the AppKit is printed
+// instead.
+//
+// Invoke dumpkeymap with one of the options listed below in order to
+// view detailed documentation about .keymapping files and the use of
+// this program.
+//
+// --help: Usage summary.
+// --help-keymapping: Detailed discussion of the internal format of a
+// .keymapping file.
+// --help-output: Explanation of dumpkeymap's output.
+// --help-files: List of key mapping-related files and directories.
+// --help-diagnostics: Explanation of diagnostic messages.
+//
+// COMPILATION INSTRUCTIONS
+//
+// MacOS/X, Darwin
+// cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit
+//
+// MacOS/X DP4 (Developer Preview 4)
+// cc -Wall -o dumpkeymap dumpkeymap.c -FKernel -framework IOKit
+//
+// MacOS/X Server, OpenStep, NextStep
+// cc -Wall -o dumpkeymap dumpkeymap.c
+//
+// By default, dumpkeymap is configured to interface with the HID driver
+// (Apple) or event-status driver (NeXT), thus allowing it to dump the
+// key mapping which is currently in use by the WindowServer and AppKit.
+// However, these facilities are specific to Apple/NeXT. In order to
+// build dumpkeymap for non-Apple/NeXT platforms, you must define the
+// DUMPKEYMAP_FILE_ONLY flag when compiling the program. This flag
+// inhibits use of the HID and event-status drivers and configures
+// dumpkeymap to work strictly with raw key mapping files.
+//
+// For example, to compile for Linux:
+// gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c
+//
+// CONCLUSION
+//
+// This program and its accompanying documentation were written by Eric
+// Sunshine and are copyright (C)1999,2000 by Eric Sunshine
+// <sunshine@sunshineco.com>.
+//
+// The implementation of dumpkeymap is based upon information gathered
+// on September 3, 1997 by Eric Sunshine <sunshine@sunshineco.com> and
+// Paul S. McCarthy <zarnuk@zarnuk.com> during an effort to reverse
+// engineer the format of the NeXT .keymapping file.
+//
+// HISTORY
+//
+// v4 2000/12/01 Eric Sunshine <sunshine@sunshineco.com>
+// Updated manual page to work with `rman', the `man' to `HTML'
+// translator. Unfortunately, however, rman is missing important
+// roff features such as diversions, indentation, and tab stops,
+// and is also hideously buggy, so getting the manual to work with
+// rman required quite a few work-arounds.
+// The manual page has now been tested with nroff (plain text), troff
+// (PostScript, etc.), groff (PostScript), and rman (HTML, etc.)
+//
+// v3 2000/11/28 Eric Sunshine <sunshine@sunshineco.com>
+// Considerably expanded the documentation.
+// Augmented the existing description of .keymapping internals.
+// Added these new documentation topics:
+// - Output: Very important section describing how to interpret
+// the output of dumpkeymap.
+// - Files: Lists files and directories related to key mappings.
+// - Diagnostics: Explains diagnostic messages issued by
+// dumpkeymap.
+// Created a manual page (dumpkeymap.1) which contains the complete
+// set of documentation for key mapping files and dumpkeymap.
+// Added command-line options (--help, --help-keymapping,
+// --help-output, --help-files, --help-diagnostics) which allow
+// access to all key mapping documentation. Previously the
+// description of the internal layout of a .keymapping file was
+// only available as source code comments.
+// Added --version option.
+// Ported to non-Apple/NeXT platforms. Defining the pre-processor
+// flag DUMPKEYMAP_FILE_ONLY at compilation time inhibits use of
+// Apple/NeXT-specific API.
+// Added a README file.
+//
+// v2 2000/11/13 Eric Sunshine <sunshine@sunshineco.com>
+// Converted from C++ to plain-C.
+// Now parses and takes into account the "number-size" flag stored
+// with each key map. This flag indicates the size, in bytes, of
+// all remaining numeric values in the mapping. Updated all code
+// to respect this flag. (Previously, the purpose of this field
+// was unknown, and it was thus denoted as
+// `KeyMapping::fill[2]'.)
+// Updated all documentation; especially the "KEY MAPPING
+// DESCRIPTION" section. Added discussion of the "number-size"
+// flag and revamped all structure definitions to use the generic
+// data type `number' instead of `uchar' or 'byte'. Clarified
+// several sections of the documentation and added missing
+// discussions about type definitions and the relationship of
+// `interface' and `handler_id' to .keymapping and .keyboard
+// files.
+// Updated compilation instructions to include directions for all
+// platforms on which this program might be built.
+// Now published under the formal BSD license rather than a
+// home-grown license.
+//
+// v1 1999/09/08 Eric Sunshine <sunshine@sunshineco.com>
+// Created.
+//-----------------------------------------------------------------------------
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#if !defined(DUMPKEYMAP_FILE_ONLY)
+#include <drivers/event_status_driver.h>
+#endif
+
+#define PROG_NAME "dumpkeymap"
+#define PROG_VERSION "4"
+#define AUTHOR_NAME "Eric Sunshine"
+#define AUTHOR_EMAIL "sunshine@sunshineco.com"
+#define AUTHOR_INFO AUTHOR_NAME " <" AUTHOR_EMAIL ">"
+#define COPYRIGHT "Copyright (C) 1999,2000 by " AUTHOR_INFO
+
+typedef unsigned char byte;
+typedef unsigned short word;
+typedef unsigned int natural;
+typedef unsigned long dword;
+typedef dword number;
+
+#define ASCII_SET 0x00
+#define BIND_FUNCTION 0xfe
+#define BIND_SPECIAL 0xff
+
+#define OPT_SWITCH(X) { char const* switched_str__=(X); if (0) {
+#define OPT_CASE(X,Y) } else if (strcmp(switched_str__,(#X)) == 0 || \
+ strcmp(switched_str__,(#Y)) == 0) {
+#define OPT_DEFAULT } else {
+#define OPT_SWITCH_END }}
+
+//-----------------------------------------------------------------------------
+// Translation Tables
+//-----------------------------------------------------------------------------
+static char const* const SPECIAL_CODE[] =
+ {
+ "sound-up",
+ "sound-down",
+ "brightness-up",
+ "brightness-down",
+ "alpha-lock",
+ "help",
+ "power",
+ "secondary-up-arrow",
+ "secondary-down-arrow"
+ };
+#define N_SPECIAL_CODE (sizeof(SPECIAL_CODE) / sizeof(SPECIAL_CODE[0]))
+
+static char const* const MODIFIER_CODE[] =
+ {
+ "alpha-lock",
+ "shift",
+ "control",
+ "alternate",
+ "command",
+ "keypad",
+ "help"
+ };
+#define N_MODIFIER_CODE (sizeof(MODIFIER_CODE) / sizeof(MODIFIER_CODE[0]))
+
+static char const* const MODIFIER_MASK[] =
+ {
+ "-----", // R = carriage-return
+ "----L", // A = alternate
+ "---S-", // C = control
+ "---SL", // S = shift
+ "--C--", // L = alpha-lock
+ "--C-L",
+ "--CS-",
+ "--CSL",
+ "-A---",
+ "-A--L",
+ "-A-S-",
+ "-A-SL",
+ "-AC--",
+ "-AC-L",
+ "-ACS-",
+ "-ACSL",
+ "R----",
+ "R---L",
+ "R--S-",
+ "R--SL",
+ "R-C--",
+ "R-C-L",
+ "R-CS-",
+ "R-CSL",
+ "RA---",
+ "RA--L",
+ "RA-S-",
+ "RA-SL",
+ "RAC--",
+ "RAC-L",
+ "RACS-",
+ "RACSL",
+ };
+#define N_MODIFIER_MASK (sizeof(MODIFIER_MASK) / sizeof(MODIFIER_MASK[0]))
+
+#define FUNCTION_KEY_FIRST 0x20
+static char const* const FUNCTION_KEY[] =
+ {
+ "F1", // 0x20
+ "F2", // 0x21
+ "F3", // 0x22
+ "F4", // 0x23
+ "F5", // 0x24
+ "F6", // 0x25
+ "F7", // 0x26
+ "F8", // 0x27
+ "F9", // 0x28
+ "F10", // 0x29
+ "F11", // 0x2a
+ "F12", // 0x2b
+ "insert", // 0x2c
+ "delete", // 0x2d
+ "home", // 0x2e
+ "end", // 0x2f
+ "page up", // 0x30
+ "page down", // 0x31
+ "print screen", // 0x32
+ "scroll lock", // 0x33
+ "pause", // 0x34
+ "sys-request", // 0x35
+ "break", // 0x36
+ "reset (HIL)", // 0x37
+ "stop (HIL)", // 0x38
+ "menu (HIL)", // 0x39
+ "user (HIL)", // 0x3a
+ "system (HIL)", // 0x3b
+ "print (HIL)", // 0x3c
+ "clear line (HIL)", // 0x3d
+ "clear display (HIL)", // 0x3e
+ "insert line (HIL)", // 0x3f
+ "delete line (HIL)", // 0x40
+ "insert char (HIL)", // 0x41
+ "delete char (HIL)", // 0x42
+ "prev (HIL)", // 0x43
+ "next (HIL)", // 0x44
+ "select (HIL)", // 0x45
+ };
+#define N_FUNCTION_KEY (sizeof(FUNCTION_KEY) / sizeof(FUNCTION_KEY[0]))
+
+
+//-----------------------------------------------------------------------------
+// Data Stream Object
+// Can be configured to treat embedded "numbers" as being composed of
+// either 1, 2, or 4 bytes, apiece.
+//-----------------------------------------------------------------------------
+typedef struct _DataStream
+ {
+ byte const* data;
+ byte const* data_end;
+ natural number_size; // Size in bytes of a "number" in the stream.
+ } DataStream;
+
+static DataStream* new_data_stream( byte const* data, int size )
+ {
+ DataStream* s = (DataStream*)malloc( sizeof(DataStream) );
+ s->data = data;
+ s->data_end = data + size;
+ s->number_size = 1; // Default to byte-sized numbers.
+ return s;
+ }
+
+static void destroy_data_stream( DataStream* s )
+ {
+ free(s);
+ }
+
+static int end_of_stream( DataStream* s )
+ {
+ return (s->data >= s->data_end);
+ }
+
+static void expect_nbytes( DataStream* s, int nbytes )
+ {
+ if (s->data + nbytes > s->data_end)
+ {
+ fputs( "Insufficient data in keymapping data stream.\n", stderr );
+ exit(-1);
+ }
+ }
+
+static byte get_byte( DataStream* s )
+ {
+ expect_nbytes( s, 1 );
+ return *s->data++;
+ }
+
+static word get_word( DataStream* s )
+ {
+ word hi, lo;
+ expect_nbytes( s, 2 );
+ hi = *s->data++;
+ lo = *s->data++;
+ return ((hi << 8) | lo);
+ }
+
+static dword get_dword( DataStream* s )
+ {
+ dword b1, b2, b3, b4;
+ expect_nbytes( s, 4 );
+ b4 = *s->data++;
+ b3 = *s->data++;
+ b2 = *s->data++;
+ b1 = *s->data++;
+ return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1);
+ }
+
+static number get_number( DataStream* s )
+ {
+ switch (s->number_size)
+ {
+ case 4: return get_dword(s);
+ case 2: return get_word(s);
+ default: return get_byte(s);
+ }
+ }
+
+
+//-----------------------------------------------------------------------------
+// Translation Utility Functions
+//-----------------------------------------------------------------------------
+static char const* special_code_desc( number n )
+ {
+ if (n < N_SPECIAL_CODE)
+ return SPECIAL_CODE[n];
+ else
+ return "invalid";
+ }
+
+static char const* modifier_code_desc( number n )
+ {
+ if (n < N_MODIFIER_CODE)
+ return MODIFIER_CODE[n];
+ else
+ return "invalid";
+ }
+
+static char const* modifier_mask_desc( number n )
+ {
+ if (n < N_MODIFIER_MASK)
+ return MODIFIER_MASK[n];
+ else
+ return "?????";
+ }
+
+static char const* function_key_desc( number n )
+ {
+ if (n >= FUNCTION_KEY_FIRST && n < N_FUNCTION_KEY + FUNCTION_KEY_FIRST)
+ return FUNCTION_KEY[ n - FUNCTION_KEY_FIRST ];
+ else
+ return "unknown";
+ }
+
+static number bits_set( number mask )
+ {
+ number n = 0;
+ for ( ; mask != 0; mask >>= 1)
+ if ((mask & 0x01) != 0)
+ n++;
+ return n;
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse a list of Modifier records.
+//-----------------------------------------------------------------------------
+static void unparse_modifiers( DataStream* s )
+ {
+ number nmod = get_number(s); // Modifier count
+ printf( "MODIFIERS [%lu]\n", nmod );
+ while (nmod-- > 0)
+ {
+ number nscan;
+ number const code = get_number(s);
+ printf( "%s:", modifier_code_desc(code) );
+ nscan = get_number(s);
+ while (nscan-- > 0)
+ printf( " 0x%02x", (natural)get_number(s) );
+ putchar( '\n' );
+ }
+ putchar( '\n' );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse a list of Character records.
+//-----------------------------------------------------------------------------
+typedef void (*UnparseSpecialFunc)( number code );
+
+static void unparse_char_codes(
+ DataStream* s, number ncodes, UnparseSpecialFunc unparse_special )
+ {
+ if (ncodes != 0)
+ {
+ while (ncodes-- > 0)
+ {
+ number const char_set = get_number(s);
+ number const code = get_number(s);
+ putchar(' ');
+ switch (char_set)
+ {
+ case ASCII_SET:
+ {
+ int const c = (int)code;
+ if (isprint(c))
+ printf( "\"%c\"", c );
+ else if (code < ' ')
+ printf( "\"^%c\"", c + '@' );
+ else
+ printf( "%02x", c );
+ break;
+ }
+ case BIND_FUNCTION:
+ printf( "[%s]", function_key_desc(code) );
+ break;
+ case BIND_SPECIAL:
+ unparse_special( code );
+ break;
+ default:
+ printf( "%02x/%02x", (natural)char_set, (natural)code );
+ break;
+ }
+ }
+ }
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse a list of scan code bindings.
+//-----------------------------------------------------------------------------
+static void unparse_key_special( number code )
+ {
+ printf( "{seq#%lu}", code );
+ }
+
+static void unparse_characters( DataStream* s )
+ {
+ number const NOT_BOUND = 0xff;
+ number const nscans = get_number(s);
+ number scan;
+ printf( "CHARACTERS [%lu]\n", nscans );
+ for (scan = 0; scan < nscans; scan++)
+ {
+ number const mask = get_number(s);
+ printf( "scan 0x%02x: ", (natural)scan );
+ if (mask == NOT_BOUND)
+ fputs( "not-bound\n", stdout );
+ else
+ {
+ number const bits = bits_set( mask );
+ number const codes = 1 << bits;
+ printf( "%s ", modifier_mask_desc(mask) );
+ unparse_char_codes( s, codes, unparse_key_special );
+ putchar( '\n' );
+ }
+ }
+ putchar( '\n' );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse a list of key sequences.
+//-----------------------------------------------------------------------------
+static void unparse_sequence_special( number code )
+ {
+ printf( "{%s}", (code == 0 ? "unmodify" : modifier_code_desc(code)) );
+ }
+
+static void unparse_sequences( DataStream* s )
+ {
+ number const nseqs = get_number(s);
+ number seq;
+ printf( "SEQUENCES [%lu]\n", nseqs );
+ for (seq = 0; seq < nseqs; seq++)
+ {
+ number const nchars = get_number(s);
+ printf( "sequence %lu:", seq );
+ unparse_char_codes( s, nchars, unparse_sequence_special );
+ putchar( '\n' );
+ }
+ putchar( '\n' );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse a list of special keys.
+//-----------------------------------------------------------------------------
+static void unparse_specials( DataStream* s )
+ {
+ number nspecials = get_number(s);
+ printf( "SPECIALS [%lu]\n", nspecials );
+ while (nspecials-- > 0)
+ {
+ number const special = get_number(s);
+ number const scan = get_number(s);
+ printf( "%s: 0x%02x\n", special_code_desc(special), (natural)scan );
+ }
+ putchar( '\n' );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse the number-size flag.
+//-----------------------------------------------------------------------------
+static void unparse_numeric_size( DataStream* s )
+ {
+ word const numbers_are_shorts = get_word(s);
+ s->number_size = numbers_are_shorts ? 2 : 1;
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse an entire key map.
+//-----------------------------------------------------------------------------
+static void unparse_keymap_data( DataStream* s )
+ {
+ unparse_numeric_size(s);
+ unparse_modifiers(s);
+ unparse_characters(s);
+ unparse_sequences(s);
+ unparse_specials(s);
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse the active key map.
+//-----------------------------------------------------------------------------
+#if !defined(DUMPKEYMAP_FILE_ONLY)
+static int unparse_active_keymap( void )
+ {
+ int rc = 1;
+ NXEventHandle const h = NXOpenEventStatus();
+ if (h == 0)
+ fputs( "Unable to open event status driver.\n", stderr );
+ else
+ {
+ NXKeyMapping km;
+ km.size = NXKeyMappingLength(h);
+ if (km.size <= 0)
+ fprintf( stderr, "Bad key mapping length (%d).\n", km.size );
+ else
+ {
+ km.mapping = (char*)malloc( km.size );
+ if (NXGetKeyMapping( h, &km ) == 0)
+ fputs( "Unable to get current key mapping.\n", stderr );
+ else
+ {
+ DataStream* stream =
+ new_data_stream( (byte const*)km.mapping, km.size );
+ fputs( "=============\nACTIVE KEYMAP\n=============\n\n",
+ stdout);
+ unparse_keymap_data( stream );
+ destroy_data_stream( stream );
+ rc = 0;
+ }
+ free( km.mapping );
+ }
+ NXCloseEventStatus(h);
+ }
+ return rc;
+ }
+#endif
+
+
+//-----------------------------------------------------------------------------
+// Unparse one key map from a keymapping file.
+//-----------------------------------------------------------------------------
+static void unparse_keymap( DataStream* s )
+ {
+ dword const interface = get_dword(s);
+ dword const handler_id = get_dword(s);
+ dword const map_size = get_dword(s);
+ printf( "interface: 0x%02lx\nhandler_id: 0x%02lx\nmap_size: %lu bytes\n\n",
+ interface, handler_id, map_size );
+ unparse_keymap_data(s);
+ }
+
+
+//-----------------------------------------------------------------------------
+// Check the magic number of a keymapping file.
+//-----------------------------------------------------------------------------
+static int check_magic_number( DataStream* s )
+ {
+ return (get_byte(s) == 'K' &&
+ get_byte(s) == 'Y' &&
+ get_byte(s) == 'M' &&
+ get_byte(s) == '1');
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse all key maps within a keymapping file.
+//-----------------------------------------------------------------------------
+static int unparse_keymaps( DataStream* s )
+ {
+ int rc = 0;
+ if (check_magic_number(s))
+ {
+ int n = 1;
+ while (!end_of_stream(s))
+ {
+ printf( "---------\nKEYMAP #%d\n---------\n", n++ );
+ unparse_keymap(s);
+ }
+ }
+ else
+ {
+ fputs( "Bad magic number.\n", stderr );
+ rc = 1;
+ }
+ return rc;
+ }
+
+
+//-----------------------------------------------------------------------------
+// Unparse a keymapping file.
+//-----------------------------------------------------------------------------
+static int unparse_keymap_file( char const* const path )
+ {
+ int rc = 1;
+ FILE* file;
+ printf( "===========\nKEYMAP FILE\n===========\n%s\n\n", path );
+ file = fopen( path, "rb" );
+ if (file == 0)
+ perror( "Unable to open key mapping file" );
+ else
+ {
+ struct stat st;
+ if (fstat( fileno(file), &st ) != 0)
+ perror( "Unable to determine key mapping file size" );
+ else
+ {
+ byte* buffer = (byte*)malloc( st.st_size );
+ if (fread( buffer, st.st_size, 1, file ) != 1)
+ perror( "Unable to read key mapping file" );
+ else
+ {
+ DataStream* stream = new_data_stream(buffer, (int)st.st_size);
+ fclose( file ); file = 0;
+ rc = unparse_keymaps( stream );
+ destroy_data_stream( stream );
+ }
+ free( buffer );
+ }
+ if (file != 0)
+ fclose( file );
+ }
+ return rc;
+ }
+
+
+//-----------------------------------------------------------------------------
+// Handle the case when no documents are mentioned on the command-line. For
+// Apple/NeXT platforms, dump the currently active key mapping; else display
+// an error message.
+//-----------------------------------------------------------------------------
+static int handle_empty_document_list( void )
+ {
+#if !defined(DUMPKEYMAP_FILE_ONLY)
+ return unparse_active_keymap();
+#else
+ fputs( "ERROR: Must specify at least one .keymapping file.\n\n", stderr );
+ return 1;
+#endif
+ }
+
+
+//-----------------------------------------------------------------------------
+// Print a detailed description of the internal layout of a key mapping.
+//-----------------------------------------------------------------------------
+static void print_internal_layout_info( FILE* f )
+ {
+ fputs(
+"What follows is a detailed descriptions of the internal layout of an\n"
+"Apple/NeXT .keymapping file.\n"
+"\n"
+"Types and Data\n"
+"--------------\n"
+"The following type definitions are employed throughout this discussion:\n"
+"\n"
+" typedef unsigned char byte;\n"
+" typedef unsigned short word;\n"
+" typedef unsigned long dword;\n"
+"\n"
+"Additionally, the type definition `number' is used generically to indicate\n"
+"a numeric value. The actual size of the `number' type may be one or two\n"
+"bytes depending upon how the data is stored in the key map. Although most\n"
+"key maps use byte-sized numeric values, word-sized values are also allowed.\n"
+"\n"
+"Multi-byte values in a key mapping file are stored in big-endian byte\n"
+"order.\n"
+"\n"
+"Key Mapping File and Device Mapping\n"
+"-----------------------------------\n"
+"A key mapping file begins with a magic-number and continues with a variable\n"
+"number of device-specific key mappings.\n"
+"\n"
+" struct KeyMappingFile {\n"
+" char magic_number[4]; // `KYM1'\n"
+" DeviceMapping maps[...]; // Variable number of maps\n"
+" };\n"
+"\n"
+" struct DeviceMapping {\n"
+" dword interface; // Interface type\n"
+" dword handler_id; // Interface subtype\n"
+" dword map_size; // Byte count of `map' (below)\n"
+" KeyMapping map;\n"
+" };\n"
+"\n"
+"The value of `interface' represents a family of keyboard device types\n"
+"(such as Intel PC, ADB, NeXT, Sun Type5, etc.), and is generally\n"
+"specified as one of the constant values NX_EVS_DEVICE_INTERFACE_ADB,\n"
+"NX_EVS_DEVICE_INTERFACE_ACE, etc., which are are defined in IOHIDTypes.h on\n"
+"MacOS/X and Darwin, and in ev_types.h on MacOS/X Server, OpenStep, and\n"
+"NextStep.\n"
+"\n"
+"The value of `handler_id' represents a specific keyboard layout within the\n"
+"much broader `interface' family. For instance, for a 101-key Intel PC\n"
+"keyboard (of type NX_EVS_DEVICE_INTERFACE_ACE) the `handler_id' is '0',\n"
+"whereas for a 102-key keyboard it is `1'.\n"
+"\n"
+"Together, `interface' and `handler_id' identify the exact keyboard hardware\n"
+"to which this mapping applies. Programs which display a visual\n"
+"representation of a keyboard layout, match `interface' and `handler_id'\n"
+"from the .keymapping file against the `interface' and `handler_id' values\n"
+"found in each .keyboard file.\n"
+"\n"
+"Key Mapping\n"
+"-----------\n"
+"A key mapping completely defines the relationship of all scan codes with\n"
+"their associated functionality. A KeyMapping structure is embedded within\n"
+"the DeviceMapping structure in a KeyMappingFile. The key mapping currently\n"
+"in use by the WindowServer and AppKit is also represented by a KeyMapping\n"
+"structure, and can be referred to directly by calling NXGetKeyMapping() and\n"
+"accessing the `mapping' data member of the returned NXKeyMapping structure.\n"
+"\n"
+" struct KeyMapping {\n"
+" word number_size; // 0=1 byte, non-zero=2 bytes\n"
+" number num_modifier_groups; // Modifier groups\n"
+" ModifierGroup modifier_groups[...];\n"
+" number num_scan_codes; // Scan groups\n"
+" ScanGroup scan_table[...];\n"
+" number num_sequence_lists; // Sequence lists\n"
+" Sequence sequence_lists[...];\n"
+" number num_special_keys; // Special keys\n"
+" SpecialKey special_key[...];\n"
+" };\n"
+"\n"
+"The `number_size' flag determines the size, in bytes, of all remaining\n"
+"numeric values (denoted by the type definition `number') within the key\n"
+"mapping. If its value is zero, then numbers are represented by a single\n"
+"byte. If it is non-zero, then numbers are represented by a word (two\n"
+"bytes).\n"
+"\n"
+"Modifier Group\n"
+"--------------\n"
+"A modifier group defines all scan codes which map to a particular type of\n"
+"modifier, such as `shift', `control', etc.\n"
+"\n"
+" enum Modifier {\n"
+" ALPHALOCK = 0,\n"
+" SHIFT,\n"
+" CONTROL,\n"
+" ALTERNATE,\n"
+" COMMAND,\n"
+" KEYPAD,\n"
+" HELP\n"
+" };\n"
+"\n"
+" struct ModifierGroup {\n"
+" number modifier; // A Modifier constant\n"
+" number num_scan_codes;\n"
+" number scan_codes[...]; // Variable number of scan codes\n"
+" };\n"
+"\n"
+"The scan_codes[] array contains a list of all scan codes which map to the\n"
+"specified modifier. The `shift', `command', and `alternate' modifiers are\n"
+"frequently mapped to two different scan codes, apiece, since these\n"
+"modifiers often appear on both the left and right sides of the keyboard.\n"
+"\n"
+"Scan Group\n"
+"----------\n"
+"There is one ScanGroup for each scan code generated by the given keyboard.\n"
+"This number is given by KeyMapping::num_scan_codes. The first scan group\n"
+"represents hardware scan code 0, the second represents scan code 1, etc.\n"
+"\n"
+" enum ModifierMask {\n"
+" ALPHALOCK_MASK = 1 << 0,\n"
+" SHIFT_MASK = 1 << 1,\n"
+" CONTROL_MASK = 1 << 2,\n"
+" ALTERNATE_MASK = 1 << 3,\n"
+" CARRIAGE_RETURN_MASK = 1 << 4\n"
+" };\n"
+" #define NOT_BOUND 0xff\n"
+"\n"
+" struct ScanGroup {\n"
+" number mask;\n"
+" Character characters[...];\n"
+" };\n"
+"\n"
+"For each scan code, `mask' defines which modifier combinations generate\n"
+"characters. If `mask' is NOT_BOUND (0xff) then then this scan code does\n"
+"not generate any characters ever, and its characters[] array is zero\n"
+"length. Otherwise, the characters[] array contains one Character record\n"
+"for each modifier combination.\n"
+"\n"
+"The number of records in characters[] is determined by computing (1 <<\n"
+"bits_set_in_mask). In other words, if mask is zero, then zero bits are\n"
+"set, so characters[] contains only one record. If `mask' is (SHIFT_MASK |\n"
+"CONTROL_MASK), then two bits are set, so characters[] contains four\n"
+"records.\n"
+"\n"
+"The first record always represents the character which is generated by that\n"
+"key when no modifiers are active. The remaining records represent\n"
+"characters generated by the various modifier combinations. Using the\n"
+"example with the `shift' and `control' masks set, record two would\n"
+"represent the character with the `shift' modifier active; record three, the\n"
+"`control' modifier active; and record four, both the `shift' and `control'\n"
+"modifiers active.\n"
+"\n"
+"As a special case, ALPHALOCK_MASK implies SHIFT_MASK, though only\n"
+"ALPHALOCK_MASK appears in `mask'. In this case the same character is\n"
+"generated for both the `shift' and `alpha-lock' modifiers, but only needs\n"
+"to appear once in the characters[] array.\n"
+"\n"
+"CARRIAGE_RETURN_MASK does not actually refer to a modifier key. Instead,\n"
+"it is used to distinguish the scan code which is given the special\n"
+"pseudo-designation of `carriage return' key. Typically, this mask appears\n"
+"solo in a ScanGroup record and only the two Character records for control-M\n"
+"and control-C follow. This flag may be a throwback to an earlier time or\n"
+"may be specially interpreted by the low-level keyboard driver, but its\n"
+"purpose is otherwise enigmatic.\n"
+"Character\n"
+"---------\n"
+"Each Character record indicates the character generated when this key is\n"
+"pressed, as well as the character set which contains the character. Well\n"
+"known character sets are `ASCII' and `Symbol'. The character set can also\n"
+"be one of the meta values FUNCTION_KEY or KEY_SEQUENCE. If it is\n"
+"FUNCTION_KEY then `char_code' represents a generally well-known function\n"
+"key such as those enumerated by FunctionKey. If the character set is\n"
+"KEY_SEQUENCE then `char_code' represents a zero-base index into\n"
+"KeyMapping::sequence_lists[].\n"
+"\n"
+" enum CharacterSet {\n"
+" ASCII = 0x00,\n"
+" SYMBOL = 0x01,\n"
+" ...\n"
+" FUNCTION_KEY = 0xfe,\n"
+" KEY_SEQUENCE = 0xff\n"
+" };\n"
+"\n"
+" struct Character {\n"
+" number set; // CharacterSet of generated character\n"
+" number char_code; // Actual character generated\n"
+" };\n"
+"\n"
+" enum FunctionKey {\n"
+" F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,\n"
+" INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN,\n"
+" SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU, USER,\n"
+" SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE,\n"
+" DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT\n"
+" };\n"
+"\n"
+"Sequence\n"
+"--------\n"
+"When Character::set contains the meta value KEY_SEQUENCE, the scan code is\n"
+"bound to a sequence of keys rather than a single character. A sequence is\n"
+"a series of modifiers and characters which are automatically generated when\n"
+"the associated key is depressed.\n"
+"\n"
+" #define MODIFIER_KEY 0xff\n"
+"\n"
+" struct Sequence {\n"
+" number num_chars;\n"
+" Character characters[...];\n"
+" };\n"
+"\n"
+"Each generated Character is represented as previously described, with the\n"
+"exception that MODIFIER_KEY may appear in place of KEY_SEQUENCE. When the\n"
+"value of Character::set is MODIFIER_KEY then Character::char_code\n"
+"represents a modifier key rather than an actual character. If the modifier\n"
+"represented by `char_code' is non-zero, then it indicates that the\n"
+"associated modifier key has been depressed. In this case, the value is one\n"
+"of the constants enumerated by Modifier (SHIFT, CONTROL, ALTERNATE, etc.).\n"
+"If the value is zero then it means that the modifier keys have been\n"
+"released.\n"
+"\n"
+"Special Key\n"
+"-----------\n"
+"A special key is one which is scanned directly by the Mach kernel rather\n"
+"than by the WindowServer. In general, events are not generated for special\n"
+"keys.\n"
+"\n"
+" enum SpecialKeyType {\n"
+" VOLUME_UP = 0,\n"
+" VOLUME_DOWN,\n"
+" BRIGHTNESS_UP,\n"
+" BRIGHTNESS_DOWN,\n"
+" ALPHA_LOCK,\n"
+" HELP,\n"
+" POWER,\n"
+" SECONDARY_ARROW_UP,\n"
+" SECONDARY_ARROW_DOWN\n"
+" };\n"
+"\n"
+" struct SpecialKey {\n"
+" number type; // A SpecialKeyType constant\n"
+" number scan_code; // Actual scan code\n"
+" };\n"
+"\n", f );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Print an explanation of the output generated by this program.
+//-----------------------------------------------------------------------------
+static void print_output_info( FILE* f )
+ {
+ fputs(
+"What follows is an explanation and description of the various pieces of\n"
+"information emitted by dumpkeymap.\n"
+"\n"
+"For a more thorough discussion of any particular piece of information\n"
+"described here, refer to the detailed description of the internal layout of\n"
+"a key mapping given by the --help-layout option.\n"
+"\n"
+"Conventions\n"
+"-----------\n"
+"Depending upon context, some numeric values are displayed in decimal\n"
+"notation, whereas others are displayed in hexadecimal notation.\n"
+"Hexadecimal numbers are denoted by a `0x' prefix (for instance, `0x7b'),\n"
+"except when explicitly noted otherwise.\n"
+"\n"
+"Key Mapping Source\n"
+"------------------\n"
+"The first piece of information presented about a particular key mapping is\n"
+"the source from which the data was gleaned. For a .keymapping file, the\n"
+"title `KEYMAP FILE' is emitted along with the path and name of the file in\n"
+"question. For the key mapping currently in use by the WindowServer and\n"
+"AppKit, the title `ACTIVE KEYMAP' is emitted instead.\n"
+"\n"
+"Device Information\n"
+"------------------\n"
+"Each .keymapping file may contain one or more raw key mappings. For\n"
+"example, a file which maps keys to a Dvorak-style layout might contain raw\n"
+"mappings for Intel PC, ADB, NeXT, and Sun Type5 keyboards.\n"
+"\n"
+"For each raw mapping, the following information is emitted:\n"
+"\n"
+" o The title `KEYMAP' along with the mapping's relative position in the\n"
+" .keymapping file.\n"
+" o The `interface' identifier.\n"
+" o The `handler_id' sub-identifier.\n"
+" o The size of the raw mapping resource counted in bytes.\n"
+"\n"
+"The `interface' and `handler_id' values, taken together, define a specific\n"
+"keyboard device. A .keyboard file, which describes the visual layout of a\n"
+"keyboard, also contains `interface' and `handler_id' identifiers. The\n"
+".keyboard file corresponding to a particular key mapping can be found by\n"
+"matching the `interface' and `handler_id' values from each resource.\n"
+"\n"
+"Modifiers\n"
+"---------\n"
+"Each mapping may contain zero or more modifier records which associate\n"
+"hardware scan codes with modifier descriptions such as `shift', `control',\n"
+"`alternate', etc. The title `MODIFIERS' is printed along with the count of\n"
+"modifier records which follow. For each modifier record, the modifier's\n"
+"name is printed along with a list of scan codes, in hexadecimal format,\n"
+"which generate that modifier value. For example:\n"
+"\n"
+" MODIFIERS [4]\n"
+" alternate: 0x1d 0x60\n"
+" control: 0x3a\n"
+" keypad: 0x52 0x53 ... 0x63 0x62\n"
+" shift: 0x2a 0x36\n"
+"\n"
+"Characters\n"
+"----------\n"
+"Each mapping may contain zero or more character records which associate\n"
+"hardware scan codes with the actual characters generated by those scan\n"
+"codes in the presence or absence of various modifier combinations. The\n"
+"title `CHARACTERS' is printed along with the count of character records\n"
+"which follow. Here is a highly abbreviated example:\n"
+"\n"
+" CHARACTERS [9]\n"
+" scan 0x00: -AC-L \"a\" \"A\" \"^A\" \"^A\" ca c7 \"^A\" \"^A\"\n"
+" scan 0x07: -AC-L \"x\" \"X\" \"^X\" \"^X\" 01/b4 01/ce \"^X\" \"^X\"\n"
+" scan 0x0a: ---S- \"<\" \">\"\n"
+" scan 0x13: -ACS- \"2\" \"@\" \"^@\" \"^@\" b2 b3 \"^@\" \"^@\"\n"
+" scan 0x24: R---- \"^M\" \"^C\"\n"
+" scan 0x3e: ----- [F4]\n"
+" scan 0x4a: ----- [page up]\n"
+" scan 0x60: ----- {seq#3}\n"
+" scan 0x68: not-bound\n"
+"\n"
+"For each record, the hexadecimal value of the hardware scan code is\n"
+"printed, followed by a list of modifier flag combinations and the actual\n"
+"characters generated by this scan code with and without modifiers applied.\n"
+"\n"
+"The modifier flags field is composed of a combination of single letter\n"
+"representations of the various modifier types. The letters stand for:\n"
+"\n"
+" L - alpha-lock\n"
+" S - shift\n"
+" C - control\n"
+" A - alternate\n"
+" R - carriage-return\n"
+"\n"
+"As a special case, the `alpha-lock' flag also implies the `shift' flag, so\n"
+"these two flags never appear together in the same record.\n"
+"\n"
+"The combination of modifier flags determines the meaning and number of\n"
+"fields which follow. The first field after the modifier flags always\n"
+"represents the character that will be generated if no modifier keys are\n"
+"depressed. The remaining fields represent characters generated by the\n"
+"various modifier combinations. The order of the fields follows this\n"
+"general pattern:\n"
+"\n"
+" o The character generated by this scan code when no modifiers are in\n"
+" effect is listed first.\n"
+"\n"
+" o If the `L' or `S' flag is active, then the shifted character\n"
+" generated by this scan code is listed next.\n"
+"\n"
+" o If the `C' flag is active, then the control-character generated by\n"
+" this scan code is listed next. Furthermore, if the `L' or `S' flag\n"
+" is also active, then the shifted control-character is listed after\n"
+" that.\n"
+"\n"
+" o If the `A' flag is active, then the alternate-character generated by\n"
+" this scan code is listed next. Furthermore, if the `L' or `S' flag\n"
+" is active, then the shifted alternate-character is listed after that.\n"
+" If the `C' flag is also active, then the alternate-control-character\n"
+" is listed next. Finally, if the `C' and `L' or `C' and `S' flags are\n"
+" also active, then the shifted alternate-control-character is listed.\n"
+"\n"
+"The `R' flag does not actually refer to a modifier key. Instead, it is\n"
+"used to distinguish the scan code which is given the special\n"
+"pseudo-designation of `carriage return' key. Typically, this mask appears\n"
+"solo and only the two fields for control-M and control-C follow. This flag\n"
+"may be a throwback to an earlier time or may be specially interpreted by\n"
+"the low-level keyboard driver, but its purpose is otherwise enigmatic.\n"
+"\n"
+"Recalling the example from above, the following fields can be identified:\n"
+"\n"
+" scan 0x00: -AC-L \"a\" \"A\" \"^A\" \"^A\" ca c7 \"^A\" \"^A\"\n"
+"\n"
+" o Lower-case `a' is generated when no modifiers are active.\n"
+" o Upper-case `A' is generated when `shift' or `alpha-lock' are active.\n"
+" o Control-A is generated when `control' is active.\n"
+" o Control-A is generated when `control' and `shift' are active.\n"
+" o The character represented by the hexadecimal code 0xca is generated\n"
+" when `alternate' is active.\n"
+" o The character represented by 0xc7 is generated when `alternate' and\n"
+" `shift' (or `alpha-lock') are active.\n"
+" o Control-A is generated when `alternate' and `control' are active.\n"
+" o Control-A is generated when `alternate', `control' and `shift' (or\n"
+" `alpha-lock') are active.\n"
+"\n"
+"The notation used to represent a particular generated character varies.\n"
+"\n"
+" o Printable ASCII characters are quoted, as in \"x\" or \"X\".\n"
+"\n"
+" o Control-characters are quoted and prefixed with `^', as in \"^X\".\n"
+"\n"
+" o Characters with values greater than 127 (0x7f) are displayed as\n"
+" hexadecimal values without the `0x' prefix.\n"
+"\n"
+" o Characters in a non-ASCII character set (such as `Symbol') are\n"
+" displayed as two hexadecimal numbers separated by a slash, as in\n"
+" `01/4a'. The first number is the character set's identification code\n"
+" (such as `01' for the `Symbol' set), and the second number is the\n"
+" value of the generated character.\n"
+"\n"
+" o Non-printing special function characters are displayed with the\n"
+" function's common name enclosed in brackets, as in `[page up]' or\n"
+" `[F4]'.\n"
+"\n"
+" o If the binding represents a key sequence rather than a single\n"
+" character, then the sequence's identification number is enclosed in\n"
+" braces, as in `{seq#3}'.\n"
+"\n"
+"Recalling a few examples from above, the following interpretations can be\n"
+"made:\n"
+"\n"
+" scan 0x07: -AC-L \"x\" \"X\" \"^X\" \"^X\" 01/b4 01/ce \"^X\" \"^X\"\n"
+" scan 0x3e: ----- [F4]\n"
+" scan 0x4a: ----- [page up]\n"
+" scan 0x60: ----- {seq#3}\n"
+"\n"
+" o \"x\" and \"X\" are printable ASCII characters.\n"
+" o \"^X\" is a control-character.\n"
+" o `01/b4' and `01/ce' represent the character codes 0xb4 and 0xce in\n"
+" the `Symbol' character set.\n"
+" o Scan code 0x3e generates function-key `F4', and scan code 0x4a\n"
+" generates function-key `page up'.\n"
+" o Scan code 0x60 is bound to key sequence #3.\n"
+"\n"
+"Finally, if a scan code is not bound to any characters, then it is\n"
+"annotated with the label `not-bound', as with example scan code 0x68 from\n"
+"above.\n"
+"\n"
+"Sequences\n"
+"---------\n"
+"A scan code (modified and unmodified) can be bound to a key sequence rather\n"
+"than generating a single character or acting as a modifier. When it is\n"
+"bound to a key sequence, a series of character invocations and modifier\n"
+"actions are automatically generated rather than a single keystroke.\n"
+"\n"
+"Each mapping may contain zero or more key sequence records. The title\n"
+"`SEQUENCES' is printed along with the count of sequence records which\n"
+"follow. For example:\n"
+"\n"
+" SEQUENCES [3]\n"
+" sequence 0: \"f\" \"o\" \"o\"\n"
+" sequence 1: {alternate} \"b\" \"a\" \"r\" {unmodify}\n"
+" sequence 2: [home] \"b\" \"a\" \"z\"\n"
+"\n"
+"The notation used to represent the sequence of generated characters is\n"
+"identical to the notation already described in the `Characters' section\n"
+"above, with the exception that modifier actions may be interposed between\n"
+"generated characters. Such modifier actions are represented by the\n"
+"modifier's name enclosed in braces. The special name `{unmodify}'\n"
+"indicates the release of the modifier keys.\n"
+"\n"
+"Thus, the sequences in the above example can be interpreted as follows:\n"
+"\n"
+" o Sequence #0 generates `foo'.\n"
+" o Sequence #1 invokes the `alternate' modifier, generates `bar', and\n"
+" then releases `alternate'.\n"
+" o Sequence #2 invokes the `home' key and then generates `baz'. In a\n"
+" text editor, this would probably result in `baz' being prepended to\n"
+" the line of text on which the cursor resides.\n"
+"\n"
+"Special Keys\n"
+"------------\n"
+"Certain keyboards feature keys which perform some type of special purpose\n"
+"function rather than generating a character or acting as a modifier. For\n"
+"instance, Apple keyboards often contain a `power' key, and NeXT keyboards\n"
+"have historically featured screen brightness and volume control keys.\n"
+"\n"
+"Each mapping may contain zero or more special-key records which associate\n"
+"hardware scan codes with such special purpose functions. The title\n"
+"`SPECIALS' is printed along with the count of records which follow. For\n"
+"each record, the special function's name is printed along with a list of\n"
+"scan codes, in hexadecimal format, which are bound to that function. For\n"
+"example:\n"
+"\n"
+" SPECIALS [6]\n"
+" alpha-lock: 0x39\n"
+" brightness-down: 0x79\n"
+" brightness-up: 0x74\n"
+" power: 0x7f\n"
+" sound-down: 0x77\n"
+" sound-up: 0x73\n"
+"\n", f );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Print a summary of the various files and directories which are related to
+// key mappings.
+//-----------------------------------------------------------------------------
+static void print_files_info( FILE* f )
+ {
+ fputs(
+"This is a summary of the various files and directories which are related to\n"
+"key mappings.\n"
+"\n"
+"*.keymapping\n"
+" A key mapping file which precisely defines the relationship of all\n"
+" hardware-specific keyboard scan-codes with their associated\n"
+" functionality.\n"
+"\n"
+"*.keyboard\n"
+" A file describing the physical layout of keys on a particular type of\n"
+" keyboard. Each `key' token in this file defines the position and shape\n"
+" of the key on the keyboard, as well as the associated scan code which\n"
+" that key generates. A .keymapping file, on the other hand, defines the\n"
+" characters which are generated by a particular scan code depending upon\n"
+" the state of the various modifier keys (such as shift, control, etc.).\n"
+" The `interface' and `handler_id' values from a .keymapping file are\n"
+" matched against those in each .keyboard file in order to associate a\n"
+" particular .keyboard file with a key mapping. Various GUI programs use\n"
+" the .keyboard file to display a visual representation of a keyboard for\n"
+" the user. Since these files are just plain text, they can be easily\n"
+" viewed and interpreted without the aid of a specialized program, thus\n"
+" dumpkeymap leaves these files alone.\n"
+"\n"
+"/System/Library/Keyboards\n"
+"/Network/Library/Keyboards\n"
+"/Local/Library/Keyboards\n"
+"/Library/Keyboards\n"
+" Repositories for .keymapping and .keyboard files for MacOS/X, Darwin,\n"
+" and MacOS/X Server.\n"
+"\n"
+"/NextLibrary/Keyboards\n"
+"/LocalLibrary/Keyboards\n"
+" Repositories for .keymapping and .keyboard files for OpenStep and\n"
+" NextStep.\n"
+"\n"
+"$(HOME)/Library/Keyboards\n"
+" Repository for personal .keymapping and .keyboard files.\n"
+"\n", f );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Print a list of the various diagnostic messages which may be emitted.
+//-----------------------------------------------------------------------------
+static void print_diagnostics_info( FILE* f )
+ {
+ fputs(
+"The following diagnostic messages may be issued to the standard error\n"
+"stream.\n"
+"\n"
+"Unrecognized option.\n"
+" An unrecognized option was specified on the command-line. Invoke\n"
+" dumpkeymap with the --help option to view a list of valid options.\n"
+"\n"
+"Insufficient data in keymapping data stream.\n"
+" The key mapping file or data stream is corrupt. Either the file has\n"
+" been incorrectly truncated or a field, such as those which indicates\n"
+" the number of variable records which follow, contains a corrupt value.\n"
+"\n"
+"The following diagnostic messages have significance only when trying to\n"
+"print .keymapping files mentioned on the command-line.\n"
+"\n"
+"Bad magic number.\n"
+" The mentioned file is not a .keymapping file. The file's content does\n"
+" not start with the string `KYM1'.\n"
+"\n"
+"Unable to open key mapping file.\n"
+" The call to fopen() failed; probably because the specified path is\n"
+" invalid or dumpkeymap does not have permission to read the file.\n"
+"\n"
+"Unable to determine key mapping file size.\n"
+" The call to fstat() failed, thus memory can not be allocated for\n"
+" loading the file.\n"
+"\n"
+"Unable to read key mapping file.\n"
+" The call to fread() failed.\n"
+"\n"
+"The following diagnostic messages have significance only when trying to\n"
+"print the currently active key mapping when no .keymapping files have been\n"
+"mentioned on the command-line.\n"
+"\n"
+"Unable to open event status driver.\n"
+" The call to NXOpenEventStatus() failed.\n"
+"\n"
+"Bad key mapping length.\n"
+" The call to NXKeyMappingLength() returned a bogus value.\n"
+"\n"
+"Unable to get current key mapping.\n"
+" The call to NXGetKeyMapping() failed.\n"
+"\n"
+"The following diagnostic messages have significance only when using\n"
+"dumpkeymap on a non-Apple/NeXT platform.\n"
+"\n"
+"Must specify at least one .keymapping file.\n"
+" No .keymapping files were mentioned on the command-line. On\n"
+" non-Apple/NeXT platforms, there is no concept of a currently active\n"
+" .keymapping file, so at least one file must be mentioned on the\n"
+" command-line.\n"
+"\n", f );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Print warranty.
+//-----------------------------------------------------------------------------
+static void print_warranty( FILE* f )
+ {
+ fputs(
+"This software is provided by the author `AS IS' and any express or implied\n"
+"WARRANTIES, including, but not limited to, the implied warranties of\n"
+"MERCHANTABILITY and FITNESS FOR A PARTICULAR PURPOSE are DISCLAIMED. In NO\n"
+"EVENT shall the author be LIABLE for any DIRECT, INDIRECT, INCIDENTAL,\n"
+"SPECIAL, EXEMPLARY, or CONSEQUENTIAL damages (including, but not limited\n"
+"to, procurement of substitute goods or services; loss of use, data, or\n"
+"profits; or business interruption) however caused and on any theory of\n"
+"liability, whether in contract, strict liability, or tort (including\n"
+"negligence or otherwise) arising in any way out of the use of this\n"
+"software, even if advised of the possibility of such damage.\n"
+"\n", f );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Print this program's version number.
+//-----------------------------------------------------------------------------
+static void print_version( FILE* f )
+ {
+ fputs( "Version " PROG_VERSION " (built " __DATE__ ")\n\n", f );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Print a usage summary.
+//-----------------------------------------------------------------------------
+static void print_usage( FILE* f )
+ {
+ fputs(
+"Usage: dumpkeymap [options] [-] [file ...]\n"
+"\n"
+"Prints a textual representation of each Apple/NeXT .keymapping file\n"
+"mentioned on the command-line. If no files are mentioned and if the local\n"
+"machine is an Apple or NeXT installation, then the key mapping currently in\n"
+"use by the WindowServer and the AppKit is printed instead.\n"
+"\n"
+"Options:\n"
+" -h --help\n"
+" Display general program instructions and option summary.\n"
+"\n"
+" -k --help-keymapping\n"
+" Display a detailed description of the internal layout of a\n"
+" .keymapping file.\n"
+"\n"
+" -o --help-output\n"
+" Display an explanation of the output generated by dumpkeymap when\n"
+" dissecting a .keymapping file.\n"
+"\n"
+" -f --help-files\n"
+" Display a summary of the various files and directories which are\n"
+" related to key mappings.\n"
+"\n"
+" -d --help-diagnostics\n"
+" Display a list of the various diagnostic messages which may be\n"
+" emitted by dumpkeymap.\n"
+"\n"
+" -v --version\n"
+" Display the dumpkeymap version number and warranty information.\n"
+"\n"
+" - --\n"
+" Inhibit processing of options at this point in the argument list.\n"
+" An occurrence of `-' or `--' in the argument list causes all\n"
+" following arguments to be treated as file names even if an argument\n"
+" begins with a `-' character.\n"
+"\n", f );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Print an informational banner.
+//-----------------------------------------------------------------------------
+static void print_banner( FILE* f )
+ {
+ fputs( "\n" PROG_NAME " v" PROG_VERSION " by " AUTHOR_INFO "\n"
+ COPYRIGHT "\n\n", f );
+ }
+
+
+//-----------------------------------------------------------------------------
+// Process command-line arguments. Examine options first; collecting files
+// along the way. If all is well, process collected file list.
+//-----------------------------------------------------------------------------
+int main( int const argc, char const* const argv[] )
+ {
+ int rc = 0, i, nfiles = 0, more_options = 1, process_files = 1;
+ int* files = (int*)calloc( argc - 1, sizeof(int) );
+ print_banner( stdout );
+
+ for (i = 1; i < argc; i++)
+ {
+ char const* const s = argv[i];
+ if (!more_options || *s != '-')
+ files[ nfiles++ ] = i;
+ else
+ {
+ OPT_SWITCH(s)
+ OPT_CASE(-,--)
+ more_options = 0;
+ OPT_CASE(-h,--help)
+ print_usage( stdout );
+ process_files = 0;
+ OPT_CASE(-k,--help-keymapping)
+ print_internal_layout_info( stdout );
+ process_files = 0;
+ OPT_CASE(-o,--help-output)
+ print_output_info( stdout );
+ process_files = 0;
+ OPT_CASE(-f,--help-files)
+ print_files_info( stdout );
+ process_files = 0;
+ OPT_CASE(-d,--help-diagnostics)
+ print_diagnostics_info( stdout );
+ process_files = 0;
+ OPT_CASE(-v,--version)
+ print_version( stdout );
+ print_warranty( stdout );
+ process_files = 0;
+ OPT_DEFAULT
+ fprintf( stderr, "ERROR: Unrecognized option: %s\n\n", s );
+ process_files = 0;
+ rc = 1;
+ OPT_SWITCH_END
+ }
+ }
+
+ if (process_files)
+ {
+ if (nfiles == 0)
+ rc = handle_empty_document_list();
+ else
+ for (i = 0; i < nfiles; i++)
+ rc |= unparse_keymap_file( argv[files[i]] );
+ }
+
+ free( files );
+ return rc;
+ }
diff --git a/hw/darwin/utils/dumpkeymap.man b/hw/darwin/utils/dumpkeymap.man
new file mode 100644
index 000000000..2ad6d54d2
--- /dev/null
+++ b/hw/darwin/utils/dumpkeymap.man
@@ -0,0 +1,1004 @@
+.ig
+//=============================================================================
+//
+// Manual page for `dumpkeymap'.
+//
+// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.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.
+// 3. 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.
+//
+//=============================================================================
+//
+// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man,v 1.2 2000/12/05 21:18:34 dawes Exp $
+//
+..
+.ig
+//-----------------------------------------------------------------------------
+// Local identification information.
+//-----------------------------------------------------------------------------
+..
+.nr VE 4 \" Version number
+.TH DUMPKEYMAP 1 "v\n(VE \-\- 1 December 2000" "Version \n(VE"
+.de UP
+1 December 2000
+..
+.ig
+//-----------------------------------------------------------------------------
+// Annotation Macros
+// -----------------
+// Facilitate creation of annotated, non-filled blocks of text. An
+// annotated block is initiated with the `AS' macro. Each annotated,
+// non-filled line within the block must be introduced with the `AN' macro
+// which takes three arguments. The first argument is the detail text to
+// be annotated. The second is a string of spaces used to align the
+// annotations by certain (broken) roff interpreters which fail to
+// implement the proper set of roff commands (such as diversions,
+// indentation, and tab stops). It is assumed that the spaces will be
+// used with fixed-point font. The third argument is the annotation
+// itself. The block should be terminated with the `AE' macro. For all
+// roff interpreters which properly implement diversions, indentation, and
+// tab stops, all anotations within the block are automatically aligned at
+// the same horizontal position. This position is guaranteed to be just
+// to the right of the widest `AN' detail line. For broken roff
+// interpreters, such as `rman', the string of spaces from the second
+// argument are used to align the annotations. Finally, the `AZ' macro,
+// which takes a single argument, can be used to to insert a non-annotated
+// line into the block which does not play a part in the calculation of
+// the horizontal annotation alignment.
+//
+// Implementation Notes
+// --------------------
+// *1* These macros utilize a diversion (named `AD'). Since the prevailing
+// indentation is stored along with the diverted text, we must muck with
+// the indentation level in order to prevent the indentation from being
+// applied to the text a second time when `AD' is finally emitted.
+//
+// *2* Unfortunately, `.if' strips leading whitespace from following text, so
+// `AN' uses \& to preserve the whitespace.
+//
+// *3* This manual page has been tested for proper formatting with troff,
+// groff, nroff and rman (the `man' to `HTML' converter). Unfortunately,
+// rman fails to implement many useful features such as diversions,
+// indentation, and tab stops, and is also hideously buggy. Furthermore
+// it identifies itself as nroff and fails to provide any further
+// identification, so there is no way to create macros which specifically
+// work around its limitations. Following is a list of several bugs in
+// rman which the implementation of these macros must avoid:
+// o Fails with multi-line conditionals within macros.
+// o Fails on macro definition within multi-line conditionals.
+// o Fails when macro arguments are not delimited by exactly 1 space.
+// o String definition `.ds' ignores the value; uses empty "" instead.
+// As a consequence of these problems, the following macros are written
+// using a series of ugly single-line `.if' conditionals rather than the
+// more natural multi-line `.if' and `.ie' conditionals. Also, rman fails
+// to understand the common idiom of `.\"' to introduce a comment, which
+// is why all comments in this file are wrapped in ignore `.ig' blocks.
+//-----------------------------------------------------------------------------
+..
+.de AS
+.if t .nr AW 0
+.if t .nr AI \\n(.i
+.if t .in -\\n(AI
+.nf
+..
+.de AN
+.if t .if \w'\\$1'>\\n(AW .nr AW \w'\\$1'
+.if t .da AD
+.if t \\&\\$1\\t\\$3
+.if t .da
+.if n \\&\\$1 \\$2\\$3
+..
+.de AZ
+.if t .da AD
+\\$1
+.if t .da
+..
+.de AE
+.if t .in +\\n(AIu
+.if t .if \\n(AW .ta \\n(AWu+\w'\\(em'u
+.if t .AD
+.if t .DT
+.if t .rm AD
+.if t .rm AW
+.fi
+..
+.ig
+//-----------------------------------------------------------------------------
+// Bulleted list macros -- `BG' begins a bulleted list; `BU' delimits
+// bulleted entries; `BE' ends a bulleted list.
+//-----------------------------------------------------------------------------
+..
+.de BG
+.PP
+.RS
+..
+.de BU
+.HP
+\\(bu\\ \\c
+..
+.de BE
+.RE
+.PP
+..
+.ig
+//-----------------------------------------------------------------------------
+// Indented paragraph with stylized hanging tag macro. `TG' takes a single
+// argument and treats it as the hanging tag of the indented paragraph.
+// The tag is italicized in troff but not in nroff.
+//-----------------------------------------------------------------------------
+..
+.de TG
+.TP
+.ie t .I "\\$1"
+.el \\$1
+..
+.ig
+//-----------------------------------------------------------------------------
+// Manual page for `dumpkeymap'.
+//-----------------------------------------------------------------------------
+..
+.SH NAME
+dumpkeymap \- Dianostic dump of a .keymapping file
+.SH SYNOPSIS
+.B dumpkeymap
+.RI [ options "] [-] [" file "...]"
+.SH DESCRIPTION
+.I dumpkeymap
+prints a textual representation of each Apple/\c
+.SM NeXT
+.I .keymapping
+file mentioned on the command-line. If no files are mentioned and if the
+local machine is an Apple or
+.SM NeXT
+installation, then the key mapping currently in use by the WindowServer and the
+AppKit is printed instead.
+.SH OPTIONS
+.TP
+.B "\-h \-\^\-help"
+Display general program instructions and option summary.
+.TP
+.B "\-k \-\^\-help\-keymapping"
+Display a detailed description of the internal layout of a
+.I .keymapping
+file. This is the same information as that presented in the
+.I "Key Mapping Description"
+section of this document.
+.TP
+.B "\-o \-\^\-help\-output"
+Display an explanation of the output generated by
+.I dumpkeymap
+when dissecting a
+.I .keymapping
+file. This is the same information as that presented in the
+.I "Output Description"
+section of this document.
+.TP
+.B "\-f \-\^\-help\-files"
+Display a summary of the various files and directories which are related to
+key mappings. This is the same information as that presented in the
+.I "Files"
+section of this document.
+.TP
+.B "\-d \-\^\-help\-diagnostics"
+Display a list of the various diagnostic messages which may be emitted by
+.I dumpkeymap.
+This is the same information as that presented in the
+.I "Diagnostics"
+section of this document.
+.TP
+.B "\-v \-\^\-version"
+Display the
+.I dumpkeymap
+version number and warranty information.
+.TP
+.B "\- \-\^\-"
+Inhibit processing of options at this point in the argument list. An
+occurrence of `\-' or `\-\^\-' in the argument list causes all following
+arguments to be treated as file names even if an argument begins with a `\-'
+character.
+.SH "KEY MAPPING DESCRIPTION"
+The following sections describe, in complete detail, the format of a raw key
+mapping resource, as well as the format of the
+.I .keymapping
+file which encapsulates one or more raw mappings.
+.SH "Types and Data"
+The following type definitions are employed throughout this discussion:
+.PP
+.RS
+.AS
+.AZ "typedef unsigned char byte;"
+.AZ "typedef unsigned short word;"
+.AZ "typedef unsigned long dword;"
+.AE
+.RE
+.PP
+Additionally, the type definition
+.RI ` number '
+is used generically to
+indicate a numeric value. The actual size of the
+.RI ` number '
+type may be one or two bytes depending upon how the data is stored in the key
+map. Although most key maps use byte-sized numeric values, word-sized values
+are also allowed.
+.PP
+Multi-byte values in a key mapping file are stored in big-endian byte order.
+.SH "Key Mapping File and Device Mapping"
+A key mapping file begins with a magic-number and continues with a
+variable number of device-specific key mappings.
+.PP
+.RS
+.AS
+.AZ "struct KeyMappingFile {"
+.AN " char magic_number[4];" " " "// `KYM1'"
+.AN " DeviceMapping maps[...];" "" "// Variable number of maps"
+.AZ };
+.AE
+.PP
+.AS
+.AZ "struct DeviceMapping {"
+.AN " dword interface;" " " "// Interface type"
+.AN " dword handler_id;" "" "// Interface subtype"
+.AN " dword map_size;" " " "// Byte count of `map' (below)"
+.AN " KeyMapping map;"
+.AZ };
+.AE
+.RE
+.PP
+The value of `interface' represents a family of keyboard device types
+(such as Intel
+.SM "PC, ADB, NeXT,"
+Sun Type5, etc.), and is generally specified as one of the constant values
+.SM "NX_EVS_DEVICE_INTERFACE_ADB, NX_EVS_DEVICE_INTERFACE_ACE,"
+etc., which are are defined in IOHIDTypes.h on MacOS/X and Darwin, and in
+ev_types.h on MacOS/X Server, OpenStep, and NextStep.
+.PP
+The value of `handler_id' represents a specific keyboard layout within the
+much broader `interface' family. For instance, for a 101-key Intel
+.SM PC
+keyboard (of type
+.SM NX_EVS_DEVICE_INTERFACE_ACE\c
+) the `handler_id' is '0', whereas for a 102-key keyboard it is `1'.
+.PP
+Together, `interface' and `handler_id' identify the exact keyboard hardware to
+which this mapping applies. Programs which display a visual representation of
+a keyboard layout, match `interface' and `handler_id' from the
+.I .keymapping
+file against the `interface' and `handler_id' values found in each
+.I .keyboard
+file.
+.SH "Key Mapping"
+A key mapping completely defines the relationship of all scan codes with their
+associated functionality. A
+.I KeyMapping
+structure is embedded within the
+.I DeviceMapping
+structure in a
+.IR KeyMappingFile .
+The key mapping currently in use by the WindowServer and AppKit is also
+represented by a
+.I KeyMapping
+structure, and can be referred to directly by calling NXGetKeyMapping() and
+accessing the `mapping' data member of the returned
+.I NXKeyMapping
+structure.
+.PP
+.RS
+.AS
+.AZ "struct KeyMapping {"
+.AN " word number_size;" " " "// 0=1 byte, non-zero=2 bytes"
+.AN " number num_modifier_groups;" "" "// Modifier groups"
+.AZ " ModifierGroup modifier_groups[...];"
+.AN " number num_scan_codes;" " " "// Scan groups"
+.AN " ScanGroup scan_table[...];"
+.AN " number num_sequence_lists;" " " "// Sequence lists"
+.AN " Sequence sequence_lists[...];"
+.AN " number num_special_keys;" " " "// Special keys"
+.AN " SpecialKey special_key[...];"
+.AZ };
+.AE
+.RE
+.PP
+The `number_size' flag determines the size, in bytes, of all remaining numeric
+values (denoted by the type definition
+.RI ` number ')
+within the
+key mapping. If its value is zero, then numbers are represented by a single
+byte. If it is non-zero, then numbers are represented by a word (two bytes).
+.SH "Modifier Group"
+A modifier group defines all scan codes which map to a particular type of
+modifier, such as
+.IR shift ,
+.IR control ,
+etc.
+.PP
+.RS
+.AS
+.AZ "enum Modifier {"
+.AZ " ALPHALOCK = 0,"
+.AZ " SHIFT,"
+.AZ " CONTROL,"
+.AZ " ALTERNATE,"
+.AZ " COMMAND,"
+.AZ " KEYPAD,"
+.AZ " HELP"
+.AZ };
+.AE
+.PP
+.AS
+.AZ "struct ModifierGroup {"
+.AN " number modifier;" " " "// A Modifier constant"
+.AN " number num_scan_codes;"
+.AN " number scan_codes[...];" "" "// Variable number of scan codes"
+.AZ };
+.AE
+.RE
+.PP
+The scan_codes[] array contains a list of all scan codes which map to the
+specified modifier. The
+.IR shift ", " command ", and " alternate
+modifiers are frequently mapped to two different scan codes, apiece,
+since these modifiers often appear on both the left and right sides of
+the keyboard.
+.SH "Scan Group"
+There is one
+.I ScanGroup
+for each scan code generated by the given keyboard. This number is given by
+KeyMapping::num_scan_codes. The first scan group represents hardware scan
+code 0, the second represents scan code 1, etc.
+.PP
+.RS
+.AS
+.AZ "enum ModifierMask {"
+.AN " ALPHALOCK_MASK" " " "= 1 << 0,"
+.AN " SHIFT_MASK" " " "= 1 << 1,"
+.AN " CONTROL_MASK" " " "= 1 << 2,"
+.AN " ALTERNATE_MASK" " " "= 1 << 3,"
+.AN " CARRIAGE_RETURN_MASK" "" "= 1 << 4"
+.AZ };
+.AZ "#define NOT_BOUND 0xff"
+.AE
+.PP
+.AS
+.AZ "struct ScanGroup {"
+.AN " number mask;"
+.AN " Character characters[...];"
+.AZ };
+.AE
+.RE
+.PP
+For each scan code, `mask' defines which modifier combinations generate
+characters. If `mask' is
+.SM NOT_BOUND
+(0xff) then then this scan code does not generate any characters ever, and its
+characters[] array is zero length. Otherwise, the characters[] array contains
+one
+.I Character
+record for each modifier combination.
+.PP
+The number of records in characters[] is determined by computing (1 <<
+bits_set_in_mask). In other words, if mask is zero, then zero bits are set,
+so characters[] contains only one record. If `mask' is
+.SM "(SHIFT_MASK | CONTROL_MASK),"
+then two bits are set, so characters[] contains four records.
+.PP
+The first record always represents the character which is generated by that
+key when no modifiers are active. The remaining records represent characters
+generated by the various modifier combinations. Using the example with the
+.I shift
+and
+.I control
+masks set, record two would represent the character with the
+.I shift
+modifier active; record three, the
+.I control
+modifier active; and record four, both the
+.I shift
+and
+.I control
+modifiers active.
+.PP
+As a special case,
+.SM ALPHALOCK_MASK
+implies
+.SM SHIFT_MASK,
+though only
+.SM ALPHALOCK_MASK
+appears in `mask'. In this case the same character is generated for both the
+.I shift
+and
+.I alpha-lock
+modifiers, but only needs to appear once in the characters[] array.
+.PP
+.SM CARRIAGE_RETURN_MASK
+does not actually refer to a modifier key. Instead, it is used to
+distinguish the scan code which is given the special pseudo-designation of
+.I "carriage return"
+key. Typically, this mask appears solo in a
+.I ScanGroup
+record and only the two
+.I Character
+records for control-M and control-C follow. This flag may be a throwback to
+an earlier time or may be specially interpreted by the low-level keyboard
+driver, but its purpose is otherwise enigmatic.
+.SH Character
+Each
+.I Character
+record indicates the character generated when this key is pressed, as well as
+the character set which contains the character. Well known character sets are
+.SM `ASCII'
+and `Symbol'. The character set can also be one of the meta values
+.SM FUNCTION_KEY
+or
+.SM KEY_SEQUENCE.
+If it is
+.SM FUNCTION_KEY
+then `char_code' represents a generally well-known function key such as those
+enumerated by
+.I FunctionKey.
+If the character set is
+.SM KEY_SEQUENCE
+then `char_code' represents is a zero-base index into
+KeyMapping::sequence_lists[].
+.PP
+.RS
+.AS
+.AZ "enum CharacterSet {"
+.AN " ASCII" " " "= 0x00,"
+.AN " SYMBOL" " " "= 0x01,"
+.AN " ..."
+.AN " FUNCTION_KEY" "" "= 0xfe,"
+.AN " KEY_SEQUENCE" "" "= 0xff"
+.AZ };
+.AE
+.PP
+.AS
+.AZ "struct Character {"
+.AN " number set;" " " "// CharacterSet of generated character"
+.AN " number char_code;" "" "// Actual character generated"
+.AZ };
+.AE
+.PP
+.AS
+.AZ "enum FunctionKey {"
+.AZ " F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,"
+.AZ " INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN,"
+.AZ " SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU,"
+.AZ " USER, SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE,"
+.AZ " DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT"
+.AZ };
+.AE
+.RE
+.SH Sequence
+When Character::set contains the meta value
+.SM KEY_SEQUENCE,
+the scan code is bound to a sequence of keys rather than a single character.
+A sequence is a series of modifiers and characters which are automatically
+generated when the associated key is depressed.
+.PP
+.RS
+.AS
+.AZ "#define MODIFIER_KEY 0xff"
+.AE
+.PP
+.AS
+.AZ "struct Sequence {"
+.AN " number num_chars;"
+.AN " Character characters[...];"
+.AZ };
+.AE
+.RE
+.PP
+Each generated
+.I Character
+is represented as previously described, with the exception that
+.SM MODIFIER_KEY
+may appear in place of
+.SM KEY_SEQUENCE.
+When the value of Character::set is
+.SM MODIFIER_KEY
+then Character::char_code represents a modifier key rather than an actual
+character. If the modifier represented by `char_code' is non-zero, then it
+indicates that the associated modifier key has been depressed. In this case,
+the value is one of the constants enumerated by
+.I Modifier
+(\c
+.SM "SHIFT, CONTROL, ALTERNATE,"
+etc.). If the value is zero then it means that the modifier keys have been
+released.
+.SH "Special Key"
+A special key is one which is scanned directly by the Mach kernel rather than
+by the WindowServer. In general, events are not generated for special keys.
+.PP
+.RS
+.AS
+.AZ "enum SpecialKeyType {"
+.AZ " VOLUME_UP = 0,"
+.AZ " VOLUME_DOWN,"
+.AZ " BRIGHTNESS_UP,"
+.AZ " BRIGHTNESS_DOWN,"
+.AZ " ALPHA_LOCK,"
+.AZ " HELP,"
+.AZ " POWER,"
+.AZ " SECONDARY_ARROW_UP,"
+.AZ " SECONDARY_ARROW_DOWN"
+.AZ };
+.AE
+.PP
+.AS
+.AZ "struct SpecialKey {"
+.AN " number type;" " " "// A SpecialKeyType constant"
+.AN " number scan_code;" "" "// Actual scan code"
+.AZ };
+.AE
+.RE
+.SH OUTPUT
+What follows is an explanation and description of the various pieces of
+information emitted by
+.I dumpkeymap.
+.PP
+For a more thorough discussion of any particular piece of information described
+here, refer to the detailed description of the internal layout of a key mapping
+provided by the
+.I "Key Mapping Description"
+section above.
+.SH Conventions
+Depending upon context, some numeric values are displayed in decimal
+notation, whereas others are displayed in hexadecimal notation.
+Hexadecimal numbers are denoted by a `0x' prefix (for instance, `0x7b'),
+except when explicitly noted otherwise.
+.SH "Key Mapping Source"
+The first piece of information presented about a particular key mapping is the
+source from which the data was gleaned. For a
+.I .keymapping
+file, the title
+.SM "`KEYMAP FILE'"
+is emitted along with the path and name of the file in question. For the key
+mapping currently in use by the WindowServer and AppKit, the title
+.SM "`ACTIVE KEYMAP'"
+is emitted instead.
+.SH "Device Information"
+Each
+.I .keymapping
+file may contain one or more raw key mappings. For example, a file which maps
+keys to a Dvorak-style layout might contain raw mappings for Intel
+.SM "PC, ADB, NeXT,"
+and Sun Type5 keyboards.
+.PP
+For each raw mapping, the following information is emitted:
+.BG
+.BU
+The title
+.SM `KEYMAP'
+along with the mapping's relative position in the
+.I .keymapping
+file.
+.BU
+The `interface' identifier.
+.BU
+The `handler_id' sub-identifier.
+.BU
+The size of the raw mapping resource counted in bytes.
+.BE
+The `interface' and `handler_id' values, taken together, define a specific
+keyboard device. A
+.I .keyboard
+file, which describes the visual layout of a keyboard, also contains
+`interface' and `handler_id' identifiers. The
+.I .keyboard
+file corresponding to a particular key mapping can be found by matching the
+`interface' and `handler_id' values from each resource.
+.SH Modifiers
+Each mapping may contain zero or more modifier records which associate hardware
+scan codes with modifier descriptions such as
+.I "shift, control, alternate,"
+etc. The title
+.SM `MODIFIERS'
+is printed along with the count of modifier records which follow. For each
+modifier record, the modifier's name is printed along with a list of scan
+codes, in hexadecimal format, which generate that modifier value. For example:
+.PP
+.RS
+.nf
+MODIFIERS [4]
+alternate: 0x1d 0x60
+control: 0x3a
+keypad: 0x52 0x53 ... 0x63 0x62
+shift: 0x2a 0x36
+.fi
+.RE
+.SH Characters
+Each mapping may contain zero or more character records which associate
+hardware scan codes with the actual characters generated by those scan
+codes in the presence or absence of various modifier combinations. The
+title
+.SM `CHARACTERS'
+is printed along with the count of character records which follow. Here is a
+highly abbreviated example:
+.PP
+.RS
+.nf
+CHARACTERS [9]
+scan 0x00: -AC-L "a" "A" "^A" "^A" ca c7 "^A" "^A"
+scan 0x07: -AC-L "x" "X" "^X" "^X" 01/b4 01/ce "^X" "^X"
+scan 0x0a: ---S- "<" ">"
+scan 0x13: -ACS- "2" "@" "^@" "^@" b2 b3 "^@" "^@"
+scan 0x24: R---- "^M" "^C"
+scan 0x3e: ----- [F4]
+scan 0x4a: ----- [page up]
+scan 0x60: ----- {seq#3}
+scan 0x68: not-bound
+.fi
+.RE
+.PP
+For each record, the hexadecimal value of the hardware scan code is printed,
+followed by a list of modifier flag combinations and the actual characters
+generated by this scan code with and without modifiers applied.
+.PP
+The modifier flags field is composed of a combination of single letter
+representations of the various modifier types. The letters stand for:
+.PP
+.RS
+.nf
+L \- alpha-lock
+S \- shift
+C \- control
+A \- alternate
+R \- carriage-return
+.fi
+.RE
+.PP
+As a special case, the
+.I alpha-lock
+flag also implies the
+.I shift
+flag, so these two flags never appear together in the same record.
+.PP
+The combination of modifier flags determines the meaning and number of fields
+which follow. The first field after the modifier flags always represents the
+character that will be generated if no modifier keys are depressed. The
+remaining fields represent characters generated by the various modifier
+combinations. The order of the fields follows this general pattern:
+.BG
+.BU
+The character generated by this scan code when no modifiers are in effect is
+listed first.
+.BU
+If the `L' or `S' flag is active, then the shifted character generated by this
+scan code is listed next.
+.BU
+If the `C' flag is active, then the control-character generated by this scan
+code is listed next. Furthermore, if the `L' or `S' flag is also active, then
+the shifted control-character is listed after that.
+.BU
+If the `A' flag is active, then the alternate-character generated by this scan
+code is listed next. Furthermore, if the `L' or `S' flag is active, then the
+shifted alternate-character is listed after that. If the `C' flag is also
+active, then the alternate-control-character is listed next. Finally, if the
+`C' and `L' or `C' and `S' flags are also active, then the shifted
+alternate-control-character is listed.
+.BE
+The `R' flag does not actually refer to a modifier key. Instead, it is used to
+distinguish the scan code which is given the special pseudo-designation of
+.I "carriage return"
+key. Typically, this mask appears solo and only the two fields for control-M
+and control-C follow. This flag may be a throwback to an earlier time or may
+be specially interpreted by the low-level keyboard driver, but its purpose is
+otherwise enigmatic.
+.PP
+Recalling the example from above, the following fields can be identified:
+.PP
+.RS
+.nf
+scan 0x00: -AC-L "a" "A" "^A" "^A" ca c7 "^A" "^A"
+.fi
+.RE
+.BG
+.BU
+Lower-case `a' is generated when no modifiers are active.
+.BU
+Upper-case `A' is generated when
+.IR shift " or " alpha-lock
+are active.
+.BU
+Control-A is generated when
+.I control
+is active.
+.BU
+Control-A is generated when
+.IR control " and " shift
+are active.
+.BU
+The character represented by the hexadecimal code 0xca is generated when
+.I alternate
+is active.
+.BU
+The character represented by 0xc7 is generated when
+.IR alternate " and " shift " (or " alpha-lock ") are active."
+.BU
+Control-A is generated when
+.IR alternate " and " control
+are active.
+.BU
+Control-A is generated when
+.IR "alternate, control" " and " shift " (or " alpha-lock ") are active."
+.BE
+The notation used to represent a particular generated character varies.
+.BG
+.BU
+Printable
+.SM ASCII
+characters are quoted, as in "x" or "X".
+.BU
+Control-characters are quoted and prefixed with `^', as in "^X".
+.BU
+Characters with values greater than 127 (0x7f) are displayed as hexadecimal
+values without the `0x' prefix.
+.BU
+Characters in a non-\c
+.SM ASCII
+character set (such as `Symbol') are displayed as two hexadecimal numbers
+separated by a slash, as in `01/4a'. The first number is the character set's
+identification code (such as `01' for the `Symbol' set), and the second number
+is the value of the generated character.
+.BU
+Non-printing special function characters are displayed with the function's
+common name enclosed in brackets, as in `[page up]' or `[F4]'.
+.BU
+If the binding represents a key sequence rather than a single character, then
+the sequence's identification number is enclosed in braces, as in `{seq#3}'.
+.BE
+Recalling a few examples from above, the following interpretations can be made:
+.PP
+.RS
+.nf
+scan 0x07: -AC-L "x" "X" "^X" "^X" 01/b4 01/ce "^X" "^X"
+scan 0x3e: ----- [F4]
+scan 0x4a: ----- [page up]
+scan 0x60: ----- {seq#3}
+.fi
+.RE
+.BG
+.BU
+"x" and "X" are printable
+.SM ASCII
+characters.
+.BU
+"^X" is a control-character.
+.BU
+`01/b4' and `01/ce' represent the character codes 0xb4 and 0xce in the `Symbol'
+character set.
+.BU
+Scan code 0x3e generates function-key `F4', and scan code 0x4a generates
+function-key `page up'.
+.BU
+Scan code 0x60 is bound to key sequence #3.
+.BE
+Finally, if a scan code is not bound to any characters, then it is annotated
+with the label `not-bound', as with example scan code 0x68 from above.
+.SH Sequences
+A scan code (modified and unmodified) can be bound to a key sequence rather
+than generating a single character or acting as a modifier. When it is bound
+to a key sequence, a series of character invocations and modifier actions are
+automatically generated rather than a single keystroke.
+.PP
+Each mapping may contain zero or more key sequence records. The title
+.SM `SEQUENCES'
+is printed along with the count of sequence records which follow. For example:
+.PP
+.RS
+.nf
+SEQUENCES [3]
+sequence 0: "f" "o" "o"
+sequence 1: {alternate} "b" "a" "r" {unmodify}
+sequence 2: [home] "b" "a" "z"
+.fi
+.RE
+.PP
+The notation used to represent the sequence of generated characters is
+identical to the notation already described in the
+.I Characters
+section above, with the exception that modifier actions may be interposed
+between generated characters. Such modifier actions are represented by the
+modifier's name enclosed in braces. The special name `{unmodify}' indicates
+the release of the modifier keys.
+.PP
+Thus, the sequences in the above example can be interpreted as follows:
+.BG
+.BU
+Sequence\ #0 generates `foo'.
+.BU
+Sequence\ #1 invokes the
+.I alternate
+modifier, generates `bar', and then releases
+.I alternate.
+.BU
+Sequence\ #2 invokes the
+.I home
+key and then generates `baz'. In a text editor, this would probably result in
+`baz' being prepended to the line of text on which the cursor resides.
+.BE
+.SH Special Keys
+Certain keyboards feature keys which perform some type of special purpose
+function rather than generating a character or acting as a modifier. For
+instance, Apple keyboards often contain a
+.I power
+key, and
+.SM NeXT
+keyboards have historically featured screen brightness and volume control keys.
+.PP
+Each mapping may contain zero or more special-key records which associate
+hardware scan codes with such special purpose functions. The title
+.SM `SPECIALS'
+is printed along with the count of records which follow. For each record, the
+special function's name is printed along with a list of scan codes, in
+hexadecimal format, which are bound to that function. For example:
+.PP
+.RS
+.nf
+SPECIALS [6]
+alpha-lock: 0x39
+brightness-down: 0x79
+brightness-up: 0x74
+power: 0x7f
+sound-down: 0x77
+sound-up: 0x73
+.fi
+.RE
+.SH FILES
+.IP *.keymapping
+A key mapping file which precisely defines the relationship of all
+hardware-specific keyboard scan-codes with their associated functionality.
+.IP *.keyboard
+A file describing the physical layout of keys on a particular type of
+keyboard. Each `key' token in this file defines the position and shape of the
+key on the keyboard, as well as the associated scan code which that key
+generates. A
+.I .keymapping
+file, on the other hand, defines the characters which are generated by a
+particular scan code depending upon the state of the various modifier keys
+(such as
+.I shift,
+.I control,
+etc.). The `interface' and `handler_id' values from a
+.I .keymapping
+file are matched against those in each
+.I .keyboard
+file in order to associate a particular
+.I .keyboard
+file with a key mapping. Various
+.SM GUI
+programs use the
+.I .keyboard
+file to display a visual representation of a keyboard for the user. Since
+these files are just plain text, they can be easily viewed and interpreted
+without the aid of a specialized program, thus
+.I dumpkeymap
+leaves these files alone.
+.PP
+/System/Library/Keyboards
+.br
+/Network/Library/Keyboards
+.br
+/Local/Library/Keyboards
+.br
+/Library/Keyboards
+.RS
+Repositories for
+.I .keymapping
+and
+.I .keyboard
+files for MacOS/X, Darwin, and MacOS/X Server.
+.RE
+.PP
+/NextLibrary/Keyboards
+.br
+/LocalLibrary/Keyboards
+.RS
+Repositories for
+.I .keymapping
+and
+.I .keyboard
+files for OpenStep and NextStep.
+.RE
+.IP $(HOME)/Library/Keyboards
+Repository for personal
+.I .keymapping
+and
+.I .keyboard
+files.
+.SH DIGANOSTICS
+The following diagnostic messages may be issued to the standard error stream.
+.TG "Unrecognized option."
+An unrecognized option was specified on the command-line. Invoke
+.I dumpkeymap
+with the
+.B "\-\^\-help"
+option to view a list of valid options.
+.TG "Insufficient data in keymapping data stream."
+The key mapping file or data stream is corrupt. Either the file has been
+incorrectly truncated or a field, such as those which indicates the number of
+variable records which follow, contains a corrupt value.
+.PP
+The following diagnostic messages have significance only when trying to print
+.I .keymapping
+files mentioned on the command-line.
+.TG "Bad magic number."
+The mentioned file is not a
+.I .keymapping
+file. The file's content does not start with the string `KYM1'.
+.TG "Unable to open key mapping file."
+The call to fopen() failed; probably because the specified path is invalid or
+.I dumpkeymap
+does not have permission to read the file.
+.TG "Unable to determine key mapping file size."
+The call to fstat() failed, thus memory can not be allocated for loading the
+file.
+.TG "Unable to read key mapping file."
+The call to fread() failed.
+.PP
+The following diagnostic messages have significance only when trying to print
+the currently active key mapping when no
+.I .keymapping
+files have been mentioned on the command-line.
+.TG "Unable to open event status driver."
+The call to NXOpenEventStatus() failed.
+.TG "Bad key mapping length."
+The call to NXKeyMappingLength() returned a bogus value.
+.TG "Unable to get current key mapping."
+The call to NXGetKeyMapping() failed.
+.PP
+The following diagnostic messages have significance only when using
+.I dumpkeymap
+on a non-Apple/\c
+.SM NeXT
+platform.
+.TG "Must specify at least one .keymapping file."
+No
+.I .keymapping
+files were mentioned on the command-line. On non-Apple/\c
+.SM NeXT
+platforms, there is no concept of a currently active
+.I .keymapping
+file, so at least one file must be mentioned on the command-line.
+.SH AUTHOR
+Eric Sunshine <sunshine@sunshineco.com> wrote
+.I dumpkeymap
+and this document, the
+.I "dumpkeymap user's manual."
+Both
+.I dumpkeymap
+and this document are copyright \(co1999,2000 by Eric Sunshine
+<sunshine@sunshineco.com>. All rights reserved.
+.PP
+The implementation of
+.I dumpkeymap
+is based upon information gathered on September 3, 1997 by Eric Sunshine
+<sunshine@sunshineco.com> and Paul S. McCarthy <zarnuk@zarnuk.com> during an
+effort to reverse engineer the format of the
+.SM NeXT
+.I .keymapping
+file.
+.if n .PP
+.if n Version \n(VE \-\-
+.if n .UP
diff --git a/hw/xfree86/Options b/hw/xfree86/Options
new file mode 100644
index 000000000..c963cd3ce
--- /dev/null
+++ b/hw/xfree86/Options
@@ -0,0 +1,409 @@
+!!
+!! Copyright (c) 2001 by The XFree86 Project, 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
+!! THE XFREE86 PROJECT 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.
+!!
+!! Except as contained in this notice, the name of the XFree86 Project shall
+!! not be used in advertising or otherwise to promote the sale, use or other
+!! dealings in this Software without prior written authorization from the
+!! XFree86 Project.
+!!
+!! $XFree86: xc/programs/Xserver/hw/xfree86/Options,v 1.10 2003/02/15 06:46:30 paulo Exp $
+
+!! XAA options
+xaa.XaaNoCPUToScreenColorExpandFill:\
+Disables accelerated rectangular expansion blits from source patterns \
+stored in system memory (using a memory-mapped aperture).
+
+xaa.XaaNoColor8x8PatternFillRect:\
+Disables accelerated fills of a rectangular region with a full-color pattern.
+
+xaa.XaaNoColor8x8PatternFillTrap:\
+Disables accelerated fills of a trapezoidal region with a full-color pattern.
+
+xaa.XaaNoDashedBresenhamLine:\
+Disables accelerated dashed Bresenham line draws.
+
+xaa.XaaNoDashedTwoPointLine:\
+Disables accelerated dashed line draws between two arbitrary points.
+
+xaa.XaaNoImageWriteRect:\
+Disables acclerated transfers of full-color rectangular patterns from \
+system memory to video memory (using a memory-mapped aperture).
+
+xaa.XaaNoMono8x8PatternFillRect:\
+Disables accelerated fills of a rectangular region with a monochrome pattern.
+
+xaa.XaaNoMono8x8PatternFillTrap:\
+Disables accelerated fills of a trapezoidal region with a monochrome pattern.
+
+xaa.XaaNoOffscreenPixmaps:\
+Disables accelerated draws into pixmaps stored in offscreen video memory.
+
+xaa.XaaNoPixmapCache:\
+Disables caching of patterns in offscreen video memory.
+
+xaa.XaaNoScanlineCPUToScreenColorExpandFill:\
+Disables accelerated rectangular expansion blits from source patterns \
+stored in system memory (one scan line at a time).
+
+xaa.XaaNoScanlineImageWriteRect:\
+Disables accelerated transfers of full-color rectangular patterns from \
+system memory to video memory (one scan line at a time).
+
+xaa.XaaNoScreenToScreenColorExpandFill:\
+Disables accelerated rectangular expansion blits from source patterns \
+stored in off-screen video memory.
+
+xaa.XaaNoScreenToScreenCopy:\
+Disables accelerated copies of rectangular regions from one part of video \
+memory to another part of video memory.
+
+xaa.XaaNoSolidBresenhamLine:\
+Disables accelerated solid Bresenham line draws.
+
+xaa.XaaNoSolidFillRect:\
+Disables accelerated solid-color fills of rectangles.
+
+xaa.XaaNoSolidFillTrap:\
+Disables accelerated solid-color fills of Bresenham trapezoids.
+
+xaa.XaaNoSolidHorVertLine:\
+Disables accelerated solid horizontal and vertical line draws.
+
+xaa.XaaNoSolidTwoPointLine:\
+Disables accelerated solid line draws between two arbitrary points.
+
+
+!! DDC Options
+ddc.NoDDC:\
+Disables DDC (Display Data Channel) so that the Xserver doesn't try to talk to\
+the Monitor. \
+Default: off, implies DDC is used.
+
+ddc.NoDDC1:\
+Disables use of DDC version 1 (DDC using vertical refresh). \
+Default: off, implies DDC1 is used.
+
+ddc.NoDDC2:\
+Disables use of DDC version 2 (DDC using I2C - usually over vga connector). \
+Default: off, implies DDC2 is used.
+
+
+!! FBDev options
+fbdev.fbdev:\
+The framebuffer device to use. \
+Default: /dev/fb0.
+
+fbdev.ShadowFB:\
+Enable or disable use of the shadow framebuffer layer. \
+Default: on.
+
+fbdev.Rotate:\
+Enable rotation of the display. The supported values are "CW" (clockwise, \
+90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise, \
+270 degrees). Implies use of the shadow framebuffer layer. \
+Default: off.
+
+
+!! MGA options
+mga.ColorKey:\
+Set the colormap index used for the transparency key for the depth 8 plane \
+when operating in 8+24 overlay mode. The value must be in the range 2-255. \
+Default: 255.
+
+!mga.HWcursor:\
+!Enable or disable the HW cursor. Default: on.
+
+mga.MGASDRAM:\
+Specify whether G100, G200 or G400 cards have SDRAM. The driver attempts to \
+auto-detect this based on the card's PCI subsystem ID. This option may be \
+used to override that auto-detection. The mga driver is not able to \
+auto-detect the presence of of SDRAM on secondary heads in multihead \
+configurations so this option will often need to be specified in multihead \
+configurations. Default: auto-detected.
+
+mga.NoAccel:\
+Disable or enable 2D hardware acceleration. Default: acceleration is enabled.
+
+mga.OverclockMem:\
+Set clocks to values used by some commercial X-Servers (G100, G200 and \
+G400 only). Default: off.
+
+mga.Overlay:\
+Enable 8+24 overlay mode. Only appropriate for depth 24. (Note: the G100 is \
+unaccelerated in the 8+24 overlay mode due to a missing hardware feature). \
+Default: off.
+
+mga.PciRetry:\
+Enable or disable PCI retries. Default: off.
+
+mga.Rotate:\
+Rotate the display clockwise or counterclockwise. This mode is unaccelerated. \
+Default: no rotation.
+
+mga.ShadowFB:\
+Enable or disable use of the shadow framebuffer layer. Default: off. \
+
+mga.SyncOnGreen:\
+Enable or disable combining the sync signals with the green signal. \
+Default: off.
+
+mga.UseFBDev:\
+Enable or disable use of on OS-specific fb interface (and is not supported \
+on all OSs). See fbdevhw(4) for further information. Default: off.
+
+mga.VideoKey:\
+This sets the default pixel value for the YUV video overlay key. \
+Default: undefined.
+
+mga.TexturedVideo:\
+This has XvImage support use the texture engine rather than the video \
+overlay. This option is only supported by the G200 and G400, and only in \
+16 and 32 bits per pixel. Default: off.
+
+mga.NoHal:\
+Matrox provides a "Hardware Abstraction Layer", \
+a separate binary which enables extra hardware features from G400 onwards. \
+Default: HAL is used.
+
+!mga.DigitalScreen:\
+! Option Ignored. Drivers auto-detect Digital output if they support it at all.
+!Default: Auto-detected.
+
+! mga.TV:\
+! Option Ignored. Drivers auto-detect TV if they support TV out at all.
+!Default: Auto-detected.
+
+mga.TVStandard:\
+(HAL only) Picture standard for TV out. Use "PAL" for 50Hz PAL. \
+Default: 60Hz NTSC.
+
+mga.CableType:\
+(HAL only) Set the cable type for TV out. Options are "SCART_RGB", \
+"SCART_COMPOSITE", or "SCART_TYPE2". Any other string enables the default. \
+Default: YC_COMPOSITE.
+
+mga.SwappedHead:\
+(HAL only) For Dual Head cards, reverse relationship between CRTC picture \
+generators and video output sockets. \
+Especially useful with TV or digital outputs. \
+Default: CRTC1 generates output for socket 1 and CRTC2 generates output for socket 2.
+
+mga.Crtc2Half:\
+In dual head mode, allow CRTC2 to use half of the video memory. \
+Default: CRTC2 uses min{8MB, half video RAM}, but see also Crtc2Ram.
+
+mga.Crtc2Ram:\
+In dual head mode, CRTC2 will use this many KB of video memory. \
+Overrrides Crtc2Half. \
+Default: CRTC2 uses min{8MB, half video RAM}, but see also Crtc2Half.
+
+mga.ShowCache:\
+An option for hackers. The pixmap cache lives in off-screen video memory. \
+This option extends the virtual desktop to show this part of video memory. \
+Default: Off.
+
+mga.AGPMode:\
+AGP bus speed multiplier, used by DRI. \
+Default: x1 (slowest but most stable).
+
+
+!! R128 options
+
+!r128.SWcursor: \
+!Selects software cursor. \
+!Default: off.
+
+r128.NoAccel:\
+Enables or disables all hardware acceleration. \
+Default: on.
+
+r128.Dac6Bit:\
+Enables or disables the use of 6 bits per color component when in 8 bpp \
+mode (emulates VGA mode). \
+Default: off.
+
+r128.VideoKey:\
+This overrides the default pixel value for the YUV video overlay key. \
+Default: undefined.
+
+r128.Display:\
+Select display mode for devices which support flat panels. Supported\
+modes are "FP", "CRT", "Mirror", "BIOS". \
+Default: "FP".
+
+r128.ProgramFPRegs:\
+Enable or disable programming of the flat panel registers.\
+Beware that this may damage your panel, so use at your own risk. \
+Default: device dependant.
+
+r128.PanelWidth:\
+Override flat panel width in pixels. \
+Default: determined using BIOS.
+
+r128.PanelHeight:\
+Override flat panel height in pixels. \
+Default: determined using BIOS.
+
+r128.UseFBDev:\
+Enable or disable use of on OS-specific fb interface (and is not supported \
+on all OSs). See fbdevhw(4) for further information. Default: off.
+
+r128.DMAForXv:\
+Try or don't try to use DMA for Xv image transfers. This will reduce CPU \
+usage when playing big videos like DVDs, but may cause instabilities. \
+Default: off.
+
+
+!! Radeon options
+
+radeon.SWcursor:\
+Selects software cursor. Default: off.
+
+radeon.NoAccel:\
+Disables all hardware acceleration. Default: off.
+
+radeon.Dac6Bit:\
+Enables or disables the use of 6 bits per color component when in 8 bpp \
+mode (emulates VGA mode). Default: off.
+
+radeon.VideoKey:\
+This overrides the default pixel value for the YUV video overlay key. \
+Default: undefined.
+
+radeon.UseFBDev:\
+Enable or disable use of an OS-specific framebuffer device interface \
+(which is not supported on all OSs). Default: off.
+
+radeon.AGPMode:\
+Set AGP data transfer rate. (used only when DRI is enabled) \
+Valid choices: 1 (default), 2 and 4
+
+radeon.AGPFastWrite:\
+Enable AGP fast write. (used only when DRI is enabled) \
+Default: off.
+
+radeon.ForcePCIMode:\
+Force to use PCI GART for DRI acceleration. (used only when DRI is enabled) \
+Default: off.
+
+radeon.DDCMode:\
+Force to use the modes queried from the connected monitor. Default: off.
+
+radeon.CloneDisplay:\
+This option is only used for dual-head cards with only single screen section \
+specified in the configuration file. Valid choices: \
+0 - disable (one CRTC used for both heads) \
+1 - auto-detect (default) \
+2 - force on \
+3 - auto-detect + 2nd head overlay \
+4 - force on + 2nd head overlay \
+
+radeon.CloneMode:\
+Set the first mode for the secondary head. It can be different from the modes \
+used for the primary head. If you don't have this line while clone is on, the \
+modes specified for the primary head will be used for the secondary head.
+
+radeon.CloneHSync:\
+Set the horizontal sync range for the secondary monitor. It is not required if \
+a DDC capable monitor is connected. Default: undefined.
+
+radeon.CloneVRefresh:\
+Set the vertical refresh range for the secondary monitor. It is not required \
+if a DDC capable monitor is connected. Default: undefined.
+
+radeon.PanelOff:\
+Disable panel output. Only used when clone is enabled. Default: off.
+
+radeon.EnablePageFlip:\
+Enable page flipping for 3D acceleration. This will increase performance but \
+not work correctly in some rare cases. Default: off.
+
+
+!! NeoMagic options
+
+neo.StrangeLockups:\
+Before XFree86 version 4.2.0 many NeoMagic systems experienced \
+strange lockups unless they used the options \
+"XaaNoScanlineImageWriteRect" and "XaaNoScanlineCPUToScreenColorExpandFill". \
+Setting this to "No" is faster but will lock some machines. \
+Default: Yes.
+
+!! Vesa options
+vesa.ShadowFB:\
+Enable or disable use of the shadow framebuffer layer. See shadowfb(4)\
+for further information. Default: on.
+
+
+!! SiS Options
+sis.NoAccel:\
+Disable or enable acceleration. \
+Default: acceleration is enabled.
+
+!sis.HWcursor:\
+!Enable or disable the HW cursor. \
+!Default: on.
+
+!sis.SWcursor:\
+!The opposite of HWCursor. \
+!Default: on.
+
+sis.NoXVideo:\
+Disable XV (XVideo) extension support. \
+Default: off.
+
+sis.SetMClk:\
+Set the memory clock in MHz. \
+Default: autodetect.
+
+sis.PciRetry:\
+Enable or disable PCI retries. \
+Default: on.
+
+sis.TurboQueue:\
+Enable or disable TurboQueue mode. \
+Default: off for SIS530, on for the others.
+
+sis.FastVram:\
+Enable or disable FastVram mode. \
+Default: on.
+
+sis.Rotate:\
+Rotate the display clockwise (CW) or counterclockwise (CCW). \
+This mode is unaccelerated, and uses the Shadow Frame Buffer layer \
+Default: no rotation.
+
+sis.ForceCRT2Type:\
+Force display type to one of: TV, LCD or VGA. \
+Default: autodetect.
+
+sis.ShadowFB:\
+Enable or disable use of the shadow framebuffer layer. See shadowfb(4) for \
+further information. Default: off.
+
+!! Generic driver options, apply to many drivers
+
+*.SWcursor:\
+See also HWcursor.\
+Default: Usually Off.
+
+*.HWcursor:\
+Use the hardware cursor. See also SWcursor. \
+Default: usually HWcursor, but some drivers may default to software.
diff --git a/hw/xfree86/common/extramodes b/hw/xfree86/common/extramodes
new file mode 100644
index 000000000..f7dc01216
--- /dev/null
+++ b/hw/xfree86/common/extramodes
@@ -0,0 +1,33 @@
+//
+// Extra modes to include as default modes in the X server.
+//
+// $XFree86: xc/programs/Xserver/hw/xfree86/etc/extramodes,v 1.6 2002/11/11 04:21:46 dawes Exp $
+//
+
+# 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) hsync: 49.725kHz
+ModeLine "832x624" 57.284 832 864 928 1152 624 625 628 667 -Hsync -Vsync
+
+# 1152x768 @ 54.8Hz (Titanium PowerBook) hsync: 44.2kHz
+ModeLine "1152x768" 64.995 1152 1178 1314 1472 768 771 777 806 +hsync +vsync
+
+# 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz
+ModeLine "1400x1050" 122.0 1400 1488 1640 1880 1050 1052 1064 1082 +hsync +vsync
+
+# 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz
+ModeLine "1400x1050" 155.8 1400 1464 1784 1912 1050 1052 1064 1090 +hsync +vsync
+
+# 1600x1024 @ 60Hz (SGI 1600SW) hsync: 64.0kHz
+Modeline "1600x1024" 106.910 1600 1620 1640 1670 1024 1027 1030 1067 -hsync -vsync
+
+# 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz
+Modeline "1920x1440" 341.35 1920 2072 2288 2656 1440 1441 1444 1512 -hsync +vsync
+
+# 2048x1536 @ 60Hz (VESA GTF) hsync: 95.3kHz
+Modeline "2048x1536" 266.95 2048 2200 2424 2800 1536 1537 1540 1589 -hsync +vsync
+
+# 2048x1536 @ 75Hz (VESA GTF) hsync: 120.2kHz
+Modeline "2048x1536" 340.48 2048 2216 2440 2832 1536 1537 1540 1603 -hsync +vsync
+
+# 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz
+Modeline "2048x1536" 388.04 2048 2216 2440 2832 1536 1537 1540 1612 -hsync +vsync
+
diff --git a/hw/xfree86/common/fourcc.h b/hw/xfree86/common/fourcc.h
new file mode 100644
index 000000000..61f403679
--- /dev/null
+++ b/hw/xfree86/common/fourcc.h
@@ -0,0 +1,130 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/fourcc.h,v 1.3 2001/12/03 22:13:24 mvojkovi Exp $ */
+
+/*
+ This header file contains listings of STANDARD guids for video formats.
+ Please do not place non-registered, or incomplete entries in this file.
+ A list of some popular fourcc's are at: http://www.webartz.com/fourcc/
+ For an explanation of fourcc <-> guid mappings see RFC2361.
+*/
+
+#define FOURCC_YUY2 0x32595559
+#define XVIMAGE_YUY2 \
+ { \
+ FOURCC_YUY2, \
+ XvYUV, \
+ LSBFirst, \
+ {'Y','U','Y','2', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 16, \
+ XvPacked, \
+ 1, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 1, 1, \
+ {'Y','U','Y','V', \
+ 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}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_YV12 0x32315659
+#define XVIMAGE_YV12 \
+ { \
+ FOURCC_YV12, \
+ XvYUV, \
+ LSBFirst, \
+ {'Y','V','1','2', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 12, \
+ XvPlanar, \
+ 3, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 2, 2, \
+ {'Y','V','U', \
+ 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}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_I420 0x30323449
+#define XVIMAGE_I420 \
+ { \
+ FOURCC_I420, \
+ XvYUV, \
+ LSBFirst, \
+ {'I','4','2','0', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 12, \
+ XvPlanar, \
+ 3, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 2, 2, \
+ {'Y','U','V', \
+ 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}, \
+ XvTopToBottom \
+ }
+
+
+#define FOURCC_UYVY 0x59565955
+#define XVIMAGE_UYVY \
+ { \
+ FOURCC_UYVY, \
+ XvYUV, \
+ LSBFirst, \
+ {'U','Y','V','Y', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 16, \
+ XvPacked, \
+ 1, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 1, 1, \
+ {'U','Y','V','Y', \
+ 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}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_IA44 0x34344149
+#define XVIMAGE_IA44 \
+ { \
+ FOURCC_IA44, \
+ XvYUV, \
+ LSBFirst, \
+ {'I','A','4','4', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 8, \
+ XvPacked, \
+ 1, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 1, 1, \
+ 1, 1, 1, \
+ {'A','I', \
+ 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}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_AI44 0x34344941
+#define XVIMAGE_AI44 \
+ { \
+ FOURCC_AI44, \
+ XvYUV, \
+ LSBFirst, \
+ {'A','I','4','4', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 8, \
+ XvPacked, \
+ 1, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 1, 1, \
+ 1, 1, 1, \
+ {'I','A', \
+ 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}, \
+ XvTopToBottom \
+ }
+
diff --git a/hw/xfree86/common/modeline2c.pl b/hw/xfree86/common/modeline2c.pl
new file mode 100644
index 000000000..fb76789d6
--- /dev/null
+++ b/hw/xfree86/common/modeline2c.pl
@@ -0,0 +1,79 @@
+#!/usr/bin/perl
+
+# automatically generate the xf86DefModeSet.c file from a normal
+# XF86Config style file of Modelines
+#
+# run as
+#
+# perl /modeline2c.pl < [modesfile] > xf86DefModes.c
+#
+# hackish perl - author Dirk Hohndel
+# Copyright 1999-2001 by The XFree86 Project, Inc.
+#
+# $XFree86: xc/programs/Xserver/hw/xfree86/common/modeline2c.pl,v 1.8 2001/10/28 03:33:17 tsi Exp $
+
+#my %flagshash;
+$flagshash{""} = "0";
+# $flagshash{"Interlace"} = "V_INTERLACE";
+# $flagshash{"+hsync"} = "V_PHSYNC";
+# $flagshash{"-hsync"} = "V_NHSYNC";
+# $flagshash{"+vsync"} = "V_PVSYNC";
+# $flagshash{"-vsync"} = "V_NVSYNC";
+# XXX I'm definitely not a perl guru... -- tsi
+$flagshash{"+hsync +vsync"} = "V_PHSYNC | V_PVSYNC";
+$flagshash{"+hsync -vsync"} = "V_PHSYNC | V_NVSYNC";
+$flagshash{"-hsync +vsync"} = "V_NHSYNC | V_PVSYNC";
+$flagshash{"-hsync -vsync"} = "V_NHSYNC | V_NVSYNC";
+$flagshash{"+hsync +vsync interlace"} = "V_PHSYNC | V_PVSYNC | V_INTERLACE";
+$flagshash{"+hsync -vsync interlace"} = "V_PHSYNC | V_NVSYNC | V_INTERLACE";
+$flagshash{"-hsync +vsync interlace"} = "V_NHSYNC | V_PVSYNC | V_INTERLACE";
+$flagshash{"-hsync -vsync interlace"} = "V_NHSYNC | V_NVSYNC | V_INTERLACE";
+
+# stop CVS from expanding the XFree86 Id here...
+
+$proj = "XFree86";
+printf("/* \$$proj: \$ */
+
+/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at
+ * modeline2c.pl */
+
+/*
+ * Copyright 1999 by The XFree86 Project, Inc.
+ *
+ * Author: Dirk Hohndel <hohndel\@XFree86.Org>
+ */
+
+#include \"xf86.h\"
+#include \"xf86Config.h\"
+#include \"xf86Priv.h\"
+#include \"xf86_OSlib.h\"
+
+#include \"globals.h\"
+
+#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT
+#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
+
+DisplayModeRec xf86DefaultModes [] = {
+");
+while (<>) {
+ if (/^\#/) {
+ s/^\#//;
+ chop;
+ print "/*" . $_ . " */\n";
+ }
+ if (/^ModeLine\s+(\S+)\s+([\d.\s]+)(.*)/i) {
+ $name = $1;
+ $values = $2;
+ $flags = $3;
+ $flags =~ y/A-Z/a-z/;
+ $values =~ /([\d.]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/;
+ printf("\t{MODEPREFIX(%s),%d, %d,%d,%d,%d,0, %d,%d,%d,%d,0, %s, MODESUFFIX},\n",
+ $name,$1*1000,$2,$3,$4,$5,$6,$7,$8,$9,$flagshash{$flags});
+# Also generate half-width doublescanned modes
+ printf("\t{MODEPREFIX(\"%dx%d\"),%d, %d,%d,%d,%d,0, %d,%d,%d,%d,0, %s | V_DBLSCAN, MODESUFFIX},\n",
+ $2/2,$6/2,$1*500,$2/2,$3/2,$4/2,$5/2,$6/2,$7/2,$8/2,$9/2,$flagshash{$flags});
+ }
+
+
+}
+printf("\t{MODEPREFIX(NULL),0,0,0,0,0,0,0,0,0,0,0,0,MODESUFFIX}\n};\n");
diff --git a/hw/xfree86/common/vesamodes b/hw/xfree86/common/vesamodes
new file mode 100644
index 000000000..d2df5931a
--- /dev/null
+++ b/hw/xfree86/common/vesamodes
@@ -0,0 +1,111 @@
+//
+// Default modes distilled from
+// "VESA and Industry Standards and Guide for Computer Display Monitor
+// Timing", version 1.0, revision 0.8, adopted September 17, 1998.
+//
+// $XFree86: xc/programs/Xserver/hw/xfree86/etc/vesamodes,v 1.4 1999/11/18 16:52:17 tsi Exp $
+
+
+# 640x350 @ 85Hz (VESA) hsync: 37.9kHz
+ModeLine "640x350" 31.5 640 672 736 832 350 382 385 445 +hsync -vsync
+
+# 640x400 @ 85Hz (VESA) hsync: 37.9kHz
+ModeLine "640x400" 31.5 640 672 736 832 400 401 404 445 -hsync +vsync
+
+# 720x400 @ 85Hz (VESA) hsync: 37.9kHz
+ModeLine "720x400" 35.5 720 756 828 936 400 401 404 446 -hsync +vsync
+
+# 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+
+# 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+
+# 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+
+# 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+
+# 800x600 @ 56Hz (VESA) hsync: 35.2kHz
+ModeLine "800x600" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
+
+# 800x600 @ 60Hz (VESA) hsync: 37.9kHz
+ModeLine "800x600" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
+
+# 800x600 @ 72Hz (VESA) hsync: 48.1kHz
+ModeLine "800x600" 50.0 800 856 976 1040 600 637 643 666 +hsync +vsync
+
+# 800x600 @ 75Hz (VESA) hsync: 46.9kHz
+ModeLine "800x600" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync
+
+# 800x600 @ 85Hz (VESA) hsync: 53.7kHz
+ModeLine "800x600" 56.3 800 832 896 1048 600 601 604 631 +hsync +vsync
+
+# 1024x768i @ 43Hz (industry standard) hsync: 35.5kHz
+ModeLine "1024x768" 44.9 1024 1032 1208 1264 768 768 776 817 +hsync +vsync Interlace
+
+# 1024x768 @ 60Hz (VESA) hsync: 48.4kHz
+ModeLine "1024x768" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
+
+# 1024x768 @ 70Hz (VESA) hsync: 56.5kHz
+ModeLine "1024x768" 75.0 1024 1048 1184 1328 768 771 777 806 -hsync -vsync
+
+# 1024x768 @ 75Hz (VESA) hsync: 60.0kHz
+ModeLine "1024x768" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync
+
+# 1024x768 @ 85Hz (VESA) hsync: 68.7kHz
+ModeLine "1024x768" 94.5 1024 1072 1168 1376 768 769 772 808 +hsync +vsync
+
+# 1152x864 @ 75Hz (VESA) hsync: 67.5kHz
+ModeLine "1152x864" 108.0 1152 1216 1344 1600 864 865 868 900 +hsync +vsync
+
+# 1280x960 @ 60Hz (VESA) hsync: 60.0kHz
+ModeLine "1280x960" 108.0 1280 1376 1488 1800 960 961 964 1000 +hsync +vsync
+
+# 1280x960 @ 85Hz (VESA) hsync: 85.9kHz
+ModeLine "1280x960" 148.5 1280 1344 1504 1728 960 961 964 1011 +hsync +vsync
+
+# 1280x1024 @ 60Hz (VESA) hsync: 64.0kHz
+ModeLine "1280x1024" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
+
+# 1280x1024 @ 75Hz (VESA) hsync: 80.0kHz
+ModeLine "1280x1024" 135.0 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync
+
+# 1280x1024 @ 85Hz (VESA) hsync: 91.1kHz
+ModeLine "1280x1024" 157.5 1280 1344 1504 1728 1024 1025 1028 1072 +hsync +vsync
+
+# 1600x1200 @ 60Hz (VESA) hsync: 75.0kHz
+ModeLine "1600x1200" 162.0 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
+
+# 1600x1200 @ 65Hz (VESA) hsync: 81.3kHz
+ModeLine "1600x1200" 175.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
+
+# 1600x1200 @ 70Hz (VESA) hsync: 87.5kHz
+ModeLine "1600x1200" 189.0 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
+
+# 1600x1200 @ 75Hz (VESA) hsync: 93.8kHz
+ModeLine "1600x1200" 202.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
+
+# 1600x1200 @ 85Hz (VESA) hsync: 106.3kHz
+ModeLine "1600x1200" 229.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
+
+# 1792x1344 @ 60Hz (VESA) hsync: 83.6kHz
+ModeLine "1792x1344" 204.8 1792 1920 2120 2448 1344 1345 1348 1394 -hsync +vsync
+
+# 1792x1344 @ 75Hz (VESA) hsync: 106.3kHz
+ModeLine "1792x1344" 261.0 1792 1888 2104 2456 1344 1345 1348 1417 -hsync +vsync
+
+# 1856x1392 @ 60Hz (VESA) hsync: 86.3kHz
+ModeLine "1856x1392" 218.3 1856 1952 2176 2528 1392 1393 1396 1439 -hsync +vsync
+
+# 1856x1392 @ 75Hz (VESA) hsync: 112.5kHz
+ModeLine "1856x1392" 288.0 1856 1984 2208 2560 1392 1393 1396 1500 -hsync +vsync
+
+# 1920x1440 @ 60Hz (VESA) hsync: 90.0kHz
+ModeLine "1920x1440" 234.0 1920 2048 2256 2600 1440 1441 1444 1500 -hsync +vsync
+
+# 1920x1440 @ 75Hz (VESA) hsync: 112.5kHz
+ModeLine "1920x1440" 297.0 1920 2064 2288 2640 1440 1441 1444 1500 -hsync +vsync
+
+
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
new file mode 100644
index 000000000..fd9e3c3d1
--- /dev/null
+++ b/hw/xfree86/common/xf86Bus.c
@@ -0,0 +1,3205 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.76 2003/02/21 17:19:34 tsi Exp $ */
+/*
+ * Copyright (c) 1997-1999 by The XFree86 Project, Inc.
+ */
+#define REDUCER
+/*
+ * This file contains the interfaces to the bus-specific code
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Resources.h"
+
+/* Bus-specific headers */
+
+#include "xf86Bus.h"
+
+#define XF86_OS_PRIVS
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSproc.h"
+
+#include "xf86RAC.h"
+
+/* Entity data */
+EntityPtr *xf86Entities = NULL; /* Bus slots claimed by drivers */
+int xf86NumEntities = 0;
+static int xf86EntityPrivateCount = 0;
+BusAccPtr xf86BusAccInfo = NULL;
+
+xf86AccessRec AccessNULL = {NULL,NULL,NULL};
+
+xf86CurrentAccessRec xf86CurrentAccess = {NULL,NULL};
+
+BusRec primaryBus = { BUS_NONE, {{0}}};
+
+Bool xf86ResAccessEnter = FALSE;
+
+#ifdef REDUCER
+/* Resources that temporarily conflict with estimated resources */
+static resPtr AccReducers = NULL;
+#endif
+
+/* resource lists */
+resPtr Acc = NULL;
+resPtr osRes = NULL;
+
+/* allocatable ranges */
+resPtr ResRange = NULL;
+
+/* predefined special resources */
+resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END};
+resRange resVgaShared[] = {_VGA_SHARED, _END};
+resRange resVgaMemShared[] = {_VGA_SHARED_MEM,_END};
+resRange resVgaIoShared[] = {_VGA_SHARED_IO,_END};
+resRange resVgaUnusedExclusive[] = {_VGA_EXCLUSIVE_UNUSED, _END};
+resRange resVgaUnusedShared[] = {_VGA_SHARED_UNUSED, _END};
+resRange resVgaSparseExclusive[] = {_VGA_EXCLUSIVE_SPARSE, _END};
+resRange resVgaSparseShared[] = {_VGA_SHARED_SPARSE, _END};
+resRange res8514Exclusive[] = {_8514_EXCLUSIVE, _END};
+resRange res8514Shared[] = {_8514_SHARED, _END};
+
+/* Flag: do we need RAC ? */
+static Bool needRAC = FALSE;
+static Bool doFramebufferMode = FALSE;
+
+/* state change notification callback list */
+static StateChangeNotificationPtr StateChangeNotificationList;
+static void notifyStateChange(xf86NotifyState state);
+
+#undef MIN
+#define MIN(x,y) ((x<y)?x:y)
+
+
+/*
+ * Call the bus probes relevant to the architecture.
+ *
+ * The only one available so far is for PCI and SBUS.
+ */
+
+void
+xf86BusProbe(void)
+{
+ xf86PciProbe();
+#if defined(__sparc__) && !defined(__OpenBSD__)
+ xf86SbusProbe();
+#endif
+}
+
+/*
+ * Determine what bus type the busID string represents. The start of the
+ * bus-dependent part of the string is returned as retID.
+ */
+
+BusType
+StringToBusType(const char* busID, const char **retID)
+{
+ char *p, *s;
+ BusType ret = BUS_NONE;
+
+ /* If no type field, Default to PCI */
+ if (isdigit(busID[0])) {
+ if (retID)
+ *retID = busID;
+ return BUS_PCI;
+ }
+
+ s = xstrdup(busID);
+ p = strtok(s, ":");
+ if (p == NULL || *p == 0) {
+ xfree(s);
+ return BUS_NONE;
+ }
+ if (!xf86NameCmp(p, "pci") || !xf86NameCmp(p, "agp"))
+ ret = BUS_PCI;
+ if (!xf86NameCmp(p, "isa"))
+ ret = BUS_ISA;
+ if (!xf86NameCmp(p, "sbus"))
+ ret = BUS_SBUS;
+ if (ret != BUS_NONE)
+ if (retID)
+ *retID = busID + strlen(p) + 1;
+ xfree(s);
+ return ret;
+}
+
+/*
+ * Entity related code.
+ */
+
+void
+xf86EntityInit(void)
+{
+ int i;
+ resPtr *pprev_next;
+ resPtr res;
+ xf86AccessPtr pacc;
+
+ for (i = 0; i < xf86NumEntities; i++)
+ if (xf86Entities[i]->entityInit) {
+ if (xf86Entities[i]->access->busAcc)
+ ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
+ (xf86Entities[i]->access->busAcc);
+ pacc = xf86Entities[i]->access->fallback;
+ if (pacc->AccessEnable)
+ pacc->AccessEnable(pacc->arg);
+ xf86Entities[i]->entityInit(i,xf86Entities[i]->private);
+ if (pacc->AccessDisable)
+ pacc->AccessDisable(pacc->arg);
+ /* remove init resources after init is processed */
+ pprev_next = &Acc;
+ res = Acc;
+ while (res) {
+ if (res->res_type & ResInit && (res->entityIndex == i)) {
+ (*pprev_next) = res->next;
+ xfree(res);
+ } else
+ pprev_next = &(res->next);
+ res = (*pprev_next);
+ }
+ }
+}
+
+int
+xf86AllocateEntity(void)
+{
+ xf86NumEntities++;
+ xf86Entities = xnfrealloc(xf86Entities,
+ sizeof(EntityPtr) * xf86NumEntities);
+ xf86Entities[xf86NumEntities - 1] = xnfcalloc(1,sizeof(EntityRec));
+ xf86Entities[xf86NumEntities - 1]->entityPrivates =
+ xnfcalloc(sizeof(DevUnion) * xf86EntityPrivateCount, 1);
+ return (xf86NumEntities - 1);
+}
+
+static void
+EntityEnter(void)
+{
+ int i;
+ xf86AccessPtr pacc;
+
+ for (i = 0; i < xf86NumEntities; i++)
+ if (xf86Entities[i]->entityEnter) {
+ if (xf86Entities[i]->access->busAcc)
+ ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
+ (xf86Entities[i]->access->busAcc);
+ pacc = xf86Entities[i]->access->fallback;
+ if (pacc->AccessEnable)
+ pacc->AccessEnable(pacc->arg);
+ xf86Entities[i]->entityEnter(i,xf86Entities[i]->private);
+ if (pacc->AccessDisable)
+ pacc->AccessDisable(pacc->arg);
+ }
+}
+
+static void
+EntityLeave(void)
+{
+ int i;
+ xf86AccessPtr pacc;
+
+ for (i = 0; i < xf86NumEntities; i++)
+ if (xf86Entities[i]->entityLeave) {
+ if (xf86Entities[i]->access->busAcc)
+ ((BusAccPtr)xf86Entities[i]->access->busAcc)->set_f
+ (xf86Entities[i]->access->busAcc);
+ pacc = xf86Entities[i]->access->fallback;
+ if (pacc->AccessEnable)
+ pacc->AccessEnable(pacc->arg);
+ xf86Entities[i]->entityLeave(i,xf86Entities[i]->private);
+ if (pacc->AccessDisable)
+ pacc->AccessDisable(pacc->arg);
+ }
+}
+
+Bool
+xf86IsEntityPrimary(int entityIndex)
+{
+ EntityPtr pEnt = xf86Entities[entityIndex];
+
+ if (primaryBus.type != pEnt->busType) return FALSE;
+
+ switch (pEnt->busType) {
+ case BUS_PCI:
+ return (pEnt->pciBusId.bus == primaryBus.id.pci.bus &&
+ pEnt->pciBusId.device == primaryBus.id.pci.device &&
+ pEnt->pciBusId.func == primaryBus.id.pci.func);
+ case BUS_ISA:
+ return TRUE;
+ case BUS_SBUS:
+ return (pEnt->sbusBusId.fbNum == primaryBus.id.sbus.fbNum);
+ default:
+ return FALSE;
+ }
+}
+
+Bool
+xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter,
+ EntityProc leave, pointer private)
+{
+ if (entityIndex >= xf86NumEntities)
+ return FALSE;
+ xf86Entities[entityIndex]->entityInit = init;
+ xf86Entities[entityIndex]->entityEnter = enter;
+ xf86Entities[entityIndex]->entityLeave = leave;
+ xf86Entities[entityIndex]->private = private;
+ return TRUE;
+}
+
+Bool
+xf86DriverHasEntities(DriverPtr drvp)
+{
+ int i;
+ for (i = 0; i < xf86NumEntities; i++) {
+ if (xf86Entities[i]->driver == drvp)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void
+xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex)
+{
+ if (entityIndex == -1)
+ return;
+ if (xf86Entities[entityIndex]->inUse &&
+ !(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL))
+ FatalError("Requested Entity already in use!\n");
+
+ pScrn->numEntities++;
+ pScrn->entityList = xnfrealloc(pScrn->entityList,
+ pScrn->numEntities * sizeof(int));
+ pScrn->entityList[pScrn->numEntities - 1] = entityIndex;
+ xf86Entities[entityIndex]->access->next = pScrn->access;
+ pScrn->access = xf86Entities[entityIndex]->access;
+ xf86Entities[entityIndex]->inUse = TRUE;
+ pScrn->entityInstanceList = xnfrealloc(pScrn->entityInstanceList,
+ pScrn->numEntities * sizeof(int));
+ pScrn->entityInstanceList[pScrn->numEntities - 1] = 0;
+ pScrn->domainIOBase = xf86Entities[entityIndex]->domainIO;
+}
+
+void
+xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex, int instance)
+{
+ int i;
+
+ if (entityIndex == -1 || entityIndex >= xf86NumEntities)
+ return;
+
+ for (i = 0; i < pScrn->numEntities; i++) {
+ if (pScrn->entityList[i] == entityIndex) {
+ pScrn->entityInstanceList[i] = instance;
+ break;
+ }
+ }
+}
+
+/*
+ * XXX This needs to be updated for the case where a single entity may have
+ * instances associated with more than one screen.
+ */
+ScrnInfoPtr
+xf86FindScreenForEntity(int entityIndex)
+{
+ int i,j;
+
+ if (entityIndex == -1) return NULL;
+
+ if (xf86Screens) {
+ for (i = 0; i < xf86NumScreens; i++) {
+ for (j = 0; j < xf86Screens[i]->numEntities; j++) {
+ if ( xf86Screens[i]->entityList[j] == entityIndex )
+ return (xf86Screens[i]);
+ }
+ }
+ }
+ return NULL;
+}
+
+void
+xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex)
+{
+ int i;
+ EntityAccessPtr *ptr = (EntityAccessPtr *)&pScrn->access;
+ EntityAccessPtr peacc;
+
+ for (i = 0; i < pScrn->numEntities; i++) {
+ if (pScrn->entityList[i] == entityIndex) {
+ peacc = xf86Entities[pScrn->entityList[i]]->access;
+ (*ptr) = peacc->next;
+ /* disable entity: call disable func */
+ if (peacc->pAccess && peacc->pAccess->AccessDisable)
+ peacc->pAccess->AccessDisable(peacc->pAccess->arg);
+ /* also disable fallback - just in case */
+ if (peacc->fallback && peacc->fallback->AccessDisable)
+ peacc->fallback->AccessDisable(peacc->fallback->arg);
+ for (i++; i < pScrn->numEntities; i++)
+ pScrn->entityList[i-1] = pScrn->entityList[i];
+ pScrn->numEntities--;
+ xf86Entities[entityIndex]->inUse = FALSE;
+ break;
+ }
+ ptr = &(xf86Entities[pScrn->entityList[i]]->access->next);
+ }
+}
+
+/*
+ * xf86ClearEntitiesForScreen() - called when a screen is deleted
+ * to mark it's entities unused. Called by xf86DeleteScreen().
+ */
+void
+xf86ClearEntityListForScreen(int scrnIndex)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ EntityAccessPtr peacc;
+ int i, entityIndex;
+
+ if (pScrn->entityList == NULL || pScrn->numEntities == 0) return;
+
+ for (i = 0; i < pScrn->numEntities; i++) {
+ entityIndex = pScrn->entityList[i];
+ xf86Entities[entityIndex]->inUse = FALSE;
+ /* disable resource: call the disable function */
+ peacc = xf86Entities[entityIndex]->access;
+ if (peacc->pAccess && peacc->pAccess->AccessDisable)
+ peacc->pAccess->AccessDisable(peacc->pAccess->arg);
+ /* and the fallback function */
+ if (peacc->fallback && peacc->fallback->AccessDisable)
+ peacc->fallback->AccessDisable(peacc->fallback->arg);
+ /* shared resources are only needed when entity is active: remove */
+ xf86DeallocateResourcesForEntity(entityIndex, ResShared);
+ }
+ xfree(pScrn->entityList);
+ xfree(pScrn->entityInstanceList);
+ if (pScrn->CurrentAccess->pIoAccess == (EntityAccessPtr)pScrn->access)
+ pScrn->CurrentAccess->pIoAccess = NULL;
+ if (pScrn->CurrentAccess->pMemAccess == (EntityAccessPtr)pScrn->access)
+ pScrn->CurrentAccess->pMemAccess = NULL;
+ pScrn->entityList = NULL;
+ pScrn->entityInstanceList = NULL;
+}
+
+void
+xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type)
+{
+ resPtr *pprev_next = &Acc;
+ resPtr res = Acc;
+
+ while (res) {
+ if (res->entityIndex == entityIndex &&
+ (type & ResAccMask & res->res_type))
+ {
+ (*pprev_next) = res->next;
+ xfree(res);
+ } else
+ pprev_next = &(res->next);
+ res = (*pprev_next);
+ }
+}
+
+/*
+ * Add an extra device section (GDevPtr) to an entity.
+ */
+
+void
+xf86AddDevToEntity(int entityIndex, GDevPtr dev)
+{
+ EntityPtr pEnt;
+
+ if (entityIndex >= xf86NumEntities)
+ return;
+
+ pEnt = xf86Entities[entityIndex];
+ pEnt->numInstances++;
+ pEnt->devices = xnfrealloc(pEnt->devices,
+ pEnt->numInstances * sizeof(GDevPtr));
+ pEnt->devices[pEnt->numInstances - 1] = dev;
+ dev->claimed = TRUE;
+}
+
+/*
+ * xf86GetEntityInfo() -- This function hands information from the
+ * EntityRec struct to the drivers. The EntityRec structure itself
+ * remains invisible to the driver.
+ */
+EntityInfoPtr
+xf86GetEntityInfo(int entityIndex)
+{
+ EntityInfoPtr pEnt;
+ int i;
+
+ if (entityIndex >= xf86NumEntities)
+ return NULL;
+
+ pEnt = xnfcalloc(1,sizeof(EntityInfoRec));
+ pEnt->index = entityIndex;
+ pEnt->location = xf86Entities[entityIndex]->bus;
+ pEnt->active = xf86Entities[entityIndex]->active;
+ pEnt->chipset = xf86Entities[entityIndex]->chipset;
+ pEnt->resources = xf86Entities[entityIndex]->resources;
+ pEnt->driver = xf86Entities[entityIndex]->driver;
+ if ( (xf86Entities[entityIndex]->devices) &&
+ (xf86Entities[entityIndex]->devices[0]) ) {
+ for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++)
+ if (xf86Entities[entityIndex]->devices[i]->screen == 0)
+ break;
+ pEnt->device = xf86Entities[entityIndex]->devices[i];
+ } else
+ pEnt->device = NULL;
+
+ return pEnt;
+}
+
+int
+xf86GetNumEntityInstances(int entityIndex)
+{
+ if (entityIndex >= xf86NumEntities)
+ return -1;
+
+ return xf86Entities[entityIndex]->numInstances;
+}
+
+GDevPtr
+xf86GetDevFromEntity(int entityIndex, int instance)
+{
+ int i;
+
+ /* We might not use AddDevtoEntity */
+ if ( (!xf86Entities[entityIndex]->devices) ||
+ (!xf86Entities[entityIndex]->devices[0]) )
+ return NULL;
+
+ if (entityIndex >= xf86NumEntities ||
+ instance >= xf86Entities[entityIndex]->numInstances)
+ return NULL;
+
+ for (i = 0; i < xf86Entities[entityIndex]->numInstances; i++)
+ if (xf86Entities[entityIndex]->devices[i]->screen == instance)
+ break;
+ return xf86Entities[entityIndex]->devices[i];
+}
+
+/*
+ * general generic disable function.
+ */
+static void
+disableAccess(void)
+{
+ int i;
+ xf86AccessPtr pacc;
+ EntityAccessPtr peacc;
+
+ /* call disable funcs and reset current access pointer */
+ /* the entity specific access funcs are in an enabled */
+ /* state - driver must restore their state explicitely */
+ for (i = 0; i < xf86NumScreens; i++) {
+ peacc = xf86Screens[i]->CurrentAccess->pIoAccess;
+ while (peacc) {
+ if (peacc->pAccess->AccessDisable)
+ peacc->pAccess->AccessDisable(peacc->pAccess->arg);
+ peacc = peacc->next;
+ }
+ xf86Screens[i]->CurrentAccess->pIoAccess = NULL;
+ peacc = xf86Screens[i]->CurrentAccess->pMemAccess;
+ while (peacc) {
+ if (peacc->pAccess->AccessDisable)
+ peacc->pAccess->AccessDisable(peacc->pAccess->arg);
+ peacc = peacc->next;
+ }
+ xf86Screens[i]->CurrentAccess->pMemAccess = NULL;
+ }
+ /* then call the generic entity disable funcs */
+ for (i = 0; i < xf86NumEntities; i++) {
+ pacc = xf86Entities[i]->access->fallback;
+ if (pacc->AccessDisable)
+ pacc->AccessDisable(pacc->arg);
+ }
+}
+
+static void
+clearAccess(void)
+{
+ int i;
+
+ /* call disable funcs and reset current access pointer */
+ /* the entity specific access funcs are in an enabled */
+ /* state - driver must restore their state explicitely */
+ for (i = 0; i < xf86NumScreens; i++) {
+ xf86Screens[i]->CurrentAccess->pIoAccess = NULL;
+ xf86Screens[i]->CurrentAccess->pMemAccess = NULL;
+ }
+
+}
+
+/*
+ * Generic interface to bus specific code - add other buses here
+ */
+
+/*
+ * xf86AccessInit() - set up everything needed for access control
+ * called only once on first server generation.
+ */
+void
+xf86AccessInit(void)
+{
+ initPciState();
+ initPciBusState();
+ DisablePciBusAccess();
+ DisablePciAccess();
+
+ xf86ResAccessEnter = TRUE;
+}
+
+/*
+ * xf86AccessEnter() -- gets called to save the text mode VGA IO
+ * resources when reentering the server after a VT switch.
+ */
+void
+xf86AccessEnter(void)
+{
+ if (xf86ResAccessEnter)
+ return;
+
+ /*
+ * on enter we simply disable routing of special resources
+ * to any bus and let the RAC code to "open" the right bridges.
+ */
+ PciBusStateEnter();
+ DisablePciBusAccess();
+ PciStateEnter();
+ disableAccess();
+ EntityEnter();
+ notifyStateChange(NOTIFY_ENTER);
+ xf86EnterServerState(SETUP);
+ xf86ResAccessEnter = TRUE;
+}
+
+/*
+ * xf86AccessLeave() -- prepares access for and calls the
+ * entityLeave() functions.
+ * xf86AccessLeaveState() --- gets called to restore the
+ * access to the VGA IO resources when switching VT or on
+ * server exit.
+ * This was split to call xf86AccessLeaveState() from
+ * ddxGiveUp().
+ */
+void
+xf86AccessLeave(void)
+{
+ if (!xf86ResAccessEnter)
+ return;
+ notifyStateChange(NOTIFY_LEAVE);
+ disableAccess();
+ DisablePciBusAccess();
+ EntityLeave();
+}
+
+void
+xf86AccessLeaveState(void)
+{
+ if (!xf86ResAccessEnter)
+ return;
+ xf86ResAccessEnter = FALSE;
+ PciStateLeave();
+ PciBusStateLeave();
+}
+
+/*
+ * xf86AccessRestoreState() - Restore the access registers to the
+ * state before X was started. This is handy for framebuffers.
+ */
+static void
+xf86AccessRestoreState(void)
+{
+ if (!xf86ResAccessEnter)
+ return;
+ PciStateLeave();
+ PciBusStateLeave();
+}
+
+/*
+ * xf86EnableAccess() -- enable access to controlled resources.
+ * To reduce latency when switching access the ScrnInfoRec has
+ * a linked list of the EntityAccPtr of all screen entities.
+ */
+/*
+ * switching access needs to be done in te following oder:
+ * disable
+ * 1. disable old entity
+ * 2. reroute bus
+ * 3. enable new entity
+ * Otherwise resources needed for access control might be shadowed
+ * by other resources!
+ */
+#ifdef async
+
+static AsyncQPtr *AsyncQ = NULL;
+ScrnInfoPtr xf86CurrentScreen = NULL;
+
+#define SETUP_Q org = AsyncQ; \
+ AsyncQ = &new;
+
+#define PROCESS_Q xf86CurrentScreen = pScrn;
+ if (!new) AsyncQ = org; \
+ else { \
+ AsyncQPtr tmp_Q; \
+ while (1) {\
+ new->func(new->arg);\
+ if (!(new->next)) {\
+ AsyncQ = org; xfree(new); break; \
+ } \
+ tmp_Q = new->next; \
+ xfree(new); \
+ new = tmp_Q; \
+ } \
+ }
+#else
+#define SETUP_Q
+#define PROCESS_Q
+#endif
+
+void
+xf86EnableAccess(ScrnInfoPtr pScrn)
+{
+ register EntityAccessPtr peAcc = (EntityAccessPtr) pScrn->access;
+ register EntityAccessPtr pceAcc;
+ register xf86AccessPtr pAcc;
+ EntityAccessPtr tmp;
+#ifdef async
+ AsyncQPtr *org, new = NULL;
+#endif
+
+#ifdef DEBUG
+ ErrorF("Enable access %i\n",pScrn->scrnIndex);
+#endif
+
+ /* Entity is not under access control or currently enabled */
+ if (!pScrn->access) {
+ if (pScrn->busAccess) {
+ SETUP_Q;
+ ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
+ PROCESS_Q;
+ }
+ return;
+ }
+
+ switch (pScrn->resourceType) {
+ case IO:
+ pceAcc = pScrn->CurrentAccess->pIoAccess;
+ if (peAcc == pceAcc) {
+ return;
+ }
+ SETUP_Q;
+ if (pScrn->CurrentAccess->pMemAccess == pceAcc)
+ pScrn->CurrentAccess->pMemAccess = NULL;
+ while (pceAcc) {
+ pAcc = pceAcc->pAccess;
+ if ( pAcc && pAcc->AccessDisable)
+ (*pAcc->AccessDisable)(pAcc->arg);
+ pceAcc = pceAcc->next;
+ }
+ if (pScrn->busAccess)
+ ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
+ while (peAcc) {
+ pAcc = peAcc->pAccess;
+ if (pAcc && pAcc->AccessEnable)
+ (*pAcc->AccessEnable)(pAcc->arg);
+ peAcc = peAcc->next;
+ }
+ pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access;
+ PROCESS_Q;
+ return;
+
+ case MEM_IO:
+ pceAcc = pScrn->CurrentAccess->pIoAccess;
+ if (peAcc != pceAcc) { /* current Io != pAccess */
+ SETUP_Q;
+ tmp = pceAcc;
+ while (pceAcc) {
+ pAcc = pceAcc->pAccess;
+ if (pAcc && pAcc->AccessDisable)
+ (*pAcc->AccessDisable)(pAcc->arg);
+ pceAcc = pceAcc->next;
+ }
+ pceAcc = pScrn->CurrentAccess->pMemAccess;
+ if (peAcc != pceAcc /* current Mem != pAccess */
+ && tmp !=pceAcc) {
+ while (pceAcc) {
+ pAcc = pceAcc->pAccess;
+ if (pAcc && pAcc->AccessDisable)
+ (*pAcc->AccessDisable)(pAcc->arg);
+ pceAcc = pceAcc->next;
+ }
+ }
+ } else { /* current Io == pAccess */
+ pceAcc = pScrn->CurrentAccess->pMemAccess;
+ if (pceAcc == peAcc) { /* current Mem == pAccess */
+ return;
+ }
+ SETUP_Q;
+ while (pceAcc) { /* current Mem != pAccess */
+ pAcc = pceAcc->pAccess;
+ if (pAcc && pAcc->AccessDisable)
+ (*pAcc->AccessDisable)(pAcc->arg);
+ pceAcc = pceAcc->next;
+ }
+ }
+ if (pScrn->busAccess)
+ ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
+ while (peAcc) {
+ pAcc = peAcc->pAccess;
+ if (pAcc && pAcc->AccessEnable)
+ (*pAcc->AccessEnable)(pAcc->arg);
+ peAcc = peAcc->next;
+ }
+ pScrn->CurrentAccess->pMemAccess =
+ pScrn->CurrentAccess->pIoAccess = (EntityAccessPtr) pScrn->access;
+ PROCESS_Q;
+ return;
+
+ case MEM:
+ pceAcc = pScrn->CurrentAccess->pMemAccess;
+ if (peAcc == pceAcc) {
+ return;
+ }
+ SETUP_Q;
+ if (pScrn->CurrentAccess->pIoAccess == pceAcc)
+ pScrn->CurrentAccess->pIoAccess = NULL;
+ while (pceAcc) {
+ pAcc = pceAcc->pAccess;
+ if ( pAcc && pAcc->AccessDisable)
+ (*pAcc->AccessDisable)(pAcc->arg);
+ pceAcc = pceAcc->next;
+ }
+ if (pScrn->busAccess)
+ ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
+ while (peAcc) {
+ pAcc = peAcc->pAccess;
+ if (pAcc && pAcc->AccessEnable)
+ (*pAcc->AccessEnable)(pAcc->arg);
+ peAcc = peAcc->next;
+ }
+ pScrn->CurrentAccess->pMemAccess = (EntityAccessPtr) pScrn->access;
+ PROCESS_Q;
+ return;
+
+ case NONE:
+ if (pScrn->busAccess) {
+ SETUP_Q;
+ ((BusAccPtr)pScrn->busAccess)->set_f(pScrn->busAccess);
+ PROCESS_Q;
+ }
+ return;
+ }
+}
+
+void
+xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn)
+{
+ EntityAccessPtr pceAcc2 = NULL;
+ register EntityAccessPtr pceAcc = NULL;
+ register xf86AccessPtr pAcc;
+
+
+ switch(pScrn->resourceType) {
+ case IO:
+ pceAcc = pScrn->CurrentAccess->pIoAccess;
+ break;
+ case MEM:
+ pceAcc = pScrn->CurrentAccess->pMemAccess;
+ break;
+ case MEM_IO:
+ pceAcc = pScrn->CurrentAccess->pMemAccess;
+ pceAcc2 = pScrn->CurrentAccess->pIoAccess;
+ break;
+ default:
+ break;
+ }
+
+ while (pceAcc) {
+ pAcc = pceAcc->pAccess;
+ if ( pAcc) {
+ if (!Enable) {
+ if (pAcc->AccessDisable)
+ (*pAcc->AccessDisable)(pAcc->arg);
+ } else {
+ if (pAcc->AccessEnable)
+ (*pAcc->AccessEnable)(pAcc->arg);
+ }
+ }
+ pceAcc = pceAcc->next;
+ if (!pceAcc) {
+ pceAcc = pceAcc2;
+ pceAcc2 = NULL;
+ }
+ }
+}
+
+void
+xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
+ xf86SetAccessFuncPtr oldFuncs)
+{
+ AccessFuncPtr rac;
+
+ if (!xf86Entities[pEnt->index]->rac)
+ xf86Entities[pEnt->index]->rac = xnfcalloc(1,sizeof(AccessFuncRec));
+
+ rac = xf86Entities[pEnt->index]->rac;
+
+ if (funcs->mem == funcs->io_mem && funcs->mem && funcs->io)
+ xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_MEM_FROM_IO;
+ if (funcs->io == funcs->io_mem && funcs->mem && funcs->io)
+ xf86Entities[pEnt->index]->entityProp |= NO_SEPARATE_IO_FROM_MEM;
+
+ rac->mem_new = funcs->mem;
+ rac->io_new = funcs->io;
+ rac->io_mem_new = funcs->io_mem;
+
+ rac->old = oldFuncs;
+}
+
+/*
+ * Conflict checking
+ */
+
+static memType
+getMask(memType val)
+{
+ memType mask = 0;
+ memType tmp = 0;
+
+ mask=~mask;
+ tmp = ~((~tmp) >> 1);
+
+ while (!(val & tmp)) {
+ mask = mask >> 1;
+ val = val << 1;
+ }
+ return mask;
+}
+
+/*
+ * checkConflictBlock() -- check for conflicts of a block resource range.
+ * If conflict is found return end of conflicting range. Else return 0.
+ */
+static memType
+checkConflictBlock(resRange *range, resPtr pRes)
+{
+ memType val,tmp,prev;
+ int i;
+
+ switch (pRes->res_type & ResExtMask) {
+ case ResBlock:
+ if (range->rBegin < pRes->block_end &&
+ range->rEnd > pRes->block_begin) {
+#ifdef DEBUG
+ ErrorF("b-b conflict w: %lx %lx\n",
+ pRes->block_begin,pRes->block_end);
+#endif
+ return pRes->block_end < range->rEnd ?
+ pRes->block_end : range->rEnd;
+ }
+ return 0;
+ case ResSparse:
+ if (pRes->sparse_base > range->rEnd) return 0;
+
+ val = (~pRes->sparse_mask | pRes->sparse_base) & getMask(range->rEnd);
+#ifdef DEBUG
+ ErrorF("base = 0x%lx, mask = 0x%lx, begin = 0x%lx, end = 0x%lx ,"
+ "val = 0x%lx\n",
+ pRes->sparse_base, pRes->sparse_mask, range->rBegin,
+ range->rEnd, val);
+#endif
+ i = sizeof(memType) * 8;
+ tmp = prev = pRes->sparse_base;
+
+ while (i) {
+ tmp |= 1<< (--i) & val;
+ if (tmp > range->rEnd)
+ tmp = prev;
+ else
+ prev = tmp;
+ }
+ if (tmp >= range->rBegin) {
+#ifdef DEBUG
+ ErrorF("conflict found at: 0x%lx\n",tmp);
+ ErrorF("b-d conflict w: %lx %lx\n",
+ pRes->sparse_base,pRes->sparse_mask);
+#endif
+ return tmp;
+ }
+ else
+ return 0;
+ }
+ return 0;
+}
+
+/*
+ * checkConflictSparse() -- check for conflicts of a sparse resource range.
+ * If conflict is found return base of conflicting region. Else return 0.
+ */
+#define mt_max ~(memType)0
+#define length sizeof(memType) * 8
+static memType
+checkConflictSparse(resRange *range, resPtr pRes)
+{
+ memType val, tmp, prev;
+ int i;
+
+ switch (pRes->res_type & ResExtMask) {
+ case ResSparse:
+ tmp = pRes->sparse_mask & range->rMask;
+ if ((tmp & pRes->sparse_base) == (tmp & range->rBase)) {
+#ifdef DEBUG
+ ErrorF("s-b conflict w: %lx %lx\n",
+ pRes->sparse_base,pRes->sparse_mask);
+#endif
+ return pRes->sparse_mask;
+ }
+ return 0;
+
+ case ResBlock:
+ if (pRes->block_end < range->rBase) return 0;
+
+ val = (~range->rMask | range->rBase) & getMask(pRes->block_end);
+ i = length;
+ tmp = prev = range->rBase;
+
+ while (i) {
+#ifdef DEBUG
+ ErrorF("tmp = 0x%lx\n",tmp);
+#endif
+ tmp |= 1<< (--i) & val;
+ if (tmp > pRes->block_end)
+ tmp = prev;
+ else
+ prev = tmp;
+ }
+ if (tmp < pRes->block_begin)
+ return 0;
+ else {
+ /*
+ * now we subdivide the block region in sparse regions
+ * with base values = 2^n and find the smallest mask.
+ * This might be done in a simpler way....
+ */
+ memType mask, m_mask = 0, base = pRes->block_begin;
+ int i;
+ while (base < pRes->block_end) {
+ for (i = 1; i < length; i++)
+ if ( base != (base & (mt_max << i))) break;
+ mask = mt_max >> (length - i);
+ do mask >>= 1;
+ while ((mask + base + 1) > pRes->block_end);
+ /* m_mask and are _inverted_ sparse masks */
+ m_mask = mask > m_mask ? mask : m_mask;
+ base = base + mask + 1;
+ }
+#ifdef DEBUG
+ ErrorF("conflict found at: 0x%lx\n",tmp);
+ ErrorF("b-b conflict w: %lx %lx\n",
+ pRes->block_begin,pRes->block_end);
+#endif
+ return ~m_mask;
+ }
+ }
+ return 0;
+}
+#undef mt_max
+#undef length
+
+/*
+ * needCheck() -- this function decides whether to check for conflicts
+ * depending on the types of the resource ranges and their locations
+ */
+static Bool
+needCheck(resPtr pRes, unsigned long type, int entityIndex, xf86State state)
+{
+ /* the same entity shouldn't conflict with itself */
+ ScrnInfoPtr pScrn;
+ int i;
+ BusType loc = BUS_NONE;
+ BusType r_loc = BUS_NONE;
+
+ /* Ignore overlapped ranges that have been nullified */
+ if ((pRes->res_type & ResOverlap) && (pRes->block_begin > pRes->block_end))
+ return FALSE;
+
+ if ((pRes->res_type & ResTypeMask) != (type & ResTypeMask))
+ return FALSE;
+
+ /*
+ * Resources set by BIOS (ResBios) are allowed to conflict
+ * with resources marked (ResBios).
+ */
+ if (pRes->res_type & type & ResBios)
+ return FALSE;
+
+ /*If requested, skip over estimated resources */
+ if (pRes->res_type & type & ResEstimated)
+ return FALSE;
+
+ if (type & pRes->res_type & ResUnused)
+ return FALSE;
+
+ if (state == OPERATING) {
+ if (type & ResDisableOpr || pRes->res_type & ResDisableOpr)
+ return FALSE;
+ if (type & pRes->res_type & ResUnusedOpr) return FALSE;
+ /*
+ * Maybe we should have ResUnused set The resUnusedOpr
+ * bit, too. This way we could avoid this confusion
+ */
+ if ((type & ResUnusedOpr && pRes->res_type & ResUnused) ||
+ (type & ResUnused && pRes->res_type & ResUnusedOpr))
+ return FALSE;
+ }
+
+ if (entityIndex > -1)
+ loc = xf86Entities[entityIndex]->busType;
+ if (pRes->entityIndex > -1)
+ r_loc = xf86Entities[pRes->entityIndex]->busType;
+
+ switch (type & ResAccMask) {
+ case ResExclusive:
+ switch (pRes->res_type & ResAccMask) {
+ case ResExclusive:
+ break;
+ case ResShared:
+ /* ISA buses are only locally exclusive on a PCI system */
+ if (loc == BUS_ISA && r_loc == BUS_PCI)
+ return FALSE;
+ break;
+ }
+ break;
+ case ResShared:
+ switch (pRes->res_type & ResAccMask) {
+ case ResExclusive:
+ /* ISA buses are only locally exclusive on a PCI system */
+ if (loc == BUS_PCI && r_loc == BUS_ISA)
+ return FALSE;
+ break;
+ case ResShared:
+ return FALSE;
+ }
+ break;
+ case ResAny:
+ break;
+ }
+
+ if (pRes->entityIndex == entityIndex) return FALSE;
+
+ if (pRes->entityIndex > -1 &&
+ (pScrn = xf86FindScreenForEntity(entityIndex))) {
+ for (i = 0; i < pScrn->numEntities; i++)
+ if (pScrn->entityList[i] == pRes->entityIndex) return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * checkConflict() - main conflict checking function which all other
+ * function call.
+ */
+static memType
+checkConflict(resRange *rgp, resPtr pRes, int entityIndex,
+ xf86State state, Bool ignoreIdentical)
+{
+ memType ret;
+
+ while(pRes) {
+ if (!needCheck(pRes,rgp->type, entityIndex ,state)) {
+ pRes = pRes->next;
+ continue;
+ }
+ switch (rgp->type & ResExtMask) {
+ case ResBlock:
+ if (rgp->rEnd < rgp->rBegin) {
+ xf86Msg(X_ERROR,"end of block range 0x%lx < begin 0x%lx\n",
+ rgp->rEnd,rgp->rBegin);
+ return 0;
+ }
+ if ((ret = checkConflictBlock(rgp, pRes))) {
+ if (!ignoreIdentical || (rgp->rBegin != pRes->block_begin)
+ || (rgp->rEnd != pRes->block_end))
+ return ret;
+ }
+ break;
+ case ResSparse:
+ if ((rgp->rBase & rgp->rMask) != rgp->rBase) {
+ xf86Msg(X_ERROR,"sparse io range (base: 0x%lx mask: 0x%lx)"
+ "doesn't satisfy (base & mask = mask)\n",
+ rgp->rBase, rgp->rMask);
+ return 0;
+ }
+ if ((ret = checkConflictSparse(rgp, pRes))) {
+ if (!ignoreIdentical || (rgp->rBase != pRes->sparse_base)
+ || (rgp->rMask != pRes->sparse_mask))
+ return ret;
+ }
+ break;
+ }
+ pRes = pRes->next;
+ }
+ return 0;
+}
+
+/*
+ * ChkConflict() -- used within xxxBus ; find conflict with any location.
+ */
+memType
+ChkConflict(resRange *rgp, resPtr res, xf86State state)
+{
+ return checkConflict(rgp, res, -2, state,FALSE);
+}
+
+/*
+ * xf86ChkConflict() - This function is the low level interface to
+ * the resource broker that gets exported. Tests all resources ie.
+ * performs test with SETUP flag.
+ */
+memType
+xf86ChkConflict(resRange *rgp, int entityIndex)
+{
+ return checkConflict(rgp, Acc, entityIndex, SETUP,FALSE);
+}
+
+/*
+ * Resources List handling
+ */
+
+resPtr
+xf86JoinResLists(resPtr rlist1, resPtr rlist2)
+{
+ resPtr pRes;
+
+ if (!rlist1)
+ return rlist2;
+
+ if (!rlist2)
+ return rlist1;
+
+ for (pRes = rlist1; pRes->next; pRes = pRes->next)
+ ;
+ pRes->next = rlist2;
+ return rlist1;
+}
+
+resPtr
+xf86AddResToList(resPtr rlist, resRange *range, int entityIndex)
+{
+ resPtr new;
+
+ switch (range->type & ResExtMask) {
+ case ResBlock:
+ if (range->rEnd < range->rBegin) {
+ xf86Msg(X_ERROR,"end of block range 0x%lx < begin 0x%lx\n",
+ range->rEnd,range->rBegin);
+ return rlist;
+ }
+ break;
+ case ResSparse:
+ if ((range->rBase & range->rMask) != range->rBase) {
+ xf86Msg(X_ERROR,"sparse io range (base: 0x%lx mask: 0x%lx)"
+ "doesn't satisfy (base & mask = mask)\n",
+ range->rBase, range->rMask);
+ return rlist;
+ }
+ break;
+ }
+
+ new = xnfalloc(sizeof(resRec));
+ /*
+ * Only background resources may be registered with ResBios
+ * and ResEstimated set. Other resources only set it for
+ * testing.
+ */
+ if (entityIndex != (-1))
+ range->type &= ~(ResBios | ResEstimated);
+ new->val = *range;
+ new->entityIndex = entityIndex;
+ new->next = rlist;
+ return new;
+}
+
+void
+xf86FreeResList(resPtr rlist)
+{
+ resPtr pRes;
+
+ if (!rlist)
+ return;
+
+ for (pRes = rlist->next; pRes; rlist = pRes, pRes = pRes->next)
+ xfree(rlist);
+ xfree(rlist);
+}
+
+resPtr
+xf86DupResList(const resPtr rlist)
+{
+ resPtr pRes, ret, prev, new;
+
+ if (!rlist)
+ return NULL;
+
+ ret = xnfalloc(sizeof(resRec));
+ *ret = *rlist;
+ prev = ret;
+ for (pRes = rlist->next; pRes; pRes = pRes->next) {
+ new = xnfalloc(sizeof(resRec));
+ *new = *pRes;
+ prev->next = new;
+ prev = new;
+ }
+ return ret;
+}
+
+void
+xf86PrintResList(int verb, resPtr list)
+{
+ int i = 0;
+ const char *s, *r;
+ resPtr tmp = list;
+ unsigned long type;
+
+ if (!list)
+ return;
+
+ type = ResMem;
+ r = "M";
+ while (1) {
+ while (list) {
+ if ((list->res_type & ResPhysMask) == type) {
+ switch (list->res_type & ResExtMask) {
+ case ResBlock:
+ xf86ErrorFVerb(verb,
+ "\t[%d] %d\t%d\t0x%08lx - 0x%08lx (0x%lx)",
+ i, list->entityIndex,
+ (list->res_type & ResDomain) >> 24,
+ list->block_begin, list->block_end,
+ list->block_end - list->block_begin + 1);
+ break;
+ case ResSparse:
+ xf86ErrorFVerb(verb, "\t[%d] %d\t%d\t0x%08lx - 0x%08lx ",
+ i, list->entityIndex,
+ (list->res_type & ResDomain) >> 24,
+ list->sparse_base,list->sparse_mask);
+ break;
+ default:
+ list = list->next;
+ continue;
+ }
+ xf86ErrorFVerb(verb, " %s", r);
+ switch (list->res_type & ResAccMask) {
+ case ResExclusive:
+ if (list->res_type & ResUnused)
+ s = "x";
+ else
+ s = "X";
+ break;
+ case ResShared:
+ if (list->res_type & ResUnused)
+ s = "s";
+ else
+ s = "S";
+ break;
+ default:
+ s = "?";
+ }
+ xf86ErrorFVerb(verb, "%s", s);
+ switch (list->res_type & ResExtMask) {
+ case ResBlock:
+ s = "[B]";
+ break;
+ case ResSparse:
+ s = "[S]";
+ break;
+ default:
+ s = "[?]";
+ }
+ xf86ErrorFVerb(verb, "%s", s);
+ if (list->res_type & ResEstimated)
+ xf86ErrorFVerb(verb, "E");
+ if (list->res_type & ResOverlap)
+ xf86ErrorFVerb(verb, "O");
+ if (list->res_type & ResInit)
+ xf86ErrorFVerb(verb, "t");
+ if (list->res_type & ResBios)
+ xf86ErrorFVerb(verb, "(B)");
+ if (list->res_type & ResBus)
+ xf86ErrorFVerb(verb, "(b)");
+ if (list->res_type & ResOprMask) {
+ switch (list->res_type & ResOprMask) {
+ case ResUnusedOpr:
+ s = "(OprU)";
+ break;
+ case ResDisableOpr:
+ s = "(OprD)";
+ break;
+ default:
+ s = "(Opr?)";
+ break;
+ }
+ xf86ErrorFVerb(verb, "%s", s);
+ }
+ xf86ErrorFVerb(verb, "\n");
+ i++;
+ }
+ list = list->next;
+ }
+ if (type == ResIo) break;
+ type = ResIo;
+ r = "I";
+ list = tmp;
+ }
+}
+
+resPtr
+xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex)
+{
+ while(pRange && pRange->type != ResEnd) {
+ list = xf86AddResToList(list,pRange,entityIndex);
+ pRange++;
+ }
+ return list;
+}
+
+void
+xf86ResourceBrokerInit(void)
+{
+ resPtr resPci;
+
+ osRes = NULL;
+
+ /* Get the addressable ranges */
+ ResRange = xf86BusAccWindowsFromOS();
+ xf86MsgVerb(X_INFO, 3, "Addressable bus resource ranges are\n");
+ xf86PrintResList(3, ResRange);
+
+ /* Get the ranges used exclusively by the system */
+ osRes = xf86AccResFromOS(osRes);
+ xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges:\n");
+ xf86PrintResList(3, osRes);
+
+ /* Bus dep initialization */
+ resPci = ResourceBrokerInitPci(&osRes);
+ Acc = xf86JoinResLists(xf86DupResList(osRes), resPci);
+
+ xf86MsgVerb(X_INFO, 3, "All system resource ranges:\n");
+ xf86PrintResList(3, Acc);
+
+}
+
+#define MEM_ALIGN (1024 * 1024)
+
+/*
+ * RemoveOverlaps() -- remove overlaps between resources of the
+ * same kind.
+ * Beware: This function doesn't check for access attributes.
+ * At resource broker initialization this is no problem as this
+ * only deals with exclusive resources.
+ */
+void
+RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated)
+{
+ resPtr pRes;
+ memType size, newsize, adjust;
+
+ for (pRes = list; pRes; pRes = pRes->next) {
+ if (pRes != target
+ && ((pRes->res_type & ResTypeMask) ==
+ (target->res_type & ResTypeMask))
+ && pRes->block_begin <= target->block_end
+ && pRes->block_end >= target->block_begin) {
+ /* Possibly ignore estimated resources */
+ if (!useEstimated && (pRes->res_type & ResEstimated)) continue;
+ /*
+ * Target should be a larger region than pRes. If pRes fully
+ * contains target, don't do anything unless target can overlap.
+ */
+ if (pRes->block_begin <= target->block_begin &&
+ pRes->block_end >= target->block_end) {
+ if (target->res_type & ResOverlap) {
+ /* Nullify range but keep its ResOverlap bit on */
+ target->block_end = target->block_begin - 1;
+ return;
+ }
+ continue;
+ }
+ /*
+ * In cases where the target and pRes have the same starting
+ * address, reduce the size of the target (given it's an estimate).
+ */
+ if (pRes->block_begin == target->block_begin) {
+ if (target->res_type & ResOverlap)
+ target->block_end = target->block_begin - 1;
+ else
+ target->block_end = pRes->block_end;
+ }
+ /* Otherwise, trim target to remove the overlap */
+ else if (pRes->block_begin <= target->block_end) {
+ target->block_end = pRes->block_begin - 1;
+ } else if (!pow2Alignment &&
+ pRes->block_end >= target->block_begin) {
+ target->block_begin = pRes->block_end + 1;
+ }
+ if (pow2Alignment) {
+ /*
+ * Align to a power of two. This requires finding the
+ * largest power of two that is smaller than the adjusted
+ * size.
+ */
+ size = target->block_end - target->block_begin + 1;
+ newsize = 1UL << (sizeof(memType) * 8 - 1);
+ while (!(newsize & size))
+ newsize >>= 1;
+ target->block_end = target->block_begin + newsize - 1;
+ } else if (target->block_end > MEM_ALIGN) {
+ /* Align the end to MEM_ALIGN */
+ if ((adjust = (target->block_end + 1) % MEM_ALIGN))
+ target->block_end -= adjust;
+ }
+ }
+ }
+}
+
+/*
+ * Resource request code
+ */
+
+#define ALIGN(x,a) ((x) + a) &~(a)
+
+resRange
+xf86GetBlock(unsigned long type, memType size,
+ memType window_start, memType window_end,
+ memType align_mask, resPtr avoid)
+{
+ memType min, max, tmp;
+ resRange r = {ResEnd,0,0};
+ resPtr res_range = ResRange;
+
+ if (!size) return r;
+ if (window_end < window_start || (window_end - window_start) < (size - 1)) {
+ ErrorF("Requesting insufficient memory window!:"
+ " start: 0x%lx end: 0x%lx size 0x%lx\n",
+ window_start,window_end,size);
+ return r;
+ }
+ type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResBlock;
+
+ while (res_range) {
+ if ((type & ResTypeMask) == (res_range->res_type & ResTypeMask)) {
+ if (res_range->block_begin > window_start)
+ min = res_range->block_begin;
+ else
+ min = window_start;
+ if (res_range->block_end < window_end)
+ max = res_range->block_end;
+ else
+ max = window_end;
+ min = ALIGN(min,align_mask);
+ /* do not produce an overflow! */
+ while (min < max && (max - min) >= (size - 1)) {
+ RANGE(r,min,min + size - 1,type);
+ tmp = ChkConflict(&r,Acc,SETUP);
+ if (!tmp) {
+ tmp = ChkConflict(&r,avoid,SETUP);
+ if (!tmp) {
+ return r;
+ }
+ }
+ min = ALIGN(tmp,align_mask);
+ }
+ }
+ res_range = res_range->next;
+ }
+ RANGE(r,0,0,ResEnd);
+ return r;
+}
+
+#define mt_max ~(memType)0
+#define length sizeof(memType) * 8
+/*
+ * make_base() -- assign the lowest bits to the bits set in mask.
+ * example: mask 011010 val 0000110 -> 011000
+ */
+static memType
+make_base(memType val, memType mask)
+{
+ int i,j = 0;
+ memType ret = 0
+ ;
+ for (i = 0;i<length;i++) {
+ if ((1 << i) & mask) {
+ ret |= (((val >> j) & 1) << i);
+ j++;
+ }
+ }
+ return ret;
+}
+
+/*
+ * make_base() -- assign the bits set in mask to the lowest bits.
+ * example: mask 011010 , val 010010 -> 000011
+ */
+static memType
+unmake_base(memType val, memType mask)
+{
+ int i,j = 0;
+ memType ret = 0;
+
+ for (i = 0;i<length;i++) {
+ if ((1 << i) & mask) {
+ ret |= (((val >> i) & 1) << j);
+ j++;
+ }
+ }
+ return ret;
+}
+
+static memType
+fix_counter(memType val, memType old_mask, memType mask)
+{
+ mask = old_mask & mask;
+
+ val = make_base(val,old_mask);
+ return unmake_base(val,mask);
+}
+
+resRange
+xf86GetSparse(unsigned long type, memType fixed_bits,
+ memType decode_mask, memType address_mask, resPtr avoid)
+{
+ resRange r = {ResEnd,0,0};
+ memType new_mask;
+ memType mask1;
+ memType base;
+ memType bits;
+ memType counter = 0;
+ memType counter1;
+ memType max_counter = ~(memType)0;
+ memType max_counter1;
+ memType conflict = 0;
+
+ /* for sanity */
+ type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResSparse;
+
+ /*
+ * a sparse address consists of 3 parts:
+ * fixed_bits: F bits which hard decoded by the hardware
+ * decode_bits: D bits which are used to decode address
+ * but which may be set by software
+ * address_bits: A bits which are used to address the
+ * sparse range.
+ * the decode_mask marks all decode bits while the address_mask
+ * masks out all address_bits:
+ * F D A
+ * decode_mask: 0 1 0
+ * address_mask: 1 1 0
+ */
+ decode_mask &= address_mask;
+ new_mask = decode_mask;
+
+ /*
+ * We start by setting the decode_mask bits to different values
+ * when a conflict is found the address_mask of the conflicting
+ * resource is returned. We remove those bits from decode_mask
+ * that are also set in the returned address_mask as they always
+ * conflict with resources which use them as address masks.
+ * The resoulting mask is stored in new_mask.
+ * We continue until no conflict is found or until we have
+ * tried all possible settings of new_mask.
+ */
+ while (1) {
+ base = make_base(counter,new_mask) | fixed_bits;
+ RANGE(r,base,address_mask,type);
+ conflict = ChkConflict(&r,Acc,SETUP);
+ if (!conflict) {
+ conflict = ChkConflict(&r,avoid,SETUP);
+ if (!conflict) {
+ return r;
+ }
+ }
+ counter = fix_counter(counter,new_mask,conflict);
+ max_counter = fix_counter(max_counter,new_mask,conflict);
+ new_mask &= conflict;
+ counter ++;
+ if (counter > max_counter) break;
+ }
+ if (!new_mask && (new_mask == decode_mask)) {
+ RANGE(r,0,0,ResEnd);
+ return r;
+ }
+ /*
+ * if we haven't been successful we also try to modify those
+ * bits in decode_mask that are not at the same time set in
+ * new mask. These bits overlap with address_bits of some
+ * resources. If a conflict with a resource of this kind is
+ * found (ie. returned_mask & mask1 != mask1) with
+ * mask1 = decode_mask & ~new_mask we cannot
+ * use our choice of bits in the new_mask part. We try
+ * another choice.
+ */
+ max_counter = fix_counter(mt_max,mt_max,new_mask);
+ mask1 = decode_mask & ~new_mask;
+ max_counter1 = fix_counter(mt_max,mt_max,mask1);
+ counter = 0;
+
+ while (1) {
+ bits = make_base(counter,new_mask) | fixed_bits;
+ counter1 = 0;
+ while (1) {
+ base = make_base(counter1,mask1);
+ RANGE(r,base,address_mask,type);
+ conflict = ChkConflict(&r,Acc,SETUP);
+ if (!conflict) {
+ conflict = ChkConflict(&r,avoid,SETUP);
+ if (!conflict) {
+ return r;
+ }
+ }
+ counter1 ++;
+ if ((mask1 & conflict) != mask1 || counter1 > max_counter1)
+ break;
+ }
+ counter ++;
+ if (counter > max_counter) break;
+ }
+ RANGE(r,0,0,ResEnd);
+ return r;
+}
+
+#undef length
+#undef mt_max
+
+/*
+ * Resource registrarion
+ */
+
+static resList
+xf86GetResourcesImplicitly(int entityIndex)
+{
+ if (entityIndex >= xf86NumEntities) return NULL;
+
+ switch (xf86Entities[entityIndex]->bus.type) {
+ case BUS_ISA:
+ case BUS_NONE:
+ case BUS_SBUS:
+ return NULL;
+ case BUS_PCI:
+ return GetImplicitPciResources(entityIndex);
+ case BUS_last:
+ return NULL;
+ }
+ return NULL;
+}
+
+static void
+convertRange2Host(int entityIndex, resRange *pRange)
+{
+ if (pRange->type & ResBus) {
+ switch (xf86Entities[entityIndex]->busType) {
+ case BUS_PCI:
+ pciConvertRange2Host(entityIndex,pRange);
+ break;
+ case BUS_ISA:
+ isaConvertRange2Host(pRange);
+ break;
+ default:
+ break;
+ }
+
+ pRange->type &= ~ResBus;
+ }
+}
+
+/*
+ * xf86RegisterResources() -- attempts to register listed resources.
+ * If list is NULL it tries to obtain resources implicitly. Function
+ * returns a resPtr listing all resources not successfully registered.
+ */
+
+resPtr
+xf86RegisterResources(int entityIndex, resList list, unsigned long access)
+{
+ resPtr res = NULL;
+ resRange range;
+ resList list_f = NULL;
+
+ if (!list) {
+ list = xf86GetResourcesImplicitly(entityIndex);
+ /* these resources have to be in host address space already */
+ if (!list) return NULL;
+ list_f = list;
+ }
+
+ while(list->type != ResEnd) {
+ range = *list;
+
+ convertRange2Host(entityIndex,&range);
+
+ if ((access != ResNone) && (access & ResAccMask)) {
+ range.type = (range.type & ~ResAccMask) | (access & ResAccMask);
+ }
+ range.type &= ~ResEstimated; /* Not allowed for drivers */
+#if !(defined(__alpha__) && defined(linux))
+ /* On Alpha Linux, do not check for conflicts, trust the kernel. */
+ if (checkConflict(&range, Acc, entityIndex, SETUP,TRUE))
+ res = xf86AddResToList(res,&range,entityIndex);
+ else
+#endif
+ {
+ Acc = xf86AddResToList(Acc,&range,entityIndex);
+ }
+ list++;
+ }
+ if (list_f)
+ xfree(list_f);
+
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3,"Resources after driver initialization\n");
+ xf86PrintResList(3, Acc);
+ if (res) xf86MsgVerb(X_INFO, 3,
+ "Failed Resources after driver initialization "
+ "for Entity: %i\n",entityIndex);
+ xf86PrintResList(3, res);
+#endif
+ return res;
+
+}
+
+static void
+busTypeSpecific(EntityPtr pEnt, xf86State state, xf86AccessPtr *acc_mem,
+ xf86AccessPtr *acc_io, xf86AccessPtr *acc_mem_io)
+{
+ pciAccPtr *ppaccp;
+
+ switch (pEnt->bus.type) {
+ case BUS_ISA:
+ case BUS_SBUS:
+ *acc_mem = *acc_io = *acc_mem_io = &AccessNULL;
+ break;
+ break;
+ case BUS_PCI:
+ ppaccp = xf86PciAccInfo;
+ while (*ppaccp) {
+ if ((*ppaccp)->busnum == pEnt->pciBusId.bus
+ && (*ppaccp)->devnum == pEnt->pciBusId.device
+ && (*ppaccp)->funcnum == pEnt->pciBusId.func) {
+ *acc_io = &(*ppaccp)->ioAccess;
+ *acc_mem = &(*ppaccp)->memAccess;
+ *acc_mem_io = &(*ppaccp)->io_memAccess;
+ break;
+ }
+ ppaccp++;
+ }
+ break;
+ default:
+ *acc_mem = *acc_io = *acc_mem_io = NULL;
+ break;
+ }
+ return;
+}
+
+static void
+setAccess(EntityPtr pEnt, xf86State state)
+{
+
+ xf86AccessPtr acc_mem, acc_io, acc_mem_io;
+ xf86AccessPtr org_mem = NULL, org_io = NULL, org_mem_io = NULL;
+ int prop;
+
+ busTypeSpecific(pEnt,state,&acc_mem,&acc_io,&acc_mem_io);
+
+ /* The replacement function needs to handle _all_ shared resources */
+ /* unless they are handeled locally and disabled otherwise */
+ if (pEnt->rac) {
+ if (pEnt->rac->io_new) {
+ org_io = acc_io;
+ acc_io = pEnt->rac->io_new;
+ }
+ if (pEnt->rac->mem_new) {
+ org_mem = acc_mem;
+ acc_mem = pEnt->rac->mem_new;
+ }
+ if (pEnt->rac->io_mem_new) {
+ org_mem_io = acc_mem_io;
+ acc_mem_io = pEnt->rac->io_mem_new;
+ }
+ }
+
+ if (state == OPERATING) {
+ prop = pEnt->entityProp;
+ switch(pEnt->entityProp & NEED_SHARED) {
+ case NEED_SHARED:
+ pEnt->access->rt = MEM_IO;
+ break;
+ case NEED_IO_SHARED:
+ pEnt->access->rt = IO;
+ break;
+ case NEED_MEM_SHARED:
+ pEnt->access->rt = MEM;
+ break;
+ default:
+ pEnt->access->rt = NONE;
+ }
+ } else {
+ prop = NEED_SHARED | NEED_MEM | NEED_IO;
+ pEnt->access->rt = MEM_IO;
+ }
+
+ switch(pEnt->access->rt) {
+ case IO:
+ pEnt->access->pAccess = acc_io;
+ break;
+ case MEM:
+ pEnt->access->pAccess = acc_mem;
+ break;
+ case MEM_IO:
+ pEnt->access->pAccess = acc_mem_io;
+ break;
+ default: /* no conflicts at all */
+ pEnt->access->pAccess = NULL; /* remove from RAC */
+ break;
+ }
+
+ if (org_io) {
+ /* does the driver want the old access func? */
+ if (pEnt->rac->old) {
+ /* give it to the driver, leave state disabled */
+ pEnt->rac->old->io = org_io;
+ } else if (org_io->AccessEnable) {
+ /* driver doesn't want it - enable generic access */
+ org_io->AccessEnable(org_io->arg);
+ }
+ }
+
+ if (org_mem_io) {
+ /* does the driver want the old access func? */
+ if (pEnt->rac->old) {
+ /* give it to the driver, leave state disabled */
+ pEnt->rac->old->io_mem = org_mem_io;
+ } else if (org_mem_io->AccessEnable) {
+ /* driver doesn't want it - enable generic access */
+ org_mem_io->AccessEnable(org_mem_io->arg);
+ }
+ }
+
+ if (org_mem) {
+ /* does the driver want the old access func? */
+ if (pEnt->rac->old) {
+ /* give it to the driver, leave state disabled */
+ pEnt->rac->old->mem = org_mem;
+ } else if (org_mem->AccessEnable) {
+ /* driver doesn't want it - enable generic access */
+ org_mem->AccessEnable(org_mem->arg);
+ }
+ }
+
+ if (!(prop & NEED_MEM_SHARED)){
+ if (prop & NEED_MEM) {
+ if (acc_mem && acc_mem->AccessEnable)
+ acc_mem->AccessEnable(acc_mem->arg);
+ } else {
+ if (acc_mem && acc_mem->AccessDisable)
+ acc_mem->AccessDisable(acc_mem->arg);
+ }
+ }
+
+ if (!(prop & NEED_IO_SHARED)) {
+ if (prop & NEED_IO) {
+ if (acc_io && acc_io->AccessEnable)
+ acc_io->AccessEnable(acc_io->arg);
+ } else {
+ if (acc_io && acc_io->AccessDisable)
+ acc_io->AccessDisable(acc_io->arg);
+ }
+ }
+
+ /* disable shared resources */
+ if (pEnt->access->pAccess
+ && pEnt->access->pAccess->AccessDisable)
+ pEnt->access->pAccess->AccessDisable(pEnt->access->pAccess->arg);
+
+ /*
+ * If device is not under access control it is enabled.
+ * If it needs bus routing do it here as it isn't bus
+ * type specific. Any conflicts should be checked at this
+ * stage
+ */
+ if (!pEnt->access->pAccess
+ && (pEnt->entityProp & (state == SETUP ? NEED_VGA_ROUTED_SETUP :
+ NEED_VGA_ROUTED)))
+ ((BusAccPtr)pEnt->busAcc)->set_f(pEnt->busAcc);
+}
+
+
+/*
+ * xf86EnterServerState() -- set state the server is in.
+ */
+
+typedef enum { TRI_UNSET, TRI_TRUE, TRI_FALSE } TriState;
+
+static void
+SetSIGIOForState(xf86State state)
+{
+ static int sigio_state;
+ static TriState sigio_blocked = TRI_UNSET;
+
+ if ((state == SETUP) && (sigio_blocked != TRI_TRUE)) {
+ sigio_state = xf86BlockSIGIO();
+ sigio_blocked = TRI_TRUE;
+ } else if ((state == OPERATING) && (sigio_blocked != TRI_UNSET)) {
+ xf86UnblockSIGIO(sigio_state);
+ sigio_blocked = TRI_FALSE;
+ }
+}
+
+void
+xf86EnterServerState(xf86State state)
+{
+ EntityPtr pEnt;
+ ScrnInfoPtr pScrn;
+ int i,j;
+ int needVGA = 0;
+ resType rt;
+ /*
+ * This is a good place to block SIGIO during SETUP state.
+ * SIGIO should be blocked in SETUP state otherwise (u)sleep()
+ * might get interrupted early.
+ * We take care not to call xf86BlockSIGIO() twice.
+ */
+ SetSIGIOForState(state);
+#ifdef DEBUG
+ if (state == SETUP)
+ ErrorF("Entering SETUP state\n");
+ else
+ ErrorF("Entering OPERATING state\n");
+#endif
+
+ /* When servicing a dumb framebuffer we don't need to do anything */
+ if (doFramebufferMode) return;
+
+ for (i=0; i<xf86NumScreens; i++) {
+ pScrn = xf86Screens[i];
+ j = pScrn->entityList[pScrn->numEntities - 1];
+ pScrn->access = xf86Entities[j]->access;
+
+ for (j = 0; j<xf86Screens[i]->numEntities; j++) {
+ pEnt = xf86Entities[xf86Screens[i]->entityList[j]];
+ if (pEnt->entityProp & (state == SETUP ? NEED_VGA_ROUTED_SETUP
+ : NEED_VGA_ROUTED))
+ xf86Screens[i]->busAccess = pEnt->busAcc;
+ }
+ if (xf86Screens[i]->busAccess)
+ needVGA ++;
+ }
+
+ /*
+ * if we just have one screen we don't have RAC.
+ * Therefore just enable the screen and return.
+ */
+ if (!needRAC) {
+ xf86EnableAccess(xf86Screens[0]);
+ notifyStateChange(NOTIFY_ENABLE);
+ return;
+ }
+
+ if (state == SETUP)
+ notifyStateChange(NOTIFY_SETUP_TRANSITION);
+ else
+ notifyStateChange(NOTIFY_OPERATING_TRANSITION);
+
+ clearAccess();
+ for (i=0; i<xf86NumScreens;i++) {
+
+ rt = NONE;
+
+ for (j = 0; j<xf86Screens[i]->numEntities; j++) {
+ pEnt = xf86Entities[xf86Screens[i]->entityList[j]];
+ setAccess(pEnt,state);
+
+ if (pEnt->access->rt != NONE) {
+ if (rt != NONE && rt != pEnt->access->rt)
+ rt = MEM_IO;
+ else
+ rt = pEnt->access->rt;
+ }
+ }
+ xf86Screens[i]->resourceType = rt;
+ if (rt == NONE) {
+ xf86Screens[i]->access = NULL;
+ if (needVGA < 2)
+ xf86Screens[i]->busAccess = NULL;
+ }
+
+#ifdef DEBUG
+ if (xf86Screens[i]->busAccess)
+ ErrorF("Screen %i setting vga route\n",i);
+#endif
+ switch (rt) {
+ case MEM_IO:
+ xf86MsgVerb(X_INFO, 3, "Screen %i shares mem & io resources\n",i);
+ break;
+ case IO:
+ xf86MsgVerb(X_INFO, 3, "Screen %i shares io resources\n",i);
+ break;
+ case MEM:
+ xf86MsgVerb(X_INFO, 3, "Screen %i shares mem resources\n",i);
+ break;
+ default:
+ xf86MsgVerb(X_INFO, 3, "Entity %i shares no resources\n",i);
+ break;
+ }
+ }
+ if (state == SETUP)
+ notifyStateChange(NOTIFY_SETUP);
+ else
+ notifyStateChange(NOTIFY_OPERATING);
+}
+
+/*
+ * xf86SetOperatingState() -- Set ResOperMask for resources listed.
+ */
+resPtr
+xf86SetOperatingState(resList list, int entityIndex, int mask)
+{
+ resPtr acc;
+ resPtr r_fail = NULL;
+ resRange range;
+
+ while (list->type != ResEnd) {
+ range = *list;
+ convertRange2Host(entityIndex,&range);
+
+ acc = Acc;
+ while (acc) {
+#define MASK (ResTypeMask | ResExtMask)
+ if ((acc->entityIndex == entityIndex)
+ && (acc->val.a == range.a) && (acc->val.b == range.b)
+ && ((acc->val.type & MASK) == (range.type & MASK)))
+ break;
+#undef MASK
+ acc = acc->next;
+ }
+ if (acc)
+ acc->val.type = (acc->val.type & ~ResOprMask)
+ | (mask & ResOprMask);
+ else {
+ r_fail = xf86AddResToList(r_fail,&range,entityIndex);
+ }
+ list ++;
+ }
+
+ return r_fail;
+}
+
+/*
+ * Stage specific code
+ */
+ /*
+ * ProcessEstimatedConflicts() -- Do something about driver-registered
+ * resources that conflict with estimated resources. For now, just register
+ * them with a logged warning.
+ */
+#ifdef REDUCER
+static void
+ProcessEstimatedConflicts(void)
+{
+ if (!AccReducers)
+ return;
+
+ /* Temporary */
+ xf86MsgVerb(X_WARNING, 3,
+ "Registering the following despite conflicts with estimated"
+ " resources:\n");
+ xf86PrintResList(3, AccReducers);
+ Acc = xf86JoinResLists(Acc, AccReducers);
+ AccReducers = NULL;
+}
+#endif
+
+/*
+ * xf86ClaimFixedResources() -- This function gets called from the
+ * driver Probe() function to claim fixed resources.
+ */
+static void
+resError(resList list)
+{
+ FatalError("A driver tried to allocate the %s %sresource at \n"
+ "0x%x:0x%x which conflicted with another resource. Send the\n"
+ "output of the server to %s. Please \n"
+ "specify your computer hardware as closely as possible.\n",
+ ResIsBlock(list)?"Block":"Sparse",
+ ResIsMem(list)?"Mem":"Io",
+ ResIsBlock(list)?list->rBegin:list->rBase,
+ ResIsBlock(list)?list->rEnd:list->rMask,BUILDERADDR);
+}
+
+/*
+ * xf86ClaimFixedResources() is used to allocate non-relocatable resources.
+ * This should only be done by a driver's Probe() function.
+ */
+void
+xf86ClaimFixedResources(resList list, int entityIndex)
+{
+ resPtr ptr = NULL;
+ resRange range;
+
+ if (!list) return;
+
+ while (list->type !=ResEnd) {
+ range = *list;
+
+ convertRange2Host(entityIndex,&range);
+
+ range.type &= ~ResEstimated; /* Not allowed for drivers */
+ switch (range.type & ResAccMask) {
+ case ResExclusive:
+ if (!xf86ChkConflict(&range, entityIndex)) {
+ Acc = xf86AddResToList(Acc, &range, entityIndex);
+#ifdef REDUCER
+ } else {
+ range.type |= ResEstimated;
+ if (!xf86ChkConflict(&range, entityIndex) &&
+ !checkConflict(&range, AccReducers, entityIndex,
+ SETUP, FALSE)) {
+ range.type &= ~(ResEstimated | ResBios);
+ AccReducers =
+ xf86AddResToList(AccReducers, &range, entityIndex);
+#endif
+ } else resError(&range); /* no return */
+#ifdef REDUCER
+ }
+#endif
+ break;
+ case ResShared:
+ /* at this stage the resources are just added to the
+ * EntityRec. After the Probe() phase this list is checked by
+ * xf86PostProbe(). All resources which don't
+ * conflict with already allocated ones are allocated
+ * and removed from the EntityRec. Thus a non-empty resource
+ * list in the EntityRec indicates resource conflicts the
+ * driver should either handle or fail.
+ */
+ if (xf86Entities[entityIndex]->active)
+ ptr = xf86AddResToList(ptr,&range,entityIndex);
+ break;
+ }
+ list++;
+ }
+ xf86Entities[entityIndex]->resources =
+ xf86JoinResLists(xf86Entities[entityIndex]->resources,ptr);
+ xf86MsgVerb(X_INFO, 3,
+ "resource ranges after xf86ClaimFixedResources() call:\n");
+ xf86PrintResList(3,Acc);
+#ifdef REDUCER
+ ProcessEstimatedConflicts();
+#endif
+#ifdef DEBUG
+ if (ptr) {
+ xf86MsgVerb(X_INFO, 3, "to be registered later:\n");
+ xf86PrintResList(3,ptr);
+ }
+#endif
+}
+
+static void
+checkRoutingForScreens(xf86State state)
+{
+ resList list = resVgaUnusedExclusive;
+ resPtr pResVGA = NULL;
+ resPtr pResVGAHost;
+ pointer vga = NULL;
+ int i,j;
+ int entityIndex;
+ EntityPtr pEnt;
+ resPtr pAcc;
+ resRange range;
+
+ /*
+ * find devices that need VGA routed: ie the ones that have
+ * registered VGA resources without ResUnused. ResUnused
+ * doesn't conflict with itself therefore use it here.
+ */
+ while (list->type != ResEnd) { /* create resPtr from resList for VGA */
+ range = *list;
+ range.type &= ~(ResBios | ResEstimated); /* if set remove them */
+ pResVGA = xf86AddResToList(pResVGA, &range, -1);
+ list++;
+ }
+
+ for (i = 0; i < xf86NumScreens; i++) {
+ for (j = 0; j < xf86Screens[i]->numEntities; j++) {
+ entityIndex = xf86Screens[i]->entityList[j];
+ pEnt = xf86Entities[entityIndex];
+ pAcc = Acc;
+ vga = NULL;
+ pResVGAHost = xf86DupResList(pResVGA);
+ xf86ConvertListToHost(entityIndex,pResVGAHost);
+ while (pAcc) {
+ if (pAcc->entityIndex == entityIndex)
+ if (checkConflict(&pAcc->val, pResVGAHost,
+ entityIndex, state, FALSE)) {
+ if (vga && vga != pEnt->busAcc) {
+ xf86Msg(X_ERROR, "Screen %i needs vga routed to"
+ "different buses - deleting\n",i);
+ xf86DeleteScreen(i--,0);
+ }
+#ifdef DEBUG
+ {
+ resPtr rlist = xf86AddResToList(NULL,&pAcc->val,
+ pAcc->entityIndex);
+ xf86MsgVerb(X_INFO,3,"====== %s\n",
+ state == OPERATING ? "OPERATING"
+ : "SETUP");
+ xf86MsgVerb(X_INFO,3,"%s Resource:\n",
+ (pAcc->val.type) & ResMem ? "Mem" :"Io");
+ xf86PrintResList(3,rlist);
+ xf86FreeResList(rlist);
+ xf86MsgVerb(X_INFO,3,"Conflicts with:\n");
+ xf86PrintResList(3,pResVGAHost);
+ xf86MsgVerb(X_INFO,3,"=====\n");
+ }
+#endif
+ vga = pEnt->busAcc;
+ pEnt->entityProp |= (state == SETUP
+ ? NEED_VGA_ROUTED_SETUP : NEED_VGA_ROUTED);
+ if (state == OPERATING) {
+ if (pAcc->val.type & ResMem)
+ pEnt->entityProp |= NEED_VGA_MEM;
+ else
+ pEnt->entityProp |= NEED_VGA_IO;
+ }
+ }
+ pAcc = pAcc->next;
+ }
+ if (vga)
+ xf86MsgVerb(X_INFO, 3,"Setting vga for screen %i.\n",i);
+ xf86FreeResList(pResVGAHost);
+ }
+ }
+ xf86FreeResList(pResVGA);
+}
+
+/*
+ * xf86PostProbe() -- Allocate all non conflicting resources
+ * This function gets called by xf86Init().
+ */
+void
+xf86PostProbe(void)
+{
+ memType val;
+ int i,j;
+ resPtr resp, acc, tmp, resp_x, *pprev_next;
+
+ if (fbSlotClaimed) {
+ if (pciSlotClaimed || isaSlotClaimed
+#if defined(__sparc__) && !defined(__OpenBSD__)
+ || sbusSlotClaimed
+#endif
+ ) {
+ FatalError("Cannot run in framebuffer mode. Please specify busIDs "
+ " for all framebuffer devices\n");
+ return;
+ } else {
+ xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n");
+ xf86AccessRestoreState();
+ notifyStateChange(NOTIFY_ENABLE);
+ doFramebufferMode = TRUE;
+
+ return;
+ }
+ }
+ /* don't compare against ResInit - remove it from clone.*/
+ acc = tmp = xf86DupResList(Acc);
+ pprev_next = &acc;
+ while (tmp) {
+ if (tmp->res_type & ResInit) {
+ (*pprev_next) = tmp->next;
+ xfree(tmp);
+ } else
+ pprev_next = &(tmp->next);
+ tmp = (*pprev_next);
+ }
+
+ for (i=0; i<xf86NumEntities; i++) {
+ resp = xf86Entities[i]->resources;
+ xf86Entities[i]->resources = NULL;
+ resp_x = NULL;
+ while (resp) {
+ if (! (val = checkConflict(&resp->val,acc,i,SETUP,FALSE))) {
+ resp->res_type &= ~(ResBios); /* just used for chkConflict() */
+ tmp = resp_x;
+ resp_x = resp;
+ resp = resp->next;
+ resp_x->next = tmp;
+#ifdef REDUCER
+ } else {
+ resp->res_type |= ResEstimated;
+ if (!checkConflict(&resp->val, acc, i, SETUP, FALSE)) {
+ resp->res_type &= ~(ResEstimated | ResBios);
+ tmp = AccReducers;
+ AccReducers = resp;
+ resp = resp->next;
+ AccReducers->next = tmp;
+#endif
+ } else {
+ xf86MsgVerb(X_INFO, 3, "Found conflict at: 0x%lx\n",val);
+ resp->res_type &= ~ResEstimated;
+ tmp = xf86Entities[i]->resources;
+ xf86Entities[i]->resources = resp;
+ resp = resp->next;
+ xf86Entities[i]->resources->next = tmp;
+ }
+#ifdef REDUCER
+ }
+#endif
+ }
+ xf86JoinResLists(Acc,resp_x);
+#ifdef REDUCER
+ ProcessEstimatedConflicts();
+#endif
+ }
+ xf86FreeResList(acc);
+
+#if !(defined(__alpha__) && defined(linux)) && \
+ !(defined(__sparc64__) && defined(__OpenBSD__))
+ /*
+ * No need to validate on Alpha Linux or OpenBSD/sparc64,
+ * trust the kernel.
+ */
+ ValidatePci();
+#endif
+
+ xf86MsgVerb(X_INFO, 3, "resource ranges after probing:\n");
+ xf86PrintResList(3, Acc);
+ checkRoutingForScreens(SETUP);
+
+ for (i = 0; i < xf86NumScreens; i++) {
+ for (j = 0; j<xf86Screens[i]->numEntities; j++) {
+ EntityPtr pEnt = xf86Entities[xf86Screens[i]->entityList[j]];
+ if ((pEnt->entityProp & NEED_VGA_ROUTED_SETUP) &&
+ ((xf86Screens[i]->busAccess = pEnt->busAcc)))
+ break;
+ }
+ }
+}
+
+static void
+checkRequiredResources(int entityIndex)
+{
+ resRange range;
+ resPtr pAcc = Acc;
+ const EntityPtr pEnt = xf86Entities[entityIndex];
+ while (pAcc) {
+ if (pAcc->entityIndex == entityIndex) {
+ range = pAcc->val;
+ /* ResAny to find conflicts with anything. */
+ range.type = (range.type & ~ResAccMask) | ResAny | ResBios;
+ if (checkConflict(&range,Acc,entityIndex,OPERATING,FALSE))
+ switch (pAcc->res_type & ResPhysMask) {
+ case ResMem:
+ pEnt->entityProp |= NEED_MEM_SHARED;
+ break;
+ case ResIo:
+ pEnt->entityProp |= NEED_IO_SHARED;
+ break;
+ }
+ if (!(pAcc->res_type & ResOprMask)) {
+ switch (pAcc->res_type & ResPhysMask) {
+ case ResMem:
+ pEnt->entityProp |= NEED_MEM;
+ break;
+ case ResIo:
+ pEnt->entityProp |= NEED_IO;
+ break;
+ }
+ }
+ }
+ pAcc = pAcc->next;
+ }
+
+ /* check if we can separately enable mem/io resources */
+ /* XXX we still need to find out how to set this yet */
+ if ( ((pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO)
+ && (pEnt->entityProp & NEED_MEM_SHARED))
+ || ((pEnt->entityProp & NO_SEPARATE_IO_FROM_MEM)
+ && (pEnt->entityProp & NEED_IO_SHARED)) )
+ pEnt->entityProp |= NEED_SHARED;
+ /*
+ * After we have checked all resources of an entity agains any
+ * other resource we know if the entity need this resource type
+ * (ie. mem/io) at all. if not we can disable this type completely,
+ * so no need to share it either.
+ */
+ if ((pEnt->entityProp & NEED_MEM_SHARED)
+ && (!(pEnt->entityProp & NEED_MEM))
+ && (!(pEnt->entityProp & NO_SEPARATE_MEM_FROM_IO)))
+ pEnt->entityProp &= ~(unsigned long)NEED_MEM_SHARED;
+
+ if ((pEnt->entityProp & NEED_IO_SHARED)
+ && (!(pEnt->entityProp & NEED_IO))
+ && (!(pEnt->entityProp & NO_SEPARATE_IO_FROM_MEM)))
+ pEnt->entityProp &= ~(unsigned long)NEED_IO_SHARED;
+}
+
+void
+xf86PostPreInit()
+{
+ if (doFramebufferMode) return;
+
+ if (xf86NumScreens > 1)
+ needRAC = TRUE;
+
+#ifdef XFree86LOADER
+ xf86MsgVerb(X_INFO, 3, "do I need RAC?");
+
+ if (needRAC) {
+ xf86ErrorFVerb(3, " Yes, I do.\n");
+
+ if (!xf86LoadOneModule("rac",NULL))
+ FatalError("Cannot load RAC module\n");
+ } else
+ xf86ErrorFVerb(3, " No, I don't.\n");
+#endif
+
+ xf86MsgVerb(X_INFO, 3, "resource ranges after preInit:\n");
+ xf86PrintResList(3, Acc);
+}
+
+void
+xf86PostScreenInit(void)
+{
+ int i,j;
+ ScreenPtr pScreen;
+ unsigned int flags;
+ int nummem = 0, numio = 0;
+#ifdef XFree86LOADER
+ pointer xf86RACInit = NULL;
+#endif
+
+ if (doFramebufferMode) {
+ SetSIGIOForState(OPERATING);
+ return;
+ }
+
+#ifdef XFree86LOADER
+ if (needRAC) {
+ xf86RACInit = LoaderSymbol("xf86RACInit");
+ if (!xf86RACInit)
+ FatalError("Cannot resolve symbol \"xf86RACInit\"\n");
+ }
+#endif
+#ifdef DEBUG
+ ErrorF("PostScreenInit generation: %i\n",serverGeneration);
+#endif
+ if (serverGeneration == 1) {
+ checkRoutingForScreens(OPERATING);
+ for (i=0; i<xf86NumEntities; i++) {
+ checkRequiredResources(i);
+ }
+
+ /*
+ * after removing NEED_XXX_SHARED from entities that
+ * don't need need XXX resources at all we might have
+ * a single entity left that has NEED_XXX_SHARED set.
+ * In this case we can delete that, too.
+ */
+ for (i = 0; i < xf86NumEntities; i++) {
+ if (xf86Entities[i]->entityProp & NEED_MEM_SHARED)
+ nummem++;
+ if (xf86Entities[i]->entityProp & NEED_IO_SHARED)
+ numio++;
+ }
+ for (i = 0; i < xf86NumEntities; i++) {
+ if (nummem < 2)
+ xf86Entities[i]->entityProp &= ~NEED_MEM_SHARED;
+ if (numio < 2)
+ xf86Entities[i]->entityProp &= ~NEED_IO_SHARED;
+ }
+ }
+
+ if (xf86Screens && needRAC) {
+ int needRACforVga = 0;
+
+ for (i = 0; i < xf86NumScreens; i++) {
+ for (j = 0; j < xf86Screens[i]->numEntities; j++) {
+ if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
+ & NEED_VGA_ROUTED) {
+ needRACforVga ++;
+ break; /* only count each screen once */
+ }
+ }
+ }
+
+ for (i = 0; i < xf86NumScreens; i++) {
+ Bool needRACforMem = FALSE, needRACforIo = FALSE;
+
+ for (j = 0; j < xf86Screens[i]->numEntities; j++) {
+ if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
+ & NEED_MEM_SHARED)
+ needRACforMem = TRUE;
+ if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
+ & NEED_IO_SHARED)
+ needRACforIo = TRUE;
+ /*
+ * We may need RAC although we don't share any resources
+ * as we need to route VGA to the correct bus. This can
+ * only be done simultaniously for MEM and IO.
+ */
+ if (needRACforVga > 1) {
+ if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
+ & NEED_VGA_MEM)
+ needRACforMem = TRUE;
+ if (xf86Entities[xf86Screens[i]->entityList[j]]->entityProp
+ & NEED_VGA_IO)
+ needRACforIo = TRUE;
+ }
+ }
+
+ pScreen = xf86Screens[i]->pScreen;
+ flags = 0;
+ if (needRACforMem) {
+ flags |= xf86Screens[i]->racMemFlags;
+ xf86ErrorFVerb(3, "Screen %d is using RAC for mem\n", i);
+ }
+ if (needRACforIo) {
+ flags |= xf86Screens[i]->racIoFlags;
+ xf86ErrorFVerb(3, "Screen %d is using RAC for io\n", i);
+ }
+
+#ifdef XFree86LOADER
+ ((Bool(*)(ScreenPtr,unsigned int))xf86RACInit)
+ (pScreen,flags);
+#else
+ xf86RACInit(pScreen,flags);
+#endif
+ }
+ }
+
+ xf86EnterServerState(OPERATING);
+
+}
+
+/*
+ * Sets
+ */
+
+
+static resPtr
+decomposeSparse(resRange range)
+{
+ resRange new;
+ resPtr ret = NULL;
+ memType val = range.rBegin;
+ int i = 0;
+
+ new.type = (range.type & ~ResExtMask) | ResSparse;
+
+ while (1) {
+ if (val & 0x01) {
+ new.rBase = (val << i);
+ new.rMask = ~((1 << i) - 1);
+ ret = xf86AddResToList(ret,&new,-1);
+ val ++;
+ }
+ i++;
+ val >>= 1;
+ if ((((val + 1) << i) - 1) > range.rEnd)
+ break;
+ }
+ i--;
+ val <<= 1;
+
+ while (1) {
+ if((((val + 1) << i) - 1)> range.rEnd) {
+ if (--i < 0) break;
+ val <<= 1;
+ } else {
+ new.rBase = (val << i);
+ new.rMask = ~((1 << i) - 1);
+ val++;
+ ret = xf86AddResToList(ret,&new,-1);
+ }
+ }
+ return ret;
+}
+
+static Bool
+x_isSubsetOf(resRange range, resPtr list1, resPtr list2)
+{
+ resRange range1, range2;
+ memType m1_A_m2;
+ Bool ret;
+ resPtr list;
+
+ if (list1) {
+ list = list1;
+ if ((range.type & ResTypeMask) == (list->res_type & ResTypeMask)) {
+ switch (range.type & ResExtMask) {
+ case ResBlock:
+ if ((list->res_type & ResExtMask) == ResBlock) {
+ if (range.rBegin >= list->block_begin
+ && range.rEnd <= list->block_end)
+ return TRUE;
+ else if (range.rBegin < list->block_begin
+ && range.rEnd > list->block_end) {
+ RANGE(range1, range.rBegin, list->block_begin - 1,
+ range.type);
+ RANGE(range2, list->block_end + 1, range.rEnd,
+ range.type);
+ return (x_isSubsetOf(range1,list->next,list2) &&
+ x_isSubsetOf(range2,list->next,list2));
+ }
+ else if (range.rBegin >= list->block_begin
+ && range.rBegin <= list->block_end) {
+ RANGE(range1, list->block_end + 1, range.rEnd,
+ range.type);
+ return (x_isSubsetOf(range1,list->next,list2));
+ } else if (range.rEnd >= list->block_begin
+ && range.rEnd <= list->block_end) {
+ RANGE(range1,range.rBegin, list->block_begin - 1,
+ range.type);
+ return (x_isSubsetOf(range1,list->next,list2));
+ }
+ }
+ break;
+ case ResSparse:
+ if ((list->res_type & ResExtMask) == ResSparse) {
+ memType test;
+ int i;
+
+ m1_A_m2 = range.rMask & list->sparse_mask;
+ if ((range.rBase ^ list->sparse_base) & m1_A_m2)
+ break;
+ /*
+ * We use the following system:
+ * let 0 ^= mask:1 base:0, 1 ^= mask:1 base:1,
+ * X mask:0 ; S: set TSS: test set for subset
+ * NTSS: new test set after test
+ * S: 1 0 1 0 X X 0 1 X
+ * TSS: 1 0 0 1 1 0 X X X
+ * T: 0 0 1 1 0 0 0 0 0
+ * NTSS: 1 0 0/X 1/X 1 0 1 0 X
+ * R: 0 0 0 0 0 0 1 1 0
+ * If R != 0 TSS and S are disjunct
+ * If R == 0 TSS is subset of S
+ * If R != 0 NTSS contains elements from TSS
+ * which are not also members of S.
+ * If a T is set one of the correspondig bits
+ * in NTSS must be set to the specified value
+ * all other are X
+ */
+ test = list->sparse_mask & ~range.rMask;
+ if (test == 0)
+ return TRUE;
+ for (i = 0; i < sizeof(memType); i++) {
+ if ((test >> i) & 0x1) {
+ RANGE(range1, ((range.rBase & list->sparse_base)
+ | (range.rBase & ~list->sparse_mask)
+ | ((~list->sparse_base & list->sparse_mask)
+ & ~range.rMask)) & range1.rMask,
+ ((range.rMask | list->sparse_mask) & ~test)
+ | (1 << i), range.type);
+ return (x_isSubsetOf(range1,list->next,list2));
+ }
+ }
+ }
+ break;
+ }
+ }
+ return (x_isSubsetOf(range,list->next,list2));
+ } else if (list2) {
+ resPtr tmpList = NULL;
+ switch (range.type & ResExtMask) {
+ case ResBlock:
+ tmpList = decomposeSparse(range);
+ while (tmpList) {
+ if (!x_isSubsetOf(tmpList->val,list2,NULL)) {
+ xf86FreeResList(tmpList);
+ return FALSE;
+ }
+ tmpList = tmpList->next;
+ }
+ xf86FreeResList(tmpList);
+ return TRUE;
+ break;
+ case ResSparse:
+ while (list2) {
+ tmpList = xf86JoinResLists(tmpList,decomposeSparse(list2->val));
+ list2 = list2->next;
+ }
+ ret = x_isSubsetOf(range,tmpList,NULL);
+ xf86FreeResList(tmpList);
+ return ret;
+ break;
+ }
+ } else
+ return FALSE;
+
+ return FALSE;
+}
+
+Bool
+xf86IsSubsetOf(resRange range, resPtr list)
+{
+ resPtr dup = xf86DupResList(list);
+ resPtr r_sp = NULL, r = NULL, tmp = NULL;
+ Bool ret = FALSE;
+
+ while (dup) {
+ tmp = dup;
+ dup = dup->next;
+ switch (tmp->res_type & ResExtMask) {
+ case ResBlock:
+ tmp->next = r;
+ r = tmp;
+ break;
+ case ResSparse:
+ tmp->next = r_sp;
+ r_sp = tmp;
+ break;
+ }
+ }
+
+ switch (range.type & ResExtMask) {
+ case ResBlock:
+ ret = x_isSubsetOf(range,r,r_sp);
+ break;
+ case ResSparse:
+ ret = x_isSubsetOf(range,r_sp,r);
+ break;
+ }
+ xf86FreeResList(r);
+ xf86FreeResList(r_sp);
+
+ return ret;
+}
+
+Bool
+xf86IsListSubsetOf(resPtr list, resPtr BaseList)
+{
+ while (list) {
+ if (! xf86IsSubsetOf(list->val,BaseList))
+ return FALSE;
+ list = list->next;
+ }
+ return TRUE;
+}
+
+resPtr
+findIntersect(resRange Range, resPtr list)
+{
+ resRange range;
+ resPtr new = NULL;
+
+ while (list) {
+ if ((Range.type & ResTypeMask) == (list->res_type & ResTypeMask)) {
+ switch (Range.type & ResExtMask) {
+ case ResBlock:
+ switch (list->res_type & ResExtMask) {
+ case ResBlock:
+ if (Range.rBegin >= list->block_begin)
+ range.rBegin = Range.rBegin;
+ else
+ range.rBegin = list->block_begin;
+ if (Range.rEnd <= list->block_end)
+ range.rEnd = Range.rEnd;
+ else
+ range.rEnd = list->block_end;
+ if (range.rEnd > range.rBegin) {
+ range.type = Range.type;
+ new = xf86AddResToList(new,&range,-1);
+ }
+ break;
+ case ResSparse:
+ new = xf86JoinResLists(new,xf86FindIntersectOfLists(new,decomposeSparse(list->val)));
+ break;
+ }
+ break;
+ case ResSparse:
+ switch (list->res_type & ResExtMask) {
+ case ResSparse:
+ if (!((~(range.rBase ^ list->sparse_base)
+ & (range.rMask & list->sparse_mask)))) {
+ RANGE(range, (range.rBase & list->sparse_base)
+ | (~range.rMask & list->sparse_base)
+ | (~list->sparse_mask & range.rBase),
+ range.rMask | list->sparse_mask,
+ Range.type);
+ new = xf86AddResToList(new,&range,-1);
+ }
+ break;
+ case ResBlock:
+ new = xf86JoinResLists(new,xf86FindIntersectOfLists(
+ decomposeSparse(range),list));
+ break;
+ }
+ }
+ }
+ list = list->next;
+ }
+ return new;
+}
+
+resPtr
+xf86FindIntersectOfLists(resPtr l1, resPtr l2)
+{
+ resPtr ret = NULL;
+
+ while (l1) {
+ ret = xf86JoinResLists(ret,findIntersect(l1->val,l2));
+ l1 = l1->next;
+ }
+ return ret;
+}
+
+#if 0 /* Not used */
+static resPtr
+xf86FindComplement(resRange Range)
+{
+ resRange range;
+ memType tmp;
+ resPtr new = NULL;
+ int i;
+
+ switch (Range.type & ResExtMask) {
+ case ResBlock:
+ if (Range.rBegin > 0) {
+ RANGE(range, 0, Range.rBegin - 1, Range.type);
+ new = xf86AddResToList(new,&range,-1);
+ }
+ if (Range.rEnd < (memType)~0) {
+ RANGE(range,Range.rEnd + 1, (memType)~0, Range.type);
+ new = xf86AddResToList(new,&range,-1);
+ }
+ break;
+ case ResSparse:
+ tmp = Range.rMask;
+ for (i = 0; i < sizeof(memType); i++) {
+ if (tmp & 0x1) {
+ RANGE(range,(~Range.rMask & range.rMask),(1 << i), Range.type);
+ new = xf86AddResToList(new,&range,-1);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ return new;
+}
+#endif
+
+resPtr
+xf86ExtractTypeFromList(resPtr list, unsigned long type)
+{
+ resPtr ret = NULL;
+
+ while (list) {
+ if ((list->res_type & ResTypeMask) == type)
+ ret = xf86AddResToList(ret,&(list->val),list->entityIndex);
+ list = list->next;
+ }
+ return ret;
+}
+
+/*------------------------------------------------------------*/
+static void CheckGenericGA(void);
+
+/*
+ * xf86FindPrimaryDevice() - Find the display device which
+ * was active when the server was started.
+ */
+void
+xf86FindPrimaryDevice()
+{
+ /* if no VGA device is found check for primary PCI device */
+ if (primaryBus.type == BUS_NONE)
+ CheckGenericGA();
+ if (primaryBus.type != BUS_NONE) {
+ char *bus;
+ char *loc = xnfcalloc(1,9);
+ if (loc == NULL) return;
+
+ switch (primaryBus.type) {
+ case BUS_PCI:
+ bus = "PCI";
+ sprintf(loc," %2.2x:%2.2x:%1.1x",primaryBus.id.pci.bus,
+ primaryBus.id.pci.device,primaryBus.id.pci.func);
+ break;
+ case BUS_ISA:
+ bus = "ISA";
+ loc[0] = '\0';
+ break;
+ case BUS_SBUS:
+ bus = "SBUS";
+ sprintf(loc," %2.2x",primaryBus.id.sbus.fbNum);
+ break;
+ default:
+ bus = "";
+ loc[0] = '\0';
+ }
+
+ xf86MsgVerb(X_INFO, 2, "Primary Device is: %s%s\n",bus,loc);
+ xfree(loc);
+ }
+
+}
+
+#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
+#include "vgaHW.h"
+#include "compiler.h"
+#endif
+
+/*
+ * CheckGenericGA() - Check for presence of a VGA device.
+ */
+static void
+CheckGenericGA()
+{
+/* This needs to be changed for multiple domains */
+#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
+ IOADDRESS GenericIOBase = VGAHW_GET_IOBASE();
+ CARD8 CurrentValue, TestValue;
+
+ /* VGA CRTC registers are not used here, so don't bother unlocking them */
+
+ /* VGA has one more read/write attribute register than EGA */
+ (void) inb(GenericIOBase + VGA_IN_STAT_1_OFFSET); /* Reset flip-flop */
+ outb(VGA_ATTR_INDEX, 0x14 | 0x20);
+ CurrentValue = inb(VGA_ATTR_DATA_R);
+ outb(VGA_ATTR_DATA_W, CurrentValue ^ 0x0F);
+ outb(VGA_ATTR_INDEX, 0x14 | 0x20);
+ TestValue = inb(VGA_ATTR_DATA_R);
+ outb(VGA_ATTR_DATA_W, CurrentValue);
+
+ if ((CurrentValue ^ 0x0F) == TestValue) {
+ primaryBus.type = BUS_ISA;
+ }
+#endif
+}
+
+Bool
+xf86NoSharedResources(int screenIndex,resType res)
+{
+ int j;
+
+ if (screenIndex > xf86NumScreens)
+ return TRUE;
+
+ for (j = 0; j < xf86Screens[screenIndex]->numEntities; j++) {
+ switch (res) {
+ case IO:
+ if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp
+ & NEED_IO_SHARED)
+ return FALSE;
+ break;
+ case MEM:
+ if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp
+ & NEED_MEM_SHARED)
+ return FALSE;
+ break;
+ case MEM_IO:
+ if ( xf86Entities[xf86Screens[screenIndex]->entityList[j]]->entityProp
+ & NEED_SHARED)
+ return FALSE;
+ break;
+ case NONE:
+ break;
+ }
+ }
+ return TRUE;
+}
+
+void
+xf86ConvertListToHost(int entityIndex, resPtr list)
+{
+ while (list) {
+ convertRange2Host(entityIndex, &list->val);
+ list = list->next;
+ }
+}
+
+void
+xf86RegisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func, pointer arg)
+{
+ StateChangeNotificationPtr ptr =
+ (StateChangeNotificationPtr)xnfalloc(sizeof(StateChangeNotificationRec));
+
+ ptr->func = func;
+ ptr->arg = arg;
+ ptr->next = StateChangeNotificationList;
+ StateChangeNotificationList = ptr;
+}
+
+Bool
+xf86DeregisterStateChangeNotificationCallback(xf86StateChangeNotificationCallbackFunc func)
+{
+ StateChangeNotificationPtr *ptr = &StateChangeNotificationList;
+ StateChangeNotificationPtr tmp;
+
+ while (*ptr) {
+ if ((*ptr)->func == func) {
+ tmp = (*ptr);
+ (*ptr) = (*ptr)->next;
+ xfree(tmp);
+ return TRUE;
+ }
+ ptr = &((*ptr)->next);
+ }
+ return FALSE;
+}
+
+static void
+notifyStateChange(xf86NotifyState state)
+{
+ StateChangeNotificationPtr ptr = StateChangeNotificationList;
+ while (ptr) {
+ ptr->func(state,ptr->arg);
+ ptr = ptr->next;
+ }
+}
+
+#ifdef async
+Bool
+xf86QueueAsyncEvent(void (*func)(pointer),pointer arg)
+{
+ AsyncQPtr new;
+
+ if (!AsyncQ) return FALSE;
+
+ new = (AsyncQPtr)xfnalloc(sizeof(AsyncQRec));
+ new->func = func;
+ new->arg = arg;
+ (*AsyncQPtr)->next = new;
+ AsyncQPtr = &new;
+ return TRUE;
+}
+#endif
+
+/* Multihead accel sharing accessor functions and entity Private handling */
+
+int
+xf86GetLastScrnFlag(int entityIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ return(xf86Entities[entityIndex]->lastScrnFlag);
+ } else {
+ return -1;
+ }
+}
+
+void
+xf86SetLastScrnFlag(int entityIndex, int scrnIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ xf86Entities[entityIndex]->lastScrnFlag = scrnIndex;
+ }
+}
+
+Bool
+xf86IsEntityShared(int entityIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ if(xf86Entities[entityIndex]->entityProp & IS_SHARED_ACCEL) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void
+xf86SetEntityShared(int entityIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ xf86Entities[entityIndex]->entityProp |= IS_SHARED_ACCEL;
+ }
+}
+
+Bool
+xf86IsEntitySharable(int entityIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ if(xf86Entities[entityIndex]->entityProp & ACCEL_IS_SHARABLE) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void
+xf86SetEntitySharable(int entityIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ xf86Entities[entityIndex]->entityProp |= ACCEL_IS_SHARABLE;
+ }
+}
+
+Bool
+xf86IsPrimInitDone(int entityIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ if(xf86Entities[entityIndex]->entityProp & SA_PRIM_INIT_DONE) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void
+xf86SetPrimInitDone(int entityIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ xf86Entities[entityIndex]->entityProp |= SA_PRIM_INIT_DONE;
+ }
+}
+
+void
+xf86ClearPrimInitDone(int entityIndex)
+{
+ if(entityIndex < xf86NumEntities) {
+ xf86Entities[entityIndex]->entityProp &= ~SA_PRIM_INIT_DONE;
+ }
+}
+
+
+/*
+ * Allocate a private in the entities.
+ */
+
+int
+xf86AllocateEntityPrivateIndex(void)
+{
+ int idx, i;
+ EntityPtr pEnt;
+ DevUnion *nprivs;
+
+ idx = xf86EntityPrivateCount++;
+ for (i = 0; i < xf86NumEntities; i++) {
+ pEnt = xf86Entities[i];
+ nprivs = xnfrealloc(pEnt->entityPrivates,
+ xf86EntityPrivateCount * sizeof(DevUnion));
+ /* Zero the new private */
+ bzero(&nprivs[idx], sizeof(DevUnion));
+ pEnt->entityPrivates = nprivs;
+ }
+ return idx;
+}
+
+DevUnion *
+xf86GetEntityPrivate(int entityIndex, int privIndex)
+{
+ if (entityIndex >= xf86NumEntities || privIndex >= xf86EntityPrivateCount)
+ return NULL;
+
+ return &(xf86Entities[entityIndex]->entityPrivates[privIndex]);
+}
+
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
new file mode 100644
index 000000000..6a129ad56
--- /dev/null
+++ b/hw/xfree86/common/xf86Bus.h
@@ -0,0 +1,135 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.21 2002/11/25 14:04:56 eich Exp $ */
+/*
+ * Copyright (c) 1997 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains definitions of the bus-related data structures/types.
+ * Everything contained here is private to xf86Bus.c. In particular the
+ * video drivers must not include this file.
+ */
+
+#ifndef _XF86_BUS_H
+#define _XF86_BUS_H
+
+#include "xf86pciBus.h"
+#ifdef __sparc__
+#include "xf86sbusBus.h"
+#endif
+
+typedef struct racInfo {
+ xf86AccessPtr mem_new;
+ xf86AccessPtr io_new;
+ xf86AccessPtr io_mem_new;
+ xf86SetAccessFuncPtr old;
+} AccessFuncRec, *AccessFuncPtr;
+
+
+typedef struct {
+ DriverPtr driver;
+ int chipset;
+ int entityProp;
+ EntityProc entityInit;
+ EntityProc entityEnter;
+ EntityProc entityLeave;
+ pointer private;
+ resPtr resources;
+ Bool active;
+ Bool inUse;
+ BusRec bus;
+ EntityAccessPtr access;
+ AccessFuncPtr rac;
+ pointer busAcc;
+ int lastScrnFlag;
+ DevUnion * entityPrivates;
+ int numInstances;
+ GDevPtr * devices;
+ IOADDRESS domainIO;
+} EntityRec, *EntityPtr;
+
+/* asynchronous event handling */
+#ifdef async
+typedef struct _AsyncQRec {
+ void (*func)(pointer);
+ pointer arg;
+ struct _AsyncQRec *next;
+} AsyncQRec, *AsyncQPtr;
+#endif
+
+#define NO_SEPARATE_IO_FROM_MEM 0x0001
+#define NO_SEPARATE_MEM_FROM_IO 0x0002
+#define NEED_VGA_ROUTED 0x0004
+#define NEED_VGA_ROUTED_SETUP 0x0008
+#define NEED_MEM 0x0010
+#define NEED_IO 0x0020
+#define NEED_MEM_SHARED 0x0040
+#define NEED_IO_SHARED 0x0080
+#define ACCEL_IS_SHARABLE 0x0100
+#define IS_SHARED_ACCEL 0x0200
+#define SA_PRIM_INIT_DONE 0x0400
+#define NEED_VGA_MEM 0x1000
+#define NEED_VGA_IO 0x2000
+
+#define NEED_SHARED (NEED_MEM_SHARED | NEED_IO_SHARED)
+
+#define busType bus.type
+#define pciBusId bus.id.pci
+#define isaBusId bus.id.isa
+#define sbusBusId bus.id.sbus
+
+struct x_BusAccRec;
+typedef void (*BusAccProcPtr)(struct x_BusAccRec *ptr);
+
+typedef struct x_BusAccRec {
+ BusAccProcPtr set_f;
+ BusAccProcPtr enable_f;
+ BusAccProcPtr disable_f;
+ BusAccProcPtr save_f;
+ BusAccProcPtr restore_f;
+ struct x_BusAccRec *current; /* pointer to bridge open on this bus */
+ struct x_BusAccRec *primary; /* pointer to the bus connecting to this */
+ struct x_BusAccRec *next; /* this links the different buses together */
+ BusType type;
+ BusType busdep_type;
+ /* Bus-specific fields */
+ union {
+ struct {
+ int bus;
+ int primary_bus;
+ PCITAG acc;
+ pciBridgesSave save;
+ void (*func)(PCITAG,int,CARD32,CARD32);
+ } pci;
+ } busdep;
+} BusAccRec, *BusAccPtr;
+
+/* state change notification callback */
+typedef struct _stateChange {
+ xf86StateChangeNotificationCallbackFunc func;
+ pointer arg;
+ struct _stateChange *next;
+} StateChangeNotificationRec, *StateChangeNotificationPtr;
+
+
+extern EntityPtr *xf86Entities;
+extern int xf86NumEntities;
+extern xf86AccessRec AccessNULL;
+extern BusRec primaryBus;
+extern resPtr Acc;
+extern resPtr osRes;
+extern resPtr ResRange;
+extern BusAccPtr xf86BusAccInfo;
+
+int xf86AllocateEntity(void);
+BusType StringToBusType(const char* busID, const char **retID);
+memType ChkConflict(resRange *rgp, resPtr res, xf86State state);
+Bool xf86IsSubsetOf(resRange range, resPtr list);
+Bool xf86IsListSubsetOf(resPtr list, resPtr BaseList);
+resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
+resPtr findIntersect(resRange Range, resPtr list);
+resPtr xf86FindIntersect(resRange Range, resPtr list);
+void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment,
+ Bool useEstimated);
+void xf86ConvertListToHost(int entityIndex, resPtr list);
+
+#endif /* _XF86_BUS_H */
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
new file mode 100644
index 000000000..6a24df0e0
--- /dev/null
+++ b/hw/xfree86/common/xf86Config.h
@@ -0,0 +1,27 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.h,v 1.5 2000/02/24 05:36:50 tsi Exp $ */
+/*
+ * Copyright 1997 by The XFree86 Project, Inc
+ */
+
+#ifndef _xf86_config_h
+#define _xf86_config_h
+
+#ifdef HAVE_PARSER_DECLS
+/*
+ * global structure that holds the result of parsing the config file
+ */
+extern XF86ConfigPtr xf86configptr;
+#endif
+
+/*
+ * prototypes
+ */
+char ** xf86ModulelistFromConfig(pointer **);
+char ** xf86DriverlistFromConfig(void);
+char ** xf86DriverlistFromCompile(void);
+char ** xf86InputDriverlistFromConfig(void);
+char ** xf86InputDriverlistFromCompile(void);
+Bool xf86BuiltinInputDriver(const char *);
+Bool xf86HandleConfigFile(void);
+
+#endif /* _xf86_config_h */
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
new file mode 100644
index 000000000..687730ea5
--- /dev/null
+++ b/hw/xfree86/common/xf86Configure.c
@@ -0,0 +1,997 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.78 2003/01/18 07:27:13 paulo Exp $ */
+/*
+ * Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales.
+ *
+ * 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 Alan Hourihane not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Alan Hourihane makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ALAN HOURIHANE 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.
+ *
+ * Author: Alan Hourihane, alanh@fairlite.demon.co.uk
+ *
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include "X.h"
+#include "Xmd.h"
+#include "os.h"
+#ifdef XFree86LOADER
+#include "loaderProcs.h"
+#endif
+#include "xf86.h"
+#include "xf86Config.h"
+#include "xf86Priv.h"
+#include "xf86PciData.h"
+#define IN_XSERVER
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+#include "vbe.h"
+#include "xf86DDC.h"
+#ifdef __sparc__
+#include "xf86Bus.h"
+#include "xf86Sbus.h"
+#endif
+#include "globals.h"
+
+typedef struct _DevToConfig {
+ GDevRec GDev;
+ pciVideoPtr pVideo;
+#ifdef __sparc__
+ sbusDevicePtr sVideo;
+#endif
+ int iDriver;
+} DevToConfigRec, *DevToConfigPtr;
+
+static DevToConfigPtr DevToConfig = NULL;
+static int nDevToConfig = 0, CurrentDriver;
+
+xf86MonPtr ConfiguredMonitor;
+Bool xf86DoConfigurePass1 = TRUE;
+Bool foundMouse = FALSE;
+
+#if defined(__UNIXOS2__)
+#define DFLT_MOUSE_DEV "mouse$"
+#define DFLT_MOUSE_PROTO "OS2Mouse"
+#elif defined(SCO)
+static char *DFLT_MOUSE_PROTO = "OSMouse";
+#elif defined(QNX4)
+static char *DFLT_MOUSE_PROTO = "OSMouse";
+static char *DFLT_MOUSE_DEV = "/dev/mouse";
+#elif defined(__QNXNTO__)
+static char *DFLT_MOUSE_PROTO = "OSMouse";
+static char *DFLT_MOUSE_DEV = "/dev/devi/mouse0";
+#elif defined(__FreeBSD__)
+static char *DFLT_MOUSE_DEV = "/dev/sysmouse";
+static char *DFLT_MOUSE_PROTO = "auto";
+#else
+static char *DFLT_MOUSE_DEV = "/dev/mouse";
+static char *DFLT_MOUSE_PROTO = "auto";
+#endif
+
+/*
+ * This is called by the driver, either through xf86Match???Instances() or
+ * directly. We allocate a GDevRec and fill it in as much as we can, letting
+ * the caller fill in the rest and/or change it as it sees fit.
+ */
+GDevPtr
+xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int chipset)
+{
+ int i, j;
+ pciVideoPtr pVideo = NULL;
+ Bool isPrimary = FALSE;
+
+ if (xf86DoProbe || !xf86DoConfigure || !xf86DoConfigurePass1)
+ return NULL;
+
+ /* Check for duplicates */
+ switch (bus) {
+ case BUS_PCI:
+ pVideo = (pciVideoPtr) busData;
+ for (i = 0; i < nDevToConfig; i++)
+ if (DevToConfig[i].pVideo &&
+ (DevToConfig[i].pVideo->bus == pVideo->bus) &&
+ (DevToConfig[i].pVideo->device == pVideo->device) &&
+ (DevToConfig[i].pVideo->func == pVideo->func))
+ return NULL;
+ isPrimary = xf86IsPrimaryPci(pVideo);
+ break;
+ case BUS_ISA:
+ /*
+ * This needs to be revisited as it doesn't allow for non-PCI
+ * multihead.
+ */
+ if (!xf86IsPrimaryIsa())
+ return NULL;
+ isPrimary = TRUE;
+ for (i = 0; i < nDevToConfig; i++)
+ if (!DevToConfig[i].pVideo)
+ return NULL;
+ break;
+#if defined(__sparc__) && !defined(__OpenBSD__)
+ case BUS_SBUS:
+ for (i = 0; i < nDevToConfig; i++)
+ if (DevToConfig[i].sVideo &&
+ DevToConfig[i].sVideo->fbNum == ((sbusDevicePtr) busData)->fbNum)
+ return NULL;
+ break;
+#endif
+ default:
+ return NULL;
+ }
+
+ /* Allocate new structure occurrence */
+ i = nDevToConfig++;
+ DevToConfig =
+ xnfrealloc(DevToConfig, nDevToConfig * sizeof(DevToConfigRec));
+#if 1 /* Doesn't work when a driver detects more than one adapter */
+ if ((i > 0) && isPrimary) {
+ memmove(DevToConfig + 1,DevToConfig,
+ (nDevToConfig - 1) * sizeof(DevToConfigRec));
+ i = 0;
+ }
+#endif
+ memset(DevToConfig + i, 0, sizeof(DevToConfigRec));
+
+# define NewDevice DevToConfig[i]
+
+ NewDevice.GDev.chipID = NewDevice.GDev.chipRev = NewDevice.GDev.irq = -1;
+
+ NewDevice.iDriver = CurrentDriver;
+
+ /* Fill in what we know, converting the driver name to lower case */
+ NewDevice.GDev.driver = xnfalloc(strlen(driver) + 1);
+ for (j = 0; (NewDevice.GDev.driver[j] = tolower(driver[j])); j++);
+
+ switch (bus) {
+ case BUS_PCI: {
+ const char *VendorName;
+ const char *CardName;
+ char busnum[8];
+
+ NewDevice.pVideo = pVideo;
+ xf86FindPciNamesByDevice(pVideo->vendor, pVideo->chipType,
+ NOVENDOR, NOSUBSYS,
+ &VendorName, &CardName, NULL, NULL);
+
+ if (!VendorName) {
+ VendorName = xnfalloc(15);
+ sprintf((char*)VendorName, "Unknown Vendor");
+ }
+
+ if (!CardName) {
+ CardName = xnfalloc(14);
+ sprintf((char*)CardName, "Unknown Board");
+ }
+
+ NewDevice.GDev.identifier =
+ xnfalloc(strlen(VendorName) + strlen(CardName) + 2);
+ sprintf(NewDevice.GDev.identifier, "%s %s", VendorName, CardName);
+
+ NewDevice.GDev.vendor = (char *)VendorName;
+ NewDevice.GDev.board = (char *)CardName;
+
+ NewDevice.GDev.busID = xnfalloc(16);
+ xf86FormatPciBusNumber(pVideo->bus, busnum);
+ sprintf(NewDevice.GDev.busID, "PCI:%s:%d:%d",
+ busnum, pVideo->device, pVideo->func);
+
+ NewDevice.GDev.chipID = pVideo->chipType;
+ NewDevice.GDev.chipRev = pVideo->chipRev;
+
+ if (chipset < 0)
+ chipset = (pVideo->vendor << 16) | pVideo->chipType;
+ }
+ break;
+ case BUS_ISA:
+ NewDevice.GDev.identifier = "ISA Adapter";
+ NewDevice.GDev.busID = "ISA";
+ break;
+#if defined(__sparc__) && !defined(__OpenBSD__)
+ case BUS_SBUS: {
+ char *promPath = NULL;
+ NewDevice.sVideo = (sbusDevicePtr) busData;
+ NewDevice.GDev.identifier = NewDevice.sVideo->descr;
+ if (sparcPromInit() >= 0) {
+ promPath = sparcPromNode2Pathname(&NewDevice.sVideo->node);
+ sparcPromClose();
+ }
+ if (promPath) {
+ NewDevice.GDev.busID = xnfalloc(strlen(promPath) + 6);
+ sprintf(NewDevice.GDev.busID, "SBUS:%s", promPath);
+ xfree(promPath);
+ } else {
+ NewDevice.GDev.busID = xnfalloc(12);
+ sprintf(NewDevice.GDev.busID, "SBUS:fb%d", NewDevice.sVideo->fbNum);
+ }
+ }
+ break;
+#endif
+ default:
+ break;
+ }
+
+ /* Get driver's available options */
+ if (xf86DriverList[CurrentDriver]->AvailableOptions)
+ NewDevice.GDev.options = (OptionInfoPtr)
+ (*xf86DriverList[CurrentDriver]->AvailableOptions)(chipset,
+ bus);
+
+ return &NewDevice.GDev;
+
+# undef NewDevice
+}
+
+/*
+ * Backwards compatibility
+ */
+GDevPtr
+xf86AddDeviceToConfigure(const char *driver, pciVideoPtr pVideo, int chipset)
+{
+ return xf86AddBusDeviceToConfigure(driver, pVideo ? BUS_PCI : BUS_ISA,
+ pVideo, chipset);
+}
+
+static XF86ConfInputPtr
+configureInputSection (void)
+{
+ XF86ConfInputPtr mouse = NULL;
+ parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
+
+ ptr->inp_identifier = "Keyboard0";
+ ptr->inp_driver = "keyboard";
+ ptr->list.next = NULL;
+
+ /* Crude mechanism to auto-detect mouse (os dependent) */
+ {
+ int fd;
+#if 0 && defined linux
+ /* Our autodetection code can do a better job */
+ int len;
+ char path[32];
+
+ if ((len = readlink(DFLT_MOUSE_DEV, path, sizeof(path) - 1)) > 0) {
+ path[len] = '\0';
+ if (strstr(path, "psaux") != NULL)
+ DFLT_MOUSE_PROTO = "PS/2";
+ }
+#endif
+#ifdef WSCONS_SUPPORT
+ fd = open("/dev/wsmouse", 0);
+ if (fd > 0) {
+ DFLT_MOUSE_DEV = "/dev/wsmouse";
+ DFLT_MOUSE_PROTO = "wsmouse";
+ close(fd);
+ }
+#endif
+
+#ifndef SCO
+ fd = open(DFLT_MOUSE_DEV, 0);
+ if (fd != -1) {
+ foundMouse = TRUE;
+ close(fd);
+ }
+#else
+ foundMouse = TRUE;
+#endif
+ }
+
+ mouse = xf86confmalloc(sizeof(XF86ConfInputRec));
+ memset((XF86ConfInputPtr)mouse,0,sizeof(XF86ConfInputRec));
+ mouse->inp_identifier = "Mouse0";
+ mouse->inp_driver = "mouse";
+ mouse->inp_option_lst =
+ xf86addNewOption(mouse->inp_option_lst, "Protocol", DFLT_MOUSE_PROTO);
+#ifndef SCO
+ mouse->inp_option_lst =
+ xf86addNewOption(mouse->inp_option_lst, "Device", DFLT_MOUSE_DEV);
+#endif
+ ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse);
+ return ptr;
+}
+
+static XF86ConfDRIPtr
+configureDRISection (void)
+{
+#ifdef NOTYET
+ parsePrologue (XF86ConfDRIPtr, XF86ConfDRIRec)
+
+ return ptr;
+#else
+ return NULL;
+#endif
+}
+
+static XF86ConfVendorPtr
+configureVendorSection (void)
+{
+ parsePrologue (XF86ConfVendorPtr, XF86ConfVendorRec)
+
+ return NULL;
+#if 0
+ return ptr;
+#endif
+}
+
+static XF86ConfScreenPtr
+configureScreenSection (int screennum)
+{
+ int i;
+ int depths[] = { 1, 4, 8, 15, 16, 24/*, 32*/ };
+ parsePrologue (XF86ConfScreenPtr, XF86ConfScreenRec)
+
+ ptr->scrn_identifier = xf86confmalloc(18);
+ sprintf(ptr->scrn_identifier, "Screen%d", screennum);
+ ptr->scrn_monitor_str = xf86confmalloc(19);
+ sprintf(ptr->scrn_monitor_str, "Monitor%d", screennum);
+ ptr->scrn_device_str = xf86confmalloc(16);
+ sprintf(ptr->scrn_device_str, "Card%d", screennum);
+
+ for (i=0; i<sizeof(depths)/sizeof(depths[0]); i++)
+ {
+ XF86ConfDisplayPtr display;
+
+ display = xf86confmalloc(sizeof(XF86ConfDisplayRec));
+ memset((XF86ConfDisplayPtr)display,0,sizeof(XF86ConfDisplayRec));
+ display->disp_depth = depths[i];
+ display->disp_black.red = display->disp_white.red = -1;
+ display->disp_black.green = display->disp_white.green = -1;
+ display->disp_black.blue = display->disp_white.blue = -1;
+ ptr->scrn_display_lst = (XF86ConfDisplayPtr)xf86addListItem(
+ (glp)ptr->scrn_display_lst, (glp)display);
+ }
+
+ return ptr;
+}
+
+static const char*
+optionTypeToSting(OptionValueType type)
+{
+ switch (type) {
+ case OPTV_NONE:
+ return "";
+ case OPTV_INTEGER:
+ return "<i>";
+ case OPTV_STRING:
+ return "<str>";
+ case OPTV_ANYSTR:
+ return "[<str>]";
+ case OPTV_REAL:
+ return "<f>";
+ case OPTV_BOOLEAN:
+ return "[<bool>]";
+ case OPTV_FREQ:
+ return "<freq>";
+ default:
+ return "";
+ }
+}
+
+static XF86ConfDevicePtr
+configureDeviceSection (int screennum)
+{
+ char identifier[16];
+ OptionInfoPtr p;
+ int i = 0;
+#ifdef DO_FBDEV_PROBE
+ Bool foundFBDEV = FALSE;
+#endif
+ parsePrologue (XF86ConfDevicePtr, XF86ConfDeviceRec)
+
+ /* Move device info to parser structure */
+ sprintf(identifier, "Card%d", screennum);
+ ptr->dev_identifier = strdup(identifier);
+/* ptr->dev_identifier = DevToConfig[screennum].GDev.identifier;*/
+ ptr->dev_vendor = DevToConfig[screennum].GDev.vendor;
+ ptr->dev_board = DevToConfig[screennum].GDev.board;
+ ptr->dev_chipset = DevToConfig[screennum].GDev.chipset;
+ ptr->dev_busid = DevToConfig[screennum].GDev.busID;
+ ptr->dev_driver = DevToConfig[screennum].GDev.driver;
+ ptr->dev_ramdac = DevToConfig[screennum].GDev.ramdac;
+ for (i = 0; (i < MAXDACSPEEDS) && (i < CONF_MAXDACSPEEDS); i++)
+ ptr->dev_dacSpeeds[i] = DevToConfig[screennum].GDev.dacSpeeds[i];
+ ptr->dev_videoram = DevToConfig[screennum].GDev.videoRam;
+ ptr->dev_textclockfreq = DevToConfig[screennum].GDev.textClockFreq;
+ ptr->dev_bios_base = DevToConfig[screennum].GDev.BiosBase;
+ ptr->dev_mem_base = DevToConfig[screennum].GDev.MemBase;
+ ptr->dev_io_base = DevToConfig[screennum].GDev.IOBase;
+ ptr->dev_clockchip = DevToConfig[screennum].GDev.clockchip;
+ for (i = 0; (i < MAXCLOCKS) && (i < DevToConfig[screennum].GDev.numclocks); i++)
+ ptr->dev_clock[i] = DevToConfig[screennum].GDev.clock[i];
+ ptr->dev_clocks = i;
+ ptr->dev_chipid = DevToConfig[screennum].GDev.chipID;
+ ptr->dev_chiprev = DevToConfig[screennum].GDev.chipRev;
+ ptr->dev_irq = DevToConfig[screennum].GDev.irq;
+
+ /* Make sure older drivers don't segv */
+ if (DevToConfig[screennum].GDev.options) {
+ /* Fill in the available driver options for people to use */
+ const char *descrip =
+ " ### Available Driver options are:-\n"
+ " ### Values: <i>: integer, <f>: float, "
+ "<bool>: \"True\"/\"False\",\n"
+ " ### <string>: \"String\", <freq>: \"<f> Hz/kHz/MHz\"\n"
+ " ### [arg]: arg optional\n";
+ ptr->dev_comment = xstrdup(descrip);
+ if (ptr->dev_comment) {
+ for (p = DevToConfig[screennum].GDev.options;
+ p->name != NULL; p++) {
+ char *p_e;
+ const char *prefix = " #Option ";
+ const char *middle = " \t# ";
+ const char *suffix = "\n";
+ const char *opttype = optionTypeToSting(p->type);
+ char *optname;
+ int len = strlen(ptr->dev_comment) + strlen(prefix) +
+ strlen(middle) + strlen(suffix) + 1;
+
+ optname = xalloc(strlen(p->name) + 2 + 1);
+ if (!optname)
+ break;
+ sprintf(optname, "\"%s\"", p->name);
+
+ len += max(20, strlen(optname));
+ len += strlen(opttype);
+
+ ptr->dev_comment = xrealloc(ptr->dev_comment, len);
+ if (!ptr->dev_comment)
+ break;
+ p_e = ptr->dev_comment + strlen(ptr->dev_comment);
+ sprintf(p_e, "%s%-20s%s%s%s", prefix, optname, middle,
+ opttype, suffix);
+ xfree(optname);
+ }
+ }
+ }
+
+#ifdef DO_FBDEV_PROBE
+ /* Crude mechanism to auto-detect fbdev (os dependent) */
+ /* Skip it for now. Options list it anyway, and we can't
+ * determine which screen/driver this belongs too anyway. */
+ {
+ int fd;
+
+ fd = open("/dev/fb0", 0);
+ if (fd != -1) {
+ foundFBDEV = TRUE;
+ close(fd);
+ }
+ }
+
+ if (foundFBDEV) {
+ XF86OptionPtr fbdev;
+
+ fbdev = xf86confmalloc(sizeof(XF86OptionRec));
+ memset((XF86OptionPtr)fbdev,0,sizeof(XF86OptionRec));
+ fbdev->opt_name = "UseFBDev";
+ fbdev->opt_val = "ON";
+ ptr->dev_option_lst = (XF86OptionPtr)xf86addListItem(
+ (glp)ptr->dev_option_lst, (glp)fbdev);
+ }
+#endif
+
+ return ptr;
+}
+
+static XF86ConfLayoutPtr
+configureLayoutSection (void)
+{
+ int scrnum = 0;
+ parsePrologue (XF86ConfLayoutPtr, XF86ConfLayoutRec)
+
+ ptr->lay_identifier = "XFree86 Configured";
+
+ {
+ XF86ConfInputrefPtr iptr;
+
+ iptr = xf86confmalloc (sizeof (XF86ConfInputrefRec));
+ iptr->list.next = NULL;
+ iptr->iref_option_lst = NULL;
+ iptr->iref_inputdev_str = "Mouse0";
+ iptr->iref_option_lst =
+ xf86addNewOption (iptr->iref_option_lst, "CorePointer", NULL);
+ ptr->lay_input_lst = (XF86ConfInputrefPtr)
+ xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
+ }
+
+ {
+ XF86ConfInputrefPtr iptr;
+
+ iptr = xf86confmalloc (sizeof (XF86ConfInputrefRec));
+ iptr->list.next = NULL;
+ iptr->iref_option_lst = NULL;
+ iptr->iref_inputdev_str = "Keyboard0";
+ iptr->iref_option_lst =
+ xf86addNewOption (iptr->iref_option_lst, "CoreKeyboard", NULL);
+ ptr->lay_input_lst = (XF86ConfInputrefPtr)
+ xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
+ }
+
+ for (scrnum = 0; scrnum < nDevToConfig; scrnum++) {
+ XF86ConfAdjacencyPtr aptr;
+
+ aptr = xf86confmalloc (sizeof (XF86ConfAdjacencyRec));
+ aptr->list.next = NULL;
+ aptr->adj_x = 0;
+ aptr->adj_y = 0;
+ aptr->adj_scrnum = scrnum;
+ aptr->adj_screen_str = xnfalloc(18);
+ sprintf(aptr->adj_screen_str, "Screen%d", scrnum);
+ if (scrnum == 0) {
+ aptr->adj_where = CONF_ADJ_ABSOLUTE;
+ aptr->adj_refscreen = NULL;
+ }
+ else {
+ aptr->adj_where = CONF_ADJ_RIGHTOF;
+ aptr->adj_refscreen = xnfalloc(18);
+ sprintf(aptr->adj_refscreen, "Screen%d", scrnum - 1);
+ }
+ ptr->lay_adjacency_lst =
+ (XF86ConfAdjacencyPtr)xf86addListItem((glp)ptr->lay_adjacency_lst,
+ (glp)aptr);
+ }
+
+ return ptr;
+}
+
+static XF86ConfModesPtr
+configureModesSection (void)
+{
+#ifdef NOTYET
+ parsePrologue (XF86ConfModesPtr, XF86ConfModesRec)
+
+ return ptr;
+#else
+ return NULL;
+#endif
+}
+
+static XF86ConfVideoAdaptorPtr
+configureVideoAdaptorSection (void)
+{
+ parsePrologue (XF86ConfVideoAdaptorPtr, XF86ConfVideoAdaptorRec)
+
+ return NULL;
+#if 0
+ return ptr;
+#endif
+}
+
+static XF86ConfFlagsPtr
+configureFlagsSection (void)
+{
+ parsePrologue (XF86ConfFlagsPtr, XF86ConfFlagsRec)
+
+ return ptr;
+}
+
+static XF86ConfModulePtr
+configureModuleSection (void)
+{
+#ifdef XFree86LOADER
+ char **elist, **el;
+ /* Find the list of extension modules. */
+ const char *esubdirs[] = {
+ "extensions",
+ NULL
+ };
+ const char *fsubdirs[] = {
+ "fonts",
+ NULL
+ };
+#endif
+ parsePrologue (XF86ConfModulePtr, XF86ConfModuleRec)
+
+#ifdef XFree86LOADER
+ elist = LoaderListDirs(esubdirs, NULL);
+ if (elist) {
+ for (el = elist; *el; el++) {
+ XF86LoadPtr module;
+
+ module = xf86confmalloc(sizeof(XF86LoadRec));
+ memset((XF86LoadPtr)module,0,sizeof(XF86LoadRec));
+ module->load_name = *el;
+ /* HACK, remove GLcore, glx, loads it as a submodule */
+ if (strcmp(*el, "GLcore"))
+ ptr->mod_load_lst = (XF86LoadPtr)xf86addListItem(
+ (glp)ptr->mod_load_lst, (glp)module);
+ }
+ xfree(elist);
+ }
+
+ /* Process list of font backends separately to include only required ones */
+ elist = LoaderListDirs(fsubdirs, NULL);
+ if (elist) {
+ for (el = elist; *el; el++) {
+ XF86LoadPtr module;
+
+ module = xf86confmalloc(sizeof(XF86LoadRec));
+ memset((XF86LoadPtr)module,0,sizeof(XF86LoadRec));
+ module->load_name = *el;
+
+ /* Add only those font backends which are referenced by fontpath */
+ /* 'strstr(dFP,"/dir")' is meant as 'dFP =~ m(/dir\W)' */
+ if (defaultFontPath && (
+ (strcmp(*el, "xtt") == 0 &&
+ strstr(defaultFontPath, "/TrueType")) ||
+ (strcmp(*el, "type1") == 0 &&
+ strstr(defaultFontPath, "/Type1")) ||
+ (strcmp(*el, "speedo") == 0 &&
+ strstr(defaultFontPath, "/Speedo"))))
+ ptr->mod_load_lst = (XF86LoadPtr)xf86addListItem(
+ (glp)ptr->mod_load_lst, (glp)module);
+ }
+ xfree(elist);
+ }
+#endif
+
+ return ptr;
+}
+
+static XF86ConfFilesPtr
+configureFilesSection (void)
+{
+ parsePrologue (XF86ConfFilesPtr, XF86ConfFilesRec)
+
+#ifdef XFree86LOADER
+ if (xf86ModulePath)
+ ptr->file_modulepath = strdup(xf86ModulePath);
+#endif
+ if (defaultFontPath)
+ ptr->file_fontpath = strdup(defaultFontPath);
+ if (rgbPath)
+ ptr->file_rgbpath = strdup(rgbPath);
+
+ return ptr;
+}
+
+static XF86ConfMonitorPtr
+configureMonitorSection (int screennum)
+{
+ parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
+
+ ptr->mon_identifier = xf86confmalloc(19);
+ sprintf(ptr->mon_identifier, "Monitor%d", screennum);
+ ptr->mon_vendor = strdup("Monitor Vendor");
+ ptr->mon_modelname = strdup("Monitor Model");
+
+ return ptr;
+}
+
+static XF86ConfMonitorPtr
+configureDDCMonitorSection (int screennum)
+{
+ int i = 0;
+ int len, mon_width, mon_height;
+#define displaySizeMaxLen 80
+ char displaySize_string[displaySizeMaxLen];
+ int displaySizeLen;
+
+ parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
+
+ ptr->mon_identifier = xf86confmalloc(19);
+ sprintf(ptr->mon_identifier, "Monitor%d", screennum);
+ ptr->mon_vendor = strdup(ConfiguredMonitor->vendor.name);
+ ptr->mon_modelname = xf86confmalloc(12);
+ sprintf(ptr->mon_modelname, "%x", ConfiguredMonitor->vendor.prod_id);
+
+ /* features in centimetres, we want millimetres */
+ mon_width = 10 * ConfiguredMonitor->features.hsize ;
+ mon_height = 10 * ConfiguredMonitor->features.vsize ;
+
+#ifdef CONFIGURE_DISPLAYSIZE
+ ptr->mon_width = mon_width;
+ ptr->mon_height = mon_height;
+#else
+ if (mon_width && mon_height) {
+ /* when values available add DisplaySize option AS A COMMENT */
+
+ displaySizeLen = snprintf(displaySize_string, displaySizeMaxLen,
+ "\t#DisplaySize\t%5d %5d\t# mm\n",
+ mon_width, mon_height);
+
+ if (displaySizeLen>0 && displaySizeLen<displaySizeMaxLen) {
+ if (ptr->mon_comment) {
+ len = strlen(ptr->mon_comment);
+ } else {
+ len = 0;
+ }
+ if ((ptr->mon_comment =
+ xf86confrealloc(ptr->mon_comment,
+ len+strlen(displaySize_string)))) {
+ strcpy(ptr->mon_comment + len, displaySize_string);
+ }
+ }
+ }
+#endif /* def CONFIGURE_DISPLAYSIZE */
+
+ for (i=0;i<4;i++) {
+ switch (ConfiguredMonitor->det_mon[i].type) {
+ case DT:
+ case DS_STD_TIMINGS:
+ case DS_WHITE_P:
+ break;
+ case DS_NAME:
+ ptr->mon_modelname = xf86confrealloc(ptr->mon_modelname,
+ strlen((char*)(ConfiguredMonitor->det_mon[i].section.name))
+ + 1);
+ strcpy(ptr->mon_modelname,
+ (char*)(ConfiguredMonitor->det_mon[i].section.name));
+ break;
+ case DS_ASCII_STR:
+ case DS_SERIAL:
+ case DS_RANGES:
+ default:
+ break;
+ }
+ }
+
+ if (ConfiguredMonitor->features.dpms) {
+ ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, "DPMS", NULL);
+ }
+
+ return ptr;
+}
+
+void
+DoConfigure()
+{
+ int i,j, screennum = -1;
+ char *home = NULL;
+ char *filename = NULL;
+ XF86ConfigPtr xf86config = NULL;
+ char **vlist, **vl;
+ int *dev2screen;
+
+ vlist = xf86DriverlistFromCompile();
+
+ if (!vlist) {
+ ErrorF("Missing output drivers. Configuration failed.\n");
+ goto bail;
+ }
+
+ ErrorF("List of video drivers:\n");
+ for (vl = vlist; *vl; vl++)
+ ErrorF("\t%s\n", *vl);
+
+#ifdef XFree86LOADER
+ /* Load all the drivers that were found. */
+ xf86LoadModules(vlist, NULL);
+#endif /* XFree86LOADER */
+
+ xfree(vlist);
+
+ /* Disable PCI devices */
+ xf86ResourceBrokerInit();
+ xf86AccessInit();
+ xf86FindPrimaryDevice();
+
+ /* Create XF86Config file structure */
+ xf86config = malloc(sizeof(XF86ConfigRec));
+ memset ((XF86ConfigPtr)xf86config, 0, sizeof(XF86ConfigRec));
+ xf86config->conf_device_lst = NULL;
+ xf86config->conf_screen_lst = NULL;
+ xf86config->conf_monitor_lst = NULL;
+
+ /* Call all of the probe functions, reporting the results. */
+ for (CurrentDriver = 0; CurrentDriver < xf86NumDrivers; CurrentDriver++) {
+
+ if (xf86DriverList[CurrentDriver]->Probe == NULL) continue;
+
+ if ((*xf86DriverList[CurrentDriver]->Probe)(
+ xf86DriverList[CurrentDriver], PROBE_DETECT) &&
+ xf86DriverList[CurrentDriver]->Identify)
+ (*xf86DriverList[CurrentDriver]->Identify)(0);
+ }
+
+ if (nDevToConfig <= 0) {
+ ErrorF("No devices to configure. Configuration failed.\n");
+ goto bail;
+ }
+
+ /* Add device, monitor and screen sections for detected devices */
+ for (screennum = 0; screennum < nDevToConfig; screennum++) {
+ XF86ConfDevicePtr DevicePtr;
+ XF86ConfMonitorPtr MonitorPtr;
+ XF86ConfScreenPtr ScreenPtr;
+
+ DevicePtr = configureDeviceSection(screennum);
+ xf86config->conf_device_lst = (XF86ConfDevicePtr)xf86addListItem(
+ (glp)xf86config->conf_device_lst, (glp)DevicePtr);
+ MonitorPtr = configureMonitorSection(screennum);
+ xf86config->conf_monitor_lst = (XF86ConfMonitorPtr)xf86addListItem(
+ (glp)xf86config->conf_monitor_lst, (glp)MonitorPtr);
+ ScreenPtr = configureScreenSection(screennum);
+ xf86config->conf_screen_lst = (XF86ConfScreenPtr)xf86addListItem(
+ (glp)xf86config->conf_screen_lst, (glp)ScreenPtr);
+ }
+
+ xf86config->conf_files = configureFilesSection();
+ xf86config->conf_modules = configureModuleSection();
+ xf86config->conf_flags = configureFlagsSection();
+ xf86config->conf_videoadaptor_lst = configureVideoAdaptorSection();
+ xf86config->conf_modes_lst = configureModesSection();
+ xf86config->conf_vendor_lst = configureVendorSection();
+ xf86config->conf_dri = configureDRISection();
+ xf86config->conf_input_lst = configureInputSection();
+ xf86config->conf_layout_lst = configureLayoutSection();
+
+ if (!(home = getenv("HOME")))
+ home = "/";
+ {
+#ifdef __UNIXOS2__
+#define PATH_MAX 2048
+#endif
+#if defined(SCO) || defined(SCO325)
+#define PATH_MAX 1024
+#endif
+ const char* configfile = XF86CONFIGFILE".new";
+ char homebuf[PATH_MAX];
+ /* getenv might return R/O memory, as with OS/2 */
+ strncpy(homebuf,home,PATH_MAX-1);
+ homebuf[PATH_MAX-1] = '\0';
+ home = homebuf;
+ if (!(filename =
+ (char *)ALLOCATE_LOCAL(strlen(home) +
+ strlen(configfile) + 3)))
+
+ if (home[0] == '/' && home[1] == '\0')
+ home[0] = '\0';
+#ifndef QNX4
+ sprintf(filename, "%s/%s", home,configfile);
+#else
+ sprintf(filename, "//%d%s/%s", getnid(),home,configfile);
+#endif
+
+ }
+
+ xf86writeConfigFile(filename, xf86config);
+
+ xf86DoConfigurePass1 = FALSE;
+ /* Try to get DDC information filled in */
+ xf86ConfigFile = filename;
+ if (!xf86HandleConfigFile()) {
+ goto bail;
+ }
+
+ xf86DoConfigurePass1 = FALSE;
+
+ dev2screen = xnfcalloc(1,xf86NumDrivers*sizeof(int));
+
+ {
+ Bool *driverProbed = xnfcalloc(1,xf86NumDrivers*sizeof(Bool));
+ for (screennum = 0; screennum < nDevToConfig; screennum++) {
+ int k,l,n,oldNumScreens;
+
+ i = DevToConfig[screennum].iDriver;
+
+ if (driverProbed[i]) continue;
+ driverProbed[i] = TRUE;
+
+ oldNumScreens = xf86NumScreens;
+
+ (*xf86DriverList[i]->Probe)(xf86DriverList[i], 0);
+
+ /* reorder */
+ k = screennum > 0 ? screennum : 1;
+ for (l = oldNumScreens; l < xf86NumScreens; l++) {
+ /* is screen primary? */
+ Bool primary = FALSE;
+ for (n = 0; n<xf86Screens[l]->numEntities; n++) {
+ if (xf86IsEntityPrimary(xf86Screens[l]->entityList[n])) {
+ dev2screen[0] = l;
+ primary = TRUE;
+ break;
+ }
+ }
+ if (primary) continue;
+ /* not primary: assign it to next device of same driver */
+ /*
+ * NOTE: we assume that devices in DevToConfig
+ * and xf86Screens[] have the same order except
+ * for the primary device which always comes first.
+ */
+ for (; k < nDevToConfig; k++) {
+ if (DevToConfig[k].iDriver == i) {
+ dev2screen[k++] = l;
+ break;
+ }
+ }
+ }
+ xf86SetPciVideo(NULL,NONE);
+ }
+ xfree(driverProbed);
+ }
+
+
+ if (nDevToConfig != xf86NumScreens) {
+ ErrorF("Number of created screens does not match number of detected"
+ " devices.\n Configuration failed.\n");
+ goto bail;
+ }
+
+ xf86PostProbe();
+ xf86EntityInit();
+
+ for (j = 0; j < xf86NumScreens; j++) {
+ xf86Screens[j]->scrnIndex = j;
+ }
+
+ xf86freeMonitorList(xf86config->conf_monitor_lst);
+ xf86config->conf_monitor_lst = NULL;
+ xf86freeScreenList(xf86config->conf_screen_lst);
+ xf86config->conf_screen_lst = NULL;
+ for (j = 0; j < xf86NumScreens; j++) {
+ XF86ConfMonitorPtr MonitorPtr;
+ XF86ConfScreenPtr ScreenPtr;
+
+ ConfiguredMonitor = NULL;
+
+ xf86EnableAccess(xf86Screens[dev2screen[j]]);
+ if ((*xf86Screens[dev2screen[j]]->PreInit)(xf86Screens[dev2screen[j]],
+ PROBE_DETECT) &&
+ ConfiguredMonitor) {
+ MonitorPtr = configureDDCMonitorSection(j);
+ } else {
+ MonitorPtr = configureMonitorSection(j);
+ }
+ ScreenPtr = configureScreenSection(j);
+ xf86config->conf_monitor_lst = (XF86ConfMonitorPtr)xf86addListItem(
+ (glp)xf86config->conf_monitor_lst, (glp)MonitorPtr);
+ xf86config->conf_screen_lst = (XF86ConfScreenPtr)xf86addListItem(
+ (glp)xf86config->conf_screen_lst, (glp)ScreenPtr);
+ }
+
+ xf86writeConfigFile(filename, xf86config);
+
+ ErrorF("\n");
+
+#ifdef SCO
+ ErrorF("\nXFree86 is using the kernel event driver to access the mouse.\n"
+ "If you wish to use the internal XFree86 mouse drivers, please\n"
+ "edit the file and correct the Device.\n");
+#else /* !SCO */
+ if (!foundMouse) {
+ ErrorF("\nXFree86 is not able to detect your mouse.\n"
+ "Edit the file and correct the Device.\n");
+ } else {
+#ifndef __UNIXOS2__ /* OS/2 definitely has a mouse */
+ ErrorF("\nXFree86 detected your mouse at device %s.\n"
+ "Please check your config if the mouse is still not\n"
+ "operational, as by default XFree86 tries to autodetect\n"
+ "the protocol.\n",DFLT_MOUSE_DEV);
+#endif
+ }
+#endif /* !SCO */
+
+ if (xf86NumScreens > 1) {
+ ErrorF("\nXFree86 has configured a multihead system, please check your config.\n");
+ }
+
+ ErrorF("\nYour XF86Config file is %s\n\n", filename);
+ ErrorF("To test the server, run 'XFree86 -xf86config %s'\n\n", filename);
+
+bail:
+ OsCleanup();
+ AbortDDX();
+ fflush(stderr);
+ exit(0);
+}
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
new file mode 100644
index 000000000..1ad8b42ff
--- /dev/null
+++ b/hw/xfree86/common/xf86DGA.c
@@ -0,0 +1,1181 @@
+/*
+ Copyright (c) 1999 - The XFree86 Project, Inc.
+
+ Written by Mark Vojkovich
+*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.46 2002/12/03 18:17:40 tsi Exp $ */
+
+#include "xf86.h"
+#include "xf86str.h"
+#include "xf86Priv.h"
+#include "dgaproc.h"
+#include "xf86dgastr.h"
+#include "colormapst.h"
+#include "pixmapstr.h"
+#include "inputstr.h"
+#include "globals.h"
+#include "servermd.h"
+#include "micmap.h"
+#ifdef XKB
+#include "XKBsrv.h"
+#endif
+#include "xf86Xinput.h"
+
+static unsigned long DGAGeneration = 0;
+static int DGAScreenIndex = -1;
+
+static Bool DGACloseScreen(int i, ScreenPtr pScreen);
+static void DGADestroyColormap(ColormapPtr pmap);
+static void DGAInstallColormap(ColormapPtr pmap);
+static void DGAUninstallColormap(ColormapPtr pmap);
+
+static void
+DGACopyModeInfo(
+ DGAModePtr mode,
+ XDGAModePtr xmode
+);
+
+#if defined(XFree86LOADER) || !defined(XFreeXDGA)
+int *XDGAEventBase = NULL;
+#else
+int *XDGAEventBase = &DGAEventBase;
+#endif
+
+#define DGA_GET_SCREEN_PRIV(pScreen) \
+ ((DGAScreenPtr)((pScreen)->devPrivates[DGAScreenIndex].ptr))
+
+
+typedef struct _FakedVisualList{
+ Bool free;
+ VisualPtr pVisual;
+ struct _FakedVisualList *next;
+} FakedVisualList;
+
+
+typedef struct {
+ ScrnInfoPtr pScrn;
+ int numModes;
+ DGAModePtr modes;
+ CloseScreenProcPtr CloseScreen;
+ DestroyColormapProcPtr DestroyColormap;
+ InstallColormapProcPtr InstallColormap;
+ UninstallColormapProcPtr UninstallColormap;
+ DGADevicePtr current;
+ DGAFunctionPtr funcs;
+ int input;
+ ClientPtr client;
+ int pixmapMode;
+ FakedVisualList *fakedVisuals;
+ ColormapPtr dgaColormap;
+ ColormapPtr savedColormap;
+ Bool grabMouse;
+ Bool grabKeyboard;
+} DGAScreenRec, *DGAScreenPtr;
+
+
+Bool
+DGAInit(
+ ScreenPtr pScreen,
+ DGAFunctionPtr funcs,
+ DGAModePtr modes,
+ int num
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ DGAScreenPtr pScreenPriv;
+ int i;
+
+ if(!funcs || !funcs->SetMode || !funcs->OpenFramebuffer)
+ return FALSE;
+
+ if(!modes || num <= 0)
+ return FALSE;
+
+ if(DGAGeneration != serverGeneration) {
+ if((DGAScreenIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ DGAGeneration = serverGeneration;
+ }
+
+ if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
+ return FALSE;
+
+ pScreenPriv->pScrn = pScrn;
+ pScreenPriv->numModes = num;
+ pScreenPriv->modes = modes;
+ pScreenPriv->current = NULL;
+
+ pScreenPriv->funcs = funcs;
+ pScreenPriv->input = 0;
+ pScreenPriv->client = NULL;
+ pScreenPriv->fakedVisuals = NULL;
+ pScreenPriv->dgaColormap = NULL;
+ pScreenPriv->savedColormap = NULL;
+ pScreenPriv->grabMouse = FALSE;
+ pScreenPriv->grabKeyboard = FALSE;
+
+ for(i = 0; i < num; i++)
+ modes[i].num = i + 1;
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension)
+ for(i = 0; i < num; i++)
+ modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
+#endif
+
+
+ pScreen->devPrivates[DGAScreenIndex].ptr = (pointer)pScreenPriv;
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = DGACloseScreen;
+ pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
+ pScreen->DestroyColormap = DGADestroyColormap;
+ pScreenPriv->InstallColormap = pScreen->InstallColormap;
+ pScreen->InstallColormap = DGAInstallColormap;
+ pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
+ pScreen->UninstallColormap = DGAUninstallColormap;
+
+ /*
+ * This is now set in InitOutput().
+ *
+ pScrn->SetDGAMode = xf86SetDGAMode;
+ */
+
+ return TRUE;
+}
+
+
+static void
+FreeMarkedVisuals(ScreenPtr pScreen)
+{
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+ FakedVisualList *prev, *curr, *tmp;
+
+ if(!pScreenPriv->fakedVisuals)
+ return;
+
+ prev = NULL;
+ curr = pScreenPriv->fakedVisuals;
+
+ while(curr) {
+ if(curr->free) {
+ tmp = curr;
+ curr = curr->next;
+ if(prev)
+ prev->next = curr;
+ else
+ pScreenPriv->fakedVisuals = curr;
+ xfree(tmp->pVisual);
+ xfree(tmp);
+ } else {
+ prev = curr;
+ curr = curr->next;
+ }
+ }
+}
+
+
+static Bool
+DGACloseScreen(int i, ScreenPtr pScreen)
+{
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ FreeMarkedVisuals(pScreen);
+
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
+ pScreen->InstallColormap = pScreenPriv->InstallColormap;
+ pScreen->UninstallColormap = pScreenPriv->UninstallColormap;
+
+ /* DGAShutdown() should have ensured that no DGA
+ screen were active by here */
+
+ xfree(pScreenPriv);
+
+ return((*pScreen->CloseScreen)(i, pScreen));
+}
+
+
+static void
+DGADestroyColormap(ColormapPtr pmap)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+ VisualPtr pVisual = pmap->pVisual;
+
+ if(pScreenPriv->fakedVisuals) {
+ FakedVisualList *curr = pScreenPriv->fakedVisuals;
+
+ while(curr) {
+ if(curr->pVisual == pVisual) {
+ /* We can't get rid of them yet since FreeColormap
+ still needs the pVisual during the cleanup */
+ curr->free = TRUE;
+ break;
+ }
+ curr = curr->next;
+ }
+ }
+
+ if(pScreenPriv->DestroyColormap) {
+ pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
+ (*pScreen->DestroyColormap)(pmap);
+ pScreen->DestroyColormap = DGADestroyColormap;
+ }
+}
+
+
+static void
+DGAInstallColormap(ColormapPtr pmap)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ if(pScreenPriv->current && pScreenPriv->dgaColormap) {
+ if (pmap != pScreenPriv->dgaColormap) {
+ pScreenPriv->savedColormap = pmap;
+ pmap = pScreenPriv->dgaColormap;
+ }
+ }
+
+ pScreen->InstallColormap = pScreenPriv->InstallColormap;
+ (*pScreen->InstallColormap)(pmap);
+ pScreen->InstallColormap = DGAInstallColormap;
+}
+
+static void
+DGAUninstallColormap(ColormapPtr pmap)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ if(pScreenPriv->current && pScreenPriv->dgaColormap) {
+ if (pmap == pScreenPriv->dgaColormap) {
+ pScreenPriv->dgaColormap = NULL;
+ }
+ }
+
+ pScreen->UninstallColormap = pScreenPriv->UninstallColormap;
+ (*pScreen->UninstallColormap)(pmap);
+ pScreen->UninstallColormap = DGAUninstallColormap;
+}
+
+int
+xf86SetDGAMode(
+ int index,
+ int num,
+ DGADevicePtr devRet
+){
+ ScreenPtr pScreen = screenInfo.screens[index];
+ DGAScreenPtr pScreenPriv;
+ ScrnInfoPtr pScrn;
+ DGADevicePtr device;
+ PixmapPtr pPix = NULL;
+ DGAModePtr pMode = NULL;
+
+ /* First check if DGAInit was successful on this screen */
+ if (DGAScreenIndex < 0)
+ return BadValue;
+ pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+ if (!pScreenPriv)
+ return BadValue;
+ pScrn = pScreenPriv->pScrn;
+
+ if(!num) {
+ if(pScreenPriv->current) {
+ PixmapPtr oldPix = pScreenPriv->current->pPix;
+ if(oldPix) {
+ if(oldPix->drawable.id)
+ FreeResource(oldPix->drawable.id, RT_NONE);
+ else
+ (*pScreen->DestroyPixmap)(oldPix);
+ }
+ xfree(pScreenPriv->current);
+ pScreenPriv->current = NULL;
+ pScrn->vtSema = TRUE;
+ (*pScreenPriv->funcs->SetMode)(pScrn, NULL);
+ if(pScreenPriv->savedColormap) {
+ (*pScreen->InstallColormap)(pScreenPriv->savedColormap);
+ pScreenPriv->savedColormap = NULL;
+ }
+ pScreenPriv->dgaColormap = NULL;
+ (*pScrn->EnableDisableFBAccess)(index, TRUE);
+
+ FreeMarkedVisuals(pScreen);
+ }
+
+ pScreenPriv->grabMouse = FALSE;
+ pScreenPriv->grabKeyboard = FALSE;
+
+ return Success;
+ }
+
+ if(!pScrn->vtSema && !pScreenPriv->current) /* Really switched away */
+ return BadAlloc;
+
+ if((num > 0) && (num <= pScreenPriv->numModes))
+ pMode = &(pScreenPriv->modes[num - 1]);
+ else
+ return BadValue;
+
+ if(!(device = (DGADevicePtr)xalloc(sizeof(DGADeviceRec))))
+ return BadAlloc;
+
+ if(!pScreenPriv->current) {
+ Bool oldVTSema = pScrn->vtSema;
+
+ pScrn->vtSema = FALSE; /* kludge until we rewrite VT switching */
+ (*pScrn->EnableDisableFBAccess)(index, FALSE);
+ pScrn->vtSema = oldVTSema;
+ }
+
+ if(!(*pScreenPriv->funcs->SetMode)(pScrn, pMode)) {
+ xfree(device);
+ return BadAlloc;
+ }
+
+ pScrn->currentMode = pMode->mode;
+
+ if(!pScreenPriv->current && !pScreenPriv->input) {
+ /* if it's multihead we need to warp the cursor off of
+ our screen so it doesn't get trapped */
+ }
+
+ pScrn->vtSema = FALSE;
+
+ if(pScreenPriv->current) {
+ PixmapPtr oldPix = pScreenPriv->current->pPix;
+ if(oldPix) {
+ if(oldPix->drawable.id)
+ FreeResource(oldPix->drawable.id, RT_NONE);
+ else
+ (*pScreen->DestroyPixmap)(oldPix);
+ }
+ xfree(pScreenPriv->current);
+ pScreenPriv->current = NULL;
+ }
+
+ if(pMode->flags & DGA_PIXMAP_AVAILABLE) {
+ if((pPix = (*pScreen->CreatePixmap)(pScreen, 0, 0, pMode->depth))) {
+ (*pScreen->ModifyPixmapHeader)(pPix,
+ pMode->pixmapWidth, pMode->pixmapHeight,
+ pMode->depth, pMode->bitsPerPixel,
+ pMode->bytesPerScanline,
+ (pointer)(pMode->address));
+ }
+ }
+
+ devRet->mode = device->mode = pMode;
+ devRet->pPix = device->pPix = pPix;
+ pScreenPriv->current = device;
+ pScreenPriv->pixmapMode = FALSE;
+ pScreenPriv->grabMouse = TRUE;
+ pScreenPriv->grabKeyboard = TRUE;
+
+ return Success;
+}
+
+
+
+/*********** exported ones ***************/
+
+void
+DGASetInputMode(int index, Bool keyboard, Bool mouse)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ if (pScreenPriv)
+ {
+ pScreenPriv->grabMouse = mouse;
+ pScreenPriv->grabKeyboard = keyboard;
+ }
+}
+
+Bool
+DGAChangePixmapMode(int index, int *x, int *y, int mode)
+{
+ DGAScreenPtr pScreenPriv;
+ DGADevicePtr pDev;
+ DGAModePtr pMode;
+ PixmapPtr pPix;
+
+ if(DGAScreenIndex < 0)
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if(!pScreenPriv || !pScreenPriv->current || !pScreenPriv->current->pPix)
+ return FALSE;
+
+ pDev = pScreenPriv->current;
+ pPix = pDev->pPix;
+ pMode = pDev->mode;
+
+ if(mode) {
+ int shift = 2;
+
+ if(*x > (pMode->pixmapWidth - pMode->viewportWidth))
+ *x = pMode->pixmapWidth - pMode->viewportWidth;
+ if(*y > (pMode->pixmapHeight - pMode->viewportHeight))
+ *y = pMode->pixmapHeight - pMode->viewportHeight;
+
+ switch(xf86Screens[index]->bitsPerPixel) {
+ case 16: shift = 1; break;
+ case 32: shift = 0; break;
+ default: break;
+ }
+
+ if(BITMAP_SCANLINE_PAD == 64)
+ shift++;
+
+ *x = (*x >> shift) << shift;
+
+ pPix->drawable.x = *x;
+ pPix->drawable.y = *y;
+ pPix->drawable.width = pMode->viewportWidth;
+ pPix->drawable.height = pMode->viewportHeight;
+ } else {
+ pPix->drawable.x = 0;
+ pPix->drawable.y = 0;
+ pPix->drawable.width = pMode->pixmapWidth;
+ pPix->drawable.height = pMode->pixmapHeight;
+ }
+ pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ pScreenPriv->pixmapMode = mode;
+
+ return TRUE;
+}
+
+Bool
+DGAAvailable(int index)
+{
+ if(DGAScreenIndex < 0)
+ return FALSE;
+
+ if (!xf86NoSharedResources(((ScrnInfoPtr)screenInfo.screens[index]->
+ devPrivates[xf86ScreenIndex].ptr)->scrnIndex,MEM))
+ return FALSE;
+
+ if(DGA_GET_SCREEN_PRIV(screenInfo.screens[index]))
+ return TRUE;
+
+ return FALSE;
+}
+
+Bool
+DGAActive(int index)
+{
+ DGAScreenPtr pScreenPriv;
+
+ if(DGAScreenIndex < 0)
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if(pScreenPriv && pScreenPriv->current)
+ return TRUE;
+
+ return FALSE;
+}
+
+
+
+/* Called by the event code in case the server is abruptly terminated */
+
+void
+DGAShutdown()
+{
+ ScrnInfoPtr pScrn;
+ int i;
+
+ if(DGAScreenIndex < 0)
+ return;
+
+ for(i = 0; i < screenInfo.numScreens; i++) {
+ pScrn = xf86Screens[i];
+
+ (void)(*pScrn->SetDGAMode)(pScrn->scrnIndex, 0, NULL);
+ }
+}
+
+/* Called by the extension to initialize a mode */
+
+int
+DGASetMode(
+ int index,
+ int num,
+ XDGAModePtr mode,
+ PixmapPtr *pPix
+){
+ ScrnInfoPtr pScrn = xf86Screens[index];
+ DGADeviceRec device;
+ int ret;
+
+ /* We rely on the extension to check that DGA is available */
+
+ ret = (*pScrn->SetDGAMode)(index, num, &device);
+ if((ret == Success) && num) {
+ DGACopyModeInfo(device.mode, mode);
+ *pPix = device.pPix;
+ }
+
+ return ret;
+}
+
+/* Called from the extension to let the DDX know which events are requested */
+
+void
+DGASelectInput(
+ int index,
+ ClientPtr client,
+ long mask
+){
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ /* We rely on the extension to check that DGA is available */
+ pScreenPriv->client = client;
+ pScreenPriv->input = mask;
+}
+
+int
+DGAGetViewportStatus(int index)
+{
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ /* We rely on the extension to check that DGA is active */
+
+ if (!pScreenPriv->funcs->GetViewport)
+ return 0;
+
+ return (*pScreenPriv->funcs->GetViewport)(pScreenPriv->pScrn);
+}
+
+int
+DGASetViewport(
+ int index,
+ int x, int y,
+ int mode
+){
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if (pScreenPriv->funcs->SetViewport)
+ (*pScreenPriv->funcs->SetViewport)(pScreenPriv->pScrn, x, y, mode);
+ return Success;
+}
+
+
+static int
+BitsClear(CARD32 data)
+{
+ int bits = 0;
+ CARD32 mask;
+
+ for(mask = 1; mask; mask <<= 1) {
+ if(!(data & mask)) bits++;
+ else break;
+ }
+
+ return bits;
+}
+
+int
+DGACreateColormap(int index, ClientPtr client, int id, int mode, int alloc)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+ FakedVisualList *fvlp;
+ VisualPtr pVisual;
+ DGAModePtr pMode;
+ ColormapPtr pmap;
+
+ if(!mode || (mode > pScreenPriv->numModes))
+ return BadValue;
+
+ if((alloc != AllocNone) && (alloc != AllocAll))
+ return BadValue;
+
+ pMode = &(pScreenPriv->modes[mode - 1]);
+
+ if(!(pVisual = xalloc(sizeof(VisualRec))))
+ return BadAlloc;
+
+ pVisual->vid = FakeClientID(0);
+ pVisual->class = pMode->visualClass;
+ pVisual->nplanes = pMode->depth;
+ pVisual->ColormapEntries = 1 << pMode->depth;
+ pVisual->bitsPerRGBValue = (pMode->depth + 2) / 3;
+
+ switch (pVisual->class) {
+ case PseudoColor:
+ case GrayScale:
+ case StaticGray:
+ pVisual->bitsPerRGBValue = 8; /* not quite */
+ pVisual->redMask = 0;
+ pVisual->greenMask = 0;
+ pVisual->blueMask = 0;
+ pVisual->offsetRed = 0;
+ pVisual->offsetGreen = 0;
+ pVisual->offsetBlue = 0;
+ break;
+ case DirectColor:
+ case TrueColor:
+ pVisual->ColormapEntries = 1 << pVisual->bitsPerRGBValue;
+ /* fall through */
+ case StaticColor:
+ pVisual->redMask = pMode->red_mask;
+ pVisual->greenMask = pMode->green_mask;
+ pVisual->blueMask = pMode->blue_mask;
+ pVisual->offsetRed = BitsClear(pVisual->redMask);
+ pVisual->offsetGreen = BitsClear(pVisual->greenMask);
+ pVisual->offsetBlue = BitsClear(pVisual->blueMask);
+ }
+
+ if(!(fvlp = xalloc(sizeof(FakedVisualList)))) {
+ xfree(pVisual);
+ return BadAlloc;
+ }
+
+ fvlp->free = FALSE;
+ fvlp->pVisual = pVisual;
+ fvlp->next = pScreenPriv->fakedVisuals;
+ pScreenPriv->fakedVisuals = fvlp;
+
+ LEGAL_NEW_RESOURCE(id, client);
+
+ return CreateColormap(id, pScreen, pVisual, &pmap, alloc, client->index);
+}
+
+/* Called by the extension to install a colormap on DGA active screens */
+
+void
+DGAInstallCmap(ColormapPtr cmap)
+{
+ ScreenPtr pScreen = cmap->pScreen;
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ /* We rely on the extension to check that DGA is active */
+
+ if(!pScreenPriv->dgaColormap)
+ pScreenPriv->savedColormap = miInstalledMaps[pScreen->myNum];
+
+ pScreenPriv->dgaColormap = cmap;
+
+ (*pScreen->InstallColormap)(cmap);
+}
+
+int
+DGASync(int index)
+{
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ /* We rely on the extension to check that DGA is active */
+
+ if (pScreenPriv->funcs->Sync)
+ (*pScreenPriv->funcs->Sync)(pScreenPriv->pScrn);
+
+ return Success;
+}
+
+int
+DGAFillRect(
+ int index,
+ int x, int y, int w, int h,
+ unsigned long color
+){
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ /* We rely on the extension to check that DGA is active */
+
+ if(pScreenPriv->funcs->FillRect &&
+ (pScreenPriv->current->mode->flags & DGA_FILL_RECT)) {
+
+ (*pScreenPriv->funcs->FillRect)(pScreenPriv->pScrn, x, y, w, h, color);
+ return Success;
+ }
+ return BadMatch;
+}
+
+int
+DGABlitRect(
+ int index,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty
+){
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ /* We rely on the extension to check that DGA is active */
+
+ if(pScreenPriv->funcs->BlitRect &&
+ (pScreenPriv->current->mode->flags & DGA_BLIT_RECT)) {
+
+ (*pScreenPriv->funcs->BlitRect)(pScreenPriv->pScrn,
+ srcx, srcy, w, h, dstx, dsty);
+ return Success;
+ }
+ return BadMatch;
+}
+
+int
+DGABlitTransRect(
+ int index,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty,
+ unsigned long color
+){
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ /* We rely on the extension to check that DGA is active */
+
+ if(pScreenPriv->funcs->BlitTransRect &&
+ (pScreenPriv->current->mode->flags & DGA_BLIT_RECT_TRANS)) {
+
+ (*pScreenPriv->funcs->BlitTransRect)(pScreenPriv->pScrn,
+ srcx, srcy, w, h, dstx, dsty, color);
+ return Success;
+ }
+ return BadMatch;
+}
+
+
+int
+DGAGetModes(int index)
+{
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+ /* We rely on the extension to check that DGA is available */
+
+ return pScreenPriv->numModes;
+}
+
+
+int
+DGAGetModeInfo(
+ int index,
+ XDGAModePtr mode,
+ int num
+){
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+ /* We rely on the extension to check that DGA is available */
+
+ if((num <= 0) || (num > pScreenPriv->numModes))
+ return BadValue;
+
+ DGACopyModeInfo(&(pScreenPriv->modes[num - 1]), mode);
+
+ return Success;
+}
+
+
+static void
+DGACopyModeInfo(
+ DGAModePtr mode,
+ XDGAModePtr xmode
+){
+ DisplayModePtr dmode = mode->mode;
+
+ xmode->num = mode->num;
+ xmode->name = dmode->name;
+ xmode->VSync_num = (int)(dmode->VRefresh * 1000.0);
+ xmode->VSync_den = 1000;
+ xmode->flags = mode->flags;
+ xmode->imageWidth = mode->imageWidth;
+ xmode->imageHeight = mode->imageHeight;
+ xmode->pixmapWidth = mode->pixmapWidth;
+ xmode->pixmapHeight = mode->pixmapHeight;
+ xmode->bytesPerScanline = mode->bytesPerScanline;
+ xmode->byteOrder = mode->byteOrder;
+ xmode->depth = mode->depth;
+ xmode->bitsPerPixel = mode->bitsPerPixel;
+ xmode->red_mask = mode->red_mask;
+ xmode->green_mask = mode->green_mask;
+ xmode->blue_mask = mode->blue_mask;
+ xmode->visualClass = mode->visualClass;
+ xmode->viewportWidth = mode->viewportWidth;
+ xmode->viewportHeight = mode->viewportHeight;
+ xmode->xViewportStep = mode->xViewportStep;
+ xmode->yViewportStep = mode->yViewportStep;
+ xmode->maxViewportX = mode->maxViewportX;
+ xmode->maxViewportY = mode->maxViewportY;
+ xmode->viewportFlags = mode->viewportFlags;
+ xmode->reserved1 = mode->reserved1;
+ xmode->reserved2 = mode->reserved2;
+ xmode->offset = mode->offset;
+
+ if(dmode->Flags & V_INTERLACE) xmode->flags |= DGA_INTERLACED;
+ if(dmode->Flags & V_DBLSCAN) xmode->flags |= DGA_DOUBLESCAN;
+}
+
+
+Bool
+DGAVTSwitch(void)
+{
+ ScreenPtr pScreen;
+ int i;
+
+ for(i = 0; i < screenInfo.numScreens; i++) {
+ pScreen = screenInfo.screens[i];
+
+ /* Alternatively, this could send events to DGA clients */
+
+ if(DGAScreenIndex >= 0) {
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ if(pScreenPriv && pScreenPriv->current)
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+
+/* We have the power to steal or modify events that are about to get queued */
+
+Bool
+DGAStealKeyEvent(int index, xEvent *e)
+{
+ DGAScreenPtr pScreenPriv;
+ dgaEvent de;
+
+ if(DGAScreenIndex < 0) /* no DGA */
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if(!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */
+ return FALSE;
+
+ de.u.u.type = e->u.u.type + *XDGAEventBase;
+ de.u.u.detail = e->u.u.detail;
+ de.u.event.time = e->u.keyButtonPointer.time;
+ xf86eqEnqueue ((xEvent *) &de);
+ return TRUE;
+}
+
+static int DGAMouseX, DGAMouseY;
+
+Bool
+DGAStealMouseEvent(int index, xEvent *e, int dx, int dy)
+{
+ DGAScreenPtr pScreenPriv;
+ dgaEvent de;
+
+ if(DGAScreenIndex < 0) /* no DGA */
+ return FALSE;
+
+ pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ if(!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */
+ return FALSE;
+
+ DGAMouseX += dx;
+ if (DGAMouseX < 0)
+ DGAMouseX = 0;
+ else if (DGAMouseX > screenInfo.screens[index]->width)
+ DGAMouseX = screenInfo.screens[index]->width;
+ DGAMouseY += dy;
+ if (DGAMouseY < 0)
+ DGAMouseY = 0;
+ else if (DGAMouseY > screenInfo.screens[index]->height)
+ DGAMouseY = screenInfo.screens[index]->height;
+ de.u.u.type = e->u.u.type + *XDGAEventBase;
+ de.u.u.detail = e->u.u.detail;
+ de.u.event.time = e->u.keyButtonPointer.time;
+ de.u.event.dx = dx;
+ de.u.event.dy = dy;
+ de.u.event.pad1 = DGAMouseX;
+ de.u.event.pad2 = DGAMouseY;
+ xf86eqEnqueue ((xEvent *) &de);
+ return TRUE;
+}
+
+Bool
+DGAIsDgaEvent (xEvent *e)
+{
+ int coreEquiv;
+ if (DGAScreenIndex < 0 || XDGAEventBase == 0)
+ return FALSE;
+ coreEquiv = e->u.u.type - *XDGAEventBase;
+ if (KeyPress <= coreEquiv && coreEquiv <= MotionNotify)
+ return TRUE;
+ return FALSE;
+}
+
+#define NoSuchEvent 0x80000000 /* so doesn't match NoEventMask */
+static Mask filters[] =
+{
+ NoSuchEvent, /* 0 */
+ NoSuchEvent, /* 1 */
+ KeyPressMask, /* KeyPress */
+ KeyReleaseMask, /* KeyRelease */
+ ButtonPressMask, /* ButtonPress */
+ ButtonReleaseMask, /* ButtonRelease */
+ PointerMotionMask, /* MotionNotify (initial state) */
+};
+
+static void
+DGAProcessKeyboardEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr keybd)
+{
+ int key, bit;
+ register BYTE *kptr;
+ register int i;
+ register CARD8 modifiers;
+ register CARD16 mask;
+ int coreEquiv;
+ xEvent core;
+ KeyClassPtr keyc = keybd->key;
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ coreEquiv = de->u.u.type - *XDGAEventBase;
+
+ /*
+ * Fill in remaining event state
+ */
+ de->u.event.dx = 0;
+ de->u.event.dy = 0;
+ de->u.event.screen = pScreen->myNum;
+ de->u.event.state = keyc->state | (inputInfo.pointer)->button->state;
+
+ /*
+ * Keep the core state in sync by duplicating what
+ * CoreProcessKeyboardEvent does
+ */
+ key = de->u.u.detail;
+ kptr = &keyc->down[key >> 3];
+ bit = 1 << (key & 7);
+ modifiers = keyc->modifierMap[key];
+ switch (coreEquiv)
+ {
+ case KeyPress:
+ inputInfo.pointer->valuator->motionHintWindow = NullWindow;
+ *kptr |= bit;
+ keyc->prev_state = keyc->state;
+ if (noXkbExtension) {
+ for (i = 0, mask = 1; modifiers; i++, mask <<= 1)
+ {
+ if (mask & modifiers)
+ {
+ /* This key affects modifier "i" */
+ keyc->modifierKeyCount[i]++;
+ keyc->state |= mask;
+ modifiers &= ~mask;
+ }
+ }
+ }
+ break;
+ case KeyRelease:
+ inputInfo.pointer->valuator->motionHintWindow = NullWindow;
+ *kptr &= ~bit;
+ keyc->prev_state = keyc->state;
+ if (noXkbExtension) {
+ for (i = 0, mask = 1; modifiers; i++, mask <<= 1)
+ {
+ if (mask & modifiers) {
+ /* This key affects modifier "i" */
+ if (--keyc->modifierKeyCount[i] <= 0) {
+ keyc->state &= ~mask;
+ keyc->modifierKeyCount[i] = 0;
+ }
+ modifiers &= ~mask;
+ }
+ }
+ }
+ break;
+ }
+ /*
+ * Deliver the DGA event
+ */
+ if (pScreenPriv->client)
+ {
+ /* If the DGA client has selected input, then deliver based on the usual filter */
+ TryClientEvents (pScreenPriv->client, (xEvent *) de, 1,
+ filters[coreEquiv], pScreenPriv->input, 0);
+ }
+ else
+ {
+ /* If the keyboard is actively grabbed, deliver a grabbed core event */
+ if (keybd->grab && !keybd->fromPassiveGrab)
+ {
+ core.u.u.type = coreEquiv;
+ core.u.u.detail = de->u.u.detail;
+ core.u.keyButtonPointer.time = de->u.event.time;
+ core.u.keyButtonPointer.eventX = de->u.event.dx;
+ core.u.keyButtonPointer.eventY = de->u.event.dy;
+ core.u.keyButtonPointer.rootX = de->u.event.dx;
+ core.u.keyButtonPointer.rootY = de->u.event.dy;
+ core.u.keyButtonPointer.state = de->u.event.state;
+ DeliverGrabbedEvent (&core, keybd, FALSE, 1);
+ }
+ }
+}
+
+static void
+DGAProcessPointerEvent (ScreenPtr pScreen, dgaEvent *de, DeviceIntPtr mouse)
+{
+ ButtonClassPtr butc = mouse->button;
+ int coreEquiv;
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+ xEvent core;
+
+ coreEquiv = de->u.u.type - *XDGAEventBase;
+ /*
+ * Fill in remaining event state
+ */
+ de->u.event.screen = pScreen->myNum;
+ de->u.event.state = butc->state | inputInfo.keyboard->key->state;
+ /*
+ * Keep the core state in sync by duplicating what
+ * CoreProcessPointerEvent does
+ */
+ if (coreEquiv != MotionNotify)
+ {
+ register int key;
+ register BYTE *kptr;
+ int bit;
+
+ key = de->u.u.detail;
+ kptr = &butc->down[key >> 3];
+ bit = 1 << (key & 7);
+ switch (coreEquiv)
+ {
+ case ButtonPress:
+ mouse->valuator->motionHintWindow = NullWindow;
+ if (!(*kptr & bit))
+ butc->buttonsDown++;
+ butc->motionMask = ButtonMotionMask;
+ *kptr |= bit;
+ if (key <= 5)
+ butc->state |= (Button1Mask >> 1) << key;
+ break;
+ case ButtonRelease:
+ mouse->valuator->motionHintWindow = NullWindow;
+ if (*kptr & bit)
+ --butc->buttonsDown;
+ if (!butc->buttonsDown)
+ butc->motionMask = 0;
+ *kptr &= ~bit;
+ if (key == 0)
+ return;
+ if (key <= 5)
+ butc->state &= ~((Button1Mask >> 1) << key);
+ break;
+ }
+ }
+ /*
+ * Deliver the DGA event
+ */
+ if (pScreenPriv->client)
+ {
+ /* If the DGA client has selected input, then deliver based on the usual filter */
+ TryClientEvents (pScreenPriv->client, (xEvent *) de, 1,
+ filters[coreEquiv], pScreenPriv->input, 0);
+ }
+ else
+ {
+ /* If the pointer is actively grabbed, deliver a grabbed core event */
+ if (mouse->grab && !mouse->fromPassiveGrab)
+ {
+ core.u.u.type = coreEquiv;
+ core.u.u.detail = de->u.u.detail;
+ core.u.keyButtonPointer.time = de->u.event.time;
+ core.u.keyButtonPointer.eventX = de->u.event.dx;
+ core.u.keyButtonPointer.eventY = de->u.event.dy;
+ core.u.keyButtonPointer.rootX = de->u.event.dx;
+ core.u.keyButtonPointer.rootY = de->u.event.dy;
+ core.u.keyButtonPointer.state = de->u.event.state;
+ DeliverGrabbedEvent (&core, mouse, FALSE, 1);
+ }
+ }
+}
+
+Bool
+DGADeliverEvent (ScreenPtr pScreen, xEvent *e)
+{
+ dgaEvent *de = (dgaEvent *) e;
+ DGAScreenPtr pScreenPriv;
+ int coreEquiv;
+
+ /* no DGA */
+ if (DGAScreenIndex < 0 || XDGAEventBase == 0)
+ return FALSE;
+ pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
+
+ /* DGA not initialized on this screen */
+ if (!pScreenPriv)
+ return FALSE;
+
+ coreEquiv = de->u.u.type - *XDGAEventBase;
+ /* Not a DGA event */
+ if (coreEquiv < KeyPress || coreEquiv > MotionNotify)
+ return FALSE;
+
+ switch (coreEquiv) {
+ case KeyPress:
+ case KeyRelease:
+ DGAProcessKeyboardEvent (pScreen, de, inputInfo.keyboard);
+ break;
+ default:
+ DGAProcessPointerEvent (pScreen, de, inputInfo.pointer);
+ break;
+ }
+ return TRUE;
+}
+
+Bool
+DGAOpenFramebuffer(
+ int index,
+ char **name,
+ unsigned char **mem,
+ int *size,
+ int *offset,
+ int *flags
+){
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ /* We rely on the extension to check that DGA is available */
+
+ return (*pScreenPriv->funcs->OpenFramebuffer)(pScreenPriv->pScrn,
+ name, mem, size, offset, flags);
+}
+
+void
+DGACloseFramebuffer(int index)
+{
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+
+ /* We rely on the extension to check that DGA is available */
+ if(pScreenPriv->funcs->CloseFramebuffer)
+ (*pScreenPriv->funcs->CloseFramebuffer)(pScreenPriv->pScrn);
+}
+
+/* For DGA 1.0 backwards compatibility only */
+
+int
+DGAGetOldDGAMode(int index)
+{
+ DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(screenInfo.screens[index]);
+ ScrnInfoPtr pScrn = pScreenPriv->pScrn;
+ DGAModePtr mode;
+ int i, w, h, p;
+
+ /* We rely on the extension to check that DGA is available */
+
+ w = pScrn->currentMode->HDisplay;
+ h = pScrn->currentMode->VDisplay;
+ p = ((pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)) + 3) & ~3L;
+
+ for(i = 0; i < pScreenPriv->numModes; i++) {
+ mode = &(pScreenPriv->modes[i]);
+
+ if((mode->viewportWidth == w) && (mode->viewportHeight == h) &&
+ (mode->bytesPerScanline == p) &&
+ (mode->bitsPerPixel == pScrn->bitsPerPixel) &&
+ (mode->depth == pScrn->depth)) {
+
+ return mode->num;
+ }
+ }
+
+ return 0;
+}
+
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
new file mode 100644
index 000000000..0de054ff3
--- /dev/null
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -0,0 +1,175 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.8 2003/02/13 02:41:09 dawes Exp $ */
+
+/*
+ * Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains the DPMS functions required by the extension.
+ */
+
+#include "X.h"
+#include "os.h"
+#include "globals.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#ifdef DPMSExtension
+#include "dpmsproc.h"
+#endif
+
+
+#ifdef DPMSExtension
+static int DPMSGeneration = 0;
+static int DPMSIndex = -1;
+static Bool DPMSClose(int i, ScreenPtr pScreen);
+static int DPMSCount = 0;
+#endif
+
+
+Bool
+xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
+{
+#ifdef DPMSExtension
+ DPMSPtr pDPMS;
+ pointer DPMSOpt;
+
+ if (serverGeneration != DPMSGeneration) {
+ if ((DPMSIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ DPMSGeneration = serverGeneration;
+ }
+
+ if (DPMSDisabledSwitch)
+ DPMSEnabled = FALSE;
+ if (!(pScreen->devPrivates[DPMSIndex].ptr = xcalloc(sizeof(DPMSRec), 1)))
+ return FALSE;
+
+ pDPMS = (DPMSPtr)pScreen->devPrivates[DPMSIndex].ptr;
+ pDPMS->Set = set;
+ pDPMS->Flags = flags;
+ DPMSOpt = xf86FindOption(xf86Screens[pScreen->myNum]->options, "dpms");
+ if (DPMSOpt) {
+ if ((pDPMS->Enabled
+ = xf86SetBoolOption(xf86Screens[pScreen->myNum]->options,
+ "dpms",FALSE))
+ && !DPMSDisabledSwitch)
+ DPMSEnabled = TRUE;
+ xf86MarkOptionUsed(DPMSOpt);
+ xf86DrvMsg(pScreen->myNum, X_CONFIG, "DPMS enabled\n");
+ } else if (DPMSEnabledSwitch) {
+ if (!DPMSDisabledSwitch)
+ DPMSEnabled = TRUE;
+ pDPMS->Enabled = TRUE;
+ }
+ else {
+ pDPMS->Enabled = FALSE;
+ }
+ pDPMS->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = DPMSClose;
+ DPMSCount++;
+ return TRUE;
+#else
+ return FALSE;
+#endif
+}
+
+
+#ifdef DPMSExtension
+
+static Bool
+DPMSClose(int i, ScreenPtr pScreen)
+{
+ DPMSPtr pDPMS;
+
+ /* This shouldn't happen */
+ if (DPMSIndex < 0)
+ return FALSE;
+
+ pDPMS = (DPMSPtr)pScreen->devPrivates[DPMSIndex].ptr;
+
+ /* This shouldn't happen */
+ if (!pDPMS)
+ return FALSE;
+
+ pScreen->CloseScreen = pDPMS->CloseScreen;
+
+ xfree((pointer)pDPMS);
+ pScreen->devPrivates[DPMSIndex].ptr = NULL;
+ if (--DPMSCount == 0)
+ DPMSIndex = -1;
+ return pScreen->CloseScreen(i, pScreen);
+}
+
+
+/*
+ * DPMSSet --
+ * Device dependent DPMS mode setting hook. This is called whenever
+ * the DPMS mode is to be changed.
+ */
+void
+DPMSSet(int level)
+{
+ int i;
+ DPMSPtr pDPMS;
+
+ DPMSPowerLevel = level;
+
+ if (DPMSIndex < 0)
+ return;
+
+ /* For each screen, set the DPMS level */
+ for (i = 0; i < xf86NumScreens; i++) {
+ pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr;
+ if (pDPMS && pDPMS->Set && pDPMS->Enabled && xf86Screens[i]->vtSema) {
+ xf86EnableAccess(xf86Screens[i]);
+ pDPMS->Set(xf86Screens[i], level, 0);
+ }
+ }
+}
+
+
+/*
+ * DPMSSupported --
+ * Return TRUE if any screen supports DPMS.
+ */
+Bool
+DPMSSupported(void)
+{
+ int i;
+ DPMSPtr pDPMS;
+
+ if (DPMSIndex < 0) {
+ return FALSE;
+ }
+
+ /* For each screen, check if DPMS is supported */
+ for (i = 0; i < xf86NumScreens; i++) {
+ pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr;
+ if (pDPMS && pDPMS->Set)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+/*
+ * DPMSGet --
+ * Device dependent DPMS mode getting hook. This returns the current
+ * DPMS mode, or -1 if DPMS is not supported.
+ *
+ * This should hook in to the appropriate driver-level function, which
+ * will be added to the ScrnInfoRec.
+ *
+ * NOTES:
+ * 1. the calling interface should be changed to specify which
+ * screen to check.
+ * 2. It isn't clear that this function is ever used or what it should
+ * return.
+ */
+int
+DPMSGet(int *level)
+{
+ return DPMSPowerLevel;
+}
+
+#endif /* DPMSExtension */
diff --git a/hw/xfree86/common/xf86Date.h b/hw/xfree86/common/xf86Date.h
new file mode 100644
index 000000000..506e05370
--- /dev/null
+++ b/hw/xfree86/common/xf86Date.h
@@ -0,0 +1,7 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.3.2.3 2003/05/10 01:10:10 dawes Exp $ */
+
+#ifndef XF86_DATE
+
+#define XF86_DATE "9 May 2003"
+
+#endif
diff --git a/hw/xfree86/common/xf86Debug.c b/hw/xfree86/common/xf86Debug.c
new file mode 100644
index 000000000..b069743a1
--- /dev/null
+++ b/hw/xfree86/common/xf86Debug.c
@@ -0,0 +1,162 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.4 2001/12/13 18:01:50 eich Exp $ */
+
+#include <sys/time.h>
+#include <unistd.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "compiler.h"
+
+void xf86Break1(void)
+{
+}
+
+void xf86Break2(void)
+{
+}
+
+void xf86Break3(void)
+{
+}
+
+char *xf86p8bit[] = { "00000000", "00000001", "00000010", "00000011",
+ "00000100", "00000101", "00000110", "00000111",
+ "00001000", "00001001", "00001010", "00001011",
+ "00001100", "00001101", "00001110", "00001111",
+ "00010000", "00010001", "00010010", "00010011",
+ "00010100", "00010101", "00010110", "00010111",
+ "00011000", "00011001", "00011010", "00011011",
+ "00011100", "00011101", "00011110", "00011111",
+ "00100000", "00100001", "00100010", "00100011",
+ "00100100", "00100101", "00100110", "00100111",
+ "00101000", "00101001", "00101010", "00101011",
+ "00101100", "00101101", "00101110", "00101111",
+ "00110000", "00110001", "00110010", "00110011",
+ "00110100", "00110101", "00110110", "00110111",
+ "00111000", "00111001", "00111010", "00111011",
+ "00111100", "00111101", "00111110", "00111111",
+ "01000000", "01000001", "01000010", "01000011",
+ "01000100", "01000101", "01000110", "01000111",
+ "01001000", "01001001", "01001010", "01001011",
+ "01001100", "01001101", "01001110", "01001111",
+ "01010000", "01010001", "01010010", "01010011",
+ "01010100", "01010101", "01010110", "01010111",
+ "01011000", "01011001", "01011010", "01011011",
+ "01011100", "01011101", "01011110", "01011111",
+ "01100000", "01100001", "01100010", "01100011",
+ "01100100", "01100101", "01100110", "01100111",
+ "01101000", "01101001", "01101010", "01101011",
+ "01101100", "01101101", "01101110", "01101111",
+ "01110000", "01110001", "01110010", "01110011",
+ "01110100", "01110101", "01110110", "01110111",
+ "01111000", "01111001", "01111010", "01111011",
+ "01111100", "01111101", "01111110", "01111111",
+ "10000000", "10000001", "10000010", "10000011",
+ "10000100", "10000101", "10000110", "10000111",
+ "10001000", "10001001", "10001010", "10001011",
+ "10001100", "10001101", "10001110", "10001111",
+ "10010000", "10010001", "10010010", "10010011",
+ "10010100", "10010101", "10010110", "10010111",
+ "10011000", "10011001", "10011010", "10011011",
+ "10011100", "10011101", "10011110", "10011111",
+ "10100000", "10100001", "10100010", "10100011",
+ "10100100", "10100101", "10100110", "10100111",
+ "10101000", "10101001", "10101010", "10101011",
+ "10101100", "10101101", "10101110", "10101111",
+ "10110000", "10110001", "10110010", "10110011",
+ "10110100", "10110101", "10110110", "10110111",
+ "10111000", "10111001", "10111010", "10111011",
+ "10111100", "10111101", "10111110", "10111111",
+ "11000000", "11000001", "11000010", "11000011",
+ "11000100", "11000101", "11000110", "11000111",
+ "11001000", "11001001", "11001010", "11001011",
+ "11001100", "11001101", "11001110", "11001111",
+ "11010000", "11010001", "11010010", "11010011",
+ "11010100", "11010101", "11010110", "11010111",
+ "11011000", "11011001", "11011010", "11011011",
+ "11011100", "11011101", "11011110", "11011111",
+ "11100000", "11100001", "11100010", "11100011",
+ "11100100", "11100101", "11100110", "11100111",
+ "11101000", "11101001", "11101010", "11101011",
+ "11101100", "11101101", "11101110", "11101111",
+ "11110000", "11110001", "11110010", "11110011",
+ "11110100", "11110101", "11110110", "11110111",
+ "11111000", "11111001", "11111010", "11111011",
+ "11111100", "11111101", "11111110", "11111111"
+};
+
+CARD32 xf86DummyVar1;
+CARD32 xf86DummyVar2;
+CARD32 xf86DummyVar3;
+
+CARD8 xf86PeekFb8(CARD8 *p) { return *p; }
+CARD16 xf86PeekFb16(CARD16 *p) { return *p; }
+CARD32 xf86PeekFb32(CARD32 *p) { return *p; }
+void xf86PokeFb8(CARD8 *p, CARD8 v) { *p = v; }
+void xf86PokeFb16(CARD16 *p, CARD16 v) { *p = v; }
+void xf86PokeFb32(CARD16 *p, CARD32 v) { *p = v; }
+
+CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset)
+{
+ return MMIO_IN8(Base,Offset);
+}
+
+CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset)
+{
+ return MMIO_IN16(Base,Offset);
+}
+
+CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset)
+{
+ return MMIO_IN32(Base,Offset);
+}
+
+void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v)
+{
+ MMIO_OUT8(Base,Offset,v);
+}
+
+void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v)
+{
+ MMIO_OUT16(Base,Offset,v);
+}
+
+void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v)
+{
+ MMIO_OUT32(Base,Offset,v);
+}
+
+
+void
+xf86STimestamp(xf86TsPtr* timestamp)
+{
+ if (*timestamp) {
+ gettimeofday((struct timeval*)*timestamp,NULL);
+ } else {
+ *timestamp = xnfalloc(sizeof(xf86TsRec));
+ gettimeofday((struct timeval*)*timestamp,NULL);
+ }
+}
+
+void
+xf86SPTimestamp(xf86TsPtr* timestamp, char *str)
+{
+ if (*timestamp) {
+ long diff;
+ struct timeval ts;
+ ts = **(struct timeval**)timestamp;
+ gettimeofday((struct timeval*)*timestamp,NULL);
+ if (ts.tv_usec > (*timestamp)->usec)
+ diff = ((*timestamp)->sec - ts.tv_sec - 1) * 1000
+ + (ts.tv_usec - (*timestamp)->usec) / 1000;
+ else
+ diff = ((*timestamp)->sec - ts.tv_sec) * 1000
+ +(- ts.tv_usec + (*timestamp)->usec) / 1000;
+ ErrorF("%s Elapsed: %i\n",str,diff);
+ } else {
+ *timestamp = xnfalloc(sizeof(xf86TsRec));
+ gettimeofday((struct timeval*)*timestamp,NULL);
+ }
+}
diff --git a/hw/xfree86/common/xf86DefModes.c b/hw/xfree86/common/xf86DefModes.c
new file mode 100644
index 000000000..abef13110
--- /dev/null
+++ b/hw/xfree86/common/xf86DefModes.c
@@ -0,0 +1,153 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DefModes.c,v 1.9 2002/11/11 04:24:40 dawes Exp $ */
+
+/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at
+ * modeline2c.pl */
+
+/*
+ * Copyright 1999 by The XFree86 Project, Inc.
+ *
+ * Author: Dirk Hohndel <hohndel@XFree86.Org>
+ */
+
+#include "xf86.h"
+#include "xf86Config.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#include "globals.h"
+
+#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT
+#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
+
+DisplayModeRec xf86DefaultModes [] = {
+/* 640x350 @ 85Hz (VESA) hsync: 37.9kHz */
+ {MODEPREFIX("640x350"),31500, 640,672,736,832,0, 350,382,385,445,0, V_PHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("320x175"),15750, 320,336,368,416,0, 175,191,192,222,0, V_PHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 640x400 @ 85Hz (VESA) hsync: 37.9kHz */
+ {MODEPREFIX("640x400"),31500, 640,672,736,832,0, 400,401,404,445,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("320x200"),15750, 320,336,368,416,0, 200,200,202,222,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 720x400 @ 85Hz (VESA) hsync: 37.9kHz */
+ {MODEPREFIX("720x400"),35500, 720,756,828,936,0, 400,401,404,446,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("360x200"),17750, 360,378,414,468,0, 200,200,202,223,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz */
+ {MODEPREFIX("640x480"),25200, 640,656,752,800,0, 480,490,492,525,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("320x240"),12600, 320,328,376,400,0, 240,245,246,262,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 640x480 @ 72Hz (VESA) hsync: 37.9kHz */
+ {MODEPREFIX("640x480"),31500, 640,664,704,832,0, 480,489,491,520,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("320x240"),15750, 320,332,352,416,0, 240,244,245,260,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 640x480 @ 75Hz (VESA) hsync: 37.5kHz */
+ {MODEPREFIX("640x480"),31500, 640,656,720,840,0, 480,481,484,500,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("320x240"),15750, 320,328,360,420,0, 240,240,242,250,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 640x480 @ 85Hz (VESA) hsync: 43.3kHz */
+ {MODEPREFIX("640x480"),36000, 640,696,752,832,0, 480,481,484,509,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("320x240"),18000, 320,348,376,416,0, 240,240,242,254,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 800x600 @ 56Hz (VESA) hsync: 35.2kHz */
+ {MODEPREFIX("800x600"),36000, 800,824,896,1024,0, 600,601,603,625,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("400x300"),18000, 400,412,448,512,0, 300,300,301,312,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 800x600 @ 60Hz (VESA) hsync: 37.9kHz */
+ {MODEPREFIX("800x600"),40000, 800,840,968,1056,0, 600,601,605,628,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("400x300"),20000, 400,420,484,528,0, 300,300,302,314,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 800x600 @ 72Hz (VESA) hsync: 48.1kHz */
+ {MODEPREFIX("800x600"),50000, 800,856,976,1040,0, 600,637,643,666,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("400x300"),25000, 400,428,488,520,0, 300,318,321,333,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 800x600 @ 75Hz (VESA) hsync: 46.9kHz */
+ {MODEPREFIX("800x600"),49500, 800,816,896,1056,0, 600,601,604,625,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("400x300"),24750, 400,408,448,528,0, 300,300,302,312,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 800x600 @ 85Hz (VESA) hsync: 53.7kHz */
+ {MODEPREFIX("800x600"),56300, 800,832,896,1048,0, 600,601,604,631,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("400x300"),28150, 400,416,448,524,0, 300,300,302,315,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1024x768i @ 43Hz (industry standard) hsync: 35.5kHz */
+ {MODEPREFIX("1024x768"),44900, 1024,1032,1208,1264,0, 768,768,776,817,0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX},
+ {MODEPREFIX("512x384"),22450, 512,516,604,632,0, 384,384,388,408,0, V_PHSYNC | V_PVSYNC | V_INTERLACE | V_DBLSCAN, MODESUFFIX},
+/* 1024x768 @ 60Hz (VESA) hsync: 48.4kHz */
+ {MODEPREFIX("1024x768"),65000, 1024,1048,1184,1344,0, 768,771,777,806,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("512x384"),32500, 512,524,592,672,0, 384,385,388,403,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1024x768 @ 70Hz (VESA) hsync: 56.5kHz */
+ {MODEPREFIX("1024x768"),75000, 1024,1048,1184,1328,0, 768,771,777,806,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("512x384"),37500, 512,524,592,664,0, 384,385,388,403,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1024x768 @ 75Hz (VESA) hsync: 60.0kHz */
+ {MODEPREFIX("1024x768"),78800, 1024,1040,1136,1312,0, 768,769,772,800,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("512x384"),39400, 512,520,568,656,0, 384,384,386,400,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1024x768 @ 85Hz (VESA) hsync: 68.7kHz */
+ {MODEPREFIX("1024x768"),94500, 1024,1072,1168,1376,0, 768,769,772,808,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("512x384"),47250, 512,536,584,688,0, 384,384,386,404,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1152x864 @ 75Hz (VESA) hsync: 67.5kHz */
+ {MODEPREFIX("1152x864"),108000, 1152,1216,1344,1600,0, 864,865,868,900,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("576x432"),54000, 576,608,672,800,0, 432,432,434,450,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1280x960 @ 60Hz (VESA) hsync: 60.0kHz */
+ {MODEPREFIX("1280x960"),108000, 1280,1376,1488,1800,0, 960,961,964,1000,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("640x480"),54000, 640,688,744,900,0, 480,480,482,500,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1280x960 @ 85Hz (VESA) hsync: 85.9kHz */
+ {MODEPREFIX("1280x960"),148500, 1280,1344,1504,1728,0, 960,961,964,1011,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("640x480"),74250, 640,672,752,864,0, 480,480,482,505,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1280x1024 @ 60Hz (VESA) hsync: 64.0kHz */
+ {MODEPREFIX("1280x1024"),108000, 1280,1328,1440,1688,0, 1024,1025,1028,1066,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("640x512"),54000, 640,664,720,844,0, 512,512,514,533,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1280x1024 @ 75Hz (VESA) hsync: 80.0kHz */
+ {MODEPREFIX("1280x1024"),135000, 1280,1296,1440,1688,0, 1024,1025,1028,1066,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("640x512"),67500, 640,648,720,844,0, 512,512,514,533,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1280x1024 @ 85Hz (VESA) hsync: 91.1kHz */
+ {MODEPREFIX("1280x1024"),157500, 1280,1344,1504,1728,0, 1024,1025,1028,1072,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("640x512"),78750, 640,672,752,864,0, 512,512,514,536,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1600x1200 @ 60Hz (VESA) hsync: 75.0kHz */
+ {MODEPREFIX("1600x1200"),162000, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("800x600"),81000, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1600x1200 @ 65Hz (VESA) hsync: 81.3kHz */
+ {MODEPREFIX("1600x1200"),175500, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("800x600"),87750, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1600x1200 @ 70Hz (VESA) hsync: 87.5kHz */
+ {MODEPREFIX("1600x1200"),189000, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("800x600"),94500, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1600x1200 @ 75Hz (VESA) hsync: 93.8kHz */
+ {MODEPREFIX("1600x1200"),202500, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("800x600"),101250, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1600x1200 @ 85Hz (VESA) hsync: 106.3kHz */
+ {MODEPREFIX("1600x1200"),229500, 1600,1664,1856,2160,0, 1200,1201,1204,1250,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("800x600"),114750, 800,832,928,1080,0, 600,600,602,625,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1792x1344 @ 60Hz (VESA) hsync: 83.6kHz */
+ {MODEPREFIX("1792x1344"),204800, 1792,1920,2120,2448,0, 1344,1345,1348,1394,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("896x672"),102400, 896,960,1060,1224,0, 672,672,674,697,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1792x1344 @ 75Hz (VESA) hsync: 106.3kHz */
+ {MODEPREFIX("1792x1344"),261000, 1792,1888,2104,2456,0, 1344,1345,1348,1417,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("896x672"),130500, 896,944,1052,1228,0, 672,672,674,708,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1856x1392 @ 60Hz (VESA) hsync: 86.3kHz */
+ {MODEPREFIX("1856x1392"),218300, 1856,1952,2176,2528,0, 1392,1393,1396,1439,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("928x696"),109150, 928,976,1088,1264,0, 696,696,698,719,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1856x1392 @ 75Hz (VESA) hsync: 112.5kHz */
+ {MODEPREFIX("1856x1392"),288000, 1856,1984,2208,2560,0, 1392,1393,1396,1500,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("928x696"),144000, 928,992,1104,1280,0, 696,696,698,750,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1920x1440 @ 60Hz (VESA) hsync: 90.0kHz */
+ {MODEPREFIX("1920x1440"),234000, 1920,2048,2256,2600,0, 1440,1441,1444,1500,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("960x720"),117000, 960,1024,1128,1300,0, 720,720,722,750,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1920x1440 @ 75Hz (VESA) hsync: 112.5kHz */
+ {MODEPREFIX("1920x1440"),297000, 1920,2064,2288,2640,0, 1440,1441,1444,1500,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("960x720"),148500, 960,1032,1144,1320,0, 720,720,722,750,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 832x624 @ 75Hz (74.55Hz) (fix if the official/Apple spec is different) hsync: 49.725kHz */
+ {MODEPREFIX("832x624"),57284, 832,864,928,1152,0, 624,625,628,667,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("416x312"),28642, 416,432,464,576,0, 312,312,314,333,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1152x768 @ 54.8Hz (Titanium PowerBook) hsync: 44.2kHz */
+ {MODEPREFIX("1152x768"),64995, 1152,1178,1314,1472,0, 768,771,777,806,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("576x384"),32497, 576,589,657,736,0, 384,385,388,403,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1400x1050 @ 60Hz (VESA GTF) hsync: 65.5kHz */
+ {MODEPREFIX("1400x1050"),122000, 1400,1488,1640,1880,0, 1050,1052,1064,1082,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("700x525"),61000, 700,744,820,940,0, 525,526,532,541,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1400x1050 @ 75Hz (VESA GTF) hsync: 82.2kHz */
+ {MODEPREFIX("1400x1050"),155800, 1400,1464,1784,1912,0, 1050,1052,1064,1090,0, V_PHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("700x525"),77900, 700,732,892,956,0, 525,526,532,545,0, V_PHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1600x1024 @ 60Hz (SGI 1600SW) hsync: 64.0kHz */
+ {MODEPREFIX("1600x1024"),106910, 1600,1620,1640,1670,0, 1024,1027,1030,1067,0, V_NHSYNC | V_NVSYNC, MODESUFFIX},
+ {MODEPREFIX("800x512"),53455, 800,810,820,835,0, 512,513,515,533,0, V_NHSYNC | V_NVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 1920x1440 @ 85Hz (VESA GTF) hsync: 128.5kHz */
+ {MODEPREFIX("1920x1440"),341350, 1920,2072,2288,2656,0, 1440,1441,1444,1512,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("960x720"),170675, 960,1036,1144,1328,0, 720,720,722,756,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 2048x1536 @ 60Hz (VESA GTF) hsync: 95.3kHz */
+ {MODEPREFIX("2048x1536"),266950, 2048,2200,2424,2800,0, 1536,1537,1540,1589,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("1024x768"),133475, 1024,1100,1212,1400,0, 768,768,770,794,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 2048x1536 @ 75Hz (VESA GTF) hsync: 120.2kHz */
+ {MODEPREFIX("2048x1536"),340480, 2048,2216,2440,2832,0, 1536,1537,1540,1603,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("1024x768"),170240, 1024,1108,1220,1416,0, 768,768,770,801,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+/* 2048x1536 @ 85Hz (VESA GTF) hsync: 137.0kHz */
+ {MODEPREFIX("2048x1536"),388040, 2048,2216,2440,2832,0, 1536,1537,1540,1612,0, V_NHSYNC | V_PVSYNC, MODESUFFIX},
+ {MODEPREFIX("1024x768"),194020, 1024,1108,1220,1416,0, 768,768,770,806,0, V_NHSYNC | V_PVSYNC | V_DBLSCAN, MODESUFFIX},
+ {MODEPREFIX(NULL),0,0,0,0,0,0,0,0,0,0,0,0,MODESUFFIX}
+};
diff --git a/hw/xfree86/common/xf86DoProbe.c b/hw/xfree86/common/xf86DoProbe.c
new file mode 100644
index 000000000..518f67214
--- /dev/null
+++ b/hw/xfree86/common/xf86DoProbe.c
@@ -0,0 +1,83 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.11 2002/07/02 02:00:03 tsi Exp $ */
+/*
+ * finish setting up the server
+ * Load the driver modules and call their probe functions.
+ *
+ * Copyright 1999 by The XFree86 Project, Inc.
+ *
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include "X.h"
+#include "Xmd.h"
+#include "os.h"
+#ifdef XFree86LOADER
+#include "loaderProcs.h"
+#include "xf86Config.h"
+#endif /* XFree86LOADER */
+#include "xf86.h"
+#include "xf86Priv.h"
+
+void
+DoProbeArgs(int argc, char **argv, int i)
+{
+}
+
+void
+DoProbe()
+{
+ int i;
+ Bool probeResult;
+
+#ifdef XFree86LOADER
+ /* Find the list of video driver modules. */
+ char **list = xf86DriverlistFromCompile();
+ char **l;
+
+ if (list) {
+ ErrorF("List of video driver modules:\n");
+ for (l = list; *l; l++)
+ ErrorF("\t%s\n", *l);
+ } else {
+ ErrorF("No video driver modules found\n");
+ }
+
+ /* Load all the drivers that were found. */
+ xf86LoadModules(list, NULL);
+#endif /* XFree86LOADER */
+
+ /* Disable PCI devices */
+ xf86AccessInit();
+
+ /* Call all of the probe functions, reporting the results. */
+ for (i = 0; i < xf86NumDrivers; i++) {
+ if (xf86DriverList[i]->Probe == NULL) continue;
+
+ xf86MsgVerb(X_INFO, 3, "Probing in driver %s\n",
+ xf86DriverList[i]->driverName);
+ probeResult =
+ (*xf86DriverList[i]->Probe)(xf86DriverList[i], PROBE_DETECT);
+ if (!probeResult) {
+ xf86ErrorF("Probe in driver `%s' returns FALSE\n",
+ xf86DriverList[i]->driverName);
+ } else {
+ xf86ErrorF("Probe in driver `%s' returns TRUE\n",
+ xf86DriverList[i]->driverName);
+
+ /* If we have a result, then call driver's Identify function */
+ if (xf86DriverList[i]->Identify != NULL) {
+ int verbose = xf86Verbose;
+
+ xf86Verbose = 1;
+ (*xf86DriverList[i]->Identify)(0);
+ xf86Verbose = verbose;
+ }
+ }
+ }
+
+ OsCleanup();
+ AbortDDX();
+ fflush(stderr);
+ exit(0);
+}
diff --git a/hw/xfree86/common/xf86DoScanPci.c b/hw/xfree86/common/xf86DoScanPci.c
new file mode 100644
index 000000000..2328d2b05
--- /dev/null
+++ b/hw/xfree86/common/xf86DoScanPci.c
@@ -0,0 +1,97 @@
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.12 2002/07/15 20:46:01 dawes Exp $ */
+/*
+ * Finish setting up the server.
+ * Call the functions from the scanpci module.
+ *
+ * Copyright 1999-2002 by The XFree86 Project, Inc.
+ *
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include "X.h"
+#include "Xmd.h"
+#include "os.h"
+#ifdef XFree86LOADER
+#include "loaderProcs.h"
+#endif
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Pci.h"
+#include "xf86ScanPci.h"
+
+
+void DoScanPci(int argc, char **argv, int i)
+{
+ int j,skip,globalVerbose,scanpciVerbose;
+ ScanPciSetupProcPtr PciSetup;
+ ScanPciDisplayCardInfoProcPtr DisplayPCICardInfo;
+#ifdef XFree86LOADER
+ int errmaj, errmin;
+#endif
+
+ /*
+ * first we need to finish setup of the OS so that we can call other
+ * functions in the server
+ */
+ OsInit();
+
+ /*
+ * now we decrease verbosity and remember the value, in case a later
+ * -verbose on the command line increases it, because that is a
+ * verbose flag for scanpci...
+ */
+ globalVerbose = --xf86Verbose;
+ /*
+ * next we process the arguments that are remaining on the command line,
+ * so that things like the module path can be set there
+ */
+ for ( j = i+1; j < argc; j++ ) {
+ if ((skip = ddxProcessArgument(argc, argv, j)))
+ j += (skip - 1);
+ }
+ /*
+ * was the verbosity level increased?
+ */
+ if( (globalVerbose == 0) && (xf86Verbose > 0) )
+ scanpciVerbose = xf86Verbose - globalVerbose -1;
+ else
+ scanpciVerbose = xf86Verbose - globalVerbose;
+ xf86Verbose = globalVerbose;
+ /*
+ * now get the loader set up and load the scanpci module
+ */
+#ifdef XFree86LOADER
+ /* Initialise the loader */
+ LoaderInit();
+ /* Tell the loader the default module search path */
+ LoaderSetPath(xf86ModulePath);
+
+ if (!LoadModule("scanpci", NULL, NULL, NULL, NULL, NULL,
+ &errmaj, &errmin)) {
+ LoaderErrorMsg(NULL, "scanpci", errmaj, errmin);
+ exit(1);
+ }
+ if (LoaderCheckUnresolved(LD_RESOLV_IFDONE)) {
+ /* For now, just a warning */
+ xf86Msg(X_WARNING, "Some symbols could not be resolved!\n");
+ }
+ PciSetup = (ScanPciSetupProcPtr)LoaderSymbol("ScanPciSetupPciIds");
+ DisplayPCICardInfo =
+ (ScanPciDisplayCardInfoProcPtr)LoaderSymbol("ScanPciDisplayPCICardInfo");
+#else
+ PciSetup = ScanPciSetupPciIds;
+ DisplayPCICardInfo = ScanPciDisplayPCICardInfo;
+#endif
+
+ if (!(*PciSetup)())
+ FatalError("ScanPciSetupPciIds() failed\n");
+ (*DisplayPCICardInfo)(scanpciVerbose);
+
+ /*
+ * That's it; we really should clean things up, but a simple
+ * exit seems to be all we need.
+ */
+ exit(0);
+}
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
new file mode 100644
index 000000000..99c53fb0b
--- /dev/null
+++ b/hw/xfree86/common/xf86Globals.c
@@ -0,0 +1,224 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.40 2003/02/20 04:05:14 dawes Exp $ */
+
+/*
+ * Copyright (c) 1997 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains all the XFree86 global variables.
+ */
+
+#include "X.h"
+#include "os.h"
+#include "windowstr.h"
+#include "propertyst.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Parser.h"
+#include "xf86Xinput.h"
+#include "xf86InPriv.h"
+
+/* Globals that video drivers may access */
+
+int xf86ScreenIndex = -1; /* Index of ScrnInfo in pScreen.devPrivates */
+int xf86CreateRootWindowIndex = -1; /* Index into pScreen.devPrivates */
+ScrnInfoPtr *xf86Screens = NULL; /* List of ScrnInfos */
+int xf86PixmapIndex = 0;
+const unsigned char byte_reversed[256] =
+{
+ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
+ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
+ 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
+ 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
+ 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
+ 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
+ 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
+ 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
+ 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
+ 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
+ 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
+ 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
+ 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
+ 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
+ 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
+ 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
+ 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
+ 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
+ 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
+ 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
+ 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
+ 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
+ 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
+ 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
+ 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
+ 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
+ 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
+ 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
+ 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
+ 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
+ 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
+ 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff,
+};
+
+/* Globals that input drivers may access */
+InputInfoPtr xf86InputDevs = NULL;
+
+
+/* Globals that video drivers may not access */
+
+xf86InfoRec xf86Info = {
+ NULL, /* pKeyboard */
+ NULL, /* kbdProc */
+ NULL, /* kbdEvents */
+ -1, /* consoleFd */
+ -1, /* kbdFd */
+ -1, /* vtno */
+ -1, /* kbdType */
+ -1, /* kbdRate */
+ -1, /* kbdDelay */
+ -1, /* bell_pitch */
+ -1, /* bell_duration */
+ TRUE, /* autoRepeat */
+ 0, /* leds */
+ 0, /* xleds */
+ NULL, /* vtinit */
+ 0, /* scanPrefix */
+ FALSE, /* capsLock */
+ FALSE, /* numLock */
+ FALSE, /* scrollLock */
+ FALSE, /* modeSwitchLock */
+ FALSE, /* composeLock */
+ FALSE, /* vtSysreq */
+ SKWhenNeeded, /* ddxSpecialKeys */
+ FALSE, /* ActionKeyBindingsSet */
+#if defined(SVR4) && defined(i386)
+ FALSE, /* panix106 */
+#endif
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+ 0, /* wskbdType */
+#endif
+ NULL, /* pMouse */
+#ifdef XINPUT
+ NULL, /* mouseLocal */
+#endif
+ -1, /* lastEventTime */
+ FALSE, /* vtRequestsPending */
+ FALSE, /* inputPending */
+ FALSE, /* dontVTSwitch */
+ FALSE, /* dontZap */
+ FALSE, /* dontZoom */
+ FALSE, /* notrapSignals */
+ FALSE, /* caughtSignal */
+ FALSE, /* sharedMonitor */
+ NULL, /* currentScreen */
+#ifdef CSRG_BASED
+ -1, /* screenFd */
+ -1, /* consType */
+#endif
+#ifdef XKB
+ NULL, /* xkbkeymap */
+ NULL, /* xkbkeycodes */
+ NULL, /* xkbtypes */
+ NULL, /* xkbcompat */
+ NULL, /* xkbsymbols */
+ NULL, /* xkbgeometry */
+ FALSE, /* xkbcomponents_specified */
+ NULL, /* xkbrules */
+ NULL, /* xkbmodel */
+ NULL, /* xkblayout */
+ NULL, /* xkbvariant */
+ NULL, /* xkboptions */
+#endif
+ FALSE, /* allowMouseOpenFail */
+ TRUE, /* vidModeEnabled */
+ FALSE, /* vidModeAllowNonLocal */
+ TRUE, /* miscModInDevEnabled */
+ FALSE, /* miscModInDevAllowNonLocal */
+ PCIProbe1, /* pciFlags */
+ Pix24DontCare, /* pixmap24 */
+ X_DEFAULT, /* pix24From */
+#if defined(i386) || defined(__i386__)
+ FALSE, /* pc98 */
+#endif
+ TRUE, /* pmFlag */
+ LogNone, /* syncLog */
+ 0, /* estimateSizesAggressively */
+ FALSE, /* kbdCustomKeycodes */
+ FALSE, /* disableRandR */
+ X_DEFAULT /* randRFrom */
+};
+const char *xf86ConfigFile = NULL;
+const char *xf86InputDeviceList = NULL;
+const char *xf86ModulePath = DEFAULT_MODULE_PATH;
+MessageType xf86ModPathFrom = X_DEFAULT;
+const char *xf86LogFile = DEFAULT_LOGPREFIX;
+MessageType xf86LogFileFrom = X_DEFAULT;
+Bool xf86LogFileWasOpened = FALSE;
+serverLayoutRec xf86ConfigLayout = {NULL, };
+confDRIRec xf86ConfigDRI = {0, };
+XF86ConfigPtr xf86configptr = NULL;
+Bool xf86Resetting = FALSE;
+Bool xf86Initialising = FALSE;
+Bool xf86ProbeFailed = FALSE;
+Bool xf86DoProbe = FALSE;
+Bool xf86DoConfigure = FALSE;
+#ifdef XFree86LOADER
+DriverPtr *xf86DriverList = NULL;
+int xf86NumDrivers = 0;
+InputDriverPtr *xf86InputDriverList = NULL;
+int xf86NumInputDrivers = 0;
+ModuleInfoPtr *xf86ModuleInfoList = NULL;
+int xf86NumModuleInfos = 0;
+#endif
+int xf86NumScreens = 0;
+
+const char *xf86VisualNames[] = {
+ "StaticGray",
+ "GrayScale",
+ "StaticColor",
+ "PseudoColor",
+ "TrueColor",
+ "DirectColor"
+};
+
+/* Parameters set only from the command line */
+char *xf86ServerName = "no-name";
+Bool xf86fpFlag = FALSE;
+Bool xf86coFlag = FALSE;
+Bool xf86sFlag = FALSE;
+Bool xf86bsEnableFlag = FALSE;
+Bool xf86bsDisableFlag = FALSE;
+Bool xf86silkenMouseDisableFlag = FALSE;
+char *xf86LayoutName = NULL;
+char *xf86ScreenName = NULL;
+char *xf86PointerName = NULL;
+char *xf86KeyboardName = NULL;
+Bool xf86ProbeOnly = FALSE;
+int xf86Verbose = DEFAULT_VERBOSE;
+int xf86LogVerbose = DEFAULT_LOG_VERBOSE;
+int xf86FbBpp = -1;
+Pix24Flags xf86Pix24 = Pix24DontCare;
+int xf86Depth = -1;
+rgb xf86Weight = {0, 0, 0};
+Bool xf86FlipPixels = FALSE;
+Gamma xf86Gamma = {0.0, 0.0, 0.0};
+Bool xf86ShowUnresolved = DEFAULT_UNRESOLVED;
+Bool xf86BestRefresh = DEFAULT_BEST_REFRESH;
+Bool xf86AllowMouseOpenFail = FALSE;
+#ifdef XF86VIDMODE
+Bool xf86VidModeDisabled = FALSE;
+Bool xf86VidModeAllowNonLocal = FALSE;
+#endif
+#ifdef XF86MISC
+Bool xf86MiscModInDevDisabled = FALSE;
+Bool xf86MiscModInDevAllowNonLocal = FALSE;
+#endif
+PropertyPtr *xf86RegisteredPropertiesTable = NULL;
+Bool xf86inSuspend = FALSE;
+
+#ifdef DLOPEN_HACK
+/*
+ * This stuff is a hack to allow dlopen() modules to work. It is intended
+ * only to be used when using dlopen() modules for debugging purposes.
+ */
+#endif
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
new file mode 100644
index 000000000..73050eab7
--- /dev/null
+++ b/hw/xfree86/common/xf86Helper.c
@@ -0,0 +1,2994 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.128 2003/02/26 23:45:24 dawes Exp $ */
+
+/*
+ * Copyright (c) 1997-1998 by The XFree86 Project, Inc.
+ *
+ * Authors: Dirk Hohndel <hohndel@XFree86.Org>
+ * David Dawes <dawes@XFree86.Org>
+ *
+ * This file includes the helper functions that the server provides for
+ * different drivers.
+ */
+
+#include "X.h"
+#include "os.h"
+#include "servermd.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "propertyst.h"
+#include "gcstruct.h"
+#include "loaderProcs.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "micmap.h"
+#include "xf86PciInfo.h"
+#include "xf86DDC.h"
+#include "xf86Xinput.h"
+#include "xf86InPriv.h"
+#include "mivalidate.h"
+#include "xf86RAC.h"
+#include "xf86Bus.h"
+#include "xf86Version.h"
+
+/* For xf86GetClocks */
+#if defined(CSRG_BASED) || defined(__GNU__)
+#define HAS_SETPRIORITY
+#include <sys/resource.h>
+#endif
+
+static int xf86ScrnInfoPrivateCount = 0;
+static FILE *logfile = NULL;
+
+
+#ifdef XFree86LOADER
+/* Add a pointer to a new DriverRec to xf86DriverList */
+
+void
+xf86AddDriver(DriverPtr driver, pointer module, int flags)
+{
+ /* Don't add null entries */
+ if (!driver)
+ return;
+
+ if (xf86DriverList == NULL)
+ xf86NumDrivers = 0;
+
+ xf86NumDrivers++;
+ xf86DriverList = xnfrealloc(xf86DriverList,
+ xf86NumDrivers * sizeof(DriverPtr));
+ xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec));
+ *xf86DriverList[xf86NumDrivers - 1] = *driver;
+ xf86DriverList[xf86NumDrivers - 1]->module = module;
+ xf86DriverList[xf86NumDrivers - 1]->refCount = 0;
+}
+
+void
+xf86DeleteDriver(int drvIndex)
+{
+ if (xf86DriverList[drvIndex]
+ && (!xf86DriverHasEntities(xf86DriverList[drvIndex]))) {
+ if (xf86DriverList[drvIndex]->module)
+ UnloadModule(xf86DriverList[drvIndex]->module);
+ xfree(xf86DriverList[drvIndex]);
+ xf86DriverList[drvIndex] = NULL;
+ }
+}
+
+/* Add a pointer to a new InputDriverRec to xf86InputDriverList */
+
+void
+xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags)
+{
+ /* Don't add null entries */
+ if (!driver)
+ return;
+
+ if (xf86InputDriverList == NULL)
+ xf86NumInputDrivers = 0;
+
+ xf86NumInputDrivers++;
+ xf86InputDriverList = xnfrealloc(xf86InputDriverList,
+ xf86NumInputDrivers * sizeof(InputDriverPtr));
+ xf86InputDriverList[xf86NumInputDrivers - 1] =
+ xnfalloc(sizeof(InputDriverRec));
+ *xf86InputDriverList[xf86NumInputDrivers - 1] = *driver;
+ xf86InputDriverList[xf86NumInputDrivers - 1]->module = module;
+ xf86InputDriverList[xf86NumInputDrivers - 1]->refCount = 0;
+}
+
+void
+xf86DeleteInputDriver(int drvIndex)
+{
+ if (xf86InputDriverList[drvIndex] && xf86InputDriverList[drvIndex]->module)
+ UnloadModule(xf86InputDriverList[drvIndex]->module);
+ xfree(xf86InputDriverList[drvIndex]);
+ xf86InputDriverList[drvIndex] = NULL;
+}
+
+void
+xf86AddModuleInfo(ModuleInfoPtr info, pointer module)
+{
+ /* Don't add null entries */
+ if (!module)
+ return;
+
+ if (xf86ModuleInfoList == NULL)
+ xf86NumModuleInfos = 0;
+
+ xf86NumModuleInfos++;
+ xf86ModuleInfoList = xnfrealloc(xf86ModuleInfoList,
+ xf86NumModuleInfos * sizeof(ModuleInfoPtr));
+ xf86ModuleInfoList[xf86NumModuleInfos - 1] = xnfalloc(sizeof(ModuleInfoRec));
+ *xf86ModuleInfoList[xf86NumModuleInfos - 1] = *info;
+ xf86ModuleInfoList[xf86NumModuleInfos - 1]->module = module;
+ xf86ModuleInfoList[xf86NumModuleInfos - 1]->refCount = 0;
+}
+
+void
+xf86DeleteModuleInfo(int idx)
+{
+ if (xf86ModuleInfoList[idx]) {
+ if (xf86ModuleInfoList[idx]->module)
+ UnloadModule(xf86ModuleInfoList[idx]->module);
+ xfree(xf86ModuleInfoList[idx]);
+ xf86ModuleInfoList[idx] = NULL;
+ }
+}
+#endif
+
+
+/* Allocate a new ScrnInfoRec in xf86Screens */
+
+ScrnInfoPtr
+xf86AllocateScreen(DriverPtr drv, int flags)
+{
+ int i;
+
+ if (xf86Screens == NULL)
+ xf86NumScreens = 0;
+
+ i = xf86NumScreens++;
+ xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr));
+ xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1);
+ xf86Screens[i]->scrnIndex = i; /* Changes when a screen is removed */
+ xf86Screens[i]->origIndex = i; /* This never changes */
+ xf86Screens[i]->privates = xnfcalloc(sizeof(DevUnion),
+ xf86ScrnInfoPrivateCount);
+ /*
+ * EnableDisableFBAccess now gets initialized in InitOutput()
+ * xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess;
+ */
+
+ xf86Screens[i]->drv = drv;
+ drv->refCount++;
+#ifdef XFree86LOADER
+ xf86Screens[i]->module = DuplicateModule(drv->module, NULL);
+#else
+ xf86Screens[i]->module = NULL;
+#endif
+ /*
+ * set the initial access state. This will be modified after PreInit.
+ * XXX Or should we do it some other place?
+ */
+ xf86Screens[i]->CurrentAccess = &xf86CurrentAccess;
+ xf86Screens[i]->resourceType = MEM_IO;
+
+#ifdef DEBUG
+ /* OOps -- What's this ? */
+ ErrorF("xf86AllocateScreen - xf86Screens[%d]->pScreen = %p\n",
+ i, xf86Screens[i]->pScreen );
+ if ( NULL != xf86Screens[i]->pScreen ) {
+ ErrorF("xf86Screens[%d]->pScreen->CreateWindow = %p\n",
+ i, xf86Screens[i]->pScreen->CreateWindow );
+ }
+#endif
+
+ return xf86Screens[i];
+}
+
+
+/*
+ * Remove an entry from xf86Screens. Ideally it should free all allocated
+ * data. To do this properly may require a driver hook.
+ */
+
+void
+xf86DeleteScreen(int scrnIndex, int flags)
+{
+ ScrnInfoPtr pScrn;
+ int i;
+
+ /* First check if the screen is valid */
+ if (xf86NumScreens == 0 || xf86Screens == NULL)
+ return;
+
+ if (scrnIndex > xf86NumScreens - 1)
+ return;
+
+ if (!(pScrn = xf86Screens[scrnIndex]))
+ return;
+
+ /* If a FreeScreen function is defined, call it here */
+ if (pScrn->FreeScreen != NULL)
+ pScrn->FreeScreen(scrnIndex, 0);
+
+ while (pScrn->modes)
+ xf86DeleteMode(&pScrn->modes, pScrn->modes);
+
+ while (pScrn->modePool)
+ xf86DeleteMode(&pScrn->modePool, pScrn->modePool);
+
+ xf86OptionListFree(pScrn->options);
+
+#ifdef XFree86LOADER
+ if (pScrn->module)
+ UnloadModule(pScrn->module);
+#endif
+
+ if (pScrn->drv)
+ pScrn->drv->refCount--;
+
+ if (pScrn->privates);
+ xfree(pScrn->privates);
+
+ xf86ClearEntityListForScreen(scrnIndex);
+
+ xfree(pScrn);
+
+ /* Move the other entries down, updating their scrnIndex fields */
+
+ xf86NumScreens--;
+
+ for (i = scrnIndex; i < xf86NumScreens; i++) {
+ xf86Screens[i] = xf86Screens[i + 1];
+ xf86Screens[i]->scrnIndex = i;
+ /* Also need to take care of the screen layout settings */
+ }
+}
+
+/*
+ * Allocate a private in ScrnInfoRec.
+ */
+
+int
+xf86AllocateScrnInfoPrivateIndex(void)
+{
+ int idx, i;
+ ScrnInfoPtr pScr;
+ DevUnion *nprivs;
+
+ idx = xf86ScrnInfoPrivateCount++;
+ for (i = 0; i < xf86NumScreens; i++) {
+ pScr = xf86Screens[i];
+ nprivs = xnfrealloc(pScr->privates,
+ xf86ScrnInfoPrivateCount * sizeof(DevUnion));
+ /* Zero the new private */
+ bzero(&nprivs[idx], sizeof(DevUnion));
+ pScr->privates = nprivs;
+ }
+ return idx;
+}
+
+/* Allocate a new InputInfoRec and add it to the head xf86InputDevs. */
+
+InputInfoPtr
+xf86AllocateInput(InputDriverPtr drv, int flags)
+{
+ InputInfoPtr new;
+
+ if (!(new = xcalloc(sizeof(InputInfoRec), 1)))
+ return NULL;
+
+ new->drv = drv;
+ drv->refCount++;
+#ifdef XFree86LOADER
+ new->module = DuplicateModule(drv->module, NULL);
+#else
+ new->module = NULL;
+#endif
+ new->next = xf86InputDevs;
+ xf86InputDevs = new;
+ return new;
+}
+
+
+/*
+ * Remove an entry from xf86InputDevs. Ideally it should free all allocated
+ * data. To do this properly may require a driver hook.
+ */
+
+void
+xf86DeleteInput(InputInfoPtr pInp, int flags)
+{
+ InputInfoPtr p;
+
+ /* First check if the inputdev is valid. */
+ if (pInp == NULL)
+ return;
+
+#if 0
+ /* If a free function is defined, call it here. */
+ if (pInp->free)
+ pInp->free(pInp, 0);
+#endif
+
+#ifdef XFree86LOADER
+ if (pInp->module)
+ UnloadModule(pInp->module);
+#endif
+
+ if (pInp->drv)
+ pInp->drv->refCount--;
+
+ if (pInp->private);
+ xfree(pInp->private);
+
+ /* Remove the entry from the list. */
+ if (pInp == xf86InputDevs)
+ xf86InputDevs = pInp->next;
+ else {
+ p = xf86InputDevs;
+ while (p && p->next != pInp)
+ p = p->next;
+ if (p)
+ p->next = pInp->next;
+ /* Else the entry wasn't in the xf86InputDevs list (ignore this). */
+ }
+ xfree(pInp);
+}
+
+Bool
+xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
+{
+ int i;
+
+ if (pScrn->numFormats >= MAXFORMATS)
+ return FALSE;
+
+ if (bpp <= 0) {
+ if (depth == 1)
+ bpp = 1;
+ else if (depth <= 8)
+ bpp = 8;
+ else if (depth <= 16)
+ bpp = 16;
+ else if (depth <= 32)
+ bpp = 32;
+ else
+ return FALSE;
+ }
+ if (pad <= 0)
+ pad = BITMAP_SCANLINE_PAD;
+
+ i = pScrn->numFormats++;
+ pScrn->formats[i].depth = depth;
+ pScrn->formats[i].bitsPerPixel = bpp;
+ pScrn->formats[i].scanlinePad = pad;
+ return TRUE;
+}
+
+/*
+ * Set the depth we are using based on (in the following order of preference):
+ * - values given on the command line
+ * - values given in the config file
+ * - values provided by the driver
+ * - an overall default when nothing else is given
+ *
+ * Also find a Display subsection matching the depth/bpp found.
+ *
+ * Sets the following ScrnInfoRec fields:
+ * bitsPerPixel, pixmap24, depth, display, imageByteOrder,
+ * bitmapScanlinePad, bitmapScanlineUnit, bitmapBitOrder, numFormats,
+ * formats, fbFormat.
+ */
+
+/* Can the screen handle 24 bpp pixmaps */
+#define DO_PIX24(f) ((f & Support24bppFb) || \
+ ((f & Support32bppFb) && (f & SupportConvert24to32)))
+
+/* Can the screen handle 32 bpp pixmaps */
+#define DO_PIX32(f) ((f & Support32bppFb) || \
+ ((f & Support24bppFb) && (f & SupportConvert32to24)))
+
+/* Does the screen prefer 32bpp fb for 24bpp pixmaps */
+#define CHOOSE32FOR24(f) ((f & Support32bppFb) && (f & SupportConvert24to32) \
+ && (f & PreferConvert24to32))
+
+/* Does the screen prefer 24bpp fb for 32bpp pixmaps */
+#define CHOOSE24FOR32(f) ((f & Support24bppFb) && (f & SupportConvert32to24) \
+ && (f & PreferConvert32to24))
+
+/* Can the screen handle 32bpp pixmaps for 24bpp fb */
+#define DO_PIX32FOR24(f) ((f & Support24bppFb) && (f & SupportConvert32to24))
+
+/* Can the screen handle 24bpp pixmaps for 32bpp fb */
+#define DO_PIX24FOR32(f) ((f & Support32bppFb) && (f & SupportConvert24to32))
+
+Bool
+xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
+ int depth24flags)
+{
+ int i;
+ DispPtr disp;
+ Pix24Flags pix24 = xf86Info.pixmap24;
+ Bool nomatch = FALSE;
+
+ scrp->bitsPerPixel = -1;
+ scrp->depth = -1;
+ scrp->pixmap24 = Pix24DontCare;
+ scrp->bitsPerPixelFrom = X_DEFAULT;
+ scrp->depthFrom = X_DEFAULT;
+
+#if BITMAP_SCANLINE_UNIT == 64
+ /*
+ * For platforms with 64-bit scanlines, modify the driver's depth24flags
+ * to remove preferences for packed 24bpp modes, which are not currently
+ * supported on these platforms.
+ */
+ depth24flags &= ~(SupportConvert32to24 | SupportConvert32to24 |
+ PreferConvert24to32 | PreferConvert32to24);
+#endif
+
+ if (xf86FbBpp > 0) {
+ scrp->bitsPerPixel = xf86FbBpp;
+ scrp->bitsPerPixelFrom = X_CMDLINE;
+ }
+
+ if (xf86Depth > 0) {
+ scrp->depth = xf86Depth;
+ scrp->depthFrom = X_CMDLINE;
+ }
+
+ if (xf86FbBpp < 0 && xf86Depth < 0) {
+ if (scrp->confScreen->defaultfbbpp > 0) {
+ scrp->bitsPerPixel = scrp->confScreen->defaultfbbpp;
+ scrp->bitsPerPixelFrom = X_CONFIG;
+ }
+ if (scrp->confScreen->defaultdepth > 0) {
+ scrp->depth = scrp->confScreen->defaultdepth;
+ scrp->depthFrom = X_CONFIG;
+ }
+ }
+
+ /* If none of these is set, pick a default */
+ if (scrp->bitsPerPixel < 0 && scrp->depth < 0) {
+ if (fbbpp > 0 || depth > 0) {
+ if (fbbpp > 0)
+ scrp->bitsPerPixel = fbbpp;
+ if (depth > 0)
+ scrp->depth = depth;
+ } else {
+ scrp->bitsPerPixel = 8;
+ scrp->depth = 8;
+ }
+ }
+
+ /* If any are not given, determine a default for the others */
+
+ if (scrp->bitsPerPixel < 0) {
+ /* The depth must be set */
+ if (scrp->depth > -1) {
+ if (scrp->depth == 1)
+ scrp->bitsPerPixel = 1;
+ else if (scrp->depth <= 4)
+ scrp->bitsPerPixel = 4;
+ else if (scrp->depth <= 8)
+ scrp->bitsPerPixel = 8;
+ else if (scrp->depth <= 16)
+ scrp->bitsPerPixel = 16;
+ else if (scrp->depth <= 24) {
+ /*
+ * Figure out if a choice is possible based on the depth24
+ * and pix24 flags.
+ */
+ /* Check pix24 first */
+ if (pix24 != Pix24DontCare) {
+ if (pix24 == Pix24Use32) {
+ if (DO_PIX32(depth24flags)) {
+ if (CHOOSE24FOR32(depth24flags))
+ scrp->bitsPerPixel = 24;
+ else
+ scrp->bitsPerPixel = 32;
+ } else {
+ nomatch = TRUE;
+ }
+ } else if (pix24 == Pix24Use24) {
+ if (DO_PIX24(depth24flags)) {
+ if (CHOOSE32FOR24(depth24flags))
+ scrp->bitsPerPixel = 32;
+ else
+ scrp->bitsPerPixel = 24;
+ } else {
+ nomatch = TRUE;
+ }
+ }
+ } else {
+ if (DO_PIX32(depth24flags)) {
+ if (CHOOSE24FOR32(depth24flags))
+ scrp->bitsPerPixel = 24;
+ else
+ scrp->bitsPerPixel = 32;
+ } else if (DO_PIX24(depth24flags)) {
+ if (CHOOSE32FOR24(depth24flags))
+ scrp->bitsPerPixel = 32;
+ else
+ scrp->bitsPerPixel = 24;
+ }
+ }
+ } else if (scrp->depth <= 32)
+ scrp->bitsPerPixel = 32;
+ else {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Specified depth (%d) is greater than 32\n",
+ scrp->depth);
+ return FALSE;
+ }
+ } else {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "xf86SetDepthBpp: internal error: depth and fbbpp"
+ " are both not set\n");
+ return FALSE;
+ }
+ if (scrp->bitsPerPixel < 0) {
+ if (nomatch)
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Driver can't support depth 24 pixmap format (%d)\n",
+ PIX24TOBPP(pix24));
+ else if ((depth24flags & (Support24bppFb | Support32bppFb)) ==
+ NoDepth24Support)
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Driver can't support depth 24\n");
+ else
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Can't find fbbpp for depth 24\n");
+ return FALSE;
+ }
+ scrp->bitsPerPixelFrom = X_PROBED;
+ }
+
+ if (scrp->depth <= 0) {
+ /* bitsPerPixel is already set */
+ switch (scrp->bitsPerPixel) {
+ case 32:
+ scrp->depth = 24;
+ break;
+ default:
+ /* 1, 4, 8, 16 and 24 */
+ scrp->depth = scrp->bitsPerPixel;
+ break;
+ }
+ scrp->depthFrom = X_PROBED;
+ }
+
+ /* Sanity checks */
+ if (scrp->depth < 1 || scrp->depth > 32) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Specified depth (%d) is not in the range 1-32\n",
+ scrp->depth);
+ return FALSE;
+ }
+ switch (scrp->bitsPerPixel) {
+ case 1:
+ case 4:
+ case 8:
+ case 16:
+ case 24:
+ case 32:
+ break;
+ default:
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Specified fbbpp (%d) is not a permitted value\n",
+ scrp->bitsPerPixel);
+ return FALSE;
+ }
+ if (scrp->depth > scrp->bitsPerPixel) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Specified depth (%d) is greater than the fbbpp (%d)\n",
+ scrp->depth, scrp->bitsPerPixel);
+ return FALSE;
+ }
+
+ /* set scrp->pixmap24 if the driver isn't flexible */
+ if (scrp->bitsPerPixel == 24 && !DO_PIX32FOR24(depth24flags)) {
+ scrp->pixmap24 = Pix24Use24;
+ }
+ if (scrp->bitsPerPixel == 32 && !DO_PIX24FOR32(depth24flags)) {
+ scrp->pixmap24 = Pix24Use32;
+ }
+
+ /*
+ * Find the Display subsection matching the depth/fbbpp and initialise
+ * scrp->display with it.
+ */
+ for (i = 0, disp = scrp->confScreen->displays;
+ i < scrp->confScreen->numdisplays; i++, disp++) {
+ if ((disp->depth == scrp->depth && disp->fbbpp == scrp->bitsPerPixel)
+ || (disp->depth == scrp->depth && disp->fbbpp <= 0)
+ || (disp->fbbpp == scrp->bitsPerPixel && disp->depth <= 0)) {
+ scrp->display = disp;
+ break;
+ }
+ }
+ if (i == scrp->confScreen->numdisplays) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR, "No Display subsection "
+ "in Screen section \"%s\" for depth/fbbpp %d/%d\n",
+ scrp->confScreen->id, scrp->depth, scrp->bitsPerPixel);
+ return FALSE;
+ }
+
+ /*
+ * Setup defaults for the display-wide attributes the framebuffer will
+ * need. These defaults should eventually be set globally, and not
+ * dependent on the screens.
+ */
+ scrp->imageByteOrder = IMAGE_BYTE_ORDER;
+ scrp->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ if (scrp->depth < 8) {
+ /* Planar modes need these settings */
+ scrp->bitmapScanlineUnit = 8;
+ scrp->bitmapBitOrder = MSBFirst;
+ } else {
+ scrp->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ scrp->bitmapBitOrder = BITMAP_BIT_ORDER;
+ }
+
+ /*
+ * If an unusual depth is required, add it to scrp->formats. The formats
+ * for the common depths are handled globally in InitOutput
+ */
+ switch (scrp->depth) {
+ case 1:
+ case 4:
+ case 8:
+ case 15:
+ case 16:
+ case 24:
+ /* Common depths. Nothing to do for them */
+ break;
+ default:
+ if (!xf86AddPixFormat(scrp, scrp->depth, 0, 0)) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Can't add pixmap format for depth %d\n", scrp->depth);
+ return FALSE;
+ }
+ }
+
+ /* Initialise the framebuffer format for this screen */
+ scrp->fbFormat.depth = scrp->depth;
+ scrp->fbFormat.bitsPerPixel = scrp->bitsPerPixel;
+ scrp->fbFormat.scanlinePad = BITMAP_SCANLINE_PAD;
+
+ return TRUE;
+}
+
+/*
+ * Print out the selected depth and bpp.
+ */
+void
+xf86PrintDepthBpp(ScrnInfoPtr scrp)
+{
+ xf86DrvMsg(scrp->scrnIndex, scrp->depthFrom, "Depth %d, ", scrp->depth);
+ xf86Msg(scrp->bitsPerPixelFrom, "framebuffer bpp %d\n", scrp->bitsPerPixel);
+}
+
+/*
+ * xf86SetWeight sets scrp->weight, scrp->mask, scrp->offset, and for depths
+ * greater than MAX_PSEUDO_DEPTH also scrp->rgbBits.
+ */
+Bool
+xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)
+{
+ MessageType weightFrom = X_DEFAULT;
+
+ scrp->weight.red = 0;
+ scrp->weight.green = 0;
+ scrp->weight.blue = 0;
+
+ if (xf86Weight.red > 0 && xf86Weight.green > 0 && xf86Weight.blue > 0) {
+ scrp->weight = xf86Weight;
+ weightFrom = X_CMDLINE;
+ } else if (scrp->display->weight.red > 0 && scrp->display->weight.green > 0
+ && scrp->display->weight.blue > 0) {
+ scrp->weight = scrp->display->weight;
+ weightFrom = X_CONFIG;
+ } else if (weight.red > 0 && weight.green > 0 && weight.blue > 0) {
+ scrp->weight = weight;
+ } else {
+ switch (scrp->depth) {
+ case 1:
+ case 4:
+ case 8:
+ scrp->weight.red = scrp->weight.green =
+ scrp->weight.blue = scrp->rgbBits;
+ break;
+ case 15:
+ scrp->weight.red = scrp->weight.green = scrp->weight.blue = 5;
+ break;
+ case 16:
+ scrp->weight.red = scrp->weight.blue = 5;
+ scrp->weight.green = 6;
+ break;
+ case 24:
+ scrp->weight.red = scrp->weight.green = scrp->weight.blue = 8;
+ break;
+ case 30:
+ scrp->weight.red = scrp->weight.green = scrp->weight.blue = 10;
+ break;
+ }
+ }
+
+ if (scrp->weight.red)
+ xf86DrvMsg(scrp->scrnIndex, weightFrom, "RGB weight %d%d%d\n",
+ scrp->weight.red, scrp->weight.green, scrp->weight.blue);
+
+ if (scrp->depth > MAX_PSEUDO_DEPTH &&
+ (scrp->depth != scrp->weight.red + scrp->weight.green +
+ scrp->weight.blue)) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Weight given (%d%d%d) is inconsistent with the "
+ "depth (%d)\n", scrp->weight.red, scrp->weight.green,
+ scrp->weight.blue, scrp->depth);
+ return FALSE;
+ }
+ if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->weight.red) {
+ /*
+ * XXX Does this even mean anything for TrueColor visuals?
+ * If not, we shouldn't even be setting it here. However, this
+ * matches the behaviour of 3.x versions of XFree86.
+ */
+ scrp->rgbBits = scrp->weight.red;
+ if (scrp->weight.green > scrp->rgbBits)
+ scrp->rgbBits = scrp->weight.green;
+ if (scrp->weight.blue > scrp->rgbBits)
+ scrp->rgbBits = scrp->weight.blue;
+ }
+
+ /* Set the mask and offsets */
+ if (mask.red == 0 || mask.green == 0 || mask.blue == 0) {
+ /* Default to a setting common to PC hardware */
+ scrp->offset.red = scrp->weight.green + scrp->weight.blue;
+ scrp->offset.green = scrp->weight.blue;
+ scrp->offset.blue = 0;
+ scrp->mask.red = ((1 << scrp->weight.red) - 1) << scrp->offset.red;
+ scrp->mask.green = ((1 << scrp->weight.green) - 1)
+ << scrp->offset.green;
+ scrp->mask.blue = (1 << scrp->weight.blue) - 1;
+ } else {
+ /* Initialise to the values passed */
+ scrp->mask.red = mask.red;
+ scrp->mask.green = mask.green;
+ scrp->mask.blue = mask.blue;
+ scrp->offset.red = ffs(mask.red);
+ scrp->offset.green = ffs(mask.green);
+ scrp->offset.blue = ffs(mask.blue);
+ }
+ return TRUE;
+}
+
+Bool
+xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual)
+{
+ MessageType visualFrom = X_DEFAULT;
+ Bool bad = FALSE;
+
+ if (defaultColorVisualClass >= 0) {
+ scrp->defaultVisual = defaultColorVisualClass;
+ visualFrom = X_CMDLINE;
+ } else if (scrp->display->defaultVisual >= 0) {
+ scrp->defaultVisual = scrp->display->defaultVisual;
+ visualFrom = X_CONFIG;
+ } else if (visual >= 0) {
+ scrp->defaultVisual = visual;
+ } else {
+ if (scrp->depth == 1)
+ scrp->defaultVisual = StaticGray;
+ else if (scrp->depth == 4)
+ scrp->defaultVisual = StaticColor;
+ else if (scrp->depth <= MAX_PSEUDO_DEPTH)
+ scrp->defaultVisual = PseudoColor;
+ else
+ scrp->defaultVisual = TrueColor;
+ }
+ switch (scrp->defaultVisual) {
+ case StaticGray:
+ case GrayScale:
+ case StaticColor:
+ case PseudoColor:
+ case TrueColor:
+ case DirectColor:
+ xf86DrvMsg(scrp->scrnIndex, visualFrom, "Default visual is %s\n",
+ xf86VisualNames[scrp->defaultVisual]);
+ /* Check if the visual is valid for the depth */
+ if (scrp->depth == 1 && scrp->defaultVisual != StaticGray)
+ bad = TRUE;
+#if 0
+ else if (scrp->depth == 4 &&
+ (scrp->defaultVisual == TrueColor ||
+ scrp->defaultVisual == DirectColor))
+ bad = TRUE;
+#endif
+ else if (scrp->depth > MAX_PSEUDO_DEPTH &&
+ scrp->defaultVisual != TrueColor &&
+ scrp->defaultVisual != DirectColor)
+ bad = TRUE;
+ if (bad) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR, "Selected default "
+ "visual (%s) is not valid for depth %d\n",
+ xf86VisualNames[scrp->defaultVisual], scrp->depth);
+ return FALSE;
+ } else
+ return TRUE;
+ default:
+
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Invalid default visual class (%d)\n", scrp->defaultVisual);
+ return FALSE;
+ }
+}
+
+#define TEST_GAMMA(g) \
+ (g).red > GAMMA_ZERO || (g).green > GAMMA_ZERO || (g).blue > GAMMA_ZERO
+
+#define SET_GAMMA(g) \
+ (g) > GAMMA_ZERO ? (g) : 1.0
+
+Bool
+xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
+{
+ MessageType from = X_DEFAULT;
+#if 0
+ xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
+#endif
+ if (TEST_GAMMA(xf86Gamma)) {
+ from = X_CMDLINE;
+ scrp->gamma.red = SET_GAMMA(xf86Gamma.red);
+ scrp->gamma.green = SET_GAMMA(xf86Gamma.green);
+ scrp->gamma.blue = SET_GAMMA(xf86Gamma.blue);
+ } else if (TEST_GAMMA(scrp->monitor->gamma)) {
+ from = X_CONFIG;
+ scrp->gamma.red = SET_GAMMA(scrp->monitor->gamma.red);
+ scrp->gamma.green = SET_GAMMA(scrp->monitor->gamma.green);
+ scrp->gamma.blue = SET_GAMMA(scrp->monitor->gamma.blue);
+#if 0
+ } else if ( DDC && DDC->features.gamma > GAMMA_ZERO ) {
+ from = X_PROBED;
+ scrp->gamma.red = SET_GAMMA(DDC->features.gamma);
+ scrp->gamma.green = SET_GAMMA(DDC->features.gamma);
+ scrp->gamma.blue = SET_GAMMA(DDC->features.gamma);
+ /* EDID structure version 2 gives optional seperate red, green & blue gamma values
+ * in bytes 0x57-0x59 */
+#endif
+ } else if (TEST_GAMMA(gamma)) {
+ scrp->gamma.red = SET_GAMMA(gamma.red);
+ scrp->gamma.green = SET_GAMMA(gamma.green);
+ scrp->gamma.blue = SET_GAMMA(gamma.blue);
+ } else {
+ scrp->gamma.red = 1.0;
+ scrp->gamma.green = 1.0;
+ scrp->gamma.blue = 1.0;
+ }
+ xf86DrvMsg(scrp->scrnIndex, from,
+ "Using gamma correction (%.1f, %.1f, %.1f)\n",
+ scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue);
+
+ return TRUE;
+}
+
+#undef TEST_GAMMA
+#undef SET_GAMMA
+
+
+/*
+ * Set the DPI from the command line option. XXX should allow it to be
+ * calculated from the widthmm/heightmm values.
+ */
+
+#undef MMPERINCH
+#define MMPERINCH 25.4
+
+void
+xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
+{
+ MessageType from = X_DEFAULT;
+ xf86MonPtr DDC = (xf86MonPtr)(pScrn->monitor->DDC);
+ int ddcWidthmm, ddcHeightmm;
+ int widthErr, heightErr;
+
+ /* XXX Maybe there is no need for widthmm/heightmm in ScrnInfoRec */
+ pScrn->widthmm = pScrn->monitor->widthmm;
+ pScrn->heightmm = pScrn->monitor->heightmm;
+
+ if (DDC && (DDC->features.hsize > 0 && DDC->features.vsize > 0) ) {
+ /* DDC gives display size in mm for individual modes,
+ * but cm for monitor
+ */
+ ddcWidthmm = DDC->features.hsize * 10; /* 10mm in 1cm */
+ ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */
+ } else {
+ ddcWidthmm = ddcHeightmm = 0;
+ }
+
+ if (monitorResolution > 0) {
+ pScrn->xDpi = monitorResolution;
+ pScrn->yDpi = monitorResolution;
+ from = X_CMDLINE;
+ } else if (pScrn->widthmm > 0 || pScrn->heightmm > 0) {
+ from = X_CONFIG;
+ if (pScrn->widthmm > 0) {
+ pScrn->xDpi =
+ (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ }
+ if (pScrn->heightmm > 0) {
+ pScrn->yDpi =
+ (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ }
+ if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
+ pScrn->yDpi = pScrn->xDpi;
+ if (pScrn->yDpi > 0 && pScrn->xDpi <= 0)
+ pScrn->xDpi = pScrn->yDpi;
+ xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n",
+ pScrn->widthmm, pScrn->heightmm);
+
+ /* Warn if config and probe disagree about display size */
+ if ( ddcWidthmm && ddcHeightmm ) {
+ if (pScrn->widthmm > 0) {
+ widthErr = abs(ddcWidthmm - pScrn->widthmm);
+ } else {
+ widthErr = 0;
+ }
+ if (pScrn->heightmm > 0) {
+ heightErr = abs(ddcHeightmm - pScrn->heightmm);
+ } else {
+ heightErr = 0;
+ }
+ if (widthErr>10 || heightErr>10) {
+ /* Should include config file name for monitor here */
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n",
+ ddcWidthmm,ddcHeightmm, pScrn->widthmm,pScrn->heightmm);
+ }
+ }
+ } else if ( ddcWidthmm && ddcHeightmm ) {
+ from = X_PROBED;
+ xf86DrvMsg(pScrn->scrnIndex, from, "Display dimensions: (%d, %d) mm\n",
+ ddcWidthmm, ddcHeightmm );
+ pScrn->widthmm = ddcWidthmm;
+ pScrn->heightmm = ddcHeightmm;
+ if (pScrn->widthmm > 0) {
+ pScrn->xDpi =
+ (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
+ }
+ if (pScrn->heightmm > 0) {
+ pScrn->yDpi =
+ (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
+ }
+ if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
+ pScrn->yDpi = pScrn->xDpi;
+ if (pScrn->yDpi > 0 && pScrn->xDpi <= 0)
+ pScrn->xDpi = pScrn->yDpi;
+ } else {
+ if (x > 0)
+ pScrn->xDpi = x;
+ else
+ pScrn->xDpi = DEFAULT_DPI;
+ if (y > 0)
+ pScrn->yDpi = y;
+ else
+ pScrn->yDpi = DEFAULT_DPI;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, from, "DPI set to (%d, %d)\n",
+ pScrn->xDpi, pScrn->yDpi);
+}
+
+#undef MMPERINCH
+
+
+void
+xf86SetBlackWhitePixels(ScreenPtr pScreen)
+{
+ if (xf86FlipPixels) {
+ pScreen->whitePixel = 0;
+ pScreen->blackPixel = 1;
+ } else {
+ pScreen->whitePixel = 1;
+ pScreen->blackPixel = 0;
+ }
+}
+
+/*
+ * xf86SetRootClip --
+ * Enable or disable rendering to the screen by
+ * setting the root clip list and revalidating
+ * all of the windows
+ */
+
+static void
+xf86SetRootClip (ScreenPtr pScreen, Bool enable)
+{
+ WindowPtr pWin = WindowTable[pScreen->myNum];
+ WindowPtr pChild;
+ Bool WasViewable = (Bool)(pWin->viewable);
+ Bool anyMarked = FALSE;
+ RegionPtr pOldClip = NULL, bsExposed;
+#ifdef DO_SAVE_UNDERS
+ Bool dosave = FALSE;
+#endif
+ WindowPtr pLayerWin;
+ BoxRec box;
+
+ if (WasViewable)
+ {
+ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
+ {
+ (void) (*pScreen->MarkOverlappedWindows)(pChild,
+ pChild,
+ &pLayerWin);
+ }
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ if (pWin->valdata)
+ {
+ if (HasBorder (pWin))
+ {
+ RegionPtr borderVisible;
+
+ borderVisible = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_SUBTRACT(pScreen, borderVisible,
+ &pWin->borderClip, &pWin->winSize);
+ pWin->valdata->before.borderVisible = borderVisible;
+ }
+ pWin->valdata->before.resized = TRUE;
+ }
+ }
+
+ /*
+ * Use REGION_BREAK to avoid optimizations in ValidateTree
+ * that assume the root borderClip can't change well, normally
+ * it doesn't...)
+ */
+ if (enable)
+ {
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pScreen->width;
+ box.y2 = pScreen->height;
+ REGION_INIT (pScreen, &pWin->winSize, &box, 1);
+ REGION_INIT (pScreen, &pWin->borderSize, &box, 1);
+ if (WasViewable)
+ REGION_RESET(pScreen, &pWin->borderClip, &box);
+ pWin->drawable.width = pScreen->width;
+ pWin->drawable.height = pScreen->height;
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+ else
+ {
+ REGION_EMPTY(pScreen, &pWin->borderClip);
+ REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ }
+
+ ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
+
+ if (WasViewable)
+ {
+ if (pWin->backStorage)
+ {
+ pOldClip = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_COPY(pScreen, pOldClip, &pWin->clipList);
+ }
+
+ if (pWin->firstChild)
+ {
+ anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin->firstChild,
+ pWin->firstChild,
+ (WindowPtr *)NULL);
+ }
+ else
+ {
+ (*pScreen->MarkWindow) (pWin);
+ anyMarked = TRUE;
+ }
+
+#ifdef DO_SAVE_UNDERS
+ if (DO_SAVE_UNDERS(pWin))
+ {
+ dosave = (*pScreen->ChangeSaveUnder)(pLayerWin, pLayerWin);
+ }
+#endif /* DO_SAVE_UNDERS */
+
+ if (anyMarked)
+ (*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
+ }
+
+ if (pWin->backStorage &&
+ ((pWin->backingStore == Always) || WasViewable))
+ {
+ if (!WasViewable)
+ pOldClip = &pWin->clipList; /* a convenient empty region */
+ bsExposed = (*pScreen->TranslateBackingStore)
+ (pWin, 0, 0, pOldClip,
+ pWin->drawable.x, pWin->drawable.y);
+ if (WasViewable)
+ REGION_DESTROY(pScreen, pOldClip);
+ if (bsExposed)
+ {
+ RegionPtr valExposed = NullRegion;
+
+ if (pWin->valdata)
+ valExposed = &pWin->valdata->after.exposed;
+ (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
+ if (valExposed)
+ REGION_EMPTY(pScreen, valExposed);
+ REGION_DESTROY(pScreen, bsExposed);
+ }
+ }
+ if (WasViewable)
+ {
+ if (anyMarked)
+ (*pScreen->HandleExposures)(pWin);
+#ifdef DO_SAVE_UNDERS
+ if (dosave)
+ (*pScreen->PostChangeSaveUnder)(pLayerWin, pLayerWin);
+#endif /* DO_SAVE_UNDERS */
+ if (anyMarked && pScreen->PostValidateTree)
+ (*pScreen->PostValidateTree)(pWin, NullWindow, VTOther);
+ }
+ if (pWin->realized)
+ WindowsRestructured ();
+ FlushAllOutput ();
+}
+
+/*
+ * Function to enable/disable access to the frame buffer
+ *
+ * This is used when VT switching and when entering/leaving DGA direct mode.
+ *
+ * This has been rewritten again to eliminate the saved pixmap. The
+ * devPrivate field in the screen pixmap is set to NULL to catch code
+ * accidentally referencing the frame buffer while the X server is not
+ * supposed to touch it.
+ *
+ * Here, we exchange the pixmap private data, rather than the pixmaps
+ * themselves to avoid having to find and change any references to the screen
+ * pixmap such as GC's, window privates etc. This also means that this code
+ * does not need to know exactly how the pixmap pixels are accessed. Further,
+ * this exchange is >not< done through the screen's ModifyPixmapHeader()
+ * vector. This means the called frame buffer code layers can determine
+ * whether they are switched in or out by keeping track of the root pixmap's
+ * private data, and therefore don't need to access pScrnInfo->vtSema.
+ */
+void
+xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
+{
+ ScrnInfoPtr pScrnInfo = xf86Screens[scrnIndex];
+ ScreenPtr pScreen = pScrnInfo->pScreen;
+ PixmapPtr pspix;
+
+ pspix = (*pScreen->GetScreenPixmap) (pScreen);
+ if (enable)
+ {
+ /*
+ * Restore the screen pixmap devPrivate field
+ */
+ pspix->devPrivate = pScrnInfo->pixmapPrivate;
+ /*
+ * Restore all of the clip lists on the screen
+ */
+ if (!xf86Resetting)
+ xf86SetRootClip (pScreen, TRUE);
+
+ }
+ else
+ {
+ /*
+ * Empty all of the clip lists on the screen
+ */
+ xf86SetRootClip (pScreen, FALSE);
+ /*
+ * save the screen pixmap devPrivate field and
+ * replace it with NULL so accidental references
+ * to the frame buffer are caught
+ */
+ pScrnInfo->pixmapPrivate = pspix->devPrivate;
+ pspix->devPrivate.ptr = NULL;
+ }
+}
+
+/* Buffer to hold log data written before the log file is opened */
+static char *saveBuffer = NULL;
+static int size = 0, unused = 0, pos = 0;
+
+/* These functions do the actual writes. */
+static void
+VWrite(int verb, const char *f, va_list args)
+{
+ static char buffer[1024];
+ int len = 0;
+
+ /*
+ * Since a va_list can only be processed once, write the string to a
+ * buffer, and then write the buffer out to the appropriate output
+ * stream(s).
+ */
+ if (verb < 0 || xf86LogVerbose >= verb || xf86Verbose >= verb) {
+ vsnprintf(buffer, sizeof(buffer), f, args);
+ len = strlen(buffer);
+ }
+ if ((verb < 0 || xf86Verbose >= verb) && len > 0)
+ fwrite(buffer, len, 1, stderr);
+ if ((verb < 0 || xf86LogVerbose >= verb) && len > 0) {
+ if (logfile) {
+ fwrite(buffer, len, 1, logfile);
+ if (xf86Info.log) {
+ fflush(logfile);
+ if (xf86Info.log == LogSync)
+ fsync(fileno(logfile));
+ }
+ } else {
+ /*
+ * Note, this code is used before OsInit() has been called, so
+ * xalloc and friends can't be used.
+ */
+ if (len > unused) {
+ size += 1024;
+ unused += 1024;
+ saveBuffer = realloc(saveBuffer, size);
+ if (!saveBuffer)
+ FatalError("realloc() failed while saving log messages\n");
+ }
+ unused -= len;
+ memcpy(saveBuffer + pos, buffer, len);
+ pos += len;
+ }
+ }
+}
+
+static void
+Write(int verb, const char *f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ VWrite(verb, f, args);
+ va_end(args);
+}
+
+/* Print driver messages in the standard format */
+
+void
+xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
+ va_list args)
+{
+ char *s = X_UNKNOWN_STRING;
+
+ /* Ignore verbosity for X_ERROR */
+ if (xf86Verbose >= verb || xf86LogVerbose >= verb || type == X_ERROR) {
+ switch (type) {
+ case X_PROBED:
+ s = X_PROBE_STRING;
+ break;
+ case X_CONFIG:
+ s = X_CONFIG_STRING;
+ break;
+ case X_DEFAULT:
+ s = X_DEFAULT_STRING;
+ break;
+ case X_CMDLINE:
+ s = X_CMDLINE_STRING;
+ break;
+ case X_NOTICE:
+ s = X_NOTICE_STRING;
+ break;
+ case X_ERROR:
+ s = X_ERROR_STRING;
+ if (verb > 0)
+ verb = 0;
+ break;
+ case X_WARNING:
+ s = X_WARNING_STRING;
+ break;
+ case X_INFO:
+ s = X_INFO_STRING;
+ break;
+ case X_NOT_IMPLEMENTED:
+ s = X_NOT_IMPLEMENTED_STRING;
+ break;
+ case X_NONE:
+ s = NULL;
+ break;
+ }
+
+ if (s != NULL)
+ Write(verb, "%s ", s);
+ if (scrnIndex >= 0 && scrnIndex < xf86NumScreens)
+ Write(verb, "%s(%d): ", xf86Screens[scrnIndex]->name, scrnIndex);
+ VWrite(verb, format, args);
+#if 0
+ if (type == X_ERROR && xf86Verbose < xf86LogVerbose) {
+ fprintf(stderr, X_ERROR_STRING " Please check the log file \"%s\""
+ " >before<\n\treporting a problem.\n", xf86LogFile);
+ }
+#endif
+ }
+}
+
+/* Print driver messages, with verbose level specified directly */
+void
+xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
+ ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VDrvMsgVerb(scrnIndex, type, verb, format, ap);
+ va_end(ap);
+}
+
+/* Print driver messages, with verbose level of 1 (default) */
+void
+xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VDrvMsgVerb(scrnIndex, type, 1, format, ap);
+ va_end(ap);
+}
+
+/* Print non-driver messages with verbose level specified directly */
+void
+xf86MsgVerb(MessageType type, int verb, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VDrvMsgVerb(-1, type, verb, format, ap);
+ va_end(ap);
+}
+
+/* Print non-driver messages with verbose level of 1 (default) */
+void
+xf86Msg(MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VDrvMsgVerb(-1, type, 1, format, ap);
+ va_end(ap);
+}
+
+/* Just like ErrorF, but with the verbose level checked */
+void
+xf86ErrorFVerb(int verb, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ if (xf86Verbose >= verb || xf86LogVerbose >= verb)
+ VWrite(verb, format, ap);
+ va_end(ap);
+}
+
+/* Like xf86ErrorFVerb, but with an implied verbose level of 1 */
+void
+xf86ErrorF(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ if (xf86Verbose >= 1 || xf86LogVerbose >= 1)
+ VWrite(1, format, ap);
+ va_end(ap);
+}
+
+void
+OsVendorVErrorF(const char *f, va_list args)
+{
+ VWrite(-1, f, args);
+}
+
+void
+xf86LogInit()
+{
+ char *lf;
+
+#define LOGSUFFIX ".log"
+#define LOGOLDSUFFIX ".old"
+
+ /* Get the log file name */
+ if (xf86LogFileFrom == X_DEFAULT) {
+ /* Append the display number and ".log" */
+ lf = malloc(strlen(xf86LogFile) + strlen(display) +
+ strlen(LOGSUFFIX) + 1);
+ if (!lf)
+ FatalError("Cannot allocate space for the log file name\n");
+ sprintf(lf, "%s%s" LOGSUFFIX, xf86LogFile, display);
+ xf86LogFile = lf;
+ }
+ {
+ struct stat buf;
+ if (!stat(xf86LogFile,&buf) && S_ISREG(buf.st_mode)) {
+ char *oldlog = (char *)malloc(strlen(xf86LogFile)
+ + strlen(LOGOLDSUFFIX));
+ if (!oldlog)
+ FatalError("Cannot allocate space for the log file name\n");
+ sprintf(oldlog, "%s" LOGOLDSUFFIX, xf86LogFile);
+ if (rename(xf86LogFile,oldlog) == -1)
+ FatalError("Cannot move old logfile \"%s\"\n",oldlog);
+ free(oldlog);
+ }
+ }
+
+ if ((logfile = fopen(xf86LogFile, "w")) == NULL)
+ FatalError("Cannot open log file \"%s\"\n", xf86LogFile);
+ xf86LogFileWasOpened = TRUE;
+ setvbuf(logfile, NULL, _IONBF, 0);
+#ifdef DDXOSVERRORF
+ if (!OsVendorVErrorFProc)
+ OsVendorVErrorFProc = OsVendorVErrorF;
+#endif
+
+ /* Flush saved log information */
+ if (saveBuffer && size > 0) {
+ fwrite(saveBuffer, pos, 1, logfile);
+ if (xf86Info.log) {
+ fflush(logfile);
+ if (xf86Info.log == LogFlush)
+ fsync(fileno(logfile));
+ }
+ free(saveBuffer); /* Note, must be free(), not xfree() */
+ saveBuffer = 0;
+ size = 0;
+ }
+
+#undef LOGSUFFIX
+}
+
+void
+xf86CloseLog()
+{
+ if (logfile) {
+ fclose(logfile);
+ logfile = NULL;
+ }
+}
+
+
+/*
+ * Drivers can use these for using their own SymTabRecs.
+ */
+
+const char *
+xf86TokenToString(SymTabPtr table, int token)
+{
+ int i;
+
+ for (i = 0; table[i].token >= 0 && table[i].token != token; i++)
+ ;
+
+ if (table[i].token < 0)
+ return NULL;
+ else
+ return(table[i].name);
+}
+
+int
+xf86StringToToken(SymTabPtr table, const char *string)
+{
+ int i;
+
+ if (string == NULL)
+ return -1;
+
+ for (i = 0; table[i].token >= 0 && xf86NameCmp(string, table[i].name); i++)
+ ;
+
+ return(table[i].token);
+}
+
+/*
+ * helper to display the clocks found on a card
+ */
+void
+xf86ShowClocks(ScrnInfoPtr scrp, MessageType from)
+{
+ int j;
+
+ xf86DrvMsg(scrp->scrnIndex, from, "Pixel clocks available:");
+ for (j=0; j < scrp->numClocks; j++) {
+ if ((j % 4) == 0) {
+ xf86ErrorF("\n");
+ xf86DrvMsg(scrp->scrnIndex, from, "pixel clocks:");
+ }
+ xf86ErrorF(" %7.3f", (double)scrp->clock[j] / 1000.0);
+ }
+ xf86ErrorF("\n");
+}
+
+
+/*
+ * This prints out the driver identify message, including the names of
+ * the supported chipsets.
+ *
+ * XXX This makes assumptions about the line width, etc. Maybe we could
+ * use a more general "pretty print" function for messages.
+ */
+void
+xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips)
+{
+ int len, i;
+
+ len = 6 + strlen(drvname) + 2 + strlen(drvmsg) + 2;
+ xf86Msg(X_INFO, "%s: %s:", drvname, drvmsg);
+ for (i = 0; chips[i].name != NULL; i++) {
+ if (i != 0) {
+ xf86ErrorF(",");
+ len++;
+ }
+ if (len + 2 + strlen(chips[i].name) < 78) {
+ xf86ErrorF(" ");
+ len++;
+ } else {
+ xf86ErrorF("\n\t");
+ len = 8;
+ }
+ xf86ErrorF("%s", chips[i].name);
+ len += strlen(chips[i].name);
+ }
+ xf86ErrorF("\n");
+}
+
+
+#define MAXDRIVERS 64 /* A >hack<, to be sure ... */
+
+
+int
+xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
+{
+ GDevPtr gdp, *pgdp = NULL;
+ confScreenPtr screensecptr;
+ int i,j;
+
+ if (sectlist)
+ *sectlist = NULL;
+
+ if (xf86DoProbe) return 1;
+
+ if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
+
+ /*
+ * This is a very important function that matches the device sections
+ * as they show up in the config file with the drivers that the server
+ * loads at run time.
+ *
+ * ChipProbe can call
+ * int xf86MatchDevice(char * drivername, GDevPtr ** sectlist)
+ * with its driver name. The function allocates an array of GDevPtr and
+ * returns this via sectlist and returns the number of elements in
+ * this list as return value. 0 means none found, -1 means fatal error.
+ *
+ * It can figure out which of the Device sections to use for which card
+ * (using things like the Card statement, etc). For single headed servers
+ * there will of course be just one such Device section.
+ */
+ i = 0;
+
+ /*
+ * first we need to loop over all the Screens sections to get to all
+ * 'active' device sections
+ */
+ for (j=0; xf86ConfigLayout.screens[j].screen != NULL; j++) {
+ screensecptr = xf86ConfigLayout.screens[j].screen;
+ if ((screensecptr->device->driver != NULL)
+ && (xf86NameCmp( screensecptr->device->driver,drivername) == 0)
+ && (! screensecptr->device->claimed)) {
+ /*
+ * we have a matching driver that wasn't claimed, yet
+ */
+ pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
+ pgdp[i++] = screensecptr->device;
+ }
+ }
+
+ /* Then handle the inactive devices */
+ j = 0;
+ while (xf86ConfigLayout.inactives[j].identifier) {
+ gdp = &xf86ConfigLayout.inactives[j];
+ if (gdp->driver && !gdp->claimed &&
+ !xf86NameCmp(gdp->driver,drivername)) {
+ /* we have a matching driver that wasn't claimed yet */
+ pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr));
+ pgdp[i++] = gdp;
+ }
+ j++;
+ }
+
+ /*
+ * make the array NULL terminated and return its address
+ */
+ if (i)
+ pgdp[i] = NULL;
+
+ if (sectlist)
+ *sectlist = pgdp;
+ else
+ xfree(pgdp);
+ return i;
+}
+
+struct Inst {
+ pciVideoPtr pci;
+ GDevPtr dev;
+ Bool foundHW; /* PCIid in list of supported chipsets */
+ Bool claimed; /* BusID matches with a device section */
+ int chip;
+ int screen;
+};
+
+int
+xf86MatchPciInstances(const char *driverName, int vendorID,
+ SymTabPtr chipsets, PciChipsets *PCIchipsets,
+ GDevPtr *devList, int numDevs, DriverPtr drvp,
+ int **foundEntities)
+{
+ int i,j;
+ MessageType from;
+ pciVideoPtr pPci, *ppPci;
+ struct Inst {
+ pciVideoPtr pci;
+ GDevPtr dev;
+ Bool foundHW; /* PCIid in list of supported chipsets */
+ Bool claimed; /* BusID matches with a device section */
+ int chip;
+ int screen;
+ } *instances = NULL;
+ int numClaimedInstances = 0;
+ int allocatedInstances = 0;
+ int numFound = 0;
+ SymTabRec *c;
+ PciChipsets *id;
+ GDevPtr devBus = NULL;
+ GDevPtr dev = NULL;
+ int *retEntities = NULL;
+
+ *foundEntities = NULL;
+
+ if (vendorID == 0) {
+ for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) {
+ Bool foundVendor = FALSE;
+ for (id = PCIchipsets; id->PCIid != -1; id++) {
+ if ( (((id->PCIid & 0xFFFF0000) >> 16) == (*ppPci)->vendor)) {
+ if (!foundVendor) {
+ ++allocatedInstances;
+ instances = xnfrealloc(instances,
+ allocatedInstances * sizeof(struct Inst));
+ instances[allocatedInstances - 1].pci = *ppPci;
+ instances[allocatedInstances - 1].dev = NULL;
+ instances[allocatedInstances - 1].claimed = FALSE;
+ instances[allocatedInstances - 1].foundHW = FALSE;
+ instances[allocatedInstances - 1].screen = 0;
+ foundVendor = TRUE;
+ }
+ if ((id->PCIid & 0x0000FFFF) == (*ppPci)->chipType) {
+ instances[allocatedInstances - 1].foundHW = TRUE;
+ instances[allocatedInstances - 1].chip = id->numChipset;
+ numFound++;
+ }
+ }
+ }
+ }
+ } else if (vendorID == PCI_VENDOR_GENERIC) {
+ for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) {
+ for (id = PCIchipsets; id->PCIid != -1; id++) {
+ if (id->PCIid == xf86CheckPciGAType(*ppPci)) {
+ ++allocatedInstances;
+ instances = xnfrealloc(instances,
+ allocatedInstances * sizeof(struct Inst));
+ instances[allocatedInstances - 1].pci = *ppPci;
+ instances[allocatedInstances - 1].dev = NULL;
+ instances[allocatedInstances - 1].claimed = FALSE;
+ instances[allocatedInstances - 1].foundHW = TRUE;
+ instances[allocatedInstances - 1].chip = id->numChipset;
+ instances[allocatedInstances - 1].screen = 0;
+ numFound++;
+ }
+ }
+ }
+ } else {
+ /* Find PCI devices that match the given vendor ID */
+ for (ppPci = xf86PciVideoInfo; (ppPci != NULL)
+ && (*ppPci != NULL); ppPci++) {
+ if ((*ppPci)->vendor == vendorID) {
+ ++allocatedInstances;
+ instances = xnfrealloc(instances,
+ allocatedInstances * sizeof(struct Inst));
+ instances[allocatedInstances - 1].pci = *ppPci;
+ instances[allocatedInstances - 1].dev = NULL;
+ instances[allocatedInstances - 1].claimed = FALSE;
+ instances[allocatedInstances - 1].foundHW = FALSE;
+ instances[allocatedInstances - 1].screen = 0;
+
+ /* Check if the chip type is listed in the chipsets table */
+ for (id = PCIchipsets; id->PCIid != -1; id++) {
+ if (id->PCIid == (*ppPci)->chipType) {
+ instances[allocatedInstances - 1].chip
+ = id->numChipset;
+ instances[allocatedInstances - 1].foundHW = TRUE;
+ numFound++;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * This may be debatable, but if no PCI devices with a matching vendor
+ * type is found, return zero now. It is probably not desirable to
+ * allow the config file to override this.
+ */
+ if (allocatedInstances <= 0) {
+ xfree(instances);
+ return 0;
+ }
+
+ if (xf86DoProbe) {
+ xfree(instances);
+ return numFound;
+ }
+
+ if (xf86DoConfigure && xf86DoConfigurePass1) {
+ GDevPtr pGDev;
+ int actualcards = 0;
+ for (i = 0; i < allocatedInstances; i++) {
+ pPci = instances[i].pci;
+ if (instances[i].foundHW) {
+ if (!xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func))
+ continue;
+ actualcards++;
+ pGDev = xf86AddDeviceToConfigure(drvp->driverName,
+ instances[i].pci, -1);
+ if (pGDev) {
+ /*
+ * XF86Match???Instances() treat chipID and chipRev as
+ * overrides, so clobber them here.
+ */
+ pGDev->chipID = pGDev->chipRev = -1;
+ }
+ }
+ }
+ xfree(instances);
+ return actualcards;
+ }
+
+#ifdef DEBUG
+ ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
+#endif
+
+ /*
+ * Check for devices that need duplicated instances. This is required
+ * when there is more than one screen per entity.
+ *
+ * XXX This currently doesn't work for cases where the BusID isn't
+ * specified explicitly in the config file.
+ */
+
+ for (j = 0; j < numDevs; j++) {
+ if (devList[j]->screen > 0 && devList[j]->busID
+ && *devList[j]->busID) {
+ for (i = 0; i < allocatedInstances; i++) {
+ pPci = instances[i].pci;
+ if (xf86ComparePciBusString(devList[j]->busID, pPci->bus,
+ pPci->device,
+ pPci->func)) {
+ allocatedInstances++;
+ instances = xnfrealloc(instances,
+ allocatedInstances *
+ sizeof(struct Inst));
+ instances[allocatedInstances - 1] = instances[i];
+ instances[allocatedInstances - 1].screen =
+ devList[j]->screen;
+ numFound++;
+ break;
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < allocatedInstances; i++) {
+ pPci = instances[i].pci;
+ devBus = NULL;
+ dev = NULL;
+ for (j = 0; j < numDevs; j++) {
+ if (devList[j]->busID && *devList[j]->busID) {
+ if (xf86ComparePciBusString(devList[j]->busID, pPci->bus,
+ pPci->device,
+ pPci->func) &&
+ devList[j]->screen == instances[i].screen) {
+
+ if (devBus)
+ xf86MsgVerb(X_WARNING,0,
+ "%s: More than one matching Device section for "
+ "instances\n\t(BusID: %s) found: %s\n",
+ driverName, devList[j]->busID,
+ devList[j]->identifier);
+ else
+ devBus = devList[j];
+ }
+ } else {
+ /*
+ * if device section without BusID is found
+ * only assign to it to the primary device.
+ */
+ if (xf86IsPrimaryPci(pPci)) {
+ xf86Msg(X_PROBED, "Assigning device section with no busID"
+ " to primary device\n");
+ if (dev || devBus)
+ xf86MsgVerb(X_WARNING, 0,
+ "%s: More than one matching Device section "
+ "found: %s\n", devList[j]->identifier);
+ else
+ dev = devList[j];
+ }
+ }
+ }
+ if (devBus) dev = devBus; /* busID preferred */
+ if (!dev) {
+ if (xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) {
+ xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
+ "for instance (BusID PCI:%i:%i:%i) found\n",
+ driverName, pPci->bus, pPci->device, pPci->func);
+ }
+ } else {
+ numClaimedInstances++;
+ instances[i].claimed = TRUE;
+ instances[i].dev = dev;
+ }
+ }
+#ifdef DEBUG
+ ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
+#endif
+ /*
+ * Now check that a chipset or chipID override in the device section
+ * is valid. Chipset has precedence over chipID.
+ * If chipset is not valid ignore BusSlot completely.
+ */
+ for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
+ if (!instances[i].claimed) {
+ continue;
+ }
+ from = X_PROBED;
+ if (instances[i].dev->chipset) {
+ for (c = chipsets; c->token >= 0; c++) {
+ if (xf86NameCmp(c->name, instances[i].dev->chipset) == 0)
+ break;
+ }
+ if (c->token == -1) {
+ instances[i].claimed = FALSE;
+ numClaimedInstances--;
+ xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
+ "section \"%s\" isn't valid for this driver\n",
+ driverName, instances[i].dev->chipset,
+ instances[i].dev->identifier);
+ } else {
+ instances[i].chip = c->token;
+
+ for (id = PCIchipsets; id->numChipset >= 0; id++) {
+ if (id->numChipset == instances[i].chip)
+ break;
+ }
+ if(id->numChipset >=0){
+ xf86Msg(X_CONFIG,"Chipset override: %s\n",
+ instances[i].dev->chipset);
+ from = X_CONFIG;
+ } else {
+ instances[i].claimed = FALSE;
+ numClaimedInstances--;
+ xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
+ "section \"%s\" isn't a valid PCI chipset\n",
+ driverName, instances[i].dev->chipset,
+ instances[i].dev->identifier);
+ }
+ }
+ } else if (instances[i].dev->chipID > 0) {
+ for (id = PCIchipsets; id->numChipset >= 0; id++) {
+ if (id->PCIid == instances[i].dev->chipID)
+ break;
+ }
+ if (id->numChipset == -1) {
+ instances[i].claimed = FALSE;
+ numClaimedInstances--;
+ xf86MsgVerb(X_WARNING, 0, "%s: ChipID 0x%04X in Device "
+ "section \"%s\" isn't valid for this driver\n",
+ driverName, instances[i].dev->chipID,
+ instances[i].dev->identifier);
+ } else {
+ instances[i].chip = id->numChipset;
+
+ xf86Msg( X_CONFIG,"ChipID override: 0x%04X\n",
+ instances[i].dev->chipID);
+ from = X_CONFIG;
+ }
+ } else if (!instances[i].foundHW) {
+ /*
+ * This means that there was no override and the PCI chipType
+ * doesn't match one that is supported
+ */
+ instances[i].claimed = FALSE;
+ numClaimedInstances--;
+ }
+ if (instances[i].claimed == TRUE){
+ for (c = chipsets; c->token >= 0; c++) {
+ if (c->token == instances[i].chip)
+ break;
+ }
+ xf86Msg(from,"Chipset %s found\n",
+ c->name);
+ }
+ }
+
+ /*
+ * Of the claimed instances, check that another driver hasn't already
+ * claimed its slot.
+ */
+ numFound = 0;
+ for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
+
+ if (!instances[i].claimed)
+ continue;
+ pPci = instances[i].pci;
+
+
+ /*
+ * Allow the same entity to be used more than once for devices with
+ * multiple screens per entity. This assumes implicitly that there
+ * will be a screen == 0 instance.
+ *
+ * XXX Need to make sure that two different drivers don't claim
+ * the same screen > 0 instance.
+ */
+ if (instances[i].screen == 0 &&
+ !xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func))
+ continue;
+
+#ifdef DEBUG
+ ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n",
+ driverName, pPci->bus, pPci->device, pPci->func);
+#endif
+
+ /* Allocate an entry in the lists to be returned */
+ numFound++;
+ retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
+ retEntities[numFound - 1]
+ = xf86ClaimPciSlot(pPci->bus, pPci->device,
+ pPci->func,drvp, instances[i].chip,
+ instances[i].dev,instances[i].dev->active ?
+ TRUE : FALSE);
+ if (retEntities[numFound - 1] == -1 && instances[i].screen > 0) {
+ for (j = 0; j < xf86NumEntities; j++) {
+ EntityPtr pEnt = xf86Entities[j];
+ if (pEnt->busType != BUS_PCI)
+ continue;
+ if (pEnt->pciBusId.bus == pPci->bus &&
+ pEnt->pciBusId.device == pPci->device &&
+ pEnt->pciBusId.func == pPci->func) {
+ retEntities[numFound - 1] = j;
+ xf86AddDevToEntity(j, instances[i].dev);
+ break;
+ }
+ }
+ }
+ }
+ xfree(instances);
+ if (numFound > 0) {
+ *foundEntities = retEntities;
+ }
+
+ return numFound;
+}
+
+int
+xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
+ IsaChipsets *ISAchipsets, DriverPtr drvp,
+ FindIsaDevProc FindIsaDevice, GDevPtr *devList,
+ int numDevs, int **foundEntities)
+{
+ SymTabRec *c;
+ IsaChipsets *Chips;
+ int i;
+ int numFound = 0;
+ int foundChip = -1;
+ int *retEntities = NULL;
+
+ *foundEntities = NULL;
+
+#if defined(__sparc__) || defined(__powerpc__)
+ FindIsaDevice = NULL; /* Temporary */
+#endif
+
+ if (xf86DoProbe || (xf86DoConfigure && xf86DoConfigurePass1)) {
+ if (FindIsaDevice &&
+ ((foundChip = (*FindIsaDevice)(NULL)) != -1)) {
+ xf86AddDeviceToConfigure(drvp->driverName, NULL, foundChip);
+ return 1;
+ }
+ return 0;
+ }
+
+ for (i = 0; i < numDevs; i++) {
+ MessageType from = X_CONFIG;
+ GDevPtr dev = NULL;
+ GDevPtr devBus = NULL;
+
+ if (devList[i]->busID && *devList[i]->busID) {
+ if (xf86ParseIsaBusString(devList[i]->busID)) {
+ if (devBus) xf86MsgVerb(X_WARNING,0,
+ "%s: More than one matching Device "
+ "section for ISA-Bus found: %s\n",
+ driverName,devList[i]->identifier);
+ else devBus = devList[i];
+ }
+ } else {
+ if (xf86IsPrimaryIsa()) {
+ if (dev) xf86MsgVerb(X_WARNING,0,
+ "%s: More than one matching "
+ "Device section found: %s\n",
+ driverName,devList[i]->identifier);
+ else dev = devList[i];
+ }
+ }
+ if (devBus) dev = devBus;
+ if (dev) {
+ if (dev->chipset) {
+ for (c = chipsets; c->token >= 0; c++) {
+ if (xf86NameCmp(c->name, dev->chipset) == 0)
+ break;
+ }
+ if (c->token == -1) {
+ xf86MsgVerb(X_WARNING, 0, "%s: Chipset \"%s\" in Device "
+ "section \"%s\" isn't valid for this driver\n",
+ driverName, dev->chipset,
+ dev->identifier);
+ } else
+ foundChip = c->token;
+ } else {
+ if (FindIsaDevice) foundChip = (*FindIsaDevice)(dev);
+ /* Probe it */
+ from = X_PROBED;
+ }
+ }
+
+ /* Check if the chip type is listed in the chipset table - for sanity*/
+
+ if (foundChip >= 0){
+ for (Chips = ISAchipsets; Chips->numChipset >= 0; Chips++) {
+ if (Chips->numChipset == foundChip)
+ break;
+ }
+ if (Chips->numChipset == -1){
+ foundChip = -1;
+ xf86MsgVerb(X_WARNING,0,
+ "%s: Driver detected unknown ISA-Bus Chipset\n",
+ driverName);
+ }
+ }
+ if (foundChip != -1) {
+ numFound++;
+ retEntities = xnfrealloc(retEntities,numFound * sizeof(int));
+ retEntities[numFound - 1] =
+ xf86ClaimIsaSlot(drvp,foundChip,dev, dev->active ? TRUE : FALSE);
+ for (c = chipsets; c->token >= 0; c++) {
+ if (c->token == foundChip)
+ break;
+ }
+ xf86Msg(from, "Chipset %s found\n", c->name);
+ }
+ }
+ *foundEntities = retEntities;
+
+ return numFound;
+}
+
+/*
+ * xf86GetClocks -- get the dot-clocks via a BIG BAD hack ...
+ */
+void
+xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
+ void (*ProtectRegs)(ScrnInfoPtr, Bool),
+ void (*BlankScreen)(ScrnInfoPtr, Bool), IOADDRESS vertsyncreg,
+ int maskval, int knownclkindex, int knownclkvalue)
+{
+ register int status = vertsyncreg;
+ unsigned long i, cnt, rcnt, sync;
+
+ /* First save registers that get written on */
+ (*ClockFunc)(pScrn, CLK_REG_SAVE);
+
+ xf86SetPriority(TRUE);
+
+ if (num > MAXCLOCKS)
+ num = MAXCLOCKS;
+
+ for (i = 0; i < num; i++)
+ {
+ if (ProtectRegs)
+ (*ProtectRegs)(pScrn, TRUE);
+ if (!(*ClockFunc)(pScrn, i))
+ {
+ pScrn->clock[i] = -1;
+ continue;
+ }
+ if (ProtectRegs)
+ (*ProtectRegs)(pScrn, FALSE);
+ if (BlankScreen)
+ (*BlankScreen)(pScrn, FALSE);
+
+ usleep(50000); /* let VCO stabilise */
+
+ cnt = 0;
+ sync = 200000;
+
+ /* XXX How critical is this? */
+ if (!xf86DisableInterrupts())
+ {
+ (*ClockFunc)(pScrn, CLK_REG_RESTORE);
+ ErrorF("Failed to disable interrupts during clock probe. If\n");
+ ErrorF("your OS does not support disabling interrupts, then you\n");
+ FatalError("must specify a Clocks line in the XF86Config file.\n");
+ }
+ while ((inb(status) & maskval) == 0x00)
+ if (sync-- == 0) goto finish;
+ /* Something appears to be happening, so reset sync count */
+ sync = 200000;
+ while ((inb(status) & maskval) == maskval)
+ if (sync-- == 0) goto finish;
+ /* Something appears to be happening, so reset sync count */
+ sync = 200000;
+ while ((inb(status) & maskval) == 0x00)
+ if (sync-- == 0) goto finish;
+
+ for (rcnt = 0; rcnt < 5; rcnt++)
+ {
+ while (!(inb(status) & maskval))
+ cnt++;
+ while ((inb(status) & maskval))
+ cnt++;
+ }
+
+finish:
+ xf86EnableInterrupts();
+
+ pScrn->clock[i] = cnt ? cnt : -1;
+ if (BlankScreen)
+ (*BlankScreen)(pScrn, TRUE);
+ }
+
+ xf86SetPriority(FALSE);
+
+ for (i = 0; i < num; i++)
+ {
+ if (i != knownclkindex)
+ {
+ if (pScrn->clock[i] == -1)
+ {
+ pScrn->clock[i] = 0;
+ }
+ else
+ {
+ pScrn->clock[i] = (int)(0.5 +
+ (((float)knownclkvalue) * pScrn->clock[knownclkindex]) /
+ (pScrn->clock[i]));
+ /* Round to nearest 10KHz */
+ pScrn->clock[i] += 5;
+ pScrn->clock[i] /= 10;
+ pScrn->clock[i] *= 10;
+ }
+ }
+ }
+
+ pScrn->clock[knownclkindex] = knownclkvalue;
+ pScrn->numClocks = num;
+
+ /* Restore registers that were written on */
+ (*ClockFunc)(pScrn, CLK_REG_RESTORE);
+}
+
+void
+xf86SetPriority(Bool up)
+{
+ static int saved_nice;
+
+ if (up) {
+#ifdef HAS_SETPRIORITY
+ saved_nice = getpriority(PRIO_PROCESS, 0);
+ setpriority(PRIO_PROCESS, 0, -20);
+#endif
+#if defined(SYSV) || defined(SVR4) || defined(linux)
+ saved_nice = nice(0);
+ nice(-20 - saved_nice);
+#endif
+ } else {
+#ifdef HAS_SETPRIORITY
+ setpriority(PRIO_PROCESS, 0, saved_nice);
+#endif
+#if defined(SYSV) || defined(SVR4) || defined(linux)
+ nice(20 + saved_nice);
+#endif
+ }
+}
+
+const char *
+xf86GetVisualName(int visual)
+{
+ if (visual < 0 || visual > DirectColor)
+ return NULL;
+
+ return xf86VisualNames[visual];
+}
+
+
+int
+xf86GetVerbosity()
+{
+ return max(xf86Verbose, xf86LogVerbose);
+}
+
+
+Pix24Flags
+xf86GetPix24()
+{
+ return xf86Info.pixmap24;
+}
+
+
+int
+xf86GetDepth()
+{
+ return xf86Depth;
+}
+
+
+rgb
+xf86GetWeight()
+{
+ return xf86Weight;
+}
+
+
+Gamma
+xf86GetGamma()
+{
+ return xf86Gamma;
+}
+
+
+Bool
+xf86GetFlipPixels()
+{
+ return xf86FlipPixels;
+}
+
+
+const char *
+xf86GetServerName()
+{
+ return xf86ServerName;
+}
+
+
+Bool
+xf86ServerIsExiting()
+{
+ return (dispatchException & DE_TERMINATE) == DE_TERMINATE;
+}
+
+
+Bool
+xf86ServerIsResetting()
+{
+ return xf86Resetting;
+}
+
+
+Bool
+xf86ServerIsInitialising()
+{
+ return xf86Initialising;
+}
+
+
+Bool
+xf86ServerIsOnlyDetecting(void)
+{
+ return xf86DoProbe || xf86DoConfigure;
+}
+
+
+Bool
+xf86ServerIsOnlyProbing(void)
+{
+ return xf86ProbeOnly;
+}
+
+
+Bool
+xf86CaughtSignal()
+{
+ return xf86Info.caughtSignal;
+}
+
+
+Bool
+xf86GetVidModeAllowNonLocal()
+{
+ return xf86Info.vidModeAllowNonLocal;
+}
+
+
+Bool
+xf86GetVidModeEnabled()
+{
+ return xf86Info.vidModeEnabled;
+}
+
+Bool
+xf86GetModInDevAllowNonLocal()
+{
+ return xf86Info.miscModInDevAllowNonLocal;
+}
+
+
+Bool
+xf86GetModInDevEnabled()
+{
+ return xf86Info.miscModInDevEnabled;
+}
+
+
+Bool
+xf86GetAllowMouseOpenFail()
+{
+ return xf86Info.allowMouseOpenFail;
+}
+
+
+Bool
+xf86IsPc98()
+{
+#if defined(i386) || defined(__i386__)
+ return xf86Info.pc98;
+#else
+ return FALSE;
+#endif
+}
+
+void
+xf86DisableRandR()
+{
+ xf86Info.disableRandR = TRUE;
+ xf86Info.randRFrom = X_PROBED;
+}
+
+CARD32
+xf86GetVersion()
+{
+ return XF86_VERSION_CURRENT;
+}
+
+CARD32
+xf86GetModuleVersion(pointer module)
+{
+#ifdef XFree86LOADER
+ return (CARD32)LoaderGetModuleVersion(module);
+#else
+ return 0;
+#endif
+}
+
+pointer
+xf86LoadDrvSubModule(DriverPtr drv, const char *name)
+{
+#ifdef XFree86LOADER
+ pointer ret;
+ int errmaj = 0, errmin = 0;
+
+ ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL,
+ &errmaj, &errmin);
+ if (!ret)
+ LoaderErrorMsg(NULL, name, errmaj, errmin);
+ return ret;
+#else
+ return (pointer)1;
+#endif
+}
+
+pointer
+xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name)
+{
+#ifdef XFree86LOADER
+ pointer ret;
+ int errmaj = 0, errmin = 0;
+
+ ret = LoadSubModule(pScrn->module, name, NULL, NULL, NULL, NULL,
+ &errmaj, &errmin);
+ if (!ret)
+ LoaderErrorMsg(pScrn->name, name, errmaj, errmin);
+ return ret;
+#else
+ return (pointer)1;
+#endif
+}
+
+/*
+ * xf86LoadOneModule loads a single module.
+ */
+pointer
+xf86LoadOneModule(char *name, pointer opt)
+{
+#ifdef XFree86LOADER
+ int errmaj, errmin;
+#endif
+ char *Name;
+ pointer mod;
+
+ if (!name)
+ return NULL;
+
+#ifndef NORMALISE_MODULE_NAME
+ Name = xstrdup(name);
+#else
+ /* Normalise the module name */
+ Name = xf86NormalizeName(name);
+#endif
+
+ /* Skip empty names */
+ if (Name == NULL)
+ return NULL;
+ if (*Name == '\0') {
+ xfree(Name);
+ return NULL;
+ }
+
+#ifdef XFree86LOADER
+ mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin);
+ if (!mod)
+ LoaderErrorMsg(NULL, Name, errmaj, errmin);
+#else
+ mod = (pointer)1;
+#endif
+ xfree(Name);
+ return mod;
+}
+
+void
+xf86UnloadSubModule(pointer mod)
+{
+ /*
+ * This is disabled for now. The loader isn't smart enough yet to undo
+ * relocations.
+ */
+#if defined(XFree86LOADER) && 0
+ UnloadSubModule(mod);
+#endif
+}
+
+Bool
+xf86LoaderCheckSymbol(const char *name)
+{
+#ifdef XFree86LOADER
+ return LoaderSymbol(name) != NULL;
+#else
+ return TRUE;
+#endif
+}
+
+void
+xf86LoaderReqSymLists(const char **list0, ...)
+{
+#ifdef XFree86LOADER
+ va_list ap;
+
+ va_start(ap, list0);
+ LoaderVReqSymLists(list0, ap);
+ va_end(ap);
+#endif
+}
+
+void
+xf86LoaderReqSymbols(const char *sym0, ...)
+{
+#ifdef XFree86LOADER
+ va_list ap;
+
+ va_start(ap, sym0);
+ LoaderVReqSymbols(sym0, ap);
+ va_end(ap);
+#endif
+}
+
+void
+xf86LoaderRefSymLists(const char **list0, ...)
+{
+#ifdef XFree86LOADER
+ va_list ap;
+
+ va_start(ap, list0);
+ LoaderVRefSymLists(list0, ap);
+ va_end(ap);
+#endif
+}
+
+void
+xf86LoaderRefSymbols(const char *sym0, ...)
+{
+#ifdef XFree86LOADER
+ va_list ap;
+
+ va_start(ap, sym0);
+ LoaderVRefSymbols(sym0, ap);
+ va_end(ap);
+#endif
+}
+
+
+typedef enum {
+ OPTION_BACKING_STORE
+} BSOpts;
+
+static const OptionInfoRec BSOptions[] = {
+ { OPTION_BACKING_STORE, "BackingStore", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+};
+
+void
+xf86SetBackingStore(ScreenPtr pScreen)
+{
+ Bool useBS = FALSE;
+ MessageType from = X_DEFAULT;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ OptionInfoPtr options;
+
+ options = xnfalloc(sizeof(BSOptions));
+ (void)memcpy(options, BSOptions, sizeof(BSOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
+
+ /* check for commandline option here */
+ if (xf86bsEnableFlag) {
+ from = X_CMDLINE;
+ useBS = TRUE;
+ } else if (xf86bsDisableFlag) {
+ from = X_CMDLINE;
+ useBS = FALSE;
+ } else {
+ if (xf86GetOptValBool(options, OPTION_BACKING_STORE, &useBS))
+ from = X_CONFIG;
+ }
+ xfree(options);
+ pScreen->backingStoreSupport = useBS ? Always : NotUseful;
+ if (serverGeneration == 1)
+ xf86DrvMsg(pScreen->myNum, from, "Backing store %s\n",
+ useBS ? "enabled" : "disabled");
+}
+
+
+typedef enum {
+ OPTION_SILKEN_MOUSE
+} SMOpts;
+
+static const OptionInfoRec SMOptions[] = {
+ { OPTION_SILKEN_MOUSE, "SilkenMouse", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+};
+
+void
+xf86SetSilkenMouse (ScreenPtr pScreen)
+{
+ Bool useSM = TRUE;
+ MessageType from = X_DEFAULT;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ OptionInfoPtr options;
+
+ options = xnfalloc(sizeof(SMOptions));
+ (void)memcpy(options, SMOptions, sizeof(SMOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
+
+ /* check for commandline option here */
+ /* disable if screen shares resources */
+ if (((pScrn->racMemFlags & RAC_CURSOR) &&
+ !xf86NoSharedResources(pScrn->scrnIndex,MEM)) ||
+ ((pScrn->racIoFlags & RAC_CURSOR) &&
+ !xf86NoSharedResources(pScrn->scrnIndex,IO))) {
+ useSM = FALSE;
+ from = X_PROBED;
+ } else if (xf86silkenMouseDisableFlag) {
+ from = X_CMDLINE;
+ useSM = FALSE;
+ } else {
+ if (xf86GetOptValBool(options, OPTION_SILKEN_MOUSE, &useSM))
+ from = X_CONFIG;
+ }
+ xfree(options);
+ /*
+ * XXX quick hack to report correctly for OSs that can't do SilkenMouse
+ * yet. Should handle this differently so that alternate async methods
+ * like Xqueue work correctly with this too.
+ */
+ pScrn->silkenMouse = useSM && xf86SIGIOSupported();
+ if (serverGeneration == 1)
+ xf86DrvMsg(pScreen->myNum, from, "Silken mouse %s\n",
+ pScrn->silkenMouse ? "enabled" : "disabled");
+}
+
+/* Wrote this function for the PM2 Xv driver, preliminary. */
+
+pointer
+xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name,
+ char **adaptor_name, pointer *adaptor_options)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ confXvAdaptorPtr adaptor;
+ int i;
+
+ if (adaptor_index >= pScrn->confScreen->numxvadaptors) {
+ if (adaptor_name) *adaptor_name = NULL;
+ if (adaptor_options) *adaptor_options = NULL;
+ return NULL;
+ }
+
+ adaptor = &pScrn->confScreen->xvadaptors[adaptor_index];
+ if (adaptor_name) *adaptor_name = adaptor->identifier;
+ if (adaptor_options) *adaptor_options = adaptor->options;
+
+ for (i = 0; i < adaptor->numports; i++)
+ if (!xf86NameCmp(adaptor->ports[i].identifier, port_name))
+ return adaptor->ports[i].options;
+
+ return NULL;
+}
+
+/* Rather than duplicate loader's get OS function, just include it directly */
+#define LoaderGetOS xf86GetOS
+#include "loader/os.c"
+
+/* new RAC */
+/*
+ * xf86ConfigIsa/PciEntity() -- These helper functions assign an
+ * active entity to a screen, registers its fixed resources, assign
+ * special enter/leave functions and their private scratch area to
+ * this entity, take the dog for a walk...
+ */
+ScrnInfoPtr
+xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
+ IsaChipsets *i_chip, resList res, EntityProc init,
+ EntityProc enter, EntityProc leave, pointer private)
+{
+ IsaChipsets *i_id;
+ EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+ if (!pEnt) return pScrn;
+
+ if (!(pEnt->location.type == BUS_ISA)) {
+ xfree(pEnt);
+ return pScrn;
+ }
+
+ if (!pEnt->active) {
+ xf86ConfigIsaEntityInactive(pEnt, i_chip, res, init, enter,
+ leave, private);
+ return pScrn;
+ }
+
+ if (!pScrn)
+ pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
+ xf86AddEntityToScreen(pScrn,entityIndex);
+
+ if (i_chip) {
+ for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
+ if (pEnt->chipset == i_id->numChipset) break;
+ }
+ xf86ClaimFixedResources(i_id->resList,entityIndex);
+ }
+ xfree(pEnt);
+ xf86ClaimFixedResources(res,entityIndex);
+ xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
+
+ return pScrn;
+}
+
+ScrnInfoPtr
+xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
+ PciChipsets *p_chip, resList res, EntityProc init,
+ EntityProc enter, EntityProc leave, pointer private)
+{
+ PciChipsets *p_id;
+ EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+ if (!pEnt) return pScrn;
+
+ if (!(pEnt->location.type == BUS_PCI)
+ || !xf86GetPciInfoForEntity(entityIndex)) {
+ xfree(pEnt);
+ return pScrn;
+ }
+ if (!pEnt->active) {
+ xf86ConfigPciEntityInactive(pEnt, p_chip, res, init, enter,
+ leave, private);
+ return pScrn;
+ }
+
+ if (!pScrn)
+ pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
+ if (xf86IsEntitySharable(entityIndex)) {
+ xf86SetEntityShared(entityIndex);
+ }
+ xf86AddEntityToScreen(pScrn,entityIndex);
+ if (xf86IsEntityShared(entityIndex)) {
+ return pScrn;
+ }
+ if (p_chip) {
+ for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
+ if (pEnt->chipset == p_id->numChipset) break;
+ }
+ xf86ClaimFixedResources(p_id->resList,entityIndex);
+ }
+ xfree(pEnt);
+
+ xf86ClaimFixedResources(res,entityIndex);
+ xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
+
+ return pScrn;
+}
+
+ScrnInfoPtr
+xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
+ EntityProc init, EntityProc enter, EntityProc leave,
+ pointer private)
+{
+ EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+ if (!pEnt) return pScrn;
+
+ if (!(pEnt->location.type == BUS_NONE)) {
+ xfree(pEnt);
+ return pScrn;
+ }
+
+ if (!pEnt->active) {
+ xf86ConfigFbEntityInactive(pEnt, init, enter, leave, private);
+ return pScrn;
+ }
+
+ if (!pScrn)
+ pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
+ xf86AddEntityToScreen(pScrn,entityIndex);
+
+ xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
+
+ return pScrn;
+}
+
+/*
+ *
+ * OBSOLETE ! xf86ConfigActiveIsaEntity() and xf86ConfigActivePciEntity()
+ * are obsolete functions. They the are likely to be removed
+ * Don't use!
+ */
+Bool
+xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex,
+ IsaChipsets *i_chip, resList res, EntityProc init,
+ EntityProc enter, EntityProc leave, pointer private)
+{
+ IsaChipsets *i_id;
+ EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+ if (!pEnt) return FALSE;
+
+ if (!pEnt->active || !(pEnt->location.type == BUS_ISA)) {
+ xfree(pEnt);
+ return FALSE;
+ }
+
+ xf86AddEntityToScreen(pScrn,entityIndex);
+
+ if (i_chip) {
+ for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
+ if (pEnt->chipset == i_id->numChipset) break;
+ }
+ xf86ClaimFixedResources(i_id->resList,entityIndex);
+ }
+ xfree(pEnt);
+ xf86ClaimFixedResources(res,entityIndex);
+ if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private))
+ return FALSE;
+
+ return TRUE;
+}
+
+Bool
+xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
+ PciChipsets *p_chip, resList res, EntityProc init,
+ EntityProc enter, EntityProc leave, pointer private)
+{
+ PciChipsets *p_id;
+ EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+ if (!pEnt) return FALSE;
+
+ if (!pEnt->active || !(pEnt->location.type == BUS_PCI)) {
+ xfree(pEnt);
+ return FALSE;
+ }
+ xf86AddEntityToScreen(pScrn,entityIndex);
+
+ if (p_chip) {
+ for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
+ if (pEnt->chipset == p_id->numChipset) break;
+ }
+ xf86ClaimFixedResources(p_id->resList,entityIndex);
+ }
+ xfree(pEnt);
+
+ xf86ClaimFixedResources(res,entityIndex);
+ if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private))
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
+ * xf86ConfigPci/IsaEntityInactive() -- These functions can be used
+ * to configure an inactive entity as well as to reconfigure an
+ * previously active entity inactive. If the entity has been
+ * assigned to a screen before it will be removed. If p_pci(p_isa) is
+ * non-NULL all static resources listed there will be registered.
+ */
+void
+xf86ConfigPciEntityInactive(EntityInfoPtr pEnt, PciChipsets *p_chip,
+ resList res, EntityProc init, EntityProc enter,
+ EntityProc leave, pointer private)
+{
+ PciChipsets *p_id;
+ ScrnInfoPtr pScrn;
+
+ if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
+ xf86RemoveEntityFromScreen(pScrn,pEnt->index);
+ else if (p_chip) {
+ for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
+ if (pEnt->chipset == p_id->numChipset) break;
+ }
+ xf86ClaimFixedResources(p_id->resList,pEnt->index);
+ }
+ xf86ClaimFixedResources(res,pEnt->index);
+ /* shared resources are only needed when entity is active: remove */
+ xf86DeallocateResourcesForEntity(pEnt->index, ResShared);
+ xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
+}
+
+void
+xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
+ resList res, EntityProc init, EntityProc enter,
+ EntityProc leave, pointer private)
+{
+ IsaChipsets *i_id;
+ ScrnInfoPtr pScrn;
+
+ if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
+ xf86RemoveEntityFromScreen(pScrn,pEnt->index);
+ else if (i_chip) {
+ for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
+ if (pEnt->chipset == i_id->numChipset) break;
+ }
+ xf86ClaimFixedResources(i_id->resList,pEnt->index);
+ }
+ xf86ClaimFixedResources(res,pEnt->index);
+ /* shared resources are only needed when entity is active: remove */
+ xf86DeallocateResourcesForEntity(pEnt->index, ResShared);
+ xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
+}
+
+void
+xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
+ EntityProc enter, EntityProc leave, pointer private)
+{
+ ScrnInfoPtr pScrn;
+
+ if ((pScrn = xf86FindScreenForEntity(pEnt->index)))
+ xf86RemoveEntityFromScreen(pScrn,pEnt->index);
+ xf86SetEntityFuncs(pEnt->index,init,enter,leave,private);
+}
+
+Bool
+xf86IsScreenPrimary(int scrnIndex)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ int i;
+
+ for (i=0 ; i < pScrn->numEntities; i++) {
+ if (xf86IsEntityPrimary(i))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+int
+xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
+ int format, unsigned long len, pointer value )
+{
+ PropertyPtr pNewProp, pRegProp;
+ int i;
+
+#ifdef DEBUG
+ ErrorF("xf86RegisterRootWindowProperty(%d, %d, %d, %d, %d, %p)\n",
+ ScrnIndex, property, type, format, len, value);
+#endif
+
+ if (ScrnIndex<0 || ScrnIndex>=xf86NumScreens) {
+ return(BadMatch);
+ }
+
+ if ( (pNewProp = (PropertyPtr)xalloc(sizeof(PropertyRec)))==NULL ) {
+ return(BadAlloc);
+ }
+
+ pNewProp->propertyName = property;
+ pNewProp->type = type;
+ pNewProp->format = format;
+ pNewProp->size = len;
+ pNewProp->data = value;
+ /* We will put this property at the end of the list so that
+ * the changes are made in the order they were requested.
+ */
+ pNewProp->next = NULL;
+
+#ifdef DEBUG
+ ErrorF("new property filled\n");
+#endif
+
+ if (NULL==xf86RegisteredPropertiesTable) {
+#ifdef DEBUG
+ ErrorF("creating xf86RegisteredPropertiesTable[] size %d\n",
+ xf86NumScreens);
+#endif
+ if ( NULL==(xf86RegisteredPropertiesTable=(PropertyPtr*)xnfcalloc(sizeof(PropertyPtr),xf86NumScreens) )) {
+ return(BadAlloc);
+ }
+ for (i=0; i<xf86NumScreens; i++) {
+ xf86RegisteredPropertiesTable[i] = NULL;
+ }
+ }
+
+#ifdef DEBUG
+ ErrorF("xf86RegisteredPropertiesTable %p\n",
+ xf86RegisteredPropertiesTable);
+ ErrorF("xf86RegisteredPropertiesTable[%d] %p\n",
+ ScrnIndex, xf86RegisteredPropertiesTable[ScrnIndex]);
+#endif
+
+ if ( xf86RegisteredPropertiesTable[ScrnIndex] == NULL) {
+ xf86RegisteredPropertiesTable[ScrnIndex] = pNewProp;
+ } else {
+ pRegProp = xf86RegisteredPropertiesTable[ScrnIndex];
+ while (pRegProp->next != NULL) {
+#ifdef DEBUG
+ ErrorF("- next %p\n", pRegProp);
+#endif
+ pRegProp = pRegProp->next;
+ }
+ pRegProp->next = pNewProp;
+ }
+#ifdef DEBUG
+ ErrorF("xf86RegisterRootWindowProperty succeeded\n");
+#endif
+ return(Success);
+}
+
+Bool
+xf86IsUnblank(int mode)
+{
+ switch(mode) {
+ case SCREEN_SAVER_OFF:
+ case SCREEN_SAVER_FORCER:
+ return TRUE;
+ case SCREEN_SAVER_ON:
+ case SCREEN_SAVER_CYCLE:
+ return FALSE;
+ default:
+ xf86MsgVerb(X_WARNING, 0, "Unexpected save screen mode: %d\n", mode);
+ return TRUE;
+ }
+}
diff --git a/hw/xfree86/common/xf86InPriv.h b/hw/xfree86/common/xf86InPriv.h
new file mode 100644
index 000000000..5cd66d882
--- /dev/null
+++ b/hw/xfree86/common/xf86InPriv.h
@@ -0,0 +1,17 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86InPriv.h,v 1.4 1999/05/17 13:17:14 dawes Exp $ */
+
+#ifndef _xf86InPriv_h
+#define _xf86InPriv_h
+
+/* xf86Globals.c */
+#ifdef XFree86LOADER
+extern InputDriverPtr *xf86InputDriverList;
+#else
+extern InputDriverPtr xf86InputDriverList[];
+#endif
+extern int xf86NumInputDrivers;
+
+/* xf86Xinput.c */
+void xf86ActivateDevice(InputInfoPtr pInfo);
+
+#endif /* _xf86InPriv_h */
diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c
new file mode 100644
index 000000000..f04a0b8d8
--- /dev/null
+++ b/hw/xfree86/common/xf86MiscExt.c
@@ -0,0 +1,612 @@
+/*
+ * Copyright (c) 1999 by The XFree86 Project, Inc.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.11 2002/11/20 04:04:57 dawes Exp $ */
+
+/*
+ * This file contains the Pointer/Keyboard functions needed by the
+ * XFree86-Misc extension.
+ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#ifdef XF86MISC
+#define _XF86MISC_SERVER_
+#include "xf86misc.h"
+#include "xf86miscproc.h"
+#endif
+
+#define XF86_OS_PRIVS
+#include "xf86_OSlib.h"
+
+#ifdef XINPUT
+#include "XI.h"
+#include "XIproto.h"
+#include "xf86Xinput.h"
+#else
+#include "inputstr.h"
+#endif
+
+#include "xf86OSmouse.h"
+#include "../input/mouse/mouse.h"
+
+#ifdef DEBUG
+# define DEBUG_P(x) ErrorF(x"\n");
+#else
+# define DEBUG_P(x) /**/
+#endif
+
+#ifdef XF86MISC
+
+typedef struct {
+ int type;
+ int baudrate;
+ int samplerate;
+ int resolution;
+ int buttons;
+ Bool em3buttons;
+ int em3timeout;
+ Bool chordmiddle;
+ int flags;
+ char* device;
+ pointer private;
+} mseParamsRec, *mseParamsPtr;
+
+typedef struct {
+ int type;
+ int rate;
+ int delay;
+ int serverNumLock; /* obsolete */
+} kbdParamsRec, *kbdParamsPtr;
+
+typedef enum {
+ TO_MISC,
+ FROM_MISC
+} MseProtoMapDirection;
+
+static void MiscExtClientStateCallback(pointer, pointer, pointer);
+
+/*
+ Sigh...
+
+ The extension should probably be changed to use protocol
+ names instead of ID numbers
+*/
+struct mouse_map {
+ int mtype;
+ MouseProtocolID proto;
+};
+
+static int
+MapMseProto(int proto, MseProtoMapDirection mapping)
+{
+ int i;
+
+ static struct mouse_map m_map[] =
+ {
+ { MTYPE_MICROSOFT, PROT_MS },
+ { MTYPE_MOUSESYS, PROT_MSC },
+ { MTYPE_MMSERIES, PROT_MM },
+ { MTYPE_LOGITECH, PROT_LOGI },
+ { MTYPE_LOGIMAN, PROT_LOGIMAN },
+ { MTYPE_MMHIT, PROT_MMHIT },
+ { MTYPE_GLIDEPOINT, PROT_GLIDE },
+ { MTYPE_IMSERIAL, PROT_IMSERIAL },
+ { MTYPE_THINKING, PROT_THINKING },
+ { MTYPE_ACECAD, PROT_ACECAD },
+ { MTYPE_PS_2, PROT_PS2 },
+ { MTYPE_IMPS2, PROT_IMPS2 },
+ { MTYPE_EXPPS2, PROT_EXPPS2 },
+ { MTYPE_THINKINGPS2, PROT_THINKPS2 },
+ { MTYPE_MMANPLUSPS2, PROT_MMPS2 },
+ { MTYPE_GLIDEPOINTPS2, PROT_GLIDEPS2 },
+ { MTYPE_NETPS2, PROT_NETPS2 },
+ { MTYPE_NETSCROLLPS2, PROT_NETSCPS2 },
+ { MTYPE_BUSMOUSE, PROT_BM },
+ { MTYPE_AUTOMOUSE, PROT_AUTO },
+ { MTYPE_SYSMOUSE, PROT_SYSMOUSE },
+ { MTYPE_UNKNOWN, PROT_UNKNOWN }
+ };
+
+ if (mapping == TO_MISC) {
+ for (i = 0; m_map[i].proto != PROT_UNKNOWN; i++)
+ if (proto == m_map[i].proto) return m_map[i].mtype;
+ return MTYPE_UNKNOWN;
+ } else {
+ for (i = 0; m_map[i].mtype != MTYPE_UNKNOWN; i++)
+ if (proto == m_map[i].mtype) return m_map[i].proto;
+ return PROT_UNKNOWN;
+ }
+}
+
+Bool
+MiscExtGetMouseSettings(pointer *mouse, char **devname)
+{
+ mseParamsPtr mseptr;
+
+ DEBUG_P("MiscExtGetMouseSettings");
+
+ mseptr = MiscExtCreateStruct(MISC_POINTER);
+ if (!mseptr)
+ return FALSE;
+
+ {
+ InputInfoPtr pInfo = mseptr->private;
+ MouseDevPtr pMse;
+
+ *devname = xf86FindOptionValue(pInfo->options, "Device");
+ pMse = pInfo->private;
+
+ mseptr->type = MapMseProto(pMse->protocolID, TO_MISC);
+ mseptr->baudrate = pMse->baudRate;
+ mseptr->samplerate = pMse->sampleRate;
+ mseptr->resolution = pMse->resolution;
+ mseptr->buttons = pMse->buttons;
+ mseptr->em3buttons = pMse->emulate3Buttons;
+ mseptr->em3timeout = pMse->emulate3Timeout;
+ mseptr->chordmiddle = pMse->chordMiddle;
+ mseptr->flags = pMse->mouseFlags;
+ }
+ *mouse = mseptr;
+ return TRUE;
+}
+
+int
+MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype)
+{
+ mseParamsPtr mse = mouse;
+
+ DEBUG_P("MiscExtGetMouseValue");
+
+ switch (valtype) {
+ case MISC_MSE_PROTO: return mse->type;
+ case MISC_MSE_BAUDRATE: return mse->baudrate;
+ case MISC_MSE_SAMPLERATE: return mse->samplerate;
+ case MISC_MSE_RESOLUTION: return mse->resolution;
+ case MISC_MSE_BUTTONS: return mse->buttons;
+ case MISC_MSE_EM3BUTTONS: return mse->em3buttons;
+ case MISC_MSE_EM3TIMEOUT: return mse->em3timeout;
+ case MISC_MSE_CHORDMIDDLE: return mse->chordmiddle;
+ case MISC_MSE_FLAGS: return mse->flags;
+ }
+ return 0;
+}
+
+Bool
+MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value)
+{
+ mseParamsPtr mse = mouse;
+
+ DEBUG_P("MiscExtSetMouseValue");
+
+ switch (valtype) {
+ case MISC_MSE_PROTO:
+ mse->type = value;
+ return TRUE;
+ case MISC_MSE_BAUDRATE:
+ mse->baudrate = value;
+ return TRUE;
+ case MISC_MSE_SAMPLERATE:
+ mse->samplerate = value;
+ return TRUE;
+ case MISC_MSE_RESOLUTION:
+ mse->resolution = value;
+ return TRUE;
+ case MISC_MSE_BUTTONS:
+ mse->buttons = value;
+ return TRUE;
+ case MISC_MSE_EM3BUTTONS:
+ mse->em3buttons = value;
+ return TRUE;
+ case MISC_MSE_EM3TIMEOUT:
+ mse->em3timeout = value;
+ return TRUE;
+ case MISC_MSE_CHORDMIDDLE:
+ mse->chordmiddle = value;
+ return TRUE;
+ case MISC_MSE_FLAGS:
+ mse->flags = value;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+Bool
+MiscExtSetMouseDevice(pointer mouse, char* device)
+{
+ mseParamsPtr mse = mouse;
+
+ mse->device = device;
+
+ return TRUE;
+}
+
+Bool
+MiscExtGetKbdSettings(pointer *kbd)
+{
+ kbdParamsPtr kbdptr;
+
+ DEBUG_P("MiscExtGetKbdSettings");
+
+ kbdptr = MiscExtCreateStruct(MISC_KEYBOARD);
+ if (!kbdptr)
+ return FALSE;
+ kbdptr->type = xf86Info.kbdType;
+ kbdptr->rate = xf86Info.kbdRate;
+ kbdptr->delay = xf86Info.kbdDelay;
+ *kbd = kbdptr;
+ return TRUE;
+}
+
+int
+MiscExtGetKbdValue(pointer keyboard, MiscExtKbdValType valtype)
+{
+ kbdParamsPtr kbd = keyboard;
+
+ DEBUG_P("MiscExtGetKbdValue");
+ switch (valtype) {
+ case MISC_KBD_TYPE: return kbd->type;
+ case MISC_KBD_RATE: return kbd->rate;
+ case MISC_KBD_DELAY: return kbd->delay;
+ case MISC_KBD_SERVNUMLOCK: return 0;
+ }
+ return 0;
+}
+
+Bool
+MiscExtSetKbdValue(pointer keyboard, MiscExtKbdValType valtype, int value)
+{
+ kbdParamsPtr kbd = keyboard;
+
+ DEBUG_P("MiscExtSetKbdValue");
+ switch (valtype) {
+ case MISC_KBD_TYPE:
+ kbd->type = value;
+ return TRUE;
+ case MISC_KBD_RATE:
+ kbd->rate = value;
+ return TRUE;
+ case MISC_KBD_DELAY:
+ kbd->delay = value;
+ return TRUE;
+ case MISC_KBD_SERVNUMLOCK:
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+MiscExtClientStateCallback(pointer callbacks, pointer data, pointer args)
+{
+ NewClientInfoRec *clientinfo = (NewClientInfoRec*)args;
+
+ if (clientinfo->client == xf86Info.grabInfo.override &&
+ clientinfo->client->clientState == ClientStateGone) {
+ xf86Info.grabInfo.override = NULL;
+ xf86Info.grabInfo.disabled = 0;
+ DeleteCallback(&ClientStateCallback,
+ (CallbackProcPtr)MiscExtClientStateCallback, NULL);
+ }
+}
+
+#define MiscExtGrabStateSuccess 0 /* No errors */
+#define MiscExtGrabStateLocked 1 /* A client already requested that
+ * grabs cannot be removed/killed */
+#define MiscExtGrabStateAlready 2 /* Request for enabling/disabling
+ * grab removeal/kill already done */
+int
+MiscExtSetGrabKeysState(ClientPtr client, int state)
+{
+ DEBUG_P("MiscExtSetGrabKeysState");
+
+ if (xf86Info.grabInfo.override == NULL ||
+ xf86Info.grabInfo.override == client) {
+ if (state == 0 && xf86Info.grabInfo.disabled == 0) {
+ xf86Info.grabInfo.disabled = 1;
+ AddCallback(&ClientStateCallback,
+ (CallbackProcPtr)MiscExtClientStateCallback, NULL);
+ xf86Info.grabInfo.override = client;
+ }
+ else if (state == 1 && xf86Info.grabInfo.disabled == 1) {
+ xf86Info.grabInfo.disabled = 0;
+ DeleteCallback(&ClientStateCallback,
+ (CallbackProcPtr)MiscExtClientStateCallback, NULL);
+ xf86Info.grabInfo.override = NULL;
+ }
+ else
+ return MiscExtGrabStateAlready;
+
+ return MiscExtGrabStateSuccess;
+ }
+
+ return MiscExtGrabStateLocked;
+}
+
+pointer
+MiscExtCreateStruct(MiscExtStructType mse_or_kbd)
+{
+ DEBUG_P("MiscExtCreateStruct");
+
+ switch (mse_or_kbd) {
+ case MISC_POINTER:
+ {
+ mseParamsPtr mseptr;
+ InputInfoPtr pInfo = xf86InputDevs;
+
+ while (pInfo) {
+ if (xf86IsCorePointer(pInfo->dev))
+ break;
+ pInfo = pInfo->next;
+ }
+ if (!pInfo)
+ return NULL;
+
+ mseptr = xcalloc(sizeof(mseParamsRec),1);
+ if (mseptr)
+ mseptr->private = pInfo;
+ return mseptr;
+ }
+ case MISC_KEYBOARD:
+ return xcalloc(sizeof(kbdParamsRec),1);
+ }
+ return 0;
+}
+
+void
+MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd)
+{
+ DEBUG_P("MiscExtDestroyStruct");
+
+ switch (mse_or_kbd) {
+ case MISC_POINTER:
+ case MISC_KEYBOARD:
+ xfree(structure);
+ }
+}
+
+static Bool
+MiscExtAuthorizeDevice(InputInfoPtr pInfo, char *device)
+{
+ Bool authorized = FALSE;
+ char *elem;
+ struct stat dev, dev_list;
+ const char *olddev = xf86FindOptionValue(pInfo->options, "Device");
+
+ if (stat(device,&dev))
+ return FALSE;
+
+ if (!S_ISCHR(dev.st_mode))
+ return FALSE;
+
+ if (!stat(olddev,&dev_list)) {
+ if (dev_list.st_dev == dev.st_dev
+ && dev_list.st_ino == dev.st_ino) {
+ authorized = TRUE;
+ }
+ }
+
+ if (!authorized) {
+ char *path;
+
+ if (!xf86InputDeviceList
+ || (path = strdup(xf86InputDeviceList)) == NULL)
+ return FALSE;
+
+ elem = strtok(path,",");
+
+ while (elem) {
+
+ if (!stat(elem,&dev_list)) {
+ if (dev_list.st_dev == dev.st_dev
+ && dev_list.st_ino == dev.st_ino) {
+ authorized = TRUE;
+ break;
+
+ }
+ }
+ elem = strtok(NULL,",");
+ }
+ xfree(path);
+ }
+#if 0
+ ErrorF("AUTHORIZED: %s\n",authorized?"Yes":"No");
+#endif
+ return (authorized);
+}
+
+MiscExtReturn
+MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
+{
+ DEBUG_P("MiscExtApply");
+
+ if (mse_or_kbd == MISC_POINTER) {
+ Bool protoChanged = FALSE;
+ int oldflags;
+ Bool reopen = FALSE;
+ mseParamsPtr mse = structure;
+ InputInfoPtr pInfo;
+ MouseDevPtr pMse;
+#ifdef XFree86LOADER
+ pointer xf86MouseProtocolIDToName
+ = LoaderSymbol("xf86MouseProtocolIDToName");
+ if (!xf86MouseProtocolIDToName)
+ return MISC_RET_NOMODULE;
+#endif
+ if (mse->type < MTYPE_MICROSOFT
+ || ( mse->type > MTYPE_EXPPS2
+ && (mse->type!=MTYPE_OSMOUSE && mse->type!=MTYPE_XQUEUE)))
+ return MISC_RET_BADMSEPROTO;
+#ifdef OSMOUSE_ONLY
+ if (mse->type != MTYPE_OSMOUSE)
+ return MISC_RET_BADMSEPROTO;
+#else
+ if (mse->type == MTYPE_XQUEUE)
+ return MISC_RET_BADMSEPROTO;
+ if (mse->type == MTYPE_OSMOUSE)
+ return MISC_RET_BADMSEPROTO;
+#endif /* OSMOUSE_ONLY */
+
+ if (mse->em3timeout < 0)
+ return MISC_RET_BADVAL;
+
+ if (mse->type == MTYPE_LOGIMAN
+ && !(mse->baudrate == 0
+ || mse->baudrate == 1200
+ || mse->baudrate == 9600))
+ return MISC_RET_BADBAUDRATE;
+ if (mse->type == MTYPE_LOGIMAN && mse->samplerate)
+ return MISC_RET_BADCOMBO;
+
+ if (mse->flags & MF_REOPEN) {
+ reopen = TRUE;
+ mse->flags &= ~MF_REOPEN;
+ }
+ if (mse->type != MTYPE_OSMOUSE
+ && mse->type != MTYPE_XQUEUE
+ && mse->type != MTYPE_PS_2
+ && mse->type != MTYPE_BUSMOUSE
+ && mse->type != MTYPE_IMPS2
+ && mse->type != MTYPE_THINKINGPS2
+ && mse->type != MTYPE_MMANPLUSPS2
+ && mse->type != MTYPE_GLIDEPOINTPS2
+ && mse->type != MTYPE_NETPS2
+ && mse->type != MTYPE_NETSCROLLPS2
+ && mse->type != MTYPE_SYSMOUSE)
+ {
+ if (mse->baudrate % 1200 != 0
+ || (mse->baudrate != 0 && mse->baudrate < 1200)
+ || mse->baudrate > 9600)
+ return MISC_RET_BADBAUDRATE;
+ }
+ if ((mse->flags & (MF_CLEAR_DTR|MF_CLEAR_RTS))
+ && (mse->type != MTYPE_MOUSESYS))
+ return MISC_RET_BADFLAGS;
+
+ if (mse->type != MTYPE_OSMOUSE
+ && mse->type != MTYPE_XQUEUE
+ && mse->type != MTYPE_BUSMOUSE)
+ {
+ if (mse->samplerate < 0)
+ return MISC_RET_BADVAL;
+ }
+
+ if (mse->resolution < 0)
+ return MISC_RET_BADVAL;
+ if (mse->chordmiddle)
+ {
+ if (mse->em3buttons || !(mse->type == MTYPE_MICROSOFT
+ || mse->type == MTYPE_LOGIMAN) )
+ return MISC_RET_BADCOMBO;
+ }
+
+ /* XXX - This still needs work */
+
+ pInfo = mse->private;
+ pMse = pInfo->private;
+ oldflags = pMse->mouseFlags;
+
+ protoChanged = pMse->protocolID != MapMseProto(mse->type, FROM_MISC);
+ if (protoChanged
+ || pMse->baudRate != mse->baudrate
+ || pMse->sampleRate != mse->samplerate
+ || pMse->resolution != mse->resolution
+ || pMse->mouseFlags != mse->flags)
+ reopen = TRUE;
+
+ if (mse->device)
+ reopen = TRUE;
+
+ if (reopen)
+ (pMse->device->deviceProc)(pMse->device, DEVICE_CLOSE);
+
+ pMse->protocolID = MapMseProto(mse->type, FROM_MISC);
+ pMse->baudRate = mse->baudrate;
+ pMse->sampleRate = mse->samplerate;
+ pMse->resolution = mse->resolution;
+ pMse->buttons = mse->buttons;
+ pMse->emulate3Buttons = mse->em3buttons;
+ pMse->emulate3Timeout = mse->em3timeout;
+ pMse->chordMiddle = mse->chordmiddle;
+ pMse->mouseFlags = mse->flags;
+
+#ifdef XFree86LOADER
+ pMse->protocol = ((const char *(*)(MouseProtocolID))
+ xf86MouseProtocolIDToName)(pMse->protocolID);
+#else
+ pMse->protocol = xf86MouseProtocolIDToName(pMse->protocolID);
+#endif
+
+ if (mse->device) {
+ if (MiscExtAuthorizeDevice(pInfo, mse->device)) {
+ xf86ReplaceStrOption(pInfo->options, "Device", mse->device);
+ } else {
+ return MISC_RET_BADVAL;
+ }
+ }
+
+ if (reopen) {
+ /* Only if protocol is changed explicitely disable auto detect */
+ if (protoChanged)
+ pMse->autoProbe = FALSE;
+ (pMse->device->deviceProc)(pMse->device, DEVICE_ON);
+ }
+ /* Set pInfo->options too */
+
+ if ((oldflags & MF_CLEAR_DTR) != (pMse->mouseFlags & MF_CLEAR_DTR))
+ xf86ReplaceBoolOption(pInfo->options, "ClearDTR",
+ pMse->mouseFlags | MF_CLEAR_DTR);
+ if ((oldflags & MF_CLEAR_RTS) != (pMse->mouseFlags & MF_CLEAR_RTS))
+ xf86ReplaceBoolOption(pInfo->options, "ClearRTS",
+ pMse->mouseFlags | MF_CLEAR_RTS);
+ }
+ if (mse_or_kbd == MISC_KEYBOARD) {
+ kbdParamsPtr kbd = structure;
+
+ if (kbd->rate < 0)
+ return MISC_RET_BADVAL;
+ if (kbd->delay < 0)
+ return MISC_RET_BADVAL;
+ if (kbd->type < KTYPE_UNKNOWN || kbd->type > KTYPE_XQUEUE)
+ return MISC_RET_BADKBDTYPE;
+
+ if (xf86Info.kbdRate!=kbd->rate || xf86Info.kbdDelay!=kbd->delay) {
+ char rad;
+
+ xf86Info.kbdRate = kbd->rate;
+ xf86Info.kbdDelay = kbd->delay;
+ if (xf86Info.kbdDelay <= 375) rad = 0x00;
+ else if (xf86Info.kbdDelay <= 625) rad = 0x20;
+ else if (xf86Info.kbdDelay <= 875) rad = 0x40;
+ else rad = 0x60;
+
+ if (xf86Info.kbdRate <= 2) rad |= 0x1F;
+ else if (xf86Info.kbdRate >= 30) rad |= 0x00;
+ else rad |= ((58/xf86Info.kbdRate)-2);
+
+ xf86SetKbdRepeat(rad);
+ }
+#if 0 /* Not done yet */
+ xf86Info.kbdType = kbd->kbdtype;
+#endif
+ }
+ return MISC_RET_SUCCESS;
+}
+
+Bool
+MiscExtGetFilePaths(const char **configfile, const char **modulepath,
+ const char **logfile)
+{
+ DEBUG_P("MiscExtGetFilePaths");
+
+ *configfile = xf86ConfigFile;
+ *modulepath = xf86ModulePath;
+ *logfile = xf86LogFile;
+
+ return TRUE;
+}
+
+#endif /* XF86MISC */
+
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
new file mode 100644
index 000000000..ba73921e4
--- /dev/null
+++ b/hw/xfree86/common/xf86Mode.c
@@ -0,0 +1,1999 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.63.2.1 2003/04/08 20:51:27 tsi Exp $ */
+
+/*
+ * Copyright (c) 1997,1998 by The XFree86 Project, Inc.
+ *
+ * Authors: Dirk Hohndel <hohndel@XFree86.Org>
+ * David Dawes <dawes@XFree86.Org>
+ *
+ * This file includes helper functions for mode related things.
+ */
+
+#include "X.h"
+#include "os.h"
+#include "servermd.h"
+#include "mibank.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86DDC.h"
+
+/*
+ * xf86GetNearestClock --
+ * Find closest clock to given frequency (in kHz). This assumes the
+ * number of clocks is greater than zero.
+ */
+int
+xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
+ int DivFactor, int MulFactor, int *divider)
+{
+ int nearestClock = 0, nearestDiv = 1;
+ int minimumGap = abs(freq - scrp->clock[0]);
+ int i, j, k, gap;
+
+ if (allowDiv2)
+ k = 2;
+ else
+ k = 1;
+
+ /* Must set this here in case the best match is scrp->clock[0] */
+ if (divider != NULL)
+ *divider = 0;
+
+ for (i = 0; i < scrp->numClocks; i++) {
+ for (j = 1; j <= k; j++) {
+ gap = abs((freq * j) - ((scrp->clock[i] * DivFactor) / MulFactor));
+ if ((gap < minimumGap) ||
+ ((gap == minimumGap) && (j < nearestDiv))) {
+ minimumGap = gap;
+ nearestClock = i;
+ nearestDiv = j;
+ if (divider != NULL)
+ *divider = (j - 1) * V_CLKDIV2;
+ }
+ }
+ }
+ return nearestClock;
+}
+
+/*
+ * xf86ModeStatusToString
+ *
+ * Convert a ModeStatus value to a printable message
+ */
+
+const char *
+xf86ModeStatusToString(ModeStatus status)
+{
+ switch (status) {
+ case MODE_OK:
+ return "Mode OK";
+ case MODE_HSYNC:
+ return "hsync out of range";
+ case MODE_VSYNC:
+ return "vrefresh out of range";
+ case MODE_H_ILLEGAL:
+ return "illegal horizontal timings";
+ case MODE_V_ILLEGAL:
+ return "illegal vertical timings";
+ case MODE_BAD_WIDTH:
+ return "width requires unsupported line pitch";
+ case MODE_NOMODE:
+ return "no mode of this name";
+ case MODE_NO_INTERLACE:
+ return "interlace mode not supported";
+ case MODE_NO_DBLESCAN:
+ return "doublescan mode not supported";
+ case MODE_NO_VSCAN:
+ return "multiscan mode not supported";
+ case MODE_MEM:
+ return "insufficient memory for mode";
+ case MODE_VIRTUAL_X:
+ return "width too large for virtual size";
+ case MODE_VIRTUAL_Y:
+ return "height too large for virtual size";
+ case MODE_MEM_VIRT:
+ return "insufficient memory given virtual size";
+ case MODE_NOCLOCK:
+ return "no clock available for mode";
+ case MODE_CLOCK_HIGH:
+ return "mode clock too high";
+ case MODE_CLOCK_LOW:
+ return "mode clock too low";
+ case MODE_CLOCK_RANGE:
+ return "bad mode clock/interlace/doublescan";
+ case MODE_BAD_HVALUE:
+ return "horizontal timing out of range";
+ case MODE_BAD_VVALUE:
+ return "vertical timing out of range";
+ case MODE_BAD_VSCAN:
+ return "VScan value out of range";
+ case MODE_HSYNC_NARROW:
+ return "horizontal sync too narrow";
+ case MODE_HSYNC_WIDE:
+ return "horizontal sync too wide";
+ case MODE_HBLANK_NARROW:
+ return "horizontal blanking too narrow";
+ case MODE_HBLANK_WIDE:
+ return "horizontal blanking too wide";
+ case MODE_VSYNC_NARROW:
+ return "vertical sync too narrow";
+ case MODE_VSYNC_WIDE:
+ return "vertical sync too wide";
+ case MODE_VBLANK_NARROW:
+ return "vertical blanking too narrow";
+ case MODE_VBLANK_WIDE:
+ return "vertical blanking too wide";
+ case MODE_PANEL:
+ return "exceeds panel dimensions";
+ case MODE_INTERLACE_WIDTH:
+ return "width too large for interlaced mode";
+ case MODE_ONE_WIDTH:
+ return "all modes must have the same width";
+ case MODE_ONE_HEIGHT:
+ return "all modes must have the same height";
+ case MODE_ONE_SIZE:
+ return "all modes must have the same resolution";
+ case MODE_BAD:
+ return "unknown reason";
+ case MODE_ERROR:
+ return "internal error";
+ default:
+ return "unknown";
+ }
+}
+
+/*
+ * xf86ShowClockRanges() -- Print the clock ranges allowed
+ * and the clock values scaled by ClockMulFactor and ClockDivFactor
+ */
+void
+xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges)
+{
+ ClockRangePtr cp;
+ int MulFactor = 1;
+ int DivFactor = 1;
+ int i, j;
+ int scaledClock;
+
+ for (cp = clockRanges; cp != NULL; cp = cp->next) {
+ DivFactor = max(1, cp->ClockDivFactor);
+ MulFactor = max(1, cp->ClockMulFactor);
+ if (scrp->progClock) {
+ if (cp->minClock) {
+ if (cp->maxClock) {
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Clock range: %6.2f to %6.2f MHz\n",
+ (double)cp->minClock / 1000.0,
+ (double)cp->maxClock / 1000.0);
+ } else {
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Minimum clock: %6.2f MHz\n",
+ (double)cp->minClock / 1000.0);
+ }
+ } else {
+ if (cp->maxClock) {
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Maximum clock: %6.2f MHz\n",
+ (double)cp->maxClock / 1000.0);
+ }
+ }
+ } else if (DivFactor > 1 || MulFactor > 1) {
+ j = 0;
+ for (i = 0; i < scrp->numClocks; i++) {
+ scaledClock = (scrp->clock[i] * DivFactor) / MulFactor;
+ if (scaledClock >= cp->minClock && scaledClock <= cp->maxClock) {
+ if ((j % 8) == 0) {
+ if (j > 0)
+ xf86ErrorF("\n");
+ xf86DrvMsg(scrp->scrnIndex, X_INFO, "scaled clocks:");
+ }
+ xf86ErrorF(" %6.2f", (double)scaledClock / 1000.0);
+ j++;
+ }
+ }
+ xf86ErrorF("\n");
+ }
+ }
+}
+
+
+/*
+ * xf86FindClockRangeForMode() [... like the name says ...]
+ */
+static ClockRangePtr
+xf86FindClockRangeForMode(ClockRangePtr clockRanges, DisplayModePtr p)
+{
+ ClockRangePtr cp;
+
+ for (cp = clockRanges; ; cp = cp->next)
+ if (!cp ||
+ ((p->Clock >= cp->minClock) &&
+ (p->Clock <= cp->maxClock) &&
+ (cp->interlaceAllowed || !(p->Flags & V_INTERLACE)) &&
+ (cp->doubleScanAllowed ||
+ ((p->VScan <= 1) && !(p->Flags & V_DBLSCAN)))))
+ return cp;
+}
+
+
+/*
+ * xf86HandleBuiltinMode() - handles built-in modes
+ */
+static ModeStatus
+xf86HandleBuiltinMode(ScrnInfoPtr scrp,
+ DisplayModePtr p,
+ DisplayModePtr modep,
+ ClockRangePtr clockRanges,
+ Bool allowDiv2)
+{
+ ClockRangePtr cp;
+ int extraFlags = 0;
+ int MulFactor = 1;
+ int DivFactor = 1;
+ int clockIndex;
+
+ /* Reject previously rejected modes */
+ if (p->status != MODE_OK)
+ return p->status;
+
+ /* Reject previously considered modes */
+ if (p->prev)
+ return MODE_NOMODE;
+
+ if ((p->type & M_T_CLOCK_C) == M_T_CLOCK_C) {
+ /* Check clock is in range */
+ cp = xf86FindClockRangeForMode(clockRanges, p);
+ if (cp == NULL){
+ modep->type = p->type;
+ p->status = MODE_CLOCK_RANGE;
+ return MODE_CLOCK_RANGE;
+ }
+ DivFactor = cp->ClockDivFactor;
+ MulFactor = cp->ClockMulFactor;
+ if (!scrp->progClock) {
+ clockIndex = xf86GetNearestClock(scrp, p->Clock, allowDiv2,
+ cp->ClockDivFactor,
+ cp->ClockMulFactor, &extraFlags);
+ modep->Clock = (scrp->clock[clockIndex] * DivFactor)
+ / MulFactor;
+ modep->ClockIndex = clockIndex;
+ modep->SynthClock = scrp->clock[clockIndex];
+ if (extraFlags & V_CLKDIV2) {
+ modep->Clock /= 2;
+ modep->SynthClock /= 2;
+ }
+ } else {
+ modep->Clock = p->Clock;
+ modep->ClockIndex = -1;
+ modep->SynthClock = (modep->Clock * MulFactor)
+ / DivFactor;
+ }
+ modep->PrivFlags = cp->PrivFlags;
+ } else {
+ if(!scrp->progClock) {
+ modep->Clock = p->Clock;
+ modep->ClockIndex = p->ClockIndex;
+ modep->SynthClock = p->SynthClock;
+ } else {
+ modep->Clock = p->Clock;
+ modep->ClockIndex = -1;
+ modep->SynthClock = p->SynthClock;
+ }
+ modep->PrivFlags = p->PrivFlags;
+ }
+ modep->type = p->type;
+ modep->HDisplay = p->HDisplay;
+ modep->HSyncStart = p->HSyncStart;
+ modep->HSyncEnd = p->HSyncEnd;
+ modep->HTotal = p->HTotal;
+ modep->HSkew = p->HSkew;
+ modep->VDisplay = p->VDisplay;
+ modep->VSyncStart = p->VSyncStart;
+ modep->VSyncEnd = p->VSyncEnd;
+ modep->VTotal = p->VTotal;
+ modep->VScan = p->VScan;
+ modep->Flags = p->Flags | extraFlags;
+ modep->CrtcHDisplay = p->CrtcHDisplay;
+ modep->CrtcHBlankStart = p->CrtcHBlankStart;
+ modep->CrtcHSyncStart = p->CrtcHSyncStart;
+ modep->CrtcHSyncEnd = p->CrtcHSyncEnd;
+ modep->CrtcHBlankEnd = p->CrtcHBlankEnd;
+ modep->CrtcHTotal = p->CrtcHTotal;
+ modep->CrtcHSkew = p->CrtcHSkew;
+ modep->CrtcVDisplay = p->CrtcVDisplay;
+ modep->CrtcVBlankStart = p->CrtcVBlankStart;
+ modep->CrtcVSyncStart = p->CrtcVSyncStart;
+ modep->CrtcVSyncEnd = p->CrtcVSyncEnd;
+ modep->CrtcVBlankEnd = p->CrtcVBlankEnd;
+ modep->CrtcVTotal = p->CrtcVTotal;
+ modep->CrtcHAdjusted = p->CrtcHAdjusted;
+ modep->CrtcVAdjusted = p->CrtcVAdjusted;
+ modep->HSync = p->HSync;
+ modep->VRefresh = p->VRefresh;
+ modep->Private = p->Private;
+ modep->PrivSize = p->PrivSize;
+
+ p->prev = modep;
+
+ return MODE_OK;
+}
+
+/*
+ * xf86LookupMode
+ *
+ * This function returns a mode from the given list which matches the
+ * given name. When multiple modes with the same name are available,
+ * the method of picking the matching mode is determined by the
+ * strategy selected.
+ *
+ * This function takes the following parameters:
+ * scrp ScrnInfoPtr
+ * modep pointer to the returned mode, which must have the name
+ * field filled in.
+ * clockRanges a list of clock ranges. This is optional when all the
+ * modes are built-in modes.
+ * strategy how to decide which mode to use from multiple modes with
+ * the same name
+ *
+ * In addition, the following fields from the ScrnInfoRec are used:
+ * modePool the list of monitor modes compatible with the driver
+ * clocks a list of discrete clocks
+ * numClocks number of discrete clocks
+ * progClock clock is programmable
+ *
+ * If a mode was found, its values are filled in to the area pointed to
+ * by modep, If a mode was not found the return value indicates the
+ * reason.
+ */
+
+ModeStatus
+xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
+ ClockRangePtr clockRanges, LookupModeFlags strategy)
+{
+ DisplayModePtr p, bestMode = NULL;
+ ClockRangePtr cp;
+ int i, k, gap, minimumGap = CLOCK_TOLERANCE + 1;
+ double refresh, bestRefresh = 0.0;
+ Bool found = FALSE;
+ int extraFlags = 0;
+ int clockIndex = -1;
+ int MulFactor = 1;
+ int DivFactor = 1;
+ int ModePrivFlags = 0;
+ ModeStatus status = MODE_NOMODE;
+ Bool allowDiv2 = (strategy & LOOKUP_CLKDIV2) != 0;
+ Bool haveBuiltin;
+
+ strategy &= ~(LOOKUP_CLKDIV2 | LOOKUP_OPTIONAL_TOLERANCES);
+
+ /* Some sanity checking */
+ if (scrp == NULL || scrp->modePool == NULL ||
+ (!scrp->progClock && scrp->numClocks == 0)) {
+ ErrorF("xf86LookupMode: called with invalid scrnInfoRec\n");
+ return MODE_ERROR;
+ }
+ if (modep == NULL || modep->name == NULL) {
+ ErrorF("xf86LookupMode: called with invalid modep\n");
+ return MODE_ERROR;
+ }
+ for (cp = clockRanges; cp != NULL; cp = cp->next) {
+ /* DivFactor and MulFactor must be > 0 */
+ cp->ClockDivFactor = max(1, cp->ClockDivFactor);
+ cp->ClockMulFactor = max(1, cp->ClockMulFactor);
+ }
+
+ haveBuiltin = FALSE;
+ /* Scan the mode pool for matching names */
+ for (p = scrp->modePool; p != NULL; p = p->next) {
+ if (strcmp(p->name, modep->name) == 0) {
+ /*
+ * Requested mode is a built-in mode. Don't let the user
+ * override it.
+ * Since built-in modes always come before user specified
+ * modes it will always be found first.
+ */
+ if (p->type & M_T_BUILTIN) {
+ haveBuiltin = TRUE;
+ }
+
+ if (haveBuiltin && !(p->type & M_T_BUILTIN))
+ continue;
+
+ /* Skip over previously rejected modes */
+ if (p->status != MODE_OK) {
+ if (!found)
+ status = p->status;
+ continue;
+ }
+
+ /* Skip over previously considered modes */
+ if (p->prev)
+ continue;
+
+ if (p->type & M_T_BUILTIN) {
+ return xf86HandleBuiltinMode(scrp, p,modep, clockRanges,
+ allowDiv2);
+ }
+
+ /* Check clock is in range */
+ cp = xf86FindClockRangeForMode(clockRanges, p);
+ if (cp == NULL) {
+ /*
+ * XXX Could do more here to provide a more detailed
+ * reason for not finding a mode.
+ */
+ p->status = MODE_CLOCK_RANGE;
+ if (!found)
+ status = MODE_CLOCK_RANGE;
+ continue;
+ }
+
+ /*
+ * If programmable clock and strategy is not LOOKUP_BEST_REFRESH,
+ * the required mode has been found, otherwise record the refresh
+ * and continue looking.
+ */
+ if (scrp->progClock) {
+ found = TRUE;
+ if (strategy != LOOKUP_BEST_REFRESH) {
+ bestMode = p;
+ DivFactor = cp->ClockDivFactor;
+ MulFactor = cp->ClockMulFactor;
+ ModePrivFlags = cp->PrivFlags;
+ break;
+ }
+ if (p->VRefresh > 0.0)
+ refresh = p->VRefresh;
+ else {
+ refresh = p->Clock * 1000.0 / p->HTotal / p->VTotal;
+ if (p->Flags & V_INTERLACE)
+ refresh *= 2.0;
+ if (p->Flags & V_DBLSCAN)
+ refresh /= 2.0;
+ if (p->VScan > 1)
+ refresh /= p->VScan;
+ }
+ if (p->Flags & V_INTERLACE)
+ refresh /= INTERLACE_REFRESH_WEIGHT;
+ if (refresh > bestRefresh) {
+ bestMode = p;
+ DivFactor = cp->ClockDivFactor;
+ MulFactor = cp->ClockMulFactor;
+ ModePrivFlags = cp->PrivFlags;
+ bestRefresh = refresh;
+ }
+ continue;
+ }
+
+ /*
+ * Clock is in range, so if it is not a programmable clock, find
+ * a matching clock.
+ */
+
+ i = xf86GetNearestClock(scrp, p->Clock, allowDiv2,
+ cp->ClockDivFactor, cp->ClockMulFactor, &k);
+ /*
+ * If the clock is too far from the requested clock, this
+ * mode is no good.
+ */
+ if (k & V_CLKDIV2)
+ gap = abs((p->Clock * 2) -
+ ((scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor));
+ else
+ gap = abs(p->Clock -
+ ((scrp->clock[i] * cp->ClockDivFactor) / cp->ClockMulFactor));
+ if (gap > minimumGap) {
+ p->status = MODE_NOCLOCK;
+ if (!found)
+ status = MODE_NOCLOCK;
+ continue;
+ }
+ found = TRUE;
+
+ if (strategy == LOOKUP_BEST_REFRESH) {
+ if (p->VRefresh > 0.0)
+ refresh = p->VRefresh;
+ else {
+ refresh = p->Clock * 1000.0 / p->HTotal / p->VTotal;
+ if (p->Flags & V_INTERLACE)
+ refresh *= 2.0;
+ if (p->Flags & V_DBLSCAN)
+ refresh /= 2.0;
+ if (p->VScan > 1)
+ refresh /= p->VScan;
+ }
+ if (p->Flags & V_INTERLACE)
+ refresh /= INTERLACE_REFRESH_WEIGHT;
+ if (refresh > bestRefresh) {
+ bestMode = p;
+ DivFactor = cp->ClockDivFactor;
+ MulFactor = cp->ClockMulFactor;
+ ModePrivFlags = cp->PrivFlags;
+ extraFlags = k;
+ clockIndex = i;
+ bestRefresh = refresh;
+ }
+ continue;
+ }
+ if (strategy == LOOKUP_CLOSEST_CLOCK) {
+ if (gap < minimumGap) {
+ bestMode = p;
+ DivFactor = cp->ClockDivFactor;
+ MulFactor = cp->ClockMulFactor;
+ ModePrivFlags = cp->PrivFlags;
+ extraFlags = k;
+ clockIndex = i;
+ minimumGap = gap;
+ }
+ continue;
+ }
+ /*
+ * If strategy is neither LOOKUP_BEST_REFRESH or
+ * LOOKUP_CLOSEST_CLOCK the required mode has been found.
+ */
+ bestMode = p;
+ DivFactor = cp->ClockDivFactor;
+ MulFactor = cp->ClockMulFactor;
+ ModePrivFlags = cp->PrivFlags;
+ extraFlags = k;
+ clockIndex = i;
+ break;
+ }
+ }
+ if (!found || bestMode == NULL)
+ return status;
+
+ /* Fill in the mode parameters */
+ if (scrp->progClock) {
+ modep->Clock = bestMode->Clock;
+ modep->ClockIndex = -1;
+ modep->SynthClock = (modep->Clock * MulFactor) / DivFactor;
+ } else {
+ modep->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor;
+ modep->ClockIndex = clockIndex;
+ modep->SynthClock = scrp->clock[clockIndex];
+ if (extraFlags & V_CLKDIV2) {
+ modep->Clock /= 2;
+ modep->SynthClock /= 2;
+ }
+ }
+ modep->type = bestMode->type;
+ modep->PrivFlags = ModePrivFlags;
+ modep->HDisplay = bestMode->HDisplay;
+ modep->HSyncStart = bestMode->HSyncStart;
+ modep->HSyncEnd = bestMode->HSyncEnd;
+ modep->HTotal = bestMode->HTotal;
+ modep->HSkew = bestMode->HSkew;
+ modep->VDisplay = bestMode->VDisplay;
+ modep->VSyncStart = bestMode->VSyncStart;
+ modep->VSyncEnd = bestMode->VSyncEnd;
+ modep->VTotal = bestMode->VTotal;
+ modep->VScan = bestMode->VScan;
+ modep->Flags = bestMode->Flags | extraFlags;
+ modep->CrtcHDisplay = bestMode->CrtcHDisplay;
+ modep->CrtcHBlankStart = bestMode->CrtcHBlankStart;
+ modep->CrtcHSyncStart = bestMode->CrtcHSyncStart;
+ modep->CrtcHSyncEnd = bestMode->CrtcHSyncEnd;
+ modep->CrtcHBlankEnd = bestMode->CrtcHBlankEnd;
+ modep->CrtcHTotal = bestMode->CrtcHTotal;
+ modep->CrtcHSkew = bestMode->CrtcHSkew;
+ modep->CrtcVDisplay = bestMode->CrtcVDisplay;
+ modep->CrtcVBlankStart = bestMode->CrtcVBlankStart;
+ modep->CrtcVSyncStart = bestMode->CrtcVSyncStart;
+ modep->CrtcVSyncEnd = bestMode->CrtcVSyncEnd;
+ modep->CrtcVBlankEnd = bestMode->CrtcVBlankEnd;
+ modep->CrtcVTotal = bestMode->CrtcVTotal;
+ modep->CrtcHAdjusted = bestMode->CrtcHAdjusted;
+ modep->CrtcVAdjusted = bestMode->CrtcVAdjusted;
+ modep->HSync = bestMode->HSync;
+ modep->VRefresh = bestMode->VRefresh;
+ modep->Private = bestMode->Private;
+ modep->PrivSize = bestMode->PrivSize;
+
+ bestMode->prev = modep;
+
+ return MODE_OK;
+}
+
+
+/*
+ * xf86SetModeCrtc
+ *
+ * Initialises the Crtc parameters for a mode. The initialisation includes
+ * adjustments for interlaced and double scan modes.
+ */
+static void
+xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
+{
+ if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN))
+ return;
+
+ p->CrtcHDisplay = p->HDisplay;
+ p->CrtcHSyncStart = p->HSyncStart;
+ p->CrtcHSyncEnd = p->HSyncEnd;
+ p->CrtcHTotal = p->HTotal;
+ p->CrtcHSkew = p->HSkew;
+ p->CrtcVDisplay = p->VDisplay;
+ p->CrtcVSyncStart = p->VSyncStart;
+ p->CrtcVSyncEnd = p->VSyncEnd;
+ p->CrtcVTotal = p->VTotal;
+ if ((p->Flags & V_INTERLACE) && (adjustFlags & INTERLACE_HALVE_V))
+ {
+ p->CrtcVDisplay /= 2;
+ p->CrtcVSyncStart /= 2;
+ p->CrtcVSyncEnd /= 2;
+ p->CrtcVTotal /= 2;
+ }
+ if (p->Flags & V_DBLSCAN) {
+ p->CrtcVDisplay *= 2;
+ p->CrtcVSyncStart *= 2;
+ p->CrtcVSyncEnd *= 2;
+ p->CrtcVTotal *= 2;
+ }
+ if (p->VScan > 1) {
+ p->CrtcVDisplay *= p->VScan;
+ p->CrtcVSyncStart *= p->VScan;
+ p->CrtcVSyncEnd *= p->VScan;
+ p->CrtcVTotal *= p->VScan;
+ }
+ p->CrtcHAdjusted = FALSE;
+ p->CrtcVAdjusted = FALSE;
+
+ /*
+ * XXX
+ *
+ * The following is taken from VGA, but applies to other cores as well.
+ */
+ p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay);
+ p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal);
+ if ((p->CrtcVBlankEnd - p->CrtcVBlankStart) >= 127) {
+ /*
+ * V Blanking size must be < 127.
+ * Moving blank start forward is safer than moving blank end
+ * back, since monitors clamp just AFTER the sync pulse (or in
+ * the sync pulse), but never before.
+ */
+ p->CrtcVBlankStart = p->CrtcVBlankEnd - 127;
+ }
+ p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay);
+ p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal);
+ if ((p->CrtcHBlankEnd - p->CrtcHBlankStart) >= 63 * 8) {
+ /*
+ * H Blanking size must be < 63*8. Same remark as above.
+ */
+ p->CrtcHBlankStart = p->CrtcHBlankEnd - 63 * 8;
+ }
+}
+
+/*
+ * xf86CheckModeForMonitor
+ *
+ * This function takes a mode and monitor description, and determines
+ * if the mode is valid for the monitor.
+ */
+ModeStatus
+xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor)
+{
+ int i;
+ float hsync, vrefresh;
+
+ /* Sanity checks */
+ if (mode == NULL || monitor == NULL) {
+ ErrorF("xf86CheckModeForMonitor: called with invalid parameters\n");
+ return MODE_ERROR;
+ }
+
+#ifdef DEBUG
+ ErrorF("xf86CheckModeForMonitor(%p %s, %p %s)\n",
+ mode, mode->name, monitor, monitor->id);
+#endif
+
+ if (monitor->DDC) {
+ xf86MonPtr DDC = (xf86MonPtr)(monitor->DDC);
+ struct detailed_monitor_section* detMon;
+ struct monitor_ranges *mon_range;
+ int i;
+
+ mon_range = NULL;
+ for (i = 0; i < 4; i++) {
+ detMon = &DDC->det_mon[i];
+ if(detMon->type == DS_RANGES) {
+ mon_range = &detMon->section.ranges;
+ }
+ }
+ if (mon_range) {
+ /* mode->Clock in kHz, DDC in MHz */
+ if (mon_range->max_clock < 2550 &&
+ mode->Clock / 1000.0 > mon_range->max_clock) {
+ xf86Msg(X_WARNING,
+ "(%s,%s) mode clock %gMHz exceeds DDC maximum %dMHz\n",
+ mode->name, monitor->id,
+ mode->Clock/1000.0, mon_range->max_clock);
+ }
+ }
+ }
+
+ /* Some basic mode validity checks */
+ if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart ||
+ mode->HSyncStart >= mode->HSyncEnd || mode->HSyncEnd >= mode->HTotal)
+ return MODE_H_ILLEGAL;
+
+ if (0 >= mode->VDisplay || mode->VDisplay > mode->VSyncStart ||
+ mode->VSyncStart >= mode->VSyncEnd || mode->VSyncEnd >= mode->VTotal)
+ return MODE_V_ILLEGAL;
+
+ if (monitor->nHsync > 0) {
+ /* Check hsync against the allowed ranges */
+ hsync = (float)mode->Clock / (float)mode->HTotal;
+ for (i = 0; i < monitor->nHsync; i++)
+ if ((hsync > monitor->hsync[i].lo * (1.0 - SYNC_TOLERANCE)) &&
+ (hsync < monitor->hsync[i].hi * (1.0 + SYNC_TOLERANCE)))
+ break;
+
+ /* Now see whether we ran out of sync ranges without finding a match */
+ if (i == monitor->nHsync)
+ return MODE_HSYNC;
+ }
+
+ if (monitor->nVrefresh > 0) {
+ /* Check vrefresh against the allowed ranges */
+ vrefresh = mode->Clock * 1000.0 / (mode->HTotal * mode->VTotal);
+ if (mode->Flags & V_INTERLACE)
+ vrefresh *= 2.0;
+ if (mode->Flags & V_DBLSCAN)
+ vrefresh /= 2.0;
+ if (mode->VScan > 1)
+ vrefresh /= (float)(mode->VScan);
+ for (i = 0; i < monitor->nVrefresh; i++)
+ if ((vrefresh > monitor->vrefresh[i].lo * (1.0 - SYNC_TOLERANCE)) &&
+ (vrefresh < monitor->vrefresh[i].hi * (1.0 + SYNC_TOLERANCE)))
+ break;
+
+ /* Now see whether we ran out of refresh ranges without finding a match */
+ if (i == monitor->nVrefresh)
+ return MODE_VSYNC;
+ }
+
+ /* Force interlaced modes to have an odd VTotal */
+ if (mode->Flags & V_INTERLACE)
+ mode->CrtcVTotal = mode->VTotal |= 1;
+
+ return MODE_OK;
+}
+
+/*
+ * xf86CheckModeSize
+ *
+ * An internal routine to check if a mode fits in video memory. This tries to
+ * avoid overflows that would otherwise occur when video memory size is greater
+ * than 256MB.
+ */
+static Bool
+xf86CheckModeSize(ScrnInfoPtr scrp, int w, int x, int y)
+{
+ int bpp = scrp->fbFormat.bitsPerPixel,
+ pad = scrp->fbFormat.scanlinePad;
+ int lineWidth, lastWidth;
+
+ if (scrp->depth == 4)
+ pad *= 4; /* 4 planes */
+
+ /* Sanity check */
+ if ((w < 0) || (x < 0) || (y <= 0))
+ return FALSE;
+
+ lineWidth = (((w * bpp) + pad - 1) / pad) * pad;
+ lastWidth = x * bpp;
+
+ /*
+ * At this point, we need to compare
+ *
+ * (lineWidth * (y - 1)) + lastWidth
+ *
+ * against
+ *
+ * scrp->videoRam * (1024 * 8)
+ *
+ * These are bit quantities. To avoid overflows, do the comparison in
+ * terms of BITMAP_SCANLINE_PAD units. This assumes BITMAP_SCANLINE_PAD
+ * is a power of 2. We currently use 32, which limits us to a video
+ * memory size of 8GB.
+ */
+
+ lineWidth = (lineWidth + (BITMAP_SCANLINE_PAD - 1)) / BITMAP_SCANLINE_PAD;
+ lastWidth = (lastWidth + (BITMAP_SCANLINE_PAD - 1)) / BITMAP_SCANLINE_PAD;
+
+ if ((lineWidth * (y - 1) + lastWidth) >
+ (scrp->videoRam * ((1024 * 8) / BITMAP_SCANLINE_PAD)))
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
+ * xf86InitialCheckModeForDriver
+ *
+ * This function checks if a mode satisfies a driver's initial requirements:
+ * - mode size fits within the available pixel area (memory)
+ * - width lies within the range of supported line pitches
+ * - mode size fits within virtual size (if fixed)
+ * - horizontal timings are in range
+ *
+ * This function takes the following parameters:
+ * scrp ScrnInfoPtr
+ * mode mode to check
+ * maxPitch (optional) maximum line pitch
+ * virtualX (optional) virtual width requested
+ * virtualY (optional) virtual height requested
+ *
+ * In addition, the following fields from the ScrnInfoRec are used:
+ * monitor pointer to structure for monitor section
+ * fbFormat pixel format for the framebuffer
+ * videoRam video memory size (in kB)
+ * maxHValue maximum horizontal timing value
+ * maxVValue maximum vertical timing value
+ */
+
+ModeStatus
+xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
+ ClockRangePtr clockRanges,
+ LookupModeFlags strategy,
+ int maxPitch, int virtualX, int virtualY)
+{
+ MonPtr monitor;
+ ClockRangePtr cp;
+ ModeStatus status;
+ Bool allowDiv2 = (strategy & LOOKUP_CLKDIV2) != 0;
+ int i, needDiv2;
+
+ /* Sanity checks */
+ if (!scrp || !mode /*|| !clockRanges*/) {
+ ErrorF("xf86InitialCheckModeForDriver: "
+ "called with invalid parameters\n");
+ return MODE_ERROR;
+ }
+
+#ifdef DEBUG
+ ErrorF("xf86InitialCheckModeForDriver(%p, %p %s, %p, 0x%x, %d, %d, %d)\n",
+ scrp, mode, mode->name , clockRanges, strategy, maxPitch, virtualX, virtualY);
+#endif
+
+ /* Some basic mode validity checks */
+ if (0 >= mode->HDisplay || mode->HDisplay > mode->HSyncStart ||
+ mode->HSyncStart >= mode->HSyncEnd || mode->HSyncEnd >= mode->HTotal)
+ return MODE_H_ILLEGAL;
+
+ if (0 >= mode->VDisplay || mode->VDisplay > mode->VSyncStart ||
+ mode->VSyncStart >= mode->VSyncEnd || mode->VSyncEnd >= mode->VTotal)
+ return MODE_V_ILLEGAL;
+
+ if (!xf86CheckModeSize(scrp, mode->HDisplay, mode->HDisplay,
+ mode->VDisplay))
+ return MODE_MEM;
+
+ if (maxPitch > 0 && mode->HDisplay > maxPitch)
+ return MODE_BAD_WIDTH;
+
+ if (virtualX > 0 && mode->HDisplay > virtualX)
+ return MODE_VIRTUAL_X;
+
+ if (virtualY > 0 && mode->VDisplay > virtualY)
+ return MODE_VIRTUAL_Y;
+
+ if (scrp->maxHValue > 0 && mode->HTotal > scrp->maxHValue)
+ return MODE_BAD_HVALUE;
+
+ if (scrp->maxVValue > 0 && mode->VTotal > scrp->maxVValue)
+ return MODE_BAD_VVALUE;
+
+ /*
+ * The use of the DisplayModeRec's Crtc* and SynthClock elements below is
+ * provisional, in that they are later reused by the driver at mode-set
+ * time. Here, they are temporarily enlisted to contain the mode timings
+ * as seen by the CRT or panel (rather than the CRTC). The driver's
+ * ValidMode() is allowed to modify these so it can deal with such things
+ * as mode stretching and/or centering. The driver should >NOT< modify the
+ * user-supplied values as these are reported back when mode validation is
+ * said and done.
+ */
+ xf86SetModeCrtc(mode, INTERLACE_HALVE_V);
+
+ cp = xf86FindClockRangeForMode(clockRanges, mode);
+ if (!cp)
+ return MODE_CLOCK_RANGE;
+
+ if (cp->ClockMulFactor < 1)
+ cp->ClockMulFactor = 1;
+ if (cp->ClockDivFactor < 1)
+ cp->ClockDivFactor = 1;
+
+ /*
+ * XXX The effect of clock dividers and multipliers on the monitor's
+ * pixel clock needs to be verified.
+ */
+ if (scrp->progClock) {
+ mode->SynthClock = mode->Clock;
+ } else {
+ i = xf86GetNearestClock(scrp, mode->Clock, allowDiv2,
+ cp->ClockDivFactor, cp->ClockMulFactor,
+ &needDiv2);
+ mode->SynthClock = (scrp->clock[i] * cp->ClockDivFactor) /
+ cp->ClockMulFactor;
+ if (needDiv2 & V_CLKDIV2)
+ mode->SynthClock /= 2;
+ }
+
+ if (scrp->ValidMode) {
+ status = (*scrp->ValidMode)(scrp->scrnIndex, mode, FALSE,
+ MODECHECK_INITIAL);
+ if (status != MODE_OK)
+ return status;
+ }
+
+ if (!(monitor = scrp->monitor)) {
+ ErrorF("xf86InitialCheckModeForDriver: "
+ "called with invalid monitor\n");
+ return MODE_ERROR;
+ }
+
+ if (mode->HSync <= 0.0)
+ mode->HSync = (float)mode->SynthClock / (float)mode->CrtcHTotal;
+ if (monitor->nHsync > 0) {
+ /* Check hsync against the allowed ranges */
+ for (i = 0; i < monitor->nHsync; i++)
+ if ((mode->HSync > monitor->hsync[i].lo * (1.0 - SYNC_TOLERANCE)) &&
+ (mode->HSync < monitor->hsync[i].hi * (1.0 + SYNC_TOLERANCE)))
+ break;
+
+ /* Now see whether we ran out of sync ranges without finding a match */
+ if (i == monitor->nHsync)
+ return MODE_HSYNC;
+ }
+
+ if (mode->VRefresh <= 0.0)
+ mode->VRefresh = (mode->SynthClock * 1000.0) /
+ (mode->CrtcHTotal * mode->CrtcVTotal);
+ if (monitor->nVrefresh > 0) {
+ /* Check vrefresh against the allowed ranges */
+ for (i = 0; i < monitor->nVrefresh; i++)
+ if ((mode->VRefresh >
+ monitor->vrefresh[i].lo * (1.0 - SYNC_TOLERANCE)) &&
+ (mode->VRefresh <
+ monitor->vrefresh[i].hi * (1.0 + SYNC_TOLERANCE)))
+ break;
+
+ /* Now see whether we ran out of refresh ranges without finding a match */
+ if (i == monitor->nVrefresh)
+ return MODE_VSYNC;
+ }
+
+ /* Force interlaced modes to have an odd VTotal */
+ if (mode->Flags & V_INTERLACE)
+ mode->CrtcVTotal |= 1;
+
+ /* Assume it is OK */
+ return MODE_OK;
+}
+
+/*
+ * xf86CheckModeForDriver
+ *
+ * This function is for checking modes while the server is running (for
+ * use mainly by the VidMode extension).
+ *
+ * This function checks if a mode satisfies a driver's requirements:
+ * - width lies within the line pitch
+ * - mode size fits within virtual size
+ * - horizontal/vertical timings are in range
+ *
+ * This function takes the following parameters:
+ * scrp ScrnInfoPtr
+ * mode mode to check
+ * flags not (currently) used
+ *
+ * In addition, the following fields from the ScrnInfoRec are used:
+ * maxHValue maximum horizontal timing value
+ * maxVValue maximum vertical timing value
+ * virtualX virtual width
+ * virtualY virtual height
+ * clockRanges allowable clock ranges
+ */
+
+ModeStatus
+xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags)
+{
+ ClockRangesPtr cp;
+ int i, k, gap, minimumGap = CLOCK_TOLERANCE + 1;
+ int extraFlags = 0;
+ int clockIndex = -1;
+ int MulFactor = 1;
+ int DivFactor = 1;
+ int ModePrivFlags = 0;
+ Bool allowDiv2;
+ ModeStatus status = MODE_NOMODE;
+
+ /* Some sanity checking */
+ if (scrp == NULL || (!scrp->progClock && scrp->numClocks == 0)) {
+ ErrorF("xf86CheckModeForDriver: called with invalid scrnInfoRec\n");
+ return MODE_ERROR;
+ }
+ if (mode == NULL) {
+ ErrorF("xf86CheckModeForDriver: called with invalid modep\n");
+ return MODE_ERROR;
+ }
+
+ /* Check the mode size */
+ if (mode->HDisplay > scrp->virtualX)
+ return MODE_VIRTUAL_X;
+
+ if (mode->VDisplay > scrp->virtualY)
+ return MODE_VIRTUAL_Y;
+
+ if (scrp->maxHValue > 0 && mode->HTotal > scrp->maxHValue)
+ return MODE_BAD_HVALUE;
+
+ if (scrp->maxVValue > 0 && mode->VTotal > scrp->maxVValue)
+ return MODE_BAD_VVALUE;
+
+ for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
+ /* DivFactor and MulFactor must be > 0 */
+ cp->ClockDivFactor = max(1, cp->ClockDivFactor);
+ cp->ClockMulFactor = max(1, cp->ClockMulFactor);
+ }
+
+ if (scrp->progClock) {
+ /* Check clock is in range */
+ for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
+ if ((cp->minClock <= mode->Clock) &&
+ (cp->maxClock >= mode->Clock) &&
+ (cp->interlaceAllowed || !(mode->Flags & V_INTERLACE)) &&
+ (cp->doubleScanAllowed ||
+ ((!(mode->Flags & V_DBLSCAN)) && (mode->VScan <= 1))))
+ break;
+ }
+ if (cp == NULL) {
+ return MODE_CLOCK_RANGE;
+ }
+ /*
+ * If programmable clock the required mode has been found
+ */
+ DivFactor = cp->ClockDivFactor;
+ MulFactor = cp->ClockMulFactor;
+ ModePrivFlags = cp->PrivFlags;
+ } else {
+ status = MODE_CLOCK_RANGE;
+ /* Check clock is in range */
+ for (cp = scrp->clockRanges; cp != NULL; cp = cp->next) {
+ if ((cp->minClock <= mode->Clock) &&
+ (cp->maxClock >= mode->Clock) &&
+ (cp->interlaceAllowed || !(mode->Flags & V_INTERLACE)) &&
+ (cp->doubleScanAllowed ||
+ ((!(mode->Flags & V_DBLSCAN)) && (mode->VScan <= 1)))) {
+
+ /*
+ * Clock is in range, so if it is not a programmable clock,
+ * find a matching clock.
+ */
+
+ allowDiv2 = (cp->strategy & LOOKUP_CLKDIV2) != 0;
+ i = xf86GetNearestClock(scrp, mode->Clock, allowDiv2,
+ cp->ClockDivFactor, cp->ClockMulFactor, &k);
+ /*
+ * If the clock is too far from the requested clock, this
+ * mode is no good.
+ */
+ if (k & V_CLKDIV2)
+ gap = abs((mode->Clock * 2) -
+ ((scrp->clock[i] * cp->ClockDivFactor) /
+ cp->ClockMulFactor));
+ else
+ gap = abs(mode->Clock -
+ ((scrp->clock[i] * cp->ClockDivFactor) /
+ cp->ClockMulFactor));
+ if (gap > minimumGap) {
+ status = MODE_NOCLOCK;
+ continue;
+ }
+
+ DivFactor = cp->ClockDivFactor;
+ MulFactor = cp->ClockMulFactor;
+ ModePrivFlags = cp->PrivFlags;
+ extraFlags = k;
+ clockIndex = i;
+ break;
+ }
+ }
+ if (cp == NULL)
+ return status;
+ }
+
+ /* Fill in the mode parameters */
+ if (scrp->progClock) {
+ mode->ClockIndex = -1;
+ mode->SynthClock = (mode->Clock * MulFactor) / DivFactor;
+ } else {
+ mode->Clock = (scrp->clock[clockIndex] * DivFactor) / MulFactor;
+ mode->ClockIndex = clockIndex;
+ mode->SynthClock = scrp->clock[clockIndex];
+ if (extraFlags & V_CLKDIV2) {
+ mode->Clock /= 2;
+ mode->SynthClock /= 2;
+ }
+ }
+ mode->PrivFlags = ModePrivFlags;
+
+ return MODE_OK;
+}
+
+/*
+ * xf86ValidateModes
+ *
+ * This function takes a set of mode names, modes and limiting conditions,
+ * and selects a set of modes and parameters based on those conditions.
+ *
+ * This function takes the following parameters:
+ * scrp ScrnInfoPtr
+ * availModes the list of modes available for the monitor
+ * modeNames (optional) list of mode names that the screen is requesting
+ * clockRanges a list of clock ranges
+ * linePitches (optional) a list of line pitches
+ * minPitch (optional) minimum line pitch (in pixels)
+ * maxPitch (optional) maximum line pitch (in pixels)
+ * pitchInc (mandatory) pitch increment (in bits)
+ * minHeight (optional) minimum virtual height (in pixels)
+ * maxHeight (optional) maximum virtual height (in pixels)
+ * virtualX (optional) virtual width requested (in pixels)
+ * virtualY (optional) virtual height requested (in pixels)
+ * apertureSize size of video aperture (in bytes)
+ * strategy how to decide which mode to use from multiple modes with
+ * the same name
+ *
+ * In addition, the following fields from the ScrnInfoRec are used:
+ * clocks a list of discrete clocks
+ * numClocks number of discrete clocks
+ * progClock clock is programmable
+ * monitor pointer to structure for monitor section
+ * fbFormat format of the framebuffer
+ * videoRam video memory size
+ * maxHValue maximum horizontal timing value
+ * maxVValue maximum vertical timing value
+ * xInc horizontal timing increment (defaults to 8 pixels)
+ *
+ * The function fills in the following ScrnInfoRec fields:
+ * modePool A subset of the modes available to the monitor which
+ * are compatible with the driver.
+ * modes one mode entry for each of the requested modes, with the
+ * status field filled in to indicate if the mode has been
+ * accepted or not.
+ * virtualX the resulting virtual width
+ * virtualY the resulting virtual height
+ * displayWidth the resulting line pitch
+ *
+ * The function's return value is the number of matching modes found, or -1
+ * if an unrecoverable error was encountered.
+ */
+
+int
+xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
+ char **modeNames, ClockRangePtr clockRanges,
+ int *linePitches, int minPitch, int maxPitch, int pitchInc,
+ int minHeight, int maxHeight, int virtualX, int virtualY,
+ int apertureSize, LookupModeFlags strategy)
+{
+ DisplayModePtr p, q, r, new, last, *endp;
+ int i, numModes = 0;
+ ModeStatus status;
+ int linePitch = -1, virtX = 0, virtY = 0;
+ int newLinePitch, newVirtX, newVirtY;
+ int modeSize; /* in pixels */
+ Bool validateAllDefaultModes;
+ Bool userModes = FALSE;
+ int saveType;
+ PixmapFormatRec *BankFormat;
+ ClockRangePtr cp;
+ ClockRangesPtr storeClockRanges;
+ struct monitor_ranges *mon_range = NULL;
+
+#ifdef DEBUG
+ ErrorF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n",
+ scrp, availModes, modeNames, clockRanges,
+ linePitches, minPitch, maxPitch, pitchInc,
+ minHeight, maxHeight, virtualX, virtualY,
+ apertureSize, strategy
+ );
+#endif
+
+ /* Some sanity checking */
+ if (scrp == NULL || scrp->name == NULL || !scrp->monitor ||
+ (!scrp->progClock && scrp->numClocks == 0)) {
+ ErrorF("xf86ValidateModes: called with invalid scrnInfoRec\n");
+ return -1;
+ }
+ if (linePitches != NULL && linePitches[0] <= 0) {
+ ErrorF("xf86ValidateModes: called with invalid linePitches\n");
+ return -1;
+ }
+ if (pitchInc <= 0) {
+ ErrorF("xf86ValidateModes: called with invalid pitchInc\n");
+ return -1;
+ }
+ if ((virtualX > 0) != (virtualY > 0)) {
+ ErrorF("xf86ValidateModes: called with invalid virtual resolution\n");
+ return -1;
+ }
+
+ /* Probe monitor so that we can enforce/warn about its limits */
+ if (scrp->monitor->DDC) {
+ MonPtr monitor = scrp->monitor;
+ xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
+ struct detailed_monitor_section* detMon;
+ int i;
+
+ for (i = 0; i < 4; i++) {
+ detMon = &DDC->det_mon[i];
+ if(detMon->type == DS_RANGES) {
+ mon_range = &detMon->section.ranges;
+ }
+ }
+ if (mon_range) {
+
+#ifdef DEBUG
+ ErrorF("DDC - Max clock %d, Hsync %d-%d kHz - Vrefresh %d-%d Hz\n",
+ mon_range->max_clock, mon_range->min_h, mon_range->max_h,
+ mon_range->min_v, mon_range->max_v );
+#endif
+
+#define DDC_SYNC_TOLERANCE SYNC_TOLERANCE
+ if (monitor->nHsync > 0) {
+ for (i = 0; i < monitor->nHsync; i++) {
+ if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_h >
+ monitor->hsync[i].lo ||
+ (1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_h <
+ monitor->hsync[i].hi) {
+ xf86DrvMsg(scrp->scrnIndex, X_WARNING,
+ "config file hsync range %g-%gkHz not within DDC "
+ "hsync range %d-%dkHz\n",
+ monitor->hsync[i].lo, monitor->hsync[i].hi,
+ mon_range->min_h, mon_range->max_h);
+ }
+ }
+ }
+
+ if (monitor->nVrefresh > 0) {
+ for (i=0; i<monitor->nVrefresh; i++) {
+ if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_v >
+ monitor->vrefresh[0].lo ||
+ (1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_v <
+ monitor->vrefresh[0].hi) {
+ xf86DrvMsg(scrp->scrnIndex, X_WARNING,
+ "config file vrefresh range %g-%gHz not within DDC "
+ "vrefresh range %d-%dHz\n",
+ monitor->vrefresh[i].lo, monitor->vrefresh[i].hi,
+ mon_range->min_v, mon_range->max_v);
+ }
+ }
+ }
+ } /* if (mon_range) */
+ }
+
+ /*
+ * If requested by the driver, allow missing hsync and/or vrefresh ranges
+ * in the monitor section.
+ */
+ if (strategy & LOOKUP_OPTIONAL_TOLERANCES) {
+ strategy &= ~LOOKUP_OPTIONAL_TOLERANCES;
+ } else {
+ if (scrp->monitor->nHsync <= 0) {
+ if (mon_range) {
+ scrp->monitor->hsync[0].lo = mon_range->min_h;
+ scrp->monitor->hsync[0].hi = mon_range->max_h;
+ } else {
+ scrp->monitor->hsync[0].lo = 28;
+ scrp->monitor->hsync[0].hi = 33;
+ }
+ xf86DrvMsg(scrp->scrnIndex, X_WARNING,
+ "%s: Using default hsync range of %.2f-%.2fkHz\n",
+ scrp->monitor->id,
+ scrp->monitor->hsync[0].lo, scrp->monitor->hsync[0].hi);
+ scrp->monitor->nHsync = 1;
+ } else {
+ for (i = 0; i < scrp->monitor->nHsync; i++)
+ if (scrp->monitor->hsync[i].lo == scrp->monitor->hsync[i].hi)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "%s: Using hsync value of %.2f kHz\n",
+ scrp->monitor->id,
+ scrp->monitor->hsync[i].lo);
+ else
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "%s: Using hsync range of %.2f-%.2f kHz\n",
+ scrp->monitor->id,
+ scrp->monitor->hsync[i].lo,
+ scrp->monitor->hsync[i].hi);
+ }
+ if (scrp->monitor->nVrefresh <= 0) {
+ if (mon_range) {
+ scrp->monitor->vrefresh[0].lo = mon_range->min_v;
+ scrp->monitor->vrefresh[0].hi = mon_range->max_v;
+ } else {
+ scrp->monitor->vrefresh[0].lo = 43;
+ scrp->monitor->vrefresh[0].hi = 72;
+ }
+ xf86DrvMsg(scrp->scrnIndex, X_WARNING,
+ "%s: using default vrefresh range of %.2f-%.2fHz\n",
+ scrp->monitor->id,
+ scrp->monitor->vrefresh[0].lo,
+ scrp->monitor->vrefresh[0].hi);
+ scrp->monitor->nVrefresh = 1;
+ } else {
+ for (i = 0; i < scrp->monitor->nVrefresh; i++)
+ if (scrp->monitor->vrefresh[i].lo == scrp->monitor->vrefresh[i].hi)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "%s: Using vrefresh value of %.2f Hz\n",
+ scrp->monitor->id,
+ scrp->monitor->vrefresh[i].lo);
+ else
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "%s: Using vrefresh range of %.2f-%.2f Hz\n",
+ scrp->monitor->id,
+ scrp->monitor->vrefresh[i].lo,
+ scrp->monitor->vrefresh[i].hi);
+ }
+ }
+
+ /*
+ * Store the clockRanges for later use by the VidMode extension. Must
+ * also store the strategy, since ClockDiv2 flag is stored there.
+ */
+ storeClockRanges = scrp->clockRanges;
+ while (storeClockRanges != NULL) {
+ storeClockRanges = storeClockRanges->next;
+ }
+ for (cp = clockRanges; cp != NULL; cp = cp->next,
+ storeClockRanges = storeClockRanges->next) {
+ storeClockRanges = xnfalloc(sizeof(ClockRanges));
+ if (scrp->clockRanges == NULL)
+ scrp->clockRanges = storeClockRanges;
+ memcpy(storeClockRanges, cp, sizeof(ClockRange));
+ storeClockRanges->strategy = strategy;
+ }
+
+ /* Determine which pixmap format to pass to miScanLineWidth() */
+ if (scrp->depth > 4)
+ BankFormat = &scrp->fbFormat;
+ else
+ BankFormat = xf86GetPixFormat(scrp, 1); /* >not< scrp->depth! */
+
+ if (scrp->xInc <= 0)
+ scrp->xInc = 8; /* Suitable for VGA and others */
+
+#define _VIRTUALX(x) ((((x) + scrp->xInc - 1) / scrp->xInc) * scrp->xInc)
+
+ /*
+ * Determine maxPitch if it wasn't given explicitly. Note linePitches
+ * always takes precedence if is non-NULL. In that case the minPitch and
+ * maxPitch values passed are ignored.
+ */
+ if (linePitches) {
+ minPitch = maxPitch = linePitches[0];
+ for (i = 1; linePitches[i] > 0; i++) {
+ if (linePitches[i] > maxPitch)
+ maxPitch = linePitches[i];
+ if (linePitches[i] < minPitch)
+ minPitch = linePitches[i];
+ }
+ }
+
+ /* Initial check of virtual size against other constraints */
+ scrp->virtualFrom = X_PROBED;
+ /*
+ * Initialise virtX and virtY if the values are fixed.
+ */
+ if (virtualY > 0) {
+ if (maxHeight > 0 && virtualY > maxHeight) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Virtual height (%d) is too large for the hardware "
+ "(max %d)\n", virtualY, maxHeight);
+ return -1;
+ }
+
+ if (minHeight > 0 && virtualY < minHeight) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Virtual height (%d) is too small for the hardware "
+ "(min %d)\n", virtualY, minHeight);
+ return -1;
+ }
+
+ virtualX = _VIRTUALX(virtualX);
+ if (linePitches != NULL) {
+ for (i = 0; linePitches[i] != 0; i++) {
+ if ((linePitches[i] >= virtualX) &&
+ (linePitches[i] ==
+ miScanLineWidth(virtualX, virtualY, linePitches[i],
+ apertureSize, BankFormat, pitchInc))) {
+ linePitch = linePitches[i];
+ break;
+ }
+ }
+ } else {
+ linePitch = miScanLineWidth(virtualX, virtualY, minPitch,
+ apertureSize, BankFormat, pitchInc);
+ }
+
+ if ((linePitch < minPitch) || (linePitch > maxPitch)) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Virtual width (%d) is too large for the hardware "
+ "(max %d)\n", virtualX, maxPitch);
+ return -1;
+ }
+
+ if (!xf86CheckModeSize(scrp, linePitch, virtualX, virtualY)) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Virtual size (%dx%d) (pitch %d) exceeds video memory\n",
+ virtualX, virtualY, linePitch);
+ return -1;
+ }
+
+ virtX = virtualX;
+ virtY = virtualY;
+ scrp->virtualFrom = X_CONFIG;
+ }
+
+ /* Print clock ranges and scaled clocks */
+ xf86ShowClockRanges(scrp, clockRanges);
+
+ /*
+ * If scrp->modePool hasn't been setup yet, set it up now. This allows the
+ * modes that the driver definitely can't use to be weeded out early. Note
+ * that a modePool mode's prev field is used to hold a pointer to the
+ * member of the scrp->modes list for which a match was considered.
+ */
+ if (scrp->modePool == NULL) {
+ q = NULL;
+ for (p = availModes; p != NULL; p = p->next) {
+ status = xf86InitialCheckModeForDriver(scrp, p, clockRanges,
+ strategy, maxPitch,
+ virtualX, virtualY);
+
+ if (status == MODE_OK)
+ status = xf86CheckModeForMonitor(p, scrp->monitor);
+
+ if (status == MODE_OK) {
+ new = xnfalloc(sizeof(DisplayModeRec));
+ *new = *p;
+ new->next = NULL;
+ if (!q) {
+ scrp->modePool = new;
+ } else {
+ q->next = new;
+ }
+ new->prev = NULL;
+ q = new;
+ q->name = xnfstrdup(p->name);
+ q->status = MODE_OK;
+ } else {
+ if (p->type & M_T_BUILTIN)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using built-in mode \"%s\" (%s)\n",
+ p->name, xf86ModeStatusToString(status));
+ else if (p->type & M_T_DEFAULT)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using default mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(status));
+ else
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(status));
+ }
+ }
+
+ if (scrp->modePool == NULL) {
+ xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Mode pool is empty\n");
+ return 0;
+ }
+ } else {
+ for (p = scrp->modePool; p != NULL; p = p->next) {
+ p->prev = NULL;
+ p->status = MODE_OK;
+ }
+ }
+
+ /*
+ * Allocate one entry in scrp->modes for each named mode.
+ */
+ while (scrp->modes)
+ xf86DeleteMode(&scrp->modes, scrp->modes);
+ endp = &scrp->modes;
+ last = NULL;
+ if (modeNames != NULL) {
+ for (i = 0; modeNames[i] != NULL; i++) {
+ userModes = TRUE;
+ new = xnfcalloc(1, sizeof(DisplayModeRec));
+ new->prev = last;
+ new->type = M_T_USERDEF;
+ new->name = xnfalloc(strlen(modeNames[i]) + 1);
+ strcpy(new->name, modeNames[i]);
+ if (new->prev)
+ new->prev->next = new;
+ *endp = last = new;
+ endp = &new->next;
+ }
+ }
+
+ /* Lookup each mode */
+ validateAllDefaultModes = TRUE;
+ for (p = scrp->modes; ; p = p->next) {
+ Bool repeat;
+
+ /*
+ * If the supplied mode names don't produce a valid mode, scan through
+ * unconsidered modePool members until one survives validation. This
+ * is done in decreasing order by mode pixel area.
+ */
+
+ if (p == NULL) {
+ if ((numModes > 0) && !validateAllDefaultModes)
+ break;
+
+ validateAllDefaultModes = TRUE;
+ r = NULL;
+ modeSize = 0;
+ for (q = scrp->modePool; q != NULL; q = q->next) {
+ if ((q->prev == NULL) && (q->status == MODE_OK)) {
+ /*
+ * Deal with the case where this mode wasn't considered
+ * because of a builtin mode of the same name.
+ */
+ for (p = scrp->modes; p != NULL; p = p->next) {
+ if ((p->status != MODE_OK) &&
+ !strcmp(p->name, q->name))
+ break;
+ }
+
+ if (p != NULL)
+ q->prev = p;
+ else {
+ /*
+ * A quick check to not allow default modes with
+ * horizontal timing parameters that CRTs may have
+ * problems with.
+ */
+ if ((q->type & M_T_DEFAULT) &&
+ ((double)q->HTotal / (double)q->HDisplay) < 1.15)
+ continue;
+
+ if (modeSize < (q->HDisplay * q->VDisplay)) {
+ r = q;
+ modeSize = q->HDisplay * q->VDisplay;
+ }
+ }
+ }
+ }
+
+ if (r == NULL)
+ break;
+
+ p = xnfcalloc(1, sizeof(DisplayModeRec));
+ p->prev = last;
+ p->name = xnfalloc(strlen(r->name) + 1);
+ if (!userModes)
+ p->type = M_T_USERDEF;
+ strcpy(p->name, r->name);
+ if (p->prev)
+ p->prev->next = p;
+ *endp = last = p;
+ endp = &p->next;
+ }
+
+ repeat = FALSE;
+ lookupNext:
+ if (repeat && ((status = p->status) != MODE_OK)) {
+ if (p->type & M_T_BUILTIN)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using built-in mode \"%s\" (%s)\n",
+ p->name, xf86ModeStatusToString(status));
+ else if (p->type & M_T_DEFAULT)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using default mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(status));
+ else
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(status));
+ }
+ saveType = p->type;
+ status = xf86LookupMode(scrp, p, clockRanges, strategy);
+ if (repeat && status == MODE_NOMODE) {
+ continue;
+ }
+ if (status != MODE_OK) {
+ if (p->type & M_T_BUILTIN)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using built-in mode \"%s\" (%s)\n",
+ p->name, xf86ModeStatusToString(status));
+ else if (p->type & M_T_DEFAULT)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using default mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(status));
+ else
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(status));
+ }
+ if (status == MODE_ERROR) {
+ ErrorF("xf86ValidateModes: "
+ "unexpected result from xf86LookupMode()\n");
+ return -1;
+ }
+ if (status != MODE_OK) {
+ if (p->status == MODE_OK)
+ p->status = status;
+ continue;
+ }
+ p->type |= saveType;
+ repeat = TRUE;
+
+ newLinePitch = linePitch;
+ newVirtX = virtX;
+ newVirtY = virtY;
+
+ /*
+ * Don't let non-user defined modes increase the virtual size
+ */
+ if (!(p->type & M_T_USERDEF) && (numModes > 0)) {
+ if (p->HDisplay > virtX) {
+ p->status = MODE_VIRTUAL_X;
+ goto lookupNext;
+ }
+ if (p->VDisplay > virtY) {
+ p->status = MODE_VIRTUAL_Y;
+ goto lookupNext;
+ }
+ }
+ /*
+ * Adjust virtual width and height if the mode is too large for the
+ * current values and if they are not fixed.
+ */
+ if (virtualX <= 0 && p->HDisplay > newVirtX)
+ newVirtX = _VIRTUALX(p->HDisplay);
+ if (virtualY <= 0 && p->VDisplay > newVirtY) {
+ if (maxHeight > 0 && p->VDisplay > maxHeight) {
+ p->status = MODE_VIRTUAL_Y; /* ? */
+ goto lookupNext;
+ }
+ newVirtY = p->VDisplay;
+ }
+
+ /*
+ * If virtual resolution is to be increased, revalidate it.
+ */
+ if ((virtX != newVirtX) || (virtY != newVirtY)) {
+ if (linePitches != NULL) {
+ newLinePitch = -1;
+ for (i = 0; linePitches[i] != 0; i++) {
+ if ((linePitches[i] >= newVirtX) &&
+ (linePitches[i] >= linePitch) &&
+ (linePitches[i] ==
+ miScanLineWidth(newVirtX, newVirtY, linePitches[i],
+ apertureSize, BankFormat, pitchInc))) {
+ newLinePitch = linePitches[i];
+ break;
+ }
+ }
+ } else {
+ if (linePitch < minPitch)
+ linePitch = minPitch;
+ newLinePitch = miScanLineWidth(newVirtX, newVirtY, linePitch,
+ apertureSize, BankFormat,
+ pitchInc);
+ }
+ if ((newLinePitch < minPitch) || (newLinePitch > maxPitch)) {
+ p->status = MODE_BAD_WIDTH;
+ goto lookupNext;
+ }
+
+ /*
+ * Check that the pixel area required by the new virtual height
+ * and line pitch isn't too large.
+ */
+ if (!xf86CheckModeSize(scrp, newLinePitch, newVirtX, newVirtY)) {
+ p->status = MODE_MEM_VIRT;
+ goto lookupNext;
+ }
+ }
+
+ if (scrp->ValidMode) {
+ /*
+ * Give the driver a final say, passing it the proposed virtual
+ * geometry.
+ */
+ scrp->virtualX = newVirtX;
+ scrp->virtualY = newVirtY;
+ scrp->displayWidth = newLinePitch;
+ p->status = (scrp->ValidMode)(scrp->scrnIndex, p, FALSE,
+ MODECHECK_FINAL);
+
+ if (p->status != MODE_OK) {
+ goto lookupNext;
+ }
+ }
+
+ /* Mode has passed all the tests */
+ virtX = newVirtX;
+ virtY = newVirtY;
+ linePitch = newLinePitch;
+ p->status = MODE_OK;
+ numModes++;
+ }
+
+#undef _VIRTUALX
+
+ /* Update the ScrnInfoRec parameters */
+
+ scrp->virtualX = virtX;
+ scrp->virtualY = virtY;
+ scrp->displayWidth = linePitch;
+
+ if (numModes <= 0)
+ return 0;
+
+ /* Make the mode list into a circular list by joining up the ends */
+ p = scrp->modes;
+ while (p->next != NULL)
+ p = p->next;
+ /* p is now the last mode on the list */
+ p->next = scrp->modes;
+ scrp->modes->prev = p;
+
+ if (minHeight > 0 && virtY < minHeight) {
+ xf86DrvMsg(scrp->scrnIndex, X_ERROR,
+ "Virtual height (%d) is too small for the hardware "
+ "(min %d)\n", virtY, minHeight);
+ return -1;
+ }
+
+ return numModes;
+}
+
+/*
+ * xf86DeleteMode
+ *
+ * This function removes a mode from a list of modes.
+ *
+ * There are different types of mode lists:
+ *
+ * - singly linked linear lists, ending in NULL
+ * - doubly linked linear lists, starting and ending in NULL
+ * - doubly linked circular lists
+ *
+ */
+
+void
+xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode)
+{
+ /* Catch the easy/insane cases */
+ if (modeList == NULL || *modeList == NULL || mode == NULL)
+ return;
+
+ /* If the mode is at the start of the list, move the start of the list */
+ if (*modeList == mode)
+ *modeList = mode->next;
+
+ /* If mode is the only one on the list, set the list to NULL */
+ if ((mode == mode->prev) && (mode == mode->next)) {
+ *modeList = NULL;
+ } else {
+ if ((mode->prev != NULL) && (mode->prev->next == mode))
+ mode->prev->next = mode->next;
+ if ((mode->next != NULL) && (mode->next->prev == mode))
+ mode->next->prev = mode->prev;
+ }
+
+ xfree(mode->name);
+ xfree(mode);
+}
+
+/*
+ * xf86PruneDriverModes
+ *
+ * Remove modes from the driver's mode list which have been marked as
+ * invalid.
+ */
+
+void
+xf86PruneDriverModes(ScrnInfoPtr scrp)
+{
+ DisplayModePtr first, p, n;
+
+ p = scrp->modes;
+ if (p == NULL)
+ return;
+
+ do {
+ if (!(first = scrp->modes))
+ return;
+ n = p->next;
+ if (p->status != MODE_OK) {
+#if 0
+ if (p->type & M_T_BUILTIN)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using built-in mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(p->status));
+ else if (p->type & M_T_DEFAULT)
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using default mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(p->status));
+ else
+ xf86DrvMsg(scrp->scrnIndex, X_INFO,
+ "Not using mode \"%s\" (%s)\n", p->name,
+ xf86ModeStatusToString(p->status));
+#endif
+ xf86DeleteMode(&(scrp->modes), p);
+ }
+ p = n;
+ } while (p != NULL && p != first);
+
+ /* modePool is no longer needed, turf it */
+ while (scrp->modePool)
+ xf86DeleteMode(&scrp->modePool, scrp->modePool);
+}
+
+
+/*
+ * xf86SetCrtcForModes
+ *
+ * Goes through the screen's mode list, and initialises the Crtc
+ * parameters for each mode. The initialisation includes adjustments
+ * for interlaced and double scan modes.
+ */
+void
+xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags)
+{
+ DisplayModePtr p;
+
+ /*
+ * Store adjustFlags for use with the VidMode extension. There is an
+ * implicit assumption here that SetCrtcForModes is called once.
+ */
+ scrp->adjustFlags = adjustFlags;
+
+ p = scrp->modes;
+ if (p == NULL)
+ return;
+
+ do {
+ xf86SetModeCrtc(p, adjustFlags);
+#ifdef DEBUG
+ ErrorF("%sMode %s: %d (%d) %d %d (%d) %d %d (%d) %d %d (%d) %d\n",
+ (p->type & M_T_DEFAULT) ? "Default " : "",
+ p->name, p->CrtcHDisplay, p->CrtcHBlankStart,
+ p->CrtcHSyncStart, p->CrtcHSyncEnd, p->CrtcHBlankEnd,
+ p->CrtcHTotal, p->CrtcVDisplay, p->CrtcVBlankStart,
+ p->CrtcVSyncStart, p->CrtcVSyncEnd, p->CrtcVBlankEnd,
+ p->CrtcVTotal);
+#endif
+ p = p->next;
+ } while (p != NULL && p != scrp->modes);
+}
+
+
+static void
+add(char **p, char *new)
+{
+ *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2);
+ strcat(*p, " ");
+ strcat(*p, new);
+}
+
+static void
+PrintModeline(int scrnIndex,DisplayModePtr mode)
+{
+ char tmp[256];
+ char *flags = xnfcalloc(1, 1);
+
+ if (mode->HSkew) {
+ snprintf(tmp, 256, "hskew %i", mode->HSkew);
+ add(&flags, tmp);
+ }
+ if (mode->VScan) {
+ snprintf(tmp, 256, "vscan %i", mode->VScan);
+ add(&flags, tmp);
+ }
+ if (mode->Flags & V_INTERLACE) add(&flags, "interlace");
+ if (mode->Flags & V_CSYNC) add(&flags, "composite");
+ if (mode->Flags & V_DBLSCAN) add(&flags, "doublescan");
+ if (mode->Flags & V_BCAST) add(&flags, "bcast");
+ if (mode->Flags & V_PHSYNC) add(&flags, "+hsync");
+ if (mode->Flags & V_NHSYNC) add(&flags, "-hsync");
+ if (mode->Flags & V_PVSYNC) add(&flags, "+vsync");
+ if (mode->Flags & V_NVSYNC) add(&flags, "-vsync");
+ if (mode->Flags & V_PCSYNC) add(&flags, "+csync");
+ if (mode->Flags & V_NCSYNC) add(&flags, "-csync");
+#if 0
+ if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2");
+#endif
+ xf86DrvMsgVerb(scrnIndex, X_INFO, 3,
+ "Modeline \"%s\" %6.2f %i %i %i %i %i %i %i %i%s\n",
+ mode->name, mode->Clock/1000., mode->HDisplay,
+ mode->HSyncStart, mode->HSyncEnd, mode->HTotal,
+ mode->VDisplay, mode->VSyncStart, mode->VSyncEnd,
+ mode->VTotal, flags);
+ xfree(flags);
+}
+
+void
+xf86PrintModes(ScrnInfoPtr scrp)
+{
+ DisplayModePtr p;
+ float hsync, refresh = 0;
+ char *desc, *desc2, *prefix, *uprefix;
+
+ if (scrp == NULL)
+ return;
+
+ xf86DrvMsg(scrp->scrnIndex, scrp->virtualFrom, "Virtual size is %dx%d "
+ "(pitch %d)\n", scrp->virtualX, scrp->virtualY,
+ scrp->displayWidth);
+
+ p = scrp->modes;
+ if (p == NULL)
+ return;
+
+ do {
+ desc = desc2 = "";
+ if (p->HSync > 0.0)
+ hsync = p->HSync;
+ else if (p->HTotal > 0)
+ hsync = (float)p->Clock / (float)p->HTotal;
+ else
+ hsync = 0.0;
+ if (p->VTotal > 0)
+ refresh = hsync * 1000.0 / p->VTotal;
+ if (p->Flags & V_INTERLACE) {
+ refresh *= 2.0;
+ desc = " (I)";
+ }
+ if (p->Flags & V_DBLSCAN) {
+ refresh /= 2.0;
+ desc = " (D)";
+ }
+ if (p->VScan > 1) {
+ refresh /= p->VScan;
+ desc2 = " (VScan)";
+ }
+ if (p->VRefresh > 0.0)
+ refresh = p->VRefresh;
+ if (p->type & M_T_BUILTIN)
+ prefix = "Built-in mode";
+ else if (p->type & M_T_DEFAULT)
+ prefix = "Default mode";
+ else
+ prefix = "Mode";
+ if (p->type & M_T_USERDEF)
+ uprefix = "*";
+ else
+ uprefix = " ";
+ if (hsync == 0 || refresh == 0) {
+ if (p->name)
+ xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
+ "%s%s \"%s\"\n", uprefix, prefix, p->name);
+ else
+ xf86DrvMsg(scrp->scrnIndex, X_PROBED,
+ "%s%s %dx%d (unnamed)\n",
+ uprefix, prefix, p->HDisplay, p->VDisplay);
+ } else if (p->Clock == p->SynthClock) {
+ xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
+ "%s%s \"%s\": %.1f MHz, %.1f kHz, %.1f Hz%s%s\n",
+ uprefix, prefix, p->name, p->Clock / 1000.0,
+ hsync, refresh, desc, desc2);
+ } else {
+ xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
+ "%s%s \"%s\": %.1f MHz (scaled from %.1f MHz), "
+ "%.1f kHz, %.1f Hz%s%s\n",
+ uprefix, prefix, p->name, p->Clock / 1000.0,
+ p->SynthClock / 1000.0, hsync, refresh, desc, desc2);
+ }
+ if (hsync != 0 && refresh != 0)
+ PrintModeline(scrp->scrnIndex,p);
+ p = p->next;
+ } while (p != NULL && p != scrp->modes);
+}
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
new file mode 100644
index 000000000..21b9aa590
--- /dev/null
+++ b/hw/xfree86/common/xf86Module.h
@@ -0,0 +1,203 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.35 2002/12/22 02:03:25 dawes Exp $ */
+
+/*
+ * Copyright (c) 1997-2001 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains the parts of the loader interface that are visible
+ * to modules. This is the only loader-related header that modules should
+ * include.
+ *
+ * It should include a bare minimum of other headers.
+ *
+ * Longer term, the module/loader code should probably live directly under
+ * Xserver/.
+ *
+ * XXX This file arguably belongs in xfree86/loader/.
+ */
+
+#ifndef _XF86MODULE_H
+#define _XF86MODULE_H
+
+#include "misc.h"
+#include "xf86Version.h"
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+typedef enum {
+ LD_RESOLV_IFDONE = 0, /* only check if no more
+ delays pending */
+ LD_RESOLV_NOW = 1, /* finish one delay step */
+ LD_RESOLV_FORCE = 2 /* force checking... */
+} LoaderResolveOptions;
+
+#define DEFAULT_LIST ((char *)-1)
+
+/* This indicates a special module that doesn't have the usual entry point */
+#define EXTERN_MODULE ((pointer)-1)
+
+/* Built-in ABI classes. These definitions must not be changed. */
+#define ABI_CLASS_NONE NULL
+#define ABI_CLASS_ANSIC "XFree86 ANSI C Emulation"
+#define ABI_CLASS_VIDEODRV "XFree86 Video Driver"
+#define ABI_CLASS_XINPUT "XFree86 XInput driver"
+#define ABI_CLASS_EXTENSION "XFree86 Server Extension"
+#define ABI_CLASS_FONT "XFree86 Font Renderer"
+
+#define ABI_MINOR_MASK 0x0000FFFF
+#define ABI_MAJOR_MASK 0xFFFF0000
+#define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK)
+#define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16)
+#define SET_ABI_VERSION(maj, min) \
+ ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK))
+
+/*
+ * ABI versions. Each version has a major and minor revision. Modules
+ * using lower minor revisions must work with servers of a higher minor
+ * revision. There is no compatibility between different major revisions.
+ * Whenever the ABI_ANSIC_VERSION is changed, the others must also be
+ * changed. The minor revision mask is 0x0000FFFF and the major revision
+ * mask is 0xFFFF0000.
+ */
+#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 2)
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 6)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(0, 4)
+#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 2)
+#define ABI_FONT_VERSION SET_ABI_VERSION(0, 4)
+
+#define MODINFOSTRING1 0xef23fdc5
+#define MODINFOSTRING2 0x10dc023a
+
+#ifndef MODULEVENDORSTRING
+#ifndef __OS2ELF__
+#define MODULEVENDORSTRING "The XFree86 Project"
+#else
+#define MODULEVENDORSTRING "The XFree86 Project - XFree86/OS2"
+#endif
+#endif
+
+/* Error return codes for errmaj. New codes must only be added at the end. */
+typedef enum {
+ LDR_NOERROR = 0,
+ LDR_NOMEM, /* memory allocation failed */
+ LDR_NOENT, /* Module file does not exist */
+ LDR_NOSUBENT, /* pre-requsite file to be sub-loaded does not exist */
+ LDR_NOSPACE, /* internal module array full */
+ LDR_NOMODOPEN, /* module file could not be opened (check errmin) */
+ LDR_UNKTYPE, /* file is not a recognized module type */
+ LDR_NOLOAD, /* type specific loader failed */
+ LDR_ONCEONLY, /* Module should only be loaded once (not an error) */
+ LDR_NOPORTOPEN, /* could not open port (check errmin) */
+ LDR_NOHARDWARE, /* could not query/initialize the hardware device */
+ LDR_MISMATCH, /* the module didn't match the spec'd requirments */
+ LDR_BADUSAGE, /* LoadModule is called with bad arguments */
+ LDR_INVALID, /* The module doesn't have a valid ModuleData object */
+ LDR_BADOS, /* The module doesn't support the OS */
+ LDR_MODSPECIFIC /* A module-specific error in the SetupProc */
+} LoaderErrorCode;
+
+/*
+ * Some common module classes. The moduleclass can be used to identify
+ * that modules loaded are of the correct type. This is a finer
+ * classification than the ABI classes even though the default set of
+ * classes have the same names. For example, not all modules that require
+ * the video driver ABI are themselves video drivers.
+ */
+#define MOD_CLASS_NONE NULL
+#define MOD_CLASS_VIDEODRV "XFree86 Video Driver"
+#define MOD_CLASS_XINPUT "XFree86 XInput Driver"
+#define MOD_CLASS_FONT "XFree86 Font Renderer"
+#define MOD_CLASS_EXTENSION "XFree86 Server Extension"
+
+/* This structure is expected to be returned by the initfunc */
+typedef struct {
+ const char * modname; /* name of module, e.g. "foo" */
+ const char * vendor; /* vendor specific string */
+ CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
+ CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */
+ CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* module-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class description */
+ CARD32 checksum[4]; /* contains a digital signature of the */
+ /* version info structure */
+} XF86ModuleVersionInfo;
+
+/*
+ * This structure can be used to callers of LoadModule and LoadSubModule to
+ * specify version and/or ABI requirements.
+ */
+typedef struct {
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* moudle-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class */
+} XF86ModReqInfo;
+
+/* values to indicate unspecified fields in XF86ModReqInfo. */
+#define MAJOR_UNSPEC 0xFF
+#define MINOR_UNSPEC 0xFF
+#define PATCH_UNSPEC 0xFFFF
+#define ABI_VERS_UNSPEC 0xFFFFFFFF
+
+#define MODULE_VERSION_NUMERIC(maj, min, patch) \
+ ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
+#define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
+#define GET_MODULE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
+#define GET_MODULE_PATCHLEVEL(vers) ((vers) & 0xFFFF)
+
+#define INITARGS void
+
+typedef void (*InitExtension)(INITARGS);
+
+typedef struct {
+ InitExtension initFunc;
+ const char * name;
+ Bool *disablePtr;
+ InitExtension setupFunc;
+ const char ** initDependencies;
+} ExtensionModule;
+
+extern ExtensionModule *ExtensionModuleList;
+
+/* Prototypes for Loader functions that are exported to modules */
+#ifndef IN_LOADER
+/* Prototypes with opaque pointers for use by modules */
+pointer LoadSubModule(pointer, const char *, const char **,
+ const char **, pointer, const XF86ModReqInfo *,
+ int *, int *);
+void UnloadSubModule(pointer);
+void LoadFont(pointer);
+void UnloadModule (pointer);
+#endif
+pointer LoaderSymbol(const char *);
+char **LoaderListDirs(const char **, const char **);
+void LoaderFreeDirList(char **);
+void LoaderErrorMsg(const char *, const char *, int, int);
+void LoadExtension(ExtensionModule *, Bool);
+void LoaderRefSymLists(const char **, ...);
+void LoaderRefSymbols(const char *, ...);
+void LoaderReqSymLists(const char **, ...);
+void LoaderReqSymbols(const char *, ...);
+int LoaderCheckUnresolved(int);
+void LoaderGetOS(const char **name, int *major, int *minor, int *teeny);
+
+typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *);
+typedef void (*ModuleTearDownProc)(pointer);
+#define MODULESETUPPROTO(func) pointer func(pointer, pointer, int*, int*)
+#define MODULETEARDOWNPROTO(func) void func(pointer)
+
+typedef struct {
+ XF86ModuleVersionInfo * vers;
+ ModuleSetupProc setup;
+ ModuleTearDownProc teardown;
+} XF86ModuleData;
+
+#endif /* _XF86STR_H */
diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h
new file mode 100644
index 000000000..dc5c2ca67
--- /dev/null
+++ b/hw/xfree86/common/xf86Opt.h
@@ -0,0 +1,82 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.12 2001/05/04 19:05:30 dawes Exp $ */
+
+/* Option handling things that ModuleSetup procs can use */
+
+#ifndef _XF86_OPT_H_
+#define _XF86_OPT_H_
+
+typedef struct {
+ double freq;
+ int units;
+} OptFrequency;
+
+typedef union {
+ unsigned long num;
+ char * str;
+ double realnum;
+ Bool bool;
+ OptFrequency freq;
+} ValueUnion;
+
+typedef enum {
+ OPTV_NONE = 0,
+ OPTV_INTEGER,
+ OPTV_STRING, /* a non-empty string */
+ OPTV_ANYSTR, /* Any string, including an empty one */
+ OPTV_REAL,
+ OPTV_BOOLEAN,
+ OPTV_FREQ
+} OptionValueType;
+
+typedef enum {
+ OPTUNITS_HZ = 1,
+ OPTUNITS_KHZ,
+ OPTUNITS_MHZ
+} OptFreqUnits;
+
+typedef struct {
+ int token;
+ const char* name;
+ OptionValueType type;
+ ValueUnion value;
+ Bool found;
+} OptionInfoRec, *OptionInfoPtr;
+
+int xf86SetIntOption(pointer optlist, const char *name, int deflt);
+double xf86SetRealOption(pointer optlist, const char *name, double deflt);
+char *xf86SetStrOption(pointer optlist, const char *name, char *deflt);
+int xf86SetBoolOption(pointer list, const char *name, int deflt );
+pointer xf86AddNewOption(pointer head, char *name, char *val );
+pointer xf86NewOption(char *name, char *value );
+pointer xf86NextOption(pointer list );
+pointer xf86OptionListCreate(const char **options, int count, int used);
+pointer xf86OptionListMerge(pointer head, pointer tail);
+void xf86OptionListFree(pointer opt);
+char *xf86OptionName(pointer opt);
+char *xf86OptionValue(pointer opt);
+void xf86OptionListReport(pointer parm);
+pointer xf86FindOption(pointer options, const char *name);
+char *xf86FindOptionValue(pointer options, const char *name);
+void xf86MarkOptionUsed(pointer option);
+void xf86MarkOptionUsedByName(pointer options, const char *name);
+Bool xf86CheckIfOptionUsed(pointer option);
+Bool xf86CheckIfOptionUsedByName(pointer options, const char *name);
+void xf86ShowUnusedOptions(int scrnIndex, pointer options);
+void xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo);
+OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token);
+const char *xf86TokenToOptName(const OptionInfoRec *table, int token);
+Bool xf86IsOptionSet(const OptionInfoRec *table, int token);
+char *xf86GetOptValString(const OptionInfoRec *table, int token);
+Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value);
+Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value);
+Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value);
+Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
+ OptFreqUnits expectedUnits, double *value);
+Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value);
+Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def);
+int xf86NameCmp(const char *s1, const char *s2);
+char *xf86NormalizeName(const char *s);
+pointer xf86ReplaceIntOption(pointer optlist, char *name, int val);
+pointer xf86ReplaceBoolOption(pointer optlist, char *name, Bool val);
+pointer xf86ReplaceStrOption(pointer optlist, char *name, char* val);
+#endif
diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
new file mode 100644
index 000000000..6ca1590e4
--- /dev/null
+++ b/hw/xfree86/common/xf86Option.c
@@ -0,0 +1,777 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.25 2002/09/10 17:39:28 dawes Exp $ */
+
+/*
+ * Copyright (c) 1998 by The XFree86 Project, Inc.
+ *
+ * Author: David Dawes <dawes@xfree86.org>
+ *
+ *
+ * This file includes public option handling functions.
+ */
+
+#include <stdlib.h>
+#include <ctype.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Xinput.h"
+#include "xf86Optrec.h"
+
+static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p);
+
+/*
+ * xf86CollectOptions collects the options from each of the config file
+ * sections used by the screen and puts the combined list in pScrn->options.
+ * This function requires that the following have been initialised:
+ *
+ * pScrn->confScreen
+ * pScrn->Entities[i]->device
+ * pScrn->display
+ * pScrn->monitor
+ *
+ * The extraOpts parameter may optionally contain a list of additional options
+ * to include.
+ *
+ * The order of precedence for options is:
+ *
+ * extraOpts, display, confScreen, monitor, device
+ */
+
+void
+xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts)
+{
+ XF86OptionPtr tmp;
+ XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
+ GDevPtr device;
+
+ int i;
+
+ pScrn->options = NULL;
+
+ for (i=pScrn->numEntities - 1; i >= 0; i--) {
+ device = xf86GetDevFromEntity(pScrn->entityList[i],
+ pScrn->entityInstanceList[i]);
+ if (device && device->options) {
+ tmp = xf86optionListDup(device->options);
+ if (pScrn->options)
+ xf86optionListMerge(pScrn->options,tmp);
+ else
+ pScrn->options = tmp;
+ }
+ }
+ if (pScrn->monitor->options) {
+ tmp = xf86optionListDup(pScrn->monitor->options);
+ if (pScrn->options)
+ pScrn->options = xf86optionListMerge(pScrn->options, tmp);
+ else
+ pScrn->options = tmp;
+ }
+ if (pScrn->confScreen->options) {
+ tmp = xf86optionListDup(pScrn->confScreen->options);
+ if (pScrn->options)
+ pScrn->options = xf86optionListMerge(pScrn->options, tmp);
+ else
+ pScrn->options = tmp;
+ }
+ if (pScrn->display->options) {
+ tmp = xf86optionListDup(pScrn->display->options);
+ if (pScrn->options)
+ pScrn->options = xf86optionListMerge(pScrn->options, tmp);
+ else
+ pScrn->options = tmp;
+ }
+ if (extras) {
+ tmp = xf86optionListDup(extras);
+ if (pScrn->options)
+ pScrn->options = xf86optionListMerge(pScrn->options, tmp);
+ else
+ pScrn->options = tmp;
+ }
+}
+
+/*
+ * xf86CollectInputOptions collects the options for an InputDevice.
+ * This function requires that the following has been initialised:
+ *
+ * pInfo->conf_idev
+ *
+ * The extraOpts parameter may optionally contain a list of additional options
+ * to include.
+ *
+ * The order of precedence for options is:
+ *
+ * extraOpts, pInfo->conf_idev->extraOptions,
+ * pInfo->conf_idev->commonOptions, defaultOpts
+ */
+
+void
+xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
+ pointer extraOpts)
+{
+ XF86OptionPtr tmp;
+ XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
+
+ pInfo->options = NULL;
+ if (defaultOpts) {
+ pInfo->options = xf86OptionListCreate(defaultOpts, -1, 0);
+ }
+ if (pInfo->conf_idev->commonOptions) {
+ tmp = xf86optionListDup(pInfo->conf_idev->commonOptions);
+ if (pInfo->options)
+ pInfo->options = xf86optionListMerge(pInfo->options, tmp);
+ else
+ pInfo->options = tmp;
+ }
+ if (pInfo->conf_idev->extraOptions) {
+ tmp = xf86optionListDup(pInfo->conf_idev->extraOptions);
+ if (pInfo->options)
+ pInfo->options = xf86optionListMerge(pInfo->options, tmp);
+ else
+ pInfo->options = tmp;
+ }
+ if (extras) {
+ tmp = xf86optionListDup(extras);
+ if (pInfo->options)
+ pInfo->options = xf86optionListMerge(pInfo->options, tmp);
+ else
+ pInfo->options = tmp;
+ }
+}
+
+/* Created for new XInput stuff -- essentially extensions to the parser */
+
+/* These xf86Set* functions are intended for use by non-screen specific code */
+
+int
+xf86SetIntOption(pointer optlist, const char *name, int deflt)
+{
+ OptionInfoRec o;
+
+ o.name = name;
+ o.type = OPTV_INTEGER;
+ if (ParseOptionValue(-1, optlist, &o))
+ deflt = o.value.num;
+ return deflt;
+}
+
+
+double
+xf86SetRealOption(pointer optlist, const char *name, double deflt)
+{
+ OptionInfoRec o;
+
+ o.name = name;
+ o.type = OPTV_REAL;
+ if (ParseOptionValue(-1, optlist, &o))
+ deflt = o.value.realnum;
+ return deflt;
+}
+
+
+char *
+xf86SetStrOption(pointer optlist, const char *name, char *deflt)
+{
+ OptionInfoRec o;
+
+ o.name = name;
+ o.type = OPTV_STRING;
+ if (ParseOptionValue(-1, optlist, &o))
+ deflt = o.value.str;
+ if (deflt)
+ return xstrdup(deflt);
+ else
+ return NULL;
+}
+
+
+int
+xf86SetBoolOption(pointer optlist, const char *name, int deflt)
+{
+ OptionInfoRec o;
+
+ o.name = name;
+ o.type = OPTV_BOOLEAN;
+ if (ParseOptionValue(-1, optlist, &o))
+ deflt = o.value.bool;
+ return deflt;
+}
+
+/*
+ * addNewOption() has the required property of replacing the option value
+ * it the option is alread present.
+ */
+pointer
+xf86ReplaceIntOption(pointer optlist, char *name, int val)
+{
+ char *tmp = xnfalloc(16);
+ sprintf(tmp,"%i",val);
+ return xf86AddNewOption(optlist,name,tmp);
+}
+
+pointer
+xf86ReplaceBoolOption(pointer optlist, char *name, Bool val)
+{
+ return xf86AddNewOption(optlist,name,(Bool)val?"True":"False");
+}
+
+pointer
+xf86ReplaceStrOption(pointer optlist, char *name, char* val)
+{
+ return xf86AddNewOption(optlist,name,val);
+}
+
+pointer
+xf86AddNewOption(pointer head, char *name, char *val)
+{
+ char *tmp = strdup(val);
+ char *tmp_name = strdup(name);
+
+ return xf86addNewOption(head, tmp_name, tmp);
+}
+
+
+pointer
+xf86NewOption(char *name, char *value)
+{
+ return xf86newOption(name, value);
+}
+
+
+pointer
+xf86NextOption(pointer list)
+{
+ return xf86nextOption(list);
+}
+
+pointer
+xf86OptionListCreate(const char **options, int count, int used)
+{
+ return xf86optionListCreate(options, count, used);
+}
+
+pointer
+xf86OptionListMerge(pointer head, pointer tail)
+{
+ return xf86optionListMerge(head, tail);
+}
+
+void
+xf86OptionListFree(pointer opt)
+{
+ xf86optionListFree(opt);
+}
+
+char *
+xf86OptionName(pointer opt)
+{
+ return xf86optionName(opt);
+}
+
+char *
+xf86OptionValue(pointer opt)
+{
+ return xf86optionValue(opt);
+}
+
+void
+xf86OptionListReport(pointer parm)
+{
+ XF86OptionPtr opts = parm;
+
+ while(opts) {
+ if (xf86optionValue(opts))
+ xf86ErrorFVerb(5, "\tOption \"%s\" \"%s\"\n",
+ xf86optionName(opts), xf86optionValue(opts));
+ else
+ xf86ErrorFVerb( 5, "\tOption \"%s\"\n", xf86optionName(opts));
+ opts = xf86nextOption(opts);
+ }
+}
+
+/* End of XInput-caused section */
+
+pointer
+xf86FindOption(pointer options, const char *name)
+{
+ return xf86findOption(options, name);
+}
+
+
+char *
+xf86FindOptionValue(pointer options, const char *name)
+{
+ return xf86findOptionValue(options, name);
+}
+
+
+void
+xf86MarkOptionUsed(pointer option)
+{
+ if (option != NULL)
+ ((XF86OptionPtr)option)->opt_used = TRUE;
+}
+
+
+void
+xf86MarkOptionUsedByName(pointer options, const char *name)
+{
+ XF86OptionPtr opt;
+
+ opt = xf86findOption(options, name);
+ if (opt != NULL)
+ opt->opt_used = TRUE;
+}
+
+Bool
+xf86CheckIfOptionUsed(pointer option)
+{
+ if (option != NULL)
+ return ((XF86OptionPtr)option)->opt_used;
+ else
+ return FALSE;
+}
+
+Bool
+xf86CheckIfOptionUsedByName(pointer options, const char *name)
+{
+ XF86OptionPtr opt;
+
+ opt = xf86findOption(options, name);
+ if (opt != NULL)
+ return opt->opt_used;
+ else
+ return FALSE;
+}
+
+void
+xf86ShowUnusedOptions(int scrnIndex, pointer options)
+{
+ XF86OptionPtr opt = options;
+
+ while (opt) {
+ if (opt->opt_name && !opt->opt_used) {
+ xf86DrvMsg(scrnIndex, X_WARNING, "Option \"%s\" is not used\n",
+ opt->opt_name);
+ }
+ opt = opt->list.next;
+ }
+}
+
+
+static Bool
+GetBoolValue(OptionInfoPtr p, const char *s)
+{
+ if (*s == '\0') {
+ p->value.bool = TRUE;
+ } else {
+ if (xf86NameCmp(s, "1") == 0)
+ p->value.bool = TRUE;
+ else if (xf86NameCmp(s, "on") == 0)
+ p->value.bool = TRUE;
+ else if (xf86NameCmp(s, "true") == 0)
+ p->value.bool = TRUE;
+ else if (xf86NameCmp(s, "yes") == 0)
+ p->value.bool = TRUE;
+ else if (xf86NameCmp(s, "0") == 0)
+ p->value.bool = FALSE;
+ else if (xf86NameCmp(s, "off") == 0)
+ p->value.bool = FALSE;
+ else if (xf86NameCmp(s, "false") == 0)
+ p->value.bool = FALSE;
+ else if (xf86NameCmp(s, "no") == 0)
+ p->value.bool = FALSE;
+ else
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static Bool
+ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
+{
+ char *s, *end;
+ Bool wasUsed;
+
+ if ((s = xf86findOptionValue(options, p->name)) != NULL) {
+ wasUsed = xf86CheckIfOptionUsedByName(options, p->name);
+ xf86MarkOptionUsedByName(options, p->name);
+ switch (p->type) {
+ case OPTV_INTEGER:
+ if (*s == '\0') {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires an integer value\n",
+ p->name);
+ p->found = FALSE;
+ } else {
+ p->value.num = strtoul(s, &end, 0);
+ if (*end == '\0') {
+ p->found = TRUE;
+ } else {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires an integer value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ }
+ break;
+ case OPTV_STRING:
+ if (*s == '\0') {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires an string value\n",
+ p->name);
+ p->found = FALSE;
+ } else {
+ p->value.str = s;
+ p->found = TRUE;
+ }
+ break;
+ case OPTV_ANYSTR:
+ p->value.str = s;
+ p->found = TRUE;
+ break;
+ case OPTV_REAL:
+ if (*s == '\0') {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a floating point value\n",
+ p->name);
+ p->found = FALSE;
+ } else {
+ p->value.realnum = strtod(s, &end);
+ if (*end == '\0') {
+ p->found = TRUE;
+ } else {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a floating point value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ }
+ break;
+ case OPTV_BOOLEAN:
+ if (GetBoolValue(p, s)) {
+ p->found = TRUE;
+ } else {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a boolean value\n", p->name);
+ p->found = FALSE;
+ }
+ break;
+ case OPTV_FREQ:
+ if (*s == '\0') {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ p->found = FALSE;
+ } else {
+ double freq = strtod(s, &end);
+ int units = 0;
+
+ if (end != s) {
+ p->found = TRUE;
+ if (!xf86NameCmp(end, "Hz"))
+ units = 1;
+ else if (!xf86NameCmp(end, "kHz") ||
+ !xf86NameCmp(end, "k"))
+ units = 1000;
+ else if (!xf86NameCmp(end, "MHz") ||
+ !xf86NameCmp(end, "M"))
+ units = 1000000;
+ else {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ if (p->found)
+ freq *= (double)units;
+ } else {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ if (p->found) {
+ p->value.freq.freq = freq;
+ p->value.freq.units = units;
+ }
+ }
+ break;
+ case OPTV_NONE:
+ /* Should never get here */
+ p->found = FALSE;
+ break;
+ }
+ if (p->found) {
+ int verb = 2;
+ if (wasUsed)
+ verb = 4;
+ xf86DrvMsgVerb(scrnIndex, X_CONFIG, verb, "Option \"%s\"", p->name);
+ if (!(p->type == OPTV_BOOLEAN && *s == 0)) {
+ xf86ErrorFVerb(verb, " \"%s\"", s);
+ }
+ xf86ErrorFVerb(verb, "\n");
+ }
+ } else if (p->type == OPTV_BOOLEAN) {
+ /* Look for matches with options with or without a "No" prefix. */
+ char *n, *newn;
+ OptionInfoRec opt;
+
+ n = xf86NormalizeName(p->name);
+ if (!n) {
+ p->found = FALSE;
+ return FALSE;
+ }
+ if (strncmp(n, "no", 2) == 0) {
+ newn = n + 2;
+ } else {
+ xfree(n);
+ n = xalloc(strlen(p->name) + 2 + 1);
+ if (!n) {
+ p->found = FALSE;
+ return FALSE;
+ }
+ strcpy(n, "No");
+ strcat(n, p->name);
+ newn = n;
+ }
+ if ((s = xf86findOptionValue(options, newn)) != NULL) {
+ xf86MarkOptionUsedByName(options, newn);
+ if (GetBoolValue(&opt, s)) {
+ p->value.bool = !opt.value.bool;
+ p->found = TRUE;
+ } else {
+ xf86DrvMsg(scrnIndex, X_WARNING,
+ "Option \"%s\" requires a boolean value\n", newn);
+ p->found = FALSE;
+ }
+ } else {
+ p->found = FALSE;
+ }
+ if (p->found) {
+ xf86DrvMsgVerb(scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn);
+ if (*s != 0) {
+ xf86ErrorFVerb(2, " \"%s\"", s);
+ }
+ xf86ErrorFVerb(2, "\n");
+ }
+ xfree(n);
+ } else {
+ p->found = FALSE;
+ }
+ return p->found;
+}
+
+
+void
+xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo)
+{
+ OptionInfoPtr p;
+
+ for (p = optinfo; p->name != NULL; p++) {
+ ParseOptionValue(scrnIndex, options, p);
+ }
+}
+
+
+OptionInfoPtr
+xf86TokenToOptinfo(const OptionInfoRec *table, int token)
+{
+ const OptionInfoRec *p;
+
+ if (!table) {
+ ErrorF("xf86TokenToOptinfo: table is NULL\n");
+ return NULL;
+ }
+
+ for (p = table; p->token >= 0 && p->token != token; p++)
+ ;
+
+ if (p->token < 0)
+ return NULL;
+ else
+ return (OptionInfoPtr)p;
+}
+
+
+const char *
+xf86TokenToOptName(const OptionInfoRec *table, int token)
+{
+ const OptionInfoRec *p;
+
+ p = xf86TokenToOptinfo(table, token);
+ return p->name;
+}
+
+
+Bool
+xf86IsOptionSet(const OptionInfoRec *table, int token)
+{
+ OptionInfoPtr p;
+
+ p = xf86TokenToOptinfo(table, token);
+ return (p && p->found);
+}
+
+
+char *
+xf86GetOptValString(const OptionInfoRec *table, int token)
+{
+ OptionInfoPtr p;
+
+ p = xf86TokenToOptinfo(table, token);
+ if (p && p->found)
+ return p->value.str;
+ else
+ return NULL;
+}
+
+
+Bool
+xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value)
+{
+ OptionInfoPtr p;
+
+ p = xf86TokenToOptinfo(table, token);
+ if (p && p->found) {
+ *value = p->value.num;
+ return TRUE;
+ } else
+ return FALSE;
+}
+
+
+Bool
+xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value)
+{
+ OptionInfoPtr p;
+
+ p = xf86TokenToOptinfo(table, token);
+ if (p && p->found) {
+ *value = p->value.num;
+ return TRUE;
+ } else
+ return FALSE;
+}
+
+
+Bool
+xf86GetOptValReal(const OptionInfoRec *table, int token, double *value)
+{
+ OptionInfoPtr p;
+
+ p = xf86TokenToOptinfo(table, token);
+ if (p && p->found) {
+ *value = p->value.realnum;
+ return TRUE;
+ } else
+ return FALSE;
+}
+
+
+Bool
+xf86GetOptValFreq(const OptionInfoRec *table, int token,
+ OptFreqUnits expectedUnits, double *value)
+{
+ OptionInfoPtr p;
+
+ p = xf86TokenToOptinfo(table, token);
+ if (p && p->found) {
+ if (p->value.freq.units > 0) {
+ /* Units give, so the scaling is known. */
+ switch (expectedUnits) {
+ case OPTUNITS_HZ:
+ *value = p->value.freq.freq;
+ break;
+ case OPTUNITS_KHZ:
+ *value = p->value.freq.freq / 1000.0;
+ break;
+ case OPTUNITS_MHZ:
+ *value = p->value.freq.freq / 1000000.0;
+ break;
+ }
+ } else {
+ /* No units given, so try to guess the scaling. */
+ switch (expectedUnits) {
+ case OPTUNITS_HZ:
+ *value = p->value.freq.freq;
+ break;
+ case OPTUNITS_KHZ:
+ if (p->value.freq.freq > 1000.0)
+ *value = p->value.freq.freq / 1000.0;
+ else
+ *value = p->value.freq.freq;
+ break;
+ case OPTUNITS_MHZ:
+ if (p->value.freq.freq > 1000000.0)
+ *value = p->value.freq.freq / 1000000.0;
+ else if (p->value.freq.freq > 1000.0)
+ *value = p->value.freq.freq / 1000.0;
+ else
+ *value = p->value.freq.freq;
+ }
+ }
+ return TRUE;
+ } else
+ return FALSE;
+}
+
+
+Bool
+xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value)
+{
+ OptionInfoPtr p;
+
+ p = xf86TokenToOptinfo(table, token);
+ if (p && p->found) {
+ *value = p->value.bool;
+ return TRUE;
+ } else
+ return FALSE;
+}
+
+
+Bool
+xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def)
+{
+ OptionInfoPtr p;
+
+ p = xf86TokenToOptinfo(table, token);
+ if (p && p->found) {
+ return p->value.bool;
+ } else
+ return def;
+}
+
+
+int
+xf86NameCmp(const char *s1, const char *s2)
+{
+ return xf86nameCompare(s1, s2);
+}
+
+char *
+xf86NormalizeName(const char *s)
+{
+ char *ret, *q;
+ const char *p;
+
+ if (s == NULL)
+ return NULL;
+
+ ret = xalloc(strlen(s) + 1);
+ for (p = s, q = ret; *p != 0; p++) {
+ switch (*p) {
+ case '_':
+ case ' ':
+ case '\t':
+ continue;
+ default:
+ if (isupper(*p))
+ *q++ = tolower(*p);
+ else
+ *q++ = *p;
+ }
+ }
+ *q = '\0';
+ return ret;
+}
diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c
new file mode 100644
index 000000000..03f5bdec1
--- /dev/null
+++ b/hw/xfree86/common/xf86PM.c
@@ -0,0 +1,188 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.8 2002/09/29 23:54:34 keithp Exp $ */
+
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Xinput.h"
+
+int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num) = NULL;
+pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event) = NULL;
+
+static Bool suspended = FALSE;
+
+static char *
+eventName(pmEvent event)
+{
+ switch(event) {
+ case XF86_APM_SYS_STANDBY: return ("System Standby Request");
+ case XF86_APM_SYS_SUSPEND: return ("System Suspend Request");
+ case XF86_APM_CRITICAL_SUSPEND: return ("Critical Suspend");
+ case XF86_APM_USER_STANDBY: return ("User System Standby Request");
+ case XF86_APM_USER_SUSPEND: return ("User System Suspend Request");
+ case XF86_APM_STANDBY_RESUME: return ("System Standby Resume");
+ case XF86_APM_NORMAL_RESUME: return ("Normal Resume System");
+ case XF86_APM_CRITICAL_RESUME: return ("Critical Resume System");
+ case XF86_APM_LOW_BATTERY: return ("Battery Low");
+ case XF86_APM_POWER_STATUS_CHANGE: return ("Power Status Change");
+ case XF86_APM_UPDATE_TIME: return ("Update Time");
+ case XF86_APM_CAPABILITY_CHANGED: return ("Capability Changed");
+ case XF86_APM_STANDBY_FAILED: return ("Standby Request Failed");
+ case XF86_APM_SUSPEND_FAILED: return ("Suspend Request Failed");
+ default: return ("Unknown Event");
+ }
+}
+
+static void
+suspend (pmEvent event, Bool undo)
+{
+ int i;
+ InputInfoPtr pInfo;
+
+ xf86inSuspend = TRUE;
+
+ for (i = 0; i < xf86NumScreens; i++) {
+ xf86EnableAccess(xf86Screens[i]);
+ if (xf86Screens[i]->EnableDisableFBAccess)
+ (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE);
+ }
+#if !defined(__EMX__)
+ pInfo = xf86InputDevs;
+ while (pInfo) {
+ DisableDevice(pInfo->dev);
+ pInfo = pInfo->next;
+ }
+#endif
+ xf86EnterServerState(SETUP);
+ for (i = 0; i < xf86NumScreens; i++) {
+ xf86EnableAccess(xf86Screens[i]);
+ if (xf86Screens[i]->PMEvent)
+ xf86Screens[i]->PMEvent(i,event,undo);
+ else {
+ xf86Screens[i]->LeaveVT(i, 0);
+ xf86Screens[i]->vtSema = FALSE;
+ }
+ }
+ xf86AccessLeave();
+ xf86AccessLeaveState();
+}
+
+static void
+resume(pmEvent event, Bool undo)
+{
+ int i;
+ InputInfoPtr pInfo;
+
+ xf86AccessEnter();
+ xf86EnterServerState(SETUP);
+ for (i = 0; i < xf86NumScreens; i++) {
+ xf86EnableAccess(xf86Screens[i]);
+ if (xf86Screens[i]->PMEvent)
+ xf86Screens[i]->PMEvent(i,event,undo);
+ else {
+ xf86Screens[i]->vtSema = TRUE;
+ xf86Screens[i]->EnterVT(i, 0);
+ }
+ }
+ xf86EnterServerState(OPERATING);
+ for (i = 0; i < xf86NumScreens; i++) {
+ xf86EnableAccess(xf86Screens[i]);
+ if (xf86Screens[i]->EnableDisableFBAccess)
+ (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE);
+ }
+ SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset);
+#if !defined(__EMX__)
+ pInfo = xf86InputDevs;
+ while (pInfo) {
+ EnableDevice(pInfo->dev);
+ pInfo = pInfo->next;
+ }
+#endif
+ xf86inSuspend = FALSE;
+}
+
+static void
+DoApmEvent(pmEvent event, Bool undo)
+{
+ /*
+ * we leave that as a global function for now. I don't know if
+ * this might cause problems in the future. It is a global server
+ * variable therefore it needs to be in a server info structure
+ */
+ int i;
+
+ switch(event) {
+ case XF86_APM_SYS_STANDBY:
+ case XF86_APM_SYS_SUSPEND:
+ case XF86_APM_CRITICAL_SUSPEND: /*do we want to delay a critical suspend?*/
+ case XF86_APM_USER_STANDBY:
+ case XF86_APM_USER_SUSPEND:
+ /* should we do this ? */
+ if (!undo && !suspended) {
+ suspend(event,undo);
+ suspended = TRUE;
+ } else if (undo && suspended) {
+ resume(event,undo);
+ suspended = FALSE;
+ }
+ break;
+ case XF86_APM_STANDBY_RESUME:
+ case XF86_APM_NORMAL_RESUME:
+ case XF86_APM_CRITICAL_RESUME:
+ if (suspended) {
+ resume(event,undo);
+ suspended = FALSE;
+ }
+ break;
+ default:
+ xf86EnterServerState(SETUP);
+ for (i = 0; i < xf86NumScreens; i++) {
+ xf86EnableAccess(xf86Screens[i]);
+ if (xf86Screens[i]->PMEvent)
+ xf86Screens[i]->PMEvent(i,event,undo);
+ }
+ xf86EnterServerState(OPERATING);
+ break;
+ }
+}
+
+#define MAX_NO_EVENTS 8
+
+void
+xf86HandlePMEvents(int fd, pointer data)
+{
+ pmEvent events[MAX_NO_EVENTS];
+ int i,n;
+ Bool wait = FALSE;
+
+ if (!xf86PMGetEventFromOs)
+ return;
+
+ if ((n = xf86PMGetEventFromOs(fd,events,MAX_NO_EVENTS))) {
+ do {
+ for (i = 0; i < n; i++) {
+ xf86MsgVerb(X_INFO,3,"PM Event received: %s\n",
+ eventName(events[i]));
+ DoApmEvent(events[i],FALSE);
+ switch (xf86PMConfirmEventToOs(fd,events[i])) {
+ case PM_WAIT:
+ wait = TRUE;
+ break;
+ case PM_CONTINUE:
+ wait = FALSE;
+ break;
+ case PM_FAILED:
+ DoApmEvent(events[i],TRUE);
+ wait = FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+ if (wait)
+ n = xf86PMGetEventFromOs(fd,events,MAX_NO_EVENTS);
+ else
+ break;
+ } while (1);
+ }
+}
diff --git a/hw/xfree86/common/xf86PciInfo.h b/hw/xfree86/common/xf86PciInfo.h
new file mode 100644
index 000000000..14f86cf89
--- /dev/null
+++ b/hw/xfree86/common/xf86PciInfo.h
@@ -0,0 +1,573 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.144 2003/02/07 20:41:11 martin Exp $ */
+/*
+ * Copyright 1995-2002 by The XFree86 Project, Inc.
+ *
+ * This file contains macros for the PCI Vendor and Device IDs for video
+ * cards plus a few other things that are needed in drivers or elsewhere.
+ * This information is used in several ways:
+ * 1. It is used by drivers and/or other code.
+ * 2. It is used by the pciid2c.pl script to determine what vendor data to
+ * include in the pcidata module that the X server loads.
+ * 3. A side-effect of 2. affects how config-generation works for
+ * otherwise "unknown" cards.
+ *
+ * Don't add entries here for vendors that don't make video cards,
+ * or for non-video devices unless they're needed by a driver or elsewhere.
+ * A comprehensive set of PCI vendor, device and subsystem data is
+ * auto-generated from the ../etc/pci.ids file using the pciids2c.pl script,
+ * and is used in both the scanpci module and the scanpci utility. Don't
+ * modify the pci.ids file. If new/corrected entries are required, add them
+ * to ../etc/extrapci.ids.
+ */
+
+
+#ifndef _XF86_PCIINFO_H
+#define _XF86_PCIINFO_H
+
+/* PCI Pseudo Vendor */
+#define PCI_VENDOR_GENERIC 0x00FF
+
+#define PCI_VENDOR_REAL3D 0x003D
+#define PCI_VENDOR_COMPAQ 0x0E11
+#define PCI_VENDOR_ATI 0x1002
+#define PCI_VENDOR_AVANCE 0x1005
+#define PCI_VENDOR_TSENG 0x100C
+#define PCI_VENDOR_NS 0x100B
+#define PCI_VENDOR_WEITEK 0x100E
+#define PCI_VENDOR_VIDEOLOGIC 0x1010
+#define PCI_VENDOR_DIGITAL 0x1011
+#define PCI_VENDOR_CIRRUS 0x1013
+#define PCI_VENDOR_AMD 0x1022
+#define PCI_VENDOR_TRIDENT 0x1023
+#define PCI_VENDOR_ALI 0x1025
+#define PCI_VENDOR_DELL 0x1028
+#define PCI_VENDOR_MATROX 0x102B
+#define PCI_VENDOR_CHIPSTECH 0x102C
+#define PCI_VENDOR_MIRO 0x1031
+#define PCI_VENDOR_NEC 0x1033
+#define PCI_VENDOR_SIS 0x1039
+#define PCI_VENDOR_HP 0x103C
+#define PCI_VENDOR_SGS 0x104A
+#define PCI_VENDOR_TI 0x104C
+#define PCI_VENDOR_SONY 0x104D
+#define PCI_VENDOR_OAK 0x104E
+#define PCI_VENDOR_MOTOROLA 0x1057
+#define PCI_VENDOR_NUMNINE 0x105D
+#define PCI_VENDOR_CYRIX 0x1078
+#define PCI_VENDOR_SUN 0x108E
+#define PCI_VENDOR_DIAMOND 0x1092
+#define PCI_VENDOR_BROOKTREE 0x109E
+#define PCI_VENDOR_ALI_2 0x10B9
+#define PCI_VENDOR_NEOMAGIC 0x10C8
+#define PCI_VENDOR_NVIDIA 0x10DE
+#define PCI_VENDOR_IMS 0x10E0
+#define PCI_VENDOR_INTEGRAPHICS 0x10EA
+#define PCI_VENDOR_VIA 0x1106
+#define PCI_VENDOR_ALLIANCE 0x1142
+#define PCI_VENDOR_RENDITION 0x1163
+#define PCI_VENDOR_3DFX 0x121A
+#define PCI_VENDOR_SMI 0x126F
+#define PCI_VENDOR_TRITECH 0x1292
+#define PCI_VENDOR_NVIDIA_SGS 0x12D2
+#define PCI_VENDOR_VMWARE 0x15AD
+#define PCI_VENDOR_3DLABS 0x3D3D
+#define PCI_VENDOR_AVANCE_2 0x4005
+#define PCI_VENDOR_HERCULES 0x4843
+#define PCI_VENDOR_S3 0x5333
+#define PCI_VENDOR_INTEL 0x8086
+#define PCI_VENDOR_ARK 0xEDD8
+
+
+/* Generic */
+#define PCI_CHIP_VGA 0x0000
+#define PCI_CHIP_8514 0x0001
+
+/* Real 3D */
+#define PCI_CHIP_I740_PCI 0x00D1
+
+/* Compaq */
+#define PCI_CHIP_QV1280 0x3033
+
+/* ATI */
+#define PCI_CHIP_R300_AD 0x4144
+#define PCI_CHIP_R300_AE 0x4145
+#define PCI_CHIP_R300_AF 0x4146
+#define PCI_CHIP_R300_AG 0x4147
+#define PCI_CHIP_MACH32 0x4158
+#define PCI_CHIP_R200_BB 0x4242
+#define PCI_CHIP_MACH64CT 0x4354
+#define PCI_CHIP_MACH64CX 0x4358
+#define PCI_CHIP_MACH64ET 0x4554
+#define PCI_CHIP_MACH64GB 0x4742
+#define PCI_CHIP_MACH64GD 0x4744
+#define PCI_CHIP_MACH64GI 0x4749
+#define PCI_CHIP_MACH64GL 0x474C
+#define PCI_CHIP_MACH64GM 0x474D
+#define PCI_CHIP_MACH64GN 0x474E
+#define PCI_CHIP_MACH64GO 0x474F
+#define PCI_CHIP_MACH64GP 0x4750
+#define PCI_CHIP_MACH64GQ 0x4751
+#define PCI_CHIP_MACH64GR 0x4752
+#define PCI_CHIP_MACH64GS 0x4753
+#define PCI_CHIP_MACH64GT 0x4754
+#define PCI_CHIP_MACH64GU 0x4755
+#define PCI_CHIP_MACH64GV 0x4756
+#define PCI_CHIP_MACH64GW 0x4757
+#define PCI_CHIP_MACH64GX 0x4758
+#define PCI_CHIP_MACH64GY 0x4759
+#define PCI_CHIP_MACH64GZ 0x475A
+#define PCI_CHIP_RV250_Id 0x4964
+#define PCI_CHIP_RV250_Ie 0x4965
+#define PCI_CHIP_RV250_If 0x4966
+#define PCI_CHIP_RV250_Ig 0x4967
+#define PCI_CHIP_MACH64LB 0x4C42
+#define PCI_CHIP_MACH64LD 0x4C44
+#define PCI_CHIP_RAGE128LE 0x4C45
+#define PCI_CHIP_RAGE128LF 0x4C46
+#define PCI_CHIP_MACH64LG 0x4C47
+#define PCI_CHIP_MACH64LI 0x4C49
+#define PCI_CHIP_MACH64LM 0x4C4D
+#define PCI_CHIP_MACH64LN 0x4C4E
+#define PCI_CHIP_MACH64LP 0x4C50
+#define PCI_CHIP_MACH64LQ 0x4C51
+#define PCI_CHIP_MACH64LR 0x4C52
+#define PCI_CHIP_MACH64LS 0x4C53
+#define PCI_CHIP_RADEON_LW 0x4C57
+#define PCI_CHIP_RADEON_LX 0x4C58
+#define PCI_CHIP_RADEON_LY 0x4C59
+#define PCI_CHIP_RADEON_LZ 0x4C5A
+#define PCI_CHIP_RV250_Ld 0x4C64
+#define PCI_CHIP_RV250_Le 0x4C65
+#define PCI_CHIP_RV250_Lf 0x4C66
+#define PCI_CHIP_RV250_Lg 0x4C67
+#define PCI_CHIP_RAGE128MF 0x4D46
+#define PCI_CHIP_RAGE128ML 0x4D4C
+#define PCI_CHIP_R300_ND 0x4E44
+#define PCI_CHIP_R300_NE 0x4E45
+#define PCI_CHIP_R300_NF 0x4E46
+#define PCI_CHIP_R300_NG 0x4E47
+#define PCI_CHIP_RAGE128PA 0x5041
+#define PCI_CHIP_RAGE128PB 0x5042
+#define PCI_CHIP_RAGE128PC 0x5043
+#define PCI_CHIP_RAGE128PD 0x5044
+#define PCI_CHIP_RAGE128PE 0x5045
+#define PCI_CHIP_RAGE128PF 0x5046
+#define PCI_CHIP_RAGE128PG 0x5047
+#define PCI_CHIP_RAGE128PH 0x5048
+#define PCI_CHIP_RAGE128PI 0x5049
+#define PCI_CHIP_RAGE128PJ 0x504A
+#define PCI_CHIP_RAGE128PK 0x504B
+#define PCI_CHIP_RAGE128PL 0x504C
+#define PCI_CHIP_RAGE128PM 0x504D
+#define PCI_CHIP_RAGE128PN 0x504E
+#define PCI_CHIP_RAGE128PO 0x504F
+#define PCI_CHIP_RAGE128PP 0x5050
+#define PCI_CHIP_RAGE128PQ 0x5051
+#define PCI_CHIP_RAGE128PR 0x5052
+#define PCI_CHIP_RAGE128PS 0x5053
+#define PCI_CHIP_RAGE128PT 0x5054
+#define PCI_CHIP_RAGE128PU 0x5055
+#define PCI_CHIP_RAGE128PV 0x5056
+#define PCI_CHIP_RAGE128PW 0x5057
+#define PCI_CHIP_RAGE128PX 0x5058
+#define PCI_CHIP_RADEON_QD 0x5144
+#define PCI_CHIP_RADEON_QE 0x5145
+#define PCI_CHIP_RADEON_QF 0x5146
+#define PCI_CHIP_RADEON_QG 0x5147
+#define PCI_CHIP_R200_QH 0x5148
+#define PCI_CHIP_R200_QI 0x5149
+#define PCI_CHIP_R200_QJ 0x514A
+#define PCI_CHIP_R200_QK 0x514B
+#define PCI_CHIP_R200_QL 0x514C
+#define PCI_CHIP_R200_QM 0x514D
+#define PCI_CHIP_R200_QN 0x514E
+#define PCI_CHIP_R200_QO 0x514F
+#define PCI_CHIP_RV200_QW 0x5157
+#define PCI_CHIP_RV200_QX 0x5158
+#define PCI_CHIP_RV100_QY 0x5159
+#define PCI_CHIP_RV100_QZ 0x515A
+#define PCI_CHIP_R200_Qh 0x5168
+#define PCI_CHIP_R200_Qi 0x5169
+#define PCI_CHIP_R200_Qj 0x516A
+#define PCI_CHIP_R200_Qk 0x516B
+#define PCI_CHIP_R200_Ql 0x516C /* Undocumented in all ATI manuals */
+#define PCI_CHIP_RAGE128RE 0x5245
+#define PCI_CHIP_RAGE128RF 0x5246
+#define PCI_CHIP_RAGE128RG 0x5247
+#define PCI_CHIP_RAGE128RK 0x524B
+#define PCI_CHIP_RAGE128RL 0x524C
+#define PCI_CHIP_RAGE128SE 0x5345
+#define PCI_CHIP_RAGE128SF 0x5346
+#define PCI_CHIP_RAGE128SG 0x5347
+#define PCI_CHIP_RAGE128SH 0x5348
+#define PCI_CHIP_RAGE128SK 0x534B
+#define PCI_CHIP_RAGE128SL 0x534C
+#define PCI_CHIP_RAGE128SM 0x534D
+#define PCI_CHIP_RAGE128SN 0x534E
+#define PCI_CHIP_RAGE128TF 0x5446
+#define PCI_CHIP_RAGE128TL 0x544C
+#define PCI_CHIP_RAGE128TR 0x5452
+#define PCI_CHIP_RAGE128TS 0x5453
+#define PCI_CHIP_RAGE128TT 0x5454
+#define PCI_CHIP_RAGE128TU 0x5455
+#define PCI_CHIP_MACH64VT 0x5654
+#define PCI_CHIP_MACH64VU 0x5655
+#define PCI_CHIP_MACH64VV 0x5656
+
+/* Avance Logic */
+#define PCI_CHIP_ALG2064 0x2064
+#define PCI_CHIP_ALG2301 0x2301
+#define PCI_CHIP_ALG2501 0x2501
+
+/* Tseng */
+#define PCI_CHIP_ET4000_W32P_A 0x3202
+#define PCI_CHIP_ET4000_W32P_B 0x3205
+#define PCI_CHIP_ET4000_W32P_D 0x3206
+#define PCI_CHIP_ET4000_W32P_C 0x3207
+#define PCI_CHIP_ET6000 0x3208
+#define PCI_CHIP_ET6300 0x4702
+
+/* Weitek */
+#define PCI_CHIP_P9000 0x9001
+#define PCI_CHIP_P9100 0x9100
+
+/* Digital */
+#define PCI_CHIP_DC21050 0x0001
+#define PCI_CHIP_DEC21030 0x0004
+#define PCI_CHIP_TGA2 0x000D
+
+/* Cirrus Logic */
+#define PCI_CHIP_GD7548 0x0038
+#define PCI_CHIP_GD7555 0x0040
+#define PCI_CHIP_GD5430 0x00A0
+#define PCI_CHIP_GD5434_4 0x00A4
+#define PCI_CHIP_GD5434_8 0x00A8
+#define PCI_CHIP_GD5436 0x00AC
+#define PCI_CHIP_GD5446 0x00B8
+#define PCI_CHIP_GD5480 0x00BC
+#define PCI_CHIP_GD5462 0x00D0
+#define PCI_CHIP_GD5464 0x00D4
+#define PCI_CHIP_GD5464BD 0x00D5
+#define PCI_CHIP_GD5465 0x00D6
+#define PCI_CHIP_6729 0x1100
+#define PCI_CHIP_6832 0x1110
+#define PCI_CHIP_GD7542 0x1200
+#define PCI_CHIP_GD7543 0x1202
+#define PCI_CHIP_GD7541 0x1204
+
+/* AMD */
+#define PCI_CHIP_AMD761 0x700E
+
+/* Trident */
+#define PCI_CHIP_8400 0x8400
+#define PCI_CHIP_8420 0x8420
+#define PCI_CHIP_8500 0x8500
+#define PCI_CHIP_8520 0x8520
+#define PCI_CHIP_8600 0x8600
+#define PCI_CHIP_8620 0x8620
+#define PCI_CHIP_8820 0x8820
+#define PCI_CHIP_9320 0x9320
+#define PCI_CHIP_9388 0x9388
+#define PCI_CHIP_9397 0x9397
+#define PCI_CHIP_939A 0x939A
+#define PCI_CHIP_9420 0x9420
+#define PCI_CHIP_9440 0x9440
+#define PCI_CHIP_9520 0x9520
+#define PCI_CHIP_9525 0x9525
+#define PCI_CHIP_9540 0x9540
+#define PCI_CHIP_9660 0x9660
+#define PCI_CHIP_9750 0x9750
+#define PCI_CHIP_9850 0x9850
+#define PCI_CHIP_9880 0x9880
+#define PCI_CHIP_9910 0x9910
+
+/* ALI */
+#define PCI_CHIP_M1435 0x1435
+
+/* Matrox */
+#define PCI_CHIP_MGA2085 0x0518
+#define PCI_CHIP_MGA2064 0x0519
+#define PCI_CHIP_MGA1064 0x051A
+#define PCI_CHIP_MGA2164 0x051B
+#define PCI_CHIP_MGA2164_AGP 0x051F
+#define PCI_CHIP_MGAG200_PCI 0x0520
+#define PCI_CHIP_MGAG200 0x0521
+#define PCI_CHIP_MGAG400 0x0525
+#define PCI_CHIP_MGAG550 0x2527
+#define PCI_CHIP_IMPRESSION 0x0D10
+#define PCI_CHIP_MGAG100_PCI 0x1000
+#define PCI_CHIP_MGAG100 0x1001
+
+#define PCI_CARD_G400_TH 0x2179
+#define PCI_CARD_MILL_G200_SD 0xFF00
+#define PCI_CARD_PROD_G100_SD 0xFF01
+#define PCI_CARD_MYST_G200_SD 0xFF02
+#define PCI_CARD_MILL_G200_SG 0xFF03
+#define PCI_CARD_MARV_G200_SD 0xFF04
+
+/* Chips & Tech */
+#define PCI_CHIP_65545 0x00D8
+#define PCI_CHIP_65548 0x00DC
+#define PCI_CHIP_65550 0x00E0
+#define PCI_CHIP_65554 0x00E4
+#define PCI_CHIP_65555 0x00E5
+#define PCI_CHIP_68554 0x00F4
+#define PCI_CHIP_69000 0x00C0
+#define PCI_CHIP_69030 0x0C30
+
+/* Miro */
+#define PCI_CHIP_ZR36050 0x5601
+
+/* NEC */
+#define PCI_CHIP_POWER_VR 0x0046
+
+/* SiS */
+#define PCI_CHIP_SG86C201 0x0001
+#define PCI_CHIP_SG86C202 0x0002
+#define PCI_CHIP_SG85C503 0x0008
+#define PCI_CHIP_SIS5597 0x0200
+/* Agregado por Carlos Duclos & Manuel Jander */
+#define PCI_CHIP_SIS82C204 0x0204
+#define PCI_CHIP_SG86C205 0x0205
+#define PCI_CHIP_SG86C215 0x0215
+#define PCI_CHIP_SG86C225 0x0225
+#define PCI_CHIP_85C501 0x0406
+#define PCI_CHIP_85C496 0x0496
+#define PCI_CHIP_85C601 0x0601
+#define PCI_CHIP_85C5107 0x5107
+#define PCI_CHIP_85C5511 0x5511
+#define PCI_CHIP_85C5513 0x5513
+#define PCI_CHIP_SIS5571 0x5571
+#define PCI_CHIP_SIS5597_2 0x5597
+#define PCI_CHIP_SIS530 0x6306
+#define PCI_CHIP_SIS6326 0x6326
+#define PCI_CHIP_SIS7001 0x7001
+#define PCI_CHIP_SIS300 0x0300
+#define PCI_CHIP_SIS315H 0x0310
+#define PCI_CHIP_SIS315PRO 0x0325
+#define PCI_CHIP_SIS330 0x0330
+#define PCI_CHIP_SIS630 0x6300
+#define PCI_CHIP_SIS540 0x5300
+#define PCI_CHIP_SIS550 0x5315
+#define PCI_CHIP_SIS650 0x6325
+#define PCI_CHIP_SIS730 0x7300
+
+/* Hewlett-Packard */
+#define PCI_CHIP_ELROY 0x1054
+#define PCI_CHIP_ZX1_SBA 0x1229
+#define PCI_CHIP_ZX1_IOC 0x122A
+#define PCI_CHIP_ZX1_LBA 0x122E /* a.k.a. Mercury */
+
+/* SGS */
+#define PCI_CHIP_STG2000 0x0008
+#define PCI_CHIP_STG1764 0x0009
+#define PCI_CHIP_KYROII 0x0010
+
+/* Texas Instruments */
+#define PCI_CHIP_TI_PERMEDIA 0x3D04
+#define PCI_CHIP_TI_PERMEDIA2 0x3D07
+
+/* Oak */
+#define PCI_CHIP_OTI107 0x0107
+
+/* Number Nine */
+#define PCI_CHIP_I128 0x2309
+#define PCI_CHIP_I128_2 0x2339
+#define PCI_CHIP_I128_T2R 0x493D
+#define PCI_CHIP_I128_T2R4 0x5348
+
+/* Sun */
+#define PCI_CHIP_EBUS 0x1000
+#define PCI_CHIP_HAPPY_MEAL 0x1001
+#define PCI_CHIP_SIMBA 0x5000
+#define PCI_CHIP_PSYCHO 0x8000
+#define PCI_CHIP_SCHIZO 0x8001
+#define PCI_CHIP_SABRE 0xA000
+#define PCI_CHIP_HUMMINGBIRD 0xA001
+
+/* BrookTree */
+#define PCI_CHIP_BT848 0x0350
+#define PCI_CHIP_BT849 0x0351
+
+/* Acer Laboratories Inc (ALI_2) */
+#define PCI_CHIP_M1541 0x1541
+
+/* NVIDIA */
+#define PCI_CHIP_NV1 0x0008
+#define PCI_CHIP_DAC64 0x0009
+#define PCI_CHIP_TNT 0x0020
+#define PCI_CHIP_TNT2 0x0028
+#define PCI_CHIP_UTNT2 0x0029
+#define PCI_CHIP_VTNT2 0x002C
+#define PCI_CHIP_UVTNT2 0x002D
+#define PCI_CHIP_ITNT2 0x00A0
+#define PCI_CHIP_GEFORCE_256 0x0100
+#define PCI_CHIP_GEFORCE_DDR 0x0101
+#define PCI_CHIP_QUADRO 0x0103
+#define PCI_CHIP_GEFORCE2_MX 0x0110
+#define PCI_CHIP_GEFORCE2_MX_100 0x0111
+#define PCI_CHIP_GEFORCE2_GO 0x0112
+#define PCI_CHIP_QUADRO2_MXR 0x0113
+#define PCI_CHIP_GEFORCE2_GTS 0x0150
+#define PCI_CHIP_GEFORCE2_TI 0x0151
+#define PCI_CHIP_GEFORCE2_ULTRA 0x0152
+#define PCI_CHIP_QUADRO2_PRO 0x0153
+#define PCI_CHIP_GEFORCE4_MX_460 0x0170
+#define PCI_CHIP_GEFORCE4_MX_440 0x0171
+#define PCI_CHIP_GEFORCE4_MX_420 0x0172
+#define PCI_CHIP_GEFORCE4_440_GO 0x0174
+#define PCI_CHIP_GEFORCE4_420_GO 0x0175
+#define PCI_CHIP_GEFORCE4_420_GO_M32 0x0176
+#define PCI_CHIP_QUADRO4_500XGL 0x0178
+#define PCI_CHIP_GEFORCE4_440_GO_M64 0x0179
+#define PCI_CHIP_QUADRO4_200 0x017A
+#define PCI_CHIP_QUADRO4_550XGL 0x017B
+#define PCI_CHIP_QUADRO4_500_GOGL 0x017C
+#define PCI_CHIP_IGEFORCE2 0x01A0
+#define PCI_CHIP_GEFORCE3 0x0200
+#define PCI_CHIP_GEFORCE3_TI_200 0x0201
+#define PCI_CHIP_GEFORCE3_TI_500 0x0202
+#define PCI_CHIP_QUADRO_DCC 0x0203
+#define PCI_CHIP_GEFORCE4_TI_4600 0x0250
+#define PCI_CHIP_GEFORCE4_TI_4400 0x0251
+#define PCI_CHIP_GEFORCE4_TI_4200 0x0253
+#define PCI_CHIP_QUADRO4_900XGL 0x0258
+#define PCI_CHIP_QUADRO4_750XGL 0x0259
+#define PCI_CHIP_QUADRO4_700XGL 0x025B
+
+/* NVIDIA & SGS */
+#define PCI_CHIP_RIVA128 0x0018
+
+/* IMS */
+#define PCI_CHIP_IMSTT128 0x9128
+#define PCI_CHIP_IMSTT3D 0x9135
+
+/* VIA Technologies */
+#define PCI_CHIP_APOLLOVP1 0x0585
+#define PCI_CHIP_APOLLOPRO133X 0x0691
+
+/* Alliance Semiconductor */
+#define PCI_CHIP_AP6410 0x3210
+#define PCI_CHIP_AP6422 0x6422
+#define PCI_CHIP_AT24 0x6424
+#define PCI_CHIP_AT3D 0x643D
+
+/* 3dfx Interactive */
+#define PCI_CHIP_VOODOO_GRAPHICS 0x0001
+#define PCI_CHIP_VOODOO2 0x0002
+#define PCI_CHIP_BANSHEE 0x0003
+#define PCI_CHIP_VOODOO3 0x0005
+#define PCI_CHIP_VOODOO5 0x0009
+
+#define PCI_CARD_VOODOO3_2000 0x0036
+#define PCI_CARD_VOODOO3_3000 0x003A
+
+/* Rendition */
+#define PCI_CHIP_V1000 0x0001
+#define PCI_CHIP_V2x00 0x2000
+
+/* 3Dlabs */
+#define PCI_CHIP_300SX 0x0001
+#define PCI_CHIP_500TX 0x0002
+#define PCI_CHIP_DELTA 0x0003
+#define PCI_CHIP_PERMEDIA 0x0004
+#define PCI_CHIP_MX 0x0006
+#define PCI_CHIP_PERMEDIA2 0x0007
+#define PCI_CHIP_GAMMA 0x0008
+#define PCI_CHIP_PERMEDIA2V 0x0009
+#define PCI_CHIP_PERMEDIA3 0x000A
+#define PCI_CHIP_PERMEDIA4 0x000C
+#define PCI_CHIP_R4 0x000D
+#define PCI_CHIP_GAMMA2 0x000E
+#define PCI_CHIP_R4ALT 0x0011
+
+/* S3 */
+#define PCI_CHIP_PLATO 0x0551
+#define PCI_CHIP_VIRGE 0x5631
+#define PCI_CHIP_TRIO 0x8811
+#define PCI_CHIP_AURORA64VP 0x8812
+#define PCI_CHIP_TRIO64UVP 0x8814
+#define PCI_CHIP_VIRGE_VX 0x883D
+#define PCI_CHIP_868 0x8880
+#define PCI_CHIP_928 0x88B0
+#define PCI_CHIP_864_0 0x88C0
+#define PCI_CHIP_864_1 0x88C1
+#define PCI_CHIP_964_0 0x88D0
+#define PCI_CHIP_964_1 0x88D1
+#define PCI_CHIP_968 0x88F0
+#define PCI_CHIP_TRIO64V2_DXGX 0x8901
+#define PCI_CHIP_PLATO_PX 0x8902
+#define PCI_CHIP_Trio3D 0x8904
+#define PCI_CHIP_Trio3D_2X 0x8A13
+#define PCI_CHIP_VIRGE_DXGX 0x8A01
+#define PCI_CHIP_VIRGE_GX2 0x8A10
+#define PCI_CHIP_SAVAGE3D 0x8A20
+#define PCI_CHIP_SAVAGE3D_MV 0x8A21
+#define PCI_CHIP_SAVAGE4 0x8A22
+#define PCI_CHIP_VIRGE_MX 0x8C01
+#define PCI_CHIP_VIRGE_MXPLUS 0x8C01
+#define PCI_CHIP_VIRGE_MXP 0x8C03
+#define PCI_CHIP_PROSAVAGE_PM 0x8A25
+#define PCI_CHIP_PROSAVAGE_KM 0x8A26
+#define PCI_CHIP_SAVAGE_MX_MV 0x8C10
+#define PCI_CHIP_SAVAGE_MX 0x8C11
+#define PCI_CHIP_SAVAGE_IX_MV 0x8C12
+#define PCI_CHIP_SAVAGE_IX 0x8C13
+#define PCI_CHIP_SAVAGE2000 0x9102
+
+/* ARK Logic */
+#define PCI_CHIP_1000PV 0xA091
+#define PCI_CHIP_2000PV 0xA099
+#define PCI_CHIP_2000MT 0xA0A1
+#define PCI_CHIP_2000MI 0xA0A9
+
+/* Tritech Microelectronics */
+#define PCI_CHIP_TR25202 0xFC02
+
+/* Neomagic */
+#define PCI_CHIP_NM2070 0x0001
+#define PCI_CHIP_NM2090 0x0002
+#define PCI_CHIP_NM2093 0x0003
+#define PCI_CHIP_NM2097 0x0083
+#define PCI_CHIP_NM2160 0x0004
+#define PCI_CHIP_NM2200 0x0005
+#define PCI_CHIP_NM2230 0x0025
+#define PCI_CHIP_NM2360 0x0006
+#define PCI_CHIP_NM2380 0x0016
+
+/* Intel */
+#define PCI_CHIP_I815_BRIDGE 0x1130
+#define PCI_CHIP_I815 0x1132
+#define PCI_CHIP_430HX_BRIDGE 0x1250
+#define PCI_CHIP_82801_P2P 0x244E
+#define PCI_CHIP_845_G_BRIDGE 0x2560
+#define PCI_CHIP_845_G 0x2562
+#define PCI_CHIP_I830_M_BRIDGE 0x3575
+#define PCI_CHIP_I830_M 0x3577
+#define PCI_CHIP_I810_BRIDGE 0x7120
+#define PCI_CHIP_I810 0x7121
+#define PCI_CHIP_I810_DC100_BRIDGE 0x7122
+#define PCI_CHIP_I810_DC100 0x7123
+#define PCI_CHIP_I810_E_BRIDGE 0x7124
+#define PCI_CHIP_I810_E 0x7125
+#define PCI_CHIP_440BX_BRIDGE 0x7190
+#define PCI_CHIP_I740_AGP 0x7800
+#define PCI_CHIP_460GX_PXB 0x84CB
+#define PCI_CHIP_460GX_SAC 0x84E0
+#define PCI_CHIP_460GX_GXB_2 0x84E2 /* PCI function 2 */
+#define PCI_CHIP_460GX_WXB 0x84E6
+#define PCI_CHIP_460GX_GXB_1 0x84EA /* PCI function 1 */
+
+/* Silicon Motion Inc. */
+#define PCI_CHIP_SMI910 0x0910
+#define PCI_CHIP_SMI810 0x0810
+#define PCI_CHIP_SMI820 0x0820
+#define PCI_CHIP_SMI710 0x0710
+#define PCI_CHIP_SMI712 0x0712
+#define PCI_CHIP_SMI720 0x0720
+
+/* VMware */
+#define PCI_CHIP_VMWARE0405 0x0405
+#define PCI_CHIP_VMWARE0710 0x0710
+
+#endif /* _XF86_PCIINFO_H */
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
new file mode 100644
index 000000000..ff704b912
--- /dev/null
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -0,0 +1,234 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.37 2003/02/20 04:05:14 dawes Exp $ */
+
+/*
+ * Copyright (c) 1997,1998 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains definitions of the private XFree86 data structures/types.
+ * None of the data structures here should be used by video drivers.
+ */
+
+#ifndef _XF86PRIVSTR_H
+#define _XF86PRIVSTR_H
+
+#include "xf86Pci.h"
+#include "xf86str.h"
+
+/* PCI probe flags */
+
+typedef enum {
+ PCIProbe1 = 0,
+ PCIProbe2,
+ PCIForceConfig1,
+ PCIForceConfig2,
+ PCIForceNone,
+ PCIOsConfig
+} PciProbeType;
+
+typedef enum {
+ LogNone,
+ LogFlush,
+ LogSync
+} Log;
+
+typedef enum {
+ SKNever,
+ SKWhenNeeded,
+ SKAlways
+} SpecialKeysInDDX;
+
+/*
+ * xf86InfoRec contains global parameters which the video drivers never
+ * need to access. Global parameters which the video drivers do need
+ * should be individual globals.
+ */
+
+typedef struct {
+
+ /* keyboard part */
+ DeviceIntPtr pKeyboard;
+ DeviceProc kbdProc; /* procedure for initializing */
+ void (* kbdEvents)(void); /* proc for processing events */
+ int consoleFd;
+ int kbdFd;
+ int vtno;
+ int kbdType; /* AT84 / AT101 */
+ int kbdRate;
+ int kbdDelay;
+ int bell_pitch;
+ int bell_duration;
+ Bool autoRepeat;
+ unsigned long leds;
+ unsigned long xleds;
+ char * vtinit;
+ int scanPrefix; /* scancode-state */
+ Bool capsLock;
+ Bool numLock;
+ Bool scrollLock;
+ Bool modeSwitchLock;
+ Bool composeLock;
+ Bool vtSysreq;
+ SpecialKeysInDDX ddxSpecialKeys;
+ Bool ActionKeyBindingsSet;
+#if defined(SVR4) && defined(i386)
+ Bool panix106;
+#endif /* SVR4 && i386 */
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+ int wsKbdType;
+#endif
+
+ /* mouse part */
+ DeviceIntPtr pMouse;
+#ifdef XINPUT
+ pointer mouseLocal;
+#endif
+
+ /* event handler part */
+ int lastEventTime;
+ Bool vtRequestsPending;
+ Bool inputPending;
+ Bool dontVTSwitch;
+ Bool dontZap;
+ Bool dontZoom;
+ Bool notrapSignals; /* don't exit cleanly - die at fault */
+ Bool caughtSignal;
+
+ /* graphics part */
+ Bool sharedMonitor;
+ ScreenPtr currentScreen;
+#ifdef CSRG_BASED
+ int screenFd; /* fd for memory mapped access to
+ * vga card */
+ int consType; /* Which console driver? */
+#endif
+
+#ifdef XKB
+ /*
+ * would like to use an XkbComponentNamesRec here but can't without
+ * pulling in a bunch of header files. :-(
+ */
+ char * xkbkeymap;
+ char * xkbkeycodes;
+ char * xkbtypes;
+ char * xkbcompat;
+ char * xkbsymbols;
+ char * xkbgeometry;
+ Bool xkbcomponents_specified;
+ char * xkbrules;
+ char * xkbmodel;
+ char * xkblayout;
+ char * xkbvariant;
+ char * xkboptions;
+#endif
+
+ /* Other things */
+ Bool allowMouseOpenFail;
+ Bool vidModeEnabled; /* VidMode extension enabled */
+ Bool vidModeAllowNonLocal; /* allow non-local VidMode
+ * connections */
+ Bool miscModInDevEnabled; /* Allow input devices to be
+ * changed */
+ Bool miscModInDevAllowNonLocal;
+ PciProbeType pciFlags;
+ Pix24Flags pixmap24;
+ MessageType pix24From;
+#if defined(i386) || defined(__i386__)
+ Bool pc98;
+#endif
+ Bool pmFlag;
+ Log log;
+ int estimateSizesAggressively;
+ Bool kbdCustomKeycodes;
+ Bool disableRandR;
+ MessageType randRFrom;
+ struct {
+ Bool disabled; /* enable/disable deactivating
+ * grabs or closing the
+ * connection to the grabbing
+ * client */
+ ClientPtr override; /* client that disabled
+ * grab deactivation.
+ */
+ Bool allowDeactivate;
+ Bool allowClosedown;
+ ServerGrabInfoRec server;
+ } grabInfo;
+} xf86InfoRec, *xf86InfoPtr;
+
+#ifdef DPMSExtension
+/* Private info for DPMS */
+typedef struct {
+ DPMSSetProcPtr Set;
+ CloseScreenProcPtr CloseScreen;
+ Bool Enabled;
+ int Flags;
+} DPMSRec, *DPMSPtr;
+#endif
+
+#ifdef XF86VIDMODE
+/* Private info for Video Mode Extentsion */
+typedef struct {
+ DisplayModePtr First;
+ DisplayModePtr Next;
+ int Flags;
+ CloseScreenProcPtr CloseScreen;
+} VidModeRec, *VidModePtr;
+#endif
+
+/* private resource types */
+#define ResNoAvoid ResBios
+
+/* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
+#define XLED1 ((unsigned long) 0x00000001)
+#define XLED2 ((unsigned long) 0x00000002)
+#define XLED3 ((unsigned long) 0x00000004)
+#define XLED4 ((unsigned long) 0x00000008)
+#define XCAPS ((unsigned long) 0x20000000)
+#define XNUM ((unsigned long) 0x40000000)
+#define XSCR ((unsigned long) 0x80000000)
+#define XCOMP ((unsigned long) 0x00008000)
+
+/* BSD console driver types (consType) */
+#ifdef CSRG_BASED
+#define PCCONS 0
+#define CODRV011 1
+#define CODRV01X 2
+#define SYSCONS 8
+#define PCVT 16
+#define WSCONS 32
+#endif
+
+/* Prefix strings for driver messages */
+#ifndef X_UNKNOWN_STRING
+#define X_UNKNOWN_STRING "(\?\?)"
+#endif
+#ifndef X_PROBE_STRING
+#define X_PROBE_STRING "(--)"
+#endif
+#ifndef X_CONFIG_STRING
+#define X_CONFIG_STRING "(**)"
+#endif
+#ifndef X_DEFAULT_STRING
+#define X_DEFAULT_STRING "(==)"
+#endif
+#ifndef X_CMDLINE_STRING
+#define X_CMDLINE_STRING "(++)"
+#endif
+#ifndef X_NOTICE_STRING
+#define X_NOTICE_STRING "(!!)"
+#endif
+#ifndef X_ERROR_STRING
+#define X_ERROR_STRING "(EE)"
+#endif
+#ifndef X_WARNING_STRING
+#define X_WARNING_STRING "(WW)"
+#endif
+#ifndef X_INFO_STRING
+#define X_INFO_STRING "(II)"
+#endif
+#ifndef X_NOT_IMPLEMENTED_STRING
+#define X_NOT_IMPLEMENTED_STRING "(NI)"
+#endif
+
+#endif /* _XF86PRIVSTR_H */
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
new file mode 100644
index 000000000..c2dbcc170
--- /dev/null
+++ b/hw/xfree86/common/xf86RandR.c
@@ -0,0 +1,280 @@
+/*
+ * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.4 2003/02/13 10:49:38 eich Exp $
+ *
+ * Copyright © 2002 Keith Packard, member of The XFree86 Project, 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, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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.
+ */
+
+#include "X.h"
+#include "os.h"
+#include "mibank.h"
+#include "globals.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86DDC.h"
+#include "mipointer.h"
+#include <randrstr.h>
+
+typedef struct _xf86RandRInfo {
+ CreateScreenResourcesProcPtr CreateScreenResources;
+ CloseScreenProcPtr CloseScreen;
+ int virtualX;
+ int virtualY;
+} XF86RandRInfoRec, *XF86RandRInfoPtr;
+
+static int xf86RandRIndex;
+static int xf86RandRGeneration;
+
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[xf86RandRIndex].ptr)
+
+static int
+xf86RandRModeRefresh (DisplayModePtr mode)
+{
+ if (mode->VRefresh)
+ return (int) mode->VRefresh;
+ else
+ return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal);
+}
+
+static Bool
+xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
+{
+ RRScreenSizePtr pSize;
+ ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+ DisplayModePtr mode;
+ Bool reportVirtual = TRUE;
+ int refresh0 = 60;
+
+ *rotations = RR_Rotate_0;
+
+ for (mode = scrp->modes; ; mode = mode->next)
+ {
+ int refresh = xf86RandRModeRefresh (mode);
+ if (mode == scrp->modes)
+ refresh0 = refresh;
+ pSize = RRRegisterSize (pScreen,
+ mode->HDisplay, mode->VDisplay,
+ pScreen->mmWidth, pScreen->mmHeight);
+ if (!pSize)
+ return FALSE;
+ if (mode->HDisplay == randrp->virtualX &&
+ mode->VDisplay == randrp->virtualY)
+ reportVirtual = FALSE;
+ RRRegisterRate (pScreen, pSize, refresh);
+ if (mode == scrp->currentMode &&
+ mode->HDisplay == pScreen->width && mode->VDisplay == pScreen->height)
+ RRSetCurrentConfig (pScreen, RR_Rotate_0, refresh, pSize);
+ if (mode->next == scrp->modes)
+ break;
+ }
+ if (reportVirtual)
+ {
+ mode = scrp->modes;
+ pSize = RRRegisterSize (pScreen,
+ randrp->virtualX, randrp->virtualY,
+ pScreen->mmWidth * randrp->virtualX / mode->HDisplay,
+ pScreen->mmHeight * randrp->virtualY / mode->VDisplay);
+ if (!pSize)
+ return FALSE;
+ RRRegisterRate (pScreen, pSize, refresh0);
+ if (pScreen->width == randrp->virtualX &&
+ pScreen->height == randrp->virtualY)
+ {
+ RRSetCurrentConfig (pScreen, RR_Rotate_0, refresh0, pSize);
+ }
+ }
+ return TRUE;
+}
+
+static Bool
+xf86RandRSetMode (ScreenPtr pScreen,
+ DisplayModePtr mode,
+ Bool useVirtual)
+{
+ ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+ int oldWidth = pScreen->width;
+ int oldHeight = pScreen->height;
+ WindowPtr pRoot = WindowTable[pScreen->myNum];
+
+ if (pRoot)
+ xf86EnableDisableFBAccess (pScreen->myNum, FALSE);
+ if (useVirtual)
+ {
+ scrp->virtualX = randrp->virtualX;
+ scrp->virtualY = randrp->virtualY;
+ }
+ else
+ {
+ scrp->virtualX = mode->HDisplay;
+ scrp->virtualY = mode->VDisplay;
+ }
+ pScreen->width = scrp->virtualX;
+ pScreen->height = scrp->virtualY;
+ if (!xf86SwitchMode (pScreen, mode))
+ {
+ scrp->virtualX = pScreen->width = oldWidth;
+ scrp->virtualY = pScreen->height = oldHeight;
+ return FALSE;
+ }
+ /*
+ * Make sure the layout is correct
+ */
+ xf86ReconfigureLayout();
+
+ /*
+ * Make sure the whole screen is visible
+ */
+ xf86SetViewport (pScreen, pScreen->width, pScreen->height);
+ xf86SetViewport (pScreen, 0, 0);
+ if (pRoot)
+ xf86EnableDisableFBAccess (pScreen->myNum, TRUE);
+ return TRUE;
+}
+
+static Bool
+xf86RandRSetConfig (ScreenPtr pScreen,
+ Rotation rotation,
+ int rate,
+ RRScreenSizePtr pSize)
+{
+ ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+ DisplayModePtr mode;
+ int px, py;
+ Bool useVirtual = FALSE;
+
+ miPointerPosition (&px, &py);
+ for (mode = scrp->modes; ; mode = mode->next)
+ {
+ if (mode->HDisplay == pSize->width &&
+ mode->VDisplay == pSize->height &&
+ (rate == 0 || xf86RandRModeRefresh (mode) == rate))
+ break;
+ if (mode->next == scrp->modes)
+ {
+ if (pSize->width == randrp->virtualX &&
+ pSize->height == randrp->virtualY)
+ {
+ mode = scrp->modes;
+ useVirtual = TRUE;
+ break;
+ }
+ return FALSE;
+ }
+ }
+ if (!xf86RandRSetMode (pScreen, mode, useVirtual))
+ return FALSE;
+ /*
+ * Move the cursor back where it belongs; SwitchMode repositions it
+ */
+ if (pScreen == miPointerCurrentScreen ())
+ {
+ if (px < pSize->width && py < pSize->height)
+ (*pScreen->SetCursorPosition) (pScreen, px, py, FALSE);
+ }
+ return TRUE;
+}
+
+/*
+ * Wait until the screen is initialized before whacking the
+ * sizes around; otherwise the screen pixmap will be allocated
+ * at the current mode size rather than the maximum size
+ */
+static Bool
+xf86RandRCreateScreenResources (ScreenPtr pScreen)
+{
+ ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+ DisplayModePtr mode;
+
+ pScreen->CreateScreenResources = randrp->CreateScreenResources;
+ if (!(*pScreen->CreateScreenResources) (pScreen))
+ return FALSE;
+
+ mode = scrp->currentMode;
+ if (mode)
+ xf86RandRSetMode (pScreen, mode, TRUE);
+
+ return TRUE;
+}
+
+/*
+ * Reset size back to original
+ */
+static Bool
+xf86RandRCloseScreen (int index, ScreenPtr pScreen)
+{
+ ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+
+ scrp->virtualX = pScreen->width = randrp->virtualX;
+ scrp->virtualY = pScreen->height = randrp->virtualY;
+ scrp->currentMode = scrp->modes;
+ pScreen->CloseScreen = randrp->CloseScreen;
+ xfree (randrp);
+ pScreen->devPrivates[xf86RandRIndex].ptr = 0;
+ return (*pScreen->CloseScreen) (index, pScreen);
+}
+
+Bool
+xf86RandRInit (ScreenPtr pScreen)
+{
+ rrScrPrivPtr rp;
+ XF86RandRInfoPtr randrp;
+ ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
+
+#ifdef PANORAMIX
+ /* XXX disable RandR when using Xinerama */
+ if (!noPanoramiXExtension)
+ return TRUE;
+#endif
+ if (xf86RandRGeneration != serverGeneration)
+ {
+ xf86RandRIndex = AllocateScreenPrivateIndex();
+ xf86RandRGeneration = serverGeneration;
+ }
+
+ randrp = xalloc (sizeof (XF86RandRInfoRec));
+ if (!randrp)
+ return FALSE;
+
+ if (!RRScreenInit (pScreen))
+ {
+ xfree (randrp);
+ return FALSE;
+ }
+ rp = rrGetScrPriv(pScreen);
+ rp->rrGetInfo = xf86RandRGetInfo;
+ rp->rrSetConfig = xf86RandRSetConfig;
+
+ randrp->virtualX = scrp->virtualX;
+ randrp->virtualY = scrp->virtualY;
+
+ randrp->CreateScreenResources = pScreen->CreateScreenResources;
+ pScreen->CreateScreenResources = xf86RandRCreateScreenResources;
+
+ randrp->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = xf86RandRCloseScreen;
+
+ pScreen->devPrivates[xf86RandRIndex].ptr = randrp;
+ return TRUE;
+}
diff --git a/hw/xfree86/common/xf86Resources.h b/hw/xfree86/common/xf86Resources.h
new file mode 100644
index 000000000..6ed3015ec
--- /dev/null
+++ b/hw/xfree86/common/xf86Resources.h
@@ -0,0 +1,113 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.14 2002/07/24 01:47:24 tsi Exp $ */
+
+#ifndef _XF86_RESOURCES_H
+
+#define _XF86_RESOURCES_H
+
+#include "xf86str.h"
+
+#define _END {ResEnd,0,0}
+
+#define _VGA_EXCLUSIVE \
+ {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+ {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
+ {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+ {ResExcIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
+ {ResExcIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
+
+#define _VGA_SHARED \
+ {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+ {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
+ {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+ {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
+ {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
+
+#define _VGA_SHARED_MEM \
+ {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+ {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
+ {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}
+
+#define _VGA_SHARED_IO \
+ {ResShrIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
+ {ResShrIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
+
+/*
+ * Exclusive unused VGA: resources unneeded but cannot be disabled.
+ * Like old Millennium.
+ */
+#define _VGA_EXCLUSIVE_UNUSED \
+ {ResExcUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+ {ResExcUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
+ {ResExcUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+ {ResExcUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
+ {ResExcUusdIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
+
+/*
+ * Shared unused VGA: resources unneeded but cannot be disabled
+ * independently. This is used to determine if a device needs RAC.
+ */
+#define _VGA_SHARED_UNUSED \
+ {ResShrUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+ {ResShrUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
+ {ResShrUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+ {ResShrUusdIoBlock | ResBios | ResBus, 0x03B0, 0x03BB},\
+ {ResShrUusdIoBlock | ResBios | ResBus, 0x03C0, 0x03DF}
+
+/*
+ * Sparse versions of the above for those adapters that respond to all ISA
+ * aliases of VGA ports.
+ */
+#define _VGA_EXCLUSIVE_SPARSE \
+ {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+ {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
+ {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+ {ResExcIoSparse | ResBios | ResBus, 0x03B0, 0x03F8},\
+ {ResExcIoSparse | ResBios | ResBus, 0x03B8, 0x03FC},\
+ {ResExcIoSparse | ResBios | ResBus, 0x03C0, 0x03E0}
+
+#define _VGA_SHARED_SPARSE \
+ {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+ {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
+ {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+ {ResShrIoSparse | ResBios | ResBus, 0x03B0, 0x03F8},\
+ {ResShrIoSparse | ResBios | ResBus, 0x03B8, 0x03FC},\
+ {ResShrIoSparse | ResBios | ResBus, 0x03C0, 0x03E0}
+
+#define _8514_EXCLUSIVE \
+ {ResExcIoSparse | ResBios | ResBus, 0x02E8, 0x03F8}
+
+#define _8514_SHARED \
+ {ResShrIoSparse | ResBios | ResBus, 0x02E8, 0x03F8}
+
+/* Predefined resources */
+extern resRange resVgaExclusive[];
+extern resRange resVgaShared[];
+extern resRange resVgaIoShared[];
+extern resRange resVgaMemShared[];
+extern resRange resVgaUnusedExclusive[];
+extern resRange resVgaUnusedShared[];
+extern resRange resVgaSparseExclusive[];
+extern resRange resVgaSparseShared[];
+extern resRange res8514Exclusive[];
+extern resRange res8514Shared[];
+
+/* Less misleading aliases for xf86SetOperatingState() */
+#define resVgaMem resVgaMemShared
+#define resVgaIo resVgaIoShared
+#define resVga resVgaShared
+
+/* Old style names */
+#define RES_EXCLUSIVE_VGA resVgaExclusive
+#define RES_SHARED_VGA resVgaShared
+#define RES_EXCLUSIVE_8514 res8514Exclusive
+#define RES_SHARED_8514 res8514Shared
+
+#define _PCI_AVOID_PC_STYLE \
+ {ResExcIoSparse | ResBus, 0x0100, 0x0300},\
+ {ResExcIoSparse | ResBus, 0x0200, 0x0200},\
+ {ResExcMemBlock | ResBus, 0xA0000,0xFFFFF}
+
+extern resRange PciAvoid[];
+
+#define RES_UNDEFINED NULL
+#endif
diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c
new file mode 100644
index 000000000..f766f899e
--- /dev/null
+++ b/hw/xfree86/common/xf86VidMode.c
@@ -0,0 +1,683 @@
+/*
+ * Copyright (c) 1999 by The XFree86 Project, Inc.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.14 2003/01/28 20:52:28 tsi Exp $ */
+
+/*
+ * This file contains the VidMode functions required by the extension.
+ * These have been added to avoid the need for the higher level extension
+ * code to access the private XFree86 data structures directly. Wherever
+ * possible this code uses the functions in xf86Mode.c to do the work,
+ * so that two version of code that do similar things don't have to be
+ * maintained.
+ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#ifdef XF86VIDMODE
+#include "vidmodeproc.h"
+#include "xf86cmap.h"
+
+static int VidModeGeneration = 0;
+static int VidModeIndex = -1;
+static int VidModeCount = 0;
+static Bool VidModeClose(int i, ScreenPtr pScreen);
+
+#define VMPTR(p) ((VidModePtr)(p)->devPrivates[VidModeIndex].ptr)
+
+#endif
+
+#ifdef DEBUG
+# define DEBUG_P(x) ErrorF(x"\n");
+#else
+# define DEBUG_P(x) /**/
+#endif
+
+Bool
+VidModeExtensionInit(ScreenPtr pScreen)
+{
+#ifdef XF86VIDMODE
+ VidModePtr pVidMode;
+
+ DEBUG_P("VidModeExtensionInit");
+
+ if (!xf86GetVidModeEnabled()) {
+ DEBUG_P("!xf86GetVidModeEnabled()");
+ return FALSE;
+ }
+
+ if (serverGeneration != VidModeGeneration) {
+ if ((VidModeIndex = AllocateScreenPrivateIndex()) < 0) {
+ DEBUG_P("AllocateScreenPrivateIndex() failed");
+ return FALSE;
+ }
+ VidModeGeneration = serverGeneration;
+ }
+
+ if (!(pScreen->devPrivates[VidModeIndex].ptr = xcalloc(sizeof(VidModeRec), 1))) {
+ DEBUG_P("xcalloc failed");
+ return FALSE;
+ }
+
+ pVidMode = VMPTR(pScreen);
+ pVidMode->Flags = 0;
+ pVidMode->Next = NULL;
+ pVidMode->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = VidModeClose;
+ VidModeCount++;
+ return TRUE;
+#else
+ DEBUG_P("no vidmode extension");
+ return FALSE;
+#endif
+}
+
+
+#ifdef XF86VIDMODE
+
+static Bool
+VidModeClose(int i, ScreenPtr pScreen)
+{
+ VidModePtr pVidMode = VMPTR(pScreen);
+
+ DEBUG_P("VidModeClose");
+
+ /* This shouldn't happen */
+ if (!pVidMode)
+ return FALSE;
+
+ pScreen->CloseScreen = pVidMode->CloseScreen;
+
+ if (--VidModeCount == 0) {
+ if (pScreen->devPrivates[VidModeIndex].ptr)
+ xfree(pScreen->devPrivates[VidModeIndex].ptr);
+ pScreen->devPrivates[VidModeIndex].ptr = NULL;
+ VidModeIndex = -1;
+ }
+ return pScreen->CloseScreen(i, pScreen);
+}
+
+Bool
+VidModeAvailable(int scrnIndex)
+{
+ ScrnInfoPtr pScrn;
+ VidModePtr pVidMode;
+
+ DEBUG_P("VidModeAvailable");
+
+ if (VidModeIndex < 0) {
+ DEBUG_P("VidModeIndex < 0");
+ return FALSE;
+ }
+
+ pScrn = xf86Screens[scrnIndex];
+ if (pScrn == NULL) {
+ DEBUG_P("pScrn == NULL");
+ return FALSE;
+ }
+
+ pVidMode = VMPTR(pScrn->pScreen);
+ if (pVidMode)
+ return TRUE;
+ else {
+ DEBUG_P("pVidMode == NULL");
+ return FALSE;
+ }
+}
+
+Bool
+VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeGetCurrentModeline");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ *mode = (pointer)(pScrn->currentMode);
+ *dotClock = pScrn->currentMode->Clock;
+
+ return TRUE;
+}
+
+int
+VidModeGetDotClock(int scrnIndex, int Clock)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeGetDotClock");
+
+ if (!VidModeAvailable(scrnIndex))
+ return 0;
+
+ pScrn = xf86Screens[scrnIndex];
+ if ((pScrn->progClock) || (Clock > MAXCLOCKS))
+ return Clock;
+ else
+ return pScrn->clock[Clock];
+}
+
+int
+VidModeGetNumOfClocks(int scrnIndex, Bool *progClock)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeGetNumOfClocks");
+
+ if (!VidModeAvailable(scrnIndex))
+ return 0;
+
+ pScrn = xf86Screens[scrnIndex];
+ if (pScrn->progClock){
+ *progClock = TRUE;
+ return 0;
+ } else {
+ *progClock = FALSE;
+ return pScrn->numClocks;
+ }
+}
+
+Bool
+VidModeGetClocks(int scrnIndex, int *Clocks)
+{
+ ScrnInfoPtr pScrn;
+ int i;
+
+ DEBUG_P("VidModeGetClocks");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+
+ if (pScrn->progClock)
+ return FALSE;
+
+ for (i = 0; i < pScrn->numClocks; i++)
+ *Clocks++ = pScrn->clock[i];
+
+ return TRUE;
+}
+
+
+Bool
+VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock)
+{
+ ScrnInfoPtr pScrn;
+ VidModePtr pVidMode;
+
+ DEBUG_P("VidModeGetFirstModeline");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ pVidMode = VMPTR(pScrn->pScreen);
+ pVidMode->First = pScrn->modes;
+ pVidMode->Next = pVidMode->First->next;
+
+ if (pVidMode->First->status == MODE_OK) {
+ *mode = (pointer)(pVidMode->First);
+ *dotClock = VidModeGetDotClock(scrnIndex, pVidMode->First->Clock);
+ return TRUE;
+ }
+
+ return VidModeGetNextModeline(scrnIndex, mode, dotClock);
+}
+
+Bool
+VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock)
+{
+ ScrnInfoPtr pScrn;
+ VidModePtr pVidMode;
+ DisplayModePtr p;
+
+ DEBUG_P("VidModeGetNextModeline");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ pVidMode = VMPTR(pScrn->pScreen);
+
+ for (p = pVidMode->Next; p != NULL && p != pVidMode->First; p = p->next) {
+ if (p->status == MODE_OK) {
+ pVidMode->Next = p->next;
+ *mode = (pointer)p;
+ *dotClock = VidModeGetDotClock(scrnIndex, p->Clock);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+Bool
+VidModeDeleteModeline(int scrnIndex, pointer mode)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeDeleteModeline");
+
+ if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ xf86DeleteMode(&(pScrn->modes), (DisplayModePtr)mode);
+ return TRUE;
+}
+
+Bool
+VidModeZoomViewport(int scrnIndex, int zoom)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeZoomViewPort");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ xf86ZoomViewport(pScrn->pScreen, zoom);
+ return TRUE;
+}
+
+Bool
+VidModeSetViewPort(int scrnIndex, int x, int y)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeSetViewPort");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ pScrn->frameX0 = min( max(x, 0),
+ pScrn->virtualX - pScrn->currentMode->HDisplay );
+ pScrn->frameX1 = pScrn->frameX0 + pScrn->currentMode->HDisplay - 1;
+ pScrn->frameY0 = min( max(y, 0),
+ pScrn->virtualY - pScrn->currentMode->VDisplay );
+ pScrn->frameY1 = pScrn->frameY0 + pScrn->currentMode->VDisplay - 1;
+ if (pScrn->AdjustFrame != NULL)
+ (pScrn->AdjustFrame)(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+
+ return TRUE;
+}
+
+Bool
+VidModeGetViewPort(int scrnIndex, int *x, int *y)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeGetViewPort");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ *x = pScrn->frameX0;
+ *y = pScrn->frameY0;
+ return TRUE;
+}
+
+Bool
+VidModeSwitchMode(int scrnIndex, pointer mode)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeSwitchMode");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ /* Force a mode switch */
+ pScrn->currentMode = NULL;
+ return xf86SwitchMode(pScrn->pScreen, mode);
+}
+
+Bool
+VidModeLockZoom(int scrnIndex, Bool lock)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeLockZoom");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+
+ if (xf86Info.dontZoom)
+ return FALSE;
+
+ xf86LockZoom(pScrn->pScreen, lock);
+ return TRUE;
+}
+
+Bool
+VidModeGetMonitor(int scrnIndex, pointer *monitor)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeGetMonitor");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ *monitor = (pointer)(pScrn->monitor);
+
+ return TRUE;
+}
+
+ModeStatus
+VidModeCheckModeForMonitor(int scrnIndex, pointer mode)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeCheckModeForMonitor");
+
+ if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ return MODE_ERROR;
+
+ pScrn = xf86Screens[scrnIndex];
+
+ return xf86CheckModeForMonitor((DisplayModePtr)mode, pScrn->monitor);
+}
+
+ModeStatus
+VidModeCheckModeForDriver(int scrnIndex, pointer mode)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeCheckModeForDriver");
+
+ if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ return MODE_ERROR;
+
+ pScrn = xf86Screens[scrnIndex];
+
+ return xf86CheckModeForDriver(pScrn, (DisplayModePtr)mode, 0);
+}
+
+void
+VidModeSetCrtcForMode(int scrnIndex, pointer mode)
+{
+ ScrnInfoPtr pScrn;
+ DisplayModePtr ScreenModes;
+
+ DEBUG_P("VidModeSetCrtcForMode");
+
+ if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ return;
+
+ /* Ugly hack so that the xf86Mode.c function can be used without change */
+ pScrn = xf86Screens[scrnIndex];
+ ScreenModes = pScrn->modes;
+ pScrn->modes = (DisplayModePtr)mode;
+
+ xf86SetCrtcForModes(pScrn, pScrn->adjustFlags);
+ pScrn->modes = ScreenModes;
+ return;
+}
+
+Bool
+VidModeAddModeline(int scrnIndex, pointer mode)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeAddModeline");
+
+ if ((mode == NULL) || (!VidModeAvailable(scrnIndex)))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+
+ ((DisplayModePtr)mode)->next = pScrn->modes->next;
+ ((DisplayModePtr)mode)->prev = pScrn->modes;
+ pScrn->modes->next = (DisplayModePtr)mode;
+ ((DisplayModePtr)mode)->next->prev = (DisplayModePtr)mode;
+
+ return TRUE;
+}
+
+int
+VidModeGetNumOfModes(int scrnIndex)
+{
+ pointer mode = NULL;
+ int dotClock= 0, nummodes = 0;
+
+ DEBUG_P("VidModeGetNumOfModes");
+
+ if (!VidModeGetFirstModeline(scrnIndex, &mode, &dotClock))
+ return nummodes;
+
+ do {
+ nummodes++;
+ if (!VidModeGetNextModeline(scrnIndex, &mode, &dotClock))
+ return nummodes;
+ } while (TRUE);
+}
+
+Bool
+VidModeSetGamma(int scrnIndex, float red, float green, float blue)
+{
+ ScrnInfoPtr pScrn;
+ Gamma gamma;
+
+ DEBUG_P("VidModeSetGamma");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ gamma.red = red;
+ gamma.green = green;
+ gamma.blue = blue;
+ if (xf86ChangeGamma(pScrn->pScreen, gamma) != Success)
+ return FALSE;
+ else
+ return TRUE;
+}
+
+Bool
+VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue)
+{
+ ScrnInfoPtr pScrn;
+
+ DEBUG_P("VidModeGetGamma");
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ *red = pScrn->gamma.red;
+ *green = pScrn->gamma.green;
+ *blue = pScrn->gamma.blue;
+ return TRUE;
+}
+
+Bool
+VidModeSetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b)
+{
+ ScrnInfoPtr pScrn;
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ xf86ChangeGammaRamp(pScrn->pScreen, size, r, g, b);
+ return TRUE;
+}
+
+Bool
+VidModeGetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b)
+{
+ ScrnInfoPtr pScrn;
+
+ if (!VidModeAvailable(scrnIndex))
+ return FALSE;
+
+ pScrn = xf86Screens[scrnIndex];
+ xf86GetGammaRamp(pScrn->pScreen, size, r, g, b);
+ return TRUE;
+}
+
+int
+VidModeGetGammaRampSize(int scrnIndex)
+{
+ if (!VidModeAvailable(scrnIndex))
+ return 0;
+
+ return xf86GetGammaRampSize(xf86Screens[scrnIndex]->pScreen);
+}
+
+pointer
+VidModeCreateMode(void)
+{
+ DisplayModePtr mode;
+
+ mode = xalloc(sizeof(DisplayModeRec));
+ if (mode != NULL) {
+ mode->name = "";
+ mode->Private = NULL;
+ mode->next = mode;
+ mode->prev = mode;
+ }
+ return mode;
+}
+
+void
+VidModeCopyMode(pointer modefrom, pointer modeto)
+{
+ memcpy(modeto, modefrom, sizeof(DisplayModeRec));
+}
+
+
+int
+VidModeGetModeValue(pointer mode, int valtyp)
+{
+ int ret = 0;
+
+ switch (valtyp) {
+ case VIDMODE_H_DISPLAY:
+ ret = ((DisplayModePtr) mode)->HDisplay;
+ break;
+ case VIDMODE_H_SYNCSTART:
+ ret = ((DisplayModePtr)mode)->HSyncStart;
+ break;
+ case VIDMODE_H_SYNCEND:
+ ret = ((DisplayModePtr)mode)->HSyncEnd;
+ break;
+ case VIDMODE_H_TOTAL:
+ ret = ((DisplayModePtr)mode)->HTotal;
+ break;
+ case VIDMODE_H_SKEW:
+ ret = ((DisplayModePtr)mode)->HSkew;
+ break;
+ case VIDMODE_V_DISPLAY:
+ ret = ((DisplayModePtr)mode)->VDisplay;
+ break;
+ case VIDMODE_V_SYNCSTART:
+ ret = ((DisplayModePtr)mode)->VSyncStart;
+ break;
+ case VIDMODE_V_SYNCEND:
+ ret = ((DisplayModePtr)mode)->VSyncEnd;
+ break;
+ case VIDMODE_V_TOTAL:
+ ret = ((DisplayModePtr)mode)->VTotal;
+ break;
+ case VIDMODE_FLAGS:
+ ret = ((DisplayModePtr)mode)->Flags;
+ break;
+ case VIDMODE_CLOCK:
+ ret = ((DisplayModePtr)mode)->Clock;
+ break;
+ }
+ return ret;
+}
+
+void
+VidModeSetModeValue(pointer mode, int valtyp, int val)
+{
+ switch (valtyp) {
+ case VIDMODE_H_DISPLAY:
+ ((DisplayModePtr)mode)->HDisplay = val;
+ break;
+ case VIDMODE_H_SYNCSTART:
+ ((DisplayModePtr)mode)->HSyncStart = val;
+ break;
+ case VIDMODE_H_SYNCEND:
+ ((DisplayModePtr)mode)->HSyncEnd = val;
+ break;
+ case VIDMODE_H_TOTAL:
+ ((DisplayModePtr)mode)->HTotal = val;
+ break;
+ case VIDMODE_H_SKEW:
+ ((DisplayModePtr)mode)->HSkew = val;
+ break;
+ case VIDMODE_V_DISPLAY:
+ ((DisplayModePtr)mode)->VDisplay = val;
+ break;
+ case VIDMODE_V_SYNCSTART:
+ ((DisplayModePtr)mode)->VSyncStart = val;
+ break;
+ case VIDMODE_V_SYNCEND:
+ ((DisplayModePtr)mode)->VSyncEnd = val;
+ break;
+ case VIDMODE_V_TOTAL:
+ ((DisplayModePtr)mode)->VTotal = val;
+ break;
+ case VIDMODE_FLAGS:
+ ((DisplayModePtr)mode)->Flags = val;
+ break;
+ case VIDMODE_CLOCK:
+ ((DisplayModePtr)mode)->Clock = val;
+ break;
+ }
+ return;
+}
+
+vidMonitorValue
+VidModeGetMonitorValue(pointer monitor, int valtyp, int indx)
+{
+ vidMonitorValue ret;
+
+ switch (valtyp) {
+ case VIDMODE_MON_VENDOR:
+ ret.ptr = (((MonPtr)monitor)->vendor);
+ break;
+ case VIDMODE_MON_MODEL:
+ ret.ptr = (((MonPtr)monitor)->model);
+ break;
+ case VIDMODE_MON_NHSYNC:
+ ret.i = ((MonPtr)monitor)->nHsync;
+ break;
+ case VIDMODE_MON_NVREFRESH:
+ ret.i = ((MonPtr)monitor)->nVrefresh;
+ break;
+ case VIDMODE_MON_HSYNC_LO:
+ ret.f = (100.0 * ((MonPtr)monitor)->hsync[indx].lo);
+ break;
+ case VIDMODE_MON_HSYNC_HI:
+ ret.f = (100.0 * ((MonPtr)monitor)->hsync[indx].hi);
+ break;
+ case VIDMODE_MON_VREFRESH_LO:
+ ret.f = (100.0 * ((MonPtr)monitor)->vrefresh[indx].lo);
+ break;
+ case VIDMODE_MON_VREFRESH_HI:
+ ret.f = (100.0 * ((MonPtr)monitor)->vrefresh[indx].hi);
+ break;
+ }
+ return ret;
+}
+
+
+#endif /* XF86VIDMODE */
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
new file mode 100644
index 000000000..531a83c08
--- /dev/null
+++ b/hw/xfree86/common/xf86cmap.c
@@ -0,0 +1,1081 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.23 2001/11/16 16:47:55 dawes Exp $ */
+
+#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__)
+#include <math.h>
+#else
+#define _XOPEN_SOURCE /* to get prototype for pow on some systems */
+#include <math.h>
+#undef _XOPEN_SOURCE
+#endif
+
+#include "X.h"
+#include "misc.h"
+#include "Xproto.h"
+#include "colormapst.h"
+#include "scrnintstr.h"
+
+#include "resource.h"
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86str.h"
+#include "micmap.h"
+
+#ifdef XFreeXDGA
+#define _XF86DGA_SERVER_
+#include "extensions/xf86dgastr.h"
+#include "dgaproc.h"
+#endif
+
+#include "xf86cmap.h"
+
+#define SCREEN_PROLOGUE(pScreen, field) ((pScreen)->field = \
+ ((CMapScreenPtr) (pScreen)->devPrivates[CMapScreenIndex].ptr)->field)
+#define SCREEN_EPILOGUE(pScreen, field, wrapper)\
+ ((pScreen)->field = wrapper)
+
+#define LOAD_PALETTE(pmap, index) \
+ ((pmap == miInstalledMaps[index]) && \
+ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || \
+ xf86Screens[index]->vtSema || pScreenPriv->isDGAmode))
+
+
+typedef struct _CMapLink {
+ ColormapPtr cmap;
+ struct _CMapLink *next;
+} CMapLink, *CMapLinkPtr;
+
+typedef struct {
+ ScrnInfoPtr pScrn;
+ CloseScreenProcPtr CloseScreen;
+ CreateColormapProcPtr CreateColormap;
+ DestroyColormapProcPtr DestroyColormap;
+ InstallColormapProcPtr InstallColormap;
+ StoreColorsProcPtr StoreColors;
+ LoadPaletteFuncPtr LoadPalette;
+ SetOverscanFuncPtr SetOverscan;
+ Bool (*EnterVT)(int, int);
+ Bool (*SwitchMode)(int, DisplayModePtr, int);
+ int (*SetDGAMode)(int, int, DGADevicePtr);
+ int maxColors;
+ int sigRGBbits;
+ int gammaElements;
+ LOCO *gamma;
+ int *PreAllocIndices;
+ CMapLinkPtr maps;
+ unsigned int flags;
+ Bool isDGAmode;
+} CMapScreenRec, *CMapScreenPtr;
+
+typedef struct {
+ int numColors;
+ LOCO *colors;
+ Bool recalculate;
+ int overscan;
+} CMapColormapRec, *CMapColormapPtr;
+
+static unsigned long CMapGeneration = 0;
+static int CMapScreenIndex = -1;
+static int CMapColormapIndex = -1;
+
+static void CMapInstallColormap(ColormapPtr);
+static void CMapStoreColors(ColormapPtr, int, xColorItem *);
+static Bool CMapCloseScreen (int, ScreenPtr);
+static Bool CMapCreateColormap (ColormapPtr);
+static void CMapDestroyColormap (ColormapPtr);
+
+static Bool CMapEnterVT(int, int);
+static Bool CMapSwitchMode(int, DisplayModePtr, int);
+static int CMapSetDGAMode(int, int, DGADevicePtr);
+static int CMapChangeGamma(int, Gamma);
+
+static void ComputeGamma(CMapScreenPtr);
+static Bool CMapAllocateColormapPrivate(ColormapPtr);
+static Bool CMapInitDefMap(ColormapPtr);
+static void CMapRefreshColors(ColormapPtr, int, int*);
+static void CMapSetOverscan(ColormapPtr, int, int *);
+static void CMapReinstallMap(ColormapPtr);
+static void CMapUnwrapScreen(ScreenPtr pScreen);
+
+
+
+Bool xf86HandleColormaps(
+ ScreenPtr pScreen,
+ int maxColors,
+ int sigRGBbits,
+ LoadPaletteFuncPtr loadPalette,
+ SetOverscanFuncPtr setOverscan,
+ unsigned int flags
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ColormapPtr pDefMap = NULL;
+ CMapScreenPtr pScreenPriv;
+ LOCO *gamma;
+ int *indices;
+ int elements;
+
+ if(!maxColors || !sigRGBbits || !loadPalette)
+ return FALSE;
+
+ if(CMapGeneration != serverGeneration) {
+ if(((CMapScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
+ ((CMapColormapIndex = AllocateColormapPrivateIndex(
+ CMapInitDefMap)) < 0))
+ return FALSE;
+ CMapGeneration = serverGeneration;
+ }
+
+ elements = 1 << sigRGBbits;
+
+ if(!(gamma = xalloc(elements * sizeof(LOCO))))
+ return FALSE;
+
+ if(!(indices = xalloc(maxColors * sizeof(int)))) {
+ xfree(gamma);
+ return FALSE;
+ }
+
+ if(!(pScreenPriv = xalloc(sizeof(CMapScreenRec)))) {
+ xfree(gamma);
+ xfree(indices);
+ return FALSE;
+ }
+
+ pScreen->devPrivates[CMapScreenIndex].ptr = (pointer)pScreenPriv;
+
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreenPriv->CreateColormap = pScreen->CreateColormap;
+ pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
+ pScreenPriv->InstallColormap = pScreen->InstallColormap;
+ pScreenPriv->StoreColors = pScreen->StoreColors;
+ pScreen->CloseScreen = CMapCloseScreen;
+ pScreen->CreateColormap = CMapCreateColormap;
+ pScreen->DestroyColormap = CMapDestroyColormap;
+ pScreen->InstallColormap = CMapInstallColormap;
+ pScreen->StoreColors = CMapStoreColors;
+
+ pScreenPriv->pScrn = pScrn;
+ pScreenPriv->LoadPalette = loadPalette;
+ pScreenPriv->SetOverscan = setOverscan;
+ pScreenPriv->maxColors = maxColors;
+ pScreenPriv->sigRGBbits = sigRGBbits;
+ pScreenPriv->gammaElements = elements;
+ pScreenPriv->gamma = gamma;
+ pScreenPriv->PreAllocIndices = indices;
+ pScreenPriv->maps = NULL;
+ pScreenPriv->flags = flags;
+ pScreenPriv->isDGAmode = FALSE;
+
+ pScreenPriv->EnterVT = pScrn->EnterVT;
+ pScreenPriv->SwitchMode = pScrn->SwitchMode;
+ pScreenPriv->SetDGAMode = pScrn->SetDGAMode;
+
+ if (!(flags & CMAP_LOAD_EVEN_IF_OFFSCREEN)) {
+ pScrn->EnterVT = CMapEnterVT;
+ if ((flags & CMAP_RELOAD_ON_MODE_SWITCH) && pScrn->SwitchMode)
+ pScrn->SwitchMode = CMapSwitchMode;
+ }
+#ifdef XFreeXDGA
+ pScrn->SetDGAMode = CMapSetDGAMode;
+#endif
+ pScrn->ChangeGamma = CMapChangeGamma;
+
+ ComputeGamma(pScreenPriv);
+
+ /* get the default map */
+
+ pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP);
+
+ if(!CMapAllocateColormapPrivate(pDefMap)) {
+ CMapUnwrapScreen(pScreen);
+ return FALSE;
+ }
+
+ /* Force the initial map to be loaded */
+ miInstalledMaps[pScreen->myNum] = NULL;
+ CMapInstallColormap(pDefMap);
+ return TRUE;
+}
+
+static Bool
+CMapInitDefMap(ColormapPtr cmap)
+{
+ return TRUE;
+}
+
+
+/**** Screen functions ****/
+
+
+static Bool
+CMapCloseScreen (int i, ScreenPtr pScreen)
+{
+ CMapUnwrapScreen(pScreen);
+
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+static Bool
+CMapAllocateColormapPrivate(ColormapPtr pmap)
+{
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
+ CMapColormapPtr pColPriv;
+ CMapLinkPtr pLink;
+ int numColors;
+ LOCO *colors;
+
+ if((1 << pmap->pVisual->nplanes) > pScreenPriv->maxColors)
+ numColors = pmap->pVisual->ColormapEntries;
+ else
+ numColors = 1 << pmap->pVisual->nplanes;
+
+ if(!(colors = xalloc(numColors * sizeof(LOCO))))
+ return FALSE;
+
+ if(!(pColPriv = xalloc(sizeof(CMapColormapRec)))) {
+ xfree(colors);
+ return FALSE;
+ }
+
+ pmap->devPrivates[CMapColormapIndex].ptr = (pointer)pColPriv;
+
+ pColPriv->numColors = numColors;
+ pColPriv->colors = colors;
+ pColPriv->recalculate = TRUE;
+ pColPriv->overscan = -1;
+
+ /* add map to list */
+ pLink = xalloc(sizeof(CMapLink));
+ if(pLink) {
+ pLink->cmap = pmap;
+ pLink->next = pScreenPriv->maps;
+ pScreenPriv->maps = pLink;
+ }
+
+ return TRUE;
+}
+
+static Bool
+CMapCreateColormap (ColormapPtr pmap)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
+ Bool ret = FALSE;
+
+ pScreen->CreateColormap = pScreenPriv->CreateColormap;
+ if((*pScreen->CreateColormap)(pmap)) {
+ if(CMapAllocateColormapPrivate(pmap))
+ ret = TRUE;
+ }
+ pScreen->CreateColormap = CMapCreateColormap;
+
+ return ret;
+}
+
+static void
+CMapDestroyColormap (ColormapPtr cmap)
+{
+ ScreenPtr pScreen = cmap->pScreen;
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
+ CMapColormapPtr pColPriv =
+ (CMapColormapPtr) cmap->devPrivates[CMapColormapIndex].ptr;
+ CMapLinkPtr prevLink = NULL, pLink = pScreenPriv->maps;
+
+ if(pColPriv) {
+ if(pColPriv->colors) xfree(pColPriv->colors);
+ xfree(pColPriv);
+ }
+
+ /* remove map from list */
+ while(pLink) {
+ if(pLink->cmap == cmap) {
+ if(prevLink)
+ prevLink->next = pLink->next;
+ else
+ pScreenPriv->maps = pLink->next;
+ xfree(pLink);
+ break;
+ }
+ prevLink = pLink;
+ pLink = pLink->next;
+ }
+
+ if(pScreenPriv->DestroyColormap) {
+ pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
+ (*pScreen->DestroyColormap)(cmap);
+ pScreen->DestroyColormap = CMapDestroyColormap;
+ }
+}
+
+
+
+static void
+CMapStoreColors(
+ ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs
+){
+ ScreenPtr pScreen = pmap->pScreen;
+ VisualPtr pVisual = pmap->pVisual;
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
+ int *indices = pScreenPriv->PreAllocIndices;
+ int num = ndef;
+
+ /* At the moment this isn't necessary since there's nobody below us */
+ pScreen->StoreColors = pScreenPriv->StoreColors;
+ (*pScreen->StoreColors)(pmap, ndef, pdefs);
+ pScreen->StoreColors = CMapStoreColors;
+
+ /* should never get here for these */
+ if( (pVisual->class == TrueColor) ||
+ (pVisual->class == StaticColor) ||
+ (pVisual->class == StaticGray))
+ return;
+
+ if(pVisual->class == DirectColor) {
+ CMapColormapPtr pColPriv =
+ (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
+ int i;
+
+ if((1 << pVisual->nplanes) > pScreenPriv->maxColors) {
+ int index;
+
+ num = 0;
+ while(ndef--) {
+ if(pdefs[ndef].flags & DoRed) {
+ index = (pdefs[ndef].pixel & pVisual->redMask) >>
+ pVisual->offsetRed;
+ i = num;
+ while(i--)
+ if(indices[i] == index) break;
+ if(i == -1)
+ indices[num++] = index;
+ }
+ if(pdefs[ndef].flags & DoGreen) {
+ index = (pdefs[ndef].pixel & pVisual->greenMask) >>
+ pVisual->offsetGreen;
+ i = num;
+ while(i--)
+ if(indices[i] == index) break;
+ if(i == -1)
+ indices[num++] = index;
+ }
+ if(pdefs[ndef].flags & DoBlue) {
+ index = (pdefs[ndef].pixel & pVisual->blueMask) >>
+ pVisual->offsetBlue;
+ i = num;
+ while(i--)
+ if(indices[i] == index) break;
+ if(i == -1)
+ indices[num++] = index;
+ }
+ }
+
+ } else {
+ /* not really as overkill as it seems */
+ num = pColPriv->numColors;
+ for(i = 0; i < pColPriv->numColors; i++)
+ indices[i] = i;
+ }
+ } else {
+ while(ndef--)
+ indices[ndef] = pdefs[ndef].pixel;
+ }
+
+ CMapRefreshColors(pmap, num, indices);
+}
+
+
+static void
+CMapInstallColormap(ColormapPtr pmap)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ int index = pScreen->myNum;
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
+
+ if (pmap == miInstalledMaps[index])
+ return;
+
+ pScreen->InstallColormap = pScreenPriv->InstallColormap;
+ (*pScreen->InstallColormap)(pmap);
+ pScreen->InstallColormap = CMapInstallColormap;
+
+ /* Important. We let the lower layers, namely DGA,
+ overwrite the choice of Colormap to install */
+ pmap = miInstalledMaps[index];
+
+ if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
+ (pmap->pVisual->class == TrueColor) &&
+ ((1 << pmap->pVisual->nplanes) > pScreenPriv->maxColors))
+ return;
+
+ if(LOAD_PALETTE(pmap, index))
+ CMapReinstallMap(pmap);
+}
+
+
+/**** ScrnInfoRec functions ****/
+
+static Bool
+CMapEnterVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
+
+ if((*pScreenPriv->EnterVT)(index, flags)) {
+ if(miInstalledMaps[index])
+ CMapReinstallMap(miInstalledMaps[index]);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+static Bool
+CMapSwitchMode(int index, DisplayModePtr mode, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
+
+ if((*pScreenPriv->SwitchMode)(index, mode, flags)) {
+ if(miInstalledMaps[index])
+ CMapReinstallMap(miInstalledMaps[index]);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+#ifdef XFreeXDGA
+static int
+CMapSetDGAMode(int index, int num, DGADevicePtr dev)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
+ int ret;
+
+ ret = (*pScreenPriv->SetDGAMode)(index, num, dev);
+
+ pScreenPriv->isDGAmode = DGAActive(index);
+
+ if(!pScreenPriv->isDGAmode && miInstalledMaps[index]
+ && xf86Screens[pScreen->myNum]->vtSema)
+ CMapReinstallMap(miInstalledMaps[index]);
+
+ return ret;
+}
+#endif
+
+
+/**** Utilities ****/
+
+static void
+CMapReinstallMap(ColormapPtr pmap)
+{
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
+ CMapColormapPtr cmapPriv =
+ (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
+ int i = cmapPriv->numColors;
+ int *indices = pScreenPriv->PreAllocIndices;
+
+ while(i--)
+ indices[i] = i;
+
+ if(cmapPriv->recalculate)
+ CMapRefreshColors(pmap, cmapPriv->numColors, indices);
+ else {
+ (*pScreenPriv->LoadPalette)(pScreenPriv->pScrn, cmapPriv->numColors,
+ indices, cmapPriv->colors, pmap->pVisual);
+ if (pScreenPriv->SetOverscan) {
+#ifdef DEBUGOVERSCAN
+ ErrorF("SetOverscan() called from CMapReinstallMap\n");
+#endif
+ pScreenPriv->SetOverscan(pScreenPriv->pScrn, cmapPriv->overscan);
+ }
+ }
+
+ cmapPriv->recalculate = FALSE;
+}
+
+
+static void
+CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
+{
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
+ CMapColormapPtr pColPriv =
+ (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
+ VisualPtr pVisual = pmap->pVisual;
+ int numColors, i;
+ LOCO *gamma, *colors;
+ EntryPtr entry;
+ int reds, greens, blues, maxValue, index, shift;
+
+ numColors = pColPriv->numColors;
+ shift = 16 - pScreenPriv->sigRGBbits;
+ maxValue = (1 << pScreenPriv->sigRGBbits) - 1;
+ gamma = pScreenPriv->gamma;
+ colors = pColPriv->colors;
+
+ reds = pVisual->redMask >> pVisual->offsetRed;
+ greens = pVisual->greenMask >> pVisual->offsetGreen;
+ blues = pVisual->blueMask >> pVisual->offsetBlue;
+
+ switch(pVisual->class) {
+ case StaticGray:
+ for(i = 0; i <= numColors - 1; i++) {
+ index = i * maxValue / numColors;
+ colors[i].red = gamma[index].red;
+ colors[i].green = gamma[index].green;
+ colors[i].blue = gamma[index].blue;
+ }
+ break;
+ case TrueColor:
+ if((1 << pVisual->nplanes) > pScreenPriv->maxColors) {
+ for(i = 0; i <= reds; i++)
+ colors[i].red = gamma[i * maxValue / reds].red;
+ for(i = 0; i <= greens; i++)
+ colors[i].green = gamma[i * maxValue / greens].green;
+ for(i = 0; i <= blues; i++)
+ colors[i].blue = gamma[i * maxValue / blues].blue;
+ break;
+ }
+ for(i = 0; i < numColors; i++) {
+ colors[i].red = gamma[((i >> pVisual->offsetRed) & reds) *
+ maxValue / reds].red;
+ colors[i].green = gamma[((i >> pVisual->offsetGreen) & greens) *
+ maxValue / greens].green;
+ colors[i].blue = gamma[((i >> pVisual->offsetBlue) & blues) *
+ maxValue / blues].blue;
+ }
+ break;
+ case StaticColor:
+ case PseudoColor:
+ case GrayScale:
+ for(i = 0; i < defs; i++) {
+ index = indices[i];
+ entry = (EntryPtr)&pmap->red[index];
+
+ if(entry->fShared) {
+ colors[index].red =
+ gamma[entry->co.shco.red->color >> shift].red;
+ colors[index].green =
+ gamma[entry->co.shco.green->color >> shift].green;
+ colors[index].blue =
+ gamma[entry->co.shco.blue->color >> shift].blue;
+ } else {
+ colors[index].red =
+ gamma[entry->co.local.red >> shift].red;
+ colors[index].green =
+ gamma[entry->co.local.green >> shift].green;
+ colors[index].blue =
+ gamma[entry->co.local.blue >> shift].blue;
+ }
+ }
+ break;
+ case DirectColor:
+ if((1 << pVisual->nplanes) > pScreenPriv->maxColors) {
+ for(i = 0; i < defs; i++) {
+ index = indices[i];
+ if(index <= reds)
+ colors[index].red =
+ gamma[pmap->red[index].co.local.red >> shift].red;
+ if(index <= greens)
+ colors[index].green =
+ gamma[pmap->green[index].co.local.green >> shift].green;
+ if(index <= blues)
+ colors[index].blue =
+ gamma[pmap->blue[index].co.local.blue >> shift].blue;
+
+ }
+ break;
+ }
+ for(i = 0; i < defs; i++) {
+ index = indices[i];
+
+ colors[index].red = gamma[pmap->red[
+ (index >> pVisual->offsetRed) & reds
+ ].co.local.red >> shift].red;
+ colors[index].green = gamma[pmap->green[
+ (index >> pVisual->offsetGreen) & greens
+ ].co.local.green >> shift].green;
+ colors[index].blue = gamma[pmap->blue[
+ (index >> pVisual->offsetBlue) & blues
+ ].co.local.blue >> shift].blue;
+ }
+ break;
+ }
+
+
+ if(LOAD_PALETTE(pmap, pmap->pScreen->myNum))
+ (*pScreenPriv->LoadPalette)(pScreenPriv->pScrn, defs, indices,
+ colors, pmap->pVisual);
+
+ if (pScreenPriv->SetOverscan)
+ CMapSetOverscan(pmap, defs, indices);
+
+}
+
+static Bool
+CMapCompareColors(LOCO *color1, LOCO *color2)
+{
+ /* return TRUE if the color1 is "closer" to black than color2 */
+#ifdef DEBUGOVERSCAN
+ ErrorF("#%02x%02x%02x vs #%02x%02x%02x (%d vs %d)\n",
+ color1->red, color1->green, color1->blue,
+ color2->red, color2->green, color2->blue,
+ color1->red + color1->green + color1->blue,
+ color2->red + color2->green + color2->blue);
+#endif
+ return (color1->red + color1->green + color1->blue <
+ color2->red + color2->green + color2->blue);
+}
+
+static void
+CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
+{
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
+ CMapColormapPtr pColPriv =
+ (CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
+ VisualPtr pVisual = pmap->pVisual;
+ int i;
+ LOCO *colors;
+ int index;
+ Bool newOverscan = FALSE;
+ int overscan, tmpOverscan;
+
+ colors = pColPriv->colors;
+ overscan = pColPriv->overscan;
+
+ /*
+ * Search for a new overscan index in the following cases:
+ *
+ * - The index hasn't yet been initialised.  In this case search
+ * for an index that is black or a close match to black.
+ *
+ * - The colour of the old index is changed. In this case search
+ * all indices for a black or close match to black.
+ *
+ * - The colour of the old index wasn't black. In this case only
+ * search the indices that were changed for a better match to black.
+ */
+
+ switch (pVisual->class) {
+ case StaticGray:
+ case TrueColor:
+ /* Should only come here once. Initialise the overscan index to 0 */
+ overscan = 0;
+ newOverscan = TRUE;
+ break;
+ case StaticColor:
+ /*
+ * Only come here once, but search for the overscan in the same way
+ * as for the other cases.
+ */
+ case DirectColor:
+ case PseudoColor:
+ case GrayScale:
+ if (overscan < 0 || overscan > pScreenPriv->maxColors - 1) {
+ /* Uninitialised */
+ newOverscan = TRUE;
+ } else {
+ /* Check if the overscan was changed */
+ for (i = 0; i < defs; i++) {
+ index = indices[i];
+ if (index == overscan) {
+ newOverscan = TRUE;
+ break;
+ }
+ }
+ }
+ if (newOverscan) {
+ /* The overscan is either uninitialised or it has been changed */
+
+ if (overscan < 0 || overscan > pScreenPriv->maxColors - 1)
+ tmpOverscan = pScreenPriv->maxColors - 1;
+ else
+ tmpOverscan = overscan;
+
+ /* search all entries for a close match to black */
+ for (i = pScreenPriv->maxColors - 1; i >= 0; i--) {
+ if (colors[i].red == 0 && colors[i].green == 0 &&
+ colors[i].blue == 0) {
+ overscan = i;
+#ifdef DEBUGOVERSCAN
+ ErrorF("Black found at index 0x%02x\n", i);
+#endif
+ break;
+ } else {
+#ifdef DEBUGOVERSCAN
+ ErrorF("0x%02x: ", i);
+#endif
+ if (CMapCompareColors(&colors[i], &colors[tmpOverscan])) {
+ tmpOverscan = i;
+#ifdef DEBUGOVERSCAN
+ ErrorF("possible \"Black\" at index 0x%02x\n", i);
+#endif
+ }
+ }
+ }
+ if (i < 0)
+ overscan = tmpOverscan;
+ } else {
+ /* Check of the old overscan wasn't black */
+ if (colors[overscan].red != 0 || colors[overscan].green != 0 ||
+ colors[overscan].blue != 0) {
+ int oldOverscan = tmpOverscan = overscan;
+ /* See of there is now a better match */
+ for (i = 0; i < defs; i++) {
+ index = indices[i];
+ if (colors[index].red == 0 && colors[index].green == 0 &&
+ colors[index].blue == 0) {
+ overscan = index;
+#ifdef DEBUGOVERSCAN
+ ErrorF("Black found at index 0x%02x\n", index);
+#endif
+ break;
+ } else {
+#ifdef DEBUGOVERSCAN
+ ErrorF("0x%02x: ", index);
+#endif
+ if (CMapCompareColors(&colors[index],
+ &colors[tmpOverscan])) {
+ tmpOverscan = index;
+#ifdef DEBUGOVERSCAN
+ ErrorF("possible \"Black\" at index 0x%02x\n",
+ index);
+#endif
+ }
+ }
+ }
+ if (i == defs)
+ overscan = tmpOverscan;
+ if (overscan != oldOverscan)
+ newOverscan = TRUE;
+ }
+ }
+ break;
+ }
+ if (newOverscan) {
+ pColPriv->overscan = overscan;
+ if (LOAD_PALETTE(pmap, pmap->pScreen->myNum)) {
+#ifdef DEBUGOVERSCAN
+ ErrorF("SetOverscan() called from CmapSetOverscan\n");
+#endif
+ pScreenPriv->SetOverscan(pScreenPriv->pScrn, overscan);
+ }
+ }
+}
+
+static void
+CMapUnwrapScreen(ScreenPtr pScreen)
+{
+ CMapScreenPtr pScreenPriv =
+ (CMapScreenPtr) pScreen->devPrivates[CMapScreenIndex].ptr;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ pScreen->CreateColormap = pScreenPriv->CreateColormap;
+ pScreen->DestroyColormap = pScreenPriv->DestroyColormap;
+ pScreen->InstallColormap = pScreenPriv->InstallColormap;
+ pScreen->StoreColors = pScreenPriv->StoreColors;
+
+ pScrn->EnterVT = pScreenPriv->EnterVT;
+ pScrn->SwitchMode = pScreenPriv->SwitchMode;
+ pScrn->SetDGAMode = pScreenPriv->SetDGAMode;
+
+ xfree(pScreenPriv->gamma);
+ xfree(pScreenPriv->PreAllocIndices);
+ xfree(pScreenPriv);
+}
+
+
+static void
+ComputeGamma(CMapScreenPtr priv)
+{
+ int elements = priv->gammaElements - 1;
+ double RedGamma, GreenGamma, BlueGamma;
+ int i;
+
+#ifndef DONT_CHECK_GAMMA
+ /* This check is to catch drivers that are not initialising pScrn->gamma */
+ if (priv->pScrn->gamma.red < GAMMA_MIN ||
+ priv->pScrn->gamma.red > GAMMA_MAX ||
+ priv->pScrn->gamma.green < GAMMA_MIN ||
+ priv->pScrn->gamma.green > GAMMA_MAX ||
+ priv->pScrn->gamma.blue < GAMMA_MIN ||
+ priv->pScrn->gamma.blue > GAMMA_MAX) {
+
+ xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0,
+ "The %s driver didn't call xf86SetGamma() to initialise\n"
+ "\tthe gamma values.\n", priv->pScrn->driverName);
+ xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0,
+ "PLEASE FIX THE `%s' DRIVER!\n", priv->pScrn->driverName);
+ priv->pScrn->gamma.red = 1.0;
+ priv->pScrn->gamma.green = 1.0;
+ priv->pScrn->gamma.blue = 1.0;
+ }
+#endif
+
+ RedGamma = 1.0 / (double)priv->pScrn->gamma.red;
+ GreenGamma = 1.0 / (double)priv->pScrn->gamma.green;
+ BlueGamma = 1.0 / (double)priv->pScrn->gamma.blue;
+
+ for(i = 0; i <= elements; i++) {
+ if(RedGamma == 1.0)
+ priv->gamma[i].red = i;
+ else
+ priv->gamma[i].red = (CARD16)(pow((double)i/(double)elements,
+ RedGamma) * (double)elements + 0.5);
+
+ if(GreenGamma == 1.0)
+ priv->gamma[i].green = i;
+ else
+ priv->gamma[i].green = (CARD16)(pow((double)i/(double)elements,
+ GreenGamma) * (double)elements + 0.5);
+
+ if(BlueGamma == 1.0)
+ priv->gamma[i].blue = i;
+ else
+ priv->gamma[i].blue = (CARD16)(pow((double)i/(double)elements,
+ BlueGamma) * (double)elements + 0.5);
+ }
+}
+
+
+int
+CMapChangeGamma(
+ int index,
+ Gamma gamma
+){
+ ScrnInfoPtr pScrn = xf86Screens[index];
+ ScreenPtr pScreen = pScrn->pScreen;
+ CMapColormapPtr pColPriv;
+ CMapScreenPtr pScreenPriv;
+ CMapLinkPtr pLink;
+
+ /* Is this sufficient checking ? */
+ if(CMapScreenIndex == -1)
+ return BadImplementation;
+
+ pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
+ if(!pScreenPriv)
+ return BadImplementation;
+
+ if (gamma.red < GAMMA_MIN || gamma.red > GAMMA_MAX ||
+ gamma.green < GAMMA_MIN || gamma.green > GAMMA_MAX ||
+ gamma.blue < GAMMA_MIN || gamma.blue > GAMMA_MAX)
+ return BadValue;
+
+ pScrn->gamma.red = gamma.red;
+ pScrn->gamma.green = gamma.green;
+ pScrn->gamma.blue = gamma.blue;
+
+ ComputeGamma(pScreenPriv);
+
+ /* mark all colormaps on this screen */
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ pColPriv =
+ (CMapColormapPtr) pLink->cmap->devPrivates[CMapColormapIndex].ptr;
+ pColPriv->recalculate = TRUE;
+ pLink = pLink->next;
+ }
+
+ if(miInstalledMaps[pScreen->myNum] &&
+ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) ||
+ pScrn->vtSema || pScreenPriv->isDGAmode)) {
+ ColormapPtr pMap = miInstalledMaps[pScreen->myNum];
+
+ if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
+ (pMap->pVisual->class == TrueColor) &&
+ ((1 << pMap->pVisual->nplanes) > pScreenPriv->maxColors)) {
+
+ /* if the current map doesn't have a palette look
+ for another map to change the gamma on. */
+
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ if(pLink->cmap->pVisual->class == PseudoColor)
+ break;
+ pLink = pLink->next;
+ }
+
+ if(pLink) {
+ /* need to trick CMapRefreshColors() into thinking
+ this is the currently installed map */
+ miInstalledMaps[pScreen->myNum] = pLink->cmap;
+ CMapReinstallMap(pLink->cmap);
+ miInstalledMaps[pScreen->myNum] = pMap;
+ }
+ } else
+ CMapReinstallMap(pMap);
+ }
+
+ return Success;
+}
+
+
+static void
+ComputeGammaRamp (
+ CMapScreenPtr priv,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ int elements = priv->gammaElements;
+ LOCO *entry = priv->gamma;
+ int shift = 16 - priv->sigRGBbits;
+
+ while(elements--) {
+ entry->red = *(red++) >> shift;
+ entry->green = *(green++) >> shift;
+ entry->blue = *(blue++) >> shift;
+ entry++;
+ }
+}
+
+int
+xf86ChangeGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ CMapColormapPtr pColPriv;
+ CMapScreenPtr pScreenPriv;
+ CMapLinkPtr pLink;
+
+ if(CMapScreenIndex == -1)
+ return BadImplementation;
+
+ pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
+ if(!pScreenPriv)
+ return BadImplementation;
+
+ if(pScreenPriv->gammaElements != size)
+ return BadValue;
+
+ ComputeGammaRamp(pScreenPriv, red, green, blue);
+
+ /* mark all colormaps on this screen */
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ pColPriv =
+ (CMapColormapPtr) pLink->cmap->devPrivates[CMapColormapIndex].ptr;
+ pColPriv->recalculate = TRUE;
+ pLink = pLink->next;
+ }
+
+ if(miInstalledMaps[pScreen->myNum] &&
+ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) ||
+ pScrn->vtSema || pScreenPriv->isDGAmode)) {
+ ColormapPtr pMap = miInstalledMaps[pScreen->myNum];
+
+ if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) &&
+ (pMap->pVisual->class == TrueColor) &&
+ ((1 << pMap->pVisual->nplanes) > pScreenPriv->maxColors)) {
+
+ /* if the current map doesn't have a palette look
+ for another map to change the gamma on. */
+
+ pLink = pScreenPriv->maps;
+ while(pLink) {
+ if(pLink->cmap->pVisual->class == PseudoColor)
+ break;
+ pLink = pLink->next;
+ }
+
+ if(pLink) {
+ /* need to trick CMapRefreshColors() into thinking
+ this is the currently installed map */
+ miInstalledMaps[pScreen->myNum] = pLink->cmap;
+ CMapReinstallMap(pLink->cmap);
+ miInstalledMaps[pScreen->myNum] = pMap;
+ }
+ } else
+ CMapReinstallMap(pMap);
+ }
+
+ return Success;
+}
+
+int
+xf86GetGammaRampSize(ScreenPtr pScreen)
+{
+ CMapScreenPtr pScreenPriv;
+
+ if(CMapScreenIndex == -1) return 0;
+
+ pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
+ if(!pScreenPriv) return 0;
+
+ return pScreenPriv->gammaElements;
+}
+
+int
+xf86GetGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+){
+ CMapScreenPtr pScreenPriv;
+ LOCO *entry;
+ int shift, sigbits;
+
+ if(CMapScreenIndex == -1)
+ return BadImplementation;
+
+ pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr;
+ if(!pScreenPriv)
+ return BadImplementation;
+
+ if(size > pScreenPriv->gammaElements)
+ return BadValue;
+
+ entry = pScreenPriv->gamma;
+ sigbits = pScreenPriv->sigRGBbits;
+
+ while(size--) {
+ *red = entry->red << (16 - sigbits);
+ *green = entry->green << (16 - sigbits);
+ *blue = entry->blue << (16 - sigbits);
+ shift = sigbits;
+ while(shift < 16) {
+ *red |= *red >> shift;
+ *green |= *green >> shift;
+ *blue |= *blue >> shift;
+ shift += sigbits;
+ }
+ red++; green++; blue++;
+ entry++;
+ }
+
+ return Success;
+}
+
+int
+xf86ChangeGamma(
+ ScreenPtr pScreen,
+ Gamma gamma
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if(pScrn->ChangeGamma)
+ return (*pScrn->ChangeGamma)(pScreen->myNum, gamma);
+
+ return Success; /* Success? */
+}
diff --git a/hw/xfree86/common/xf86cmap.h b/hw/xfree86/common/xf86cmap.h
new file mode 100644
index 000000000..b871d6762
--- /dev/null
+++ b/hw/xfree86/common/xf86cmap.h
@@ -0,0 +1,62 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.7 2001/05/06 00:49:12 mvojkovi Exp $ */
+
+#ifndef _XF86CMAP_H
+#define _XF86CMAP_H
+
+#include "xf86str.h"
+#include "colormapst.h"
+
+#define CMAP_PALETTED_TRUECOLOR 0x0000001
+#define CMAP_RELOAD_ON_MODE_SWITCH 0x0000002
+#define CMAP_LOAD_EVEN_IF_OFFSCREEN 0x0000004
+
+typedef void (*LoadPaletteFuncPtr)(
+ ScrnInfoPtr pScrn,
+ int numColors,
+ int *indicies,
+ LOCO *colors,
+ VisualPtr pVisual
+);
+
+typedef void (*SetOverscanFuncPtr)(
+ ScrnInfoPtr pScrn,
+ int Index
+);
+
+Bool xf86HandleColormaps(
+ ScreenPtr pScreen,
+ int maxCol,
+ int sigRGBbits,
+ LoadPaletteFuncPtr loadPalette,
+ SetOverscanFuncPtr setOverscan,
+ unsigned int flags
+);
+
+int
+xf86ChangeGamma(
+ ScreenPtr pScreen,
+ Gamma newGamma
+);
+
+int
+xf86ChangeGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+);
+
+int xf86GetGammaRampSize(ScreenPtr pScreen);
+
+int
+xf86GetGammaRamp(
+ ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+);
+
+#endif /* _XF86CMAP_H */
+
diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c
new file mode 100644
index 000000000..8fcf9b817
--- /dev/null
+++ b/hw/xfree86/common/xf86fbBus.c
@@ -0,0 +1,70 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.2 2001/10/28 03:33:19 tsi Exp $ */
+
+/*
+ * Copyright (c) 2000 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains the interfaces to the bus-specific code
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Resources.h"
+
+#include "xf86Bus.h"
+
+#define XF86_OS_PRIVS
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSproc.h"
+
+#include "xf86RAC.h"
+
+Bool fbSlotClaimed = FALSE;
+
+int
+xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
+{
+ EntityPtr p;
+ int num;
+
+ num = xf86AllocateEntity();
+ p = xf86Entities[num];
+ p->driver = drvp;
+ p->chipset = 0;
+ p->busType = BUS_NONE;
+ p->active = active;
+ p->inUse = FALSE;
+ xf86AddDevToEntity(num, dev);
+ p->access = xnfcalloc(1,sizeof(EntityAccessRec));
+ p->access->fallback = &AccessNULL;
+ p->access->pAccess = &AccessNULL;
+ p->busAcc = NULL;
+
+ fbSlotClaimed = TRUE;
+ return num;
+}
+
+/*
+ * Get the list of FB "slots" claimed by a screen
+ */
+int
+xf86GetFbInfoForScreen(int scrnIndex)
+{
+ int num = 0;
+ int i;
+ EntityPtr p;
+
+ for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) {
+ p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]];
+ if (p->busType == BUS_NONE) {
+ num++;
+ }
+ }
+ return num;
+}
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
new file mode 100644
index 000000000..7f4cffaae
--- /dev/null
+++ b/hw/xfree86/common/xf86fbman.c
@@ -0,0 +1,1236 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.24 2001/12/05 19:23:52 mvojkovi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "regionstr.h"
+#include "xf86fbman.h"
+
+static int xf86FBMangerIndex = -1;
+static unsigned long xf86ManagerGeneration = 0;
+
+Bool xf86RegisterOffscreenManager(
+ ScreenPtr pScreen,
+ FBManagerFuncsPtr funcs
+){
+
+ if(xf86ManagerGeneration != serverGeneration) {
+ if((xf86FBMangerIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ xf86ManagerGeneration = serverGeneration;
+ }
+
+ pScreen->devPrivates[xf86FBMangerIndex].ptr = (pointer)funcs;
+
+ return TRUE;
+}
+
+
+Bool
+xf86FBManagerRunning(ScreenPtr pScreen)
+{
+ if(xf86FBMangerIndex < 0)
+ return FALSE;
+ if(!pScreen->devPrivates[xf86FBMangerIndex].ptr)
+ return FALSE;
+
+ return TRUE;
+}
+
+Bool
+xf86RegisterFreeBoxCallback(
+ ScreenPtr pScreen,
+ FreeBoxCallbackProcPtr FreeBoxCallback,
+ pointer devPriv
+){
+ FBManagerFuncsPtr funcs;
+
+ if(xf86FBMangerIndex < 0)
+ return FALSE;
+ if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return FALSE;
+
+ return (*funcs->RegisterFreeBoxCallback)(pScreen, FreeBoxCallback, devPriv);
+}
+
+
+FBAreaPtr
+xf86AllocateOffscreenArea(
+ ScreenPtr pScreen,
+ int w, int h,
+ int gran,
+ MoveAreaCallbackProcPtr moveCB,
+ RemoveAreaCallbackProcPtr removeCB,
+ pointer privData
+){
+ FBManagerFuncsPtr funcs;
+
+ if(xf86FBMangerIndex < 0)
+ return NULL;
+ if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return NULL;
+
+ return (*funcs->AllocateOffscreenArea)(
+ pScreen, w, h, gran, moveCB, removeCB, privData);
+}
+
+
+FBLinearPtr
+xf86AllocateOffscreenLinear(
+ ScreenPtr pScreen,
+ int length,
+ int gran,
+ MoveLinearCallbackProcPtr moveCB,
+ RemoveLinearCallbackProcPtr removeCB,
+ pointer privData
+){
+ FBManagerFuncsPtr funcs;
+
+ if(xf86FBMangerIndex < 0)
+ return NULL;
+ if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return NULL;
+
+ return (*funcs->AllocateOffscreenLinear)(
+ pScreen, length, gran, moveCB, removeCB, privData);
+}
+
+
+void
+xf86FreeOffscreenArea(FBAreaPtr area)
+{
+ FBManagerFuncsPtr funcs;
+
+ if(!area) return;
+
+ if(xf86FBMangerIndex < 0)
+ return;
+ if(!(funcs =
+ (FBManagerFuncsPtr)area->pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return;
+
+ (*funcs->FreeOffscreenArea)(area);
+
+ return;
+}
+
+
+void
+xf86FreeOffscreenLinear(FBLinearPtr area)
+{
+ FBManagerFuncsPtr funcs;
+
+ if(!area) return;
+
+ if(xf86FBMangerIndex < 0)
+ return;
+ if(!(funcs =
+ (FBManagerFuncsPtr)area->pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return;
+
+ (*funcs->FreeOffscreenLinear)(area);
+
+ return;
+}
+
+
+Bool
+xf86ResizeOffscreenArea(
+ FBAreaPtr resize,
+ int w, int h
+){
+ FBManagerFuncsPtr funcs;
+
+ if(!resize) return FALSE;
+
+ if(xf86FBMangerIndex < 0)
+ return FALSE;
+ if(!(funcs =
+ (FBManagerFuncsPtr)resize->pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return FALSE;
+
+ return (*funcs->ResizeOffscreenArea)(resize, w, h);
+}
+
+Bool
+xf86ResizeOffscreenLinear(
+ FBLinearPtr resize,
+ int size
+){
+ FBManagerFuncsPtr funcs;
+
+ if(!resize) return FALSE;
+
+ if(xf86FBMangerIndex < 0)
+ return FALSE;
+ if(!(funcs =
+ (FBManagerFuncsPtr)resize->pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return FALSE;
+
+ return (*funcs->ResizeOffscreenLinear)(resize, size);
+}
+
+
+Bool
+xf86QueryLargestOffscreenArea(
+ ScreenPtr pScreen,
+ int *w, int *h,
+ int gran,
+ int preferences,
+ int severity
+){
+ FBManagerFuncsPtr funcs;
+
+ *w = 0;
+ *h = 0;
+
+ if(xf86FBMangerIndex < 0)
+ return FALSE;
+ if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return FALSE;
+
+ return (*funcs->QueryLargestOffscreenArea)(
+ pScreen, w, h, gran, preferences, severity);
+}
+
+Bool
+xf86QueryLargestOffscreenLinear(
+ ScreenPtr pScreen,
+ int *size,
+ int gran,
+ int severity
+){
+ FBManagerFuncsPtr funcs;
+
+ *size = 0;
+
+ if(xf86FBMangerIndex < 0)
+ return FALSE;
+ if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return FALSE;
+
+ return (*funcs->QueryLargestOffscreenLinear)(
+ pScreen, size, gran, severity);
+}
+
+
+Bool
+xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen)
+{
+ FBManagerFuncsPtr funcs;
+
+ if(xf86FBMangerIndex < 0)
+ return FALSE;
+ if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return FALSE;
+
+ return (*funcs->PurgeOffscreenAreas)(pScreen);
+}
+
+/************************************************************\
+
+ Below is a specific implementation of an offscreen manager.
+
+\************************************************************/
+
+static unsigned long xf86FBGeneration = 0;
+static int xf86FBScreenIndex = -1;
+
+typedef struct _FBLink {
+ FBArea area;
+ struct _FBLink *next;
+} FBLink, *FBLinkPtr;
+
+typedef struct _FBLinearLink {
+ FBLinear linear;
+ FBAreaPtr area;
+ struct _FBLinearLink *next;
+} FBLinearLink, *FBLinearLinkPtr;
+
+
+typedef struct {
+ ScreenPtr pScreen;
+ RegionPtr InitialBoxes;
+ RegionPtr FreeBoxes;
+ FBLinkPtr UsedAreas;
+ int NumUsedAreas;
+ FBLinearLinkPtr LinearAreas;
+ CloseScreenProcPtr CloseScreen;
+ int NumCallbacks;
+ FreeBoxCallbackProcPtr *FreeBoxesUpdateCallback;
+ DevUnion *devPrivates;
+} FBManager, *FBManagerPtr;
+
+
+static void
+SendCallFreeBoxCallbacks(FBManagerPtr offman)
+{
+ int i = offman->NumCallbacks;
+
+ while(i--) {
+ (*offman->FreeBoxesUpdateCallback[i])(
+ offman->pScreen, offman->FreeBoxes, offman->devPrivates[i].ptr);
+ }
+}
+
+static Bool
+localRegisterFreeBoxCallback(
+ ScreenPtr pScreen,
+ FreeBoxCallbackProcPtr FreeBoxCallback,
+ pointer devPriv
+){
+ FBManagerPtr offman;
+ FreeBoxCallbackProcPtr *newCallbacks;
+ DevUnion *newPrivates;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ newCallbacks = xrealloc( offman->FreeBoxesUpdateCallback,
+ sizeof(FreeBoxCallbackProcPtr) * (offman->NumCallbacks + 1));
+
+ newPrivates = xrealloc(offman->devPrivates,
+ sizeof(DevUnion) * (offman->NumCallbacks + 1));
+
+ if(!newCallbacks || !newPrivates)
+ return FALSE;
+
+ offman->FreeBoxesUpdateCallback = newCallbacks;
+ offman->devPrivates = newPrivates;
+
+ offman->FreeBoxesUpdateCallback[offman->NumCallbacks] = FreeBoxCallback;
+ offman->devPrivates[offman->NumCallbacks].ptr = devPriv;
+ offman->NumCallbacks++;
+
+ SendCallFreeBoxCallbacks(offman);
+
+ return TRUE;
+}
+
+
+static FBAreaPtr
+AllocateArea(
+ FBManagerPtr offman,
+ int w, int h,
+ int granularity,
+ MoveAreaCallbackProcPtr moveCB,
+ RemoveAreaCallbackProcPtr removeCB,
+ pointer privData
+){
+ ScreenPtr pScreen = offman->pScreen;
+ FBLinkPtr link = NULL;
+ FBAreaPtr area = NULL;
+ RegionRec NewReg;
+ int i, x = 0, num;
+ BoxPtr boxp;
+
+ if(granularity <= 1) granularity = 0;
+
+ boxp = REGION_RECTS(offman->FreeBoxes);
+ num = REGION_NUM_RECTS(offman->FreeBoxes);
+
+ /* look through the free boxes */
+ for(i = 0; i < num; i++, boxp++) {
+ x = boxp->x1;
+ if(granularity) {
+ int tmp = x % granularity;
+ if(tmp) x += (granularity - tmp);
+ }
+
+ if(((boxp->y2 - boxp->y1) < h) || ((boxp->x2 - x) < w))
+ continue;
+
+ link = xalloc(sizeof(FBLink));
+ if(!link) return NULL;
+
+ area = &(link->area);
+ link->next = offman->UsedAreas;
+ offman->UsedAreas = link;
+ offman->NumUsedAreas++;
+ break;
+ }
+
+ /* try to boot a removeable one out if we are not expendable ourselves */
+ if(!area && !removeCB) {
+ link = offman->UsedAreas;
+
+ while(link) {
+ if(!link->area.RemoveAreaCallback) {
+ link = link->next;
+ continue;
+ }
+
+ boxp = &(link->area.box);
+ x = boxp->x1;
+ if(granularity) {
+ int tmp = x % granularity;
+ if(tmp) x += (granularity - tmp);
+ }
+
+ if(((boxp->y2 - boxp->y1) < h) || ((boxp->x2 - x) < w)) {
+ link = link->next;
+ continue;
+ }
+
+ /* bye, bye */
+ (*link->area.RemoveAreaCallback)(&link->area);
+ REGION_INIT(pScreen, &NewReg, &(link->area.box), 1);
+ REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg);
+ REGION_UNINIT(pScreen, &NewReg);
+
+ area = &(link->area);
+ break;
+ }
+ }
+
+ if(area) {
+ area->pScreen = pScreen;
+ area->granularity = granularity;
+ area->box.x1 = x;
+ area->box.x2 = x + w;
+ area->box.y1 = boxp->y1;
+ area->box.y2 = boxp->y1 + h;
+ area->MoveAreaCallback = moveCB;
+ area->RemoveAreaCallback = removeCB;
+ area->devPrivate.ptr = privData;
+
+ REGION_INIT(pScreen, &NewReg, &(area->box), 1);
+ REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg);
+ REGION_UNINIT(pScreen, &NewReg);
+ }
+
+ return area;
+}
+
+static FBAreaPtr
+localAllocateOffscreenArea(
+ ScreenPtr pScreen,
+ int w, int h,
+ int gran,
+ MoveAreaCallbackProcPtr moveCB,
+ RemoveAreaCallbackProcPtr removeCB,
+ pointer privData
+){
+ FBManagerPtr offman;
+ FBAreaPtr area = NULL;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ if((area = AllocateArea(offman, w, h, gran, moveCB, removeCB, privData)))
+ SendCallFreeBoxCallbacks(offman);
+
+ return area;
+}
+
+
+static void
+localFreeOffscreenArea(FBAreaPtr area)
+{
+ FBManagerPtr offman;
+ FBLinkPtr pLink, pLinkPrev = NULL;
+ RegionRec FreedRegion;
+ ScreenPtr pScreen;
+
+ pScreen = area->pScreen;
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ pLink = offman->UsedAreas;
+ if(!pLink) return;
+
+ while(&(pLink->area) != area) {
+ pLinkPrev = pLink;
+ pLink = pLink->next;
+ if(!pLink) return;
+ }
+
+ /* put the area back into the pool */
+ REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1);
+ REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedRegion);
+ REGION_UNINIT(pScreen, &FreedRegion);
+
+ if(pLinkPrev)
+ pLinkPrev->next = pLink->next;
+ else offman->UsedAreas = pLink->next;
+
+ xfree(pLink);
+ offman->NumUsedAreas--;
+
+ SendCallFreeBoxCallbacks(offman);
+}
+
+
+
+static Bool
+localResizeOffscreenArea(
+ FBAreaPtr resize,
+ int w, int h
+){
+ FBManagerPtr offman;
+ ScreenPtr pScreen;
+ BoxRec OrigArea;
+ RegionRec FreedReg;
+ FBAreaPtr area = NULL;
+ FBLinkPtr pLink, newLink, pLinkPrev = NULL;
+
+ pScreen = resize->pScreen;
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ /* find this link */
+ if(!(pLink = offman->UsedAreas))
+ return FALSE;
+
+ while(&(pLink->area) != resize) {
+ pLinkPrev = pLink;
+ pLink = pLink->next;
+ if(!pLink) return FALSE;
+ }
+
+ OrigArea.x1 = resize->box.x1;
+ OrigArea.x2 = resize->box.x2;
+ OrigArea.y1 = resize->box.y1;
+ OrigArea.y2 = resize->box.y2;
+
+ /* if it's smaller, this is easy */
+
+ if((w <= (resize->box.x2 - resize->box.x1)) &&
+ (h <= (resize->box.y2 - resize->box.y1))) {
+ RegionRec NewReg;
+
+ resize->box.x2 = resize->box.x1 + w;
+ resize->box.y2 = resize->box.y1 + h;
+
+ if((resize->box.y2 == OrigArea.y2) &&
+ (resize->box.x2 == OrigArea.x2))
+ return TRUE;
+
+ REGION_INIT(pScreen, &FreedReg, &OrigArea, 1);
+ REGION_INIT(pScreen, &NewReg, &(resize->box), 1);
+ REGION_SUBTRACT(pScreen, &FreedReg, &FreedReg, &NewReg);
+ REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
+ REGION_UNINIT(pScreen, &FreedReg);
+ REGION_UNINIT(pScreen, &NewReg);
+
+ SendCallFreeBoxCallbacks(offman);
+
+ return TRUE;
+ }
+
+
+ /* otherwise we remove the old region */
+
+ REGION_INIT(pScreen, &FreedReg, &OrigArea, 1);
+ REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
+
+ /* remove the old link */
+ if(pLinkPrev)
+ pLinkPrev->next = pLink->next;
+ else offman->UsedAreas = pLink->next;
+
+ /* and try to add a new one */
+
+ if((area = AllocateArea(offman, w, h, resize->granularity,
+ resize->MoveAreaCallback, resize->RemoveAreaCallback,
+ resize->devPrivate.ptr))) {
+
+ /* copy data over to our link and replace the new with old */
+ memcpy(resize, area, sizeof(FBArea));
+
+ pLinkPrev = NULL;
+ newLink = offman->UsedAreas;
+
+ while(&(newLink->area) != area) {
+ pLinkPrev = newLink;
+ newLink = newLink->next;
+ }
+
+ if(pLinkPrev)
+ pLinkPrev->next = newLink->next;
+ else offman->UsedAreas = newLink->next;
+
+ pLink->next = offman->UsedAreas;
+ offman->UsedAreas = pLink;
+
+ xfree(newLink);
+
+ /* AllocateArea added one but we really only exchanged one */
+ offman->NumUsedAreas--;
+ } else {
+ /* reinstate the old region */
+ REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
+ REGION_UNINIT(pScreen, &FreedReg);
+
+ pLink->next = offman->UsedAreas;
+ offman->UsedAreas = pLink;
+ return FALSE;
+ }
+
+
+ REGION_UNINIT(pScreen, &FreedReg);
+
+ SendCallFreeBoxCallbacks(offman);
+
+ return TRUE;
+}
+
+static Bool
+localQueryLargestOffscreenArea(
+ ScreenPtr pScreen,
+ int *width, int *height,
+ int granularity,
+ int preferences,
+ int severity
+){
+ FBManagerPtr offman;
+ RegionPtr newRegion = NULL;
+ BoxPtr pbox;
+ int nbox;
+ int x, w, h, area, oldArea;
+
+ *width = *height = oldArea = 0;
+
+ if(granularity <= 1) granularity = 0;
+
+ if((preferences < 0) || (preferences > 3))
+ return FALSE;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ if(severity < 0) severity = 0;
+ if(severity > 2) severity = 2;
+
+ switch(severity) {
+ case 2:
+ if(offman->NumUsedAreas) {
+ FBLinkPtr pLink;
+ RegionRec tmpRegion;
+ newRegion = REGION_CREATE(pScreen, NULL, 1);
+ REGION_COPY(pScreen, newRegion, offman->InitialBoxes);
+ pLink = offman->UsedAreas;
+
+ while(pLink) {
+ if(!pLink->area.RemoveAreaCallback) {
+ REGION_INIT(pScreen, &tmpRegion, &(pLink->area.box), 1);
+ REGION_SUBTRACT(pScreen, newRegion, newRegion, &tmpRegion);
+ REGION_UNINIT(pScreen, &tmpRegion);
+ }
+ pLink = pLink->next;
+ }
+
+ nbox = REGION_NUM_RECTS(newRegion);
+ pbox = REGION_RECTS(newRegion);
+ break;
+ }
+ case 1:
+ if(offman->NumUsedAreas) {
+ FBLinkPtr pLink;
+ RegionRec tmpRegion;
+ newRegion = REGION_CREATE(pScreen, NULL, 1);
+ REGION_COPY(pScreen, newRegion, offman->FreeBoxes);
+ pLink = offman->UsedAreas;
+
+ while(pLink) {
+ if(pLink->area.RemoveAreaCallback) {
+ REGION_INIT(pScreen, &tmpRegion, &(pLink->area.box), 1);
+ REGION_APPEND(pScreen, newRegion, &tmpRegion);
+ REGION_UNINIT(pScreen, &tmpRegion);
+ }
+ pLink = pLink->next;
+ }
+
+ nbox = REGION_NUM_RECTS(newRegion);
+ pbox = REGION_RECTS(newRegion);
+ break;
+ }
+ default:
+ nbox = REGION_NUM_RECTS(offman->FreeBoxes);
+ pbox = REGION_RECTS(offman->FreeBoxes);
+ break;
+ }
+
+ while(nbox--) {
+ x = pbox->x1;
+ if(granularity) {
+ int tmp = x % granularity;
+ if(tmp) x += (granularity - tmp);
+ }
+
+ w = pbox->x2 - x;
+ h = pbox->y2 - pbox->y1;
+ area = w * h;
+
+ if(w > 0) {
+ Bool gotIt = FALSE;
+ switch(preferences) {
+ case FAVOR_AREA_THEN_WIDTH:
+ if((area > oldArea) || ((area == oldArea) && (w > *width)))
+ gotIt = TRUE;
+ break;
+ case FAVOR_AREA_THEN_HEIGHT:
+ if((area > oldArea) || ((area == oldArea) && (h > *height)))
+ gotIt = TRUE;
+ break;
+ case FAVOR_WIDTH_THEN_AREA:
+ if((w > *width) || ((w == *width) && (area > oldArea)))
+ gotIt = TRUE;
+ break;
+ case FAVOR_HEIGHT_THEN_AREA:
+ if((h > *height) || ((h == *height) && (area > oldArea)))
+ gotIt = TRUE;
+ break;
+ }
+ if(gotIt) {
+ *width = w;
+ *height = h;
+ oldArea = area;
+ }
+ }
+ pbox++;
+ }
+
+ if(newRegion)
+ REGION_DESTROY(pScreen, newRegion);
+
+ return TRUE;
+}
+
+static Bool
+localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen)
+{
+ FBManagerPtr offman;
+ FBLinkPtr pLink, tmp, pPrev = NULL;
+ RegionRec FreedRegion;
+ Bool anyUsed = FALSE;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ pLink = offman->UsedAreas;
+ if(!pLink) return TRUE;
+
+ while(pLink) {
+ if(pLink->area.RemoveAreaCallback) {
+ (*pLink->area.RemoveAreaCallback)(&pLink->area);
+
+ REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1);
+ REGION_APPEND(pScreen, offman->FreeBoxes, &FreedRegion);
+ REGION_UNINIT(pScreen, &FreedRegion);
+
+ if(pPrev)
+ pPrev->next = pLink->next;
+ else offman->UsedAreas = pLink->next;
+
+ tmp = pLink;
+ pLink = pLink->next;
+ xfree(tmp);
+ offman->NumUsedAreas--;
+ anyUsed = TRUE;
+ } else {
+ pPrev = pLink;
+ pLink = pLink->next;
+ }
+ }
+
+ if(anyUsed) {
+ REGION_VALIDATE(pScreen, offman->FreeBoxes, &anyUsed);
+ SendCallFreeBoxCallbacks(offman);
+ }
+
+ return TRUE;
+}
+
+static void
+LinearMoveCBWrapper(FBAreaPtr from, FBAreaPtr to)
+{
+ /* this will never get called */
+}
+
+static void
+LinearRemoveCBWrapper(FBAreaPtr area)
+{
+ FBManagerPtr offman;
+ FBLinearLinkPtr pLink, pLinkPrev = NULL;
+ ScreenPtr pScreen = area->pScreen;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ pLink = offman->LinearAreas;
+ if(!pLink) return;
+
+ while(pLink->area != area) {
+ pLinkPrev = pLink;
+ pLink = pLink->next;
+ if(!pLink) return;
+ }
+
+ /* give the user the callback it is expecting */
+ (*pLink->linear.RemoveLinearCallback)(&(pLink->linear));
+
+ if(pLinkPrev)
+ pLinkPrev->next = pLink->next;
+ else offman->LinearAreas = pLink->next;
+
+ xfree(pLink);
+}
+
+
+static FBLinearPtr
+localAllocateOffscreenLinear(
+ ScreenPtr pScreen,
+ int length,
+ int gran,
+ MoveLinearCallbackProcPtr moveCB,
+ RemoveLinearCallbackProcPtr removeCB,
+ pointer privData
+){
+ FBManagerPtr offman;
+ FBLinearLinkPtr link;
+ FBAreaPtr area;
+ FBLinearPtr linear = NULL;
+ BoxPtr extents;
+ int w, h, pitch;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ if(!(link = xalloc(sizeof(FBLinearLink))))
+ return NULL;
+
+#if 0
+ if(we have linear heap space) {
+ if(able to allocate some) {
+ link->area = NULL;
+ link->next = offman->LinearAreas;
+ offman->LinearAreas = link;
+ linear = link->linear;
+ linear->pScreen = pScreen;
+ linear->size = length;
+ linear->offset = ????;
+ linear->granularity = gran;
+ linear->MoveLinearAreaCallback = moveCB;
+ linear->RemoveLinearAreaCallback = removeCB;
+ linear->devPrivate.ptr = privData;
+ return linear;
+ } /* else fallthrough */
+ }
+#endif
+
+ extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
+ pitch = extents->x2 - extents->x1;
+
+ if(gran && ((gran > pitch) || (pitch % gran))) {
+ /* we can't match the specified alignment with XY allocations */
+ xfree(link);
+ return NULL;
+ }
+
+ if(length < pitch) { /* special case */
+ w = length;
+ h = 1;
+ } else {
+ w = pitch;
+ h = (length + pitch - 1) / pitch;
+ }
+
+ if((area = localAllocateOffscreenArea(pScreen, w, h, gran,
+ moveCB ? LinearMoveCBWrapper : NULL,
+ removeCB ? LinearRemoveCBWrapper : NULL,
+ privData)))
+ {
+ link->area = area;
+ link->next = offman->LinearAreas;
+ offman->LinearAreas = link;
+ linear = &(link->linear);
+ linear->pScreen = pScreen;
+ linear->size = h * w;
+ linear->offset = (pitch * area->box.y1) + area->box.x1;
+ linear->granularity = gran;
+ linear->MoveLinearCallback = moveCB;
+ linear->RemoveLinearCallback = removeCB;
+ linear->devPrivate.ptr = privData;
+ } else
+ xfree(link);
+
+ return linear;
+}
+
+
+static void
+localFreeOffscreenLinear(FBLinearPtr linear)
+{
+ FBManagerPtr offman;
+ FBLinearLinkPtr pLink, pLinkPrev = NULL;
+ ScreenPtr pScreen = linear->pScreen;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ pLink = offman->LinearAreas;
+ if(!pLink) return;
+
+ while(&(pLink->linear) != linear) {
+ pLinkPrev = pLink;
+ pLink = pLink->next;
+ if(!pLink) return;
+ }
+
+ if(pLink->area) { /* really an XY area */
+ localFreeOffscreenArea(pLink->area);
+ } else {
+ /* free the linear area */
+ }
+
+ if(pLinkPrev)
+ pLinkPrev->next = pLink->next;
+ else offman->LinearAreas = pLink->next;
+
+ xfree(pLink);
+}
+
+
+static Bool
+localResizeOffscreenLinear(FBLinearPtr resize, int length)
+{
+ FBManagerPtr offman;
+ FBLinearLinkPtr pLink, pLinkPrev = NULL;
+ ScreenPtr pScreen = resize->pScreen;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ pLink = offman->LinearAreas;
+ if(!pLink) return FALSE;
+
+ while(&(pLink->linear) != resize) {
+ pLinkPrev = pLink;
+ pLink = pLink->next;
+ if(!pLink) return FALSE;
+ }
+
+ /* This could actually be alot smarter and try to move allocations
+ from XY to linear when available. For now if it was XY, we keep
+ it XY */
+
+ if(pLink->area) { /* really an XY area */
+ BoxPtr extents;
+ int pitch, w, h;
+
+ extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
+ pitch = extents->x2 - extents->x1;
+
+ if(length < pitch) { /* special case */
+ w = length;
+ h = 1;
+ } else {
+ w = pitch;
+ h = (length + pitch - 1) / pitch;
+ }
+
+ if(localResizeOffscreenArea(pLink->area, w, h)) {
+ resize->size = h * w;
+ resize->offset = (pitch * pLink->area->box.y1) + pLink->area->box.x1;
+ return TRUE;
+ }
+ } else {
+ /* resize the linear area */
+ }
+
+ return FALSE;
+}
+
+
+static Bool
+localQueryLargestOffscreenLinear(
+ ScreenPtr pScreen,
+ int *size,
+ int gran,
+ int priority
+)
+{
+ int w, h;
+
+ *size = 0;
+
+ /* for now, we only look at XY space */
+ if(localQueryLargestOffscreenArea(pScreen, &w, &h, gran,
+ FAVOR_WIDTH_THEN_AREA, priority))
+ {
+ FBManagerPtr offman;
+ BoxPtr extents;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+ extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
+ if((extents->x2 - extents->x1) == w)
+ *size = w * h;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+
+static FBManagerFuncs xf86FBManFuncs = {
+ localAllocateOffscreenArea,
+ localFreeOffscreenArea,
+ localResizeOffscreenArea,
+ localQueryLargestOffscreenArea,
+ localRegisterFreeBoxCallback,
+ localAllocateOffscreenLinear,
+ localFreeOffscreenLinear,
+ localResizeOffscreenLinear,
+ localQueryLargestOffscreenLinear,
+ localPurgeUnlockedOffscreenAreas
+ };
+
+
+static Bool
+xf86FBCloseScreen (int i, ScreenPtr pScreen)
+{
+ FBLinkPtr pLink, tmp;
+ FBLinearLinkPtr pLinearLink, tmp2;
+ FBManagerPtr offman =
+ (FBManagerPtr) pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+
+ pScreen->CloseScreen = offman->CloseScreen;
+
+ pLink = offman->UsedAreas;
+ while(pLink) {
+ tmp = pLink;
+ pLink = pLink->next;
+ xfree(tmp);
+ }
+
+ pLinearLink = offman->LinearAreas;
+ while(pLinearLink) {
+ tmp2 = pLinearLink;
+ pLinearLink = pLinearLink->next;
+ xfree(tmp2);
+ }
+
+ REGION_DESTROY(pScreen, offman->InitialBoxes);
+ REGION_DESTROY(pScreen, offman->FreeBoxes);
+
+ xfree(offman->FreeBoxesUpdateCallback);
+ xfree(offman->devPrivates);
+ xfree(offman);
+ pScreen->devPrivates[xf86FBScreenIndex].ptr = NULL;
+
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+Bool
+xf86InitFBManager(
+ ScreenPtr pScreen,
+ BoxPtr FullBox
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ RegionRec ScreenRegion;
+ RegionRec FullRegion;
+ BoxRec ScreenBox;
+ Bool ret;
+
+ ScreenBox.x1 = 0;
+ ScreenBox.y1 = 0;
+ ScreenBox.x2 = pScrn->virtualX;
+ ScreenBox.y2 = pScrn->virtualY;
+
+ if((FullBox->x1 > ScreenBox.x1) || (FullBox->y1 > ScreenBox.y1) ||
+ (FullBox->x2 < ScreenBox.x2) || (FullBox->y2 < ScreenBox.y2)) {
+ return FALSE;
+ }
+
+ if (FullBox->y2 < FullBox->y1) return FALSE;
+ if (FullBox->x2 < FullBox->x2) return FALSE;
+
+ REGION_INIT(pScreen, &ScreenRegion, &ScreenBox, 1);
+ REGION_INIT(pScreen, &FullRegion, FullBox, 1);
+
+ REGION_SUBTRACT(pScreen, &FullRegion, &FullRegion, &ScreenRegion);
+
+ ret = xf86InitFBManagerRegion(pScreen, &FullRegion);
+
+ REGION_UNINIT(pScreen, &ScreenRegion);
+ REGION_UNINIT(pScreen, &FullRegion);
+
+ return ret;
+}
+
+Bool
+xf86InitFBManagerArea(
+ ScreenPtr pScreen,
+ int PixelArea,
+ int Verbosity
+)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ xRectangle Rect[3];
+ RegionPtr pRegion, pScreenRegion;
+ int nRect;
+ Bool ret = FALSE;
+
+ if (PixelArea < (pScrn->displayWidth * pScrn->virtualY))
+ return FALSE;
+
+ Rect[0].x = Rect[0].y = 0;
+ Rect[0].width = pScrn->displayWidth;
+ Rect[0].height = PixelArea / pScrn->displayWidth;
+ nRect = 1;
+
+ /* Add a possible partial scanline */
+ if ((Rect[1].height = Rect[1].width = PixelArea % pScrn->displayWidth)) {
+ Rect[1].x = 0;
+ Rect[1].y = Rect[0].height;
+ Rect[1].height = 1;
+ nRect++;
+ }
+
+ /* Factor out virtual resolution */
+ pRegion = RECTS_TO_REGION(pScreen, nRect, Rect, 0);
+ if (pRegion) {
+ if (!REGION_NAR(pRegion)) {
+ Rect[2].x = Rect[2].y = 0;
+ Rect[2].width = pScrn->virtualX;
+ Rect[2].height = pScrn->virtualY;
+
+ pScreenRegion = RECTS_TO_REGION(pScreen, 1, &Rect[2], 0);
+ if (pScreenRegion) {
+ if (!REGION_NAR(pScreenRegion)) {
+ REGION_SUBTRACT(pScreen, pRegion, pRegion, pScreenRegion);
+
+ ret = xf86InitFBManagerRegion(pScreen, pRegion);
+
+ if (ret && xf86GetVerbosity() >= Verbosity) {
+ int scrnIndex = pScrn->scrnIndex;
+
+ xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
+ "Largest offscreen areas (with overlaps):\n");
+
+ if (Rect[2].width < Rect[0].width) {
+ xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
+ "\t%d x %d rectangle at %d,0\n",
+ Rect[0].width - Rect[2].width,
+ Rect[0].height,
+ Rect[2].width);
+ }
+ if (Rect[2].width < Rect[1].width) {
+ xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
+ "\t%d x %d rectangle at %d,0\n",
+ Rect[1].width - Rect[2].width,
+ Rect[0].height + Rect[1].height,
+ Rect[2].width);
+ }
+ if (Rect[2].height < Rect[0].height) {
+ xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
+ "\t%d x %d rectangle at 0,%d\n",
+ Rect[0].width,
+ Rect[0].height - Rect[2].height,
+ Rect[2].height);
+ }
+ if (Rect[1].height) {
+ xf86DrvMsgVerb(scrnIndex, X_INFO, Verbosity,
+ "\t%d x %d rectangle at 0,%d\n",
+ Rect[1].width,
+ Rect[0].height - Rect[2].height +
+ Rect[1].height,
+ Rect[2].height);
+ }
+ }
+ }
+
+ REGION_DESTROY(pScreen, pScreenRegion);
+ }
+ }
+
+ REGION_DESTROY(pScreen, pRegion);
+ }
+
+ return ret;
+}
+
+Bool
+xf86InitFBManagerRegion(
+ ScreenPtr pScreen,
+ RegionPtr FullRegion
+){
+ FBManagerPtr offman;
+
+ if(REGION_NIL(FullRegion))
+ return FALSE;
+
+ if(xf86FBGeneration != serverGeneration) {
+ if((xf86FBScreenIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ xf86FBGeneration = serverGeneration;
+ }
+
+ if(!xf86RegisterOffscreenManager(pScreen, &xf86FBManFuncs))
+ return FALSE;
+
+ offman = xalloc(sizeof(FBManager));
+ if(!offman) return FALSE;
+
+ pScreen->devPrivates[xf86FBScreenIndex].ptr = (pointer)offman;
+
+ offman->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = xf86FBCloseScreen;
+
+ offman->InitialBoxes = REGION_CREATE(pScreen, NULL, 1);
+ offman->FreeBoxes = REGION_CREATE(pScreen, NULL, 1);
+
+ REGION_COPY(pScreen, offman->InitialBoxes, FullRegion);
+ REGION_COPY(pScreen, offman->FreeBoxes, FullRegion);
+
+ offman->pScreen = pScreen;
+ offman->UsedAreas = NULL;
+ offman->LinearAreas = NULL;
+ offman->NumUsedAreas = 0;
+ offman->NumCallbacks = 0;
+ offman->FreeBoxesUpdateCallback = NULL;
+ offman->devPrivates = NULL;
+
+ return TRUE;
+}
+
+
+
+/* This is an implementation specific function and should
+ disappear after the next release. People should use the
+ real linear functions instead */
+
+FBAreaPtr
+xf86AllocateLinearOffscreenArea (
+ ScreenPtr pScreen,
+ int length,
+ int gran,
+ MoveAreaCallbackProcPtr moveCB,
+ RemoveAreaCallbackProcPtr removeCB,
+ pointer privData
+){
+ FBManagerFuncsPtr funcs;
+ FBManagerPtr offman;
+ BoxPtr extents;
+ int w, h;
+
+ if(xf86FBMangerIndex < 0)
+ return NULL;
+ if(!(funcs = (FBManagerFuncsPtr)pScreen->devPrivates[xf86FBMangerIndex].ptr))
+ return NULL;
+
+ offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
+
+ extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
+ w = extents->x2 - extents->x1;
+
+ if(gran && ((gran > w) || (w % gran))) {
+ /* we can't match the specified alignment with XY allocations */
+ return NULL;
+ }
+
+ if(length <= w) { /* special case */
+ h = 1;
+ w = length;
+ } else {
+ h = (length + w - 1) / w;
+ }
+
+ return (*funcs->AllocateOffscreenArea)(
+ pScreen, w, h, gran, moveCB, removeCB, privData);
+}
diff --git a/hw/xfree86/common/xf86fbman.h b/hw/xfree86/common/xf86fbman.h
new file mode 100644
index 000000000..673c7bc33
--- /dev/null
+++ b/hw/xfree86/common/xf86fbman.h
@@ -0,0 +1,193 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.h,v 1.12 2001/08/28 16:55:09 tsi Exp $ */
+
+#ifndef _XF86FBMAN_H
+#define _XF86FBMAN_H
+
+
+#include "scrnintstr.h"
+#include "regionstr.h"
+
+
+#define FAVOR_AREA_THEN_WIDTH 0
+#define FAVOR_AREA_THEN_HEIGHT 1
+#define FAVOR_WIDTH_THEN_AREA 2
+#define FAVOR_HEIGHT_THEN_AREA 3
+
+#define PRIORITY_LOW 0
+#define PRIORITY_NORMAL 1
+#define PRIORITY_EXTREME 2
+
+
+typedef struct _FBArea {
+ ScreenPtr pScreen;
+ BoxRec box;
+ int granularity;
+ void (*MoveAreaCallback)(struct _FBArea*, struct _FBArea*);
+ void (*RemoveAreaCallback)(struct _FBArea*);
+ DevUnion devPrivate;
+} FBArea, *FBAreaPtr;
+
+typedef struct _FBLinear {
+ ScreenPtr pScreen;
+ int size;
+ int offset;
+ int granularity;
+ void (*MoveLinearCallback)(struct _FBLinear*, struct _FBLinear*);
+ void (*RemoveLinearCallback)(struct _FBLinear*);
+ DevUnion devPrivate;
+} FBLinear, *FBLinearPtr;
+
+typedef void (*FreeBoxCallbackProcPtr)(ScreenPtr, RegionPtr, pointer);
+typedef void (*MoveAreaCallbackProcPtr)(FBAreaPtr, FBAreaPtr);
+typedef void (*RemoveAreaCallbackProcPtr)(FBAreaPtr);
+
+typedef void (*MoveLinearCallbackProcPtr)(FBLinearPtr, FBLinearPtr);
+typedef void (*RemoveLinearCallbackProcPtr)(FBLinearPtr);
+
+
+typedef struct {
+ FBAreaPtr (*AllocateOffscreenArea)(
+ ScreenPtr pScreen,
+ int w, int h,
+ int granularity,
+ MoveAreaCallbackProcPtr moveCB,
+ RemoveAreaCallbackProcPtr removeCB,
+ pointer privData);
+ void (*FreeOffscreenArea)(FBAreaPtr area);
+ Bool (*ResizeOffscreenArea)(FBAreaPtr area, int w, int h);
+ Bool (*QueryLargestOffscreenArea)(
+ ScreenPtr pScreen,
+ int *width, int *height,
+ int granularity,
+ int preferences,
+ int priority);
+ Bool (*RegisterFreeBoxCallback)(
+ ScreenPtr pScreen,
+ FreeBoxCallbackProcPtr FreeBoxCallback,
+ pointer devPriv);
+/* linear functions */
+ FBLinearPtr (*AllocateOffscreenLinear)(
+ ScreenPtr pScreen,
+ int size,
+ int granularity,
+ MoveLinearCallbackProcPtr moveCB,
+ RemoveLinearCallbackProcPtr removeCB,
+ pointer privData);
+ void (*FreeOffscreenLinear)(FBLinearPtr area);
+ Bool (*ResizeOffscreenLinear)(FBLinearPtr area, int size);
+ Bool (*QueryLargestOffscreenLinear)(
+ ScreenPtr pScreen,
+ int *size,
+ int granularity,
+ int priority);
+ Bool (*PurgeOffscreenAreas) (ScreenPtr);
+} FBManagerFuncs, *FBManagerFuncsPtr;
+
+
+Bool xf86RegisterOffscreenManager(
+ ScreenPtr pScreen,
+ FBManagerFuncsPtr funcs
+);
+
+Bool
+xf86InitFBManagerRegion(
+ ScreenPtr pScreen,
+ RegionPtr ScreenRegion
+);
+
+Bool
+xf86InitFBManagerArea(
+ ScreenPtr pScreen,
+ int PixalArea,
+ int Verbosity
+);
+
+Bool
+xf86InitFBManager(
+ ScreenPtr pScreen,
+ BoxPtr FullBox
+);
+
+Bool
+xf86FBManagerRunning(
+ ScreenPtr pScreen
+);
+
+FBAreaPtr
+xf86AllocateOffscreenArea (
+ ScreenPtr pScreen,
+ int w, int h,
+ int granularity,
+ MoveAreaCallbackProcPtr moveCB,
+ RemoveAreaCallbackProcPtr removeCB,
+ pointer privData
+);
+
+FBAreaPtr
+xf86AllocateLinearOffscreenArea (
+ ScreenPtr pScreen,
+ int length,
+ int granularity,
+ MoveAreaCallbackProcPtr moveCB,
+ RemoveAreaCallbackProcPtr removeCB,
+ pointer privData
+);
+
+FBLinearPtr
+xf86AllocateOffscreenLinear (
+ ScreenPtr pScreen,
+ int length,
+ int granularity,
+ MoveLinearCallbackProcPtr moveCB,
+ RemoveLinearCallbackProcPtr removeCB,
+ pointer privData
+);
+
+void xf86FreeOffscreenArea(FBAreaPtr area);
+void xf86FreeOffscreenLinear(FBLinearPtr area);
+
+Bool
+xf86ResizeOffscreenArea(
+ FBAreaPtr resize,
+ int w, int h
+);
+
+Bool
+xf86ResizeOffscreenLinear(
+ FBLinearPtr resize,
+ int size
+);
+
+
+Bool
+xf86RegisterFreeBoxCallback(
+ ScreenPtr pScreen,
+ FreeBoxCallbackProcPtr FreeBoxCallback,
+ pointer devPriv
+);
+
+Bool
+xf86PurgeUnlockedOffscreenAreas(
+ ScreenPtr pScreen
+);
+
+
+Bool
+xf86QueryLargestOffscreenArea(
+ ScreenPtr pScreen,
+ int *width, int *height,
+ int granularity,
+ int preferences,
+ int priority
+);
+
+Bool
+xf86QueryLargestOffscreenLinear(
+ ScreenPtr pScreen,
+ int *size,
+ int granularity,
+ int priority
+);
+
+
+#endif /* _XF86FBMAN_H */
diff --git a/hw/xfree86/common/xf86isaBus.c b/hw/xfree86/common/xf86isaBus.c
new file mode 100644
index 000000000..cfe6ed000
--- /dev/null
+++ b/hw/xfree86/common/xf86isaBus.c
@@ -0,0 +1,115 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.5 2000/12/06 15:35:11 eich Exp $ */
+
+/*
+ * Copyright (c) 1997-1999 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains the interfaces to the bus-specific code
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Resources.h"
+
+#include "xf86Bus.h"
+
+#define XF86_OS_PRIVS
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSproc.h"
+
+#include "xf86RAC.h"
+
+Bool isaSlotClaimed = FALSE;
+
+/*
+ * If the slot requested is already in use, return FALSE.
+ * Otherwise, claim the slot for the screen requesting it.
+ */
+
+int
+xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
+{
+ EntityPtr p;
+ BusAccPtr pbap = xf86BusAccInfo;
+ int num;
+
+ num = xf86AllocateEntity();
+ p = xf86Entities[num];
+ p->driver = drvp;
+ p->chipset = chipset;
+ p->busType = BUS_ISA;
+ p->active = active;
+ p->inUse = FALSE;
+ xf86AddDevToEntity(num, dev);
+ p->access = xnfcalloc(1,sizeof(EntityAccessRec));
+ p->access->fallback = &AccessNULL;
+ p->access->pAccess = &AccessNULL;
+ p->busAcc = NULL;
+ while (pbap) {
+ if (pbap->type == BUS_ISA)
+ p->busAcc = pbap;
+ pbap = pbap->next;
+ }
+ isaSlotClaimed = TRUE;
+ return num;
+}
+
+/*
+ * Get the list of ISA "slots" claimed by a screen
+ *
+ * Note: The ISA implementation here assumes that only one ISA "slot" type
+ * can be claimed by any one screen. That means a return value other than
+ * 0 or 1 isn't useful.
+ */
+int
+xf86GetIsaInfoForScreen(int scrnIndex)
+{
+ int num = 0;
+ int i;
+ EntityPtr p;
+
+ for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) {
+ p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]];
+ if (p->busType == BUS_ISA) {
+ num++;
+ }
+ }
+ return num;
+}
+
+/*
+ * Parse a BUS ID string, and return True if it is a ISA bus id.
+ */
+
+Bool
+xf86ParseIsaBusString(const char *busID)
+{
+ /*
+ * The format assumed to be "isa" or "isa:"
+ */
+ return (StringToBusType(busID,NULL) == BUS_ISA);
+}
+
+
+/*
+ * xf86IsPrimaryIsa() -- return TRUE if primary device
+ * is ISA.
+ */
+
+Bool
+xf86IsPrimaryIsa(void)
+{
+ return ( primaryBus.type == BUS_ISA );
+}
+
+void
+isaConvertRange2Host(resRange *pRange)
+{
+ return;
+}
diff --git a/hw/xfree86/common/xf86noBus.c b/hw/xfree86/common/xf86noBus.c
new file mode 100644
index 000000000..a9efcdbc4
--- /dev/null
+++ b/hw/xfree86/common/xf86noBus.c
@@ -0,0 +1,48 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.1 2002/09/18 08:54:55 eich Exp $ */
+
+/*
+ * Copyright (c) 2000 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains the interfaces to the bus-specific code
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Resources.h"
+
+#include "xf86Bus.h"
+
+#define XF86_OS_PRIVS
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSproc.h"
+
+#include "xf86RAC.h"
+
+int
+xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
+{
+ EntityPtr p;
+ int num;
+
+ num = xf86AllocateEntity();
+ p = xf86Entities[num];
+ p->driver = drvp;
+ p->chipset = 0;
+ p->busType = BUS_NONE;
+ p->active = active;
+ p->inUse = FALSE;
+ xf86AddDevToEntity(num, dev);
+ p->access = xnfcalloc(1,sizeof(EntityAccessRec));
+ p->access->fallback = &AccessNULL;
+ p->access->pAccess = &AccessNULL;
+ p->busAcc = NULL;
+
+ return num;
+}
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
new file mode 100644
index 000000000..c40fc1016
--- /dev/null
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -0,0 +1,3493 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.68.2.1 2003/05/06 17:00:43 tsi Exp $ */
+/*
+ * Copyright (c) 1997-2002 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains the interfaces to the bus-specific code
+ */
+#define INCLUDE_DEPRECATED 1
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "X.h"
+#include "os.h"
+#include "Pci.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Resources.h"
+
+/* Bus-specific headers */
+#include "xf86PciData.h"
+
+#include "xf86Bus.h"
+
+#define XF86_OS_PRIVS
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSproc.h"
+
+#include "xf86RAC.h"
+
+/* Bus-specific globals */
+Bool pciSlotClaimed = FALSE;
+pciConfigPtr *xf86PciInfo = NULL; /* Full PCI probe info */
+pciVideoPtr *xf86PciVideoInfo = NULL; /* PCI probe for video hw */
+pciAccPtr * xf86PciAccInfo = NULL; /* PCI access related */
+
+/* pcidata globals */
+ScanPciSetupProcPtr xf86SetupPciIds = NULL;
+ScanPciCloseProcPtr xf86ClosePciIds = NULL;
+ScanPciFindByDeviceProcPtr xf86FindPciNamesByDevice = NULL;
+ScanPciFindBySubsysProcPtr xf86FindPciNamesBySubsys = NULL;
+ScanPciFindClassBySubsysProcPtr xf86FindPciClassBySubsys = NULL;
+ScanPciFindClassByDeviceProcPtr xf86FindPciClassByDevice = NULL;
+
+static resPtr pciAvoidRes = NULL;
+
+/* PCI buses */
+static PciBusPtr xf86PciBus = NULL;
+/* Bus-specific probe/sorting functions */
+
+/* PCI classes that get included in xf86PciVideoInfo */
+#define PCIINFOCLASSES(b,s) \
+ (((b) == PCI_CLASS_PREHISTORIC) || \
+ ((b) == PCI_CLASS_DISPLAY) || \
+ ((b) == PCI_CLASS_MULTIMEDIA && (s) == PCI_SUBCLASS_MULTIMEDIA_VIDEO) || \
+ ((b) == PCI_CLASS_PROCESSOR && (s) == PCI_SUBCLASS_PROCESSOR_COPROC))
+
+/*
+ * PCI classes that have messages printed always. The others are only
+ * have a message printed when the vendor/dev IDs are recognised.
+ */
+#define PCIALWAYSPRINTCLASSES(b,s) \
+ (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \
+ ((b) == PCI_CLASS_DISPLAY) || \
+ ((b) == PCI_CLASS_MULTIMEDIA && (s) == PCI_SUBCLASS_MULTIMEDIA_VIDEO))
+
+/*
+ * PCI classes for which potentially destructive checking of the map sizes
+ * may be done. Any classes where this may be unsafe should be omitted
+ * from this list.
+ */
+#define PCINONSYSTEMCLASSES(b,s) PCIALWAYSPRINTCLASSES(b,s)
+
+/*
+ * PCI classes that use RAC
+ */
+#define PCISHAREDIOCLASSES(b,s) \
+ (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \
+ ((b) == PCI_CLASS_DISPLAY && (s) == PCI_SUBCLASS_DISPLAY_VGA))
+
+#define PCI_MEM32_LENGTH_MAX 0xFFFFFFFF
+
+#undef MIN
+#define MIN(x,y) ((x<y)?x:y)
+
+#define B2M(tag,base) pciBusAddrToHostAddr(tag,PCI_MEM,base)
+#define B2I(tag,base) (base)
+#define B2H(tag,base,type) (((type & ResPhysMask) == ResMem) ? \
+ B2M(tag, base) : B2I(tag, base))
+#define M2B(tag,base) pciHostAddrToBusAddr(tag,PCI_IO,base)
+#define I2B(tag,base) (base)
+#define H2B(tag,base,type) (((type & ResPhysMask) == ResMem) ? \
+ M2B(tag, base) : I2B(tag, base))
+#define TAG(pvp) (pciTag(pvp->bus,pvp->device,pvp->func))
+#define SIZE(size) ((1 << size) - 1)
+#define PCI_SIZE(type,tag,size) (((type & ResPhysMask) == ResMem) \
+ ? pciBusAddrToHostAddr(tag,PCI_MEM_SIZE,size) \
+ : pciBusAddrToHostAddr(tag,PCI_IO_SIZE,size))
+#define PCI_M_RANGE(range,tag,begin,end,type) \
+ { \
+ RANGE(range, B2M(tag, begin), B2M(tag, end), \
+ RANGE_TYPE(type, xf86GetPciDomain(tag))); \
+ }
+#define PCI_I_RANGE(range,tag,begin,end,type) \
+ { \
+ RANGE(range, B2I(tag, begin), B2I(tag, end), \
+ RANGE_TYPE(type, xf86GetPciDomain(tag))); \
+ }
+#define PCI_X_RANGE(range,tag,begin,end,type) \
+{ if ((type & ResPhysMask) == ResMem) PCI_M_RANGE(range,tag,begin,end,type); \
+ else PCI_I_RANGE(range,tag,begin,end,type); }
+#define P_M_RANGE(range,tag,begin,size,type) \
+ PCI_M_RANGE(range,tag,begin,(begin + SIZE(size)),type)
+#define P_I_RANGE(range,tag,begin,size,type) \
+ PCI_I_RANGE(range,tag,begin,(begin + SIZE(size)),type)
+#define P_X_RANGE(range,tag,begin,size,type) \
+{ if ((type & ResPhysMask) == ResMem) P_M_RANGE(range,tag,begin,size,type); \
+ else P_I_RANGE(range,tag,begin,size,type); }
+#define PV_M_RANGE(range,pvp,i,type) \
+ P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i],type)
+#define PV_B_RANGE(range,pvp,type) \
+ P_M_RANGE(range,TAG(pvp),pvp->biosBase,pvp->biosSize,type)
+#define PV_I_RANGE(range,pvp,i,type) \
+ P_I_RANGE(range,TAG(pvp),pvp->ioBase[i],pvp->size[i],type)
+
+static void getPciClassFlags(pciConfigPtr *pcrpp);
+static void pciConvertListToHost(int bus, int dev, int func, resPtr list);
+static PciBusPtr xf86GetPciBridgeInfo(void);
+
+void
+xf86FormatPciBusNumber(int busnum, char *buffer)
+{
+ /* 'buffer' should be at least 8 characters long */
+ if (busnum < 256)
+ sprintf(buffer, "%d", busnum);
+ else
+ sprintf(buffer, "%d@%d", busnum & 0x00ff, busnum >> 8);
+}
+
+static Bool
+IsBaseUnassigned(CARD32 base)
+{
+ CARD32 mask;
+
+ if (base & PCI_MAP_IO)
+ mask = ~PCI_MAP_IO_ATTR_MASK;
+ else
+ mask = ~PCI_MAP_MEMORY_ATTR_MASK;
+
+ base &= mask;
+ return (!base || (base == mask));
+}
+
+static void
+FindPCIVideoInfo(void)
+{
+ pciConfigPtr pcrp, *pcrpp;
+ int i = 0, j, k;
+ int num = 0;
+ pciVideoPtr info;
+ Bool mem64 = FALSE;
+
+ pcrpp = xf86PciInfo = xf86scanpci(0);
+ getPciClassFlags(pcrpp);
+
+ if (pcrpp == NULL) {
+ xf86PciVideoInfo = NULL;
+ return;
+ }
+ xf86PciBus = xf86GetPciBridgeInfo();
+
+ while ((pcrp = pcrpp[i])) {
+ int baseclass;
+ int subclass;
+
+ if (pcrp->listed_class & 0xffff) {
+ baseclass = (pcrp->listed_class >> 8) & 0xff;
+ subclass = pcrp->listed_class & 0xff;
+ } else {
+ baseclass = pcrp->pci_base_class;
+ subclass = pcrp->pci_sub_class;
+ }
+
+ if (PCIINFOCLASSES(baseclass, subclass)) {
+ num++;
+ xf86PciVideoInfo = xnfrealloc(xf86PciVideoInfo,
+ sizeof(pciVideoPtr) * (num + 1));
+ xf86PciVideoInfo[num] = NULL;
+ info = xf86PciVideoInfo[num - 1] = xnfalloc(sizeof(pciVideoRec));
+ info->validSize = FALSE;
+ info->vendor = pcrp->pci_vendor;
+ info->chipType = pcrp->pci_device;
+ info->chipRev = pcrp->pci_rev_id;
+ info->subsysVendor = pcrp->pci_subsys_vendor;
+ info->subsysCard = pcrp->pci_subsys_card;
+ info->bus = pcrp->busnum;
+ info->device = pcrp->devnum;
+ info->func = pcrp->funcnum;
+ info->class = baseclass;
+ info->subclass = pcrp->pci_sub_class;
+ info->interface = pcrp->pci_prog_if;
+ info->biosBase = PCIGETROM(pcrp->pci_baserom);
+ info->biosSize = pciGetBaseSize(pcrp->tag, 6, TRUE, NULL);
+ info->thisCard = pcrp;
+ info->validate = FALSE;
+#ifdef INCLUDE_XF86_NO_DOMAIN
+ if ((PCISHAREDIOCLASSES(baseclass, subclass))
+ && (pcrp->pci_command & PCI_CMD_IO_ENABLE) &&
+ (pcrp->pci_prog_if == 0)) {
+
+ /*
+ * Attempt to ensure that VGA is actually routed to this
+ * adapter on entry. This needs to be fixed when we finally
+ * grok host bridges (and multiple bus trees).
+ */
+ j = info->bus;
+ while (TRUE) {
+ PciBusPtr pBus = xf86PciBus;
+ while (pBus && j != pBus->secondary)
+ pBus = pBus->next;
+ if (!pBus || !(pBus->brcontrol & PCI_PCI_BRIDGE_VGA_EN))
+ break;
+ if (j == pBus->primary) {
+ if (primaryBus.type == BUS_NONE) {
+ /* assumption: primary adapter is always VGA */
+ primaryBus.type = BUS_PCI;
+ primaryBus.id.pci.bus = pcrp->busnum;
+ primaryBus.id.pci.device = pcrp->devnum;
+ primaryBus.id.pci.func = pcrp->funcnum;
+ } else if (primaryBus.type < BUS_last) {
+ xf86Msg(X_NOTICE,
+ "More than one primary device found\n");
+ primaryBus.type ^= (BusType)(-1);
+ }
+ break;
+ }
+ j = pBus->primary;
+ }
+ }
+#endif
+
+ for (j = 0; j < 6; j++) {
+ info->memBase[j] = 0;
+ info->ioBase[j] = 0;
+ if (PCINONSYSTEMCLASSES(baseclass, subclass)) {
+ info->size[j] =
+ pciGetBaseSize(pcrp->tag, j, TRUE, &info->validSize);
+ pcrp->minBasesize = info->validSize;
+ } else {
+ info->size[j] = pcrp->basesize[j];
+ info->validSize = pcrp->minBasesize;
+ }
+ info->type[j] = 0;
+ }
+
+ if (PCINONSYSTEMCLASSES(baseclass, subclass)) {
+ if (info->size[0] && IsBaseUnassigned(pcrp->pci_base0))
+ pcrp->pci_base0 = pciCheckForBrokenBase(pcrp->tag, 0);
+ if (info->size[1] && IsBaseUnassigned(pcrp->pci_base1))
+ pcrp->pci_base1 = pciCheckForBrokenBase(pcrp->tag, 1);
+ if (info->size[2] && IsBaseUnassigned(pcrp->pci_base2))
+ pcrp->pci_base2 = pciCheckForBrokenBase(pcrp->tag, 2);
+ if (info->size[3] && IsBaseUnassigned(pcrp->pci_base3))
+ pcrp->pci_base3 = pciCheckForBrokenBase(pcrp->tag, 3);
+ if (info->size[4] && IsBaseUnassigned(pcrp->pci_base4))
+ pcrp->pci_base4 = pciCheckForBrokenBase(pcrp->tag, 4);
+ if (info->size[5] && IsBaseUnassigned(pcrp->pci_base5))
+ pcrp->pci_base5 = pciCheckForBrokenBase(pcrp->tag, 5);
+ }
+
+ /*
+ * 64-bit base addresses are checked for and avoided.
+ * XXX Should deal with them on platforms that support them.
+ */
+ if (pcrp->pci_base0) {
+ if (pcrp->pci_base0 & PCI_MAP_IO) {
+ info->ioBase[0] = (memType)PCIGETIO(pcrp->pci_base0);
+ info->type[0] = pcrp->pci_base0 & PCI_MAP_IO_ATTR_MASK;
+ } else {
+ info->type[0] = pcrp->pci_base0 & PCI_MAP_MEMORY_ATTR_MASK;
+ info->memBase[0] = (memType)PCIGETMEMORY(pcrp->pci_base0);
+ if (PCI_MAP_IS64BITMEM(pcrp->pci_base0)) {
+ mem64 = TRUE;
+#if defined(LONG64) || defined(WORD64)
+ info->memBase[0] |=
+ (memType)PCIGETMEMORY64HIGH(pcrp->pci_base1) << 32;
+#else
+ if (pcrp->pci_base1)
+ info->memBase[0] = 0;
+#endif
+ }
+ }
+ }
+
+ if (pcrp->pci_base1 && !mem64) {
+ if (pcrp->pci_base1 & PCI_MAP_IO) {
+ info->ioBase[1] = (memType)PCIGETIO(pcrp->pci_base1);
+ info->type[1] = pcrp->pci_base1 & PCI_MAP_IO_ATTR_MASK;
+ } else {
+ info->type[1] = pcrp->pci_base1 & PCI_MAP_MEMORY_ATTR_MASK;
+ info->memBase[1] = (memType)PCIGETMEMORY(pcrp->pci_base1);
+ if (PCI_MAP_IS64BITMEM(pcrp->pci_base1)) {
+ mem64 = TRUE;
+#if defined(LONG64) || defined(WORD64)
+ info->memBase[1] |=
+ (memType)PCIGETMEMORY64HIGH(pcrp->pci_base2) << 32;
+#else
+ if (pcrp->pci_base2)
+ info->memBase[1] = 0;
+#endif
+ }
+ }
+ } else
+ mem64 = FALSE;
+
+ if (pcrp->pci_base2 && !mem64) {
+ if (pcrp->pci_base2 & PCI_MAP_IO) {
+ info->ioBase[2] = (memType)PCIGETIO(pcrp->pci_base2);
+ info->type[2] = pcrp->pci_base2 & PCI_MAP_IO_ATTR_MASK;
+ } else {
+ info->type[2] = pcrp->pci_base2 & PCI_MAP_MEMORY_ATTR_MASK;
+ info->memBase[2] = (memType)PCIGETMEMORY(pcrp->pci_base2);
+ if (PCI_MAP_IS64BITMEM(pcrp->pci_base2)) {
+ mem64 = TRUE;
+#if defined(LONG64) || defined(WORD64)
+ info->memBase[2] |=
+ (memType)PCIGETMEMORY64HIGH(pcrp->pci_base3) << 32;
+#else
+ if (pcrp->pci_base3)
+ info->memBase[2] = 0;
+#endif
+ }
+ }
+ } else
+ mem64 = FALSE;
+
+ if (pcrp->pci_base3 && !mem64) {
+ if (pcrp->pci_base3 & PCI_MAP_IO) {
+ info->ioBase[3] = (memType)PCIGETIO(pcrp->pci_base3);
+ info->type[3] = pcrp->pci_base3 & PCI_MAP_IO_ATTR_MASK;
+ } else {
+ info->type[3] = pcrp->pci_base3 & PCI_MAP_MEMORY_ATTR_MASK;
+ info->memBase[3] = (memType)PCIGETMEMORY(pcrp->pci_base3);
+ if (PCI_MAP_IS64BITMEM(pcrp->pci_base3)) {
+ mem64 = TRUE;
+#if defined(LONG64) || defined(WORD64)
+ info->memBase[3] |=
+ (memType)PCIGETMEMORY64HIGH(pcrp->pci_base4) << 32;
+#else
+ if (pcrp->pci_base4)
+ info->memBase[3] = 0;
+#endif
+ }
+ }
+ } else
+ mem64 = FALSE;
+
+ if (pcrp->pci_base4 && !mem64) {
+ if (pcrp->pci_base4 & PCI_MAP_IO) {
+ info->ioBase[4] = (memType)PCIGETIO(pcrp->pci_base4);
+ info->type[4] = pcrp->pci_base4 & PCI_MAP_IO_ATTR_MASK;
+ } else {
+ info->type[4] = pcrp->pci_base4 & PCI_MAP_MEMORY_ATTR_MASK;
+ info->memBase[4] = (memType)PCIGETMEMORY(pcrp->pci_base4);
+ if (PCI_MAP_IS64BITMEM(pcrp->pci_base4)) {
+ mem64 = TRUE;
+#if defined(LONG64) || defined(WORD64)
+ info->memBase[4] |=
+ (memType)PCIGETMEMORY64HIGH(pcrp->pci_base5) << 32;
+#else
+ if (pcrp->pci_base5)
+ info->memBase[4] = 0;
+#endif
+ }
+ }
+ } else
+ mem64 = FALSE;
+
+ if (pcrp->pci_base5 && !mem64) {
+ if (pcrp->pci_base5 & PCI_MAP_IO) {
+ info->ioBase[5] = (memType)PCIGETIO(pcrp->pci_base5);
+ info->type[5] = pcrp->pci_base5 & PCI_MAP_IO_ATTR_MASK;
+ } else {
+ info->type[5] = pcrp->pci_base5 & PCI_MAP_MEMORY_ATTR_MASK;
+ info->memBase[5] = (memType)PCIGETMEMORY(pcrp->pci_base5);
+ }
+ } else
+ mem64 = FALSE;
+ info->listed_class = pcrp->listed_class;
+ }
+ i++;
+ }
+
+ /* If we haven't found a primary device try a different heuristic */
+ if (primaryBus.type == BUS_NONE && num) {
+ for (i = 0; i < num; i++) {
+ info = xf86PciVideoInfo[i];
+ pcrp = info->thisCard;
+
+ if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) &&
+ (num == 1 ||
+ ((info->class == PCI_CLASS_DISPLAY) &&
+ (info->subclass == PCI_SUBCLASS_DISPLAY_MISC)))) {
+ if (primaryBus.type == BUS_NONE) {
+ primaryBus.type = BUS_PCI;
+ primaryBus.id.pci.bus = pcrp->busnum;
+ primaryBus.id.pci.device = pcrp->devnum;
+ primaryBus.id.pci.func = pcrp->funcnum;
+ } else {
+ xf86Msg(X_NOTICE,
+ "More than one possible primary device found\n");
+ primaryBus.type ^= (BusType)(-1);
+ }
+ }
+ }
+ }
+
+ /* Print a summary of the video devices found */
+ for (k = 0; k < num; k++) {
+ const char *vendorname = NULL, *chipname = NULL;
+ const char *prim = " ";
+ char busnum[8];
+ Bool memdone = FALSE, iodone = FALSE;
+
+ i = 0;
+ info = xf86PciVideoInfo[k];
+ xf86FormatPciBusNumber(info->bus, busnum);
+ xf86FindPciNamesByDevice(info->vendor, info->chipType,
+ NOVENDOR, NOSUBSYS,
+ &vendorname, &chipname, NULL, NULL);
+ if ((!vendorname || !chipname) &&
+ !PCIALWAYSPRINTCLASSES(info->class, info->subclass))
+ continue;
+ if (xf86IsPrimaryPci(info))
+ prim = "*";
+
+ xf86Msg(X_PROBED, "PCI:%s(%s:%d:%d) ", prim, busnum, info->device,
+ info->func);
+ if (vendorname)
+ xf86ErrorF("%s ", vendorname);
+ else
+ xf86ErrorF("unknown vendor (0x%04x) ", info->vendor);
+ if (chipname)
+ xf86ErrorF("%s ", chipname);
+ else
+ xf86ErrorF("unknown chipset (0x%04x) ", info->chipType);
+ xf86ErrorF("rev %d", info->chipRev);
+ for (i = 0; i < 6; i++) {
+ if (info->memBase[i] &&
+ (info->memBase[i] < (memType)(-1 << info->size[i]))) {
+ if (!memdone) {
+ xf86ErrorF(", Mem @ ");
+ memdone = TRUE;
+ } else
+ xf86ErrorF(", ");
+ xf86ErrorF("0x%08x/%d", info->memBase[i], info->size[i]);
+ }
+ }
+ for (i = 0; i < 6; i++) {
+ if (info->ioBase[i] &&
+ (info->ioBase[i] < (memType)(-1 << info->size[i]))) {
+ if (!iodone) {
+ xf86ErrorF(", I/O @ ");
+ iodone = TRUE;
+ } else
+ xf86ErrorF(", ");
+ xf86ErrorF("0x%04x/%d", info->ioBase[i], info->size[i]);
+ }
+ }
+ if (info->biosBase &&
+ (info->biosBase < (memType)(-1 << info->biosSize)))
+ xf86ErrorF(", BIOS @ 0x%08x/%d", info->biosBase, info->biosSize);
+ xf86ErrorF("\n");
+ }
+}
+
+/*
+ * fixPciSizeInfo() -- fix pci size info by testing it destructively
+ * (if not already done), fix pciVideoInfo and entry in the resource
+ * list.
+ */
+/*
+ * Note: once we have OS support to read the sizes GetBaseSize() will
+ * have to be wrapped by the OS layer. fixPciSizeInfo() should also
+ * be wrapped by the OS layer to do nothing if the size is always
+ * returned correctly by GetBaseSize(). It should however set validate
+ * in pciVideoRec if validation is required. ValidatePci() also needs
+ * to be wrapped by the OS layer. This may do nothing if the OS has
+ * already taken care of validation. fixPciResource() may be moved to
+ * OS layer with minimal changes. Once the wrapping layer is in place
+ * the common level and drivers should not reference these functions
+ * directly but thru the OS layer.
+ */
+
+static void
+fixPciSizeInfo(int entityIndex)
+{
+ pciVideoPtr pvp;
+ resPtr pAcc;
+ PCITAG tag;
+ int j;
+
+ if (! (pvp = xf86GetPciInfoForEntity(entityIndex))) return;
+ if (pvp->validSize) return;
+
+ tag = pciTag(pvp->bus,pvp->device,pvp->func);
+
+ for (j = 0; j < 6; j++) {
+ pAcc = Acc;
+ if (pvp->memBase[j])
+ while (pAcc) {
+ if (((pAcc->res_type & (ResPhysMask | ResBlock))
+ == (ResMem | ResBlock))
+ && (pAcc->block_begin == B2M(TAG(pvp),pvp->memBase[j]))
+ && (pAcc->block_end == B2M(TAG(pvp),pvp->memBase[j]
+ + SIZE(pvp->size[j])))) break;
+ pAcc = pAcc->next;
+ }
+ else if (pvp->ioBase[j])
+ while (pAcc) {
+ if (((pAcc->res_type & (ResPhysMask | ResBlock)) ==
+ (ResIo | ResBlock))
+ && (pAcc->block_begin == B2I(TAG(pvp),pvp->ioBase[j]))
+ && (pAcc->block_end == B2I(TAG(pvp),pvp->ioBase[j]
+ + SIZE(pvp->size[j])))) break;
+ pAcc = pAcc->next;
+ }
+ else continue;
+ pvp->size[j] = pciGetBaseSize(tag, j, TRUE, &pvp->validSize);
+ if (pAcc) {
+ pAcc->block_end = pvp->memBase[j] ?
+ B2M(TAG(pvp),pvp->memBase[j] + SIZE(pvp->size[j]))
+ : B2I(TAG(pvp),pvp->ioBase[j] + SIZE(pvp->size[j]));
+ pAcc->res_type &= ~ResEstimated;
+ pAcc->res_type |= ResBios;
+ }
+ }
+ if (pvp->biosBase) {
+ pAcc = Acc;
+ while (pAcc) {
+ if (((pAcc->res_type & (ResPhysMask | ResBlock)) ==
+ (ResMem | ResBlock))
+ && (pAcc->block_begin == B2M(TAG(pvp),pvp->biosBase))
+ && (pAcc->block_end == B2M(TAG(pvp),pvp->biosBase
+ + SIZE(pvp->biosSize)))) break;
+ pAcc = pAcc->next;
+ }
+ pvp->biosSize = pciGetBaseSize(tag, 6, TRUE, &pvp->validSize);
+ if (pAcc) {
+ pAcc->block_end = B2M(TAG(pvp),pvp->biosBase+SIZE(pvp->biosSize));
+ pAcc->res_type &= ~ResEstimated;
+ pAcc->res_type |= ResBios;
+ }
+ }
+}
+
+/*
+ * IO enable/disable related routines for PCI
+ */
+#define pArg ((pciArg*)arg)
+#define SETBITS PCI_CMD_IO_ENABLE
+static void
+pciIoAccessEnable(void* arg)
+{
+#ifdef DEBUG
+ ErrorF("pciIoAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
+#endif
+ pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
+ (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+}
+
+static void
+pciIoAccessDisable(void* arg)
+{
+#ifdef DEBUG
+ ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
+#endif
+ pArg->ctrl &= ~SETBITS;
+ (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+}
+
+#undef SETBITS
+#define SETBITS (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE)
+static void
+pciIo_MemAccessEnable(void* arg)
+{
+#ifdef DEBUG
+ ErrorF("pciIo_MemAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
+#endif
+ pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
+ (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+}
+
+static void
+pciIo_MemAccessDisable(void* arg)
+{
+#ifdef DEBUG
+ ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
+#endif
+ pArg->ctrl &= ~SETBITS;
+ (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+}
+
+#undef SETBITS
+#define SETBITS (PCI_CMD_MEM_ENABLE)
+static void
+pciMemAccessEnable(void* arg)
+{
+#ifdef DEBUG
+ ErrorF("pciMemAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
+#endif
+ pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
+ (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+}
+
+static void
+pciMemAccessDisable(void* arg)
+{
+#ifdef DEBUG
+ ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
+#endif
+ pArg->ctrl &= ~SETBITS;
+ (*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
+}
+#undef SETBITS
+#undef pArg
+
+
+/* move to OS layer */
+#define PCI_PCI_BRDG_CTRL_BASE (PCI_PCI_BRIDGE_CONTROL_REG & 0xFC)
+#define SHIFT_BITS ((PCI_PCI_BRIDGE_CONTROL_REG & 0x3) << 3)
+#define SETBITS (CARD32)((PCI_PCI_BRIDGE_VGA_EN) << SHIFT_BITS)
+static void
+pciBusAccessEnable(BusAccPtr ptr)
+{
+#ifdef DEBUG
+ ErrorF("pciBusAccessEnable: bus=%d\n", ptr->busdep.pci.bus);
+#endif
+ (*ptr->busdep.pci.func)(ptr->busdep.pci.acc, PCI_PCI_BRDG_CTRL_BASE,
+ SETBITS, SETBITS);
+}
+
+/* move to OS layer */
+static void
+pciBusAccessDisable(BusAccPtr ptr)
+{
+#ifdef DEBUG
+ ErrorF("pciBusAccessDisable: bus=%d\n", ptr->busdep.pci.bus);
+#endif
+ (*ptr->busdep.pci.func)(ptr->busdep.pci.acc, PCI_PCI_BRDG_CTRL_BASE,
+ SETBITS, 0);
+}
+#undef SETBITS
+#undef SHIFT_BITS
+
+/* move to OS layer */
+static void
+pciDrvBusAccessEnable(BusAccPtr ptr)
+{
+ int bus = ptr->busdep.pci.bus;
+
+#ifdef DEBUG
+ ErrorF("pciDrvBusAccessEnable: bus=%d\n", bus);
+#endif
+ (*pciBusInfo[bus]->funcs->pciControlBridge)(bus,
+ PCI_PCI_BRIDGE_VGA_EN,
+ PCI_PCI_BRIDGE_VGA_EN);
+}
+
+/* move to OS layer */
+static void
+pciDrvBusAccessDisable(BusAccPtr ptr)
+{
+ int bus = ptr->busdep.pci.bus;
+
+#ifdef DEBUG
+ ErrorF("pciDrvBusAccessDisable: bus=%d\n", bus);
+#endif
+ (*pciBusInfo[bus]->funcs->pciControlBridge)(bus,
+ PCI_PCI_BRIDGE_VGA_EN, 0);
+}
+
+
+static void
+pciSetBusAccess(BusAccPtr ptr)
+{
+#ifdef DEBUG
+ ErrorF("pciSetBusAccess: route VGA to bus %d\n", ptr->busdep.pci.bus);
+#endif
+
+ if (!ptr->primary && !ptr->current)
+ return;
+
+ if (ptr->current && ptr->current->disable_f)
+ (*ptr->current->disable_f)(ptr->current);
+ ptr->current = NULL;
+
+ /* walk down */
+ while (ptr->primary) { /* No enable for root bus */
+ if (ptr != ptr->primary->current) {
+ if (ptr->primary->current && ptr->primary->current->disable_f)
+ (*ptr->primary->current->disable_f)(ptr->primary->current);
+ if (ptr->enable_f)
+ (*ptr->enable_f)(ptr);
+ ptr->primary->current = ptr;
+ }
+ ptr = ptr->primary;
+ }
+}
+
+/* move to OS layer */
+static void
+savePciState(PCITAG tag, pciSavePtr ptr)
+{
+ int i;
+
+ ptr->command = pciReadLong(tag, PCI_CMD_STAT_REG);
+ for (i=0; i < 6; i++)
+ ptr->base[i] = pciReadLong(tag, PCI_CMD_BASE_REG + i*4);
+ ptr->biosBase = pciReadLong(tag, PCI_CMD_BIOS_REG);
+}
+
+/* move to OS layer */
+static void
+restorePciState(PCITAG tag, pciSavePtr ptr)
+{
+ int i;
+
+ /* disable card before setting anything */
+ pciSetBitsLong(tag, PCI_CMD_STAT_REG,
+ PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE , 0);
+ pciWriteLong(tag,PCI_CMD_BIOS_REG, ptr->biosBase);
+ for (i=0; i<6; i++)
+ pciWriteLong(tag, PCI_CMD_BASE_REG + i*4, ptr->base[i]);
+ pciWriteLong(tag, PCI_CMD_STAT_REG, ptr->command);
+}
+
+/* move to OS layer */
+static void
+savePciBusState(BusAccPtr ptr)
+{
+ ptr->busdep.pci.save.control =
+ pciReadWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG) &
+ ~PCI_PCI_BRIDGE_SECONDARY_RESET;
+ /* Allow master aborts to complete normally on non-root buses */
+ if (ptr->busdep.pci.save.control & PCI_PCI_BRIDGE_MASTER_ABORT_EN)
+ pciWriteWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG,
+ ptr->busdep.pci.save.control
+ & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
+}
+
+/* move to OS layer */
+static void
+restorePciBusState(BusAccPtr ptr)
+{
+ pciWriteWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG,
+ ptr->busdep.pci.save.control);
+}
+
+/* move to OS layer */
+static void
+savePciDrvBusState(BusAccPtr ptr)
+{
+ int bus = ptr->busdep.pci.bus;
+
+ ptr->busdep.pci.save.control =
+ (*pciBusInfo[bus]->funcs->pciControlBridge)(bus, 0, 0);
+ /* Allow master aborts to complete normally on this bus */
+ (*pciBusInfo[bus]->funcs->pciControlBridge)(bus,
+ PCI_PCI_BRIDGE_MASTER_ABORT_EN,
+ 0);
+}
+
+/* move to OS layer */
+static void
+restorePciDrvBusState(BusAccPtr ptr)
+{
+ int bus = ptr->busdep.pci.bus;
+
+ (*pciBusInfo[bus]->funcs->pciControlBridge)(bus, (CARD16)(-1),
+ ptr->busdep.pci.save.control);
+}
+
+
+static void
+disablePciBios(PCITAG tag)
+{
+ pciSetBitsLong(tag, PCI_CMD_BIOS_REG, PCI_CMD_BIOS_ENABLE, 0);
+}
+
+/* ????? */
+static void
+correctPciSize(memType base, memType oldsize, memType newsize,
+ unsigned long type)
+{
+ pciConfigPtr pcrp, *pcrpp;
+ pciVideoPtr pvp, *pvpp;
+ CARD32 *basep;
+ int i;
+ int old_bits = 0, new_bits = 0;
+
+ if (oldsize + 1) while (oldsize & 1) {
+ old_bits ++;
+ oldsize >>= 1;
+ }
+ if (newsize + 1) while (newsize & 1) {
+ new_bits ++;
+ newsize >>= 1;
+ }
+
+ for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) {
+
+ /* Only process devices with type 0 headers */
+ if ((pcrp->pci_header_type & 0x7f) != 0)
+ continue;
+
+ basep = &pcrp->pci_base0;
+ for (i = 0; i < 6; i++) {
+ if (basep[i] && (pcrp->basesize[i] == old_bits)) {
+ if ((((type & ResPhysMask) == ResIo) &&
+ PCI_MAP_IS_IO(basep[i]) &&
+ B2I(pcrp->tag,PCIGETIO(basep[i]) == base)) ||
+ (((type & ResPhysMask) == ResMem) &&
+ PCI_MAP_IS_MEM(basep[i]) &&
+ (((!PCI_MAP_IS64BITMEM(basep[i])) &&
+ (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base))
+#if defined(LONG64) || defined(WORD64)
+ ||
+ (B2M(pcrp->tag,PCIGETMEMORY64(basep[i])) == base)
+#endif
+ ))) {
+ pcrp->basesize[i] = new_bits;
+ break; /* to next device */
+ }
+ }
+ }
+ }
+
+ if (xf86PciVideoInfo) {
+ for (pvpp = xf86PciVideoInfo, pvp = *pvpp; pvp; pvp = *(++pvpp)) {
+
+ for (i = 0; i < 6; i++) {
+ if (pvp->size[i] == old_bits) {
+ if ((((type & ResPhysMask) == ResIo) && pvp->ioBase[i]
+ && (B2I(TAG(pvp),pvp->ioBase[i]) == base)) ||
+ (((type & ResPhysMask) == ResMem) && pvp->memBase[i]
+ && (B2M(TAG(pvp),pvp->memBase[i]) == base))) {
+ pvp->size[i] = new_bits;
+ break; /* to next device */
+ }
+ }
+ }
+ }
+ }
+}
+
+/* ????? */
+static void
+removeOverlapsWithBridges(int busIndex, resPtr target)
+{
+ PciBusPtr pbp;
+ resPtr tmp,bridgeRes = NULL;
+ resRange range = target->val;
+
+ if (!ResCanOverlap(&target->val))
+ return;
+
+ for (pbp=xf86PciBus; pbp; pbp = pbp->next) {
+ if (pbp->primary == busIndex) {
+ tmp = xf86DupResList(pbp->preferred_io);
+ bridgeRes = xf86JoinResLists(tmp,bridgeRes);
+ tmp = xf86DupResList(pbp->preferred_mem);
+ bridgeRes = xf86JoinResLists(tmp,bridgeRes);
+ tmp = xf86DupResList(pbp->preferred_pmem);
+ bridgeRes = xf86JoinResLists(tmp,bridgeRes);
+ }
+ }
+
+ RemoveOverlaps(target, bridgeRes, TRUE, TRUE);
+ if (range.rEnd > target->block_end) {
+ correctPciSize(range.rBegin, range.rEnd - range.rBegin,
+ target->block_end - target->block_begin,
+ target->res_type);
+ xf86MsgVerb(X_INFO, 3,
+ "PCI %s resource overlap reduced 0x%08x from 0x%08x to 0x%08x\n",
+ ((target->res_type & ResPhysMask) == ResMem) ? "Memory" : "I/O",
+ range.rBegin, range.rEnd, target->block_end);
+ }
+ xf86FreeResList(bridgeRes);
+}
+
+/* ????? */
+static void
+xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
+{
+ pciConfigPtr pcrp, *pcrpp;
+ pciVideoPtr pvp, *pvpp;
+ CARD32 *basep;
+ int i;
+ resPtr pRes, tmp;
+ resRange range;
+ long resMisc;
+
+ if (activeRes)
+ *activeRes = NULL;
+ if (inactiveRes)
+ *inactiveRes = NULL;
+
+ if (!activeRes || !inactiveRes || !xf86PciInfo)
+ return;
+
+ if (xf86PciVideoInfo)
+ for (pvpp = xf86PciVideoInfo, pvp = *pvpp; pvp; pvp = *(++pvpp)) {
+ resPtr *res;
+
+ if (PCINONSYSTEMCLASSES(pvp->class, pvp->subclass))
+ resMisc = ResBios;
+ else
+ resMisc = 0;
+
+ if (((pciConfigPtr)pvp->thisCard)->pci_command
+ & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE))
+ res = activeRes;
+ else
+ res = inactiveRes;
+
+ if (!pvp->validSize)
+ resMisc |= ResEstimated;
+
+ for (i = 0; i < 6; i++) {
+ if (pvp->ioBase[i] &&
+ (pvp->ioBase[i] < (memType)(-1 << pvp->size[i]))) {
+ PV_I_RANGE(range,pvp,i,ResExcIoBlock | resMisc);
+ tmp = xf86AddResToList(NULL, &range, -1);
+ removeOverlapsWithBridges(pvp->bus,tmp);
+ *res = xf86JoinResLists(tmp,*res);
+ } else if (pvp->memBase[i] &&
+ (pvp->memBase[i] < (memType)(-1 << pvp->size[i]))) {
+ PV_M_RANGE(range, pvp,i, ResExcMemBlock | resMisc);
+ tmp = xf86AddResToList(NULL, &range, -1);
+ removeOverlapsWithBridges(pvp->bus,tmp);
+ *res = xf86JoinResLists(tmp,*res);
+ }
+ }
+ /* FIXME!!!: Don't use BIOS resources for overlap
+ * checking but reserve them!
+ */
+ if (pvp->biosBase &&
+ (pvp->biosBase < (memType)(-1 << pvp->biosSize))) {
+ PV_B_RANGE(range, pvp, ResExcMemBlock | resMisc);
+ tmp = xf86AddResToList(NULL, &range, -1);
+ removeOverlapsWithBridges(pvp->bus,tmp);
+ *res = xf86JoinResLists(tmp,*res);
+ }
+ }
+
+ for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) {
+ resPtr *res;
+ CARD8 baseclass, subclass;
+
+ if (pcrp->listed_class & 0x0ffff) {
+ baseclass = pcrp->listed_class >> 8;
+ subclass = pcrp->listed_class;
+ } else {
+ baseclass = pcrp->pci_base_class;
+ subclass = pcrp->pci_sub_class;
+ }
+
+ if (PCIINFOCLASSES(baseclass, subclass))
+ continue;
+
+ /* Only process devices with type 0 headers */
+ if ((pcrp->pci_header_type & 0x7f) != 0)
+ continue;
+
+ if (!pcrp->minBasesize)
+ resMisc = ResEstimated;
+ else
+ resMisc = 0;
+
+ /*
+ * Allow resources allocated to host bridges to overlap. Perhaps, this
+ * needs to be specific to AGP-capable chipsets. AGP "memory"
+ * sometimes gets allocated within the range routed to the AGP bus.
+ */
+ if ((baseclass == PCI_CLASS_BRIDGE) &&
+ (subclass == PCI_SUBCLASS_BRIDGE_HOST))
+ resMisc |= ResOverlap;
+
+ if ((pcrp->pci_command & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE)))
+ res = activeRes;
+ else
+ res = inactiveRes;
+
+ basep = &pcrp->pci_base0;
+ for (i = 0; i < 6; i++) {
+ if (basep[i]) {
+ if (PCI_MAP_IS_IO(basep[i]))
+ P_I_RANGE(range,pcrp->tag,PCIGETIO(basep[i]),
+ pcrp->basesize[i], ResExcIoBlock | resMisc)
+ else if (!PCI_MAP_IS64BITMEM(basep[i]))
+ P_M_RANGE(range,pcrp->tag,PCIGETMEMORY(basep[i]),
+ pcrp->basesize[i], ResExcMemBlock | resMisc)
+ else {
+ i++;
+#if defined(LONG64) || defined(WORD64)
+ P_M_RANGE(range,pcrp->tag,PCIGETMEMORY64(basep[i-1]),
+ pcrp->basesize[i-1], ResExcMemBlock | resMisc)
+#else
+ continue;
+#endif
+ }
+ if (range.rBegin) { /* catch cases where PCI base is unset */
+ tmp = xf86AddResToList(NULL, &range, -1);
+ removeOverlapsWithBridges(pcrp->busnum,tmp);
+ *res = xf86JoinResLists(tmp,*res);
+ }
+ }
+ }
+ /* Ignore disabled non-video ROMs */
+ if ((res == activeRes) &&
+ (pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) {
+ P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom),
+ pcrp->basesize[6], ResExcMemBlock | resMisc);
+ if (range.rBegin) {
+ tmp = xf86AddResToList(NULL, &range, -1);
+ removeOverlapsWithBridges(pcrp->busnum,tmp);
+ *res = xf86JoinResLists(tmp,*res);
+ }
+ }
+ }
+
+ if (*activeRes) {
+ xf86MsgVerb(X_INFO, 3, "Active PCI resource ranges:\n");
+ xf86PrintResList(3, *activeRes);
+ }
+ if (*inactiveRes) {
+ xf86MsgVerb(X_INFO, 3, "Inactive PCI resource ranges:\n");
+ xf86PrintResList(3, *inactiveRes);
+ }
+
+ /*
+ * Adjust ranges based on the assumption that there are no real
+ * overlaps in the PCI base allocations. This assumption should be
+ * reasonable in most cases. It may be possible to refine the
+ * approximated PCI base sizes by considering bus mapping information
+ * from PCI-PCI bridges.
+ */
+
+ if (*activeRes) {
+ /* Check for overlaps */
+ for (pRes = *activeRes; pRes; pRes = pRes->next) {
+ if (ResCanOverlap(&pRes->val)) {
+ range = pRes->val;
+
+ RemoveOverlaps(pRes, *activeRes, TRUE, TRUE);
+ RemoveOverlaps(pRes, *inactiveRes, TRUE,
+ (xf86Info.estimateSizesAggressively > 0));
+
+ if (range.rEnd > pRes->block_end) {
+ correctPciSize(range.rBegin, range.rEnd - range.rBegin,
+ pRes->block_end - pRes->block_begin,
+ pRes->res_type);
+ xf86MsgVerb(X_INFO, 3,
+ "PCI %s resource overlap reduced 0x%08x"
+ " from 0x%08x to 0x%08x\n",
+ ((pRes->res_type & ResPhysMask) == ResMem) ?
+ "Memory" : "I/O",
+ range.rBegin, range.rEnd, pRes->block_end);
+ }
+ }
+ }
+ xf86MsgVerb(X_INFO, 3,
+ "Active PCI resource ranges after removing overlaps:\n");
+ xf86PrintResList(3, *activeRes);
+ }
+
+ if (*inactiveRes) {
+ /* Check for overlaps */
+ for (pRes = *inactiveRes; pRes; pRes = pRes->next) {
+ if (ResCanOverlap(&pRes->val)) {
+ range = pRes->val;
+
+ RemoveOverlaps(pRes, *activeRes, TRUE,
+ (xf86Info.estimateSizesAggressively > 1));
+ RemoveOverlaps(pRes, *inactiveRes, TRUE,
+ (xf86Info.estimateSizesAggressively > 1));
+
+ if (range.rEnd > pRes->block_end) {
+ correctPciSize(range.rBegin, range.rEnd - range.rBegin,
+ pRes->block_end - pRes->block_begin,
+ pRes->res_type);
+ xf86MsgVerb(X_INFO, 3,
+ "PCI %s resource overlap reduced 0x%08x"
+ " from 0x%08x to 0x%08x\n",
+ ((pRes->res_type & ResPhysMask) == ResMem) ?
+ "Memory" : "I/O",
+ range.rBegin, range.rEnd, pRes->block_end);
+ }
+
+ }
+ }
+ xf86MsgVerb(X_INFO, 3,
+ "Inactive PCI resource ranges after removing overlaps:\n");
+ xf86PrintResList(3, *inactiveRes);
+ }
+}
+
+resPtr
+ResourceBrokerInitPci(resPtr *osRes)
+{
+ resPtr activeRes, inactiveRes;
+ resPtr tmp;
+
+ /* Get bus-specific system resources (PCI) */
+ xf86GetPciRes(&activeRes, &inactiveRes);
+
+ /*
+ * Adjust OS-reported resource ranges based on the assumption that there
+ * are no overlaps with the PCI base allocations. This should be a good
+ * assumption because writes to PCI address space won't be routed directly
+ * to host memory.
+ */
+
+ for (tmp = *osRes; tmp; tmp = tmp->next)
+ RemoveOverlaps(tmp, activeRes, FALSE, TRUE);
+
+ xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges after removing"
+ " overlaps with PCI:\n");
+ xf86PrintResList(3, *osRes);
+
+ pciAvoidRes = xf86AddRangesToList(pciAvoidRes,PciAvoid,-1);
+ for (tmp = pciAvoidRes; tmp; tmp = tmp->next)
+ RemoveOverlaps(tmp, activeRes, FALSE, TRUE);
+ tmp = xf86DupResList(*osRes);
+ pciAvoidRes = xf86JoinResLists(pciAvoidRes,tmp);
+
+ return (xf86JoinResLists(activeRes,inactiveRes));
+}
+
+
+/*
+ * PCI Resource modification
+ */
+static Bool
+fixPciResource(int prt, memType alignment, pciVideoPtr pvp, unsigned long type)
+{
+ int res_n;
+ memType *p_base;
+ int *p_size;
+ unsigned char p_type;
+ resPtr AccTmp = NULL;
+ resPtr orgAcc = NULL;
+ resPtr *pAcc = &AccTmp;
+ resPtr avoid = NULL;
+ resRange range;
+ resPtr resSize = NULL;
+ resPtr w_tmp, w = NULL, w_2nd = NULL;
+ PCITAG tag;
+ PciBusPtr pbp = xf86PciBus;
+ pciConfigPtr pcp;
+ resPtr tmp;
+
+ if (!pvp) return FALSE;
+ tag = pciTag(pvp->bus,pvp->device,pvp->func);
+ pcp = pvp->thisCard;
+
+ type &= ResAccMask;
+ if (!type) type = ResShared;
+ if (prt < 6) {
+ if (pvp->memBase[prt]) {
+ type |= ResMem;
+ res_n = prt;
+ p_base = &(pvp->memBase[res_n]);
+ p_size = &(pvp->size[res_n]);
+ p_type = pvp->type[res_n];
+ if (!PCI_MAP_IS64BITMEM(pvp->type[res_n])) {
+ PCI_M_RANGE(range,tag,0,0xffffffff,ResExcMemBlock);
+ resSize = xf86AddResToList(resSize,&range,-1);
+ }
+ } else if (pvp->ioBase[prt]){
+ type |= ResIo;
+ res_n = prt;
+ p_base = &(pvp->ioBase[res_n]);
+ p_size = &(pvp->size[res_n]);
+ p_type = pvp->type[res_n];
+ PCI_I_RANGE(range, tag, 0, 0xffffffff, ResExcIoBlock);
+ resSize = xf86AddResToList(resSize, &range, -1);
+ } else return FALSE;
+ } else if (prt == 6) {
+ type |= ResMem;
+ res_n = 0xff; /* special flag for bios rom */
+ p_base = &(pvp->biosBase);
+ p_size = &(pvp->biosSize);
+ /* XXX This should also include the PCI_MAP_MEMORY_TYPE_MASK part */
+ p_type = 0;
+ PCI_M_RANGE(range,tag,0,0xffffffff,ResExcMemBlock);
+ resSize = xf86AddResToList(resSize,&range,-1);
+ } else return FALSE;
+
+ if (! *p_base) return FALSE;
+
+ type |= (range.type & ResDomain) | ResBlock;
+
+ /* setup avoid: PciAvoid is bus range: convert later */
+ avoid = xf86DupResList(pciAvoidRes);
+
+ while (pbp) {
+ if (pbp->secondary == pvp->bus) {
+ if ((type & ResPhysMask) == ResMem) {
+ if (((p_type & PCI_MAP_MEMORY_CACHABLE)
+#if 0 /*EE*/
+ || (res_n == 0xff)/* bios should also be prefetchable */
+#endif
+ )) {
+ if (pbp->preferred_pmem)
+ w = xf86FindIntersectOfLists(pbp->preferred_pmem,
+ ResRange);
+ else if (pbp->pmem)
+ w = xf86FindIntersectOfLists(pbp->pmem,ResRange);
+
+ if (pbp->preferred_mem)
+ w_2nd = xf86FindIntersectOfLists(pbp->preferred_mem,
+ ResRange);
+ else if (pbp->mem)
+ w_2nd = xf86FindIntersectOfLists(pbp->mem,
+ ResRange);
+ } else {
+ if (pbp->preferred_mem)
+ w = xf86FindIntersectOfLists(pbp->preferred_mem,
+ ResRange);
+ else if (pbp->mem)
+ w = xf86FindIntersectOfLists(pbp->mem,ResRange);
+ }
+ } else {
+ if (pbp->preferred_io)
+ w = xf86FindIntersectOfLists(pbp->preferred_io,ResRange);
+ if (pbp->io)
+ w = xf86FindIntersectOfLists(pbp->io,ResRange);
+ }
+ } else if (pbp->primary == pvp->bus) {
+ if ((type & ResPhysMask) == ResMem) {
+ tmp = xf86DupResList(pbp->preferred_pmem);
+ avoid = xf86JoinResLists(avoid, tmp);
+ tmp = xf86DupResList(pbp->preferred_mem);
+ avoid = xf86JoinResLists(avoid, tmp);
+ } else {
+ tmp = xf86DupResList(pbp->preferred_io);
+ avoid = xf86JoinResLists(avoid, tmp);
+ }
+ }
+ pbp = pbp->next;
+ }
+
+ /* convert bus based entries in avoid list to host base */
+ pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
+
+ if (!w)
+ w = xf86DupResList(ResRange);
+ xf86MsgVerb(X_INFO, 3, "window:\n");
+ xf86PrintResList(3, w);
+ xf86MsgVerb(X_INFO, 3, "resSize:\n");
+ xf86PrintResList(3, resSize);
+
+ if (resSize) {
+ w_tmp = w;
+ w = xf86FindIntersectOfLists(w,resSize);
+ xf86FreeResList(w_tmp);
+ if (w_2nd) {
+ w_tmp = w_2nd;
+ w_2nd = xf86FindIntersectOfLists(w_2nd,resSize);
+ xf86FreeResList(w_tmp);
+ }
+ xf86FreeResList(resSize);
+ }
+ xf86MsgVerb(X_INFO, 3, "window fixed:\n");
+ xf86PrintResList(3, w);
+
+ if (!alignment)
+ alignment = (1 << (*p_size)) - 1;
+
+ /* Access list holds bios resources -- remove this one */
+#ifdef NOTYET
+ AccTmp = xf86DupResList(Acc);
+ while ((*pAcc)) {
+ if ((((*pAcc)->res_type & (type & ~ResAccMask))
+ == (type & ~ResAccMask))
+ && ((*pAcc)->block_begin == (B2H(tag,(*p_base),type)))
+ && ((*pAcc)->block_end == (B2H(tag,
+ (*p_base)+SIZE(*p_size),type)))) {
+ resPtr acc_tmp = (*pAcc)->next;
+ xfree((*pAcc));
+ (*pAcc) = acc_tmp;
+ break;
+ } else
+ pAcc = &((*pAcc)->next);
+ }
+ /* check if we really need to fix anything */
+ P_X_RANGE(range,tag,(*p_base),(*p_base) + SIZE((*p_size)),type);
+ if (!ChkConflict(&range,avoid,SETUP)
+ && !ChkConflict(&range,AccTmp,SETUP)
+ && ((B2H(tag,(*p_base),type) & PCI_SIZE(type,tag,alignment)
+ == range->block_begin)
+ && ((xf86IsSubsetOf(range,w)
+ || (w_2nd && xf86IsSubsetOf(range,w_2n))))) {
+#ifdef DEBUG
+ ErrorF("nothing to fix\n");
+#endif
+ xf86FreeResList(AccTmp);
+ xf86FreeResList(w);
+ xf86FreeResList(w_2nd);
+ xf86FreeResList(avoid);
+ return TRUE;
+ }
+#ifdef DEBUG
+ ErrorF("removing old resource\n");
+#endif
+ orgAcc = Acc;
+ Acc = AccTmp;
+#else
+ orgAcc = xf86DupResList(Acc);
+ pAcc = &Acc;
+ while (*pAcc) {
+ if ((((*pAcc)->res_type & (ResTypeMask|ResExtMask)) ==
+ (type & ~ResAccMask))
+ && ((*pAcc)->block_begin == B2H(tag,(*p_base),type))
+ && ((*pAcc)->block_end == B2H(tag,(*p_base) + SIZE(*p_size),
+ type))) {
+#ifdef DEBUG
+ ErrorF("removing old resource\n");
+#endif
+ tmp = *pAcc;
+ *pAcc = (*pAcc)->next;
+ tmp->next = NULL;
+ xf86FreeResList(tmp);
+ break;
+ } else
+ pAcc = &((*pAcc)->next);
+ }
+#endif
+
+#ifdef DEBUG
+ ErrorF("base: 0x%lx alignment: 0x%lx host alignment: 0x%lx size[bit]: 0x%x\n",
+ (*p_base),alignment,PCI_SIZE(type,tag,alignment),(*p_size));
+ xf86MsgVerb(X_INFO, 3, "window:\n");
+ xf86PrintResList(3, w);
+ if (w_2nd)
+ xf86MsgVerb(X_INFO, 3, "2nd window:\n");
+ xf86PrintResList(3, w_2nd);
+ xf86ErrorFVerb(3,"avoid:\n");
+ xf86PrintResList(3,avoid);
+#endif
+ w_tmp = w;
+ while (w) {
+ if ((type & ResTypeMask) == (w->res_type & ResTypeMask)) {
+#ifdef DEBUG
+ ErrorF("block_begin: 0x%lx block_end: 0x%lx\n",w->block_begin,
+ w->block_end);
+#endif
+ range = xf86GetBlock(type,PCI_SIZE(type,tag,alignment + 1),
+ w->block_begin, w->block_end,
+ PCI_SIZE(type,tag,alignment),avoid);
+ if (range.type != ResEnd)
+ break;
+ }
+ w = w->next;
+ }
+ xf86FreeResList(w_tmp);
+ /* if unsuccessful and memory prefetchable try non-prefetchable */
+ if (range.type == ResEnd && w_2nd) {
+ w_tmp = w_2nd;
+ while (w_2nd) {
+ if ((type & ResTypeMask) == (w_2nd->res_type & ResTypeMask)) {
+#ifdef DEBUG
+ ErrorF("block_begin: 0x%lx block_end: 0x%lx\n",w_2nd->block_begin,
+ w_2nd->block_end);
+#endif
+ range = xf86GetBlock(type,PCI_SIZE(type,tag,alignment + 1),
+ w_2nd->block_begin, w_2nd->block_end,
+ PCI_SIZE(type,tag,alignment),avoid);
+ if (range.type != ResEnd)
+ break;
+ }
+ w_2nd = w_2nd->next;
+ }
+ xf86FreeResList(w_tmp);
+ }
+ xf86FreeResList(avoid);
+
+ if (range.type == ResEnd) {
+ xf86MsgVerb(X_ERROR,3,"Cannot find a replacement memory range\n");
+ xf86FreeResList(Acc);
+ Acc = orgAcc;
+ return FALSE;
+ }
+ xf86FreeResList(orgAcc);
+#ifdef DEBUG
+ ErrorF("begin: 0x%lx, end: 0x%lx\n",range.a,range.b);
+#endif
+
+ (*p_size) = 0;
+ while (alignment >> (*p_size))
+ (*p_size)++;
+ (*p_base) = H2B(tag,range.rBegin,type);
+#ifdef DEBUG
+ ErrorF("New PCI res %i base: 0x%lx, size: 0x%lx, type %s\n",
+ res_n,(*p_base),(1 << (*p_size)),
+ ((type & ResPhysMask) == ResMem) ? "Mem" : "Io");
+#endif
+ if (res_n != 0xff) {
+ if ((type & ResPhysMask) == ResMem)
+ pvp->memBase[prt] = range.rBegin;
+ else
+ pvp->ioBase[prt] = range.rBegin;
+ ((CARD32 *)(&(pcp->pci_base0)))[res_n] =
+ (CARD32)(*p_base) | (CARD32)(p_type);
+ pciWriteLong(tag, PCI_CMD_BASE_REG + res_n * sizeof(CARD32),
+ ((CARD32 *)(&(pcp->pci_base0)))[res_n]);
+ if (PCI_MAP_IS64BITMEM(p_type)) {
+#if defined(LONG64) || defined(WORD64)
+ ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1] =
+ (CARD32)(*p_base >> 32);
+ pciWriteLong(tag, PCI_CMD_BASE_REG + (res_n + 1) * sizeof(CARD32),
+ ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1]);
+#else
+ ((CARD32 *)(&(pcp->pci_base0)))[res_n + 1] = 0;
+ pciWriteLong(tag, PCI_CMD_BASE_REG + (res_n + 1) * sizeof(CARD32),
+ 0);
+#endif
+ }
+ } else {
+ pvp->biosBase = range.rBegin;
+ pcp->pci_baserom = (pciReadLong(tag,PCI_CMD_BIOS_REG) & 0x01) |
+ (CARD32)(*p_base);
+ pciWriteLong(tag, PCI_CMD_BIOS_REG, pcp->pci_baserom);
+ }
+ /* @@@ fake BIOS allocated resource */
+ range.type |= ResBios;
+ Acc = xf86AddResToList(Acc, &range,-1);
+
+ return TRUE;
+
+}
+
+Bool
+xf86FixPciResource(int entityIndex, int prt, memType alignment,
+ unsigned long type)
+{
+ pciVideoPtr pvp = xf86GetPciInfoForEntity(entityIndex);
+ return fixPciResource(prt, alignment, pvp, type);
+}
+
+resPtr
+xf86ReallocatePciResources(int entityIndex, resPtr pRes)
+{
+ pciVideoPtr pvp = xf86GetPciInfoForEntity(entityIndex);
+ resPtr pBad = NULL,pResTmp;
+ unsigned int prt = 0;
+ int i;
+
+ if (!pvp) return pRes;
+
+ while (pRes) {
+ switch (pRes->res_type & ResPhysMask) {
+ case ResMem:
+ if (pRes->block_begin == B2M(TAG(pvp),pvp->biosBase) &&
+ pRes->block_end == B2M(TAG(pvp),pvp->biosBase
+ + SIZE(pvp->biosSize)))
+ prt = 6;
+ else for (i = 0 ; i < 6; i++)
+ if ((pRes->block_begin == B2M(TAG(pvp),pvp->memBase[i]))
+ && (pRes->block_end == B2M(TAG(pvp),pvp->memBase[i]
+ + SIZE(pvp->size[i])))) {
+ prt = i;
+ break;
+ }
+ break;
+ case ResIo:
+ for (i = 0 ; i < 6; i++)
+ if (pRes->block_begin == B2I(TAG(pvp),pvp->ioBase[i])
+ && pRes->block_end == B2I(TAG(pvp),pvp->ioBase[i]
+ + SIZE(pvp->size[i]))) {
+ prt = i;
+ break;
+ }
+ break;
+ }
+
+ if (!prt) return pRes;
+
+ pResTmp = pRes->next;
+ if (! fixPciResource(prt, 0, pvp, pRes->res_type)) {
+ pRes->next = pBad;
+ pBad = pRes;
+ } else
+ xfree(pRes);
+
+ pRes = pResTmp;
+ }
+ return pBad;
+}
+
+/*
+ * BIOS releated
+ */
+memType
+getValidBIOSBase(PCITAG tag, int num)
+{
+ pciVideoPtr pvp = NULL;
+ PciBusPtr pbp;
+ resPtr m = NULL;
+ resPtr tmp, avoid, mem = NULL;
+ resRange range;
+ memType ret;
+ int n = 0;
+ int i;
+ CARD32 biosSize, alignment;
+
+ if (!xf86PciVideoInfo) return 0;
+
+ while ((pvp = xf86PciVideoInfo[n++])) {
+ if (pciTag(pvp->bus,pvp->device,pvp->func) == tag)
+ break;
+ }
+ if (!pvp) return 0;
+
+ biosSize = pvp->biosSize;
+ alignment = (1 << biosSize) - 1;
+ if (biosSize > 24)
+ biosSize = 24;
+
+ switch ((romBaseSource)num) {
+ case ROM_BASE_PRESET:
+ return 0; /* This should not happen */
+ case ROM_BASE_BIOS:
+ /* In some cases the BIOS base register contains the size mask */
+ if ((memType)(-1 << biosSize) == PCIGETROM(pvp->biosBase))
+ return 0;
+ /* Make sure we don't conflict with our own mem resources */
+ for (i = 0; i < 6; i++) {
+ if (!pvp->memBase[i])
+ continue;
+ P_M_RANGE(range,TAG(pvp),pvp->memBase[i],pvp->size[i],
+ ResExcMemBlock);
+ mem = xf86AddResToList(mem,&range,-1);
+ }
+ P_M_RANGE(range, TAG(pvp),pvp->biosBase,biosSize,ResExcMemBlock);
+ ret = pvp->biosBase;
+ break;
+ case ROM_BASE_MEM0:
+ case ROM_BASE_MEM1:
+ case ROM_BASE_MEM2:
+ case ROM_BASE_MEM3:
+ case ROM_BASE_MEM4:
+ case ROM_BASE_MEM5:
+ if (!pvp->memBase[num] || (pvp->size[num] < biosSize))
+ return 0;
+ P_M_RANGE(range, TAG(pvp),pvp->memBase[num],biosSize,
+ ResExcMemBlock);
+ ret = pvp->memBase[num];
+ break;
+ case ROM_BASE_FIND:
+ ret = 0;
+ break;
+ default:
+ return 0; /* This should not happen */
+ }
+
+ /* Now find the ranges for validation */
+ avoid = xf86DupResList(pciAvoidRes);
+ pbp = xf86PciBus;
+ while (pbp) {
+ if (pbp->secondary == pvp->bus) {
+ if (pbp->preferred_pmem)
+ tmp = xf86DupResList(pbp->preferred_pmem);
+ else
+ tmp = xf86DupResList(pbp->pmem);
+ m = xf86JoinResLists(m,tmp);
+ if (pbp->preferred_mem)
+ tmp = xf86DupResList(pbp->preferred_mem);
+ else
+ tmp = xf86DupResList(pbp->mem);
+ m = xf86JoinResLists(m,tmp);
+ tmp = m;
+ while (tmp) {
+ tmp->block_end = MIN(tmp->block_end,PCI_MEM32_LENGTH_MAX);
+ tmp = tmp->next;
+ }
+ } else if ((pbp->primary == pvp->bus) &&
+ (pbp->secondary >= 0) &&
+ (pbp->primary != pbp->secondary)) {
+ tmp = xf86DupResList(pbp->preferred_pmem);
+ avoid = xf86JoinResLists(avoid, tmp);
+ tmp = xf86DupResList(pbp->pmem);
+ avoid = xf86JoinResLists(avoid, tmp);
+ tmp = xf86DupResList(pbp->preferred_mem);
+ avoid = xf86JoinResLists(avoid, tmp);
+ tmp = xf86DupResList(pbp->mem);
+ avoid = xf86JoinResLists(avoid, tmp);
+ }
+ pbp = pbp->next;
+ }
+ pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
+ if (mem)
+ pciConvertListToHost(pvp->bus,pvp->device,pvp->func, mem);
+
+ if (!ret) {
+ /* Return a possible window */
+ while (m) {
+ range = xf86GetBlock(RANGE_TYPE(ResExcMemBlock, xf86GetPciDomain(tag)),
+ PCI_SIZE(ResMem, TAG(pvp), 1 << biosSize),
+ m->block_begin, m->block_end,
+ PCI_SIZE(ResMem, TAG(pvp), alignment),
+ avoid);
+ if (range.type != ResEnd) {
+ ret = M2B(TAG(pvp), range.rBase);
+ break;
+ }
+ m = m->next;
+ }
+ } else {
+ if (!xf86IsSubsetOf(range, m) ||
+ ChkConflict(&range, avoid, SETUP)
+ || (mem && ChkConflict(&range, mem, SETUP)))
+ ret = 0;
+ }
+
+ xf86FreeResList(avoid);
+ xf86FreeResList(m);
+ return ret;
+}
+
+/*
+ * xf86Bus.c interface
+ */
+
+void
+xf86PciProbe(void)
+{
+ /*
+ * Initialise the pcidata entry points.
+ */
+#ifdef XFree86LOADER
+ xf86SetupPciIds = (ScanPciSetupProcPtr)LoaderSymbol("ScanPciSetupPciIds");
+ xf86ClosePciIds = (ScanPciCloseProcPtr)LoaderSymbol("ScanPciClosePciIds");
+ xf86FindPciNamesByDevice =
+ (ScanPciFindByDeviceProcPtr)LoaderSymbol("ScanPciFindPciNamesByDevice");
+ xf86FindPciNamesBySubsys =
+ (ScanPciFindBySubsysProcPtr)LoaderSymbol("ScanPciFindPciNamesBySubsys");
+ xf86FindPciClassBySubsys =
+ (ScanPciFindClassBySubsysProcPtr)LoaderSymbol("ScanPciFindPciClassBySubsys");
+ xf86FindPciClassByDevice =
+ (ScanPciFindClassByDeviceProcPtr)LoaderSymbol("ScanPciFindPciClassByDevice");
+#else
+ xf86SetupPciIds = ScanPciSetupPciIds;
+ xf86ClosePciIds = ScanPciClosePciIds;
+ xf86FindPciNamesByDevice = ScanPciFindPciNamesByDevice;
+ xf86FindPciNamesBySubsys = ScanPciFindPciNamesBySubsys;
+ xf86FindPciClassBySubsys = ScanPciFindPciClassBySubsys;
+ xf86FindPciClassByDevice = ScanPciFindPciClassByDevice;
+#endif
+
+ if (!xf86SetupPciIds())
+ FatalError("xf86SetupPciIds() failed\n");
+
+ FindPCIVideoInfo();
+}
+
+static void alignBridgeRanges(PciBusPtr PciBusBase, PciBusPtr primary);
+
+static void
+printBridgeInfo(PciBusPtr PciBus)
+{
+ char primary[8], secondary[8], subordinate[8], brbus[8];
+
+ xf86FormatPciBusNumber(PciBus->primary, primary);
+ xf86FormatPciBusNumber(PciBus->secondary, secondary);
+ xf86FormatPciBusNumber(PciBus->subordinate, subordinate);
+ xf86FormatPciBusNumber(PciBus->brbus, brbus);
+
+ xf86MsgVerb(X_INFO, 3, "Bus %s: bridge is at (%s:%d:%d), (%s,%s,%s),"
+ " BCTRL: 0x%04x (VGA_EN is %s)\n",
+ secondary, brbus, PciBus->brdev, PciBus->brfunc,
+ primary, secondary, subordinate, PciBus->brcontrol,
+ (PciBus->brcontrol & PCI_PCI_BRIDGE_VGA_EN) ?
+ "set" : "cleared");
+ if (PciBus->preferred_io) {
+ xf86MsgVerb(X_INFO, 3,
+ "Bus %s I/O range:\n", secondary);
+ xf86PrintResList(3, PciBus->preferred_io);
+ }
+ if (PciBus->preferred_mem) {
+ xf86MsgVerb(X_INFO, 3,
+ "Bus %s non-prefetchable memory range:\n", secondary);
+ xf86PrintResList(3, PciBus->preferred_mem);
+ }
+ if (PciBus->preferred_pmem) {
+ xf86MsgVerb(X_INFO, 3,
+ "Bus %s prefetchable memory range:\n", secondary);
+ xf86PrintResList(3, PciBus->preferred_pmem);
+ }
+}
+
+static PciBusPtr
+xf86GetPciBridgeInfo(void)
+{
+ const pciConfigPtr *pcrpp;
+ pciConfigPtr pcrp;
+ pciBusInfo_t *pBusInfo;
+ resRange range;
+ PciBusPtr PciBus, PciBusBase = NULL;
+ PciBusPtr *pnPciBus = &PciBusBase;
+ int MaxBus = 0;
+ int i, domain;
+ int primary, secondary, subordinate;
+ memType base, limit;
+
+ resPtr pciBusAccWindows = xf86PciBusAccWindowsFromOS();
+
+ if (xf86PciInfo == NULL)
+ return NULL;
+
+ /* Add each bridge */
+ for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *(++pcrpp)) {
+ if (pcrp->busnum > MaxBus)
+ MaxBus = pcrp->busnum;
+ if ((pcrp->pci_base_class == PCI_CLASS_BRIDGE) ||
+ (((pcrp->listed_class >> 8) & 0xff) == PCI_CLASS_BRIDGE)) {
+ int sub_class;
+ sub_class = (pcrp->listed_class & 0xffff) ?
+ (pcrp->listed_class & 0xff) : pcrp->pci_sub_class;
+ domain = xf86GetPciDomain(pcrp->tag);
+
+ switch (sub_class) {
+ case PCI_SUBCLASS_BRIDGE_PCI:
+ /* something fishy about the header? If so: just ignore! */
+ if ((pcrp->pci_header_type & 0x7f) != 0x01) {
+ xf86MsgVerb(X_WARNING, 3, "PCI-PCI bridge at %x:%x:%x has"
+ " unexpected header: 0x%x",
+ pcrp->busnum, pcrp->devnum,
+ pcrp->funcnum, pcrp->pci_header_type);
+ break;
+ }
+
+ domain = pcrp->busnum & 0x0000FF00;
+ primary = pcrp->busnum;
+ secondary = domain | pcrp->pci_secondary_bus_number;
+ subordinate = domain | pcrp->pci_subordinate_bus_number;
+
+ /* Is this the correct bridge? If not, ignore it */
+ pBusInfo = pcrp->businfo;
+ if (pBusInfo && (pcrp != pBusInfo->bridge)) {
+ xf86MsgVerb(X_WARNING, 3, "PCI bridge mismatch for bus %x:"
+ " %x:%x:%x and %x:%x:%x\n", secondary,
+ pcrp->busnum, pcrp->devnum, pcrp->funcnum,
+ pBusInfo->bridge->busnum,
+ pBusInfo->bridge->devnum,
+ pBusInfo->bridge->funcnum);
+ break;
+ }
+
+ if (pBusInfo && pBusInfo->funcs->pciGetBridgeBusses)
+ (*pBusInfo->funcs->pciGetBridgeBusses)(secondary,
+ &primary,
+ &secondary,
+ &subordinate);
+
+ if (!pcrp->fakeDevice && (primary >= secondary)) {
+ xf86MsgVerb(X_WARNING, 3, "Misconfigured PCI bridge"
+ " %x:%x:%x (%x,%x)\n",
+ pcrp->busnum, pcrp->devnum, pcrp->funcnum,
+ primary, secondary);
+ break;
+ }
+
+ *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
+ pnPciBus = &PciBus->next;
+
+ PciBus->primary = primary;
+ PciBus->secondary = secondary;
+ PciBus->subordinate = subordinate;
+
+ PciBus->brbus = pcrp->busnum;
+ PciBus->brdev = pcrp->devnum;
+ PciBus->brfunc = pcrp->funcnum;
+
+ PciBus->subclass = sub_class;
+ PciBus->interface = pcrp->pci_prog_if;
+
+ if (pBusInfo && pBusInfo->funcs->pciControlBridge)
+ PciBus->brcontrol =
+ (*pBusInfo->funcs->pciControlBridge)(secondary, 0, 0);
+ else
+ PciBus->brcontrol = pcrp->pci_bridge_control;
+
+ if (pBusInfo && pBusInfo->funcs->pciGetBridgeResources) {
+ (*pBusInfo->funcs->pciGetBridgeResources)(secondary,
+ (pointer *)&PciBus->preferred_io,
+ (pointer *)&PciBus->preferred_mem,
+ (pointer *)&PciBus->preferred_pmem);
+ break;
+ }
+
+ if ((pcrp->pci_command & PCI_CMD_IO_ENABLE) &&
+ (pcrp->pci_upper_io_base || pcrp->pci_io_base ||
+ pcrp->pci_upper_io_limit || pcrp->pci_io_limit)) {
+ base = (pcrp->pci_upper_io_base << 16) |
+ ((pcrp->pci_io_base & 0xf0u) << 8);
+ limit = (pcrp->pci_upper_io_limit << 16) |
+ ((pcrp->pci_io_limit & 0xf0u) << 8) | 0x0fff;
+ /*
+ * Deal with bridge ISA mode (256 wide ranges spaced 1K
+ * apart, but only in the first 64K).
+ */
+ if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) {
+ while ((base <= (CARD16)(-1)) && (base <= limit)) {
+ PCI_I_RANGE(range, pcrp->tag,
+ base, base + (CARD8)(-1),
+ ResIo | ResBlock | ResExclusive);
+ PciBus->preferred_io =
+ xf86AddResToList(PciBus->preferred_io,
+ &range, -1);
+ base += 0x0400;
+ }
+ }
+ if (base <= limit) {
+ PCI_I_RANGE(range, pcrp->tag, base, limit,
+ ResIo | ResBlock | ResExclusive);
+ PciBus->preferred_io =
+ xf86AddResToList(PciBus->preferred_io, &range, -1);
+ }
+ }
+ if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) {
+ /*
+ * The P2P spec requires these next two, but some bridges
+ * don't comply. Err on the side of caution, making the not
+ * so bold assumption that no bridge would ever re-route the
+ * bottom megabyte.
+ */
+ if (pcrp->pci_mem_base || pcrp->pci_mem_limit) {
+ base = pcrp->pci_mem_base & 0xfff0u;
+ limit = pcrp->pci_mem_limit & 0xfff0u;
+ if (base <= limit) {
+ PCI_M_RANGE(range, pcrp->tag,
+ base << 16, (limit << 16) | 0x0fffff,
+ ResMem | ResBlock | ResExclusive);
+ PciBus->preferred_mem =
+ xf86AddResToList(PciBus->preferred_mem, &range, -1);
+ }
+ }
+
+ if (pcrp->pci_prefetch_mem_base ||
+ pcrp->pci_prefetch_mem_limit ||
+ pcrp->pci_prefetch_upper_mem_base ||
+ pcrp->pci_prefetch_upper_mem_limit) {
+ base = pcrp->pci_prefetch_mem_base & 0xfff0u;
+ limit = pcrp->pci_prefetch_mem_limit & 0xfff0u;
+#if defined(LONG64) || defined(WORD64)
+ base |= (memType)pcrp->pci_prefetch_upper_mem_base << 16;
+ limit |= (memType)pcrp->pci_prefetch_upper_mem_limit << 16;
+#endif
+ if (base <= limit) {
+ PCI_M_RANGE(range, pcrp->tag,
+ base << 16, (limit << 16) | 0xfffff,
+ ResMem | ResBlock | ResExclusive);
+ PciBus->preferred_pmem =
+ xf86AddResToList(PciBus->preferred_pmem,
+ &range, -1);
+ }
+ }
+ }
+ break;
+
+ case PCI_SUBCLASS_BRIDGE_CARDBUS:
+ /* something fishy about the header? If so: just ignore! */
+ if ((pcrp->pci_header_type & 0x7f) != 0x02) {
+ xf86MsgVerb(X_WARNING, 3, "PCI-CardBus bridge at %x:%x:%x"
+ " has unexpected header: 0x%x",
+ pcrp->busnum, pcrp->devnum,
+ pcrp->funcnum, pcrp->pci_header_type);
+ break;
+ }
+
+ domain = pcrp->busnum & 0x0000FF00;
+ primary = pcrp->busnum;
+ secondary = domain | pcrp->pci_cb_cardbus_bus_number;
+ subordinate = domain | pcrp->pci_subordinate_bus_number;
+
+ /* Is this the correct bridge? If not, ignore it */
+ pBusInfo = pcrp->businfo;
+ if (pBusInfo && (pcrp != pBusInfo->bridge)) {
+ xf86MsgVerb(X_WARNING, 3, "CardBus bridge mismatch for bus"
+ " %x: %x:%x:%x and %x:%x:%x\n", secondary,
+ pcrp->busnum, pcrp->devnum, pcrp->funcnum,
+ pBusInfo->bridge->busnum,
+ pBusInfo->bridge->devnum,
+ pBusInfo->bridge->funcnum);
+ break;
+ }
+
+ if (pBusInfo && pBusInfo->funcs->pciGetBridgeBusses)
+ (*pBusInfo->funcs->pciGetBridgeBusses)(secondary,
+ &primary,
+ &secondary,
+ &subordinate);
+
+ if (primary >= secondary) {
+ if (pcrp->pci_cb_cardbus_bus_number != 0)
+ xf86MsgVerb(X_WARNING, 3, "Misconfigured CardBus"
+ " bridge %x:%x:%x (%x,%x)\n",
+ pcrp->busnum, pcrp->devnum, pcrp->funcnum,
+ primary, secondary);
+ break;
+ }
+
+ *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
+ pnPciBus = &PciBus->next;
+
+ PciBus->primary = primary;
+ PciBus->secondary = secondary;
+ PciBus->subordinate = subordinate;
+
+ PciBus->brbus = pcrp->busnum;
+ PciBus->brdev = pcrp->devnum;
+ PciBus->brfunc = pcrp->funcnum;
+
+ PciBus->subclass = sub_class;
+ PciBus->interface = pcrp->pci_prog_if;
+
+ if (pBusInfo && pBusInfo->funcs->pciControlBridge)
+ PciBus->brcontrol =
+ (*pBusInfo->funcs->pciControlBridge)(secondary, 0, 0);
+ else
+ PciBus->brcontrol = pcrp->pci_bridge_control;
+
+ if (pBusInfo && pBusInfo->funcs->pciGetBridgeResources) {
+ (*pBusInfo->funcs->pciGetBridgeResources)(secondary,
+ (pointer *)&PciBus->preferred_io,
+ (pointer *)&PciBus->preferred_mem,
+ (pointer *)&PciBus->preferred_pmem);
+ break;
+ }
+
+ if (pcrp->pci_command & PCI_CMD_IO_ENABLE) {
+ if (pcrp->pci_cb_iobase0) {
+ base = PCI_CB_IOBASE(pcrp->pci_cb_iobase0);
+ limit = PCI_CB_IOLIMIT(pcrp->pci_cb_iolimit0);
+
+ /*
+ * Deal with bridge ISA mode (256-wide ranges spaced 1K
+ * apart (start to start), but only in the first 64K).
+ */
+ if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) {
+ while ((base <= (CARD16)(-1)) &&
+ (base <= limit)) {
+ PCI_I_RANGE(range, pcrp->tag,
+ base, base + (CARD8)(-1),
+ ResIo | ResBlock | ResExclusive);
+ PciBus->preferred_io =
+ xf86AddResToList(PciBus->preferred_io,
+ &range, -1);
+ base += 0x0400;
+ }
+ }
+
+ if (base <= limit) {
+ PCI_I_RANGE(range, pcrp->tag, base, limit,
+ ResIo | ResBlock | ResExclusive);
+ PciBus->preferred_io =
+ xf86AddResToList(PciBus->preferred_io,
+ &range, -1);
+ }
+ }
+
+ if (pcrp->pci_cb_iobase1) {
+ base = PCI_CB_IOBASE(pcrp->pci_cb_iobase1);
+ limit = PCI_CB_IOLIMIT(pcrp->pci_cb_iolimit1);
+
+ /*
+ * Deal with bridge ISA mode (256-wide ranges spaced 1K
+ * apart (start to start), but only in the first 64K).
+ */
+ if (pcrp->pci_bridge_control & PCI_PCI_BRIDGE_ISA_EN) {
+ while ((base <= (CARD16)(-1)) &&
+ (base <= limit)) {
+ PCI_I_RANGE(range, pcrp->tag,
+ base, base + (CARD8)(-1),
+ ResIo | ResBlock | ResExclusive);
+ PciBus->preferred_io =
+ xf86AddResToList(PciBus->preferred_io,
+ &range, -1);
+ base += 0x0400;
+ }
+ }
+
+ if (base <= limit) {
+ PCI_I_RANGE(range, pcrp->tag, base, limit,
+ ResIo | ResBlock | ResExclusive);
+ PciBus->preferred_io =
+ xf86AddResToList(PciBus->preferred_io,
+ &range, -1);
+ }
+ }
+ }
+
+ if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) {
+ if ((pcrp->pci_cb_membase0) &&
+ (pcrp->pci_cb_membase0 <= pcrp->pci_cb_memlimit0)) {
+ PCI_M_RANGE(range, pcrp->tag,
+ pcrp->pci_cb_membase0 & ~0x0fff,
+ pcrp->pci_cb_memlimit0 | 0x0fff,
+ ResMem | ResBlock | ResExclusive);
+ if (pcrp->pci_bridge_control &
+ PCI_CB_BRIDGE_CTL_PREFETCH_MEM0)
+ PciBus->preferred_pmem =
+ xf86AddResToList(PciBus->preferred_pmem,
+ &range, -1);
+ else
+ PciBus->preferred_mem =
+ xf86AddResToList(PciBus->preferred_mem,
+ &range, -1);
+ }
+ if ((pcrp->pci_cb_membase1) &&
+ (pcrp->pci_cb_membase1 <= pcrp->pci_cb_memlimit1)) {
+ PCI_M_RANGE(range, pcrp->tag,
+ pcrp->pci_cb_membase1 & ~0x0fff,
+ pcrp->pci_cb_memlimit1 | 0x0fff,
+ ResMem | ResBlock | ResExclusive);
+ if (pcrp->pci_bridge_control &
+ PCI_CB_BRIDGE_CTL_PREFETCH_MEM1)
+ PciBus->preferred_pmem =
+ xf86AddResToList(PciBus->preferred_pmem,
+ &range, -1);
+ else
+ PciBus->preferred_mem =
+ xf86AddResToList(PciBus->preferred_mem,
+ &range, -1);
+ }
+ }
+
+ break;
+
+ case PCI_SUBCLASS_BRIDGE_ISA:
+ case PCI_SUBCLASS_BRIDGE_EISA:
+ case PCI_SUBCLASS_BRIDGE_MC:
+ *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
+ pnPciBus = &PciBus->next;
+ PciBus->primary = pcrp->busnum;
+ PciBus->secondary = PciBus->subordinate = -1;
+ PciBus->brbus = pcrp->busnum;
+ PciBus->brdev = pcrp->devnum;
+ PciBus->brfunc = pcrp->funcnum;
+ PciBus->subclass = sub_class;
+ PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN;
+ break;
+
+ case PCI_SUBCLASS_BRIDGE_HOST:
+ /* Is this the correct bridge? If not, ignore bus info */
+ pBusInfo = pcrp->businfo;
+ if (pBusInfo == HOST_NO_BUS)
+ break;
+
+ secondary = 0;
+ if (pBusInfo) {
+ /* Find "secondary" bus segment */
+ while (pBusInfo != pciBusInfo[secondary])
+ secondary++;
+ if (pcrp != pBusInfo->bridge) {
+ xf86MsgVerb(X_WARNING, 3, "Host bridge mismatch for"
+ " bus %x: %x:%x:%x and %x:%x:%x\n",
+ pBusInfo->primary_bus,
+ pcrp->busnum, pcrp->devnum, pcrp->funcnum,
+ pBusInfo->bridge->busnum,
+ pBusInfo->bridge->devnum,
+ pBusInfo->bridge->funcnum);
+ pBusInfo = NULL;
+ }
+ }
+
+ *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
+ pnPciBus = &PciBus->next;
+
+ PciBus->primary = -1;
+ PciBus->secondary = -1; /* to be set below */
+ PciBus->subordinate = pciNumBuses - 1;
+
+ if (pBusInfo) {
+ PciBus->primary = PciBus->secondary = secondary;
+ if (pBusInfo->funcs->pciGetBridgeBusses)
+ (*pBusInfo->funcs->pciGetBridgeBusses)
+ (secondary,
+ &PciBus->primary,
+ &PciBus->secondary,
+ &PciBus->subordinate);
+ }
+
+ PciBus->brbus = pcrp->busnum;
+ PciBus->brdev = pcrp->devnum;
+ PciBus->brfunc = pcrp->funcnum;
+
+ PciBus->subclass = sub_class;
+
+ if (pBusInfo && pBusInfo->funcs->pciControlBridge)
+ PciBus->brcontrol =
+ (*pBusInfo->funcs->pciControlBridge)(secondary, 0, 0);
+ else
+ PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN;
+
+ if (pBusInfo && pBusInfo->funcs->pciGetBridgeResources) {
+ (*pBusInfo->funcs->pciGetBridgeResources)
+ (secondary,
+ (pointer *)&PciBus->preferred_io,
+ (pointer *)&PciBus->preferred_mem,
+ (pointer *)&PciBus->preferred_pmem);
+ break;
+ }
+
+ PciBus->preferred_io =
+ xf86ExtractTypeFromList(pciBusAccWindows,
+ RANGE_TYPE(ResIo, domain));
+ PciBus->preferred_mem =
+ xf86ExtractTypeFromList(pciBusAccWindows,
+ RANGE_TYPE(ResMem, domain));
+ PciBus->preferred_pmem =
+ xf86ExtractTypeFromList(pciBusAccWindows,
+ RANGE_TYPE(ResMem, domain));
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ for (i = 0; i <= MaxBus; i++) { /* find PCI buses not attached to bridge */
+ if (!pciBusInfo[i])
+ continue;
+ for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next)
+ if (PciBus->secondary == i) break;
+ if (!PciBus) { /* We assume it's behind a HOST-PCI bridge */
+ /*
+ * Find the 'smallest' free HOST-PCI bridge, where 'small' is in
+ * the order of pciTag().
+ */
+ PCITAG minTag = 0xFFFFFFFF, tag;
+ PciBusPtr PciBusFound = NULL;
+ for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next)
+ if ((PciBus->subclass == PCI_SUBCLASS_BRIDGE_HOST) &&
+ (PciBus->secondary == -1) &&
+ ((tag = pciTag(PciBus->brbus,PciBus->brdev,PciBus->brfunc))
+ < minTag) ) {
+ minTag = tag;
+ PciBusFound = PciBus;
+ }
+ if (PciBusFound)
+ PciBusFound->secondary = i;
+ else { /* if nothing found it may not be visible: create new */
+ /* Find a device on this bus */
+ domain = 0;
+ for (pcrpp = xf86PciInfo; (pcrp = *pcrpp); pcrpp++) {
+ if (pcrp->busnum == i) {
+ domain = xf86GetPciDomain(pcrp->tag);
+ break;
+ }
+ }
+ *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec));
+ pnPciBus = &PciBus->next;
+ PciBus->primary = PciBus->secondary = i;
+ PciBus->subclass = PCI_SUBCLASS_BRIDGE_HOST;
+ PciBus->brcontrol = PCI_PCI_BRIDGE_VGA_EN;
+ PciBus->preferred_io =
+ xf86ExtractTypeFromList(pciBusAccWindows,
+ RANGE_TYPE(ResIo, domain));
+ PciBus->preferred_mem =
+ xf86ExtractTypeFromList(pciBusAccWindows,
+ RANGE_TYPE(ResMem, domain));
+ PciBus->preferred_pmem =
+ xf86ExtractTypeFromList(pciBusAccWindows,
+ RANGE_TYPE(ResMem, domain));
+ }
+ }
+ }
+
+ for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) {
+ if (PciBus->primary == PciBus->secondary) {
+ alignBridgeRanges(PciBusBase, PciBus);
+ }
+ }
+
+ for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) {
+ switch (PciBus->subclass) {
+ case PCI_SUBCLASS_BRIDGE_PCI:
+ if (PciBus->interface == PCI_IF_BRIDGE_PCI_SUBTRACTIVE)
+ xf86MsgVerb(X_INFO, 3, "Subtractive PCI-to-PCI bridge:\n");
+ else
+ xf86MsgVerb(X_INFO, 3, "PCI-to-PCI bridge:\n");
+ break;
+ case PCI_SUBCLASS_BRIDGE_CARDBUS:
+ xf86MsgVerb(X_INFO, 3, "PCI-to-CardBus bridge:\n");
+ break;
+ case PCI_SUBCLASS_BRIDGE_HOST:
+ xf86MsgVerb(X_INFO, 3, "Host-to-PCI bridge:\n");
+ break;
+ case PCI_SUBCLASS_BRIDGE_ISA:
+ xf86MsgVerb(X_INFO, 3, "PCI-to-ISA bridge:\n");
+ break;
+ case PCI_SUBCLASS_BRIDGE_EISA:
+ xf86MsgVerb(X_INFO, 3, "PCI-to-EISA bridge:\n");
+ break;
+ case PCI_SUBCLASS_BRIDGE_MC:
+ xf86MsgVerb(X_INFO, 3, "PCI-to-MCA bridge:\n");
+ break;
+ default:
+ break;
+ }
+ printBridgeInfo(PciBus);
+ }
+ xf86FreeResList(pciBusAccWindows);
+ return PciBusBase;
+}
+
+static void
+alignBridgeRanges(PciBusPtr PciBusBase, PciBusPtr primary)
+{
+ PciBusPtr PciBus;
+
+ for (PciBus = PciBusBase; PciBus; PciBus = PciBus->next) {
+ if ((PciBus != primary) && (PciBus->primary != -1)
+ && (PciBus->primary == primary->secondary)) {
+ resPtr tmp;
+ tmp = xf86FindIntersectOfLists(primary->preferred_io,
+ PciBus->preferred_io);
+ xf86FreeResList(PciBus->preferred_io);
+ PciBus->preferred_io = tmp;
+ tmp = xf86FindIntersectOfLists(primary->preferred_pmem,
+ PciBus->preferred_pmem);
+ xf86FreeResList(PciBus->preferred_pmem);
+ PciBus->preferred_pmem = tmp;
+ tmp = xf86FindIntersectOfLists(primary->preferred_mem,
+ PciBus->preferred_mem);
+ xf86FreeResList(PciBus->preferred_mem);
+ PciBus->preferred_mem = tmp;
+
+ /* Deal with subtractive decoding */
+ switch (PciBus->subclass) {
+ case PCI_SUBCLASS_BRIDGE_PCI:
+ if (PciBus->interface != PCI_IF_BRIDGE_PCI_SUBTRACTIVE)
+ break;
+ /* Fall through */
+#if 0 /* Not yet */
+ case PCI_SUBCLASS_BRIDGE_ISA:
+ case PCI_SUBCLASS_BRIDGE_EISA:
+ case PCI_SUBCLASS_BRIDGE_MC:
+#endif
+ if (!(PciBus->io = primary->io))
+ PciBus->io = primary->preferred_io;
+ if (!(PciBus->mem = primary->mem))
+ PciBus->mem = primary->preferred_mem;
+ if (!(PciBus->pmem = primary->pmem))
+ PciBus->pmem = primary->preferred_pmem;
+ default:
+ break;
+ }
+
+ alignBridgeRanges(PciBusBase, PciBus);
+ }
+ }
+}
+
+void
+ValidatePci(void)
+{
+ pciVideoPtr pvp, pvp1;
+ PciBusPtr pbp;
+ pciConfigPtr pcrp, *pcrpp;
+ CARD32 *basep;
+ resPtr Sys;
+ resPtr Fix;
+ resRange range;
+ int n = 0, m, i;
+
+ if (!xf86PciVideoInfo) return;
+
+ /*
+ * Mark all pciInfoRecs that need to be validated. These are
+ * the ones which have been assigned to a screen.
+ */
+ Sys = xf86DupResList(osRes);
+ for (i=0; i<xf86NumScreens; i++) {
+ for (m = 0; m < xf86Screens[i]->numEntities; m++)
+ if ((pvp = xf86GetPciInfoForEntity(xf86Screens[i]->entityList[m])))
+ pvp->validate = TRUE;
+ }
+
+ /*
+ * Collect all background PCI resources we need to validate against.
+ * These are all resources which don't belong to PCINONSYSTEMCLASSES
+ * and which have not been assigned to an entity.
+ */
+ /* First get the PCIINFOCLASSES */
+ m = 0;
+ while ((pvp = xf86PciVideoInfo[m++])) {
+ /* is it a PCINONSYSTEMCLASS? */
+ if (PCINONSYSTEMCLASSES(pvp->class, pvp->subclass))
+ continue;
+ /* has it an Entity assigned to it? */
+ for (i=0; i<xf86NumEntities; i++) {
+ EntityPtr p = xf86Entities[i];
+ if (p->busType != BUS_PCI)
+ continue;
+ if (p->pciBusId.bus == pvp->bus
+ && p->pciBusId.device == pvp->device
+ && p->pciBusId.func == pvp->func)
+ break;
+ }
+ if (i != xf86NumEntities) /* found an Entity for this one */
+ continue;
+
+ for (i = 0; i<6; i++) {
+ if (pvp->ioBase[i]) {
+ PV_I_RANGE(range,pvp,i,ResExcIoBlock);
+ Sys = xf86AddResToList(Sys,&range,-1);
+ } else if (pvp->memBase[i]) {
+ PV_M_RANGE(range,pvp,i,ResExcMemBlock);
+ Sys = xf86AddResToList(Sys,&range,-1);
+ }
+ }
+ }
+ for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) {
+
+ if (PCIINFOCLASSES(pcrp->pci_base_class, pcrp->pci_sub_class))
+ continue;
+
+ if ((pcrp->pci_header_type & 0x7f) ||
+ !(pcrp->pci_command & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE)))
+ continue;
+
+ basep = &pcrp->pci_base0;
+ for (i = 0; i < 6; i++) {
+ if (basep[i]) {
+ if (PCI_MAP_IS_IO(basep[i])) {
+ if (!(pcrp->pci_command & PCI_CMD_IO_ENABLE))
+ continue;
+ P_I_RANGE(range, pcrp->tag, PCIGETIO(basep[i]),
+ pcrp->basesize[i], ResExcIoBlock)
+ } else if (!PCI_MAP_IS64BITMEM(basep[i])) {
+ if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE))
+ continue;
+ P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i]),
+ pcrp->basesize[i], ResExcMemBlock)
+ } else {
+ i++;
+#if defined(LONG64) || defined(WORD64)
+ if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE))
+ continue;
+ P_M_RANGE(range, pcrp->tag, PCIGETMEMORY64(basep[i-1]),
+ pcrp->basesize[i-1], ResExcMemBlock)
+#else
+ continue;
+#endif
+ }
+ Sys = xf86AddResToList(Sys, &range, -1);
+ }
+ }
+ if ((pcrp->pci_baserom) &&
+ (pcrp->pci_command & PCI_CMD_MEM_ENABLE) &&
+ (pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) {
+ P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom),
+ pcrp->basesize[6],ResExcMemBlock);
+ Sys = xf86AddResToList(Sys, &range, -1);
+ }
+ }
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3,"Sys:\n");
+ xf86PrintResList(3,Sys);
+#endif
+
+ /*
+ * The order the video devices are listed in is
+ * just right: the lower buses come first.
+ * This way we attempt to fix a conflict of
+ * a lower bus device with a higher bus device
+ * where we have more room to find different
+ * resources.
+ */
+ while ((pvp = xf86PciVideoInfo[n++])) {
+ resPtr res_mp = NULL, res_m_io = NULL;
+ resPtr NonSys;
+ resPtr tmp, avoid = NULL;
+
+ if (!pvp->validate) continue;
+ NonSys = xf86DupResList(Sys);
+ m = n;
+ while ((pvp1 = xf86PciVideoInfo[m++])) {
+ if (!pvp1->validate) continue;
+ for (i = 0; i<6; i++) {
+ if (pvp1->ioBase[i]) {
+ PV_I_RANGE(range,pvp1,i,ResExcIoBlock);
+ NonSys = xf86AddResToList(NonSys,&range,-1);
+ } else if (pvp1->memBase[i]) {
+ PV_M_RANGE(range,pvp1,i,ResExcMemBlock);
+ NonSys = xf86AddResToList(NonSys,&range,-1);
+ }
+ }
+ }
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3,"NonSys:\n");
+ xf86PrintResList(3,NonSys);
+#endif
+ pbp = xf86PciBus;
+ while (pbp) {
+ if (pbp->secondary == pvp->bus) {
+ if (pbp->preferred_pmem) {
+ /* keep prefetchable separate */
+ res_mp =
+ xf86FindIntersectOfLists(pbp->preferred_pmem, ResRange);
+ }
+ if (pbp->pmem) {
+ res_mp = xf86FindIntersectOfLists(pbp->pmem, ResRange);
+ }
+ if (pbp->preferred_mem) {
+ res_m_io =
+ xf86FindIntersectOfLists(pbp->preferred_mem, ResRange);
+ }
+ if (pbp->mem) {
+ res_m_io = xf86FindIntersectOfLists(pbp->mem, ResRange);
+ }
+ if (pbp->preferred_io) {
+ res_m_io = xf86JoinResLists(res_m_io,
+ xf86FindIntersectOfLists(pbp->preferred_io, ResRange));
+ }
+ if (pbp->io) {
+ res_m_io = xf86JoinResLists(res_m_io,
+ xf86FindIntersectOfLists(pbp->preferred_io, ResRange));
+ }
+ } else if ((pbp->primary == pvp->bus) &&
+ (pbp->secondary >= 0) &&
+ (pbp->primary != pbp->secondary)) {
+ tmp = xf86DupResList(pbp->preferred_pmem);
+ avoid = xf86JoinResLists(avoid, tmp);
+ tmp = xf86DupResList(pbp->preferred_mem);
+ avoid = xf86JoinResLists(avoid, tmp);
+ tmp = xf86DupResList(pbp->preferred_io);
+ avoid = xf86JoinResLists(avoid, tmp);
+ }
+ pbp = pbp->next;
+ }
+ if (res_m_io == NULL)
+ res_m_io = xf86DupResList(ResRange);
+
+ pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid);
+
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3,"avoid:\n");
+ xf86PrintResList(3,avoid);
+ xf86MsgVerb(X_INFO, 3,"prefetchable Memory:\n");
+ xf86PrintResList(3,res_mp);
+ xf86MsgVerb(X_INFO, 3,"MEM/IO:\n");
+ xf86PrintResList(3,res_m_io);
+#endif
+ Fix = NULL;
+ for (i = 0; i < 6; i++) {
+ int j;
+ resPtr own = NULL;
+ for (j = i+1; j < 6; j++) {
+ if (pvp->ioBase[j]) {
+ PV_I_RANGE(range,pvp,j,ResExcIoBlock);
+ own = xf86AddResToList(own,&range,-1);
+ } else if (pvp->memBase[j]) {
+ PV_M_RANGE(range,pvp,j,ResExcMemBlock);
+ own = xf86AddResToList(own,&range,-1);
+ }
+ }
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "own:\n");
+ xf86PrintResList(3, own);
+#endif
+ if (pvp->ioBase[i]) {
+ PV_I_RANGE(range,pvp,i,ResExcIoBlock);
+ if (xf86IsSubsetOf(range,res_m_io)
+ && ! ChkConflict(&range,own,SETUP)
+ && ! ChkConflict(&range,avoid,SETUP)
+ && ! ChkConflict(&range,NonSys,SETUP)) {
+ xf86FreeResList(own);
+ continue;
+ }
+ xf86MsgVerb(X_WARNING, 0,
+ "****INVALID IO ALLOCATION**** b: 0x%lx e: 0x%lx "
+ "correcting\a\n", range.rBegin,range.rEnd);
+#ifdef DEBUG
+ sleep(2);
+#endif
+ fixPciResource(i, 0, pvp, range.type);
+ } else if (pvp->memBase[i]) {
+ PV_M_RANGE(range,pvp,i,ResExcMemBlock);
+ if (pvp->type[i] & PCI_MAP_MEMORY_CACHABLE) {
+ if (xf86IsSubsetOf(range,res_mp)
+ && ! ChkConflict(&range,own,SETUP)
+ && ! ChkConflict(&range,avoid,SETUP)
+ && ! ChkConflict(&range,NonSys,SETUP)) {
+ xf86FreeResList(own);
+ continue;
+ }
+ }
+ if (xf86IsSubsetOf(range,res_m_io)
+ && ! ChkConflict(&range,own,SETUP)
+ && ! ChkConflict(&range,avoid,SETUP)
+ && ! ChkConflict(&range,NonSys,SETUP)) {
+ xf86FreeResList(own);
+ continue;
+ }
+ xf86MsgVerb(X_WARNING, 0,
+ "****INVALID MEM ALLOCATION**** b: 0x%lx e: 0x%lx "
+ "correcting\a\n", range.rBegin,range.rEnd);
+ if (ChkConflict(&range,own,SETUP)) {
+ xf86MsgVerb(X_INFO,3,"own\n");
+ xf86PrintResList(3,own);
+ }
+ if (ChkConflict(&range,avoid,SETUP)) {
+ xf86MsgVerb(X_INFO,3,"avoid\n");
+ xf86PrintResList(3,avoid);
+ }
+ if (ChkConflict(&range,NonSys,SETUP)) {
+ xf86MsgVerb(X_INFO,3,"NonSys\n");
+ xf86PrintResList(3,NonSys);
+ }
+
+#ifdef DEBUG
+ sleep(2);
+#endif
+ fixPciResource(i, 0, pvp, range.type);
+ }
+ xf86FreeResList(own);
+ }
+ xf86FreeResList(avoid);
+ xf86FreeResList(NonSys);
+ xf86FreeResList(res_mp);
+ xf86FreeResList(res_m_io);
+ }
+ xf86FreeResList(Sys);
+}
+
+resList
+GetImplicitPciResources(int entityIndex)
+{
+ pciVideoPtr pvp;
+ int i;
+ resList list = NULL;
+ int num = 0;
+
+ if (! (pvp = xf86GetPciInfoForEntity(entityIndex))) return NULL;
+
+ for (i = 0; i < 6; i++) {
+ if (pvp->ioBase[i]) {
+ list = xnfrealloc(list,sizeof(resRange) * (++num));
+ PV_I_RANGE(list[num - 1],pvp,i,ResShrIoBlock | ResBios);
+ } else if (pvp->memBase[i]) {
+ list = xnfrealloc(list,sizeof(resRange) * (++num));
+ PV_M_RANGE(list[num - 1],pvp,i,ResShrMemBlock | ResBios);
+ }
+ }
+#if 0
+ if (pvp->biosBase) {
+ list = xnfrealloc(list,sizeof(resRange) * (++num));
+ PV_B_RANGE(list[num - 1],pvp,ResShrMemBlock | ResBios);
+ }
+#endif
+ list = xnfrealloc(list,sizeof(resRange) * (++num));
+ list[num - 1].type = ResEnd;
+
+ return list;
+}
+
+void
+initPciState(void)
+{
+ int i = 0;
+ int j = 0;
+ pciVideoPtr pvp;
+ pciAccPtr pcaccp;
+
+ if (xf86PciAccInfo != NULL)
+ return;
+
+ if (xf86PciVideoInfo == NULL)
+ return;
+
+ while ((pvp = xf86PciVideoInfo[i]) != NULL) {
+ i++;
+ j++;
+ xf86PciAccInfo = xnfrealloc(xf86PciAccInfo,
+ sizeof(pciAccPtr) * (j + 1));
+ xf86PciAccInfo[j] = NULL;
+ pcaccp = xf86PciAccInfo[j - 1] = xnfalloc(sizeof(pciAccRec));
+ pcaccp->busnum = pvp->bus;
+ pcaccp->devnum = pvp->device;
+ pcaccp->funcnum = pvp->func;
+ pcaccp->arg.tag = pciTag(pvp->bus, pvp->device, pvp->func);
+ pcaccp->arg.func =
+ (WriteProcPtr)pciLongFunc(pcaccp->arg.tag,WRITE);
+ pcaccp->ioAccess.AccessDisable = pciIoAccessDisable;
+ pcaccp->ioAccess.AccessEnable = pciIoAccessEnable;
+ pcaccp->ioAccess.arg = &pcaccp->arg;
+ pcaccp->io_memAccess.AccessDisable = pciIo_MemAccessDisable;
+ pcaccp->io_memAccess.AccessEnable = pciIo_MemAccessEnable;
+ pcaccp->io_memAccess.arg = &pcaccp->arg;
+ pcaccp->memAccess.AccessDisable = pciMemAccessDisable;
+ pcaccp->memAccess.AccessEnable = pciMemAccessEnable;
+ pcaccp->memAccess.arg = &pcaccp->arg;
+ if (PCISHAREDIOCLASSES(pvp->class, pvp->subclass))
+ pcaccp->ctrl = TRUE;
+ else
+ pcaccp->ctrl = FALSE;
+ savePciState(pcaccp->arg.tag, &pcaccp->save);
+ pcaccp->arg.ctrl = pcaccp->save.command;
+ }
+}
+
+/*
+ * initPciBusState() - fill out the BusAccRec for a PCI bus.
+ * Theory: each bus is associated with one bridge connecting it
+ * to its parent bus. The address of a bridge is therefore stored
+ * in the BusAccRec of the bus it connects to. Each bus can
+ * have several bridges connecting secondary buses to it. Only one
+ * of these bridges can be open. Therefore the status of a bridge
+ * associated with a bus is stored in the BusAccRec of the parent
+ * the bridge connects to. The first member of the structure is
+ * a pointer to a function that open access to this bus. This function
+ * receives a pointer to the structure itself as argument. This
+ * design should be common to BusAccRecs of any type of buses we
+ * support. The remeinder of the structure is bus type specific.
+ * In this case it contains a pointer to the structure of the
+ * parent bus. Thus enabling access to a specific bus is simple:
+ * 1. Close any bridge going to secondary buses.
+ * 2. Climb down the ladder and enable any bridge on buses
+ * on the path from the CPU to this bus.
+ */
+
+void
+initPciBusState(void)
+{
+ BusAccPtr pbap, pbap_tmp;
+ PciBusPtr pbp = xf86PciBus;
+ pciBusInfo_t *pBusInfo;
+
+ while (pbp) {
+ pbap = xnfcalloc(1,sizeof(BusAccRec));
+ pbap->busdep.pci.bus = pbp->secondary;
+ pbap->busdep.pci.primary_bus = pbp->primary;
+ pbap->busdep_type = BUS_PCI;
+ pbap->busdep.pci.acc = PCITAG_SPECIAL;
+
+ if ((pbp->secondary >= 0) && (pbp->secondary < pciNumBuses) &&
+ (pBusInfo = pciBusInfo[pbp->secondary]) &&
+ pBusInfo->funcs->pciControlBridge) {
+ pbap->type = BUS_PCI;
+ pbap->save_f = savePciDrvBusState;
+ pbap->restore_f = restorePciDrvBusState;
+ pbap->set_f = pciSetBusAccess;
+ pbap->enable_f = pciDrvBusAccessEnable;
+ pbap->disable_f = pciDrvBusAccessDisable;
+ savePciDrvBusState(pbap);
+ } else switch (pbp->subclass) {
+ case PCI_SUBCLASS_BRIDGE_HOST:
+ pbap->type = BUS_PCI;
+ pbap->set_f = pciSetBusAccess;
+ break;
+ case PCI_SUBCLASS_BRIDGE_PCI:
+ case PCI_SUBCLASS_BRIDGE_CARDBUS:
+ pbap->type = BUS_PCI;
+ pbap->save_f = savePciBusState;
+ pbap->restore_f = restorePciBusState;
+ pbap->set_f = pciSetBusAccess;
+ pbap->enable_f = pciBusAccessEnable;
+ pbap->disable_f = pciBusAccessDisable;
+ pbap->busdep.pci.acc = pciTag(pbp->brbus,pbp->brdev,pbp->brfunc);
+ pbap->busdep.pci.func =
+ (SetBitsProcPtr)pciLongFunc(pbap->busdep.pci.acc,SET_BITS);
+ savePciBusState(pbap);
+ break;
+ case PCI_SUBCLASS_BRIDGE_ISA:
+ case PCI_SUBCLASS_BRIDGE_EISA:
+ case PCI_SUBCLASS_BRIDGE_MC:
+ pbap->type = BUS_ISA;
+ pbap->set_f = pciSetBusAccess;
+ break;
+ }
+ pbap->next = xf86BusAccInfo;
+ xf86BusAccInfo = pbap;
+ pbp = pbp->next;
+ }
+
+ pbap = xf86BusAccInfo;
+
+ while (pbap) {
+ pbap->primary = NULL;
+ if (pbap->busdep_type == BUS_PCI
+ && pbap->busdep.pci.primary_bus > -1) {
+ pbap_tmp = xf86BusAccInfo;
+ while (pbap_tmp) {
+ if (pbap_tmp->busdep_type == BUS_PCI &&
+ pbap_tmp->busdep.pci.bus == pbap->busdep.pci.primary_bus) {
+ /* Don't create loops */
+ if (pbap == pbap_tmp)
+ break;
+ pbap->primary = pbap_tmp;
+ break;
+ }
+ pbap_tmp = pbap_tmp->next;
+ }
+ }
+ pbap = pbap->next;
+ }
+}
+
+void
+PciStateEnter(void)
+{
+ pciAccPtr paccp;
+ int i = 0;
+
+ if (xf86PciAccInfo == NULL)
+ return;
+
+ while ((paccp = xf86PciAccInfo[i]) != NULL) {
+ i++;
+ if (!paccp->ctrl)
+ continue;
+ savePciState(paccp->arg.tag, &paccp->save);
+ restorePciState(paccp->arg.tag, &paccp->restore);
+ paccp->arg.ctrl = paccp->restore.command;
+ }
+}
+
+void
+PciBusStateEnter(void)
+{
+ BusAccPtr pbap = xf86BusAccInfo;
+
+ while (pbap) {
+ if (pbap->save_f)
+ pbap->save_f(pbap);
+ pbap = pbap->next;
+ }
+}
+
+void
+PciStateLeave(void)
+{
+ pciAccPtr paccp;
+ int i = 0;
+
+ if (xf86PciAccInfo == NULL)
+ return;
+
+ while ((paccp = xf86PciAccInfo[i]) != NULL) {
+ i++;
+ if (!paccp->ctrl)
+ continue;
+ savePciState(paccp->arg.tag, &paccp->restore);
+ restorePciState(paccp->arg.tag, &paccp->save);
+ }
+}
+
+void
+PciBusStateLeave(void)
+{
+ BusAccPtr pbap = xf86BusAccInfo;
+
+ while (pbap) {
+ if (pbap->restore_f)
+ pbap->restore_f(pbap);
+ pbap = pbap->next;
+ }
+}
+
+void
+DisablePciAccess(void)
+{
+ int i = 0;
+ pciAccPtr paccp;
+ if (xf86PciAccInfo == NULL)
+ return;
+
+ while ((paccp = xf86PciAccInfo[i]) != NULL) {
+ i++;
+ if (!paccp->ctrl) /* disable devices that are under control initially*/
+ continue;
+ pciIo_MemAccessDisable(paccp->io_memAccess.arg);
+ }
+}
+
+void
+DisablePciBusAccess(void)
+{
+ BusAccPtr pbap = xf86BusAccInfo;
+
+ while (pbap) {
+ if (pbap->disable_f)
+ pbap->disable_f(pbap);
+ if (pbap->primary)
+ pbap->primary->current = NULL;
+ pbap = pbap->next;
+ }
+}
+
+/*
+ * Public functions
+ */
+
+Bool
+xf86IsPciDevPresent(int bus, int dev, int func)
+{
+ int i = 0;
+ pciConfigPtr pcp;
+
+ while ((pcp = xf86PciInfo[i]) != NULL) {
+ if ((pcp->busnum == bus)
+ && (pcp->devnum == dev)
+ && (pcp->funcnum == func))
+ return TRUE;
+ i++;
+ }
+ return FALSE;
+}
+
+/*
+ * If the slot requested is already in use, return -1.
+ * Otherwise, claim the slot for the screen requesting it.
+ */
+
+int
+xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
+ int chipset, GDevPtr dev, Bool active)
+{
+ EntityPtr p = NULL;
+ pciAccPtr *ppaccp = xf86PciAccInfo;
+ BusAccPtr pbap = xf86BusAccInfo;
+
+ int num;
+
+ if (xf86CheckPciSlot(bus, device, func)) {
+ num = xf86AllocateEntity();
+ p = xf86Entities[num];
+ p->driver = drvp;
+ p->chipset = chipset;
+ p->busType = BUS_PCI;
+ p->pciBusId.bus = bus;
+ p->pciBusId.device = device;
+ p->pciBusId.func = func;
+ p->active = active;
+ p->inUse = FALSE;
+ if (dev)
+ xf86AddDevToEntity(num, dev);
+ /* Here we initialize the access structure */
+ p->access = xnfcalloc(1,sizeof(EntityAccessRec));
+ while (ppaccp && *ppaccp) {
+ if ((*ppaccp)->busnum == bus
+ && (*ppaccp)->devnum == device
+ && (*ppaccp)->funcnum == func) {
+ p->access->fallback = &(*ppaccp)->io_memAccess;
+ p->access->pAccess = &(*ppaccp)->io_memAccess;
+ (*ppaccp)->ctrl = TRUE; /* mark control if not already */
+ break;
+ }
+ ppaccp++;
+ }
+ if (!ppaccp || !*ppaccp) {
+ p->access->fallback = &AccessNULL;
+ p->access->pAccess = &AccessNULL;
+ }
+
+ p->busAcc = NULL;
+ while (pbap) {
+ if (pbap->type == BUS_PCI && pbap->busdep.pci.bus == bus)
+ p->busAcc = pbap;
+ pbap = pbap->next;
+ }
+ fixPciSizeInfo(num);
+
+ /* in case bios is enabled disable it */
+ disablePciBios(pciTag(bus,device,func));
+ pciSlotClaimed = TRUE;
+
+ if (active) {
+ /* Map in this domain's I/O space */
+ p->domainIO = xf86MapDomainIO(-1, VIDMEM_MMIO,
+ pciTag(bus, device, func), 0, 1);
+ }
+
+ return num;
+ } else
+ return -1;
+}
+
+/*
+ * Get xf86PciVideoInfo for a driver.
+ */
+pciVideoPtr *
+xf86GetPciVideoInfo(void)
+{
+ return xf86PciVideoInfo;
+}
+
+/* --- Used by ATI driver, but also more generally useful */
+
+/*
+ * Get the full xf86scanpci data.
+ */
+pciConfigPtr *
+xf86GetPciConfigInfo(void)
+{
+ return xf86PciInfo;
+}
+
+/*
+ * Enable a device and route VGA to it. This is intended for a driver's
+ * Probe(), before creating EntityRec's. Only one device can be thus enabled
+ * at any one time, and should be disabled when the driver is done with it.
+ *
+ * The following special calls are also available:
+ *
+ * pvp == NULL && rt == NONE disable previously enabled device
+ * pvp != NULL && rt == NONE ensure device is disabled
+ * pvp == NULL && rt != NONE disable >all< subsequent calls to this function
+ * (done from xf86PostProbe())
+ * The last combination has been removed! To do this cleanly we have
+ * to implement stages and need to test at each stage dependent function
+ * if it is allowed to execute.
+ *
+ * The device represented by pvp may not have been previously claimed.
+ */
+void
+xf86SetPciVideo(pciVideoPtr pvp, resType rt)
+{
+ static BusAccPtr pbap = NULL;
+ static xf86AccessPtr pAcc = NULL;
+ static Bool DoneProbes = FALSE;
+ pciAccPtr pcaccp;
+ int i;
+
+ if (DoneProbes)
+ return;
+
+ /* Disable previous access */
+ if (pAcc) {
+ if (pAcc->AccessDisable)
+ (*pAcc->AccessDisable)(pAcc->arg);
+ pAcc = NULL;
+ }
+ if (pbap) {
+ while (pbap->primary) {
+ if (pbap->disable_f)
+ (*pbap->disable_f)(pbap);
+ pbap->primary->current = NULL;
+ pbap = pbap->primary;
+ }
+ pbap = NULL;
+ }
+
+ /* Check for xf86PostProbe's magic combo */
+ if (!pvp) {
+ if (rt != NONE)
+ DoneProbes = TRUE;
+ return;
+ }
+
+ /* Validate device */
+ if (!xf86PciVideoInfo || !xf86PciAccInfo || !xf86BusAccInfo)
+ return;
+
+ for (i = 0; pvp != xf86PciVideoInfo[i]; i++)
+ if (!xf86PciVideoInfo[i])
+ return;
+
+ /* Ignore request for claimed adapters */
+ if (!xf86CheckPciSlot(pvp->bus, pvp->device, pvp->func))
+ return;
+
+ /* Find pciAccRec structure */
+ for (i = 0; ; i++) {
+ if (!(pcaccp = xf86PciAccInfo[i]))
+ return;
+ if ((pvp->bus == pcaccp->busnum) &&
+ (pvp->device == pcaccp->devnum) &&
+ (pvp->func == pcaccp->funcnum))
+ break;
+ }
+
+ if (rt == NONE) {
+ /* This is a call to ensure the adapter is disabled */
+ if (pcaccp->io_memAccess.AccessDisable)
+ (*pcaccp->io_memAccess.AccessDisable)(pcaccp->io_memAccess.arg);
+ return;
+ }
+
+ /* Find BusAccRec structure */
+ for (pbap = xf86BusAccInfo; ; pbap = pbap->next) {
+ if (!pbap)
+ return;
+ if (pvp->bus == pbap->busdep.pci.bus)
+ break;
+ }
+
+ /* Route VGA */
+ if (pbap->set_f)
+ (*pbap->set_f)(pbap);
+
+ /* Enable device */
+ switch (rt) {
+ case IO:
+ pAcc = &pcaccp->ioAccess;
+ break;
+ case MEM_IO:
+ pAcc = &pcaccp->io_memAccess;
+ break;
+ case MEM:
+ pAcc = &pcaccp->memAccess;
+ break;
+ default: /* no compiler noise */
+ break;
+ }
+
+ if (pAcc && pAcc->AccessEnable)
+ (*pAcc->AccessEnable)(pAcc->arg);
+}
+
+/*
+ * Parse a BUS ID string, and return the PCI bus parameters if it was
+ * in the correct format for a PCI bus id.
+ */
+
+Bool
+xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func)
+{
+ /*
+ * The format is assumed to be "bus[@domain]:device[:func]", where domain,
+ * bus, device and func are decimal integers. domain and func may be
+ * omitted and assumed to be zero, although doing this isn't encouraged.
+ */
+
+ char *p, *s, *d;
+ const char *id;
+ int i;
+
+ if (StringToBusType(busID, &id) != BUS_PCI)
+ return FALSE;
+
+ s = xstrdup(id);
+ p = strtok(s, ":");
+ if (p == NULL || *p == 0) {
+ xfree(s);
+ return FALSE;
+ }
+ d = strpbrk(p, "@");
+ if (d != NULL) {
+ *(d++) = 0;
+ for (i = 0; d[i] != 0; i++) {
+ if (!isdigit(d[i])) {
+ xfree(s);
+ return FALSE;
+ }
+ }
+ }
+ for (i = 0; p[i] != 0; i++) {
+ if (!isdigit(p[i])) {
+ xfree(s);
+ return FALSE;
+ }
+ }
+ *bus = atoi(p);
+ if (d != NULL && *d != 0)
+ *bus += atoi(d) << 8;
+ p = strtok(NULL, ":");
+ if (p == NULL || *p == 0) {
+ xfree(s);
+ return FALSE;
+ }
+ for (i = 0; p[i] != 0; i++) {
+ if (!isdigit(p[i])) {
+ xfree(s);
+ return FALSE;
+ }
+ }
+ *device = atoi(p);
+ *func = 0;
+ p = strtok(NULL, ":");
+ if (p == NULL || *p == 0) {
+ xfree(s);
+ return TRUE;
+ }
+ for (i = 0; p[i] != 0; i++) {
+ if (!isdigit(p[i])) {
+ xfree(s);
+ return FALSE;
+ }
+ }
+ *func = atoi(p);
+ xfree(s);
+ return TRUE;
+}
+
+/*
+ * Compare a BUS ID string with a PCI bus id. Return TRUE if they match.
+ */
+
+Bool
+xf86ComparePciBusString(const char *busID, int bus, int device, int func)
+{
+ int ibus, idevice, ifunc;
+
+ if (xf86ParsePciBusString(busID, &ibus, &idevice, &ifunc)) {
+ return bus == ibus && device == idevice && func == ifunc;
+ } else {
+ return FALSE;
+ }
+}
+
+/*
+ * xf86IsPrimaryPci() -- return TRUE if primary device
+ * is PCI and bus, dev and func numbers match.
+ */
+
+Bool
+xf86IsPrimaryPci(pciVideoPtr pPci)
+{
+ if (primaryBus.type != BUS_PCI) return FALSE;
+ return (pPci->bus == primaryBus.id.pci.bus &&
+ pPci->device == primaryBus.id.pci.device &&
+ pPci->func == primaryBus.id.pci.func);
+}
+
+/*
+ * xf86CheckPciGAType() -- return type of PCI graphics adapter.
+ */
+int
+xf86CheckPciGAType(pciVideoPtr pPci)
+{
+ int i = 0;
+ pciConfigPtr pcp;
+
+ while ((pcp = xf86PciInfo[i]) != NULL) {
+ if (pPci->bus == pcp->busnum && pPci->device == pcp->devnum
+ && pPci->func == pcp->funcnum) {
+ if (pcp->pci_base_class == PCI_CLASS_PREHISTORIC &&
+ pcp->pci_sub_class == PCI_SUBCLASS_PREHISTORIC_VGA)
+ return PCI_CHIP_VGA ;
+ if (pcp->pci_base_class == PCI_CLASS_DISPLAY &&
+ pcp->pci_sub_class == PCI_SUBCLASS_DISPLAY_VGA) {
+ if (pcp->pci_prog_if == 0)
+ return PCI_CHIP_VGA ;
+ if (pcp->pci_prog_if == 1)
+ return PCI_CHIP_8514;
+ }
+ return -1;
+ }
+ i++;
+ }
+ return -1;
+}
+
+/*
+ * xf86GetPciInfoForEntity() -- Get the pciVideoRec of entity.
+ */
+pciVideoPtr
+xf86GetPciInfoForEntity(int entityIndex)
+{
+ pciVideoPtr *ppPci;
+ EntityPtr p = xf86Entities[entityIndex];
+
+ if (entityIndex >= xf86NumEntities
+ || p->busType != BUS_PCI) return NULL;
+
+ for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) {
+ if (p->pciBusId.bus == (*ppPci)->bus &&
+ p->pciBusId.device == (*ppPci)->device &&
+ p->pciBusId.func == (*ppPci)->func)
+ return (*ppPci);
+ }
+ return NULL;
+}
+
+int
+xf86GetPciEntity(int bus, int dev, int func)
+{
+ int i;
+
+ for (i = 0; i < xf86NumEntities; i++) {
+ EntityPtr p = xf86Entities[i];
+ if (p->busType != BUS_PCI) continue;
+
+ if (p->pciBusId.bus == bus &&
+ p->pciBusId.device == dev &&
+ p->pciBusId.func == func)
+ return i;
+ }
+ return -1;
+}
+
+/*
+ * xf86CheckPciMemBase() checks that the memory base value matches one of the
+ * PCI base address register values for the given PCI device.
+ */
+Bool
+xf86CheckPciMemBase(pciVideoPtr pPci, memType base)
+{
+ int i;
+
+ for (i = 0; i < 6; i++)
+ if (base == pPci->memBase[i])
+ return TRUE;
+ return FALSE;
+}
+
+/*
+ * Check if the slot requested is free. If it is already in use, return FALSE.
+ */
+
+Bool
+xf86CheckPciSlot(int bus, int device, int func)
+{
+ int i;
+ EntityPtr p;
+
+ for (i = 0; i < xf86NumEntities; i++) {
+ p = xf86Entities[i];
+ /* Check if this PCI slot is taken */
+ if (p->busType == BUS_PCI && p->pciBusId.bus == bus &&
+ p->pciBusId.device == device && p->pciBusId.func == func)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * This used to load the scanpci module. The pcidata module is now used
+ * (which the server always loads early). The main difference between the
+ * two modules is size, and the scanpci module should only ever be loaded
+ * when the X server is run with the -scanpci flag.
+ *
+ * To make sure that the required information is present in the pcidata
+ * module, add a PCI_VENDOR_* macro for the relevant vendor to xf86PciInfo.h,
+ * and add the class override data to ../etc/extrapci.ids.
+ */
+
+static void
+getPciClassFlags(pciConfigPtr *pcrpp)
+{
+ pciConfigPtr pcrp;
+ int i = 0;
+
+ if (!pcrpp)
+ return;
+ while ((pcrp = pcrpp[i])) {
+ if (!(pcrp->listed_class =
+ xf86FindPciClassBySubsys(pcrp->pci_subsys_vendor,
+ pcrp->pci_subsys_card))) {
+ pcrp->listed_class =
+ xf86FindPciClassByDevice(pcrp->pci_vendor, pcrp->pci_device);
+ }
+ i++;
+ }
+}
+
+/*
+ * xf86FindPciVendorDevice() xf86FindPciClass(): These functions
+ * are meant to be used by the pci bios emulation. Some bioses
+ * need to see if there are _other_ chips of the same type around
+ * so by setting pvp_exclude one pci device can be explicitely
+ * _excluded if required.
+ */
+pciVideoPtr
+xf86FindPciDeviceVendor(CARD16 vendorID, CARD16 deviceID,
+ char n, pciVideoPtr pvp_exclude)
+{
+ pciVideoPtr pvp, *ppvp;
+ n++;
+
+ for (ppvp = xf86PciVideoInfo, pvp =*ppvp; pvp ; pvp = *(++ppvp)) {
+ if (pvp == pvp_exclude) continue;
+ if ((pvp->vendor == vendorID) && (pvp->chipType == deviceID)) {
+ if (!(--n)) break;
+ }
+ }
+ return pvp;
+}
+
+pciVideoPtr
+xf86FindPciClass(CARD8 intf, CARD8 subClass, CARD16 class,
+ char n, pciVideoPtr pvp_exclude)
+{
+ pciVideoPtr pvp, *ppvp;
+ n++;
+
+ for (ppvp = xf86PciVideoInfo, pvp =*ppvp; pvp ; pvp = *(++ppvp)) {
+ if (pvp == pvp_exclude) continue;
+ if ((pvp->interface == intf) && (pvp->subclass == subClass)
+ && (pvp->class == class)) {
+ if (!(--n)) break;
+ }
+ }
+ return pvp;
+}
+
+/*
+ * This attempts to detect a multi-device card and sets up a list
+ * of pci tags of the devices of this card. On some of these
+ * cards the BIOS is not visible from all chipsets. We therefore
+ * need to use the BIOS from a chipset where it is visible.
+ * We do the following heuristics:
+ * If we detect only identical pci devices on a bus we assume it's
+ * a multi-device card. This assumption isn't true always, however.
+ * One might just use identical cards on a bus. We therefore don't
+ * detect this situation when we set up the PCI video info. Instead
+ * we wait until an attempt to read the BIOS fails.
+ */
+int
+pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag)
+{
+ pciConfigPtr *ppcrp = xf86PciInfo;
+ pciConfigPtr pcrp = NULL;
+ int i,j;
+ Bool multicard = FALSE;
+ Bool multifunc = FALSE;
+ char str[256];
+ char *str1;
+
+ str1 = str;
+ if (!pTag)
+ return 0;
+
+ *pTag = NULL;
+
+ for (i=0; i < 8; i++) {
+ j = 0;
+
+ while (ppcrp[j]) {
+ if (ppcrp[j]->busnum == bus && ppcrp[j]->funcnum == i) {
+ pcrp = ppcrp[j];
+ break;
+ }
+ j++;
+ }
+
+ if (!pcrp) return 0;
+
+ /*
+ * we check all functions here: since multifunc devices need
+ * to implement func 0 we catch all devices on the bus when
+ * i = 0
+ */
+ if (pcrp->pci_header_type &0x80)
+ multifunc = TRUE;
+
+ j = 0;
+
+ while (ppcrp[j]) {
+ if (ppcrp[j]->busnum == bus && ppcrp[j]->funcnum == i
+ && ppcrp[j]->devnum != pcrp->devnum) {
+ /* don't test subsys ID here. It might be set by POST
+ - however some cards might not have been POSTed */
+ if (ppcrp[j]->pci_device_vendor != pcrp->pci_device_vendor
+ || ppcrp[j]->pci_header_type != pcrp->pci_header_type )
+ return 0;
+ else
+ multicard = TRUE;
+ }
+ j++;
+ }
+ if (!multifunc)
+ break;
+ }
+
+ if (!multicard)
+ return 0;
+
+ j = 0;
+ i = 0;
+ while (ppcrp[i]) {
+ if (ppcrp[i]->busnum == bus && ppcrp[i]->funcnum == func) {
+ str1 += sprintf(str1,"[%x:%x:%x]",ppcrp[i]->busnum,
+ ppcrp[i]->devnum,ppcrp[i]->funcnum);
+ *pTag = xnfrealloc(*pTag,sizeof(PCITAG) * (j + 1));
+ (*pTag)[j++] = pciTag(ppcrp[i]->busnum,
+ ppcrp[i]->devnum,ppcrp[i]->funcnum);
+ }
+ i++;
+ }
+ xf86MsgVerb(X_INFO,3,"Multi Device Card detected: %s\n",str);
+ return j;
+}
+
+static void
+pciTagConvertRange2Host(PCITAG tag, resRange *pRange)
+{
+ if (!(pRange->type & ResBus))
+ return;
+
+ switch(pRange->type & ResPhysMask) {
+ case ResMem:
+ switch(pRange->type & ResExtMask) {
+ case ResBlock:
+ pRange->rBegin = pciBusAddrToHostAddr(tag,PCI_MEM, pRange->rBegin);
+ pRange->rEnd = pciBusAddrToHostAddr(tag,PCI_MEM, pRange->rEnd);
+ break;
+ case ResSparse:
+ pRange->rBase = pciBusAddrToHostAddr(tag,PCI_MEM_SPARSE_BASE,
+ pRange->rBegin);
+ pRange->rMask = pciBusAddrToHostAddr(tag,PCI_MEM_SPARSE_MASK,
+ pRange->rEnd);
+ break;
+ }
+ break;
+ case ResIo:
+ switch(pRange->type & ResExtMask) {
+ case ResBlock:
+ pRange->rBegin = pciBusAddrToHostAddr(tag,PCI_IO, pRange->rBegin);
+ pRange->rEnd = pciBusAddrToHostAddr(tag,PCI_IO, pRange->rEnd);
+ break;
+ case ResSparse:
+ pRange->rBase = pciBusAddrToHostAddr(tag,PCI_IO_SPARSE_BASE
+ , pRange->rBegin);
+ pRange->rMask = pciBusAddrToHostAddr(tag,PCI_IO_SPARSE_MASK
+ , pRange->rEnd);
+ break;
+ }
+ break;
+ }
+
+ /* Set domain number */
+ pRange->type &= ~(ResDomain | ResBus);
+ pRange->type |= xf86GetPciDomain(tag) << 24;
+}
+
+static void
+pciConvertListToHost(int bus, int dev, int func, resPtr list)
+{
+ PCITAG tag = pciTag(bus,dev,func);
+ while (list) {
+ pciTagConvertRange2Host(tag, &list->val);
+ list = list->next;
+ }
+}
+
+static void
+updateAccessInfoStatusControlInfo(PCITAG tag, CARD32 ctrl)
+{
+ int i;
+
+ if (!xf86PciAccInfo)
+ return;
+
+ for (i = 0; xf86PciAccInfo[i] != NULL; i++) {
+ if (xf86PciAccInfo[i]->arg.tag == tag)
+ xf86PciAccInfo[i]->arg.ctrl = ctrl;
+ }
+}
+
+void
+pciConvertRange2Host(int entityIndex, resRange *pRange)
+{
+ PCITAG tag;
+ pciVideoPtr pvp;
+
+ pvp = xf86GetPciInfoForEntity(entityIndex);
+ if (!pvp) return;
+ tag = TAG(pvp);
+ pciTagConvertRange2Host(tag, pRange);
+}
+
+
+#ifdef INCLUDE_DEPRECATED
+void
+xf86EnablePciBusMaster(pciVideoPtr pPci, Bool enable)
+{
+ CARD32 temp;
+ PCITAG tag;
+
+ if (!pPci) return;
+
+ tag = pciTag(pPci->bus, pPci->device, pPci->func);
+ temp = pciReadLong(tag, PCI_CMD_STAT_REG);
+ if (enable) {
+ updateAccessInfoStatusControlInfo(tag, temp | PCI_CMD_MASTER_ENABLE);
+ pciWriteLong(tag, PCI_CMD_STAT_REG, temp | PCI_CMD_MASTER_ENABLE);
+ } else {
+ updateAccessInfoStatusControlInfo(tag, temp & ~PCI_CMD_MASTER_ENABLE);
+ pciWriteLong(tag, PCI_CMD_STAT_REG, temp & ~PCI_CMD_MASTER_ENABLE);
+ }
+}
+#endif /* INCLUDE_DEPRECATED */
diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h
new file mode 100644
index 000000000..fbe3fbe62
--- /dev/null
+++ b/hw/xfree86/common/xf86pciBus.h
@@ -0,0 +1,72 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.8 2002/09/16 16:55:33 tsi Exp $ */
+
+#ifndef _XF86_PCI_BUS_H
+#define _XF86_PCI_BUS_H
+
+#define PCITAG_SPECIAL pciTag(0xFF,0xFF,0xFF)
+
+typedef struct {
+ CARD32 command;
+ CARD32 base[6];
+ CARD32 biosBase;
+} pciSave, *pciSavePtr;
+
+typedef void (*SetBitsProcPtr)(PCITAG, int, CARD32, CARD32);
+typedef void (*WriteProcPtr)(PCITAG, int, CARD32);
+
+typedef struct {
+ PCITAG tag;
+ WriteProcPtr func;
+ CARD32 ctrl;
+} pciArg;
+
+typedef struct {
+ int busnum;
+ int devnum;
+ int funcnum;
+ pciArg arg;
+ xf86AccessRec ioAccess;
+ xf86AccessRec io_memAccess;
+ xf86AccessRec memAccess;
+ pciSave save;
+ pciSave restore;
+ Bool ctrl;
+} pciAccRec, *pciAccPtr;
+
+typedef union {
+ CARD16 control;
+} pciBridgesSave, *pciBridgesSavePtr;
+
+typedef struct pciBusRec {
+ int brbus, brdev, brfunc; /* ID of the bridge to this bus */
+ int primary, secondary, subordinate;
+ int subclass; /* bridge type */
+ int interface;
+ resPtr preferred_io; /* I/O range */
+ resPtr preferred_mem; /* non-prefetchable memory range */
+ resPtr preferred_pmem; /* prefetchable memory range */
+ resPtr io; /* for subtractive PCI-PCI bridges */
+ resPtr mem;
+ resPtr pmem;
+ int brcontrol; /* bridge_control byte */
+ struct pciBusRec *next;
+} PciBusRec, *PciBusPtr;
+
+void xf86PciProbe(void);
+void ValidatePci(void);
+resList GetImplicitPciResources(int entityIndex);
+void initPciState(void);
+void initPciBusState(void);
+void DisablePciAccess(void);
+void DisablePciBusAccess(void);
+void PciStateEnter(void);
+void PciBusStateEnter(void);
+void PciStateLeave(void);
+void PciBusStateLeave(void);
+resPtr ResourceBrokerInitPci(resPtr *osRes);
+void pciConvertRange2Host(int entityIndex, resRange *pRange);
+void isaConvertRange2Host(resRange *pRange);
+
+extern pciAccPtr * xf86PciAccInfo;
+
+#endif /* _XF86_PCI_BUS_H */
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
new file mode 100644
index 000000000..87042cb14
--- /dev/null
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -0,0 +1,705 @@
+/*
+ * SBUS bus-specific code.
+ *
+ * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
+ *
+ * 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
+ * JAKUB JELINEK 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c,v 3.7 2001/10/28 03:33:19 tsi Exp $ */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86Resources.h"
+#include "xf86cmap.h"
+
+#include "xf86Bus.h"
+
+#include "xf86sbusBus.h"
+#include "xf86Sbus.h"
+
+Bool sbusSlotClaimed = FALSE;
+
+static int xf86nSbusInfo;
+
+static void
+CheckSbusDevice(const char *device, int fbNum)
+{
+ int fd, i;
+ struct fbgattr fbattr;
+ sbusDevicePtr psdp;
+
+ fd = open(device, O_RDONLY, 0);
+ if (fd < 0)
+ return;
+ memset(&fbattr, 0, sizeof(fbattr));
+ if (ioctl(fd, FBIOGATTR, &fbattr) < 0) {
+ if (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0) {
+ close(fd);
+ return;
+ }
+ }
+ close(fd);
+ for (i = 0; sbusDeviceTable[i].devId; i++)
+ if (sbusDeviceTable[i].fbType == fbattr.fbtype.fb_type)
+ break;
+ if (! sbusDeviceTable[i].devId)
+ return;
+ xf86SbusInfo = xnfrealloc(xf86SbusInfo, sizeof(psdp) * (++xf86nSbusInfo + 1));
+ xf86SbusInfo[xf86nSbusInfo] = NULL;
+ xf86SbusInfo[xf86nSbusInfo - 1] = psdp = xnfcalloc(sizeof (sbusDevice), 1);
+ psdp->devId = sbusDeviceTable[i].devId;
+ psdp->fbNum = fbNum;
+ psdp->device = xnfstrdup(device);
+ psdp->width = fbattr.fbtype.fb_width;
+ psdp->height = fbattr.fbtype.fb_height;
+ psdp->fd = -1;
+}
+
+void
+xf86SbusProbe(void)
+{
+ int i, useProm = 0;
+ char fbDevName[32];
+ sbusDevicePtr psdp, *psdpp;
+
+ xf86SbusInfo = xalloc(sizeof(psdp));
+ *xf86SbusInfo = NULL;
+ for (i = 0; i < 32; i++) {
+ sprintf(fbDevName, "/dev/fb%d", i);
+ CheckSbusDevice(fbDevName, i);
+ }
+ if (sparcPromInit() >= 0) {
+ useProm = 1;
+ sparcPromAssignNodes();
+ }
+ for (psdpp = xf86SbusInfo; (psdp = *psdpp); psdpp++) {
+ for (i = 0; sbusDeviceTable[i].devId; i++)
+ if (sbusDeviceTable[i].devId == psdp->devId)
+ psdp->descr = sbusDeviceTable[i].descr;
+ /*
+ * If we can use PROM information and found the PROM node for this
+ * device, we can tell more about the card.
+ */
+ if (useProm && psdp->node.node) {
+ char *prop, *promPath;
+ int len, chiprev, vmsize;
+
+ switch (psdp->devId) {
+ case SBUS_DEVICE_MGX:
+ prop = sparcPromGetProperty(&psdp->node, "fb_size", &len);
+ if (prop && len == 4 && *(int *)prop == 0x400000)
+ psdp->descr = "Quantum 3D MGXplus with 4M VRAM";
+ break;
+ case SBUS_DEVICE_CG6:
+ chiprev = 0;
+ vmsize = 0;
+ prop = sparcPromGetProperty(&psdp->node, "chiprev", &len);
+ if (prop && len == 4)
+ chiprev = *(int *)prop;
+ prop = sparcPromGetProperty(&psdp->node, "vmsize", &len);
+ if (prop && len == 4)
+ vmsize = *(int *)prop;
+ switch (chiprev) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ psdp->descr = "Sun Double width GX"; break;
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ psdp->descr = "Sun Single width GX"; break;
+ case 11:
+ switch (vmsize) {
+ case 2:
+ psdp->descr = "Sun Turbo GX with 1M VSIMM"; break;
+ case 4:
+ psdp->descr = "Sun Turbo GX Plus"; break;
+ default:
+ psdp->descr = "Sun Turbo GX"; break;
+ }
+ }
+ break;
+ case SBUS_DEVICE_CG14:
+ prop = sparcPromGetProperty(&psdp->node, "reg", &len);
+ vmsize = 0;
+ if (prop && !(len % 12) && len > 0)
+ vmsize = *(int *)(prop + len - 4);
+ switch (vmsize) {
+ case 0x400000:
+ psdp->descr = "Sun SX with 4M VSIMM"; break;
+ case 0x800000:
+ psdp->descr = "Sun SX with 8M VSIMM"; break;
+ }
+ break;
+ case SBUS_DEVICE_LEO:
+ prop = sparcPromGetProperty(&psdp->node, "model", &len);
+ if (prop && len > 0 && !strstr(prop, "501-2503"))
+ psdp->descr = "Sun Turbo ZX";
+ break;
+ case SBUS_DEVICE_TCX:
+ if (sparcPromGetBool(&psdp->node, "tcx-8-bit"))
+ psdp->descr = "Sun TCX (8bit)";
+ else
+ psdp->descr = "Sun TCX (S24)";
+ break;
+ case SBUS_DEVICE_FFB:
+ prop = sparcPromGetProperty(&psdp->node, "name", &len);
+ chiprev = 0;
+ prop = sparcPromGetProperty(&psdp->node, "board_type", &len);
+ if (prop && len == 4)
+ chiprev = *(int *)prop;
+ if (strstr (prop, "afb")) {
+ if (chiprev == 3)
+ psdp->descr = "Sun|Elite3D-M6 Horizontal";
+ } else {
+ switch (chiprev) {
+ case 0x08:
+ psdp->descr = "Sun FFB 67MHz Creator"; break;
+ case 0x0b:
+ psdp->descr = "Sun FFB 67MHz Creator 3D"; break;
+ case 0x1b:
+ psdp->descr = "Sun FFB 75MHz Creator 3D"; break;
+ case 0x20:
+ case 0x28:
+ psdp->descr = "Sun FFB2 Vertical Creator"; break;
+ case 0x23:
+ case 0x2b:
+ psdp->descr = "Sun FFB2 Vertical Creator 3D"; break;
+ case 0x30:
+ psdp->descr = "Sun FFB2+ Vertical Creator"; break;
+ case 0x33:
+ psdp->descr = "Sun FFB2+ Vertical Creator 3D"; break;
+ case 0x40:
+ case 0x48:
+ psdp->descr = "Sun FFB2 Horizontal Creator"; break;
+ case 0x43:
+ case 0x4b:
+ psdp->descr = "Sun FFB2 Horizontal Creator 3D"; break;
+ }
+ }
+ break;
+ }
+
+ xf86Msg(X_PROBED, "SBUS:(0x%08x) %s", psdp->node.node, psdp->descr);
+ promPath = sparcPromNode2Pathname (&psdp->node);
+ if (promPath) {
+ xf86ErrorF(" at %s", promPath);
+ xfree(promPath);
+ }
+ } else
+ xf86Msg(X_PROBED, "SBUS: %s", psdp->descr);
+ xf86ErrorF("\n");
+ }
+ if (useProm)
+ sparcPromClose();
+}
+
+/*
+ * Parse a BUS ID string, and return the SBUS bus parameters if it was
+ * in the correct format for a SBUS bus id.
+ */
+
+Bool
+xf86ParseSbusBusString(const char *busID, int *fbNum)
+{
+ /*
+ * The format is assumed to be one of:
+ * "fbN", e.g. "fb1", which means the device corresponding to /dev/fbN
+ * "nameN", e.g. "cgsix0", which means Nth instance of card NAME
+ * "/prompath", e.g. "/sbus@0,10001000/cgsix@3,0" which is PROM pathname
+ * to the device.
+ */
+
+ const char *id;
+ int i, len;
+
+ if (StringToBusType(busID, &id) != BUS_SBUS)
+ return FALSE;
+
+ if (*id != '/') {
+ if (!strncmp (id, "fb", 2)) {
+ if (!isdigit(id[2]))
+ return FALSE;
+ *fbNum = atoi(id + 2);
+ return TRUE;
+ } else {
+ sbusDevicePtr *psdpp;
+ int devId;
+
+ for (i = 0, len = 0; sbusDeviceTable[i].devId; i++) {
+ len = strlen(sbusDeviceTable[i].promName);
+ if (!strncmp (sbusDeviceTable[i].promName, id, len)
+ && isdigit(id[len]))
+ break;
+ }
+ devId = sbusDeviceTable[i].devId;
+ if (!devId) return FALSE;
+ i = atoi(id + len);
+ for (psdpp = xf86SbusInfo; *psdpp; ++psdpp) {
+ if ((*psdpp)->devId != devId)
+ continue;
+ if (!i) {
+ *fbNum = (*psdpp)->fbNum;
+ return TRUE;
+ }
+ i--;
+ }
+ }
+ return FALSE;
+ }
+
+ if (sparcPromInit() >= 0) {
+ i = sparcPromPathname2Node(id);
+ sparcPromClose();
+ if (i) {
+ sbusDevicePtr *psdpp;
+ for (psdpp = xf86SbusInfo; *psdpp; ++psdpp) {
+ if ((*psdpp)->node.node == i) {
+ *fbNum = (*psdpp)->fbNum;
+ return TRUE;
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * Compare a BUS ID string with a SBUS bus id. Return TRUE if they match.
+ */
+
+Bool
+xf86CompareSbusBusString(const char *busID, int fbNum)
+{
+ int iFbNum;
+
+ if (xf86ParseSbusBusString(busID, &iFbNum)) {
+ return fbNum == iFbNum;
+ } else {
+ return FALSE;
+ }
+}
+
+/*
+ * Check if the slot requested is free. If it is already in use, return FALSE.
+ */
+
+Bool
+xf86CheckSbusSlot(int fbNum)
+{
+ int i;
+ EntityPtr p;
+
+ for (i = 0; i < xf86NumEntities; i++) {
+ p = xf86Entities[i];
+ /* Check if this SBUS slot is taken */
+ if (p->busType == BUS_SBUS && p->sbusBusId.fbNum == fbNum)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * If the slot requested is already in use, return -1.
+ * Otherwise, claim the slot for the screen requesting it.
+ */
+
+int
+xf86ClaimSbusSlot(sbusDevicePtr psdp, DriverPtr drvp,
+ GDevPtr dev, Bool active)
+{
+ EntityPtr p = NULL;
+
+ int num;
+
+ if (xf86CheckSbusSlot(psdp->fbNum)) {
+ num = xf86AllocateEntity();
+ p = xf86Entities[num];
+ p->driver = drvp;
+ p->chipset = -1;
+ p->busType = BUS_SBUS;
+ xf86AddDevToEntity(num, dev);
+ p->sbusBusId.fbNum = psdp->fbNum;
+ p->active = active;
+ p->inUse = FALSE;
+ /* Here we initialize the access structure */
+ p->access = xnfcalloc(1,sizeof(EntityAccessRec));
+ p->access->fallback = &AccessNULL;
+ p->access->pAccess = &AccessNULL;
+ sbusSlotClaimed = TRUE;
+ return num;
+ } else
+ return -1;
+}
+
+int
+xf86MatchSbusInstances(const char *driverName, int sbusDevId,
+ GDevPtr *devList, int numDevs, DriverPtr drvp,
+ int **foundEntities)
+{
+ int i,j;
+ sbusDevicePtr psdp, *psdpp;
+ int numClaimedInstances = 0;
+ int allocatedInstances = 0;
+ int numFound = 0;
+ GDevPtr devBus = NULL;
+ GDevPtr dev = NULL;
+ int *retEntities = NULL;
+ int useProm = 0;
+
+ struct Inst {
+ sbusDevicePtr sbus;
+ GDevPtr dev;
+ Bool claimed; /* BusID matches with a device section */
+ } *instances = NULL;
+
+ *foundEntities = NULL;
+ for (psdpp = xf86SbusInfo, psdp = *psdpp; psdp; psdp = *++psdpp) {
+ if (psdp->devId != sbusDevId)
+ continue;
+ if (psdp->fd == -2)
+ continue;
+ ++allocatedInstances;
+ instances = xnfrealloc(instances,
+ allocatedInstances * sizeof(struct Inst));
+ instances[allocatedInstances - 1].sbus = psdp;
+ instances[allocatedInstances - 1].dev = NULL;
+ instances[allocatedInstances - 1].claimed = FALSE;
+ numFound++;
+ }
+
+ /*
+ * This may be debatable, but if no SBUS devices with a matching vendor
+ * type is found, return zero now. It is probably not desirable to
+ * allow the config file to override this.
+ */
+ if (allocatedInstances <= 0) {
+ xfree(instances);
+ return 0;
+ }
+
+ if (xf86DoProbe) {
+ xfree(instances);
+ return numFound;
+ }
+
+ if (sparcPromInit() >= 0)
+ useProm = 1;
+
+ if (xf86DoConfigure && xf86DoConfigurePass1) {
+ GDevPtr pGDev;
+ int actualcards = 0;
+ for (i = 0; i < allocatedInstances; i++) {
+ actualcards++;
+ pGDev = xf86AddBusDeviceToConfigure(drvp->driverName, BUS_SBUS,
+ instances[i].sbus, -1);
+ if (pGDev) {
+ /*
+ * XF86Match???Instances() treat chipID and chipRev as
+ * overrides, so clobber them here.
+ */
+ pGDev->chipID = pGDev->chipRev = -1;
+ }
+ }
+ xfree(instances);
+ if (useProm)
+ sparcPromClose();
+ return actualcards;
+ }
+
+#ifdef DEBUG
+ ErrorF("%s instances found: %d\n", driverName, allocatedInstances);
+#endif
+
+ for (i = 0; i < allocatedInstances; i++) {
+ char *promPath = NULL;
+
+ psdp = instances[i].sbus;
+ devBus = NULL;
+ dev = NULL;
+ if (useProm && psdp->node.node)
+ promPath = sparcPromNode2Pathname(&psdp->node);
+
+ for (j = 0; j < numDevs; j++) {
+ if (devList[j]->busID && *devList[j]->busID) {
+ if (xf86CompareSbusBusString(devList[j]->busID, psdp->fbNum)) {
+ if (devBus)
+ xf86MsgVerb(X_WARNING,0,
+ "%s: More than one matching Device section for "
+ "instance (BusID: %s) found: %s\n",
+ driverName,devList[j]->identifier,
+ devList[j]->busID);
+ else
+ devBus = devList[j];
+ }
+ } else {
+ if (!dev && !devBus) {
+ if (promPath)
+ xf86Msg(X_PROBED, "Assigning device section with no busID to SBUS:%s\n",
+ promPath);
+ else
+ xf86Msg(X_PROBED, "Assigning device section with no busID to SBUS:fb%d\n",
+ psdp->fbNum);
+ dev = devList[j];
+ } else
+ xf86MsgVerb(X_WARNING, 0,
+ "%s: More than one matching Device section "
+ "found: %s\n", driverName, devList[j]->identifier);
+ }
+ }
+ if (devBus) dev = devBus; /* busID preferred */
+ if (!dev && psdp->fd != -2) {
+ if (promPath) {
+ xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
+ "for instance (BusID SBUS:%s) found\n",
+ driverName, promPath);
+ } else
+ xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
+ "for instance (BusID SBUS:fb%d) found\n",
+ driverName, psdp->fbNum);
+ } else if (dev) {
+ numClaimedInstances++;
+ instances[i].claimed = TRUE;
+ instances[i].dev = dev;
+ }
+ if (promPath)
+ xfree(promPath);
+ }
+
+#ifdef DEBUG
+ ErrorF("%s instances found: %d\n", driverName, numClaimedInstances);
+#endif
+
+ /*
+ * Of the claimed instances, check that another driver hasn't already
+ * claimed its slot.
+ */
+ numFound = 0;
+ for (i = 0; i < allocatedInstances && numClaimedInstances > 0; i++) {
+ if (!instances[i].claimed)
+ continue;
+ psdp = instances[i].sbus;
+ if (!xf86CheckSbusSlot(psdp->fbNum))
+ continue;
+
+#ifdef DEBUG
+ ErrorF("%s: card at fb%d %08x is claimed by a Device section\n",
+ driverName, psdp->fbNum, psdp->node.node);
+#endif
+
+ /* Allocate an entry in the lists to be returned */
+ numFound++;
+ retEntities = xnfrealloc(retEntities, numFound * sizeof(int));
+ retEntities[numFound - 1]
+ = xf86ClaimSbusSlot(psdp, drvp, instances[i].dev,instances[i].dev->active ?
+ TRUE : FALSE);
+ }
+ xfree(instances);
+ if (numFound > 0) {
+ *foundEntities = retEntities;
+ }
+
+ if (useProm)
+ sparcPromClose();
+
+ return numFound;
+}
+
+/*
+ * xf86GetSbusInfoForEntity() -- Get the sbusDevicePtr of entity.
+ */
+sbusDevicePtr
+xf86GetSbusInfoForEntity(int entityIndex)
+{
+ sbusDevicePtr *psdpp;
+ EntityPtr p = xf86Entities[entityIndex];
+
+ if (entityIndex >= xf86NumEntities
+ || p->busType != BUS_SBUS) return NULL;
+
+ for (psdpp = xf86SbusInfo; *psdpp != NULL; psdpp++) {
+ if (p->sbusBusId.fbNum == (*psdpp)->fbNum)
+ return (*psdpp);
+ }
+ return NULL;
+}
+
+int
+xf86GetEntityForSbusInfo(sbusDevicePtr psdp)
+{
+ int i;
+
+ for (i = 0; i < xf86NumEntities; i++) {
+ EntityPtr p = xf86Entities[i];
+ if (p->busType != BUS_SBUS) continue;
+
+ if (p->sbusBusId.fbNum == psdp->fbNum)
+ return i;
+ }
+ return -1;
+}
+
+void
+xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp)
+{
+ DisplayModePtr mode;
+
+ mode = xnfcalloc(sizeof(DisplayModeRec), 1);
+ mode->name = "current";
+ mode->next = mode;
+ mode->prev = mode;
+ mode->type = M_T_BUILTIN;
+ mode->Clock = 100000000;
+ mode->HDisplay = psdp->width;
+ mode->HSyncStart = psdp->width;
+ mode->HSyncEnd = psdp->width;
+ mode->HTotal = psdp->width;
+ mode->VDisplay = psdp->height;
+ mode->VSyncStart = psdp->height;
+ mode->VSyncEnd = psdp->height;
+ mode->VTotal = psdp->height;
+ mode->SynthClock = mode->Clock;
+ mode->CrtcHDisplay = mode->HDisplay;
+ mode->CrtcHSyncStart = mode->HSyncStart;
+ mode->CrtcHSyncEnd = mode->HSyncEnd;
+ mode->CrtcHTotal = mode->HTotal;
+ mode->CrtcVDisplay = mode->VDisplay;
+ mode->CrtcVSyncStart = mode->VSyncStart;
+ mode->CrtcVSyncEnd = mode->VSyncEnd;
+ mode->CrtcVTotal = mode->VTotal;
+ mode->CrtcHAdjusted = FALSE;
+ mode->CrtcVAdjusted = FALSE;
+ pScrn->modes = mode;
+ pScrn->virtualX = psdp->width;
+ pScrn->virtualY = psdp->height;
+}
+
+static int sbusPaletteIndex = -1;
+static unsigned long sbusPaletteGeneration = 0;
+typedef struct _sbusCmap {
+ sbusDevicePtr psdp;
+ CloseScreenProcPtr CloseScreen;
+ Bool origCmapValid;
+ unsigned char origRed[16];
+ unsigned char origGreen[16];
+ unsigned char origBlue[16];
+} sbusCmapRec, *sbusCmapPtr;
+
+#define SBUSCMAPPTR(pScreen) ((sbusCmapPtr)((pScreen)->devPrivates[sbusPaletteIndex].ptr))
+
+static void
+xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual)
+{
+ int i, index;
+ sbusCmapPtr cmap;
+ struct fbcmap fbcmap;
+ unsigned char *data = ALLOCATE_LOCAL(numColors*3);
+
+ cmap = SBUSCMAPPTR(pScrn->pScreen);
+ if (!cmap) return;
+ fbcmap.count = 0;
+ fbcmap.index = indices[0];
+ fbcmap.red = data;
+ fbcmap.green = data + numColors;
+ fbcmap.blue = fbcmap.green + numColors;
+ for (i = 0; i < numColors; i++) {
+ index = indices[i];
+ if (fbcmap.count && index != fbcmap.index + fbcmap.count) {
+ ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap);
+ fbcmap.count = 0;
+ fbcmap.index = index;
+ }
+ fbcmap.red[fbcmap.count] = colors[index].red;
+ fbcmap.green[fbcmap.count] = colors[index].green;
+ fbcmap.blue[fbcmap.count++] = colors[index].blue;
+ }
+ ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap);
+ DEALLOCATE_LOCAL(data);
+}
+
+static Bool
+xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen)
+{
+ sbusCmapPtr cmap;
+ struct fbcmap fbcmap;
+
+ cmap = SBUSCMAPPTR(pScreen);
+ if (cmap->origCmapValid) {
+ fbcmap.index = 0;
+ fbcmap.count = 16;
+ fbcmap.red = cmap->origRed;
+ fbcmap.green = cmap->origGreen;
+ fbcmap.blue = cmap->origBlue;
+ ioctl (cmap->psdp->fd, FBIOPUTCMAP, &fbcmap);
+ }
+ pScreen->CloseScreen = cmap->CloseScreen;
+ xfree (cmap);
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+Bool
+xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp)
+{
+ sbusCmapPtr cmap;
+ struct fbcmap fbcmap;
+ unsigned char data[2];
+
+ if(sbusPaletteGeneration != serverGeneration) {
+ if((sbusPaletteIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ sbusPaletteGeneration = serverGeneration;
+ }
+ cmap = xnfcalloc(1, sizeof(sbusCmapRec));
+ pScreen->devPrivates[sbusPaletteIndex].ptr = cmap;
+ cmap->psdp = psdp;
+ fbcmap.index = 0;
+ fbcmap.count = 16;
+ fbcmap.red = cmap->origRed;
+ fbcmap.green = cmap->origGreen;
+ fbcmap.blue = cmap->origBlue;
+ if (ioctl (psdp->fd, FBIOGETCMAP, &fbcmap) >= 0)
+ cmap->origCmapValid = TRUE;
+ fbcmap.index = 0;
+ fbcmap.count = 2;
+ fbcmap.red = data;
+ fbcmap.green = data;
+ fbcmap.blue = data;
+ if (pScreen->whitePixel == 0) {
+ data[0] = 255;
+ data[1] = 0;
+ } else {
+ data[0] = 0;
+ data[1] = 255;
+ }
+ ioctl (psdp->fd, FBIOPUTCMAP, &fbcmap);
+ cmap->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = xf86SbusCmapCloseScreen;
+ return xf86HandleColormaps(pScreen, 256, 8,
+ xf86SbusCmapLoadPalette, NULL, 0);
+}
diff --git a/hw/xfree86/common/xf86sbusBus.h b/hw/xfree86/common/xf86sbusBus.h
new file mode 100644
index 000000000..0816c63a1
--- /dev/null
+++ b/hw/xfree86/common/xf86sbusBus.h
@@ -0,0 +1,98 @@
+/*
+ * SBUS bus-specific declarations
+ *
+ * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
+ *
+ * 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
+ * JAKUB JELINEK 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.h,v 3.5 2002/12/10 02:42:35 tsi Exp $ */
+
+#ifndef _XF86_SBUSBUS_H
+#define _XF86_SBUSBUS_H
+
+#include "xf86str.h"
+
+#define SBUS_DEVICE_BW2 0x0001
+#define SBUS_DEVICE_CG2 0x0002
+#define SBUS_DEVICE_CG3 0x0003
+#define SBUS_DEVICE_CG4 0x0004
+#define SBUS_DEVICE_CG6 0x0005
+#define SBUS_DEVICE_CG8 0x0006
+#define SBUS_DEVICE_CG12 0x0007
+#define SBUS_DEVICE_CG14 0x0008
+#define SBUS_DEVICE_LEO 0x0009
+#define SBUS_DEVICE_TCX 0x000a
+#define SBUS_DEVICE_FFB 0x000b
+#define SBUS_DEVICE_GT 0x000c
+#define SBUS_DEVICE_MGX 0x000d
+
+typedef struct sbus_prom_node {
+ int node;
+ /* Because of misdesigned openpromio */
+ int cookie[2];
+} sbusPromNode, *sbusPromNodePtr;
+
+typedef struct sbus_device {
+ int devId;
+ int fbNum;
+ int fd;
+ int width, height;
+ sbusPromNode node;
+ char *descr;
+ char *device;
+} sbusDevice, *sbusDevicePtr;
+
+extern struct sbus_devtable {
+ int devId;
+ int fbType;
+ char *promName;
+ char *descr;
+} sbusDeviceTable[];
+
+void xf86SbusProbe(void);
+extern sbusDevicePtr *xf86SbusInfo;
+
+int xf86MatchSbusInstances(const char *driverName, int sbusDevId,
+ GDevPtr *devList, int numDevs, DriverPtr drvp,
+ int **foundEntities);
+sbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex);
+int xf86GetEntityForSbusInfo(sbusDevicePtr psdp);
+void xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn, sbusDevicePtr psdp);
+pointer xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset,
+ unsigned long size);
+void xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size);
+void xf86SbusHideOsHwCursor(sbusDevicePtr psdp);
+void xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg);
+Bool xf86SbusHandleColormaps(ScreenPtr pScreen, sbusDevicePtr psdp);
+
+extern int promRootNode;
+
+int promGetSibling(int node);
+int promGetChild(int node);
+char * promGetProperty(const char *prop, int *lenp);
+int promGetBool(const char *prop);
+
+int sparcPromInit(void);
+void sparcPromClose(void);
+char * sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp);
+int sparcPromGetBool(sbusPromNodePtr pnode, const char *prop);
+void sparcPromAssignNodes(void);
+char * sparcPromNode2Pathname(sbusPromNodePtr pnode);
+int sparcPromPathname2Node(const char *pathName);
+
+#endif /* _XF86_SBUSBUS_H */
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
new file mode 100644
index 000000000..2b6deed33
--- /dev/null
+++ b/hw/xfree86/common/xf86str.h
@@ -0,0 +1,1029 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.90 2002/11/25 14:04:56 eich Exp $ */
+
+/*
+ * Copyright (c) 1997-2000 by The XFree86 Project, Inc.
+ */
+
+/*
+ * This file contains definitions of the public XFree86 data structures/types.
+ * Any data structures that video drivers need to access should go here.
+ */
+
+#ifndef _XF86STR_H
+#define _XF86STR_H
+
+#include "misc.h"
+#include "input.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "xf86Module.h"
+#include "xf86Opt.h"
+#include "xf86Pci.h"
+
+/*
+ * memType is of the size of the addressable memory (machine size)
+ * usually unsigned long.
+ */
+typedef unsigned long memType;
+
+/* Video mode flags */
+
+typedef enum {
+ V_PHSYNC = 0x0001,
+ V_NHSYNC = 0x0002,
+ V_PVSYNC = 0x0004,
+ V_NVSYNC = 0x0008,
+ V_INTERLACE = 0x0010,
+ V_DBLSCAN = 0x0020,
+ V_CSYNC = 0x0040,
+ V_PCSYNC = 0x0080,
+ V_NCSYNC = 0x0100,
+ V_HSKEW = 0x0200, /* hskew provided */
+ V_BCAST = 0x0400,
+ V_PIXMUX = 0x1000,
+ V_DBLCLK = 0x2000,
+ V_CLKDIV2 = 0x4000
+} ModeFlags;
+
+typedef enum {
+ INTERLACE_HALVE_V = 0x0001 /* Halve V values for interlacing */
+} CrtcAdjustFlags;
+
+/* Flags passed to ChipValidMode() */
+typedef enum {
+ MODECHECK_INITIAL = 0,
+ MODECHECK_FINAL = 1
+} ModeCheckFlags;
+
+/* These are possible return values for xf86CheckMode() and ValidMode() */
+typedef enum {
+ MODE_OK = 0, /* Mode OK */
+ MODE_HSYNC, /* hsync out of range */
+ MODE_VSYNC, /* vsync out of range */
+ MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
+ MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
+ MODE_BAD_WIDTH, /* requires an unsupported linepitch */
+ MODE_NOMODE, /* no mode with a maching name */
+ MODE_NO_INTERLACE, /* interlaced mode not supported */
+ MODE_NO_DBLESCAN, /* doublescan mode not supported */
+ MODE_NO_VSCAN, /* multiscan mode not supported */
+ MODE_MEM, /* insufficient video memory */
+ MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
+ MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
+ MODE_MEM_VIRT, /* insufficient video memory given virtual size */
+ MODE_NOCLOCK, /* no fixed clock available */
+ MODE_CLOCK_HIGH, /* clock required is too high */
+ MODE_CLOCK_LOW, /* clock required is too low */
+ MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
+ MODE_BAD_HVALUE, /* horizontal timing was out of range */
+ MODE_BAD_VVALUE, /* vertical timing was out of range */
+ MODE_BAD_VSCAN, /* VScan value out of range */
+ MODE_HSYNC_NARROW, /* horizontal sync too narrow */
+ MODE_HSYNC_WIDE, /* horizontal sync too wide */
+ MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
+ MODE_HBLANK_WIDE, /* horizontal blanking too wide */
+ MODE_VSYNC_NARROW, /* vertical sync too narrow */
+ MODE_VSYNC_WIDE, /* vertical sync too wide */
+ MODE_VBLANK_NARROW, /* vertical blanking too narrow */
+ MODE_VBLANK_WIDE, /* vertical blanking too wide */
+ MODE_PANEL, /* exceeds panel dimensions */
+ MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
+ MODE_ONE_WIDTH, /* only one width is supported */
+ MODE_ONE_HEIGHT, /* only one height is supported */
+ MODE_ONE_SIZE, /* only one resolution is supported */
+ MODE_BAD = -2, /* unspecified reason */
+ MODE_ERROR = -1 /* error condition */
+} ModeStatus;
+
+# define M_T_BUILTIN 0x01 /* built-in mode */
+# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
+# define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */
+# define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C)
+ /* built-in mode - configure CRTC and clock */
+# define M_T_DEFAULT 0x10 /* (VESA) default modes */
+# define M_T_USERDEF 0x20 /* One of the modes from the config file */
+
+/* Video mode */
+typedef struct _DisplayModeRec {
+ struct _DisplayModeRec * prev;
+ struct _DisplayModeRec * next;
+ char * name; /* identifier for the mode */
+ ModeStatus status;
+ int type;
+
+ /* These are the values that the user sees/provides */
+ int Clock; /* pixel clock freq */
+ int HDisplay; /* horizontal timing */
+ int HSyncStart;
+ int HSyncEnd;
+ int HTotal;
+ int HSkew;
+ int VDisplay; /* vertical timing */
+ int VSyncStart;
+ int VSyncEnd;
+ int VTotal;
+ int VScan;
+ int Flags;
+
+ /* These are the values the hardware uses */
+ int ClockIndex;
+ int SynthClock; /* Actual clock freq to
+ * be programmed */
+ int CrtcHDisplay;
+ int CrtcHBlankStart;
+ int CrtcHSyncStart;
+ int CrtcHSyncEnd;
+ int CrtcHBlankEnd;
+ int CrtcHTotal;
+ int CrtcHSkew;
+ int CrtcVDisplay;
+ int CrtcVBlankStart;
+ int CrtcVSyncStart;
+ int CrtcVSyncEnd;
+ int CrtcVBlankEnd;
+ int CrtcVTotal;
+ Bool CrtcHAdjusted;
+ Bool CrtcVAdjusted;
+ int PrivSize;
+ INT32 * Private;
+ int PrivFlags;
+
+ float HSync, VRefresh;
+} DisplayModeRec, *DisplayModePtr;
+
+/* The monitor description */
+
+#define MAX_HSYNC 8
+#define MAX_VREFRESH 8
+
+typedef struct { float hi, lo; } range;
+
+typedef struct { CARD32 red, green, blue; } rgb;
+
+typedef struct { float red, green, blue; } Gamma;
+
+/* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
+#define GAMMA_MAX 10.0
+#define GAMMA_MIN (1.0 / GAMMA_MAX)
+#define GAMMA_ZERO (GAMMA_MIN / 100.0)
+
+typedef struct {
+ char * id;
+ char * vendor;
+ char * model;
+ int nHsync;
+ range hsync[MAX_HSYNC];
+ int nVrefresh;
+ range vrefresh[MAX_VREFRESH];
+ DisplayModePtr Modes; /* Start of the monitor's mode list */
+ DisplayModePtr Last; /* End of the monitor's mode list */
+ Gamma gamma; /* Gamma of the monitor */
+ int widthmm;
+ int heightmm;
+ pointer options;
+ pointer DDC;
+} MonRec, *MonPtr;
+
+/* the list of clock ranges */
+typedef struct x_ClockRange {
+ struct x_ClockRange *next;
+ int minClock;
+ int maxClock;
+ int clockIndex; /* -1 for programmable clocks */
+ Bool interlaceAllowed;
+ Bool doubleScanAllowed;
+ int ClockMulFactor;
+ int ClockDivFactor;
+ int PrivFlags;
+} ClockRange, *ClockRangePtr;
+
+/* Need to store the strategy with clockRange for VidMode extension */
+typedef struct x_ClockRanges {
+ struct x_ClockRanges *next;
+ int minClock;
+ int maxClock;
+ int clockIndex; /* -1 for programmable clocks */
+ Bool interlaceAllowed;
+ Bool doubleScanAllowed;
+ int ClockMulFactor;
+ int ClockDivFactor;
+ int PrivFlags;
+ int strategy;
+} ClockRanges, *ClockRangesPtr;
+
+/*
+ * The driver list struct. This contains the information required for each
+ * driver before a ScrnInfoRec has been allocated.
+ */
+typedef struct _DriverRec {
+ int driverVersion;
+ char * driverName;
+ void (*Identify)(int flags);
+ Bool (*Probe)(struct _DriverRec *drv, int flags);
+ const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
+ pointer module;
+ int refCount;
+} DriverRec, *DriverPtr;
+
+#ifdef XFree86LOADER
+/*
+ * The optional module list struct. This allows modules exporting helping
+ * functions to configuration tools, the Xserver, or any other
+ * application/module interested in such information.
+ */
+typedef struct _ModuleInfoRec {
+ int moduleVersion;
+ char * moduleName;
+ pointer module;
+ int refCount;
+ const OptionInfoRec * (*AvailableOptions)(void *unused);
+ pointer unused[8]; /* leave some space for more fields */
+} ModuleInfoRec, *ModuleInfoPtr;
+#endif
+
+/*
+ * These are the private bus types. New types can be added here. Types
+ * required for the public interface should be added to xf86str.h, with
+ * function prototypes added to xf86.h.
+ */
+
+/* Tolerate prior #include <linux/input.h> */
+#if defined(linux) && defined(_INPUT_H)
+#undef BUS_NONE
+#undef BUS_ISA
+#undef BUS_PCI
+#undef BUS_SBUS
+#undef BUS_last
+#endif
+
+typedef enum {
+ BUS_NONE,
+ BUS_ISA,
+ BUS_PCI,
+ BUS_SBUS,
+ BUS_last /* Keep last */
+} BusType;
+
+typedef struct {
+ int bus;
+ int device;
+ int func;
+} PciBusId;
+
+typedef struct {
+ unsigned int dummy;
+} IsaBusId;
+
+typedef struct {
+ int fbNum;
+} SbusBusId;
+
+typedef struct _bus {
+ BusType type;
+ union {
+ IsaBusId isa;
+ PciBusId pci;
+ SbusBusId sbus;
+ } id;
+} BusRec, *BusPtr;
+
+#define MAXCLOCKS 128
+typedef enum {
+ DAC_BPP8 = 0,
+ DAC_BPP16,
+ DAC_BPP24,
+ DAC_BPP32,
+ MAXDACSPEEDS
+} DacSpeedIndex;
+
+typedef struct {
+ char * identifier;
+ char * vendor;
+ char * board;
+ char * chipset;
+ char * ramdac;
+ char * driver;
+ struct _confscreenrec * myScreenSection;
+ Bool claimed;
+ int dacSpeeds[MAXDACSPEEDS];
+ int numclocks;
+ int clock[MAXCLOCKS];
+ char * clockchip;
+ char * busID;
+ Bool active;
+ Bool inUse;
+ int videoRam;
+ int textClockFreq;
+ unsigned long BiosBase; /* Base address of video BIOS */
+ unsigned long MemBase; /* Frame buffer base address */
+ unsigned long IOBase;
+ int chipID;
+ int chipRev;
+ pointer options;
+ int irq;
+ int screen; /* For multi-CRTC cards */
+} GDevRec, *GDevPtr;
+
+typedef int (*FindIsaDevProc)(GDevPtr dev);
+
+typedef struct {
+ char * identifier;
+ char * driver;
+ pointer commonOptions;
+ pointer extraOptions;
+} IDevRec, *IDevPtr;
+
+typedef struct {
+ int vendor;
+ int chipType;
+ int chipRev;
+ int subsysVendor;
+ int subsysCard;
+ int bus;
+ int device;
+ int func;
+ int class;
+ int subclass;
+ int interface;
+ memType memBase[6];
+ memType ioBase[6];
+ int size[6];
+ unsigned char type[6];
+ memType biosBase;
+ int biosSize;
+ pointer thisCard;
+ Bool validSize;
+ Bool validate;
+ CARD32 listed_class;
+} pciVideoRec, *pciVideoPtr;
+
+typedef struct {
+ int frameX0;
+ int frameY0;
+ int virtualX;
+ int virtualY;
+ int depth;
+ int fbbpp;
+ rgb weight;
+ rgb blackColour;
+ rgb whiteColour;
+ int defaultVisual;
+ char ** modes;
+ pointer options;
+} DispRec, *DispPtr;
+
+typedef struct _confxvportrec {
+ char * identifier;
+ pointer options;
+} confXvPortRec, *confXvPortPtr;
+
+typedef struct _confxvadaptrec {
+ char * identifier;
+ int numports;
+ confXvPortPtr ports;
+ pointer options;
+} confXvAdaptorRec, *confXvAdaptorPtr;
+
+typedef struct _confscreenrec {
+ char * id;
+ int screennum;
+ int defaultdepth;
+ int defaultbpp;
+ int defaultfbbpp;
+ MonPtr monitor;
+ GDevPtr device;
+ int numdisplays;
+ DispPtr displays;
+ int numxvadaptors;
+ confXvAdaptorPtr xvadaptors;
+ pointer options;
+} confScreenRec, *confScreenPtr;
+
+typedef enum {
+ PosObsolete = -1,
+ PosAbsolute = 0,
+ PosRightOf,
+ PosLeftOf,
+ PosAbove,
+ PosBelow,
+ PosRelative
+} PositionType;
+
+typedef struct _screenlayoutrec {
+ confScreenPtr screen;
+ char * topname;
+ confScreenPtr top;
+ char * bottomname;
+ confScreenPtr bottom;
+ char * leftname;
+ confScreenPtr left;
+ char * rightname;
+ confScreenPtr right;
+ PositionType where;
+ int x;
+ int y;
+ char * refname;
+ confScreenPtr refscreen;
+} screenLayoutRec, *screenLayoutPtr;
+
+typedef struct _serverlayoutrec {
+ char * id;
+ screenLayoutPtr screens;
+ GDevPtr inactives;
+ IDevPtr inputs;
+ pointer options;
+} serverLayoutRec, *serverLayoutPtr;
+
+typedef struct _confdribufferrec {
+ int count;
+ int size;
+ enum {
+ XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
+ } flags;
+} confDRIBufferRec, *confDRIBufferPtr;
+
+typedef struct _confdrirec {
+ int group;
+ int mode;
+ int bufs_count;
+ confDRIBufferRec *bufs;
+} confDRIRec, *confDRIPtr;
+
+/* These values should be adjusted when new fields are added to ScrnInfoRec */
+#define NUM_RESERVED_INTS 16
+#define NUM_RESERVED_POINTERS 15
+#define NUM_RESERVED_FUNCS 16
+
+typedef pointer (*funcPointer)(void);
+
+/* Flags for driver messages */
+typedef enum {
+ X_PROBED, /* Value was probed */
+ X_CONFIG, /* Value was given in the config file */
+ X_DEFAULT, /* Value is a default */
+ X_CMDLINE, /* Value was given on the command line */
+ X_NOTICE, /* Notice */
+ X_ERROR, /* Error message */
+ X_WARNING, /* Warning message */
+ X_INFO, /* Informational message */
+ X_NONE, /* No prefix */
+ X_NOT_IMPLEMENTED /* Not implemented */
+} MessageType;
+
+/* flags for depth 24 pixmap options */
+typedef enum {
+ Pix24DontCare = 0,
+ Pix24Use24,
+ Pix24Use32
+} Pix24Flags;
+
+/* Power management events: so far we only support APM */
+
+typedef enum {
+ XF86_APM_UNKNOWN = -1,
+ XF86_APM_SYS_STANDBY,
+ XF86_APM_SYS_SUSPEND,
+ XF86_APM_CRITICAL_SUSPEND,
+ XF86_APM_USER_STANDBY,
+ XF86_APM_USER_SUSPEND,
+ XF86_APM_STANDBY_RESUME,
+ XF86_APM_NORMAL_RESUME,
+ XF86_APM_CRITICAL_RESUME,
+ XF86_APM_LOW_BATTERY,
+ XF86_APM_POWER_STATUS_CHANGE,
+ XF86_APM_UPDATE_TIME,
+ XF86_APM_CAPABILITY_CHANGED,
+ XF86_APM_STANDBY_FAILED,
+ XF86_APM_SUSPEND_FAILED
+} pmEvent;
+
+typedef enum {
+ PM_WAIT,
+ PM_CONTINUE,
+ PM_FAILED,
+ PM_NONE
+} pmWait;
+
+/*
+ * The IO access enabler struct. This contains the address for
+ * the IOEnable/IODisable funcs for their specific bus along
+ * with a pointer to data needed by them
+ */
+typedef struct _AccessRec {
+ void (*AccessDisable)(void *arg);
+ void (*AccessEnable)(void *arg);
+ void *arg;
+} xf86AccessRec, *xf86AccessPtr;
+
+typedef struct {
+ xf86AccessPtr mem;
+ xf86AccessPtr io;
+ xf86AccessPtr io_mem;
+} xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
+
+/* bus-access-related types */
+typedef enum {
+ NONE,
+ IO,
+ MEM_IO,
+ MEM
+} resType;
+
+typedef struct _EntityAccessRec {
+ xf86AccessPtr fallback;
+ xf86AccessPtr pAccess;
+ resType rt;
+ pointer busAcc;
+ struct _EntityAccessRec *next;
+} EntityAccessRec, *EntityAccessPtr;
+
+typedef struct _CurrAccRec {
+ EntityAccessPtr pMemAccess;
+ EntityAccessPtr pIoAccess;
+} xf86CurrentAccessRec, *xf86CurrentAccessPtr;
+
+/* new RAC */
+
+/* Resource Type values */
+#define ResNone ((unsigned long)(-1))
+
+#define ResMem 0x0001
+#define ResIo 0x0002
+#define ResIrq 0x0003
+#define ResDma 0x0004
+#define ResPciCfg 0x000e /* PCI Configuration space */
+#define ResPhysMask 0x000F
+
+#define ResExclusive 0x0010
+#define ResShared 0x0020
+#define ResAny 0x0040
+#define ResAccMask 0x0070
+#define ResUnused 0x0080
+
+#define ResUnusedOpr 0x0100
+#define ResDisableOpr 0x0200
+#define ResOprMask 0x0300
+
+#define ResBlock 0x0400
+#define ResSparse 0x0800
+#define ResExtMask 0x0C00
+
+#define ResEstimated 0x001000
+#define ResInit 0x002000
+#define ResBios 0x004000
+#define ResMiscMask 0x00F000
+
+#define ResBus 0x010000
+#define ResOverlap 0x020000
+
+#if defined(__alpha__) && defined(linux)
+# define ResDomain 0x1ff000000ul
+#else
+# define ResDomain 0xff000000ul
+#endif
+#define ResTypeMask (ResPhysMask | ResDomain) /* For conflict check */
+
+#define ResEnd ResNone
+
+#define ResExcMemBlock (ResMem | ResExclusive | ResBlock)
+#define ResExcIoBlock (ResIo | ResExclusive | ResBlock)
+#define ResShrMemBlock (ResMem | ResShared | ResBlock)
+#define ResShrIoBlock (ResIo | ResShared | ResBlock)
+#define ResExcUusdMemBlock (ResMem | ResExclusive | ResUnused | ResBlock)
+#define ResExcUusdIoBlock (ResIo | ResExclusive | ResUnused | ResBlock)
+#define ResShrUusdMemBlock (ResMem | ResShared | ResUnused | ResBlock)
+#define ResShrUusdIoBlock (ResIo | ResShared | ResUnused | ResBlock)
+#define ResExcUusdMemSparse (ResMem | ResExclusive | ResUnused | ResSparse)
+#define ResExcUusdIoSparse (ResIo | ResExclusive | ResUnused | ResSparse)
+#define ResShrUusdMemSparse (ResMem | ResShared | ResUnused | ResSparse)
+#define ResShrUusdIoSparse (ResIo | ResShared | ResUnused | ResSparse)
+
+#define ResExcMemSparse (ResMem | ResExclusive | ResSparse)
+#define ResExcIoSparse (ResIo | ResExclusive | ResSparse)
+#define ResShrMemSparse (ResMem | ResShared | ResSparse)
+#define ResShrIoSparse (ResIo | ResShared | ResSparse)
+#define ResUusdMemSparse (ResMem | ResUnused | ResSparse)
+#define ResUusdIoSparse (ResIo | ResUnused | ResSparse)
+
+#define ResIsMem(r) (((r)->type & ResPhysMask) == ResMem)
+#define ResIsIo(r) (((r)->type & ResPhysMask) == ResIo)
+#define ResIsExclusive(r) (((r)->type & ResAccMask) == ResExclusive)
+#define ResIsShared(r) (((r)->type & ResAccMask) == ResShared)
+#define ResIsUnused(r) (((r)->type & ResAccMask) == ResUnused)
+#define ResIsBlock(r) (((r)->type & ResExtMask) == ResBlock)
+#define ResIsSparse(r) (((r)->type & ResExtMask) == ResSparse)
+#define ResIsEstimated(r) (((r)->type & ResMiscMask) == ResEstimated)
+#define ResCanOverlap(r) (ResIsEstimated(r) || ((r)->type & ResOverlap))
+
+typedef struct {
+ unsigned long type; /* shared, exclusive, unused etc. */
+ memType a;
+ memType b;
+} resRange, *resList;
+
+#define RANGE_TYPE(type, domain) \
+ (((unsigned long)(domain) << 24) | ((type) & ~ResBus))
+#define RANGE(r,u,v,t) {\
+ (r).a = (u);\
+ (r).b = (v);\
+ (r).type = (t);\
+ }
+
+#define rBase a
+#define rMask b
+#define rBegin a
+#define rEnd b
+
+/* resource record */
+typedef struct _resRec *resPtr;
+typedef struct _resRec {
+ resRange val;
+ int entityIndex; /* who owns the resource */
+ resPtr next;
+} resRec;
+
+#define sparse_base val.rBase
+#define sparse_mask val.rMask
+#define block_begin val.rBegin
+#define block_end val.rEnd
+#define res_type val.type
+
+typedef struct {
+ int numChipset;
+ resRange *resList;
+} IsaChipsets;
+
+typedef struct {
+ int numChipset;
+ int PCIid;
+ resRange *resList;
+} PciChipsets;
+
+/* Entity properties */
+typedef void (*EntityProc)(int entityIndex,pointer private);
+
+typedef struct _entityInfo {
+ int index;
+ BusRec location;
+ int chipset;
+ Bool active;
+ resPtr resources;
+ GDevPtr device;
+ DriverPtr driver;
+} EntityInfoRec, *EntityInfoPtr;
+
+/* server states */
+
+typedef enum {
+ SETUP,
+ OPERATING
+} xf86State;
+
+typedef enum {
+ NOTIFY_SETUP_TRANSITION,
+ NOTIFY_SETUP,
+ NOTIFY_OPERATING,
+ NOTIFY_OPERATING_TRANSITION,
+ NOTIFY_ENABLE,
+ NOTIFY_ENTER,
+ NOTIFY_LEAVE
+} xf86NotifyState;
+
+typedef void (*xf86StateChangeNotificationCallbackFunc)(xf86NotifyState state,pointer);
+
+/* DGA */
+
+typedef struct {
+ int num; /* A unique identifier for the mode (num > 0) */
+ DisplayModePtr mode;
+ int flags; /* DGA_CONCURRENT_ACCESS, etc... */
+ int imageWidth; /* linear accessible portion (pixels) */
+ int imageHeight;
+ int pixmapWidth; /* Xlib accessible portion (pixels) */
+ int pixmapHeight; /* both fields ignored if no concurrent access */
+ int bytesPerScanline;
+ int byteOrder; /* MSBFirst, LSBFirst */
+ int depth;
+ int bitsPerPixel;
+ unsigned long red_mask;
+ unsigned long green_mask;
+ unsigned long blue_mask;
+ short visualClass;
+ int viewportWidth;
+ int viewportHeight;
+ int xViewportStep; /* viewport position granularity */
+ int yViewportStep;
+ int maxViewportX; /* max viewport origin */
+ int maxViewportY;
+ int viewportFlags; /* types of page flipping possible */
+ int offset; /* offset into physical memory */
+ unsigned char *address; /* server's mapped framebuffer */
+ int reserved1;
+ int reserved2;
+} DGAModeRec, *DGAModePtr;
+
+typedef struct {
+ DGAModePtr mode;
+ PixmapPtr pPix;
+} DGADeviceRec, *DGADevicePtr;
+
+/*
+ * Flags for driver Probe() functions.
+ */
+#define PROBE_DEFAULT 0x00
+#define PROBE_DETECT 0x01
+#define PROBE_TRYHARD 0x02
+
+/*
+ * Driver entry point types
+ */
+typedef struct _ScrnInfoRec *ScrnInfoPtr;
+
+typedef Bool xf86ProbeProc (DriverPtr, int);
+typedef Bool xf86PreInitProc (ScrnInfoPtr, int);
+typedef Bool xf86ScreenInitProc (int, ScreenPtr, int, char**);
+typedef Bool xf86SwitchModeProc (int, DisplayModePtr, int);
+typedef void xf86AdjustFrameProc (int, int, int, int);
+typedef Bool xf86EnterVTProc (int, int);
+typedef void xf86LeaveVTProc (int, int);
+typedef void xf86FreeScreenProc (int, int);
+typedef int xf86ValidModeProc (int, DisplayModePtr, Bool, int);
+typedef void xf86EnableDisableFBAccessProc(int, Bool);
+typedef int xf86SetDGAModeProc (int, int, DGADevicePtr);
+typedef int xf86ChangeGammaProc (int, Gamma);
+typedef void xf86PointerMovedProc (int, int, int);
+typedef Bool xf86PMEventProc (int, pmEvent, Bool);
+
+/*
+ * ScrnInfoRec
+ *
+ * There is one of these for each screen, and it holds all the screen-specific
+ * information.
+ *
+ * Note: the size and layout must be kept the same across versions. New
+ * fields are to be added in place of the "reserved*" fields. No fields
+ * are to be dependent on compile-time defines.
+ */
+
+
+typedef struct _ScrnInfoRec {
+ int driverVersion;
+ char * driverName; /* canonical name used in */
+ /* the config file */
+ ScreenPtr pScreen; /* Pointer to the ScreenRec */
+ int scrnIndex; /* Number of this screen */
+ Bool configured; /* Is this screen valid */
+ int origIndex; /* initial number assigned to
+ * this screen before
+ * finalising the number of
+ * available screens */
+
+ /* Display-wide screenInfo values needed by this screen */
+ int imageByteOrder;
+ int bitmapScanlineUnit;
+ int bitmapScanlinePad;
+ int bitmapBitOrder;
+ int numFormats;
+ PixmapFormatRec formats[MAXFORMATS];
+ PixmapFormatRec fbFormat;
+
+ int bitsPerPixel; /* fb bpp */
+ Pix24Flags pixmap24; /* pixmap pref for depth 24 */
+ int depth; /* depth of default visual */
+ MessageType depthFrom; /* set from config? */
+ MessageType bitsPerPixelFrom; /* set from config? */
+ rgb weight; /* r/g/b weights */
+ rgb mask; /* rgb masks */
+ rgb offset; /* rgb offsets */
+ int rgbBits; /* Number of bits in r/g/b */
+ Gamma gamma; /* Gamma of the monitor */
+ int defaultVisual; /* default visual class */
+ int maxHValue; /* max horizontal timing */
+ int maxVValue; /* max vertical timing value */
+ int virtualX; /* Virtual width */
+ int virtualY; /* Virtual height */
+ int xInc; /* Horizontal timing increment */
+ MessageType virtualFrom; /* set from config? */
+ int displayWidth; /* memory pitch */
+ int frameX0; /* viewport position */
+ int frameY0;
+ int frameX1;
+ int frameY1;
+ int zoomLocked; /* Disallow mode changes */
+ DisplayModePtr modePool; /* list of compatible modes */
+ DisplayModePtr modes; /* list of actual modes */
+ DisplayModePtr currentMode; /* current mode
+ * This was previously
+ * overloaded with the modes
+ * field, which is a pointer
+ * into a circular list */
+ confScreenPtr confScreen; /* Screen config info */
+ MonPtr monitor; /* Monitor information */
+ DispPtr display; /* Display information */
+ int * entityList; /* List of device entities */
+ int numEntities;
+ int widthmm; /* physical display dimensions
+ * in mm */
+ int heightmm;
+ int xDpi; /* width DPI */
+ int yDpi; /* height DPI */
+ char * name; /* Name to prefix messages */
+ pointer driverPrivate; /* Driver private area */
+ DevUnion * privates; /* Other privates can hook in
+ * here */
+ DriverPtr drv; /* xf86DriverList[] entry */
+ pointer module; /* Pointer to module head */
+ int colorKey;
+ int overlayFlags;
+
+ /* Some of these may be moved out of here into the driver private area */
+
+ char * chipset; /* chipset name */
+ char * ramdac; /* ramdac name */
+ char * clockchip; /* clock name */
+ Bool progClock; /* clock is programmable */
+ int numClocks; /* number of clocks */
+ int clock[MAXCLOCKS]; /* list of clock frequencies */
+ int videoRam; /* amount of video ram (kb) */
+ unsigned long biosBase; /* Base address of video BIOS */
+ unsigned long memPhysBase; /* Physical address of FB */
+ unsigned long fbOffset; /* Offset of FB in the above */
+ IOADDRESS domainIOBase; /* Domain I/O base address */
+ int memClk; /* memory clock */
+ int textClockFreq; /* clock of text mode */
+ Bool flipPixels; /* swap default black/white */
+ pointer options;
+
+ int chipID;
+ int chipRev;
+ int racMemFlags;
+ int racIoFlags;
+ pointer access;
+ xf86CurrentAccessPtr CurrentAccess;
+ resType resourceType;
+ pointer busAccess;
+
+ /* Allow screens to be enabled/disabled individually */
+ Bool vtSema;
+ DevUnion pixmapPrivate; /* saved devPrivate from pixmap */
+
+ /* hw cursor moves at SIGIO time */
+ Bool silkenMouse;
+
+ /* Storage for clockRanges and adjustFlags for use with the VidMode ext */
+ ClockRangesPtr clockRanges;
+ int adjustFlags;
+
+ /*
+ * These can be used when the minor ABI version is incremented.
+ * The NUM_* parameters must be reduced appropriately to keep the
+ * structure size and alignment unchanged.
+ */
+ int reservedInt[NUM_RESERVED_INTS];
+
+ int * entityInstanceList;
+ pointer reservedPtr[NUM_RESERVED_POINTERS];
+
+ /*
+ * Driver entry points.
+ *
+ */
+
+ xf86ProbeProc *Probe;
+ xf86PreInitProc *PreInit;
+ xf86ScreenInitProc *ScreenInit;
+ xf86SwitchModeProc *SwitchMode;
+ xf86AdjustFrameProc *AdjustFrame;
+ xf86EnterVTProc *EnterVT;
+ xf86LeaveVTProc *LeaveVT;
+ xf86FreeScreenProc *FreeScreen;
+ xf86ValidModeProc *ValidMode;
+ xf86EnableDisableFBAccessProc *EnableDisableFBAccess;
+ xf86SetDGAModeProc *SetDGAMode;
+ xf86ChangeGammaProc *ChangeGamma;
+ xf86PointerMovedProc *PointerMoved;
+ xf86PMEventProc *PMEvent;
+
+ /*
+ * This can be used when the minor ABI version is incremented.
+ * The NUM_* parameter must be reduced appropriately to keep the
+ * structure size and alignment unchanged.
+ */
+ funcPointer reservedFuncs[NUM_RESERVED_FUNCS];
+
+} ScrnInfoRec;
+
+
+typedef struct {
+ Bool (*OpenFramebuffer)(
+ ScrnInfoPtr pScrn,
+ char **name,
+ unsigned char **mem,
+ int *size,
+ int *offset,
+ int *extra
+ );
+ void (*CloseFramebuffer)(ScrnInfoPtr pScrn);
+ Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
+ void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
+ int (*GetViewport)(ScrnInfoPtr pScrn);
+ void (*Sync)(ScrnInfoPtr);
+ void (*FillRect)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned long color
+ );
+ void (*BlitRect)(
+ ScrnInfoPtr pScrn,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty
+ );
+ void (*BlitTransRect)(
+ ScrnInfoPtr pScrn,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty,
+ unsigned long color
+ );
+} DGAFunctionRec, *DGAFunctionPtr;
+
+typedef struct {
+ int token; /* id of the token */
+ const char * name; /* token name */
+} SymTabRec, *SymTabPtr;
+
+/* flags for xf86LookupMode */
+typedef enum {
+ LOOKUP_DEFAULT = 0, /* Use default mode lookup method */
+ LOOKUP_BEST_REFRESH, /* Pick modes with best refresh */
+ LOOKUP_CLOSEST_CLOCK, /* Pick modes with the closest clock */
+ LOOKUP_LIST_ORDER, /* Pick first useful mode in list */
+ LOOKUP_CLKDIV2 = 0x0100, /* Allow half clocks */
+ LOOKUP_OPTIONAL_TOLERANCES = 0x0200 /* Allow missing hsync/vrefresh */
+} LookupModeFlags;
+
+#define NoDepth24Support 0x00
+#define Support24bppFb 0x01 /* 24bpp framebuffer supported */
+#define Support32bppFb 0x02 /* 32bpp framebuffer supported */
+#define SupportConvert24to32 0x04 /* Can convert 24bpp pixmap to 32bpp */
+#define SupportConvert32to24 0x08 /* Can convert 32bpp pixmap to 24bpp */
+#define PreferConvert24to32 0x10 /* prefer 24bpp pixmap to 32bpp conv */
+#define PreferConvert32to24 0x20 /* prefer 32bpp pixmap to 24bpp conv */
+
+
+/* For DPMS */
+typedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);
+
+/* Input handler proc */
+typedef void (*InputHandlerProc)(int fd, pointer data);
+
+/* These are used by xf86GetClocks */
+#define CLK_REG_SAVE -1
+#define CLK_REG_RESTORE -2
+
+/* xf86Debug.c */
+#ifdef BUILDDEBUG
+typedef struct {
+ long sec;
+ long usec;
+} xf86TsRec, *xf86TsPtr;
+#endif
+
+/*
+ * misc constants
+ */
+#define INTERLACE_REFRESH_WEIGHT 1.5
+#define SYNC_TOLERANCE 0.01 /* 1 percent */
+#define CLOCK_TOLERANCE 2000 /* Clock matching tolerance (2MHz) */
+
+
+#define OVERLAY_8_32_DUALFB 0x00000001
+#define OVERLAY_8_24_DUALFB 0x00000002
+#define OVERLAY_8_16_DUALFB 0x00000004
+#define OVERLAY_8_32_PLANAR 0x00000008
+
+#if 0
+#define LD_RESOLV_IFDONE 0 /* only check if no more
+ delays pending */
+#define LD_RESOLV_NOW 1 /* finish one delay step */
+#define LD_RESOLV_FORCE 2 /* force checking... */
+#endif
+
+/* Values of xf86Info.mouseFlags */
+#define MF_CLEAR_DTR 1
+#define MF_CLEAR_RTS 2
+
+/* Action Events */
+typedef enum {
+ ACTION_TERMINATE = 0, /* Terminate Server */
+ ACTION_NEXT_MODE = 10, /* Switch to next video mode */
+ ACTION_PREV_MODE,
+ ACTION_DISABLEGRAB = 20, /* Cancel server/pointer/kbd grabs */
+ ACTION_CLOSECLIENT, /* Kill client holding grab */
+ ACTION_SWITCHSCREEN = 100, /* VT switch */
+ ACTION_SWITCHSCREEN_NEXT,
+ ACTION_SWITCHSCREEN_PREV
+} ActionEvent;
+
+#endif /* _XF86STR_H */
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
new file mode 100644
index 000000000..c6a09121b
--- /dev/null
+++ b/hw/xfree86/common/xf86xv.c
@@ -0,0 +1,1935 @@
+/*
+
+ XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
+
+ Copyright (C) 1998, 1999 - The XFree86 Project Inc.
+
+*/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.33 2002/11/09 01:18:11 keithp Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "Xproto.h"
+#include "scrnintstr.h"
+#include "regionstr.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "mivalidate.h"
+#include "validate.h"
+#include "resource.h"
+#include "gcstruct.h"
+#include "dixstruct.h"
+
+#include "Xv.h"
+#include "Xvproto.h"
+#include "xvdix.h"
+#ifdef XFree86LOADER
+#include "xvmodproc.h"
+#endif
+
+#include "xf86xv.h"
+
+
+/* XvScreenRec fields */
+
+static Bool xf86XVCloseScreen(int, ScreenPtr);
+static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
+
+/* XvAdaptorRec fields */
+
+static int xf86XVAllocatePort(unsigned long, XvPortPtr, XvPortPtr*);
+static int xf86XVFreePort(XvPortPtr);
+static int xf86XVPutVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
+ INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16);
+static int xf86XVPutStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
+ INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16);
+static int xf86XVGetVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
+ INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16);
+static int xf86XVGetStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
+ INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16);
+static int xf86XVStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
+static int xf86XVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
+static int xf86XVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32*);
+static int xf86XVQueryBestSize(ClientPtr, XvPortPtr, CARD8,
+ CARD16, CARD16,CARD16, CARD16,
+ unsigned int*, unsigned int*);
+static int xf86XVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
+ INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
+ XvImagePtr, unsigned char*, Bool,
+ CARD16, CARD16);
+static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
+ CARD16*, CARD16*, int*, int*);
+
+
+/* ScreenRec fields */
+
+static Bool xf86XVDestroyWindow(WindowPtr pWin);
+static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2);
+static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy);
+
+/* ScrnInfoRec functions */
+
+static Bool xf86XVEnterVT(int, int);
+static void xf86XVLeaveVT(int, int);
+static void xf86XVAdjustFrame(int index, int x, int y, int flags);
+
+/* misc */
+
+static Bool xf86XVInitAdaptors(ScreenPtr, XF86VideoAdaptorPtr*, int);
+
+
+int XF86XVWindowIndex = -1;
+int XF86XvScreenIndex = -1;
+static unsigned long XF86XVGeneration = 0;
+static unsigned long PortResource = 0;
+
+#ifdef XFree86LOADER
+int (*XvGetScreenIndexProc)(void) = NULL;
+unsigned long (*XvGetRTPortProc)(void) = NULL;
+int (*XvScreenInitProc)(ScreenPtr) = NULL;
+#else
+int (*XvGetScreenIndexProc)(void) = XvGetScreenIndex;
+unsigned long (*XvGetRTPortProc)(void) = XvGetRTPort;
+int (*XvScreenInitProc)(ScreenPtr) = XvScreenInit;
+#endif
+
+
+#define GET_XV_SCREEN(pScreen) \
+ ((XvScreenPtr)((pScreen)->devPrivates[XF86XvScreenIndex].ptr))
+
+#define GET_XF86XV_SCREEN(pScreen) \
+ ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr))
+
+#define GET_XF86XV_WINDOW(pWin) \
+ ((XF86XVWindowPtr)((pWin)->devPrivates[XF86XVWindowIndex].ptr))
+
+static xf86XVInitGenericAdaptorPtr *GenDrivers = NULL;
+static int NumGenDrivers = 0;
+
+int
+xf86XVRegisterGenericAdaptorDriver(
+ xf86XVInitGenericAdaptorPtr InitFunc
+){
+ xf86XVInitGenericAdaptorPtr *newdrivers;
+
+ newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) *
+ (1 + NumGenDrivers));
+ if (!newdrivers)
+ return 0;
+ GenDrivers = newdrivers;
+
+ GenDrivers[NumGenDrivers++] = InitFunc;
+
+ return 1;
+}
+
+int
+xf86XVListGenericAdaptors(
+ ScrnInfoPtr pScrn,
+ XF86VideoAdaptorPtr **adaptors
+){
+ int i,j,n,num;
+ XF86VideoAdaptorPtr *DrivAdap,*new;
+
+ num = 0;
+ *adaptors = NULL;
+ for (i = 0; i < NumGenDrivers; i++) {
+ n = GenDrivers[i](pScrn,&DrivAdap);
+ if (0 == n)
+ continue;
+ new = xrealloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num+n));
+ if (NULL == new)
+ continue;
+ *adaptors = new;
+ for (j = 0; j < n; j++, num++)
+ (*adaptors)[num] = DrivAdap[j];
+ }
+ return num;
+}
+
+XF86VideoAdaptorPtr
+xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn)
+{
+ return xcalloc(1, sizeof(XF86VideoAdaptorRec));
+}
+
+void
+xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr)
+{
+ xfree(ptr);
+}
+
+
+Bool
+xf86XVScreenInit(
+ ScreenPtr pScreen,
+ XF86VideoAdaptorPtr *adaptors,
+ int num
+){
+ ScrnInfoPtr pScrn;
+ XF86XVScreenPtr ScreenPriv;
+ XvScreenPtr pxvs;
+
+ if(num <= 0 ||
+ !XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc)
+ return FALSE;
+
+ if(XF86XVGeneration != serverGeneration) {
+ if((XF86XVWindowIndex = AllocateWindowPrivateIndex()) < 0)
+ return FALSE;
+ XF86XVGeneration = serverGeneration;
+ }
+
+ if(!AllocateWindowPrivate(pScreen,XF86XVWindowIndex,0))
+ return FALSE;
+
+ if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
+
+ XF86XvScreenIndex = (*XvGetScreenIndexProc)();
+ PortResource = (*XvGetRTPortProc)();
+
+ pxvs = GET_XV_SCREEN(pScreen);
+
+ /* Anyone initializing the Xv layer must provide these two.
+ The Xv di layer calls them without even checking if they exist! */
+
+ pxvs->ddCloseScreen = xf86XVCloseScreen;
+ pxvs->ddQueryAdaptors = xf86XVQueryAdaptors;
+
+ /* The Xv di layer provides us with a private hook so that we don't
+ have to allocate our own screen private. They also provide
+ a CloseScreen hook so that we don't have to wrap it. I'm not
+ sure that I appreciate that. */
+
+ ScreenPriv = xalloc(sizeof(XF86XVScreenRec));
+ pxvs->devPriv.ptr = (pointer)ScreenPriv;
+
+ if(!ScreenPriv) return FALSE;
+
+ pScrn = xf86Screens[pScreen->myNum];
+
+ ScreenPriv->videoGC = NULL; /* for the helper */
+
+ ScreenPriv->DestroyWindow = pScreen->DestroyWindow;
+ ScreenPriv->WindowExposures = pScreen->WindowExposures;
+ ScreenPriv->ClipNotify = pScreen->ClipNotify;
+ ScreenPriv->EnterVT = pScrn->EnterVT;
+ ScreenPriv->LeaveVT = pScrn->LeaveVT;
+ ScreenPriv->AdjustFrame = pScrn->AdjustFrame;
+
+ pScreen->DestroyWindow = xf86XVDestroyWindow;
+ pScreen->WindowExposures = xf86XVWindowExposures;
+ pScreen->ClipNotify = xf86XVClipNotify;
+ pScrn->EnterVT = xf86XVEnterVT;
+ pScrn->LeaveVT = xf86XVLeaveVT;
+ if(pScrn->AdjustFrame)
+ pScrn->AdjustFrame = xf86XVAdjustFrame;
+
+ if(!xf86XVInitAdaptors(pScreen, adaptors, num))
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor)
+{
+ int i;
+
+ if(pAdaptor->name)
+ xfree(pAdaptor->name);
+
+ if(pAdaptor->pEncodings) {
+ XvEncodingPtr pEncode = pAdaptor->pEncodings;
+
+ for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++) {
+ if(pEncode->name) xfree(pEncode->name);
+ }
+ xfree(pAdaptor->pEncodings);
+ }
+
+ if(pAdaptor->pFormats)
+ xfree(pAdaptor->pFormats);
+
+ if(pAdaptor->pPorts) {
+ XvPortPtr pPort = pAdaptor->pPorts;
+ XvPortRecPrivatePtr pPriv;
+
+ for(i = 0; i < pAdaptor->nPorts; i++, pPort++) {
+ pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
+ if(pPriv) {
+ if(pPriv->clientClip)
+ REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip);
+ if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
+ REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip);
+ xfree(pPriv);
+ }
+ }
+ xfree(pAdaptor->pPorts);
+ }
+
+ if(pAdaptor->nAttributes) {
+ XvAttributePtr pAttribute = pAdaptor->pAttributes;
+
+ for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) {
+ if(pAttribute->name) xfree(pAttribute->name);
+ }
+
+ xfree(pAdaptor->pAttributes);
+ }
+
+ if(pAdaptor->nImages)
+ xfree(pAdaptor->pImages);
+
+ if(pAdaptor->devPriv.ptr)
+ xfree(pAdaptor->devPriv.ptr);
+}
+
+static Bool
+xf86XVInitAdaptors(
+ ScreenPtr pScreen,
+ XF86VideoAdaptorPtr *infoPtr,
+ int number
+) {
+ XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XF86VideoAdaptorPtr adaptorPtr;
+ XvAdaptorPtr pAdaptor, pa;
+ XvAdaptorRecPrivatePtr adaptorPriv;
+ int na, numAdaptor;
+ XvPortRecPrivatePtr portPriv;
+ XvPortPtr pPort, pp;
+ int numPort;
+ XF86AttributePtr attributePtr;
+ XvAttributePtr pAttribute, pat;
+ XF86VideoFormatPtr formatPtr;
+ XvFormatPtr pFormat, pf;
+ int numFormat, totFormat;
+ XF86VideoEncodingPtr encodingPtr;
+ XvEncodingPtr pEncode, pe;
+ XF86ImagePtr imagePtr;
+ XvImagePtr pImage, pi;
+ int numVisuals;
+ VisualPtr pVisual;
+ int i;
+
+ pxvs->nAdaptors = 0;
+ pxvs->pAdaptors = NULL;
+
+ if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec))))
+ return FALSE;
+
+ for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) {
+ adaptorPtr = infoPtr[na];
+
+ if(!adaptorPtr->StopVideo || !adaptorPtr->SetPortAttribute ||
+ !adaptorPtr->GetPortAttribute || !adaptorPtr->QueryBestSize)
+ continue;
+
+ /* client libs expect at least one encoding */
+ if(!adaptorPtr->nEncodings || !adaptorPtr->pEncodings)
+ continue;
+
+ pa->type = adaptorPtr->type;
+
+ if(!adaptorPtr->PutVideo && !adaptorPtr->GetVideo)
+ pa->type &= ~XvVideoMask;
+
+ if(!adaptorPtr->PutStill && !adaptorPtr->GetStill)
+ pa->type &= ~XvStillMask;
+
+ if(!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes)
+ pa->type &= ~XvImageMask;
+
+ if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage &&
+ !adaptorPtr->PutStill)
+ pa->type &= ~XvInputMask;
+
+ if(!adaptorPtr->GetVideo && !adaptorPtr->GetStill)
+ pa->type &= ~XvOutputMask;
+
+ if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask)))
+ continue;
+ if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask)))
+ continue;
+
+ pa->pScreen = pScreen;
+ pa->ddAllocatePort = xf86XVAllocatePort;
+ pa->ddFreePort = xf86XVFreePort;
+ pa->ddPutVideo = xf86XVPutVideo;
+ pa->ddPutStill = xf86XVPutStill;
+ pa->ddGetVideo = xf86XVGetVideo;
+ pa->ddGetStill = xf86XVGetStill;
+ pa->ddStopVideo = xf86XVStopVideo;
+ pa->ddPutImage = xf86XVPutImage;
+ pa->ddSetPortAttribute = xf86XVSetPortAttribute;
+ pa->ddGetPortAttribute = xf86XVGetPortAttribute;
+ pa->ddQueryBestSize = xf86XVQueryBestSize;
+ pa->ddQueryImageAttributes = xf86XVQueryImageAttributes;
+ if((pa->name = xalloc(strlen(adaptorPtr->name) + 1)))
+ strcpy(pa->name, adaptorPtr->name);
+
+ if(adaptorPtr->nEncodings &&
+ (pEncode = xcalloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
+
+ for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0;
+ i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++)
+ {
+ pe->id = encodingPtr->id;
+ pe->pScreen = pScreen;
+ if((pe->name = xalloc(strlen(encodingPtr->name) + 1)))
+ strcpy(pe->name, encodingPtr->name);
+ pe->width = encodingPtr->width;
+ pe->height = encodingPtr->height;
+ pe->rate.numerator = encodingPtr->rate.numerator;
+ pe->rate.denominator = encodingPtr->rate.denominator;
+ }
+ pa->nEncodings = adaptorPtr->nEncodings;
+ pa->pEncodings = pEncode;
+ }
+
+ if(adaptorPtr->nImages &&
+ (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) {
+
+ for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages;
+ i < adaptorPtr->nImages; i++, pi++, imagePtr++)
+ {
+ pi->id = imagePtr->id;
+ pi->type = imagePtr->type;
+ pi->byte_order = imagePtr->byte_order;
+ memcpy(pi->guid, imagePtr->guid, 16);
+ pi->bits_per_pixel = imagePtr->bits_per_pixel;
+ pi->format = imagePtr->format;
+ pi->num_planes = imagePtr->num_planes;
+ pi->depth = imagePtr->depth;
+ pi->red_mask = imagePtr->red_mask;
+ pi->green_mask = imagePtr->green_mask;
+ pi->blue_mask = imagePtr->blue_mask;
+ pi->y_sample_bits = imagePtr->y_sample_bits;
+ pi->u_sample_bits = imagePtr->u_sample_bits;
+ pi->v_sample_bits = imagePtr->v_sample_bits;
+ pi->horz_y_period = imagePtr->horz_y_period;
+ pi->horz_u_period = imagePtr->horz_u_period;
+ pi->horz_v_period = imagePtr->horz_v_period;
+ pi->vert_y_period = imagePtr->vert_y_period;
+ pi->vert_u_period = imagePtr->vert_u_period;
+ pi->vert_v_period = imagePtr->vert_v_period;
+ memcpy(pi->component_order, imagePtr->component_order, 32);
+ pi->scanline_order = imagePtr->scanline_order;
+ }
+ pa->nImages = adaptorPtr->nImages;
+ pa->pImages = pImage;
+ }
+
+ if(adaptorPtr->nAttributes &&
+ (pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec))))
+ {
+ for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0;
+ i < adaptorPtr->nAttributes; pat++, i++, attributePtr++)
+ {
+ pat->flags = attributePtr->flags;
+ pat->min_value = attributePtr->min_value;
+ pat->max_value = attributePtr->max_value;
+ if((pat->name = xalloc(strlen(attributePtr->name) + 1)))
+ strcpy(pat->name, attributePtr->name);
+ }
+ pa->nAttributes = adaptorPtr->nAttributes;
+ pa->pAttributes = pAttribute;
+ }
+
+
+ totFormat = adaptorPtr->nFormats;
+
+ if(!(pFormat = xcalloc(totFormat, sizeof(XvFormatRec)))) {
+ xf86XVFreeAdaptor(pa);
+ continue;
+ }
+ for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats;
+ i < adaptorPtr->nFormats; i++, formatPtr++)
+ {
+ numVisuals = pScreen->numVisuals;
+ pVisual = pScreen->visuals;
+
+ while(numVisuals--) {
+ if((pVisual->class == formatPtr->class) &&
+ (pVisual->nplanes == formatPtr->depth)) {
+
+ if(numFormat >= totFormat) {
+ void *moreSpace;
+ totFormat *= 2;
+ moreSpace = xrealloc(pFormat,
+ totFormat * sizeof(XvFormatRec));
+ if(!moreSpace) break;
+ pFormat = moreSpace;
+ pf = pFormat + numFormat;
+ }
+
+ pf->visual = pVisual->vid;
+ pf->depth = formatPtr->depth;
+
+ pf++;
+ numFormat++;
+ }
+ pVisual++;
+ }
+ }
+ pa->nFormats = numFormat;
+ pa->pFormats = pFormat;
+ if(!numFormat) {
+ xf86XVFreeAdaptor(pa);
+ continue;
+ }
+
+ if(!(adaptorPriv = xcalloc(1, sizeof(XvAdaptorRecPrivate)))) {
+ xf86XVFreeAdaptor(pa);
+ continue;
+ }
+
+ adaptorPriv->flags = adaptorPtr->flags;
+ adaptorPriv->PutVideo = adaptorPtr->PutVideo;
+ adaptorPriv->PutStill = adaptorPtr->PutStill;
+ adaptorPriv->GetVideo = adaptorPtr->GetVideo;
+ adaptorPriv->GetStill = adaptorPtr->GetStill;
+ adaptorPriv->StopVideo = adaptorPtr->StopVideo;
+ adaptorPriv->SetPortAttribute = adaptorPtr->SetPortAttribute;
+ adaptorPriv->GetPortAttribute = adaptorPtr->GetPortAttribute;
+ adaptorPriv->QueryBestSize = adaptorPtr->QueryBestSize;
+ adaptorPriv->QueryImageAttributes = adaptorPtr->QueryImageAttributes;
+ adaptorPriv->PutImage = adaptorPtr->PutImage;
+ adaptorPriv->ReputImage = adaptorPtr->ReputImage;
+
+ pa->devPriv.ptr = (pointer)adaptorPriv;
+
+ if(!(pPort = xcalloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) {
+ xf86XVFreeAdaptor(pa);
+ continue;
+ }
+ for(pp = pPort, i = 0, numPort = 0;
+ i < adaptorPtr->nPorts; i++) {
+
+ if(!(pp->id = FakeClientID(0)))
+ continue;
+
+ if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate))))
+ continue;
+
+ if(!AddResource(pp->id, PortResource, pp)) {
+ xfree(portPriv);
+ continue;
+ }
+
+ pp->pAdaptor = pa;
+ pp->pNotify = (XvPortNotifyPtr)NULL;
+ pp->pDraw = (DrawablePtr)NULL;
+ pp->client = (ClientPtr)NULL;
+ pp->grab.client = (ClientPtr)NULL;
+ pp->time = currentTime;
+ pp->devPriv.ptr = portPriv;
+
+ portPriv->pScrn = pScrn;
+ portPriv->AdaptorRec = adaptorPriv;
+ portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr;
+
+ pp++;
+ numPort++;
+ }
+ pa->nPorts = numPort;
+ pa->pPorts = pPort;
+ if(!numPort) {
+ xf86XVFreeAdaptor(pa);
+ continue;
+ }
+
+ pa->base_id = pPort->id;
+
+ pa++;
+ numAdaptor++;
+ }
+
+ if(numAdaptor) {
+ pxvs->nAdaptors = numAdaptor;
+ pxvs->pAdaptors = pAdaptor;
+ } else {
+ xfree(pAdaptor);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* Video should be clipped to the intersection of the window cliplist
+ and the client cliplist specified in the GC for which the video was
+ initialized. When we need to reclip a window, the GC that started
+ the video may not even be around anymore. That's why we save the
+ client clip from the GC when the video is initialized. We then
+ use xf86XVUpdateCompositeClip to calculate the new composite clip
+ when we need it. This is different from what DEC did. They saved
+ the GC and used it's clip list when they needed to reclip the window,
+ even if the client clip was different from the one the video was
+ initialized with. If the original GC was destroyed, they had to stop
+ the video. I like the new method better (MArk).
+
+ This function only works for windows. Will need to rewrite when
+ (if) we support pixmap rendering.
+*/
+
+static void
+xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
+{
+ RegionPtr pregWin, pCompositeClip;
+ WindowPtr pWin;
+ Bool freeCompClip = FALSE;
+
+ if(portPriv->pCompositeClip)
+ return;
+
+ pWin = (WindowPtr)portPriv->pDraw;
+
+ /* get window clip list */
+ if(portPriv->subWindowMode == IncludeInferiors) {
+ pregWin = NotClippedByChildren(pWin);
+ freeCompClip = TRUE;
+ } else
+ pregWin = &pWin->clipList;
+
+ if(!portPriv->clientClip) {
+ portPriv->pCompositeClip = pregWin;
+ portPriv->FreeCompositeClip = freeCompClip;
+ return;
+ }
+
+ pCompositeClip = REGION_CREATE(pWin->pScreen, NullBox, 1);
+ REGION_COPY(pWin->pScreen, pCompositeClip, portPriv->clientClip);
+ REGION_TRANSLATE(pWin->pScreen, pCompositeClip,
+ portPriv->pDraw->x + portPriv->clipOrg.x,
+ portPriv->pDraw->y + portPriv->clipOrg.y);
+ REGION_INTERSECT(pWin->pScreen, pCompositeClip, pregWin, pCompositeClip);
+
+ portPriv->pCompositeClip = pCompositeClip;
+ portPriv->FreeCompositeClip = TRUE;
+
+ if(freeCompClip) {
+ REGION_DESTROY(pWin->pScreen, pregWin);
+ }
+}
+
+/* Save the current clientClip and update the CompositeClip whenever
+ we have a fresh GC */
+
+static void
+xf86XVCopyClip(
+ XvPortRecPrivatePtr portPriv,
+ GCPtr pGC
+){
+ /* copy the new clip if it exists */
+ if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
+ if(!portPriv->clientClip)
+ portPriv->clientClip = REGION_CREATE(pGC->pScreen, NullBox, 1);
+ /* Note: this is in window coordinates */
+ REGION_COPY(pGC->pScreen, portPriv->clientClip, pGC->clientClip);
+ } else if(portPriv->clientClip) { /* free the old clientClip */
+ REGION_DESTROY(pGC->pScreen, portPriv->clientClip);
+ portPriv->clientClip = NULL;
+ }
+
+ /* get rid of the old clip list */
+ if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) {
+ REGION_DESTROY(pWin->pScreen, portPriv->pCompositeClip);
+ }
+
+ portPriv->clipOrg = pGC->clipOrg;
+ portPriv->pCompositeClip = pGC->pCompositeClip;
+ portPriv->FreeCompositeClip = FALSE;
+ portPriv->subWindowMode = pGC->subWindowMode;
+}
+
+static int
+xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
+{
+ RegionRec WinRegion;
+ RegionRec ClipRegion;
+ BoxRec WinBox;
+ ScreenPtr pScreen;
+ int ret = Success;
+ Bool clippedAway = FALSE;
+
+ pScreen = portPriv->pDraw->pScreen;
+ xf86XVUpdateCompositeClip(portPriv);
+
+ /* translate the video region to the screen */
+ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x;
+ WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
+ WinBox.x2 = WinBox.x1 + portPriv->drw_w;
+ WinBox.y2 = WinBox.y1 + portPriv->drw_h;
+
+ /* clip to the window composite clip */
+ REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
+ REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
+ REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
+
+ /* that's all if it's totally obscured */
+ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
+ clippedAway = TRUE;
+ goto CLIP_VIDEO_BAILOUT;
+ }
+
+ if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
+ REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
+ }
+
+ ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn,
+ portPriv->vid_x, portPriv->vid_y,
+ WinBox.x1, WinBox.y1,
+ portPriv->vid_w, portPriv->vid_h,
+ portPriv->drw_w, portPriv->drw_h,
+ &ClipRegion, portPriv->DevPriv.ptr);
+
+ if(ret == Success)
+ portPriv->isOn = XV_ON;
+
+CLIP_VIDEO_BAILOUT:
+
+ if((clippedAway || (ret != Success)) && portPriv->isOn == XV_ON) {
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
+ }
+
+ /* This clip was copied and only good for one shot */
+ if(!portPriv->FreeCompositeClip)
+ portPriv->pCompositeClip = NULL;
+
+ REGION_UNINIT(pScreen, &WinRegion);
+ REGION_UNINIT(pScreen, &ClipRegion);
+
+ return ret;
+}
+
+
+static int
+xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
+{
+ RegionRec WinRegion;
+ RegionRec ClipRegion;
+ BoxRec WinBox;
+ ScreenPtr pScreen;
+ int ret = Success;
+ Bool clippedAway = FALSE;
+
+ pScreen = portPriv->pDraw->pScreen;
+
+ xf86XVUpdateCompositeClip(portPriv);
+
+ /* translate the video region to the screen */
+ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x;
+ WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
+ WinBox.x2 = WinBox.x1 + portPriv->drw_w;
+ WinBox.y2 = WinBox.y1 + portPriv->drw_h;
+
+ /* clip to the window composite clip */
+ REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
+ REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
+ REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
+
+ /* clip and translate to the viewport */
+ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
+ RegionRec VPReg;
+ BoxRec VPBox;
+
+ VPBox.x1 = portPriv->pScrn->frameX0;
+ VPBox.y1 = portPriv->pScrn->frameY0;
+ VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.y2 = portPriv->pScrn->frameY1;
+
+ REGION_INIT(pScreen, &VPReg, &VPBox, 1);
+ REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_UNINIT(pScreen, &VPReg);
+ }
+
+ /* that's all if it's totally obscured */
+ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
+ clippedAway = TRUE;
+ goto CLIP_VIDEO_BAILOUT;
+ }
+
+ /* bailout if we have to clip but the hardware doesn't support it */
+ if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
+ BoxPtr clipBox = REGION_RECTS(&ClipRegion);
+ if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
+ {
+ clippedAway = TRUE;
+ goto CLIP_VIDEO_BAILOUT;
+ }
+ }
+
+ if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
+ REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
+ }
+
+ ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn,
+ portPriv->vid_x, portPriv->vid_y,
+ WinBox.x1, WinBox.y1,
+ portPriv->vid_w, portPriv->vid_h,
+ portPriv->drw_w, portPriv->drw_h,
+ &ClipRegion, portPriv->DevPriv.ptr);
+
+ if(ret == Success) portPriv->isOn = XV_ON;
+
+CLIP_VIDEO_BAILOUT:
+
+ if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
+ }
+
+ /* This clip was copied and only good for one shot */
+ if(!portPriv->FreeCompositeClip)
+ portPriv->pCompositeClip = NULL;
+
+ REGION_UNINIT(pScreen, &WinRegion);
+ REGION_UNINIT(pScreen, &ClipRegion);
+
+ return ret;
+}
+
+static int
+xf86XVReputImage(XvPortRecPrivatePtr portPriv)
+{
+ RegionRec WinRegion;
+ RegionRec ClipRegion;
+ BoxRec WinBox;
+ ScreenPtr pScreen;
+ int ret = Success;
+ Bool clippedAway = FALSE;
+
+ pScreen = portPriv->pDraw->pScreen;
+
+ xf86XVUpdateCompositeClip(portPriv);
+
+ /* translate the video region to the screen */
+ WinBox.x1 = portPriv->pDraw->x + portPriv->drw_x;
+ WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
+ WinBox.x2 = WinBox.x1 + portPriv->drw_w;
+ WinBox.y2 = WinBox.y1 + portPriv->drw_h;
+
+ /* clip to the window composite clip */
+ REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
+ REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
+ REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
+
+ /* clip and translate to the viewport */
+ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
+ RegionRec VPReg;
+ BoxRec VPBox;
+
+ VPBox.x1 = portPriv->pScrn->frameX0;
+ VPBox.y1 = portPriv->pScrn->frameY0;
+ VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.y2 = portPriv->pScrn->frameY1;
+
+ REGION_INIT(pScreen, &VPReg, &VPBox, 1);
+ REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_UNINIT(pScreen, &VPReg);
+ }
+
+ /* that's all if it's totally obscured */
+ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
+ clippedAway = TRUE;
+ goto CLIP_VIDEO_BAILOUT;
+ }
+
+ /* bailout if we have to clip but the hardware doesn't support it */
+ if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
+ BoxPtr clipBox = REGION_RECTS(&ClipRegion);
+ if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
+ {
+ clippedAway = TRUE;
+ goto CLIP_VIDEO_BAILOUT;
+ }
+ }
+
+ if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
+ REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
+ }
+
+ ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
+ WinBox.x1, WinBox.y1,
+ &ClipRegion, portPriv->DevPriv.ptr);
+
+ portPriv->isOn = (ret == Success) ? XV_ON : XV_OFF;
+
+CLIP_VIDEO_BAILOUT:
+
+ if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
+ }
+
+ /* This clip was copied and only good for one shot */
+ if(!portPriv->FreeCompositeClip)
+ portPriv->pCompositeClip = NULL;
+
+ REGION_UNINIT(pScreen, &WinRegion);
+ REGION_UNINIT(pScreen, &ClipRegion);
+
+ return ret;
+}
+
+
+static int
+xf86XVReputAllVideo(WindowPtr pWin, pointer data)
+{
+ XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
+
+ while(WinPriv) {
+ if(WinPriv->PortRec->type == XvInputMask)
+ xf86XVReputVideo(WinPriv->PortRec);
+ else
+ xf86XVRegetVideo(WinPriv->PortRec);
+ WinPriv = WinPriv->next;
+ }
+
+ return WT_WALKCHILDREN;
+}
+
+static int
+xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
+{
+ XF86XVWindowPtr winPriv, PrivRoot;
+
+ winPriv = PrivRoot = GET_XF86XV_WINDOW(pWin);
+
+ /* Enlist our port in the window private */
+ while(winPriv) {
+ if(winPriv->PortRec == portPriv) /* we're already listed */
+ break;
+ winPriv = winPriv->next;
+ }
+
+ if(!winPriv) {
+ winPriv = xalloc(sizeof(XF86XVWindowRec));
+ if(!winPriv) return BadAlloc;
+ winPriv->PortRec = portPriv;
+ winPriv->next = PrivRoot;
+ pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
+ }
+ return Success;
+}
+
+
+static void
+xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
+{
+ XF86XVWindowPtr winPriv, prevPriv = NULL;
+
+ winPriv = GET_XF86XV_WINDOW(pWin);
+
+ while(winPriv) {
+ if(winPriv->PortRec == portPriv) {
+ if(prevPriv)
+ prevPriv->next = winPriv->next;
+ else
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
+ (pointer)winPriv->next;
+ xfree(winPriv);
+ break;
+ }
+ prevPriv = winPriv;
+ winPriv = winPriv->next;
+ }
+ portPriv->pDraw = NULL;
+}
+
+/**** ScreenRec fields ****/
+
+static Bool
+xf86XVDestroyWindow(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+ XF86XVWindowPtr tmp, WinPriv = GET_XF86XV_WINDOW(pWin);
+ int ret;
+
+ while(WinPriv) {
+ XvPortRecPrivatePtr pPriv = WinPriv->PortRec;
+
+ if(pPriv->isOn > XV_OFF) {
+ (*pPriv->AdaptorRec->StopVideo)(
+ pPriv->pScrn, pPriv->DevPriv.ptr, TRUE);
+ pPriv->isOn = XV_OFF;
+ }
+
+ pPriv->pDraw = NULL;
+ tmp = WinPriv;
+ WinPriv = WinPriv->next;
+ xfree(tmp);
+ }
+
+ pWin->devPrivates[XF86XVWindowIndex].ptr = NULL;
+
+ pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
+ ret = (*pScreen->DestroyWindow)(pWin);
+ pScreen->DestroyWindow = xf86XVDestroyWindow;
+
+ return ret;
+}
+
+
+static void
+xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+ XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
+ XF86XVWindowPtr pPrev;
+ XvPortRecPrivatePtr pPriv;
+ Bool AreasExposed;
+
+ AreasExposed = (WinPriv && reg1 && REGION_NOTEMPTY(pScreen, reg1));
+
+ pScreen->WindowExposures = ScreenPriv->WindowExposures;
+ (*pScreen->WindowExposures)(pWin, reg1, reg2);
+ pScreen->WindowExposures = xf86XVWindowExposures;
+
+ /* filter out XClearWindow/Area */
+ if (!pWin->valdata) return;
+
+ pPrev = NULL;
+
+ while(WinPriv) {
+ pPriv = WinPriv->PortRec;
+
+ /* Reput anyone with a reput function */
+
+ switch(pPriv->type) {
+ case XvInputMask:
+ xf86XVReputVideo(pPriv);
+ break;
+ case XvOutputMask:
+ xf86XVRegetVideo(pPriv);
+ break;
+ default: /* overlaid still/image*/
+ if (pPriv->AdaptorRec->ReputImage)
+ xf86XVReputImage(pPriv);
+ else if(AreasExposed) {
+ XF86XVWindowPtr tmp;
+
+ if (pPriv->isOn == XV_ON) {
+ (*pPriv->AdaptorRec->StopVideo)(
+ pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
+ pPriv->isOn = XV_PENDING;
+ }
+ pPriv->pDraw = NULL;
+
+ if(!pPrev)
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
+ (pointer)(WinPriv->next);
+ else
+ pPrev->next = WinPriv->next;
+ tmp = WinPriv;
+ WinPriv = WinPriv->next;
+ xfree(tmp);
+ continue;
+ }
+ break;
+ }
+ pPrev = WinPriv;
+ WinPriv = WinPriv->next;
+ }
+}
+
+
+static void
+xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+ XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin);
+ XF86XVWindowPtr tmp, pPrev = NULL;
+ XvPortRecPrivatePtr pPriv;
+ Bool visible = (pWin->visibility == VisibilityUnobscured) ||
+ (pWin->visibility == VisibilityPartiallyObscured);
+
+ while(WinPriv) {
+ pPriv = WinPriv->PortRec;
+
+ if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
+ REGION_DESTROY(pScreen, pPriv->pCompositeClip);
+
+ pPriv->pCompositeClip = NULL;
+
+ /* Stop everything except images, but stop them too if the
+ window isn't visible. But we only remove the images. */
+
+ if(pPriv->type || !visible) {
+ if(pPriv->isOn == XV_ON) {
+ (*pPriv->AdaptorRec->StopVideo)(
+ pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
+ pPriv->isOn = XV_PENDING;
+ }
+
+ if(!pPriv->type) { /* overlaid still/image */
+ pPriv->pDraw = NULL;
+
+ if(!pPrev)
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
+ (pointer)(WinPriv->next);
+ else
+ pPrev->next = WinPriv->next;
+ tmp = WinPriv;
+ WinPriv = WinPriv->next;
+ xfree(tmp);
+ continue;
+ }
+ }
+
+ pPrev = WinPriv;
+ WinPriv = WinPriv->next;
+ }
+
+ if(ScreenPriv->ClipNotify) {
+ pScreen->ClipNotify = ScreenPriv->ClipNotify;
+ (*pScreen->ClipNotify)(pWin, dx, dy);
+ pScreen->ClipNotify = xf86XVClipNotify;
+ }
+}
+
+
+
+/**** Required XvScreenRec fields ****/
+
+static Bool
+xf86XVCloseScreen(int i, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
+ XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+ XvAdaptorPtr pa;
+ int c;
+
+ if(!ScreenPriv) return TRUE;
+
+ if(ScreenPriv->videoGC) {
+ FreeGC(ScreenPriv->videoGC, 0);
+ ScreenPriv->videoGC = NULL;
+ }
+
+ pScreen->DestroyWindow = ScreenPriv->DestroyWindow;
+ pScreen->WindowExposures = ScreenPriv->WindowExposures;
+ pScreen->ClipNotify = ScreenPriv->ClipNotify;
+
+ pScrn->EnterVT = ScreenPriv->EnterVT;
+ pScrn->LeaveVT = ScreenPriv->LeaveVT;
+ pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
+
+ for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
+ xf86XVFreeAdaptor(pa);
+ }
+
+ if(pxvs->pAdaptors)
+ xfree(pxvs->pAdaptors);
+
+ xfree(ScreenPriv);
+
+
+ return TRUE;
+}
+
+
+static int
+xf86XVQueryAdaptors(
+ ScreenPtr pScreen,
+ XvAdaptorPtr *p_pAdaptors,
+ int *p_nAdaptors
+){
+ XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
+
+ *p_nAdaptors = pxvs->nAdaptors;
+ *p_pAdaptors = pxvs->pAdaptors;
+
+ return (Success);
+}
+
+
+/**** ScrnInfoRec fields ****/
+
+static Bool
+xf86XVEnterVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+ Bool ret;
+
+ ret = (*ScreenPriv->EnterVT)(index, flags);
+
+ if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0);
+
+ return ret;
+}
+
+static void
+xf86XVLeaveVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
+ XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+ XvAdaptorPtr pAdaptor;
+ XvPortPtr pPort;
+ XvPortRecPrivatePtr pPriv;
+ int i, j;
+
+ for(i = 0; i < pxvs->nAdaptors; i++) {
+ pAdaptor = &pxvs->pAdaptors[i];
+ for(j = 0; j < pAdaptor->nPorts; j++) {
+ pPort = &pAdaptor->pPorts[j];
+ pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
+ if(pPriv->isOn > XV_OFF) {
+
+ (*pPriv->AdaptorRec->StopVideo)(
+ pPriv->pScrn, pPriv->DevPriv.ptr, TRUE);
+ pPriv->isOn = XV_OFF;
+
+ if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
+ REGION_DESTROY(pScreen, pPriv->pCompositeClip);
+
+ pPriv->pCompositeClip = NULL;
+
+ if(!pPriv->type && pPriv->pDraw) { /* still */
+ xf86XVRemovePortFromWindow((WindowPtr)pPriv->pDraw, pPriv);
+ }
+ }
+ }
+ }
+
+ (*ScreenPriv->LeaveVT)(index, flags);
+}
+
+static void
+xf86XVAdjustFrame(int index, int x, int y, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[index];
+ ScreenPtr pScreen = pScrn->pScreen;
+ XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
+ XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+ WindowPtr pWin;
+ XvAdaptorPtr pa;
+ int c, i;
+
+ if(ScreenPriv->AdjustFrame) {
+ pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
+ (*pScrn->AdjustFrame)(index, x, y, flags);
+ pScrn->AdjustFrame = xf86XVAdjustFrame;
+ }
+
+ for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) {
+ XvPortPtr pPort = pa->pPorts;
+ XvPortRecPrivatePtr pPriv;
+
+ for(i = pa->nPorts; i > 0; i--, pPort++) {
+ pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
+
+ if(!pPriv->type && (pPriv->isOn == XV_ON)) { /* overlaid still/image */
+
+ if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
+ REGION_DESTROY(pScreen, pPriv->pCompositeClip);
+
+ pPriv->pCompositeClip = NULL;
+
+ pWin = (WindowPtr)pPriv->pDraw;
+
+ if ((pPriv->AdaptorRec->ReputImage) &&
+ ((pWin->visibility == VisibilityUnobscured) ||
+ (pWin->visibility == VisibilityPartiallyObscured)))
+ {
+ xf86XVReputImage(pPriv);
+ } else {
+ (*pPriv->AdaptorRec->StopVideo)(
+ pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
+ xf86XVRemovePortFromWindow(pWin, pPriv);
+ pPriv->isOn = XV_PENDING;
+ continue;
+ }
+ }
+ }
+ }
+}
+
+
+/**** XvAdaptorRec fields ****/
+
+static int
+xf86XVAllocatePort(
+ unsigned long port,
+ XvPortPtr pPort,
+ XvPortPtr *ppPort
+){
+ *ppPort = pPort;
+ return Success;
+}
+
+
+
+static int
+xf86XVFreePort(XvPortPtr pPort)
+{
+ return Success;
+}
+
+
+static int
+xf86XVPutVideo(
+ ClientPtr client,
+ DrawablePtr pDraw,
+ XvPortPtr pPort,
+ GCPtr pGC,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
+ INT16 drw_x, INT16 drw_y,
+ CARD16 drw_w, CARD16 drw_h
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+ int result;
+
+ /* No dumping video to pixmaps... For now anyhow */
+ if(pDraw->type != DRAWABLE_WINDOW) {
+ pPort->pDraw = (DrawablePtr)NULL;
+ return BadAlloc;
+ }
+
+ /* If we are changing windows, unregister our port in the old window */
+ if(portPriv->pDraw && (portPriv->pDraw != pDraw))
+ xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
+
+ /* Register our port with the new window */
+ result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
+ if(result != Success) return result;
+
+ portPriv->pDraw = pDraw;
+ portPriv->type = XvInputMask;
+
+ /* save a copy of these parameters */
+ portPriv->vid_x = vid_x; portPriv->vid_y = vid_y;
+ portPriv->vid_w = vid_w; portPriv->vid_h = vid_h;
+ portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
+ portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
+
+ /* make sure we have the most recent copy of the clientClip */
+ xf86XVCopyClip(portPriv, pGC);
+
+ /* To indicate to the DI layer that we were successful */
+ pPort->pDraw = pDraw;
+
+ if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
+
+ return(xf86XVReputVideo(portPriv));
+}
+
+static int
+xf86XVPutStill(
+ ClientPtr client,
+ DrawablePtr pDraw,
+ XvPortPtr pPort,
+ GCPtr pGC,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
+ INT16 drw_x, INT16 drw_y,
+ CARD16 drw_w, CARD16 drw_h
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+ ScreenPtr pScreen;
+ RegionRec WinRegion;
+ RegionRec ClipRegion;
+ BoxRec WinBox;
+ int ret = Success;
+ Bool clippedAway = FALSE;
+
+ if (pDraw->type != DRAWABLE_WINDOW)
+ return BadAlloc;
+
+ if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
+
+ pScreen = pDraw->pScreen;
+
+ WinBox.x1 = pDraw->x + drw_x;
+ WinBox.y1 = pDraw->y + drw_y;
+ WinBox.x2 = WinBox.x1 + drw_w;
+ WinBox.y2 = WinBox.y1 + drw_h;
+
+ REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
+ REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
+
+ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
+ RegionRec VPReg;
+ BoxRec VPBox;
+
+ VPBox.x1 = portPriv->pScrn->frameX0;
+ VPBox.y1 = portPriv->pScrn->frameY0;
+ VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.y2 = portPriv->pScrn->frameY1;
+
+ REGION_INIT(pScreen, &VPReg, &VPBox, 1);
+ REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_UNINIT(pScreen, &VPReg);
+ }
+
+ if(portPriv->pDraw) {
+ xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
+ }
+
+ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
+ clippedAway = TRUE;
+ goto PUT_STILL_BAILOUT;
+ }
+
+ if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
+ BoxPtr clipBox = REGION_RECTS(&ClipRegion);
+ if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
+ {
+ clippedAway = TRUE;
+ goto PUT_STILL_BAILOUT;
+ }
+ }
+
+ if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
+ REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
+ }
+
+ ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn,
+ vid_x, vid_y, WinBox.x1, WinBox.y1,
+ vid_w, vid_h, drw_w, drw_h,
+ &ClipRegion, portPriv->DevPriv.ptr);
+
+ if((ret == Success) &&
+ (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_STILLS)) {
+
+ xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
+ portPriv->isOn = XV_ON;
+ portPriv->pDraw = pDraw;
+ portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
+ portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
+ portPriv->type = 0; /* no mask means it's transient and should
+ not be reput once it's removed */
+ pPort->pDraw = pDraw; /* make sure we can get stop requests */
+ }
+
+PUT_STILL_BAILOUT:
+
+ if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
+ }
+
+ REGION_UNINIT(pScreen, &WinRegion);
+ REGION_UNINIT(pScreen, &ClipRegion);
+
+ return ret;
+}
+
+static int
+xf86XVGetVideo(
+ ClientPtr client,
+ DrawablePtr pDraw,
+ XvPortPtr pPort,
+ GCPtr pGC,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
+ INT16 drw_x, INT16 drw_y,
+ CARD16 drw_w, CARD16 drw_h
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+ int result;
+
+ /* No pixmaps... For now anyhow */
+ if(pDraw->type != DRAWABLE_WINDOW) {
+ pPort->pDraw = (DrawablePtr)NULL;
+ return BadAlloc;
+ }
+
+ /* If we are changing windows, unregister our port in the old window */
+ if(portPriv->pDraw && (portPriv->pDraw != pDraw))
+ xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
+
+ /* Register our port with the new window */
+ result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
+ if(result != Success) return result;
+
+ portPriv->pDraw = pDraw;
+ portPriv->type = XvOutputMask;
+
+ /* save a copy of these parameters */
+ portPriv->vid_x = vid_x; portPriv->vid_y = vid_y;
+ portPriv->vid_w = vid_w; portPriv->vid_h = vid_h;
+ portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
+ portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
+
+ /* make sure we have the most recent copy of the clientClip */
+ xf86XVCopyClip(portPriv, pGC);
+
+ /* To indicate to the DI layer that we were successful */
+ pPort->pDraw = pDraw;
+
+ if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
+
+ return(xf86XVRegetVideo(portPriv));
+}
+
+static int
+xf86XVGetStill(
+ ClientPtr client,
+ DrawablePtr pDraw,
+ XvPortPtr pPort,
+ GCPtr pGC,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
+ INT16 drw_x, INT16 drw_y,
+ CARD16 drw_w, CARD16 drw_h
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+ ScreenPtr pScreen;
+ RegionRec WinRegion;
+ RegionRec ClipRegion;
+ BoxRec WinBox;
+ int ret = Success;
+ Bool clippedAway = FALSE;
+
+ if (pDraw->type != DRAWABLE_WINDOW)
+ return BadAlloc;
+
+ if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
+
+ pScreen = pDraw->pScreen;
+
+ WinBox.x1 = pDraw->x + drw_x;
+ WinBox.y1 = pDraw->y + drw_y;
+ WinBox.x2 = WinBox.x1 + drw_w;
+ WinBox.y2 = WinBox.y1 + drw_h;
+
+ REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
+ REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
+
+ if(portPriv->pDraw) {
+ xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
+ }
+
+ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
+ clippedAway = TRUE;
+ goto GET_STILL_BAILOUT;
+ }
+
+ if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
+ REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
+ }
+
+ ret = (*portPriv->AdaptorRec->GetStill)(portPriv->pScrn,
+ vid_x, vid_y, WinBox.x1, WinBox.y1,
+ vid_w, vid_h, drw_w, drw_h,
+ &ClipRegion, portPriv->DevPriv.ptr);
+
+GET_STILL_BAILOUT:
+
+ if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
+ }
+
+ REGION_UNINIT(pScreen, &WinRegion);
+ REGION_UNINIT(pScreen, &ClipRegion);
+
+ return ret;
+}
+
+
+
+static int
+xf86XVStopVideo(
+ ClientPtr client,
+ XvPortPtr pPort,
+ DrawablePtr pDraw
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+
+ if(pDraw->type != DRAWABLE_WINDOW)
+ return BadAlloc;
+
+ xf86XVRemovePortFromWindow((WindowPtr)pDraw, portPriv);
+
+ if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
+
+ /* Must free resources. */
+
+ if(portPriv->isOn > XV_OFF) {
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, TRUE);
+ portPriv->isOn = XV_OFF;
+ }
+
+ return Success;
+}
+
+static int
+xf86XVSetPortAttribute(
+ ClientPtr client,
+ XvPortPtr pPort,
+ Atom attribute,
+ INT32 value
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+
+ return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->pScrn,
+ attribute, value, portPriv->DevPriv.ptr));
+}
+
+
+static int
+xf86XVGetPortAttribute(
+ ClientPtr client,
+ XvPortPtr pPort,
+ Atom attribute,
+ INT32 *p_value
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+
+ return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->pScrn,
+ attribute, p_value, portPriv->DevPriv.ptr));
+}
+
+
+
+static int
+xf86XVQueryBestSize(
+ ClientPtr client,
+ XvPortPtr pPort,
+ CARD8 motion,
+ CARD16 vid_w, CARD16 vid_h,
+ CARD16 drw_w, CARD16 drw_h,
+ unsigned int *p_w, unsigned int *p_h
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+
+ (*portPriv->AdaptorRec->QueryBestSize)(portPriv->pScrn,
+ (Bool)motion, vid_w, vid_h, drw_w, drw_h,
+ p_w, p_h, portPriv->DevPriv.ptr);
+
+ return Success;
+}
+
+
+static int
+xf86XVPutImage(
+ ClientPtr client,
+ DrawablePtr pDraw,
+ XvPortPtr pPort,
+ GCPtr pGC,
+ INT16 src_x, INT16 src_y,
+ CARD16 src_w, CARD16 src_h,
+ INT16 drw_x, INT16 drw_y,
+ CARD16 drw_w, CARD16 drw_h,
+ XvImagePtr format,
+ unsigned char* data,
+ Bool sync,
+ CARD16 width, CARD16 height
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+ ScreenPtr pScreen;
+ RegionRec WinRegion;
+ RegionRec ClipRegion;
+ BoxRec WinBox;
+ int ret = Success;
+ Bool clippedAway = FALSE;
+
+ if (pDraw->type != DRAWABLE_WINDOW)
+ return BadAlloc;
+
+ if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
+
+ pScreen = pDraw->pScreen;
+
+ WinBox.x1 = pDraw->x + drw_x;
+ WinBox.y1 = pDraw->y + drw_y;
+ WinBox.x2 = WinBox.x1 + drw_w;
+ WinBox.y2 = WinBox.y1 + drw_h;
+
+ REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
+ REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
+
+ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
+ RegionRec VPReg;
+ BoxRec VPBox;
+
+ VPBox.x1 = portPriv->pScrn->frameX0;
+ VPBox.y1 = portPriv->pScrn->frameY0;
+ VPBox.x2 = portPriv->pScrn->frameX1 + 1;
+ VPBox.y2 = portPriv->pScrn->frameY1 + 1;
+
+ REGION_INIT(pScreen, &VPReg, &VPBox, 1);
+ REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_UNINIT(pScreen, &VPReg);
+ }
+
+ if(portPriv->pDraw) {
+ xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
+ }
+
+ if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
+ clippedAway = TRUE;
+ goto PUT_IMAGE_BAILOUT;
+ }
+
+ if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
+ BoxPtr clipBox = REGION_RECTS(&ClipRegion);
+ if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
+ {
+ clippedAway = TRUE;
+ goto PUT_IMAGE_BAILOUT;
+ }
+ }
+
+ if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
+ REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
+ }
+
+ ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn,
+ src_x, src_y, WinBox.x1, WinBox.y1,
+ src_w, src_h, drw_w, drw_h, format->id, data, width, height,
+ sync, &ClipRegion, portPriv->DevPriv.ptr);
+
+ if((ret == Success) &&
+ (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
+
+ xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
+ portPriv->isOn = XV_ON;
+ portPriv->pDraw = pDraw;
+ portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
+ portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
+ portPriv->type = 0; /* no mask means it's transient and should
+ not be reput once it's removed */
+ pPort->pDraw = pDraw; /* make sure we can get stop requests */
+ }
+
+PUT_IMAGE_BAILOUT:
+
+ if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
+ }
+
+ REGION_UNINIT(pScreen, &WinRegion);
+ REGION_UNINIT(pScreen, &ClipRegion);
+
+ return ret;
+}
+
+
+static int
+xf86XVQueryImageAttributes(
+ ClientPtr client,
+ XvPortPtr pPort,
+ XvImagePtr format,
+ CARD16 *width,
+ CARD16 *height,
+ int *pitches,
+ int *offsets
+){
+ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+
+ return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->pScrn,
+ format->id, width, height, pitches, offsets);
+}
+
+void
+xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
+{
+ XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
+ DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
+ XID pval[2];
+ BoxPtr pbox = REGION_RECTS(clipboxes);
+ int i, nbox = REGION_NUM_RECTS(clipboxes);
+ xRectangle *rects;
+
+ if(!xf86Screens[pScreen->myNum]->vtSema) return;
+
+ if(!ScreenPriv->videoGC) {
+ int status;
+ pval[0] = key;
+ pval[1] = IncludeInferiors;
+ ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode,
+ pval, &status);
+ if(!ScreenPriv->videoGC) return;
+ ValidateGC(root, ScreenPriv->videoGC);
+ } else if (key != ScreenPriv->videoGC->fgPixel){
+ pval[0] = key;
+ ChangeGC(ScreenPriv->videoGC, GCForeground, pval);
+ ValidateGC(root, ScreenPriv->videoGC);
+ }
+
+ rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle));
+
+ for(i = 0; i < nbox; i++, pbox++) {
+ rects[i].x = pbox->x1;
+ rects[i].y = pbox->y1;
+ rects[i].width = pbox->x2 - pbox->x1;
+ rects[i].height = pbox->y2 - pbox->y1;
+ }
+
+ (*ScreenPriv->videoGC->ops->PolyFillRect)(
+ root, ScreenPriv->videoGC, nbox, rects);
+
+ DEALLOCATE_LOCAL(rects);
+}
+
+/* xf86XVClipVideoHelper -
+
+ Takes the dst box in standard X BoxRec form (top and left
+ edges inclusive, bottom and right exclusive). The new dst
+ box is returned. The source boundaries are given (x1, y1
+ inclusive, x2, y2 exclusive) and returned are the new source
+ boundaries in 16.16 fixed point.
+*/
+
+#define DummyScreen screenInfo.screens[0]
+
+Bool
+xf86XVClipVideoHelper(
+ BoxPtr dst,
+ INT32 *xa,
+ INT32 *xb,
+ INT32 *ya,
+ INT32 *yb,
+ RegionPtr reg,
+ INT32 width,
+ INT32 height
+){
+ INT32 vscale, hscale, delta;
+ BoxPtr extents = REGION_EXTENTS(DummyScreen, reg);
+ int diff;
+
+ hscale = ((*xb - *xa) << 16) / (dst->x2 - dst->x1);
+ vscale = ((*yb - *ya) << 16) / (dst->y2 - dst->y1);
+
+ *xa <<= 16; *xb <<= 16;
+ *ya <<= 16; *yb <<= 16;
+
+ diff = extents->x1 - dst->x1;
+ if(diff > 0) {
+ dst->x1 = extents->x1;
+ *xa += diff * hscale;
+ }
+ diff = dst->x2 - extents->x2;
+ if(diff > 0) {
+ dst->x2 = extents->x2;
+ *xb -= diff * hscale;
+ }
+ diff = extents->y1 - dst->y1;
+ if(diff > 0) {
+ dst->y1 = extents->y1;
+ *ya += diff * vscale;
+ }
+ diff = dst->y2 - extents->y2;
+ if(diff > 0) {
+ dst->y2 = extents->y2;
+ *yb -= diff * vscale;
+ }
+
+ if(*xa < 0) {
+ diff = (- *xa + hscale - 1)/ hscale;
+ dst->x1 += diff;
+ *xa += diff * hscale;
+ }
+ delta = *xb - (width << 16);
+ if(delta > 0) {
+ diff = (delta + hscale - 1)/ hscale;
+ dst->x2 -= diff;
+ *xb -= diff * hscale;
+ }
+ if(*xa >= *xb) return FALSE;
+
+ if(*ya < 0) {
+ diff = (- *ya + vscale - 1)/ vscale;
+ dst->y1 += diff;
+ *ya += diff * vscale;
+ }
+ delta = *yb - (height << 16);
+ if(delta > 0) {
+ diff = (delta + vscale - 1)/ vscale;
+ dst->y2 -= diff;
+ *yb -= diff * vscale;
+ }
+ if(*ya >= *yb) return FALSE;
+
+ if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) ||
+ (dst->y1 != extents->y1) || (dst->y2 != extents->y2))
+ {
+ RegionRec clipReg;
+ REGION_INIT(DummyScreen, &clipReg, dst, 1);
+ REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
+ REGION_UNINIT(DummyScreen, &clipReg);
+ }
+ return TRUE;
+}
+
+
+/**************** Offscreen surface stuff *******************/
+
+typedef struct {
+ XF86OffscreenImagePtr images;
+ int num;
+} OffscreenImageRec;
+
+static OffscreenImageRec OffscreenImages[MAXSCREENS];
+static Bool offscreenInited = FALSE;
+
+Bool
+xf86XVRegisterOffscreenImages(
+ ScreenPtr pScreen,
+ XF86OffscreenImagePtr images,
+ int num
+){
+ if(!offscreenInited) {
+ bzero(OffscreenImages, sizeof(OffscreenImages[MAXSCREENS]));
+ offscreenInited = TRUE;
+ }
+
+ OffscreenImages[pScreen->myNum].num = num;
+ OffscreenImages[pScreen->myNum].images = images;
+
+ return TRUE;
+}
+
+XF86OffscreenImagePtr
+xf86XVQueryOffscreenImages(
+ ScreenPtr pScreen,
+ int *num
+){
+ if(!offscreenInited) {
+ *num = 0;
+ return NULL;
+ }
+
+ *num = OffscreenImages[pScreen->myNum].num;
+ return OffscreenImages[pScreen->myNum].images;
+}
diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h
new file mode 100644
index 000000000..9fd6b4edf
--- /dev/null
+++ b/hw/xfree86/common/xf86xv.h
@@ -0,0 +1,272 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.23 2002/11/09 01:18:33 keithp Exp $ */
+
+#ifndef _XF86XV_H_
+#define _XF86XV_H_
+
+#include "xvdix.h"
+#include "xf86str.h"
+
+#define VIDEO_NO_CLIPPING 0x00000001
+#define VIDEO_INVERT_CLIPLIST 0x00000002
+#define VIDEO_OVERLAID_IMAGES 0x00000004
+#define VIDEO_OVERLAID_STILLS 0x00000008
+#define VIDEO_CLIP_TO_VIEWPORT 0x00000010
+
+typedef struct {
+ int id;
+ int type;
+ int byte_order;
+ unsigned char guid[16];
+ int bits_per_pixel;
+ int format;
+ int num_planes;
+
+ /* for RGB formats only */
+ int depth;
+ unsigned int red_mask;
+ unsigned int green_mask;
+ unsigned int blue_mask;
+
+ /* for YUV formats only */
+ unsigned int y_sample_bits;
+ unsigned int u_sample_bits;
+ unsigned int v_sample_bits;
+ unsigned int horz_y_period;
+ unsigned int horz_u_period;
+ unsigned int horz_v_period;
+ unsigned int vert_y_period;
+ unsigned int vert_u_period;
+ unsigned int vert_v_period;
+ char component_order[32];
+ int scanline_order;
+} XF86ImageRec, *XF86ImagePtr;
+
+
+typedef struct {
+ ScrnInfoPtr pScrn;
+ int id;
+ unsigned short width, height;
+ int *pitches; /* bytes */
+ int *offsets; /* in bytes from start of framebuffer */
+ DevUnion devPrivate;
+} XF86SurfaceRec, *XF86SurfacePtr;
+
+
+typedef int (* PutVideoFuncPtr)( ScrnInfoPtr pScrn,
+ short vid_x, short vid_y, short drw_x, short drw_y,
+ short vid_w, short vid_h, short drw_w, short drw_h,
+ RegionPtr clipBoxes, pointer data );
+typedef int (* PutStillFuncPtr)( ScrnInfoPtr pScrn,
+ short vid_x, short vid_y, short drw_x, short drw_y,
+ short vid_w, short vid_h, short drw_w, short drw_h,
+ RegionPtr clipBoxes, pointer data );
+typedef int (* GetVideoFuncPtr)( ScrnInfoPtr pScrn,
+ short vid_x, short vid_y, short drw_x, short drw_y,
+ short vid_w, short vid_h, short drw_w, short drw_h,
+ RegionPtr clipBoxes, pointer data );
+typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn,
+ short vid_x, short vid_y, short drw_x, short drw_y,
+ short vid_w, short vid_h, short drw_w, short drw_h,
+ RegionPtr clipBoxes, pointer data );
+typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn, pointer data, Bool Exit);
+typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,
+ INT32 value, pointer data);
+typedef int (* GetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute,
+ INT32 *value, pointer data);
+typedef void (* QueryBestSizeFuncPtr)(ScrnInfoPtr pScrn, Bool motion,
+ short vid_w, short vid_h, short drw_w, short drw_h,
+ unsigned int *p_w, unsigned int *p_h, pointer data);
+typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn,
+ short src_x, short src_y, short drw_x, short drw_y,
+ short src_w, short src_h, short drw_w, short drw_h,
+ int image, unsigned char* buf, short width, short height, Bool Sync,
+ RegionPtr clipBoxes, pointer data );
+typedef int (* ReputImageFuncPtr)( ScrnInfoPtr pScrn, short drw_x, short drw_y,
+ RegionPtr clipBoxes, pointer data );
+typedef int (*QueryImageAttributesFuncPtr)(ScrnInfoPtr pScrn,
+ int image, unsigned short *width, unsigned short *height,
+ int *pitches, int *offsets);
+
+typedef enum {
+ XV_OFF,
+ XV_PENDING,
+ XV_ON
+} XvStatus;
+
+/*** this is what the driver needs to fill out ***/
+
+typedef struct {
+ int id;
+ char *name;
+ unsigned short width, height;
+ XvRationalRec rate;
+} XF86VideoEncodingRec, *XF86VideoEncodingPtr;
+
+typedef struct {
+ char depth;
+ short class;
+} XF86VideoFormatRec, *XF86VideoFormatPtr;
+
+typedef struct {
+ int flags;
+ int min_value;
+ int max_value;
+ char *name;
+} XF86AttributeRec, *XF86AttributePtr;
+
+typedef struct {
+ unsigned int type;
+ int flags;
+ char *name;
+ int nEncodings;
+ XF86VideoEncodingPtr pEncodings;
+ int nFormats;
+ XF86VideoFormatPtr pFormats;
+ int nPorts;
+ DevUnion *pPortPrivates;
+ int nAttributes;
+ XF86AttributePtr pAttributes;
+ int nImages;
+ XF86ImagePtr pImages;
+ PutVideoFuncPtr PutVideo;
+ PutStillFuncPtr PutStill;
+ GetVideoFuncPtr GetVideo;
+ GetStillFuncPtr GetStill;
+ StopVideoFuncPtr StopVideo;
+ SetPortAttributeFuncPtr SetPortAttribute;
+ GetPortAttributeFuncPtr GetPortAttribute;
+ QueryBestSizeFuncPtr QueryBestSize;
+ PutImageFuncPtr PutImage;
+ ReputImageFuncPtr ReputImage;
+ QueryImageAttributesFuncPtr QueryImageAttributes;
+} XF86VideoAdaptorRec, *XF86VideoAdaptorPtr;
+
+typedef struct {
+ XF86ImagePtr image;
+ int flags;
+ int (*alloc_surface)(ScrnInfoPtr pScrn,
+ int id,
+ unsigned short width,
+ unsigned short height,
+ XF86SurfacePtr surface);
+ int (*free_surface)(XF86SurfacePtr surface);
+ int (*display) (XF86SurfacePtr surface,
+ short vid_x, short vid_y,
+ short drw_x, short drw_y,
+ short vid_w, short vid_h,
+ short drw_w, short drw_h,
+ RegionPtr clipBoxes);
+ int (*stop) (XF86SurfacePtr surface);
+ int (*getAttribute) (ScrnInfoPtr pScrn, Atom attr, INT32 *value);
+ int (*setAttribute) (ScrnInfoPtr pScrn, Atom attr, INT32 value);
+ int max_width;
+ int max_height;
+ int num_attributes;
+ XF86AttributePtr attributes;
+} XF86OffscreenImageRec, *XF86OffscreenImagePtr;
+
+Bool
+xf86XVScreenInit(
+ ScreenPtr pScreen,
+ XF86VideoAdaptorPtr *Adaptors,
+ int num
+);
+
+typedef int (* xf86XVInitGenericAdaptorPtr)(ScrnInfoPtr pScrn,
+ XF86VideoAdaptorPtr **Adaptors);
+
+int
+xf86XVRegisterGenericAdaptorDriver(
+ xf86XVInitGenericAdaptorPtr InitFunc
+);
+
+int
+xf86XVListGenericAdaptors(
+ ScrnInfoPtr pScrn,
+ XF86VideoAdaptorPtr **Adaptors
+);
+
+Bool
+xf86XVRegisterOffscreenImages(
+ ScreenPtr pScreen,
+ XF86OffscreenImagePtr images,
+ int num
+);
+
+XF86OffscreenImagePtr
+xf86XVQueryOffscreenImages(
+ ScreenPtr pScreen,
+ int *num
+);
+
+XF86VideoAdaptorPtr xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn);
+
+void xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr);
+
+void
+xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes);
+
+Bool
+xf86XVClipVideoHelper(
+ BoxPtr dst,
+ INT32 *xa,
+ INT32 *xb,
+ INT32 *ya,
+ INT32 *yb,
+ RegionPtr reg,
+ INT32 width,
+ INT32 height
+);
+
+/*** These are DDX layer privates ***/
+
+extern int XF86XvScreenIndex;
+
+typedef struct {
+ DestroyWindowProcPtr DestroyWindow;
+ ClipNotifyProcPtr ClipNotify;
+ WindowExposuresProcPtr WindowExposures;
+ void (*AdjustFrame)(int, int, int, int);
+ Bool (*EnterVT)(int, int);
+ void (*LeaveVT)(int, int);
+ GCPtr videoGC;
+} XF86XVScreenRec, *XF86XVScreenPtr;
+
+typedef struct {
+ int flags;
+ PutVideoFuncPtr PutVideo;
+ PutStillFuncPtr PutStill;
+ GetVideoFuncPtr GetVideo;
+ GetStillFuncPtr GetStill;
+ StopVideoFuncPtr StopVideo;
+ SetPortAttributeFuncPtr SetPortAttribute;
+ GetPortAttributeFuncPtr GetPortAttribute;
+ QueryBestSizeFuncPtr QueryBestSize;
+ PutImageFuncPtr PutImage;
+ ReputImageFuncPtr ReputImage;
+ QueryImageAttributesFuncPtr QueryImageAttributes;
+} XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr;
+
+typedef struct {
+ ScrnInfoPtr pScrn;
+ DrawablePtr pDraw;
+ unsigned char type;
+ unsigned int subWindowMode;
+ DDXPointRec clipOrg;
+ RegionPtr clientClip;
+ RegionPtr pCompositeClip;
+ Bool FreeCompositeClip;
+ XvAdaptorRecPrivatePtr AdaptorRec;
+ XvStatus isOn;
+ Bool moved;
+ int vid_x, vid_y, vid_w, vid_h;
+ int drw_x, drw_y, drw_w, drw_h;
+ DevUnion DevPriv;
+} XvPortRecPrivate, *XvPortRecPrivatePtr;
+
+typedef struct _XF86XVWindowRec{
+ XvPortRecPrivatePtr PortRec;
+ struct _XF86XVWindowRec *next;
+} XF86XVWindowRec, *XF86XVWindowPtr;
+
+#endif /* _XF86XV_H_ */
diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
new file mode 100644
index 000000000..4559359ec
--- /dev/null
+++ b/hw/xfree86/common/xf86xvmc.c
@@ -0,0 +1,201 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.3 2001/04/01 14:00:08 tsi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "Xproto.h"
+#include "scrnintstr.h"
+#include "resource.h"
+#include "dixstruct.h"
+
+#ifdef XFree86LOADER
+#include "xvmodproc.h"
+#endif
+
+#include "xf86xvmc.h"
+
+#ifdef XFree86LOADER
+int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL;
+#else
+int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = XvMCScreenInit;
+#endif
+
+
+typedef struct {
+ CloseScreenProcPtr CloseScreen;
+ int num_adaptors;
+ XF86MCAdaptorPtr *adaptors;
+ XvMCAdaptorPtr dixinfo;
+} xf86XvMCScreenRec, *xf86XvMCScreenPtr;
+
+static unsigned long XF86XvMCGeneration = 0;
+static int XF86XvMCScreenIndex = -1;
+
+#define XF86XVMC_GET_PRIVATE(pScreen) \
+ (xf86XvMCScreenPtr)((pScreen)->devPrivates[XF86XvMCScreenIndex].ptr)
+
+
+static int
+xf86XvMCCreateContext (
+ XvPortPtr pPort,
+ XvMCContextPtr pContext,
+ int *num_priv,
+ CARD32 **priv
+)
+{
+ xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+
+ pContext->port_priv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
+
+ return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateContext)(
+ pScrn, pContext, num_priv, priv);
+}
+
+static void
+xf86XvMCDestroyContext ( XvMCContextPtr pContext)
+{
+ xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+
+ (*pScreenPriv->adaptors[pContext->adapt_num]->DestroyContext)(
+ pScrn, pContext);
+}
+
+static int
+xf86XvMCCreateSurface (
+ XvMCSurfacePtr pSurface,
+ int *num_priv,
+ CARD32 **priv
+)
+{
+ XvMCContextPtr pContext = pSurface->context;
+ xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+
+ return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateSurface)(
+ pScrn, pSurface, num_priv, priv);
+}
+
+static void
+xf86XvMCDestroySurface (XvMCSurfacePtr pSurface)
+{
+ XvMCContextPtr pContext = pSurface->context;
+ xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+
+ (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySurface)(
+ pScrn, pSurface);
+}
+
+static int
+xf86XvMCCreateSubpicture (
+ XvMCSubpicturePtr pSubpicture,
+ int *num_priv,
+ CARD32 **priv
+)
+{
+ XvMCContextPtr pContext = pSubpicture->context;
+ xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+
+ return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateSubpicture)(
+ pScrn, pSubpicture, num_priv, priv);
+}
+
+static void
+xf86XvMCDestroySubpicture (XvMCSubpicturePtr pSubpicture)
+{
+ XvMCContextPtr pContext = pSubpicture->context;
+ xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum];
+
+ (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySubpicture)(
+ pScrn, pSubpicture);
+}
+
+
+static Bool
+xf86XvMCCloseScreen (int i, ScreenPtr pScreen)
+{
+ xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pScreen);
+
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+
+ xfree(pScreenPriv->dixinfo);
+ xfree(pScreenPriv);
+
+ return (*pScreen->CloseScreen)(i, pScreen);
+}
+
+Bool xf86XvMCScreenInit(
+ ScreenPtr pScreen,
+ int num_adaptors,
+ XF86MCAdaptorPtr *adaptors
+)
+{
+ XvMCAdaptorPtr pAdapt;
+ xf86XvMCScreenPtr pScreenPriv;
+ XvScreenPtr pxvs =
+ (XvScreenPtr)(pScreen->devPrivates[XF86XvScreenIndex].ptr);
+
+ int i, j;
+
+ if(!XvMCScreenInitProc) return FALSE;
+
+ if(XF86XvMCGeneration != serverGeneration) {
+ if((XF86XvMCScreenIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ XF86XvMCGeneration = serverGeneration;
+ }
+
+ if(!(pAdapt = xalloc(sizeof(XvMCAdaptorRec) * num_adaptors)))
+ return FALSE;
+
+ if(!(pScreenPriv = xalloc(sizeof(xf86XvMCScreenRec)))) {
+ xfree(pAdapt);
+ return FALSE;
+ }
+
+ pScreen->devPrivates[XF86XvMCScreenIndex].ptr = (pointer)pScreenPriv;
+
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = xf86XvMCCloseScreen;
+
+ pScreenPriv->num_adaptors = num_adaptors;
+ pScreenPriv->adaptors = adaptors;
+ pScreenPriv->dixinfo = pAdapt;
+
+ for(i = 0; i < num_adaptors; i++) {
+ pAdapt[i].xv_adaptor = NULL;
+ for(j = 0; j < pxvs->nAdaptors; j++) {
+ if(!strcmp((*adaptors)->name, pxvs->pAdaptors[j].name)) {
+ pAdapt[i].xv_adaptor = &(pxvs->pAdaptors[j]);
+ break;
+ }
+ }
+ if(!pAdapt[i].xv_adaptor) {
+ /* no adaptor by that name */
+ xfree(pAdapt);
+ return FALSE;
+ }
+ pAdapt[i].num_surfaces = (*adaptors)->num_surfaces;
+ pAdapt[i].surfaces = (XvMCSurfaceInfoPtr*)((*adaptors)->surfaces);
+ pAdapt[i].num_subpictures = (*adaptors)->num_subpictures;
+ pAdapt[i].subpictures = (XvImagePtr*)((*adaptors)->subpictures);
+ pAdapt[i].CreateContext = xf86XvMCCreateContext;
+ pAdapt[i].DestroyContext = xf86XvMCDestroyContext;
+ pAdapt[i].CreateSurface = xf86XvMCCreateSurface;
+ pAdapt[i].DestroySurface = xf86XvMCDestroySurface;
+ pAdapt[i].CreateSubpicture = xf86XvMCCreateSubpicture;
+ pAdapt[i].DestroySubpicture = xf86XvMCDestroySubpicture;
+ adaptors++;
+ }
+
+ if(Success != (*XvMCScreenInitProc)(pScreen, num_adaptors, pAdapt))
+ return FALSE;
+
+ return TRUE;
+}
diff --git a/hw/xfree86/common/xf86xvmc.h b/hw/xfree86/common/xf86xvmc.h
new file mode 100644
index 000000000..074edbebe
--- /dev/null
+++ b/hw/xfree86/common/xf86xvmc.h
@@ -0,0 +1,134 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.h,v 1.5 2001/11/14 21:54:39 mvojkovi Exp $ */
+
+#ifndef _XF86XVMC_H
+#define _XF86XVMC_H
+
+#include "xvmcext.h"
+#include "xf86xv.h"
+
+typedef struct {
+ int num_xvimages;
+ int *xvimage_ids; /* reference the subpictures in the XF86MCAdaptorRec */
+} XF86MCImageIDList;
+
+typedef struct {
+ int surface_type_id; /* Driver generated. Must be unique on the port */
+ int chroma_format;
+ int color_description; /* no longer used */
+ unsigned short max_width;
+ unsigned short max_height;
+ unsigned short subpicture_max_width;
+ unsigned short subpicture_max_height;
+ int mc_type;
+ int flags;
+ XF86MCImageIDList *compatible_subpictures; /* can be null, if none */
+} XF86MCSurfaceInfoRec, *XF86MCSurfaceInfoPtr;
+
+
+/*
+ xf86XvMCCreateContextProc
+
+ DIX will fill everything out in the context except the driver_priv.
+ The port_priv holds the private data specified for the port when
+ Xv was initialized by the driver.
+ The driver may store whatever it wants in driver_priv and edit
+ the width, height and flags. If the driver wants to return something
+ to the client it can allocate space in priv and specify the number
+ of 32 bit words in num_priv. This must be dynamically allocated
+ space because DIX will free it after it passes it to the client.
+*/
+
+
+typedef int (*xf86XvMCCreateContextProcPtr) (
+ ScrnInfoPtr pScrn,
+ XvMCContextPtr context,
+ int *num_priv,
+ CARD32 **priv
+);
+
+typedef void (*xf86XvMCDestroyContextProcPtr) (
+ ScrnInfoPtr pScrn,
+ XvMCContextPtr context
+);
+
+/*
+ xf86XvMCCreateSurfaceProc
+
+ DIX will fill everything out in the surface except the driver_priv.
+ The driver may store whatever it wants in driver_priv. The driver
+ may pass data back to the client in the same manner as the
+ xf86XvMCCreateContextProc.
+*/
+
+
+typedef int (*xf86XvMCCreateSurfaceProcPtr) (
+ ScrnInfoPtr pScrn,
+ XvMCSurfacePtr surface,
+ int *num_priv,
+ CARD32 **priv
+);
+
+typedef void (*xf86XvMCDestroySurfaceProcPtr) (
+ ScrnInfoPtr pScrn,
+ XvMCSurfacePtr surface
+);
+
+/*
+ xf86XvMCCreateSubpictureProc
+
+ DIX will fill everything out in the subpicture except the driver_priv,
+ num_palette_entries, entry_bytes and component_order. The driver may
+ store whatever it wants in driver_priv and edit the width and height.
+ If it is a paletted subpicture the driver needs to fill out the
+ num_palette_entries, entry_bytes and component_order. These are
+ not communicated to the client until the time the surface is
+ created.
+
+ The driver may pass data back to the client in the same manner as the
+ xf86XvMCCreateContextProc.
+*/
+
+
+typedef int (*xf86XvMCCreateSubpictureProcPtr) (
+ ScrnInfoPtr pScrn,
+ XvMCSubpicturePtr subpicture,
+ int *num_priv,
+ CARD32 **priv
+);
+
+typedef void (*xf86XvMCDestroySubpictureProcPtr) (
+ ScrnInfoPtr pScrn,
+ XvMCSubpicturePtr subpicture
+);
+
+
+typedef struct {
+ char *name;
+ int num_surfaces;
+ XF86MCSurfaceInfoPtr *surfaces;
+ int num_subpictures;
+ XF86ImagePtr *subpictures;
+ xf86XvMCCreateContextProcPtr CreateContext;
+ xf86XvMCDestroyContextProcPtr DestroyContext;
+ xf86XvMCCreateSurfaceProcPtr CreateSurface;
+ xf86XvMCDestroySurfaceProcPtr DestroySurface;
+ xf86XvMCCreateSubpictureProcPtr CreateSubpicture;
+ xf86XvMCDestroySubpictureProcPtr DestroySubpicture;
+} XF86MCAdaptorRec, *XF86MCAdaptorPtr;
+
+/*
+ xf86XvMCScreenInit
+
+ Unlike Xv, the adaptor data is not copied from this structure.
+ This structure's data is used so it must stick around for the
+ life of the server. Note that it's an array of pointers not
+ an array of structures.
+*/
+
+Bool xf86XvMCScreenInit(
+ ScreenPtr pScreen,
+ int num_adaptors,
+ XF86MCAdaptorPtr *adaptors
+);
+
+#endif /* _XF86XVMC_H */
diff --git a/hw/xfree86/common/xisb.c b/hw/xfree86/common/xisb.c
new file mode 100644
index 000000000..4132c7abf
--- /dev/null
+++ b/hw/xfree86/common/xisb.c
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.5 2000/11/06 19:24:07 dawes Exp $ */
+
+/*
+ X Input Serial Buffer routines for use in any XInput driver that accesses
+ a serial device.
+*/
+
+
+/*****************************************************************************
+ * Standard Headers
+ ****************************************************************************/
+
+#include <misc.h>
+#include <xf86.h>
+#include <xf86Version.h>
+#include <xf86_OSproc.h>
+#include <xf86_OSlib.h>
+#include <xf86Xinput.h>
+#include "xisb.h"
+
+/*****************************************************************************
+ * Local Headers
+ ****************************************************************************/
+
+/*****************************************************************************
+ * Variables without includable headers
+ ****************************************************************************/
+
+/*****************************************************************************
+ * Local Variables
+ ****************************************************************************/
+
+/*****************************************************************************
+ * Function Definitions
+ ****************************************************************************/
+
+XISBuffer *
+XisbNew (int fd, xf86ssize_t size)
+{
+ XISBuffer *b;
+
+ b = xalloc (sizeof (XISBuffer));
+ if (!b)
+ return (NULL);
+ b->buf = xalloc ((sizeof (unsigned char) * size));
+ if (!b->buf)
+ {
+ xfree (b);
+ return (NULL);
+ }
+
+ b->fd = fd;
+ b->trace = 0;
+ b->block_duration = 0;
+ b->current = 1; /* force it to be past the end to trigger initial read */
+ b->end = 0;
+ b->buffer_size = size;
+ return (b);
+}
+
+void
+XisbFree (XISBuffer *b)
+{
+ xfree (b->buf);
+ xfree (b);
+}
+
+int
+XisbRead (XISBuffer *b)
+{
+ int ret;
+
+ if (b->current >= b->end)
+ {
+ if (b->block_duration >= 0)
+ {
+ if (xf86WaitForInput (b->fd, b->block_duration) < 1)
+ return (-1);
+ }
+ else
+ {
+ /*
+ * automatically clear it so if XisbRead is called in a loop
+ * the next call will make sure there is data with select and
+ * thus prevent a blocking read
+ */
+ b->block_duration = 0;
+ }
+
+ ret = xf86ReadSerial (b->fd, b->buf, b->buffer_size);
+ switch (ret)
+ {
+ case 0:
+ return (-1); /* timeout */
+ case -1:
+ return (-2); /* error */
+ default:
+ b->end = ret;
+ b->current = 0;
+ break;
+ }
+ }
+ if (b->trace)
+ ErrorF ("read 0x%02x (%c)\n", b->buf[b->current],
+ isprint(b->buf[b->current])?b->buf[b->current]:'.');
+
+ return (b->buf[b->current++]);
+}
+
+/* the only purpose of this function is to provide output tracing */
+xf86ssize_t
+XisbWrite (XISBuffer *b, unsigned char *msg, xf86ssize_t len)
+{
+ if (b->trace)
+ {
+ int i = 0;
+ for (i = 0; i < len; i++)
+ ErrorF ("\t\twrote 0x%02x (%c)\n", msg[i], msg[i]);
+ }
+ return (xf86WriteSerial (b->fd, msg, len));
+}
+
+/* turn tracing of this buffer on (1) or off (0) */
+void
+XisbTrace (XISBuffer *b, int trace)
+{
+ b->trace = trace;
+}
+
+/*
+ * specify a block_duration of -1 when you know the buffer's fd is ready to
+ * read. After a read, it is automatically set to 0 so that the next read
+ * will use check to select for data and prevent a block.
+ * It is the caller's responsibility to set the block_duration to -1 if it
+ * knows that there is data to read (because the main select loop triggered
+ * the read) and want's to avoid the unnecessary overhead of the select call
+ *
+ * a zero or positive block duration will cause the select to block for the
+ * give duration in usecs.
+ */
+
+void
+XisbBlockDuration (XISBuffer *b, int block_duration)
+{
+ b->block_duration = block_duration;
+}
diff --git a/hw/xfree86/common/xisb.h b/hw/xfree86/common/xisb.h
new file mode 100644
index 000000000..7b5e26a23
--- /dev/null
+++ b/hw/xfree86/common/xisb.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.h,v 1.1 1998/12/05 14:40:10 dawes Exp $ */
+
+#ifndef _xisb_H_
+#define _xisb_H_
+
+/******************************************************************************
+ * Definitions
+ * structs, typedefs, #defines, enums
+ *****************************************************************************/
+
+typedef struct _XISBuffer
+{
+ int fd;
+ int trace;
+ int block_duration;
+ xf86ssize_t current; /* bytes read */
+ xf86ssize_t end;
+ xf86ssize_t buffer_size;
+ unsigned char *buf;
+} XISBuffer;
+
+/******************************************************************************
+ * Declarations
+ * variables: use xisb_LOC in front
+ * of globals.
+ * put locals in the .c file.
+ *****************************************************************************/
+XISBuffer * XisbNew (int fd, xf86ssize_t size);
+void XisbFree (XISBuffer *b);
+int XisbRead (XISBuffer *b);
+xf86ssize_t XisbWrite (XISBuffer *b, unsigned char *msg, xf86ssize_t len);
+void XisbTrace (XISBuffer *b, int trace);
+void XisbBlockDuration (XISBuffer *b, int block_duration);
+
+/*
+ * DO NOT PUT ANYTHING AFTER THIS ENDIF
+ */
+#endif
diff --git a/hw/xfree86/ddc/DDC.HOWTO b/hw/xfree86/ddc/DDC.HOWTO
new file mode 100644
index 000000000..2f2c95b7f
--- /dev/null
+++ b/hw/xfree86/ddc/DDC.HOWTO
@@ -0,0 +1,97 @@
+ DDC.HOWTO
+
+ This file describes how to add DDC support to a chipset driver.
+
+1) DDC INITIALIZATION
+
+ When implementing DDC in the driver one has the choice between
+ DDC1 and DDC2.
+ DDC1 data is contiuously transmitted by a DDC1 capable display
+ device. The data is send serially over a data line; the Vsync
+ signal serves as clock. Only one EDID 1.x data block can be
+ transmitted using DDC1. Since transmission of an EDID1 block
+ using a regular Vsync frequency would take up several seconds
+ the driver can increase the Vsync frequency to up to 25 kHz as
+ soon as it detects DDC1 activety on the data line.
+ DDC2 data is transmitted using the I2C protocol. This requires
+ an additional clock line. DDC2 is capable of transmitting EDID1
+ and EDID2 block as well as a VDIF block on display devices that
+ support these.
+ Display devices switch into the DDC2 mode as soon as they detect
+ activety on the DDC clock line. Once the are in DDC2 mode they
+ stop transmitting DDC1 signals until the next power cycle.
+
+ Some graphics chipset configurations which are not capable of
+ DDC2 might still be able to read DDC1 data. Where available
+ DDC2 it is preferrable.
+
+ All relevant prototypes and defines are in xf86DDC.h.
+ DDC2 additionally requires I2C support. The I2C prototypes
+ are in xf86i2c.h.
+
+ DDC1 Support:
+
+ The driver has to provide a read function which waits for the
+ end of the next Vsync signal and reads in and returns the status
+ of the DDC line:
+
+ unsigned int XXX_ddc1Read(ScrnInfoPtr pScrn)
+
+ Additionally a function is required to inclrease the Vsync
+ frequency to max. 25 kHz.
+
+ void XXX_ddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed)
+
+ If the speed argument is DDC_FAST the function should increase
+ the Vsync frequency on DDC_SLOW it should restore the original
+ value. For convenience a generic ddc1SetSpeed() function is provided
+ in the vga module for VGA-like chipsets.
+
+ void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, sf86ddcSpeed speed).
+
+ To read out the DDC1 data the driver should call
+
+ xf86MonPtr xf86DoEDID_DDC1(int scrnIndex,
+ void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed),
+ unsigned int (*DDC1Read)(ScrnInfoPtr))
+
+ in PreInit(). DDC1SetSpeed is a pointer to the SetSpeed()
+ function, DDC1Read has to point to the DDC1 read function.
+ The function will return a pointer to the xf86Monitor structure
+ which contains all information retreived by DDC.
+ NULL will be returned on failure.
+
+ DDC2 Support
+
+ To read out DDC2 information I2C has to be initialized first.
+ (See documentation for the i2c module).
+ The function
+
+ xf86MonPtr xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
+
+ is provided to read out and process DDC2 data. A pointer
+ to the I2CBusRec of the appropriate I2C Bus has to be passed
+ as the second argument.
+ The function will return a pointer to the xf86Monitor structure
+ which contains all information retreived by DDC.
+ NULL will be returned on failure.
+
+ Printing monitor parameters
+
+ To print out the information contained in the xf86Monitor
+ structure the function
+
+ xf86MonPtr xf86PrintEDID(xf86MonPtr monitor)
+
+ is provided.
+
+ Further processing of the xf86Monitor structure is not yet
+ implemented. Howerver it is planned to use the information
+ about video modes, gamma values etc.
+ Therefore it is strongly recommended to read out DDC data
+ before any video mode processing is done.
+
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/ddc/DDC.HOWTO,v 1.3 1999/09/25 14:37:16 dawes Exp $
diff --git a/hw/xfree86/ddc/ddcPriv.h b/hw/xfree86/ddc/ddcPriv.h
new file mode 100644
index 000000000..b5cb9b836
--- /dev/null
+++ b/hw/xfree86/ddc/ddcPriv.h
@@ -0,0 +1,9 @@
+extern unsigned char *GetEDID_DDC1(
+ unsigned int *
+);
+
+extern int DDC_checksum(
+ unsigned char *,
+ int
+);
+
diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
new file mode 100644
index 000000000..d779834c2
--- /dev/null
+++ b/hw/xfree86/ddc/ddcProperty.c
@@ -0,0 +1,160 @@
+/* ddcProperty.c: Make the DDC monitor information available to clients
+ * as properties on the root window
+ *
+ * Copyright 1999 by Andrew C Aitchison <A.C.Aitchison@dpmms.cam.ac.uk>
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.9 2001/10/28 03:33:21 tsi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+/* #include "xf86_ansic.h" */
+/* #include "xf86_OSproc.h" */
+#include "Xatom.h"
+#include "property.h"
+#include "propertyst.h"
+#include "xf86DDC.h"
+
+#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
+#define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA"
+#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA"
+
+Bool
+xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
+{
+ Atom EDID1Atom=-1, EDID2Atom=-1, VDIFAtom=-1;
+ CARD8 *EDID1rawdata = NULL;
+ CARD8 *EDID2rawdata = NULL;
+ int i, ret;
+ Bool makeEDID1prop = FALSE;
+ Bool makeEDID2prop = FALSE;
+
+#ifdef DEBUG
+ ErrorF("xf86SetDDCproperties(%p, %p)\n", pScrnInfo, DDC);
+#endif
+
+ if (pScrnInfo==NULL || pScrnInfo->monitor==NULL || DDC==NULL) {
+ return FALSE;
+ }
+
+#ifdef DEBUG
+ ErrorF("pScrnInfo->scrnIndex %d\n", pScrnInfo->scrnIndex);
+
+ ErrorF("pScrnInfo->monitor was %p\n", pScrnInfo->monitor);
+#endif
+
+ pScrnInfo->monitor->DDC = DDC;
+
+ if (DDC->ver.version == 1) {
+ makeEDID1prop = TRUE;
+ } else if (DDC->ver.version == 2) {
+ int checksum1;
+ int checksum2;
+ makeEDID2prop = TRUE;
+
+ /* Some monitors (eg Panasonic PanaSync4)
+ * report version==2 because they used EDID v2 spec document,
+ * although they use EDID v1 data structure :-(
+ *
+ * Try using checksum to determine when we have such a monitor.
+ */
+ checksum2 = 0;
+ for (i=0; i<256; i++) { checksum2 += DDC->rawData[i]; }
+ if ( (checksum2 % 256) != 0 ) {
+ xf86DrvMsg(pScrnInfo->scrnIndex,X_INFO, "Monitor EDID v2 checksum failed\n");
+ xf86DrvMsg(pScrnInfo->scrnIndex,X_INFO, "XFree86_DDC_EDID2_RAWDATA property may be bad\n");
+ checksum1 = 0;
+ for (i=0; i<128; i++) { checksum1 += DDC->rawData[i]; }
+ if ( (checksum1 % 256) == 0 ) {
+ xf86DrvMsg(pScrnInfo->scrnIndex,X_INFO, "Monitor EDID v1 checksum passed,\n");
+ xf86DrvMsg(pScrnInfo->scrnIndex,X_INFO, "XFree86_DDC_EDID1_RAWDATA property created\n");
+ makeEDID1prop = TRUE;
+ }
+ }
+ } else {
+ xf86DrvMsg(pScrnInfo->scrnIndex, X_PROBED,
+ "unexpected EDID version %d revision %d\n",
+ DDC->ver.version, DDC->ver.revision );
+ }
+
+ if (makeEDID1prop) {
+ if ( (EDID1rawdata = xalloc(128*sizeof(CARD8)))==NULL ) {
+ return FALSE;
+ }
+
+ EDID1Atom = MakeAtom(EDID1_ATOM_NAME, sizeof(EDID1_ATOM_NAME), TRUE);
+
+
+ for (i=0; i<128; i++) {
+ EDID1rawdata[i] = DDC->rawData[i];
+ }
+
+#ifdef DEBUG
+ ErrorF("xf86RegisterRootWindowProperty %p(%d,%d,%d,%d,%d,%p)\n",
+ xf86RegisterRootWindowProperty,
+ pScrnInfo->scrnIndex,
+ EDID1Atom, XA_INTEGER, 8,
+ 128, (unsigned char *)EDID1rawdata );
+#endif
+
+ ret = xf86RegisterRootWindowProperty(pScrnInfo->scrnIndex,
+ EDID1Atom, XA_INTEGER, 8,
+ 128, (unsigned char *)EDID1rawdata
+ );
+#ifdef DEBUG
+ ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
+#endif
+
+ }
+
+ if (makeEDID2prop) {
+ if ( (EDID2rawdata = xalloc(256*sizeof(CARD8)))==NULL ) {
+ return FALSE;
+ }
+ for (i=0; i<256; i++) {
+ EDID2rawdata[i] = DDC->rawData[i];
+ }
+
+ EDID2Atom = MakeAtom(EDID2_ATOM_NAME, sizeof(EDID2_ATOM_NAME), TRUE);
+
+#ifdef DEBUG
+ ErrorF("xf86RegisterRootWindowProperty %p(%d,%d,%d,%d,%d,%p)\n",
+ xf86RegisterRootWindowProperty,
+ pScrnInfo->scrnIndex,
+ EDID2Atom, XA_INTEGER, 8,
+ 256, (unsigned char *)EDID2rawdata );
+#endif
+ ret = xf86RegisterRootWindowProperty(pScrnInfo->scrnIndex,
+ EDID2Atom, XA_INTEGER, 8,
+ 256, (unsigned char *)EDID2rawdata
+ );
+#ifdef DEBUG
+ ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
+#endif
+ }
+
+ if (DDC->vdif) {
+#define VDIF_DUMMY_STRING "setting dummy VDIF property - please insert correct values\n"
+#ifdef DEBUG
+ ErrorF("xf86RegisterRootWindowProperty %p(%d,%d,%d,%d,%d,%p)\n",
+ xf86RegisterRootWindowProperty,
+ pScrnInfo->scrnIndex,
+ VDIFAtom, XA_STRING, 8,
+ strlen(VDIF_DUMMY_STRING), VDIF_DUMMY_STRING
+ );
+#endif
+
+
+ VDIFAtom = MakeAtom(VDIF_ATOM_NAME, sizeof(VDIF_ATOM_NAME), TRUE);
+
+ ret = xf86RegisterRootWindowProperty(pScrnInfo->scrnIndex,
+ VDIFAtom, XA_STRING, 8,
+ strlen(VDIF_DUMMY_STRING),
+ VDIF_DUMMY_STRING
+ );
+#ifdef DEBUG
+ ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
+#endif
+ }
+
+ return TRUE;
+}
diff --git a/hw/xfree86/ddc/edid.c b/hw/xfree86/ddc/edid.c
new file mode 100644
index 000000000..a61940cfa
--- /dev/null
+++ b/hw/xfree86/ddc/edid.c
@@ -0,0 +1,137 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/edid.c,v 1.4 2003/02/17 16:08:27 dawes Exp $ */
+
+/* edid.c: retrieve EDID record from raw DDC1 data stream: data
+ * is contained in an array of unsigned int each unsigned int
+ * contains one bit if bit is 0 unsigned int has to be zero else
+ * unsigned int > 0
+ *
+ * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
+ */
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+#include "xf86DDC.h"
+#include "ddcPriv.h"
+
+static int find_start(unsigned int *);
+static unsigned char * find_header(unsigned char *);
+static unsigned char * resort(unsigned char *);
+
+unsigned char *
+GetEDID_DDC1(unsigned int *s_ptr)
+{
+ unsigned char *d_block, *d_pos;
+ unsigned int *s_pos, *s_end;
+ int s_start;
+ int i,j;
+ s_start = find_start(s_ptr);
+ if (s_start==-1) return NULL;
+ s_end = s_ptr + NUM;
+ s_pos = s_ptr + s_start;
+ d_block=xalloc(EDID1_LEN);
+ if (!d_block) return NULL;
+ d_pos = d_block;
+ for (i=0;i<EDID1_LEN;i++) {
+ for (j=0;j<8;j++) {
+ *d_pos <<= 1;
+ if (*s_pos) {
+ *d_pos |= 0x01;
+ }
+ s_pos++; if (s_pos == s_end) s_pos=s_ptr;
+ };
+ s_pos++; if (s_pos == s_end) s_pos=s_ptr;
+ d_pos++;
+ }
+ xfree(s_ptr);
+ if (d_block && DDC_checksum(d_block,EDID1_LEN)) return NULL;
+ return (resort(d_block));
+}
+
+int
+DDC_checksum(unsigned char *block, int len)
+{
+ int i, result = 0;
+ int not_null = 0;
+
+ for (i=0;i<len;i++) {
+ not_null |= block[i];
+ result += block[i];
+ }
+
+#ifdef DEBUG
+ if (result & 0xFF) ErrorF("DDC checksum not correct\n");
+ if (!not_null) ErrorF("DDC read all Null\n");
+#endif
+
+ /* catch the trivial case where all bytes are 0 */
+ if (!not_null) return 1;
+
+ return (result&0xFF);
+}
+
+static int
+find_start(unsigned int *ptr)
+{
+ unsigned int comp[9], test[9];
+ int i,j;
+
+ for (i=0;i<9;i++){
+ comp[i] = *(ptr++);
+ test[i] = 1;
+ }
+ for (i=0;i<127;i++){
+ for (j=0;j<9;j++){
+ test[j] = test[j] & !(comp[j] ^ *(ptr++));
+ }
+ }
+ for (i=0;i<9;i++)
+ if (test[i]) return (i+1);
+ return (-1);
+}
+
+static unsigned char *
+find_header(unsigned char *block)
+{
+ unsigned char *ptr, *head_ptr, *end;
+ unsigned char header[]={0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
+
+ ptr = block;
+ end = block + EDID1_LEN;
+ while (ptr<end) {
+ int i;
+ head_ptr = ptr;
+ for (i=0;i<8;i++){
+ if (header[i] != *(head_ptr++)) break;
+ if (head_ptr == end) head_ptr = block;
+ }
+ if (i==8) break;
+ ptr++;
+ }
+ if (ptr == end) return (NULL);
+ return (ptr);
+}
+
+static unsigned char *
+resort(unsigned char *s_block)
+{
+ unsigned char *d_new, *d_ptr, *d_end, *s_ptr, *s_end;
+ unsigned char tmp;
+
+ s_end = s_block + EDID1_LEN;
+ d_new = xalloc(EDID1_LEN);
+ if (!d_new) return NULL;
+ d_end = d_new + EDID1_LEN;
+
+ s_ptr = find_header(s_block);
+ if (!s_ptr) return NULL;
+ for (d_ptr=d_new;d_ptr<d_end;d_ptr++){
+ tmp = *(s_ptr++);
+ *d_ptr = tmp;
+ if (s_ptr == s_end) s_ptr = s_block;
+ }
+ xfree(s_block);
+ return (d_new);
+}
+
+
diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h
new file mode 100644
index 000000000..7a2f30cb4
--- /dev/null
+++ b/hw/xfree86/ddc/edid.h
@@ -0,0 +1,424 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/edid.h,v 1.7 2000/04/20 21:28:26 tsi Exp $ */
+
+/* edid.h: defines to parse an EDID block
+ *
+ * This file contains all information to interpret a standard EDIC block
+ * transmitted by a display device via DDC (Display Data Channel). So far
+ * there is no information to deal with optional EDID blocks.
+ * DDC is a Trademark of VESA (Video Electronics Standard Association).
+ *
+ * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
+ */
+
+#ifndef _EDID_H_
+#define _EDID_H_ 1
+
+#include "vdif.h"
+
+/* read complete EDID record */
+#define EDID1_LEN 128
+#define BITS_PER_BYTE 9
+#define NUM BITS_PER_BYTE*EDID1_LEN
+#define HEADER 6
+
+#define STD_TIMINGS 8
+#define DET_TIMINGS 4
+
+#ifdef _PARSE_EDID_
+
+/* header: 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 */
+#define HEADER_SECTION 0
+#define HEADER_LENGTH 8
+
+/* vendor section */
+#define VENDOR_SECTION (HEADER_SECTION + HEADER_LENGTH)
+#define V_MANUFACTURER 0
+#define V_PROD_ID (V_MANUFACTURER + 2)
+#define V_SERIAL (V_PROD_ID + 2)
+#define V_WEEK (V_SERIAL + 4)
+#define V_YEAR (V_WEEK + 1)
+#define VENDOR_LENGTH (V_YEAR + 1)
+
+/* EDID version */
+#define VERSION_SECTION (VENDOR_SECTION + VENDOR_LENGTH)
+#define V_VERSION 0
+#define V_REVISION (V_VERSION + 1)
+#define VERSION_LENGTH (V_REVISION + 1)
+
+/* display information */
+#define DISPLAY_SECTION (VERSION_SECTION + VERSION_LENGTH)
+#define D_INPUT 0
+#define D_HSIZE (D_INPUT + 1)
+#define D_VSIZE (D_HSIZE + 1)
+#define D_GAMMA (D_VSIZE + 1)
+#define FEAT_S (D_GAMMA + 1)
+#define D_RG_LOW (FEAT_S + 1)
+#define D_BW_LOW (D_RG_LOW + 1)
+#define D_REDX (D_BW_LOW + 1)
+#define D_REDY (D_REDX + 1)
+#define D_GREENX (D_REDY + 1)
+#define D_GREENY (D_GREENX + 1)
+#define D_BLUEX (D_GREENY + 1)
+#define D_BLUEY (D_BLUEX + 1)
+#define D_WHITEX (D_BLUEY + 1)
+#define D_WHITEY (D_WHITEX + 1)
+#define DISPLAY_LENGTH (D_WHITEY + 1)
+
+/* supported VESA and other standard timings */
+#define ESTABLISHED_TIMING_SECTION (DISPLAY_SECTION + DISPLAY_LENGTH)
+#define E_T1 0
+#define E_T2 (E_T1 + 1)
+#define E_TMANU (E_T2 + 1)
+#define E_TIMING_LENGTH (E_TMANU + 1)
+
+/* non predefined standard timings supported by display */
+#define STD_TIMING_SECTION (ESTABLISHED_TIMING_SECTION + E_TIMING_LENGTH)
+#define STD_TIMING_INFO_LEN 2
+#define STD_TIMING_INFO_NUM STD_TIMINGS
+#define STD_TIMING_LENGTH (STD_TIMING_INFO_LEN * STD_TIMING_INFO_NUM)
+
+/* detailed timing info of non standard timings */
+#define DET_TIMING_SECTION (STD_TIMING_SECTION + STD_TIMING_LENGTH)
+#define DET_TIMING_INFO_LEN 18
+#define MONITOR_DESC_LEN DET_TIMING_INFO_LEN
+#define DET_TIMING_INFO_NUM DET_TIMINGS
+#define DET_TIMING_LENGTH (DET_TIMING_INFO_LEN * DET_TIMING_INFO_NUM)
+
+/* number of EDID sections to follow */
+#define NO_EDID (DET_TIMING_SECTION + DET_TIMING_LENGTH)
+/* one byte checksum */
+#define CHECKSUM (NO_EDID + 1)
+
+#if (CHECKSUM != (EDID1_LEN - 1))
+# error "EDID1 length != 128!"
+#endif
+
+
+#define SECTION(x,y) (Uchar *)(x + y)
+#define GET_ARRAY(y) ((Uchar *)(c + y))
+#define GET(y) *(Uchar *)(c + y)
+
+/* extract information from vendor section */
+#define _PROD_ID(x) x[0] + (x[1] << 8);
+#define PROD_ID _PROD_ID(GET_ARRAY(V_PROD_ID))
+#define _SERIAL_NO(x) x[0] + (x[1] << 8) + (x[2] << 16) + (x[3] << 24)
+#define SERIAL_NO _SERIAL_NO(GET_ARRAY(V_SERIAL))
+#define _YEAR(x) (x & 0xFF) + 1990
+#define YEAR _YEAR(GET(V_YEAR))
+#define WEEK GET(V_WEEK) & 0xFF
+#define _L1(x) ((x[0] & 0x7C) >> 2) + '@'
+#define _L2(x) ((x[0] & 0x03) << 3) + ((x[1] & 0xE0) >> 5) + '@'
+#define _L3(x) (x[1] & 0x1F) + '@';
+#define L1 _L1(GET_ARRAY(V_MANUFACTURER))
+#define L2 _L2(GET_ARRAY(V_MANUFACTURER))
+#define L3 _L3(GET_ARRAY(V_MANUFACTURER))
+
+/* extract information from version section */
+#define VERSION GET(V_VERSION)
+#define REVISION GET(V_REVISION)
+
+/* extract information from display section */
+#define _INPUT_TYPE(x) ((x & 0x80) >> 7)
+#define INPUT_TYPE _INPUT_TYPE(GET(D_INPUT))
+#define _INPUT_VOLTAGE(x) ((x & 0x60) >> 5)
+#define INPUT_VOLTAGE _INPUT_VOLTAGE(GET(D_INPUT))
+#define _SETUP(x) ((x & 0x10) >> 4)
+#define SETUP _SETUP(GET(D_INPUT))
+#define _SYNC(x) (x & 0x0F)
+#define SYNC _SYNC(GET(D_INPUT))
+#define _GAMMA(x) ((x + 100.0)/100.0)
+#define GAMMA _GAMMA(GET(D_GAMMA))
+#define HSIZE_MAX GET(D_HSIZE)
+#define VSIZE_MAX GET(D_VSIZE)
+#define _DPMS(x) ((x & 0xE0) >> 5)
+#define DPMS _DPMS(GET(FEAT_S))
+#define _DISPLAY_TYPE(x) ((x & 0x18) >> 3)
+#define DISPLAY_TYPE _DISPLAY_TYPE(GET(FEAT_S))
+#define _MSC(x) (x & 0x7)
+#define MSC _MSC(GET(FEAT_S))
+
+
+/* color characteristics */
+#define CC_L(x,y) ((x & (0x03 << y)) >> y)
+#define CC_H(x) (x << 2)
+#define I_CC(x,y,z) CC_H(y) | CC_L(x,z)
+#define F_CC(x) ((x)/1024.0)
+#define REDX F_CC(I_CC((GET(D_RG_LOW)),(GET(D_REDX)),6))
+#define REDY F_CC(I_CC((GET(D_RG_LOW)),(GET(D_REDY)),4))
+#define GREENX F_CC(I_CC((GET(D_RG_LOW)),(GET(D_GREENX)),2))
+#define GREENY F_CC(I_CC((GET(D_RG_LOW)),(GET(D_GREENY)),0))
+#define BLUEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_BLUEX)),6))
+#define BLUEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_BLUEY)),4))
+#define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2))
+#define WHITEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEY)),0))
+
+/* extract information from standard timing section */
+#define T1 GET(E_T1)
+#define T2 GET(E_T2)
+#define T_MANU GET(E_TMANU)
+
+/* extract information from estabished timing section */
+#define _HSIZE1(x) ((x[0] + 31) * 8)
+#define HSIZE1 _HSIZE1(c)
+#define RATIO(x) ((x[1] & 0xC0) >> 6)
+#define RATIO1_1 0
+#define RATIO4_3 1
+#define RATIO5_4 2
+#define RATIO16_9 3
+#define _VSIZE1(x,y) switch(RATIO(x)){ \
+ case RATIO1_1: y = _HSIZE1(x); break; \
+ case RATIO4_3: y = _HSIZE1(x) * 3 / 4; break; \
+ case RATIO5_4: y = _HSIZE1(x) * 4 / 5; break; \
+ case RATIO16_9: y = _HSIZE1(x) * 9 / 16; break; \
+ }
+#define VSIZE1(x) _VSIZE1(c,x)
+#define _REFRESH_R(x) (x[1] & 0x3F) + 60
+#define REFRESH_R _REFRESH_R(c)
+#define _ID_LOW(x) x[0]
+#define ID_LOW _ID_LOW(c)
+#define _ID_HIGH(x) (x[1] << 8)
+#define ID_HIGH _ID_HIGH(c)
+#define STD_TIMING_ID (ID_LOW | ID_HIGH)
+#define _NEXT_STD_TIMING(x) (x = (x + STD_TIMING_INFO_LEN))
+#define NEXT_STD_TIMING _NEXT_STD_TIMING(c)
+
+
+/* EDID Ver. > 1.2 */
+#define _IS_MONITOR_DESC(x) (x[0] == 0 && x[1] == 0 && x[2] == 0 && x[4] == 0)
+#define IS_MONITOR_DESC _IS_MONITOR_DESC(c)
+#define _PIXEL_CLOCK(x) (x[0] + (x[1] << 8)) * 10000
+#define PIXEL_CLOCK _PIXEL_CLOCK(c)
+#define _H_ACTIVE(x) (x[2] + ((x[4] & 0xF0) << 4))
+#define H_ACTIVE _H_ACTIVE(c)
+#define _H_BLANK(x) (x[3] + ((x[4] & 0x0F) << 8))
+#define H_BLANK _H_BLANK(c)
+#define _V_ACTIVE(x) (x[5] + ((x[7] & 0xF0) << 4))
+#define V_ACTIVE _V_ACTIVE(c)
+#define _V_BLANK(x) (x[6] + ((x[7] & 0x0F) << 8))
+#define V_BLANK _V_BLANK(c)
+#define _H_SYNC_OFF(x) (x[8] + ((x[11] & 0xC0) << 2))
+#define H_SYNC_OFF _H_SYNC_OFF(c)
+#define _H_SYNC_WIDTH(x) (x[9] + ((x[11] & 0x30) << 4))
+#define H_SYNC_WIDTH _H_SYNC_WIDTH(c)
+#define _V_SYNC_OFF(x) ((x[10] >> 4) + ((x[11] & 0x0C) << 2))
+#define V_SYNC_OFF _V_SYNC_OFF(c)
+#define _V_SYNC_WIDTH(x) ((x[10] & 0x0F) + ((x[11] & 0x03) << 4))
+#define V_SYNC_WIDTH _V_SYNC_WIDTH(c)
+#define _H_SIZE(x) (x[12] + ((x[14] & 0xF0) << 4))
+#define H_SIZE _H_SIZE(c)
+#define _V_SIZE(x) (x[13] + ((x[14] & 0x0F) << 8))
+#define V_SIZE _V_SIZE(c)
+#define _H_BORDER(x) (x[15])
+#define H_BORDER _H_BORDER(c)
+#define _V_BORDER(x) (x[16])
+#define V_BORDER _V_BORDER(c)
+#define _INTERLACED(x) ((x[17] & 0x80) >> 7)
+#define INTERLACED _INTERLACED(c)
+#define _STEREO(x) ((x[17] & 0x60) >> 6)
+#define STEREO _STEREO(c)
+#define _SYNC_T(x) ((x[17] & 0x18) >> 4)
+#define SYNC_T _SYNC_T(c)
+#define _MISC(x) ((x[17] & 0x06) >> 2)
+#define MISC _MISC(c)
+
+#define _MONITOR_DESC_TYPE(x) x[3]
+#define MONITOR_DESC_TYPE _MONITOR_DESC_TYPE(c)
+#define SERIAL_NUMBER 0xFF
+#define ASCII_STR 0xFE
+#define MONITOR_RANGES 0xFD
+#define _MIN_V(x) x[5]
+#define MIN_V _MIN_V(c)
+#define _MAX_V(x) x[6]
+#define MAX_V _MAX_V(c)
+#define _MIN_H(x) x[7]
+#define MIN_H _MIN_H(c)
+#define _MAX_H(x) x[8]
+#define MAX_H _MAX_H(c)
+#define _MAX_CLOCK(x) x[9]
+#define MAX_CLOCK _MAX_CLOCK(c)
+#define MONITOR_NAME 0xFC
+#define ADD_COLOR_POINT 0xFB
+#define WHITEX F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEX)),2))
+#define WHITEY F_CC(I_CC((GET(D_BW_LOW)),(GET(D_WHITEY)),0))
+#define _WHITEX_ADD(x,y) F_CC(I_CC(((*(x + y))),(*(x + y + 1)),2))
+#define _WHITEY_ADD(x,y) F_CC(I_CC(((*(x + y))),(*(x + y + 2)),0))
+#define _WHITE_INDEX1(x) x[5]
+#define WHITE_INDEX1 _WHITE_INDEX1(c)
+#define _WHITE_INDEX2(x) x[10]
+#define WHITE_INDEX2 _WHITE_INDEX2(c)
+#define WHITEX1 _WHITEX_ADD(c,6)
+#define WHITEY1 _WHITEY_ADD(c,6)
+#define WHITEX2 _WHITEX_ADD(c,12)
+#define WHITEY2 _WHITEY_ADD(c,12)
+#define _WHITE_GAMMA1(x) _GAMMA(x[9])
+#define WHITE_GAMMA1 _WHITE_GAMMA1(c)
+#define _WHITE_GAMMA2(x) _GAMMA(x[14])
+#define WHITE_GAMMA2 _WHITE_GAMMA2(c)
+#define ADD_STD_TIMINGS 0xFA
+
+#define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN))
+#define NEXT_DT_MD_SECTION _NEXT_DT_MD_SECTION(c)
+
+#endif /* _PARSE_EDID_ */
+
+/* input type */
+#define DIGITAL(x) x
+
+/* input voltage level */
+#define V070 0 /* 0.700V/0.300V */
+#define V071 1 /* 0.714V/0.286V */
+#define V100 2 /* 1.000V/0.400V */
+#define V007 3 /* 0.700V/0.000V */
+
+/* Signal level setup */
+#define SIG_SETUP(x) (x)
+
+/* sync characteristics */
+#define SEP_SYNC(x) (x & 0x08)
+#define COMP_SYNC(x) (x & 0x04)
+#define SYNC_O_GREEN(x) (x & 0x02)
+#define SYNC_SERR(x) (x & 0x01)
+
+/* DPMS features */
+#define DPMS_STANDBY(x) (x & 0x04)
+#define DPMS_SUSPEND(x) (x & 0x02)
+#define DPMS_OFF(x) (x & 0x01)
+
+/* display type */
+#define DISP_MONO 0
+#define DISP_RGB 1
+#define DISP_MULTCOLOR 2
+
+/* Msc stuff EDID Ver > 1.1 */
+#define STD_COLOR_SPACE(x) (x & 0x4)
+#define PREFERRED_TIMING_MODE(x) (x & 0x2)
+#define GFT_SUPPORTED(x) (x & 0x1)
+
+/* detailed timing misc */
+#define IS_INTERLACED(x) (x)
+#define IS_STEREO(x) (x)
+#define IS_RIGHT_ON_SYNC(x) (x & 0x01)
+#define IS_LEFT_ON_SYNC(x) (x & 0x02)
+
+typedef unsigned int Uint;
+typedef unsigned char Uchar;
+
+struct vendor {
+ char name[4];
+ int prod_id;
+ Uint serial;
+ int week;
+ int year;
+};
+
+struct edid_version {
+ int version;
+ int revision;
+};
+
+struct disp_features {
+ unsigned int input_type:1;
+ unsigned int input_voltage:2;
+ unsigned int input_setup:1;
+ unsigned int input_sync:5;
+ int hsize;
+ int vsize;
+ float gamma;
+ unsigned int dpms:3;
+ unsigned int display_type:2;
+ unsigned int msc:3;
+ float redx;
+ float redy;
+ float greenx;
+ float greeny;
+ float bluex;
+ float bluey;
+ float whitex;
+ float whitey;
+};
+
+struct established_timings {
+ Uchar t1;
+ Uchar t2;
+ Uchar t_manu;
+};
+
+struct std_timings {
+ int hsize;
+ int vsize;
+ int refresh;
+ CARD16 id;
+};
+
+struct detailed_timings {
+ int clock;
+ int h_active;
+ int h_blanking;
+ int v_active;
+ int v_blanking;
+ int h_sync_off;
+ int h_sync_width;
+ int v_sync_off;
+ int v_sync_width;
+ int h_size;
+ int v_size;
+ int h_border;
+ int v_border;
+ unsigned int interlaced:1;
+ unsigned int stereo:2;
+ unsigned int sync:2;
+ unsigned int misc:2;
+};
+
+#define DT 0
+#define DS_SERIAL 0xFF
+#define DS_ASCII_STR 0xFE
+#define DS_NAME 0xFC
+#define DS_RANGES 0xFD
+#define DS_WHITE_P 0xFB
+#define DS_STD_TIMINGS 0xFA
+
+struct monitor_ranges {
+ int min_v;
+ int max_v;
+ int min_h;
+ int max_h;
+ int max_clock;
+};
+
+struct whitePoints{
+ int index;
+ float white_x;
+ float white_y;
+ float white_gamma;
+};
+
+struct detailed_monitor_section {
+ int type;
+ union {
+ struct detailed_timings d_timings;
+ Uchar serial[13];
+ Uchar ascii_data[13];
+ Uchar name[13];
+ struct monitor_ranges ranges;
+ struct std_timings std_t[5];
+ struct whitePoints wp[2];
+ } section;
+};
+
+typedef struct {
+ int scrnIndex;
+ struct vendor vendor;
+ struct edid_version ver;
+ struct disp_features features;
+ struct established_timings timings1;
+ struct std_timings timings2[8];
+ struct detailed_monitor_section det_mon[4];
+ xf86vdifPtr vdif;
+ int no_sections;
+ Uchar *rawData;
+} xf86Monitor, *xf86MonPtr;
+
+extern xf86MonPtr ConfiguredMonitor;
+
+#endif /* _EDID_H_ */
diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
new file mode 100644
index 000000000..c0092aed9
--- /dev/null
+++ b/hw/xfree86/ddc/interpret_edid.c
@@ -0,0 +1,226 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/interpret_edid.c,v 1.8 2000/07/13 21:31:37 tsi Exp $ */
+
+/* interpret_edid.c: interpret a primary EDID block
+ *
+ * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
+ */
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+#define _PARSE_EDID_
+#include "xf86DDC.h"
+
+static void get_vendor_section(Uchar*, struct vendor *);
+static void get_version_section(Uchar*, struct edid_version *);
+static void get_display_section(Uchar*, struct disp_features *);
+static void get_established_timing_section(Uchar*, struct established_timings *);
+static void get_std_timing_section(Uchar*, struct std_timings *);
+static void get_dt_md_section(Uchar *, struct edid_version *,
+ struct detailed_monitor_section *det_mon);
+static void copy_string(Uchar *, Uchar *);
+static void get_dst_timing_section(Uchar *, struct std_timings *);
+static void get_monitor_ranges(Uchar *, struct monitor_ranges *);
+static void get_whitepoint_section(Uchar *, struct whitePoints *);
+static void get_detailed_timing_section(Uchar*, struct detailed_timings *);
+
+xf86MonPtr
+xf86InterpretEDID(int scrnIndex, Uchar *block)
+{
+ xf86MonPtr m;
+
+ if (!block) return NULL;
+ if (! (m = xnfcalloc(sizeof(xf86Monitor),1))) return NULL;
+ m->scrnIndex = scrnIndex;
+ m->rawData = block;
+ get_vendor_section(SECTION(VENDOR_SECTION,block),&m->vendor);
+ get_version_section(SECTION(VERSION_SECTION,block),&m->ver);
+ get_display_section(SECTION(DISPLAY_SECTION,block),&m->features);
+ get_established_timing_section(SECTION(ESTABLISHED_TIMING_SECTION,block),
+ &m->timings1);
+ get_std_timing_section(SECTION(STD_TIMING_SECTION,block),m->timings2);
+ get_dt_md_section(SECTION(DET_TIMING_SECTION,block),&m->ver, m->det_mon);
+ m->no_sections = (int)*(char *)SECTION(NO_EDID,block);
+ return (m);
+}
+
+static void
+get_vendor_section(Uchar *c, struct vendor *r)
+{
+ r->name[0] = L1;
+ r->name[1] = L2;
+ r->name[2] = L3;
+ r->name[3] = '\0';
+
+ r->prod_id = PROD_ID;
+ r->serial = SERIAL_NO;
+ r->week = WEEK;
+ r->year = YEAR;
+}
+
+static void
+get_version_section(Uchar *c, struct edid_version *r)
+{
+ r->version = VERSION;
+ r->revision = REVISION;
+}
+
+static void
+get_display_section(Uchar *c, struct disp_features *r)
+{
+ r->input_type = INPUT_TYPE;
+ r->input_voltage = INPUT_VOLTAGE;
+ r->input_setup = SETUP;
+ r->input_sync = SYNC;
+ r->hsize = HSIZE_MAX;
+ r->vsize = VSIZE_MAX;
+ r->gamma = GAMMA;
+ r->dpms = DPMS;
+ r->display_type = DISPLAY_TYPE;
+ r->msc = MSC;
+ r->redx = REDX;
+ r->redy = REDY;
+ r->greenx = GREENX;
+ r->greeny = GREENY;
+ r->bluex = BLUEX;
+ r->bluey = BLUEY;
+ r->whitex = WHITEX;
+ r->whitey = WHITEY;
+}
+
+static void
+get_established_timing_section(Uchar *c, struct established_timings *r)
+{
+ r->t1 = T1;
+ r->t2 = T2;
+ r->t_manu = T_MANU;
+}
+
+static void
+get_std_timing_section(Uchar *c, struct std_timings *r)
+{
+ int i;
+
+ for (i=0;i<STD_TIMINGS;i++){
+ r[i].hsize = HSIZE1;
+ VSIZE1(r[i].vsize);
+ r[i].refresh = REFRESH_R;
+ r[i].id = STD_TIMING_ID;
+ NEXT_STD_TIMING;
+ }
+}
+
+static void
+get_dt_md_section(Uchar *c, struct edid_version *ver,
+ struct detailed_monitor_section *det_mon)
+{
+ int i;
+
+ for (i=0;i<DET_TIMINGS;i++) {
+ if (ver->version == 1 && ver->revision >= 1 && IS_MONITOR_DESC) {
+
+ switch (MONITOR_DESC_TYPE) {
+ case SERIAL_NUMBER:
+ det_mon[i].type = DS_SERIAL;
+ copy_string(c,det_mon[i].section.serial);
+ break;
+ case ASCII_STR:
+ det_mon[i].type = DS_ASCII_STR;
+ copy_string(c,det_mon[i].section.ascii_data);
+ break;
+ case MONITOR_RANGES:
+ det_mon[i].type = DS_RANGES;
+ get_monitor_ranges(c,&det_mon[i].section.ranges);
+ break;
+ case MONITOR_NAME:
+ det_mon[i].type = DS_NAME;
+ copy_string(c,det_mon[i].section.name);
+ break;
+ case ADD_COLOR_POINT:
+ det_mon[i].type = DS_WHITE_P;
+ get_whitepoint_section(c,det_mon[i].section.wp);
+ break;
+ case ADD_STD_TIMINGS:
+ det_mon[i].type = DS_STD_TIMINGS;
+ get_dst_timing_section(c,det_mon[i].section.std_t);
+ break;
+ }
+ } else {
+ det_mon[i].type = DT;
+ get_detailed_timing_section(c,&det_mon[i].section.d_timings);
+ }
+ NEXT_DT_MD_SECTION;
+ }
+}
+
+static void
+copy_string(Uchar *c, Uchar *s)
+{
+ int i;
+ c = c + 5;
+ for (i = 0; (i < 13 && *c != 0x0A); i++)
+ *(s++) = *(c++);
+ *s = 0;
+ while (i-- && (*--s == 0x20)) *s = 0;
+}
+
+static void
+get_dst_timing_section(Uchar *c, struct std_timings *t)
+{
+ int j;
+ c = c + 5;
+ for (j = 0; j < 5; j++) {
+ t[j].hsize = HSIZE1;
+ VSIZE1(t[j].vsize);
+ t[j].refresh = REFRESH_R;
+ t[j].id = STD_TIMING_ID;
+ NEXT_STD_TIMING;
+ }
+}
+
+static void
+get_monitor_ranges(Uchar *c, struct monitor_ranges *r)
+{
+ r->min_v = MIN_V;
+ r->max_v = MAX_V;
+ r->min_h = MIN_H;
+ r->max_h = MAX_H;
+ r->max_clock = MAX_CLOCK * 10;
+}
+
+static void
+get_whitepoint_section(Uchar *c, struct whitePoints *wp)
+{
+ wp[1].white_x = WHITEX1;
+ wp[1].white_y = WHITEY1;
+ wp[2].white_x = WHITEX2;
+ wp[2].white_y = WHITEY2;
+ wp[1].index = WHITE_INDEX1;
+ wp[2].index = WHITE_INDEX2;
+ wp[1].white_gamma = WHITE_GAMMA1;
+ wp[2].white_gamma = WHITE_GAMMA2;
+}
+
+static void
+get_detailed_timing_section(Uchar *c, struct detailed_timings *r)
+{
+ r->clock = PIXEL_CLOCK;
+ r->h_active = H_ACTIVE;
+ r->h_blanking = H_BLANK;
+ r->v_active = V_ACTIVE;
+ r->v_blanking = V_BLANK;
+ r->h_sync_off = H_SYNC_OFF;
+ r->h_sync_width = H_SYNC_WIDTH;
+ r->v_sync_off = V_SYNC_OFF;
+ r->v_sync_width = V_SYNC_WIDTH;
+ r->h_size = H_SIZE;
+ r->v_size = V_SIZE;
+ r->h_border = H_BORDER;
+ r->v_border = V_BORDER;
+ r->interlaced = INTERLACED;
+ r->stereo = STEREO;
+ r->sync = SYNC_T;
+ r->misc = MISC;
+}
+
+
diff --git a/hw/xfree86/ddc/interpret_vdif.c b/hw/xfree86/ddc/interpret_vdif.c
new file mode 100644
index 000000000..acd931e70
--- /dev/null
+++ b/hw/xfree86/ddc/interpret_vdif.c
@@ -0,0 +1,129 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/interpret_vdif.c,v 1.6 2000/01/21 02:30:00 dawes Exp $ */
+
+#include "Xarch.h"
+#include "xf86DDC.h"
+#include "vdif.h"
+
+static xf86VdifLimitsPtr* get_limits(CARD8 *c);
+static xf86VdifGammaPtr* get_gamma(CARD8 *c);
+static xf86VdifTimingPtr* get_timings(CARD8 *c);
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+static CARD32 swap_byte_order(CARD32 c);
+#endif
+
+xf86vdifPtr
+xf86InterpretVdif(CARD8 *c)
+{
+ xf86VdifPtr p = (xf86VdifPtr)c;
+ xf86vdifPtr vdif;
+ int i;
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ int length;
+#endif
+ unsigned long l = 0;
+
+ if (c == NULL) return NULL;
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ length = swap_byte_order(p->FileLength);
+ for (i = 0; i < (length >>2); i++)
+ ((CARD32*)c)[i] = swap_byte_order(((CARD32*)c)[i]) ;
+#endif
+ if (p->VDIFId[0] != 'V' || p->VDIFId[1] != 'D' || p->VDIFId[2] != 'I'
+ || p->VDIFId[3] != 'F') return NULL;
+ for ( i = 12; i < p->FileLength; i++)
+ l += c[i];
+ if ( l != p->Checksum) return NULL;
+ vdif = xalloc(sizeof(xf86vdif));
+ vdif->vdif = p;
+ vdif->limits = get_limits(c);
+ vdif->timings = get_timings(c);
+ vdif->gamma = get_gamma(c);
+ vdif->strings = VDIF_STRING(((xf86VdifPtr)c),0);
+ xfree(c);
+ return vdif;
+}
+
+static xf86VdifLimitsPtr*
+get_limits(CARD8 *c)
+{
+ int num, i, j;
+ xf86VdifLimitsPtr *pp;
+ xf86VdifLimitsPtr p;
+
+ num = ((xf86VdifPtr)c)->NumberOperationalLimits;
+ pp = xalloc(sizeof(xf86VdifLimitsPtr) * (num+1));
+ p = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
+ j = 0;
+ for ( i = 0; i<num; i++) {
+ if (p->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
+ pp[j++] = p;
+ VDIF_NEXT_OPERATIONAL_LIMITS(p);
+ }
+ pp[j] = NULL;
+ return pp;
+}
+
+static xf86VdifGammaPtr*
+get_gamma(CARD8 *c)
+{
+ int num, i, j;
+ xf86VdifGammaPtr *pp;
+ xf86VdifGammaPtr p;
+
+ num = ((xf86VdifPtr)c)->NumberOptions;
+ pp = xalloc(sizeof(xf86VdifGammaPtr) * (num+1));
+ p = (xf86VdifGammaPtr)VDIF_OPTIONS(((xf86VdifPtr)c));
+ j = 0;
+ for ( i = 0; i<num; i++)
+ {
+ if (p->Header.ScnTag == VDIF_GAMMA_TABLE_TAG)
+ pp[j++] = p;
+ VDIF_NEXT_OPTIONS(p);
+ }
+ pp[j] = NULL;
+ return pp;
+}
+
+static xf86VdifTimingPtr*
+get_timings(CARD8 *c)
+{
+ int num, num_limits;
+ int i,j,k;
+ xf86VdifLimitsPtr lp;
+ xf86VdifTimingPtr *pp;
+ xf86VdifTimingPtr p;
+
+ num = ((xf86VdifPtr)c)->NumberOperationalLimits;
+ lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
+ num_limits = 0;
+ for (i = 0; i < num; i++) {
+ if (lp->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
+ num_limits += lp->NumberPreadjustedTimings;
+ VDIF_NEXT_OPERATIONAL_LIMITS(lp);
+ }
+ pp = xalloc(sizeof(xf86VdifTimingPtr)
+ * (num_limits+1));
+ j = 0;
+ lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr) c));
+ for (i = 0; i < num; i++) {
+ p = VDIF_PREADJUSTED_TIMING(lp);
+ for (k = 0; k < lp->NumberPreadjustedTimings; k++) {
+ if (p->Header.ScnTag == VDIF_PREADJUSTED_TIMING_TAG)
+ pp[j++] = p;
+ VDIF_NEXT_PREADJUSTED_TIMING(p);
+ }
+ VDIF_NEXT_OPERATIONAL_LIMITS(lp);
+ }
+ pp[j] = NULL;
+ return pp;
+}
+
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+static CARD32
+swap_byte_order(CARD32 c)
+{
+ return ((c & 0xFF000000) >> 24) | ((c & 0xFF0000) >> 8)
+ | ((c & 0xFF00) << 8) | ((c & 0xFF) << 24);
+}
+
+#endif
diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c
new file mode 100644
index 000000000..3451e52f6
--- /dev/null
+++ b/hw/xfree86/ddc/print_edid.c
@@ -0,0 +1,286 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.15 2001/05/22 17:01:23 tsi Exp $ */
+
+/* print_edid.c: print out all information retrieved from display device
+ *
+ * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
+ */
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+#include "xf86DDC.h"
+
+static void print_vendor(int scrnIndex, struct vendor *);
+static void print_version(int scrnIndex, struct edid_version *);
+static void print_display(int scrnIndex, struct disp_features *);
+static void print_established_timings(int scrnIndex,
+ struct established_timings *);
+static void print_std_timings(int scrnIndex, struct std_timings *);
+static void print_detailed_monitor_section(int scrnIndex,
+ struct detailed_monitor_section *);
+static void print_detailed_timings(int scrnIndex, struct detailed_timings *);
+
+static void print_input_features(int scrnIndex, struct disp_features *);
+static void print_dpms_features(int scrnIndex, struct disp_features *);
+static void print_whitepoint(int scrnIndex, struct disp_features *);
+
+xf86MonPtr
+xf86PrintEDID(xf86MonPtr m)
+{
+ if (!(m)) return NULL;
+ print_vendor(m->scrnIndex,&m->vendor);
+ print_version(m->scrnIndex,&m->ver);
+ print_display(m->scrnIndex,&m->features);
+ print_established_timings(m->scrnIndex,&m->timings1);
+ print_std_timings(m->scrnIndex,m->timings2);
+ print_detailed_monitor_section(m->scrnIndex,m->det_mon);
+ return m;
+}
+
+static void
+print_vendor(int scrnIndex, struct vendor *c)
+{
+ xf86DrvMsg(scrnIndex, X_INFO, "Manufacturer: %s Model: %x Serial#: %u\n",
+ &c->name, c->prod_id, c->serial);
+ xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week);
+}
+
+static void
+print_version(int scrnIndex, struct edid_version *c)
+{
+ xf86DrvMsg(scrnIndex,X_INFO,"EDID Version: %u.%u\n",c->version,
+ c->revision);
+}
+
+static void
+print_display(int scrnIndex, struct disp_features *disp)
+{
+ print_input_features(scrnIndex,disp);
+ xf86DrvMsg(scrnIndex,X_INFO,"Max H-Image Size [cm]: ");
+ if (disp->hsize)
+ xf86ErrorF("horiz.: %i ",disp->hsize);
+ else
+ xf86ErrorF("H-Size may change, ");
+ if (disp->vsize)
+ xf86ErrorF("vert.: %i\n",disp->vsize);
+ else
+ xf86ErrorF("V-Size may change\n");
+ xf86DrvMsg(scrnIndex,X_INFO,"Gamma: %.2f\n", disp->gamma);
+ print_dpms_features(scrnIndex,disp);
+ print_whitepoint(scrnIndex,disp);
+}
+
+static void
+print_input_features(int scrnIndex, struct disp_features *c)
+{
+ if (DIGITAL(c->input_type))
+ xf86DrvMsg(scrnIndex,X_INFO,"Digital Display Input\n");
+ else {
+ xf86DrvMsg(scrnIndex,X_INFO,"Analog Display Input, ");
+ xf86ErrorF("Input Voltage Level: ");
+ switch (c->input_voltage){
+ case V070:
+ xf86ErrorF("0.700/0.300 V\n");
+ break;
+ case V071:
+ xf86ErrorF("0.714/0.286 V\n");
+ break;
+ case V100:
+ xf86ErrorF("1.000/0.400 V\n");
+ break;
+ case V007:
+ xf86ErrorF("0.700/0.700 V\n");
+ break;
+ default:
+ xf86ErrorF("undefined\n");
+ }
+ if (SIG_SETUP(c->input_setup))
+ xf86DrvMsg(scrnIndex,X_INFO,"Signal levels configurable\n");
+ xf86DrvMsg(scrnIndex,X_INFO,"Sync:");
+ if (SEP_SYNC(c->input_sync))
+ xf86ErrorF(" Separate");
+ if (COMP_SYNC(c->input_sync))
+ xf86ErrorF(" Composite");
+ if (SYNC_O_GREEN(c->input_sync))
+ xf86ErrorF(" SyncOnGreen");
+ if (SYNC_SERR(c->input_sync))
+ xf86ErrorF("Serration on. "
+ "V.Sync Pulse req. if CompSync or SyncOnGreen\n");
+ else xf86ErrorF("\n");
+ }
+}
+
+static void
+print_dpms_features(int scrnIndex, struct disp_features *c)
+{
+ if (c->dpms) {
+ xf86DrvMsg(scrnIndex,X_INFO,"DPMS capabilities:");
+ if (DPMS_STANDBY(c->dpms)) xf86ErrorF(" StandBy");
+ if (DPMS_SUSPEND(c->dpms)) xf86ErrorF(" Suspend");
+ if (DPMS_OFF(c->dpms)) xf86ErrorF(" Off");
+ } else
+ xf86DrvMsg(scrnIndex,X_INFO,"No DPMS capabilities specified");
+ switch (c->display_type){
+ case DISP_MONO:
+ xf86ErrorF("; Monochorome/GrayScale Display\n");
+ break;
+ case DISP_RGB:
+ xf86ErrorF("; RGB/Color Display\n");
+ break;
+ case DISP_MULTCOLOR:
+ xf86ErrorF("; Non RGB Multicolor Display\n");
+ break;
+ default:
+ xf86ErrorF("\n");
+ break;
+ }
+ if (STD_COLOR_SPACE(c->msc))
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "Default color space is primary color space\n");
+ if (PREFERRED_TIMING_MODE(c->msc))
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "First detailed timing is preferred mode\n");
+ if (GFT_SUPPORTED(c->msc))
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "GTF timings supported\n");
+}
+
+static void
+print_whitepoint(int scrnIndex, struct disp_features *disp)
+{
+ xf86DrvMsg(scrnIndex,X_INFO,"redX: %.3f redY: %.3f ",
+ disp->redx,disp->redy);
+ xf86ErrorF("greenX: %.3f greenY: %.3f\n",
+ disp->greenx,disp->greeny);
+ xf86DrvMsg(scrnIndex,X_INFO,"blueX: %.3f blueY: %.3f ",
+ disp->bluex,disp->bluey);
+ xf86ErrorF("whiteX: %.3f whiteY: %.3f\n",
+ disp->whitex,disp->whitey);
+}
+
+static void
+print_established_timings(int scrnIndex, struct established_timings *t)
+{
+ unsigned char c;
+
+ if (t->t1 || t->t2 || t->t_manu)
+ xf86DrvMsg(scrnIndex,X_INFO,"Supported VESA Video Modes:\n");
+ c=t->t1;
+ if (c&0x80) xf86DrvMsg(scrnIndex,X_INFO,"720x400@70Hz\n");
+ if (c&0x40) xf86DrvMsg(scrnIndex,X_INFO,"720x400@88Hz\n");
+ if (c&0x20) xf86DrvMsg(scrnIndex,X_INFO,"640x480@60Hz\n");
+ if (c&0x10) xf86DrvMsg(scrnIndex,X_INFO,"640x480@67Hz\n");
+ if (c&0x08) xf86DrvMsg(scrnIndex,X_INFO,"640x480@72Hz\n");
+ if (c&0x04) xf86DrvMsg(scrnIndex,X_INFO,"640x480@75Hz\n");
+ if (c&0x02) xf86DrvMsg(scrnIndex,X_INFO,"800x600@56Hz\n");
+ if (c&0x01) xf86DrvMsg(scrnIndex,X_INFO,"800x600@60Hz\n");
+ c=t->t2;
+ if (c&0x80) xf86DrvMsg(scrnIndex,X_INFO,"800x600@72Hz\n");
+ if (c&0x40) xf86DrvMsg(scrnIndex,X_INFO,"800x600@75Hz\n");
+ if (c&0x20) xf86DrvMsg(scrnIndex,X_INFO,"832x624@75Hz\n");
+ if (c&0x10) xf86DrvMsg(scrnIndex,X_INFO,"1024x768@87Hz (interlaced)\n");
+ if (c&0x08) xf86DrvMsg(scrnIndex,X_INFO,"1024x768@60Hz\n");
+ if (c&0x04) xf86DrvMsg(scrnIndex,X_INFO,"1024x768@70Hz\n");
+ if (c&0x02) xf86DrvMsg(scrnIndex,X_INFO,"1024x768@75Hz\n");
+ if (c&0x01) xf86DrvMsg(scrnIndex,X_INFO,"1280x1024@75Hz\n");
+ c=t->t_manu;
+ if (c&0x80) xf86DrvMsg(scrnIndex,X_INFO,"1152x870@75Hz\n");
+ xf86DrvMsg(scrnIndex,X_INFO,"Manufacturer's mask: %X\n",c&0x7F);
+}
+
+static void
+print_std_timings(int scrnIndex, struct std_timings *t)
+{
+ int i;
+ char done = 0;
+ for (i=0;i<STD_TIMINGS;i++) {
+ if (t[i].hsize > 256) { /* sanity check */
+ if (!done) {
+ xf86DrvMsg(scrnIndex,X_INFO,"Supported Future Video Modes:\n");
+ done = 1;
+ }
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "#%i: hsize: %i vsize %i refresh: %i vid: %i\n",
+ i, t[i].hsize, t[i].vsize, t[i].refresh, t[i].id);
+ }
+ }
+}
+
+static void
+print_detailed_monitor_section(int scrnIndex,
+ struct detailed_monitor_section *m)
+{
+ int i,j;
+
+ for (i=0;i<DET_TIMINGS;i++) {
+ switch (m[i].type) {
+ case DT:
+ print_detailed_timings(scrnIndex,&m[i].section.d_timings);
+ break;
+ case DS_SERIAL:
+ xf86DrvMsg(scrnIndex,X_INFO,"Serial No: %s\n",m[i].section.serial);
+ break;
+ case DS_ASCII_STR:
+ xf86DrvMsg(scrnIndex,X_INFO," %s\n",m[i].section.ascii_data);
+ break;
+ case DS_NAME:
+ xf86DrvMsg(scrnIndex,X_INFO,"Monitor name: %s\n",m[i].section.name);
+ break;
+ case DS_RANGES:
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "Ranges: V min: %i V max: %i Hz, H min: %i H max: %i kHz,",
+ m[i].section.ranges.min_v, m[i].section.ranges.max_v,
+ m[i].section.ranges.min_h, m[i].section.ranges.max_h);
+ if (m[i].section.ranges.max_clock != 0)
+ xf86ErrorF(" PixClock max %i MHz\n",m[i].section.ranges.max_clock);
+ else
+ xf86DrvMsg(scrnIndex,X_INFO,"\n");
+ break;
+ case DS_STD_TIMINGS:
+ for (j = 0; j<5; j++)
+ xf86DrvMsg(scrnIndex,X_INFO,"#%i: hsize: %i vsize %i refresh: %i "
+ "vid: %i\n",i,m[i].section.std_t[i].hsize,
+ m[i].section.std_t[j].vsize,m[i].section.std_t[j].refresh,
+ m[i].section.std_t[j].id);
+ break;
+ case DS_WHITE_P:
+ for (j = 0; j<2; j++)
+ if (m[i].section.wp[j].index != 0)
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "White point %i: whiteX: %f, whiteY: %f; gamma: %f\n",
+ m[i].section.wp[j].index,m[i].section.wp[j].white_x,
+ m[i].section.wp[j].white_y,
+ m[i].section.wp[j].white_gamma);
+ break;
+ }
+ }
+}
+
+static void
+print_detailed_timings(int scrnIndex, struct detailed_timings *t)
+{
+
+ if (t->clock > 15000000) { /* sanity check */
+ xf86DrvMsg(scrnIndex,X_INFO,"Supported additional Video Mode:\n");
+ xf86DrvMsg(scrnIndex,X_INFO,"clock: %.1f MHz ",t->clock/1000000.0);
+ xf86ErrorF("Image Size: %i x %i mm\n",t->h_size,t->v_size);
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "h_active: %i h_sync: %i h_sync_end %i h_blank_end %i ",
+ t->h_active, t->h_sync_off + t->h_active,
+ t->h_sync_off + t->h_sync_width + t->h_active,
+ t->h_active + t->h_blanking);
+ xf86ErrorF("h_border: %i\n",t->h_border);
+ xf86DrvMsg(scrnIndex,X_INFO,
+ "v_active: %i v_sync: %i v_sync_end %i v_blanking: %i ",
+ t->v_active, t->v_sync_off + t->v_active,
+ t->v_sync_off + t->v_sync_width + t->v_active,
+ t->v_active + t->v_blanking);
+ xf86ErrorF("v_border: %i\n",t->v_border);
+ if (IS_STEREO(t->stereo)) {
+ xf86DrvMsg(scrnIndex,X_INFO,"Stereo: ");
+ if (IS_RIGHT_ON_SYNC(t->stereo))
+ xf86ErrorF("right channel on sync\n");
+ else xf86ErrorF("right channel on sync\n");
+ }
+ }
+}
diff --git a/hw/xfree86/ddc/print_vdif.c b/hw/xfree86/ddc/print_vdif.c
new file mode 100644
index 000000000..c65d1a0c9
--- /dev/null
+++ b/hw/xfree86/ddc/print_vdif.c
@@ -0,0 +1,222 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.3 2003/02/17 16:08:27 dawes Exp $ */
+
+#include "vdif.h"
+#include "misc.h"
+#include "xf86DDC.h"
+
+static void print_vdif(xf86VdifPtr l, char *s);
+static void print_timings(xf86VdifTimingPtr *pt);
+static void print_limits(xf86VdifLimitsPtr *pl);
+static void print_gamma(xf86VdifGammaPtr *pg);
+static void print_type(CARD8 c);
+static void print_polarity(CARD8 c);
+
+void
+xf86print_vdif(xf86vdifPtr v)
+{
+ print_vdif(v->vdif,v->strings);
+ print_limits(v->limits);
+ print_timings(v->timings);
+ print_gamma(v->gamma);
+}
+
+static void
+print_vdif(xf86VdifPtr l, char *s)
+{
+ ErrorF("Version %i.%i",l->VDIFVersion,l->VDIFRevision);
+ ErrorF(" Date: %i/%i/%i, Manufactured: %i/%i/%i\n",l->Date[0],
+ l->Date[1],l->Date[2],l->DateManufactured[0],
+ l->DateManufactured[1],l->DateManufactured[2]);
+ ErrorF("File Revision: %i",l->FileRevision);
+ ErrorF("Manufacturer: %s\n",s + l->Manufacturer);
+ ErrorF("ModelNumber: %s\n",s + l->ModelNumber);
+ ErrorF("VDIFIndex: %s\n",s +l->MinVDIFIndex);
+ ErrorF("Version: %s\n",s + l->Version);
+ ErrorF("SerialNumber %s\n",s + l->SerialNumber);
+ ErrorF("MonitorType: ");
+ switch (l->MonitorType) {
+ case VDIF_MONITOR_MONOCHROME:
+ ErrorF("Mono\n");
+ break;
+ case VDIF_MONITOR_COLOR:
+ ErrorF("Color\n");
+ break;
+ }
+ ErrorF("CRT Size: %i inches\n",l->CRTSize);
+ switch (l->MonitorType) {
+ case VDIF_MONITOR_MONOCHROME:
+ ErrorF("Border: %i percent\n",
+ l->BorderRed);
+ ErrorF("Phosphor Decay: 1: %i,",l->RedPhosphorDecay);
+ if (l->GreenPhosphorDecay !=0)
+ ErrorF(" 2: %i,",l->GreenPhosphorDecay);
+ if (l->BluePhosphorDecay !=0)
+ ErrorF(" 3: %i",l->BluePhosphorDecay);
+ ErrorF(" ms\n");
+ if (l->RedChromaticity_x)
+ ErrorF("Chromaticity: 1: x:%f, y:%f; ",
+ l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0);
+ if (l->GreenChromaticity_x)
+ ErrorF("Chromaticity: 2: x:%f, y:%f; ",
+ l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0);
+ if (l->BlueChromaticity_x)
+ ErrorF("Chromaticity: 3: x:%f, y:%f ",
+ l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
+ ErrorF("\n");
+ ErrorF("Gamma: %f\n",l->RedGamma/1000.0);
+ break;
+ case VDIF_MONITOR_COLOR:
+ ErrorF("Border: Red: %i Green: %i Blue: %i percent\n",
+ l->BorderRed,l->BorderGreen,l->BorderBlue);
+ ErrorF("Phosphor Decay: Red: %i, Green: %i, Blue: %i ms\n",
+ l->RedPhosphorDecay,l->GreenPhosphorDecay,l->BluePhosphorDecay);
+ ErrorF("Chromaticity: Red: x:%f, y:%f; Green: x:%f, y:%f; "
+ "Blue: x:%f, y:%f\n",
+ l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0,
+ l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0,
+ l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
+ ErrorF("Gamma: Red:%f, Green:%f, Blue:%f\n",l->RedGamma/1000.0,
+ l->GreenGamma/1000.0,l->BlueGamma/1000.0);
+ break;
+ }
+ ErrorF("White Point: x: %f y: %f Y: %f\n",l->WhitePoint_x/1000.0,
+ l->WhitePoint_y/1000.0,l->WhitePoint_Y/1000.0);
+}
+
+static void
+print_limits(xf86VdifLimitsPtr *pl)
+{
+ int i = 0;
+ xf86VdifLimitsPtr l;
+
+ while((l = pl[i]) != NULL) {
+ ErrorF("Max display resolution: %i x %i pixel\n",l->MaxHorPixel,
+ l->MaxVerPixel);
+ ErrorF("Size of active area: %i x %i millimeters\n",l->MaxHorActiveLength,
+ l->MaxVerActiveHeight);
+ ErrorF("Video Type: ");
+ print_type(l->VideoType);
+ ErrorF("Sync Type: ");
+ print_type(l->SyncType);
+ ErrorF("Sync Configuration ");
+ switch (l->SyncConfiguration) {
+ case VDIF_SYNC_SEPARATE:
+ ErrorF("separate\n");
+ break;
+ case VDIF_SYNC_C:
+ ErrorF("composite C\n");
+ break;
+ case VDIF_SYNC_CP:
+ ErrorF("composite CP\n");
+ break;
+ case VDIF_SYNC_G:
+ ErrorF("composite G\n");
+ break;
+ case VDIF_SYNC_GP:
+ ErrorF("composite GP\n");
+ break;
+ case VDIF_SYNC_OTHER:
+ ErrorF("other\n");
+ break;
+ }
+ ErrorF("Termination Resistance: %i\n",l->TerminationResistance);
+ ErrorF("Levels: white: %i, black: %i, blank: %i, sync: %i mV\n",
+ l->WhiteLevel,l->BlackLevel,l->BlankLevel,l->SyncLevel);
+ ErrorF("Max. Pixel Clock: %f MHz\n",l->MaxPixelClock/1000.0);
+ ErrorF("Freq. Range: Hor.: %f - %f kHz, Ver.: %f - %f Hz\n",
+ l->MaxHorFrequency/1000.0,l->MinHorFrequency/1000.0,
+ l->MaxVerFrequency/1000.0,l->MinVerFrequency/1000.0);
+ ErrorF("Retrace time: Hor: %f us, Ver: %f ms\n",l->MinHorRetrace/1000.0,
+ l->MinVerRetrace/1000.0);
+ }
+}
+
+static void
+print_timings(xf86VdifTimingPtr *pt)
+{
+ int i = 0;
+ xf86VdifTimingPtr t;
+
+ while((t = pt[i]) != NULL) {
+ ErrorF("SVGA / SVPMI mode number: %i\n",t->PreadjustedTimingName);
+ ErrorF("Mode %i x %i\n",t->HorPixel,t->VerPixel);
+ ErrorF("Size: %i x %i mm\n",t->HorAddrLength,t->VerAddrHeight);
+ ErrorF("Ratios: %i/%i\n",t->PixelWidthRatio,t->PixelHeightRatio);
+ ErrorF("Character width: %i",t->CharacterWidth);
+ ErrorF("Clock: %f MHz HFreq.: %f kHz, VFreq: %f Hz\n",t->PixelClock/1000.0,
+ t->HorFrequency/1000.0,t->VerFrequency/1000.0);
+ ErrorF("Htotal: %f us, Vtotal %f ms\n", t->HorTotalTime/1000.0,
+ t->VerTotalTime/1000.0);
+ ErrorF("HDisp: %f, HBlankStart: %f, HBlankLength: %f, "
+ "HSyncStart: %f HSyncEnd: %f us\n",t->HorAddrTime/1000.0,
+ t->HorBlankStart/1000.0,t->HorBlankTime/1000.0,
+ t->HorSyncStart/1000.0,t->HorSyncTime/1000.0);
+ ErrorF("VDisp: %f, VBlankStart: %f, VBlankLength: %f, "
+ "VSyncStart: %f VSyncEnd: %f us\n",t->VerAddrTime/1000.0,
+ t->VerBlankStart/1000.0,t->VerBlankTime/1000.0,
+ t->VerSyncStart/1000.0,t->VerSyncTime/1000.0);
+ ErrorF("Scan Type: ");
+ switch (t->ScanType) {
+ case VDIF_SCAN_INTERLACED:
+ ErrorF("interlaced ");
+ break;
+ case VDIF_SCAN_NONINTERLACED:
+ ErrorF("non interlaced ");
+ break;
+ case VDIF_SCAN_OTHER:
+ ErrorF("other ");
+ break;
+ }
+ ErrorF("Polarity: H: ");
+ print_polarity(t->HorSyncPolarity);
+ ErrorF("V: ");
+ print_polarity(t->VerSyncPolarity);
+ ErrorF("\n");
+ }
+}
+
+static void
+print_gamma(xf86VdifGammaPtr *pg)
+{
+ int i = 0;
+ xf86VdifGammaPtr g;
+
+ while((g = pg[i]) != NULL) {
+ ErrorF("Gamma Table Entries: %i\n",g->GammaTableEntries);
+ }
+}
+
+static void
+print_type(CARD8 c)
+{
+ switch (c) {
+ case VDIF_VIDEO_TTL :
+ ErrorF("TTL\n");
+ break;
+ case VDIF_VIDEO_ANALOG :
+ ErrorF("Analog\n");
+ break;
+ case VDIF_VIDEO_ECL:
+ ErrorF("ECL\n");
+ break;
+ case VDIF_VIDEO_DECL:
+ ErrorF("DECL\n");
+ break;
+ case VDIF_VIDEO_OTHER:
+ ErrorF("other\n");
+ break;
+ }
+}
+
+static void
+print_polarity(CARD8 c)
+{
+ switch (c) {
+ case VDIF_POLARITY_NEGATIVE:
+ ErrorF(" Neg.");
+ break;
+ case VDIF_POLARITY_POSITIVE:
+ ErrorF(" Pos.");
+ break;
+ }
+}
diff --git a/hw/xfree86/ddc/vdif.h b/hw/xfree86/ddc/vdif.h
new file mode 100644
index 000000000..38026e56a
--- /dev/null
+++ b/hw/xfree86/ddc/vdif.h
@@ -0,0 +1,174 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.3 2000/04/14 12:16:04 tsi Exp $ */
+
+#ifndef _VDIF_H
+#define _VDIF_H
+
+#define VDIF_MONITOR_MONOCHROME 0
+#define VDIF_MONITOR_COLOR 1
+#define VDIF_VIDEO_TTL 0
+#define VDIF_VIDEO_ANALOG 1
+#define VDIF_VIDEO_ECL 2
+#define VDIF_VIDEO_DECL 3
+#define VDIF_VIDEO_OTHER 4
+#define VDIF_SYNC_SEPARATE 0
+#define VDIF_SYNC_C 1
+#define VDIF_SYNC_CP 2
+#define VDIF_SYNC_G 3
+#define VDIF_SYNC_GP 4
+#define VDIF_SYNC_OTHER 5
+#define VDIF_SCAN_NONINTERLACED 0
+#define VDIF_SCAN_INTERLACED 1
+#define VDIF_SCAN_OTHER 2
+#define VDIF_POLARITY_NEGATIVE 0
+#define VDIF_POLARITY_POSITIVE 1
+
+#include "Xmd.h"
+
+#pragma pack(1)
+
+typedef struct _VDIF { /* Monitor Description: */
+ CARD8 VDIFId[4]; /* alway "VDIF" */
+ CARD32 FileLength; /* lenght of the whole file */
+ CARD32 Checksum; /* sum of all bytes in the file after*/
+ /* this field */
+ CARD16 VDIFVersion; /* structure version number */
+ CARD16 VDIFRevision; /* structure revision number */
+ CARD16 Date[3]; /* file date Year/Month/Day */
+ CARD16 DateManufactured[3]; /* date Year/Month/Day */
+ CARD32 FileRevision; /* file revision string */
+ CARD32 Manufacturer; /* ASCII ID of the manufacturer */
+ CARD32 ModelNumber; /* ASCII ID of the model */
+ CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */
+ CARD32 Version; /* ASCII ID of the model version */
+ CARD32 SerialNumber; /* ASCII ID of the serial number */
+ CARD8 MonitorType; /* Monochrome or Color */
+ CARD8 CRTSize; /* inches */
+ CARD8 BorderRed; /* percent */
+ CARD8 BorderGreen; /* percent */
+ CARD8 BorderBlue; /* percent */
+ CARD8 Reserved1; /* padding */
+ CARD16 Reserved2; /* padding */
+ CARD32 RedPhosphorDecay; /* microseconds */
+ CARD32 GreenPhosphorDecay; /* microseconds */
+ CARD32 BluePhosphorDecay; /* microseconds */
+ CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */
+ CARD16 WhitePoint_y;
+ CARD16 WhitePoint_Y;
+ CARD16 RedChromaticity_x; /* Red chromaticity in x,y */
+ CARD16 RedChromaticity_y;
+ CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */
+ CARD16 GreenChromaticity_y;
+ CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */
+ CARD16 BlueChromaticity_y;
+ CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */
+ CARD16 GreenGamma;
+ CARD16 BlueGamma;
+ CARD32 NumberOperationalLimits;
+ CARD32 OffsetOperationalLimits;
+ CARD32 NumberOptions; /* optinal sections (gamma table) */
+ CARD32 OffsetOptions;
+ CARD32 OffsetStringTable;
+} xf86VdifRec, *xf86VdifPtr;
+
+typedef enum { /* Tags for section identification */
+ VDIF_OPERATIONAL_LIMITS_TAG = 1,
+ VDIF_PREADJUSTED_TIMING_TAG,
+ VDIF_GAMMA_TABLE_TAG
+} VDIFScnTag;
+
+typedef struct _VDIFScnHdr { /* Generic Section Header: */
+ CARD32 ScnLength; /* lenght of section */
+ CARD32 ScnTag; /* tag for section identification */
+} VDIFScnHdrRec, *VDIFScnHdrPtr;
+
+typedef struct _VDIFLimits { /* Operational Limits: */
+ VDIFScnHdrRec Header; /* common section info */
+ CARD16 MaxHorPixel; /* pixels */
+ CARD16 MaxVerPixel; /* lines */
+ CARD16 MaxHorActiveLength; /* millimeters */
+ CARD16 MaxVerActiveHeight; /* millimeters */
+ CARD8 VideoType; /* TTL / Analog / ECL / DECL */
+ CARD8 SyncType; /* TTL / Analog / ECL / DECL */
+ CARD8 SyncConfiguration; /* separate / composite / other */
+ CARD8 Reserved1; /* padding */
+ CARD16 Reserved2; /* padding */
+ CARD16 TerminationResistance; /* */
+ CARD16 WhiteLevel; /* millivolts */
+ CARD16 BlackLevel; /* millivolts */
+ CARD16 BlankLevel; /* millivolts */
+ CARD16 SyncLevel; /* millivolts */
+ CARD32 MaxPixelClock; /* kiloHertz */
+ CARD32 MinHorFrequency; /* Hertz */
+ CARD32 MaxHorFrequency; /* Hertz */
+ CARD32 MinVerFrequency; /* milliHertz */
+ CARD32 MaxVerFrequency; /* milliHertz */
+ CARD16 MinHorRetrace; /* nanoseconds */
+ CARD16 MinVerRetrace; /* microseconds */
+ CARD32 NumberPreadjustedTimings;
+ CARD32 OffsetNextLimits;
+} xf86VdifLimitsRec, *xf86VdifLimitsPtr;
+
+typedef struct _VDIFTiming { /* Preadjusted Timing: */
+ VDIFScnHdrRec Header; /* common section info */
+ CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */
+ CARD16 HorPixel; /* pixels */
+ CARD16 VerPixel; /* lines */
+ CARD16 HorAddrLength; /* millimeters */
+ CARD16 VerAddrHeight; /* millimeters */
+ CARD8 PixelWidthRatio; /* gives H:V */
+ CARD8 PixelHeightRatio;
+ CARD8 Reserved1; /* padding */
+ CARD8 ScanType; /* noninterlaced / interlaced / other*/
+ CARD8 HorSyncPolarity; /* negative / positive */
+ CARD8 VerSyncPolarity; /* negative / positive */
+ CARD16 CharacterWidth; /* pixels */
+ CARD32 PixelClock; /* kiloHertz */
+ CARD32 HorFrequency; /* Hertz */
+ CARD32 VerFrequency; /* milliHertz */
+ CARD32 HorTotalTime; /* nanoseconds */
+ CARD32 VerTotalTime; /* microseconds */
+ CARD16 HorAddrTime; /* nanoseconds */
+ CARD16 HorBlankStart; /* nanoseconds */
+ CARD16 HorBlankTime; /* nanoseconds */
+ CARD16 HorSyncStart; /* nanoseconds */
+ CARD16 HorSyncTime; /* nanoseconds */
+ CARD16 VerAddrTime; /* microseconds */
+ CARD16 VerBlankStart; /* microseconds */
+ CARD16 VerBlankTime; /* microseconds */
+ CARD16 VerSyncStart; /* microseconds */
+ CARD16 VerSyncTime; /* microseconds */
+} xf86VdifTimingRec, *xf86VdifTimingPtr;
+
+typedef struct _VDIFGamma { /* Gamma Table: */
+ VDIFScnHdrRec Header; /* common section info */
+ CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */
+ CARD16 Unused1;
+} xf86VdifGammaRec, *xf86VdifGammaPtr;
+
+/* access macros */
+#define VDIF_OPERATIONAL_LIMITS(vdif) \
+((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits))
+#define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \
+ ((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits))
+#define VDIF_PREADJUSTED_TIMING(limits) \
+((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength))
+#define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \
+ ((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength))
+#define VDIF_OPTIONS(vdif) \
+ ((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions))
+#define VDIF_NEXT_OPTIONS(options) options = \
+ ((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength))
+#define VDIF_STRING(vdif, string) \
+ ((char*)((char*)vdif + vdif->OffsetStringTable + (string)))
+
+typedef struct _vdif {
+ xf86VdifPtr vdif;
+ xf86VdifLimitsPtr *limits;
+ xf86VdifTimingPtr *timings;
+ xf86VdifGammaPtr *gamma;
+ char * strings;
+} xf86vdif, *xf86vdifPtr;
+
+#pragma pack()
+
+#endif
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
new file mode 100644
index 000000000..736fb741b
--- /dev/null
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -0,0 +1,379 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.23 2003/02/17 16:08:27 dawes Exp $ */
+
+/* xf86DDC.c
+ *
+ * Copyright 1998,1999 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
+ */
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+#include "xf86DDC.h"
+#include "ddcPriv.h"
+
+#ifdef XFree86LOADER
+static const OptionInfoRec *DDCAvailableOptions(void *unused);
+#endif
+
+const char *i2cSymbols[] = {
+ "xf86CreateI2CDevRec",
+ "xf86I2CDevInit",
+ "xf86I2CWriteRead",
+ "xf86DestroyI2CDevRec",
+ NULL
+};
+
+#ifdef XFree86LOADER
+
+static MODULESETUPPROTO(ddcSetup);
+
+static XF86ModuleVersionInfo ddcVersRec =
+{
+ "ddc",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData ddcModuleData = { &ddcVersRec, ddcSetup, NULL };
+
+ModuleInfoRec DDC = {
+ 1,
+ "DDC",
+ NULL,
+ 0,
+ DDCAvailableOptions,
+};
+
+static pointer
+ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+
+ if (!setupDone) {
+ setupDone = TRUE;
+#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
+ if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
+#endif
+ xf86AddModuleInfo(&DDC, module);
+ /*
+ * Tell the loader about symbols from other modules that this module
+ * might refer to.
+ */
+ LoaderRefSymLists(i2cSymbols, NULL);
+
+ }
+ /*
+ * The return value must be non-NULL on success even though there
+ * is no TearDownProc.
+ */
+ return (pointer)1;
+}
+
+#endif
+
+#define RETRIES 4
+
+static unsigned char *EDIDRead_DDC1(
+ ScrnInfoPtr pScrn,
+ void (*)(ScrnInfoPtr,xf86ddcSpeed),
+ unsigned int (*)(ScrnInfoPtr)
+);
+
+static Bool TestDDC1(
+ ScrnInfoPtr pScrn,
+ unsigned int (*)(ScrnInfoPtr)
+);
+
+static unsigned int *FetchEDID_DDC1(
+ ScrnInfoPtr,
+ register unsigned int (*)(ScrnInfoPtr)
+);
+
+static unsigned char* EDID1Read_DDC2(
+ int scrnIndex,
+ I2CBusPtr pBus
+);
+
+static unsigned char * VDIFRead(
+ int scrnIndex,
+ I2CBusPtr pBus,
+ int start
+);
+
+static unsigned char * DDCRead_DDC2(
+ int scrnIndex,
+ I2CBusPtr pBus,
+ int start,
+ int len
+);
+
+typedef enum {
+ DDCOPT_NODDC1,
+ DDCOPT_NODDC2,
+ DDCOPT_NODDC
+} DDCOpts;
+
+static const OptionInfoRec DDCOptions[] = {
+ { DDCOPT_NODDC1, "NoDDC1", OPTV_BOOLEAN, {0}, FALSE },
+ { DDCOPT_NODDC2, "NoDDC2", OPTV_BOOLEAN, {0}, FALSE },
+ { DDCOPT_NODDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE },
+};
+
+#ifdef XFree86LOADER
+/*ARGSUSED*/
+static const OptionInfoRec *
+DDCAvailableOptions(void *unused)
+{
+ return (DDCOptions);
+}
+#endif
+
+xf86MonPtr
+xf86DoEDID_DDC1(
+ int scrnIndex, void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed),
+ unsigned int (*DDC1Read)(ScrnInfoPtr)
+)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ unsigned char *EDID_block = NULL;
+ xf86MonPtr tmp = NULL;
+ int sigio;
+ /* Default DDC and DDC1 to enabled. */
+ Bool noddc = FALSE, noddc1 = FALSE;
+ OptionInfoPtr options;
+
+ options = xnfalloc(sizeof(DDCOptions));
+ (void)memcpy(options, DDCOptions, sizeof(DDCOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
+
+ xf86GetOptValBool(options, DDCOPT_NODDC, &noddc);
+ xf86GetOptValBool(options, DDCOPT_NODDC1, &noddc1);
+ xfree(options);
+
+ if (noddc || noddc1)
+ return NULL;
+
+ sigio = xf86BlockSIGIO();
+ EDID_block = EDIDRead_DDC1(pScrn,DDC1SetSpeed,DDC1Read);
+ xf86UnblockSIGIO(sigio);
+
+ if (EDID_block){
+ tmp = xf86InterpretEDID(scrnIndex,EDID_block);
+ }
+#ifdef DEBUG
+ else ErrorF("No EDID block returned\n");
+ if (!tmp)
+ ErrorF("Cannot interpret EDID block\n");
+#endif
+ return tmp;
+}
+
+xf86MonPtr
+xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ unsigned char *EDID_block = NULL;
+ unsigned char *VDIF_Block = NULL;
+ xf86MonPtr tmp = NULL;
+ /* Default DDC and DDC2 to enabled. */
+ Bool noddc = FALSE, noddc2 = FALSE;
+ OptionInfoPtr options;
+
+ options = xnfalloc(sizeof(DDCOptions));
+ (void)memcpy(options, DDCOptions, sizeof(DDCOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
+
+ xf86GetOptValBool(options, DDCOPT_NODDC, &noddc);
+ xf86GetOptValBool(options, DDCOPT_NODDC2, &noddc2);
+ xfree(options);
+
+ if (noddc || noddc2)
+ return NULL;
+
+ EDID_block = EDID1Read_DDC2(scrnIndex,pBus);
+
+ if (EDID_block){
+ tmp = xf86InterpretEDID(scrnIndex,EDID_block);
+ } else {
+#ifdef DEBUG
+ ErrorF("No EDID block returned\n");
+#endif
+ return NULL;
+ }
+#ifdef DEBUG
+ if (!tmp)
+ ErrorF("Cannot interpret EDID block\n");
+ ErrorF("Sections to follow: %i\n",tmp->no_sections);
+#endif
+ VDIF_Block =
+ VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1));
+ tmp->vdif = xf86InterpretVdif(VDIF_Block);
+
+ return tmp;
+}
+
+/*
+ * read EDID record , pass it to callback function to interpret.
+ * callback function will store it for further use by calling
+ * function; it will also decide if we need to reread it
+ */
+static unsigned char *
+EDIDRead_DDC1(ScrnInfoPtr pScrn, void (*DDCSpeed)(ScrnInfoPtr,xf86ddcSpeed),
+ unsigned int (*read_DDC)(ScrnInfoPtr))
+{
+ unsigned char *EDID_block = NULL;
+ int count = RETRIES;
+
+ if (!read_DDC) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "chipset doesn't support DDC1\n");
+ return NULL;
+ };
+
+ if (TestDDC1(pScrn,read_DDC)==-1) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "No DDC signal\n");
+ return NULL;
+ };
+
+ if (DDCSpeed) DDCSpeed(pScrn,DDC_FAST);
+ do {
+ EDID_block = GetEDID_DDC1(FetchEDID_DDC1(pScrn,read_DDC));
+ count --;
+ } while (!EDID_block && count);
+ if (DDCSpeed) DDCSpeed(pScrn,DDC_SLOW);
+
+ return EDID_block;
+}
+
+/* test if DDC1 return 0 if not */
+static Bool
+TestDDC1(ScrnInfoPtr pScrn, unsigned int (*read_DDC)(ScrnInfoPtr))
+{
+ int old, count;
+
+ old = read_DDC(pScrn);
+ count = HEADER * BITS_PER_BYTE;
+ do {
+ /* wait for next retrace */
+ if (old != read_DDC(pScrn)) break;
+ } while(count--);
+ return (count);
+}
+
+/* fetch entire EDID record; DDC bit needs to be masked */
+static unsigned int *
+FetchEDID_DDC1(register ScrnInfoPtr pScrn,
+ register unsigned int (*read_DDC)(ScrnInfoPtr))
+{
+ int count = NUM;
+ unsigned int *ptr, *xp;
+
+ ptr=xp=xalloc(sizeof(int)*NUM);
+
+ if (!ptr) return NULL;
+ do {
+ /* wait for next retrace */
+ *xp = read_DDC(pScrn);
+ xp++;
+ } while(--count);
+ return (ptr);
+}
+
+static unsigned char*
+EDID1Read_DDC2(int scrnIndex, I2CBusPtr pBus)
+{
+ return DDCRead_DDC2(scrnIndex, pBus, 0, EDID1_LEN);
+}
+
+static unsigned char*
+VDIFRead(int scrnIndex, I2CBusPtr pBus, int start)
+{
+ unsigned char * Buffer, *v_buffer = NULL, *v_bufferp = NULL;
+ int i, num = 0;
+
+ /* read VDIF length in 64 byte blocks */
+ Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
+ if (Buffer == NULL)
+ return NULL;
+#ifdef DEBUG
+ ErrorF("number of 64 bit blocks: %i\n",Buffer[0]);
+#endif
+ if ((num = Buffer[0]) > 0)
+ v_buffer = v_bufferp = xalloc(sizeof(unsigned char) * 64 * num);
+
+ for (i = 0; i < num; i++) {
+ Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
+ if (Buffer == NULL) {
+ xfree (v_buffer);
+ return NULL;
+ }
+ memcpy(v_bufferp,Buffer,63); /* 64th byte is checksum */
+ xfree(Buffer);
+ v_bufferp += 63;
+ }
+ return v_buffer;
+}
+
+static unsigned char *
+DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
+{
+ I2CDevPtr dev;
+ unsigned char W_Buffer[2];
+ int w_bytes;
+ unsigned char *R_Buffer;
+ int i;
+
+ xf86LoaderReqSymLists(i2cSymbols, NULL);
+ dev = xf86CreateI2CDevRec();
+ dev->DevName = "ddc2";
+ dev->SlaveAddr = 0xA0;
+ dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
+ dev->StartTimeout = 550;
+ dev->BitTimeout = 40;
+ dev->ByteTimeout = 40;
+ dev->AcknTimeout = 40;
+
+ dev->pI2CBus = pBus;
+ if (! xf86I2CDevInit(dev)) {
+ xf86DrvMsg(X_PROBED,scrnIndex,"No DDC2 device\n");
+ return NULL;
+ }
+ if (start < 0x100) {
+ w_bytes = 1;
+ W_Buffer[0] = start;
+ } else {
+ w_bytes = 2;
+ W_Buffer[0] = start & 0xFF;
+ W_Buffer[1] = (start & 0xFF00) >> 8;
+ }
+ R_Buffer = xcalloc(1,sizeof(unsigned char)
+ * (len));
+ for (i=0; i<RETRIES; i++) {
+ if (xf86I2CWriteRead(dev, W_Buffer,w_bytes, R_Buffer,len)) {
+ if (!DDC_checksum(R_Buffer,len)) {
+ xf86DestroyI2CDevRec(dev,TRUE);
+ return R_Buffer;
+ }
+#ifdef DEBUG
+ else ErrorF("Checksum error in EDID block\n");
+#endif
+ }
+#ifdef DEBUG
+ else ErrorF("Error reading EDID block\n");
+#endif
+ }
+
+ xf86DestroyI2CDevRec(dev,TRUE);
+ xfree(R_Buffer);
+ return NULL;
+}
+
+
diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h
new file mode 100644
index 000000000..b4252ef6b
--- /dev/null
+++ b/hw/xfree86/ddc/xf86DDC.h
@@ -0,0 +1,61 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.h,v 1.11 2003/02/17 16:08:27 dawes Exp $ */
+
+/* xf86DDC.h
+ *
+ * This file contains all information to interpret a standard EDIC block
+ * transmitted by a display device via DDC (Display Data Channel). So far
+ * there is no information to deal with optional EDID blocks.
+ * DDC is a Trademark of VESA (Video Electronics Standard Association).
+ *
+ * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
+ */
+
+
+#ifndef XF86_DDC_H
+# define XF86_DDC_H
+
+#include "edid.h"
+#include "xf86i2c.h"
+#include "xf86str.h"
+
+/* speed up / slow down */
+typedef enum {
+ DDC_SLOW,
+ DDC_FAST
+} xf86ddcSpeed;
+
+extern xf86MonPtr xf86DoEDID_DDC1(
+ int scrnIndex,
+ void (*DDC1SetSpeed)(ScrnInfoPtr, xf86ddcSpeed),
+ unsigned int (*DDC1Read)(ScrnInfoPtr)
+);
+
+extern xf86MonPtr xf86DoEDID_DDC2(
+ int scrnIndex,
+ I2CBusPtr pBus
+);
+
+extern xf86MonPtr xf86PrintEDID(
+ xf86MonPtr monPtr
+);
+
+extern xf86MonPtr xf86InterpretEDID(
+ int screenIndex, Uchar *block
+);
+
+extern xf86vdifPtr xf86InterpretVdif(
+ CARD8 *c
+);
+
+extern Bool xf86SetDDCproperties(
+ ScrnInfoPtr pScreen,
+ xf86MonPtr DDC
+);
+
+extern void xf86print_vdif(
+ xf86vdifPtr v
+);
+
+#endif
+
+
diff --git a/hw/xfree86/dixmods/GLcoremodule.c b/hw/xfree86/dixmods/GLcoremodule.c
new file mode 100644
index 000000000..9369db1f2
--- /dev/null
+++ b/hw/xfree86/dixmods/GLcoremodule.c
@@ -0,0 +1,60 @@
+/* $XFree86: xc/programs/Xserver/GL/mesa/GLcore/GLcoremodule.c,v 1.1 2002/02/25 00:45:41 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, 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 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 <kevin@precisioninsight.com>
+ *
+ */
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(GLcoreSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "GLcore",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData GLcoreModuleData = { &VersRec, GLcoreSetup, NULL };
+
+static pointer
+GLcoreSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ /* Need a non-NULL return value to indicate success */
+ return (pointer)1;
+}
diff --git a/hw/xfree86/dixmods/afbmodule.c b/hw/xfree86/dixmods/afbmodule.c
new file mode 100644
index 000000000..19f196ad8
--- /dev/null
+++ b/hw/xfree86/dixmods/afbmodule.c
@@ -0,0 +1,49 @@
+/* $XFree86: xc/programs/Xserver/afb/afbmodule.c,v 1.1 1999/06/13 13:47:38 dawes Exp $ */
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+#include "afb.h"
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "afb",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData afbModuleData = { &VersRec, NULL, NULL };
+
+#endif
diff --git a/hw/xfree86/dixmods/bitmapmod.c b/hw/xfree86/dixmods/bitmapmod.c
new file mode 100644
index 000000000..27fc23d32
--- /dev/null
+++ b/hw/xfree86/dixmods/bitmapmod.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+/* $XFree86: xc/lib/font/bitmap/module/bitmapmod.c,v 1.7 1999/01/26 05:53:47 dawes Exp $ */
+
+#include "misc.h"
+
+#include "fontmod.h"
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(bitmapSetup);
+
+ /*
+ * This is the module data function that is accessed when loading
+ * libbitmap as a module.
+ */
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "bitmap",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_FONT, /* Font module */
+ ABI_FONT_VERSION,
+ MOD_CLASS_FONT,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData bitmapModuleData = { &VersRec, bitmapSetup, NULL };
+
+extern void BitmapRegisterFontFileFunctions(void);
+
+FontModule bitmapModule = {
+ BitmapRegisterFontFileFunctions,
+ "Bitmap",
+ NULL
+};
+
+static pointer
+bitmapSetup(pointer mod, pointer opts, int *errmaj, int *errmin)
+{
+ bitmapModule.module = mod;
+ LoadFont(&bitmapModule);
+
+ /* Need a non-NULL return */
+ return (pointer)1;
+}
diff --git a/hw/xfree86/dixmods/cfb16module.c b/hw/xfree86/dixmods/cfb16module.c
new file mode 100644
index 000000000..c8c79b545
--- /dev/null
+++ b/hw/xfree86/dixmods/cfb16module.c
@@ -0,0 +1,59 @@
+/* $XFree86: xc/programs/Xserver/cfb16/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+#include "cfb.h"
+
+static MODULESETUPPROTO(cfb16Setup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "cfb16",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData cfb16ModuleData = { &VersRec, cfb16Setup, NULL };
+
+static pointer
+cfb16Setup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ /* This modules requires cfb, so load it */
+ return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin);
+}
+
+#endif
diff --git a/hw/xfree86/dixmods/cfb24module.c b/hw/xfree86/dixmods/cfb24module.c
new file mode 100644
index 000000000..cf363f3c7
--- /dev/null
+++ b/hw/xfree86/dixmods/cfb24module.c
@@ -0,0 +1,59 @@
+/* $XFree86: xc/programs/Xserver/cfb24/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+#include "cfb.h"
+
+static MODULESETUPPROTO(cfb24Setup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "cfb24",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData cfb24ModuleData = { &VersRec, cfb24Setup, NULL };
+
+static pointer
+cfb24Setup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ /* This modules requires cfb, so load it */
+ return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin);
+}
+
+#endif
diff --git a/hw/xfree86/dixmods/cfb32module.c b/hw/xfree86/dixmods/cfb32module.c
new file mode 100644
index 000000000..791b64285
--- /dev/null
+++ b/hw/xfree86/dixmods/cfb32module.c
@@ -0,0 +1,59 @@
+/* $XFree86: xc/programs/Xserver/cfb32/cfbmodule.c,v 1.8 1999/01/26 05:53:49 dawes Exp $ */
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+#include "cfb.h"
+
+static MODULESETUPPROTO(cfb32Setup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "cfb32",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData cfb32ModuleData = { &VersRec, cfb32Setup, NULL };
+
+static pointer
+cfb32Setup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ /* This modules requires cfb, so load it */
+ return LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin);
+}
+
+#endif
diff --git a/hw/xfree86/dixmods/cfbmodule.c b/hw/xfree86/dixmods/cfbmodule.c
new file mode 100644
index 000000000..87af699db
--- /dev/null
+++ b/hw/xfree86/dixmods/cfbmodule.c
@@ -0,0 +1,59 @@
+/* $XFree86: xc/programs/Xserver/cfb/cfbmodule.c,v 1.8 1999/01/26 05:53:48 dawes Exp $ */
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+#include "cfb.h"
+
+static MODULESETUPPROTO(cfbSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "cfb",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData cfbModuleData = { &VersRec, cfbSetup, NULL };
+
+static pointer
+cfbSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ /* This modules requires mfb, so load it */
+ return LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin);
+}
+
+#endif
diff --git a/hw/xfree86/dixmods/dbemodule.c b/hw/xfree86/dixmods/dbemodule.c
new file mode 100644
index 000000000..f9dcc8477
--- /dev/null
+++ b/hw/xfree86/dixmods/dbemodule.c
@@ -0,0 +1,43 @@
+/* $XFree86: xc/programs/Xserver/dbe/dbemodule.c,v 1.7 2000/01/25 18:37:37 dawes Exp $ */
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(dbeSetup);
+
+extern void DbeExtensionInit(INITARGS);
+
+ExtensionModule dbeExt = {
+ DbeExtensionInit,
+ "DOUBLE-BUFFER",
+ NULL,
+ NULL,
+ NULL
+};
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "dbe",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_EXTENSION,
+ {0,0,0,0}
+};
+
+/*
+ * Data for the loader
+ */
+XF86ModuleData dbeModuleData = { &VersRec, dbeSetup, NULL };
+
+static pointer
+dbeSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ LoadExtension(&dbeExt, FALSE);
+
+ /* Need a non-NULL return value to indicate success */
+ return (pointer)1;
+}
diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h
new file mode 100644
index 000000000..2b0118f15
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/dgaproc.h
@@ -0,0 +1,147 @@
+/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.21 2000/06/30 19:06:54 keithp Exp $ */
+
+#ifndef __DGAPROC_H
+#define __DGAPROC_H
+
+#include "Xproto.h"
+#include "pixmap.h"
+
+#define DGA_CONCURRENT_ACCESS 0x00000001
+#define DGA_FILL_RECT 0x00000002
+#define DGA_BLIT_RECT 0x00000004
+#define DGA_BLIT_RECT_TRANS 0x00000008
+#define DGA_PIXMAP_AVAILABLE 0x00000010
+
+#define DGA_INTERLACED 0x00010000
+#define DGA_DOUBLESCAN 0x00020000
+
+#define DGA_FLIP_IMMEDIATE 0x00000001
+#define DGA_FLIP_RETRACE 0x00000002
+
+#define DGA_COMPLETED 0x00000000
+#define DGA_PENDING 0x00000001
+
+#define DGA_NEED_ROOT 0x00000001
+
+typedef struct {
+ int num; /* A unique identifier for the mode (num > 0) */
+ char *name; /* name of mode given in the XF86Config */
+ int VSync_num;
+ int VSync_den;
+ int flags; /* DGA_CONCURRENT_ACCESS, etc... */
+ int imageWidth; /* linear accessible portion (pixels) */
+ int imageHeight;
+ int pixmapWidth; /* Xlib accessible portion (pixels) */
+ int pixmapHeight; /* both fields ignored if no concurrent access */
+ int bytesPerScanline;
+ int byteOrder; /* MSBFirst, LSBFirst */
+ int depth;
+ int bitsPerPixel;
+ unsigned long red_mask;
+ unsigned long green_mask;
+ unsigned long blue_mask;
+ short visualClass;
+ int viewportWidth;
+ int viewportHeight;
+ int xViewportStep; /* viewport position granularity */
+ int yViewportStep;
+ int maxViewportX; /* max viewport origin */
+ int maxViewportY;
+ int viewportFlags; /* types of page flipping possible */
+ int offset;
+ int reserved1;
+ int reserved2;
+} XDGAModeRec, *XDGAModePtr;
+
+
+void XFree86DGAExtensionInit(void);
+
+/* DDX interface */
+
+int
+DGASetMode(
+ int Index,
+ int num,
+ XDGAModePtr mode,
+ PixmapPtr *pPix
+);
+
+void
+DGASetInputMode(
+ int Index,
+ Bool keyboard,
+ Bool mouse
+);
+
+void
+DGASelectInput(
+ int Index,
+ ClientPtr client,
+ long mask
+);
+
+Bool DGAAvailable(int Index);
+Bool DGAActive(int Index);
+void DGAShutdown(void);
+void DGAInstallCmap(ColormapPtr cmap);
+int DGAGetViewportStatus(int Index);
+int DGASync(int Index);
+
+int
+DGAFillRect(
+ int Index,
+ int x, int y, int w, int h,
+ unsigned long color
+);
+
+int
+DGABlitRect(
+ int Index,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty
+);
+
+int
+DGABlitTransRect(
+ int Index,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty,
+ unsigned long color
+);
+
+int
+DGASetViewport(
+ int Index,
+ int x, int y,
+ int mode
+);
+
+int DGAGetModes(int Index);
+int DGAGetOldDGAMode(int Index);
+
+int DGAGetModeInfo(int Index, XDGAModePtr mode, int num);
+
+Bool DGAVTSwitch(void);
+Bool DGAStealMouseEvent(int Index, xEvent *e, int dx, int dy);
+Bool DGAStealKeyEvent(int Index, xEvent *e);
+Bool DGAIsDgaEvent (xEvent *e);
+
+Bool DGADeliverEvent (ScreenPtr pScreen, xEvent *e);
+
+Bool DGAOpenFramebuffer(int Index, char **name, unsigned char **mem,
+ int *size, int *offset, int *flags);
+void DGACloseFramebuffer(int Index);
+Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode);
+int DGACreateColormap(int Index, ClientPtr client, int id, int mode,
+ int alloc);
+
+extern unsigned char DGAReqCode;
+extern int DGAErrorBase;
+extern int DGAEventBase;
+extern int *XDGAEventBase;
+
+
+
+#endif /* __DGAPROC_H */
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
new file mode 100644
index 000000000..d97b88fa4
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -0,0 +1,362 @@
+/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.16 2002/03/06 21:12:33 mvojkovi Exp $ */
+
+/*
+ *
+ * Copyright (c) 1997 Matthieu Herrb
+ *
+ * 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 Matthieu Herrb not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Matthieu Herrb makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * MATTHIEU HERRB DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL MATTHIEU HERRB 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.
+ */
+
+#ifdef XFree86LOADER
+#include "xf86_ansic.h"
+
+#include "xf86Module.h"
+#include "xf86Opt.h"
+
+#include "Xproto.h"
+
+static MODULESETUPPROTO(extmodSetup);
+
+extern Bool noTestExtensions;
+
+#ifdef SHAPE
+extern void ShapeExtensionInit(INITARGS);
+#define _SHAPE_SERVER_ /* don't want Xlib structures */
+#include "shapestr.h"
+#endif
+
+#ifdef MULTIBUFFER
+extern void MultibufferExtensionInit(INITARGS);
+#define _MULTIBUF_SERVER_ /* don't want Xlib structures */
+#include "multibufst.h"
+#endif
+
+#ifdef MITMISC
+extern void MITMiscExtensionInit(INITARGS);
+#define _MITMISC_SERVER_
+#include "mitmiscstr.h"
+#endif
+
+#ifdef XTEST
+extern void XTestExtensionInit(INITARGS);
+#define _XTEST_SERVER_
+#include "XTest.h"
+#include "xteststr.h"
+#endif
+
+#ifdef BIGREQS
+extern void BigReqExtensionInit(INITARGS);
+#include "bigreqstr.h"
+#endif
+
+#ifdef XSYNC
+extern void SyncExtensionInit(INITARGS);
+#define _SYNC_SERVER
+#include "sync.h"
+#include "syncstr.h"
+#endif
+
+#ifdef SCREENSAVER
+extern void ScreenSaverExtensionInit (INITARGS);
+#include "saver.h"
+#endif
+
+#ifdef XCMISC
+extern void XCMiscExtensionInit(INITARGS);
+#include "xcmiscstr.h"
+#endif
+
+#ifdef XF86VIDMODE
+extern void XFree86VidModeExtensionInit(INITARGS);
+#define _XF86VIDMODE_SERVER_
+#include "xf86vmstr.h"
+#endif
+
+#ifdef XF86MISC
+extern void XFree86MiscExtensionInit(INITARGS);
+#define _XF86MISC_SERVER_
+#define _XF86MISC_SAVER_COMPAT_
+#include "xf86mscstr.h"
+#endif
+
+#ifdef XFreeXDGA
+extern void XFree86DGAExtensionInit(INITARGS);
+extern void XFree86DGARegister(INITARGS);
+#define _XF86DGA_SERVER_
+#include "xf86dgastr.h"
+#endif
+
+#ifdef DPMSExtension
+extern void DPMSExtensionInit(INITARGS);
+#include "dpmsstr.h"
+#endif
+
+#ifdef FONTCACHE
+extern void FontCacheExtensionInit(INITARGS);
+#define _FONTCACHE_SERVER_
+#include "fontcacheP.h"
+#include "fontcachstr.h"
+#endif
+
+#ifdef TOGCUP
+extern void XcupExtensionInit(INITARGS);
+#define _XCUP_SERVER_
+#include "Xcupstr.h"
+#endif
+
+#ifdef EVI
+extern void EVIExtensionInit(INITARGS);
+#define _XEVI_SERVER_
+#include "XEVIstr.h"
+#endif
+
+#ifdef XV
+extern void XvExtensionInit(INITARGS);
+extern void XvMCExtensionInit(INITARGS);
+extern void XvRegister(INITARGS);
+#include "Xv.h"
+#include "XvMC.h"
+#endif
+
+#ifdef RES
+extern void ResExtensionInit(INITARGS);
+#include "XResproto.h"
+#endif
+
+/*
+ * Array describing extensions to be initialized
+ */
+ExtensionModule extensionModules[] = {
+#ifdef SHAPE
+ {
+ ShapeExtensionInit,
+ SHAPENAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef MULTIBUFFER
+ {
+ MultibufferExtensionInit,
+ MULTIBUFFER_PROTOCOL_NAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef MITMISC
+ {
+ MITMiscExtensionInit,
+ MITMISCNAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef notyet
+ {
+ XTestExtensionInit,
+ XTestExtensionName,
+ &noTestExtensions,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef BIGREQS
+ {
+ BigReqExtensionInit,
+ XBigReqExtensionName,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef XSYNC
+ {
+ SyncExtensionInit,
+ SYNC_NAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef SCREENSAVER
+ {
+ ScreenSaverExtensionInit,
+ ScreenSaverName,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef XCMISC
+ {
+ XCMiscExtensionInit,
+ XCMiscExtensionName,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef XF86VIDMODE
+ {
+ XFree86VidModeExtensionInit,
+ XF86VIDMODENAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef XF86MISC
+ {
+ XFree86MiscExtensionInit,
+ XF86MISCNAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef XFreeXDGA
+ {
+ XFree86DGAExtensionInit,
+ XF86DGANAME,
+ NULL,
+ XFree86DGARegister,
+ NULL
+ },
+#endif
+#ifdef DPMSExtension
+ {
+ DPMSExtensionInit,
+ DPMSExtensionName,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef FONTCACHE
+ {
+ FontCacheExtensionInit,
+ FONTCACHENAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef TOGCUP
+ {
+ XcupExtensionInit,
+ XCUPNAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef EVI
+ {
+ EVIExtensionInit,
+ EVINAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef XV
+ {
+ XvExtensionInit,
+ XvName,
+ NULL,
+ XvRegister,
+ NULL
+ },
+ {
+ XvMCExtensionInit,
+ XvMCName,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+#ifdef RES
+ {
+ ResExtensionInit,
+ XRES_NAME,
+ NULL,
+ NULL,
+ NULL
+ },
+#endif
+ { /* DON'T delete this entry ! */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ }
+};
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "extmod",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_EXTENSION,
+ {0,0,0,0}
+};
+
+/*
+ * Data for the loader
+ */
+XF86ModuleData extmodModuleData = { &VersRec, extmodSetup, NULL };
+
+static pointer
+extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ int i;
+
+ /* XXX the option stuff here is largely a sample/test case */
+
+ for (i = 0; extensionModules[i].name != NULL; i++) {
+ if (opts) {
+ char *s;
+ s = (char *)xalloc(strlen(extensionModules[i].name) + 5);
+ if (s) {
+ pointer o;
+ strcpy(s, "omit");
+ strcat(s, extensionModules[i].name);
+ o = xf86FindOption(opts, s);
+ xfree(s);
+ if (o) {
+ xf86MarkOptionUsed(o);
+ continue;
+ }
+ }
+ }
+ LoadExtension(&extensionModules[i], FALSE);
+ }
+ /* Need a non-NULL return */
+ return (pointer)1;
+}
+
+#endif /* XFree86LOADER */
diff --git a/hw/xfree86/dixmods/extmod/vidmodeproc.h b/hw/xfree86/dixmods/extmod/vidmodeproc.h
new file mode 100644
index 000000000..57a7872f0
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/vidmodeproc.h
@@ -0,0 +1,74 @@
+/* $XFree86: xc/programs/Xserver/Xext/vidmodeproc.h,v 1.5 2001/05/06 00:51:19 mvojkovi Exp $ */
+
+/* Prototypes for DGA functions that the DDX must provide */
+
+#ifndef _VIDMODEPROC_H_
+#define _VIDMODEPROC_H_
+
+
+typedef enum {
+ VIDMODE_H_DISPLAY,
+ VIDMODE_H_SYNCSTART,
+ VIDMODE_H_SYNCEND,
+ VIDMODE_H_TOTAL,
+ VIDMODE_H_SKEW,
+ VIDMODE_V_DISPLAY,
+ VIDMODE_V_SYNCSTART,
+ VIDMODE_V_SYNCEND,
+ VIDMODE_V_TOTAL,
+ VIDMODE_FLAGS,
+ VIDMODE_CLOCK
+} VidModeSelectMode;
+
+typedef enum {
+ VIDMODE_MON_VENDOR,
+ VIDMODE_MON_MODEL,
+ VIDMODE_MON_NHSYNC,
+ VIDMODE_MON_NVREFRESH,
+ VIDMODE_MON_HSYNC_LO,
+ VIDMODE_MON_HSYNC_HI,
+ VIDMODE_MON_VREFRESH_LO,
+ VIDMODE_MON_VREFRESH_HI
+} VidModeSelectMonitor;
+
+typedef union {
+ pointer ptr;
+ int i;
+ float f;
+} vidMonitorValue;
+
+void XFree86VidModeExtensionInit(void);
+
+Bool VidModeAvailable(int scrnIndex);
+Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode, int *dotClock);
+Bool VidModeGetFirstModeline(int scrnIndex, pointer *mode, int *dotClock);
+Bool VidModeGetNextModeline(int scrnIndex, pointer *mode, int *dotClock);
+Bool VidModeDeleteModeline(int scrnIndex, pointer mode);
+Bool VidModeZoomViewport(int scrnIndex, int zoom);
+Bool VidModeGetViewPort(int scrnIndex, int *x, int *y);
+Bool VidModeSetViewPort(int scrnIndex, int x, int y);
+Bool VidModeSwitchMode(int scrnIndex, pointer mode);
+Bool VidModeLockZoom(int scrnIndex, Bool lock);
+Bool VidModeGetMonitor(int scrnIndex, pointer *monitor);
+int VidModeGetNumOfClocks(int scrnIndex, Bool *progClock);
+Bool VidModeGetClocks(int scrnIndex, int *Clocks);
+ModeStatus VidModeCheckModeForMonitor(int scrnIndex, pointer mode);
+ModeStatus VidModeCheckModeForDriver(int scrnIndex, pointer mode);
+void VidModeSetCrtcForMode(int scrnIndex, pointer mode);
+Bool VidModeAddModeline(int scrnIndex, pointer mode);
+int VidModeGetDotClock(int scrnIndex, int Clock);
+int VidModeGetNumOfModes(int scrnIndex);
+Bool VidModeSetGamma(int scrnIndex, float red, float green, float blue);
+Bool VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue);
+pointer VidModeCreateMode(void);
+void VidModeCopyMode(pointer modefrom, pointer modeto);
+int VidModeGetModeValue(pointer mode, int valtyp);
+void VidModeSetModeValue(pointer mode, int valtyp, int val);
+vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx);
+Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *);
+Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *);
+int VidModeGetGammaRampSize(int scrnIndex);
+
+#endif
+
+
diff --git a/hw/xfree86/dixmods/extmod/xf86dga.c b/hw/xfree86/dixmods/extmod/xf86dga.c
new file mode 100644
index 000000000..9593c4a40
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/xf86dga.c
@@ -0,0 +1,302 @@
+/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.21 2000/06/30 19:06:54 keithp Exp $ */
+
+/*
+
+Copyright (c) 1995 Jon Tombs
+Copyright (c) 1995, 1996, 1999 XFree86 Inc
+
+*/
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include "X.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+#define _XF86DGA_SERVER_
+#include "xf86dga.h"
+#include "xf86dgastr.h"
+#include "swaprep.h"
+#include "dgaproc.h"
+
+
+static DISPATCH_PROC(ProcXF86DGADirectVideo);
+static DISPATCH_PROC(ProcXF86DGAGetVidPage);
+static DISPATCH_PROC(ProcXF86DGAGetVideoLL);
+static DISPATCH_PROC(ProcXF86DGAGetViewPortSize);
+static DISPATCH_PROC(ProcXF86DGASetVidPage);
+static DISPATCH_PROC(ProcXF86DGASetViewPort);
+static DISPATCH_PROC(ProcXF86DGAInstallColormap);
+static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo);
+static DISPATCH_PROC(ProcXF86DGAViewPortChanged);
+
+
+static int
+ProcXF86DGAGetVideoLL(ClientPtr client)
+{
+ REQUEST(xXF86DGAGetVideoLLReq);
+ xXF86DGAGetVideoLLReply rep;
+ XDGAModeRec mode;
+ int num, offset, flags;
+ char *name;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if(!DGAAvailable(stuff->screen))
+ return (DGAErrorBase + XF86DGANoDirectVideoMode);
+
+ if(!(num = DGAGetOldDGAMode(stuff->screen)))
+ return (DGAErrorBase + XF86DGANoDirectVideoMode);
+
+ /* get the parameters for the mode that best matches */
+ DGAGetModeInfo(stuff->screen, &mode, num);
+
+ if(!DGAOpenFramebuffer(stuff->screen, &name,
+ (unsigned char**)(&rep.offset),
+ (int*)(&rep.bank_size), &offset, &flags))
+ return BadAlloc;
+
+ rep.offset += mode.offset;
+ rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3);
+ rep.ram_size = rep.bank_size >> 10;
+
+ WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DGADirectVideo(ClientPtr client)
+{
+ int num;
+ PixmapPtr pix;
+ XDGAModeRec mode;
+ REQUEST(xXF86DGADirectVideoReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);
+
+ if (!DGAAvailable(stuff->screen))
+ return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+ if (stuff->enable & XF86DGADirectGraphics) {
+ if(!(num = DGAGetOldDGAMode(stuff->screen)))
+ return (DGAErrorBase + XF86DGANoDirectVideoMode);
+ } else
+ num = 0;
+
+ if(Success != DGASetMode(stuff->screen, num, &mode, &pix))
+ return (DGAErrorBase + XF86DGAScreenNotActive);
+
+ DGASetInputMode (stuff->screen,
+ (stuff->enable & XF86DGADirectKeyb) != 0,
+ (stuff->enable & XF86DGADirectMouse) != 0);
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DGAGetViewPortSize(ClientPtr client)
+{
+ int num;
+ XDGAModeRec mode;
+ REQUEST(xXF86DGAGetViewPortSizeReq);
+ xXF86DGAGetViewPortSizeReply rep;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DGAAvailable(stuff->screen))
+ return (DGAErrorBase + XF86DGANoDirectVideoMode);
+
+ if(!(num = DGAGetOldDGAMode(stuff->screen)))
+ return (DGAErrorBase + XF86DGANoDirectVideoMode);
+
+ DGAGetModeInfo(stuff->screen, &mode, num);
+
+ rep.width = mode.viewportWidth;
+ rep.height = mode.viewportHeight;
+
+ WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DGASetViewPort(ClientPtr client)
+{
+ REQUEST(xXF86DGASetViewPortReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq);
+
+ if (!DGAActive(stuff->screen))
+ {
+ int num;
+ PixmapPtr pix;
+ XDGAModeRec mode;
+
+ if(!(num = DGAGetOldDGAMode(stuff->screen)))
+ return (DGAErrorBase + XF86DGANoDirectVideoMode);
+ if(Success != DGASetMode(stuff->screen, num, &mode, &pix))
+ return (DGAErrorBase + XF86DGAScreenNotActive);
+ }
+
+ if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE)
+ != Success)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DGAGetVidPage(ClientPtr client)
+{
+ REQUEST(xXF86DGAGetVidPageReq);
+ xXF86DGAGetVidPageReply rep;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.vpage = 0; /* silently fail */
+
+ WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+
+static int
+ProcXF86DGASetVidPage(ClientPtr client)
+{
+ REQUEST(xXF86DGASetVidPageReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq);
+
+ /* silently fail */
+
+ return (client->noClientException);
+}
+
+
+static int
+ProcXF86DGAInstallColormap(ClientPtr client)
+{
+ ColormapPtr pcmp;
+ REQUEST(xXF86DGAInstallColormapReq);
+
+ REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq);
+
+ if (!DGAActive(stuff->screen))
+ return (DGAErrorBase + XF86DGADirectNotActivated);
+
+ pcmp = (ColormapPtr )LookupIDByType(stuff->id, RT_COLORMAP);
+ if (pcmp) {
+ DGAInstallCmap(pcmp);
+ return (client->noClientException);
+ } else {
+ client->errorValue = stuff->id;
+ return (BadColor);
+ }
+}
+
+static int
+ProcXF86DGAQueryDirectVideo(ClientPtr client)
+{
+ REQUEST(xXF86DGAQueryDirectVideoReq);
+ xXF86DGAQueryDirectVideoReply rep;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.flags = 0;
+
+ if (DGAAvailable(stuff->screen))
+ rep.flags = XF86DGADirectPresent;
+
+ WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DGAViewPortChanged(ClientPtr client)
+{
+ REQUEST(xXF86DGAViewPortChangedReq);
+ xXF86DGAViewPortChangedReply rep;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq);
+
+ if (!DGAActive(stuff->screen))
+ return (DGAErrorBase + XF86DGADirectNotActivated);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.result = 1;
+
+ WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+int
+ProcXF86DGADispatch (client)
+ register ClientPtr client;
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_XF86DGAGetVideoLL:
+ return ProcXF86DGAGetVideoLL(client);
+ case X_XF86DGADirectVideo:
+ return ProcXF86DGADirectVideo(client);
+ case X_XF86DGAGetViewPortSize:
+ return ProcXF86DGAGetViewPortSize(client);
+ case X_XF86DGASetViewPort:
+ return ProcXF86DGASetViewPort(client);
+ case X_XF86DGAGetVidPage:
+ return ProcXF86DGAGetVidPage(client);
+ case X_XF86DGASetVidPage:
+ return ProcXF86DGASetVidPage(client);
+ case X_XF86DGAInstallColormap:
+ return ProcXF86DGAInstallColormap(client);
+ case X_XF86DGAQueryDirectVideo:
+ return ProcXF86DGAQueryDirectVideo(client);
+ case X_XF86DGAViewPortChanged:
+ return ProcXF86DGAViewPortChanged(client);
+ default:
+ return BadRequest;
+ }
+}
+
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
new file mode 100644
index 000000000..c0d51b809
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -0,0 +1,773 @@
+/*
+ Copyright (c) 1999 - The XFree86 Project Inc.
+
+ Written by Mark Vojkovich
+*/
+/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.17 2001/10/28 03:32:51 tsi Exp $ */
+
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include "X.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "dixstruct.h"
+#include "dixevents.h"
+#include "pixmapstr.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+#define _XF86DGA_SERVER_
+#include "xf86dga.h"
+#include "xf86dgastr.h"
+#include "swaprep.h"
+#include "dgaproc.h"
+
+#ifdef EXTMODULE
+#include "xf86_ansic.h"
+#else
+#include <string.h>
+#endif
+
+
+static DISPATCH_PROC(ProcXDGADispatch);
+static DISPATCH_PROC(SProcXDGADispatch);
+static DISPATCH_PROC(ProcXDGAQueryVersion);
+static DISPATCH_PROC(ProcXDGAQueryModes);
+static DISPATCH_PROC(ProcXDGASetMode);
+static DISPATCH_PROC(ProcXDGAOpenFramebuffer);
+static DISPATCH_PROC(ProcXDGACloseFramebuffer);
+static DISPATCH_PROC(ProcXDGASetViewport);
+static DISPATCH_PROC(ProcXDGAInstallColormap);
+static DISPATCH_PROC(ProcXDGASelectInput);
+static DISPATCH_PROC(ProcXDGAFillRectangle);
+static DISPATCH_PROC(ProcXDGACopyArea);
+static DISPATCH_PROC(ProcXDGACopyTransparentArea);
+static DISPATCH_PROC(ProcXDGAGetViewportStatus);
+static DISPATCH_PROC(ProcXDGASync);
+static DISPATCH_PROC(ProcXDGASetClientVersion);
+static DISPATCH_PROC(ProcXDGAChangePixmapMode);
+static DISPATCH_PROC(ProcXDGACreateColormap);
+
+
+extern DISPATCH_PROC(ProcXF86DGADispatch);
+
+
+static void XDGAResetProc(ExtensionEntry *extEntry);
+
+static void DGAClientStateChange (CallbackListPtr*, pointer, pointer);
+
+static ClientPtr DGAClients[MAXSCREENS];
+
+unsigned char DGAReqCode = 0;
+int DGAErrorBase;
+int DGAEventBase;
+
+static int DGAGeneration = 0;
+static int DGAClientPrivateIndex;
+static int DGACallbackRefCount = 0;
+
+/* This holds the client's version information */
+typedef struct {
+ int major;
+ int minor;
+} DGAPrivRec, *DGAPrivPtr;
+
+#define DGAPRIV(c) ((c)->devPrivates[DGAClientPrivateIndex].ptr)
+
+void
+XFree86DGAExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+ if ((extEntry = AddExtension(XF86DGANAME,
+ XF86DGANumberEvents,
+ XF86DGANumberErrors,
+ ProcXDGADispatch,
+ SProcXDGADispatch,
+ XDGAResetProc,
+ StandardMinorOpcode))) {
+ int i;
+
+ for(i = 0; i < MAXSCREENS; i++)
+ DGAClients[i] = NULL;
+
+ DGAReqCode = (unsigned char)extEntry->base;
+ DGAErrorBase = extEntry->errorBase;
+ DGAEventBase = extEntry->eventBase;
+ for (i = KeyPress; i <= MotionNotify; i++)
+ SetCriticalEvent (DGAEventBase + i);
+ }
+
+ /*
+ * Allocate a client private index to hold the client's version
+ * information.
+ */
+ if (DGAGeneration != serverGeneration) {
+ DGAClientPrivateIndex = AllocateClientPrivateIndex();
+ /*
+ * Allocate 0 length, and use the private to hold a pointer to
+ * our DGAPrivRec.
+ */
+ if (!AllocateClientPrivate(DGAClientPrivateIndex, 0)) {
+ ErrorF("XFree86DGAExtensionInit: AllocateClientPrivate failed\n");
+ return;
+ }
+ DGAGeneration = serverGeneration;
+ }
+}
+
+
+
+static void
+XDGAResetProc (ExtensionEntry *extEntry)
+{
+ DeleteCallback (&ClientStateCallback, DGAClientStateChange, NULL);
+ DGACallbackRefCount = 0;
+}
+
+
+static int
+ProcXDGAQueryVersion(ClientPtr client)
+{
+ xXDGAQueryVersionReply rep;
+
+ REQUEST_SIZE_MATCH(xXDGAQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = XDGA_MAJOR_VERSION;
+ rep.minorVersion = XDGA_MINOR_VERSION;
+
+ WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+
+static int
+ProcXDGAOpenFramebuffer(ClientPtr client)
+{
+ REQUEST(xXDGAOpenFramebufferReq);
+ xXDGAOpenFramebufferReply rep;
+ char *deviceName;
+ int nameSize;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if (!DGAAvailable(stuff->screen))
+ return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+ REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if(!DGAOpenFramebuffer(stuff->screen, &deviceName,
+ (unsigned char**)(&rep.mem1),
+ (int*)&rep.size, (int*)&rep.offset, (int*)&rep.extra))
+ {
+ return BadAlloc;
+ }
+
+ nameSize = deviceName ? (strlen(deviceName) + 1) : 0;
+ rep.length = (nameSize + 3) >> 2;
+
+ WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *)&rep);
+ if(rep.length)
+ WriteToClient(client, nameSize, deviceName);
+
+ return (client->noClientException);
+}
+
+
+static int
+ProcXDGACloseFramebuffer(ClientPtr client)
+{
+ REQUEST(xXDGACloseFramebufferReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if (!DGAAvailable(stuff->screen))
+ return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+ REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq);
+
+ DGACloseFramebuffer(stuff->screen);
+
+ return (client->noClientException);
+}
+
+static int
+ProcXDGAQueryModes(ClientPtr client)
+{
+ int i, num, size;
+ REQUEST(xXDGAQueryModesReq);
+ xXDGAQueryModesReply rep;
+ xXDGAModeInfo info;
+ XDGAModePtr mode;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXDGAQueryModesReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.number = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DGAAvailable(stuff->screen)) {
+ rep.number = 0;
+ rep.length = 0;
+ WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
+ return (client->noClientException);
+ }
+
+ if(!(num = DGAGetModes(stuff->screen))) {
+ WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
+ return (client->noClientException);
+ }
+
+ if(!(mode = (XDGAModePtr)xalloc(num * sizeof(XDGAModeRec))))
+ return BadAlloc;
+
+ for(i = 0; i < num; i++)
+ DGAGetModeInfo(stuff->screen, mode + i, i + 1);
+
+ size = num * sz_xXDGAModeInfo;
+ for(i = 0; i < num; i++)
+ size += (strlen(mode[i].name) + 4) & ~3L; /* plus NULL */
+
+ rep.number = num;
+ rep.length = size >> 2;
+
+ WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
+
+ for(i = 0; i < num; i++) {
+ size = strlen(mode[i].name) + 1;
+
+ info.byte_order = mode[i].byteOrder;
+ info.depth = mode[i].depth;
+ info.num = mode[i].num;
+ info.bpp = mode[i].bitsPerPixel;
+ info.name_size = (size + 3) & ~3L;
+ info.vsync_num = mode[i].VSync_num;
+ info.vsync_den = mode[i].VSync_den;
+ info.flags = mode[i].flags;
+ info.image_width = mode[i].imageWidth;
+ info.image_height = mode[i].imageHeight;
+ info.pixmap_width = mode[i].pixmapWidth;
+ info.pixmap_height = mode[i].pixmapHeight;
+ info.bytes_per_scanline = mode[i].bytesPerScanline;
+ info.red_mask = mode[i].red_mask;
+ info.green_mask = mode[i].green_mask;
+ info.blue_mask = mode[i].blue_mask;
+ info.visual_class = mode[i].visualClass;
+ info.viewport_width = mode[i].viewportWidth;
+ info.viewport_height = mode[i].viewportHeight;
+ info.viewport_xstep = mode[i].xViewportStep;
+ info.viewport_ystep = mode[i].yViewportStep;
+ info.viewport_xmax = mode[i].maxViewportX;
+ info.viewport_ymax = mode[i].maxViewportY;
+ info.viewport_flags = mode[i].viewportFlags;
+ info.reserved1 = mode[i].reserved1;
+ info.reserved2 = mode[i].reserved2;
+
+ WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info));
+ WriteToClient(client, size, mode[i].name);
+ }
+
+ xfree(mode);
+
+ return (client->noClientException);
+}
+
+
+static void
+DGAClientStateChange (
+ CallbackListPtr* pcbl,
+ pointer nulldata,
+ pointer calldata
+){
+ NewClientInfoRec* pci = (NewClientInfoRec*) calldata;
+ ClientPtr client = NULL;
+ int i;
+
+ for(i = 0; i < screenInfo.numScreens; i++) {
+ if(DGAClients[i] == pci->client) {
+ client = pci->client;
+ break;
+ }
+ }
+
+ if(client &&
+ ((client->clientState == ClientStateGone) ||
+ (client->clientState == ClientStateRetained))) {
+ XDGAModeRec mode;
+ PixmapPtr pPix;
+
+ DGAClients[i] = NULL;
+ DGASelectInput(i, NULL, 0);
+ DGASetMode(i, 0, &mode, &pPix);
+
+ if(--DGACallbackRefCount == 0)
+ DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
+ }
+}
+
+static int
+ProcXDGASetMode(ClientPtr client)
+{
+ REQUEST(xXDGASetModeReq);
+ xXDGASetModeReply rep;
+ XDGAModeRec mode;
+ xXDGAModeInfo info;
+ PixmapPtr pPix;
+ int size;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXDGASetModeReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.offset = 0;
+ rep.flags = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DGAAvailable(stuff->screen))
+ return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+ if(DGAClients[stuff->screen] &&
+ (DGAClients[stuff->screen] != client))
+ return DGAErrorBase + XF86DGANoDirectVideoMode;
+
+ if(!stuff->mode) {
+ if(DGAClients[stuff->screen]) {
+ if(--DGACallbackRefCount == 0)
+ DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL);
+ }
+ DGAClients[stuff->screen] = NULL;
+ DGASelectInput(stuff->screen, NULL, 0);
+ DGASetMode(stuff->screen, 0, &mode, &pPix);
+ WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep);
+ return (client->noClientException);
+ }
+
+ if(Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix))
+ return BadValue;
+
+ if(!DGAClients[stuff->screen]) {
+ if(DGACallbackRefCount++ == 0)
+ AddCallback (&ClientStateCallback, DGAClientStateChange, NULL);
+ }
+
+ DGAClients[stuff->screen] = client;
+
+ if(pPix) {
+ if(AddResource(stuff->pid, RT_PIXMAP, (pointer)(pPix))) {
+ pPix->drawable.id = (int)stuff->pid;
+ rep.flags = DGA_PIXMAP_AVAILABLE;
+ }
+ }
+
+ size = strlen(mode.name) + 1;
+
+ info.byte_order = mode.byteOrder;
+ info.depth = mode.depth;
+ info.num = mode.num;
+ info.bpp = mode.bitsPerPixel;
+ info.name_size = (size + 3) & ~3L;
+ info.vsync_num = mode.VSync_num;
+ info.vsync_den = mode.VSync_den;
+ info.flags = mode.flags;
+ info.image_width = mode.imageWidth;
+ info.image_height = mode.imageHeight;
+ info.pixmap_width = mode.pixmapWidth;
+ info.pixmap_height = mode.pixmapHeight;
+ info.bytes_per_scanline = mode.bytesPerScanline;
+ info.red_mask = mode.red_mask;
+ info.green_mask = mode.green_mask;
+ info.blue_mask = mode.blue_mask;
+ info.visual_class = mode.visualClass;
+ info.viewport_width = mode.viewportWidth;
+ info.viewport_height = mode.viewportHeight;
+ info.viewport_xstep = mode.xViewportStep;
+ info.viewport_ystep = mode.yViewportStep;
+ info.viewport_xmax = mode.maxViewportX;
+ info.viewport_ymax = mode.maxViewportY;
+ info.viewport_flags = mode.viewportFlags;
+ info.reserved1 = mode.reserved1;
+ info.reserved2 = mode.reserved2;
+
+ rep.length = (sz_xXDGAModeInfo + info.name_size) >> 2;
+
+ WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep);
+ WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info));
+ WriteToClient(client, size, mode.name);
+
+ return (client->noClientException);
+}
+
+static int
+ProcXDGASetViewport(ClientPtr client)
+{
+ REQUEST(xXDGASetViewportReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGASetViewportReq);
+
+ DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags);
+
+ return (client->noClientException);
+}
+
+static int
+ProcXDGAInstallColormap(ClientPtr client)
+{
+ ColormapPtr cmap;
+ REQUEST(xXDGAInstallColormapReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGAInstallColormapReq);
+
+ cmap = (ColormapPtr)LookupIDByType(stuff->cmap, RT_COLORMAP);
+ if (cmap) {
+ DGAInstallCmap(cmap);
+ return (client->noClientException);
+ } else {
+ client->errorValue = stuff->cmap;
+ return (BadColor);
+ }
+
+ return (client->noClientException);
+}
+
+
+static int
+ProcXDGASelectInput(ClientPtr client)
+{
+ REQUEST(xXDGASelectInputReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGASelectInputReq);
+
+ if(DGAClients[stuff->screen] == client)
+ DGASelectInput(stuff->screen, client, stuff->mask);
+
+ return (client->noClientException);
+}
+
+
+static int
+ProcXDGAFillRectangle(ClientPtr client)
+{
+ REQUEST(xXDGAFillRectangleReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGAFillRectangleReq);
+
+ if(Success != DGAFillRect(stuff->screen, stuff->x, stuff->y,
+ stuff->width, stuff->height, stuff->color))
+ return BadMatch;
+
+ return (client->noClientException);
+}
+
+static int
+ProcXDGACopyArea(ClientPtr client)
+{
+ REQUEST(xXDGACopyAreaReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGACopyAreaReq);
+
+ if(Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy,
+ stuff->width, stuff->height, stuff->dstx, stuff->dsty))
+ return BadMatch;
+
+ return (client->noClientException);
+}
+
+
+static int
+ProcXDGACopyTransparentArea(ClientPtr client)
+{
+ REQUEST(xXDGACopyTransparentAreaReq);
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq);
+
+ if(Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy,
+ stuff->width, stuff->height, stuff->dstx, stuff->dsty, stuff->key))
+ return BadMatch;
+
+ return (client->noClientException);
+}
+
+
+static int
+ProcXDGAGetViewportStatus(ClientPtr client)
+{
+ REQUEST(xXDGAGetViewportStatusReq);
+ xXDGAGetViewportStatusReply rep;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ rep.status = DGAGetViewportStatus(stuff->screen);
+
+ WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXDGASync(ClientPtr client)
+{
+ REQUEST(xXDGASyncReq);
+ xXDGASyncReply rep;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGASyncReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ DGASync(stuff->screen);
+
+ WriteToClient(client, sizeof(xXDGASyncReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXDGASetClientVersion(ClientPtr client)
+{
+ REQUEST(xXDGASetClientVersionReq);
+
+ DGAPrivPtr pPriv;
+
+ REQUEST_SIZE_MATCH(xXDGASetClientVersionReq);
+ if ((pPriv = DGAPRIV(client)) == NULL) {
+ pPriv = xalloc(sizeof(DGAPrivRec));
+ /* XXX Need to look into freeing this */
+ if (!pPriv)
+ return BadAlloc;
+ DGAPRIV(client) = pPriv;
+ }
+ pPriv->major = stuff->major;
+ pPriv->minor = stuff->minor;
+
+ return (client->noClientException);
+}
+
+static int
+ProcXDGAChangePixmapMode(ClientPtr client)
+{
+ REQUEST(xXDGAChangePixmapModeReq);
+ xXDGAChangePixmapModeReply rep;
+ int x, y;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ x = stuff->x;
+ y = stuff->y;
+
+ if(!DGAChangePixmapMode(stuff->screen, &x, &y, stuff->flags))
+ return BadMatch;
+
+ rep.x = x;
+ rep.y = y;
+ WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *)&rep);
+
+ return (client->noClientException);
+}
+
+
+static int
+ProcXDGACreateColormap(ClientPtr client)
+{
+ REQUEST(xXDGACreateColormapReq);
+ int result;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ if(DGAClients[stuff->screen] != client)
+ return DGAErrorBase + XF86DGADirectNotActivated;
+
+ REQUEST_SIZE_MATCH(xXDGACreateColormapReq);
+
+ if(!stuff->mode)
+ return BadValue;
+
+ result = DGACreateColormap(stuff->screen, client, stuff->id,
+ stuff->mode, stuff->alloc);
+ if(result != Success)
+ return result;
+
+ return (client->noClientException);
+}
+
+
+static int
+SProcXDGADispatch (ClientPtr client)
+{
+ return DGAErrorBase + XF86DGAClientNotLocal;
+}
+
+#if 0
+#define DGA_REQ_DEBUG
+#endif
+
+#ifdef DGA_REQ_DEBUG
+static char *dgaMinor[] = {
+ "QueryVersion",
+ "GetVideoLL",
+ "DirectVideo",
+ "GetViewPortSize",
+ "SetViewPort",
+ "GetVidPage",
+ "SetVidPage",
+ "InstallColormap",
+ "QueryDirectVideo",
+ "ViewPortChanged",
+ "10",
+ "11",
+ "QueryModes",
+ "SetMode",
+ "SetViewport",
+ "InstallColormap",
+ "SelectInput",
+ "FillRectangle",
+ "CopyArea",
+ "CopyTransparentArea",
+ "GetViewportStatus",
+ "Sync",
+ "OpenFramebuffer",
+ "CloseFramebuffer",
+ "SetClientVersion",
+ "ChangePixmapMode",
+ "CreateColormap",
+};
+#endif
+
+static int
+ProcXDGADispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ if (!LocalClient(client))
+ return DGAErrorBase + XF86DGAClientNotLocal;
+
+#ifdef DGA_REQ_DEBUG
+ if (stuff->data <= X_XDGACreateColormap)
+ fprintf (stderr, " DGA %s\n", dgaMinor[stuff->data]);
+#endif
+
+ /* divert old protocol */
+#if 1
+ if( (stuff->data <= X_XF86DGAViewPortChanged) &&
+ (stuff->data >= X_XF86DGAGetVideoLL))
+ return ProcXF86DGADispatch(client);
+#endif
+
+ switch (stuff->data){
+ case X_XDGAQueryVersion:
+ return ProcXDGAQueryVersion(client);
+ case X_XDGAQueryModes:
+ return ProcXDGAQueryModes(client);
+ case X_XDGASetMode:
+ return ProcXDGASetMode(client);
+ case X_XDGAOpenFramebuffer:
+ return ProcXDGAOpenFramebuffer(client);
+ case X_XDGACloseFramebuffer:
+ return ProcXDGACloseFramebuffer(client);
+ case X_XDGASetViewport:
+ return ProcXDGASetViewport(client);
+ case X_XDGAInstallColormap:
+ return ProcXDGAInstallColormap(client);
+ case X_XDGASelectInput:
+ return ProcXDGASelectInput(client);
+ case X_XDGAFillRectangle:
+ return ProcXDGAFillRectangle(client);
+ case X_XDGACopyArea:
+ return ProcXDGACopyArea(client);
+ case X_XDGACopyTransparentArea:
+ return ProcXDGACopyTransparentArea(client);
+ case X_XDGAGetViewportStatus:
+ return ProcXDGAGetViewportStatus(client);
+ case X_XDGASync:
+ return ProcXDGASync(client);
+ case X_XDGASetClientVersion:
+ return ProcXDGASetClientVersion(client);
+ case X_XDGAChangePixmapMode:
+ return ProcXDGAChangePixmapMode(client);
+ case X_XDGACreateColormap:
+ return ProcXDGACreateColormap(client);
+ default:
+ return BadRequest;
+ }
+}
+
+#ifdef EXTMODULE
+void
+XFree86DGARegister()
+{
+ XDGAEventBase = &DGAEventBase;
+}
+#endif
diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c
new file mode 100644
index 000000000..bc8e94b45
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/xf86misc.c
@@ -0,0 +1,767 @@
+/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.37 2002/11/20 04:04:58 dawes Exp $ */
+
+/*
+ * Copyright (c) 1995, 1996 The XFree86 Project, Inc
+ */
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include "X.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "scrnintstr.h"
+#include "inputstr.h"
+#include "servermd.h"
+#define _XF86MISC_SERVER_
+#undef _XF86MISC_SAVER_COMPAT_
+#include "xf86mscstr.h"
+#include "swaprep.h"
+#include "xf86.h"
+#include "Xfuncproto.h"
+#include "xf86miscproc.h"
+
+#if 0
+#include <X11/Xtrans.h>
+#include "../os/osdep.h"
+#include <X11/Xauth.h>
+#ifndef USL
+#ifndef Lynx
+#include <sys/socket.h>
+#else
+#include <socket.h>
+#endif
+#endif /* USL */
+#endif
+
+#ifdef EXTMODULE
+#include "xf86_ansic.h"
+#endif
+
+static int miscErrorBase;
+static int MiscGeneration = 0;
+static int MiscClientPrivateIndex;
+
+/* This holds the client's version information */
+typedef struct {
+ int major;
+ int minor;
+} MiscPrivRec, *MiscPrivPtr;
+
+#define MPRIV(c) ((c)->devPrivates[MiscClientPrivateIndex].ptr)
+
+static void XF86MiscResetProc(
+#if NeedFunctionPrototypes
+ ExtensionEntry* /* extEntry */
+#endif
+);
+
+static void
+ClientVersion(ClientPtr client, int *major, int *minor)
+{
+ MiscPrivPtr pPriv;
+
+ pPriv = MPRIV(client);
+ if (!pPriv) {
+ if (major) *major = 0;
+ if (minor) *minor = 0;
+ return;
+ }
+
+ if (major) *major = pPriv->major;
+ if (minor) *minor = pPriv->minor;
+}
+
+static DISPATCH_PROC(ProcXF86MiscDispatch);
+static DISPATCH_PROC(ProcXF86MiscQueryVersion);
+static DISPATCH_PROC(ProcXF86MiscGetKbdSettings);
+static DISPATCH_PROC(ProcXF86MiscGetMouseSettings);
+static DISPATCH_PROC(ProcXF86MiscSetKbdSettings);
+static DISPATCH_PROC(ProcXF86MiscSetMouseSettings);
+static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState);
+static DISPATCH_PROC(ProcXF86MiscSetClientVersion);
+static DISPATCH_PROC(ProcXF86MiscGetFilePaths);
+#ifdef _XF86MISC_SAVER_COMPAT_
+static DISPATCH_PROC(ProcXF86MiscGetSaver);
+static DISPATCH_PROC(ProcXF86MiscSetSaver);
+#endif
+static DISPATCH_PROC(SProcXF86MiscDispatch);
+static DISPATCH_PROC(SProcXF86MiscQueryVersion);
+static DISPATCH_PROC(SProcXF86MiscGetKbdSettings);
+static DISPATCH_PROC(SProcXF86MiscGetMouseSettings);
+static DISPATCH_PROC(SProcXF86MiscSetKbdSettings);
+static DISPATCH_PROC(SProcXF86MiscSetMouseSettings);
+static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState);
+static DISPATCH_PROC(SProcXF86MiscSetClientVersion);
+static DISPATCH_PROC(SProcXF86MiscGetFilePaths);
+#ifdef _XF86MISC_SAVER_COMPAT_
+static DISPATCH_PROC(SProcXF86MiscGetSaver);
+static DISPATCH_PROC(SProcXF86MiscSetSaver);
+#endif
+
+static unsigned char XF86MiscReqCode = 0;
+
+#ifdef DEBUG
+# define DEBUG_P(x) ErrorF(x"\n");
+#else
+# define DEBUG_P(x) /**/
+#endif
+
+#define MISCERR(x) (miscErrorBase + x)
+
+void
+XFree86MiscExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+ DEBUG_P("XFree86MiscExtensionInit");
+
+ if (!xf86GetModInDevEnabled())
+ return;
+
+ /*
+ * Allocate a client private index to hold the client's version
+ * information.
+ */
+ if (MiscGeneration != serverGeneration) {
+ MiscClientPrivateIndex = AllocateClientPrivateIndex();
+ /*
+ * Allocate 0 length, and use the private to hold a pointer to our
+ * MiscPrivRec.
+ */
+ if (!AllocateClientPrivate(MiscClientPrivateIndex, 0)) {
+ ErrorF("XFree86MiscExtensionInit: "
+ "AllocateClientPrivate failed\n");
+ return;
+ }
+ MiscGeneration = serverGeneration;
+ }
+
+ if (
+ (extEntry = AddExtension(XF86MISCNAME,
+ XF86MiscNumberEvents,
+ XF86MiscNumberErrors,
+ ProcXF86MiscDispatch,
+ SProcXF86MiscDispatch,
+ XF86MiscResetProc,
+ StandardMinorOpcode))) {
+ XF86MiscReqCode = (unsigned char)extEntry->base;
+ miscErrorBase = extEntry->errorBase;
+ }
+}
+
+/*ARGSUSED*/
+static void
+XF86MiscResetProc (extEntry)
+ ExtensionEntry* extEntry;
+{
+}
+
+static int
+ProcXF86MiscQueryVersion(client)
+ register ClientPtr client;
+{
+ xXF86MiscQueryVersionReply rep;
+ register int n;
+
+ DEBUG_P("XF86MiscQueryVersion");
+
+ REQUEST_SIZE_MATCH(xXF86MiscQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = XF86MISC_MAJOR_VERSION;
+ rep.minorVersion = XF86MISC_MINOR_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.majorVersion, n);
+ swaps(&rep.minorVersion, n);
+ }
+ WriteToClient(client, sizeof(xXF86MiscQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+#ifdef _XF86MISC_SAVER_COMPAT_
+/* THESE HAVE NOT BEEN CONVERTED TO THE NEW DESIGN */
+
+/*
+ * This will go away, but remains for now for compatibility with older
+ * clients.
+ */
+static int
+ProcXF86MiscSetSaver(client)
+ register ClientPtr client;
+{
+ REQUEST(xXF86MiscSetSaverReq);
+ ScrnInfoPtr vptr;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr;
+
+ REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq);
+
+ if (stuff->suspendTime < 0)
+ return BadValue;
+ if (stuff->offTime < 0)
+ return BadValue;
+
+ return (client->noClientException);
+}
+
+/*
+ * This will go away, but remains for now for compatibility with older
+ * clients.
+ */
+static int
+ProcXF86MiscGetSaver(client)
+ register ClientPtr client;
+{
+ REQUEST(xXF86MiscGetSaverReq);
+ xXF86MiscGetSaverReply rep;
+ register int n;
+ ScrnInfoPtr vptr;
+
+ if (stuff->screen > screenInfo.numScreens)
+ return BadValue;
+
+ vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr;
+
+ REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.suspendTime = 0;
+ rep.offTime = 0;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.suspendTime, n);
+ swapl(&rep.offTime, n);
+ }
+ WriteToClient(client, SIZEOF(xXF86MiscGetSaverReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+#endif /* _XF86MISC_SAVER_COMPAT_ */
+
+static int
+ProcXF86MiscGetMouseSettings(client)
+ register ClientPtr client;
+{
+ xXF86MiscGetMouseSettingsReply rep;
+ char *devname;
+ pointer mouse;
+ register int n;
+
+ DEBUG_P("XF86MiscGetMouseSettings");
+
+ REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq);
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+
+ if (!MiscExtGetMouseSettings(&mouse, &devname))
+ return BadValue;
+
+ rep.mousetype = MiscExtGetMouseValue(mouse, MISC_MSE_PROTO);
+ rep.baudrate = MiscExtGetMouseValue(mouse, MISC_MSE_BAUDRATE);
+ rep.samplerate = MiscExtGetMouseValue(mouse, MISC_MSE_SAMPLERATE);
+ rep.resolution = MiscExtGetMouseValue(mouse, MISC_MSE_RESOLUTION);
+ rep.buttons = MiscExtGetMouseValue(mouse, MISC_MSE_BUTTONS);
+ rep.emulate3buttons = MiscExtGetMouseValue(mouse, MISC_MSE_EM3BUTTONS);
+ rep.emulate3timeout = MiscExtGetMouseValue(mouse, MISC_MSE_EM3TIMEOUT);
+ rep.chordmiddle = MiscExtGetMouseValue(mouse, MISC_MSE_CHORDMIDDLE);
+ rep.flags = MiscExtGetMouseValue(mouse, MISC_MSE_FLAGS);
+ rep.devnamelen = (devname? strlen(devname): 0);
+ rep.length = (sizeof(xXF86MiscGetMouseSettingsReply) -
+ sizeof(xGenericReply) + ((rep.devnamelen+3) & ~3)) >> 2;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.mousetype, n);
+ swapl(&rep.baudrate, n);
+ swapl(&rep.samplerate, n);
+ swapl(&rep.resolution, n);
+ swapl(&rep.buttons, n);
+ swapl(&rep.emulate3buttons, n);
+ swapl(&rep.emulate3timeout, n);
+ swapl(&rep.chordmiddle, n);
+ swapl(&rep.flags, n);
+ }
+ WriteToClient(client, SIZEOF(xXF86MiscGetMouseSettingsReply), (char *)&rep);
+ MiscExtDestroyStruct(mouse, MISC_POINTER);
+
+ if (rep.devnamelen)
+ WriteToClient(client, rep.devnamelen, devname);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86MiscGetKbdSettings(client)
+ register ClientPtr client;
+{
+ xXF86MiscGetKbdSettingsReply rep;
+ pointer kbd;
+ register int n;
+
+ DEBUG_P("XF86MiscGetKbdSettings");
+
+ REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ if (!MiscExtGetKbdSettings(&kbd))
+ return BadValue;
+
+ rep.kbdtype = MiscExtGetKbdValue(kbd, MISC_KBD_TYPE);
+ rep.rate = MiscExtGetKbdValue(kbd, MISC_KBD_RATE);
+ rep.delay = MiscExtGetKbdValue(kbd, MISC_KBD_DELAY);
+ rep.servnumlock = MiscExtGetKbdValue(kbd, MISC_KBD_SERVNUMLOCK);
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.kbdtype, n);
+ swapl(&rep.rate, n);
+ swapl(&rep.delay, n);
+ }
+ WriteToClient(client, SIZEOF(xXF86MiscGetKbdSettingsReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86MiscSetMouseSettings(client)
+ register ClientPtr client;
+{
+ MiscExtReturn ret;
+ pointer mouse;
+ char *devname = NULL;
+ int major, minor;
+
+ REQUEST(xXF86MiscSetMouseSettingsReq);
+
+ DEBUG_P("XF86MiscSetMouseSettings");
+
+ REQUEST_AT_LEAST_SIZE(xXF86MiscSetMouseSettingsReq);
+
+ ClientVersion(client, &major, &minor);
+
+ if (xf86GetVerbosity() > 1) {
+ ErrorF("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n",
+ stuff->mousetype, stuff->baudrate,
+ stuff->samplerate, stuff->chordmiddle);
+ ErrorF(" em3but: %d em3tim: %d res: %d flags: %d\n",
+ stuff->emulate3buttons, stuff->emulate3timeout,
+ stuff->resolution, stuff->flags);
+ }
+
+
+ if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0)
+ return BadAlloc;
+
+ MiscExtSetMouseValue(mouse, MISC_MSE_PROTO, stuff->mousetype);
+ MiscExtSetMouseValue(mouse, MISC_MSE_BAUDRATE, stuff->baudrate);
+ MiscExtSetMouseValue(mouse, MISC_MSE_SAMPLERATE, stuff->samplerate);
+ MiscExtSetMouseValue(mouse, MISC_MSE_RESOLUTION, stuff->resolution);
+ MiscExtSetMouseValue(mouse, MISC_MSE_BUTTONS, stuff->buttons);
+ MiscExtSetMouseValue(mouse, MISC_MSE_EM3BUTTONS, stuff->emulate3buttons);
+ MiscExtSetMouseValue(mouse, MISC_MSE_EM3TIMEOUT, stuff->emulate3timeout);
+ MiscExtSetMouseValue(mouse, MISC_MSE_CHORDMIDDLE, stuff->chordmiddle);
+ MiscExtSetMouseValue(mouse, MISC_MSE_FLAGS, stuff->flags);
+
+ if ((major > 0 || minor > 5) && stuff->devnamelen) {
+ int size = sizeof(xXF86MiscSetMouseSettingsReq) + stuff->devnamelen;
+ size = (size + 3) >> 2;
+ if (client->req_len < size)
+ return BadLength;
+ if (stuff->devnamelen) {
+ if (!(devname = xalloc(stuff->devnamelen)))
+ return BadAlloc;
+ strncpy(devname,(char*)(&stuff[1]),stuff->devnamelen);
+ if (xf86GetVerbosity() > 1)
+ ErrorF("SetMouseSettings - device: %s\n",devname);
+ MiscExtSetMouseDevice(mouse, devname);
+ }
+ }
+
+ ret = MiscExtApply(mouse, MISC_POINTER);
+
+ if (devname)
+ xfree(devname);
+
+ switch ((ret)) {
+ case MISC_RET_SUCCESS: break;
+ case MISC_RET_BADVAL: return BadValue;
+ case MISC_RET_BADMSEPROTO: return MISCERR(XF86MiscBadMouseProtocol);
+ case MISC_RET_BADBAUDRATE: return MISCERR(XF86MiscBadMouseBaudRate);
+ case MISC_RET_BADFLAGS: return MISCERR(XF86MiscBadMouseFlags);
+ case MISC_RET_BADCOMBO: return MISCERR(XF86MiscBadMouseCombo);
+ case MISC_RET_NOMODULE: return MISCERR(XF86MiscNoModule);
+ default:
+ ErrorF("Unexpected return from MiscExtApply(POINTER) = %d\n", ret);
+ return BadImplementation;
+ }
+
+ if (xf86GetVerbosity() > 1)
+ ErrorF("SetMouseSettings - Succeeded\n");
+ return (client->noClientException);
+}
+
+static int
+ProcXF86MiscSetKbdSettings(client)
+ register ClientPtr client;
+{
+ MiscExtReturn ret;
+ pointer kbd;
+ REQUEST(xXF86MiscSetKbdSettingsReq);
+
+ DEBUG_P("XF86MiscSetKbdSettings");
+
+ REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq);
+
+ if (xf86GetVerbosity() > 1)
+ ErrorF("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n",
+ stuff->kbdtype, stuff->rate,
+ stuff->delay, stuff->servnumlock);
+
+ if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
+ return BadAlloc;
+
+ MiscExtSetKbdValue(kbd, MISC_KBD_TYPE, stuff->kbdtype);
+ MiscExtSetKbdValue(kbd, MISC_KBD_RATE, stuff->rate);
+ MiscExtSetKbdValue(kbd, MISC_KBD_DELAY, stuff->delay);
+ MiscExtSetKbdValue(kbd, MISC_KBD_SERVNUMLOCK, stuff->servnumlock);
+
+ switch ((ret = MiscExtApply(kbd, MISC_KEYBOARD))) {
+ case MISC_RET_SUCCESS: break;
+ case MISC_RET_BADVAL: return BadValue;
+ case MISC_RET_BADKBDTYPE: return MISCERR(XF86MiscBadKbdType);
+ default:
+ ErrorF("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret);
+ return BadImplementation;
+ }
+
+ if (xf86GetVerbosity() > 1)
+ ErrorF("SetKbdSettings - Succeeded\n");
+ return (client->noClientException);
+}
+
+static int
+ProcXF86MiscSetGrabKeysState(client)
+ register ClientPtr client;
+{
+ int n, status;
+ xXF86MiscSetGrabKeysStateReply rep;
+ REQUEST(xXF86MiscSetGrabKeysStateReq);
+
+ DEBUG_P("XF86MiscSetGrabKeysState");
+
+ REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq);
+
+ if ((status = MiscExtSetGrabKeysState(client, stuff->enable)) == 0) {
+ if (xf86GetVerbosity() > 1)
+ ErrorF("SetGrabKeysState - %s\n",
+ stuff->enable ? "enabled" : "disabled");
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.status = status;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swapl(&rep.status, n);
+ }
+ WriteToClient(client, SIZEOF(xXF86MiscSetGrabKeysStateReply), (char *)&rep);
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86MiscSetClientVersion(ClientPtr client)
+{
+ REQUEST(xXF86MiscSetClientVersionReq);
+
+ MiscPrivPtr pPriv;
+
+ DEBUG_P("XF86MiscSetClientVersion");
+
+ REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq);
+
+ if ((pPriv = MPRIV(client)) == NULL) {
+ pPriv = xalloc(sizeof(MiscPrivRec));
+ if (!pPriv)
+ return BadAlloc;
+ MPRIV(client) = pPriv;
+ }
+ ErrorF("SetClientVersion: %i %i\n",stuff->major,stuff->minor);
+ pPriv->major = stuff->major;
+ pPriv->minor = stuff->minor;
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86MiscGetFilePaths(client)
+ register ClientPtr client;
+{
+ xXF86MiscGetFilePathsReply rep;
+ const char *configfile;
+ const char *modulepath;
+ const char *logfile;
+ register int n;
+
+ DEBUG_P("XF86MiscGetFilePaths");
+
+ REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq);
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+
+ if (!MiscExtGetFilePaths(&configfile, &modulepath, &logfile))
+ return BadValue;
+
+ rep.configlen = (configfile? strlen(configfile): 0);
+ rep.modulelen = (modulepath? strlen(modulepath): 0);
+ rep.loglen = (logfile? strlen(logfile): 0);
+ rep.length = (SIZEOF(xXF86MiscGetFilePathsReply) - SIZEOF(xGenericReply) +
+ ((rep.configlen + 3) & ~3) +
+ ((rep.modulelen + 3) & ~3) +
+ ((rep.loglen + 3) & ~3) ) >> 2;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ swaps(&rep.configlen, n);
+ swaps(&rep.modulelen, n);
+ swaps(&rep.loglen, n);
+ }
+ WriteToClient(client, SIZEOF(xXF86MiscGetFilePathsReply), (char *)&rep);
+
+ if (rep.configlen)
+ WriteToClient(client, rep.configlen, (char *)configfile);
+ if (rep.modulelen)
+ WriteToClient(client, rep.modulelen, (char *)modulepath);
+ if (rep.loglen)
+ WriteToClient(client, rep.loglen, (char *)logfile);
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86MiscDispatch (client)
+ register ClientPtr client;
+{
+ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_XF86MiscQueryVersion:
+ return ProcXF86MiscQueryVersion(client);
+#ifdef _XF86MISC_SAVER_COMPAT_
+ case X_XF86MiscGetSaver:
+ return ProcXF86MiscGetSaver(client);
+ case X_XF86MiscSetSaver:
+ return ProcXF86MiscSetSaver(client);
+#endif
+ case X_XF86MiscGetMouseSettings:
+ return ProcXF86MiscGetMouseSettings(client);
+ case X_XF86MiscGetKbdSettings:
+ return ProcXF86MiscGetKbdSettings(client);
+ case X_XF86MiscSetClientVersion:
+ return ProcXF86MiscSetClientVersion(client);
+ case X_XF86MiscGetFilePaths:
+ return ProcXF86MiscGetFilePaths(client);
+ default:
+ if (!xf86GetModInDevEnabled())
+ return miscErrorBase + XF86MiscModInDevDisabled;
+ if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) {
+ switch (stuff->data) {
+ case X_XF86MiscSetMouseSettings:
+ return ProcXF86MiscSetMouseSettings(client);
+ case X_XF86MiscSetKbdSettings:
+ return ProcXF86MiscSetKbdSettings(client);
+ case X_XF86MiscSetGrabKeysState:
+ return ProcXF86MiscSetGrabKeysState(client);
+ default:
+ return BadRequest;
+ }
+ } else
+ return miscErrorBase + XF86MiscModInDevClientNotLocal;
+ }
+}
+
+static int
+SProcXF86MiscQueryVersion(client)
+ register ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscQueryVersionReq);
+ swaps(&stuff->length, n);
+ return ProcXF86MiscQueryVersion(client);
+}
+
+#ifdef _XF86MISC_SAVER_COMPAT_
+static int
+SProcXF86MiscGetSaver(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscGetSaverReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq);
+ swaps(&stuff->screen, n);
+ return ProcXF86MiscGetSaver(client);
+}
+
+static int
+SProcXF86MiscSetSaver(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscSetSaverReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq);
+ swaps(&stuff->screen, n);
+ swapl(&stuff->suspendTime, n);
+ swapl(&stuff->offTime, n);
+ return ProcXF86MiscSetSaver(client);
+}
+#endif /* _XF86MISC_SAVER_COMPAT_ */
+
+static int
+SProcXF86MiscGetMouseSettings(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscGetMouseSettingsReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq);
+ return ProcXF86MiscGetMouseSettings(client);
+}
+
+static int
+SProcXF86MiscGetKbdSettings(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscGetKbdSettingsReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq);
+ return ProcXF86MiscGetKbdSettings(client);
+}
+
+static int
+SProcXF86MiscSetMouseSettings(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscSetMouseSettingsReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscSetMouseSettingsReq);
+ swapl(&stuff->mousetype, n);
+ swapl(&stuff->baudrate, n);
+ swapl(&stuff->samplerate, n);
+ swapl(&stuff->resolution, n);
+ swapl(&stuff->buttons, n);
+ swapl(&stuff->emulate3timeout, n);
+ swapl(&stuff->flags, n);
+ return ProcXF86MiscSetMouseSettings(client);
+}
+
+static int
+SProcXF86MiscSetKbdSettings(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscSetKbdSettingsReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq);
+ swapl(&stuff->kbdtype, n);
+ swapl(&stuff->rate, n);
+ swapl(&stuff->delay, n);
+ return ProcXF86MiscSetKbdSettings(client);
+}
+
+static int
+SProcXF86MiscSetGrabKeysState(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscSetGrabKeysStateReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq);
+ swaps(&stuff->enable, n);
+ return ProcXF86MiscSetGrabKeysState(client);
+}
+
+static int
+SProcXF86MiscSetClientVersion(ClientPtr client)
+{
+ register int n;
+ REQUEST(xXF86MiscSetClientVersionReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq);
+ swaps(&stuff->major, n);
+ swaps(&stuff->minor, n);
+ return ProcXF86MiscSetClientVersion(client);
+}
+
+static int
+SProcXF86MiscGetFilePaths(client)
+ ClientPtr client;
+{
+ register int n;
+ REQUEST(xXF86MiscGetFilePathsReq);
+ swaps(&stuff->length, n);
+ REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq);
+ return ProcXF86MiscGetFilePaths(client);
+}
+
+static int
+SProcXF86MiscDispatch (client)
+ register ClientPtr client;
+{
+ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_XF86MiscQueryVersion:
+ return SProcXF86MiscQueryVersion(client);
+#ifdef _XF86MISC_SAVER_COMPAT_
+ case X_XF86MiscGetSaver:
+ return SProcXF86MiscGetSaver(client);
+ case X_XF86MiscSetSaver:
+ return SProcXF86MiscSetSaver(client);
+#endif
+ case X_XF86MiscGetMouseSettings:
+ return SProcXF86MiscGetMouseSettings(client);
+ case X_XF86MiscGetKbdSettings:
+ return SProcXF86MiscGetKbdSettings(client);
+ case X_XF86MiscSetClientVersion:
+ return SProcXF86MiscSetClientVersion(client);
+ case X_XF86MiscGetFilePaths:
+ return SProcXF86MiscGetFilePaths(client);
+ default:
+ if (!xf86GetModInDevEnabled())
+ return miscErrorBase + XF86MiscModInDevDisabled;
+ if (xf86GetModInDevAllowNonLocal() || LocalClient (client)) {
+ switch (stuff->data) {
+ case X_XF86MiscSetMouseSettings:
+ return SProcXF86MiscSetMouseSettings(client);
+ case X_XF86MiscSetKbdSettings:
+ return SProcXF86MiscSetKbdSettings(client);
+ case X_XF86MiscSetGrabKeysState:
+ return SProcXF86MiscSetGrabKeysState(client);
+ default:
+ return BadRequest;
+ }
+ } else
+ return miscErrorBase + XF86MiscModInDevClientNotLocal;
+ }
+}
+
diff --git a/hw/xfree86/dixmods/extmod/xf86miscproc.h b/hw/xfree86/dixmods/extmod/xf86miscproc.h
new file mode 100644
index 000000000..63db938d1
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/xf86miscproc.h
@@ -0,0 +1,64 @@
+/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.5 2002/11/20 04:04:58 dawes Exp $ */
+
+/* Prototypes for Pointer/Keyboard functions that the DDX must provide */
+
+#ifndef _XF86MISCPROC_H_
+#define _XF86MISCPROC_H_
+
+typedef enum {
+ MISC_MSE_PROTO,
+ MISC_MSE_BAUDRATE,
+ MISC_MSE_SAMPLERATE,
+ MISC_MSE_RESOLUTION,
+ MISC_MSE_BUTTONS,
+ MISC_MSE_EM3BUTTONS,
+ MISC_MSE_EM3TIMEOUT,
+ MISC_MSE_CHORDMIDDLE,
+ MISC_MSE_FLAGS
+} MiscExtMseValType;
+
+typedef enum {
+ MISC_KBD_TYPE,
+ MISC_KBD_RATE,
+ MISC_KBD_DELAY,
+ MISC_KBD_SERVNUMLOCK
+} MiscExtKbdValType;
+
+typedef enum {
+ MISC_RET_SUCCESS,
+ MISC_RET_BADVAL,
+ MISC_RET_BADMSEPROTO,
+ MISC_RET_BADBAUDRATE,
+ MISC_RET_BADFLAGS,
+ MISC_RET_BADCOMBO,
+ MISC_RET_BADKBDTYPE,
+ MISC_RET_NOMODULE
+} MiscExtReturn;
+
+typedef enum {
+ MISC_POINTER,
+ MISC_KEYBOARD
+} MiscExtStructType;
+
+#define MISC_MSEFLAG_CLEARDTR 1
+#define MISC_MSEFLAG_CLEARRTS 2
+#define MISC_MSEFLAG_REOPEN 128
+
+void XFree86MiscExtensionInit(void);
+
+Bool MiscExtGetMouseSettings(pointer *mouse, char **devname);
+int MiscExtGetMouseValue(pointer mouse, MiscExtMseValType valtype);
+Bool MiscExtSetMouseValue(pointer mouse, MiscExtMseValType valtype, int value);
+Bool MiscExtGetKbdSettings(pointer *kbd);
+int MiscExtGetKbdValue(pointer kbd, MiscExtKbdValType valtype);
+Bool MiscExtSetKbdValue(pointer kbd, MiscExtKbdValType valtype, int value);
+int MiscExtSetGrabKeysState(ClientPtr client, int enable);
+pointer MiscExtCreateStruct(MiscExtStructType mse_or_kbd);
+void MiscExtDestroyStruct(pointer structure, MiscExtStructType mse_or_kbd);
+MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd);
+Bool MiscExtSetMouseDevice(pointer mouse, char* device);
+Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath,
+ const char **logfile);
+
+#endif
+
diff --git a/hw/xfree86/dixmods/extmod/xvmod.c b/hw/xfree86/dixmods/extmod/xvmod.c
new file mode 100644
index 000000000..4a9c461f6
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/xvmod.c
@@ -0,0 +1,20 @@
+/* $XFree86: xc/programs/Xserver/Xext/xvmod.c,v 1.2 2001/03/05 04:51:55 mvojkovi Exp $ */
+
+#include "X.h"
+#include "misc.h"
+#include "scrnintstr.h"
+#include "gc.h"
+#include "Xv.h"
+#include "Xvproto.h"
+#include "xvdix.h"
+#include "xvmodproc.h"
+
+void
+XvRegister()
+{
+ XvScreenInitProc = XvScreenInit;
+ XvGetScreenIndexProc = XvGetScreenIndex;
+ XvGetRTPortProc = XvGetRTPort;
+ XvMCScreenInitProc = XvMCScreenInit;
+}
+
diff --git a/hw/xfree86/dixmods/extmod/xvmodproc.h b/hw/xfree86/dixmods/extmod/xvmodproc.h
new file mode 100644
index 000000000..2dcbd472a
--- /dev/null
+++ b/hw/xfree86/dixmods/extmod/xvmodproc.h
@@ -0,0 +1,10 @@
+/* $XFree86: xc/programs/Xserver/Xext/xvmodproc.h,v 1.3 2001/04/08 16:33:22 dawes Exp $ */
+
+#include "xvmcext.h"
+
+extern int (*XvGetScreenIndexProc)(void);
+extern unsigned long (*XvGetRTPortProc)(void);
+extern int (*XvScreenInitProc)(ScreenPtr);
+extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr);
+
+extern void XvRegister(void);
diff --git a/hw/xfree86/dixmods/fbmodule.c b/hw/xfree86/dixmods/fbmodule.c
new file mode 100644
index 000000000..2b9c50408
--- /dev/null
+++ b/hw/xfree86/dixmods/fbmodule.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+/* $XFree86: xc/programs/Xserver/fb/fbmodule.c,v 1.3 2000/02/14 19:20:29 dawes Exp $ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+#include "fb.h"
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "fb",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData fbModuleData = { &VersRec, NULL, NULL };
+
+#endif
diff --git a/hw/xfree86/dixmods/ftmodule.c b/hw/xfree86/dixmods/ftmodule.c
new file mode 100644
index 000000000..e44c94984
--- /dev/null
+++ b/hw/xfree86/dixmods/ftmodule.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 1998-2002 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+/* $XFree86: xc/lib/font/FreeType/module/ftmodule.c,v 1.14 2003/02/13 03:01:45 dawes Exp $ */
+
+#include "misc.h"
+
+#include "fontmod.h"
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(freetypeSetup);
+
+ /*
+ * This is the module data function that is accessed when loading
+ * libfreetype as a module.
+ */
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "freetype",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 2, 0, 2,
+ ABI_CLASS_FONT, /* Font module */
+ ABI_FONT_VERSION,
+ MOD_CLASS_FONT,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData freetypeModuleData = { &VersRec, freetypeSetup, NULL };
+
+extern void FreeTypeRegisterFontFileFunctions(void);
+
+FontModule freetypeModule = {
+ FreeTypeRegisterFontFileFunctions,
+ "FreeType",
+ NULL
+};
+
+static pointer
+freetypeSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ freetypeModule.module = module;
+ LoadFont(&freetypeModule);
+
+ /* Need a non-NULL return */
+ return (pointer)1;
+}
diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c
new file mode 100644
index 000000000..513bb7647
--- /dev/null
+++ b/hw/xfree86/dixmods/glxmodule.c
@@ -0,0 +1,1253 @@
+
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, 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 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.
+
+**************************************************************************/
+/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.11 2001/06/15 21:22:38 dawes Exp $ */
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ *
+ */
+
+#include "xf86Module.h"
+#include "colormap.h"
+#include "micmap.h"
+
+static MODULESETUPPROTO(glxSetup);
+
+extern void GlxExtensionInit(INITARGS);
+extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
+extern void InitGlxWrapInitVisuals(void (*f)(miInitVisualsProcPtr *));
+
+static const char *initdeps[] = { "DOUBLE-BUFFER", NULL };
+
+ExtensionModule GLXExt =
+{
+ GlxExtensionInit,
+ "GLX",
+ NULL,
+ NULL,
+ initdeps
+};
+
+static const char *glcoreSymbols[] = {
+ "__glCallLists_size",
+ "__glColorTableParameterfv_size",
+ "__glColorTableParameteriv_size",
+ "__glConvolutionParameterfv_size",
+ "__glConvolutionParameteriv_size",
+ "__glDDXExtensionInfo",
+ "__glDDXScreenInfo",
+ "__glEvalComputeK",
+ "__glFloorLog2",
+ "__glFogfv_size",
+ "__glFogiv_size",
+ "__glGetBooleanv_size",
+ "__glGetColorTableParameterfv_size",
+ "__glGetColorTableParameteriv_size",
+ "__glGetConvolutionParameterfv_size",
+ "__glGetConvolutionParameteriv_size",
+ "__glGetDoublev_size",
+ "__glGetFloatv_size",
+ "__glGetHistogramParameterfv_size",
+ "__glGetHistogramParameteriv_size",
+ "__glGetIntegerv_size",
+ "__glGetLightfv_size",
+ "__glGetLightiv_size",
+ "__glGetMapdv_size",
+ "__glGetMapfv_size",
+ "__glGetMapiv_size",
+ "__glGetMaterialfv_size",
+ "__glGetMaterialiv_size",
+ "__glGetMinmaxParameterfv_size",
+ "__glGetMinmaxParameteriv_size",
+ "__glGetPixelMapfv_size",
+ "__glGetPixelMapuiv_size",
+ "__glGetPixelMapusv_size",
+ "__glGetTexEnvfv_size",
+ "__glGetTexEnviv_size",
+ "__glGetTexGendv_size",
+ "__glGetTexGenfv_size",
+ "__glGetTexGeniv_size",
+ "__glGetTexImage_size",
+ "__glGetTexLevelParameterfv_size",
+ "__glGetTexLevelParameteriv_size",
+ "__glGetTexParameterfv_size",
+ "__glGetTexParameteriv_size",
+ "__glLightModelfv_size",
+ "__glLightModeliv_size",
+ "__glLightfv_size",
+ "__glLightiv_size",
+ "__glMaterialfv_size",
+ "__glMaterialiv_size",
+ "__glReadPixels_size",
+ "__glTexEnvfv_size",
+ "__glTexEnviv_size",
+ "__glTexGendv_size",
+ "__glTexGenfv_size",
+ "__glTexGeniv_size",
+ "__glTexParameterfv_size",
+ "__glTexParameteriv_size",
+ "__glXActiveScreens",
+ "__glXAssociateContext",
+ "__glXBadContext",
+ "__glXBadContextState",
+ "__glXBadContextTag",
+ "__glXBadCurrentWindow",
+ "__glXBadDrawable",
+ "__glXBadLargeRequest",
+ "__glXBadPixmap",
+ "__glXBadRenderRequest",
+ "__glXBitmapReqSize",
+ "__glXCacheDrawableSize",
+ "__glXCallListsReqSize",
+ "__glXClearErrorOccured",
+ "__glXClientInfo",
+ "__glXClientRes",
+ "__glXClients",
+ "__glXColorSubTableReqSize",
+ "__glXColorTableParameterfvReqSize",
+ "__glXColorTableParameterivReqSize",
+ "__glXColorTableReqSize",
+ "__glXContextRes",
+ "__glXConvolutionFilter1DReqSize",
+ "__glXConvolutionFilter2DReqSize",
+ "__glXConvolutionParameterfvReqSize",
+ "__glXConvolutionParameterivReqSize",
+ "__glXCopyContext",
+ "__glXCoreType",
+ "__glXCreateContext",
+ "__glXCreateGLXPixmap",
+ "__glXDeassociateContext",
+ "__glXDestroyContext",
+ "__glXDestroyGLXPixmap",
+ "__glXDispSwap_Accum",
+ "__glXDispSwap_ActiveTextureARB",
+ "__glXDispSwap_AlphaFunc",
+ "__glXDispSwap_AreTexturesResident",
+ "__glXDispSwap_AreTexturesResidentEXT",
+ "__glXDispSwap_Begin",
+ "__glXDispSwap_BindTexture",
+ "__glXDispSwap_Bitmap",
+ "__glXDispSwap_BlendColor",
+ "__glXDispSwap_BlendEquation",
+ "__glXDispSwap_BlendFunc",
+ "__glXDispSwap_CallList",
+ "__glXDispSwap_CallLists",
+ "__glXDispSwap_Clear",
+ "__glXDispSwap_ClearAccum",
+ "__glXDispSwap_ClearColor",
+ "__glXDispSwap_ClearDepth",
+ "__glXDispSwap_ClearIndex",
+ "__glXDispSwap_ClearStencil",
+ "__glXDispSwap_ClipPlane",
+ "__glXDispSwap_Color3bv",
+ "__glXDispSwap_Color3dv",
+ "__glXDispSwap_Color3fv",
+ "__glXDispSwap_Color3iv",
+ "__glXDispSwap_Color3sv",
+ "__glXDispSwap_Color3ubv",
+ "__glXDispSwap_Color3uiv",
+ "__glXDispSwap_Color3usv",
+ "__glXDispSwap_Color4bv",
+ "__glXDispSwap_Color4dv",
+ "__glXDispSwap_Color4fv",
+ "__glXDispSwap_Color4iv",
+ "__glXDispSwap_Color4sv",
+ "__glXDispSwap_Color4ubv",
+ "__glXDispSwap_Color4uiv",
+ "__glXDispSwap_Color4usv",
+ "__glXDispSwap_ColorMask",
+ "__glXDispSwap_ColorMaterial",
+ "__glXDispSwap_ColorSubTable",
+ "__glXDispSwap_ColorTable",
+ "__glXDispSwap_ColorTableParameterfv",
+ "__glXDispSwap_ColorTableParameteriv",
+ "__glXDispSwap_ConvolutionFilter1D",
+ "__glXDispSwap_ConvolutionFilter2D",
+ "__glXDispSwap_ConvolutionParameterf",
+ "__glXDispSwap_ConvolutionParameterfv",
+ "__glXDispSwap_ConvolutionParameteri",
+ "__glXDispSwap_ConvolutionParameteriv",
+ "__glXDispSwap_CopyColorSubTable",
+ "__glXDispSwap_CopyColorTable",
+ "__glXDispSwap_CopyConvolutionFilter1D",
+ "__glXDispSwap_CopyConvolutionFilter2D",
+ "__glXDispSwap_CopyPixels",
+ "__glXDispSwap_CopyTexImage1D",
+ "__glXDispSwap_CopyTexImage2D",
+ "__glXDispSwap_CopyTexSubImage1D",
+ "__glXDispSwap_CopyTexSubImage2D",
+ "__glXDispSwap_CopyTexSubImage3D",
+ "__glXDispSwap_CullFace",
+ "__glXDispSwap_DeleteLists",
+ "__glXDispSwap_DeleteTextures",
+ "__glXDispSwap_DeleteTexturesEXT",
+ "__glXDispSwap_DepthFunc",
+ "__glXDispSwap_DepthMask",
+ "__glXDispSwap_DepthRange",
+ "__glXDispSwap_Disable",
+ "__glXDispSwap_DrawArrays",
+ "__glXDispSwap_DrawArraysEXT",
+ "__glXDispSwap_DrawBuffer",
+ "__glXDispSwap_DrawPixels",
+ "__glXDispSwap_EdgeFlagv",
+ "__glXDispSwap_Enable",
+ "__glXDispSwap_End",
+ "__glXDispSwap_EndList",
+ "__glXDispSwap_EvalCoord1dv",
+ "__glXDispSwap_EvalCoord1fv",
+ "__glXDispSwap_EvalCoord2dv",
+ "__glXDispSwap_EvalCoord2fv",
+ "__glXDispSwap_EvalMesh1",
+ "__glXDispSwap_EvalMesh2",
+ "__glXDispSwap_EvalPoint1",
+ "__glXDispSwap_EvalPoint2",
+ "__glXDispSwap_FeedbackBuffer",
+ "__glXDispSwap_Finish",
+ "__glXDispSwap_Flush",
+ "__glXDispSwap_Fogf",
+ "__glXDispSwap_Fogfv",
+ "__glXDispSwap_Fogi",
+ "__glXDispSwap_Fogiv",
+ "__glXDispSwap_FrontFace",
+ "__glXDispSwap_Frustum",
+ "__glXDispSwap_GenLists",
+ "__glXDispSwap_GenTextures",
+ "__glXDispSwap_GenTexturesEXT",
+ "__glXDispSwap_GetBooleanv",
+ "__glXDispSwap_GetClipPlane",
+ "__glXDispSwap_GetColorTable",
+ "__glXDispSwap_GetColorTableParameterfv",
+ "__glXDispSwap_GetColorTableParameteriv",
+ "__glXDispSwap_GetConvolutionFilter",
+ "__glXDispSwap_GetConvolutionParameterfv",
+ "__glXDispSwap_GetConvolutionParameteriv",
+ "__glXDispSwap_GetDoublev",
+ "__glXDispSwap_GetError",
+ "__glXDispSwap_GetFloatv",
+ "__glXDispSwap_GetHistogram",
+ "__glXDispSwap_GetHistogramParameterfv",
+ "__glXDispSwap_GetHistogramParameteriv",
+ "__glXDispSwap_GetIntegerv",
+ "__glXDispSwap_GetLightfv",
+ "__glXDispSwap_GetLightiv",
+ "__glXDispSwap_GetMapdv",
+ "__glXDispSwap_GetMapfv",
+ "__glXDispSwap_GetMapiv",
+ "__glXDispSwap_GetMaterialfv",
+ "__glXDispSwap_GetMaterialiv",
+ "__glXDispSwap_GetMinmax",
+ "__glXDispSwap_GetMinmaxParameterfv",
+ "__glXDispSwap_GetMinmaxParameteriv",
+ "__glXDispSwap_GetPixelMapfv",
+ "__glXDispSwap_GetPixelMapuiv",
+ "__glXDispSwap_GetPixelMapusv",
+ "__glXDispSwap_GetPolygonStipple",
+ "__glXDispSwap_GetSeparableFilter",
+ "__glXDispSwap_GetString",
+ "__glXDispSwap_GetTexEnvfv",
+ "__glXDispSwap_GetTexEnviv",
+ "__glXDispSwap_GetTexGendv",
+ "__glXDispSwap_GetTexGenfv",
+ "__glXDispSwap_GetTexGeniv",
+ "__glXDispSwap_GetTexImage",
+ "__glXDispSwap_GetTexLevelParameterfv",
+ "__glXDispSwap_GetTexLevelParameteriv",
+ "__glXDispSwap_GetTexParameterfv",
+ "__glXDispSwap_GetTexParameteriv",
+ "__glXDispSwap_Hint",
+ "__glXDispSwap_Histogram",
+ "__glXDispSwap_IndexMask",
+ "__glXDispSwap_Indexdv",
+ "__glXDispSwap_Indexfv",
+ "__glXDispSwap_Indexiv",
+ "__glXDispSwap_Indexsv",
+ "__glXDispSwap_Indexubv",
+ "__glXDispSwap_InitNames",
+ "__glXDispSwap_IsEnabled",
+ "__glXDispSwap_IsList",
+ "__glXDispSwap_IsTexture",
+ "__glXDispSwap_IsTextureEXT",
+ "__glXDispSwap_LightModelf",
+ "__glXDispSwap_LightModelfv",
+ "__glXDispSwap_LightModeli",
+ "__glXDispSwap_LightModeliv",
+ "__glXDispSwap_Lightf",
+ "__glXDispSwap_Lightfv",
+ "__glXDispSwap_Lighti",
+ "__glXDispSwap_Lightiv",
+ "__glXDispSwap_LineStipple",
+ "__glXDispSwap_LineWidth",
+ "__glXDispSwap_ListBase",
+ "__glXDispSwap_LoadIdentity",
+ "__glXDispSwap_LoadMatrixd",
+ "__glXDispSwap_LoadMatrixf",
+ "__glXDispSwap_LoadName",
+ "__glXDispSwap_LogicOp",
+ "__glXDispSwap_Map1d",
+ "__glXDispSwap_Map1f",
+ "__glXDispSwap_Map2d",
+ "__glXDispSwap_Map2f",
+ "__glXDispSwap_MapGrid1d",
+ "__glXDispSwap_MapGrid1f",
+ "__glXDispSwap_MapGrid2d",
+ "__glXDispSwap_MapGrid2f",
+ "__glXDispSwap_Materialf",
+ "__glXDispSwap_Materialfv",
+ "__glXDispSwap_Materiali",
+ "__glXDispSwap_Materialiv",
+ "__glXDispSwap_MatrixMode",
+ "__glXDispSwap_Minmax",
+ "__glXDispSwap_MultMatrixd",
+ "__glXDispSwap_MultMatrixf",
+ "__glXDispSwap_MultiTexCoord1dvARB",
+ "__glXDispSwap_MultiTexCoord1fvARB",
+ "__glXDispSwap_MultiTexCoord1ivARB",
+ "__glXDispSwap_MultiTexCoord1svARB",
+ "__glXDispSwap_MultiTexCoord2dvARB",
+ "__glXDispSwap_MultiTexCoord2fvARB",
+ "__glXDispSwap_MultiTexCoord2ivARB",
+ "__glXDispSwap_MultiTexCoord2svARB",
+ "__glXDispSwap_MultiTexCoord3dvARB",
+ "__glXDispSwap_MultiTexCoord3fvARB",
+ "__glXDispSwap_MultiTexCoord3ivARB",
+ "__glXDispSwap_MultiTexCoord3svARB",
+ "__glXDispSwap_MultiTexCoord4dvARB",
+ "__glXDispSwap_MultiTexCoord4fvARB",
+ "__glXDispSwap_MultiTexCoord4ivARB",
+ "__glXDispSwap_MultiTexCoord4svARB",
+ "__glXDispSwap_NewList",
+ "__glXDispSwap_Normal3bv",
+ "__glXDispSwap_Normal3dv",
+ "__glXDispSwap_Normal3fv",
+ "__glXDispSwap_Normal3iv",
+ "__glXDispSwap_Normal3sv",
+ "__glXDispSwap_Ortho",
+ "__glXDispSwap_PassThrough",
+ "__glXDispSwap_PixelMapfv",
+ "__glXDispSwap_PixelMapuiv",
+ "__glXDispSwap_PixelMapusv",
+ "__glXDispSwap_PixelStoref",
+ "__glXDispSwap_PixelStorei",
+ "__glXDispSwap_PixelTransferf",
+ "__glXDispSwap_PixelTransferi",
+ "__glXDispSwap_PixelZoom",
+ "__glXDispSwap_PointSize",
+ "__glXDispSwap_PolygonMode",
+ "__glXDispSwap_PolygonOffset",
+ "__glXDispSwap_PolygonStipple",
+ "__glXDispSwap_PopAttrib",
+ "__glXDispSwap_PopMatrix",
+ "__glXDispSwap_PopName",
+ "__glXDispSwap_PrioritizeTextures",
+ "__glXDispSwap_PushAttrib",
+ "__glXDispSwap_PushMatrix",
+ "__glXDispSwap_PushName",
+ "__glXDispSwap_RasterPos2dv",
+ "__glXDispSwap_RasterPos2fv",
+ "__glXDispSwap_RasterPos2iv",
+ "__glXDispSwap_RasterPos2sv",
+ "__glXDispSwap_RasterPos3dv",
+ "__glXDispSwap_RasterPos3fv",
+ "__glXDispSwap_RasterPos3iv",
+ "__glXDispSwap_RasterPos3sv",
+ "__glXDispSwap_RasterPos4dv",
+ "__glXDispSwap_RasterPos4fv",
+ "__glXDispSwap_RasterPos4iv",
+ "__glXDispSwap_RasterPos4sv",
+ "__glXDispSwap_ReadBuffer",
+ "__glXDispSwap_ReadPixels",
+ "__glXDispSwap_Rectdv",
+ "__glXDispSwap_Rectfv",
+ "__glXDispSwap_Rectiv",
+ "__glXDispSwap_Rectsv",
+ "__glXDispSwap_RenderMode",
+ "__glXDispSwap_ResetHistogram",
+ "__glXDispSwap_ResetMinmax",
+ "__glXDispSwap_Rotated",
+ "__glXDispSwap_Rotatef",
+ "__glXDispSwap_Scaled",
+ "__glXDispSwap_Scalef",
+ "__glXDispSwap_Scissor",
+ "__glXDispSwap_SelectBuffer",
+ "__glXDispSwap_SeparableFilter2D",
+ "__glXDispSwap_ShadeModel",
+ "__glXDispSwap_StencilFunc",
+ "__glXDispSwap_StencilMask",
+ "__glXDispSwap_StencilOp",
+ "__glXDispSwap_TexCoord1dv",
+ "__glXDispSwap_TexCoord1fv",
+ "__glXDispSwap_TexCoord1iv",
+ "__glXDispSwap_TexCoord1sv",
+ "__glXDispSwap_TexCoord2dv",
+ "__glXDispSwap_TexCoord2fv",
+ "__glXDispSwap_TexCoord2iv",
+ "__glXDispSwap_TexCoord2sv",
+ "__glXDispSwap_TexCoord3dv",
+ "__glXDispSwap_TexCoord3fv",
+ "__glXDispSwap_TexCoord3iv",
+ "__glXDispSwap_TexCoord3sv",
+ "__glXDispSwap_TexCoord4dv",
+ "__glXDispSwap_TexCoord4fv",
+ "__glXDispSwap_TexCoord4iv",
+ "__glXDispSwap_TexCoord4sv",
+ "__glXDispSwap_TexEnvf",
+ "__glXDispSwap_TexEnvfv",
+ "__glXDispSwap_TexEnvi",
+ "__glXDispSwap_TexEnviv",
+ "__glXDispSwap_TexGend",
+ "__glXDispSwap_TexGendv",
+ "__glXDispSwap_TexGenf",
+ "__glXDispSwap_TexGenfv",
+ "__glXDispSwap_TexGeni",
+ "__glXDispSwap_TexGeniv",
+ "__glXDispSwap_TexImage1D",
+ "__glXDispSwap_TexImage2D",
+ "__glXDispSwap_TexImage3D",
+ "__glXDispSwap_TexParameterf",
+ "__glXDispSwap_TexParameterfv",
+ "__glXDispSwap_TexParameteri",
+ "__glXDispSwap_TexParameteriv",
+ "__glXDispSwap_TexSubImage1D",
+ "__glXDispSwap_TexSubImage2D",
+ "__glXDispSwap_TexSubImage3D",
+ "__glXDispSwap_Translated",
+ "__glXDispSwap_Translatef",
+ "__glXDispSwap_Vertex2dv",
+ "__glXDispSwap_Vertex2fv",
+ "__glXDispSwap_Vertex2iv",
+ "__glXDispSwap_Vertex2sv",
+ "__glXDispSwap_Vertex3dv",
+ "__glXDispSwap_Vertex3fv",
+ "__glXDispSwap_Vertex3iv",
+ "__glXDispSwap_Vertex3sv",
+ "__glXDispSwap_Vertex4dv",
+ "__glXDispSwap_Vertex4fv",
+ "__glXDispSwap_Vertex4iv",
+ "__glXDispSwap_Vertex4sv",
+ "__glXDispSwap_Viewport",
+ "__glXDisp_Accum",
+ "__glXDisp_ActiveTextureARB",
+ "__glXDisp_AlphaFunc",
+ "__glXDisp_AreTexturesResident",
+ "__glXDisp_AreTexturesResidentEXT",
+ "__glXDisp_Begin",
+ "__glXDisp_BindTexture",
+ "__glXDisp_Bitmap",
+ "__glXDisp_BlendColor",
+ "__glXDisp_BlendEquation",
+ "__glXDisp_BlendFunc",
+ "__glXDisp_CallList",
+ "__glXDisp_CallLists",
+ "__glXDisp_Clear",
+ "__glXDisp_ClearAccum",
+ "__glXDisp_ClearColor",
+ "__glXDisp_ClearDepth",
+ "__glXDisp_ClearIndex",
+ "__glXDisp_ClearStencil",
+ "__glXDisp_ClipPlane",
+ "__glXDisp_Color3bv",
+ "__glXDisp_Color3dv",
+ "__glXDisp_Color3fv",
+ "__glXDisp_Color3iv",
+ "__glXDisp_Color3sv",
+ "__glXDisp_Color3ubv",
+ "__glXDisp_Color3uiv",
+ "__glXDisp_Color3usv",
+ "__glXDisp_Color4bv",
+ "__glXDisp_Color4dv",
+ "__glXDisp_Color4fv",
+ "__glXDisp_Color4iv",
+ "__glXDisp_Color4sv",
+ "__glXDisp_Color4ubv",
+ "__glXDisp_Color4uiv",
+ "__glXDisp_Color4usv",
+ "__glXDisp_ColorMask",
+ "__glXDisp_ColorMaterial",
+ "__glXDisp_ColorSubTable",
+ "__glXDisp_ColorTable",
+ "__glXDisp_ColorTableParameterfv",
+ "__glXDisp_ColorTableParameteriv",
+ "__glXDisp_ConvolutionFilter1D",
+ "__glXDisp_ConvolutionFilter2D",
+ "__glXDisp_ConvolutionParameterf",
+ "__glXDisp_ConvolutionParameterfv",
+ "__glXDisp_ConvolutionParameteri",
+ "__glXDisp_ConvolutionParameteriv",
+ "__glXDisp_CopyColorSubTable",
+ "__glXDisp_CopyColorTable",
+ "__glXDisp_CopyConvolutionFilter1D",
+ "__glXDisp_CopyConvolutionFilter2D",
+ "__glXDisp_CopyPixels",
+ "__glXDisp_CopyTexImage1D",
+ "__glXDisp_CopyTexImage2D",
+ "__glXDisp_CopyTexSubImage1D",
+ "__glXDisp_CopyTexSubImage2D",
+ "__glXDisp_CopyTexSubImage3D",
+ "__glXDisp_CullFace",
+ "__glXDisp_DeleteLists",
+ "__glXDisp_DeleteTextures",
+ "__glXDisp_DeleteTexturesEXT",
+ "__glXDisp_DepthFunc",
+ "__glXDisp_DepthMask",
+ "__glXDisp_DepthRange",
+ "__glXDisp_Disable",
+ "__glXDisp_DrawArrays",
+ "__glXDisp_DrawArraysEXT",
+ "__glXDisp_DrawBuffer",
+ "__glXDisp_DrawPixels",
+ "__glXDisp_EdgeFlagv",
+ "__glXDisp_Enable",
+ "__glXDisp_End",
+ "__glXDisp_EndList",
+ "__glXDisp_EvalCoord1dv",
+ "__glXDisp_EvalCoord1fv",
+ "__glXDisp_EvalCoord2dv",
+ "__glXDisp_EvalCoord2fv",
+ "__glXDisp_EvalMesh1",
+ "__glXDisp_EvalMesh2",
+ "__glXDisp_EvalPoint1",
+ "__glXDisp_EvalPoint2",
+ "__glXDisp_FeedbackBuffer",
+ "__glXDisp_Finish",
+ "__glXDisp_Flush",
+ "__glXDisp_Fogf",
+ "__glXDisp_Fogfv",
+ "__glXDisp_Fogi",
+ "__glXDisp_Fogiv",
+ "__glXDisp_FrontFace",
+ "__glXDisp_Frustum",
+ "__glXDisp_GenLists",
+ "__glXDisp_GenTextures",
+ "__glXDisp_GenTexturesEXT",
+ "__glXDisp_GetBooleanv",
+ "__glXDisp_GetClipPlane",
+ "__glXDisp_GetColorTable",
+ "__glXDisp_GetColorTableParameterfv",
+ "__glXDisp_GetColorTableParameteriv",
+ "__glXDisp_GetConvolutionFilter",
+ "__glXDisp_GetConvolutionParameterfv",
+ "__glXDisp_GetConvolutionParameteriv",
+ "__glXDisp_GetDoublev",
+ "__glXDisp_GetError",
+ "__glXDisp_GetFloatv",
+ "__glXDisp_GetHistogram",
+ "__glXDisp_GetHistogramParameterfv",
+ "__glXDisp_GetHistogramParameteriv",
+ "__glXDisp_GetIntegerv",
+ "__glXDisp_GetLightfv",
+ "__glXDisp_GetLightiv",
+ "__glXDisp_GetMapdv",
+ "__glXDisp_GetMapfv",
+ "__glXDisp_GetMapiv",
+ "__glXDisp_GetMaterialfv",
+ "__glXDisp_GetMaterialiv",
+ "__glXDisp_GetMinmax",
+ "__glXDisp_GetMinmaxParameterfv",
+ "__glXDisp_GetMinmaxParameteriv",
+ "__glXDisp_GetPixelMapfv",
+ "__glXDisp_GetPixelMapuiv",
+ "__glXDisp_GetPixelMapusv",
+ "__glXDisp_GetPolygonStipple",
+ "__glXDisp_GetSeparableFilter",
+ "__glXDisp_GetString",
+ "__glXDisp_GetTexEnvfv",
+ "__glXDisp_GetTexEnviv",
+ "__glXDisp_GetTexGendv",
+ "__glXDisp_GetTexGenfv",
+ "__glXDisp_GetTexGeniv",
+ "__glXDisp_GetTexImage",
+ "__glXDisp_GetTexLevelParameterfv",
+ "__glXDisp_GetTexLevelParameteriv",
+ "__glXDisp_GetTexParameterfv",
+ "__glXDisp_GetTexParameteriv",
+ "__glXDisp_Hint",
+ "__glXDisp_Histogram",
+ "__glXDisp_IndexMask",
+ "__glXDisp_Indexdv",
+ "__glXDisp_Indexfv",
+ "__glXDisp_Indexiv",
+ "__glXDisp_Indexsv",
+ "__glXDisp_Indexubv",
+ "__glXDisp_InitNames",
+ "__glXDisp_IsEnabled",
+ "__glXDisp_IsList",
+ "__glXDisp_IsTexture",
+ "__glXDisp_IsTextureEXT",
+ "__glXDisp_LightModelf",
+ "__glXDisp_LightModelfv",
+ "__glXDisp_LightModeli",
+ "__glXDisp_LightModeliv",
+ "__glXDisp_Lightf",
+ "__glXDisp_Lightfv",
+ "__glXDisp_Lighti",
+ "__glXDisp_Lightiv",
+ "__glXDisp_LineStipple",
+ "__glXDisp_LineWidth",
+ "__glXDisp_ListBase",
+ "__glXDisp_LoadIdentity",
+ "__glXDisp_LoadMatrixd",
+ "__glXDisp_LoadMatrixf",
+ "__glXDisp_LoadName",
+ "__glXDisp_LogicOp",
+ "__glXDisp_Map1d",
+ "__glXDisp_Map1f",
+ "__glXDisp_Map2d",
+ "__glXDisp_Map2f",
+ "__glXDisp_MapGrid1d",
+ "__glXDisp_MapGrid1f",
+ "__glXDisp_MapGrid2d",
+ "__glXDisp_MapGrid2f",
+ "__glXDisp_Materialf",
+ "__glXDisp_Materialfv",
+ "__glXDisp_Materiali",
+ "__glXDisp_Materialiv",
+ "__glXDisp_MatrixMode",
+ "__glXDisp_Minmax",
+ "__glXDisp_MultMatrixd",
+ "__glXDisp_MultMatrixf",
+ "__glXDisp_MultiTexCoord1dvARB",
+ "__glXDisp_MultiTexCoord1fvARB",
+ "__glXDisp_MultiTexCoord1ivARB",
+ "__glXDisp_MultiTexCoord1svARB",
+ "__glXDisp_MultiTexCoord2dvARB",
+ "__glXDisp_MultiTexCoord2fvARB",
+ "__glXDisp_MultiTexCoord2ivARB",
+ "__glXDisp_MultiTexCoord2svARB",
+ "__glXDisp_MultiTexCoord3dvARB",
+ "__glXDisp_MultiTexCoord3fvARB",
+ "__glXDisp_MultiTexCoord3ivARB",
+ "__glXDisp_MultiTexCoord3svARB",
+ "__glXDisp_MultiTexCoord4dvARB",
+ "__glXDisp_MultiTexCoord4fvARB",
+ "__glXDisp_MultiTexCoord4ivARB",
+ "__glXDisp_MultiTexCoord4svARB",
+ "__glXDisp_NewList",
+ "__glXDisp_Normal3bv",
+ "__glXDisp_Normal3dv",
+ "__glXDisp_Normal3fv",
+ "__glXDisp_Normal3iv",
+ "__glXDisp_Normal3sv",
+ "__glXDisp_Ortho",
+ "__glXDisp_PassThrough",
+ "__glXDisp_PixelMapfv",
+ "__glXDisp_PixelMapuiv",
+ "__glXDisp_PixelMapusv",
+ "__glXDisp_PixelStoref",
+ "__glXDisp_PixelStorei",
+ "__glXDisp_PixelTransferf",
+ "__glXDisp_PixelTransferi",
+ "__glXDisp_PixelZoom",
+ "__glXDisp_PointSize",
+ "__glXDisp_PolygonMode",
+ "__glXDisp_PolygonOffset",
+ "__glXDisp_PolygonStipple",
+ "__glXDisp_PopAttrib",
+ "__glXDisp_PopMatrix",
+ "__glXDisp_PopName",
+ "__glXDisp_PrioritizeTextures",
+ "__glXDisp_PushAttrib",
+ "__glXDisp_PushMatrix",
+ "__glXDisp_PushName",
+ "__glXDisp_RasterPos2dv",
+ "__glXDisp_RasterPos2fv",
+ "__glXDisp_RasterPos2iv",
+ "__glXDisp_RasterPos2sv",
+ "__glXDisp_RasterPos3dv",
+ "__glXDisp_RasterPos3fv",
+ "__glXDisp_RasterPos3iv",
+ "__glXDisp_RasterPos3sv",
+ "__glXDisp_RasterPos4dv",
+ "__glXDisp_RasterPos4fv",
+ "__glXDisp_RasterPos4iv",
+ "__glXDisp_RasterPos4sv",
+ "__glXDisp_ReadBuffer",
+ "__glXDisp_ReadPixels",
+ "__glXDisp_Rectdv",
+ "__glXDisp_Rectfv",
+ "__glXDisp_Rectiv",
+ "__glXDisp_Rectsv",
+ "__glXDisp_RenderMode",
+ "__glXDisp_ResetHistogram",
+ "__glXDisp_ResetMinmax",
+ "__glXDisp_Rotated",
+ "__glXDisp_Rotatef",
+ "__glXDisp_Scaled",
+ "__glXDisp_Scalef",
+ "__glXDisp_Scissor",
+ "__glXDisp_SelectBuffer",
+ "__glXDisp_SeparableFilter2D",
+ "__glXDisp_ShadeModel",
+ "__glXDisp_StencilFunc",
+ "__glXDisp_StencilMask",
+ "__glXDisp_StencilOp",
+ "__glXDisp_TexCoord1dv",
+ "__glXDisp_TexCoord1fv",
+ "__glXDisp_TexCoord1iv",
+ "__glXDisp_TexCoord1sv",
+ "__glXDisp_TexCoord2dv",
+ "__glXDisp_TexCoord2fv",
+ "__glXDisp_TexCoord2iv",
+ "__glXDisp_TexCoord2sv",
+ "__glXDisp_TexCoord3dv",
+ "__glXDisp_TexCoord3fv",
+ "__glXDisp_TexCoord3iv",
+ "__glXDisp_TexCoord3sv",
+ "__glXDisp_TexCoord4dv",
+ "__glXDisp_TexCoord4fv",
+ "__glXDisp_TexCoord4iv",
+ "__glXDisp_TexCoord4sv",
+ "__glXDisp_TexEnvf",
+ "__glXDisp_TexEnvfv",
+ "__glXDisp_TexEnvi",
+ "__glXDisp_TexEnviv",
+ "__glXDisp_TexGend",
+ "__glXDisp_TexGendv",
+ "__glXDisp_TexGenf",
+ "__glXDisp_TexGenfv",
+ "__glXDisp_TexGeni",
+ "__glXDisp_TexGeniv",
+ "__glXDisp_TexImage1D",
+ "__glXDisp_TexImage2D",
+ "__glXDisp_TexImage3D",
+ "__glXDisp_TexParameterf",
+ "__glXDisp_TexParameterfv",
+ "__glXDisp_TexParameteri",
+ "__glXDisp_TexParameteriv",
+ "__glXDisp_TexSubImage1D",
+ "__glXDisp_TexSubImage2D",
+ "__glXDisp_TexSubImage3D",
+ "__glXDisp_Translated",
+ "__glXDisp_Translatef",
+ "__glXDisp_Vertex2dv",
+ "__glXDisp_Vertex2fv",
+ "__glXDisp_Vertex2iv",
+ "__glXDisp_Vertex2sv",
+ "__glXDisp_Vertex3dv",
+ "__glXDisp_Vertex3fv",
+ "__glXDisp_Vertex3iv",
+ "__glXDisp_Vertex3sv",
+ "__glXDisp_Vertex4dv",
+ "__glXDisp_Vertex4fv",
+ "__glXDisp_Vertex4iv",
+ "__glXDisp_Vertex4sv",
+ "__glXDisp_Viewport",
+ "__glXDrawArraysSize",
+ "__glXDrawPixelsReqSize",
+ "__glXDrawableRes",
+ "__glXErrorOccured",
+ "__glXFBInitDrawable",
+ "__glXFBMemSwapBuffers",
+ "__glXFindDrawablePrivate",
+ "__glXFogfvReqSize",
+ "__glXFogivReqSize",
+ "__glXForceCurrent",
+ "__glXFormatGLModes",
+ "__glXFree",
+ "__glXFreeBuffers",
+ "__glXFreeContext",
+ "__glXGetDrawablePrivate",
+ "__glXGetVisualConfigs",
+ "__glXImageSize",
+ "__glXImpAtoi",
+ "__glXImpCalloc",
+ "__glXImpFatal",
+ "__glXImpFclose",
+ "__glXImpFopen",
+ "__glXImpFprintf",
+ "__glXImpFree",
+ "__glXImpGetDrawablePrivate",
+ "__glXImpGetenv",
+ "__glXImpMalloc",
+ "__glXImpRealloc",
+ "__glXImpSprintf",
+ "__glXImpWarning",
+ "__glXInitFB",
+ "__glXInitMem",
+ "__glXInitPix",
+ "__glXIsDirect",
+ "__glXLastContext",
+ "__glXLightModelfvReqSize",
+ "__glXLightModelivReqSize",
+ "__glXLightfvReqSize",
+ "__glXLightivReqSize",
+ "__glXLookupContextByTag",
+ "__glXMakeCurrent",
+ "__glXMalloc",
+ "__glXMap1dReqSize",
+ "__glXMap1fReqSize",
+ "__glXMap2dReqSize",
+ "__glXMap2fReqSize",
+ "__glXMaterialfvReqSize",
+ "__glXMaterialivReqSize",
+ "__glXNoSuchRenderOpcode",
+ "__glXNoSuchSingleOpcode",
+ "__glXNop",
+ "__glXPixInitDrawable",
+ "__glXPixelMapfvReqSize",
+ "__glXPixelMapuivReqSize",
+ "__glXPixelMapusvReqSize",
+ "__glXPixmapRes",
+ "__glXPrioritizeTexturesReqSize",
+ "__glXQueryContextInfoEXT",
+ "__glXQueryExtensionsString",
+ "__glXQueryServerString",
+ "__glXQueryVersion",
+ "__glXRealloc",
+ "__glXRender",
+ "__glXRenderLarge",
+ "__glXRenderSizeTable",
+ "__glXRenderSizeTable_EXT",
+ "__glXRenderTable",
+ "__glXRenderTable_EXT",
+ "__glXReply",
+ "__glXResetLargeCommandStatus",
+ "__glXResizeBuffers",
+ "__glXResizeDrawableBuffers",
+ "__glXScreenInit",
+ "__glXScreenReset",
+ "__glXSeparableFilter2DReqSize",
+ "__glXSingleTable",
+ "__glXSwapBuffers",
+ "__glXSwapClientInfo",
+ "__glXSwapCopyContext",
+ "__glXSwapCreateContext",
+ "__glXSwapCreateGLXPixmap",
+ "__glXSwapDestroyContext",
+ "__glXSwapDestroyGLXPixmap",
+ "__glXSwapGetVisualConfigs",
+ "__glXSwapIsDirect",
+ "__glXSwapIsDirectReply",
+ "__glXSwapMakeCurrent",
+ "__glXSwapMakeCurrentReply",
+ "__glXSwapQueryContextInfoEXTReply",
+ "__glXSwapQueryExtensionsString",
+ "__glXSwapQueryServerString",
+ "__glXSwapQueryVersion",
+ "__glXSwapQueryVersionReply",
+ "__glXSwapRender",
+ "__glXSwapRenderLarge",
+ "__glXSwapRenderTable",
+ "__glXSwapRenderTable_EXT",
+ "__glXSwapSingleTable",
+ "__glXSwapSwapBuffers",
+ "__glXSwapUseXFont",
+ "__glXSwapVendorPrivTable_EXT",
+ "__glXSwapVendorPrivate",
+ "__glXSwapVendorPrivateWithReply",
+ "__glXSwapWaitGL",
+ "__glXSwapWaitX",
+ "__glXTexEnvfvReqSize",
+ "__glXTexEnvivReqSize",
+ "__glXTexGendvReqSize",
+ "__glXTexGenfvReqSize",
+ "__glXTexGenivReqSize",
+ "__glXTexImage1DReqSize",
+ "__glXTexImage2DReqSize",
+ "__glXTexImage3DReqSize",
+ "__glXTexParameterfvReqSize",
+ "__glXTexParameterivReqSize",
+ "__glXTexSubImage1DReqSize",
+ "__glXTexSubImage2DReqSize",
+ "__glXTexSubImage3DReqSize",
+ "__glXTypeSize",
+ "__glXUnrefDrawablePrivate",
+ "__glXUnsupportedPrivateRequest",
+ "__glXUseXFont",
+ "__glXVendorPrivTable_EXT",
+ "__glXVendorPrivate",
+ "__glXVendorPrivateWithReply",
+ "__glXWaitGL",
+ "__glXWaitX",
+ "__glXcombine_strings",
+ "glAccum",
+ "glActiveTextureARB",
+ "glAlphaFunc",
+ "glAreTexturesResident",
+ "glAreTexturesResidentEXT",
+ "glBegin",
+ "glBindTexture",
+ "glBitmap",
+ "glBlendColor",
+ "glBlendEquation",
+ "glBlendFunc",
+ "glCallList",
+ "glCallLists",
+ "glClear",
+ "glClearAccum",
+ "glClearColor",
+ "glClearDepth",
+ "glClearIndex",
+ "glClearStencil",
+ "glClipPlane",
+ "glColor3bv",
+ "glColor3dv",
+ "glColor3fv",
+ "glColor3iv",
+ "glColor3sv",
+ "glColor3ubv",
+ "glColor3uiv",
+ "glColor3usv",
+ "glColor4bv",
+ "glColor4dv",
+ "glColor4fv",
+ "glColor4iv",
+ "glColor4sv",
+ "glColor4ubv",
+ "glColor4uiv",
+ "glColor4usv",
+ "glColorMask",
+ "glColorMaterial",
+ "glColorPointer",
+ "glColorSubTable",
+ "glColorTable",
+ "glColorTableParameterfv",
+ "glColorTableParameteriv",
+ "glConvolutionFilter1D",
+ "glConvolutionFilter2D",
+ "glConvolutionParameterf",
+ "glConvolutionParameterfv",
+ "glConvolutionParameteri",
+ "glConvolutionParameteriv",
+ "glCopyColorSubTable",
+ "glCopyColorTable",
+ "glCopyConvolutionFilter1D",
+ "glCopyConvolutionFilter2D",
+ "glCopyPixels",
+ "glCopyTexImage1D",
+ "glCopyTexImage2D",
+ "glCopyTexSubImage1D",
+ "glCopyTexSubImage2D",
+ "glCopyTexSubImage3D",
+ "glCullFace",
+ "glDeleteLists",
+ "glDeleteTextures",
+ "glDeleteTexturesEXT",
+ "glDepthFunc",
+ "glDepthMask",
+ "glDepthRange",
+ "glDisable",
+ "glDisableClientState",
+ "glDrawArrays",
+ "glDrawBuffer",
+ "glDrawPixels",
+ "glEdgeFlagPointer",
+ "glEdgeFlagv",
+ "glEnable",
+ "glEnableClientState",
+ "glEnd",
+ "glEndList",
+ "glEvalCoord1dv",
+ "glEvalCoord1fv",
+ "glEvalCoord2dv",
+ "glEvalCoord2fv",
+ "glEvalMesh1",
+ "glEvalMesh2",
+ "glEvalPoint1",
+ "glEvalPoint2",
+ "glFeedbackBuffer",
+ "glFinish",
+ "glFlush",
+ "glFogf",
+ "glFogfv",
+ "glFogi",
+ "glFogiv",
+ "glFrontFace",
+ "glFrustum",
+ "glGenLists",
+ "glGenTextures",
+ "glGenTexturesEXT",
+ "glGetBooleanv",
+ "glGetClipPlane",
+ "glGetColorTable",
+ "glGetColorTableParameterfv",
+ "glGetColorTableParameteriv",
+ "glGetConvolutionFilter",
+ "glGetConvolutionParameterfv",
+ "glGetConvolutionParameteriv",
+ "glGetDoublev",
+ "glGetError",
+ "glGetFloatv",
+ "glGetHistogram",
+ "glGetHistogramParameterfv",
+ "glGetHistogramParameteriv",
+ "glGetIntegerv",
+ "glGetLightfv",
+ "glGetLightiv",
+ "glGetMapdv",
+ "glGetMapfv",
+ "glGetMapiv",
+ "glGetMaterialfv",
+ "glGetMaterialiv",
+ "glGetMinmax",
+ "glGetMinmaxParameterfv",
+ "glGetMinmaxParameteriv",
+ "glGetPixelMapfv",
+ "glGetPixelMapuiv",
+ "glGetPixelMapusv",
+ "glGetPolygonStipple",
+ "glGetSeparableFilter",
+ "glGetString",
+ "glGetTexEnvfv",
+ "glGetTexEnviv",
+ "glGetTexGendv",
+ "glGetTexGenfv",
+ "glGetTexGeniv",
+ "glGetTexImage",
+ "glGetTexLevelParameterfv",
+ "glGetTexLevelParameteriv",
+ "glGetTexParameterfv",
+ "glGetTexParameteriv",
+ "glHint",
+ "glHistogram",
+ "glIndexMask",
+ "glIndexPointer",
+ "glIndexdv",
+ "glIndexfv",
+ "glIndexiv",
+ "glIndexsv",
+ "glIndexubv",
+ "glInitNames",
+ "glIsEnabled",
+ "glIsList",
+ "glIsTexture",
+ "glIsTextureEXT",
+ "glLightModelf",
+ "glLightModelfv",
+ "glLightModeli",
+ "glLightModeliv",
+ "glLightf",
+ "glLightfv",
+ "glLighti",
+ "glLightiv",
+ "glLineStipple",
+ "glLineWidth",
+ "glListBase",
+ "glLoadIdentity",
+ "glLoadMatrixd",
+ "glLoadMatrixf",
+ "glLoadName",
+ "glLogicOp",
+ "glMap1d",
+ "glMap1f",
+ "glMap2d",
+ "glMap2f",
+ "glMapGrid1d",
+ "glMapGrid1f",
+ "glMapGrid2d",
+ "glMapGrid2f",
+ "glMaterialf",
+ "glMaterialfv",
+ "glMateriali",
+ "glMaterialiv",
+ "glMatrixMode",
+ "glMinmax",
+ "glMultMatrixd",
+ "glMultMatrixf",
+ "glMultiTexCoord1dvARB",
+ "glMultiTexCoord1fvARB",
+ "glMultiTexCoord1ivARB",
+ "glMultiTexCoord1svARB",
+ "glMultiTexCoord2dvARB",
+ "glMultiTexCoord2fvARB",
+ "glMultiTexCoord2ivARB",
+ "glMultiTexCoord2svARB",
+ "glMultiTexCoord3dvARB",
+ "glMultiTexCoord3fvARB",
+ "glMultiTexCoord3ivARB",
+ "glMultiTexCoord3svARB",
+ "glMultiTexCoord4dvARB",
+ "glMultiTexCoord4fvARB",
+ "glMultiTexCoord4ivARB",
+ "glMultiTexCoord4svARB",
+ "glNewList",
+ "glNormal3bv",
+ "glNormal3dv",
+ "glNormal3fv",
+ "glNormal3iv",
+ "glNormal3sv",
+ "glNormalPointer",
+ "glOrtho",
+ "glPassThrough",
+ "glPixelMapfv",
+ "glPixelMapuiv",
+ "glPixelMapusv",
+ "glPixelStoref",
+ "glPixelStorei",
+ "glPixelTransferf",
+ "glPixelTransferi",
+ "glPixelZoom",
+ "glPointSize",
+ "glPolygonMode",
+ "glPolygonOffset",
+ "glPolygonStipple",
+ "glPopAttrib",
+ "glPopMatrix",
+ "glPopName",
+ "glPrioritizeTextures",
+ "glPushAttrib",
+ "glPushMatrix",
+ "glPushName",
+ "glRasterPos2dv",
+ "glRasterPos2fv",
+ "glRasterPos2iv",
+ "glRasterPos2sv",
+ "glRasterPos3dv",
+ "glRasterPos3fv",
+ "glRasterPos3iv",
+ "glRasterPos3sv",
+ "glRasterPos4dv",
+ "glRasterPos4fv",
+ "glRasterPos4iv",
+ "glRasterPos4sv",
+ "glReadBuffer",
+ "glReadPixels",
+ "glRectdv",
+ "glRectfv",
+ "glRectiv",
+ "glRectsv",
+ "glRenderMode",
+ "glResetHistogram",
+ "glResetMinmax",
+ "glRotated",
+ "glRotatef",
+ "glScaled",
+ "glScalef",
+ "glScissor",
+ "glSelectBuffer",
+ "glSeparableFilter2D",
+ "glShadeModel",
+ "glStencilFunc",
+ "glStencilMask",
+ "glStencilOp",
+ "glTexCoord1dv",
+ "glTexCoord1fv",
+ "glTexCoord1iv",
+ "glTexCoord1sv",
+ "glTexCoord2dv",
+ "glTexCoord2fv",
+ "glTexCoord2iv",
+ "glTexCoord2sv",
+ "glTexCoord3dv",
+ "glTexCoord3fv",
+ "glTexCoord3iv",
+ "glTexCoord3sv",
+ "glTexCoord4dv",
+ "glTexCoord4fv",
+ "glTexCoord4iv",
+ "glTexCoord4sv",
+ "glTexCoordPointer",
+ "glTexEnvf",
+ "glTexEnvfv",
+ "glTexEnvi",
+ "glTexEnviv",
+ "glTexGend",
+ "glTexGendv",
+ "glTexGenf",
+ "glTexGenfv",
+ "glTexGeni",
+ "glTexGeniv",
+ "glTexImage1D",
+ "glTexImage2D",
+ "glTexImage3D",
+ "glTexParameterf",
+ "glTexParameterfv",
+ "glTexParameteri",
+ "glTexParameteriv",
+ "glTexSubImage1D",
+ "glTexSubImage2D",
+ "glTexSubImage3D",
+ "glTranslated",
+ "glTranslatef",
+ "glVertex2dv",
+ "glVertex2fv",
+ "glVertex2iv",
+ "glVertex2sv",
+ "glVertex3dv",
+ "glVertex3fv",
+ "glVertex3iv",
+ "glVertex3sv",
+ "glVertex4dv",
+ "glVertex4fv",
+ "glVertex4iv",
+ "glVertex4sv",
+ "glVertexPointer",
+ "glViewport",
+ "glxSwapQueryExtensionsStringReply",
+ "glxSwapQueryServerStringReply",
+ NULL
+};
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "glx",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData glxModuleData = { &VersRec, glxSetup, NULL };
+
+static pointer
+glxSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+ pointer GLcore = NULL;
+#ifdef GLX_USE_SGI_SI
+ char GLcoreName[] = "GL";
+#else
+ char GLcoreName[] = "GLcore";
+#endif
+
+ if (!setupDone) {
+ setupDone = TRUE;
+
+ GLcore = LoadSubModule(module, GLcoreName, NULL, NULL, NULL, NULL,
+ errmaj, errmin);
+ if (!GLcore) {
+ if (errmaj) *errmaj = LDR_NOSUBENT;
+ } else {
+ LoaderReqSymLists(glcoreSymbols, NULL);
+ LoadExtension(&GLXExt, FALSE);
+ /* Wrap the init visuals routine in micmap.c */
+ GlxWrapInitVisuals(&miInitVisualsProc);
+ /* Make sure this gets wrapped each time InitVisualWrap is called */
+ miHookInitVisuals(NULL, GlxWrapInitVisuals);
+ }
+ } else {
+ if (errmaj) *errmaj = LDR_ONCEONLY;
+ }
+ /* Need a non-NULL return value to indicate success */
+ return GLcore;
+}
diff --git a/hw/xfree86/dixmods/laymodule.c b/hw/xfree86/dixmods/laymodule.c
new file mode 100644
index 000000000..60b6bcfa0
--- /dev/null
+++ b/hw/xfree86/dixmods/laymodule.c
@@ -0,0 +1,56 @@
+/*
+ * $XFree86: xc/programs/Xserver/miext/layer/laymodule.c,v 1.1 2002/11/08 22:19:55 keithp Exp $
+ *
+ * Copyright © 2000 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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.
+ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+#include "X.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "font.h"
+#include "dixfontstr.h"
+#include "fontstruct.h"
+#include "mi.h"
+#include "regionstr.h"
+#include "globals.h"
+#include "gcstruct.h"
+#include "layer.h"
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "layer",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData layerModuleData = { &VersRec, NULL, NULL };
+
+#endif
diff --git a/hw/xfree86/dixmods/mfbmodule.c b/hw/xfree86/dixmods/mfbmodule.c
new file mode 100644
index 000000000..0617226d0
--- /dev/null
+++ b/hw/xfree86/dixmods/mfbmodule.c
@@ -0,0 +1,48 @@
+/* $XFree86: xc/programs/Xserver/mfb/mfbmodule.c,v 1.7 1999/01/26 05:54:21 dawes Exp $ */
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifdef XFree86LOADER
+#include "xf86Module.h"
+
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "mfb",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData mfbModuleData = { &VersRec, NULL, NULL };
+
+#endif
diff --git a/hw/xfree86/dixmods/recordmod.c b/hw/xfree86/dixmods/recordmod.c
new file mode 100644
index 000000000..acafc456d
--- /dev/null
+++ b/hw/xfree86/dixmods/recordmod.c
@@ -0,0 +1,42 @@
+/* $XFree86: xc/programs/Xserver/record/recordmod.c,v 1.6 2000/01/25 18:37:50 dawes Exp $ */
+
+#include "xf86Module.h"
+
+extern Bool noTestExtensions;
+
+static MODULESETUPPROTO(recordSetup);
+
+extern void RecordExtensionInit(INITARGS);
+
+ExtensionModule recordExt = {
+ RecordExtensionInit,
+ "RECORD",
+ &noTestExtensions,
+ NULL,
+ NULL
+};
+
+static XF86ModuleVersionInfo VersRec = {
+ "record",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 13, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_EXTENSION,
+ {0,0,0,0}
+};
+
+XF86ModuleData recordModuleData = { &VersRec, recordSetup, NULL };
+
+static pointer
+recordSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ LoadExtension(&recordExt, FALSE);
+
+ /* Need a non-NULL return value to indicate success */
+ return (pointer)1;
+}
+
diff --git a/hw/xfree86/dixmods/shmodule.c b/hw/xfree86/dixmods/shmodule.c
new file mode 100644
index 000000000..44aef65ce
--- /dev/null
+++ b/hw/xfree86/dixmods/shmodule.c
@@ -0,0 +1,56 @@
+/*
+ * $XFree86: xc/programs/Xserver/miext/shadow/shmodule.c,v 1.1 2000/09/03 05:07:24 keithp Exp $
+ *
+ * Copyright © 2000 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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.
+ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+#include "X.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "font.h"
+#include "dixfontstr.h"
+#include "fontstruct.h"
+#include "mi.h"
+#include "regionstr.h"
+#include "globals.h"
+#include "gcstruct.h"
+#include "shadow.h"
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "shadow",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData shadowModuleData = { &VersRec, NULL, NULL };
+
+#endif
diff --git a/hw/xfree86/dixmods/type1mod.c b/hw/xfree86/dixmods/type1mod.c
new file mode 100644
index 000000000..9c25f4c0b
--- /dev/null
+++ b/hw/xfree86/dixmods/type1mod.c
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+/* $XFree86: xc/lib/font/Type1/module/type1mod.c,v 1.10 2002/12/09 17:29:59 dawes Exp $ */
+
+#include "misc.h"
+
+#include "fontmod.h"
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(type1Setup);
+
+ /*
+ * This is the module data function that is accessed when loading
+ * libtype1 as a module.
+ */
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "type1",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 2,
+ ABI_CLASS_FONT, /* Font module */
+ ABI_FONT_VERSION,
+ MOD_CLASS_FONT,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData type1ModuleData = { &VersRec, type1Setup, NULL };
+
+extern void Type1RegisterFontFileFunctions(void);
+#ifdef BUILDCID
+extern void CIDRegisterFontFileFunctions(void);
+#endif
+
+FontModule type1Module = {
+ Type1RegisterFontFileFunctions,
+ "Type1",
+ NULL
+};
+
+#ifdef BUILDCID
+FontModule CIDModule = {
+ CIDRegisterFontFileFunctions,
+ "CID",
+ NULL
+};
+#endif
+
+static pointer
+type1Setup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ type1Module.module = module;
+ LoadFont(&type1Module);
+#ifdef BUILDCID
+ CIDModule.module = module;
+ LoadFont(&CIDModule);
+#endif
+
+ /* Need a non-NULL return */
+ return (pointer)1;
+}
diff --git a/hw/xfree86/dixmods/xf86XTrapModule.c b/hw/xfree86/dixmods/xf86XTrapModule.c
new file mode 100644
index 000000000..07283cdb7
--- /dev/null
+++ b/hw/xfree86/dixmods/xf86XTrapModule.c
@@ -0,0 +1,47 @@
+/* $XFree86: xc/programs/Xserver/XTrap/xf86XTrapModule.c,v 1.1 2001/11/02 23:29:29 dawes Exp $ */
+/* This is the xf86 module code for the DEC_XTRAP extension.
+ */
+
+#include "xf86Module.h"
+
+#include <X11/extensions/xtrapdi.h>
+
+extern void DEC_XTRAPInit(INITARGS);
+
+#ifdef XFree86LOADER
+
+static MODULESETUPPROTO(xtrapSetup);
+
+ExtensionModule xtrapExt =
+{
+ DEC_XTRAPInit,
+ XTrapExtName,
+ NULL,
+ NULL,
+ NULL
+};
+
+static XF86ModuleVersionInfo xtrapVersRec =
+{
+ "xtrap",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION, /* needs the server extension ABI */
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_EXTENSION,
+ {0,0,0,0}
+};
+
+XF86ModuleData xtrapModuleData = { &xtrapVersRec, xtrapSetup, NULL };
+
+static pointer
+xtrapSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
+ LoadExtension(&xtrapExt, FALSE);
+ /* Need a non-NULL return value to indicate success */
+ return (pointer)1;
+}
+
+#endif /* XFree86LOADER */
diff --git a/hw/xfree86/doc/README.DRI b/hw/xfree86/doc/README.DRI
new file mode 100644
index 000000000..66a5a5ff8
--- /dev/null
+++ b/hw/xfree86/doc/README.DRI
@@ -0,0 +1,1257 @@
+ DRI User Guide
+
+ VA Linux Systems, Inc. Professional Services - Graphics.
+
+ 15 June 2001
+
+1. Preamble
+
+1.1 Copyright
+
+Copyright © 2000-2001 by VA Linux Systems, Inc. All Rights Reserved.
+
+Permission is granted to make and distribute verbatim copies of this document
+provided the copyright notice and this permission notice are preserved on all
+copies.
+
+1.2 Trademarks
+
+OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics,
+Inc. Unix is a registered trademark of The Open Group. The `X' device and X
+Window System are trademarks of The Open Group. XFree86 is a trademark of
+The XFree86 Project. Linux is a registered trademark of Linus Torvalds.
+Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and
+Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd.
+3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter-
+active, Incorporated. Matrox is a registered trademark of Matrox Electronic
+Systems Ltd. ATI Rage and Radeon are registered trademarks of ATI Technolo-
+gies, Inc. All other trademarks mentioned are the property of their respec-
+tive owners.
+
+2. Introduction
+
+With XFree86 4.x and the Direct Rendering Interface (DRI), hardware acceler-
+ated 3D graphics can be considered a standard feature on Linux workstations.
+Support for other operating systems, such as FreeBSD, is underway.
+
+This document describes how to use the DRI system and troubleshoot problems
+which may occur. Readers should have a basic understanding of Linux, X and
+OpenGL. See the resources section at the end for more documentation and
+software downloads.
+
+This document does not cover compilation or installation of XFree86 4.x. It
+is assumed that you've already installed a Linux distribution which includes
+XFree86 4.x or that you're an experienced Linux developer who has compiled
+the DRI for himself. DRI download, compilation and installation instructions
+can be found at http://dri.sourceforge.net/DRIcompile.html
+
+Edits, corrections and updates to this document may be mailed to <brian@tung-
+stengrahpics.com>.
+
+3. Supported Architectures & Hardware
+
+3.1 CPU Architectures
+
+The architectures currently supported by the DRI have grown from the initial
+Intel i386 systems to now include the Alpha Processor and the Sun SPARC
+machines.
+
+Intel's SSE (a.k.a. Katmai) instructions are used in optimized vertex trans-
+formation functions in Mesa-based drivers. This requires a recent Linux ker-
+nel both at compile and runtime. See the DRI Compile Guide for compile-time
+requirements. At runtime a check is made to determine if the CPU can execute
+SSE instructions. They're disabled otherwise.
+
+AMD's 3DNow! instructions are also used in optimized vertex transformation
+functions in the Mesa-based DRI drivers. 3DNow! is supported in most ver-
+sions of Linux. Like the SSE optimizations, a runtime check is made to
+determine if the CPU can execute 3DNow! instructions.
+
+Alpha-based systems can use Compaq's optimized math library for improved 3D
+performance. See the DRI Compilation Guide for details.
+
+3.2 Graphics Hardware
+
+XFree86 4.2 (or later versions) includes 3D acceleration for the following
+graphics hardware:
+
+ o 3dfx, supported on Intel x86, AMD and Alpha:
+
+ o Voodoo5 5500
+
+ o Voodoo4 4500
+
+ o Voodoo3 3500 TV
+
+ o Voodoo3 3000 AGP
+
+ o Voodoo3 3000 PCI
+
+ o Voodoo3 2000 AGP
+
+ o Voodoo3 2000 PCI
+
+ o Voodoo Banshee
+
+ o Velocity 100/200
+
+ There are many configurations of 3dfx cards on the market. Not all have
+ been tested.
+
+ o Matrox, supported on Intel x86 and AMD:
+
+ o Matrox G200
+
+ o Matrox G400
+
+ o Intel i810/i815/i830 (motherboard chipsets)
+
+ o i810
+
+ o i810-dc100
+
+ o i810e
+
+ o i815
+
+ o i830
+
+ o ATI Rage 128, supported on Intel x86, AMD and Alpha:
+
+ o Rage Fury
+
+ o Rage Magnum
+
+ o XPERT 2000
+
+ o XPERT 128
+
+ o XPERT 99
+
+ o All-in-Wonder 128
+
+ o Rage 128 PCI (Alpha-based systems)
+
+ Note that both PCI and AGP versions of Rage 128 based cards are sup-
+ ported at this time.
+
+ o ATI Radeon, supported on Intel x86, AMD and Alpha:
+
+ o Radeon SDR AGP
+
+ o Radeon DDR AGP
+
+ o Radeon 32MB SDR PCI (Alpha-based systems)
+
+ o Radeon 7000, M6 (RV100)
+
+ o Radeon 7200 (R100)
+
+ o Radeon 7500, M7 (RV200)
+
+ o Radeon 8500, 9100 (R200)
+
+ o Radeon 9000, M9 (RV250)
+
+ o 3Dlabs, supported on Intel x86 and AMD:
+
+ o Oxygen GMX 2000 (MX/Gamma based). Note: this driver is no longer
+ being actively developed.
+
+Support for other hardware is underway. Most of the DRI development work is
+funded by contracts with IHVs. These contracts often prevent us from
+announcing drivers before they're released. Queries about upcoming drivers
+may not be answerable.
+
+4. Prerequisite Software
+
+ o The DRI is available in XFree86 4.0 and later.
+
+ o Some hardware drivers require specific versions of the Linux kernel for
+ AGP support, etc. See section 10 for specifics.
+
+ o You DO NOT need to install Mesa separately. The parts of Mesa needed
+ for hardware acceleration are already in the XFree86/DRI project.
+
+5. Kernel Modules
+
+3D hardware acceleration requires a DRI kernel module that's specific to your
+graphics hardware.
+
+The DRI kernel module version must exactly match your running kernel version.
+Since there are so many versions of the kernel, it's difficult to provide
+precompiled kernel modules.
+
+While the Linux source tree includes the DRI kernel module sources, the lat-
+est DRI kernel sources will be found in the DRI source tree.
+
+See the DRI Compilation Guide for information on compiling the DRI kernel
+modules.
+
+XFree86 4.0.1 added automatic kernel module loading to the X server. On
+Linux, the X server uses modprobe to load kernel modules. In Linux 2.4.x the
+DRM kernel modules should be kept in /lib/modules/2.4.x/ker-
+nel/drivers/char/drm/ for automatic loading to work.
+
+Optionally, DRM kernel modules can be loaded manually with insmod prior to
+starting the X server.
+
+You can verify that the kernel module was installed with lsmod, checking the
+X server startup log, and checking that /proc/dri/0 exists.
+
+6. XF86Config file
+
+The XFree86 configuration file is usually found in /etc/X11/XF86Config. This
+section describes the parts which must be specially set for the DRI.
+
+First, the XF86Config file must load the GLX and DRI modules:
+
+ Section "Module"
+ ...
+ # This loads the GLX module
+ Load "glx"
+ # This loads the DRI module
+ Load "dri"
+ EndSection
+
+Next, the DRI section can be used to restrict access to direct rendering. A
+client can only use direct rendering if it has permission to open the
+/dev/dri/card? file(s). The permissions on these DRI device files is con-
+trolled by the "DRI" section in the XF86Config file.
+
+If you want all of the users on your system to be able to use direct-render-
+ing, then use a simple DRI section like this:
+
+ Section "DRI"
+ Mode 0666
+ EndSection
+
+This section will allow any user with a current connection to the X server to
+use direct rendering.
+
+If you want to restrict the use of direct-rendering to a certain group of
+users, then create a group for those users by editing the /etc/group file on
+your system. For example, you may want to create a group called xf86dri and
+place two users (e.g., fred and jane) in that group. To do that, you might
+add the following line to /etc/group:
+
+ xf86dri:x:8000:fred,jane
+
+You have to be careful that the group id (8000 in this example) is unique.
+
+Then you would use the following DRI section:
+
+ Section "DRI"
+ Group "xf86dri"
+ Mode 0660
+ EndSection
+
+This would limit access to direct-rendering to those users in the xf86dri
+group (fred and jane in this example). When other users tried to use direct
+rendering, they would fall back to unaccelerated indirect rendering.
+
+[Note that there is a known bug in XFree86 4.0 that prevents some changes to
+the DRI section from taking effect. Until this bug is fixed, if you change
+the DRI section, please also remove the /dev/dri directory with the rm -rf
+/dev/dri command.]
+
+Finally, the XF86Config file needs Device and Screen sections specific to
+your hardware. Look in section 10: Hardware-Specific Information and Trou-
+bleshooting for details.
+
+7. Memory usage
+
+Using the 3D features of a graphics card requires more memory than when it's
+just used as a 2D device. Double buffering, depth buffering, stencil
+buffers, textures, etc. all require extra graphics memory. These features
+may require four times the memory used for a simple 2D display.
+
+If your graphics card doesn't have a lot of memory (less than 16MB, for exam-
+ple), you may have to reduce your screen size and/or color depth in order to
+use 3D features. Reducing the screen resolution will also leave more space
+for texture images, possibly improving 3D performance. If, for example, you
+play Quake3 at 1024x768 but start your display at 1600x1200 you might con-
+sider restarting X at 1024x768 in order to maximize your texture memory
+space.
+
+The documentation included with your card should have information about maxi-
+mum screen size when using 3D.
+
+8. Using 3D Acceleration
+
+This section describes how to link your application with libGL.so and verify
+that you are in fact using 3D acceleration.
+
+8.1 libGL.so
+
+Your OpenGL program must link with the libGL.so.1.2 library provided by
+XFree86. The libGL.so.1.2 library contains a GLX protocol encoder for indi-
+rect/remote rendering and DRI code for accessing hardware drivers. In par-
+ticular, be sure you're not using libGL.so from another source such as Mesa
+or the Utah GLX project.
+
+Unless it was built in a special way, the libGL.so library does not contain
+any 3D hardware driver code. Instead, libGL.so dynamically loads the appro-
+priate 3D driver during initialization.
+
+Most simple OpenGL programs also use the GLUT and GLU libraries. A source
+for these libraries is listed in the Resources section below.
+
+8.2 Compiling and linking an OpenGL program
+
+A simple GLUT/OpenGL program may be compiled and linked as follows:
+
+ gcc program.c -I/usr/local/include -L/usr/local/lib -L/usr/X11R6/lib -lglut -lGLU -lGL -o program
+
+The -I option is used to specify where the GL/glut.h (and possibly the
+GL/gl.h and GL/glu.h) header file may be found.
+
+The -L options specify where the libglut.so and the X libraries are located.
+libGL.so and libGLU.so should be in /usr/lib, as specified by the
+Linux/OpenGL ABI standard.
+
+The -lglut -lGLU -lGL arguments specify that the application should link with
+the GLUT, GLU and GL libraries, in that order.
+
+8.3 Running your OpenGL program
+
+Simply typing ./program in your shell should execute the program.
+
+If you get an error message such as
+
+ gears: error in loading shared libraries: libGL.so.1: cannot
+ open shared object file: No such file or directory
+
+if means that the libGL.so.1 file is not the right location. Proceed to the
+trouble shooting section.
+
+8.4 libOSMesa.so
+
+OSMesa (Off-Screen Mesa) is an interface and driver for rendering 3D images
+into a user-allocated block of memory rather than an on-screen window. It
+was originally developed for Mesa before Mesa became part of the XFree86/DRI
+project. It can now be used with the XFree86/DRI libGL.so as well.
+
+libOSMesa.so implements the OSMesa interface and it must be linked with your
+application if you want to use the OSMesa functions. You must also link with
+libGL.so. For example:
+
+ gcc osdemo.c -lOSMesa -lGLU -lGL -o osdemo
+
+In stand-alone Mesa this interface was compiled into the monolithic libGL.so
+(formerly libMesaGL.so) library. In XFree86 4.0.1 and later this interface
+is implemented in a separate library.
+
+8.5 glxinfo
+
+glxinfo is a useful program for checking which version of libGL you're using
+as well as which DRI-based driver. Simply type glxinfo and examine the
+OpenGL vendor, renderer, and version lines. Among the output you should see
+something like this:
+
+ OpenGL vendor string: VA Linux Systems, Inc.
+ OpenGL renderer string: Mesa DRI Voodoo3 20000224
+ OpenGL version string: 1.2 Mesa 3.4
+
+or this:
+
+ OpenGL vendor string: VA Linux Systems, Inc.
+ OpenGL renderer string: Mesa GLX Indirect
+ OpenGL version string: 1.2 Mesa 3.4
+
+The first example indicates that the 3dfx driver is using Voodoo3 hardware.
+The second example indicates that no hardware driver was found and indirect,
+unaccelerated rendering is being used.
+
+If you see that indirect rendering is being used when direct rendering was
+expected, proceed to the troubleshooting section.
+
+glxinfo also lists all of the GLX-enhanced visuals available so you can
+determine which visuals are double-bufferd, have depth (Z) buffers, stencil
+buffers, accumulation buffers, etc.
+
+8.6 Environment Variables
+
+The libGL.so library recognizes three environment variables. Normally, none
+of them need to be defined. If you're using the csh or tcsh shells, type
+setenv VARNAME value to set the variable. Otherwise, if you're using sh or
+bash, type export VARNAME=value.
+
+ 1. LIBGL_DEBUG, if defined will cause libGL.so to print error and diagnos-
+ tic messages. This can help to solve problems. Setting LIBGL_DEBUG to
+ verbose may provide additional information.
+
+ 2. LIBGL_ALWAYS_INDIRECT, if defined this will force libGL.so to always
+ use indirect rendering instead of hardware acceleration. This can be
+ useful to isolate rendering errors.
+
+ 3. LIBGL_DRIVERS_PATH can be used to override the default directories
+ which are searched for 3D drivers. The value is one or more paths sep-
+ arated by colons. In a typical XFree86 installation, the 3D drivers
+ should be in /usr/X11R6/lib/modules/dri/ and LIBGL_DRIVERS_PATH need
+ not be defined. Note that this feature is disabled for set-uid pro-
+ grams. This variable replaces the LIBGL_DRIVERS_DIR env var used in
+ XFree86 4.0.
+
+ 4. MESA_DEBUG, if defined, will cause Mesa-based 3D drivers to print user
+ error messages to stderr. These are errors that you'd otherwise detect
+ by calling glGetError.
+
+Mesa-based drivers (this includes most of the drivers listed above) also
+observe many of the existing Mesa environment variables. These include the
+MESA_DEBUG and MESA_INFO variables.
+
+9. General Trouble Shooting
+
+This section contains information to help you diagnose general problems. See
+below for additional information for specific hardware.
+
+9.1 Bus Mastering
+
+DMA-based DRI drivers (that's most DRI drivers) cannot function unless bus
+mastering is enabled for your graphics card. By default, some systems don't
+having bus mastering on. You should enable it in your BIOS.
+
+Alternately, you can check the status of bus mastering and change the setting
+from within Linux. There may be similar procedures for other operating sys-
+tems.
+
+Run lspci (as root) and find the information describing your graphics
+adapter. For example:
+
+ 00:00.0 Host bridge: Intel Corporation 440BX/ZX - 82443BX/ZX Host bridge (rev 03)
+ 00:01.0 PCI bridge: Intel Corporation 440BX/ZX - 82443BX/ZX AGP bridge (rev 03)
+ 00:07.0 ISA bridge: Intel Corporation 82371AB PIIX4 ISA (rev 02)
+ 00:07.1 IDE interface: Intel Corporation 82371AB PIIX4 IDE (rev 01)
+ 00:07.2 USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 01)
+ 00:07.3 Bridge: Intel Corporation 82371AB PIIX4 ACPI (rev 02)
+ 00:11.0 Ethernet controller: Intel Corporation 82557 [Ethernet Pro 100] (rev 08)
+ 00:12.0 SCSI storage controller: Symbios Logic Inc. (formerly NCR) 53c895 (rev 02)
+ 00:14.0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 08)
+ 01:00.0 VGA compatible controller: 3Dfx Interactive, Inc.: Unknown device 0009 (rev 01)
+
+The bus, device, and function number comprise the device id, which is conven-
+tionally written in the form bus:dev.func, or in this case 01:00.0.
+
+Use the setpci command to examine bit two of register 4 for your graphics
+card. This will indicate whether or not bus mastering is enabled.
+
+ setpci -s 01:00.0 4.w
+
+A hexadecimal value will be printed. Convert the least significant digit to
+binary. For example, if you see 3, that's 0011 in binary (bit two is 0). If
+you see 7, that's 0111 in binary (bit two is 1). In the first example, bus
+mastering is disabled. It's enabled in the second example.
+
+The following shell script will enabled bus mastering for your graphics card
+and host bridge. Run it as root.
+
+ #!/bin/bash
+ dev=01:00.0 # change as appropriate
+ echo Enabling bus mastering on device $dev
+ setpci -s $dev 4.w=$(printf %x $((0x$(setpci -s $dev 4.w)|4)))
+ dev=00:00.0
+ echo Enabling bus mastering on host bridge $dev
+ setpci -s $dev 4.w=$(printf %x $((0x$(setpci -s $dev 4.w)|4)))
+
+You can check if this worked by running the first setpci command again.
+
+9.2 The X Server
+
+ 1. Before you start the X server, verify the appropriate 3D kernel module
+ is installed. Type lsmod and look for the appropriate kernel module.
+ For 3dfx hardware you should see tdfx, for example.
+
+ 2. Verify you're running XFree86 4.0 (or newer) and not an older version.
+ If you run xdpyinfo and look for the following line near the top:
+
+ vendor release number: 4000
+
+ 3. Verify that your XF86Config file (usually found at /etc/X11/XF86Config)
+ loads the glx and dri modules and has a DRI section.
+
+ See the Software Resources section below for sample XF86Config files.
+
+ 4. Examine the messages printed during X server startup and check that the
+ DRM module loaded. Using the Voodoo3 as an example:
+
+ (==) TDFX(0): Write-combining range (0xf0000000,0x2000000)
+ (II) TDFX(0): Textures Memory 7.93 MB
+ (0): [drm] created "tdfx" driver at busid "PCI:1:0:0"
+ (0): [drm] added 4096 byte SAREA at 0xc65dd000
+ (0): [drm] mapped SAREA 0xc65dd000 to 0x40013000
+ (0): [drm] framebuffer handle = 0xf0000000
+ (0): [drm] added 1 reserved context for kernel
+ (II) TDFX(0): [drm] Registers = 0xfc000000
+ (II) TDFX(0): visual configs initialized
+ (II) TDFX(0): Using XFree86 Acceleration Architecture (XAA)
+ Screen to screen bit blits
+ Solid filled rectangles
+ 8x8 mono pattern filled rectangles
+ Indirect CPU to Screen color expansion
+ Solid Lines
+ Dashed Lines
+ Offscreen Pixmaps
+ Driver provided NonTEGlyphRenderer replacement
+ Setting up tile and stipple cache:
+ 10 128x128 slots
+ (==) TDFX(0): Backing store disabled
+ (==) TDFX(0): Silken mouse enabled
+ (0): X context handle = 0x00000001
+ (0): [drm] installed DRM signal handler
+ (0): [DRI] installation complete
+ (II) TDFX(0): direct rendering enabled
+
+ 5. After the X server has started, verify that the required X server
+ extensions are loaded. Run xdpyinfo and look for the following entries
+ in the extensions list:
+
+ GLX
+ SGI-GLX
+ XFree86-DRI
+
+9.3 Linking, running and verifying 3D acceleration
+
+After you've verified that the X server and DRI have started correctly it's
+time to verify that the GL library and hardware drivers are working cor-
+rectly.
+
+ 1. Verify that you're using the correct libGL.so library with ldd. The
+ /usr/lib and /usr/X11R6/lib directories are expected locations for
+ libGL.so.
+
+ Example:
+
+ % ldd /usr/local/bin/glxinfo
+ libglut.so.3 => /usr/local/lib/libglut.so.3 (0x40019000)
+ libGLU.so.1 => /usr/local/lib/libGLU.so.1 (0x40051000)
+ libGL.so.1 => /usr/lib/libGL.so.1 (0x40076000)
+ libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x402ee000)
+ libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40301000)
+ libm.so.6 => /lib/libm.so.6 (0x40309000)
+ libc.so.6 => /lib/libc.so.6 (0x40325000)
+ libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40419000)
+ libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404bd000)
+ libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40509000)
+ libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40512000)
+ libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40529000)
+ libvga.so.1 => /usr/lib/libvga.so.1 (0x40537000)
+ libpthread.so.0 => /lib/libpthread.so.0 (0x4057d000)
+ /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
+
+ 2. You may also double check that libGL.so is in fact DRI-capable. Run
+ strings libGL.so.1.2 | grep DRI and look for symbols prefixed with
+ "XF86DRI", such as "XF86DRIQueryExtension".
+
+ 3. To be safe one should run ldconfig after installing libGL.so to be sure
+ the runtime loader will find the proper library.
+
+ 4. Verify that the appropriate 3D driver is in /usr/X11R6/lib/modules/dri/
+ For example, the 3dfx driver will be named tdfx_dri.so.
+
+ 5. Set the LIBGL_DEBUG environment variable. This will cause libGL.so to
+ print an error message if it fails to load a DRI driver. Any error
+ message printed should be self-explanatory.
+
+ 6. Run glxinfo. Note the line labeled "OpenGL renderer string". It
+ should have a value which starts with "Mesa DRI" followed by the name
+ of your hardware.
+
+ 7. Older Linux OpenGL applications may have been linked against Mesa's GL
+ library and will not automatically use libGL.so. In some cases, making
+ symbolic links from the Mesa GL library to libGL.so.1 will solve the
+ problem:
+
+ ln -s libGL.so.1 libMesaGL.so.3
+
+ In other cases, the application will have to be relinked against the
+ new XFree86 libGL.so.
+
+ It is reported that part of the problem is that running ldconfig will
+ silently rewrite symbolic links based on the SONAME field in libraries.
+
+If you're still having trouble, look in the next section for information spe-
+cific to your graphics card.
+
+10. Hardware-Specific Information and Troubleshooting
+
+This section presents hardware-specific information for normal use and trou-
+bleshooting.
+
+10.1 3dfx Banshee, Voodoo3, Voodoo4 and Voodoo5 Series
+
+10.1.1 Requirements
+
+The 3dfx DRI driver requires special versions of the 3dfx Glide library.
+Different versions of Glide are needed for Banshee/Voodoo3 than for
+Voodoo4/5. The Glide libraries can be downloaded from the DRI website.
+
+10.1.2 Configuration
+
+Your XF86Config file's device section must specify the tdfx device. For
+example:
+
+ Section "Device"
+ Identifier "Voodoo3"
+ VendorName "3dfx"
+ Driver "tdfx"
+ EndSection
+
+Or,
+
+ Section "Device"
+ Identifier "Voodoo5"
+ VendorName "3dfx"
+ Driver "tdfx"
+ EndSection
+
+The Screen section should then reference the Voodoo device:
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "Voodoo3"
+ Monitor "High Res Monitor"
+ DefaultDepth 16
+ Subsection "Display"
+ Depth 16
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
+Or,
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "Voodoo5"
+ Monitor "High Res Monitor"
+ DefaultDepth 24
+ Subsection "Display"
+ Depth 16
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ Subsection "Display"
+ Depth 24
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
+The kernel module for 3dfx hardware is named tdfx.o and should be installed
+in /lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically
+loaded by the Xserver if needed.
+
+The DRI 3D driver for 3dfx hardware should be in /usr/X11R6/lib/mod-
+ules/dri/tdfx_dri.so. This will be automatically loaded by libGL.so.
+
+The Voodoo5 supports 3D rendering in 16 and 32 bpp modes. When running in
+32bpp mode an 8-bit stencil buffer and 24-bit Z (depth) buffer are offered.
+When running in 16bpp mode only a 16-bit Z (depth) buffer is offered and
+stencil is implemented in software.
+
+A software-based accumulation buffer is available in both 16 and 32bpp modes.
+
+10.1.3 Troubleshooting
+
+ o If you try to run an OpenGL application and see an error message similar
+ to
+
+ gd error (glide): gd error (glide): grSstSelect: non-existent SSTgd error (glide): grSstSelect: non-existent SSTS
+
+ it means that you have the wrong version of the Glide library for your
+ hardware.
+
+ o 3D acceleration for Banshee and Voodoo3 is only supported in the 16
+ bit/pixel screen mode. Use xdpyinfo to verify that all your visuals are
+ depth 16. Edit your XF86Config file if needed.
+
+ o The /dev/3dfx device is not used for DRI; it's only for Glide on older
+ 3dfx hardware.
+
+ o Different versions of Glide are needed for Voodoo3 and Voodoo5. See the
+ DRI website's resources page to download the right version of Glide.
+
+ o Voodoo4/5 may be run at 24bpp (instead of 32bpp, the default) but 3D
+ acceleration is not supported in that mode. 32bpp mode is fully 3D
+ accelerated.
+
+10.1.4 Performance and Features
+
+ o Normally, buffer swapping in double-buffered applications is synchro-
+ nized to your monitor's refresh rate. This may be overridden by setting
+ the FX_GLIDE_SWAPINTERVAL environment variable. The value of this vari-
+ able indicates the maximum number of swap buffer commands can be
+ buffered. Zero allows maximum frame rate.
+
+ o On Voodoo4/5, rendering with 16-bits/texel textures is faster than using
+ 32-bit per texel textures. The internalFormat parameter to glTexImage2D
+ can be used to control texel size. Quake3 and other games let you con-
+ trol this as well.
+
+ o The glTexEnv mode GL_BLEND is not directly supported by the Voodoo3
+ hardware. It can be accomplished with a multipass algorithm but it's
+ not implemented at this time. Applications which use that mode, such as
+ the Performer Town demo, may become sluggish when falling back to soft-
+ ware rendering to render in that mode.
+
+ o The Voodoo3/Banshee driver reverts to software rendering under the fol-
+ lowing conditions:
+
+ o Setting GL_LIGHT_MODEL_COLOR_CONTROL to GL_SEPARATE_SPECULAR_COLOR.
+
+ o Enabling line stippling or polygon stippling.
+
+ o Enabling point smoothing or polygon smoothing.
+
+ o Enabling line smoothing when line width is not 1.0. That is,
+ antialiased lines are done in hardware only when the line width is
+ 1.0.
+
+ o Using 1-D or 3-D texture maps.
+
+ o Using the GL_BLEND texture environment.
+
+ o Using stencil operations.
+
+ o Using the accumulation buffer.
+
+ o Using glBlendEquation(GL_LOGIC_OP).
+
+ o Using glDrawBuffer(GL_FRONT_AND_BACK).
+
+ o Using glPolygonMode(face, GL_POINT) or glPolygonMode(face,
+ GL_LINE).
+
+ o Using point size attenuation (i.e. GL_DISTANCE_ATTENUATION_EXT).
+
+ o Using glColorMask(r, g, b, a) when r!=g or g!=b.
+
+ o The Voodoo5 driver reverts to software rendering under the same condi-
+ tions Voodoo3 with three exceptions. First, stencil operations are
+ implemented in hardware when the screen is configured for 32 bits/pixel.
+ Second, the GL_BLEND texture env mode is fully supported in hardware.
+ Third, glColorMask is fully supported in hardware when the screen is
+ configured for 32 bits/pixel.
+
+ o As of January, 2001 the second VSA-100 chip on the Voodoo5 is not yet
+ operational. Therefore, the board isn't being used to its full capac-
+ ity. The second VSA-100 chip will allow Scan-Line Interleave (SLI) mode
+ for full-screen applications and games, potentially doubling the sys-
+ tem's fill rate. When the second VSA-100 chip is activated glGet-
+ String(GL_RENDERER) will report Voodoo5 instead of Voodoo4.
+
+ o The lowest mipmap level is sometimes miscolored in trilinear- sampled
+ polygons.
+
+ o The GL_EXT_texture_env_combine extension is supported on the Voodoo4 and
+ Voodoo5.
+
+10.1.5 Known Problems
+
+ o The lowest mipmap level is sometimes miscolored in trilinear- sampled
+ polygons (Voodoo3/Banshee).
+
+ o Fog doesn't work with orthographic projections.
+
+ o The accuracy of blending operations on Voodoo4/5 isn't always very good.
+ If you run Glean, you'll find some test failures.
+
+ o The Glide library cannot be used directly; it's only meant to be used
+ via the tdfx DRI driver.
+
+ o SSystem has problems because of poorly set near and far clipping planes.
+ The office.unc Performer model also suffers from this problem.
+
+10.2 Intel i810
+
+10.2.1 Requirements
+
+A kernel with AGP GART support (such as Linux 2.4.x) is needed.
+
+10.2.2 Configuration
+
+Your XF86Config file's device section must specify the i810 device, and spec-
+ify a usable amount of video ram to reserve.
+
+ Section "Device"
+ Identifier "i810"
+ VendorName "Intel"
+ Driver "i810"
+ Option "AGPMode" "1"
+ VideoRam 10000
+ EndSection
+
+The Screen section should then reference the i810 device:
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "i810"
+ Monitor "High Res Monitor"
+ DefaultDepth 16
+ Subsection "Display"
+ Depth 16
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
+The kernel module for the i810 is named i810.o and should be installed in
+/lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically loaded
+by the Xserver if needed.
+
+The DRI 3D driver for the i810 should be in /usr/X11R6/lib/mod-
+ules/dri/i810_dri.so. This will be automatically loaded by libGL.so.
+
+10.2.3 Troubleshooting
+
+ o 3D acceleration for the i810 is only available in the 16 bit/pixel
+ screen mode at this time. 32bpp acceleration is not supported by this
+ hardware. Use xdpyinfo to verify that all your visuals are depth 16.
+ Edit your XF86Config file if needed.
+
+ o The i810 uses system ram for video and 3d graphics. The X server will
+ ordinarily reserve 4mb of ram for graphics, which is too little for an
+ effective 3d setup. To tell the driver to use a larger amount, specify
+ a VideoRam option in the Device section of your XF86Config file. A num-
+ ber between 10000 and 16384 seems adequate for most requirements. If
+ too little memory is available for DMA buffers, back and depth buffers
+ and textures, direct rendering will be disabled.
+
+10.2.4 Performance and Features
+
+Basically all of the i810 features which can be exposed through OpenGL 1.2
+are implemented. However, the following OpenGL features are implemented in
+software and will be slow:
+
+ o Stencil buffer and accumulation buffer operations
+
+ o Blend subtract, min/max and logic op blend modes
+
+ o glColorMask when any mask is set to false
+
+ o GL_SEPARATE_SPECULAR_COLOR lighting mode
+
+ o glDrawBuffer(GL_FRONT_AND_BACK)
+
+ o Using 1D or 3D textures
+
+ o Using texture borders
+
+10.3 Matrox G200 and G400
+
+10.3.1 Requirements
+
+A kernel with AGP GART support (such as Linux 2.4.x) is needed.
+
+10.3.2 Configuration
+
+Your XF86Config file's device section must specify the mga device:
+
+ Section "Device"
+ Identifier "MGA"
+ VendorName "Matrox"
+ Driver "mga"
+ Option "AGPMode" "1"
+ VideoRam 32768
+ EndSection
+
+The Screen section should then reference the MGA device:
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "MGA"
+ Monitor "High Res Monitor"
+ DefaultDepth 16
+ Subsection "Display"
+ Depth 16
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
+To use a 32bpp screen mode, use this Screen section instead:
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "MGA"
+ Monitor "High Res Monitor"
+ DefaultDepth 24
+ DefaultFbBpp 32
+ Subsection "Display"
+ Depth 24
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
+The kernel module for the G200/G400 is named mga.o and should be installed in
+/lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically loaded
+by the Xserver if needed.
+
+The DRI 3D driver for the G200/G400 should be in /usr/X11R6/lib/mod-
+ules/dri/mga_dri.so. This will be automatically loaded by libGL.so.
+
+10.3.3 Performance and Features
+
+Software rendering will be used under any of the following conditions:
+
+ o Using glDrawBuffer(GL_FRONT_AND_BACK).
+
+ o Using point, line, or triangle smoothing.
+
+ o Using glLogicOp.
+
+ o Using glPolygonStipple or glLineStipple.
+
+ o Using 1D or 3D textures.
+
+ o Using texture borders.
+
+ o Using glDepthFunc(GL_NEVER).
+
+ o Using the accumulation buffer.
+
+The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP
+speeds may result in unreliable performance depending on your motherboard.
+
+Compaq has funded the implementation of AGP accelerated ReadPixels and Draw-
+Pixels in this driver. With this implementation, on a G400 drawing directly
+from AGP memory (exported to the client), throughput of up to 1 GB/sec has
+been measured.
+
+Additionally Compaq's funding has produced several new extensions in Mesa,
+including one (packed_depth_stencil_MESA) which enables Read/DrawPixels func-
+tionality to operate directly on the packed 24/8 depth/stencil buffers of
+this hardware.
+
+In order to access this functionality, the application must ensure that all
+pixel processing operations are disabled. There are in addition a fairly
+complex set of rules regarding which packing/unpacking modes must be used,
+and which data formats are supported, and alignment constraints. See the
+files in lib/GL/mesa/src/drv/mga/DOCS for a summary of these. The extension
+definitions are included in the Mesa 3.4 source distribution.
+
+10.3.4 IRQ Assignment
+
+There have been problems in the past with the MGA driver being very sluggish
+when the DRI is enabled (to the point of being unusable.) This is caused by
+the graphics card not having an interrupt assigned to it. The current DRI
+trunk will attempt to detect this condition and bail out gracefully.
+
+The solution to the above problem is to assign an interrupt to your graphics
+card. This is something you must turn on in your system BIOS configuration.
+Please consult your system BIOS manual for instructions on how to enable an
+interrupt for your graphics card.
+
+10.3.5 MGA HAL lib
+
+MGAHALlib.a is a binary library Matrox has provided for use under Linux to
+expose functionality for which they can not provide documentation. (For
+example TV-Out requires MacroVision be enabled on the output.) This binary
+library also sets the pixel/memory clocks to the optimal settings for your
+Matrox card.
+
+Currently the MGAHAL library is required for the G450 to work. You can down-
+load this from the driver section on Matrox's website: www.matrox.com/mga
+
+Here modifications to the DRI build instructions which make the mga ddx
+driver use the MGAHAL library:
+
+ 1.Put the following define in your host.def file
+ #define UseMatroxHal YES
+ 2. Place mgaHALlib.a in the following directory
+ xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/
+
+You can use DualHead on the G400/G450 DH cards by creating two device sec-
+tions which both point to the same BusID. For most AGP devices the BusID
+will be "PCI:1:0:0". Configure your screen section as you would normally
+configure XFree86 4.x Multihead. It should be noted that currently the sec-
+ond head does not support direct rendering.
+
+10.3.6 Known Problems
+
+None.
+
+10.4 ATI Rage 128
+
+10.4.1 Requirements
+
+A kernel with AGP GART support (such as Linux 2.4.x) is needed.
+
+10.4.2 Configuration
+
+Your XF86Config file's device section must specify the ati device:
+
+ Section "Device"
+ Identifier "Rage128"
+ VendorName "ATI"
+ Driver "ati"
+ Option "AGPMode" "1"
+ Option "UseCCEFor2D" "false"
+ EndSection
+
+The Screen section should then reference the Rage 128 device:
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "Rage128"
+ Monitor "High Res Monitor"
+ DefaultDepth 16
+ Subsection "Display"
+ Depth 16
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ Subsection "Display"
+ Depth 32
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
+The kernel module for the Rage 128 is named r128.o and should be installed in
+/lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically loaded
+by the Xserver if needed.
+
+The DRI 3D driver for the Rage 128 should be in /usr/X11R6/lib/mod-
+ules/dri/r128_dri.so. This will be automatically loaded by libGL.so.
+
+You may also set your screen depth to 32 for 32bpp mode.
+
+10.4.3 Performance and Features
+
+While PCI Rage 128 based cards are supported, they do not yet support PCI
+GART, so they will not perform as well as their AGP counterparts.
+
+For AGP cards, the AGP mode may be set to 1, 2, or 4. One is used by
+default. Higher AGP speeds may result in unreliable performance depending on
+your motherboard.
+
+Note that even at 32bpp there is no alpha channel.
+
+The following OpenGL features are implemented in software and will be slow:
+
+ o accumulation buffer operations
+
+ o stencil, when using a 16bpp screen
+
+ o Blend subtract, min/max and logic op blend modes
+
+ o GL_SEPARATE_SPECULAR_COLOR lighting mode
+
+ o glDrawBuffer(GL_FRONT_AND_BACK)
+
+ o Using 1D or 3D textures
+
+ o Using texture borders
+
+10.4.4 Known Problems
+
+If you experience stability problems you may try setting the UseCCEFor2D
+option to true. This will effectively disable 2D hardware acceleration.
+Performance will be degraded, of course.
+
+10.5 ATI Radeon
+
+10.5.1 Requirements
+
+A kernel with AGP GART support (such as Linux 2.4.x) is needed.
+
+10.5.2 Configuration
+
+Your XF86Config file's device section must specify the ati device:
+
+ Section "Device"
+ Identifier "Radeon"
+ VendorName "ATI"
+ Driver "ati"
+ Option "AGPMode" "1"
+ EndSection
+
+The Screen section should then reference the Radeon device:
+
+ Section "Screen"
+ Identifier "Screen 1"
+ Device "Radeon"
+ Monitor "High Res Monitor"
+ DefaultDepth 16
+ Subsection "Display"
+ Depth 16
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ Subsection "Display"
+ Depth 32
+ Modes "1280x1024" "1024x768" "800x600" "640x480"
+ ViewPort 0 0
+ EndSubsection
+ EndSection
+
+The kernel module for the Radeon is named radeon.o and should be installed in
+/lib/modules/2.4.x/kernel/drivers/char/drm/. It will be automatically loaded
+by the Xserver if needed.
+
+The DRI 3D driver for the Radeon should be in /usr/X11R6/lib/mod-
+ules/dri/radeon_dri.so. This will be automatically loaded by libGL.so.
+
+You may also set your screen depth to 32 for 32bpp mode.
+
+10.5.3 Performance and Features
+
+While this driver supports many of the features of ATI Radeon cards, we do
+not yet fully support the card's TCL features. This work is progressing, but
+is not yet ready.
+
+The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP
+speeds may result in unreliable performance depending on your motherboard.
+
+The following OpenGL features are implemented in software and will be slow:
+
+ o Blend subtract, blend min/max and blend logicops
+
+ o Stencil and accumulation operations
+
+ o 1D and 3D textures
+
+ o Texture borders
+
+The GL_EXT_texture_env_combine, GL_EXT_texture_env_add and GL_EXT_tex-
+ture_env_dot3 extensions are supported (or will be soon supported in the new
+driver based on Mesa 3.5).
+
+We hope to implement support for the following features in the future:
+
+ o Vertex transformation, clipping and lighting (TCL)
+
+ o Hardware stencil buffer
+
+ o Cube map textures
+
+ o 3D textures
+
+ o Three texture units
+
+10.5.4 Known Problems
+
+Certain (early?) revisions of the AMD Irongate chipset have AGPGART problems
+which effect Radeon, and other graphics cards. The card may work unreliably,
+or not work at all. If the DRM kernel module is not loaded, the 2D Xserver
+may work. There's hope that this can be fixed in the future.
+
+10.6 3DLabs Oxygen GMX 2000
+
+The driver for this hardware was experimental and is no longer being devel-
+oped or supported.
+
+11. General Limitations and Known Bugs
+
+11.1 OpenGL
+
+The following OpenGL features are not supported at this time: overlays,
+stereo, hardware-accelerated indirect rendering.
+
+OpenGL-like functionality is provided with the Mesa library. XFree86 4.1.0
+uses Mesa 3.4.2. Subsequent releases of XFree86 will use newer versions of
+Mesa. When newer versions of Mesa are available, the 3D drivers can be
+updated without reinstalling XFree86 or libGL.so.
+
+11.2 GLX
+
+The GLX 1.3 API is exported but none of the new 1.3 functions are opera-
+tional.
+
+The new glXGetProcAddressARB function is fully supported.
+
+GLXPixmap rendering is only supported for indirect rendering contexts. This
+is a common OpenGL limitation. Attempting to use a direct rendering context
+with a GLXPixmap will result in an X protocol error.
+
+11.3 Debugging
+
+Debugging DRI drivers with gdb can be difficult because of the locking
+involved. When debugging OpenGL applications, you should avoid stepping
+inside the GL functions. If you're trying to debug a DRI driver it's recom-
+mended that you do so remotely, from a second system.
+
+11.4 Scheduling
+
+When you run multiple GL applications at once you may notice poor time slic-
+ing. This is due to an interaction problem with the Linux scheduler which
+will be addressed in the future.
+
+11.5 libGL.so and dlopen()
+
+A number of popular OpenGL applications on Linux (such as Quake3, HereticII,
+Heavy Gear 2, etc) dynamically open the libGL.so library at runtime with
+dlopen(), rather than linking with -lGL at compile/link time.
+
+If dynamic loading of libGL.so is not implemented carefully, there can be a
+number of serious problems. Here are the things to be careful of in your
+application:
+
+ o Specify the RTLD_GLOBAL flag to dlopen(). If you don't do this then
+ you'll likely see a runtime error message complaining that _glapi_Con-
+ text is undefined when libGL.so tries to open a hardware-specific
+ driver. Without this flag, nested opening of dynamic libraries does not
+ work.
+
+ o Do not close the library with dlclose() until after XCloseDisplay() has
+ been called. When libGL.so initializes itself it registers several
+ callbacks functions with Xlib. When XCloseDisplay() is called those
+ callback functions are called. If libGL.so has already been unloaded
+ with dlclose() this will cause a segmentation fault.
+
+ o Your application should link with -lpthread. On Linux, libGL.so uses
+ the pthreads library in order to provide thread safety. There is appar-
+ ently a bug in the dlopen()/dlclose() code which causes crashes if the
+ library uses pthreads but the parent application doesn't. The only
+ known work-around is to link the application with -lpthread.
+
+Some applications don't yet incorporate these procedures and may fail. For
+example, changing the graphics settings in some video games will expose this
+problem. The DRI developers are working with game vendors to prevent this
+problem in the future.
+
+11.6 Bug Database
+
+The DRI bug database which includes bugs related to specific drivers is at
+the SourceForge DRI Bug Database
+
+Please scan both the open and closed bug lists to determine if your problem
+has already been reported and perhaps fixed.
+
+12. Resources
+
+12.1 Software
+
+A collection of useful configuration files, libraries, headers, utilities and
+demo programs is available from http://dri.sourceforge.net/res.phtml
+
+12.2 Documentation
+
+ o General OpenGL information is available at the OpenGL Home Page
+
+ o XFree86 information is available at the XFree86 Home Page
+
+ o Information about the design of the DRI is available from Precision
+ Insight, Inc.
+
+ o Visit the DRI project on SourceForge.net for the latest development news
+ about the DRI and 3D drivers.
+
+ o The DRI Compilation Guide explains how to download, compile and install
+ the DRI for yourself.
+
+12.3 Support
+
+ o The DRI-users mailing list at SourceForge is a forum for people to dis-
+ cuss DRI problems.
+
+ o In the future there may be IHV and Linux vendor support resources for
+ the DRI.
+
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.29 2003/02/17 03:57:29 dawes Exp $
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.21 2003/02/17 04:04:07 dawes Exp $
diff --git a/hw/xfree86/doc/README.fonts b/hw/xfree86/doc/README.fonts
new file mode 100644
index 000000000..fb1c1f5fb
--- /dev/null
+++ b/hw/xfree86/doc/README.fonts
@@ -0,0 +1,1146 @@
+ Fonts in XFree86
+
+ Juliusz Chroboczek, <jch@xfree86.org>
+
+ 17 January 2003
+
+1. Introduction
+
+This document describes the support for fonts in XFree86. Installing fonts
+(section 2., page 1) is aimed at the casual user wishing to install fonts in
+XFree86; the rest of the document describes the font support in more detail.
+
+We assume some familiarity with digital fonts. If anything is not clear to
+you, please consult Appendix: Background (section 5., page 1) at the end of
+this document for background information.
+
+1.1 Two font systems
+
+XFree86 includes two font systems: the core X11 fonts system, which is pre-
+sent in all implementations of X11, and the Xft fonts system, which is not
+currently distributed with implementations of X11 that are not based on
+XFree86 but will hopefully be included by them in the future
+
+The core X11 fonts system is directly derived from the fonts system included
+with X11R1 in 1987, which could only use monochrome bitmap fonts. Over the
+years, it has been more or less happily coerced into dealing with scalable
+fonts and rotated glyphs.
+
+Xft was designed from the start to provide good support for scalable fonts,
+and do so efficiently. Unlike the core fonts system, it supports features
+such as anti-aliasing and sub-pixel rasterisation. Perhaps more importantly,
+it gives applications full control over the way glyphs are rendered, making
+fine typesetting and WYSIWIG display possible. Finally, it allows applica-
+tions to use fonts that are not installed system-wide for displaying docu-
+ments with embedded fonts.
+
+Xft is not compatible with the core fonts system: usage of Xft requires mak-
+ing fairly extensive changes to toolkits (user-interface libraries). While
+XFree86 will continue to maintain the core fonts system, toolkit authors are
+encouraged to switch to Xft as soon as possible.
+
+2. Installing fonts
+
+This section explains how to configure both Xft and the core fonts system to
+access newly-installed fonts.
+
+2.1 Configuring Xft
+
+Xft has no configuration mechanism itself, rather it relies upon the fontcon-
+fig library to configure and customize fonts. That library is not specific
+to XFree86 or indeed on any particular font output mechanism. This discus-
+sion describes how fontconfig, rather than Xft, works.
+
+2.1.1 Installing fonts in Xft
+
+Fontconfig looks for fonts in a set of well-known directories that include
+all of XFree86's standard font directories (`/usr/X11R6/lib/X11/lib/fonts/*')
+by default) as well as a directory called `.fonts/' in the user's home direc-
+tory. Installing a font for use by Xft applications is as simple as copying
+a font file into one of these directories.
+
+ $ cp lucbr.ttf ~/.fonts/
+
+Fontconfig will notice the new font at the next opportunity and rebuild its
+list of fonts. If you want to trigger this update from the command line (for
+example in order to globally update the system-wide Fontconfig information),
+you may run the command `fc-cache'.
+
+ $ fc-cache
+
+2.1.2 Fine-tuning Xft
+
+Fontconfig's behaviour is controlled by a set of configuration files: a sys-
+tem-wide configuration file, `/etc/fonts/fonts.conf', and a user-specific
+file called `.fonts.conf' in the user's home directory (this can be overrid-
+den with the `FONTCONFIG_FILE' environment variable).
+
+Every Fontconfig configuration file must start with the following boiler-
+plate:
+
+ <?xml version="1.0"?>
+ <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+ <fontconfig>
+
+In addition, every Fontconfig configuration file must end with the following
+line:
+
+ </fontconfig>
+
+The default Fontconfig configuration file includes the directory `~/.fonts/'
+in the list of directories searched for font files, and this is where user-
+specific font files should be installed. In the unlikely case that a new
+font directory needs to be added, this can be done with the following syntax:
+
+ <dir>/usr/local/share/fonts/</dir>
+
+Another useful option is the ability to disable anti-aliasing (font smooth-
+ing) for selected fonts. This can be done with the following syntax:
+
+ <match target="font">
+ <test qual="any" name="family">
+ <string>Lucida Console</string>
+ </test>
+ <edit name="antialias" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+Anti-aliasing can be disabled for all fonts by the following incantation:
+
+ <match target="font">
+ <edit name="antialias" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+Xft supports sub-pixel rasterisation on LCD displays. XFree86 should auto-
+matically enable this feature on laptops and when using an LCD monitor con-
+nected with a DVI cable; you can check whether this was done by typing
+
+ $ xdpyinfo -ext RENDER | grep sub-pixel
+
+If this doesn't print anything, you will need to configure Render for your
+particular LCD hardware manually; this is done with the following syntax:
+
+ <match target="font">
+ <edit name="rgba" mode="assign">
+ <const>rgb</const>
+ </edit>
+ </match>
+
+The string `rgb' within the `<const>'...`</const>' specifies the order of
+pixel components on your display, and should be changed to match your hard-
+ware; it can be one of `rgb (normal LCD screen), `bgr' (backwards LCD
+screen), `vrgb' (LCD screen rotated clockwise) or `vbgr' (LCD screen rotated
+counterclockwise).
+
+2.1.3 Configuring applications
+
+Because most current applications use the core fonts system by default, it is
+necessary to explicitly configure them to use Xft. How this is done depends
+on the application.
+
+XTerm can be set to use Xft by using the `-fa' command line option or by set-
+ting the `XTerm*faceName' resource:
+
+ XTerm*faceName: Courier
+
+or
+
+ $ xterm -fa "Courier"
+
+For applications based on GTK+ 2.0 (including GNOME 2 applications), the
+environment variable `GDK_USE_XFT' should be set to `1':
+
+ $ export GDK_USE_XFT=1
+
+GTK+ 2.2 uses Xft by default.
+
+For KDE applications, you should select ``Anti-alias fonts'' in the ``Fonts''
+panel of KDE's ``Control Center''. Note that this option is misnamed: it
+switches KDE to using Xft but doesn't enable anti-aliasing in case it was
+disabled by your Xft configuration file.
+
+(What about Mozilla?)
+
+2.1.4 Troubleshooting
+
+If some Xft-based applications don't seem to notice the changes you are mak-
+ing to your configuration files, they may be linked against the XFree86 4.2
+version of Xft. In order to fix the problem, you should relink them against
+a current version of Xft; on most systems, it is enough to install the cur-
+rent version of the Xft and Fontconfig libraries.
+
+If, for some reason, you cannot upgrade the shared libraries, please check
+the Xft(3) manual page included with XFree86 4.2 for the configuration mecha-
+nisms of the previous version of Xft.
+
+2.2 Configuring the core X11 fonts system
+
+Installing fonts in the core system is a two step process. First, you need
+to create a font directory that contains all the relevant font files as well
+as some index files. You then need to inform the X server of the existence
+of this new directory by including it in the font path.
+
+2.2.1 Installing bitmap fonts
+
+The XFree86 server can use bitmap fonts in both the cross-platform BDF format
+and the somewhat more efficient binary PCF format. (XFree86 also supports
+the obsolete SNF format.)
+
+Bitmap fonts are normally distributed in the BDF format. Before installing
+such fonts, it is desirable (but not absolutely necessary) to convert the
+font files to the PCF format. This is done by using the command `bdftopcf',
+e.g.
+
+ $ bdftopcf courier12.bdf
+
+You will then want to compress the resulting PCF font files:
+
+ $ gzip courier12.pcf
+
+After the fonts have been converted, you should copy all the font files that
+you wish to make available into a arbitrary directory, say
+`/usr/local/share/fonts/bitmap/'. You should then create the index file
+`fonts.dir' by running the command `mkfontdir' (please see the mkfontdir(1)
+manual page for more information):
+
+ $ mkdir /usr/local/share/fonts/bitmap/
+ $ cp *.pcf.gz /usr/local/share/fonts/bitmap/
+ $ mkfontdir /usr/local/share/fonts/bitmap/
+
+All that remains is to tell the X server about the existence of the new font
+directory; see Setting the server font path (section 2.2.4, page 1) below.
+
+2.2.2 Installing scalable fonts
+
+The XFree86 server supports scalable fonts in four formats: Type 1, Speedo,
+TrueType and CIDFont. This section only applies to the former three; for
+information on CIDFonts, please see Installing CIDFonts (section 2.2.3, page
+1) later in this document.
+
+Installing scalable fonts is very similar to installing bitmap fonts: you
+create a directory with the font files, and run `mkfontdir' to create an
+index file called `fonts.dir'.
+
+There is, however, a big difference: `mkfontdir' cannot automatically recog-
+nise scalable font files. For that reason, you must first index all the font
+files in a file called `fonts.scale'. While this can be done by hand, it is
+best done by using the `mkfontscale' utility.
+
+ $ mkfontscale /usr/local/share/fonts/Type1/
+ $ mkfontdir /usr/local/share/fonts/Type1/
+
+Under some circumstances, it may be necessary to modify the `fonts.scale'
+file generated by mkfontscale; for more information, please see the mkfont-
+dir(1) and mkfontscale(1) manual pages and Core fonts and internationalisa-
+tion (section 4.1, page 1) later in this document.
+
+2.2.3 Installing CID-keyed fonts
+
+The CID-keyed font format was designed by Adobe Systems for fonts with large
+character sets. A CID-keyed font, or CIDFont for short, contains a collec-
+tion of glyphs indexed by character ID (CID).
+
+In order to map such glyphs to meaningful indices, Adobe provide a set of
+CMap files. The PostScript name of a font generated from a CIDFont consists
+of the name of the CIDFont and the name of the CMap separated by two dashes.
+For example, the font generated from the CIDFont `Munhwa-Regular' using the
+CMap `UniKS-UCS2-H' is called
+
+ Munhwa-Regular--UniKS-UCS2-H
+
+The CIDFont code in XFree86 requires a very rigid directory structure. The
+main directory must be called `CID' (its location defaults to
+`/usr/X11R6/lib/X11/fonts/CID' but it may be located anywhere), and it should
+contain a subdirectory for every CID collection. Every subdirectory must
+contain subdirectories called CIDFont (containing the actual CIDFont files),
+CMap (containing all the needed CMaps), AFM (containing the font metric
+files) and CFM (initially empty). For example, in the case of the font
+Munhwa-Regular that uses the CID collection Adobe-Korea1-0, the directory
+structure should be as follows:
+
+ CID/Adobe-Korea1/CIDFont/Munhwa-Regular
+ CID/Adobe-Korea1/CMap/UniKS-UCS2-H
+ CID/Adobe-Korea1/AFM/Munhwa-Regular.afm
+ CID/Adobe-Korea1/CFM/
+ CID/fonts.dir
+ CID/fonts.scale
+
+After creating this directory structure and copying the relevant files, you
+should create a <`tt/fonts.scale/' file. This file has the same format as in
+the case of (non-CID) scalable fonts, except that its first column contains
+PostScript font names with the extension `.cid' appended rather than actual
+filenames:
+
+ 1
+ Adobe-Korea1/Munhwa-Regular--UniKS-UCS2-H.cid \
+ -adobe-munhwa-medium-r-normal--0-0-0-0-p-0-iso10646-1
+
+(both names on the same line). Running `mkfontdir' creates the `fonts.dir'
+file:
+
+ $ cd /usr/local/share/fonts/CID
+ $ mkfontdir
+
+Finally, you should create the font metrics summary files in the directory
+`CFM' by running the command `mkcfm':
+
+ $ mkcfm /usr/local/share/fonts/CID
+
+If no CFM files are available, the server will still be able to use the CID
+fonts but querying them will take a long time. You should run `mkcfm' again
+whenever a change is made to any of the CID-keyed fonts, or when the CID-
+keyed fonts are copied to a machine with a different architecture.
+
+2.2.4 Setting the server's font path
+
+The list of directories where the server looks for fonts is known as the font
+path. Informing the server of the existence of a new font directory consists
+of putting it on the font path.
+
+The font path is an ordered list; if a client's request matches multiple
+fonts, the first one in the font path is the one that gets used. When match-
+ing fonts, the server makes two passes over the font path: during the first
+pass, it searches for an exact match; during the second, it searches for
+fonts suitable for scaling.
+
+For best results, scalable fonts should appear in the font path before the
+bitmap fonts; this way, the server will prefer bitmap fonts to scalable fonts
+when an exact match is possible, but will avoid scaling bitmap fonts when a
+scalable font can be used. (The `:unscaled' hack, while still supported,
+should no longer be necessary in XFree86 4.0 and later.)
+
+You may check the font path of the running server by typing the command
+
+ $ xset q
+
+2.2.4.1 Temporary modification of the font path
+
+The `xset' utility may be used to modify the font path for the current ses-
+sion. The font path is set with the command xset fp; a new element is added
+to the front with xset +fp, and added to the end with xset fp+. For example,
+
+ $ xset +fp /usr/local/fonts/Type1
+ $ xset fp+ /usr/local/fonts/bitmap
+
+Conversely, an element may be removed from the front of the font path with
+`xset -fp', and removed from the end with `xset fp-'. You may reset the font
+path to its default value with `xset fp default'.
+
+For more information, please consult the xset(1) manual page.
+
+2.2.4.2 Permanent modification of the font path
+
+The default font path (the one used just after server startup or after `xset
+fp default') is specified in the X server's `XF86Config' file. It is com-
+puted by appending all the directories mentioned in the `FontPath' entries of
+the `Files' section in the order in which they appear.
+
+ FontPath "/usr/local/fonts/Type1"
+ ...
+ FontPath "/usr/local/fonts/bitmap"
+
+For more information, please consult the XF86Config(5) manual page.
+
+2.2.5 Troubleshooting
+
+If you seem to be unable to use some of the fonts you have installed, the
+first thing to check is that the `fonts.dir' files are correct and that they
+are readable by the server (the X server usually runs as root, beware of NFS-
+mounted font directories). If this doesn't help, it is quite possible that
+you are trying to use a font in a format that is not supported by your
+server.
+
+XFree86 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType, OpenType and
+CIDFont font formats. However, not all XFree86 servers come with all the
+font backends configured in.
+
+On most platforms, the XFree86 servers are modular: the font backends are
+included in modules that are loaded at runtime. The modules to be loaded are
+specified in the `XF86Config' file using the `Load' directive:
+
+ Load "type1"
+
+If you have trouble installing fonts in a specific format, you may want to
+check the server's log file in order to see whether the relevant modules are
+properly loaded. The list of font modules distributed with XFree86 is as
+follows:
+
+ o "bitmap": bitmap fonts (`*.bdf', `*.pcf' and `*.snf');
+
+ o "freetype": TrueType fonts (`*.ttf' and `*.ttc'), OpenType fonts
+ (`*.otf' and `*.otc') and Type 1 fonts (`*.pfa' and `*.pfb');
+
+ o "type1": alternate Type 1 backend (`*.pfa' and `*.pfb') and CIDFont
+ backend;
+
+ o "xtt": alternate TrueType backend (`*.ttf' and `*.ttc');
+
+ o "speedo": Bitstream Speedo fonts (`*.spd').
+
+Please note that the argument of the `Load' directive is case-sensitive.
+
+3. Fonts included with XFree86
+
+3.1 Standard bitmap fonts
+
+The Sample Implementation of X11 (SI) comes with a large number of bitmap
+fonts, including the `fixed' family, and bitmap versions of Courier, Times,
+Helvetica and some members of the Lucida family. In the SI, these fonts are
+provided in the ISO 8859-1 encoding (ISO Latin Western-European).
+
+In XFree86, a number of these fonts are provided in Unicode-encoded font
+files instead. At build time, these fonts are split into font files encoded
+according to legacy encodings, a process which allows us to provide the stan-
+dard fonts in a number of regional encodings with no duplication of work.
+
+For example, the font file
+
+ /usr/X11R6/lib/X11/fonts/misc/6x13.bdf
+
+with XLFD
+
+ -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
+
+is a Unicode-encoded version of the standard `fixed' font with added support
+for the Latin, Greek, Cyrillic, Georgian, Armenian, IPA and other scripts
+plus numerous technical symbols. It contains over 2800 glyphs, covering all
+characters of ISO 8859 parts 1-5, 7-10, 13-15, as well as all European IBM
+and Microsoft code pages, KOI8, WGL4, and the repertoires of many other char-
+acter sets.
+
+This font is used at build time for generating the font files
+
+ 6x13-ISO8859-1.bdf
+ 6x13-ISO8859-2.bdf
+ ...
+ 6x13-ISO8859-15.bdf
+ 6x13-KOI8-R.bdf
+
+with respective XLFDs
+
+ -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1
+ ...
+ -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-15
+ -misc-fixed-medium-r-normal--13-120-75-75-c-60-koi8-r
+
+The standard short name `fixed' is normally an alias for
+
+ -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1
+
+3.2 The ClearlyU Unicode font family
+
+The ClearlyU family of fonts provides a set of 12 pt, 100 dpi proportional
+fonts with many of the glyphs needed for Unicode text. Together, the fonts
+contain approximately 7500 glyphs.
+
+The main ClearlyU font has the XLFD
+
+ -mutt-clearlyu-medium-r-normal--17-120-100-100-p-101-iso10646-1
+
+and resides in the font file
+
+ /usr/X11R6/lib/X11/fonts/misc/cu12.pcf.gz
+
+Additional ClearlyU fonts include
+
+ -mutt-clearlyu alternate glyphs-medium-r-normal--17-120-100-100-p-91-iso10646-1
+ -mutt-clearlyu pua-medium-r-normal--17-120-100-100-p-111-iso10646-1
+ -mutt-clearlyu arabic extra-medium-r-normal--17-120-100-100-p-103-fontspecific-0
+ -mutt-clearlyu ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0
+
+The Alternate Glyphs font contains additional glyph shapes that are needed
+for certain languages. A second alternate glyph font will be provided later
+for cases where a character has more than one commonly used alternate shape
+(e.g. the Urdu heh).
+
+The PUA font contains extra glyphs that are useful for certain rendering pur-
+poses.
+
+The Arabic Extra font contains the glyphs necessary for characters that don't
+have all of their possible shapes encoded in ISO 10646. The glyphs are
+roughly ordered according to the order of the characters in the ISO 10646
+standard.
+
+The Ligature font contains ligatures for various scripts that may be useful
+for improved presentation of text.
+
+3.3 Standard scalable fonts
+
+XFree86 includes all the scalable fonts distributed with X11R6.
+
+3.3.1 Standard Type 1 fonts
+
+The IBM Courier set of fonts cover ISO 8859-1 and ISO 8859-2 as well as Adobe
+Standard Encoding. These fonts have XLFD
+
+ -adobe-courier-medium-*-*--0-0-0-0-m-0-*-*
+
+and reside in the font files
+
+ /usr/X11R6/lib/X11/fonts/Type1/cour*.pfa
+
+The Adobe Utopia set of fonts only cover ISO 8859-1 as well as Adobe Standard
+Encoding. These fonts have XLFD
+
+ -adobe-utopia-*-*-normal--0-0-0-0-p-0-iso8859-1
+
+and reside in the font files
+
+ /usr/X11R6/lib/X11/fonts/Type1/UT*.pfa
+
+Finally, XFree86 also comes with Type 1 versions of Bitstream Courier and
+Charter. These fonts have XLFD
+
+ -bitstream-courier-*-*-normal--0-0-0-0-m-0-iso8859-1
+ -bitstream-charter-*-*-normal--0-0-0-0-p-0-iso8859-1
+
+and reside in the font files
+
+ /usr/X11R6/lib/X11/fonts/Type1/c*bt_.pfb
+
+3.3.2 Standard Speedo fonts
+
+XFree86 includes Speedo versions of the Bitstream Courier and Charter fonts.
+In order to use these fonts, you should ensure that your X server is loading
+the `Speedo' font backend; see Troubleshooting (section 2.2.5, page 1).
+
+These fonts cover all of ISO 8859-1 and almost all of ISO 8859-2. They have
+XLFD name
+
+ -bitstream-courier-*-*-normal--0-0-0-0-m-0-*-*
+ -bitstream-charter-*-*-normal--0-0-0-0-p-0-*-*
+
+and reside in the font files
+
+ /usr/X11R6/lib/X11/fonts/Speedo/font*.spd
+
+3.4 The Bigelow & Holmes Luxi family
+
+XFree86 includes the Luxi family of scalable fonts, in both TrueType and
+Type 1 format. This family consists of the fonts Luxi Serif, with XLFD
+
+ -b&h-luxi serif-medium-*-normal--*-*-*-*-p-*-*-*
+
+Luxi Sans, with XLFD
+
+ -b&h-luxi sans-medium-*-normal--*-*-*-*-p-*-*-*
+
+and Luxi Mono, with XLFD
+
+ -b&h-luxi mono-medium-*-normal--*-*-*-*-m-*-*-*
+
+Each of these fonts comes Roman, oblique, bold and bold oblique variants The
+TrueType version have glyphs covering the basic ASCII Unicode range, the
+Latin 1 range, as well as the Extended Latin range and some additional punc-
+tuation characters. In particular, these fonts include all the glyphs needed
+for ISO 8859 parts 1, 2, 3, 4, 9, 13 and 15, as well as all the glyphs in the
+Adobe Standard encoding and the Windows 3.1 character set.
+
+The glyph coverage of the Type 1 versions is somewhat reduced, and only cov-
+ers ISO 8859 parts 1, 2 and 15 as well as the Adobe Standard encoding.
+
+The Luxi fonts are original designs by Kris Holmes and Charles Bigelow. Luxi
+fonts include seriffed, sans serif, and monospaced styles, in roman and
+oblique, and normal and bold weights. The fonts share stem weight, x-height,
+capital height, ascent and descent, for graphical harmony.
+
+The character width metrics of Luxi roman and bold fonts match those of core
+fonts bundled with popular operating and window systems.
+
+The license terms for the Luxi fonts are included in the file `COPYRIGHT.BH',
+as well as in the License document.
+
+Charles Bigelow and Kris Holmes from Bigelow and Holmes Inc. developed the
+Luxi typeface designs in Ikarus digital format.
+
+URW++ Design and Development GmbH converted the Ikarus format fonts to True-
+Type and Type1 font programs and implemented the grid-fitting "hints" and
+kerning tables in the Luxi fonts.
+
+For more information, please contact <design@bigelowandholmes.com> or
+<info@urwpp.de>, or consult the URW++ web site <URL:http://www.urwpp.de>.
+
+An earlier version of the Luxi fonts was made available under the name
+Lucidux. This name should no longer be used due to trademark uncertainties,
+and all traces of the Lucidux name have been removed from XFree86.
+
+4. More about core fonts
+
+This section describes XFree86-specific enhancements to the core X11 fonts
+system.
+
+4.1 Core fonts and internationalisation
+
+The scalable font backends (Type 1, Speedo and TrueType) can automatically
+re-encode fonts to the encoding specified in the XLFD in `fonts.dir'. For
+example, a `fonts.dir' file can contain entries for the Type 1 Courier font
+such as
+
+ cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1
+ cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-2
+
+which will lead to the font being recoded to ISO 8859-1 and ISO 8859-2
+respectively.
+
+4.1.1 The fontenc layer
+
+Three of the scalable backends (Type 1, Speedo, and the FreeType TrueType
+backend) use a common fontenc layer for font re-encoding. This allows these
+backends to share their encoding data, and allows simple configuration of new
+locales independently of font type.
+
+Please note: the X-TrueType (X-TT) backend does not use the fontenc layer,
+but instead uses its own method for font reencoding. If you are only inter-
+ested in X-TT you may want to skip to Using Symbol Fonts (section 4.1.5, page
+1), as the intervening information does not apply to X-TT. X-TT itself is
+described in more detail in X-TrueType (section 4.2.3, page 1).
+
+In the fontenc layer, an encoding is defined by a name (such as iso8859-1),
+possibly a number of aliases (alternate names), and an ordered collection of
+mappings. A mapping defines the way the encoding can be mapped into one of
+the target encodings known to fontenc; currently, these consist of Unicode,
+Adobe glyph names, and arbitrary TrueType ``cmap''s.
+
+A number of encodings are hardwired into fontenc, and are therefore always
+available; the hardcoded encodings cannot easily be redefined. These
+include:
+
+ o iso10646-1: Unicode;
+
+ o iso8859-1: ISO Latin-1 (Western Europe);
+
+ o iso8859-2: ISO Latin-2 (Eastern Europe);
+
+ o iso8859-3: ISO Latin-3 (Southern Europe);
+
+ o iso8859-4: ISO Latin-4 (Northern Europe);
+
+ o iso8859-5: ISO Cyrillic;
+
+ o iso8859-6: ISO Arabic;
+
+ o iso8859-7: ISO Greek;
+
+ o iso8859-8: ISO Hebrew;
+
+ o iso8859-9: ISO Latin-5 (Turkish);
+
+ o iso8859-10: ISO Latin-6 (Nordic);
+
+ o iso8859-15: ISO Latin-9, or Latin-0 (Revised Western-European);
+
+ o koi8-r: KOI8 Russian;
+
+ o koi8-u: KOI8 Ukrainian (see RFC 2319);
+
+ o koi8-ru: KOI8 Russian/Ukrainian;
+
+ o koi8-uni: KOI8 ``Unified'' (Russian, Ukrainian, and Byelorussian);
+
+ o koi8-e: KOI8 ``European,'' ISO-IR-111, or ECMA-Cyrillic;
+
+ o microsoft-symbol and apple-roman: these are only likely to be useful
+ with TrueType symbol fonts.
+
+Additional encodings can be added by defining encoding files. When a font
+encoding is requested that the fontenc layer doesn't know about, the backend
+checks the directory in which the font file resides (not necessarily the
+directory with fonts.dir!) for a file named `encodings.dir'. If found, this
+file is scanned for the requested encoding, and the relevant encoding defini-
+tion file is read in. The `mkfontdir' utility, when invoked with the `-e'
+option followed by the name of a directory containing encoding files, can be
+used to automatically build `encodings.dir' files. Please see the mkfont-
+dir(1) manual page for more details.
+
+A number of encoding files for common encodings are included with XFree86.
+Information on writing new encoding files can be found in Format of encodings
+directory files (section 4.1.3, page 1) and Format of encoding files (section
+4.1.4, page 1) later in this document.
+
+4.1.2 Backend-specific notes about fontenc
+
+4.1.2.1 The FreeType backend
+
+For TrueType and OpenType fonts, the FreeType backend scans the mappings in
+order. Mappings with a target of PostScript are ignored; mappings with a
+TrueType or Unicode target are checked against all the cmaps in the file.
+The first applicable mapping is used.
+
+For Type 1 fonts, the FreeType backend first searches for a mapping with a
+target of PostScript. If one is found, it is used. Otherwise, the backend
+searches for a mapping with target Unicode, which is then composed with a
+built-in table mapping codes to glyph names. Note that this table only cov-
+ers part of the Unicode code points that have been assigned names by Adobe.
+
+Specifying an encoding value of adobe-fontspecific for a Type 1 font disables
+the encoding mechanism. This is useful with symbol and incorrectly encoded
+fonts (see Incorrectly encoded fonts (section 4.1.6, page 1) below).
+
+If a suitable mapping is not found, the FreeType backend defaults to
+ISO 8859-1.
+
+4.1.2.2 Type 1
+
+The Type 1 backend behaves similarly to the FreeType backend with Type 1
+fonts, except that it limits all encodings to 8-bit codes.
+
+4.1.2.3 Speedo
+
+The Speedo backend searches for a mapping with a target of Unicode, and uses
+it if found. If none is found, the backend defaults to ISO 8859-1.
+
+The Speedo backend limits all encodings to 8-bit codes.
+
+4.1.3 Format of encoding directory files
+
+In order to use a font in an encoding that the font backend does not know
+about, you need to have an `encodings.dir' file either in the same directory
+as the font file used or in a system-wide location
+(`/usr/X11R6/lib/X11/fonts/encodings/' by default).
+
+The `encodings.dir' file has a similar format to `fonts.dir'. Its first line
+specifies the number of encodings, while every successive line has two
+columns, the name of the encoding, and the name of the encoding file; this
+can be relative to the current directory, or absolute. Every encoding name
+should agree with the encoding name defined in the encoding file. For exam-
+ple,
+
+ 3
+ mulearabic-0 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-0.enc
+ mulearabic-1 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-1.enc
+ mulearabic-2 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-2.enc
+
+The name of an encoding must be specified in the encoding file's `STARTENCOD-
+ING' or `ALIAS' line. It is not enough to create an `encodings.dir' entry.
+
+If your platform supports it (it probably does), encoding files may be com-
+pressed or gzipped.
+
+The `encoding.dir' files are best maintained by the `mkfontdir' utility.
+Please see the mkfontdir(1) manual page for more information.
+
+4.1.4 Format of encoding files
+
+The encoding files are ``free form,'' i.e. any string of whitespace is equiv-
+alent to a single space. Keywords are parsed in a non-case-sensitive manner,
+meaning that `size', `SIZE', and `SiZE' all parse as the same keyword; on the
+other hand, case is significant in glyph names.
+
+Numbers can be written in decimal, as in `256', in hexadecimal, as in
+`0x100', or in octal, as in `0400'.
+
+Comments are introduced by a hash sign `#'. A `#' may appear at any point in
+a line, and all characters following the `#' are ignored, up to the end of
+the line.
+
+The encoding file starts with the definition of the name of the encoding, and
+possibly its alternate names (aliases):
+
+ STARTENCODING mulearabic-0
+ ALIAS arabic-0
+
+The name of the encoding and its aliases should be suitable for use in an
+XLFD font name, and therefore contain exactly one dash `-'.
+
+The encoding file may then optionally declare the size of the encoding. For
+a linear encoding (such as ISO 8859-1), the SIZE line specifies the maximum
+code plus one:
+
+ SIZE 0x2B
+
+For a matrix encoding, it should specify two numbers. The first is the num-
+ber of the last row plus one, the other, the highest column number plus one.
+In the case of `jisx0208.1990-0' (JIS X 0208(1990), double-byte encoding,
+high bit clear), it should be
+
+ SIZE 0x75 0x80
+
+In the case of a matrix encoding, a `FIRSTINDEX' line may be included to
+specify the minimum glyph index in an encoding. The keyword `FIRSTINDEX' is
+followed by two integers, the minimum row number followed by the minimum col-
+umn number:
+
+ FIRSTINDEX 0x20 0x20
+
+In the case of a linear encoding, a `FIRSTINDEX' line is not very useful. If
+for some reason however you chose to include on, it should be followed by a
+single integer.
+
+Note that in most font backends inclusion of a `FIRSTINDEX' line has the side
+effect of disabling default glyph generation, and this keyword should there-
+fore be avoided unless absolutely necessary.
+
+Codes outside the region defined by the `SIZE' and `FIRSTINDEX' lines are
+understood to be undefined. Encodings default to linear encoding with a size
+of 256 (0x100). This means that you must declare the size of all 16 bit
+encodings.
+
+What follows is one or more mapping sections. A mapping section starts with
+a `STARTMAPPING' line stating the target of the mapping. The target may be
+one of:
+
+ o Unicode (ISO 10646):
+
+ STARTMAPPING unicode
+
+ o a given TrueType ``cmap'':
+
+ STARTMAPPING cmap 3 1
+
+ o PostScript glyph names:
+
+ STARTMAPPING postscript
+
+Every line in a mapping section maps one from the encoding being defined to
+the target of the mapping. In mappings with a Unicode or TrueType mapping,
+codes are mapped to codes:
+
+ 0x21 0x0660
+ 0x22 0x0661
+ ...
+
+As an abbreviation, it is possible to map a contiguous range of codes in a
+single line. A line consisting of three integers
+
+ <it/start/ <it/end/ <it/target/
+
+is an abbreviation for the range of lines
+
+ start target
+
+ start+1 target+1
+
+ ...
+
+ end target+end-start
+
+For example, the line
+
+ 0x2121 0x215F 0x8140
+
+is an abbreviation for
+
+ 0x2121 0x8140
+ 0x2122 0x8141
+ ...
+ 0x215F 0x817E
+
+Codes not listed are assumed to map through the identity (i.e. to the same
+numerical value). In order to override this default mapping, you may specify
+a range of codes to be undefined by using an `UNDEFINE' line:
+
+ UNDEFINE 0x00 0x2A
+
+or, for a single code,
+
+ UNDEFINE 0x1234
+
+PostScript mappings are different. Every line in a PostScript mapping maps a
+code to a glyph name
+
+ 0x41 A
+ 0x42 B
+ ...
+
+and codes not explicitly listed are undefined.
+
+A mapping section ends with an ENDMAPPING line
+
+ ENDMAPPING
+
+After all the mappings have been defined, the file ends with an ENDENCODING
+line
+
+ ENDENCODING
+
+In order to make future extensions to the format possible, lines starting
+with an unknown keyword are silently ignored, as are mapping sections with an
+unknown target.
+
+4.1.5 Using symbol fonts
+
+Type 1 symbol fonts should be installed using the adobe-fontspecific encod-
+ing.
+
+In an ideal world, all TrueType symbol fonts would be installed using one of
+the microsoft-symbol and apple-roman encodings. A number of symbol fonts,
+however, are not marked as such; such fonts should be installed using
+microsoft-cp1252, or, for older fonts, microsoft-win3.1.
+
+In order to guarantee consistent results (especially between Type 1 and True-
+Type versions of the same font), it is possible to define a special encoding
+for a given font. This has already been done for the ZapfDingbats font; see
+the file `encodings/adobe-dingbats.enc'.
+
+4.1.6 Hints about using badly encoded fonts
+
+A number of text fonts are incorrectly encoded. Incorrect encoding is some-
+times done by design, in order to make a font for an exotic script appear
+like an ordinary Western text font on systems which are not easily extended
+with new locale data. It is often the result of the font designer's laziness
+or incompetence; for some reason, most people seem to find it easier to
+invent idiosyncratic glyph names rather than follow the Adobe glyph list.
+
+There are two ways of dealing with such fonts: using them with the encoding
+they were designed for, and creating an ad hoc encoding file.
+
+4.1.6.1 Using fonts with the designer's encoding
+
+In the case of Type 1 fonts, the font designer can specify a default encod-
+ing; this encoding is requested by using the `adobe-fontspecific' encoding in
+the XLFD name. Sometimes, the font designer omitted to specify a reasonable
+default encoding, in which case you should experiment with `adobe-standard',
+`iso8859-1', `microsoft-cp1252', and `microsoft-win3.1'. (The encoding
+`microsoft-symbol' doesn't make sense for Type 1 fonts).
+
+TrueType fonts do not have a default encoding. However, most TrueType fonts
+are designed with either Microsoft or Apple platforms in mind, so one of
+`microsoft-symbol', `microsoft-cp1252', `microsoft-win3.1', or `apple-roman'
+should yield reasonable results.
+
+4.1.6.2 Specifying an ad hoc encoding file
+
+It is always possible to define an encoding file to put the glyphs in a font
+in any desired order. Again, see the `encodings/adobe-dingbats.enc' file to
+see how this is done.
+
+4.1.6.3 Specifying font aliases
+
+By following the directions above, you will find yourself with a number of
+fonts with unusual names --- with encodings such as `adobe-fontspecific',
+`microsoft-win3.1' etc. In order to use these fonts with standard applica-
+tions, it may be useful to remap them to their proper names.
+
+This is done by writing a `fonts.alias' file. The format of this file is very
+simple: it consists of a series of lines each mapping an alias name to a font
+name. A `fonts.alias' file might look as follows:
+
+ "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-iso8859-2" \
+ "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific"
+
+(both XLFD names on a single line). The syntax of the `fonts.alias' file is
+more precisely described in the mkfontdir(1) manual page.
+
+4.2 Additional notes about scalable core fonts
+
+The FreeType backend (module `freetype', formerly known as xfsft) is able to
+deal with both TrueType and Type 1 fonts. This puts it in conflict with the
+X-TT and Type 1 backends respectively.
+
+If both the FreeType and the Type 1 backends are loaded, the FreeType backend
+will be used for Type 1 fonts. If both the FreeType and X-TT backends are
+loaded, X-TT will be used for TrueType fonts.
+
+4.2.1 Delayed glyph rasterisation
+
+Both FreeType and X-TT delay glyph rasterisation up to the time at which a
+glyph is first used. For this reason, they only provide an approximate value
+for the ``average width'' font property.
+
+Both backends also support an optimisation for character-cell fonts (fonts
+with all glyph metrics equal, or terminal fonts). A font with an XLFD speci-
+fying a character-cell spacing `c', as in
+
+ -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+
+will not rasterise glyphs at metrics computation time, but instead trust the
+font really to be a character-cell font. You are encouraged to make use of
+this optimisation when useful, but be warned that not all monospaced fonts
+are character-cell fonts.
+
+4.2.2 About the FreeType backend
+
+The FreeType backend (formerly xfsft) is a backend based on version 2 of the
+FreeType library (see the FreeType web site <URL:http://www.freetype.org/>)
+and has support for the ``fontenc'' style of internationalisation (see The
+fontenc layer (section 4.1.1, page 1)). This backend supports TrueType font
+files (`*.ttf'), OpenType font files (`*.otf'), TrueType Collections
+(`*.ttc'), OpenType Collections (`*.otc') and Type 1 font files (`*.pfa' and
+`*.pfb').
+
+In order to access the faces in a TrueType Collection file, the face number
+must be specified in the fonts.dir file before the filename within colons.
+For example,
+
+ :2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+
+refers to face 2 in the `mincho.ttc' TrueType Collection file.
+
+The FreeType backend uses the fontenc layer in order to support recoding of
+fonts; this was described in The fontenc layer (section 4.1.1, page 1) and
+especially FreeType-specific notes about fontenc (section 4.1.2.1, page 1)
+earlier in this document.
+
+4.2.3 About the X-TrueType TrueType backend
+
+The `X-TrueType' backend is a backend based on version 1 of the FreeType
+library. X-TrueType doesn't use the `fontenc' layer for managing font encod-
+ings, but instead uses its own database of encodings.
+
+X-TrueType extends the `fonts.dir' syntax with a number of options, collec-
+tively known as `TTCap'. A `TTCap' entry follows the general syntax
+
+ :option=value:
+
+and should be specified before the filename.
+
+The most useful TTCap option is used to specify the face number to use with
+TTCs; this is the `fn' TTCap option. For example, face 2 of font file `min-
+cho.ttc' is specified using:
+
+ :fn=2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+
+More information on the TTCap syntax, and on X-TrueType in general, may be
+found on the X-TrueType home page <URL:http://x-tt.dsl.gr.jp/>.
+
+5. Appendix: background and terminology
+
+5.1 Characters and glyphs
+
+A computer text-processing system inputs keystrokes and outputs glyphs, small
+pictures that are assembled on paper or on a computer screen. Keystrokes and
+glyphs do not, in general, coincide: for example, if the system does generate
+ligatures, then to the sequence of two keystrokes <f><i> will typically cor-
+respond a single glyph. Similarly, if the system shapes Arabic glyphs in a
+vaguely reasonable manner, then multiple different glyphs may correspond to a
+single keystroke.
+
+The complex transformation rules from keystrokes to glyphs are usually fac-
+tored into two simpler transformations, from keystrokes to characters and
+from characters to glyphs. You may want to think of characters as the basic
+unit of text that is stored e.g. in the buffer of your text editor. While
+the definition of a character is intrinsically application-specific, a number
+of standardised collections of characters have been defined.
+
+A coded character set is a set of characters together with a mapping from
+integer codes --- known as codepoints --- to characters. Examples of coded
+character sets include US-ASCII, ISO 8859-1, KOI8-R, and JIS X 0208(1990).
+
+A coded character set need not use 8 bit integers to index characters. Many
+early systems used 6 bit character sets, while 16 bit (or more) character
+sets are necessary for ideographic writing systems.
+
+5.2 Font files, fonts, and XLFD
+
+Traditionally, typographers speak about typefaces and founts. A typeface is
+a particular style or design, such as Times Italic, while a fount is a
+molten-lead incarnation of a given typeface at a given size.
+
+Digital fonts come in font files. A font file contains the information nec-
+essary for generating glyphs of a given typeface, and applications using font
+files may access glyph information in an arbitrary order.
+
+Digital fonts may consist of bitmap data, in which case they are said to be
+bitmap fonts. They may also consist of a mathematical description of glyph
+shapes, in which case they are said to be scalable fonts. Common formats for
+scalable font files are Type 1 (sometimes incorrectly called ATM fonts or
+PostScript fonts), TrueType and Speedo.
+
+The glyph data in a digital font needs to be indexed somehow. How this is
+done depends on the font file format. In the case of Type 1 fonts, glyphs
+are identified by glyph names. In the case of TrueType fonts, glyphs are
+indexed by integers corresponding to one of a number of indexing schemes
+(usually Unicode --- see below).
+
+The X11 core fonts system uses the data in a font file to generate font
+instances, which are collections of glyphs at a given size indexed according
+to a given encoding.
+
+X11 core font instances are usually specified using a notation known as the X
+Logical Font Description (XLFD). An XLFD starts with a dash `-', and con-
+sists of fourteen fields separated by dashes, for example:
+
+ -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1
+
+Or particular interest are the last two fields `iso8859-1', which specify the
+font instance's encoding.
+
+A scalable font is specified by an XLFD which contains zeroes instead of some
+fields:
+
+ -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1
+
+X11 font instances may also be specified by short name. Unlike an XLFD, a
+short name has no structure and is simply a conventional name for a font
+instance. Two short names are of particular interest, as the server will not
+start if font instances with these names cannot be opened. These are
+`fixed', which specifies the fallback font to use when the requested font
+cannot be opened, and `cursor', which specifies the set of glyphs to be used
+by the mouse pointer.
+
+Short names are usually implemented as aliases to XLFDs; the standard `fixed'
+and `cursor' aliases are defined in
+
+ /usr/X11R6/lib/X11/font/misc/fonts.alias
+
+5.3 Unicode
+
+Unicode (<URL:http://www.unicode.org>) is a coded character set with the goal
+of uniquely identifying all characters for all scripts, current and histori-
+cal. While Unicode was explicitly not designed as a glyph encoding scheme,
+it is often possible to use it as such.
+
+Unicode is an open character set, meaning that codepoint assignments may be
+added to Unicode at any time (once specified, though, an assignment can never
+be changed). For this reason, a Unicode font will be sparse, meaning that it
+only defines glyphs for a subset of the character registry of Unicode.
+
+The Unicode standard is defined in parallel with the international standard
+ISO 10646. Assignments in the two standards are always equivalent, and we
+often use the terms Unicode and ISO 10646 interchangeably.
+
+When used in the X11 core fonts system, Unicode-encoded fonts should have the
+last two fields of their XLFD set to `iso10646-1'.
+
+6. References
+
+XFree86 comes with extensive documentation in the form of manual pages and
+typeset documents. Before installing fonts, you really should read the font-
+config(3) and mkfontdir(1) manual pages; other manual pages of interest
+include X(7), Xserver(1), xset(1), Xft(3), xlsfonts(1) and showfont(1). In
+addition, you may want to read the X Logical Font Description document, by
+Jim Flowers, which is provided in the file `xc/doc/xlfd.PS.Z'.
+
+The latest released version of the XFree86 documentation (including this doc-
+ument and all manual pages) is available as current XFree86 documentation
+<URL:http://www.xfree86.org/current/>.
+
+The comp.fonts FAQ <URL:http://www.netmeg.net/faq/computers/fonts/>, which is
+unfortunately no longer being maintained, contains a wealth of information
+about digital fonts.
+
+Xft and Fontconfig are described on Keith Packard's Fontconfig site
+<URL:http://www.fontconfig.org>.
+
+The xfsft home page <URL:http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/>
+has been superseded by this document, and is now obsolete; you may however
+still find some of the information that it contains useful. Joerg Pommnitz'
+xfsft page <URL:http://www.joerg-pommnitz.de/TrueType/xfsft.html> is the
+canonical source for the `ttmkfdir' utility, which is the ancestor of
+mkfontscale.
+
+The author's software pages <URL:http://www.pps.jussieu.fr/~jch/software/>
+might or might not contain related scribbles and development versions of
+software.
+
+The documentation of X-TrueType is available from the X-TrueType home page
+<URL:http://x-tt.dsl.gr.jp/>.
+
+A number of East-Asian CIDFonts are available from O'Reilly's FTP site
+<URL:ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/>.
+
+While the Unicode consortium site <URL:http://www.unicode.org> may be of
+interest, you are more likely to find what you need in Markus Kuhn's UTF-8
+and Unicode FAQ <URL:http://www.cl.cam.ac.uk/~mgk25/unicode.html>.
+
+The IANA RFC documents, available from a number of sites throughout the
+world, often provide interesting information about character set issues; see
+for example RFC 373.
+
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.20 2003/01/20 03:43:07 dawes Exp $
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.22 2003/01/20 04:10:01 dawes Exp $
diff --git a/hw/xfree86/doc/README.rapidaccess b/hw/xfree86/doc/README.rapidaccess
new file mode 100644
index 000000000..a78dfb9bc
--- /dev/null
+++ b/hw/xfree86/doc/README.rapidaccess
@@ -0,0 +1,48 @@
+The IBM Rapid Access keyboard have some extra buttons
+on it to launch programs, control a cd-player and so on.
+
+These buttons is not functional when the computer is turned
+on but have to be activated by sending the codes 0xea 0x71
+to it.
+
+I've written the following hack to send codes to the keyboard:
+
+--------------------------------------------------------------
+/* gcc -O2 -s -Wall -osend_to_keyboard send_to_keyboard.c */
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/io.h>
+
+int main( int argc, char *argv[] )
+{
+ int i;
+
+ ioperm( 0x60, 3, 1 );
+
+ for( i = 1; i < argc; i++ ) {
+ int x = strtol( argv[i], 0, 16 );
+
+ usleep( 300 );
+ outb( x, 0x60 );
+ }
+
+ return 0;
+}
+--------------------------------------------------------------
+
+As root you can then call this program (in your boot scripts)
+as "send_to_keyboard ea 71" to turn on the extra buttons.
+
+It's not a good idea to run several instances of this program
+at the same time. It is a hack but it works. If you try to
+send other codes to the keyboard it probably will lock up.
+For other codes see:
+
+http://www.win.tue.nl/~aeb/linux/kbd/scancodes-2.html#ss2.22
+
+--
+Dennis Björklund <db@zigo.dhs.org>
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess,v 1.1 2001/05/18 23:35:32 dawes Exp $
diff --git a/hw/xfree86/doc/changelogs/CHANGELOG b/hw/xfree86/doc/changelogs/CHANGELOG
new file mode 100644
index 000000000..732330eec
--- /dev/null
+++ b/hw/xfree86/doc/changelogs/CHANGELOG
@@ -0,0 +1,16588 @@
+XFree86 4.3.0.2 (xx May 2003)
+
+XFree86 4.3.0.1 (9 May 2003)
+ 987. Fix a FreeBSD/alpha build problem (#5679, Fred Clift).
+ 986. Fix SiliconMotion driver for mode switching and SEGV problem when
+ initializing Xv functionality (Bugzilla #50, Alan Hourihane).
+ 985. Fix a SEGV that can happen with Riva128 cards (Mark Vojkovich).
+ 984. Prevent a SIGFPE with the glint/pm3 driver when attempting to display
+ an XVideo image less than 8 pixels wide (Måns Rullgård).
+ 983. Fix double free bug when a Mac-specific font fails to load with
+ Freetype (Torrey T. Lyons).
+ 982. Check for NULL tObj in the i830 3D driver's TexEnv function. This
+ fixes a FlightGear crash (Keith Whitwell).
+ 981. Fix lockup on server reset in radeon driver
+ (Michel Dänzer, Keith Whitwell).
+ 980. Set Mesa hooks to flush vertices on state changes in Radeon 3D drivers
+ (Keith Whitwell).
+ 979. Fix to prevent PCI and CardBus resets when switching out of the server's
+ virtual console (Marc La France).
+ 978. Fix infinite loop that occurs on systems whose PCI configuration space
+ doesn't advertise a host bridge (Marc La France).
+ 977. Workaround for broken devices that don't implement the header type field
+ in their PCI configuration space (Marc La France).
+ 976. Fix programming error in ix86 motherboard chipset determination
+ (Marc La France).
+ 975. Fix bug in mode validation that occurs when the XF86Config doesn't
+ specify any mode or virtual resolution information (Marc La France).
+ 974. Another int10 fix. This time for adapters found at PCI:0:0:0. This
+ fix is particularly important for ZX1-based systems (Marc La France).
+ 973. int10 fix for all ix86 non-Linux systems (Marc La France).
+ 972. Fix compatibility problem between modules generated without the recent
+ setjmp/longjmp work and a server generated using glibc <= 2.2.*
+ (Marc La France).
+ 971. setjmp/longjmp related fixes for Linux/libc5 systems (Marc La France).
+ 970. Make setjmp/longjmp emulation save/restore blocked signal masks on all
+ libc5 & glibc systems (Marc La France).
+ 969. Fix setjmp/longjmp emulation for glibc 2.2.[01] systems and remove
+ HasGlibc21Sigsetjmp override (Marc La France).
+ 968. setjmp/longjmp-related compilation fixes for libc5 systems
+ (Marc La France).
+ 967. Fix possible overflow in _XlcLocaleDirName. (Matthieu Herrb).
+ 966. Fix XDarwin build broken by #960 (Shantonu Sen).
+ 965. Fix StaticColor colormap on Darwin/x86 6.x (Rob Braun).
+
+XFree86 4.3.0 (27 February 2003)
+ 964. Add an imake option to allow the glibc21-style setjmp() behaviour
+ to be forced when auto-detecting it fails (this is needed for RH 7.0).
+ 963. Add missing raise/lower volume key descriptions for the "hpxe3gc"
+ XKB map (#A.1651, Paul Pacheco).
+ 962. Fix some typos in the Syriac XKB map (#5654, Emil Soleyman-Zomalan).
+ 961. Add documentation about using XKB for the XFree86 server's special
+ key sequences and the HandleSpecialKeys config option (#5653, Joe Moss).
+ 960. Move the XF86_DATE definition to a separate file so that bumping it
+ doesn't trigger almost everything to be rebuilt (David Dawes).
+ 959. Xterm patch #174 (Thomas Dickey).
+ 958. Fix a bug that was preventing DGA2 acceleration from being advertised
+ by the i810 driver (David Dawes).
+ 957. Fix an "xtt" font backend module crash that shows up on Linux/PPC,
+ related to an invalid code converter module being loaded because of
+ a broken string comparison in xttconv.c (#A.1647, Chisato Yamauchi,
+ Daisuke MASATSUNA).
+ 956. Fix a NULL dereference that can happen in lcGenConv.c (#A.1646,
+ Anthony Fok Tung-Ling).
+ 955. Bump the libXft minor revision for the UTF-16 APIs that were added
+ after rev 2.0 (#A.1643, A.1644, Keith Packard, 5652, Mike Harris).
+ 954. Fix a typo in the "freetype" font backend that prevents "ttc" fonts
+ from working (#5651, Mike Fabian).
+ 953. Fix atimisc bug in restoring colourmaps after a VT switch
+ (Marc La France).
+ 952. A more complete set of dead accent/space compose sequences, add
+ <Multi_key> <slash> for letters with a "stroke", and add some
+ combos for exponent characters, katakana voiced sounds, etc to
+ the en_US.UTF-8 compose file (#5646, David Monniaux).
+ 951. Reinstate the VBEInit() call in the savage driver's PreInit(). This
+ appears to fix a problem on some Savage MX platforms (#5649,
+ Mike Harris).
+ 950. Restore the radeon driver's unconditional RADEONPreInt10Save() call
+ on Alpha platforms because this is needed for Radeon cards where the
+ BIOS ROM can't be read after it's been run once (by the firmware)
+ without this (#5648, Jeff Wiedemeier).
+ 949. Update Newport driver doc (#5647, Guido Guenther).
+ 948. Fix reversed logic for VGA locking/unlocking (Nat Ersoz).
+ 947. Luit fixes:
+ - Fix a bug with --encoding being too strict with the syntax.
+ - Add a -x flag that causes luit to exit as soon as the child does.
+ - Update the man page to synchronise with Tomohiro's work on XTerm.
+ (#5643, Juliusz Chroboczek).
+ 946. Fix some endianness bugs in the r200 DRI driver, and guard a debugging
+ print message (Michel Dänzer).
+ 945. Fix radeon HW cursor artifacts when switching between 2-color and
+ ARGB cursors by always using the ARGB mode (#A.1639, Michel Dänzer and
+ Fredrik Höglund).
+ 944. Fix rootless XDarwin crash when trying to GetImage with a rectangle
+ bigger then the associated top level window (Apple).
+ 943. Add support for multi-head on ZX1-based Itanium2 systems (Marc La France
+ with documentation and assistance from Hewlett-Packard).
+ 942. Correctly initialize the RE_LINE_PATTERN register in the radeon
+ and r200 DRI drivers (Keith Whitwell).
+ 941. Fix a problem where a malformed Ximage can cause Xcursor to step
+ outside the image data (#A.1636, Keith Packard, reported by
+ Michel Dänzer).
+ 940. Allow xf86setjmp/xf86setlongjmp to work with platforms where
+ setjmp() isn't directly available as a function, specifically Linux
+ platforms that use glibc 2.0 and 2.1. (David Dawes, Keith Packard).
+ 939. Check pScrn->vtSema before calling xf86SetCursor() from
+ xf86CursorCloseScreen(). This avoids a segfault at exit with some
+ drivers (Alan Hourihane).
+ 938. Fix adding FP native mode for Radeon (Hui Yu@ATI, Kevin Martin).
+ 937. Initialize I2C when primary head has an invalid DDC type for the
+ Radeon driver (Hui Yu@ATI).
+ 936. Video fixes for TV and TVOverscan for the nsc driver (Sarma Kolluru).
+ 935. Fix to prevent ShadowComposite() to try to update the framebuffer
+ when server is switched away (Egbert Eich).
+ 934. Fix problems where the ThirdLevel key and Alt modifiers don't work
+ when a map that uses the ThirdLevel virtual modifier is not the first
+ layout in a multi-layout configuration (#5642, Ivan Pascal).
+ 933. Use safe values in the Thai XIM which should work regardless of
+ the signedness of XIMStringConversionPosition (#A.1628,
+ Theppitak Karoonboonyanan).
+ 932. Replace xf86setjmp/xf86setlongjmp with symbol aliases that resolve
+ directly to the native libc versions so that they can operate in
+ modules, and make xf86jmp_buf much larger so that should be big enough
+ for any reasonable CPU/OS combination. This should fix problems
+ with the Freetype2-based freetype font module (#A.1625, Keith Packard).
+ 931. Change the default base symbols map from pc104 to pc105, which should
+ fix most cases where the <LSGT> key isn't defined. Also change the
+ default XkbModel from pc101 to pc105 (Ivan Pascal).
+ 930. Fix run-time enabling/disabling of VT switching via xf86EnableVTSwitch()
+ (David Dawes).
+ 929. Add a "DontVTSwitch" option to allow VT switching to be disabled
+ (on platforms where the X server initiates VT switches) (#5640,
+ Branden Robinson).
+ 928. Fix a memory leak in _XimExtension() (#5638, MINAMI Hirokazu).
+ 927. Fix hard-coded ProjectRoot paths in the proxymngr man page (#5634,
+ Branden Robinson).
+ 926. Fix a NULL pointer dereference in the fontenc library (#5633, Debian).
+ 925. Update the neomagic man page to document the OverlayMem option (#5632,
+ Diego Santa Cruz and Branden Robinson).
+ 924. Fix a memory leak in XCloseDisplay, and a potential race condition
+ when multiple threads attempt to initialize the Xcursor library
+ simultaneously (#A.1623, Keith Packard).
+ 923. Fix xvidtune to pop up a info window if mode on chipset is
+ not tuneable (Egbert Eich).
+ 922. Fix a NULL pointer in a var_arg list in xfd which causes problems
+ on 64 bit systems (Egbert Eich).
+ 921. Fix a typo in the nsc Imakefile when installing the linkkit
+ (#A.1624, Stanislav Brabec).
+ 920. Remove a dependency on how Xlib buffers requests internally for
+ xtest's test 2 of XSync (Keith Packard).
+ 919. Fix a bug in the way the bitmap font code calculates mix/max bounds
+ (it was ignoring empty characters), which fixes some xtest fonts
+ bounds check failures (Keith Packard).
+ 918. Check that the HW cursor has been setup before calling
+ xf86ForceHWCursor() in the radeon (and r128) driver. This fixes
+ crashes when using only the SW cursor (#5628, Michel Dänzer).
+ 917. Fix duplicate arguments for xf86MatchPciInstances() in the DESIGN doc
+ (#5627, Guido Guenther).
+ 916. Miscellaneous 64-bit and warning fixes to mfb, xf1bpp and xf4bpp
+ (Marc La France).
+ 915. Fix a bug in beforelight that was preventing it from being restarted
+ and could cause random X clients to be killed. (Matthieu Herrb)
+ 914. Add a means by which a motherboard chipset driver can prevent the common
+ layer's check for mis-configured PCI-to-PCI bridges (Marc La France).
+ 913. Fix bug that would sometimes cause an extra hardware cursor to re-appear
+ on a secondary head after a server reset (Marc La France).
+ 912. Protect "cvl" references in recent changes to _XEventsQueued() with
+ '#ifdef XTHREADS' (reported by Dan Holm).
+
+XFree86 4.2.99.902 (17 February 2003)
+ 911. Change the newport driver to use ShadowFBInit2 to fix the broken
+ "switching back from the console" issue, and update the driver's man
+ page (#5625, Guido Guenther).
+ 910. SCO doc update (#5624, J. Kean Johnston).
+ 909. Fix X11.tmpl so that Fontconfig works correctly if an OS.cf file
+ sets HasFontconfig, and do this in sco5.cf (#5624, J. Kean Johnston).
+ 908. Move the vbe module from xfree86/os-support/ to xfree86/ (David Dawes).
+ 907. Some changes to the os-support kbd driver layer's calling conventions
+ to provide more flexibility (#A.1615, Zephaniah E. Hull).
+ 906. Fix a crash in the "xtt" font module caused by a NULL dereference
+ when the font cache becomes full (#A.1611, Chisato Yamauchi and
+ tokeijikakenoringo).
+ 905. Update the list of DRI-supported Radeon hardware (#A.1610,
+ Knut J Bjuland).
+ 904. Fix a problem in _XEventsQueued() that causes an event reader lock
+ of another thread to be released. This can cause a hang and keyboard
+ lockup in KDE (#5619, Ewald Snel).
+ 903. Fix some bugs with Xft drawing to non-Render enabled servers:
+ - Drawing monochrome glyphs had an infinite loop.
+ - XftGlyphSpecCore failed to render some glyphs, leading to application
+ crashes from uninitialized values.
+ (#A.1608, Keith Packard, reported by Nalin Dahyabhai).
+ 902. Fix the <BKSL> key in the "winkeys" variants of the Russian and
+ Ukrainian XKB maps (#5624, Leon Kanter).
+ 901. Install the XKB README files (#5623, Ivan Pascal).
+ 900. Add the numeric keys row to the pc/us symbols map (#5622, Ivan Pascal).
+ 899. Resync with DRI mesa-4-0-4 branch:
+ - Fix DOT3 texture combine env in the r200 driver (Ian Romanick).
+ - Fix SW TCL path in the radeon driver (Felix Kühling).
+ - Don't assert for FLUSH_STORED_VERTICES if a glBegin hasn't been
+ emitted (Alan Hourihane).
+ 898. Another update to the fix for the client-side DRI cleanup code that
+ should fix references to freed data, an fix a potential memory leak
+ (Leif Delgass).
+ 897. Fix the behaviour of XLookupString() when XKB is enabled in Xlib
+ but not the server. This fixes an xtest XRebindKeysym() failure
+ (David Dawes).
+ 896. Added radeon driver options documentation to the Options file
+ (#5621, Michel Dänzer).
+ 895. Fix the return value of SetFontPath() when a font path element is bad
+ (David Dawes).
+ 894. Add some more HP keyboard layouts (Peter Soos).
+ 893. Remove XFree86-specific keysyms that already have generic equivalents
+ (Menu, Redo, Print, Undo).
+ 892. Add keyboard layout information for the HP 5181 Internet/Multimedia
+ keyboard (#A.1603, John Mitchell).
+ 891. Fix a problem where two-color render cursors have extra pixels set
+ (#A.1607, Keith Packard).
+ 890. Fix for corruption when using video modes requiring more than 2MB on
+ S3 968 cards (#A.1602, Justin T. Gibbs).
+ 889. Fix TVoverscan problems on the NSC SC1200 chip (Sarma Kolluru).
+ 888. Cure cursor artifacts by setting HARDWARE_CURSOR_SHOW_TRANSPARENT and
+ HARDWARE_CURSOR_UPDATE_UNHIDDEN in the r128 and radeon drivers. The
+ wait-for-VSync nonsense the Radeon's currently do can, and should, be
+ ripped out later. (Marc La France).
+ 887. Extend HARDWARE_CURSOR_SHOW_TRANSPARENT to make hardware cursors
+ transparent, rather than disabling them, when a switch to a software
+ cursor is needed. This removes recently introduced cursor artifacts
+ in the atimisc driver. (Marc La France).
+ 886. Cancel repeat for switch screen XKB actions, which fixes a VT
+ switching problem that has just become visible (Ivan Pascal).
+ 885. Added reinitialization of screen layout after RandR size change
+ on a multihead setup. This keeps cursor movement beween screens
+ working (Egbert Eich).
+ 884. Remove Xcms.txt entries that have server-side equivalents. It looks
+ like the slightly different resulting colour definitions from the
+ Xcms.txt entries were responsible for an xtest failure.
+ 883. Fix some problems with using pre-existing version of fontconfig,
+ freetype2 and expat (#A.1600, Keith Packard).
+ 882. Add missing zero-sized check to one of Xft's core rendering routines
+ (#A.1599, Keith Packard).
+ 881. Add a missing symbol reference to the radeon driver (#5618, Mike Harris).
+ 880. Fix the Xcursor include path in the man page (#5617, Kevin Brosius).
+ 879. Update ViRGE documentation (#5617, Kevin Brosius).
+ 878. Fix mkfontscale so that it doesn't include characters forbidden in XLFD
+ in the names it generates (#5616, Mike Fabian and Juliusz Chroboczek).
+ 877. Fix a rounding problem in the "freetype" module, which fixes the problem
+ worked around in entry 864 below (#5615, Juliusz Chroboczek).
+ 876. Fix incorrect alias for lv_LV.iso885913, and add some missing lv_LV
+ aliases (#5614, Aivils Stoss).
+ 875. Fix a bug where xauth may write an incomplete authority file and delete
+ the old one if there is insufficient disk space (#5612, Harald Hoyer).
+ 874. DPMSClose() wasn't correctly setting its devPrivate to NULL (based
+ on #A.1594, Denis Zaitsev).
+ 873. Fix scanpci's printing of routing information for PCI-to-PCI bridges
+ (Marc La France).
+ 872. Bring Cygwin/XFree86 up-to-date (#5613)
+ - Multiwindow Window Manager (Kensuke Matsuzaki).
+ - Clipboard integration (Harold Hunt).
+ - Remove unnecessary redefines of fchown/fchmod (Takashi Sawanaka)
+ - Fix some NULL pointer problems on screen changes (Alexander Gottwald).
+ 871. Fix some problems when noaccel is used in the nsc driver (Sarma Kolluru).
+ 870. Fix acceleration bugs in the nsc driver (Sarma Kolluru).
+ 869. Change initMouseHW() to always return TRUE, which restores the older
+ more graceful behaviour (Egbert Eich).
+ 868. Revert the DestroyContext, GarbageCollectDrawables reording in
+ dri_util.c, and instead check if the drawable is known to the DRI
+ client code before calling XF86DRIGetDrawableInfo (Egbert Eich).
+ 867. Fix some scaling problems with the updated whiteglass cursor icons,
+ fixing some incorrect hotspots (Kevin Puetz).
+ 866. The sunffb driver was treating a function with a void return value
+ as if it had a Bool return value. This causes the driver to fail
+ in some cases (#A.1588, Ferris McCormick).
+ 865. Add private keysyms for the new XKB actions (XFree86 special keys),
+ and move those actions to an XKB compatibility map. This fixes
+ side-effects (loss of auto-repeat and mousekeys functionality) of
+ the way this was implemented previously (#5610, Ivan Pascal).
+ 864. Fix an X server crash with the "freetype" module when displaying
+ kochi-mincho.ttf at a size of 18 pixels or higher (Chisato Yamauchi).
+ 863. Fix segfault in XkbInitKeyboardDeviceStruct() (David Dawes).
+ 862. Add a ServerFlags/ServerLayout option for disabling the RandR extension
+ (David Dawes).
+ 861. Resync with DRI mesa-4-0-4 branch:
+ - Correct RADEON_MAX_TCL_VERTSIZE and set MaxArrayLockSize
+ (Keith Whitwell).
+ - Fix EAGAIN handling in radeon_cp_dispatch_texture(), which fixes
+ corruption of large textures (Michel Dänzer).
+ - Fix bufferSize and alphaMask for DRI in several drivers (Brian Paul,
+ Leif Delgass).
+ - Avoid a loop on validating destroyed drawable (Keith Whitwell).
+ - Reorder DestroyContext, GarbageCollectDrawables to avoid error
+ (Egbert Eich).
+ - Remove untested BSD DRM vlank signal code (Eric Anholt).
+ - Update Radeon PCI IDs for BSD drm driver (Eric Anholt).
+ - Uninitialize mutexes on cleanup in the BSD drm driver, which
+ fixes panics with FreeBSD-5.0 with WITNESS (Eric Anholt).
+ - Remove the untested/unused gamma DRM driver for BSD (Eric Anholt).
+ 860. Fix byte swapping of the refresh rate argument to RandR's
+ SetScreenConfig request, and fix a 1.0 client compatibility problem
+ with SetScreenConfig (#A.1574, Keith Packard).
+ 859. The i810 driver wasn't releasing control of the agpgart when VT switching
+ away for the 830M and later (David Dawes).
+ 858. Update Rage 128 and Radeon PCI IDs (Mike Harris).
+ 857. Fix vertical retrace to not interfere with interrupt handling
+ (#5608, Michel Dänzer).
+ 856. Add M9 DRI support (Hui Yu@ATI).
+ 855. Update Radeon man page (Michel Dänzer).
+ 854. Add Radeon man page (Hui Yu@ATI).
+ 853. Use strtol instead of atoi in xf86cfg 'expert' mode. Make pauses
+ when printing keyboard models in xf86config (#5609, Chisato Yamauchi).
+ 852. Xterm patch #173 (Thomas Dickey).
+ 851. Don't use XkbGetKeyboard() in xset, just use XkbAllocKeyboard()
+ (Ivan Pascal).
+ 850. Fixes for the nsc driver for HW cursor hotspots and GX2 video
+ clipping issues (Sarma Kolluru, NSC).
+ 849. Fix HW cursor on CRTC2 for SiS650+301B (Thomas Winischhofer).
+ 848. Update the i810/i830 driver to recognise the 865G integrated graphics
+ chipset (David Dawes).
+ 847. Updates for the nsc driver (Sarma Kolluru, NSC).
+ 846. Fixed dual head for 1400x1050 displays (Thomas Winischhofer).
+ 845. Initializing clock ranges in several drivers to get rid of the
+ annoying 'scaled from 0.0 MHz' message in xf86PrintModes()
+ (Egbert Eich).
+
+XFree86 4.2.99.901 (4 February 2003)
+ 844. Fixing a double free in libXRandr (Egbert Eich).
+ 843. The microsoft-win3.1 encoding file wasn't being installed (#A.1569,
+ Mike Harris).
+ 842. Sync the FIFO in the vmware driver after defining an ARGB cursor
+ (#5607, Nolan Leake).
+ 841. Add missing Num_Lock and Scroll_Lock modifiers to the jp XKB map
+ (Chisato Yamauchi).
+ 840. Change the default cursor theme to "core".
+ 839. Fix some keys in the Slovenian (si) XKB map (David Balazic,
+ Henrik Nordström).
+ 838. Add a check to xset for a NULL return from XkbGetKeyboard()
+ (Tapani Utriainen).
+ 837. Resync with DRI mesa-4-0-4 branch:
+ - radeon DRM: only acknowledge interrupts we handle -- others could
+ be used outside the DRM (Michel Dänzer).
+ - Fix PCI and AGP posting problems (based on testing by Chris Ison
+ and suggestions by Benjamin Herrenschmidt and Arjan van de Ven).
+ - Remove radeon_flush_write_combine() which has been unused for a while
+ (Michel Dänzer).
+ - Disable strict aliasing when building the DRM (Michel Dänzer).
+ 836. Fix xfs crash on Darwin by making libXfont a flat namespace image
+ (Torrey T. Lyons).
+ 835. Avoid endless loop when initializing an PS/2 mouse behind a
+ repeater (Egbert Eich).
+ 834. Radeon driver: make sure RADEONCPStop() is only called when
+ RADEONCPStart() has been called before. Failing to do so may
+ make the kernel driver oops (Egbert Eich).
+ 833. Disabling MMX, 3DNow and SSE support for x86-64 as the function
+ call sequence is hardcoded to ia32 (Egbert Eich).
+ 832. Fix a hang in multi-thread mode caused by a missing UnlockDisplay() in
+ XkbGetMapChanges() (Jose Luu).
+ 831. Resync with DRI mesa-4-0-4 branch:
+ - Don't inflate relative vblank sequence numbers on repeated calls
+ (e.g., when interrupted by a signal) (Michel Dänzer).
+ - Fix size of VERTEX2 ioctl struct (Egbert Eich).
+ 830. SiS driver fixes:
+ - Mode restoration fix.
+ - Xv Hue and Saturation property fixes (310/325 series).
+ - Built-in mode fixes.
+ - Revert wrong bus width assumptions from previous patch.
+ (Thomas Winischhofer).
+ 829. R128 build fix on big endian platforms (#A.1565, George Staikos).
+ 828. Updated whiteglass cursor icons that fix the resizing glitches in the
+ existing ones (#A.1563, Kevin Puetz).
+ 827. Include server control definitions in some XKB maps that were missing
+ them (based on #A.1562, Jens Petersen).
+ 826. Define Alt/Meta modifiers for the jp106 XKB layout, and include
+ server control definitions (#A.1562, Jens Petersen).
+ 825. Add some locales required for the OpenI18N compliance test (#A.1550,
+ Leon Ho).
+ 824. s3virge driver updates:
+ - 320x240 doublescan support with mouse adjust.
+ - Power management printouts, DAC error printout fix.
+ - Log XVideo status based on chipset, and preliminary support for
+ disabling XV when a mode doesn't support it.
+ (#A.1550, Kevin Brosius).
+ 823. Add an Ethiopic TTF and OTF font (#A.1549, Daniel Yacob).
+ 822. Add a phonetic layout to the Bengali XKB map (#5606, Taneem Ahmed).
+ 821. Work around an AGP bug in the AlphaServer ES45 by padding each ring
+ buffer packet in the radeon drm with NOPs to cache line boundaries.
+ This is only done for Alpha platforms (#5605, Jeff Wiedemeier).
+ 820. Add missing domain decoding to DRM(irq_busid) for Alpha (#5604,
+ Jeff Wiedemeier).
+ 819. Build fix for the DRM on FreeBSD 5.0-current (#5603, Eric Anholt).
+ 818. xaaStateChange.c was not calling RestoreAccelState before doing
+ CPUToScreenTexture and CPUToScreenAlphaTexture, which seems to be the
+ reason why RENDER acceleration was broken on some dual-monitor MGA cards
+ (#5602, Nolan Leake).
+ 817. Make the vmware driver a little more conservative about supporting
+ HW RGBA cursors in 8-bit modes (#5606, Nolan Leake).
+ 816. Work around a problem with the vmware driver's interaction with the
+ offscreen memory manager (#5606, Nolan Leake).
+ 815. Fix fb's rotation of tiles and stipples when using non-zero PixOrigin
+ macros (Torrey T. Lyons).
+ 814. Fix Radeon native FP mode initializion (Hui Yu@ATI).
+ 813. Resync with DRI mesa-4-0-4 branch:
+ - Fix Q3A mode change prolbem in thr r200 driver (Keith Whitwell).
+ - Add a missing break to prevent spurious GL_INVALID_ENUM
+ (Leif Delgass).
+ - Fix __FUNCTION__ usage in the ffb 3D driver (Leif Delgass).
+ - Limit the number of pending vblank signals to 100 to prevent
+ a DoS (Michel Dänzer).
+ - Fix a void * arithmetic warning in the radeon DRM driver
+ (Leif Delgass).
+ 812. Fix a typo in the "pl2" XKB map (#A.1553, Piotr Xurek).
+ 811. Fix a null dereference in Mesa that can cause an X server crash at
+ client exit (#A.1548, Ezra Peisach).
+ 810. Improve the XTT code that prevents unexpected data to be passed to
+ XAA (#5600, Chisato Yamauchi).
+ 809. xkbcomp/rules/xfree86.xml wasn't being installed (#5599, Ivan Pascal).
+ 808. Add knowledge about two Korean foundries to mkfontscale (#5598,
+ Jungshik Shin).
+ 807. Disable the INREG fallbackup in the radeon 3D driver on Alpha because
+ it references a function that's not availalbe (#5596, Jeff Wiedemeier).
+ 806. Fixed patch 760: VBEInit takes entity index, not screen index
+ (Egbert Eich).
+ 805. Card name changes/fixes (Hui Yu@ATI).
+ 804. Panel color channel depth fix for Radeons (Hui Yu@ATI).
+ 803. Include list_for_each_safe define for kernels that do not have it
+ (Kevin Martin).
+ 802. Fix 2D corruption around 3D window, when 3D window is moving and using
+ Radeon page flipping code (Michel Dänzer).
+ 801. Big endian fixes for Rage 128 and Radeon video and Radeon cursor code
+ (Michel Dänzer).
+ 800. Enable PCI GART for all architectures (still gated by ForcePCIMode, if
+ on an AGP card) (Michel Dänzer).
+ 799. Fix for Radeon's CP accelerated 2D sync routine (Michel Dänzer).
+ 798. SiS driver fixes:
+ - Fix for SiS730+LVDS machines (display modes restricted due to
+ hardware limits; LCD text mode restoration fixed)
+ - Fix for SiS300 bus width detection
+ - Fix for Fn+Fx output device switching on some machines (still
+ does not work on all)
+ - Numerous Dual Head fixes
+ - Added color hardware cursor support on 300/310/325/330 series
+ - Added PAL-M and PAL-N support for Chrontel 701x
+ - Added ModeLine handling for 300/310/325/330 series (CRT1 only)
+ (Thomas Winischhofer).
+ 797. Fix for memory fences on PowerPC (Marc La France).
+ 796. Work-around for Radeon int10 problems (Marc La France).
+ 795. Fix XDarwin crash in rootless mode with 16-bit color by ensuring that
+ window pixmap pointers are 32-bit aligned (Apple, Torrey T. Lyons).
+ 794. Update the i810 2D driver and i830 3D drivers to recognise and handle
+ the Intel 852GM/855GM integrated graphics chipsets (David Dawes,
+ Keith Whitwell).
+ 793. Force extension-generated mode switches always occur (Marc La France).
+ 792. Fix OS/2 library build problem (Frank Giessler).
+ 791. Fix bug that at times prevented recognition of resources decoded on PCI
+ root busses (Marc La France).
+ 790. Fix XDarwin's spurious transparent regions in rootless windows
+ (Torrey T. Lyons).
+ 789. Fix bug in recognition of certain ix86 Host-to-PCI bridges
+ (Marc La France).
+ 788. Fix for breakage in reading the serial PnP mouse ID string (David Dawes).
+ 787. Add "core" theme to Xcursor to force old behaviour (Keith Packard).
+ 786. Increase the default font cache size so that it works better for
+ iso10646 (#A.1541, Hidetoshi Yamanouchi, Chisato Yamauchi).
+ 785. Fix an XTT problem where garbage is displayed when there are undefined
+ glyphs for fixed width fonts, and fix some other potential problems
+ (#A.1541, Hidetoshi Yamanouchi, Chisato Yamauchi).
+ 784. Resync symbols/fi with symbols/pc/fi (#A.1532, Marko Myllynen,
+ #5589, Linus Torvalds).
+ 783. Resync xkb/rules/xfree86.xml with xfree86.lst (#5595, Ivan Pascal).
+ 782. ISO_Level3_Shift was breaking compose sequences because Xlib wasn't
+ recognising it as a modifier key (#5594, Ivan Pascal).
+ 781. Add a Lao (lo) XKB map (#5592, Anousak Souphavanh).
+ 780. Add a multi-layout version of the Malayalam keymap (#5593, Ivan Pascal).
+ 779. Add some missing entries to the xkb rules $oldlayouts and $nonlatin
+ sets (#5593, Ivan Pascal).
+ 778. Prevent mkfontscale from looking at bitmap fonts, and ensure that it
+ doesn't crash if a font happens to have no head (#5591,
+ Juliusz Chroboczek).
+ 777. Document that DVI the mga_hal module may be necessary to use the DVI
+ output with the G550 and other cards (#5590, Andrew Aitchison).
+ 776. Fixes for a few "nodeadkeys" XKB maps (David Dawes).
+ 775. Protect magic cookie from short-lived exposure on command line in
+ startx (Christian Biere).
+ 774. Fix ELF loader to ignore -g debugging information
+ (#A.1539, Juergen Keil).
+ 773. Fix artifacts left by XDarwin when reshaping a shaped window (reported
+ by Adrian Umpleby).
+ 772. Fix XDarwin rootless crash when resizing a window (Apple).
+ 771. Fix vbe module to not assume BIOS call results are zero-extended
+ (Paulo Cesar Pereira de Andrade).
+ 770. Fix improper initialisation of pciConfigRec's. Reported by Marcel
+ Moolenaar (Marc La France).
+ 769. Fix intermittent XDarwin crash on Mac OS X 10.1.x when changing cursors
+ on dual processor machines (Torrey T. Lyons).
+ 768. Correction to 'is' keymap (reported by Richard Allen).
+ 767. Fix GLX library mis-use of LockDisplay()/UnlockDisplay() sequences
+ (reported by Alexis Vartanian).
+
+XFree86 4.2.99.4 (20 January 2003)
+ 766. Fix XDarwin's rootless mode with 16-bit color (Apple).
+ 765. Allow UTF8 conversion to work for Japanese locales (#A.1527,
+ Etsushi Kato).
+ 764. Add a method for working around a problem that can show up when
+ running setxkbmap from a machine with a different version of XKB
+ than the X server. The workaround method is documented in
+ the setxkbmap(1) man page (#5588, Ivan Pascal).
+ 763. Add some new keys and key combinations that can be used for switching
+ between XKB groups (#5587, Ivan Pascal).
+ 762. Fix typos in the README.fonts document (#5585, John Himpel,
+ Juliusz Chroboczek).
+ 761. Fix the pc/fi and pc/il XKB maps after recent changes made them
+ non-compliant with the multi-layout scheme (#5581, Ivan Pascal).
+ 760. Allow the mga driver to fallback to using VBE for DDC when using
+ the native method fails. This allows DDC to work for DVI output
+ on Matrox cards (#5580, Andrew Aitchison).
+ 759. Add block handler for XDarwin's quartz modes to clean up any
+ autoreleased objects in the server thread (Torrey T. Lyons).
+ 758. Fix use of uninitliazed variable in xmag/xmag.c (A.1525, Keith Packard).
+ 757. Fix typo in Radeon Mono8x8 code (#A.1526, Juergen Keil).
+ 756. PS/2 mice initialization sequence changed: rerun entire sequence
+ when something goes wrong - this needs to be rewritten completely
+ after 4.3 is out (Egbert Eich).
+ 755. Savage driver: disable HW cursor on stretched LCD displays,
+ let SaveScreen and DGA test if HW cursor is on before
+ disabling/reenabling it (Egbert Eich).
+ 754. Fixed VBE EDID read: due to a missing register setting read
+ ended in endless loop on certain systems (Egbert Eich).
+ 753. Changed the default mouse device for FreeBSD to sysmouse and the
+ protocol to auto when running X -configure (#5584, Eric Anholt).
+ 752. Changed the default mouse device for xf86cfg and xf86config to
+ /dev/sysmouse for FreeBSD (#5582, #5583, Eric Anholt).
+ 751. Fix for Mono8x8 patterns on Radeon (#A.1520, Juergen Keil, Kevin Martin).
+ 750. Fix for Radeon mode validation (#A.1330, #A.1380, #A.1393, #A.1522,
+ #A.1523, Wayne Whitney, Hui Yu@ATI, Juergen Keil).
+ 749. Workaround for flickering problem with switching between ARGB and mono
+ cursors on Radeons (#A.1380, Hui Yu@ATI).
+ 748. DDCMode fix for VidMode extension (#A.1380, Kevin Martin, Hui Yu@ATI).
+ 747. Panel detection bug fix for Radeon (#A.1380, Hui Yu@ATI).
+ 746. Add Xv overlay support for dual headed Radeons (#A.1380, Hui Yu@ATI).
+ 745. Fix Radeon driver's 24-bit support for flat panels (#A.1380, Hui Yu@ATI).
+ 744. Add Radeon 9500/Pro support (#A.1380, Hui Yu@ATI).
+ 743. Disable CGWorkaround for non-A11 rev R300s (Kevin Martin, Hui Yu@ATI).
+ 742. Radeon solid/dashed line fix for RV200 and newer card (Kevin Martin).
+ 741. Radeon overlay gamma fix (Hui Yu@ATI).
+ 740. Radeon LG panel fix (Hui Yu@ATI).
+ 739. Change makedepend to warn about any whitespace it finds in front of
+ pre-processor directives (Marc La France).
+ 738. Missing deadkeys in UTF-8 compose table (Mike Fabian).
+ 737. Build fix for SPARC (Thorsten Kukuk).
+ 736. Fixed integer address value in vesa driver to be large enough
+ to hold a 64 bit memory address (Andreas Schwab).
+ 735. Disabled RENDER accel on Matrox when used in multihead mode
+ (Stefan Dirsch).
+ 734. Added FireGL 8700/8800 to the list of supported cards or RADEON
+ driver (Stefan Dirsch).
+ 733. Added -mcmodel=kernel to DRM Makefile for x86_64 (Stefan Dirsch).
+ 732. Added vesa and fbdev driver to x86_64, removed nsc driver for ia64 build
+ (Stefan Dirsch).
+ 731. Fixing comments in th_TH.UTF-8 (Stefan Dirsch).
+ 730. Fixes from the DRI CVS:
+ - Don't segfault when spec or fog stride is 0.
+ - Don't set RADEON_SURF_TRANSLATION_DIS for framebuffer aperture
+ byte swapping on big endian machines; doesn't work with R200 and
+ later chips.
+ - Improve AGP workaround for pre-R200 chips.
+ (Michel Dänzer).
+ 729. Remove inappropriate __linux__ ifdef in the tdfx client-side DRI driver
+ (#5579, Eric Anholt).
+ 728. Allow makedepend handle whitespace in front of the '#' in preprocessor
+ directives (ISO C permits this) (#A.1516, Alexander Stohr).
+ 727. Add zh_TW.UTF-8 locale support (#A.1514, Leon Ho).
+ 726. Add recognition of wacom "XD-xxxx" models to the wacom input driver,
+ and treat them the same as "GD-xxxx" models (#A.1505, Rene Rask).
+ 725. Fix some missing render extension big-req compatibility (#A.1493,
+ Keith Packard).
+ 724. Fix a missing initialisation in the calcomp input driver that makes
+ the driver unusable and crashes the X server at startup (#A.1492,
+ Martin Kroeker).
+ 723. Work around for a bug in the i740 driver's XVideo support where the
+ video output would sometimes stop updating (#5578, Stephen Blackheath).
+ 722. Make DRM signal-on-vblank request return EINVAL on BSD since it's
+ not been ported yet (#5576, Eric Anholt).
+ 721. Remove the no longer used bsd/drm/kernel/r128/*.[ch] files (#5576,
+ Eric Anholt).
+ 720. drmFreeBufs was missing from the r128 driver's referenced symbols list
+ (#5574, Eric Anholt).
+ 719. Allow all of the extended mouse button bits for the "sysmouse" protocol
+ to be passed through (#5573, Eric Anholt).
+ 718. Update the XFree86 server special key handling so that by default
+ there is a fallback to the the hard-coded keys when there is no
+ Terminate action binding in the XKB map. A new global option is
+ added to allow the fallback mechanism to be used never, when needed,
+ or always, with "when needed" the default (#5572, Joe Moss).
+ 717. Update the README.fonts document (#5570, Juliusz Chroboczek).
+ 716. Build the loader's libc wrapper with -DHAVE_SYSV_IPC on FreeBSD
+ since NVIDIA's binary driver uses it (#5569, Eric Anholt).
+ 715. Reduce the stack usage from 64k to 8k in imLcPrs.c, which fixes
+ a problem with Java for FreeBSD (#5568, Eric Anholt).
+ 714. Gcc 3 deprecated the #pragma weak method for weak links (#5567,
+ Motoyuki Konno).
+ 713. FreeBSD.cf updates:
+ - Sparc64 support
+ - Recent 5.0-current doesn't need libXThrStub
+ - Disable SharedLibXdmGreet, fixing xdm on alpha
+ (#5566, Eric Anholt).
+ 712. XDarwin now loads GLX support dynamically. Current options are Apple's
+ OpenGL framework or Mesa (Torrey T. Lyons).
+ 711. GeForceFX support in the nv driver (Mark Vojkovich).
+ 710. DPMS support in the nv driver. CRTs only at this time (Mark Vojkovich).
+ 709. Fix for recognition of non-existent PCI devices (Marc La France).
+ 708. Fix for when firmware/BIOS initialisation does not enable the extra
+ command FIFO entries available on second-generation integrated Mach64
+ variants (Marc La France).
+ 707. Copying Syriac OTF fonts to directory OTF instead of TTF.
+ The xtt font renderer cannot handle OTF fonts causing the
+ entire directory to be ignored (Egbert Eich).
+ 706. Disabling MIT-SHM extensions for Xnest, fixing pixmap private
+ code in Xnest, thus cleaning out bogus patch 137.
+ NOTE: The MIT-SHM presently *does* *not* work with Xnest.
+ I have code to make it work but it is not well tested therefore
+ MIT-SHM is disabled for now! (Egbert Eich).
+ 705. Fix the misnaming of three of the redglass cursors (#A.1491,
+ Keith Packard).
+ 704. Fix for two problems where the combination of xtt and XAA could result
+ in a crash. The first problem was xtt returning a NULL pointer for
+ the bitmap even though the height was non-zero. The second problem
+ was glyph ascent/descent exceeding the range of maxbounds.ascent/
+ maxbounds.descent (A.1484, Chisato Yamauchi, Masanori Shimada).
+ 703. Eliminate locale-dependent behaviour in fontconfig's setfontdirs
+ script (#A.1483, Markus Kuhn).
+ 702. Fix a bug in previous Thai XIM changes (#5563,
+ Theppitak Karoonboonyanan).
+ 701. Updates for the Israeli XKB map, including:
+ - Implement parens mirroring.
+ - Add two additional variants: "lyx", replacing shifted Hebrew
+ letters with Hebrew point marks, and "si1452", implementing the
+ Standard of Israel no. 1452 mapping.
+ (#5562, Tzafrir Cohen).
+ 700. BuildServersOnly fix when building on a system with no installed
+ X headers or libraries (#5559, ISHIKAWA Mutsumi).
+ 699. Add extended symbols for the "Logitech Cordless Desktop Navigator"
+ keyboard (#A.1480, Gilbert Fridgen).
+ 698. Fix xdm resource's font references to match actual bitmap fonts (#A.1477,
+ Göran Uddeborg).
+ 697. Update the xcursorgen man page (#A.1475, Keith Packard).
+ 696. Add a Mongolian XKB map (#5557, Sanlig Badral).
+ 695. Fixes for the Turkish XKB map (#5556, Nilgün Belma Bugüner).
+ 694. Thai XIM fixes:
+ - Fix the arguments in calling to StringConversionCallback in Thai XIM
+ filter, according to Hideki Hiura's explanation on the protocol.
+ - Add input sequence correction capability to the Thai XIM by
+ exploiting the XIMStringConversionSubstitution operation.
+ (#5553, Theppitak Karoonboonyanan).
+ 693. Resync the pc/fi XKB map with the previous map (#5552, Marko Myllynen).
+ 692. Workaround for parsing of Layout sections caused by recent changes
+ (#5558, Andrew Aitchison, Paulo César Pereira de Andrade).
+ 691. Fix the enabling of the Glint Gamma for use on an Appian Graphics
+ Jeronimo 2000 board which uses two Permedia3's (#5448, Sven Luther).
+ 690. Fix a problem in the trident driver for older chipsets and using
+ 16bit clock programming, manifested itself on a Thinkpad 760EL,
+ but there are probably lots of others. (Alan Hourihane).
+ 689. On Darwin add Mac font directories to fonts.conf (Torrey T. Lyons).
+ 688. Post XDarwin mouse events in Quartz mode where they happen rather than
+ where the cursor currently is (Adrian Umpleby).
+ 687. Enable Freetype Mac FOND support on Mac OS X (Torrey T. Lyons).
+ 686. Add an "lswitch" option to the group xkb map, allowing the left Alt
+ key to be used for AltGr (#A.1463, Andreas Tobler).
+ 685. Add some locales for OpenI18N1.2 (LI18NUX2000) level.1 conformance,
+ and change zh_HK to point to zh_HK.big5hkscs which conforms to
+ glibc's default for zh_HK (#A.1457, Leon Ho).
+ 684. Updates for the Irish and Ogham XKB maps (#5549, 5550,
+ Séamus Ó Ciardhuáin).
+ 683. Xterm patch #172 (Thomas Dickey).
+
+XFree86 4.2.99.3 (21 December 2002)
+ 682. Add a request to XFree86-VidModeExtension to get the read/write
+ permissions so that clients can check if they have permission to
+ change parameters (David Dawes).
+ 681. Fix read-only XFree86-VidModeExtension requests for remote connections
+ (David Dawes, reported by Jamie Zawinski).
+ 680. Correct problem when the server prints the name of a 'private
+ xkb action' in a format that xkbcomp cannot understand, and
+ was causing problems when calling XkbGetKeyboard (Ivan Pascal).
+ 679. Fix animated cursor problem with multiple screens (#A.1454,
+ Keith Packard).
+ 678. gtf.c build fix for LynxOS 4.0 (#A.1453, Stuart Lissaman).
+ 677. Fix a segfault in fontconfig (#A.1450, Keith Packard).
+ 676. If some LEDs are lighting when one reloads the XKB keyboard map
+ (using setxkbmap or xf86cfg) the LEDs become 'frozen' and can't
+ be switched off. The patch fixes this bug. (#5544, Ivan Pascal).
+ 675. Fix some problems with the addition of multi-layout scheme to
+ xkb: some keys that aren't 'alphabetic' should be treated as
+ such to allow CapsLock+Shift working as expected; sometimes it
+ is required to load an include file more than once due to
+ multi-layout configuration, also fix some typos
+ (#5545, Ivan Pascal).
+ 674. XKB programable 'special combinations' (such as Ctrl+Alt+<key>)
+ also send usual key evants (press and release). Although the
+ keysym generated in this case is NoSymbol such events can confuse
+ some applications (#5546, Ivan Pascal).
+ 673. Fix some remaining memory leaks in xkb initialization code
+ (Paulo César Pereira de Andrade).
+ 672. Temporarily enable the hard-coded Ctrl-Alt-Backspace terminate sequence
+ until a better fallback mechanism is implemented (Egbert Eich).
+ 671. Allow XKB-remappable hot keys to work with the "kbd" driver
+ (Egbert Eich).
+ 670. Export xf86inSuspend as needed by the "kbd" driver (Egbert Eich).
+ 669. SiS driver updates, including:
+ - support for SiS 330 Xabre (untested)
+ - Bugfix for boxes with two VGA connectors (tested)
+ - Autodetection of second monitor (tested)
+ - TV detection improved (tested)
+ - fixed error in 1280x1024 panel support (yet untested)
+ - Fixed bug in TV output on SiS30xB/30xLV (PAL still only BW, not
+ even the Windows driver can display PAL in color)
+ - Fixed positioning of TV picture. Works now for all video bridges
+ except Chrontel 7019 (still untested).
+ (Thomas Winischhofer).
+ 668. Add an alternative French XKB layout (fr-latin9) (#A.1446, Guylhem Aznar,
+ Rene Cougnenc, Nicolas Mailhot).
+ 667. Add bar and brokenbar to default <LSGT> definition for pc102 and
+ pc105 xkb maps (based on #A.1445, Göran Uddeborg).
+ 666. Change the keypad "decimal" key to KP_Separator in the dk, fi, no, se
+ xkb maps (#A.1440, Robin Rosenberg).
+ 665. Fixes and cleanups for the ISO8859-14 Compose table (#5543,
+ Séamus Ó Ciardhuáin).
+ 664. Update the Ogham xkb map, including full support for the IS434 standard
+ and laptops (#5542, Séamus Ó Ciardhuáin).
+ 663. Update the Irish xkb map, including adding support for laptops (#5541,
+ Séamus Ó Ciardhuáin).
+ 662. Add "Inet" key definitions for the Honeywell Euroboard keyboard (#A.810,
+ Scott Penrose).
+ 661. Add "Inet" key definitions for the Trust Direct Access keyboard (#A.897,
+ Raphaël Poss).
+ 660. Add draglock support to the mouse driver, for aiding trackball use
+ by people with low dexterity (#A.1224, Paul Elliott).
+ 659. Fix bad includes in the xkb "level3" symbols file (A.1444,
+ Göran Uddeborg).
+ 658. Fix atimisc panel support bug that occurs when the mode on server entry
+ is a VGA mode with large horizontal and/or vertical blanking pulses
+ (Marc La France).
+ 657. Fix small documentation error in config/imake/imakemdep.h (#A.1052,
+ Linus Almstrom).
+ 656. Small change to find_mesa_visual() in xf86glx.c to avoid
+ branch misprediction on x86 (#A.1057, lompik at voila.fr).
+ 655. Clear memory allocated in xtWidgetAlloc() to avoid garbage from
+ malloc() being referenced later (#A.1114, Adam J. Richter).
+ 656. Make SysRq generate the same keycode as PrtScrn, and Break the same
+ keycode as Pause (#A.1160, Owen Taylor).
+ 655. Add "Inet" key definitions for some HP and Toshiba laptops (#A.1213,
+ Peter Soos).
+ 654. "Inet" key definitions for the Brother Internet keyboard (#A.1242,
+ Diego Iastrubni).
+ 653. "Inet" key definitions for the Ennyah model DKB-1008 keyboard (#A.1256,
+ Lionel Landwerlin).
+ 652. Apply i830 DRM driver cleanups to the i810 driver (#A.1438,
+ David Airlie).
+ 651. Add XI18NOBJS files for the ko_KR.UTF-8 and ja_JP.UTF-8 locales
+ (#5538, 5539, Jungshik Shin).
+ 650. Add FIRSTINDEX to the gb2312.1980-0.enc, gbk-0.enc and jis0212.1990-0.enc
+ encoding files (#5537, Jungshik Shin).
+ 649. Increment shared libraries major revisions on OpenBSD if gcc with
+ stack protector is used (Matthieu Herrb, Todd Fries).
+ 648. Resync with DRI (mesa-4-0-4-branch).
+ 647. Update XDarwin's IOKit mode to work with new event handling code
+ (Torrey T. Lyons).
+ 646. Add some more aliases for some German locales (#A.1263, Thomas Koeller).
+ 645. Update kio8-r encoded Cyrillic BDF fonts (#A.1267, Andrey A. Chernov).
+ 644. Fix Xtrans TLI code to handle a port scan and not fill the log file
+ with error messages from _XSERVTransTLIAccept() (#A.1333, Fiel Cabral).
+ 643. Only free cbs.data.text when cbs.type is XIMTextType in
+ _XimStatusDrawCallback() (#A.1342, Owen Taylor).
+ 642. Allow mouse pointer movement to be rotated (#A.1346, Joost Buelens).
+ 641. Add xkb layouts for Indian scripts (Kannada, Telugu, and Oriya) (#A.1436,
+ Guntupalli Karunakar).
+ 640. Enable MMX, SSE and 3DNow! for NetBSD 1.6 and later (#5536,
+ Matthias Scheler).
+ 639. Merge the xkb 'lt' layouts into pc/lt (#5535, Nerijus Baliunas).
+ 638. Set the default fa_IR character set to UTF-8 instead of
+ ISIRI-3342 (#A.1356, Roozbeh Pournader).
+ 637. Fixes and updates for building under LynxOS/PowerPC 4.0 (#A.1386,
+ Stuart Lissaman).
+ 636. Update the ClearlyU fonts to version 1.9 (#A.1386, Mark Leisher).
+ 635. Fix for drmOpenDevice() ignoring success on its second attempt at
+ opening the drm device (#A.1394, Alexander Stohr).
+ 634. Add support for a "-include" command line option to makedepend, similar
+ to the same GNU C option (#A.1396, Alexander Stohr).
+ 633. Perform country-independent matching for Chinese languages in fontconfig
+ (#A.1406, Keith Packard).
+ 632. Finish off the UTF-16 APIs in Xft, and fix the UTF-16 conversion
+ code in fontconfig (#A.1411, Keith Packard, Jungshik Shin).
+ 631. Make XIM locale checking case-independent (based on #A.1422, Leon Ho).
+ 630. Fix incorrect datatype for the pixmap width in
+ fbCompositeSrcAdd_8000x8000(), and add some small optimisations
+ (#A.1423, Keith Packard).
+ 629. Update the se xkb map to allow the older AltGr+5 method of entering
+ the Euro sign (#A.1433, Christian Rose).
+ 628. Add validation for the screen number parameter received over the wire
+ by the X server's DRI extension code, and fix some similar checks in
+ the GLX code. This fixes X server segfaults when an invalid screen
+ value is provided (#A.1434, Felix Kühling)..
+ 627. Fix some bugs in the Iranian xkb layout (#A.1135, Roozbeh Pournader).
+ 626. Add a Bosnian xkb layout (#A.1398, Amila Akagic).
+ 625. Fix for Hungarian xkb layout (#A.1175, Peter Soos).
+ 624. Update the Maltese xkb layouts (#A.1243, Ramon Casha).
+ 623. Add EuroSign to the xkb "gb" layout (#A.901, Dermot McNally).
+ 622. Various updates for the xkb "xfree86" keymap list (including #A.777,
+ Andriy Rysin).
+ 621. Let kbd driver test if Xserver is in suspend before handling any
+ input events (Egbert Eich).
+ 620. Fixed agp version checking to accept minor versions >= the specified
+ number (Leif Delgass).
+ 619. Update referenced symbols lists for the mga, vesa, i810 and vmware
+ drivers (David Dawes).
+ 618. Add missing symbol to the mga driver's referenced symbols lists
+ (#5534, Mike Harris).
+ 617. Add some utf8 locale aliases (#5533, Mike Harris).
+ 616. Fix some Linux/Alpha (with domain support) build and runtime
+ problems (#5532, Jeff Wiedemeier).
+ 615. Add some missing symbols to the radeon driver's referenced symbols
+ lists (#5531, Mike Harris).
+ 614. Restore the Alt/Meta mappings for pc104/pc105 keyboards in the
+ multi-layout maps (David Dawes).
+ 613. Add UTF-8 locale entries for Amharic-Ethiopian, Tigrinya-Eritrean
+ and Tigrinya-Ethiopian (#5529, Daniel Yacob).
+ 612. Restore the "\|" key in the GB multi-layout keyboard layout (#5528,
+ Andrew Aitchison).
+ 611. Updates for the auto-generated UTF-8 Compose file (#5527,
+ David Monniaux).
+ 610. Updates/fixes for the Korean font encoding file (#5525, Jungshik Shin).
+ 609. Fix some problems with the multilayout version of the Turkish layout
+ (#5521, Nilgün Belma Bugüner).
+ 608. DRM vertical blank ioctl can send a signal as an alternative to
+ blocking (r200 and radeon only so far) (#5523, Michel Dänzer).
+ 607. Build fix for Linux/Alpha (#5515, Mike Harris).
+ 606. Change CppCmd on Linux to /usr/bin/cpp (#5514, Mike Harris).
+ 605. Fix an incorrect check for the "StrangeLockups" option in the
+ neomagic driver (#5505, Mike Harris).
+ 604. Rename geode driver to nsc and add GX2 support (Sarma Kolluru, NatSemi).
+ 603. Add the missing XKB definition for keysym "ISO_Level3_Lock" (#5526,
+ Séamus Ó Ciardhuáin).
+ 602. XkbSetControls should return True when successful, not False (#A.1385,
+ Stephen Montgomery-Smith).
+ 601. The functions XGetXlibControls and XSetXlibControls must work even if
+ the X server doesn't have the XKB extensions (#5513, Ivan Pascal).
+ 600. Add en_ZA locales (#5512, Berend De Schouwer).
+ 599. Fix shadowfb to not make update callbacks for operations that don't
+ touch offscreen memory, and to not double (or more) update glyph
+ rendering (#5509, Nolan Leake).
+ 598. Change XAA to not sync when it sees RENDER operations that don't
+ touch VRAM, and to try to accelerate Glyphs with Composite if it
+ seems likely that will work (#5509, Nolan Leake).
+ 597. VMware driver updates, including:
+ - Fixed vmwareGetImage to correctly calculate the region to be gotten.
+ - Small cursor bypass optimization.
+ - Fixed race between writing normal registers and writing HWcursor
+ registers.
+ - Fixed small race in the FIFO wrap code that could cause FIFO
+ corruption.
+ - Added temporary offscreen memory manager.
+ - Added compositing (RENDER) acceleration.
+ (#5509, Nolan Leake).
+ 596. Newport driver updates, including:
+ - Add hardware cursor support.
+ - Workaround blank console after VT switch on some newports
+ (based on a patch from Dominik Behr).
+ - Support for the Indigo2 XL (based on a patch from Adrian Schroeter).
+ (#5507, Guido Guenther).
+ 595. Add SGML versions of the XKB config and enhancing docs (#5506,
+ Kamil Toman).
+ 594. Enable SSE, MMX, 3DNow support by default for Linux/x86_64 (#5502,
+ Mike Harris).
+ 593. Replace hard-coded "lib" directory names with LibDirName in Imake.tmpl
+ (#5480, Mike Harris).
+ 592. DRI shouldn't have been enabled for Linux/s390 (#5500, Mike Harris).
+ 591. Numerous bug, stability, and correctness fixes for the Intel 830/845G
+ 3D support (#5517, Keith Whitwell).
+ 590. Numerous bug and stability fixes for the Intel 830/845G 2D and Xv
+ support (#5517, David Dawes).
+ 589. Move IOKit-specific global variables out of generic XDarwin code
+ (Torrey T. Lyons).
+ 588. Add a new interface for registration of core font renderers that allows
+ priorities to be assigned. This allows multiple renderers for the
+ same extension to be registered, with the one with the highest priority
+ being the one that gets used (#5435, 5437, Juliusz Chroboczek).
+ 587. Fix 640x480 modes in neomagic driver (Egbert Eich).
+ 586. Fix reporting of G400/G450 in MGA driver (Andrew C. Aitchison).
+ 585. Don't change the authorization data (and in particular, don't
+ enable local host access) if the X server's authority file
+ is removed or becomes unreadable while the server is running
+ (David Dawes, reported by Dietmar Schröter).
+ 584. Xterm patch #171 (Thomas Dickey).
+ 583. Fix uninitialized buffer-count in luit (Semen A. Ustimenko).
+ 582. Various xdm updates from Debian and Suse (#5358, Branden Robinson,
+ #5511, Sebastian Krahmer).
+ 581. Flesh out suncg6's SaveScreen() function (Moritz Bunkus).
+ 580. lib/Xaw/MultiSrc.c improperly checks open() return value
+ (A.1415, Jaromir Dolecek), Fix provided by Hideo Saito in NetBSD.
+ 579. Add DPMS and screen blanking support in the sunffb driver
+ (Ferris McCormick).
+ 578. Fix SEGV that occurs when Xsun* runs into an unrecognized framebuffer
+ type (Marc La France).
+ 577. When the mode on server entry is found to be using composite sync on a
+ Mach64 variant, turn on the "compositesync" option (Marc La France).
+ 576. Plug SIGIO hole while the server is switching back into its VT
+ (reported by Michel Lespinasse).
+ 575. Use shadowfb in XDarwin fullscreen Quartz mode (Torrey T. Lyons).
+ 574. Make RENDER optional for Xvfb. When RENDER is enabled add depth 32
+ pixmap format to list of supported pixmaps (Egbert Eich).
+ 573. Fix va_args glitches for xterm/libfontconfig: 0 == (void*)0 isn't true
+ for all platforms (Egbert Eich).
+ 572. Fix lbxproxy to also build on platforms that don't have snprintf()
+ (Egbert Eich).
+ 571. Fix va_args glitches in mkfontscale: arg stack isn't preserved after
+ calling va_arg on all platforms (Egbert Eich).
+ 570. Fixed x11perf aa benchmarks to support non-default visuals/colormaps
+ (Egbert Eich).
+ 569. Use -Os to build on Darwin PPC with Gcc 3.x (Torrey T. Lyons).
+ 568. XEditResCheckMessages trashed XtMalloced memory on some widget
+ hierarchies, due to using incorrect indexes when removing
+ duplicates (A.1409, Rob Arthan).
+ 567. xprop updates (Mihael Hategan).
+ 566. Fix SEGV in ICE library (Petter Reinholdtsen).
+ 565. Fix interaction between backing store and miext/shadow (adapted from
+ Paulo César Pereira de Andrade).
+ 564. Add new key descriptions for XFree86 special keys (i.e. for terminating
+ and VT switching the Xserver) (#5510, Ivan Pascal).
+ 563. #define DEALLOCATE_LOCAL as "do {} while(0)" instead of nothing to
+ eliminate GCC warnings caused by code that does not assume
+ DEALLOCATE_LOCAL can deal with null pointers (suggested by Kevin Martin).
+ 562. -
+ 561. Fix bug in kldload() call on FreeBSD (reported by Joy Ganguly).
+ 560. Adding int10 symbols to the list of possibly unresolved symbols in
+ Rage128 driver (Egbert Eich).
+ 559. Allowing scanpci to be build on Ppc (Egbert Eich).
+ 558. Updating SiS driver. Lots of new features, supported chipsets and
+ LCD panels, bug fixes. For details please check:
+ http://www.winischhofer.net/linuxsis630.shtml
+ (Thomas Winischhofer).
+ 557. Changed MGA driver to query fb_offset for DRI from kernel instead
+ of taking the driver's FBAddress - this is required by platforms
+ like Alpha (Egbert Eich).
+ 556. Fix Xmu memory leak (reported by Michael Vogt).
+ 555. Deal with Creative SBlive devices that mis-identify themselves as
+ "prehistoric" VGA's (Marc La France).
+ 554. Allow -configure to setup Unknown Vendor/Boards removing the requirement
+ of xf86PciInfo information (Alan Hourihane).
+ 553. Hardware alpha blended cursors in the "nv" driver, new PCI IDs, and
+ a fix for a problem on PowerPC (Mark Vojkovich).
+ 552. "nv" driver workaround needed to let Xv continue to work after a
+ suspend on some laptops (Pierre Lombard).
+ 551. Restore '--assembler-with-cpp' in AsCmd for Linux/mips, fixing the build
+ on that platform (#5499, Guido Guenther).
+ 550. An alternative update for alphabetic four level cz, sk XKB maps.
+ This is compatible with the way MS Windows behaves (#5498, Kamil Toman).
+ 549. Clarify the difference between characters and bytes in xev (#5497,
+ Markus Kuhn).
+ 548. Add an Irish (ie) XKB keyboard map (#5496, Seamus O Ciardhuain).
+ 547. Replace the UTF-8 compose map with one automatically generated from
+ the official Unicode documentation, with the addition of some
+ handwritten rules (#5495, David Monniaux).
+ 546. Document the "nomtrr" option in the XF86Config man page (#5494,
+ Mike Harris).
+ 545. Some fixes for the Icelandic xkb map (#5493, Olafur Osvaldsson).
+ 544. Add French Canadian keyboard description to xfree86.lst (#5492,
+ Mike Harris).
+ 543. Add a new file for descriptions of XkbModel, XkbLayout, XkbVariant
+ and XkbOption names, using an XML format. Includes a DTD file
+ and perl script to convert from the new format to the old (.lst)
+ format (#5491, Ivan Pascal).
+ 542. Add missing "dvorak" single-group XKB layout (#5490, Ivan Pascal).
+ 541. Change the xkbfile library to allow some names to be grouped into
+ a named list, which allows the rules file to be simplified (#5490,
+ Ivan Pascal).
+ 540. Make the new single-group XKB symbols maps used by default (#5490,
+ Ivan Pascal).
+ 539. Fix a crash that can happen when some apps are run in CJK locales
+ (#5489, Havoc Pennington).
+ 538. Make xdm check the full password string (on Linux) for locked accounts
+ rather than just the first character (#5485, Mike Harris,
+ Nalin Dahyabhai).
+ 537. Fix a few cases where the transport endpoints would be removed
+ even if NOUNLINK is specified in the flags (#5484, J. Kean Johnston).
+ 536. Attempt to fix bitblt problems when doing offscreen pixmaps in
+ i810 (Egbert Eich).
+ 535. Change Build rule so that x86 assembler code for MESA can be completely
+ disabled on i386 (Egbert Eich).
+ 534. Added IEEE Optimization for x86-64 (Egbert Eich).
+ 533. Initialized fullscreen in DRIscreenPrivate to a vaild value
+ (Egbert Eich).
+ 532. Fixed module loader to map memory in the low 32bit address space on
+ x86-64 (Egbert Eich).
+ 531. Shifted Keypad delete: added KP_Separator for de_DE and de_CH keyboard.
+ 530. Added sanity checks to various scripts (Egbert Eich).
+ 529. Fixed Trident RGB16 video playback mode (Alastair Robinsion).
+ 528. i810 only set OVRACT register when TVout isn't enabled
+ (Sebastien BASTARD, Matthew J. Sottek, Egbert Eich).
+ 527. Record changes of BusMaster state so that pciDisable/Enable/Mem/Io
+ don't override these (Egbert Eich).
+ 526. Fixed RAC code: when no resources are shared chips may still need
+ RAC for bus access if both require non overlapping parts of the
+ VGA resources (Egbert Eich).
+ 525. Fix for resource registration of C&T and Tdfx driver (Egbert Eich).
+ 524. Prevent core dumps in Xutf8Reset/Lookup code of Xlib (Masaru Yokoi).
+ 523. Added support for BE systems for C&T driver (Michael Stephen Hanni).
+ 522. Added support for special keys found on many ACPI control, Easy Access
+ Keyboards, Internet keyboards, laptops, notebooks and PDA (via
+ xkb/symbols/inet). Added new key symbols for these keyboards
+ (Stanislav Brabec).
+ 521. Fixed some problems with ininite loops which where introduced
+ with the host bridge specific code (Egbert Eich).
+ 520. AXP domain support (Jeff Wiedemeier).
+ 519. Added -m32 flag to c++ when build on ia32 (Egbert Eich).
+ 518. -
+ 517. Added rule to be able to use Numlock key on broken IBM keyboards
+ (Stefan Dirsch).
+ 516. Fixed Xlib build rules so it builds a truly static library again
+ (Egbert Eich).
+ 515. When compiled with GCC, force imake to generate Makefile's using GCC's
+ preprocessor rather than a system-provided one (Marc La France).
+ 514. Replace hard-coded "lib" directory names with LibDirName in X11.tmpl
+ (#5480, Mike Harris).
+ 513. Add some README files for XKB and it's configuration files (#5479, 5483,
+ Kamil Toman).
+ 512. Fixes for the "pc" cz and sk XKB maps:
+ - readded cz_qwerty (but new pc/ style) map
+ - added bskl variant missing in cz_qwerty and sk, sk_qwerty
+ - fixed keypad decimal key definition to affect only defined group
+ in cz, cz_qwerty
+ - missing SPCE definition readded to sk, sk_qwerty
+ (#5478, Kamil Toman).
+ 511. Union Reality UR-F98 headtracker input driver (Linux-only) (#5476, 5477,
+ Alan Cox).
+ 510. Palmax PD1100 touch screen driver (#5475, 5477, Alan Cox).
+ 509. Fujitsu Stylistic input driver (#5474, 5477, Rob Tsuk, John Apfelbaum,
+ Richard Miller-Smith, Alan Cox).
+ 508. Initialise ProgramName in xterm's main before referencing it (#5473,
+ Peter Valchev).
+ 507. Add an Ogham XKB keyboard map (#5472, Seamus O Ciardhuain).
+ 506. Handle Alt+Ctrl+Shift+SPECIAL differently from Alt+Ctrl+SPECIAL
+ where SPECIAL is one of the fallback built-in XFree86 hot keys
+ (#5468, J. Kean Johnston).
+ 505. Add Syriac XKB keyboard maps (#5467, Emil Soleyman-Zomalan).
+ 504. Rename HasKatmaiSupport to HasSSESupport (#5461-5463, 5465, Mike Harris).
+ 503. Add mouse wheel support for SCO OpenServer (#5460, J. Kean Johnston).
+ 502. Fix i18n problem in xmessage due to use of the useStringInPlace
+ resource (A.1381, Chisato Yamauchi).
+ 501. Fix xnest build on file systems that are not case sensitive
+ (Torrey T. Lyons).
+ 500. Use unique local Imake define for fonts.conf dir (#5482, Mike A. Harris)
+ 499. Fix xc/lib/Imakefile to not break HasFontconfig (#5481, Mike A. Harris)
+ 498. Refresh screen after wake from sleep in XDarwin full screen mode
+ (Torrey T. Lyons).
+ 497. Fixes and updates for the SCO OpenServer port (#5459, J. Kean Johnston).
+ 496. Add PCI ID defines for some ATI R300 chipsets (#5458,
+ Vladimir Dergachev).
+ 495. Fix error message typo in MakeRootTile() (#5451, Mike Harris).
+ 494. Redirect hostname's stderr in the xon script (#5450, Mike Harris).
+ 493. Add a request to the XFree86-Misc extension for querying the
+ X server's config file, module path, and log file name (#5456, Joe Moss).
+ 492. Add support for using the XKEYBOARD extension's action handlers
+ for the XFree86 X server hot keys. This provides control over
+ the mapping of these hot keys (#A.1334, 5454, Joe Moss).
+ 491. Reinstate the X server -xkbdir option, but only when the X server's
+ real and effective uids are the same (based on #A.1132, Ivan Popov).
+ 490. Fix an xkbcomp bug that prevents a later definition from specifying
+ actions if the previous definition didn't (#5471, Joe Moss).
+ 489. Add a stub handler to xkbcomp for the DeviceValuator action (#A.1341,
+ Joe Moss).
+ 488. Fix broken software cursor with XDarwin's new event handling
+ (Torrey T. Lyons).
+ 487. Change imake so that, when compiled with GCC, it invokes the pre-
+ processor through the gcc front-end, passing it imake's -v flag
+ (Marc La France).
+ 486. xf86cfg and xf86config patches, includind 1400x1050 mode, update list
+ of modules, auto inclusion of the xtt module when running X -configure
+ (A.1363, A.1364, A.1365, Chisato Yamauchi).
+ 485. Fix unbalanced paranthesis in linuxPci.c (#5466, Ishikawa Mutsumi).
+ 484. Remove "Option VideoRam" from savage driver, there's no need for it,
+ and utilize the entities given VideoRam size (Alan Hourihane).
+ 483. Fix fontconfig to obey NothingOutsideProjectRoot, so that the directory
+ /usr/share/fonts is ignored in this case (#A.1325, Joe Moss).
+ 482. Fix a segfault when using xkbcomp's -I option, and update the man
+ page to correctly document the way this option works (#5447, Joe Moss).
+ 481. Don't assume mmap returns the pointer hint requested. This is in
+ the DENSE map code for Linux/alpha (#5439, Ray Strode).
+ 480. Build fix for r128_accel on PPC when DRI is disabled (based on
+ #5438, Mike Harris and #5449, Matthieu Herrb).
+ 479. Updates to bdf/misc UCS fonts (#5446, 5453, Markus Kuhn).
+ 478. Fix Thai glyphs in the 6x13 UCS font (#5427, Theppitak Karoonboonyanan).
+ 477. Add Thai glyphs to 7x13, 7x13B, 7x13O, 7x14, 7x14B UCS fonts
+ (#5445, Theppitak Karoonboonyanan).
+ 476. Add Thai subfont generation based on the ISO8859-11 map from unicode.org
+ (#5434, 5445, Theppitak Karoonboonyanan).
+ 475. Update the multilayout version of the Greek (el) xkb symbols (#5425,
+ Vasilis Vasaitis).
+ 474. On XDarwin startup, do not send events to the X server thread until it
+ is ready to receive them (Torrey T. Lyons).
+ 473. Add a utility (called gtf) for calculating VESA GTF mode lines
+ (Andy Ritger).
+ 472. Add an input driver for KB-Gear's Jamstudio pentablet (A.1328,
+ Brian Goines).
+ 471. Add a Tektronix 4957 input driver (#A.1211, Olivier Danet).
+ 470. Fix backing store in Rage 128 and Radeon drivers (Kevin Martin).
+ 469. Fix Mono8x8 code in savage driver, needed ROP_NEEDS_SOURCE, also
+ add NO_PLANEMASK to ScreenToScreen as code doesn't handle that case
+ (Alan Hourihane).
+ 468. Add a little utility to read and write I/O ports, for those host
+ architectures that have them (Marc La France).
+ 467. Ignore (with messages) any HorizSync and VertRefresh specifications for
+ panels when using ATI LT, LTPro, XL and Mobility M1 (Marc La France).
+ 466. Fix a build failure when BuildServersOnly is defined and XnestServer
+ is not defined, and when /usr/X11R6 is not installed. (#A.1145,
+ Valeriy E. Ushakov).
+ 465. Fix panel support bug for ATI LTPro, XL and Mobility M1 chips
+ (Marc La France).
+ 464. Fix mode validation to deal with video memory sizes 256MB or greater
+ (Marc La France).
+ 463. Add ARGB cursors support to the vmware driver (#5442, Nolan Leake).
+ 462. Add more query options to glxinfo (#5441, Brian Paul).
+ 461. Fix a typo in glxinfo (#5440, D. Hageman).
+ 460. Fix a memory leak in Cygwin/XFree86 server (#5444, Kensuke Matsuzaki).
+ 459. Missing fallback to miPolyArc in fbarc.c (#A.1339, Ralf Klingebiel).
+ 458. Fix the cyrix driver support for the 5510, 5520 and 5530. This driver
+ only works with VSA1 based chips (#A.1260, Alan Cox).
+ 457. When building with gcc >= 2.8, generate Makefiles with `imake -Wundef`
+ (Marc La France).
+ 456. Re-instate changes clobbered by DRI merge (Marc La France).
+ 455. Fix a typo in shadowfb support from #5413 (#5430, Nolan Leake).
+ 454. Fix a bug in vmware's HW cursor support which conditionally hid the
+ cursor (#5430, Nolan Leake).
+ 453. Fix an initialization problem in the calcomp input driver (#A.1056,
+ Josef Walzer).
+ 452. Add command line and XF86Config options to control Render color
+ allocation on dynamic indexed visuals (Olivier Chapuis, Keith Packard)
+ 451. Keep track of whether the 830/845G HW cursor should be visible or
+ hidden so that it doesn't get turned on when it shouldn't (David Dawes).
+ 450. Fix for DGA offset inconsistency in the 830/845G driver (based on
+ a patch from Edgar Toernig).
+ 449. Fix a memory leak when calling _XCloseLC and removing the loadable
+ locales (#A.855 Mark Robinson).
+ 448. Fix input size of character strings used in lib/X11/lcGetConv.c (#A.828,
+ Yong-Jhen Hong).
+ 447. Add Shape extension support to Cygwin/XFree86 rootless mode (#5431,
+ Matsuzaki Kensuke).
+ 446. Fix a typo in the s3 driver which prevented virtual display sizes.
+ (#A.965, Stef Voltz).
+ 445. Fix a server crash that can happen when a DGA client frees its colormap
+ before setting the mode back to the original mode (David Dawes).
+ 444. Modify Type1 font RAM allocation heuristics to allow for larger fonts.
+ (#A.1121, Melchior Franz).
+ 443. Add new relocation entries for Alpha architecture to the loader which
+ are used when compiling with gcc >3.1 (#A.819, Thorsten Kranzkowski).
+ 442. Fix server crash when using Xinerama when application closes.
+ (#A.808, Tsukahara Ken).
+ 441. Import Mesa-4.0.4, and resync with the DRI trunk (DRI Project).
+ 440. Server support for the alpha architecture on OpenBSD 3.2.
+ (Matthieu Herrb, Arthur Grabowski).
+ 439. Workaround for <linux/input.h> conflict (Marc La France).
+
+XFree86 4.2.99.2 (21 October 2002)
+ 438. Fix some memory leaks in libX11 i18n code (#A.1314, Olivier Chapuis).
+ 437. Add DGA and Xvideo support to the i740 driver (#A.1307, Kopecek Tomas).
+ 436. Fix the number of beeps when using AccessX and XKB
+ (#A.1302, Alan Coopersmith).
+ 435. Add twelve hour format to xclock's digital format
+ (#A.1285, Brian L. Matthews).
+ 434. Fix application crash when using DPS client libraries
+ (#A.1282, Frank Giessler).
+ 433. Fix pixmap cache corruption on VT switches in mga driver
+ (#A.1279, Ross Mikosh).
+ 432. Add missing Increment option in Summa input driver (#A.1276, G.P.Halkes).
+ 431. Missing semicolon in twm/gram.y (#A.1307, Jim Gifford).
+ 430. Cygwin/XFree86 updates
+ - Add X.ico, an icon for Windows (Harold Hunt, Jehan Bing)
+ - Include a preliminary pseudo-rootless mode (Matsuzaki Kensuke)
+ - XF86Config file support (Alexander Gottwald)
+ - Scrollbars support (Jehan Bing, Harold Hunt)
+ (#5424, Cygwin/XFree86 developers).
+ 429. Add ko_KR.UTF-8 and ja_JP.UTF-8 XLC_LOCALE files (#5421, Jungshik Shin).
+ 428. Add TCVN support to luit (#5416, Tomohiro KUBOTA).
+ 427. Expand luit to support several major non-ISO-2022-compliant
+ encodings such as GBK and Shift_JIS (#5416, Tomohiro KUBOTA).
+ 426. Add support for double-buffering to the tdfx driver's XVideo overlay
+ support (#5415, Stephen Davies).
+ 425. Add a -strftime option for xclock's digital mode (#5414, George Belotsky).
+ 424. README.fonts update (#5409, 5410, Khoda Hafez).
+ 423. Major update for VMware driver
+ - recoded to use XAA, offscreen memory support, and color expansion code
+ - Add RENDER support
+ - Optimization of HWcursor
+ - Bug fixes for HWcursor in 8bit mode and VT switching
+ (#5423, Nolan Leake, VMware).
+ 422. Updates for shadowfb code
+ - Add RENDER support
+ - support for pre-fb modifications
+ - support for real framebuffers rather than memory based framebuffer
+ - Removal of old fullscreen update code (when VT switching)
+ - fix bug in FillSpans
+ (#5411, #5413, Nolan Leake, VMware).
+ 421. Clear the list of registered renderers at the start of each new server
+ generation, and only print warnings about suffixes with more than
+ one registered renderer for the first generation (David Dawes).
+ 420. Make xf86PrintModes() show which modes are hot-key switchable
+ (David Dawes).
+ 419. Fix the vesa driver's misuse of virtualX for displayWidth (David Dawes).
+ 418. Fix the VBE module's depth/bpp matching, which fixes some 24/32 problems
+ as well as some 15/16 problems (David Dawes).
+ 417. Fix black cursor images on Mac OS X 10.2.2 (Joseph Maurer).
+ 416. Fix hotkey switching for user-specified modes, and fix hotkey switching
+ between all valid modes when no specific modes are specified in the
+ config file (David Dawes).
+ 415. Trival input drivers Imakefile cleanup (#5299, Mike Harris).
+ 414. Use INSTDATFLAGS when installing X server modules (#5292,
+ Branden Robinson).
+ 413. Fix the iso8859-15 Compose map -- there is no diaeresis codepoint
+ in iso8859-15 (#5389, Wolfgang Sourdeau, Rüdiger Kuhlman).
+ 412. Acute/apostrophe fix for nodeadkeys section of XKB German symbols
+ (#5388, Andreas Metzler).
+ 411. Fix Cards file typo (#5387, Branden Robinson).
+ 410. Cleanup the XKB Macinosh US keyboard symbols, and remove those that
+ should be in other country maps (#5386, Branden Robinson).
+ 409. Add a user-configurable throttle on xconsole's number of saved lines
+ (#5379, Branden Robinson).
+ 408. Fix missing declaration of XShmGetEventBase() in XShm.h (#5375,
+ Branden Robinson).
+ 407. Remove inconsistencies in the way extension headers are referred to
+ in most extension libraries (David Dawes).
+ 406. Install extension struct/protocol headers that weren't already
+ being installed (#5369, Branden Robinson).
+ 405. Fix long-standing colour map bug in ATI driver (Marc La France).
+ 404. Enable imake.c to perform correct C library version detection on hppa
+ machines (#5372, Ben Collins).
+ 403. Add new Imake rules to handle C++ programs that don't have man pages
+ (#5371, Branden Robinson).
+ 402. Add a -color app-defaults file for xmessage that exercises some
+ features of Xaw7, and fix the base app-defaults to not use the no
+ longer supported "whenNeeded" value for the "Scroll" resource (#5370,
+ Branden Robinson).
+ 401. Stop the drm module from creating a world-writable directory in /dev.
+ Since dev nodes can only be created by root, there's no need for
+ anyone else to be able to write to /dev/dri (#5367, Brendan O'Dea,
+ #5380, 5422, Mike Harris).
+ 400. Fix a SEGV in lbxproxy because it's ResizeReverseMap() makes assumptions
+ about the atom numbers that can lead to unallocated memory being
+ accessed (#5366, Branden Robinson and Anthony DeRobertis).
+ 399. Increase the wacom driver's timeout for reading data after a request.
+ This is needed for PalmWac (Wacom emulation for PalmOS) (#5364,
+ Mathieu Clabaut).
+ 398. Add Big5-HKSCS to locale.dir, and fix a missing portion in X-TT's
+ Big5HKSCS-Unicode table (#5362, Branden Robinson and ThizLinux
+ Laboratory Ltd).
+ 397. Handle vetoed APM suspend events properly on Linux (#5362,
+ Branden Robinson).
+ 396. Handle ARM and HP-PA separately from m68k and PowerPC in xfree86.cf,
+ and some cleanups (#5360, Branden Robinson).
+ 395. xfs updates and cleanups (#5359, Branden Robinson).
+ 394. Fix for random crashes when a screen fails to initialise (Marc La France).
+ 393. Update RandR to include refresh rates (v1.1) (Keith Packard)
+ 392. Numerous man pages fixes, add some missing manpages (#5365, #5373,
+ #5376, #5377, #5382-5385, #5390, #5391, #5393, #5295 Branden Robinson
+ #5374, Jonathan Amery, #5378, Jochen Voss)
+ 391. Install bdftruncate and ucs2any without the .pl extension
+ (#5391, Branden Robinson)
+ 390. Rewrite Radeon DDC/DFP mode detection and management (Kevin Martin).
+ 389. Integrate ATI patch:
+ - Add 2D support for Radeon 9000 (RV250), Mobility M9 (RV250 mobile)
+ and Radeon 9700 (R300)
+ - Clone mode fixes and improvements
+ - Dell VE card fixes
+ - Dual-head VT switching fixes
+ - General code clean up
+ (#A.1217, Hui Yu@ATI).
+ 388. Rewrite XDarwin's event handling to fix some bugs and to use
+ SetInputCheck() for a performance boost (Torrey T. Lyons).
+ 387. Add a little utility to write files through mmap() (Marc La France).
+ 386. Add National Semiconductor Geode driver, support for the 5530, SC1200
+ and SC1400 chipsets (NSC, Alan Hourihane).
+ 385. linux.cf updates:
+ - Resync the DebianMaintainer #define and the stuff in the
+ corresponding if block to meet Debian's current needs.
+ - Sort long chains of architecture-dependent #if-#elif directives in
+ ASCII order.
+ - Add explicit recongition of several architectures to the #ifndef
+ BuildXF86DRI block.
+ - Define a fallback CplusplusCmd (g++) if we don't recongize the
+ platform we're on.
+ - Turn off the loadable server on MIPS and SuperH platforms, where it
+ doesn't (yet) work.
+ - Trash some unneeded #defines in the Mc68020Architecture compilation
+ environment.
+ - Remove the block that #defines HasXserver NO for the s390 and s390x
+ architectures (things like Xvfb build fine on these platforms).
+ (#5357, Branden Robinson).
+ 384. Fix an error in the Finnish XKB keyboard map (#5356, Marko Myllynen).
+ 383. Add a Malayalam XKB keyboard map (#5355, Baiju M).
+ 382. Add a "kbd" driver module that can eventually replace the built-in
+ "keyboard" driver (#5344, Ivan Pascal).
+ 381. Add os-support level support for a loadable keyboard driver for BSD
+ and Linux (#5344, Ivan Pascal).
+ 380. Add some new common layer functions for supporting a loadable keyboard
+ driver (#5344, Ivan Pascal).
+ 379. Move the XkbDisable option to a global server flag rather than
+ keyboard driver flag, since it really is a global setting (#5344,
+ Ivan Pascal).
+ 378. Fix RenderCreateCursor's conversion from an ARGB cursor to a 2-color
+ cursor when the cursor is wider than 8 pixels (#5353, Greg Parker).
+ 377. Fix 24bpp displays with the fbdev driver when not using shadowfb
+ (#5351, Michel Lanners).
+ 376. Fixes and improvements for the en_US.UTF8 compose rules (#5346,
+ Alexandre Oliva).
+ 375. Fix compose rules for some dead accents for iso8859-1 and iso8859-15
+ (#5338, 5339, Alexandre Oliva).
+ 374. Add support for th_TH.UTF-8. with XIM (#5336, Theppitak Karoonboonyanan).
+ 373. Fix some bugs in the Thai XIM:
+ - excessive '(' char when switching XKB keyboard group
+ - ineffective Ctrl-<key> and Alt-<key>
+ (#5335, Theppitak Karoonboonyanan).
+ 372. Add an X server command line flag (-br) to make the default root window
+ solid black (#5334, Jens Owen).
+ 371. Add support for th_TH.ISO-8859-11 (#5327, Theppitak Karoonboonyanan).
+ 370. Use pci_alloc_consistent/pci_free_consistent instead of the
+ local page alloc/free functions in the i810 and i830 DRM drivers
+ (#5323, Arjan van de Ven).
+ 369. Fix some non-POSIX usage of tail, expand and sort (#5322, Paul Eggert).
+ 368. Fix bug in PCI code for Solaris/SPARC (Marc La France).
+ 367. When enabling PCI adapters, also enable their bus mastering capability;
+ Consequently, deprecate xf86EnablePciBusMaster() (Marc La France).
+ 366. Fix lndir's handling of relative symbolic links, and update the man page
+ to document the -withrevinfo flag (H. J. Lu, Marc La France).
+ 365. Xdm patches: realloc usage, zero malloc()ated memory, enable
+ /dev/urandom on NetBSD 1.4 and later, OpenBSD patches (#5345,
+ Mike A. Harris, #5401, Matthias Scheler, Matthieu Herrb)
+ 364. Xterm patches #168, #169 (Thomas Dickey).
+ 363. In certain circumstances, allow VGA-rerouting through Simba bridges.
+ This only affects UltraSPARC-IIi systems. This is a small but
+ necessary step in eradicating SparcArchitecture's need to compile the ati
+ dribver with -DAVOID_CPIO (Marc La France).
+ 362. In int10, ignore interrupts whose simulation isn't yet implemented.
+ Previously, such interrupts caused the emulation to stop. (Egbert Eich,
+ Marc La France).
+ 361. Add full support for multi-head on 460GX-based Itanium systems
+ (Marc La France, with documentation loaned by Intel under NDA).
+ 360. Fix Darwin build problems with libXrandr and the new FreeType2 backend
+ (Torrey T. Lyons).
+ 359. Savage driver updates.
+ - Support for ProSavage DDR (PCI ID 0x8D04)
+ - TV output fixes
+ - support for -pixmap24 flag
+ - XAA fixes to cure lockups
+ (#5412, Tim Roberts).
+ 358. Enable version controlled .dll's on Cygwin/XFree86 (Alexander Gottwald).
+ 357. Some build fixes for Cygwin/XFree86 (Alan Hourihane).
+ 356. Add new FreeType2 backend which fixes a bug with -c- fonts
+ (#5347, #5348, Juliusz Chroboczek).
+ 355. Add new command line options to glxinfo for more detailed output
+ (#5354, Brian Paul).
+ 354. Support for 24bpp, fix screen blanking and bug fixes for newport driver
+ (#5329, #5349, Guido Guenther).
+ 353. Add RandR support to XFree86 DDX. (Keith Packard)
+ 352. Update RandR extension to 1.0. Eliminate depth switching
+ (Keith Packard, Jim Gettys)
+ 351. Fix XDarwin rootless crash when window resizing with complex bit
+ gravity (Greg Parker).
+ 350. Fix some incorrect mappings in the gbk-0.enc encodings file (#5313,
+ Tomohiro KUBOTA).
+ 349. Fix C precedence bug in mfb (#5309, Tassia St. Germain).
+ 348. Updates to mkfontscale (#5307, Juliusz Chroboczek).
+ 347. Add SharedXcursorReqs to Cygwin build (#5405, Harold Hunt).
+ 346. Add image transformation and subpixel order to Render (Keith Packard)
+ 345. Add Xcursor-def.cpp to Xcursor library (#5350, Alexander Gottwald).
+ 344. Update to pci.ids to 2002-09-24 snapshot (Marc La France).
+ 343. Add a little utility to read files through mmap() (Marc La France).
+ 342. Implement a means to ignore certain host bridges while determining PCI
+ bus topology (not yet used) (Marc La France).
+ 341. Bridge driver interface fixups for host bridges (Marc La France).
+ 340. Change makedepend to recognise invocations of parameter'ed macros
+ (Marc La France).
+ 339. Major redesign in the Xedit syntax highlight code. Now there isn't
+ anymore the builtin C mode, but a new version using the xedit lisp
+ interpreter, as well as several new modes, including Lisp/Scheme,
+ Imakefile, X Resource files, Makefile, Manpage source, Sgml and
+ Html (Paulo César Pereira de Andrade).
+ 338. Print a warning if more than one renderer is registered for a font type
+ (#5305, Juliusz Chroboczek).
+ 337. Fix a double free() that can cause a crash in XCloseIM() (based one
+ #5303, Mo DeJong).
+ 336. Allow xman's MANCONF definition to be specified in the Imakefile
+ (based on #5302, Mike Harris).
+ 335. Config typo and update for Linux on Hitachi SuperH architecture (#5301,
+ ISHIKAWA Mutsumi).
+ 334. Add a "DefaultRefresh" option to the vesa driver (David Dawes).
+ 333. Fix build problem when calling GNU make with "--" prefixed options
+ (#5291, Toomas (toomas at tklabor.ee)).
+ 332. Avoid noise from hostname call in startx (#5270, Mike Harris).
+ 331. xwd ignores the -frame option if the -id option is used (#5251,
+ Mike Harris).
+ 330. Fix problem where DRIUnlock was called when DRI fails to load
+ (Kevin Martin)
+ 329. Fix erroneous warnings about removing DRM signal handler when DRI
+ fails to load (Kevin Martin)
+ 328. Add LINE_LIMIT_COORDS option to XAA to work around limited coordinate
+ space for lines on Radeons (Kevin Martin)
+ 327. Fix Radeon DGA code to use XAA sync function (Michel Dänzer)
+ 326. Major rework of Radeon accel code:
+ - Merge CP and MMIO code (Kevin Martin and Michel Dänzer)
+ - Fix indirect buffer CP code (Kevin Martin and Michel Dänzer)
+ - Add CP support for scanline color expansion and image writes
+ (Michel Dänzer)
+ - Fix Mono8x8 problems (Kevin Martin and Michel Dänzer)
+ - Fix clipping routine to properly set transparency and
+ dp_gui_master_cntl reg (Kevin Martin and Michel Dänzer)
+ - Fix clipping calculation errors (Kevin Martin)
+ - Properly set line bias so that sw rendered solid and dashed lines
+ match the accel TwoPoint lines (Kevin Martin)
+ - Fix drawing last point for solid and dashed lines (Kevin Martin)
+ - Remove NoLineAccel option since two point lines work (Kevin Martin)
+ 325. Export some more Xft symbols (Cygwin) that are needed for qt 3.x
+ (#5285, Ralf Habacker).
+ 324. Don't sleep on Cygwin for ICE directory mode problems (#5284,
+ Ralf Habacker).
+ 323. Fix a bug in XtGetDisplays() with more than 1 open display (#5282,
+ Kip Rugger).
+ 322. Second part of xkb multi-layout keyboard map support (#5321,
+ Ivan Pascal).
+ 321. Allow the Record extension to report logical coordinated with Xinerama
+ (#5231, Paul Stewart).
+ 320. Allow the XTrap extension to report logical coordinated with Xinerama
+ (#5230, Paul Stewart).
+ 319. Moved LdPreLib define after the vendor/OS specific config files
+ as it may depend on setting done there (Egbert Eich).
+ 318. Several fixes for cross compile environment (Egbert Eich).
+ 317. Added code to allow for building of static only libraries with
+ -fPIC for platforms which require it (Egbert Eich).
+ 316. Added '-m32' to gcc flags as default for ia32 builds when gcc version
+ is >= 3.1. This allows building a 32 bit Version of X on 64bit x86-64
+ (Egbert Eich).
+ 315. Changed direct calls of ld to 'gcc -nostdlib' for Linux (Egbert Eich).
+ 314. Changed calls to as to 'gcc -c -x assembler-with-cpp' for Linux
+ (Egbert Eich).
+ 313. Added '-fno-strict-aliasing' flag to gcc version >= 3.1 (Egbert Eich).
+ Strict requires that one address must not contain pointers to
+ different types - a feature heavily used by X (Egbert Eich).
+ 312. Fixed a core dump problem in libXtt (?) (Egbert Eich).
+ 311. Removed '#pragma pack' from structures that contain function pointers
+ in x86emu. This causes problems on gcc 3.1 for ia64 (Egbert Eich).
+ 310. Added defines for missing X types to saverproto.h (Egbert Eich).
+ 309. Fixed compiler warings generated by gcc >= 3.1 in mesa drivers
+ (Egbert Eich).
+ 308. For platforms that allow both 32 and 64 bit libraries to be executed
+ split Xlib i18n modules path into
+ <libpath>/X11R6/lib/X11/locale/lib/common and
+ <libpath>/X11R6/lib/X11/locale/lib64/common. 'lib64' has been defined
+ to be the default path for 64bit shared libraries on these platforms
+ (Egbert Eich).
+ 307. Fixed obvious typo in OMlib (Egbert Eich).
+ 306. Fixed code in cfb that didn't comply with C sequence rules.
+ Modern C compilers tend to be more aggressive on code reordering
+ (Egbert Eich).
+ 305. Changed arguments of NoopDDA() from VarArgs to void. Handling
+ of VarArgs by gcc isn't compatible with the way it was used
+ on certain platforms (Egbert Eich).
+ 304. Added support for 32bit pixmaps for 24bit overlay framebuffers in
+ fb overlay code (Egbert Eich).
+ 303. Fixed kdrive to print a meaningful error message instead of just
+ core dump when no matching graphics cards is found (Egbert Eich).
+ 302. fixed portability bug in xwd (Andreas Schwab <schwab@suse.de>)
+ 301. fixed X Server crash, which happended each time a proportional iso10646
+ font was loaded with xtt backend (Yong Li <rigel863@yahoo.com>)
+ 300. Added some ARM specific fixes to compiler.h (Uli Hecht).
+ 299. Added a virtual 'dummy' driver (Egbert Eich).
+ 298. Fixed core dump when certain access functions are not set in
+ xf86Bus.c (Egbert Eich).
+ 297. Fixed problem where SIGIO could be disabled after a server reset.
+ 296. Added configurable list of devices the xf86Misc extension is allowed
+ to change the mouse device to (Egbert Eich).
+ 295. Changed default mouse type to 'auto' when generating config file
+ with '-configure' (Egbert Eich).
+ 294. Made sure keyboard modifier settings are consistent after exit
+ from DGA when the xkb extension is used (Egbert Eich).
+ 293. Disabled keyboard processing when Xserver is suspended by power
+ management.
+ This allows effective locking of laptops when stolen (Egbert Eich).
+ 292. Added/improved options for lockfile syncing (Egbert Eich).
+ 291. Added support for backup copy of Xserver logfile (Egbert Eich).
+ 290. Fixed GetTimeInMillis() to use deltas instead of absolute time
+ returend by gettimeofday(). This ensures time is monotonic in X
+ (Egbert Eich).
+ 289. Fixed xf86Misc extension to allow modification of Expps2 mice
+ (Egbert Eich).
+ 288. Made code in xf86MiscExt.c more readable (Egbert Eich).
+ 287. Fixed PCI CardBus bridge handling (Egbert Eich).
+ 286. Added code to reenable PCI bus mastering after coming back from a
+ VT switch to radeon driver (Charl P. Botha <http://cpbotha.net/>)
+ (Egbert Eich).
+ 285. Dito for r128 driver (M. Harris).
+ 284. Dito for glint and mga driver (Egbert Eich).
+ 283. Fixed double scan issues for low res modes in C&T driver (Egbert Eich).
+ 282. Set rgbBits to 8 for all HiQV chips in chips driver (Egbert Eich).
+ 281. Moved initialization of accel funtions past initialization of
+ offscreen fb manager in chips driver (Egbert Eich).
+ 280. Fixed initialization of video in chips driver (?).
+ 279. Fixed HALlib problem restoring text mode on G550 (Egbert Eich).
+ 278. Restructured and included Matrox's Merged Framebuffer changes
+ to mga driver (Egbert Eich).
+ 277. G450/550 clockchip programming fixes (Matrox).
+ 276. Fixed HW Cursor for HALlib frame granularity (Egbert Eich).
+ 275. Enabling 2D accel in 24-bit for neomagic 2360 and 2380 (Egbert Eich).
+ 274. Added support for builtin 1024x480 mode of Sony subnotebooks for
+ Neomagic driver (Egbert Eich).
+ 273. Fixed support for lowRes (320x240) modes in neomagic driver
+ (Egbert Eich).
+ 272. Fixed RAC function registration in S3 driver (Egbert Eich).
+ 271. Added some voodoo to screen initialization of S3 driver (Egbert Eich).
+ 270. Fixed vbe/int10 support in SMI driver. It used to core dump
+ when BIOS was not usable (Egbert Eich).
+ 269. Separated BRIGHTNESS and and CAPTURE_BRIGNTESS video attributes
+ in smi driver: CAPTURE_BRIGHTNESS refers to the capture chip
+ (ie. Philips SAA7110) while BRIGHTNESS controls the video overlay
+ of the SMI chip itself (Egbert Eich).
+ 268. Disable automatic loading of DRI when running SUN ffb as this is
+ inconsistent with other drivers (Thorsten Kukuk).
+ 267. Fixed Gamma/Brightness code in trident driver (Egbert Eich).
+ 266. Added FpDelay debugging option (Egbert Eich).
+ 260. Fixed video support for Trident 9397 (Egbert Eich).
+ 265. Fixed Cursor/VT switch support for vmware driver (Egbert Eich).
+ 264. Fixed Blit problems in vmware driver when running KDE (Egbert Eich).
+ 263. Added RENDER support to vmware driver (Egbert Eich).
+ 262. Added C&T 69030 to extrapci.ids (Egbert Eich).
+ 261. Improved mouse autodetection code (Egbert Eich).
+ 260. Restructured int10 code so that vm86 and x86emu support can be loaded
+ as modules. Implemented heuristic to try vm86 first and fall back to
+ x86emu. This allows 32 bit Xservers to run on x86_64 on 64-bit kernel
+ without vm86 support (Egbert Eich).
+ 259. Restructured elf loader: determine which section to load from elfheader
+ flags (Egbert Eich).
+ 258. Adding RENDER Support to RAC (Egbert Eich).
+ 257. Using borderClip instead of borderSize region for redisplay function
+ in miext/shadow code to avoid core dumps when vt switched away
+ (Egbert Eich).
+ 256. Replacing sprintf() by snprintf() in lbxproxy to eliminate possible
+ buffer overrun exploits (Egbert Eich).
+ 255. KP_Decimal fixes to Czech and Slovak keybards
+ (Jan Holesovsky <kendy@suse.cz>) (Egbert Eich).
+ 254. Treat PCI-to-MCA and PCI-to_EISA bridges as PCI-to-ISA (Marc La France).
+ 253. Correct the server's understanding of CardBus resource ranges
+ (Marc La France).
+ 252. Ignore unconfigured (and mis-configured) PCI-to-PCI and PCI-to-CardBus
+ bridges (Marc La France).
+ 251. Prevent infinite loops during VGA re-routing (Marc La France).
+ 250. Add a framework for bus bridge drivers and use it to rework the handling
+ of Sun's Simba P2P bridges (Marc La France).
+ 249. Fix bdftopcf memory leak (Marc La France).
+ 248. XVideo support for the i830 and i845G (David Dawes, Alan Hourihane).
+ 247. Fix various bugs in the DRI support for the i830 and i845G
+ (Keith Whitwell).
+ 246. Major rework of the 2D i830/i845G support, including:
+ - Improve VESA mode selection, and fix refresh rate selection.
+ - Don't duplicate functions provided in the vbe modules.
+ - Don't duplicate functions provided in the vgahw module.
+ - Rewrite memory allocation.
+ - Rewrite initialisation and save/restore state handling.
+ - Decouple the i810 support from i830 and later.
+ - Remove various unnecessary hacks and workarounds.
+ - Fix an 845G problem with the ring buffer not in pre-allocated
+ memory.
+ - Fix screen blanking.
+ - Fix some HW cursor glitches, and turn HW cursor off at VT switch
+ and exit.
+ - Don't attempt to use the i830's function 1 entity.
+ - Fix problems with option handling.
+ (David Dawes).
+ 245. A "hammer" approach at ensuring font properties are freed properly
+ (Marc La France).
+ 244. Fix 'su' usage for FreeBSD in the default xdm config (Eric Anholt).
+ 243. Fix a FreeBSD scrollwheel problem that shows up with gcc 3.1
+ (Eric Anholt).
+ 242. Make C++ libraries on FreeBSD get linked with $(CXX), fixing libGLU
+ (Eric Anholt).
+ 241. FreeBSD.cf updates, including enabling SSE/3DNow support (Eric Anholt).
+ 240. Intel 830 and 845G DRI support, including i830 support updated for
+ Mesa 4.x (#5288, Jeff Hartmann, 2D3D).
+ 239. [SECURITY] Fix an Xlib problem that made it possible to load arbitrary
+ code into privileged clients.
+ 238. Add Xcursor library. Make Xlib use it. (Keith Packard)
+ 237. Fix threaded libraries on Mac OS X 10.2 (A.1229, Marko Karppinen).
+ 236. Add hardware accelerated GLX to XDarwin (Greg Parker).
+ 235. Use Imake custom version variables in XDarwin startup message
+ (Torrey T. Lyons).
+ 234. Attempt to prevent PCI scans on non-PCI ix86 systems (Marc La France).
+ 233. Allow master aborts on CardBus buses to complete normally during PCI
+ scans (Marc La France).
+ 232. Fix bug that prevented the server from restoring CardBus data properly
+ (Marc La France).
+ 231. Fix DEVID define and make it more generally available (Marc La France).
+ 230. Fix bug in NetBSD PCI code (Marc La France).
+ 229. Add an option to completely disable PCI scans (Marc La France).
+ 228. Xterm patch #167 (Thomas Dickey).
+ 227. Add CreateCursor request to Render extension (Keith Packard)
+ 226. Change scanpci to not disable I/O too early (Marc La France).
+ 225. Better error handling in xfs -ls argument parsing (Mordy Ovits).
+ 224. Make loader ignore ELF objects that don't define any symbols (H. J. Lu)
+ 223. Add a HasGcc3 imake symbol (Marc La France).
+ 222. Enable threaded libraries on Darwin (Jeff Whitaker and Torrey T. Lyons).
+ 221. Xaw documentation fixes (A.1218, Paul Vojta).
+ 220. Add some mode collection/handling interfaces to the vbe module,
+ which makes it easier for drivers to set modes via the video BIOS
+ (David Dawes).
+ 219. I830/845 Workaround for BIOSes which force 1MB stolen memory, and
+ agpgart related fix (#5300, Abraham vd Merwe).
+ 218. Add NetBSD specific PCI access functions for powerpc and alpha
+ platforms (Charles Hannum).
+ 217. Split bsd_video.c into architecture specific files, and merge NetBSD
+ alpha and powerpc support there. (Matthieu Herrb, Simon Burge,
+ Charles Hannum & other NetBSD developers).
+ 216. Define CSRG_BASED for Darwin and fix xman so it works on Darwin
+ (Torrey T. Lyons).
+ 215. On Darwin, fix imake to find Gcc and correct config for RawCppCmd
+ (Torrey T. Lyons).
+ 214. Add functions to allow modules to query the core X server version
+ and the version of its sub modules (David Dawes).
+ 213. Fix scanpci's printing of 64-bit PCI bases (Marc La France).
+ 212. Add missing dependency and regenerate xf86PciStdIds.h accordingly
+ (Marc La France).
+ 211. A more flexible way of dealing with ix86 motherboard chipsets that can
+ only implement less than the full 256 PCI buses (Marc La France).
+ 210. RAC-related fixups to ATI drivers and xf86SetOperatingState() call
+ cleanups in most drivers (Marc La France).
+ 209. Fix int10 miscompilation glitch on IA-64 (Marc La France).
+ 208. Add support for Permedia3 (rev C) chips that use slightly different
+ clock programming techniques (Jay Estabrook).
+ 207. Fix Finder warnings about XDarwin plist format on Jaguar
+ (Torrey T. Lyons).
+ 206. Fix XDarwin build issues on Jaguar (Sean Fagan).
+ 205. Fix Radeon DDC for non-Dell cards, and fix a radeon pci id-related
+ build problem (#5326, Andrew C Aitchison).
+ 204. Change the X server (and scanpci) to use the pci.ids file (from
+ pciids.sf.net) for vendor/device descriptions (David Dawes).
+ 203. Change XDarwin to use NSQuickDrawView instead of Carbon windows to
+ get a QuickDraw graphics port for rootless windows (Torrey T. Lyons).
+ 202. Add support for some missing 32-bit address modes to x86emu. Some
+ video BIOSes use them, especially those for some of the integrated
+ Intel chipsets, and this fixes int10/vbe support for these on
+ platforms that use the emulator (David Dawes).
+ 201. Add PCI ID for ATI Radeon Mobility M7 'LX' (#5233, Mike Harris).
+ 200. Fix CrossCompile environment for Cygwin/XFree86
+ (#5324, Alexander Gottwald, Harold Hunt).
+ 199. ATI patch to:
+ - Fix Dell OEM VE card support
+ - Add better clone mode support
+ - Fix large panel (>= 1600x1200) detection and initialization problems
+ - Remove "PanelSize" and "CrtScreen" options since they are no longer
+ needed with new CloneMode and improved flat panel support
+ - Add "DDCMode" option to detect and use DDC modes
+ - Add "PanelOff" option to disable panel on laptops
+ - Fix corrupted console problem
+ - Other misc fixes
+ (#A.1043, Hui Yu@ATI).
+ 198. Remove -DNO_TCP_H from cygwin.cf for Cygwin/XFree86 (#5320, Harold Hunt).
+ 197. Major updates to Cygwin/XFree86.
+ - fix depth 24 issues.
+ - fix the handling of the DirectDraw module.
+ - disable the use of the LAYER/RANDR extension.
+ - lots of bug fixes.
+ (#5318, #5317, Harold L. Hunt, Alan Hourihane).
+ 196. When using the vesa driver and the DisplaySize option the server
+ would crash with a floating point exception due to a divide by zero
+ in miscreeninit() (#5298, Mike A. Harris).
+ 195. The function MoveLine in lib/Xaw/TextAction.c sometimes attempts to
+ read uninitialized memory when hit ctrl-N in a Text widget to move to
+ the next line (#5245, Johnathan Kamens).
+ 194. Adjust -probe for change in default stderr verbosity (Marc La France).
+ 193. Radeon patch for Xv on all known Radeon devices (James Ralston and
+ Keith Packard).
+ 192. New XDarwin application icon (Michael Oland).
+ 191. Dead strip unneeded code in rootlessValTree.c and other miscellaneous
+ XDarwin code cleanup (Greg Parker and Torrey T. Lyons).
+ 190. Lots of Cygwin/XFree86 cleanups and fixes (#5304, Harold Hunt)
+ 189. Fix rootless XDarwin crash when resizing a window with negative x
+ coordinate (Torrey T. Lyons).
+
+XFree86 4.2.99.1 (7 June 2002)
+ 188. Fix some build problems when building with shared libraries disabled
+ (David Dawes).
+ 187. Update the magellan input driver and turn it on in the build process
+ (#A.1024, Christoph Koulen).
+ 186. Add Peritek Borealis support to the I128 driver (Robin Cutshaw).
+ 185. Modify the r128 and radeon drivers to use fbdev's DPMS support when
+ fbdev is enabled (#5219, Michel Dänzer).
+ 184. Add support for the composite sync mode flag to the radeon driver
+ (#5219, Michel Dänzer).
+ 183. Add a mkfontscale utility for creating fonts.scale files (#5213, 5214,
+ Juliusz Chroboczek).
+ 182. Add a 1152x768 mode suitable for Titanium PowerBooks to the set of
+ build-in modes (#5212, Michel Dänzer).
+ 181. Add support to xkbcomp and libxkbfile for composing multi-layout
+ keyboard maps from partial "single layout" files. This allows
+ the XkbLayout to be specified as a comma-separated list of single
+ layout names. Note: new "single layout" symbol maps aren't available
+ yet. (#5210, Ivan Pascal).
+ 180. Fix Xv endianess problem with the Radeon driver (#5207, Guido Guenther).
+ 179. Updates to the Finnish xkb map, including:
+ - add ISO-8859-15 missing symbols ([zZsS]caron)
+ - reorganize some special symbols (such as paragraph, cent, division)
+ - map AltGr+SPCE as space, nobreakspace comes way too often by accident
+ - minor white space/comment cleanups
+ (#5197, Marko Myllynen).
+ 178. Add an option to the r128 driver for enabling DMA for Xv image transfers
+ (#5195, Michel Dänzer).
+ 177. Make the 'distclean' target remove depend files (#5194,
+ Carlos A M dos Santos).
+ 176. Fix bad usage of "UseInstalled" in FreeBSD.cf (#5192,
+ Carlos A M dos Santos).
+ 175. Several xkb layout updates:
+ - Added other Armenian layouts.
+ - Added Swedish dvorak layout.
+ - Fixed typo in "la" file.
+ - Added EuroSign in Dutch keyboard.
+ - Added a "comma" variant for "ro" keyboard allowing to type real comma
+ below Romanian letters.
+ - New file "ro2" with the real Romanian layout (the file "ro" is not a
+ Romanian keyboard, but a modified US one that has been hacked to
+ include Romanian letters).
+ (#5191, Pablo Saratxaga).
+ 174. Fix makedepend so that it can parse a unary '+' operator (#5185,
+ Mark Snitily).
+ 173. Fix a typo in Xvesa's emulation of instructions forbidden in vm86
+ mode (#5184, Juliusz Chroboczek)
+ 172. Fix a bounds check in Xlib's Region code (#5183, Owen Taylor).
+ 171. Fix LIBXML2LIBDIR name clash in lib/Imakefile (#5180, ISHIKAWA Mutsumi).
+ 170. Avoid a problem with setfontdirs when run in some locales (#5179,
+ ISHIKAWA Mutsumi).
+ 169. A little tuning for XtAppPeekEvent() (#5178, Dan McNichol).
+ 168. Add a command line option to luit to specify the encoding (#5177, 5181,
+ Tomohiro Kubota).
+ 167. A fix for luit's command line argument handling (#5173, Tomohiro Kubota).
+ 166. Add support to luit for some more 8-bit encodings (#5171,
+ Juliusz Chroboczek).
+ 165. Add an option to luit to enable using GL codes instead of GR codes
+ after a single shift for keyboard input (#5170-5172, Tomohiro Kubota
+ and Juliusz Chroboczek).
+ 164. Fix an fbdev driver crash when the VT isn't active (#5169,
+ Michel Dänzer).
+ 163. Fix a bug that resulted in XwcTextPropertyToTextList() storing an
+ incomplete list (#5168, Tassia St. Germain, for X.Org).
+ 162. Add "ISO8859-16" to the registry (#5167, Tassia St. Germain, for X.Org).
+ 161. A revised Greek xkb layout, including a three-level "extended"
+ variant, and a "polytonic" variant (#5165, Vasilis Vasaitis).
+ 160. Add support for an el_GR.UTF-8 locale, including a compose file with
+ support for polytonic Greek text (#5165, Vasilis Vasaitis).
+ 159. Add missing zh_CN XI18N_OBJS file (#5164, Yong Li).
+ 158. Make xfs chdir to "/" before fork()ing (#5162, Mike Harris).
+ 157. Add some reference counting for Xlib's i18n modules, preventing
+ a module getting unloaded while it's still in use (#5160, Owen Taylor).
+ 156. Update for SCO OpenServer support (#5158, Kean Johnston).
+ 155. Add aliases for the Brazilian Portuguese locale as defined on FreeBSD
+ (#5157, Carlos A M dos Santos).
+ 154. Recognise the en_UK.ISO8859-15 and en_US.ISO8859-15 locales (#5156, 5186,
+ Matthias Scheler).
+ 153. Some cleanups for the UTF-8 Compose file, including:
+ - Better support for Greek
+ - Typo fixes, including incorrect character literals and keysyms.
+ (#5154, Vasilis Vasaitis).
+ 152. Modify Xt's default fallback font pattern to work better in locales
+ where the current one fails to find a useful font (#5152,
+ Tomohiro KUBOTA).
+ 151. Updates to bdf/misc UCS fonts, and generate ISO8859-16 subsets
+ (#5147, Markus Kuhn).
+ 150. Fix some empty delay loops and jiffie wrap bugs in the i830 drm driver
+ (#5149, Arjan Van de Ven).
+ 149. Fix a potential NULL dereference in the drm kernel module (#5148,
+ Andreas Schwab).
+ 148. Major OS/2 support update (#5119, Holger Veit).
+ 147. Fix mode setting in DGA on the Rage128 & Radeon drivers (Alan Hourihane).
+ 146. Build libXt as a flat namespace image on Darwin (Torrey T. Lyons).
+ 145. Install the bitmap file xc/programs/bitmap/Stipple as Stippler on file
+ systems that are not case sensitive (Torrey T. Lyons).
+ 144. Fix enabling of MMIO window on BladeXP desktop chips (Alan Hourihane).
+ 143. Due to bugs in the CyberBladei7/i1 series that cause offset problems,
+ we're disabling the hardware cursor (for now) (Alan Hourihane).
+ 142. Fix Xft-def.cpp file for Cygwin/XFree86 (#5283, Harold Hunt).
+ 141. Server support for OpenBSD/sparc64 (Jason Wright, Matthieu Herrb).
+ 140. Alignment fixes for Xvideo on the Permedia3 (Alan Hourihane).
+ 139. lndir fix for paths containing '//' (H. J. Lu).
+ 138. Fix blank display problem in trident driver for older TGUI series
+ chips, and a few Xv cleanups too (Alan Hourihane).
+ 137. Enable MIT-SHM extension in Xnest server (#A.795, Steve Schwarz).
+ 136. Fix typo in Rage128 DGA driver (#5187. Charles M. Hannum).
+ 135. Fix enabling of DRI when XvMC is disabled (#5208, Matthew Sottek, Intel).
+ 134. Fix HW Cursor handling in vmware driver (#5193, Jeremy, VMWare).
+ 133. YUV handling updates for v4l module. Can now handle multiple formats
+ and find common format for both videocard and kernel.(#5196, Gerd Knorr).
+ 132. Savage driver updates (#5203, Tim Roberts).
+ 131. Drop the indirect buffer after ScreenInit, fixes corruption and
+ kernel error messages. (#5199, Michel Dänzer).
+ 130. Add Polygon support to Render extension (Carl Worth, Keith Packard)
+ 129. Add Intel i845G 2D support to the i8x0 driver, DRI is disabled.
+ (#A.1062, Graeme Fisher, 2D3D).
+ 128. Fix RGB/BGR inversion problem and screen blanking in the glint
+ driver (Alan Hourihane).
+ 127. Add MIT-SCREEN-SAVER extension docs (Alan Coopersmith).
+ 126. Fix problems opening /dev/fb0 in fbdevhw layer (#5229, Michel Dänzer).
+ 125. Update the apm driver (#5227, Loic Grenie).
+ 124. Update the Japanese localization of XDarwin (Toshimitsu Tanaka).
+ 123. Symbol table cleanup, leaving xf86GetPointerScreenFuncs() as the only
+ common/xf86Cursor.c entry available to modules (Marc La France).
+ 122. Fix VidMode-generated mode switches by making them go through (almost)
+ the same code path as keyboard-generated mode switches (Marc La France).
+ 121. Allow AGP apertures to overlap with other BIOS-assigned PCI resources
+ (Marc La France).
+ 120. Indent'd most of xterm's C code (Thomas Dickey).
+ 119. Major Radeon driver code cleanup (Kevin Martin).
+ 118. Radeon Xv fixes and video key support added (Keith Packard).
+ 117. DPMS support for DFP/LCD and second head added for Radeon (Hui Yu@ATI).
+ 116. Option to disable line acceleration added since Radeon only has 14 bits
+ for lines and clipping. This will be changed to an XAA option for 14
+ bit support in the future (Hui Yu@ATI, Kevin Martin).
+ 115. Radeon DDC and DFP handling improvements (Hui Yu@ATI).
+ 114. Fixes for DRI lockup problems with Radeon 7500/VE and the AMD 761
+ chipset (Hui Yu@ATI).
+ 113. Radeon PLL routines rewritten with ATOMIC_UPDATE enabled (Hui Yu@ATI).
+ 112. Clone mode added to Radeon driver (not yet functional and disabled
+ by default) (Hui Yu@ATI, Kevin Martin).
+ 111. Fix usage of BuildBinTop in Cygwin/XFree86 (#5223, Harold Hunt).
+ 110. Implement WarpCursor for Cygwin/XFree86, and use GetProcAddress
+ instead of relying on ddraw.dll (#5220-#5222, Harold Hunt).
+ 109. Fix bug that prevented the vesa driver from accessing VGA CRTC registers
+ (Marc La France).
+ 108. New pre-processor files for expat, fontconfig and rename of
+ OSmesa-def.cpp to OSMesa-def.cpp (#5215-#5218, Alexander Gottwald).
+ 107. Rework ati, atimisc, r128 and radeon module versioning (Marc La France).
+ 106. Code clean up for the original Rage LT (Marc La France).
+ 105. An attempt at disabling display switches while the server is running on
+ an LT Pro or Mobility M1 (Marc La France).
+ 104. Make atimisc, r128 and radeon modules register the symbols they reference
+ at module load time, rather than PreInit() (Marc La France).
+ 103. Fix rounding error in Mach64 DSP calculation (Marc La France).
+ 102. Convert xmh to ANSI C (Thomas Dickey).
+ 101. Xterm patch #166 (Thomas Dickey).
+ 100. Fix keyboard beeps on Cygwin/XFree86 (#5211, Harold Hunt).
+ 99. Fixed i810 crash on vt switch due to call to Sync() while switched away
+ (Andris Pavenis).
+ 98. Fixed MGAG550 HW Cursor (Laure-Amelie Couturie).
+ 97. Added Xv support to neomagic driver (Shigehiro Nomura).
+ 96. Implemented cross compile environment (Egbert Eich).
+ 95. Added AMD x86-64 architecture support (Egbert Eich).
+ 94. Fixed memory leaks in xkb code (Egbert Eich).
+ 93. Fixed several memory leaks in the config file parser and initialization
+ routines (Egbert Eich).
+ 92. Added CardBus bridge support (Egbert Eich).
+ 91. Fixed strdup() define in glx (Egbert Eich).
+ 90. Extended xf86misc extension to support changing the mouse device
+ (Egbert Eich).
+ 89. Replaced strdup() in xf86Configure.c with xalloc()/strcpy() to avoid
+ conflicts when using internal malloc (Egbert Eich).
+ 88. Extended memory debugging: Added signal handler to trigger a memory
+ debugger dump on SIGUSR2 when compiled with memleak support
+ (Egbert Eich).
+ 87. Set vtSema to FALSE when suspended by APM to catch calls to 2D accel
+ functions (Egbert Eich).
+ 86. Implemented mouse protocol detection by analyzing data stream
+ (Egbert Eich).
+ 85. Added PnP mouse detection for PS/2, ImPS/2 and older MS serial mice
+ (Egbert Eich).
+ 84. Fixed gamma correction code for Trident 9397 (Alan Hourihane).
+ 83. Fixed C&T driver to avoid initialization of video in non-linear mode
+ (Egbert Eich).
+ 82. Changed C&T driver to allow video even if acceleration is disabled
+ (Egbert Eich).
+ 81. Attempt to implement a more consistent handling of HW cursor in C&T
+ driver (Egbert Eich).
+ 80. Fixed MGA driver to make HALlib work with VESA framebuffer modes
+ (Egbert Eich).
+ 79. Reworked Rendition driver (Egbert Eich).
+ 78. S3 Virge driver: added minimal gap between SyncStart and HDisplay to
+ avoid video lockups (Egbert Eich).
+ 77. Fixed memory leaks in S3 Savage driver (Egbert Eich).
+ 76. Modified several drivers to do int10 initialization using the
+ VBE functions instead of calling int10 directly (Egbert Eich).
+ 75. Fixed video support and mode initialization in Silicon Motion driver,
+ removed wait for v-retrace (Egbert Eich).
+ 74. Misc fixes to SiS driver (Thomas Winischhofer).
+ 73. Added support for 1400x1050 screen in Trident driver (Egbert Eich).
+ 72. Fixed several video issues for Trident CyberBladeXP chips (Egbert Eich).
+ 71. Added probe for Tseng ISA chips (Egbert Eich).
+ 70. Added 'KGAUniversal' option to generic vga driver which changes handling
+ left overscan to work also on chips with C&T core (ie all C&T and Intel
+ graphics chips) (Egbert Eich).
+ 69. Modified int10 code to map area between V_BIOS and SYS_BIOS instead of
+ copying it. Copying causes problems if legacy devices map MMIO
+ registers there (Egbert Eich).
+ 68. Implemented an extended int10 init function to allow passing flags
+ (Egbert Eich).
+ 67. Implemented optional handling of BIOS video mode scratch area in int10
+ code (Egbert Eich).
+ 66. Again modified MTRR range splitting (Egbert Eich).
+ 65. Added funtions to VBE to save and restore a video mode (Egbert Eich).
+ 64. Added missing commas to symbols/us_intl (Hans Lunsing).
+ 63. Added Ungherese (qwerty) support (Koblinger Egmont).
+ 62. Added Euro symbol for hungarian kbd layout (Koblinger Egmont).
+ 61. Build with libcurses on Darwin for forward compatibility
+ (Jordan Hubbard).
+ 60. Add Trident CyberBladeXP acceleration (Alan Hourihane).
+ 59. Major XDarwin rootless mode rewrite:
+ - Use Carbon to draw directly to windows' backing buffers, rather
+ than "triple" buffering with Core Graphics.
+ - Reorganized Xserver/hw/darwin directory structure to separate out
+ legacy support for Mac OS X 10.0.x.
+ (Torrey T. Lyons and Greg Parker).
+ 58. Fix RGB/BGR inversion problem on Permedia3 chips (Alan Hourihane).
+ 57. Fix server link problem that shows up on ppc (#5205, Guido Guenther).
+ 56. Restore effect of option "NoSilkenMouse" (Marc La France).
+ 55. Fix some nForce graphics regressions caused by recent flat panel and
+ Mac updates to the nv driver (Mark Vojkovich).
+ 54. Recognise the "Absolute" keyword that was documented in the
+ XF86Config man page (David Dawes).
+ 53. Fix the man page information about Absolute screen positioning in
+ the ServerLayout section (David Dawes).
+ 52. SunOS changes to xedit's lisp interpreter (Marc La France).
+ 51. Support the Ti 3026 ramdac with 3DLabs Permedia found on some
+ AccelStar boards (Alan Hourihane).
+ 50. Move int10 softbooting furthur up in the glint driver to post
+ much earlier (Alan Hourihane).
+ 49. Fix bug that sometimes caused makedepend to forget #define'd symbols
+ (Marc La France).
+ 48. MIT-SHM updates (Roberto Zunino, Matthieu Herrb).
+ 47. Import Mesa-4.0.1, and resync with the DRI trunk which is now based
+ on this (Keith Whitwell, Brian Paul, Alan Hourihane, David Dawes).
+ 46. Mga driver updates:
+ - Don't try dual-head mode with the G400 unless the mga_hal module
+ is loaded.
+ - Distinguish between the G400 and G450 when showing the chipset in
+ the log.
+ - Update the mga man page for supported hardware and dual-head
+ support. Futher updates are needed to document all of the
+ drivers's options.
+ (David Dawes).
+ 45. Add -Wundef when compiling the tree with GCC >= 2.8 (Marc La France).
+ 44. Macintosh flat panel fix in the "nv" driver (Mark Vojkovich).
+ 43. XDarwin fixes and improvements for full screen Quartz mode:
+ - Pull full screen specific code out of generic Quartz support.
+ - Install new colormaps correctly with PseudoColor.
+ - Release the screen immediately when closing down.
+ - Do not try to release the screen when closing down in rootless mode.
+ (Torrey T. Lyons).
+ 42. Reimplement Xft library on top of new fontconfig library (Keith Packard).
+ 41. Resync with the final Mesa-3.4.x-based DRI trunk.
+ 40. Add support for wscons bell (Jason Wright).
+ 39. Fix IBM-reported bug that could cause PCI bus lockouts with second
+ generation integrated Mach64 controllers (Marc La France).
+ 38. Rework ATI driver's registration of symbols with the loader
+ (Marc La France).
+ 37. In the ATI driver, add option "CrtDisplay" to force CRT display in a
+ dual display situation (Marc La France).
+ 36. In the ATI driver, rename option "CrtScreen" to "NoPanelDisplay", keeping
+ "CrtScreen" as a private option for compatibility (Marc La France).
+ 35. Document X_NOT_IMPLEMENTED (Marc La France).
+ 34. NetBSD teeny OS version handling improvement in imake (#5176,
+ Matthias Scheler).
+ 33. Build I2C support before building drivers (Marc La France).
+ 32. Fix a problem related to reserving the overlay key in the default
+ colormap in 24+8 mode. This caused some clients using the 8-bit
+ visuals to fail (David Dawes).
+ 31. [SECURITY] Zlib error handling fix (Mark Adler).
+ 30. Put back XDarwin's byte-ordering fix for reading keymappings on
+ Darwin x86 that was inadvertently dropped (Rob Braun).
+ 29. Fix Big Endian hardware cursor bug on GeForce3 (Mark Vojkovich).
+ 28. Experimental flat panel support in the "nv" driver. GeForce2 Go
+ should work now (Mark Vojkovich).
+ 27. XDarwinStartup improvements:
+ - Auto-detect proper mode to run XDarwin.
+ - Find XDarwin.app with Launch Services.
+ - Add XDarwinStartup man page.
+ (Torrey T. Lyons).
+ 26. Localize XDarwin credits in French (Olivier Verdier) and Portuguese
+ (Fabr’cio L. de Castro).
+ 25. Turn off XFree86-Misc and VidMode extensions for XDarwin
+ (Torrey T. Lyons).
+ 24. Localize a few missing strings in XDarwin preferences (Torrey T. Lyons).
+ 23. GeForce4 support (Mark Vojkovich).
+ 22. Add IA-64 460GX PCI IDs (Marc La France).
+ 21. Some vesa driver updates:
+ - Use the common layer's mode validation functions, which gives
+ mode selection behaviour more consistent with other drivers.
+ - Don't force the depth 24 framebuffer bpp. Instead check what
+ framebuffer layouts are supported by VBE, and and choose the
+ layout appropriately.
+ - fb handles 24/32 fb/pixmap layout conversion, so don't use
+ the xf24_32bpp module.
+ - shadow + fb at depth 4 needs the bpp set to 8.
+ (David Dawes).
+ 20. Fix some misleading messages about why modes aren't available
+ (David Dawes).
+ 19. Fix for `hostname` issue on Linux (Marc La France).
+ 18. Fix startx script for ksh (Phillip B. Bruce).
+ 17. Fix Emulate3Buttons for wsmouse protocol on NetBSD and OpenBSD
+ (Matthieu Herrb).
+ 16. Add Portuguese localization of XDarwin front end
+ (Fabr’cio L. de Castro).
+ 15. Fix mouse Protocol "Auto" for SunOS (Marc La France).
+ 14. Relocate all driver low memory accesses (atimisc module not yet done)
+ (Marc La France).
+ 13. Make driver I/O relocatable (atimisc, s3, sis and tseng not yet done)
+ (Marc La France).
+ 12. PCI domain changes for SunOS/SPARC64 (Marc La France).
+ 11. PCI domain changes for Linux/SPARC64 (#4653, David S. Miller,
+ Marc La France).
+ 10. Temporary workaround for IA-64 (Marc La France).
+ 9. Fix SIGSEGV when printing modes that have no modifiers (Marc La France).
+ 8. Revert the ATI driver's composite sync default to off (Marc La France).
+ 7. Add a note to the messages that get printed when a signal is caught
+ during initialization (which includes X -configure) that reported
+ unresolved symbols might not be the reason for the server aborting
+ (David Dawes).
+ 6. Fix symbol registration in some drivers, which reduces the number of
+ symbols reported as "unresolved" when 'X -configure' crashes
+ (David Dawes).
+ 5. Fill in names for BIOS modes in the vesa driver's mode pool that weren't
+ otherwise assigned names (David Dawes).
+ 4. Fix an unresolved symbol in libGLU.so that shows up when building it
+ with gcc-3 (David Dawes).
+ 3. Fix invalid code caused by a memcpy() macro being split by a directive
+ (#5150, Sami Farin).
+ 2. Fix incorrect symbol prefixing with Xlib's i18n modules on Solaris
+ (Keith Packard, David Dawes).
+ 1. Don't try to print mode names when the name is NULL (David Dawes).
+
+XFree86 4.2.0 (18 January 2002)
+ 690. Workaround for hardware bug that prevents older ATI 3D Rage adapters from
+ being assigned to XF86Config device sections (Marc La France).
+
+XFree86 4.1.99.7 (17 January 2002)
+ 689. Fix bug introduced in snapshot 4.1.99.5 causing XDarwin's PseudoramiX
+ extension to always be disabled (Torrey T. Lyons).
+ 688. Disable the pipe check for stdout/stderr that was added in the previous
+ snapshot because it looks like it might cause too many problems
+ (David Dawes).
+ 687. Update the Arabic (ar) XKB keyboard map (#5145, Arabeyes team).
+ 686. Update the Russian (ru) XKB keyboard map, adding two new variants
+ ("typewriter" and "phonetic") (#5143, Ivan Pascal).
+ 685. Remove the lt_a and lt_p XKB keyboard maps (#5139, Nerijus Baliunas).
+ 684. Disable the DRI and print a warning message for Radeon 8500 cards
+ until they are supported (Kevin Martin).
+ 683. Properly detect when no BIOS is present on Radeon cards (#4978,
+ Charles Hannum, Kevin Martin).
+ 682. Delay before restoring VGA registers for Radeons to "fix" VT switch
+ problems (Kevin Martin).
+ 681. Add new PCI IDs from ATI (Kevin Martin).
+ 680. Update the Xinstall.sh script to create version compatibility links for
+ shared freetype libraries when needed (David Dawes).
+ 679. Update Freetype2 shared library versions to match the versions libtool
+ generates (Keith Packard).
+ 678. Doc updates (lots of people, includes #5142, 5144)
+
+XFree86 4.1.99.6 (14 January 2002)
+ 677. Change the default verbosity level for stderr from 1 to 0 (David Dawes).
+ 676. Set the X server's stderr to non-blocking for non-root users
+ (David Dawes).
+ 675. Don't allow the X server to start when stdout or stderr is a pipe for
+ non-root users (David Dawes).
+ 674. Add OpenGL man pages.
+ 673. Avoid duplicate symbol problem with xkbevd on some platform (#A.769,
+ Nicholas Leippe).
+ 672. Updated Ukranian XKB symbols file (#A.764, Andriy Rysin).
+ 671. Fix ELF loader for ARM architecture (#5138, Phil Blundell and
+ Adam C. Powell IV).
+ 670. Fix a race condition in the Linux kernel DRM code (#5136,
+ Arjan van de Ven).
+ 669. Fix DGA support in the s3virge driver (#5135, Kevin Brosius).
+ 668. Add XvBskew, XvRskew to adjust skew values for centering of an
+ Xvideo window for the trident driver (Alan Hourihane).
+ 667. Fix loader for Motorola 68k machines (Alan Hourihane).
+ 666. Fix very high resolution modes (e.g. 1600x1200@16bpp) in the
+ Trident driver (Alan Hourihane).
+ 665. -
+ 664. Quick hack to allow GLX to be included in non-XFree86 servers
+ (Marc La France).
+ 663. More ROP_NEEDS_SOURCE fixes for Savage chipsets (Egbert Eich).
+ 662. Improvements to the SiS driver which should fix a lot of the 630
+ issues (Thomas Winischhofer).
+ 661. In XDarwin IOKit mode, ignore screens sized 1x1 (Torrey T. Lyons).
+ 660. Some missing QNX fixes (#5121, Frank Liu).
+ 659. Update XDarwin man page and usage message for XFree86 4.2.0. Add
+ XFree86 man page to XDarwin distribution (Torrey T. Lyons).
+ 658. Add bn_BD.UTF-8 to locale.dir (Taneem Ahmed).
+ 657. Fix luit not dropping priviledges when run with the -c flag (#5134,
+ Juliusz Chroboczek).
+ 656. Fix unresolved symbol and loader symbol registration problems in the
+ i810 driver that were introduced with the i830 support (David Dawes,
+ Abraham vd Merwe).
+ 655. Fix sparklies problem for other Trident *BladeXP chipsets
+ (Alan Hourihane).
+ 654. In XDarwin IOKit mode, ignore screens that can not provide the requested
+ size, depth, or refresh rate instead of generating a fatal error
+ (Torrey T. Lyons).
+
+XFree86 4.1.99.5 (7 January 2002)
+ 653. Fix some typos in the DRI README (#A.757, Andreas Mohr).
+ 652. xon.sh path setting from 3.3.6 (#A.756, Marc Herbert).
+ 651. Fix a problem with the Radeon driver that was causing the sync polarity
+ to be ignored (#A.753, Vedran Rodic).
+ 650. Set the max clock correctly for the G550 second head (#5133,
+ Luugi Marsan).
+ 649. Fix a Radeon DRI lockup problem (#5128, Steven Pritchard).
+ 648. Back out some mga_g450pll.c changes that cause problems on at least
+ some G450 configurations (#5122, David Woodhouse).
+ 647. Fix some xterm build warnings on *BSD (David Dawes, Thomas Dickey).
+ 646. Some QNX4 fixes/updates (#5121, 5124, 5130, 5131, Frank Liu).
+ 645. Prefer POSIX O_NONBLOCK to O_NDELAY (when defined) in lib/dps (#5121,
+ Frank Liu).
+ 644. Fix portability problem with XpmI.h (based on #5121, Frank Liu).
+ 643. Only use SA_RESTART in xterm when it's available (#5121, Frank Liu).
+ 642. Work around Watcom compiler bug that shows up when building Mesa's
+ stencil.c (David Dawes, based on #5121, Frank Liu).
+ 641. Handle __inline and __inline__ in compiler.h for non-GNU compilers,
+ which makes it more likely that drivers will build with other compilers
+ (David Dawes, based on #5121, Frank Liu).
+ 640. Build fixes for xedit/lisp. Don't define NEED_SNPRINTF when not needed.
+ Avoid a double recursion into subdirs (#5123, Matthieu Herrb).
+ Added code for systems without getpagesize.
+ 639. Fix the xdm's handling of keys, allowing keypad keys to work (#A.662,
+ Servaas Vandenberghe).
+ 638. Fix hang when quitting XDarwin before starting X server
+ (Torrey T. Lyons).
+ 637. Don't add XDarwin's PseudoramiX extension with only one screen
+ (Greg Parker).
+ 636. Add Spanish localization of XDarwin help file (Pablo Di Noto).
+ 635. Improve XDarwinStartup's error reporting (Torrey T. Lyons).
+
+XFree86 4.1.99.4 (28 December 2001)
+ 634. Update the ati/radeon driver to recognise the All-in-Wonder 8500's
+ ID (#5117, Vladimir Dergachev).
+ 633. Fix bug where a pointer may be checked without being intialized in xman
+ (#5120, Martin Husemann).
+ 632. Add an informational message to the radeon driver when LCD/DFP mode
+ validation fails (#5118, Vladimir Dergachev).
+ 631. Handle the ATI Rage128 "PP" variant like the "PR" variant (#4982,
+ Mike Harris).
+ 630. Fix a LynxOS on PowerPC build problem (#A.746, Stuart Lissaman).
+ 629. Fix the names of the Northern Saami keyboards (#A.742,
+ Petter Reinholdtsen).
+ 628. Add Xinerama info to xdpyinfo (#A.741, Greg Parker).
+ 627. Fix an xdm problem caused by not handling an interrupted read (#A.728,
+ Darren Marshall).
+ 626. Add functions completing text control for Render. Bump XRender library
+ minor version (Keith Packard).
+ 625. Add XKB layout info for a newer Logitech iTouch keyboard (#A.727,
+ Dimitromanolakis Apostolos).
+ 624. Fix a problem that shows up with the summa tablet driver when using
+ a Genius EasyPen (#A.714, Anders Melchiorsen).
+ 623. Fix for VT switch problem with the S3 driver (based on #A.677,
+ Juergen Lesny).
+ 622. Remove some more spurious entries in the KSC 5601 encoding file (#A.678,
+ Jungshik Shin).
+ 621. Fix for APM problem on devfs-based Linux systems with APM in a kernel
+ module (#A.663, Denis Zaitsev).
+ 620. Update the mga Xv double buffering to match the more recent submission
+ (#4976, Didier Gautheron).
+ 619. Fix a bug in the XKB Slovak (sk) layout (#A.621, Juraj Bednar).
+ 618. Fix a small window when a SIGIO may be received without a handler
+ installed (David Dawes, based on #A.620, Michel Lespinasse).
+ 617. ISO 8859-{1,7,15} Compose file updates and fixes (#5114,
+ Vasilis Vasaitis).
+ 616. In XDarwin multi-monitor IOKit mode, read screen location from the
+ kernel (Torrey T. Lyons).
+ 615. Update XDarwin credits file (Torrey T. Lyons).
+ 614. Fix various XDarwin crashes in multi-monitor rootless mode by using
+ a new "light" version of PanoramiX/Xinerama called PseudoramiX
+ (Gregory Parker).
+ 613. Fix some typos in the X.Org INSTALL doc (#5113, Chris Pepper).
+ 612. Fix an bug that prevented the releasing of XvMC memory on exit (#5112,
+ Matthew J. Sottek).
+ 611. Some Xprint build warning fixes (David Dawes).
+ 610. Xprt PCL3 support (#5111, Mark Snitily, from X11R6.6).
+ 609. Xprt PostScript bitmap cache (#5110, Chris Bare, from X11R6.6).
+ 608. Updates for the Romanian (ro) XKB map (#5108, Marius Andreiana).
+ 607. Update s3virge docs (#5107, Kevin Brosius).
+ 606. Disable pixmap24 option for Permedia3/4/R4 as the chip doesn't support
+ this (Alan Hourihane).
+ 605. Fixed a infinite loop in the i2c code.
+ 604. Fixed a Sig11 problem in siliconmotion driver (Egbert Eich).
+ 603. Fixes to silicon motion driver:
+ - gamma correction for 24 bit true color mode.
+ - XAA: clipping rectangle was clipped to visible screen, so offscreen
+ pixmaps could not been drawn at with accelerated drawing functions.
+ - in SMI_ScreenInit frame buffer size calculation for video changed.
+ - smi_video: partly rewritten.
+ - Support for 7111
+ - interlaced video via
+ - XF86Config Option "Interlaced" or
+ - attribute XV_INTERLACED (Corvin Zahn).
+ 602. Add French localization of XDarwin help file (Olivier Verdier).
+
+XFree86 4.1.99.3 (19 December 2001)
+ 601. Change the property Xprint uses to identify pmf printer internal fonts
+ to avoid a clash with DPS (#5106, Chris Bare, from X11R6.6).
+ 600. Fix a C type aliasing bug in xkbcomp (#5104, Jakub Jelinek).
+ 599. Fix a bug in Xprint's PS output code that was over-optimizing out
+ clip change requests (#5102, Chris Bare, from X11R6.6).
+ 598. Improved error handling for Xprint's -XpFile option (#5101, 5105,
+ Chris Bare, from X11R6.6).
+ 597. Add higher resolution options to the Xprint postscript printer support
+ (#5096, Chris Bare, from X11R6.6).
+ 596. BuildLoadableXlibI18n should be keyed off "SharedLibX11" rather than
+ "BuildX11Lib" (#5095, Ernie Coskrey).
+ 595. Fix a luit inconsistency between the default data used when a
+ locale is unknown and the data used by ISO 8859-1 locales (#5092,
+ Juliusz Chroboczek).
+ 594. Add eo_EO locale entries, which is what GNU libc 2.2 uses for the
+ Esperanto locale (#5091, Juliusz Chroboczek).
+ 593. Fix an Xprt page handling problem (#5090, Chris Bare, from X11R6.6).
+ 592. Update the X.Org release number from 6.5.1 to 6.6 in various
+ documents and header files (#5089, 5100, Chris Bare, from X11R6.6).
+ 591. Recognise __SVR4 as an alternative for SVR4 in Xosdefs.h (#5087,
+ Chris Bare, from X11R6.6).
+ 590. Cleanup some header files to make them more C++ friendly (#5086, 5088,
+ Chris Bare, from X11R6.6).
+ 589. Update the driver status document (#5085, Branden Robinson).
+ 588. Fix the SiS drm driver (#5084, Torsten Duwe).
+ 588. Fix Trident driver pitch values when accelerator is in use, applies
+ to Image and Blade series chips (Alan Hourihane).
+ 586. Minor bugfix to SiS driver, restructured VT switching code
+ (Egbert Eich).
+ 585. Attempt to fix flickering in 24bpp on Trident CyberBladeXPAi1
+ (Egbert Eich).
+ 584. Fixed UTF8lib support (Mike Fabian).
+ 583. Re-instate makedepend's recognition of backslash line terminations
+ (Marc La France).
+ 582. Add proper reference counting to the XvMCContext so that destroying
+ the context before destroying associated surfaces is handled correctly
+ (#5083, Matthew J. Sottek).
+ 581. Fix the xtt (X-TrueType) font module so that it will recognise
+ fonts with upper-case suffixes (".TTF" and ".TTC") (#5082,
+ ISHIKAWA Mutsumi).
+ 580. Use uname instead of hostname in rstart and xon scripts for portability,
+ plus some other rstart and xon fixes (#5081, Chris Bare, from X11R6.6).
+ 579. Some newport driver cleanups and fixes (#5080, 5103, Guido Guenther).
+ 578. Fix XagNsingleScreen definition and some related side-effects (#5077,
+ Chris Bare, from X11R6.6).
+ 577. Fix some doc typos, and remove references to the non-existent
+ shadowfb(4) man page (#5076, David Krause).
+ 576. Pitch calculation updates for the r128 driver (#5074, Michel Dänzer).
+ 575. Updates for VMware SVGA programming documentation (#5073,
+ Jeremy (VMware)).
+ 574. Fix cases where makedepend reports the wrong line number and file when
+ an error occurs (#5072, Mark Snitily, from X11R6.6).
+ 573. Fix differences in libXt behaviour when using poll() compared with
+ when using select() (#5071, Chris Bare, from X11R6.6).
+ 572. Some warning cleanups for Tru64 (#5069, Antti Tapaninen).
+ 571. Fix a typo in the mt_us keymap entry (#5067, Nerijus Baliunas).
+ 570. Add some missing UNDEFINE lines to the iso8859-11 and tis620-2
+ encoding files (#5065, 5066, Theppitak Karoonboonyanan).
+ 569. Some Luxi font updates:
+ - update the Type 1 versions to fix a UID-related bug and cover more
+ glyphs
+ - update the TTF fonts.scale file to include ISO 8859-13
+ - update the docs to properly reflect the fonts' glyph coverage
+ (#5064, B&H, Juliusz Chroboczek).
+ 568. Fix "The Open Group" copyright notices to reflect the change in
+ post R6.4 licensing (#5093, Mark Snitily, from X11R6.6).
+ 567. Added debugging helpers (Egbert Eich).
+ 566. Added support for the Trident CyberBladeXPAi1 (Egbert Eich).
+ 565. Fixed Mono8x8Fill problem in S3 Virge and Savage drivers (Egbert Eich).
+
+XFree86 4.1.99.2 (12 December 2001)
+ 564. Fix XDarwin GetImage bug on screens other than 0 in rootless mode
+ (Gregory Parker).
+ 563. Fix acceleration, hw cursor and console restoration in the "nv" driver
+ on PowerPC (Mark Vojkovich).
+ 562. Fix console switching on r128 & radeon drivers using FBDev (#5075,
+ Benjamin Herrenschmidt (radeon), Michel Dänzer (r128) ).
+ 561. Implement double buffering for XVputimage in the mga driver (#A.601,
+ Didier Gautheron).
+ 560. Fix a wheel emulation problem that prevented delivery of button
+ events when the wheel button was the same as one of the emulated
+ button (#A.600, Antonio Larrosa Jiménez).
+ 559. Fix some 'make install.sdk' problems (#A.586, Stanislav Brabec).
+ 558. Fix mga DGA when UseFBDev is enabled (#A.584, Wayne Whitney).
+ 557. Fix dri module build when BuildXinerama is set to NO (David Dawes,
+ based on #A.599, Pontus Lidman).
+ 556. Fix libXext build when BuildLBX is set to NO (based on #A.582,
+ Didier Gautheron).
+ 555. Fix typo in ms_MY locale name (was ms_NY) (Hasbullah Bin Pit).
+ 554. Fix incorrect code in signal handlers in most of the clients,
+ xterm and xdm not done yet (Matthieu Herrb).
+ 553. Add Glint R4 and Gamma2 support to the glint driver (Alan Hourihane).
+ 552. Fix rotated display in the nv driver (Mark Vojkovich).
+ 551. By default, validate all available modes rather than only the largest
+ such mode (Marc La France).
+ 550. Various XDarwin improvements:
+ - Use all 8 bits of PseudoColor in full screen Quartz mode.
+ - Write XDarwin version number to console log.
+ - Move Alt/Option key back to Mod1 by default.
+ (Torrey T. Lyons)
+ 549. Fix offscreen memory manager segfault (Jacques Gangloff).
+ 548. XDarwin Quartz mode cursor improvements:
+ - Safely free QuickDraw cursors.
+ - Fix disappearing cursor in rootless mode with multiple monitors.
+ (Gregory Parker and Torrey T. Lyons)
+ 547. i810 XvMC fixes (#5078, Matthew J. Sottek).
+ 546. Downgrade DDC-related mode rejections to warnings as some monitors
+ advertise their nominal, rather than actual, tolerances (Marc La France).
+ 545. Add Korean localization of XDarwin front end (Kyunghwan Kim).
+ 544. Allow XDarwin to launch from the Finder even if there are spaces, etc.
+ in the path to its application bundle (Torrey T. Lyons).
+ 543. Add XvHsync, XvVsync to adjust skew values for centering of an
+ Xvideo window for the trident driver (Geoffrey Hausheer, Alan Hourihane).
+ 542. Fixed xkb to avoid setting of AccessXTimeout to 0 (Egbert Eich).
+ 541. Added option to sync the logfile after every line written (Egbert Eich).
+ 540. Improved APM handling:
+ - Added disable of Input Handlers.
+ - Added support for undo on failed APM requests.
+ - Set vtSema to false (Egbert Eich).
+ 539. Improved detection of primary device especially for non-PC platforms
+ (Egbert Eich).
+ 538. Silicon Motion driver Fixes:
+ - Removed separate loading of int10 code.
+ - Added reset of graphics engine on EnterVT (Egbert Eich).
+ 537. Set flag ROP_NEEDS_SOURCE for CPUToScreenColorExpand for all
+ S3 Savage chips (Egbert Eich).
+ 536. SiS driver:
+ - Added fix to restore fbdev mode properly on VT switch/exit.
+ - Improved LCD handling on SiS 630.
+ - fixed screen blanking in SiS driver to properly blank LCDs
+ (Egbert Eich).
+ 535. Trident driver:
+ - Fixed screen centering for 640x480 Modes.
+ - Fixed video playback for BladeAi1.
+ - Fixed hotkey internal/external switching for XPm8/16.
+ - Added support for on-the-fly video recentering.
+ - Attempt to fix contrast settings for video (Egbert Eich).
+ 534. Added reset code for PS/2 mice when replug events occurs
+ (required for later Linux 2.4.x kernels) (Egbert Eich).
+ 533. xf86cfg: start AccessX controls even when started from a running server
+ (Egbert Eich).
+ 532. Add support in glint driver for booting secondary cards that have
+ the VGA disable jumper set (so no access to the BIOS) (Jay Estabrook).
+ 531. Add Spanish localization of XDarwin front end (Pablo Di Noto).
+ 530. Set the r128 DRI driver version back to 2.2 so that the major version is
+ the same as for the version in XFree86 4.1.0.
+ 529. Fixes for DGA2.0 support in the radeon driver (#A.585,
+ Shyouzou Sugitani).
+ 528. Fix mkfontdir's scanning of fonts.scale files to detect a bad file
+ resulting from concatenating two fonts.scales files, and to avoid
+ buffer overruns from over-long strings (#A.563, Jonathan Kamens).
+ 527. Avoid i810 VT switching problems on FreeBSD (David Dawes).
+ 526. Fix a possible SIGFPE in the X-TrueType fonts (#A.640, Nam SungHyun).
+ 525. Fix -probe and -configure to not clear the screen on exit on SunOS SPARC.
+ (Marc La France).
+ 524. Fix support for ATI Graphics Pro Turbo 1600 adapters (Marc La France).
+ 523. Newport driver updates, including 24-bit support (#5062, Guido Guenther).
+ 522. Fix pixel info not being returned from the APPGROUP extension (#5061,
+ Chris Bare, from X11R6.6).
+ 521. Remove debug message in the calcomp driver (#5060, Martin Kroeker).
+ 520. Replace "X Windows" with "X Window System" or "X" in various places
+ (#5058, David Krause).
+ 519. Fix the size of some lbx struct members on 64-bit architectures
+ (#5053, Chris Bare, from X11R6.6).
+ 518. Fix the size of some xXagGetAttrReply struct members on 64-bit
+ architectures (#5052, Chris Bare, from X11R6.6).
+ 517. Add a NULL check that was missing in the CID part of the Type1 code
+ (#5050, Mark Snitily, from X11R6.6).
+ 516. XKB AccessX LED beep feature (#5047, Chris Bare, from X11R6.6).
+ 515. Fix WriteToClient flushing bug (#5046, Chris Bare, from X11R6.6).
+ 514. Fix improper freeing of widget translations in libXt when
+ REFCNT_TRANSLATIONS is defined (#5044, Chris Bare, from X11R6.6).
+ 513. Fix XPrint memory leak (#5042, Chris Bare, from X11R6.6).
+ 512. Local Authorization Fix (#5041, Chris Bare, from X11R6.6).
+ 511. Add locale entries for Sami (#5055, Børre Gaup).
+ 510. Fix XProcessInternalConnection man page duplication (#5040, Chris Bare,
+ from X11R6.6).
+ 509. Minor xrx Imakefile fix (#5038, Chris Bare, from X11R6.6).
+ 508. Remove outdated xc/fonts/encodings/large/README (#5033,
+ Juliusz Chroboczek).
+ 507. Enable XVideo support for the SuperSavage (#5031, Tim Roberts).
+ 506. Add some missing locale entries (#5026, Mike Harris).
+ 505. s3virge driver updates, including:
+ - cr3a patch (#4884, Adam J. Richter)
+ - ViRGE MX XVideo patch (#4915, Sven Menke)
+ - An option to disable XVideo
+ - Disable solid filled rects for Trio3D because of trouble reports
+ - Some MX fixes
+ - Fix ViRGE MX XVideo so window overlap works
+ - Enable ViRGE GX2 XVideo
+ - Fix low resolution problems on ViRGE MX (&GX2)
+ (#5024, 5030, 5034, Kevin Brosius).
+ 504. Some new/updated xkb files (#5019, Pablo Saratxaga).
+ 503. Add some ATI PCI IDs (#5018, Mike Harris).
+ 502. Implement a hack for the DEC TGA2 cards which maps an extra page
+ before framebuffer start as the acceleration code is slightly
+ broken (Jay Estabrook).
+ 501. Allow secondary MGA boards to be used on Alpha that have the VGA
+ disable switch set (Jay Estabrook).
+ 500. Fix Radeon jerky cursor movement bug (Jay Estabrook, #5054, Mike Harris).
+ 499. Add new Luxi fonts from Bigelow & Holmes (#5010, Charles Bigelow and
+ Kris Holmes, integrated by Juliusz Chroboczek).
+ 498. Update the ClearlyU fonts to version 1.8 (#5009, Mark Leisher).
+ 497. Add XKB symbols for Saami (#5006, 5059, Børre Gaup).
+ 496. Change the mapping of the JIS reverse solidus to what most Japanese
+ users expect (#5002, Juliusz Chroboczek).
+ 495. Fix hiding/showing of mouse cursor under Windows on Cygwin/XFree86
+ (#5056, Harold Hunt).
+ 494. Fix Permedia3 SDRAM based boards planemask problems (Jay Estabrook).
+ 493. Don't use int10 in glint driver when using fbdev interface (#5039,
+ Michel Dänzer).
+ 492. Fix SlowBCopy for MIPS and PowerPCs (Marc La France).
+ 491. Fix XF86Config overrides for I/O base, framebuffer address and video
+ memory size in cyrix driver (Marc La France).
+ 490. Don't interfere with ATI panel support when using DDC information for
+ monitor tolerance defaults (Marc La France).
+ 489. Add Dutch localization of XDarwin help file (Paul Edens).
+ 488. Add stub functions needed by libGL to libXThrStubs. Link libGL against
+ libXthrStubs on systems that build it. (#4997, Matthieu Herrb).
+ 487. Fix building and loading of I18N modules by Xlib on NetBSD and OpenBSD
+ (#5049, Matthieu Herrb).
+ 486. Fix duplicate loader symbols (#5048, Vladimir Dergachev).
+ 485. Fix problems with clipping in fb when the clip list contains negative
+ coordinates (Gregory Parker).
+ 484. Fix return value of VBEBankSwitch() (Norm Raden).
+ 483. Updates/fixes for the QNX6 (aka Neutrino) port (#4990, Frank Liu).
+ 482. Autodetect when -fno-merge-constants is needed for building modules,
+ and enable its use by default in those cases (Marc La France,
+ David Dawes).
+ 481. Status doc updates (#4991, Branden Robinson).
+ 480. Fix for flickering i815 LCDs (#4968, Poul-Henning Kamp, Harald Koenig).
+ 479. Move much of the I18N code in Xlib into separately loadable
+ modules (#4965, 5043, Ernie Coskrey, from X11R6.6).
+ 478. Modify UXTerm.ad's font5 resource so that xterm can display double
+ width characters using a font distributed with XFree86 (#4962,
+ Tomohiro KUBOTA).
+ 477. Add Dutch localization of XDarwin front end (Paul Edens).
+ 476. Add a quick check to not use as the default mode any internal modes
+ with horizontal timing parameters that aren't CRT-friendly (David Dawes).
+ 475. Add an 832x624 @ 75Hz mode line to the default mode set (#4960,
+ Andrew C. Aitchison).
+ 474. Fix Radeon LCD Panel detection and Power Delay (ATI Technologies).
+ 473. Ignore XDarwin full screen switch key combination when in rootless mode
+ (Torrey T. Lyons).
+ 472. Xterm patches #163, #164 (Thomas Dickey): mostly bug fixes.
+ 471. Fix race condition in XDarwin causing occasional hangs or crashes when
+ quitting from the menu (Torrey T. Lyons).
+ 470. Cygwin/XFree86 updates (#5035, #5036, Harold Hunt).
+ 469. Make sure Cygwin checks ENOBUFS for error test in XlibInt.c, as under
+ Cygwin when the socket is full ENOBUFS is returned (Brian Genisio).
+ 468. Fix SIGFPE in LastLinePel for ATI Radeon, console restoring on dual CRT
+ head on VE, improved panel and ddc line detection (ATI Technologies).
+ 467. Fix bug that caused hardware cursors to disappear on mode switches when
+ silken mouse is disabled (Marc La France).
+ 466. Preliminary changes to keyboard handling for SPARC SunOS
+ (Marc La France).
+ 465. Zero out SPARC SunOS primary framebuffer on exit, like Sun's servers do
+ (Marc La France).
+ 464. More driver name normalisation (Marc La France).
+ 463. Minor speedup for Mach64 acceleration for big-endian architectures
+ (Marc La France).
+ 462. Fix bug that prevented relocation of unassigned PCI I/O bases
+ (Marc La France).
+ 461. Add Swedish localization of the XDarwin help file (Patrik Montgomery).
+ 460. Fix use of gethostbyname and getservbyname to _XGethostbyname and
+ _XGetservbyname for portability (#5017, Mark W. Snitily, from X11R6.6).
+ 459. Fix buffer problems used by xrdb to build command line, noticed on
+ systems with a large amount of visuals (#5016, Alan Coopersmith).
+ 458. Fix bug regarding signal handling in x11perf by inserting an abort
+ test after each run (#5015, Mark W. Snitily, from X11R6.6).
+ 457. Add improved diagnostic messages and error checking to libXfont
+ which is used by bdftopcf command (#5014, Chris Bare, from X11R6.6).
+ 456. Fix advertised surfaces for the i810 Motion Compensation driver and
+ make use of new XVMC_INTRA_UNSIGNED surface flag (#5003, Matthew Sottek).
+ 455. Fix r128 driver to call wrapped screen functions when using the
+ fbdevhw layer (#5004, Michel Dänzer).
+ 454. Add Rage128 Pro PP detection to ati driver (#5025, Alfred Perlstein,
+ Mike Harris).
+ 453. Add CyberBladeXPAi1 recognition to the trident driver (#A.658,
+ Jani Jaakkola).
+ 452. Fix typo in PCI bus scanning that caused a hang when there was more than
+ one PCI bus (#A.652, Uwe Dannowski).
+ 451. Update Japanese localization of XDarwin help file (Toshimitsu Tanaka).
+ 450. Update XDarwin help file (Torrey T. Lyons).
+ 449. Fix XDarwin SHAPE support in rootless mode (Gregory Parker).
+ 448. More corrections to Xaw manpage (#5022, Branden Robinson).
+ 447. Fix XDarwin crash if a NULL mask is passed to Composite in rootless
+ mode (Torrey T. Lyons).
+ 446. Fix XDarwin crash if more than one keyboard interface is returned from
+ NXEventSystemInfo (Gregory Parker).
+ 445. Big5 encoding fix (#4957, Juliusz Chroboczek).
+ 444. Use DDC sync (disabled by default) and DPMS info (#4955,
+ Andrew C Aitchison).
+ 443. Update the i810 XVideo support to double the maximum image width
+ to 1440 (#4933, Philip Pokorny).
+ 442. Fix several memory leaks in x11perf (#4931, Ernie Coskrey, from X11R6.6).
+ 441. Bypass startup VT #1 switching hack for FreeBSD/syscons unless running
+ on a pre-3.1 version of FreeBSD (#4926, Huver).
+ 440. Catch bogus flat panel dimensions in the ati/r128 driver (#4907,
+ Michel Dänzer).
+ 439. Fix Maltese entry in xkbcomp/keymap/xfree86 (#4921, Nerijus Baliunas).
+ 438. Fix a locale.alias typo (#4920, Nerijus Baliunas).
+ 437. Documents Options for the Matrox and Neomagic drivers, and makes
+ HW/SWcursor generic options (#5021, Dr. Andrew C. Aitchison).
+ 436. Corrections and updates to Xaw manpage (#5020, Branden Robinson).
+ 435. Add German localization of XDarwin front end (Andreas Monitzer).
+ 434. Add the DEC-XTRAP extension and sample clients (#4904, 4918,
+ Paul Stewart).
+ 433. Update the us_intl XKB symbols map to include all diacritics used
+ in latin script (#4917, Pablo Saratxaga).
+ 432. Add a Compose file for utf-8 (#4917, 5019, Pablo Saratxaga).
+ 431. Fix radeon and sis GL module Imakefiles (#4916, Bill Nottingham).
+ 430. Bug fixes and updates for Savage driver (#5001, Tim Roberts).
+ 429. Add luit (#4914, Juliusz Chroboczek).
+ 428. Fix a typo in fontenc that prevents building with no dependency on
+ libfont (#4913, Juliusz Chroboczek).
+ 427. Add an encoding file for the KSC Johab encoding (#4912, Jungshik Shin).
+ 426. Remove some spurious entries in the KSC 5601 encoding file (#4910,
+ Jungshik Shin).
+ 425. Add Swedish localization of XDarwin front end (Patrik Montgomery).
+ 424. Fill in mode switch characters in XDarwin keymap (Mario Klebsch and
+ Torrey T. Lyons).
+ 423. Linux/PA-RISC portability fixes (#4892, Grant Grundler, Bdale Garbee,
+ and LaMont Jones).
+ 422. Linux/mips portability patch (#4891, 4919, Guido Guenther).
+ 421. Preliminary support for building on Linux/arm32 (#4890,
+ Branden Robinson).
+ 420. Make it possible to build the X server on Linux/m68k platforms
+ (#4889, Christian T. Steigies).
+ 419. Fixes for xman's manpath config handling (#4886, Branden Robinson and
+ Colin Watson).
+ 418. Fix some man page aliases (#4882, Branden Robinson).
+ 417. Define __GLX_ALIGN64 for glx on Alpha (based on #4888, Branden Robinson).
+ 416. Remove PEX5 from the lists of specs in doc/specs/Imakefile (#4881,
+ Branden Robinson).
+ 415. linux.cf updates (#4874, Branden Robinson).
+ 414. Updates for zh locale files (#4879, Branden Robinson).
+ 413. xf86config man page update (#4877, Branden Robinson).
+ 412. Startx enhancements and cleanups (#4875, Branden Robinson and
+ Henry T. So).
+ 411. Use DirectDraw2 instead of DirectDraw on Cygwin (#5012, Harold Hunt).
+ 410. Add French localization of XDarwin front end (Olivier Verdier).
+ 409. Fix portability problem in the generation of the man page version string
+ (Marc La France).
+ 408. Fix a NativeGDI problem on Cygwin/XFree86 (#5007, #5008, Harold Hunt).
+ 407. Fix for threaded libraries (Marc La France).
+ 406. Finish removal of SuperProbe (Marc La France).
+ 405. A rather large number of warning fixes throughout (Marc La France).
+ 404. Fix bug in HTML install script (Marc La France).
+ 403. Missing ident lines for some XFree86-modified files (Marc La France).
+ 402. Add default half-width doublescanned modes (Marc La France).
+ 401. Mark all driver-registered resources with ResBus (Marc La France).
+ 400. Fix DPMS-related build problem (Marc La France).
+ 399. Log a message just before calling each ChipProbe() during '-probe'
+ processing (Marc La France).
+ 398. Temporarily disable ISA probing on SPARCs and PowerPCs (Marc La France).
+ 397. Add PCI IDs for Sun hardware (Marc La France).
+ 396. Fix memory leak in resource relocation (Marc La France).
+ 395. Do not relocate resources that only conflict with disabled non-video PCI
+ devices or disabled PCI ROMs (Marc La France).
+ 394. Re-organise SBUS code (Marc La France).
+ 393. Add as-yet-unused definitions for PCI resource types other than I/O and
+ memory (Marc La France).
+ 392. Add doc for Solaris, but don't format it yet (Marc La France).
+ 391. Normalise driver names (Marc La France).
+ 390. For SPARCs, disable DGA support in ATI driver
+ (from #4650, David S. Miller).
+ 389. Clean up some debugging messages (Marc La France).
+ 388. Fix newport driver for when a /proc fs isn't mounted (Marc La France).
+ 387. Fix DAC handling bugs in s3 driver (Marc La France).
+ 386. Fix resource registration bug for PCI Tseng's (Marc La France).
+ 385. Add aperture driver for Solaris (not yet used) (Marc La France).
+ 384. Rework scanpci to fix problems that prevented it from completely
+ displaying non-PCI bridges and Simba bridges (Marc La France).
+ 383. Fix build problems in some input drivers (Marc La France).
+ 382. Fix int10 compile problem for SPARCs and PowerPCs (Marc La France).
+ 381. Ensure master aborts on secondary buses complete normally during PCI
+ scans (Marc La France).
+ 380. Some memory mapping and Solaris cleanups (Marc La France).
+ 379. Fix XDarwin crash on server reset and problem in full screen mode when
+ switching from X to Aqua to X too rapidly (Torrey T. Lyons).
+ 378. Add __apploaddir__ definition to imake MANDEFS, to specify location of
+ app-defaults directory, fixes Debian bug report #87611 (Thomas Dickey).
+ 377. Xterm patches #161, #162 (Thomas Dickey): mostly bug fixes.
+ 376. Add new CyberBladeXP Aladdin based chip ID's (#4994, Hubert Feyrer).
+ 375. fix a potential issue where POSIX allows the string returned
+ from getenv to be overwritten (from X11R6.6, Chris Bare).
+ 374. Cygwin/XFree86 cleanups and fixes (#4992, #4993, #4999 Harold Hunt).
+ 373. Fix i830 VT switching problems which hang the ring buffer (#4987,
+ #4989, Abraham vd Merwe).
+ 372. fix a format string problem in lbxproxy, apparently not exploitable
+ (r0gue@vertarmy.org, Matthieu Herrb).
+ 371. Fix disappearing cursor in XDarwin rootless mode by falling back to
+ system cursor for cursors bigger than 16x16 (Torrey T. Lyons).
+ 370. Make XDarwin start more robustly from the Finder (Torrey T. Lyons).
+ 369. Update XDarwin Japanese localization (Toshimitsu Tanaka).
+ 368. Fix calculation of DPI when Xinerama in use (#4986, Andrew C Aitchison).
+ 367. Update XDarwin preferences GUI to match current features
+ (Torrey T. Lyons).
+ 366. Xkb fixes for international keyboards (Matthieu Herrb).
+ 365. Add client side sparc64 support for NetBSD and OpenBSD (Eduardo Horvath,
+ Matthieu Herrb).
+ 364. Allow xkbcomp to be used in a cross-compile environment (Alan Hourihane).
+ 363. Update documention for the SiS driver, the Options file
+ (Ademar de Souza Reis Jr.).
+ 362. Xterm patches #157, #158, #159, #160 (Thomas Dickey): mostly bug fixes.
+ 361. Fix high-res modes in the nv driver. Add interlaced support for
+ chips older than NV11 (Mark Vojkovich).
+ 360. Cross compilation fixes (#4981, Harold Hunt, Alan Hourihane).
+ 359. Fix cursor artifacts when running XDarwin in full screen Quartz mode
+ with 8 bit depth (Torrey T. Lyons).
+ 358. Fix byte ordering issue in XDarwin when loading keymapping files on x86
+ and correctly set ByteOrder for PPC and x86 (Rob Braun).
+ 357. When XDarwin is launched from the Finder, start X clients in an
+ interactive shell if user's shell is Bourne-based (Torrey T. Lyons).
+ 356. Add CaseSensitiveFileSystem definition, which defaults to YES, except
+ on Darwin, Cygwin, and OS/2. Fix another case problem spotted by
+ NAKAHASHI Ichiro (Torrey T. Lyons).
+ 355. Enable Vendor specific FatalError for Cygwin/XFree86 and create
+ the Xserver as a windows executable (#4967, Harold Hunt).
+ 354. Add i830 2D and DRI driver (#A.604, VA Linux Systems, 2D3D).
+ 353. Use the -no-cpp-precomp compiler option on Darwin, rather than the
+ deprecated -traditional-cpp (Christoph Pfisterer).
+ 352. Reverting patch #340, fixing type (Egbert Eich).
+ 351. Fix rotation in fbdev driver (#4958, #4959, Michel Dänzer).
+ 350. Resync with DRI CVS trunk (DRI Project).
+ 349. Move ati driver out of DevelDrivers on PPC platforms (#4952,
+ Michel Dänzer).
+ 348. SECURITY: set default value of authComplain resource in xdm to true.
+ This closes a hole where anyone can connect to the X server if
+ the xdm auth dir doesn't exist (Galen Hancock).
+ 347. SECURITY: don't let a non-root user halt the machine by having X
+ send SIGUSR1 to init (Thomas Moestl).
+ 346. Changed int10 module to stub on Sparc (Egbert Eich).
+ 345. Added hyperpen driver (Roland Jansen et. al.).
+ 344. Fixed alignments of x86emu-structures for AXP (Jay Estabrook).
+ 343. Fixed XLoadQueryFont() and XLoadFont() to support locales
+ (required for Euro support) (Markus Kuhn).
+ 342. Modified XtCvtStringToFont() to match any ISO8859 instead of
+ latin1 as fallback. Required for Euro Support (Markus Kuhn).
+ 341. Added acute to compose key list for iso8859-15 (Markus Kuhn).
+ 340. Modified XV Xinerama support to recognize adaptors if screen 0
+ has no adaptor (Egbert Eich).
+ 339. Modified order of disable devices and LeaveVT() to be symetric
+ to the enter case (Egbert Eich).
+ 338. Modified GetTimeInMillis() to handle non monotonous system clocks
+ (Egbert Eich).
+ 337. Added comment about a Zeos Meridan 850c Notebook to C&T docs (Alan Cox).
+ 336. Added call to vbeFree() to apm driver (Egbert Eich).
+ 335. C&T driver:
+ - fixed sig11 problem for non-69030 chipsets.
+ - fixed DGA to announce acellerated functions only if accelleration
+ is enabled.
+ - added FP_mode flag to C&T driver which allows to override the detected
+ state of the flat panel (Egbert Eich).
+ - fixed driver to act appropriately if the BIOS switches to the
+ external monitor it detects when doing DDC.
+ - Set IOBase correctly for MMIO when detection 65545 PCI.
+ - fixed text screen restauration on 69030 (Egbert Eich).
+ - reinabled correct KGA handling of C&T chips: unblank before the end
+ of scanline.
+ - added support for composite sync.
+ - when FP is active disallow display sizes greater than panel.
+ - added double buffering to video support.
+ - fixed register settings to prevent flickering during video playback.
+ (Egbert Eich).
+ 334. Fixed bug in C&T driver that caused interlaced mode not to work
+ (Claus Hulstrøm).
+ 333. Added full MMIO support for C&T 69030 chips (Gregg H. Burman).
+ 332. Fixed MMIO accel code in Cirrus Alpine driver, got PIO accel code to
+ work (Egbert Eich).
+ 331. Fixed fbdev to obtain 24 bit framebuffer format from the kernel, added
+ more failure messages to fbdev driver (Egbert Eich).
+ 330. Added calls to vbeFree() to rendition, savage, silicon motion,
+ i740 and i810 driver (Egbert Eich).
+ 329. Modified MGA driver for new Sparse allocation sceme (Jay Estabrook).
+ 328. Modified handling of sparse addresses on AXP: The code now no longer
+ maps the entire sparse range. Now the required ranges are mapped
+ relative to a fixed base address (Jay Estabrook).
+ 327. Fixed HW cursor for MGA G100 (Egbert Eich).
+ 326. Fixed MGA drivers to be able to use overlay modes when HAL lib is
+ loaded (Egbert Eich).
+ 325. Disabled accel functions that cause lockups on certain neomagic
+ systems by default. They can be reenabled by setting the option
+ "StrangeLockups" to "no" (Egbert Eich).
+ 324. Did a further fix on ScreenToScreenCopy() for Neomagic 2200
+ (Egbert Eich).
+ 323. Added experimental support for Toshiba Libretto. This can be enabled
+ by the option "DisplayHeight480" (Egbert Eich).
+ 322. Fixed clipping in Savage driver, update to version 1.1.1.19
+ (Tim Roberts).
+ 321. fixed calls to BLTSync() on SiS driver (Egbert Eich).
+ 320. Fixed Mono8x8PatternFill(): Moving SETROPFG behind SETROPBG did the
+ trick (Egbert Eich).
+ 319. Setting 24 bpp pximap flags correctly in SiS driver dependening
+ on chipset (Egbert Eich).
+ 318. Setting depth and bpp of framebuffer correctly for suncg14 and sunleo
+ driver (Thorsten Kukuk).
+ 317. Tseng driver not longer ignores results of TsengDoMemLimit() which
+ tests for certain restrictions on the usable framebuffer size
+ (Egbert Eich).
+ 316. Vesa driver: adding calls to vbeFree() before exiting PreInit().
+ Reinit vbe in ScreenInit() (Egbert Eich).
+ 315. Adding int10 initialization to generic vga driver (Egbert Eich).
+ 314. Modified generic vga driver to use shadow fb for vga16 on AXP.
+ This works around the problem that AXP can address memory only 32bit
+ wide which doesn't work on a latched register planar fb (Egbert Eich).
+ 313. Removing 3.3 code from wacom driver. Makes driver hard to read
+ (Egbert Eich).
+ 312. Removing message output from xf86WcmPlug() which causes -configure
+ to core dump (Egbert Eich).
+ 311. Modified int10 Pci code to be able to use new version of
+ xf86ReadPciBIOS() (Egbert Eich).
+ 310. Modified int10 int1A handler to return valid when an unimplemented int10
+ call is encountered. This allows fallback to system BIOS (Egbert Eich).
+ 309. Modified xf86ReadPciBIOS() to check for valid i386 PC signature.
+ Added functions xf86GetAvailablePciBIOSTypes() and
+ xf86ReadPciBIOSByType() to obtain available PCI BIOS types and
+ retrieve a certain BIOS by type (Egbert Eich).
+ 308. Reversed bogus patch 1050 of version 4.0.2. The graphics engine will
+ *never* be called after receiving an APM suspend and before receiving
+ an APM resume. If the neomagic locks up on resume this has a different
+ reason (Egbert Eich).
+ 307. Change real/effective user ID to 0/0 before calling modprobe in
+ xf86LoadKernelModule() on Linux so user can also load drm modules. Fixed
+ PATH environment variable to /sbin (Stefan Dirsch, Egbert Eich).
+ 306. Removed disable/enable interrupt code on ia64 as interrupts cannot
+ be controled from user level (Egbert Eich).
+ 305. Further attempt to fix split algorithm for MTRR regions (Egbert Eich).
+ 304. Fixed problem in XAACopyPlaneNtoNColorExpand() that caused bogus
+ memory accesses when src was not in fb memory (Egbert Eich).
+ 303. Fixed cfb8_32PaintWindow() to use correct cfb32FillBoxTileOdd function
+ (Egbert Eich).
+ 302. Fix to xdm PAM support (Werner Fink).
+ 301. Fixed cz and cz_querty keyboard layouts, added support for Slovak
+ keyboard (Jan Holesovsky).
+ 300. Fixed core dump in twm if no locales are present (Egbert Eich).
+ 299. Modified xterm app default to use LFD fontnames instead of old type
+ (Michael Schroeder).
+ 298. Add a f.startwm function to twm to start another manager.
+ (Matthieu Herrb).
+ 297. Disable MIT-SHM in Xnest, caused a segfault (Matthieu Herrb).
+ 296. Update wskbd keyboard protocol handling for OpenBSD/macppc
+ (Matthieu Herrb).
+ 295. Fix problems starting XDarwin from the Finder and pasting with
+ multi-button mouse emulation (Torrey T. Lyons).
+ 294. S3 driver updates. Restore console for 964 with Ti3025 and Trio64, and
+ support for Aurora64V+ (#4953, Ani Joshi).
+ 293. Fix USB Keyboard access when no PS/2 controller present
+ (#4948, Pontus Lidman).
+ 292. Add i810 XvMC (Motion Compensation) driver (#4946, #4964, #4966,
+ Matthew Sottek, Intel).
+ 291. When using XKB and LEDs are switched on/off by external application
+ the keyboard module doesn't change phisycal LEDs state immediately
+ (#4951, Ivan Pascal).
+ 290. Clean up Cygwin/XFree86 keyboard files (#4949 Harold Hunt).
+ 289. Add Matrox G550 support (#4947, Luugi Marson, Matrox).
+ 288. Remove SuperProbe.man definition for manual page
+ (#4944, Ishikawa Mutsumi).
+ 287. Ark driver updates (#4943, Ani Joshi).
+ 286. Fix xterm when XIM is disabled - caused a segfault
+ (#4942, Tomohiro Kubota).
+ 285. Add Big Endian support (PowerPC) to radeon driver (#4934, Ani Joshi).
+ 284. Fix support for legacy Windows TrueType fonts in Big5 encoding
+ (#4938, Joe Man).
+ 283. Support Radeon 7500, 8500 and Rage128ProII (#4941, ATI Technologies).
+ 282. Support Trident TGUI96xx and greater with Xv (Alan Hourihane).
+ 281. XDarwin fixes for Xinerama in Quartz modes:
+ - Turn Xinerama on by default.
+ - Fix warping the cursor.
+ Also load keymapping from file in IOKit mode for Mac OS X 10.1
+ compatibility. (Torrey T. Lyons and Gregory Parker)
+ 280. Fix Trident 96xx high clock setting, acceleration fixes (Alan Hourihane).
+ 279. Fix XDarwin rootless crashing bug when window resizing with the Mac menu
+ bar not on X11 main screen (Gregory Parker).
+ 278. Define X_LOCALE on Darwin as Darwin's setlocale() does not work
+ properly (Torrey T. Lyons).
+ 277. Fix problems with XDarwin multi-monitor support for some screen
+ arrangements (Gregory Parker).
+ 276. Preliminary big endian (PowerPC) support for the "nv" driver
+ (Ani Joshi, Mark Vojkovich).
+ 275. Enable ThreadedX for Cygwin/XFree86 using auto import features of
+ newer binutils packages (Alan Hourihane).
+ 274. Exclude the Mac OS X menu bar from the X11 screen while running XDarwin
+ in rootless mode (Yannick Bessette and Torrey T. Lyons).
+ 273. Add support for builtin MTRR and AGP support in NetBSD 1.5Y.
+ (Matthias Drochner and Frank van der Linden).
+ 272. Rework XDarwin front end to start X clients in the user's normal
+ environment and fix issues while quitting (Torrey T. Lyons).
+ 271. SECURITY: fix glyph clipping for large origin (Keith Packard).
+ Reported to be remotly exploitable through konqueror or netscape
+ by Georgi Guninski.
+ 270. Fix setting of memPhysBase in a few drivers (#4937, Gerd Knorr).
+ 269. Finish merging freetype-2-0-4 into trunk by resolving conflicts. This
+ also fixes a syntax error on Darwin caused by an out of date version of
+ ttgload.c (Torrey T. Lyons).
+ 268. Update VMware driver (#4935, Jeremy (VMware)).
+ 267. Native GDI infrastructure sync with Cygwin/XFree86 (#4936, Harold Hunt).
+ 266. Update Darwin build configuration files including:
+ - Report full OS version and more capabilities.
+ - Fix X server build problem due to libraries in ProjectRoot being
+ listed as dependencies for some targets.
+ - Allow dynamic shared libraries to take advantage of two-level
+ namespace on Darwin 1.4.
+ (Torrey T. Lyons)
+ 265. Disable clipboard viewer, external program xwinclip handles this (fow now)
+ (#4932, Harold Hunt).
+ 264. Add ability to let Aqua and X use different display modes while running
+ XDarwin full screen (Torrey T. Lyons).
+ 263. Fix build dependency problem in xedit/lisp/lisp.rules
+ (#4930, Harald Koenig).
+ 262. Fix a fontenc-related problem that can cause the TrueType backend
+ to crash (#4909, Juliusz Chroboczek).
+ 261. Fix DPMS support for I128 driver (Robin Cutshaw).
+ 260. Add OSVErrorF for Cygwin/XFree86 (#4923, Harold Hunt).
+ 259. Support Trident Cyber9320, TGUI9440, TVGA8900C, TVGA9000 ISA chips
+ (Alan Hourihane).
+ 258. Fix banked 24bpp displayWidth calculation (Marc La France).
+ 257. Fix accel initialisation bugs in ATI driver (Marc La France).
+ 256. Add entry to initialise framebuffer manager by area (allowing for a
+ possible extra partial scanline) and make it print all largest areas
+ (Marc La France).
+ 255. Make xdm use BSD authentification on OpenBSD and use setproctitle()
+ instead of home grown version where available (enabled on
+ OpenBSD and NetBSD only) (Matthieu Herrb).
+ 254. Make -configure generate the DisplaySize from the acquired DDC
+ information (#4897, Andrew C Aitchison).
+
+XFree86 4.1.99.1 (20 August 2001)
+ 253. Fix bad xalloc() in the new fontenc code (#4899, ISHIKAWA Mutsumi).
+ 252. Fix some Xrandr build issues on Cygwin/XFree86 (#4898, Suhaib Siddiqi).
+ 251. Fix some Cygwin/XFree86 dependencies in cygwin.rules (#4894, Harold Hunt).
+ 250. Add ATI Xpert2000 (Rage 128 SM) (#4896, Mike Harris).
+ 249. Fix '-configure' crash introduced recently (#4895, Andrew C Aitchison).
+ 248. Re-write Xvideo support for Permedia3 (Alan Hourihane).
+ 247. Add Texas Instruments Permedia to Delta attached chips (Alan Hourihane).
+ 246. Add Permedia4 support (different clock synth) (Jay Estabrook).
+ 245. Resync with DRI CVS trunk (VA Linux Systems).
+ 244. Add XKB descriptions for the extra keys on a Dell Internet keyboard
+ (#A.533, Ben Liblit).
+ 243. Add a Maltese XKB map and locale support (#A.527, Ramon Casha).
+ 242. Add a new "bksl" variant of the Czech XKB map (#A.515, Stanislav Brabec).
+ 241. Fix the initialization sequence for ExplorerPS/2 (#A.510,
+ Arndt Schoenewald).
+ 240. When xdm is built with PAM support, don't call getpwnam() before
+ calling the various PAM functions associated with authenticating a user
+ (A.504, Ben Harris).
+ 239. Fix ccmakedep to handle source file extensions of more than one
+ character (#A.507, Andy Wiggin).
+ 238. Fix a VT switching crash in the cirrus driver when acceleration is
+ disabled (#A.489, Kirill V. Semenkov, #A.518, B. D. Elliott).
+ 237. Add support for the "PR" variant of the Rage 128 Pro (#A.487,
+ Alfred Perlstein).
+ 236. Make the config file created with 'XFree86 -configure' load the
+ speedo and/or type1 modules if relevant font directory is in
+ the font path (#A.484, Dmitry Yu. Bolkhovityanov).
+ 235. Fix a bug in the nv driver's detection of the crystal frequency (A.481,
+ Leo L. Schwab).
+ 234. Make xfontsel use the same order in its menus as the sort order used
+ by the X server and xfs (#A.480, Dmitry Yu. Bolkhovityanov).
+ 233. Add an input driver for DMC FIT10 touch-panel (#A.477, Mayk Langer).
+ 232. Fix xf86PostMotionEvent() to handle first_valuator values other than
+ zero (#A.468, Joe Krahn).
+ 231. Change the Swedish xkb map to map AltGr+Space to space (#A.467,
+ David Härdeman).
+ 230. Fix the return value information in the Xv library man pages (#A.458,
+ Tommi Vainikainen).
+ 229. Fix the DGA client library so that it can map the video memory on
+ Solaris 8 x86 (#A.454, Juergen Keil).
+ 228. Change {Max,Min}{X,Y}Position options in the elographics and mutouch
+ drivers to {Max,Min}{X,Y} so that it's consistent with the other
+ drivers.
+ 227. Some Bulgarian and Serbian locale updates (#A.444, Anton Zinoviev).
+ 226. Add a usage message to glxinfo (#A.430, Mike Coleman).
+ 225. Set the Alt/Windows key mappings for 104-key keyboards to be
+ compatible with 101-key keyboards by default, and add some new
+ XKB options to set them differently.
+ 224. Add some new XKB options to select third level shift and group
+ switchers/togglers (#A.425, Anton Zinoviev).
+ 223. Fix a bug in the Serbian XKB map (#A.424, Anton Zinoviev).
+ 222. Export from the loader the DIX symbols necessary for a modular version
+ of the DEC-XTRAP extension (#4797, Paul Stewart).
+ 221. Add a workaround for FreeBSD to make programs (like mkfontdir) that
+ are run as part of the build use the shared libraries from the build
+ rather than those that may be installed on the system (David Dawes).
+ 220. Use MAXSOCKS for connection limit in Cygwin/XFree86 (Alan Hourihane).
+ 219. Add Render's layer support to Cygwin/XFree86 (#4872, Harold Hunt).
+ 218. Support for OpenBSD/powerpc (Matthieu Herrb).
+ 217. Experimental change to default behaviour of ATI panel support to override
+ the horizontal and vertical porches of all modes to that found in the
+ mode on entry (Marc La France).
+ 216. Fix detection of a panel's mode on entry in the ATI driver
+ (Marc La France).
+ 215. Fix for Option "CRTScreen" in ATI driver (Marc La France).
+ 214. Patch for the Thai glyphs in Mark Leisher's ClearlyU font (#4846,
+ Theppitak Karoonboonyanan).
+ 213. Add a font encoding file for tis620-2 (#4845, Theppitak Karoonboonyanan).
+ 212. Add a font encoding file for ISO8859-16 (#4844, Markus Kuhn).
+ 211. Make the input method framework in Xlib work better in an UTF-8
+ locale (#4843, Yao Zhang and Bruno Haible).
+ 210. Default *sampleText*international to false in xfontsel's app-defaults
+ file, since it breaks if the user has '*international: true' (#4842,
+ Juliusz Chroboczek).
+ 209. A new version of the fontenc layer. A major difference is that it
+ reads from a "system" encodings directory
+ <ProjectRoot>/lib/fonts/encodings/encodings.dir, which is searched
+ after any encodings.dir file in the font's directory. The font
+ ABI version is bumped to 0.3 and the Xfont shared library's version
+ is bumped to 1.4 (#4839, Juliusz Chroboczek).
+ 208. Add support to xload for displaying the load of remote hosts by using
+ information in rwhod(1)'s database (#4833, Anders Eriksson).
+ 207. Rename the XVisibilityNotifyEvent man page to XVisibilityEvent,
+ which matches the naming convention for the other X Event man pages
+ (#4830, Ernie Coskrey, from X11R6.6).
+ 206. Update the registry to match X.Org's X11R6.6 version (#4829,
+ Ernie Coskrey, from X11R6.6).
+ 205. Fix for the SlowKeys feature of the AccessX portion of XKB not working
+ when the delay is longer than the amount of time between the delivery
+ of key press events to the extension (#4828, Ernie Coskrey,
+ from X11R6.6).
+ 204. Add a locale alias for "th_TH.TIS-620" (#4827,
+ Theppitak Karoonboonyanan).
+ 203. Some linux.cf updates (#4825, Branden Robinson).
+ 202. Make the vbe module build like the other modules.
+ 201. -
+ 200. Add a command line options (-show) to xvidtune to print out the current
+ video mode (#4809, Markus Kuhn).
+ 199. A new driver for the "Acecad Flair" tablet (not enabled by default yet)
+ (#4800, Edouard TISSERANT).
+ 198. Fix some typos in the iso8859-2 Compose file (#4799, Kamil Toman).
+ 197. Add some XKB options to allow the CapsLock behaviour to be easily
+ selected (#4794, Ivan Pascal).
+ 196. Don't reference the log file in the FatalError message if it hasn't
+ been opened yet (#4793, Branden Robinson).
+ 195. Add Calcomp input driver (#A.554 Martin Kroeker).
+ 194. Add preliminary 8 bit PseudoColor support to XDarwin full screen Quartz
+ mode and fix IOKit mode PseudoColor that was broken by the multi-monitor
+ patch (Torrey T. Lyons).
+ 193. Load XDarwin keymapping from file by default and give more useful error
+ message if getting keymapping from kernel fails. Change keymapping
+ translation so delete key is XK_BackSpace by default (Torrey T. Lyons).
+ 192. Create the two sets of locale.alias and locale.dir entries (those with
+ and those without the ':' separator) from a single set of entries in
+ the source files (David Dawes).
+ 191. Add an MS mouse driver for KDrive (#4754, Juliusz Chroboczek).
+ 190. Improve "true Big5" and "Emacs Big5" support (#4792, Yong Li, #4798,
+ Tomohiro KUBOTA).
+ 189. Fix a non-standard character set bug in Xlib (#4792, Ivan Pascal).
+ 188. Fix for the savage driver on 64-bit platforms (#4788, Jay Estabrook).
+ 187. Xv fix for the r128 driver on big-endian architectures (#4781,
+ Michel Dänzer).
+ 186. Fix an Xlib bug that affects conversion from CTEXT to multibyte /
+ wide character (#4780, Tomohiro KUBOTA, #4783, Bruno Haible).
+ 185. Release notes (4.1.0) and Status doc fixes (#4778, 4779,
+ Branden Robinson).
+ 184. 64-bit fix for lib/X11/ImUtil.c (#4773, Mike Harris).
+ 183. Fix dashed lines for the r128 driver on big-endian architectures
+ (#4769, Michel Dänzer).
+ 182. Fix Xlib's parsing of CTEXT with multi-byte characters in GR (#4761,
+ Juliusz Chroboczek).
+ 181. Fixes for the Romanian (ro) XKB map (#4746, Marius Andreiana).
+ 180. XDarwin bug fixes:
+ - Stop FatalError re-entry in "no Quartz support" messages.
+ - Synchronize XDarwin serverVisible state with application on rootless
+ startup.
+ (Torrey T. Lyons)
+ 179. Fix an XDarwin bug that broke XWarpPointer in Quartz modes (Gregory
+ Parker).
+ 178. Fix some more mi build warnings (David Dawes).
+ 177. Fix some mi build warnings (#4716-4719,4721-4724, Adam Sulmicki).
+ 176. Port for Linux/SuperH (Jornada680/690 and SEGA Dreamcast) (#4680, 4681,
+ ISHIKAWA Mutsumi).
+ 175. Support for mouse wheel emulation (#A.506, Henry T. So).
+ 174. Add support to Cygwin/XFree86 to use CTRL+ALT+BKSPACE as the shutdown
+ signal and fix up command line options to accomodate.
+ (#4838, Alexander Gottwald).
+ 173. In XDarwin, add ability to change modifiers to use when faking multiple
+ mouse buttons (Gregory Parker).
+ 172. Do not build Cygwin/XFree86 with -ansi as Cygwin's library (newlib) lacks
+ some prototype definitions that cause runtime failures (hypot being one
+ of them) (Alan Hourihane).
+ 171. Add extra library flags (commented out for now) for building
+ Cygwin/XFree86's server (#4834, Harold Hunt).
+ 170. Fix a bug in the v4l module which caused multiple TV cards not to work
+ (#4835, Gerd Knorr).
+ 169. Add multi-monitor support to XDarwin for all display modes using
+ Xinerama (Gregory Parker and Torrey T. Lyons).
+ 168. Fix 16bpp colour maps on Mach64's (Marc La France).
+ 167. Fix Mach64 DPMS bug (Marc La France).
+ 166. Fix bug that prevented hardware cursors on Mach64 CT's (Marc La France).
+ 165. Document what a ChipAdjustFrame() function should to to prevent moving
+ of hardware cursors during mode switches (Marc La France).
+ 164. -Wimplicit warning cleanup [`make World` >required<] (Marc La France).
+ 163. Ensure installed headers can find the headers they, in turn, #include
+ (Marc La France).
+ 162. Make imake pass its -W* flags to cpp (Marc La France).
+ 161. More accomodations for newer GCC's (Mike A. Harris).
+ 160. Remove a CYGWIN define from Xserver/include/windowstr.h
+ (#4832, Harold Hunt).
+ 159. Fix a casting problem which causes bdftopcf to write corrupted
+ fonts on buffer boundaries (#A.522, Jakub Bogusz).
+ 158. Cygwin/XFree86 updates (#4824, #4826 Harold Hunt).
+ 157. Fix horizontal stripes problem in Permedia3 driver (Alan Hourihane).
+ 156. Remove most X_NOT_STDC_ENV code, and assume that __STDC__ is defined
+ (David Dawes).
+ 155. Remove (stale) support for Amoeba and Minix (David Dawes).
+ 154. Update Cygwin/XFree86 cross-compilation and update to latest
+ source base (#4801, #4802, Harold Hunt).
+ 153. Fix 'make install' for Freetype. (#4812, Carlos A M dos Santos).
+ 152. Turn on dll style modules for Linux/MIPS. (#4807, Guido Guenther).
+ 151. Add support for ATI's Radeon VE, Mobility M6, All-In-Wonder Radeon
+ and Rage128 Pro Ultra, Digital Flat Panel support. Use DDC2 interface.
+ (#4817, Mike Smith, ATI Technologies).
+ 150. Add IBM S/390 support for building the tree (#4815, Mike A. Harris)
+ 149. Fixes incorrect spelling of "XChangeWindowAttributes" found in
+ XCreateColormap(3X11) and XInstallColormap(3X11)
+ (#4813 Carlos A M dos Santos).
+ 148. Fix a serious memory leak in XAA (Mark Vojkovich).
+ 147. Add a DriverPrivate field to I2C devices (Marc La France).
+ 146. In the ATI driver, initialise the fb manager whether or not XAA is also
+ used (Marc La France).
+ 145. Fix typos in radeon and wacom drivers.
+ 144. Don't disable the secondary CRTC on ATI Rage XL adapters (it doesn't
+ exist) (Marc La France).
+ 143. Speed up ix86 block moves in ATI driver (Marc La France).
+ 142. Temporarily disable hardware cursor support for ATI GX & CX adapters
+ (Marc La France).
+ 141. Make composite sync the default in the ATI driver (David S. Miller).
+ 140. Rework stretching of small DFP modes in ATI driver (Marc La France).
+ 139. Add an interesting PCI ID (Marc La France).
+ 138. Allow ChipValidMode() functions to pre-calculate a mode's horizontal
+ sync and vertical refresh rates (Marc La France).
+ 137. Another fix for mode switch and cursor interactions (Marc La France).
+ 136. Temporary fix for endianness problems in ATI driver (Marc La France).
+ 135. Add XGetIMValues() prototype to Xlib.h (Marc La France).
+ 134. Use a more reasonable numbering for recent binutils versions on Linux
+ (Marc La France).
+ 133. Fix dependencies for building drivers in a static server
+ (Marc La France).
+ 132. Update XDarwin Japanese localization to include rootless UI changes
+ (Toshimitsu Tanaka).
+ 131. Fix potential XDarwin bug in translating Darwin keymappings to X11
+ keymaps with unrecognized modifier keys (Gregory Parker).
+ 130. Make XDarwin ignore Caps Lock when checking for VT switch, except when
+ the user's switch key preference includes Caps Lock (Gregory Parker).
+ 129. Update XDarwin Cocoa UI and preferences for rootless mode. Add more
+ explicit error message for users trying to run in Quartz modes without
+ Quartz support. Remove unneeded info.nib files (Torrey T. Lyons).
+ 128. Added XDarwin menu bar hiding/showing in rootless mode (Gregory Parker).
+ 127. Fix DDC from reporting misleading information.
+ (#4806 Andrew C Aitchison)
+ 126. Patch to make VBE DDC honour the NoDDC option.
+ Before this, NoDDC disabled only 2 of the 3 ways the server might
+ ask the monitor for DDC infomation.
+ (#4805 Andrew C Aitchison)
+ 125. Stops xf86cfg complaining about non-video chips from Intel.
+ Adds a few PCI card ids for Intel and one for Matrox.
+ (#4804 Andrew C Aitchison)
+ 124. Add support for NVIDIA nForce integrated graphics (Mark Vojkovich).
+ 123. Fix a possible fatal crash in Xv when Xinerama is used (Mark Vojkovich).
+ 122. Corrects typos in output of xf86cfg when checking modules and
+ documents ddc module options (Andrew C Aitchison).
+ 121. On Mac OS X, allow users to disable mouse acceleration changes by
+ XDarwin (Torrey T. Lyons).
+ 120. By default, don't build the MagicTouch input driver until a common layer
+ interface is coded for it (Marc La France).
+ 119. Fix Offscreen Image support for Xv/v4l in tdfx driver (Alan Hourihane).
+ 118. Add MagicTouch driver (A.482, Mauro Ziliani)
+ 117. Fix side effect in XFree86 of the recent changes to libxf86config
+ (A.486, Knuts Andy).
+ 116. Define Xutf8LookupString in X11-def.cpp for Cygwin/XFree86
+ (#4790, Suhaib Siddiqi).
+ 115. Turn on RandR build for Cygwin/XFree86 (#4789, Harold Hunt).
+ 114. Import of Gregory Parker's rootless code for Mac OS X. The code has
+ been cleaned up, reorganized, and modified to use Cocoa and fb
+ (Gregory Parker and Torrey T. Lyons).
+ 113. Freshen SCO port (#4709, J. Kean Johnston).
+ 112. Fix int10 build for GCC 3.0 (Marc La France).
+ 111. An attempt at fixing the i740 driver to not reference options before they
+ are collected (Marc La France).
+ 110. Fix for RandR build (Bill Crawford).
+ 109. Fix 3Dfx Voodoo Banshee boards with timing issues (Alan Hourihane).
+ 108. Allow Cygwin/XFree86 to be cross compiled (#4784-#4786 Harold Hunt).
+ 107. Fix fatal bug in XAA's N-to-N CopyPlane acceleration (Elliot Lee).
+ 106. Add RandR support to the Kdrive PCMCIA driver (Alan Hourihane).
+ 105. Fix SharedLibGL to SharedLibGlx in cygwin.rules and some Cygwin/XFree86
+ fixes including enabling backing store. (#4770, #4771 Harold Hunt).
+ 104. xf86UnMapVidMem shows the wrong number of arguments in
+ os-support/README.OS-lib (#4357, Guido Guenther).
+ 103. Some driver loader symbol req/ref registration cleanups (David Dawes).
+ 102. Cygwin/XFree86 fixes.
+ Release pressed modifier keys when server looses focus.
+ Remove declaration in lib/X11/lcGetConv.c (no longer needed).
+ Remove unnecessary #if(n)def __CYGWIN__ in lib/X11/lcGetConv.c, one in
+ lib/dps/csconndi.c and one in lib/font/Type1/regions.h.
+ Add a new SharedDepLibraryTarget rule (#4763-#4768, Harold Hunt).
+ 101. Fix bogus handling of BUS_CNTL Mach64 register (Marc La France).
+ 100. Fix a typo in xc/programs/bitmap/Bitmap.h (#4757, Suhaib Siddiqi).
+ 99. Add Cygwin/XFree86 manpage and minor tweaks (#4756, Harold Hunt).
+ 98. Ensure PCI master aborts are allowed to complete normally on non-root
+ buses (Marc La France).
+ 97. Allow ChipScreenInit()'s to load modules during the first server
+ generation (Marc La France).
+ 96. Update XvMC header files to match the spec (Matthew Sottek).
+ 95. Darwin build configuration changes:
+ - Turn on building Xv and GLX extensions.
+ - Make GLX and GLU build successfully.
+ - Use Darwin's libz instead of building one for XFree86.
+ - Use XFree86's standard compiler optimization flags per CPU type.
+ (Torrey T. Lyons).
+ 94. Fix Xserver/Imakefile typo which broke XDarwin build (Torrey T. Lyons).
+ 93. Fix Darwin bindist files so that dynamic shared libraries are put in
+ Xbin.tgz instead of Xprog.tgz (Torrey T. Lyons).
+ 92. Fix problem in Ib/Xaw/AsciiSrc.c:nitStringOrFile() when descriptor 0
+ is closed, as a zero return value from open(2) is taken as an error
+ (splite at purdue.edu).
+ 91. Fix glide driver that causes -configure to fail for all drivers
+ (Alan Hourihane).
+ 90. Don't define SVR4 on Cygwin/XFree86 (#4751, Suhaib Siddiqi,
+ Alan Hourihane).
+ 89. Don't override system commands specified in host.def on Cygwin/XFree86
+ (#4753, Alexander Gottwald).
+ 88. Fix cursor problem in server respawn's on Cygwin/XFree86
+ (#4750, Harold Hunt).
+ 87. Fix typo definition of CplusplusCmd in cygwin.cf
+ (#4752, Alexander Gottwald).
+ 86. Fix makedepend for use on Cygwin/XFree86.
+ Use makedepend on Cygwin/XFree86.
+ Fix SharedDepLibraryTarget so that build dependencies are correct,
+ this fixes libGLU's build problem (Alan Hourihane).
+ 85. Don't define MKSTEMP on Cygwin/XFree86 (#4725, Harold Hunt).
+ 84. Fix memory count function for I128 (Mark Thompson).
+ 83. Use TermcapLibrary as -lncurses instead of -ltermcap, fixes problem
+ building xterm/resize on Cygwin/XFree86 (#4749, Harold Hunt).
+ 82. Fix X server segfault in the GLX code (Brian Paul).
+ 81. PseudoColor fixes for Cygwin/XFree86 (#4745, Harold Hunt).
+ 80. Fix broken TGA driver (Alan Hourihane).
+ 79. Fix FIFO reset trouble in tdfx driver by lowering the FIFO size due to
+ suspect code in Glide3. (Alan Hourihane).
+ 78. Fix Xvideo in tdfx driver when using YUY2 or UYVY data (Alan Hourihane).
+ 77. Add two missing symbols to loader reference for the glint driver
+ (#4740, Mike Harris).
+ 76. Make Cygwin/XFree86 work at 8bpp, and re-arrange some command line
+ flags. (#4743, Harold Hunt).
+ 75. Fix some build issues on Cygwin/XFree86 (#4736, #4737, Suhaib Siddiqi).
+ 74. Some Cygwin/XFree86 cleanups (#4735, Harold Hunt).
+ 73. Fix XAA's incorrect acceleration of X-Render's repeated sources and
+ masks (Mark Vojkovich).
+ 72. Disable PCI resource conflict checking for Linux/Alpha (Jay Estabrook).
+ 71. Fix Linux xf86GetPciSizeFromOS() parsing when the kernel is 64 bit
+ and any base or size is larger than 32 bits in magnitude (#4732,
+ David S. Miller).
+ 70. Xinstall.sh updates and bug fixes (David Dawes).
+ 69. Make XDarwin ddx pass up proper right and middle mouse button numbers
+ and fix mouse button 5 (Christoph Pfisterer and Torrey T. Lyons).
+ 68. Restore backwards compatibility from 4.0.[2,3] to 4.1.0 for
+ the i810, r128 and radeon DRI drivers (Gareth Hughes).
+ 67. Fix a problem when using patterns of horizontal lines with the mga
+ video overlay (#A.442, Ewald Snel).
+ 66. Remove duplicate XineramaLibrary section in X11.tmpl (#4731,
+ Mike Harris).
+ 65. Enable building DRI for Linux/ppc, and fix a drm-related bug
+ for Linux/ppc (#4728, 4730, Michel Dänzer).
+ 64. Document Options for the r128 and fbdev drivers (#4727, 4729,
+ Michel Dänzer).
+ 63. Add a BuildBindist switch which causes a file containing the XFree86
+ version number to be installed in ProjectRoot, include this in
+ the Xbin bindist tarballs, and turn on this switch in the bindist
+ host.def files. The purpose is to allow the installer script to
+ easily identify which version the bindist tarballs are (David Dawes).
+ 62. Resync bindist and Xinstall.sh with changes made for 4.0.3 (David Dawes).
+ 61. Fix the Shape extension's XShapeCombineMask to handle cases where
+ src_mask is None according to the spec. This reportedly fixes an
+ X server crash (#4715, Huver).
+ 60. Exclude the DRI extension when NO_HW_ONLY_EXTS is defined (based on
+ #4714, Frederic Lepied).
+ 59. Fixup Cygwin/XFree86 after recent Xrandr changes (#4726, Harold Hunt).
+ 58. Fix ATI Radeon driver on Alpha. Seems as though the BIOS doesn't
+ like Re-POSTing and memory setup gets confused. (Jay Estabrook, Jeff
+ Weidemeier)
+ 57. Build fixes for Cygwin/XFree86 (#4710,#4711,#4713 Harold Hunt).
+ 56. Fix problem with Xinstall.sh on Darwin 1.3.x (#A.431, Stefan Pantos).
+ 55. Update Xinstall.sh and Darwin bindist directories to optionally
+ install Quartz support and to add an x86 distribution (Torrey T. Lyons).
+ 54. Install xterm.termcap and xterm.terminfo when installing xterm
+ (Torrey T. Lyons).
+ 53. Add missing return value for miSetPixmapDepths() (#4708,
+ ISHIKAWA Mutsumi).
+ 52. Fill in the v4l man page template with some useful information (#4707,
+ Gerd Knorr).
+ 51. Fix FFB OpenGL SwapBuffers (#4705, David S. Miller).
+ 50. Fix some mi build warnings (#4695-4701,4704, Adam Sulmicki).
+ 49. Work around a problem building the rstart specs doc with a symlinked
+ build tree (David Dawes).
+ 48. Fix Glint 300SX+Delta support. Add faster 500TX text acceleration
+ based on other code (Alan Hourihane).
+ 47. Remove SPARC-specific byte-swapping code that would not work on older
+ SPARC CPUs (part of #4653, David S. Miller).
+ 46. NULLify mapVidMem() and remove DEV_MEM define for Linux/SPARC
+ (#4651, David S. Miller).
+ 45. Fixing MTRR split code (hopefully) (Egbert Eich).
+ 44. Fixing coredump when doing vbeFree() twice: S3 Virge and C&T
+ (Egbert Eich).
+ 43. Fixing HWCursor for mga driver in fbdev mode (Egbert Eich).
+ 42. Make the entire source tree (except GLX) compile under SunOS/SPARC 5.7.
+ Functions that have yet to be ported are FatalError()'s. This is
+ temporarily controlled through a BuildXFree86onSparcSunOS #define in
+ host.def (Marc La France).
+ 41. Merge support for all Solaris/ix86 versions together (Marc La France).
+ 40. Replace Xserver/Imakefile's DDXDIRn scheme with a more general scheme
+ (Marc La France).
+ 39. For GCC on SVR4 variants, use -fPIC rather than -fpic to generate shared
+ objects (Marc La France).
+ 38. Fix xmh's use of XtNewString() with getenv (#4694, Tim Waugh).
+ 37. Xdm/PAM fixes: leave it to PAM to observe whether or not an account
+ is locked, and reinitialize credentials after calling initgroups(),
+ because sometimes the credentials pam_setcred() gives are in the
+ form of group membership (#4693, Mike Harris).
+ 36. Add an encodings file for standard box drawing characters for
+ VT100-compatible terminals (#4691, Juliusz Chroboczek).
+ 35. Fix warnings when building mieq.c (#4689, Adam Sulmicki).
+ 34. Fix some bugs in the cz and sk entried in XKB's keymap/xfree86 file
+ (#4692, Ivan Pascal).
+ 33. Add 'hr' entries to XKB's keymap/xfree86 and rules/xfree86.lst files
+ (#4687, Nerijus Baliunas).
+ 32. Include <X11/Xutil.h> in shape.h to get Region typedef (#4686,
+ Adam Sulmicki).
+ 31. Acceleration bug fixes for GLINT Permedia1 (Alan Hourihane).
+ 30. Ensure glint driver chips don't exceed the specified virtual sizes.
+ (Alan Hourihane).
+ 29. ATI DGA changes (Patrick Chase and Marc La France):
+ - Add accelerated DGA primitives for Mach64 variants;
+ - Add accelerated DGA transparent blits for Rage128 and Radeon;
+ - Fix setting of DGA_CONCURRENT_ACCESS;
+ - Take XaaNo* options into consideration.
+ 28. Simplify DGAShutdown() (Marc La France).
+ 27. Fix colourmap bug when switching out of a DGA mode (Marc La France).
+ 26. Make it possible, but not required, for a driver to initialise DGA after
+ XAA so that it may factor in any XaaNo* options in determining what DGA
+ drawing primitives to support (Marc La France).
+ 25. Prevent mode switches while DGA modes are set (Marc La France).
+ 24. Remove all VGA'isms from the glint driver, it doesn't need them
+ (Alan Hourihane).
+ 23. Support the Delta in the glint driver, needed for boards that have
+ the Delta connected to the rasterizer, as it acts as an arbiter for
+ the bus. Resolves acceleration troubles. (Alan Hourihane).
+ 22. Add an lv entry to XKB's keymap/xfree86 file (#4685, Nerijus Baliunas).
+ 21. Fix some typos in XKB's xfree86.lst file (#4684, Nerijus Baliunas).
+ 20. Add DDXOSVERRORF ifdefs to the XFree86 ddx code that make use of the
+ OsVendorVErrorFProc feature (#4678, Michel Dänzer).
+ 19. Convert the r128 driver's "UseBIOSDisplay" option into a more general
+ "Display" option (#4678, Michel Dänzer).
+ 18. Treat GL_POINT like GL_POINTS and GL_LINE like GL_LINES in the sunffb
+ DRI driver (#4677, David S. Miller).
+ 17. Some doc updates related to cross compiling (#A.413, Scott A McConnell).
+ 16. Fix bsdLib.rules and bsdLib.tmpl problems that show up when
+ X11ProjectRoot is defined (#4676, Johnny C. Lam).
+ 15. Fix Trident XVideo colorkey at depth 15, 24 (Alan Hourihane).
+ 14. Fix some apm driver bugs, including one that prevented acceleration
+ from working (#4674, Loïc Grenié).
+ 13. Fix 555 (depth 15) palette handling in the i810 driver (#4673,
+ Andrew C. Aitchison).
+ 12. [SECURITY] Fix authentication issues with mmap() on drm devices
+ (Jeff Hartmann).
+ 11. Add euro locales and some other missing locales to locale.alias and
+ locale.dir (#4662, 4665, 4667, Mike Harris).
+ 10. Fix Romanian XKB map (#4664, Mike Harris).
+ 9. Spell Portuguese correctly in XKB lst files (#4663, Mike Harris).
+ 8. Fix new ioperm calls in lnx_video.c for Alpha that are not needed
+ (Jay Estabrook).
+ 7. Add drivers for PCMCIA cards, HP VGA Out F1252A, and the ColorGraphic
+ Voyager VGA card to the KDrive server. Tested on the Compaq IPAQ.
+ Use -listmodes, to check resolutions supported.
+ (Alan Hourihane).
+ 6. Add RandR extension (Jim Gettys)
+ 5. Fix int10 option handling and DDC max clock reporting (Marc La France).
+ 4. Fix problems with assembler file dependencies when using gccmakedep
+ with the build (Frederic Lepied).
+ 3. Update Japanese localization of XDarwin help file (Toshimitsu Tanaka).
+ 2. Update XDarwin man pages, help files, and version info. Add option to
+ build XDarwin.app bundle for deployment (Torrey Lyons).
+ 1. Finish DRI resync, including tdfx driver updates for textured video
+ support (VA Linux Systems).
+
+XFree86 4.0.99.900 (18 May 2001)
+ 561. Add an XKB description for Latvian (lv) keyboards (#A.411, Ilya Ketris).
+ 560. Resync with DRI CVS trunk (VA Linux Systems).
+ 559. Savage driver updates, including compiler warning fixes, document
+ the "ShadowStatus" option in the man page, and fix an argument
+ mismatch between ShadowWait and SavageWaitQueue (#4661, Tim Roberts).
+ 558. Update the wacom driver to add a "ScreenNo" option to allow a tablet
+ to be attached to a screen in a multi-head setup, and to add auto-
+ detection of USB line and max parameters of USB tablets (#4640,
+ Frederic Lepied).
+ 557. Add a README file that has information about enabling the extra buttons
+ on the IBM Rapid Access keyboard (#4639, Dennis Bjorklund).
+ 556. Fix some Slovene/Slovak confusion in locale.dir/locale.alias files
+ (#4638, Kamil Toman).
+ 555. New XKB keymaps for cz and sk (#4634, 4637, Kamil Toman).
+ 554. Updates for the iso8859-2 Compose file (#4634, Kamil Toman).
+ 553. Check V_CSYNC in the r128 driver, and fix building with R128_DEBUG
+ enabled (#4631, Michel Dänzer).
+ 552. Mesa 3.4.2 (and later) import.
+ 551. More build & warning fixes (Marc La France).
+ 550. Fix bug that caused hardware cursors to be temporarily moved during mode
+ switches (Marc La France).
+ 549. Optimise HARDWARE_CURSOR_AND_SOURCE_WITH_MASK case (Marc La France).
+ 548. Move xf86CursorScreenRec definition into xf86CursorPriv.h
+ (Marc La France).
+ 547. Fix BIOS retrievals in MGA driver (Marc La France).
+ 546. Fix ATIProbe() for newer Rage128 and Radeon chips (Marc La France).
+ 545. Add temporary workaround in ATI driver for interrupts that occur on
+ PowerPC's upon PCI master-aborts (Marc La France).
+ 544. Update XDarwin to use fb and support Render (Torrey Lyons).
+ 543. Back out sunleo conversion to fb. This driver is too heavily dependent
+ on cfb32 for a simple fb conversion (Marc La France).
+ 542. Miscellaneous build/warning fixes (Marc La France).
+ 541. More prep work for SunOS (Marc La France).
+ 540. Fix libXft build on SunOS (Marc La France).
+ 539. Another makedepend bug fix (Marc La France).
+ 538. Fix use of xftcache utility during !UseInstalled builds (Marc La France).
+ 537. Adds #XFree86LOADER define to wrap ModuleInfo related functions
+ (#4654, Harold Hunt).
+ 536. Add an option to the SiS driver to turn off Xvideo support
+ (Ademar de Souza Reis Jr.)
+ 535. Fix FreeType bug, use MAXFONTNAMELEN (#4652, Janusz Gorycki,
+ Juliusz Chroboczek).
+ 534. Fix hw/vfb for compilation on Cygwin/XFree86 (#4655, Harold Hunt).
+ 533. Fix some Sparc platform issues with Pci resources and the glint
+ driver (#4641-4641,4644-4648 David S. Miller).
+ 532. Update glide, imstt, newport, rendition, suncg14, suncg3, suncg6,
+ sunleo, suntcx, vga and vmware to use fb and support Render
+ (Keith Packard).
+ 531. XDarwin fixes:
+ - Turn off building non-functional RENDER support.
+ - Reduce disappearing cursor problems when switching with Dock.
+ - Top of X display is no longer occasionally drawn black when
+ switching from Aqua.
+ (Torrey Lyons).
+ 530. Update freetype2 bits to 2.0.2 version (Keith Packard).
+ 529. Re-fix the Trident Video scaler support for Blade series chips
+ (Alan Hourihane).
+ 528. Fixed lbx to handle endian swapping without core dump (Egbert Eich).
+ 527. Fixed MTRR region splitting (Egbert Eich).
+ 526. Cleaned up option handling in int10 code (Egbert Eich).
+ 525. Added options to specify the Video BIOS to use for POSTing a
+ chipset (Egbert Eich).
+ 524. Trident driver: added call to BIOS to enable unstretched mode when
+ display is stretched. This should make the option "CyberShadow"
+ obsolete. (Egbert Eich).
+ 523. Attempt to fix video Support on Trident driver (Egbert Eich).
+ 522. Added VBE DDC support to SiS driver (Egbert Eich).
+ 521. Fixed Silicon Motion to unblank the display when driver fails
+ in PreInit() (Egbert Eich).
+ 520. Cleaned up handling of 'shadow status' in Savage driver
+ (Egbert Eich).
+ 519. Savage driver: fixed lockups for Savage4 when loading colormap,
+ manipulating the HW cursor, doing certain blit operations
+ 518. Cleanded up DDC code in mga driver (Egbert Eich).
+ 517. Fixed KGA handling in i740 driver (Egbert Eich).
+ 516. Converted i740 and Silicon Motion drivers to fb (Egbert Eich).
+ 515. Added calls to vbeFree() or xf86FreeInt10() to C&T, glint,
+ mga, neomagic, nv, s3v, tdfx and trident drivers to clean up
+ shared memory segments (Egbert Eich).
+ 514. Reworked video support in C&T driver, cleaned up block handler
+ (Egbert Eich).
+ 513. C&T driver: introduced a delay when setting the cursor image for
+ the first time after a mode change (Egbert Eich).
+ 512. Fixed R128CCE_RESET in r128 driver to do a reset only when dri
+ is enabled (Egbert Eich).
+ 511. Rewrote readPciBIOS() and getValidBIOSBase() (Egbert Eich).
+ 510. Fixed xf86Info structure in xf86Globals.c to match prototype
+ (Egbert Eich).
+ 509. -
+ 508. Fix XDarwin install problems with DESTDIR handling and with soft links
+ to the XtAppAddTimeOut manpage (Christoph Pfisterer).
+ 507. Add Error message output in Cygwin/XFree86 (#4632, Harold Hunt).
+ 506. Fix xdm when HasPam defined, and enable Pam support on Solaris 2.6 and
+ later (#A.401, #A.402, #A.403, Rainer Orth).
+ 505. Add Croatian keyboard for xkbcomp from Slovenian keyboard layout
+ (#A.405, Vlatko Kosturjak).
+ 504. Fix XvQueryAdaptors when there is no adaptors found
+ (#A.394, Jamie Strachan).
+ 503. Remove a stray INCLUDES in Xmuu/Imakefile when snprintf isn't used.
+ Set the Permedia2 DAC Mask to 0xFF.
+ PCI ROM space address access patch for LynxOS PPC.
+ Change limit of motoppcBusAddrToHostAddr for LynxOS PPC.
+ Include <sys/wait.h> for LynxOS in os/osinit.c.
+ Define CBAUD, when it's missing in xterm, on LynxOS.
+ (#A.387, Stuart Lissaman).
+ 502. Add SiS 86C204 to xf86PciInfo.h (#A.382, Carlos Manuel Duclos Vergara).
+ 501. Fix mga font corruption problems introduced with the recent addition
+ of big-endian support (#4629, Andrew C. Aitchison).
+ 500. Update for the mga driver's man page (#4628, Andy Isaacson).
+ 499. Add more drivers to the default build on Linux/mips (#4623,
+ Guido Guenther).
+ 498. Move the vgahw module load/init after the PROBD_DETECT handling
+ in the i810 driver's PreInit(), which fixes a segv when using
+ the X server's -configure option (#A.378, Leandro Martelli).
+ 497. Fix a problem with Radeon VE cards failing to enable its video output
+ (#A.376, Paul Stewart).
+ 496. Fix some DRI-related build dependency problems (David Dawes).
+ 495. Fix some drivers (including tdfx, r128, radeon, ark, imstt) that weren't
+ respecting the Virtual resolution requested in the config file
+ (David Dawes).
+ 494. Fix some offscreen memory calculation/allocation problems in the
+ tdfx driver (David Dawes).
+ 493. Fix a bug in localResizeOffscreenLinear when checking widths
+ (Alan Hourihane).
+ 492. Update Japanese localization for XDarwin Dock related fixes
+ (Toshimitsu Tanaka).
+ 491. Fix restoring of text mode fonts on Permedia3 (Alan Hourihane).
+ 490. Provide workaround for an apparent bug in Mac OS X 10.0.2 that causes
+ XDarwin to lose the cursor when switching to X using the Dock icon.
+ Fix "Application not responding" message in XDarwin's popup Dock menu
+ (Torrey Lyons).
+ 489. Hardware cursor documentation update (Marc La France).
+ 488. XVideo extension support in ATI driver for generic (e.g. v4l) adapters
+ (based on a patch by Ignacio Garcia Etxebarria).
+ 487. Fix ATI driver bug that caused the hardware cursor to move after mode
+ switches (Marc La France).
+ 486. Fix off-by-one error in screen positioning after a mode switch
+ (Marc La France).
+ 485. Backout part of 479 and implement a proper fix in the ATI driver
+ (Marc La France).
+ 484. Fix palette problem on NVIDIA Riva128 in DGA mode (Mark Vojkovich).
+ 483. setxkbmap patch that:
+ - fixes bug in comand line parser
+ - makes debug output more comprehensive
+ - prevent to use 'variant' from previous call if 'layout' name changed.
+ (#4627, Ivan Pascal)
+ 482. Documents Xaa specific options in the XF86Config manual page
+ (#4616, Branden Robinson)
+ 481. Add Mouse 3 Button emulation to Cygwin/XFree86 (#4626, Harold Hunt,
+ Alexander Gottwald).
+ 480. V4L documentation fix (Marc La France).
+ 479. Fix bug in generic hardware cursor RealizeCursor entry
+ (Marc La France).
+ 478. Extend the XFree86-VidModeExtension to accept gamma ramps from the
+ client rather than just rgb gamma values (Mark Vojkovich).
+ 477. More Xv updates for the Permedia3 (#4625, Sven Luther).
+ 476. Build Cygwin/XFree86 with -ansi -pedantic (Alan Hourihane).
+ 475. Limit the number of PCI buses to 128 on ix86 (Marc La France).
+ 474. More fixes for the handling of unassigned PCI bases (Marc La France).
+ 473. Fix option handling in most drivers so that per-screen options work
+ correctly (David Dawes).
+ 472. Resync with DRI CVS trunk (VA Linux Systems).
+ 471. Import latest Mesa 3.4.x branch.
+ 470. Add a PIOOffset value plus readEnable and writeEnable function pointers
+ to the vgahw rec. The former allows vgahw to be used for VGA registers
+ that are shadowed in I/O space. The latter allow the VGA_ENABLE
+ register to be accessed in similar way to most other VGA registers.
+ Add vgaHWEnable() and vgaHWDisable() functions (David Dawes).
+ 469. Disable HWcursor for CyberBladeXP chips (Alan Hourihane).
+ 468. Fix a Trident Cyber9388 setup issue (Alan Hourihane).
+ 467. Fix man page building and installing on Darwin. To be safe we assume
+ the Darwin file system is case insensitive since one common variety is,
+ ie. HFS+ (Torrey Lyons).
+ 466. Improve interoperability between Aqua pasteboard and X cut buffer with
+ XDarwin (Gregory Parker).
+ 465. Updates for Cygwin/XFree86 (Harold Hunt).
+ 464. Provide more robust default preferences for XDarwin (Torrey Lyons).
+ 463. Remove map84 keyboard map from Cygwin/XFree86 build (#4621, Harold Hunt).
+ 462. Disable xload on Cygwin/XFree86 (Alan Hourihane).
+ 461. Remove an errorneous i++ from os/xdmcp.c with -class (Alexander Gottwald).
+ 460. Allow Cygwin/XFree86 to build with cygipc support (Alan Hourihane).
+ 459. Small XDarwin fixes:
+ - Don't leak IOService objects when searching for desired screen.
+ - Eliminate chance of SIGPIPE while shutting down.
+ - Revert to Aqua cursor when quit by exiting main client.
+ - Stop console error messages when using mouse button 3.
+ (Torrey Lyons and Christoph Pfisterer).
+ 458. At Linus' request, make linux/int10 module deal with shmat() errors
+ (Marc La France).
+ 457. Fix makedepend's integer value parsing and make it understand GCC's
+ #include_next directive as found in glibc & libc5 (Marc La France).
+ 456. Xterm patch #156 (Thomas Dickey): change preference of types for
+ selection-target between UTF8_STRING and STRING (Juliusz Chroboczek),
+ fixes for configure script and documentation (report by Adam
+ <adam@cfar.umd.edu>).
+ 455. Fix XDarwin so display number preference is followed (Torrey Lyons).
+ 454. Fix Xserver/Imakefile for Cygwin/XFree86 (Harold Hunt, Alan Hourihane).
+
+XFree86 4.0.99.3 (26 April 2001)
+ 453. Loader fixups for Sparc's (Marc La France).
+ 452. Fix dependencies for libGLU on Cygwin/XFree86 (Alan Hourihane).
+ 451. Make xdm & xfs compile on Cygwin/XFree86 (Alan Hourihane).
+ 450. Update Japanese localization of XDarwin.app's Preferences window
+ (Toshimitsu Tanaka).
+ 449. Don't build clients that require extension libraries unless those
+ libraries are being built (#A.386, Scott A McConnell, David Dawes).
+ 448. Fix the BuildXinerama test in Xserver/Imakefile (#4615, Harold Hunt).
+ 447. Ignore MakeDllModules when DoLoadableServer isn't set (#4613,
+ Guido Guenther).
+ 446. Don't define the <Ctrl>T compose sequences in the iso8859-1 compose
+ map by default (#4611, Mike Harris).
+ 445. Allow the nls compose data files to be pre-processed (David Dawes).
+ 444. Fix some problems introduced with the internationalisation of twm
+ (#4607, Juliusz Chroboczek).
+ 443. Fix dpsinfo so that the correct headers are included (#4606,
+ Juliusz Chroboczek).
+ 442. Fix mismatches between the way xlsfonts interprets font properties and
+ the way they are defined in the XLFD spec (#4604, Jochen Voss).
+ 441. Add entries for German iso-8859-15 locales (#4603,
+ Philipp Matthias Hahn).
+ 440. Cleanup build in Xserver/GL/mesa, making use of the earlier cleanups in
+ the lib/GL build (David Dawes). #4602 is redundant as a result.
+ 439. [SECURITY] Check for negative reply length/overflow in _XAsyncReply
+ (Xlib) (#4601, Mike Harris).
+ 438. New 'hu' xkb symbols file (#A.364, Peter Soos).
+ 437. Trident driver fixes for PC98 platforms (#4612, Akio Morita).
+ 436. Convert apm driver from cfb to fb (Alan Hourihane).
+ 435. Fix makedepend for '//' comment parsing and symbols that contain
+ expressions (Marc La France).
+ 434. Fix a problem with the mga G400 2nd head going into power saver mode
+ when it should be blanked, and enable DPMS for the 2nd head (#A.358,
+ Craig Leres).
+ 433. Fix a horizontal resolution problem that shows up with mga Xv (#A.365,
+ Ewald Snel).
+ 432. Work around a refresh rate problem when using custom modelines that
+ have a refresh rate > 100Hz with the Matrox HAL library (#A.360,
+ Ewald Snel).
+ 431. XDarwin fixes:
+ - Provide work around for kernel/driver issue on Darwin 1.3 that
+ causes the kernel keymapping to be empty on Mac portables.
+ - Command line -dpi option is no longer ignored.
+ (Torrey Lyons).
+ 430. Ensure that the X-TT module isn't built if the Xserver isn't being
+ built (#4594, Chu-yeon Park).
+ 429. Make xconsole try to reopen the /dev/xconsole pipe when it gets an EOF
+ (#4593, Jeff King).
+ 428. Prevent an infinite loop (or unpredictable behaviour) in xmodmap (#4592,
+ Peter Maydell).
+ 427. Add a font substitute for the zh locale (#4590, submitted by Branden
+ Robinson).
+ 426. Make the backspace key definitions for the xkb macintosh/us and
+ dvorak layouts consistent with the default 'us' layout (#4588, 4589,
+ Branden Robinson).
+ 425. Update for the sessreg man page (#4587, Branden Robinson).
+ 424. Add a font substitute for the ko locale (#4586, Changwoo Ryu).
+ 423. Avoid using fileno() in xauth's signal handler, and write messages to
+ stderr rather than stdout (#4585, submitted by Branden Robinson).
+ 422. Fix nested comment warnings in dix/gc.c (#4584, Branden Robinson).
+ 421. Include <stdlib.h> in two lbxutil files to get malloc/free prototypes
+ (#4583, submitted by Branden Robinson).
+ 420. Remove duplicate paragraph in xdm man page (#4582, Branden Robinson).
+ 419. Fix line numbers in error messages when parsing .twmrc files (#4580,
+ Topi Miettinen).
+ 418. Fix backwards font glyphs in the ati/Mach64 driver for big endian
+ platforms (#4579, Michael Dänzer).
+ 417. Add a build-time option to xf86config to make it append the major version
+ number to the config file name (David Dawes, prompted by #4577,
+ Branden Robinson).
+ 416. xf86config build fix for non-GNU make (Marc La France).
+ 415. Build fix for Summa driver on SunOS/Sparc (Marc La France).
+ 414. compiler.h cleanup (Marc La France).
+ 413. More DependDefines, OS_DEFINES and EXT_DEFINES build fixes
+ (Marc La France).
+ 412. Fix installation of specs docs (#4575, Branden Robinson).
+ 411. Make Cygwin/XFree86 call miSetPixmapDepth for RENDER extension
+ (Alan Hourihane).
+ 410. Xterm patch #155 (Thomas Dickey): correct change to return-type of
+ in_put(), which caused problem with UTF-8 (fixed by Bruno Haible).
+ 409. Some unobstrusive preparations for SunOS/Sparc (Marc La France).
+ 408. Remove unnecessary libxf86_os link into Xnest & Xvfb (Marc La France).
+ 407. Disable building of SuperProbe by default (Alan Hourihane).
+ 406. Make OS_DEFINES available to all server Makefiles (Marc La France).
+ 405. Add support to xman for parsing '\" <string> formatting hints.
+ Also cleanup some of the vendor-specific definitions and fix
+ processing of mandoc pages on FreeBSD (based on #4573,
+ Branden Robinson, David Dawes).
+ 404. Fix default mailbox selection in xbiff for Linux, add recognition of
+ $MAIL, and update the man page accordingly (based on #4571,
+ Branden Robinson).
+ 403. Remove redundant PCI id definitions in the tdfx driver, and clean up
+ the messages printed when the DRI can't be enabled because the bpp
+ isn't supported (based on #4570, Branden Robinson and #4598,
+ Antti Tapaninen). Also, re-enable soft booting.
+ 402. Install the XftConfig file under $(CONFDIR), with a link from the
+ usual place (based on #4569, Branden Robinson).
+ 401. Update the Debian section on linux.cf (#4568, Branden Robinson).
+ 400. Startx fixes/enhancements, including:
+ - Fix argument processing.
+ - Set XAUTHORITY.
+ - Don't overwrite existing cookies, and remove ones added for this
+ session when exiting.
+ - Deallocate the VT that X was using.
+ - Update the man page.
+ (based on #4567, Branden Robinson, Henry T. So, Jr).
+ 399. Implement two new driver-provided options in the common cursor code and
+ use them to work around hardware bug that causes flickering Mach64
+ hardware cursors (Marc La France).
+ 398. Integrate SiS driver changes (Ademar De Souza Reis).
+ 397. Initialize Elsa GloriaXXL (GLINT) framebuffer properly (Alan Hourihane).
+ 396. Fix bug where XDarwin.app would not hide the X display when it was no
+ longer the active application (Torrey Lyons).
+ 395. Make XDarwin.app ignore .xserverrc file when started from the GUI so
+ that it starts correctly (Torrey Lyons).
+ 394. Cygwin updates (#4557, 4558, 4563, Suhaib Siddiqi).
+ 393. Document the usage of the -server option in the xfsinfo man page (#4562,
+ Mike Harris).
+ 392. Fix xfs man page problem (#4561, Mike Harris).
+ 391. Fix a crash that happens when a font encoding has no aliases and it is
+ invoked using a non-canonical name (#4560, Takeshi Miyasaka).
+ 390. Add imake/config support for distinguising big endian and little endian
+ MipsArchitecture types (#4556, Florian Lohoff).
+ 389. Add support to the mga driver for auto-detecting the display type
+ (#4555, Stephane Duguay (Matrox)).
+ 388. Savage driver updates, including:
+ - Enable the Render extension.
+ - Make the DGA mode setup look more like the other drivers.
+ - First cut at Xvideo for the Savage4.
+ - Add a "ShadowStatus" option, which is a reliable workaround for the
+ scrolling hang that many experience.
+ (#4554, Tim Roberts).
+ 387. Enable wide character support for NetBSD 1.5P and later (#4553,
+ Matthias Scheler).
+ 386. Add offscreen image support to the i810 driver (for Xv), and fix
+ physMemBase (#4552, Matthew Sottek).
+ 385. Fix bad cut&paste update to the sunffb driver (#4551, David S. Miller).
+ 384. Fix "DriDrivers" typo in the sparc section of xfree86.cf (#4550,
+ David S. Miller).
+ 383. Update UCS 75dpi and 100dpi fonts, including adding UCS versions of
+ the UTBI and UTB fonts that were in the unnec_75dpi and unnec_100dpi
+ directories. The other "unnec" fonts are also moved over (#4548,
+ Markus Kuhn).
+ 382. Make the v4l driver module keep searching for more devices if the first
+ one can't do overlay (#4545, 4614, Gerd Knorr).
+ 381. Bug fixes for Xv support using a Permedia3 chip (#4564, Sven Luther).
+ 380. Xterm patches #151, #152, #153, #154 (Thomas Dickey):
+ - improve select/paste of COMPOUND_TEXT and UTF8_STRING (Juliusz
+ Chroboczek, Bruno Haible).
+ - fixes for erase operations (Alexander V Lukyanov).
+ - correct ifdef for bold overstriking when built to support UTF-8.
+ - change resource corresponding to "-T" option to match Xt library's
+ "-title", i.e., ".title" rather than "*title" so the command-line
+ options are interchangeable as documented (Debian bug report #68843).
+ - modify "RequestResize()" function to save/restore window manager hints
+ (Debian bug report #79939).
+ - improved error checking for input-method initialization.
+ - minor fixes for terminfo entries.
+ - various build/portability fixes.
+ 379. XDarwin fixes:
+ - Don't SetUID XDarwin X server. (The IOKit doesn't need it.)
+ - Startup message reports correct display mode.
+ - XDarwin.app is now installed in /Applications by default.
+ - Update xinit server name list.
+ - "make clean" now works for a non-root user.
+ (Torrey T. Lyons)
+ 378. Make XDarwin correctly handle color hardware cursors in Quartz mode
+ (Gregory Parker).
+ 377. Fixes to the XDarwin application:
+ - Display menubar when started without a splash screen.
+ - Query before quitting from Aqua when started with startx.
+ (Torrey T. Lyons).
+ 376. Update Japanese localization for XDarwin application (Toshimitsu Tanaka).
+ 375. Fix byte ordering and static colormap issues with XDarwin server
+ on x86 hardware (Rob Braun).
+ 374. Fix problems with XDarwin hardware cursor support in Quartz mode
+ (Gregory Parker).
+ 373. Resync with DRI CVS trunk (VA Linux Systems).
+ 372. Fix bug in XvMC protocol (Bob Paauwe).
+ 371. Ensure NoInt10 is used for PC98 (Alan Hourihane).
+ 370. Fix PC98 issues with the trident driver (#4547, Akio Morita).
+ 369. Add a NoInt10 option to the int10 module, allowing it to be disabled
+ per entity (Alan Hourihane).
+ 368. Fixes to the XDarwin application:
+ - X clients are now started correctly.
+ - Shuts down cleanly.
+ - Removed erroneous NSString releases in quartzCocoa.m.
+ - Dragging with mouse button 3 or higher depressed produces events.
+ (Christoph Pfisterer and Torrey Lyons)
+ 367. Make the ramdac module for the IBM RGB640 DAC work at depth 15
+ (Alan Hourihane).
+ 366. Fix interference between acceleration and hardware cursors on Mach64
+ variants (Marc La France).
+ 365. Fix xload so it is functional on Darwin OS (Rob Braun).
+ 364. Mac OS X specific fixes:
+ - Fix typo in XDarwin startup program that could cause crash with
+ many command line options.
+ - Move Show/HideMenuBar() call to main thread so that XDarwin
+ application displays a menu bar on the Mac OS X desktop.
+ (Greg Parker).
+ 363. XDarwin application fixes including:
+ - Fix bugs causing XDarwin preferences to not be saved correctly.
+ - When using system beep, turn off bell when beep volume is set to 0.
+ (Christoph Pfisterer).
+ 362. Fix building of dpsops.h and psops.h in correct order (Alan Hourihane).
+ 361. Change xvmc.h to xvmcext.h to avoid case-(in)sensitive name clash with
+ XvMC.h for Cygwin/XFree86 (Alan Hourihane).
+
+XFree86 4.0.99.2 (6 April 2001)
+ 360. Fbdev driver updates, including:
+ - Switch from shadowfb to mishadow.
+ - Add RENDER extension support.
+ - Add DGA support.
+ - Fix SaveScreen function
+ - Blank screen in ScreenInit so the former framebuffer contents aren't
+ visible
+ (#4544, Michel Dänzer).
+ 359. Remove references to th_TH compose file from compose.dir (#4543,
+ Theppitak Karoonboonyanan).
+ 358. Fix for improper setting of the maxHValue limit in the tseng driver.
+ This makes modes like 1152x864@24bpp possible (#A.355, Stanislav Brabec).
+ 357. Fix a hw cursor related lockup that shows up with some mga G400
+ 16MB OEM single head cards (#A.351, Ewald Snel).
+ 356. Fix the XKB macintosh/it mapping (the accent-related keys were wrong)
+ (#A.349, Andrea Ghirardini).
+ 355. Add XKB descriptions for the extra keys on a Chicony internet
+ keyboard (#A.356, John Gladkih).
+ 354. Add support for the internal input device interface to mice on
+ Solaris 8, and make it the default protocol ("VUID") (#A.340,
+ Marcus Comstedt).
+ 353. Add XKB descriptions for the extra keys on an IBM Rapid Access II
+ keyboard (#A.332, Patrick D'Cruze).
+ 352. Fix a typo in xvidtune (#A.327, Peter Breitenlohner).
+ 351. Fix Linux/libc5 build problem in the bigfont extension code (#A.327,
+ Peter Breitenlohner).
+ 350. Fix typo in Chooser.ad (#A.327, Peter Breitenlohner).
+ 349. Big endian and PowerPC support for the mga driver (#4540, Ani Joshi).
+ 348. Big endian support for the tdfx driver (#4539, Ani Joshi,
+ Nicolas Dimitrijevic).
+ 347. Build the tdfx and imstt drivers on PowerPC platforms (#4538, Ani Joshi).
+ 346. Add IMS (Integrated Micro Solutions) PCI data for the TwinTurbo128
+ and TwinTurbo3D (#4537, Ani Joshi).
+ 345. Fix some color and accel glitches in the imstt driver (#4536, Ani Joshi).
+ 344. Add ISA I/O support for PowerPC Linux using the __NR_pciconfig_iobase
+ syscall (#4535, Ani Joshi).
+ 343. New Xwin server code from the Cygwin/XFree86 project. This version
+ is more portable across Win32 platforms. Changes include:
+ - Use fb and shadowfb, and use the faster of GDI blitter,
+ DirectDraw blitter and DirectDraw4 blitter to update damaged
+ regions. The video card's framebuffer is no longer mapped.
+ - Works correctly at depths > 8, but colors are not correct at depth 8.
+ - Uses the standard Win32 API messages for processing keyboard and
+ mouse input rather than using DirectInput. This is more reliable.
+ - Improved internal structure and coding conventions.
+ - Builds completely from the XFree86 tree using gcc (the Visual C++
+ compiled xf_dx.dll is no longer used).
+ - The new server can run on machines that don't have DirectDraw/DirectX
+ installed (or installed but not operable) by falling back to the
+ GDI blitter. The best drawing interface is determined at startup,
+ but this can be overriden with the -engine command line option.
+ - The Xrender extension is now supported.
+ - Command line option is available to run in full screen mode.
+ (#4531, 4532, 4534, Cygwin/XFree86 project including Harold L Hunt II,
+ Suhaib M Siddiqi, Dakshinamurthy Karra, Peter Busch).
+ 342. v4l driver bug fixs: catch xalloc() failures, and set the depth
+ correctly for the VIDIOCSPICT ioctl (#4530, Gerd Knorr).
+ 341. Add a driver for VMware virtual SVGA devices. This is for use
+ by X servers running under a VMware guest OS (#4529, VMware, Inc).
+ 340. Remove Cygwin-specific #ifdef in Xserver/os/Waitfor.c, which fixes
+ a crash (#4528, Suhaib Siddiqi).
+ 339. Cygwin build fixes (#4527, Suhaib Siddiqi).
+ 338. Updates to the "citron" input driver. It includes compatibility
+ with the Winbond SIO chip (83977EF), and some new commands to
+ communicate to the touch driver from an application program
+ (via XChangeFeedbackControl) (#4526, Peter Kunzmann, Citron).
+ 337. Updates to the "summa" input driver, including:
+ - "Resolution" replaces "LPI" as option for setting resolution.
+ - Fixed device reporting to give the actual tablet area size and
+ resolution.
+ - Tested and working with: SummaSketch3, Hitachi_1217D, a couple of
+ others emulating the Summa protocol.
+ - Reduce debug message verbosity.
+ - Various cleanups.
+ (#4525, Huver).
+ 336. SunFFB driver bug fixes, including:
+ - Be smarter about restoring Kernel framebuffer state.
+ - Cure build errors when debug defines are enabled.
+ - Do not enable DRI or DGA acceleration if NoAccel option is specified.
+ (#4524, David S. Miller).
+ 335. Mga G450 dual head support, (#4523, Luugi Marsan (Matrox) and
+ David Woodhouse).
+ 334. Fix missing xfree -> Xfree mapping in the Type1 font library code (#4521,
+ Juliusz Chroboczek).
+ 333. Make sure that an initialization assumption in parse_fontdata() in
+ lib/X11/omGeneric.c is met (#4520, Jonathan Kamens).
+ 332. Add checksum verification to detect monitors that give incorrect EDID
+ data (#4517, Andrew C Aitchison).
+ 331. Fix checking of LD_ELFDLOBJECT on big-endian systems (#4514,
+ Guido Guenter).
+ 330. Add an update.fonts target/rule for maintainer use to update
+ the latin1 fonts in the source tree that are derived from the
+ ISO10646-1 masters (David Dawes).
+ 329. Update UCS misc fonts, which includes the addition of the missing
+ 4 DEC VT100 graphics characters from Unicode 3.2 (#4533, Markus Kuhn).
+ 328. Handle build-time generation of 8 bit fonts from the UCS versions,
+ rework the way this is organised, and allow some better control over
+ which fonts are built/installed (David Dawes).
+ 327. Add UCS versions of most of the 75dpi and 100dpi bdf fonts, and generate
+ 8-bit subsets of them. Also, remove the now-redundant latin2
+ bdf font directories (#4512 Markus Kuhn).
+ 326. Add support for Trident CyberBladeXP and CyberBladeXPm (mobile)
+ (Alan Hourihane, Robert V Fleisig).
+ 325. Add XKB descriptions for the extra keys on an IBM Rapid Access keyboard
+ (#4510, Dennis Bjorklund).
+ 324. Update Status and i810 docs to mention i815 support and FreeBSD support
+ (#4509, Andrew C Aitchison, David Dawes).
+ 323. Xprt fixes to make it closer to X.org version (Danny Backx).
+ 322. Fix for reading PCI resource data on Linux/alpha (#4508,
+ Ivan Kokshaysky).
+ 321. Add XKB descriptions for the extra keys on a "Logitech Internet Keyboard"
+ (#4505, Matthew Hand).
+ 320. Build shared libGL and DRI client modules on Linux without PIC for
+ performance reasons.
+ 319. Updates to glxinfo (Brian Paul).
+ 318. Add glxgears (Brian Paul).
+ 317. glxinfo needs libGLU (Marc La France).
+ 316. Rage128 fix to Cards database (Marc La France).
+ 315. Minor fix to PCI resource overlap handling (Marc La France).
+ 314. Loader code simplification and IA-64 cache flushes (Marc La France).
+ 313. Workaround in the ATI driver for troublesome interaction between loader
+ and compiler optimisation (Marc La France).
+ 312. Warning fixes for `gcc -fno-builtin`, which appears to be the default on
+ some systems (Marc La France).
+ 311. Add glyph transformations to Xft (Tuomas J. Lukka)
+ 310. Add XftCache creation to fonts/Type1 (Keith Packard)
+ 309. Add Xmuu library for non-Xt/Xaw dependent applications (Jim Gettys)
+ 308. Add i810 and Xv support to kdrive (Pontus Lidman)
+ 307. Fix Radeon CPUToScreen acceleration on Alpha platforms (Jay Estabrook).
+ 306. Fix bug in ServerLayout option handling when there's no ServerFlags
+ section present (David Dawes).
+ 305. Allow fb to access 16bit devices (Alan Hourihane).
+ 304. XvImage support for GeForce chips in the nv driver (Mark Vojkovich).
+ 303. XvMC build fix (Marc La France).
+ 302. Fix recently introduced bug in xf86cfg (Marc La France).
+ 301. Re-instate warning fixes clobbered by DRI merge (Marc La France).
+ 300. Ignore disabled non-video PCI ROMs (Marc La France).
+ 299. Hardware cursor implementation for Mach64 variants (William Blew,
+ Ani Joshi, Marc La France).
+ 298. Some endianness fixes in the ATI driver (incomplete) (Marc La France).
+ 297. Fix MMIO ordering problems for Mach64 acceleration (Marc La France).
+ 296. Fix ATI driver behaviour when it finds the LCD panel has been disabled
+ on entry (Marc La France).
+ 295. Fix ECP clock for GATOS (Vladimir Dergachev).
+ 294. Undo part of CHANGELOG 36 (Marc La France).
+ 293. Rework the building of libGL and the DRI drivers (David Dawes).
+ 292. Update greek keyboard layout and compose map.
+ (#4513, Katsaloulis Panagiotis)
+ 291. Fix problems in Xnest when MouseKeys is enabled and patched it to
+ use XKB to allow clients to change keyboard description and
+ configuration whithout interfering with the "real" X server
+ (Paulo César Pereira de Andrade).
+ 290. Dvorak keymap fix (#A.343, J Phillips).
+ 289. Some vesa driver updates, including:
+ - Wrap CloseScreen().
+ - Call xf86PrintModes().
+ - Add error messages for when PreInit bails out for lack of modes.
+ - Rework how the debugging information is printed.
+ _ Avoid some build warnings.
+ (David Dawes)
+ 288. Make it possible to call xf86PrintModes() when there is no hsync or
+ refresh data available, like from the vesa drivers (David Dawes).
+ 287. Add a "cleanlinks" script for cleaning up dangling links in lndir-created
+ shadow trees (David Dawes).
+ 286. Resync with DRI CVS trunk (VA Linux Systems).
+ 285. Make extension headers available when the extension is enabled but the
+ extension's client library is disabled (David Dawes).
+ 284. Make it possible to enable building selected extension libraries
+ when BuildServersOnly is set, and allow independent control of
+ building docs and clients (David Dawes).
+ 283. Import latest Mesa 3.4.x branch.
+ 282. Lower the default fifo threshold for PM3 chips (Alan Hourihane,
+ Rafael Barbalho, 3DLabs).
+ 281. Fix 3DLabs GLINT driver for use the Flat Panels, use the UseFlatPanel
+ option. Tested with the SGI 1600SW and Permedia3 board (Alan Hourihane).
+ 280. Fix glxinfo to query default display (Alan Hourihane).
+ 279. Convert TGA driver to use fb (Alan Hourihane).
+ 278. Fix XTRAP typo in miinitext.c (Damien Touraine).
+ 277. Major updates to the XFree86(1) man page (David Dawes).
+ 276. A new (perl) version of the mkhtmlindex script that works better than
+ the shell version (David Dawes).
+ 275. Fix the `make depend` scripts to accept -U flags and not require a blank
+ in their -f flag (Marc La France).
+ 274. Bump the video and input driver ABI minor numbers.
+ 273. Add xf86SetRealOption() (Huver).
+ 272. Change Xdarwin do that it processes all pending events instead of
+ just the oldest one on ProcessInputEvents() call ,
+ Quit Xdarwin cleanly, wether from the Xserve or from Cocoa front end,
+ Fix a case typp which cases the Xdarwin server not to start if
+ installed on a case sensitive file system like UFS.
+ (#4504, #4507, #45011, Gregory Parker, Torrey T. Lyons).
+ 271. Move Section DRI/Endsection into the DRI function to be consistant with
+ all of the other sections. (Quentin Neill)
+ 270. Made xf4bpp code moer 64bit clean (still doesn't work on Alphas)
+ (Egbert Eich).
+ 269. Removed disable/enable interrupt call on ia64 platforms.
+ The machine instruction is privileged and not permitted in user space
+ (Egbert Eich).
+ 268. Improved mode setting in Trident driver; added code to ValidMode
+ to reject any modes whose size is larger than the physical LCD
+ size if LCD is enabled (Egbert Eich).
+ 267. Modified error message in TDFX driver to give user a clue how
+ to avoid error (Stefan Dirsch).
+ 266. Fixed appearant typo in SMI driver (Egbert Eich).
+ 265. Changed Savage driver to unmap memory when exiting PreInit() and
+ maps it on every call to ScreenInit() (Egbert Eich).
+ 264. Changed handling of failed vbe call in rage 128 driver.
+ No the driver doesn't fail any more (Egbert Eich).
+ 263. Integrate the currently Panix-specific keycodes into atKeynames.h,
+ since they're not really Panix-specific (David Dawes).
+ 262. Fix problem with a NULL pointer in Xv Xineramification (Benjamin Monate).
+ 261. Bug fixes and improvements for mouse 3 button emulation state machine
+ (Andrew Pimlott).
+ 260. Updates for Hurd support (#A.324, Marcus Brinkmann).
+ 259. Add call to setlocale() in xev (#A.322, Eugene B. Byrganov).
+ 258. Add support fo the charset Big5HKSCS to the X-TrueType module, as
+ well as some basic XLocale support for it (#A.321, Roger So).
+ 257. Fix core dump in XqueueMousePreInit (#A.317, Fiel Cabral).
+ 256. Allow the mga driver's "DigitalScreen" option to work for the first
+ head (#A.297, Niels Gram Jeppesen).
+ 255. Add zh_CN.GBK locale support (#A.293, Yong Li).
+ 254. Fix a problem with the ThinkingMousePS/2 protocol handling of left
+ movement (#A.292, Ian Remmler). (This has been in 3.3.x since 3.3.4.)
+ 253. Make xdm Xinerama-aware so that it can avoid splitting login and
+ chooser windows across physical screens (#A.276,
+ Dmitry Yu. Bolkhovityanov).
+ 252. Fix a resource allocation bug in the DBE code (#A.271, Bill Rugolsky).
+ 251. Only enable Xv support for the 630 in the sis driver (#A.263, Nick Lamb).
+ 250. Modify the sis driver to prefer 24bpp framebuffer layout. Perhaps not
+ all support 32bpp? (#A.263, Nick Lamb).
+ 249. Add missing byte to Intellimouse init string, which fixes problems
+ that show up with some KVM switches (#A.258, Seung-Hyeon Rhee).
+ 248. Some DRM module fixes for FreeBSD 5-current (#A.242, Andrew Atrens).
+ 247. Fix xterm build on Solaris 2.5.1 (based on #A.282 from mark at zang.com).
+ 246. Make the Linux/PPC "custom keycodes" choice a run-time option instead
+ of a build-time option (#A.240, Franz Sirl).
+ 245. Add support to splitting WC MTRR regions on Linux when the regions is
+ not aligned on a size boudary (#A.238, _Usul John Obscurant).
+ 244. Add Acecad support to the "summa" input driver (#A.237, Arpad Gereoffy).
+ 243. Don't try to map 64K blit window aperture on older trident chips
+ (Alan Hourihane).
+ 242. V4L driver cleanups and Xineramification (#4502, Gerd Knorr).
+ 241. Make the X server and the Mac OS X front end run in a single process.
+ Other build fixes for Darwin (#4500, #4501, the XonX team).
+ 240. Don't build xf86config under BuildServersOnly (Marc La France).
+ 239. Potential fix for DGA apps that set colourmaps the normal way rather than
+ through DGA (Mark Vojkovich, Marc La France, Pontus Lidman).
+ 238. Make fstobdf generate correct ATTRIBUTES fields (Ishikawa Mutsumi).
+ 237. Xt man page updates (Paul Vojta).
+ 236. Plug kernel security hole in Linux int10 (Marc La France).
+ 235. Fix Xnest build for newest gcc versions (Marc La France).
+ 234. Fix typo in Xv Xinerama support (Gerd Knorr).
+ 233. Fix a problem with multi-thread support on OpenBSD (released OpenBSD
+ versions don't have getpwuid_r) (Matthieu Herrb)
+ 232. Allow to compile on OpenBSD-current which has completly removed PCVT
+ from its installation. (Matthieu Herrb)
+ 231. Support for ThreadedX on FreeBSD (FreeBSD ports patch-xthread).
+ 230. Updates for console-related FreeBSD system header changes as of 4.1-REL
+ (FreeBSD ports patch-r, patch-s).
+ 229. Don't leave free'd vrotate uninitialised in lib/X11/omGeneric.c
+ (FreeBSD ports patch-q).
+ 228. Protect #define HasPam in FreeBSD.cf (FreeBSD ports patch-d).
+ 227. Fix border garbage for the G400 second head by backing out #4205
+ (David Dawes).
+ 227. Fix a typo in fonts/util/Imakefile (#4499, Juliusz Chroboczek).
+ 226. Add a document describing the DPS code included in the tree, and
+ pointers to web resources (#4498, Juliusz Chroboczek).
+ 225. Use VBE to add runtime DDC support to the i810 driver (#4496,
+ Andrew C. Aitchison).
+ 224. DRM kernel module updates for FreeBSD (#4493, joe at cracktown.org).
+ 223. Add support for the "Internet" keys of the Genius Comfy KB-16M keyboard
+ (#4491, Kamil Toman).
+ 222. Include three DPS sample clients:
+ - dpsinfo: random info about the DPS extension;
+ - dpsexec: interactive DPS ``executive'' (command-line);
+ - texteroids: a demo of font support.
+ (#4489, 4497, Juliusz Chroboczek).
+ 221. Don't build the GLU library when not building GLX. This fixes
+ a build failure when GLX is disabled (#4488, Juliusz Chroboczek).
+ 220. Make the stub files that pswrap generates contain the same set of
+ includes as the Adobe version, which fixes problems building
+ standalone DPS clients (#4487, Juliusz Chroboczek).
+ 219. Fix setxkbmap bugs, including:
+ - Continue working if the appropriate root window property where the
+ current xkb settings are saved can't be read or interpreted.
+ - Make the -keymap option work.
+ - Update the man page to explain how the "-option" option works.
+ - Add primitive sanity checking for 'map name'.
+ (#4482, Ivan Pascal).
+ 218. Fix a server crash while reading DDC data from EDID2 capable monitors
+ (#4481, Andrew C Aitchison).
+ 217. Updates to Thai support, including:
+ - Fix a bug combining characterw with Shift keys.
+ - Remove the th_TH Compose file so that Thai XIM is/can be(?) activated
+ without needing XSetLocaleModifiers().
+ - A more precise context-sensitive input sequence check using
+ XNStringConversionCallback added. This has been tested with
+ xiterm+thai-1.04pre2. The implementation detail might be changed
+ if found inconsistent with the X11 specification.
+ (#4478, Theppitak Karoonboonyanan).
+ 216. Update ucs2any.pl, and replace the special map-* files with the
+ original mapping files from ftp.unicode.org. Changes include:
+ - A bug has been fixed that caused sometimes the FONT property not
+ to be updated correctly.
+ - The FONTBOUNDINGBOX is now recalculated, which makes the script
+ also suitable for proportional fonts.
+ - The mapping table for the DEC VT100 graphic characters is now built
+ into the script. This means the special map-* files are not necessary
+ any more and they could be replaced with the original mapping files
+ found on ftp://ftp.unicode.org/Public/MAPPINGS/
+ - Whether the DEC VT100 graphic characters are added can be controlled
+ with options +d/-d. Default is to add them for upright charcell fonts
+ only.
+ - Slightly improved warning messages.
+ (#4472, Markus Kuhn).
+ 215. Fix libGLU build problem on Cygwin (#4467, Suhaib M. Siddiqi).
+ 214. Fix missing libX11 exported symbols for Cygwin (#4467,
+ Suhaib M. Siddiqi).
+ 213. Updates for Hurd support (#A.209, Marcus Brinkmann).
+ 212. Fix some mis-placed mem_barrier's for Alpha platforms (Jay Estabrook).
+ 211. Fix a Index/DAC register access in glint PM2v, PM3 driver.
+ (#A.319, Romain Dolbeau).
+ 210. Add Xv support to Permedia3 driver (#4480, #4486 Sven Luther).
+ 209. Support for NVIDIA GeForce3 (Mark Vojkovich).
+ 208. Allow GccWarningFlags overrides on Linux (Marc La France).
+ 207. Fix a problem with xvinfo's listing of image formats
+ (Giridhar Pemmasani).
+ 206. Fix bug in XkbSetNamedDeviceIndicator (XkbSetNamedIndicator). This
+ function can be used both for change state of specified indicator
+ (on/off) and for change description (and so behavior) of indicator.
+ Fix bug (in XkbGetPerClientControls). Typo where subroutine apply bit
+ mask (that consist of bitwise OR of three separate masks) to value
+ that have to be returned (#4474, Ivan Pascal).
+ 205. Setxkbmap can crash X server if one specify some illegal string as
+ 'xkb variant' name (#4471, Ivan Pascal).
+ 204. In Grab mode XKB sends 'state' in key events without 'group info'
+ (keyboard map layout) (#4469-4470, Ivan Pascal).
+ 203. Rewrite the X-Video extension's Xineramification (Mark Vojkovich).
+
+XFree86 4.0.99.1 (19 February 2001)
+ 202. Gamma correction and DirectColor visual support for NVIDIA RIVA TNT
+ and newer chipsets (Mark Vojkovich).
+ 201. IA64 fix for generic int10 code (Egbert Eich).
+ 200. Redadding space as delimiter in locale.alias and locale.dir
+ (Egbert Eich).
+ 199. Modified memory debugger script to retieve backtrace information
+ with an unmodified version of gdb (Egbert Eich).
+ 198. Modified memory debugger to print out backtrace of call where
+ a referenced freed pointer was once allocated (Egbert Eich).
+ 197. Several more fixes for memory leaks and several "referenced freed"
+ to keep memory debugger quiet (Egbert Eich).
+ 196. Fixed "referenced freed" memory debugger message in xf8_24bpp code
+ (Egbert Eich).
+ 195. Add a new rule for building DRI (client) modules, so that only the
+ relevant symbols are exported (#4454, Red Hat).
+ 194. Fixed several memleaks in PCI bus code (Egbert Eich).
+ 193. Added code to disable SIGIO when entering SETUP state and reenable
+ it when leaving SETUP state (Egbert Eich).
+ 192. Add type of option argument as comment to config file.
+ (xf86cfg might need some fixing) (Egbert Eich).
+ (Hopefully) fixed reordering of chips so primary comes first
+ (Egbert Eich).
+ 191. Fixed bug that caused server to crash when a DGA private colormap
+ was freed as miSprite still had a pointer to this colormap
+ (Egbert Eich).
+ 190. Fixed savage driver for altered vbe functionality (Egbert Eich).
+ 189. Moved bulk of generic VBE functionality from VESA driver into
+ the vbe module (Egbert Eich).
+ 188. Fixed some bugs in vesa driver (Egbert Eich).
+ 187. Fixed memleaks in parser code as well as several referenced freed
+ pointers which pollute output of memory debugger and obsucre debugging
+ (Egbert Eich).
+ 186. Fixed ChangeWindowAttributes() in cfb8_16 code (Egbert Eich).
+ 185. Moved Linux specific typedef from shared/xf86AXP.h to linux-specific
+ os-level code (Egbert Eich).
+ 184. Added option to int10 softbooter to POST even primary device.
+ 183. Fixed memory leak in linux int10 code (Egbert Eich).
+ 182. Modified vm86 trap code not to fail on a #LOCK prefix byte
+ (Egbert Eich).
+ 181. Fixed memory leak in posix_tty.c (Egbert Eich).
+ 180. Added support to generic driver to POST even primary devices
+ (Egbert Eich).
+ 179. Added support for more AXP chipsets that require sparse addressing
+ to bsd os level (Egbert Eich).
+ 178. Added missing symbols to C&T driver (Egbert Eich).
+ 177. Fixed problems with Xv code in C&T driver (Egbert Eich).
+ 176. Fixed a vertical and horizontal offsets on HiQV chips due to
+ non-"standard" handling of H/VBlankEnd registers (Egbert Eich).
+ 175. Removed code that sets a chipset into graphics mode when
+ saving/restoring fonts in standard vga code. This causes problems
+ on some trident chipsets (Egbert Eich). [EXPERIMENTAL!]
+ 174. Moved KGA code that handles the H/VBlankEnd code that overscans remain
+ invisible to separate functions. This way drivers have better control
+ over these registers.
+ 173. TGA driver fixes (Jay Estabrook).
+ 172. Moved option processing to allow VGAClock option to be processed
+ (Egbert Eich).
+ 171. Added option to swap heads on a matrox G400 dual head (Stefan Dirsch).
+ 170. Added handling of broken planemask support on different models of
+ matrox G100 cards (Egbert Eich).
+ 169. Fixed minor memory leak in ati driver (Egbert Eich).
+ 168. Fixed resource registration in TDFX driver (Egbert Eich).
+ 167. Set new modelines for Trident LCD modes (Egbert Eich).
+ 166. Fixed handling of PreEnd Control register on Trident (Egbert Eich).
+ 165. Fixed problem with Trident Blade Mono8x8Patterns (Egbert Eich).
+ 164. Fixed clock division for CyberBlade E4 (Egbert Eich).
+ 163. Removed last static symbols from Tseng driver (Egbert Eich).
+ 162. Fixed handling of ICS5341 RAMDAC under 24bpp (Egbert Eich).
+ 161. Fixed resource registration in rendition driver (Egbert Eich).
+ 160. Attempt to fix various other issues on rendition - driver remains
+ to be broken though (Egbert Eich)!
+ 159. Fixed false linear size for NeoMagic 2380 (Egbert Eich).
+ 158. Modified calulation of aperture size in NeoMagic driver to use the
+ available video memory instead of the map size (Egbert Eich).
+ 157. Added a delay to prevent rare cases of lockups when starting
+ X on NeoMagic 2160 (Miles Lane).
+ 156. Added DGA to Cirrus driver (Egbert Eich).
+ 155. Missing symbols added to Cirrus driver (Egbert Eich).
+ 154. Fixed acceleration on Alpine (Cirrus) driver. PIO and MMIO versions of
+ the accelerator driver now support the same functionality (Egbert Eich).
+ 153. Removed unneededed call to xfree() in ddc code (Egbert Eich).
+ 152. -
+ 151. Siliconmotion driver updates, including:
+ - Color change/flash at 8bpp when switch back to desktop in rotation
+ mode.
+ - System hangs when enabling rotation in 24-bpp.
+ - Overlay disappear in the virtual desktop when move the window.
+ - Mouse pointer doesn't work properly in panning modes under rotation.
+ - Garbage appears on desktop when click the Basic/Metal for the Theme
+ Selector.
+ - Added ZoomOnLCD option.
+ - Desktop changes color when panning in 24-bpp mode.
+ - CRT is off after exit X on DSTN 800x600.
+ - Screen broken occurs in X when enable Rotation on DSTN 800x600.
+ (#4463, Frido Garritsen).
+ 150. Include <time.h> in Xos.h to get struct tm (based on #4464, Mike Harris,
+ and H.J. Lu).
+ 149. Add 1400x1050 60Hz and 75Hz to the default built-in modes (#4462,
+ Tim Roberts).
+ 148. Create the default modes source file from the mode definitions on
+ systems that have perl (David Dawes).
+ 147. Alias memset and memcpy to xf86memset and xf86memcpy in the loader,
+ which should catch implicit compiler-generated calls to these functions
+ (David Dawes).
+ 146. Fix NV, Glint, ati and mga drivers for Alpha EV56 machines
+ (Jay Estabrook).
+ 145. Work around compiler-generated call to memcpy in the sis driver
+ (David Dawes).
+ 144. Fix the neomagic driver so that it saves/restores the palette (#4452,
+ Ken Hornstein).
+ 143. Fix a palette saving bug in the vgahw module (#4452, Ken Hornstein).
+ 142. Fix a typo in Xfbdev.man (#4446, Juliusz Chroboczek).
+ 141. Major updates to the savage driver, including:
+ - DDC support
+ - I2C support
+ - XVideo YUV overlay support for Savage/MX and Savage/IX
+ - DGA support
+ - yanks Ani Joshi's depth/bitsPerPixel patch for searching the BIOS
+ - fixes interactions with frame buffer and SVGATextMode consoles;
+ VT switching now seems quite reliable for almost everyone
+ - yanks unused options
+ - adds new options for hacks to deal with the status register hangs
+ - adds one special case memory configuration for Savage 4
+ - adds support for doublescan modes (320x240 works)
+ - adds LCD panel detection
+ - fixes a panning bug at depth 24 (panning must be to even pixels)
+ - adds a workaround for bugs in the latest ProSavage BIOSes
+ (#4445, 4448, Tim Roberts).
+ 140. Make 'X -configure' use the long monitor name when present in the
+ DDC info (#4444, Andrew C. Aitchison).
+ 139. Make glxinfo respect $DISPLAY (#4443, Meelis Roos).
+ 138. Fix TrueType font problems in 4.0.2 (#4439, Juliusz Chroboczek).
+ 137. Document the "DisplaySize" keyword in the XF86Config man page (#4438,
+ Andrew C. Aitchison).
+ 136. Update the i810 driver to set the UV vertical phase for the 4:2:0
+ planar formats to account for the spatial relationship between the
+ chroma and luma samples (#4436, Jonathan Bian).
+ 135. Updates for Cygwin support (#4433, Suhaib M. Siddiqi).
+ 134. Fix a bug in the fonts.sgml doc (#4432, Juliusz Chroboczek).
+ 133. Fix the xdpyinfo so that it will build when the XKB extension isn't
+ defined (#4422, Jim Gettys).
+ 132. Fix the xdm greeter so that it will build when the XKB extension isn't
+ defined (#4421, Jim Gettys).
+ 131. Only build setxkbmap when building the XKB lib support (based on #4420,
+ Jim Gettys).
+ 130. Improve the mga driver messages when the HAL module isn't available
+ (#4451, David Woodhouse).
+ 129. Add G450 support to the mga driver (#4416, Luugi Marsan (Matrox),
+ 4449, David Woodhouse).
+ 128. Mga driver updates, including HAL cleanups, add a Crtc2Ram option,
+ and merge with Matrox beta4 source (#4415, Antii Tapaninen, #4423,
+ Simon Hosie).
+ 127. Fix a rounding problem in the wacom driver that was causing some
+ position instability (#4417, Hannes Eriksson).
+ 126. Change Freetype2 compilation to pacify makedepend (Marc La France).
+ 125. Added changes to il (Hebrew) xkb keyboard map (#4459, Tzafrir Cohen).
+ Added new by (Belarusian) xkb keyboard map (#4460, Alexander Mikhailian).
+ Small additions to fixes A.272 to allow autorepeat control of MouseKeys
+ also in 'non-accelerated mode' (#4461, Ivan Pascal).
+ 124. Add ATI Rage 128 PD support (#4455, ISHIKAWA Mutsumi).
+ 123. Make modeline2c.pl script case-insensitive (#4453, Mike Harris).
+ 122. Change ATI driver to detect panel dimensions of non-PC systems using an
+ LT or LT Pro (Marc La France).
+ 121. Fix misdetection of sparse I/O PCI bases and handling of unassigned PCI
+ bases in ATI driver (Marc La France).
+ 120. Extend libc wrapper's emulation of gettimeofday() and add emulation of PC
+ and PC98 interval timers to int10 (Marc La France).
+ 119. An attempt at fixing the handling of unassigned PCI resources by
+ improving detection of them and forcing them to be relocated
+ (Marc La France).
+ 118. Make lndir ignore finder data files on Mac OS X (Matthieu Herrb).
+ 117. -
+ 116. -
+ 115. Undo s3virge changes in 4.0.2 for Xv support on ViRGE chipsets since
+ they caused problems with plain ViRGE cards. Xv is still supported
+ for the ViRGE DX (#4414, 4430, Kevin Brosius).
+ 114. Siliconmotion driver fixes:
+ - 24bpp corruption
+ - mouse cursor still showing after X-server shutdown
+ (#4413, Frido Garritsen).
+ 113. Change the Thai charset and locale description to a form agreed to
+ by some Thai developers (#4412, Chanop Silpa-Anan).
+ 112. [SECURITY] Fix temp files vulnerabilites in xman on systems with
+ mkstemp(). (Matthieu Herrb).
+ 111. Major improvement to the Xmaster UI on Mac OS X. (#4447, XonX team).
+ 110. 8 bit DAC support for the NVIDIA Riva-128 (Mark Vojkovich).
+ 109. Fix panning on Permedia3 (Alan Hourihane).
+ 108. Enable wsmouse support on OpenBSD/i386 (Matthieu Herrb).
+ 107. Xdarwin bug fixes and updates (#4440-4442, Torrey T. Lyons).
+ 106. ATI driver Sparc compile fix (David S. Miller).
+ 105. Implement BlockFills at 32bpp in the Permedia3 driver (Alan Hourihane).
+ 104. Ensure PCI retry is off for Permedia3, and fix an over by 1 error on
+ FIFO usage (Alan Hourihane).
+ 103. Prevent glint driver from Seg faulting if mode pool is empty
+ (Alan Hourihane).
+ 102. Add FIFOSize to glint driver for overriding of the FIFO depending on
+ the target chip being used (Alan Hourihane).
+ 101. Major updates to the GLINT driver.
+ - Add Dual-Headed Appian Jeronimo 2000 support (dual PM3's), it now
+ shares heads as per MGA driver for G4xx dual head boards.
+ - Faster Permedia3 WriteBitmap/WritePixmap accelerator functions.
+ - Fix Scanline acceleration routines when MAX FIFO is reached.
+ - Improved Gamma support.
+ - Upload cursor and cursor colours for pm2v/pm3 during vertical retrace,
+ which fixes r/b inversion and loss of video problems.
+ - Fix pm2v/pm3 text restoration problems.
+ - Re-arranged structure to accomodate multi-chips per screen.
+ - Removed dualmx files and incorporated changes into standalone versions
+ - Allow -configure to only configure VGA based Glint chips, works
+ around multichip boards (for now).
+ (Alan Hourihane).
+ 100. Add XaaNoWriteBitmap and XaaNoWritePixmap options to XAA (Alan Hourihane).
+ 99. Improve determination of primary adapter (Marc La France).
+ 98. Fix PPC xf86sym.c compile problems (Marc La France).
+ 97. Fix int10 option handling for drivers that call xf86CollectOptions()
+ before calling int10 (Marc La France).
+ 96. Properly detect unassigned MMIO address in ATI driver (Marc La France).
+ 95. Fix default compilation on Sparc/Solaris (Marc La France).
+ 94. Fix typo in Linux/Arm configuration (Marc La France).
+ 93. By default, don't build libGLU on libc5 systems (Marc La France).
+ 92. Fix HW cursor colors for pm2v/pm3 in the glint driver (Alan Hourihane).
+ 91. Rework the memory detection code for Permedia3, now correctly detects
+ boards which aren't 32MB (Alan Hourihane).
+ 90. Write ScanlineCPUToScreen, ScanlineImageWrite functions for Permedia3
+ which write directly to the FIFO, and remove obsolete functions
+ (Alan Hourihane).
+ 89. Fix ordering of writes in pm2v/pm3 ramdac functions in the glint driver,
+ thus fixing the R/B inversion problems (Jay Estabrook).
+ 88. Set the version strings in man pages dynamically (David Dawes).
+ 87. Remove the XF86_VERSION string from xf86Version.h, leaving just
+ the numerical values. All the version information is now derived
+ from that single set of values (David Dawes).
+ 86. [SECURITY] Fix temp vulnerabilities in Xaw/MultiSrc.c using the technique
+ in patch #4279 (Branden Robinson). Fix temp file vulnerability in
+ gccmakedep based on report from Alan Cox. Fix temp file vulnerability
+ in Imake.rules, InstallManPageAliases (Matthieu Herrb).
+ 85. Support vertical sub-pixel glyph rasterization in Xft
+ (Keith Packard)
+ 84. Allow xf86ClaimPciSlot to be called with a NULL GDevPtr, as it was
+ previously (Alan Hourihane).
+ 83. Fix clean rule in DRM build (Philip Willoghby).
+ 82. If MouseKeys is switched on, then the mousekeys autorepeat. (fixes
+ #272, Stephen Montgomery-Smith)
+ 81. Ensure Video is unavailable when no acceleration available in the
+ trident driver (Alan Hourihane).
+ 80. Implement a distclean make target (Marc La France).
+ NOTE: To correctly install this change, either `make Everything` or
+ `rm xmakefile; make World`.
+ 79. Preprocess all man pages to make sure that the references to pages
+ in sections that are platform-dependent are correct. Also fixed some
+ misc formatting problems found while doing that (David Dawes).
+ 78. Ensure client side version checking in 3D drivers for Rage128 and
+ Radeon chipsets (Alan Hourihane).
+ 77. Nv driver update to fix the cursor for double scan modes, and to
+ improve double scan mode handling in general (#4408, Csaba Halasz,
+ Jarno Paananen).
+ 76. Fix a twm segfault if it gets events for buttons > 5 (#4407, 4425,
+ Nathan Hand).
+ 75. Update the module subdirectory search list to include "multimedia/"
+ (#4405, Vladimir Dergachev).
+ 74. Small R6.5.1 merge update in Xlib (based on #4403, Bruno Haible).
+ 73. Updates to the xprop utility, including:
+ - Move to ANSI C, use const where possible.
+ - Print WM_NAME and WM_ICON_NAME properties in the locale encoding.
+ - Allow multiple "-remove" commands on the same command line.
+ - Better error message when "-remove" is applied to a font.
+ - New option "-set" that permits the changing of individual window
+ properties.
+ (#4402, Bruno Haible).
+ 72. Remove schumacher-clean compatibility aliases, since the fonts are
+ really ASCII and not iso8859-1 (#4401, Bruno Haible).
+ 71. Allow drivers to provide their own substitute for the xf86I2CWriteRead
+ function (#4399, Vladimir Dergachev).
+ 70. Cirrus driver updates, including:
+ - Add a call to fbPictureInit() in the Laguna driver.
+ - Fix warning (missing a symbol from VBE) when starting the Alpine
+ driver.
+ - Fix MMIO acceleration for the CL-GD5480
+ (#4395, Itai Nahshon).
+ 69. Fix Neomagic 2200 screen corruption (Egbert Eich).
+ 68. Disable RENDER extension support in the ATI(misc) driver when mibank
+ and/or shadowfb is used (Marc La France).
+ 67. Remove cfb & friends from the ATI driver (Marc La France).
+ 66. Some additional ATI PCI IDs (Marc La France).
+ 65. Make compilation of drivers produce the same object whether or not
+ DPMS and DGA extensions are being built. Partial changes to do the same
+ for RENDER (Marc La France).
+ 64. Ensure `make depend` goes through the same set of subdirectories as
+ `make all` does. Allows MakefileAdditions to contain depend rule(s)
+ (Marc La France).
+ 63. Move $(EXTRA_DEFINES) to the end of ALLDEFINES. Ditto for
+ $(CXXEXTRA_DEFINES) and CXXDEFINES. Allows easier overrides at the
+ subdirectory level (Marc La France).
+ 62. Add a pre-clean phase to `make World` if xc/xmakefile already exists
+ (Marc La France).
+ 61. Import X.Org's X11R6.5.1 (David Dawes)
+ 60. Change identification of Trident 8400(CyberBlade/i7) so that it is not
+ a Cyber chipset (integrated Desktop version) (Alan Hourihane).
+ 59. Use the wsmouse protocol in XFree86 -configure if wsmouse is available
+ (Matthieu Herrb, lha at stacken.kth.se).
+ 58. Sync Xdarwin with XonX version (#4428 Torrey T. Lyons):
+ - add a working WarpCursor
+ - add 15 bit pixel depth to the Quartz mode.
+ 57. New version of Xmaster, a Mac OS X application that controls the
+ X server (#4427, Torrey T. Lyons, Andreas Monitzer).
+ 56. Add external CRT support for the Rage 128 Mobility (Kevin Martin
+ and ATI).
+ 55. Radeon DRI fixes (VA Linux Systems).
+ - Re-enable freeing resources when the screen is destroyed (Kevin
+ Martin)
+ - Use screen-relative instead of window-relative coordiantes to
+ calculate the tiled depth buffer offset address (Kevin Martin)
+ - Fix texture upload at offset 0 bug. Quake 2 engine games use
+ TexSubImage to update lightmaps and the like, and we were
+ uploading the updates before the image had space in the texture
+ heap allocated to it. (Gareth Hughes)
+ - Add XF86Config file option to enable depth buffer moves (they
+ are disabled by default since they are excuciatingly slow)
+ (Kevin Martin)
+ - Enable bus mastering in PCI config space for those systems that
+ do not automatically have it enabled (Kevin Martin)
+ - Remove AGP_CNTL register programming -- it was a holdover from
+ the Rage 128 driver and is not needed on the Radeon (Kevin
+ Martin)
+ - Fix offscreen memory allocation calculation for textures (Kevin
+ Martin)
+ 54. Allow libGLU to be built (Craig Dunwoody, SGI, David Dawes,
+ Alan Hourihane).
+ 53. Import the GLU parts of ogl-sample.
+ 52. Add an imake control for determining when xload should be installed
+ set-gid (David Dawes).
+ 51. Add some imake controls for installing Xkb and app-defaults files
+ in the traditional location rather than under /etc/X11 (Red Hat does
+ that) (David Dawes).
+ 50. Add compressed man page functionality to the rules in Imake.rules,
+ so it should be usable on most platforms (David Dawes).
+ 49. Make acceleration work on the Trident Cyber9388 (Alan Hourihane).
+ 48. - Various small changes to accomodate Mac OS X support and fix a
+ problem people were having with uninitialized globals in X
+ libraries,
+ - Allow XFree86 to run on Mac OS X as a full screen client of
+ CoreGraphics,
+ - Add a Mac OS X application that controls the X server and feeds it
+ events when running on Mac OS X. Currently must be built by
+ ProjectBuilder (#4409, #4410, #4411, Torrey T. Lyons).
+ 47. Fix Mach64 Mono 8x8 Pattern acceleration (Marc La France).
+ 46. Experiment with setting the server's "vendor release" value from
+ the information in xf86Version.h, and modify xdpyinfo to show the
+ server version in an easily readable format (David Dawes).
+ 45. Fix 1bpp colour map in vgaHW (Marc La France).
+ 44. More IA64 loader fixes and make xf86sym.c compile again
+ (Michael Madore, Marc La France).
+ 43. Add missing symbols in vesa driver (Marc La France).
+ 42. Fix multihead pointer problem on Rage 128 (Mark Vojkovich).
+ 41. Resync with DRI CVS trunk (Kevin Martin, VA Linux Systems)
+ - Add Radeon 3D driver (Kevin Martin and Gareth Hughes)
+ - Improve Rage 128 3D driver support (Gareth Hughes)
+ - Add fast AGP read/drawpixels support in MGA driver (Keith Whitwell)
+ - Update DRI docs (Kevin Martin, Brian Paul)
+ - Fix various bugs (Keith Whitwell, Brian Paul, Kevin Martin)
+ 40. Rename fsinfo to xfsinfo to avoid a name clash with the fsinfo utility
+ in the Berkeley automounter amd (Matthieu Herrb).
+ 39. Invert NO_COMPILER_H_EXTRAS to prevent unintentional references to inx()/
+ outx() on the likes of SunOS (Marc La France).
+ 38. Change the os-support layer to only claim a bare minimum of I/O resources
+ rather than a larger estimate (Marc La France).
+ 37. Loader work: Fix handling of shared GOTs on IA-64 and Alpha's, and of
+ PLT and OPD entries on IA-64; Cleanup debug messages and #if testing
+ (Marc La France).
+ 36. Extensive int10 rework to address lockups, spontaneous reboots and tight
+ CPU loops on various architectures (Marc La France):
+ - Use intialised BIOS to softboot primary adapters on non-PC's;
+ - Fix endianness problems;
+ - Move stack into its own page to prevent overwritting interrupt vectors;
+ - Prevent (with a message) int10 from interfering with mainboard devices
+ (i.e. RTC, keyboard, speaker, chipset, etc.);
+ - Flesh out int 0x42 emulation on non-PC's;
+ - Emulate BIOS data area on non-PC's;
+ 35. Add missing symbols in i810 and sis drivers (Marc La France).
+ 34. Optionally disable, at compile time, loader bug workarounds in ATI driver
+ (Marc La France).
+ 33. Prevent the Rage 128 and Radeon drivers from initialising an adapter more
+ than once (Marc La France).
+ 32. Move support for >64kB BIOS'es from int10 into the os-support/bus layer
+ (Marc La France).
+ 31. When retrieving PCI BIOS'es, only use another PCI base when a previous
+ retrieval attempt fails (Marc La France).
+ 30. Temporary kludge to not consider any adapter as primary if more than one
+ candidate can be found (Marc La France).
+ 29. Make deleted mode messages less fearsome (Marc La France).
+ 28. Fix -configure to retrieve the correct set of options for ATI, C&T,
+ Cirrus and NeoMagic adapters (Marc La France).
+ 27. When removing PCI resource overlaps, always consider resources whose size
+ can be accurately determined, whether active or not (Marc La France).
+ 26. Real 4:2:0 YUV support for the Rage 128 (Mark Vojkovich).
+ 25. Xinerama support for Render extension (Keith Packard).
+ 24. Make some changes to the clock selection for trident driver
+ (Alan Hourihane).
+ 23. Switch savage driver to fb (+Render), correct maxHValue (Keith Packard).
+ 22. Add font property caching in Xft (Keith Packard).
+ 21. Xterm patch #150 (Thomas Dickey).
+ 20. Fix 24/8 Overlay support on Permedia2v and Permedia3 chipsets
+ (Alan Hourihane).
+ 19. Add CyberStretch option to the trident driver for Cyber chipsets that
+ allows Graphics modes to stretch to the full display (Alan Hourihane).
+ 18. Xterm patch #149 (#4351, Thomas Dickey).
+ 17. Fix Y offsets passed to pixmap cache when DRI disabled in R128 driver
+ (Alan Hourihane).
+ 16. Add BlockFills to Permedia3 (Alan Hourihane).
+ 15. Fix pixmap cache when more than 16MB of memory on Permedia 3
+ (Alan Hourihane).
+ 14. Fix colourmap problems at depth15/16 on Permedia3 (Alan Hourihane).
+ 13. Bump xc/programs/Xserver/GL/dri (libdri.a) version to 3.1.0 to
+ correspond with the DRI backbuffer rewrite, and modify drivers accordingly
+ (Alan Hourihane).
+ 12. Enable ImageWrites on Rage128 and Radeon (Alan Hourihane).
+ 11. Add DRIMoveBuffersHelper function to prevent code duplication in
+ the drivers (Mark Vojkovich).
+ 10. Bug fixes for endianness problems in Permedia3 driver
+ (#4404, Sven Luther).
+ 9. Add Appian Jeronimo 4x8Mb (PM2v) support to the glint driver
+ (Alan Hourihane).
+ 8. Add render support to i810 driver (Keith Packard with testing
+ by Christien Bunting)
+ 7. Switch misc (non-radeon, non-r128) ATI driver to fb (Keith Packard).
+ 6. 3DFX driver changes (Mark Vojkovich).
+ - fix some DGA issues.
+ - 2D and 3D now share offscreen memory (much faster 2D now).
+ - rewrite Xv support to use the video overlay.
+ - add new Options "VideoKey" and "ShowCache".
+ 5. Change xterm from simple face name to full Xft font name so
+ that options can be provide (like minspace) (Keith Packard)
+ 4. Add UTF-8 support to Xft (Keith Packard)
+ 3. Add font/face sharing and a minumum vertical space option
+ to Xft (Keith Packard)
+ 2. Fix 64 bit DGA bug (Mark Vojkovich).
+ 1. Rewrite DRI back buffer handling to minimize the impact on 2D
+ performance (Mark Vojkovich).
+ 0. Fix incorrect driverName fields in the cyrix, i810 and sis drivers.
+ This was causing 'XFree86 -configure' to get the driver name wrong
+ (David Dawes).
+
+XFree86 4.0.2 (18 December 2000)
+1211. Fix a problem introduced recently when using the "ps/2" protocol for
+ mice on FreeBSD (David Dawes).
+1210. Disable DRI for tdfx when there's insufficient memory for textures
+ (Alan Hourihane).
+1209. Rename the R6.4 INSTALL and RELNOTES docs at the top level of the source
+ tree, and add a copy of the XFree86 RELNOTES.
+1208. Add Solaris 8/x86 key mappings for some more jp106 keys.
+1207. Fix wacom man page to match the driver (based on #4398, Akio Morita).
+1206. Install the iso8859-13 encoding file (#4397, Nerijus Baliunas).
+1205. Misc doc-related updates.
+
+XFree86 4.0.1Zc (15 December 2000)
+1204. Fix an Xlib memory overrun when the Xutf8TextPropertyToTextList function
+ is used in a unibyte locale (#4394, Bruno Haible).
+1203. Fix the yen/backslash keys for Solaris 8/x86 with Japanese 106 keyboards
+ (based on #4393, Takaaki Nomura).
+1202. Fix type mismatches in the r128 DRI driver on Alpha platforms (#4392,
+ Gareth Hughes).
+1201. Fix build on Japanized version of Solaris 8 for x86 (#4390,
+ Takaaki Nomura).
+1200. Remove some old XtOffset magic for the arm that affects building
+ with gcc (#4388, Keith Packard).
+1199. Release notes updates (David Dawes, Egbert Eich, Mark Vojkovich,
+ Robin Cutshaw, Keith Packard, Alan Hourihane, #4391, Kevin Brosius).
+1198. Revert the tdfx driver to something functionally close to the
+ last known working version (4.0.1g) (David Dawes).
+
+XFree86 4.0.1Zb (14 December 2000)
+1197. New fonts document (#4386, 4387, Juliusz Chroboczek).
+1196. Status doc update for Trident (Alan Hourihane).
+1195. Update the R6.4 INSTALL and RELNOTES docs to include references at
+ the top to the XFree86-specific docs (David Dawes).
+1194. Make it possible to install platform-specific man pages with most
+ ix86 builds (David Dawes).
+1193. Add a short man page for the newport driver, update it's sample config
+ file, and have the driver check user-supplied parameters (#4385,
+ Guido Guenther).
+1192. Missing part of fix for FreeBSD sysmouse support (#4317, from FreeBSD
+ ports collection).
+1191. Trident driver bug fixes (Alan Hourihane).
+1190. Make it possible to install hardcopy specs docs that we can't generate
+ from source (David Dawes).
+1189. Set the HasPerl default correctly for LynxOS (#4384, Thomas Mueller).
+1188. Lots of Status doc updates (#4383, Branden Robinson).
+1187. Update some DebianMaintainer defaults in linux.cf (#4380,
+ Branden Robinson).
+1186. Fix a segfault in the font path verification code in xfs (#4379,
+ Charles C. Fu).
+1185. Rework and document the various MatroxHal imake parameters, and
+ build in support for the mga_hal module by default for loadable server
+ builds (David Dawes).
+1184. Fix sis driver corrupt display with more than 8MB of video memory (#4378,
+ Can-Ru Yeou).
+1183. Fix xf86cfg build problem on systems that don't come with snprintf
+ and/or regex (based on #4361, Thomas Mueller).
+1182. Fix siliconmotion driver screen restoration when a graphics vesafb mode
+ is selected during boot up (#4377, Frido Garritsen).
+1181. Install and RELNOTES updates for Darwin (#4375, 4376, Torrey T. Lyons).
+1180. s3virge patch to get Xft/Xrender working (#4374, Kevin Brosius).
+1179. Improve aperture driver related error messages on OpenBSD
+ (Matthieu Herrb).
+1178. Workaround for IA-64 loader bug (Marc La France).
+1177. Fix recognition of valid depth/fbbpp combinations in ATI driver
+ (Marc La France).
+1176. Fix 1bpp in ATI driver (Marc La France).
+1175. Fix ATI DPMS support on panels by mimicking BIOS behaviour more closely
+ (Marc La France).
+
+XFree86 4.0.1Za (12 December 2000)
+1174. Set defaults for Mesa's x86 CPU-specific asm options, and make it
+ possible to build with MMX disabled for systems with older assemblers
+ (David Dawes).
+1173. Fix some R128 DRI bugs:
+ - Fix depth span functions (was causing rendering errors for windows
+ not at (0,0)).
+ - Don't use 32-bit depth buffers since they're not supported by Mesa.
+ - Use subpixel offsets to fix coordinate rounding errors.
+ (#4373, Gareth Hughes).
+1172. Reinstate the AllTarget for the rule to make html man pages
+ (David Dawes).
+1171. Build all modules on Linux/mips, fixing Xnest build (#4372,
+ Guido Guenther).
+1170. Update Permedia 3 README, Cards file, and glint section in the Status
+ doc (#4371, Sven Luther).
+1169. Fix depth passed to the BIOS in the savage driver (affects depth 15)
+ (#4369, Ani Joshi).
+1168. Update fbdev man page (#4368, Michel Daenzer).
+1167. Fix a problem with 32-bit depth buffers when using indirect rendering,
+ by not advertising them in the mga driver (#4367, Brian Paul).
+1166. Update man page version strings, and convert some server/XFree86 man
+ pages to cpp-processed files to make the references to pages in
+ system-dependent sections correct (David Dawes).
+1165. Update the release notes for the i18n and Unicode support (#4366,
+ Bruno Haible).
+1164. Document most of the environment variables that can influence libX11
+ and libXt in the 'X' man page (#4365, Bruno Haible).
+1163. Update the ICCCM spec document to relfect the selection targets currently
+ used in XFree86 (#4364, Bruno Haible).
+1162. Update the CTEXT spec document to reflect part of the current
+ practice in XFree86 (#4363, Bruno Haible).
+1161. Augment SpecsDocDirs to reflect additional docs that have XFree86 changes
+ (#4362, Bruno Haible).
+1160. Fix Xv library references in the xvinfo Imakefile (#4361,
+ Thomas Mueller).
+1159. Fix a signed/unsigned error in the calculation of 16-bit displacements
+ in x86emu (#4359, Tim Roberts).
+1158. Fix "noaccel" option in the tdfx driver when building without DRI
+ (David Dawes).
+1157. Add Darwin documentation (Torrey T. Lyons).
+1156. Add Darwin bindist files and update Xinstall.sh (Matthieu Herrb).
+1155. Update bindist files for NetBSD 1.5 ELF (Matthieu Herrb).
+1154. Add DGA support to I128 driver (Robin Cutshaw).
+
+XFree86 4.0.1Z (8 December 2000)
+1153. Flesh out the wacom man page (#4358, Frederic Lepied).
+1152. Fix incorrect documentation for xf86UnMapVidMem() in README.OS-lib
+ (#4357, Guido Guenther).
+1151. Update the newport driver to use the map/unmap functions provided by
+ the os-support layer (#4356, Guido Guenther).
+1150. Bugfix to xf86UDelay() (Egbert Eich).
+1149. Added a sanity check to pciConvertRange2Host() (Egbert Eich).
+1148. Added more log messages to Linux APM code (Egbert Eich).
+1147. Added a sanity check to xf86ConfigPciEntity() (Egbert Eich).
+1146. Resync with DRI CVS trunk (tdfx driver updates) (Daryll Strauss).
+1145. Add -textmode mode option for xf86cfg, to run a ncurses interface, and
+ add the "expert" interface, to provide more control over the config file.
+ Updates to vesa driver, removed debug messages and fixed problem with
+ console restoration in some S3 cards.
+1144. Merge tdfx 3D driver code (VA Linux).
+1143. Add support PPC support on Rage 128 and disable Int10 for PPC on
+ Rage 128 (until the bug in PPC Int10 support is fixed) (Kevin Martin).
+1142. Install an alternative fonts.alias file that references the UCS-encoded
+ fonts on systems without Perl (David Dawes).
+1141. Add CyberShadow Option back into Trident driver (Alan Hourihane).
+1140. Resync with DRI CVS trunk, including:
+ - SSE support updates
+ - DRI-specific full screen mode
+ - Reduce the minimum space required for 3D on the Rage 128
+ (VA Linux).
+1139. Fix a memory leak in the UTF-8 <--> CompoundText converter (#4354,
+ Bruno Haible).
+1138. Add support for the selection target UTF8_STRING to libXaw (#4353,
+ Bruno Haible).
+1137. Make Xlib's CompoundText converter ISO-2022 compliant (#4352,
+ Bruno Haible).
+1136. Fix 2 wacom driver bugs (core dump on VT switching, and USB support)
+ (#4350, Frederic Lepied).
+1135. Update the ClearlyU fonts to 1.8b. Changes include:
+ - Cleaned up the Arabic glyphs so they don't look quite so juvenile.
+ - Squared up the Hebrew glyphs so they match the style of the other
+ scripts better.
+ - Added many of the basic Hangul glyphs.
+ - Brought the Cyrillic block in line with Unicode 3.0 and moved the
+ extra glyphs into the PUA font in the 0xE4XX range.
+ (#4349, Mark Leisher).
+1134. Update the savage driver to all I/O via MMIO, and add DPMS support
+ (4347, Ani Joshi).
+1133. Change xfs to drop privs after daemonising so that the pid file can
+ be written (#4346, Frederic Lepied).
+1132. Miscellaneous fixups to the trident driver (Alan Hourihane).
+1131. Add Xv support to the trident driver. Works for Blade and Image series
+ chips, but zooming currently doesn't work on Image series.
+ (Alan Hourihane).
+1130. Don't perform a software reset on the Graphics Engine for Trident
+ Blade3D's and CyberBlade's (Alan Hourihane).
+1129. Fix typo in int10 for IA-64's (Marc La France).
+1128. Make PCI bridge information in the log more accurate (Marc La France).
+1127. Update ATI docs (Marc La France).
+1126. Another getValidBIOSBase() fix (Marc La France).
+1125. If the loader server dies from a signal during initialisation, print a
+ list of undefined symbols (Marc La France).
+1124. Move Alpha MMIO definitions from xf86_OSproc.h to compiler.h
+ (Marc La France).
+1123. Change update.docs rule for shadow tree friendliness (Marc La France).
+1122. Don't reference libc wrapper names directly in the newport driver
+ (David Dawes).
+1121. Fix the fr_CH xkb Macintosh symbols file (#4345, Olaf Hering).
+1120. Revert the Estonian_Estonia.1257 change in patch #4297 because
+ windows-1257 is a closer match to iso8859-13 than iso8859-15.
+ Also add entries for the et_EE.ISO8859-1 locale (while not perfect for
+ Estonian, it is commonly used) (#4344, Ville Hallik).
+1119. Change name of long Unicode keysyms from 6 to 8 hex digits, which
+ matches conventional usage better (#4343, Ivan Pascal).
+1118. Make XF86VidModeSetViewPort() actually set the viewport to the
+ X and Y coordinates specified as opposed to always setting it to (0,0)
+ (#4342, Joe Moss).
+1117. Work around some build problems on SVR4.0 (#4341, Satoshi Kimura).
+1116. Compose characters for the Macedonian UTF-8 locale (#4338,
+ Damjan Georgievski).
+1115. Fix build problems with the wacom driver on Linux 2.4 when building
+ a static server (Frederic Lepied, David Dawes).
+1114. Changed name of server binary to call by xf86cfg back to "XFree86
+ (Egbert Eich).
+1113. Modified handling of memory alloctaion in TDFX driver (Egbert Eich).
+1112. Attempt to fix the 'UseModes' directive in the Monitor section
+ (Egbert Eich).
+1111. Added debugging output for BIOS base address search (Egbert Eich).
+1110. Changed neomagic driver to treat disable stretching for each mode
+ individually (Egbert Eich).
+1109. Removed '-traditional' from cpp rule for makedpend. Required for
+ new glibc header files (Ruediger Oertel).
+1107. Fix to make SuperProbe build again on ia64 (Andreas Schwab).
+1107. Attempt to fix int10 (Egbert Eich).
+1106. Modified blitter busy test to use the MMIO mapped registers on chips
+ > CT69000 (Egbert Eich).
+1105. Attempt to improve dga support in C&T driver (Egbert Eich).
+1104. Moved ppc_flush_icache to compiler.h - hope this fixes build problems
+ (Egert Eich).
+1103. changed cirrus driver to us fb instead of cfb (Egbert Eich).
+1102. Modularized HALlib for mga driver (Egbert Eich).
+1101. Added DGA support to tseng driver (Rainer Keller).
+1100. Added "framebuffer" bus type allowing resource control to take place
+ outside of the server (Egbert Eich).
+1099. Added turkish keyboard layout (Togan Muftuoglu).
+1098. Fix Cyber9397/DVD acceleration problem (Alan Hourihane).
+1097. Resync with the DRI CVS trunk.
+1096. Fix alot of Rage 128 Xv bugs (Mark Vojkovich).
+1095. Fix XKB symbols for Swedish Macintosh keyboards (#4337, Olaf Hering).
+1094. Disable DRI on PPC (#4337, Olaf Hering).
+1093. Suppress xf86ReadBIOS debugging messages for BSD (#4336, Takaaki Nomura).
+1092. Silicon Motion driver update, includes bug fixes (#4335,
+ Frido Garritsen, Silicon Motion, Inc.).
+1091. Updates to the dumpkeymap utility and its documentation (#4323,
+ Eric Sunshine).
+1090. Enable 3D support for Rage 128 Mobility chips (Kevin Martin).
+1089. Add clip rectangles support to Render extension, Xrender and Xft.
+ Make Xrender and Xft usable from c++.
+ Fix a bunch of compiler warnings in Render extension code
+ (Keith Packard)
+
+XFree86 4.0.1h (4 December 2000)
+1088. Fix key mapping for the '\' key on GB keyboards in Solaris 8.
+1087. Status doc updates for Neomagic an NVIDIA (#4334, Andrew C. Aitchison,
+ Mark Vojkovich).
+1086. Updated Rage 128 DRI support from the DRI CVS (Gareth Hughes, VA Linux).
+1085. -
+1084. Bump the minor revisions of libXmu (UTF8_STRING) and libX11
+ (Xutf8LookupString).
+1083. Fixes for all known bugs in the CompoundText parser and generator,
+ including:
+ * While adding a charset:
+ - Adding a charset with two different escape sequences (e.g.
+ ISO-8859-14) led to broken behaviour of the converter. Moreover
+ the second added would have priority over the first added.
+ - If an invalid escape sequence was detected by _XlcParseCharSet, it
+ was still used when generating compound text.
+ - Extended segment charsets with varying number of bytes per character
+ were treated like those with 1 byte per character.
+ - _XlcAddCT failed to copy its ct_sequence argument, thus leading to
+ bugs when this argument was a dynamically allocated string.
+ - Missing detection of different charsets having the same escape
+ sequence.
+ * Parsing Compound Text:
+ - The functions _XlcParseCT and _XlcGetCTInfo did not perform range
+ checks on the strings being parsed. Danger of core dump through
+ out-of-bounds string access if a malicious client provides malformed
+ text.
+ - Builtin extended segment charsets were not recognized because the
+ strncmp in _XlcGetCTInfo was returning false most of the time, due
+ to the embedded length bytes.
+ - Extended segment charsets in general would not be deactivated after
+ the specified number of bytes.
+ - In _XlcCheckCTSequence, extended segments with invalid embedded
+ length bytes would lead to out-of-bounds string accesses as well.
+ - Unrecognized escape sequences did not lead to a return value > 0.
+ - Left-to-right and right-to-left indicators (starting with 0x9b) were
+ just ignored, without leading to a return value > 0.
+ - If the source string was larger than the intermediate buffer,
+ multibyte characters could be split into pieces, leading to
+ conversion errors.
+ * Generating Compound Text:
+ - The length embedded in an extended segment prefix was always wrong.
+ - Long strings could give rise to extended segments with a length that
+ doesn't fit in the allowed 14 bits.
+ - After an extended segment, GL or GR designators would unnecessarily
+ be repeated.
+ - Bytes in the range 0x81..0x88, 0x8b..0x9a, 0x9c..0x9f in multibyte
+ encodings could not be output, would be thrown away.
+ - Byte 0x9b could not be output in the UTF-8 charset.
+ * udcInf.c was generating invalid Compound Text (invalid length in
+ extended segment).
+ * lcConv.c: If in the indirect converter, the first step led to no
+ output, the second step would still be called, possibly leading to
+ out-of-bounds accesses.
+ * lcUTF8.c: had knowledge about JISX0208.1983-0 but not about
+ JISX0208.1990-0.
+ (#4333, Bruno Haible).
+1082. Fix documentation for XSetOMValues() (#4332, Bruno Haible).
+1081. Fix namespace polution in <X11/Xlib.h> introduced with patch #4293
+ (#4331, Bruno Haible).
+1080. Fix a bug in the newly introduced Xutf8LookupString() function that
+ loses input not representable in the locale encoding (#4330,
+ Bruno Haible).
+1079. Avoid four new gcc warnings about const in lcUTF8.c introduced by
+ patch #4293 (#4329, Bruno Haible).
+1078. Fix some additional cases of confusing local typedef for wchar_t
+ (#4328, Bruno Haible).
+1077. Fix some round-trip conversion errors in COMPOUND_TEXT -> UTF8_STRING ->
+ COMPOUND_TEXT due to wrong tables introduced by patches #4214, 4215
+ (#4327, Pablo Saratxaga).
+1076. Cygwin update for building Xrender DLL (#4326, Suhaib M. Siddiqi).
+1075. Fix an undefined SUBDIRS in xc/lib/GL/mesa/src/drv/Imakefile when
+ compiling on something other than x86, alpha or sparc (#4325,
+ Brian Paul).
+1074. Don't have the neomagic driver disable stretching when a mode that
+ fills the panel is selected (#4324, Andrew C. Aitchison).
+1073. Fix a bug in Xlib's _XimLocalMbLookupString() that causes a crash when
+ a zero keycode keypress event is received (#4322, HIBINO Kei).
+1072. NetBSD doesn't have perl in its default install (Matthieu Herrb).
+1071. Add Xft support to xditview with #ifdefs (Keith Packard)
+1070. Add a MIT-MAGIC-COOKIE-1 generator to startx for NetBSD 1.5 and OpenBSD
+ and FreeBSD and make mkcookie support more generic (Matthieu Herrb).
+1069. Update OpenBSD and NetBSD docs (Matthieu Herrb).
+1068. Clean up r128_video.c again (Marc La France).
+1067. Fix ATI clock generator recognition when an adapter BIOS cannot be
+ retrieved (Linus Torvalds).
+1066. Fix int10 and ATI driver for video BIOSes larger than 64kB
+ (Marc La France).
+1065. Change xf86MatchDevice() to initialise its return pointer and clean up
+ drivers accordingly (Marc La France).
+1064. Fix for bug in new imConv.c (#4318, Ivan Pascal).
+1063. Fix for FreeBSD sysmouse support (#4317, from FreeBSD ports collection).
+1062. Enable the ru_SU local entries for FreeBSD (based on patch from FreeBSD
+ ports collection).
+1061. Driver for the S3 Savage family of chips (#4315, 4316, 4319-4321,
+ Tim Roberts).
+1060. Add xkb definitions for the Logitech cordless keyboard (#4314,
+ Michel Goraczko).
+1059. Add support for "unicode keysym" to XKeysymToString() and
+ XStringToKeysym() (#4313, Ivan Pascal).
+1058. SiS driver updates, including:
+ - Performance tuning for sis630
+ - Support XV extension for sis630
+ - Support Chrontel TV for sis630
+ (#4312, Can-Ru Yeou).
+1057. Fix Xrender library to handle strings > 254 chars long.
+ Change Xrender and Xft interfaces to use 'unsigned int'
+ instead of 'unsigned long' for 32-bit glyph values.
+ (Keith Packard)
+1056. Fix neomagic driver mangled acceleration test (#4309, 4310,
+ Chip Salzenberg).
+1055. Add a rudimentary driver for the SGI Indy's newport cards (only
+ 8-bit and non-accelerated so far) (#4308, Guido Guenther).
+1054. Fix a bug in rman that is provoked by the new dumpkeymap man page
+ (David Dawes).
+1053. Updates to the dumpkeymap utility, and add documentation (including
+ a man page) (#4307, Eric Sunshine).
+1052. Add -version and -showconfig options to the Darwin Xserver, and print
+ the usual "XFree86" banner message (#4306, Torrey T. Lyons).
+1051. Fix i810 crash when running XFree86 -configure (#4305, Ryan Drake).
+1050. Linux APM fix, which fixes a problem that shows up with the neomagic
+ driver after an APM suspend (#4304, 4311, Chip Salzenberg).
+1049. Correct maximum ranges for Wacom IV devices (#4303, Frederic Lepied).
+1048. Add preliminary support for USB input devices under Linux (wacom
+ driver (#4303, MATSUMURA Namihiko).
+1047. Locale fixes/cleanups, including:
+ - Cleanup garbage in XLC_LOCALES.
+ - Add "use_stdc_env' to locales where it was absent.
+ - Move non-standard charset descriptions from the lcCT.c table to
+ the XLC_LOCALE files.
+ (#4302, Ivan Pascal).
+1046. Make sure the correct "driverName" string is used in xf86Configure.c.
+1045. Fix some i810 driver problems when too little videoRam is specified
+ (David Dawes).
+1044. Fix an i810 driver bug that prevents the DRI from being enabled
+ after a server reset (Jeff Hartmann).
+1043. Add a "dri" config file option to the i810 driver that can be used
+ to enable/disable the DRI (no other method works for statically
+ linked servers) (David Dawes, from VA's 7.0.1).
+1042. Update the i810 driver to check the max available GART memory
+ (Jeff Hartmann, David Dawes, from VA's 7.0.1).
+1041. Resync DRI code/drivers with the DRI CVS (VA Linux). Includes
+ 3dfx driver updates (Daryll Strauss).
+1040. Fix a couple of clipping problems on the Trident CyberBlade/Blade3d
+ chipsets (Alan Hourihane).
+1039. Fix a couple of Alpha related issues (Jay Estabrook).
+1038. Change Xft interface (again) to use new XftColor datatype for
+ colors instead of XRenderColor. xterm and x11perf updated to
+ match. (Keith Packard)
+1037. Fix an i810 init problem that resulted in the fallback to 2D failing
+ for one case where there's insufficient memory to enable the DRI
+ (David Dawes, from VA's 7.0.1).
+1036. Add support for printing a vendor-specific version string in the
+ X server startup messages (David Dawes, from VA's 7.0.1).
+1035. Xwd workaround for a gcc bug (Red Hat's XFree86-4.0.1-xwd-gcc-workaround
+ patch).
+1034. Fixes for sparc drivers, mostly to prevent accessing the hardware
+ when the server doesn't have control of the VT (Red Hat's
+ XFree86-4.0.1-ffb patch).
+1033. Use OS-provided interface for accessing PCI config space on Linux/ia64
+ (based on Red Hat's XFree86-4.0.1-ia64-pci patch).
+1032. Use AsmDefines when processing the Sparc assembler code for cfb
+ (based on Red Hat's XFree86-4.0-sparc-asmflags patch).
+1031. Add PAM authentication to the X server (based on Red Hat's
+ XFree86-4.0-Xwrapper patch).
+1030. Add Slovenian and Romanian entries to XKB's keymap/xfree86 file
+ (Red Hat's XFree86-4.0-si_xkb patch and XFree86-4.0-ro_xkb.patch).
+1029. Fix for PAM support in xdm SessionExit() (Red Hat's
+ XFree86-4.0-pamsession patch).
+1028. XlibInt.c patch to avoid buffer overflow (Red Hat's
+ XFree86-3.3.6-fixemacs patch).
+1027. Updates to xfs from Red Hat and Debian, including:
+ - command line options to make xfs drop it's root privs (-droppriv
+ and -user) - command line options to make xfs start as a daemon,
+ and a build option to make this the default.
+ - don't let a port option in the config file override the -port
+ command line option
+ - cleanup/fix syslogging
+ (based on #4253, Topi Miettinen, Debian, and Red Hat's
+ XFree86-4.0-xfsredhat patch).
+1026. Support for startx to set up the Xauth when starting an X server
+ (based on Red Hat's XFree86-4.0-startx_xauth patch).
+1025. Fix an unaligned access on Alpha with the tdfx driver (Jay Estabrook).
+1024. Add detection for CyberBlade/Ai1 Socket A chipsets (Alan Hourihane).
+
+XFree86 4.0.1g (29 November 2000)
+1023. Fix small bug in lcGeneric.c (#4301, Ivan Pascal).
+1022. Rewrite Xft library for Render extension/core text and font management
+ Change xterm to use new interface (Keith Packard).
+1021. s3virge driver updates, including Xv fixes for the ViRGE DX, disable
+ GX2 color expansion until it's stable, GX2 Xv code (not enabled or
+ working yet) (#4299, Kevin Brosius).
+1020. Siliconmotion driver (#4298, Frido Garritsen, Silicon Motion, Inc.).
+1019. Fix Estonian_Estonia.1257 entry in locale.alias (#4297, 4300,
+ Nerijus Baliunas).
+1018. New Lithuanian XKB map (#4296, Nerijus Baliunas).
+1017. Fix a problem with the "xtt" font module introduced with recent
+ changes to the "freetype" module (#4295, ISHIKAWA Mutsumi).
+1016. Fix the return value for the "indirect" converter in Xlib (#4294,
+ Bruno Haible).
+1015. ANSI C cleanup of Xlib locale core code (#4293, Bruno Haible).
+1014. Optimize the i18n support for parsing resource files for the unibyte
+ locales, and clean up pre-ANSI-C-isms and warnings (#4292, Bruno Haible).
+1013. Enhance the CompoundText <-> UTF-8 converter so that it understands
+ the BIG5 encoding scheme used by Emacs (#4291, Bruno Haible).
+1012. Fix documentation and implementation of _XlcCompareISOLatin1 and
+ _XlcNCompareISOLatin1 (#4290, Bruno Haible).
+1011. Add new Unicode-based APIs for internationalized text for Xlib (#4289,
+ Bruno Haible).
+1010. Fix a minor Mesa lighting bug (#4288, Brian Paul).
+1009. Fix the glide driver's resolution of symbols from the glide library
+ (#4281, Pontus Lidman).
+1008. Fix X server stalling forever with local font servers on Linux 2.4
+ kernels (#4280, Branden Robinson).
+1007. Improve temp file handling in the Xaw library (#4279, Branden Robinson).
+1006. Add support for Rage 128 RG (#4277, Michael Mattice).
+1005. Modify XimGetCharCode() to use conversion from keysym to UCS and then
+ from UCS to the appropriate charset specified in the locale description
+ (#4276, Ivan Pascal).
+1004. Allow Unicode fonts to be used as UTF-8 locale native fonts (#4275,
+ Ivan Pascal).
+1003. Fix abnt2/br XKB config (#4274, Paulo Cesar Pereira de Andrade).
+1002. Let the Darwin X server build on pure Darwin as well as Mac OS X systems
+ (#4273, Torrey T. Lyons).
+1001. Patch to allow xdm to build on Darwin (#4273, Torrey T. Lyons).
+1000. Fix parser not dup'ing a string (#4272, Paulo Cesar Pereira de Andrade).
+ 999. Improve direct fifo writes for the glint/permedia3 pixmapwrite hook
+ when using FIFO disconnect (#4271, Sven Luther).
+ 998. Fix a sprite problem with the "xwin" server (#4269, Suhaib M. Siddiqi).
+ 997. Fix a confusing local typedef for "wchar_t' in xc/lib/X11/lcUTF8.c
+ (#4268, Bruno Haible).
+ 996. Allow ProjectVar to override "/var" when set (based on #4266,
+ Bruno Haible).
+ 995. Rework Trident Blade/CyberBlade acceleration (Alan Hourihane).
+ 994. Make the CyberBlade/e4 (aka 9540) work (Alan Hourihane).
+ 993. Updates to Big5 encodings for the TrueType font backends (#4265,
+ Jacky Bryant).
+ 992. Fixes for Thai (th_TH) locale support in Xlib (#4264,
+ Theppitak Karoonboonyanan)
+ 991. Fix a segv in Xnest caused by overflowing the pixmap formats array
+ (based on #4262, Matthieu Herrb).
+ 990. Fix an xdm problem that prevents the chooser from working (#4261,
+ Matthieu Herrb).
+ 989. Update the Cards file (#4260, Paulo Cesar Pereira de Andrade).
+ 988. Update Macedonian xkb symbols, and add mk_MK.utf8 to locale.alias
+ (#4258, 4259, Damjan Georgievski).
+ 987. Safe tempfile handline for imake's probing of glibc version (based on
+ #4257, Colin Phipps).
+ 986. Fix typo in dvorak xkb symbols file, plus white space cleanup (#4256,
+ Branden Robinson).
+ 985. Fix typo in server startup message (#4255, Branden Robinson).
+ 984. Make XOpenDisplay() bail out if the server claims that its vendor
+ string is > 256 in length (#4254).
+ 983. Add some useful default key bindings for the xdm login widget (#4252,
+ Branden Robinson).
+ 982. Change the default xdm Xaccess file to not allow any connections
+ (#4252, Branden Robinson).
+ 981. Set the default glyph caching mode to "CACHE_16_BIT_GLYPHS"
+ (#4251, Branden Robinson).
+ 980. Make the X server use the XAUTHORITY environment variable (if set)
+ when the -authfile command line flag isn't given (#4250,
+ Branden Robinson).
+ 979. Add Debian-specific settings to linux.cf (#4249, Branden Robinson).
+ 978. Rename Trident Cyber9540 to CyberBlade/e4 and make appropriate
+ changes in driver (Alan Hourihane).
+ 977. Fix Trident Cyber series to only detect SDRAM (Alan Hourihane).
+ 976. Make xf86SoundKbdBell() available to modules (for citron driver)
+ (Marc La France, #4270, Frederic Lepied).
+ 975. Fix glide driver's check for glide library presence (Marc La France).
+ 974. Add missing symbol references in r128 and s3virge drivers
+ (Marc La France).
+ 973. Fix int10 debugging and reading in all segments between 0x0C0000 and
+ 0x0F0000 (Marc La France).
+ 972. Fix typo in imake.c (Marc La France).
+ 971. Turn off SGRAM optimization for Trident Blade chips, causes some
+ problems. (Alan Hourihane).
+ 970. Ignore various ".stab.*" sections for Solaris (Marc La France).
+ 969. Fix ENXIO errors on Linux BIOS retrievals by removing restriction on
+ several OSes that xf86ReadBIOS()'s Base be page-aligned (Marc La France).
+ 968. Disable change 873. It causes device/monitor mismatches
+ (Marc La France).
+ 967. Change linux/int10 to intercept signals generated by the vm86() syscall
+ rather than killing the server (Marc La France).
+ 966. Reinstate DG/UX mmap() bug work-around in int10 (Marc La France).
+ 965. Rage128 and Radeon fix for -configure (Marc La France).
+ 964. Fix int10 woes with retrieving PCI BIOSes (Marc La France).
+ 963. Allow modules to intercept signals that would otherwise kill the server
+ (Marc La France).
+ 962. Fix static Xvfb server build (Marc La France).
+ 961. Some warning fixes (Marc La France).
+ 960. Rage128 and Radeon #include changes to reduce recompilations
+ (Marc La France).
+ 959. Modify item no. 949 - only reset clipping for Cyber9382, Cyber9385 and
+ ProVidia9682 (Alan Hourihane).
+ 958. Added messages about modes rejected on lookup (Egbert Eich).
+ 957. Attempt to fix DDC1 support on Neomagic (Egbert Eich).
+ 956. Added Block/UnblockSIGIO() to DDC1 readout code (Egbert Eich).
+ 955. Enabled virtual depth for a second head on a G400 multihead
+ (this needs to be looked at) (Egbert Eich).
+ 954. Added code to check if the PictureScreen structure was initialized
+ before referencing it (Egbert Eich).
+ 953. Modified xf86UDelay() to use Block/UnblockSIGIO and usleep()
+ instead of gettimeofday() (Egbert Eich).
+ 952. Modified xf86MatchPciInstances() to allow for chipset overrides
+ even when called with no separate vendorID (Egbert Eich).
+ 951. Changed Xvfb to use fb instead of cfb (Egbert Eich).
+ 950. Moved a misplaced xfree() in the generic driver. Now more than
+ one chipset can use this driver in a multihead setup (Egbert Eich).
+ 949. Did some fixes for the Trident driver ie. fixed a LCD modeline,
+ reset clipping register on all non 3D chips (Egbert Eich).
+ 948. Added missing parts for AXP support to lnx_video.c (Egbert Eich).
+ 947. Added bsr/bsf to x86emu (Jeff Wiedemeier).
+
+XFree86 4.0.1f (16 November 2000)
+ 946. Add a dumpkeymap utility for Darwin (#4248, Eric Sunshine).
+ 945. Fix a Darwin build problem with mkcfm, and get xdm closer to building
+ (#4247, Torrey T. Lyons).
+ 944. DDX for the Xdarwin server (#4246, Torrey T. Lyons).
+ 943. Enable xdm/PAM support by default for FreeBSD versions with PAM.
+ 942. Fix a problem where the X server thinks it has acquired a VT at startup
+ before it has really been released. This is due to the ioctl()
+ returning prematurely because of a pending signal (Jeff Hartmann).
+ 941. Fix a problem with the PAM support in xdm that prevents
+ pam_start_session() from ever being called (Takanori Saneto).
+ 940. Enable PAM support for xdm on FreeBSD (#A.202, Jean-Marc Zucconi, and
+ Takanori Saneto).
+ 939. Fix xf86cfg build problem when BuildXinerama is set to NO (#A.200,
+ Jean-Marc Zucconi).
+ 938. gccmakedep has a typo which affects handling the -o and -O options
+ (A.192, Ivan Zakharyaschev).
+ 937. Specify the units for the dpms and rate commands in the xset man
+ page (#A.191, John Heidemann).
+ 936. Let makedepend ignore "//" style comments on all platforms, not
+ just Win32, and fix a bug in that code that was causing the line
+ after such comments to also be ignored (#A.189, Guenther Grau).
+ 935. Update GNU/Hurd support (#A.188, Marcus Brinkmann).
+ 934. Initial port of the ark driver to 4.x (#4242, Ani Joshi).
+ 933. Wacom input driver update, including support for 38400 link speed
+ and fix wrong advertisement of min/max values (#4241, Frederic Lepied).
+ 932. Fix some parser problems, including:
+ - parser does not write Modes section and UseModes keyword
+ - the vscan value wasn't being used
+ - make the XF86ConfModesPtr structure accessible from the
+ XF86ConfMonitorPtr structure
+ - allow xf86Parser.h to be included from in a C++ program
+ (#4238, 4243-4245, Paulo Cesar Pereira de Andrade).
+ 931. Fix the name of the Serbian xkb symbols file (rename from yu to sr)
+ (#4237, Ivan Pascal).
+ 930. Fix mkcfm bug (#4236, Juliusz Chroboczek).
+ 929. Glint/permedia3 updates (#4235, 4238, Sven Luther).
+ 928. Fix an SVR4 loader build problem introduced in 4.0.1d (#4234,
+ Takaaki Nomura).
+ 927. Fix a bug in fontenc that would cause a memory leak whenever an
+ encoding would be declared in encodings.dir but not in the encoding
+ file itself (#4233, Juliusz Chroboczek).
+ 926. Make the freetype backend use the fontenc matrix encoding support,
+ remove support for the defunct XAnti extension, and bump the version
+ of the freetype backend to 1.1.8 (#4233, Juliusz Chroboczek).
+ 925. Add proper support for matrix encodings in fontenc (including the
+ new FIRSTINDEX keyword in encoding files), and bump the version of
+ the font module ABI to 0.2 (#4233, Juliusz Chroboczek).
+ 924. Fix a problem the vesa driver (#4232, Paulo Cesar Pereira de Andrade).
+ 923. Fix problems building the C&T driver with DEBUG defined (#4231,
+ Taketoshi Sano).
+ 922. Remove lt_LT.ISO8859-1 entry from compose.dir (#4230, Nerijus Baliunas).
+ 921. s3virge driver updates, including:
+ - Stabilize GX2 support, reenable silken mouse
+ - Enable MX fixes
+ - Add support for the render extension
+ - Enable BLT_BUG for ViRGE and VX chipsets
+ (#4229, Kevin Brosius).
+ 920. Don't initialize DRI when noaccel is specified in the tdfx driver
+ (Alan Hourihane).
+ 919. Make module ABI compatibility mismatches fatal by default, and
+ add a command line option for making them non-fatal (David Dawes).
+ 918. Changed SiS driver to use fb instead of cfb (Alan Hourihane).
+ 917. Fix r128 and radeon driver source code formatting that was munged
+ during ATI merge (Kevin Martin).
+ 916. Update Markus Kuhn's UCS fonts, and add his scripts for extracting
+ subsets of them to the build process (David Dawes).
+ 915. Fix visual setting in ATI r128/radeon driver (Jeff Wiedemeier).
+ 914. Alpha fix for xf86cfg (Alan Hourihane).
+ 913. Resync DRI code/drivers with the DRI CVS (VA Linux).
+ 912. Fix tdfx driver to register resources and remove some redundant code
+ (Alan Hourihane).
+
+XFree86 4.0.1e (6 November 2000)
+ 911. Fix the ksc5601.1987-0 encoding file (#4226, 4228, Pablo Saratxaga).
+ 910. Update xdm/sessreg to write ":0" type entried in utmp on OpenBSD
+ (#4225, Matthieu Herrb).
+ 909. Fix for Xmu under NetBSD, which doesn't #define "unix" anymore (#4225,
+ Matthieu Herrb).
+ 908. Preliminary support for OpenBSD/powerpc (#4225, Tsubai Masanari,
+ Matthieu Herrb).
+ 907. Support for native WSCONS driver on NetBSD and OpenBSD (#4225,
+ Tsubai Masanari).
+ 906. Support for new OpenBSD 2.8 shared libs scheme (#4225, Matthieu Herrb).
+ 905. Support for the OpenBSD ports tree (#4225, Marc Espie).
+ 904. Update the list of layouts in the xfree86.lst file (#4224, Ivan Pascal).
+ 903. Add an XKB map for Serbian (#4224, Milos Rancic).
+ 903. New revision of the Bulgarian XKB map (#4224, Anton Zinoviev).
+ 902. Change the Alt key definitions in the "group switcher" descriptions
+ to not override the base Alt key mappings (#4223, Ivan Pascal).
+ 901. Change XKB Mode_switch behavior description to not clear "locked
+ group" (#4223, Ivan Pascal).
+ 900. Create a root window property "XFree86_DDC_EDID2_RAWDATA" when
+ suitable data is available (#4222, Andrew C. Aitchison).
+ 899. Fix some typos/errors in the Latvian and Lithuanian entries in
+ the locale.alias and locale.dir files (#4221, Nerijus Baliunas).
+ 898. Fix two more bugs in xkbcomp: handling of 'keycode aliases', and
+ copying of strings when copying structures (#4208, Ivan Pascal).
+ 897. Added render extension support to tseng driver (Egbert Eich).
+ 896. Fixed clock code in neomagic driver (Egbert Eich).
+ 899. xf86Configure now uses the imake variable xf86ConfigFile (Egbert Eich).
+ 898. xf86cfg has a new option for a server path (Egbert Eich).
+ 897. xf86cfg can now handle more than one command line argument (Egbert Eich).
+ 895. Added a delay to dac code in neomagic driver (Egbert Eich).
+ 894. Changed shadowfb to use delayed updates in neomagic
+ driver (Egbert Eich).
+ 893. Rewrote ddc code in nv driver (Egbert Eich).
+ 892. Rewrote ddc code in neomagic driver (Egbert Eich).
+ 891. Fixed problems with enter/leave/closeScreen in nv
+ driver (Egbert Eich).
+ 890. Fixed a bug in the fixed modelines in trident driver (Egbert Eich).
+ 889. Added reinitialization of blitter on enterVT in trident
+ driver (Egbert Eich).
+ 888. Fixed a typo which caused wrong register to be set in trident
+ driver (Egbert Eich).
+ 887. Added loader symbol handling to tseng driver (Egbert Eich).
+ 886. Changed tseng driver to use fb instead of cfb (Egbert Eich).
+ 885. Changed chips driver to use fb instead of cfb (Egbert Eich).
+ 884. Added render extension support to chips driver (Egbert Eich).
+ 883. Added render extension support to neomagic driver (Egbert Eich).
+ 882. Added render extension support to nv driver (Egbert Eich).
+ 881. Modified helper_mem.c to map everything between video bios and
+ system bios on PC-like platforms (Egbert Eich).
+ 880. Modified Linux mapVidMem() to map memory on page boundaries
+ (Egbert Eich).
+ 879. Changed BIOS_SIZE (Sys BIOS) from 0x10000 to 0xffff to make
+ int10 work un DGUX (Takis Psarogiannakopoulos).
+ 878. Fixed a bug in the argument list of the call to xf86ReadPciBIOS()
+ from int10/pci.c (Egbert Eich).
+ 877. Added simple sanity check to catch situation where DDC reads
+ all 0 and therefore trivially has the correct checksum (Egbert Eich).
+ 876. Changed i2c code to allow for longer rise/fall times on longer
+ cables (Egbert Eich).
+ 875. Removed limit on default visual for 4bpp (Egbert Eich).
+ 874. Added macros to build nv driver on AXP (Jay Estabrook).
+ 873. Changed -configure to use primary card as first card (Egbert Eich).
+ 872. Changed generic vga driver to not unmap memory when switched away.
+ 871. Fixed problem that caused APM support to be disabled on server
+ reset (Egbert Eich).
+ 870. Added support for newer sparse AXP systems (Egbert Eich).
+ 869. Added support for MGA G100 PCI (Egbert Eich).
+ 868. Add missing exported libXext Shm functions to loader (Alan Hourihane).
+ 867. Change Rage 128 DRM driver name to what the r128 kernel module
+ expects (Kevin Martin).
+ 866. Fix newly merged "ati" driver probe to allow "r128" and "radeon"
+ driver names in the XF86Config file for backwards compatibility
+ (Kevin Martin).
+ 865. Use vgaHW module to fix font save/restore in i128 driver (Robin Cutshaw).
+ 864. Fixed (hopefully) a Xinerama problem with BE clients (Mark Vojkovich).
+ 863. Modifications to GLw to allow it to build without Motif, and
+ integrate it into the regular build process (#4142,
+ Carlos A. M. dos Santos, David Dawes).
+ 862. Import the GLw parts of SGI's ogl-sample (snapshot from 20001102)
+ under xc/extras/ogl-sample.
+ 861. Add support for SubSection in the Vendor Section of the config file
+ (Stuart Anderson)
+ 860. Fix a typo introduced in a recent update to the 'no' xkb symbols
+ file (#4218, Pablo Saratxaga, 4219, Harald Nordgård-Hansen).
+ 859. Parser symbol update (#4217, Paulo Cesar Pereira de Andrade).
+ 858. Updates to iso8859-9e, microsoft_cp1251 charset handling, and
+ add real support for microsoft_cp1255 and microsoft_cp1256 (#4214, 4215,
+ Pablo Saratxaga).
+ 857. Fix Sparc build problems linking xf86cfb with libloader that were
+ related to various interdependencies (#4212, David S. Miller).
+ 856. Allow generic XVideo adaptors (like v4l) to be initialised for
+ the G400 crtc2 (#4211, Antti Tapaninen).
+ 855. Update mga driver to check the chipset much earlier to prevent
+ server hang when using g400 dual head + millennium 2, and some
+ G200 PCI/warp cleanups (#4211, Antti Tapaninen).
+ 854. Updates to the Macedonian xkb symbols (#4210, 4220, Damjan Georgievski).
+ 853. Combine the ATI, Rage128 and Radeon drivers into one with multiple
+ sub-modules (Marc La France).
+ 852. Make BIOS accesses in the Rage128 and Radeon drivers independent of
+ endianess and alignment (Marc La France).
+ 851. Fix the claiming of XF86Config device sections by drivers, and change
+ xf86MatchDevices() to only return unclaimed sections (Marc La France).
+ 850. Fixed build problem in s3virge when XvExtension is not set (Stuart
+ Anderson)
+ 849. Add a message at the top of the server/log output for pre-release
+ versions stating that they are unsupported (David Dawes).
+ 848. Fix two problems in Imake.rules: have LinkBuildBinary create the
+ used directory if it doesn't exist, and fix a missing ')' in
+ the LinkConfFileLong (#A.187, Ivan Zakharyaschev).
+ 847. Fix a libXt bug that affects multidisplay applications when Xt is
+ built to use select(2) rather than poll(2) (#A.181, Antony Uspensky).
+ 846. Add a -utime option to xclock that allows the digital clock to
+ display the number of seconds since the Epoch (based on A.173,
+ Kelsey Hudson).
+ 845. Add symbols mappings for extra keys on the BTC 9000 keyboard (#A.167,
+ Stefano Cavallari).
+ 844. Fix twm's icon manager so that it is functional before an EnterNotify
+ event is received in twm's event loop (#A.156, Jason Zwolak).
+ 843. Update comments about standards for Estonian support, and add an
+ entry for the Estonian keyboard layout to the xfree86.lst file
+ (#A.155).
+ 842. Fix for G400 crtc2 blank screen color (#4205, Antti Tapaninen).
+ 841. Modify the mga/HALlib support to allow it to be selected at
+ run-time. This allows a driver built with HALlib to be used with
+ older hardware (like the Millennium, Millennium 2) (#4204,
+ Antii Tapaninen).
+ 840. Add config/imake support for Darwin (#4200, Torrey T. Lyons).
+ 839. Add a driver for the citron touch screen (#4199, Peter Kunzmann).
+ 838. Fix Html man page install problem (Robin Cutshaw).
+ 837. Fix transparency problem with blits, add DDC2 for i128-II chipset
+ in i128 driver (Robin Cutshaw).
+ 836. Allow loader to be build if HasShm == NO (Marcus Brinkmann).
+ 835. Allow the log file to be set in the config files (Stuart Anderson).
+ 834. Fix Rage128/Radeon drivers to free correct scratch buffer on LeaveVT
+ (Alan Hourihane).
+ 833. Xterm patch #148 (#4213, Thomas Dickey).
+ 832. Split ATI driver into two modules in preparation for merging in the
+ r128 and radeon drivers (Marc La France).
+ 831. Update the XFree86 -configure code to put the default font path
+ in the Files section of the config file it generates (#4202,
+ Paulo Cesar Pereira de Andrade).
+ 830. Add write-combine support for IA-64 (Mark Vojkovich).
+
+XFree86 4.0.1d (27 October 2000)
+ 829. Add code to the xf86config utility to get the list of XKB selections
+ from the appropriate XKB files rather than having them hard-coded.
+ Also allow XkbOptions to be set (#4209, Ivan Pascal).
+ 828. -
+ 827. Xterm patch #147 (#4207, Thomas Dickey).
+ 826. Move the initialisation of pScrn->EnableDisableFBAccess into
+ InitOutput(), which fixes an infinite loop problem that can show up
+ on server resets (#4206, Joe Moss).
+ 825. Make xf86cfg use the same config file search path as the X server
+ (#4203, Paulo Cesar Pereira de Andrade).
+ 824. -
+ 823. Fix a bug in the vesa driver when finding the linear address for the
+ card, some compile time warnings, faster code for handling colormap
+ changes, and add DGA support (#4201, Paulo Cesar Pereira de Andrade).
+ 822. Fix a typo in the mga driver that causes planemask problems with
+ the PCI version of the G100 (#4198, Antti Tapaninen).
+ 821. Add an option to the C&T driver to disable "TMED" (DSTN dithering
+ scheme) (#A.172, Damir Anicic, #4196, 4197, David Bateman).
+ 820. Pablo Saratxaga's i18n updates for XFree86 that are used in Mandrake 7.2.
+ Includes various new and fixed xkb files, locale name additions and
+ updates, and new support for various charset encodings (#4195,
+ Pablo Saratxaga).
+ 819. Improve Xaw 7 compatibility with version 6 in the form widget geometry
+ management code. This should fix some problems seen with ghostview
+ (#4194, Paulo Cesar Pereira de Andrade).
+ 818. Build fixes for XFree86 on Cygwin (#4193, Suhaib Siddiqi).
+ 817. Fix for missing symbol messages in int10 and cirrus driver
+ (Marc La France).
+ 816. Detect null windows of PCI-to-PCI bridges (Marc La France).
+ 815. Update pciConfigRec's and pciVideoRec's when relocating PCI resources
+ (Marc La France).
+ 814. Fix handling of 64-bit PCI bases (Marc La France).
+ 813. Fix cursor hide on i128 in multi-head mode (Robin Cutshaw).
+ 812. Fix accel on i128 non-primary cards (Robin Cutshaw).
+ 811. locale.alias fix for ko_KR.utf8 (#4190, Won-kyu Park).
+ 810. Fix incorrect vtSema usage in neomagic driver DPMS code (#4184,
+ Andrew C Aitchison).
+ 809. Fix a 1-byte overflow in Xtrans.c (#4182, Aaron Campbell).
+ 808. Enable building the loadable server for BSD/OS.
+ 807. Fix the following xkbcomp bugs:
+ - 'base group' keyword added to 'whichGroup' possible values list
+ - 'groupsWrap' keyword removed from 'controls' possible values list
+ - fix crash in processing files with unnamed sections
+ - now keep 'per key group adjustment mode' in XKM file
+ - now allow an empty 'key' description to be specified in an
+ xkb_symbols file.
+ (#4170, Ivan Pascal).
+ 806. Add a "bcast" flag for mode lines, which is needed to display
+ broadcast resolutions (#4169, Michel Danzer).
+ 805. Fix compiler warnings when building the mga driver with or without
+ the Matrox HALlib, add the digital/tv-out/tvstandard/cabletype
+ options, missing files, and some cleanups (#4166, Antti Tapaninen).
+ 804. Fix spelling from xvinfo (#4166, Antti Tapaninen).
+ 803. Add support to twm for displaying multibyte strings on window titles,
+ and make the twm config file reader 8-bit clean (#4165, 4168, 4180,
+ Tomohiro Kubota).
+ 802. Fix a tseng driver problem related to the usable amount of video memory
+ (#4164, A.182, Randy McCaskill).
+ 801. Add support for the new Render extension to the nv driver, and
+ turn on fb support by default in the nv driver (#4161, Jarno Paananen).
+ 800. Fix a typo that prevents DPS from being built statically (#4160,
+ Juliusz Chroboczek).
+ 799. Fix some xkbfile bugs in the .xkb files that it writes
+ (two adjacent commas, no xkb_types section in xkb_layout) (#4159,
+ Ivan Pascal).
+ 798. Fix an xkbcomp bug that causes an infinite loop for some error
+ message output (#4158, Ivan Pascal).
+ 797. Fix XlcNONE usage in charset description (#4153, Ivan Pascal).
+ 796. Fix a bug in XKB group adjustment (#4152, Ivan Pascal).
+ 795. Fix some build problems that show up with the SVR4 C compiler
+ (based on #4139, Takaaki Nomura).
+ 794. Add two new XKB group switches (Alt+Shift and Menu key) (#4151,
+ Ivan Pascal).
+ 793. Fix HTML man page links when the man page suffix has more than one
+ character (#4150, Bruno Haible, A.149, Serguei Ostrovskii).
+ 792. Remove the old UTF-1 locale (it's not filesystems safe, deprecated
+ for years, withdrawn from ISO standards, and nobody uses it) (#4147,
+ 4149, Bruno Haible).
+ 791. Replace multiple stub functions in libXThrStub by only one (#4141,
+ Carlos A. M. dos Santos).
+ 790. Fix some build problems that show up with glibc 2.1.3 where ctype.h
+ sometimes (always?) depends on stdlib.h being included (#4134,
+ Kevin Brosius).
+ 789. Updates for building on BSD/OS 4.2 on UltraSparc (#4132, Kurt J. Lidl).
+ 788. Default to linking the Xfont library into the X server statically
+ (based on #4127, Kurt J. Lidl).
+ 787. Update apNetBSD.shar for a kernel mmap interface change (#4124,
+ Bernd Ernesti).
+ 786. When the "auto" mouse protocol is specified, do the auto-detection
+ whenever regaining control of the VT (based on #4120, Kazutaka Yokota).
+ 785. Change the usage of the "Xinerama" config file option to be consistent
+ with all the other ServerLayout/ServerFlags options, and document it
+ in the XF86Config man page (#4118, Itai Nahshon).
+ 784. Add I2C/DDC support to i128 driver (Robin Cutshaw).
+ 783. Add non-GXcopy raster op support to cirrus driver (#4178, David Monniaux).
+ 782. Use DlLibrary instead of referencing -ldl explicitly in xf86cfg
+ (#4189, Matthieu Herrb).
+ 781. Add S3 Virge XVideo support (preliminary) (#4186, Kevin Brosius).
+ 780. Fix non-DRI build problem in r128 driver (#4188, Matthieu Herrb).
+ 779. Add XLIB for OpenBSD/i386 dependency problem to xvinfo
+ (#4187, Matthieu Herrb).
+ 778. Update C&T driver, remove obsolete acceleration and use fb instead
+ of cfb with USE_FB option (#4185, David Bateman).
+ 777. Experimental XAA Render support in the MGA driver (Mark Vojkovich).
+ 776. Preliminary XAA support for the Render extension (Mark Vojkovich).
+ 775. Pass depth/bpp correctly, scan all fbdev devices, misc fbdev fixes.
+ (#4179, Michel Danzer).
+ 774. Add generic Vesa driver, fixes for xf86cfg plus changes to parser to
+ reflect xf86cfg changes (#4174,#4175, Paulo Cesar Pereira de Andrade).
+ 773. Loader fixes for Alpha. (Jay Estabrook).
+ 772. Accelerated TGA2 32bpp for tga driver (Jay Estabrook).
+ 771. Allow use of Compaq's Math Library on Alpha (currently for Mesa)
+ (Alan Hourihane).
+ 770. Update Tiny-X Xvesa server for standard VGA BIOS modes. (Keith Packard)
+ 769. Added ATI Radeon driver, accelerated 2D only (for now) (VA Linux).
+ 768. Fix depth24/32 issue in i128 driver (#4176, Andrew C Aitchison).
+ 767. On IA-64's, build DRI and drm's if they would be built on IA-32's
+ (David Mosberger).
+ 766. Fix xf8_32wid build on Sparc's (Marc La France).
+ 765. Fix MMIO macros for Sparc's (David S. Miller, Jakub Jelinek,
+ Marc La France).
+ 764. Sparc warning fixes (Marc La France).
+ 763. Fix for decoded I/O and memory ranges of certain Sun PCI-to-PCI bridges
+ (David S. Miller, Jakub Jelinek).
+ 762. Force ATIAvoidCPIO to YES on Sparc's (Marc La France).
+ 761. Minor fix for the ATI driver's printing of MMIO registers
+ (Marc La France).
+ 760. Minor fix for sunffb DGA support (Marc La France).
+ 759. Remove unnecessary pointer<->long casts in tseng driver (Marc La France).
+ 758. Re-align Sparc PCI support with that of other architectures
+ (Marc La France).
+ 757. mmap() /dev/fb instead of /dev/mem on Linux/Sparc (Marc La France).
+ 756. Fix OS-reported PCI ranges on Linux/Sparc (David S. Miller,
+ Jakub Jelinek).
+ 755. Remove a dependency on word size in the determination of PCI resource
+ sizes on Linux (Marc La France).
+ 754. Permedia3 updates (#4177, 4183, 4192, Sven Luther).
+ 753. Add Xv support to the r128 driver (Stuart Anderson/Vladmir Dergacheb)
+ 752. Make VBE module log a message when the BIOS doesn't support any VESA
+ extensions (Marc La France).
+ 751. Fix int10 so that it rejects BIOS's that are not aligned on a 512-byte
+ boundary (Marc La France).
+ 750. Fix int10 for ISA adapters on Alpha's (Egbert Eich).
+ 749. Fix for ATI ISA adapters on Alpha's or with -configure (Marc La France).
+ 748. Fix stupid clock probe bug in ATI driver (Marc La France).
+ 747. Reorganise ATI driver in preparation for futuure changes
+ (Marc La France).
+ 746. Formatting changes to hsync/vrefresh messages (Marc La France).
+ 745. Fix spurious free() when using an ISA adapter (Marc La France).
+ 744. Preliminary acceleration of the Render extension for Matrox G200/G400
+ (Mark Vojkovich).
+ 743. Fix ordering of drawable destruction in client-side DRI (Brian Paul).
+ 742. Update Trident's text acceleration routines (Alan Hourihane).
+ 741. Destroy unbound window info when a client destroys a context in
+ the client-side DRI driver (Kevin Martin).
+ 740. Make ATI driver's detection of Rage 128's more precise (Marc La France).
+ 739. Reinstate BIOS checksum verification but make it non-fatal
+ (Marc La France).
+ 738. Don't set protection register on older trident chips
+ Fixes Vertical line problem. (Alan Hourihane).
+ 737. Add missing symbols for Solaris (incomplete) (Marc La France).
+ 736. Add primitive support in xterm for Xft based fonts (Keith Packard)
+ 735. Add new Xft library to hook FreeType 2 to Render (Keith Packard)
+ 734. Added support for Number Nine I128 chipsets (Robin Cutshaw).
+ 733. Added support for softbooting BIOSes on ia64 (Egbert Eich).
+ 732. Fixed handling of XtMakeGeometryRequest() to test for parent
+ belonging to subclass of composite class only if the widget
+ itself is managed. This follows the specs more closely.
+ (Keith Packard).
+ 731. Changed handling of DDC read in r128 driver. Driver does not
+ fail any more if vbe DDC reads don't succeed (Egbert Eich).
+ 730. Fixed infinite loop when referencing the same mnitor section
+ twice when using a Mode Section (Egbert Eich).
+ 729. Fixed problem that caused SIGV in xf86GetValidBiosBase() (Egbert Eich).
+ 728. Fixed macintosh us keyboard (Olaf Hering).
+ 727. Added missing symbols to mga driver (Stefan Dirsch).
+ 726. Fixed a ia64 loader problem that caused SIGV when PLT was present
+ (Andreas Schwab).
+ 725. Fixed ia64 build rules (Andreas Schwab).
+ 724. Fix DGA library to only swap events for DGA 2.0 X servers
+ 723. Fix locale parsing code in Xlib and Xt (Matthieu Herrb)
+ 722. Fix X Test Suite to work on 800x600 screens (Keith Packard)
+ 721. PCI chip ID updates to ATI driver (Marc La France).
+ 720. Fix i810 driver for -probe and -configure (Marc La France).
+ 719. Change message when default modes are deleted (Marc La France).
+ 718. Fix Xinerama byte swapping bug (Marc La France).
+ 717. IA-64 and Alpha fixes for pswrap, Mesa, DRI, Xpm, libX11, Xt, Xaw, Xmu,
+ dps, Type1 fonts, cfb24, most output drivers, ELF loader, ramdac module,
+ xf4bpp and xf86cfg (Marc La France).
+ 716. Improve IA-64 support by removing a plethora of 32-bit'isms
+ (Marc La France).
+ 715. Default HasLinuxDoc to NO (Marc La France).
+ 714. Lots of Neomagic driver fixes/enhancements (Mark Vojkovich).
+ - Fix logic bug that kept HW cursor from being used.
+ - Added support for gamma correction and DirectColor visuals.
+ - Fixed some depth/bpp confusion (depth 15 works now).
+ - Convert from cfb to fb.
+ - Fix typo that kept the pixmap cache from being used.
+ - Fixed DGA support.
+ - Disable 8x8 pattern fills because they don't work.
+ - Set correct virtual desktop size limits for 2160 and older chips.
+ - Preliminary man page.
+ - Enable burst modes by default.
+ - Accelerate ImageWrite support for 2097/2160.
+ 713. Fix some depth 32 problems in XAA (Mark Vojkovich).
+ 712. Add Silken Mouse to Rage 128 driver (Alan Hourihane).
+ 711. Resync DRI code/drivers with the DRI CVS (VA Linux).
+ 710. Add glxinfo to programs list (#4138, Mark Paton).
+ 709. Add LVDS support for SiS and fix copyright messages (#4136, Can-Ru Yeou).
+ 708. Fix support for C&T 69030 (#4137, David Bateman).
+ 707. Support Cirrus Logic 7548 chip (#4146, David Monniaux).
+ 706. Fix typos in Xt man pages (#4156, Carlos Santos).
+ 705. Fix libdps bug (#4154, Juliusz Chroboczek).
+ 704. Xterm patch #146 (#4144, Thomas Dickey).
+ 703. Xterm patch #145 (#4140, Thomas Dickey).
+ 702. Fix 32bpp on the Permedia3 (Sven Luther).
+ 701. Fix to xterm InsertChar() to handle cases where cur_col + n
+ ends up past the end of the line (Andreas Schwab).
+ 700. Added keyboard layouts for PowerMac (Olaf Hering).
+ 609. Fixed Macintosh keyboard layouts (Olaf Hering).
+ 608. Fixed build when BuildServer defined NO (Egbert Eich).
+ 607. Fixes for C&T 69030 (David Bateman).
+ 606. Fix for locale setting in Xlib and Xt using getlocale()
+ from glibc5 (Egbert Eich).
+ 605. Added handling of i5/686 and k6 compiler defines to Imake.cf
+ (Philipp Thomas).
+ 604. Added support for non-English locales in xload (Egbert Eich).
+ 603. Fixed memory initialization in Xlib (Vladimir Nadvornik).
+ 602. Fixed memory initialization in xdm (Egbert Eich).
+ 601. Rudimentary S390 support (Ruediger Oertel, Bernhard Kaindl).
+ 600. Enabled support for compressed xpm-files (Stefan Dirsch).
+ 599. Added support for Czech querty keyboard (Jan Holesovsky).
+ Some fixes for ia64 ().
+ 598. Added CPU to Screen Color expansion to Neomagic driver (Egbert Eich).
+ 597. Added support for hotkey display output switch for Neomagic
+ driver (Egbert Eich).
+ 596. Add "xvinfo" client for querying Xv adaptors (Mark Vojkovich).
+ 595. Fix DGA support in the i810 driver (Mark Vojkovich).
+ 594. Enlarge the i810 pixmap cache and have the YUV overlay use that memory
+ rather than allocate dedicated memory for overlay data (Mark Vojkovich).
+ 593. Add/fix support for the Rage 128 Mobility chips (M3/M4) (Kevin Martin).
+ 592. Fix RegisterResources for multiple heads in glint driver
+ (#4143, Berend Ozceri).
+ 591. Update Permedia3's hw cursor to match the Permedia2v's they are
+ the same (Alan Hourihane).
+ 590. Fix glint driver to use colorKey rather than fixed value (Alan Hourihane).
+ 589. Add ScreenToScreenCopies for Permedia3 (Alan Hourihane).
+ 588. Add SilkenMouse support to the i810 driver (Mark Vojkovich).
+ 587. Disable DRI acceleration in depth 15 on the i810 because it doesn't
+ work (Mark Vojkovich).
+ 586. Fix some ordering problems in the I810ScreenInit that broke the
+ software cursor and backing store (Mark Vojkovich).
+ 585. Convert the i810 driver from cfb to fb (Mark Vojkovich).
+ 584. Fix some depth/bpp confusion in the i810 driver. Depth 15 works now
+ (Mark Vojkovich).
+ 583. Turn off visual ID matching in Xv (Mark Vojkovich).
+ 582. Add the IA-64 ELF loader (Jakub Jelinek).
+ 581. Add I420 and UYVY image formats to the i810 driver (#4135, Jonathan Bian).
+ 580. Fix an Xaw problem with illegal aliases (#4133, Jakub Jelinek).
+ 579. Set $(SHELL) to '/bin/sh -e' on Linux to allow builds/installs stop
+ immediately on errors as on other platforms (Brandon Robinson).
+ 578. Update i810 driver for -configure to work (Alan Hourihane).
+ 577. Have Xv silently ignore client requests with zero sized primitives
+ (Mark Vojkovich).
+ 576. Disable gamma correction and DirectColor visuals on the i810 because
+ they don't work (Mark Vojkovich).
+ 575. Fix a bug in XAA's MSBFIRST color expansion support (Mark Vojkovich).
+ 574. Allow the default i810 video overlay key to be changed from the
+ XF86Config file (Mark Vojkovich).
+ 573. Don't build DRM modules with a non-module Linux kernel (Marc La France).
+ 572. Reinstate non-MMIO-only version of ATI driver for Alpha architecture
+ (Marc La France).
+ 571. Fix input event queueuing for 64-bit platforms (Marc La France).
+ 570. IA-64 changes resulting from a source cross-check with Alpha support
+ for 64-bit dependencies (Marc La France).
+ 569. Fix in ATI drivber for DPMS support on panels (Marc La France).
+ 568. I810 bugs fixes and enhancements relating to Xv (#4121, 4117, 4123,
+ 4128, Jonathan Bian).
+
+XFree86 4.0.1c (28 August 2000)
+ 567. Add support to xset for setting the keyboard repeat rate using XKB
+ (A.119, A.126, Stephen Montgomery-Smith).
+ 566. Various DRI-related 64-bit/IA-64 fixes (#A.134, David Mosberger).
+ 565. Support for multithreaded libraries on NetBSD when used in conjunction
+ with the GNU pth library (#4113, Chris Sekiya).
+ 564. Add /usr/pkg/bin to NetBSD's DefaultUserPath (#4112, Bernd Ernesti).
+ 563. Add a (Linux-specific) VESA driver for Keith's small X server (#4111,
+ Juliusz Chroboczek).
+ 562. Update Hungarian xkb maps (#A.145, Peter Soos).
+ 561. Fix ATI driver bug that prevented the disabling of int10, ddc and vbe
+ through options (Marc La France).
+ 560. Improve libX11 behaviour when a server doesn't have XKB, allowing
+ XKB-aware XLookupString features with servers without XKB (#4108,
+ Ivan Pascal).
+ 559. Fix a bug in xkbcomp'shandling of 'group compat' data (#4107,
+ Ivan Pascal).
+ 558. Fix an i810 driver problem doing XvImage with clipping (#4106, 4110,
+ Jonathan Bian).
+ 557. Add PCI info for devices found on the G4 Mac (#4105, Matthieu Herrb).
+ 556. New XkbOptions for LED selection (#4101, Ivan Pascal).
+ 555. Changes to XkbGetControls regarding ax_options (#4100, Ivan Pascal,
+ based on A.125, Stephen Montgomery-Smith).
+ 554. Changes to XkbSetControls regarding per_key_repeat (#4099, Ivan Pascal,
+ based on A.124, Stephen Montgomery-Smith).
+ 553. Fix MouseKeys acceleration (#4098, Ivan Pascal, based on A.112,
+ Stephen Montgomery-Smith).
+ 552. -
+ 551. Man page for Xmark (#4097, Richard Braakman).
+ 550. Fixes for Macintosh XKB data files (#4094, Ani Joshi).
+ 549. Change VarDbDirectory to /var/lib on Linux to comply with FHS 2.1
+ (#4093, Branden Robinson).
+ 548. Include <sys/types.h> in agpgart.h (#4091, Branden Robinson).
+ 547. Re-add installation of the micro font (#4090, Branden Robinson).
+ 546. Fix the rstart/server script generation (#4088, 4089, Branden Robinson).
+ 545. Allow mkhtmlindex.sh to work when the shell's -e flag is used (#4087,
+ Branden Robinson).
+ 544. Xterm patch #144 (#4109, Thomas Dickey).
+ 543. Xterm patch #143 (#4104, Thomas Dickey).
+ 542. Xterm patch #142 (#4102, Thomas Dickey).
+ 541. Xterm patch #141 (#4085, Thomas Dickey).
+ 540. Xterm patch #140 (Thomas Dickey).
+ 539. Xaw bug fix (#4084, Paulo Cesar Pereira de Andrade).
+ 538. Add support for the NeoMagic NM2230 MagicMedia 256AV+ to the neomagic
+ driver (#4083, Andrew C Aitchison).
+ 537. Fix generic Xom to select the same font for measuring text escapement
+ as is used for drawing (#4082, Owen Taylor).
+ 536. Resync DRI code/drivers with the DRI CVS (VA Linux).
+ 535. Engine polling changes in r128 driver (David Mosberger).
+ 534. Fix linear memory mapping in ATI driver (Marc La France).
+ 533. Fix endianness problems in the ATI driver when accessing BIOS images
+ (Marc La France).
+ 532. Allow building Xptr, Xnest and Xvfb with MakeDllModules
+ (Bill Nottingham).
+ 531. Build DRI drivers on IA-64 (David Mosberger, Marc La France).
+ 530. Use $(CC) instead of $(LD) when building modules (Bill Nottingham).
+ 529. When building with MakeDllModules, generate both dynamic and static
+ libraries (Bill Nottingham, Marc La France).
+ 528. Fix detection problem with ramdac for Glint Permedia1's
+ (Alan Hourihane).
+ 527. Fix minor symbol resoltion problem in dlopen() loader (Marc La France).
+ 526. Alpha changes that fell out of RadHat's IA-64 changes (Marc La France).
+ 525. A merge of most of RedHat's IA-64 changes (Keith Fish, Stephane Eranian,
+ Bill Nottingham, Marc La France):
+ - Don't force static server build.
+ - Fix NULL #define'ition for loader server.
+ - Various #if-testing changes.
+ 524. Fix the few problems that showed up with the integration of the cygwin
+ support (Suhaib M. Siddiqi).
+ 523. ATI driver changes (Marc La France):
+ - Make ATIProbe() and ATIPreInit() optionally more verbose.
+ - Fix compile problem on Alpha's.
+ - Fix Mach64 hardware clipping bug.
+ - Support transparency during Mach64 screen-to-screen copies.
+ - Disable int10 interface in MMIO-only driver version.
+ - Fix determination of MMIO base address for Mach64 GX, CX, CT, ET,
+ VT and GT.
+ - "Wake" up ATI VGA's before probing for them.
+ - Other cosmetic changes.
+ 522. Workaround for problems with static during palette changes on the
+ MGA G400 (Mark Vojkovich).
+ 521. Share common drm files between Linux and FreeBSD. This fixes
+ DRI-related build problems on FreeBSD (David Dawes).
+ 520. Add Romanian xkb symbols definitions (Cristian Gafton).
+ 519. First cut at pushing the AGP GART interface into the os-support
+ layer, with support for Linux and FreeBSD (David Dawes).
+ 518. Fix SHM support in Xv that was broken in 4.0.1b (David Dawes)
+ 517. Change the Solaris8/x86 keyboard handling to map the raw keycodes to
+ the same keycodes that we use on other platforms, and remove the
+ Solaris8/x86-specific XKB definitions (David Dawes).
+ 516. Fix a problem in the fbdev driver where xf86DrvMsg() is called before
+ the necessary pScrn fields have been initialised (Martin Dalecki).
+ 515. Fix mga dri bug that caused some rendering corruption when the dri module
+ was loaded (Mark Vojkovich).
+
+XFree86 4.0.1b (11 August 2000)
+ 514. Fix the freetype font renderer's handling of True Type Collections
+ (.ttc files) (based on #A.123, timecop at japan.co.jp).
+ 513. Add PCI IDs for Silicon Motion, Inc (#A.122, Martin Dalecki).
+ 512. Fix a problem with the sequence number not being byte-swapped
+ for the reply to the DPMSCapable request (#A.120, Stephen Tse).
+ 511. Fix input driver PreInit funtions to behave as expected by InitInput()
+ (David Dawes).
+ 510. Port the spaceorb input driver to 4.x (Guido Heumer).
+ 509. Port the Summa input driver to 4.x (#A.116, Peter Schlaile).
+ 508. Add a DigitalEdge input driver (#A.116, Peter Schlaile).
+ 507. Remove obsolete PC98 code (#4081, Takaaki Nomura).
+ 506. Fix PC98 keyboard problems (#4081, Osamu Tomita).
+ 505. Imake support for building on Linux/arm32 (#4080, Andrew E. Mileski).
+ 504. Fix a problem with restoring the PIXCONF register in the i810 driver
+ (#4078, Jonathan Bian).
+ 503. Fix a build problem with the sis dri driver Imakefile (#4076,
+ Takaaki Nomura).
+ 502. Add DPMS support to the fbdev driver (#4075, Ani Joshi).
+ 501. Add DPMS support to the fbdevhw module (#4074, Ani Joshi).
+ 500. Fix VGA detection bug with Mach64 integrated controllers
+ (Marc La France).
+ 499. Accelerated line support for the NV driver (Chas Inman, Mark Vojkovich).
+ 498. Add GeForce2 support to the NV driver (Chas Inman).
+ 497. Integrate Cygwin support. To compile, this requires Cygwin 1.0 or
+ later with gcc 2.95.2 and Windows NT (#4073, Suhaib M. Siddiqi).
+ 496. Add en_GB.ISO8859-15 to locale.dir (David Dawes)
+ 495. Build int10 on all platforms and move ATI driver after r128 driver in
+ compiled-in probe lists (Marc La France, Michael Madore).
+ 494. Fix bug in parser code: addNewOption2() trunkates option list
+ when an option is added that already exists (Egbert Eich).
+ 493. Fix tmp file problem with makedepend scripts (based on report from
+ Alan Cox).
+ 492. ATI driver changes (Marc La France):
+ - Fix resource relocation bug.
+ - An attempt at fixing problems reported with Chrontel 8398's.
+ - Workaround for Mobility BIOS bug that affected the driver's ability to
+ restore the mode on server entry.
+ - Fix SEGV that occurs with ATI adapter BIOS'es that do not support some
+ flavour of VBE.
+ - Allow the driver to tolerate the absence of an initialised adapter BIOS
+ image and introduce XF86Config options for the information the driver
+ would otherwise require from it.
+ - Recognise more cases where a DFP panel might be in use.
+ - Fix minor bug that occurred on xf86SetDepthBpp() failures.
+ - Implement a compilation option that produces an MMIO-only version of
+ the driver. Intended for non-Intel architectures. See the driver's
+ Imakefile for details.
+ 491. fixed handling of backwards compatibility in xvmode (Egbert Eich).
+ 490. fixed changing mouse protocol with xf86misc extensions (Egbert Eich).
+ 489. added code to sanitize uninitialized PCI config space
+ base addresses (Egbert Eich).
+ 488. Changed xf86xv.c to call StopVideo(exit=TRUE) even
+ if StopVideo(exit=FALSE) has already been sent (Egbert Eich).
+ 487. fixed core dump in C&T video driver when vt switching
+ Changed C&T video driver to only register a block handler
+ when StopVideo() is called with exit = TRUE (Egbert Eich).
+ 486. Fixed Cirrus driver not segfault when termineated while
+ switched away (Egbert Eich).
+ 485. Neomagic driver: select sw cursor when screen stretching is
+ enabled (Egbert Eich).
+ 484. Neomagic driver: fixed problem with screen to screen copy
+ on 2200 chipsets (Egbert Eich).
+ 483. Neomagic driver: fixed 'white screen problem' by implementing
+ a signal save delay routine (Egbert Eich).
+ 482. r128 driver: Fixed colormap set problem when server is switched
+ away (Egbert Eich).
+ 481. r128 driver Added reinitialization of accel engine after vt switch.
+ 480. fixed a fg/bg color problem in SiS driver (Egbert Eich).
+ 479. attempt to address some problems with Cyber LCD chipsets in
+ Trident driver (Egbert Eich).
+ 478. tseng driver: Implemented correct MMIO handling (Egbert Eich).
+ 477. tseng driver: made accel driver multi screen capable (Egbert Eich).
+ 476. fixed vgaHW driver to use forground color for readability
+ test of pallette registers. This prevents annoying flashing
+ screen on server start (Egbert Eich).
+ 475. added module/font/rgb path parameters to xf86cfg (Egbert Eich).
+
+XFree86 4.0.1a (2 August 2000)
+ 474. i810 DRI updates (Jeff Hartmann).
+ 473. i810 driver updates (H. J. Lu).
+ 472. Save/restore the text mode colourmap for Solaris, to fix a blank
+ screen problem on Solaris 8 after exiting the X server (#A.104,
+ Richard Coley).
+ 471. Patch for SuperProbe on Linux with devfs (#A.103, Adam J. Richter).
+ 470. Enable BSD/gcc-2.95.2 workaround for BSD/OS 4.2 (#4072, Kurt Lidl).
+ 469. Fix a problem with the header symlinks in Xserver/GL/mesa/include/GL
+ (#4071, Matthieu Herrb).
+ 468. Finish integrating the SiS DRI driver support (Can-Ru Yeou, SiS).
+ 467. Change references to the Mesa source directory in Imakefiles to
+ $(MESASRCDIR) (David Dawes).
+ 467. Fix a typo an error in the example code in the XtAppAddInput man page
+ (#4070, Carlos A. M. dos Santos).
+ 466. Imstt driver updates, including moving from cfb to fb, fixing fbdev
+ bugs and an accel blit bug, and a general cleanup (#4068, Ani Joshi).
+ 465. Fix the installation path of the xditview bitmap (#4067,
+ Carlos A. M. dos Santos).
+ 464. Some xf86cfg fixes (#4065, 4068, Paulo Cesar Pereira de Andrade).
+ 463. Fix some syntax errors in xkb config files and a size mismatch between
+ two xkbcomp structures that were being masked one to another (#4063,
+ Paulo Cesar Pereira de Andrade).
+ 462. Fix a problem where the xkbcomp would read junk data from the server
+ if SmartScheduleTimer() is called while writing to it (#4063,
+ Paulo Cesar Pereira de Andrade).
+ 461. Increase MAXVISUALSPERDEPTH further for Xnest so that it will work
+ with GLX (#4062, Harald Koenig).
+ 460. Xv overlay support for the Intel i810 chipset (#4061, Jonathan Bian,
+ Matthew J Sottek, Intel).
+ 459. Penmount touch panel input driver (#4060, Mayk Langer).
+ 458. Fix the r128 SaveScreen function so that it doesn't touch the hardware
+ when switched away (#4056, Benjamin Herrenschmidt).
+ 457. Add support to xman for FreeBSD's /etc/manpath.config (#4055,
+ Carlos A M dos Santos).
+ 456. Update Xinstall.sh to handle the different behaviour of ldconfig
+ 2.1.3 (used on SuSE 6.4) (#4058, Michael Rohleder).
+ 455. Fix incorrect use of xf86{En,Dis}ableInterrupts() for ppc
+ (Marc La France).
+ 454. Add man pages for pcitweak and scanpci (David Dawes).
+ 453. Fix problems with xkb "Internet" keyboard mapping support (David Dawes).
+ 452. A few corrections to PIO and MMIO definitions affecting mips, arm32,
+ powerpc architectures and QNX4 (Marc La France).
+ 451. Minor int10 and VBE fixups (Marc La France).
+ 450. For frequency options, don't clobber the old value before verifying the
+ new one is valid (Marc La France).
+ 449. Ensure xf86_ansic.h is always #include'd before compiler.h in code
+ that can be compiled as a module (even for the static server). Generate
+ an error if not (Marc La France).
+ 448. Make linux/int10 module complain when SystemV IPC isn't configured
+ into the kernel (Marc La France).
+ 447. Add new offscreen frame bufffer manager functions for managing linear
+ offscreen areas (Mark Vojkovich).
+ 446. int10 fixes and remove checksum verification (Marc La France).
+ 445. More message formatting changes for DDC (Marc La France).
+ 444. Add missing xf86write symbol (Marc La France).
+ 443. Fix open(, O_CREAT) emulation (Marc La France).
+ 442. Fix Trident Cyber9320 > 8bpp modes (Alan Hourihane).
+ 441. Allow memory mapping during probe phase (Marc La France).
+ 440. Clean up os-support/dgux/dgux_video.c (Marc La France).
+ 439. Fix int10 bug that prevented recognition of video BIOS'es that are part
+ of the system BIOS (Marc La France).
+ 438. MGA driver warning fix (Marc La France).
+ 437. An update to change 425 (Marc La France).
+ 436. More EDID formatting changes (Marc La France).
+ 435. Fix bug that caused the relocation of PCI I/O bases assigned to multiples
+ of 0x0100 (but not 0x0400) by the system BIOS (Marc La France).
+ 434. Add ATI driver to Alpha, and experimentally, to ppc architectures. ppc
+ support is still known to be incomplete (Marc La France).
+ 433. For IA64, compile everything, except PEX, that is also compiled for IA32
+ (Marc La France).
+ 432. Fix Cyrix driver for -configure (Alan Hourihane).
+ 431. Fix Glint PM3 memory detect when only 1MB of videoram (Alan Hourihane).
+ 430. Fix DAC colour problem and blank out issue in glint driver
+ (Alan Hourihane).
+ 429. Add missing clock values to the trident driver (Alan Hourihane).
+ 428. Fix Glint driver's SaveScreen function (#4057, Michel Danzer).
+ 427. Convert MGA driver to use fb instead of cfb (Mark Vojkovich).
+ 426. Rewrite MGA color expansion routines so that pci retries never occur
+ (Mark Vojkovich).
+ 425. Make ATI driver tolerate relocation of conflicting resources
+ (Marc La France).
+ 424. Make Mach64 FIFO handling available to GATOS (Marc La France).
+ 423. Fix bug in Mach64 scissor handling (Marc La France).
+ 422. Implement Mark Vojkovich's suggestions in the ATI driver
+ (LSB ordering of monochrome data and host transfer burst modes)
+ (Marc La France).
+ 421. More fixes to ATI DSP register calculation (Marc La France).
+ 420. ATI DGA support fixes for VGA Wonder capable adapters and the
+ setting of the DGA_CONCURRENT_ACCESS flag (Marc La France).
+ 419. Change imake to generate symbols for the GCC version used to
+ compile it (Marc La France).
+ 418. Fix xf1bpp/xf4bpp in trident driver and some planemask problems
+ (Alan Hourihane).
+
+XFree86 4.0.1 (1 July 2000)
+ 417. Update OpenBSD and NetBSD docs (#4053, Matthieu Herrb).
+ 416. Fix segfault when destroying a GLX context (Kevin Martin).
+ 415. Doc updates (Georgina Economou).
+ 414. Fix some palette and fbdev problems, and add a missing break to the
+ video memory type detection code for the r128 (#4043, Benjamin
+ Herrenschmidt).
+
+XFree86 4.0Z (30 June 2000)
+ 413. README updates (Georgina Economou).
+ 412. Add some SiS DRI code, but currently disabled because the X server
+ driver level support hasn't been integrated yet (Can-Ru Yeou, SiS).
+ 411. Remove the PPC-specific assembly for load/stores from the r128 driver,
+ and use the versions now provided in compiler.h, which are faster (#4051,
+ Ani Joshi).
+ 410. Fix the UTF-8 converters so that cut&paste works better in UTF-8 locales
+ (#4049, Bruno Haible).
+ 409. Complete the move of glx.h to xc/include/GL, and don't include
+ Xmd.h in glx.h (#4048, Brian Paul).
+ 408. Apm driver updates, including fixing 24/32 access, fixing an
+ initialization bug, and some code cleanups (#4047, Loic Grenie).
+ 407. Sparc/sbus updates: put sparcProm* in the correct header file, add
+ xf86SbusSetOsHwCursorCmap sbus layer interface, and export symbols for
+ this new interface and the sparcProm* interfaces in the loader (#4046,
+ Jakub Jelinek).
+ 406. Add cg3/cg14/tcx/bw2 drivers (sparc), and fix a few bugs in leo and
+ cg6 drivers. Build these driver, plus the ati and glint drivers
+ on Linux/sparc (#4046, Jakub Jelinek).
+ 405. Fix Elite3D detection (#4045, David S. Miller).
+ 404. Treat SBUS like ISA when assigning access control records, so now
+ multi-head, Xinerama, etc works with SBUS drivers (#4045,
+ David S. Miller).
+ 403. SDK install updates (#4044, David Bateman).
+ 402. Work around an odd problem with waitpid() in the code for auto-loading
+ DRM kernel modules on Linux (#4042, Brian Paul).
+ 401. Change the imake parameter for BSD/OS from BSD386Architecture to
+ BSDOSArchitecture (#4041, Kurt Lidl).
+ 400. Make the neomagic driver recognise the NM2380 chip, and treat it
+ exactly like a NM2360 (#4041, Kurt Lidl).
+ 399. Updates for compiling cleanly on BSD/OS 4.0.1, and to make the
+ BSD/OS support less i386-centric (#4041, Kurt Lidl).
+ 398. Disable SilkenMouse for the s3virge GX2 to avoid some lockup problems
+ (#4039, Kevin Brosius).
+ 397. Some mga DRI updates to improve stability (Jeff Hartmann).
+ 396. Fix some DRI offscreen memory calculations in the Matrox driver
+ (Mark Vojkovich).
+ 395. IA64 workarounds - should compile and run right out of the box now
+ (Mark Vojkovich).
+ 394. LBX, X-TrueType and Xnest warning fixes (Marc La France).
+ 393. Remove unused xf86MapDisplay() and xf86UnMapDisplay() os-support entry
+ points (Marc La France).
+
+XFree86 4.0g (26 June 2000)
+ 392. Fix a missing -I in sunffb/Imakefile (#4038, David S. Miller).
+ 391. Some -misc-fixed-* BDF font updates, primarily expanding the 7x13
+ set to include the same 8-bit variants as the 6x13 set, including
+ a new oblique/italic version (#4037, Markus Kuhn).
+ 390. Fix an endless loop in the UTF-8 converters (#4036, Bruno Haible).
+ 389. Straighten out xfindproxy exit codes to match success/failer status;
+ also change one instance where error message was printed to stdout
+ (#4035, Huver).
+ 388. With LBX enabled, the X server wasn't checking the proxy connection,
+ and so fails the connection request without calling InvalidHost()
+ (#4033, Huver).
+ 387. xfwp doProcessWritables() closes connection, but then proceeds
+ to reset client fd via FD_SET() (#4031, Huver).
+ 386. Don't build a non-DRI libOSMesa (#4029, Takaaki Nomura).
+ 385. Add generic DGA support to SiS driver (Alan Hourihane).
+ 384. Add more support structure for Alpha/DRI (not enabled yet though)
+ (Alan Hourihane).
+ 383. Fix glXDestroyContext bug that caused Q3A to use old clip rect info
+ when opening a new window (Kevin Martin).
+ 382. Fix R128 3D driver clear problem which caused R128Pro cards to lock
+ up, and fix dword count on ring-based vertex buffer code for PCI
+ R128 cards (Gareth Hughes).
+ 381. Possible fix for a problem introduced with item 332 that resulted
+ in the first screen's config file data being used for all screens
+ (Mark Vojkovich, David Dawes).
+ 380. Add an imake parameter NothingOutsideProjectRoot that turns off
+ installing links and config files, etc, outside of ProjectRoot
+ (David Dawes).
+ 379. Possible fix a problem with 'make install' on Linux when there is
+ already a /usr/include/GL directory (David Dawes).
+ 378. Fix a DGA-related crash when using multiple input devices with the
+ DGA extension disabled (Matthieu Herrb).
+
+XFree86 4.0f (23 June 2000)
+ 377. Suppress the use of a temporary directory to build man pages on
+ OpenBSD, which fixes problems with some external programs (#4028,
+ Matthieu Herrb).
+ 376. Allow some linux/mips settings in linux.cf to be overriden (#4026,
+ Guido Guenther).
+ 375. Synchronize the pointer state before checking it in xf86CheckButton()
+ (Paulo Cesar Pereira de Andrade).
+ 374. s3virge driver fixes for noise and console corruptionn on the GX2 and
+ MX (but they're commented out for the MX because it hasn't been tested
+ yet) (#4027, Kevin Brosius).
+ 373. Fixes for lib/GL Imakefiles (Marc La France).
+ 372. Update DRI drivers sunffb,mga,i810,glint,r128,tdfx to check for
+ DRIQueryVersion, overcomes an older libdri issue (Alan Hourihane).
+ 371. Change tdfx driver to use fb instead of cfb (Alan Hourihane).
+ 370. Make using libpthread optional for OpenBSD 2.7.
+ 369. Fix a problem when calling XF86VidModeSwitchMode() when the switched
+ screen is different from the one that has the pointer (#4024,
+ Paulo Cesar Pereira de Andrade).
+ 368. Bindist files for Linux/mips (#4023, Guido Guenther).
+ 367. Allow XFree86 to compile on NetBSD-current and 1.5_ALPHA, which
+ no longer use the pcvt console, but have a compatibility mode for it
+ in wscons (#4021, Bernd Ernesti).
+ 366. Add support for the iso8859-13 charset to Xlib (#4020, Bruno Haible).
+ 365. Add ISO-8859-13 support to the UTF-8 converters, which is needed for
+ Lithuanian UTF-8 locales (#4019, Bruno Haible).
+ 364. Fix three bugs in the UTF-8 converters:
+ - In an UTF-8 locale, keyboard input coming in as UTF-8 would not be
+ accepted.
+ - Incorrect handling of the "end of string" and "invalid byte sequence"
+ situations.
+ - A bug on platforms with sizeof(wchar_t) != sizeof(int).
+ (#4018, Bruno Haible).
+ 363. Enable building DRI support for FreeBSD 4.1 and higher.
+ 362. Don't try to use kldload() on FreeBSD versions prior to 3.0 (#4016,
+ Takaaki Nomura).
+ 361. Some sunffb cleanups (#4015, David S. Miller).
+ 360. Add DRI drawable index callback (#4015, David S. Miller).
+ 359. Fix -configure option to print out fatal message and abort gracefully
+ when pci data isn't entered into xf86PciInfo.h (Alan Hourihane).
+ 358. Add generic DGA support to NeoMagic (not tested) (Alan Hourihane).
+ 357. Add generic DGA support to i810 (not tested) (Alan Hourihane).
+ 356. Fix GCC 2.96 complaints in big font extension and imstt driver
+ (Steven King).
+ 355. Fix remaining DRI III compile glitches (Marc La France).
+ 354. Fix long standing bug with 3Dfx driver when DRI module isn't loaded.
+ It complained about unresolved symbol called after 'Textures memory'
+ output (Alan Hourihane).
+
+XFree86 4.0e (20 June 2000)
+ 353. Fix a couple of acceleration problems in glint driver (Alan Hourihane).
+ 352. Don't attempt to build the Sparc DRI drivers on ix86, and vice versa
+ (David Dawes).
+ 351. Fix a lib/GL build problem when the DRI isn't enabled (#4014,
+ Nicholas J Brealey).
+ 350. Fix location of dri module links in the xc/exports directory of the
+ build tree.
+ 349. Replace LoaderSymbol() with xf86LoaderCheckSymbol() in drivers.
+ 348. Disable SmartScheduler on LynxOS 3.1 (#4013, Thomas Mueller).
+ 347. Update Japanese PC98 docs (#4012, Isao Ohishi, Takaaki Nomura).
+ 346. Add some S3/Diamond PCI IDs (#4011, Werner Leeb).
+ 345. Update sbus support for recent bus infrastructure changes
+ (David S. Miller)
+ 344. Check for NULL pointers from item 332 (Alan Hourihane).
+ 343. Xf86cfg updates (#4010, Paulo Cesar Pereira de Andrade).
+ 342. Fix threads support in OpenBSD 2.7 and above (#4006, 4009,
+ Carlos A M dos Santos).
+ 341. UCS misc BDF fonts updates, including new oblique/italic versions
+ (6x13O, 8x13O), Korean font covering all Hangul symbols (18x18ko)
+ and many additional autogenerated ISO 8859 fonts to cover with
+ 6x13 and 8x13 all the locale encodings suggested by the Li18nux
+ specification (#4007, Markus Kuhn).
+ 340. Add Linux/Sparc support for the DRI, and a DRI driver for Sun
+ Creator3D hardware (#4004).
+ 339. Fix DRI BusIDString length usage (#4003, David S. Miller).
+ 338. Xterm patch #139 (#4002, Thomas Dickey).
+ 337. Make the use of GlxDefines for libGL independent of BuildXF86DRI (#4001,
+ David S. Miller).
+ 336. Fix i810 build warnings (#4000, Jarno Paananen).
+ 335. Fix an i810 build problem (Keith Whitwell, #4000, Jarno Paananen).
+ 334. Fix a multihead problem with the mga driver (Mark Vojkovich).
+ 333. Add support to the i810 driver for the i815 (Keith Whitwell).
+ 332. Add infrastructure support for cards with multiple CRTCs (screens)
+ per accelerator (PCI entity) (Jeff Hartmann and David Dawes).
+ 331. Fix some Mesa problems (Brian Paul).
+ 330. Rework patch for mapping drmAddMap on Alpha platforms
+ (Bruce Stockwell/Compaq, Alan Hourihane).
+ 329. Don't build Debuggable Library on Linux for the release (Alan Hourihane).
+ 328. Don't build lib/GL/mesa/src/X86 on Alpha systems (Alan Hourihane).
+ 327. xdm warning fix (Marc La France).
+ 326. Make x11perf die gracefully when display cannot be opened
+ (Marc La France).
+ 325. Fix rendition driver compile glitch (Marc La France).
+ 324. #ifdef out glitch in glint driver (Marc La France).
+ 323. Preliminary DGA support in ATI driver (Marc La France).
+ 322. Minor update to DESIGN and Status documents (Marc La France).
+ 321. Fix DGA's reporting of vertical refresh rates to clients
+ (Marc La France).
+ 320. Make driver-provided Sync(), SetViewport() and GetViewport() DGA
+ callbacks optional (Marc La France).
+ 319. Fix XKB compile glitch (Marc La France).
+ 318. Make imstt driver compile (Marc La France).
+
+XFree86 4.0d (16 June 2000)
+ 317. Fix a typo in the xfree86 xkb keycodes file (#3999, Matthieu Herrb).
+ 316. Fix some build problems when the DRI is not enabled (#3998,
+ Matthieu Herrb).
+ 315. Add missing Linux/mips config changes (#3997, Guido Guenther).
+ 314. Fix for libICE DOS (Keith Packard).
+ 313. FontInfo.c (lib/X11) needs to be built with the bigfont defines (#3996,
+ Paulo Cesar Pereira de Andrade).
+ 312. Disable the smart scheduler for SVR4.0 (based on #3916, Takaaki Nomura).
+ 311. Add a check for PS/2 mice on Linux for the X server's -configure
+ option (#3991, Paulo Cesar Pereira de Andrade).
+ 310. Fix a problem mouse driver button flush was causing with Xaw menus
+ (#3991, Paulo Cesar Pereira de Andrade, David Dawes).
+ 309. Modify scanpci to print out card/subsys information, and add a few
+ more entries to the pci data (David Dawes).
+ 308. Fix r128_cursor.c build problem for big-endian machines (#3989,
+ Thomas Mueller, #3994, Ani Joshi).
+ 307. Update LynxOS docs (#3989, Thomas Mueller).
+ 306. Add a few PPC compiler internal symbols to the loader's export list
+ (#3989, Thomas Mueller).
+ 305. Add crypt support to xdm for LynxOS (#3989, Thomas Mueller).
+ 304. Add preliminary build support for LynxOS 3.1.0 (#3989, Thomas Mueller).
+ 303. Add keysyms to complete the set for the Compaq SK2850 keyboard and
+ the Microsoft Natural Keyboard Pro (David Dawes).
+ 302. Add new keysyms for PDAs (#3985, 3987, 3988, Jim Gettys).
+ 301. Xterm patch #138 (#3986, Thomas Dickey).
+ 300. DRI megapatch III. This includes DRI enhancements, 3dfx fixes and
+ updates, updates Mesa to the latest version, adds Intel i810, Matrox
+ G200/G400, ATI Rage 128 and 3dfx Voodoo5 3D support, adds ATI Rage
+ Mobility 2D support (disabled by default). (Precision Insight and
+ VA Linux Systems).
+ 299. Add a function to the X server that performs the same checks on
+ command line arguments and environment variables as the Xwrapper
+ from 3.3.x. This function is called very early from main()
+ (David Dawes).
+ 298. Fix for some Xlib problems that can show up when connecting to
+ a rogue server (Keith Packard, with analysis by Chris Evans).
+ 297. Increase MAXVISUALSPERDEPTH to 64 for Xnest so that it can handle
+ GLX's visuals.
+ 296. Add a Macedonian xkb symbols file (#A.96, Zlatko Trajceski).
+ 295. Fix a buffer overflow with the -xkbmap X server flag (#A.91,
+ Trevor Johnson).
+ 294. Fix a rectangle fill problem that shows up with an AGP SiS 6326
+ (A.81, A.83, Milivoj Savin).
+ 293. Fix a problem in xcalc when the current locale uses a character
+ other than "." for the decimal point (#A.63, Stanislav Brabec).
+ 292. Allow some more parameters in linux.cf and lnxLib.rules to be
+ redefined (#A.60, Stanislav Brabec).
+ 291. Fix a typo in lib/Xss/Imakefile (#A.59, Stanislav Brabec).
+ 290. Fix an xfs crash that shows up when many clients connect (#A.48,
+ Remy Card).
+ 289. Fix some man page build problems (#A.43, Ian Collier).
+ 288. Fix xedit core dump (in Xaw) on Solaris, related to the bsearch()
+ usage (#A.42, Ian Collier).
+ 287. Add xkb mappings for the keycodes generated by the SysRq and Break
+ keys, which are different from the keycodes generated when used as
+ PrtScn and Pause (#A.29, Eric W. Biederman).
+ 286. Fix problems when building on Solaris 2.6/sparc and Irix 6.5.5
+ (#A.21, A.28, Sullivan N. Beck).
+ 285. Fix a core dump in fstobdf when using 16 bit fonts (#A.25,
+ Morten Storgaard Nielsen).
+ 284. Clean up some of the messages printed by the neomagic driver
+ (David Dawes).
+ 283. Add support for the 2360 (256ZX) to the neomagic driver, and enable
+ acceleration at depth 24 for this chip (#A.23, Gregory M Pomerantz).
+ 282. Adjust the bigfont extension to not use SHM segments for fonts with
+ a small glyph metric size, and fix a build problem on systems without
+ shared memory (#3984, Bruno Haible).
+ 281. Status doc updates (#A.9, Chris Smith, A.80, Ferenc Acs).
+ 280. Fix memleak warning when doing realloc(NULL, size) (#A.7,
+ Charles G Waldman).
+ 279. xf86cfg fixes (#3983, Paulo Cesar Pereira de Andrade).
+ 278. Add SilkenMouse support to the s3virge driver (#3982, Kevin Brosius).
+ 277. Update Xv support in the glint driver and add the XvPutImage function
+ for the Permedia 2 (#3926, Michael Schimek).
+
+XFree86 4.0c (13 June 2000)
+ 276. Xterm patch #137 (#3976, Thomas Dickey).
+ 275. Doc update for the chips driver (#3981, David Bateman).
+ 274. Fix some problems building with the SDK (#3981, David Bateman).
+ 273. Fix comments for the address matching algorithm in
+ XauGetAuthByAddr() and XauGetBestAuthByAddr() (Keith Packard, based on
+ #3939, Peter Runestig).
+ 272. Handle setting SharedLibXdmGreet in the OS imake config files rather
+ than having a complicated expression in the xdm Imakefile (#3980,
+ Matthieu Herrb).
+ 271. xdm updates from the OpenBSD team, including:
+ - support for Kerberos IV authentication [enabled only in OpenBSD.cf,
+ but could be enabled for other systems by setting HasdKrbIV]
+ - use the arc4random(4) random number generator on OpenBSD
+ - add a new resource "allowRootLogin", which can be used to disable
+ root logins through xdm
+ - log failed logins to syslogd [OpenBSD only, but could be enabled on
+ other systems]
+ - verify that the shell is valid using /etc/shells [OpenBSD only]
+ - verify that the account hasn't expired [OpenBSD only, but could be
+ enabled on other system that use the same passwd aging structure]
+ (#3948, 3980, OpenBSD team, Matthieu Herrb).
+ 270. Big/little endian MMIO_XX macros for ppc, and also PIO macros check
+ that IOBase is mmapped before doing any accesses (#3979,
+ Kostas Gewrgiou).
+ 269. Preliminary driver for Integrated Micro Solutions TwinTurbo128
+ (imstt) (#3978, Ani Joshi).
+ 268. Fix broken czsk keymaps, and let the user directly select either
+ Czech or Slovak keyboard in xf86config (#3975, Kamil Toman).
+ 267. Implement DGA2 support with depth switching for ATI Rage 128 cards
+ (#3974, Ove Kaaven).
+ 266. Recent versions of FreeBSD have the xpg4 library folded into libc.
+ 265. xf86cfg updates (#3973, Paulo Cesar Pereira de Andrade).
+ 264. Xaw bug fixes (#3973, Paulo Cesar Pereira de Andrade).
+ 263. Fix M-d and M-h key bindings in the Xaw Text widget (#A.87,
+ Jonathan Kamens).
+ 262. Fix some Xaw memory errors (#A.79, Jonathan Kamens).
+ 261. Xman fixes/updates, including:
+ - Fix a core dump in fclose()
+ - Append the default search path when MANPATH ends in a ':'
+ - Understand man pages that have a single line with a .so directive
+ (#3969, 3973, Paulo Cesar Pereira de Andrade).
+ 260. Resync nls Compose file with 3.3.6 (#3964, 3973,
+ Paulo Cesar Pereira de Andrade).
+ 259. Fix moving the pointer between screens when using MouseKeys, and fix
+ some bugs in the xkbfile code (#3963, 3973,
+ Paulo Cesar Pereira de Andrade).
+ 258. Fix XC-SECURITY security bug (#3954, 3973,
+ Paulo Cesar Pereira de Andrade).
+ 257. Bigfont bug fix, which stops cvsup crashing (#3954, 3973,
+ Paulo Cesar Pereira de Andrade).
+ 256. Replace some bitswapping assembler code in XAA with faster C code
+ (Mark Vojkovich).
+ 255. Rendition driver updates, including:
+ - add DirectColor support
+ - add SilkenMouse support
+ - documentation updates
+ - some code cleanups
+ (#3972, Dejan Ilic).
+ 254. For v4l: don't advertise the XV_VOLUME attr if we're only going to
+ return BadMatch on use (#3968, David Woodhouse).
+ 253. Modify the I2C delay routine to use xf86getsecs (gettimeofday) instead
+ of an uncalibrated loop (#3967, Andrew Aitchison).
+ 252. Add some PCI ids to xf86PciInfo.h, and include some instructions
+ about how to add new PCI data (#3966, Kevin Brosius).
+ 251. Update documentation for Japanese PC98 (#3965, Satoshi Kimura,
+ Akio Morita, Takaaki Nomura).
+ 250. XIM patch (imInt.c) (#3962, Fuminori Hirayama).
+ 249. Xterm patch #136 (#3960, Thomas Dickey).
+ 248. Fix Imake.rules for building on Solaris 7 with gcc-2.95.2 (#3958,
+ Nicholas Brealey).
+ 247. Add basic support for the Linux/mips and mipsel architecture (#3957,
+ 3970, Guido Guenther).
+ 246. Disable reading the BIOS in the int10 code for Japanese PC98 (#3959,
+ Isao Ohishi).
+ 245. Add a "NoPciBurst" option to the Trident drive for Japanese PC98
+ cards with the TGUi968x chip (#3955, Akio Morita).
+ 244. Xterm patch #135 (#3951, Thomas Dickey).
+ 243. Fbdev driver fix (#3953, Ani Joshi).
+ 242. Xterm patch #134 (#3949, Thomas Dickey).
+ 241. Import the mktemp() usage fixes for imake from the 3.3.x branch
+ (#3947, Matthieu Herrb).
+ 240. Rman updates, including:
+ - minor reformating (make { and } match)
+ - fix logic for parsing comments in man pages, which allows the
+ copyrights to appear in the output html
+ - a few changes based on weblint and tidy
+ (#3946, Thomas Dickey).
+ 239. Fix incorrect type for vgaIOBase in the neomagic driver (#3944,
+ Ani Joshi).
+ 238. Fix an Xlib build problem when the big-font extension is disabled
+ (#3945, Mutsumi Ishikawa).
+ 237. Xv v4l attribute handling bug fix (#3928, Gerd Knorr).
+ 236. Fix some problems with the locale-dependent input processing in Xlib
+ by:
+ - removing unneeded to/from CTEXT conversion for characters coming
+ from keyboard input
+ - move "locale_code" and "keyboard charset" searching to the
+ initialization step (XIM creation)
+ - Fix some inconsistencies between memory allocation and freeing
+ in XIM objects (imLcIm.c imThaiIm.c)
+ (#3927, Ivan Pascal).
+ 235. Update support for Appian J2000 board with dual PM3 chips, and
+ add partial acceleration (#3977, Sven Luther).
+ 234. Only claim other devices on the same card when gamma chip is used
+ in the glint driver (Alan Hourihane).
+ 233. Separate offscreen memory manager API from implementation to facilitate
+ driver replacement of the default manager (Mark Vojkovich).
+ 232. Add Option "TexturedVideo" to have the Matrox driver optionally use
+ YUV textures instead of the video overlay for XvImage support
+ (Mark Vojkovich).
+ 232. Add Xv functions for allocating/freeing XvVideoAdaptorRecs to shield
+ drivers from structure size changes (Mark Vojkovich).
+ 231. Have XDGAQueryModes return no modes as being available instead of an
+ error when DGA is not supported on the particular screen (Mark Vojkovich).
+ 230. Fix xdm when PAM is not available (Marc La France).
+ 229. Fix int10 bug on non-PC platforms (Marc La France).
+ 228. Finish prototyping of DPS libraries. Fix argument promotions in
+ pswrap. Fix yytext portability problem. Fix non-standard format
+ in pswrap (#3941, #3942, Nomura Takaaki, Thomas Dickey).
+ 227. Fixed FP chipset handling in Trident driver. LCD-CRT switching
+ should work now (Egbert Eich).
+ 226. Modified device detection on PCI bus to handle Host-to-PCI bridges
+ better (Egbert Eich).
+ 225. Fix i810 driver so it advertises 32bpp pixmaps in depth 24 like the
+ rest of the drivers do (Mark Vojkovich).
+ 224. Added a call ioperm() to to allow vm86 to execute in/out calls
+ directly to avoid problems with certain notebook bioses (Egbert Eich).
+ 223. Fixed mouse driver to flush pending button press events on
+ protocol change (Egbert Eich).
+ 222. Fixed DDC support and sync flags handling in trident driver
+ (Egbert Eich).
+ 221. Added PAM support to xdm, ANSIfied prototypes (Werner Fink).
+ 220. Added ServerFlag to force the use of OS PCI config space
+ support (Egbert Eich).
+ 219. Fix Xv DDX stop overlaid stills/images when XvStopVideo() is called
+ (Mark Vojkovich).
+ 218. Have the Xv DDX send clients exposure events when windows containing
+ overlaid data, which isn't actually in the framebuffer, are moved
+ (Mark Vojkovich).
+ 217. Fix ordering of calling DDC probe in VBE to respect NoDDC options
+ (Alan Hourihane).
+ 216. Fix VBE initialization in trident driver for DDC (Alan Hourihane).
+ 215. Fix a typo in the glint driver (#3943, Michael Schimek).
+ 214. Fix multithread bug in Xlib big font support (Mark Vojkovich).
+ 213. Fix a window class initialization problem in Xinerama (Mark Vojkovich).
+ 212. Fix some multithreading related problems in the Xv client library
+ (Mark Vojkovich).
+
+XFree86 4.0b (23 May 2000)
+ 211. Add support to the sunffb driver for multiple visuals on the same screen,
+ overlays, double buffering and some other niceties (#3938,
+ David S. Miller, Jakub Jelinek).
+ 210. Make the modifier setting on Sun keyboards match what XFree86 expects
+ (#3937, Jakub Jelinek).
+ 209. Add unaccelerated support for the Sun CG6 (#3935, Jakub Jelinek).
+ 208. Make the -configure option work with SBUS/UPA drivers, fix some
+ bugs in the sbus layer, add support for ioctl based colormap setting,
+ and fix leds on Sun keyboards (#3934, Jakub Jelinek).
+ 207. Fix a parallel build problem in lib/dps (#3932, H. J. Lu).
+ 206. Fix some build problems that show up with LynxOS x86 and PowerPC (#3929,
+ Thomas Mueller).
+ 205. Fix documentation files for the mutouch and elographics drivers,
+ and build these drivers by default (#3935, Patrick Lecoanet).
+ 204. Make the dga2 library use the device name provide by the driver rather
+ than always using the default (3924, David S. Miller).
+ 203. Fix a problem with the internal xalloc that shows up on Sparc (#3923,
+ David S. Miller).
+ 202. Fix a GLX visual problem that causes a crash at server shutdown
+ (#3922, David S. Miller).
+ 201. 8+32 framebuffer for hardware that uses window IDs (David S. Miller).
+ 200. Fix a memory allocation in lbxproxy that can cause it to crash at
+ startup (#3921, Peter Runestig, #A.46, Rob Clark).
+ 199. Fix a problem with imake's handling of DefaultGccIncludeDir (#3920,
+ Peter Runestig, #A.64, Stanislav Brabec).
+ 198. lib/X11/imInt.c fix from the OpenMotif release notes (#3919).
+ 197. Prototype and fix almost all compiler warnings fot he dps library
+ and the related pswrap program (#3912, Thomas Dickey).
+ 196. Fix for x-tt font cache corruption (#3911, H. J. Lu).
+ 195. Ansi prototypes for the lbxusilt library and Xserver/lbx directory
+ (#3908, Matthieu Herrb).
+ 194. Fix some bugs in the cirrus lg driver (#3900, Itai Nahshon).
+ 193. Accelerated driver for Sun Leo/ZX cards (#3899, 3936, Jakub Jelinek).
+ 192. Fully accelerated driver for Sun FFB and AFB chips (#3898,
+ Jakub Jelinek).
+ 191. Generic SBUS and UPA support for XFree86 (#3897, Jakub Jelinek).
+ 190. Fix building xf86cfg on systems where libxpm isn't linked in
+ implicitly (#3903, Matthieu Herrb).
+ 189. Update the fbdevhw stubs for an interface change (#3902, Matthieu Herrb,
+ #3910, Bernd Ernesti).
+ 188. Simplify the platform defines in servermd.h to make them more hardware
+ dependent than OS dependent (#3913, Kurt Lidl).
+ 187. Fix a bug in the search/replace dialog in the Xaw text widget (#3896,
+ Paulo Cesar Pereira de Andrade).
+ 186. Xterm patch #133 (#3894, Thomas Dickey).
+ 185. Fixes for the Xaw TipWidget (#3893, Paulo Cesar Pereira de Andrade).
+ 184. Change CTEXT from/to converters to allow processing of "C1" codes
+ (0x80-0x9f) as ordinary characters for "non-standard" encodings
+ (such as UTF-8) (#3891, Ivan Pascal).
+ 183. Add "software" per-key auto-repeat disabling (#3889, Ivan Pascal).
+ 182. Refix fog.c build problem on Alpha (#3888, Dave Gilbert).
+ 181. Add some new things for the VidMode interface in xf86cfg (#3877,
+ Paulo Cesar Pereira de Andrade).
+ 180. Rework most of the look and feel of xf86cfg, and fix some bugs (#3877,
+ 3886, 3892, Paulo Cesar Pereira de Andrade).
+ 179. Add a ProjectRoot to Xaw rather than hard-coding it, so that the
+ pixmap code can find pixmaps and bitmaps on non-standard installations
+ (#3877, Paulo Cesar Pereira de Andrade).
+ 178. Fix a bug in the DRI section parsing (David Dawes).
+ 177. Add support for building shared libraries on BSD/OS (#3876, Kurt Lidl).
+ 176. Add imake support for automatically determining the version for BSD/OS,
+ and update bsdi.cf for the features relevant to the different versions
+ (#3876, 3940, Kurt Lidl).
+ 175. Xterm patch #132 (#3874, Thomas Dickey).
+ 174. Fix rman-related build problems when building external applications
+ (#3869, Matthieu Herrb, #3890, H. J. Lu).
+ 173. Fix a typo in OpenBSD.cf (#3867, Matthieu Herrb).
+ 172. Fix some build warnings (#3864, Ani Joshi).
+ 171. Fix some BSDI typos in hw/sun (#3862, Kurt Lidl).
+ 170. Fix r128 palette save/restore when VT switching (#3861, Ani Joshi).
+ 169. Disable the X server's internal malloc by default (#3860, Keith Packard).
+ 168. Make xdpyinfo and xf86dga fail gracefully when DGA is not enabled
+ in the driver, but the extension is enabled (#3870, Andrew Aitchison).
+ 167. Fix too many xfree calls in lbxproxy (#3907, Matthieu Herrb).
+ 166. Fix uninitialized fd_set mask in lbxproxy (#3906, Matthieu Herrb).
+ 165. Fix typo when printing HSync frequency when not a range
+ (#3895, Andrew Aitchison).
+ 164. Fix a window unmapping bug in the mioverlay code (Mark Vojkovich).
+ 163. Attempt to improve memory detection reliability in the Matrox driver
+ (Mark Vojkovich).
+ 162. Fix possible SEGV in generic int10 module (Marc La France).
+ 161. Fix *BSD aperture driver to allow for int10 (Bernd Ernesti,
+ Marc La France).
+ 160. Fix vesafb restore problem in ATI driver (Marc La France).
+ 159. Fix a few more compilation glitches (Marc La France).
+ 158. Fix DRM for gamma for single and dual MX chips (Alan Hourihane).
+ 157. Fix Mesa for single and dual MX chips (Alan Hourihane).
+ 156. Fix Mesa for multiple screen widths (Alan Hourihane).
+ 155. Add DGA support to the glint driver.
+ - Fix initialization of DRI when using single or dual MX's.
+ - Fix register resources.
+ - Turn on more acceleration for DualMX boards.
+ - Fix DualMX boards displaywidth problems at >640 widths.
+ - Fix depth15/16 for PM2v and PM3 chipsets (Alan Hourihane).
+ 154. Use MMIO_xx macros in glint driver (#3904, Michel Danzer).
+ 153. Fix lib/GL/mesa/src/X86/Imakefile for m4 (Alan Hourihane).
+ 152. Fix m4 rules in Imake.tmpl (Alan Hourihane).
+ 151. ATI documentation update (Marc La France).
+ 150. Disable debugging messages from XF86-Misc extension (Marc La France).
+ 149. Ensure XAA always respects user options that disable subsets of its
+ primitives (Marc La France).
+ 148. Bug fix in XAA's CPU-to-screen colour expansion (Marc La France).
+ 147. Finish off XAA's CPU-to-screen colour expansion for 24bpp
+ (Marc La France).
+ 146. When matching adapters to XF86Config sections, the ATI driver will now
+ look at the primary adapter before any other non-primary PCI adapters
+ (Marc La France).
+ 145. Ensure Mach64 acceleration is disabled when using the VGA CRTC
+ (Marc La France).
+ 144. Set a Mach64's scaler/overlay clock divider in preparation for a GATOS
+ merge (Marc La France).
+ 143. Make VBE use its own option instead of DDC's (a consequence of
+ re-entrancy) (Marc La France).
+ 142. Make option processing re-entrant in DDC, int10, VBE and XAA modules, and
+ in the common layer (Marc La France).
+ 141. Add Permedia3 support to the glint driver (Sven Luther).
+ 140. Fix XvPutImage in the client libs so that it can use the BIG-REQUESTS
+ extension (Mark Vojkovich).
+ 139. Fixed xf4bpp for devPrivates in PixmapRec. (Egbert Eich).
+ 138. Fixed laguna driver to map FB after the video RAM size is known
+ (Egbert Eich).
+ 137. Fixed xdm to give up to respawn Xservers if the server crashes
+ more than once within 60 seconds (Egbert Eich).
+ 136. Added VGA default clock option to generic driver (Egbert Eich).
+ 135. Fixed CyberShadow option in Trident driver (Egbert Eich).
+ 134. Fix bug where the cursor is not put back after a failed DGA mode
+ initialization attempt (Mark Vojkovich).
+ 133. Add a missing symbol "AllocateColormapPrivateIndex" (Mark Vojkovich).
+ 132. Remove Intel 440BX-specific resources from os-support layer
+ (Marc La France).
+ 131. Change ATI driver to mark VGA resources as unused in operating state when
+ appropriate (Marc La France).
+ 130. Fix bug in the generation of default screen layout (Marc La France).
+ 129. Include all resource attributes when printing them (Marc La France).
+ 128. Fix compiled-in input driver list (Marc La France).
+ 127. Allow driver access to resource manipulation functions (Marc La France).
+ 126. Fix a DGA 2.0 crash that happened when bogus mode numbers were sent
+ by the client (Lionel Ulmer).
+ 125. Make a recent shm pixmap fix Xinerama aware (Mark Vojkovich).
+ 124. Fix mode setting bug in ATI driver (Marc La France).
+ 123. Add int10, DDC & VBE support to ATI driver
+ (Andrew C Aitchison, Marc La France).
+ 122. Allow driver to supply DDC module to VBE (Marc La France).
+ 121. Attempt to fix cyrix driver (untested). (Egbert Eich)
+ 120. Added support for 'inactive' devices. (Egbert Eich)
+ 119. Fixed xf86misc extensions. (Egbert Eich)
+ 118. Fixed design of xf86SetAccessFuncs(). Now all old access funcs
+ are returned if the driver asks for them not only the one
+ that is used in OPERATING state. (Egbert Eich)
+ 117. Added a function LoadDrvSubModule() to allow drivers to load
+ sub modules before a screen is allocated. (Egbert Eich)
+ 116. Fixed lndir to handle trailing '/' on path correctly. (Egbert Eich)
+ 115. Undefined i486/i586/i686 in Imake.cf. cpp might predefine
+ them which might cause undesirable results. (Egbert Eich)
+ 114. Updated x86emu. (Egbert Eich)
+ 113. Fixed problems with xf86RegisterResources() if preregistered
+ resources are not marked ResBios. Identical ranges are not considered
+ to conflict with each other. (Egbert Eich)
+ 112. Improved DDC information printout. (Egbert Eich)
+ 111. Added NODDC options to vbe. (Egbert Eich)
+ 110. Added fixes for Lynx OS. (Egbert Eich)
+ Changed int10 code to always map/allocate entire 1Meg. (Egbert Eich)
+ 109. Let int10 code try harder to locate a video bios to work
+ around some system bios bugs. (Holger Veit, Egbert Eich)
+ 108. Modified fbdevProbe() to return the name string representing
+ the chipset. (Egbert Eich)
+ 107. Minor fixes to i810 driver (Egbert Eich)
+ 106. Fixed format of float numbers in C&T driver. (Jens Taprogge)
+ 105. Added support for the NeoMagic 2360. (Gregory Pomerantz)
+ 104. Add an xf86UnloadSubModule() entry (temporarily disabled)
+ (Marc La France).
+ 103. Fix missing symbol "ServerGrabCallback" (Mark Vojkovich).
+ 102. Fix XAA problems with CPU-to-screen colour expansion (Marc La France).
+ 101. For panel support in the ATI driver, add an entry to the monitor
+ section's mode list for the panel's native resolution (Marc La France).
+ 100. Fix depth24 acceleration problems with 300SX (Alan Hourihane).
+ 99. Update glint driver for fb24_32 and ensure memset used in fb is
+ xf86memset when using loader (Alan Hourihane).
+ 98. By default, limit ATI 3DRage LTPro's to 200 MHz, instead of 230 MHz
+ (Marc La France).
+ 97. Remove some leftover INTERNAL_VS_EXTERNAL_PADDING stuff from the
+ extensions (Mark Vojkovich).
+ 96. Fix a NonTE text bug in XAA where zero-height primitives could be passed
+ to the driver (Mark Vojkovich).
+ 95. Add CPU-to-screen colour expansion acceleration for Mach64's
+ (Kevin Martin, Marc La France).
+
+XFree86 4.0a (6 April 2000)
+ 94. Major OS/2 resync (#3859, Holger Veit).
+ 93. Fix some 'XFree86 -configure' problems when multiple cards (#3850,
+ Paulo Cesar Pereira de Andrade).
+ 92. New graphical config tool (xf86cfg) (#3850,
+ Paulo Cesar Pereira de Andrade).
+ 91. Fix a typo in Xinstall.sh that prevents moving config files to
+ /etc/X11 from being optional (#3858, Richard Gooch).
+ 90. Add lt_LT.ISO_8859-4 to locale.alias, and update the lt symbols for
+ xkb (#3857, Ricardas Cepas).
+ 89. Fix the return values of some "xkb action" filters (SetControls and
+ RedirectKey) (#3854, Ivan Pascal).
+ 88. Fix problems with using "radio group" number one in XKB keyboard
+ descriptions (#3853, Ivan Pascal).
+ 87. Fix MIT-SHM crash caused by incorrect reference tracking (#3851,
+ Keith Packard).
+ 86. Updates to allow a build on sparc-linux to succeed (#3849,
+ Jakub Jelinek).
+ 85. Fix GetImage in XY format in fb at 32bpp (#3848, Keith Packard).
+ 84. Add support for 24/32 fb/pixmap format conversion to fb (#3847,
+ Keith Packard).
+ 83. Update the r128 driver to use fb and fb24_32, and disable
+ transparency at 24bpp (#3846, Keith Packard).
+ 82. Let the server continue when a font path element in the default path
+ is found to be invalid (#3843, Keith Packard).
+ 81. Fix parsing of the Group keyword in the DRI section of the config file
+ (#3842, Stefan Dirsch, David Dawes).
+ 80. Add support for YUV422, YV12, RGB15 and RGB16 XvImages to the C&T driver
+ (#3840, David Bateman).
+ 79. Change the config file Xkb* option priority. Now, if XkbKeymap is
+ set it will be tried first. If a component is present it will override
+ components computed from ruls/module/layout/etc (#3839, Ivan Pascal).
+ 78. Fix an infinite loop problem that can show up in makedepend (#3838, A.10,
+ Jeremy Buhler).
+ 77. Fix Overlay support in the TI ramdac module (Alan Hourihane).
+ 76. Fix mixup between TVP3026/3030 ramdacs in the ramdac module
+ (Alan Hourihane).
+ 75. Increase usage of ReadPixmap within XAA (Mark Vojkovich).
+ 74. Allow the v4l driver to use offscreen YUV surfaces exported by the
+ chipset drivers (Gerd Knorr).
+ 73. Change xf86LoadModules() so that it doesn't quit at the first module
+ that fails to load (David Dawes).
+ 72. SIGIO doesn't work on Linux pipes, so diasble it for input devices
+ which are pipes (#3835, Keith Packard).
+ 71. Bring the SDK support up to date (#3834, David Bateman).
+ 70. Fix an Xlib problem that causes an application crash when inputting
+ cyrillic symbols with the koi8-r locale (and other locales with
+ long esc-sequences) (#3833, Ivan Pascal, #A.15, Serguei Poliakov, #A.34,
+ Stanislav Meduna, #A.40, Rimantas Plaipa, #A.74, Sergei Laskavy).
+ 69. Fixes for S3 Trio3D/2X:
+ - flickering for some cards (bad FIFO setting from bios).
+ - workaround for 8MB ram (ramdac can access only 4MB).
+ - adjust clock limits which have been too low.
+ (#3832, Harald Koenig).
+ 68. Fix v4l problem with a function being called after the module is
+ unloaded (#3831, gbritton@light-brigade.mit.edu).
+ 67. Fixes for the PPC icache flushing code (#3830, Kostas Gewrgiou).
+ 66. Fix for /tmp race installing man pages on OpenBSD (#3829,
+ Matthieu Herrb).
+ 65. Fix problems building the Xsun and XsunMono servers on
+ NetBSD-current/sparc (#3828, Matthieu Herrb).
+ 64. Add a comment to site.def about how to move the /etc/X11 contents to
+ a directory under ProjectRoot (#3827, R Horn).
+ 63. Fix an Xaw bug that shows up when usingn c-mode with xedit on Linux
+ (#3824, Paulo Cesar Pereira de Andrade).
+ 62. Enable devfs support for the v4l driver (based on #3823,
+ Christopher Sekiya).
+ 61. Update for README.FreeBSD (#3822, Kazutaka Yokota).
+ 60. Bump the video driver ABI minor version because of interface changes
+ (now 0.2).
+ 59. Disable SilkenMouse when IO/MEM resource sharing means that it cannot
+ be reliably used (#382o, Keith Packard and Egbert Eich).
+ 58. Fix DGA 1.0 compatibility for mouse events and SetViewport behaviour
+ (#3820, Keith Packard).
+ 57. Fix the Linux APM code so that the X server doesn't hang the machine
+ on suspend (#3820, Keith Packard and Egbert Eich).
+ 56. Fix problems that break Overlay support in the glint driver (#3818,
+ Michel Dänzer).
+ 55. Possible fix for AvailableOptions function and submodule loading
+ for the cirrus driver (David Dawes).
+ 54. Add an entry for the GeForce to the Cards file (#A.6, Oliver Lau).
+ 53. Fix pswrap build problem when cross compiling (#3815, Jim Gettys).
+ 52. Fix a typo in itsy.cf (#3814, Jim Gettys).
+ 51. SiS driver fixes:
+ - 630/540/300 display abnormal for all modes.
+ - 630/540/300 cannot enter true color modes.
+ - 530/620 1600x1200x8bpp display abnormal.
+ (#3807, Can-Ru Yeou, SiS).
+ 50. Fix a -configure crash in the nv driver (#3805, Jarno Paananen).
+ 49. Rendition driver updates:
+ - rename most v_ to verite_ to avoid potential namespace clashes.
+ - add support for VBE DDC and "XFree86 -configure".
+ - fix PROBE_DETECT issues.
+ - Replace a number of ErrorF's with xf86DrvMsg to reduce noise
+ when not requested. A number of debugging messages #ifdef'ed also.
+ - Option "MTRR" reenabled. Was disabled when acceleration was debugged.
+ (#3785, 3808, Dejan Ilic).
+ 48. S3virge driver updates:
+ - Revert WAITIDLE to cleanly abort a segfaulting imagewrite.
+ - Start of GX2 fixes.
+ - Add DDC monitor X -configure code.
+ - Update copyrights
+ (#3783, Kevin Brosius).
+ 47. Update XSetWMProperties() to set the WM_LOCALE_NAME property (#3780,
+ Peter Novodvorsky).
+ 46. Xterm patch #131 (#3777, Thomas Dickey).
+ 45. Add some xtest tests to cover some accelerated cases implemented by
+ XAA, and fix some Linux/glibc build problems (#3767, Rik Faith).
+ 44. Xineramification of XvImage support (Mark Vojkovich).
+ 43. By default, cache writes to selected Mach64 MMIO registers and allow this
+ cache to be disabled (Marc La France).
+ 42. Add detection of Rage128 Mobility to ATI driver (Marc La France).
+ 41. Fix a Xinerama GetImage bug that showed up in 24+32 (Mark Vojkovich).
+ 40. Fix XAA transparent blits. They are broken in 4.0 (Mark Vojkovich).
+ 39. Fix typo in mioverlay that broke resize gravity (Mark Vojkovich).
+ 38. Fix PCI/AGP bridge I/O and memory window detection (Marc La France).
+ 37. Add Mach64 solid zero-width line acceleration, except for 24bpp
+ (Kevin Martin, Marc La France).
+ 36. Add Mach64 mono 8x8 pattern fill acceleration (Kevin Martin,
+ Marc La France).
+ 35. Fix DDC bug (John McCorquodale).
+ 34. Fix minClock and maxClock determination in ATI driver (Marc La France).
+ 33. A first step at allowing -configure to deal with more than one device per
+ driver (Marc La France).
+ 32. ATI driver changes: Implement Mach64 engine restriction on virtual
+ resolution; Add DPMS support; More DSP calculation fixes; Fix text
+ mode restoration bug; Fix Mach64 screen blanking; Don't probe for
+ previously claimed VGA compatibles; Fix device section matching for
+ Mach64 controllers made by UMC foundry; Miscellaneous cleanups
+ (Marc La France).
+ 31. Add GLINT 300SX support to the glint driver (Alan Hourihane).
+ 30. Remove the unused GLINT Delta code (for now) to re-implement as
+ a chipset (like the gamma) from the glint driver (Alan Hourihane).
+ 29. Add support for the TVP3026 ramdac to the ramdac module (Alan Hourihane).
+ 28. Add support for building and installing HTML versions of the man
+ pages (David Dawes).
+ 27. Fix some limitation in rman so that it will handle our man pages
+ correctly (David Dawes).
+ 26. Import rman-3.0.8, for generating HTML versions of the man pages
+ (David Dawes).
+ 25. ATI fixes to Cards database (Marc La France).
+ 24. Fix some man page formatting problems that show up on some platforms
+ (David Dawes).
+ 23. Fix an 8+24 bug that occured when shared memory pixmaps were used as
+ tiles (Mark Vojkovich).
+ 22. Support for the Trident CyberBlade/DSTN/i1 (Alan Hourihane).
+ 21. Fix Xinerama problems that occured when screen zero was not at (0,0)
+ (Mark Vojkovich).
+ 20. Add untested support for Matrox SDRAM G400s (Mark Vojkovich).
+ 19. Improve memory probing reliability in the Matrox driver (Mark Vojkovich).
+ 18. Fix DESIGN doc and XF86Config man page information about the Screen
+ entry format in the ServerLayout sections (David Dawes).
+ 17. Add missing file permission flags to xf86shmget (Mark Vojkovich).
+ 16. Workaround in 8+32 for applications that assume changes to window
+ background pixmaps go into effect immediately (Mark Vojkovich).
+ 15. Change loader search order to look in more specific subdirectories first,
+ thereby avoiding loading 3.3.* module versions (Marc La France).
+ 14. Remove the var-* bindist files for platforms that don't use Xvar.tgz
+ (David Dawes).
+ 13. No Xset.tgz, so remove the set-list bindist files (David Dawes).
+ 12. Fix Xinstall's symlink testing for Solaris (/bin/sh's builtin doesn't
+ recognise '-L') (David Dawes).
+ 11. Update Xinstall.sh to handle the xkb/compiled directory properly in all
+ cases, including when there is no Xvar.tgz tarball (David Dawes).
+ 10. Add missing cs_CZ.ISO_8859-2 entries to locale.alias (#A.20,
+ Cejka Rudolf).
+ 9. Updates to Linux-ix86 bindist host.def file.
+ 8. Fix installation of iso8859-{1,2,3} Compose files, and fix the czech
+ entry in locale.alias (Charles Lopes, #A.62, Stanislav Brabec).
+ 7. Fix some problems with layers forgetting that SwitchMode is an
+ optional function (Mark Vojkovich).
+ 6. Parser bug fix for hexadecimal numbers (Marc La France).
+ 5. Fix scanpci (Marc La France).
+ 4. DPMS #include fix (Marc La France).
+ 3. Fix an event ordering problem in Xinerama (Mark Vojkovich).
+ 2. Fix some clipping bugs in the Xv DDX (Mark Vojkovich).
+ 1. Remove 24bpp shadowfb support from the NV driver since the hardware
+ is not capable of 24bpp (Mark Vojkovich).
+
+XFree86 4.0 (8 March 2000)
+3972. Possible fix for a cirrus driver crash when using -configure
+ (David Dawes).
+3971. R128 driver doc update (#3813, Ove Kaaven).
+3970. Update Unicode/ISO 10646 information in the release notes (#3812,
+ Markus Kuhn).
+3969. Fix an apm driver crash when using -configure (#3811, Loic Grenie).
+3968. Release notes updates (David Dawes).
+3967. Major updates to the XF86Config man page (David Dawes).
+3966. Update the Cyrix driver documentation (#3810, Richard Hecker).
+3965. Update the APM driver documentation (#3809, Loic Grenie).
+3964. Fix a name clash in XF86OffscreenImageRec (Mark Vojkovich).
+
+XFree86 3.9.18Za (7 March 2000)
+3963. GCC/egcs bug workaround and other more minor ATI fixes (Marc La France).
+3962. Split HasGlide into HasGlide2 and HasGlide3 (David Dawes).
+3961. Enable known gcc optmisation work arounds by default (David Dawes).
+3960. Fix uninitialized screen function (RestackWindow) (#3806, Keith Packard).
+3959. Added DRI users guide documentation (Brian Paul and Kevin Martin).
+3958. Update the -misc-fixed-* BDF fonts. New glyphs have been added and
+ some old ones fixed. 10x20.bdf and 9x15.bdf now also cover the
+ ISO 8859-6 characters (Arabic), and 18x18ja.bdf covers now all
+ characters necessary to display the full ISO-2022-JP-2 repertoire
+ (#3799, Markus Kuhn).
+3957. Make sure the fbdevhw module is loaded by the glint driver when it
+ is needed, and add some memory barriers to some register access macros
+ (#3804, Michel Dänzer).
+3956. Update the glint driver man page and release notes (#3804,
+ Michel Dänzer).
+3955. Remove some noisy messages from the mga driver (#3803, Mark Vojkovich).
+3954. The last segment in any zero-width polysegment drawing request to
+ a window with more than one clipping rectangle gets dropped in the
+ fb code (#3802, Keith Packard).
+3953. Fix the versions for which HasMTRRSupport is enabled for OpenBSD
+ (#3800, Matthieu Herrb).
+3952. Fix some "ambiguous" else statements in some of the driver Probe()
+ functions (David Dawes).
+3951. Don't make the VBEInit call in the chips driver dependent on the loader
+ server (David Dawes).
+3950. Register vbe symbols as "referenced" with the loader in drivers that
+ use them (David Dawes).
+3949. Fixed the unresolved VBE symbols in the r128 driver and a crash
+ related to referencing vgahw symbols before the module is loaded
+ (Kevin Martin).
+3948. Fix a -configure crash in the tdfx driver (David Dawes).
+3947. Fix a mouse driver bug that prevented the X server from seeing the
+ mouse button 4 and above when three button emulation is enabled
+ (#3773, Yoshihiko Sarumau, Kazutaka Yokota).
+3946. Add NO_GXCOPY to the s3virge driver's imagewrite flags, which fixes
+ a crash (#3783, Kevin Brosius).
+3945. Fix a parser build problem for Interactive Unix, and update the
+ docs (#3796, Michael Rohleder).
+3944. Fix the r128 hw cursor for big endian machines, and enable building
+ the r128 driver for PPC (#3975, Kostas Gewrgiou).
+3943. Update lnxResource.c to allow builds to succeed on PPC platforms
+ (#3795, Kostas Gewrgiou).
+3942. B&H Lucidux fonts (#3794, donated by Charles Bigelow, Kris Holmes
+ from Bigelow and Holmes Inc, with hinting donated by Berthold Horn and
+ Blenda Horn from Y&Y, Inc).
+3941. Doc update for the sis driver (#3793, R Horn).
+3940. Fix an xman build problem on LynxOS (#3792, Thomas Mueller).
+3939. Fix some 24-plane problems with the tga driver, and update the docs
+ (#3789, Martin Lucina).
+3938. Rage 128 documentation update (Kevin Martin).
+3937. Fix an unresolved reference to VErrorF from the int10 module
+ (David Dawes).
+3936. Reduce some of the noise in the server startup messages (David Dawes).
+3935. Static library objects don't use THREADS_CFLAGS (#3790, Matthieu Herrb).
+3934. Fix a fatal error related to shared memory pixmaps in Xinerama (#3788,
+ Mark Vojkovich).
+3933. Fix IA64 build fixes (#3787, Mark Vojkovich).
+3932. Fill out the rendition man page (#3785, Dejan Ilic).
+3931. Update the s3virge man page (#3784, Kevin Brosius).
+3930. Fix the FreeBSD/alpha code to track changes made to the Linux memory
+ mapping code (#3782, Doug Rabson).
+3929. Update email addresses for C&T driver authors (#3781, Nozomi Ytow).
+
+XFree86 3.9.18Z (3 March 2000)
+3928. Restrict the X server -configure option to root, and fix a crash
+ when the server fails to read the first stage config file that it
+ writes when run with this option (David Dawes).
+3927. Modify the parser's xf86WriteConfigFile() function to write the
+ file using the real user id when the real and effective ids are
+ different (David Dawes).
+3926. Fix a problem with VT switching disabling direct rendering 3D apps
+ (Kevin Martin).
+3925. Add an imake parameter called XFree86Devel that can be set in host.def
+ to enable devel-specific settings (like more verbose compiler warnings),
+ and adjust GccWarningOptions to use this (David Dawes).
+3924. Various doc updates, and don't install out of date docs (David Dawes).
+3923. Fix a thread related problem in the Xv client library (Mark Vojkovich).
+3922. Fix a Xinerama problem with XShapeMask (Mark Vojkovich).
+3921. LynxOS documentation and bindist updates, and an os-support fix (#3779,
+ Thomas Mueller).
+3920. Update the wacom input driver to suppor the PL400 model and the
+ stroking pen on the Intuos model (#3778, Frederic Lepied).
+3919. -
+3918. -
+3917. Add prototypes for xman, and eliminate most of the compiler warnings
+ (#3772, Thomas Dickey).
+3916. Xterm patch #130 (#3771, Thomas Dickey).
+3915. Fix a segfault in XAA caused by reading beyond shared memory bitmaps
+ when hardware clipping is not available (Mark Vojkovich).
+3914. Update the mga man page (Mark Vojkovich).
+3913. A Q&D fix for GLX segment violation in loader server (Marc La France).
+3912. Add Mach64 screen-to-screen copy acceleration (Kevin Martin,
+ Marc La France).
+3911. IA-64 fixes (Mark Vojkovich).
+3910. Add skeleton man pages for the video and input drivers that don't
+ already have one (David Dawes).
+3909. Add man pages for the mouse, keyboard and void input drivers
+ (David Dawes).
+3908. Enable building the "void" input driver by default (David Dawes).
+3907. Keep xf86RegisterRootWindowProperty from freeing data it didn't
+ allocate (Mark Vojkovich).
+3906. Add an extra file name to the server config file search path --
+ XF86Config-M, where M is the major version number (David Dawes).
+3905. DRI megapatch II. This includes DRI enhancements, 3dfx fixes and
+ updates, updates Mesa to version 3.3 beta, adds new GLX dispatch
+ code and adds i810 2D support (Precision Insight).
+3904. Add SERVER_OVERLAY_VISUALS root window property (Mark Vojkovich).
+3903. Remove unnecessary VGA CRTC unlock/relock in cyrix driver
+ (Marc La France).
+3902. Fix ATI driver's 8514/A probe delay when one isn't present
+ (Marc La France).
+3901. Changes to -configure: ATI driver interface; Move default monitor
+ tolerances to xf86ValidateModes(); Let drivers decide on default depth
+ and mode; Don't "special-case" VGA driver. (Marc La France)
+3900. Fix xc/lib/Imakefile for BuildServersOnly (Marc La France).
+
+XFree86 3.9.18b (29 February 2000)
+3899. Fix a bug in lnx_apm.c that causes fd 0 to be closed instead
+ of the just opened /proc/apm (#3766, Kars de Jong).
+3898. Fix a SuperProbe build problem on UnixWare 7 (#3765, Thanh Ma).
+3897. Mouse doc updates (#3764, Kazutaka Yokota).
+3896. Speed up dashed lines and conic sections in fb, including changing
+ mi to use PolyPoint instead of FillSpans for dashed arcs (#3763,
+ Keith Packard).
+3895. Add shadowfb support to the rendition driver (#3762, Dejan Ilic).
+3894. Allow Rage128 driver to Probe DDC too (Alan Hourihane).
+3893. Allow i740 driver to Probe DDC (using vbe) for -configure, and remove
+ one liner from tdfx driver to enable it too (Alan Hourihane).
+3892. Make GNU make -j workaround separately configurable (Marc La France).
+3891. Replace remaining occurrences of BuildXTT imake symbol with
+ BuildXTrueType (Marc La France).
+3890. Fix some problems using the UTF-8 -locale:
+ - Add proper side (GL/GR) handling to the UTF-8 locale
+ - No more need to define ISO10646-1 in en_US.UTF-8. It is already
+ defined in lcCT.c
+ - The fontset loading routines would access invalid memory when
+ not all fonts for a fontset were found
+ (#3761, Bruno Haible).
+3889. Avoid spurious warnings from the XFree86-Bigfont extension (#3760,
+ Bruno Haible).
+3888. Fix an error in the XtAppMainLoop() man page related to its return
+ behaviour (#3759, Bruno Haible).
+3887. Make it possible for gcc to compile the Linux int10 module with -fPIC
+ (#3758, Bruno Haible).
+3886. Fix typos in fontcacheP.h and RELNOTES (#3757, Bruno Haible).
+3885. Disable stripping programs when they are installed to make it
+ easier to debug problems that may show up within libraries (#3756,
+ Bruno Haible).
+3884. Add support for reading power management events for NetBSD and
+ OpenBSD (#3755, Matthieu Herrb).
+3883. Update Xinstall.sh for NetBSD-current-ELF (#3754, Matthieu Herrb).
+3882. Update NetBSD and OpenBSD bindist files (#3753, Matthieu Herrb).
+3881. Apm driver update, including extending the Rush extension to allow
+ initialisation of the Rush chip in a legal way (#3752, Loic Grenie).
+3880. Xterm patch #129 (#3751, Thomas Dickey).
+3879. Add DDC support to the tdfx driver via the vbe interface (#3750,
+ Jarno Paananen).
+3878. Enable double scan and interlaced modes for the tdfx and nv drivers
+ (#3750, Jarno Paananen).
+3877. Fix 8bpp initialisation problem with the rendition driver (#3749,
+ Dejan Ilic).
+3876. Update the XThrStub library version with that in the 3.3.x branch,
+ and enable thread-safe libraries for OpenBSD 2.6 and later (#3748,
+ Matthieu Herrb).
+3875. Fix some REGION_BROKEN related stuff with the overlays (Mark Vojkovich).
+3874. Fix a bug with unaccelerated pixmap cache uploads when virtualX
+ was larger than the displayWidth (Mark Vojkovich).
+3873. Xinerama changes (Mark Vojkovich).
+ - extend the Xinerama protocol and change the version number to 1.1.
+ - add a new client API in the "Xinerama" namespace with more
+ functionality than the previous "PanoramiX" functions.
+ - move Xinerama functions out of libXext and into libXinerama.a.
+ - some Xinerama bug fixes.
+3872. Add a flags field to the XF86OffscreenImageRec (Mark Vojkovich).
+3871. Fix a malloc/free problem in Xnest on 64-bit platforms (David Dawes).
+3870. Update bindist definition files (David Dawes).
+3869. More installer updates (David Dawes).
+3868. Make -configure generate multihead configs (Alan Hourihane).
+
+XFree86 3.9.18a (25 February 2000)
+3867. Add a preliminary Install document (David Dawes).
+3866. Remove obsolete XF98 and XF68 definitions from xfree86.cf (David Dawes).
+3865. Fix some rendition driver problems (#3746, Dejan Ilic).
+3864. Add build-time support for using fb instead of cfb with the nv
+ driver (#3744, Jarno Paananen).
+3863. Add missing xf86_ansic.h include for the nv driver, and avoid a
+ gcc 2.96-generated memcpy call in Mesa (#3743, Jarno Paananen).
+3862. Glint driver updates:
+ - removed obsolete NoWriteBitmap option
+ - reworked pm2_accel.c (cleaned up swapping/mirroring, removed
+ obsolete hacks)
+ - fixed setting of mode sync flags
+ - fixed PolySegmentThinSolidWrapper functions
+ (#3742, Michel Dänzer).
+3861. Change the positioning of $(XF86INT10LIB) to fix some static server
+ linking problems (#3741, Kevin Brosius).
+3860. Make xclock's -brief option off by default, and document it in the
+ man page (#3740, Nozomi Ytow).
+3859. Improve the default converters set in libX11, and use it for all
+ "one byte" locales (#3737, Ivan Pascal).
+3858. Some improvements to the generic converters set in libX11, including:
+ - some converter optimization
+ - actions that can be done once at initialization step moved to
+ lcGeneric.c
+ - converters from CharSet to MultiByte/WideChar added
+ (#3731, Ivan Pascal).
+3857. Add a "showCurrent" resource for Xaw, which makes the list widget
+ always show the selected item (#3728, Paulo Cesar Pereira de Andrade).
+3856. Use fb for the fbdev driver, and check if the fbdev modes are suitable
+ for the monitor (#3709, Michel Dänzer).
+3855. Add support for finding VT devices for Linux kernels compiled with
+ devfs (#3692, Christopher Sekiya).
+3854. Implmenent the Font Type font properties for the Speedo, Type 1 and
+ TrueType backends (#3688, Juliusz Chroboczek).
+3853. Add an installation script (Xinstall.sh) for installing binary
+ distributions (David Dawes).
+3852. Fix bitmap installation location for xditview (#3724, Harald Koenig).
+3851. Make -probe and -configure deal with vendor-supplied modules again
+ (Marc La France).
+3850. Fix an exposure problem that occured in 8+32 mode when the root
+ window was in depth 24 (Mark Vojkovich).
+3849. The MGA driver now recognizes a "VideoKey" option that sets the
+ default video key for YUV overlays (Mark Vojkovich).
+3848. Add some missing cfbDrawableEnabled checks to the 8+32 and 24+32
+ framebuffers (Mark Vojkovich).
+3847. Fix a segfault introduced by the workaround in 3546 below.
+3846. Fix big endian problems in XAA stipple code (Michel Dänzer).
+3845. Fix xf86MatchPciInstances() to not cause r128 to report detection of
+ other ATI adapters to -probe (Marc La France).
+3844. Fix bug in xf86MatchDevices() with -probe or -configure (Marc La France).
+3843. More compilation fixups (Marc La France).
+3842. Make -probe and -configure use compiled-in driver lists. Make -configure
+ work in the static server (Marc La France).
+3841. A second attempt at fixing DPS compilation (Marc La France).
+3840. Add DDC probing to the -configure option and enable it in the trident
+ driver (Alan Hourihane).
+3839. Bring xditview over from the contrib dist.
+3838. Fix drm free list bug (Jeff Hartmann and Rik Faith, Precision Insight).
+3837. Remove deprecated keywords (Kevin Martin).
+3836. Support for YUV offscreen surfaces in Xv and have the MGA driver
+ offer them (Mark Vojkovich).
+3835. Reorder generic Xv adaptor registration to allow V4L to use
+ driver-managed YUV offscreen surfaces (Gerd Knorr).
+3834. Preliminary IA-64 support (Mark Vojkovich, Johannes Erdfelt).
+
+XFree86 3.9.18 (21 February 2000)
+3833. Bump the minor version number for libXaw since it has some symbols
+ that are not present in 6.0.
+3832. Add a "xf86LoaderCheckSymbol" function and use this in drivers to
+ check if the vgahw module is loaded before calling vgaHWFreeHWRec()
+ (David Dawes).
+3831. Fix some build problems on Interactive Unix (#3739, Michael Rohleder).
+3830. Disable NetBSD aperture driver support by default (#3736,
+ Matthieu Herrb).
+3829. Update OpenBSD and NetBSD docs (#3735, Matthieu Herrb).
+3828. Update the VideoBoard98 file (#3734, Isao Ohishi).
+3827. Fix 'X -scanpci' crash (David Dawes).
+3826. Fix the "ev56" gcc option (#3730, Keith Packard).
+3825. Fix some problems with the MMIO macro use of function pointers on
+ Alpha (#3729, Keith Packard).
+3824. Fix a Mesa bug involving paletted textures and software rendering
+ (#3727, Brian Paul).
+3823. Fix a glx bug involving glFlush() inside glXWaitGL() (#3727, Brian Paul).
+3822. Disable the 3DNow assembler code for now, to avoid problems with
+ assemblers that don't recognise the instructions (Brian Paul).
+3821. Fix some problems with the Cards file (#3726,
+ Paulo Cesar Pereira de Andrade).
+3820. Eliminate the double mappings added to the r128 driver work around
+ earlier limitations, and add the fix necessary to make the R128
+ work on an Alpha UP1000 box without hanging the AGP bus during fb
+ rendering (#3720, Keith Packard).
+3819. Fix an int10 crash when the BIOS accessed memory beyond the first
+ 8kbytes (#3722, Keith Packard).
+3818. Fix PCI memory regions on dense alpha (#3720, Keith Packard).
+3817. Fix an int10 module build problem on big endian machines (#3719,
+ Kostas Gewrgiou).
+3816. Remove "lib" from the GLcore module name (David Dawes).
+3815. Set HasPoll to NO for Linux to work around a problem that Netscape
+ has when libXt uses poll() instead of select() (#3718, Keith Packard).
+3814. Disable 24bpp fb rendering on big endian machines because it doesn't
+ work yet (#3717, Keith Packard).
+3813. Fix an Xlib bug that causes freed memory to be accessed. This is
+ exposed by Netscape (#3716, Keith Packard).
+3812. Fix a problem in glxUseXFont() when direct rendering (#3715, Brian Paul).
+3811. A rework of Kevin Martin's Mach64 acceleration. Only solid fills for
+ now (Marc La France).
+3810. ATI Mobility fixes (Marc La France).
+3809. A new clock ordering has been reported for Mach32's. Treated as a
+ different clock chip for now (Marc La France).
+3808. Build fixups (Marc La France).
+3807. Fix a bug in the code that checks for the presence of a core keyboard
+ and pointer (David Dawes).
+3806. Remove unnecessary system headers from Xext/fontcache.c, which were
+ causing unresolved symbols for the extmod module on Solaris
+ (David Dawes).
+
+XFree86 3.9.17Z (17 February 2000)
+3805. Fix VT switch problem when using shadowfb with the ati driver
+ (Marc La France).
+3804. Fix some typos in the mouse driver that affect some of the extended
+ PS/2 protocols (Kazutaka Yokota).
+3803. Xterm patch #128 (#3713, Thomas Dickey).
+3802. Fix a crash in the XKB library code (#3712,
+ Paulo Cesar Pereira de Andrade).
+3801. Set the right max clock for the Voodoo3 3000 (#3707,
+ Yoann Vandoorselaere).
+3800. Fix various build problems (David Dawes).
+3799. Fix all other SaveScreen() functions, and add a helper xf86IsUnblank()
+ that drivers can use to interpret the SaveScreen mode values
+ (David Dawes).
+3798. Fix GLINTSaveScreen's use of the second argument (#3706, Michel Danzer).
+3797. Glint driver updates: register int10 module's symbols, and add a
+ workaround to set the sync flags in supplied modes to make the HW
+ cursor work with FBDev (#3650, Michel Danzer).
+3796. Indented xfree86 for better readability. (Egbert Eich)
+3795. Fixed int10 build rules (hope they are right now) (Egbert Eich)
+3794. Changed lnxResources.c to know about differences between ev4/5 and ev6.
+ (Egbert Eich).
+3793. xf86pciBus.c restores old registration if attempt fo fix PCI
+ registration fails. (Egbert Eich)
+3792. Removed sparse mapping from vidmem.c. (Egbert Eich)
+3791. Changed memory mapping for linux on Alpha:
+ - removed separate mapping functions for sparse and dense.
+ - allow for 32bit read/write to access memory directly without
+ going thru a function call if Jensen support is not enabled
+ (Egbert Eich)
+3790. Fix for dead keys in XKB Norwegian keyboards (#3702, 3703,
+ Preston Brown).
+3789. Synced with latest Mesa 3.3 sources (Brian Paul, Precision Insight).
+3788. Bug fixes for DRI (Kevin Martin, Precision Insight).
+3787. Bug fixes for tdfx DRI driver (Daryll Strauss, Precision Insight).
+3786. Cleanups for the contrib programs recently moved into the main xc/
+ tree (#3701, Bruno Haible).
+3785. Small lynx.cf fix (#3700, Thomas Mueller).
+3784. Initialise MMIO32 for r128 when using fbdev (#3699, Kostas Gewrgiou).
+3783. Avoid most lockups for Trio3D startup (s3virge driver) (#3698,
+ Harald Koenig).
+3782. Fix unresolved and conflicting symbols in X-TT, and fix the broken
+ BIG5 converter (#3697, Takuya Shiozaki).
+3781. Update README.fonts (#3696, Juliusz Chroboczek).
+3780. Add dot, line, arc accelerations for 24bpp in fb, and cleanup most
+ warnings (#3695, 3711, Keith Packard).
+3779. Make it possible to build the r128 driver with support for fb
+ (disabled by default) (#3693, Keith Packard).
+3778. Fix a problem with lnx_ev56 (#3693, Keith Packard).
+3777. Fix references to noPanoramiXExtension when Xinerama is not built
+ (#3691, Christopher Sekiya).
+3776. Fix possible races in xauth and libXau (#3690, 3694, Colin Phipps).
+3775. Fix some Xv and PC-98 init bugs in the apm driver (#3689, Loic Grenie).
+3774. Fix SVR4.0 build problem in the cyrix driver (David Dawes).
+3773. Fix SVR4.0 build problems in the sis driver (#3687, Takaaki Nomura).
+3772. Change CppProgram to /usr/bin/cpp for FreeBSD.
+3771. DPS build fixes (#3686, Juliusz Chroboczek, David Dawes).
+3770. Back out the pMga->PointerMoved change.
+3769. Fix DRI/DRM code to build tdfx driver and turn off building MGA DRI
+ support until the next code merge (Kevin Martin).
+3768. Attempt to first read the PLL parameters in the BIOS from PCI space,
+ then fallback to 0xc0000, and then fallback to default PLL parameters
+ in r128 driver (Kevin Martin).
+3767. Fix compiler warnings in r128 driver (Kevin Martin).
+
+XFree86 3.9.17f (12 February 2000)
+3766. Moved Alpha ev5/56 read dense functions to a separate file.
+ (Egbert Eich)
+3765. Improved RAC support for asynchronous events (not yet enabled).
+ (Egbert Eich)
+3764. Fixed a bug that prevented restoration of PCI registers after
+ a VT switch. (Egbert Eich)
+3763. Fixed support for BIOS reading on multiple chipset cards. (Egbert Eich)
+3762. Separated stub functions from pcitweak. (Egbert Eich)
+3761. Rewrote scanpci to use libxf86_os.a. (Egbert Eich)
+3760. Improved server state notification callback handler to meet the
+ needs of multi-head dri. (Egbert Eich)
+3759. Mga fix for pMga->PointerMoved init (#3684, Isao Ohishi).
+3758. Import FreeType 1.3.1 and X-TrueType 1.3, and incorporate the
+ font cache extension (#3653, Akio Morita, X-TrueType team, Nozomi Ytow).
+3757. Add a stub for xf86OSPMOpen() for OS's that don't have their own
+ (David Dawes).
+3756. Move the other XFree86-supported contrib programs to the main xc/
+ tree (except for xditview) (David Dawes).
+3755. Add a dummylib that provides functions required by libxf86_os. This
+ makes it easier for utilities (like scanpci and pcitweak) to use
+ libxf86_os (Egbert Eich, David Dawes).
+3754. Some bug fixes and PC-98 enhancements for the apm driver (#3685,
+ Loic Grenie).
+3753. GL build fix (#3683, Christopher Sekiya).
+3752. Xterm patch #127 (#3682, Thomas Dickey).
+3751. Cyrix MediaGX driver. Not very usable yet (#3681, Richard Hecker).
+3750. Add DPS libraries. Building these is disabled right now because
+ some more work is needed on the Imakefiles and portability issues
+ (#3645, 3680, Juliusz Chroboczek).
+3749. Fix the mga driver to work with the MGA 2064W on Alpha architectures
+ (#3679, Doug Rabson).
+3748. Support for building XFree86 on FreeBSD/alpha (#3678, Doug Rabson).
+3747. Restore viewport correctly on VT switch for the s3virge, and clean
+ up the logging messages (#3676, Kevin Brosius).
+3746. Don't try to program the keyboard repeat rate directly for Linux/98
+ (#3675, Takaaki Nomura).
+3745. Update information about mouse support in 3.9.18 (#3673, 3674,
+ Kazutaka Yokota).
+3744. Remove the "Extended PS/2 mouse protocol" class from the supported
+ interfaces in FreeBSD, since they are already handled at the
+ device driver level (#3672, Kazutaka Yokota).
+3743. Merge Kevin Hendricks fbdev/ppc patches in r128, fix wrong order
+ in cursor init (#3671, Kostas Gewrgiou, Kevin Hendricks).
+3742. Fix a problem building xedit/realpath.c that shows up on Linux
+ (#3670, Andrew Aitcheson).
+3741. Fix a build problem for lcUTF.c on Linux/libc5 (#3668,
+ Andrew Aitcheson).
+3740. Make sure the cursor is positioned correctly after mode changes
+ (#3667, Harald Koenig).
+3739. Add support for the SiS 630/540/300/530/620 to the SiS driver with
+ hw acceleration. Support for the tvout function is included for
+ the 630/540/300 (#3666, Can-Ru Yeou, SiS).
+3738. Fix some build problems with the apm driver on SVR4.0 (David Dawes).
+
+XFree86 3.9.17e (11 February 2000)
+3727. Move xman into the main xc/ tree.
+3726. The leak-tracing allocator now works on 64-bit machines, and update
+ the server to allow the use of the leak-tracing allocator (#3665,
+ Keith Packard).
+3725. Fix fb so that it works with 64-bit pointers and works on big-endian
+ machines (#3665, Keith Packard).
+3724. r128 driver updates to work on Alpha UP1000 (ev6). The changes follow
+ recommendations from Kevin Martin and Egbert to try to make them
+ reasonable (#3665, Keith Packard).
+3723. Modify mfb, cfb and mi so that they now do all accesses 32-bits at
+ a time instead of 64 (on 64-bit platforms). This eliminates image
+ repadding in DIX (#3665, Keith Packard).
+3722. Bug fixes, comments and cosmetics for the input method code:
+ - Add prefix "_Xim" to two input specific functions.
+ - Remove buggy function ConvertUCS4toUTF8 (bug: UCS-4 never contains
+ surrogates), and replace with simpler code. Based on a patch by
+ Ivan Pascal.
+ - Fix for _XimLookupMBText and _XimLookupWCText in multibyte locales
+ Patch by Ivan Pascal.
+ (#3664, Bruno Haible, Ivan Pascal).
+3721. Fix ugly code in _XlcCreateDefaultCharSet and add comments (#3663,
+ Bruno Haible).
+3720. Introduce a UTF-8 locale, including conversion from/to compound text.
+ This is not fully functional yet (#3662, Bruno Haible).
+3719. Resturcutre lib/X11/lcCt.c so that it is more understandable. Update
+ the default_ct_data array. Fix bugs in _XlcCheckCTSequence and cstoct,
+ and fix the UTF-8 introducing sequence (#3661, Bruno Haible).
+3718. Fix parsing of resource files so that it works better in multi-byte
+ locales (#3660, Bruno Haible).
+3717. Add commens to the libX11 locale files, declare _XlcInitLoader and
+ XlcConverter and a portability fix for dlopen() (#3659, Bruno Haible).
+3716. Fix an indentation problem in Xlib that was the origin of a malloc/free
+ bug (#3658, Bruno Haible).
+3715. Fix a bug in the locale file parsing routines (#3657, Bruno Haible).
+3714. Create a locale en_US.UTF-8. This isn't fully functional yet, but
+ parts of Xlib work with it (#3657, Bruno Haible).
+3713. Modify xman to search for man pages in a locale-specific directory
+ first (#3652, Paulo Cesar Pereira de Andrade).
+3712. Have xedit use the BSD realpath() provided instead of the standard
+ Linux one because the Linux one behaves differently (#3652,
+ Paulo Cesar Pereira de Andrade).
+3711. Fix some typos in the Monitors and Cards files (#3652,
+ Paulo Cesar Pereira de Andrade).
+3710. Disable SilkenMouse in the C&T driver until the memory transfer
+ sync problem is solved (#3654, Nozomi Ytow).
+3709. -
+3708. Don't "normalise" module names in xf86LoadModules (David Dawes).
+3707. Apm driver updates, including updates to the xf86Rush extension (#3649,
+ 3655, Loic Grenie).
+3706. Small cosmetic patch to glide driver (#3648, Loic Grenie).
+3705. Fix a bug in the way the BIOS mapping size is calculated in
+ in the ReadBIOS functions (#3647, Loic Grenie).
+3704. Add ReputImage function to the Xv DDX to prevent flickering during
+ window moves on some hardware (Loic Grenie).
+3703. Fix a bigfont extension build problem on Interactive UNIX (#3646,
+ Michael Rohleder).
+3702. Fix a bigfont extension build problem on NetBSD and OpenBSD (#3644,
+ Matthieu Herrb).
+3701. USB mouse support for *BSD (enabled for OpenBSD) (#3644, 3656,
+ Matthieu Herrb).
+3700. Update README.fonts (#3643, Juliusz Chroboczek).
+3699. i810 driver and preliminary DRI support for i810 and mga (#3638,
+ Keith Whitwell, Precision Insight).
+3698. 8+24 support upgraded to a non-destructive overlay (Mark Vojkovich).
+3697. Modify XAA to allow image rendering into DMA buffers (Mark Vojkovich).
+3696. Fix some SVR4.0 build problems (#3642, 3653, Satoshi Kimura).
+3695. Add XErrorDB entries for the DPS extension (#3639, Juliusz Chroboczek).
+3694. Fix a bigfont extension build problem on Linux/libc5 (#3637,
+ Takaaki Nomura).
+3693. Extend the Mouse "ZAxisMapping" option so that it can accept
+ (optionally) four arguments. The additional two are for mice that
+ have two wheels or whose scroll device has two axes) (#3636, 3641,
+ Kazutaka Yokota).
+3692. Add support for some new mice (Microsoft IntelliMouse Explorer,
+ Genius NetScroll Mouse Optical, IBM ScrollPoint) and serial PnP
+ IDs (A4 Tech 4D/4D+, MouseSystems SmartScroll, Logitech Cordless
+ MouseMan Wheel, 8D Scroll mouse) to the mouse driver, and update
+ the mouse documentation (#3636, 3640, 3641, Kazutaka Yokota).
+3691. Xterm patch #126 (#3635, Thomas Dickey).
+3690. Fix for the Japanese PC-98 with GA-RUSH/6PCI in the apm driver (#3634,
+ Isao Ohishi).
+3689. Update man pages and server messages for -xf86config usage, and
+ FatalError when an unsafe path is given by a non-root user (#3633,
+ Mark Montague).
+3688. Add support for the Melco WHP-PS8 Permedia2-based card for Japanese
+ PC-98 machines to the glint driver (#3354, Isao Ohishi).
+3687. Avoid segv in new Linux apm support (David Dawes, Michel Danzer).
+3686. Fix unresolved symbols in the linux int10 module and the GLcore module
+ (David Dawes).
+3685. Add xkb support plus new (XFree86-specific) keysym names for the
+ HP and Logitech iTouch "Internet" keyboards (David Dawes).
+3684. Fix a vbe-related build problem on Solaris (David Dawes).
+
+XFree86 3.9.17d (9 February 2000)
+3684. XKB could crash with keycodes larger than the range given in the
+ keycodes file (David Dawes).
+3683. Allow the passing of all extended keycodes, which makes it possible
+ to access keys on "Internet" keyboards (David Dawes).
+3682. Added support for saving/restoring access state during
+ asynchronous events. Added code to make xf86EnableAccess()
+ atomic for asynchronous events. (Egbert Eich)
+3681. Modified xf86EnterServerState() to avoid any unnecessary
+ disabling of resources during state transition. (Egbert Eich)
+3680. Added function callback registration. Drivers can register
+ callback functions to be notified of the start/end of a
+ resource transition. (Egbert Eich)
+3679. Added support for OS specific Pci address windows. (Egbert Eich)
+3678. Added more debug traps to xalloc.c. Added support to peek/poke
+ MMIO registers and fb addresses from a debugger. (Egbert Eich)
+3677. Changed resource registration to use CPU space addresses
+ instead of BUS space addresses. Added flag to resource type
+ to mark addresses in bus address space. (Egbert Eich)
+3676. Extended host2bus and bus2host address conversion for PCI
+ addresses to PIO. (Egbert Eich)
+3675. Improved subset and intersect handling for resources ranges.
+ (Egbert Eich)
+3674. Modified mapping of V_RAM in int10/generic.c. (Egbert Eich)
+3673. Updated INT10.HOWTO. (Egbert Eich)
+3672. Added support for VBE DDC read out to s3v driver. (Egbert Eich)
+3671. Added xf86SetDDCProperties() to glint, chips, neomagic, s3v
+ and r128 driver. (Egbert Eich)
+3670. Fixed problems with virtual screen size != real screen size
+ when using shadow fb in mga driver. (Egbert Eich)
+3669. Fixed handling of virtual != real screen in shadowfb. (Egbert Eich)
+3668. Prevent reinitialization of pMga->PointerMoved in mga_driver.c
+ on server reset. (Egbert Eich).
+3667. Added int10 support to r128 driver. (Egbert Eich)
+3666. Attempt to make apm driver 64bit clean. (Egbert Eich)
+3665. Added options to swap x/y coordinates on mice. Useful when
+ using rotate on notebooks. (Egbert Eich)
+3664. Modified memory mapping on AXP to map entire MMIO space
+ at once. (Egbert Eich)
+3663. Fixed handling of sparsely mapped MMIO on AXP increasing
+ performance considerably. (Egbert Eich).
+3662. Added non-barrier versions of MMIO_OUTxx. (Egbert Eich).
+3661. Added support for new AXPs that don't have sparse mapping.
+ (Egbert Eich)
+3660. Separated high and low level handling in ModeInit() and
+ Restore() in cirrus driver. (Egbert Eich)
+3659. Made chipset specific record subrecord of vendor record
+ in cirrus driver. (Egbert Eich).
+3658. Made some improvements to acceleration code of Cirrus Alpine driver.
+ (Egbert Eich)
+3657. Added support for 64-bit cursor for Cirrus Alpine. (Egbert Eich)
+3656. Fixed cirrus driver to handle MMIO access using MMIO_IN/OUTxx
+ (Egbert Eich)
+3655. Fixed xf86HWCurs.c to handle 32-bit cursors on 64-bit machines
+ correctly. (Egbert Eich)
+3654. Added rotate support to neomagic, s3v, chips and cirrus
+ driver (Egbert Eich)
+3653. Added shadow fb support to s3v and cirrus driver (Egbert Eich)
+3652. Fixed sig11 problem after server reset caused by the new
+ extension loading code. (Egbert Eich)
+3651. Attempted to fix build problems with int10 (Egbert Eich)
+3650. Added a baseclass/subclass override to xf86PciInfo.h.
+ This override is evaluated in xf86pciBus.c (Egbert Eich)
+3649. Changed memory mapping in int10 support for Linux to use SYSV
+ IPC shm instead of mapping /proc/self/mem (Egbert Eich)
+3648. Added APM support for portable systems. (Egbert Eich)
+3647. XFree86-Bigfont extension that provides efficient client access to
+ the complete glyph metrics, using shared memory where possible/available
+ or transmitting the data in a compressed format otherwise (#3626,
+ Bruno Haible).
+3646. Update locale support for Celtic languages (Welsh, Irish, Scots, Manx
+ and Cornish), and include a compose file for ISO-8859-14 (#3612,
+ Alastair McKinstry).
+3645. Add a Slovenian xkb symbols file (#3629, Marko Samastur,
+ Primoz Peterlin).
+3644. The new extension init code didn't handle server resets (#3628,
+ Ebgert Eich).
+3643. xf86GetPciSizeFromOS() didn't close the file it opened (#3627,
+ Loic Grenie).
+3642. Export frexp() and ldexp() to modules (#3624, 3631, Juliusz Chroboczek).
+3641. Fixes for CTEXT handling in Xlib:
+ - rewrite CTEXT from/to converters for standard compliance
+ - CTEXT parser now understands UTF-8 (and other DOC) sequences and
+ performs only CTEXT sequence recognition
+ - detailed charset information parsing moved to the procedure that
+ adds 'charset object'
+ - Some actions for preparing 'charset object' moved to lcCharSet.c
+ (where it can be done easily)
+ - XlcAddCT call added to XLC_LOCALE file parser to allow recognition
+ of charsets that are described only in those files (ie, not
+ in internal Xlib tables)
+ (#3624, Ivan Pascal).
+3640. Convert the nv driver to use MMIO to access the VGA registers
+ instead of normal I/O ports. Also riva_hw is updated to the
+ same version as is in 3.3.6 (#3620, Jarno Paananen).
+3639. DRI and Mesa update (#3619, Brian Paul, Precision Insight).
+3638. Fix a problem with the tdfx driver that can result in a lockup
+ (#3618, Nicholas Brealey).
+3627. Fix some PPC inline assembler in compiler.h (#3617, Kostas Gewrgiou).
+3626. Add support for the S3 Trio3D/2x and Trio3D chips to the s3virge
+ driver (#3616, 3623, Harald Koenig).
+3625. Fix some build problems on Solaris 8 with gcc (#3615, Richard Coley).
+3624. Fix an Xserver core dump that can happen when xdmcp-related command
+ line options have missing arguments (#3614, Harald Koenig).
+3623. Xterm patch #125 (#3611, Thomas Dickey).
+3622. Add a Type1 version of the cursor font (#3610, Juliusz Chroboczek).
+3621. Add Trident Cyber9540 detection (not tested) (Alan Hourihane).
+3620. Fix horizontal/vertical line drawing for r128 driver (Kevin Martin).
+3619. Update -probe option for all bus types (Alan Hourihane).
+3618. Fix primary card detection for -configure (Alan Hourihane).
+3617. Modularize the mouse driver (Alan Hourihane).
+3616. Fix Cyber9388 detection in trident driver (Alan Hourihane).
+3615. Implement some of the (installed) path restructuring that was
+ discussed back in April 1999 (David Dawes).
+3614. Remove duplicated code in XKB and InputMethod processing (#3396,
+ Ivan Pascal).
+
+XFree86 3.9.17c (30 January 2000)
+3613. Add DDC1 and DDC2 support to the NVIDIA driver (#3608, Jarno Paananen).
+3612. Make -configure multihead aware, add loading of all extension modules,
+ setup Layout sections (Alan Hourihane).
+3611. XTextPropertyToTextList doesn't work if incoming XTextProperty has
+ encoding field other than STRING or COMPOUND_TEXT (#3606, Ivan Pascal).
+3610. Fix a bug in the X11 generic converters that prevents them from
+ converting the last character in a string (#3605, Ivan Pascal).
+3609. Fix a bug in _XOpenLC() that was causing unallocated memory to be
+ freed (#3604, Ivan Pascal).
+3608. Xterm patch #124 (#3603, Thomas Dickey).
+3607. Fixes to the character set conversion tables (#3602, Bruno Haible).
+3606. Reduce the data section of libX11 by 30% by proper use of
+ 'const' for tables (#3601, Bruno Haible).
+3605. Fix a bug in ConvertUCS4toUTF8() in libX11 (#3600, Bruno Haible).
+3604. Fix some fb macros that gcc accepted but which weren't legal ANSI C
+ (#3599, Keith Packard).
+3603. Update micmap to allow the drivers to specify the r/g/b mask values
+ (3598, Keith Packard).
+3602. Disable the cfbCopyPlane functions on big endian machines, and fix
+ a cfb24 bug (#3597, David Bateman).
+3601. Add a CheckExtension() function that can be called to check if an
+ extension has been initialised (David Dawes).
+3600. Allow extensions to specify which other extensions must be
+ initialised first, and sort the initialisation order according to
+ this information (David Dawes).
+3599. Force BIOS to be read from 0xc0000 for r128 driver (Kevin Martin).
+3598. Add a XXXAvailableOptions to DriverRec which allows passing available
+ options back to the -configure option (Alan Hourihane).
+3597. Avoid PCI-PCI bridges with an unexpected header type, which avoids
+ an infinite loop that can show up in the PCI bus enumeration code
+ (Egbert Eich).
+3596. More compilation fixups (Marc La France).
+3595. Add '###' (Comment) line capability to the parser (Alan Hourihane).
+3594. Fix the laguna driver to return MOD_CLASS_NONE (Alan Hourihane).
+3593. Add the 'extmod' module to the -configure option (Alan Hourihane).
+3592. Modify the extension loading code so that he core server no longer
+ needs to be aware of all extensions that can be loaded (David Dawes).
+3591. Remove XExtensionVersion from XPrint headers (Dirk Hohndel, from 3.3.5).
+3590. Fix a build problem with the static server related to the -configure
+ option code (#3596, Takaaki Nomura).
+
+XFree86 3.9.17b (24 January 2000)
+3589. Add a rule to lnxdoc.rules for maintainers to use to update the
+ formatted docs (David Dawes).
+3588. Add new -configure option to generate a clean XF86Config without the
+ need for a config tool. But hopefully could be used with XF86Setup.
+ (Needs some OS based updates - tested only on linux so far)
+ (Alan Hourihane).
+3587. Fix 64 bit problem in the Xv client header files (Mark Vojkovich).
+3586. Change the default charset for et_EE from ISO8859-4 to ISO8859-15,
+ which conforms with the upcoming standard EVS8:1999
+ (http://www.eki.ee/itstandard/) (#3595, Ville Hallik).
+3585. Fix a bug in XKB's CapsLock handling for some non-Latin1 locales,
+ and add support for ISO8859-15. Without this, CapsLock only affects
+ Latin1 keysyms and has no effect on scaron and zcaron, for example
+ (#3595, Ville Hallik).
+3584. Add Estonian keyboard support to XKB (#3595, Ville Hallik).
+3583. Hack to disable optimisation when building Xext/xf86vmode.c on FreeBSD
+ 4.0 to avoid a compiler bug (David Dawes).
+3582. Disable the hardware cursor in the tdfx driver when the screen is
+ too wide for the hardware to properly position the cursor on the
+ right side of the screen (#3593, Scott Bertin).
+3581. Fix a typo in panoramiXprocs.c that shows up on SVR4.0 (#3592,
+ Takaaki Nomura).
+3580. Xterm patch #123 (#3591, Thomas Dickey).
+3579. Add a "Status" document that lists and compares the driver status of
+ 4.0 and 3.3.x (needs a lot more input) (David Dawes, plus contributions
+ from the devel team).
+3578. Fix a problem with the EmulateTimeout line in the file generated
+ by xf86config, and have xf86config create /etc/X11 if it doesn't
+ already exist (David Dawes).
+3577. Put an OS-independent version of the int10 module/library in
+ xfree86/int10, but still allow an OS-specific version to override
+ it (David Dawes).
+3576. Import a minimal subset of the x86emu 0.6 distribution (David Dawes).
+3575. Register the required/referenced int10 symbols in the nv driver
+ so that there are no warnings on platforms that don't have this
+ module (David Dawes).
+3574. Don't probe for PC98 architecture on Solaris (David Dawes).
+3573. Fix some SVR4.0 build problems related to bzero() (David Dawes).
+3572. Rewrite the way Xinerama deals with events (Mark Vojkovich).
+3571. Fix VT switching problem in shadowfb (Marc La France).
+3570. Initialize DST_X_DIR and DST_Y_DIR for solid filled rects and for
+ horizontal and vertical lines to fix line drawing problems, and
+ initialize ScanlineCPUToScreenColorExpandFillFlags to fix font
+ corruption problems in r128 driver (Kevin Martin and Rik Faith).
+3569. Fix BIOS reading problem with r128 driver (Kevin Martin).
+3568. Fix imake failure in Mesa Imakefile (Kevin Martin).
+3567. Change trident driver to use fb instead of cfb and make DDC1 info
+ available to the primary card (Alan Hourihane).
+3566. Fix an XAA text corruption problem introduced by the endian fix
+ in 3.9.17a (David Dawes).
+
+XFree86 3.9.17a (21 January 2000)
+3565. Update linux.cf to use the kernel header files on Debian rather than
+ those packaged with the libc headers (#3544, Simon Richter).
+3564. Add an item to the default twm menu to open an xterm window (#3584,
+ David Brownlee).
+3563. Update Spanish locales in xc/nls (#3583, Fernando Herrera).
+3562. Fix I2C/DDC for S3 ViRGE (#3582, Harald Koenig).
+3561. Update the fbdevhw module for some new cards (#3579, Kostas Gewrgiou).
+3560. Fix interpret_vdif.c for big endian machines (#3578, Kostas Gewrgiou).
+3559. Minor fix to DDC to find monitor descriptions in EDID v1.1 (#3576,
+ Andrew Aitchison).
+3558. Allow silken mouse to work when building on Linux without DRI (#3574,
+ Keith Packard).
+3557. Only do the kbdrate I/O on architectures that support it (#3573, 3581,
+ Kostas Gewrgiou, Branden Robinson).
+3556. Fix XAA colour expansion for big-endian architectures (#3572,
+ Kostas Gewrgiou).
+3555. Update QNX support (#3570, Frank Guangxin Liu).
+3554. Fix "controlization" in XLookupString for chars > 127 (#3569,
+ Ivan Pascal).
+3553. Take advantage of FB speedups in Tiny-X (#3568, Keith Packard).
+3552. Speed up FB and do 32bit accesses instead of 64bit accesses
+ (#3567, Keith Packard).
+3551. Eliminate saving the contents of the screen durint VT switching
+ (#3562, Keith Packard).
+3550. Make using fb easier for driver writers (#3561, Keith Packard).
+3549. Fix TCP font server connections (#3560, Keith Packard).
+3548. Implement the "OverclockMem" option for the Millennium and Millennium
+ II (#3558, Andrew Aitchison).
+3547. Speed up some FB performance problems (#3557, 3559, 3560, 3588, 3589,
+ Keith Packard).
+3546. Work around a bad code generation bug in gcc 2.7.2.3 that shows up
+ in XAA (#3550, Rik Faith).
+3545. Add a -brief option to xclock to show only hours and minutes when in
+ digital mode (#3549, Keith Packard).
+3544. Fix some dead key problems with xkb symbols for Swiss French and
+ Swiss German keyboards (#3546, Charles Lopes).
+3543. Add drm_poll to fix SIGIO problem in the drm kernel modules, and change
+ drm to use /{proc,dev}/dri to avoid conflicts with /{proc,dev}/graphics
+ (Rik Faith and Daryll Strauss).
+3542. Fix some fb/glint-realted static build problems (Marc La France).
+3541. Add 3.9.17 xterm information to the RELNOTES (#3541, Thomas Dickey).
+3540. Fix some 64-bit problems in the GLX code (#3539, Dave Gilbert).
+3539. Execute the GLINT delta code in the Probe for each instance of
+ hardware found, not just the first one (#3534, Michael Rohleder).
+3538. Allow mesa to build on an Alpha (#3533, Matt Grossman).
+3537. Fix glint/Imakefile so that the correct fb.h is included, and rename
+ the private fb.h file in fbdevhw so that it won't be mistakenly included
+ instead of the one in Xserver/fb (David Dawes).
+3536. Fix some (unused) bad usages of InstallDynamicModule (David Dawes).
+3535. Make the Glint driver use the new fb module and fix correct operation
+ for 24bpp support (Alan Hourihane).
+3534. Fix for various compilation glitches (Marc La France).
+3533. Fix some Segmentation faults with NULL pointers in xf86Config.c
+ (Alan Hourihane).
+3532. Update some drivers to respect the PROBE_DETECT flag and update
+ xf86DoProbe to print out the supported chipset list (Alan Hourihane).
+3531. Update Trident driver to fix Clock source for 9440 chips and allow
+ linear framebuffer mapping for nommio (Alan Hourihane).
+3530. Fix fb for module compiling and ifdef fbcmap for now (Alan Hourihane).
+3529. Add Cyber9397 and Cyber9397DVD PCI ID detection to trident driver
+ (Alan Hourihane).
+3528. Fix Multiple MX RegisterResources with RAC in glint
+ driver (Alan Hourihane).
+3527. Update loader for Xinerama changes (Alan Hourihane).
+3526. Massive Xinerama rewrite (Mark Vojkovich).
+ - Change the way it deals with resources.
+ - Remove broken Xinerama code from the multibuf extension.
+ - Add support for shared memory pixmaps.
+ - Lessen Xinerama's impact on DIX.
+3525. Point and arc acceleration improvements for the NVIDIA driver
+ (Mark Vojkovich).
+3524. MGA acceleration modifications to prevent pci retries during
+ color expansions (Mark Vojkovich).
+
+XFree86 3.9.17 (31 December 1999)
+3523. Clean up bindist directories for the loader server (Robin Cutshaw).
+3522a. Fix return values in PsImageText8() and PsImageText16() (#3535,
+ Takaaki Nomura).
+3522. Old-style DGA keyboard input fix (#3536, Keith Packard).
+
+XFree86 3.9.16Za (29 December 1999)
+3521. Fix HW cursor on rendition V2K (#3532, Dejan Ilic).
+3520. Sync wacom driver with 3.3 (Frederic Lepied).
+3519. Resolve missing symbol in TDFX driver (#3531, Dave Gilbert).
+3518. Allow TDFX driver to build on Linux-axp (#3530, Dave Gilbert).
+3517. Fix Linux-axp compile problem (#3529, Dave Gilbert).
+3516. Jumbo Tiny-X patch with Itsy support (#3527, Keith Packard).
+3515. Turn off debug messages in font client code (#3525, Keith Packard).
+3414. Allow colormap privates to be allocated before default colormap
+ (#3524, Keith Packard).
+3413. Make Xserver/fb work with R6.3 server and with MSB cpu
+ (#3523, Keith Packard).
+3412. Compress built-in fonts (#3522, Keith Packard).
+3411. Fix ct_driver for static server (#3521, Takaaki Nomura).
+3410. Fix the last Xaw user of XtOffset (#3520, Keith Packard).
+3409. FreeBSD-current compile fix (#3519, Eric Anholt).
+3408. Xterm patch #122. (#3517, Thomas Dickey).
+3407. Remove duplicate symbol from loader (#3516/3528,
+ Jarno Paananen/Nicholas Brealey).
+
+XFree86 3.9.16Z (28 December 1999)
+3406. Temporary fix for building linux platform without glide (Robin Cutshaw).
+3405. Fix unresolved symbols for the loader (#3501, Matthieu Herrb).
+3404. Fix compiles on non-NetBSD systems (#3499, Matthieu Herrb).
+3403. Fix XKB XlookupString usage (#3511, Ivan Pascal).
+3402. Use ForceLatin1Lookup mode after XmbLookupString/XwcLookupString
+ (#3510, Ivan Pascal).
+3401. Export symbols for SGI driver (#3505, Terence Ripperda).
+3400. Fix problem with compilation of static server on SVR4.0
+ (#3497,3514 Takaaki Nomura).
+3399. Fix where using bitsPerPixel from screen pixmap to use drawable,
+ fix default visual class search for fallback visual, fix pixmap
+ privates allocation, change screen init sequence so that the
+ calling function is responsible for init of backing store
+ (#3495, Keith Packard).
+3398. Fix more problems between the X and font servers (#3493, Keith Packard).
+3397. Fix util/memleak to work on linux/x86 (#3492, Keith Packard).
+3396. Add DPS support hooks (#3491, Juliusz Chroboczek).
+3395. Add QNX4, Neutrino support (#3489, Frank Guangxin Liu).
+3394. Add ATI Rage 128 Pro PF support to r128 driver (#3488, Rik Faith).
+3393. AutoRepeat fix for xf86config (#3485, Harald Koenig).
+3392. Cirrus driver split for Laguna and Alpine (#3484, Derek Fawcus).
+3391. Mga_dac3026 rev A/B fixes (#3427, Mark Montague).
+3390. Jumbo font patch. This updates the bdf/misc fonts to the
+ latest ISO versions (#3429+updates, Markus Kuhn).
+3389. Fix a problem with no Xv encodings being reported (Mark Vojkovich).
+3388. Update Xv driver interface docs (Mark Vojkovich).
+
+XFree86 3.9.16f (15 December 1999)
+3387. Fix posix compliance problem in Xserver/os/utils.c
+ (Robin Cutshaw/Keith Packard).
+3386. Fix for os2_bios (#3483, Holger Veit).
+3385. Enhance DK keyboard support (#3481, Keld Simonsen).
+3384. Xv client library documentation (#3480, Mark Vojkovich).
+3383. Rendition microcode cleanup, accel fix, int10/ddc support,
+ pixmap cache fix, doc update (#3479, Dejan Ilic/Marc Langenbach).
+3382. Reverse kbdrate patch (#3478, Harald Koenig).
+3381. Add Xv support to tga driver (#3473, Matt Grossman).
+3380. Add ViRGE/MX and BIOS probing to the s3virge driver (#3470,
+ Harald Koenig).
+3379. Install NetBSD aperture driver in /usr/local until added to
+ the core O/S (#3466, Matthieu Herrb).
+3378. Add QNX/Neutrino support (#3464, Frank Guangxin Liu).
+3377. DRI megapatch. This moves mesa to xc/extras, updates Mesa to
+ version 3.2, adds full support and fifo code for 3dfx hardware,
+ and updates the device driver to work with Linux 2.3 kernels
+ (#3463, Daryll Strauss).
+3376. Fix dynamic loading on the alpha platform (#3459, Hannes Reinecke).
+3375. Add Xinerama option to the serverlayout section of the config file
+ (#3458, Joe Moss).
+3374. Add accelerated line support, clean up accel code, and other fixes
+ for the tga driver (#3453, Matt Grossman).
+3373. Restore colormap on exit in nv driver (#3452, Thomas Mueller).
+3372. Generalize the SIGIO way of reading input data (#3450, Frederic Lepied).
+3371. Fix missing quotes in Xt docs (#3443, Matthieu Herrb).
+3370. Add request bounds checking for xfs (#3449, Keith Packard).
+3369. Fix problem where font library fails to match bitmap instances
+ (#3448, Keith Packard).
+3368. Change font client code to recover from font server hangs/crashes
+ and reduce memory fragmentation (#3446, Keith Packard).
+3367. Allow MAXCLIENT to be any of 64, 128, 256, or 512 and adjust the
+ resource allocation code as appropriate (#3445, Keith Packard).
+3366. Fix compile problems with Solaris 7 (#3437, Nicholas Brealey).
+3365. Add Riva TNT2 M64 to nv_driver (#3436, Jarno Paananen).
+3364. Add prototypes for Xserver/Xprint and fix various problems with
+ Xprint (#3432, Thomas Dickey).
+3363. Add proper clock checking for VidMode extension, add SDK fixes for
+ missing files, add SilkenMouse for C&T driver (#3424, David Bateman).
+3362. Sync v4l and glint drivers with the new Xv changes (Mark Vojkovich).
+3361. Add XvImage support to the MGA driver - G200/400 only (Mark Vojkovich).
+3360. Xv changes/additions (Mark Vojkovich)
+ - XvImage support in the Xv DDX, DIX, client libs and header files.
+ - Add min and max fields to the XvAttributes.
+ - Reved Xv minor version.
+ - Rewrote some of the way clipping is dealt with in the Xv DDX.
+3359. Fix nv driver rendering bugs (Mark Vojkovich).
+3358. Add MTRR support for LynxOS (#3419, Thomas Mueller).
+3357. Fix bad return in GLINTAdjustFrame (#3418, David Holland).
+3356. Fix some build problems with the rendition driver, including a general
+ problem building the static server, and problems that show up on
+ some OSs (David Dawes, #3418, David Holland).
+
+XFree86 3.9.16e (5 December 1999)
+3355. Fix a problem with the bitmap font module (#3421, Matthieu Herrb).
+3354. Misc. bug/typo fixes. (Egbert Eich)
+3353. Fixed scanpci to generate better output on Alphas (Harald Koenig,
+ Egbert Eich)
+3352. Added initial VESA VBE support. This includes initialization
+ and DDC. (Egbert Eich)
+3351. Added support for 64bit PCI devices (untested) (Egbert Eich.
+3350. Added support to read PCI memory and io ranges from kernel on
+ Linux 2.3 (untested). (Egbert Eich)
+3349. introduced "#undef" before definitions in xf86_libc.h to keep
+ gcc on Alpha quite. (Egbert Eich)
+3348. Added a function to check if any resource needs to share memory.
+ Required for DGA. (Egbert Eich)
+3347. Added copyright messages to int10 code. Fixed int10 code to
+ run on Alphas.
+3346. Changed some byte and word access to MMIO registers in drivers
+ to use MMIO_READ/WRITE8/16(). Made attempt to make some drivers
+ 64 bit (and Alpha!) clean: s3virge, chips, gling, neomagic.
+ Fixed bugs in compiler.h. (Egbert Eich)
+3345. Made part of the code 64 bit clean. (Egbert Eich)
+3344. Cleanups in the C&T driver. (Egbert Eich)
+3343. Clearified meaning of VIDMEM_MMIO and VIDMEM_MMIO_32BIT. (Egbert Eich)
+3342. Added support for host-PCI bridges. (Egbert Eich)
+3341. Changed policy for removing resource overlaps.
+ Removed a bug in findIntersect() (xf86Bus.c).
+ Added function that enables/disables all resources of a given
+ screen. Added a config file option to set overlap removal
+ aggressiveness.(Egbert Eich)
+3340. Split xf86Bus.c into generic/pci/isa specific parts. (Egbert Eich)
+3339. Faster clocks for the G400 (Mark Vojkovich).
+3338. Fix bug in FB manager's ResizeArea function (Mark Vojkovich).
+3337. Pass positioning information for the obsolete ServerLayout format
+ to the common layer, and update the DESIGN doc for the newer ServerLayout
+ formats (David Dawes).
+
+XFree86 3.9.16d (19 November 1999)
+3336. Fx up new MMIO macros (#3337, Matt Grossman).
+3335. Clean up compiler warnings in lib/font/bitmap (#3411, Matt Grossman).
+3334. TGA fixes, add sync on green (#3410, Matt Grossman).
+3333. Fix NULL pointer dereference in libXaw (#3406, Christopher Sekiya).
+3332. Add Rage128 support (#3405, Rik Faith, funded by ATI).
+3331. Add MTRR support for NetBSD and OpenBSD. Add new NetBSD aperture driver
+ (#3404, Matthieu Herrb).
+3330. Xterm patch #121 (#3402, Thomas Dickey).
+3329. Rendition driver bugfixes and alpha related cleanups (#3400,
+ Dejan Ilic, Marc Langenbach, Egbert Eich).
+3328. Add void input device (ä3392, Frederic Lepied).
+3327. Changed the Xon serial option to be able to select xon/xoff for input,
+ output or both. Add support for Graphire models. Change wacom init
+ phase to use new Xoff option (#3391, Frederic Lepied).
+3326. Change the SwapAxes option to SwapXY in elographics/microtouch driver
+ to match an already existing option in the Dynapro driver. Add a Focus
+ class capability to the elographics driver (#3395, Patrick Lecoanet).
+3325. Update mouse rate handling (#3388, Harald Koenig).
+3324. Fix NULL pointer dereference in misprite.c (#3380, Edward Wang).
+3323. Add FBDev and ShadowFB support to glint driver. Add new option
+ "NoWriteBitmap" (#3383, Michel Daenzer).
+3322. Update SuperProbe to handle S3 Savage4, Savage200 and clean up
+ Trio3D/Savage3D detection (#3382,3384 Harald Koenig).
+3321. Add new framebuffer code and tiny X DDX architecture (#3379,
+ Keith Packard).
+3320. Add DGA2 documentation (#3378, Mark Vojkovich).
+3319. Update XFree86 manpage wrt -bpp/-depth/-fbbpp (#3377, Andy Isaacson).
+3318. Make SuperProbe check primary cards, only (#3374, Harald Koenig).
+3317. Add SilkenMouse to *BSD (#3373, Matthieu Herrb).
+3316. Allow SilkenMouse to work if not all drivers of an OS support SIGIO
+ (#3372, Keith Packard).
+3315. Fix a few problems in TGA driver and add support for backing store
+ and SilkenMouse (#3371, Matt Grossman).
+3314. Add smarter scheduler (#3370, Keith Packard).
+3313. Xterm patch #120 (#3369, Thomas Dickey).
+3312. Enable xf86SetKbdRate function on Solaris 8 (#3364, David Holland).
+3311. Fix some bugs and add acceleration to Rendition server (#3360,
+ Dejan Ilic).
+3310. Make raw DDC information available as properties in the root window
+ (#3357, Andrew Aitchison).
+3309. Fix for xf86CreateRootWindow (#3355, Andrew Aitchison).
+3308. Add manpage for the chips driver (#3353, David Bateman).
+3307. Update contact info (#3352, Andrew van der Stock).
+3306. Add kbd rate support for Linux (#3363, Harald Koenig).
+3305. Update Portuguese XKB map (#3351, Joao Esteves, Francisco Colaco).
+3304. Fix text clipping in 3dfx driver (#3349, Henrik Harmsen).
+3303. Fix S3 ViRGE hw cursor (#3348, Harald Koenig).
+3302. Fix clipping in 3dfx driver (#3342, Daryll Strauss).
+3301. Enable SilkenMouse for 3dfx driver (#3341, Henrik Harmsen).
+3300. Enable SIGIO support on LynxOS (#3339, Thomas Mueller).
+3299. Get TRUE defined in sigio.c. Fix xterm compile problem on ISC
+ (#3338, Michael Rohleder).
+3298. Correct DPMS suspend/standby modes for 3dfx driver (#3336,
+ Henrik Harmsen)
+3297. Xterm patch #119 (#3335, Thomas Dickey).
+3296. ATI LCD changes to add interlaced mode support and near-final rework of
+ mode validation (Marc La France).
+3295. Keep track of a mode's hsync and vrefresh rates used for monitor checks
+ so they can be displayed by xf86PrintModes() (Marc La France).
+3294. Add sync polarities to VESA modes (Marc La France).
+3293. Fix VESA mode typos and some warnings (Marc La France).
+3292. Add GeForce/Quadro support to the NVIDIA driver (Chas Inman,
+ Mark Vojkovich).
+3291. Fix a DGA colormap problem (Mark Vojkovich).
+3290. Disable the Double-Buffer extension in Xinerama mode since it
+ doesn't work (Mark Vojkovich).
+3289. Fix XAA scanline color expansion routines to check the buffer address
+ after the Subsequent function is called. This allows the driver to
+ change buffers on-the-fly (Mark Vojkovich).
+3288. Update PCI device IDs for newer NVIDIA chipsets (Mark Vojkovich).
+3287. Add an 80 Hz sample rate option for PS/2 mice (Mark Vojkovich).
+3286. Remove ATI driver's meddling with LCD power management facilities
+ (Marc La France).
+3285. Ensure miInitializeBanking() fails when a bank clip region cannot be
+ allocated (Marc La France).
+3284. Static server fix for s3virge and nv drivers (Marc La France).
+3283. Map MMIO areas on ATI adapters (Marc La France).
+3282. Disable DirectColor and gamma support for the original ATI integrated
+ controllers (Marc La France).
+3281. Linear aperture fixes for ATI 88800 and CT controllers (Marc La France).
+3280. Make LCD mode validation changes in ATI driver (CHANGELOG #3271)
+ into a development option, restoring the previous behaviour by
+ default (Marc La France).
+3279. When display subsection mode names run out without yeilding a valid mode,
+ continue validation with the largest unvalidated modePool member, rather
+ than the first (Marc La France).
+3278. Allow drivers to specify whether or not sync/refresh rates in monitor
+ sections are optional and use this for ATI LCD support (Marc La France).
+3277. Replace xf86Exiting with its DIX counterpart, dispatchException's
+ DE_TERMINATE bit (Marc La France).
+3276. NVIDIA driver changes (Mark Vojkovich):
+ - Improved shadowfb support (screen rotation).
+ - Improved acceleration (color expansion, lines).
+ - Fixed some rendering correctness issues.
+ - Full DGA 2.0 support including changing depth on the fly.
+3275. Make usage of hardware clipping in XAA more consistent (Mark Vojkovich).
+3274. Limit MGA driver to using 16 Meg of ram to workaround some hardware
+ limitations (Mark Vojkovich).
+3273. Fix DGA event bug (Mark Vojkovich).
+3272. Mode validation changes (Marc La France).
+ - Remove assumption that modes of the same name are also of the same
+ size.
+ - Even if Display subsection mode names include duplicates, no two names
+ will ever match the same mode.
+ - If the supplied mode names do not yield a usable mode (including the
+ case where no names are supplied), scan the mode pool until a usable
+ mode is found. This is a step towards allowing successful server
+ runs with XF86Config's that specify no mode information whatsoever.
+ - Implement minHeight and maxHeight checks.
+ - Call the driver's ValidMode() for a final OK just before accepting a
+ mode.
+ - Free mode pool on xf86PruneDriverModes() calls.
+ - Documentation updates.
+ - Minor fixes to C&T and GLINT drivers.
+3271. ATI driver updates (Marc La France).
+ - Disallow interlaced modes when scanline pitch exceeds hardware limits.
+ - LCD support no longer depends on the mode on server entry.
+ - Fix bug introduced by CHANGELOG entry 3245.
+ - Re-lock adapters on ATIPreInit() failures.
+ - Make default sync polarities consistent.
+3270. Trident updates for ISA cards and DGA support (Alan Hourihane).
+3269. mibank bug fixes (Marc La France).
+3268. Add -withrevinfo flag to lndir to allow shadowing of RCS, SCCS, CVS and
+ CVS.adm directories (Marc La France).
+3267. SIGIO workaround for older Linux kernels (Marc La France).
+3266. Fix xalloc.c compilation failure with -DXALLOC_LOG (Marc La France).
+3265. Change ATIProbe() to use int 10 vector to locate the BIOS of VGA and
+ VGA Wonder non-PCI adapters (Marc La France).
+3264. Make '-probe' work for static server and ATI driver (Marc La France).
+3263. #define _POSIX_C_SOURCE to 2 for Linux libc5 (Marc La France).
+
+XFree86 3.9.16c (13 October 1999)
+3262. Export SetCriticalEvent from DIX, it was an unresolved external in
+ xf86dga2.c (#3326, Jarno Paananen).
+3261. Removes Alpha-specific MMIO-mappings from NVIDIA driver in the
+ same fashion that was done in MGA-driver (#3326, Jarno Paananen).
+3260. Add SilkenMouse to NVIDIA and Glint drivers (#3326, Jarno Paananen).
+3259. Workaround for problem in xf86RegisterRootWindowProperty() code
+ (Jarno Paananen).
+3258. DGA workaround for recent VTSwitch changes (#3325, Mark Vojkovich).
+3257. Out of memory fixes for the mi region code (#3323, 3324, Keith Packard).
+3256. "Silken Mouse" support (#3323, Keith Packard).
+3255. Modify the ati driver to temporarily ignore Rage 128s (#3322,
+ Marc La France).
+3254. Fix offscreen memory handling for xf4bpp when VT switched away
+ (Alan Hourihane).
+3253. xf4bpp, xf1bpp, ISA additions for the trident driver (Alan Hourihane).
+3252. Fix problem with cleanup after XAA offscreen pixmap allocation fails
+ (Mark Vojkovich).
+3251. Fix missing USE_MMIO define in trident driver (Alan Hourihane).
+3250. Blade, image and trident updates for the trident driver (Alan Hourihane).
+3249. A very preliminary "-probe" mode for the X server (David Dawes).
+3248. Remove __alpha__ ifdefs from the mga and s3virge drivers by changing
+ the way sparse MMIO access is handled (David Dawes).
+3247. Fix a WarpPointer bug introduced when "xineramifying" some dix code
+ (Mark Vojkovich).
+3246. Move the BuildObjectFromLibrary rule into Imake.rules.
+3245. Fix text mode restoration when large modes are used in the ATI driver
+ (#3318, 3321, Marc La France).
+3244. Rendition driver update, including skeleton HW cursor and accelerated
+ support (#3317, Dejan Ilic, Marc Langenbach).
+3243. Change mode validation to allow drivers to modify a mode before it
+ is checked against the monitor's constraints (#3316, Marc La France).
+3242. C&T driver fix (#3314, David Bateman).
+3241. Change the ati mode validation strategy for programmable clocks to best
+ refresh (#3313, Marc La France).
+3240. Fix ATI Rage XL/XC & Mobility support so that it actually works this time
+ (#3313, Marc La France).
+3239. Update the xfsft code to version 1.1.7 (#3310, Juliusz Chroboczek).
+3238. Remaining keyboard support for Solaris 8/x86, including keyboard beep,
+ auto-repeat, keyboard LEDs, modifier keys (#3294, 3309, David Holland).
+3237. Add xf86RegisterRootWindowProperty() - a mechanism for drivers etc
+ to add properties to the root window before the screen is created
+ (#3307, Andrew Aitchison).
+3236. Fix two problems that may occur when some extension allocates a "font
+ private index" while a font is already open (#3305, Bruno Haible).
+3235. Xterm patch #118 (#3303, Thomas Dickey).
+3234. Fix a typo in a dga header file (#3302, Mark Vojkovich).
+3233. Update rendition name info in scanpci (#3301, Dejan Ilic).
+3232. Getuid fix for scanpci (#3300, Marc La France).
+3231. This patch will avoid compilation warnings when GCC 3.0 comes out (#3299,
+ Bruno Haible).
+3230. Fix some build warnings (#3298, Bruno Haible).
+3229. Fix for the DebuggableLibraries support (#3297, Bruno Haible).
+3228. Revert to always using bison instead of yacc on Linux (#3296,
+ Bruno Haible).
+3227. Fix XAA flags checking for the ScanlineImageWrite function (#3293,
+ Alan Hourihane).
+3226. Fix some problems wth the SiS 2x5 chipsets, and disable advertising
+ support for the 201 and 202 chipsets (#3292, Juanjo Santamarta).
+3225. Call SoftReset for MGA cards on PC-98 machines (#3291, Isao Ohishi).
+3224. Use the int10 soft booter to get a non-primary voodoo3 card to work
+ with the tdfx driver (#3290, Henrik Harmsen).
+3223. Fixes for the i740 and neomagic drivers (#3289, Jeff Hartmann).
+3222. Enable compiling ico on systems with pre-standard pthread API (e.g.,
+ LynxOS), and fix a problem where a condition variable is used without
+ holding the corresponding mutex (#3288, Thomas Mueller).
+3221. Add soft-booting capability to the glint and nv drivers (#3287,
+ Jarno Paananen).
+3220. Xterm patch #117 (#3285, Thomas Dickey).
+3219. Fix xf8_32bpp's VT switching by restoring the previous
+ xf86SaveRestoreImage() into it (#3284, Marc La France).
+3218. Remove duplicate symbol in misym.c (#3283, Alan Hourihane).
+
+XFree86 3.9.16b (27 September 1999)
+3217. Xterm patch #116 (#3280, Thomas Dickey).
+3216. Add new flags to the Xv adaptor type to indicate that it can be used
+ to render into window or pixmaps and do video or stills (#3279,
+ Mark Vojkovich).
+3215. Fix some MGA pci retry related corruption problems (#3278,
+ Mark Vojkovich).
+3214. Attempt to autoprobe the memory on all MGA cards except the 2164
+ (#3277, Mark Vojkovich).
+3213. APM driver updates, including bug fixes, 24bpp acceleration and
+ improved Rush support (#3276, Loic Grenie).
+3212. Some DGA fixes (3275, Loic Grenie).
+3211. Fix and document the CMAP_LOAD_EVEN_IF_OFFSCREEN option for the common
+ layer cmap code (#3274, Marc La France).
+3210. Some resource management speed improvements in Xinerama (#3273,
+ Mark Vojkovich).
+3209. Fix an off-by-one error in shadowfb's EnterVT wrapper (#3272,
+ Marc La France).
+3208. Fix ATI driver DAC handling for >8bpp TrueColor and add >8bpp
+ DirectColor support (#3271, Marc La France).
+3207. Add a hardcopy version of the Xv specs (#3270, Mark Vojkovich).
+3206. Integration of a bug fix by David Woodhouse in the Microtouch
+ driver. Correct a possible problem when configuring only one of
+ the two devices supported by the driver (#3269, Patrick Lecoanet).
+3205. Update XF86Conf.man to reflect the current state of the input drivers
+ (#3269, Patrick Lecoanet).
+3204. Add support for the ThruGlass touchscreens to the Microtouch driver
+ (#3269, Andreas Micklei).
+3203. Add SwapAxes and PortraitMode options to the Elographics and
+ Microtouch drivers (#3269, Patrick Lecoanet).
+3202. Port Microtouch and elographics drivers to the new module loading method
+ (#3269, Patrick Lecoanet).
+3201. Rewrite the way Xinerama handles visibility events. Also fix some
+ problems with CoordModePrevious primitives drawn on the root window
+ (#3267, Mark Vojkovich).
+3200. Some Xaw and xedit updates. The html-mode code is removed from xedit
+ (#3265, Paulo Cesar Pereira de Andrade).
+3199. Fix a problem with pScrn->rgbBits not being set in the correct place
+ in the tdfx driver (#3264, Scott Bertin).
+3198. Update ATI info for `XFree86 -scanpci` (#3263, Marc La France).
+3197. ATI driver changes:
+ - Rage XC & Rage XL fixes.
+ - Preliminary Rage Mobility support.
+ - Fix from Christian Lupien to disable TVOUT feature of 3D Rage
+ adapters.
+ - Work around vertical blending limitations with "shallow" modes by
+ doublescanning (accelerator CRTC) or multiscanning (VGA CRTC) them.
+ - Fix bug that did not map the VGA aperture for generic VGA support.
+ (#3260, Marc La France).
+3196. Warning fixes in miscrinit.c (#3260, Marc La France).
+3195. Rework mibank for maintenance reasons (#3260, 3281, Marc La France).
+3194. VT switching changes, implementing a framework for framebuffer layers
+ to be notified when an aperture is remapped at a different virtual
+ address during EnterVT, and improved DDX-independence for mibank,
+ and xf86SaveRestoreImage() no longer cares how the lower framebuffer
+ layers access pixmap pixels (#3260, Marc La France).
+3193. Remove scanpci's redundant check for "root". It get in the way when
+ setting its setuid bit (#3260, Marc La France).
+3192. Add several acceleration functions to the tdfx driver, and fix some
+ compliance problems (#3259, Darryl Strauss).
+3191. i740 driver updates (#3256, Kurt Olsen).
+3190. Enable image writes in the nv driver for the TNT in 32 bit mode
+ (#3255, Jarno Paananen, Neil Burch).
+3189. Remove the last global variables from the nv driver (#3255,
+ Jarno Paananen).
+3188. Turn MGA soft reset stuff back on but modified so that it doesn't
+ poll for fifos in case the PLLs aren't powered up (#3254,
+ Mark Vojkovich).
+3187. Xterm patch #115 (#3253, Thomas Dickey).
+3186. Comment out some of the CacheBlit tiling code since the logic is not
+ quite correct and it can get stuck in an endless loop in some cases
+ (#3250, Mark Vojkovich).
+3185. Fix tseng 24 bpp mode (#3249, Egbert Eich).
+3184. Fix et4000W32p font corruption with ColorExpandScanline in modes > 8bpp
+ (#3249, Egbert Eich).
+3183. Add Solaris 8 support (#3241, 3247, David Holland).
+3182. Fix some build problems in the Type1 code that show up on Solaris 8
+ (#3241, David Holland).
+3181. Add an ISO8859-1 version of the "micro" font (#3246, Mark Montague).
+3180. Minor DDC code improvement: xf86PrintEDID() now returns pointer to
+ monitor structure (#3245, Egbert Eich).
+3179. Problem with RAC wrapper (hopefully) fixed (#3245, Egbert Eich).
+3178. Neomagic ScreenToScreenCopy bug fix (#3245, Egbert Eich).
+3177. Initial INT10 module (Linux-only so far) (#3245, 3248, 3251, Egbert Eich).
+3176. Update the DRM Linux kernel module to match that in the Linux 2.3.18
+ tree, and update libdrm and the DRI routines that use libdrm to reflect
+ changes in the Linux kernel (#3244, Rik Faith).
+3175. Fix a WarpPointer bug in Xinerama (#3243, 3252, Mark Vojkovich).
+3174. Fix a seg fault when changing DGA mode (#3242, Loic Grenie).
+3173. Xterm patch #114 (#3240, Thomas Dickey).
+3172. Fix an XAA GC validation problem with Polygons for some fillStyles in
+ some situations (#3239, Mark Vojkovich).
+3171. Fix an incorrect method for preallocating a color on the default map
+ (#3237, Mark Vojkovich).
+3170. Fix a bad assumption in the XAA NonTE text rendering code (#3236,
+ Mark Vojkovich).
+3169. An attempt to autodetect the G400 Max and set the max pixel clock
+ appropriately (#3235, Mark Vojkovich).
+3168. Fix shadowfb problems when drawing is done while switched out (#3234,
+ Marc La France).
+3167. Attempt to autodetect SDRAM in the MGA driver for the primary head
+ (#3233, Mark Vojkovich).
+3166. Make Window->Pixmap copies in Xinerama less broken (#3232,
+ Mark Vojkovich).
+3165. Fix a bug in the Xinerama ShmGetImage support added in the last alpha
+ (#3230, Mark Vojkovich).
+3164. New cursor warping code. This implements the new way of specifying
+ screen positions in the ServerLayout config file section (#3229,
+ Mark Vojkovich).
+3163. Add a xf86CheckMTRR function which returns TRUE when changing the
+ MTRR setting is supported and enabled (#3227, Alan Hourihane).
+3162. Resync SuperProbe and scanpci with the 3.3.x version (#3226,
+ Marc La France).
+3161. Make 8+24 work on Matrox 2064w (Millennium I) with >4MB (#3224,
+ Mark Montague).
+3160. Make xdpyinfo -ext XFree86-VidModeExtension print the current mode line
+ (#3223, Andrew Aitchison).
+3159. Minor fix to Xnest Imakefile (#3222, Marc La France).
+3158. Make the wrapping or replacement of ScreenRec region code function
+ pointers reliable when NEED_SCREEN_REGIONS is #define'd (#3221,
+ Marc La France).
+3157. Remove ScreenRec region code function pointers (except BitmapToRegion)
+ when the server is compiled with NEED_SCREEN_REGIONS #undef'ined
+ (#3221, Marc La France).
+3156. Fix memory leak during resource broker initialisation (#3220,
+ Marc La France).
+3155. During broker initialisation, use both system and non-system PCI
+ resources to "trim" OS resources. Among other things, this allows the
+ maximum memory limit to be bumped back up to 2G (#3220, 3282,
+ Marc La France).
+3154. Temporarily allow a driver to register resources that only conflict with
+ resources whose size the common layer has only estimated (#3220,
+ Marc La France).
+3153. ATI driver updates, including:
+ - Add option to display on the CRT interface whether or not a digital
+ flat panel is detected.
+ - Add support for ShadowFB (adapted from Henrik Harmsen).
+ - Always read BIOS from legacy location for adapters found enabled on
+ server entry.
+ - Ensure the primary CRTC is always used for the CRT interface.
+ - Fix determination of panel dimensions with older BIOS's.
+ - Stop driver when panel dimensions cannot be determined.
+ (#3219, Marc La France).
+3152. Thread-related updates to 'ico' (#3217, Carlos A M dos Santos).
+3151. Fix a build problem on 64-bit platforms introduced in 3.9.16a (#3216,
+ Matt Grossman).
+
+XFree86 3.9.16a (6 September 1999)
+3150. Add support to the parser for a new way of specifying the screen
+ positions (not made use of yet) (David Dawes).
+3149. Remove a spurious #endif in linux.cf (#3215, Jarno Paananen).
+3148. Add driver option VIDEO_OVERLAID_STILLS for the Xv DDX (untested)
+ (#3214, Mark Vojkovich).
+3147. Comment out the MGASoftReset() call in the mga driver to fix a
+ multi-head problem (#3213, Mark Vojkovich).
+3146. xman updates, including some app-defaults file tuning, change some
+ widget names for better consistency, reformat the help file and
+ update the man page (#3212, Carlos A M dos Santos)..
+3145. Add support for DG/ux systems to xload (#3212,
+ Takis Psarogiannakopoulos).
+3144. App-defaults file updates for xcalc (#3212, Carlos A M dos Santos).
+3143. Fix some prototypes/casts in viewres (#3212, Carlos A M dos Santos).
+3142. Add an XtSetLanguageProc() call to all contrib programs except xman
+ (#3212, Carlos A M dos Santos).
+3141. Fix a zero-height bug in the xaa text code (#3211, Mark Vojkovich).
+3140. ScreenToScreenColorExpansion bug fix for the G400 (#3210,
+ Mark Vojkovich).
+3139. Xineramify ShmGetImage (#3209, Mark Vojkovich).
+3138. Rewrite PanoramiXGetImage so that it passes xtest (#3209,
+ Mark Vojkovich).
+3137. Increase IMAGE_BUFSIZE to 64k (#3208, Mark Vojkovich).
+3136. Remove the "old input" code (David Dawes).
+3135. Fix a problem with xman that prevents it form recognising the
+ XM_DELETE_WINDOW message when xman is run with the "topbox" disabled
+ (#3207, Carlos A M dos Santos).
+3134. Prevent xkbcomp from overwriting writing through symlinks (#3206,
+ Branden Robinson).
+3133. Use ncurses instead of termcap for Linux/libc6 (#3204, H.J. Lu).
+3132. Fix a build problem with the tdfx driver (#3203, Takaaki Nomura).
+3131. Add a clean rule to remove the automatically generated
+ doc/sgml/index.sgml file (#3202, Marc La France).
+3130. Fix some build warnings (#3202, Marc La France).
+3129. Add missing files for the Rush extension (#3199, Loic Grenie).
+3128. Export the xf86InitFBManagerRegion symbol.
+
+XFree86 3.9.16 (31 August 1999)
+3127. Potential fix for a server crash when connecting from a byte-swapped
+ client in Xinerama mode (based on #3196, Attila Fülöp).
+3126. Build xterm/resize with -lncurses on Debian (#3197, Attila Fülöp).
+3125. Allow inclusion of Xvlib.h into C++ code (#3195, Vladimir Dergachev).
+3124. Modify the ISO-8859-{6,7,10} to Unicode tables so that they agree with
+ the tables found on ftp.unicode.org (#3172, Bruno Haible).
+3123. Some minor C&T bug fixes (#3194, David Bateman).
+3122. Xman update (#3174, Carlos A M dos Santos).
+3021. Import some xkb data file updates from 3.3.5.
+3020. Fix a build problem on Alpha platforms (#3191, Matt Grossman).
+3019. Allow driver SDK builds for the i740 driver (#3190, Daryll Strauss).
+3018. Allow driver SDK builds for the tdfx driver, and allow it to be built
+ without DRI support (#3189, Daryll Strauss).
+
+XFree86 3.9.15d (29 August 1999)
+3017. 3Dfx driver for Banshee and Voodoo3 (#3188,
+ Daryll Strauss/Precision Insight).
+3016. Fix a 24/32 GetImage problem (#3187, Mark Vojkovich).
+3015. Intel i740 driver (#3186, Precision Insight/Daryll Strauss).
+3014. Fix a planemask problem in 24bpp with the recently added MGA point
+ speedups (#3185, Mark Vojkovich).
+3013. Some new and updated ISO 10646-1 fonts, including 5x7, 6x10, 6x13, 6x13B,
+ 7x13, 7x13B, 7x14, 7x14B, 8x13, 8x13B, 9x15, 9x15B, 10x20, 9x18, 12x13ja,
+ 18x18ja (#3184, Markus Kuhn, Robert Brady, Birger Langkjer,
+ Constantine Stathopoulos).
+3012. Update the default xdm config file to disable listening for XDMCP
+ requests (#3183, Matthieu Herrb).
+3011. Reinstate the code to stop DDC1 problems on secondary screens with
+ the MGA driver (#3182, Andrew Aitchison).
+3010. Fix for the option handling in the glide driver (#3181, Henrik Harmsen).
+3009. NVIDIA doc update (#3179, Jarno Paananen).
+3008. Doc update for the C&T driver (#3176, David Bateman).
+3007. Update some of the bindist files (#3175, Michael Rohleder).
+3006. Fix a libXfont build problem that shows up on IUS (#3175,
+ Michael Rohleder).
+3005. Xaw and xedit updates (#3174, 3180, Paulo Cesar Pereira de Andrade).
+3004. Add a new DebuggableLibraries imake parameter to allow libraries to
+ be built with debugging symbols, and enable this by default for Linux
+ (#3173, Bruno Haible).
+3003. Some Driver SDK build fixes (#3172, David Bateman).
+3002. Modify the MGA driver to fall back to DDC1 if DDC2 fails or is
+ disabled (#3171, Andrew Aitchison).
+3001. Allow the -allowMouseOpenFail X server command line option to be
+ recognised independently of the XFree86-Misc extension (#3170, Joe Moss).
+3000. Update NetBSD's and OpenBSD's aperture driver to remove a warning from
+ xf86ReadBIOS() during xf86Config.c's PC98 detection on non-PC98 systems
+ (#3169, Marc La France).
+2999. Disable setting the default gamma from the DDC data (#3168,
+ Andrew Aitchison).
+2998. Update the microtouch input driver for "NEW_INPUT", and re-enable
+ building it (#3178, David Woodhouse).
+2997. Back out the change in 3.9.15c that includes "non-system" resources
+ in the RAC "system" resources list (#3167, Marc La France).
+2996. Update the RELNOTES for DDC (#3165, Andrew Aitchison).
+2995. Fix a problem with xf86ReadBIOS() on NetBSD/OpenBSD (#3164,
+ Marc La France).
+2994. Add an XLC_LOCALE file for zh_TW.Big5 (#3163, Pablo Saratxaga).
+2993. Add dummy Compose files for encodings that don't already have them
+ (#3163, Pablo Saratxaga).
+2992. APM driver updates. The Rush extension is now included in the driver
+ (some files missing, so not enabled yet) (#3162, 3159, Loic Grenie).
+2991. Some fixes for the VidMode extension (#3161, Loic Grenie).
+2990. Update SuperProbe to recognise the APM AT3D chipset (#3160, Loic Grenie).
+2989. Some fixes for the nv driver (#3158, Jarno Paananen).
+2988. Fix a typo in ObjectFromAsmSource() in xf86.rules (#3157,
+ Matthieu Herrb).
+2987. Add some NVIDIA cards to the Cards file (#3155, Jarno Paananen).
+2986. A quick hack to cut down on XAA pixmap cache thrashing that
+ happens with some particular apps (#3154, Mark Vojkovich).
+2985. Update the tabtcvn file to include the full tcvn-5712 encoding, not
+ only lowercase characters (#3153, Pablo Saratxaga).
+2984. Create the doc index list from information in the .sgml files
+ (David Dawes).
+2983. Basic man page for the generic VGA driver (David Dawes).
+2982. Fix for lockup problem with Trident Image 975 (Alan Hourihane).
+
+XFree86 3.9.15c (22 August 1999)
+2981. Update NetBSD.cf to reflect NetBSD's switch from GNU malloc to FreeBSD's
+ malloc (#3151, Bernd Ernesti).
+2980. Change xf86ReadBIOS() to reuse the fd for /dev/mem or /dev/xf86 from
+ the other bsd_video.c functions in order to avoid the difficulty caused
+ by the NetBSD aperture driver only allowing one open of /dev/xf86 at
+ a time (#3150, Matthieu Herrb).
+2979. Add pre-R6.4 compatible entries to the NLS .dir and .alias files. This
+ should make it possible for them to be used with older versions of Xlib.
+2978. Fix a typo in the MGA arc code that broke some arcs (#3149,
+ Mark Vojkovich).
+2977. Fix a problem with cfb allocating too much space on the stack when
+ clipping rects (#3148, Mark Vojkovich).
+2976. Add missing sync when uploading into the XAA pixmap cache (#3147,
+ Mark Vojkovich).
+2975. Change XDGAFlush() to XDGASync() (#3146, Mark Vojkovich).
+2974. Add transparent DGA blits to the MGA driver, and enable the OverclockMem
+ option for the G400 (#3145, Mark Vojkovich).
+2973. Update the common cursor code to keep virtual desktop panning from
+ interfering with screen rotation (#3144, Mark Vojkovich).
+2972. Dynapro driver update: initialise the incoming packet state machine,
+ and add a "SwapXY" option (#3142, David Woodhouse).
+2971. Fix a loader problem that shows up on Alpha/ELF platforms when there
+ is a .sbss section (#3141, Hannes Reinecke).
+2970. Modify DDC for neomagic (#3139, Egbert Eich).
+2969. Add DDC support for the S3 ViRGE (DDC2 untested) (#3139, Egbert Eich).
+2968. Fix DDC2 support for MGA and C&T drivers (#3139, Egbert Eich).
+2967. Add a call to xf86SetPciVideo(NULL,NONE) after each probe (#3139,
+ Egbert Eich).
+2966. Modified registration of the OS access windows (#3139, Egbert Eich).
+2965. Some Xaw and xedit fixes (#3138, Paulo Cesar Pereira de Andrade).
+2964. Next round of the font ansification and warning removal (#3135,
+ Matthieu Herrb).
+2963. Fix ATI 18800-x detection problem (#3133, Marc La France).
+2962. Check for limitations on vertical blending in panel support for the ATI
+ driver (#3133, Marc La France).
+2961. Update ATI driver to complain about bad BIOS data (#3133,
+ Marc La France).
+2960. Man page corrections for the MGA driver (#3132, Mark Vojkovich).
+2959. Limit PCI BIOS apertures to 16MB as per the PCI 2.1 spec (#3131,
+ Marc La France).
+2958. Assume a system has up to 1G of physical memory installed, rather than
+ 2G (#3130, Marc La France).
+2957. Fix a bug in the handling for buggy VGA CRTCs (#3129, Marc La France).
+2956. Fix to build the mga driver with the driver SDK (#3128, David Bateman).
+2955. Xterm patch #113 (#3125, Thomas Dickey).
+2954. Port the XAA cfb copyplane functions, adding them to the cfb code
+ (#3124, 3126, 3127, David Bateman).
+
+XFree86 3.9.15b (15 August 1999)
+2953. Improved point rendering performance for the MGA driver (#3123,
+ Mark Vojkovich).
+2952. Xaw and xedit updates (#3122, Paulo Cesar Pereira de Andrade).
+2951. Remove the Latin2 Type1 fonts.
+2950. Change the RGB mask names in the DGA structures (#3120, Mark Vojkovich).
+2949. More acceleration and bug fixes for the NV driver (#3119,
+ Jarno Paananen).
+2948. Change some things in the XAA color expansion code to facilitate
+ rendering into DMA buffers (#3118, Mark Vojkovich).
+2947. Fix a 64 bit problem with the xf24_32bpp layer (#3117, Mark Vojkovich).
+2946. Modify XF86FlushInput() to work for non-tty devices, which is required
+ for PS/2 mice with Linux 2.2.x kernels (#3114, Kazutaka Yokota).
+2945. Support for rotating the virtual desktop for the MGA driver using
+ the shadowfb (#3113, 3116, Mark Vojkovich).
+2944. Fix a colormap problem with DGA when initialized from an 8+24 mode with
+ the MGA driver (#3112, Mark Vojkovich).
+2943. Fix multihead on the MGA-2164W (#3111, Mark Vojkovich).
+2942. XAA speedups for planar copies in some cases (#3110, Mark Vojkovich).
+2941. Add a driver SDK which performs a similar function to the old LinkKit,
+ but for the loadable server (#3105, David Bateman).
+2940. C&T doc update and xgamma man page update (#3105, David Bateman).
+2939. Add an option to the C&T driver to allow the user to select the
+ transparency key when using the overlay (#3105, David Bateman).
+2938. Add DGA2 support to the C&T driver (#3105, David Bateman).
+2937. Fix a bug in the bitmap font code introduced in 3.9.15a (#3101,
+ Juliusz Chroboczek).
+2936. Some TGA driver cleanups, including a SaveScreen function and code to
+ disallow virtual desktops in a nicer way (#3100, Matt Grossman).
+
+XFree86 3.9.15a (1 August 1999)
+2935. Fix the RAC usage in the nv driver to allow multi-head to work
+ (#3093, Itai Nahshon).
+2934. Reduce memory consumption of the bitmap font backends when using
+ sparse fonts, which is important when using Unicode-encoded fonts
+ (#3092, Juliusz Chroboczek).
+2933. Fix Option register initialisation in multi-head for MGA 2064/2164
+ (#3089, Andrew Aitchison).
+2932. Convert the nv (NVIDIA) driver from 3.3.4 (#3078-3080, 3087,
+ Jarno Paananen).
+2931. Add SuperProbe for NetBSD 1.4 wscons (#3083, Matthias Drochner).
+2930. Fix button and modifier key state problems in DGA (#3082,
+ Mark Vojkovich).
+2929. Avoid a possible segmentation fault in "xsm" which, for example,
+ occurs local hostname can't be resolved (#3073, Matthias Scheler).
+2928. ATI driver updates, including:
+ - Add preliminary panel support.
+ - Rework RAC interface.
+ - PCI VGA's not on primary bus are now detected.
+ - Fix bug when an adapter's VGA has been disabled.
+ - Fix gamma support.
+ (#3069, Marc La France)
+2927. Fix 8514/A pre-defined resource and pre-define VGA sparse I/O resources
+ (#3069, 3081, Marc La France).
+2926. Fix a bug in the registration of background device BIOS'es (#3069,
+ Marc La France).
+2925. Invert the meaning of ResMinimised bit into ResEstimated (#3069,
+ Marc La France).
+2924. Allow drivers to print resource lists, and allow them to enable/disable
+ adapters before creating bus slots for them (#3069, Marc La France).
+2923. Resync SuperProbe and scanpci with 3.3.x (#3069, Marc La France).
+2922. Add some missing man pages for the DGA and VidMode extensions (#3064,
+ Joe Moss).
+2921. Some changes to the DGA and colormap layers to allow gamma changes
+ during DGA mode (#3060, Mark Vojkovich).
+2920. Fix XIM segv error (#3033, 3051, Manabe Takashi).
+2919. Add a client state callback to the DGA extension so that the server side
+ can be cleaned up when a DGA client exits (#3048, 3049, Mark Vojkovich).
+2918. Update the FreeBSD/mouse documentation (#3047, Kazutaka Yokota).
+2917. Fix an undocumented blitter constraint on the G200 (#3046,
+ Mark Vojkovich).
+2916. Fix the MGA driver so that it can support changing depth on the fly
+ in DGA mode. All depths are now offered to DGA clients regardless of
+ what the screen's main depth is (#3045, Mark Vojkovich).
+2915. Fix a bug in the InstallGenManPageLong() rule in lynx.cf (#3043,
+ Thomas Mueller).
+2914. Update ATI doc with info about a VGA/RAC problem (#3044,
+ Andrew Aitchison).
+
+XFree86 3.9.15 (19 July 1999)
+2913. -
+2912. Fix a problem with the library spec in xgc/Imakefile (#3042,
+ Thomas Mueller).
+2911. Add native 69030 support to the C&T driver (#3041, David Bateman).
+2910. Update release notes for the apm driver (#3040, Loic Grenie).
+2909. Fix a small bug in the color expands in the TGA driver (#3039,
+ Matt Grossman).
+2908. Updates for the Japanese (PC98) docs (#3038, Takaaki Nomura).
+2907. Some Xaw and xedit updates (#3037, Paulo Cesar Pereira de Andrade).
+2906. Fix a problem with the VidMode extension (#3036, David Bateman).
+2905. Sample config file for Japanese PC98 architecture (#3035,
+ Takaaki Nomura).
+
+XFree86 3.9Py (18 July 1999)
+2904. Add a visualClass to the XDGAMode request and a XDGACreateColormap
+ request to DGA 2.0 so Colormaps can be created for XDGADevices
+ without needing a corresponding visual (#3032, Mark Vojkovich).
+2903. Update the mmap versions of xf86ReadBIOS() to use a map size that
+ fits the requested BIOS offset and length rather than using a fixed
+ map size (David Dawes).
+2902. Xterm patch #112 (#3031, Thomas Dickey).
+2901. Change the colormap layer's LoadPalette function to take a Visual as
+ an argument rather than just the Visual class (#3030, Mark Vojkovich).
+2900. Add some code to auto-detect Japanese PC98 systems (#3029,
+ Takaaki Nomura).
+2899. Fix a casting problem in DefineSelf() that shows up on FreeBSD/alpha
+ (#3028, Doug Rabson).
+2898. Fix a problem with the GMX2000 DRI support (#3034, Jens Owen).
+2897. Work around a problem in mfb that is caused by an optimiser bug
+ in egcs-1.1.2 for the alpha (#3027, Doug Rabson).
+2896. Fix a problem that shows up in the s3virge driver after the recent
+ vgahw module changes (David Dawes).
+2895. Add missing references to xf86MiscExt.c in common/Imakefile (#3025,
+ Joe Moss).
+2894. Update for the apm driver so that it will work on a Japanese PC-98
+ with GA-RUSH6/PCI(VoodooRUSH based video card) (#3024, Isao Ohishi).
+2893. ISO 10646-1 Japanese font (12x13ja.bdf) that covers a superset of
+ CP1252 and JIS X 208, and which is suitable to be used together with
+ 6x13 for bi-width Japanese text output (#3022, Markus Kuhn).
+2892. Refine the MouseMan+ (PS2++) protocol support (#3020, Kazutaka Yokota).
+2891. Fix problems with the wheels on some mice, including the OEM version of
+ the Logitech FirstMouse+, are not recognized and the mouse cursor jumps
+ around (#3020, Kazutaka Yokota).
+2890. Fix a problem building the X-TT modules on Solaris 7 (based on #3019,
+ David Holland).
+2889. Fix a bug in Xaw/TextAction.c introduced in 3.9Pw (#3018,
+ Paulo Cesar Pereira de Andrade).
+2888. ISO 10646-1 version of the 5x7 and 6x13B fonts, and an update for the
+ 6x13 font (#3017, Markus Kuhn).
+2887. First part of the ansification of xc/lib/fonts. So far the bitmap,
+ fc and fontfile directories have been done (#3016, Matthieu Herrb).
+2886. Fix default PC98 XKB setting (#3015, Akio Morita).
+2885. Remove the reference to VGADriverDoc in xfree86/Imakefile (#3015,
+ Takaaki Nomura).
+2884. Fix a bug in Xaw/TextPop.c (#3014, Paulo Cesar Pereira de Andrade).
+2883. Man page update for xfontsel (#3013, Paulo Cesar Pereira de Andrade).
+
+XFree86 3.9Px (12 July 1999)
+2882. Updates to get XF86Setup to build again after the NewInput-related
+ changes, and have XF86Setup print a short message stating that it
+ isn't usable before exiting (#3012, Joe Moss).
+2881. Fix some compiler warnings in lib/Xext (#3011, Matt Grossman).
+2880. Fix a bug in the wacom driver that shows up when multiple wacom devices
+ don't report the same valuators (#3010, Frederic Lepied).
+2879. Some updates to the PCI/RAC code (#3008, Egbert Eich).
+2878. Fix the acute and apostrophe mixup in the German xkb layout with the
+ nodeadkey option, and add the EuroSign to AltGr+e (#3006, Markus Kuhn).
+2877. Add code to the mga driver to handle PC98 architecture machines
+ (#3007, Takaaki Nomura).
+2876. Add a global (ServerFlags) "PC98" Option for the Japanese PC98
+ architecture, and add a function xf86IsPc98() that drivers can call
+ to check for this.
+2875. Fix a relocation problem in the ELF loader that shows up on 64-bit
+ platforms when mapping unresolved symbols to LoaderDefaultFunc()
+ (#3005, Doug Rabson).
+2874. Remove the original text version of the DESIGN doc from hw/xfree86.
+2873. Fix a glyph padding problem in XAA's nonTE text code that shows up on
+ 64-bit platforms (Doug Rabson).
+2872. Rework the wacom driver's init phase (#3004, Frederic Lepied).
+2871. Add a 19200 speed option to the wacom driver for Airbrush tablets
+ (#3004, Frederic Lepied).
+2870. Add support for transparent stipples to the tga driver (#3003,
+ Matt Grossman).
+2869. Modify xfontsel to not show scaled fonts by default (#3002,
+ Paulo Cesar Pereira de Andrade).
+2868. Some notes about xterm for the release notes (#3001, Thomas Dickey).
+2867. Some Xaw, Xmu and xedit updates (#2999, 3002,
+ Paulo Cesar Pereira de Andrade).
+2866. Xterm patch #111 (#2998, Thomas Dickey).
+2865. Fix a "NoAccel" problem with the PM2 video support (#2997,
+ Michael Schimek).
+2864. Update for lynx.cf (#2995, Thomas Mueller).
+2863. Fix a LynxOS macro clash with the cirrus driver, and fix a
+ xf86UnmapVidMem() warning in the cirrus driver (#2995, Thomas Mueller).
+2862. Fix a problem on LynxOS where assert is unresolved in the static server
+ (#2995, Thomas Mueller).
+2861. Fix a problme with vsnprintf being unresolved when building Xvfb
+ and Xnest on some platforms (#2995, Thomas Mueller).
+2860. Remove the s3virge fifo_ changes introduced in 3.9Pu, update the
+ DGA2 support and docs (#2994, Kevin Brosius).
+2859. Initial attempt to get the XFree86-Misc again (#2993, Joe Moss).
+2858. Remove XAASync() (#2992, Rik Faith).
+2857. Cleanup the TGA driver's hw cursor code, remove global variables in
+ in the "accel" files, and fix up the RAC support (#2991, Matt Grossman).
+2856. Add partial support for color expands to the 8-bit TGA driver (#2991,
+ Matt Grossman).
+2855. Re-enable DDC2 support in the MGA driver (#2989, Andrew Aitchison).
+2854. Add missing TIOC defines for Interactive Unix to xf86_OSlib.h (#2990,
+ Michael Rohleder).
+2853. Don't register the Xqueue mouse handler for Interactive Unix (#2990,
+ Michael Rohleder).
+2852. Don't include sys/mman.h in cidchar.c when USE_MMAP isn't defined
+ (#2990, Michael Rohleder).
+2851. Disable BuildXF86DRI and BuildXF86DRIDriverSupport for Interactive Unix
+ (#2990, Michael Rohleder).
+2851. Update the apm (Alliance ProMotion) driver (#2987, 2988, Loic Grenie).
+2850. Fix a problem with the xf86config screen configuration that was
+ introduced with the removal of "32bpp" (#2986, Matthieu Herrb).
+2849. Add a DefaultDepth configuration page to xf86config (#2986,
+ Matthieu Herrb).
+2848. Add the inputDevice examples from XF86Config.eg to config files
+ generated by xf86config (#2986, Matthieu Herrb).
+2847. Modify the vgahw module to allow it to save/restore more than the
+ standard number VGA CRTC, Sequencer, Graphics and Attribute registers
+ (2985, 2996, Jeff Garzik).
+2846. Add DDC information to the release notes (#2984, Andrew Aitchison).
+2845. Change XDGAChangePixmapMode to return the X-Y position of the pixmap
+ in case the server is not able to place it exactly where requested
+ (#2983, Mark Vojkovich).
+2844. Fix some problems with unfavorable alignment of XAA offscreen pixmap
+ (#2982, Mark Vojkovich).
+2843. Some XAA speedups for NonTE text in certain cases (#2981,
+ Mark Vojkovich).
+2842. Rename the assembler files that need preprocessing from .s to .S,
+ and adjust the imake rules accordingly.
+2841. A fix for xf86PciReadBios() (#2979, Egbert Eich).
+2840. Fix a problem with false detection of multi-function PCI devices (#2978,
+ Loic Grenie).
+2839. Fix a problem with libXfont.a not being linked into exports/lib during
+ the build phase (#2977, Thomas Mueller, 2990, Michael Rohleder).
+2838. Deal with OSes which don't have TIOCM ioctls in posix_tty.c (#2976,
+ Thomas Mueller).
+2837. Fix the use of TIOCM_ in some calls to xf86SerialModem..() in mouse/pnp.c
+ (#2976, Thomas Mueller).
+2836. Enable NEW_INPUT on LynxOS (#2976, Thomas Mueller).
+
+XFree86 3.9Pw (6 July 1999)
+2835. Fix for GetBlock() (#2974, Egbert Eich).
+2834. Remove the test for SHAREDIOCLASS when creating a pciAccessInfoRec for
+ a device (#2974, Egbert Eich).
+2833. Modified BIOS ROM handling, doing validation only on demand (#2974,
+ Egbert Eich).
+2832. Add a ChangeGamma function to the ScrnInfoRec, which allows drivers to
+ optionally provide a function to do this instead of the default one
+ provided by the colormap layer (#2972, Mark Vojkovich).
+2831. Sis driver memclock fixes (#2971, Bart Oldeman, Juanjo Santamarta).
+2830. Add snprintf() and vsnprintf() to libc emulation (#2970, Marc La France).
+2829. Increase array size in PciInfo data (#2970, Marc La France).
+2828. Add a LoaderRefSymbols() function (#2970, Marc La France).
+2827. When matching fixed clocks, prefer non-CLKDIV2 modes over CLKDIV2 modes
+ (#2970, Marc La France).
+2826. Reinstate xf86GetPciConfigInfo() and some warning fixes (#2970,
+ Marc La France).
+2825. Build libXext and libX11 client-side libraries when also building
+ GLX, despite BuildServersOnly (#2970, Marc La France).
+2824. Update ATI doc (#2970, Marc La France).
+2823. ATI driver from 3.3.3.1 (rac interface is preliminary, no LCD panel
+ or Rage 128 support yet) (#2970, Marc La France).
+2822. Fix Ukrainian_GHE_with_upturn double definition error (#2969,
+ Peter Novodvorsky).
+2822. Updates to the xf86config utility for the 4.0 config file format
+ (#2968, Matthieu Herrb).
+2821. Add default rules to allow easy compilation of .c files to assembler.
+
+XFree86 3.9Pv (4 July 1999)
+2820. Add a marked up (SGML) version of the DESIGN doc (David Dawes).
+2819. Remove the Alpha-specific Linux libc6 parts in linux.cf.
+2818. Add a "defs.ent" file for defining SGML entities that can be shared by
+ other docs (David Dawes).
+2817. Import the mouse.sgml doc from 3.3.x, and update it for 4.0.
+2816. Remove support for the very old LinuxDoc tools.
+2815. Use SpecialCObjectRule() in favour of SpecialObjectRule().
+2814. Fix lots of 64-bit problems in XAA (#2967, Mark Vojkovich).
+2813. Add a new DGA request to allow switching the DGA pixmap from one the
+ size of the framebuffer to one the size of the viewport that you
+ can move around (#2966, Mark Vojkovich).
+2812. Make sure that all Xinerama heads have the same root window depth,
+ and don't advertise backing store or save unders as being available
+ unless it's available on all heads (#2965, Mark Vojkovich).
+2811. Some Xaw and xedit updates (#2964, Paulo Cesar Pereira de Andrade).
+2810. Some DRI updates (#2962, Rik Faith).
+2809. Fix a double-free problem in the mouse driver (#2959, Egbert Eich).
+2808. Add some debugging code to xalloc.c to detect and allow trapping of
+ double xfree() calls (#2954, Egbert Eich).
+2807. Add Single GLINT MX support for Direct Rendering, which now allows
+ ELSA Gloria XXL to take part in this (#2592, 2955, 2957, 2958,
+ Alan Hourihane and #2960, Rik Faith).
+2806. Add ScanlineCPU function to the glint driver for PM2 when pci
+ retries aren't used (#2952, Alan Hourihane).
+2805. Use mediumraw keyboard mode for LinuxPPC (#2946, Gerd Knorr).
+2804. Xterm patch #110 (#2943, Thomas Dickey).
+2803. Add CyberBlade/i7 (Socket 7), CyberBlade/i7 DSTN (Laptop Socket 7) and
+ CyberBlade/i1 (Slot 1) support to the trident driver (#2940,
+ Alan Hourihane).
+2802. Some new PCI ids for Cyberblades and Via MVP4 (#2939, Alan Hourihane).
+2801. Replace `__volatile__' in xf86drm.h with `volatile' (#2938,
+ Takaaki Nomura).
+2800. Fix a problem with the umask not being reset in some cases in the
+ xtrans code (#2936, Bill Nottingham).
+2799. Improve the latency associated with writing to the PCI config space,
+ which is important for RAC to work efficiently (Egbert Eich).
+
+XFree86 3.9Pu (27 June 1999)
+2798. Xterm patch #109 (#2920, Thomas Dickey).
+2797. Xaw and xedit updates (#2932, 2933, Paulo Cesar Pereira de Andrade).
+2796. Make the "fifo_conservative" memory settings default for the s3virge
+ accelerator (#2931, Kevin Brosius).
+2795. Preliminary DGA2 code for the s3virge driver (#2931, Kevin Brosius).
+2794. Updates to PI's DRI sample implementation, including:
+ - Dynamic loading of the OpenGL client driver is implemented
+ - 3D client death while holding the drawable lock does not cause deadlock
+ - The kernel module works with Linux 2.2.x [x <= 10] and 2.3.y [y <= 8]
+ - A better authentication mechanism has been implemented
+ - XF86Config options for the DRI are supported
+ (#2929, Precision Insight).
+2793. Add functions to the FBManager to query the largest size available and
+ to purge all areas that aren't nailed down (#2928, Mark Vojkovich).
+2792. Fix some serious performance problems with Xinerama when the number
+ of resource IDs becomes large (#2927, Carsten Haitzler).
+2791. Remove the significant RGB bits check from Xinerama visual eliminations
+ (#2926, Mark Vojkovich).
+2790. Fix a typo in xmodmap and xstdcmap (#2924, Matthieu Herrb).
+2789. Fix the type of the OverclockMem Option in the MGA driver (#2922,
+ Andrew Aitchison).
+2788. Fix PCI resource handling problems that were showing up with the
+ glint driver (#2918, Egbert Eich).
+2787. Fix a problem building some Makefiles when JoystickSupport is enabled
+ (#2917, Todd Fries).
+2786. Fix a typo in the RAC support for the glint driver (#2915, Jens Owen).
+2785. Fix a RAC-related build problem on 64-bit machines (#2913,
+ Matt Grossman).
+2784. Some afb-related updates (#2911, Sven Luther).
+2783. Fix race condition in xinit (Nate Eldredge, Mark Montague).
+2782. Documentation for the new RAC code (Egbert Eich).
+2781. Fix some problems with the glide driver that can result in server crashes
+ if there is a problem when it is starting up (David Dawes).
+2780. Install the X server signal handlers before xf86OpenConsole is first
+ called. This makes sure that the VT is returned to text mode if the
+ server crashes in the early stages of InitOutput() (David Dawes).
+2779. Fix xf86vsprintf() and xf86vfprintf().
+2778. Support for the different PLL reference clock used for HP's on-board
+ G200s.
+2777. Disable building the Xanti extension (Mark Vojkovich).
+2776. Update the log file handling to catch most messages that are generated
+ before the log file is actually opened (David Dawes).
+2775. Another fix for PM2 text restoration (Egbert Eich).
+
+XFree86 3.9Pt (20 June 1999)
+2774. First cut at converting the fbdev, sis, glide, neomagic and rendition
+ drivers for the new RAC code (David Dawes).
+2773. Fix a PM2 lockup problem during GLINTSave, and fix a text mode font
+ corruption problem (#2907, Egbert Eich).
+2772. Xterm patch #108 (#2906, Thomas Dickey).
+2771. Fix a problem with duplicate ShmCompletion events in Xinerama mode
+ (#2905, Mark Vojkovich).
+2770. Add a XDGAKeyEventToXKeyEvent helper function to the DGA client library
+ (#2904, Mark Vojkovich).
+2769. Fix some incorrect XAA GC validation checks (#2903, Mark Vojkovich).
+2768. Fix some XAA caching problems with shared memory pixmaps (#2903,
+ Mark Vojkovich).
+2767. Wait for the fifo to clear out in the mga driver before returning to
+ the client after any cpu->screen color expansion or image writes (#2901,
+ Mark Vojkovich).
+2766. Don't use the BIOS info for the MGA G400 since we don't understand
+ the format (#2901, Mark Vojkovich).
+2765. Fix some MGA bitblit problems when more than 16MB of memory is being
+ used (#2901, Mark Vojkovich).
+2764. Set memory clocks to the bios defaults in the MGA driver, and add an
+ Option "OverclockMem" to allow the previous settings to be used (#2901,
+ Mark Vojkovich).
+2763. Xaw and xedit updates (see lib/Xaw/Changelog) (#2899,
+ Paulo Cesar Pereira de Andrade).
+2762. Ansification and warning elimination in lib/xtrans (#2896,
+ Matthieu Herrb).
+2761. Fix a glint scanline interleave bug introduced by the change in
+ device scaning order in the new RAC code (#2890, Jens Owen).
+2760. Fix a dual head Xinerama crash that happens when running the xv program
+ (#2889, Itai Nahshon).
+2759. Add v4l Xv support to the trident driver (#2877, Alan Hourihane).
+2758. Trident Image series and standard chipset acceleration fixes (#2877,
+ Alan Hourihane).
+2757. Add more Blade3D acceleration to the trident driver (#2877,
+ Alan Hourihane).
+2756. Fix for DPMS with the new RAC (Itai Nahshon).
+2755. RAC updates, including changing the way PCI resource validation works
+ (Egbert Eich).
+2754. Update the TGA driver for the new RAC (#2886, Matt Grossman).
+2753. Fix a fatal event problem with DGA 2.0 (#2884, Mark Vojkovich).
+2752. Fix some macros in xf86str.h that conflict with system headers on some
+ platforms (#2883, 2888, 2902, Matt Grossman).
+
+XFree86 3.9Ps (14 June 1999)
+2751. Some small RAC updates (Egbert Eich).
+2750. Direct Rendering Infrastructure from Precision Insight (#2871).
+2749. Fix a problem building xedit on SVR4.0 (missing strcasecmp).
+
+XFree86 3.9Pr (13 June 1999)
+2748. Xterm patch #107 (#2879, Thomas Dickey).
+2747. Cirrus driver updates, including support for generic (V4L) video
+ adapters, fix depth 15 mode for the laguna chips and turn of the DAC
+ when blanking the screen (#2878, Itai Nahshon).
+2746. Fix problems with the build of the 6.1-compatible Xaw shared library,
+ and some optimizations and bug fixes for the Xaw and xedit (#2877,
+ Paulo Cesar Pereira de Andrade).
+2745. Add functions (CreateFontRec and DestroyFontRec) for allocating and
+ freeing FontRecs rather than having the size encoded in all of the
+ renderer modules. Also, change the font private index handling to
+ make all indices show up in all FontRecs (#2873, Mark Vojkovich).
+2744. Add ANSI prototypes for lib/XIE (#2870, Thomas Dickey).
+2743. Some preliminary work on adding afb support to the fbdev driver (#2869,
+ Sven Luther).
+2742. Change the semantics of xf86ReadPciBIOS() to allow it to temporarily
+ map an unmapped BIOS at the address assigned to another of the card's
+ base address registers, and modify the MGA driver to make use of this
+ (David Dawes).
+2741. Add some functions to the common layer to allow drivers to register
+ input handling functions, and modify the pm2_video code to make use of
+ this instead of the XInput code (David Dawes).
+2740. Trap for packed 24bpp on systems with 64-bit scanlines.
+2739. Fix the type of the "set_mckl" option in the s3virge driver (#2865,
+ Harald Koenig).
+2738. Fix some s3virge palette problems in 8bpp mode (#2863, Harald Koenig).
+2737. Avoid clobbering CR55 in the s3virge HW cursor code (#2862,
+ Harald Koenig).
+2736. Xterm patch #106 (#2861, Thomas Dickey).
+2735. Fix an incorrect test in I2CWriteBytes() in the i2c module (#2875,
+ Ben Cahill).
+2734. Don't set YDSTORG for the non-WRAM Matrox cards (#2874, Mark Vojkovich).
+2733. Change the order of text-mode font restoration in the vgahw module
+ (#2872).
+2732. XInput driver for Dynapro touch screens (#2859, 2860, 2867,
+ David Woodhouse).
+2731. Enable support for extended PS/2 protocols on Solaris/x86 (#2857,
+ Nicholas Brealey).
+2730. Fix the ZAxisMapping handling in the mouse driver (#2857,
+ Nicholas Brealey).
+2729. Add a sixth valuator to the wacom driver to support the wheel of
+ the airbrush and of the lens cursor (Frederic Lepied).
+2728. Convert the wacom driver to work with the new input code
+ (Frederic Lepied).
+2727. Increase the MAXSCREENS value from 4 to 16 (Egbert Eich).
+2726. Add support to scanpci for printing out PCI-PCI bridge header
+ information correctly (Egbert Eich).
+2725. New RAC (Resource Access Control) code (Egbert Eich).
+2724. Update the Solaris/x86 version of xf86ReadBIOS() to handle BIOSs located
+ at high physical addresses (David Dawes).
+2723. An attempt at allowing the server to correct the /tmp/.X11-unix
+ directory when it is possible to do so safely (David Dawes).
+2722. Re-enable screen->screen blts for the Trident Image3D, and fix a problem
+ with mapping/unmapping memory with VT switching (David Dawes).
+2721. Fix a problem linking with libXfont when building the shared version
+ is disabled (David Dawes).
+2720. Fix an Xlib problem introduced in 3.9Pq that shows up when X_LOCALE
+ is defined (David Dawes).
+
+XFree86 3.9Pq (6 June 1999)
+2719. Change the parser's error message printing so that they will end
+ up in the log file (David Dawes).
+2718. Add support for armscii-8, ibm-cp1133, mulelao-1, viscii1.1-1,
+ tcvn-5712, georgian-academy, georgian-ps (not all complete yet)
+ (#2843, Pablo Saratxaga).
+2717. Some fixes for the v4l driver that make it keep track of the video
+ state correctly (#2854, Gerd Knorr).
+2716. Xterm patch #105 (#2853, Thomas Dickey).
+2715. Add defines to the Xaw code to make it possible to build a version
+ of the shared library that is binary compatible with the standard 6.1
+ version (#2849, Paulo Cesar Pereira de Andrade).
+2714. Xedit updates (see the Xaw Changelog for details) (#2849,
+ Paulo Cesar Pereira de Andrade).
+2713. Bump the Xaw library major version (now 7.0), and enable the Xpm
+ dependency by default (#2849, Paulo Cesar Pereira de Andrade).
+2712. Fix an Xmu build warning (#2849, Paulo Cesar Pereira de Andrade).
+2711. Some updates to the XAnti extension (#2851, 2852, Mark Vojkovich).
+2710. Update the scanline width choices used in the MGA driver to better
+ match the capabilities of the different chips (#2850, Mark Vojkovich).
+2709. Add G400 support to the MGA driver (#2850, Mark Vojkovich).
+2708. Resync SuperProbe with 3.3.3.1e, and add ATI Rage XL & XC detection
+ (#2847, Marc La France).
+2707. Fix for drivers/v4l/README (#2846, David Woodhouse).
+2706. Fixes for the big5.eten-0 and gb2312.1980-0 encoding files (#2840, 2841,
+ 2846, Juliusz Chroboczek).
+2705. Use 8-bit I/O instead of 16-bit I/O in xf4bpp (better for older
+ adapters), and some cleanups (#2838, Marc La France).
+2704. Fix RGB "masks" for depth <=8, and fix the formatting of the "Clocks"
+ messages (#2838, Marc La France).
+2703. Remove assumption that PCI systems contain PCI video (#2838,
+ Marc La France).
+2702. Add missing parsing of the ZAxisMapping option to the revised mouse
+ driver (David Dawes).
+2701. Add a simple verification check for core-capable input devices
+ (David Dawes).
+2700. Update the serial PnP mouse support for the revised mouse driver
+ (David Dawes).
+
+XFree86 3.9Pp (30 May 1999)
+2699. Xterm patch #104 (#2836, Thomas Dickey).
+2698. Doc updates for the s3virge driver, and cleanup register debugging
+ printouts (#2835, Kevin Brosius).
+2697. Rework the config file search algorithm, and allow "safe" relative
+ paths to be specified by non-root users (David Dawes).
+2696. Close input devices while VT switched away (David Dawes).
+2695. Prevent the input device "PreInit" from being called in subsequent
+ server generations (David Dawes).
+2694. Handle the Keyboard config information as an InputDevice section
+ (but the keyboard driver isn't converted yet) (David Dawes).
+2693. Add basic accessEnable calls to the Tseng driver so that it will at
+ least work single head with an ET6000 (David Dawes).
+2692. Fix Xinerama bugs related to the Shape extension (#2832, Mark Vojkovich).
+2691. Separate the pitch and virtual X increments (#2829, Marc La France).
+2690. Add some large encoding files for the `fontenc' layer (#2827,
+ Juliusz Chroboczek).
+2689. A rewrite of the way Xinerama handles visuals (#2824, Mark Vojkovich).
+2688. Integrate the pointer acceleration patch from Kevin Brown (#2823,
+ Frederic Lepied).
+2687. Make button mapping work for XInput "AlwaysCore" devices (#2823,
+ Frederic Lepied).
+2686. Fix xtest failure with SiS TwoPointLine (#2821, Juanjo Santamarta).
+2685. Xlib support for KOI8-U (#2820, Aleksey Novodvorsky).
+2684. Fix a problems with the new mouse code looping by adding CLOCAL to
+ the standard termios flags for xf86OpenSerial() (#2819, Matthieu Herrb).
+2683. New font document (#2818, Juliusz Chroboczek).
+2682. Fix the reworked "wsmouse" code for NetBSD (#2815, Matthieu Herrb).
+2681. Fix for `resize' on OpenBSD (#2814, Matthieu Herrb).
+2680. Add the `s' flag to ArCmd and ArAddCmd for SVR4 so that empty archives
+ can be created (#2813, Nicholas Brealey).
+
+XFree86 3.9Po (23 May 1999)
+2679. Enable the new input code (NewInput) by default in xfree86.cf
+ (David Dawes).
+2678. Add compatibilty support for interpreting "Pointer" sections as
+ "InputDevice" sections in the reworked input device code (David Dawes).
+2677. Modify mkfontdir to handle duplicate encodings in a reasonable way
+ when generating the encodings.dir file (#2812, Juliusz Chroboczek).
+2676. Xaw and xedit updates (see lib/Xaw/Changelog for details) (#2811,
+ Paulo Cesar Pereira de Andrade).
+2675. Fix xinerama problems with clipmasks and stipple/tile offsets
+ in GCs used on the root window (#2810, Mark Vojkovich).
+2674. Fix problems uploading to the pixmap cache in 8+32 mode when
+ ImageWrites aren't available (#2809, Mark Vojkovich).
+2673. Ansify the Xv client library (#2808, Mark Vojkovich).
+2672. Add a XvQueryPortAttributes request to the Xv API/protocol and
+ driver interface, with an example in the v4l driver, and update the
+ documentation (#2808, Mark Vojkovich).
+2671. Fix some compiler warnings in the oldX and ICE libraries (#2807,
+ Matt Grossman).
+2670. Fix a problem with the Type1 font handling that was introduced when the
+ CID support was added (#2805, Ivan Bach).
+2669. Wacom driver update, including a fix for initialization problems with
+ Wacom IV devices, and improved Wacom V device support (Lens cursor
+ support) (#2803, Frederic Lepied).
+2668. Fix for some 8+32 xinerama problems (#2802, Mark Vojkovich).
+2667. Xkb fixes for PC98 (#2800, Akio Morita).
+2666. Xkb data files for a Macintosh keyboard (#2798, Sven LUTHER).
+2665. Some preliminary support for the "new" mouse driver for most OSs
+ (David Dawes).
+2664. Prevent xf86LogInit() being called for subsequent server generations.
+
+XFree86 3.9Pn (16 May 1999)
+2663. Add a SetClientVersion request to the DGA extension (David Dawes).
+2662. Change DGA initialisation ordering in the MGA driver (#2796,
+ Mark Vojkovich).
+2661. Turn off DGA pixmaps in xinerama since it insists on duplicating
+ the rendering protocol on all heads despite the DGA pixmaps existing
+ only on a single head (#2795, Mark Vojkovich).
+2660. Fix some xinerama problems with 8+32 overlays (#2795, Mark Vojkovich).
+2659. Add XAA acceleration for DGA pixmaps (#2795, Mark Vojkovich).
+2658. Add PCI IDs for new NVIDIA chipsets (#2794, Mark Vojkovich).
+2657. Change the default cursor colour in the app-defaults for editres
+ (#2793, Paulo Cesar Pereira de Andrade).
+2656. Xedit updates, including a new Xedit-color.ad file, to show some of
+ the new features of Xaw, and some improvements to the ispell interface
+ (#2793, Paulo Cesar Pereira de Andrade).
+2655. Xaw updates, including some fixes, optimizations, and additional
+ documentation (#2793, Paulo Cesar Pereira de Andrade).
+2654. Working mouse support with the new input device code (David Dawes).
+2653. Fix for sysv_video.c on Interactive UNIX (#2792, Michael Rohleder).
+2652. Fix handling of xkbcomp's -I flag (Stanislav Meduna).
+2651. CID updates (third submission) (#2769, Ivan Bach, SGI).
+2650. Kludge to allow a server with the glint driver to link without XInput
+ (#2788, Marc La France).
+2649. Remove unused dacSpeeds field from the ScrnInfoRec (#2788,
+ Marc La France).
+2648. Add an option to the colourmap code to allow a driver's LoadPalette()
+ to be called even when switched out (#2788, Marc La France).
+2647. Add more reasons for rejecting a mode (#2788, Marc La France).
+2646. Factor in the log verbosity when reporting the verbosity to a driver
+ (#2788, Marc La France).
+2645. Allow xf86GetClocks() to be called with NULL ProtectRegs() and
+ BlankScreen() functions (#2788, Marc La France).
+2644. When deleting a screen, also free its mode lists and options (#2788,
+ Marc La France).
+2643. Allow a driver to determine if -probeonly was specified (#2788,
+ Marc La France).
+2642. Fix a large jump in changelog numbering that happened a little while
+ ago (#2788, Marc La France).
+2641. Various warning and include fixes (#2788, Marc La France).
+2640. Xterm patch #103 (#2786, Thomas Dickey).
+2639. SiS driver updates, including fixing the SetMClk option, change solid
+ lines from bresenham to two-point, correct a clippling bug, and change
+ the verbose level of some messages (#2784, 2785, Juanjo Santamarta).
+2638. Fix a server loop that can happen when VT switching while a grab is
+ in progress (#2782, Edward Wang).
+2637. Xterm patch #102 (#2778, Thomas Dickey).
+2636. Fix some spelling errors in Xlib.h (#2775, Itai Nahshon).
+2635. Add auto-detection of Debian to imake (#2774, Sven Luther).
+2634. SiS driver updates, including turning on solid line acceleration,
+ remove GXCOPY_ONLY for Mono8x8 patterns, change mmio pointers to
+ volatile to avoid optimization problems, use xaarop.h, fix offscreen
+ memory init to avoid exceeding the accelerator's address range
+ (#2772, Alan Hourihane).
+2633. Fix build problems with the v4l driver on some systems (based on #2771,
+ Gerd Knorr, and a suggestion from David Woodhouse).
+2632. Xterm patch #101 (#2770, Thomas Dickey).
+2631. Fix some more Xinerarma bugs (#2766, 2768, Mark Vojkovich).
+2630. Fix the use of va_lists in the logging code (David Dawes).
+
+XFree86 3.9Pm (9 May 1999)
+2629. Clean up the handling of Alphas in the s3virge driver (#2767,
+ Matt Grossman).
+2628. Fix a problem that can show up when a module is unloaded while another
+ module has unaccounted for references to its symbols (Egbert Eich).
+2627. -
+2626. Finish DGA event support (#2765, Mark Vojkovich).
+2625. Xaw updates (including compatibility updates and a man page), xedit
+ and editres updates (#2764, Paulo Cesar Pereira de Andrade).
+2624. Disable MIT-SHM in Xnest since it doesn't work (#2763, Wolfram Gloger).
+2623. Add hw clipping for the SiS 6326, and solid lines (disabled) (#2760,
+ Juanjo Santamarta).
+2622. Cirrus driver updates (#2759, Itai Nahshon).
+2621. Fix complier warnings in lib/X11 (#2758, Matt Grossman).
+2620. Fix complier warnings in lib/Xau (#2757, Matt Grossman).
+2619. Update some of the font encoding translation files (#2756,
+ Juliusz Chroboczek).
+2618. Fix some bugs in the font encoding support (#2756, Juliusz Chroboczek).
+2617. Update the Arabic24 BDF font to version 1.3 (#2754, Mark Leisher).
+2616. Xterm patch #100 (#2753, Thomas Dickey).
+2615. A start at the unification of input devices (David Dawes).
+2614. Change the MGA ImageWrite code to not use the image transfer window
+ for simple cpu->framebuffer copies (#2738, Mark Vojkovich).
+2613. Add lseek and bsearch to the libc wrappers (and fix fseek), as needed
+ by the CID font code.
+2612. Add missing file for CID fonts support, and fix a few module-related
+ thing with it.
+
+XFree86 3.9Pl (3 May 1999)
+2611. Fix Xinerama bugs in GetImage and PolyRectangle (#2751, Mark Vojkovich).
+2610. Xterm patch #99 (#2750, Thomas Dickey).
+2609. Disable unneccessary C&T message (#2748, Nozomi Ytow).
+2608. Add some DGA event support (not working yet) (#2747, Mark Vojkovich).
+2607. Xaw and xedit updates including some compatibility updates and
+ performance improvements (#2746, Paulo Cesar Pereira de Andrade).
+2606. Modify mkfontdir to create "encodings.dir" files (#2745,
+ Juliusz Chroboczek).
+2605. Update the DESIGN doc for the new DGA driver interface (#2744,
+ Mark Vojkovich).
+2604. Update the LynxOS vidmem code to use the new shared vidmem.c (#2743,
+ Thomas Mueller).
+2603. -
+2602. Update TGA docs (#2737, Matt Grossman).
+2601. Fix a zero width problem that shows up in xaaSpans.c when hardware
+ clipping is enabled (#2736, Alan Hourihane).
+2600. Add support for Adobe CID fonts (#2728, Ivan Bach, SGI).
+2599. Quick fix for cirrus driver problem introduced in 3.9Pk.
+2598. Fix a problem with pcitweak that was preventing it from working with
+ buses other than bus 0 (David Dawes).
+2597. Update xfontsel to display appropriate glyphs for ISO10646 fonts
+ (Mark Leisher).
+2596. Add support for building XF86Setup with ncurses on NetBSD and OpenBSD
+ (#2734, Matthieu Herrb).
+2595. Fix vidmem map/unmap mismatch in the TGA driver (#2733, Matt Grossman).
+2594. A minor interlace improvement for the PM2 Xv driver (#2731,
+ Michael Schimek).
+2593. Fix color expansion bug in the SiS driver (#2729, Juanjo Santamarta).
+2592. Major resync for OS/2 (#2727, 2732, 2735, Holger Veit).
+2591. Xterm patch #98 (#2726, 2730, Thomas Dickey).
+2590. Fix a build V4L driver build problem (#2725, David Woodhouse).
+2589. Xterm patch #97 (#2724, Thomas Dickey).
+2588. Move the VTInit and VTSysReq keywords from the Keyboard section to
+ the ServerFlags section (as options) (David Dawes).
+2587. Remove the legacy ServerNumLock and "RightAlt", etc special key mapping
+ support (David Dawes).
+2586. Add a new, more complete version of snprintf, vsnprintf for OSs that
+ don't have it. This one is based on the "SIO" stdio-like package
+ (David Dawes).
+2585. Add log file support, including separate log and stderr streams, and
+ separate verbosity levels for each stream. Changed the -verbose option
+ to accept an optional integer argument that specifies the verbosity
+ level, add a -logverbose option and a root-only -logfile option
+ (David Dawes).
+2584. Unify the "Overlay" options and "SetMclk" options, and remove the
+ SetMClk Device section keyword (David Dawes).
+2583. Add a "frequency" option value type for use with options processed
+ by xf86ProcessOptions(). This value type consists of a floating point
+ number optionally followed by "Hz", "kHz" or "MHz" (David Dawes).
+
+XFree86 3.9Pk (25 April 1999)
+2582. Move the SVR4-specific handling of mapping memory areas which have
+ read side-effects out of the drivers and into the os-support layer
+ (David Dawes).
+2581. Fix unmap parameters for the SiS driver (David Dawes).
+2580. Fix unmap parameters for the glint driver (#2722, Alan Hourihane).
+2579. Fix the depth 24 visual initialisation (mask, offset) in the
+ Rendition driver (#2720, Martin Cerveny).
+2578. Rework the use of inb/outb in the trident driver, replacing it with
+ MMIO. Also, don't use the 0xBF000 range for the accelerator registers
+ (#2719, Alan Hourihane).
+2577. Add a -screen option to the xgamma utility so that the gamma of each
+ screen can be changed in Xinerama mode (#2717, Mark Vojkovich).
+2576. Fix all the known problems with the ispell support in xedit (#2716,
+ Paulo Cesar Pereira de Andrade).
+2575. Xaw updates, including improved speed for FindPiece in AsciiSrc.c,
+ add submenu support to the SimpleMenuWidget, add support for text
+ justification to the TextWidget, add an overwrite mode to the
+ TextWidget, make the TextWidget understand negative "multiply" values,
+ add an indent action to the TextWidget, fix a bug in the undo code
+ (#2716, 2721, Paulo Cesar Pereira de Andrade).
+2574. Pcitweak fix for LynxOS, and define NO_MMAP for pre 2.5.0 LynxOS
+ releases (#2715, Thomas Mueller).
+2573. Fix for cirrus hardware cursor on (big endian) PowerPC platform
+ (#2715, Thomas Mueller).
+2572. Experimental DDC support for the Matrox "G" series cards (#2713,
+ Andrew Aitchison).
+2571. Fix a crash in the XAA fill code that happens when
+ Mono8x8PatternFillFlags is set only to HARDWARE_PATTERN_PROGRAMMED_BITS,
+ which affects the TGA driver (#2712, Matt Grossman).
+2570. Replace the default "fixed" (6x13) font with Markus Kuhn's ISO 10646-1
+ version (#2711, Markus Kuhn).
+2569. Import Mark Leisher's ClearlyU BDF fonts (#2707, Mark Leisher).
+2568. Import Mark Leisher's Arabic24 BDF font (#2706, Mark Leisher).
+2567. Initial acceleration for the 24-plane TGA (#2710, Tim Rowley).
+2566. Fix clip bugs in the MGA driver (#2709, Mark Vojkovich).
+2565. Update the `xfsft' TrueType backend to version beta1.1.4. This includes
+ updates to the `fontenc' interfaces (#2708, Juliusz Chroboczek).
+2564. Fix some #include problems with the rendition driver (#2704, Dejan Ilic).
+2563. Fix a syntax error in the `ru' symbols file (#2703, Peter Novodvorsky).
+2562. Update the xf86SetGamma and xf86SetDpi helpers to use DDC information
+ when it is available, and update the MGA driver to make the DDC
+ information available earlier in the PreInit phase (#2702,
+ Andrew Aitchison).
+2561. Flesh out XF86Setup's config file read and write routines (#2701,
+ Joe Moss).
+2560. Parser fixes (#2700, Joe Moss).
+2559. Remove the out of date references to the sparse map mem functions from
+ the loader (#2699, Matt Grossman).
+2558. Color expansion for the SiS driver, and change the "NoTurboQueue" option
+ to "TurboQueue" (#2696, Juanjo Santamarta).
+2557. Xterm patch #96, including improved logic for bold fonts, improved
+ Unix98 PTY support, and modify initial-erase logic to ensure that the
+ ttyModes resource overrides it (#2695, Thomas Dickey).
+2556. Some #include and warning fixes (#2693, Marc La France).
+2555. On an error, tell user to re-run the server >without< -quiet. This is
+ generalized to allow the production of error messages to specify the
+ minimum verbosity to be used before reporting a problem (#2693,
+ Marc La France).
+2554. Make -depth 24 produce a more appropriate message when the driver
+ doesn't support it (#2693, Marc La France).
+2553. Reinstate black & white colour options for 1bpp (#2693, Marc La France).
+2552. Fix a typo in XF86Conf.man (#2691, Itai Nahshon).
+2551. Fix the initialisation of some global flags when the config file has
+ no ServerFlags section (David Dawes).
+
+XFree86 3.9Pj (18 April 1999)
+2550. Update SiS docs (#2690, Juanjo Santamarta).
+2549. Glide driver and documentation updates. Fix the "EXTERN_MODULE"
+ usage, force the virtual size to be the display size, and add a
+ GlideDevice Option to specify one of multiple cards (#2689,
+ Henrik Harmsen).
+2548. Resync DPMS timeout code with the 3.3.x code, which fixes some problems
+ (#2688, David Wragg).
+2547. Preliminary MTRR support for FreeBSD (3.2 and later) (David Dawes).
+2546. Separate the OS-independent and OS-dependent parts of the MapVidMem
+ functions, and handle sparse mapping with a flag to MapVidMem instead
+ of using a separate function (David Dawes).
+2545. Remove most LinkKit references.
+2544. Disable WC for the framebuffer for the Rendition V1K by default,
+ because it appears to be causing lockups (Dejan Ilic).
+2543. Some fixes for the Rendition driver (Dejan Ilic).
+2542. Add HW cursor using the Bt485 ramdac to the DEC TGA driver (#2687,
+ Matt Grossman).
+2541. More of the DGA 2.0 extension. Most of it is there now except for
+ the events (#2686, Mark Vojkovich).
+2540. Imlement attributes for Audio (mute, volume) and implement
+ QueryBestSize for the v4l driver (#2685, Gerd Knorr).
+2539. Fix hardware cursor code so that it works with the internal 64 bit
+ scanlines used on Alpha platforms (#2679, Matt Grossman).
+2538. Export new DGA symbols from the loader (#2678, Alan Hourihane).
+2537. Update C&T driver to use independent clocks for FP/dual and CRT modes
+ with HiQV chipsets (#2677, Egbert Eich).
+2536. Port of Precision Insight's NeoMagic driver to the new design
+ (#2677, Egbert Eich).
+2535. Add a Linux kernel backbone to the Permedia 2 Xv driver (#2661+revisions,
+ Michael Schimek).
+2534. Port of the rendition driver to the new design (#2674, Marc Langenbach).
+2533. Fix for the parser's printDeviceSection() function (#2673, Joe Moss).
+2532. Fix a bug in the handling of ZAxisMapping in the parser (#2672,
+ Nicholas Brealey).
+2531. Enable mono 8x8 pattern fills for the SiS driver (#2670,
+ Juanjo Santamarta).
+2530. Remove references to ru_SU in locale.alias (#2669, Aleksey Nowodworsky).
+2529. Fix a bug in xf86CollectOptions() that could cause a server crash.
+2528. Fix the problem causing the mouse acceleration to be done twice
+ (#2671, Frederic Lepied).
+2527. Disable clipping in the trident driver for FillRectSolid because the
+ driver gets passed zero values (#2681, Alan Hourihane).
+2526. Add Trident Blade3D support (#2681, Alan Hourihane).
+2525. Add Mono8x8 pattern for the Trident Image series (#2681, Alan Hourihane).
+2524. Fix trident screen glitches when mode switching (#2681, Alan Hourihane).
+2523. Some minor documentation-related cleanups. Doctools version 1.0.2 is
+ now required to format the XFree86 docs.
+
+XFree86 3.9Pi (11 April 1999)
+2522. Fix a Linux/PPC loader relocation bug, and reenable building the
+ loadable server by default for Linux/PPC (#2668, Gerd Knorr).
+2521. Fix a problem with non-terminated strings in the Xv library (#2665,
+ Gerd Knorr).
+2520. Update the v4l driver -- fix open/close handling and add support for
+ the XV_ENCODING attribute (#2665, Gerd Knorr).
+2519. Implement FBDevSaveScreen() (#2664, Gerd Knorr).
+2518. Enable shadowfb by default for the fbdev driver (#2664, Gerd Knorr).
+2517. Fix fbdev option handling (#2664, Gerd Knorr).
+2516. Fbdev documentation updates (#2664, Gerd Knorr).
+2515. Some more progress on the DGA 2.0 API/protocol (#2663, Mark Vojkovich).
+2514. Add ispell support to xedit (#2662, Paulo Cesar Pereira de Andrade).
+2513. Fix -DUSE_XPM handling in Xaw (#2662, Paulo Cesar Pereira de Andrade).
+2512. Some updates to the offscreen memory allocator and the i2c code
+ (#2661, Michael Schimek).
+2711. Use the correct version of xf86Xinput.c (the wrong version was
+ included in 3.9Ph) (Frederic Lepied).
+2710. Fix a pcitweak build problem on NetBSD (#2659, Isao Ohishi).
+2509. Add acceleration for the 8+16 mode of the C&T driver (#2658,
+ David Bateman).
+2508. Add compatibility to the client-side of the VidMode extension so that
+ it will work with 3.3.x servers (#2657, David Bateman).
+2507. Update 'ru' xkb symbols file (#2656, Aleksey Nowodworsky).
+2506. Add Trident 9525 ID to PCI info and trident driver (#2655,
+ Alan Hourihane).
+2505. Cleanup some compiler warnings in mfb and mi (#2654, Alan Hourihane).
+2504. Added a glide driver. It currently only works with the loadable
+ server (read the manpage before trying it) (#2653, Henrik Harmsen).
+2503. Update the Type1/latin2 fonts.* files to disable reencoding of the
+ fonts while keeping the same XLFD names (#2652, Juliusz Chroboczek).
+2502. Fix some pcitweak build problems on Interactive UNIX (#2651,
+ Michael Rohleder).
+2501. Xterm patch #95 (see xterm.log.html for details) (#2649, Thomas Dickey).
+2500. Fix typos in the VidMode extension that causes a protocol problem
+ (#2648, 2657, David Bateman).
+2499. Reorder the visuals to put TrueColor before DirectColor so that broken
+ clients (like Wabi) that assume the default visual is the first visual
+ will work (2647, David Woodhouse).
+2498. Fix a problem with the ThinkingMousePS/2 protocol handling of left
+ movement (#2392, Ian Remmler).
+2497. Fix an ISO8859-5 support bug in Xlib (Nikolai Saoukh).
+2496. Rework the GlxInitVisuals hooks with a more general wrapper-based
+ mechanism (David Dawes).
+2495. Fix a XINERAMA bug in dix/events.c (Dirk Hohndel).
+
+XFree86 3.9Ph (5 April 1999)
+2494. Add code to XF86Setup for mode adjustment (like xvidtune), addition,
+ and removal (#2646, Joe Moss).
+2493. Remove the use of the `dialog' program from XF86Setup, and add
+ various curses routines and the start of a text mode user-interface
+ (both curses & plain text). Also remove some obsolete Tk 4.0-specific
+ code (#2645, Joe Moss).
+2492. Add code to XF86Setup to convert all of the config file sections
+ to/from Tcl variables (#2644, Joe Moss).
+2491. Allow fbdev to handle non-page-aligned framebuffers correctly (#2643,
+ Gerd Knorr).
+2490. Add RAC code to the fbdev driver (if there is a PCI BusID specified
+ in the config file it will "check in" this into access control)
+ (#2643, Gerd Knorr).
+2489. Cleanup in sysv_video.c (#2642, Michael Rohleder).
+2488. Update xedit's realpath.c for IUS (#2642, Michael Rohleder).
+2487. Add support for InputDevice sections to the parser (not used yet)
+ (David Dawes).
+2486. A first cut at cleaning up the handling of memory mapping and client
+ exit/crash in the DGA library (David Dawes).
+2485. Shadowfb support for the generic VGA driver at depths 4 and 1
+ (Dirk Hohndel and Mark Vojkovich).
+2484. Fix the printMonitorSection and printDeviceSection functions in
+ the parser (#2641, Joe Moss).
+2483. Change the s3virge chipset names, removing the slashes (#2640,
+ Kevin Brosius).
+2482. Preliminary s3virge man page (#2640, Kevin Brosius).
+2481. Fix s3virge HW cursor (#2640, Kevin Brosius, Mark Vojkovich).
+2480. Remove some multiply defined variables in the cfb modules to avoid
+ a problem on LynxOS PowerPC (#2639, Thomas Mueller).
+2479. Fix a crash in the new xedit code for listing files and directories
+ (#2638, Paulo Cesar Pereira de Andrade).
+2478. Change the kill_ring code in TextAction.c to always end in a text block
+ of zero length (#2638, Paulo Cesar Pereira de Andrade).
+2477. Add xpm pixmap support to Xaw (needs to be built with -DUSE_XPM
+ for this), and if the xpm image has a mask, the widget will be
+ automatically reshaped to the pixmap mask (#2638,
+ Paulo Cesar Pereira de Andrade).
+2476. Add some PCI IDs for Creative Labs 3D Blaster Banshee PCI (#2637,
+ Nicholas Brealey).
+2475. XAA pixmap->window and window->pixmap copy optimization (#2636,
+ Mark Vojkovich).
+2474. Implement some attributes for the v4l module, and fix the clipping
+ code (#2635, Gerd Knorr).
+2473. Incorporate 3.3.1 FIFO settings for the SiS driver based on memory
+ bandwidth and pixel clock (#2632, Juanjo Santamarta).
+2472. SetMclk and FastVram options for the SiS driver (#2632,
+ Juanjo Santamarta).
+2471. Fix some SiS mode switch problems (#2632, Juanjo Santamarta).
+2470. Imakefile fix for building the X server with BuildGlxExt=NO (#2631,
+ Thomas Mueller).
+2469. Imakefile fixes for cxpm and sxpm (#2631, Thomas Mueller).
+2468. LynxOS resync, including removing the CrossCompile rule from lynx.cf,
+ LynxOS sparc resync, remove SMEM warning for default verbose level,
+ LynxOS support for chips driver util programs (#2631, Thomas Mueller).
+2467. Add man pages for the fbdevhw and fbdev modules (#2630, Gerd Knorr).
+2466. Add fb.h so that fbdevhw can be built on pre-2.2 Linux (#2630,
+ Gerd Knorr).
+2465. Add support for generic Xv adaptors to the fbdev driver (#2629,
+ David Woodhouse).
+2464. Fix X locale problem for Linux/libc6 introduced in 3.9Pg (#2628,
+ Nozomi Ytow).
+2463. Fix VT switching problems with the 8+16 code (#2627, David Bateman).
+2462. Generic Xv support for the s3virge driver (#2626, David Woodhouse).
+2461. Add a permission notice to videodev.h (#2625, David Woodhouse).
+2460. Resync parts of the XInput DDX code with 3.3.x, including restoring
+ the "Switch" device, RELATIVE_CHECK code, Elographics driver,
+ Wacom driver, and Joystick driver (#2514, 2548, Frederic Lepied
+ and Patrick Lecoanet).
+2459. Fix remaining build issued with the GLX/Mesa integration
+ (Marc La France).
+2458. Some preliminary support code that the new RAC code may use
+ (David Dawes).
+2457. Add a utility called `pcitweak' that can be used to read/write
+ registers in the PCI config space from the command line (David Dawes).
+
+XFree86 3.9Pg (29 March 1999)
+2456. Fix an off-by-one clipping error in the XAA wide line code (#2624,
+ Mark Vojkovich).
+2455. Add HW cursor support to the s3virge driver and make it the default
+ (#2623, Kevin Brosius).
+2454. Add OS-specific subdirectories to the loader subdirectory search lists,
+ and install OS-specific modules in such directories (David Dawes).
+2453. Set the screen numbering in multihead configurations based on the
+ ordering of the Screen entries in the ServerLayout section,
+ and allow an optional numerical argument to follow the Screen
+ keyword to indicate a different ordering (David Dawes).
+2452. Fix some signedness discrepancies in the libc_wrapper code.
+2451. Add missing parts to the parser's printKeyboardSection routine (#2621,
+ Joe Moss).
+2450. Finalising the DGA 2.0 driver interface (#2619, Mark Vojkovich).
+2449. Xterm patch #94 (#2618, Thomas Dickey).
+2448. Accelerated support for 8+16 overlays in XAA (untested) (#2617,
+ Mark Vojkovich).
+2447. Some optimisations for the 8+32 and 24+32 layers (#2616, Mark Vojkovich).
+2446. Updates for IUS (Interactive Unix) (#2614, Michael Rohleder).
+2445. Update xf86config for the 4.0 config file format (#2613,
+ Justin Bradford).
+2444. Update and clean up the Cards file (#2600, 2612, Justin Bradford).
+2443. When probing for a VGA, it's unnecessary to unlock its CRTC registers
+ (#2611, Marc La France).
+2442. Remove xf86FreeBusSlots(), which is redundant, unused and incorrect
+ (#2611, Marc La France).
+2441. Move the claiming of ISA resources from xf86Check???Slot() to
+ xf86Claim???Slot() (#2611, Marc La France).
+2440. On Linux, define _GNU_SOURCE only compiling the xc/ source tree (#2611,
+ Marc La France).
+2439. Remove uneeded s3virge files (#2615, Kevin Brosius).
+2438. "pci_burst" option updates for the s3virge driver (#2615, Kevin Brosius).
+2437. Fix missing accel flags and depth 24 problem with the s3virge driver
+ from the Alpha patch (#2615, Kevin Brosius).
+2436. Make sure the size of offscreen pixmaps don't exceed the address space
+ of the ViRGE (#2610, Mark Vojkovich).
+2435. Add a driver for video4linux frame grabber cards (#2609, Gerd Knorr,
+ David Woodhouse).
+2434. Add support to the MGA driver so that it will use any available
+ generic Xv adaptors (#2609, David Woodhouse).
+2433. Add xf86XVRegisterGenericAdaptor() and xf86XVListGenericAdaptors()
+ functions for maintaining a list of Xv adaptors which are not tied
+ to a particular screen (#2609, David Woodhouse).
+2432. Fix virtual screen panning with the SiS driver (#2608,
+ Juanjo Santamarta).
+2431. Fix security problem with the creation of the /tmp/.X11-unix directory
+ (#2607, Matthieu Herrb).
+2430. Update the 8+16 layer to get the color key from the new field in
+ the ScrnInfoRec (#2605, Mark Vojkovich).
+2429. Complete the Xv config evaluation code in the PM2 Xv driver and the
+ common layer (#2604, Michael Schimek).
+2428. Modify Xv DDX's clipping interface (#2604, Michael Schimek).
+2427. Fix a bug in the handling of Boolean options (#2603, Michael Schimek).
+2426. Have xf86ChangeGamma() update and install the default colormap
+ when the currently installed colormap is not implemented by lookup
+ (#2602, Mark Vojkovich).
+2425. Export StoreColors() (#2601, Mark Vojkovich).
+2424. Replace all Imakefile.obj files with Imakefile.inc because .obj is
+ a reserved extension for object file on OS/2 (#2599, Holger Veit).
+2423. Update the Cards file parser to accept a new DRIVER line (#2598,
+ Justin Bradford).
+2422. Fix getline clash in proxymngr and xsm (#2595, Dejan Ilic).
+2421. Fix colourmap on Permedia2, and fix GLINT SaveScreen to blank the
+ display (#2594, 2596, Alan Hourihane).
+2420. Make fbdev work on Sparc Linux, and fix a few bugs in fbdevhw and
+ fbdev (#2593, Jakub Jelinek).
+2419. Sparc Linux support for XFree86 (#2593, Jakub Jelinek).
+2418. Add DPMS support to the s3virge driver (#2592, Matt Grossman).
+2417. ppc_flush_icache() for Linux/PPC, required for the loader to work
+ correctly (#2591, Gerd Knorr).
+2416. Linux/PPC loader fix (#2590, Stuart Anderson).
+2415. Modify the ramdac module and glint driver to use the ScrnInfoRec
+ overlay fields (#2589, 2594, Alan Hourihane).
+2414. Add RTL ethernet and VIA APCI PCI devices to the ID list (#2588,
+ Kevin Brosius).
+2413. Fix a problem with $(STD_CPP_DEFINES) that was introduced in 3.9Pf.
+2412. Add VESA default modes, small perl hack to create an initialized data
+ structure from them, and the code to use those modes as default if no
+ other modes with the same name are defined (Dirk Hohndel).
+
+XFree86 3.9Pf (21 March 1999)
+2411. Fix some malloc problems in xf86xv.c (#2587, Michael Schimek).
+2410. Fix building of Xprt, Xnest and Xvfb when doing a loader build
+ (David Dawes).
+2409. Updates to s3virge driver to get it working under Linux/Alpha
+ (#2586, Matt Grossman).
+2408. Fix getline() clash (#2585, Alan Hourihane).
+2407. Have the s3virge driver use the new XAA rop helper functions (#2584,
+ Mark Vojkovich).
+2406. Add code to SuperProbe to detect the S3 Trio3D and Savage3D
+ (2583, Eric Molitor).
+2405. Add some XAA helper functions that drivers can call for help
+ converting X rops into MS rops (#2582, Mark Vojkovich).
+2404. Resync the overlay support in the glint driver (#2580, 2581,
+ Mark Vojkovich).
+2403. Add support for changing the overlay color key to the MGA driver
+ (#2579, Mark Vojkovich).
+2402. Preallocate the color key in the default colormap and set it to
+ something already in the default man (black) so that AllocColor will
+ never allocate it (#2578, Mark Vojkovich).
+2401. Use the color key field in the ScrnInfoRec for the overlay layers
+ (#2578, Mark Vojkovich).
+2400. Preliminary loader support for Linux/PPC ELF objects (#2577 (2570),
+ Stuart Anderson).
+2399. Fix some XAA offscreen pixmap problmes (#2576, Mark Vojkovich).
+2398. DGA fixes. Old apps should now run with the new driver interface,
+ and event handling should work better than before (#2575,
+ Mark Vojkovich).
+2397. Fix most remaining signed/unsigned and prototype warnings in the
+ following directories: lib/Xaw, lib/Xmu, programs/xclipboard,
+ programs/xconsole, programs/xmag, and programs/xvidtune (#2574,
+ Thomas Dickey).
+2396. Restore the interface of XmuConvertStandardSelection() to use
+ XPointer rather than XtPointer (#2574, Thomas Dickey).
+2395. Fix an malloc size bug in libICE (#2572, Christopher Sekiya).
+2394. Make MIT-SHM resource types non-static so that other extensions
+ (like Xv) can access client shared memory segments (#2571,
+ Mark Vojkovich).
+2393. First cut at altering the C&T user docs for 4.0 (#2569, David Bateman).
+2392. Fix a C&T problem affecting the colourmap setup for 1bpp modes, and some
+ other minor C&T driver fixes (#2569, David Bateman).
+2391. Fix an buffer overflow in os/connection.c (#2568, Gerd Knorr).
+2390. Add support for Modes sections and the UseModes keyword for Monitor
+ sections to the parser (#2567, Dirk Hohndel).
+2389. Fix xfree86.cf for Alpha (#2567, Dirk Hohndel).
+2388. Fix XAAFillPolygonStippled to obey the flag NO_TRANSPARENCY in
+ Mono8x8PatternFill (#2566, Xavier Ducoin).
+2387. Only allow the shadowfb layer in the C&T driver when linear addressing
+ is enabled (#2565 (2561), David Bateman).
+2386. Fix some problems with the xf8_16bpp layer, and allow it to work
+ with depth 15 as well as 16 (#2565 (2561, 2562), David Bateman).
+2385. Implement TrueColor with PseudoColor Overlays (8+16) for the
+ C&T driver for HiQV chipsets (#2565 (2561), David Bateman).
+2384. Add a -quiet option to xgamma (#2565 (2561), David Bateman).
+2383. Add TrueColor Gamma Correction for C&T HiQV chipsets (#2565 (2561),
+ David Bateman).
+2382. Fix Permedia 2 HW cursor lockup (#2563, Alan Hourihane).
+2381. Initial XAA support for SiS530 and SiS620 (#2560, Xavier Ducoin).
+2380. Add SuperProbe for SiS (#2559, Xavier Ducoin).
+2379. Fix the InstalMultipleMan and InstallMultipleManSuffix rules for
+ NetBSD and OpenBSD (#2558 (2557), Matthieu Herrb).
+2378. Add Cards entry for Number Nine FX Reality 772 (#2556, Harald Koenig).
+2377. Make XF86Setup build again (not fully functional yet) (#2555, Joe Moss).
+2376. Update the apm (Alliance Promotion) driver to the 4.0 interface (#2554,
+ Loic Grenie, Henrik Harmsen).
+2375. Add some rules for driver/module man pages, and add a sample driver
+ man page for the mga driver (David Dawes).
+2374. Update the Option Names section of xfree86/Registry (David Dawes).
+2373. Merge the OPTV_BOOLEAN and OPTV_TRI option classes, removing the
+ latter. Update code affected by this (David Dawes).
+2372. Fix the BackingStore option.
+2371. Disable transparency for screen->screen copies for Trident Image for
+ now.
+2370. Trident Image transparency update (#2564, Alan Hourihane).
+
+XFree86 3.9Pe (14 March 1999)
+2369. Fix problems debugging archive library modules on Linux with long
+ member names (Paul Flinders).
+2368. Add new XAA clipping for Trident Image (#2553, Alan Hourihane).
+2367. Fix Trident save screen so that it blanks the display (#2553,
+ Alan Hourihane).
+2366. Fix tranparency for the Trident Image cards (#2553, Alan Hourihane).
+2365. Remove the panmi and pandix directories, since they're no longer
+ needed.
+2364. Add gamma correction to the C&T driver, but disabled because it doesn't
+ work yet (David Bateman).
+2363. Add shadow fb support to the C&T driver (David Bateman).
+2362. Finish off the VidMode extension backward compatibility code
+ (David Bateman).
+2361. Add SetGamma/GetGamma requests to the VidMode extension, and a client
+ called 'xgamma' that makes use of them to allow the server's gamma
+ correction to be changed dynamically (David Bateman).
+2360. Make the cursor layer smart enough to remove the cursor itself when
+ DGA is activated (#2552, Mark Vojkovich).
+2359. Add some overlay-related entries to the ScrnInfoRec (#2550,
+ Mark Vojkovich).
+2358. Some DGA fixes (#2550, 2551, Mark Vojkovich).
+2357. Set X_BYTE_ORDER from the imake config, and use it in place of
+ the system's BYTE_ORDER (David Dawes).
+2356. Update copyright notices in the s3virge driver (#2546, Kevin Brosius).
+2355. Xterm patch #93 (#2546, Thomas Dickey).
+2354. Fix some minor fbdev problems in fbdevhw and the mga driver (#2545,
+ Gerd Knorr).
+2353. Disable the loader for LinuxPPC because it doesn't work (#2545,
+ Gerd Knorr).
+2352. Disable the Linux fbdevhw by default for versions older than 2.2
+ (#2545, Gerd Knorr).
+2351. Xaw and xedit updates, including changes to Xaw to support latin*
+ languages in the text code when not using the "international" resource
+ (#2544, Paulo Cesar Pereira de Andrade).
+2350. Add 3D decoration and the ability to display an XPM pixmap in the xdm
+ Login widget. A default pixmap made with the XFree86 logo is included
+ (#2543, Amit Margalit, Caolan McNamara, Ivan Griffin, Matthieu Herrb).
+2349. Improve attribute scaling in the PM2 Xv driver (#2542, Michael Schimek).
+2348. Add an "acecad" mouse protocol so that an acecad tablet can be used
+ with the standard mouse driver (#2541, Jeff Anton).
+2347. Include xf86_ansic.h in module build of xf86vmode.c (#2540,
+ Matthieu Herrb).
+2346. Fix a server crash when no mode lines are specified in the Monitor
+ section (#2539, Andreas Ehliar).
+2345. Resync SuperProbe with the 3.3.3.1 version (#2538, Marc La France).
+2344. Document -once server commad line option (#2538, Marc La France).
+2343. Add and document a -noreset server command line option to disable server
+ resets when the last client connection is closed. This is useful for
+ xtest'ing a server that is switched out (#2538, Marc La France).
+2342. More compiler warning fixups, including a re-integration of GLX for both
+ static and loader builds (#2538, Marc La France).
+2341. On Linux, compile with _GNU_SOURCE so that declarations for snprintf &
+ friends may be #include'd with <stdio.h> (#2538, Marc La France).
+2340. Fix the glint driver's use of resource control, which fixes problems
+ using MGA/GLINT combinations in multi-head (#2537, Alan Hourihane).
+2339. Fix a problem building xrdb with SVR4.0's cc (#2536, Satoshi Kimura).
+2338. Fix a trident 24bpp bug (#2535, Alan Hourihane).
+2337. Fix Permedia 2V hardware cursor (#2534, Alan Hourihane).
+2336. Add the rest of the known EM_ machine type defines, and Sparc
+ specific relocation defines to loader/elf.h (#2533, David Miller).
+2335. -
+2334. Disable MTRRs when unmapping memory (#2531, David Wragg).
+2333. Avoid the MTRR messages on systems with no MTRR support unless
+ the "mtrr" option is specified or -verbose is used (#2531, David Wragg).
+2332. -
+2331. Fix some offscreen pixmap-related problems with XAA (#2497, 2549,
+ Mark Vojkovich).
+
+XFree86 3.9Pd (9 March 1999)
+2330. Updates for Hurd port (#2528, UCHIYAMA Yasushi).
+2329. Fix some Solaris 7 build problems (#2530, Nicholas Brealey).
+2328. Add some more PCI entries (#2529, Nicholas Brealey).
+2327. Preliminary DGA support for the mga driver (#2527, Mark Vojkovich).
+2326. Fix some DGA bugs and turn on events in the DGA compatibility code
+ (#2526, Mark Vojkovich).
+2325. Fix the memory units in the old DGA (#2525, Mark Vojkovich).
+2324. Allow drivers to limit the size of XAA offscreen pixmaps (#2524,
+ Mark Vojkovich).
+2323. Fix the problem with XAA pixmap cache messages only being printed
+ for the first screen (#2524, Mark Vojkovich).
+2322. Temporarily disable rops without a source in the s3virge driver,
+ and add the ShowCache option (#2523, Mark Vojkovich).
+2321. Add XF86Config parser for VideoAdaptor configuration (#2521,
+ Michael Schimek).
+2320. Fis Permedia DPMS bug and Permedia 2 hw cursor (#2521, Michael Schimek).
+2319. Move include/Xvlib.h to include/X11/extensions/, add missing
+ XvPortNotify, and fix Xv DDX StopVideo deficiency (#2521,
+ Michael Schimek).
+2318. More ansifications/gcc warning removal for the clients (#2520,
+ Matthieu Herrb).
+2317. Implement backward compatibility for the server side of the VidMode
+ extension, which relies on the new clients informing the server of
+ their version (David Dawes).
+2316. Initial conversion of the VidMode extension for 4.0 (David Bateman).
+2315. Add DPMS support to the TGA driver (#2518, Matt Grossman).
+2314. Fix a bug in xaaInitAccel.c that affects disabling offscreen pixmaps
+ (#2519, Andrew Aitchison).
+2313. Some SiS driver fixes/updates (#2517, Juanjo Santamarta).
+2312. Fix a server crash when assiging the primary device (#2516,
+ Alan Hourihane).
+2311. Don't save/restore the VGA colourmap in the glint driver (#2515,
+ Alan Hourihane).
+2310. Fix a problem of using freed data in xgc (#2512, Jeff Anton).
+2309. Make the server fail gracefully when it can't load its base modules
+ (#2511, Alan Hourihane).
+2308. Fix a global declaration clash in panoramiXprocs.c (#2510,
+ Alan Hourihane).
+2307. Fix installation of GLX man pages (based on #2509, Matthieu Herrb).
+2306. Update the Linux/ppc section of xfree86.cf (#2507, Gerd Knorr).
+2305. Add code to the mga driver for using the fbdevhw module (#2507, 2522,
+ Gerd Knorr).
+2304. Add a fbdev module that provides a simple non-accelerated driver that
+ works on top of fbdevhw (#2507, Gerd Knorr).
+2303. Add a fbdevhw module that provides the functions needed to access
+ Linux framebuffer devices (#2507, Gerd Knorr).
+2302. Add a wrapper for mmap and munmap (#2507, Gerd Knorr).
+2301. Fix an XAA FillPoly problem that shows up with the noblank screen
+ saver (#2513, Mark Vojkovich).
+2300. Fix some problems in XAA's 32->24bpp image conversion (Mark Vojkovich).
+2299. Fix padding in the xf24_32bpp layer (#2508, Mark Vojkovich).
+
+XFree86 3.9Pc (2 March 1999)
+2298. Preliminary work on new DGA event support (#2506, Mark Vojkovich).
+2297. Add rewrite of s3virge driver's accel code (#2505, Mark Vojkovich,
+ Kevin Brosius).
+2296. Remove typos and inconsistencies between the Xv manual pages and
+ the implementation (#2504, Michael Schimek).,
+2295. Ansification and gcc warning elimnation in xfwp, xhost, xieperf,
+ xinit, xkbevd, xkbprint, xkbutils, xkill, xlogo (#2502, Matthieu Herrb).
+2294. Fix an MGA driver crash that shows up when running xtest (#2501
+ Alan Hourihane).
+2293. Correctly indicate when the MGA driver auto-detects SDRAM cards
+ (#2500, Alan Hourihane).
+2292. Add "noddc1" and "noddc2" options to the DDC layer to allow DDC to
+ be disabled (#2499, Alan Hourihane).
+2291. Change PsAttVal.c (Xprt/PS) so that values other then {PostScript 2}
+ can be put into xp-raw-formats-supported (#2498, Noah Roberts).
+2290. Fix a 'make includes' problem in lib/font that shows up on SVR4.
+2289. Integrate SGI's GLX and the Mesa core rendering library
+ (#2492, Precision Insight, SGI, Mesa).
+2288. -
+2287. New DGA DDX layer (not finished yet) (#2495, Mark Vojkovich).
+2286. Backwards compatibility layer translating DGA 1.0 into the new DDX
+ (#2494, Mark Vojkovich).
+2285. Disable old DGA support in the cirrus driver (#2493, Mark Vojkovich).
+2284. Ansification and gcc warning elimnation in xclipboard, xclock, xcmsdb,
+ xconsole, xdm, xdpyinfo, xedit, xfd and xfindproxy (#2491,
+ Matthieu Herrb).
+2283. Fix 8 plane TGA 8x8 pattern fill (#2490, Matt Grossman).
+2282. Fix pitch padding in the xf24_32bpp layer (#2489, 2496, Itai Nahshon).
+2281. Add DPMS support for the Cirrus Laguna chips (#2489, 2496, Itai Nahshon).
+2280. Add loader req/ref symbol lists to the cirrus module (#2489, 2496,
+ Itai Nahshon).
+2279. Fix cirrus display corruption with acceleration and SW cursor
+ (#2489, 2496, Itai Nahshon).
+2278. Add minimal 5430 support to the cirrus driver (#2489, 2496,
+ Itai Nahshon).
+2277. Resync LynxOS support (#2486, Thomas Mueller).
+2276. Remove the driver for the never-released P3D chipset (#2285, Dejan Ilic).
+2275. Change xf86XVScreenInit's arguments so that it's easier to initialize
+ the Xv DDX when adaptors come from multiple sources (#2484,
+ Mark Vojkovich).
+2274. Ansification and gcc warning elimnation in x11perf and xauth
+ (#2483, Matthieu Herrb).
+2273. Fix a backing store bug in the 24/32 layer, and add a local version
+ of a 24->24bpp copy routine since the performance in cfb24 is too
+ poor (#2481, Mark Vojkovich).
+2272. Add support for setting write-combining for the frame buffer memory,
+ and disabling WC for MMIO memory via the PPro/PII MTRR facility
+ provided in Linux 2.2 (#2480, 2503, David Wragg).
+2271. Xaw and xedit updates/fixes (#2479, Paulo Cesar Pereira de Andrade).
+2270. Add some more PCI data (#2478, Andrew Aitchison, #2489, 2495,
+ Itai Nahshon).
+2269. Fix a bug in the KIO8-U encoding in fontenc.c (#2477,
+ Juliusz Chroboczek).
+2268. Fix most of the warnings that show up when building on Digital Unix 4.0D,
+ with the DEC C compiler.
+2267. Fix for Millennium II hardware cursor-related loss of sync problem
+ that shows up with some revs of the 3026 ramdac (Trey Boudreau).
+2266. Update the setting of the option registers in G-type RAMDAC
+ Matrox cards and add "no_ddc" flag (Dirk Hohndel, Michael
+ Brown).
+
+XFree86 3.9Pb (20 February 1999)
+2265. Allow YaccCmd to be overridden in host.def (#2474-2476,
+ Christopher Sekiya).
+2264. Implement null overscans in VGA, minor fixups to VGA generic
+ default mode, re-add #ifndef's in VGA generic driver erroneously
+ deleted in 3.9No (#2473, Marc LaFrance).
+2263. More MULTIBUFFER extension fixes (#2471, Marc LaFrance).
+2262. Add support for the Matrox G200 SDRAM cards; G100 SGRAM still
+ doesn't work (Dirk Hohndel).
+2261. Support Linux PowerPC. Add Linux 2.2 PCI config space code
+ (#2470, Gerd Knorr).
+2260. Remove gcc warnings in the clients and lib/FS (#2469, Matthieu Herrb).
+2259. Updates to the PCI database (Dirk Hohndel, David Monro).
+
+XFree86 3.9Pa (14 February 1999)
+2258. Use /dev/io to enable I/O access on FreeBSD instead of KDENABIO.
+2257. Correct some typos/grammatical problems with the DESIGN doc (Ivan Bach).
+2256. Fix a crash when PciAccInfo isn't initialized (#2468, Alan Hourihane).
+2255. Add SiS530 detection to the SiS driver. Clock programming,
+ acceleration and hw cursor are not implemented, yet (Dirk Hohndel).
+2254. Fix some bugs related to hardware clipping of spans. XAA
+ WideLine speedups when hardware clipping is available (#2467
+ Mark Vojkovich).
+2253. Permedia2 clipping fixes, fix WritePixmap for non-GXcopy rasters
+ (#2466, Alan Hourihane).
+2252. Add -scanpci option and a scanpci module to the server. Add tons
+ of PCI2.1 subsystem ids to identify specifc cards; the PCI data
+ base needs more work (Dirk Hohndel).
+2251. Remove obsolete xf86[GS]etDefaultColorVisualClass() and fix some
+ small typos and comments; make type of BIOS, Memory and I/O
+ bases consistent (#2460,2465 Marc LaFrance).
+2250. Add ScanlineCPUToScreen for TX/MX and older Permedia chipsets
+ for when PCI retries are not enabled (#2459,2461,2462,2463
+ Alan Hourihane).
+2249. Add 24/8 overlay support for 3Dlabs chipsets and switch to MMIO
+ for vga access (#2459, Alan Hourihane).
+2248. Add 24/8 overlay support to IBM526 and IBM640 ramdacs, fix IBM640 hw
+ cursor (#2458, Alan Hourihane).
+2247. Fix depth 24 support in TGA driver (#2456, Tim Rowley).
+
+XFree86 3.9P (7 February 1999)
+2246. Some TGA driver speedups and cleanups (#2454, Matt Grossman).
+2245. Fix a lock_display() prototype problem in Xlibint.h that shows up
+ when building with -DXTHREADS.
+2244. Allow the driver to override XAA's assignment of Screen functions which
+ access the framebuffer (#2453, Mark Vojkovich).
+2243. Fix mga overlay problems related to the software cursor and disable
+ overlays for the G100 since it doesn't support planemasks (#2452,
+ Mark Vojkovich).
+2242. Rectangle outline performance improvements for the shadow framebuffer
+ (2451, Mark Vojkovich).
+2241. Update the ati driver code to include changes in 3.3.3.1. The driver
+ is not buildable yet (#2450, Marc La France).
+2240. Add support for VT switching to the 8+16 layer (#2449, Mark Vojkovich).
+2239. Export xf86NewSerialNumber() (#2448, Mark Vojkovich).
+2238. Fix XAA pixmap cache in 24bpp when ImageWrites are not available and
+ 32bpp pixmaps are used (#2447, Mark Vojkovich).
+2237. Improve performance for zero width arcs at 24bpp in the mga driver
+ (#2446, Mark Vojkovich).
+2236. Optimise 24->32bpp transfers (#2445, Mark Vojkovich).
+2235. Xterm patch #92 (#2444, Thomas Dickey).
+2234. Fix some compiler warnings in libfont (#2443, Marc La France).
+2233. Make building the Speedo and Type1 font code optional (#2443,
+ Marc La France).
+2232. Add DDC2 and Xv support for Permedia 2 to the glint driver (#2442,
+ Michael Schimek).
+2231. Update the glint driver's clipping for the new XAA clip support
+ (#2440, Alan Hourihane).
+2230. Add support for the ELSA Gloria-XXL with Glint Gamma chip (#2440, 2441,
+ Alan Hourihane).
+2229. Fix some ANSI vs non-ANSI prototype mixing in the Speedo code.
+2228. Fix a bug setting the framebuffer pixmap format for depth 4 in
+ xf86SetDepthBpp().
+2227. Fix some misuse of the VGA "Palette" enable/disable functions in the
+ vgahw code, and clarify what they do. This fixes some display artefacts
+ that were showing up when writing to the colourmap.
+
+XFree86 3.9Nz (1 February 1999)
+2226. Add an 8+16bpp dual framebuffer layer (#2425, Mark Vojkovich).
+2225. Add "ShadowFB" to the mga driver for experimenting with the shadowfb
+ layer (#2439, Mark Vojkovich).
+2224. Some cleanups/fixes for Solaris 7 (#2437, David Holland).
+2223. Ansify (and remove gcc warnings from) the following clients: appres,
+ bdftopcf, beforelight, bitmap and editres (#2436, Matthieu Herrb).
+2222. Eliminate cpp-related warnings about the "unix" symbol on NetBSD-current
+ (#2434, Matthieu Herrb).
+2221. Fix a bug in Xaw's StripChart widget that shows up with xload
+ (#2433, Matthieu Herrb).
+2220. Some initial code for supporting other SiS cards in the SiS driver
+ (#2420, Juanjo Santamarta).
+2219. Allow static Xvfb to compile (#2432, Marc La France).
+2218. Fix ddc and chips Imakefiles (#2432, Marc La France,
+ #2435, Matthieu Herrb).
+2217. Remove redundant BitsPerPixel macro definitions (#2432, Marc La France).
+2216. Remove some redundant rules from Xpm's Imakefile (#2432, Marc La France).
+2215. Fix some compiler warnings (#2432, Marc La France).
+2214. Allow the deprecated MultiBuffer extension to compile (#2432,
+ Marc La France).
+2213. Fix problems building with XInput disabled (#2432, Marc La France).
+2212. Fix 'make clean' to remove lndir and revpath (#2432, Marc La France).
+2211. Add a new "shadowfb" layer that maintains a virtual framebuffer in
+ system memory and tells the driver what parts of the videoram
+ framebuffer need updating. This allows the use of write-only videoram
+ framebuffers (#2431, 2438, Mark Vojkovich).
+2210. Fix some compilation problems on Alpha platforms caused by some
+ inlines in complier.h being declared as extern instead of static
+ (2430, Matt Grossman).
+2209. Remove the inconsistencies with numeric chipset tokens in the s3virge
+ driver (#2428, Kevin Brosius).
+2208. Move the mga DDC code into the PreInit function, add I2C support
+ (disabled and not working so far), and allow the driver to continue
+ without DDC support if the DDC module is missing (#2427,
+ Andrew Aitchison).
+2207. Fix a problem with xsm not acknowledging the SaveYourself message it
+ sends clients with a SaveComplete message (#2426, Robert Bihlmeyer).
+2206. Update the mga driver to use the new XAA clipping (#2424,
+ Mark Vojkovich).
+2205. Some enhancements to XAA's HW clipping handling, allowing clipping
+ to be used for more than just lines (#2423, Mark Vojkovich).
+2204. Fix a problem with the previous cfb screen pixmap access fix (#2242,
+ Mark Vojkovich).
+2203. Fix SiS 24bpp support (#2421, Alan Hourihane).
+2202. Fix SiS HW cursor, max clock and 16bpp support (#2418, Alan Hourihane).
+2201. Update the ramdac module's HW cursor support to handle hardware that
+ requires nibble swapping (#2417, 2419, Alan Hourihane).
+2200. Make the fact that the XAA TE font rendering assembly code is disabled
+ by default more obvious (#2416, David Bateman).
+2199. Fix VT switches in 8+32 mode (#2415, Mark Vojkovich).
+2198. Add common encoding support for the Speedo, Type1 and FreeType
+ font backends (#2385, Juliusz Chroboczek).
+2197. Update lib/font/FreeType to xfsft-1.0.3 (#2385, Juliusz Chroboczek).
+2196. X-TT updates for our loader (X-TT team and Nozomi Ytow).
+2195. Import X-TrueType 1.2pre-19990125 (X-TT team).
+
+XFree86 3.9Ny (26 January 1999)
+2194. Some improvements to the XAA TE font rendering assembly code (note
+ that this assembly code is disabled by default) (#2413, David Bateman).
+2193. Fix some places in cfb that were accessing the screen pixmap directly
+ from the private (#2412, Mark Vojkovich).
+2192. Fix a FreeType build problem on 64-bit platforms (#2411, Alan Hourihane).
+2191. Fix a cfb24 build problem that shows up with egcs (#2410,
+ Alan Hourihane).
+2190. Add DPMS, DDC1 and HW cursor support to the SiS driver, and fix panning
+ in the SiS driver (#2409, Alan Hourihane).
+2189. Put copyright notices from the pandix/panmi code into the merged
+ dix/mi versions (#2408, Alan Hourihane).
+2188. Update drivers to use the 24/32 conversion layer, and to default to
+ a 24bpp framebuffer format when supported.
+2187. Make some refinements to the way the depth 24 pixmap format is set.
+2186. Replace the ModuleInit function with a ModuleData data object. This
+ allows the loader to get the version and entry points from a module
+ without first executing module code.
+2185. Unify the abiclass and abivendor fields of XF86ModuleVersionInfo,
+ and add a moduleclass field.
+2184. Add a SaveRestoreImage field to the ScrnInfoRec to allow drivers to
+ supply an alternative to the default.
+
+XFree86 3.9Nx (24 January 1999)
+2183. Prevent LoadSubModule() from passing absolute module paths and from
+ providing its own module search path.
+2182. Import FreeType 1.2. This includes the FreeType library specific parts
+ of #2385 from Juliusz Chroboczek.
+2181. Add a root-only -modulepath command line option to the X server.
+2180. Fix the VT switch screen restore bug introduced a few versions ago
+ (#2406, Mark Vojkovich).
+2179. ND version of the SiS driver, currently only for the 6326 chip (#2404,
+ 2405, 2407, Alan Hourihane).
+2178. xterm patch #91 (#2402, Thomas Dickey).
+2177. Add 32/24 support to the MGA driver (#2401, Mark Vojkovich).
+2176. Add 32bpp->24bpp conversion acceleration to XAA (#2400, Mark Vojkovich).
+2175. Add partial acceleration support to the TGA driver (#2399, 2403,
+ Matt Grossman).
+2174. Fix an 8+32 layer bug introduced in 3.9Nw (#2398, Mark Vojkovich).
+2173. Add a 32/24 conversion layer. Pixmaps are still 24bpp internally,
+ but the interfaces visible to clients are all 32bpp (#2397,
+ Mark Vojkovich).
+2172. Fix trident driver panning at 24bpp (#2395, Alan Hourihane).
+2171. Add DDC1 and DDC2 (the latter not working yet) to the trident driver
+ (#2395, Alan Hourihane).
+2170. Add MCLK override to the trident driver (#2395, Alan Hourihane).
+2169. Enable pixel multiplexing to the trident drive for high resolution
+ 8bpp modes (#2395, Alan Hourihane).
+2168. Add clipping for the Trident 9682 and 9685 and Mono8x8 and CPUToScreen
+ support for the 9685 (#2395, Alan Hourihane).
+2167. Add offscreen pixmap support for the Trident Image series (#2395,
+ Alan Hourihane).
+2166. Fix some cfb24 problems that showed up after the previous changes
+ (#2396, Nozomi Ytow).
+2165. Update the C&T HW cursor defaults to only disable them by default when
+ necessary (#2394, David Bateman).
+2164. Add some sanity checking for the subdirs argument to LoadSubModule, etc.
+2163. Fix a bug in the verbose Mode handling in the parser that can result
+ in an infinite loop when the "Mode" keyword is used incorrectly in
+ a config file.
+2162. Add a global default module path to the loader, and a function that
+ the common layer can call to set it.
+2161. LoadModule was ignoring the subdir list argument (Nozomi Ytow).
+2160. Add printing of subsystem ids to scanpci (Dirk Hohndel).
+
+XFree86 3.9Nw (17 January 1999)
+2159. Add functions for finding the pixmap format and pixmap bpp for a
+ given depth, and fix a crash in xf86ValidateModes() caused by recent
+ changes in this area.
+2158. Add an extra argument to LoadSubModule (and LoadModule) to allow the
+ caller to optionally specify version and/or ABI requirements that
+ the loaded module must meet for the load to complete successfully.
+2158. Add support to the loader for vendor-defined ABI classes. These classes
+ are specified as a string. The main use is for third party modules that
+ themselves load sub-modules (like X-TT).
+2157. Fix the MGA driver's handling of the "MGA_SDRAM" option. SDRAM cards
+ are still not auto-detected though (#2391, Mark Vojkovich).
+2156. Add a screen->screen colour expansion bug workaround to the MGA driver,
+ and enable the faster linear expansions instead of the planar ones
+ (#2390, Mark Vojkovich).
+2155. Fix some depth/bpp issues in the SHM code (#2389, Mark Vojkovich).
+2154. Export some missing symbols for Alpha platforms (#2388, Alan Hourihane).
+2153. Fix a bug in determing the card type in the TGA driver (#2387,
+ Alan Hourihane).
+2152. Fix a problem in ramdac/BT.c (#2386, Alan Hourihane).
+
+XFree86 3.9Nv (15 January 1999)
+2151. Fix cfb24 problems that show up with xtest (#2384, Nozomi Ytow).
+2150. Fix 64 pixel rounding of display width in the C&T driver (#2383,
+ David Bateman).
+2149. Add an UnloadSubModule() function that can unload individual sub-modules
+ without unloading sibilings.
+2148. Remove a lot of unnecessary casts of x*alloc().
+2147. Add a pciGetBaseSize() funtion to the PCI code.
+2146. Make our PCI code aware of the following 2.1 type 0 header fields:
+ Cardbus CIS pointer and subsystem ids.
+2145. Remove the KEEP_BPP code, and fix problems with some drivers referencing
+ the unused pixmapBPP ScrnInfoRec field.
+
+XFree86 3.9Nu (13 January 1999)
+2144. Fix a bug in PANORAMIX_FREE(), which was referencing just freed data.
+2143. Merge the pandix/panmi code into dix and mi, and enable building
+ the Xinerama (panoramiX) extension by default (#2377-2381,
+ Alan Hourihane).
+2142. Rework the handling of the depth/bpp/fbbpp options. The -bpp flag and
+ related config file keywords are no longer used. New flags and options
+ have been added to specify the server-wide depth 24 pixmap format.
+ A "standard" set of pixmap formats is always advertised, so drivers
+ using these don't need to worry about explicitly adding them.
+2141. Fix some sun_path overflows in xtrans.
+2140. Some panoramix fixups (#2376, Alan Hourihane).
+2139. Don't allow arbitrarily long display number strings to be passed on
+ to xtrans by _X11TransConnectDisplay().
+2138. Update the parser and xf86Config.c to allow Options to be specified in
+ the config file's ServerLayout section. Options in the ServerLayout
+ section can override those in the ServerFlags section.
+2137. Update the parser and xf86Config.c to allow "Inactive" devices
+ to be specified in the config file's ServerLayout section.
+2136. Import xpm version 3.4k.
+
+XFree86 3.9Nt (11 January 1999)
+2135. Fix 8+32 rendering bugs (#2374, Mark Vojkovich).
+2134. Update vgaHWddc1SetSpeed() to select the 25 MHz clock (#2373,
+ Alan Hourihane).
+2133. Add support for a shared font library (#2364, Takuya SHIOZAKI).
+2132. Add ProfiledDepLibraryTarget, DebuggedDepLibraryTarget and
+ SharedDepLibraryTarget rules to imake (#2364, Takuya SHIOZAKI).
+2131. Fix a typo in xf86Init.c (#2372, Nozomi Ytow).
+2130. Xaw and xedit updates (#2371, Paulo Cesar Pereira de Andrade).
+2129. Move the DDC call to before the mode initialisation in the mga driver
+ (#2367, Alan Hourihane).
+2128. Fix a problem with the xkb dvorak layout (#2362, Tabman)
+2127. Fix an xsm crash (NULL dereference) when a client sets an SM property
+ list to a length of zero (#2361, Robert Bihlmeyer).
+2126. Untested support for the Trident 939A/DVD (#2359, 2360, Alan Hourihane).
+
+XFree86 3.9Ns (3 January 1999)
+2125. Allow backing store to be controlled with a per-screen config file
+ option (#2357, Mark Vojkovich).
+2124. Fix XAA so that the offscreen pixmaps are compatible with backing store
+ (#2354, Mark Vojkovich).
+2123. Fix a bug in XAA's stipple to 8x8 pattern reduction code (#2352,
+ Mark Vojkovich).
+2122. 8+32 overlay support for XAA (#2352, 2356, Mark Vojkovich).
+2121. Add TGUI9440 and Cyber9320 support to the trident driver (#2348,
+ Alan Hourihane).
+2120. Fix a typo in xkbcomp/symbols/sun/Imakefile (#2337, Matthieu Herrb).
+2119. Mga driver updates for the new 8+32 overlay support (#2332, 2353,
+ Mark Vojkovich).
+2118. New 8+32 overlay support (#2331, 2351, 2358, Mark Vojkovich).
+2117. Fix a bug in the xterm man page (#2333, Thomas Dickey).
+2116. Remove the -fno-strength-reduce option for OpenBSD and NetBSD (#2328,
+ Matthieu Herrb).
+2115. Import regex for systems that don't have a Posix regex.
+2114. Add a LoaderListDir() function that can be used to list the available
+ modules.
+2113. Modify LoadModule and LoadSubmodule to accept optional subdir and
+ pattern lists, and use regular expressions for the module matching
+ instead of prefix/suffix lists.
+2112. Add a "revpath" utility to xc/config/util to help in dealing with
+ imake's use of relative paths. If this proves to be useful, it could
+ be used more widely in imake's rules.
+2111. Install some classes of modules into subdirectories of the "modules"
+ directory. The imake module install rules have been updated
+ accordingly.
+
+XFree86 3.9Nr (20 December 1998)
+2110. Add support for the wscons console driver for NetBSD-current (#2326,
+ Matthieu Herrb).
+2109. Remove cfbPuntCopyPlane from cfb (#2325, Mark Vojkovich).
+2108. Fix a build problem related to Xarch.h on NetBSD (#2322, Isao Ohishi).
+2107. Fix an XAA bug tha can result in a zero height when rendering TE text
+ (#2321, Mark Vojkovich).
+2106. Fix an optimization bug in the new XAA rect and span code (#2319,
+ Mark Vojkovich).
+2105. Accelerate CopyPlane on offscreen pixmaps (#2318, Mark Vojkovich).
+2104. Fix a 4bpp problem with the C&T driver and the new colourmap code
+ (#2317, David Bateman).
+2103. Enable XAA offscreen pixmaps in the C&T driver (#2317, David Bateman).
+2102. ImageRead functions for some C&T HiQV chipsets (disabled) (#2317,
+ David Bateman).
+2101. MMIO access to the registers for PCI C&T 69000 (#2317, David Bateman).
+2100. Cleanup code in mipushpxl.c (#2313, Thomas Mueller).
+2099. Fix MX/TX clipping bugs in the glint driver (#2312, Alan Hourihane).
+2098. xterm patch #90 (#2311, Thomas Dickey).
+2097. Export missing symbols for panoramiX (#2310, Alan Hourihane).
+2096. Initialise a number of Xlib/Xt data structures, correct a minor linker
+ bug in OS/2 (#2026, Holger Veit).
+2095. Fix some realloc() usages (#2019, Matthieu Herrb).
+2094. Support for arc4random() in xdm/genauth.c (#2019, Michael Shalayeff).
+2093. Update mkfontdir to create an appropriate fonts.dir file when no
+ fonts are found rather than doing nothing.
+2092. Replace void main() -> int main() for ANSI conformance (#2019,
+ Matthieu Herrb).
+2091. Only allow the X server -nolock option when the real uid is root.
+2090. Some sanity checks on DISPLAY name (#2168, Kevin Vajk).
+2089. Fix an Xnest crash with too many visuals (#2019, Matthieu Herrb).
+2088. Swedish sun keyboard support in Xsun and xkb (#2019, Magnus Holmberg).
+2087. A quick attempt at neutralising a stack-buffer overflow problem in
+ the Xprt server.
+2086. LP64 compiler warning fixes from the NetBSD xsrc tree (#2019,
+ Ross Harvey).
+2085. Don't install lndir on OpenBSD (#2019, Matthieu Herrb).
+2084. Teach imake how to automatically determine the NetBSD architecture
+ (#2180, Jason Thorpe).
+2083. Add local font directory (Dirk Hohndel).
+2082. LynxOS OS version detection for imake (#2039, Thomas Mueller).
+2081. Resync OpenBSD.cf (#2019, Matthieu Herrb).
+2080. Fix security problem by creating /tmp/.X11-unix with sticky bit (#2168,
+ Kevin Vajk, David Dawes, Dirk Hohndel).
+2079. Make LinkVarDirectory handle DESTDIR (#2019, Matthieu Herrb).
+2078. Resync NetBSD.cf.
+2077. Some doc and nroff-related updates to the build system.
+2076. Update tk/tcl definitions in FreeBSD.cf and add support for building
+ a.out compatibility libraries on FreeBSD/ELF systems.
+2075. Create host.def with sane defaults when none exists and when a cut-down
+ source tree is detected.
+2074. Resync with 3.3.3 (items 2075-2096 above).
+2073. Fix an xset segfault (#2320, Itai Nahshon).
+
+XFree86 3.9Nq (13 December 1998)
+2072. Change the modversion field in the XF86ModuleVersionInfo struct into
+ separate major, minor and patchlevel fields.
+2071. Initial DG/ux support (#2299, Takis Psarogiannakopoulos).
+2070. DDC1 support for TVP3026 based Matrox cards (#2309, Andrew Aitchison).
+2069. More rewrites of the way spans and rects are handles in XAA so that
+ it never has to allocate any memory, thereby eliminating potential
+ stack overflow problems (#2308, Mark Vojkovich).
+2068. MGA driver-provided FillCacheBltRects replacement, optimised for fastblt
+ (#2307, Mark Vojkovich).
+2067. Choose MGA planar vs linear screen to screen colour expansion at runtime
+ rather than at compile time (#2307, Mark Vojkovich).
+2066. Fix a build problem related to Xarch.h on OpenBSD (#2306,
+ Matthieu Herrb).
+2065. Fix a typo in FreeBSD.cf that affects adding the runtime library
+ search patch for 2.2.x (#2305, Keisuke Inoue).
+2064. Some enhanced XKB files for French-Canadian keyboards (#2204,
+ Eric Moreau).
+2063. Fix an incorrect realloc in xmodmap (#2303, Alexander V. Lukyanov).
+2062. Fix depth 30 for the glint driver (#2297, Alan Hourihane).
+2061. Resync pandix and panmi, and fix some panoramix build problems
+ (#2296, Alan Hourihane).
+2060. Enable offscreen pixmaps for the glint driver (#2295, Alan Hourihane).
+2059. Fix PC98 XKB (#2292, Hirofumi Nishizuka and #2300, Tetsuo Tsukamoto).
+2058. Fix some unresolved symbols (#2293, Michael Rohleder).
+
+XFree86 3.9Np (6 December 1998)
+2057. Some xedit updates (#2291, Paulo Cesar Pereira de Andrade).
+2056. Updates to the Xaw text code (#2291, Paulo Cesar Pereira de Andrade).
+2055. XAA doc updates (#2289, Mark Vojkovich).
+2054. Replace linear screen to screen colour expansions with planar ones
+ in the MGA driver because there seems to be a hardware problem with
+ the linear ones (#2288, Mark Vojkovich).
+2053. Enable offscreen pixmaps for the MGA driver (#2288, Mark Vojkovich).
+2052. Some misc XAA updates (#2287, Mark Vojkovich).
+2051. A non-trival rewrite of the way fills are done in XAA (#2287,
+ Mark Vojkovich).
+2050. Add a LINEAR_FRAMEBUFFER flag to XAA so that the pixmap cache can
+ be loaded without requiring a driver-supplied ImageWrite function
+ (#2287, Mark Vojkovich).
+2049. Add fully accelerated offscreen pixmaps support to XAA (#2287,
+ Mark Vojkovich).
+2048. Add a RemoveAreaCallback for the offscreen memory manager. Areas
+ for which this is supplied are considered lower priority than ones
+ that don't, and can be booted out when something of higher priority
+ needs the space (#2286, Mark Vojkovich).
+2047. Remove the ScreenPtr passed to the offscreen memory manager's resize
+ function since it is already available from the FbAreaPtr (#2286,
+ Mark Vojkovich).
+2046. Change xf86SaveRestoreImage() so that it doesn't create a new
+ screen pixmap but modifies the old one (#2285, Mark Vojkovich).
+2045. Add support to mi for pixmaps with non-zero origins (#2284,
+ Mark Vojkovich).
+2044. Fix some Alpha compilation problems introduced in 3.9No (#2283,
+ Alan Hourihane).
+2043. Fix an Xlib problem with _XimLookupMBText() when using KOI8-R
+ (#2282, Alexander Kabaev).
+2042. Fix the pattern source address mask for the C&T HiQV chips, which
+ was causing 8x8 pattern problems when using more than 2MB of video
+ memory (#2281, Peter Wainwright).
+2041. Update the TGA and Trident drivers for the ramdac/cmap changes (#2277,
+ Alan Hourihane).
+2040. Change the Permedia2 to use a direct LoadPalette rather than the
+ ramdac module because of 16bpp difficulty with the TVP3026 (#2277,
+ Alan Hourihane).
+2039. Remove the old cmap code from the ramdac module and use the new
+ cmap layer instead (#2277, Alan Hourihane).
+2038. Fix os.h and misc.h so that system headers don't get included when
+ building modules.
+2037. Make the X server read an Xauthority file using the real user id
+ to avoid problems when it is located on an NFS-mounted filesystem.
+ (as suggested by #2276, MIHIRA Sanpei Yoshiro).
+2036. Xdm patch to allow the "Willing to manage" test displayed in the chooser
+ window to be generated from a program run on the target host. This
+ allows information like number of users, load average, etc to be
+ displayed (like CDE does) (#2275, Dick Snippe).
+2035. Fix a core dump problem in xauth when interrupted while attempting
+ to lock the auth file. Also fix a potential problem with calling
+ printf() from within a signal handler (#2274, BSDI/Jeff Polk).
+2034. Add DDC2 probing for Cirrus 5446/5480 and Laguna chipsets (#2273,
+ Itai Nahshon).
+2033. Fix some possible memory corruption and some minor bugs in the new DDC
+ code (#2271, 2272, Itai Nahshon).
+2032. Offscreen memory manager and colormap layer doc updates (#2270, 2290,
+ Mark Vojkovich).
+2031. Some glint clipping fixes (#2269, Alan Hourihane).
+2030. New XInput code, including new drivers for the SpaceOrb and Magellan
+ (#2243, Metro Link).
+2029. Fix mga YDstOrg start address adjustment after VT switching.
+2028. Fix cfb24 bitblt for non-trivial planemasks (Peter Wainwright).
+2027. Fix bad headers included when compiling cup.c for extmod module.
+2026. Fix a malloc/xfree mismatch in xtrans LocalInitTransports().
+2025. Add some documentation for DDC (#2259, Egbert Eich).
+2024. Fix a problem with recent VT switch changes.
+
+XFree86 3.9No (29 November 1998)
+2023. Fix the depth vs bpp mixup in miCreateScreenResources().
+2022. Resync the s3virge driver with most of the updates contained in 3.3.3.
+ This includes GX2 and MX+ support and the set_mclk and set_lcdclk
+ options (#2267, Kevin Brosius).
+2021. Update the cirrus, chips and tseng drivers to use the new colourmap
+ layer (via vgaHWHandleColormaps).
+2020. Add support for automatically adjusting the overscan colour index to
+ the new colourmap layer.
+2019. Disable backing store by default, and provide a "+bs" option to enable
+ it from the command line. This may be done in a better way later.
+2018. Remove the per-depth cfb private indices added in 3.9Nn (#2265,
+ Mark Vojkovich).
+2017. Build cfb with -DSINLGEDEPTH because we don't need the per-depth
+ cfb Screen privates.
+2016. Fix problems with the allocation of the cfbScreenPrivateIndex
+ parameters.
+2015. Remove the offscreen memory manager functions out of the ScrnInfoRec
+ (#2266, Mark Vojkovich).
+2014. Update the s3virge driver to use the new colormap layer, which fixes
+ the VT switch colormap problem (#2264, Kevin Brosius).
+2013. Disable s3virge trapezoid fills since they don't match cfb (#2264,
+ Kevin Brosius).
+2012. Add an ImageWrite function for the s3virge driver, so the pixmap
+ cache support now works (#2264, Kevin Brosius).
+2011. Turn off PCI_RETRY by default in the glint driver, and various other
+ driver updates (#2263, Alan Hourihane).
+2010. Fix a glint driver bug in WritePixmap for TX/MX chipsets (#2263,
+ Alan Hourihane).
+2009. Update the Alpha unaligned access inlines in compiler.h, based on
+ similar code in the Linux kernel (#2240, Matti Aarnio).
+2008. Fix a typo in the C&T driver (#2262, Nozomi Ytow).
+2007. Enable building libraries and clients for for sparclinux (#2261,
+ Christopher Sekiya).
+2006. Define _XOPEN_SOURCE for Linux (#2261, Christopher Sekiya).
+2005. Add the vga copy plane expansion patch to the vgafb code (#2021,
+ Jens Owen).
+2004. -
+2003. Fix a bug in xaaStipple.c which can cause a blitter lockup.
+2002. Fix a C&T bug that causes memory corruption when not in linear mode
+ (#2260, Egbert Eich).
+2001. Only disable C&T transparency blits for HiQV chips below 65550, and
+ fix the display pitch when acceleration is enabled (#2260,
+ David Bateman).
+2000. Conditionally enable ScreenToScreenColorExpandFills for C&T HiQV
+ chips (#2259, 2260, Nozomi Ytow, Egbert Eich).
+1999. Reduce the timeout period for C&T blitter lockups and reset the reset-bit
+ after blitter timeouts (#2260, Egbert Eich).
+1998. Add DDC1/2 support for the C&T driver (not tested) (#2260, Egbert Eich).
+1997. Add a DDC module with DDC1 and DDC2 support for EDID version 1.x,
+ and untested VDIF support (#2259, 2260, Egbert Eich).
+1996. Fix a problem switching from VT back to X when displayPitch
+ != displayWidth (#2260, Egbert Eich).
+1995. Some colormap layer optimisations (#2258, Mark Vojkovich).
+1994. Add some missing micmap symbols to the loader's export list (#2257,
+ Alan Hourihane).
+
+XFree86 3.9Nn (22 November 1998)
+1993. Set the valid gamma range as macros rather than having it hard coded
+ in various places.
+1992. Always refer to and store the gamma values as those of the monitor,
+ not of the correction. This means that the values stored in the
+ ScrnInfoRec are now the same as those entered in the config file and
+ on the command line.
+1991. Fix the colormap layer's handling of static colormaps (#2255,
+ Mark Vojkovich).
+1990. Add XAA acceleration for pixmap->window N deep planar copies (#2254,
+ Mark Vojkovich).
+1989. Add an xf86ChangeGamma() function to the colormap layer (#2253,
+ Mark Vojkovich).
+1988. Have NameCompare() check for NULL pointers (#2252, Rik Faith).
+1987. Port Mark Vojkovich's accelerated line code form Permedia 2 to TX
+ and Permedia 1 chips (#2249, Alan Hourihane).
+1986. Fix mono 8x8 pattern problem for Permedia 1 (#2249, Alan Hourihane).
+1985. Fix glint crash in CloseScreen, and set rgbBits to 8 by default
+ (#2249, Alan Hourihane).
+1984. Fix glint CRTC setting alignment when using 24bpp (#2249,
+ Alan Hourihane).
+1983. Give all cfb private indices unique names so that cfb's for multiple
+ depths can be loaded on the same screen (#2248, 2250, 2251,
+ Mark Vojkovich).
+1982. xterm patch #89, including the completion of double-sized character
+ support (#2247, Thomas Dickey).
+1981. Fix an MGA dashed line clipping bug (#2246, Mark Vojkovich).
+1980. S3virge driver updates, including som acceleration, reinstatement of
+ config options and chip ID changes (#2245, Kevin Brosius).
+1979. Fix some RAC-related problems with the glint driver (#2244,
+ Alan Hourihane).
+1978. Fix some 64-bit problems in some unused driver code (for reference)
+ (#2242, Matti Aarnio).
+1977. Fix a 64-bit alignment problem in cfb8line.c (#2242, Matti Aarnio).
+1976. Fix a typo in Pclose() (#2242, Matti Aarnio).
+1975. Update some Linux-related Imake.cf settings (#2242, Matti Aarnio).
+1974. -
+1973. Cirrus 546x memory interleaving (#2235, Corin Anderson).
+1972. XAA and HW cursor support for the Cirrus 546x series (#2235,
+ Corin Anderson).
+1971. Fix a cirrus 546x clock setting problem that was introduced in 3.9Nm
+ and add a few more predefined dot clocks (#2234, #2235, Corin Anderson).
+1970. Move the generic one-installed-colormap colormap handling functions
+ into micmap.c, remove the use of STATIC_COLOR, update other fb
+ layers to use the micmap functions where appropriate and ensure
+ that they initialise InstallColormap, UninstallColormap, StoreColors
+ and ListInstalledColormaps in their ScreenInit functions. Also move
+ the global InstalledMaps array into micmap.c.
+
+XFree86 3.9Nm (15 November 1998)
+1969. libXv fix (#2233, Michael Schimek).
+1968. Add support for building clients on NetBSD/vax 1.3H (#2231,
+ Chris Sekiya).
+1967. Add an alternate init function for the framebuffer manager. The new
+ one takes a region rather than a box which allows disconnected regions
+ to be managed (#2230, Mark Vojkovich).
+1966. XAA pixmap cache fix (#2229, Mark Vojkovich).
+1965. Add support to XAA for filled rects via ImageWrites (#2227,
+ Mark Vojkovich).
+1964. Preliminary "XAnti" extension for antialiasing (#2224, Mark Vojkovich).
+1963. Fix glint driver coordinates when offscreen (negative) when using
+ colour expansion and the NEGATIVE_X stuff (#2221, Alan Hourihane).
+1962. Add PCI IDs for S3 Trio3D and Savage chips to scanpci and xf86PciInfo.h
+ (#2220, Harald Koenig).
+1961. Add support to XAA for the caching of planar colour expansion data,
+ including an example of how to use it in the mga driver (#2215,
+ Mark Vojkovich).
+1960. Xaw and xedit updates (#2205, Paulo Cesar Pereira de Andrade).
+1959. Provide code to initialise cirrus memory config registers on non-primary
+ cards using config file options (#2202, Itai Nahshon).
+1958. Initial code for Cirrus Laguna I2C/DDC support (#2202, Itai Nahshon).
+1957. Fix some cirrus initialisation errors and MCLK calculation (#2202,
+ Itai Nahshon).
+1956. Synch the cir.h and lg.h files (#2202, Itai Nahshon).
+1955. For newer Cirrus Alpine chips, replace most I/O operations to calls
+ to the vgahw I/O routines, and configure them for MMIO when available
+ (#2202, Itai Nahshon).
+1954. Fix mga G100/200 planemask problem (#2198, Mark Vojkovich).
+1953. Update the mga driver to use the new colourmap layer (#2198,
+ Mark Vojkovich).
+1952. A new colourmap layer (#2197, Mark Vojkovich).
+1951. Redo the lbx colourmap fix in a multihead friendly way (#2196,
+ Mark Vojkovich).
+1950. Make the resource access updates to the glint driver to get it working
+ again (#2177, Alan Hourihane).
+1949. Fix Cirrus 546x big screen modes, 32bpp modes (#2175, Corin Anderson).
+1948. Support for the Cirrus 5464 (5462 remains untested) (#2175,
+ Corin Anderson).
+1947. Fix xf86ValidateModes() to make the maxHeight parameter optional
+ as documented (#2174, Corin Anderson).
+1946. Acceleration for the trident 3DImage/Cyber9388/Cyber9397 chipsets,
+ and accel updates for other trident chips (#2161, Alan Hourihane).
+1945. Implement I2C layer for the trident driver (#2161, Alan Hourihane).
+1944. Add TGUI96xx hardware cursor support (#2161, Alan Hourihane).
+1943. Add some xkb entries for 105 key international PC keyboards (#2157,
+ Matthieu Herrb).
+1942. Enable mode switching for the ViRGE driver (#2156, Kevin Brosius,
+ 2200, Joe Moss).
+1941. Add depths 15,16,24 to the preliminary ViRGE driver (#2156,
+ Kevin Brosius).
+1940. Replace __syscall() with syscall() in Linux/Alpha PCI code (#2211,
+ Matti Aarnio).
+
+XFree86 3.9Nl (1 November 1998)
+1939. xterm patch #88 (#2152, Thomas Dickey).
+1938. Fix some build problems that show up on SunOS 4.1.4.
+1937. Allow the driver to give XAA the definition of a full planemask,
+ with a reasonable default set when it doesn't (#2150, Mark Vojkovich).
+1936. XAA optimisation: when fgPixel == bgPixel draw opaque stipples as
+ solid rects (#2150, Mark Vojkovich).
+1935. Preliminary S3 ViRGE driver conversion (#2148, Kevin Brosius).
+1934. Fix a bug in the LBX extension's colourmap code (#2143, Mark Vojkovich).
+1933. Add base address size and type fields to PciVideoRec (#2141,
+ Egbert Eich).
+1932. Change the PCIInfo entries for NeoMagic chips (#2141, Egbert Eich).
+1931. Some C&T driver updates (#2141, Egbert Eich).
+1930. Add support for the Cirrus 5465 (and 5464, 5462 -- untested)
+ (#2140, Corin Anderson).
+1929. Make the vgahw module a little easier to use by setting its own
+ defaults where appropriate.
+
+XFree86 3.9Nk (25 October 1998)
+1928. Some XAA GC validation bug fixes and optimisations. This includes
+ wrapping pixmap rendering to determine when pixmap cache invalidation
+ is required (#2126, Mark Vojkovich).
+1927. Backout the dix fb,bg planemask manipulation added in a previous version
+ (#2125, Mark Vojkovich).
+1926. Fix an MGA fastblt bug (#2124, Mark Vojkovich).
+1925. Accelerate zero width arcs on MGA (only use for rops other than
+ GXcopy and when PCI retries are enabled) (#2124, Mark Vojkovich).
+1924. Restore default-promotion to the Xdmcp library (#2103, Thomas Dickey).
+1923. Prototype/ansification cleanup for Xserver/XIE, xfs, fontlib, mkfontdir,
+ and fix some bugs found along the way (#2103, Thomas Dickey).
+1922. Set HasPoll to YES for Linux with glibc2 (#2095, Kars de Jong).
+1921. Fix some MGA modeline problems and change the G200 MCLK to 143MHz
+ (#2088, Radislaw Kapitan).
+1920. Move xedit from the contrib tree to the main tree.
+1919. Xaw and xedit updates (see the changelog in the Xaw directory for
+ details) (#2083, Paulo Cesar Pereira de Andrade).
+1918. Add support for BSD 4.4 style long file names in ar archives to
+ the loader (#2066, Matthieu Herrb).
+1917. Some GNU/Hurd config/build updates (#2057, UCHIYAMA Yasushi).
+1916. Do a soft reset for secondary MGA cards prior to probing for the
+ video memory size (#2052, Radislaw Kapitan).
+1915. sigset_t isn't an integer type on NetBSD (and some other OSs) so
+ don't try to print it in xdm (#2048, Matthieu Herrb).
+1914. NetBSD's preprocessor emits a warning when it sees '#ifdef unix',
+ which makes imake noisy (#2048, Matthieu Herrb).
+1913. xterm patches 85, 86, 87 (see xterm.log.html for details) (#2043, 2056,
+ 2097, Thomas Dickey).
+1912. Change "fcd8859-15" to "iso8859-15".
+1911. Some updates to the "dacG" mga reset code, and enable it by default
+ since it helps initialising an inactive secondary G200 (#2032,
+ Radoslaw Kapitan).
+
+XFree86 3.9Nj (11 October 1998)
+1910. Fix the 8+24 overlay's CopyWindow wrapper so that it works properly
+ with "NoAccel" or without hardware planemasks (#2041, Mark Vojkovich).
+1909. Reenable planemasks for SDRAM G200s and disable for all G100 (#2040,
+ Mark Vojkovich).
+1908. Add mga overlay support for the TVP3026 (#2040, Mark Vojkovich).
+1907. Ansifiy and remove most warnings from the Xdmcp library and xdm
+ (#2038, Thomas Dickey).
+1906. xterm patch 84 (see xterm.log.html for details) (#2036,
+ Thomas Dickey, Bjorn Helgaas).
+1905. Enhancements for xedit (#2028, 2033, Paulo Cesar Pereira de Andrade).
+1904. Patch to make editres work properly (#2028,
+ Paulo Cesar Pereira de Andrade).
+1903. Xaw updates (see the changelog in the Xaw directory for details)
+ (#2028, 2033, Paulo Cesar Pereira de Andrade).
+
+XFree86 3.9Ni (6 October 1998)
+1902. Fix miCreateDefColormap() for depth 1.
+1901. Update the "extmod" module of the new extensions.
+1900. Fix some font-related problems introduced by the R6.4 merge.
+1899. Update the cirrus driver for the recent i2c module changes (#2025,
+ Itai Nahshon).
+1898. Initial XAA acceleration for the cirrus driver (#2025, Itai Nahshon).
+1897. Add some option code to do a soft reset when restoring the video state
+ for the "dacG" part of the MGA driver (#2012, Uli Walther).
+1896. Add some TTF encoding files (#2013-2016, Juliusz Chroboczek).
+1895. Resync the FreeType server interface with Xfsft-1.0.2, including
+ code to read encodings from plain text files (#2013-2016,
+ Juliusz Chroboczek).
+1894. Add an "8plus24" option to the MGA driver that turns on overlays when
+ in 32bpp mode. Support is there only for the 1064 and SGRAM G100/G200
+ chips so far (#2024, Mark Vojkovich).
+1893. Fix an MGA dashed line bug (#2024, Mark Vojkovich).
+1892. Add an "mga_sdram" option that turns off block mode and disables
+ planemasks (#2024, Mark Vojkovich).
+1891. Add SGRAM and NonTEText optimisations to the MGA driver (#2024,
+ Mark Vojkovich).
+1890. Add XYPixmap support to XAA (#2023, Mark Vojkovich).
+1889. Preliminary support for depth 8 + 24 mode. Depth 8 currently uses
+ 32bpp pixmaps. Support is included for destructive and non-destructive
+ overlays and driver-chosen transparency key (#2022, Mark Vojkovich).
+1888. Update imake for cpp changes with egcs-1.1 and gcc-2.8.1 (#2017,
+ David Wragg).
+1887. Fix XvQueryAdaptors() when more than one adaptor is present, and
+ export xf86XVScreenInit() to drivers (#2018, Michael Schimek).
+1886. Updates/improvements to the I2C module (#2008, 2018, Michael Schimek).
+1885. Don't include standard system headers when building XIE as a module.
+1884. Cleanup Xlibint.h, which significantly reduces the level of compiler
+ warnings, and also cleanup XIE's error.h (#2007, Thomas Dickey).
+1883. Add support for built-in driver modes (#2006, Egbert Eich).
+1882. Ansify and remove gcc warnings for imake, makedepend, lndir, makestrs,
+ makekeys and mkg3states) (#2005, Matthieu Herrb).
+1881. Introduce a "generic" PCI device (pseudo vendor/devids) for use with
+ the generic vga driver (#1994, Egbert Eich).
+1880. Fix some bugs in the C&T driver (#1994, Egbert Eich).
+1879. Fix an XAA bug with CPU_TRANSFER_PAD_QWORD handling (#1994, Egbert Eich).
+1878. Sanity fix: if all devices of a screen are of type none assume
+ resource type NONE in xf86AddControlledResource() even if specified
+ otherwise (#1994, Egbert Eich).
+1877. Added more support to the resource code for mono devices (for
+ consistency) (#1994, Egbert Eich).
+1876. Add RAC wrappers to the sprite functions (#1994, Egbert Eich).
+1875. Reset xf86Resetting in xf86Init.c (#1994, Egbert Eich).
+
+XFree86 3.9Nh (5 October 1998)
+1874. Temporary workaround to avoid static server build problem introduced
+ in 3.9Ng.
+1873. Import and merge in X11R6.4 and its first three public patches.
+
+XFree86 3.9Ng (27 September 1998)
+1872. Rewrite the XAA NonTE text code, fixing the handling of overlapping
+ characters (#2002, Mark Vojkovich).
+1871. Fix an typo causing a CapNotLast line bug in XAA (#2002, Mark Vojkovich).
+1870. Some updates to the FreeBSD/ELF support, including auto-detection
+ of the binary format.
+1869. Update the Type1 and Speedo fonts.scale files to take advantage
+ of the recent ISO 8859-2 encoding updates (#1995, Juliusz Chroboczek).
+1868. Update drivers to use miCreateDefColormap instead of calling
+ the ones in the fb-specific code, update mfbCreateDefColormap
+ to call the mi version, and remove the xf4bpp version.
+1867. ANSI-related cleanups for the C&T driver, and make use of the
+ LoaderRefSymobols() code to eliminate loader warnings (#1993,
+ David Bateman).
+1866. Fix pixmap cache sizing for C&T DSTN systems (#1993, David Bateman).
+1865. Fix a typo that affected the memory probing for C&T 65550 sysems
+ with 2MB of memory (#1993, David Bateman).
+1864. Let the C&T driver accept '-depth 15' (#1993, David Bateman).
+1863. Reintroduce DirectColor visual support for depth >8 for the
+ Millennium I (#1992, Andrew Aitchison).
+1862. Fixes and cleanups for Linux/Alpha build problems (#1989, 2000,
+ Andrew P. Lentvorski).
+1861. Make some changes to the vgahw MMIO handling for Alpha platforms.
+1860. Cleanup and simply some of the mga driver/dac/clock code (#1991,
+ Radislaw Kapitan).
+1859. Enable mga TVP3026 interlaced cursor (#1991, Radislaw Kapitan).
+1858. Enable the Pseudo-DMA window for the G100 in the mga driver (#1991,
+ Radislaw Kapitan).
+1857. Change some tables in the mga driver to 'const' to help make sure
+ that they are not abused, and fix the code that was abusing them
+ (#1991, Radislaw Kapitan).
+1856. Fix some G200 problems introduced in 3.9Nf (#1988, 1991, Mark Vojkovich,
+ Radislaw Kapitan).
+1855. Fix static server problems caused by item 1851 (based on #1984, 1985,
+ Takaaki Nomura).
+1854. xman improvements for NetBSD/OpenBSD (#1983, Matthieu Herrb,
+ Ross Harvey).
+1853. C&T update for SuperProbe (#1981, Taketoshi Sano).
+
+XFree86 3.9Nf (20 September 1998)
+1852. Update the sample config file to be consistent with the updated format.
+1851. Add a mechanism to allow modules to tell the loader which symbols from
+ from other modules it references, and which of those are essential.
+ This makes it possible to eliminate unnecessary warnings about
+ unresolved symbols, and to trigger a fatal error where appropriate.
+1850. More attempts towards a working G100 server (#1982, Dirk Hohndel).
+1849. Update the mga driver for use with the resource management code.
+1848. Fix some bugs and typos in the resource management code.
+1847. Rework the vgahw module, abstracting the register accesses and split up
+ the save/restore parts.
+1846. Add '\n' to some of the messages in PEXExtensionInit().
+1845. Fix the mga driver's handling of the option register in mga_dac3026.c.
+1844. Trap reentrancy to the FatalError() function and call abort() when
+ this happens.
+1843. Avoid a bug in SunPro C 4.2 (ix86) that shows up when building libPEX5
+ (#1980, David Holland).
+1842. Fix a typo in Xserver/Imakefile (#1979, David Holland).
+1841. Have the Xv DIX layer trap zero size src and/or dest, returning
+ BadValue (#1978, Mark Vojkovich).
+1840. Parially accelerated lines for the Permedia 2 (#1977, Mark Vojkovich).
+1839. Some formatting, bug fix updates to the C&T driver, and reintroduce
+ the screen blanking during initialisation for the C&T drivers
+ (#1976, David Bateman).
+1838. Update the C&T driver to use the RAC wrapper (#1976, Egbert Eich).
+1837. Add a Resource Access Control (RAC) wrapper module which allows
+ colourmap, cursor and fb access to be wrapped when necessary in
+ cases where memory and/or I/O resources are being shared (#1976,
+ Egbert Eich).
+1836. Back out item 1823 (mi bank enable) (#1976, Ebgert Eich).
+
+XFree86 3.9Ne (13 September 1998)
+1835. Remove the OS dependence in the formatting of docs in xfree86/doc/sgml
+ (which removes the need for the BuildAllDocs setting).
+1834. Update mi and dix cursor handling to avoid displaying empty cursors
+ (#1972, Mark Vojkovich).
+1833. Update Xv docs (#1971, Mark Vojkovich).
+1832. Add return values to the Get/Put driver functions in the Xv DDX
+ (#1970, Mark Vojkovich).
+1831. Some preliminary reorganisation of the MGA driver (#1969,
+ Mark Vojkovich).
+1830. Update CURSOR.NOTES (#1968, Mark Vojkovich).
+1829. MGA driver should recognise 15 as a valid depth (#1967,
+ Andrew Aitchison).
+1828. Experimental G100 support for the MGA driver, and fix clock PLL
+ programming (#1966, Radislaw Kapitan).
+1827. Add support for the 9660, 9680 and 9682 chips to the new trident driver,
+ and add some initial acceleration (#1963, Alan Hourihane).
+1826. Fix some planemask test problems at 16bpp with the C&T driver (#1962,
+ Taketoshi Sano).
+1825. Fix a problem with QWORD_PAD in XAA (#1961, David Bateman).
+1824. Fix SuperProbe's detection of some C&T HiQV chipsets (#1960,
+ Taketoshi Sano).
+1823. Update the mi banking code to enable resources as required (#1959,
+ Egbert Eich).
+1822. Update the generic VGA driver to use the new resource control code
+ (#1959, Egbert Eich).
+1821. Restructure the C&T driver, and fix the following:
+ - CRT half-screen blanking
+ - 1bpp mode
+ - several SEGV problems
+ - the long standing LCD blank problem
+ (#1959, Egbert Eich).
+1820. Allow a Device section without a BusID be acceptable for the primary
+ vga device when multiple heads are detected (#1959, Egbert Eich).
+1819. New resource management code, which should provide an improved
+ infrastructure for handling multi-head configuration, particularly
+ where resource sharing is required (#1959, Egbert Eich).
+1818. Fix problems with NonTE ImageText in XAA (#1958, Mark Vojkovich).
+1817. Fix the tseng driver's handling of cases when there is insufficient
+ free memory for acceleration to be used (#1957, Koen Gadeyne).
+1816. Change the RELATIVE_CHECK() macro in xf86Xinput.c to fix a multi-head
+ cursor problem (Chris Bare).
+1815. Update xf86ReadPciBIOS to set the decode enable bit while reading,
+ and update the mga driver to use xf86ReadPciBIOS when appropriate.
+1814. Use mmap for reading the BIOS on more platforms because the
+ lseek/read method doesn't work in many cases when the offset is
+ greater than 2G.
+
+XFree86 3.9Nd (6 September 1998)
+1813. Preliminary port of the trident driver for the ND (the old version
+ has been moved to the olddrivers directory (#1956, Alan Hourihane).
+1812. Document the offscreen memory managers new ResizeArea function
+ (#1955, Mark Vojkovich).
+1810. Allow the FreeType code to be build as an X server font module.
+1809. Add Latin2 support to the Speedo and Type1 font code (#1792,
+ Robert Wilhelm).
+1808. Updates to XFree86 specific parts of FreeType (#1792, 1933,
+ Robert Wilhelm, Juliusz Chroboczek).
+1807. Add the base FreeType 1.1 distribution to /xc/extras/FreeType, and
+ update the build procedure to get the source from there.
+1806. Map the pseudo-DMA transfer window used on newer MGA chips, and use
+ it for solid rects and spans (#1953, Mark Vojkovich).
+1805. Fix C&T HiQV detection (#1952, Taketoshi Sano).
+1804. Add dashed line support to XAA, and update the mga driver to use it
+ (#1951, 1953, 1954, Mark Vojkovich).
+1803. Lots of glint driver updates, including a memclock option to set the
+ mclk, and some more XAA functions for the older Permedia chip (#1950,
+ Alan Hourihane).
+1802. Use POSIX macro S_IS* instead of (((m)&S_IFMT)==S_IF*) and replace
+ "u_long" with "unsigned long" (#1949, UCHIYAMA Yasushi).
+1801. Fix IBM hw cursor pixel ordering (#1948, Alan Hourihane).
+1800. Remove accel/tga and accel/glint directories that are no longer needed
+ (#1947, Alan Hourihane).
+1799. Build support for FreeBSD/ELF (#1946, Doug Rabson, Joachim Kuebart,
+ Ollivier Robert).
+1798. Xaw and Xmu fixes (#1945, Paulo Cesar Pereira de Andrade).
+1797. HW Bresenham line drawing support for Tseng W32p and ET6000
+ (#1944, Koen Gadeyne).
+1796. Fix depth/bpp issues at depth 16 and depth 15 with the IBM support
+ in the ramdac module (#1943, Alan Hourihane).
+1795. Change messages in xf86PruneMonitorModes() so that they appear at the
+ default verbosity level (#1942, Egbert Eich).
+1794. Print out clock ranges or fixed clocks scaled by the mul/div factors
+ (#1942, Egbert Eich).
+1793. MGA G200 support (#1941, Radislaw Kapitan).
+1792. Preliminary I2C module (#1940, Itai Nahshon).
+1791. Add config support for building XFree86 on Linux with DECnet transport
+ (#1939, Eduardo Serrat).
+
+XFree86 3.9Nc (29 August 1998)
+1790. 24bpp (high res display problems) and 32bpp (horizontal stripe) fixes
+ for the mga driver (#1715, 1716, Doug Merritt).
+1789. Take the mga driver's YDstOrg parameter into account when it passed the
+ framebuffer start address to the cfbInitScreen functions. This fixes
+ problems that can show up when using more than 4MB.
+1788. Fix an extraneous pixel drawn for some H/V two point lines with
+ a Millennium I (Mark Vojkovich).
+1787. Make the BuildLinuxDoc* symbols default to YES when HasSgmlFmt is YES
+ (Marc La France).
+1786. Add a resize function to the offscreen memory manager (#1937,
+ Mark Vojkovich).
+1785. Fix C&T 69000 horizontal CRT overflow register settings (#1936,
+ David Bateman).
+1784. Add some missing UnlockDisplay calls to lib/Xv/Xv.c (#1935,
+ Thomas Mueller).
+1783. Fix colourmap save problem (#1935, Thomas Mueller).
+1782. Support for LynxOS 3.0.0 and LynxOS PowerPC fixes (#1935,
+ Thomas Mueller).
+1781. An ND version of the Cirrus driver, currently for 5480 and 5446 chips
+ only. The old driver has been moved to xfree86/olddrivers/cirrus
+ for reference (#1932, 1938, Itai Nahshon).
+1780. Xterm updates:
+ - add configure test to infer if xterm should be installed setuid
+ based on previously installed xterm (reported by Stephen Marley).
+ - integrate/extend patch by Jason Bacon to implement quasi-continuous
+ mouse reporting.
+ - correct control sequences transmitted by function keys F1 to F4
+ when sunFunctionKeys resource is true (it was still using the
+ VT100 control sequences).
+ - modify handling of backarrow key so that the control modifier
+ toggles the backspace/delete interpretation set by the
+ backarrowKey resource.
+ - limit the row and column values used to report mouse position.
+ (#1931, Thomas Dickey).
+1779. Fix clockRanges alloction problem in the tseng driver (#1927,
+ Koen Gadeyne).
+1778. Fix tseng banked accelerated mode, and disable ImageWrite in banked
+ mode if it requires more than 8k (#1927, Koen Gadeyne).
+1777. Some initial ET4000W32p acceleration (#1927, Koen Gadeyne).
+1776. Fix 24 and 32bpp tseng modes for cards with programmable clocks
+ (#1930, Koen Gadeyne).
+1775. Implement the pci_retry and Memclk options for the MGA driver (#1927,
+ Mark Vojkovich).
+1774. Update the mga driver to use MMIO for everything (making use of the
+ MMIO support in the vgahw module), and do its own colourmap handling
+ (#1927, Mark Vojkovich).
+1773. Add a MMIO version of the vgahw code to the vgahw module (#1926, 1928,
+ Mark Vojkovich).
+1772. Small Xv DDX udpate (#1925, Mark Vojkovich).
+1771. Update the C&T driver to use the new ClockMulFactor code (#1924, 1936,
+ David Bateman).
+1770. Add a ROP_NEEDS_SOURCE option to XAA, as needed by the C&T driver
+ (#1924, David Bateman).
+1769. Add support to the tga driver for 24 plane cards (#1923, Tim Rowley).
+1768. Resync the scale[] find_scale[] arrays in the bitmap font code, which
+ got out of sync when gzipped font support was added (#1921 Doug Ridgway).
+1767. Fix incorrect #ifdef in sunKeyMap.c for Danish Type 5 Sun keyboards
+ (#1919, Erik Bertelsen).
+1766. Move HW cursor support from the XAA module to the ramdac module,
+ update drivers for this change, move IBM cursor code from the glint
+ driver to the ramdac module, and intergrate the HW cursor code fir
+ the IBM ramdacs using a new helper function in the ramdac module.
+ (#1918, Alan Hourihane).
+1765. Fix some more compiler.h problems for AXP platforms (#1918,
+ Alan Hourihane).
+
+XFree86 3.9Nb (20 August 1998)
+1764. Fix some memory leaks in Xlib that happen on realloc failures
+ (#1914, ??)
+1763. Optimise the way C&T acceleration is handled by reorganising
+ some of the graphics primitives, including caching foreground and
+ background colours, and moving some operations from the Subsequent
+ primitives to the Setup primitives (#1915, David Bateman).
+1762. Introduce HW cursor for the Permedia2 (but p2 and p2v dont' work
+ yet), fixup pm2v_dac and pm2_dac register naming, and add reset
+ logic to reset the accelerator (but not used yet) (#1912,
+ Alan Hourihane).
+1761. Fix building in xfree86/common when XINPUT is not defined (Egbert Eich).
+1760. Fix problem compiling xf86_IlHack.c on Alpha platforms.
+1759. Add an option "ShowOverscan" to the vgahw module which makes the
+ unblanked area of overscan clearly visible.
+1758. Adjust the builtin mode for the 8bpp generic vga driver to blank as
+ much of the overscan area as possible.
+1757. Adjust the horizontal blank end value in the vgahw module to avoid
+ excessive blanking for most chipsets when running in generic vga mode.
+1756. Tseng driver updates, including:
+ - Add support for chips with a set of discrete clocks instead of a
+ programmable clock.
+ - use the new ClockRanges code to auutomatically select between pixmux
+ and normal modes, and for 24bpp clock scaling.
+ - add a replacement for vgaHWBlankScreen() that doesn't do a
+ sequencer reset.
+ - remove some old, unused code.
+ (#1910, Koen Gadeyne).
+1755. Loader updates required for the updated gdb (#1908, Paul Flinders).
+1754. Add VSTATUS control char support to xterm (#1907, Robert Earl).
+1753. Update the register probing of the chipset for the C&T HiQV chips
+ in SuperProbe and the C&T driver (#1904, David Bateman).
+1752. Add cached screen to screen colour expansion to the C&T driver
+ (1904, David Bateman).
+1751. Add options to XAA to allow acceleration primitives to be disabled
+ individually (#1903, David Bateman).
+1750. Add preliminary solid Bresenham and two point line support for XAA,
+ and code to make use of it for the mga driver (#1900-1902,
+ Mark Vojkovich).
+1749. Introduce Helper functions for ramdac module, Save/Restore/SetBpp,
+ and update the glint and tga drivers to use them (#1899, 1913,
+ Alan Hourihane).
+1748. Move IBM640 code from the glint driver intot he generic ramdac module
+ (#1899, Alan Hourihane).
+1747. Add ClockMulFactor and ClockDivFactor fields to clockRanges to allow
+ for scaling of clocks when doing mode validation (#1898, 1905,
+ Koen Gadeyne, 1906, Itai Nahshon).
+1746. Add recognition of the Voodoo 2 to the PCI list (#1897, Koen Gadeyne).
+1745. Some editres, xedit and xgc updates (#1788, 1842,
+ Paulo Cesar Pereira de Andrade).
+1744. Lots of Xaw/Xmu updates (including ansification of Xaw and Xmu) --
+ see the Changelog in xc/lib/Xaw for further details (#1776, 1788, 1842,
+ Paulo Cesar Pereira de Andrade).
+1743. Support for GNU/Hurd (#1895, UCHIYAMA Yasushi).
+1742. Remove the implicit assumption in some areas that O_RDONLY is 0
+ (#1894, UCHIYAMA Yasushi).
+1741. Merge in Metro Link's version of the 64 bit select fixes for the
+ X server and lbxproxy (#1893, Stuart Anderson).
+1740. Set DlLibrary to be empty for OpenBSD, and remove formatted man pages
+ on 'make clean' for OpenBSD and NetBSD (#1892, Matthieu Herrb).
+
+XFree86 3.9Na (14 August 1998)
+1739. Rework the way the maximum number of server client connections
+ is determined, and experimentally increase MAXCLIENTS to 256.
+1738. Enable mmap support in Xvfb for Linux (#1889, Douglas Ridgway).
+1737. Xv DDX layer for XFree86, and add documentation for it to the DESIGN
+ doc (#1883, 1884, Mark Vojkovich).
+1736. Modify AddScreen() and AllocateScreenPrivateIndex() to initialise new
+ screen devPrivates to zero.
+1735. Ansify the Xv server dix code (#1881, Mark Vojkovich).
+1734. XAA doc update (#1880, Mark Vojkovich).
+1733. Cache the fg, bg and planemask values in the MGA driver and only
+ change them when needed (#1878, Mark Vojkovich).
+1732. Preliminary ImageRead support for the MGA driver (disabled) (#1879,
+ Mark Vojkovich).
+1731. Preliminary ImageRead support (#1878, Mark Vojkovich).
+1730. Use accelerated ImageWrites for PutImage and BackingStore and SaveUnder
+ pixmap restores (#1878, Mark Vojkovich).
+1729. Fix an XAA text rendering bug for rotated text (#1878, Mark Vojkovich).
+1728. Tseng driver updates:
+ - Add DPMS support
+ - Replace some Boolean options with Tristate options
+ - Add ET4000W32p support and the ICS5341 16-bit ramdac support
+ - 1bpp and 4bpp support added (1bpp doesn't work yet)
+ - cleanup mode validation code
+ (#1877, Koen Gadeyne).
+1727. Fix problems using ffs() in the X server on 64bit platforms
+ (specifically Linux/Alpha) (#1876, Raphael Finkel).
+1726. Fix for palette problems with the BT ramdac support in the ramdac
+ module (#1873, Alan Hourihane).
+1725. Export the symbols __remq and __remqu from the loader for Alpha
+ platforms (#1872, Alan Hourihane).
+1724. Fix a 24/32bpp problem with the IBM code in the ramdac module
+ (#1871, Alan Hourihane).
+1723. Change the way the depth/bpp/fbbpp values are selected form the
+ command line and config file to prevent inconsistently mixing values
+ from the two sources (#1868, Alan Hourihane).
+1722. Fix some XAA hw cursor problems:
+ - Apply the HARDWARE_CURSOR_INVERT_MASK flag only after applying
+ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK
+ - Fix the 1-bit interleaving code
+ (#1867, Koen Gadeyne).
+1721. Remove all the (currently unused) colour expansion code from
+ the old branch that replaced some XAA functions. This should no
+ longer be necessary (#1866, Koen Gadeyne).
+1720. Add XAA hw cursor support for the ET6000 (#1866, Koen Gadeyne).
+1719. Fix some problems that showed up with the glint driver when
+ using a P2 and TX500 card together (#1861, Dirk Hohndel).
+1718. Have the glint driver remove all but one mode since the chipset
+ doesn't support panning (#1859, 1870, Alan Hourihane).
+1717. Update the loader to correctly identify dll ELF modules (#1858,
+ Itai Nahshon).
+1716. Fix an infinite loop in the xf86Config code that can happen with a
+ config file error (#1858, Itai Nahshon).
+1715. Resync the TGA driver with changes elsewhere (#1856, 1874,
+ Alan Hourihane).
+1714. Glint driver updates, including:
+ - HW cursor for IBM 526 and 640 ramdacs
+ - Depth 30 support for the IBM 640
+ - GLINT MX (ELSA Gloria XL) support
+ - More acceleration for the TX/MX chipsets
+ - Fixes for Alpha platforms
+ - Major acceleration updates for Permedia, Permedia2, 500TX and MX chips
+ - Permedia 2v cleanups
+ (#1855, 1857, 1860, 1863, 1864, 1865, 1890, Alan Hourihane).
+1713. Add support for depth 30 to xf86SetWeight() (#1854, Alan Hourihane).
+1712. Reinstate the ONLY_LEFT_TO_RIGHT_BITBLT and ONLY_TWO_BITBLT_DIRECTIONS
+ XAA options (#1853, Alan Hourihane).
+1711. Add support for the IBM 640 ramdac to the ramdac module (#1852,
+ Alan Hourihane).
+1710. Add finer grained offscreen memory management for the accelerator
+ to the Tseng driver to allow as many acceleration features to be
+ enabled as can be supported by the available offscreen memory
+ (#1851, Koen Gadeyne).
+1709. Add XAA scanline colour expansion, screen-to-screen colour expansion,
+ 8x8 colour pattern fills, ImageWrite to the Tseng driver (#1851,
+ Koen Gadeyne).
+
+XFree86 3.9N (2 August 1998)
+1708. Fix some XAA problems (#1850, Mark Vojkovich and Koen Gadeyne).
+1707. Rename some of the XAA colour expansion stuff, and update the XAA docs
+ (#1848, 1849, Mark Vojkovich).
+1706. Tseng driver updates (#1847, Koen Gadeyne):
+ Add Mclk support, replace globals in tseng_bank.c with entries
+ in the TsengRec, remove redundant parameter passing, fix a potential
+ bug in the ET6000 memory detection code, implement memory limit
+ checking, fix a bug in the 555/565 handling, cleanup locking/unlocking
+ code.
+1705. Some fine tuning of the way the extension modules are build.
+1704. Merge in the new design branch. A full changelog for the new design
+ branch can be found in the CHANGELOG.ND file.
+1703. Font-related X server buffer overflow fixes (Robin Cutshaw).
+
+XFree86 3.9Ak (11 July 1998)
+1702. xterm patches 81 and 82. Fix Linux/Alpha build problems,
+ utmp handling on Solaris, some terminfo nits, and improve
+ cursor colour (#1794, 1797, Thomas Dickey).
+1701. Fix CloseScreen() related problems (#1793, Marc La France).
+1700. Close some sockets that xdm was leaving open when running new
+ sessions (#1704, Matthieu Herrb).
+1699. Fix usleep problems with static servers on SVR4.
+1698. Fix a problem parsing "ModeLine" entries (#1779, Keldon Jones).
+
+XFree86 3.9Aj (04 July 1998)
+1697. PC98 fix for VT switching, VideoBoard98 update (#1766, Takaaki Nomura).
+1696. xterm patches 79 and 80. Fix for F1-F4 key handling, fg/bg pixel
+ value with -flipPixels, scrollbar color, keypad handling, and
+ various terminfo enhancements (#1758,1762 Thomas Dickey).
+1695. Lots of Xaw work. See xc/lib/Xaw/Changelog for details
+ (#1660, 1673, 1678, 1686, 1701, 1738, 1752, 1755, 1765
+ Paulo Cesar Pereira de Andrade).
+1694. Add the library security fixes (#1722).
+1693. Fix rendering errors in the generic bit expansion code (#1746,
+ Jens Owen).
+1692. Fix problem in Oak clock setting routines (#1744, Kevin Buhr).
+1691. Clean up vga16 (remove unused code, remove vga16's mfb (vga2 is used
+ instead), clean up vga16's external name space). Minor fix to ATI
+ driver. (#1742, Marc LaFrance).
+1690. Fix macro expansion in xf86Config.c (#1730, Jens Maurer).
+1689. On Linux, default the use of special or internal malloc's to NO
+ (instead of forcing it to NO). Allow CloseScreen to free wrapper
+ private storage in most servers. Push out backing store initialisation
+ to the callers of the various <framebuffer>ScreenInit()'s. Change
+ m68k's XF68_FBDev to use backing store low-level functions to
+ save/restore the screen during VT switches. Minor fixup to loader
+ message. (#1719, Marc La France).
+1688. Fixes for 24bpp and 32bpp on Matrox Millenium II. This fixes the
+ horizontal stripe for modes using > 4MB (#1715,1716, Doug Merritt).
+1687. Fix build problems on LynxOS and enable keyboard LEDs on LynxOS 2.5.1
+ (1712, Thomas Mueller).
+
+XFree86 3.9Ai (05 June 1998)
+1686. Add rendition directory. This is not included in the build process, yet
+ (#1707, Marc Langenbach).
+1685. Make glint compile on Alpha. Some xtest fixes for Alpha (#1705,
+ Christian Worley).
+1684. xterm patch 77,78, convert to ANSI C (#1702,1706 Thomas Dickey).
+1683. Fix compile problems under OS/2 (#1693, Holger Veit).
+1682. Fix xmag segfault (#1675, Andy Sloane).
+1681. Fix build problem of the static servers on FreeBSD. Fix build problem
+ on SVR4(incomplete). Update PC98 Card Database(#1691, Isao Ohishi,
+ Takaaki Nomura).
+1680. Minor fix to ATI driver clock code. Fix vga16 for xtest-detected
+ problems. Fix up vga16's pixmap printing when enabled by DEBUG. There's
+ no need for XFree86LOADER specifics in mibitblt.c(#1690, Marc La France).
+1679. Fix hw cursor on CT65555 and fix loader problem (#1688,1689 Nozomi Ytow).
+1678. Fix freeing of names when removing modes (#1685, Matthieu Herrb).
+1677. Enable ImageWrite in 24 bpp for C&T HiQV (#1684,1687 Nozomi Ytow).
+1676. Fix unknown symbol type 1e message in a.out loader (#1683,
+ Matthieu Herrb).
+1675. xterm patches 75 and 76. Fix for print-window function, minor cleanups,
+ lots of fixes from other people (see xterm.log.html) (#1681,1682,
+ Thomas Dickey).
+1674. Make vga16 use backing store functions to save/restore the screen on VT
+ switches. Don't call xf86InvalidatePixmapCache when bpp is 1 or 4
+ (#1680, Marc La France).
+1673. Change PIC code to print names of ALL devices capable of displaying
+ video. Return pointer to the last card instead of the first (#1662,
+ Dejan Ilic).
+1672. Add skeleton driver for Tritech Pyramid 3D (#1661, Dejan Ilic,
+ Mark Vojkovich).
+1671. Check additional pci bus in scanpci (Robin Cutshaw).
+
+XFree86 3.9Ah (28 April 1998)
+1670. Xterm patch 74 fix define conflicts and update print support (#1674,
+ T.E.Dickey).
+1669. Xterm patch 73 added print window facility, terminfo updates,
+ conditional include cleanup, debugging trace enhancements, and
+ HP-UX configure updates (#1672 T.E.Dickey).
+1668. Framebuffer fixes leaving valid GC on exit, fix for opaque types
+ (#1669 Marc Aurele La France).
+1667. Add ELF support for AXP platform (#1666 Stuart Anderson).
+1666. PCI function fixes for AXP platform (#1665 Alan Hourihane).
+1665. SiS updates (#1664 Mike Chapman, Mitani Hiroshi).
+1664. Fix CompressAllFonts define use in X11.tmpl (#1663 Matthieu Herrb).
+1663. Xaw updates including more functions for diaplayLists, fixes
+ for simpleMenuWidget, boxWidget, and panedWidget (#1660 Paulo Cesar
+ Pereira de Andrade).
+1662. Xdm seg fault fix (#1658 Matthieu Herrb).
+1661. Tseng PIXMUX updates (#1656 Krajcsovits Gyorgy).
+1660. Mouse driver loop restructuring and additional packet data
+ checks (#1654, Oyvind Aabling).
+1659. PANIX build fix for PC98 platform (#1653, Satoshi Kimura).
+1658. Sync loss on cursor change fix (#1650, Mark Vojkovich).
+1657. Driver line fix, unresolved symbol fix, remove loading of xaavga256
+ at depths greater than 8, glint 24bpp fix (#1645-1649 Alan Hourihane).
+1656. More XF86Setup patches, P9000 symbol fix, PC98 Imakefile sync (#1644
+ Takaaki Nomura).
+1655. Tseng doc, accel sync with 3.3.2, PIXMUX and misc fixes (#1641,1642
+ Koen Gadeyne).
+1654. ISC fix for usleep and glint probe fix for DELTA (#1639,1640 Michael
+ Rohleder).
+1653. Add FreeType code to lib/font/FreeType, but the build-related
+ things haven't been done yet (David Turner, Robert Wilhelm,
+ Werner Lemberg, Mark Leisher, Juliusz Chroboczek).
+1652. Xterm patch 72 activity notification enhancement (#1659, T.E.Dickey).
+1651. Xterm patch 71 buffer overflow fix (#1651, T.E.Dickey).
+1650. Sync I128 server acceleration with 3.3.2 (Robin Cutshaw).
+
+XFree86 3.9Ag (05 April 1998)
+1649. AGX ScrnInfoRec fix, fix compiler warnings for Xprt and loader,
+ fix vgaCloseScreen problem, add new ScreenRec functions to
+ set/get pixmaps and wrapper functions, VC switch to use
+ low-level backing store functions (#1635, Marc Aurele La France).
+1648. xfree98/XF86Setup sync with 3.3.2 (#1632, Takaaki Nomura).
+1647. xfree86/XF86Setup sync with 3.3.2 (#1629,1634 Kazutaka Yokota).
+1646. Back out the following R6.4-related changes:
+ #1169, 1170, 1342 -- version numbering changes,
+ #1167 -- CUP extension,
+ #1225, 1282, 1341 -- EVI extension,
+ #1171-1178, 1198, 1246, 1305 -- Xinerama extension,
+ #1165 -- Xt Resource Configuration Management.
+1645. XAA fixes for xf86bpp (#1633, Alan Hourihane).
+1644. More 3.3.2 syncs, PC98 sync, usleep problem with FreeBSD,
+ SVR4.0 build problem fixes (#1631, Takaaki Nomura).
+1643. Kensinngton Thinking and Expert Mouse fix (#1630, Kazutaka Yokota).
+1642. S3 968 fix (#1628, Kazutaka Yokota).
+1641. Add DoImageWrite for Permedia2 and partial 24bpp acceleration to
+ the glint server (#1627, Alan Hourihane).
+1640. ISC sync with 3.3.2 (#1625,1626, Michael Rohleder).
+1639. Xterm patch 70 including Imakefile fix for logging, "ich"
+ restoration, cursor color fix, "-vb" arg fix, character-set
+ rework, SS2/SS3 control fix, terminfo updates (#1624, T.E.Dickey).
+1638. Add loader symbol for miSetZeroLineBias (#1623, Mark Vojkovich).
+1637. Fix duplicate symbols in s3 server (#1621, Takaaki Nomura).
+1636. glint cleanup for XAA autoload modules (#1620, Alan Hourihane).
+1635. xf86Config fixes for svga and accel servers, extmod load for all
+ depths (#1618,1619, Alan Hourihane).
+
+XFree86 3.9Af (28 March 1998)
+1634. Add 1024x600 to the identified video modes in the chips server
+ (#1617, Nozomi Ytow).
+1633. Resync xfree98 with xfree86 and resync some PC98 files with 3.3.2
+ (#1616, Takaaki Nomura).
+1632. Fix micro typo in chips.sgml (#1615, David Bateman).
+1631. Define defaults for XF86Config file locations. Have make World remove
+ Makefile.bak files. Resync ScrnInfoRec's for the last time (Hope
+ springs eternal). "Externalise" InstalledMaps in all XFree?? servers.
+ Remove reference to DEFAULT_MODULE_PATH in static servers. Deal with
+ some of the warnings produced by gcc by default. Resync ATI driver with
+ the version found in XFree86 3.3.2. Fix loader bug in dealing with XAA.
+ (#1614, Marc La France).
+1630. Don't abort a static server if the Driver statement in the Device
+ section is missing (#1613, Kazutaka Yokota).
+1629. Fix typo in #1606 and improve printing of mouse related messages
+ (#1613, Kazutaka Yokota).
+1628. Build fixes for static S3 and S3V servers (#1613, Kazutaka Yokota).
+1627. Re-add 8x8 trap fill support in XAA (#1612, Mark Vojkovich).
+1626. Add new text replacements to glint server, add packed data modes, tune
+ fifo handling, fix drawing bugs and others (#1609,1611, Mark Vojkovich,
+ Alan Hourihane).
+1625. Add mouse related 3.3.2 changes to XF86Setup (which still doesn't
+ compile) (#1608,1610, Kazutaka Yokota).
+1624. Update xdpyinfo to reflect mouse code changes (#1607, Kazutaka Yokota).
+1623. Merge missing mouse code from 3.3.2 (#1606, Kazutaka Yokota).
+1622. Resync xterm, add missing patches from 3.3.2 (#1605, Thomas Dickey).
+
+XFree86 3.9Ae (22 March 1998)
+1621. Bring over some of the new mouse code from the 3.3.2 tree.
+1620. Link X11 apps against libxpg4 on FreeBSD to get multibyte locale
+ support.
+1619. SVGA/chips. include support for the new 69000 chipset. Fix up the
+ memory probing for the 65554, 65555 and 68554 chips. Add probing for
+ the 64200, 64300 and 69000 chips to SuperProbe. Fix the memory probing
+ for the 65554, etc in SuperProbe. Some docs updates (#1603,1604,
+ David Bateman).
+1618. Fix Mach32 text restoration (#1601, Marc La France).
+1618. Add Rendition V2x00 to vgaPCI.h (#1598, Marc Langenbach).
+1617. xterm patches. improve test for highlightColor so that xterm does not
+ attempt to use that unless it is different from the foreground and
+ background colors. remove ich and ich1 from xterm and xterm-8bit
+ terminfo descriptions. restore 1-pixel overlap of scrollbar border with
+ left edge of window. add a configure option, --enable-logfile-exec.
+ make the ALLOWLOGFILEEXEC code compile & run, if configured. minor
+ documentation nits. correct the problem in xterm with utmp by removing
+ the reset of setuid/setgid before the main event loop (#1525,1571,1599,
+ Thomas Dickey).
+1616. Change s3/svga from using 8x8 pattern fills to 8x8 color expand fills.
+ Add support for S3's type planar 8x8 pattern fills to XAA. Add support
+ for S3's planar 8x8 fills to the XAA stippled trapezoid stuff
+ (#1594,1595,1596,1597, Mark Vojkovich).
+1615. Ensure the correct message for lines at startup (#1591, Alan Hourihane).
+1614. Fix XAA to allow vertical lines using TwoPointLine (#1590,
+ Alan Hourihane).
+1613. Change the xf86orect.c code to always use a hardware filled rect rather
+ than a software one when drawing vertical lines (#1589, Mark Vojkovich).
+1612. Add MICROSOFT_ZERO_LINE_BIAS flag to xaa to indicate that the hardware
+ uses MicroSoft's line bias rules rather than X's. Fix the end point
+ sematics for two point lines. Add TiledFilled Rects via image write.
+ Fix a problem with the CopyArea wrapper syncing when it shouldn't. Fix
+ twopoint line problems with XAA dashed lines. Make sure we alway check
+ for one rect situations when using XAA polygon code (#1575,1576,1577,
+ 1578,1579,1580,1581, Mark Vojkovich).
+1611. Add new MGA acceleration, including image writes and 8x8 pattern trap
+ fills. Go back to two point lines. Add solid filled span replacement.
+ Make PCI retries off for mga by default (need Option "pci_retry" to turn
+ them on). Make hardware cursor work better in doublescan modes. And
+ turn hw cursor on by default (#1582,1583,1592 Mark Vojkovich).
+1610. Removes assumption that we have a Trapezoid function (#1573,
+ Alan Hourihane).
+1609. Fix ImageWrite code at 15bpp by fixing xaa not to rely on xf86bpp, but
+ use the accel structure (#1572, Alan Hourihane).
+1608. Fix problem building resize on BSDI, update manpages, add log
+ xterm.log.html (#1490, Thomas Dickey).
+1607. Small patch to xterm's 8-bit terminal description (#1481, Thomas Dickey).
+1606. Move framebuffer ModuleInit functions to separate C source files.
+ Another fixup to mono's ScrnInfoRec (#1474. Marc La France).
+1605. Loader updates (#1467, Stuart Anderson).
+1604. Ensure window and GC privates are aligned on a sizeof(long) boundary.
+ Minor bug fix to mfb and afb framebuffers. Reinstate building of Xibm
+ server. Move pRotatedPixmap, pCompositeClip, fExpose, freeCompClip from
+ GC privates to the GC structure proper (in preparation for the banking
+ mi wrapper) (#1442,1443,1444,1445,1588 Marc La France).
+1603. xterm fixes for configuration (#1437, Bjorn Helgaas).
+1602. Lots of SVGA/ATI updates. Enforce architectural limits on panning &
+ scrolling. Duplicate recent XF86_Mach64 changes (Bus detection, Chipset
+ detection adjustments, Support for 16MB linear apertures, maxClock
+ settings). First swipe at supporting adapters whose VGA has been
+ disabled. Save and restore more registers on mode
+ entries/switches/exits. Colour map initialization changes to make use
+ of uninitialized entries more obvious. Bug fix to DSP register
+ calculation. Support 15, 16, 24 and 32bpp on integrated controllers.
+ Remove dependence on TimingTab. Include VGA DAC registers in verbose
+ output. Skip sparse I/O probes when PCI configuration space indicates a
+ device has registered a block I/O base. Virtual X rounding adjustments
+ for packed modes. Documentation updates (#1430, Marc La France).
+1601. Clean up ScrnInfo, make vgaCloseScreen call the framebuffer's
+ CloseScreen() function, determine more pricely whether the virtual
+ resolution fits in video memory, minor optimization of cfb's
+ ImageGlyphBlt entry (#1428,1429, Marc La France).
+1600. Fix typo in mga.h (#1418, Tim Rowley).
+1599. Fix some baserom/_baserom confusion (#1407, Gary Barton/Concurrent).
+1598. More fixes from Metro Link and some updates for clients. Remove
+ all but one copy of sdimple.c (#1405,1406, Craig Groeschel).
+1597. Remove unnecessary byte_reversed arrays (#1400, Craig Groeschel).
+1596. Add missing Xarch.h (#1399, Craig Groeschel).
+1595. Add no-listen keyword to xfs (#1397, Topi Miettinen).
+1594. Build fixes for PC98 static build (#1391,1396 Takaaki Nomura).
+1593. Build fixes to loader directory (#1388, Alan Hourihane).
+1592. Some Link Kit fixes (#1384, David Bateman).
+1591. Add zoom initialization and fix blits on T2R (Robin Cutshaw).
+1590. Add support for several new mice, including Kensington ThinkingMouse,
+ ALPS GlidePoint, Genius NetScroll, Genius NetMouse, Genius NetMouse,
+ ASCII MieMouse, Logitech MouseMan+, Logitech FirstMouse+ (#1380,
+ Kazutaka Yokota).
+
+XFree86 3.9Ad (25 January 1998)
+1596. Fix two buffer overflow problems in the X server.
+1595. Fix some libXt VSW5 failures (#1347, 1359-1363, 1365, Kaleb Keithley,
+ Arthur Barstow).
+1594. Change server's default vendor string and release (#1342,
+ Kaleb Keithley).
+1593. Fix problem entering mode_shifted characters with xdm and XKB
+ (#1340, Kaleb Keithley).
+1592. Bump SunOS 4.x libXext rev (#1339, Kaleb Keithley).
+1591. Pick up PCI multimedia/video devices and display devices of all
+ subclasses (not just VGA) in vgaGetPCIInfo().
+1590. Reinstate Xserver/hw/ibm for reference purposes.
+1589. Cirrus and vga256 driver changes to support the PowerPC machines.
+ (1357, Gary Barton/Concurrent).
+1588. Organize xf86_ansic.h/xf86_libc.h/xf86_OSlib.h, and de-mangle xf86*
+ libc calls. Move Probe routine to the beginning of the ScrnInfoRec to
+ match the vgaVideoChipRec. Make the mach32, mach64, mach8, i128, and
+ ibm8514 servers loadable. Use one global byte_reversed array. When
+ SetCursor is called with a null CursorPtr, turn the cursor off. Fix
+ CapNotLast lines and segments in mach64 and xaa. Copy some code from
+ Metro-X 3 to handle panning at 24 bpp on Mach64. Mask the correct
+ number of pitch bits when updating the CRTC_OFF_PITCH register. Use
+ xf86scanpci instead of vgaPCIInfo. Fix tseng driver DPMS bug. Declare
+ and initialize xf86PixmapIndex. (#1356, Craig Groeschel/Metro Link).
+1587. Add xf86Serial functions (#1355, Chris Bare/Metro Link).
+1586. New config file parser, new functions for accessing xf86Info,
+ handle an XQUEUE race condition, make sure XqueQaddr is initialized
+ (1353, Stuart Anderson/Metro Link)
+1585. Build cleanups and fixes to cursor handling for multi screen layout
+ (#1354, Craig Groeschel/Metro Link).
+1584. Add portable and extensible PCI support framework (#1352,
+ Gary Barton/Concurrent).
+1583. Support PowerMAX_OS on Motorola/Concurrent PowerPC machines
+ (#1351, Gary Barton/Concurrent).
+1582. .cf and Imakefile changes to use PpcArchitecture and PpcSvr4Architecture
+ definitions for consistency (#1350, Gary Barton/Concurrent).
+1581. Fix 9397 detection in Trident driver (#1376, Alan Hourihane).
+1580. Add support for the DacSpeed entry to the Mach64 server (#1375,
+ Kevin Martin).
+1579. Fix 16bpp for the Permedia 2 (#1373, Alan Hourihane).
+1578. Fix DPMS for Trident cards (#1372, Alan Hourihane).
+1577. Add Option "no_pci_retry" to option code and the MGA driver (#1370,1371,
+ Mark Vojkovich).
+1576. Add back CyberCont that was removed from Trident driver in 3.9Ac by
+ mistake (#1369, Alan Hourihane).
+1575. Fix ImageWrite code to not read beyond the end of the source in cases
+ of bad alignment (#1368, Mark Vojkovich).
+1574. xterm updates (#1366,1378 Thomas Dickey) including:
+ - change the terminfo entry so that rs1 does a hard reset
+ - modify treatment of hard reset by the xterm program to reset the saved
+ lines
+ - correct hard reset by also resetting user-defined keys.
+ - change the way highlihting is implemented
+1573. Fix PutImage to work with Rops other than GXcopy (#1364, Alan Hourihane).
+1572. Fix clipping in 16bpp on tgui chipsets, fix 32bpp and add transparency
+ (#1345,1346,1349 Alan Hourihane).
+1571. Some updates to stub driver to reflect current layout (#1343,
+ Dejan Ilic).
+1570. Change xdm config to explicitly specify the VT used on OpenBSD (#1337,
+ Matthieu Herrb).
+1569. Build fix for P9x00 driver (#1336,1344 Takaaki Nomura).
+1568. Resync xaa/Imakefile for PC98 (#1335, Takaaki Nomura).
+
+XFree86 3.9Ac (11 January 1998)
+1567. Fix some VSW5 failures in libXt (#1333, Kaleb Keithley).
+1566. xterm updates (#1332, Thomas Dickey) including:
+ - Add xterm support for blinking text. It doesn't actually cause the
+ text to flash, but text with the blink attribute can be displayed in
+ color, using new resources colorBL and colorBLMode.
+ - Corrected a missing save-cursor in the handling of SGR 1048.
+ - Flush the output of the transparent printing after each line.
+ - Correct the modes that are affected by save/restore cursor.
+ - Corrected placement of one of the XSync calls which had the
+ side-effect of writing on the window border when the xterm was
+ resizing from 132 to 80 columns.
+ - Work around an incompatibility of the XKB definition used in xterm
+ versus that symbol from IRIX 6.2's imake definitions (by adjusting
+ the standalone configure script).
+1565. Add detection of Intel TX chips and Pyramid 3D TR25202 to scanpci
+ (#1330, Dejan Ilic).
+1564. Fix xtest related problems on MGA (related to syncing before reading)
+ (#1329, 1334, Mark Vojkovich).
+1563. Possible fix for Millennium II crashing (#1328, Mark Vojkovich).
+1562. Add more careful checking of $HOME/.xsession in the default xdm
+ Xsession script (#1327, Geoff Wing).
+1561. Fix uninitialised variables in decddx (#1326, Kaleb Keithley).
+1560. Fix a typo in the Xlib docs (#1325, Kaleb Keithley).
+1559. Add 8x8 pattern filled 1 rect polygons to XAA. Also included is
+ an 8x8 pattern filled trapezoid function (#1324, 1331, Mark Vojkovich).
+1558. Add more conservative limits for when XAA uses trapezoid fills rather
+ than spans (#1323, Mark Vojkovich).
+1557. Add transparent 8x8 pattern fills to s3/svga (#1322, Mark Vojkovich).
+1556. Xt (VSW5 failures): Xt11/XtCallConverter - Test Purposes 11, 12, 13
+ (#1321, Kaleb Keithley).
+1555. Xt: XtMakeGeometryRequest doesn't emit error if parent != composite
+ (#1320, Kaleb Keithley).
+1554. S3 (svga) ramdac fixes in IBMRGB52x_Init, TI_3020_3025_Init,
+ NORMAL_PreInit, and ATT_409_498_Probe routines, including fixes for
+ the use of the dacSpeeds array (#1319, Craig Groeschel/Metro Link).
+1553. Fixes for Permedia PM2 support to correct 32bpp, and improve things
+ for 16bpp (#1318, Alan Hourihane).
+1552. P9x00 driver (#1317, Joerg Knura).
+1551. Allow xvidtune to be driven by the keyboard (#1315, via Kaleb Keithley).
+1550. Add missing exported symbols to Win32 DLLs (#1314, Kaleb Keithley).
+1549. Detect an extra Trident Cyber chip (#1313, Alan Hourihane).
+1548. Add timeouts to all Tseng "wait for something" functions (#1312,
+ Koen Gadeyne).
+1547. Tseng driver documentation update (#1311, Koen Gadeyne).
+1546. Update xterm man page, configure script and related things (#1310,
+ Thomas Dickey).
+1545. Add a version number to xterm, and make the -version and -help options
+ used before attempting to open the display (#1310, 1316, Thomas Dickey).
+1544. Implement logic to permit xterm to work with proportional fonts.
+ This is done by rendering the characters on a fixed pitch (#1310,
+ Thomas Dickey).
+1543. Fix missing planemask in XAA function (#1309, Mark Vojkovich).
+1542. Fix XAA syncing inconsistencies (#1308, Mark Vojkovich).
+1541. Allow Trident 9397 and later 3D chipsets to work by not using
+ acceleration (#1307, Alan Hourihane).
+1540. Fixes for older Trident Cyber series (#1307, Arthur Tateshi).
+1539. Fix includes for xfwp (#1306, Craig Groeschel/Metro Link).
+1538. Fix for large pixmaps in XINERAMA extension (#1305, Kaleb Keithley).
+1537. Xlib: XGetICValues fails for {preedit,status}Attributes
+ (#1299, Kaleb Keithley).
+1536. Add locale and xkb files for Lithuanian (#1298, Ricardas Cepas).
+1535. Device updates for scanpci (Robin Cutshaw).
+1534. First cut at cleaning up the parallel make dependencies (Robin Cutshaw).
+
+XFree86 3.9Ab (29 December 1997)
+1533. Reorganize the acceleration code in the tseng driver. Fix tseng XAA init
+ problem (#1303, Koen Gadeyne).
+1532. Add support for changing the MClk from the XF86Config file for
+ W32p cards with ICS5341 RAMDAC and for the ET6000 family (#1302,
+ Koen Gadeyne).
+1531. Add option to build xterm without tek4014 emulation. Add option to
+ build xterm with default TERM value other than "xterm". Apply some
+ minor bugfixes to OS/2 version. Fix configure help message and missing
+ quotes in memmove/bcopy configure test (#1297, Thomas Dickey, Darren
+ Heibert).
+1530. Add support for clock setting of the new trident chips (#1294,
+ Alan Hourihane).
+1529. XAA vertical line speedup (#1293, Alan Hourihane).
+1528. Add panning for Permedia and Permedia 2 (#1292, Alan Hourihane).
+1527. Add a few more messages to tseng driver and clean up the use of
+ the different bytes-per-pixel variables. Add "showcache" option
+ (#1300,1301, Koen Gadeyne).
+1526. Fix XAA pixmap cache bug with 16bpp and RGB=555 or 32bpp (#1295,
+ Walter Gadeyne).
+1525. Fix ImageWrite for Tseng (and re-enable it) (#1296, Koen Gadeyne).
+1524. Fix horizontal lines in Tseng driver (#1291, George Krajcsovits).
+1523. Support MUSIC MU9C4910 RAMDAC in Tseng driver (#1290, Koen Gadeyne).
+1522. Fix bad color in hardware linedraw for Tseng (#1290, Koen Gadeyne).
+
+XFree86 3.9Aa (20 December 1997)
+1521. Fix border colours for Trident server (#1289, Alan Hourihane).
+1520. Major update to Mach64 server. Proper identification of the different
+ chips. Support for 16MB boards. Increased max DAC speed settings for
+ newer chips. Support for AGP RagePro cards. Block write mode for
+ RagePro chips. 1600x1200 mode support for VT and newer chips. Use the
+ auxilliary register aperture on chips that support it. Use 16MB memory
+ aperture on PCI Mach64s with integrated controllers.
+ (#1288, Kevin Martin).
+1519. New code for the glint server. Preliminary support for the Permedia 2
+ hardware cursor. Preliminary support for panning the display with
+ multiple modelines for Permedia/Permedia 2. Fix ELSA Permedia 2 boards.
+ Cleanup of glint_init.c. Fix DGA when using software cursor. Addition
+ of code to not save VGA state if the VGA core is disabled.
+ (#1285,1286,1287, Alan Hourihane).
+1518. Fix the "invalid depth" problem with packed 24 (#1284, Andrew Aitchison).
+1517. Fixes to finish keyboard layout (Johan Myreen).
+
+XFree86 3.9z (14 December 1997)
+1516. Fix loss of sync while panning problem and attempt to fix the occasional
+ crashes of the Millennium II by restricting the MGACountRam function
+ to test the first 8MB, only (#1280, Mark Vojkovich).
+1515. Fix XF86Setup to create a (symbolic) link of /usr/X11R6/bin/X when it
+ doesn't exist (#1279, Matthieu Herrb).
+1514. Fix solid trap/rect fill bugain the mga server for the Millennium II
+ that was hurting performance severely (#1277, Mark Vojkovich).
+1513. Reenable BitBlt accelerations for Millennium II (#1271, Mark Montague).
+1512. Fix mmap memory leak in IGS driver. ARM32/NetBSD specific fix for
+ xf86MapInfoMap (#1265, Katrina Maffey).
+1511. Resync change 1474 for PC98 and fix a reference to usleep on SVR4
+ (#1264, Takaaki Nomura).
+1510. Add BLK opaque color expansion for 2164 and change the mga code to use
+ a lookup table for XFree->mga rop conversions (#1261, Mark Vojkovich).
+1509. Fix XAA hardware cursor support for BT485 ramdacs
+ in the S3/SVGA server (#1260, Mark Vojkovich).
+1508. Fix VT switching hang in FreeBSD (#1259, Joerg Wunsch).
+1507. Enable MMIO / linear FB on Cirrus 7548. Experimental patch for screen
+ expansion (640x480 on 800x600 LCD) which doesn't seem to work, yet
+ (#1258, Achim Oppelt).
+1506. Fix gc validation (#1257,1262 Mark Vojkovich).
+1505. Fix SIGSEGV in xf86setup (Dirk Hohndel).
+1504. Extend XF86Setup to allow selecting the modes and the default color
+ depth (Dirk Hohndel).
+1503. Fix build problem on Solaris 2.6/x86 with gcc 2.7.2.3.
+1502. Fix Solaris 2.x + gcc build problem in xfwp (#1272, Takaaki Nomura).
+1501. Xkb{Get,Set}PerClientControls missing from XKBlib.h (#1283,
+ Kaleb Keithley).
+1500. BSD 4.4 sockets not handled correctly in xfwp/transport.c (#1276, 1281,
+ Kaleb Keithley).
+1499. Local connection doesn't work for lbxproxy on AIX (#1275,
+ Arthur Barstow).
+1498. Get fcntl flags in Xtrans before setting them (#1268, Kaleb Keithley).
+1497. Fix 'Xnest -query' on IBM (#1263, Kaleb Keithley).
+1496. Fix X server core dump after disconnecting from a font server
+ (#1256, Arthur Barstow).
+1495. Xserver:Security Policy parsing code returns bogus value on suceess
+ (#1254, M.S. Ramesh).
+1494. Install app-defaults in /var (#1253, Kaleb Keithley).
+1493. Some xfwp fixes (#1252, Arthur Barstow).
+1492. Fix some Win32 problems (#1251, 1255, Kaleb Keithley).
+1491. DPMS was missing from pandix main.c (#1246, Kaleb Keithley).
+1490. Solaris 2.x LOCALCONN updates (#1269 Kaleb Keithley).
+1489. DPMS updates (#1229, Kaleb Keithley).
+1488. KeyPress event doesn't use XKB state when GrabsUseXKBStateMask is set
+ (#1227, Kaleb Keithley).
+1487. Add EVI (Extended Visual Information) server extension (#1225, 1282,
+ Kaleb Keithley).
+1486. Fix some Xmb man pages and specs docs (#1220, 1270, Kaleb Keithley).
+1485. Plugin fixes (#1219, 1221, 1224, 1226, 1247, 1273, Kaleb Keithley).
+
+XFree86 3.9y (6 December 1997)
+1484. Fix some initialization problems in the xkb programs (#1233,
+ Andreas Schwab).
+1483. Fix loader to resolve symbols properly in Xext (#1250, Robin Cutshaw).
+1482. Fix loader on Solaris and enable it for SVR4 (#1248,1249, Robin Cutshaw).
+1481. Fix some problems with T2R support (#1245, Robin Cutshaw).
+1480. Fix rfhcnt calculation and VT swithcing in mga driver. Allow DirectColor
+ on Millennium II cards (#1241,1242,1243,1244, Mark Montague).
+1479. Potential fix for s3/svga cursor support for Ti ramdacs. Remove a
+ mistake from the s3/svga acceleration code (#1237, Mark Vojkovich).
+1478. Switch the MGA driver over to XAA Hardware Cursor. Only support for
+ TVP3026 is included (#1236,1239, Mark Vojkovich).
+1477. Add delayed syncing abd faster arcs ub 8bpp to mga driver (#1235,
+ Mark Vojkovich).
+1476. Fix another SIGSEGV in xterm, where wrong assumptions about the type of
+ widget passed to an action handler were made (#1234, Thomas Dickey,
+ Arfst Ludwig).
+1475. Fix the wraparound problem with the Mach32 cursor and add another seven
+ pixels to the possible width of the cursor (#1232, Bryan Feir).
+1474. Remove vga256/vgainit (#1231, Mark La France).
+1473. Fix a namespace collision in Mach8 server (#1230, Mark La France).
+1472. Fix SIGSEGV when some internal xterm buffers overflowed (#1228,
+ Thomas Dickey).
+1471. Fix HiQV version of ImageWrite in the C&T driver (#1222,1223,
+ David Bateman).
+1470. Yet another attempt to fix packing order for dashed lines (#1217,
+ Mark Vojkovich).
+1469. Build fixes for Xext (#1216,1238 Takaaki Nomura).
+1468. Remove all references to the W32 server (but not the actual server code)
+ (#1215, Koen Gadeyne).
+1467. Complete initial support for Permedia 2 and add some acceleration for it
+ (Alan Hourihane).
+1466. Some more code for supporting the IBM RGB640 in the glint server
+ (Dirk Hohndel).
+
+XFree86 3.9x (23 November 1997)
+1466. Updates for SCO (#1211, 1212, J. Kean Johnston).
+1465. Fix netscape plugin core dump when transfer is interrupted (#1209,
+ Kaleb Keithley).
+1464. Registry updates (#1205, Kaleb Keithley).
+1463. Preliminary imake support for different Linux distributions (#1203,
+ Kaleb Keithley).
+1462. Enable JIS, SJIS, EUC, etc. on X_LOCALE machines (#1201, Kaleb Keithley).
+1461. Linux and HP imake cf updated (#1200, Kaleb Keithley).
+1460. Updates to XINERAMA (#1198, Kaleb Keithley).
+1459. Make the DPMS extension a more "standard" item (ie, its library code
+ is now in libXext) (#1197, Kaleb Keithley).
+1458. xload doesn't need libutil and libkvm on NetBSD and OpenBSD (#1189,
+ Scott Reynolds).
+1457. Separate module-specific and non-module-specific Xserver/Xext code
+ (#1149, Holger Veit).
+1456. OS/2 updates (don't use WIN32 file handling) (#1149, Holger Veit).
+1455. Clean up XAA calls in glint server (#1210, Alan Hourihane).
+1454. Adapt memory detection in I128 server to T2R (#1208, Robin Cutshaw).
+1453. Add DGA to glint server and get xvidtune to work with it (#1207,
+ Alan Hourihane).
+1452. Cleanups and preliminary support for the Trident 3DImage975 and
+ 3DImage985 (#1206, Alan Hourihane).
+1451. Add stipple acceleration to the tseng driver (#1192, Koen Gadeyne,
+ Mark Vojkovich).
+1450. Add better text acceleration to the tseng driver (#1190, Koen Gadeyne).
+1449. Fix HiQV image writes (#1191, David Bateman).
+1448. Remove the need for the VideoMemSave buffers in glint server (#1196,
+ Alan Hourihane).
+1447. Handle bogus base address in vgaPCIInfo for s3/svga (#1194, Mark
+ Vojkovich).
+1446. Fix XF86Setup to work with Tcl/Tk 8.0 and improve support for future
+ mouse protocols in XF86Setup (#1158,1159, Joe Moss).
+1445. Fix DGASetViewPort problem in S3 server (#1157, Harald Koenig).
+1444. Add -U flag to imake (#1156, Chris Demetriou).
+1443. First cut for I128 Revolution support (#1155, Robin Cutshaw).
+1442. Fix packing order for dashed lines (#1154, 1188, Alan Hourihane, Mark
+ Vojkovich).
+1441. Fix joycal.c to work with Linux 2.1.x (#1153, Robin Cutshaw).
+1440. Fix ImageString xtest results. Call miImageGlyphBlt instead of
+ cfbImageGlyphBlt8 (#1152, Alan Hourihane).
+1439. Add overlay support for the IBM RGB526 (disabled)(#1151, Mark Vojkovich).
+1438. Fix setting maxclock in s3/svga (#1151, Mark Vojkovich).
+1437. Print module version in plain text (#1150, Holger Veit).
+1436. Correct change 1390 (#1148, Takaaki Nomura).
+
+XFree86 3.9w (16 November 1997)
+1435. Remove some compiler warnings.
+1434. Fix lcPublic state_depend_encoding test in Xlib (#1181, Kaleb Keithley).
+1433. Fix buffer overrun in lib/X11/omGeneric.c (#1180, Kaleb Keithley).
+1432. Add new XINERAMA extension (#1171-1178, Kaleb Keithley).
+1431. Update man pages for X11R6.4 (#1169, 1170, Kaleb Keithley).
+1430. Add new CUP (Colormap Utilization) extension code (#1167,
+ Kaleb Keithley).
+1429. Add resource configuration management code to libXt (#1165,
+ Arthur Barstow).
+1428. Xkb{Get,Set}PerClientControls not implemented in Xlib (#1164,
+ Kaleb Keithley).
+1427. Fix bug in lbxproxy's detection of synonymous server names (#1161,
+ Arthur Barstow).
+1426. Various xfwp fixes and cleanups (#1103-1107, 1109, 1110, 1140-1144,
+ 1160, 1162, 1163, 1166, 1168, 1179, Arthur Barstow).
+1426. Fix select prototype for HP/UX 10.x (#1102, Kaleb Keithley).
+1425. Fix a 64-bit nit in MakeRootTile (#1080, Kaleb Keithley).
+1424. Export weak symbols in elistgen.sun (#1078, Kaleb Keithley).
+1423. Put back the reference to the xfree68 directory in
+ xkbcomp/symbols/Imakefile.
+1422. Add xkb support for some older HP keyboards (#1077, Kaleb Keithley).
+1421. Fix some typos in the iso8859-1 compose file (#1076,
+ Niels Kristian Bech Jensen).
+1420. Xlib UTF support uses longs, but should use wchar_t (#1068,
+ Kaleb Keithley).
+1419. HP/UX 10 config update (#1066, 1079, Kaleb Keithley).
+1418. Update lbxproxy to use the Xtrans library (#1060, Arthur Barstow).
+1417. Deal with gratuitous Xserver colormap flashing (#1059, Kaleb Keithley).
+1416. LBX-related updates to the Xserver (#1049, Kaleb Keithley).
+1415. Remove Xibm server from the source (#1048, Kaleb Keithley).
+1414. Remove xmh from the core tree (#1043, Kaleb Keithley). Note, only
+ the entry for it in xc/programs/Imakefile is removed here so far, and
+ we may want to move it into our supported contrib.
+1413. Update sgi.cf (#1042, Kaleb Keithley).
+1412. Fix inconsistency with the naming of general man pages and the sections
+ they are installed in (#1040, Kaleb Keithley).
+1411. Fix xrx plug-in build problem on Solaris 2.6 (#1039, Kaleb Keithley).
+1410. Fix Xserver crash when using lbxproxy and xdm-auth-1 (#1038,
+ Kaleb Keithley).
+1409. Fix an infinite loop in CreateVisual() in lbxproxy (#1034,
+ Arthur Barstow).
+1408. locale.alias updates (#1032, Kaleb Keithley).
+1407. Misc very minor TOG updates (#1031, Kaleb Keithley).
+1406. Fix for MaxClients not being defined correctly in the Xserver
+ (#1030, Sekhar Makkapati).
+1405. Fix an Xserver problem related to FreeCursor() in
+ DisposeWindowOptional() (#1026, Kaleb Keithley).
+1404. Add setusercontext support to xdm for FreeBSD (#1025, Kaleb Keithley).
+1403. Use named pipes for local connections with Solaris 2.x (#1011, 1067
+ Kaleb Keithley).
+1402. Fix lost support for non-standard encodings in Xlib (#1005,
+ Kaleb Keithley).
+1401. Fix Xserver crash when colormap of copyfromparent given (#990,
+ Sekhar Makkapati).
+1400. Make lbxproxy try another port when bind fails (#988, Arthur Barstow).
+1399. Remove the Xserver '-config' flag for OSs that don't have tight command
+ line length restrictions (#987, Kaleb Keithley).
+1398. Remove some vararg cruft from the Appgroup library (#986,
+ Kaleb Keithley).
+1397. Fix SecurityLookupIDByClass in Xserver (#1186, Sekhar Makkapati).
+1396. Fix for sample site.def (#1184, Sekhar Makkapati).
+1395. Fix references to LINE_MAX in Xos_r.h (#1182, Sekhar Makkapati).
+
+XFree86 3.9v (9 November 1997)
+1394. Add unrolled text code for the 9 pixel width fonts (#1147,
+ Mark Vojkovich).
+1393. Fix planemask/transparency problems in tseng driver (#1146,
+ Harald Nordgard Hansen).
+1392. Add Fire GL 3000 option for glint server (#1139, Bart van den Broek).
+1391. Remove unnecessary ARM32 code (#1138, Katrina Maffey).
+1390. Fix a crash in XCopyPlane after server reset (#1137, Katrina Maffey).
+1389. Add support for PS/2 Intellimouse (#1136, Tim Goodwin).
+1388. Add a PolyArc replacement for s3/svga in 8bpp when using a linear
+ framebuffer. Add a stippled rect speedup for destinations less than 32
+ pixels wide (#1135, Mark Vojkovich).
+1387. Add read speed benchmark and support for >8bpp modes to dga test
+ program (#1134, Koen Gadeyne).
+1386. Fix dashed lines for vga256 (#1133, Alan Hourihane).
+1385. Enable trapezoid fill on mga (#1132, Radek Kapitan).
+1384. Fix ImageWriteFlags in trident driver (#1131, Alan Hourihane).
+1383. Fix wide line problem in the static server (#1129, Brian Wainscott).
+1382. Fix syncing problems with the scanline routines in XAA (#1128,
+ Alan Hourihane).
+1381. Restructure glint server to call the AccelInit function in a sane
+ manner (#1127, Alan Hourihane).
+1380. Add planemask support for the tridents and add hardware clipping for
+ the Cyber chipsets. Add Cyber 9397 detection (#1126,1130, Alan Hourihane).
+1379. Fix a typo in vgaPCI.h (#1125, Alan Hourihane).
+1378. Fix a problem with setting the maximum clock value on s3 cards at depths
+ other than 8bpp (#1123, Steve Forsythe).
+1377. Fix dashed lines for matrox driver (#1122, Radek Kapitan).
+1376. Use correct arguments to xf86ImageWrite when uploading cursor image to
+ videoram. Units of pixels instead of bytes (#1120, Mark Vojkovich).
+1375. Fix s3/svga cursor location computation error (#1119, Mark Vojkovich).
+1374. Improve GC validation code in XAA (#1117,1118,1121, Mark Vojkovich,
+ David Bateman).
+1373. Add accelerated color expansion for all color depths and for all
+ W32-style chips (#1116, Koen Gadeyne).
+1372. Add Warpnext/Warpprev to twm (#1114, Benjamin Gras).
+1371. One more fix to restore changes to variable types made in change 1347.
+ This should fix MouseSystem mice (#1111,1124,1145, Steve Forsythe,
+ Andrew Aitchison).
+1370. Add missing pm_accel.c.
+1369. Add ImageWrite support to glint server (Alan Hourihane).
+
+XFree86 3.9u (1 November 1997)
+1368. Add support for I128 Revolution to scanpci and SuperProbe (#1108,
+ Robin Cutshaw).
+1367. Compile fixes for ARM32/NetBSD (#1099, Katrina Maffey).
+1366. Change mga to use bresenham lines instead of two point (#1098,
+ Radek Kapitan).
+1365. Add mga stipple code so that it is 256K pixels barrier sensible and
+ even faster than current XAA stipple code (#1097, Mark Vojkovich,
+ Radek Kapitan).
+1364. Move C&T hw cursor into XAA. Re-enable ImageWrite on C&T. Rewrite 32bpp
+ HiQV code (should be almost usable) (#1096, David Bateman).
+1363. Get the ch8398 work in tseng driver at every color depth and any hibit
+ setting (#1095, George Krajcsovits).
+1362. Changes to XAA hw cursor code to better support switching between hw
+ and sw cursor (#1094, David Bateman).
+1361. Fix incorrect parenthesis placement caused by hand-applying part of
+ change 1347 (#1092, Mark Vojkovich).
+1360. Resync PC98 Imakefiles (#1091, Takaaki Nomura).
+1359. Build fix for PANIX (#1090, Takaaki Nomura).
+1358. Fix a duplicate inclusion of <sys/termio.h> on ISC inside xterm/screen.c
+ and update the help text for xterm to correspond with the appropriate
+ commandline switches (#1089, Michael Rohleder).
+1357. Fix some incorrect type modifications in change 1347 (#1087,1088
+ Alan Hourihane, Michael Rohleder).
+1356. Fix mga_xaarepl.c to compile with non-GNU cc (#1086, Robin Cutshaw).
+1355. Clean up vgaPCI.h for Trident (#1085, Alan Hourihane).
+1354. Fix a bug introduced in change 1222 (#1084, Koen Gadeyne).
+1353. Remove amiga/ataritt files from xkbcomp/symbols Imakefile (they have
+ been moved to a subdir in change 1338) (#1083, Takaaki Nomura).
+1352. Update VideoBoard98 (#1081, Takaaki Nomura).
+1351. Add DO_NOT_BLIT_STIPPLES to the xf86AccelInfoRec.Flags (#1070,
+ Marc Vojkovich).
+1350. More work for Permedia 2 support. Still doesn't work (Dirk Hohndel).
+1349. Split acceleration drivers for GLINT and Permedia. Get glint server
+ to work (again) on Fire GL 1000 (Helmut Fahrion).
+1348. Get glint server to work on Fire GL 3000 (Bart van den Broek).
+
+XFree86 3.9t (26 October 1997)
+1347. Add support for ARM32 architecture and IGS CyberPro 2010 support
+ (#1052, Digital Equipment Corporation).
+1346. Multi-display support for lbxproxy (#969-971, 977, 978, Arthur Barstow).
+1345. Remove some misleading 32-bit comments in Xlib (#967, Kaleb Keithley).
+1344. Additional symbols for Japanese 109 key keyboard (#962, Kaleb Keithley).
+1343. Faster bit counting algorithm for Xlib/Xt modifier code (#958,
+ Kaleb Keithley).
+1342. XKB updates for hp ddx (#955, 956, Kaleb Keithley).
+1341. Fix Xaw Text Widget call to XtMalloc(0) (#954, Kaleb Keithley).
+1340. Updates to xrx plugins (#953, 957, 959-961, 963, Kaleb Keithley).
+1339. Use dump instead of nm in elistgen.sun (#922, Kaleb Keithley).
+1338. xkb updates (#920, Kaleb Keithley).
+1337. Fix imake's SPARCcompiler CCompilerMajorVersion detection (#919,
+ Kaleb Keithley).
+1336. Updates related to xkbcomp install (#918, Kaleb Keithley).
+1335. General MS-Win lib fixes (#917, Kaleb Keithley).
+1334. xterm support for -lcurses on HPUX 10.2 (#914, 916, 952, Kaleb Keithley).
+1333. Fix incorrect mode name in xf86config.c.
+1332. Fix text restore problem on some Avance Logic cards (#1072, Thomas
+ Dreibholz).
+1331. WriteBitmap code for MGA driver (#1069, Mark Vojkovich, Radek Kapitan).
+1330. Add a clean rule to remove XKB's .dir files. Add support for newer 3D
+ Rage III adapters to SuperProbe, the Mach64 server and the ATI driver.
+ Fix misuse of DirtyStartup define. Fix Mach64 mode restoration problems
+ in ATI driver. Fix 8MB linear aperture problem in ATI driver. Fix
+ typo's in drivers/s3* Imakefiles. Fix banking globals when a linear
+ aperture is used. Retrofit 3.3.1 vgaPCI code into 3.9s. (#1065,
+ Marc La France).
+1329. Add support for the Microsoft Intellimouse in the XFree86-Misc
+ Extension and XF86Setup (#1063,1064, Takaaki Nomura, Joe Moss).
+1328. Add Scanline ImageWrite support to XAA (#1062, Alan Hourihane).
+1327. Missing Millennium II AGP fixes (#1058, Brian Wainscott).
+1326. XAA hw cursor fix. Delay cursor restoration until after the saved screen
+ is restored (#1057, Mark Vojkovich).
+1325. Fix server to print the clock scale instead of effective clocks when
+ using a clockchip (#1056, Krajcsovits Gyorgy).
+1324. Correct eraser/stylus detection in wacom driver (#1055, Frederic Lepied).
+1323. Fixes for APM driver. HW lines/HW clipping. ROP support. Text accel now
+ uses PAD_DWORD. Bugfix for WaitForFifo() (lost serial interrupts) and
+ ApmSync() (various errors). HW cursor now uses XAA interface. Combined
+ write for many registers (x+y in one longword etc.) (#1054, Henrik
+ Harmsen).
+1322. xterm fixes. Correct a minor placement problem with the right scrollbar.
+ Implement a new set of control sequences for switching between the
+ normal and alternate VT100 screens. Implement the alternate-screen menu
+ entry (#1053, Thomas Dickey).
+1321. Add some reasonable limit for when a trapezoid fill is used rather than
+ using spans (#1051, Mark Vojkovich).
+1320. Add bindist description files for an OpenBSD/sparc binary distribution
+ (#1045, Todd Fries).
+1319. Some fixes and additions to the PCI databases (#1046,1050, Dejan Ilic).
+1318. Add 543x cirrus driver for PowerPC, fix some LynxOS related problems
+ (#1044, Thomas Mueller).
+1317. Add support for ViRGE/GX2 to SuperProbe (Dirk Hohndel).
+1316. Add support for ViRGE/GX2 to SVGA and S3V server (#1041, Harald Koenig).
+
+XFree86 3.9s (15 October 1997)
+1315. Fix segmentation fault in glint driver when server is started with a
+ card without GLINT/PERMEDIA chip (Stefan Dirsch).
+1314. Lots of fixes and additions to glint acceleration (Helmut Fahrion).
+1313. Fix problem with xterm hanging when opening a log file. Add
+ right-scrollbar to xterm (#1037, Thomas Dickey, Michael Rohleder).
+1312. Add GD7555 to vgaPCI.h and fix XF98_SVGA (#1036, Shuichi Ueno).
+1311. Fix a bug with Qword pad support in ImageWrite (#1033, Mark Vojkovich).
+1310. Fix mystique driver and build problem on SVR4.0 (#1029, Takaaki Nomura,
+ Isao Ohishi).
+1309. Fix SuperProbe to correctly detect memory on the Trident 9685 (#1023,
+ Alan Hourihane).
+1308. Add hardware clipping and transparency for the trident chips that
+ support it. Partially implement the 'set_mclk' option, not yet
+ complete, remove the tgui_mclk_66 option, clean up the TV output for
+ 9685 boards. Documentation updates (#1022, Alan Hourihane).
+1307. Add accelerated ImageWrite and a WriteBitmap replacement to the tseng
+ driver (#1021, Mark Vojkovich, Koen Gadeyne).
+1306. Documentation update for tseng driver (#1020, Koen Gadeyne).
+1305. Clear disallowed flags in Options bitmap (#1019, Alan Hourihane).
+1304. Fix XAA hardware cursor for built-in S3 RAMDACs (#1018, Alan Hourihane).
+1303. Use trapezoid fills for some wide lines (#1017, Mark Vojkovich).
+1302. Fix colormap switching problem in svga/s3 (#1016, Mark Vojkovich).
+1301. Fix install problem with xkbcomp (#1014, Robin Cutshaw).
+1300. Fix lnx_jstk.c to work with 2.1.x joystick.h file (#1013, Robin Cutshaw).
+1299. Disable some HTotals in matrox driver that cause vertical stripes (#1010,
+ 1015, Radek Kapitan).
+1298. Improve some bailout messages in tseng driver (#1009, Koen Gadeyne).
+1297. Suppress popen/pclose messages (#1008, Takaaki Nomura).
+1296. Initial support for Millennium II AGP (Dirk Hohndel).
+1295. Fixes to make glint server pass more of xtest (Alan Hourihane).
+
+XFree86 3.9r (30 September 1997)
+1294. Bug fixes to xterm. Change default resource of colorMode to true. Fix
+ 'ech' control. Add resource boldColors and +pc / -pc. Add resource
+ colorAttrMode. Fix conflict between colorULMode/colorBDMode versus ANSI
+ colors. Correct two problems with the optional logging support. Various
+ updates to configure-script macros (#1004, Thomas Dickey).
+1293. Make sure ImageWriteBase gets set with a default value (#1003,
+ Alan Hourihane).
+1292. Replace mktemp() with mkstemp() in xrdb (#1002, Luke Mewburn).
+1291. Don't fail to start if there isn't enough memory for the hw cursor in
+ tseng driver (#1001, Koen Gadeyne).
+1290. Fix the install problem with XF98_SVGA (#1000, Takaaki Nomura).
+1289. Add bresenham lines to tseng driver (#997, Koen Gadeyne).
+1288. Significantly accelerate clipped terminal font performance (#996,998,999,
+ Andrew van der Stock, David Bateman).
+1287. Enable 24bpp for Trident TGUI 96xx (#995, Alan Hourihane).
+1286. Add support for the Trident ClearTV (#994, Alan Hourihane).
+1285. Remove INT64 from XAA text code (#993, Mark Vojkovich).
+1284. XAA hw cursor support for s3/svga. IBM cursor works, other RAMDAC
+ cursors need to be implemented/verified. S3 builtin curser seems
+ to work in 8bpp, but fails in other depths (#992, Mark Vojkovich).
+1283. Some fixes for Unixware 2.1.2 (#989, Steve Forsythe).
+1282. Fix the remaining line drawing problems for the CL-GD5428 and CL-GD754x
+ chips (#985, Corin Anderson).
+1281. Fix build problem (982, Takaaki Nomura).
+1280. Add more acceleration for Permedia (this is partly producing drawing
+ errors and needs much more testing) and remove Trapezoid bug in 500TX
+ support of glint server (Helmut Fahrion).
+1279. Build fixes for XAA hw cursor and updates to glint XAA hw cursor (#983,
+ 984, Alan Hourihane).
+1278. Better color depth support and cleanups for glint server (Helmut Fahrion).
+1277. Add initial support for Permedia 2 chip to glint server (Dirk Hohndel).
+1276. Add support for GLINT MX chip to glint server (Dirk Hohndel).
+1275. Add RIVA 128 to scanpci (Dirk Hohndel).
+
+XFree86 3.9q (19 September 1997)
+1274. Add XF98_SVGA server, update XF98Conf.cpp, VideoBoard98, fix mga driver
+ for PC98 (#980,981, Michio "Karl" Jinbo, Shuichirou Urata).
+1273. Some fixes to glint server (Helmut Fahrion, Stefan Dirsch, Dirk Hohndel).
+1272. Fix for glint_dump_regs and disable accelerated lines for glint
+ (Stefan Dirsch).
+1271. Add XAA hw cursor support and update trident and glint drivers to use it
+ (#973-976,979, Alan Hourihane).
+1270. Several fixes to xterm: fix redraw errors after font changes or resizes,
+ add sunKeyboard resource, correct fg/bg test in the control sequence
+ that replies with the current SGR settings ((#972, Thomas Dickey).
+1269. Several fixes to the xterm standalone configure script (#972,
+ Thomas Dickey).
+1268. Fix to pointer movement constraints (#968, Stuart Anderson).
+
+XFree86 3.9p (15 September 1997)
+1267. Disable Image Write for HiQV chips in C&T driver (#966, David Bateman).
+1266. Add stipple accelerated functions through the ScanlineScreenToScreen
+ function (#965, Alan Hourihane).
+1255. Add ImageWrite support for the Laguna chips in cirrus driver (#964,
+ Corin Anderson).
+1254. Disable the Xserver '-config' option when run set-uid.
+1253. Have the Xservers run xkbcomp under the real user's ID.
+1252. Fix xterm's default handling of the KP_Add key.
+1251. Fix Linux-axp xdm build problem.
+1250. Fix stripping of extension from module names (so that it works OK
+ when there is a '.' in the module directory pathname).
+1249. Fix some problems in the trident driver with the 9685 programmable clock
+ and disable the GE when too little memory is available (#950,
+ Alan Hourihane).
+1248. Fix build problem with non gcc compilers (#948,949, Takaaki Nomura,
+ David Bateman).
+1247. Fix some dangling references and max MClk value in matrox driver (#951,
+ Dirk Hohndel).
+1246. Disable debugging messages in DirectColor support (Andrew Aitchison).
+1245. Fix saving video memory for glint server (Helmut Fahrion).
+
+XFree86 3.9o (9 September 1997)
+1244. Yet another fix for the problems around installing xkbcomp
+ (Michael Rohleder, David Dawes, Dirk Hohndel).
+1243. Add more acceleration for 500TX to glint server (Alan Hourihane).
+1242. Add initial acceleration for Permedia to glint server (Dirk Hohndel).
+1241. Lots of cleanups and fixes to glint server (Stefan Dirsch, Helmut
+ Fahrion, Dirk Hohndel).
+1240. Fix glint server problems on some ASUS motherboards (Stefan Dirsch).
+1239. Add Permedia support to glint server (Helmut Fahrion, Dirk Hohndel).
+1238. Several m68k related fixes (faster pic code, change Atari TT geometry),
+ fixes to not reference the undefined variable XPROJECTROOT, some glibc
+ updates (#947, Andreas Schwab).
+1237. Move some of the improvements that Mark Vojkovich made for the S3 stipple
+ code back into XAA (#945, David Bateman).
+1236. Fix problem with HW cursor disappearing on Cirrus Laguna chips (#943,
+ Corin Anderson).
+1235. Fix 24bpp XAA NonTE image text with RGB_EQUAL (#942, David Bateman).
+1234. Fix BIOS layout issues in matrox drivers. This might make Millennium
+ Rev 3 cards work (#941, Andrew van der Stock).
+1233. Improve the performance of the 24bpp fills on the 6554x machines and
+ hopefully implements a solid fill at 32bpp for the 6555x machines
+ (untested). Some cosmetic changes (#940,944, David Bateman).
+1232. Turn off CPU_TRANSFER_BASE_FIXED in SVGA/S3 driver (#939, Mark Vojkovich).
+1231. Add the correct Enable/DisableIO Ports back into the glint driver (#938,
+ Alan Hourihane).
+1230. Fix trident & mga driver for PC98. Fix XF98Conf.cpp. Resync PC98
+ Imakefiles (#935, Takaaki Nomura).
+1229. Add accelerated Image Write to C&T driver. Attempted fix for the use
+ of TMED DSTN dithering on the 65555 and 68554 chips. Small
+ documentation patch (#934, David Bateman).
+1228. Fix XF86Setup to load XFree86-VidModeExtension (#932, Takaaki Nomura).
+1227. Fix MClk limits for matrox driver (#931, Andrew van der Stock).
+1226. Fix build problem on Solaris (#929, Matthieu Herrb).
+1225. Add DacSpeed to C&T driver (#930, David Bateman).
+1224. Disable acceleration for IMA bus chips in tseng driver (#928,
+ David Bateman)
+1223. Turn Record extension into module and fix problems in XInput joystick
+ module (#927,933, Matthieu Herrb).
+1222. Add support for the ch8398 and ch8398a clockchips to the tseng driver
+ (#913,914 Gyorgy Krajcsovits).
+
+XFree86 3.9n (26 August 1997)
+1221. Lots of small fixes for xterm (#912, Thomas Dickey).
+1220. Add DirectColor visual to Matrox server (#911, Andrew Aitchison).
+1219. Disable 8x8 pattern tiling on W32 (not W32i/p) cards. Fix lowend W32p
+ cards with IMA bus. Modify linear memory code (#910, Koen Gadeyne).
+1218. Fix locale in R6.3, Fix PC98 XKB, Remove xf86ClearIOPortList() and
+ xf86AddIOPorts() from PEGC driver (#908, Takaaki Nomura, Isao Ohishi).
+1217. Remove xf86ClearIOPortList() and xf86AddIOPorts() (#907,909
+ Matthieu Herrb).
+1216. Add ET6100 support to tseng driver (#906, Koen Gadeyne).
+1215. Add wide lines to XAA (#904, Mark Vojkovich).
+1214. Add Chrontel8391CalcClock function (#903, Gyorgy Krajcsovits).
+1213. Fix output of hex numbers in chip revision (#902, Dejan Ilic).
+1212. Add accelerated Bresenham lines to tseng driver at 8bpp (#901,
+ Koen Gadeyne).
+1211. Xlib: XIMStringConversionRetrival should be XIMStringConversionRetrieval
+ (#905, Kaleb Keithley).
+1210. Official fix for potential buffer overflow in XGetErrorDatabaseText
+ (#900, Kaleb Keithley).
+1209. Fix typo in cde.rules (#899, Kaleb Keithley).
+1208. SGI threads patch update (#898, Kaleb Keithley).
+1207. Fix UNSHARED_CXXLIB for SPARCcompiler4.0 (#897, Kaleb Keithley).
+1206. Fix SPARCcompiler CCompilerMajorVersion (#896, Kaleb Keithley).
+1205. Parse junk from export lists better (#895, Kaleb Keithley).
+1204. Removes some dead or unused code in os-support (#893, Matthieu Herrb).
+1203. Remove xf86tmpnam() from libc_wrapper and rewrites xf86tmpfile() to
+ use tmpfile() (#892, Matthieu Herrb).
+1202. Add a separate README.OpenBSD for 3.9 (#890, Matthieu Herrb).
+1201. Move most common extensions into a module (#889, Matthieu Herrb).
+1200. OpenBSD multi-architecture support (#888, Matthieu Herrb).
+1199. Disable disables broken software/hardware cursor switching in s3/svga
+ (#887, Mark Vojkovich).
+1198. Some fixes for PC98. XF86Setup, mga driver, VideoBoards98, Cards98
+ (#886, Takaaki Nomura, Takefumi Tsukada).
+1197. Acceleration fixes for Trident and accelerated ImageWrite (#883,884,885
+ Alan Hourihane).
+1196. Bring the 3.3.1 Trident fixes into 3.9 (#882, Alan Hourihane).
+1195. Add incomplete Rendition detection code to SuperProbe (Dirk Hohndel).
+1194. Add Rendition detection to PCI code (#881, Marc Langenbach, Dirk Hohndel).
+1193. Fix to only build *.dir file for xkbcomp on make install (#880,
+ Michael Rohleder).
+1192. Add ImageWrites for s3/svga (#879, Mark Vojkovich).
+1191. Rename dashed pattern flags (#878, Mark Vojkovich).
+1190. Add ImageWrite support for XAA (#877, Mark Vojkovich).
+1189. Add MGA2164 define to vgaPCI.h (#876, Takaaki Nomura).
+1188. Extend the frame buffer test in glint_dump_regs (Stefan Dirsch).
+
+XFree86 3.9m (13 August 1997)
+1187. Add printing support to xterm (#870, Thomas E. Dickey).
+1186. Fix denial of service attack through xdm double freeing memory (#875,
+ Kaleb Keithley).
+1185. Fix Solaris build problem (#874, Takaaki Nomura).
+1184. Preliminary experimental support for the Millennium II (#852-857,
+ Andrew Vanderstock).
+1183. Recognise the rev 3 Mystique, and hopefully set everything up
+ correctly for it, change MMIO/fb mapping for Mystique rev >=3.
+ (David Dawes)
+1182. Patches to both XAA and the Glint sources that enable the
+ ScanlineScreenToScreen colour expansion (#873, Alan Hourihane).
+1181. Fix problem of xkbcomp not generating .dir files during install
+ (#872, Kaleb Keithley).
+1180. Fix problem with possible denial of service attack using the X server
+ (#867, Kaleb Keithley).
+1179. Update VidModes.sgml to latest version (#871, Eric Raymond).
+1178. Fix I128 support for AXP (#868, Robin Cutshaw).
+1177. Add planemask support to most XAA functions for all tseng chips
+ (#869, Koen Gadeyne).
+1176. Fix text rendering for W32 at 16bpp, always determine bus type, fix
+ bug in XAA color expansion (#865, Koen Gadeyne).
+1175. Fix ET6000 dram speed code, disable 32bpp on ics5301 ramdacs (#864,
+ Koen Gadeyne).
+1174. Clean up RAMDAC handling in tseng driver, extend stg1702 support, and
+ fix problems caused by treating unknown RAMDACs as AT&T compatible
+ (#862, Koen Gadeyne).
+1173. Fix support for linear memory mode on W32p rev a&b (#861, Koen Gadeyne).
+1172. Fix ET6000 black screen problem (#861, Koen Gadeyne).
+1171. Changes to Amiga XKB code (#860, Bernd Ernesti).
+
+XFree86 3.9l (31 July 1997)
+1170. Fix parsing of DPMS parameters in config file.
+1169. Catch a NULL dereference in lib/X11/lcFile.c (#843, Dirk Hohndel).
+1168. Xterm support for compound text cut and paste (#836, Kaleb Keithley).
+1166. Fix some I128 problems reported with PPro CPUs (#834, Robin Cutshaw).
+1165. Disable C&T fill at 32bpp (#831, David Bateman).
+1164. Update VideoBoard98 file (#830, 842 Takaaki Nomura, Isao Ohishi).
+1163. Prevent re-allocation of cfb ScreenPrivateIndex for multi-head
+ server (#829, Stuart Anderson).
+1162. Fix unintended changes in PCI code.
+1161. Fix handling of PS/2 protocol mice with OpenBSD (it doesn't translate
+ to BusMouse protocol like NetBSD does) (#820, Matthieu Herrb).
+
+XFree86 3.9k (29 July 1997)
+1160. Several fixes to xterm. Correct an indexing error in the doublesize
+ character logic. Correct the logic of ShowCursor when it is painting in
+ a doublesize cell. Correct the behavior when switching to doublesize
+ characters and back again. Add cbt (back_tab) to the terminfo
+ description. Correct the logic for disabling xmc. Minor correction to
+ positioning of underlines for small (e.g., 5x8 font size. Add more
+ special-case tokens to the standalone configure script's imake-option
+ filter. Add a '--enable-logging' option for the standalone configure
+ script. Add check and ifdef's for the standalone configure script to
+ allow for building on platforms with X11R6, which lacks Xpoll.h
+ (#769,821, Thomas Dickey).
+1159. Preliminary support for Millennium on PC98 (#825, Shuichiro Urata,
+ Takaaki Nomura).
+1158. update XKB for PC98 (#825, Isao Ohishi).
+1157. Support XF86Setup for PC98 (#825, Takaaki Nomura, Kazunori Ueno).
+1156. PC98 resync (#825, Michio "Karl" Jinbo).
+1155. Add common Imakefiles for some PC98 sub directories (#825,
+ Michio "Karl" Jinbo).
+1154. Add code to fine tune memory access on ET6000 boards and cleanup some
+ W32 specific code that would write to illegal registers on ET6000 cards
+ (#818, Harald Nordgard Hansen).
+1153. Ensure accelerator CRTC registers are unlocked before writing them and
+ horizontal & vertical syncs are not disabled on mode switches (#817,
+ Marc La France).
+1152. Change xsetroot -mod option to count pixels from left to right within
+ each 16-pixel slice, instead of right to left (#817, Marc La France).
+1151. Cleanup declarations for xf86Verbose, xf86ProbeOnly & xf86ProbeFailed,
+ make VGABase XF86Config option recognized by more servers, HSkew wasn't
+ being dealt with correctly in matching modes to clocks, fixup default
+ mode for the generic VGA driver (#817, Marc La France).
+1150. Fix a few bugs in ATI driver, break it up in multiple files, add
+ support for Mach64 accelerator CTRC, which now is used by default, and
+ generic VGA (untested) (#817, Marc La France).
+1149. Fix build problem on Solaris (#810, Dirk Hohndel).
+1148. Re-enable LEFT_EDGE_CLIPPING_NEGATIVE for the HiQV chips and tidy up the
+ ScreenToScreenColorExpand stuff (#808, David Bateman).
+1147. Enable the sw_cursor option and add support for the no_accel option (#806,
+ Joe Moss).
+1146. Avoid source overruns in xf86DrawStippleScanline() and remove the
+ restrictions on TRIPLE_BITS_24BPP, LEFT_EDGE_CLIPPING
+ and LEFT_EDGE_CLIPPING_NEGATIVE_X (#805, David Bateman).
+1145. Allow keywords with underscores in XF86Setup (#802, Harald Koenig).
+1144. Explicitly enable hsync and vsync on Mach64 boards (#799, Marc La France).
+1143. Small fix for norwegian keyboard in xkb (#797, Harald Nordgard Hansen).
+1142. Add 32bpp to HiQV driver and get CopyArea and Solid Fills accelerated
+ in 32bpp (#790,796, David Bateman).
+1141. Fix clock calculation on HiQV chips (#783, David Bateman).
+1140. Fix hardware clipping and get closer to a working 8x8pattern color expand
+ (#781,811, Alan Hourihane).
+1139. Disable C&T HiQV ImageWrite (#780, David Bateman).
+1138. Change how patterns are packed for LINE_PATTERN_MSBFIRST_INCREASING
+ (#779, Mark Vojkovich).
+1137. SVGA/S3 acceleration improvements (#778, Mark Vojkovich).
+1136. Fix xclock problem that shows up on Cirrus 542x chips
+ (#777, Corin Anderson).
+1135. Small fix for C&T driver (#775,776 David Bateman).
+1134. Merge missing ViRGE code from 3.3* into 3.9* (#773, Harald Koenig).
+1133. Support for I128 DRAM cards (#816, Robin Cutshaw).
+1132. PCI updates required for the I128 server (#815, Robin Cutshaw).
+1131. Fix for Xt/Error.c (#813, Kaleb Keithley).
+1130. Make XF86Setup's keyword matching the same as the Xservers (ie,
+ ignore '_', ' ', '\t' in keywords).
+1129. Tseng documentation update (#800, 803, Koen Gadeyne).
+1128. Update to imake's auto GCC PostIncDir detection for OpenBSD
+ (#794, Matthieu Herrb).
+1127. Fix I128 problems (#792, 809, Robin Cutshaw).
+1126. Fix some errors in the symbols/th XKB file (Poonlap Veeratanabutr).
+1125. Don't use EXTRA_DEFINES in Xserver/xkb/Imakefile (#786, Kaleb Keithley).
+1124. Alternate way of fixing the "./" problem in Imake.rules
+ (#785, Kaleb Keithley).
+1123. Install full path in dynamic libraries for SCO (#782, J. Kean Johnston).
+1122. Fix remaining problems with SCO OpenServer 5 support (#772,
+ J. Kean Johnston).
+1121. Fix support for older I128 cards (#771, Robin Cutshaw).
+1120. Add detection for C&T 68554, and fix detection of the 65550 revision
+ numbers (#770, David Bateman).
+1119. Fix STG170x support in tseng driver (#766, Koen Gadeyne).
+1118. Fix linkkit install problem in apm driver (#767, Holger Veit).
+1117. Add more resolutions to xf86config (#767, Holger Veit).
+1116. Add OS/2 diagnostic on network config (#767, Holger Veit).
+1115. Fix EditRes problems that show up on OS/2 (#767, Holger Veit).
+1114. Fix a problem in OS/2's imakesvc.cmd (#767, Holger Veit).
+1113. Fix lockup when the SVGA server dumps core with the MGA driver
+ on some OSs.
+1112. Fix a bug in cfb24GetSpans which can cause a server crash
+ (StarOffice will provoke this).
+1111. Fix the use of a C++ reserved word in xf86vmode.h.
+1110. Reset the DPMS state to ON when re-entering the server's VT.
+
+XFree86 3.9j (12 July 1997)
+1109. Process Xqueue events synchronously to avoid problems with
+ accelerated servers.
+1108. Fix sqrt problems in miarc (#765, Harald Koenig).
+1107. Remove special Tk 4.0 support in XF86Setup and add C code to match the
+ latest vidmode extension changes. Fix a minor bug in the DPMS code
+ (#764, Joe Moss).
+1106. Several small fixes to Xserver/{dix,include,os/,PEX5} (#760-763,
+ Craig Groeschel).
+1105. XKB fixes (#759, Stuart Anderson).
+1104. Fix uninitialized variable (verbose) in scanpci.c (#757, Thomas Mueller).
+1103. Add big endian version of PCI config structure (#757, Thomas Mueller).
+1102. Add cross compile definitions for LynxOS and add static vga server for
+ LynxOS PowerPC (#757, Thomas Mueller).
+1101. Add bindist files for LynxOS (#756, Thomas Mueller).
+1100.
+1099. Add handling for AST onboard Mach32 card (#754, Bryan Feir).
+1098. Fix a problem in Imake.rules that shows up when using Motif.rules.
+1097. Fix MGA lockup on SVR4.0.
+1096. Add missing for Japanese "small TSU" character to the XKB
+ symbols/jp file (#751, Shigehiko Sasaki).
+1095. Fix ET4000/W32i acceleration at 16 and 24bpp, and accelerate colour
+ expansion at 16bpp and 24bpp for the W32p (#747, Koen Gadeyne).
+1094. Fix for I128 rev 2 chips (#746, Robin Cutshaw).
+1093. Fix typo in xf86_libc.h.
+
+XFree86 3.9i (6 July 1997)
+1092. Fix apm HW cursor problem at VT switch, and a problem with
+ screen-to-screen bitblts (#745, Henrik Harmsen).
+1091. VidMode extensions updates, including adding a new function to
+ return the available clocks, and how many more clocks can be programmed,
+ add the HSkew parameter and some reserved fields (this introduces
+ a protocol incompatibility), and fix a bug in the ValidateModeLine
+ function's clock checking (#744, Joe Moss).
+1090. Add port probing to SuperProbe for the Alliance 6410, 6422 and AT24
+ (#743, Joe Moss).
+1089. Add similar ET6300 detection to scanpci and vgaPCI.h.
+1088. Fix SuperProbe's ET6000 memory probe (#742, Koen Gadeyne).
+1087. Add detection for the ET6100 and ET6300 to SuperProbe (#742,
+ Koen Gadeyne).
+1086. Some PCI video cards don't have the expected "IBM" string in the
+ BIOS, so look for the "PCI" string too. Without this, scanning with
+ -nopci fails for some cards (#741, Koen Gadeyne).
+1085. Possible fix for XWarpCursor() not working with the XInput
+ xf86PostMotionEvent() function (#740, Michael Rohleder).
+1084. Add some "test-support" code to xterm, which is not enabled by
+ default (#739, Thomas E. Dickey).
+1083. Fix ET4000W32p RAMDAC detection (backs out most of #717), make
+ the tseng driver use DELAYED_SYNC, and an (unsuccessful) attempt
+ to get CPU-to-screen colour expansion working (#737, Koen Gadeyne).
+1082. Add missing valuator initialisation to the OS/2, SCO and Xqueue
+ MouseProc() functions. This fixes the mouse problems on those OSs
+ (#736, 738, Holger Veit and Richard Coley).
+1081. Fix a misplaced va_end() in the recent XInput code which caused a core
+ dump on OS/2 (#736, Holger Veit).
+1080. Fix SummaSketch bug that shows up with newer XInput code, add
+ a missing conversion_proc, fix misplaced break, and add new config
+ options to the SummaSketch subsection for ActiveArea and ActiveOffset
+ (#735, Steven Lang).
+1079. Fix a problem with xterm's cursor colour versus the background, and
+ remove a duplicate initialisation of the cursor's GC (#734,
+ Thomas E. Dickey).
+1078. Fix XAA's bpp setting at 24bpp (#733, Mark Vojkovich).
+1077. Fix cpp script problem on AIX (#732, Kaleb Keithley).
+1076. Fix xhost core dump that can happen if no hosts are authorised
+ (#731, Kaleb Keithley).
+1075. Glint driver updates (#729, 730, Alan Hourihane).
+1074. Move the solx86usleep() function out of solx86_init.c into a separate
+ file, which should fix the problems addressed by #726.
+1073. Add ANSI-C wrappers (#724, Holger Veit).
+1072. Update recent config and libX11 changes for OS/2 (#724, Holger Veit).
+1071. Fix and enable ET4000W32i acceleration, and fix unmap bug in the
+ ET6000 memory probe (#723, Koen Gadeyne).
+1070. Replace fdflush() in the Summa and AceCad drivers with tcflush
+ (#722, Steven Lang).
+1069. SCO support updates (#721, J. Kean Johnston).
+1068. Add some more dead accents to the 'se' xkb layout (#718, Dejan Ilic).
+1067. Merge in TOG's X11R6.3 public patch 2.
+
+XFree86 3.9h (30 June 1997)
+1066. Don't call seteuid in the server when the real uid is root. This
+ fixes a problem of not getting a core file under some FreeBSD versions.
+1065. Tseng driver cleanups (#717, Koen Gadeyne).
+1064. 'xset dpms 600 0 0' complains about 600 being greater than 0.
+1063. New XInput driver for the AceCad ADVANCEDigitizer (#716, Shane Watts).
+1062. Clean up some problems with the xf86 wrappers (#715, Matthieu Herrb).
+1061. New Xinput driver for MicroTouch TouchPen touch screen (#714,
+ Patrick Lecoanet).
+1060. Changes for E281-2310 and fully compatible controllers in the
+ Elographics driver (#714, Juergen P. Meier).
+1059. Elographics driver updates (#714, Patrick Lecoanet).
+1058. Fix ROP bugs in the svga/s3v driver (#713, Harald Koenig).
+1057. Fix a malloc/free bug which can cause the Xserver to crash when
+ an lbxproxy terminates.
+1056. Change default compression level in lbxproxy (#710, Kaleb Keithley).
+1055. Xt/Error.c update (#708, Kaleb Keithley).
+1054. LibXext cleanups (#707, Kaleb Keithley).
+1053. Config updates (#706, Kaleb Keithley).
+1052. Add PreviousCandidate and MultipleCandidate keysyms (some new Japanese
+ keyboards have these keys) (#705, Kaleb Keithley).
+1051. Fix some xterm bugs (#700, Thomas E. Dickey).
+1050. Initial part of implementing VT100 doublesize characters for xterm
+ (#700, Thomas E. Dickey).
+1049. First stab at adding dlopen() style loader (#712, Matthieu Herrb).
+1048. Add further acceleration to the GLINT server (mostly disabled) (#711,
+ Alan Hourihane).
+1047. Add support for I128 Series II Rev 2 chips (#704, Robin Cutshaw).
+1046. Additions to the apm driver. Add support for AT3D, acceleration for
+ 8,16,32bpp (for AT3D and AT24, filled rectangles, screen-screen bitblts,
+ host-screen color expansion bitblts for text). DPMS support, hardware
+ cursor code (also in 8bpp), use programmable clock, set MCLK to 57.3
+ MHz on AT3D, various bugfixes and cleanups (#702, Henrik Harmsen).
+1045. Fix problems with displaying card READMEs in XF86Setup (#701, Dirk
+ Hohndel).
+1044. Add left-edge clipping to s3_newmmio. There's bug in both the scanline
+ screen->screen and CPU->screen stipple fallback routines though. Both
+ break certain patterns and the screen->screen bug is worse than the
+ CPU->screen one (#694, Mark Vojkovich).
+1043. Enables the XInput modules from 3.2 to be loaded as modules in
+ XF86_LOADER (#693, Matthieu Herrb).
+1042. Add code to have XAA check to see if a stipple can be reduced to an 8x8
+ pattern before banishing it from the pixmap cache on account of it's
+ size (#692, Mark Vojkovich).
+1041. Fix CapNotLast problem in dashed line code (#686, Mark Vojkovich).
+1040. Add stippled fill fallback for SVGA/S3 if the pixmap cache is too small
+ (#685, Mark Vojkovich)
+1039. Fix for xf86initac,c so that drivers can specify their own WriteBitmap
+ functions and fallbacks for non-cachable stippled fills. This also
+ allows usage of both CPU->screen and scanline screen->screen color
+ expansion instead of one or the other (#684, Mark Vojkovich).
+1038. Some Xlib fixes (#687-690, 695-699, Kaleb Keithley).
+1037. XKB updates (#674, 675, 709, Kaleb Keithley).
+1036. Config updates to make use of change 1033 (#673, Kaleb Keithley).
+1035. Fix a typo in the XKB symbols/hu file and add an entry for it in
+ the rules/xfree86.lst file (Peter Soos).
+1034. Fix a bug in Xt/Error.c that can result in partially duplicated
+ error/warning messages.
+
+XFree86 3.9g (20 June 1997)
+1033. Changes to imake to determine LinuxCLib*Version,
+ LinuxBinUtilsMajorVersion and PostIncDir at build time (#673,
+ Kaleb Keithley).
+1032. Fix SEGV in solx86's xf86MapVidMem() when called without first
+ calling xf86LinearVidMem() (David Thompson).
+1031. Fix for pci detection code in S3 server (#683, Harald Koenig).
+1030. Fix problems with rop -1 in S3V server (#679,681,682, Huver Hu, Harald
+ Koenig).
+1029. Fix cache expansion routine for HARDWARE_PATTERN_NOT_LINEAR (#680,
+ Mark Vojkovich).
+1028. Add "no_split_xfer" option to S3 server (#678, Harald Koenig).
+1027. Fix bug in xterm. Logout records should contain '\0' as first char
+ in user name (#676, Alex Belits).
+1026. Fix color problems on S3 cards with Ti3026 for SVGA/S3 (#671,
+ Achim Oppelt).
+1025. Adapt code to future changes in NetBSD's (and OpenBSD's?) mmap
+ semantics (#670, Matthieu Herrb).
+1024. Fix xterm's op termcap entry, and shorten the entry so it fits within
+ the 1024 character limit.
+1023. Actually include changes 963-965.
+1022. Add accelerated server for cards based on 3DLabs GLINT chipsets. This
+ server is known to work on Elsa GLoria L cards on most motherboards.
+ It does not support any other cards at this time. This work was
+ sponsored by S.u.S.E., Elsa, and SNI (Alan Hourihane, Stefan Dirsch,
+ Dirk Hohndel).
+
+XFree86 3.9f (16 June 1997)
+1021. Fix some build problems with 3.9e.
+
+XFree86 3.9e (15 June 1997)
+1020. Add some more I128 acceleration, including pixmap cache, rectangle
+ fills and line drawing (#669, Robin Cutshaw).
+1019. Fix a compile problem that shows up with GLX isn't enabled
+ (#668, Frederic Lepied).
+1018. If the Wacom driver isn't supplied with a value for the Suppress
+ option it is calculated to report motions according to the screen
+ resolution (#668, Frederic Lepied).
+1017. Fix a bug in the XInput Wacom driver which prevented the eraser from
+ working (#668, Frederic Lepied).
+1016. Add a virtual XInput device called "Switch" which sends extended
+ motions when a different device sends a core event (with AlwaysCore
+ enabled (#668, Frederic Lepied).
+1015. Fix behaviour of XInput relative devices. They send events with
+ accumulated valuators not with valuators deltas (#668, Frederic Lepied).
+1014. XInput devices with AlwaysCore enabled send both core and extended
+ events at the same time (#668, Frederic Lepied).
+1014. Move HP's HPkeysym.h (#667, Kaleb Keithley).
+1013. Fix a bad include in FS.h (#666, Arthur Barstow).
+1012. Add the mechanism to acknowledge the new DacSpeed[] values to the
+ svga/s3 driver. Only the Trios use it so far (#665, Mark Vojkovich).
+1011. Fix(?) Truecolor depths for the Ti 3026/3030 ramdacs in the svga/s3
+ driver (#665, Mark Vojkovich).
+1010. Fix a logic bug in the XAA code that checks to see if there is
+ enough room for 8x8 patterns in the pixmap cache (#664,
+ Mark Vojkovich).
+1009. Changes to vga256/vga to allow the NV1 driver to work without
+ requiring any VGA functionality (#663, David McKay).
+1008. Resync the MGA driver with 3.3 (#660, Radoslaw Kapitan).
+1007. Lots of updates to the svga/ati driver (#659, Marc Aurele La France).
+1006. Update support for ATI Rage II+, Rage Pro in the Mach64 server, scanpci,
+ and SuperProbe (#659, Marc Aurele La France).
+1005. Remove man pages for VGA16 and Mono servers (#659,
+ Marc Aurele La France).
+1004. Fix duplicate target in drivers/s3/Imakefile (#658, Robin Cutshaw).
+1003. Fix some Xprt problems (#655-657, Kevin Samborn).
+1002. Fix some DPMS problems, including problems when the DPMS timeouts
+ are smaller than the screensaver cycle time, and problems with the
+ various DPMS setting not being re-initialised at server reset.
+1001. Fix an InfoRec initialisation problem in xfree68/fbdev (#652,
+ Andreas Schwab).
+1000. Fix incorrect links created from nls/XLC_LOCALE to xc/exports
+ (#652, Andreas Schwab).
+ 999. Fix a flaw in a libX11 security fix (#652, Andreas Schwab).
+ 998. Add libc 6 config for Linux/m68k to Linux.cf (#652, Andreas Schwab).
+ 997. Allow depth-specific Dacspeeds to work for the tseng driver
+ (#651, Koen Gadeyne).
+ 996. Tseng driver cleanups (#650, Koen Gadeyne).
+ 995. Allow xterm to start when /etc/termcap is missing, and fix some
+ configure script nits (#649, Thomas E. Dickey).
+ 994. Fix twm crash if interrupted during startup (#644, Wolfram Gloger).
+ 993. Fontlib fixes (#636-640, 642, 646, 648, Arthur Barstow).
+ 992. Add audit logging to xfwp (#623, Kaleb Keithley).
+ 991. Sun/XKB keyboard fix (#621, Kaleb Keithley).
+ 990. Update xrx defaults (#620, Kaleb Keithley).
+ 989. Fontserver fixes (#613, 643, Arthur Barstow).
+ 988. Imake config updates (#610-612, 614-617, 619, 624, Kaleb Keithley).
+
+XFree86 3.9d (10 June 1997)
+ 987. Fix "xaa_no_color_exp" option for scanline-screen-to-screen color
+ expansion (#629, Koen Gadeyne).
+ 986. Add hint how to disable building Xprt to xf86site.def (#627, Koen
+ Gadeyne).
+ 985. Change Linux to use -D_REENTRANT (#644, Wolfram Gloger).
+ 984. Fix C&T driver to be more strict about DClk and MClk limits for HiQV
+ chips (#645, David Bateman).
+ 983. Fix I128 server (#635, Robin Cutshaw).
+ 982. Fix VT switching problems in mga driver (#634, Guy Desbief).
+ 981. Fixes for xterm (missing part of install-rule, incorrect assignment for
+ --enable-color-mode option, unexpected cursor color change while
+ scrolling) (#632,633, Thomas Dickey).
+ 980. Fix a problem where the Tseng memory mapped registers get cleared in
+ vgaScreenInit() when it is clearing the screen as startup. This only
+ happened for 8bpp with linear mode enabled (#630, OEyvind Aabling).
+ 979. Avoid nested asm calls for SVR4.0 (#631, Takaaki Nomura).
+ 978. Fix error messages when loading modules in the static server (#626,
+ Matthieu Herrb).
+ 977. Change svga/s3 into two separate modules s3_pio and s3_newmmio. This
+ doesn't work with the static server at this point. Add linear
+ addressing and 16/24(packed)/32bpp. Add pci_retry option. (#625,
+ Mark Vojkovich).
+ 976. Allow the ChipId and ChipRev values to be overridden from the XF86Config
+ for the Mach64 server.
+ 975. Fix some 1bpp and 4bpp problems (#609, Marc Aurele La France).
+ 974. Changes to allow SuperProbe, Mach64 driver, scanpci and vgaPCI to
+ detect the newer ATI 3D Rage II+ chips (#609, Marc Aurele La France).
+ 973. Allow the server side of the multibuffer extension to compile (#609,
+ Marc Aurele La France).
+ 972. Continue removal of the XF86_VGA16 & XF86_Mono servers (#609,
+ Marc Aurele La France).
+ 971. Add some new keywords to xf86_Config.h (#608, Stuart Anderson).
+ 970. Fix problem building the PC98 loader server (#607, Takaaki Nomura).
+ 969. Fix xdm/Imakefile for OpenBSD (which doesn't have libcrypt)
+ (#606, Matthieu Herrb).
+ 968. Fix default value for xf86bpp (David Dawes, Dirk Hohndel).
+ 967. Some cleanups to tseng driver, re-apply the STG1700 RAMDAC changes and
+ re-introduce some 1/4bpp checks (#605, Koen Gadeyne).
+ 966. Fix a few typos in tseng.sgml (#605, Koen Gadeyne).
+ 965. Automagically select the correct protocol for PS/2 mice at startup
+ with XF86Setup (#604, Dirk Hohndel).
+ 964. Fix XF86Setup to follow links that point to non-existing files (so that
+ it creates /var/X11R6/bin/X if necessary (#604, Dirk Hohndel).
+ 963. Fix XF86Setup to allow reading the right README files for cards using
+ the SVGA server (#604, Dirk Hohndel).
+ 962. Fix small problem with installing the LinkKit (#603, Geert Uytterhoeven).
+ 961. Fix 8x8 pattern cache size checking (#602, David Bateman).
+ 960. Remove old (pre-XAA) acceleration from C&T driver (#601, David Bateman).
+ 959. Two small fixes in C&T driver for "use_vclk1" option and ImageWrites
+ (#600, David Bateman).
+ 958. Add C&T 65555 detection to SuperProbe and SVGA server; treat it
+ basically like a 65550 but attempts to use the TMED features (untested)
+ (#600, David Bateman).
+ 957. Fix build problems in tseng_driver.c (#599, David Bateman).
+ 956. Fix XF86Setup build problem (#598, Takaaki Nomura).
+ 955. Fix yet another fontserver problem (#597, Arthur Barstow).
+ 954. Remove bogus changes to xc/Imakefile (Dirk Hohndel).
+ 953. Fix incorrect define for DGA (Steve Kump).
+
+XFree86 3.9c (3 June 1997)
+ 952. Fix a problem with the HW cursor being drawn in the overscan area
+ with the svga/s3v driver and cleanup some of the register
+ save/restore (#585, Harald Koenig).
+ 951. Disable the banked-mode speedups for the Tseng driver when running
+ in linear mode (#584, David Bateman).
+ 950. Fix for CR53 not being restored unless xf86Verbose > 1 in the svga/s3v
+ driver (#572, Sebastien Marineau).
+ 720. Fix problems restoring some non-standard text modes for the Millennium
+ (#571,573, Radoslaw Kapitan, #574, Ansgar Hockmann).
+ 948. Fix svga/s3v panning at 24bpp (#570, Harald Koenig).
+ 947. Fix S3V panning at 24bpp (#569, Harald Koenig).
+ 946. Fix misleading messages in the svga/s3v driver when the SVGA server
+ is started with a non-ViRGE S3 card (#568, Sebastien Marineau).
+ 945. Alternate S3V 32<->24 bpp translation to avoid unaligned traps
+ on Alpha platforms (#567, Harald Koenig).
+ 944. Disable 8x8 pattern fill when less than 8 scanlines are available
+ in the XAA pixmap cache (#566, David Bateman).
+ 943. Fix a screen restore problem for the Mystique when the server is
+ started with '-probeonly' (#559, Radoslaw Kapitan).
+ 942. Turn the monitor back on after DPMS has done its thing for
+ OSs where the input devices are not selectable (558, Jack Thomasson).
+ 941. Fix some incorrect ROP definitions in the C&T driver (#557,
+ David Bateman).
+ 940. Fix some text font corruption for the S3 Trio64 (#549,554 Harald Koenig).
+ 939. XF86Setup carddata updates (#547, Koen Gadeyne, #552, Matthieu Herrb).
+ 938. Modify xon to use the fully qualified hostname on Linux (#544,
+ Burchard Steinbild, Dirk Hohndel).
+ 937. Exclude ROPs with no source from XAA CopyPlane functions (#538,
+ David Bateman).
+ 936. Mach32 updates, including accepting '-bpp 15' and increasing the
+ 16bpp clock limit for the 68875 ramdac to 80MHz (#536, Bryan Feir).
+ 935. PC98 doc updates (#535, Takaaki Nomura).
+ 934. Fix for an S3V server problem at 16bpp introduced in change 650
+ (#532, Huver Hu).
+ 933. Further fix for Mystique problems when VT switching (#531,
+ Radoslaw Kapitan).
+ 932. Fix a blit bug with the ViRGE chip in the svga/s3v driver which
+ shows up with xv rubber-banding (#529, Sebastien Marineau).
+ 931. Fix a blank screen problem when switching back to the Xserver
+ from a text VT with the Mystique (#520, Radoslaw Kapitan).
+ 930. Some minor Tseng code cleanups (#519, Koen Gadeyne).
+ 929. Add a timeout to the MGA Sync() function (#518, Radoslaw Kapitan).
+ 928. Map only the amount of video memory present in the MGA driver
+ rather than always 8MB (#516, Radoslaw Kapitan).
+ 927. Disable the HW cursor in the tseng driver when entering DGA mode
+ (#514, Koen Gadeyne).
+ 926. Fix a S3V server text console corruption problem when running at 24bpp
+ (#513, Kevin Brosius).
+ 925. Update NetBSD/OpenBSD docs (#512, Matthieu Herrb).
+ 925. Update Cirrus docs (#509, Harm Hanemaayer).
+ 924. Change Tseng memory mapped registers to volatile (#507, Koen Gadeyne).
+ 923. Disable Tseng 24bpp for CH8398 RAMDAC (#507, Koen Gadeyne).
+ 922. Update docs to reflect change 643 (#507, Koen Gadeyne).
+ 921. Re-enable Tseng 8bpp+linear+accel combination (#507, OEyvind Aabling).
+ 920. Update mga docs (#502, #503, Radoslaw Kapitan).
+ 919. Fix font and LUT corruption on VT switch for the svga/s3v driver
+ (#497, Harald Koenig).
+ 918. Fix some acceleration bugs in the TGUI driver (#495,496, Alan Hourihane).
+ 917. Updates to the I128 server for Alpha platforms (#494, Robin Cutshaw).
+ 916. Fix a Mystique colour problem when switching VTs (#488, Guy Desbief).
+ 915. Fix a bug in Mystique memory detection (2MB was detected as 4MB)
+ (#482, Radoslaw Kapitan).
+ 914. Merge in simple dashed horizontal and vertical line drawing in the
+ S3V server into s3line.c, and use this for 24/32bpp (#474, Huver Hu).
+ 913. Modify the S3V server to advertise a 32 bits-per-pixel pixmap
+ format to clients, and translate to/from packed 24bpp when accessing
+ the framebuffer. This allows a lot of clients which didn't know
+ how to handle the 24 bits-per-pixel pixmap format to work
+ (#474, Huver Hu).
+ 912. Start cleanup of depth/bitPerPixel usage in the SVGA server. xdpyinfo
+ should now report the correct information (#472, Mark Vojkovich).
+ 911. Change chiprounding from 128 to 64 in 8bpp for the Mystique, which
+ allows 1600x1200x8 on 2MB boards (#467, Radoslaw Kapitan).
+ 910. Position the tseng accel scratchpad area correctly (#461, Koen Gadeyne).
+ 909. Fix a problem with the W32 server that causes it to hang with
+ W32i cards (#456, Koen Gadeyne).
+ 908. Save the initial state of bit 7 of CR58 in the S3, S3V servers and
+ svga/s3v driver, and change the "ras_precharge" option to allow it
+ to be turned on or off (#458, Harald Koenig).
+ 907. Enable the clockchip in the tseng driver by default when a suitable
+ RAMDAC/clockchip is found (#448, Koen Gadeyne).
+ 906. Fix text mode restore with ViRGE (#443, Harald Koenig).
+ 905. Add CH8398 probing to XF86_W32 (#439, Kurt Olsen).
+ 904. Add STG1702 probing to XF86_W32 (#434, Stuart Lamble).
+ 903. Fix blitbug widths in SVGA/S3V and S3V servers, enable the hardware
+ cursor in doublescan mode in SVGA/S3V server, fix the 24bpp problem in
+ SVGA/S3V server when mode switching (#432, Sebastien Marineau).
+ 902. Disable 24bpp on the STG1700, new "default" linear memory base for W32p
+ cards, fix STG170x problems (#430 Koen Gadeyne).
+ 901. Add MODULEVENDORSTRING to the ModuleVersionInfo (#423, Stuart Anderson).
+ 900. Finetuning for Miro 80SV support. Add "no_pci_disconnect" Option
+ (for some Alpha boxes, Alphastation255 and UDB) (#416, Harald Koenig).
+ 899. Fix several problems with the tseng driver. Don't allow pixmux modes
+ in the VGA16 or MONO server (it doesn't work), disable the combination
+ 8bpp + linear + acceleration, fix maximal pixel clock for W32p, fix
+ cut'n'paste bug where CRTC 0x31 was restored incorrectly, update the
+ XF86_SVGA manual pages (#414,415, Koen Gadeyne).
+ 898. NetBSD and OpenBSD doc updates (#412, Matthieu Herrb).
+ 897. LynxOS documentation updates (#411,537 Thomas Mueller).
+ 896. LynxOS microSPARC fixes (#410, Thomas Mueller).
+ 895. Small fixes for dacspeed and set_mclk code in the S3V server (#401,
+ Harald Koenig).
+ 894. Fix text mode restauration in S3V server (#400, Harald Koenig).
+ 893. Some misc bug fixes (#395, Harald Koenig).
+ 892. Change clock limits for S3 /DX and /GX chips to 170/170/135 based
+ on information from S3 (#395, Harald Koenig).
+ 891. Add detection and higher clock limits for MELCO S3 ViRGE card
+ (#395, Harald Koenig).
+ 890. Add set_mclk for S3V and S3/Trio64 (#395, Harald Koenig).
+ 889. Add support for specifying DACSpeeds separately for 8/16/24/32bpp
+ (#395, Harald Koenig).
+ 888. Fix module handle leak in LoaderOpen (#393, Eric Nygren).
+ 877. Add Mach8 and 8514 to loader server (#387,394, Hans Nasten).
+ 876. More 68k loader updates (#380, Alan Hourihane).
+ 875. Some updates to the S3 server (#374, Harald Koenig).
+ 874. Fix some hangs on C&T 65550/65554 (#370, David Bateman).
+ 873. Several OS/2 fixes: Add the creation of host.def if not present. Get
+ errno declared correctly. Add missing commandline options (#403,405
+ Holger Veit).
+ 872. Fix a problem in the tseng driver which was causing it to fail at >8bpp
+ with the STG1700 RAMDAC (#594, Koen Gadeyne).
+ 871. Tseng doc updates (#594, Koen Gadeyne).
+ 870. Enable shadow passwords by default for xdm on Linux-Elf.
+ 869. Fix Xrm buffer overflow in Xprint ddx (#591, Kaleb Keithley).
+ 868. Fix for incorrect handling of negative values in cfb (#586, Harald
+ Koenig).
+ 867. Fix for fontserver accessing NULL pointer (#587, Arthur Barstow).
+ 866. A better fix for change 862 (#590, Kaleb Keithley).
+ 865. Fix the incorrect resetting of the HW cursor hotx/hoty values at
+ VT switch in most servers/drivers that support HW cursor
+ (based on #582, OEyvind Aabling, #588, Dejan Ilic).
+ 864. Fix for Xlib/Xt buffer overflows which can be triggered by long
+ $LANG and related environment variables (#576, Alex Belits).
+ 863. Cards db updates (#583, Dirk Hohndel, Harald Koenig).
+ 862. Fix for NULL dereference in XtOpenApplication/XtAppInitialize.
+ This also makes these functions behave as documented (ie, exit
+ when the display open fails).
+ 861. Some man page updates.
+ 860. Refine change 856 to take into account that some forms of 8x8
+ pattern fill only need one scanline in the XAA pixmap cache
+ (#581, David Bateman).
+ 859. Remove some unneeded <locale.h> includes in libXp and XKB (libX11)
+ (#579, 580, Kaleb Keithley).
+ 858. Fix a problem that can cause xfs to crash after running for a while
+ (#578, Arthur Barstow).
+ 857. Fix a problem with xfs that meant it could be killed by interrupting
+ one of its clients (#575, Arthur Barstow).
+ 856. Disable 8x8 pattern fill when less than 8 scanlines are available
+ in the XAA pixmap cache (#566, David Bateman).
+ 855. Fix some sgml problems in fbdev.sgml (#564, Matthieu Herrb).
+ 854. Cards db updates (#548, Koen Gadeyne, #552, Matthieu Herrb,
+ #555, Harald Koenig).
+ 853. Make the TGA server us the same black/white pixel defaults as the
+ others, and make it honour the flippixels flag (#551, Alan Hourihane).
+ 852. Updates for the VGADriverDoc sample stub driver (#546, Harald Koenig).
+ 851. Fix uninitialised variables in xeyes which can cause it to crash
+ on Alpha platforms (#546, Harald Koenig).
+ 850. Fix a problem where XAA calls accel text functions with a ROP that
+ has no source by rechecking the text function when the ROP is changed
+ in the gc (#543, David Bateman).
+ 849. Fix an xterm autoconf problem (#541, Thomas E. Dickey).
+ 848. Add support for ICD2061 programmable clock in the pvga1 driver,
+ as used by Diamond Speedstar 24X cards (#539, Torsten Duwe).
+ 847. Fix XAA cap style problem with thin lines that shows up with the
+ MGA driver (#540, Radoslaw Kapitan).
+ 846. Update the Cards db for ViRGE cards (#534, Sebastien Marineau).
+ 845. PC98 doc updates (#530, Michio "Karl" Jinbo).
+ 844. Implement the Get/SetViewPort() functions in the VidMode extension
+ (these were already documented).
+ 843. Fix some client/server protocol mismatches in some newer VidMode
+ extension functions, and allow new clients to not fail with
+ servers that don't have these fixes. The extension version has
+ been bumped to 0.8.
+ 842. Allow xconsole to handle regular files (it could in our R5-based
+ releases, but this was lost when we moved to R6).
+ 841. Updates of tgetent for terminfo vs termcap for resize (#527,
+ Thomas E. Dickey).
+ 840. Add aixterm-style 16 colour support to xterm (#527, Thomas E. Dickey).
+ 839. Make sure the port number is printed in host byte order in Xserver
+ AUTH warning messages (#525, Marc W. Eichin).
+ 838. Stop xterm from setting the TERMCAP environment variable when
+ using terminfo (#523, Mark W. Eichin).
+ 837. Remove '.' from DefaultUserPath (#517, Per Fogelstrom).
+ 836. Add more ET6000-based cards to the Cards db, and make ET6000 and
+ ET4000w32i/p cards point to the SVGA server instead of the W32 server
+ (#515, Koen Gadeyne).
+ 835. Remove '-m486' from the default gcc options.
+ 834. Add detection of other variants of the Cyber9385 to the trident
+ driver and SuperProbe (Arthur Tateishi and Alan Hourihane).
+ 833. Change the SVGA server to tell DGA clients that the memory available
+ is InfoRec.videoRam rather than ChipLinearSize (which is often
+ too large).
+ 832. Cards db updates (#511, Harm Hanemaayer).
+ 831. Fix LynxOS inconsistent TERMCAP use by xterm and resize ($504,
+ Thomas Mueller).
+ 830. Fix a duplicate declaration in imConv.c that shows up when building
+ without XKB support, and remove a "Const" from the declaration
+ (#505, David A. Koontz).
+ 829. Remove all local symlinks for 'make clean' in lnxLib.rules.
+ 828. Add an autoconf configuration script for xterm. This isn't used
+ in the standard build process, but is useful when building xterm
+ standalone (#500, Thomas E. Dickey).
+ 827. Fix a problem in the RECORD server extension where the last ClientDied
+ is never flushed (#498, Kaleb Keithley).
+ 826. Fix array bounds problem in dixutils.c (#493, Kaleb Keithley).
+ 825. Fix Xserver crash in SHAPE extension (#492, Kaleb Keithley).
+ 824. Fix typos in NetBSD.cf and OpenBSD.cf (#491, Takaaki Nomura).
+ 823. Update sun.cf with the version numbers of more recent Sun ProWorks
+ compilers (#489, William Austin).
+ 822. TOG fix for the lib/X11 -xrm buffer overflow (#487, Kaleb Keithley).
+ 821. XInput doc updates (#486, Frederic Lepied).
+ 820. Fix SuperProbe's memory size detection for the ATI 264VT-B, 264GT-B,
+ 264LT and above, and fix SuperProbe's detection of the 264LT
+ (#481, Marc Aurele La France).
+ 819. New entries for the Monitors db (#478, collected by Andrew Vanderstock).
+ 818. Enable building support for the NetBSD/OpenBSD/Solaris aperture
+ drivers by default.
+ 817. Have postinst.sh optionally install a link in /usr/bin to rstartd.
+ 816. Change the name of the saved ids feature test macro in xterm to
+ be more accurate.
+ 815. Enable colour in the default XTerm app-defaults file, and include
+ the colour-related resources there.
+ 814. Update SOLX86 docs (#477, Matthieu Herrb).
+ 813. Update the Xservers to check for /dev/xsvc before /dev/fbs/aperture
+ on Solaris (#477, Matthieu Herrb).
+ 812. Fix XAA stipple ScreenToScreen colour expansion, and fix a problem
+ with stipples when ONLY_TRANSPARENCY is flagged (#476, David Bateman).
+ 811. Fix Xlib ctstowcs parser mishandling charset escape sequences in
+ COMPOUND_TEXT (#470, Kaleb Keithley).
+ 810. Fix the -ar1 and -ar2 Xserver flags breaking XKB auto-repeat (#469,
+ Kaleb Keithley).
+ 809. Add a backward-compatibility option to disable the recent XtMalloc
+ changes (#468, Kaleb Keithley).
+ 808. Bump the revision number of SuperProbe (#462, Koen Gadeyne).
+ 807. Add ICS5341 and ISC5301 SDAC/Gendac detection to SuperProbe (#462,
+ Koen Gadeyne).
+ 806. Fix negative offsets in pixmap during stipple fill (#460,
+ Radoslaw Kapitan).
+ 805. Fix the layout of the mouse protocol buttons in XF86Setup. XF86Setup
+ now requires Tk version 4.1 or later (#459, Matthieu Herrb).
+ 804. Install rstartd in /usr/X11R6/bin rather than in /usr/bin.
+ 803. Fix a DGA addressing problem in the S3 server (#457, Mark Vojkovich).
+ 802. Remove the part of the PCI config-type detection that seems to switch
+ some Neptune-based machines from type 1 to type 2.
+ 801. xtest update for OpenBSD (#455, Matthieu Herrb).
+ 800. Only show Xinput initialisation messages once (#454, Matthieu Herrb).
+ 799. Add support for the IntelliMouse protocol to xf86config and XF86Setup.
+ 798. Fix a problem in the Xservers where the DPMS timer code can cause
+ select() can get called with a negative timeout value (and get stuck
+ in an infinite loop) (#453, Van Jacobson).
+ 797. OS/2 updates (including docs) (#452, Holger Veit).
+ 796. Doc updates (#450, Matthieu Herrb).
+ 795. Fix the trident driver to make virtual resolutions work for the
+ TGUI96xx/Cyber chips and make 32bpp available to these chips too.
+ Also, update the clock code for these chips to allow higher
+ resolutions (#386, Alan Hourihane).
+ 794. Disable the svga/s3v register dumps except for xf86Verbose > 1.
+ 793. Fix the svga/s3v driver Probe() to not falsely assume a ViRGE card
+ is present in some circumstances.
+ 792. Add some new entries for the ServerFlags section to allow some
+ control of the code used to determine the PCI config type on
+ Intel platforms.
+ 791. Fix handling of the "line" parameter for the scroll-forw/scroll-back
+ actions in xterm, and add entries to the XTerm app-defaults to
+ use buttons 4 and 5 (as generated by the wheel on the IntelliMouse)
+ for scrolling.
+ 790. Add debugging messages to the PCI probe code. These are enabled
+ when xf86Verbose > 2. Also, try scanpci's method of detecting PCI
+ config type 1 when the other method fails.
+ 789. Fix DeviceButtonMotion (#437, George Sachs).
+ 788. Fix for SuperProbe dumping core on NetBSD (#433, Matthieu Herrb).
+ 787. Fix fbdev.c and update documentation (#428, Geert Uytterhoeven).
+ 786. mga/README updates (#419, Radoslaw Kapitan, #431, Guy Desbief).
+ 785. xtest fixes, and updates for Linux (Harald Koenig).
+ 784. MGA doc updates (#447, Guy Desbief).
+ 783. Fix the Xt TopLevelShell's XtNiconic resource (Sekhar Makkapati).
+ 782. Tseng doc updates (#445, Koen Gadeyne).
+ 781. Tseng doc updates (#421, Harald Nordgard Hansen).
+ 780. Change the behaviour of XtMalloc, XtCalloc and XtRealloc when
+ Malloc0ReturnsNull is set to YES so that they conform to the
+ Xt spec (#444, Kaleb Keithley).
+ 779. Fix for buffer overflows in libX11's GetDatabase(). This can be
+ used to exploit setuid programs linked against libX11
+ (#442, Harald Nordgard Hansen).
+ 778. Doc updates (#441, Takaaki Nomura).
+ 777. Doc updates (#440, Thomas Mueller).
+ 776. Modify some messages in the svga/s3v driver (#443, Harald Koenig).
+ 775. Undo change 623; the post dividers were incorrect (#435, Marc Aurele
+ La France).
+ 774. Move the Tk/Tcl include dirs after all the others in the XF86Setup
+ Imakefile to make sure they don't cause installed X headers to be
+ incorrectly used.
+ 773. Add CH8398 RAMDAC detection to SuperProbe (#418, Kurt Olsen).
+ 772. Fix an error in xterm's vt220 emulation: the DECUDK is only supposed
+ to be interpreted for _shifted_ function keys (#384, Thomas E. Dickey).
+ 771. Patch to GLX comment/example in xf86site.def (#409, Henry Worth).
+ 770. Improve handling of screen pitch for accelerated C&T driver (#407,
+ David Bateman).
+ 769. Add support for the Miro 80SV to the S3 server (#406, Harald Koenig).
+ 768. Fix bmtoa, smproxy, twm, xsm and Xprint to use mkstemp, if available,
+ to avoid the mktemp() race condition (#404, Matthieu Herrb).
+ 767. Several updates XInput: Add always core feature to mouse driver. Add zone
+ configuration for the wacom driver (TopX, TopY, BottomX, BottomY). Add
+ KeepShape option for the wacom to respect the ratio of width/height
+ |of the screen. Add multiple active zones on the same tablet. Add
+ checks not to send core button events when multiple devices control the
+ core pointer. Fix problem in the mouse driver not sending the button id
+ in extended events. (#402, Frederic Lepied).
+ 766. More modes for xf86config and XF86Setup database (#397, Koen Gadeyne).
+ 765. Fix name of GLX stub library (#389, Henry Worth).
+ 764. Renumber option flag definitions to allow more space in the various
+ categories.
+ 763. Fix problems with DGA on 4/8MB Millenniums (#390, Radoslaw Kapitan).
+ 762. Fix Mystique display problems and dim text font after exit problems
+ (#378,379, Guy Desbief).
+ 761. Rewrite clock restoring procedure for mga driver (#385, Radoslaw Kapitan).
+ 760. More modes for XF86Setup database (#372, Koen Gadeyne).
+ 759. Fix typos in NetBSD.cf (#363, Takaaki Nomura).
+ 758. Add a ModuleInit function to libxaa.a (#362, J. Kean Johnston).
+ 757. Fix a NULL dereference in xf86Config.c on OSs that don't support
+ dlopen() loading for the static servers (#361, Thomas Mueller).
+ 756. Fix a problem with references to the GLX stub libraries in
+ Xserver/Imakefile that affects building static servers
+ (#361, Thomas Mueller).
+ 755. Allow most of the extensions in Xext to be dynamically loaded (in
+ a single module) (#360, Matthieu Herrb).
+ 754. Allow the DBE extension to be dynamically loaded (#359, Matthieu Herrb).
+
+XFree86 3.9b (4 May 1997)
+ 753. Add BuildPC98Servers as an easy way to enable/disable building
+ all PC98 servers.
+ 752. Build Xvfb by default to help pick up build problems.
+ 751. Make 'makedepend' understand '-U' on the command line.
+ 750. Some fix-trackers from TOG, includes:
+ lib/Xi: missing error message (#352 -- we already had this fix)
+ lib/X11: long font paths can garbage heap (#353)
+ fix potential memory leak in xinput ProcXGetDeviceMotionEvents (#354)
+ fix unmatched quotes in comments (and other stuff?!?) (#355)
+ config updates (#356)
+ lib/X11: when IMS dies the library closes all open IMs (#357)
+ lib/X11: When doing XSetICValues and IMS returns ERROR, library core
+ dump (#358).
+ 749. Clean up the GLX for the static-linked servers (#351, Henry Worth).
+ 748. Fix SCO Open Server build problem (#348, J. Kean Johnston).
+ 747. Add an option to allow VClk1 to be used as the programmable clock
+ with C&T 65550 and 65554 chips (#346 Daniel Bischof, Andreas Heitmann
+ and Thomas Landgraf).
+ 746. Remove trailing ',' at the end of InfoRec initialisations, which
+ was hiding potential compiler warnings (#343, Koen Gadeyne).
+ 745. Replace the ChipClockScaleFactor field with ChipClockMulFactor and
+ ChipClockDivFactor to allow for non-integer factors required in
+ some cases (#343, Koen Gadeyne).
+ 744. Fix some 'make' problems that show up on NetBSD and OpenBSD, and clean
+ up BSD 4.4 -specific make stuff in the config/cf directory
+ (#342, #344, Matthieu Herrb).
+ 743. Add better error/warning messages for the aperture driver code for
+ NetBSD/OpenBSD (#341, Matthieu Herrb).
+ 742. Block choosing interleave mode for the Mystique, and set maxPixelClock
+ for the Mystique (#338, Radoslaw Kapitan).
+ 741. Add ability to set MCLK for the mga driver in XF86Config (#338, #339,
+ Radoslaw Kapitan).
+ 740. Fix some problems with XAA DELAYED_SYNC and the software cursor and
+ backing store -- new wrappers are added (#337, Sebastien Marineau).
+ 739. Re-enable HW cursor for Millennium, and implement looping over
+ MGAIdent when checking the Chipset (#336, Radoslaw Kapitan).
+ 738. Remove some assumptions about burst modes from the C&T ImageWrite
+ function (#335, David Bateman).
+ 737. Matrox Mystique driver support, which should work fine with
+ acceleration disabled (#334, Guy Desbief).
+ 736. Fix for double-height MGA hw cursor when using interlaced modes
+ (#333, Radoslaw Kapitan).
+ 735. Explicit syncing of the blitter at the end of the C&T XAA primitives
+ is no longer needed since delayed syncing is off by default
+ (#332, David Bateman).
+ 734. Use the source pitch for colour CPU to screen operations in the C&T
+ driver (#332, David Bateman).
+ 733. Fix writing the 16bpp planemask to the chip in the C&T driver
+ (#332, David Bateman).
+ 732. Stop reserving 1kb of video memory when the accelerator is disabled
+ for the Tseng driver (#331, Stuart Lamble).
+ 731. Fix Trident 96xx/Cyber series for snow on the screen and fix
+ acceleration issues (#330, #349, Alan Hourihane).
+ 730. C&T doc updates (#329, David Bateman).
+ 729. Fix a bitblt bug for 8bpp, widths 49..56 in the s3v driver (#328,
+ Sebastien Marineau).
+ 728. Add filled trapezoid support to the s3v driver (#328,
+ Sebastien Marineau).
+ 727. Add caching of often-used ViRGE registers (#328, Sebastien Marineau).
+ 726. Add hw cursor support for the SVGA s3v driver (#328, Sebastien Marineau).
+ 725. Add a new kind of XAA pixmap cache slot which is used to hold mono
+ 8x8 patterns for chips which have PROGRAMMED_BITS (#327,
+ Sebastien Marineau).
+ 724. Fix XAA pixmap cache invalidation after a VT switch (#327,
+ Sebastien Marineau).
+ 723. Fix lockup problem in SVGA s3v driver, and some cleanups (#326,
+ Harald Koenig).
+ 722. Fix MGA hw cursor not displaying after switching resolutions
+ (#325, Radoslaw Kapitan).
+ 721. Fix text colour problems for ViRGE/VX, a rectfill and bitblt bug
+ for virtual width == 2048, and avoid some more bad hardware lines in
+ the S3V server (#324, Harald Koenig).
+ 720. Move chipset independent hw-cursor stub from mga_dac3026.c to
+ mga_hwcurs.c (#322, Radoslaw Kapitan).
+ 719. Fix a build problem in osPexFont.c, and add a ModuleInit function
+ for libxf86cache.a (#321, Michael Rohleder).
+ 718. Fix a 32bpp Millennium DAC initialisation typo (#318, Radoslaw Kapitan).
+ 717. Loader support for m68k (#317, #323, Alan Hourihane).
+ 716. Fix copyright and remove RCS idents in xf86_ldext.h (#316,
+ Matthieu Herrb).
+ 715. Fix some NonTE text problems, and back out change #690 (#315,
+ David Bateman).
+ 714. Add initialisation of GlxInitVisualsPtr to loadmod.c (#313, Henry Worth).
+ 713. Don't build libX11 for BuildServers only unless building the Xnest
+ server (#312, Marc Aurele La France).
+ 712. Remove extraneous line in xf86text.c (#311, Harald Nordgard Hansen).
+ 711. Restore changes accidentally backed out of xfree86.cf in 3.9a
+ (includes #310, #313, #320, #326).
+ 710. Open /dev/tty0 instead of /dev/console on Linux to find the first
+ free VT.
+
+XFree86 3.9a (17 April 1997)
+ 709. Add delayed syncing as an optional flag for XAA. This is now
+ currently enabled only in the S3 driver (#308, Mark Vojkovich).
+ 708. Several fixes to TE and NonTE fonts. The server now passes CH06
+ drwimgstr, drwimgst16, drwstr, drwstr16, drwtxt and drwtxt16 xtest tests
+ (#305,307, Sebastien Marineau).
+ 707. Add Latin2 Type1 fonts (Peter Soos).
+ 706. Add Latin2 bdf fonts (Petr Kolar).
+ 705. Add SubsequentDashedTwoPointLine to XAA (#296, Mark Vojkovich).
+ 704. Add a Hungarian XKB symbols file (Peter Soos).
+ 703. Add support for Microsoft Intellimouse (#304, Thomas Vogler).
+ 702. Add ViRGE/VX support to SVGA/S3V server; this isn't really working, yet
+ (#299,301, Harald Koenig).
+ 701. Add memory, FIFO, and PCI retry options to SVGA/S3V server (#293,300,
+ Sebastien Marineau).
+ 700. Add support for 15bpp and 32bpp to SVGA/S3V server. 32bpp only with
+ very limited acceleration (#293,300, Sebastien Marineau).
+ 699. Only build libX11 while doing BuildServersOnly if Xnest is enabled (295,
+ Harald Koenig).
+ 698. Disable color expansion with planemask at 24bpp in chips driver (#303,
+ David Bateman).
+ 697. Fix small bug in SVGA/S3 dash line code (#302, Mark Vojkovich).
+ 696. Allow trident 96xx chips to restore text mode (#298, Alan Hourihane).
+ 695. Fix virtual resolutions for trident driver at 24bpp (#298, Massimiliano
+ Ghilardi).
+ 694. TGUI driver updates for PC98 (#297, Akio Morita)
+ 693. Fix building PC98 modules, resync PC98 Imakefile (#297, Takaaki Nomura).
+ 692. Fix ch8398 ramdac command byte for 8bpp in tseng driver (#294,
+ Krajcsovits Gyorgy).
+ 691. Fix NonTE fonts in XAA (#292,309 David Bateman).
+ 690. Disable XAA matchcommon logic to fix problem with grayed out fonts
+ (#291, David Bateman).
+ 689. Fix sis driver for 8x8 color expand pattern fill pattern flags and XAA's
+ new synching policy (#290, Xavier Ducoin).
+ 688. LynxOS updates (#289, Thomas Mueller).
+ 687. Enable 1bpp and 4bpp for the chips driver (#288, David Bateman).
+ 686. Jump version number to document that this is the branch working towards
+ XFree86-4.0.
+
+XFree86 3.2At (14 April 1997)
+ 685. Fix ImageText fallback (#287, David Bateman).
+ 684. Some fixes for NonTE text. Add FixedBase support. Add TRIPLE_BITS24BPP
+ support. Fix CPU_TRANSFER_PAD_QWORD problem. Fix possible loss of a few
+ pixels at the end of NonTE text strings (#286, David Bateman).
+ 683. Fix compile problem with USL compiler (#283, David Bateman).
+ 682. Updates to mga_reg.h for Mystique (Guy Desbief).
+ 681. Add ATT20C49x RAMDAC support for 16 and 24bpp modes to tseng driver.
+ Make ET6000 hardware cursor use closest available color instead of
+ refusing to change colors when it can't find an exact match. Fix
+ another W32i linear mode bug. Change ET6000 pixel clock limits as per
+ Tseng's recommendations (=much lower than we had before). fix a BUG in
+ the ET4000 "standard set-of-clocks" code. Use ChipClockScaleFactor.
+ (#282, Koen Gadeyne).
+ 680. Fix and re-enable 8x8 pattern color expansion (!=24bpp) for Alpine cards
+ Fix CPUToScreen color expansion for 24bpp mode, fix determining the BG
+ color in 24bpp color expansion routines (#281,285, Corin Anderson).
+ 679. Various Cirrus fixes and additions. Fix HAVE_546X() macro for Laguna
+ support. Add support for CL-GD5480. Disable Alpine XAA color expansion
+ code. Fix 32bpp Alpine mode bug. Overload {slow,med,fast}_dram options
+ to set Rambus BCLK on Laguna chips. Remove Sync()'s in laguna_acl.c.
+ Removed unnecessary, dead, and/or dumb code in cir_driver.c. Add clock
+ values for 150MHz through 229MHz dot clocks. Set clock limits correctly
+ for Laguna chips. (#280, Corey Anderson).
+ 678. Fix problem in xf86gcmisc.c that could cause a segfault (#279,
+ Mark Vojkovich).
+ 677. Fix problems with NonTE text in XAA (#278, David Bateman).
+ 676. Fix loader under SVR4.0.4 (lstat,fstat,mknod)(#277, Richard Coley).
+ 675. Speedups for dashed lines in SVGA/S3 (#276, Mark Vojkovich).
+ 674. Allow building Xnest with BuildServersOnly (#275, Marc Aurele La France).
+ 673. Fix vga16 and banked vga2 without also breaking either of the loader or
+ static servers. Remove obsolete directories and other extraneous junk.
+ Remove mi's dependence on mfb. LoaderFixups is no longer needed. Add
+ xf86InitViewport to the symbol table. Combine vga2/mfb & vga2/mfb.banked.
+ (#274 Marc Aurele La France).
+ 672. More layout cleanups in matrox driver (#273, Radek Kapitan).
+ 671. Fix LinkKit to build loader (#272, Takaaki Nomura).
+ 670. Fix some Alpha problems (#270, Robin Cutshaw).
+ 669. Add MemClk field to all drivers (#270,271 Robin Cutshaw, Sebastien
+ Marineau).
+ 668. Fix server crashes in C&T driver caused by delayed syncing (#269, David
+ Bateman).
+ 667. Fix problems with PEX modules (#268, Takaaki Nomura).
+ 666. Fix some problems in XAA benchmarks and Trident Cyber support (#266,267,
+ Alan Hourihane).
+ 665. Add Mystique to scanpci (#264, Guy Desbief).
+ 664. Fix problems with delayed syncing (#263, Mark Vojkovich).
+ 663. Fix LinkKit and cirrus driver (#262, Takaaki Nomura).
+ 662. Fix I18N bug (#261, Nagao Tadaaki).
+ 661. First steps to get loader on SCO (#260, J. Kean Johnston).
+ 660. File structure changes for mga driver (#259, Radek Kapitan).
+ 659. Add stubs to load GLX extension (#228,246, Henry Worth, Dirk Hohndel).
+
+XFree86 3.2As (09 April 1997)
+ 658. Several fixes and enhancements for the cirrus driver. Fix the crash that
+ showed up in 3.2A with MMIO on some chips at 16bpp. Enable the 8x8
+ pattern fill code for different chips. Reorganize the BitBLT feature
+ checks in the accelerated driver, and make it compatible with the new
+ delayed syncing in XAA.Fix the > 85 MHz dot clock mode on the
+ CL-GD5436/46. Detect all DRAM configurations that are possible on the
+ CL-GD5446. Add code to handle the 7555 (no detection).
+ (#258, Harm Hanemaayer).
+ 657. Fix Bresenham line bug in trident/9440 driver (#257, Alan Hourihane).
+ 656. Add trapezoid acceleration to tseng driver (disabled), disable W32 hw
+ cursor, remove redundant warning message about "Wrong Cursor Color Tried"
+ (#256, Koen Gadeyne).
+ 655. Add mga dashed lines (#255, Andrew Vanderstock).
+ 654. Add more flexible way of loading and initializing extensions (#253,
+ Matthieu Herrb).
+ 653. Fix bugs in the S3V server concerning rectfill with scan line width of
+ 2048 and with lines (#251,252, Harald Koenig).
+ 652. Add option "set_memclk" (#249, Sebastien Marineau).
+ 651. Fix hangs in svga/s3v server, fix some bugs, add planemask support to
+ most accelerated primitives and start accelerated lines (#249, Sebastien
+ Marineau).
+ 650. Fix XAA to force ROP to GXcopy for XDrawImageString (#249, Sebastien
+ Marineau).
+ 649. Change "unsigned long" to CARD32 in dashed line support (#248,
+ Mark Vojkovich).
+ 648. Add Matrox Mystique to vgaPCI.h (Guy Desbief).
+ 647. Fix building XF98_EGC (#247, Takaaki Nomura).
+ 646. Fix some problems with delayed syncing in the C&T driver (#245, David
+ Bateman).
+ 645. Add dashed line support for SVGA/S3 (#243, Mark Vojkovich).
+ 644. Add dashed line support for XAA (#242,244, Mark Vojkovich).
+ 643. Fix some fill problems in S3V server (#241, Harald Koenig).
+ 642. Several fixes to C&T driver that rearrange code in XAA FillRect code to
+ work around bug in HW cursor, add ImageWrite function, use the 8x8
+ pattern where possible to simulate a planemask, add preliminary support
+ for vga2 and vga16 and temporary fix for Syncing problems in new XAA code
+ (#239, David Bateman).
+ 641. Further LinkKit changes (#238, Takaaki Nomura).
+ 640. Small fix for LinkKit (#237, David Bateman).
+ 639. Fix twm double-frees (#236, John Hawkinson).
+ 638. Include missing patch for change 601.
+ 637. Update Compaq vgaVideoChipRec (1bpp,4bpp,15bpp,32bpp) (#234, Gerry Toll).
+ 636. Fix Linkkit (#233, Takaaki Nomura).
+ 635. Fix broken console restore for 4bpp driver (#232, Marc Aurele La France).
+ 634. Add S3 chipset override code to SVGA/S3 server (#231, Harald Koenig).
+ 633. Start converting XF86Setup to use the loader (#230, Joe Moss).
+ 632. Correct DCLK limits for S3V server (#229, Harald Koenig).
+ 631. Add STG1702 to SuperProbe (#227, Stuart Lamble).
+ 630. Small fix for syncing in XAA color expansion (#225, Mark Vojkovich).
+ 629. Resync PC98 server (#224, Takaaki Nomura).
+ 628. Add stg1702 auto probing to the tseng driver (#223,#226, Stuart Lamble).
+ 627. Fix 4bpp for PC98 (#222, Takaaki Nomura).
+
+XFree86 3.2Ar (28 March 1997)
+ 626. Remove the old driver subdirectories.
+ 625. Fix setting of CRTC[22] on VGA compatibles (#220, Marc Aurele La France).
+ 624. Fix vga16 & banked vga2; don't remap *fb's endtab. Use the correct
+ banking functions, displayWidth handling (#219, Marc Aurele La France).
+ 623. Change Mach64 to use the known extended post-divider setting on the
+ 3D Rage II (#218, Marc Aurele La France).
+ 622. Lots of changes to the SVGA/ATI driver, including 3D Rage II support,
+ memory type detection (#217, Marc Aurele La France).
+ 621. Clean up internal allocator a bit, and make it log more information
+ (when enabled) (#216, Marc Aurele La France).
+ 620. Fix misuse of UseInstalled in the .cf files for BSD derivatives.
+ Make LinkKit use the same default CCOPTIONS as the main build.
+ Remove redundancy in svr4.cf (#215, Marc Aurele La France).
+ 619. Add newer ATI chipsets to SuperProbe (#214, Marc Aurele La France).
+ 618. Fix color expansion and pixmap cache in trident driver (#212,213,
+ Alan Hourihane).
+ 617. Change XAA to delay syncing (#211, Mark Vojkovich).
+ 616. Fix OS/2 naming problem in Xserver Imakefile and XAA 8x8 pattern
+ rotations and flag checking inconsistency (#210, Sebastien Marineau).
+ 615. Add SVGA/S3V driver (#210, Sebastien Marineau).
+ 614. Add Sigma Designs REALMagic to SuperProbe (#209, Harald Koenig).
+ 613. Merge Trio64V2/Aurora64V+/PLATO changes into S3/SVGA driver (#208,
+ Harald Koenig).
+ 612. Fix building XF98_EGC (#207, Takaaki Nomura).
+ 611. Add ImageWrite to s3/svga and prepare driver for upcoming XAA changes;
+ the s3/svga server no longer does cursor blocking, users of Xqueue
+ might have to use the Option "sw_cursor" (#206, Mark Vojkovich).
+ 610. Fix 8 bit DAC handling in SVGA server (#205, Mark Vojkovich).
+ 609. Add better support for linear memory on W32i cards (#204, Koen Gadeyne).
+ 608. Add HORIZONTAL_TWOPOINTLINE to XAA (#203, Alan Hourihane).
+ 607. Add autoloading of libxf86cache to Mach32 & Mach64 server and compile
+ ServerInit() and ModuleInit() only for the LOADER (#202, Takaaki Nomura).
+ 606. Add support for Cirrus CL-GD5464BD, CL-GD5465 (#201, Corin Anderson).
+ 605. Documentation updates and improved memory bandwidth handling in tseng
+ driver (#200, Koen Gadeyne).
+ 604. ViRGE/DX support for S3V server (#199, Harald Koenig).
+ 603. Some fixes to Trio64V+ & Trio64V2 (#198, Harald Koenig).
+ 602. Recognize 1MB on ViRGE (using an illegal setting) (Alan Hourihane).
+ 601. Fix and enhance handling of unresolved symbols in loader (#196, Harald
+ Koenig).
+ 600. Fixes and Additions for XF86Setup (#194,195, Joe Moss).
+ 599. Fix SuperProbe for W32 chipsets (#191, Koen Gadeyne).
+ 598. Fix building the static S3 server (#188-190, Harald Koenig).
+ 597. Fix undefined symbols in the pex5 module (#187, Matthieu Herrb).
+ 596. Fix autoloading modules in the S3 server for PC98 (#186,197 Takaaki
+ Nomura).
+
+XFree86 3.2Aq (23 March 1997)
+ 595. Fix building static XF86_S3 (#185, Harald Koenig).
+ 594. Enable loader on OpenBSD (#184, Matthieu Herrb).
+ 593. Add missing files for NV1 (change 591).
+
+XFree86 3.2Ap (22 March 1997)
+ 592. Fix screen problems with C&T at 24bpp (#182, Nozomi Ytow).
+ 591. Add NV1 acceleration (#181, David McKay).
+ 590. Add Trio64V2 170/110/60MHz support to S3 server (#180, Harald Koenig).
+ 589. Automagic loading of modules for old S3 server (#178,179 Harald Koenig).
+ 588. Automagic loading of modules for PC98 servers (#177, Takaaki Nomura).
+ 587. Fixes to blitter and hw cursor handling in C&T driver (#176, David
+ Bateman, Egbert Eich).
+ 586. Add Elsa handling to S3/SVGA and Trio64V2/DX/GX, ViRGE/DX/GX and PLATO/PX
+ to SuperProbe, scanpci, S3, S3V and S3/SVGA servers (#174,175,
+ Harald Koenig).
+ 585. Build fix for Xprt, Xnest and Xvfb (#172, Takaaki Nomura).
+
+XFree86 3.2Ao (18 March 1997)
+ 584. Fix/add IBM RGB528 support and add ELSA eeprom detection (only
+ for IBM ramdacs right now) (#170, Harald Koenig).
+ 583. Fix linking problem of XF86_LOADER for Linux/a.out (#170,171, Harald
+ Koenig, Xavier Ducoin)
+ 582. Fix several problems with loader and static server that were caused
+ by change 567 (Dirk Hohndel).
+ 581. Fix bad 400x300 mode line (#165, Koen Gadeyne).
+ 580. Finer W32 chipset detection (#165, Koen Gadeyne).
+ 579. Tseng documentation updates (#165, Koen Gadeyne).
+ 578. Fix unresolved strlen in PEX and XIE (#164, Takaaki Nomura).
+ 577. Fix changes of NEC480 to PEGC (#163, Michio "Karl" Jinbo).
+ 576. Fix building of XF98_LOADER (#163,169, Michio "Karl" Jinbo,
+ Takaaki Nomura).
+ 575. Fix building of normal X servers for PC98 (#163, Takaaki Nomura).
+ 574. Fix building P9000 module (#160, Takaaki Nomura).
+ 573. Add S3/SVGA color expansion (#161, Mark Vojkovich).
+ 572. Fix problems with "dac_8_bit" in svga server (#159, Mark Vojkovich).
+ 571. Fix ET6000 hardware cursor (#158, Harald Nordgard Hansen).
+ 570. Changes to NetBSD + BSD Elf library configuration (#157, Chris G.
+ Demetriou).
+ 569. Fix for the SVGA/S3 hardware cursor (Xavier Ducoin).
+
+XFree86 3.2An (15 March 1997)
+ 568. Build fixes in order to get a clean compile on Linux and FreeBSD
+ (not for PC98, though). The servers still don't work quite as
+ they should.
+
+XFree86 3.2Am (12 March 1997)
+ 567. First attempt to get a universal SVGA server that statically links
+ in all drivers except those from the accel directory. Links ok and
+ seems to work at >=8bpp, but has bit ordering problems for 1,4bpp.
+ (David Dawes, Dirk Hohndel).
+ 566. Fixes for Trident Cyber chipsets (#154,155, Alan Hourihane).
+ 565. Fixes for OS/2 (more IHaveModules and drive letters in ModulePath),
+ get Mach64 to work again (#153, Holger Veit).
+ 564. Cleanups and improvements to tseng hw cursor code (#152, Koen Gadeyne,
+ Harald Nordgard Hansen).
+ 563. Add pci_retry option to tseng driver (#151, Dejan Ilic).
+ 562. Change NEC480 to PEGC, resync of SuperProbe/Imakefile (#150, Takaaki
+ Nomura).
+ 561. Add hardware cursor to MGA driver (#149, Xavier Ducoin).
+ 560. Make tseng driver handle 1/4/8bpp at runtime (#145, Koen Gadeyne).
+ 559. Make apm driver loadable (#146, Joe Moss).
+ 558. Fix some cross compilation problem for XAA on OS/2 (#144, Sebastien
+ Marineau).
+ 557. Fix some 24bpp problems for ViRGE and cfb (#144, Sebastien Marineau).
+ 556. Move cursor area to top of vidmem for ViRGE (#144, Sebastien Marineau).
+ 555. Really fix mono/Imakefile and fix PEX struct dirent problem (#143,
+ Matthieu Herrb).
+ 554. Add handling for S3-style 8x8 pattern fill to XAA; fix s3/svga
+ accordingly (#141, Mark Vojkovich).
+ 553. Fix OS/2 problems; disable cross compiling Xprt, Xvfb, Xnest (#140,
+ Holger Veit).
+ 552. Include some fix trackers, fixing problems with sunLib.tmpl, hp.cf,
+ memory leak in xdm: xdmcp.c manage(), Imake.rules, zlib 1.0.4, AltGR
+ not working in Xlib (#131,132,135-139).
+ 551. Reapply change 536 for the new drivers (#130, Mark Vojkovich).
+ 550. Enable loader for NetBSD and fix a few typos (#127-129, Takaaki Nomura).
+
+XFree86 3.2Al ( 7 March 1997)
+ 549. Fix a.out loader for FreeBSD (#126, Takaaki Nomura).
+ 548. Add the BT-848 to scanpci (#121, Dejan Ilic).
+ 547. Change the way dynamic loading of vga2. vga16, vga256 modules is done
+ (just one module per driver for all color depths, all the drivers are
+ moved to xfree86/drivers) (#122-124, Alan Hourihane, Dirk Hohndel).
+ 546. Add support for 3DLabs GLINT chipsets to scanpci and SuperProbe, start
+ working on a 2D server for Elsa Gloria L (Dirk Hohndel, Stefan Dirsch).
+
+XFree86 3.2Ak ( 4 March 1997)
+ 545. Make Mono drivers loadable and clean up some of XF86_LOADER; this
+ change replaces some of the things done in change 537 (#119, H.J. Lu).
+ 544. Fix char alignment in COFF loader as well (#120, Thomas Mueller).
+ 543. Fix short alignment in COFF loader and add missing entry to SYMENT
+ (#118, Michael Rohleder).
+ 542. Build fix for libc_wrapper.c on ISC (#117, Michael Rohleder).
+ 541. Add Module Version to Mach32 server (#117, Michael Rohleder).
+ 540. Add smarter handling of unresolved symbols in the loader (#116,
+ Sebastien Marineau).
+ 539. Fix problem in OS/2 loader (#115, Sebastien Marineau).
+ 538. Add module versioning and auto loading to S3V server (#114, Sebastien
+ Marineau).
+ 537. Change name of Screen Section to "XFree86".
+ 536. Set correct clipping rectangle for SVGA/S3 (#112, Mark Vojkovich).
+ 535. Fix a problem in trapezoid solid fill code (not sure if this fixes
+ the problems that caused change 533 to be disabled) (#110,
+ Mark Vojkovich).
+ 534. Add 'Doublescan' support to MGA driver (#109, Radoslaw Kapitan).
+ 533. Add trapezoid solid fill acceleration to MGA driver; disabled as it
+ doesn't draw correctly at this point (#109, Radoslaw Kapitan).
+ 532. Remove MgaAccelSwitch (#108, Radoslaw Kapitan).
+ 531. Improve SolidFill speed on C&T65545/6/8 (#107, Nozomi Ytow).
+ 530. Fix libc_wrapper.c build problem on SVR4 (#106, Takaaki Nomura).
+ 529. Fix VGA16 driver (#105, Thomas Mueller).
+ 528. Fix Compaq AVGA driver (#104, Ming Yu, Joseph Pfeiffer, Gerry Toll).
+ 527. Add more comments to MGA driver (#103, Radoslaw Kapitan).
+
+XFree86 3.2Aj (28 February 1997)
+ 526. Various build fixes for FreeBSD, NetBSD, Linux, Solaris (Dirk Hohndel).
+ 525. Fixes for OS/2 loader and ar code (#100, Sebastien Marineau).
+ 524. Updates to S3/SVGA driver (#99, Mark Vojkovich).
+ 523. Add SubsequentFillTrapezoidSolid to XAA (#99, Mark Vojkovich).
+ 522. First stab at getting VGA16 as loadable module; doesn't work, yet
+ (Dirk Hohndel).
+ 521. Add Mystique register definitions (#98, Guy Desbief).
+ 520. Fix unresolved symbols with loadable ati driver (#96, Thomas Mueller).
+ 519. Add module versioning (#97, Holger Veit).
+ 518. LynxOS doesn't have vfscanf (#95, Thomas Mueller).
+ 517. Fix 499 was missing. It is now included.
+ 516. Remove bogus code in xf86frect.c (#93, Harm Hanemaayer, Harald Nordgard
+ Hansen).
+ 515. Build fixes for FreeBSD (#92, Takaaki Nomura).
+ 514. Restructure RAMDAC handling in tseng driver and add 16/24bpp support
+ for STG1703 (#91, Koen Gadeyne).
+ 513. Tseng HW cursor state save/restore (#91, Dejan Ilic).
+ 512. Disable HW cursor on et4000 (#91, Koen Gadeyne).
+ 511. Fix et6000 memory probing (#91, Koen Gadeyne).
+ 510. Fix handling of PCI probe in the tseng driver (#91, Koen Gadeyne).
+ 509. Fix "double-magic" in libc_wrapper.c (#90, Holger Veit).
+ 508. Fix for ET6000 HW cursor (#89, Harald Nordgard Hansen).
+ 507. Fixes to MGA driver: remove "nolinear", allow overriding MMIO address
+ as IoBase in XF86Config, remove obsolete files (#88, Radoslaw Kapitan).
+
+XFree86 3.2Ai (25 February 1997)
+ 506. Fix libc_wrapper.c for LynxOS, where stdin/out/err isn't a valid
+ initializer (#87, Thomas Mueller).
+ 505. Updates to SiS driver: fix setting MemBase, allow some XAA functions
+ in 8bpp even without linear mode, support DPMS (#86, Xavier Ducoin).
+ 504. Disable the stream display fetch length control for Trio64V2
+ (#85, Xavier Ducoin).
+ 503. Update SuperProbe for sis86c202 and sis86c205 (#84, Xavier Ducoin).
+ 502. Allow ModulePath to have multiple elements; use heuristic to find the
+ module if only part of the exact filename is specified; allow subdirs
+ of the module directory to be searched (Dirk Hohndel).
+ 501. Change loader code so that ModuleInit is a magic function name that
+ indicates the init function for a module. ServerInit now is the function
+ used to get the initial ScrnInfoRec; change all modules to follow these
+ naming conventions (Dirk Hohndel).
+ 500. Fix missing fsetpos/fgetpos in ISC (#78, Michael Rohleder).
+ 499. Fix elfloader to recognize .data1 and .rodata1 sections
+ (#82, Steve Forsythe).
+ 498. Add readdir family of functions to libc_wrapper (#81, Holger Veit).
+ 497. Add crosscompilation support for OS/2 (#81, Holger Veit).
+ 496. Add loadable module support for P9000 (#80, Erik Nygren).
+ 495. Fix error message in loader (#79, Matthieu Herrb).
+ 494. Workaround for a bug in 68k GNU binutils (#77, Geert Uytterhoeven).
+ 493. Add new xf86_libc.h to make porting to the new style loader
+ architecture easier. Adapt PEX5 using the new header file (Dirk Hohndel).
+ 492. Fixes for a.out loader (#74-76, Matthieu Herrb).
+ 491. More fixes for libc_wrapper.c (#73, Michael Rohleder).
+
+XFree86 3.2Ah (23 February 1997)
+ 490. Some a.out loader updates for Linux/a.out (#72, Harald Koenig).
+ 489. Add support for cross compilation of modules in the Imake rules
+ (#71, Holger Veit).
+ 488. Add a subset of xf86stdio functions to libc_wrapper.c (#71, Holger Veit).
+ 487. Make the I128 driver loadable (#65,66,70, Robin Cutshaw).
+ 486. Fix et4000 driver compile problems for vga2 and vga16
+ (#69, Koen Gadeyne).
+ 485. Fix 8x8 patterns for TGUI chips (#68, Alan Hourihane).
+ 484. Fix direct reference to memset() (#67, Harald Nordgard Hansen).
+ 483. Gnu parallel make update for loadable server (#64, H.J. Lu).
+ 482. Include the summasketch support explicitly in xf86Xinput.c when
+ not using dynamic modules (#63, Christer Nilsson).
+ 481. Loader support for OS/2-style a.out (#62, Sebastien Marineau).
+ 480. Fix nested asm calls in tseng_cursor.c (#61, Takaaki Nomura).
+ 479. Add a timeout to the C&T blitter wait loop, and reset the blitter
+ when this happens (#60, David Bateman).
+ 478. Add missing imake patch for massaging the results of parse_utsname()
+ (#57, Chris Demetriou).
+ 477. Don't define DoLoadableServer yet for non-Intel Linux platforms.
+ 476. Don't refer to the PEX init function in loadmod.c when PEXEXT isn't
+ defined (as is the case on Alpha platforms) (#56, Alan Hourihane).
+ 475. Fix references to usleep on SVR4 (#61, Takaaki Nomura).
+ 474. Fix references to snprintf on SVR4 (David Dawes).
+ 473. Fix some compile problems on FreeBSD (David Dawes).
+
+XFree86 3.2Ag (19 February 1997)
+ 472. Fix Imakefiles and loader problems on OS/2 (#53, Sebastien Marineau).
+ 471. Fix problems with ISC and the Mach32 module (#55, Michael Rohleder).
+ 470. Fix Xnest and Xvfb when DoLoadableServer is YES (Dirk Hohndel).
+ 469. Clear up multiplex support on 96xx and display error message when
+ requested resolution exceeds available memory with the accelerator
+ engine (#52, Alan Hourihane).
+ 468. Let Trio64V2 use newmmio driver (#49, Tom Angert).
+ 467. First cut for ET6000 hardware cursor (#48, Dejan Ilic).
+ 466. Some xf86 wrappers (#47, Craig Groeschel).
+ 465. Convert PEX and XIE to be loadable with the new style loader
+ (Dirk Hohndel).
+ 464. Clean up configuration files to distinguish old and new style
+ loading of extensions (Dirk Hohndel).
+ 463. Add DPMS support (off mode only) to the P9000 server
+ (#9, Karl Anders Oygard).
+ 462. Add PCI probing to the P9000 server (#9, Karl Anders Oygard).
+ 461. Resync PC98 Imakefiles.
+ 460. Enable the loadable server for LynxOS AT (#46, Thomas Mueller).
+ 459. Better fix for XF86Setup compile problems (David Dawes).
+
+XFree86 3.2Af (17 February 1997)
+ 458. Fix XF86Setup/Imakefile (#45, Harald Nordgard Hansen).
+ 457. Fix xdm/Imakefile for ISC (Michael Rohleder).
+ 456. Fix problem with S3V and W32 modules (Dirk Hohndel).
+ 455. Move module rules from xf86.rules to Imake.rules, and when building
+ a module, install a link to it in xc/exports/lib/modules/ (David Dawes).
+ 454. Start Elf loader for Linux/Alpha; doesn't work, yet (#44, Alan Hourihane).
+ 453. Hide cursor in S3/SVGA when DGA is active (#43, Mark Vojkovich).
+ 452. a.out loader for module loading (#42, Matthieu Herrb).
+ 451. Extend OS support layer to cover some libc functions and update all
+ drivers to use the internal functions (Dirk Hohndel).
+
+XFree86 3.2Ae (16 February 1997)
+ 450. Add -showunresolved flag to server.
+ 449. Add sourceAddress option to xdm (#41, Christos Zoulas).
+ 448. Fix cfb8line (#40, Jeff Anton).
+ 447. Turn pixmap cache in SVGA/S3 server back on and switch over to XAA for
+ lines and segments (#39, Mark Vojkovich).
+ 446. Fix COFF header file (#38, Stuart Anderson).
+ 445. Better XKB russian keyboard support (#36, Andrey A. Chernov).
+ 444. Fix an X11R6.3 problem with SCO 5 build (#35, Alan Hourihane).
+ 443. Fixes for Trio64V2 (#35, Tom Angert, Harald Koenig, Xavier Ducoin).
+ 442. avoid nested asm calls which cause compile errors on PANIX(SVR4) (#31,
+ Takaaki Nomura).
+ 441. Resync LinkKit (#26, Takaaki Nomura).
+ 440. Fix some build problems when not using the new loader code
+ (on FreeBSD) (David Dawes).
+ 439. Stop S3 and S3V server from overwriting CR11 (#30, Harald Koenig).
+ 438. Fix banking code in S3/SVGA driver (#29, Thomas Mueller).
+ 437. Fix DPMS code for C&T (#28, David Bateman).
+ 436. Enable left edge clipping for HiQV chips (#28, David Bateman).
+ 435. Stop C&T probe from printing out messages for non C&T chips (#28,
+ David Bateman).
+
+XFree86 3.2Ad (14 February 1997)
+ 434. Merge Metro Link loader code and make all SVGA drivers and S3, S3V
+ server loadable (Metro Link, Dirk Hohndel).
+ 433. Avoid installing CVS admin files when doing 'make install' for rstart
+ (#25).
+ 432. Resync xfree98/SuperProbe/Imakefile.
+ 431. Fix for 'xset r rate' and XF86MiscSetKbdSettings() for some OSs (#24).
+
+XFree86 3.2Ac (12 February 1997)
+ 430. Fix problem with system #define Control on LynxOS (Thomas Mueller).
+ 429. FreeBSD 2.2 doesn't need libz (Takaaki Nomura).
+ 428. Another attempt at left edge clipping for HiQV chips (still disabled
+ by default) (David Bateman).
+ 427. DPMS in C&T is now enabled even when no monitor is detect (David Bateman).
+ 426. Additional fixes for 65530/35 linear addressing (untested) (Egbert Eich).
+ 425. Fix for the 16/24 bpp corruption in RIGHT2LEFT blits in the C&T driver
+ (Egbert Eich).
+ 424. Fix LinkKit and XF98_TGUI server (Takaaki Nomura).
+ 423. Reenable xsetpointer, xsetmode, xsetxkbmap in programs/Imakefile.
+ 422. Encapsulate arguments in C&T header files (Nozomi Ytow).
+ 421. Documentation updates for ET4000, mostly about 16/24/32bpp (Koen Gadeyne).
+ 420. Fix VGA2 and VGA16 that were broken in 394/395 and reenable them
+ (Koen Gadeyne).
+ 419. Improved resolution switching and 24bpp handling in S3V (Kevin Brosius).
+ 418. Matrox detection in SuperProbe (Alan Hourihane).
+ 417. Fix bug in the Type1 font code (H.J. Lu).
+ 416. Autoprobe Viper PCI and DPMI support for P9000 (Karl Anders Oygard).
+ 415. Use fill rect solid for horizontal lines on S3 (Mark Vojkovich).
+ 414. Add 8bit dac support to MGA (Mark Vojkovich).
+ 413. Add make -j support for gnu make (H.J. Lu and Craig Groeschel).
+
+XFree86 3.2Ab (11 February 1997)
+ 412. Some fixes for Linux/m68k (Geert Uytterhoeven).
+ 411. Add XAA S3 driver to the SVGA server (Mark Vojkovich).
+ 410. Add a flag argument to the ValidMode functions (Dirk Hohndel).
+ 409. Implemented (but disabled) left edge clipping for color expansion for
+ HiQV chips (David Bateman).
+ 408. 8x8 mono pattern fills for HiQV chips (David Bateman).
+ 407. DPMS support for C&T driver (David Bateman).
+ 406. Scanpci for Alpha (Robin Cutshaw).
+ 405. Fix clock clock limits for trident driver (Alan Hourihane).
+ 404. 9420/9430 acceleration - not tested, only partial, too (Alan Hourihane).
+ 403. DPMS support for the Trident driver (Alan Hourihane).
+ 402. 24/32bpp support for Trident chipsets (Alan Hourihane).
+ 401. Trident support for the Alpha platform (Alan Hourihane).
+ 400. Add DPMS to et4000 driver of the SVGA server (Harald Nordgard Hansen).
+ 399. Fixes and addition to the acceleration for W32 and ET6000 (Koen Gadeyne).
+ 398. Chrontel RAMDAC support for W32 in SVGA server (Kurt Olsen).
+ 397. Hardware Linedraw support for ET6000 and ET4000W32p (Koen Gadeyne).
+ 396. Add memory bandwidth as a concept to the W32 RAMDAC code (Koen Gadeyne).
+ 395. Move W32/ET6k clock setting functions into tseng_clock.c. This together
+ with change 394 breaks the W32 server and the et4000 driver in the
+ VGA2 and VGA16 server (all those are disabled by default for now)
+ (Koen Gadeyne).
+ 394. Move RAMDAC support from W32 server in SVGA server and added
+ accelerated 16/24/32 bpp support for ET4000/W32p (Koen Gadeyne).
+
+XFree86 3.2Aa (10 February 1997)
+ 393. Much additional acceleration for the HiQV chips (David Bateman).
+ 392. Print the PCI retry setting in MGA server (Radoslaw Kapitan).
+ 391. OpenBSD fixes (Matthieu Herrb).
+ 390. Small fix for doc naming.
+ 389. Fix 24bpp clock limit for ViRGE (Harald Koenig).
+ 388. Fix 16bpp 6554x 8x8 pattern fill problem (David Bateman).
+ 387. Fix core dump in C&T driver (Egbert Eich).
+
+XFree86 3.2A (28 January 1997)
+ 386. Updates to the OS/2 pipe xtrans code (Sebastien Marineau).
+ 385. Update the max clock for the TGUI ProVidia 968x (Alan Hourihane).
+ 384. Disable memory interleaving before restoring the text font info
+ for the MGA driver. This fixes font corruption that shows up
+ in Alpha platforms (Jay Estabrook).
+ 383. Fix some document formatting problems.
+ 382. Enable MMIO by default for TGUI chips when acceleration is enabled.
+ It can be disabled with the "no_mmio" option.
+ 381. Fix problems with the Trident driver in 16-colour mode (Alan Hourihane).
+ 380. Back out change 370 because it is obsoleted by change 373.
+ 379. Fix 369 was missing, and is now included.
+ 378. OS/2 updates (including documentation) (Holger Veit).
+ 377. Add bitblt acceleration for 16 and 32bpp for the I128 server
+ (Robin Cutshaw).
+ 376. Tseng doc update (Koen Gadeyne).
+
+XFree86 3.2y (26 January 1997)
+ 375. I128 accel fix (Robin Cutshaw).
+ 374. Update Japanese version of documentation to 3.2 (Kazuyuki Okamoto).
+ 373. Fix 8x8 pattern acceleration for ET6000 (Koen Gadeyne).
+ 372. Fix an optimisation/volatile problem with the I128 accel code
+ (Robin Cutshaw).
+ 371. Fix the clearing of video memory in the SVGA server when the linear
+ base address has been offset (Jay Estabrook).
+ 370. Disable 8x8 pattern acceleration for ET6000 (Harald Nordgard Hansen).
+ 369. Fix stippled/tiled lines (segments) (Harm Hanemaayer).
+ 368. Update the LinkKit for recent I128 server changes (Takaaki Nomura).
+ 367. Fix display of 8bit characters in xterm (when in VT100 mode)
+ (Thomas E. Dickey).
+ 366. m68k server updates (Geert Uytterhoeven).
+ 365. Matrox doc updates (Andrew Vanderstock).
+ 364. Update Mach64 docs (Kevin Martin).
+ 363. Fix a ELSA Winner 2000PRO/X-8 initialisation problem that shows up
+ after running a certain other X server (Harald Koenig).
+ 362. Fix a PC98 TGUI problem when using XAA colour expansion (Kazunori Ueno).
+
+XFree86 3.2x (23 January 1997)
+ 361. Remove some XAA debugging messages (David Bateman).
+ 360. Preliminary I128 bitblt acceleration using XAA (Robin Cutshaw).
+ 359. NetBSD doc updates (Matthieu Herrb).
+ 358. Fix a problem with specifying the chipset as "et6000" with the W32
+ server (Koen Gadeyne).
+ 357. Fix for XAA bitmap problem which showed up with the C&T driver, and
+ With this fixed, change 339 has been backed out (David Bateman).
+ 356. Update clock limits for the PC98 TGUI server (Akio Morita).
+ 355. PC98 documentation update (Akio Morita).
+ 354. Tseng doc updates (Koen Gadeyne).
+ 353. Add NO_PLANEMASK to the Tseng XAA colorexpansion flags (Koen Gadeyne).
+ 352. LynxOS doc updates (Thomas Mueller).
+ 351. Fix some unaligned access problems with pixmap data that show up on
+ Alpha platforms (Jay Estabrook).
+ 350. Fix a problem with passing the depth/weight specified on the
+ server command line in some situations (Harald Koenig).
+ 349. Add support for the S3 Aurora64V+ programmable clock, which is slightly
+ different from the Trio64 (Harald Koenig).
+ 348. Blank the screen before turning off the sync signals for the WD90C24
+ DPMS support (Brad Bosch).
+ 347. Change 341 was missing, and is now included.
+ 346. Don't accelerate XAA functions which use source bitmap data when
+ the rop is GXclear, GXnoop, and GXset (as well as GXinvert)
+ (Harm Hanemaayer).
+ 345. S3V doc updates (Kevin Brosius).
+ 344. S3 doc updates (Harald Koenig).
+ 343. Remove some experimental code in XF86Setup that was causing it
+ to fail when starting the first server (Joe Moss).
+
+XFree86 3.2w (22 January 1997)
+ 342. Update the xset man page for the DPMS additions.
+ 341. Updates to TGUI acceleration, to hopefully fix some problems that
+ show up with xtest (Alan Hourihane).
+ 340. Add recognition of some other TGUI Cyber chipset codes (Alan Hourihane).
+ 339. Enable 8x8 mono pattern fills for C&T 65545, and limit colour expansion
+ to GXCOPY_ONLY to avoid some crashes when running things like
+ xengine and xdvi (David Bateman).
+ 338. Fix various Chips & Tech display problems for 6554x, 65550 and
+ 64300 chips (Egbert Eich).
+ 337. Fix some XAA-related xtest errors (Harm Hanemaayer).
+ 336. Enable the "no_accel" flag for the ET6000 (Koen Gadeyne).
+ 335. When the "et6000" chipset is specified, use the port-probed value
+ for the membase rather than getting it from the PCI info (Koen Gadeyne).
+ 334. Tseng documentation updates (Koen Gadeyne).
+ 333. Cirrus documentation updates (Harm Hanemaayer).
+ 332. Add README.SiS (Xavier Ducoin).
+ 331. Temporary workaround for Mode_switch problems when using XKB and
+ Latin1 charset (Matthieu Herrb).
+
+XFree86 3.2v (20 January 1997)
+ 330. Added rules to use FreeBSD's sgmlfmt tool to format Linuxdoc/sgml
+ docs -- but this needs more work.
+ 329. Blank the screen before setting a DPMS mode (Leonard N. Zubkoff).
+ 328. Fix sync disabling for DPMS for the S3 (and S3V) server (Robert Wilhelm).
+ 327. Change the .name parameter of the S3V server to "S3V" (Kevin Brosius).
+ 326. Improve S3V 24bpp mode switching (still has some problems)
+ (Kevin Brosius).
+ 325. Disable 32bpp for the S3V server (not supported) (Kevin Brosius).
+ 324. Fix S3V aspect ratio problem at 24bpp (Kevin Brosius).
+ 323. Fix rotation direction of 8x8 mono patterns in XAA (David Bateman).
+ 322. XAA updates (see xaa/NOTES for details) (Harm Hanemaayer).
+ 321. Another fix for 5446 clocks higher than 85 MHz (Harm Hanemaayer).
+ 320. When a clocks line is specified in the XF86Config file for the
+ cirrus driver, ignore it rather that insisting on its removal
+ (Harm Hanemaayer).
+ 319. Remove artificial limit for LCD dot clock for Cirrus 754x chips
+ (Harm Hanemaayer).
+ 318. Fix a problem with default cirrus MMIO operation (Harm Hanemaayer)
+ 317. Improved acceleration support at 24bpp for the Ark driver
+ (Harm Hanemaayer).
+ 316. Ark documentation updates (Harm Hanemaayer).
+ 315. Enable "slow_dram" in the tseng driver for cards below W32i
+ (Koen Gadeyne).
+ 314. Fix a tseng driver typo (missing braces) which was causing linear
+ mode to incorrectly disable acceleration for the ET6000 (Dejan Ilic)
+ 313. Fix a tseng driver bug which was causing a system hang because
+ "fast_dram" wasn't completely disabled (Dejan Ilic).
+ 312. Fix a tseng driver bug which causes a server crash when the chipset
+ "et6000" is specified for the SVGA server (Koen Gadeyne).
+ 311. Some more W32i accel code, but disabled because it doesn't yet
+ work (Koen Gadeyne).
+ 310. Fix for ET6000 24bpp MULBPP optimisation (Harald Nordgard Hansen).
+ 309. Tseng documentation updates (Koen Gadeyne).
+ 308. Cirrus documentation updates (Corin Anderson).
+ 307. Updates for TGUI96xx hw cursor (8bpp, 16bpp), and PC98 TGUI card
+ list (Akio Morita).
+ 306. Fix build TGA compile problem and xdm build problem on Linux/Alpha
+ (Robin Cutshaw).
+
+XFree86 3.2u (19 January 1997)
+ 305. Only show the "extension not loaded" messages for the first
+ server generation.
+ 304. Don't allow DPMS to be switched if the Xserver's VT isn't active
+ (Leonard N. Zubkoff).
+ 303. Implement DPMS "off" support for the WD90C24, for LCD, CRT or both
+ (Brad Bosch).
+ 302. Add a missing DPMSExtension #ifdef in os/WaitFor.c (Corin Anderson).
+ 301. Fix an XAA bug with mono patterns, SCREEN_ORIGIN, and PROGRAMMED_ORIGIN
+ (Corin Anderson).
+ 300. Implement monochrome pattern fill for Cirrus Laguna chips
+ (Corin Anderson).
+ 299. Disable "fast_dram" for the ET6000 because it can cause serious
+ problems (Koen Gadeyne).
+ 298. Disable "power saving" in the Tseng driver because the current
+ way of doing it causes memory corruption (Koen Gadeyne).
+ 297. Disable linear mode and acceleration for Tseng chips that have
+ not been tested or which are not supported (Koen Gadeyne).
+ 296. Add some code to treat the ET6000 slightly differently when the
+ chipset is specified in the XF86Config file, to help the case
+ when another (disabled) PCI video card is detected (Koen Gadeyne).
+ 295. Use triple-buffering for colour expansion in the tseng driver
+ (Koen Gadeyne).
+ 294. Make some variables in the tseng driver static (Koen Gadeyne).
+ 293. Remove some asm stuff in the tseng driver, and add a C optimised
+ MULBPP calculation (Koen Gadeyne).
+ 292. Disable XAA framebuffer concurrency in the tseng driver, which
+ hides most of the text corruption problems (Koen Gadeyne).
+ 291. Man page (DPMS) and documentation (MGA) updates (Leonard N. Zubkoff).
+ 290. Fix invalid modelines in XF98Conf.cpp (Takaaki Nomura).
+ 289. Add checking of mode size against video memory requirements to the
+ Mach32 and Mach64 servers.
+ 288. Fix GXnor and GXnand ROP definitions for the TGUI driver.
+ 287. Update for Linux a.out libX11's jump_ignore (Harald Koenig).
+ 286. Fix (?) TGA server link problem.
+
+XFree86 3.2t (18 January 1997)
+ 285. Update W32 docs (Dirk Hohndel).
+ 284. Recognise "noaccel" and "slow_dram" options in the ET4000 driver
+ (Dirk Hohndel).
+ 283. Fix problem with not truncating pixel values in the MGA driver
+ (Dirk Hohndel).
+
+XFree86 3.2s (18 January 1997)
+ 282. Fix a problem with xdm's sessreg and utmp on Linux (Leonard N. Zubkoff).
+ 281. Fix a plane-enable bug for Cirrus 754x (Corin Anderson).
+ 280. Don't use teblt code for depths other than 8 for Cirrus 754x
+ chips (Corin Anderson).
+ 279. Implement programmable pattern offset using XAA, add support for
+ plane masks and fix sum bugs for Cirrus Laguna chips (Corin Anderson).
+ 278. Don't check the PCI command FIFO for Cirrus Laguna chips
+ (Corin Anderson).
+ 277. Add XAA support to the SiS driver. The old code can be reverted
+ to at runtime with the "noaccel" option (Xavier Ducoin).
+ 276. Add recognition of XAA options as valid options for the SVGA
+ server (Alan Hourihane).
+ 275. Add "please report" messages when S3 Trio64V2, Trio64UV+ or
+ Aurora64V+ chips are detected (Harald Koenig).
+ 274. Add undocumented options to XF86Config to allow a numerical ChipID
+ and ChipRev to be specified (used by the S3 and S3V servers)
+ (Harald Koenig).
+ 273. Attempt to fix false detection of RGB524 ramdac as RGB528
+ (Harald Koenig).
+ 272. Make sure x coordinate doesn't overflow into the y coordinate
+ for some MGA operations (Xavier Ducoin and Radoslaw Kapitan).
+ 271. Don't write high order CRTC vertical bits for Trident chips earlier
+ than TGUI9440AGi (Alan Hourihane).
+ 270. Fix an error in koi8-r charset switching code (Andrey Chernov).
+ 269. Disable acceleration for TGUI Cyber chips (Alan Hourihane).
+ 268. Fix register access in Cirrus 754x LCD size detection (Harm Hanemaayer).
+ 267. Add support for the "no_stretch" option for Cirrus 754x chips
+ (Harm Hanemaayer).
+ 266. Enable MMIO by default for Cirrus 543x/4x chips, and add a "no_mmio"
+ option to allow it to be disabled (Harm Hanemaayer).
+ 265. Disable PCI burst mode on the TGUI by default, but allow it to be
+ turned on with options (Alan Hourihane).
+ 264. Update max clocks for the TGUI 96xx chips (Alan Hourihane).
+ 263. Fix centre/stretch TGUI LCD problems (Alan Hourihane).
+ 262. Add Option "tgui_mclk_66" to force MCLK to 66 MHz (Alan Hourihane).
+ 261. Fix TGUI Cyber detection problems (Alan Hourihane).
+ 260. Flush MGA "direct access read cache" in MgaSync(), which fixes
+ problems reading directly from the framebuffer after accelerated
+ operations (Radoslaw Kapitan).
+ 259. XAA updates (see xaa/NOTES for details) (Harm Hanemaayer).
+ 258. Updates for LynxOS 2.5.0 (Thomas Mueller).
+ 257. Fix xterm text highlighting when the window it partly off-screen
+ (Thomas E. Dickey).
+ 256. Remove the GetSaver/SetSaver functionality from the client
+ side of the XFree86-Misc extension, but leave dummy support in
+ the server side for now to avoid breaking old clients
+ (Leonard N. Zubkoff).
+ 255. Implement hw-specific DPMS support for servers/drivers which already
+ had an old implementation, adding support for Standby mode where
+ possible, and adding a StandbyTime keyword for the XF86Config
+ file (Leonard N. Zubkoff).
+ 254. Fix some problems with the original DPMS extension behaviour
+ (Leonard N. Zubkoff).
+ 253. Possible speedup for S3V polypoint code (Harald Koenig).
+ 252. Disable C&T 65550 acceleration features that weren't present
+ in 3.2 (David Bateman).
+ 251. Fix a C&T 24bpp pattern fill problem (David Bateman).
+ 250. Make the XAA C&T code independent of the old acceleration code
+ (David Bateman).
+ 249. Recognise the Alliance AT24, but treat the same way as a 6442
+ (Joe Moss).
+ 248. Add detection for newer TGUI chipsets to SuperProbe (Alan Hourihane).
+
+XFree86 3.2r (14 January 1997)
+ 247. Use some extra XAA flags in the MGA acceleration (Radoslaw Kapitan).
+ 246. XAA updates (see xaa/NOTES for details) (Harm Hanemaayer).
+ 245. Fix DAC register for > 85 MHz mode on Cirrus 5446 (Harm Hanemaayer).
+ 244. Memory config fix for 2MB Cirrus 7543/8 and fix 754x LCD size detection
+ (Harm Hanemaayer).
+ 243. Fix a problem in Imake.rules that causes problems when using bash
+ (Leonard N. Zubkoff).
+ 242. Fix some server prototyping problems (Thomas E. Dickey).
+ 241. Detect the Trio64UV+, Trio64V2 and Aurora64V+, and handle them
+ as a Trio64V+ (Harald Koenig).
+ 240. Add preliminary support for the ELSA Winner 2000PRO/X-8 (S3 968,
+ IBM RGB528A, 8MB VRAM 250 MHz) (Harald Koenig).
+ 239. Fix retrace waits in the MGA driver (Radoslaw Kapitan).
+ 238. Enable CPUToScreen colour expansion for the TGUI driver (Alan Hourihane).
+ 237. Add an options "lcd_center" to the TGUI driver for Cyber chips
+ (Alan Hourihane).
+ 236. Some S3V updates, including combining s3dline.c and s3dseg.c,
+ moving planemask/colour conversion into a separate module,
+ add FillSolid, improve speed of s3plypt.c, and enable some
+ previously disable functions (Berry Dijk).
+ 235. Updates for ISC support (Michael Rohleder).
+ 234. Disable ExportLists for Solaris versions older than 2.5.
+ 233. Fix for C&T 8x8 pattern fills (David Bateman).
+ 232. LinkKit fix (SiS driver) (Takaaki Nomura).
+ 231. Fix for XAA colour expansion when using FIXED_BASE (Koen Gadeyne).
+ 230. ET6000 accel updates and optimisations (Koen Gadeyne).
+ 229. Add code to the MGA driver to set MCLK based on the values
+ stored in the BIOS and the memory size (Andrew E. Mileski).
+
+XFree86 3.2q (12 January 1997)
+ 228. Make makedepend recognise #warning on all OSs (since we have it
+ in shm.h).
+ 227. Add Digital's DPMS server extension (no device-specific support yet).
+ 226. Fix some compile problems on Solaris x86 2.4 with gcc (James Hawtin).
+ 225. Add prelim support for LCD stretching with the TGUI Cyber chips
+ (Alan Hourihane).
+ 224. Add support for some blitter functions to the SiS driver (not XAA
+ yet) (Xavier Ducoin).
+ 223. Fix HW cursor problems in the SiS driver (Xavier Ducoin).
+ 222. Add 15/16/24bpp support to the SiS driver (Xavier Ducoin).
+ 221. Fix problems with linear mode in the SiS driver (Xavier Ducoin).
+ 220. Programmable clock support for the SiS 205 (Xavier Ducoin).
+ 219. TGUI acceleration updates (Alan Hourihane).
+ 218. Add XAA support for the Chips & Technologies driver (David Bateman).
+ 217. Support for 555 weighting in the MGA driver (Xavier Ducoin).
+ 216. TGUI clock fix (Alan Hourihane and Massimiliano Ghilardi).
+ 215. VGA server compiler warning fixes (Thomas E. Dickey).
+ 214. LinkKit fixes (Takaaki Nomura).
+ 213. XAA updates (see xaa/NOTES for details) (Harm Hanemaayer).
+ 212. The item 203 fix was missing. It is included now.
+ 211. Modify Cirrus 754x LCD size detection (Harm Hanemaayer).
+ 210 Add support for pattern offset for the Cirrus 5446 (Harm Hanemaayer).
+ 209. Fix non-MMIO operation for the Cirrus 5446 (Harm Hanemaayer).
+ 208. Fix font cache problem introduced in 3.2p (Takaaki Nomura).
+
+XFree86 3.2p (8 January 1997)
+ 207. XAA support for the Cirrus Laguna chips (Corin Anderson).
+ 206. Modify the PF1-PF4 coding in the xterm termcap/terminfo, and add an
+ interim xterm-vt220 description to accommodate the old and new styles
+ (Thomas E. Dickey).
+ 205. Combine the coding for foreground and background colours in xterm
+ into a single byte (Thomas E. Dickey).
+ 204. Some optimisations and transparent 8x8 pattern tiling for the ET6000
+ driver (Koen Gadeyne)
+ 203. Parallel make fix for lbxproxy (Robin Cutshaw).
+ 202. LinkKit fixes (David Bateman).
+ 201. Defining XF86ExpireServer to YES in host.def allows easy enabling
+ of server expiry.
+ 200. The item 176 fix was missing. It is included now.
+ 199. Fix an Xlib problem with non-8859-1 locales (Kaleb Keithley).
+ 198. Set default hsync and vsync polarity for the MGA driver in the same
+ way as other servers (Leonard N. Zubkoff).
+ 197. Fix sync polarity in MGA driver (Radoslaw Kapitan).
+ 196. Add DGA support to the MGA driver (Mark Vojkovich).
+ 195. Some xterm cleanups (Thomas E. Dickey).
+ 194. Implement DECSTR (soft terminal reset) for xterm (Thomas E. Dickey).
+ 193. Fix some unaligned accesses in cfb16SegmentSS1RectCopy() on Alpha
+ (Harald Koenig).
+ 192. 8x8 colour expand patterns for MGA (Radoslaw Kapitan).
+ 191. Fix various compiler warnings in the S3 server (Thomas E. Dickey).
+ 190. Fix TRANS_ENABLE definition for the TGUI driver (Alan Hourihane).
+ 189. Fix a problem with the location of ident lines in the tclIndex file
+ (Joe Moss).
+
+XFree86 3.2o (5 January 1997)
+ 188. Add MIPS/Arc support to build the S3 server on OpenBSD (Per Fogelstrom).
+ 187. Split OpenBSD config support out into a new OpenBSD.cf file
+ (Matthieu Herrb).
+ 186. Split the retrace wait out into a separate function in the S3
+ server (Mark Vojkovich).
+ 185. Fix a problem with FIFO setting for Mach64 chips with an
+ integrated DAC (Kevin Martin).
+ 184. Fix a pixmap corruption problem that shows up on Mach64 [CVG]T chips
+ (Kevin Martin).
+ 183. Disallow block write mode for [CVG]T Mach64 chips (Kevin Martin).
+ 182. Fix a problem for Mach64 CT-D cards where the server writes to the
+ wrong I/O address, possibly that of another PCI device (Kevin Martin).
+ 181. Fix Rage II support in the Mach64 server (Kevin Martin).
+ 180. Add preliminary XAA support for the TGA server (Alan Hourihane).
+ 179. Don't compile Xprint/Xrm.c because it is already included in
+ attributes.c (Holger Veit).
+ 178. Various updates for OS/2 (Holger Veit).
+ 177. Fix some typing problems in xf86expblt.c (Alan Hourihane).
+ 176. Fix XAA crash for drivers that don't fill in the ServerInfoRec
+ (Harm Hanemaayer).
+ 175. Add DPMS support for the MGA driver (Leonard N. Zubkoff).
+ 174. Add sync-on-green support to the MGA driver (Leonard N. Zubkoff).
+ 173. Add support for display modes that require more than 4MB on
+ Millennium cards (Leonard N. Zubkoff).
+ 172. Enable acceleration support for the Trident 9320LCD chips
+ (Alan Hourihane).
+ 171. Add parallel make support for the lbxutil Imakefile (Robin Cutshaw).
+ 170. Fix a problem with the Xmark script (Andrew E. Mileski).
+
+XFree86 3.2n (3 January 1997)
+ 169. Fix some xaa build problems on some platforms.
+ 168. Updates to NetBSD.cf, including auto-detection of ELF (Chris Demetriou).
+ 167. Add I128 series II detection to scanpci and SuperProbe (Robin Cutshaw).
+ 166. Fix a problem in sun.cf (Robin Cutshaw).
+
+XFree86 3.2m (2 January 1997)
+ 165. Fix some problems creating Xserver links in XF86Setup (Dirk Hohndel).
+ 164. Update to R6.3 public patch 1.
+ 165. XAA updates (Harm Hanemaayer).
+ 163. Fix problems with out-of-date cirrus_acl.c (Harm Hanemaayer).
+ 162. Move all default settings from xf86site.def to xfree86.cf, and leave
+ xf86site.def containing only commented out definitions.
+ 161. Fix 'make install' problems in xkbcomp.
+ 160. Fix some ZLIB problems.
+
+XFree86 3.2l (31 December 1996)
+ 159. Tseng acceleration updates (Koen Gadeyne).
+ 158. Add config support for using the system's standard version of libz
+ when it exists (Chris Demetriou).
+ 157. Add rules for ELF shared libraries on BSD (Chris Demetriou).
+ 156. Recognise __alpha__ as AlphaArchitecture for NetBSD, and treat
+ __alpha__ the same way as __alpha is various part of the code
+ (Chris Demetriou).
+ 155. Update NetBSD config file (Chris Demetriou).
+ 154. Add code to dynamically recognise NetBSD versions in imake, and
+ add defines to allow massaging of the information returned by
+ uname Chris Demetriou).
+ 153. Fix inconsistent usage of malloc/xalloc/Xalloc in the Xprt server.
+ 152. Fix segfault at startup of clients linked with libICE on SVR4.0
+ 151. Add detection for the 250MHz ramdac used on the PowerDoc Edition
+ variant of the Matrox Millennium (Dirk Hohndel).
+ 150. Fix some compile/cpp warnings (Marc Aurele La France).
+ 149. Add support to makedepend for the '^' and '? :' operators
+ (Marc Aurele La France).
+ 148. Change GZIP to GZIPCMD in Makefiles because of a conflict with
+ an environment variable used by gzip (Marc Aurele La France).
+ 147. Fix make depend problem for xdm-shadow (Marc Aurele La France).
+ 146. Update Linux a.out support for R6.3 (Harald Koenig).
+ 145. Trident doc updates (Alan Hourihane).
+ 144. TGUI solidfill updates (Alan Hourihane).
+ 143. XC fixes.
+
+XFree86 3.2k (28 December 1996)
+ 142. Fix a problem introduced in 3.2i which causes the S3 server to crashed
+ for cards with a Ti3026.
+ 141. Updates for GNU libc on Linux, and fix some compile warnings
+ (H.J. Lu).
+ 140. Updated Russian XKB layout (Andrey Chernov).
+ 139. Workaround for KOI8-R problem in XmbLookupString(). The change
+ is to XLC_XLOCALE/koi8-r (Andrey Chernov).
+ 138. Fix some problems with the server build on Alphas (Jay Estabrook).
+ 137. Avoid a server hang in the et4000 driver (Koen Gadeyne).
+ 136. Add some more acceleration for ET4000 chips (Koen Gadeyne).
+ 135. Fix server crash when chipset "et6000" is specified (Koen Gadeyne).
+ 134. Cleanup of vgaHW.c (Marc Aurele La France).
+ 133. In the vga2 server, use the bank size, not the aperture size, to
+ decide between banked and non-banked support (Marc Aurele La France).
+ 132. Fix to FIFO depth calculation in the Mach64 server
+ (Marc Aurele La France).
+ 131. Fix some problems with the width of the pixmap used by the VGA servers
+ when the server's VT isn't active (Marc Aurele La France).
+ 130. Major ati SVGA driver updates (Marc Aurele La France).
+ 129. Fix Xserver/Imakefile problem that sometimes causes problems with
+ cfb24 not being built (Marc Aurele La France).
+ 128. Fix some compiler warnings (including a problem with the ScreenInfoRec
+ initialisation in the I128 server) (Marc Aurele La France).
+ 127. Updated PC98 TGUI support (Akio Morita).
+ 126. Add MMIO support to the TGUI driver, and remove MCLK limits
+ (Alan Hourihane).
+ 125. Add pa, Sf, Sb capabilities to the xterm termcap.
+ 124. Add Tcl interfaces for the new vidmode functions (Joe Moss).
+ 123. Complete the implementation of XF86VidModeAddModeLine() (Joe Moss).
+ 122. Some more s3init.c cleanups (Mark Vojkovich).
+ 121. XC fixes.
+ 120. More R6.3-related updates.
+
+XFree86 3.2j (26 December 1996)
+ 119. Integrate X11R6.3 (pre-release) source base.
+
+XFree86 3.2i (20 December 1996)
+ 118. Some general cleanups (Stuart Anderson, Dirk Hohndel).
+
+XFree86 3.2h (20 December 1996)
+ 117. Fix a "void * used in arithmetic" warning in lnx_video.c.
+ 116. Allow the XInput "AlwaysCore" feature to be controlled dynamically
+ via an "integer feedback" (Frederic Lepied).
+ 115. Fix TGUI clock programming problems (Alan Hourihane).
+ 114. Fix clock scaling with ClockChip "cirrus" (Harm Hanemaayer).
+ 113. Fix some compile problems on SVR4 (Takaaki Nomura).
+
+XFree86 3.2g (19 December 1996)
+ 112. Separate the function prototypes out of xf86_OSlib.h (Stuart Anderson).
+ 111. Fix for change 97 (which was causing a server startup problem)
+ (Harald Koenig).
+ 110. Enable accelerated copy plane for 24bpp in XAA.
+ 109. Fix some compile problems related to the recent Cirrus changes.
+
+XFree86 3.2f (18 December 1996)
+ 108. Enable the XAA driver for cirrus chips with a BitBLT engine and
+ the driver for Laguna family chips (Harm Hanemaayer).
+ 107. Modify the support for dot clocks > 85 MHz on the 5436/46
+ (Harm Hanemaayer).
+ 106. Fix 24bpp support for the CL-GD5430 (Harm Hanemaayer).
+ 105. Add optimized support for the CL-GD5446 to the XAA driver
+ (Harm Hanemaayer).
+ 104. When a PCI cirrus chip is detected, enable linear addressing by default
+ (Harm Hanemaayer).
+ 103. Better LCD control settings for CL-GD754x for different LCD sizes,
+ and improve 754x LCD type detection (Harm Hanemaayer).
+ 102. Modify CRT FIFO threshold setting for the CL-GD7548 (Harm Hanemaayer).
+ 101. Don't treat the CL-GD7543 as an Alpine-family chip (Harm Hanemaayer).
+ 100. XAA updates (see the NOTES file in the xaa directory for details)
+ (Harm Hanemaayer).
+ 99. Support for sharing the core pointer between multiple XInput devices
+ (Frederic Lepied).
+ 98. XAA support for the ET6000 (Koen Gadeyne).
+ 97. Fix an S3 server crash caused by an off-by-one access when displaying
+ images (Harald Koenig).
+ 96. Updates to LynxOS support for 2.5.0 (Thomas Mueller).
+ 95. Add a "pc104" XKB layout for keyboards with the extra "Windows" keys
+ (Joe Moss).
+ 94. Fix for problem clearing "chordmiddle" flag from XF86Setup (Joe Moss).
+ 93. Ti3026 clock programming updates for the MGA driver (Andrew E. Mileski).
+ 92. A general s3init.c cleanup and modularization. This isolates
+ ramdac register save/restore functions, and moves them into
+ s3ramdacs.c (Mark Vojkovich).
+ 91. Fix S3 server lockup due to vsync wait when power-saving mode is
+ active (Xavier Ducoin).
+ 90. PC98 LinkKit updates (Takaaki Nomura).
+
+XFree86 3.2e (12 December 1996)
+ 89. Fix some TGUI clock programming problems (Massimiliano Ghilardi).
+ 88. Disable <ctrl><alt><backspace> when in DGA mode (Mark Vojkovich).
+ 87. Fix some XAA-related server link problems (Marc Aurele La France).
+ 86. Fix some LinkKit problems (David Bateman and Takaaki Nomura).
+ 85. Fix some more implicit typing in function declarations (Andreas Schwab).
+ 84. Add some more ELSA cards to the Cards file (Harald Koenig).
+ 83. Fix the ICS5342 clock limit (Harald Koenig).
+ 82. Fix typos in the mga Alpha support.
+ 81. Fix a typo in the XThrStub Imakefile (H.J. Lu).
+ 80. Resync the PC98 Imakefiles (Takaaki Nomura).
+
+XFree86 3.2d (9 December 1996)
+ 79. Updates to SCO Open Server 5 support (Tom Angert and J Kean Johnston).
+ 78. Add support for Linux C library version 6 (GLIBC), and fix some
+ prototype problems (H.J. Lu).
+ 77. Add Alpha support for the mga driver (SVGA server), and generic
+ driver (Mono/VGA2 server) (Jay Estabrook).
+ 76. Fix s3ReadImageBanked() with a planemask (Harald Koenig).
+ 75. Add fast bitblt support for the mga driver (Radoslaw Kapitan).
+ 74. Allow probing of the Bt485 when an S3 968 is detected (Mark Vojkovich).
+ 73. Fix an integer overflow in the S3V server when drawing long lines
+ (Harald Koenig).
+ 72. Add detection of the Alliance ProMotion chips to SuperProbe
+ (Joe Moss).
+ 71. XAA updates (including disabling non-TE text acceleration)
+ (Harm Hanemaayer).
+ 70. Fix pixmap support in XAA (Harm Hanemaayer and Alan Hourihane).
+ 69. Update the device-specific XF86Config parsing support to report
+ unknown keyword and options (Egbert Eich).
+ 68. Add another check for the fb base address in the S3 server
+ (Harald Koenig).
+ 67. Fix some typos in the SuperProbe Imakefile (Harald Koenig).
+ 66. Update the AXP/IO Jensen support (David Mosberger).
+ 65. Add code to the S3 server to recognise the ELSA 1000PRO/X
+ (Harald Koenig).
+ 64. Fix an initialisation problem for Diamond ViRGE/VX cards, which
+ causes a lockup (Harald Koenig).
+ 63. Add support for the STREAMS processor to the S3V server (Kevin Brosius).
+ 62. Fix a problem in xf86bench.c for OS/2 (Holger Veit).
+ 61. Some mga line fixes (Radek Kapitan).
+ 60. Chips & Technologies driver updates (includes support for the
+ 64200 and 64300 WinGine series of chips, and the 65525 and 65535
+ chips) (David Bateman and Egbert Eich).
+ 59. Fix some problems with the new S3 probe code (Mark Vojkovich).
+ 58. Allow xterm to output 8-bit characters in VT100 mode (Matthieu Herrb
+ and Thomas Dickey).
+ 57. Add a return value to XF86DGAGetVideo() (Mark Vojkovich).
+ 56. Add missing write_mem_barrier definitions (Harald Koenig).
+ 55. Fix some compile problems with 3.2c.
+
+XFree86 3.2c (24 November 1996)
+ 54. Fix some potential buffer overflows in SuperProbe, and don't
+ install it setuid root (Marc Slemko).
+ 53. Add support for driver-specific parsing of the XF86Config file's
+ Device section (Egbert Eich).
+ 52. Fix S3 virtual resolution handling problem introduced in 3.2a
+ (Mark Vojkovich).
+ 51. Add a '-nolisten' flag to the X server to allow disabling of
+ a transport type (Nathaniel D. Daw).
+ 50. Update Imake.rules to do better error recovery for missing
+ directory or Makefiles (Thomas E. Dickey).
+ 49. Add REP (repeat) control for xterm (Thomas E. Dickey).
+ 48. XAA updates (Harm Hanemaayer).
+ 47. Add required changes for the PC98 servers to build using XAA
+ (Takaaki Nomura).
+ 46. Fix an unaligned access in cfb (Harald Koenig).
+ 45. Add support for Alpha Jensen (EISA) using sparse memory MMIO
+ (Martin Ostermann).
+ 44. Add working "newmmio" support for AXP (Harald Koenig).
+ 43. Add some memory barriers to the ViRGE server for AXP (Harald Koenig).
+ 42. Reset the ViRGE (but not ViRGE/VX) GE while reading the BIOS to avoid
+ text font corruption (Harald Koenig).
+ 41. Change the S3 ViRGE default base address when PCI config registers
+ can't be accessed (mainly for AXP) (Harald Koenig).
+ 40. S3 ViRGE/VX fix (Harald Koenig).
+ 39. Patch for mk68 servers (Geert Uytterhoeven).
+ 38. Add detection for the S3 Aurora64V+ and Trio64UV+ (Harald Koenig).
+ 37. Replace the truncated files in xterm/tektests with full versions
+ (from color_xterm) (Thomas E. Dickey).
+ 36. Add some more MGA line code (Andrew Vanderstock).
+ 35. Add some MGA macros, especially for access type setting
+ (Radoslaw Kapitan).
+ 34. Add MGA screen-to-screen color expansion (not used yet)
+ (Radoslaw Kapitan).
+
+XFree86 3.2b (20 November 1996)
+ 33. Fix some compilation problems with 3.2a.
+ 32. Fix DGA fb mapping for SVR4 (Richard Coley).
+ 31. Fix Hercules mono driver text bug (H.J. Lu).
+
+XFree86 3.2a (18 November 1996)
+ 30. Bump default FreeBSD version to 2.1.6.
+ 29. TGUI driver updates for PC98 (Akio Morita).
+ 28. Fix trident driver compile problem with VGA2 and VGA16 servers
+ (Takaaki Nomura).
+ 27. XAA support for the Trident driver (Alan Hourihane).
+ 26. Add VT52 emulation to xterm (Thomas E. Dickey).
+ 25. Fix a missing resets to groundstate in xterm (Denis Auroux and
+ Thomas Dickey).
+ 24. Improve overflow problem in XAA internal benchmarking
+ (Akio Morita).
+ 23. XAA support for the mga driver (Radoslaw Kapitan and the Matrox team).
+ 22. XAA support for the Cirrus BitBLT and Laguna chips (but not enabled
+ yet) (Harm Hanemaayer).
+ 21. XAA support for the ARK driver (Harm Hanemaayer).
+ 20. A new acceleration interface (XAA) for the SVGA server (Harm Hanemaayer).
+ 19. S3V s3plypt.c changed to use GE, but is slower so still disabled
+ (Harald Koenig).
+ 18. Change the S3V GE reset to avoid lockups (Harald Koenig).
+ 17. Add WaitIdle() at the end of S3V accel routines to avoid screen
+ corruption from direct fb access while the GE is still active
+ (Harald Koenig).
+ 16. Remove unsupported option flags from the S3V server (Harald Koenig).
+ 15. Allow large S3 cursors by switching to SW cursor when required
+ (Harald Koenig).
+ 14. Fix S3 frame buffer probing and memory leak (Harald Koenig).
+ 13. Fix S3 ReadImage with a planemask (when ReadImageNoMem can't be used)
+ (Harald Koenig).
+ 12. S3 line and text fixes (Harald Koenig).
+ 11. Fix DGA colourmap problems in the W32 server.
+ 10. Fix a problem with realloc usage in xrdb for some older OSs
+ (eg, SunOS 4.x) (Wolfgang Rupprecht).
+ 9. Fix an xrdb malloc problem (Michael Lipp).
+ 8. Fix xload problems on Solaris 2.5 (David Thompson).
+ 7. Fix xload problem for most BSD OSs that was introduced in 3.2, and
+ fix some problems in the BSDI-specific code (Matthieu Herrb).
+ 6. Modify the external ClockProg support to allow for programmable
+ clocks (ie, no clocks line) (Egbert Eich).
+ 5. Fix W32p rev C and rev D PCI ids (Koen Gadeyne).
+ 4. Fix a problem which causes a server crash on PANIX/PC98 when using
+ the XFree86-Misc extension (Takaaki Nomura).
+ 3. S3 server probe cleanup (Mark Vojkovich).
+ 2. Fix XF86Setup compile problem on Solaris (Robin Cutshaw).
+ 1. Patches for OS/2 support (Holger Veit).
+
+XFree86 3.2 (26 October 1996)
+1079. Fix a bug in xgc that can cause a SEGV (Takaaki Nomura).
+1078. README and FreeBSD doc updates (Takaaki Nomura).
+1077. RELNOTES updates, and some updates to the preinst and postinst scripts.
+1076. Tell xf86config about the S3V server.
+1075. Fix some typos in XF86Setup.
+1074. Fix a problem with XF86Setup that shows up when there is no
+ <Xroot>/bin/X link present.
+1073. Fix a test restoration problem with the ali driver.
+1072. NetBSD and Solaris doc updates (Matthieu Herrb).
+1071. Cirrus doc updates (Harm Hanemaayer).
+1070. Prevent Oak probe from falsely detecting some Avance Logic chips.
+
+XFree86 3.1.2Zd (24 October 1996)
+1069. Fix a problem with the TGUI driver disabling linear mode when the
+ OS doesn't support it.
+1068. Fix an image stipple problem in the S3, Mach8, Mach32 and 8514 servers
+ (Harald Koenig).
+
+XFree86 3.1.2Zc (24 October 1996)
+1067. Mach64 doc updates (Kevin Martin).
+1066. Xvfb shouldn't depend on cfb24 (Geert Uytterhoeven).
+1065. Update contrib to R6.1.
+1064. C&T doc updates (David Bateman).
+1063. Fix an image stipple problem in the S3V server (Harald Koenig).
+1062. Doc updates (Takaaki Nomura).
+
+XFree86 3.1.2Zb (23 October 1996)
+1061. Fix some NV1 problems, including clock selection problems and
+ pixel corruption problems (David McKay).
+1060. Fix some bad random() prototypes for Linux (Harald Koenig).
+1059. Fix NeqnCmd definition in NetBSD.cf (Matthieu Herrb).
+1058. Chips&Tech doc updates (David Bateman).
+1057. Cards db update for Chips&Tech (David Bateman).
+1056. Some updates to the "supported" contrib clients (Harald Koenig).
+1055. VGADriver doc updates (Stuart Lamble).
+1054. LynxOS doc updates (Thomas Mueller).
+1053. Fix a problem in mgaFillBoxSolid() (Radoslaw Kapitan).
+1052. Fix a serious probe bug in the MGA driver which causes a crash on
+ non-PCI machines (Egbert Eich).
+1051. Fix a serious probe bug in the NV driver (David Bateman).
+
+XFree86 3.1.2Za (21 October 1996)
+1052. Some documentation updates (Dirk Hohndel).
+1051. A few cleanups that have no affect on function (Harald Koenig).
+1050. Fix a problem in XF86Setup (Harald Koenig).
+
+XFree86 3.1.2Z (20 October 1996)
+1049. Update XF86_SVGA man page (Harm Hanemaayer).
+1048. Update Linux README (Dirk Hohndel).
+1047. Fix some mono/4bpp problems introduced by recent ET6000 changes
+ (Koen Gadeyne).
+1046. Updates to the Cards database (Harald Koenig).
+1045. Fix xdpyinfo core dump when the XInput extension is not available
+ (Frederic Lepied).
+1044. Fix SuperProbe mis-detection of S3 ViRGE (Harald Koenig).
+1043. S3V README (Harald Koenig).
+1042. Resync some PC98 Imakefiles (Takaaki Nomura).
+1041. Update XF86Setup card list features, and add 1152x864 video modes
+ (Harald Koenig).
+
+XFree86 3.1.2Gq (19 October 1996)
+1040. Some updates to use the native setlocale() in the GNU libc used
+ by Linux/Alpha/ELF (Ulrich Drepper, Harald Koenig).
+1039. MGA README (Andrew Vanderstock and Dirk Hohndel).
+1038. Fix REQUIREDLIBS problem with dynamic xie.so (Alan Hourihane).
+1037. Update man page versions (Takaaki Nomura).
+1036. Add xf86VTSema checks to the MGA server, move blitter init to
+ HWRestore, and wait for drawing engine before enter/leave VT
+ (Radoslaw Kapitan).
+1035. TGA and Trident doc updates (Alan Hourihane).
+1034. Remove an unused TGA server file (Alan Hourihane).
+1033. Update to the Chips&Tech screen corruption fix (Egbert Eich).
+1032. Fix a typo in the Chips&Tech driver which prevents the "hw_clocks"
+ option from working (David Bateman).
+1031. Move the SVGA 'mx' driver to after the 'chips' driver, because its
+ probe causes problems for the chips driver. Also, fix a problem
+ in the 'mx' probe where it writes to a register without first saving
+ its contents.
+
+XFree86 3.1.2Gp (18 October 1996)
+1030. Fix the cursor colour not being correctly set in 15/16/32bpp modes
+ on the CT, ET, VT and GT chips (Kevin Martin).
+1029. Change Mach64 block_write behaviour. Assume that block write mode is
+ initialised by the BIOS, but still allow it to be turned on or off
+ explicitly in the XF86Config (Kevin Martin).
+1028. Set the extended display FIFO LWM bit on the Mach64 CT-D (Kevin Martin).
+1027. Fix the retrace wait in mach64AdjustFrame() (Kevin Martin).
+1026. Delete Mach64 doublescan modes for chipsets that don't support any
+ accelerated doublescan modes (Kevin Martin).
+1025. Set Mach64 display FIFO setting to the values supplied by ATI for
+ various chipset/memory type/memory size/bpp combinations (Kevin Martin).
+1024. Fix some MGA accel problems (Radoslaw Kapitan).
+1023. FreeBSD and NetBSD doc updates (Takaaki Nomura).
+1022. Fix some Mach32 16bit font display problems (Bryan Feir).
+1021. Add support for the ICS1562 clockchip used by the DEC TGA (Harald
+ Koenig).
+1020. Make WaitQueue wait for three more free slots than requested to
+ allow a safety margin in case of coding bugs (the ViRGE will lock
+ up the PCI bus when the FIFO is full) (Harald Koenig).
+1019. S3V fixes for some XTEST errors, and remove debug and unused code
+ (Harald Koenig).
+1018. Preliminary support for the Trident Cyber 938x chipset (Alan Hourihane).
+1017. Update the max clock for the Cirrus 754x with LCD enabled, and
+ deal more gracefully when a clock line is encountered (Harm Hanemaayer).
+1016. Add/implement XF86DGAGetViewPortSize() and add an extra argument
+ to XF86DGAViewPortChanged() which indicates the number of pages
+ being used when multi-buffering (Harm Hanemaayer).
+1015. Move the setting of the XF86DGADirectColormap flag into
+ XF86DGAInstallColormap() so that apps which use this function but
+ don't explicitly set the flag will work correctly.
+
+XFree86 3.1.2Go (17 October 1996)
+1014. Add xterm-r6 entries to the xterm termcap and terminfo files. These
+ are compatible with the standard X11R6 version of xterm.
+1013. Chips&Tech driver updates, including: add an option to deal with
+ LCD panel size problems, add an option to use an 18bit bus for some
+ TFT laptops, allow imageblt to be disabled, support sync-on-green
+ for the 65550, improve some screen scrambling problems, add DGA
+ support, fix 24bpp acceleration problems, fix HW cursor colouring
+ problems, update docs (Egbert Eich, David Bateman, Nozomi Ytow,
+ Marc de Courville, Jens Mauer, Adam Sulmicki).
+1012. BlankDelay settings for ViRGE (non-VX) (Harald Koenig).
+1011. More S3V ROPs for planemask simulation for BLTs (not used yet)
+ (Harald Koenig).
+1010. S3V fix for some image ops (Harald Koenig).
+1009. LynxOS microSPARC updates (Thomas Mueller).
+1008. OS/2 updates (Holger Veit and Sebastien Marineau).
+1007. TGA server updates, including disallow interlace modes, parse /proc/pci
+ output to find the memory base address (Alan Hourihane).
+1006. Add a DGA flag (XF86DGADirectColormap) to control when the colourmap
+ is in the exclusive control of XF86DGAInstallColormap(). This allows
+ older DGA clients which don't use XF86DGAInstallColormap() to work
+ as before.
+1005. Fix mmap in libXxf86dga for FreeBSD 1.1.5.
+1004. Fix a typo in xf86writepci() which causes it to return without doing
+ anything (URATA Shuichiro).
+
+XFree86 3.1.2Gn (16 October 1996)
+1003. Fix a problem with the ospex Imakefile regarding the building of
+ a non-shared library.
+1002. Increase the listen(2) backlog value in Xtranssock.c.
+1001. VidMode extensions updates (Joe Moss).
+1000. Add QueryDirectVideo and ViewPortChanged functions to the DGA
+ extension (Harm Hanemaayer and Mark Vojkovich).
+ 999. Fix a problem where parts of lines incorrectly appear black with the
+ S3V server (Berry Dijk).
+ 998. Fix some S3V problems that show up when running xtest (Harald Koenig).
+ 997. Change MGAAdjustPitch to choose a pitch for which acceleration is
+ possible (Ansgar Hockmann).
+ 996. Fix some server compile warnings (Thomas E. Dickey).
+ 995. Set HasPoll to YES for NetBSD 1.2 and OpenBSD. This solves the
+ fundamental problem select has with the width of a fd_set
+ (Matthieu Herrb).
+ 994. Use modified ROPs and colour bit patterns to simulate the planemask
+ where possible in the S3V line code (Harald Koenig).
+ 993. Report the Wacom function/macro button as key events (Frederic Lepied).
+ 992. Initial DSP programming of Mach64 VT-B and GT-B implemented, but not
+ enabled yet (Kevin Martin).
+ 991. Mach64 CT, ET, VT, GT clock programming changed to be more accurate.
+ Previously it used integer arithmetic, now it uses floats (Kevin Martin).
+ 990. Mach64 VT-B and GT-B extra clock divisors (3,6,12) implemented
+ (Kevin Martin).
+ 989. Fix Mach64 VT-B and GT-B memory detection (Kevin Martin).
+ 988. Updates for LinkKit and SVR4 README files (Takaaki Nomura).
+ 987. Add a MGAWAITFIFOSLOTS macro for use with accel functions
+ (Andrew Vanderstock).
+ 986. Fix for MGA line colour that works at all depths (Andrew Vanderstock).
+ 985. Add a wait for retrace to the end of most Adjust functions when DGA
+ mode is active (Mark Vojkovich and Harm Hanemaayer).
+ 984. Fix a typo in XF86Setup, and change the vsync parameters of some
+ of the default monitor types (Harm Hanemaayer).
+ 983. ET6000 support for linear memory and 16/24/32bpp in the SVGA server
+ (Koen Gadeyne).
+ 982. OpenBSD no longer defines __NetBSD__ in their cpp (Matthieu Herrb).
+ 981. OpenBSD/NetBSD doc updates (Matthieu Herrb).
+
+XFree86 3.1.2Gm (13 October 1996)
+980. Set foreground colour for MGA line code (Ansgar Hockmann).
+979. Add weight 555 support for the Cirrus 5464 (Corin Anderson).
+978. Fix Cirrus HAVE546X macro to detect the 5464 (Corin Anderson).
+977. Updates to Cirrus docs and Cards database (Corin Anderson).
+976. Add detection of the ARK2000MI to SuperProbe (Harm Hanemaayer).
+975. Cirrus updates, including fix MMIO for the Cirrus 5446, update some
+ DAC register values, disallow clocks line and change max clock for
+ LCD displays (Harm Hanemaayer).
+974. Add some sanity checks for potential VT problems in the cirrus and
+ ARK drivers (Harm Hanemaayer).
+973. Fix for LynxOS microSPARC (Thomas Mueller).
+972. Update the LynxOS docs for 3.2 (Thomas Mueller).
+971. Change the various malloc/free calls in the XKB code to use the
+ XkbMalloc/XkbFree equivalents (Joe Moss).
+970. Update the Wacom driver to support the new stylus with two side
+ buttons. The second side button is reported as button 4
+ (Frederic Lepied).
+969. Update the LinkKit to build the SVGA and I128 servers, and update the
+ LinkKit README (Takaaki Nomura).
+968. DGA support for the W32 server (Koen Gadeyne).
+967. Resynch some PC98 Imakefiles (Takaaki Nomura).
+966. LinkKit updates for a PC98-only LinkKit (Takaaki Nomura).
+965. Add some missing bits to the MGA solid box fill patch (Radoslaw Kapitan).
+964. Fix a typo in SuperProbe that would result in incorrect chipset
+ reporting for some Cirrus chips (Harm Hanemaayer).
+
+XFree86 3.1.2Gl (10 October 1996)
+963. PC98 doc updates (Michio "Karl" Jinbo).
+962. Add some solid box fills to the MGA driver (Radoslaw Kapitan).
+961. Cirrus and Ark doc updates (Harm Hanemaayer).
+960. Apply 959 to the Mach32 server.
+959. Ignore clipping boxes completely to the left of right of each glyph
+ for the S3, Mach8 and 8514 servers (Hans Nasten).
+958. LinkKit fixes for PC98 (Takaaki Nomura).
+957. Fix Imakefile problem related to dynamic loading for PC98
+ (Michio "Karl" Jinbo).
+956. ViRGE/VX update (Harald Koenig).
+955. Add power_saver support to the TGA server (Alan Hourihane).
+954. Some more line/seg updates for S3V (Harald Koenig).
+953. Fix some problems with the previous S3V planemask patch (Harald Koenig).
+952. Add code to read the MGA card information from the BIOS. This
+ allows the RAMDAC type/speed to be determined (Andrew E. Mileski).
+951. Disable 24/32bpp for S3V server because it doesn't work yet.
+950. Driver for NVidia NV1 / SGS-Thomson STG2000 (David McKay).
+
+XFree86 3.1.2Gk (8 October 1996)
+949. Use cfb code in the S3V server when the planemask is non-trivial
+ (Harald Koenig).
+948. More line/seg fixes for the S3V server (Harald Koenig).
+947. Fix XORing text (and other ROPs) for the S3V server (Harald Koenig).
+946. Force 1-cycle EDO mode for the ViRGE/VX (Harald Koenig).
+945. Disable the font and pixmap caches in the S3V server (not implemented).
+944. Apply 943 to the Mach32 and S3V servers.
+943. Ignore clipping boxes completely above or below the displayed text
+ for the S3, Mach8 and 8514 servers. This improves performance
+ when a window is partly covered by a shaped window (Hans Nasten).
+942. Resync PC98 Imakefiles, and update documentation (Michio "Karl" Jinbo).
+941. Some LinkKit changes to prevent conflicts between the xf86 and xf98
+ linkkits when doing a combined build/install.
+940. Fix for keycodes/xfree98 (Takefumi Tsukada).
+939. LinkKit support for PC98 servers (Takaaki Nomura).
+938. Fix MGA 24bpp problems (Ansgar Hockmann).
+937. Fix a potential memory interleave problem and spurious warning messages
+ in the Cirrus driver (Corin Anderson).
+
+XFree86 3.1.2Gj (6 October 1996)
+936. Build PEX, XIE as dynamically loaded modules by default where it is
+ supported.
+935. Fix some S3gendac interface changes (Koen Gadeyne).
+934. Fix a lex warning for reconfig (Koen Gadeyne).
+933. Fix a ROP problem in the W32 solid fill code (Koen Gadeyne).
+932. Dynamic PEX, XIE extension support for Linux/ELF.
+931. 24bpp packed support for the MGA driver (Ansgar Hockmann).
+930. Fix the way the list of clocks is derived for the Cirrus driver
+ (Harm Hanemaayer).
+929. Fix problems with 16bpp for a 1MB Cirrus 5434 (Harm Hanemaayer).
+928. Fix for xdm indirect query for ISC (Michael Rohleder).
+927. Remove virtual size check in the mach32ValidMode (Michael Rohleder).
+926. Fix a typo in lib/Xbsd (Michael Rohleder).
+925. Fix "nolinear" mode in the MGA driver (Radoslaw Kapitan).
+924. Add memory detection to the MGA driver (Radoslaw Kapitan).
+923. Update NetBSD/OpenBSD docs (Matthieu Herrb).
+922. Add OpenBSD/mips config support (Per Fogelstrom, Matthieu Herrb).
+921. Update OpenBSD version to 2.0 (Matthieu Herrb).
+920. Updates to the S3 ViRGE line code (Harald Koenig).
+919. Updated ViRGE/VX support (Harald Koenig).
+918. TGA server shouldn't report DGA support (Alan Hourihane).
+917. Alpha-related config updates (Harald Koenig).
+916. Updates to Cirrus probing in SuperProbe (Harm Hanemaayer).
+915. Fix a Cirrus bitmap overrun problem (Harm Hanemaayer).
+914. Fix Cirrus FIFO settings for 5436/5446 (Harm Hanemaayer).
+913. Fix Cirrus HW cursor colours at 32bpp (Harm Hanemaayer).
+912. Fix 24bpp support for Cirrus 54xx (Harm Hanemaayer).
+
+XFree86 3.1.2Gi (3 October 1996)
+911. SCO updates. SCO5 is now the only supported version (there are
+ still problems to be resolved though) (J. Kean Johnston).
+910. LinkKit updates and related cleanups (Marc Aurele La France).
+909. Updated code to program the Ti3026 clock in the MGA server
+ (Andrew E. Mileski).
+908. Preliminary S3 ViRGE/VX support (Harald Koenig).
+907. Fix S3 PCI read burst disable problem (Harald Koenig)
+906. Fix SuperProbe memory reporting for the S3 ViRGE, ViRGE/VX, and
+ separately report off-screen memory (Harald Koenig).
+905. Fix MGA interleave and 32bpp problems (Radoslaw Kapitan).
+904. Fix a RD_MASK problem that shows with 928 cards (at least on some
+ PC98 servers) (Michio "Karl" Jinbo, Harald Koenig).
+903. Allow xterm to be statically linked with libtermcap on Linux
+ (Dirk Hohndel).
+902. Fix screen save/restore on VT switch for the TGA server (Alan Hourihane).
+901. Chips&Tech updates, including a fix for line acceleration
+ problems (David Bateman).
+900. VidMode extension changes/enhancements (not complete yet) (Joe Moss).
+899. S3 ViRGE solid line code (Harald Koenig).
+898. S3 ViRGE updates, including using cfb calls for non-implemented
+ functions (Harald Koenig).
+897. Fix for a line drawing problem in the Cirrus driver (Harm Hanemaayer).
+896. Ark driver updates, including fixes for FIFO settings, HW cursor at
+ 16/32bpp, virtual panning at 24bpp, and enable BitBlt acceleration at
+ 32bpp (Harm Hanemaayer).
+895. LynxOS microSPARC updates (Thomas Mueller).
+894. Add support for Japanese 106 key keyboards on PANIX. This is enabled
+ with the 'panix106' keyword in the Keyboard section (Takefumi Tsukada).
+893. README.SVR4 update (Takaaki Nomura).
+892. ValidMode function for Mach32 (Bryan Feir).
+891. Fix a Mach32 problem with VT switch screen save/restore when the
+ virtual width is less than 1024 (Bryan Feir).
+890. Updated NetBSD aperture driver (Matthieu Herrb).
+889. Allow the PEX and XIE server extensions to be built as dynamic modules
+ (FreeBSD and NetBSD so far). (Matthieu Herrb).
+
+XFree86 3.1.2Gh (29 September 1996)
+888. Replace virtualX by displayWidth where appropriate in many SVGA drivers.
+887. Fix virtual width/pitch checking/setting for the MGA driver.
+886. Solid line acceleration for the MGA driver (Dirk Hohndel).
+885. Improve the way scanline pitch restrictions are implemented for the
+ SVGA server.
+884. Set default W32 black/white pixel values the same as for the other
+ servers.
+883. Fix some W32 stipple problems (Glenn Lai).
+882. Allow "mclk" as a synonym for "s3mclk" (Harm Hanemaayer).
+881. Adjust mode timings in the ARK driver when required for 24bpp operation
+ and for HW cursor operation (Harm Hanemaayer).
+880. Some MGA driver cleanups.
+879. Fix selection of interleave mode for MGA (Ansgar Hockmann).
+878. Add "fifo_conservative" option for the ARK driver (Harm Hanemaayer).
+877. Possible fix for ICS5342 MCLK calculation in the Ark driver
+ (Harm Hanemaayer).
+876. Fix max clocks when ClockChip "cirrus" is used (Harm Hanemaayer).
+875. XF86Setup updates (see XF86Setup/CHANGELOG for details) (Joe Moss).
+874. LCD code for Cyber9320 in PC98_TGUI server (X98 core team).
+873. Fix typos in pc98_tgui.{c,h} (X98 core team).
+872. PC98 Imakefile updates (X98 core team).
+871. PC98 documentation updates (X98 core team).
+870. New Chips&Tech accelerations, including: multiple depth ImageGlyph
+ and PolyGlyph for 65545, 8bpp CopyPlane1to8 for 65545, 8bpp
+ FillRectTransparentStippled32 and FillRectOpaqueStippled32 for 65545,
+ modified simple BitBlt and Solid fill for 65550, stipple and tile
+ functions for 65550 (Egbert Eich, Xavier Ducoin, David Bateman).
+869. Chips&Tech driver fixes, including: improve stability of
+ suspend/resume, fix DSTN screens with 65550, reduce the size of
+ MMIO regions, fix PCI burst mode, disable line acceleration because
+ it can cause a server crash in rare circumstances (Egbert Eich,
+ Xavier Ducoin, David Bateman).
+868. Make the Cirrus fifo options work for the 546x chips (Corin Anderson).
+867. Support for the Cirrus 5464 (Corin Anderson).
+866. Add a hook to the SVGA server to allow drivers to specify a display
+ width (pitch) which is different from the virtual width. This
+ is required for some Cirrus chipsets (Corin Anderson).
+865. 24bpp packed pixel Cirrus support (Harm Hanemaayer and Corin Anderson).
+864. Work around a problem on NetBSD/OpenBSD where dlsym() searches for
+ the symbol in the whole executable rather than just in the modules
+ specified (Matthieu Herrb).
+863. Add an X server and config/imake support for LynxOS microSPARC 2.4.0
+ (Thomas Mueller).
+862. Remove stale fb shared memory before dying on LynxOS (Thomas Mueller).
+861. Work around a popen/pclose bug on LynxOS in the server XKB code
+ (Thomas Mueller).
+860. Work around a bash problem on LynxOS which affects rstart/Imakefile
+ (Thomas Mueller).
+859. Solid vertical and horizontal lines for the S3 ViRGE server (Berry Dijk).
+858. Fix max clock for TGA (Alan Hourihane).
+857. Fix for TGA VT switching problems (Alan Hourihane).
+856. Add code to detect the ViRGE/VX (Dirk Hohndel).
+
+XFree86 3.1.2Gg (26 September 1996)
+855. Preliminary support for the Matrox Millennium (MGA 2064W)
+ (Radoslaw Kapitan, Andrew Vanderstock, Dirk Hohndel).
+
+XFree86 3.1.2Gf (25 September 1996)
+854. Mach32 documentation (Bryan Feir).
+853. Improve Mach32 ramdac probing in SuperProbe (Bryan Feir).
+852. Fix xf86writepci() prototype (Alan Hourihane).
+851. TGA server and documentation updates (Alan Hourihane).
+850. Fix missing argument in the QueryBestSize functions in the SVGA server
+ (Harm Hanemaayer).
+849. Another fix for usage of XInput defines, and make initext depend on
+ ICONFIGFILES (Marc Aurele La France).
+848. Improve reliability of detecting Mach64 cards in SuperProbe, the
+ Mach64 server and the ati driver (Marc Aurele La France).
+847. Complete s3im.c for s3_virge (Harald Koenig).
+846. Fix s3_virge framebuffer detection (Harald Koenig).
+845. Fix s3_virge compile problems when using a compiler other than gcc.
+844. Missing patch to vgaCmap.c for item 842 (Harm Hanemaayer).
+
+XFree86 3.1.2Ge (24 September 1996)
+843. Add Trio/ViRGE clock support to the "s3_svga" driver. This is still
+ incomplete, and for development use (Harald Koenig).
+842. Add vgaGetInstalledColormaps() and support for 8-bit colour components
+ to the SVGA server (Harm Hanemaayer).
+841. ARK driver updates, including: fix problems with BitBlts at 24bpp,
+ fix hw cursor at 8bpp, fix some ZoomDAC problems, and add support
+ for 8-bit colour components (dac_8_bit) at 8bpp (Harm Hanemaayer).
+840. Fix some typos in compiler.h (Harald Koenig).
+839. Initial ViRGE s3im.c, and remove unneeded s3linear.h and bank switching
+ (Harald Koenig).
+838. Fix some XInput and XKB defines (Marc Aurele La France).
+837. LinkKit fixes (Marc Aurele La France).
+836. Add ARK Logic chipset detection to SuperProbe (Harm Hanemaayer).
+835. Fix a typo in xkbcomp/symbols/de (Thomas Mueller).
+
+XFree86 3.1.2Gd (23 September 1996)
+834. Rename ViRGE driver from s3_generic to s3_virge (Dirk Hohndel).
+833. Don't reference uninitialised s3MmioMem in ViRGE server (Harald Koenig
+ and Dirk Hohndel).
+832. Don't do S3 bug tests for 928 and earlier (Harald Koenig).
+831. ViRGE fixes, including BITBLT and text clipping (Harald Koenig).
+830. Updates to the Cards file for Cirrus and Ark (Harm Hanemaayer).
+829. xf86config updates, including 24bpp support, and making "virtual"
+ optional (Harm Hanemaayer).
+828. Fix trident probe so that it restores all registers it touches
+ (Harm Hanemaayer).
+827. ARK driver updates, including: auto-detect the ZoomDAC and print out
+ the RAMDAC type, use DRAM bandwidth for CRT FIFO setting, don't allow
+ 5-5-5 weight for 16bpp with 1000PV and ZoomDAC, and add sanity check
+ for off-screen CopyWindow (Harm Hanemaayer).
+826. Fix a typo in the TGA server that could cause it to think it has found
+ a valid mode (Alan Hourihane).
+825. Don't try to use -ldl for XF86Setup on non-ELF Linux (Harald Koenig).
+824. Add "slow_dram" option for the W32 server to fix some problems with
+ older cards (Dirk Hohndel).
+
+XFree86 3.1.2Gc (22 September 1996)
+823. XKB data file updates for jp106/jp (Takaaki Nomura).
+822. S3 Virge server (preliminary version) (Harald Koenig).
+821. ARK driver updates, including basic BitBlt acceleration, improved
+ ramdac support, experimental 24bpp support, and max dot clocks take
+ the memory clock into consideration (Harm Hanemaayer).
+820. Minor xdm and xterm changes to allow them to compile on FreeBSD 1.1.5.
+819. Fix Trident probe in SuperProbe so that it doesn't corrupt ET6000
+ display (Koen Gadeyne).
+818. Fix Sierra 1502X RAMDAC handling in the W32 server (Dirk Hohndel).
+817. TGA server for Alpha machines. Not accelerated at this stage
+ (Alan Hourihane).
+816. SuperProbe update for ELSA Gloria (Harald Koenig).
+815. Fix/add 15/16bpp support for S3 805i with AT&T 20C498 (Hermann Lauer).
+814. Improve S3 clipped text performance (Harald Koenig).
+813. Fix a typo in xkbcomp/rules/xfree86 (Joe Moss).
+812. Add detection for the Cirrus 7548, and treat it like the other 754x
+ chips (Harm Hanemaayer).
+811. Change xterm valid-response code in DECRQSS from 0 to 1 to match a
+ real VT420 terminal (Thomas E. Dickey).
+810. Add a resource 'decTerminalID' to control the reporting level of
+ xterm (e.g., VT100, VT220), and use it to implement/correct the
+ DA1, DA2 and DECRPTUI reports (Thomas E. Dickey).
+809. Fix xterm restoration of color for bold/underline color mode
+ (Thomas E. Dickey).
+
+XFree86 3.1.2Gb (15 September 1996)
+808. Update PC98 Imakefiles (Michio "Karl" Jinbo).
+807. Fixes for problems with the PC98 TGUI server (Michio "Karl" Jinbo).
+806. Fix/workaround to avoid DGAInstallColormap() being affected by
+ window managers.
+805. Fix some problems related to the change in the xf86scanpci() interface.
+
+XFree86 3.1.2Ga (14 September 1996)
+804. Implement s3ValidMode() (Mark Vojkovich).
+803. Modify the ValidMode interface in preparation for some VidMode extension
+ changes.
+802. Fix a problem with the XOpenDisplay buffer overflow fix (item 734 below)
+ (X Consortium, Kaleb Keithley).
+801. Fix FIFO setting for Cirrus Alpine (543x, 5446) cards with 1MB
+ (Harm Hanemaayer).
+800. Modify Cirrus asm code to allow PCI burst accesses (Harm Hanemaayer).
+799. Change default for MvCmd to 'mv -f'.
+798. Redo the xf86PCI code, based on that in FreeBSD-current.
+797. Update xf86PCI code to deal with PCI bridges and multi-function
+ devices (Mihoko Tanaka).
+796. Fix a problem with the Sigma L-View driver (and presumably the same
+ problem in the HGC1280 driver (Norbert Berzen).
+795. Add a "Sundeadkeys" XKB variant for European keyboards.
+794. Change the "es" XKB symbols to match a Spanish keyboard (Jon Tombs).
+793. Update Cards database.
+792. Fix panning problem with some Cirrus cards (Corin Anderson).
+791. Map the S3 MMIO area separately (Harald Koenig).
+790. Don't allow S3 newmmio to be selected for chips that don't support
+ it (Harald Koenig).
+789. Fix for Linux/m68k frame buffer device (Geert Uytterhoeven).
+788. Fix detection of some SiS chips.
+787. Turn on 32-bit mode for TGUI chips. This allows PCI burst to be
+ turned on by default. (Alan Hourihane).
+786. Disable 16bpp for the TGUI9320LCD since it doesn't work (Alan Hourihane).
+785. Fix ET6000 problems with the VGA16/Mono servers (Koen Gadeyne).
+784. Speedups for the W32 arc and teblt8 code (Glenn Lai).
+783. Fix W32 line-drawing using the wrong ROP for horizontal and vertical
+ lines (Koen Gadeyne).
+782. Add a new xdm access control keyword "NOBROADCAST" to disable answering
+ broadcasts from specified hosts (Kimmo Suominen).
+781. Make xf86config run the correct server by name rather than trying
+ to run 'X' (Holger Veit).
+780. Change default "gb" XKB symbols (James Hawtin).
+779. Config and documentation updates for LynxOS (Thomas Mueller).
+778. Update XF86Setup's device list for LynxOS (Thomas Mueller).
+777. Fix compile problem when XINPUT isn't defined (James Hawtin).
+776. XF86Setup needs to be linked with -ldl on Solaris (James Hawtin).
+
+XFree86 3.1.2G (3 September 1996)
+775. Fixes for some NECS3 server problems (Naofumi Honda).
+774. Fix some XF86Setup typos.
+773. OS/2 updates (Holger Veit).
+
+XFree86 3.1.2Fc (3 September 1996)
+772. XF86Setup updates (see XF86Setup/CHANGELOG for details) (Joe Moss).
+771. PCI detection for the Alliance ProMotion 6422 (Kent Hamilton).
+770. Documentation updates (Dirk Hohndel, Matthieu Herrb).
+769. Updates for OpenBSD, including support for recent changes to the
+ console drivers (Matthieu Herrb).
+768. Need rint() for ISC and Lynx (Michael Rohleder).
+
+XFree86 3.1.2Fb (1 September 1996)
+767. S3 support for the Diamond SS2410 RAMDAC (eriks).
+746. Fix resize on Linux (for terminfo) (Rik Faith).
+745. Updates to Cyrillic fonts (Andrey Chernov).
+
+XFree86 3.1.2Fa (31 August 1996)
+744. Fix xterm's handling of SGR 22, 24 and 25 in combination with colorUL
+ and colorBD resources. Also noted & fixed reset of colored
+ underline/bold with SGR 0 (Thomas E. Dickey).
+743. Fix a typo in the xterm termcap (Thomas E. Dickey).
+742. Don't allow the "fb_debug" option when newmmio is used (Harald Koenig).
+741. Make sure s3Port59/s3Port5A are initialised before s3Init() is called
+ (Harald Koenig).
+740. Force 64MB alignment of linear FB, even when MemBase is given in
+ the config file (Harald Koenig).
+739. Disable newmmio when "nolinear" is specified, or when linear memory
+ mapping isn't available (Harald Koenig).
+738. Fix C&T driver printing out a line in its probe in cases where a
+ C&T chip hasn't been detected.
+737. Driver for the Alliance ProMotion 6422 (Alliance Semiconductor, and
+ Kent Hamilton).
+736. Make the Ark SVGA driver detect the ARK2000MT, and treat it as an
+ ARK2000PV.
+735. Updates for SCO OpenServer 5 support (J. Kean Johnston).
+734. Fix for a buffer overflow problem in XOpenDislpay (libX11)
+ (X Consortium, Kaleb Keithley).
+733. Some imake/config updates (Dirk Hohndel).
+732. Add a '-nolock' server command line option to disable the X server
+ locking (Roger Wolff).
+731. Scanpci updates: Check general pci-pci bridges, add some more
+ vendor and device IDs, and add a '-f' flag to print out the full
+ information -- otherwise just print the vendor/device name
+ (Mihoko Tanaka).
+730. Updates for ISC (Michael Rohleder).
+729. Fix typo in XF86Setup/mouse.tcl (Thomas Mueller).
+728. Fix malloc problem in TLI xtrans code (Joe Moss).
+727. Fix some WaitQueue problems with the S3 server (Naofumi Honda,
+ Takaaki Nomura, Harald Koenig).
+726. Fix for display problem with Trio64V+ at 16bpp (Harald Koenig).
+725. Fix clock limit arrays for Cirrus 754x chip (Corin Anderson).
+724. Add a "DefaultColorDepth" keyword for the Screen section of the
+ XF86Config (Dirk Hohndel).
+723. Fix problem using non-linear mode with TGUI chips (Alan Hourihane).
+722. Turn off PCI burst write by default for TGUI chips.
+
+XFree86 3.1.2F (27 August 1996)
+721. Update the QuickStart guide with details about using XF86Setup (Joe Moss).
+720. Some XF86Setup updates (Joe Moss).
+719. Avoid a possible malloc/free problem in the xtrans TLI code (Joe Moss).
+718. Some Linux a.out lib updates for libX11, libXt (Harald Koenig).
+717. Fix 32bpp S3 newmmio problem (Harald Koenig).
+
+XFree86 3.1.2Eo (26 August 1996)
+716. Disable 24bpp packed mode in S3 server because it doesn't work properly
+ yet (Harald Koenig).
+715. Don't use newmmio S3 driver by default on Alpha architecture (or
+ for ISC) (need to specify it explicitly in XF86Config) (Harald Koenig).
+714. Fix some incorrect printf-style arguments in xkbcomp (Thomas E. Dickey).
+713. Fix compiler warnings, including uninitialised variables, missing
+ prototypes, etc (Thomas E. Dickey).
+712. XF86Setup updates (Joe Moss).
+711. Fix for some potential buffer overrun problems in libXt and libX11 that
+ can lead to security holes.
+
+XFree86 3.1.2En (25 August 1996)
+710. Build/install the xkbui library regardless of whether XF86Setup is
+ being built.
+709. Fix lots of compiler warnings and related problems when building on
+ Alpha (Richard Henderson).
+708. Fix missing function prototype problem in libXi that causes problems
+ on Alpha platforms (Richard Henderson).
+707. XF86Setup updates.
+
+XFree86 3.1.2Em (24 August 1996)
+706. Swap acute and apostrophe keys in de(nodeadkeys) (Michael Rohleder).
+705. ISC documentation updates (Michael Rohleder).
+704. Chips & Tech documentation update (Egbert Eich).
+703. Chips & Tech driver updates, including a fix for a 65545 PCI problem,
+ and a hack/option for a suspend/resume problem (Egbert Eich).
+702. Major updates to XF86Setup (Joe Moss).
+701. Updates to the Cards database (various).
+700. ATI (SVGA) driver update (Marc Aurele La France).
+699. Cards file update for AGX (Henry Worth).
+698. Fix for a BIOS initialisation problem on some VideoLogic (S3) cards
+ (Harald Koenig).
+697. Fix some 32bpp problems with S3 newmmio (Harald Koenig, Bernd Lind).
+696. Fix some PCI lockups when using S3 newmmio mode (Harald Koenig).
+
+XFree86 3.1.2El (23 August 1996)
+695. NetBSD/OpenBSD doc updates (Matthieu Herrb).
+694. Fix typo in rules/xfree86 (Joe Moss).
+693. Fix some virtual desktop scrolling bugs with the CL-GD5462 in the
+ Cirrus driver (Corin Anderson).
+692. Set BSD (syscons/pcvt) keyboard to K_RAW after establishing the tty
+ settings (was done in the opposite order) (Naofumi Honda).
+691. Fix PCVT_SUPPORT in BSD xf86KbdOn/Off functions (Naofumi Honda).
+690. Add correct handling of PCI connect/disconnect for the PC98 S3 968
+ server (Naofumi Honda).
+689. Fix PCI probing for PC98 machines (Michio Jinbo).
+688. Fix mask used for TGUI fb address when membase is supplied (Michio Jinbo).
+687. Add an xterm option/resource to allow text selection to be shown
+ differently -- ie, only highlight the characters selected when selecting
+ beyond the end of a line (Thomas E. Dickey).
+686. Fix PCI base address for S3 868/968, and newmmio fixes (Harald Koenig).
+685. Fix problem with memory allocation in XKB that could cause the server
+ to crash (Joe Moss).
+
+XFree86 3.1.2Ek (21 August 1996)
+684. Fixes for m68k support (Geert Uytterhoeven).
+683. Naming changes for m68k servers and config options (Geert Uytterhoeven).
+682. Update SuperProbe to identify the amount of memory for a 65550/54,
+ and fix detection of 65545 (David Bateman).
+681. Fix for 65545 PCI problems in the C&T driver (Egbert Eich).
+680. resync os2_select.c (Holger Veit).
+
+XFree86 3.1.2Ej (20 August 1996)
+679. Fix install problem when xkbcomp is linked against shared libs.
+678. Prevent server exit if the mouse device is changed to something
+ unsuitable (Joe Moss).
+677. XF86Setup updates (Joe Moss).
+676. Update XF86Config man page and sample XF86Config file for XKB changes
+ (Joe Moss).
+675. LinkKit fixes (David Bateman).
+674. Chips & Tech driver updates (David Bateman and others?).
+673. xterm bug fixes (Thomas E. Dickey).
+672. PCI probe fix for S3 server (Harald Koenig).
+671. Support for new MMIO style for 868/968/Trio64V+, and MMIO support
+ (with optimised use of memory barriers) for Alpha/AXP. This currently
+ has problems at 32bpp (Bernd Lind, Harald Koenig).
+670. Use POSIX termios for xterm for all Linux systems (Richard Henderson).
+669. Generalise mmap access to DENSE I/O memory for Alpha (Richard Henderson).
+668. 32/64 bit cleanup, especially in server's XIE code (Richard Henderson).
+667. Config updates for Linux/Alpha (Richard Henderson).
+666. Updates for OS/2 (Holger Veit).
+665. Fix problems building XF86Setup with BuildServersOnly set to YES.
+
+XFree86 3.1.2Ei (18 August 1996)
+664. Fix some PC98 Imakefile problems (Michio "Karl" Jinbo).
+663. Linux/m68k support (Geert Uytterhoeven, Martin Schaller, Gary Henderson).
+662. Change the S3 server's handling of situations where mode choices
+ cause problems. It is now less likely to exit in these situations.
+661. Add a -bestRefresh command line option to the X servers to change
+ the mode selection to pick the mode with the best refresh rate when
+ multiple modes of the same name are available.
+660. XF86Setup updates (see XF86Setup/CHANGELOG) (Joe Moss).
+
+XFree86 3.1.2Eh (14 August 1996)
+659. Update Cyrillic fonts (Andrey Chernov).
+658. Add support for the CL-GD5462 to the cirrus driver, and update
+ documentation for recent cirrus driver changes (Corin Anderson).
+657. XF86Setup updates (Joe Moss).
+656. Fix some LynxOS-related typos in the config (Thomas Mueller).
+655. Add a man page for the DGA extension.
+
+XFree86 3.1.2Eg (14 August 1996)
+654 Update Japanese docs (Michio "Karl" Jinbo).
+653 Add XF98_GA968 server for GA-968V4/PCI(S3 968) (Michio "Karl" Jinbo).
+652. Bring the PC98 tree into sync with the main tree, and add XF86Setup
+ (Michio "Karl" Jinbo).
+651. Fix problems with 32bpp sparse mode that were introduced in 3.1.2Eb.
+ Need to check that this fix works OK with 24bpp packed mode.
+650. Fix some compiler warnings (Thomas E. Dickey).
+649. Mods to ct_driver.c so that it will compile on SVR4.0 (no nested
+ asm calls, and work around a code generation problem).
+648. Fix some problems with mouse changes in 3.1.2Ef (Joe Moss).
+
+XFree86 3.1.2Ef (13 August 1996)
+647. ET6000 support for the SVGA and W32 servers. The support in the
+ W32 server is accelerated (Koen Gadeyne).
+646. Add support to xterm for most vt220 and vt320 terminal features
+ (Thomas E. Dickey).
+645. Support for I128 series II cards (Robin Cutshaw).
+644. Wacom driver updates (Frederic Lepied).
+643. Support for core motion history management through mi (Frederic Lepied).
+642. Improved integration of mouse with XInput (Frederic Lepied).
+641. Major updates to XF86Setup (Joe Moss).
+640. Update to latest version of XKB.
+639. Fix broken 32bpp sparse support in S3 server (there are still some
+ problems though, and they are also seen with the Mach64 server).
+
+XFree86 3.1.2Ee (11 August 1996)
+638. Implement ech and ech1 terminal capabilities for xterm (Thomas E. Dickey).
+637. Add blinking cursor support for xterm (disabled for now)
+ (Thomas E. Dickey).
+636. Fix a PEX font struct being freed twice (Richard Henderson).
+635. Make xterm tolerant of applications that allocate the whole colour map
+ (by disabling colour mode if the ANSI colours are set with non fg/bg
+ values) (Thomas E. Dickey).
+634. Allow ISO colour support to be #ifdef'd out in xterm. This allows
+ xterm's memory usage to be significantly reduced when colorMode is not
+ enabled (Thomas E. Dickey).
+633. Reduce flickering during resize for ReverseVideo in xterm
+ (Thomas E. Dickey).
+632. Fix xterm core dump problem on IRIX 5.2 (Thomas E. Dickey).
+631. Update scanpci to detect the #9 I128 series II (Robin Cutshaw).
+630. Preliminary Mach32 ramdac support updates (Bryan Feir).
+629. Document new xterm control sequences (Thomas E. Dickey).
+628. Fix problem introduced in 3.1.2E with software cursor on some non-i386
+ platforms (Thomas E. Dickey and Thomas Mueller).
+627. Support for SCO Open Server 5 (J. Kean Johnston).
+626. Add detection of the S3 ViRGE chip to SuperProbe (and scanpci), and
+ use PCI probing for S3 chipset detection in SuperProbe where appropriate
+ (Harald Koenig).
+625. Add detection of newly supported C&T chips to SuperProbe.
+624. Add a TextClock keyword for the XF86Config to fix problems restoring
+ the text clock with the chips & tech driver (Egbert Eich).
+623. Updates for the LinkKit (Egbert Eich).
+622. Significantly improved driver for Chips and Technologies chipsets.
+ Includes linear addressing (65530 and above), 16/24bpp (65540 and above),
+ programmable clock support (65540 and above), HW cursor support (65545
+ and above), BitBLT acceleration (65545/46 and 48), support for the
+ 65546, 65548, 65550 and 65554 (Nozomi Ytow, Egbert Eich, Ken Raeburn,
+ Xavier Ducoin and David Bateman).
+
+XFree86 3.1.2Ed (10 August 1996)
+621. Fix xterm colour translation problem (Michael Rohleder and
+ Thomas E. Dickey).
+620. xterm termcap/terminfo fixes (Thomas E. Dickey).
+619. Add escape sequences to xterm that act like CDE ddterm's window
+ operations (Thomas E. Dickey).
+618. Set the initial cleared screen colour correctly for the 8514 and Mach8
+ servers to match the default black pixel value and the -flipPixels
+ flag (Hans Nasten).
+617. Add support for LynxOS AT version 2.4.0, and client-only support for
+ LynxOS microSPARC and PowerPC (Thomas Mueller).
+616. Config updates for OpenBSD and NetBSD 1.2 (Matthieu Herrb).
+615. Fix typo in trident driver, and update XFree86 man page (Alan Hourihane).
+614. Fix problems with Trio64V+ video blanking signal. Some undocumented
+ options "trio64v+_bug1" to "trio64v+_bug3" have been added enable/disable
+ parts of the code in case they are required later (Harald Koenig).
+613. Don't require SuperProbe to do the BIOS signature check for VGA cards
+ when the PCI probe detects a VGA card (Koen Gadeyne).
+612. Add ET6000 detection to SuperProbe (Koen Gadeyne).
+611. Add PCI detection of ET6000 to scanpci and SVGA server (Koen Gadeyne).
+610. Update AGX documentation (Henry Worth).
+609. Add DGA support to the AGX server (Henry Worth).
+608. AGX server recognises "fast_vram" and "slow_vram" options as equivalents
+ to "fast_dram" and "slow_dram" (Henry Worth).
+607. 8 bit/RGB DAC mode is now the default for the AGX server where supported
+ (Henry Worth).
+606. Fix initialisation of the Bt481 for AGX-016 based Hercules dual-DAC
+ Graphite cards (Henry Worth).
+605. Fix overscan colour correctly for the AGX server to match the change
+ to the default black pixel value and the -flipPixels flag (Henry Worth).
+604. Update et4000w32.c for ChipHas24bpp in vgaVideoChipRec (Thomas E. Dickey).
+603. Prevent Xserver from exiting when a mouse device can't be opened and
+ the '-allowMouseOpenFail' command line option is used (Joe Moss).
+602. Add CL-GD5446 detection to SuperProbe.
+601. Add support for CL-GD5446 to the cirrus driver (Corin Anderson).
+600. Add PCI detection of Cirrus CL-GD5446 to SVGA server and scanpci
+ (Corin Anderson).
+599. Add a function XF86DGAForkApp() to the dga library, which causes
+ the client to fork, with the parent remaining to clean up after the
+ child exits (Jon Tombs).
+598. Add an InstallColormap function to the DGA extension (Jon Tombs).
+597. Fix broken DGA setviewport on SVGA servers (Jon Tombs).
+
+XFree86 3.1.2Ec (8 July 1996)
+596. XF86Setup fixes and updates (Joe Moss).
+595. Fix some build problems on Solaris due to the positioning of
+ <stdlib.h> includes in xconsole and xwd (William Austin).
+594. Fix a make problem in xfree98/vga16/drivers (Takaaki Nomura).
+593. Add some minor features from ISO 6429 to xterm (Thomas E. Dickey).
+592. Fix for SiS clock programming, and implement HW cursor for SiS
+ (Alan Hourihane).
+591. XInput support for SummaSketch tablets (Steven Lang).
+590. Improve the startup of the Wacom driver (Frederic Lepied).
+589. Fix an XInput bug with extended events reporting the wrong number
+ of valuators (Frederic Lepied).
+588. Fix xterm's utmp usage for Solaris (Christos Zoulas).
+
+XFree86 3.1.2Eb (30 June 1996)
+587. Fix MMIO setting which causes problems with Trio64V+ cards in machines
+ with PCI SCSI controllers (Harald Koenig).
+586. Auto-select the ICD2061A for Diamond Stealth 64 VRAM cards (when
+ a Diamond BIOS, Bt485 and S3 964 are all detected).
+585. Fix a problem with the VGA16 server when Chipset "generic" is specified.
+584. Fix twm/gram.y and fonts/PEX/to_wfont.y problems that show up when
+ using bison-1.25 (Matthieu Herrb).
+583. Move the beta expiry check code into a separate file, and add a command
+ line option to allow the expiry date to be extended when a key is
+ provided.
+582. Preliminary 24bpp packed support for some S3 cards (Harald Koenig).
+581. Add 24bpp (packed pixel) support for cfb (cfb24), and the required
+ hooks for using it with the SVGA server (Shigehiro Nomura and
+ NoZomi Ytow).
+580. Fix some xterm background colouring problems (Thomas E. Dickey).
+579. Allow the PCI burst to be separately turned on/off for read and write
+ for the TGUI chips (Alan Hourihane).
+578. vgaHW.c fix (NoZomi Ytow).
+577. Fix for Mach64 block_write problems introduced in 3.1.2E (Kevin Martin).
+576. An alternate fix to the Makedirectories() rule, which causes only
+ one 'sh -c' to be used (Marc Aurele La France).
+575. Some sanity checks for the trident driver (Alan Hourihane).
+574. Another HSkew fix for the ATI SVGA driver (Marc Aurele La France).
+573. Add 256 colour support to the SiS driver (Alan Hourihane).
+572. Fix a stdlib.h -related problem in xwd (Joe Moss).
+571. Fix a stdlib.h -related problem in xfs/os/utils.h (Takaaki Nomura).
+570. Add a new Xserver configuration utility -- XF86Setup (Joe Moss).
+569. Remove the "-noscale" flag from the Xserver usage message (Joe Moss).
+568. Fix session handling of xdm for *BSD (Peter Wemm).
+
+XFree86 3.1.2Ea (10 June 1996)
+567. xf86config.c update in preparation for the XF86Setup utility (Joe Moss).
+566. Fix some Mach64 problems in the SVGA ati driver (Marc Aurele La France).
+565. Fix the xf86GetClocks prototype (Marc Aurele La France).
+564. Fix MakeDirectories rule (Stephen Hocking).
+563. By default, don't change PCI burst settings for TGUI (Alan Hourihane).
+562. Fix interlaced modes for the SVGA ali driver (Thomas Graichen).
+561. xfs updates for OS/2 (Sebastien Marineau).
+560. Fix some TGUI problems introduced in 3.1.2E (Alan Hourihane).
+559. Fix problems with scanpci on NetBSD (Michio "Karl" Jinbo).
+558. Some cleanups/removal of compiler warnings (Christos Zoulas).
+557. Patch for compiling on BSD/OS 2.1 (Mike Bernson).
+556. Turn off the Xaw3d arrow scrollbar support in xterm by default (it
+ causes xterm to suck CPU), and make it an option/resource
+ (Thomas E. Dickey).
+555. Reinstate the "no_program_clocks" for TGUI9440 chips (Alan Hourihane).
+554. XInput updates, including motion history support for the joystick and
+ elo devices, removing auto link speed detection for the elo -- it is
+ now set with the LinkSpeed XF86Config option, and added acceleration
+ handling for relative devices (Patrick Lecoanet and Frederic Lepied).
+553. Add VGA16 support to the ET3000 driver (Thomas Graichen).
+552. Fix for first button click in a xterm being mistaken for a double
+ click (Kaleb Keithley).
+551. Fix for server crash on Alpha when using the logo screen saver
+ (Manabe Takashi).
+550. xkb datafile updates, including more/better European keymaps, pc102
+ geometry and keycodes (Stuart Anderson, courtesy Metro Link).
+549. Fix xterm problem on *BSD (VMIN initialisation) that would cause
+ rlogin to fail (Matthieu Herrb).
+548. Fix problems when a dynamic module is specified with an absolute path.
+
+XFree86 3.1.2E (13 May 1996)
+547. Fix Trio64V+ problem with DAC entry#255 for color mode 0 (1 8bpp/DCLK)
+ by only using color mode 8 (2 8bpp pixel/DCLK, CR67=10) (Harald Koenig).
+546. Added options to the S3 server to slow down DRAM and EDO DRAM access
+ (Harald Koenig).
+545. Add inlined assembler code to do unaligned access on Alphas
+ (Harald Koenig).
+544. Fix a font corruption problem for Alphas in cfb (Harald Koenig).
+543. Fix sample Xcms.txt colour entries (Harald Koenig).
+542. Fix some problems building the a.out DLL version of libX11
+ (Harald Koenig).
+541. OS/2 updates (Sebastien Marineau).
+540. Fix(?) server crash on keyboard input when using DGA with XKB disabled.
+539. Install xterm termcap/terminfo files in lib/X11/etc for all OSs, not
+ just SYSV/SVR4.
+538. Convert egc_asm.s to the portable assembler format so it can be built
+ on SVR4 (Takaaki Nomura).
+537. Fix Mach64 ghostview scrollbar problem. This may also fix some font
+ corruption problems seen in Netscape (Kevin Martin).
+536. Fix Mach64 ol[v]wm icon problem (Kevin Martin).
+535. Add Mach64 cursor in doublescan mode -- this still has problems
+ (Kevin Martin).
+534. Add Mach64 doublescan mode for low resolution modes (only works so far
+ for the VT chip) (Kevin Martin).
+533. Fix Mach64 264VT support in the Mach64 server (Kevin Martin).
+532. Update the xterm termcap and terminfo descriptions (Thomas E. Dickey).
+531. Fix an xterm bug where XmbLookupString is used even though an
+ IM/IC isn't open/used (Kaleb Keithley).
+530. Fix a clock roll-over bug in xterm (Kaleb Keithley).
+529. Add some new locale aliases used by Solaris 2.5 and some other OSs
+ (Kaleb Keithley).
+528. Fix some potential data overruns with long environment variables in
+ libX11 and libXt which could create security holes in suid root
+ programs like xterm (Kaleb Keithley).
+527. Fix makedepend's handling of long typed defines (eg, 1993L)
+ (Kaleb Keithley).
+526. User alloca on UnixWare (Kaleb Keithley).
+525. Improved fix for removing compiled keymap files (Kaleb Keithley).
+
+XFree86 3.1.2Dj (12 May 1996)
+524. Disable POSIX_TERMIOS in xterm for FreeBSD versions prior to 2.1.
+523. Add a document for XInput (Frederic Lepied).
+522. Have the server remove the compiled keymap file when shutting down
+ (Joe Moss).
+521. Fix problem of XkbListComponents() not listing anything in
+ subdirectories (Joe Moss).
+520. Fix passing of button events for the Joystick (Frederic Lepied).
+519. NetBSD documentation updates (Matthieu Herrb).
+
+XFree86 3.1.2Di (11 May 1996)
+518. Modify xterm to revoke() its pty before opening it on *BSD
+ (Matthieu Herrb).
+517. Fix xterm not sending SIGHUP to its children when it dies on *BSD
+ (Matthieu Herrb).
+516. Fix some problems that were preventing extended Mouse devices from
+ working.
+515. Add "Port" as a synonym for "Device" in the Pointer section.
+514. Fix Makefile dependencies for dynamically loaded XInput modules.
+513. Fix screen saver blanking for Mach64 CT at 16bpp and 32bpp.
+512. Remove the directory components from the XKB parameters in the sample
+ XF86Config files, and from the XF86Config files generated by xf86config.
+511. Fix Mach64 memory mapping bug introduced in 3.1.2Dg.
+
+XFree86 3.1.2Dh (10 May 1996)
+510. Fix for some image problems on VGAWonder V3, V4 and V5 adapters
+ (Marc Aurele La France).
+509. Enable TERMIOS for xterm on Linux/Alpha (Kazushige Goto).
+508. Make the "clkdiv2" option a valid option for most accelerated
+ servers (Koen Gadeyne).
+507. Unified the global function names to use the xf86 prefix in the XInput
+ code (Frederic Lepied).
+506. Add support for motion history for extended input devices (implemented
+ for the Wacom driver) (Frederic Lepied).
+505. Oak documentation updates (Jorge Delgado).
+504. Fix compiler warnings introduced in 3.1.2Dg (Thomas E. Dickey).
+503. OS/2 updates (Sebastien Marineau and Holger Veit).
+502. Fix formatting of xtrans error messages (Holger Veit).
+501. S3 image fixes for Alpha (Harald Koenig).
+
+XFree86 3.1.2Dg (6 May 1996)
+500. X98 updates for PANIX(98) support (X98 core team).
+499. Allow halved clocks to be used with the VGA servers (Koen Gadeyne).
+498. Use same xlfd value rounding for alpha as for i386 (Harald Koenig).
+497. Support for Linux/Alpha (Jay Estabrook, Craig Ruff, Harald Koenig
+ and others?).
+496. Fix autorepeating modifier keys (Kaleb Keithley).
+495. Fix nonMuxMaxClock for S3 864/868 (Harald Koenig).
+494. Make sure that imake, xinit and the XFree86 servers don't inherit
+ a SIGCHLD signal handler of SIG_IGN (Marc Aurele La France).
+493. Fix default HSkew for ATI 28800 cards (Marc Aurele La France).
+492. Fix typo in SuperProbe/PCI.c (Holger Veit).
+491. Colour xterm fixes -- fixes inner border being painted with the wrong
+ colour (Thomas E. Dickey).
+490. More X server prototyping fixes -- mostly for Xserver/Xext
+ (Thomas E. Dickey).
+489. DGA support for the P9000 server (Erik Nygren).
+
+XFree86 3.1.2Df (15 April 1996)
+488. Changes to xf86Config.c in preparation for XF86Setup sharing this
+ code (Joe Moss).
+487. Prevent SuperProbe from falsely detecting non-VGA PCI devices.
+486. Config/Imake support for building LBX (Holger Veit).
+485. OS/2 updates (Holger Veit and Sebastien Marineau).
+484. Add support for the I128 8MB board with the IBM528 RAMDAC (Robin Cutshaw).
+483. Add prototyping for Xserver/dix, and fix copyright notices in new
+ header files (Thomas E. Dickey).
+482. Replace the vsync wait delays in the ICD2061A code with a 20ms usleep
+ (Harald Koenig).
+481. Ensure that the S3 server clears the screen to black even when
+ '-flipPixels' is used, and erase the S3 HW bug test patterns after
+ completing the tests (Harald Koenig).
+480. Fix incorrect S3 HW cursor offset after VT switching (Harald Koenig).
+479. Fix SuperProbe's memory probing for S3 cards with more than 4MB,
+ and add detection for the TVP3030 RAMDAC (Harald Koenig).
+478. Fix some S3 TVP3026 problems introduced in 3.1.2Dc (Harald Koenig).
+477. Add support to the S3 server for the ELSA Gloria-8 card (except the
+ GLint 300SX 3D chip) (Harald Koenig).
+476. Fix for POSIX termios support in xterm (Matthieu Herrb).
+475. Add -li386 to ServerExtraSysLibs for NetBSD (Matthieu Herrb).
+474. Fix problems when XINPUT isn't defined (Kaleb Keithley).
+473. Fix for TGUI 9320 LCD support (Alan Hourihane).
+472. Imakefile updates for X98, and PCI detection added for TGUI9320
+ (Michio "Karl" Jinbo).
+
+XFree86 3.1.2De (31 March 1996)
+471. Change the default HSkew calculation (Marc Aurele La France).
+470. Add detection of the ATI 264VT, 264VT2 and 264GT to the ati driver,
+ SuperProbe, scanpci, and the Mach64 server (Marc Aurele La France).
+469. Fix the W32 server's reporting of the bits/rgb resolution (Koen Gadeyne).
+468. Add ICD2061A clockchip support to the W32 server (Koen Gadeyne and
+ Peter Chang).
+467. Add support for PowerWindow968, Cyber9320 and TGUI9680 (X98 core team).
+466. Fixes for XF98_NEC480 on PANIX-PC98 (X98 core team).
+465. Remove X98 style version info from the server startup messages
+ (X98 core team).
+464. Improve stability of the XF98_PWSK server (X98 core team).
+463. Add some missing XFreeXDGA #ifdefs (Kaleb Keithley).
+462. Fix problem of the XKB keymaps not getting loaded when using the
+ Xqueue keyboard driver on SVR4 (Joe Moss).
+461. Add POSIX termios support to xterm, and use it for BSD Net/2
+ derived systems. This removes the need for kernels on those systems
+ to be compiled with COMPAT_43 in order to run xterm (Matthieu Herrb).
+460. Update the I/O enabling in the X servers and SuperProbe for
+ NetBSD-current (Matthieu Herrb).
+459. Save the S3 cursor colour stack (CR4A/CR4B) (Harald Koenig).
+458. Add macro button support to the Wacom driver, and handle more than
+ six valuators to post events (Frederic Lepied).
+457. Support for the Miro Magic S4 (S3 928 + Bt485). A known problem is
+ that switching between pixmux an non-pixmux modes doesn't work
+ (Bernd Strobel).
+456. Fix banked mono for the SiS driver (Alan Hourihane).
+455. X server prototype cleanups and fixes, particularly in the Xi code
+ (Thomas E. Dickey).
+454. Possible fix for tvga9000 and tvga8900d problems (Alan Hourihane).
+
+XFree86 3.1.2Dd (17 March 1996)
+453. Include R6.1 public patch 1.
+452. Fix incorrect type in SuperProbe/PCI.c (Thomas E. Dickey).
+451. Fix a memory leak in xterm when switching fonts (Thomas E. Dickey).
+450. Fixes for mouse problems introduced in 3.1.2Dc (Joe Moss,
+ Michael Rohleder, Takaaki Nomura).
+449. Man page for the VidMode extension (Joe Moss).
+448. Modify xterm to work properly with Xaw3d's arror scrollbars (based on
+ Kaleb Keithley's R5 patch).
+447. Add tilt report for the Wacom device (Frederic Lepied).
+446. Deal with DAC/clock discrepancy for Mach64 in the ati driver
+ (Marc Aurele La France).
+445. Reduce warnings in the ati driver when compiling with 'gcc -Wall'
+ (Marc Aurele La France).
+444. Fix recognition of ATI extended VGA register I/O port number on some
+ Mach32 Mach64 PCI adapters in the ati driver (Marc Aurele La France).
+443. Add nested prototypes to xf86_HWlib.h (Marc Aurele La France).
+442. Fix typo in IBM RGB514 programming for the Mach64 (Marc Aurele La France).
+441. Fix a problem with the Mach64 server incorrectly using Block I/O mode
+ on some cards.
+
+XFree86 3.1.2Dc (11 March 1996)
+440. XKB updates from recent XC fix-tracker.
+439. Fix freeing a random pointer in the module code when an absolute
+ path is given (Thomas E. Dickey).
+438. Updates to Ti3026 PLL parameter limits (Harald Koenig).
+437. Support for ELSA Winner 2000PRO/X rev G (Harald Koenig).
+436. Fix 'make clean' problems for PC98 (Takefumi Tsukada).
+435. OS/2 updates (Holger Veit).
+434. Remove DEVINTPTR ifdefs by renaming the entrypoints of the affected
+ functions (Thomas E. Dickey).
+433. Fix for handling of long version strings in beta servers (Harald Koenig).
+432. Some XFree86-Misc cleanups (Joe Moss).
+431. Add an extended input device supporting mouse protocols. This shares
+ code with the core mouse (Frederic Lepied).
+430. Fix the behaviour of ANSI colours in xterm when reverse video is used,
+ and some other xterm updates (Thomas E. Dickey).
+429. Fix SEGV with ark driver when no Ramdac is given in the XF86Config.
+428. Avoid retrace wait for S3 HW cursor when DGA is active (Jon Tombs).
+
+XFree86 3.1.2Db (5 March 1996)
+427. Fix a problem where hw cursors get recoloured incorrectly.
+426. Fix another possible Trio32 font cache problem (Harald Koenig).
+425. Another S3 968 dashed line fix (Harald Koenig).
+424. Fix RecolorCursor problems for S3 hw cursors in RAMDACs and for
+ sw cursor (Harald Koenig).
+423. Add a Japanese version of the FreeBSD README (Takefumi Tsukada).
+422. Fix for problems with XF86_WSNA server (X98 core team).
+421. Add a mapping for Pointer_EnableKeys to the XKB symbols/us map (Joe Moss).
+420. XC patch for XKB.
+419. Add code to the vidmode and misc extensions to print details of mode
+ keyboard and mouse setting changes (Joe Moss).
+418. Add code to recognise extra keys on Digital LK201 PC keyboards
+ (Basil Duval).
+417. Don't include Multibuffer support in xdpyinfo when it isn't included
+ in the X servers (Joe Moss).
+416. Fix core dump when XInput debugging is enabled (Frederic Lepied).
+415. Fix implicit grab problem with Wacom input device (Frederic Lepied).
+414. Add an "allowMouseOpenFail" XF86Config and command-line option to allow
+ the server to be started when no mouse can be initialised (Joe Moss).
+413. Updates for parallel make (Robin Cutshaw).
+412. Update xf86config for the I128 server (Robin Cutshaw).
+
+XFree86 3.1.2Da (3 March 1996)
+411. Add a preinst.sh script.
+410. Documentation updates.
+409. Fix for Linux/ELF rules (H.J. Lu).
+408. Always used extended I/O for SYSV/SVR4. This is required now for
+ ISC (Michael Rohleder).
+407. Fix BootstrapCFlags in sun.cf for Solaris x86.
+406. Solaris fixes for SuperProbe and the Mach64 server (Robin Cutshaw
+ and James Hawtin).
+405. Wacom bug fix (Frederic Lepied).
+404. Add support for writing to stdout for gccmakedep, which is required
+ for NetBSD and FreeBSD (Matthieu Herrb).
+
+XFree86 3.1.2D (24 February 1996)
+403. Fix xterm SEGV if it cannot open an input method (Manabe Takashi).
+402. Update Linux/ELF SharedLibraryTarget() (H.J. Lu).
+401. Add a BinUtilsVersion parameter for Linux, and modify ExtraLoadFlags for
+ Binutils versions 2.6.0.7 and later (H.J. Lu).
+400. Set CplusplusCmd to 'c++' for Linux, set YaccCmd to byacc when
+ USE_BYACC is defined, and remove $(CBRT) from ServerExtraSysLibs
+ (H.J. Lu).
+399. Fix installation of some SCO rules/cf files (H.J. Lu).
+398. Modify imake.rules to include Motif rules/tmpl files when BUILD_MOTIF
+ is defined (H.J. Lu).
+397. Fix argument passing typo in SuperProbe (Thomas E. Dickey).
+396. Update Cards database (Joe Moss).
+395. Documentation updates (Holger Veit, Joe Moss).
+394. Fix xset/Imakefile for OS/2 (Holger Veit).
+393. Don't use the index/rindex macros with arguments for non-ANSI compilers.
+392. Uncomment xf86cleanpci() in vga.c.
+
+XFree86 3.1.2Ch (22 February 1996)
+391. Fix xset linking for Linux a.out (Harald Koenig).
+390. Disallow interlaced modes with the SiS driver (Alan Hourihane).
+389. Change SCO interface to allow for a 128K VGA aperture
+ (Marc Aurele La France).
+388. Add support to the ati driver for Mach64 cards with a base address
+ other than 0x2EC (Marc Aurele La France).
+387. Introduce a new XF86Config mode option called HSkew which sets bits
+ 0x60 of CRTC[3] (Marc Aurele La France).
+386. Fix colour map problem on VGA Wonder V3 boards (Randall Hopper,
+ Marc Aurele La France).
+385. Allow multiple "-verbose" command line flags to increase the verbosity
+ level (Marc Aurele La France).
+384. Modify xf86scanpci() so that it will be able to deal with multi-headed
+ servers in the future, add an xf86cleanpci() function to allow
+ the PCI data to be freed after use, allow xf86scanpci() to be called
+ more than once, and fix a problem with it not always returning with I/O
+ permissions disabled (Marc Aurele La France).
+383. SuperProbe updates for Mach64 and PCI (Marc Aurele La France).
+382. OS/2 updates (Holger Veit).
+381. Keyboard/mouse parameter changes with XFree86-Misc can now be disabled,
+ and these are only allowable by default for local client connections
+ (Joe Moss).
+380. Only check/change relevant parameters with XFree86-Misc (Joe Moss).
+379. Add new/better protocol error messages for XFree86-Misc (Joe Moss).
+378. Man page for the XFree86-Misc library functions (Joe Moss).
+377. Add detection of the SiS 86C202 and 86C205 to SuperProbe and the SiS
+ driver (Alan Hourihane).
+
+XFree86 3.1.2Cg (20 February 1996)
+376. Modify the handling of the XF86Config xkb options to allow the
+ -xkbmap server flag to work (it overrides what is in the XF86Config).
+ The XKBKeyMap XF86Config setting will now work too, and it overrides
+ any other XKB settings given there.
+375. Fix for parts of a VT switch sequence getting passed to clients when
+ XKB is enabled.
+374. NetBSD.cf update (Matthieu Herrb).
+373. Fix various cases of nested comment delimiters (Thomas E. Dickey).
+372. Config additions/updates for CLIX and for HP with GCC2 (Thomas E. Dickey).
+371. Fix RecolorCursor for HW cursor in AGX, Mach32, Mach64, P9000, I128,
+ Cirrus, Ark and Trident server/drivers (untested).
+370. Fix xinit problem introduced in 3.1.2Cf.
+369. S3 dashed line fix, including an option "s3_968_dash_bug" to enable
+ a workaround for a 968 bug. There is code to auto-detect this problem,
+ so the option shouldn't need to be specified explicitly (Harald Koenig).
+368. Fix for RecolorCursor problem with S3 HW cursors. This problem is
+ also present in other accel servers (Harald Koenig).
+367. Trident linear mode updates (Alan Hourihane).
+
+XFree86 3.1.2Cf (19 February 1996)
+366. S3 update for ELSA Winner1000 cards with the AT&T 20C409 Ramdac
+ (Dirk Hohndel).
+365. PC98 updates, including a new xkbcomp/compat/pc98 description
+ (X98 core team).
+364. SiS driver updated (Alan Hourihane).
+363. Work around an S3 968 dashed line bug (Harald Koenig).
+362. OS/2 updates, including a new OS/2 README (Holger Veit and
+ Sebastien Marineau).
+361. ISC documentation updates (Michael Rohleder).
+360. NetBSD documentation updates (Matthieu Herrb).
+359. Trident driver updates (Alan Hourihane).
+
+XFree86 3.1.2Ce (18 February 1996)
+358. PC98 documentation (X98 core team).
+357. Fix a bug in the handling of the Wacom eraser as a third button
+ (Frederic Lepied).
+356. Enable the Joystick driver for NetBSD (using a port of the FreeBSD
+ joystick driver to NetBSD) (Matthieu Herrb).
+355. Allow XInput dynamic loading for NetBSD (Matthieu Herrb).
+354. Use the FreeBSD way of making dependencies in .depend files for NetBSD
+ (Matthieu Herrb).
+353. Change the XInput Dynamic module loading to allow a ModulePath to
+ be specified in the Files section of the XF86Config, and move the
+ list of loadable modules into a Modules section in XF86Config
+ (Frederic Lepied).
+352. Fix some glitches in xterm's colour behaviour (Thomas E. Dickey).
+351. Modify the xf86config utility to allow XKB information to be entered
+ (Holger Veit).
+350. Fix Xserver prototyping problems (Thomas E. Dickey).
+349. Modify PCI code for PC98 (X98 core team).
+348. Add PC98 server for WSN-A2F (X98 core team).
+347. XKB description files for a Japanese 106 key keyboard (Takefumi Tsukada).
+346. Probe the VGA sis driver before the the cl64xx to avoid mis-probing
+ (Alan Hourihane).
+345. Modify XF86VidModeGetAllModeLines() to allocate memory in one chunk
+ so it can be freed later by the client (Joe Moss).
+344. Fix incorrect handling of S3RefClock when specified in the XF86Config
+ (Harald Koenig).
+343. Clean up linear mode setup in the Trident Driver (Alan Hourihane).
+342. Disable PCI burst mode by default for the Trident driver
+ (Alan Hourihane).
+341. Fix a problem restoring 16bpp modes with the Mach32 server on OS/2
+ (Sebastien Marineau).
+340. Fix a problem that was preventing the tgui driver from working on
+ some TGUI9440 cards (Alan Hourihane).
+
+XFree86 3.1.2Cd (12 February 1996)
+339. Fix library ordering for Linux a.out for xset, xdpyinfo and xvidtune
+ (Harald Koenig).
+338. Add a version check to the XInput dynamic modules (Frederic Lepied).
+337. Fix keyboard LED initialisation. This usually shows up as a problem
+ on *BSD where the NumLock LED is on when the server is started.
+336. Update Linux DLL jump files (Harald Koenig).
+335. PC98 updates, including XF98Conf, and the XKB nec geometry description
+ (X98 core team).
+334. Automatically treat the PS/2 protocol the same as the busmouse protocol
+ on NetBSD (since that's how NetBSD's PS/2 driver works).
+333. Add XInput dynamic loading support for FreeBSD 2.x.
+332. Fix problem with XInput on non-Linux/ELF systems.
+331. xterm fixes, including updates to allow building on R5
+ (Thomas E. Dickey).
+330. Add to the docs a file containing a list of PC98 cards that are
+ supported (X98 core team).
+329. Documentation updates for xterm (Thomas E. Dickey).
+328. Disable the TGUI HW cursor by default (Alan Hourihane).
+327. Add PCI support to SuperProbe (Alan Hourihane).
+
+XFree86 3.1.2Cc (10 February 1996)
+326. Merge in final form of R6.1.
+
+XFree86 3.1.2Cb (9 February 1996)
+325. XC fix-trackers to seq-4114 (mostly XKB).
+324. Xlib prototyping improvements/fixes (Thomas E. Dickey).
+323. OS/2 updates (Holger Veit and Sebastien Marineau).
+322. Allow the eraser button of a wacom stylus to act as a third button
+ if the WacomEraser device isn't enabled (Frederic Lepied).
+321. Allow XInput device support to be dynamically loaded. This is for
+ Linux only so far (Frederic Lepied).
+320. Major updates to the ati driver, including support for the newer
+ Mach64 chips and clocks, preliminary support or pre- VGAWonder V3
+ adapters and generic VGA. The default chipset name has been changed
+ back to "ati" from "vgawonder" (Marc Aurele La France).
+319. Properly implement xf86DisableIOPrivs and xf86Disable/EnableInterrupts
+ for Linux (Marc Aurele La France).
+318. ATI doc updates (Marc Aurele La France).
+317. Remove ati.test.c, and move the functionality into the ati driver
+ (Marc Aurele La France).
+316. Remove the "undoc_clocks" option (Marc Aurele La France).
+315. Make all I/O ports in compiler.h unsigned short, and all values
+ unsigned char/short/int (Marc Aurele La France).
+314. Updates Mach64 probing for SuperProbe (Marc Aurele La France).
+313. Make the Linux ELF/a.out default build the same as the system default
+ (Marc Aurele La France).
+312. Delete unneeded cmd/sh files in xfree98/vga256 (X98 core team).
+311. Fix problems with XF98_WABS (X98 core team).
+310. update xfree98/etc/Imakefile, and remove the *.sed files and their
+ related imake rules (X98 core team).
+309. XF98_WABEP server added (for Melco WAB-EP) (X98 core team).
+308. Trident driver updates including some clock probing fixes
+ (Alan Hourihane).
+307. Fix 2MB Trio64 display error problem due to incorrect parameter
+ calculation (Harald Koenig).
+
+XFree86 3.1.2Ca (5 February 1996)
+306. Improve S3 Diamond BIOS detection.
+305. XC fix-trackers to seq-4104 (mostly a new XKB snapshot).
+304. Don't include the compaq driver by default -- it is broken.
+
+XFree86 3.1.2C (31 January 1996)
+303. Allow the mouse parameters (except the device) to be changed with
+ the XFree86-Misc extension. This causes a close/reopen of the the
+ device (Joe Moss).
+302. Fix problem introduced with the server lock code which causes a delay
+ at startup.
+301. Add some checking for the mouse baud rate given in the XF86Config
+ (Joe Moss).
+300. Fix for the bright left border problem with some Trio64V+ cards
+ (Harald Koenig).
+299. PC98 XKB support files (Kaleb Keithley, Toyonori Fujiura).
+298. Update German XKB symbols (Thomas Mueller).
+
+XFree86 3.1.2Bo (30 January 1996)
+297. Updates for XF98Conf.cpp (Takefumi Tsukada).
+296. Add an XF86Config option for disabling XKB (Kaleb Keithley).
+295. Further OS/2 support updates, including a working X server
+ (Sebastien Marineau and Holger Veit).
+294. Documentation update for PC98 (Takefumi Tsukada).
+293. Improved prototyping for Xlib.h (Thomas E. Dickey).
+292. xterm updates, including mods to allow it to be built with X11R5
+ (Thomas E. Dickey).
+291. Some XFree86-Misc extension updates (Joe Moss).
+290. GlidePoint updates (Jean-Christophe Hugly).
+289. Add XInput knowledge to xdpyinfo, and update the output format of
+ xsetpointer (Frederic Lepied).
+288. NetBSD updates for scanpci now that console.h isn't included any more
+ (Matthieu Herrb).
+287. XC fix-trackers to seq-4086 (xsm updates).
+286. xkb symbol addition for European-style keyboards (Kaleb Keithley).
+285. Possible fix for security problem related to the X server's lock files.
+
+XFree86 3.1.2Bn (28 January 1996)
+284. Fix reporting of the ATI68860 Rev C Ramdac with the Mach64 server.
+283. Support for ALPS GlidePoint. A tap on the pad is treated as a fourth
+ button (Jean-Christophe Hugly).
+282. Improved XKB support for XFree86 servers (Kaleb Keithley).
+281. Prevent mode switching and VT switching when DGA is active (Jon Tombs).
+280. Don't include for syscons with NetBSD by default.
+279. NetBSD doc updates (Matthieu Herrb).
+278. XFree86-Misc extension updates, including more sanity checking (Joe Moss).
+277. Fix some length calculations in libXxf86vm (Joe Moss).
+
+XFree86 3.1.2Bm (26 January 1996)
+276. Remove (for now) the vertical retrace wait in the S3 SetViewPort.
+275. Updates TGUI support for SuperProbe (Alan Hourihane).
+274. TGUI driver updates (Alan Hourihane).
+273. Major updates to OS/2 support (Holger Veit).
+272. Update xdpyinfo for the latest XFree86-Misc changes, and update xset
+ to allow the keyboard repeat parameters to be changed (Joe Moss).
+271. Add functions to the XFree86-Misc extension to allow getting and
+ setting mouse and keyboard configuration (Joe Moss).
+270. Remove the low ICS5342 clock limit (Harald Koenig).
+269. Add an "XF98Config.cpp" from which a sample config file suitable for
+ the X98 servers is generated (X98 core team).
+268. Update Imakefiles under hw/xfree98 (X98 core team).
+267. Fix for make dependency problem with BSD make and the XFree86 drivers
+ subdirectories (Matthieu Herrb).
+266. X Consortium fix-trackers to seq-4084 (mostly XKB and doc updates).
+265. Allow the XInput debug level to be set from the XF86Config
+ (Frederic Lepied).
+
+XFree86 3.1.2Bl (21 January 1996)
+264. Fix xterm IM problem if *inputMethod == "" (Kaleb Keithley).
+263. Xvfb fix for systems that have mmap, but not the MS_ASYNC flag for
+ msync().
+262. XC fix-trackers to seq-4060 (some XKB and config updates).
+261. 6-bit/rgb fix for the I128 server (Robin Cutshaw).
+260. Update hw/xfree98 Imakefiles (Takefumi Tsukada).
+259. Add a GetAllModeLines function to the VidMode extension, and modify
+ xdpyinfo to use it (Joe Moss).
+
+XFree86 3.1.2Bk (17 January 1996)
+258. Don't allow DGA operations which affect the server when it isn't on
+ the active screen.
+257. Have XFree86-Misc report the power saver times in seconds rather
+ than milliseconds (to be consistent with XGetScreenSaver).
+256. Modify xset to allow setting/viewing the power saver parameters via
+ the XFree86-Misc extension.
+255. Modify the VidMode extension to disallow both mode switches and
+ the locking/unlocking of mode switching when DontZoom has been set
+ in the XF86Config.
+254. Only allow the DGA extension to accept local connections.
+253. Fix Home/End key support in xterm (Thomas Mueller).
+252. Add support for VT200 compatible cursor on/off to xterm (Thomas Mueller).
+251. Add support for the XFree86-Misc extension to xdpyinfo (Joe Moss).
+250. VidMode/xvidtune updates (Kaleb Keithley).
+249. XC fix-trackers to seq-4055 (mostly XKB fixes).
+248. Fix link ordering of new libraries (Thomas Mueller).
+247. Add some missing XKB #defines (Thomas Mueller).
+246. Fix typo in include/extensions/Imakefile (Thomas Mueller).
+
+XFree86 3.1.2Bj (16 January 1996)
+245. Remove the XExExt library, and replace it with individual libraries
+ for each extension.
+244. Remove the GetSaver/SetSaver functions from the VidMode extension
+ and add them to a new extension: XFree86-Misc.
+243. Cleanup VidMode extension code -- removing "vgahelp" references
+ (Kaleb Keithley).
+242. Allow the write functions of the VidMode extension to be disabled
+ for non-local clients (default), and all clients (Kaleb Keithley).
+241. XC fix-trackers to seq-4052 (new XKB snapshot).
+240. README.S3 updates (Paul Gortmaker).
+239. Do framebuffer address scan for all VLB Trio64 cards, not just those
+ with > 1MB.
+238. Fix typo in trident driver (Alan Hourihane).
+237. Modify the I128 server to use xf86scanpci() rather than its own PCI
+ probe (which didn't work for PCI config type 1 boards) (Robin Cutshaw).
+
+XFree86 3.1.2Bi (14 January 1996)
+236. Enable dynamic allocation of XInput devices to allow for multiple
+ instances of the same device type. The Joystick2 device has been
+ removed (Frederic Lepied).
+235. Fix typo in a recent xconsole fix (Michael Rohleder).
+234. Add POSIX build config option for ISC, and change the Vendor name to IUS
+ (Interactive Unix System) (Michael Rohleder).
+233. Disable linear mode by default for non-PCI Trident cards (Alan Hourihane).
+232. Fix some compiler warnings in various parts of the source (Fred Appelman).
+231. Fix xterm compile problem with -DALLOWLOGGING (William Austin).
+230. Fix compile problem in resize for NetBSD (Matthieu Herrb).
+
+XFree86 3.1.2Bh (13 January 1996)
+229. Fix dga speed test problem when the bank size is less than 64k.
+228. Add DGA support to the Mach32 server (untested).
+227. Add SVGA-based servers for PC98 (Cirrus driver) (X98 core team).
+226. Update the Cirrus driver to use the vga PCI probe data (not tested).
+225. Include XC fix-trackers to seq-4035 (mostly fixes for Solaris 2.5
+ build problems).
+224. Update xdpyinfo to print some info about XKB (Joe Moss).
+223. Fix(?) problem some people see with vertical lines / black screens
+ with the Trident driver (Alan Hourihane).
+222. Update the Trident and SiS drivers to use the vga PCI probe data
+ (Alan Hourihane).
+221. Define SetTtyGroup for Linux (Kevin Martin).
+
+XFree86 3.1.2Bg (12 January 1996)
+220. Fix cursor colour for TGUI 9660/9680 (Alan Hourihane).
+219. LynxOS fix for xterm's resize (Thomas Mueller).
+218. Write beta marker file as the user's real uid rather than as root.
+217. Fix DGA for SVGA cards using banked memory, and enable it for most
+ SVGA drivers.
+216. Add a PCI probe to the VGA servers. The happens before the chipset
+ probes, and may be disabled with the "no_pci_probe" option.
+215. Add 16bpp support for Trident 8900D, and some cleanups (Alan Hourihane).
+214. Add install.linkkit target to the top level Makefile.
+
+XFree86 3.1.2Bf (11 January 1996)
+213. Xinput updates, including: improved error handling, "Screen" option
+ renamed to "ScreenNo" for consistency, new config options for the
+ Wacom tablet, update to the Linux joystick support, and a fix
+ for xsetmode (Frederic Lepied and Patrick Lecoanet).
+212. Fix core dump when exiting an X server started with XKB enabled.
+211. Update accelerated servers' use of miZeroClipLine().
+210. Include XC fix-trackers to seq-4031 (includes update of RECORD spec
+ to version 1.13, some Xlib and xterm fixes, and preliminary ISO Latin-2
+ compose support).
+209. Add code to detect the Trio32 BITBLT bug, and automatically enable
+ the workaround when it is detected (Harald Koenig).
+208. Final changes for POSIXized ISC build (Michael Rohleder).
+207. Define NO_READAHEAD for ISC in xconsole (Michael Rohleder).
+206. Fix(?) Xalloca.h problem on Solaris 2.5.
+205. Fix missing XFreeDGA #ifdef in change 187 (Kaleb Keithley).
+
+XFree86 3.1.2Be (10 January 1996)
+204. Fix build with BuildServersOnly set to YES (Takefumi Tsukada).
+203. Major xterm cleanup (including prototyping), and fixes to the colour
+ code (Thomas E. Dickey).
+202. PC98 EGC (16 colour) server added (X98 core team).
+201. Updates for LynxOS AT, including a workaround in the xkb clients
+ for the fact that stdin/out/err isn't a valid initialiser
+ (Thomas Mueller).
+200. Modify the dga test program to use GetTimeInMillis() (Tiago Gons).
+199. Fix merge problem in xconsole (Michael Rohleder).
+198. Initial changes to POSIXize the ISC build (Michael Rohleder).
+197. Fix a clash of symbols between libX11 and the X server's libxkb which
+ shows up when building Xnest on ISC (Michael Rohleder).
+196. Fix XKB merge problem in xf86Events.c (Kaleb Keithley).
+195. Complete the logging code in xalloc (Pascal Haible).
+
+XFree86 3.1.2Bd (8 January 1996)
+194. Fix a build problem when BuildServersOnly is set to YES.
+193. Clean up the InstallManPageLong() run for NetBSD (Takefumi Tsukada).
+192. Modify ForceSubdirs() rule for NetBSD and FreeBSD so that it works
+ with GNU make (Matthieu Herrb).
+191. Fix a Ti3026 clock problem that appears on SPEA 968+Ti3026 cards
+ (Harald Koenig).
+190. Fix TGUI 9440 HW cursor problems (Alan Hourihane).
+189. Fix problems with the TGUI 9660/9680 support (Alan Hourihane).
+188. Fix 256-colour interlace problem with TGUI cards (Alan Hourihane).
+187. Fix for text mode restore problem when the DGA extension has been
+ used with the SVGA server (Alan Hourihane).
+186. Set the Block I/O bit in the PCI userconfig register for Mach64 cards
+ that report an I/O address range.
+
+XFree86 3.1.2Bc (7 January 1996)
+185. Update lnxLib.rules for new GNU elf tools which look for libname.so
+ rather than libname.so.rev at link time (Helmut Geyer).
+184. Set default ProjectRoot back to /usr/X11R6.
+183. Include fix-trackers to seq-4024 (includes more a more recent XKB snap,
+ some record updates, and some config and Xlib updates).
+182. Fix some merge problems.
+
+XFree86 3.1.2Bb (6 January 1996)
+181. Merge in X11R6.1 beta.
+180. Fix problems with the ARK/ICS5342 clock programming (Leon Bottou).
+179. Fix problem with Mach64 CT cards that incorrectly appear to be using
+ block I/O.
+
+XFree86 3.1.2Ba (3 January 1996)
+178. Fix support for the old ET4000 in the et4000 driver.
+177. Fix problem with the SIS driver that can cause a server crash
+ (Alan Hourihane).
+176. Modify linux config for building a.out binaries on Slackware 3.0.
+175. Fix Linux Joystick compilation problems.
+174. Doc updates.
+
+XFree86 3.1.2B (28 December 1995)
+173. Fix a problem with the ARK/ICS5342 clock programming (don't know if this
+ completely fixes the clock programming problems).
+172. Don't do PCI probe in S3 server for PC98 (Takefumi Tsukada).
+171. Fix bank select problem with S3 911 cards when using DGA.
+
+XFree86 3.1.2Af (26 December 1995)
+170. Added README.DGA which gives a brief outline of the API for the DGA
+ extension. This should be converted to man pages.
+169. Added a simple standalone program (joycal) to get the Joystick
+ calibration coordinates.
+168. Modify the Joystick code to auto-detect the centre values at startup
+ if they are not given the XF86Config (this assumes that the Joystick
+ is centred when first enabled).
+167. Add XInput Joystick support for FreeBSD 2.x.
+166. Remove the strict membase checking for "orchid_p9000" in the P9000
+ server so that the correct membase can be specified for some other
+ types of P9000 cards which are not explicitly supported.
+165. Fix problem with the trident driver in the VGA16 server (Alan Hourihane).
+164. XF86Config(4/5) man page additions for the XInput section
+ (Frederic Lepied).
+163. Update xfree98/Imakefile (Takefumi Tsukada).
+162. Remove the "no_ti3026_curs" option again.
+161. Updates for xdpyinfo's Imakefile and the Xinput code for ISC
+ (Michael Rohleder).
+
+XFree86 3.1.2Ae (23 December 1995)
+160. A new document called QuickStart.doc which is a quick-start guide
+ to XFree86 setup (Joe Moss).
+159. Add a PCI probe to the S3 server, and use the membase value reported
+ when it is non-zero. This should help for some TrioV64+ cards.
+158. Move the DGA client-side helper functions into libXExExt.
+157. XInput support for XFree86. This includes device support for two
+ Joysticks (Linux-only so far), Wacom tablet (Wacom IV protocol only),
+ and Elographics touchscreen. Two utility programs are included.
+ xsetpointer can be used to make an extended device the core pointer
+ or to list the extended devices. xsetmode can be used to set a device
+ in absolute or relative mode (Frederic Lepied and Patrick Lecoanet).
+156. Workaround for a hardware bug in some S3 Trio32 revisions which causes
+ font corruption when using the font cache. This is currently enabled
+ with the "trio32_fc_bug" Option (Harald Koenig).
+155. Logging support for the internal xalloc code (Pascal Haible).
+154. Fix the S3 server's detection of the Trio64V+.
+153. Fix problems building the PC98 code (Takefumi Tsukada).
+152. LynxOS support for the DGA extension (Thomas Mueller).
+151. Fix a problem were XListFonts() can return fewer font names than
+ XListFontsWithInfo() (Manabe Takashi).
+150. Add knowledge of the XFree86-VidModeExtension, XFree86-DGA and LBX
+ extensions to xdpyinfo (Joe Moss).
+149. Add a benchmark function to the dga test program. It is activated with
+ the 'b' key (Koen Gadeyne).
+148. Change all servers to default to blackPixel = 0 and whitePixel = 1,
+ and allow this default to be swapped with the -flipPixels server
+ command line flag (Michael Rohleder).
+147. Restore the "no_ti3026_curs" option to the S3 server (Harald Koenig).
+146. Trident driver and documentation updates (Alan Hourihane).
+
+XFree86 3.1.2Ad (21 December 1995)
+145. Fix for incorrect usage of S3 PIX_TRANS writing (Takefumi Tsukada).
+144. PC98 support integrated into the main XFree86 source tree. The PC98
+ code gets built under xc/programs/Xserver/hw/xfree98 (Takefumi Tsukada
+ and the X98 team).
+
+XFree86 3.1.2Ac (17 December 1995)
+143. Modify the XDGA implementation in the server, and add support for it
+ to the Mach64 server. Also, XDGA is now enabled for all OSs since there
+ are now no OS-specific parts on the server side.
+142. Add "no_font_cache" and "no_pixmap_cache" options to allow the font
+ cache and pixmap cache/expansion to be disabled in the S3 and Mach64
+ servers.
+141. Fix positioning and shape of the Bt485 HW cursor for doublescan modes
+ in the S3 server.
+140. Fix positioning of the HW cursor for interlaced and doublescan modes
+ with the IBM RGB RAMDACs in the S3 server. The cursor shape still
+ isn't correct though (Trent Piepho and R.E. Wolff).
+139. HW cursor support for the Trident 9660/9680 and 9430 -- not tested
+ (Alan Hourihane).
+138. XFree86-DGA extension support for ISC SVR3 (Michael Rohleder).
+137. Fix for "XIOerror 11 (Resource temporarily unavailable)" errors while
+ running xterm on ISC (Michael Rohleder).
+136. Major Trident driver updates, including HW cursor for 9440, and
+ an option to use a set of fixed clocks instead of fully programmable
+ clocks for the TGUI chips (Alan Hourihane).
+135. I128 updates (Robin Cutshaw).
+134. Mach64 support for ATI Extended VGA register location on PCI
+ cards with block I/O (Kevin Martin).
+133. Clean up Mach64 software cursor support (Kevin Martin).
+132. "dac_8_bit" is now the default for supported RAMDACs in the Mach64
+ server. 6-bit mode can be forced with the "dac_6_bit" option
+ (Kevin Martin).
+131. Mach64 support for the ATI Graphics Pro Turbo 1600, including
+ 1600x1200 mode support (Kevin Martin).
+130. Mach64 support for the IBM RGB514 RAMDAC (Kevin Martin).
+129. Mach64 support for the GX-F (GX rev 3) (Kevin Martin).
+128. Add new options "w32_interleave_on" and "w32_interleave_off" to
+ the SVGA and W32 servers. They allow the desired mode to be
+ forced for W32i and W32p cards (Dirk Hohndel).
+127. Full STG1703 support for W32 server (Dirk Hohndel).
+126. Fix some incorrect prototype ifdefs in xf86.h (Kaleb Keithley).
+125. Modify xterm to call XtSetLanguageProc() rather than setlocale()
+ (Kaleb Keithley).
+124. Preliminary driver for the SIS 86C201 chipset (VGA2 and VGA16 only
+ so far) (Alan Hourihane).
+123. Change the Mach64 aperture mapping to map the video memory and
+ mmapped registers into two separate areas rather than mapping the
+ entire 8MB aperture range.
+122. Use an 8MB aperture for all but ISA Mach64 cards since most of the
+ newer Mach64 chips only support an 8MB aperture size.
+121. Fix typo in Mach64 server that was causing some RAMDACs to be incorrectly
+ detected.
+120. Fix aperture address detection for VLB Mach64 cards.
+119. In the Mach64 server, set RAMDAC to 20C408 if the 20C408 clock type
+ is detected, and same for STG1703.
+118. SIGWINCH support for xterm on ISC 4.x (Geoff Steckel).
+
+XFree86 3.1.2Ab (9 December 1995)
+117. FreeBSD support for the DGA extension.
+116. Split the DGA code out into a separate extension (called XFree86-DGA)
+ (Kaleb Keithley).
+115. Fix some compiler warnings when compiling on LynxOS (Thomas Mueller).
+114. Fix some byte swapping problems in XFree86-VidModeExtension
+ (Thomas Mueller).
+113. Add preliminary STG1703 support to the W32 server. No clock
+ programming and no pixmux yet (Dirk Hohndel).
+112. Add new options "pci_burst_on" and "pci_burst_off" to SVGA and
+ W32 server. They will allow to solve display problems on many
+ ET4000/W32p based cards (Dirk Hohndel).
+111. Add new clock selection scheme to SVGA and W32 server, so that
+ 32 clocks are used. The first 16 are the same as before, the
+ second 16 use CS3 (Dirk Hohndel and Koen Gadeyne).
+110. Add STG1703 detection to SuperProbe for ET4000/W32 based cards (Dirk
+ Hohndel).
+109. Fix extension version checking in xvidtune.
+108. Modify xterm to call XSupportsLocale() before initialising I18N
+ support (William Volkman).
+107. Fix S3 support for clocks up to 135MHz in 8 bpp for S3 868 cards
+ with ATT20C409 Gendac (e.g., Elsa Winner 1000AVI) (Dirk Hohndel).
+106. Fix S3 HW cursor handling for doublescan modes (Jon Tombs).
+105. Config and doc updates for NetBSD 1.1 (Matthieu Herrb).
+104. Preliminary (unaccelerated) I128 server code (Robin Cutshaw).
+103. Attempt to fix problem of Mach64 server mis-detecting the CH8398
+ RAMDAC.
+102. Modify the Mach64 server to use the membase address it reads from
+ the configuration registers.
+101. Fix cursor colour problem at 16, 32bpp with the Mach64 server.
+100. Support for the Mach64 CT.
+
+XFree86 3.1.2Aa (2 December 1995)
+ 99. Fix for xterm behaving badly when TERM is set to "vt100" (Joerg Wunsch).
+ 98. XDGA (direct graphics access) support added via the XFree86 VidMode
+ extension. This is primarily intended for games support. Currently
+ it is implemented only for Linux, and for the S3 and Cirrus drivers
+ (Jon Tombs).
+ 97. Fixes for Ti3026 loop clock calculation code (Dirk Hohndel).
+ 96. Detection and preliminary support for the Elsa Winner2000PRO/X-2,4 Rev.G
+ which has a S3-968, Ti3026, and ICS9161A clock chip. Clock doubling
+ doesn't work yet (Dirk Hohndel).
+ 95. Mach64 code cleanups and documentation updates (Kevin Martin).
+ 94. Fix Mach64 pixmap cache bug which resulted in xcalloc being called
+ with a negative size (Kevin Martin).
+ 93. The state of the AT&T20C408 is now saved/restored by the Mach64 server.
+ This should fix the dim screen problem when exiting from the server
+ (Kevin Martin).
+ 92. ClockChip and Ramdac can now be specified in the XF86Config for the
+ Mach64 server (Kevin Martin).
+ 91. Mach64 server ATI 18818/ICS 2595 clock chip programming now works
+ (Kevin Martin).
+ 90. Mach64 server now automatically programs a programmable clock chip
+ when present. This can be overridden with the "no_program_clocks"
+ Option. The "program_clocks" option has been removed (Kevin Martin).
+ 89. Initial changes to allow for integration of the I128 server
+ (Robin Cutshaw).
+ 88. Avoid defining __USLC__ for MP/RAS in compiler.h (Kaleb Keithley).
+ 87. If the server can't find an XF86Config file, print out the files it
+ tried to open (Joe Moss).
+ 86. Fix(?) display centering for the Cirrus 754x.
+ 85. Fix text mode clock problem in ET4000/W32 server (Koen Gadeyne).
+ 84. Remove the "-noscale" flag from the Xserver and xfs since it has
+ been obsoleted by the ":unscaled" fontpath attribute.
+ 83. Remove the RepeatedMiddle mouse option because it doesn't work
+ properly (Jon Tombs).
+ 82. Remove some casts in xf86MouseProtocol() to work around in the
+ Metaware compiler/NCR assembler (Kaleb Keithley).
+ 81. When the X server exits due to an unrecognised command-line option,
+ print out the offending option (Joe Moss).
+ 80. Remove '-lc_s' from ExtraLibraries for ISC (Michael Rohleder).
+ 79. Add code to SuperProbe and the Cirrus driver to recognise the
+ CL-GD7542 (and a guess for the CL-GD7541).
+ 78. Fix RAMDAC probe problem introduced into the S3 server in 3.1.2e
+ (Joe Moss).
+
+XFree86 3.1.2A (19 November 1995)
+ 77. Added a Beta Report template form.
+ 76. Update xf86config for some of the new Ramdacs.
+ 75. Allow 'Ramdac "ibm_rgb526" to be recognised by the S3 server. It
+ then treats it as an RGB524.
+ 74. Modify the beta startup message usage so that it gets printed once
+ for each different server started.
+ 73. Fix for AGX-010 clock probing (Henry Worth).
+
+XFree86 3.1.2e (16 November 1995)
+ 72. Updates to the Cards database.
+ 71. S3 868 + AT&T 20C409 support (8/15/16/24bpp) without pixmux, and
+ S3-868 + AT&T 20C499 support (untested) (8/15/16/24bpp, no pixmux).
+ Pixmux support is enabled, but not functional (Dirk Hohndel).
+ 70. Update SuperProbe to recognise AT&T 20C409 and AT&T 20C499 RAMDACs
+ (Dirk Hohndel).
+ 69. Allow attributes to be appended to elements of a font path. The
+ attributes are introduced by a ':' character, and multiple attributes
+ are separated by a ':'. Currently the attribute "unscaled" is
+ supported for bitmap fonts, and this prevents them from being scaled.
+ 68. Trident driver cleanups, and fixes for interlacing (Alan Hourihane).
+ 67. LynxOS updates for using MetroLink Motif (Thomas Mueller).
+ 66. Preliminary AT&T 20C409 support for the S3 server (not functional
+ yet) (Dirk Hohndel).
+ 65. W32 updates to Xserver and SuperProbe (Dirk Hohndel and Koen Gadeyne).
+
+XFree86 3.1.2d (12 November 1995)
+ 64. Fix a typo in the iso8859-1 Compose file.
+ 63. Add a '-noscale' flag to the Xserver and xfs to allow scaling of
+ bitmap fonts to be disabled. The keyword DontScaleBitmapFonts
+ in the ServerFlags section of the XF86Config file has the same affect.
+ 62. Fix problem that prevents bitmap fonts from being scaled after
+ running something like 'xset fp rehash'.
+ 61. Add a Release Date to the X server startup messages.
+ 60. Add a "RELNOTES" document to describe changes in beta releases.
+ 59. Fix panning for ARK2000PV chips with 2MB of memory (Leon Bottou).
+ 58. Support for ICS5342 programmable clock in the ARK driver (Leon Bottou).
+ 57. Major updates to the Oak driver, including more accelerated functions
+ for the OTI087 (Jorge Delgado).
+ 56. Option "program_clocks" added for the Mach64 server to allow
+ arbitrary clocks to be programmed for most clock chips. This
+ currently doesn't work with the ATI18818/ICS2595 chips (Kevin Martin).
+ 55. Mach64 server support for the AT&T 20C408 (Kevin Martin).
+ 54. Fix problem of two undisplayed pixels with the CL-GD7543
+ (Thomas Zerucha).
+ 53. Add support for three button operation with some dual protocol mice
+ when they are in Microsoft-compatible mode. The keyword to enable
+ this is 'RepeatedMiddle' (Jon Tombs).
+ 52. Fix 3 button emulation problem introduced in item 48 (Thomas Mueller).
+ 51. Add support for '-crt /dev/ttyXX' command line option for the X
+ servers for SCO. This is for compatibility with the native SCO X
+ servers (Didier Poirot).
+
+XFree86 3.1.2c (5 November 1995)
+ 50. Add expiry date and startup message for beta versions.
+ 49. Fix problem using a LinkKit generated with BuildLBX set to YES.
+ 48. Allow a real middle button event to be passed when 3 button mouse
+ emulation is enabled (Thomas Wu).
+ 47. Fix panning and some initial clock selection problems for TGUI9440
+ cards (Alan Hourihane).
+ 46. Support for the Cirrus CL-GD7543 (Thomas Zerucha).
+ 45. Fix for instability problems with Cirrus programmable clock
+ (Koen Gadeyne).
+ 44. Fix memory overwrite problem in xterm which could be a security
+ problem.
+ 43. Merge in the X Consortium's public patch 13.
+ 42. Define X_LOCALE for LynxOS for compatibility with Metrolink's
+ Motif package (Thomas Mueller).
+ 41. Update SuperProbe to recognise the Cirrus CL-GD7543.
+ 40. The Trident driver now automatically selects the "tgui" clockchip
+ when it detects a TGUI9440 (Alan Hourihane).
+ 39. Remove the dependency on -lthread for UnixWare 2.x, while still
+ allowing full MT support. This is done by adding a threads stub
+ library with weak symbols (David Wexelblat).
+
+XFree86 3.1.2b (22 October 1995)
+ 38. Updated Japanese docs, including SGML versions suitable for formatting
+ with jlinuxdoc-sgml. These docs use EUC encoding (Kazuyuki Okamoto).
+ 37. Preliminary support for the Trident TGUI9440 (Alan Hourihane).
+ 36. Add an "AllowNullPasswd" resource to xdm to make it possible for xdm
+ to login to accounts with a null password. This is set to "False"
+ by default (Joerg Wunsch).
+ 35. Use dynamically allocated strings in xrdb to avoid overruns that
+ can occur otherwise (Joerg Wunsch).
+ 34. Add ELSA Winner 2000PRO/X-8 to the S3 ELSA probe code (Dirk Hohndel).
+ 33. Fix S3 probe of IBM RGB RAMDACs incorrectly identifying an RGB528
+ or RGB528A as an RGB524 (Dirk Hohndel).
+ 32. Fix incorrect memory probe for S3 964/968 (Dirk Hohndel).
+ 31. Prelim pixmux support for ICS5341 RAMDAC in W32 server (Dirk Hohndel).
+ 30. Support for ICS5341 programmable clock in W32 server (Dirk Hohndel).
+ 29. Add RFC1700-conformant charset names for ISO-8859 locales to
+ locale.alias.
+ 28. Fix LynxOS video mapping problem that shows up when the "fb_debug"
+ option is set in the S3 server (Thomas Mueller).
+ 27. Fix reference to undeclared variable in os/xalloc.c for OSs which
+ don't have MMAP_ANON or MMAP_DEV_ZERO defined (Thomas Mueller).
+ 26. Fix W32 server core dump on LynxOS when run with '-probeonly'
+ and no Clocks line in the XF86Config file (Thomas Mueller).
+ 25. Fix reference to uninitialised string in Hercules mono driver
+ (Paul Gortmaker).
+
+XFree86 3.1.2a (23 September 1995)
+ 24. Fix HW cursor masks in Mach32 and Mach64 servers.
+ 23. Add detection of C&T 65548 to SuperProbe.
+ 22. Fix snow problems with WD90C24 when for clocks higher than MCLK
+ (Brad Bosch).
+ 21. Add XNLS support for KOI8-R (Andrey Chernov).
+ 20. Fix problem with IBM ramdac and clockchip handling in xf86config.
+ 19. Change XF86Config parsing to ignore '_' characters in keywords, and
+ to ignore '_', ' ', and '\t' characters when comparing strings with
+ StrCaseCmp() (ie, all strings except paths, Device/Monitor identifiers
+ and Mode names).
+ 18. Reduce nonMuxMaxClock to 80MHz (from 100MHz) for S3 864 with
+ ATT498-compatible RAMDACs because it was too high for some cards.
+ 17. Fix problem installing xterm on SunOS 4.x introduced in 3.1.2.
+ 16. Set -fno-strength-reduce with -O2 for gcc2 to avoid a compiler bug.
+ 15. Fix xvidtune/XF86VidMode problem when the Monitor Vendor and/or Model
+ are not specified in the XF86Config file.
+ 14. Colour support for xterm (David Wexelblat).
+ 13. Fix usage of $LINES and $COLUMNS by xterm on SVR4 (David Wexelblat).
+ 12. Fix xconsole for Unixware 2.0 (David Wexelblat).
+ 11. Fix optimisation problem with inline asm on Unixware 2.0
+ (David Wexelblat).
+ 10. Improve subdir/lib dependence on systems using BSD 4.4. make
+ (Matthieu Herrb)
+ 9. Allow the Xserver to accept InvertVCLK, EarlySC and BlankDelay. It
+ previously expected Invert_VCLK, Early_SC and Blank_Delay.
+ 8. Fix problem selecting a StaticGray visual with the VGA16 server
+ (Olivier De Smet).
+ 7. Fix compile problem on FreeBSD 1.1.5 (David Bremner).
+ 6. Change index and rindex macros in Xos.h when X_NOT_STDC_ENV is not
+ defined.
+ 5. Fix(?) alloca declaration in Xtos.h for Solaris 2.5.
+ 4. Fix dependencies for 'make includes' to ensure that auto-generated
+ headers exist before linking them to xc/X11 (David McCullough).
+ 3. Change default InvertVCLK setting for the Hercules Terminator 64 Pro
+ (Harald Koenig).
+ 2. Update for lynx.cf (Thomas Mueller).
+ 1. README updates.
+
+XFree86 3.1.2 (24 July 1995)
+235. Fix(?) scanpci compile problem with gcc on Solaris.
+234. Documentation updates.
+
+XFree86 3.1.1Z (22 July 1995)
+233. Code Freeze for 3.1.2.
+232. Fix an imake config problem on non-XFree86 platforms.
+231. xman update for Solaris 2.5 (William Austin).
+230. Cyrillic fonts with KOI8 encoding added (Cronyx Ltd, Serge Vakulenko,
+ Andrey A. Chernov).
+229. Allow ndbm to be used for the rgb database on NetBSD for those
+ who want it (Matthieu Herrb).
+228. Attempt to fix register corruption for Cirrus 5430/5434/5436 in
+ SuperProbe.
+227. Remove -DUNIXCONN from the default SVR3 ConnectionFlags.
+226. Fix disappearing S3 hw cursor when switching modes with xvidtune
+ (Harald Koenig).
+225. Sync-on-green support for the ELSA Winner 2000Pro/X (Harald Koenig).
+224. Add vendor options to S3 server (hercules, stb, genoa) (Harald Koenig).
+223. Documentation updates (Joe Moss, Harald Koenig, Matthieu Herrb).
+
+XFree86 3.1.1Dc (19 July 1995)
+222. Fix(?) server crash when the Cirrus driver auto-detects the linear
+ fb address for PCI cards.
+221. Support for 964+IBM (Hercules Terminator 64) (Harald Koenig).
+220. Disable >8bpp for S3 911 and 924 because it won't work.
+219. Fix some auto-apply problems in xvidtune, and added a restore hot-key "R".
+
+XFree86 3.1.1Db (17 July 1995)
+218. Documentation updates.
+217. xvidtune updates.
+216. S3 parameter updates for STB 968 card, and update to the Trio64V
+ probe (Harald Koenig).
+
+XFree86 3.1.1Da (16 July 1995)
+215. Replace xf86pci.c with the real scanpci.c (Robin Cutshaw).
+214. Updates to the code for the additional S3 mode parameters, including
+ better default settings (Harald Koenig).
+
+XFree86 3.1.1D (15 July 1995)
+213. xterm fix for crash when inputMethod is set to kinput2 (Manabe Keishi).
+212. Code to detect the AT&T20C490, and Sierra 1148[234579] ramdacs
+ (Joe Moss).
+211. Update the VidMode extension to handle extra mode-specific parameters,
+ and update xvidtune for extra S3 parameters.
+210. Allow some S3 parameters to be set in the Display SubSection for
+ individual modes.
+209. xf86config Cards database updates.
+208. Updates to README.WstDig for the 90C24 (Brad Bosch).
+207. Updates to LynxOS support, including support for version 2.2.1, and
+ a README.LynxOS (Thomas Mueller).
+206. Support for the SC1148{2,3,4} ramdacs at 15bpp, and the SC1148{5,7,9}
+ ramdacs at 15 and 16bpp in the S3 server (Joe Moss).
+205. Fix for problems with some WD90C24 TFT systems (Brad Bosch).
+
+XFree86 3.1.1Cd (12 July 1995)
+204. Allow for three verbosity levels for Xserver messages: -quiet, default,
+ and -verbose (Marc Aurele La France).
+203. Make the LinkKit self-contained. Apart from Xnest, it no longer
+ depends on the config files, headers, and utility programs being
+ installed (Marc Aurele La France).
+202. Updates to xvidtune. The Show button now also sets the primary
+ selection, better usage/error messages and exit codes, man page
+ updates (Joe Moss).
+201. Updates for SCO -- mostly for lbx (David McCullough).
+200. Fix a cause for some S3 lockups (Harald Koenig).
+199. Updates/fixes and SVR4 support for new malloc code.
+
+XFree86 3.1.1Cc (8 July 1995)
+198. Merge in final form of XC fix-12.
+
+XFree86 3.1.1Cb (7 July 1995)
+197. Minor IBM RGB updates (Harald Koenig).
+196. MCLK detection for STG1703 (Harald Koenig).
+195. Add detection for new S3 Trio64V+ chip to the S3 server and
+ SuperProbe (Harald Koenig).
+194. Fix some clashing option numbers (Harald Koenig).
+193. Preliminary STG1703 clock programming code.
+192. A new malloc for use by the Xserver. It is enabled by setting
+ UseInternalMalloc to YES (Pascal Haible).
+191. Fix for threads lib problem on Unixware 2.0
+190. Support for the WD90C24 in the pvga1 driver (Bradley Bosch).
+
+XFree86 3.1.1Ca (5 July 1995)
+189. Don't enable HAS_MMAP for Xvfb on Linux (Marc Aurele La France).
+188. Code to detect the STG1703 RAMDAC in SuperProbe and the S3 server
+ (Harald Koenig).
+187. A few AGX bug fixes (Henry Worth).
+186. More pre-fix-12 fix-trackers.
+
+XFree86 3.1.1C (3 July 1995)
+185. Manual page updates.
+184. Add extended power_saver support to the VGA and Mach64 servers.
+ Suspend mode isn't currently supported by the VGA servers.
+183. Add entries for the SunFA_ dead accents to the iso8859-1 Compose file
+ (Jon Tombs).
+182. Updates to IBM RGB52x in the S3 server, including fixing the
+ 8bpp problem.
+181. Documentation updates (including a README.ark) (Harm Hanemaayer).
+180. Change the Mach64 server to ignore the Clocks line in the XF86Config
+ unless the "no_bios_clocks" option is used (Kevin Martin).
+179. Fix font corruption with Mach64 server (seen when running Mosaic
+ or Netscape) (Kevin Martin).
+178. Fixes for constant-metric fonts in AGX server (Henry Worth).
+
+XFree86 3.1.1Bi (2 July 1995)
+177. Improved "power_saver" for the S3 server, and modified XFree86-VidMode
+ extension to allow its parameters to be set from a client.
+176. Fixes for AGX copyplane (Henry Worth).
+
+XFree86 3.1.1Bh (1 July 1995)
+175. Updates to AGX server. Includes reversing previous copyplane change,
+ restoring the setting of membase for AGX chips, cleanup setting
+ of the default planemask, and fixes to the agxIm routines + some
+ speedups (Henry Worth).
+174. Some more pre-fix-12 fix-trackers.
+
+XFree86 3.1.1Bg (29 June 1995)
+173. Turn on "dac_8_bit" by default in the S3 server for RAMDACs that
+ support it. Add "dac_6_bit" option to allow 6-bit mode to be selected.
+ Also, complain when "dac_8_bit" is used for a RAMDAC that can't do it.
+172. Improve "power_saver" operation by adding a delay between turning off
+ the video signal and the syncs (Bernhard Bender).
+171. Workaround for the NumLock modifier interfering with the xterm
+ ctrl+btn menus.
+170. More pre-fix-12 fix-trackers. Mostly some libX11 and libXt fixes.
+ Includes a workaround for the NumLock modifier interfering with
+ Xaw pull-down menus.
+169. Preliminary support for the IBM RGB52x ramdacs in the S3 server
+ (Harald Koenig).
+
+XFree86 3.1.1Bf (27 June 1995)
+168. Another stab at the ET4000/W32p mouse droppings fix (Glenn Lai).
+167. Back out some LBX fixes that won't be in fix-12.
+
+XFree86 3.1.1Be (25 June 1995)
+166. Some documentation updates.
+165. Fix a few LinkKit problems.
+164. Fix LBXProxyOnly build.
+
+XFree86 3.1.1Bd (24 June 1995)
+163. Add a BuildLBXProxyOnly Imake config option to allow building lbxproxy
+ from a self-contained cut-down source tree.
+162. vtname was too short in Linux OS-dep code (similar change for LynxOS
+ and SCO too) (Pascal Haible).
+161. Change uses of malloc/free in Xserver to xalloc/xfree (Pascal Haible).
+160. AGX documentation updates (Henry Worth).
+159. Fixes for AGX font rendering, and copyplane (Henry Worth).
+158. AGX font cache flushed by screensaver (Henry Worth).
+157. AGX screensaver for >8bpp (Henry Worth).
+156. pre-fix-12 fix-tracker: improvement to the Xt translation manager
+ performance when high order modifiers are assigned. Also, change
+ the servers to use Mod3 for Mode_switch instead of Mod5 to further
+ improve this.
+155. Fix some UseGnuMalloc config stuff, and set this to YES by default
+ for FreeBSD.
+154. Fix some problems with the VGA2 server, including crashes in banked
+ mode, and incorrectly switching banks when bitblting in non-banked
+ mode.
+
+XFree86 3.1.1Bc (21 June 1995)
+153. Fix for ET4000/W32p cards -- don't change the PCI burst setting.
+ This should fix mouse droppings and missing characters in text mode
+ for some cards (Glenn Lai).
+152. Fix AGX font corruption problem (Henry Worth).
+151. Disable 32bpp in AGX server by default -- it is too unstable
+ (Henry Worth).
+150. XGA clock updates in AGX server (Henry Worth).
+149. EISA XGA probing in AGX server (Henry Worth).
+148. Better scratchpad and font cache support for XGAs in AGX server
+ (Henry Worth).
+147. Font glyph blting for non-cached fonts with AGX server (Henry Worth).
+146. AGX font cache fixes (Henry Worth).
+145. pre-fix-12 fix-trackers, including:
+ - LBX fixes and additional functionality
+ - some xtrans and fontlib fixes
+ - smproxy and xsm fixes
+144. Fix sessreg (WTMP, LASTLOG, but no UTMP) for *BSD.
+143. Allow 'UseGnuMalloc' to work on all platforms.
+
+XFree86 3.1.1Bb (17 June 1995)
+142. Config updates to make LinkKit more self-contained
+ (Marc Aurele La France).
+141. Fix some problems with blocking stderr on BSD/OS 2.0 (Hans Nasten).
+140. Add auto-apply mode to xvidtune, and flesh out the xvidtune man
+ page (Joe Moss).
+139. AGX font cache bug fixes, and fix font clipping problem (Henry Worth).
+138. Some more pre-fix-12 fix-trackers, including:
+ - Xaw - removal of undocumented/broken INTERNAL selection mechanism
+ - Fix makestrs problem with -earlyR6bc.
+
+XFree86 3.1.1Ba (14 June 1995)
+137. Fix AGX problem with vertically overlapping fonts (Henry Worth).
+136. Fix some mono (VGA2) problems that can lead to a server crash.
+135. New "VGAbase" keyword for XF86Config -- currently used only by the
+ AGX server (Henry Worth).
+134. Fixes for XGA autoconfig code in the AGX server (Henry Worth).
+133. Documentation updates (Dirk Hohndel).
+132. Change default FreeBSD version in FreeBSD.cf to 2.0.5.
+131. Add a LockModeSwitch function to the VidMode extension, and modify
+ xvidtune to use it.
+130. Force VTotal to be odd for interlaced modes.
+129. Fix default Vsync/Hsync polarity setting (Marc Aurele La France).
+128. Trap a failed 'cd' in 'make Makefiles'. This prevents the Makefile
+ in the . directory being removed (and other potential problems) when
+ one of the SUBDIRS directories is missing.
+127. Include some XC fix-trackers intended for fix-12. Main changes include:
+ - Using -Xa for SVR4 compiles, and changing '#if __STDC__' to
+ '#ifdef __STDC__'
+ - Overhall tty setup in xterm -- should work better for Solaris now.
+ - Fix SVR4 ABI problems with libXt strings.
+126. Recognise 'Ramdac "generic"' in W32 server (Glenn Lai).
+
+XFree86 3.1.1B (10 June 1995)
+125. Fix problem with dacspeed line in files generated by xf86config.
+
+XFree86 3.1.1Ad (8 June 1995)
+124. Rename the vgahelp client to xvidtune.
+123. Rename "VGAHelp" extension to our registered name
+ "XFree86-VidModeExtension", and update API to use the XF86VidMode
+ prefix instead of the "XVGAHelp"/"VGAHelp" prefix.
+122. Undef i386 in Imake.cf for i386Architecture systems.
+121. Fix(?) WTMP problem with xterm on SYSV and Linux.
+120. Mach64 documentation updates (Kevin Martin).
+119. Power_saver support for the Mach64 server (Kevin Martin).
+118. Autodetect when block write mode should be disabled for the Mach64
+ server. A "block_write" option has been added to override this
+ (Kevin Martin).
+117. Use "dead_*" keysyms instead of the DEC "D*" keysyms for the dead keys
+ in the Linux keyboard code and Compose file.
+116. Use our registered name for the ModeLock keysym.
+
+XFree86 3.1.1Ac (6 June 1995)
+115. Vgahelp client enhancements (Jon Tombs).
+114. Fix core dump in fslsfonts when no fontserver is specified
+ (Matthieu Herrb).
+113. Fix W32 problem introduced with modified SaveScreen code.
+112. Update "M" parameter calculation for Trio boards (Harald Koenig).
+
+XFree86 3.1.1Ab (2 June 1995)
+111. Preliminary support for the Cirrus 5436 (Harm Hanemaayer).
+110. PCI base address detection for the Cirrus driver (Harm Hanemaayer).
+109. Fix problem linking AGX server with the LinkKit (Stephen Kump).
+108. Support for LynxOS (Thomas Mueller).
+107. Update LinkKit to make it self-contained regarding X headers
+ (Marc Aurele La France).
+106. Realtek SVGA driver. It works with the RTG3106, and possibly the
+ RTG3103 and RTG3105 (Peter Trattler).
+105. Enable the s3MCLK option for the S3 805i, and fix some bugs relating to
+ s3MCLK (Harald Koenig).
+104. Fix XF86Config problem when monitor and screen sections are interleaved.
+
+XFree86 3.1.1Aa (1 June 1995)
+103. Fix SiteIConfigFiles settings for the LinkKit (Marc Aurele La France).
+102. Fix gccmakedep problem with .s files.
+101. Updates to BSDI docs (Hans Nasten).
+100. Updates to Linux ELF config/rules (Orest Zborowski).
+ 99. Check for 868 before 864 in S3 server (Harald Koenig).
+ 98. Add rule for compiling/installing scanpci.
+
+XFree86 3.1.1A (28 May 1995)
+ 97. vgawonder driver updates (including fix for VGA2 driver with Mach64)
+ (Marc Aurele La France).
+ 97. Small TVP3026 fix (Harald Koenig).
+ 95. Fix keyboard LEDs not being turned off now that the initial lock state
+ is ignored.
+
+XFree86 3.1.1h (26 May 1995)
+ 94. Support for parallel make (on SVR4) (Robin Cutshaw).
+ 93. Don't initialise the state of the lock keys based on their state
+ prior to server startup.
+ 92. Untested changes in the AGX server for AGX-010 support (Henry Worth).
+ 91. Tested support in the AGX server for the XGA-2 at 8bpp and 16bpp
+ (Henry Worth).
+ 90. 16bpp and 32bpp support for the AGX server (Henry Worth).
+ 89. Additional accelerations for the P9000 server (Henrik Harmsen and
+ Chris Mason).
+ 88. Fix some gamma correction problems in the S3 server (Harald Koenig).
+ 87. More 968/868 fixes, including code to recognise the newer ELSA cards
+ (Harald Koenig).
+ 86. Further VGA16 scrolling fix (Stuart Anderson).
+ 85. Fix problems with some 1MB P9000 cards (Erik Nygren).
+ 84. Swap the black and white pixel values in the SVGA server's default
+ colour map. This fixes a white line problem with some older
+ VGA Wonder boards (Marc Aurele La France).
+ 83. Move sequencer resets into the driver's SaveScreen function
+ (Marc Aurele La France).
+ 82. vgawonder and ati_test updates (Marc Aurele La France).
+ 81. Handle "crippled" Mach32 and Mach64 chips in SuperProbe and the
+ vgawonder driver (Marc Aurele La France).
+ 80. Distinguish between different types of Mach64 chips in SuperProbe and
+ the vgawonder driver (Marc Aurele La France).
+ 79. Add defines to xf86Version.h for each part of the XFree86
+ version numbers (Marc Aurele La France).
+ 78. LinkKit updates to make it self-contained (Marc Aurele La France).
+ 77. Memleak support for NetBSD, and add UseMemLeak Imake config
+ parameter to allow compiling Xserver/os with memleak (Matthieu Herrb).
+ 76. Update NetBSD aperture driver to support -current loadable kernel
+ modules (Matthieu Herrb).
+ 75. Don't try to do clock doubling for 964 + Bt485 at 32bpp.
+
+XFree86 3.1.1g (7 May 1995)
+ 74. i386 BSD support for the memleak utility (Jeffrey Hsu).
+ 73. Fix a scrolling corruption problem with multiple regions in the VGA16
+ server (Stuart Anderson).
+ 72. Modify VGA16 server to provide 4 visuals which can be selected
+ using the standard -cc flag (Stuart Anderson).
+ 71. Changes to allow XDMCP broadcasts on some transports when using
+ STREAMSCONN (Stuart Anderson).
+ 70. Updates for building on NCR SVR4/MP-RAS 3.0 (Stuart Anderson).
+ 69. Some updates for ISC (Michael Rohleder).
+ 68. Fix FillRect problem that causes a server crash for most accel servers
+ when running at 16/32bpp and X isn't on the active VC (Harald Koenig).
+ 67. Fix mach32 inline asm problem (outsw) that shows up with recent gcc
+ versions.
+ 66. Modify xterm to find all ptys on recent FreeBSD (Satoshi Asami).
+ 65. Work around S3 Trio "white line" problem by swapping the default black
+ and white pixel values.
+
+XFree86 3.1.1f (24 April 1995)
+ 64. Remove ComplexProgramTargetNoMan rule, and use NormalProgramTarget
+ instead.
+ 63. Fix cirrus MMIO problem introduced in 3.1.1e, and allow 135MHz clocks
+ for a wider range of CL-GD5434 revisions (Harm Hanemaayer).
+ 62. Update to S3 HW cursor fix (Harald Koenig).
+ 61. Preliminary support for S3 866 and 868 boards (tested with the
+ ELSA Winner 1000AVI) (Harald Koenig).
+ 60. Fix a problem with virtual resolution calculation in the Mach32 and
+ Mach64 servers (when none is given in the XF86Config file)
+ (David Holland).
+
+XFree86 3.1.1e (10 April 1995)
+ 59. Fix problems that can lead to S3 crash/lockup when using HW cursor
+ (Harald Koenig).
+ 58. S3 Trio updates (Harald Koenig).
+ 57. Fix return value of QueryBestSize() for HW cursors.
+ 56. Fix cirrus display error when scrolling without BitBLT engine
+ (Harm Hanemaayer).
+ 55. Sanity check to prevent cirrus crash with negative size rectangle
+ fill (Harm Hanemaayer).
+ 54. Cirrus MMIO improvements, including support for 5429 (Harm Hanemaayer).
+ 53. More balanced cirrus FIFO settings to resolve display refresh errors
+ during drawing operations at high dot clocks (Harm Hanemaayer).
+ 52. Support for clocks up to 135MHz for CL-GD5434 revision E and later
+ (Harm Hanemaayer).
+ 51. Fix memory leak in cirrus text drawing (Harm Hanemaayer).
+ 50. Updates for Linux ELF support (H.J. Lu).
+ 49. Fix mail directory path in xbiff.
+ 48. Fix S3 interlace mode problem for boards with programmable clocks
+ (Harald Koenig).
+ 47. Fix core dump from vgahelp when started with no args (Christos Zoulas).
+ 46. Fix 968 detection in SuperProbe, and add Ti3026 detection (Harald Koenig).
+ 45. Preliminary S3 968 and Ti3026 support (Harald Koenig).
+ 44. Added similar code for SYSV regarding I/O permission, but not enabled
+ (yet) by default.
+ 43. Modify Linux I/O permission code to use IOPL rather than TSS bitmap
+ in all cases (Orest Zborowski and Harm Hanemaayer).
+ 42. Fix lack of keysyms for numerical keypad when ServerNumLock is enabled
+ on Linux (Orest Zborowski).
+ 41. Update _SC_OPEN_MAX code.
+ 40. Fix ALLOCATE_LOCAL() not using alloca() with gcc.
+
+XFree86 3.1.1d (21 March 1995)
+ 39. Preliminary mode checking for the VGAHelp extension.
+ 38. Add timeout for 3 button emulation (Mike Hench).
+ 37. Reorganise Ti302x code to remove S3-specifics from common_hw
+ (Robin Cutshaw).
+ 36. General PCI probe code (Robin Cutshaw).
+ 35. FreeBSD 1.1.5 has _SC_OPEN_MAX defined, but no sysconf().
+
+XFree86 3.1.1c (12 March 1995)
+ 34. Updates for #9 GXE64Pro required due to changes in 3.1.1b (Hans Nasten).
+ 33. Support for BSD/OS 2.0 (Hans Nasten).
+ 32. Updates for OS/2, including work on the X server support (Holger Veit).
+ 31. SVGA driver for the ARK 1000PV and 2000PV chipsets (Harm Hanemaayer).
+ 30. Add predefs to makedepend for FreeBSD and NetBSD. This allows
+ xf86_OSlib.h to be cleaned up a little.
+ 29. Fix config rules for Sentinel build (David Wexelblat).
+
+XFree86 3.1.1b (8 March 1995)
+ 28. Fix for byte swapped extension problem in lbxproxy (Dave Lemke).
+ 27. Support for Unixware 2.0 (Robin Cutshaw and Kaleb Keithley).
+ 26. Fix FIFO detection problem and bug reading BIOS video max modes in
+ Mach64 server (Kevin Martin).
+ 25. Support for Chrontel 8398 and STG1703 clock programming in the Mach64
+ server (Kevin Martin).
+ 24. Add "no_block_write" option to turn of block write mode in the Mach64
+ server (Kevin Martin).
+ 23. Add "override_bios" option to override the Mach64 server's BIOS mode
+ checking (Kevin Martin).
+ 22. Allow Membase to be given in XF86Config for the Mach64 server
+ (Kevin Martin).
+ 21. Fix bug in Mach64 ATI68860 RAMDAC code which causes noisy display
+ (Kevin Martin).
+ 20. Add support for STG1702, STG1703, ATI68875, CH8398 RAMDACs to Mach64
+ server (Kevin Martin).
+ 19. Post events for initial lock key state differently to avoid calling
+ ProcessKeyboardEvents() before all the data it uses is initialised.
+ 18. Fix and extend ISO8859-1 Compose file (Peter Dalgaard).
+ 17. Update S3 SVGA driver so that it works with 3.1.1.
+ 16. Fix 90C33 problem with 2MB cards when memory is not auto-probed.
+ 15. Fix some ISC LOCALCONN problems (Michael Rohleder).
+ 14. Put back some #9 GXE64Pro specific bits in S3 server.
+ 13. Remove 1024 min virtual width restriction from Mach64 server
+ (Kevin Martin).
+ 12. Fix dashed line server hang problem for Mach32.
+ 11. Add UseGnuMalloc to xf86site.def (only implemented for ISC so far).
+ 10. Fix POSIX_SAVED_IDS typo in xterm (Christos Zoulas).
+ 9. Fix problem of attempting to include the VGAHELP extension in Xnest.
+
+XFree86 3.1.1a (12 February 1995)
+ 8. VGAHELP X server extension for tuning video modes (Kaleb Keithley).
+ 7. Fix libfont problem that can cause xfs to get into a loop (Jason Venner).
+ 6. Fix problem with TekHVC colours (Kaz Sasayama).
+ 5. Fix merge problems in hw/sun.
+ 4. Fix line clipping problem in Mach32 server (can affect font cache).
+ 3. Fix font cache problem on 2MB Mach32 cards.
+ 2. Add detection of Trident GUI9440 to SuperProbe (untested).
+ 1. Fix some ISC problems (Michael Rohleder).
+
+
+XFree86 3.1.1 (30 January 1995)
+265. --- Code freeze ---
+264. Include final form of fix-11.
+
+XFree86 3.1.0Zg (29 January 1995)
+263. Include final form of fix-10.
+262. Fix some merge problems.
+
+XFree86 3.1.0Zf (28 January 1995)
+261. Merge in prelim version of XC fix-11.
+
+XFree86 3.1.0Ze (28 January 1995)
+260. Merge in prelim version of XC fix-10.
+
+XFree86 3.1.0Zd (28 January 1995)
+259. Merge in XC fix-09.
+258. Minor updates (mostly typographical) to smooth the fix-11 merge.
+257. Define X_LOCALE for Linux.
+
+XFree86 3.1.0Zc (27 January 1995)
+256. Doc updates.
+255. Minor hw/xfree86 updates for fix-11 (Kaleb Keithley).
+254. Merge in XC fix-08.
+
+XFree86 3.1.0Zb (26 January 1995)
+253. Rename some files under hw/xfree86 to avoid clashes when truncated to
+ 8.3 type names as used on ISO9660 format CDROMs.
+
+XFree86 3.1.0Za (25 January 1995)
+252. Minor pixmux clock limit update for Trio64 (Harald Koenig).
+251. Merge in XC fix-07.
+250. Some documentation updates.
+
+XFree86 3.1.0Z (23 January 1995)
+249. Restore correct key maps for 84-key keyboard, but allow alternate (old)
+ behaviour when "ServerNumLock" is set in the XF86Config.
+248. xf86config updates (Harald Koenig).
+247. Remove stripes when panning with Ti3025 (Harald Koenig).
+246. Enable linear fb probing for VLB Trio64 cards with > 1MB DRAM
+ (Harald Koenig).
+245. Put blank delay values back to what they were for non-#9 Ti3025
+ boards (Harald Koenig).
+244. Fix AGX fill problems and hangs when exiting with an AGX-016 under
+ SVR4 (Henry Worth).
+243. Fix AGX font cache problem, and other updates/cleanups
+ (Henry Worth).
+
+XFree86 3.1.0Ce (22 January 1995)
+242. Updates to vgawonder driver, including fix for 68800-6 memory probe,
+ and a reworking of the clock matching code (Marc Aurele La France).
+241. Remove most BIOS dependencies in vgawonder probe code
+ (Marc Aurele La France).
+240. Change ordering of Mach32 and Mach64 probing in SuperProbe, ati.test
+ and the vgawonder driver to avoid hanging Mach32 boards. Also use
+ a timeout in all WaitIdle loops in the probes (Marc Aurele La France).
+239. Minor #9 GXE64Pro updates (Hans Nasten).
+238. Allow LASTLOG to be independent of SYSV_UTMP in xterm -- so it will
+ work for Linux (Helmut Geyer).
+
+XFree86 3.1.0Cd (21 January 1995)
+237. Improve positioning of pixmap expansion and font cache areas with
+ the S3 server.
+236. Fix problem with Cirrus mono server crashing (Stephen Kump).
+235. Allow the "sw_cursor" option to work for the S3 server.
+234. Fix S3 HW cursor hot spot problem when no ViewPort entry is given in
+ the XF86Config (Harald Koenig).
+233. Fix some S3 Trio64 8bpp+pixmux display errors (Harald Koenig).
+232. Fix #9 GXE64Pro problems introduced in 3.1.0Cc (Hans Nasten).
+231. SPEA auto-detection for their Trio64 cards (Norbert Distler).
+230. Possible fix for keymap problems with 84-key keyboards.
+229. Internationalisation support for xterm (Martin Forssén).
+228. Remove the need for a Virtual entry in the XF86Config for the Mach64
+ server.
+
+XFree86 3.1.0Cc (20 January 1995)
+227. Add a check to the W32 server for invalid depths.
+226. Fix bug in PaintWindow in Mach32 and AGX servers (Stuart Anderson).
+225. Chrontel 8391 programmable clock support (Richard Burdick
+ and Harald Koenig).
+224. S3 programmable clock code updates (Harald Koenig).
+223. Support for S3 Trio32 and Trio64 (Harald Koenig).
+222. Updates to S3 Ti3025 code for the Miro 40SV (Harald Koenig).
+221. Update xf86config to know about the latest clockchip changes
+ (Harm Hanemaayer).
+220. Minor cirrus HW cursor patch (Harm Hanemaayer).
+219. Updates to OAK driver, including mapping the linear fb above 64MB
+ (Jorge Delgado).
+
+XFree86 3.1.0Cb (19 January 1995)
+218. Fix XLOCAL parsing problem introduced in XC fix-06 (Steve Forsythe).
+217. Added a DocIndex (to use as a starting point for the HTML docs).
+216. README.Oak (Jorge Delgado).
+215. SuperProbe/kbd_mode updates for compiling with PCVT_SUPPORT
+ (Joerg Wunsch).
+214. Fix for 90C31 acceleration problems.
+213. Don't use '-ansi -pedantic' for Solaris versions earlier than 2.4.
+
+XFree86 3.1.0Ca (18 January 1995)
+212. S3 update for SPEA Mercury P64 (Norbert Distler).
+211. Late LBX updates from the XC.
+210. Add a "no_imageblt" option for the Cirrus driver (Harm Hanemaayer).
+209. Support for 2:1 pixmux 8bpp RAMDACs on boards with fixed clock chips.
+208. S3 changes for the ICS5342 ramdac/clock (Harald Koenig).
+207. Fix problem in miZeroClipLine() which can cause a server hang
+ (Harald Koenig).
+206. Fix register unlocking problem in S3 server (for Stealth 64 VRAM)
+ (Harald Koenig).
+
+XFree86 3.1.0C (15 January 1995)
+205. Preliminary programmable clock support for the Mach64 server
+ (Kevin Martin).
+204. Add accelerated line code for the P9000 server and fix/update some
+ other accelerated code (Chris Mason).
+203. Allow XF86Config Videoram to override autodetection with the P9000
+ server, and allow the "vram_128" option force recognition of
+ 128kx8 VRAM (Erik Nygren).
+202. Change P9000 programmable clock operation to be consistent with other
+ servers (Erik Nygren).
+201. Allow Cirrus MMIO for the 5429, and change on of the fixed clocks
+ in the Cirrus programmable clock code (Harm Hanemaayer).
+
+XFree86 3.1.0Bf (14 January 1995)
+200. Preprocess Linux jump files, and allow libX11 to be built with XdmAuth
+ (Orest Zborowski).
+199. Fix VTSema-related problem in s3bstore.c (Henry Worth).
+198. Merge in XC's pre-fix-07 LBX code.
+
+XFree86 3.1.0Be (12 January 1995)
+197. Include Japanese translations of some XFree86 3.1 docs (Kazuyuki Okamoto).
+196. Updates to SPEA detection code (Norbert Distler).
+195. Fix for ICS2595 initialisation problem (Norbert Distler).
+194. Some vgawonder driver fixes (Marc Aurele La France).
+193. Prevent xf86config from crashing when some fields are missing in
+ the Cards database (Matthieu Herrb).
+192. Fix S3 cursor X position when the display address is not changed to
+ avoid display errors.
+191. Set S3 M/N parameters depending on the MCLK value (which can be probed
+ or set in XF86Config) (Harald Koenig).
+
+XFree86 3.1.0Bd (12 January 1995)
+190. Update cl64xx driver for modeRec changes.
+189. Merge in XC public fix-06.
+
+XFree86 3.1.0Bc (11 January 1995)
+188. Added a DontZoom keyword for the XF86Config "ServerFlags" section
+ to disable the mode switching key sequences.
+187. Updates for ISC. Includes imake config support for the SVR3 mmap
+ driver, updates to install.svr3, and patches for building lbxproxy
+ (Michael Rohleder).
+186. Fix 864 + STG1700 8bpp pixmux for clocks between 67.5 and 95 MHz
+ (Harald Koenig).
+185. Change VRAM timings for Diamond Stealth 64 VRAM (Harald Koenig).
+184. Set HSyncEnd overflow in S3 server when needed (Harald Koenig).
+183. Prevent C&T driver from pretending to support the 82c45x chipsets.
+182. Don't trap <ctrl><alt><bs> when DontZap is set.
+
+XFree86 3.1.0Bb (10 January 1995)
+181. Updates to linear fb code for OTI087, and allow the FIFO threshold
+ to be set from XF86Config (Jorge Delgado).
+180. Add hooks for server/driver mode validation. This is currently used
+ only by the NCR SVGA driver (Stuart Anderson).
+179. Fix for ET4000/W32 bank switching code in the SVGA et4000 driver
+ (David Etherton).
+178. Similar hw cursor move fix for S3 server.
+177. Fix for Cirrus crash when the hw cursor is moved while in another VT
+ (Harm Hanemaayer).
+176. Allow the "s3_964_bt485_vclk" to be used for the Diamond Stealth64 (VRAM).
+ This requires the "diamond" option (Harald Koenig).
+175. Rewrite xlfd_round_double() to speed it up on machines with no
+ hw floating point. This reduces server startup time on such machines
+ (Harald Koenig).
+174. Reduce amount of floating-point calculation in icd2061a and S3 gendac
+ clock code (Harald Koenig).
+173. Probe code to detect some SPEA boards and correctly set the clockchip
+ (Norbert Distler).
+172. Allow Xservers to be built with only PCVT support on *BSD, and
+ clean up the console driver probing for *BSD (Joerg Wunsch).
+
+XFree86 3.1.0Ba (8 January 1995)
+171. Change "ct5??" chips&tech names to "ct655??".
+170. Fix for Xnest (and Xvfb) not calling OsInitColors().
+169. Add support for relinking the Xnest server with the LinkKit.
+168. Modify vgawonder to probe clocks when -probeonly is used
+ (Marc Aurele La France).
+167. Fix some cirrus line drawing problems and fix non-interlaced modes
+ with vertical timings > 1024 (Harm Hanemaayer).
+166. Avoid use of the threads lib for SolX86 (David Holland).
+
+XFree86 3.1.0B (4 January 1995)
+165. Support for C&T 65540/45 added to the SVGA server (Régis Cridlig).
+164. Change cirrus programmable clock code to use a tested set of clock
+ parameters when there is one close to the requested clock frequency
+ (Harm Hanemaayer).
+163. Fix cirrus BitBLTs with height > 1024 for 543x (Harm Hanemaayer).
+162. Clock-related updates to the vgawonder driver (reject invalid clocks
+ where possible) (Marc Aurele La France).
+161. Config updates (including installation of host.def and fix references
+ to cl64xx driver in xf86site.def) (Marc Aurele La France).
+
+XFree86 3.1.0Ae (2 January 1995)
+160. Replace docs with the ascii versions generated from the sgml source.
+159. Major updates to xf86config(1), including the addition of a Cards
+ database (Harm Hanemaayer).
+158. Check and reject invalid XF86Config depths for the VGA16 and Mono
+ servers.
+157. Add an "s3_964_bt485_vclk" option to fix a problem with 964+Bt485.
+ Also added code to detect the MIRO 20SV board revision (Harald Koenig).
+156. Add an S3Mclk entry to XF86Config to allow the MCLK value to be specified
+ in order to aid the calculation of the optimal M parameter
+ (Harald Koenig).
+155. Fix S3 linear fb check and allow membase to work for 864/964 boards
+ (Harald Koenig).
+154. Move server lock code back into Xserver/os so that it gets used by
+ Xnest and Xvfb.
+
+XFree86 3.1.0Ad (26 December 1994)
+153. Fix problems with DBLSCAN code introduced in 3.1.0Aa (Harm Hanemaayer).
+152. Support for adding LBX via the LinkKit.
+151. Fix some LinkKit config problems.
+150. Fix LinkKit Imakefile bug introduced in 3.1.0A.
+149. Support for SPEA Mercury P64 (Bt485 + 964) (Norbert Distler).
+148. Enable ICD2061A/SC11412 clockchip by default for S3 server if the
+ the "SPEA_Mercury" option is given and Bt485 + 964/928 is detected
+ (doesn't happen if an XF86Config entry for either ramdac or clockchip
+ is present) (Norbert Distler).
+147. Fix for PCI Type 2 probe for I128 SuperProbe code (Robin Cutshaw).
+146. Major Cirrus update. Includes new acceleration using mmio (lines
+ tilefill and rectangles), and more acceleration for 16/32bpp
+ (Harm Hanemaayer).
+145. Fixes for AGX dashed line code (Henry Worth).
+144. Allow S3 server to put the cache in the area to the right of the screen
+ when it is larger than the area below it (Leonard N. Zubkoff).
+
+XFree86 3.1.0Ac (20 December 1994)
+143. Imake template and rules for LinuxDoc-SGML formatting.
+142. Documentation converted to LinuxDoc-SGML (Gertjan Akkerman,
+ Jayadev Billa, Matthieu Herrb, Michael Klemme).
+141. Re-enable SO_REUSEADDR code in Xtranssock.
+
+XFree86 3.1.0Ab (18 December 1994)
+140. Item 58. below (the patch didn't get included before).
+139. Add some sanity checking for horizontal timing parameters (including
+ HTotal overflow for 864 with 24bpp, pixmux and HTotal > 1024)
+ (Harald Koenig).
+138. Add check for 864 DCLK limit for 24bpp (Harald Koenig).
+137. Clean up of SDAC/GENDAC detection and related messages (Harald Koenig).
+136. Allow the following ramdac and clock chips to be specified by name:
+ att21c498 (att20c498), ics5300 (s3_gendac), ics5342 (s3_sdac),
+ ics9161a & dcs2824 (icd2061a). (Harald Koenig)
+135. OS/2 updates, including config updates, SuperProbe support and
+ compile-time support for most of the Xserver (Holger Veit).
+134. Updated cl64xx driver, including support for the CL6440. Note, the
+ driver name has changed from "cl6420" to "cl64xx" (Manfred Brands and
+ Randy Hendry).
+133. Fix VT switch problem with the SVGA MX driver (Frank Dikker).
+132. Add PCI config type 1 support to I128 probe in SuperProbe (Robin Cutshaw).
+131. Update support for STB Pegasus (928 + Bt485), including 16bpp and
+ 32bpp (Leonard N. Zubkoff).
+130. Fix pixmux clock check in Mach32 server (Alan Hourihane).
+129. Mods to allow XFree86 servers to compile with 'gcc -ansi -pedantic'
+ on Solaris 2.x (David Holland).
+128. Fix stipple problem in S3 server.
+127. Fix for setuid-root xterm problem reading .Xauthority file on
+ nfs-mounted filesystem (so far only for systems with POSIX_SAVED_IDS)
+ (Christos Zoulas).
+126. Move server lock code into hw/xfree86 (Kaleb Keithley).
+125. Really fix Membase handling for S3 server and 805/928.
+124. Fix Mach32 probe problem.
+123. Fix SVR3 config problems (Michael Rohleder).
+
+XFree86 3.1.0Aa (11 December 1994)
+122. Fix default mapping for numpad keys. ServerNumLock should now not
+ be required (for clients using R6 Xlib).
+121. DoubleScan modes are no longer specified with doubled vertical timings.
+120. Add extra timings fields to the ModeRec which are the CRTC values
+ used by the hardware.
+119. Update oak driver to support linear mode for the oti-087 (Jorge Delgado).
+118. Fix '-DSTATIC_COLOR' problems (Hans Nasten).
+117. Fix typos which prevented Mach64 detection in SuperProbe from working
+ (Marc Aurele La France).
+116. Allow XF86Config settings to override ELSA probe (Harald Koenig).
+115. Fix Membase handling for S3 server and 805/928.
+114. Make BSD console driver support selectable from imake.
+113. Fix some SVR4 config problems.
+
+XFree86 3.1.0A (5 December 1994)
+112. Mach64 pixmap cache fixes (Kevin Martin).
+111. Improve cirrus programmable clock handling (Harm Hanemaayer).
+110. Add code to SuperProbe to detect the #9 Imagine I128 (Robin Cutshaw).
+
+XFree86 3.1.0g (2 December 1994)
+109. Enable mmio for the Cirrus 543x (Harm Hanemaayer).
+108. Updates to xf86config (Harm Hanemaayer).
+107. Code for SuperProbe to successfully detect CL-GD543x (Harm Hanemaayer).
+106. Eliminate all references to "SYSV386". "-Di386" should be used instead,
+ even in the BOOTSTRAPCFLAGS for SVR4 and SVR3 (Kaleb Keithley).
+105. Some typo changes to bring our code closer to what the XC has.
+
+XFree86 3.1.0f (1 December 1994)
+104. Eliminate references to SYSV386.
+103. Add check for usable linear fb for 864/964 boards.
+102. Detect and reject Mach64 boards whose ROM or VGA capability has been
+ disabled (Marc Aurele La France).
+101. Experimental code in the vgawonder driver to reset Mach* boards. This
+ is enabled with the "noaccel" option (Marc Aurele La France).
+100. Fix clashes with K_SCROLLLOCK and related symbols defined in newer
+ Linux releases (Marc Aurele La France).
+ 99. Change SuperProbe to detect the Mach64, and deal with ATI DAC classes
+ 6 and 7, and recognise the ATI 28800-6 chip (Marc Aurele La France).
+ 98. ISC 3.x and 4.x support (Michael Rohleder).
+ 97. Add support for 640 and 800 line widths to AGX server (Henry Worth).
+ 96. Fix cursor/screen scrolling problem for doublescan modes (Henry Worth).
+ 95. Add missing XF86_Mach64.c file.
+
+XFree86 3.1.0e (27 November 1994)
+ 94. Add missing install rule for gccmakedep.
+ 93. Define CSRG_BASED for *BSD (Kaleb Keithley).
+ 92. Code/prototype cleanup under hw/xfree86 (Kaleb Keithley).
+ 91. Mach64 accelerated server (Kevin Martin).
+
+XFree86 3.1.0d (22 November 1994)
+ 90. Updates to NetBSD aperture driver (Matthieu Herrb).
+ 89. Bring back 'gccmakedep' from 2.x. Currently only use it when
+ UseInstalled is true.
+ 88. Support for additional keys on Microsoft ergonomic keyboard (may
+ require support in the OS's console driver) (Kaleb Keithley).
+ 87. Updates for SCO (David McCullough).
+ 86. Don't require the Virtual size to be specified for the Mach32 server.
+ 85. Allow virtual widths < 1024 for Mach32 server (currently untested).
+ 84. Some preliminary support for ISC (SVR3) 4.x (Michael Rohleder).
+ 83. ET4000/W32 server updates. Includes accelerated 32-bit opaque and
+ transparent stipple, acceleration for cases where the planemask != 0xFF,
+ and ramdac code changed to accommodate more ramdac types (Glenn Lai).
+ 82. NetBSD support in hw/sun (Dennis Ferguson, Matthew Green, Matthieu
+ Herrb).
+ 81. Fix xterm hang-on-exit problem on SolX86 2.4 (David Holland).
+ 80. Speedups for AGX constant-metric and non-overlapping characters
+ (Henry Worth).
+ 79. AGX accelerated dashed lines, and solid fills for arcs and polygons
+ (Henry Worth).
+ 78. Doublescan support for the AGX server (Henry Worth).
+ 77. Update AGX server to delete unusable modes, and to allow the virtual
+ width to be less than the display width (Henry Worth).
+ 76. Fix typo in oak driver (which broke 067/077 support) (Jorge Delgado).
+ 75. NetBSD updates, including SparcArchitecture support in imake config
+ (Matthieu Herrb).
+ 74. 32bpp support for SPEA Mercury (928+Bt485) (Norbert Distler).
+ 73. Modify Linux kbd code to read the "high_keys" mapping (Takashi Manabe).
+ 72. Fix RGBPath in XF86Config being ignored.
+
+XFree86 3.1.0c (6 November 1994)
+ 71. Fix xload for FreeBSD 1.1.5 (Joerg Wunsch).
+ 70. Modify S3 linear fb probe to handle the non-standard CR5A[6:7] address
+ mapping used by some Diamond boards (including the Diamond Stealth Pro).
+ Also, the 10 most significant bits of a specified MemBase value are
+ now used (which leads to an incompatibility with previous usage)
+ (Dick Streefland).
+ 69. Fix clock matching and some other problems in vgawonder driver
+ (Marc Aurele La France).
+ 68. Reduce RAS to 6 MCLKs for SPEA Mercury (Norbert Distler).
+ 67. Fix setting of CR65 for the SPEA Mercury -- fixes 1600 width at 8bpp
+ and 1152 width at 16bpp (Norbert Dislter).
+ 66. Change MCLK from 46MHz to 49MHz in the SC11412 clock code (Norbert
+ Distler).
+ 65. S3 code to detect 866/868/968/Trio32/Trio64 and treat them as
+ an 864 (Harald Koenig).
+ 64. Update SuperProbe to detect STG1700, S3 GENDAC and SDAC, ATT22C498,
+ S3 Vision866, 868, 968, Trio32 and Trio64 (Harald Koenig).
+ 63. Enforce 95MHz limit for 864 when no pixmux (eg, 16bpp) (Harald Koenig).
+ 62. Increase pixmux cut-in point for ATT20C498 to 95MHz (Harald Koenig).
+ 61. ATT22C498 detection and (untested) support (Harald Koenig).
+ 60. New code for S3 SDAC/GENDAC detection, and enable the programmable
+ clock when one of these is detected (Harald Koenig).
+ 59. Fixes for S3 RAMDAC detection (STG1700 and SDAC) (Harald Koenig).
+ 58. Fix ICD2061A code for clocks between 110MHz and 120MHz (Harald Koenig).
+ 57. Chips & Technology SVGA driver (Jon Block, Mike Hollick, Régis Cridlig).
+ 56. 16/32bpp support for #9 boards with Ti3020 ramdac (Robin Cutshaw).
+ 55. Fix bsdi.cf problems with gcc options (Hans Nasten).
+
+XFree86 3.1.0b (30 October 1994)
+ 54. 16/32bpp support for Elsa Winner2000Pro (964+Ti3020) (Dirk Hohndel).
+ 53. Update to cirrus programmable clock code (Harm Hanemaayer).
+ 52. Accelerated 16/32bpp bitblt for the Cirrus driver (Harm Hanemaayer).
+ 51. The vgawonder driver will now attempt to determine what the board uses to
+ generate clocks (Marc Aurele La France).
+ 50. Allow mode flags to specify composite sync polarity (Marc Aurele
+ La France).
+ 49. ati.test and vgawonder driver updates (Marc Aurele La France).
+ 48. Vgawonder driver will now attempt to use a default video mode (derived
+ from the existing CRTC settings) when no modes are specified in the
+ XF86Config (Marc Aurele La France).
+ 47. Fix problem where clock probe could report high values as zero (Marc
+ Aurele La France).
+ 46. SVGA driver for Avance Logic Inc. ali2301, ali2302, ali2308 and
+ ali2401 (Ching-Tai Chiu).
+ 45. Enable linear aperture access for BSD/386 (Hans Nasten).
+ 44. Some Linux xterm fixes (Orest Zborowski).
+ 43. Fix Linux xdm groups setting problem (Orest Zborowski).
+ 42. Allow Mach8 server to delete unsuitable modes (Hans Nasten).
+ 41. Attempt at fixing FatalError() re-entrancy problems when aborting.
+ 40. Add X server lock file code.
+ 39. Modify PTS code in xtrans to remove an existing node at server startup
+ (as happens with UNIXCONN).
+ 38. Set debug level to 1 in xtrans (this should allow error messages to
+ finally be seen).
+ 37. Modify xtrans to use ErrorF() for debug/error messages within the
+ X server.
+ 36. Updates to the S3MNAdjust option -- including no longer using global
+ variables (Harald Koenig).
+ 35. Fix horizontal stripes when panning with an S3 805i (Harald Koenig).
+ 34. Fix SDAC + pixmux patch (Harald Koenig).
+ 33. Fix line-related crash problem when using linear addressing with
+ the SVGA server (Harm Hanemaayer).
+ 32. Fix Cirrus 5434 linear addressing text blt bug (Harm Hanemaayer).
+ 31. Fix Cirrus 14-pixel font bug (Harm Hanemaayer).
+ 30. Improve Cirrus probing (Harm Hanemaayer).
+
+XFree86 3.1.0a (21 October 1994)
+ 29. Fix some missing globals in Linux libX11 (Orest Zborowski).
+ 28. Fix for TCPCONN code's checking for an existing server.
+ 27. Support for building ELF dynamic libs on Linux (Michael Riepe).
+ 26. Fix gcc local label usage in vgaFasm.h (Adam Richter).
+ 25. OS/2 client support (Holger Veit).
+ 24. Fix some data initialisation problems in libX11 and libXt
+ (Christos Zoulas).
+ 23. Use '-ansi -pedantic' with GCC when building the core tree.
+ 22. Changes to vgaFasm.h to allow compilation with 'gcc -ansi -pedantic'.
+ 21. Revised OAK driver which includes OTI-087 support (Jorge Delgado).
+ 20. Don't use -lmalloc for FreeBSD 1.1.5 -- it seems to cause some server
+ crashes.
+ 19. Change FreeBSD.cf to refer to the compiler as 'cc' instead of 'gcc'
+ (Rich Murphey).
+ 18. Work around some problems GNU make 3.62 has with the rstart Imakefile
+ (Jim Tsillas).
+ 17. Fix HW cursor problems after switching resolutions with the SVGA
+ server (Harm Hanemaayer).
+ 16. Fix I/O permission problem with AL2101 driver (Harm Hanemaayer).
+ 15. Preliminary doublescan mode flag support (Harm Hanemaayer).
+ 14. Accelerated transparent text for Cirrus 5426/8 (Harm Hanemaayer).
+ 13. Cirrus programmable clock support (Harm Hanemaayer).
+ 12. Cirrus accelerated image text for 16/32bpp (Harm Hanemaayer).
+ 11. Fix Cirrus HW cursor colour map at 16/32bpp (Harm Hanemaayer).
+ 10. Fix 16bpp VC switch lockup on Cirrus 5426 (Harm Hanemaayer).
+ 9. Fix SDAC 15/16bpp setup and 8bpp pixmux clock selection (Harald Koenig).
+ 8. New (faster) S3 stipple code (Hans Nasten).
+ 7. Add the xf86config program to the source tree (Harm Hanemaayer).
+ 6. Gamma correction support for Ti3025 (Hans Nasten).
+ 5. Add code to set 170MHz Bt485/20C505 limits for 32bpp.
+ 4. Fix incorrect clock limit for ATT20C490 + programmable clock.
+ 3. Fix S3 co-ord overflow check for bpp > 8.
+ 2. Fix to S3 server to support newer #9 GXE64Pro boards (Robin Cutshaw).
+ 1. Documentation updates.
+
+XFree86 3.1 (29 September 1994)
+400. --- Code freeze ---
+399. Fix slow server death and VT switching problems with W32 server
+ (Glenn Lai).
+398. Fix problem with the W32 server not being installed set-uid (Hans Nasten).
+397. Fix problem with LinkKit Imakefile (Matthieu Herrb).
+396. Documentation updates.
+
+XFree86 3.0Z (27 September 1994)
+395. Fix mouse access problem when server resets while not in the active VT
+ (Orest Zborowski).
+394. Fix typo in pvga1 driver (Simon Cooper).
+393. Documentation updates.
+392. Disable MMIO for Cirrus -- doesn't work yet (Harm Hanemaayer).
+391. Workaround for Cirrus GRF corruption in SVGA probe (Harm Hanemaayer).
+390. Update colourmap/blanking for W32 server (Glenn Lai).
+389. Fix clock ordering problem for vgawonder driver (Marc Aurele La France).
+388. Fix typo in Mach32 server which prevents it from starting at 16bpp
+ (Alan Hourihane).
+
+XFree86 3.0Fe (26 September 1994)
+387. Fix for S3 line drawing overwriting HW cursor storage.
+386. Include Monitors and Devices files which contain the Monitor and Device
+ XF86Config sections that have been submitted (Gertjan Akkerman).
+385. Update Cirrus probing for 543x chips in SuperProbe (Harm Hanemaayer).
+384. Update ET4000/W32 probing for SuperProbe (Glenn Lai).
+383. 16bpp support for S3 GENDAC + 801/805 (Harald Koenig).
+382. Updates to S3 GENDAC code -- program best matching clock frequency
+ (Harald Koenig).
+381. Fix most pixel shift problems for #9GXE64Pro (Hans Nasten and
+ Robin Cutshaw).
+380. Don't allow the S3 "dac_8_bit" option to have any affect at 16/32bpp,
+ and fix related problem when using the SC15025 RAMDAC.
+379. Fix problem with Spea Mercury (Norbert Distler).
+378. Documentation updates.
+377. Updates to SolX86 aperture driver config (David Holland).
+376. Don't write mouse speed setting commands when using a non-logitech
+ protocols.
+
+XFree86 3.0Fd (25 September 1994)
+375. AGX documentation updates (Henry Worth).
+374. Fix for text-mode restore problem with AGX server (Henry Worth).
+373. Change name of XF86Vga256Drivers to XF86SvgaDrivers.
+372. Documentation updates.
+371. Enable 16bpp, 32bpp for 964+Bt485.
+370. Support for 16bpp and 32bpp on 964+Bt485 -- tested so far on
+ Miro Crystal 20SV (Eddy Olk).
+369. Fix pixel wrapping for 964+Bt485 (Eddy Olk).
+368. Fix low-res mode support for GXE64Pro (Robin Cutshaw).
+367. Fix some depth 15 vs depth 16 code for the Ti3020 (Hans Nasten).
+366. Update W32 server (Glenn Lai).
+
+XFree86 3.0Fc (24 September 1994)
+365. Fix image shift at 32bpp on GXE64Pro (Hans Nasten).
+364. Only initialise TrueColor visual for 16/32bpp since DirectColor is
+ not appropriate for the hardware.
+363. Man page updates.
+362. Fix installation problems with XF86Config man page.
+361. Disable some code in vgawonder driver that leads to problems with
+ SuperProbe (Marc Aurele La France).
+360. Change clock ordering (in some cases) for vgawonder driver so it
+ now depends only on the clock chip used (Marc Aurele La France).
+359. Fix S3 VT switching problem with #9 GXE64Pro (Robin Cutshaw).
+358. Added README.SOLX86 (David Holland).
+
+XFree86 3.0Fb (23 September 1994)
+357. Enable ICS2595 clockchip support.
+356. Enable 32bpp for Ti3025+964.
+355. Change font cache and pixmap expansion allocation policy for S3
+ server. This allows better performance when there isn't much
+ offscreen memory available (Hans Nasten).
+354. Fix for banked ImageFill for bpp>8 (Hans Nasten).
+353. Updates to XF86_Accel man page.
+352. Remove references to 'Xconfig' in source code.
+351. Updates for ICS2595 code (Norbert Distler).
+350. Enable 16bpp for Spea Mercury.
+349. VTSema fixes for AGX server (Henry Worth).
+348. Updated 16bpp/32bpp support for 928+Bt485 (Norbert Distler).
+347. Partial support for 16bpp/32bpp with 964+Bt485 (Steve Parker).
+346. Fix Ti3025 pll save/restore, and set MCLK to 54.8MHz to eliminate
+ screen corruption (Hans Nasten).
+345. Fix for AGX tile SEGV (plus some cleanups) (Henry Worth).
+344. Update to solx86 aperture driver docs (David Holland).
+343. Fix problem with S3 mmio usage at 16bpp and 32bpp (Hans Nasten).
+342. Fix Mono VGA server crashes when compiled with gcc2.
+341. Updates to xterm for Linux to handle its UTMP style and lastlog
+ (Helmut Geyer).
+340. Remove some dependencies on removed cfb.banked.
+339. Fix Mach32 SW cursor SEGV.
+338. Prevent "nomemaccess" being used for S3 864/964.
+337. Change FreeBSD.cf to use gnumalloc for FreeBSD 2.x (Rich Murphey).
+336. Set weights correctly for Cirrus 32bpp (Harm Hanemaayer).
+335. Fix signal handling in xinit for SVR4 (David Holland).
+
+XFree86 3.0Fa (21 September 1994)
+334. Fix problems with cirrus top/left edge handling with HW cursor
+ (Simon Cooper).
+333. Fix GC problem causing S3 server crash at 16bpp and 32bpp.
+332. Added copyright to the output of reconfig.
+331. Fixes for vgawonder driver (Marc Aurele La France).
+330. Update README.ati and ati.test.c (Marc Aurele La France).
+329. Fix potential problem with transparent text for the cirrus 543x
+ (Harm Hanemaayer).
+328. Fixes for ICS2595 clock code (Norbert Distler).
+327. Remove cfb.banked.
+
+XFree86 3.0F (20 September 1994)
+326. Fix problem building reconfig when BuildServersOnly is YES.
+325. Updates to README.FreeBSD (Rich Murphey).
+324. Fix P9000 problem starting at 16bpp (Erik Nygren).
+323. Fix AGX screen saver, and a flash that occurs when switching into
+ XGA mode (Henry Worth).
+322. Preliminary support for the ICS2595 clock chip (not enabled yet)
+ (Norbert Distler).
+321. Fix pixel shift problem with GXE64Pro at 8bpp and 16bpp (Robin Cutshaw).
+320. Change clock doubler transition to 80MHz for Ti3025 (Robin Cutshaw).
+319. Add README.Bsdi (Hans Nasten).
+318. Removed the need to specify the "elsa_w1000pro" and "elsa_w1000isa"
+ Options.
+317. Remove "stealth64" and "miro_crystal20sv" Options -- they are no longer
+ needed.
+
+XFree86 3.0Ec (19 September 1994)
+316. Fixes for Ti3025 support -- fixes problem with machine lockups, and
+ adds preliminary 16bpp support (Robin Cutshaw).
+315. No longer allow 'Device' in the Keyboard section. Must now use
+ 'Protocol'.
+314. Updates to Cirrus BitBLT and fix for tile fill bug (Harm Hanemaayer).
+313. Disable Cirrus top/left edge HW cursor handling -- problems when
+ changing cursors near the edge.
+312. Fix another clock limit bug in S3 server.
+311. Disable Fresco by default.
+310. Updates to W32 server (Glenn Lai).
+
+XFree86 3.0Eb (18 September 1994)
+309. Updates to README.NetBSD (Matthieu Herrb).
+308. Fix Mode Flags error reporting in xf86Config.c.
+307. Fix sessreg for Linux and add an install rule for it (Leonard N. Zubkoff).
+306. Fix xdm support with shadow passwords for Linux (Leonard N. Zubkoff).
+305. Fix typo in bsdi.cf (Hans Nasten).
+304. Support for Ti3025/#9GXE64pro (Robin Cutshaw).
+303. Don't include s3_svga driver in SVGA server by default.
+
+XFree86 3.0Ea (17 September 1994)
+302. Update bsdi.cf so Gcc2 is default for versions 1.1 and later only
+ (Hans Nasten).
+301. Fix mfb.banked so it will compile with gcc 1.4x (Hans Nasten).
+300. Remove old Xconfig code.
+299. Fix some SEGV after FatalError() problems in xf86Config.c.
+298. Set max clock to 67.5MHz for Mach32 at 16bpp.
+297. Support for P9000 screen blanking at 16bpp and 32bpp (Erik Nygren).
+296. Merge in XC public fix-05.
+295. Trap bpp > 8 in S3 server for Bt485 and Ti RAMDACs since it doesn't work.
+294. Fixes for various xf86Config.c bugs.
+293. Fix S3 clock limits when using clock doubling RAMDACs.
+292. Fixes to Ti3025 code to prevent lockups (Robin Cutshaw).
+291. Move S3 Bt485 probe to after the Ti3020/5 probe (Robin Cutshaw).
+290. Fix cirrus HW cursor behaviour at top and left edges (Simon Cooper).
+289. Set background colour mapping of Cirrus HW cursor correctly
+ (Simon Cooper).
+288. Allow cirrus hardware cursor to be used when accel is turned off
+ (Simon Cooper).
+287. Don't build shared lib for LBX on Linux (Orest Zborowski).
+286. Add README.Linux (Orest Zborowski).
+285. Fix P9000 cursor problems when VT switching (Erik Nygren).
+284. Update P9000 server to work with XF86Config (Erik Nygren).
+283. Fixes for Solaris 2.4 x86 build problems with reconfig and shm.c
+ (Doug Anson).
+
+XFree86 3.0E (14 September 1994)
+282. Change the 'Device' entry in the Keyboard section of XF86Config to
+ 'Protocol'.
+281. Update the M magic formula for S3 server (Harald Koenig).
+280. Disable TI3025 support in S3 server -- it is incomplete.
+
+XFree86 3.0Dl (13 September 1994)
+279. XF86Config(4/5) manual page.
+278. LinkKit support for the W32 server.
+277. Change HW cursor code to position cursor next to the top/left edges
+ instead of disappearing (Harm Hanemaayer).
+276. Add code to the Cirrus driver to determine clock limits based on the
+ available DRAM bandwidth (Harm Hanemaayer).
+275. Add an "S3MNAdjust" entry to the Device section of the XF86Config
+ to allow tuning of the M and N parameters in the S3 server (Harald
+ Koenig).
+274. Add a Gamma entry to the Monitor section in the XF86Config (Harald
+ Koenig).
+273. Don't strip server binaries when installing.
+272. Set PLL limits in S3 server for S3 GENDAC and SDAC.
+
+XFree86 3.0Dk (11 September 1994)
+271. Add check for incorrect Modes line in XF86Config.
+270. Add some sanity checks to S3 server for supported depths.
+269. Fix SEGV during startup of VGA16 server.
+268. Support for HW cursor in the Cirrus driver (Simon Cooper).
+267. Fix LinkKit Imakefile for building SVGA server (Simon Cooper).
+266. Update lnxLib.rules for new dll tools (Orest Zborowski).
+265. Add code to the VGA servers to handle drivers (like tvga with 512k
+ in 256 colour mode) which require scaling of the raw clock to give
+ the pixel clock.
+264. Add code to the VGA servers to handle drivers (like the generic 256
+ colour driver) which use only builtin modes.
+263. Fix bitPerRGB reported by the SVGA server.
+262. ET4000/W32 accelerated server (Glenn Lai).
+261. Fix for AGX rect tile and stipple code (Henry Worth).
+260. Add checks for the presence of Modes lines to servers that require them.
+259. S3 code to handle limits imposed by clock chips.
+258. Fix S3 pMode->SynthClock code (Harald Koenig).
+257. Fix S3 raw clock setting for SC15025 (Harald Koenig).
+256. Fixes for Mach32ImageStipple (Mike Bernson).
+255. Improve AGX support for the Hercules dual RAMDACs, provide
+ better screen blanking at startup, and fix memory probe (Henry Worth).
+254. Add clockchip "ti3025" recognition (Hans Nasten).
+253. Fix xf86Config handling of ClockChip (Harald Koenig).
+252. Fix xf86Config handling of default colour weights (Harm Hanemaayer).
+251. P9000 updates (Erik Nygren).
+250. Fix SEGV problem in Mach32 font cache code.
+249. S3 code to handle clock/bpp/ramdac dependent raw-clock vs pixel clock
+ scaling.
+
+XFree86 3.0Dj (8 September 1994)
+248. Fixed and enabled ImageRead in CopyArea for P9000 server (Chris Mason).
+247. Fixed xdm server restart problem with P9000 server (Erik Nygren).
+246. Added a sample XF86Config file that gets installed as
+ $(LIBDIR)/XF86Config.eg.
+245. Change search method for XF86Config file. Only allow user-specified
+ location when real-uid == 0. Also change -xconfig flag to -xf86config,
+ and $XCONFIG to $XF86CONFIG.
+244. Fix reconfig's problem with "ps/2" (Orest Zborowski).
+243. External changes for W32 server (Glenn Lai).
+242. Change ELSA probe to check for BIOS signature first (Harald Koenig).
+241. Preliminary support for the Ti3025 & #9GXE64pro (Robin Cutshaw).
+
+XFree86 3.0Di (7 September 1994)
+240. Remove AGX server's dependence on VGA256 (Henry Worth).
+239. Fix display start address in vgawonder driver for Mach32 and Mach64
+ boards (Marc Aurele La France).
+238. Fix clock probing in vgawonder driver for Mach64 boards
+ (Marc Aurele La France).
+237. vgawonder driver now detects and rejects Mach32 boards without
+ VGA Wonder functionality (Marc Aurele La France).
+236. Add ClockChip XF86Config keyword for programmable clock chips.
+235. Add a FIFO_MODERATE option for AGX server (Henry Worth).
+234. Limited support for Big-RAMDAC and dual-RAMDAC for 2MB Hercules
+ Graphite cards (Henry Worth).
+233. Eliminate use of libvga256 in AGX server (Henry Worth).
+232. Convert AGX code to use the Ramdac keyword instead of Options (Henry
+ Worth).
+231. Fix (?) ELSA probe code's register restoral.
+230. Auto-detection code for the NetBSD aperture driver (Matthieu Herrb).
+229. Change OpStipple interface in font code (Hans Nasten and Jon Tombs).
+228. Fix clock and register restoration in P9000 server (Chris Mason,
+ Harry Langenbacher, Erik Nygren).
+227. Fix Orchid P9000 support (Harry Langenbacher).
+226. Fix BIOS Probe for Viper PCI (Bob Hollinger).
+225. 16bpp/32bpp support code for SVGA server. Cirrus 16bpp/32bpp support
+ is now enabled (Harm Hanemaayer).
+224. Fix Mach32 cache problems (Mike Bernson).
+223. Fix Mach32 memory probe.
+222. xf86Config and reconfig bug fixes.
+
+XFree86 3.0Dh (4 September 1994)
+221. Added minimal reconfig(1) man page so that 'make install.man'
+ doesn't fail.
+220. Combine Stealth64 and Miro Crystal 20SV code. This should fix
+ some Stealth64 problems.
+219. Fix InstallManPageAliases rule for FreeBSD (Ernest Hua).
+218. 16bpp and 32bpp support for Cirrus driver -- still requires some changes
+ to the SVGA server, so not enabled yet (Harm Hanemaayer).
+217. Fixes for Mach32 cache clipping problems (Mike Bernson).
+216. 32bpp S3 updates for ELSA cards (Harald Koenig).
+215. Updates to new XF86Config code.
+
+XFree86 3.0Dg (3 September 1994)
+214. Change over to new config file format -- XF86Config (Gertjan Akkerman).
+
+XFree86 3.0Df (31 August 1994)
+213. Amoeba support updates (Kees Verstoep).
+212. Fixes for Viper PCI support (Matt Thomas).
+211. MoveWindow acceleration for all depths on P9000, and acceleration
+ now enabled by default (Chris Mason).
+210. P9000 updates. Includes updates to sysconfig code, Orchid and PCI
+ support now enabled by default (Erik Nygren).
+209. SuperProbe and ModeDB updates (David Wexelblat).
+208. Support for the S3 805i and 16-bit RAMDACS (including ATT20C498,
+ STG1700, SDAC) (Bernhard Bender).
+207. Support for the S3 SDAC with S3 864 (Bernhard Bender).
+206. Basic support for ET4000W32 chipsets in the VGA servers. Includes
+ chipset detection and code to handle up to 4MB video memory (Harm
+ Hanemaayer).
+205. Mach32 server modified to use generic cache code (Mike Bernson).
+204. Allow pixmap expansion for display widths <= 800 in S3 server.
+203. Updates for SCO (including 3.2.4 and international crypt support)
+ (David McCullough).
+202. Use mi cursor for 32bpp on S3 928 because HW cursor is broken (Harald
+ Koenig).
+201. Fix nomemaccess code in s3im.c (Harald Koenig).
+200. Code to auto-detect ELSA Winner cards, and automatically enable the
+ icd2061a clock (Harald Koenig).
+199. Fix for 32bpp S3 font cache problems (Harald Koenig).
+198. Support for a linear addressing mode in the Cirrus driver (Harm
+ Hanemaayer).
+197. Performance improvements for the "fastvga256" asm code (Harm Hanemaayer).
+196. Fix for Cirrus problem caused by pvga1 probe.
+195. Code added to S3, Mach8 and VGA servers to delete modes from the
+ "Modes" line which would previously have caused the server to
+ not start (Stuart Anderson). Note: the Mach32 server already had
+ this code.
+
+XFree86 3.0De (20 August 1994)
+194. Add run-time check for SHM kernel support on FreeBSD and NetBSD.
+193. Updates to xload for Solx86 (David Holland).
+192. Fix NULL dereference in showfont (David Holland).
+191. xconsole and doc updates for NetBSD 1.0_BETA (Matthieu Herrb).
+190. Major Cirrus driver update. Includes faster solid, stipple and tile
+ filling, improved text acceleration, blt in background, shadow I/O
+ registers, optional MMIO support for 543x (Harm Hanemaayer).
+189. Support for the miroCRYSTAL 20SV (S3 964) (Eddy Olk).
+188. Preliminary 32bpp S3 support (Harald Koenig).
+187. Make TrueColor the default root visual for 15/16/24bpp S3 (Harald Koenig).
+186. Fix S3 16bpp for 1024x768 and 1152x900 and some panning problems
+ (Harald Koenig).
+185. Fix tiling problem, and VT switch problems for S3 16bpp (Harald Koenig).
+184. Fix for Ti3020 ramdac support at >8bpp (Robin Cutshaw).
+183. AGX server fixes. Includes CopyPlane, (vga) save/restore, SC15021 CLUT
+ access, scratchpad config. (Henry Worth).
+182. Merge in XC public fix-04.
+
+XFree86 3.0Dd (12 August 1994)
+181. Fix for unnecessary read-ahead in mfbblt, and remove the '-32' display
+ width restriction (Pascal Haible, Gertjan Akkerman).
+180. Support for SGS/inmos STG1700 RAMDAC -- S3 server (Bernhard Bender).
+179. Performance improvements for AGX server (Henry Worth).
+178. More 15/16bpp fixes for S3 (Harald Koenig).
+
+XFree86 3.0Dc (11 August 1994)
+177. Various 15/16bpp S3 fixes (Jon Tombs, Harald Koenig).
+176. 16bpp support for ATT 20C490 (Jon Tombs).
+175. 16/24/32bpp code for SC15025 (Harald Koenig).
+174. Support for gamma correction in S3 server (Harald Koenig).
+173. Probe code for the SC15025 (S3 server and SuperProbe) (Harald Koenig).
+
+XFree86 3.0Db (6 August 1994)
+172. Patches for N.M value trimming (Harald Koenig).
+171. ATT20C498 and 864 support for 15/16/24bpp in S3 server (Harald Koenig).
+170. Ti3020 and Bt485 Ramdac support for 15/16/24bpp in S3 server
+ (Robin Cutshaw).
+169. Fix problems building debugging libFS (Christos Zoulas).
+168. Remove XOR'd extended register addressing in S3 server.
+
+XFree86 3.0Da (3 August 1994)
+167. Use XOR'd extended register addresses for S3 server -- avoids clash
+ with "COM4" I/O address (Jon Tombs).
+166. 16bpp S3 support (no ramdac initialisation yet) (Jon Tombs).
+
+XFree86 3.0D (1 August 1994)
+165. Fix for text restore problems with cl6420 driver (Manfred Brands).
+164. Change S3 screensaver code to do the same thing as the vga256 code
+ (Bernhard Bender).
+163. Update Cirrus driver for vga256 changes (Harm Hanemaayer).
+162. Fixes for font scaling problems on SVR4 (David Wexelblat).
+161. Remove all of the old unused pixmap cache code (David Wexelblat).
+160. Use generic font cache code for S3 server (David Wexelblat).
+159. Native AGX code for Save/RestoreAreas, CopyWindow and PaintWindow
+ (Henry Worth).
+158. Change AGX clock mappings -- see README.agx for details (Henry Worth).
+157. Update AGX server for vga256 changes (Henry Worth).
+156. Xtest fix for Linux (Erik Nygren).
+155. Speedup for cached text output in Mach8 and 8514 servers (Hans Nasten).
+154. Workaround for 6225 with LCD where full on white pixels cause display
+ problems (Philip Homburg).
+153. Fix memory handling for Mach8 boards with the SVGA vgawonder driver
+ (Marc Aurele La France).
+152. Fix some build problems on NCR SVR4 (Stuart Anderson).
+151. Fix problem which caused xjewel to lock up the S3 server when running
+ in linear mode (Harald Koenig).
+150. xman support for gzip'd man pages.
+149. Fix LinkKit problems.
+148. Omit monitor ID check in 8514 server.
+147. Fix card ident problem with ati driver.
+146. Fix asm problem in new pvga1/bank.s.
+145. Fix programs/Imakefile error.
+
+XFree86 3.0Ce (24 July 1994)
+144. Alternate "SlowBcopy()" which avoids I/O (which causes problems on
+ some cards) (Glenn Lai).
+143. Restore original mouse baud rate when exiting and VT switching (Harald
+ Koenig).
+142. pvga1 driver updates. Includes 90C33 support for 2MB, and accel code
+ updates (Bill Conn and Bill Morgart).
+141. Major updates to the SVGA ATI vgawonder driver. Includes support for
+ 4MB, probe code to detect Mach8, Mach32 and Mach64 boards, RAMDAC
+ detection, clock probe update to handle the clock chip used on Mach64
+ boards, and fixes for V3, V4 and V5 boards (Marc Aurele La France).
+140. Support for BuildServersOnly option to build only the servers using
+ a cut-down source tree (Gertjan Akkerman).
+139. Preliminary P9000 accelerated support (currently incomplete and
+ disabled by default) (Chris Mason and Erik Nygren).
+138. Preliminary Viper PCI, Orchid P9000 support (currently disabled by
+ default) (Erik Nygren).
+137. Replace the cfb.banked code with fb code which relies more on the
+ standard cfb code. For further details see the file "Design" in
+ xfree86/vga256/vga/ (Stuart Anderson).
+
+XFree86 3.0Cd (22 July 1994)
+136. Add dacspeed Xconfig keyword, and modify the S3 server to use it.
+135. Update contrib source to the XC's full release version.
+134. Fix pixel doubling problem on #9 GXE64 cards (Robin Cutshaw).
+133. Change '--print' to 'print-libgcc-file-name' in Linux config files
+ for compatibility with gcc 2.6 (Orest Zbrowoski).
+
+XFree86 3.0Cc (19 July 1994)
+132. Make use of the Xconfig Ramdac keyword in the S3 server.
+131. Improved support for the ELSA W2000Pro (Dirk Hohndel).
+
+XFree86 3.0Cb (16 July 1994)
+130. Updated xc/bug-report for XC fix-03.
+129. Don't mark duplicate clocks as zero in VGA servers.
+128. Support for #9GXE64 in S3 server (Robin Cutshaw).
+127. Tiled pixmap/stipple expansion for the S3 server (David Wexelblat).
+126. Tiled pixmap/stipple expansion for Mach8 and 8514 servers (Hans Nasten).
+125. P9000 updates. Includes colour restoration fix, changes in Modes
+ processing, and removal of banking support (Erik Nygren).
+124. 16 and 32 bpp TrueColor support for the P9000 server (Erik Nygren).
+123. Updates to AGX server. Includes font cache fixes, line fixes and
+ some more tuning options (Henry Worth).
+122. Aperture driver for NetBSD (Matthieu Herrb).
+121. Added basic man page for beforelight (Rich Murphey).
+120. Swap order of libXExExt and libXext.
+119. Remove the temporary Mach32ShareCfb option.
+
+XFree86 3.0Ca (28 June 1994)
+118. NetBSD updates (Christos Zoulas).
+117. Various updates for Minix (Philip Homburg).
+116. Support for including the MIT-SCREEN-SAVER extension (David Holland).
+115. Fixes for AGX font cache code (Henry Worth).
+114. Banking support for P9000 (doesn't seem to work yet) (David Moews).
+113. Text restoration code for P9000 (Chris Mason).
+
+XFree86 3.0C (22 June 1994)
+112. Fix server crash when started with a lock key on.
+111. Recognise 864/964 PCI as capable of linear memory access.
+110. Fix ramdac access and clock probe problems with AGX server (Henry Worth).
+109. Support for Stealth 64 (S3 964 + Bt485) (Steven Parker).
+108. Fix for 4-pixel border problem with S3 864 pixmux (Harald Koenig).
+107. Allow the S3 SVGA driver to recognise the 864 and 964 (Harald Koenig).
+106. Improved 5434 support, and accelerated copyPlane1to8 for cirrus
+ (Harm Hanemaayer).
+
+XFree86 3.0Bc (19 June 1994)
+105. Fix VT switch problem in 16bpp Mach32 when sharing cfb.
+104. Add framework for a ramdac Xconfig setting (like chipset).
+103. Reorganise mode/clock matching code (Marc Aurele La France).
+102. Fix server's client count problem after authorisation failure.
+101. Option "power_saver" to enable power-down mode on "green" monitors.
+ So far this is implemented only for VGA (all depths) and S3 servers.
+100. Remove old "memaccess" S3 option.
+ 99. Add Option "pci_hack" to work around a lockup problem reported with
+ some 928-P cards.
+ 98. Fix S3 928-P detection/reporting.
+ 97. Don't allow S3 "nomemaccess" option for 864/964 chipsets.
+ 96. Make cbrt a library -- removes the need for NeedCbrt on Linux
+ (Marc Aurele La France).
+ 95. Change ATI SVGA driver to Marc Aurele La France's version
+ (includes support for Vga2 and Vga16).
+ 94. Function prototyping for AGX, and prototype cleanup in vga16 (Stuart
+ Anderson).
+ 93. Fix (not complete?) problem with dual-headed servers.
+
+XFree86 3.0Bb (16 June 1994)
+ 92. AGX server (Henry Worth).
+ 91. Accelerated support for 90C33 (Bill Conn).
+ 90. Use s3ImageWriteFunc to load S3 cursor.
+ 89. Fix problems with SPEA Mercury for clocks > 120MHz (Norbert Distler).
+ 88. Code to program S3 GENDAC clock (Clocks "s3gendac") (Jon Tombs).
+ 87. Fix some build problems with lbx.
+ 86. Build servers with -DAVOID_GLYPHBLT.
+
+XFree86 3.0Ba (11 June 1994)
+ 85. Preliminary ELSA Winner 2000PRO support (S3 964) (Dirk Hohndel).
+ 84. Updates to S3 864 support (Harald Koenig).
+ 83. Merge in XC fix-02.
+
+XFree86 3.0B (6 June 1994)
+ 82. bitblt fixes (including big memory leak) for 8514, Mach8, Mach32 and
+ S3 servers (Tiago Gons).
+ 81. line/seg fixes for 8514 and Mach8 servers (Tiago Gons).
+ 80. Remove separate cfb libs for Mach32 (only compile-tested so far).
+ 79. Restore hw/xfree86/etc directory.
+ 78. Update bsdinst.sh for SVR4 (use /usr/ucb/install, and run 'mcs -d'
+ as well as strip).
+ 77. Cirrus driver updates (Harm Hanamaayer).
+ 76. Mach support (Robert Baron).
+
+XFree86 3.0Ac (1 June 1994)
+ 75. Amoeba fixes (Kees Verstoep).
+ 74. Fixes for Mach32 dashed line/segment code (Mike Bernson).
+ 73. Preliminary 90C33 support (Bill Conn).
+ 72. NetBSD.cf updates, and README.NetBSD added (Matthieu Herrb).
+ 71. Preliminary support for the ELSA Winner 1000PRO-VL-2 (Harald Koenig).
+ 70. Add "weight" and "displayWidth" entries to ScrnInfoRec.
+ 69. Banked vga2 server (Pascal Haible).
+ 68. Font cache changes for the Mach8 and 8514 servers. This allows them
+ to work without a font cache, and should allow their use with 512k
+ Mach8 cards. (Hans Nasten)
+ 67. Don't include XIE in the Mono and VGA16 servers (it doesn't handle
+ bit-order != byte_order).
+ 66. Add LinkKit and updated VGADriverDoc.
+
+XFree86 3.0Ab (28 May 1994)
+ 65. Add support for gzip'd man pages on FreeBSD.
+ 64. P9000 server (Erik Nygren).
+ 63. Video7 SVGA driver (Craig Struble).
+ 62. CL6420 SVGA driver (Manfred Brands).
+ 61. Set default paths for xdm for *BSD (so {Give,Take}Console can find chown).
+ 60. Add a hw/xfree86/doc directory, and start putting the docs back.
+ 59. Fixes for Amoeba support (Kees Verstoep).
+
+XFree86 3.0Aa (22 May 1994)
+ 58. Merge in XC public fix-01.
+ 57. Updates to FreeBSD.cf.
+ 56. Add xf86site.def which can optionally be included from site.def.
+ 55. SCO support and some bug fixes (David McCullough).
+ 54. Some initial untested S3 864/964 code (Harald Koenig).
+ 53. Fix for bsdLib.tmpl.
+ 52. STREAMSCONN fixes for xdm, chooser and Xserver XDMCP code (Stuart
+ Anderson).
+
+XFree86 3.0A (15 May 1994)
+ 51. SVGA driver for the AL2101 chipset (Paolo Severini).
+ 50. SVGA driver for the MX68000 and MX68010 chipsets (Frank Dikker).
+ 49. Updates to the Cirrus driver (Harm Hanemaayer). Includes code cleanup,
+ mono support, improved handling of the 5430, 5434, and transparent
+ text acceleration.
+ 48. Preliminary code for detecting S3 864/964 and AT&T 20C498 (Harald Koenig).
+ 47. Generic VGA256 driver -- works only at 320x200 (Harm Hanemaayer)
+ 46. Fixes for vga2/mfb and vga16/mfb Imakefiles.
+ 45. Include SuperProbe.
+
+XFree86 3.0d (8 May 1994)
+ 44. Add missing files to vga2/mfb.
+ 43. Set VendorString and VendorRelease up for XFree86.
+ 42. Workaround for STREAMSCONN Xdmcp problems (Xserver and xdm).
+ 41. 16 bit (directcolor) support for Mach32 (Craig Groeschel).
+ 40. Minix 3886vm support (Philip Homburg).
+
+XFree86 3.0c (6 May 1994)
+ 39. Fixes for Solaris X86 (Doug Anson).
+ 38. No longer link the Mono and VGA16 servers with Xserver/mfb/libmfb.a.
+ 37. Updates to the VGA16 code (Gertjan Akkerman). Includes banking support
+ (old-style rather than the Xsvga method), staticcolor visual, oak
+ driver enabled, added some missing files to vga16/mfb.
+ 36. Fix Linux shared libs (Orest Zborowski)
+ 35. Apollo mono driver (Hamish Coleman)
+ 34. Support for dual-headed vga2+mono and vga16+mono servers (Pascal Haible).
+ 33. Reorganisation of the mono server (Pascal Haible). Includes removing
+ xfree86/bdm2, xfree86/hga2, and replacing them with xfree86/mono.
+ 32. Fixes for PEX font compiler (from our 940327a snapshot).
+ 31. Fix SIOCGIFCONF code in xdm and Xserver for SVR4 (with Lachman TCP)
+ and FreeBSD. There are still xdm and chooser problems on SVR4.
+
+XFree86 3.0b (29 April 1994)
+ 30. Add S3 driver to SVGA server.
+ 29. Disable accelerated text blit for Cirrus 543x.
+ 28. Reorder some of the Bt485 code, and get clock doubling working again
+ without pixmux.
+ 27. Fix image shift problem for pixmux on #9 cards (Robin Cutshaw).
+ 26. Fix initialisation bug for Cirrus 62{2,3}5 cards (Harm Hanemaayer).
+ 25. Remove 8514 monitor ID check in Mach8 server.
+ 24. Fix for problem with compaq driver.
+ 23. Add "no_bitblt" option for the cirrus driver.
+ 22. Recognise the 5429 in the cirrus driver.
+ 21. Disable interrupts while programming the ICD2061A.
+ 20. sync-on-green support for the TI3020.
+ 19. Move S3 clock doubler setting from icd2061ClockSelect() to s3Init().
+ 18. Fix dac_8_bit for Bt485 cursor, and fix Bt cursor blanking problem.
+ 17. S3 pixmux support for STB Pegasus, and cleanup of pixmux and icd code.
+ (Leonard Zubkoff).
+ 16. Change "fifo_conservative" setting for CLGD543x.
+ 15. Don't reserve video memory for HW cursor on S3 when using a RAMDAC cursor.
+ 14. Allow the "8clocks" option to force 9 clocks instead of 17 on WD90C3{0,1}
+ cards.
+ 13. Fix some DEALLOCATE_LOCAL problems in accel servers.
+ 12. Support for Bt485 on #9 cards (Robin Cutshaw).
+ 11. Fixes for Cirrus driver (Harm Hanemaayer).
+ 10. Fix for text restore problem on some S3 cards (Jon Tombs).
+ 9. Workaround for Mach32 detection problem on some platforms.
+ 8. Fix incorrect usage of $(DESTDIR) in some lnxLib.rules.
+ 7. Code to detect 928-P (Harald Koenig).
+ 6. Fix cbrt() in mi/ so that it can handle negative arguments.
+ 5. Fix for line clipping problem in cfb.banked (Glenn Lai).
+
+XFree86 3.0a (28 April 1994)
+ 4. Add XFree86 server names to the list in xinit.
+ 3. Set XawI18nDefines correctly for SVR4.0.
+ 2. Update ncr.cf to pick up AllocateLocalDefines when building servers.
+ 1. Fold in client/lib OS support not picked up by the XC.
+
+XFree86 3.0 (26 April 1994)
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2588.2.13 2003/05/10 01:12:56 dawes Exp $
+
+
+
+
+
diff --git a/hw/xfree86/doc/changelogs/CHANGELOG.ND b/hw/xfree86/doc/changelogs/CHANGELOG.ND
new file mode 100644
index 000000000..3c9e1e1f6
--- /dev/null
+++ b/hw/xfree86/doc/changelogs/CHANGELOG.ND
@@ -0,0 +1,418 @@
+XFree86 3.9jw (31 July 1998)
+1327. Fix a crash in the chips driver when the chipset is specified in the
+ config file (#1846, Taketoshi Sano).
+1326. Add more Pm2 acceleration and add DPMS support for all glint chips
+ (#1844, Alan Hourihane).
+1325. Add 8x8 pattern trapezium fills, screen to screen colour expansion
+ to the MGA driver, and fix a clipping bug with colour expansion
+ (#1843, Mark Vojkovich).
+1324. Add Screen->Screen colour expansion to XAA (#1841, Mark Vojkovich).
+1323. Fix negative widths and heights in XAA's wide line code (#1840,
+ Alan Hourihane).
+1322. Fix an XAA tiled rect alignment problem (#1839, David Bateman).
+1321. Fix XAA 8x8 mono for 24bpp.
+
+XFree86 3.9jv (24 July 1998)
+1320. Fix the BitsPerPixel() macro in cfb.h for 24bpp.
+1319. Update XAA docs (#1838, Mark Vojkovich).
+1318. Add colour expansion stipples to XAA (#1837, Mark Vojkovich).
+1317. Add a stipple replacement for the MGA driver that takes into account
+ the 256K blit maximum per operation (#1836, Mark Vojkovich).
+1316. Fix C&T memory clock messages (#1834, David Bateman).
+1315. Add some new colour expansion code for older tseng chips (W32/W32i)
+ (#1832, Koen Gadeyne).
+1314. Preliminary tseng XAA support (#1832, Koen Gadeyne).
+1313. Resync the tseng driver with the main branch version (#1832,
+ Koen Gadeyne).
+1312. Some C&T updates (#1833, David Bateman).
+1311. Speed up GXcopy for XAAFillCacheBltRects (#1831, David Bateman).
+1310. Remove some code duplication in the C&T driver (#1830, David Bateman).
+1309. Add 8x8 colour and mono fills for 8bpp and 16bpp for all C&T chips
+ and 8x8 mono fills at 24bpp for HiQV chips (#1830, David Bateman).
+1308. Fix problems with XAA 8x8 patterns (#1830, David Bateman).
+1307. Get 4bpp working with C&T chipsets, and add the ShowCache option to
+ the C&T driver (#1829, David Bateman).
+
+XFree86 3.9ju (19 July 1998)
+1306. Calculate DPI from the DisplaySize entry in the Monitor section
+ if present.
+1305. Implement "tri-state" options.
+1304. Move most of cfbcmap.c to mi.
+1303. Update the C&T driver for recent XAA ImageWrite changes, and fix
+ some bugs in CHIPSHiQVWritePixmap (#1824, Nozomi Ytow).
+1302. Optimised horizontal and vertical lines for MGA (#1823, Mark Vojkovich).
+1301. Fix some XAA bugs (#1822, Mark Vojkovich).
+1300. Major updates to the XAA documentation (#1821, Mark Vojkovich).
+1299. Update XAA for the EnterVT type change (#1821, Mark Vojkovich).
+1298. Add scanline ImageWrites to XAA (#1821, Mark Vojkovich).
+1297. Make XAA Alpha friendly (#1821, Mark Vojkovich).
+1296. Set pScrn->vtSema to FALSE in ChipCloseScreen() after restoring the
+ video hardware state.
+1295. Move xf86SetDpi() calls into PreInit().
+1294. Don't show module version info on subsequent loads.
+
+XFree86 3.9jt (18 July 1998)
+1293. Add IBM 528A to the ramdac module (#1820, Alan Hourihane).
+1292. Make it a fatal error when any AddScreen() call in XFree86's InitOutput()
+ fails.
+1291. Change the type of EnterVT() from void to Bool, and make it a fatal
+ error for this to fail.
+1290. Add a helper xf86SetBlackWhitePixels() to set the values according
+ to the presence of the -flipPixels command line option.
+1289. Add xDpi and yDpi fields to the ScrnInfoRec, and a helper xf86SetDpi()
+ to set them.
+1288. Allow a bus type prefix for BusID strings.
+1287. Remove the global xf86VTSema (David Bateman, David Dawes).
+1286. Complete the XAA 8x8 pattern caching (#1817, Mark Vojkovich).
+1285. Add a missing Millennium accel flag (#1816, Mark Vojkovich).
+1284. Make the CRTC blanking setting exact rather than allowing some unblanked
+ overscan area (#1813, Koen Gadeyne).
+1283. Prelminary TGA (AXP only) driver (#1811, 1818, Alan Hourihane).
+1282. Prelminary Bt485 ramdac support for the ramdac module (#1809, 1815,
+ Alan Hourihane).
+1281. OS-support and config updates for AXP (#1808, Alan Hourihane).
+1280. Add code to the ramdac module for initialising gamma correction
+ (1807, Alan Hourihane).
+1279. Fix C&T HiQV PCI bus support (#1802, David Bateman and Nozomi Ytow).
+1278. Add HW cursor support for the Permedia2v (#1812, Alan Hourihane).
+1277. Remove most vgahw dependencies from the glint driver (#1810,
+ Alan Hourihane).
+1276. Add preliminary support for the Permedia2v to the glint driver
+ (#1800, 1810, Alan Hourihane).
+1275. Some C&T updates (#1791, 1796, Nozomi Ytow, David Bateman).
+1274. Reintegrate Harm's XAA SolidArc code (#1814, David Bateman).
+1273. Make sure assembler usage is set correctly for x86 when MakeDllModules
+ is true (#1806, David Bateman).
+1272. Fix too little data being sent by the XAA BitmapScanline when the
+ number of dwords sent was divisible by four (#1806, David Bateman).
+1275. Fix for the swapping of fg and bg in the XAA WriteBitmap primitives
+ (#1806, David Bateman).
+1274. Add TRIPLE_BITS_24BPP code for the XAA WriteBitmap function (#1806,
+ David Bateman).
+1273. Attempts at optimised 6 and 8 pixel drawTETextScanline functions
+ in assembler (#1789, 1806, David Bateman).
+1272. Remove some redundant extern declarations (xf86Procs.h & xnest)
+ (#1790, Marc La France).
+1271. xf4bpp now loads xf1bpp (#1790, Marc La France).
+1270. Make vgahw module load cfb (re: cfbExpandDirectColors()) (#1790,
+ Marc La France).
+1269. Fix vgahw's saving/restoring of text modes, overscan handling
+ and memory leaks (#1790, Marc La France).
+1268. Fix compilation warnings in libc wrapper (Marc La France).
+1267. Rewrite VGA generic driver (Marc La France).
+1266. Fix bug that nullified the driver's mode list when deleting the
+ second-to-last mode (#1790, Marc La France).
+1265. Reduce verbosity level of the message that gets printed when
+ a driver's ValidMode() rejects a mode (#1790, Marc La France).
+1264. Allow drivers to supply a default mode (#1790, Marc La France).
+1263. Allow for more than 4 (== MAXSCREENS) drivers to probe a system
+ (1790, Marc La France).
+1262. Fix xf4bpp integration (#1790, Marc La France).
+1261. Implement -dpi flag and -flippixels flags (#1790, Marc La France).
+1260. Fix CLKDIV2 support (#1790, Marc La France).
+1259. Implement multiscanned modes (#1790, Marc La France).
+1258. Fix some depth/bitsPerPixel confusion (#1790, 1799, Marc La France).
+1257. Fix memory leaks in the MITSHM and dix pixmap code (#1790,
+ Marc La France).
+1256. Fix a minor header problem in the Type1 code (#1790, Marc La France).
+
+XFree86 3.9js (12 July 1998)
+1255. Make sure DPMSEnabled gets set correctly.
+1254. Use a BlankScreen function with xf86GetClocks() that takes more
+ appropriate arguments than SaveScreen.
+1253. Fix SEGV in TsengProbe() when there are no Tseng cards present.
+1252. Add caching of 8x8 patterns to XAA (#1787, Mark Vojkovich).
+1251. XAA updates, including TRIPPLE_BITS_24BPP, check QWORD padding in
+ the font rendering, and an attempt at Pentium optimised assembler
+ for 6 pixel wide TE font (#1785, David Bateman).
+1250. Fix an omission in xf86MatchPciInstances() (#1786, Kevin Martin).
+1249. Numerous C&T driver fixes and HW cursor support added (#1781-1783,
+ David Bateman).
+1248. Add support for 1, 8, 16, 32 and 64 bit interleaves to the XAA
+ hardware cursor code (#1780, David Bateman).
+1247. Fix a segfault in xf86DPMSInit() (#1780, David Bateman).
+1246. Some updates to the ramdac module (#1777, 1778, Alan Hourihane).
+1245. Add 500TX support to the glint driver (#1777, Alan Hourihane).
+1244. Fix parsing of ModeLine keyword (#1779, Keldon Jones).
+
+XFree86 3.9jr (5 July 1998)
+1243. Avoid mishandling 64-bit PCI base addresses, and "safely" avoid them.
+1242. Fix font modules so that clients can use the font libraries
+ (#1774, Alan Hourihane, David Dawes).
+1241. Fix for XAA GC problems that show up when backing store is enabled
+ (#1775, Mark Vojkovich).
+1240. Fix for xf86MatchPciInstances() (#1773, Alan Hourihane).
+1239. Unload drivers in InitOutput that end up not being used.
+1238. Make the ScrnInfoRec.privates persistent rather than per-generation
+ data.
+1237. Remove the "requiredModules" field from the ScrnInfoRec and have the
+ drivers load the modules they need explicitly. The loader and parts
+ of the design have been updated to take this into account.
+1236. Remove refcount code added in change 1175, and fix problem with the
+ preexisting refcount code not incrementing the count when modules
+ are loaded second and subsequent times.
+1235. Add more info for LoaderPrint{Symbol,Address} functions (1772,
+ Stuart Anderson).
+1234. Fix some Linux/Alpha loader problem (#1772, Stuart Anderson).
+
+XFree86 3.9jq (3 July 1998)
+1233. Loadable font modules (#1767, Alan Hourihane).
+1232. Add Option "ShowCache" to allow scrolling down to see part of the
+ pixmap cache (#1770, Mark Vojkovich).
+1231. Fix MGA loss of sync problem when scrolling the desktop (#1770,
+ Mark Vojkovich).
+1230. Add XAA cursor support to the MGA driver (#1770, Mark Vojkovich).
+1229. Have XAA wrap the EnterVT and LeaveVT functions so that it can
+ invalidate the pixmap cache. Also further progress towards
+ getting 8x8 patterns cached (#1769, Mark Vojkovich).
+1228. XAA cursor support. Only the TVP3026's style cursor data packing
+ (ie. source and mask not interleaved) is supported at the moment
+ (#1768, 1771, Mark Vojkovich).
+1227. Implement correct CRTC blanking timings (Koen Gadeyne).
+1226. Lots up updates to the Tseng driver (Koen Gadeyne).
+1225. Chips & Technologies driver converted to ND (#1761, David Bateman).
+1224. Ramdac/colourmap module. Support for IBM ramdac so far (#1759, 1760,
+ Alan Hourihane).
+1223. Set the Crtc[HV]Adjusted flags more appropriately in
+ xf86SetCrtcForModes() (#1757, David Bateman).
+1222. Change xf86MatchPciInstances() to work with drivers supporting chips
+ from more than one vendor (#1753, 1754, Alan Hourihane).
+
+XFree86 3.9jp (27 June 1998)
+1221. Preliminary tseng driver (Koen Gadeyne).
+1220. Add the Xv extension (from the R5 contrib) (#1749, Mark Vojkovich).
+1219. Fix a rendering error in cfb's bit expansion code that can show
+ up with a very complex clip mask (#1747, Jens Owen).
+1218. Allow XAA's pixmap cache to use smaller slots when the larger ones
+ are not available (#1751, Mark Vojkovich).
+1217. Document the offscreen memory manager (#1747, Mark Vojkovich).
+1216. Fixes and temporary workarounds for mibank problems detected by xf4bpp
+ (#1743, Marc La France).
+1215. Fix a XF68_FBDev typo (#1743, Marc La France).
+1214. Fix up cfb and mfb header files (#1743, Marc La France).
+1213. Fix up xf1bpp's integration into the new design (#1743, Marc La France).
+1212. Introduce xf4bpp, a port of vga16 to the new design (#1743,
+ Marc La France).
+1211. Allow for zero to be a valid setting for chipID and chipRev. These
+ are now initialised to -1 to indicate when they have not been set.
+
+XFree86 3.9jo (22 June 1998)
+1210. Add accelerated solid trapezoid fills to the MGA driver (#1740,
+ Mark Vojkovich).
+1209. Add accelerated polygons and wide lines to XAA, and fix some pixmap
+ cache problems (#1739, Mark Vojkovich).
+1208. Move the offscreen memory manager from XAA to xfree86/common
+ (#1739, 1741, Mark Vojkovich).
+1207. Fix a typo in the glint driver (#1737, Alan Hourihane).
+1206. Resync the parser with the common layer data structures, removing
+ some obsolete things and adding a few missing things.
+1205. Include the class/subclass/interface values in pciVideoRec.
+
+XFree86 3.9jn (21 June 1998)
+1204. Replace the "MAGIC" module init interface with the more general
+ SetupProc/TearDownProc interface.
+1203. Fix some typos in the DESIGN doc (Koen Gadeyne).
+1202. Add some more acceleration to XAA, and support for it to the MGA
+ driver (#1732, 1733, 1735, Mark Vojkovich).
+1201. Preliminary pixmap cache support and offscreen memory manager added
+ to XAA (#1732, 1734, 1736, Mark Vojkovich).
+1200. Fix linepitch handling in the glint driver (#1731, Alan Hourihane).
+
+XFree86 3.9jm (15 June 1998)
+1199. Add preliminary infrastructure for different pixmap and framebuffer
+ formats.
+1198. Start a module/driver name space registry.
+1197. Accelerated glint driver (#1725-1727, Alan Hourihane).
+1196. Resync the PCI IDs.
+1195. Update xf86GetPciInfoForScreen() and add a similar
+ xf86GetIsaInfoForScreen().
+1194. Update DGA support code in the common layer.
+1193. Update DPMS support code in the common layer.
+1192. Reintroduce xf86GetClocks() as a helper.
+
+XFree86 3.9jl (9 June 1998)
+1191. Bring over the serial port functions (from Metro Link).
+1190. Bring over the os-support/pmax code.
+1189. Change the interface for xf86MatchPciInstances() to use separate
+ lists of PCI chipset names and IDs.
+1188. Fix some build problems on SVR4.0 and Solaris.
+1187. Rename xf1bpp_mfb* entry points to xf1bpp (#1714, Marc La France).
+1186. Port some recent vga16 changes over to the nd branch (#1714,
+ Marc La France).
+1185. Remove CloseScreen() and SaveScreen() from ScrnInfoRec's (#1714,
+ Marc La France).
+1184. m68k's XF86_FBDev now uses low-level backing store functions
+ during VC switches (#1714, Marc La France).
+1183. Push out backing store and banking wrapper initialisation to the
+ to the callers of the various <framebuffer>ScreenInit()'s. This allows
+ XAA to wrap screens after banking, but before backing store (#1714,
+ Marc La France).
+1182. Allow screen wrappers to free their private data on server reset and
+ termination (#1714, Marc La France).
+1181. Minimise the number of public globals in the common layer, and replace
+ those the drivers need with functions to access their values.
+1180. Update the PCI code to match that on the main branch.
+
+XFree86 3.9jk (4 June 1998)
+1179. Change the Xserver binary name to "XFree86".
+1178. Add support for building a static Xserver.
+1177. Clean up some of the module Imake config stuff.
+1176. Fix generic vga driver probe crash.
+1175. Keep a reference count for loading modules and avoid loading the
+ same module twice.
+1174. A first attempt at ABI versioning the modules and checking it
+ in the loader.
+1173. Add a canonical naming for modules, without things like the "lib"
+ prefix or "_drv" suffix.
+1172. Add the -layout and -screen options to allow a layout or screen section
+ to be specified from the command line.
+1171. Make the interface in the xf86Find{Vendor,Layout} parser functions
+ consistent with the others.
+
+XFree86 3.9jj (31 May 1998)
+1170. Add call to LoaderCheckUnresolved().
+1169. Add finding the correct Display subsection to the xf86SetDepthBpp()
+ helper (David Dawes).
+1168. Some os-support layer cleanups (more required).
+1167. Add a new helper to simplify the driver Probe() code for PCI cards
+ (David Dawes).
+1166. Remove some fields from the ScrnInfoRec.
+1165. Add a set of option handling functions and helpers to the common layer.
+ These allow the option data structures to be opaque to the drivers
+ (David Dawes).
+1164. Add xstrdup (Xstrdup) to os/utils.c, and treat xf86strdup the same way
+ as xf86malloc in the libc wrappers.
+1163. Fix XAA 14 pixel width fonts (#1699, Mark Vojkovich).
+1162. Fix XAA CopyGC crash (#1698, Mark Vojkovich).
+
+XFree86 3.9ji (23 May 1998)
+1161. MGA Support for the new XAA code (#1697, Mark Vojkovich).
+1160. New XAA code (#1695, 1696, Mark Vojkovich).
+1159. Millennium 2 (inc AGP) support for the mga driver (#1697,
+ Mark Vojkovich).
+
+XFree86 3.9jh (22 May 1998)
+1158. Fix 'Unknown symbol type 1e' messages in the a.out loader
+ (#1683, Matthieu Herrb).
+1157. Loader updates, including Alpha and PowerPC support (#1467, 1666,
+ Metro Link).
+1156. Add '-Wall' to gcc compile options
+1155. Add Xarch.h (#1399, Metro Link).
+1154. Resync libc/ansic wrappering.
+
+XFree86 3.9jg (3 May 1998)
+1153. Remove ilbm's call to miRegisterGCPrivateIndex(), which no longer
+ exists (#1670, Marc La France).
+1152. Fix problems with mi generic functions in mibank (#1670,
+ Marc La France).
+1151. Symbolically link xf86_ansic.h so osPexFont.c can #include it
+ (#1670, Marc La France).
+1150. Fix opaque types in xf86_libc.h (#1670, Marc La France).
+1149. Fix a typo in mibank which makes miScanLineWidth() always fail.
+1148. Fix various missing symbols that show up when attempting to use
+ non-dlopen modules.
+
+XFree86 3.9jf (18 April 1998)
+1147. Add xf1bpp framebuffer for use by vga2 and mono (i.e. hga2)
+ drivers. This is just a copy of mfb compiled for the bitmapScanlinePad
+ and bitmapBitOrder needed by these hardware framebuffers (#1636,
+ Marc La France).
+1146. A mode that fails validation (for whatever reason) no longer
+ affects the resulting virtual resolution (#1636, Marc La France).
+1145. miScanlineWidth() is now passed the hardware plane pixmap format
+ rather than nBankBPP (the harware plane bpp) and nPixelBPP (the
+ "total" bpp), and have xf86ValidateModes() call miScanLineWidth()
+ to determine an appropriate line pitch for the virtual resolution
+ requested (#1636, Marc La France).
+1144. Remove the helpers' concept of pixelArea as this can be derived
+ from videoRam and bitsPerPixel, express pitchInc in bits, and
+ pass apertureSize to mode validation helper (#1636, Marc La France).
+1143. Introduce the new mi banking wrapper (not yet used) (#1636,
+ Marc La France).
+1142. Make each screen keep track of the pixmap formats and display-
+ wide attributes it needs in its ScreenInfoRec. InitOutput()
+ can then ensure consistency before adding the screens to the
+ display (#1636, Marc La France).
+1141. Use low-level backing store functions to save/restore the
+ screen during VC switches (doesn't work with vga16) (#1636,
+ Marc La France).
+1140. Move a copy of the backing store low-level function pointers
+ into the ScreenRec. This allows them to be wrapped (#1636,
+ Marc La France).
+1139. Rename [GS]etRootPixmap screen entries to [GS]etScreenPixmap
+ and add [GS]etWindowPixmap entries. Some may not be needed and
+ can be removed later (#1636, Marc La France).
+1138. Remove cfbScreenInitLong() entries. They are not needed since the
+ RGB ordering and masks can be fixed after calling cfbScreenInit()
+ (#1636, Marc La France).
+1137. Fix the saving and restoring of PSZ #define in cfb??.h headers,
+ add copyright notice to them, and get right Imakefile to include
+ them in the link kit (#1636, Marc La France).
+1136. Fix oversight in 1133 (#1636, Marc La France).
+1135. Some include file fixes (#1539, Marc La France).
+
+XFree86 3.9je (14 February 1998)
+1134. Move framebuffer ModuleInit funtions into separate files (#1475,
+ Marc La France).
+1133. Move the following GC privates to the GC structure proper:
+ pRotatedPixmap, pCompositeClip, fExpose, freeCompClip. This is in
+ preparation for the banking mi wrapper (#1451, Marc La France).
+1132. Minor bug fix to mfb and afb framebuffers (#1443, Marc La France).
+1131. Ensure window and GC privates are aligned on a sizeof(long)
+ boundary (#1442, Marc La France).
+1130. Minor optimisation of cfb's ImageGlyphBlt entry, required for
+ the new banking code (#1431, Marc La France).
+
+XFree86 3.9jd (1 February 1998)
+1129. Update the generic VGA driver for these changes (David Dawes).
+1128. Flesh out and update the design document, and add it to the source
+ tree (in xc/programs/Xserver/hw/xfree86/DESIGN) (David Dawes).
+1127. Working non-accel MGA driver (Millennium I only) (David Dawes).
+1126. Update parser (from Metro Link).
+1125. Fill in some missing bits of infrastructure, and fix some bugs there
+ (David Dawes).
+
+XFree86 3.9jc (16 January 1998)
+1124. A start at modifying non-accel MGA driver for new design (David Dawes).
+1123. Pick up multimedia/video PCI devices in xf86GetPCIVideoInfo()
+ (David Dawes).
+1122. Fix some header usage and missing prototypes (David Dawes).
+1121. Continue filling in missing bits of the new design infrastructure
+ (David Dawes).
+1120. Get the generic vga driver working (using dll modules on FreeBSD)
+ (David Dawes).
+1119. Reorganise the vgahw module (David Dawes).
+
+XFree86 3.9jb (25 September 1997)
+1118. Continuation of 1117.
+
+XFree86 3.9ja (29 July 1997)
+1117. Start converting the generic vga driver to the new design (Dirk Hohndel,
+ David Dawes).
+1116. Add flags to allow to build some modules as shared objects (Dirk Hohndel).
+1115. Fix dll loader to work on Linux (and re-fix it to work on FreeBSD
+ again) (Dirk Hohndel, David Dawes).
+1114. Add helper functions for various stages of the server (David Dawes,
+ Dirk Hohndel).
+1113. Add glue code to interface with new parser and create internal data
+ structures (David Dawes, Dirk Hohndel).
+1112. Split up vga256/vga into vgahw and vgafb (Dirk Hohndel).
+1111. New parser for the config file (Stuart Anderson).
+1110. Start work on the new design.
+
+XFree86 3.9j (12 July 1997)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG.ND,v 1.3 1998/08/02 05:16:54 dawes Exp $
diff --git a/hw/xfree86/doc/changelogs/CHANGELOG.R5 b/hw/xfree86/doc/changelogs/CHANGELOG.R5
new file mode 100644
index 000000000..5f8e03a19
--- /dev/null
+++ b/hw/xfree86/doc/changelogs/CHANGELOG.R5
@@ -0,0 +1,1249 @@
+XFree86 2.1.1 (4 May 1994)
+ 36. Fix server crash on reset problem in Mach32 and S3 servers
+ 35. Fix typos in apollo driver
+ 34. Fix for Imake config problem on ISC 4.0
+ 33. ET3000 memory probe fix for SuperProbe
+ 32. Documentation updates
+ 31. Some updates for NetBSD-current
+
+XFree86 2.1.0B (26 April 1994)
+ 30. Disable accelerated text blit for Cirrus 543x
+ 29. Reorder some of the Bt485 code, and get clock doubling working again
+ without pixmux
+ 28. Disable the PIXMUX_SWITCH_HACK stuff -- it doesn't seem needed any more
+ 27. Fix image shift problem for pixmux on #9 cards (Robin Cutshaw)
+ 26. Fix initialisation bug for Cirrus 62{2,3}5 cards (Harm Hanemaayer)
+ 25. Remove 8514 monitor ID check in Mach8 server
+ 24. Updates to the NetBSD README (Matthieu Herrb)
+ 23. Hey Rocky, watch me unbreak the Compaq driver... This time for sure...
+
+XFree86 2.1.0Ab (16 April 1994)
+ 22. Rewrite of ATI SVGA driver (Marc La France)
+ 21. Add "no_bitblt" option for the cirrus driver
+ 20. Recognise the 5429 in the cirrus driver
+ 19. Disable interrupts while programming the ICD2061A
+ 18. sync-on-green support for the TI3020
+ 17. Move S3 clock doubler setting from icd2061ClockSelect() to s3Init()
+ 16. Fix dac_8_bit for Bt485 cursor, and fix Bt cursor blanking problem
+ 15. SuperProbe updates
+
+XFree86 2.1.0Aa (10 April 1994)
+ 14. BDM2 apollo driver (Hamish Coleman)
+ 13. S3 support for switching between pixmux and non-pixmux modes
+ (Amancio Hasty)
+ 12. S3 pixmux support for STB Pegasus, and cleanup of pixmux and icd code
+ (Leonard Zubkoff)
+ 11. Change "fifo_conservative" setting for CLGD543x
+ 10. Updates for NetBSD-current, including bumping shared lib revs
+
+XFree86 2.1.0A (7 April 1994)
+ 9. Don't reserve video memory for HW cursor on S3 when using a RAMDAC cursor
+ 8. Allow the "8clocks" option to force 9 clocks instead of 17 on WD90C3{0,1}
+ cards
+
+XFree86 2.1.0a (6 April 1994)
+ 7. Fix some DEALLOCATE_LOCAL problems in accel servers
+ 6. Support for Bt485 on #9 cards (Robin Cutshaw)
+ 5. Fixes for Cirrus driver (Harm Hanemaayer)
+ 4. Fix for text restore problem on some S3 cards (Jon Tombs)
+ 3. Workaround for Mach32 detection problem on some platforms
+ 2. Fix incorrect usage of $(DESTDIR) in some lnuxLib.rules and x386.cf rules
+ 1. Code to detect 928-P (Harald Koenig)
+
+XFree86 2.1 (11 March 1994)
+151. OS README updates (affect individual OSs only)
+150. Fix AltGr handling for Linux (affects Linux only)
+149. Comment out the unused s3Save() and s3Restore() functions -- a typo in
+ some unreachable code may cause problems with some compilers (should not
+ affect any OSs)
+148. Linux compile-time fix for fonts/PEX/lex.l (affects Linux only)
+147. Late cirrus fix for large tiles
+146. Fix for LinkKit site.def and Imakefile (remove dbm references)
+
+XFree86 2.0Z (8 March 1994)
+145. Fix text/graphics mode switching for pixmux with SPEA Mercury. This
+ code is now reasonably stable (interlace support is still absent though)
+ (Norbert Distler)
+144. Fix for cirrus stipple fill when virtual width is not a multiple of 32
+143. Linux keyboard updates
+
+XFree86 2.0Ce (7 March 1994)
+142. Preliminary support for Bt485 pixel multiplexing on the SPEA Mercury
+ card (Norbert Distler)
+141. More documentation updates
+140. SuperProbe updates (ATI and Weitek fixes)
+139. Fix for second MB cirrus BitBLT but -- BitBLT now turned back on for
+ 2MB cards (Wolfgang Jung)
+
+XFree86 2.0Cd (6 March 1994)
+138. Default to building shared libs for FreeBSD
+137. Updates to cirrus driver: (Harm Hanemaayer)
+ New Option flag "no_2mb_banksel" for cards that have 2MB in the form
+ of 512kx8 DRAMS (4 chips)
+ Disable BitBLT engine use when using more than 1MB because there
+ are problems
+ New text bitmap transfer code
+136. Documentation updates
+135. Fix mi/cbrt.c so it handles negative arguments.
+
+XFree86 2.0Cc (5 March 1994)
+134. Update x386/etc/console.h to current version
+133. Some documentation updates (including removing README.XS3)
+132. Updates to cirrus driver: (Harm Hanemaayer)
+ New option flags "fifo_conservative" and "fifo_aggressive" to
+ control the CRTC fifo threshold.
+ Reduce clock limit for the 5420
+ Remove accelerated PolyGlyphBlt -- it causes problems
+131. Modify pvga1 driver to detect the 90C24 and treat it as a 90C30
+130. Support for the SC15025 RAMDAC in 8-bit/RGB mode (requires
+ the "sc15025" and "dac_8_bit" options) (Helmut Geyer)
+129. Fix vga colourmap save/restore when using a RAMDAC in 8-bit mode (Helmut
+ Geyer)
+
+XFree86 2.0Cb (3 March 1994)
+128. Fix for "snow" problems on WD90C3x cards with 80MHz clock (Anders Bostrom)
+127. Fixes for compilation problems on Mach and ISC
+126. Support for 8-bit/RGB for the AT&T 20C490/491 ramdacs (S3 server).
+ There is no auto-detect, so the "att_20c490_1" Option must be
+ specified (together with the "dac_8_bit" Option)
+125. Added some sample patches from Gertjan Akkerman which document some
+ useful changes which could me made to the VGA16 server (these are
+ in x386/vga16/doc/).
+124. Fix Mach8 and Mach32 server hang when run on a card with no Mach chip
+123. Update xterm's terminfo file
+122. Install mit/config/README in lib/X11/config
+121. Modify Trident driver to recognise the 9000i, 9200CX, 9100B and 9420
+ chipsets. The first is treated as a 9000, and the last three are
+ treated as a 8900CL.
+
+XFree86 2.0Ca (2 March 1994)
+120. Fix CR60 setting for clocks > 100MHz (S3 server)
+119. Fix cirrus compilation on SVR4, and bsd_init.c typo
+118. Enable Home/End esc sequences for xterm on all OSs
+117. SuperProbe register unlock fixes
+
+XFree86 2.0C (1 March 1994)
+116. Allow the MIT-SHM extension to be disabled at run-time on BSD systems
+ when kernel support for sysv-shm isn't present
+115. Enable Home/End esc sequences for xterm (Linux only -- should this be
+ extended?)
+114. Set default xterm tty parameters to reasonable values (fixes problems
+ seen when using xdm)
+113. gccmakedep fix (David McCullough)
+112. Special-case code for lines where this is one rectangle in the clip
+ region -- for Mach32 (Craig Groeschel)
+111. Update to compaq probe code -- hopefully this will reduce the number
+ of false positives
+110. Major updates to SuperProbe
+109. Cirrus driver patches
+
+XFree86 2.0Bb (27 February 1994)
+108. Removed experimental "cr60=..." options (S3), and made CR60=0xFF
+ the default setting. The "dram_{slow,med,fast}" options still remain
+ as un-documented options (just in case).
+107. Manual page updates
+106. Support for linear fb location on Mach32 PCI cards
+105. Include Solaris x86 "aperture driver" (Doug Anson and David Holland)
+104. Updated Thomas Wolfram's SVR3 mmap driver to version 2.2.3
+103. Allow the MemBase setting in Xconfig specify the high 5 bits of the
+ 4MB aperture address for the Mach32 server, and the high 6 bits of
+ the LAW address for the S3 server
+
+XFree86 2.0Ba (25 February 1994)
+102. Fix/speedup for window->pixmap part of CopyPlane() in the accel servers
+101. Fix bits per RGB reported for S3 server when using 8bpRGB
+100. Modify code for determining when pixel multiplexing is required for
+ the S3 server, and restrict the DisplayWidth to either 1024 or 2048 when
+ pixel multiplexing is used
+ 99. Preliminary support for the SC11412 clock chip used on the SPEA Mercury
+ (S3). Use 'Clocks "sc11412"' to select this (Norbert Distler)
+ 98. "icd2061a" now uses the "icd2061a_slow" clock setting algorithm.
+ The name "icd2061a_slow" will be dropped in the release after 2.1
+ 97. Fixes for zero-width arcs for the VGA16 server (Gertjan Akkerman)
+ 96. Support for David Holland's "aperture driver" for linear fbs on Solaris
+ 95. Fix Solaris panic when no free VTs are available
+ 94. Much-enhanced accelerated support for Cirrus chips (Harm Hanemaayer)
+ 93. Support for up to 17 clocks on WD90C3x cards (Anders Bostrom)
+ 92. Fix for Compaq avga driver
+ 91. Keyboard updates to handle Linux' key remapping (Orest Zborowski)
+ 90. README for Solaris (David Holland)
+
+XFree86 2.0B (21 February 1994)
+ 89. Possible fix for Bt probe problem that some people see
+
+XFree86 2.0Ab (19 February 1994)
+ 88. Combine DRAM and non-DRAM mach8 image assembler code into single files
+ with #ifdefs
+ 87. Fix for hga2 driver to prevent it from blanking MDA displays when
+ swithching back to text mode
+ 86. Code to explicitly recognise the *BSD PCVT console driver
+ 85. Preliminary support for the S3 805i in interleaved mode
+ 85. Fix for single-bank SVGA bitblt code (Giovanni Novelli)
+ 84. Fix alu usage in mach32CopyArea() (Craig Groeschel)
+ 83. Fix dash line support in Mach32 server (Mike Bernson)
+
+XFree86 2.0Aa (13 February 1994)
+ 82. S3 "No_Bt485" and "No_Ti3020" options have been replaced by "Normal_DAC",
+ and a "20C505" option has been added
+ 81. ATI text restore fixes for Mach32 server (Ton van Rosmalen)
+ 80. Planemask fixes for Mach32GetImage() (Craig Groeschel)
+ 79. Prevent S3 Ti cursor from being turned on when the screen is blanked
+ 78. No longer define __386BSD__ for BSD/386, NetBSD, FreeBSD. Change
+ the FreeBSD define from -DFreeBSD to -D__FreeBSD__. Code outside
+ ddx/x386 now uses the value of BSD (from <sys/param.h>) and for
+ code below ddx/x386, __BSD__ is defined for all the x86 BSD OSs
+ 77. Rewrite of Mach32 memory detection code (Mark Weaver)
+ 76. Set clock-doubler cut-in to 67.5MHz for Bt485 and 90MHz for AT&T 20C505
+ 75. Add ClearRTS option (some mice seem to need it)
+ 74. Mach8 server now uses a 1024 line pitch (regardless of virtualX) for
+ cards with 1MB
+ 73. Support for bank switching with the VGA16 server. Staticgray and
+ Grayscale visuals added to the VGA16 server (Gertjan Akkerman)
+ 72. Slowed down image routines for DRAM based Mach8 cards (Hans Nasten)
+ 71. Improvements to solx86 in/out assembler code, and removal of the
+ broken ProworksMOption
+
+XFree86 2.0A (15 January 1994)
+ 70. Increase Bt485 clock-doubler cut-in point from 67.5MHz to 90MHz. This
+ should fix the "flashing pixel" problem many have reported
+ 69. Mach8 font cache performance updates
+ 68. Update assembler code and SuperProbe Makefile.std for the ProWorks
+ compile on Solaris x86
+ 67. Ti3020 probe code for SuperProbe (Robin Cutshaw)
+ 66. Fix Mach32 server to recognise PCI cards
+
+XFree86 2.0g (9 January 1994)
+ 65. Clock probe code for Mach32 server
+ 64. Support for TI3020 ramdac for S3 server (Robin Cutshaw)
+ 63. Fix server crash problem if reset occurs when VT switched away
+ 62. Make accel servers honour the -dpi flag
+ 61. Mach8 font cache updates
+ 60. Support for the ProWorks compiler on Solarix x86
+ 59. Add memory probe to SuperProbe (only for a couple of chipsets so far)
+ 58. Support for display widths of 640, 800 and 2048 with S3 server
+ 57. Generalise S3 HW cursor memory allocation -- fixes problems that showed
+ up with some virtualY/displaywidth combinations, and will work for
+ display widths < 1024
+
+XFree86 2.0f (27 December 1993)
+ 56. Fix mach32RecolorCursor() SIGSEGV when VT switched away
+ 55. Possible fix for cases where the S3 linear fb probe fails the first
+ time the server is started but succeeds on subsequent times
+ 54. Updates to Mach32 memory probe
+ 53. Fixes for ATI SVGA save/restore code (Ton van Rosmalen)
+ 52. Fix xman's handling of nroff bullets and bolding (Rich Murphey)
+ 51. Mach8 font cache updates (Hans Nasten)
+ 50. Mach32 HW cursor fixes (Mark Weaver)
+ 49. Change "makedepend" for systems with gcc to use "gcc -M" (based on
+ code from Hongjiu Lu). This is much slower than the other version,
+ and maybe should be disabled by default for !UseInstalled
+
+XFree86 2.0e (18 December 1993)
+ 48. SuperProbe updates (details in SuperProbe/ChangeLog)
+ 47. Imake updates for NetBSD
+ 46. Ramdac multiplexing for Mach32 cards with TLC34075 (and ATI68875?)
+ ramdacs (Mike Bernson)
+ 45. Imake changes to allow easy building of just the servers with a
+ cut-down source tree
+ 44. Fix ClearDTR -- now it clears *only* the DTR line
+
+XFree86 2.0d (11 December 1993)
+ 43. Xconfig keyboard option: VTSysReq to enable SVR4-style VT switching
+ sequence on Linux and *BSD+syscons
+ 42. Solaris 2.x x86 support (David Holland, Doug Anson)
+ 41. Accelerated dline and dseg for Mach32 (Mike Bernson)
+ 40. Accelerated non-cache text code for Mach8 (Hans Nasten)
+ 39. VirtualY limit removed for Mach8 (cache can be disabled)
+ 38. Dynamic allocation for font cache for Mach8 (Hans Nasten)
+ 37. New GetImage for Mach32 (Mike Bernson)
+ 36. Support for linear fb on *BSD with mmapable /dev/mem
+ 35. Preliminary support for 1152 width on Rev C 801 and Rev E 928, and
+ 1600 width on Rev E 928 in S3 server
+
+XFree86 2.0c (3 December 1993)
+ 34. Support for 8-bit/gun for Mach32 server (Craig Groeschel)
+ 33. New GetImage() for Mach8 and 8514
+ 32. Fix error message printed when no appropriate graphics sections are
+ present in Xconfig
+ 31. Add a "fb_debug" option to the S3 server
+ 30. MemBase Xconfig parameter added to allow the fb base address to be
+ specified. This is currently used only by some bdm2 drivers
+ 29. Support added to bdm2 for Visa board (untested)
+ 28. HGC-1280 now supported on both primary and secondary addresses
+ 27. Sigma L-View driver tested and works now
+ 26. Code from ATI to work around memory probing problems with some Mach32
+ chips (untested)
+ 25. Workaround for some 2MB DRAM ATI cards (eg, CLX). This allows the
+ VideoRam amount specified in Xconfig to override the detected value
+ 24. Support for NetBSD/FreeBSD shared libraries (John Brezak & ??)
+ 23. Add option "intel_gx" to handle linear fb on Intel GX/Pro (Mach32)
+ 22. Composite sync support for Mach8
+ 21. Allow linear fb for EISA S3 cards
+ 20. Fix s3RecolorCursor() SIGSEGV when VT switched away
+
+XFree86 2.0b (14 November 1993)
+ 19. Add virtualY <= 896 check to Mach8 server
+ 18. Restore settings for VGA aperture mapping if linear fb access fails for,
+ S3. Also restore those registers at exit
+ 17. Merge in MIT fix-26 (mainly xterm security patch)
+ 16. Fix S3 interlaced modes with VTotal > 1025.
+ 15. Hack for 1280x1024 on S3 801 with 110MHz clock
+ 14. Composite sync support for Mach32 (Todd Pfaff)
+
+XFree86 2.0a (9 November 1993)
+ 13. Speedup for aligned <=16 bit wide stipple ops for Mach8 and 8514
+ 12. Fix NULL dereference when ModeDB is empty (Bill Metzenthen)
+ 11. make mit/rgb consistent with the server's usage of it. showrgb can now
+ read rgb.txt directly, and [sng]dbm is no longer required
+ 10. Attempt to clean up strerror() vs sys_errlist[] usage outside ddx/x386
+ 9. Disable saving the Tek screen to a file in xterm -- a quick hack to
+ get around another security problem. An official X Consortium fix
+ should be available soon
+ 8. Fix vgaFasm.h so it works for gcc2 with '-traditional'
+ 7. Fix clock probing problem in pvga1 driver
+ 6. Fix typo in xf86_OSlib.h
+ 5. Fix ClockProg informational message
+ 4. Truncate clock values to MHz resolution when checking against the limit
+ 3. Fix bug in LinkKit Imakefile
+ 2. Fix malloc problem in the PEX font reader
+ 1. Some documentation fixes
+
+XFree86 2.0 (24 October 1993)
+247. Documentation finalised
+246. Fix for VT switching problem with Mach32 server
+
+XFree86 1.9Za (23 October 1993)
+245. Documentation updates
+244. Fix bug in backing pixmap used for VT switching with the S3 server
+243. Fix typo which prevented nomemaccess being turned of when a localbus
+ S3 card is used without linear fb mapping
+
+XFree86 1.9Z (18 October 1993)
+242. Code freeze for 2.0. Docs still not finished
+241. Disable linear fb mapping for BSD/386 since it doesn't appear to work
+240. Fix for dline bug in Mach8 and 8514 servers
+239. Updates to ati SVGA driver
+238. SCO doc updates
+237. Allow "nolinear" Option for Mach32 server
+
+XFree86 1.9Fe (17 October 1993)
+236. Fix S3 cursor problem when panning
+235. Mach32 HW cursor fixes
+234. Include Accel cards db
+233. Fix video mmap problem with *BSD
+
+XFree86 1.9Fd (17 October 1993)
+232. Add undocumented "showcache" Option for the S3 server
+231. Fix ALLOCATE_LOCAL/DEALLOCATE_LOCAL problem in S3 server
+230. Fix multi-screen I/O permission bug on SYSV
+229. SVR3 version of IOPL kernel patch (required for ISC 2.0.2)
+228. Get xload's compiled-in kernel name from <paths.h> for BSD
+227. Fix some compilation-related problems
+226. Sigma Lview driver doesn't work, so removed references to it
+225. DAC_MASK save/restore for 8514 server
+
+XFree86 1.9Fc (16 October 1993)
+224. Stipple and colour mapping fixes for vga16
+223. Fix for Mach8 VT switching problem
+222. Include README.Bsdi
+221. Fix SEGV in s3WarpCursor when VT not active
+220. Don't use kbd_mode for BSDI
+
+XFree86 1.9Fb (13 October 1993)
+219. Mach32 HW cursor colouring fixes (still not quite right)
+218. Change Mach8 clock probing to measure the divided-by-4 values only
+217. Correct fix for problems when some cards are in mono address mode
+216. Fix sync polarity problem with S3 server
+215. Update kbd_mode for syscons
+214. Add "memaccess" option (for S3) so that mem access can be forced on
+ for localbus cards when the linear framebuffer can't be mapped
+
+XFree86 1.9Fa (9 October 1993)
+213. 1-pixel segments fix for Mach8
+212. Trap virtual screen sizes which are too large for Mach32
+211. Turn off Mach32 HW cursor if insufficient videoram
+210. Some documentation updates
+209. Move clock limit definitions so that they can be changed when using
+ the LinkKit
+208. SuperProbe updates
+207. Fix mis-detection of ATI cards by the compaq driver
+206. Fix hard-coded path in xdpr script
+205. Print max clock before resolving modes
+204. Fix CRTC setting procedure for Mach32
+
+XFree86 1.9F (4 October 1993)
+203. Limit clock to 80MHz for Mach8 and Mach32
+202. Mach32 HW cursor fixes and mach32im cleanup
+201. Cleanup startup messages in Mach8 and Mach32 servers
+200. Disable xterm logging by default, and provide a safer(?) method of
+ opening the log file
+
+XFree86 1.9Ed (2 October 1993)
+199. Support for Cirrus 62x5 chips (Prof. Hank Dietz)
+198. Clean up handling of 'volatile', etc for 'gcc -traditional'
+197. Merge Mach8 font cache fix into Mach32
+196. Default to probe for 4 clocks on pvga1 cards
+195. Remove implicit assumption that certain mouse protocols are only used
+ by serial devices
+194. Updates/cleanups for bdm2 code
+193. Include SVR3 mmap and SCO dmmap drivers (in x386/etc)
+192. Change location of console.h to machine/ for FreeBSD
+191. Fix setting of AdmDir for *BSD
+190. Update GnuMalloc option. Now it enables use of GNU malloc for clients
+ as well as the servers
+189. Patches for Amoeba
+188. Fix for OAK crash with SVGA server
+187. Fix for ATI SVGA restore problem
+186. HW cursor for Mach32 (Mike Bernson)
+185. Option checking in other accel servers
+
+XFree86 1.9Ec (1 October 1993)
+184. Option checking in S3 server
+183. Fix default colour visual handling for accel servers
+182. Add checking of clock limits
+181. Clean up s3Init()
+180. Fix to allow SVR3 shared libs to build when using gas
+
+XFree86 1.9Eb (29 September 1993)
+179. Updates to syscons support (requires lastest console.h -- which is now
+ included in ddx/x386/etc)
+178. Fix for colourmap restoration problem with 8514/A cards
+177. Updates to Bt485 code
+
+XFree86 1.9Ea (28 September 1993)
+176. Man page updates
+175. Modify "number9gxe" option to use the Bt485's clock doubling for clocks
+ higher than 67.5Mhz
+174. Alternate ICD clock selection code. Enable it with
+ 'Clocks "icd2061a_slow"'
+173. site.def cleanup
+172. Fix Bt485 Cursor support
+171. Update syscons support
+170. Fix for S3 font cache server crash problem
+169. Fix for S3 xqueue problems when operating in linear mode
+168. Fix for S3 928 localbus problem
+167. Fix SuperProbe's graphics co-processor detection, and add code to detect
+ Bt485 on S3 cards.
+166. Fix text problems in Mach8 and 8514 servers
+165. Image read/write fix for Mach32
+
+XFree86 1.9E (23 September 1993)
+164. Support for the syscons driver on *BSD (S|ren Schmidt)
+163. Get/PutImage speedups for S3
+162. Accelerated image text for non-cached fonts (S3)
+161. Image read/write speedups for Mach32
+
+XFree86 1.9Dc (22 September 1993)
+160. Hooks added for HW cursor support on SVGA cards
+159. Support for ISC 4.0
+158. Accel text functions for non-cached fonts (S3 server)
+157. Fix problems with vga sequencer not being turned off in the right places
+156. Support for dmmap driver for SCO
+155. Oak driver (from Steve Goldman)
+154. Updates for Minix
+
+XFree86 1.9Db (21 September 1993)
+153. Accelerated WD90C31 support (Mike Tierney)
+152. Updates to ImageStipple code for Mach8 and 8514
+151. Fix for memory leak in mi backing store (Amancio Hasty)
+150. Accelerated Cirrus support (Simon Cooper and Bill Reynolds)
+149. Accelerated dline for Mach8 and 8514 (from Tiago Gons)
+148. Fixes for localbus 928
+147. Modify server to use rgb.txt directly and create an internal hash table
+ (from Thomas Roell)
+146. SuperProbe updates
+145. Fix cursor recolour problems in S3 server
+144. Use uname/gethostbyname for cases where SIOCGIFCONF fails
+
+XFree86 1.9Da (18 September 1993)
+143. ImageStipple speedup for Mach8 and 8514 (from Hans Nasten)
+142. Reorganise man page installation details for *BSD
+141. Fix various minor bugs
+
+XFree86 1.9D (15 September 1993)
+140. Use non-MAP_FIXED for mmap on Linux -- requires latest kernel
+139. dseg for S3
+
+XFree86 1.9Cf (14 September 1993)
+138. line updates for S3 (including dline)
+137. Support for Thomas Wolfram's mmap driver for SVR3
+136. Config changes to support NetBSD and FreeBSD
+135. Correct fix for SIOCGIFCONF on *BSD (from Mark Davies)
+134. Use Jerry Whelan's BSDselect() for SVR4 in libXt and libXbsd
+133. CopyPlane() for Mach32 server
+132. Include Berkeley str{,n}casecmp() in libXbsd
+131. Sigma LView driver for bdm2 (untested)
+130. OsMouse support for SCO (uses the SCO event driver)
+
+XFree86 1.9Ce (9 September 1993)
+129. Improve reliablilty of mmio code (thanks Thomas)
+128. Fix xdm-related server crash on Linux
+127. Support for 4MB aperture with EISA Mach32 cards
+126. CopyPlane() for 8514 server
+125. Fix "xfig" problem in accel servers
+124. Fix GetImage and PolyText in accel servers
+123. Fix problem with VT-switching and server reset
+122. Fix some more cfb.banked bugs
+
+XFree86 1.9Cd (5 September 1993)
+121. Fast image read/write for 8514 server
+120. Mmio support for 928 in S3 server
+119. Fixes for BT ramdac HW cursor (S3) (still doesn't work)
+118. CopyPlane() fixes for S3
+117. Speedup for PolyPoint() in Mach8 (and others)
+116. Fix for lines in accel servers -- now match cfb lines.
+115. CopyPlane()
+
+XFree86 1.9Cc (2 September 1993)
+114. Fix auto-repeat trapping of lock keys
+113. Support BT485 ramdac's HW cursor (S3 server) (doesn't work yet)
+112. Use mmap for BIOS access on SVR4
+111. Only protect page 0 for SVR4 when the -protect0 flag is given. It makes
+ cores less useful
+110. bdm2 (banked dumb mono) fb/driver (from Pascal Haible)
+109. Fast image fill for Mach8 (from Hans Nasten)
+108. Update shared-lib version numbers for Linux
+107. Split bsdi os-support from 386BSD -- little code was common
+106. Modify s3Init() code to use vgaHWInit()
+
+XFree86 1.9Cb (28 August 1993)
+105. Fast image read/write for Mach8 (from Hans Nasten)
+
+XFree86 1.9Ca (28 August 1993)
+104. Default to NoMemAccess for S3 localbus cards on OSs that don't
+ support linear videomem mapping
+103. Add QueryBestSize() for S3
+102. Protect page 0 for SVR4 (to help find NULL pointer dereferences)
+101. Fix ChordMiddle
+100. Fix some compilation problems with vga16
+ 99. vga16 fix for OpaqueMove bug
+ 98. Work around GNU make's "different" default dependency handling.
+ Dependencies should now work reliably with GNU make.
+ 97. Fast CopyPlane() for S3 server
+ 96. Fix I/O port handling to deal with multiple screens
+ 95. Mach8 updates
+
+XFree86 1.9C (25 August 1993)
+ 94. Updated video mem <-> main mem copy code to get better performance on
+ localbus cards
+ 93. Alternate fix for xqueue with S3 (previous fix degraded performance too
+ much)
+
+XFree86 1.9Be (25 August 1993)
+ 92. SIOCGIFCONF fix for ISC in xdm
+ 91. Mach support for mapping arbitrary video memory
+ 90. Fix for performance problems in S3 server
+
+XFree86 1.9Bd (24 August 1993)
+ 89. Updated version of Xconfig/probe info
+ 88. Update libXt jump entries for Shm on Linux
+ 87. Another S3 cursor update
+ 86. Use mmap() for mapping framebuffer on SVR4
+ 85. Localbus linear mapping for S3 (tested only on Linux)
+
+XFree86 1.9Bc (23 August 1993)
+ 84. SuperProbe update
+ 83. Improve picture stability when using high clocks (S3)
+ 82. Get memory detection right for S3 911
+ 81. Change localbus wait states for S3
+ 80. Go back to the MAP_FIXED mmap for Linux, added xf86UnMapVidMem()
+ 79. S3 cache updates and cursor changes
+
+XFree86 1.9Bb (21 August 1993)
+ 78. Fix S3 server crash if it exits when its VT isn't active
+ 77. Indicate where information in server startup messages comes from (ie
+ whether from Xconfig or by probing, etc)
+ 76. Fix ATI/Mach probing in SuperProbe
+ 75. Fix S3 cursor "shadowing" in interlaced modes
+ 74. Fix problems with the S3 server when using xqueue
+ 73. 16-colour generic VGA server (from Gertjan Akkerman)
+
+XFree86 1.9Ba (18 August 1993)
+ 72. Support for a Hitachi Puma Plus digitising tablet's 4-button puck
+ (from Randy Terbush)
+ 71. Mouse "ChordMiddle" option. This is for a 3-button mouse which
+ generates left+right events when the middle button is used. This is
+ for Microsoft protocol only (from Ted Goldblatt)
+ 70. Reorganise the way SpeedUp options are handled so that the speedup code
+ is only linked into the server when the appropriate chipset driver is
+ included.
+ 69. Fix inb/inw inlines for gcc without gas
+ 68. Code to use memory to the right of the screen for caching (S3)
+ 67. Various compilation-related fixes
+
+XFree86 1.9B (16 August 1993)
+ 66. Fix memory leak on server reset
+
+XFree86 1.9Ai (16 August 1993)
+ 65. Fix LinkKit
+ 64. Cirrus driver was ignoring clocks when a VideoRam line is specified
+ 63. Fix VT switching for Mach8 and ibm8514 servers
+ 62. Fix server reset for S3 server
+ 61. Fix problems in mach32ImageFill for virtual width != 1024
+ 60. Text save/restore added to Mach32 server
+
+XFree86 1.9Ah (15 August 1993)
+ 59. Updates to SuperProbe so it can detect the latest S3 chip revisions
+ 58. VT switching support for the S3 server
+ 57. Fix for S3 image write problems with screen width 1024 & 2MB videoram
+
+XFree86 1.9Ag (14 August 1993)
+ 56. Another stipple fill fix in cfb.banked
+ 55. S3 clock select fixes -- allows clock probing to work
+ 54. Fix initialisation of miCacheFreeSlot
+
+XFree86 1.9Af (13 August 1993)
+ 53. Allow programmable clocks to be specified with 'Clocks "prog_clk_type"'
+ in Xconfig.
+ 52. Virtual size fixes for S3
+
+XFree86 1.9Ae (13 August 1993)
+ 51. Extended I/O and IOPL handling for BSDI.
+ 50. Set virtual size for S3 if not given.
+
+XFree86 1.9Ad (13 August 1993)
+ 49. Imake config updates
+ 48. Created libxf86_hw in common_hw, and moved clock probe code there.
+ 47. XF86_Mach8 and XF86_8514 compilable.
+
+XFree86 1.9Ac (12 August 1993)
+ 46. S3 updates (diff15)
+ 45. XF86_Mach32 compilable
+
+XFree86 1.9Ab (11 August 1993)
+ 44. XF86_S3 compilable and runnable on Linux
+ 43a Cirrus driver updates (including fix for line problem)
+ 43. Fix problem in Xlib compose-key code that caused auto-repeat problems
+ on some SVR4.
+ 42. Keep /dev/console open for pccons on 386BSD to work around keyboard
+ hanging problem (from Mark Weaver)
+ 41. Fix for zero width horiz, vert lines with rop other than GXcopy, GXxor
+ (from Mark Weaver)
+
+XFree86 1.9Aa (6 August 1993)
+ 40. Include accel dirs (not compilable yet)
+
+XFree86 1.9A (4 August 1993)
+ 39. Fix authorisation for LOCALCONN connections on SYSV.
+ 38. OS-lib fixes
+
+XFree86 1.9e (1 August 1993)
+ 37. Make the ET4000 Option "force_bits" standard behaviour
+ 36. Fix problem of renderer config not being handled properly in the LinkKit
+ 35. Update screen configuration handling to better suit multiple servers.
+
+XFree86 1.9d (29 July 1993)
+ 34. Mach OS-lib fixes
+
+XFree86 1.9c (28 July 1993)
+ 33. Lots of SCO patches (including fixing the bogus window problem, xterm,
+ font server, PEX)
+ 32. SuperProbe updates (includes identification of AT&T RAMDACs and
+ detection of 8514/A and ATI Mach-xx chipsets)
+ 31. Fix for bug in cfbgetsp.c
+ 30. Include pixmap cache support in mi, mfb, cfb.
+ 29. SVR3/ISC updates for gcc 2.4.5
+ 28. Moved OS-specific parts of x386Io.c to the OS-lib
+ 27. OS-lib fixes.
+ 26. Converted the experimental ET4000 RCCONF code to an Option flag:
+ "fast_dram"
+ 25. Fix SIOCGIFCONF related problems in xdm, chooser and server/os/access.c
+ on SVR4 and 386BSD (thanks to Ian Donaldson and Peter Wemm).
+ 24. Support for easily adding multiple servers to server/Imakefile and
+ the LinkKit
+
+XFree86 1.9b (13 July 1993)
+ 23. Fix for interlaced support in the Cirrus driver
+ 22. OS-library added to separate out OS-specifics under ddx/x386
+ 21. Fix initialisation of supported pixmap formats
+ 20. Fix for authorisation on streams connections for SVR3
+ 19. Fix other line bugs (fLineH.s, suLine.s, suVHLine.s)
+ 18. Really make the horizontal panning symmetric
+ 17. Fix 2MB support on Cirrus 5426
+ 16. Fix line bug in non-speedup code (fLineBres.s)
+
+XFree86 1.9a (3 July 1993)
+ 15. Added support for BSDI's BSD/386 (from Hans Nasten)
+ 14. SuperProbe updates for C&T chipsets
+ 13. Make horizontal panning symmetric
+ 12. Allow Cirrus driver to address 2MB on the 5426 cards (not tested)
+ 11. Add ChipRounding to the vga ChipRec so that chip-specific rounding of
+ virtualX can be handled properly
+ 10. OSF/1 patches (Marc Evans)
+ 9. Fix for xload problem on Linux
+ 8. Fix for ATI text-mode font restore problem
+ 7. Experimental code to set the RCCONF register on ET4000 cards (this is
+ only used if Et4000SetRCConf is set to YES in site.def)
+ 6. Allow "black" and "white" colours to be specified in Xconfig for the mono
+ vga server
+ 5. Fix Xconfig visual spec check for mono servers
+ 4. Fixed some long file names (in extensions/lib/PEXlib, fonts/bdf/misc)
+ 3. Fix xman bug introduced in 1.2Da
+ 2. Fix bank-switching bug in cfbfillsp.c
+ 1. Fix a couple problems that show up when using a XFree86 patched source
+ tree on non-i386 systems
+
+XFree86 1.3 (5 June 1993)
+98. Updates to ncr driver
+97. NCR imake config changes
+96. Docs updated for gzip extension change ".z" -> ".gz"
+95. Experimental "force_bits" option flag for ET4000
+
+XFree86 1.2Da (2 June 1993)
+94. Modify xman to use groff instead of nroff for Linux
+93. Modify xload to use /proc/loadavg for Linux
+92. Change ownership of /dev/console and /dev/tty0 for Linux
+91. Added xmodmap.std to the etc dir which lists the default key map in a form
+ that can be read by xmodmap(1)
+90. Various small SVR3 adjustments, and new README.SVR3
+89. Add a README for the LinkKit
+88. Support for banked mono in ET3000 driver (thanks to Joerg Wunsch)
+87. ET3000 probe changes
+86. README.Linux updates
+
+XFree86 1.2D (26 May 1993)
+85. Merge in MIT fix-25
+84. OSF/1 support is incomplete -- so remove references to it in the docs
+83. Add -keeptty flag to prevent server from detaching its controlling tty
+ (useful when debugging)
+82. Include support for 77C22E in ncr driver
+81. Set bank 0 for save/restore in trident driver [removed]
+80. Workaround for mouse loss when VT switching on SCO
+79. Compile-time support for SCO 3.2.4
+78. Don't include PEX in mono server (even when BuildPex is set) because it
+ only works for 8-bit PseudoColour
+77. Mach support for SuperProbe
+76. Various SVR3 shared lib fixes including fixes for AT&T SVR3.2, XDM auth
+ support and fixes for initialisation problems that showed up with Motif.
+75. Ignore SIGHUP in xterm for ISC 2.2.1, 3.0
+74. rgb/Imakefile fix
+73. Imake.tmpl updates for ISC
+
+XFree86 1.2Cb (19 May 1993)
+72. Code to slow down DAC access
+71. Possible fix for font restore bug on Linux and 386BSD (works for some
+ people, but not everyone)
+70. Merge in MIT fix-24
+69. Xosdefs.h mod for Mach
+68. Eliminate various compiler warnings with PEX
+67. Modify lndir to ignore directories called "CVS"
+66. Fix overscan restore problem when mode switching
+65. Fix a Cirrus-specific font/text restore problem
+
+XFree86 1.2Ca (16 May 1993)
+64. Fix for lndir to work with Linux (Gnu ls)
+63. Documentation updates
+62. Allow PEX to be turned on/off at link-time with the LinkKit
+61. Add "hibit_high" and "hibit_low" Option flags to handle some ET4000
+ cards when the server is started from a high-res text mode
+60. Fix screen corruption when mode-resolving fails (problem was introduced
+ in 1.2Bb)
+59. Fix to pvga1 driver for 90C11
+58. kbd_mode modified to be a no-op for codrv
+57. Imake.tmpl updates for SCO and OSF/1
+56. Remove need for <sys/ioctl_pc.h> with LinkKit on 386BSD
+
+XFree86 1.2C (8 May 1993)
+55. Modify Cirrus driver to set the reported clocks to the preset values
+ rather than probing them. Probing can be forced with the "Probe_Clocks"
+ Option flag.
+
+XFree86 1.2Bb (6 May 1993)
+54. Compatibility support for codrv 0.1.1 (run-time only)
+53. Merge in OSF/1 support (from Marc Evans)
+52. Merge in SCO support (from David McCullough)
+
+XFree86 1.2Ba (4 May 1993)
+51. SuperProbe updates (can now be compiled with a K&R compiler)
+50. Compaq driver (from Hans Oey)
+49. Merge codrv and pccons support so that a single server can support
+ both
+48. Cirrus driver for CLGD542x cards (no accelerated support) (from Bill
+ Reynolds)
+47. Allow inline'd macros to be disabled for debugging purposes (by compiling
+ the video drivers with -DNO_INLINE)
+46. Print OS version in startup message
+
+XFree86 1.2B (19 April 1993)
+45. ET4000 text clock restoration modified -- maybe it will fix the problems
+ when restoring to a high res text mode
+44. Sample SVGA driver stubs and documentation added
+43. Xconfig option to specify VGA BIOS base address (not all are at 0xC0000)
+42. Major rewrite of tvga driver. Now supports 8800CS, 8900B, 8900C, 8900CL,
+ 9000 in all modes.
+41. Xconfig option to clear DTR after opening MouseSystems mouse (only for
+ SYSV, Linux, 386BSD)
+40. Change server names. X386 -> XF86_SVGA, X386mono -> XF86_Mono.
+
+XFree86 1.2Aa (17 April 1993)
+39. SuperProbe will now find vga BIOS at addresses other than 0xC0000
+38. Support for building Linux shared libs (DLL version)
+37. Remove case-sensitivity of the Chipset option.
+36. Save and restore registers affected by clock probing
+35. Some more Xconfig validity checks
+34. Change 'Vendor' keyword in Xconfig to 'Option'
+33. Fix to make use of the RGBPath specified in Xconfig (this was pointed out
+ by Greg Hartman back in Sept)
+32. Use XWINHOME to specify ProjectRoot at run-time
+31. PEX patches for Linux
+30. libX11 shared lib problem fixed (for SVR4)
+
+XFree86 1.2A (3 April 1993)
+29. More pvga1/wd driver tuning, added rudimentary support for 90c20
+28. Improve overscan handling
+27. modeDB.txt updates
+
+XFree86 1.2e (27 March 1993)
+26. Minix/Amoeba updates
+25. New et3000 probe (to prevent tvga8900CL being falsly detected as et3000)
+24. More interlace tuning for pvga1 and tvga8900 drivers
+23. SuperProbe
+22. XDMCP fixes for Linux (and others)
+
+XFree86 1.2d (24 March 1993)
+21. Added support for Minix-386 and Amoeba (from Kees Verstoep)
+
+XFree86 1.2c (20 March 1993)
+20. Merged in MIT fix-23
+19. Support for 9th clock on WD90Cxx chips
+18. NCR 77C22 driver (from Stuart Anderson)
+17. Allow multiple Clocks lines in Xconfig
+16. Changes to external clock program code to handle VT switching better
+15. ISC 2.0.2 support (from Aki Atoji)
+14. Include driver source instead of objects in LinkKit
+
+XFree86 1.2b (1 March 1993)
+13. Improved ISC support for xman
+12. Improved handling of overscan colour
+11. Make the server's -pn option the default (compile time configurable)
+10. Hga2 support for 386BSD and Mach
+9. pvga1 driver support for WD90C3x
+8. Portable assembler macros (from Greg Sharp)
+7. More flexible handling of Vendor strings in Xconfig
+6. Store clock resolutions to nearest 1kHz.
+5. Removed old SpeedUp version
+4. Changes in LinkKit to handle distributions built with PEX support
+
+XFree86 1.2a (20 February 1993)
+3. Xlib support for run-time selectable multiple LOCAL connection types
+ for SVR3, SVR4
+2. Fix mapping problem when using codrv and a non-US keyboard mapping
+1. Fix for TVGA interlaced modes
+
+
+XFree86 1.2 (8 February 1993)
+74. README updates
+73. ATI driver updates
+72. Banked mono doesn't work on ET3000 -- so turned off for that driver
+71. Merged in MIT fix-22
+70. Changes so that XFree86 patched source will build on other platforms.
+
+XFree86 1.1F (1 February 1993)
+69. Add check for presence of "Modes" line in Xconfig
+68. Add assembler code for byte-order swapping in mfb
+67. More svr3 shlib "tuning"
+
+XFree86 1.1E (26 January 1993)
+66. Change to pvga1 driver to get correct clock ordering for 90C30
+65. Fix linux problem building liboldX
+64. server locking to prevent clobbering of local connection pipes
+63. xhost fix for LOCALCONN
+62. Add missing svr3 shlib patches
+
+XFree86 1.1D (24 January 1993)
+61. Removed SVR3 shlib stubs from clients
+
+XFree86 1.1Ce (23 January 1993)
+60. SVR3 shared lib support (from Thomas Wolfram)
+59. Added Hercules driver (from Davor Matic)
+58. Re-map scancodes for Codrv so that the keycodes the server sees are the
+ same on all platforms
+57. Modify NumPad handling so that Shift works properly.
+
+XFree86 1.1Cd (13 January 1993)
+56. Commented out force VT disabling -- causes problems with Esix 4.0.3A
+55. Support for tvga9000 (from Gertjan Akkerman)
+54. Ignore FontPath in Xconfig when a FontPath is provided with the -fp option
+53. Support for new Linux VTs
+52. Turn off Alt-Sysreq-F (forced VT switch) by default for SYSV. Added an
+ Xconfig option to prevent this disabling (AllowForceVT)
+51. X386keybd man page added
+50. mfb.banked fixes
+
+XFree86 1.1Cc (3 January 1993)
+49. tvga driver updates for banked mono
+48. Fixes to cfbblt, mfbblt for single-banked drivers
+
+XFree86 1.1Cb (1 January 1993)
+47. Added -verbose (default) and -quiet flags, and print out more information
+ in verbose mode
+46. Improved banking for mfb.banked
+
+XFree86 1.1Ca (30 December 1992)
+45. cmfb code (from Davor Matic), and an experimental mfb.banked
+44. Flush mouse input after opening
+43. Fix problem starting X from within an X session
+
+XFree86 1.1C (23 December 1992)
+42. Added -probeonly option which causes the server to exit after the
+ device probe stage.
+41. Merged in MIT fix-21
+40. Support for an external clock setting program
+39. Patches for Destiny (SVR4.2)
+
+XFree86 1.1Ba (17 December 1992)
+38. Merged in MIT fix-20
+37. Various improved error messages
+36. Improve accuracy of clock probing code -- add delay so VCO can
+ stabilise before starting the measurement
+35. Store dot-clocks to .1MHz accuracy
+34. Make the server's -dpi option work
+33. Extend fontpath validation to the compiled-in default fontpath
+32. Increase server priority while probing for clocks
+31. Fixed KDSETRAD bug introduced in 1.1a (affected DELL)
+30. Bell support for pccons driver on 386BSD
+
+XFree86 1.1B (21 November 1992)
+29. Hack for ISC local connection on SVR4 with ACP (requires the ISC
+ client binary to be edited)
+28. Added code to change IOPL on SYSV for extended I/O (including patch
+ scripts for the SVR4 kernel)
+27. Merged in MIT fix-18 and fix-19
+26. Support for PS/2 mouse
+
+XFree86 1.1A (16 November 1992)
+25. Fix problems compiling with a non-ansi compiler.
+
+XFree86 1.1c (8 November 1992)
+24. Xconfig options to set default mapping of some special keys
+23. Code to validate the fontpath given in Xconfig
+22. Patches for Logitech Trackman/Mouseman (from Christian Ziemann)
+21. Updates for version 0.1.1 of Holger's co driver
+20. Fix for et3000 text mode restoration (from Holger Veit)
+19. Fix NumLock support -- use two sets of keycodes for num keypad
+18. Add Compose / Multi-key support to Xlib (from MIT contrib)
+17. Don't reset state of lock keys when starting the server
+16. Fix code for setting visual type from Xconfig
+
+XFree86 1.1b (21 October 1992)
+15. Xload support for Linux
+14. Use Xconfig.cpp to generate the sample Xconfig with paths consistent with
+ the configuration.
+13. Allow multiple "FontPath" lines in Xconfig which are concatenated to build
+ the FontPath.
+12. Blank and clear the screen during server startup
+11. Fix tegblt code for mono server (instead of the previous workaround)
+10. Fix non-32bit tiles and stipples for mono server with 8-bit scanlines
+9. Fix circle/ellipse drawing for mono server
+8. Use 8-bit bitmap scanlines for mono server (can now remove pixmap hack)
+7. Add check in server to see if euid==0. If not, exit with a warning.
+
+XFree86 1.1a (11 October 1992)
+6. Add a VTInit option to Xconfig to run a program on the VT during
+ screen initialisation.
+5. Fix security holes in reading Xconfig files, and the undocumented
+ -mono and -colour options.
+4. Use KDMKTONE for bell for systems that support it
+3. Allow 4 clocks for generic driver
+2. Mods to allow compile time selection of 128k display mapping for mono
+ (this is experimental and may be removed)
+1. Holger's 386BSD co driver support (compile-time selectable)
+
+
+XFree86 1.1 (1 October 1992)
+70. Public release
+69. Set mailbox for 386bsd in Xaw
+
+XFree86 1.0Zb (30 September 1992)
+68. Mods to startx so that an absolute path is not required for a server
+67. Make the right-hand <ALt> key behave like Alt_R
+66. Updates to X386.man
+65. Add -mono and -colour (undocumented) options to server
+64. Look for Xconfig file in /etc before /usr/X386/lib/X11
+63. Print out Trident version in probe routine and add README.trident
+
+XFree86 1.0Za (27 September 1992)
+62. cfb.banked changes for Mach's BSD cpp.
+61. Add mkwhatis script for 386BSD
+60. Fix problems with xgc/lex.l
+59. Modify default keymap so Alt_L will work like both Meta_L and Alt_L.
+58. xload fixes for 386BSD
+57. Change config/x386config.sh for dumb BSD sh.
+
+XFree86 1.0Z (24 September 1992)
+56. Beta release (final for 1.1)
+55. Add ISC22, ISC30 defines
+
+XFree86 1.0Yb (21 September 1992)
+54. Included Thomas Eberhardt's updates to the compressed font code.
+53. Put Alan Hourihane's generic save/restore code into vgaHW.c
+52. Correction to xmh man page
+51. Support use of libdbm.a for ISC 3.0
+
+XFree86 1.0Ya (17 September 1992)
+50. Merge in Linux support (from Orest Zborowski)
+
+XFree86 1.0Y (14 September 1992)
+49. Beta release (second for 1.1)
+48. Removed FAS support on SVR4
+47. Changes to font and text save/restore
+
+XFree86 1.0Xc (12 September 1992)
+46. Fix xman scroll bug
+45. Update to ati driver to save more planes
+44. Single/double bank selection for drivers
+
+XFree86 1.0Xb (9 September 1992)
+43. Link Kit updates
+
+XFree86 1.0Xa (8 September 1992)
+42. Fix some Xconfig related problems
+41. Trident driver (256 colour and mono)
+40. Mono drivers for et3000, pvga1, gvga (untested)
+
+XFree86 1.0X (4 September 1992)
+39. Beta release
+38. Minor updates
+
+XFree86 1.0m (2 September 1992)
+37. Change name to XFree86
+36. Added link kit
+
+X386 1.2E 1.0l (30 August 1992)
+35. Added (experimental) ATI driver
+34. Changed configuration so that mono and colour servers can be built
+ at the same time.
+X386 1.2E 1.0k (30 August 1992)
+33. Directory re-organisation
+
+X386 1.2E 1.0j (29 August 1992)
+32. Fix problem of server crashing while resetting
+
+X386 1.2E 1.0i (28 August 1992)
+31. Portability changes to vgaFasm.h (for cc and gcc-1.??)
+30. Added a -xconfig flag to specifiy the Xconfig file from the command line.
+29. Fixed problem with xdmauth accessing memory between 640k and 1M.
+28. Round down the specified virtual width to the nearest required multiple.
+27. Fix some bugs in the Xconfig parser.
+26. Added 'vga2' keyword for Xconfig so one file can be used for both the
+ colour and mono servers.
+25. README's updated
+24. Minor speedup fix
+23. More server configuration changes
+
+X386 1.2E 1.0h (26 August 1992)
+22. cfb.banked updated for fix-17
+21. New SpeedUp code (works for any* virtual width)
+20. Monochrome VGA server
+19. Changes for compile-time selection of supported chipsets, and font
+ renderers
+18. Updated X386.man, README.Mach
+17. Fix mouse map bug for logitech (and microsoft?).
+16. Merge in changes for Mach386 (from Robert Baron, Joel Jacobson)
+15. Merge in changes for 386BSD (from Rich Murphey, Amancio Hasty)
+
+X386 1.2E 1.0g (25 August 1992)
+14. Merged in MIT fix-17
+
+X386 1.2E 1.0f (4 August 1992)
+13. SpeedUp flag for Rectangle Stipple fills
+
+X386 1.2E 1.0e (4 August 1992)
+12. Extend the trapping of unexpected fatal signals beyond just SIGSEGV.
+ The NoTrapSegV option has been changed to NoTrapSignals.
+
+X386 1.2E 1.0d (3 August 1992)
+11. Run mkfontdir in install directory rather than copying fonts.dir from
+ the build directory.
+10. Merged in MIT fix-16
+
+X386 1.2E 1.0c (1 August 1992)
+9. Run 'mcs -d' on SVR4 shared libraries
+8. Merged in official Type1 font patch
+7. Merged in MIT fix-15
+6. Fixed malloc/free problems in lib/X/XcmsLRGB.c, clients/xdm/greet.c
+5. Merged in MIT fix-14
+
+X386 1.2E 1.0b (27 July 1992)
+4. Updated version of fFill.s
+3. Bug fixes (for stipple) from Jim (require GCC at the moment)
+
+X386 1.2E 1.0a (22 July 1992)
+2. Merged in MIT fix-13
+1. Fix problem with divide by zero when bell pitch was set to zero.
+
+
+X386 1.2E 1.0 (16 July 1992)
+97. First general release
+96. Define repz to be repe for gas.
+95. Update XdmConf.svr4 to read /etc/default/login to set ulimit, etc.
+
+X386 1.2E 0.2c (15 July 1992)
+94. Allow easy selection of ansi level when building non-core clients.
+93. Install and use sessreg (for xdm)
+92. .align changes for gas
+91. README and X386.man updates
+
+X386 1.2E 0.2b (11 July 1992)
+90. Mods to SpeedUp for gas (jcxz changes).
+89. Minor change to xdm/auth.c for ISC3.0
+88. Removed SVR4 Vendor defines.
+
+X386 1.2E 0.2a (8 July 1992)
+87. Added some missing cld's to gBitBlt.s
+86. Some portability changes to fFill.s
+85. VT release problem when using FAS/SVR4 really fixed this time.
+84. Moved libinetemul.a to lib/InetEmul; library now called libXinetem.a, and
+ used in a similar way as libXbsd.a. Changes to top level Imakefile have
+ been removed.
+83. Updates to README (building under ISC2.2, compiling clients)
+82. Include libXbsd.a in ExtraLibraries for SVR4/SYSV
+
+X386 1.2E 0.2 (3 July 1992)
+81. Second beta version
+80. et debug option removed
+
+X386 1.2E 0.1i (2 July 1992)
+79. Fixed VT release problem when using FAS/SVR4.
+78. Added warning about using xdmauth.
+77. Updated XdmConf.svr4 to handle different auth types
+76. Reorganisation of some compiler and assembler related options in x386.cf
+
+X386 1.2E 0.1h (27 June 1992)
+75. More portability changes to assembler code.
+74. Updates to modeDB, XdmConf.svr4
+
+X386 1.2E 0.1g (25 June 1992)
+73. Assembler portability changes from Jon Block.
+72. Change startup message from 'X Windows System' to 'X Window System'
+
+X386 1.2E 0.1f (20 June 1992)
+71. Fixed line problem when compiling with SVR4 'cc'.
+70. Changes to make source compile with Esix 3.2D, ISC 3.0 (without TCPCONN)
+
+X386 1.2E 0.1e (17 June 1992)
+69. Removed Glenn's wrapper comments from cfb.banked files.
+68. Added a debug flag to check operation of hiclock selection, and hopefully
+ fixed the problem with that.
+67. Fixed PIC flag problem in sv4Lib.rules
+
+X386 1.2E 0.1d (13 June 1992)
+66. Xconfig is installed as Xconfig.sample so as not to overwrite a locally
+ configured one.
+65. Use HasSdbm to determine use of -lsdbm for server and rgb.
+64. Made SpeedUp the default when appropriate, and added 'SpeedUp "none"' and
+ 'NoSpeedUp' options.
+63. Updates to README, X386.man, modeDB.txt.
+62. Added a shar file with sample configuration files for xdm.
+61. Another setpgrp() change in xdm.
+60. Added command line option to specify which VT the server runs on.
+59. Changed default pointer map to the correct 1:1 map.
+58. Fixed bug in merge of SPEEDUP_TEGBLT8 which caused problems when that
+ option was not selected.
+
+X386 1.2E 0.1c (7 June 1992)
+57. Remove some setpgrp() calls in xdm. This allows xdm to work with
+ xqueue on Microport, Dell, AT&T versions.
+56. Default for server to open SCO Xsight connection for SVR4. SVR4.0.4
+ supports this as part of its "Advanced Compatibility Package". The
+ code doesn't appear to cause problems with versions of SVR4 without this
+ (the feature just can't be used on them).
+
+X386 1.2E 0.1b (3 June 1992)
+55. Fixed bug in SPEEDUP_TEGBLT8 selection in vga.c
+54. Glenn's new cfbteblt8.c
+
+X386 1.2E 0.1a (30 May 1992)
+53. Fixed problem when switching VT away too quickly after switching back.
+52. Added Vendor defines for ISC SVR4 (ISC4), AT&T SVR4 (ATT4)
+
+X386 1.2E 0.1 (29 May 1992)
+51. First beta version
+
+X386 1.2E 0.0n (28 May 1992)
+50. Added README.X386-1.2E
+49. Introductory info added to modeDB.
+48. A few missed RCS Header lines.
+
+X386 1.2E 0.0m (26 May 1992)
+47. Added options to control building 75dpi, 100dpi, and large misc fonts.
+46. More updates to modeDB.
+45. Assembly changes for more pedantic 4.0.4 assembler.
+44. Moved site-specific defines from x386.cf to site.def
+43. Define usleep as the nap syscall for all SVR4 to avoid using libucb.a
+
+X386 1.2E 0.0l (23 May 1992)
+42. Added BuildType1 option
+41. Fixed ManDir and LibmanDir in site.def
+40. Added RCS Header lines to modified files
+
+X386 1.2E 0.0k (23 May 1992)
+39. Moved Glenn's and Jim's assembler routines into ddx/x386/enhanced
+38. Local connection added to X386.man
+37. Jim's update to cfbtileodd.c
+
+X386 1.2E 0.0j (21 May 1992)
+36. Updates to ModeDB.txt
+35. New fLineH.s from Jim
+34. New gLine.s from Glenn
+
+X386 1.2E 0.0i (19 May 1992)
+33. Fixed problem with setting mouse acceleration
+32. Prettied up startup message
+
+X386 1.2E 0.0h (16 May 1992)
+31. Removed SPEEDUP_TEGBLT8 from SPEEDUP_ALL -- it causes problems for some
+ font rendering (characters coming out as solid filled blocks).
+30. Added Thomas Eberhardt's compressed bitmap font patches
+
+X386 1.2E 0.0g (15 May 1992)
+29. #undef'd SO_DONTLINGER in os/connection.c for SVR4 -- it is not properly
+ defined for SVR4, and it removes the familiar startup error message.
+28. Changed SPEEDUP_VHLINE to SPEEDUP_LINE since it's not just for V, H lines
+27. Included Glenn's gLine.s
+26. Modified auto-detect HiClock code to use Thomas' method of making 16
+ clocks available with ET4000. HiClock option has been removed since
+ this change makes it obsolete. X386.man and Xconfig have been updated
+ accordingly.
+25. Fix problem switching after SIGHUP is sent while VT switched away.
+24. Take x386Resetting out of os/utils.c and put it in x386Init.c
+23. Turn on screen saver before copying screen to pixmap when switching away
+22. Fixed typo in vga.c related to SPEEDUP_TEGBLT8
+
+X386 1.2E 0.0f (14 May 1992)
+21. Removed special handling of SIGSEGV when server is exiting.
+20. Take care of server exiting and resetting when VT is switched away.
+19. Copy screen to dummy pixmap when switching away, and copy it back when
+ switching back. (The contents were of the dummy pixmap were previously
+ ignored.) Masking window is no longer used.
+
+X386 1.2E 0.0e (13 May 1992)
+18. Add missing argument in call of GlennsFillBoxSolid -- hopefully fixes
+ SIGSEGV problem.
+17. Added x386Version.h, CHANGELOG
+16. Added a couple of #undef's in cfbhrzvert.c
+15. Fold in public-patch-9 for cfb/cfbbresd.c into cfb.banked/cfbbresd.c
+14. casting for VGABASE in cfbbitblt.c
+13. #include fix in connection.c
+12. Disable building of FontServer in site.def
+
+X386 1.2E 0.0d (12 May 1992)
+11. Changes to gFillCopy.s, gVHLine.s to improve hseg100 performance.
+10. Change the way GCOps are initialised when SpeedUp is selected
+9. Add SpeedUp to cfbteblt8.c that assumes xdim=1024
+
+X386 1.2E 0.0c (10 May 1992)
+8. Allow SpeedUp Xconfig option to individually select various speedups
+
+X386 1.2E 0.0b (10 May 1992)
+7. Autodetect for HiClock option (not tested yet)
+6. Fix for cfbblt not setting read on dst for GC ops that require it
+5. Minor change in X386.man
+
+X386 1.2E 0.0a (09 May 1992)
+4. Reset screen saver timer for ForceScreenSaver(Reset)
+3. Reset screen saver when switching back
+2. Raise masking window when switching back so all windows get expose events
+1. Use dummy buffer for screen writes when VT is switched away
+
+X386 1.2E 0.0 (07 May 1992)
diff --git a/hw/xfree86/doc/devel/DebuggingHints b/hw/xfree86/doc/devel/DebuggingHints
new file mode 100644
index 000000000..300fe4813
--- /dev/null
+++ b/hw/xfree86/doc/devel/DebuggingHints
@@ -0,0 +1,192 @@
+
+ Xserver Debugging
+ =================
+
+This file is intended to collect helpful hints on Xserver debugging.
+I merely outline my experiences here. Somebody else might have better
+methods on doing it. This person is therefore invited to share this
+experience with the rest of the world by adding it here.
+
+Paul Flinders has made some patches to gdb to add support for loadable
+modules. This version of gdb is currently available as binary for
+Linux/x86 on Paul's web site:
+
+ www.dawa.demon.co.uk/xfree-gdb
+
+This web-site also contains the patches to gdb 4.18 so you may port it
+to other platforms.
+
+It loads the module symbols and supports all gdb features like
+breakpointing, disassembling and single stepping. It also shows the
+exact location of a signal 11. Paul has fixed the code so that all of
+this is working even if using modules compiled without -g. You can
+find his latest version on his web site.
+
+If no module aware gdb is available the following hints might help:
+
+1. Use remote login. This can be done thru a network connection or
+ simply by connecting a serial console. This enables you to watch
+ the Xservers output while running set breakpoints with gdb etc.
+ Don't even try to run the Xserver from a system console. Whenever
+ something happens gdb waits for input. However the Xserver has
+ locked the system console including the keyboard, therefore you'll
+ never be able to send any input to gdb. Even if your process
+ doesn't crash or you haven't set any breakpoints a vt switch can be
+ hazardous: When doing vt switching a signal is sent; unless you did
+
+ gdb> handle SIGUSR1 nostop
+
+ gdb waits for you to continue the program which cannot happen as
+ you don't have access to gdb's console.
+
+2. You can compile any source file with debugging symbols to obtain
+ more information about where an error occurred. Simply go to the
+ directory which holds the corresponding object file and do:
+
+ # rm <file>.o
+ # xc/config/util/makeg.sh <file>.o
+
+ After relinking the server or module gdb is able to obtain the
+ necessary debugging information and will show the exact line in the
+ source where the error ccurred. See also:
+ xc/config/util/makeg.man.
+
+3. In some cases it might be useful to have the assembler output of a
+ compiled source file. This can be obtained by doing:
+
+ # make <file>.s
+
+ or
+
+ # xc/config/util/makeg.sh <file>.s
+
+ Make will use exactly the same rules it uses for building *.o files.
+
+4. In some cases it might be useful to set breakpoints in modules. If
+ no module aware gdb is available you should add a call to one of
+ the three dummy breakpoint functions
+
+ xf86Break1(), xf86Break2() and xf86Break3()
+
+ to the source file and recompile the module. You now just have to
+ set a breakpoint onto the appropriate dummy functions. These
+ functions are located in the core part of the server and therefore
+ will be available any time.
+
+5. Without module support gdb is not able to print the function where
+ an error occurred in a module.
+
+ If you get a line like:
+
+ (gdb) bt
+ #0 0x823b4f5 in ?? ()
+ ....
+
+ You may obtain the function the address belongs to by calling
+ LoaderPrintSymbol():
+
+ (gdb) call LoaderPrintSymbol(0x823b4f5)
+
+ The symbol returned might not always be the name of the function
+ which contains the address. In case of static functions the symbol
+ is not known to the loader. However LoaderPrintSymbol() will print
+ the nearest known function and the offset from its start. You may
+ easily find the exact location of the address if you do:
+
+ # objdump --disassemble <file>.o
+
+ <file>.o is the name of the object file containing the symbol printed.
+
+6. Locating static symbols in modules is simpler if the module is a
+ single object file instead of a library. Such a object file can
+ easily be build from a library: # mkdir tmp # cd tmp; ar x
+ module-path/<libname>.a # ld -r *.o -o module-path/<name>.o
+
+ When calling LoaderPrintSymbol() the closes public symbol will be
+ printed together with the offset from the symbol's address. If a
+ static symbol comes before the first public symbol in a module The
+ following trick may help:
+
+ create a file 1-<name>.c in tmp/
+ containing:
+ void Dummy-<name>() {}
+
+ Compile it:
+
+ # gcc -c 1-<name>.c
+
+ and do the link step above.
+
+ This way Dummy-<name>() will be the first public function in the
+ module. All addresses in static function can now be printed
+ relatively to this address if no other public function comes before
+ this static one.
+
+7. In some situations it is quite helpful to add debugging symbols to
+ the binary. This can be done per object file. Simply remove the
+ object file and do
+
+ # makeg
+
+ When looking for a bug in a module these debugging infos can be
+ very helpful: Calling LoaderPrintSymbol() as described above will
+ return a function and an offset giving the exact location of the
+ address with respect to this function entry point. When
+ disassembling an object file with debugging symbols: # objdump -d
+ -l <file>.o one will receive a disassembled output containing line
+ number information. Thus one can locate the exact line of code
+ where the error occurred.
+
+8. To quickly trace the value of a variable declared in a module three
+ dummy variables have been added to the core part:
+
+ CARD32 xf86DummyVar1;
+ CARD32 xf86DummyVar2;
+ CARD32 xf86DummyVar3;
+
+ The variable can be assigned to one of them. One can then use gdb
+ to return the value of this variable:
+
+ gdb> p /x xf86DummyVar1
+
+9. Sometimes it might be useful to check how the preprocessor replaced
+ symbols. One can obtain a preprocessed version of the source file
+ by doing:
+
+ make <filename>.i
+
+ This will generate a preprocessed source in <filename>.i.
+
+10. xfree() can catch if one tries to free a memory range twice. You
+ will get the message:
+
+ Xalloc error: range already freed in Xrealloc() :-(
+
+ To find the location from which xfree() was called one can
+ breakpoint on XfreeTrap(). The backtrace should show the origin of the
+ call this call.
+
+11. To access mapped physical memory the following functions might be
+ useful.
+
+ These may be used to access physical memory that was mapped using
+ the flags VIDMEM_FRAMEBUFFER or VIDMEM_MMIO32:
+
+ CARD8 xf86PeekFb8(CARD8 *p);
+ CARD16 xf86PeekFb16(CARD16 *p);
+ CARD32 xf86PeekFb32(CARD32 *p);
+ void xf86PokeFb8(CARD8 *p, CARD8 v);
+ void xf86PokeFb16(CARD16 *p, CARD16 v);
+ void xf86PokeFb32(CARD16 *p, CARD32 v);
+
+ Physical memory which was mapped by setting VIDMEM_MMIO should be
+ accessed using the following. Here the base address to which the
+ memory is mapped and the offset are required separately.
+
+ CARD8 xf86PeekMmio8(pointer Base, unsigned long Offset);
+ CARD16 xf86PeekMmio16(pointer Base, unsigned long Offset);
+ CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset);
+ void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v);
+ void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v);
+ void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v);
+
diff --git a/hw/xfree86/doc/devel/Domain.note b/hw/xfree86/doc/devel/Domain.note
new file mode 100644
index 000000000..3db2aefae
--- /dev/null
+++ b/hw/xfree86/doc/devel/Domain.note
@@ -0,0 +1,159 @@
+The purpose of the changes described here is to implement a more general
+framework for multi-head on systems with more than one host-to-PCI bridge.
+The changes also implement a basic port of XFree86 to SPARC Solaris.
+
+These changes are derived from David S. Miller's submission #4653 to the
+patch list. David Andrew of Sun Microsystems was also kind enough to
+arrange for a hardware loan for development of these changes.
+
+These changes are known to work on several SPARC SunOS and UltraSPARC
+Linux configurations. Linux kernel work is in progress to port these
+changes to Linux/PowerPC.
+
+Several loose ends still need to be addressed before these changes can be
+considered stable. The bulk of this note is devoted to enumerating what
+remains to be done, along with other notes, broken down into various broad
+categories.
+
+SPARC SunOS (aka Solaris)
+-------------------------
+- An overview of this XFree86 port is available in README.Solaris.
+- The keyboard map code in hw/xfree86/os-support/sunos/sun_kbdEv.c needs
+ to be extended to handle more than only the sun5 keyboard I targeted it
+ for. Even for the sun5, the map is incomplete as several keys are not
+ mapped. What is there is just barely usable.
+- On exit, the server will zero out /dev/fb, but that might not be the
+ right thing to do for all primary adapters. This does however
+ appear to emulate the behaviour of Sun's commercial servers. It also
+ eliminates the need for output drivers to save and restore video memory
+ contents. (They still need to save/restore the mode timing however.)
+ This also chimes into a long-standing XFree86 policy to not save/restore
+ video memory contents if the mode on entry is found to be non-VGA, a
+ policy several existing drivers comply with.
+- The SBUS drivers (sunbw2, suncg14, suncg3, suncg6, sunffb, sunleo and
+ suntcx), the common layer's SBUS code and the fbdev driver have all
+ only been compile tested. There are likely to be Linux'isms within
+ them that remain to be dealt with.
+- It still needs to be verified whether or not this work adversely
+ affected support for ix86 Solaris.
+
+UltraSPARC Linux
+----------------
+- Although this code can be compiled using any Linux/SPARC64 kernel, it
+ can only run successfully using 2.4.12 or later.
+- I haven't had time to sufficiently dig into XKB to properly configure it
+ for sun5 keyboards. Given XFree86 on Linux/SPARC has been around for a
+ while, it's likely someone has already done this, and I'd appreciate
+ receiving a copy of a working XF86Config input section.
+
+PowerPC Linux
+-------------
+- As mentioned above, kernel work is in progress to port this PCI scheme
+ to Linux/PowerPC.
+- Aside from kernel work, the inX() and outX() definitions in compiler.h
+ will need to be changed to do something akin to their SPARC definitions,
+ i.e. consider their port argument to be a virtual address.
+
+Other Linux ports to multi-domain architectures
+-----------------------------------------------
+- Comments in os-support/bus/linuxPci.c document the kernel interface
+ required to port these changes. In short, Linux ports, such as Alpha
+ and mips, should follow SPARC and PowerPC's lead in providing support to
+ mmap() PCI devices through their /proc/bus/pci pseudo-files and to treat
+ such requests for host bridges as requests to mmap() space provided by
+ these bridges.
+
+Other OS's
+----------
+- In the right hands, either linuxPci.c or sparcPci.c can be used as a
+ guide for what would need to be done to port this scheme to other OS's.
+ Perhaps the largest difference between the two (in terms of interface to
+ the common layer) is that the SunOS port includes internally generated
+ domain numbers in PCITAG's, whereas the Linux port doesn't need to. The
+ remainder of the PCI code (which is OS-independent) can handle either
+ scheme.
+- Required entry points are xf86GetPciDomain(), xf86MapDomainMemory(),
+ xf86MapDomainIO() and xf86ReadDomainMemory(). Replacements for
+ xf86BusAccWindowsFromOS(), xf86PciBusAccWindowsFromOS() and
+ xf86AccResFromOS() might also be required.
+- Development of these changes has detected the fact that the XFree86 port
+ to the PowerMax OS is broken, and has been for some time, i.e. since
+ shortly after its introduction, back in the 3.9* days.
+
+SPARC PCI (OS-independent)
+--------------------------
+- The "Simba" PCI-to-PCI bridge used in SPARC's does not implement VGA
+ routing, as defined in the PCI specs. Fortunately, OpenPROM seems to
+ always route VGA resources to the bus with PCI connectors, but this also
+ causes the common layer to not mark any PCI adapter as primary.
+
+Multiple PCI domains (architecture- and OS-independent)
+-------------------------------------------------------
+- This implementation assumes every host-to-PCI bridge provides access to
+ a separate PCI domain. Each such domain provides three different
+ "address" spaces: PCI configuration, I/O and memory. The
+ implementation can also deal with situations where more than one PCI
+ domain share (different subsets of) the same PCI configuration space. I
+ have unconfirmed information that suggests it might be necessary to also
+ allow the sharing of PCI memory spaces.
+- This implementation also assumes the CPU's physical address space
+ includes the entirety of each domain's I/O and memory spaces. I know
+ this'll need to be changed to deal with the so-called UniNorth bridge,
+ found on PowerPC's, which allows access to only a subset of the memory
+ space behind it.
+- Ideally, the common layer should mark as primary up to one PCI adapter
+ per domain. This has yet to be done.
+- Something needs to be done about PCI master aborts on primary buses.
+ For details on this, see my long-winded diatribe in sparcPci.c, and
+ related comments in linuxPci.c. Suffice it to say here that I see the
+ eventual implementation of host bridge drivers within XFree86 as
+ unavoidable at this point.
+- DGA is broken on multi-domain platforms. The information passed to the
+ client to locate the framebuffer still needs to be revised. The best way
+ to deal with this is to change all drivers' OpenFramebuffer() function to
+ call a common layer routine to set the device name and displacements to be
+ returned to the DGA client.
+
+Output drivers
+--------------
+Most drivers currently used on ix86 need(ed) source code changes.
+- Calls to xf86ReadBIOS() and xf86MapVidMem() were replaced with calls to
+ xf86ReadDomainMemory() and xf86MapDomainMemory() respectively. Except
+ for the "ati" and "atimisc" modules, this has already been done.
+- All ix86-style I/O port numbers need to be declared as an IOADDRESS, a
+ type defined in xf86Pci.h as "unsigned long". Such port numbers also
+ need to be offset by a displacement which is also defined as an
+ IOADDRESS. Before a driver's PreInit() is called, the common layer
+ makes this displacement available in ScrnInfoRec.domainIOBase. For
+ single-domain architectures, such as ix86, domainIOBase will always be
+ zero. Current use of vgaHWRec.PIOOffset has also been adjusted
+ accordingly. Some drivers have been changed to keep a copy of this
+ displacement in their private structure. Internally, an IOADDRESS is
+ actually a pointer that has been recasted to an unsigned long, but the
+ common layer "hides" this fact from the driver ABI, which means that I/O
+ port numbers, as seen by drivers, remain as integers rather than
+ addresses. Aside from the ati and atimisc modules, s3, sis and tseng
+ are the only modules left whose I/O still needs to be converted (I've
+ temporarily run out of steam).
+- Note that these conversions are not necessarily sufficient to produce
+ drivers that will work on any given multi-domain architecture. A driver
+ that, for example, had endianness problems, still does. But, at least,
+ these conversions, along with the supporting common layer changes, make
+ PCI drivers more widely amenable to porting.
+- rdinx(), wrinx(), modinx(), testrg(), testinx() and testinx2() are not
+ given enough information to allow for the relocation of their I/O. They
+ are consequently being deleted. The apm and ark drivers, the only
+ remaining callers of the first three, have been changed to use local
+ definitions instead. The last three (test*()) were already unused.
+- As a temporary measure, these changes completely disable ISA-style
+ probing on SPARC's and PowerPC's. This means that driver calls to
+ xf86MatchIsaInstances(), while still valid, will always return detection
+ failure on SPARC's and PowerPC's. This will be dealt with when a more
+ general master abort handling scheme is implemented.
+- I need to make a decision about the master abort issues mentionned above
+ before I can convert the "ati" and "atimisc" modules. Consequently,
+ these modules still need to be compiled with -DAVOID_CPIO on
+ multi-domain architectures, and support for Mach64 variants as
+ non-primary heads is not yet available.
+
+$XFree86: xc/programs/Xserver/hw/xfree86/Domain.note,v 1.2 2002/01/25 21:55:49 tsi Exp $
diff --git a/hw/xfree86/doc/devel/RAC.Notes b/hw/xfree86/doc/devel/RAC.Notes
new file mode 100644
index 000000000..0aec9d795
--- /dev/null
+++ b/hw/xfree86/doc/devel/RAC.Notes
@@ -0,0 +1,696 @@
+I. Abstract
+===========
+
+Graphics devices are accessed thru ranges in I/O or memory space. While
+most modern graphics devices allow relocation of such ranges many of
+them still require the use of well established interfaces such as VGA
+memory and IO ranges or 8514/A IO ranges. Up to version 3.3 of
+XFree86 only a single graphics device could be driven. Therfore there
+was no need to address the issue of sharing such memory or I/O ranges
+among several devices. Starting with version 4.0 XFree86 is capable of
+driving more than one graphics interface in a multi-head environment.
+Therefore a mechanism needed to be designed which was capable of
+controlling the sharing the access to memory and I/O ranges. In this
+document we describe to use of the RAC (Resource Access Control)
+system in the XFree86 server which provides the service of controlling
+access to interface resources.
+
+II. Introduction
+================
+
+Terms and definitions:
+
+II.1. Bus
+---------
+
+'Bus' is ambiguous as it is used for different things: It may refer to
+physical incompatible extension connectors in a computer system. The
+RAC system knows two such systems: The ISA bus and the PCI bus. (On
+the software level EISA, MC and VL buses are currently treated like
+ISA buses). 'Bus' may always refer to logically different entities on
+a single bus system which are connected via bridges. A PCI system may
+have several distinct PCI buses connecting each other by PCI-PCI
+bridges or to the host CPU by HOST-PCI bridges.
+
+Systems that host more than one bus system link these together using
+bridges. Bridges are a concern to RAC as they might block or pass
+specific resources. PCI-PCI bridges may be set up to pass VGA
+resources to the secondary bus. PCI-ISA buses pass any resources not
+decoded on the primary PCI bus to the ISA bus. This way VGA resources
+(although exclusive on the ISA bus) can be shared by ISA and PCI
+cards. Currently HOST-PCI bridges are not yet handled by RACY as they
+require specific drivers.
+
+II.2. Entity
+------------
+
+The smallest independently addressable unit on a system bus is
+referred to as an entity. So far we know ISA and PCI entities. PCI
+entities can be located on the PCI bus by an unique ID consisting of
+the bus, card and function number.
+
+II.3. Resource
+--------------
+
+ 'Resource' refers to a range of memory or I/O addresses an entity
+can decode.
+
+If a device is capable of disabling this decoding the resource is
+called sharable. For PCI devices a generic method is provided to
+control resource decoding. Other devices will have to provide a device
+specific function to control decoding.
+
+If the entity is capable of decoding this range at a different
+location this resource is considered relocatable. Resource which start
+at a specific address and occupy a single continuous range are called
+block resources.
+
+Alternatively resource addresses can be decoded in a way that they
+satisfy the condition:
+
+ address & mask == base
+
+with base & mask == base. Resources addressed in such a way are
+considered sparse resources.
+
+
+II.4. Server States
+------------------
+
+The resource access control system knows two server states: the SETUP
+and the OPERATING state. The setup state is entered whenever a mode
+change takes place or the server exits or does VT switching. During
+this state any entity resource is under resource access control.
+During OPERATING state only those entities are controlled which
+actually have shared resources that conflict with others. The
+determination which entity is to be placed under RAC during OPERATING
+state takes place after ScreenInit() during the first server
+generation. This doesn't apply if only one screen is active: in this
+case no RAC is needed and the screen is simply left enabled while the
+server is active.
+
+
+III. Theory of operation
+========================
+
+III.1. General
+--------------
+
+The common level has knowledge of generic access control mechanisms
+for devices on certain bus systems (currently the PCI bus) as well as
+of methods to enable or disable access to the buses
+itself. Furthermore it can access information on resources decoded by
+these devices and if necessary modify it.
+
+When first starting the Xserver collects all this information, saves
+it for restoration checks it for consistency and if necessary corrects
+it. Finally it disables all resources on a generic level prior to
+calling any driver function.
+
+ The user should provide a device section in XF86Config for each
+graphics device installed in his system. Each such entity which is
+never to be used as X display device might be marked as inactive by
+adding the keyword "Inactive" to the device section.
+
+When the Probe() function of each driver is called the device sections
+are matched against the devices found in the system. The driver may
+probe devices at this stage that cannot be identified by using device
+independent methods. Access to all resources that can be controlled in
+a device independent way is disabled. The Probe() function should
+register all non-relocatable resources at this stage. If a resource
+conflict is found between exclusive resources the driver will fail
+immediately. Optionally the driver might specify an EntityInit(),
+EntityLeave() and EntityEnter() function.
+
+EntityInit() can be used to disable any shared resources that are not
+controlled by the generic access control functions. It is called prior
+to the PreInit phase regardless if an entity is active or not. When
+calling the EntityInit(), EntityEnter() and EntityLeave() functions
+the common level will disable access to all other entities on a
+generic level. Since the common level has no knowledge of device
+specific methods to disable access to resources it cannot be
+guaranteed that certain resources are not decoded by any other entity
+until the EntityInit() or EntityEnter() phase is finished. Device
+drivers should therefore register all those resources which they are
+going to disable. If these resources are never to be used by any
+driver function they may be flagged 'ResInit' so that they can be
+removed from the resource list after processing all EntityInit()
+functions. EntityEnter() should disable decoding of all resources
+which are not registered as exclusive and which are not handled by the
+generic access control in the common level. The difference to
+EntityInit() is that the latter one is only called once during
+lifetime of the server. It can therefore be used to set up variables
+prior to disabling resources. EntityLeave() should restore the
+original state when exiting the server or switching to a different vt.
+It also needs to disable device specific access functions if they need
+to be disabled on server exit or VT switch. The default state is to
+enable them before giving up the VT.
+
+In PreInit() phase each driver should check if any sharable resources
+it has registered during Probe() has been denied and take appropriate
+action which could simply be to fail. If it needs to access resources
+it has disabled during EntitySetup() it can do so provided it has
+registered these and will disable them before returning from
+PreInit(). This also applies to all other driver functions. Several
+functions are provided to request resource ranges, register these,
+correct PCI config space and add replacements for the generic access
+functions. Resources may be marked 'disabled' or 'unused' during
+OPERATING stage. Although these steps could also be performed in
+ScreenInit(), this is not desirable.
+
+Following PreInit() phase the common level determines if resource
+access control is needed. This is the case if more than one screen is
+used. If necessary the RAC wrapper module is loaded. In ScreenInit()
+the drivers can decide which operations need to be placed under
+RAC. Available are the frame buffer operations, the pointer operations
+and the colormap operations. Any operation that requires resources
+which might be disabled during OPERATING state should be set to use
+RAC. This can be specified separately for memory and IO resources.
+
+When ScreenInit() phase is done the common level will determine which
+shared resources are requested by more than one driver and set the
+access functions accordingly. This is done following these rules:
+
+a. The sharable resources registered by each entity are compared. if
+ a resource is registered by more than one entity the entity will be
+ marked to need to share this resources type (IO or MEM).
+
+b. A resource marked 'disabled' during OPERATING state will be ignored
+ entirely.
+
+c. A resource marked 'unused' will only conflicts with an overlapping
+ resource of an other entity if the second is actually in use during
+ OPERATING state.
+
+d. If an 'unused' resource was found to conflict however the entity
+ does not use any other resource of this type the entire resource
+ type will be disabled for that entity.
+
+The driver has the choice among different ways to control access to
+certain resources:
+
+a. It can relay on the generic access functions. This is probably the
+ most common case. Here the driver only needs to register any
+ resource it is going to use.
+
+b. It can replace the generic access functions by driver specific
+ ones. This will mostly be used in cases where no generic access
+ functions are available. In this case the driver has to make sure
+ these resources are disabled when entering the PreInit() stage.
+ Since the replacement functions are registered in PreInit() the
+ driver will have to enable these resources itself if it needs to
+ access them during this state. The driver can specify if the
+ replacement functions can control memory and/or I/O resources
+ separately.
+
+c. The driver can enable resources itself when it needs them. Each
+ driver function enabling them needs to disable them before it will
+ return. This should be used if a resource which can be controlled
+ in a device dependent way is only required during SETUP state. This
+ way it can be marked 'unused' during OPERATING state.
+
+A resource which is decoded during OPERATING state however never
+accessed by the driver should be marked unused.
+
+Since access switching latencies are an issue during Xserver
+operation, the common level attempts to minimize the number of
+entities that need to be placed under RAC control. When a wrapped
+operation is called, the EnableAccess() function is called before
+control is passed on. EnableAccess() checks if a screen is under
+access control. If not it just establishes bus routing and returns. If
+the screen needs to be under access control, EnableAccess() determines
+which resource types (MEM,IO) are required. Then it tests if this
+access is already established. If so it simply returns. If not it
+disables the currently established access, fixes bus routing and
+enables access to all entities registered for this screen.
+
+Whenever a mode switch or a vt-switch is performed the common level
+will return to SETUP state.
+
+III.3. Resource Types
+---------------------
+
+Resource have certain properties. When registering resources each
+range is accompanied by a flag consisting of the or'ed flags of the
+different properties the resource has. Each resource range may be
+classified according to
+
+- its physical properties ie. if it addresses
+ memory (ResMem) or
+ I/O space (ResIo),
+- if it addresses a
+ block (ResBlock) or
+ sparse (ResSparse)
+ range,
+- its access properties.
+
+There are two known access properties:
+
+- ResExclusive
+ for resources which may not be shared with any other device and
+- ResShared
+ for resources which can be disabled and therefore can be shared.
+
+If it is desirable to test a resource against any type a generic
+access type 'ResAny' is provided. If this is set the resource will
+conflict with any resource of a different entity intersecting its
+range. Further it can be specified that a resource is decoded however
+never used during any stage (ResUnused) or during OPERATING state
+(ResUnusedOpr). A resource only visible during the init functions (ie.
+EntityInit(), EntityEnter() and EntityLeave() should be registered
+with the flag 'ResInit'. A resource that might conflict with
+background resource ranges may be flagged with 'ResBios'. This might
+be useful when registering resources ranges that were assigned by the
+system Bios.
+
+Several predefined resource lists are available for VGA and 8514/A
+resources in common/sf86Resources.h.
+
+IV. Available Functions
+=======================
+
+The functions provided for resource management will be listed in order
+of use in the driver.
+
+IV.1. Probe phase
+-----------------
+
+In this stage each driver detects those resources it is able to drive,
+creates an entity record for each of them, registers non-relocatable
+resources and allocates screens and adds the resources to screens.
+
+Two helper functions are provided for matching device sections in the
+XF86Config file to the devices:
+
+ int xf86MatchPciInstances(const char *driverName, int vendorID,
+ SymTabPtr chipsets, PciChipsets *PCIchipsets,
+ GDevPtr *devList, int numDevs, DriverPtr drvp,
+ int **foundEntities);
+
+ int xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
+ IsaChipsets *ISAchipsets, DriverPtr drvp,
+ FindIsaDevProc FindIsaDevice, GDevPtr *devList,
+ int numDevs, int **foundEntities);
+
+Both functions return the number of matched entities and their indices
+in foundEntities list.
+
+They make use of several sub functions which are also available on the
+driver level:
+
+ Bool xf86ComparePciBusString(const char *busID, int bus,
+ int device, int func);
+
+and
+
+ Bool xf86ParseIsaBusString(const char *busID);
+
+are called to interpret the busID in the device section. The functions:
+
+ int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
+ int chipset, GDevPtr dev, Bool active);
+
+ int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool
+ active);
+
+are used to allocate the entities and initialize their data
+structures. Both functions return the index of the newly allocated
+entity record or (-1) should the function fail. Before probing an ISA
+card
+
+ Bool xf86IsPrimaryIsa();
+
+gets called to determine if the primary card was not detected on the
+PCI bus.
+
+Two helper functions are provided to aid configuring entities:
+
+ Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
+ PciChipsets *p_chip, resList res,
+ EntityProc init, EntityProc enter,
+ EntityProc leave, pointer private);
+ Bool xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex,
+ IsaChipsets *i_chip, resList res,
+ EntityProc init, EntityProc enter,
+ EntityProc leave, pointer private);
+
+They are used to register the init/enter/leave functions described
+above as well as the non-relocatable resources. Generally the list of
+fixed resources is obtained from the Isa/PciChipsets lists. However
+an additional list of resources may be passed. Generally this is not
+required. The init/enter/leave functions have to be of type
+
+ typedef void (*EntityProc)(int entityIndex,pointer private);
+
+They are passed the entity index and a pointer to a private scratch
+area. This are can be set up during Probe() and its address can be
+passed to xf86ConfigActiveIsaEntity() xf86ConfigActivePciEntity() as
+the last argument.
+
+These helper functions use:
+
+ void xf86ClaimFixedResources(resList list, int entityIndex);
+
+ To register the non relocatable resources which cannot be disabled
+ and which therefore would cause the server to fail immediately if
+ they were found to conflict. It also records non-relocatable but
+ sharable resources for processing after the Probe() phase.
+
+ Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
+ EntityProc enter, EntityProc leave, pointer);
+
+ This function registers the init/enter/leave() functions along with
+ the pointer to their private area to the entity.
+
+ void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
+
+ adds the entity to the screen.
+
+These functions are also available on the driver level. A detailed
+Probe() function is listed below. For most drivers this can be used
+with little change.
+
+Please note that VGA resources have to be claimed in Probe()
+phase. Otherwise they are not routed to the bus.
+
+IV.2. PreInit() phase
+---------------------
+
+During this phase the remaining resource should be registered.
+PreInit() should call
+
+ EntityInfoPtr xf86GetEntityInfo(int entityIndex);
+
+To obtain a pointer to an EntityInfoRec for each entity it is able to
+drive and check if any resource are listed in 'resources'. These have
+been rejected in the post-Probe() phase. The driver should decide if
+it can continue without using these or if it should fail. The pointer
+to the EntityInfoRec should be freed if not needed any more.
+
+Several functions are provided to simplify resource registration:
+
+ Bool xf86IsEntityPrimary(int entityIndex);
+
+is used to determine if the entity is the display device that is used
+during boot-up and text mode.
+
+ Bool xf86IsScreenPrimary(int scrnIndex);
+
+finds out if the primary entity is registered for the screen with
+specified index.
+
+ pciVideoPtr xf86GetPciInfoForEntity(int entityIndex);
+
+returns a pointer to the pciVideoRec of the specified entity. If the
+entity is not a PCI device NULL is returned.
+
+The primary function for registration of resources is
+
+ resPtr xf86RegisterResources(int entityIndex, resList list, int access);
+
+it tries to register the resources in 'list'. If list is NULL it tries
+to determine the resources automatically. This only works for entities
+that provide a generic way to read out the resource ranges they
+decode. So far this is only the case for PCI devices. By default the
+PCI resources are registered as shared (ResShared) if the driver wants
+to set a different access type it can do so by specifying the access
+flags in the third argument. A value of 0 means to use the default
+settings. If for any reason the resource broker is not able to
+register some of the requested resources the function will return a
+pointer to a list of the failed ones. In this case the driver may move
+the resource to different locations. In case of PCI bus entities this
+is done by passing the list of failed resources to
+
+ resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
+
+this function returns a list of reallocated resource. This list needs
+to be passed to xf86RegisterResources() again to be registered with
+the broker.
+
+Two functions are provided to obtain a resource range of a given type:
+
+ resRange xf86GetBlock(long type, memType size,
+ memType window_start, memType window_end,
+ memType align_mask, resPtr avoid);
+ resRange xf86GetSparse(long type, unsigned long fixed_bits,
+ unsigned long decode_mask, unsigned long address_mask,
+ resPtr avoid);
+
+The first one tries to find a block range of size 'size' and type
+'type' in a window bound by window_start and window_end with the
+alignment specified in alignment mask. Optionally a list of resource
+ranges which should be avoided inside this window can be passed. On
+failure it will return a zero range of type 'ResEnd'.
+
+The latter function does the same for sparse resources. A spares range
+is determined by to parameters: the mask and the base value. An
+address satisfying
+
+ mask & address == base
+
+belongs to the specific spares range. 'mask' and 'base' themselves
+have to satisfy:
+
+ mask & base == base.
+
+Here three values have to be specified: the address mask which marks
+all bits of the mask part of the address, the decode_mask which masks
+out the bits which are hard coded and are therefore not available for
+relocation and the values of the fixed bits. The function tries to
+find a base that satisfies the given condition. If the function fails
+it will return a zero range of type 'ResEnd'. Optionally it might be
+passed a list of resource ranges to avoid.
+
+Certain PCI devices are broken in the sense that they return invalid
+size information for a certain resource. In this case the driver can
+supply the correct size and make sure that the resource range
+allocated for the card is large enough to hold the address range
+decoded by the card. The function:
+
+ Bool xf86FixPciResource(int entityIndex, unsigned int prt, CARD32 alignment,
+ long type);
+
+is used for that. The parameter prt contains the number of the PCI
+base register that needs to be modified. A value of 6 refers to the
+BIOS base register. The size is specified in the alignment
+register. Since PCI resources need to span an integral range of the
+size 2^n the alignment also specifies the number of addresses that
+will be decoded. If the driver specifies a type mask it can override
+the default type for PCI resources which is 'ResShared'. The resource
+broker needs to know that to find a matching resource range. This
+function should be called before calling xf86RegisterResources().
+
+ Bool xf86CheckPciMemBase(pciVideoPtr pPci, unsigned long base);
+
+checks that the memory base value specified in base matches one of the
+PCI base address register values for the given PCI device.
+
+The driver may replace the generic access control functions for an
+entity by it's own ones.
+
+ void xf86SetAccessFuncs(EntityInfoPtr pEnt, xf86SetAccessFuncPtr funcs,
+ xf86SetAccessFuncPtr oldFuncs);
+
+ with:
+
+ typedef struct {
+ xf86AccessPtr mem;
+ xf86AccessPtr io;
+ xf86AccessPtr io_mem;
+ } xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
+
+is used for that. The driver can pass three functions: one for I/O
+access, one for memory access and one for combined memory and I/O
+access. If the memory access and combined access functions are
+identical the common level assumes that the memory access cannot be
+controlled independently of I/O access, if the I/O access function and
+the combined access functions are the same it is assumed that I/O can
+not be controlled independently. If memory and I/O have to be
+controlled together all three values should be the same. If a non
+NULL value is passed as third argument it is interpreted as an address
+where to store the old access records. If the third argument is NULL
+it will be assumed that the generic access should be enabled before
+replacing the access functions. Otherwise it will be disabled. The
+driver may enable them itself using the returned values. It should do
+this from his replacement access functions as the generic access may
+be disabled by the common level on certain occasions. If replacement
+functions are specified they must control all resources of the
+specific type registered for the entity.
+
+To find out if specific resource range is conflicting with another
+resource
+
+ memType xf86ChkConflict(resRange *rgp, int entityIndex);
+
+may be called. If a non-zero value is returned a conflict is found.
+
+ resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
+
+is used to set the state of a resource during OPERATING state. 'list'
+holds a list to which 'mask' is to be applied. The parameter 'mask'
+may have the value 'ResUnusedOpr' and 'ResDisableOpr'. The first one
+should be used if a resource isn't used during OPERATING state however
+decoded by the device while the latter one indicates that the resource
+is not decoded during OPERATING state. Note that the resource ranges
+have to match those specified during registration. If a range has been
+specified starting at A and ending at B and suppose C us a value
+satisfying A < C < B one may not specify the resource range (A,B) by
+splitting it into two ranges (A,C) and (C,B).
+
+Two functions are provided for special cases:
+
+ void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
+
+may be used to remove an entity from a screen. This only makes sense
+if a screen has more than one entity assigned or the screen is to be
+deleted. No test is made if the screen has any entities left.
+
+ void xf86DeallocateResourcesForEntity(int entityIndex, long type);
+
+deallocates all resources of a given type registered for a certain
+entity from the resource broker list.
+
+IV.3. ScreenInit() phase
+------------------------
+
+Setting up the rac flags is all that remains to do in ScreenInit()
+phase (Note that these flags might also be set up in PreInit() phase).
+The ScrnInfoRec has separate flags for memory and PIO access:
+racIoFlags and racMemFlags. They specifies which graphics operations
+might require the use of resources which might be disabled for some
+reason. Note that even exclusive resources might be disabled if they
+are disabled along with shared resources. For example if a driver has
+registered the VGA PIO resources and lets the common level disable
+these by disabling PIO access in PCI config space (the standard way),
+exclusive PCI PIO ranges will also be disabled. Therefore the driver
+has to flag any operations requiring PCI PIO resources in racIoFlags.
+The avaliable flags are defined in rac/xf86RAC.h. Available are:
+
+ RAC_FB for framebuffer operations (including hw acceleration)
+ RAC_CURSOR for Cursor operations
+ (??? I'm not sure if we need this for SW cursor it depends
+ on which level the sw cursor is drawn)
+ RAC_COLORMAP for colormap operations
+ RAC_VIEWPORT for the call to RACAdjustFrame()
+
+The flags are or'ed.
+
+V. Appendix
+===========
+
+A. Sample Probe() Function
+--------------------------
+
+static Bool
+XXXProbe(DriverPtr drv, int flags)
+{
+ Bool foundScreen = FALSE;
+ int numDevSections, numUsed;
+ GDevPtr *devSections;
+ int *usedChips;
+ int i;
+
+ /*
+ * Find the config file Device sections that match this
+ * driver, and return if there are none.
+ */
+ if ((numDevSections = xf86MatchDevice(CHIPS_DRIVER_NAME,
+ &devSections)) <= 0) {
+ return FALSE;
+ }
+ /* PCI BUS */
+ /* test if PCI bus present */
+ if (xf86GetPciVideoInfo() ) {
+ /* match PCI instances with ones supported by the driver */
+ numUsed = xf86MatchPciInstances(XXX_NAME, PCI_VENDOR_XXX,
+ XXXChipsets, XXXPCIchipsets,
+ devSections,numDevSections, drv,
+ &usedChips);
+ if (numUsed > 0) {
+ for (i = 0; i < numUsed; i++) {
+ /* Allocate a ScrnInfoRec */
+ ScrnInfoPtr pScrn = xf86AllocateScreen(drv,0);
+ pScrn->driverVersion = VERSION;
+ pScrn->driverName = XXX_DRIVER_NAME;
+ pScrn->name = XXX_NAME;
+ pScrn->Probe = XXXProbe;
+ pScrn->PreInit = XXXPreInit;
+ pScrn->ScreenInit = XXXScreenInit;
+ pScrn->SwitchMode = XXXSwitchMode;
+ pScrn->AdjustFrame = XXXAdjustFrame;
+ pScrn->EnterVT = XXXEnterVT;
+ pScrn->LeaveVT = XXXLeaveVT;
+ pScrn->FreeScreen = XXXFreeScreen;
+ pScrn->ValidMode = XXXValidMode;
+ foundScreen = TRUE;
+ /* add screen to entity */
+ xf86ConfigActivePciEntity(pScrn,usedChips[i],XXXPCIchipsets,
+ NULL,NULL,NULL,NULL,NULL);
+ }
+ }
+ }
+
+ /* Isa Bus */
+ numUsed = xf86MatchIsaInstances(XXX_NAME,XXXChipsets,XXXISAchipsets,
+ drv,chipsFindIsaDevice,devSections,
+ numDevSections,&usedChips);
+ if(numUsed >= 0)
+ for (i = 0; i < numUsed; i++) {
+ ScrnInfoPtr pScrn = xf86AllocateScreen(drv,0);
+
+ pScrn->driverVersion = VERSION;
+ pScrn->driverName = XXX_DRIVER_NAME;
+ pScrn->name = XXX_NAME;
+ pScrn->Probe = XXXProbe;
+ pScrn->PreInit = XXXPreInit;
+ pScrn->ScreenInit = XXXScreenInit;
+ pScrn->SwitchMode = XXXSwitchMode;
+ pScrn->AdjustFrame = XXXAdjustFrame;
+ pScrn->EnterVT = XXXEnterVT;
+ pScrn->LeaveVT = XXXLeaveVT;
+ pScrn->FreeScreen = XXXFreeScreen;
+ pScrn->ValidMode = XXXValidMode;
+ foundScreen = TRUE;
+ xf86ConfigActiveIsaEntity(pScrn,usedChips[i],XXXISAchipsets,
+ NULL,NULL,NULL,NULL,NULL);
+ }
+ xfree(devSections);
+ return foundScreen;
+}
+
+B. Porting Issues
+-----------------
+
+Here are some hints on porting code developed for RAC 1 to RAC 2.
+
+1. a. Initialization of RAC is now entirely done on the common level.
+ Therefore the call to xf86RACInit() can be removed.
+
+ b. Also there is no need for the racSymbols list.
+
+ c. LoadSubModule(..,rac) should be removed.
+
+ d. racSymbols should be removed from LoaderRequestSymList(racSymbols,..)
+
+2. a. if the driver uses the predefined resource lists xf86Resources.h
+ needs to be included.
+
+ b. RES_VGA should be changed to RES_EXCLUSIVE_VGA
+
+3. The device list now belongs to the EntityInfoRec.
+ Change pScrn->device to xxx->pEnt->device.
+
+4. Rewrite the Probe() function. The example given above should work
+ as a guideline.
+
+5. Register all necessary resources in PreInit() by calling
+ xf86RegisterResources().
+
+6. If applicable set the operating state of the registered resources
+ by calling xf86SetOperatingState(). This should be done during
+ PreInit(). If necessary it might still be done in ScreenInit()
+
+7. Set up the racIoFlags and racMemFlags.
+
+
+ LocalWords: ISA
diff --git a/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/devel/README.DRIcomp
new file mode 100644
index 000000000..1e9773ccc
--- /dev/null
+++ b/hw/xfree86/doc/devel/README.DRIcomp
@@ -0,0 +1,543 @@
+ DRI Compilation Guide
+
+ VA Linux Systems, Inc. Professional Services - Graphics.
+
+ 21 April 2001
+
+1. Preamble
+
+1.1 Copyright
+
+Copyright © 2000-2001 by VA Linux Systems, Inc. All Rights Reserved.
+
+Permission is granted to make and distribute verbatim copies of this document
+provided the copyright notice and this permission notice are preserved on all
+copies.
+
+1.2 Trademarks
+
+OpenGL is a registered trademark and SGI is a trademark of Silicon Graphics,
+Inc. Unix is a registered trademark of The Open Group. The `X' device and X
+Window System are trademarks of The Open Group. XFree86 is a trademark of
+The XFree86 Project. Linux is a registered trademark of Linus Torvalds.
+Intel is a registered trademark of Intel Corporation. 3Dlabs, GLINT, and
+Oxygen are either registered trademarks or trademarks of 3Dlabs Inc. Ltd.
+3dfx, Voodoo3, Voodoo4, and Voodoo5 are registered trademarks of 3dfx Inter-
+active, Incorporated. Matrox is a registered trademark of Matrox Electronic
+Systems Ltd. ATI Rage and Radeon is a registered trademark of ATI Technolo-
+gies, Inc. All other trademarks mentioned are the property of their respec-
+tive owners.
+
+2. Introduction
+
+This document describes how to download, compile and install the DRI. The
+DRI provides 3D graphics hardware acceleration for the XFree86 project. This
+information is intended for experienced Linux developers. Beginners are
+probably better off installing precompiled packages.
+
+Edits, corrections and updates to this document may be mailed to <brian@tung-
+stengraphics.com>.
+
+Last updated on 13 February 2002 by Brian Paul.
+
+3. Prerequisites
+
+You'll need the following:
+
+ o An installation of XFree86 4.1 or later. The DRI tree has been pruned
+ down to minimize its size. But in order to build the DRI tree you need
+ to have recent X header files, etc. already installed. If you don't
+ have XFree86 4.1 (or later) installed you can probably install it from
+ RPMs (or another package format). Or, you can download XFree86 as
+ sources and compile/install it yourself.
+
+ o At least 200MB of free disk space. If you compile for debugging (the -g
+ option) then you'll need about 600MB.
+
+ o GCC compiler and related tools.
+
+ o ssh (secure shell) if you're a DRI developer and don't want to use
+ anonymous CVS download.
+
+ o A 2.4.x Linux Kernel. See below for details.
+
+ o FreeBSD support is not currently being maintained and may not work.
+
+The DRI 3D drivers generally work on systems with Intel or AMD CPUs. How-
+ever, limited support for Alpha and PowerPC support is underway.
+
+For 3dfx Voodoo hardware, you'll also need the Glide3 runtime library
+(libglide3-v3.so for Voodoo3 or libglide3-v5.so for Voodoo4/5). These can be
+downloaded from the DRI website. You can compile them yourself, but it's
+often a painful process.
+
+For Matrox G200/G400, Intel i810/i830 or ATI Rage128/Radeon hardware, you'll
+also need AGP support in your Linux kernel, either built-in or as a loadable
+module.
+
+4. Linux Kernel Preparation
+
+Only the Linux 2.4.x kernels are currently supported by the DRI hardware
+drivers. 2.5.x kernels may work, but aren't tested.
+
+Most of the DRI drivers require AGP support and using Intel Pentium III SSE
+optimizations also requires an up-to-date Linux kernel. Configuring your
+kernel correctly is very important, as features such as SSE optimizations
+will be disabled if your kernel does not support them. Thus, if you have a
+Pentium III processor, you must configure your kernel for the Pentium III
+processor family.
+
+Building a new Linux kernel can be difficult for beginners but there are
+resources on the Internet to help. This document assumes experience with
+configuring, building and installing Linux kernels.
+
+Linux kernels can be downloaded from www.kernel.org
+
+Here are the basic steps for kernel setup.
+
+ o Download the needed kernel and put it in /usr/src. Create a directory
+ for the source and unpack it. For example:
+
+ cd /usr/src
+ rm -f linux
+ mkdir linux-2.4.x
+ ln -s linux-2.4.x linux
+ bzcat linux-2.4.x.tar.bz2 | tar xf -
+
+ It is critical that /usr/src/linux point to your new kernel sources,
+ otherwise the kernel headers will not be used when building the DRI.
+ This will almost certainly cause compilation problems.
+
+ o Read /usr/src/linux/Documentation/Changes. This file lists the minimum
+ requirements for all software packages required to build the kernel.
+ You must upgrade at least gcc, make, binutils and modutils to at least
+ the versions specified in this file. The other packages may not be
+ needed. If you are upgrading from Linux 2.2.x you must upgrade your
+ modutils package for Linux 2.4.x.
+
+ o Configure your kernel. You might, for example, use make menuconfig and
+ do the following:
+
+ o Go to Code maturity level options
+
+ o Enable Prompt for development and/or incomplete code/drivers
+
+ o hit ESC to return to the top-level menu
+
+ o Go to Processor type and features
+
+ o Select your processor type from Processor Family
+
+ o hit ESC to return to the top-level menu
+
+ o Go to Character devices
+
+ o Disable Direct Rendering Manager (XFree86 DRI support) since we'll
+ use the DRI code from the XFree86/DRI tree and will compile it
+ there.
+
+ o Go to /dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW)
+
+ o Hit SPACE twice to build AGP support into the kernel
+
+ o Enable all chipsets' support for AGP
+
+ o It's recommended that you turn on MTRRs under Processor type and
+ Features, but not required.
+
+ o Configure the rest of the kernel as required for your system (i.e. Eth-
+ ernet, SCSI, etc)
+
+ o Exit, saving your kernel configuration.
+
+ o Edit your /etc/lilo.conf file. Make sure you have an image entry as
+ follows (or similar):
+
+ image=/boot/vmlinuz
+ label=linux.2.4.x
+ read-only
+ root=/dev/hda1
+
+ The important part is that you have /boot/vmlinuz without a trailing
+ version number. If this is the first entry in your /etc/lilo.conf AND
+ you haven't set a default, then this will be your default kernel.
+
+ o Compile the new kernel.
+
+ cd /usr/src/linux-2.4.x
+ make dep
+ make bzImage
+ make modules
+ make modules_install
+ make install
+
+ Note that last make command will automatically run lilo for you.
+
+ o Now reboot to use the new kernel.
+
+5. CPU Architectures
+
+In general, nothing special has to be done to use the DRI on different CPU
+architectures. There are, however, a few optimizations that are CPU-depen-
+dent. Mesa will determine at runtime which CPU-dependent optimizations
+should be used and enable them where appropriate.
+
+5.1 Intel Pentium III Features
+
+The Pentium III SSE instructions are used in optimized vertex transformation
+functions in the Mesa-based DRI drivers. On Linux, SSE requires a recent
+kernel (such as 2.4.0-test11 or later) both at compile time and runtime.
+
+5.2 AMD 3DNow! Features
+
+AMD's 3DNow! instructions are used in optimized vertex transformation func-
+tions in the Mesa-based DRI drivers. 3DNow! is supported in most versions of
+Linux.
+
+5.3 Alpha Features
+
+On newer Alpha processors a significant performance increase can be seen with
+the addition of the -mcpu= option to GCC. This option is dependent on the
+architecture of the processor. For example, -mcpu=ev6 will build specifi-
+cally for the EV6 based AXP's, giving both byte and word alignment access to
+the DRI/Mesa drivers.
+
+To enable this optimization edit your xc/config/host.def file and add the
+line:
+
+#define DefaultGcc2AxpOpt -O2 -mcpu=ev6
+
+Additional speed improvements to 3D rendering can be achieved by installing
+Compaq's Math Libraries (CPML) which can be obtained from http://www.sup-
+port.compaq.com/alpha-tools/software/index.html
+
+Once installed, you can add this line to your host.def to build with the CPML
+libraries:
+
+#define UseCompaqMathLibrary YES
+
+The host.def file is explained below.
+
+6. Downloading the XFree86/DRI CVS Sources
+
+The DRI project is hosted by SourceForge. The DRI source code, which is a
+subset of the XFree86 source tree, is kept in a CVS repository there.
+
+The DRI CVS sources may be accessed either anonymously or as a registered
+SourceForge user. It's recommended that you become a registered SourceForge
+user so that you may submit non-anonymous bug reports and can participate in
+the mailing lists.
+
+6.1 Anonymous CVS download:
+
+ 1. Create a directory to store the CVS files:
+
+ cd ~
+ mkdir DRI-CVS
+
+ You could put your CVS directory in a different place but we'll use
+ ~/DRI-CVS/ here.
+
+ 2. Check out the CVS sources:
+
+ cd ~/DRI-CVS
+ cvs -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri login
+ (hit ENTER when prompted for a password)
+ cvs -z3 -d:pserver:anonymous@cvs.dri.sourceforge.net:/cvsroot/dri co xc
+
+ The -z3 flag causes compression to be used in order to reduce the down-
+ load time.
+
+6.2 Registered CVS download:
+
+ 1. Create a directory to store the CVS files:
+
+ cd ~
+ mkdir DRI-CVS
+
+ You could put your CVS directory in a different place but we'll use
+ ~/DRI-CVS/ here.
+
+ 2. Set the CVS_RSH environment variable:
+
+ setenv CVS_RSH ssh // if using csh or tcsh
+ export CVS_RSH=ssh // if using sh or bash
+
+ 3. Check out the CVS sources:
+
+ cd ~/DRI-CVS
+ cvs -z3 -d:ext:YOURID@cvs.dri.sourceforge.net:/cvsroot/dri co xc
+
+ Replace YOURID with your CVS login name. You'll be prompted to enter
+ your sourceforge password.
+
+ The -z3 flag causes compression to be used in order to reduce the down-
+ load time.
+
+6.3 Updating your CVS sources
+
+In the future you'll want to occasionally update your local copy of the DRI
+source code to get the latest changes. This can be done with:
+
+ cd ~/DRI-CVS
+ cvs -z3 update -dA xc
+
+The -d flag causes any new subdirectories to be created and -A causes most
+recent trunk sources to be fetched, not branch sources.
+
+7. Mesa
+
+Most of the DRI 3D drivers are based on Mesa (the free implementation of the
+OpenGL API). The relevant files from Mesa are already included in the
+XFree86/DRI source tree. There is no need to download or install the Mesa
+source files separately.
+
+Sometimes a newer version of Mesa will be available than the version included
+in XFree86/DRI. Upgrading Mesa within XFree86/DRI is not always straightfor-
+ward. It can be an error-prone undertaking, especially for beginners, and is
+not generally recommended. The DRI developers will upgrade Mesa when appro-
+priate.
+
+8. Compiling the XFree86/DRI tree
+
+8.1 Make a build tree
+
+Rather than placing object files and library files right in the source tree,
+they're instead put into a parallel build tree. The build tree is made with
+the lndir command:
+
+ cd ~/DRI-CVS
+ ln -s xc XFree40
+ mkdir build
+ cd build
+ lndir -silent -ignorelinks ../XFree40
+
+The build tree will be populated with symbolic links which point back into
+the CVS source tree.
+
+Advanced users may have several build trees for compiling and testing with
+different options.
+
+8.2 Edit the host.def file
+
+The ~/DRI-CVS/build/xc/config/cf/host.def file is used to configure the
+XFree86 build process. You can change it to customize your build options or
+make adjustments for your particular system configuration
+
+The default host.def file will look something like this:
+
+ #define DefaultCCOptions -Wall
+ (i386) #define DefaultGcc2i386Opt -O2
+ (Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar)
+ #define LibraryCDebugFlags -O2
+ #define BuildServersOnly YES
+ #define XF86CardDrivers vga tdfx mga ati i810
+ #define LinuxDistribution LinuxRedHat
+ #define DefaultCCOptions -ansi GccWarningOptions -pipe
+ #define BuildXF86DRI YES
+ /* Optionally turn these on for debugging */
+ /* #define GlxBuiltInTdfx YES */
+ /* #define GlxBuiltInMga YES */
+ /* #define GlxBuiltInR128 YES */
+ /* #define GlxBuiltInRadeon YES */
+ /* #define DoLoadableServer NO */
+ #define SharedLibFont NO
+
+The ProjectRoot variable specifies where the XFree86 files will be installed.
+We recommend installing the DRI files over your existing XFree86 installation
+- it's generally safe to do and less error-prone. This policy is different
+than what we used to recommend.
+
+If XFree86 4.x is not installed in /usr/X11R6/ you'll have to add the follow-
+ing to the host.def file:
+
+ #define ProjectRoot pathToYourXFree86installation
+
+Note the XF86CardDrivers line to be sure your card's driver is listed.
+
+If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you
+should add the following:
+
+ #define MesaUse3DNow YES
+
+You don't have to be using an AMD processor in order to enable this option.
+The DRI will look for 3DNow! support and runtime and only enable it if appli-
+cable.
+
+If you want to enable SSE optimizations in Mesa and the DRI drivers, you must
+upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by
+both your processor and your operating system, but to build Mesa inside the
+DRI you need to have the Linux 2.4.x kernel headers in /usr/src/linux. If
+you enable SSE optimizations with an earlier version of the Linux kernel in
+/usr/src/linux, Mesa will not compile. You have been warned. If you do have
+a 2.4.x kernel, you should add the following:
+
+ #define MesaUseSSE YES
+
+8.3 Compilation
+
+To compile the complete DRI tree:
+
+ cd ~/DRI-CVS/build/xc/
+ make World >& world.log
+
+Or if you want to watch the compilation progress:
+
+ cd ~/DRI-CVS/build/xc/
+ make World >& world.log &
+ tail -f world.log
+
+With the default compilation flags it's normal to get a lot of warnings dur-
+ing compilation.
+
+Building will take some time so you may want to go check your email or visit
+slashdot.
+
+WARNING: do not use the -j option with make. It's reported that it does not
+work with XFree86/DRI.
+
+8.4 Check for compilation errors
+
+Using your text editor, examine world.log for errors by searching for the
+pattern ***.
+
+Verify that the DRI kernel module(s) for your system were built:
+
+ cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
+ ls
+
+For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you
+should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI
+Radeon, you should see radeon.o. For the Intel i810, you should see i810.o.
+
+If the DRI kernel module(s) failed to build you should verify that you're
+using the right version of the Linux kernel. The most recent kernels are not
+always supported.
+
+If your build machine is running a different version of the kernel than your
+target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel
+headers. This can be fixed by explicitly setting the value of TREE. If the
+path to your kernel source is /usr/src/linux-2.4.x,
+
+ cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
+ make TREE=/usr/src/linux-2.4.x/include
+
+or alternatively, edit Makefile to include this change.
+
+After fixing the errors, run make World again. Later, you might just compile
+parts of the source tree but it's important that the whole tree will build
+first.
+
+8.5 DRI kernel module installation
+
+The DRI kernel modules will be in ~/DRI-CVS/build/xc/pro-
+grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/.
+
+To load the appropriate DRM module in your running kernel you can either use
+ismod and restart your X server or copy the kernel module to /lib/mod-
+ules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X
+server.
+
+Make sure you first unload any older DRI kernel modules that might be already
+loaded.
+
+Note that some DRM modules require that the agpgart module be loaded first.
+
+9. Normal Installation and Configuration
+
+Most users will want to install the new X server and use it in place of their
+old X server. This section explains how to do that.
+
+Developers, on the other hand, may just want to test the X server without
+actually installing it as their default server. If you want to do that, skip
+to the next section.
+
+9.1 Installation
+
+Here are the installation commands:
+
+ su
+ cd ~/DRI-CVS/build/xc
+ make install
+
+9.2 Update the XF86Config File
+
+You may need to edit your XF86Config file to enable the DRI. The config file
+is usually installed as /etc/X11/XF86Config-4. See the DRI User Guide for
+details, but basically, you need to load the "glx" and "dri" modules and add
+a "DRI" section.
+
+On the DRI web site, in the resources section, you'll find example XF86Config
+files for a number of graphics cards. These configuration files also setup
+DRI options so it's highly recommended that you look at these examples.
+
+The XFree86 4.x server can generate a basic configuration file itself. Sim-
+ply do this:
+
+ cd /usr/X11R6/bin
+ ./XFree86 -configure
+
+A file named /root/XF86Config.new will be created. It should allow you to
+try your X server but you'll almost certainly have to edit it. For example,
+you should add HorizSync and VertRefresh options to the Monitor section and
+Modes options to the Screen section. Also, the ModulePath option in the
+Files section should be set to /usr/X11R6/lib/modules.
+
+9.3 Start the New X Server
+
+The new X server should be ready to use now. Start your X server in your
+usual manner. Often times the startx command is used:
+
+ startx
+
+10. Testing the Server Without Installing It
+
+As mentioned at the start of section 9, developers may want to simply run the
+X server without installing it. This can save some time and allow you to
+keep a number of X servers available for testing.
+
+10.1 Configuration
+
+As described in the preceding section, you'll need to create a configuration
+file for the new server. Put the XF86Config file in your ~/DRI-
+CVS/build/xc/programs/Xserver directory.
+
+Be sure the ModulePath option in your XF86Config file is set correctly.
+
+10.2 A Startup Script
+
+A simple shell script can be used to start the X server. Here's an example.
+
+ #!/bin/sh
+ export DISPLAY=:0
+ ./XFree86 -xf86config XF86Config & \
+ sleep 2
+ fvwm2 &
+ xset b off
+ xmodmap -e "clear mod4"
+ xsetroot -solid "#00306f"
+ xterm -geometry 80x40+0+0
+
+You might name this script start-dri. Put it in your ~/DRI-CVS/build/xc/pro-
+grams/Xserver directory.
+
+To test the server run the script:
+
+ cd ~/DRI-CVS/build/xc/programs/Xserver
+ ./start-dri
+
+For debugging, you may also want to capture the log messages printed by the
+server in a file. If you're using the C-shell:
+
+ ./start-dri >& log
+
+11. Where To Go From Here
+
+At this point your X server should be up and running with hardware-acceler-
+ated direct rendering. Please read the DRI User Guide for information about
+trouble shooting and how to use the DRI-enabled X server for 3D applications.
+
+ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 2002/11/26 01:05:50 dawes Exp $
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.16 2002/11/26 02:24:01 dawes Exp $
diff --git a/hw/xfree86/doc/devel/Registry b/hw/xfree86/doc/devel/Registry
new file mode 100644
index 000000000..9c4111348
--- /dev/null
+++ b/hw/xfree86/doc/devel/Registry
@@ -0,0 +1,410 @@
+This is the XFree86 driver/module registry. To avoid name space clashes and
+to maintain some consistency between drivers the important name spaces are
+maintained here.
+
+1. Module Names.
+
+Each module is required to have a unique name. Registered names are:
+
+GLcore
+acecad
+afb
+apm
+ark
+ati
+atimisc
+bitmap
+bt8xx
+calcomp
+cfb
+cfb16
+cfb24
+cfb32
+chips
+cirrus
+citron
+cyrix
+dbe
+ddc
+digitaledge
+dmc
+dri
+drm
+dynapro
+elo2300
+elographics
+extmod
+fb
+fbdev
+fbdevhw
+fi12x6
+freetype
+glide
+glint
+glx
+hyperpen
+i128
+i2c
+i740
+i810
+imstt
+int10
+joystick
+keyboard
+layer
+magellan
+magictouch
+mfb
+mga
+microtouch
+mouse
+msp34xx
+mutouch
+neomagic
+newport
+nv
+pcidata
+penmount
+pex5
+r128
+radeon
+rac
+ramdac
+record
+rendition
+s3
+s3virge
+savage
+scanpci
+shadow
+shadowfb
+siliconmotion
+sis
+spaceorb
+speedo
+summa
+sunbw2
+suncg14
+suncg3
+suncg6
+sunffb
+sunleo
+suntcx
+tdfx
+tga
+trident
+tseng
+type1
+v4l
+vbe
+vesa
+vga
+vgahw
+vmware
+void
+wacom
+xaa
+xf1bpp
+xf24_32bpp
+xf4bpp
+xf8_16bpp
+xf8_32bpp
+xf8_32wid
+xie
+xtrap
+xtt
+
+2. External Module Object Symbols.
+
+Each module is required to use a unique prefix or prefixes for all of
+its externally visible symbols. They should be unique without regard to
+case. Registered prefixes are:
+
+ati
+bt8xx
+cfb
+chips
+fi12x6
+glide
+glint
+mfb
+mga
+msp34xx
+neo
+permedia
+tseng
+vga
+vgahw
+vmware
+xaa
+xf1bpp
+xf4bpp
+
+3. Chipset Names.
+
+Each video driver is required to use a unique set of chipset names. Case,
+white space and underscore characters are ignored when comparing chipset
+names. All names listed here are in lower case with all white space and
+underscores removed. Registered chipset names are:
+
+ati
+ativga
+ct64200
+ct64300
+ct65520
+ct65525
+ct65530
+ct65535
+ct65540
+ct65545
+ct65546
+ct65548
+ct65550
+ct65554
+ct65555
+ct68554
+ct69000
+et4000
+et4000w32
+et4000w32i
+et4000w32p
+et6000
+et6100
+generic
+ibmvga
+ibm8514
+mach32
+mach64
+mach8
+mga2064w
+mga1064sg
+mga2164w
+mga2164wagp
+neo2070
+neo2090
+neo2093
+neo2097
+neo2160
+neo2200
+tipm2
+vgawonder
+voodoo
+
+4. Option Names.
+
+Option names and their usage should be consistent between drivers.
+Case, white space and underscore characters are ignored when comparing
+option names. The prefix "no" may be added or removed from boolean
+option names. All names listed here are in their preferred user-visible
+form. Some registered option names are:
+
+Types are: B = boolean, O = set/unset (no value), I = integer, S = string,
+ A = optional string, F = floating point number Q = frequency
+
+Scopes are: F = global flags, V = video driver, C = common (per screen),
+ I = input drivers, X = XAA, Xv = Xv extension, M = misc.
+
+Names currently in use:
+
+Name Type Scope Description
+----------------------------------------------------------------------------
+AllowMouseOpenFail B F ignore mouse dev open failure
+AllowNonLocalModInDev B F allow non-local mod of input devs
+AllowNonLocalXvidtune B F allow non-local VidMode connections
+BlankTime I F Screen saver timeout (min)
+DisableModInDev B F disallow changing input devs
+DisableVidModeExtension B F disable VidMode extension
+DontVTSwitch B F disable Ctrl-Alt-Fn
+DontZap B F disable Ctrl-Alt-BS sequence
+DontZoom B F disable Ctrl-Alt-+/-
+NoTrapSignals B F don't trap signals
+OffTime I F Time before DPMS off mode active (min)
+PciProbe1 O F use PCI probe algorithm 1
+PciProbe2 O F use PCI probe algorithm 2
+PciForceConfig1 O F force PCI config type 1
+PciForceConfig2 O F force PCI config type 2
+Pixmap I F depth 24 pixmap size (24 or 32)
+StandbyTime I F Time before DPMS standby active (min)
+SuspendTime I F Time before DPMS suspend mode active (min)
+
+BackingStore B C Enable backing store
+DDC B C Enable/disable DDC
+DDC1 B C Enable/disable DDC1
+DDC2 B C Enable/disable DDC2
+DPMS O C Enable DPMS
+MTRR B C Enable/disable setting MTRRs
+
+BaudRate I I Serial port baud rate
+ButtonNumber I I Button number (for touch screen?)
+ButtonThreshold I I ??
+ClearDTR O I Clear serial port DTR
+ClearRTS O I Clear serial port RTS
+DataBits I I Serial port data bits
+DemandLoad O I ??
+Device S I Device file name
+DeviceName S I Input device name
+FlowControl S I Serial flow control ("xon", "none")
+HistorySize I I ??
+MaxX I I Maximum X coordinate
+MaxY I I Maximum Y coordinate
+MinX I I Minimum X coordinate
+MinY I I Minimum Y coordinate
+Parity S I Serial port parity ("odd", "even", "none")
+ReportDelay I I ??
+ReportingMode S I may be "raw" or "scaled"
+ScreenNumber I I Screen number (for touch screen)
+SendCoreEvents B I Send core events
+SendDragEvents B I Send drag events
+StopBits I I Serial port stop bits
+SwapXY B I Swap the X and Y axes
+UntouchDelay I I ??
+Vmin I I Tty VMIN
+Vtime I I Tty VTIME
+
+
+18BitBus B V ??
+8Plus16 B V Enable depth 8 + depth 16 with overlay
+8Plus24 B V Enable depth 8 + depth 24 with overlay
+BlockWrite B V Enable/disable block write
+ColorKey I V Set the color key for overlay modes
+CompositeSync B V Composite sync
+CRTDisplay B V Force display on CRT, not LCD
+CRTScreen B V Display on CRT, not LCD (Obsolete)
+EarlyRasPrecharge O V Early RAS pre-charge
+FastDRAM O V Fast DRAM
+FifoAggressive O V Aggressive FIFO setting
+FifoConservative O V Conservative FIFO setting
+FifoModerate O V Moderate FIFO setting
+FireGL3000 B V Card is Diamond FireGL3000
+FixPanelSize B V ??
+FPClock8 Q V Flat panel clock for 8bpp fb (MHz)
+FPClock16 Q V Flat panel clock for 16bpp fb (MHz)
+FPClock24 Q V Flat panel clock for 24bpp fb (MHz)
+FPClock32 Q V Flat panel clock for 32bpp fb (MHz)
+FPMVRAM O V Fast page mode VRAM
+FramebufferWC B V Enable/disable WC for the framebuffer
+GlideDevice I V Selects which Voodoo board to use
+HiBitHigh O V High clock bit default to set
+HiBitLow O V High clock bit default to cleared
+HWClocks B V Enable/disable HW clocks
+HWCursor B V Enable/disable HW cursor
+LateRasPrecharge O V Late RAS pre-charge
+Legend O V Card is Legend ET4000
+LCDCenter B V Enable/disable centering for LCD displays
+Linear B V Enable/disable linear framebuffer
+MCLK Q V Specify the current MCLK value (MHz)
+MedDRAM B V Medium speed DRAM
+MemCfg1 I V ??
+MemCfg2 I V ??
+MGASDRAM B V Mga card has SDRAM
+MMIO B V Enable/disable memory mapped I/O
+MMIOCache B V Enable/Disable MMIO cache
+MuxThreshold I V Multiplexing threshold (kHz)
+NoAccel B V Disable/enable acceleration
+NoClockChip B V ??
+NoStretch B V Disable/enable stretching for LCD displays
+OnAtExit B V Leave video signal on when exiting server
+OverclockMem B V Enable memory overclocking
+Overlay A V Enable multi-depth/overlay. An optional
+ string "M,N" may be specified, where
+ M, N are the depths.
+PanelDisplay B V Force display on LCD
+PciBurst B V Enable/disable PCI burst mode
+PciRetry B V Enable/disable PCI retries
+ProbeClocks B V Force probe for non-programmable clocks
+ReferenceClock Q V Clock generator reference frequency
+RGBbits I V Number of significant bits per rgb
+Rotate S V Rotate the virtual display (CW or CCW)
+SetLCDClk Q V Set LCD clock (MHz)
+SetMclk Q V Set Memory Clock (MHz)
+ShadowFB B V Enable shadow framebuffer layer
+ShowCache B V Enable viewing of offscreen memory
+ShowOverscan O V Set the overscan area to a visible colour
+SlowDRAM O V Slow DRAM
+SlowEDODRAM O V Slow EDO DRAM
+STN B V STN screen type (??)
+SWCursor B V Enable/disable SW cursor
+SuspendHack B V ??
+SyncOnGreen B V Enable/disable sync on green
+TurboQueue B V Enable/disable turbo queue
+UseFBDev B V Use the fbdev driver interface
+UseModeLine B V Use Modeline (??)
+W32Interleave B V ??
+
+Buffers I Xv Number of buffers
+Device S Xv Device file name
+Expose B Xv Disable occlusion clipping (see DESIGN)
+FramesPerSec I Xv Max. refresh frequency
+
+XAA options. All are of type "O" and scope "X", and are self-explanatory
+
+XaaNoColor8x8PatternFillRect
+XaaNoColor8x8PatternFillTrap
+XaaNoCPUToScreenColorExpandFill
+XaaNoDashedBresenhamLine
+XaaNoDashedTwoPointLine
+XaaNoScreenToScreenCopy
+XaaNoImageReadRect
+XaaNoImageWriteRect
+XaaNoMono8x8PatternFillRect
+XaaNoMono8x8PatternFillTrap
+XaaNoOffscreenPixmaps
+XaaNoPixmapCache
+XaaNoScanlineCPUToScreenColorExpandFill
+XaaNoScanlineImageWriteRect
+XaaNoScreenToScreenColorExpandFill
+XaaNoSolidBresenhamLine
+XaaNoSolidFillRect
+XaaNoSolidFillTrap
+XaaNoSolidHorVertLine
+XaaNoSolidTwoPointLine
+
+
+Names used in previous versions:
+
+16Clocks
+8Clocks
+ClkDiv2
+EDO VRAM
+ExternDisp
+ExtFramBuf
+FastVRAM
+FavorBitBlt
+InternDisp
+NoBitBlt
+NoFontCache
+NoImageBlt
+NoMemAccess
+NoPciDisconnect
+NoPixmapCache
+NoProgramClocks
+NoSplitXfer
+OverrideBIOS
+OverrideValidateMode
+ProgLcdModeRegs
+ProgLcdModeStretch
+SlowDRAMrefresh
+SlowVRAM
+SwapHiBit
+
+
+5. Ramdac Names.
+
+Ramdac names should be consistent between drivers. Case, white space
+and underscore characters are ignored when comparing ramdac names. All
+names listed here are in lower case with all white space and underscores
+removed.
+
+
+6. Clock Chip Names.
+
+Clock chip names should be consistent between drivers. Case, white
+space and underscore characters are ignored when comparing clock chip
+names. All names listed here are in lower case with all white space
+and underscores removed.
+
+
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/Registry,v 1.19 2003/02/20 04:05:12 dawes Exp $
diff --git a/hw/xfree86/doc/sgml/DESIGN.sgml b/hw/xfree86/doc/sgml/DESIGN.sgml
new file mode 100644
index 000000000..322ab00e0
--- /dev/null
+++ b/hw/xfree86/doc/sgml/DESIGN.sgml
@@ -0,0 +1,7415 @@
+<!DOCTYPE linuxdoc PUBLIC "-//XFree86//DTD linuxdoc//EN" [
+ <!-- config file keyword markup -->
+ <!ENTITY s.key STARTTAG "bf">
+ <!ENTITY e.key ENDTAG "bf">
+ <!-- specific config file keywords -->
+ <!ENTITY k.device "&s.key;Device&e.key;">
+ <!ENTITY k.monitor "&s.key;Monitor&e.key;">
+ <!ENTITY k.display "&s.key;Display&e.key;">
+ <!ENTITY k.inputdevice "&s.key;InputDevice&e.key;">
+ <!ENTITY k.screen "&s.key;Screen&e.key;">
+ <!ENTITY k.serverlayout "&s.key;ServerLayout&e.key;">
+ <!ENTITY k.driver "&s.key;Driver&e.key;">
+ <!ENTITY k.module "&s.key;Module&e.key;">
+ <!ENTITY k.identifier "&s.key;Identifier&e.key;">
+ <!ENTITY k.serverflags "&s.key;ServerFlags&e.key;">
+ <!-- command line markup -->
+ <!ENTITY s.cmd STARTTAG "tt">
+ <!ENTITY e.cmd ENDTAG "tt">
+ <!-- inline code markup -->
+ <!ENTITY s.code STARTTAG "tt">
+ <!ENTITY e.code ENDTAG "tt">
+ <!-- function indent -->
+ <!ENTITY f.indent "&nl&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp">
+] >
+
+<article>
+
+<title>XFree86 X server ``New Design'' (DRAFT)
+<author>The XFree86 Project, Inc
+<date>Last modified 2003 January 22
+
+
+
+
+
+
+
+<ident>
+$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.52 2003/02/25 19:31:00 dawes Exp $
+</ident>
+
+
+<p>
+<bf>NOTE</bf>: This is a DRAFT document, and the interfaces described here
+are subject to change without notice.
+
+
+<sect>Preface
+<p>
+
+The broad design principles are:
+<itemize>
+ <item>keep it reasonable
+ <itemize>
+ <item>We cannot rewrite the complete server
+ <item>We don't want to re-invent the wheel
+ </itemize>
+ <item>keep it modular
+ <itemize>
+ <item>As many things as possible should go into modules
+ <item>The basic loader binary should be minimal
+ <item>A clean design with well defined layering is important
+ <item>DDX specific global variables are a nono
+ <item>The structure should be flexible enough to allow
+ future extensions
+ <item> The structure should minimize duplication of common code
+ </itemize>
+ <item>keep important features in mind
+ <itemize>
+ <item>multiple screens, including multiple instances of drivers
+ <item>mixing different color depths and visuals on different
+ and ideally even on the same screen
+ <item>better control of the PCI device used
+ <item>better config file parser
+ <item>get rid of all VGA compatibility assumptions
+ </itemize>
+</itemize>
+
+Unless we find major deficiencies in the DIX layer, we should avoid
+making changes there.
+
+<sect>The XF86Config File
+<p>
+
+The XF86Config file format is similar to the old format, with the following
+changes:
+
+<sect1>&k.device; section
+<p>
+
+ The &k.device; sections are similar to what they used to be, and
+ describe hardware-specific information for a single video card.
+ &k.device;
+ Some new keywords are added:
+
+
+ <descrip>
+ <tag>Driver "drivername"</tag>
+ Specifies the name of the driver to be used for the card. This
+ is mandatory.
+ <tag>BusID "busslot"</tag>
+ Specifies uniquely the location of the card on the bus. The
+ purpose is to identify particular cards in a multi-headed
+ configuration. The format of the argument is intentionally
+ vague, and may be architecture dependent. For a PCI bus, it
+ is something like "bus:slot:func".
+ </descrip>
+
+ A &k.device; section is considered ``active'' if there is a reference
+ to it in an active &k.screen; section.
+
+<sect1>&k.screen; section
+<p>
+
+ The &k.screen; sections are similar to what they used to be. They
+ no longer have a &k.driver; keyword, but an &k.identifier; keyword
+ is added. (The &k.driver; keyword may be accepted in place of the
+ &k.identifier; keyword for compatibility purposes.) The identifier
+ can be used to identify which screen is to be active when multiple
+ &k.screen sections are present. It is possible to specify the active
+ screen from the command line. A default is chosen in the absence
+ of one being specified. A &k.screen; section is considered ``active''
+ if there is a reference to it either from the command line, or from
+ an active &k.serverlayout; section.
+
+<sect1>&k.inputdevice; section
+<p>
+
+ The &k.inputdevice; section is a new section that describes
+ configuration information for input devices. It replaces the old
+ &s.key;Keyboard&e.key;, &s.key;Pointer&e.key; and &s.key;XInput&e.key;
+ sections. Like the &k.device; section, it has two mandatory keywords:
+ &k.identifier; and &k.driver;. For compatibility purposes the old
+ &s.key;Keyboard&e.key; and &s.key;Pointer&e.key; sections are
+ converted by the parser into &k.inputdevice; sections as follows:
+
+ <descrip>
+ <tag>&s.key;Keyboard&e.key;</tag>
+ &k.identifier; "Implicit Core Keyboard"<newline>
+ &k.driver; "keyboard"
+ <tag>&s.key;Pointer&e.key;</tag>
+ &k.identifier; "Implicit Core Pointer"<newline>
+ &k.driver; "mouse"
+ </descrip>
+
+ An &k.inputdevice; section is considered active if there is a
+ reference to it in an active &k.serverlayout; section. An
+ &k.inputdevice; section may also be referenced implicitly if there
+ is no &k.serverlayout; section, if the &s.cmd;-screen&e.cmd; command
+ line options is used, or if the &k.serverlayout; section doesn't
+ reference any &k.inputdevice; sections. In this case, the first
+ sections with drivers "keyboard" and "mouse" are used as the core
+ keyboard and pointer respectively.
+
+<sect1>&k.serverlayout; section
+<p>
+
+ The &k.serverlayout; section is a new section that is used to identify
+ which &k.screen; sections are to be used in a multi-headed configuration,
+ and the relative layout of those screens. It also identifies which
+ &k.inputdevice; sections are to be used. Each &k.serverlayout section
+ has an identifier, a list of &k.screen; section identifiers, and a list of
+ &k.inputdevice; section identifiers. &k.serverflags; options may also be
+ included in a &k.serverlayout; section, making it possible to override
+ the global values in the &k.serverflags; section.
+
+ A &k.serverlayout; section can be made active by being referenced on
+ the command line. In the absence of this, a default will be chosen
+ (the first one found). The screen names may optionally be followed
+ by a number specifying the preferred screen number, and optionally
+ by information specifying the physical positioning of the screen,
+ either in absolute terms or relative to another screen (or screens).
+ When no screen number is specified, they are numbered according to
+ the order in which they are listed. The old (now obsolete) method
+ of providing the positioning information is to give the names of
+ the four adjacent screens. The order of these is top, bottom, left,
+ right. Here is an example of a &k.serverlayout; section for two
+ screens using the old method, with the second located to the right
+ of the first:
+
+ <code>
+ Section "ServerLayout"
+ Identifier "Main Layout"
+ Screen 0 "Screen 1" "" "" "" "Screen 2"
+ Screen 1 "Screen 2"
+ Screen "Screen 3"
+ EndSection
+ </code>
+
+ The preferred way of specifying the layout is to explicitly specify
+ the screen's location in absolute terms or relative to another
+ screen.
+
+ In the absolute case, the upper left corner's coordinates are given
+ after the &s.key;Absolute&e.key; keyword. If the coordinates are
+ omitted, a value of &s.code;(0,0)&e.code; is assumed. An example
+ of absolute positioning follows:
+
+ <code>
+ Section "ServerLayout"
+ Identifier "Main Layout"
+ Screen 0 "Screen 1" Absolute 0 0
+ Screen 1 "Screen 2" Absolute 1024 0
+ Screen "Screen 3" Absolute 2048 0
+ EndSection
+ </code>
+
+ In the relative case, the position is specified by either using one of
+ the following keywords followed by the name of the reference screen:
+
+ <quote>
+ &s.key;RightOf&nl;
+ LeftOf&nl;
+ Above&nl;
+ Below&nl;
+ Relative&e.key;
+ </quote>
+
+ When the &s.key;Relative&e.key; keyword is used, the reference screen
+ name is followed by the coordinates of the new screen's origin
+ relative to reference screen. The following example shows how to use
+ some of the relative positioning options.
+
+ <code>
+ Section "ServerLayout"
+ Identifier "Main Layout"
+ Screen 0 "Screen 1"
+ Screen 1 "Screen 2" RightOf "Screen 1"
+ Screen "Screen 3" Relative "Screen 1" 2048 0
+ EndSection
+ </code>
+
+<sect1>Options
+<p>
+
+ Options are used more extensively. They may appear in most sections
+ now. Options related to drivers can be present in the &k.screen;,
+ &k.device; and &k.monitor; sections and the &k.display; subsections.
+ The order of precedence is &k.display;, &k.screen;, &k.monitor;,
+ &k.device;. Options have been extended to allow an optional value
+ to be specified in addition to the option name. For more details
+ about options, see the <ref id="options" name="Options"> section
+ for details.
+
+<sect>Driver Interface
+<p>
+
+The driver interface consists of a minimal set of entry points that are
+required based on the external events that the driver must react to.
+No non-essential structure is imposed on the way they are used beyond
+that. This is a significant difference compared with the old design.
+
+The entry points for drawing operations are already taken care of by
+the framebuffer code (including, XAA). Extensions and enhancements to
+framebuffer code are outside the scope of this document.
+
+This approach to the driver interface provides good flexibility, but does
+increase the complexity of drivers. To help address this, the XFree86
+common layer provides a set of ``helper'' functions to take care of things
+that most drivers need. These helpers help minimise the amount of code
+duplication between drivers. The use of helper functions by drivers is
+however optional, though encouraged. The basic philosophy behind the
+helper functions is that they should be useful to many drivers, that
+they should balance this against the complexity of their interface. It
+is inevitable that some drivers may find some helpers unsuitable and
+need to provide their own code.
+
+Events that a driver needs to react to are:
+
+ <descrip>
+ <tag>ScreenInit</tag>
+
+ An initialisation function is called from the DIX layer for each
+ screen at the start of each server generation.
+
+ <tag>Enter VT</tag>
+
+ The server takes control of the console.
+
+ <tag>Leave VT</tag>
+
+ The server releases control of the console.
+
+ <tag>Mode Switch</tag>
+
+ Change video mode.
+
+ <tag>ViewPort change</tag>
+
+ Change the origin of the physical view port.
+
+ <tag>ScreenSaver state change</tag>
+
+ Screen saver activation/deactivation.
+
+ <tag>CloseScreen</tag>
+
+ A close screen function is called from the DIX layer for each screen
+ at the end of each server generation.
+ </descrip>
+
+
+In addition to these events, the following functions are required by
+the XFree86 common layer:
+
+ <descrip>
+ <tag>Identify</tag>
+
+ Print a driver identifying message.
+
+ <tag>Probe</tag>
+
+ This is how a driver identifies if there is any hardware present that
+ it knows how to drive.
+
+ <tag>PreInit</tag>
+
+ Process information from the XF86Config file, determine the
+ full characteristics of the hardware, and determine if a valid
+ configuration is present.
+ </descrip>
+
+The VidMode extension also requires:
+
+ <descrip>
+ <tag>ValidMode</tag>
+
+ Identify if a new mode is usable with the current configuration.
+ The PreInit function (and/or helpers it calls) may also make use
+ of the ValidMode function or something similar.
+ </descrip>
+
+
+Other extensions may require other entry points. The drivers will
+inform the common layer of these in such cases.
+
+<sect>Resource Access Control Introduction
+<p>
+
+Graphics devices are accessed through ranges in I/O or memory space.
+While most modern graphics devices allow relocation of such ranges many
+of them still require the use of well established interfaces such as
+VGA memory and IO ranges or 8514/A IO ranges. With modern buses (like
+PCI) it is possible for multiple video devices to share access to these
+resources. The RAC (Resource Access Control) subsystem provides a
+mechanism for this.
+
+<sect1>Terms and Definitions
+<p>
+
+<sect2>Bus
+<p>
+
+ ``Bus'' is ambiguous as it is used for different things: it may refer
+ to physical incompatible extension connectors in a computer system.
+ The RAC system knows two such systems: The ISA bus and the PCI bus.
+ (On the software level EISA, MCA and VL buses are currently treated
+ like ISA buses). ``Bus'' may also refer to logically different
+ entities on a single bus system which are connected via bridges. A
+ PCI system may have several distinct PCI buses connecting each other
+ by PCI-PCI bridges or to the host CPU by HOST-PCI bridges.
+
+ Systems that host more than one bus system link these together using
+ bridges. Bridges are a concern to RAC as they might block or pass
+ specific resources. PCI-PCI bridges may be set up to pass VGA
+ resources to the secondary bus. PCI-ISA buses pass any resources not
+ decoded on the primary PCI bus to the ISA bus. This way VGA resources
+ (although exclusive on the ISA bus) can be shared by ISA and PCI
+ cards. Currently HOST-PCI bridges are not yet handled by RAC as they
+ require specific drivers.
+
+<sect2>Entity
+<p>
+
+ The smallest independently addressable unit on a system bus is
+ referred to as an entity. So far we know ISA and PCI entities. PCI
+ entities can be located on the PCI bus by an unique ID consisting of
+ the bus, card and function number.
+
+<sect2>Resource
+<p>
+
+ ``Resource'' refers to a range of memory or I/O addresses an entity
+ can decode.
+
+ If a device is capable of disabling this decoding the resource is
+ called sharable. For PCI devices a generic method is provided to
+ control resource decoding. Other devices will have to provide a
+ device specific function to control decoding.
+
+ If the entity is capable of decoding this range at a different
+ location this resource is considered relocatable.
+
+ Resources which start at a specific address and occupy a single
+ continuous range are called block resources.
+
+ Alternatively resource addresses can be decoded in a way that they
+ satisfy the conditions:
+ <quote><verb>
+ address & mask == base
+ </verb></quote>
+ and
+ <quote><verb>
+ base & mask == base
+ </verb></quote>
+ Resources addressed in such a way are called sparse resources.
+
+<sect2>Server States
+<p>
+
+ The resource access control system knows two server states: the
+ SETUP and the OPERATING state. The SETUP state is entered whenever
+ a mode change takes place or the server exits or does VT switching.
+ During this state all entity resources are under resource access
+ control. During OPERATING state only those entities are controlled
+ which actually have shared resources that conflict with others.
+
+<sect>Control Flow in the Server and Mandatory Driver Functions
+<p>
+
+At the start of each server generation, &s.code;main()&e.code;
+(&s.code;dix/main.c&e.code;) calls the DDX function
+&s.code;InitOutput()&e.code;. This is the first place that the DDX gets
+control. &s.code;InitOutput()&e.code; is expected to fill in the global
+&s.code;screenInfo&e.code; struct, and one
+&s.code;screenInfo.screen[]&e.code; entry for each screen present. Here
+is what &s.code;InitOutput()&e.code; does:
+
+<sect1>Parse the XF86Config file
+<p>
+
+ This is done at the start of the first server generation only.
+
+ The XF86Config file is read in full, and the resulting information
+ stored in data structures. None of the parsed information is
+ processed at this point. The parser data structures are opaque to
+ the video drivers and to most of the common layer code.
+
+ The entire file is parsed first to remove any section ordering
+ requirements.
+
+
+<sect1>Initial processing of parsed information and command line options
+<p>
+
+ This is done at the start of the first server generation only.
+
+ The initial processing is to determine paths like the
+ &s.key;ModulePath&e.key;, etc, and to determine which &k.serverlayout;,
+ &k.screen; and &k.device; sections are active.
+
+
+<sect1>Enable port I/O access
+<p>
+
+ Port I/O access is controlled from the XFree86 common layer, and is
+ ``all or nothing''. It is enabled prior to calling driver probes, at
+ the start of subsequent server generations, and when VT switching
+ back to the Xserver. It is disabled at the end of server generations,
+ and when VT switching away from the Xserver.
+
+ The implementation details of this may vary on different platforms.
+
+
+<sect1>General bus probe
+<p>
+
+ This is done at the start of the first server generation only.
+
+ In the case of ix86 machines, this will be a general PCI probe.
+ The full information obtained here will be available to the drivers.
+ This information persists for the life of the Xserver. In the PCI
+ case, the PCI information for all video cards found is available by
+ calling &s.code;xf86GetPciVideoInfo()&e.code;.
+
+ <quote>
+ &s.code;pciVideoPtr *xf86GetPciVideoInfo(void)&e.code;
+ <quote><p>
+ returns a pointer to a list of pointers to
+ &s.code;pciVideoRec&e.code; entries, of which there is one for
+ each detected PCI video card. The list is terminated with a
+ &s.code;NULL&e.code; pointer. If no PCI video cards were
+ detected, the return value is &s.code;NULL&e.code;.
+
+ </quote>
+ </quote>
+
+ After the bus probe, the resource broker is initialised.
+
+
+<sect1>Load initial set of modules
+<p>
+
+ This is done at the start of the first server generation only.
+
+ The core server contains a list of mandatory modules. These are loaded
+ first. Currently the only module on this list is the bitmap font module.
+
+ The next set of modules loaded are those specified explicitly in the
+ &k.module; section of the config file.
+
+ The final set of initial modules are the driver modules referenced
+ by the active &k.device; and &k.inputdevice; sections in the config
+ file. Each of these modules is loaded exactly once.
+
+
+<sect1>Register Video and Input Drivers
+<p>
+
+ This is done at the start of the first server generation only.
+
+ When a driver module is loaded, the loader calls its
+ &s.code;Setup&e.code; function. For video drivers, this function
+ calls &s.code;xf86AddDriver()&e.code; to register the driver's
+ &s.code;DriverRec&e.code;, which contains a small set of essential
+ details and driver entry points required during the early phase of
+ &s.code;InitOutput()&e.code;. &s.code;xf86AddDriver()&e.code; adds
+ it to the global &s.code;xf86DriverList[]&e.code; array.
+
+ The &s.code;DriverRec&e.code; contains the driver canonical name,
+ the &s.code;Identify()&e.code;,
+ &s.code;Probe()&e.code; and &s.code;AvailableOptions()&e.code;
+ function entry points as well as a pointer
+ to the driver's module (as returned from the loader when the driver
+ was loaded) and a reference count which keeps track of how many
+ screens are using the driver. The entry driver entry points are
+ those required prior to the driver allocating and filling in its
+ &s.code;ScrnInfoRec&e.code;.
+
+ For a static server, the &s.code;xf86DriverList[]&e.code; array is
+ initialised at build time, and the loading of modules is not done.
+
+ A similar procedure is used for input drivers. The input driver's
+ &s.code;Setup&e.code; function calls
+ &s.code;xf86AddInputDriver()&e.code; to register the driver's
+ &s.code;InputDriverRec&e.code;, which contains a small set of
+ essential details and driver entry points required during the early
+ phase of &s.code;InitInput()&e.code;.
+ &s.code;xf86AddInputDriver()&e.code; adds it to the global
+ &s.code;xf86InputDriverList[]&e.code; array. For a static server,
+ the &s.code;xf86InputDriverList[]&e.code; array is initialised at
+ build time.
+
+ Both the &s.code;xf86DriverList[]&e.code; and
+ &s.code;xf86InputDriverList[]&e.code; arrays have been initialised
+ by the end of this stage.
+
+ Once all the drivers are registered, their
+ &s.code;ChipIdentify()&e.code; functions are called.
+
+ <quote>
+ &s.code;void ChipIdentify(int flags)&e.code;
+ <quote>
+ This is expected to print a message indicating the driver name,
+ a short summary of what it supports, and a list of the chipset
+ names that it supports. It may use the xf86PrintChipsets() helper
+ to do this.
+ </quote>
+ </quote>
+
+ <quote>
+ &s.code;void xf86PrintChipsets(const char *drvname, const char *drvmsg,
+ &f.indent;SymTabPtr chips)&e.code;
+ <quote>
+ This function provides an easy way for a driver's ChipIdentify
+ function to format the identification message.
+ </quote>
+ </quote>
+
+<sect1>Initialise Access Control
+<p>
+
+ This is done at the start of the first server generation only.
+
+ The Resource Access Control (RAC) subsystem is initialised before
+ calling any driver functions that may access hardware. All generic
+ bus information is probed and saved (for restoration later). All
+ (shared resource) video devices are disabled at the generic bus
+ level, and a probe is done to find the ``primary'' video device. These
+ devices remain disabled for the next step.
+
+
+<sect1>Video Driver Probe<label id="probe">
+<p>
+ This is done at the start of the first server generation only. The
+ &s.code;ChipProbe()&e.code; function of each registered video driver
+ is called.
+
+ <quote><p>
+ &s.code;Bool ChipProbe(DriverPtr drv, int flags)&e.code;
+ <quote><p>
+ The purpose of this is to identify all instances of hardware
+ supported by the driver. The flags value is currently either 0,
+ &s.code;PROBE_DEFAULT&e.code; or &s.code;PROBE_DETECT&e.code;.
+ &s.code;PROBE_DETECT&e.code; is used if "-configure" or "-probe"
+ command line arguments are given and indicates to the
+ &s.code;Probe()&e.code; function that it should not configure the
+ bus entities and that no XF86Config information is available.
+
+ The probe must find the active device sections that match the
+ driver by calling &s.code;xf86MatchDevice()&e.code;. The number
+ of matches found limits the maximum number of instances for this
+ driver. If no matches are found, the function should return
+ &s.code;FALSE&e.code; immediately.
+
+ Devices that cannot be identified by using device-independent
+ methods should be probed at this stage (keeping in mind that access
+ to all resources that can be disabled in a device-independent way
+ are disabled during this phase). The probe must be a minimal
+ probe. It should just determine if there is a card present that
+ the driver can drive. It should use the least intrusive probe
+ methods possible. It must not do anything that is not essential,
+ like probing for other details such as the amount of memory
+ installed, etc. It is recommended that the
+ &s.code;xf86MatchPciInstances()&e.code; helper function be used
+ for identifying matching PCI devices, and similarly the
+ &s.code;xf86MatchIsaInstances()&e.code; for ISA (non-PCI) devices
+ (see the <ref id="rac" name="RAC"> section). These helpers also
+ checks and claims the appropriate entity. When not using the
+ helper, that should be done with &s.code;xf86CheckPciSlot()&e.code;
+ and &s.code;xf86ClaimPciSlot()&e.code; for PCI devices and
+ &s.code;xf86ClaimIsaSlot()&e.code; for ISA devices (see the
+ <ref id="rac" name="RAC"> section).
+
+ The probe must register all non-relocatable resources at this
+ stage. If a resource conflict is found between exclusive resources
+ the driver will fail immediately. This is usually best done with
+ the &s.code;xf86ConfigPciEntity()&e.code; helper function
+ for PCI and &s.code;xf86ConfigIsaEntity()&e.code; for ISA
+ (see the <ref id="rac" name="RAC"> section). It is possible to
+ register some entity specific functions with those helpers. When
+ not using the helpers, the &s.code;xf86AddEntityToScreen()&e.code;
+ &s.code;xf86ClaimFixedResources()&e.code; and
+ &s.code;xf86SetEntityFuncs()&e.code; should be used instead (see
+ the <ref id="rac" name="RAC"> section).
+
+ If a chipset is specified in an active device section which the
+ driver considers relevant (ie it has no driver specified, or the
+ driver specified matches the driver doing the probe), the Probe
+ must return &s.code;FALSE&e.code; if the chipset doesn't match
+ one supported by the driver.
+
+ If there are no active device sections that the driver considers
+ relevant, it must return &s.code;FALSE&e.code;.
+
+ Allocate a &s.code;ScrnInfoRec&e.code; for each active instance of the
+ hardware found, and fill in the basic information, including the
+ other driver entry points. This is best done with the
+ &s.code;xf86ConfigIsaEntity()&e.code; helper function for ISA
+ instances or &s.code;xf86ConfigPciEntity()&e.code; for PCI instances.
+ These functions allocate a &s.code;ScrnInfoRec&e.code; for active
+ entities. Optionally &s.code;xf86AllocateScreen()&e.code;
+ function may also be used to allocate the &s.code;ScrnInfoRec&e.code;.
+ Any of these functions take care of initialising fields to defined
+ ``unused'' values.
+
+ Claim the entities for each instance of the hardware found. This
+ prevents other drivers from claiming the same hardware.
+
+ Must leave hardware in the same state it found it in, and must not
+ do any hardware initialisation.
+
+ All detection can be overridden via the config file, and that
+ parsed information is available to the driver at this stage.
+
+ Returns &s.code;TRUE&e.code; if one or more instances are found,
+ and &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+
+ &s.code;int xf86MatchDevice(const char *drivername,
+ &f.indent;GDevPtr **driversectlist)&e.code;
+ <quote><p>
+
+ This function takes the name of the driver and returns via
+ &s.code;driversectlist&e.code; a list of device sections that
+ match the driver name. The function return value is the number
+ of matches found. If a fatal error is encountered the return
+ value is &s.code;-1&e.code;.
+
+ The caller should use &s.code;xfree()&e.code; to free
+ &s.code;*driversectlist&e.code; when it is no longer needed.
+
+ </quote>
+
+ &s.code;ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags)&e.code;
+ <quote><p>
+ This function allocates a new &s.code;ScrnInfoRec&e.code; in the
+ &s.code;xf86Screens[]&e.code; array. This function is normally
+ called by the video driver &s.code;ChipProbe()&e.code; functions.
+ The return value is a pointer to the newly allocated
+ &s.code;ScrnInfoRec&e.code;. The &s.code;scrnIndex&e.code;,
+ &s.code;origIndex&e.code;, &s.code;module&e.code; and
+ &s.code;drv&e.code; fields are initialised. The reference count
+ in &s.code;drv&e.code; is incremented. The storage for any
+ currently allocated ``privates'' pointers is also allocated and
+ the &s.code;privates&e.code; field initialised (the privates data
+ is of course not allocated or initialised). This function never
+ returns on failure. If the allocation fails, the server exits
+ with a fatal error. The flags value is not currently used, and
+ should be set to zero.
+ </quote>
+ </quote>
+
+ At the completion of this, a list of &s.code;ScrnInfoRecs&e.code;
+ have been allocated in the &s.code;xf86Screens[]&e.code; array, and
+ the associated entities and fixed resources have been claimed. The
+ following &s.code;ScrnInfoRec&e.code; fields must be initialised at
+ this point:
+
+ <quote><verb>
+ driverVersion
+ driverName
+ scrnIndex(*)
+ origIndex(*)
+ drv(*)
+ module(*)
+ name
+ Probe
+ PreInit
+ ScreenInit
+ EnterVT
+ LeaveVT
+ numEntities
+ entityList
+ access
+ </verb></quote>
+
+ <tt>(*)</tt> These are initialised when the &s.code;ScrnInfoRec&e.code;
+ is allocated, and not explicitly by the driver.
+
+ The following &s.code;ScrnInfoRec&e.code; fields must be initialised
+ if the driver is going to use them:
+
+ <quote><verb>
+ SwitchMode
+ AdjustFrame
+ FreeScreen
+ ValidMode
+ </verb></quote>
+
+<sect1>Matching Screens
+<p>
+
+ This is done at the start of the first server generation only.
+
+ After the Probe phase is finished, there will be some number of
+ &s.code;ScrnInfoRecs&e.code;. These are then matched with the active
+ &k.screen; sections in the XF86Config, and those not having an active
+ &k.screen; section are deleted. If the number of remaining screens
+ is 0, &s.code;InitOutput()&e.code; sets
+ &s.code;screenInfo.numScreens&e.code; to &s.code;0&e.code; and
+ returns.
+
+ At this point the following fields of the &s.code;ScrnInfoRecs&e.code;
+ must be initialised:
+
+ <quote><verb>
+ confScreen
+ </verb></quote>
+
+
+<sect1>Allocate non-conflicting resources
+<p>
+
+ This is done at the start of the first server generation only.
+
+ Before calling the drivers again, the resource information collected
+ from the Probe phase is processed. This includes checking the extent
+ of PCI resources for the probed devices, and resolving any conflicts
+ in the relocatable PCI resources. It also reports conflicts, checks
+ bus routing issues, and anything else that is needed to enable the
+ entities for the next phase.
+
+ If any drivers registered an &s.code;EntityInit()&e.code; function
+ during the Probe phase, then they are called here.
+
+
+<sect1>Sort the Screens and pre-check Monitor Information
+<p>
+
+ This is done at the start of the first server generation only.
+
+ The list of screens is sorted to match the ordering requested in the
+ config file.
+
+ The list of modes for each active monitor is checked against the
+ monitor's parameters. Invalid modes are pruned.
+
+
+<sect1>PreInit
+<p>
+
+ This is done at the start of the first server generation only.
+
+ For each &s.code;ScrnInfoRec&e.code;, enable access to the screens entities and call
+ the &s.code;ChipPreInit()&e.code; function.
+
+ <quote><p>
+ &s.code;Bool ChipPreInit(ScrnInfoRec screen, int flags)&e.code;
+ <quote><p>
+ The purpose of this function is to find out all the information
+ required to determine if the configuration is usable, and to
+ initialise those parts of the &s.code;ScrnInfoRec&e.code; that
+ can be set once at the beginning of the first server generation.
+
+ The number of entities registered for the screen should be checked
+ against the expected number (most drivers expect only one). The
+ entity information for each of them should be retrieved (with
+ &s.code;xf86GetEntityInfo()&e.code;) and checked for the correct
+ bus type and that none of the sharable resources registered during
+ the Probe phase was rejected.
+
+ Access to resources for the entities that can be controlled in a
+ device-independent way are enabled before this function is called.
+ If the driver needs to access any resources that it has disabled
+ in an &s.code;EntityInit()&e.code; function that it registered,
+ then it may enable them here providing that it disables them before
+ this function returns.
+
+ This includes probing for video memory, clocks, ramdac, and all
+ other HW info that is needed. It includes determining the
+ depth/bpp/visual and related info. It includes validating and
+ determining the set of video modes that will be used (and anything
+ that is required to determine that).
+
+ This information should be determined in the least intrusive way
+ possible. The state of the HW must remain unchanged by this
+ function. Although video memory (including MMIO) may be mapped
+ within this function, it must be unmapped before returning. Driver
+ specific information should be stored in a structure hooked into
+ the &s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code;
+ field. Any other modules which require persistent data (ie data
+ that persists across server generations) should be initialised in
+ this function, and they should allocate a ``privates'' index to
+ hook their data into by calling
+ &s.code;xf86AllocateScrnInfoPrivateIndex().&e.code; The ``privates''
+ data is persistent.
+
+ Helper functions for some of these things are provided at the
+ XFree86 common level, and the driver can choose to make use of
+ them.
+
+ All additional resources that the screen needs must be registered
+ here. This should be done with
+ &s.code;xf86RegisterResources()&e.code;. If some of the fixed
+ resources registered in the Probe phase are not needed or not
+ decoded by the hardware when in the OPERATING server state, their
+ status should be updated with
+ &s.code;xf86SetOperatingState()&e.code;.
+
+ Modules may be loaded at any point in this function, and all
+ modules that the driver will need must be loaded before the end
+ of this function. Either the &s.code;xf86LoadSubModule()&e.code;
+ or the &s.code;xf86LoadDrvSubModule()&e.code; function should be
+ used to load modules depending on whether a
+ &s.code;ScrnInfoRec&e.code; has been set up. A driver may unload
+ a module within this function if it was only needed temporarily,
+ and the &s.code;xf86UnloadSubModule()&e.code; function should be used
+ to do that. Otherwise there is no need to explicitly unload modules
+ because the loader takes care of module dependencies and will
+ unload submodules automatically if/when the driver module is
+ unloaded.
+
+ The bulk of the &s.code;ScrnInfoRec&e.code; fields should be filled
+ out in this function.
+
+ &s.code;ChipPreInit()&e.code; returns &s.code;FALSE&e.code; when
+ the configuration is unusable in some way (unsupported depth, no
+ valid modes, not enough video memory, etc), and &s.code;TRUE&e.code;
+ if it is usable.
+
+ It is expected that if the &s.code;ChipPreInit()&e.code; function
+ returns &s.code;TRUE&e.code;, then the only reasons that subsequent
+ stages in the driver might fail are lack or resources (like xalloc
+ failures). All other possible reasons for failure should be
+ determined by the &s.code;ChipPreInit()&e.code; function.
+
+ </quote>
+ </quote>
+
+ The &s.code;ScrnInfoRecs&e.code; for screens where the &s.code;ChipPreInit()&e.code; fails are removed.
+ If none remain, &s.code;InitOutput()&e.code; sets &s.code;screenInfo.numScreens&e.code; to &s.code;0&e.code; and returns.
+
+ At this point, further fields of the &s.code;ScrnInfoRecs&e.code; would normally be
+ filled in. Most are not strictly mandatory, but many are required
+ by other layers and/or helper functions that the driver may choose
+ to use. The documentation for those layers and helper functions
+ indicates which they require.
+
+ The following fields of the &s.code;ScrnInfoRecs&e.code; should be filled in if the
+ driver is going to use them:
+
+ <quote><verb>
+ monitor
+ display
+ depth
+ pixmapBPP
+ bitsPerPixel
+ weight (>8bpp only)
+ mask (>8bpp only)
+ offset (>8bpp only)
+ rgbBits (8bpp only)
+ gamma
+ defaultVisual
+ maxHValue
+ maxVValue
+ virtualX
+ virtualY
+ displayWidth
+ frameX0
+ frameY0
+ frameX1
+ frameY1
+ zoomLocked
+ modePool
+ modes
+ currentMode
+ progClock (TRUE if clock is programmable)
+ chipset
+ ramdac
+ clockchip
+ numClocks (if not programmable)
+ clock[] (if not programmable)
+ videoRam
+ biosBase
+ memBase
+ memClk
+ driverPrivate
+ chipID
+ chipRev
+ </verb></quote>
+
+ <quote><p>
+ &s.code;pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name)&e.code:
+ and
+ &s.code;pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name)&e.code:
+ <quote><p>
+ Load a module that a driver depends on. This function loads the
+ module &s.code;name&e.code; as a sub module of the driver. The
+ return value is a handle identifying the new module. If the load
+ fails, the return value will be &s.code;NULL&e.code;. If a driver
+ needs to explicitly unload a module it has loaded in this way,
+ the return value must be saved and passed to
+ &s.code;xf86UnloadSubModule()&e.code; when unloading.
+
+ </quote>
+
+ &s.code;void xf86UnloadSubModule(pointer module)&e.code;
+ <quote><p>
+ Unloads the module referenced by &s.code;module&e.code;.
+ &s.code;module&e.code; should be a pointer returned previously
+ by &s.code;xf86LoadSubModule()&e.code; or
+ &s.code;xf86LoadDrvSubModule()&e.code; .
+
+ </quote>
+ </quote>
+
+<sect1>Cleaning up Unused Drivers
+<p>
+
+ At this point it is known which screens will be in use, and which
+ drivers are being used. Unreferenced drivers (and modules they
+ may have loaded) are unloaded here.
+
+
+<sect1>Consistency Checks
+<p>
+
+ The parameters that must be global to the server, like pixmap formats,
+ bitmap bit order, bitmap scanline unit and image byte order are
+ compared for each of the screens. If a mismatch is found, the server
+ exits with an appropriate message.
+
+
+<sect1>Check if Resource Control is Needed
+<p>
+
+ Determine if resource access control is needed. This is the case
+ if more than one screen is used. If necessary the RAC wrapper module
+ is loaded.
+
+<sect1>AddScreen (ScreenInit)
+<p>
+
+ At this point, the valid screens are known.
+ &s.code;AddScreen()&e.code; is called for each of them, passing
+ &s.code;ChipScreenInit()&e.code; as the argument.
+ &s.code;AddScreen()&e.code; is a DIX function that allocates a new
+ &s.code;screenInfo.screen[]&e.code; entry (aka
+ &s.code;pScreen&e.code;), and does some basic initialisation of it.
+ It then calls the &s.code;ChipScreenInit()&e.code; function, with
+ &s.code;pScreen&e.code; as one of its arguments. If
+ &s.code;ChipScreenInit()&e.code; returns &s.code;FALSE&e.code;,
+ &s.code;AddScreen()&e.code; returns &s.code;-1&e.code;. Otherwise
+ it returns the index of the screen. &s.code;AddScreen()&e.code;
+ should only fail because of programming errors or failure to allocate
+ resources (like memory). All configuration problems should be
+ detected BEFORE this point.
+
+ <quote><p>
+ &s.code;Bool ChipScreenInit(int index, ScreenPtr pScreen,
+ &f.indent;int argc, char **argv)&e.code;
+ <quote><p>
+ This is called at the start of each server generation.
+
+ Fill in all of &s.code;pScreen&e.code;, possibly doing some of
+ this by calling ScreenInit functions from other layers like mi,
+ framebuffers (cfb, etc), and extensions.
+
+ Decide which operations need to be placed under resource access
+ control. The classes of operations are the frame buffer operations
+ (&s.code;RAC_FB&e.code;), the pointer operations
+ (&s.code;RAC_CURSOR&e.code;), the viewport change operations
+ (&s.code;RAC_VIEWPORT&e.code;) and the colormap operations
+ (&s.code;RAC_COLORMAP&e.code;). Any operation that requires
+ resources which might be disabled during OPERATING state should
+ be set to use RAC. This can be specified separately for memory
+ and IO resources (the &s.code;racMemFlags&e.code; and
+ &s.code;racIoFlags&e.code; fields of the &s.code;ScrnInfoRec&e.code;
+ respectively).
+
+ Map any video memory or other memory regions.
+
+ Save the video card state. Enough state must be saved so that
+ the original state can later be restored.
+
+ Initialise the initial video mode. The &s.code;ScrnInfoRec&e.code;'s
+ &s.code;vtSema&e.code; field should be set to &s.code;TRUE&e.code;
+ just prior to changing the video hardware's state.
+
+ </quote>
+ </quote>
+
+
+ The &s.code;ChipScreenInit()&e.code; function (or functions from other
+ layers that it calls) should allocate entries in the
+ &s.code;ScreenRec&e.code;'s &s.code;devPrivates&e.code; area by
+ calling &s.code;AllocateScreenPrivateIndex()&e.code; if it needs
+ per-generation storage. Since the &s.code;ScreenRec&e.code;'s
+ &s.code;devPrivates&e.code; information is cleared for each server
+ generation, this is the correct place to initialise it.
+
+ After &s.code;AddScreen()&e.code; has successfully returned, the
+ following &s.code;ScrnInfoRec&e.code; fields are initialised:
+
+ <quote><verb>
+ pScreen
+ racMemFlags
+ racIoFlags
+ </verb></quote>
+
+ The &s.code;ChipScreenInit()&e.code; function should initialise the
+ &s.code;CloseScreen&e.code; and &s.code;SaveScreen&e.code; fields
+ of &s.code;pScreen&e.code;. The old value of
+ &s.code;pScreen-&gt;CloseScreen&e.code; should be saved as part of
+ the driver's per-screen private data, allowing it to be called from
+ &s.code;ChipCloseScreen()&e.code;. This means that the existing
+ &s.code;CloseScreen()&e.code; function is wrapped.
+
+<sect1>Finalising RAC Initialisation
+<p>
+
+ After all the &s.code;ChipScreenInit()&e.code; functions have been
+ called, each screen has registered its RAC requirements. This
+ information is used to determine which shared resources are requested
+ by more than one driver and set the access functions accordingly.
+ This is done following these rules:
+
+ <enum>
+ <item>The sharable resources registered by each entity are compared.
+ If a resource is registered by more than one entity the entity
+ will be marked to indicate that it needs to share this resources
+ type (IO or MEM).
+
+ <item>A resource marked ``disabled'' during OPERATING state will be
+ ignored entirely.
+
+ <item>A resource marked ``unused'' will only conflict with an overlapping
+ resource of an other entity if the second is actually in use
+ during OPERATING state.
+
+ <item>If an ``unused'' resource was found to conflict but the entity
+ does not use any other resource of this type the entire resource
+ type will be disabled for that entity.
+ </enum>
+
+
+<sect1>Finishing InitOutput()
+<p>
+
+ At this point &s.code;InitOutput()&e.code; is finished, and all the
+ screens have been setup in their initial video mode.
+
+
+<sect1>Mode Switching
+<p>
+
+ When a SwitchMode event is received, &s.code;ChipSwitchMode()&e.code;
+ is called (when it exists):
+
+ <quote><p>
+ &s.code;Bool ChipSwitchMode(int index, DisplayModePtr mode, int flags)&e.code;
+ <quote><p>
+ Initialises the new mode for the screen identified by
+ &s.code;index;&e.code;. The viewport may need to be adjusted
+ also.
+
+ </quote>
+ </quote>
+
+
+<sect1>Changing Viewport
+<p>
+
+ When a Change Viewport event is received,
+ &s.code;ChipAdjustFrame()&e.code; is called (when it exists):
+
+ <quote><p>
+ &s.code;void ChipAdjustFrame(int index, int x, int y, int flags)&e.code;
+ <quote><p>
+ Changes the viewport for the screen identified by
+ &s.code;index;&e.code;.
+
+ It should be noted that many chipsets impose restrictions on where the
+ viewport may be placed in the virtual resolution, either for alignment
+ reasons, or to prevent the start of the viewport from being positioned
+ within a pixel (as can happen in a 24bpp mode). After calculating the
+ value the chipset's panning registers need to be set to for non-DGA
+ modes, this function should recalculate the ScrnInfoRec's
+ &s.code;frameX0&e.code;, &s.code;frameY0&e.code, &s.code;frameX1&e.code;
+ and &s.code;frameY1&e.code; fields to correspond to that value. If
+ this is not done, switching to another mode might cause the position
+ of a hardware cursor to change.
+
+ </quote>
+ </quote>
+
+
+<sect1>VT Switching
+<p>
+
+ When a VT switch event is received, &s.code;xf86VTSwitch()&e.code;
+ is called. &s.code;xf86VTSwitch()&e.code; does the following:
+
+ <descrip>
+ <tag>On ENTER:</tag>
+ <itemize>
+ <item>enable port I/O access
+
+ <item>save and initialise the bus/resource state
+
+ <item>enter the SETUP server state
+
+ <item>calls &s.code;ChipEnterVT()&e.code; for each screen
+
+ <item>enter the OPERATING server state
+
+ <item>validate GCs
+
+ <item>Restore fb from saved pixmap for each screen
+
+ <item>Enable all input devices
+ </itemize>
+ <tag>On LEAVE:</tag>
+ <itemize>
+ <item>Save fb to pixmap for each screen
+
+ <item>validate GCs
+
+ <item>enter the SETUP server state
+
+ <item>calls &s.code;ChipLeaveVT()&e.code; for each screen
+
+ <item>disable all input devices
+
+ <item>restore bus/resource state
+
+ <item>disables port I/O access
+ </itemize>
+ </descrip>
+
+ <quote><p>
+ &s.code;Bool ChipEnterVT(int index, int flags)&e.code;
+ <quote><p>
+ This function should initialise the current video mode and
+ initialise the viewport, turn on the HW cursor if appropriate,
+ etc.
+
+ Should it re-save the video state before initialising the video
+ mode?
+
+ </quote>
+
+ &s.code;void ChipLeaveVT(int index, int flags)&e.code;
+ <quote><p>
+ This function should restore the saved video state. If
+ appropriate it should also turn off the HW cursor, and invalidate
+ any pixmap/font caches.
+
+ </quote>
+
+ Optionally, &s.code;ChipLeaveVT()&e.code; may also unmap memory
+ regions. If so, &s.code;ChipEnterVT()&e.code; will need to remap
+ them. Additionally, if an aperture used to access video memory is
+ unmapped and remapped in this fashion, &s.code;ChipEnterVT()&e.code;
+ will also need to notify the framebuffer layers of the aperture's new
+ location in virtual memory. This is done with a call to the screen's
+ &s.code;ModifyPixmapHeader()&e.code; function, as follows
+
+ <quote><p>
+ &s.code;(*pScreen->ModifyPixmapHeader)(pScrn->ppix,
+ &f.indent;-1, -1, -1, -1, -1, <it>NewApertureAddress</it>);&e.code;
+ <quote><p>
+ where the &s.code``ppix''&e.code; field in a ScrnInfoRec
+ points to the pixmap used by the screen's
+ &s.code;SaveRestoreImage()&e.code; function to hold the screen's
+ contents while switched out.
+
+ </quote>
+ </quote>
+
+ Currently, aperture remapping, as described here, should not be
+ attempted if the driver uses the &s.code;xf8_16bpp&e.code; or
+ &s.code;xf8_32bpp&e.code; framebuffer layers. A pending
+ restructuring of VT switching will address this restriction in
+ the near future.
+
+ </quote>
+
+ Other layers may wrap the &s.code;ChipEnterVT()&e.code; and
+ &s.code;ChipLeaveVT()&e.code; functions if they need to take some
+ action when these events are received.
+
+<sect1>End of server generation
+<p>
+
+ At the end of each server generation, the DIX layer calls
+ &s.code;ChipCloseScreen()&e.code; for each screen:
+
+ <quote><p>
+ &s.code;Bool ChipCloseScreen(int index, ScreenPtr pScreen)&e.code;
+ <quote><p>
+ This function should restore the saved video state and unmap the
+ memory regions.
+
+ It should also free per-screen data structures allocated by the
+ driver. Note that the persistent data held in the
+ &s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code; field
+ should not be freed here because it is needed by subsequent server
+ generations.
+
+ The &s.code;ScrnInfoRec&e.code;'s &s.code;vtSema&e.code; field
+ should be set to &s.code;FALSE&e.code; once the video HW state
+ has been restored.
+
+ Before freeing the per-screen driver data the saved
+ &s.code;CloseScreen&e.code; value should be restored to
+ &s.code;pScreen-&gt;CloseScreen&e.code;, and that function should
+ be called after freeing the data.
+
+ </quote>
+ </quote>
+
+<sect>Optional Driver Functions
+<p>
+
+The functions outlined here can be called from the XFree86 common layer,
+but their presence is optional.
+
+<sect1>Mode Validation
+<p>
+
+ When a mode validation helper supplied by the XFree86-common layer is
+ being used, it can be useful to provide a function to check for hw
+ specific mode constraints:
+
+ <quote><p>
+ &s.code;ModeStatus ChipValidMode(int index, DisplayModePtr mode,
+ &f.indent;Bool verbose, int flags)&e.code;
+ <quote><p>
+ Check the passed mode for hw-specific constraints, and return the
+ appropriate status value.
+
+ </quote>
+ </quote>
+
+<p>
+This function may also modify the effective timings and clock of the passed
+mode. These have been stored in the mode's &s.code;Crtc*&e.code; and
+&s.code;SynthClock&e.code; elements, and have already been adjusted for
+interlacing, doublescanning, multiscanning and clock multipliers and dividers.
+The function should not modify any other mode field, unless it wants to modify
+the mode timings reported to the user by &s.code;xf86PrintModes()&e.code;.
+
+<p>
+The function is called once for every mode in the XF86Config Monitor section
+assigned to the screen, with &s.code;flags&e.code; set to
+&s.code;MODECHECK_INITIAL&e.code;. It is subsequently called for every mode
+in the XF86Config Display subsection assigned to the screen, with
+&s.code;flags&e.code; set to &s.code;MODECHECK_FINAL&e.code;. In the second
+case, the mode will have successfully passed all other tests. In addition,
+the &s.code;ScrnInfoRec&e.code;'s &s.code;virtualX&e.code;,
+&s.code;virtualY&e.code; and &s.code;displayWidth&e.code; fields will have been
+set as if the mode to be validated were to be the last mode accepted.
+
+<p>
+In effect, calls with MODECHECK_INITIAL are intended for checks that do not
+depend on any mode other than the one being validated, while calls with
+MODECHECK_FINAL are intended for checks that may involve more than one mode.
+
+<sect1>Free screen data
+<p>
+
+ When a screen is deleted prior to the completion of the ScreenInit
+ phase the &s.code;ChipFreeScreen()&e.code; function is called when defined.
+
+ <quote><p>
+ &s.code;void ChipFreeScreen(int scrnindex, int flags)&e.code;
+ <quote><p>
+ Free any driver-allocated data that may have been allocated up to
+ and including an unsuccessful &s.code;ChipScreenInit()&e.code;
+ call. This would predominantly be data allocated by
+ &s.code;ChipPreInit()&e.code; that persists across server
+ generations. It would include the &s.code;driverPrivate&e.code;,
+ and any ``privates'' entries that modules may have allocated.
+
+ </quote>
+ </quote>
+
+
+<sect>Recommended driver functions
+<p>
+
+The functions outlined here are for internal use by the driver only.
+They are entirely optional, and are never accessed directly from higher
+layers. The sample function declarations shown here are just examples.
+The interface (if any) used is up to the driver.
+
+<sect1>Save
+<p>
+
+ Save the video state. This could be called from &s.code;ChipScreenInit()&e.code; and
+ (possibly) &s.code;ChipEnterVT()&e.code;.
+
+ <quote><p>
+ &s.code;void ChipSave(ScrnInfoPtr pScrn)&e.code;
+ <quote><p>
+ Saves the current state. This will only be saving pre-server
+ states or states before returning to the server. There is only
+ one current saved state per screen and it is stored in private
+ storage in the screen.
+
+ </quote>
+ </quote>
+
+<sect1>Restore
+<p>
+
+ Restore the original video state. This could be called from the
+ &s.code;ChipLeaveVT()&e.code; and &s.code;ChipCloseScreen()&e.code;
+ functions.
+
+ <quote><p>
+ &s.code;void ChipRestore(ScrnInfoPtr pScrn)&e.code;
+ <quote><p>
+ Restores the saved state from the private storage. Usually only
+ used for restoring text modes.
+
+ </quote>
+ </quote>
+
+
+<sect1>Initialise Mode
+<p>
+
+ Initialise a video mode. This could be called from the
+ &s.code;ChipScreenInit()&e.code;, &s.code;ChipSwitchMode()&e.code;
+ and &s.code;ChipEnterVT()&e.code; functions.
+
+ <quote><p>
+ &s.code;Bool ChipModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)&e.code;
+ <quote><p>
+ Programs the hardware for the given video mode.
+
+ </quote>
+ </quote>
+
+
+<sect>Data and Data Structures
+<p>
+
+<sect1>Command line data
+<p>
+
+Command line options are typically global, and are stored in global
+variables. These variables are read-only and are available to drivers
+via a function call interface. Most of these command line values are
+processed via helper functions to ensure that they are treated consistently
+by all drivers. The other means of access is provided for cases where
+the supplied helper functions might not be appropriate.
+
+Some of them are:
+
+<quote><verb>
+ xf86Verbose verbosity level
+ xf86Bpp -bpp from the command line
+ xf86Depth -depth from the command line
+ xf86Weight -weight from the command line
+ xf86Gamma -{r,g,b,}gamma from the command line
+ xf86FlipPixels -flippixels from the command line
+ xf86ProbeOnly -probeonly from the command line
+ defaultColorVisualClass -cc from the command line
+</verb></quote>
+
+If we ever do allow for screen-specific command line options, we may
+need to rethink this.
+
+These can be accessed in a read-only manner by drivers with the following
+functions:
+
+ <quote><p>
+ &s.code;int xf86GetVerbosity()&e.code;
+ <quote><p>
+ Returns the value of &s.code;xf86Verbose&e.code;.
+
+ </quote>
+
+ &s.code;int xf86GetDepth()&e.code;
+ <quote><p>
+ Returns the &s.cmd;-depth&e.cmd; command line setting. If not
+ set on the command line, &s.code;-1&e.code; is returned.
+
+ </quote>
+
+ &s.code;rgb xf86GetWeight()&e.code;
+ <quote><p>
+ Returns the &s.cmd;-weight&e.cmd; command line setting. If not
+ set on the command line, &s.code;{0, 0, 0}&e.code; is returned.
+
+ </quote>
+
+ &s.code;Gamma xf86GetGamma()&e.code;
+ <quote><p>
+ Returns the &s.cmd;-gamma&e.cmd; or &s.cmd;-rgamma&e.cmd;,
+ &s.cmd;-ggamma&e.cmd;, &s.cmd;-bgamma&e.cmd; command line settings.
+ If not set on the command line, &s.code;{0.0, 0.0, 0.0}&e.code;
+ is returned.
+
+ </quote>
+
+ &s.code;Bool xf86GetFlipPixels()&e.code;
+ <quote><p>
+ Returns &s.code;TRUE&e.code; if &s.cmd;-flippixels&e.cmd; is
+ present on the command line, and &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+
+ &s.code;const char *xf86GetServerName()&e.code;
+ <quote><p>
+ Returns the name of the X server from the command line.
+
+ </quote>
+ </quote>
+
+<sect1>Data handling
+<p>
+
+Config file data contains parts that are global, and parts that are
+Screen specific. All of it is parsed into data structures that neither
+the drivers or most other parts of the server need to know about.
+
+The global data is typically not required by drivers, and as such, most
+of it is stored in the private &s.code;xf86InfoRec&e.code;.
+
+The screen-specific data collected from the config file is stored in
+screen, device, display, monitor-specific data structures that are separate
+from the &s.code;ScrnInfoRecs&e.code;, with the appropriate elements/fields
+hooked into the &s.code;ScrnInfoRecs&e.code; as required. The screen
+config data is held in &s.code;confScreenRec&e.code;, device data in
+the &s.code;GDevRec&e.code;, monitor data in the &s.code;MonRec&e.code;,
+and display data in the &s.code;DispRec&e.code;.
+
+The XFree86 common layer's screen specific data (the actual data in use
+for each screen) is held in the &s.code;ScrnInfoRecs&e.code;. As has
+been outlined above, the &s.code;ScrnInfoRecs&e.code; are allocated at probe
+time, and it is the responsibility of the Drivers' &s.code;Probe()&e.code;
+and &s.code;PreInit()&e.code; functions to finish filling them in based
+on both data provided on the command line and data provided from the
+Config file. The precedence for this is:
+
+ <quote>
+ command line -&gt; config file -&gt; probed/default data
+ </quote>
+
+For most things in this category there are helper functions that the
+drivers can use to ensure that the above precedence is consistently
+used.
+
+As well as containing screen-specific data that the XFree86 common layer
+(including essential parts of the server infrastructure as well as helper
+functions) needs to access, it also contains some data that drivers use
+internally. When considering whether to add a new field to the
+&s.code;ScrnInfoRec&e.code;, consider the balance between the convenience
+of things that lots of drivers need and the size/obscurity of the
+&s.code;ScrnInfoRec&e.code;.
+
+Per-screen driver specific data that cannot be accommodated with the
+static &s.code;ScrnInfoRec&e.code; fields is held in a driver-defined
+data structure, a pointer to which is assigned to the
+&s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code; field. This
+is per-screen data that persists across server generations (as does the
+bulk of the static &s.code;ScrnInfoRec&e.code; data). It would typically
+also include the video card's saved state.
+
+Per-screen data for other modules that the driver uses (for example,
+the XAA module) that is reset for each server generation is hooked into
+the &s.code;ScrnInfoRec&e.code; through it's &s.code;privates&e.code;
+field.
+
+Once it has stabilised, the data structures and variables accessible to
+video drivers will be documented here. In the meantime, those things
+defined in the &s.code;xf86.h&e.code; and &s.code;xf86str.h&e.code;
+files are visible to video drivers. Things defined in
+&s.code;xf86Priv.h&e.code; and &s.code;xf86Privstr.h&e.code; are NOT
+intended to be visible to video drivers, and it is an error for a driver
+to include those files.
+
+
+<sect1>Accessing global data
+<p>
+
+Some other global state information that the drivers may access via
+functions is as follows:
+
+ <quote><p>
+ &s.code;Bool xf86ServerIsExiting()&e.code;
+ <quote><p>
+ Returns &s.code;TRUE&e.code; if the server is at the end of a
+ generation and is in the process of exiting, and
+ &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+
+ &s.code;Bool xf86ServerIsResetting()&e.code;
+ <quote><p>
+ Returns &s.code;TRUE&e.code; if the server is at the end of a
+ generation and is in the process of resetting, and
+ &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+
+ &s.code;Bool xf86ServerIsInitialising()&e.code;
+ <quote><p>
+ Returns &s.code;TRUE&e.code; if the server is at the beginning of
+ a generation and is in the process of initialising, and
+ &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+
+ &s.code;Bool xf86ServerIsOnlyProbing()&e.code;
+ <quote><p>
+ Returns &s.code;TRUE&e.code; if the -probeonly command line flag
+ was specified, and &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+
+ &s.code;Bool xf86CaughtSignal()&e.code;
+ <quote><p>
+ Returns &s.code;TRUE&e.code; if the server has caught a signal,
+ and &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+ </quote>
+
+<sect1>Allocating private data
+<p>
+
+A driver and any module it uses may allocate per-screen private storage
+in either the &s.code;ScreenRec&e.code; (DIX level) or
+&s.code;ScrnInfoRec&e.code; (XFree86 common layer level).
+&s.code;ScreenRec&e.code; storage persists only for a single server
+generation, and &s.code;ScrnInfoRec&e.code; storage persists across
+generations for the lifetime of the server.
+
+The &s.code;ScreenRec&e.code; &s.code;devPrivates&e.code; data must be
+reallocated/initialised at the start of each new generation. This is
+normally done from the &s.code;ChipScreenInit()&e.code; function, and
+Init functions for other modules that it calls. Data allocated in this
+way should be freed by the driver's &s.code;ChipCloseScreen()&e.code;
+functions, and Close functions for other modules that it calls. A new
+&s.code;devPrivates&e.code; entry is allocated by calling the
+&s.code;AllocateScreenPrivateIndex()&e.code; function.
+
+ <quote><p>
+ &s.code;int AllocateScreenPrivateIndex()&e.code;
+ <quote><p>
+ This function allocates a new element in the
+ &s.code;devPrivates&e.code; field of all currently existing
+ &s.code;ScreenRecs&e.code;. The return value is the index of this
+ new element in the &s.code;devPrivates&e.code; array. The
+ &s.code;devPrivates&e.code; field is of type
+ &s.code;DevUnion&e.code;:
+
+ <verb>
+ typedef union _DevUnion {
+ pointer ptr;
+ long val;
+ unsigned long uval;
+ pointer (*fptr)(void);
+ } DevUnion;
+ </verb>
+
+ which allows the element to be used for any of the above types.
+ It is commonly used as a pointer to data that the caller allocates
+ after the new index has been allocated.
+
+ This function will return &s.code;-1&e.code; when there is an
+ error allocating the new index.
+
+ </quote>
+ </quote>
+
+The &s.code;ScrnInfoRec&e.code; &s.code;privates&e.code; data persists
+for the life of the server, so only needs to be allocated once. This
+should be done from the &s.code;ChipPreInit()&e.code; function, and Init
+functions for other modules that it calls. Data allocated in this way
+should be freed by the driver's &s.code;ChipFreeScreen()&e.code; functions,
+and Free functions for other modules that it calls. A new
+&s.code;privates&e.code; entry is allocated by calling the
+&s.code;xf86AllocateScrnInfoPrivateIndex()&e.code; function.
+
+
+ <quote><p>
+ &s.code;int xf86AllocateScrnInfoPrivateIndex()&e.code;
+ <quote><p>
+ This function allocates a new element in the &s.code;privates&e.code;
+ field of all currently existing &s.code;ScrnInfoRecs&e.code;.
+ The return value is the index of this new element in the
+ &s.code;privates&e.code; array. The &s.code;privates&e.code;
+ field is of type &s.code;DevUnion&e.code;:
+
+ <verb>
+ typedef union _DevUnion {
+ pointer ptr;
+ long val;
+ unsigned long uval;
+ pointer (*fptr)(void);
+ } DevUnion;
+ </verb>
+
+ which allows the element to be used for any of the above types.
+ It is commonly used as a pointer to data that the caller allocates
+ after the new index has been allocated.
+
+ This function will not return when there is an error allocating
+ the new index. When there is an error it will cause the server
+ to exit with a fatal error. The similar function for allocation
+ privates in the &s.code;ScreenRec&e.code;
+ (&s.code;AllocateScreenPrivateIndex()&e.code;) differs in this
+ respect by returning &s.code;-1&e.code; when the allocation fails.
+
+ </quote>
+ </quote>
+
+<sect>Keeping Track of Bus Resources<label id="rac">
+<p>
+
+<sect1>Theory of Operation
+<p>
+
+The XFree86 common layer has knowledge of generic access control mechanisms
+for devices on certain bus systems (currently the PCI bus) as well as
+of methods to enable or disable access to the buses itself. Furthermore
+it can access information on resources decoded by these devices and if
+necessary modify it.
+
+When first starting the Xserver collects all this information, saves it
+for restoration, checks it for consistency, and if necessary, corrects
+it. Finally it disables all resources on a generic level prior to
+calling any driver function.
+
+When the &s.code;Probe()&e.code; function of each driver is called the
+device sections are matched against the devices found in the system.
+The driver may probe devices at this stage that cannot be identified by
+using device independent methods. Access to all resources that can be
+controlled in a device independent way is disabled. The
+&s.code;Probe()&e.code; function should register all non-relocatable
+resources at this stage. If a resource conflict is found between
+exclusive resources the driver will fail immediately. Optionally the
+driver might specify an &s.code;EntityInit()&e.code;,
+&s.code;EntityLeave()&e.code; and &s.code;EntityEnter()&e.code; function.
+
+&s.code;EntityInit()&e.code; can be used to disable any shared resources
+that are not controlled by the generic access control functions. It is
+called prior to the PreInit phase regardless if an entity is active or
+not. When calling the &s.code;EntityInit()&e.code;,
+&s.code;EntityEnter()&e.code; and &s.code;EntityLeave()&e.code; functions
+the common level will disable access to all other entities on a generic
+level. Since the common level has no knowledge of device specific
+methods to disable access to resources it cannot be guaranteed that
+certain resources are not decoded by any other entity until the
+&s.code;EntityInit()&e.code; or &s.code;EntityEnter()&e.code; phase is
+finished. Device drivers should therefore register all those resources
+which they are going to disable. If these resources are never to be
+used by any driver function they may be flagged &s.code;ResInit&e.code;
+so that they can be removed from the resource list after processing all
+&s.code;EntityInit()&e.code; functions. &s.code;EntityEnter()&e.code;
+should disable decoding of all resources which are not registered as
+exclusive and which are not handled by the generic access control in
+the common level. The difference to &s.code;EntityInit()&e.code; is
+that the latter one is only called once during lifetime of the server.
+It can therefore be used to set up variables prior to disabling resources.
+&s.code;EntityLeave()&e.code; should restore the original state when
+exiting the server or switching to a different VT. It also needs to
+disable device specific access functions if they need to be disabled on
+server exit or VT switch. The default state is to enable them before
+giving up the VT.
+
+In &s.code;PreInit()&e.code; phase each driver should check if any
+sharable resources it has registered during &s.code;Probe()&e.code; has
+been denied and take appropriate action which could simply be to fail.
+If it needs to access resources it has disabled during
+&s.code;EntitySetup()&e.code; it can do so provided it has registered
+these and will disable them before returning from
+&s.code;PreInit()&e.code;. This also applies to all other driver
+functions. Several functions are provided to request resource ranges,
+register these, correct PCI config space and add replacements for the
+generic access functions. Resources may be marked ``disabled'' or
+``unused'' during OPERATING stage. Although these steps could also be
+performed in &s.code;ScreenInit()&e.code;, this is not desirable.
+
+Following &s.code;PreInit()&e.code; phase the common level determines
+if resource access control is needed. This is the case if more than
+one screen is used. If necessary the RAC wrapper module is loaded. In
+&s.code;ScreenInit()&e.code; the drivers can decide which operations
+need to be placed under RAC. Available are the frame buffer operations,
+the pointer operations and the colormap operations. Any operation that
+requires resources which might be disabled during OPERATING state should
+be set to use RAC. This can be specified separately for memory and IO
+resources.
+
+When &s.code;ScreenInit()&e.code; phase is done the common level will
+determine which shared resources are requested by more than one driver
+and set the access functions accordingly. This is done following these
+rules:
+
+<enum>
+<item>The sharable resources registered by each entity are compared. If
+ a resource is registered by more than one entity the entity will be
+ marked to need to share this resources type (&s.code;IO&e.code; or
+ &s.code;MEM&e.code;).
+
+<item>A resource marked ``disabled'' during OPERATING state will be ignored
+ entirely.
+
+<item>A resource marked ``unused'' will only conflicts with an overlapping
+ resource of an other entity if the second is actually in use during
+ OPERATING state.
+
+<item>If an ``unused'' resource was found to conflict however the entity
+ does not use any other resource of this type the entire resource type
+ will be disabled for that entity.
+</enum>
+
+The driver has the choice among different ways to control access to
+certain resources:
+
+<enum>
+<item>It can rely on the generic access functions. This is probably the
+ most common case. Here the driver only needs to register any resource
+ it is going to use.
+
+<item>It can replace the generic access functions by driver specific
+ ones. This will mostly be used in cases where no generic access
+ functions are available. In this case the driver has to make sure
+ these resources are disabled when entering the &s.code;PreInit()&e.code;
+ stage. Since the replacement functions are registered in
+ &s.code;PreInit()&e.code; the driver will have to enable these
+ resources itself if it needs to access them during this state. The
+ driver can specify if the replacement functions can control memory
+ and/or I/O resources separately.
+
+<item>The driver can enable resources itself when it needs them. Each
+ driver function enabling them needs to disable them before it will
+ return. This should be used if a resource which can be controlled
+ in a device dependent way is only required during SETUP state. This
+ way it can be marked ``unused'' during OPERATING state.
+</enum>
+
+A resource which is decoded during OPERATING state however never accessed
+by the driver should be marked unused.
+
+Since access switching latencies are an issue during Xserver operation,
+the common level attempts to minimize the number of entities that need
+to be placed under RAC control. When a wrapped operation is called,
+the &s.code;EnableAccess()&e.code; function is called before control is
+passed on. &s.code;EnableAccess()&e.code; checks if a screen is under
+access control. If not it just establishes bus routing and returns.
+If the screen needs to be under access control,
+&s.code;EnableAccess()&e.code; determines which resource types
+(&s.code;MEM&e.code;, &s.code;IO&e.code;) are required. Then it tests
+if this access is already established. If so it simply returns. If
+not it disables the currently established access, fixes bus routing and
+enables access to all entities registered for this screen.
+
+Whenever a mode switch or a VT-switch is performed the common level will
+return to SETUP state.
+
+<sect1>Resource Types
+<p>
+
+Resource have certain properties. When registering resources each range
+is accompanied by a flag consisting of the ORed flags of the different
+properties the resource has. Each resource range may be classified
+according to
+
+<itemize>
+ <item>its physical properties i.e., if it addresses
+ memory (&s.code;ResMem&e.code;) or
+ I/O space (&s.code;ResIo&e.code;),
+ <item>if it addresses a
+ block (&s.code;ResBlock&e.code;) or
+ sparse (&s.code;ResSparse&e.code;)
+ range,
+ <item>its access properties.
+</itemize>
+
+There are two known access properties:
+
+<itemize>
+ <item>&s.code;ResExclusive&e.code;
+ for resources which may not be shared with any other device and
+ <item>&s.code;ResShared&e.code;
+ for resources which can be disabled and therefore can be shared.
+</itemize>
+
+If it is necessary to test a resource against any type a generic access
+type &s.code;ResAny&e.code; is provided. If this is set the resource
+will conflict with any resource of a different entity intersecting its
+range. Further it can be specified that a resource is decoded however
+never used during any stage (&s.code;ResUnused&e.code;) or during
+OPERATING state (&s.code;ResUnusedOpr&e.code;). A resource only visible
+during the init functions (ie. &s.code;EntityInit()&e.code;,
+&s.code;EntityEnter()&e.code; and &s.code;EntityLeave()&e.code; should
+be registered with the flag &s.code;ResInit&e.code;. A resource that
+might conflict with background resource ranges may be flagged with
+&s.code;ResBios&e.code;. This might be useful when registering resources
+ranges that were assigned by the system Bios.
+
+Several predefined resource lists are available for VGA and 8514/A
+resources in &s.code;common/xf86Resources.h&e.code;.
+
+<sect1>Available Functions<label id="avail">
+<p>
+
+The functions provided for resource management are listed in their order
+of use in the driver.
+
+
+<sect2>Probe Phase
+<p>
+
+In this phase each driver detects those resources it is able to drive,
+creates an entity record for each of them, registers non-relocatable
+resources and allocates screens and adds the resources to screens.
+
+Two helper functions are provided for matching device sections in the
+XF86Config file to the devices:
+
+ <quote><p>
+ &s.code;int xf86MatchPciInstances(const char *driverName, int vendorID,
+ &f.indent;SymTabPtr chipsets, PciChipsets *PCIchipsets,
+ &f.indent;GDevPtr *devList, int numDevs, DriverPtr drvp,
+ &f.indent;int **foundEntities)&e.code;
+ <quote><p>
+ This function finds matches between PCI cards that a driver supports
+ and config file device sections. It is intended for use in the
+ &s.code;ChipProbe()&e.code; function of drivers for PCI cards.
+ Only probed PCI devices with a vendor ID matching
+ &s.code;vendorID&e.code; are considered. &s.code;devList&e.code;
+ and &s.code;numDevs&e.code; are typically those found from
+ calling &s.code;xf86MatchDevice()&e.code;, and represent the active
+ config file device sections relevant to the driver.
+ &s.code;PCIchipsets&e.code; is a table that provides a mapping
+ between the PCI device IDs, the driver's internal chipset tokens
+ and a list of fixed resources.
+
+ When a device section doesn't have a &s.key;BusID&e.key; entry it
+ can only match the primary video device. Secondary devices are
+ only matched with device sections that have a matching
+ &s.key;BusID&e.key; entry.
+
+ Once the preliminary matches have been found, a final match is
+ confirmed by checking if the chipset override, ChipID override or
+ probed PCI chipset type match one of those given in the
+ &s.code;chipsets&e.code; and &s.code;PCIchipsets&e.code; lists.
+ The &s.code;PCIchipsets&e.code; list includes a list of the PCI
+ device IDs supported by the driver. The list should be terminated
+ with an entry with PCI ID &s.code;-1&e.code;". The
+ &s.code;chipsets&e.code; list is a table mapping the driver's
+ internal chipset tokens to names, and should be terminated with
+ a &s.code;NULL&e.code; entry. Only those entries with a
+ corresponding entry in the &s.code;PCIchipsets&e.code; list are
+ considered. The order of precedence is: config file chipset,
+ config file ChipID, probed PCI device ID.
+
+ In cases where a driver handles PCI chipsets with more than one
+ vendor ID, it may set &s.code;vendorID&e.code; to
+ &s.code;0&e.code;, and OR each devID in the list with (the
+ vendor&nbsp;ID&nbsp;&lt;&lt;&nbsp;16).
+
+ Entity index numbers for confirmed matches are returned as an
+ array via &s.code;foundEntities&e.code;. The PCI information,
+ chipset token and device section for each match are found in the
+ &s.code;EntityInfoRec&e.code; referenced by the indices.
+
+ The function return value is the number of confirmed matches. A
+ return value of &s.code;-1&e.code; indicates an internal error.
+ The returned &s.code;foundEntities&e.code; array should be freed
+ by the driver with &s.code;xfree()&e.code; when it is no longer
+ needed in cases where the return value is greater than zero.
+
+ </quote>
+
+ &s.code;int xf86MatchIsaInstances(const char *driverName,
+ &f.indent;SymTabPtr chipsets, IsaChipsets *ISAchipsets,
+ &f.indent;DriverPtr drvp, FindIsaDevProc FindIsaDevice,
+ &f.indent;GDevPtr *devList, int numDevs,
+ int **foundEntities)&e.code;
+ <quote><p>
+ This function finds matches between ISA cards that a driver supports
+ and config file device sections. It is intended for use in the
+ &s.code;ChipProbe()&e.code; function of drivers for ISA cards.
+ &s.code;devList&e.code; and &s.code;numDevs&e.code; are
+ typically those found from calling &s.code;xf86MatchDevice()&e.code;,
+ and represent the active config file device sections relevant to
+ the driver. &s.code;ISAchipsets&e.code; is a table that provides
+ a mapping between the driver's internal chipset tokens and the
+ resource classes. &s.code;FindIsaDevice&e.code; is a
+ driver-provided function that probes the hardware and returns the
+ chipset token corresponding to what was detected, and
+ &s.code;-1&e.code; if nothing was detected.
+
+ If the config file device section contains a chipset entry, then
+ it is checked against the &s.code;chipsets&e.code; list. When
+ no chipset entry is present, the &s.code;FindIsaDevice&e.code;
+ function is called instead.
+
+ Entity index numbers for confirmed matches are returned as an
+ array via &s.code;foundEntities&e.code;. The chipset token and
+ device section for each match are found in the
+ &s.code;EntityInfoRec&e.code; referenced by the indices.
+
+ The function return value is the number of confirmed matches. A
+ return value of &s.code;-1&e.code; indicates an internal error.
+ The returned &s.code;foundEntities&e.code; array should be freed
+ by the driver with &s.code;xfree()&e.code; when it is no longer
+ needed in cases where the return value is greater than zero.
+
+ </quote>
+ </quote>
+
+These two helper functions make use of several core functions that are
+available at the driver level:
+
+ <quote><p>
+ &s.code;Bool xf86ParsePciBusString(const char *busID, int *bus,
+ &f.indent;int *device, int *func)&e.code;
+ <quote><p>
+ Takes a &s.code;BusID&e.code; string, and if it is in the correct
+ format, returns the PCI &s.code;bus&e.code;, &s.code;device&e.code;,
+ &s.code;func&e.code; values that it indicates. The format of the
+ string is expected to be "PCI:bus:device:func" where each of `bus',
+ `device' and `func' are decimal integers. The ":func" part may
+ be omitted, and the func value assumed to be zero, but this isn't
+ encouraged. The "PCI" prefix may also be omitted. The prefix
+ "AGP" is currently equivalent to the "PCI" prefix. If the string
+ isn't a valid PCI BusID, the return value is &s.code;FALSE&e.code;.
+
+ </quote>
+
+
+ &s.code;Bool xf86ComparePciBusString(const char *busID, int bus,
+ &f.indent;int device, int func)&e.code;
+ <quote><p>
+ Compares a &s.code;BusID&e.code; string with PCI &s.code;bus&e.code;,
+ &s.code;device&e.code;, &s.code;func&e.code; values. If they
+ match &s.code;TRUE&e.code; is returned, and &s.code;FALSE&e.code;
+ if they don't.
+
+ </quote>
+
+ &s.code;Bool xf86ParseIsaBusString(const char *busID)&e.code;
+ <quote><p>
+ Compares a &s.code;BusID&e.code; string with the ISA bus ID string
+ ("ISA" or "ISA:"). If they match &s.code;TRUE&e.code; is returned,
+ and &s.code;FALSE&e.code; if they don't.
+
+ </quote>
+
+ &s.code;Bool xf86CheckPciSlot(int bus, int device, int func)&e.code;
+ <quote><p>
+ Checks if the PCI slot &s.code;bus:device:func&e.code; has been
+ claimed. If so, it returns &s.code;FALSE&e.code;, and otherwise
+ &s.code;TRUE&e.code;.
+
+ </quote>
+
+ &s.code;int xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp,
+ &f.indent;int chipset, GDevPtr dev, Bool active)&e.code;
+ <quote><p>
+ This function is used to claim a PCI slot, allocate the associated
+ entity record and initialise their data structures. The return
+ value is the index of the newly allocated entity record, or
+ &s.code;-1&e.code; if the claim fails. This function should always
+ succeed if &s.code;xf86CheckPciSlot()&e.code; returned
+ &s.code;TRUE&e.code; for the same PCI slot.
+
+ </quote>
+
+ &s.code;Bool xf86IsPrimaryPci(void)&e.code;
+ <quote><p>
+ This function returns &s.code;TRUE&e.code; if the primary card is
+ a PCI device, and &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+
+ &s.code;int xf86ClaimIsaSlot(DriverPtr drvp, int chipset,
+ &f.indent;GDevPtr dev, Bool active)&e.code;
+ <quote><p>
+ This allocates an entity record entity and initialise the data
+ structures. The return value is the index of the newly allocated
+ entity record.
+
+ </quote>
+
+ &s.code;Bool xf86IsPrimaryIsa(void)&e.code;
+ <quote><p>
+ This function returns &s.code;TRUE&e.code; if the primary card is
+ an ISA (non-PCI) device, and &s.code;FALSE&e.code; otherwise.
+
+ </quote>
+ </quote>
+
+Two helper functions are provided to aid configuring entities:
+ <quote><p>
+ &s.code;ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
+ &f.indent;int scrnFlag, int entityIndex,
+ &f.indent;PciChipsets *p_chip,
+ &f.indent;resList res, EntityProc init,
+ &f.indent;EntityProc enter, EntityProc leave,
+ &f.indent;pointer private)&e.code;
+ <p>
+ &s.code;ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn,
+ &f.indent;int scrnFlag, int entityIndex,
+ &f.indent;IsaChipsets *i_chip,
+ &f.indent;resList res, EntityProc init,
+ &f.indent;EntityProc enter, EntityProc leave,
+ &f.indent;pointer private)&e.code;
+ <quote><p>
+ These functions are used to register the non-relocatable resources
+ for an entity, and the optional entity-specific &s.code;Init&e.code;, &s.code;Enter&e.code; and
+ &s.code;Leave&e.code; functions. Usually the list of fixed resources is obtained
+ from the Isa/PciChipsets lists. However an additional list of
+ resources may be passed. Generally this is not required.
+ For active entities a &s.code;ScrnInfoRec&e.code; is allocated
+ if the &s.code;pScrn&e.code; argument is &s.code;NULL&e.code;.
+The
+ return value is &s.code;TRUE&e.code; when successful. The init, enter, leave
+ functions are defined as follows:
+
+ <quote>
+ &s.code;typedef void (*EntityProc)(int entityIndex,
+ &f.indent;pointer private)&e.code;
+ </quote>
+
+ They are passed the entity index and a pointer to a private scratch
+ area. This can be set up during &s.code;Probe()&e.code; and
+ its address can be passed to
+ &s.code;xf86ConfigIsaEntity()&e.code; and
+ &s.code;xf86ConfigPciEntity()&e.code; as the last argument.
+
+ </quote>
+ </quote>
+
+These two helper functions make use of several core functions that are
+available at the driver level:
+ <quote><p>
+ &s.code;void xf86ClaimFixedResources(resList list, int entityIndex)&e.code;
+ <quote><p>
+ This function registers the non-relocatable resources which cannot
+ be disabled and which therefore would cause the server to fail
+ immediately if they were found to conflict. It also records
+ non-relocatable but sharable resources for processing after the
+ &s.code;Probe()&e.code; phase.
+
+ </quote>
+
+ &s.code;Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
+ &f.indent;EntityProc enter, EntityProc leave, pointer)&e.code;
+ <quote><p>
+ This function registers with an entity the &s.code;init&e.code;,
+ &s.code;enter&e.code;, &s.code;leave&e.code; functions along
+ with the pointer to their private area.
+
+ </quote>
+
+ &s.code;void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex)&e.code;
+ <quote><p>
+ This function associates the entity referenced by
+ &s.code;entityIndex&e.code; with the screen.
+
+ </quote>
+ </quote>
+
+<sect2>PreInit Phase
+<p>
+
+During this phase the remaining resources should be registered.
+&s.code;PreInit()&e.code; should call &s.code;xf86GetEntityInfo()&e.code;
+to obtain a pointer to an &s.code;EntityInfoRec&e.code; for each entity
+it is able to drive and check if any resource are listed in its
+&s.code;resources&e.code; field. If resources registered in the Probe
+phase have been rejected in the post-Probe phase
+(&s.code;resources&e.code; is non-&s.code;NULL&e.code;), then the driver should
+decide if it can continue without using these or if it should fail.
+
+ <quote><p>
+ &s.code;EntityInfoPtr xf86GetEntityInfo(int entityIndex)&e.code;
+ <quote><p>
+ This function returns a pointer to the &s.code;EntityInfoRec&e.code;
+ referenced by &s.code;entityIndex&e.code;. The returned
+ &s.code;EntityInfoRec&e.code; should be freed with
+ &s.code;xfree()&e.code; when no longer needed.
+
+ </quote>
+ </quote>
+Several functions are provided to simplify resource registration:
+ <quote><p>
+ &s.code;Bool xf86IsEntityPrimary(int entityIndex)&e.code;
+ <quote><p>
+ This function returns &s.code;TRUE&e.code; if the entity referenced
+ by &s.code;entityIndex&e.code; is the primary display device (i.e.,
+ the one initialised at boot time and used in text mode).
+
+ </quote>
+
+ &s.code;Bool xf86IsScreenPrimary(int scrnIndex)&e.code;
+ <quote><p>
+ This function returns &s.code;TRUE&e.code; if the primary entity
+ is registered with the screen referenced by
+ &s.code;scrnIndex&e.code;.
+
+ </quote>
+
+ &s.code;pciVideoPtr xf86GetPciInfoForEntity(int entityIndex)&e.code;
+ <quote><p>
+ This function returns a pointer to the &s.code;pciVideoRec&e.code;
+ for the specified entity. If the entity is not a PCI device,
+ &s.code;NULL&e.code; is returned.
+
+ </quote>
+ </quote>
+
+The primary function for registration of resources is:
+ <quote><p>
+ &s.code;resPtr xf86RegisterResources(int entityIndex, resList list,
+ &f.indent;int access)&e.code;
+ <quote><p>
+ This function tries to register the resources in
+ &s.code;list&e.code;. If list is &s.code;NULL&e.code; it tries
+ to determine the resources automatically. This only works for
+ entities that provide a generic way to read out the resource ranges
+ they decode. So far this is only the case for PCI devices. By
+ default the PCI resources are registered as shared
+ (&s.code;ResShared&e.code;) if the driver wants to set a different
+ access type it can do so by specifying the access flags in the
+ third argument. A value of &s.code;0&e.code; means to use the
+ default settings. If for any reason the resource broker is not
+ able to register some of the requested resources the function will
+ return a pointer to a list of the failed ones. In this case the
+ driver may be able to move the resource to different locations.
+ In case of PCI bus entities this is done by passing the list of
+ failed resources to &s.code;xf86ReallocatePciResources()&e.code;.
+ When the registration succeeds, the return value is
+ &s.code;NULL&e.code;.
+
+ </quote>
+
+ &s.code;resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes)&e.code;
+ <quote><p>
+ This function takes a list of PCI resources that need to be
+ reallocated and returns &s.code;NULL&e.code when all relocations are
+ successful.
+ &s.code;xf86RegisterResources()&e.code; should be called again to
+ register the relocated resources with the broker.
+ If the reallocation fails, a list of the resources that could not be
+ relocated is returned.
+
+ </quote>
+ </quote>
+
+Two functions are provided to obtain a resource range of a given type:
+ <quote><p>
+ &s.code;resRange xf86GetBlock(long type, memType size,
+ &f.indent;memType window_start, memType window_end,
+ &f.indent;memType align_mask, resPtr avoid)&e.code;
+ <quote><p>
+ This function tries to find a block range of size
+ &s.code;size&e.code; and type &s.code;type&e.code; in a window
+ bound by &s.code;window_start&e.code; and &s.code;window_end&e.code;
+ with the alignment specified in &s.code;align_mask&e.code;.
+ Optionally a list of resource ranges which should be avoided within
+ the window can be supplied. On failure a zero-length range of
+ type &s.code;ResEnd&e.code; will be returned.
+
+ </quote>
+ &s.code;resRange xf86GetSparse(long type, memType fixed_bits,
+ &f.indent;memType decode_mask, memType address_mask,
+ &f.indent;resPtr avoid)&e.code;
+ <quote><p>
+ This function is like the previous one, but attempts to find a
+ sparse range instead of a block range. Here three values have to
+ be specified: the &s.code;address_mask&e.code; which marks all
+ bits of the mask part of the address, the &s.code;decode_mask&e.code;
+ which masks out the bits which are hardcoded and are therefore
+ not available for relocation and the values of the fixed bits.
+ The function tries to find a base that satisfies the given condition.
+ If the function fails it will return a zero range of type
+ &s.code;ResEnd&e.code;. Optionally it might be passed a list of
+ resource ranges to avoid.
+
+ </quote>
+ </quote>
+
+Some PCI devices are broken in the sense that they return invalid size
+information for a certain resource. In this case the driver can supply
+the correct size and make sure that the resource range allocated for
+the card is large enough to hold the address range decoded by the card.
+The function &s.code;xf86FixPciResource()&e.code; can be used to do this:
+ <quote><p>
+ &s.code;Bool xf86FixPciResource(int entityIndex, unsigned int prt,
+ &f.indent;CARD32 alignment, long type)&e.code;
+ <quote><p>
+ This function fixes a PCI resource allocation. The
+ &s.code;prt&e.code; parameter contains the number of the PCI base
+ register that needs to be fixed (&s.code;0-5&e.code;, and
+ &s.code;6&e.code; for the BIOS base register). The size is
+ specified by the alignment. Since PCI resources need to span an
+ integral range of size &s.code;2^n&e.code;, the alignment also
+ specifies the number of addresses that will be decoded. If the
+ driver specifies a type mask it can override the default type for
+ PCI resources which is &s.code;ResShared&e.code;. The resource
+ broker needs to know that to find a matching resource range. This
+ function should be called before calling
+ &s.code;xf86RegisterResources()&e.code;. The return value is
+ &s.code;TRUE&e.code; when the function succeeds.
+
+ </quote>
+
+ &s.code;Bool xf86CheckPciMemBase(pciVideoPtr pPci, memType base)&e.code;
+ <quote><p>
+ This function checks that the memory base address specified matches
+ one of the PCI base address register values for the given PCI
+ device. This is mostly used to check that an externally provided
+ base address (e.g., from a config file) matches an actual value
+ allocated to a device.
+
+ </quote>
+ </quote>
+
+The driver may replace the generic access control functions for an entity.
+This is done with the &s.code;xf86SetAccessFuncs()&e.code;:
+ <quote><p>
+ &s.code;void xf86SetAccessFuncs(EntityInfoPtr pEnt,
+ &f.indent;xf86SetAccessFuncPtr funcs,
+ &f.indent;xf86SetAccessFuncPtr oldFuncs)&e.code;
+ <quote><p>
+ with:
+ </quote>
+
+ <verb>
+ typedef struct {
+ xf86AccessPtr mem;
+ xf86AccessPtr io;
+ xf86AccessPtr io_mem;
+ } xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;
+ </verb>
+
+ <quote><p>
+ The driver can pass three functions: one for I/O access, one for
+ memory access and one for combined memory and I/O access. If the
+ memory access and combined access functions are identical the
+ common level assumes that the memory access cannot be controlled
+ independently of I/O access, if the I/O access function and the
+ combined access functions are the same it is assumed that I/O can
+ not be controlled independently. If memory and I/O have to be
+ controlled together all three values should be the same. If a
+ non &s.code;NULL&e.code; value is passed as third argument it is
+ interpreted as an address where to store the old access record.
+ If the third argument is &s.code;NULL&e.code; it will be assumed
+ that the generic access should be enabled before replacing the
+ access functions. Otherwise it will be disabled. The driver may
+ enable them itself using the returned values. It should do this
+ from its replacement access functions as the generic access may
+ be disabled by the common level on certain occasions. If replacement
+ functions are specified they must control all resources of the
+ specific type registered for the entity.
+
+ </quote>
+ </quote>
+
+To find out if a specific resource range conflicts with another
+resource the &s.code;xf86ChkConflict()&e.code; function may be used:
+ <quote><p>
+ &s.code;memType xf86ChkConflict(resRange *rgp, int entityIndex)&e.code;
+ <quote><p>
+ This function checks if the resource range &s.code;rgp&e.code; of
+ for the specified entity conflicts with with another resource.
+ If a conflict is found, the address of the start of the conflict
+ is returned. The return value is zero when there is no conflict.
+
+ </quote>
+ </quote>
+
+The OPERATING state properties of previously registered fixed resources
+can be set with the &s.code;xf86SetOperatingState()&e.code; function:
+ <quote><p>
+ &s.code;resPtr xf86SetOperatingState(resList list, int entityIndex,
+ &f.indent;int mask)&e.code;
+ <quote><p>
+ This function is used to set the status of a resource during
+ OPERATING state. &s.code;list&e.code; holds a list to which
+ &s.code;mask&e.code; is to be applied. The parameter
+ &s.code;mask&e.code; may have the value &s.code;ResUnusedOpr&e.code;
+ and &s.code;ResDisableOpr&e.code;. The first one should be used
+ if a resource isn't used by the driver during OPERATING state
+ although it is decoded by the device, while the latter one indicates
+ that the resource is not decoded during OPERATING state. Note
+ that the resource ranges have to match those specified during
+ registration. If a range has been specified starting at
+ &s.code;A&e.code; and ending at &s.code;B&e.code; and suppose
+ &s.code;C&e.code; us a value satisfying
+ &s.code;A&nbsp;&lt;&nbsp;C&nbsp;&lt;&nbsp;B&e.code; one may not
+ specify the resource range &s.code;(A,B)&e.code; by splitting it
+ into two ranges &s.code;(A,C)&e.code; and &s.code;(C,B)&e.code;.
+
+ </quote>
+ </quote>
+
+The following two functions are provided for special cases:
+ <quote><p>
+ &s.code;void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex)&e.code;
+ <quote><p>
+ This function may be used to remove an entity from a screen. This
+ only makes sense if a screen has more than one entity assigned or
+ the screen is to be deleted. No test is made if the screen has
+ any entities left.
+
+ </quote>
+
+ &s.code;void xf86DeallocateResourcesForEntity(int entityIndex, long type)&e.code;
+ <quote><p>
+ This function deallocates all resources of a given type registered
+ for a certain entity from the resource broker list.
+
+ </quote>
+ </quote>
+
+<sect2>ScreenInit Phase
+<p>
+
+All that is required in this phase is to setup the RAC flags. Note that
+it is also permissible to set these flags up in the PreInit phase. The
+RAC flags are held in the &s.code;racIoFlags&e.code; and &s.code;racMemFlags&e.code; fields of the
+&s.code;ScrnInfoRec&e.code; for each screen. They specify which graphics operations
+might require the use of shared resources. This can be specified
+separately for memory and I/O resources. The available flags are defined
+in &s.code;rac/xf86RAC.h&e.code;. They are:
+
+ &s.code;RAC_FB&e.code;
+ <quote>
+ for framebuffer operations (including hw acceleration)
+ </quote>
+ &s.code;RAC_CURSOR&e.code;
+ <quote>
+ for Cursor operations
+ (??? I'm not sure if we need this for SW cursor it depends
+ on which level the sw cursor is drawn)
+ </quote>
+ &s.code;RAC_COLORMAP&e.code;
+ <quote>
+ for colormap operations
+ </quote>
+ &s.code;RAC_VIEWPORT&e.code;
+ <quote>
+ for the call to &s.code;ChipAdjustFrame()&e.code; </quote>
+
+
+The flags are ORed together.
+
+<sect>Config file ``Option'' entries<label id="options">
+<p>
+
+Option entries are permitted in most sections and subsections of the
+config file. There are two forms of option entries:
+
+<descrip>
+<tag>Option "option-name"</tag>
+ A boolean option.
+<tag>Option "option-name" "option-value"</tag>
+ An option with an arbitrary value.
+</descrip>
+
+The option entries are handled by the parser, and a list of the parsed
+options is included with each of the appropriate data structures that
+the drivers have access to. The data structures used to hold the option
+information are opaque to the driver, and a driver must not access the
+option data directly. Instead, the common layer provides a set of
+functions that may be used to access, check and manipulate the option
+data.
+
+First, the low level option handling functions. In most cases drivers
+would not need to use these directly.
+
+ <quote><p>
+ &s.code;pointer xf86FindOption(pointer options, const char *name)&e.code;
+ <quote><p>
+ Takes a list of options and an option name, and returns a handle
+ for the first option entry in the list matching the name. Returns
+ &s.code;NULL&e.code; if no match is found.
+
+ </quote>
+
+ &s.code;char *xf86FindOptionValue(pointer options, const char *name)&e.code;
+ <quote><p>
+ Takes a list of options and an option name, and returns the value
+ associated with the first option entry in the list matching the
+ name. If the matching option has no value, an empty string
+ (&s.code;""&e.code;) is returned. Returns &s.code;NULL&e.code;
+ if no match is found.
+
+ </quote>
+
+ &s.code;void xf86MarkOptionUsed(pointer option)&e.code;
+ <quote><p>
+ Takes a handle for an option, and marks that option as used.
+
+ </quote>
+
+ &s.code;void xf86MarkOptionUsedByName(pointer options, const char *name)&e.code;
+ <quote><p>
+ Takes a list of options and an option name and marks the first
+ option entry in the list matching the name as used.
+
+ </quote>
+ </quote>
+
+
+Next, the higher level functions that most drivers would use.
+ <quote><p>
+ &s.code;void xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts)&e.code;
+ <quote><p>
+ Collect the options from each of the config file sections used by
+ the screen (&s.code;pScrn&e.code;) and return the merged list as
+ &s.code;pScrn-&gt;options&e.code;. This function requires that
+ &s.code;pScrn-&gt;confScreen&e.code;, &s.code;pScrn-&gt;display&e.code;,
+ &s.code;pScrn-&gt;monitor&e.code;,
+ &s.code;pScrn-&gt;numEntities&e.code;, and
+ &s.code;pScrn-&gt;entityList&e.code; are initialised.
+ &s.code;extraOpts&e.code; may optionally be set to an additional
+ list of options to be combined with the others. The order of
+ precedence for options is &s.code;extraOpts&e.code;, display,
+ confScreen, monitor, device.
+
+ </quote>
+
+ &s.code;void xf86ProcessOptions(int scrnIndex, pointer options,
+ &f.indent;OptionInfoPtr optinfo)&e.code;
+ <quote><p>
+ Processes a list of options according to the information in the
+ array of &s.code;OptionInfoRecs&e.code; (&s.code;optinfo&e.code;).
+ The resulting information is stored in the &s.code;value&e.code;
+ fields of the appropriate &s.code;optinfo&e.code; entries. The
+ &s.code;found&e.code; fields are set to &s.code;TRUE&e.code;
+ when an option with a value of the correct type if found, and
+ &s.code;FALSE&e.code; otherwise. The &s.code;type&e.code; field
+ is used to determine the expected value type for each option.
+ Each option in the list of options for which there is a name match
+ (but not necessarily a value type match) is marked as used.
+ Warning messages are printed when option values don't match the
+ types specified in the optinfo data.
+
+ NOTE: If this function is called before a driver's screen number
+ is known (e.g., from the &s.code;ChipProbe()&e.code; function) a
+ &s.code;scrnIndex&e.code; value of &s.code;-1&e.code; should be
+ used.
+
+ NOTE 2: Given that this function stores into the
+ &s.code;OptionInfoRecs&e.code; pointed to by &s.code;optinfo&e.code,
+ the caller should ensure the &s.code;OptionInfoRecs&e.code; are
+ (re-)initialised before the call, especially if the caller expects
+ to use the predefined option values as defaults.
+
+ The &s.code;OptionInfoRec&e.code; is defined as follows:
+
+ <verb>
+ typedef struct {
+ double freq;
+ int units;
+ } OptFrequency;
+
+ typedef union {
+ unsigned long num;
+ char * str;
+ double realnum;
+ Bool bool;
+ OptFrequency freq;
+ } ValueUnion;
+
+ typedef enum {
+ OPTV_NONE = 0,
+ OPTV_INTEGER,
+ OPTV_STRING, /* a non-empty string */
+ OPTV_ANYSTR, /* Any string, including an empty one */
+ OPTV_REAL,
+ OPTV_BOOLEAN,
+ OPTV_FREQ
+ } OptionValueType;
+
+ typedef enum {
+ OPTUNITS_HZ = 1,
+ OPTUNITS_KHZ,
+ OPTUNITS_MHZ
+ } OptFreqUnits;
+
+ typedef struct {
+ int token;
+ const char* name;
+ OptionValueType type;
+ ValueUnion value;
+ Bool found;
+ } OptionInfoRec, *OptionInfoPtr;
+ </verb>
+
+ &s.code;OPTV_FREQ&e.code; can be used for options values that are
+ frequencies. These values are a floating point number with an
+ optional unit name appended. The unit name can be one of "Hz",
+ "kHz", "k", "MHz", "M". The multiplier associated with the unit
+ is stored in &s.code;freq.units&e.code;, and the scaled frequency
+ is stored in &s.code;freq.freq&e.code;. When no unit is specified,
+ &s.code;freq.units&e.code; is set to &s.code;0&e.code;, and
+ &s.code;freq.freq&e.code; is unscaled.
+
+ Typical usage is to setup an array of
+ &s.code;OptionInfoRecs&e.code; with all fields initialised.
+ The &s.code;value&e.code; and &s.code;found&e.code; fields get
+ set by &s.code;xf86ProcessOptions()&e.code;. For cases where the
+ value parsing is more complex, the driver should specify
+ &s.code;OPTV_STRING&e.code;, and parse the string itself. An
+ example of using this option handling is included in the
+ <ref id="sample" name="Sample Driver"> section.
+
+ </quote>
+
+ &s.code;void xf86ShowUnusedOptions(int scrnIndex, pointer options)&e.code;
+ <quote><p>
+ Prints out warning messages for each option in the list of options
+ that isn't marked as used. This is intended to show options that
+ the driver hasn't recognised. It would normally be called near
+ the end of the &s.code;ChipScreenInit()&e.code; function, but only
+ when &s.code;serverGeneration&nbsp;==&nbsp;1&e.code;.
+
+ </quote>
+
+ &s.code;OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table,
+ &f.indent;int token)&e.code;
+
+ <quote><p>
+ Returns a pointer to the &s.code;OptionInfoRec&e.code; in
+ &s.code;table&e.code; with a token field matching
+ &s.code;token&e.code;. Returns &s.code;NULL&e.code; if no match
+ is found.
+
+ </quote>
+
+ &s.code;Bool xf86IsOptionSet(const OptionInfoRec *table, int token)&e.code;
+ <quote><p>
+ Returns the &s.code;found&e.code; field of the
+ &s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a
+ &s.code;token&e.code; field matching &s.code;token&e.code;. This
+ can be used for options of all types. Note that for options of
+ type &s.code;OPTV_BOOLEAN&e.code;, it isn't sufficient to check
+ this to determine the value of the option. Returns
+ &s.code;FALSE&e.code; if no match is found.
+
+ </quote>
+
+ &s.code;char *xf86GetOptValString(const OptionInfoRec *table, int token)&e.code;
+ <quote><p>
+ Returns the &s.code;value.str&e.code; field of the
+ &s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a
+ token field matching &s.code;token&e.code;. Returns
+ &s.code;NULL&e.code; if no match is found.
+
+ </quote>
+
+ &s.code;Bool xf86GetOptValInteger(const OptionInfoRec *table, int token,
+ &f.indent;int *value)&e.code;
+ <quote><p>
+ Returns via &s.code;*value&e.code; the &s.code;value.num&e.code;
+ field of the &s.code;OptionInfoRec&e.code; in &s.code;table&e.code;
+ with a &s.code;token&e.code; field matching &s.code;token&e.code;.
+ &s.code;*value&e.code; is only changed when a match is found so
+ it can be safely initialised with a default prior to calling this
+ function. The function return value is as for
+ &s.code;xf86IsOptionSet()&e.code;.
+
+ </quote>
+
+ &s.code;Bool xf86GetOptValULong(const OptionInfoRec *table, int token,
+ &f.indent;unsigned long *value)&e.code;
+ <quote><p>
+ Like &s.code;xf86GetOptValInteger()&e.code;, except the value is
+ treated as an &s.code;unsigned long&e.code;.
+
+ </quote>
+
+ &s.code;Bool xf86GetOptValReal(const OptionInfoRec *table, int token,
+ &f.indent;double *value)&e.code;
+ <quote><p>
+ Like &s.code;xf86GetOptValInteger()&e.code;, except that
+ &s.code;value.realnum&e.code; is used.
+
+ </quote>
+
+ &s.code;Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
+ &f.indent;OptFreqUnits expectedUnits, double *value)&e.code;
+ <quote><p>
+ Like &s.code;xf86GetOptValInteger()&e.code;, except that the
+ &s.code;value.freq&e.code; data is returned. The frequency value
+ is scaled to the units indicated by &s.code;expectedUnits&e.code;.
+ The scaling is exact when the units were specified explicitly in
+ the option's value. Otherwise, the &s.code;expectedUnits&e.code;
+ field is used as a hint when doing the scaling. In this case,
+ values larger than &s.code;1000&e.code; are assumed to have be
+ specified in the next smallest units. For example, if the Option
+ value is "10000" and expectedUnits is &s.code;OPTUNITS_MHZ&e.code;,
+ the value returned is &s.code;10&e.code;.
+
+ </quote>
+
+ &s.code;Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value)&e.code;
+ <quote><p>
+ This function is used to check boolean options
+ (&s.code;OPTV_BOOLEAN&e.code;). If the function return value is
+ &s.code;FALSE&e.code;, it means the option wasn't set. Otherwise
+ &s.code;*value&e.code; is set to the boolean value indicated by
+ the option's value. No option &s.code;value&e.code; is interpreted
+ as &s.code;TRUE&e.code;. Option values meaning &s.code;TRUE&e.code;
+ are "1", "yes", "on", "true", and option values meaning
+ &s.code;FALSE&e.code; are "0", "no", "off", "false". Option names
+ both with the "no" prefix in their names, and with that prefix
+ removed are also checked and handled in the obvious way.
+ &s.code;*value&e.code; is not changed when the option isn't present.
+ It should normally be set to a default value before calling this
+ function.
+
+ </quote>
+
+ &s.code;Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def)&e.code;
+ <quote><p>
+ This function is used to check boolean options
+ (&s.code;OPTV_BOOLEAN&e.code;). If the option is set, its value
+ is returned. If the options is not set, the default value specified
+ by &s.code;def&e.code; is returned. The option interpretation is
+ the same as for &s.code;xf86GetOptValBool()&e.code;.
+
+ </quote>
+
+ &s.code;int xf86NameCmp(const char *s1, const char *s2)&e.code;
+ <quote><p>
+ This function should be used when comparing strings from the config
+ file with expected values. It works like &s.code;strcmp()&e.code;,
+ but is not case sensitive and space, tab, and `<tt>_</tt>' characters
+ are ignored in the comparison. The use of this function isn't
+ restricted to parsing option values. It may be used anywhere
+ where this functionality required.
+
+ </quote>
+ </quote>
+
+<sect>Modules, Drivers, Include Files and Interface Issues
+<p>
+
+NOTE: this section is incomplete.
+
+
+<sect1>Include files
+<p>
+
+The following include files are typically required by video drivers:
+
+ <quote><p>
+ All drivers should include these:
+ <quote>
+ &s.code;"xf86.h"&nl;
+ "xf86_OSproc.h"&nl;
+ "xf86_ansic.h"&nl;
+ "xf86Resources.h"&e.code;
+ </quote>
+ Wherever inb/outb (and related things) are used the following should be
+ included:
+ <quote>
+ &s.code;"compiler.h"&e.code;
+ </quote>
+ Note: in drivers, this must be included after &s.code;"xf86_ansic.h"&e.code;.
+
+ Drivers that need to access PCI vendor/device definitions need this:
+ <quote>
+ &s.code;"xf86PciInfo.h"&e.code;
+ </quote>
+
+ Drivers that need to access the PCI config space need this:
+ <quote>
+ &s.code;"xf86Pci.h"&e.code;
+ </quote>
+
+ Drivers that initialise a SW cursor need this:
+ <quote>
+ &s.code;"mipointer.h"&e.code;
+ </quote>
+
+ All drivers implementing backing store need this:
+ <quote>
+ &s.code;"mibstore.h"&e.code;
+ </quote>
+
+ All drivers using the mi colourmap code need this:
+ <quote>
+ &s.code;"micmap.h"&e.code;
+ </quote>
+
+ If a driver uses the vgahw module, it needs this:
+ <quote>
+ &s.code;"vgaHW.h"&e.code;
+ </quote>
+
+ Drivers supporting VGA or Hercules monochrome screens need:
+ <quote>
+ &s.code;"xf1bpp.h"&e.code;
+ </quote>
+
+ Drivers supporting VGA or EGC 16-colour screens need:
+ <quote>
+ &s.code;"xf4bpp.h"&e.code;
+ </quote>
+
+ Drivers using cfb need:
+ <quote>
+ &s.code;#define PSZ 8&nl;
+ #include "cfb.h"&nl;
+ #undef PSZ&e.code;
+ </quote>
+
+ Drivers supporting bpp 16, 24 or 32 with cfb need one or more of:
+ <quote>
+ &s.code;"cfb16.h"&nl;
+ "cfb24.h"&nl;
+ "cfb32.h"&e.code;
+ </quote>
+
+ If a driver uses XAA, it needs these:
+ <quote>
+ &s.code;"xaa.h"&nl;
+ "xaalocal.h"&e.code;
+ </quote>
+
+ If a driver uses the fb manager, it needs this:
+ <quote>
+ &s.code;"xf86fbman.h"&e.code;
+ </quote>
+ </quote>
+
+Non-driver modules should include &s.code;"xf86_ansic.h"&e.code; to get the correct
+wrapping of ANSI C/libc functions.
+
+All modules must NOT include any system include files, or the following:
+
+ <quote>
+ &s.code;"xf86Priv.h"&nl;
+ "xf86Privstr.h"&nl;
+ "xf86_OSlib.h"&nl;
+ "Xos.h"&e.code;
+ </quote>
+
+In addition, "xf86_libc.h" must not be included explicitly. It is
+included implicitly by "xf86_ansic.h".
+
+
+<sect>Offscreen Memory Manager
+<p>
+
+Management of offscreen video memory may be handled by the XFree86
+framebuffer manager. Once the offscreen memory manager is running,
+drivers or extensions may allocate, free or resize areas of offscreen
+video memory using the following functions (definitions taken from
+&s.code;xf86fbman.h&e.code;):
+
+<code>
+ typedef struct _FBArea {
+ ScreenPtr pScreen;
+ BoxRec box;
+ int granularity;
+ void (*MoveAreaCallback)(struct _FBArea*, struct _FBArea*)
+ void (*RemoveAreaCallback)(struct _FBArea*)
+ DevUnion devPrivate;
+ } FBArea, *FBAreaPtr;
+
+ typedef void (*MoveAreaCallbackProcPtr)(FBAreaPtr from, FBAreaPtr to)
+ typedef void (*RemoveAreaCallbackProcPtr)(FBAreaPtr)
+
+ FBAreaPtr xf86AllocateOffscreenArea (
+ ScreenPtr pScreen,
+ int width, int height,
+ int granularity,
+ MoveAreaCallbackProcPtr MoveAreaCallback,
+ RemoveAreaCallbackProcPtr RemoveAreaCallback,
+ pointer privData
+ )
+
+ void xf86FreeOffscreenArea (FBAreaPtr area)
+
+ Bool xf86ResizeOffscreenArea (
+ FBAreaPtr area
+ int w, int h
+ )
+</code>
+
+The function:
+<quote>
+ &s.code;Bool xf86FBManagerRunning(ScreenPtr pScreen)&e.code;
+</quote>
+
+can be used by an extension to check if the driver has initialized
+the memory manager. The manager is not available if this returns
+&s.code;FALSE&e.code; and the functions above will all fail.
+
+
+&s.code;xf86AllocateOffscreenArea()&e.code; can be used to request a
+rectangle of dimensions &s.code;width&e.code; x &s.code;height&e.code;
+(in pixels) from unused offscreen memory. &s.code;granularity&e.code;
+specifies that the leftmost edge of the rectangle must lie on some
+multiple of &s.code;granularity&e.code; pixels. A granularity of zero
+means the same thing as a granularity of one - no alignment preference.
+A &s.code;MoveAreaCallback&e.code; can be provided to notify the requester
+when the offscreen area is moved. If no &s.code;MoveAreaCallback&e.code;
+is supplied then the area is considered to be immovable. The
+&s.code;privData&e.code; field will be stored in the manager's internal
+structure for that allocated area and will be returned to the requester
+in the &s.code;FBArea&e.code; passed via the
+&s.code;MoveAreaCallback&e.code;. An optional
+&s.code;RemoveAreaCallback&e.code; is provided. If the driver provides
+this it indicates that the area should be allocated with a lower priority.
+Such an area may be removed when a higher priority request (one that
+doesn't have a &s.code;RemoveAreaCallback&e.code;) is made. When this
+function is called, the driver will have an opportunity to do whatever
+cleanup it needs to do to deal with the loss of the area, but it must
+finish its cleanup before the function exits since the offscreen memory
+manager will free the area immediately after.
+
+&s.code;xf86AllocateOffscreenArea()&e.code; returns &s.code;NULL&e.code;
+if it was unable to allocate the requested area. When no longer needed,
+areas should be freed with &s.code;xf86FreeOffscreenArea()&e.code;.
+
+&s.code;xf86ResizeOffscreenArea()&e.code; resizes an existing
+&s.code;FBArea&e.code;. &s.code;xf86ResizeOffscreenArea()&e.code;
+returns &s.code;TRUE&e.code; if the resize was successful. If
+&s.code;xf86ResizeOffscreenArea()&e.code; returns &s.code;FALSE&e.code;,
+the original &s.code;FBArea&e.code; is left unmodified. Resizing an
+area maintains the area's original &s.code;granularity&e.code;,
+&s.code;devPrivate&e.code;, and &s.code;MoveAreaCallback&e.code;.
+&s.code;xf86ResizeOffscreenArea()&e.code; has considerably less overhead
+than freeing the old area then reallocating the new size, so it should
+be used whenever possible.
+
+The function:
+ <quote>
+ &s.code;Bool xf86QueryLargestOffscreenArea(
+ &f.indent;ScreenPtr pScreen,
+ &f.indent;int *width, int *height,
+ &f.indent;int granularity,
+ &f.indent;int preferences,
+ &f.indent;int priority
+ &nl)&e.code;
+ </quote>
+
+is provided to query the width and height of the largest single
+&s.code;FBArea&e.code; allocatable given a particular priority.
+&s.code;preferences&e.code; can be one of the following to indicate
+whether width, height or area should be considered when determining
+which is the largest single &s.code;FBArea&e.code; available.
+
+ <quote>
+ &s.code;FAVOR_AREA_THEN_WIDTH&nl;
+ FAVOR_AREA_THEN_HEIGHT&nl;
+ FAVOR_WIDTH_THEN_AREA&nl;
+ FAVOR_HEIGHT_THEN_AREA&e.code;
+ </quote>
+
+&s.code;priority&e.code; is one of the following:
+
+ <quote><p>
+ &s.code;PRIORITY_LOW&e.code;
+ <quote><p>
+ Return the largest block available without stealing anyone else's
+ space. This corresponds to the priority of allocating a
+ &s.code;FBArea&e.code; when a &s.code;RemoveAreaCallback&e.code;
+ is provided.
+
+ </quote>
+ &s.code;PRIORITY_NORMAL&e.code;
+ <quote><p>
+ Return the largest block available if it is acceptable to steal a
+ lower priority area from someone. This corresponds to the priority
+ of allocating a &s.code;FBArea&e.code; without providing a
+ &s.code;RemoveAreaCallback&e.code;.
+
+ </quote>
+ &s.code;PRIORITY_EXTREME&e.code;
+ <quote><p>
+ Return the largest block available if all &s.code;FBAreas&e.code;
+ that aren't locked down were expunged from memory first. This
+ corresponds to any allocation made directly after a call to
+ &s.code;xf86PurgeUnlockedOffscreenAreas()&e.code;.
+
+ </quote>
+ </quote>
+
+
+The function:
+
+ <quote>
+ &s.code;Bool xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen)&e.code;
+ </quote>
+
+is provided as an extreme method to free up offscreen memory. This
+will remove all removable &s.code;FBArea&e.code; allocations.
+
+
+Initialization of the XFree86 framebuffer manager is done via
+
+ <quote>
+ &s.code;Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox)&e.code;
+ </quote>
+
+&s.code;FullBox&e.code; represents the area of the framebuffer that the
+manager is allowed to manage. This is typically a box with a width of
+&s.code;pScrn-&gt;displayWidth&e.code; and a height of as many lines as
+can be fit within the total video memory, however, the driver can reserve
+areas at the extremities by passing a smaller area to the manager.
+
+&s.code;xf86InitFBManager()&e.code; must be called before XAA is
+initialized since XAA uses the manager for it's pixmap cache.
+
+An alternative function is provided to allow the driver to initialize
+the framebuffer manager with a Region rather than a box.
+
+ <quote>
+ &s.code;Bool xf86InitFBManagerRegion(ScreenPtr pScreen,
+ &f.indent;RegionPtr FullRegion)&e.code;
+ </quote>
+
+&s.code;xf86InitFBManagerRegion()&e.code;, unlike
+&s.code;xf86InitFBManager()&e.code;, does not remove the area used for
+the visible screen so that area should not be included in the region
+passed to the function. &s.code;xf86InitFBManagerRegion()&e.code; is
+useful when non-contiguous areas are available to be managed, and is
+required when multiple framebuffers are stored in video memory (as in
+the case where an overlay of a different depth is stored as a second
+framebuffer in offscreen memory).
+
+
+<sect>Colormap Handling<label id="cmap">
+<p>
+
+A generic colormap handling layer is provided within the XFree86 common
+layer. This layer takes care of most of the details, and only requires
+a function from the driver that loads the hardware palette when required.
+To use the colormap layer, a driver calls the
+&s.code;xf86HandleColormaps()&e.code; function.
+
+ <quote><p>
+ &s.code;Bool xf86HandleColormaps(ScreenPtr pScreen, int maxColors,
+ &f.indent;int sigRGBbits, LoadPaletteFuncPtr loadPalette,
+ &f.indent;SetOverscanFuncPtr setOverscan,
+ unsigned int flags)&e.code;
+ <quote><p>
+ This function must be called after the default colormap has been
+ initialised. The &s.code;pScrn-&gt;gamma&e.code; field must also
+ be initialised, preferably by calling &s.code;xf86SetGamma()&e.code;.
+ &s.code;maxColors&e.code; is the number of entries in the palette.
+ &s.code;sigRGBbits&e.code; is the size in bits of each color
+ component in the DAC's palette. &s.code;loadPalette&e.code;
+ is a driver-provided function for loading a colormap into the
+ hardware, and is described below. &s.code;setOverscan&e.code; is
+ an optional function that may be provided when the overscan color
+ is an index from the standard LUT and when it needs to be adjusted
+ to keep it as close to black as possible. The
+ &s.code;setOverscan&e.code; function programs the overscan index.
+ It shouldn't normally be used for depths other than 8.
+ &s.code;setOverscan&e.code; should be set to &s.code;NULL&e.code;
+ when it isn't needed. &s.code;flags&e.code; may be set to the
+ following (which may be ORed together):
+
+ &s.code;CMAP_PALETTED_TRUECOLOR&e.code;
+ <quote><p>
+ the TrueColor visual is paletted and is
+ just a special case of DirectColor.
+ This flag is only valid for
+ &s.code;bpp&nbsp;&gt;&nbsp;8&e.code;.
+
+ </quote>
+
+ &s.code;CMAP_RELOAD_ON_MODE_SWITCH&e.code;
+ <quote><p>
+ reload the colormap automatically
+ after mode switches. This is useful
+ for when the driver is resetting the
+ hardware during mode switches and
+ corrupting or erasing the hardware
+ palette.
+
+ </quote>
+
+ &s.code;CMAP_LOAD_EVEN_IF_OFFSCREEN&e.code;
+ <quote><p>
+ reload the colormap even if the screen
+ is switched out of the server's VC.
+ The palette is <it>not</it> reloaded when
+ the screen is switched back in, nor after
+ mode switches. This is useful when the
+ driver needs to keep track of palette
+ changes.
+
+ </quote>
+
+ The colormap layer normally reloads the palette after VT enters so it
+ is not necessary for the driver to save and restore the palette
+ when switching VTs. The driver must, however, still save the
+ initial palette during server start up and restore it during
+ server exit.
+
+ </quote>
+
+ &s.code;void LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
+ &f.indent;LOCO *colors, VisualPtr pVisual)&e.code;
+ <quote><p>
+ &s.code;LoadPalette()&e.code; is a driver-provided function for
+ loading a colormap into hardware. &s.code;colors&e.code; is the
+ array of RGB values that represent the full colormap.
+ &s.code;indices&e.code; is a list of index values into the colors
+ array. These indices indicate the entries that need to be updated.
+ &s.code;numColors&e.code; is the number of the indices to be
+ updated.
+
+ </quote>
+
+ &s.code;void SetOverscan(ScrnInfoPtr pScrn, int overscan)&e.code;
+ <quote><p>
+ &s.code;SetOverscan()&e.code; is a driver-provided function for
+ programming the &s.code;overscan&e.code; index. As described
+ above, it is normally only appropriate for LUT modes where all
+ colormap entries are available for the display, but where one of
+ them is also used for the overscan (typically 8bpp for VGA compatible
+ LUTs). It isn't required in cases where the overscan area is
+ never visible.
+
+ </quote>
+ </quote>
+
+
+<sect>DPMS Extension
+<p>
+
+Support code for the DPMS extension is included in the XFree86 common layer.
+This code provides an interface between the main extension code, and a means
+for drivers to initialise DPMS when they support it. One function is
+available to drivers to do this initialisation, and it is always available,
+even when the DPMS extension is not supported by the core server (in
+which case it returns a failure result).
+
+
+ <quote><p>
+ &s.code;Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)&e.code;
+ <quote><p>
+ This function registers a driver's DPMS level programming function
+ &s.code;set&e.code;. It also checks
+ &s.code;pScrn-&gt;options&e.code; for the "dpms" option, and when
+ present marks DPMS as being enabled for that screen. The
+ &s.code;set&e.code; function is called whenever the DPMS level
+ changes, and is used to program the requested level.
+ &s.code;flags&e.code; is currently not used, and should be
+ &s.code;0&e.code;. If the initialisation fails for any reason,
+ including when there is no DPMS support in the core server, the
+ function returns &s.code;FALSE&e.code;.
+
+ </quote>
+ </quote>
+
+
+Drivers that implement DPMS support must provide the following function,
+that gets called when the DPMS level is changed:
+
+
+ <quote><p>
+ &s.code;void ChipDPMSSet(ScrnInfoPtr pScrn, int level, int flags)&e.code;
+ <quote><p>
+ Program the DPMS level specified by &s.code;level&e.code;. Valid
+ values of &s.code;level&e.code; are &s.code;DPMSModeOn&e.code;,
+ &s.code;DPMSModeStandby&e.code;, &s.code;DPMSModeSuspend&e.code;,
+ &s.code;DPMSModeOff&e.code;. These values are defined in
+ &s.code;"extensions/dpms.h"&e.code;.
+
+ </quote>
+ </quote>
+
+
+<sect>DGA Extension
+<p>
+
+Drivers can support the XFree86 Direct Graphics Architecture (DGA) by
+filling out a structure of function pointers and a list of modes and
+passing them to DGAInit.
+
+ <quote><p>
+ &s.code;Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs,
+ &f.indent;DGAModePtr modes, int num)&e.code;
+ <quote><p>
+ <verb>
+/** The DGAModeRec **/
+
+typedef struct {
+ int num;
+ DisplayModePtr mode;
+ int flags;
+ int imageWidth;
+ int imageHeight;
+ int pixmapWidth;
+ int pixmapHeight;
+ int bytesPerScanline;
+ int byteOrder;
+ int depth;
+ int bitsPerPixel;
+ unsigned long red_mask;
+ unsigned long green_mask;
+ unsigned long blue_mask;
+ int viewportWidth;
+ int viewportHeight;
+ int xViewportStep;
+ int yViewportStep;
+ int maxViewportX;
+ int maxViewportY;
+ int viewportFlags;
+ int offset;
+ unsigned char *address;
+ int reserved1;
+ int reserved2;
+} DGAModeRec, *DGAModePtr;
+</verb>
+
+ &s.code;num&e.code;
+ <quote>
+ Can be ignored. The DGA DDX will assign these numbers.
+ </quote>
+
+ &s.code;mode&e.code;
+ <quote>
+ A pointer to the &s.code;DisplayModeRec&e.code; for this mode.
+ </quote>
+
+ &s.code;flags&e.code;
+ <quote><p>
+ The following flags are defined and may be OR'd together:
+
+ &s.code;DGA_CONCURRENT_ACCESS&e.code;
+ <quote><p>
+ Indicates that the driver supports concurrent graphics
+ accelerator and linear framebuffer access.
+
+ </quote>
+
+ &s.code;DGA_FILL_RECT&nl;
+ DGA_BLIT_RECT&nl;
+ DGA_BLIT_RECT_TRANS&e.code;
+ <quote><p>
+ Indicates that the driver supports the FillRect, BlitRect
+ or BlitTransRect functions in this mode.
+
+ </quote>
+
+ &s.code;DGA_PIXMAP_AVAILABLE&e.code;
+ <quote><p>
+ Indicates that Xlib may be used on the framebuffer.
+ This flag will usually be set unless the driver wishes
+ to prohibit this for some reason.
+
+ </quote>
+
+ &s.code;DGA_INTERLACED&nl;
+ DGA_DOUBLESCAN&e.code;
+ <quote><p>
+ Indicates that these are interlaced or double scan modes.
+
+ </quote>
+ </quote>
+
+ &s.code;imageWidth&nl;
+ imageHeight&e.code;
+ <quote><p>
+ These are the dimensions of the linear framebuffer
+ accessible by the client.
+
+ </quote>
+
+ &s.code;pixmapWidth&nl;
+ pixmapHeight&e.code;
+ <quote><p>
+ These are the dimensions of the area of the
+ framebuffer accessible by the graphics accelerator.
+
+ </quote>
+
+ &s.code;bytesPerScanline&e.code;
+ <quote><p>
+ Pitch of the framebuffer in bytes.
+
+ </quote>
+
+ &s.code;byteOrder&e.code;
+ <quote><p>
+ Usually the same as
+ &s.code;pScrn-&gt;imageByteOrder&e.code;.
+
+ </quote>
+
+ &s.code;depth&e.code;
+ <quote><p>
+ The depth of the framebuffer in this mode.
+
+ </quote>
+
+ &s.code;bitsPerPixel&e.code;
+ <quote><p>
+ The number of bits per pixel in this mode.
+
+ </quote>
+
+ &s.code;red_mask&nl;
+ green_mask&nl;
+ blue_mask&e.code;
+ <quote><p>
+ The RGB masks for this mode, if applicable.
+
+ </quote>
+
+ &s.code;viewportWidth&nl;
+ viewportHeight&e.code;
+ <quote><p>
+ Dimensions of the visible part of the framebuffer.
+ Usually &s.code;mode-&gt;HDisplay&e.code; and
+ &s.code;mode-&gt;VDisplay&e.code;.
+
+ </quote>
+
+ &s.code;xViewportStep&nl;
+ yViewportStep&e.code;
+ <quote><p>
+ The granularity of x and y viewport positions that
+ the driver supports in this mode.
+
+ </quote>
+
+ &s.code;maxViewportX&nl;
+ maxViewportY&e.code;
+ <quote><p>
+ The maximum viewport position supported by the
+ driver in this mode.
+
+ </quote>
+
+ &s.code;viewportFlags&e.code;
+ <quote><p>
+ The following may be OR'd together:
+
+ &s.code;DGA_FLIP_IMMEDIATE&e.code;
+ <quote><p>
+ The driver supports immediate viewport changes.
+
+ </quote>
+ &s.code;DGA_FLIP_RETRACE&e.code;
+ <quote<p>
+ The driver supports viewport changes at retrace.
+
+ </quote>
+ </quote>
+
+ &s.code;offset&e.code;
+ <quote><p>
+ The offset into the linear framebuffer that corresponds to
+ pixel (0,0) for this mode.
+
+ </quote>
+
+ &s.code;address&e.code;
+ <quote><p>
+ The virtual address of the framebuffer as mapped by the driver.
+ This is needed when DGA_PIXMAP_AVAILABLE is set.
+
+ </quote>
+
+ <verb>
+/** The DGAFunctionRec **/
+
+typedef struct {
+ Bool (*OpenFramebuffer)(
+ ScrnInfoPtr pScrn,
+ char **name,
+ unsigned char **mem,
+ int *size,
+ int *offset,
+ int *extra
+ );
+ void (*CloseFramebuffer)(ScrnInfoPtr pScrn);
+ Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
+ void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
+ int (*GetViewport)(ScrnInfoPtr pScrn);
+ void (*Sync)(ScrnInfoPtr);
+ void (*FillRect)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned long color
+ );
+ void (*BlitRect)(
+ ScrnInfoPtr pScrn,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty
+ );
+ void (*BlitTransRect)(
+ ScrnInfoPtr pScrn,
+ int srcx, int srcy,
+ int w, int h,
+ int dstx, int dsty,
+ unsigned long color
+ );
+} DGAFunctionRec, *DGAFunctionPtr;
+</verb>
+
+ </quote>
+
+ &s.code;Bool OpenFramebuffer (pScrn, name, mem, size, offset, extra)&e.code;
+ <quote><p>
+ &s.code;OpenFramebuffer()&e.code; should pass the client everything
+ it needs to know to be able to open the framebuffer. These
+ parameters are OS specific and their meanings are to be interpreted
+ by an OS specific client library.
+
+ &s.code;name&e.code;
+ <quote><p>
+ The name of the device to open or &s.code;NULL&e.code; if
+ there is no special device to open. A &s.code;NULL&e.code;
+ name tells the client that it should open whatever device
+ one would usually open to access physical memory.
+
+ </quote>
+ &s.code;mem&e.code;
+ <quote><p>
+ The physical address of the start of the framebuffer.
+
+ </quote>
+ &s.code;size&e.code;
+ <quote><p>
+ The size of the framebuffer in bytes.
+
+ </quote>
+ &s.code;offset&e.code;
+ <quote><p>
+ Any offset into the device, if applicable.
+
+ </quote>
+ &s.code;flags&e.code;
+ <quote><p>
+ Any additional information that the client may need.
+ Currently, only the &s.code;DGA_NEED_ROOT&e.code; flag is
+ defined.
+
+ </quote>
+ </quote>
+
+ &s.code;void CloseFramebuffer (pScrn)&e.code;
+ <quote><p>
+ &s.code;CloseFramebuffer()&e.code; merely informs the driver (if it
+ even cares) that client no longer needs to access the framebuffer
+ directly. This function is optional.
+
+ </quote>
+
+ &s.code;Bool SetMode (pScrn, pMode)&e.code;
+ <quote><p>
+ &s.code;SetMode()&e.code; tells the driver to initialize the mode
+ passed to it. If &s.code;pMode&e.code; is &s.code;NULL&e.code;,
+ then the driver should restore the original pre-DGA mode.
+
+ </quote>
+
+ &s.code;void SetViewport (pScrn, x, y, flags)&e.code;
+ <quote><p>
+ &s.code;SetViewport()&e.code; tells the driver to make the upper
+ left-hand corner of the visible screen correspond to coordinate
+ &s.code;(x,y)&e.code; on the framebuffer. &s.code;Flags&e.code;
+ currently defined are:
+
+ &s.code;DGA_FLIP_IMMEDIATE&e.code;
+ <quote><p>
+ The viewport change should occur immediately.
+
+ </quote>
+ &s.code;DGA_FLIP_RETRACE&e.code;
+ <quote><p>
+ The viewport change should occur at the
+ vertical retrace, but this function should
+ return sooner if possible.
+
+ </quote>
+ The &s.code;(x,y)&e.code; locations will be passed as the client
+ specified them, however, the driver is expected to round these
+ locations down to the next supported location as specified by the
+ &s.code;xViewportStep&e.code; and &s.code;yViewportStep&e.code;
+ for the current mode.
+
+ </quote>
+
+ &s.code;int GetViewport (pScrn)&e.code;
+ <quote><p>
+ &s.code;GetViewport()&e.code; gets the current page flip status.
+ Set bits in the returned int correspond to viewport change requests
+ still pending. For instance, set bit zero if the last SetViewport
+ request is still pending, bit one if the one before that is still
+ pending, etc.
+
+ </quote>
+
+ &s.code;void Sync (pScrn)&e.code;
+ <quote><p>
+ This function should ensure that any graphics accelerator operations
+ have finished. This function should not return until the graphics
+ accelerator is idle.
+
+ </quote>
+
+ &s.code;void FillRect (pScrn, x, y, w, h, color)&e.code;
+ <quote><p>
+ This optional function should fill a rectangle
+ &s.code;w&nbsp;&times;&nbsp;h&e.code; located at
+ &s.code;(x,y)&e.code; in the given color.
+
+ </quote>
+
+ &s.code;void BlitRect (pScrn, srcx, srcy, w, h, dstx, dsty)&e.code;
+ <quote><p>
+ This optional function should copy an area
+ &s.code;w&nbsp;&times;&nbsp;h&e.code; located at
+ &s.code;(srcx,srcy)&e.code; to location &s.code;(dstx,dsty)&e.code;.
+ This function will need to handle copy directions as appropriate.
+
+ </quote>
+
+ &s.code;void BlitTransRect (pScrn, srcx, srcy, w, h, dstx, dsty, color)&e.code;
+ <quote><p>
+ This optional function is the same as BlitRect except that pixels
+ in the source corresponding to the color key &s.code;color&e.code;
+ should be skipped.
+
+ </quote>
+ </quote>
+
+<sect>The XFree86 X Video Extension (Xv) Device Dependent Layer
+<p>
+
+XFree86 offers the X Video Extension which allows clients to treat video
+as any another primitive and ``Put'' video into drawables. By default,
+the extension reports no video adaptors as being available since the
+DDX layer has not been initialized. The driver can initialize the DDX
+layer by filling out one or more &s.code;XF86VideoAdaptorRecs&e.code;
+as described later in this document and passing a list of
+&s.code;XF86VideoAdaptorPtr&e.code; pointers to the following function:
+
+ <quote>
+ &s.code;Bool xf86XVScreenInit(
+ &f.indent;ScreenPtr pScreen,
+ &f.indent;XF86VideoAdaptorPtr *adaptPtrs,
+ &f.indent;int num)&e.code;
+ </quote>
+
+After doing this, the extension will report video adaptors as being
+available, providing the data in their respective
+&s.code;XF86VideoAdaptorRecs&e.code; was valid.
+&s.code;xf86XVScreenInit()&e.code; <em>copies</em> data from the structure
+passed to it so the driver may free it after the initialization. At
+the moment, the DDX only supports rendering into Window drawables.
+Pixmap rendering will be supported after a sufficient survey of suitable
+hardware is completed.
+
+The &s.code;XF86VideoAdaptorRec&e.code;:
+
+<quote><p>
+<verb>
+typedef struct {
+ unsigned int type;
+ int flags;
+ char *name;
+ int nEncodings;
+ XF86VideoEncodingPtr pEncodings;
+ int nFormats;
+ XF86VideoFormatPtr pFormats;
+ int nPorts;
+ DevUnion *pPortPrivates;
+ int nAttributes;
+ XF86AttributePtr pAttributes;
+ int nImages;
+ XF86ImagePtr pImages;
+ PutVideoFuncPtr PutVideo;
+ PutStillFuncPtr PutStill;
+ GetVideoFuncPtr GetVideo;
+ GetStillFuncPtr GetStill;
+ StopVideoFuncPtr StopVideo;
+ SetPortAttributeFuncPtr SetPortAttribute;
+ GetPortAttributeFuncPtr GetPortAttribute;
+ QueryBestSizeFuncPtr QueryBestSize;
+ PutImageFuncPtr PutImage;
+ QueryImageAttributesFuncPtr QueryImageAttributes;
+} XF86VideoAdaptorRec, *XF86VideoAdaptorPtr;
+</verb>
+
+ Each adaptor will have its own XF86VideoAdaptorRec. The fields are
+ as follows:
+
+ &s.code;type&e.code;
+ <quote><p>
+ This can be any of the following flags OR'd together.
+
+ &s.code;XvInputMask&e.code;
+ &s.code;XvOutputMask&e.code;
+ <quote><p>
+ These refer to the target drawable and are similar to a Window's
+ class. &s.code;XvInputMask&e.code; indicates that the adaptor
+ can put video into a drawable. &s.code;XvOutputMask&e.code;
+ indicates that the adaptor can get video from a drawable.
+ </quote>
+
+ &s.code;XvVideoMask&e.code;
+ &s.code;XvStillMask&e.code;
+ &s.code;XvImageMask&e.code;
+ <quote><p>
+ These indicate that the adaptor supports video, still or
+ image primitives respectively.
+ </quote>
+
+ &s.code;XvWindowMask&e.code;
+ &s.code;XvPixmapMask&e.code;
+ <quote><p>
+ These indicate the types of drawables the adaptor is capable
+ of rendering into. At the moment, Pixmap rendering is not
+ supported and the &s.code;XvPixmapMask&e.code; flag is ignored.
+ </quote>
+
+ </quote>
+
+ &s.code;flags&e.code;
+ <quote><p>
+ Currently, the following flags are defined:
+
+ &s.code;VIDEO_NO_CLIPPING&e.code;
+ <quote><p>
+ This indicates that the video adaptor does not support
+ clipping. The driver will never receive ``Put'' requests
+ where less than the entire area determined by
+ &s.code;drw_x&e.code;, &s.code;drw_y&e.code;,
+ &s.code;drw_w&e.code; and &s.code;drw_h&e.code; is visible.
+ This flag does not apply to ``Get'' requests. Hardware
+ that is incapable of clipping ``Gets'' may punt or get
+ the extents of the clipping region passed to it.
+
+ </quote>
+
+ &s.code;VIDEO_INVERT_CLIPLIST&e.code;
+ <quote><p>
+ This indicates that the video driver requires the clip
+ list to contain the regions which are obscured rather
+ than the regions which are are visible.
+
+ </quote>
+
+ &s.code;VIDEO_OVERLAID_STILLS&e.code;
+ <quote><p>
+ Implementing PutStill for hardware that does video as an
+ overlay can be awkward since it's unclear how long to leave
+ the video up for. When this flag is set, StopVideo will be
+ called whenever the destination gets clipped or moved so that
+ the still can be left up until then.
+
+ </quote>
+
+ &s.code;VIDEO_OVERLAID_IMAGES&e.code;
+ <quote><p>
+ Same as &s.code;VIDEO_OVERLAID_STILLS&e.code; but for images.
+ </quote>
+
+ &s.code;VIDEO_CLIP_TO_VIEWPORT&e.code;
+ <quote><p>
+ Indicates that the clip region passed to the driver functions
+ should be clipped to the visible portion of the screen in the
+ case where the viewport is smaller than the virtual desktop.
+ </quote>
+
+ </quote>
+
+ &s.code;name&e.code;
+ <quote><p>
+ The name of the adaptor.
+
+ </quote>
+
+ &s.code;nEncodings&nl;
+ pEncodings&e.code;
+ <quote><p>
+ The number of encodings the adaptor is capable of and pointer
+ to the &s.code;XF86VideoEncodingRec&e.code; array. The
+ &s.code;XF86VideoEncodingRec&e.code; is described later on.
+ For drivers that only support XvImages there should be an encoding
+ named "XV_IMAGE" and the width and height should specify
+ the maximum size source image supported.
+
+ </quote>
+
+ &s.code;nFormats&nl;
+ pFormats&e.code;
+ <quote><p>
+ The number of formats the adaptor is capable of and pointer to
+ the &s.code;XF86VideoFormatRec&e.code; array. The
+ &s.code;XF86VideoFormatRec&e.code; is described later on.
+
+ </quote>
+
+ &s.code;nPorts&nl;
+ pPortPrivates&e.code;
+ <quote><p>
+ The number of ports is the number of separate data streams which
+ the adaptor can handle simultaneously. If you have more than
+ one port, the adaptor is expected to be able to render into more
+ than one window at a time. &s.code;pPortPrivates&e.code; is
+ an array of pointers or ints - one for each port. A port's
+ private data will be passed to the driver any time the port is
+ requested to do something like put the video or stop the video.
+ In the case where there may be many ports, this enables the
+ driver to know which port the request is intended for. Most
+ commonly, this will contain a pointer to the data structure
+ containing information about the port. In Xv, all ports on
+ a particular adaptor are expected to be identical in their
+ functionality.
+
+ </quote>
+
+ &s.code;nAttributes&nl;
+ pAttributes&e.code;
+ <quote><p>
+ The number of attributes recognized by the adaptor and a pointer to
+ the array of &s.code;XF86AttributeRecs&e.code;. The
+ &s.code;XF86AttributeRec&e.code; is described later on.
+
+ </quote>
+
+ &s.code;nImages&nl;
+ pImages&e.code;
+ <quote><p>
+ The number of &s.code;XF86ImageRecs&e.code; supported by the adaptor
+ and a pointer to the array of &s.code;XF86ImageRecs&e.code;. The
+ &s.code;XF86ImageRec&e.code; is described later on.
+
+ </quote>
+
+
+ &s.code;PutVideo PutStill GetVideo GetStill StopVideo
+ SetPortAttribute GetPortAttribute QueryBestSize PutImage
+ QueryImageAttributes&e.code;
+ <quote><p>
+ These functions define the DDX-&gt;driver interface. In each
+ case, the pointer &s.code;data&e.code; is passed to the driver.
+ This is the port private for that port as described above. All
+ fields are required except under the following conditions:
+
+ <enum>
+ <item>&s.code;PutVideo&e.code;, &s.code;PutStill&e.code; and
+ the image routines &s.code;PutImage&e.code; and
+ &s.code;QueryImageAttributes&e.code; are not required when the
+ adaptor type does not contain &s.code;XvInputMask&e.code;.
+
+ <item>&s.code;GetVideo&e.code; and &s.code;GetStill&e.code;
+ are not required when the adaptor type does not contain
+ &s.code;XvOutputMask&e.code;.
+
+ <item>&s.code;GetVideo&e.code; and &s.code;PutVideo&e.code;
+ are not required when the adaptor type does not contain
+ &s.code;XvVideoMask&e.code;.
+
+ <item>&s.code;GetStill&e.code; and &s.code;PutStill&e.code;
+ are not required when the adaptor type does not contain
+ &s.code;XvStillMask&e.code;.
+
+ <item>&s.code;PutImage&e.code; and &s.code;QueryImageAttributes&e.code;
+ are not required when the adaptor type does not contain
+ &s.code;XvImageMask&e.code;.
+
+ </enum>
+
+ With the exception of &s.code;QueryImageAttributes&e.code;, these
+ functions should return &s.code;Success&e.code; if the operation was
+ completed successfully. They can return &s.code;XvBadAlloc&e.code;
+ otherwise. &s.code;QueryImageAttributes&e.code; returns the size
+ of the XvImage queried.
+
+ If the &s.code;VIDEO_NO_CLIPPING&e.code;
+ flag is set, the &s.code;clipBoxes&e.code; may be ignored by
+ the driver. &s.code;ClipBoxes&e.code; is an &s.code;X-Y&e.code;
+ banded region identical to those used throughout the server.
+ The clipBoxes represent the visible portions of the area determined
+ by &s.code;drw_x&e.code;, &s.code;drw_y&e.code;,
+ &s.code;drw_w&e.code; and &s.code;drw_h&e.code; in the Get/Put
+ function. The boxes are in screen coordinates, are guaranteed
+ not to overlap and an empty region will never be passed.
+ If the driver has specified &s.code;VIDEO_INVERT_CLIPLIST&e.code;,
+ &s.code;clipBoxes&e.code; will indicate the areas of the primitive
+ which are obscured rather than the areas visible.
+
+ </quote>
+
+ &s.code;typedef int (* PutVideoFuncPtr)( ScrnInfoPtr pScrn,
+ &f.indent;short vid_x, short vid_y, short drw_x, short drw_y,
+ &f.indent;short vid_w, short vid_h, short drw_w, short drw_h,
+ &f.indent;RegionPtr clipBoxes, pointer data )&e.code;
+ <quote><p>
+ This indicates that the driver should take a subsection
+ &s.code;vid_w&e.code; by &s.code;vid_h&e.code; at location
+ &s.code;(vid_x,vid_y)&e.code; from the video stream and direct
+ it into the rectangle &s.code;drw_w&e.code; by &s.code;drw_h&e.code;
+ at location &s.code;(drw_x,drw_y)&e.code; on the screen, scaling as
+ necessary. Due to the large variations in capabilities of
+ the various hardware expected to be used with this extension,
+ it is not expected that all hardware will be able to do this
+ exactly as described. In that case the driver should just do
+ ``the best it can,'' scaling as closely to the target rectangle
+ as it can without rendering outside of it. In the worst case,
+ the driver can opt to just not turn on the video.
+
+ </quote>
+
+ &s.code;typedef int (* PutStillFuncPtr)( ScrnInfoPtr pScrn,
+ &f.indent;short vid_x, short vid_y, short drw_x, short drw_y,
+ &f.indent;short vid_w, short vid_h, short drw_w, short drw_h,
+ &f.indent;RegionPtr clipBoxes, pointer data )&e.code;
+ <quote><p>
+ This is same as &s.code;PutVideo&e.code; except that the driver
+ should place only one frame from the stream on the screen.
+
+ </quote>
+
+ &s.code;typedef int (* GetVideoFuncPtr)( ScrnInfoPtr pScrn,
+ &f.indent;short vid_x, short vid_y, short drw_x, short drw_y,
+ &f.indent;short vid_w, short vid_h, short drw_w, short drw_h,
+ &f.indent;RegionPtr clipBoxes, pointer data )&e.code;
+ <quote><p>
+ This is same as &s.code;PutVideo&e.code; except that the driver
+ gets video from the screen and outputs it. The driver should
+ do the best it can to get the requested dimensions correct
+ without reading from an area larger than requested.
+
+ </quote>
+
+ &s.code;typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn,
+ &f.indent;short vid_x, short vid_y, short drw_x, short drw_y,
+ &f.indent;short vid_w, short vid_h, short drw_w, short drw_h,
+ &f.indent;RegionPtr clipBoxes, pointer data )&e.code;
+ <quote><p>
+ This is the same as &s.code;GetVideo&e.code; except that the
+ driver should place only one frame from the screen into the
+ output stream.
+
+ </quote>
+
+ &s.code;typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn,
+ &f.indent;pointer data, Bool cleanup)&e.code;
+ <quote><p>
+ This indicates the driver should stop displaying the video.
+ This is used to stop both input and output video. The
+ &s.code;cleanup&e.code; field indicates that the video is
+ being stopped because the client requested it to stop or
+ because the server is exiting the current VT. In that case
+ the driver should deallocate any offscreen memory areas (if
+ there are any) being used to put the video to the screen. If
+ &s.code;cleanup&e.code; is not set, the video is being stopped
+ temporarily due to clipping or moving of the window, etc...
+ and video will likely be restarted soon so the driver should
+ not deallocate any offscreen areas associated with that port.
+
+ </quote>
+ &s.code;typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn,
+ &f.indent;Atom attribute,INT32 value, pointer data)&e.code;
+
+ &s.code;typedef int (* GetPortAttributeFuncPtr)(ScrnInfoPtr pScrn,
+ &f.indent;Atom attribute,INT32 *value, pointer data)&e.code;
+
+ <quote><p>
+ A port may have particular attributes such as hue,
+ saturation, brightness or contrast. Xv clients set and
+ get these attribute values by sending attribute strings
+ (Atoms) to the server. Such requests end up at these
+ driver functions. It is recommended that the driver provide
+ at least the following attributes mentioned in the Xv client
+ library docs:
+ <quote>
+ &s.code;XV_ENCODING&nl;
+ XV_HUE&nl;
+ XV_SATURATION&nl;
+ XV_BRIGHTNESS&nl;
+ XV_CONTRAST&e.code;
+ </quote>
+ but the driver may recognize as many atoms as it wishes. If
+ a requested attribute is unknown by the driver it should return
+ &s.code;BadMatch&e.code;. &s.code;XV_ENCODING&e.code; is the
+ attribute intended to let the client specify which video
+ encoding the particular port should be using (see the description
+ of &s.code;XF86VideoEncodingRec&e.code; below). If the
+ requested encoding is unsupported, the driver should return
+ &s.code;XvBadEncoding&e.code;. If the value lies outside the
+ advertised range &s.code;BadValue&e.code; may be returned.
+ &s.code;Success&e.code; should be returned otherwise.
+
+ </quote>
+
+ &s.code;typedef void (* QueryBestSizeFuncPtr)(ScrnInfoPtr pScrn,
+ &f.indent;Bool motion, short vid_w, short vid_h,
+ &f.indent;short drw_w, short drw_h,
+ &f.indent;unsigned int *p_w, unsigned int *p_h, pointer data)&e.code;
+ <quote><p>
+ &s.code;QueryBestSize&e.code; provides the client with a way
+ to query what the destination dimensions would end up being
+ if they were to request that an area
+ &s.code;vid_w&e.code by &s.code;vid_h&e.code; from the video
+ stream be scaled to rectangle of
+ &s.code;drw_w&e.code; by &s.code;drw_h&e.code; on the screen.
+ Since it is not expected that all hardware will be able to
+ get the target dimensions exactly, it is important that the
+ driver provide this function.
+
+ </quote>
+
+ &s.code;typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn,
+ &f.indent;short src_x, short src_y, short drw_x, short drw_y,
+ &f.indent;short src_w, short src_h, short drw_w, short drw_h,
+ &f.indent;int image, char *buf, short width, short height,
+ &f.indent;Bool sync, RegionPtr clipBoxes, pointer data )&e.code;
+ <quote><p>
+ This is similar to &s.code;PutStill&e.code; except that the
+ source of the video is not a port but the data stored in a system
+ memory buffer at &s.code;buf&e.code;. The data is in the format
+ indicated by the &s.code;image&e.code; descriptor and represents a
+ source of size &s.code;width&e.code; by &s.code;height&e.code;.
+ If &s.code;sync&e.code; is TRUE the driver should not return
+ from this function until it is through reading the data
+ from &s.code;buf&e.code;. Returning when &s.code;sync&e.code;
+ is TRUE indicates that it is safe for the data at &s.code;buf&e.code;
+ to be replaced, freed, or modified.
+
+ </quote>
+
+ &s.code;typedef int (* QueryImageAttributesFuncPtr)( ScrnInfoPtr pScrn,
+ &f.indent;int image, short *width, short *height,
+ &f.indent;int *pitches, int *offsets)&e.code;
+ <quote><p>
+ This function is called to let the driver specify how data for
+ a particular &s.code;image&e.code; of size &s.code;width&e.code;
+ by &s.code;height&e.code; should be stored. Sometimes only
+ the size and corrected width and height are needed. In that
+ case &s.code;pitches&e.code; and &s.code;offsets&e.code; are
+ NULL. The size of the memory required for the image is returned
+ by this function. The &s.code;width&e.code; and
+ &s.code;height&e.code; of the requested image can be altered by
+ the driver to reflect format limitations (such as component
+ sampling periods that are larger than one). If
+ &s.code;pitches&e.code; and &s.code;offsets&e.code; are not NULL,
+ these will be arrays with as many elements in them as there
+ are planes in the &s.code;image&e.code; format. The driver
+ should specify the pitch (in bytes) of each scanline in the
+ particular plane as well as the offset to that plane (in bytes)
+ from the beginning of the image.
+
+ </quote>
+
+ </quote>
+
+The XF86VideoEncodingRec:
+<quote><p>
+<verb>
+typedef struct {
+ int id;
+ char *name;
+ unsigned short width, height;
+ XvRationalRec rate;
+} XF86VideoEncodingRec, *XF86VideoEncodingPtr;
+
+</verb>
+ The &s.code;XF86VideoEncodingRec&e.code; specifies what encodings
+ the adaptor can support. Most of this data is just informational
+ and for the client's benefit, and is what will be reported by
+ &s.code;XvQueryEncodings&e.code;. The &s.code;id&e.code; field is
+ expected to be a unique identifier to allow the client to request a
+ certain encoding via the &s.code;XV_ENCODING&e.code; attribute string.
+
+</quote>
+
+The XF86VideoFormatRec:
+
+<quote><p>
+<verb>
+typedef struct {
+ char depth;
+ short class;
+} XF86VideoFormatRec, *XF86VideoFormatPtr;
+</verb>
+
+ This specifies what visuals the video is viewable in.
+ &s.code;depth&e.code; is the depth of the visual (not bpp).
+ &s.code;class&e.code; is the visual class such as
+ &s.code;TrueColor&e.code;, &s.code;DirectColor&e.code; or
+ &s.code;PseudoColor&e.code;. Initialization of an adaptor will fail
+ if none of the visuals on that screen are supported.
+
+</quote>
+
+The XF86AttributeRec:
+
+<quote><p>
+<verb>
+typedef struct {
+ int flags;
+ int min_value;
+ int max_value;
+ char *name;
+} XF86AttributeListRec, *XF86AttributeListPtr;
+
+</verb>
+
+ Each adaptor may have an array of these advertising the attributes
+ for its ports. Currently defined flags are &s.code;XvGettable&e.code;
+ and &s.code;XvSettable&e.code; which may be OR'd together indicating that
+ attribute is ``gettable'' or ``settable'' by the client. The
+ &s.code;min&e.code; and &s.code;max&e.code; field specify the valid range
+ for the value. &s.code;Name&e.code; is a text string describing the
+ attribute by name.
+
+</quote>
+
+The XF86ImageRec:
+
+<quote><p>
+<verb>
+typedef struct {
+ int id;
+ int type;
+ int byte_order;
+ char guid[16];
+ int bits_per_pixel;
+ int format;
+ int num_planes;
+
+ /* for RGB formats */
+ int depth;
+ unsigned int red_mask;
+ unsigned int green_mask;
+ unsigned int blue_mask;
+
+ /* for YUV formats */
+ unsigned int y_sample_bits;
+ unsigned int u_sample_bits;
+ unsigned int v_sample_bits;
+ unsigned int horz_y_period;
+ unsigned int horz_u_period;
+ unsigned int horz_v_period;
+ unsigned int vert_y_period;
+ unsigned int vert_u_period;
+ unsigned int vert_v_period;
+ char component_order[32];
+ int scanline_order;
+} XF86ImageRec, *XF86ImagePtr;
+</verb>
+
+ XF86ImageRec describes how video source data is laid out in memory.
+ The fields are as follows:
+
+ &s.code;id&e.code;
+ <quote><p>
+ This is a unique descriptor for the format. It is often good to
+ set this value to the FOURCC for the format when applicable.
+ </quote>
+
+ &s.code;type&e.code;
+ <quote><p>
+ This is &s.code;XvRGB&e.code; or &s.code;XvYUV&e.code;.
+ </quote>
+
+ &s.code;byte_order&e.code;
+ <quote><p>
+ This is &s.code;LSBFirst&e.code; or &s.code;MSBFirst&e.code;.
+ </quote>
+
+ &s.code;guid&e.code;
+ <quote><p>
+ This is the Globally Unique IDentifier for the format. When
+ not applicable, all characters should be NULL.
+ </quote>
+
+ &s.code;bits_per_pixel&e.code;
+ <quote><p>
+ The number of bits taken up (but not necessarily used) by each
+ pixel. Note that for some planar formats which have fractional
+ bits per pixel (such as IF09) this number may be rounded _down_.
+ </quote>
+
+ &s.code;format&e.code;
+ <quote><p>
+ This is &s.code;XvPlanar&e.code; or &s.code;XvPacked&e.code;.
+ </quote>
+
+ &s.code;num_planes&e.code;
+ <quote><p>
+ The number of planes in planar formats. This should be set to
+ one for packed formats.
+ </quote>
+
+ &s.code;depth&e.code;
+ <quote><p>
+ The significant bits per pixel in RGB formats (analgous to the
+ depth of a pixmap format).
+ </quote>
+
+ &s.code;red_mask&e.code;
+ &s.code;green_mask&e.code;
+ &s.code;blue_mask&e.code;
+ <quote><p>
+ The red, green and blue bitmasks for packed RGB formats.
+ </quote>
+
+ &s.code;y_sample_bits&e.code;
+ &s.code;u_sample_bits&e.code;
+ &s.code;v_sample_bits&e.code;
+ <quote><p>
+ The y, u and v sample sizes (in bits).
+ </quote>
+
+ &s.code;horz_y_period&e.code;
+ &s.code;horz_u_period&e.code;
+ &s.code;horz_v_period&e.code;
+ <quote><p>
+ The y, u and v sampling periods in the horizontal direction.
+ </quote>
+
+ &s.code;vert_y_period&e.code;
+ &s.code;vert_u_period&e.code;
+ &s.code;vert_v_period&e.code;
+ <quote><p>
+ The y, u and v sampling periods in the vertical direction.
+ </quote>
+
+ &s.code;component_order&e.code;
+ <quote><p>
+ Uppercase ascii characters representing the order that
+ samples are stored within packed formats. For planar formats
+ this represents the ordering of the planes. Unused characters
+ in the 32 byte string should be set to NULL.
+ </quote>
+
+ &s.code;scanline_order&e.code;
+ <quote><p>
+ This is &s.code;XvTopToBottom&e.code; or &s.code;XvBottomToTop&e.code;.
+ </quote>
+
+ Since some formats (particular some planar YUV formats) may not
+be completely defined by the parameters above, the guid, when
+available, should provide the most accurate description of the
+format.
+
+</quote>
+
+<sect>The Loader
+<p>
+
+This section describes the interfaces to the module loader. The loader
+interfaces can be divided into two groups: those that are only available to
+the XFree86 common layer, and those that are also available to modules.
+
+<sect1>Loader Overview
+<p>
+
+The loader is capable of loading modules in a range of object formats,
+and knowledge of these formats is built in to the loader. Knowledge of
+new object formats can be added to the loader in a straightforward
+manner. This makes it possible to provide OS-independent modules (for
+a given CPU architecture type). In addition to this, the loader can
+load modules via the OS-provided &s.code;dlopen(3)&e.code; service where
+available. Such modules are not platform independent, and the semantics
+of &s.code;dlopen()&e.code; on most systems results in significant
+limitations in the use of modules of this type. Support for
+&s.code;dlopen()&e.code; modules in the loader is primarily for
+experimental and development purposes.
+
+Symbols exported by the loader (on behalf of the core X server) to
+modules are determined at compile time. Only those symbols explicitly
+exported are available to modules. All external symbols of loaded
+modules are exported to other modules, and to the core X server. The
+loader can be requested to check for unresolved symbols at any time,
+and the action to be taken for unresolved symbols can be controlled by
+the caller of the loader. Typically the caller identifies which symbols
+can safely remain unresolved and which cannot.
+
+NOTE: Now that ISO-C allows pointers to functions and pointers to data to
+have different internal representations, some of the following interfaces
+will need to be revisited.
+
+<sect1>Semi-private Loader Interface
+<p>
+
+The following is the semi-private loader interface that is available to the
+XFree86 common layer.
+
+ <quote><p>
+ &s.code;void LoaderInit(void)&e.code;
+ <quote><p>
+ The &s.code;LoaderInit()&e.code; function initialises the loader,
+ and it must be called once before calling any other loader functions.
+ This function initialises the tables of exported symbols, and anything
+ else that might need to be initialised.
+
+ </quote>
+
+ &s.code;void LoaderSetPath(const char *path)&e.code;
+ <quote><p>
+ The &s.code;LoaderSetPath()&e.code; function initialises a default
+ module search path. This must be called if calls to other functions
+ are to be made without explicitly specifying a module search path.
+ The search path &s.code;path&e.code; must be a string of one or more
+ comma separated absolute paths. Modules are expected to be located
+ below these paths, possibly in subdirectories of these paths.
+
+ </quote>
+
+ &s.code;pointer LoadModule(const char *module, const char *path,
+ &f.indent;const char **subdirlist, const char **patternlist,
+ &f.indent;pointer options, const XF86ModReqInfo * modreq,
+ &f.indent;int *errmaj, int *errmin)&e.code;
+ <quote><p>
+ The &s.code;LoadModule()&e.code; function loads the module called
+ &s.code;module&e.code;. The return value is a module handle, and
+ may be used in future calls to the loader that require a reference
+ to a loaded module. The module name &s.code;module&e.code; is
+ normally the module's canonical name, which doesn't contain any
+ directory path information, or any object/library file prefixes of
+ suffixes. Currently a full pathname and/or filename is also accepted.
+ This might change. The other parameters are:
+
+ &s.code;path&e.code;
+ <quote><p>
+ An optional comma-separated list of module search paths.
+ When &s.code;NULL&e.code;, the default search path is used.
+
+ </quote>
+
+ &s.code;subdirlist&e.code;
+ <quote><p>
+ An optional &s.code;NULL&e.code; terminated list of
+ subdirectories to search. When &s.code;NULL&e.code;,
+ the default built-in list is used (refer to
+ &s.code;stdSubdirs&e.code; in &s.code;loadmod.c&e.code;).
+ The default list is also substituted for entries in
+ &s.code;subdirlist&e.code; with the value
+ &s.code;DEFAULT_LIST&e.code;. This makes is possible
+ to augment the default list instead of replacing it.
+ Subdir elements must be relative, and must not contain
+ &s.code;".."&e.code;. If any violate this requirement,
+ the load fails.
+
+ </quote>
+
+ &s.code;patternlist&e.code;
+ <quote><p>
+ An optional &s.code;NULL&e.code; terminated list of
+ POSIX regular expressions used to connect module
+ filenames with canonical module names. Each regex
+ should contain exactly one subexpression that corresponds
+ to the canonical module name. When &s.code;NULL&e.code;,
+ the default built-in list is used (refer to
+ &s.code;stdPatterns&e.code; in
+ &s.code;loadmod.c&e.code;). The default list is also
+ substituted for entries in &s.code;patternlist&e.code;
+ with the value &s.code;DEFAULT_LIST&e.code;. This
+ makes it possible to augment the default list instead
+ of replacing it.
+
+ </quote>
+
+ &s.code;options&e.code;
+ <quote><p>
+ An optional parameter that is passed to the newly
+ loaded module's &s.code;SetupProc&e.code; function
+ (if it has one). This argument is normally a
+ &s.code;NULL&e.code; terminated list of
+ &s.code;Options&e.code;, and must be interpreted that
+ way by modules loaded directly by the XFree86 common
+ layer. However, it may be used for application-specific
+ parameter passing in other situations.
+
+ When loading ``external'' modules (modules that don't
+ have the standard entry point, for example a
+ special shared library) the options parameter can be
+ set to &s.code;EXTERN_MODULE&e.code; to tell the
+ loader not to reject the module when it doesn't find
+ the standard entry point.
+
+ </quote>
+
+ &s.code;modreq&e.code;
+ <quote><p>
+ An optional &s.code;XF86ModReqInfo*&e.code; containing
+ version/ABI/vendor information to requirements to
+ check the newly loaded module against. The main
+ purpose of this is to allow the loader to verify that
+ a module of the correct type/version before running
+ its &s.code;SetupProc&e.code; function.
+
+ The &s.code;XF86ModReqInfo&e.code; struct is defined
+ as follows:
+<verb>
+typedef struct {
+ CARD8 majorversion; /* MAJOR_UNSPEC */
+ CARD8 minorversion; /* MINOR_UNSPEC */
+ CARD16 patchlevel; /* PATCH_UNSPEC */
+ const char * abiclass; /* ABI_CLASS_NONE */
+ CARD32 abiversion; /* ABI_VERS_UNSPEC */
+ const char * moduleclass; /* MOD_CLASS_NONE */
+} XF86ModReqInfo;
+</verb>
+
+ The information here is compared against the equivalent
+ information in the module's
+ &s.code;XF86ModuleVersionInfo&e.code; record (which
+ is described below). The values in comments above
+ indicate ``don't care'' settings for each of the fields.
+ The comparisons made are as follows:
+
+ &s.code;majorversion&e.code;
+ <quote><p>
+ Must match the module's majorversion
+ exactly.
+
+ </quote>
+ &s.code;minorversion&e.code;
+ <quote><p>
+ The module's minor version must be
+ no less than this value. This
+ comparison is only made if
+ &s.code;majorversion&e.code; is
+ specified and matches.
+
+ </quote>
+ &s.code;patchlevel&e.code;
+ <quote><p>
+ The module's patchlevel must be no
+ less than this value. This comparison
+ is only made if
+ &s.code;minorversion&e.code; is
+ specified and matches.
+
+ </quote>
+ &s.code;abiclass&e.code;
+ <quote><p>
+ String must match the module's abiclass
+ string.
+
+ </quote>
+ &s.code;abiversion&e.code;
+ <quote><p>
+ Must be consistent with the module's
+ abiversion (major equal, minor no
+ older).
+
+ </quote>
+ &s.code;moduleclass&e.code;
+ <quote><p>
+ String must match the module's
+ moduleclass string.
+
+ </quote>
+
+ </quote>
+
+ &s.code;errmaj&e.code;
+ <quote><p>
+ An optional pointer to a variable holding the major
+ part or the error code. When provided,
+ &s.code;*errmaj&e.code; is filled in when
+ &s.code;LoadModule()&e.code; fails.
+
+ </quote>
+
+ &s.code;errmin&e.code;
+ <quote><p>
+ Like &s.code;errmaj&e.code;, but for the minor part
+ of the error code.
+
+ </quote>
+
+ </quote>
+
+ &s.code;void UnloadModule(pointer mod)&e.code;
+ <quote><p>
+ This function unloads the module referred to by the handle mod.
+ All child modules are also unloaded recursively. This function must
+ not be used to directly unload modules that are child modules (i.e.,
+ those that have been loaded with the &s.code;LoadSubModule()&e.code;
+ described below).
+
+ </quote>
+ </quote>
+
+<sect1>Module Requirements
+<p>
+
+Modules must provide information about themselves to the loader, and
+may optionally provide entry points for "setup" and "teardown" functions
+(those two functions are referred to here as &s.code;SetupProc&e.code;
+and &s.code;TearDownProc&e.code;).
+
+The module information is contained in the
+&s.code;XF86ModuleVersionInfo&e.code; struct, which is defined as follows:
+
+<quote><p><verb>
+typedef struct {
+ const char * modname; /* name of module, e.g. "foo" */
+ const char * vendor; /* vendor specific string */
+ CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
+ CARD32 _modinfo2_; /* infoarea with a binary editor/sign tool */
+ CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* module-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char * abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char * moduleclass; /* module class */
+ CARD32 checksum[4]; /* contains a digital signature of the */
+ /* version info structure */
+} XF86ModuleVersionInfo;
+</verb>
+
+The fields are used as follows:
+
+ &s.code;modname&e.code;
+ <quote><p>
+ The module's name. This field is currently only for
+ informational purposes, but the loader may be modified
+ in future to require it to match the module's canonical
+ name.
+
+ </quote>
+
+ &s.code;vendor&e.code;
+ <quote><p>
+ The module vendor. This field is for informational purposes
+ only.
+
+ </quote>
+
+ &s.code;_modinfo1_&e.code;
+ <quote><p>
+ This field holds the first part of a signature that can
+ be used to locate this structure in the binary. It should
+ always be initialised to &s.code;MODINFOSTRING1&e.code;.
+
+ </quote>
+
+ &s.code;_modinfo2_&e.code;
+ <quote><p>
+ This field holds the second part of a signature that can
+ be used to locate this structure in the binary. It should
+ always be initialised to &s.code;MODINFOSTRING2&e.code;.
+
+ </quote>
+
+ &s.code;xf86version&e.code;
+ <quote><p>
+ The XFree86 version against which the module was compiled.
+ This is mostly for informational/diagnostic purposes. It
+ should be initialised to &s.code;XF86_VERSION_CURRENT&e.code;, which is
+ defined in &s.code;xf86Version.h&e.code;.
+
+ </quote>
+
+ &s.code;majorversion&e.code;
+ <quote><p>
+ The module-specific major version. For modules where this
+ version is used for more than simply informational
+ purposes, the major version should only change (be
+ incremented) when ABI incompatibilities are introduced,
+ or ABI components are removed.
+
+ </quote>
+
+ &s.code;minorversion&e.code;
+ <quote><p>
+ The module-specific minor version. For modules where this
+ version is used for more than simply informational
+ purposes, the minor version should only change (be
+ incremented) when ABI additions are made in a backward
+ compatible way. It should be reset to zero when the major
+ version is increased.
+
+ </quote>
+
+ &s.code;patchlevel&e.code;
+ <quote><p>
+ The module-specific patch level. The patch level should
+ increase with new revisions of the module where there
+ are no ABI changes, and it should be reset to zero when
+ the minor version is increased.
+
+ </quote>
+
+ &s.code;abiclass&e.code;
+ <quote><p>
+ The ABI class that the module requires. The class is
+ specified as a string for easy extensibility. It should
+ indicate which (if any) of the X server's built-in ABI
+ classes that the module relies on, or a third-party ABI
+ if appropriate. Built-in ABI classes currently defined are:
+
+ <quote>
+ &s.code;ABI_CLASS_NONE&e.code;
+ <quote>no class</quote>
+ &s.code;ABI_CLASS_ANSIC&e.code;
+ <quote>only requires the ANSI C interfaces</quote>
+ &s.code;ABI_CLASS_VIDEODRV&e.code;
+ <quote>requires the video driver ABI</quote>
+ &s.code;ABI_CLASS_XINPUT&e.code;
+ <quote>requires the XInput driver ABI</quote>
+ &s.code;ABI_CLASS_EXTENSION&e.code;
+ <quote>requires the extension module ABI</quote>
+ &s.code;ABI_CLASS_FONT&e.code;
+ <quote>requires the font module ABI</quote>
+ </quote>
+
+ </quote>
+
+ &s.code;abiversion&e.code;
+ <quote><p>
+ The version of abiclass that the module requires. The
+ version consists of major and minor components. The
+ major version must match and the minor version must be
+ no newer than that provided by the server or parent
+ module. Version identifiers for the built-in classes
+ currently defined are:
+
+ <quote>
+ &s.code;ABI_ANSIC_VERSION&nl;
+ ABI_VIDEODRV_VERSION&nl;
+ ABI_XINPUT_VERSION&nl;
+ ABI_EXTENSION_VERSION&nl;
+ ABI_FONT_VERSION&e.code;
+ </quote>
+
+ </quote>
+
+ &s.code;moduleclass&e.code;
+ <quote><p>
+ This is similar to the abiclass field, except that it
+ defines the type of module rather than the ABI it
+ requires. For example, although all video drivers require
+ the video driver ABI, not all modules that require the
+ video driver ABI are video drivers. This distinction
+ can be made with the moduleclass. Currently pre-defined
+ module classes are:
+
+ <quote>
+ &s.code;MOD_CLASS_NONE&nl;
+ MOD_CLASS_VIDEODRV&nl;
+ MOD_CLASS_XINPUT&nl;
+ MOD_CLASS_FONT&nl;
+ MOD_CLASS_EXTENSION&e.code;
+ </quote>
+
+ </quote>
+
+ &s.code;checksum&e.code;
+ <quote><p>
+ Not currently used.
+
+ </quote>
+
+</quote>
+
+The module version information, and the optional &s.code;SetupProc&e.code;
+and &s.code;TearDownProc&e.code; entry points are found by the loader
+by locating a data object in the module called "modnameModuleData",
+where "modname" is the canonical name of the module. Modules must
+contain such a data object, and it must be declared with global scope,
+be compile-time initialised, and is of the following type:
+
+<quote>
+<verb>
+typedef struct {
+ XF86ModuleVersionInfo * vers;
+ ModuleSetupProc setup;
+ ModuleTearDownProc teardown;
+} XF86ModuleData;
+</verb>
+</quote>
+
+The vers parameter must be initialised to a pointer to a correctly
+initialised &s.code;XF86ModuleVersionInfo&e.code; struct. The other
+two parameter are optional, and should be initialised to
+&s.code;NULL&e.code; when not required. The other parameters are defined
+as
+
+ <quote><p>
+ &s.code;typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *)&e.code;
+
+ &s.code;typedef void (*ModuleTearDownProc)(pointer)&e.code;
+
+
+ &s.code;pointer SetupProc(pointer module, pointer options,
+ &f.indent;int *errmaj, int *errmin)&e.code;
+ <quote><p>
+ When defined, this function is called by the loader after successfully
+ loading a module. module is a handle for the newly loaded module,
+ and maybe used by the &s.code;SetupProc&e.code; if it calls other
+ loader functions that require a reference to it. The remaining
+ arguments are those that were passed to the
+ &s.code;LoadModule()&e.code; (or &s.code;LoadSubModule()&e.code;),
+ and are described above. When the &s.code;SetupProc&e.code; is
+ successful it must return a non-&s.code;NULL&e.code; value. The
+ loader checks this, and if it is &s.code;NULL&e.code; it unloads
+ the module and reports the failure to the caller of
+ &s.code;LoadModule()&e.code;. If the &s.code;SetupProc&e.code;
+ does things that need to be undone when the module is unloaded,
+ it should define a &s.code;TearDownProc&e.code;, and return a
+ pointer that the &s.code;TearDownProc&e.code; can use to undo what
+ has been done.
+
+ When a module is loaded multiple times, the &s.code;SetupProc&e.code;
+ is called once for each time it is loaded.
+
+ </quote>
+
+ &s.code;void TearDownProc(pointer tearDownData)&e.code;
+ <quote><p>
+ When defined, this function is called when the loader unloads a
+ module. The &s.code;tearDownData&e.code; parameter is the return
+ value of the &s.code;SetupProc()&e.code; that was called when the
+ module was loaded. The purpose of this function is to clean up
+ before the module is unloaded (for example, by freeing allocated
+ resources).
+
+ </quote>
+ </quote>
+
+<sect1>Public Loader Interface
+<p>
+
+The following is the Loader interface that is available to any part of
+the server, and may also be used from within modules.
+
+ <quote><p>
+ &s.code;pointer LoadSubModule(pointer parent, const char *module,
+ &f.indent;const char **subdirlist, const char **patternlist,
+ &f.indent;pointer options, const XF86ModReqInfo * modreq,
+ &f.indent;int *errmaj, int *errmin)&e.code;
+ <quote><p>
+ This function is like the &s.code;LoadModule()&e.code; function
+ described above, except that the module loaded is registered as a
+ child of the calling module. The &s.code;parent&e.code; parameter
+ is the calling module's handle. Modules loaded with this function
+ are automatically unloaded when the parent module is unloaded. The
+ other difference is that the path parameter may not be specified.
+ The module search path used for modules loaded with this function
+ is the default search path as initialised with
+ &s.code;LoaderSetPath()&e.code;.
+
+ </quote>
+
+ &s.code;void UnloadSubModule(pointer module)&e.code;
+ <quote><p>
+ This function unloads the module with handle &s.code;module&e.code;.
+ If that module itself has children, they are also unloaded. It is
+ like &s.code;UnloadModule()&e.code;, except that it is safe to use
+ for unloading child modules.
+
+ </quote>
+
+ &s.code;pointer LoaderSymbol(const char *symbol)&e.code;
+ <quote><p>
+ This function returns the address of the symbol with name
+ &s.code;symbol&e.code;. This may be used to locate a module entry
+ point with a known name.
+
+ </quote>
+
+ &s.code;char **LoaderlistDirs(const char **subdirlist,
+ &f.indent;const char **patternlist)&e.code;
+ <quote><p>
+ This function returns a &s.code;NULL&e.code; terminated list of
+ canonical modules names for modules found in the default module
+ search path. The &s.code;subdirlist&e.code; and
+ &s.code;patternlist&e.code; parameters are as described above, and
+ can be used to control the locations and names that are searched.
+ If no modules are found, the return value is &s.code;NULL&e.code;.
+ The returned list should be freed by calling
+ &s.code;LoaderFreeDirList()&e.code; when it is no longer needed.
+
+ </quote>
+
+ &s.code;void LoaderFreeDirList(char **list)&e.code;
+ <quote><p>
+ This function frees a module list created by
+ &s.code;LoaderlistDirs()&e.code;.
+
+ </quote>
+
+ &s.code;void LoaderReqSymLists(const char **list0, ...)&e.code;
+ <quote><p>
+ This function allows the registration of required symbols with the
+ loader. It is normally used by a caller of
+ &s.code;LoadSubModule()&e.code;. If any symbols registered in this
+ way are found to be unresolved when
+ &s.code;LoaderCheckUnresolved()&e.code; is called then
+ &s.code;LoaderCheckUnresolved()&e.code; will report a failure.
+ The function takes one or more &s.code;NULL&e.code; terminated
+ lists of symbols. The end of the argument list is indicated by a
+ &s.code;NULL&e.code; argument.
+
+ </quote>
+
+ &s.code;void LoaderReqSymbols(const char *sym0, ...)&e.code;
+ <quote><p>
+ This function is like &s.code;LoaderReqSymLists()&e.code; except
+ that its arguments are symbols rather than lists of symbols. This
+ function is more convenient when single functions are to be registered,
+ especially when the single function might depend on runtime factors.
+ The end of the argument list is indicated by a &s.code;NULL&e.code;
+ argument.
+
+ </quote>
+
+ &s.code;void LoaderRefSymLists(const char **list0, ...)&e.code;
+ <quote><p>
+ This function allows the registration of possibly unresolved symbols
+ with the loader. When &s.code;LoaderCheckUnresolved()&e.code; is
+ run it won't generate warnings for symbols registered in this way
+ unless they were also registered as required symbols.
+ The function takes one or more &s.code;NULL&e.code; terminated
+ lists of symbols. The end of the argument list is indicated by a
+ &s.code;NULL&e.code; argument.
+
+ </quote>
+
+ &s.code;void LoaderRefSymbols(const char *sym0, ...)&e.code;
+ <quote><p>
+ This function is like &s.code;LoaderRefSymLists()&e.code; except
+ that its arguments are symbols rather than lists of symbols. This
+ function is more convenient when single functions are to be registered,
+ especially when the single function might depend on runtime factors.
+ The end of the argument list is indicated by a &s.code;NULL&e.code;
+ argument.
+
+ </quote>
+
+ &s.code;int LoaderCheckUnresolved(int delayflag)&e.code;
+ <quote><p>
+ This function checks for unresolved symbols. It generates warnings
+ for unresolved symbols that have not been registered with
+ &s.code;LoaderRefSymLists()&e.code;, and maps them to a dummy
+ function. This behaviour may change in future. If unresolved
+ symbols are found that have been registered with
+ &s.code;LoaderReqSymLists()&e.code; or
+ &s.code;LoaderReqSymbols()&e.code; then this function returns a
+ non-zero value. If none of these symbols are unresolved the return
+ value is zero, indicating success.
+
+ The &s.code;delayflag&e.code; parameter should normally be set to
+ &s.code;LD_RESOLV_IFDONE&e.code;.
+
+ </quote>
+
+ &s.code;LoaderErrorMsg(const char *name, const char *modname,
+ &f.indent;int errmaj, int errmin)&e.code;
+ <quote><p>
+ This function prints an error message that includes the text ``Failed
+ to load module'', the module name &s.code;modname&e.code;, a message
+ specific to the &s.code;errmaj&e.code; value, and the value if
+ &s.code;errmin&e.code;. If &s.code;name&e.code; is
+ non-&s.code;NULL&e.code;, it is printed as an identifying prefix
+ to the message (followed by a `:').
+
+ </quote>
+ </quote>
+
+<sect1>Special Registration Functions
+<p>
+
+The loader contains some functions for registering some classes of modules.
+These may be moved out of the loader at some point.
+
+ <quote><p>
+ &s.code;void LoadExtension(ExtensionModule *ext)&e.code;
+ <quote><p>
+ This registers the entry points for the extension identified by
+ &s.code;ext&e.code;. The &s.code;ExtensionModule&e.code; struct is
+ defined as:
+
+<quote>
+<verb>
+typedef struct {
+ InitExtension initFunc;
+ char * name;
+ Bool *disablePtr;
+ InitExtension setupFunc;
+} ExtensionModule;
+</verb>
+</quote>
+
+ </quote>
+
+ &s.code;void LoadFont(FontModule *font)&e.code;
+ <quote><p>
+ This registers the entry points for the font rasteriser module
+ identified by &s.code;font&e.code;. The &s.code;FontModule&e.code;
+ struct is defined as:
+
+<quote>
+<verb>
+typedef struct {
+ InitFont initFunc;
+ char * name;
+ pointer module;
+} FontModule;
+</verb>
+</quote>
+
+ </quote>
+ </quote>
+
+</sect>
+
+
+<sect>Helper Functions
+<p>
+
+This section describe ``helper'' functions that video driver
+might find useful. While video drivers are not required to use any of
+these to be considered ``compliant'', the use of appropriate helpers is
+strongly encouraged to improve the consistency of driver behaviour.
+
+<sect1>Functions for printing messages
+<p>
+
+ <quote><p>
+ &s.code;ErrorF(const char *format, ...)&e.code;
+ <quote><p>
+ This is the basic function for writing to the error log (typically
+ stderr and/or a log file). Video drivers should usually avoid
+ using this directly in favour of the more specialised functions
+ described below. This function is useful for printing messages
+ while debugging a driver.
+
+ </quote>
+
+ &s.code;FatalError(const char *format, ...)&e.code;
+ <quote><p>
+ This prints a message and causes the Xserver to abort. It should
+ rarely be used within a video driver, as most error conditions
+ should be flagged by the return values of the driver functions.
+ This allows the higher layers to decide how to proceed. In rare
+ cases, this can be used within a driver if a fatal unexpected
+ condition is found.
+
+ </quote>
+
+ &s.code;xf86ErrorF(const char *format, ...)&e.code;
+ <quote><p>
+ This is like &s.code;ErrorF()&e.code;, except that the message is
+ only printed when the Xserver's verbosity level is set to the
+ default (&s.code;1&e.code;) or higher. It means that the messages
+ are not printed when the server is started with the
+ &s.cmd;-quiet&e.cmd; flag. Typically this function would only be
+ used for continuing messages started with one of the more specialised
+ functions described below.
+
+ </quote>
+
+ &s.code;xf86ErrorFVerb(int verb, const char *format, ...)&e.code;
+ <quote><p>
+ Like &s.code;xf86ErrorF()&e.code;, except the minimum verbosity
+ level for which the message is to be printed is given explicitly.
+ Passing a &s.code;verb&e.code; value of zero means the message
+ is always printed. A value higher than &s.code;1&e.code; can be
+ used for information would normally not be needed, but which might
+ be useful when diagnosing problems.
+
+ </quote>
+
+ &s.code;xf86Msg(MessageType type, const char *format, ...)&e.code;
+ <quote><p>
+ This is like &s.code;xf86ErrorF()&e.code;, except that the message
+ is prefixed with a marker determined by the value of
+ &s.code;type&e.code;. The marker is used to indicate the type of
+ message (warning, error, probed value, config value, etc). Note
+ the &s.code;xf86Verbose&e.code; value is ignored for messages of
+ type &s.code;X_ERROR&e.code;.
+
+ The marker values are:
+
+ <quote>
+ &s.code;X_PROBED&e.code;
+ <quote>Value was probed.</quote>
+ &s.code;X_CONFIG&e.code;
+ <quote>Value was given in the config file.</quote>
+ &s.code;X_DEFAULT&e.code;
+ <quote>Value is a default.</quote>
+ &s.code;X_CMDLINE&e.code;
+ <quote>Value was given on the command line.</quote>
+ &s.code;X_NOTICE&e.code;
+ <quote>Notice.</quote>
+ &s.code;X_ERROR&e.code;
+ <quote>Error message.</quote>
+ &s.code;X_WARNING&e.code;
+ <quote>Warning message.</quote>
+ &s.code;X_INFO&e.code;
+ <quote>Informational message.</quote>
+ &s.code;X_NONE&e.code;
+ <quote>No prefix.</quote>
+ &s.code;X_NOT_IMPLEMENTED&e.code;
+ <quote>The message relates to functionality that is not yet
+ implemented.</quote>
+ </quote>
+
+
+ </quote>
+
+ &s.code;xf86MsgVerb(MessageType type, int verb, const char *format, ...)&e.code;
+ <quote><p>
+ Like &s.code;xf86Msg()&e.code;, but with the verbosity level given
+ explicitly.
+
+ </quote>
+
+ &s.code;xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)&e.code;
+ <quote><p>
+ This is like &s.code;xf86Msg()&e.code; except that the driver's
+ name (the &s.code;name&e.code; field of the
+ &s.code;ScrnInfoRec&e.code;) followed by the
+ &s.code;scrnIndex&e.code; in parentheses is printed following the
+ prefix. This should be used by video drivers in most cases as it
+ clearly indicates which driver/screen the message is for. If
+ &s.code;scrnIndex&e.code; is negative, this function behaves
+ exactly like &s.code;xf86Msg()&e.code;.
+
+ NOTE: This function can only be used after the
+ &s.code;ScrnInfoRec&e.code; and its &s.code;name&e.code; field
+ have been allocated. Normally, this means that it can not be
+ used before the END of the &s.code;ChipProbe()&e.code; function.
+ Prior to that, use &s.code;xf86Msg()&e.code;, providing the
+ driver's name explicitly. No screen number can be supplied at
+ that point.
+
+ </quote>
+
+ &s.code;xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
+ &f.indent;const char *format, ...)&e.code;
+ <quote><p>
+ Like &s.code;xf86DrvMsg()&e.code;, but with the verbosity level
+ given explicitly.
+
+ </quote>
+ </quote>
+
+
+<sect1>Functions for setting values based on command line and config file
+<p>
+
+ <quote><p>
+ &s.code;Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp,
+ &f.indent;int fbbpp, int depth24flags)&e.code;
+ <quote><p>
+ This function sets the &s.code;depth&e.code;, &s.code;pixmapBPP&e.code; and &s.code;bitsPerPixel&e.code; fields
+ of the &s.code;ScrnInfoRec&e.code;. It also determines the defaults for display-wide
+ attributes and pixmap formats the screen will support, and finds
+ the Display subsection that matches the depth/bpp. This function
+ should normally be called very early from the
+ &s.code;ChipPreInit()&e.code; function.
+
+ It requires that the &s.code;confScreen&e.code; field of the &s.code;ScrnInfoRec&e.code; be
+ initialised prior to calling it. This is done by the XFree86
+ common layer prior to calling &s.code;ChipPreInit()&e.code;.
+
+ The parameters passed are:
+
+ &s.code;depth&e.code;
+ <quote><p>
+ driver's preferred default depth if no other is given.
+ If zero, use the overall server default.
+
+ </quote>
+ &s.code;bpp&e.code;
+ <quote><p>
+ Same, but for the pixmap bpp.
+
+ </quote>
+ &s.code;fbbpp&e.code;
+ <quote><p>
+ Same, but for the framebuffer bpp.
+
+ </quote>
+ &s.code;depth24flags&e.code;
+ <quote><p>
+ Flags that indicate the level of 24/32bpp support
+ and whether conversion between different framebuffer
+ and pixmap formats is supported. The flags for this
+ argument are defined as follows, and multiple flags
+ may be ORed together:
+
+ &s.code;NoDepth24Support&e.code;
+ <quote>No depth 24 formats supported</quote>
+ &s.code;Support24bppFb&e.code;
+ <quote>24bpp framebuffer supported</quote>
+ &s.code;Support32bppFb&e.code;
+ <quote>32bpp framebuffer supported</quote>
+ &s.code;SupportConvert24to32&e.code;
+ <quote>Can convert 24bpp pixmap to 32bpp fb</quote>
+ &s.code;SupportConvert32to24&e.code;
+ <quote>Can convert 32bpp pixmap to 24bpp fb</quote>
+ &s.code;ForceConvert24to32&e.code;
+ <quote>Force 24bpp pixmap to 32bpp fb conversion</quote>
+ &s.code;ForceConvert32to24&e.code;
+ <quote>Force 32bpp pixmap to 24bpp fb conversion</quote>
+
+ </quote>
+
+ It uses the command line, config file, and default values in the
+ correct order of precedence to determine the depth and bpp values.
+ It is up to the driver to check the results to see that it supports
+ them. If not the &s.code;ChipPreInit()&e.code; function should
+ return &s.code;FALSE&e.code;.
+
+ If only one of depth/bpp is given, the other is set to a reasonable
+ (and consistent) default.
+
+ If a driver finds that the initial &s.code;depth24flags&e.code;
+ it uses later results in a fb format that requires more video
+ memory than is available it may call this function a second time
+ with a different &s.code;depth24flags&e.code; setting.
+
+ On success, the return value is &s.code;TRUE&e.code;. On failure
+ it prints an error message and returns &s.code;FALSE&e.code;.
+
+ The following fields of the &s.code;ScrnInfoRec&e.code; are
+ initialised by this function:
+
+ <quote>
+ &s.code;depth&e.code;, &s.code;bitsPerPixel&e.code;,
+ &s.code;display&e.code;, &s.code;imageByteOrder&e.code;,
+ &s.code;bitmapScanlinePad&e.code;,
+ &s.code;bitmapScanlineUnit&e.code;, &s.code;bitmapBitOrder&e.code;,
+ &s.code;numFormats&e.code;, &s.code;formats&e.code;,
+ &s.code;fbFormat&e.code;.
+ </quote>
+
+ </quote>
+
+ &s.code;void xf86PrintDepthBpp(scrnInfoPtr scrp)&e.code;
+ <quote><p>
+ This function can be used to print out the depth and bpp settings.
+ It should be called after the final call to
+ &s.code;xf86SetDepthBpp()&e.code;.
+
+ </quote>
+
+ &s.code;Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)&e.code;
+ <quote><p>
+ This function sets the &s.code;weight&e.code;, &s.code;mask&e.code;,
+ &s.code;offset&e.code; and &s.code;rgbBits&e.code; fields of the
+ &s.code;ScrnInfoRec&e.code;. It would normally be called fairly
+ early in the &s.code;ChipPreInit()&e.code; function for
+ depths&nbsp;>&nbsp;8bpp.
+
+ It requires that the &s.code;depth&e.code; and
+ &s.code;display&e.code; fields of the &s.code;ScrnInfoRec&e.code;
+ be initialised prior to calling it.
+
+ The parameters passed are:
+
+ &s.code;weight&e.code;
+ <quote><p>
+ driver's preferred default weight if no other is given.
+ If zero, use the overall server default.
+
+ </quote>
+
+ &s.code;mask&e.code;
+ <quote><p>
+ Same, but for mask.
+
+ </quote>
+
+ It uses the command line, config file, and default values in the
+ correct order of precedence to determine the weight value. It
+ derives the mask and offset values from the weight and the defaults.
+ It is up to the driver to check the results to see that it supports
+ them. If not the &s.code;ChipPreInit()&e.code; function should
+ return &s.code;FALSE&e.code;.
+
+ On success, this function prints a message showing the weight
+ values selected, and returns &s.code;TRUE&e.code;.
+
+ On failure it prints an error message and returns &s.code;FALSE&e.code;.
+
+ The following fields of the &s.code;ScrnInfoRec&e.code; are
+ initialised by this function:
+
+ <quote>
+ &s.code;weight&e.code;, &s.code;mask&e.code;, &s.code;offset&e.code;.
+ </quote>
+
+ </quote>
+
+ &s.code;Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual)&e.code;
+ <quote><p>
+ This function sets the &s.code;defaultVisual&e.code; field of the
+ &s.code;ScrnInfoRec&e.code;. It would normally be called fairly
+ early from the &s.code;ChipPreInit()&e.code; function.
+
+ It requires that the &s.code;depth&e.code; and
+ &s.code;display&e.code; fields of the &s.code;ScrnInfoRec&e.code;
+ be initialised prior to calling it.
+
+ The parameters passed are:
+
+ &s.code;visual&e.code;
+ <quote><p>
+ driver's preferred default visual if no other is given.
+ If &s.code;-1&e.code;, use the overall server default.
+
+ </quote>
+
+ It uses the command line, config file, and default values in the
+ correct order of precedence to determine the default visual value.
+ It is up to the driver to check the result to see that it supports
+ it. If not the &s.code;ChipPreInit()&e.code; function should
+ return &s.code;FALSE&e.code;.
+
+ On success, this function prints a message showing the default visual
+ selected, and returns &s.code;TRUE&e.code;.
+
+ On failure it prints an error message and returns &s.code;FALSE&e.code;.
+
+ </quote>
+
+ &s.code;Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)&e.code;
+ <quote><p>
+ This function sets the &s.code;gamma&e.code; field of the
+ &s.code;ScrnInfoRec&e.code;. It would normally be called fairly
+ early from the &s.code;ChipPreInit()&e.code; function in cases
+ where the driver supports gamma correction.
+
+ It requires that the &s.code;monitor&e.code; field of the
+ &s.code;ScrnInfoRec&e.code; be initialised prior to calling it.
+
+ The parameters passed are:
+
+ &s.code;gamma&e.code;
+ <quote><p>
+ driver's preferred default gamma if no other is given.
+ If zero (&s.code;< 0.01&e.code;), use the overall server
+ default.
+
+ </quote>
+
+ It uses the command line, config file, and default values in the
+ correct order of precedence to determine the gamma value. It is
+ up to the driver to check the results to see that it supports
+ them. If not the &s.code;ChipPreInit()&e.code; function should
+ return &s.code;FALSE&e.code;.
+
+ On success, this function prints a message showing the gamma
+ value selected, and returns &s.code;TRUE&e.code;.
+
+ On failure it prints an error message and returns &s.code;FALSE&e.code;.
+
+ </quote>
+
+ &s.code;void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)&e.code;
+ <quote><p>
+ This function sets the &s.code;xDpi&e.code; and &s.code;yDpi&e.code;
+ fields of the &s.code;ScrnInfoRec&e.code;. The driver can specify
+ preferred defaults by setting &s.code;x&e.code; and &s.code;y&e.code;
+ to non-zero values. The &s.cmd;-dpi&e.cmd; command line option
+ overrides all other settings. Otherwise, if the
+ &s.key;DisplaySize&e.key; entry is present in the screen's &k.monitor;
+ config file section, it is used together with the virtual size to
+ calculate the dpi values. This function should be called after
+ all the mode resolution has been done.
+
+ </quote>
+
+ &s.code;void xf86SetBlackWhitePixels(ScrnInfoPtr pScrn)&e.code;
+ <quote><p>
+ This functions sets the &s.code;blackPixel&e.code; and
+ &s.code;whitePixel&e.code; fields of the &s.code;ScrnInfoRec&e.code;
+ according to whether or not the &s.cmd;-flipPixels&e.cmd; command
+ line options is present.
+
+ </quote>
+
+ &s.code;const char *xf86GetVisualName(int visual)&e.code;
+ <quote><p>
+ Returns a printable string with the visual name matching the
+ numerical visual class provided. If the value is outside the
+ range of valid visual classes, &s.code;NULL&e.code; is returned.
+
+ </quote>
+ </quote>
+
+
+<sect1>Primary Mode functions
+<p>
+
+The primary mode helper functions are those which would normally be
+used by a driver, unless it has unusual requirements which cannot
+be catered for the by the helpers.
+
+ <quote><p>
+ &s.code;int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
+ &f.indent;char **modeNames, ClockRangePtr clockRanges,
+ &f.indent;int *linePitches, int minPitch, int maxPitch,
+ &f.indent;int pitchInc, int minHeight, int maxHeight,
+ &f.indent;int virtualX, int virtualY,
+ &f.indent;unsigned long apertureSize,
+ &f.indent;LookupModeFlags strategy)&e.code;
+ <quote><p>
+ This function basically selects the set of modes to use based on
+ those available and the various constraints. It also sets some
+ other related parameters. It is normally called near the end of
+ the &s.code;ChipPreInit()&e.code; function.
+
+ The parameters passed to the function are:
+
+ &s.code;availModes&e.code;
+ <quote><p>
+ List of modes available for the monitor.
+
+ </quote>
+ &s.code;modeNames&e.code;
+ <quote><p>
+ List of mode names that the screen is requesting.
+
+ </quote>
+ &s.code;clockRanges&e.code;
+ <quote><p>
+ A list of clock ranges allowed by the driver. Each
+ range includes whether interlaced or multiscan modes
+ are supported for that range. See below for more on
+ &s.code;clockRanges&e.code;.
+
+ </quote>
+ &s.code;linePitches&e.code;
+ <quote><p>
+ List of line pitches supported by the driver.
+ This is optional and should be &s.code;NULL&e.code; when
+ not used.
+
+ </quote>
+ &s.code;minPitch&e.code;
+ <quote><p>
+ Minimum line pitch supported by the driver. This must
+ be supplied when &s.code;linePitches&e.code; is
+ &s.code;NULL&e.code;, and is ignored otherwise.
+
+ </quote>
+ &s.code;maxPitch&e.code;
+ <quote><p>
+ Maximum line pitch supported by the driver. This is
+ required when &s.code;minPitch&e.code; is required.
+
+ </quote>
+ &s.code;pitchInc&e.code;
+ <quote><p>
+ Granularity of horizontal pitch values as supported by
+ the chipset. This is expressed in bits. This must be
+ supplied.
+
+ </quote>
+ &s.code;minHeight&e.code;
+ <quote><p>
+ minimum virtual height allowed. If zero, no limit is
+ imposed.
+
+ </quote>
+ &s.code;maxHeight&e.code;
+ <quote><p>
+ maximum virtual height allowed. If zero, no limit is
+ imposed.
+
+ </quote>
+ &s.code;virtualX&e.code;
+ <quote><p>
+ If greater than zero, this is the virtual width value
+ that will be used. Otherwise, the virtual width is
+ chosen to be the smallest that can accommodate the modes
+ selected.
+
+ </quote>
+ &s.code;virtualY&e.code;
+ <quote><p>
+ If greater than zero, this is the virtual height value
+ that will be used. Otherwise, the virtual height is
+ chosen to be the smallest that can accommodate the modes
+ selected.
+
+ </quote>
+ &s.code;apertureSize&e.code;
+ <quote><p>
+ The size (in bytes) of the aperture used to access video
+ memory.
+
+ </quote>
+ &s.code;strategy&e.code;
+ <quote><p>
+ The strategy to use when choosing from multiple modes
+ with the same name. The options are:
+
+ &s.code;LOOKUP_DEFAULT&e.code;
+ <quote>???</quote>
+ &s.code;LOOKUP_BEST_REFRESH&e.code;
+ <quote>mode with best refresh rate</quote>
+ &s.code;LOOKUP_CLOSEST_CLOCK&e.code;
+ <quote>mode with closest matching clock</quote>
+ &s.code;LOOKUP_LIST_ORDER&e.code;
+ <quote>first usable mode in list</quote>
+
+ The following options can also be combined (OR'ed) with
+ one of the above:
+
+ &s.code;LOOKUP_CLKDIV2&e.code;
+ <quote>Allow halved clocks</quote>
+ &s.code;LOOKUP_OPTIONAL_TOLERANCES&e.code;
+ <quote>Allow missing horizontal sync and/or vertical refresh
+ ranges in the XF86Config Monitor section</quote>
+
+ &s.code;LOOKUP_OPTIONAL_TOLERANCES&e.code; should only be
+ specified when the driver can ensure all modes it generates
+ can sync on, or at least not damage, the monitor or digital
+ flat panel. Horizontal sync and/or vertical refresh ranges
+ specified by the user will still be honoured (and acted upon).
+
+ </quote>
+
+ This function requires that the following fields of the
+ &s.code;ScrnInfoRec&e.code; are initialised prior to calling it:
+
+ &s.code;clock[]&e.code;
+ <quote>List of discrete clocks (when non-programmable)</quote>
+ &s.code;numClocks&e.code;
+ <quote>Number of discrete clocks (when non-programmable)</quote>
+ &s.code;progClock&e.code;
+ <quote>Whether the clock is programmable or not</quote>
+ &s.code;monitor&e.code;
+ <quote>Pointer to the applicable XF86Config monitor section</quote>
+ &s.code;fdFormat&e.code;
+ <quote>Format of the screen buffer</quote>
+ &s.code;videoRam&e.code;
+ <quote>total video memory size (in bytes)</quote>
+ &s.code;maxHValue&e.code;
+ <quote>Maximum horizontal timing value allowed</quote>
+ &s.code;maxVValue&e.code;
+ <quote>Maximum vertical timing value allowed</quote>
+ &s.code;xInc&e.code;
+ <quote>Horizontal timing increment in pixels (defaults to 8)</quote>
+
+ This function fills in the following &s.code;ScrnInfoRec&e.code;
+ fields:
+
+ &s.code;modePool&e.code;
+ <quote><p>
+ A subset of the modes available to the monitor which
+ are compatible with the driver.
+
+ </quote>
+ &s.code;modes&e.code;
+ <quote><p>
+ One mode entry for each of the requested modes, with
+ the status field of each filled in to indicate if
+ the mode has been accepted or not. This list of
+ modes is a circular list.
+
+ </quote>
+ &s.code;virtualX&e.code;
+ <quote><p>
+ The resulting virtual width.
+
+ </quote>
+ &s.code;virtualY&e.code;
+ <quote><p>
+ The resulting virtual height.
+
+ </quote>
+ &s.code;displayWidth&e.code;
+ <quote><p>
+ The resulting line pitch.
+
+ </quote>
+ &s.code;virtualFrom&e.code;
+ <quote><p>
+ Where the virtual size was determined from.
+
+ </quote>
+
+ The first stage of this function checks that the
+ &s.code;virtualX&e.code; and &s.code;virtualY&e.code; values
+ supplied (if greater than zero) are consistent with the line pitch
+ and &s.code;maxHeight&e.code; limitations. If not, an error
+ message is printed, and the return value is &s.code;-1&e.code;.
+
+ The second stage sets up the mode pool, eliminating immediately
+ any modes that exceed the driver's line pitch limits, and also
+ the virtual width and height limits (if greater than zero). For
+ each mode removed an informational message is printed at verbosity
+ level &s.code;2&e.code;. If the mode pool ends up being empty,
+ a warning message is printed, and the return value is
+ &s.code;0&e.code;.
+
+ The final stage is to lookup each mode name, and fill in the remaining
+ parameters. If an error condition is encountered, a message is
+ printed, and the return value is &s.code;-1&e.code;. Otherwise,
+ the return value is the number of valid modes found
+ (&s.code;0&e.code; if none are found).
+
+ Even if the supplied mode names include duplicates, no two names will
+ ever match the same mode. Furthermore, if the supplied mode names do not
+ yield a valid mode (including the case where no names are passed at all),
+ the function will continue looking through the mode pool until it finds
+ a mode that survives all checks, or until the mode pool is exhausted.
+
+ A message is only printed by this function when a fundamental
+ problem is found. It is intended that this function may be called
+ more than once if there is more than one set of constraints that
+ the driver can work within.
+
+ If this function returns &s.code;-1&e.code;, the
+ &s.code;ChipPreInit()&e.code; function should return
+ &s.code;FALSE&e.code;.
+
+ &s.code;clockRanges&e.code; is a linked list of clock ranges
+ allowed by the driver. If a mode doesn't fit in any of the defined
+ &s.code;clockRanges&e.code;, it is rejected. The first
+ &s.code;clockRange&e.code; that matches all requirements is used.
+ This structure needs to be initialized to NULL when allocated.
+
+ &s.code;clockRanges&e.code; contains the following fields:
+
+ &s.code;minClock&nl;
+ maxClock&e.code;
+ <quote><p>
+ The lower and upper mode clock bounds for which the rest
+ of the &s.code;clockRange&e.code; parameters apply.
+ Since these are the mode clocks, they are not scaled
+ with the &s.code;ClockMulFactor&e.code; and
+ &s.code;ClockDivFactor&e.code;. It is up to the driver
+ to adjust these values if they depend on the clock
+ scaling factors.
+
+ </quote>
+ &s.code;clockIndex&e.code;
+ <quote><p>
+ (not used yet) &s.code;-1&e.code; for programmable clocks
+
+ </quote>
+ &s.code;interlaceAllowed&e.code;
+ <quote><p>
+ &s.code;TRUE&e.code; if interlacing is allowed for this
+ range
+
+ </quote>
+ &s.code;doubleScanAllowed&e.code;
+ <quote><p>
+ &s.code;TRUE&e.code; if doublescan or multiscan is allowed
+ for this range
+
+ </quote>
+ &s.code;ClockMulFactor&nl;
+ ClockDivFactor&e.code;
+ <quote><p>
+ Scaling factors that are applied to the mode clocks ONLY
+ before selecting a clock index (when there is no
+ programmable clock) or a &s.code;SynthClock&e.code;
+ value. This is useful for drivers that support pixel
+ multiplexing or that need to scale the clocks because
+ of hardware restrictions (like sending 24bpp data to an
+ 8 bit RAMDAC using a tripled clock).
+
+ Note that these parameters describe what must be done
+ to the mode clock to achieve the data transport clock
+ between graphics controller and RAMDAC. For example
+ for &s.code;2:1&e.code; pixel multiplexing, two pixels
+ are sent to the RAMDAC on each clock. This allows the
+ RAMDAC clock to be half of the actual pixel clock.
+ Hence, &s.code;ClockMulFactor=1&e.code; and
+ &s.code;ClockDivFactor=2&e.code;. This means that the
+ clock used for clock selection (ie, determining the
+ correct clock index from the list of discrete clocks)
+ or for the &s.code;SynthClock&e.code; field in case of
+ a programmable clock is: (&s.code;mode-&gt;Clock *
+ ClockMulFactor) / ClockDivFactor&e.code;.
+
+ </quote>
+ &s.code;PrivFlags&e.code;
+ <quote><p>
+ This field is copied into the
+ &s.code;mode-&gt;PrivFlags&e.code; field when this
+ &s.code;clockRange&e.code; is selected by
+ &s.code;xf86ValidateModes()&e.code;. It allows the
+ driver to find out what clock range was selected, so it
+ knows it needs to set up pixel multiplexing or any other
+ range-dependent feature. This field is purely
+ driver-defined: it may contain flag bits, an index or
+ anything else (as long as it is an &s.code;INT&e.code;).
+ </quote>
+
+ Note that the &s.code;mode-&gt;SynthClock&e.code; field is always
+ filled in by &s.code;xf86ValidateModes()&e.code;: it will contain
+ the ``data transport clock'', which is the clock that will have
+ to be programmed in the chip when it has a programmable clock, or
+ the clock that will be picked from the clocks list when it is not
+ a programmable one. Thus:
+
+ &s.code;mode-&gt;SynthClock =
+ &f.indent;(mode-&gt;Clock * ClockMulFactor) / ClockDivFactor&e.code;
+
+ </quote>
+
+ &s.code;void xf86PruneDriverModes(ScrnInfoPtr scrp)&e.code;
+ <quote><p>
+ This function deletes modes in the modes field of the
+ &s.code;ScrnInfoRec&e.code; that have been marked as invalid.
+ This is normally run after having run
+ &s.code;xf86ValidateModes()&e.code; for the last time. For each
+ mode that is deleted, a warning message is printed out indicating
+ the reason for it being deleted.
+
+ </quote>
+
+ &s.code;void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags)&e.code;
+ <quote><p>
+ This function fills in the &s.code;Crtc*&e.code; fields for all
+ the modes in the &s.code;modes&e.code; field of the
+ &s.code;ScrnInfoRec&e.code;. The &s.code;adjustFlags&e.code;
+ parameter determines how the vertical CRTC values are scaled for
+ interlaced modes. They are halved if it is
+ &s.code;INTERLACE_HALVE_V&e.code;. The vertical CRTC values are
+ doubled for doublescan modes, and are further multiplied by the
+ &s.code;VScan&e.code; value.
+
+ This function is normally called after calling
+ &s.code;xf86PruneDriverModes()&e.code;.
+
+ </quote>
+
+ &s.code;void xf86PrintModes(ScrnInfoPtr scrp)&e.code;
+ <quote><p>
+ This function prints out the virtual size setting, and the line
+ pitch being used. It also prints out two lines for each mode being
+ used. The first line includes the mode's pixel clock, horizontal sync
+ rate, refresh rate, and whether it is interlaced, doublescanned and/or
+ multi-scanned. The second line is the mode's Modeline.
+
+ This function is normally called after calling
+ &s.code;xf86SetCrtcForModes()&e.code;.
+
+ </quote>
+ </quote>
+
+
+<sect1>Secondary Mode functions
+<p>
+
+The secondary mode helper functions are functions which are normally
+used by the primary mode helper functions, and which are not normally
+called directly by a driver. If a driver has unusual requirements
+and needs to do its own mode validation, it might be able to make
+use of some of these secondary mode helper functions.
+
+ <quote><p>
+ &s.code;int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
+ &f.indent;int *divider)&e.code;
+ <quote><p>
+ This function returns the index of the closest clock to the
+ frequency &s.code;freq&e.code; given (in kHz). It assumes that
+ the number of clocks is greater than zero. It requires that the
+ &s.code;numClocks&e.code; and &s.code;clock&e.code; fields of the
+ &s.code;ScrnInfoRec&e.code; are initialised. The
+ &s.code;allowDiv2&e.code; field determines if the clocks can be
+ halved. The &s.code;*divider&e.code; return value indicates
+ whether clock division is used when determining the clock returned.
+
+ This function is only for non-programmable clocks.
+
+ </quote>
+
+ &s.code;const char *xf86ModeStatusToString(ModeStatus status)&e.code;
+ <quote><p>
+ This function converts the &s.code;status&e.code; value to a
+ descriptive printable string.
+
+ </quote>
+
+ &s.code;ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
+ &f.indent;ClockRangePtr clockRanges, LookupModeFlags strategy)&e.code;
+ <quote><p>
+ This function takes a pointer to a mode with the name filled in,
+ and looks for a mode in the &s.code;modePool&e.code; list which
+ matches. The parameters of the matching mode are filled in to
+ &s.code;*modep&e.code;. The &s.code;clockRanges&e.code; and
+ &s.code;strategy&e.code; parameters are as for the
+ &s.code;xf86ValidateModes()&e.code; function above.
+
+ This function requires the &s.code;modePool&e.code;,
+ &s.code;clock[]&e.code;, &s.code;numClocks&e.code; and
+ &s.code;progClock&e.code; fields of the &s.code;ScrnInfoRec&e.code;
+ to be initialised before being called.
+
+ The return value is &s.code;MODE_OK&e.code; if a mode was found.
+ Otherwise it indicates why a matching mode could not be found.
+
+ </quote>
+
+ &s.code;ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp,
+ &f.indent;DisplayModePtr mode, ClockRangePtr clockRanges,
+ &f.indent;LookupModeFlags strategy, int maxPitch,
+ &f.indent;int virtualX, int virtualY)&e.code;
+ <quote><p>
+ This function checks the passed mode against some basic driver
+ constraints. Apart from the ones passed explicitly, the
+ &s.code;maxHValue&e.code; and &s.code;maxVValue&e.code; fields of
+ the &s.code;ScrnInfoRec&e.code; are also used. If the
+ &s.code;ValidMode&e.code; field of the &s.code;ScrnInfoRec&e.code;
+ is set, that function is also called to check the mode. Next, the
+ mode is checked against the monitor's constraints.
+
+ If the mode is consistent with all constraints, the return value
+ is &s.code;MODE_OK&e.code;. Otherwise the return value indicates
+ which constraint wasn't met.
+
+ </quote>
+
+ &s.code;void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode)&e.code;
+ <quote><p>
+ This function deletes the &s.code;mode&e.code; given from the
+ &s.code;modeList&e.code;. It never prints any messages, so it is
+ up to the caller to print a message if required.
+
+ </quote>
+ </quote>
+
+<sect1>Functions for handling strings and tokens
+<p>
+
+ Tables associating strings and numerical tokens combined with the
+ following functions provide a compact way of handling strings from
+ the config file, and for converting tokens into printable strings.
+ The table data structure is:
+
+<quote><verb>
+typedef struct {
+ int token;
+ const char * name;
+} SymTabRec, *SymTabPtr;
+</verb></quote>
+
+ A table is an initialised array of &s.code;SymTabRec&e.code;. The
+ tokens must be non-negative integers. Multiple names may be mapped
+ to a single token. The table is terminated with an element with a
+ &s.code;token&e.code; value of &s.code;-1&e.code; and
+ &s.code;NULL&e.code; for the &s.code;name&e.code;.
+
+
+ <quote><p>
+ &s.code;const char *xf86TokenToString(SymTabPtr table, int token)&e.code;
+ <quote><p>
+ This function returns the first string in &s.code;table&e.code;
+ that matches &s.code;token&e.code;. If no match is found,
+ &s.code;NULL&e.code; is returned (NOTE, older versions of this
+ function would return the string "unknown" when no match is found).
+
+ </quote>
+
+ &s.code;int xf86StringToToken(SymTabPtr table, const char *string)&e.code;
+ <quote><p>
+ This function returns the first token in &s.code;table&e.code;
+ that matches &s.code;string&e.code;. The
+ &s.code;xf86NameCmp()&e.code; function is used to determine the
+ match. If no match is found, &s.code;-1&e.code; is returned.
+
+ </quote>
+ </quote>
+
+
+<sect1>Functions for finding which config file entries to use
+<p>
+
+ These functions can be used to select the appropriate config file
+ entries that match the detected hardware. They are described above
+ in the <ref id="probe" name="Probe"> and
+ <ref id="avail" name="Available Functions"> sections.
+
+
+<sect1>Probing discrete clocks on old hardware
+<p>
+
+ The &s.code;xf86GetClocks()&e.code; function may be used to assist
+ in finding the discrete pixel clock values on older hardware.
+
+
+ <quote><p>
+ &s.code;void xf86GetClocks(ScrnInfoPtr pScrn, int num,
+ &f.indent;Bool (*ClockFunc)(ScrnInfoPtr, int),
+ &f.indent;void (*ProtectRegs)(ScrnInfoPtr, Bool),
+ &f.indent;void (*BlankScreen)(ScrnInfoPtr, Bool),
+ &f.indent;int vertsyncreg, int maskval, int knownclkindex,
+ &f.indent;int knownclkvalue)&e.code;
+ <quote><p>
+ This function uses a comparative sampling method to measure the
+ discrete pixel clock values. The number of discrete clocks to
+ measure is given by &s.code;num&e.code;. &s.code;clockFunc&e.code;
+ is a function that selects the &s.code;n&e.code;'th clock. It
+ should also save or restore any state affected by programming the
+ clocks when the index passed is &s.code;CLK_REG_SAVE&e.code; or
+ &s.code;CLK_REG_RESTORE&e.code;. &s.code;ProtectRegs&e.code; is
+ a function that does whatever is required to protect the hardware
+ state while selecting a new clock. &s.code;BlankScreen&e.code;
+ is a function that blanks the screen. &s.code;vertsyncreg&e.code;
+ and &s.code;maskval&e.code; are the register and bitmask to
+ check for the presence of vertical sync pulses.
+ &s.code;knownclkindex&e.code; and &s.code;knownclkvalue&e.code;
+ are the index and value of a known clock. These are the known
+ references on which the comparative measurements are based. The
+ number of clocks probed is set in &s.code;pScrn-&gt;numClocks&e.code;,
+ and the probed clocks are set in the &s.code;pScrn-&gt;clock[]&e.code;
+ array. All of the clock values are in units of kHz.
+
+ </quote>
+
+ &s.code;void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from)&e.code;
+ <quote><p>
+ Print out the pixel clocks &s.code;scrp-&gt;clock[]&e.code;.
+ &s.code;from&e.code; indicates whether the clocks were probed
+ or from the config file.
+
+ </quote>
+ </quote>
+
+<sect1>Other helper functions
+<p>
+ <quote><p>
+ &s.code;Bool xf86IsUnblank(int mode)&e.code;
+ <quote><p>
+ Returns &s.code;TRUE&e.code; when the screen saver mode specified
+ by &s.code;mode&e.code; requires the screen be unblanked,
+ and &s.code;FALSE&e.code; otherwise. The screen saver modes that
+ require blanking are &s.code;SCREEN_SAVER_ON&e.code; and
+ &s.code;SCREEN_SAVER_CYCLE&e.code;, and the screen saver modes that
+ require unblanking are &s.code;SCREEN_SAVER_OFF&e.code; and
+ &s.code;SCREEN_SAVER_FORCER&e.code;. Drivers may call this helper
+ from their &s.code;SaveScreen()&e.code; function to interpret the
+ screen saver modes.
+
+ </quote>
+ </quote>
+
+<sect>The vgahw module
+<p>
+
+The vgahw modules provides an interface for saving, restoring and
+programming the standard VGA registers, and for handling VGA colourmaps.
+
+<sect1>Data Structures
+<p>
+
+ The public data structures used by the vgahw module are
+ &s.code;vgaRegRec&e.code; and &s.code;vgaHWRec&e.code;. They are
+ defined in &s.code;vgaHW.h.&e.code;
+
+
+<sect1>General vgahw Functions
+<p>
+
+ <quote><p>
+ &s.code;Bool vgaHWGetHWRec(ScrnInfoPtr pScrn)&e.code;
+ <quote><p>
+ This function allocates a &s.code;vgaHWRec&e.code; structure, and
+ hooks it into the &s.code;ScrnInfoRec&e.code;'s
+ &s.code;privates&e.code;. Like all information hooked into the
+ &s.code;privates&e.code;, it is persistent, and only needs to be
+ allocated once per screen. This function should normally be called
+ from the driver's &s.code;ChipPreInit()&e.code; function. The
+ &s.code;vgaHWRec&e.code; is zero-allocated, and the following
+ fields are explicitly initialised:
+
+ &s.code;ModeReg.DAC[]&e.code;
+ <quote>initialised with a default colourmap</quote>
+ &s.code;ModeReg.Attribute[0x11]&e.code;
+ <quote>initialised with the default overscan index</quote>
+ &s.code;ShowOverscan&e.code;
+ <quote>initialised according to the "ShowOverscan" option</quote>
+ &s.code;paletteEnabled&e.code;
+ <quote>initialised to FALSE</quote>
+ &s.code;cmapSaved&e.code;
+ <quote>initialised to FALSE</quote>
+ &s.code;pScrn&e.code;
+ <quote>initialised to pScrn</quote>
+
+ In addition to the above, &s.code;vgaHWSetStdFuncs()&e.code; is
+ called to initialise the register access function fields with the
+ standard VGA set of functions.
+
+ Once allocated, a pointer to the &s.code;vgaHWRec&e.code; can be
+ obtained from the &s.code;ScrnInfoPtr&e.code; with the
+ &s.code;VGAHWPTR(pScrn)&e.code; macro.
+
+ </quote>
+
+ &s.code;void vgaHWFreeHWRec(ScrnInfoPtr pScrn)&e.code;
+ <quote><p>
+ This function frees a &s.code;vgaHWRec&e.code; structure. It
+ should be called from a driver's &s.code;ChipFreeScreen()&e.code;
+ function.
+
+ </quote>
+
+ &s.code;Bool vgaHWSetRegCounts(ScrnInfoPtr pScrn, int numCRTC,
+ &f.indent;int numSequencer, int numGraphics, int numAttribute)&e.code;
+ <quote><p>
+ This function allows the number of CRTC, Sequencer, Graphics and
+ Attribute registers to be changed. This makes it possible for
+ extended registers to be saved and restored with
+ &s.code;vgaHWSave()&e.code; and &s.code;vgaHWRestore()&e.code;.
+ This function should be called after a &s.code;vgaHWRec&e.code;
+ has been allocated with &s.code;vgaHWGetHWRec()&e.code;. The
+ default values are defined in &s.code;vgaHW.h&e.code; as follows:
+
+ <quote><verb>
+#define VGA_NUM_CRTC 25
+#define VGA_NUM_SEQ 5
+#define VGA_NUM_GFX 9
+#define VGA_NUM_ATTR 21
+ </verb></quote>
+
+ </quote>
+
+ &s.code;Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src)&e.code;
+ <quote><p>
+ This function copies the contents of the VGA saved registers in
+ &s.code;src&e.code; to &s.code;dst&e.code;. Note that it isn't
+ possible to simply do this with &s.code;memcpy()&e.code; (or
+ similar). This function returns &s.code;TRUE&e.code; unless there
+ is a problem allocating space for the &s.code;CRTC&e.code and
+ related fields in &s.code;dst&e.code;.
+
+ </quote>
+
+ &s.code;void vgaHWSetStdFuncs(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ This function initialises the register access function fields of
+ &s.code;hwp&e.code; with the standard VGA set of functions. This
+ is called by &s.code;vgaHWGetHWRec()&e.code;, so there is usually
+ no need to call this explicitly. The register access functions
+ are described below. If the registers are shadowed in some other
+ port I/O space (for example a PCI I/O region), these functions
+ can be used to access the shadowed registers if
+ &s.code;hwp-&gt;PIOOffset&e.code; is initialised with
+ &s.code;offset&e.code;, calculated in such a way that when the
+ standard VGA I/O port value is added to it the correct offset into
+ the PIO area results. This value is initialised to zero in
+ &s.code;vgaHWGetHWRec()&e.code;. (Note: the PIOOffset functionality
+ is present in XFree86 4.1.0 and later.)
+
+ </quote>
+
+ &s.code;void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset)&e.code;
+ <quote><p>
+ This function initialised the register access function fields of
+ hwp with a generic MMIO set of functions.
+ &s.code;hwp-&gt;MMIOBase&e.code; is initialised with
+ &s.code;base&e.code;, which must be the virtual address that the
+ start of MMIO area is mapped to. &s.code;hwp-&gt;MMIOOffset&e.code;
+ is initialised with &s.code;offset&e.code;, which must be calculated
+ in such a way that when the standard VGA I/O port value is added
+ to it the correct offset into the MMIO area results. That means
+ that these functions are only suitable when the VGA I/O ports are
+ made available in a direct mapping to the MMIO space. If that is
+ not the case, the driver will need to provide its own register
+ access functions. The register access functions are described
+ below.
+
+ </quote>
+
+ &s.code;Bool vgaHWMapMem(ScrnInfoPtr pScrn)&e.code;
+ <quote><p>
+ This function maps the VGA memory window. It requires that the
+ &s.code;vgaHWRec&e.code; be allocated. If a driver requires
+ non-default &s.code;MapPhys&e.code; or &s.code;MapSize&e.code;
+ settings (the physical location and size of the VGA memory window)
+ then those fields of the &s.code;vgaHWRec&e.code; must be initialised
+ before calling this function. Otherwise, this function initialiases
+ the default values of &s.code;0xA0000&e.code; for
+ &s.code;MapPhys&e.code; and &s.code;(64&nbsp;*&nbsp;1024)&e.code; for
+ &s.code;MapSize&e.code;. This function must be called before
+ attempting to save or restore the VGA state. If the driver doesn't
+ call it explicitly, the &s.code;vgaHWSave()&e.code; and
+ &s.code;vgaHWRestore()&e.code; functions may call it if they need
+ to access the VGA memory (in which case they will also call
+ &s.code;vgaHWUnmapMem()&e.code; to unmap the VGA memory before
+ exiting).
+
+ </quote>
+
+ &s.code;void vgaHWUnmapMem(ScrnInfoPtr pScrn)&e.code;
+ <quote><p>
+ This function unmaps the VGA memory window. It must only be called
+ after the memory has been mapped. The &s.code;Base&e.code; field
+ of the &s.code;vgaHWRec&e.code; field is set to &s.code;NULL&e.code;
+ to indicate that the memory is no longer mapped.
+
+ </quote>
+
+ &s.code;void vgaHWGetIOBase(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ This function initialises the &s.code;IOBase&e.code; field of the
+ &s.code;vgaHWRec&e.code;. This function must be called before
+ using any other functions that access the video hardware.
+
+ A macro &s.code;VGAHW_GET_IOBASE()&e.code; is also available in
+ &s.code;vgaHW.h&e.code; that returns the I/O base, and this may
+ be used when the vgahw module is not loaded (for example, in the
+ &s.code;ChipProbe()&e.code; function).
+
+ </quote>
+
+ &s.code;void vgaHWUnlock(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ This function unlocks the VGA &s.code;CRTC[0-7]&e.code; registers,
+ and must be called before attempting to write to those registers.
+
+ </quote>
+
+ &s.code;void vgaHWLock(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ This function locks the VGA &s.code;CRTC[0-7]&e.code; registers.
+
+ </quote>
+
+ &s.code;void vgaHWEnable(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ This function enables the VGA subsystem. (Note, this function is
+ present in XFree86 4.1.0 and later.).
+
+ </quote>
+
+ &s.code;void vgaHWDisable(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ This function disables the VGA subsystem. (Note, this function is
+ present in XFree86 4.1.0 and later.).
+
+ </quote>
+
+ &s.code;void vgaHWSave(ScrnInfoPtr pScrn, vgaRegPtr save, int flags)&e.code;
+ <quote><p>
+ This function saves the VGA state. The state is written to the
+ &s.code;vgaRegRec&e.code; pointed to by &s.code;save&e.code;.
+ &s.code;flags&e.code; is set to one or more of the following flags
+ ORed together:
+
+ &s.code;VGA_SR_MODE&e.code;
+ <quote>the mode setting registers are saved</quote>
+ &s.code;VGA_SR_FONTS&e.code;
+ <quote>the text mode font/text data is saved</quote>
+ &s.code;VGA_SR_CMAP&e.code;
+ <quote>the colourmap (LUT) is saved</quote>
+ &s.code;VGA_SR_ALL&e.code;
+ <quote>all of the above are saved</quote>
+
+ The &s.code;vgaHWRec&e.code; and its &s.code;IOBase&e.code; fields
+ must be initialised before this function is called. If
+ &s.code;VGA_SR_FONTS&e.code; is set in &s.code;flags&e.code;, the
+ VGA memory window must be mapped. If it isn't then
+ &s.code;vgaHWMapMem()&e.code; will be called to map it, and
+ &s.code;vgaHWUnmapMem()&e.code; will be called to unmap it
+ afterwards. &s.code;vgaHWSave()&e.code; uses the three functions
+ below in the order &s.code;vgaHWSaveColormap()&e.code;,
+ &s.code;vgaHWSaveMode()&e.code;, &s.code;vgaHWSaveFonts()&e.code; to
+ carry out the different save phases. It is undecided at this
+ stage whether they will remain part of the vgahw module's public
+ interface or not.
+
+ </quote>
+
+ &s.code;void vgaHWSaveMode(ScrnInfoPtr pScrn, vgaRegPtr save)&e.code;
+ <quote><p>
+ This function saves the VGA mode registers. They are saved to
+ the &s.code;vgaRegRec&e.code; pointed to by &s.code;save&e.code;.
+ The registers saved are:
+
+ <quote>
+ &s.code;MiscOut&nl;
+ CRTC[0-0x18]&nl;
+ Attribute[0-0x14]&nl;
+ Graphics[0-8]&nl;
+ Sequencer[0-4]&e.code;
+ </quote>
+
+ The number of registers actually saved may be modified by a prior call
+ to &s.code;vgaHWSetRegCounts()&e.code;.
+
+ </quote>
+
+ &s.code;void vgaHWSaveFonts(ScrnInfoPtr pScrn, vgaRegPtr save)&e.code;
+ <quote><p>
+ This function saves the text mode font and text data held in the
+ video memory. If called while in a graphics mode, no save is
+ done. The VGA memory window must be mapped with
+ &s.code;vgaHWMapMem()&e.code; before to calling this function.
+
+ On some platforms, one or more of the font/text plane saves may be
+ no-ops. This is the case when the platform's VC driver already
+ takes care of this.
+
+ </quote>
+
+ &s.code;void vgaHWSaveColormap(ScrnInfoPtr pScrn, vgaRegPtr save)&e.code;
+ <quote><p>
+ This function saves the VGA colourmap (LUT). Before saving it, it
+ attempts to verify that the colourmap is readable. In rare cases
+ where it isn't readable, a default colourmap is saved instead.
+
+ </quote>
+
+ &s.code;void vgaHWRestore(ScrnInfoPtr pScrn, vgaRegPtr restore, int flags)&e.code;
+ <quote><p>
+ This function programs the VGA state. The state programmed is
+ that contained in the &s.code;vgaRegRec&e.code; pointed to by
+ &s.code;restore&e.code;. &s.code;flags&e.code; is the same
+ as described above for the &s.code;vgaHWSave()&e.code; function.
+
+ The &s.code;vgaHWRec&e.code; and its &s.code;IOBase&e.code; fields
+ must be initialised before this function is called. If
+ &s.code;VGA_SR_FONTS&e.code; is set in &s.code;flags&e.code;, the
+ VGA memory window must be mapped. If it isn't then
+ &s.code;vgaHWMapMem()&e.code; will be called to map it, and
+ &s.code;vgaHWUnmapMem()&e.code; will be called to unmap it
+ afterwards. &s.code;vgaHWRestore()&e.code; uses the three functions
+ below in the order &s.code;vgaHWRestoreFonts()&e.code;,
+ &s.code;vgaHWRestoreMode()&e.code;,
+ &s.code;vgaHWRestoreColormap()&e.code; to carry out the different
+ restore phases. It is undecided at this stage whether they will
+ remain part of the vgahw module's public interface or not.
+
+ </quote>
+
+ &s.code;void vgaHWRestoreMode(ScrnInfoPtr pScrn, vgaRegPtr restore)&e.code;
+ <quote><p>
+ This function restores the VGA mode registers. They are restored
+ from the data in the &s.code;vgaRegRec&e.code; pointed to by
+ &s.code;restore&e.code;. The registers restored are:
+
+ <quote>
+ &s.code;MiscOut&nl;
+ CRTC[0-0x18]&nl;
+ Attribute[0-0x14]&nl;
+ Graphics[0-8]&nl;
+ Sequencer[0-4]&e.code;
+ </quote>
+
+ The number of registers actually restored may be modified by a prior call
+ to &s.code;vgaHWSetRegCounts()&e.code;.
+
+ </quote>
+
+ &s.code;void vgaHWRestoreFonts(ScrnInfoPtr pScrn, vgaRegPtr restore)&e.code;
+ <quote><p>
+ This function restores the text mode font and text data to the
+ video memory. The VGA memory window must be mapped with
+ &s.code;vgaHWMapMem()&e.code; before to calling this function.
+
+ On some platforms, one or more of the font/text plane restores
+ may be no-ops. This is the case when the platform's VC driver
+ already takes care of this.
+
+ </quote>
+
+ &s.code;void vgaHWRestoreColormap(ScrnInfoPtr pScrn, vgaRegPtr restore)&e.code;
+ <quote><p>
+ This function restores the VGA colourmap (LUT).
+
+ </quote>
+
+ &s.code;void vgaHWInit(ScrnInfoPtr pScrn, DisplayModePtr mode)&e.code;
+ <quote><p>
+ This function fills in the &s.code;vgaHWRec&e.code;'s
+ &s.code;ModeReg&e.code; field with the values appropriate for
+ programming the given video mode. It requires that the
+ &s.code;ScrnInfoRec&e.code;'s &s.code;depth&e.code; field is
+ initialised, which determines how the registers are programmed.
+
+ </quote>
+
+ &s.code;void vgaHWSeqReset(vgaHWPtr hwp, Bool start)&e.code;
+ <quote><p>
+ Do a VGA sequencer reset. If start is &s.code;TRUE&e.code;, the
+ reset is started. If start is &s.code;FALSE&e.code;, the reset
+ is ended.
+
+ </quote>
+
+ &s.code;void vgaHWProtect(ScrnInfoPtr pScrn, Bool on)&e.code;
+ <quote><p>
+ This function protects VGA registers and memory from corruption
+ during loads. It is typically called with on set to
+ &s.code;TRUE&e.code; before programming, and with on set to
+ &s.code;FALSE&e.code; after programming.
+
+ </quote>
+
+ &s.code;Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode)&e.code;
+ <quote><p>
+ This function blanks and unblanks the screen. It is blanked when
+ &s.code;mode&e.code; is &s.code;SCREEN_SAVER_ON&e.code; or
+ &s.code;SCREEN_SAVER_CYCLE&e.code;, and unblanked when
+ &s.code;mode&e.code; is &s.code;SCREEN_SAVER_OFF&e.code; or
+ &s.code;SCREEN_SAVER_FORCER&e.code;.
+
+ </quote>
+
+ &s.code;void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on)&e.code;
+ <quote><p>
+ This function blanks and unblanks the screen. It is blanked when
+ &s.code;on&e.code; is &s.code;FALSE&e.code;, and unblanked when
+ &s.code;on&e.code; is &s.code;TRUE&e.code;. This function is
+ provided for use in cases where the &s.code;ScrnInfoRec&e.code;
+ can't be derived from the &s.code;ScreenRec&e.code; (while probing
+ for clocks, for example).
+
+ </quote>
+ </quote>
+
+<sect1>VGA Colormap Functions
+<p>
+
+ The vgahw module uses the standard colormap support (see the
+ <ref id="cmap" name="Colormap Handling"> section. This is initialised
+ with the following function:
+
+ <quote>
+ &s.code;Bool vgaHWHandleColormaps(ScreenPtr pScreen)&e.code;
+ </quote>
+
+
+<sect1>VGA Register Access Functions
+<p>
+
+ The vgahw module abstracts access to the standard VGA registers by
+ using a set of functions held in the &s.code;vgaHWRec&e.code;. When
+ the &s.code;vgaHWRec&e.code; is created these function pointers are
+ initialised with the set of standard VGA I/O register access functions.
+ In addition to these, the vgahw module includes a basic set of MMIO
+ register access functions, and the &s.code;vgaHWRec&e.code; function
+ pointers can be initialised to these by calling the
+ &s.code;vgaHWSetMmioFuncs()&e.code; function described above. Some
+ drivers/platforms may require a different set of functions for VGA
+ access. The access functions are described here.
+
+
+ <quote><p>
+ &s.code;void writeCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to CRTC register &s.code;index&e.code;.
+
+ </quote>
+
+ &s.code;CARD8 readCrtc(vgaHWPtr hwp, CARD8 index)&e.code;
+ <quote><p>
+ Return the value read from CRTC register &s.code;index&e.code;.
+
+ </quote>
+
+ &s.code;void writeGr(vgaHWPtr hwp, CARD8 index, CARD8 value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to Graphics Controller register
+ &s.code;index&e.code;.
+
+ </quote>
+
+ &s.code;CARD8 readGR(vgaHWPtr hwp, CARD8 index)&e.code;
+ <quote><p>
+ Return the value read from Graphics Controller register
+ &s.code;index&e.code;.
+
+ </quote>
+
+ &s.code;void writeSeq(vgaHWPtr hwp, CARD8 index, CARD8, value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to Sequencer register
+ &s.code;index&e.code;.
+
+ </quote>
+
+ &s.code;CARD8 readSeq(vgaHWPtr hwp, CARD8 index)&e.code;
+ <quote><p>
+ Return the value read from Sequencer register &s.code;index&e.code;.
+
+ </quote>
+
+ &s.code;void writeAttr(vgaHWPtr hwp, CARD8 index, CARD8, value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to Attribute Controller register
+ &s.code;index&e.code;. When writing out the index value this
+ function should set bit 5 (&s.code;0x20&e.code;) according to the
+ setting of &s.code;hwp-&gt;paletteEnabled&e.code; in order to
+ preserve the palette access state. It should be cleared when
+ &s.code;hwp-&gt;paletteEnabled&e.code; is &s.code;TRUE&e.code;
+ and set when it is &s.code;FALSE&e.code;.
+
+ </quote>
+
+ &s.code;CARD8 readAttr(vgaHWPtr hwp, CARD8 index)&e.code;
+ <quote><p>
+ Return the value read from Attribute Controller register
+ &s.code;index&e.code;. When writing out the index value this
+ function should set bit 5 (&s.code;0x20&e.code;) according to the
+ setting of &s.code;hwp-&gt;paletteEnabled&e.code; in order to
+ preserve the palette access state. It should be cleared when
+ &s.code;hwp-&gt;paletteEnabled&e.code; is &s.code;TRUE&e.code;
+ and set when it is &s.code;FALSE&e.code;.
+
+ </quote>
+
+ &s.code;void writeMiscOut(vgaHWPtr hwp, CARD8 value)&e.code;
+ <quote><p>
+ Write `&s.code;value&e.code;' to the Miscellaneous Output register.
+
+ </quote>
+
+ &s.code;CARD8 readMiscOut(vgwHWPtr hwp)&e.code;
+ <quote><p>
+ Return the value read from the Miscellaneous Output register.
+
+ </quote>
+
+ &s.code;void enablePalette(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ Clear the palette address source bit in the Attribute Controller
+ index register and set &s.code;hwp-&gt;paletteEnabled&e.code; to
+ &s.code;TRUE&e.code;.
+
+ </quote>
+
+ &s.code;void disablePalette(vgaHWPtr hwp)&e.code;
+ <quote><p>
+ Set the palette address source bit in the Attribute Controller
+ index register and set &s.code;hwp-&gt;paletteEnabled&e.code; to
+ &s.code;FALSE&e.code;.
+
+ </quote>
+
+ &s.code;void writeDacMask(vgaHWPtr hwp, CARD8 value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to the DAC Mask register.
+
+ </quote>
+
+ &s.code;CARD8 readDacMask(vgaHWptr hwp)&e.code;
+ <quote><p>
+ Return the value read from the DAC Mask register.
+
+ </quote>
+
+ &s.code;void writeDacReadAddress(vgaHWPtr hwp, CARD8 value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to the DAC Read Address register.
+
+ </quote>
+
+ &s.code;void writeDacWriteAddress(vgaHWPtr hwp, CARD8 value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to the DAC Write Address register.
+
+ </quote>
+
+ &s.code;void writeDacData(vgaHWPtr hwp, CARD8 value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to the DAC Data register.
+
+ </quote>
+
+ &s.code;CARD8 readDacData(vgaHWptr hwp)&e.code;
+ <quote><p>
+ Return the value read from the DAC Data register.
+
+ </quote>
+
+ &s.code;CARD8 readEnable(vgaHWptr hwp)&e.code;
+ <quote><p>
+ Return the value read from the VGA Enable register. (Note: This
+ function is present in XFree86 4.1.0 and later.)
+
+ </quote>
+
+ &s.code;void writeEnable(vgaHWPtr hwp, CARD8 value)&e.code;
+ <quote><p>
+ Write &s.code;value&e.code; to the VGA Enable register. (Note: This
+ function is present in XFree86 4.1.0 and later.)
+
+ </quote>
+ </quote>
+
+<sect>Some notes about writing a driver<label id="sample">
+<p>
+
+<em>NOTE: some parts of this are not up to date</em>
+
+The following is an outline for writing a basic unaccelerated driver
+for a PCI video card with a linear mapped framebuffer, and which has a
+VGA core. It is includes some general information that is relevant to
+most drivers (even those which don't fit that basic description).
+
+The information here is based on the initial conversion of the Matrox
+Millennium driver to the ``new design''. For a fleshing out and sample
+implementation of some of the bits outlined here, refer to that driver.
+Note that this is an example only. The approach used here will not be
+appropriate for all drivers.
+
+Each driver must reserve a unique driver name, and a string that is used
+to prefix all of its externally visible symbols. This is to avoid name
+space clashes when loading multiple drivers. The examples here are for
+the ``ZZZ'' driver, which uses the ``ZZZ'' or ``zzz'' prefix for its externally
+visible symbols.
+
+
+<sect1>Include files
+<p>
+
+ All drivers normally include the following headers:
+ <quote>
+ &s.code;"xf86.h"&nl;
+ "xf86_OSproc.h"&nl;
+ "xf86_ansic.h"&nl;
+ "xf86Resources.h"&e.code;
+ </quote>
+ Wherever inb/outb (and related things) are used the following should be
+ included:
+ <quote>
+ &s.code;"compiler.h"&e.code;
+ </quote>
+ Note: in drivers, this must be included after &s.code;"xf86_ansic.h"&e.code;.
+
+ Drivers that need to access PCI vendor/device definitions need this:
+ <quote>
+ &s.code;"xf86PciInfo.h"&e.code;
+ </quote>
+
+ Drivers that need to access the PCI config space need this:
+ <quote>
+ &s.code;"xf86Pci.h"&e.code;
+ </quote>
+
+ Drivers using the mi banking wrapper need:
+
+ <quote>
+ &s.code;"mibank.h"&e.code;
+ </quote>
+
+ Drivers that initialise a SW cursor need this:
+ <quote>
+ &s.code;"mipointer.h"&e.code;
+ </quote>
+
+ All drivers implementing backing store need this:
+ <quote>
+ &s.code;"mibstore.h"&e.code;
+ </quote>
+
+ All drivers using the mi colourmap code need this:
+ <quote>
+ &s.code;"micmap.h"&e.code;
+ </quote>
+
+ If a driver uses the vgahw module, it needs this:
+ <quote>
+ &s.code;"vgaHW.h"&e.code;
+ </quote>
+
+ Drivers supporting VGA or Hercules monochrome screens need:
+ <quote>
+ &s.code;"xf1bpp.h"&e.code;
+ </quote>
+
+ Drivers supporting VGA or EGC 16-colour screens need:
+ <quote>
+ &s.code;"xf4bpp.h"&e.code;
+ </quote>
+
+ Drivers using cfb need:
+ <quote>
+ &s.code;#define PSZ 8&nl;
+ #include "cfb.h"&nl;
+ #undef PSZ&e.code;
+ </quote>
+
+ Drivers supporting bpp 16, 24 or 32 with cfb need one or more of:
+ <quote>
+ &s.code;"cfb16.h"&nl;
+ "cfb24.h"&nl;
+ "cfb32.h"&e.code;
+ </quote>
+
+ The driver's own header file:
+ <quote>
+ &s.code;"zzz.h"&e.code;
+ </quote>
+
+ Drivers must NOT include the following:
+
+ <quote>
+ &s.code;"xf86Priv.h"&nl;
+ "xf86Privstr.h"&nl;
+ "xf86_libc.h"&nl;
+ "xf86_OSlib.h"&nl;
+ "Xos.h"&e.code;&nl;
+ any OS header
+ </quote>
+
+
+<sect1>Data structures and initialisation
+<p>
+
+<itemize>
+ <item>The following macros should be defined:
+ <code>
+#define VERSION <version-as-an-int>
+#define ZZZ_NAME "ZZZ" /* the name used to prefix messages */
+#define ZZZ_DRIVER_NAME "zzz" /* the driver name as used in config file */
+#define ZZZ_MAJOR_VERSION <int>
+#define ZZZ_MINOR_VERSION <int>
+#define ZZZ_PATCHLEVEL <int>
+ </code>
+<p>
+ NOTE: &s.code;ZZZ_DRIVER_NAME&e.code; should match the name of the
+ driver module without things like the "lib" prefix, the "_drv" suffix
+ or filename extensions.
+<p>
+
+ <item>A DriverRec must be defined, which includes the functions required
+ at the pre-probe phase. The name of this DriverRec must be an
+ upper-case version of ZZZ_DRIVER_NAME (for the purposes of static
+ linking).
+<p>
+ <code>
+DriverRec ZZZ = {
+ VERSION,
+ ZZZ_DRIVER_NAME,
+ ZZZIdentify,
+ ZZZProbe,
+ ZZZAvailableOptions,
+ NULL,
+ 0
+};
+ </code>
+
+ <item>Define list of supported chips and their matching ID:
+<p>
+ <code>
+static SymTabRec ZZZChipsets[] = {
+ { PCI_CHIP_ZZZ1234, "zzz1234a" },
+ { PCI_CHIP_ZZZ5678, "zzz5678a" },
+ { -1, NULL }
+};
+ </code>
+<p>
+ The token field may be any integer value that the driver may use to
+ uniquely identify the supported chipsets. For drivers that support
+ only PCI devices using the PCI device IDs might be a natural choice,
+ but this isn't mandatory. For drivers that support both PCI and other
+ devices (like ISA), some other ID should probably used. When other
+ IDs are used as the tokens it is recommended that the names be
+ defined as an &s.code;enum&e.code; type.
+<p>
+ <item>If the driver uses the &s.code;xf86MatchPciInstances(&e.code;)
+ helper (recommended for drivers that support PCI cards) a list that
+ maps PCI IDs to chip IDs and fixed resources must be defined:
+<p>
+ <code>
+static PciChipsets ZZZPciChipsets[] = {
+ { PCI_CHIP_ZZZ1234, PCI_CHIP_ZZZ1234, RES_SHARED_VGA },
+ { PCI_CHIP_ZZZ5678, PCI_CHIP_ZZZ5678, RES_SHARED_VGA },
+ { -1, -1, RES_UNDEFINED }
+}
+ </code>
+<p>
+ <item>Define the &s.code;XF86ModuleVersionInfo&e.code; struct for the
+ driver. This is required for the dynamically loaded version:
+<p>
+ <code>
+#ifdef XFree86LOADER
+static XF86ModuleVersionInfo zzzVersRec =
+{
+ "zzz",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ ZZZ_MAJOR_VERSION, ZZZ_MINOR_VERSION, ZZZ_PATCHLEVEL,
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_VIDEODRV,
+ {0,0,0,0}
+};
+#endif
+ </code>
+<p>
+ <item>Define a data structure to hold the driver's screen-specific data.
+ This must be used instead of global variables. This would be defined
+ in the &s.code;"zzz.h"&e.code; file, something like:
+<p>
+ <code>
+typedef struct {
+ type1 field1;
+ type2 field2;
+ int fooHack;
+ Bool pciRetry;
+ Bool noAccel;
+ Bool hwCursor;
+ CloseScreenProcPtr CloseScreen;
+ OptionInfoPtr Options;
+ ...
+} ZZZRec, *ZZZPtr;
+ </code>
+<p>
+ <item>Define the list of config file Options that the driver accepts. For
+ consistency between drivers those in the list of ``standard'' options
+ should be used where appropriate before inventing new options.
+<p>
+ <code>
+typedef enum {
+ OPTION_FOO_HACK,
+ OPTION_PCI_RETRY,
+ OPTION_HW_CURSOR,
+ OPTION_NOACCEL
+} ZZZOpts;
+
+static const OptionInfoRec ZZZOptions[] = {
+ { OPTION_FOO_HACK, "FooHack", OPTV_INTEGER, {0}, FALSE },
+ { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+};
+ </code>
+<p>
+</itemize>
+
+<sect1>Functions
+<p>
+
+
+<sect2>SetupProc
+<p>
+
+ For dynamically loaded modules, a &s.code;ModuleData&e.code;
+ variable is required. It is should be the name of the driver
+ prepended to "ModuleData". A &s.code;Setup()&e.code; function is
+ also required, which calls &s.code;xf86AddDriver()&e.code; to add
+ the driver to the main list of drivers.
+
+ <code>
+#ifdef XFree86LOADER
+
+static MODULESETUPPROTO(mgaSetup);
+
+XF86ModuleData zzzModuleData = { &amp;zzzVersRec, zzzSetup, NULL };
+
+static pointer
+zzzSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+
+ /* This module should be loaded only once, but check to be sure. */
+
+ if (!setupDone) {
+ /*
+ * Modules that this driver always requires may be loaded
+ * here by calling LoadSubModule().
+ */
+
+ setupDone = TRUE;
+ xf86AddDriver(&amp;MGA, module, 0);
+
+ /*
+ * The return value must be non-NULL on success even though
+ * there is no TearDownProc.
+ */
+ return (pointer)1;
+ } else {
+ if (errmaj) *errmaj = LDR_ONCEONLY;
+ return NULL;
+ }
+}
+#endif
+ </code>
+
+<sect2>GetRec, FreeRec
+<p>
+
+ A function is usually required to allocate the driver's
+ screen-specific data structure and hook it into the
+ &s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code; field.
+ The &s.code;ScrnInfoRec&e.code;'s &s.code;driverPrivate&e.code; is
+ initialised to &s.code;NULL&e.code;, so it is easy to check if the
+ initialisation has already been done. After allocating it, initialise
+ the fields. By using &s.code;xnfcalloc()&e.code; to do the allocation
+ it is zeroed, and if the allocation fails the server exits.
+<p>
+ NOTE:
+ When allocating structures from inside the driver which are defined
+ on the common level it is important to initialize the structure to
+ zero.
+ Only this guarantees that the server remains source compatible to
+ future changes in common level structures.
+
+ <code>
+static Bool
+ZZZGetRec(ScrnInfoPtr pScrn)
+{
+ if (pScrn->driverPrivate != NULL)
+ return TRUE;
+ pScrn->driverPrivate = xnfcalloc(sizeof(ZZZRec), 1);
+ /* Initialise as required */
+ ...
+ return TRUE;
+}
+ </code>
+
+ Define a macro in &s.code;"zzz.h"&e.code; which gets a pointer to
+ the &s.code;ZZZRec&e.code; when given &s.code;pScrn&e.code;:
+
+ <code>
+#define ZZZPTR(p) ((ZZZPtr)((p)->driverPrivate))
+ </code>
+
+ Define a function to free the above, setting it to &s.code;NULL&e.code;
+ once it has been freed:
+
+ <code>
+static void
+ZZZFreeRec(ScrnInfoPtr pScrn)
+{
+ if (pScrn->driverPrivate == NULL)
+ return;
+ xfree(pScrn->driverPrivate);
+ pScrn->driverPrivate = NULL;
+}
+ </code>
+
+<sect2>Identify
+<p>
+
+ Define the &s.code;Identify()&e.code; function. It is run before
+ the Probe, and typically prints out an identifying message, which
+ might include the chipsets it supports. This function is mandatory:
+
+ <code>
+static void
+ZZZIdentify(int flags)
+{
+ xf86PrintChipsets(ZZZ_NAME, "driver for ZZZ Tech chipsets",
+ ZZZChipsets);
+}
+ </code>
+
+<sect2>Probe
+<p>
+
+ Define the &s.code;Probe()&e.code; function. The purpose of this
+ is to find all instances of the hardware that the driver supports,
+ and for the ones not already claimed by another driver, claim the
+ slot, and allocate a &s.code;ScrnInfoRec&e.code;. This should be
+ a minimal probe, and it should under no circumstances leave the
+ state of the hardware changed. Because a device is found, don't
+ assume that it will be used. Don't do any initialisations other
+ than the required &s.code;ScrnInfoRec&e.code; initialisations.
+ Don't allocate any new data structures.
+
+ This function is mandatory.
+
+ NOTE: The &s.code;xf86DrvMsg()&e.code; functions cannot be used from
+ the Probe.
+
+ <code>
+static Bool
+ZZZProbe(DriverPtr drv, int flags)
+{
+ Bool foundScreen = FALSE;
+ int numDevSections, numUsed;
+ GDevPtr *devSections;
+ int *usedChips;
+ int i;
+
+ /*
+ * Find the config file Device sections that match this
+ * driver, and return if there are none.
+ */
+ if ((numDevSections = xf86MatchDevice(ZZZ_DRIVER_NAME,
+ &amp;devSections)) <= 0) {
+ return FALSE;
+ }
+
+ /*
+ * Since this is a PCI card, "probing" just amounts to checking
+ * the PCI data that the server has already collected. If there
+ * is none, return.
+ *
+ * Although the config file is allowed to override things, it
+ * is reasonable to not allow it to override the detection
+ * of no PCI video cards.
+ *
+ * The provided xf86MatchPciInstances() helper takes care of
+ * the details.
+ */
+ /* test if PCI bus present */
+ if (xf86GetPciVideoInfo()) {
+
+ numUsed = xf86MatchPciInstances(ZZZ_NAME, PCI_VENDOR_ZZZ,
+ ZZZChipsets, ZZZPciChipsets, devSections,
+ numDevSections, drv, &amp;usedChips);
+
+ for (i = 0; i < numUsed; i++) {
+ ScrnInfoPtr pScrn = NULL;
+ if ((pScrn = xf86ConfigPciEntity(pScrn, flags, usedChips[i],
+ ZZZPciChipsets, NULL, NULL,
+ NULL, NULL, NULL))) {
+ /* Allocate a ScrnInfoRec */
+ pScrn->driverVersion = VERSION;
+ pScrn->driverName = ZZZ_DRIVER_NAME;
+ pScrn->name = ZZZ_NAME;
+ pScrn->Probe = ZZZProbe;
+ pScrn->PreInit = ZZZPreInit;
+ pScrn->ScreenInit = ZZZScreenInit;
+ pScrn->SwitchMode = ZZZSwitchMode;
+ pScrn->AdjustFrame = ZZZAdjustFrame;
+ pScrn->EnterVT = ZZZEnterVT;
+ pScrn->LeaveVT = ZZZLeaveVT;
+ pScrn->FreeScreen = ZZZFreeScreen;
+ pScrn->ValidMode = ZZZValidMode;
+ foundScreen = TRUE;
+ /* add screen to entity */
+ }
+ }
+ xfree(usedChips);
+ }
+
+#ifdef HAS_ISA_DEVS
+ /*
+ * If the driver supports ISA hardware, the following block
+ * can be included too.
+ */
+ numUsed = xf86MatchIsaInstances(ZZZ_NAME, ZZZChipsets,
+ ZZZIsaChipsets, drv, ZZZFindIsaDevice,
+ devSections, numDevSections, &amp;usedChips);
+ for (i = 0; i < numUsed; i++) {
+ ScrnInfoPtr pScrn = NULL;
+ if ((pScrn = xf86ConfigIsaEntity(pScrn, flags, usedChips[i],
+ ZZZIsaChipsets, NULL, NULL, NULL,
+ NULL, NULL))) {
+ pScrn->driverVersion = VERSION;
+ pScrn->driverName = ZZZ_DRIVER_NAME;
+ pScrn->name = ZZZ_NAME;
+ pScrn->Probe = ZZZProbe;
+ pScrn->PreInit = ZZZPreInit;
+ pScrn->ScreenInit = ZZZScreenInit;
+ pScrn->SwitchMode = ZZZSwitchMode;
+ pScrn->AdjustFrame = ZZZAdjustFrame;
+ pScrn->EnterVT = ZZZEnterVT;
+ pScrn->LeaveVT = ZZZLeaveVT;
+ pScrn->FreeScreen = ZZZFreeScreen;
+ pScrn->ValidMode = ZZZValidMode;
+ foundScreen = TRUE;
+ }
+ }
+ xfree(usedChips);
+#endif /* HAS_ISA_DEVS */
+
+ xfree(devSections);
+ return foundScreen;
+ </code>
+
+<sect2>AvailableOptions
+<p>
+
+ Define the &s.code;AvailableOptions()&e.code; function. The purpose
+ of this is to return the available driver options back to the
+ -configure option, so that an XF86Config file can be built and the
+ user can see which options are available for them to use.
+
+<sect2>PreInit
+<p>
+
+ Define the &s.code;PreInit()&e.code; function. The purpose of
+ this is to find all the information required to determine if the
+ configuration is usable, and to initialise those parts of the
+ &s.code;ScrnInfoRec&e.code; that can be set once at the beginning
+ of the first server generation. The information should be found in
+ the least intrusive way possible.
+
+ This function is mandatory.
+
+ NOTES:
+ <enum>
+ <item>The &s.code;PreInit()&e.code; function is only called once
+ during the life of the X server (at the start of the first
+ generation).
+
+ <item>Data allocated here must be of the type that persists for
+ the life of the X server. This means that data that hooks into
+ the &s.code;ScrnInfoRec&e.code;'s &s.code;privates&e.code;
+ field should be allocated here, but data that hooks into the
+ &s.code;ScreenRec&e.code;'s &s.code;devPrivates&e.code; field
+ should not be allocated here. The &s.code;driverPrivate&e.code;
+ field should also be allocated here.
+
+ <item>Although the &s.code;ScrnInfoRec&e.code; has been allocated
+ before this function is called, the &s.code;ScreenRec&e.code;
+ has not been allocated. That means that things requiring it
+ cannot be used in this function.
+
+ <item>Very little of the &s.code;ScrnInfoRec&e.code; has been
+ initialised when this function is called. It is important to
+ get the order of doing things right in this function.
+
+ </enum>
+
+ <code>
+static Bool
+ZZZPreInit(ScrnInfoPtr pScrn, int flags)
+{
+ /* Fill in the monitor field */
+ pScrn->monitor = pScrn->confScreen->monitor;
+
+ /*
+ * If using the vgahw module, it will typically be loaded
+ * here by calling xf86LoadSubModule(pScrn, "vgahw");
+ */
+
+ /*
+ * Set the depth/bpp. Our preferred default depth/bpp is 8, and
+ * we support both 24bpp and 32bpp framebuffer layouts.
+ * This sets pScrn->display also.
+ */
+ if (!xf86SetDepthBpp(pScrn, 8, 8, 8,
+ Support24bppFb | Support32bppFb)) {
+ return FALSE;
+ } else {
+ if (depth/bpp isn't one we support) {
+ print error message;
+ return FALSE;
+ }
+ }
+ /* Print out the depth/bpp that was set */
+ xf86PrintDepthBpp(pScrn);
+
+ /* Set bits per RGB for 8bpp */
+ if (pScrn->depth <= 8) {
+ /* Take into account a dac_6_bit option here */
+ pScrn->rgbBits = 6 or 8;
+ }
+
+ /*
+ * xf86SetWeight() and xf86SetDefaultVisual() must be called
+ * after pScrn->display is initialised.
+ */
+
+ /* Set weight/mask/offset for depth > 8 */
+ if (pScrn->depth > 8) {
+ if (!xf86SetWeight(pScrn, defaultWeight, defaultMask)) {
+ return FALSE;
+ } else {
+ if (weight isn't one we support) {
+ print error message;
+ return FALSE;
+ }
+ }
+ }
+
+ /* Set the default visual. */
+ if (!xf86SetDefaultVisual(pScrn, -1)) {
+ return FALSE;
+ } else {
+ if (visual isn't one we support) {
+ print error message;
+ return FALSE;
+ }
+ }
+
+ /* If the driver supports gamma correction, set the gamma. */
+ if (!xf86SetGamma(pScrn, default_gamma)) {
+ return FALSE;
+ }
+
+ /* This driver uses a programmable clock */
+ pScrn->progClock = TRUE;
+
+ /* Allocate the ZZZRec driverPrivate */
+ if (!ZZZGetRec(pScrn)) {
+ return FALSE;
+ }
+
+ pZzz = ZZZPTR(pScrn);
+
+ /* Collect all of the option flags (fill in pScrn->options) */
+ xf86CollectOptions(pScrn, NULL);
+
+ /*
+ * Process the options based on the information in ZZZOptions.
+ * The results are written to pZzz->Options. If all of the options
+ * processing is done within this function a local variable "options"
+ * can be used instead of pZzz->Options.
+ */
+ if (!(pZzz->Options = xalloc(sizeof(ZZZOptions))))
+ return FALSE;
+ (void)memcpy(pZzz->Options, ZZZOptions, sizeof(ZZZOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pZzz->Options);
+
+ /*
+ * Set various fields of ScrnInfoRec and/or ZZZRec based on
+ * the options found.
+ */
+ from = X_DEFAULT;
+ pZzz->hwCursor = FALSE;
+ if (xf86IsOptionSet(pZzz->Options, OPTION_HW_CURSOR)) {
+ from = X_CONFIG;
+ pZzz->hwCursor = TRUE;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n",
+ pZzz->hwCursor ? "HW" : "SW");
+ if (xf86IsOptionSet(pZzz->Options, OPTION_NOACCEL)) {
+ pZzz->noAccel = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
+ "Acceleration disabled\n");
+ } else {
+ pZzz->noAccel = FALSE;
+ }
+ if (xf86IsOptionSet(pZzz->Options, OPTION_PCI_RETRY)) {
+ pZzz->UsePCIRetry = TRUE;
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n");
+ }
+ pZzz->fooHack = 0;
+ if (xf86GetOptValInteger(pZzz->Options, OPTION_FOO_HACK,
+ &amp;pZzz->fooHack)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Foo Hack set to %d\n",
+ pZzz->fooHack);
+ }
+
+ /*
+ * Find the PCI slot(s) that this screen claimed in the probe.
+ * In this case, exactly one is expected, so complain otherwise.
+ * Note in this case we're not interested in the card types so
+ * that parameter is set to NULL.
+ */
+ if ((i = xf86GetPciInfoForScreen(pScrn->scrnIndex, &amp;pciList, NULL))
+ != 1) {
+ print error message;
+ ZZZFreeRec(pScrn);
+ if (i > 0)
+ xfree(pciList);
+ return FALSE;
+ }
+ /* Note that pciList should be freed below when no longer needed */
+
+ /*
+ * Determine the chipset, allowing config file chipset and
+ * chipid values to override the probed information. The config
+ * chipset value has precedence over its chipid value if both
+ * are present.
+ *
+ * It isn't necessary to fill in pScrn->chipset if the driver
+ * keeps track of the chipset in its ZZZRec.
+ */
+
+ ...
+
+ /*
+ * Determine video memory, fb base address, I/O addresses, etc,
+ * allowing the config file to override probed values.
+ *
+ * Set the appropriate pScrn fields (videoRam is probably the
+ * most important one that other code might require), and
+ * print out the settings.
+ */
+
+ ...
+
+ /* Initialise a clockRanges list. */
+
+ ...
+
+ /* Set any other chipset specific things in the ZZZRec */
+
+ ...
+
+ /* Select valid modes from those available */
+
+ i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
+ pScrn->display->modes, clockRanges,
+ NULL, minPitch, maxPitch, rounding,
+ minHeight, maxHeight,
+ pScrn->display->virtualX,
+ pScrn->display->virtualY,
+ pScrn->videoRam * 1024,
+ LOOKUP_BEST_REFRESH);
+ if (i == -1) {
+ ZZZFreeRec(pScrn);
+ return FALSE;
+ }
+
+ /* Prune the modes marked as invalid */
+
+ xf86PruneDriverModes(pScrn);
+
+ /* If no valid modes, return */
+
+ if (i == 0 || pScrn->modes == NULL) {
+ print error message;
+ ZZZFreeRec(pScrn);
+ return FALSE;
+ }
+
+ /*
+ * Initialise the CRTC fields for the modes. This driver expects
+ * vertical values to be halved for interlaced modes.
+ */
+ xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V);
+
+ /* Set the current mode to the first in the list. */
+ pScrn->currentMode = pScrn->modes;
+
+ /* Print the list of modes being used. */
+ xf86PrintModes(pScrn);
+
+ /* Set the DPI */
+ xf86SetDpi(pScrn, 0, 0);
+
+ /* Load bpp-specific modules */
+ switch (pScrn->bitsPerPixel) {
+ case 1:
+ mod = "xf1bpp";
+ break;
+ case 4:
+ mod = "xf4bpp";
+ break;
+ case 8:
+ mod = "cfb";
+ break;
+ case 16:
+ mod = "cfb16";
+ break;
+ case 24:
+ mod = "cfb24";
+ break;
+ case 32:
+ mod = "cfb32";
+ break;
+ }
+ if (mod && !xf86LoadSubModule(pScrn, mod))
+ ZZZFreeRec(pScrn);
+ return FALSE;
+
+ /* Load XAA if needed */
+ if (!pZzz->noAccel || pZzz->hwCursor)
+ if (!xf86LoadSubModule(pScrn, "xaa")) {
+ ZZZFreeRec(pScrn);
+ return FALSE;
+ }
+
+ /* Done */
+ return TRUE;
+}
+ </code>
+
+<sect2>MapMem, UnmapMem
+<p>
+
+ Define functions to map and unmap the video memory and any other
+ memory apertures required. These functions are not mandatory, but
+ it is often useful to have such functions.
+
+ <code>
+static Bool
+ZZZMapMem(ScrnInfoPtr pScrn)
+{
+ /* Call xf86MapPciMem() to map each PCI memory area */
+ ...
+ return TRUE or FALSE;
+}
+
+static Bool
+ZZZUnmapMem(ScrnInfoPtr pScrn)
+{
+ /* Call xf86UnMapVidMem() to unmap each memory area */
+ ...
+ return TRUE or FALSE;
+}
+ </code>
+
+<sect2>Save, Restore
+<p>
+
+ Define functions to save and restore the original video state. These
+ functions are not mandatory, but are often useful.
+
+ <code>
+static void
+ZZZSave(ScrnInfoPtr pScrn)
+{
+ /*
+ * Save state into per-screen data structures.
+ * If using the vgahw module, vgaHWSave will typically be
+ * called here.
+ */
+ ...
+}
+
+static void
+ZZZRestore(ScrnInfoPtr pScrn)
+{
+ /*
+ * Restore state from per-screen data structures.
+ * If using the vgahw module, vgaHWRestore will typically be
+ * called here.
+ */
+ ...
+}
+ </code>
+
+<sect2>ModeInit
+<p>
+
+ Define a function to initialise a new video mode. This function isn't
+ mandatory, but is often useful.
+
+ <code>
+static Bool
+ZZZModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
+{
+ /*
+ * Program a video mode. If using the vgahw module,
+ * vgaHWInit and vgaRestore will typically be called here.
+ * Once up to the point where there can't be a failure
+ * set pScrn->vtSema to TRUE.
+ */
+ ...
+}
+ </code>
+
+<sect2>ScreenInit
+<p>
+
+ Define the &s.code;ScreenInit()&e.code; function. This is called
+ at the start of each server generation, and should fill in as much
+ of the &s.code;ScreenRec&e.code; as possible as well as any other
+ data that is initialised once per generation. It should initialise
+ the framebuffer layers it is using, and initialise the initial video
+ mode.
+
+ This function is mandatory.
+
+ NOTE: The &s.code;ScreenRec&e.code; (&s.code;pScreen&e.code;) is
+ passed to this driver, but it and the
+ &s.code;ScrnInfoRecs&e.code; are not yet hooked into each
+ other. This means that in this function, and functions it
+ calls, one cannot be found from the other.
+
+ <code>
+static Bool
+ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+{
+ /* Get the ScrnInfoRec */
+ pScrn = xf86Screens[pScreen->myNum];
+
+ /*
+ * If using the vgahw module, its data structures and related
+ * things are typically initialised/mapped here.
+ */
+
+ /* Save the current video state */
+ ZZZSave(pScrn);
+
+ /* Initialise the first mode */
+ ZZZModeInit(pScrn, pScrn->currentMode);
+
+ /* Set the viewport if supported */
+
+ ZZZAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+
+ /*
+ * Setup the screen's visuals, and initialise the framebuffer
+ * code.
+ */
+
+ /* Reset the visual list */
+ miClearVisualTypes();
+
+ /*
+ * Setup the visuals supported. This driver only supports
+ * TrueColor for bpp > 8, so the default set of visuals isn't
+ * acceptable. To deal with this, call miSetVisualTypes with
+ * the appropriate visual mask.
+ */
+
+ if (pScrn->bitsPerPixel > 8) {
+ if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
+ pScrn->rgbBits, pScrn->defaultVisual))
+ return FALSE;
+ } else {
+ if (!miSetVisualTypes(pScrn->depth,
+ miGetDefaultVisualMask(pScrn->depth),
+ pScrn->rgbBits, pScrn->defaultVisual))
+ return FALSE;
+ }
+
+ /*
+ * Initialise the framebuffer.
+ */
+
+ switch (pScrn->bitsPerPixel) {
+ case 1:
+ ret = xf1bppScreenInit(pScreen, FbBase,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth);
+ break;
+ case 4:
+ ret = xf4bppScreenInit(pScreen, FbBase,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth);
+ break;
+ case 8:
+ ret = cfbScreenInit(pScreen, FbBase,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth);
+ break;
+ case 16:
+ ret = cfb16ScreenInit(pScreen, FbBase,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth);
+ break;
+ case 24:
+ ret = cfb24ScreenInit(pScreen, FbBase,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth);
+ break;
+ case 32:
+ ret = cfb32ScreenInit(pScreen, FbBase,
+ pScrn->virtualX, pScrn->virtualY,
+ pScrn->xDpi, pScrn->yDpi,
+ pScrn->displayWidth);
+ break;
+ default:
+ print a message about an internal error;
+ ret = FALSE;
+ break;
+ }
+
+ if (!ret)
+ return FALSE;
+
+ /* Override the default mask/offset settings */
+ if (pScrn->bitsPerPixel > 8) {
+ for (i = 0, visual = pScreen->visuals;
+ i < pScreen->numVisuals; i++, visual++) {
+ if ((visual->class | DynamicClass) == DirectColor) {
+ visual->offsetRed = pScrn->offset.red;
+ visual->offsetGreen = pScrn->offset.green;
+ visual->offsetBlue = pScrn->offset.blue;
+ visual->redMask = pScrn->mask.red;
+ visual->greenMask = pScrn->mask.green;
+ visual->blueMask = pScrn->mask.blue;
+ }
+ }
+ }
+
+ /*
+ * If banking is needed, initialise an miBankInfoRec (defined in
+ * "mibank.h"), and call miInitializeBanking().
+ */
+ if (!miInitializeBanking(pScreen, pScrn->virtualX, pScrn->virtualY,
+ pScrn->displayWidth, pBankInfo))
+ return FALSE;
+
+ /*
+ * If backing store is to be supported (as is usually the case),
+ * initialise it.
+ */
+ miInitializeBackingStore(pScreen);
+
+ /*
+ * Set initial black & white colourmap indices.
+ */
+ xf86SetBlackWhitePixels(pScreen);
+
+ /*
+ * Install colourmap functions. If using the vgahw module,
+ * vgaHandleColormaps would usually be called here.
+ */
+
+ ...
+
+ /*
+ * Initialise cursor functions. This example is for the mi
+ * software cursor.
+ */
+ miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
+
+ /* Initialise the default colourmap */
+ switch (pScrn->depth) {
+ case 1:
+ if (!xf1bppCreateDefColormap(pScreen))
+ return FALSE;
+ break;
+ case 4:
+ if (!xf4bppCreateDefColormap(pScreen))
+ return FALSE;
+ break;
+ default:
+ if (!cfbCreateDefColormap(pScreen))
+ return FALSE;
+ break;
+ }
+
+ /*
+ * Wrap the CloseScreen vector and set SaveScreen.
+ */
+ ZZZPTR(pScrn)->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = ZZZCloseScreen;
+ pScreen->SaveScreen = ZZZSaveScreen;
+
+ /* Report any unused options (only for the first generation) */
+ if (serverGeneration == 1) {
+ xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
+ }
+
+ /* Done */
+ return TRUE;
+}
+ </code>
+
+
+<sect2>SwitchMode
+<p>
+
+ Define the &s.code;SwitchMode()&e.code; function if mode switching
+ is supported by the driver.
+
+ <code>
+static Bool
+ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+{
+ return ZZZModeInit(xf86Screens[scrnIndex], mode);
+}
+ </code>
+
+
+<sect2>AdjustFrame
+<p>
+
+ Define the &s.code;AdjustFrame()&e.code; function if the driver
+ supports this.
+
+ <code>
+static void
+ZZZAdjustFrame(int scrnIndex, int x, int y, int flags)
+{
+ /* Adjust the viewport */
+}
+ </code>
+
+
+<sect2>EnterVT, LeaveVT
+<p>
+
+ Define the &s.code;EnterVT()&e.code; and &s.code;LeaveVT()&e.code;
+ functions.
+
+ These functions are mandatory.
+
+ <code>
+static Bool
+ZZZEnterVT(int scrnIndex, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ return ZZZModeInit(pScrn, pScrn->currentMode);
+}
+
+static void
+ZZZLeaveVT(int scrnIndex, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ ZZZRestore(pScrn);
+}
+ </code>
+
+<sect2>CloseScreen
+<p>
+
+ Define the &s.code;CloseScreen()&e.code; function:
+
+ This function is mandatory. Note that it unwraps the previously
+ wrapped &s.code;pScreen-&gt;CloseScreen&e.code;, and finishes by
+ calling it.
+
+ <code>
+static Bool
+ZZZCloseScreen(int scrnIndex, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ if (pScrn->vtSema) {
+ ZZZRestore(pScrn);
+ ZZZUnmapMem(pScrn);
+ }
+ pScrn->vtSema = FALSE;
+ pScreen->CloseScreen = ZZZPTR(pScrn)->CloseScreen;
+ return (*pScreen->CloseScreen)(scrnIndex, pScreen);
+}
+ </code>
+
+<sect2>SaveScreen
+<p>
+
+ Define the &s.code;SaveScreen()&e.code; function (the screen
+ blanking function). When using the vgahw module, this will typically
+ be:
+
+ <code>
+static Bool
+ZZZSaveScreen(ScreenPtr pScreen, int mode)
+{
+ return vgaHWSaveScreen(pScreen, mode);
+}
+ </code>
+
+ This function is mandatory. Before modifying any hardware register
+ directly this function needs to make sure that the Xserver is active
+ by checking if &s.code;pScrn&e.code; is non-NULL and for
+ &s.code;pScrn->vtSema == TRUE&e.code;.
+
+<sect2>FreeScreen
+<p>
+
+ Define the &s.code;FreeScreen()&e.code; function. This function
+ is optional. It should be defined if the &s.code;ScrnInfoRec&e.code;
+ &s.code;driverPrivate&e.code; field is used so that it can be freed
+ when a screen is deleted by the common layer for reasons possibly
+ beyond the driver's control. This function is not used in during
+ normal (error free) operation. The per-generation data is freed by
+ the &s.code;CloseScreen()&e.code; function.
+
+ <code>
+static void
+ZZZFreeScreen(int scrnIndex, int flags)
+{
+ /*
+ * If the vgahw module is used vgaHWFreeHWRec() would be called
+ * here.
+ */
+ ZZZFreeRec(xf86Screens[scrnIndex]);
+}
+ </code>
+
+
+</article>
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
new file mode 100644
index 000000000..b08379099
--- /dev/null
+++ b/hw/xfree86/dri/dri.c
@@ -0,0 +1,2117 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.38 2002/11/20 18:10:24 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, 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 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:
+ * Jens Owen <jens@tungstengraphics.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifdef XFree86LOADER
+#include "xf86.h"
+#include "xf86_ansic.h"
+#else
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include "X.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "servermd.h"
+#define _XF86DRI_SERVER_
+#include "xf86dristr.h"
+#include "swaprep.h"
+#include "dri.h"
+#include "sarea.h"
+#include "dristruct.h"
+#include "xf86.h"
+#include "xf86drm.h"
+#include "glxserver.h"
+#include "mi.h"
+#include "mipointer.h"
+
+#if defined(XFree86LOADER) && !defined(PANORAMIX)
+extern Bool noPanoramiXExtension;
+#endif
+
+static int DRIScreenPrivIndex = -1;
+static int DRIWindowPrivIndex = -1;
+static unsigned long DRIGeneration = 0;
+static unsigned int DRIDrawableValidationStamp = 0;
+static int lockRefCount=0;
+
+ /* Support cleanup for fullscreen mode,
+ independent of the DRICreateDrawable
+ resource management. */
+static Bool _DRICloseFullScreen(pointer pResource, XID id);
+static RESTYPE DRIFullScreenResType;
+
+static RESTYPE DRIDrawablePrivResType;
+static RESTYPE DRIContextPrivResType;
+static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv);
+
+ /* Wrapper just like xf86DrvMsg, but
+ without the verbosity level checking.
+ This will make it easy to turn off some
+ messages later, based on verbosity
+ level. */
+
+/*
+ * Since we're already referencing things from the XFree86 common layer in
+ * this file, we'd might as well just call xf86VDrvMsgVerb, and have
+ * consistent message formatting. The verbosity of these messages can be
+ * easily changed here.
+ */
+#define DRI_MSG_VERBOSITY 1
+static void
+DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VDrvMsgVerb(scrnIndex, type, DRI_MSG_VERBOSITY, format, ap);
+ va_end(ap);
+}
+
+Bool
+DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
+{
+ DRIScreenPrivPtr pDRIPriv;
+ drmContextPtr reserved;
+ int reserved_count;
+ int i, fd, drmWasAvailable;
+ Bool xineramaInCore = FALSE;
+ int err = 0;
+
+ if (DRIGeneration != serverGeneration) {
+ if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ DRIGeneration = serverGeneration;
+ }
+
+ /*
+ * If Xinerama is on, don't allow DRI to initialise. It won't be usable
+ * anyway.
+ */
+#if defined(PANORAMIX) && !defined(XFree86LOADER)
+ xineramaInCore = TRUE;
+#elif defined(XFree86LOADER)
+ if (xf86LoaderCheckSymbol("noPanoramiXExtension"))
+ xineramaInCore = TRUE;
+#endif
+
+#if defined(PANORAMIX) || defined(XFree86LOADER)
+ if (xineramaInCore) {
+ if (!noPanoramiXExtension) {
+ DRIDrvMsg(pScreen->myNum, X_WARNING,
+ "Direct rendering is not supported when Xinerama is enabled\n");
+ return FALSE;
+ }
+ }
+#endif
+
+ drmWasAvailable = drmAvailable();
+
+ /* Note that drmOpen will try to load the kernel module, if needed. */
+ fd = drmOpen(pDRIInfo->drmDriverName, NULL );
+ if (fd < 0) {
+ /* failed to open DRM */
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmOpen failed\n");
+ return FALSE;
+ }
+
+ if (!drmWasAvailable) {
+ /* drmOpen loaded the kernel module, print a message to say so */
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] loaded kernel module for \"%s\" driver\n",
+ pDRIInfo->drmDriverName);
+ }
+
+ pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec));
+ if (!pDRIPriv) {
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ return FALSE;
+ }
+
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv;
+ pDRIPriv->drmFD = fd;
+ pDRIPriv->directRenderingSupport = TRUE;
+ pDRIPriv->pDriverInfo = pDRIInfo;
+ pDRIPriv->nrWindows = 0;
+ pDRIPriv->fullscreen = NULL;
+
+ pDRIPriv->createDummyCtx = pDRIInfo->createDummyCtx;
+ pDRIPriv->createDummyCtxPriv = pDRIInfo->createDummyCtxPriv;
+
+ pDRIPriv->grabbedDRILock = FALSE;
+ pDRIPriv->drmSIGIOHandlerInstalled = FALSE;
+
+ if ((err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString)) < 0) {
+ pDRIPriv->directRenderingSupport = FALSE;
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ drmClose(pDRIPriv->drmFD);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmSetBusid failed (%d, %s), %s\n",
+ pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString, strerror(-err));
+ return FALSE;
+ }
+
+ *pDRMFD = pDRIPriv->drmFD;
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] created \"%s\" driver at busid \"%s\"\n",
+ pDRIPriv->pDriverInfo->drmDriverName,
+ pDRIPriv->pDriverInfo->busIdString);
+
+ if (drmAddMap( pDRIPriv->drmFD,
+ 0,
+ pDRIPriv->pDriverInfo->SAREASize,
+ DRM_SHM,
+ DRM_CONTAINS_LOCK,
+ &pDRIPriv->hSAREA) < 0)
+ {
+ pDRIPriv->directRenderingSupport = FALSE;
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ drmClose(pDRIPriv->drmFD);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmAddMap failed\n");
+ return FALSE;
+ }
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] added %d byte SAREA at 0x%08lx\n",
+ pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA);
+
+ if (drmMap( pDRIPriv->drmFD,
+ pDRIPriv->hSAREA,
+ pDRIPriv->pDriverInfo->SAREASize,
+ (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0)
+ {
+ pDRIPriv->directRenderingSupport = FALSE;
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ drmClose(pDRIPriv->drmFD);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmMap failed\n");
+ return FALSE;
+ }
+ memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize);
+ DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA 0x%08lx to %p\n",
+ pDRIPriv->hSAREA, pDRIPriv->pSAREA);
+
+ if (drmAddMap( pDRIPriv->drmFD,
+ (drmHandle)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress,
+ pDRIPriv->pDriverInfo->frameBufferSize,
+ DRM_FRAME_BUFFER,
+ 0,
+ &pDRIPriv->hFrameBuffer) < 0)
+ {
+ pDRIPriv->directRenderingSupport = FALSE;
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ drmUnmap(pDRIPriv->pSAREA, pDRIPriv->pDriverInfo->SAREASize);
+ drmClose(pDRIPriv->drmFD);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] drmAddMap failed\n");
+ return FALSE;
+ }
+ DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = 0x%08lx\n",
+ pDRIPriv->hFrameBuffer);
+
+ /* Add tags for reserved contexts */
+ if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD,
+ &reserved_count))) {
+ int i;
+ void *tag;
+
+ for (i = 0; i < reserved_count; i++) {
+ tag = DRICreateContextPrivFromHandle(pScreen,
+ reserved[i],
+ DRI_CONTEXT_RESERVED);
+ drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag);
+ }
+ drmFreeReservedContextList(reserved);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] added %d reserved context%s for kernel\n",
+ reserved_count, reserved_count > 1 ? "s" : "");
+ }
+
+ /* validate max drawable table entry set by driver */
+ if ((pDRIPriv->pDriverInfo->maxDrawableTableEntry <= 0) ||
+ (pDRIPriv->pDriverInfo->maxDrawableTableEntry > SAREA_MAX_DRAWABLES)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "Invalid max drawable table size set by driver: %d\n",
+ pDRIPriv->pDriverInfo->maxDrawableTableEntry);
+ }
+
+ /* Initialize drawable tables (screen private and SAREA) */
+ for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) {
+ pDRIPriv->DRIDrawables[i] = NULL;
+ pDRIPriv->pSAREA->drawableTable[i].stamp = 0;
+ pDRIPriv->pSAREA->drawableTable[i].flags = 0;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIFinishScreenInit(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+ DRIContextFlags flags = 0;
+ DRIContextPrivPtr pDRIContextPriv;
+
+ /* Set up flags for DRICreateContextPriv */
+ switch (pDRIInfo->driverSwapMethod) {
+ case DRI_KERNEL_SWAP: flags = DRI_CONTEXT_2DONLY; break;
+ case DRI_HIDE_X_CONTEXT: flags = DRI_CONTEXT_PRESERVED; break;
+ }
+
+ if (!(pDRIContextPriv = DRICreateContextPriv(pScreen,
+ &pDRIPriv->myContext,
+ flags))) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "failed to create server context\n");
+ return FALSE;
+ }
+ pDRIPriv->myContextPriv = pDRIContextPriv;
+
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "X context handle = 0x%08lx\n", pDRIPriv->myContext);
+
+ /* Now that we have created the X server's context, we can grab the
+ * hardware lock for the X server.
+ */
+ DRILock(pScreen, 0);
+ pDRIPriv->grabbedDRILock = TRUE;
+
+ /* pointers so that we can prevent memory leaks later */
+ pDRIPriv->hiddenContextStore = NULL;
+ pDRIPriv->partial3DContextStore = NULL;
+
+ switch(pDRIInfo->driverSwapMethod) {
+ case DRI_HIDE_X_CONTEXT:
+ /* Server will handle 3D swaps, and hide 2D swaps from kernel.
+ * Register server context as a preserved context.
+ */
+
+ /* allocate memory for hidden context store */
+ pDRIPriv->hiddenContextStore
+ = (void *)xcalloc(1, pDRIInfo->contextSize);
+ if (!pDRIPriv->hiddenContextStore) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "failed to allocate hidden context\n");
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ }
+
+ /* allocate memory for partial 3D context store */
+ pDRIPriv->partial3DContextStore
+ = (void *)xcalloc(1, pDRIInfo->contextSize);
+ if (!pDRIPriv->partial3DContextStore) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI] failed to allocate partial 3D context\n");
+ xfree(pDRIPriv->hiddenContextStore);
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ }
+
+ /* save initial context store */
+ if (pDRIInfo->SwapContext) {
+ (*pDRIInfo->SwapContext)(
+ pScreen,
+ DRI_NO_SYNC,
+ DRI_2D_CONTEXT,
+ pDRIPriv->hiddenContextStore,
+ DRI_NO_CONTEXT,
+ NULL);
+ }
+ /* fall through */
+
+ case DRI_SERVER_SWAP:
+ /* For swap methods of DRI_SERVER_SWAP and DRI_HIDE_X_CONTEXT
+ * setup signal handler for receiving swap requests from kernel
+ */
+ if (!(pDRIPriv->drmSIGIOHandlerInstalled =
+ drmInstallSIGIOHandler(pDRIPriv->drmFD, DRISwapContext))) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] failed to setup DRM signal handler\n");
+ if (pDRIPriv->hiddenContextStore)
+ xfree(pDRIPriv->hiddenContextStore);
+ if (pDRIPriv->partial3DContextStore)
+ xfree(pDRIPriv->partial3DContextStore);
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ } else {
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] installed DRM signal handler\n");
+ }
+
+ default:
+ break;
+ }
+
+ /* Wrap DRI support */
+ if (pDRIInfo->wrap.ValidateTree) {
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = pDRIInfo->wrap.ValidateTree;
+ }
+ if (pDRIInfo->wrap.PostValidateTree) {
+ pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = pDRIInfo->wrap.PostValidateTree;
+ }
+ if (pDRIInfo->wrap.WindowExposures) {
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures;
+ }
+ if (pDRIInfo->wrap.CopyWindow) {
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow;
+ }
+ if (pDRIInfo->wrap.ClipNotify) {
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify;
+ }
+ if (pDRIInfo->wrap.AdjustFrame) {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
+ pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame;
+ }
+ pDRIPriv->wrapped = TRUE;
+
+ DRIDrvMsg(pScreen->myNum, X_INFO, "[DRI] installation complete\n");
+
+ return TRUE;
+}
+
+void
+DRICloseScreen(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo;
+ drmContextPtr reserved;
+ int reserved_count;
+
+ if (pDRIPriv && pDRIPriv->directRenderingSupport) {
+
+ pDRIInfo = pDRIPriv->pDriverInfo;
+
+ if (pDRIPriv->wrapped) {
+ /* Unwrap DRI Functions */
+ if (pDRIInfo->wrap.ValidateTree) {
+ pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
+ pDRIPriv->wrap.ValidateTree = NULL;
+ }
+ if (pDRIInfo->wrap.PostValidateTree) {
+ pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
+ pDRIPriv->wrap.PostValidateTree = NULL;
+ }
+ if (pDRIInfo->wrap.WindowExposures) {
+ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+ pDRIPriv->wrap.WindowExposures = NULL;
+ }
+ if (pDRIInfo->wrap.CopyWindow) {
+ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+ pDRIPriv->wrap.CopyWindow = NULL;
+ }
+ if (pDRIInfo->wrap.ClipNotify) {
+ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+ pDRIPriv->wrap.ClipNotify = NULL;
+ }
+ if (pDRIInfo->wrap.AdjustFrame) {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
+ pDRIPriv->wrap.AdjustFrame = NULL;
+ }
+ pDRIPriv->wrapped = FALSE;
+ }
+
+ if (pDRIPriv->drmSIGIOHandlerInstalled) {
+ if (!drmRemoveSIGIOHandler(pDRIPriv->drmFD)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] failed to remove DRM signal handler\n");
+ }
+ }
+
+ if (pDRIPriv->dummyCtxPriv && pDRIPriv->createDummyCtx) {
+ DRIDestroyDummyContext(pScreen, pDRIPriv->createDummyCtxPriv);
+ }
+
+ if (!DRIDestroyContextPriv(pDRIPriv->myContextPriv)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "failed to destroy server context\n");
+ }
+
+ /* Remove tags for reserved contexts */
+ if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD,
+ &reserved_count))) {
+ int i;
+
+ for (i = 0; i < reserved_count; i++) {
+ DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD,
+ reserved[i]));
+ }
+ drmFreeReservedContextList(reserved);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] removed %d reserved context%s for kernel\n",
+ reserved_count, reserved_count > 1 ? "s" : "");
+ }
+
+ /* Make sure signals get unblocked etc. */
+ drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext);
+ lockRefCount=0;
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] unmapping %d bytes of SAREA 0x%08lx at %p\n",
+ pDRIInfo->SAREASize,
+ pDRIPriv->hSAREA,
+ pDRIPriv->pSAREA);
+ if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] unable to unmap %d bytes"
+ " of SAREA 0x%08lx at %p\n",
+ pDRIInfo->SAREASize,
+ pDRIPriv->hSAREA,
+ pDRIPriv->pSAREA);
+ }
+
+ drmClose(pDRIPriv->drmFD);
+
+ xfree(pDRIPriv);
+ pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL;
+ }
+}
+
+Bool
+DRIExtensionInit(void)
+{
+ int i;
+ ScreenPtr pScreen;
+
+ if (DRIScreenPrivIndex < 0) {
+ return FALSE;
+ }
+
+ /* Allocate a window private index with a zero sized private area for
+ * each window, then should a window become a DRI window, we'll hang
+ * a DRIWindowPrivateRec off of this private index.
+ */
+ if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0)
+ return FALSE;
+
+ DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);
+ DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete);
+ DRIFullScreenResType = CreateNewResourceType(_DRICloseFullScreen);
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ {
+ pScreen = screenInfo.screens[i];
+ if (!AllocateWindowPrivate(pScreen, DRIWindowPrivIndex, 0))
+ return FALSE;
+ }
+
+ RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL);
+
+ return TRUE;
+}
+
+void
+DRIReset(void)
+{
+ /*
+ * This stub routine is called when the X Server recycles, resources
+ * allocated by DRIExtensionInit need to be managed here.
+ *
+ * Currently this routine is a stub because all the interesting resources
+ * are managed via the screen init process.
+ */
+}
+
+Bool
+DRIQueryDirectRenderingCapable(ScreenPtr pScreen, Bool* isCapable)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv)
+ *isCapable = pDRIPriv->directRenderingSupport;
+ else
+ *isCapable = FALSE;
+
+ return TRUE;
+}
+
+Bool
+DRIOpenConnection(ScreenPtr pScreen, drmHandlePtr hSAREA, char **busIdString)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ *hSAREA = pDRIPriv->hSAREA;
+ *busIdString = pDRIPriv->pDriverInfo->busIdString;
+
+ return TRUE;
+}
+
+Bool
+DRIAuthConnection(ScreenPtr pScreen, drmMagic magic)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (drmAuthMagic(pDRIPriv->drmFD, magic)) return FALSE;
+ return TRUE;
+}
+
+Bool
+DRICloseConnection(ScreenPtr pScreen)
+{
+ return TRUE;
+}
+
+Bool
+DRIGetClientDriverName(ScreenPtr pScreen,
+ int *ddxDriverMajorVersion,
+ int *ddxDriverMinorVersion,
+ int *ddxDriverPatchVersion,
+ char **clientDriverName)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ *ddxDriverMajorVersion = pDRIPriv->pDriverInfo->ddxDriverMajorVersion;
+ *ddxDriverMinorVersion = pDRIPriv->pDriverInfo->ddxDriverMinorVersion;
+ *ddxDriverPatchVersion = pDRIPriv->pDriverInfo->ddxDriverPatchVersion;
+ *clientDriverName = pDRIPriv->pDriverInfo->clientDriverName;
+
+ return TRUE;
+}
+
+/* DRICreateContextPriv and DRICreateContextPrivFromHandle are helper
+ functions that layer on drmCreateContext and drmAddContextTag.
+
+ DRICreateContextPriv always creates a kernel drmContext and then calls
+ DRICreateContextPrivFromHandle to create a DRIContextPriv structure for
+ DRI tracking. For the SIGIO handler, the drmContext is associated with
+ DRIContextPrivPtr. Any special flags are stored in the DRIContextPriv
+ area and are passed to the kernel (if necessary).
+
+ DRICreateContextPriv returns a pointer to newly allocated
+ DRIContextPriv, and returns the kernel drmContext in pHWContext. */
+
+DRIContextPrivPtr
+DRICreateContextPriv(ScreenPtr pScreen,
+ drmContextPtr pHWContext,
+ DRIContextFlags flags)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (drmCreateContext(pDRIPriv->drmFD, pHWContext)) {
+ return NULL;
+ }
+
+ return DRICreateContextPrivFromHandle(pScreen, *pHWContext, flags);
+}
+
+DRIContextPrivPtr
+DRICreateContextPrivFromHandle(ScreenPtr pScreen,
+ drmContext hHWContext,
+ DRIContextFlags flags)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIContextPrivPtr pDRIContextPriv;
+ int contextPrivSize;
+
+ contextPrivSize = sizeof(DRIContextPrivRec) +
+ pDRIPriv->pDriverInfo->contextSize;
+ if (!(pDRIContextPriv = xcalloc(1, contextPrivSize))) {
+ return NULL;
+ }
+ pDRIContextPriv->pContextStore = (void *)(pDRIContextPriv + 1);
+
+ drmAddContextTag(pDRIPriv->drmFD, hHWContext, pDRIContextPriv);
+
+ pDRIContextPriv->hwContext = hHWContext;
+ pDRIContextPriv->pScreen = pScreen;
+ pDRIContextPriv->flags = flags;
+ pDRIContextPriv->valid3D = FALSE;
+
+ if (flags & DRI_CONTEXT_2DONLY) {
+ if (drmSetContextFlags(pDRIPriv->drmFD,
+ hHWContext,
+ DRM_CONTEXT_2DONLY)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] failed to set 2D context flag\n");
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return NULL;
+ }
+ }
+ if (flags & DRI_CONTEXT_PRESERVED) {
+ if (drmSetContextFlags(pDRIPriv->drmFD,
+ hHWContext,
+ DRM_CONTEXT_PRESERVED)) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[drm] failed to set preserved flag\n");
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return NULL;
+ }
+ }
+ return pDRIContextPriv;
+}
+
+Bool
+DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv)
+{
+ DRIScreenPrivPtr pDRIPriv;
+
+ if (!pDRIContextPriv) return TRUE;
+
+ pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen);
+
+ if (!(pDRIContextPriv->flags & DRI_CONTEXT_RESERVED)) {
+ /* Don't delete reserved contexts from
+ kernel area -- the kernel manages its
+ reserved contexts itself. */
+ if (drmDestroyContext(pDRIPriv->drmFD, pDRIContextPriv->hwContext))
+ return FALSE;
+ }
+
+ /* Remove the tag last to prevent a race
+ condition where the context has pending
+ buffers. The context can't be re-used
+ while in this thread, but buffers can be
+ dispatched asynchronously. */
+ drmDelContextTag(pDRIPriv->drmFD, pDRIContextPriv->hwContext);
+ xfree(pDRIContextPriv);
+ return TRUE;
+}
+
+static Bool
+DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ __GLXscreenInfo *pGLXScreen = &__glXActiveScreens[pScreen->myNum];
+ __GLXvisualConfig *pGLXVis = pGLXScreen->pGlxVisual;
+ void **pVisualConfigPriv = pGLXScreen->pVisualPriv;
+ DRIContextPrivPtr pDRIContextPriv;
+ void *contextStore;
+ VisualPtr visual;
+ int visNum;
+
+ visual = pScreen->visuals;
+
+ /* Find the X visual that corresponds the the first GLX visual */
+ for (visNum = 0;
+ visNum < pScreen->numVisuals;
+ visNum++, visual++) {
+ if (pGLXVis->vid == visual->vid)
+ break;
+ }
+ if (visNum == pScreen->numVisuals) return FALSE;
+
+ if (!(pDRIContextPriv =
+ DRICreateContextPriv(pScreen,
+ &pDRIPriv->pSAREA->dummy_context, 0))) {
+ return FALSE;
+ }
+
+ contextStore = DRIGetContextStore(pDRIContextPriv);
+ if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) {
+ if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, visual,
+ pDRIPriv->pSAREA->dummy_context,
+ *pVisualConfigPriv,
+ (DRIContextType)(long)contextStore)) {
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ }
+ }
+
+ pDRIPriv->dummyCtxPriv = pDRIContextPriv;
+ return TRUE;
+}
+
+static void
+DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIContextPrivPtr pDRIContextPriv = pDRIPriv->dummyCtxPriv;
+ void *contextStore;
+
+ if (!pDRIContextPriv) return;
+ if (pDRIPriv->pDriverInfo->DestroyContext && hasCtxPriv) {
+ contextStore = DRIGetContextStore(pDRIContextPriv);
+ pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen,
+ pDRIContextPriv->hwContext,
+ (DRIContextType)(long)contextStore);
+ }
+
+ DRIDestroyContextPriv(pDRIPriv->dummyCtxPriv);
+ pDRIPriv->dummyCtxPriv = NULL;
+}
+
+Bool
+DRICreateContext(ScreenPtr pScreen, VisualPtr visual,
+ XID context, drmContextPtr pHWContext)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ __GLXscreenInfo *pGLXScreen = &__glXActiveScreens[pScreen->myNum];
+ __GLXvisualConfig *pGLXVis = pGLXScreen->pGlxVisual;
+ void **pVisualConfigPriv = pGLXScreen->pVisualPriv;
+ DRIContextPrivPtr pDRIContextPriv;
+ void *contextStore;
+ int visNum;
+
+ if (pDRIPriv->createDummyCtx && !pDRIPriv->dummyCtxPriv) {
+ if (!DRICreateDummyContext(pScreen, pDRIPriv->createDummyCtxPriv)) {
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[drm] Could not create dummy context\n");
+ return FALSE;
+ }
+ }
+
+ /* Find the GLX visual associated with the one requested */
+ for (visNum = 0;
+ visNum < pGLXScreen->numVisuals;
+ visNum++, pGLXVis++, pVisualConfigPriv++)
+ if (pGLXVis->vid == visual->vid)
+ break;
+ if (visNum == pGLXScreen->numVisuals) {
+ /* No matching GLX visual found */
+ return FALSE;
+ }
+
+ if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, pHWContext, 0))) {
+ return FALSE;
+ }
+
+ contextStore = DRIGetContextStore(pDRIContextPriv);
+ if (pDRIPriv->pDriverInfo->CreateContext) {
+ if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, visual,
+ *pHWContext, *pVisualConfigPriv,
+ (DRIContextType)(long)contextStore))) {
+ DRIDestroyContextPriv(pDRIContextPriv);
+ return FALSE;
+ }
+ }
+
+ /* track this in case the client dies before cleanup */
+ AddResource(context, DRIContextPrivResType, (pointer)pDRIContextPriv);
+
+ return TRUE;
+}
+
+Bool
+DRIDestroyContext(ScreenPtr pScreen, XID context)
+{
+ FreeResourceByType(context, DRIContextPrivResType, FALSE);
+
+ return TRUE;
+}
+
+/* DRIContextPrivDelete is called by the resource manager. */
+Bool
+DRIContextPrivDelete(pointer pResource, XID id)
+{
+ DRIContextPrivPtr pDRIContextPriv = (DRIContextPrivPtr)pResource;
+ DRIScreenPrivPtr pDRIPriv;
+ void *contextStore;
+
+ pDRIPriv = DRI_SCREEN_PRIV(pDRIContextPriv->pScreen);
+ if (pDRIPriv->pDriverInfo->DestroyContext) {
+ contextStore = DRIGetContextStore(pDRIContextPriv);
+ pDRIPriv->pDriverInfo->DestroyContext(pDRIContextPriv->pScreen,
+ pDRIContextPriv->hwContext,
+ (DRIContextType)(long)contextStore);
+ }
+ return DRIDestroyContextPriv(pDRIContextPriv);
+}
+
+
+/* This walks the drawable timestamp array and invalidates all of them
+ * in the case of transition from private to shared backbuffers. It's
+ * not necessary for correctness, because DRIClipNotify gets called in
+ * time to prevent any conflict, but the transition from
+ * shared->private is sometimes missed if we don't do this.
+ */
+static void
+DRIClipNotifyAllDrawables(ScreenPtr pScreen)
+{
+ int i;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ for( i=0; i < pDRIPriv->pDriverInfo->maxDrawableTableEntry; i++) {
+ pDRIPriv->pSAREA->drawableTable[i].stamp = DRIDrawableValidationStamp++;
+ }
+}
+
+
+static void
+DRITransitionToSharedBuffers(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
+ DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionSingleToMulti3D)
+ pDRIInfo->TransitionSingleToMulti3D( pScreen );
+}
+
+
+static void
+DRITransitionToPrivateBuffers(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
+ DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionMultiToSingle3D)
+ pDRIInfo->TransitionMultiToSingle3D( pScreen );
+}
+
+
+static void
+DRITransitionTo3d(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
+ DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionTo3d)
+ pDRIInfo->TransitionTo3d( pScreen );
+}
+
+static void
+DRITransitionTo2d(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIInfoPtr pDRIInfo = pDRIPriv->pDriverInfo;
+
+ DRIClipNotifyAllDrawables( pScreen );
+
+ if (pDRIInfo->TransitionTo2d)
+ pDRIInfo->TransitionTo2d( pScreen );
+}
+
+
+Bool
+DRICreateDrawable(ScreenPtr pScreen, Drawable id,
+ DrawablePtr pDrawable, drmDrawablePtr hHWDrawable)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+ WindowPtr pWin;
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
+ pDRIDrawablePriv->refCount++;
+ }
+ else {
+ /* allocate a DRI Window Private record */
+ if (!(pDRIDrawablePriv = xalloc(sizeof(DRIDrawablePrivRec)))) {
+ return FALSE;
+ }
+
+ /* Only create a drmDrawable once */
+ if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) {
+ xfree(pDRIDrawablePriv);
+ return FALSE;
+ }
+
+ /* add it to the list of DRI drawables for this screen */
+ pDRIDrawablePriv->hwDrawable = *hHWDrawable;
+ pDRIDrawablePriv->pScreen = pScreen;
+ pDRIDrawablePriv->refCount = 1;
+ pDRIDrawablePriv->drawableIndex = -1;
+
+ /* save private off of preallocated index */
+ pWin->devPrivates[DRIWindowPrivIndex].ptr =
+ (pointer)pDRIDrawablePriv;
+
+ switch (++pDRIPriv->nrWindows) {
+ case 1:
+ DRITransitionTo3d( pScreen );
+ break;
+ case 2:
+ DRITransitionToSharedBuffers( pScreen );
+ break;
+ default:
+ break;
+ }
+
+ /* track this in case this window is destroyed */
+ AddResource(id, DRIDrawablePrivResType, (pointer)pWin);
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIDestroyDrawable(ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+ WindowPtr pWin;
+
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+ pDRIDrawablePriv->refCount--;
+ if (pDRIDrawablePriv->refCount <= 0) {
+ /* This calls back DRIDrawablePrivDelete which frees private area */
+ FreeResourceByType(id, DRIDrawablePrivResType, FALSE);
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIDrawablePrivDelete(pointer pResource, XID id)
+{
+ DrawablePtr pDrawable = (DrawablePtr)pResource;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pDrawable->pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+ WindowPtr pWin;
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+
+ if (pDRIDrawablePriv->drawableIndex != -1) {
+ /* bump stamp to force outstanding 3D requests to resync */
+ pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
+ = DRIDrawableValidationStamp++;
+
+ /* release drawable table entry */
+ pDRIPriv->DRIDrawables[pDRIDrawablePriv->drawableIndex] = NULL;
+ }
+
+ if (drmDestroyDrawable(pDRIPriv->drmFD,
+ pDRIDrawablePriv->hwDrawable)) {
+ return FALSE;
+ }
+ xfree(pDRIDrawablePriv);
+ pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL;
+
+ switch (--pDRIPriv->nrWindows) {
+ case 0:
+ DRITransitionTo2d( pDrawable->pScreen );
+ break;
+ case 1:
+ DRITransitionToPrivateBuffers( pDrawable->pScreen );
+ break;
+ default:
+ break;
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIGetDrawableInfo(ScreenPtr pScreen,
+ DrawablePtr pDrawable,
+ unsigned int* index,
+ unsigned int* stamp,
+ int* X,
+ int* Y,
+ int* W,
+ int* H,
+ int* numClipRects,
+ XF86DRIClipRectPtr* pClipRects,
+ int* backX,
+ int* backY,
+ int* numBackClipRects,
+ XF86DRIClipRectPtr* pBackClipRects)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv, pOldDrawPriv;
+ WindowPtr pWin, pOldWin;
+ int i;
+
+ printf("maxDrawableTableEntry = %d\n", pDRIPriv->pDriverInfo->maxDrawableTableEntry);
+
+ if (pDrawable->type == DRAWABLE_WINDOW) {
+ pWin = (WindowPtr)pDrawable;
+ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
+
+ /* Manage drawable table */
+ if (pDRIDrawablePriv->drawableIndex == -1) { /* load SAREA table */
+
+ /* Search table for empty entry */
+ i = 0;
+ while (i < pDRIPriv->pDriverInfo->maxDrawableTableEntry) {
+ if (!(pDRIPriv->DRIDrawables[i])) {
+ pDRIPriv->DRIDrawables[i] = pDrawable;
+ pDRIDrawablePriv->drawableIndex = i;
+ pDRIPriv->pSAREA->drawableTable[i].stamp =
+ DRIDrawableValidationStamp++;
+ break;
+ }
+ i++;
+ }
+
+ /* Search table for oldest entry */
+ if (i == pDRIPriv->pDriverInfo->maxDrawableTableEntry) {
+ unsigned int oldestStamp = ~0;
+ int oldestIndex = 0;
+ i = pDRIPriv->pDriverInfo->maxDrawableTableEntry;
+ while (i--) {
+ if (pDRIPriv->pSAREA->drawableTable[i].stamp <
+ oldestStamp) {
+ oldestIndex = i;
+ oldestStamp =
+ pDRIPriv->pSAREA->drawableTable[i].stamp;
+ }
+ }
+ pDRIDrawablePriv->drawableIndex = oldestIndex;
+
+ /* release oldest drawable table entry */
+ pOldWin = (WindowPtr)pDRIPriv->DRIDrawables[oldestIndex];
+ pOldDrawPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pOldWin);
+ pOldDrawPriv->drawableIndex = -1;
+
+ /* claim drawable table entry */
+ pDRIPriv->DRIDrawables[oldestIndex] = pDrawable;
+
+ /* validate SAREA entry */
+ pDRIPriv->pSAREA->drawableTable[oldestIndex].stamp =
+ DRIDrawableValidationStamp++;
+
+ /* check for stamp wrap around */
+ if (oldestStamp > DRIDrawableValidationStamp) {
+
+ /* walk SAREA table and invalidate all drawables */
+ for( i=0;
+ i < pDRIPriv->pDriverInfo->maxDrawableTableEntry;
+ i++) {
+ pDRIPriv->pSAREA->drawableTable[i].stamp =
+ DRIDrawableValidationStamp++;
+ }
+ }
+ }
+
+ /* If the driver wants to be notified when the index is
+ * set for a drawable, let it know now.
+ */
+ if (pDRIPriv->pDriverInfo->SetDrawableIndex)
+ pDRIPriv->pDriverInfo->SetDrawableIndex(pWin,
+ pDRIDrawablePriv->drawableIndex);
+
+ /* reinit drawable ID if window is visible */
+ if ((pWin->viewable) &&
+ (pDRIPriv->pDriverInfo->bufferRequests != DRI_NO_WINDOWS))
+ {
+ (*pDRIPriv->pDriverInfo->InitBuffers)(pWin,
+ &pWin->clipList, pDRIDrawablePriv->drawableIndex);
+ }
+ }
+
+ *index = pDRIDrawablePriv->drawableIndex;
+ *stamp = pDRIPriv->pSAREA->drawableTable[*index].stamp;
+ *X = (int)(pWin->drawable.x);
+ *Y = (int)(pWin->drawable.y);
+#if 0
+ *W = (int)(pWin->winSize.extents.x2 - pWin->winSize.extents.x1);
+ *H = (int)(pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
+#endif
+ *W = (int)(pWin->drawable.width);
+ *H = (int)(pWin->drawable.height);
+ *numClipRects = REGION_NUM_RECTS(&pWin->clipList);
+ *pClipRects = (XF86DRIClipRectPtr)REGION_RECTS(&pWin->clipList);
+
+ if (!*numClipRects && pDRIPriv->fullscreen) {
+ /* use fake full-screen clip rect */
+ pDRIPriv->fullscreen_rect.x1 = *X;
+ pDRIPriv->fullscreen_rect.y1 = *Y;
+ pDRIPriv->fullscreen_rect.x2 = *X + *W;
+ pDRIPriv->fullscreen_rect.y2 = *Y + *H;
+
+ *numClipRects = 1;
+ *pClipRects = &pDRIPriv->fullscreen_rect;
+ }
+
+ *backX = *X;
+ *backY = *Y;
+
+ if (pDRIPriv->nrWindows == 1 && *numClipRects) {
+ /* Use a single cliprect. */
+
+ int x0 = *X;
+ int y0 = *Y;
+ int x1 = x0 + *W;
+ int y1 = y0 + *H;
+
+ if (x0 < 0) x0 = 0;
+ if (y0 < 0) y0 = 0;
+ if (x1 > pScreen->width-1) x1 = pScreen->width-1;
+ if (y1 > pScreen->height-1) y1 = pScreen->height-1;
+
+ pDRIPriv->private_buffer_rect.x1 = x0;
+ pDRIPriv->private_buffer_rect.y1 = y0;
+ pDRIPriv->private_buffer_rect.x2 = x1;
+ pDRIPriv->private_buffer_rect.y2 = y1;
+
+ *numBackClipRects = 1;
+ *pBackClipRects = &(pDRIPriv->private_buffer_rect);
+ } else {
+ /* Use the frontbuffer cliprects for back buffers. */
+ *numBackClipRects = 0;
+ *pBackClipRects = 0;
+ }
+ }
+ else {
+ /* Not a DRIDrawable */
+ return FALSE;
+ }
+ }
+ else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ /* NOT_DONE */
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+Bool
+DRIGetDeviceInfo(ScreenPtr pScreen,
+ drmHandlePtr hFrameBuffer,
+ int* fbOrigin,
+ int* fbSize,
+ int* fbStride,
+ int* devPrivateSize,
+ void** pDevPrivate)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ *hFrameBuffer = pDRIPriv->hFrameBuffer;
+ *fbOrigin = 0;
+ *fbSize = pDRIPriv->pDriverInfo->frameBufferSize;
+ *fbStride = pDRIPriv->pDriverInfo->frameBufferStride;
+ *devPrivateSize = pDRIPriv->pDriverInfo->devPrivateSize;
+ *pDevPrivate = pDRIPriv->pDriverInfo->devPrivate;
+
+ return TRUE;
+}
+
+DRIInfoPtr
+DRICreateInfoRec(void)
+{
+ DRIInfoPtr inforec = (DRIInfoPtr)xcalloc(1, sizeof(DRIInfoRec));
+ if (!inforec) return NULL;
+
+ /* Initialize defaults */
+ inforec->busIdString = NULL;
+
+ /* Wrapped function defaults */
+ inforec->wrap.WakeupHandler = DRIDoWakeupHandler;
+ inforec->wrap.BlockHandler = DRIDoBlockHandler;
+ inforec->wrap.WindowExposures = DRIWindowExposures;
+ inforec->wrap.CopyWindow = DRICopyWindow;
+ inforec->wrap.ValidateTree = DRIValidateTree;
+ inforec->wrap.PostValidateTree = DRIPostValidateTree;
+ inforec->wrap.ClipNotify = DRIClipNotify;
+ inforec->wrap.AdjustFrame = DRIAdjustFrame;
+
+ inforec->TransitionTo2d = 0;
+ inforec->TransitionTo3d = 0;
+ inforec->SetDrawableIndex = 0;
+
+ return inforec;
+}
+
+void
+DRIDestroyInfoRec(DRIInfoPtr DRIInfo)
+{
+ if (DRIInfo->busIdString) xfree(DRIInfo->busIdString);
+ xfree((char*)DRIInfo);
+}
+
+
+void
+DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask)
+{
+ int i;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv &&
+ pDRIPriv->pDriverInfo->wrap.WakeupHandler)
+ (*pDRIPriv->pDriverInfo->wrap.WakeupHandler)(i, wakeupData,
+ result, pReadmask);
+ }
+}
+
+void
+DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
+{
+ int i;
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv &&
+ pDRIPriv->pDriverInfo->wrap.BlockHandler)
+ (*pDRIPriv->pDriverInfo->wrap.BlockHandler)(i, blockData,
+ pTimeout, pReadmask);
+ }
+}
+
+void
+DRIDoWakeupHandler(int screenNum, pointer wakeupData,
+ unsigned long result, pointer pReadmask)
+{
+ ScreenPtr pScreen = screenInfo.screens[screenNum];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ DRILock(pScreen, 0);
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+ /* hide X context by swapping 2D component here */
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_3D_SYNC,
+ DRI_2D_CONTEXT,
+ pDRIPriv->partial3DContextStore,
+ DRI_2D_CONTEXT,
+ pDRIPriv->hiddenContextStore);
+ }
+}
+
+void
+DRIDoBlockHandler(int screenNum, pointer blockData,
+ pointer pTimeout, pointer pReadmask)
+{
+ ScreenPtr pScreen = screenInfo.screens[screenNum];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+ /* hide X context by swapping 2D component here */
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_2D_SYNC,
+ DRI_NO_CONTEXT,
+ NULL,
+ DRI_2D_CONTEXT,
+ pDRIPriv->partial3DContextStore);
+ }
+ DRIUnlock(pScreen);
+}
+
+void
+DRISwapContext(int drmFD, void *oldctx, void *newctx)
+{
+ DRIContextPrivPtr oldContext = (DRIContextPrivPtr)oldctx;
+ DRIContextPrivPtr newContext = (DRIContextPrivPtr)newctx;
+ ScreenPtr pScreen = newContext->pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ void* oldContextStore = NULL;
+ DRIContextType oldContextType;
+ void* newContextStore = NULL;
+ DRIContextType newContextType;
+ DRISyncType syncType;
+#ifdef DEBUG
+ static int count = 0;
+#endif
+
+ if (!newContext) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI] Context Switch Error: oldContext=%x, newContext=%x\n",
+ oldContext, newContext);
+ return;
+ }
+
+#ifdef DEBUG
+ /* usefull for debugging, just print out after n context switches */
+ if (!count || !(count % 1)) {
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[DRI] Context switch %5d from %p/0x%08x (%d)\n",
+ count,
+ oldContext,
+ oldContext ? oldContext->flags : 0,
+ oldContext ? oldContext->hwContext : -1);
+ DRIDrvMsg(pScreen->myNum, X_INFO,
+ "[DRI] Context switch %5d to %p/0x%08x (%d)\n",
+ count,
+ newContext,
+ newContext ? newContext->flags : 0,
+ newContext ? newContext->hwContext : -1);
+ }
+ ++count;
+#endif
+
+ if (!pDRIPriv->pDriverInfo->SwapContext) {
+ DRIDrvMsg(pScreen->myNum, X_ERROR,
+ "[DRI] DDX driver missing context swap call back\n");
+ return;
+ }
+
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+
+ /* only 3D contexts are swapped in this case */
+ if (oldContext) {
+ oldContextStore = DRIGetContextStore(oldContext);
+ oldContext->valid3D = TRUE;
+ oldContextType = DRI_3D_CONTEXT;
+ } else {
+ oldContextType = DRI_NO_CONTEXT;
+ }
+ newContextStore = DRIGetContextStore(newContext);
+ if ((newContext->valid3D) &&
+ (newContext->hwContext != pDRIPriv->myContext)) {
+ newContextType = DRI_3D_CONTEXT;
+ }
+ else {
+ newContextType = DRI_2D_CONTEXT;
+ }
+ syncType = DRI_3D_SYNC;
+ }
+ else /* default: driverSwapMethod == DRI_SERVER_SWAP */ {
+
+ /* optimize 2D context swaps */
+
+ if (newContext->flags & DRI_CONTEXT_2DONLY) {
+ /* go from 3D context to 2D context and only save 2D
+ * subset of 3D state
+ */
+ oldContextStore = DRIGetContextStore(oldContext);
+ oldContextType = DRI_2D_CONTEXT;
+ newContextStore = DRIGetContextStore(newContext);
+ newContextType = DRI_2D_CONTEXT;
+ syncType = DRI_3D_SYNC;
+ pDRIPriv->lastPartial3DContext = oldContext;
+ }
+ else if (oldContext->flags & DRI_CONTEXT_2DONLY) {
+ if (pDRIPriv->lastPartial3DContext == newContext) {
+ /* go from 2D context back to previous 3D context and
+ * only restore 2D subset of previous 3D state
+ */
+ oldContextStore = DRIGetContextStore(oldContext);
+ oldContextType = DRI_2D_CONTEXT;
+ newContextStore = DRIGetContextStore(newContext);
+ newContextType = DRI_2D_CONTEXT;
+ syncType = DRI_2D_SYNC;
+ }
+ else {
+ /* go from 2D context to a different 3D context */
+
+ /* call DDX driver to do partial restore */
+ oldContextStore = DRIGetContextStore(oldContext);
+ newContextStore =
+ DRIGetContextStore(pDRIPriv->lastPartial3DContext);
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_2D_SYNC,
+ DRI_2D_CONTEXT,
+ oldContextStore,
+ DRI_2D_CONTEXT,
+ newContextStore);
+
+ /* now setup for a complete 3D swap */
+ oldContextStore = newContextStore;
+ oldContext->valid3D = TRUE;
+ oldContextType = DRI_3D_CONTEXT;
+ newContextStore = DRIGetContextStore(newContext);
+ if ((newContext->valid3D) &&
+ (newContext->hwContext != pDRIPriv->myContext)) {
+ newContextType = DRI_3D_CONTEXT;
+ }
+ else {
+ newContextType = DRI_2D_CONTEXT;
+ }
+ syncType = DRI_NO_SYNC;
+ }
+ }
+ else {
+ /* now setup for a complete 3D swap */
+ oldContextStore = newContextStore;
+ oldContext->valid3D = TRUE;
+ oldContextType = DRI_3D_CONTEXT;
+ newContextStore = DRIGetContextStore(newContext);
+ if ((newContext->valid3D) &&
+ (newContext->hwContext != pDRIPriv->myContext)) {
+ newContextType = DRI_3D_CONTEXT;
+ }
+ else {
+ newContextType = DRI_2D_CONTEXT;
+ }
+ syncType = DRI_3D_SYNC;
+ }
+ }
+
+ /* call DDX driver to perform the swap */
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ syncType,
+ oldContextType,
+ oldContextStore,
+ newContextType,
+ newContextStore);
+}
+
+void*
+DRIGetContextStore(DRIContextPrivPtr context)
+{
+ return((void *)context->pContextStore);
+}
+
+void
+DRIWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr bsreg)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+
+ if(pDRIDrawablePriv) {
+ (*pDRIPriv->pDriverInfo->InitBuffers)(pWin, prgn,
+ pDRIDrawablePriv->drawableIndex);
+ }
+
+ /* call lower wrapped functions */
+ if (pDRIPriv && pDRIPriv->wrap.WindowExposures) {
+
+ /* unwrap */
+ pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures;
+
+ /* call lower layers */
+ (*pScreen->WindowExposures)(pWin, prgn, bsreg);
+
+ /* rewrap */
+ pDRIPriv->wrap.WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = DRIWindowExposures;
+ }
+}
+
+
+static int
+DRITreeTraversal(WindowPtr pWin, pointer data)
+{
+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+
+ if(pDRIDrawablePriv) {
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ RegionPtr reg = (RegionPtr)data;
+
+ REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
+
+ if(pDRIPriv->nrWindows == 1)
+ return WT_STOPWALKING;
+ }
+ return WT_WALKCHILDREN;
+}
+
+void
+DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if(!pDRIPriv) return;
+
+ if(pDRIPriv->nrWindows > 0) {
+ RegionRec reg;
+
+ REGION_INIT(pScreen, &reg, NullBox, 0);
+ TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
+
+ if(REGION_NOTEMPTY(pScreen, &reg)) {
+ REGION_TRANSLATE(pScreen, &reg, ptOldOrg.x - pWin->drawable.x,
+ ptOldOrg.y - pWin->drawable.y);
+ REGION_INTERSECT(pScreen, &reg, &reg, prgnSrc);
+
+ /* The MoveBuffers interface is not ideal */
+ (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, &reg,
+ pDRIPriv->pDriverInfo->ddxDrawableTableEntry);
+ }
+
+ REGION_UNINIT(pScreen, &reg);
+ }
+
+ /* call lower wrapped functions */
+ if(pDRIPriv->wrap.CopyWindow) {
+ /* unwrap */
+ pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
+
+ /* call lower layers */
+ (*pScreen->CopyWindow)(pWin, ptOldOrg, prgnSrc);
+
+ /* rewrap */
+ pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = DRICopyWindow;
+ }
+}
+
+static void
+DRIGetSecs(long *secs, long *usecs)
+{
+#ifdef XFree86LOADER
+ getsecs(secs,usecs);
+#else
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+
+ *secs = tv.tv_sec;
+ *usecs = tv.tv_usec;
+#endif
+}
+
+static unsigned long
+DRIComputeMilliSeconds(unsigned long s_secs, unsigned long s_usecs,
+ unsigned long f_secs, unsigned long f_usecs)
+{
+ if (f_usecs < s_usecs) {
+ --f_secs;
+ f_usecs += 1000000;
+ }
+ return (f_secs - s_secs) * 1000 + (f_usecs - s_usecs) / 1000;
+}
+
+static void
+DRISpinLockTimeout(drmLock *lock, int val, unsigned long timeout /* in mS */)
+{
+ int count = 10000;
+#if !defined(__alpha__) && !defined(__powerpc__)
+ char ret;
+#else
+ int ret;
+#endif
+ long s_secs, s_usecs;
+ long f_secs, f_usecs;
+ long msecs;
+ long prev = 0;
+
+ DRIGetSecs(&s_secs, &s_usecs);
+
+ do {
+ DRM_SPINLOCK_COUNT(lock, val, count, ret);
+ if (!ret) return; /* Got lock */
+ DRIGetSecs(&f_secs, &f_usecs);
+ msecs = DRIComputeMilliSeconds(s_secs, s_usecs, f_secs, f_usecs);
+ if (msecs - prev < 250) count *= 2; /* Not more than 0.5S */
+ } while (msecs < timeout);
+
+ /* Didn't get lock, so take it. The worst
+ that can happen is that there is some
+ garbage written to the wrong part of the
+ framebuffer that a refresh will repair.
+ That's undesirable, but better than
+ locking the server. This should be a
+ very rare event. */
+ DRM_SPINLOCK_TAKE(lock, val);
+}
+
+static void
+DRILockTree(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ if(!pDRIPriv) return;
+
+ /* Restore the last known 3D context if the X context is hidden */
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_2D_SYNC,
+ DRI_NO_CONTEXT,
+ NULL,
+ DRI_2D_CONTEXT,
+ pDRIPriv->partial3DContextStore);
+ }
+
+ /* Call kernel to release lock */
+ DRIUnlock(pScreen);
+
+ /* Grab drawable spin lock: a time out between 10 and 30 seconds is
+ appropriate, since this should never time out except in the case of
+ client death while the lock is being held. The timeout must be
+ greater than any reasonable rendering time. */
+ DRISpinLockTimeout(&pDRIPriv->pSAREA->drawable_lock, 1, 10000); /*10 secs*/
+
+ /* Call kernel flush outstanding buffers and relock */
+ DRILock(pScreen, DRM_LOCK_QUIESCENT|DRM_LOCK_FLUSH_ALL);
+
+ /* Switch back to our 2D context if the X context is hidden */
+ if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) {
+ /* hide X context by swapping 2D component here */
+ (*pDRIPriv->pDriverInfo->SwapContext)(pScreen,
+ DRI_3D_SYNC,
+ DRI_2D_CONTEXT,
+ pDRIPriv->partial3DContextStore,
+ DRI_2D_CONTEXT,
+ pDRIPriv->hiddenContextStore);
+ }
+}
+
+/* It appears that somebody is relying on the lock being set even
+ if we aren't touching 3D windows */
+
+#define DRI_BROKEN
+
+static Bool DRIWindowsTouched = FALSE;
+
+int
+DRIValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+{
+ ScreenPtr pScreen = pParent->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ int returnValue = 1; /* always return 1, not checked by dix/window.c */
+
+ if(!pDRIPriv) return returnValue;
+
+ DRIWindowsTouched = FALSE;
+
+#ifdef DRI_BROKEN
+ if(!DRIWindowsTouched) {
+ DRILockTree(pScreen);
+ DRIWindowsTouched = TRUE;
+ }
+#endif
+
+ /* call lower wrapped functions */
+ if(pDRIPriv->wrap.ValidateTree) {
+ /* unwrap */
+ pScreen->ValidateTree = pDRIPriv->wrap.ValidateTree;
+
+ /* call lower layers */
+ returnValue = (*pScreen->ValidateTree)(pParent, pChild, kind);
+
+ /* rewrap */
+ pDRIPriv->wrap.ValidateTree = pScreen->ValidateTree;
+ pScreen->ValidateTree = DRIValidateTree;
+ }
+
+ return returnValue;
+}
+
+void
+DRIPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
+{
+ ScreenPtr pScreen;
+ DRIScreenPrivPtr pDRIPriv;
+
+ if (pParent) {
+ pScreen = pParent->drawable.pScreen;
+ } else {
+ pScreen = pChild->drawable.pScreen;
+ }
+ if(!(pDRIPriv = DRI_SCREEN_PRIV(pScreen))) return;
+
+ if (pDRIPriv->wrap.PostValidateTree) {
+ /* unwrap */
+ pScreen->PostValidateTree = pDRIPriv->wrap.PostValidateTree;
+
+ /* call lower layers */
+ (*pScreen->PostValidateTree)(pParent, pChild, kind);
+
+ /* rewrap */
+ pDRIPriv->wrap.PostValidateTree = pScreen->PostValidateTree;
+ pScreen->PostValidateTree = DRIPostValidateTree;
+ }
+
+ if (DRIWindowsTouched) {
+ /* Release spin lock */
+ DRM_SPINUNLOCK(&pDRIPriv->pSAREA->drawable_lock, 1);
+ DRIWindowsTouched = FALSE;
+ }
+}
+
+void
+DRIClipNotify(WindowPtr pWin, int dx, int dy)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv;
+
+ if(!pDRIPriv) return;
+
+ if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
+
+#ifndef DRI_BROKEN
+ if(!DRIWindowsTouched) {
+ DRILockTree(pScreen);
+ DRIWindowsTouched = TRUE;
+ }
+#endif
+
+ pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
+ = DRIDrawableValidationStamp++;
+ }
+
+ /* call lower wrapped functions */
+ if(pDRIPriv->wrap.ClipNotify) {
+
+ /* unwrap */
+ pScreen->ClipNotify = pDRIPriv->wrap.ClipNotify;
+
+ /* call lower layers */
+ (*pScreen->ClipNotify)(pWin, dx, dy);
+
+ /* rewrap */
+ pDRIPriv->wrap.ClipNotify = pScreen->ClipNotify;
+ pScreen->ClipNotify = DRIClipNotify;
+ }
+}
+
+CARD32
+DRIGetDrawableIndex(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIDrawablePrivPtr pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin);
+ CARD32 index;
+
+ if (pDRIDrawablePriv) {
+ index = pDRIDrawablePriv->drawableIndex;
+ }
+ else {
+ index = pDRIPriv->pDriverInfo->ddxDrawableTableEntry;
+ }
+
+ return index;
+}
+
+unsigned int
+DRIGetDrawableStamp(ScreenPtr pScreen, CARD32 drawable_index)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ return pDRIPriv->pSAREA->drawableTable[drawable_index].stamp;
+}
+
+
+void
+DRIPrintDrawableLock(ScreenPtr pScreen, char *msg)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+
+ ErrorF("%s: %d\n", msg, pDRIPriv->pSAREA->drawable_lock.lock);
+}
+
+void
+DRILock(ScreenPtr pScreen, int flags)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!pDRIPriv) return;
+
+ if (!lockRefCount)
+ DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags);
+ lockRefCount++;
+}
+
+void
+DRIUnlock(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if(!pDRIPriv) return;
+
+ if (lockRefCount > 0) {
+ lockRefCount--;
+ }
+ else {
+ ErrorF("DRIUnlock called when not locked\n");
+ return;
+ }
+ if (!lockRefCount)
+ DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext);
+}
+
+void *
+DRIGetSAREAPrivate(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if (!pDRIPriv) return 0;
+
+ return (void *)(((char*)pDRIPriv->pSAREA)+sizeof(XF86DRISAREARec));
+}
+
+drmContext
+DRIGetContext(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ if (!pDRIPriv) return 0;
+
+ return pDRIPriv->myContext;
+}
+
+/* This lets get at the unwrapped functions so that they can correctly
+ * call the lowerlevel functions, and choose whether they will be
+ * called at every level of recursion (eg in validatetree).
+ */
+DRIWrappedFuncsRec *
+DRIGetWrappedFuncs(ScreenPtr pScreen)
+{
+ return &(DRI_SCREEN_PRIV(pScreen)->wrap);
+}
+
+void
+DRIQueryVersion(int *majorVersion,
+ int *minorVersion,
+ int *patchVersion)
+{
+ *majorVersion = XF86DRI_MAJOR_VERSION;
+ *minorVersion = XF86DRI_MINOR_VERSION;
+ *patchVersion = XF86DRI_PATCH_VERSION;
+}
+
+static void
+_DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y)
+{
+ pDRIPriv->pSAREA->frame.x = x;
+ pDRIPriv->pSAREA->frame.y = y;
+ pDRIPriv->pSAREA->frame.width = pScrn->frameX1 - x + 1;
+ pDRIPriv->pSAREA->frame.height = pScrn->frameY1 - y + 1;
+}
+
+void
+DRIAdjustFrame(int scrnIndex, int x, int y, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[scrnIndex];
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ int px, py;
+
+ if (!pDRIPriv || !pDRIPriv->pSAREA) {
+ DRIDrvMsg(scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n",
+ pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL);
+ return;
+ }
+
+ if (pDRIPriv->fullscreen) {
+ /* Fix up frame */
+ pScrn->frameX0 = pDRIPriv->pSAREA->frame.x;
+ pScrn->frameY0 = pDRIPriv->pSAREA->frame.y;
+ pScrn->frameX1 = pScrn->frameX0 + pDRIPriv->pSAREA->frame.width - 1;
+ pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1;
+
+ /* Fix up cursor */
+ miPointerPosition(&px, &py);
+ if (px < pScrn->frameX0) px = pScrn->frameX0;
+ if (px > pScrn->frameX1) px = pScrn->frameX1;
+ if (py < pScrn->frameY0) py = pScrn->frameY0;
+ if (py > pScrn->frameY1) py = pScrn->frameY1;
+ pScreen->SetCursorPosition(pScreen, px, py, TRUE);
+ return;
+ }
+
+ if (pDRIPriv->wrap.AdjustFrame) {
+ /* unwrap */
+ pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
+ /* call lower layers */
+ (*pScrn->AdjustFrame)(scrnIndex, x, y, flags);
+ /* rewrap */
+ pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame;
+ pScrn->AdjustFrame = DRIAdjustFrame;
+ }
+
+ _DRIAdjustFrame(pScrn, pDRIPriv, x, y);
+}
+
+/* WARNING WARNING WARNING: Just like every other function call in this
+ file, the DRIOpenFullScreen and DRICloseFullScreen calls are for
+ internal use only! They should be used only by GLX internals and
+ should NEVER be called from a GL application.
+
+ Some time in the future, there will be a (proposed) standard GLX
+ extension that performs expanded functionality, that is designed for
+ used by application-level programs, and that should be portable
+ across multiple GLX implementations. */
+Bool
+DRIOpenFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ WindowPtr pWin = (WindowPtr)pDrawable;
+ XF86DRIClipRectPtr pClipRects = (void *)REGION_RECTS(&pWin->clipList);
+
+ _DRIAdjustFrame(pScrn, pDRIPriv, pScrn->frameX0, pScrn->frameY0);
+
+ if (pDrawable->type != DRAWABLE_WINDOW) return FALSE;
+
+ if (!pScrn->vtSema) return FALSE; /* switched away */
+
+ if (pDrawable->x != pScrn->frameX0
+ || pDrawable->y != pScrn->frameY0
+ || pDrawable->width != pScrn->frameX1 - pScrn->frameX0 + 1
+ || pDrawable->height != pScrn->frameY1 - pScrn->frameY0 + 1) {
+ return FALSE;
+ }
+
+ if (REGION_NUM_RECTS(&pWin->clipList) != 1) return FALSE;
+ if (pDrawable->x != pClipRects[0].x1
+ || pDrawable->y != pClipRects[0].y1
+ || pDrawable->width != pClipRects[0].x2 - pClipRects[0].x1
+ || pDrawable->height != pClipRects[0].y2 - pClipRects[0].y1) {
+ return FALSE;
+ }
+
+ AddResource(pDrawable->id, DRIFullScreenResType, (pointer)pWin);
+
+ xf86EnableVTSwitch(FALSE);
+ pScrn->EnableDisableFBAccess(pScreen->myNum, FALSE);
+ pScrn->vtSema = FALSE;
+ pDRIPriv->fullscreen = pDrawable;
+ DRIClipNotify(pWin, 0, 0);
+
+ if (pDRIPriv->pDriverInfo->OpenFullScreen)
+ pDRIPriv->pDriverInfo->OpenFullScreen(pScreen);
+
+ pDRIPriv->pSAREA->frame.fullscreen = 1;
+ return TRUE;
+}
+
+static Bool
+_DRICloseFullScreen(pointer pResource, XID id)
+{
+ DrawablePtr pDrawable = (DrawablePtr)pResource;
+ ScreenPtr pScreen = pDrawable->pScreen;
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ WindowPtr pWin = (WindowPtr)pDrawable;
+ WindowOptPtr optional = pWin->optional;
+ Mask mask = pWin->eventMask;
+
+ if (pDRIPriv->pDriverInfo->CloseFullScreen)
+ pDRIPriv->pDriverInfo->CloseFullScreen(pScreen);
+
+ pDRIPriv->fullscreen = NULL;
+ pScrn->vtSema = TRUE;
+
+ /* Turn off expose events for the top window */
+ pWin->eventMask &= ~ExposureMask;
+ pWin->optional = NULL;
+ pScrn->EnableDisableFBAccess(pScreen->myNum, TRUE);
+ pWin->eventMask = mask;
+ pWin->optional = optional;
+
+ xf86EnableVTSwitch(TRUE);
+ pDRIPriv->pSAREA->frame.fullscreen = 0;
+ return TRUE;
+}
+
+Bool
+DRICloseFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable)
+{
+ FreeResourceByType(pDrawable->id, DRIFullScreenResType, FALSE);
+ return TRUE;
+}
+
+
+/*
+ * DRIMoveBuffersHelper swaps the regions rects in place leaving you
+ * a region with the rects in the order that you need to blit them,
+ * but it is possibly (likely) an invalid region afterwards. If you
+ * need to use the region again for anything you have to call
+ * REGION_VALIDATE on it, or better yet, save a copy first.
+ */
+
+void
+DRIMoveBuffersHelper(
+ ScreenPtr pScreen,
+ int dx,
+ int dy,
+ int *xdir,
+ int *ydir,
+ RegionPtr reg
+)
+{
+ BoxPtr extents, pbox, firstBox, lastBox;
+ BoxRec tmpBox;
+ int y, nbox;
+
+ extents = REGION_EXTENTS(pScreen, reg);
+ nbox = REGION_NUM_RECTS(reg);
+ pbox = REGION_RECTS(reg);
+
+ if((dy > 0) && (dy < (extents->y2 - extents->y1))) {
+ *ydir = -1;
+ if(nbox > 1) {
+ firstBox = pbox;
+ lastBox = pbox + nbox - 1;
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+ }
+ } else *ydir = 1;
+
+ if((dx > 0) && (dx < (extents->x2 - extents->x1))) {
+ *xdir = -1;
+ if(nbox > 1) {
+ firstBox = lastBox = pbox;
+ y = pbox->y1;
+ while(--nbox) {
+ pbox++;
+ if(pbox->y1 == y) lastBox++;
+ else {
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+
+ firstBox = lastBox = pbox;
+ y = pbox->y1;
+ }
+ }
+ while((unsigned long)firstBox < (unsigned long)lastBox) {
+ tmpBox = *firstBox;
+ *firstBox = *lastBox;
+ *lastBox = tmpBox;
+ firstBox++;
+ lastBox--;
+ }
+ }
+ } else *xdir = 1;
+
+}
diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h
new file mode 100644
index 000000000..80602d3dd
--- /dev/null
+++ b/hw/xfree86/dri/dri.h
@@ -0,0 +1,330 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/dri.h,v 1.19 2002/10/30 12:52:03 alanh Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, 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 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:
+ * Jens Owen <jens@tungstengraphics.com>
+ *
+ */
+
+/* Prototypes for DRI functions */
+
+#ifndef _DRI_H_
+
+#include "scrnintstr.h"
+#include "xf86dri.h"
+
+typedef int DRISyncType;
+
+#define DRI_NO_SYNC 0
+#define DRI_2D_SYNC 1
+#define DRI_3D_SYNC 2
+
+typedef int DRIContextType;
+
+typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr;
+
+typedef enum _DRIContextFlags
+{
+ DRI_CONTEXT_2DONLY = 0x01,
+ DRI_CONTEXT_PRESERVED = 0x02,
+ DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */
+} DRIContextFlags;
+
+#define DRI_NO_CONTEXT 0
+#define DRI_2D_CONTEXT 1
+#define DRI_3D_CONTEXT 2
+
+typedef int DRISwapMethod;
+
+#define DRI_HIDE_X_CONTEXT 0
+#define DRI_SERVER_SWAP 1
+#define DRI_KERNEL_SWAP 2
+
+typedef int DRIWindowRequests;
+
+#define DRI_NO_WINDOWS 0
+#define DRI_3D_WINDOWS_ONLY 1
+#define DRI_ALL_WINDOWS 2
+
+
+typedef void (*ClipNotifyPtr)( WindowPtr, int, int );
+typedef void (*AdjustFramePtr)(int scrnIndex, int x, int y, int flags);
+
+
+/*
+ * These functions can be wrapped by the DRI. Each of these have
+ * generic default funcs (initialized in DRICreateInfoRec) and can be
+ * overridden by the driver in its [driver]DRIScreenInit function.
+ */
+typedef struct {
+ ScreenWakeupHandlerProcPtr WakeupHandler;
+ ScreenBlockHandlerProcPtr BlockHandler;
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ ClipNotifyProcPtr ClipNotify;
+ AdjustFramePtr AdjustFrame;
+} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
+
+
+
+
+typedef struct {
+ /* driver call back functions
+ *
+ * New fields should be added at the end for backwards compatability.
+ * Don't forget to bump the version minor number in
+ * xc/lib/GL/dri/xf86dristr.h
+ */
+ Bool (*CreateContext)(ScreenPtr pScreen,
+ VisualPtr visual,
+ drmContext hHWContext,
+ void* pVisualConfigPriv,
+ DRIContextType context);
+ void (*DestroyContext)(ScreenPtr pScreen,
+ drmContext hHWContext,
+ DRIContextType context);
+ void (*SwapContext)(ScreenPtr pScreen,
+ DRISyncType syncType,
+ DRIContextType readContextType,
+ void* readContextStore,
+ DRIContextType writeContextType,
+ void* writeContextStore);
+ void (*InitBuffers)(WindowPtr pWin,
+ RegionPtr prgn,
+ CARD32 indx);
+ void (*MoveBuffers)(WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc,
+ CARD32 indx);
+ void (*TransitionTo3d)(ScreenPtr pScreen);
+ void (*TransitionTo2d)(ScreenPtr pScreen);
+
+ void (*SetDrawableIndex)(WindowPtr pWin, CARD32 indx);
+ Bool (*OpenFullScreen)(ScreenPtr pScreen);
+ Bool (*CloseFullScreen)(ScreenPtr pScreen);
+
+ /* wrapped functions */
+ DRIWrappedFuncsRec wrap;
+
+ /* device info */
+ char* drmDriverName;
+ char* clientDriverName;
+ char* busIdString;
+ int ddxDriverMajorVersion;
+ int ddxDriverMinorVersion;
+ int ddxDriverPatchVersion;
+ CARD32 frameBufferPhysicalAddress;
+ long frameBufferSize;
+ long frameBufferStride;
+ long SAREASize;
+ int maxDrawableTableEntry;
+ int ddxDrawableTableEntry;
+ long contextSize;
+ DRISwapMethod driverSwapMethod;
+ DRIWindowRequests bufferRequests;
+ int devPrivateSize;
+ void* devPrivate;
+ Bool createDummyCtx;
+ Bool createDummyCtxPriv;
+
+ /* New with DRI version 4.1.0 */
+ void (*TransitionSingleToMulti3D)(ScreenPtr pScreen);
+ void (*TransitionMultiToSingle3D)(ScreenPtr pScreen);
+} DRIInfoRec, *DRIInfoPtr;
+
+
+extern Bool DRIScreenInit(ScreenPtr pScreen,
+ DRIInfoPtr pDRIInfo,
+ int *pDRMFD);
+
+extern void DRICloseScreen(ScreenPtr pScreen);
+
+extern Bool DRIExtensionInit(void);
+
+extern void DRIReset(void);
+
+extern Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
+ Bool *isCapable);
+
+extern Bool DRIOpenConnection(ScreenPtr pScreen,
+ drmHandlePtr hSAREA,
+ char **busIdString);
+
+extern Bool DRIAuthConnection(ScreenPtr pScreen, drmMagic magic);
+
+extern Bool DRICloseConnection(ScreenPtr pScreen);
+
+extern Bool DRIGetClientDriverName(ScreenPtr pScreen,
+ int* ddxDriverMajorVersion,
+ int* ddxDriverMinorVersion,
+ int* ddxDriverPatchVersion,
+ char** clientDriverName);
+
+extern Bool DRICreateContext(ScreenPtr pScreen,
+ VisualPtr visual,
+ XID context,
+ drmContextPtr pHWContext);
+
+extern Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
+
+extern Bool DRIContextPrivDelete(pointer pResource, XID id);
+
+extern Bool DRICreateDrawable(ScreenPtr pScreen,
+ Drawable id,
+ DrawablePtr pDrawable,
+ drmDrawablePtr hHWDrawable);
+
+extern Bool DRIDestroyDrawable(ScreenPtr pScreen,
+ Drawable id,
+ DrawablePtr pDrawable);
+
+extern Bool DRIDrawablePrivDelete(pointer pResource,
+ XID id);
+
+extern Bool DRIGetDrawableInfo(ScreenPtr pScreen,
+ DrawablePtr pDrawable,
+ unsigned int* indx,
+ unsigned int* stamp,
+ int* X,
+ int* Y,
+ int* W,
+ int* H,
+ int* numClipRects,
+ XF86DRIClipRectPtr* pClipRects,
+ int* backX,
+ int* backY,
+ int* numBackClipRects,
+ XF86DRIClipRectPtr* pBackClipRects);
+
+extern Bool DRIGetDeviceInfo(ScreenPtr pScreen,
+ drmHandlePtr hFrameBuffer,
+ int* fbOrigin,
+ int* fbSize,
+ int* fbStride,
+ int* devPrivateSize,
+ void** pDevPrivate);
+
+extern DRIInfoPtr DRICreateInfoRec(void);
+
+extern void DRIDestroyInfoRec(DRIInfoPtr DRIInfo);
+
+extern Bool DRIFinishScreenInit(ScreenPtr pScreen);
+
+extern void DRIWakeupHandler(pointer wakeupData,
+ int result,
+ pointer pReadmask);
+
+extern void DRIBlockHandler(pointer blockData,
+ OSTimePtr pTimeout,
+ pointer pReadmask);
+
+extern void DRIDoWakeupHandler(int screenNum,
+ pointer wakeupData,
+ unsigned long result,
+ pointer pReadmask);
+
+extern void DRIDoBlockHandler(int screenNum,
+ pointer blockData,
+ pointer pTimeout,
+ pointer pReadmask);
+
+extern void DRISwapContext(int drmFD,
+ void *oldctx,
+ void *newctx);
+
+extern void *DRIGetContextStore(DRIContextPrivPtr context);
+
+extern void DRIWindowExposures(WindowPtr pWin,
+ RegionPtr prgn,
+ RegionPtr bsreg);
+
+extern void DRICopyWindow(WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc);
+
+extern int DRIValidateTree(WindowPtr pParent,
+ WindowPtr pChild,
+ VTKind kind);
+
+extern void DRIPostValidateTree(WindowPtr pParent,
+ WindowPtr pChild,
+ VTKind kind);
+
+extern void DRIClipNotify(WindowPtr pWin,
+ int dx,
+ int dy);
+
+extern CARD32 DRIGetDrawableIndex(WindowPtr pWin);
+
+extern void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg);
+
+extern void DRILock(ScreenPtr pScreen, int flags);
+
+extern void DRIUnlock(ScreenPtr pScreen);
+
+extern DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
+
+extern void *DRIGetSAREAPrivate(ScreenPtr pScreen);
+
+extern unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
+ CARD32 drawable_index);
+
+extern DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
+ drmContextPtr pHWContext,
+ DRIContextFlags flags);
+
+extern DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr pScreen,
+ drmContext hHWContext,
+ DRIContextFlags flags);
+
+extern Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
+
+extern drmContext DRIGetContext(ScreenPtr pScreen);
+
+extern void DRIQueryVersion(int *majorVersion,
+ int *minorVersion,
+ int *patchVersion);
+
+extern void DRIAdjustFrame(int scrnIndex, int x, int y, int flags);
+
+extern int DRIOpenFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable);
+extern int DRICloseFullScreen(ScreenPtr pScreen, DrawablePtr pDrawable);
+
+extern void DRIMoveBuffersHelper(ScreenPtr pScreen,
+ int dx,
+ int dy,
+ int *xdir,
+ int *ydir,
+ RegionPtr reg);
+
+#define _DRI_H_
+
+#endif
diff --git a/hw/xfree86/dri/drimodule.c b/hw/xfree86/dri/drimodule.c
new file mode 100644
index 000000000..bb7a89ee0
--- /dev/null
+++ b/hw/xfree86/dri/drimodule.c
@@ -0,0 +1,121 @@
+/**************************************************************************
+
+Copyright 1999 Precision Insight, 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 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.
+
+**************************************************************************/
+/* $XFree86: xc/programs/Xserver/GL/dri/drimodule.c,v 1.6 2001/12/10 19:07:19 dawes Exp $ */
+
+/*
+ * Authors:
+ * Kevin E. Martin <kevin@precisioninsight.com>
+ * Rickard E. Faith <faith@precisioninsight.com>
+ *
+ */
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(driSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "dri",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+extern void XFree86DRIExtensionInit(INITARGS);
+#define _XF86DRI_SERVER_
+#include "xf86dristr.h"
+
+ExtensionModule XF86DRIExt =
+{
+ XFree86DRIExtensionInit,
+ XF86DRINAME,
+ NULL,
+ NULL,
+ NULL
+};
+
+static const char *drmSymbols[] = {
+ "drmAddContextTag",
+ "drmAddMap",
+ "drmAuthMagic",
+ "drmAvailable",
+ "drmClose",
+ "drmCreateContext",
+ "drmCreateDrawable",
+ "drmDelContextTag",
+ "drmDestroyContext",
+ "drmDestroyDrawable",
+ "drmFreeReservedContextList",
+ "drmGetContextTag",
+ "drmGetLock",
+ "drmGetReservedContextList",
+ "drmInstallSIGIOHandler",
+ "drmMap",
+ "drmOpen",
+ "drmRemoveSIGIOHandler",
+ "drmSetBusid",
+ "drmSetContextFlags",
+ "drmUnlock",
+ "drmUnmap",
+ NULL
+};
+
+XF86ModuleData driModuleData = { &VersRec, driSetup, NULL };
+
+static pointer
+driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+ pointer drm = NULL;
+
+ if (!setupDone) {
+ setupDone = TRUE;
+
+ drm =
+ LoadSubModule(module, "drm", NULL, NULL, NULL, NULL, errmaj, errmin);
+
+ if (!drm) {
+ if (errmaj) *errmaj = LDR_NOSUBENT;
+ }
+ else {
+ LoaderReqSymLists(drmSymbols, NULL);
+ LoaderRefSymbols("noPanoramiXExtension", NULL);
+ LoadExtension(&XF86DRIExt, FALSE);
+ }
+ } else {
+ if (errmaj) *errmaj = LDR_ONCEONLY;
+ }
+ /* Need a non-NULL return value to indicate success */
+ return drm;
+}
+
diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h
new file mode 100644
index 000000000..e733ac210
--- /dev/null
+++ b/hw/xfree86/dri/dristruct.h
@@ -0,0 +1,104 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/dristruct.h,v 1.13 2002/11/20 18:10:24 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, 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 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:
+ * Jens Owen <jens@tungstengraphics.com>
+ *
+ */
+
+#ifndef DRI_STRUCT_H
+#define DRI_STRUCT_H
+
+#include "xf86drm.h"
+
+
+#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \
+ ((DRIWindowPrivIndex < 0) ? \
+ NULL : \
+ ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr)))
+
+#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \
+ ((DRIPixmapPrivIndex < 0) ? \
+ NULL : \
+ ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr)))
+
+typedef struct _DRIDrawablePrivRec
+{
+ drmDrawable hwDrawable;
+ int drawableIndex;
+ ScreenPtr pScreen;
+ int refCount;
+} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
+
+struct _DRIContextPrivRec
+{
+ drmContext hwContext;
+ ScreenPtr pScreen;
+ Bool valid3D;
+ DRIContextFlags flags;
+ void** pContextStore;
+};
+
+#define DRI_SCREEN_PRIV(pScreen) \
+ ((DRIScreenPrivIndex < 0) ? \
+ NULL : \
+ ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr)))
+
+#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
+ (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr))
+
+
+typedef struct _DRIScreenPrivRec
+{
+ Bool directRenderingSupport;
+ int drmFD; /* File descriptor for /dev/video/? */
+ drmHandle hSAREA; /* Handle to SAREA, for mapping */
+ XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
+ drmHandle hFrameBuffer; /* Handle to framebuffer, for mapping */
+ drmContext myContext; /* DDX Driver's context */
+ DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */
+ DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
+ void** hiddenContextStore; /* hidden X context */
+ void** partial3DContextStore; /* parital 3D context */
+ DRIInfoPtr pDriverInfo;
+ int nrWindows;
+ XF86DRIClipRectRec private_buffer_rect; /* management of private buffers */
+ DrawablePtr fullscreen; /* pointer to fullscreen drawable */
+ XF86DRIClipRectRec fullscreen_rect; /* fake rect for fullscreen mode */
+ DRIWrappedFuncsRec wrap;
+ DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
+ DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
+ Bool createDummyCtx;
+ Bool createDummyCtxPriv;
+ Bool grabbedDRILock;
+ Bool drmSIGIOHandlerInstalled;
+ Bool wrapped;
+} DRIScreenPrivRec, *DRIScreenPrivPtr;
+
+#endif /* DRI_STRUCT_H */
diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h
new file mode 100644
index 000000000..99c04b9e9
--- /dev/null
+++ b/hw/xfree86/dri/sarea.h
@@ -0,0 +1,80 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, 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 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 <kevin@precisioninsight.com>
+ * Jens Owen <jens@tungstengraphics.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifndef _SAREA_H_
+#define _SAREA_H_
+
+#include "xf86drm.h"
+
+/* SAREA area needs to be at least a page */
+#if defined(__alpha__)
+#define SAREA_MAX 0x2000
+#elif defined(__ia64__)
+#define SAREA_MAX 0x10000 /* 64kB */
+#else
+/* Intel 830M driver needs at least 8k SAREA */
+#define SAREA_MAX 0x2000
+#endif
+
+#define SAREA_MAX_DRAWABLES 256
+
+#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
+
+typedef struct _XF86DRISAREADrawable {
+ unsigned int stamp;
+ unsigned int flags;
+} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
+
+typedef struct _XF86DRISAREAFrame {
+ unsigned int x;
+ unsigned int y;
+ unsigned int width;
+ unsigned int height;
+ unsigned int fullscreen;
+} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
+
+typedef struct _XF86DRISAREA {
+ /* first thing is always the drm locking structure */
+ drmLock lock;
+ /* NOT_DONE: Use readers/writer lock for drawable_lock */
+ drmLock drawable_lock;
+ XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
+ XF86DRISAREAFrameRec frame;
+ drmContext dummy_context;
+} XF86DRISAREARec, *XF86DRISAREAPtr;
+
+#endif
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
new file mode 100644
index 000000000..7920b217d
--- /dev/null
+++ b/hw/xfree86/dri/xf86dri.c
@@ -0,0 +1,710 @@
+/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.12 2002/12/14 01:36:08 dawes Exp $ */
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, 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 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>
+ * Jens Owen <jens@tungstengraphics.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifdef XFree86LOADER
+#include "xf86.h"
+#include "xf86_ansic.h"
+#endif
+
+#define NEED_REPLIES
+#define NEED_EVENTS
+#include "X.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+#define _XF86DRI_SERVER_
+#include "xf86dristr.h"
+#include "swaprep.h"
+#include "dri.h"
+#include "sarea.h"
+#include "dristruct.h"
+#include "xf86.h"
+#include "xf86drm.h"
+
+static int DRIErrorBase;
+
+static DISPATCH_PROC(ProcXF86DRIQueryVersion);
+static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
+static DISPATCH_PROC(ProcXF86DRIOpenConnection);
+static DISPATCH_PROC(ProcXF86DRICloseConnection);
+static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
+static DISPATCH_PROC(ProcXF86DRICreateContext);
+static DISPATCH_PROC(ProcXF86DRIDestroyContext);
+static DISPATCH_PROC(ProcXF86DRICreateDrawable);
+static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
+static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
+static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
+static DISPATCH_PROC(ProcXF86DRIDispatch);
+static DISPATCH_PROC(ProcXF86DRIAuthConnection);
+static DISPATCH_PROC(ProcXF86DRIOpenFullScreen);
+static DISPATCH_PROC(ProcXF86DRICloseFullScreen);
+
+static DISPATCH_PROC(SProcXF86DRIQueryVersion);
+static DISPATCH_PROC(SProcXF86DRIDispatch);
+
+static void XF86DRIResetProc(ExtensionEntry* extEntry);
+
+static unsigned char DRIReqCode = 0;
+
+extern void XFree86DRIExtensionInit(void);
+
+void
+XFree86DRIExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+#ifdef XF86DRI_EVENTS
+ EventType = CreateNewResourceType(XF86DRIFreeEvents);
+#endif
+
+ if (
+ DRIExtensionInit() &&
+#ifdef XF86DRI_EVENTS
+ EventType && ScreenPrivateIndex != -1 &&
+#endif
+ (extEntry = AddExtension(XF86DRINAME,
+ XF86DRINumberEvents,
+ XF86DRINumberErrors,
+ ProcXF86DRIDispatch,
+ SProcXF86DRIDispatch,
+ XF86DRIResetProc,
+ StandardMinorOpcode))) {
+ DRIReqCode = (unsigned char)extEntry->base;
+ DRIErrorBase = extEntry->errorBase;
+ }
+}
+
+/*ARGSUSED*/
+static void
+XF86DRIResetProc (
+ ExtensionEntry* extEntry
+)
+{
+ DRIReset();
+}
+
+static int
+ProcXF86DRIQueryVersion(
+ register ClientPtr client
+)
+{
+ xXF86DRIQueryVersionReply rep;
+ register int n;
+
+ REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = XF86DRI_MAJOR_VERSION;
+ rep.minorVersion = XF86DRI_MINOR_VERSION;
+ rep.patchVersion = XF86DRI_PATCH_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber, n);
+ swapl(&rep.length, n);
+ }
+ WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIQueryDirectRenderingCapable(
+ register ClientPtr client
+)
+{
+ xXF86DRIQueryDirectRenderingCapableReply rep;
+ Bool isCapable;
+
+ REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
+ REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen],
+ &isCapable)) {
+ return BadValue;
+ }
+ rep.isCapable = isCapable;
+
+ if (!LocalClient(client))
+ rep.isCapable = 0;
+
+ WriteToClient(client,
+ sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIOpenConnection(
+ register ClientPtr client
+)
+{
+ xXF86DRIOpenConnectionReply rep;
+ drmHandle hSAREA;
+ char* busIdString;
+
+ REQUEST(xXF86DRIOpenConnectionReq);
+ REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ if (!DRIOpenConnection( screenInfo.screens[stuff->screen],
+ &hSAREA,
+ &busIdString)) {
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.busIdStringLength = 0;
+ if (busIdString)
+ rep.busIdStringLength = strlen(busIdString);
+ rep.length = (SIZEOF(xXF86DRIOpenConnectionReply) - SIZEOF(xGenericReply) +
+ ((rep.busIdStringLength + 3) & ~3)) >> 2;
+
+ rep.hSAREALow = (CARD32)(hSAREA & 0xffffffff);
+#ifdef LONG64
+ rep.hSAREAHigh = (CARD32)(hSAREA >> 32);
+#else
+ rep.hSAREAHigh = 0;
+#endif
+
+ WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep);
+ if (rep.busIdStringLength)
+ WriteToClient(client, rep.busIdStringLength, busIdString);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIAuthConnection(
+ register ClientPtr client
+)
+{
+ xXF86DRIAuthConnectionReply rep;
+
+ REQUEST(xXF86DRIAuthConnectionReq);
+ REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.authenticated = 1;
+
+ if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
+ ErrorF("Failed to authenticate %u\n", stuff->magic);
+ rep.authenticated = 0;
+ }
+ WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRICloseConnection(
+ register ClientPtr client
+)
+{
+ REQUEST(xXF86DRICloseConnectionReq);
+ REQUEST_SIZE_MATCH(xXF86DRICloseConnectionReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ DRICloseConnection( screenInfo.screens[stuff->screen]);
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIGetClientDriverName(
+ register ClientPtr client
+)
+{
+ xXF86DRIGetClientDriverNameReply rep;
+ char* clientDriverName;
+
+ REQUEST(xXF86DRIGetClientDriverNameReq);
+ REQUEST_SIZE_MATCH(xXF86DRIGetClientDriverNameReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ DRIGetClientDriverName( screenInfo.screens[stuff->screen],
+ (int *)&rep.ddxDriverMajorVersion,
+ (int *)&rep.ddxDriverMinorVersion,
+ (int *)&rep.ddxDriverPatchVersion,
+ &clientDriverName);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.clientDriverNameLength = 0;
+ if (clientDriverName)
+ rep.clientDriverNameLength = strlen(clientDriverName);
+ rep.length = (SIZEOF(xXF86DRIGetClientDriverNameReply) -
+ SIZEOF(xGenericReply) +
+ ((rep.clientDriverNameLength + 3) & ~3)) >> 2;
+
+ WriteToClient(client,
+ sizeof(xXF86DRIGetClientDriverNameReply), (char *)&rep);
+ if (rep.clientDriverNameLength)
+ WriteToClient(client,
+ rep.clientDriverNameLength,
+ clientDriverName);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRICreateContext(
+ register ClientPtr client
+)
+{
+ xXF86DRICreateContextReply rep;
+ ScreenPtr pScreen;
+ VisualPtr visual;
+ int i;
+
+ REQUEST(xXF86DRICreateContextReq);
+ REQUEST_SIZE_MATCH(xXF86DRICreateContextReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ pScreen = screenInfo.screens[stuff->screen];
+ visual = pScreen->visuals;
+
+ /* Find the requested X visual */
+ for (i = 0; i < pScreen->numVisuals; i++, visual++)
+ if (visual->vid == stuff->visual)
+ break;
+ if (i == pScreen->numVisuals) {
+ /* No visual found */
+ return BadValue;
+ }
+
+ if (!DRICreateContext( pScreen,
+ visual,
+ stuff->context,
+ (drmContextPtr)&rep.hHWContext)) {
+ return BadValue;
+ }
+
+ WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIDestroyContext(
+ register ClientPtr client
+)
+{
+ REQUEST(xXF86DRIDestroyContextReq);
+ REQUEST_SIZE_MATCH(xXF86DRIDestroyContextReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ if (!DRIDestroyContext( screenInfo.screens[stuff->screen],
+ stuff->context)) {
+ return BadValue;
+ }
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRICreateDrawable(
+ ClientPtr client
+)
+{
+ xXF86DRICreateDrawableReply rep;
+ DrawablePtr pDrawable;
+
+ REQUEST(xXF86DRICreateDrawableReq);
+ REQUEST_SIZE_MATCH(xXF86DRICreateDrawableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
+ (Drawable)stuff->drawable,
+ client,
+ SecurityReadAccess))) {
+ return BadValue;
+ }
+
+ if (!DRICreateDrawable( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable,
+ pDrawable,
+ (drmDrawablePtr)&rep.hHWDrawable)) {
+ return BadValue;
+ }
+
+ WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIDestroyDrawable(
+ register ClientPtr client
+)
+{
+ REQUEST(xXF86DRIDestroyDrawableReq);
+ DrawablePtr pDrawable;
+ REQUEST_SIZE_MATCH(xXF86DRIDestroyDrawableReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
+ (Drawable)stuff->drawable,
+ client,
+ SecurityReadAccess))) {
+ return BadValue;
+ }
+
+ if (!DRIDestroyDrawable( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable,
+ pDrawable)) {
+ return BadValue;
+ }
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIGetDrawableInfo(
+ register ClientPtr client
+)
+{
+ xXF86DRIGetDrawableInfoReply rep;
+ DrawablePtr pDrawable;
+ int X, Y, W, H;
+ XF86DRIClipRectPtr pClipRects;
+ XF86DRIClipRectPtr pBackClipRects;
+ int backX, backY;
+
+ REQUEST(xXF86DRIGetDrawableInfoReq);
+ REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!(pDrawable = (DrawablePtr)SecurityLookupDrawable(
+ (Drawable)stuff->drawable,
+ client,
+ SecurityReadAccess))) {
+ return BadValue;
+ }
+
+ if (!DRIGetDrawableInfo( screenInfo.screens[stuff->screen],
+ pDrawable,
+ (unsigned int*)&rep.drawableTableIndex,
+ (unsigned int*)&rep.drawableTableStamp,
+ (int*)&X,
+ (int*)&Y,
+ (int*)&W,
+ (int*)&H,
+ (int*)&rep.numClipRects,
+ &pClipRects,
+ &backX,
+ &backY,
+ (int*)&rep.numBackClipRects,
+ &pBackClipRects)) {
+ return BadValue;
+ }
+
+ rep.drawableX = X;
+ rep.drawableY = Y;
+ rep.drawableWidth = W;
+ rep.drawableHeight = H;
+ rep.length = (SIZEOF(xXF86DRIGetDrawableInfoReply) -
+ SIZEOF(xGenericReply));
+
+ rep.backX = backX;
+ rep.backY = backY;
+
+ if (rep.numBackClipRects)
+ rep.length += sizeof(XF86DRIClipRectRec) * rep.numBackClipRects;
+
+ if (rep.numClipRects)
+ rep.length += sizeof(XF86DRIClipRectRec) * rep.numClipRects;
+
+ rep.length = ((rep.length + 3) & ~3) >> 2;
+
+ WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *)&rep);
+
+ if (rep.numClipRects) {
+ WriteToClient(client,
+ sizeof(XF86DRIClipRectRec) * rep.numClipRects,
+ (char *)pClipRects);
+ }
+
+ if (rep.numBackClipRects) {
+ WriteToClient(client,
+ sizeof(XF86DRIClipRectRec) * rep.numBackClipRects,
+ (char *)pBackClipRects);
+ }
+
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIGetDeviceInfo(
+ register ClientPtr client
+)
+{
+ xXF86DRIGetDeviceInfoReply rep;
+ drmHandle hFrameBuffer;
+ void *pDevPrivate;
+
+ REQUEST(xXF86DRIGetDeviceInfoReq);
+ REQUEST_SIZE_MATCH(xXF86DRIGetDeviceInfoReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DRIGetDeviceInfo( screenInfo.screens[stuff->screen],
+ &hFrameBuffer,
+ (int*)&rep.framebufferOrigin,
+ (int*)&rep.framebufferSize,
+ (int*)&rep.framebufferStride,
+ (int*)&rep.devPrivateSize,
+ &pDevPrivate)) {
+ return BadValue;
+ }
+
+ rep.hFrameBufferLow = (CARD32)(hFrameBuffer & 0xffffffff);
+#ifdef LONG64
+ rep.hFrameBufferHigh = (CARD32)(hFrameBuffer >> 32);
+#else
+ rep.hFrameBufferHigh = 0;
+#endif
+
+ rep.length = 0;
+ if (rep.devPrivateSize) {
+ rep.length = (SIZEOF(xXF86DRIGetDeviceInfoReply) -
+ SIZEOF(xGenericReply) +
+ ((rep.devPrivateSize + 3) & ~3)) >> 2;
+ }
+
+ WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *)&rep);
+ if (rep.length) {
+ WriteToClient(client, rep.devPrivateSize, (char *)pDevPrivate);
+ }
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIOpenFullScreen (
+ register ClientPtr client
+)
+{
+ REQUEST(xXF86DRIOpenFullScreenReq);
+ xXF86DRIOpenFullScreenReply rep;
+ DrawablePtr pDrawable;
+
+ REQUEST_SIZE_MATCH(xXF86DRIOpenFullScreenReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!(pDrawable = SecurityLookupDrawable(stuff->drawable,
+ client,
+ SecurityReadAccess)))
+ return BadValue;
+
+ rep.isFullScreen = DRIOpenFullScreen(screenInfo.screens[stuff->screen],
+ pDrawable);
+
+ WriteToClient(client, sizeof(xXF86DRIOpenFullScreenReply), (char *)&rep);
+ return client->noClientException;
+}
+
+static int
+ProcXF86DRICloseFullScreen (
+ register ClientPtr client
+)
+{
+ REQUEST(xXF86DRICloseFullScreenReq);
+ xXF86DRICloseFullScreenReply rep;
+ DrawablePtr pDrawable;
+
+ REQUEST_SIZE_MATCH(xXF86DRICloseFullScreenReq);
+ if (stuff->screen >= screenInfo.numScreens) {
+ client->errorValue = stuff->screen;
+ return BadValue;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!(pDrawable = SecurityLookupDrawable(stuff->drawable,
+ client,
+ SecurityReadAccess)))
+ return BadValue;
+
+ DRICloseFullScreen(screenInfo.screens[stuff->screen], pDrawable);
+
+ WriteToClient(client, sizeof(xXF86DRICloseFullScreenReply), (char *)&rep);
+ return (client->noClientException);
+}
+
+static int
+ProcXF86DRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_XF86DRIQueryVersion:
+ return ProcXF86DRIQueryVersion(client);
+ case X_XF86DRIQueryDirectRenderingCapable:
+ return ProcXF86DRIQueryDirectRenderingCapable(client);
+ }
+
+ if (!LocalClient(client))
+ return DRIErrorBase + XF86DRIClientNotLocal;
+
+ switch (stuff->data)
+ {
+ case X_XF86DRIOpenConnection:
+ return ProcXF86DRIOpenConnection(client);
+ case X_XF86DRICloseConnection:
+ return ProcXF86DRICloseConnection(client);
+ case X_XF86DRIGetClientDriverName:
+ return ProcXF86DRIGetClientDriverName(client);
+ case X_XF86DRICreateContext:
+ return ProcXF86DRICreateContext(client);
+ case X_XF86DRIDestroyContext:
+ return ProcXF86DRIDestroyContext(client);
+ case X_XF86DRICreateDrawable:
+ return ProcXF86DRICreateDrawable(client);
+ case X_XF86DRIDestroyDrawable:
+ return ProcXF86DRIDestroyDrawable(client);
+ case X_XF86DRIGetDrawableInfo:
+ return ProcXF86DRIGetDrawableInfo(client);
+ case X_XF86DRIGetDeviceInfo:
+ return ProcXF86DRIGetDeviceInfo(client);
+ case X_XF86DRIAuthConnection:
+ return ProcXF86DRIAuthConnection(client);
+ case X_XF86DRIOpenFullScreen:
+ return ProcXF86DRIOpenFullScreen(client);
+ case X_XF86DRICloseFullScreen:
+ return ProcXF86DRICloseFullScreen(client);
+ default:
+ return BadRequest;
+ }
+}
+
+static int
+SProcXF86DRIQueryVersion(
+ register ClientPtr client
+)
+{
+ register int n;
+ REQUEST(xXF86DRIQueryVersionReq);
+ swaps(&stuff->length, n);
+ return ProcXF86DRIQueryVersion(client);
+}
+
+static int
+SProcXF86DRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ /* It is bound to be non-local when there is byte swapping */
+ if (!LocalClient(client))
+ return DRIErrorBase + XF86DRIClientNotLocal;
+
+ /* only local clients are allowed DRI access */
+ switch (stuff->data)
+ {
+ case X_XF86DRIQueryVersion:
+ return SProcXF86DRIQueryVersion(client);
+ default:
+ return BadRequest;
+ }
+}
diff --git a/hw/xfree86/dummylib/README b/hw/xfree86/dummylib/README
new file mode 100644
index 000000000..8e5b539a6
--- /dev/null
+++ b/hw/xfree86/dummylib/README
@@ -0,0 +1,7 @@
+
+libdummy (dummylib) contains basic utility functions required by libxf86_os.a.
+There is one symbol per source/object so that each can be overriden
+individually by whatever uses this library.
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/dummylib/README,v 1.1 2000/02/13 03:06:38 dawes Exp $
diff --git a/hw/xfree86/dummylib/dummylib.h b/hw/xfree86/dummylib/dummylib.h
new file mode 100644
index 000000000..4b685e272
--- /dev/null
+++ b/hw/xfree86/dummylib/dummylib.h
@@ -0,0 +1,8 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/dummylib.h,v 1.1 2000/02/13 03:06:38 dawes Exp $ */
+
+#ifndef _DUMMY_LIB_H
+#define _DUMMY_LIB_H
+
+extern void VErrorFVerb(int verb, const char *format, va_list ap);
+
+#endif /* _DUMMY_LIB_H */
diff --git a/hw/xfree86/dummylib/fatalerror.c b/hw/xfree86/dummylib/fatalerror.c
new file mode 100644
index 000000000..3c482b480
--- /dev/null
+++ b/hw/xfree86/dummylib/fatalerror.c
@@ -0,0 +1,23 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/fatalerror.c,v 1.1 2000/02/13 03:06:38 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+FatalError(const char *f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ fprintf(stderr, "Fatal Error:\n");
+ vfprintf(stderr, f, args);
+ va_end(args);
+ exit(1);
+}
+
diff --git a/hw/xfree86/dummylib/getvalidbios.c b/hw/xfree86/dummylib/getvalidbios.c
new file mode 100644
index 000000000..a16126842
--- /dev/null
+++ b/hw/xfree86/dummylib/getvalidbios.c
@@ -0,0 +1,16 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c,v 1.3 2001/05/15 10:19:41 eich Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+memType
+getValidBIOSBase(PCITAG tag, int num)
+{
+ return 0;
+}
diff --git a/hw/xfree86/dummylib/pcitestmulti.c b/hw/xfree86/dummylib/pcitestmulti.c
new file mode 100644
index 000000000..4259f678e
--- /dev/null
+++ b/hw/xfree86/dummylib/pcitestmulti.c
@@ -0,0 +1,17 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/pcitestmulti.c,v 1.1 2000/02/13 03:06:39 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+int
+pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag)
+{
+ return 0;
+}
+
diff --git a/hw/xfree86/dummylib/verrorf.c b/hw/xfree86/dummylib/verrorf.c
new file mode 100644
index 000000000..e36a590e7
--- /dev/null
+++ b/hw/xfree86/dummylib/verrorf.c
@@ -0,0 +1,17 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/verrorf.c,v 1.1 2000/02/13 03:06:39 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+VErrorF(const char *f, va_list args)
+{
+ vfprintf(stderr, f, args);
+}
+
diff --git a/hw/xfree86/dummylib/xalloc.c b/hw/xfree86/dummylib/xalloc.c
new file mode 100644
index 000000000..63d3ff8c7
--- /dev/null
+++ b/hw/xfree86/dummylib/xalloc.c
@@ -0,0 +1,92 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xalloc.c,v 1.2 2002/11/09 09:00:13 herrb Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+pointer
+Xalloc(unsigned long n)
+{
+ if (!n)
+ n = 1;
+ return malloc(n);
+}
+
+pointer
+Xrealloc(pointer p, unsigned long n)
+{
+ if (!n)
+ n = 1;
+ return realloc(p, n);
+}
+
+pointer
+Xcalloc(unsigned long n)
+{
+ pointer r;
+
+ r = Xalloc(n);
+ memset(r, 0, n);
+ return r;
+}
+
+pointer
+XNFalloc(unsigned long n)
+{
+ pointer r;
+
+ r = Xalloc(n);
+ if (!r)
+ FatalError("XNFalloc failed\n");
+ return r;
+
+}
+
+pointer
+XNFrealloc(pointer p, unsigned long n)
+{
+ pointer r;
+
+ r = Xrealloc(p, n);
+ if (!r)
+ FatalError("XNFrealloc failed\n");
+ return r;
+
+}
+
+pointer
+XNFcalloc(unsigned long n)
+{
+ pointer r;
+
+ r = Xcalloc(n);
+ if (!r)
+ FatalError("XNFcalloc failed\n");
+ return r;
+
+}
+
+void
+Xfree(pointer p)
+{
+ free(p);
+}
+
+char *
+Xstrdup(const char *s)
+{
+ char *sd;
+
+ if (s == NULL)
+ return NULL;
+
+ sd = (char *)Xalloc(strlen(s) + 1);
+ if (sd != NULL)
+ strcpy(sd, s);
+ return sd;
+}
diff --git a/hw/xfree86/dummylib/xf86addrestolist.c b/hw/xfree86/dummylib/xf86addrestolist.c
new file mode 100644
index 000000000..ea24fc1dc
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86addrestolist.c
@@ -0,0 +1,21 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86addrestolist.c,v 1.3 2002/12/24 15:50:43 tsi Exp $ */
+
+#include "xf86.h"
+
+resPtr
+xf86AddResToList(resPtr rlist, resRange *Range, int entityIndex)
+{
+ return rlist;
+}
+
+void
+xf86FreeResList(resPtr rlist)
+{
+ return;
+}
+
+resPtr
+xf86DupResList(const resPtr rlist)
+{
+ return rlist;
+}
diff --git a/hw/xfree86/dummylib/xf86allocscripi.c b/hw/xfree86/dummylib/xf86allocscripi.c
new file mode 100644
index 000000000..1f61eda4d
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86allocscripi.c
@@ -0,0 +1,17 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86allocscripi.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+int
+xf86AllocateScrnInfoPrivateIndex()
+{
+ return -1;
+}
+
diff --git a/hw/xfree86/dummylib/xf86drvmsg.c b/hw/xfree86/dummylib/xf86drvmsg.c
new file mode 100644
index 000000000..ffcefd6bf
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86drvmsg.c
@@ -0,0 +1,22 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsg.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "dummylib.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+xf86DrvMsg(int i, MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ VErrorFVerb(1, format, ap);
+ va_end(ap);
+}
+
diff --git a/hw/xfree86/dummylib/xf86drvmsgverb.c b/hw/xfree86/dummylib/xf86drvmsgverb.c
new file mode 100644
index 000000000..f59c42abf
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86drvmsgverb.c
@@ -0,0 +1,22 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsgverb.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "dummylib.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+xf86DrvMsgVerb(int i, MessageType type, int verb, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ VErrorFVerb(verb, format, ap);
+ va_end(ap);
+}
+
diff --git a/hw/xfree86/dummylib/xf86errorf.c b/hw/xfree86/dummylib/xf86errorf.c
new file mode 100644
index 000000000..072f639ca
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86errorf.c
@@ -0,0 +1,31 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorf.c,v 1.2 2000/05/31 07:15:05 eich Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "dummylib.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+xf86ErrorF(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ VErrorFVerb(1, format, ap);
+ va_end(ap);
+}
+
+void
+ErrorF(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ VErrorFVerb(1, format, ap);
+ va_end(ap);
+}
diff --git a/hw/xfree86/dummylib/xf86errorfverb.c b/hw/xfree86/dummylib/xf86errorfverb.c
new file mode 100644
index 000000000..61bff15a5
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86errorfverb.c
@@ -0,0 +1,22 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorfverb.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "dummylib.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+xf86ErrorFVerb(int verb, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ VErrorFVerb(verb, format, ap);
+ va_end(ap);
+}
+
diff --git a/hw/xfree86/dummylib/xf86getpagesize.c b/hw/xfree86/dummylib/xf86getpagesize.c
new file mode 100644
index 000000000..51b785a73
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86getpagesize.c
@@ -0,0 +1,19 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86getpagesize.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+int xf86getpagesize(void);
+
+int
+xf86getpagesize(void)
+{
+ return 4096; /* not used */
+}
+
diff --git a/hw/xfree86/dummylib/xf86getverb.c b/hw/xfree86/dummylib/xf86getverb.c
new file mode 100644
index 000000000..a4255698f
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86getverb.c
@@ -0,0 +1,17 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86getverb.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+int
+xf86GetVerbosity()
+{
+ return xf86Verbose;
+}
+
diff --git a/hw/xfree86/dummylib/xf86info.c b/hw/xfree86/dummylib/xf86info.c
new file mode 100644
index 000000000..d7b95b430
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86info.c
@@ -0,0 +1,10 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86info.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/* Dummy variables */
+xf86InfoRec xf86Info = {NULL, };
+
diff --git a/hw/xfree86/dummylib/xf86msg.c b/hw/xfree86/dummylib/xf86msg.c
new file mode 100644
index 000000000..bc8c76626
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86msg.c
@@ -0,0 +1,22 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msg.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "dummylib.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+xf86Msg(MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ VErrorFVerb(1, format, ap);
+ va_end(ap);
+}
+
diff --git a/hw/xfree86/dummylib/xf86msgverb.c b/hw/xfree86/dummylib/xf86msgverb.c
new file mode 100644
index 000000000..b9e343fd9
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86msgverb.c
@@ -0,0 +1,22 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msgverb.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "dummylib.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+xf86MsgVerb(MessageType type, int verb, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ VErrorFVerb(verb, format, ap);
+ va_end(ap);
+}
+
diff --git a/hw/xfree86/dummylib/xf86opt.c b/hw/xfree86/dummylib/xf86opt.c
new file mode 100644
index 000000000..dd00635b0
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86opt.c
@@ -0,0 +1,22 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c,v 1.2 2001/05/04 19:05:50 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+void
+xf86ProcessOptions(int i, pointer p, OptionInfoPtr o)
+{
+}
+
+Bool
+xf86GetOptValBool(const OptionInfoRec *o, int i, Bool *b)
+{
+ return FALSE;
+}
+
diff --git a/hw/xfree86/dummylib/xf86screens.c b/hw/xfree86/dummylib/xf86screens.c
new file mode 100644
index 000000000..031b6e55a
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86screens.c
@@ -0,0 +1,10 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86screens.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/* Dummy variables */
+ScrnInfoPtr *xf86Screens = NULL;
+
diff --git a/hw/xfree86/dummylib/xf86servisinit.c b/hw/xfree86/dummylib/xf86servisinit.c
new file mode 100644
index 000000000..8339c658b
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86servisinit.c
@@ -0,0 +1,17 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86servisinit.c,v 1.1 2000/02/13 03:06:43 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/*
+ * Utility functions required by libxf86_os.
+ */
+
+Bool
+xf86ServerIsInitialising()
+{
+ return FALSE;
+}
+
diff --git a/hw/xfree86/dummylib/xf86verbose.c b/hw/xfree86/dummylib/xf86verbose.c
new file mode 100644
index 000000000..877bd6fd7
--- /dev/null
+++ b/hw/xfree86/dummylib/xf86verbose.c
@@ -0,0 +1,10 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86verbose.c,v 1.1 2000/02/13 03:06:43 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+/* Dummy variables */
+int xf86Verbose = 0;
+
diff --git a/hw/xfree86/fbdevhw/README b/hw/xfree86/fbdevhw/README
new file mode 100644
index 000000000..27cc337d4
--- /dev/null
+++ b/hw/xfree86/fbdevhw/README
@@ -0,0 +1,16 @@
+
+This is a submodule to access linux framebuffer devices.
+It is supported to work as helper module (like vgahw)
+for the chipset drivers. There are functions for
+saving/restoring/setting video modes, set palette entries,
+and a few more helper functions. Some of them can be
+hooked directly into ScrnInfoRec.
+
+In ../drivers/fbdev is a "chipset" driver. It is a simple,
+non-accelerated and hardware-independent driver which works
+on top of this fbdevhw submodule.
+
+ Gerd
+
+--
+Gerd Knorr <kraxel@goldbach.in-berlin.de>
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
new file mode 100644
index 000000000..a90fff34c
--- /dev/null
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -0,0 +1,870 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c,v 1.30 2002/11/25 14:05:00 eich Exp $ */
+
+/* all driver need this */
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+
+/* pci stuff */
+#include "xf86PciInfo.h"
+#include "xf86Pci.h"
+
+#include "xf86cmap.h"
+
+#include "fbdevhw.h"
+#include "fbpriv.h"
+
+#include "asm/page.h" /* #define for PAGE_* */
+
+#include "globals.h"
+#define DPMS_SERVER
+#include "extensions/dpms.h"
+
+#define DEBUG 0
+
+#if DEBUG
+# define TRACE_ENTER(str) ErrorF("fbdevHW: " str " %d\n",pScrn->scrnIndex)
+#else
+# define TRACE_ENTER(str)
+#endif
+
+/* -------------------------------------------------------------------- */
+
+#ifdef XFree86LOADER
+
+static MODULESETUPPROTO(fbdevhwSetup);
+
+static XF86ModuleVersionInfo fbdevHWVersRec =
+{
+ "fbdevhw",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 0, 0, 2,
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData fbdevhwModuleData = { &fbdevHWVersRec, fbdevhwSetup, NULL };
+
+static pointer
+fbdevhwSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ const char *osname;
+
+ /* Check that we're being loaded on a Linux system */
+ LoaderGetOS(&osname, NULL, NULL, NULL);
+ if (!osname || strcmp(osname, "linux") != 0) {
+ if (errmaj)
+ *errmaj = LDR_BADOS;
+ if (errmin)
+ *errmin = 0;
+ return NULL;
+ } else {
+ /* OK */
+ return (pointer)1;
+ }
+}
+
+#else /* XFree86LOADER */
+
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/mman.h>
+
+#endif /* XFree86LOADER */
+
+/* -------------------------------------------------------------------- */
+/* our private data, and two functions to allocate/free this */
+
+#define FBDEVHWPTRLVAL(p) (p)->privates[fbdevHWPrivateIndex].ptr
+#define FBDEVHWPTR(p) ((fbdevHWPtr)(FBDEVHWPTRLVAL(p)))
+
+static int fbdevHWPrivateIndex = -1;
+
+typedef struct {
+ /* framebuffer device: filename (/dev/fb*), handle, more */
+ char* device;
+ int fd;
+ void* fbmem;
+ unsigned int fbmem_len;
+ unsigned int fboff;
+ char* mmio;
+ unsigned int mmio_len;
+
+ /* current hardware state */
+ struct fb_fix_screeninfo fix;
+ struct fb_var_screeninfo var;
+
+ /* saved video mode */
+ struct fb_var_screeninfo saved_var;
+
+ /* FIXME: unused??? [geert] */
+ struct fb_cmap saved_cmap;
+ unsigned short *saved_red;
+ unsigned short *saved_green;
+ unsigned short *saved_blue;
+
+ /* buildin video mode */
+ DisplayModeRec buildin;
+
+} fbdevHWRec, *fbdevHWPtr;
+
+Bool
+fbdevHWGetRec(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr;
+
+ if (fbdevHWPrivateIndex < 0)
+ fbdevHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
+
+ if (FBDEVHWPTR(pScrn) != NULL)
+ return TRUE;
+
+ fPtr = FBDEVHWPTRLVAL(pScrn) = xnfcalloc(sizeof(fbdevHWRec), 1);
+ return TRUE;
+}
+
+void
+fbdevHWFreeRec(ScrnInfoPtr pScrn)
+{
+ if (fbdevHWPrivateIndex < 0)
+ return;
+ if (FBDEVHWPTR(pScrn) == NULL)
+ return;
+ xfree(FBDEVHWPTR(pScrn));
+ FBDEVHWPTRLVAL(pScrn) = NULL;
+}
+
+/* -------------------------------------------------------------------- */
+/* some helpers for printing debug informations */
+
+#if DEBUG
+static void
+print_fbdev_mode(char *txt, struct fb_var_screeninfo *var)
+{
+ ErrorF( "fbdev %s mode:\t%d %d %d %d %d %d %d %d %d %d %d:%d:%d\n",
+ txt,var->pixclock,
+ var->xres, var->right_margin, var->hsync_len, var->left_margin,
+ var->yres, var->lower_margin, var->vsync_len, var->upper_margin,
+ var->bits_per_pixel,
+ var->red.length, var->green.length, var->blue.length);
+}
+
+static void
+print_xfree_mode(char *txt, DisplayModePtr mode)
+{
+ ErrorF( "xfree %s mode:\t%d %d %d %d %d %d %d %d %d\n",
+ txt,mode->Clock,
+ mode->HDisplay, mode->HSyncStart, mode->HSyncEnd, mode->HTotal,
+ mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, mode->VTotal);
+}
+#endif
+
+/* -------------------------------------------------------------------- */
+/* Convert timings between the XFree and the Frame Buffer Device */
+
+static void
+xfree2fbdev_fblayout(ScrnInfoPtr pScrn, struct fb_var_screeninfo *var)
+{
+ var->xres_virtual = pScrn->virtualX;
+ var->yres_virtual = pScrn->virtualY;
+ var->bits_per_pixel = pScrn->bitsPerPixel;
+ var->red.length = pScrn->weight.red;
+ var->green.length = pScrn->weight.green;
+ var->blue.length = pScrn->weight.blue;
+}
+
+static void
+xfree2fbdev_timing(DisplayModePtr mode, struct fb_var_screeninfo *var)
+{
+ var->xres = mode->HDisplay;
+ var->yres = mode->VDisplay;
+ if (var->xres_virtual < var->xres)
+ var->xres_virtual = var->xres;
+ if (var->yres_virtual < var->yres)
+ var->yres_virtual = var->yres;
+ var->xoffset = var->yoffset = 0;
+ var->pixclock = mode->Clock ? 1000000000/mode->Clock : 0;
+ var->right_margin = mode->HSyncStart-mode->HDisplay;
+ var->hsync_len = mode->HSyncEnd-mode->HSyncStart;
+ var->left_margin = mode->HTotal-mode->HSyncEnd;
+ var->lower_margin = mode->VSyncStart-mode->VDisplay;
+ var->vsync_len = mode->VSyncEnd-mode->VSyncStart;
+ var->upper_margin = mode->VTotal-mode->VSyncEnd;
+ var->sync = 0;
+ if (mode->Flags & V_PHSYNC)
+ var->sync |= FB_SYNC_HOR_HIGH_ACT;
+ if (mode->Flags & V_PVSYNC)
+ var->sync |= FB_SYNC_VERT_HIGH_ACT;
+ if (mode->Flags & V_PCSYNC)
+ var->sync |= FB_SYNC_COMP_HIGH_ACT;
+#if 1 /* Badly needed for PAL/NTSC on Amiga (amifb)!! [geert] */
+ if (mode->Flags & V_BCAST)
+ var->sync |= FB_SYNC_BROADCAST;
+#endif
+ if (mode->Flags & V_INTERLACE)
+ var->vmode = FB_VMODE_INTERLACED;
+ else if (mode->Flags & V_DBLSCAN)
+ var->vmode = FB_VMODE_DOUBLE;
+ else
+ var->vmode = FB_VMODE_NONINTERLACED;
+}
+
+static void
+fbdev2xfree_timing(struct fb_var_screeninfo *var, DisplayModePtr mode)
+{
+ mode->Clock = var->pixclock ? 1000000000/var->pixclock : 28000000;
+ mode->HDisplay = var->xres;
+ mode->HSyncStart = mode->HDisplay+var->right_margin;
+ mode->HSyncEnd = mode->HSyncStart+var->hsync_len;
+ mode->HTotal = mode->HSyncEnd+var->left_margin;
+ mode->VDisplay = var->yres;
+ mode->VSyncStart = mode->VDisplay+var->lower_margin;
+ mode->VSyncEnd = mode->VSyncStart+var->vsync_len;
+ mode->VTotal = mode->VSyncEnd+var->upper_margin;
+ mode->Flags = 0;
+ mode->Flags |= var->sync & FB_SYNC_HOR_HIGH_ACT ? V_PHSYNC : V_NHSYNC;
+ mode->Flags |= var->sync & FB_SYNC_VERT_HIGH_ACT ? V_PVSYNC : V_NVSYNC;
+ mode->Flags |= var->sync & FB_SYNC_COMP_HIGH_ACT ? V_PCSYNC : V_NCSYNC;
+#if 1 /* Badly needed for PAL/NTSC on Amiga (amifb)!! [geert] */
+ if (var->sync & FB_SYNC_BROADCAST)
+ mode->Flags |= V_BCAST;
+#endif
+ if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED)
+ mode->Flags |= V_INTERLACE;
+ else if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE)
+ mode->Flags |= V_DBLSCAN;
+ mode->SynthClock = mode->Clock;
+ mode->CrtcHDisplay = mode->HDisplay;
+ mode->CrtcHSyncStart = mode->HSyncStart;
+ mode->CrtcHSyncEnd = mode->HSyncEnd;
+ mode->CrtcHTotal = mode->HTotal;
+ mode->CrtcVDisplay = mode->VDisplay;
+ mode->CrtcVSyncStart = mode->VSyncStart;
+ mode->CrtcVSyncEnd = mode->VSyncEnd;
+ mode->CrtcVTotal = mode->VTotal;
+ mode->CrtcHAdjusted = FALSE;
+ mode->CrtcVAdjusted = FALSE;
+}
+
+
+/* -------------------------------------------------------------------- */
+/* open correct framebuffer device */
+
+/* try to find the framebuffer device for a given PCI device */
+static int
+fbdev_open_pci(pciVideoPtr pPci, char **namep)
+{
+ struct fb_fix_screeninfo fix;
+ char filename[16];
+ int fd,i,j;
+ memType res_start, res_end;
+
+ for (i = 0; i < 8; i++) {
+ sprintf(filename,"/dev/fb%d",i);
+ if (-1 == (fd = open(filename,O_RDWR,0))) {
+ xf86DrvMsg(-1, X_WARNING,
+ "open %s: %s\n", filename, strerror(errno));
+ continue;
+ }
+ if (-1 == ioctl(fd,FBIOGET_FSCREENINFO,(void*)&fix)) {
+ close(fd);
+ continue;
+ }
+ for (j = 0; j < 6; j++) {
+ res_start = pPci->memBase[j];
+ res_end = res_start+pPci->size[j];
+ if ((0 != fix.smem_len &&
+ (memType) fix.smem_start >= res_start &&
+ (memType) fix.smem_start < res_end) ||
+ (0 != fix.mmio_len &&
+ (memType) fix.mmio_start >= res_start &&
+ (memType) fix.mmio_start < res_end))
+ break;
+ }
+ if (j == 6) {
+ close(fd);
+ continue;
+ }
+ if (namep) {
+ *namep = xnfalloc(16);
+ strncpy(*namep,fix.id,16);
+ }
+ return fd;
+ }
+ if (namep)
+ *namep = NULL;
+ return -1;
+}
+
+static int
+fbdev_open(int scrnIndex, char *dev, char** namep)
+{
+ struct fb_fix_screeninfo fix;
+ int fd;
+
+ /* try argument (from XF86Config) first */
+ if (dev) {
+ fd = open(dev,O_RDWR,0);
+ } else {
+ /* second: environment variable */
+ dev = getenv("FRAMEBUFFER");
+ if ((NULL == dev) || ((fd = open(dev,O_RDWR,0)) == -1)) {
+ /* last try: default device */
+ dev = "/dev/fb0";
+ fd = open(dev,O_RDWR,0);
+ }
+ }
+
+ if (fd == -1) {
+ xf86DrvMsg(scrnIndex, X_ERROR,
+ "open %s: %s\n", dev, strerror(errno));
+ return -1;
+ }
+
+ if (namep) {
+ if (-1 == ioctl(fd,FBIOGET_FSCREENINFO,(void*)(&fix))) {
+ *namep = NULL;
+ xf86DrvMsg(scrnIndex, X_ERROR,
+ "FBIOGET_FSCREENINFO: %s\n", strerror(errno));
+ return -1;
+ } else {
+ *namep = xnfalloc(16);
+ strncpy(*namep,fix.id,16);
+ }
+ }
+ return fd;
+}
+
+/* -------------------------------------------------------------------- */
+
+Bool
+fbdevHWProbe(pciVideoPtr pPci, char *device,char **namep)
+{
+ int fd;
+
+ if (pPci)
+ fd = fbdev_open_pci(pPci,namep);
+ else
+ fd = fbdev_open(-1,device,namep);
+
+ if (-1 == fd)
+ return FALSE;
+ close(fd);
+ return TRUE;
+}
+
+Bool
+fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device)
+{
+ fbdevHWPtr fPtr;
+
+ TRACE_ENTER("Init");
+
+ fbdevHWGetRec(pScrn);
+ fPtr = FBDEVHWPTR(pScrn);
+
+ /* open device */
+ if (pPci)
+ fPtr->fd = fbdev_open_pci(pPci,NULL);
+ else
+ fPtr->fd = fbdev_open(pScrn->scrnIndex,device,NULL);
+ if (-1 == fPtr->fd) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Failed to open framebuffer device, consult warnings"
+ " and/or errors above for possible reasons\n"
+ "\t(you may have to look at the server log to see"
+ " warnings)\n");
+ return FALSE;
+ }
+
+ /* get current fb device settings */
+ if (-1 == ioctl(fPtr->fd,FBIOGET_FSCREENINFO,(void*)(&fPtr->fix))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "ioctl FBIOGET_FSCREENINFO: %s\n",
+ strerror(errno));
+ return FALSE;
+ }
+ if (-1 == ioctl(fPtr->fd,FBIOGET_VSCREENINFO,(void*)(&fPtr->var))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "ioctl FBIOGET_VSCREENINFO: %s\n",
+ strerror(errno));
+ return FALSE;
+ }
+
+ /* we can use the current settings as "buildin mode" */
+ fbdev2xfree_timing(&fPtr->var, &fPtr->buildin);
+ fPtr->buildin.name = "current";
+ fPtr->buildin.next = &fPtr->buildin;
+ fPtr->buildin.prev = &fPtr->buildin;
+ fPtr->buildin.type |= M_T_BUILTIN;
+
+ return TRUE;
+}
+
+char*
+fbdevHWGetName(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ return fPtr->fix.id;
+}
+
+int
+fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ if (fbbpp)
+ *fbbpp = fPtr->var.bits_per_pixel;
+
+ if (fPtr->fix.visual == FB_VISUAL_TRUECOLOR ||
+ fPtr->fix.visual == FB_VISUAL_DIRECTCOLOR)
+ return fPtr->var.red.length+fPtr->var.green.length+
+ fPtr->var.blue.length;
+ else
+ return fPtr->var.bits_per_pixel;
+}
+
+int
+fbdevHWGetLineLength(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ if (fPtr->fix.line_length)
+ return fPtr->fix.line_length;
+ else
+ return fPtr->var.xres_virtual*fPtr->var.bits_per_pixel/8;
+}
+
+int
+fbdevHWGetType(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ return fPtr->fix.type;
+}
+
+int
+fbdevHWGetVidmem(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ return fPtr->fix.smem_len;
+}
+
+void
+fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ int virtX = pScrn->display->virtualX;
+ int virtY = pScrn->display->virtualY;
+ struct fb_var_screeninfo var;
+ char **modename;
+ DisplayModePtr mode,this,last = NULL;
+
+ TRACE_ENTER("VerifyModes");
+ if (NULL == pScrn->display->modes)
+ return;
+
+ for (modename = pScrn->display->modes; *modename != NULL; modename++) {
+ for (mode = pScrn->monitor->Modes; mode != NULL; mode = mode->next)
+ if (0 == strcmp(mode->name,*modename))
+ break;
+ if (NULL == mode) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "\tmode \"%s\" not found\n", *modename);
+ continue;
+ }
+ memset(&var,0,sizeof(var));
+ xfree2fbdev_timing(mode,&var);
+ var.xres_virtual = virtX;
+ var.yres_virtual = virtY;
+ var.bits_per_pixel = pScrn->bitsPerPixel;
+ var.red.length = pScrn->weight.red;
+ var.green.length = pScrn->weight.green;
+ var.blue.length = pScrn->weight.blue;
+
+ var.activate = FB_ACTIVATE_TEST;
+ if (var.xres_virtual < var.xres) var.xres_virtual = var.xres;
+ if (var.yres_virtual < var.yres) var.yres_virtual = var.yres;
+ if (-1 == ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&var))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "\tmode \"%s\" test failed\n", *modename);
+ continue;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "\tmode \"%s\" ok\n", *modename);
+ if (virtX < var.xres) virtX = var.xres;
+ if (virtY < var.yres) virtY = var.yres;
+ if (NULL == pScrn->modes) {
+ pScrn->modes = xnfalloc(sizeof(DisplayModeRec));
+ this = pScrn->modes;
+ memcpy(this,mode,sizeof(DisplayModeRec));
+ this->next = this;
+ this->prev = this;
+ } else {
+ this = xnfalloc(sizeof(DisplayModeRec));
+ memcpy(this,mode,sizeof(DisplayModeRec));
+ this->next = pScrn->modes;
+ this->prev = last;
+ last->next = this;
+ pScrn->modes->prev = this;
+ }
+ last = this;
+ }
+ pScrn->virtualX = virtX;
+ pScrn->virtualY = virtY;
+}
+
+DisplayModePtr
+fbdevHWGetBuildinMode(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ return &fPtr->buildin;
+}
+
+void
+fbdevHWUseBuildinMode(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("UseBuildinMode");
+ pScrn->modes = &fPtr->buildin;
+ pScrn->virtualX = pScrn->display->virtualX;
+ pScrn->virtualY = pScrn->display->virtualY;
+ if (pScrn->virtualX < fPtr->buildin.HDisplay)
+ pScrn->virtualX = fPtr->buildin.HDisplay;
+ if (pScrn->virtualY < fPtr->buildin.VDisplay)
+ pScrn->virtualY = fPtr->buildin.VDisplay;
+}
+
+/* -------------------------------------------------------------------- */
+
+void
+calculateFbmem_len(fbdevHWPtr fPtr)
+{
+ fPtr->fboff = (unsigned long) fPtr->fix.smem_start & ~PAGE_MASK;
+ fPtr->fbmem_len = (fPtr->fboff+fPtr->fix.smem_len+~PAGE_MASK) &
+ PAGE_MASK;
+}
+
+
+void*
+fbdevHWMapVidmem(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("MapVidmem");
+ if (NULL == fPtr->fbmem) {
+ calculateFbmem_len(fPtr);
+ fPtr->fbmem = mmap(NULL, fPtr->fbmem_len, PROT_READ | PROT_WRITE,
+ MAP_SHARED, fPtr->fd, 0);
+ if (-1 == (long)fPtr->fbmem) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "mmap fbmem: %s\n", strerror(errno));
+ fPtr->fbmem = NULL;
+ } else {
+ /* Perhaps we'd better add fboff to fbmem and return 0 in
+ fbdevHWLinearOffset()? Of course we then need to mask
+ fPtr->fbmem with PAGE_MASK in fbdevHWUnmapVidmem() as
+ well. [geert] */
+ }
+ }
+ pScrn->memPhysBase = (unsigned long)fPtr->fix.smem_start & (unsigned long)(PAGE_MASK);
+ pScrn->fbOffset = (unsigned long)fPtr->fix.smem_start & (unsigned long)(~PAGE_MASK);
+ return fPtr->fbmem;
+}
+
+int
+fbdevHWLinearOffset(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("LinearOffset");
+ return fPtr->fboff;
+}
+
+Bool
+fbdevHWUnmapVidmem(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("UnmapVidmem");
+ if (NULL != fPtr->fbmem) {
+ if (-1 == munmap(fPtr->fbmem, fPtr->fbmem_len))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "munmap fbmem: %s\n", strerror(errno));
+ fPtr->fbmem = NULL;
+ }
+ return TRUE;
+}
+
+void*
+fbdevHWMapMMIO(ScrnInfoPtr pScrn)
+{
+ unsigned int mmio_off;
+
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("MapMMIO");
+ if (NULL == fPtr->mmio) {
+ /* tell the kernel not to use accels to speed up console scrolling */
+ fPtr->var.accel_flags = 0;
+ if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->var))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
+ return FALSE;
+ }
+ mmio_off = (unsigned long) fPtr->fix.mmio_start & ~PAGE_MASK;
+ fPtr->mmio_len = (mmio_off+fPtr->fix.mmio_len+~PAGE_MASK) &
+ PAGE_MASK;
+ if (NULL == fPtr->fbmem)
+ calculateFbmem_len(fPtr);
+ fPtr->mmio = mmap(NULL, fPtr->mmio_len, PROT_READ | PROT_WRITE,
+ MAP_SHARED, fPtr->fd, fPtr->fbmem_len);
+ if (-1 == (long)fPtr->mmio) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "mmap mmio: %s\n", strerror(errno));
+ fPtr->mmio = NULL;
+ } else
+ fPtr->mmio += mmio_off;
+ }
+ return fPtr->mmio;
+}
+
+Bool
+fbdevHWUnmapMMIO(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("UnmapMMIO");
+ if (NULL != fPtr->mmio) {
+ if (-1 == munmap((void *)((unsigned long)fPtr->mmio & PAGE_MASK), fPtr->mmio_len))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "munmap mmio: %s\n", strerror(errno));
+ fPtr->mmio = NULL;
+ /* FIXME: restore var.accel_flags [geert] */
+ }
+ return TRUE;
+}
+
+/* -------------------------------------------------------------------- */
+
+Bool
+fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("ModeInit");
+ xfree2fbdev_fblayout(pScrn, &fPtr->var);
+ xfree2fbdev_timing(mode, &fPtr->var);
+#if DEBUG
+ print_xfree_mode("init",mode);
+ print_fbdev_mode("init",&fPtr->var);
+#endif
+ pScrn->vtSema = TRUE;
+
+ /* set */
+ if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->var))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
+ return FALSE;
+ }
+ /* read back */
+ if (0 != ioctl(fPtr->fd,FBIOGET_FSCREENINFO,(void*)(&fPtr->fix))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOGET_FSCREENINFO: %s\n", strerror(errno));
+ return FALSE;
+ }
+ if (0 != ioctl(fPtr->fd,FBIOGET_VSCREENINFO,(void*)(&fPtr->var))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOGET_VSCREENINFO: %s\n", strerror(errno));
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/* -------------------------------------------------------------------- */
+/* video mode save/restore */
+
+/* TODO: colormap */
+void
+fbdevHWSave(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("Save");
+ if (0 != ioctl(fPtr->fd,FBIOGET_VSCREENINFO,(void*)(&fPtr->saved_var)))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOGET_VSCREENINFO: %s\n", strerror(errno));
+}
+
+void
+fbdevHWRestore(ScrnInfoPtr pScrn)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("Restore");
+ if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->saved_var)))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
+}
+
+/* -------------------------------------------------------------------- */
+/* callback for xf86HandleColormaps */
+
+void
+fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ struct fb_cmap cmap;
+ unsigned short red,green,blue;
+ int i;
+
+ TRACE_ENTER("ModeInit");
+ cmap.len = 1;
+ cmap.red = &red;
+ cmap.green = &green;
+ cmap.blue = &blue;
+ cmap.transp = NULL;
+ for (i = 0; i < numColors; i++) {
+ cmap.start = indices[i];
+ red = (colors[indices[i]].red << 8) |
+ colors[indices[i]].red;
+ green = (colors[indices[i]].green << 8) |
+ colors[indices[i]].green;
+ blue = (colors[indices[i]].blue << 8) |
+ colors[indices[i]].blue;
+ if (-1 == ioctl(fPtr->fd,FBIOPUTCMAP,(void*)&cmap))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOPUTCMAP: %s\n", strerror(errno));
+ }
+}
+
+/* -------------------------------------------------------------------- */
+/* these can be hooked directly into ScrnInfoRec */
+
+int
+fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ struct fb_var_screeninfo var;
+
+ TRACE_ENTER("ValidMode");
+ memcpy(&var,&fPtr->var,sizeof(var));
+ xfree2fbdev_timing(mode, &var);
+ var.activate = FB_ACTIVATE_TEST;
+ if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->var))) {
+ xf86DrvMsg(scrnIndex, X_ERROR,
+ "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
+ return MODE_BAD;
+ }
+ return MODE_OK;
+}
+
+Bool
+fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("SwitchMode");
+ xfree2fbdev_timing(mode, &fPtr->var);
+ if (0 != ioctl(fPtr->fd,FBIOPUT_VSCREENINFO,(void*)(&fPtr->var))) {
+ xf86DrvMsg(scrnIndex, X_ERROR,
+ "FBIOPUT_VSCREENINFO: %s\n", strerror(errno));
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void
+fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+ TRACE_ENTER("AdjustFrame");
+ fPtr->var.xoffset = x;
+ fPtr->var.yoffset = y;
+ if (-1 == ioctl(fPtr->fd,FBIOPAN_DISPLAY,(void*)&fPtr->var))
+ xf86DrvMsgVerb(scrnIndex,5, X_WARNING,
+ "FBIOPAN_DISPLAY: %s\n", strerror(errno));
+}
+
+Bool
+fbdevHWEnterVT(int scrnIndex, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+
+ TRACE_ENTER("EnterVT");
+ if (!fbdevHWModeInit(pScrn, pScrn->currentMode))
+ return FALSE;
+ fbdevHWAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+ return TRUE;
+}
+
+void
+fbdevHWLeaveVT(int scrnIndex, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+
+ TRACE_ENTER("LeaveVT");
+ fbdevHWRestore(pScrn);
+}
+
+void
+fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
+{
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ unsigned long fbmode;
+
+ if (!pScrn->vtSema)
+ return;
+
+ switch (mode) {
+ case DPMSModeOn:
+ fbmode = 0;
+ break;
+ case DPMSModeStandby:
+ fbmode = 2;
+ break;
+ case DPMSModeSuspend:
+ fbmode = 3;
+ break;
+ case DPMSModeOff:
+ fbmode = 4;
+ break;
+ default:
+ return;
+ }
+
+ if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *)fbmode))
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOBLANK: %s\n", strerror(errno));
+}
+
+Bool
+fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
+ unsigned long unblank;
+
+ if (!pScrn->vtSema)
+ return TRUE;
+
+ unblank = xf86IsUnblank(mode);
+
+ if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *)(1-unblank))) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "FBIOBLANK: %s\n", strerror(errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h
new file mode 100644
index 000000000..78a5b5882
--- /dev/null
+++ b/hw/xfree86/fbdevhw/fbdevhw.h
@@ -0,0 +1,52 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.h,v 1.11 2001/10/01 13:44:12 eich Exp $ */
+
+#ifndef _FBDEVHW_H_
+#define _FBDEVHW_H_
+
+#include "xf86str.h"
+#include "colormapst.h"
+
+#define FBDEVHW_PACKED_PIXELS 0 /* Packed Pixels */
+#define FBDEVHW_PLANES 1 /* Non interleaved planes */
+#define FBDEVHW_INTERLEAVED_PLANES 2 /* Interleaved planes */
+#define FBDEVHW_TEXT 3 /* Text/attributes */
+#define FBDEVHW_VGA_PLANES 4 /* EGA/VGA planes */
+
+Bool fbdevHWGetRec(ScrnInfoPtr pScrn);
+void fbdevHWFreeRec(ScrnInfoPtr pScrn);
+
+Bool fbdevHWProbe(pciVideoPtr pPci, char *device, char **namep);
+Bool fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device);
+
+char* fbdevHWGetName(ScrnInfoPtr pScrn);
+int fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp);
+int fbdevHWGetLineLength(ScrnInfoPtr pScrn);
+int fbdevHWGetType(ScrnInfoPtr pScrn);
+int fbdevHWGetVidmem(ScrnInfoPtr pScrn);
+
+void* fbdevHWMapVidmem(ScrnInfoPtr pScrn);
+int fbdevHWLinearOffset(ScrnInfoPtr pScrn);
+Bool fbdevHWUnmapVidmem(ScrnInfoPtr pScrn);
+void* fbdevHWMapMMIO(ScrnInfoPtr pScrn);
+Bool fbdevHWUnmapMMIO(ScrnInfoPtr pScrn);
+
+void fbdevHWSetVideoModes(ScrnInfoPtr pScrn);
+DisplayModePtr fbdevHWGetBuildinMode(ScrnInfoPtr pScrn);
+void fbdevHWUseBuildinMode(ScrnInfoPtr pScrn);
+Bool fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
+void fbdevHWSave(ScrnInfoPtr pScrn);
+void fbdevHWRestore(ScrnInfoPtr pScrn);
+
+void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual);
+
+int fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags);
+Bool fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
+void fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags);
+Bool fbdevHWEnterVT(int scrnIndex, int flags);
+void fbdevHWLeaveVT(int scrnIndex, int flags);
+void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags);
+
+Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode);
+
+#endif
diff --git a/hw/xfree86/fbdevhw/fbdevhw.man.pre b/hw/xfree86/fbdevhw/fbdevhw.man.pre
new file mode 100644
index 000000000..dadc1f9a3
--- /dev/null
+++ b/hw/xfree86/fbdevhw/fbdevhw.man.pre
@@ -0,0 +1,21 @@
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.man,v 1.2 2001/01/27 18:20:56 dawes Exp $
+.TH FBDEVHW __drivermansuffix__ __vendorversion__
+.SH NAME
+fbdevhw \- os-specific submodule for framebuffer device access
+.SH DESCRIPTION
+.B fbdevhw
+provides functions for talking to a framebuffer device. It is
+os-specific. It is a submodule used by other video drivers.
+A
+.B fbdevhw
+module is currently available for linux framebuffer devices.
+.PP
+fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the
+fbdevhw module. fbdevhw can be used by other drivers too, this
+is usually activated with `Option "UseFBDev"' in the device section.
+.SH "SEE ALSO"
+XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__),
+fbdev(__drivermansuffix__)
+.SH AUTHORS
+Authors include: Gerd Knorr, based on the XF68_FBDev Server code
+(Martin Schaller, Geert Uytterhoeven).
diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c
new file mode 100644
index 000000000..02086ef8f
--- /dev/null
+++ b/hw/xfree86/fbdevhw/fbdevhwstub.c
@@ -0,0 +1,170 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhwstub.c,v 1.12 2001/10/28 03:33:55 tsi Exp $ */
+
+#include "xf86.h"
+#include "xf86cmap.h"
+#include "fbdevhw.h"
+
+/* Stubs for the static server on platforms that don't support fbdev */
+
+
+Bool
+fbdevHWGetRec(ScrnInfoPtr pScrn)
+{
+ return FALSE;
+}
+
+void
+fbdevHWFreeRec(ScrnInfoPtr pScrn)
+{
+}
+
+
+Bool
+fbdevHWProbe(pciVideoPtr pPci, char *device, char **namep)
+{
+ return FALSE;
+}
+
+Bool
+fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device)
+{
+ xf86Msg(X_ERROR, "fbdevhw is not available on this platform\n");
+ return FALSE;
+}
+
+char*
+fbdevHWGetName(ScrnInfoPtr pScrn)
+{
+ return NULL;
+}
+
+int
+fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp)
+{
+ return -1;
+}
+
+int
+fbdevHWGetLineLength(ScrnInfoPtr pScrn)
+{
+ return -1; /* Should cause something spectacular... */
+}
+
+int
+fbdevHWGetType(ScrnInfoPtr pScrn)
+{
+ return -1;
+}
+
+int
+fbdevHWGetVidmem(ScrnInfoPtr pScrn)
+{
+ return -1;
+}
+
+void
+fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
+{
+}
+
+DisplayModePtr
+fbdevHWGetBuildinMode(ScrnInfoPtr pScrn)
+{
+ return NULL;
+}
+
+void
+fbdevHWUseBuildinMode(ScrnInfoPtr pScrn)
+{
+}
+
+void*
+fbdevHWMapVidmem(ScrnInfoPtr pScrn)
+{
+ return NULL;
+}
+
+int
+fbdevHWLinearOffset(ScrnInfoPtr pScrn)
+{
+ return 0;
+}
+
+Bool
+fbdevHWUnmapVidmem(ScrnInfoPtr pScrn)
+{
+ return FALSE;
+}
+
+void*
+fbdevHWMapMMIO(ScrnInfoPtr pScrn)
+{
+ return NULL;
+}
+
+Bool
+fbdevHWUnmapMMIO(ScrnInfoPtr pScrn)
+{
+ return FALSE;
+}
+
+Bool
+fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode)
+{
+ return FALSE;
+}
+
+void
+fbdevHWSave(ScrnInfoPtr pScrn)
+{
+}
+
+void
+fbdevHWRestore(ScrnInfoPtr pScrn)
+{
+}
+
+void
+fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual)
+{
+}
+
+int
+fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+{
+ return MODE_ERROR;
+}
+
+Bool
+fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+{
+ return FALSE;
+}
+
+void
+fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
+{
+}
+
+Bool
+fbdevHWEnterVT(int scrnIndex, int flags)
+{
+ return FALSE;
+}
+
+void
+fbdevHWLeaveVT(int scrnIndex, int flags)
+{
+}
+
+void
+fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
+{
+}
+
+Bool
+fbdevHWSaveScreen(ScreenPtr pScreen, int mode)
+{
+ return FALSE;
+}
diff --git a/hw/xfree86/fbdevhw/fbpriv.h b/hw/xfree86/fbdevhw/fbpriv.h
new file mode 100644
index 000000000..d651e5129
--- /dev/null
+++ b/hw/xfree86/fbdevhw/fbpriv.h
@@ -0,0 +1,262 @@
+/*
+ * copyed from from linux kernel 2.2.4
+ * removed internal stuff (#ifdef __KERNEL__)
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbpriv.h,v 1.3 2000/08/11 17:27:14 dawes Exp $ */
+
+#ifndef _LINUX_FB_H
+#define _LINUX_FB_H
+
+#include <asm/types.h>
+
+/* Definitions of frame buffers */
+
+#define FB_MAJOR 29
+
+#define FB_MODES_SHIFT 5 /* 32 modes per framebuffer */
+#define FB_NUM_MINORS 256 /* 256 Minors */
+#define FB_MAX (FB_NUM_MINORS / (1 << FB_MODES_SHIFT))
+#define GET_FB_IDX(node) (MINOR(node) >> FB_MODES_SHIFT)
+
+/* 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
+/* 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
+
+#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_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_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 */
+
+struct fb_fix_screeninfo {
+ char id[16]; /* identification string eg "TT Builtin" */
+ char *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 */
+ char *mmio_start; /* Start of Memory Mapped I/O */
+ /* (physical address) */
+ __u32 mmio_len; /* Length of Memory Mapped I/O */
+ __u32 accel; /* Type of acceleration available */
+ __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. This implies
+ * big-endian byte order if bits_per_pixel is greater than 8.
+ */
+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_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_ACCELF_TEXT 1 /* text mode acceleration */
+
+#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_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 */
+
+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; /* acceleration flags (hints) */
+
+ /* 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 reserved[6]; /* 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;
+};
+
+struct fb_monspecs {
+ __u32 hfmin; /* hfreq lower limit (Hz) */
+ __u32 hfmax; /* hfreq upper limit (Hz) */
+ __u16 vfmin; /* vfreq lower limit (Hz) */
+ __u16 vfmax; /* vfreq upper limit (Hz) */
+ unsigned dpms : 1; /* supports DPMS */
+};
+
+#if 1
+
+#define FBCMD_GET_CURRENTPAR 0xDEAD0005
+#define FBCMD_SET_CURRENTPAR 0xDEAD8005
+
+#endif
+
+
+#if 1 /* Preliminary */
+
+ /*
+ * Hardware Cursor
+ */
+
+#define FBIOGET_FCURSORINFO 0x4607
+#define FBIOGET_VCURSORINFO 0x4608
+#define FBIOPUT_VCURSORINFO 0x4609
+#define FBIOGET_CURSORSTATE 0x460A
+#define FBIOPUT_CURSORSTATE 0x460B
+
+
+struct fb_fix_cursorinfo {
+ __u16 crsr_width; /* width and height of the cursor in */
+ __u16 crsr_height; /* pixels (zero if no cursor) */
+ __u16 crsr_xsize; /* cursor size in display pixels */
+ __u16 crsr_ysize;
+ __u16 crsr_color1; /* colormap entry for cursor color1 */
+ __u16 crsr_color2; /* colormap entry for cursor color2 */
+};
+
+struct fb_var_cursorinfo {
+ __u16 width;
+ __u16 height;
+ __u16 xspot;
+ __u16 yspot;
+ __u8 data[1]; /* field with [height][width] */
+};
+
+struct fb_cursorstate {
+ __s16 xoffset;
+ __s16 yoffset;
+ __u16 mode;
+};
+
+#define FB_CURSOR_OFF 0
+#define FB_CURSOR_ON 1
+#define FB_CURSOR_FLASH 2
+
+#endif /* Preliminary */
+
+#endif /* _LINUX_FB_H */
diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c
new file mode 100644
index 000000000..494f9303b
--- /dev/null
+++ b/hw/xfree86/i2c/xf86i2c.c
@@ -0,0 +1,863 @@
+/*
+ * Copyright (C) 1998 Itai Nahshon, Michael Schimek
+ *
+ * The original code was derived from and inspired by
+ * the I2C driver from the Linux kernel.
+ * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c,v 1.13 2002/09/16 18:06:07 eich Exp $ */
+
+#if 1
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "Xproto.h"
+#include "scrnintstr.h"
+#include "regionstr.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "validate.h"
+#include "resource.h"
+#include "gcstruct.h"
+#include "dixstruct.h"
+#else
+typedef int Bool;
+typedef void *Pointer;
+#define NULL ((void *)0)
+#define X_DEFAULT 0
+#define TRUE 1
+#define FALSE 0
+#endif
+
+#include "xf86i2c.h"
+
+#define I2C_TIMEOUT(x) /*(x)*/ /* Report timeouts */
+#define I2C_TRACE(x) /*(x)*/ /* Report progress */
+
+/* Set which OSs have bad gettimeofday resolution. */
+#if defined(SVR4) && !defined(sun)
+#define BAD_GETTIMEOFDAY_RESOLUTION
+#endif
+
+
+/* This is the default I2CUDelay function if not supplied by the driver.
+ * High level I2C interfaces implementing the bus protocol in hardware
+ * should supply this function too.
+ *
+ * Delay execution at least usec microseconds.
+ * All values 0 to 1e6 inclusive must be expected.
+ */
+
+#ifdef BAD_GETTIMEOFDAY_RESOLUTION
+/*
+ * This is temporary until a better, portable
+ * way is found. Adjust bogo_usec to match CPU speed.
+ */
+static int bogo_usec = 500;
+
+static void
+I2CUDelay(I2CBusPtr b, int usec)
+{
+ volatile long i;
+
+ if (usec > 0)
+ for (i = usec * bogo_usec; i > 0; i--)
+ /* (perhaps hw delay action) */;
+}
+#else
+static void
+I2CUDelay(I2CBusPtr b, int usec)
+{
+ long b_secs, b_usecs;
+ long a_secs, a_usecs;
+ long d_secs, d_usecs;
+ long diff;
+
+ if (usec > 0) {
+ xf86getsecs(&b_secs, &b_usecs);
+ do {
+ /* It would be nice to use {xf86}usleep,
+ * but usleep (1) takes >10000 usec !
+ */
+ xf86getsecs(&a_secs, &a_usecs);
+ d_secs = (a_secs - b_secs);
+ d_usecs = (a_usecs - b_usecs);
+ diff = d_secs*1000000 + d_usecs;
+ } while (diff>0 && diff< (usec + 1));
+ }
+}
+#endif
+
+/* Most drivers will register just with GetBits/PutBits functions.
+ * The following functions implement a software I2C protocol
+ * by using the promitive functions given by the driver.
+ * ================================================================
+ *
+ * It is assumed that there is just one master on the I2C bus, therefore
+ * there is no explicit test for conflits.
+ */
+
+#define RISEFALLTIME 2 /* usec, actually 300 to 1000 ns according to the i2c specs */
+
+/* Some devices will hold SCL low to slow down the bus or until
+ * ready for transmission.
+ *
+ * This condition will be noticed when the master tries to raise
+ * the SCL line. You can set the timeout to zero if the slave device
+ * does not support this clock synchronization.
+ */
+
+static Bool
+I2CRaiseSCL(I2CBusPtr b, int sda, int timeout)
+{
+ int i, scl;
+
+ b->I2CPutBits(b, 1, sda);
+ b->I2CUDelay(b, b->RiseFallTime);
+
+ for (i = timeout; i > 0; i -= b->RiseFallTime) {
+ b->I2CGetBits(b, &scl, &sda);
+ if (scl) break;
+ b->I2CUDelay(b, b->RiseFallTime);
+ }
+
+ if (i <= 0) {
+ I2C_TIMEOUT(ErrorF("[I2CRaiseSCL(<%s>, %d, %d) timeout]", b->BusName, sda, timeout));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* Send a start signal on the I2C bus. The start signal notifies
+ * devices that a new transaction is initiated by the bus master.
+ *
+ * The start signal is always followed by a slave address.
+ * Slave addresses are 8+ bits. The first 7 bits identify the
+ * device and the last bit signals if this is a read (1) or
+ * write (0) operation.
+ *
+ * There may be more than one start signal on one transaction.
+ * This happens for example on some devices that allow reading
+ * of registers. First send a start bit followed by the device
+ * address (with the last bit 0) and the register number. Then send
+ * a new start bit with the device address (with the last bit 1)
+ * and then read the value from the device.
+ *
+ * Note this is function does not implement a multiple master
+ * arbitration procedure.
+ */
+
+static Bool
+I2CStart(I2CBusPtr b, int timeout)
+{
+ if (!I2CRaiseSCL(b, 1, timeout))
+ return FALSE;
+
+ b->I2CPutBits(b, 1, 0);
+ b->I2CUDelay(b, b->HoldTime);
+ b->I2CPutBits(b, 0, 0);
+ b->I2CUDelay(b, b->HoldTime);
+
+ I2C_TRACE(ErrorF("\ni2c: <"));
+
+ return TRUE;
+}
+
+/* This is the default I2CStop function if not supplied by the driver.
+ *
+ * Signal devices on the I2C bus that a transaction on the
+ * bus has finished. There may be more than one start signal
+ * on a transaction but only one stop signal.
+ */
+
+static void
+I2CStop(I2CDevPtr d)
+{
+ I2CBusPtr b = d->pI2CBus;
+
+ b->I2CPutBits(b, 0, 0);
+ b->I2CUDelay(b, b->RiseFallTime);
+
+ b->I2CPutBits(b, 1, 0);
+ b->I2CUDelay(b, b->HoldTime);
+ b->I2CPutBits(b, 1, 1);
+ b->I2CUDelay(b, b->HoldTime);
+
+ I2C_TRACE(ErrorF(">\n"));
+}
+
+/* Write/Read a single bit to/from a device.
+ * Return FALSE if a timeout occurs.
+ */
+
+static Bool
+I2CWriteBit(I2CBusPtr b, int sda, int timeout)
+{
+ Bool r;
+
+ b->I2CPutBits(b, 0, sda);
+ b->I2CUDelay(b, b->RiseFallTime);
+
+ r = I2CRaiseSCL(b, sda, timeout);
+ b->I2CUDelay(b, b->HoldTime);
+
+ b->I2CPutBits(b, 0, sda);
+ b->I2CUDelay(b, b->HoldTime);
+
+ return r;
+}
+
+static Bool
+I2CReadBit(I2CBusPtr b, int *psda, int timeout)
+{
+ Bool r;
+ int scl;
+
+ r = I2CRaiseSCL(b, 1, timeout);
+ b->I2CUDelay(b, b->HoldTime);
+
+ b->I2CGetBits(b, &scl, psda);
+
+ b->I2CPutBits(b, 0, 1);
+ b->I2CUDelay(b, b->HoldTime);
+
+ return r;
+}
+
+/* This is the default I2CPutByte function if not supplied by the driver.
+ *
+ * A single byte is sent to the device.
+ * The function returns FALSE if a timeout occurs, you should send
+ * a stop condition afterwards to reset the bus.
+ *
+ * A timeout occurs,
+ * if the slave pulls SCL to slow down the bus more than ByteTimeout usecs,
+ * or slows down the bus for more than BitTimeout usecs for each bit,
+ * or does not send an ACK bit (0) to acknowledge the transmission within
+ * AcknTimeout usecs, but a NACK (1) bit.
+ *
+ * AcknTimeout must be at least b->HoldTime, the other timeouts can be
+ * zero according to the comment on I2CRaiseSCL.
+ */
+
+static Bool
+I2CPutByte(I2CDevPtr d, I2CByte data)
+{
+ Bool r;
+ int i, scl, sda;
+ I2CBusPtr b = d->pI2CBus;
+
+ if (!I2CWriteBit(b, (data >> 7) & 1, d->ByteTimeout))
+ return FALSE;
+
+ for (i = 6; i >= 0; i--)
+ if (!I2CWriteBit(b, (data >> i) & 1, d->BitTimeout))
+ return FALSE;
+
+ b->I2CPutBits(b, 0, 1);
+ b->I2CUDelay(b, b->RiseFallTime);
+
+ r = I2CRaiseSCL(b, 1, b->HoldTime);
+
+ if (r) {
+ for (i = d->AcknTimeout; i > 0; i -= b->HoldTime) {
+ b->I2CUDelay(b, b->HoldTime);
+ b->I2CGetBits(b, &scl, &sda);
+ if (sda == 0) break;
+ }
+
+ if (i <= 0) {
+ I2C_TIMEOUT(ErrorF("[I2CPutByte(<%s>, 0x%02x, %d, %d, %d) timeout]",
+ b->BusName, data, d->BitTimeout,
+ d->ByteTimeout, d->AcknTimeout));
+ r = FALSE;
+ }
+
+ I2C_TRACE(ErrorF("W%02x%c ", (int) data, sda ? '-' : '+'));
+ }
+
+ b->I2CPutBits(b, 0, 1);
+ b->I2CUDelay(b, b->HoldTime);
+
+ return r;
+}
+
+/* This is the default I2CGetByte function if not supplied by the driver.
+ *
+ * A single byte is read from the device.
+ * The function returns FALSE if a timeout occurs, you should send
+ * a stop condition afterwards to reset the bus.
+ *
+ * A timeout occurs,
+ * if the slave pulls SCL to slow down the bus more than ByteTimeout usecs,
+ * or slows down the bus for more than b->BitTimeout usecs for each bit.
+ *
+ * ByteTimeout must be at least b->HoldTime, the other timeouts can be
+ * zero according to the comment on I2CRaiseSCL.
+ *
+ * For the <last> byte in a sequence the acknowledge bit NACK (1),
+ * otherwise ACK (0) will be sent.
+ */
+
+static Bool
+I2CGetByte(I2CDevPtr d, I2CByte *data, Bool last)
+{
+ int i, sda;
+ I2CBusPtr b = d->pI2CBus;
+
+ b->I2CPutBits(b, 0, 1);
+ b->I2CUDelay(b, b->RiseFallTime);
+
+ if (!I2CReadBit(b, &sda, d->ByteTimeout))
+ return FALSE;
+
+ *data = (sda > 0) << 7;
+
+ for (i = 6; i >= 0; i--)
+ if (!I2CReadBit(b, &sda, d->BitTimeout))
+ return FALSE;
+ else
+ *data |= (sda > 0) << i;
+
+ if (!I2CWriteBit(b, last ? 1 : 0, d->BitTimeout))
+ return FALSE;
+
+ I2C_TRACE(ErrorF("R%02x%c ", (int) *data, last ? '+' : '-'));
+
+ return TRUE;
+}
+
+/* This is the default I2CAddress function if not supplied by the driver.
+ *
+ * It creates the start condition, followed by the d->SlaveAddr.
+ * Higher level functions must call this routine rather than
+ * I2CStart/PutByte because a hardware I2C master may not be able
+ * to send a slave address without a start condition.
+ *
+ * The same timeouts apply as with I2CPutByte and additional a
+ * StartTimeout, similar to the ByteTimeout but for the start
+ * condition.
+ *
+ * In case of a timeout, the bus is left in a clean idle condition.
+ * I. e. you *must not* send a Stop. If this function succeeds, you *must*.
+ *
+ * The slave address format is 16 bit, with the legacy _8_bit_ slave address
+ * in the least significant byte. This is, the slave address must include the
+ * R/_W flag as least significant bit.
+ *
+ * The most significant byte of the address will be sent _after_ the LSB,
+ * but only if the LSB indicates:
+ * a) an 11 bit address, this is LSB = 1111 0xxx.
+ * b) a 'general call address', this is LSB = 0000 000x - see the I2C specs
+ * for more.
+ */
+
+static Bool
+I2CAddress(I2CDevPtr d, I2CSlaveAddr addr)
+{
+ if (I2CStart(d->pI2CBus, d->StartTimeout)) {
+ if (I2CPutByte(d, addr & 0xFF)) {
+ if ((addr & 0xF8) != 0xF0 &&
+ (addr & 0xFE) != 0x00)
+ return TRUE;
+
+ if (I2CPutByte(d, (addr >> 8) & 0xFF))
+ return TRUE;
+ }
+
+ I2CStop(d);
+ }
+
+ return FALSE;
+}
+
+/* These are the hardware independent I2C helper functions.
+ * ========================================================
+ */
+
+/* Function for probing. Just send the slave address
+ * and return true if the device responds. The slave address
+ * must have the lsb set to reflect a read (1) or write (0) access.
+ * Don't expect a read- or write-only device will respond otherwise.
+ */
+
+Bool
+xf86I2CProbeAddress(I2CBusPtr b, I2CSlaveAddr addr)
+{
+ int r;
+ I2CDevRec d;
+
+ d.DevName = "Probing";
+ d.BitTimeout = b->BitTimeout;
+ d.ByteTimeout = b->ByteTimeout;
+ d.AcknTimeout = b->AcknTimeout;
+ d.StartTimeout = b->StartTimeout;
+ d.SlaveAddr = addr;
+ d.pI2CBus = b;
+ d.NextDev = NULL;
+
+ r = b->I2CAddress(&d, addr);
+
+ if (r) b->I2CStop(&d);
+
+ return r;
+}
+
+/* All functions below are related to devices and take the
+ * slave address and timeout values from an I2CDevRec. They
+ * return FALSE in case of an error (presumably a timeout).
+ */
+
+/* General purpose read and write function.
+ *
+ * 1st, if nWrite > 0
+ * Send a start condition
+ * Send the slave address (1 or 2 bytes) with write flag
+ * Write n bytes from WriteBuffer
+ * 2nd, if nRead > 0
+ * Send a start condition [again]
+ * Send the slave address (1 or 2 bytes) with read flag
+ * Read n bytes to ReadBuffer
+ * 3rd, if a Start condition has been successfully sent,
+ * Send a Stop condition.
+ *
+ * The functions exits immediately when an error occures,
+ * not proceeding any data left. However, step 3 will
+ * be executed anyway to leave the bus in clean idle state.
+ */
+
+static Bool
+I2CWriteRead(I2CDevPtr d,
+ I2CByte *WriteBuffer, int nWrite,
+ I2CByte *ReadBuffer, int nRead)
+{
+ Bool r = TRUE;
+ I2CBusPtr b = d->pI2CBus;
+ int s = 0;
+
+ if (r && nWrite > 0) {
+ r = b->I2CAddress(d, d->SlaveAddr & ~1);
+ if (r) {
+ for (; nWrite > 0; WriteBuffer++, nWrite--)
+ if (!(r = b->I2CPutByte(d, *WriteBuffer)))
+ break;
+ s++;
+ }
+ }
+
+ if (r && nRead > 0) {
+ r = b->I2CAddress(d, d->SlaveAddr | 1);
+ if (r) {
+ for (; nRead > 0; ReadBuffer++, nRead--)
+ if (!(r = b->I2CGetByte(d, ReadBuffer, nRead == 1)))
+ break;
+ s++;
+ }
+ }
+
+ if (s) b->I2CStop(d);
+
+ return r;
+}
+
+/* wrapper - for compatibility and convinience */
+
+Bool
+xf86I2CWriteRead(I2CDevPtr d,
+ I2CByte *WriteBuffer, int nWrite,
+ I2CByte *ReadBuffer, int nRead)
+{
+ I2CBusPtr b = d->pI2CBus;
+ return b->I2CWriteRead(d,WriteBuffer,nWrite,ReadBuffer,nRead);
+}
+
+/* Read a byte, the only readable register of a device.
+ */
+
+Bool
+xf86I2CReadStatus(I2CDevPtr d, I2CByte *pbyte)
+{
+ return xf86I2CWriteRead(d, NULL, 0, pbyte, 1);
+}
+
+/* Read a byte from one of the registers determined by its sub-address.
+ */
+
+Bool
+xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte)
+{
+ return xf86I2CWriteRead(d, &subaddr, 1, pbyte, 1);
+}
+
+/* Read bytes from subsequent registers determined by the
+ * sub-address of the first register.
+ */
+
+Bool
+xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte, int n)
+{
+ return xf86I2CWriteRead(d, &subaddr, 1, pbyte, n);
+}
+
+/* Read a word (high byte, then low byte) from one of the registers
+ * determined by its sub-address.
+ */
+
+Bool
+xf86I2CReadWord(I2CDevPtr d, I2CByte subaddr, unsigned short *pword)
+{
+ I2CByte rb[2];
+
+ if (!xf86I2CWriteRead(d, &subaddr, 1, rb, 2)) return FALSE;
+
+ *pword = (rb[0] << 8) | rb[1];
+
+ return TRUE;
+}
+
+/* Write a byte to one of the registers determined by its sub-address.
+ */
+
+Bool
+xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte)
+{
+ I2CByte wb[2];
+
+ wb[0] = subaddr;
+ wb[1] = byte;
+
+ return xf86I2CWriteRead(d, wb, 2, NULL, 0);
+}
+
+/* Write bytes to subsequent registers determined by the
+ * sub-address of the first register.
+ */
+
+Bool
+xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr,
+ I2CByte *WriteBuffer, int nWrite)
+{
+ I2CBusPtr b = d->pI2CBus;
+ Bool r = TRUE;
+
+ if (nWrite > 0) {
+ r = b->I2CAddress(d, d->SlaveAddr & ~1);
+ if (r){
+ if ((r = b->I2CPutByte(d, subaddr)))
+ for (; nWrite > 0; WriteBuffer++, nWrite--)
+ if (!(r = b->I2CPutByte(d, *WriteBuffer)))
+ break;
+
+ b->I2CStop(d);
+ }
+ }
+
+ return r;
+}
+
+/* Write a word (high byte, then low byte) to one of the registers
+ * determined by its sub-address.
+ */
+
+Bool
+xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word)
+{
+ I2CByte wb[3];
+
+ wb[0] = subaddr;
+ wb[1] = word >> 8;
+ wb[2] = word & 0xFF;
+
+ return xf86I2CWriteRead(d, wb, 3, NULL, 0);
+}
+
+/* Write a vector of bytes to not adjacent registers. This vector is,
+ * 1st byte sub-address, 2nd byte value, 3rd byte sub-address asf.
+ * This function is intended to initialize devices. Note this function
+ * exits immediately when an error occurs, some registers may
+ * remain uninitialized.
+ */
+
+Bool
+xf86I2CWriteVec(I2CDevPtr d, I2CByte *vec, int nValues)
+{
+ I2CBusPtr b = d->pI2CBus;
+ Bool r = TRUE;
+ int s = 0;
+
+ if (nValues > 0) {
+ for (; nValues > 0; nValues--, vec += 2) {
+ if (!(r = b->I2CAddress(d, d->SlaveAddr & ~1)))
+ break;
+
+ s++;
+
+ if (!(r = b->I2CPutByte(d, vec[0])))
+ break;
+
+ if (!(r = b->I2CPutByte(d, vec[1])))
+ break;
+ }
+
+ if (s > 0) b->I2CStop(d);
+ }
+
+ return r;
+}
+
+/* Administrative functions.
+ * =========================
+ */
+
+/* Allocates an I2CDevRec for you and initializes with propper defaults
+ * you may modify before calling xf86I2CDevInit. Your I2CDevRec must
+ * contain at least a SlaveAddr, and a pI2CBus pointer to the bus this
+ * device shall be linked to.
+ *
+ * See function I2CAddress for the slave address format. Always set
+ * the least significant bit, indicating a read or write access, to zero.
+ */
+
+I2CDevPtr
+xf86CreateI2CDevRec(void)
+{
+ return xcalloc(1, sizeof(I2CDevRec));
+}
+
+/* Unlink an I2C device. If you got the I2CDevRec from xf86CreateI2CDevRec
+ * you should set <unalloc> to free it.
+ */
+
+void
+xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc)
+{
+ if (d) {
+ I2CDevPtr *p;
+
+ /* Remove this from the list of active I2C devices. */
+
+ for (p = &d->pI2CBus->FirstDev; *p != NULL; p = &(*p)->NextDev)
+ if (*p == d) {
+ *p = (*p)->NextDev;
+ break;
+ }
+
+ xf86DrvMsg(d->pI2CBus->scrnIndex, X_INFO,
+ "I2C device \"%s:%s\" removed.\n",
+ d->pI2CBus->BusName, d->DevName);
+
+ if (unalloc) xfree(d);
+ }
+}
+
+/* I2C transmissions are related to an I2CDevRec you must link to a
+ * previously registered bus (see xf86I2CBusInit) before attempting
+ * to read and write data. You may call xf86I2CProbeAddress first to
+ * see if the device in question is present on this bus.
+ *
+ * xf86I2CDevInit will not allocate an I2CBusRec for you, instead you
+ * may enter a pointer to a statically allocated I2CDevRec or the (modified)
+ * result of xf86CreateI2CDevRec.
+ *
+ * If you don't specify timeouts for the device (n <= 0), it will inherit
+ * the bus-wide defaults. The function returns TRUE on success.
+ */
+
+Bool
+xf86I2CDevInit(I2CDevPtr d)
+{
+ I2CBusPtr b;
+
+ if (d == NULL ||
+ (b = d->pI2CBus) == NULL ||
+ (d->SlaveAddr & 1) ||
+ xf86I2CFindDev(b, d->SlaveAddr) != NULL)
+ return FALSE;
+
+ if (d->BitTimeout <= 0) d->BitTimeout = b->BitTimeout;
+ if (d->ByteTimeout <= 0) d->ByteTimeout = b->ByteTimeout;
+ if (d->AcknTimeout <= 0) d->AcknTimeout = b->AcknTimeout;
+ if (d->StartTimeout <= 0) d->StartTimeout = b->StartTimeout;
+
+ d->NextDev = b->FirstDev;
+ b->FirstDev = d;
+
+ xf86DrvMsg(b->scrnIndex, X_INFO,
+ "I2C device \"%s:%s\" registered at address 0x%02X.\n",
+ b->BusName, d->DevName, d->SlaveAddr);
+
+ return TRUE;
+}
+
+I2CDevPtr
+xf86I2CFindDev(I2CBusPtr b, I2CSlaveAddr addr)
+{
+ I2CDevPtr d;
+
+ if (b) {
+ for (d = b->FirstDev; d != NULL; d = d->NextDev)
+ if (d->SlaveAddr == addr)
+ return d;
+ }
+
+ return NULL;
+}
+
+static I2CBusPtr I2CBusList;
+
+/* Allocates an I2CBusRec for you and initializes with propper defaults
+ * you may modify before calling xf86I2CBusInit. Your I2CBusRec must
+ * contain at least a BusName, a scrnIndex (or -1), and a complete set
+ * of either high or low level I2C function pointers. You may pass
+ * bus-wide timeouts, otherwise inplausible values will be replaced
+ * with safe defaults.
+ */
+
+I2CBusPtr
+xf86CreateI2CBusRec(void)
+{
+ I2CBusPtr b;
+
+ b = (I2CBusPtr) xcalloc(1, sizeof(I2CBusRec));
+
+ if (b != NULL) {
+ b->scrnIndex = -1;
+ b->HoldTime = 5; /* 100 kHz bus */
+ b->BitTimeout = 5;
+ b->ByteTimeout = 5;
+ b->AcknTimeout = 5;
+ b->StartTimeout = 5;
+ b->RiseFallTime = RISEFALLTIME;
+ }
+
+ return b;
+}
+
+/* Unregister an I2C bus. If you got the I2CBusRec from xf86CreateI2CBusRec
+ * you should set <unalloc> to free it. If you set <devs_too>, the function
+ * xf86DestroyI2CDevRec will be called for all devices linked to the bus
+ * first, passing down the <unalloc> option.
+ */
+
+void
+xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too)
+{
+ if (b) {
+ I2CBusPtr *p;
+
+ /* Remove this from the list of active I2C busses. */
+
+ for (p = &I2CBusList; *p != NULL; p = &(*p)->NextBus)
+ if (*p == b) {
+ *p = (*p)->NextBus;
+ break;
+ }
+
+ if (b->FirstDev != NULL) {
+ if (devs_too) {
+ I2CDevPtr d;
+
+ while ((d = b->FirstDev) != NULL) {
+ b->FirstDev = d->NextDev;
+ xf86DestroyI2CDevRec(d, unalloc);
+ }
+ } else {
+ if (unalloc) {
+ xf86Msg(X_ERROR, "i2c bug: Attempt to remove I2C bus \"%s\", "
+ "but device list is not empty.\n",
+ b->BusName);
+ return;
+ }
+ }
+ }
+
+ xf86DrvMsg(b->scrnIndex, X_INFO, "I2C bus \"%s\" removed.\n",
+ b->BusName);
+
+ if (unalloc) xfree(b);
+ }
+}
+
+/* I2C masters have to register themselves using this function.
+ * It will not allocate an I2CBusRec for you, instead you may enter
+ * a pointer to a statically allocated I2CBusRec or the (modified)
+ * result of xf86CreateI2CBusRec. Returns TRUE on success.
+ *
+ * At this point there won't be any traffic on the I2C bus.
+ */
+
+Bool
+xf86I2CBusInit(I2CBusPtr b)
+{
+ /* I2C busses must be identified by a unique scrnIndex
+ * and name. If scrnIndex is unspecified (a negative value),
+ * then the name must be unique throughout the server.
+ */
+
+ if (b->BusName == NULL ||
+ xf86I2CFindBus(b->scrnIndex, b->BusName) != NULL)
+ return FALSE;
+
+ /* If the high level functions are not
+ * supplied, use the generic functions.
+ * In this case we need the low-level
+ * function.
+ */
+ if (b->I2CWriteRead == NULL)
+ {
+ b->I2CWriteRead=I2CWriteRead;
+
+ if (b->I2CPutBits == NULL ||
+ b->I2CGetBits == NULL)
+ {
+ if (b->I2CPutByte == NULL ||
+ b->I2CGetByte == NULL ||
+ b->I2CAddress == NULL ||
+ b->I2CStop == NULL)
+ return FALSE;
+ } else {
+ b->I2CPutByte = I2CPutByte;
+ b->I2CGetByte = I2CGetByte;
+ b->I2CAddress = I2CAddress;
+ b->I2CStop = I2CStop;
+ }
+ }
+
+ if (b->I2CUDelay == NULL)
+ b->I2CUDelay = I2CUDelay;
+
+ if (b->HoldTime < 2) b->HoldTime = 5;
+ if (b->BitTimeout <= 0) b->BitTimeout = b->HoldTime;
+ if (b->ByteTimeout <= 0) b->ByteTimeout = b->HoldTime;
+ if (b->AcknTimeout <= 0) b->AcknTimeout = b->HoldTime;
+ if (b->StartTimeout <= 0) b->StartTimeout = b->HoldTime;
+
+ /* Put new bus on list. */
+
+ b->NextBus = I2CBusList;
+ I2CBusList = b;
+
+ xf86DrvMsg(b->scrnIndex, X_INFO, "I2C bus \"%s\" initialized.\n",
+ b->BusName);
+
+ return TRUE;
+}
+
+I2CBusPtr
+xf86I2CFindBus(int scrnIndex, char *name)
+{
+ I2CBusPtr p;
+
+ if (name != NULL)
+ for (p = I2CBusList; p != NULL; p = p->NextBus)
+ if (scrnIndex < 0 || p->scrnIndex == scrnIndex)
+ if (!strcmp(p->BusName, name))
+ return p;
+
+ return NULL;
+}
diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h
new file mode 100644
index 000000000..42b68a179
--- /dev/null
+++ b/hw/xfree86/i2c/xf86i2c.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 1998 Itai Nahshon, Michael Schimek
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.8 2001/07/19 14:19:40 tsi Exp $ */
+#ifndef _XF86I2C_H
+#define _XF86I2C_H
+
+#include "miscstruct.h"
+
+typedef unsigned char I2CByte;
+typedef unsigned short I2CSlaveAddr;
+
+typedef struct _I2CBusRec *I2CBusPtr;
+typedef struct _I2CDevRec *I2CDevPtr;
+
+/* I2C masters have to register themselves */
+
+typedef struct _I2CBusRec {
+ char * BusName;
+ int scrnIndex;
+
+ void (*I2CUDelay) (I2CBusPtr b, int usec);
+
+ void (*I2CPutBits)(I2CBusPtr b, int scl, int sda);
+ void (*I2CGetBits)(I2CBusPtr b, int *scl, int *sda);
+
+ /* Look at the generic routines to see how these functions should behave. */
+
+ Bool (*I2CAddress)(I2CDevPtr d, I2CSlaveAddr);
+ void (*I2CStop) (I2CDevPtr d);
+ Bool (*I2CPutByte)(I2CDevPtr d, I2CByte data);
+ Bool (*I2CGetByte)(I2CDevPtr d, I2CByte *data, Bool);
+
+ DevUnion DriverPrivate;
+
+ int HoldTime; /* 1 / bus clock frequency, 5 or 2 usec */
+
+ int BitTimeout; /* usec */
+ int ByteTimeout; /* usec */
+ int AcknTimeout; /* usec */
+ int StartTimeout; /* usec */
+ int RiseFallTime; /* usec */
+
+ I2CDevPtr FirstDev;
+ I2CBusPtr NextBus;
+ Bool (*I2CWriteRead)(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite,
+ I2CByte *ReadBuffer, int nRead);
+} I2CBusRec;
+
+I2CBusPtr xf86CreateI2CBusRec(void);
+void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too);
+Bool xf86I2CBusInit(I2CBusPtr pI2CBus);
+I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name);
+
+/* I2C slave devices */
+
+typedef struct _I2CDevRec {
+ char * DevName;
+
+ int BitTimeout; /* usec */
+ int ByteTimeout; /* usec */
+ int AcknTimeout; /* usec */
+ int StartTimeout; /* usec */
+
+ I2CSlaveAddr SlaveAddr;
+ I2CBusPtr pI2CBus;
+ I2CDevPtr NextDev;
+ DevUnion DriverPrivate;
+} I2CDevRec;
+
+I2CDevPtr xf86CreateI2CDevRec(void);
+void xf86DestroyI2CDevRec(I2CDevPtr pI2CDev, Bool unalloc);
+Bool xf86I2CDevInit(I2CDevPtr pI2CDev);
+I2CDevPtr xf86I2CFindDev(I2CBusPtr, I2CSlaveAddr);
+
+/* See descriptions of these functions in xf86i2c.c */
+
+Bool xf86I2CProbeAddress(I2CBusPtr pI2CBus, I2CSlaveAddr);
+Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite,
+ I2CByte *ReadBuffer, int nRead);
+#define xf86I2CRead(d, rb, nr) xf86I2CWriteRead(d, NULL, 0, rb, nr)
+Bool xf86I2CReadStatus(I2CDevPtr d, I2CByte *pbyte);
+Bool xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte);
+Bool xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte, int n);
+Bool xf86I2CReadWord(I2CDevPtr d, I2CByte subaddr, unsigned short *pword);
+#define xf86I2CWrite(d, wb, nw) xf86I2CWriteRead(d, wb, nw, NULL, 0)
+Bool xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte);
+Bool xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *WriteBuffer, int nWrite);
+Bool xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word);
+Bool xf86I2CWriteVec(I2CDevPtr d, I2CByte *vec, int nValues);
+
+#endif /*_XF86I2C_H */
diff --git a/hw/xfree86/i2c/xf86i2cmodule.c b/hw/xfree86/i2c/xf86i2cmodule.c
new file mode 100644
index 000000000..de923b2f0
--- /dev/null
+++ b/hw/xfree86/i2c/xf86i2cmodule.c
@@ -0,0 +1,34 @@
+/* (c) Itai Nahshon
+ *
+ * This code is derived from and inspired by the I2C driver
+ * from the Linux kernel.
+ * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2cmodule.c,v 1.7 1999/04/11 13:11:02 dawes Exp $ */
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(i2cSetup);
+
+static XF86ModuleVersionInfo i2cVersRec =
+{
+ "i2c",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 2, 0,
+ ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData i2cModuleData = { &i2cVersRec, i2cSetup, NULL };
+
+static pointer
+i2cSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
+/* ErrorF("i2cSetup\n"); */
+ return (pointer)1;
+}
diff --git a/hw/xfree86/int10/INT10.HOWTO b/hw/xfree86/int10/INT10.HOWTO
new file mode 100644
index 000000000..bba0c774f
--- /dev/null
+++ b/hw/xfree86/int10/INT10.HOWTO
@@ -0,0 +1,344 @@
+
+ INT10 X86 Real Mode executor
+ =============================
+
+ PRELIMINARY
+
+INT10 is a XFree86 module for soft-booting and executing real mode
+int10 BIOS calls. The BIOS call code is largely untested, yet.
+
+1. Usage
+========
+
+To use the int10 module in a driver the header file
+xfree86/os-support/int10/xf86int10.h must be included.
+
+ a. Initialization
+ -----------------
+
+The int10-executer gets initialized by calling:
+
+ xf86Int10InfoPtr xf86InitInt10(int entityIndex);
+
+The function will soft-boot any non-primary device and return a
+pointer to a xf86Int10InfoRec on success. If anything fails or if
+int10 execution is disabled by an option in the device section NULL
+will be returned. The driver should store this pointer for later
+calls to other int10 module functions.
+
+ b. Memory allocation
+ --------------------
+
+To allocate memory in the real mode execution environment
+
+ void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off);
+
+can be called. It allocates num consecutive pagesize chunks. It
+returns the address of the allocated area. off is set to its offset in
+the real mode memory space.
+
+ void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num);
+
+Is used to free num pages beginning at pbase.
+
+ c. Doing int10 BIOS calls
+ -------------------------
+
+The BIOS call is executed by calling:
+
+ void xf86ExecX86int10(xf86Int10InfoPtr pInt);
+
+The number of the interrupt (normally 10) and the initial values of
+the ax, bx, cx, dx, si, di and es x86-CPU registers can be set in the
+xf86Int10InfoRec passed to the function. On return this structure
+contains the exit values of the registers listed above and the CPU
+flag register.
+
+ d. De-initializing
+ -----------------
+
+If no further int10 calls are required for a certain chipset
+the driver should call:
+
+ void xf86FreeInt10(xf86Int10InfoPtr pInt);
+
+to free the memory allocated for real mode int10 calls.
+
+
+2. Porting issues
+=================
+
+The int10 real mode executor is designed to run on top of various x86
+CPU emulators as well as in vm86 mode of a real x86 CPU. If used with
+a CPU emulator the emulator and CPU specific interfaces can be held
+separate thus requiring minimal efforts to port the int10 module to
+new platforms. Currently an interface to the x86emu real mode
+emulator is provided. Since details of setting up and running the
+vm86 mode is platform dependent both the platform dependent
+environment and the emulation layer have to be ported. Several helper
+functions are provided for that.
+
+A CPU emulator should meet certain requirements to be usable
+for the INT10 executor:
+
+1. It must trap calls to intXX instructions and pass execution to an
+ external function which is allowed to modify CPU registers
+ including the instruction pointer (IP) before returning to the
+ emulator for continuing execution. When the external function is
+ called the IP must point to the instruction past the intXX call.
+
+2. The emulator should use externally provided functions to handle
+ PIO.
+
+3. The emulator should be able to use externally provided functions
+ to access memory from the real mode memory environment. Note, that
+ the vm86 mode usually requires one hunk of consecutive memory
+ starting at address 0 in the process virtual memory space. Thus if
+ this mode is to be used, the OS environment has to be able to provide
+ that, ie. it must be able to remap the processes virtual memory space
+ onto itself. If the emulator is able to handle memory access thru
+ externally provided functions the real mode process memory can be
+ located anywhere in the processes virtual memory. It does not even
+ have to be consecutive.
+
+4. The executor should terminate on encountering a 'hlt' instruction.
+
+
+Functions to implement:
+
+To simplify development the code has been split into a general setup
+part and an emulator specific one. A generic setup code is provided in
+generic.c. It should be usable with any emulator satisfying the
+conditions mentioned above. Therefore the following section on int10
+setup may be skipped when porting int10 to new emulator.
+
+If the vm86() is to be used no memory access functions can be used.
+Therefore the layout of the real mode memory image has to meet certain
+requirements. Therefore when porting to other platforms a new setup
+code may have to be designed, too. The following section will give
+guidelines how this may be done. A sample implementation using SysV
+IPC to map the appropriate real mode memory image to address 0 in
+virtual address space just prior to execution may be found in
+xfree86/os-support/linux/int10/linux.c.
+
+On non-PC like platforms emulation of certain PC features such as
+initialization of BIOS int vectors, sys_BIOS constants or PCI config
+method 1 can be turned on by defining _PC.
+
+I. Setup Code
+-------------
+
+This sets up the real mode memory image, calls the emulator to POST
+the chipset if required and maintains memory allocations in real mode
+address space.
+
+1. xf86Int10InfoPtr xf86InitInt10(int entityIndex);
+
+This function should first find the screen assigned to the entity
+carrying entitiyIndex and then call
+
+ Bool int10skip(ScrnInfoPtr pScrn)
+
+to find out if the user has requested not to initialize int10. If so
+xf86InitInt10() should return NULL. Otherwise an xf86Int10InfoRec
+should be allocated. This structure contains the following fields:
+
+ a. int entityIndex - index of the entity whose BIOS is to be
+ executed.
+ b. int scrnIndex - index of the screen assigned the entity.
+ c. pointer cpuRegs - pointer to a emulator/vm86-mode private
+ structure. May hold cpu register values
+ for the emulator.
+ d. CARD16 BIOSseg - Video BIOS segment address.
+ e. pointer private - pointer to a os specific data structure.
+ f. struct _int10Mem* - pointer to a structure to hold the memory
+ access functions for use by an emulator.
+ g. int num - number of the int to be called.
+ h. int ax..es,flags - CPU register values to pass to int-call.
+
+The Init function should initialize a-f. To initialize the emulator
+specific execute environment the function
+
+ Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
+
+should be called. If this function returns FALSE any already allocated
+memory should be freed and xf86Int10Init(0 should exit returning NULL.
+
+If the platform has a PC like system BIOS it may be copied to or
+mapped into memory locations SYS_BIOS to SYS_SIZE-1 of the real mode
+memory environment of this process. Otherwise the helper function:
+
+int setup_system_bios(CARD32 base_addr);
+
+may be called to set up a rudimentary system BIOS sufficient to be
+used to boot video BIOSes. base_addr specifies the virtual address
+corresponding to SYS_BIOS in the real mode environment. If a PC-like
+int vector and BIOS data area is available it should be copied to 0 to
+LOW_PAGE_SIZE of the entities real mode environment. In this case the
+video interrupt related entries should be reset for all non-primary
+cards by calling:
+
+void reset_int_vect(xf86Int10InfoPtr pInt); To initialize the
+
+correct video BIOS entry points the BIOS must be warm-booted. If no
+PC-like int vector is available one can be set up by calling
+
+void setup_int_vect(xf86Int10InfoPtr pInt);
+
+In this case the video BIOS has to be warm-booted always. If the
+video BIOS for this entity has been installed during boot it may be
+mapped (or copied) directly to the correct address in the real mode
+memory environment. Otherwise
+
+int mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address);
+
+should be called to copy the BIOS image from PCI ROM. 'address'
+specifies the address this image should be copied to. Sufficient space
+to hold an entire BIOS image should be allocated prior to calling
+mapPciRom(). This function will return the size of the BIOS image in
+bytes if it was able to successfully copy the image and 0
+otherwise. To create a well defined point to exit the softbooter
+
+void set_return_trap(xf86Int10Ptr pInt);
+
+may be called. It sets up a 'hlt' instruction in the emulator memory
+just above the BIOS variable area. Before entering real mode execution
+this address will be pushed onto the return stack. If the BIOS needs
+to be warm-booted this should be done before leaving xf86InitInt10()
+by setting num in the xf86Int10InfoRec to 0xe6 and calling
+
+void xf86ExecX86int10(xf86Int10IfoPtr pInt);
+
+The implementation of this function will be discussed below. This
+function should be wrapped by calls to void LockLegacyVGA(screen,
+legacyVGAPtr vga); and void UnlockLegacyVGA(screen, legacyVGAPtr vga);
+The struct vga is used to hold the state of the legacy VGA access
+registers if a legacy VGA device exists. xf86InitInt10() should
+return a pointer to the xf86Int10InfoRec allocated.
+
+2. Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
+
+In case a platform specific mapping has to be performed to map the
+memory allocated for the real mode memory environment into a specific
+location prior to executing the x86 real mode code a function
+
+ Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
+
+has to be provided. It will be called by a helper function whenever
+the active entity changes. If the vm86 mode is used it is most likely
+that the 1MB real mode memory space located somewhere in the processes
+virtual memory will have to be remapped to address 0 of the virtual
+memory space.
+
+3. void xf86FreeInt10(xf86Int10InfoPtr pInt);
+
+To free all memory allocated for video BIOS calls of a specific entity
+the function
+
+ void xf86FreeInt10(xf86Int10InfoPtr pInt);
+
+should be provided. If the entity to be freed was mapped by
+MapCurrentInt10() this mapping needs to be undone also.
+
+4.
+ void * xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off)
+ void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
+
+xf86Int10AllocPages() should allocate 'num' consecutive page-size
+chunks of memory. In real mode memory space this range needs to occupy
+consecutive addresses, too. The function must return the address of
+this memory. The offset in real mode memory needs to be returned in
+'off'. If no block of 'num' pages are available the function should
+return NULL.
+
+xf86Int10FreePages() will free the 'num' pages starting at 'pbase'.
+'num' is equal to the number of pages allocated by a single
+xf86Int10AllocatePages() call. 'pbase' is the address of the range
+previously returned by xf86Int10AllocatePages().
+
+II. Emulator specific functions
+-------------------------------
+
+1. Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
+
+This function will be called from xf86InitInt10(). It may be used to
+set up the static emulator specific part of the real mode
+environment. On success it should return TRUE.
+
+2. xf86ExecX86int10(xf86Int10InfoPtr pInt);
+
+This function gets called to execute an int call. It may call the
+helper function:
+
+ void setup_int(xf86Int10InfoPrt pInt);
+
+to copy the register values to the emulator specific locations and to
+set up the non-static real mode execution environment. On return from
+setup_int() 'Int10Current' holds a pointer to the current
+xf86Int10InfoRec.
+
+It should start execution by calling
+
+ Bool int_handler(xf86Int10InfoPtr pInt);
+
+and if this function returns TRUE it should call whatever necessary to
+continue execution until a 'hlt' instruction is encountered. To copy
+the resulting register values back to the xf86Int10InfoRec structure
+
+ void finish_int(xf86Int10InfoPtr pInt);
+
+should be called.
+
+Helper functions are provided to aid the implementation of a vm86
+call:
+
+ Bool vm86_GP_fault(xf86Int10InfoPtr pInt);
+
+This function handles instructions which cause a vm86 call to
+trap. PIO access is handled by the in/out calls as defined in
+compiler.h. Optionally the PIO instructions can be logged by defining
+PRINT_PORT in xf86int10.h. This is meant for debugging purposes.
+
+Unknown instructions and 'hlt' cause vm86_GP_fault() to return
+FALSE. Otherwise TRUE is returned.
+
+Note: This function is currently based on the Linux vm86 call. It
+might have to be modified or even rewritten for other OS. So your
+milage may vary.
+
+Functions to dump memory, code, xf86 CPU register values and stack are
+also provided. Take a look at helper.c To view a memory range the
+function
+
+ void dprint(unsigned long start, unsigned long size)
+
+is provided. The use should be self explanatory.
+
+Register and memory access functions are provided in helper_mem.c.
+The PIO register access functions can trap access to PCI config space
+access register (config method 1) if _PC is not defined.
+
+A header file 'defines.h' is required to define OS/emulator specific
+ways to access memory and xf86 CPU registers: Defines need to be
+provided for memory byte/work/long read/write access
+(MEM_RB(name,addr),MEM_RW(name,addr),MEM_RL(name,addr),
+MEM_WB(name,addr,val),MEM_WL(name,addr,val),MEM_WL(name,addr,val)) of
+the real mode memory environment. 'name' will contain a pointer to the
+current xf86Int10InfoRec. Currently defines are available for
+vm86-mode under Linux and x86emu. They may be activated by defining
+_X86EMU or _VM86_LINUX respectively.
+
+Note: Emulators usually are not able to pass this pointer when calling
+memory access functions. In this case a global variable should be
+defined which can hold this pointer. This variable can be set in
+MapCurrentInt10(). It also must be set in xf86InitInt10() if this
+function calls the memory access functions either directly or by
+calling xf86ExecX86int10(pInt). Defines to access the emulator
+specific xf86 CPU register locations are also required:
+X86_EAX,...,X86_EFLAGS for access of the full 32 bit registers,
+X86_AX...X86_FLAGS for access of the 16 bit registers and
+XF86_AL,XF86_BL,XF86_CL,XF86_DL to access the lower byte of the
+AX,BX,CX and DX register.
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.3 2001/04/30 14:34:57 tsi Exp $
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
new file mode 100644
index 000000000..d481f000d
--- /dev/null
+++ b/hw/xfree86/int10/generic.c
@@ -0,0 +1,552 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.25.2.1 2003/03/20 15:14:25 tsi Exp $ */
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+#include "compiler.h"
+#define _INT10_PRIVATE
+#include "xf86int10.h"
+#include "int10Defines.h"
+
+#define ALLOC_ENTRIES(x) ((V_RAM / x) - 1)
+
+static CARD8 read_b(xf86Int10InfoPtr pInt,int addr);
+static CARD16 read_w(xf86Int10InfoPtr pInt,int addr);
+static CARD32 read_l(xf86Int10InfoPtr pInt,int addr);
+static void write_b(xf86Int10InfoPtr pInt,int addr, CARD8 val);
+static void write_w(xf86Int10InfoPtr pInt,int addr, CARD16 val);
+static void write_l(xf86Int10InfoPtr pInt,int addr, CARD32 val);
+
+/*
+ * the emulator cannot pass a pointer to the current xf86Int10InfoRec
+ * to the memory access functions therefore store it here.
+ */
+
+typedef struct {
+ int shift;
+ int entries;
+ void* base;
+ void* vRam;
+ int highMemory;
+ void* sysMem;
+ char* alloc;
+} genericInt10Priv;
+
+#define INTPriv(x) ((genericInt10Priv*)x->private)
+
+int10MemRec genericMem = {
+ read_b,
+ read_w,
+ read_l,
+ write_b,
+ write_w,
+ write_l
+};
+
+static void MapVRam(xf86Int10InfoPtr pInt);
+static void UnmapVRam(xf86Int10InfoPtr pInt);
+#ifdef _PC
+#define GET_HIGH_BASE(x) (((V_BIOS + size + getpagesize() - 1)/getpagesize()) \
+ * getpagesize())
+#endif
+
+static void *sysMem = NULL;
+
+xf86Int10InfoPtr
+xf86InitInt10(int entityIndex)
+{
+ return xf86ExtendedInitInt10(entityIndex, 0);
+}
+
+xf86Int10InfoPtr
+xf86ExtendedInitInt10(int entityIndex, int Flags)
+{
+ xf86Int10InfoPtr pInt;
+ void* base = 0;
+ void* vbiosMem = 0;
+ void* options = NULL;
+ pciVideoPtr pvp;
+ int screen;
+ legacyVGARec vga;
+ xf86int10BiosLocation bios;
+
+#ifdef _PC
+ int size;
+ CARD32 cs;
+#endif
+
+ screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
+
+ options = xf86HandleInt10Options(xf86Screens[screen],entityIndex);
+
+ if (int10skip(options)) {
+ xfree(options);
+ return NULL;
+ }
+
+ pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
+ pInt->entityIndex = entityIndex;
+ if (!xf86Int10ExecSetup(pInt))
+ goto error0;
+ pInt->mem = &genericMem;
+ pInt->private = (pointer)xnfcalloc(1, sizeof(genericInt10Priv));
+ INTPriv(pInt)->alloc = (pointer)xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
+ pInt->scrnIndex = screen;
+ base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS);
+
+ pvp = xf86GetPciInfoForEntity(entityIndex);
+ if (pvp) pInt->Tag = ((pciConfigPtr)(pvp->thisCard))->tag;
+
+ /*
+ * we need to map video RAM MMIO as some chipsets map mmio
+ * registers into this range.
+ */
+ MapVRam(pInt);
+#ifdef _PC
+ if (!sysMem)
+ sysMem = xf86MapVidMem(screen, VIDMEM_MMIO, V_BIOS,
+ BIOS_SIZE + SYS_BIOS - V_BIOS);
+ INTPriv(pInt)->sysMem = sysMem;
+
+ if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
+ goto error1;
+ }
+
+ /*
+ * Retrieve everything between V_BIOS and SYS_BIOS as some system BIOSes
+ * have executable code there. Note that xf86ReadBIOS() can only read in
+ * 64kB at a time.
+ */
+ (void)memset((char *)base + V_BIOS, 0, SYS_BIOS - V_BIOS);
+#if 0
+ for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE)
+ if (xf86ReadBIOS(cs, 0, (unsigned char *)base + cs, V_BIOS_SIZE) <
+ V_BIOS_SIZE)
+ xf86DrvMsg(screen, X_WARNING,
+ "Unable to retrieve all of segment 0x%06X.\n", cs);
+#endif
+ INTPriv(pInt)->highMemory = V_BIOS;
+
+ xf86int10ParseBiosLocation(options,&bios);
+
+ if (xf86IsEntityPrimary(entityIndex)
+ && !(initPrimary(options))) {
+
+ if (bios.bus == BUS_ISA && bios.location.legacy) {
+ xf86DrvMsg(screen, X_CONFIG,
+ "Overriding BIOS location: 0x%lx\n",
+ bios.location.legacy);
+ cs = bios.location.legacy >> 4;
+#define CHECK_V_SEGMENT_RANGE(x) \
+ if ((x << 4) < V_BIOS) {\
+ xf86DrvMsg(screen, X_ERROR, \
+ "V_BIOS address 0x%x out of range\n",x << 4); \
+ goto error1; \
+ }
+ CHECK_V_SEGMENT_RANGE(cs);
+ vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
+ if (!int10_check_bios(screen, cs, vbiosMem)) {
+ xf86DrvMsg(screen, X_ERROR,
+ "No V_BIOS at specified address 0x%x\n",cs << 4);
+ goto error1;
+ }
+ } else {
+ if (bios.bus == BUS_PCI) {
+ xf86DrvMsg(screen, X_WARNING,
+ "Option BiosLocation for primary device ignored: "
+ "It points to PCI.\n");
+ xf86DrvMsg(screen, X_WARNING,
+ "You must set Option InitPrimary also\n");
+ }
+
+ cs = MEM_RW(pInt,((0x10<<2)+2));
+ CHECK_V_SEGMENT_RANGE(cs);
+ vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
+ if (!int10_check_bios(screen, cs, vbiosMem)) {
+ cs = MEM_RW(pInt, (0x42 << 2) + 2);
+ CHECK_V_SEGMENT_RANGE(cs);
+ vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
+ if (!int10_check_bios(screen, cs, vbiosMem)) {
+ cs = V_BIOS >> 4;
+ vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
+ if (!int10_check_bios(screen, cs, vbiosMem)) {
+ xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
+ goto error1;
+ }
+ }
+ }
+ }
+
+ xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs);
+
+ set_return_trap(pInt);
+ pInt->BIOSseg = cs;
+
+ pInt->Flags = Flags & (SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH);
+ if (! (pInt->Flags & SET_BIOS_SCRATCH))
+ pInt->Flags &= ~RESTORE_BIOS_SCRATCH;
+ xf86Int10SaveRestoreBIOSVars(pInt, TRUE);
+
+ } else {
+ BusType location_type;
+ int bios_location = V_BIOS;
+ int pci_entity;
+
+ EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
+ reset_int_vect(pInt);
+ set_return_trap(pInt);
+
+ if (bios.bus != BUS_NONE) {
+ switch (location_type = bios.bus) {
+ case BUS_PCI:
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "PCI:%i:%i%i\n",bios.location.pci.bus,
+ bios.location.pci.dev,bios.location.pci.func);
+ break;
+ case BUS_ISA:
+ bios_location = bios.location.legacy;
+ if (bios.location.legacy)
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "Legacy:0x%x\n",bios.location.legacy);
+ else
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "Legacy\n");
+ break;
+ default:
+ break;
+ }
+ } else
+ location_type = pEnt->location.type;
+
+ switch (location_type) {
+ case BUS_PCI:
+ vbiosMem = (unsigned char *)base + bios_location;
+ if (bios.bus == BUS_PCI)
+ pci_entity = xf86GetPciEntity(bios.location.pci.bus,
+ bios.location.pci.dev,
+ bios.location.pci.func);
+ else
+ pci_entity = pInt->entityIndex;
+ if (!(size = mapPciRom(pci_entity,(unsigned char *)(vbiosMem)))) {
+ xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (3)\n");
+ goto error1;
+ }
+ INTPriv(pInt)->highMemory = GET_HIGH_BASE(size);
+ break;
+ case BUS_ISA:
+ vbiosMem = (unsigned char *)sysMem + bios_location;
+#if 0
+ (void)memset(vbiosMem, 0, V_BIOS_SIZE);
+ if (xf86ReadBIOS(bios_location, 0, vbiosMem, V_BIOS_SIZE)
+ < V_BIOS_SIZE)
+ xf86DrvMsg(screen, X_WARNING,
+ "Unable to retrieve all of segment 0x%x.\n",bios_location);
+#endif
+ if (!int10_check_bios(screen, bios_location >> 4, vbiosMem)) {
+ xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (4)\n");
+ goto error1;
+ }
+ default:
+ goto error1;
+ }
+ xfree(pEnt);
+ pInt->BIOSseg = V_BIOS >> 4;
+ pInt->num = 0xe6;
+ LockLegacyVGA(pInt, &vga);
+ xf86ExecX86int10(pInt);
+ UnlockLegacyVGA(pInt, &vga);
+ }
+#else
+ if (!sysMem) {
+ sysMem = xnfalloc(BIOS_SIZE);
+ setup_system_bios(sysMem);
+ }
+ INTPriv(pInt)->sysMem = sysMem;
+ setup_int_vect(pInt);
+ set_return_trap(pInt);
+
+ /*
+ * Retrieve two segments: one at V_BIOS, the other 64kB beyond the first.
+ * This'll catch any BIOS that might have been initialised before server
+ * entry.
+ */
+ vbiosMem = (char *)base + V_BIOS;
+ (void)memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
+ if (xf86ReadDomainMemory(pInt->Tag, V_BIOS, V_BIOS_SIZE, vbiosMem) <
+ V_BIOS_SIZE)
+ xf86DrvMsg(screen, X_WARNING,
+ "Unable to retrieve all of segment 0x0C0000.\n");
+ else if ((((unsigned char *)vbiosMem)[0] == 0x55) &&
+ (((unsigned char *)vbiosMem)[1] == 0xAA) &&
+ (((unsigned char *)vbiosMem)[2] > 0x80))
+ if (xf86ReadDomainMemory(pInt->Tag, V_BIOS + V_BIOS_SIZE, V_BIOS_SIZE,
+ (unsigned char *)vbiosMem + V_BIOS_SIZE) < V_BIOS_SIZE)
+ xf86DrvMsg(screen, X_WARNING,
+ "Unable to retrieve all of segment 0x0D0000.\n");
+
+ /*
+ * If this adapter is the primary, use its post-init BIOS (if we can find
+ * it).
+ */
+ xf86int10ParseBiosLocation(options,&bios);
+
+ {
+ int bios_location = V_BIOS;
+ Bool done = FALSE;
+ vbiosMem = (unsigned char *)base + bios_location;
+
+ if ((bios.bus == BUS_ISA)
+ || (bios.bus != BUS_PCI && xf86IsEntityPrimary(entityIndex))) {
+ if (bios.bus == BUS_ISA && bios.location.legacy) {
+ xf86DrvMsg(screen, X_CONFIG,"Looking for legacy V_BIOS "
+ "at 0x%x for %sprimary device\n",
+ bios.location.legacy,
+ xf86IsEntityPrimary(entityIndex) ? "" : "non-");
+ bios_location = bios.location.legacy;
+ vbiosMem = (unsigned char *)base + bios_location;
+ }
+ if (int10_check_bios(screen, bios_location >> 4, vbiosMem))
+ done = TRUE;
+ else
+ xf86DrvMsg(screen,X_INFO,
+ "No legacy BIOS found -- trying PCI\n");
+ }
+ if (!done) {
+ int pci_entity;
+
+ if (bios.bus == BUS_PCI) {
+ xf86DrvMsg(screen,X_CONFIG,"Looking for BIOS at PCI:%i%i%i\n",
+ bios.location.pci.bus,bios.location.pci.dev,
+ bios.location.pci.func);
+ pci_entity = xf86GetPciEntity(bios.location.pci.bus,
+ bios.location.pci.dev,
+ bios.location.pci.func);
+ } else
+ pci_entity = pInt->entityIndex;
+
+ if (!mapPciRom(pci_entity, vbiosMem)) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5)\n");
+ goto error1;
+ }
+ }
+
+ }
+
+ pInt->BIOSseg = V_BIOS >> 4;
+ pInt->num = 0xe6;
+ LockLegacyVGA(pInt, &vga);
+ xf86ExecX86int10(pInt);
+ UnlockLegacyVGA(pInt, &vga);
+#endif
+ xfree(options);
+ return pInt;
+
+ error1:
+ xfree(base);
+ UnmapVRam(pInt);
+ xfree(INTPriv(pInt)->alloc);
+ xfree(pInt->private);
+ error0:
+ xfree(pInt);
+ xfree(options);
+
+ return NULL;
+}
+
+static void
+MapVRam(xf86Int10InfoPtr pInt)
+{
+ int pagesize = getpagesize();
+ int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize;
+
+ INTPriv(pInt)->vRam = xf86MapDomainMemory(pInt->scrnIndex, VIDMEM_MMIO,
+ pInt->Tag, V_RAM, size);
+
+ pInt->ioBase = xf86Screens[pInt->scrnIndex]->domainIOBase;
+}
+
+static void
+UnmapVRam(xf86Int10InfoPtr pInt)
+{
+ int screen = pInt->scrnIndex;
+ int pagesize = getpagesize();
+ int size = ((VRAM_SIZE + pagesize - 1)/pagesize) * pagesize;
+
+ xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size);
+}
+
+Bool
+MapCurrentInt10(xf86Int10InfoPtr pInt)
+{
+ /* nothing to do here */
+ return TRUE;
+}
+
+void
+xf86FreeInt10(xf86Int10InfoPtr pInt)
+{
+ if (!pInt)
+ return;
+#if defined (_PC)
+ xf86Int10SaveRestoreBIOSVars(pInt, FALSE);
+#endif
+ if (Int10Current == pInt)
+ Int10Current = NULL;
+ xfree(INTPriv(pInt)->base);
+ UnmapVRam(pInt);
+ xfree(INTPriv(pInt)->alloc);
+ xfree(pInt->private);
+ xfree(pInt);
+}
+
+void *
+xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
+{
+ int pagesize = getpagesize();
+ int num_pages = ALLOC_ENTRIES(pagesize);
+ int i,j;
+
+ for (i = 0; i < (num_pages - num); i++) {
+ if (INTPriv(pInt)->alloc[i] == 0) {
+ for (j = i; j < (num + i); j++)
+ if (INTPriv(pInt)->alloc[j] != 0)
+ break;
+ if (j == (num + i))
+ break;
+ i += num;
+ }
+ }
+ if (i == (num_pages - num))
+ return NULL;
+
+ for (j = i; j < (i + num); j++)
+ INTPriv(pInt)->alloc[j] = 1;
+
+ *off = (i + 1) * pagesize;
+
+ return (char *)INTPriv(pInt)->base + *off;
+}
+
+void
+xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
+{
+ int pagesize = getpagesize();
+ int first = (((char *)pbase - (char *)INTPriv(pInt)->base) / pagesize) - 1;
+ int i;
+
+ for (i = first; i < (first + num); i++)
+ INTPriv(pInt)->alloc[i] = 0;
+}
+
+#define OFF(addr) ((addr) & 0xffff)
+#if defined _PC
+# define HIGH_OFFSET (INTPriv(pInt)->highMemory)
+# define HIGH_BASE V_BIOS
+#else
+# define HIGH_OFFSET SYS_BIOS
+# define HIGH_BASE SYS_BIOS
+#endif
+# define SYS(addr) ((addr) >= HIGH_OFFSET)
+#define V_ADDR(addr) \
+ (SYS(addr) ? ((char*)INTPriv(pInt)->sysMem) + (addr - HIGH_BASE) \
+ : (((char*)(INTPriv(pInt)->base) + addr)))
+#define VRAM_ADDR(addr) (addr - V_RAM)
+#define VRAM_BASE (INTPriv(pInt)->vRam)
+
+#define VRAM(addr) ((addr >= V_RAM) && (addr < (V_RAM + VRAM_SIZE)))
+#define V_ADDR_RB(addr) \
+ (VRAM(addr)) ? MMIO_IN8((CARD8*)VRAM_BASE,VRAM_ADDR(addr)) \
+ : *(CARD8*) V_ADDR(addr)
+#define V_ADDR_RW(addr) \
+ (VRAM(addr)) ? MMIO_IN16((CARD16*)VRAM_BASE,VRAM_ADDR(addr)) \
+ : ldw_u((pointer)V_ADDR(addr))
+#define V_ADDR_RL(addr) \
+ (VRAM(addr)) ? MMIO_IN32((CARD32*)VRAM_BASE,VRAM_ADDR(addr)) \
+ : ldl_u((pointer)V_ADDR(addr))
+
+#define V_ADDR_WB(addr,val) \
+ if(VRAM(addr)) \
+ MMIO_OUT8((CARD8*)VRAM_BASE,VRAM_ADDR(addr),val); \
+ else \
+ *(CARD8*) V_ADDR(addr) = val;
+#define V_ADDR_WW(addr,val) \
+ if(VRAM(addr)) \
+ MMIO_OUT16((CARD16*)VRAM_BASE,VRAM_ADDR(addr),val); \
+ else \
+ stw_u((val),(pointer)(V_ADDR(addr)));
+
+#define V_ADDR_WL(addr,val) \
+ if (VRAM(addr)) \
+ MMIO_OUT32((CARD32*)VRAM_BASE,VRAM_ADDR(addr),val); \
+ else \
+ stl_u(val,(pointer)(V_ADDR(addr)));
+
+static CARD8
+read_b(xf86Int10InfoPtr pInt, int addr)
+{
+ return V_ADDR_RB(addr);
+}
+
+static CARD16
+read_w(xf86Int10InfoPtr pInt, int addr)
+{
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ if (OFF(addr + 1) > 0)
+ return V_ADDR_RW(addr);
+#endif
+ return V_ADDR_RB(addr) | (V_ADDR_RB(addr + 1) << 8);
+}
+
+static CARD32
+read_l(xf86Int10InfoPtr pInt, int addr)
+{
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ if (OFF(addr + 3) > 2)
+ return V_ADDR_RL(addr);
+#endif
+ return V_ADDR_RB(addr) |
+ (V_ADDR_RB(addr + 1) << 8) |
+ (V_ADDR_RB(addr + 2) << 16) |
+ (V_ADDR_RB(addr + 3) << 24);
+}
+
+static void
+write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val)
+{
+ V_ADDR_WB(addr,val);
+}
+
+static void
+write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val)
+{
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ if (OFF(addr + 1) > 0)
+ { V_ADDR_WW(addr, val); }
+#endif
+ V_ADDR_WB(addr, val);
+ V_ADDR_WB(addr + 1, val >> 8);
+}
+
+static void
+write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
+{
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ if (OFF(addr + 3) > 2)
+ { V_ADDR_WL(addr, val); }
+#endif
+ V_ADDR_WB(addr, val);
+ V_ADDR_WB(addr + 1, val >> 8);
+ V_ADDR_WB(addr + 2, val >> 16);
+ V_ADDR_WB(addr + 3, val >> 24);
+}
+
+pointer
+xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
+{
+ return V_ADDR(addr);
+}
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
new file mode 100644
index 000000000..2d6c0eb24
--- /dev/null
+++ b/hw/xfree86/int10/helper_exec.c
@@ -0,0 +1,603 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.24 2002/11/25 21:05:49 tsi Exp $ */
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ *
+ * Part of this is based on code taken from DOSEMU
+ * (C) Copyright 1992, ..., 1999 the "DOSEMU-Development-Team"
+ */
+
+/*
+ * To debug port accesses define PRINT_PORT.
+ * Note! You also have to comment out ioperm()
+ * in xf86EnableIO(). Otherwise we won't trap
+ * on PIO.
+ */
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+#include "compiler.h"
+#define _INT10_PRIVATE
+#include "int10Defines.h"
+#include "xf86int10.h"
+
+#if !defined (_PC) && !defined (_PC_PCI)
+static int pciCfg1in(CARD16 addr, CARD32 *val);
+static int pciCfg1out(CARD16 addr, CARD32 val);
+#endif
+#if defined (_PC)
+static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set);
+#endif
+
+#define REG pInt
+
+int
+setup_int(xf86Int10InfoPtr pInt)
+{
+ if (pInt != Int10Current) {
+ if (!MapCurrentInt10(pInt))
+ return -1;
+ Int10Current = pInt;
+ }
+ X86_EAX = (CARD32) pInt->ax;
+ X86_EBX = (CARD32) pInt->bx;
+ X86_ECX = (CARD32) pInt->cx;
+ X86_EDX = (CARD32) pInt->dx;
+ X86_ESI = (CARD32) pInt->si;
+ X86_EDI = (CARD32) pInt->di;
+ X86_EBP = (CARD32) pInt->bp;
+ X86_ESP = 0x1000; X86_SS = pInt->stackseg >> 4;
+ X86_EIP = 0x0600; X86_CS = 0x0; /* address of 'hlt' */
+ X86_DS = 0x40; /* standard pc ds */
+ X86_ES = pInt->es;
+ X86_FS = 0;
+ X86_GS = 0;
+ X86_EFLAGS = X86_IF_MASK | X86_IOPL_MASK;
+#if defined (_PC)
+ if (pInt->flags & SET_BIOS_SCRATCH)
+ SetResetBIOSVars(pInt, TRUE);
+#endif
+ return xf86BlockSIGIO();
+}
+
+void
+finish_int(xf86Int10InfoPtr pInt, int sig)
+{
+ xf86UnblockSIGIO(sig);
+ pInt->ax = (CARD32) X86_EAX;
+ pInt->bx = (CARD32) X86_EBX;
+ pInt->cx = (CARD32) X86_ECX;
+ pInt->dx = (CARD32) X86_EDX;
+ pInt->si = (CARD32) X86_ESI;
+ pInt->di = (CARD32) X86_EDI;
+ pInt->es = (CARD16) X86_ES;
+ pInt->bp = (CARD32) X86_EBP;
+ pInt->flags = (CARD32) X86_FLAGS;
+#if defined (_PC)
+ if (pInt->flags & RESTORE_BIOS_SCRATCH)
+ SetResetBIOSVars(pInt, FALSE);
+#endif
+}
+
+/* general software interrupt handler */
+CARD32
+getIntVect(xf86Int10InfoPtr pInt,int num)
+{
+ return MEM_RW(pInt, num << 2) + (MEM_RW(pInt, (num << 2) + 2) << 4);
+}
+
+void
+pushw(xf86Int10InfoPtr pInt, CARD16 val)
+{
+ X86_ESP -= 2;
+ MEM_WW(pInt, ((CARD32) X86_SS << 4) + X86_SP, val);
+}
+
+int
+run_bios_int(int num, xf86Int10InfoPtr pInt)
+{
+ CARD32 eflags;
+#ifndef _PC
+ /* check if bios vector is initialized */
+ if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) { /* SYS_BIOS_SEG ?*/
+
+ if (num == 21 && X86_AH == 0x4e) {
+ xf86DrvMsg(pInt->scrnIndex, X_NOTICE,
+ "Failing Find-Matching-File on non-PC"
+ " (int 21, func 4e)\n");
+ X86_AX = 2;
+ SET_FLAG(F_CF);
+ return 1;
+ } else {
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "Ignoring int 0x%02x call\n", num);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ return 1;
+ }
+ }
+#endif
+#ifdef PRINT_INT
+ ErrorF("calling card BIOS at: ");
+#endif
+ eflags = X86_EFLAGS;
+#if 0
+ eflags = eflags | IF_MASK;
+ X86_EFLAGS = X86_EFLAGS & ~(VIF_MASK | TF_MASK | IF_MASK | NT_MASK);
+#endif
+ pushw(pInt, eflags);
+ pushw(pInt, X86_CS);
+ pushw(pInt, X86_IP);
+ X86_CS = MEM_RW(pInt, (num << 2) + 2);
+ X86_IP = MEM_RW(pInt, num << 2);
+#ifdef PRINT_INT
+ ErrorF("0x%x:%lx\n", X86_CS, X86_EIP);
+#endif
+ return 1;
+}
+
+/* Debugging stuff */
+void
+dump_code(xf86Int10InfoPtr pInt)
+{
+ int i;
+ CARD32 lina = SEG_ADR((CARD32), X86_CS, IP);
+
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8lx:\n", lina);
+ for (i=0; i<0x10; i++)
+ xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
+ xf86ErrorFVerb(3, "\n");
+ for (; i<0x20; i++)
+ xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
+ xf86ErrorFVerb(3, "\n");
+}
+
+void
+dump_registers(xf86Int10InfoPtr pInt)
+{
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+ "EAX=0x%8.8x, EBX=0x%8.8x, ECX=0x%8.8x, EDX=0x%8.8x\n",
+ X86_EAX, X86_EBX, X86_ECX, X86_EDX);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+ "ESP=0x%8.8x, EBP=0x%8.8x, ESI=0x%8.8x, EDI=0x%8.8x\n",
+ X86_ESP, X86_EBP, X86_ESI, X86_EDI);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+ "CS=0x%4.4x, SS=0x%4.4x,"
+ " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n",
+ X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+ "EIP=0x%8.8x, EFLAGS=0x%8.8x\n", X86_EIP, X86_EFLAGS);
+}
+
+void
+stack_trace(xf86Int10InfoPtr pInt)
+{
+ int i = 0;
+ CARD32 stack = SEG_ADR((CARD32), X86_SS, SP);
+ CARD32 tail = (CARD32)((X86_SS << 4) + 0x1000);
+
+ if (stack >= tail) return;
+
+ xf86MsgVerb(X_INFO, 3, "stack at 0x%8.8lx:\n", stack);
+ for (; stack < tail; stack++) {
+ xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, stack));
+ i = (i + 1) % 0x10;
+ if (!i)
+ xf86ErrorFVerb(3, "\n");
+ }
+ if (i)
+ xf86ErrorFVerb(3, "\n");
+}
+
+int
+port_rep_inb(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -1 : 1;
+ CARD32 dst = base;
+#ifdef PRINT_PORT
+ ErrorF(" rep_insb(%#x) %d bytes at %p %s\n",
+ port, count, base, d_f ? "up" : "down");
+#endif
+ while (count--) {
+ MEM_WB(pInt, dst, x_inb(port));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_inw(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -2 : 2;
+ CARD32 dst = base;
+#ifdef PRINT_PORT
+ ErrorF(" rep_insw(%#x) %d bytes at %p %s\n",
+ port, count, base, d_f ? "up" : "down");
+#endif
+ while (count--) {
+ MEM_WW(pInt, dst, x_inw(port));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_inl(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -4 : 4;
+ CARD32 dst = base;
+#ifdef PRINT_PORT
+ ErrorF(" rep_insl(%#x) %d bytes at %p %s\n",
+ port, count, base, d_f ? "up" : "down");
+#endif
+ while (count--) {
+ MEM_WL(pInt, dst, x_inl(port));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_outb(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -1 : 1;
+ CARD32 dst = base;
+#ifdef PRINT_PORT
+ ErrorF(" rep_outb(%#x) %d bytes at %p %s\n",
+ port, count, base, d_f ? "up" : "down");
+#endif
+ while (count--) {
+ x_outb(port, MEM_RB(pInt, dst));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_outw(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -2 : 2;
+ CARD32 dst = base;
+#ifdef PRINT_PORT
+ ErrorF(" rep_outw(%#x) %d bytes at %p %s\n",
+ port, count, base, d_f ? "up" : "down");
+#endif
+ while (count--) {
+ x_outw(port, MEM_RW(pInt, dst));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_outl(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -4 : 4;
+ CARD32 dst = base;
+#ifdef PRINT_PORT
+ ErrorF(" rep_outl(%#x) %d bytes at %p %s\n",
+ port, count, base, d_f ? "up" : "down");
+#endif
+ while (count--) {
+ x_outl(port, MEM_RL(pInt, dst));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+CARD8
+x_inb(CARD16 port)
+{
+ CARD8 val;
+
+ if (port == 0x40) {
+ Int10Current->inb40time++;
+ val = (CARD8)(Int10Current->inb40time >>
+ ((Int10Current->inb40time & 1) << 3));
+#ifdef PRINT_PORT
+ ErrorF(" inb(%#x) = %2.2x\n", port, val);
+#endif
+#ifdef __NOT_YET__
+ } else if (port < 0x0100) { /* Don't interfere with mainboard */
+ val = 0;
+ xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "inb 0x%4.4x\n", port);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(Int10Current);
+ stack_trace(Int10Current);
+ }
+#endif /* __NOT_YET__ */
+ } else {
+ val = inb(Int10Current->ioBase + port);
+#ifdef PRINT_PORT
+ ErrorF(" inb(%#x) = %2.2x\n", port, val);
+#endif
+ }
+ return val;
+}
+
+CARD16
+x_inw(CARD16 port)
+{
+ CARD16 val;
+
+ if (port == 0x5c) {
+ /*
+ * Emulate a PC98's timer. Typical resolution is 3.26 usec.
+ * Approximate this by dividing by 3.
+ */
+ long sec, usec;
+ (void)getsecs(&sec, &usec);
+ val = (CARD16)(usec / 3);
+ } else {
+ val = inw(Int10Current->ioBase + port);
+ }
+#ifdef PRINT_PORT
+ ErrorF(" inw(%#x) = %4.4x\n", port, val);
+#endif
+ return val;
+}
+
+void
+x_outb(CARD16 port, CARD8 val)
+{
+ if ((port == 0x43) && (val == 0)) {
+ /*
+ * Emulate a PC's timer 0. Such timers typically have a resolution of
+ * some .838 usec per tick, but this can only provide 1 usec per tick.
+ * (Not that this matters much, given inherent emulation delays.) Use
+ * the bottom bit as a byte select. See inb(0x40) above.
+ */
+ long sec, usec;
+ (void) getsecs(&sec, &usec);
+ Int10Current->inb40time = (CARD16)(usec | 1);
+#ifdef PRINT_PORT
+ ErrorF(" outb(%#x, %2.2x)\n", port, val);
+#endif
+#ifdef __NOT_YET__
+ } else if (port < 0x0100) { /* Don't interfere with mainboard */
+ xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "outb 0x%4.4x,0x%2.2x\n", port, val);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(Int10Current);
+ stack_trace(Int10Current);
+ }
+#endif /* __NOT_YET__ */
+ } else {
+#ifdef PRINT_PORT
+ ErrorF(" outb(%#x, %2.2x)\n", port, val);
+#endif
+ outb(Int10Current->ioBase + port, val);
+ }
+}
+
+void
+x_outw(CARD16 port, CARD16 val)
+{
+#ifdef PRINT_PORT
+ ErrorF(" outw(%#x, %4.4x)\n", port, val);
+#endif
+
+ outw(Int10Current->ioBase + port, val);
+}
+
+CARD32
+x_inl(CARD16 port)
+{
+ CARD32 val;
+
+#if !defined(_PC) && !defined(_PC_PCI)
+ if (!pciCfg1in(port, &val))
+#endif
+ val = inl(Int10Current->ioBase + port);
+
+#ifdef PRINT_PORT
+ ErrorF(" inl(%#x) = %8.8x\n", port, val);
+#endif
+ return val;
+}
+
+void
+x_outl(CARD16 port, CARD32 val)
+{
+#ifdef PRINT_PORT
+ ErrorF(" outl(%#x, %8.8x)\n", port, val);
+#endif
+
+#if !defined(_PC) && !defined(_PC_PCI)
+ if (!pciCfg1out(port, val))
+#endif
+ outl(Int10Current->ioBase + port, val);
+}
+
+CARD8
+Mem_rb(CARD32 addr)
+{
+ return (*Int10Current->mem->rb)(Int10Current, addr);
+}
+
+CARD16
+Mem_rw(CARD32 addr)
+{
+ return (*Int10Current->mem->rw)(Int10Current, addr);
+}
+
+CARD32
+Mem_rl(CARD32 addr)
+{
+ return (*Int10Current->mem->rl)(Int10Current, addr);
+}
+
+void
+Mem_wb(CARD32 addr, CARD8 val)
+{
+ (*Int10Current->mem->wb)(Int10Current, addr, val);
+}
+
+void
+Mem_ww(CARD32 addr, CARD16 val)
+{
+ (*Int10Current->mem->ww)(Int10Current, addr, val);
+}
+
+void
+Mem_wl(CARD32 addr, CARD32 val)
+{
+ (*Int10Current->mem->wl)(Int10Current, addr, val);
+}
+
+#if !defined(_PC) && !defined(_PC_PCI)
+static CARD32 PciCfg1Addr = 0;
+
+#define TAG(Cfg1Addr) (Cfg1Addr & 0xffff00)
+#define OFFSET(Cfg1Addr) (Cfg1Addr & 0xff)
+
+static int
+pciCfg1in(CARD16 addr, CARD32 *val)
+{
+ if (addr == 0xCF8) {
+ *val = PciCfg1Addr;
+ return 1;
+ }
+ if (addr == 0xCFC) {
+ *val = pciReadLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr));
+ return 1;
+ }
+ return 0;
+}
+
+static int
+pciCfg1out(CARD16 addr, CARD32 val)
+{
+ if (addr == 0xCF8) {
+ PciCfg1Addr = val;
+ return 1;
+ }
+ if (addr == 0xCFC) {
+ pciWriteLong(TAG(PciCfg1Addr), OFFSET(PciCfg1Addr),val);
+ return 1;
+ }
+ return 0;
+}
+#endif
+
+CARD8
+bios_checksum(CARD8 *start, int size)
+{
+ CARD8 sum = 0;
+
+ while (size-- > 0)
+ sum += *start++;
+ return sum;
+}
+
+/*
+ * Lock/Unlock legacy VGA. Some Bioses try to be very clever and make
+ * an attempt to detect a legacy ISA card. If they find one they might
+ * act very strange: for example they might configure the card as a
+ * monochrome card. This might cause some drivers to choke.
+ * To avoid this we attempt legacy VGA by writing to all know VGA
+ * disable registers before we call the BIOS initialization and
+ * restore the original values afterwards. In beween we hold our
+ * breath. To get to a (possibly exising) ISA card need to disable
+ * our current PCI card.
+ */
+/*
+ * This is just for booting: we just want to catch pure
+ * legacy vga therefore we don't worry about mmio etc.
+ * This stuff should really go into vgaHW.c. However then
+ * the driver would have to load the vga-module prior to
+ * doing int10.
+ */
+void
+LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
+{
+ xf86SetCurrentAccess(FALSE, xf86Screens[pInt->scrnIndex]);
+ vga->save_msr = inb(pInt->ioBase + 0x03CC);
+ vga->save_vse = inb(pInt->ioBase + 0x03C3);
+#ifndef __ia64__
+ vga->save_46e8 = inb(pInt->ioBase + 0x46E8);
+#endif
+ vga->save_pos102 = inb(pInt->ioBase + 0x0102);
+ outb(pInt->ioBase + 0x03C2, ~(CARD8)0x03 & vga->save_msr);
+ outb(pInt->ioBase + 0x03C3, ~(CARD8)0x01 & vga->save_vse);
+#ifndef __ia64__
+ outb(pInt->ioBase + 0x46E8, ~(CARD8)0x08 & vga->save_46e8);
+#endif
+ outb(pInt->ioBase + 0x0102, ~(CARD8)0x01 & vga->save_pos102);
+ xf86SetCurrentAccess(TRUE, xf86Screens[pInt->scrnIndex]);
+}
+
+void
+UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
+{
+ xf86SetCurrentAccess(FALSE, xf86Screens[pInt->scrnIndex]);
+ outb(pInt->ioBase + 0x0102, vga->save_pos102);
+#ifndef __ia64__
+ outb(pInt->ioBase + 0x46E8, vga->save_46e8);
+#endif
+ outb(pInt->ioBase + 0x03C3, vga->save_vse);
+ outb(pInt->ioBase + 0x03C2, vga->save_msr);
+ xf86SetCurrentAccess(TRUE, xf86Screens[pInt->scrnIndex]);
+}
+
+#if defined (_PC)
+static void
+SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set)
+{
+ int pagesize = getpagesize();
+ unsigned char* base = xf86MapVidMem(pInt->scrnIndex,
+ VIDMEM_MMIO, 0, pagesize);
+ int i;
+
+ if (set) {
+ for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
+ MEM_WW(pInt, i, *(base + i));
+ } else {
+ for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
+ *(base + i) = MEM_RW(pInt, i);
+ }
+
+ xf86UnMapVidMem(pInt->scrnIndex,base,pagesize);
+}
+
+void
+xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
+{
+ int pagesize = getpagesize();
+ unsigned char* base;
+ int i;
+
+ if (!xf86IsEntityPrimary(pInt->entityIndex)
+ || (!save && !pInt->BIOSScratch))
+ return;
+
+ base = xf86MapVidMem(pInt->scrnIndex, VIDMEM_MMIO, 0, pagesize);
+ base += BIOS_SCRATCH_OFF;
+ if (save) {
+ if ((pInt->BIOSScratch
+ = xnfalloc(BIOS_SCRATCH_LEN)))
+ for (i = 0; i < BIOS_SCRATCH_LEN; i++)
+ *(((char*)pInt->BIOSScratch + i)) = *(base + i);
+ } else {
+ if (pInt->BIOSScratch) {
+ for (i = 0; i < BIOS_SCRATCH_LEN; i++)
+ *(base + i) = *(pInt->BIOSScratch + i);
+ xfree(pInt->BIOSScratch);
+ pInt->BIOSScratch = NULL;
+ }
+ }
+
+ xf86UnMapVidMem(pInt->scrnIndex,base - BIOS_SCRATCH_OFF ,pagesize);
+}
+#endif
diff --git a/hw/xfree86/int10/helper_mem.c b/hw/xfree86/int10/helper_mem.c
new file mode 100644
index 000000000..6de89c5d9
--- /dev/null
+++ b/hw/xfree86/int10/helper_mem.c
@@ -0,0 +1,333 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_mem.c,v 1.26 2002/11/25 14:05:01 eich Exp $ */
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+#include "compiler.h"
+#include "xf86Pci.h"
+#define _INT10_PRIVATE
+#if 0
+#include "int10Defines.h"
+#endif
+#include "xf86int10.h"
+
+#define REG pInt
+
+typedef enum {
+ OPT_NOINT10,
+ OPT_INIT_PRIMARY,
+ OPT_BIOS_LOCATION
+} INT10Opts;
+
+static const OptionInfoRec INT10Options[] = {
+ {OPT_NOINT10, "NoINT10", OPTV_BOOLEAN, {0}, FALSE },
+ {OPT_INIT_PRIMARY, "InitPrimary", OPTV_BOOLEAN, {0}, FALSE },
+ {OPT_BIOS_LOCATION, "BiosLocation", OPTV_STRING, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE },
+};
+
+#ifdef DEBUG
+void
+dprint(unsigned long start, unsigned long size)
+{
+ int i,j;
+ char *c = (char *)start;
+
+ for (j = 0; j < (size >> 4); j++) {
+ char *d = c;
+ ErrorF("\n0x%lx: ",(unsigned long)c);
+ for (i = 0; i<16; i++)
+ ErrorF("%2.2x ",(unsigned char) (*(c++)));
+ c = d;
+ for (i = 0; i<16; i++) {
+ ErrorF("%c",((((CARD8)(*c)) > 32) && (((CARD8)(*c)) < 128)) ?
+ (unsigned char) (*(c)): '.');
+ c++;
+ }
+ }
+ ErrorF("\n");
+}
+#endif
+
+#ifndef _PC
+/*
+ * here we are really paranoid about faking a "real"
+ * BIOS. Most of this information was pulled from
+ * dosemu.
+ */
+void
+setup_int_vect(xf86Int10InfoPtr pInt)
+{
+ int i;
+
+ /* let the int vects point to the SYS_BIOS seg */
+ for (i = 0; i < 0x80; i++) {
+ MEM_WW(pInt, i << 2, 0);
+ MEM_WW(pInt, (i << 2) + 2, SYS_BIOS >> 4);
+ }
+
+ reset_int_vect(pInt);
+ /* font tables default location (int 1F) */
+ MEM_WW(pInt,0x1f<<2,0xfa6e);
+
+ /* int 11 default location (Get Equipment Configuration) */
+ MEM_WW(pInt, 0x11 << 2, 0xf84d);
+ /* int 12 default location (Get Conventional Memory Size) */
+ MEM_WW(pInt, 0x12 << 2, 0xf841);
+ /* int 15 default location (I/O System Extensions) */
+ MEM_WW(pInt, 0x15 << 2, 0xf859);
+ /* int 1A default location (RTC, PCI and others) */
+ MEM_WW(pInt, 0x1a << 2, 0xff6e);
+ /* int 05 default location (Bound Exceeded) */
+ MEM_WW(pInt, 0x05 << 2, 0xff54);
+ /* int 08 default location (Double Fault) */
+ MEM_WW(pInt, 0x08 << 2, 0xfea5);
+ /* int 13 default location (Disk) */
+ MEM_WW(pInt, 0x13 << 2, 0xec59);
+ /* int 0E default location (Page Fault) */
+ MEM_WW(pInt, 0x0e << 2, 0xef57);
+ /* int 17 default location (Parallel Port) */
+ MEM_WW(pInt, 0x17 << 2, 0xefd2);
+ /* fdd table default location (int 1e) */
+ MEM_WW(pInt, 0x1e << 2, 0xefc7);
+
+ /* Set Equipment flag to VGA */
+ i = MEM_RB(pInt, 0x0410) & 0xCF;
+ MEM_WB(pInt, 0x0410, i);
+ /* XXX Perhaps setup more of the BDA here. See also int42(0x00). */
+}
+#endif
+
+int
+setup_system_bios(void *base_addr)
+{
+ char *base = (char *) base_addr;
+
+ /*
+ * we trap the "industry standard entry points" to the BIOS
+ * and all other locations by filling them with "hlt"
+ * TODO: implement hlt-handler for these
+ */
+ memset(base, 0xf4, 0x10000);
+
+ /* set bios date */
+ strcpy(base + 0x0FFF5, "06/11/99");
+ /* set up eisa ident string */
+ strcpy(base + 0x0FFD9, "PCI_ISA");
+ /* write system model id for IBM-AT */
+ *((unsigned char *)(base + 0x0FFFE)) = 0xfc;
+
+ return 1;
+}
+
+void
+reset_int_vect(xf86Int10InfoPtr pInt)
+{
+ /*
+ * This table is normally located at 0xF000:0xF0A4. However, int 0x42,
+ * function 0 (Mode Set) expects it (or a copy) somewhere in the bottom
+ * 64kB. Note that because this data doesn't survive POST, int 0x42 should
+ * only be used during EGA/VGA BIOS initialisation.
+ */
+ static const CARD8 VideoParms[] = {
+ /* Timing for modes 0x00 & 0x01 */
+ 0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
+ 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
+ /* Timing for modes 0x02 & 0x03 */
+ 0x71, 0x50, 0x5a, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
+ 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
+ /* Timing for modes 0x04, 0x05 & 0x06 */
+ 0x38, 0x28, 0x2d, 0x0a, 0x7f, 0x06, 0x64, 0x70,
+ 0x02, 0x01, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
+ /* Timing for mode 0x07 */
+ 0x61, 0x50, 0x52, 0x0f, 0x19, 0x06, 0x19, 0x19,
+ 0x02, 0x0d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,
+ /* Display page lengths in little endian order */
+ 0x00, 0x08, /* Modes 0x00 and 0x01 */
+ 0x00, 0x10, /* Modes 0x02 and 0x03 */
+ 0x00, 0x40, /* Modes 0x04 and 0x05 */
+ 0x00, 0x40, /* Modes 0x06 and 0x07 */
+ /* Number of columns for each mode */
+ 40, 40, 80, 80, 40, 40, 80, 80,
+ /* CGA Mode register value for each mode */
+ 0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29,
+ /* Padding */
+ 0x00, 0x00, 0x00, 0x00
+ };
+ int i;
+
+ for (i = 0; i < sizeof(VideoParms); i++)
+ MEM_WB(pInt, i + (0x1000 - sizeof(VideoParms)), VideoParms[i]);
+ MEM_WW(pInt, 0x1d << 2, 0x1000 - sizeof(VideoParms));
+ MEM_WW(pInt, (0x1d << 2) + 2, 0);
+
+ MEM_WW(pInt, 0x10 << 2, 0xf065);
+ MEM_WW(pInt, (0x10 << 2) + 2, SYS_BIOS >> 4);
+ MEM_WW(pInt, 0x42 << 2, 0xf065);
+ MEM_WW(pInt, (0x42 << 2) + 2, SYS_BIOS >> 4);
+ MEM_WW(pInt, 0x6D << 2, 0xf065);
+ MEM_WW(pInt, (0x6D << 2) + 2, SYS_BIOS >> 4);
+}
+
+void
+set_return_trap(xf86Int10InfoPtr pInt)
+{
+ /*
+ * Here we set the exit condition: We return when we encounter
+ * 'hlt' (=0xf4), which we locate at address 0x600 in x86 memory.
+ */
+ MEM_WB(pInt, 0x0600, 0xf4);
+
+ /*
+ * Allocate a segment for the stack
+ */
+ xf86Int10AllocPages(pInt, 1, &pInt->stackseg);
+}
+
+void *
+xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex)
+{
+ EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+ OptionInfoPtr options = NULL;
+
+ if (pEnt->device) {
+ pointer configOptions = NULL;
+
+ /* Check if xf86CollectOptions() has already been called */
+ if (((pEnt->index < 0) ||
+ !pScrn ||
+ !(configOptions = pScrn->options)) &&
+ pEnt->device)
+ configOptions = pEnt->device->options;
+
+ if (configOptions) {
+ if (!(options = (OptionInfoPtr) xalloc(sizeof(INT10Options))))
+ return NULL;
+
+ (void)memcpy(options, INT10Options, sizeof(INT10Options));
+ xf86ProcessOptions(pScrn->scrnIndex, configOptions, options);
+ }
+ }
+ xfree(pEnt);
+
+ return options;
+}
+
+Bool
+int10skip(void* options)
+{
+ Bool noint10 = FALSE;
+
+ if (!options) return FALSE;
+
+ xf86GetOptValBool(options, OPT_NOINT10, &noint10);
+ return noint10;
+}
+
+Bool
+int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem)
+{
+ int size;
+
+ if ((codeSeg & 0x1f) || /* Not 512-byte aligned otherwise */
+ ((codeSeg << 4) < V_BIOS) ||
+ ((codeSeg << 4) >= SYS_SIZE))
+ return FALSE;
+
+ if (xf86IsPc98())
+ return FALSE;
+
+ if ((*vbiosMem != 0x55) || (*(vbiosMem+1) != 0xAA) || !*(vbiosMem+2))
+ return FALSE;
+
+ size = *(vbiosMem + 2) * 512;
+
+ if ((size + (codeSeg << 4)) > SYS_SIZE)
+ return FALSE;
+
+ if (bios_checksum(vbiosMem, size))
+ xf86DrvMsg(scrnIndex, X_WARNING, "Bad V_BIOS checksum\n");
+
+ return TRUE;
+}
+
+Bool
+initPrimary(void* options)
+{
+ Bool initPrimary = FALSE;
+
+ if (!options) return FALSE;
+
+ xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary);
+ return initPrimary;
+}
+
+/*
+ * xf86int10ParseBiosLocation(): allows to set the location of the
+ * BIOS. One may select a BIOS of another card for posting or the
+ * legacy V_BIOS range located at 0xc0000 or an alternative address
+ * (BUS_ISA).
+ * This is only useful under very special circumstances and should
+ * be used with extreme care.
+ */
+void
+xf86int10ParseBiosLocation(void* options,
+ xf86int10BiosLocationPtr bios)
+{
+ char *s;
+ char *p;
+ char *str = NULL;
+
+ if (options)
+ str = xf86GetOptValString(options,OPT_BIOS_LOCATION);
+
+ bios->bus = BUS_NONE;
+ if (!str)
+ return;
+
+ s = xstrdup(str);
+ p = strtok(s,":");
+ if (xf86NameCmp(p,"pci") == 0) bios->bus = BUS_PCI;
+ else
+ if (xf86NameCmp(p,"primary") == 0) bios->bus = BUS_ISA;
+
+ xfree(s);
+
+ if (bios->bus == BUS_NONE) return;
+
+ s = xstrdup(str);
+ p = strchr(s, ':');
+
+ switch (bios->bus) {
+ case BUS_ISA:
+ if (p)
+ bios->location.legacy = atoi(++p);
+ else
+ bios->location.legacy = 0;
+ break;
+ case BUS_PCI:
+ if (p) {
+ bios->location.pci.bus = atoi(++p);
+ if ((p = strchr(p, ':'))) {
+ bios->location.pci.dev = atoi(++p);
+ if ((p = strchr(p, ':'))) {
+ bios->location.pci.func = atoi(++p);
+ break;
+ }
+ }
+ }
+ /* fall through */
+ bios->bus = BUS_NONE;
+ break;
+ default:
+ break;
+ }
+ xfree(s);
+}
+
+
+
diff --git a/hw/xfree86/int10/pci.c b/hw/xfree86/int10/pci.c
new file mode 100644
index 000000000..debd842e7
--- /dev/null
+++ b/hw/xfree86/int10/pci.c
@@ -0,0 +1,51 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.12 2002/04/04 14:05:51 eich Exp $ */
+
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#include "xf86Pci.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#define _INT10_PRIVATE
+#include "xf86int10.h"
+
+int
+mapPciRom(int pciEntity, unsigned char * address)
+{
+ PCITAG tag;
+ unsigned char *mem, *ptr;
+ int length;
+
+ pciVideoPtr pvp = xf86GetPciInfoForEntity(pciEntity);
+
+ if (pvp == NULL) {
+#ifdef DEBUG
+ ErrorF("mapPciRom: no PCI info\n");
+#endif
+ return 0;
+ }
+
+ tag = pciTag(pvp->bus,pvp->device,pvp->func);
+ length = 1 << pvp->biosSize;
+
+ /* Read in entire PCI ROM */
+ mem = ptr = xnfcalloc(length, 1);
+ length = xf86ReadPciBIOS(0, tag, -1, ptr, length);
+ if (length > 0)
+ memcpy(address, ptr, length);
+ /* unmap/close/disable PCI bios mem */
+ xfree(mem);
+
+#ifdef DEBUG
+ if (!length)
+ ErrorF("mapPciRom: no BIOS found\n");
+#ifdef PRINT_PCI
+ else
+ dprint(address,0x20);
+#endif
+#endif
+
+ return length;
+}
diff --git a/hw/xfree86/int10/stub.c b/hw/xfree86/int10/stub.c
new file mode 100644
index 000000000..f6b38580c
--- /dev/null
+++ b/hw/xfree86/int10/stub.c
@@ -0,0 +1,66 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/stub.c,v 1.4 2002/04/04 14:05:51 eich Exp $ */
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#include "xf86.h"
+#include "xf86str.h"
+#include "xf86_OSproc.h"
+#define _INT10_PRIVATE
+#include "xf86int10.h"
+
+xf86Int10InfoPtr
+xf86InitInt10(int entityIndex)
+{
+ return xf86ExtendedInitInt10(entityIndex, 0);
+}
+
+xf86Int10InfoPtr
+xf86ExtendedInitInt10(int entityIndex, int Flags)
+{
+ return NULL;
+}
+
+Bool
+MapCurrentInt10(xf86Int10InfoPtr pInt)
+{
+ return FALSE;
+}
+
+void
+xf86FreeInt10(xf86Int10InfoPtr pInt)
+{
+ return;
+}
+
+void *
+xf86Int10AllocPages(xf86Int10InfoPtr pInt,int num, int *off)
+{
+ *off = 0;
+ return NULL;
+}
+
+void
+xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
+{
+ return;
+}
+
+Bool
+xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
+{
+ return FALSE;
+}
+
+void
+xf86ExecX86int10(xf86Int10InfoPtr pInt)
+{
+ return;
+}
+
+pointer
+xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
+{
+ return 0;
+}
diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c
new file mode 100644
index 000000000..d6c5d1f43
--- /dev/null
+++ b/hw/xfree86/int10/xf86int10.c
@@ -0,0 +1,787 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v 1.10.2.1 2003/03/21 22:29:59 tsi Exp $ */
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "compiler.h"
+#define _INT10_PRIVATE
+#include "xf86int10.h"
+#include "int10Defines.h"
+
+#define REG pInt
+
+xf86Int10InfoPtr Int10Current = NULL;
+
+static int int1A_handler(xf86Int10InfoPtr pInt);
+#ifndef _PC
+static int int42_handler(xf86Int10InfoPtr pInt);
+#endif
+static int intE6_handler(xf86Int10InfoPtr pInt);
+static PCITAG findPci(xf86Int10InfoPtr pInt, unsigned short bx);
+static CARD32 pciSlotBX(pciVideoPtr pvp);
+
+int
+int_handler(xf86Int10InfoPtr pInt)
+{
+ int num = pInt->num;
+ int ret = 0;
+
+ switch (num) {
+#ifndef _PC
+ case 0x10:
+ case 0x42:
+ case 0x6D:
+ if (getIntVect(pInt, num) == I_S_DEFAULT_INT_VECT)
+ ret = int42_handler(pInt);
+ break;
+#endif
+ case 0x1A:
+ ret = int1A_handler(pInt);
+ break;
+ case 0xe6:
+ ret = intE6_handler(pInt);
+ break;
+ default:
+ break;
+ }
+
+ if (!ret)
+ ret = run_bios_int(num, pInt);
+
+ if (!ret) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "Halting on int 0x%2.2x!\n", num);
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+
+ return ret;
+}
+
+#ifndef _PC
+/*
+ * This is derived from a number of PC system BIOS'es. The intent here is to
+ * provide very primitive video support, before an EGA/VGA BIOS installs its
+ * own interrupt vector. Here, "Ignored" calls should remain so. "Not
+ * Implemented" denotes functionality that can be implemented should the need
+ * arise. What are "Not Implemented" throughout are video memory accesses.
+ * Also, very little input validity checking is done here.
+ */
+static int
+int42_handler(xf86Int10InfoPtr pInt)
+{
+ switch (X86_AH) {
+ case 0x00:
+ /* Set Video Mode */
+ /* Enter: AL = video mode number */
+ /* Leave: Nothing */
+ /* Implemented (except for clearing the screen) */
+ { /* Localise */
+ IOADDRESS ioport;
+ int i;
+ CARD16 int1d, regvals, tmp;
+ CARD8 mode, cgamode, cgacolour;
+
+ /*
+ * Ignore all mode numbers but 0x00-0x13. Some systems also ignore
+ * 0x0B and 0x0C, but don't do that here.
+ */
+ if (X86_AL > 0x13)
+ break;
+
+ /*
+ * You didn't think that was really the mode set, did you? There
+ * are only so many slots in the video parameter table...
+ */
+ mode = X86_AL;
+ ioport = 0x03D4;
+ switch (MEM_RB(pInt, 0x0410) & 0x30) {
+ case 0x30: /* MDA */
+ mode = 0x07; /* Force mode to 0x07 */
+ ioport = 0x03B4;
+ break;
+ case 0x10: /* CGA 40x25 */
+ if (mode >= 0x07)
+ mode = 0x01;
+ break;
+ case 0x20: /* CGA 80x25 (MCGA?) */
+ if (mode >= 0x07)
+ mode = 0x03;
+ break;
+ case 0x00: /* EGA/VGA */
+ if (mode >= 0x07) /* Don't try MDA timings */
+ mode = 0x01; /* !?!?! */
+ break;
+ }
+
+ /* Locate data in video parameter table */
+ int1d = MEM_RW(pInt, 0x1d << 2);
+ regvals = ((mode >> 1) << 4) + int1d;
+ cgacolour = 0x30;
+ if (mode == 0x06) {
+ regvals -= 0x10;
+ cgacolour = 0x3F;
+ }
+
+ /** Update BIOS Data Area **/
+
+ /* Video mode */
+ MEM_WB(pInt, 0x0449, mode);
+
+ /* Columns */
+ tmp = MEM_RB(pInt, mode + int1d + 0x48);
+ MEM_WW(pInt, 0x044A, tmp);
+
+ /* Page length */
+ tmp = MEM_RW(pInt, (mode & 0x06) + int1d + 0x40);
+ MEM_WW(pInt, 0x044C, tmp);
+
+ /* Start Address */
+ MEM_WW(pInt, 0x044E, 0);
+
+ /* Cursor positions, one for each display page */
+ for (i = 0x0450; i < 0x0460; i += 2)
+ MEM_WW(pInt, i, 0);
+
+ /* Cursor start & end scanlines */
+ tmp = MEM_RB(pInt, regvals + 0x0B);
+ MEM_WB(pInt, 0x0460, tmp);
+ tmp = MEM_RB(pInt, regvals + 0x0A);
+ MEM_WB(pInt, 0x0461, tmp);
+
+ /* Current display page number */
+ MEM_WB(pInt, 0x0462, 0);
+
+ /* CRTC I/O address */
+ MEM_WW(pInt, 0x0463, ioport);
+
+ /* CGA Mode register value */
+ cgamode = MEM_RB(pInt, mode + int1d + 0x50);
+ MEM_WB(pInt, 0x0465, cgamode);
+
+ /* CGA Colour register value */
+ MEM_WB(pInt, 0x0466, cgacolour);
+
+ /* Rows */
+ MEM_WB(pInt, 0x0484, (25 - 1));
+
+ /* Remap I/O port number into its domain */
+ ioport += pInt->ioBase;
+
+ /* Programme the mode */
+ outb(ioport + 4, cgamode & 0x37); /* Turn off screen */
+ for (i = 0; i < 0x10; i++) {
+ tmp = MEM_RB(pInt, regvals + i);
+ outb(ioport, i);
+ outb(ioport + 1, tmp);
+ }
+ outb(ioport + 5, cgacolour); /* Select colour mode */
+ outb(ioport + 4, cgamode); /* Turn on screen */
+ }
+ break;
+
+ case 0x01:
+ /* Set Cursor Type */
+ /* Enter: CH = starting line for cursor */
+ /* CL = ending line for cursor */
+ /* Leave: Nothing */
+ /* Implemented */
+ { /* Localise */
+ IOADDRESS ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
+
+ MEM_WB(pInt, 0x0460, X86_CL);
+ MEM_WB(pInt, 0x0461, X86_CH);
+
+ outb(ioport, 0x0A);
+ outb(ioport + 1, X86_CH);
+ outb(ioport, 0x0B);
+ outb(ioport + 1, X86_CL);
+ }
+ break;
+
+ case 0x02:
+ /* Set Cursor Position */
+ /* Enter: BH = display page number */
+ /* DH = row */
+ /* DL = column */
+ /* Leave: Nothing */
+ /* Implemented */
+ { /* Localise */
+ IOADDRESS ioport;
+ CARD16 offset;
+
+ MEM_WB(pInt, (X86_BH << 1) + 0x0450, X86_DL);
+ MEM_WB(pInt, (X86_BH << 1) + 0x0451, X86_DH);
+
+ if (X86_BH != MEM_RB(pInt, 0x0462))
+ break;
+
+ offset = (X86_DH * MEM_RW(pInt, 0x044A)) + X86_DL;
+ offset += MEM_RW(pInt, 0x044E) << 1;
+
+ ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
+ outb(ioport, 0x0E);
+ outb(ioport + 1, offset >> 8);
+ outb(ioport, 0x0F);
+ outb(ioport + 1, offset & 0xFF);
+ }
+ break;
+
+ case 0x03:
+ /* Get Cursor Position */
+ /* Enter: BH = display page number */
+ /* Leave: CH = starting line for cursor */
+ /* CL = ending line for cursor */
+ /* DH = row */
+ /* DL = column */
+ /* Implemented */
+ { /* Localise */
+ X86_CL = MEM_RB(pInt, 0x0460);
+ X86_CH = MEM_RB(pInt, 0x0461);
+ X86_DL = MEM_RB(pInt, (X86_BH << 1) + 0x0450);
+ X86_DH = MEM_RB(pInt, (X86_BH << 1) + 0x0451);
+ }
+ break;
+
+ case 0x04:
+ /* Get Light Pen Position */
+ /* Enter: Nothing */
+ /* Leave: AH = 0x01 (down/triggered) or 0x00 (not) */
+ /* BX = pixel column */
+ /* CX = pixel row */
+ /* DH = character row */
+ /* DL = character column */
+ /* Not Implemented */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x04) -- Get Light Pen Position\n", pInt->num);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ X86_AH = X86_BX = X86_CX = X86_DX = 0;
+ }
+ break;
+
+ case 0x05:
+ /* Set Display Page */
+ /* Enter: AL = display page number */
+ /* Leave: Nothing */
+ /* Implemented */
+ { /* Localise */
+ IOADDRESS ioport = MEM_RW(pInt, 0x0463) + pInt->ioBase;
+ CARD16 start;
+ CARD8 x, y;
+
+ /* Calculate new start address */
+ MEM_WB(pInt, 0x0462, X86_AL);
+ start = X86_AL * MEM_RW(pInt, 0x044C);
+ MEM_WW(pInt, 0x044E, start);
+ start <<= 1;
+
+ /* Update start address */
+ outb(ioport, 0x0C);
+ outb(ioport + 1, start >> 8);
+ outb(ioport, 0x0D);
+ outb(ioport + 1, start & 0xFF);
+
+ /* Switch cursor position */
+ y = MEM_RB(pInt, (X86_AL << 1) + 0x0450);
+ x = MEM_RB(pInt, (X86_AL << 1) + 0x0451);
+ start += (y * MEM_RW(pInt, 0x044A)) + x;
+
+ /* Update cursor position */
+ outb(ioport, 0x0E);
+ outb(ioport + 1, start >> 8);
+ outb(ioport, 0x0F);
+ outb(ioport + 1, start & 0xFF);
+ }
+ break;
+
+ case 0x06:
+ /* Initialise or Scroll Window Up */
+ /* Enter: AL = lines to scroll up */
+ /* BH = attribute for blank */
+ /* CH = upper y of window */
+ /* CL = left x of window */
+ /* DH = lower y of window */
+ /* DL = right x of window */
+ /* Leave: Nothing */
+ /* Not Implemented */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x06) -- Initialise or Scroll Window Up\n",
+ pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ " AL=0x%2.2x, BH=0x%2.2x,"
+ " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n",
+ X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ }
+ break;
+
+ case 0x07:
+ /* Initialise or Scroll Window Down */
+ /* Enter: AL = lines to scroll down */
+ /* BH = attribute for blank */
+ /* CH = upper y of window */
+ /* CL = left x of window */
+ /* DH = lower y of window */
+ /* DL = right x of window */
+ /* Leave: Nothing */
+ /* Not Implemented */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x07) -- Initialise or Scroll Window Down\n",
+ pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ " AL=0x%2.2x, BH=0x%2.2x,"
+ " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n",
+ X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ }
+ break;
+
+ case 0x08:
+ /* Read Character and Attribute at Cursor */
+ /* Enter: BH = display page number */
+ /* Leave: AH = attribute */
+ /* AL = character */
+ /* Not Implemented */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x08) -- Read Character and Attribute at"
+ " Cursor\n", pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ "BH=0x%2.2x\n", X86_BH);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ X86_AX = 0;
+ }
+ break;
+
+ case 0x09:
+ /* Write Character and Attribute at Cursor */
+ /* Enter: AL = character */
+ /* BH = display page number */
+ /* BL = attribute (text) or colour (graphics) */
+ /* CX = replication count */
+ /* Leave: Nothing */
+ /* Not Implemented */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x09) -- Write Character and Attribute at"
+ " Cursor\n", pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n",
+ X86_AL, X86_BH, X86_BL, X86_CX);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ }
+ break;
+
+ case 0x0a:
+ /* Write Character at Cursor */
+ /* Enter: AL = character */
+ /* BH = display page number */
+ /* BL = colour */
+ /* CX = replication count */
+ /* Leave: Nothing */
+ /* Not Implemented */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x0A) -- Write Character at Cursor\n",
+ pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n",
+ X86_AL, X86_BH, X86_BL, X86_CX);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ }
+ break;
+
+ case 0x0b:
+ /* Set Palette, Background or Border */
+ /* Enter: BH = 0x00 or 0x01 */
+ /* BL = colour or palette (respectively) */
+ /* Leave: Nothing */
+ /* Implemented */
+ { /* Localise */
+ IOADDRESS ioport = MEM_RW(pInt, 0x0463) + 5 + pInt->ioBase;
+ CARD8 cgacolour = MEM_RB(pInt, 0x0466);
+
+ if (X86_BH) {
+ cgacolour &= 0xDF;
+ cgacolour |= (X86_BL & 0x01) << 5;
+ } else {
+ cgacolour &= 0xE0;
+ cgacolour |= X86_BL & 0x1F;
+ }
+
+ MEM_WB(pInt, 0x0466, cgacolour);
+ outb(ioport, cgacolour);
+ }
+ break;
+
+ case 0x0c:
+ /* Write Graphics Pixel */
+ /* Enter: AL = pixel value */
+ /* BH = display page number */
+ /* CX = column */
+ /* DX = row */
+ /* Leave: Nothing */
+ /* Not Implemented */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x0C) -- Write Graphics Pixel\n", pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ "AL=0x%2.2x, BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n",
+ X86_AL, X86_BH, X86_CX, X86_DX);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ }
+ break;
+
+ case 0x0d:
+ /* Read Graphics Pixel */
+ /* Enter: BH = display page number */
+ /* CX = column */
+ /* DX = row */
+ /* Leave: AL = pixel value */
+ /* Not Implemented */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x0D) -- Read Graphics Pixel\n", pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ "BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n",
+ X86_BH, X86_CX, X86_DX);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ X86_AL = 0;
+ }
+ break;
+
+ case 0x0e:
+ /* Write Character in Teletype Mode */
+ /* Enter: AL = character */
+ /* BH = display page number */
+ /* BL = foreground colour */
+ /* Leave: Nothing */
+ /* Not Implemented */
+ /* WARNING: Emulation of BEL characters will require */
+ /* emulation of RTC and PC speaker I/O. */
+ /* Also, this recurses through int 0x10 */
+ /* which might or might not have been */
+ /* installed yet. */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x0E) -- Write Character in Teletype Mode\n",
+ pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x\n",
+ X86_AL, X86_BH, X86_BL);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ }
+ break;
+
+ case 0x0f:
+ /* Get Video Mode */
+ /* Enter: Nothing */
+ /* Leave: AH = number of columns */
+ /* AL = video mode number */
+ /* BH = display page number */
+ /* Implemented */
+ { /* Localise */
+ X86_AH = MEM_RW(pInt, 0x044A);
+ X86_AL = MEM_RB(pInt, 0x0449);
+ X86_BH = MEM_RB(pInt, 0x0462);
+ }
+ break;
+
+ case 0x10:
+ /* Colour Control (subfunction in AL) */
+ /* Enter: Various */
+ /* Leave: Various */
+ /* Ignored */
+ break;
+
+ case 0x11:
+ /* Font Control (subfunction in AL) */
+ /* Enter: Various */
+ /* Leave: Various */
+ /* Ignored */
+ break;
+
+ case 0x12:
+ /* Miscellaneous (subfunction in BL) */
+ /* Enter: Various */
+ /* Leave: Various */
+ /* Ignored. Previous code here optionally allowed */
+ /* the enabling and disabling of VGA, but no system */
+ /* BIOS I've come across actually implements it. */
+ break;
+
+ case 0x13:
+ /* Write String in Teletype Mode */
+ /* Enter: AL = write mode */
+ /* BL = attribute (if (AL & 0x02) == 0) */
+ /* CX = string length */
+ /* DH = row */
+ /* DL = column */
+ /* ES:BP = string segment:offset */
+ /* Leave: Nothing */
+ /* Not Implemented */
+ /* WARNING: Emulation of BEL characters will require */
+ /* emulation of RTC and PC speaker I/O. */
+ /* Also, this recurses through int 0x10 */
+ /* which might or might not have been */
+ /* installed yet. */
+ { /* Localise */
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x%2.2x(AH=0x13) -- Write String in Teletype Mode\n",
+ pInt->num);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3,
+ "AL=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x,"
+ " DH=0x%2.2x, DL=0x%2.2x, ES:BP=0x%4.4x:0x%4.4x\n",
+ X86_AL, X86_BL, X86_CX, X86_DH, X86_DL, X86_ES, X86_BP);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ }
+ break;
+
+ default:
+ /* Various extensions */
+ /* Enter: Various */
+ /* Leave: Various */
+ /* Ignored */
+ break;
+ }
+
+ return 1;
+}
+#endif
+
+#define SUCCESSFUL 0x00
+#define DEVICE_NOT_FOUND 0x86
+#define BAD_REGISTER_NUMBER 0x87
+
+static int
+int1A_handler(xf86Int10InfoPtr pInt)
+{
+ PCITAG tag;
+ pciVideoPtr pvp;
+
+ if (!(pvp = xf86GetPciInfoForEntity(pInt->entityIndex)))
+ return 0; /* oops */
+
+#ifdef PRINT_INT
+ ErrorF("int 0x1a: ax=0x%x bx=0x%x cx=0x%x dx=0x%x di=0x%x es=0x%x\n",
+ X86_EAX, X86_EBX, X86_ECX, X86_EDX, X86_EDI, X86_ESI);
+#endif
+ switch (X86_AX) {
+ case 0xb101:
+ X86_EAX &= 0xFF00; /* no config space/special cycle support */
+ X86_EDX = 0x20494350; /* " ICP" */
+ X86_EBX = 0x0210; /* Version 2.10 */
+ X86_ECX &= 0xFF00;
+ X86_ECX |= (pciNumBuses & 0xFF); /* Max bus number in system */
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x dx=0x%x bx=0x%x cx=0x%x flags=0x%x\n",
+ X86_EAX, X86_EDX, X86_EBX, X86_ECX, X86_EFLAGS);
+#endif
+ return 1;
+ case 0xb102:
+ if (X86_DX == pvp->vendor && X86_CX == pvp->chipType && X86_ESI == 0) {
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ X86_EBX = pciSlotBX(pvp);
+ }
+#ifdef SHOW_ALL_DEVICES
+ else
+ if ((pvp = xf86FindPciDeviceVendor(X86_EDX, X86_ECX, X86_ESI, pvp))) {
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ X86_EBX = pciSlotBX(pvp);
+ }
+#endif
+ else {
+ X86_EAX = X86_AL | (DEVICE_NOT_FOUND << 8);
+ X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
+ }
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x bx=0x%x flags=0x%x\n", X86_EAX, X86_EBX, X86_EFLAGS);
+#endif
+ return 1;
+ case 0xb103:
+ if (X86_CL == pvp->interface &&
+ X86_CH == pvp->subclass &&
+ ((X86_ECX & 0xFFFF0000) >> 16) == pvp->class) {
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EBX = pciSlotBX(pvp);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ }
+#ifdef SHOW_ALL_DEVICES
+ else if ((pvp = xf86FindPciClass(X86_CL, X86_CH,
+ (X86_ECX & 0xffff0000) >> 16,
+ X86_ESI, pvp))) {
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ X86_EBX = pciSlotBX(pvp);
+ }
+#endif
+ else {
+ X86_EAX = X86_AL | (DEVICE_NOT_FOUND << 8);
+ X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
+ }
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS);
+#endif
+ return 1;
+ case 0xb108:
+ if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
+ X86_CL = pciReadByte(tag, X86_EDI);
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ } else {
+ X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
+ X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
+ }
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS);
+#endif
+ return 1;
+ case 0xb109:
+ if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
+ X86_CX = pciReadWord(tag, X86_EDI);
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ } else {
+ X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
+ X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
+ }
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS);
+#endif
+ return 1;
+ case 0xb10a:
+ if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
+ X86_ECX = pciReadLong(tag, X86_EDI);
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ } else {
+ X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
+ X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
+ }
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x cx=0x%x flags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS);
+#endif
+ return 1;
+ case 0xb10b:
+ if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
+ pciWriteByte(tag, X86_EDI, X86_CL);
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ } else {
+ X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
+ X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
+ }
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS);
+#endif
+ return 1;
+ case 0xb10c:
+ if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
+ pciWriteWord(tag, X86_EDI, X86_CX);
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ } else {
+ X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
+ X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
+ }
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS);
+#endif
+ return 1;
+ case 0xb10d:
+ if ((tag = findPci(pInt, X86_EBX)) != PCI_NOT_FOUND) {
+ pciWriteLong(tag, X86_EDI, X86_ECX);
+ X86_EAX = X86_AL | (SUCCESSFUL << 8);
+ X86_EFLAGS &= ~((unsigned long)0x01); /* clear carry flag */
+ } else {
+ X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8);
+ X86_EFLAGS |= ((unsigned long)0x01); /* set carry flag */
+ }
+#ifdef PRINT_INT
+ ErrorF("ax=0x%x flags=0x%x\n", X86_EAX, X86_EFLAGS);
+#endif
+ return 1;
+ default:
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "int 0x1a subfunction\n");
+ dump_registers(pInt);
+ if (xf86GetVerbosity() > 3)
+ stack_trace(pInt);
+ return 0;
+ }
+}
+
+static PCITAG
+findPci(xf86Int10InfoPtr pInt, unsigned short bx)
+{
+ int bus = ((pInt->Tag >> 16) & ~0x00FF) | ((bx >> 8) & 0x00FF);
+ int dev = (bx >> 3) & 0x1F;
+ int func = bx & 0x7;
+ if (xf86IsPciDevPresent(bus, dev, func))
+ return pciTag(bus, dev, func);
+ return PCI_NOT_FOUND;
+}
+
+static CARD32
+pciSlotBX(pciVideoPtr pvp)
+{
+ return ((pvp->bus << 8) & 0x00FF00) | (pvp->device << 3) | (pvp->func);
+}
+
+/*
+ * handle initialization
+ */
+static int
+intE6_handler(xf86Int10InfoPtr pInt)
+{
+ pciVideoPtr pvp;
+
+ if ((pvp = xf86GetPciInfoForEntity(pInt->entityIndex)))
+ X86_AX = (pvp->bus << 8) | (pvp->device << 3) | (pvp->func & 0x7);
+ pushw(pInt, X86_CS);
+ pushw(pInt, X86_IP);
+ X86_CS = pInt->BIOSseg;
+ X86_EIP = 0x0003;
+ X86_ES = 0; /* standard pc es */
+ return 1;
+}
diff --git a/hw/xfree86/int10/xf86int10.h b/hw/xfree86/int10/xf86int10.h
new file mode 100644
index 000000000..843902c5e
--- /dev/null
+++ b/hw/xfree86/int10/xf86int10.h
@@ -0,0 +1,198 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.24 2002/07/23 14:22:46 tsi Exp $ */
+
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+
+#ifndef _XF86INT10_H
+#define _XF86INT10_H
+
+#include "Xmd.h"
+#include "Xdefs.h"
+#include "xf86Pci.h"
+
+#define SEG_ADDR(x) (((x) >> 4) & 0x00F000)
+#define SEG_OFF(x) ((x) & 0x0FFFF)
+
+#define SET_BIOS_SCRATCH 0x1
+#define RESTORE_BIOS_SCRATCH 0x2
+
+/* int10 info structure */
+typedef struct {
+ int entityIndex;
+ int scrnIndex;
+ pointer cpuRegs;
+ CARD16 BIOSseg;
+ CARD16 inb40time;
+ char * BIOSScratch;
+ int Flags;
+ pointer private;
+ struct _int10Mem* mem;
+ int num;
+ int ax;
+ int bx;
+ int cx;
+ int dx;
+ int si;
+ int di;
+ int es;
+ int bp;
+ int flags;
+ int stackseg;
+ PCITAG Tag;
+ IOADDRESS ioBase;
+} xf86Int10InfoRec, *xf86Int10InfoPtr;
+
+typedef struct _int10Mem {
+ CARD8(*rb)(xf86Int10InfoPtr, int);
+ CARD16(*rw)(xf86Int10InfoPtr, int);
+ CARD32(*rl)(xf86Int10InfoPtr, int);
+ void(*wb)(xf86Int10InfoPtr, int, CARD8);
+ void(*ww)(xf86Int10InfoPtr, int, CARD16);
+ void(*wl)(xf86Int10InfoPtr, int, CARD32);
+} int10MemRec, *int10MemPtr;
+
+typedef struct {
+ CARD8 save_msr;
+ CARD8 save_pos102;
+ CARD8 save_vse;
+ CARD8 save_46e8;
+} legacyVGARec, *legacyVGAPtr;
+
+typedef struct {
+ BusType bus;
+ union {
+ struct {
+ int bus;
+ int dev;
+ int func;
+ } pci;
+ int legacy;
+ } location;
+} xf86int10BiosLocation, *xf86int10BiosLocationPtr;
+
+/* OS dependent functions */
+xf86Int10InfoPtr xf86InitInt10(int entityIndex);
+xf86Int10InfoPtr xf86ExtendedInitInt10(int entityIndex, int Flags);
+void xf86FreeInt10(xf86Int10InfoPtr pInt);
+void *xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off);
+void xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num);
+pointer xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr);
+
+/* x86 executor related functions */
+void xf86ExecX86int10(xf86Int10InfoPtr pInt);
+
+#ifdef _INT10_PRIVATE
+
+#define I_S_DEFAULT_INT_VECT 0xFF065
+#define SYS_SIZE 0x100000
+#define SYS_BIOS 0xF0000
+#if 1
+#define BIOS_SIZE 0x10000
+#else /* a bug in DGUX requires this - let's try it */
+#define BIOS_SIZE (0x10000 - 1)
+#endif
+#define LOW_PAGE_SIZE 0x600
+#define V_RAM 0xA0000
+#define VRAM_SIZE 0x20000
+#define V_BIOS_SIZE 0x10000
+#define V_BIOS 0xC0000
+#define BIOS_SCRATCH_OFF 0x449
+#define BIOS_SCRATCH_END 0x466
+#define BIOS_SCRATCH_LEN (BIOS_SCRATCH_END - BIOS_SCRATCH_OFF + 1)
+#define HIGH_MEM V_BIOS
+#define HIGH_MEM_SIZE (SYS_BIOS - HIGH_MEM)
+#define SEG_ADR(type, seg, reg) type((seg << 4) + (X86_##reg))
+#define SEG_EADR(type, seg, reg) type((seg << 4) + (X86_E##reg))
+
+#define X86_TF_MASK 0x00000100
+#define X86_IF_MASK 0x00000200
+#define X86_IOPL_MASK 0x00003000
+#define X86_NT_MASK 0x00004000
+#define X86_VM_MASK 0x00020000
+#define X86_AC_MASK 0x00040000
+#define X86_VIF_MASK 0x00080000 /* virtual interrupt flag */
+#define X86_VIP_MASK 0x00100000 /* virtual interrupt pending */
+#define X86_ID_MASK 0x00200000
+
+#define MEM_RB(name, addr) (*name->mem->rb)(name, addr)
+#define MEM_RW(name, addr) (*name->mem->rw)(name, addr)
+#define MEM_RL(name, addr) (*name->mem->rl)(name, addr)
+#define MEM_WB(name, addr, val) (*name->mem->wb)(name, addr, val)
+#define MEM_WW(name, addr, val) (*name->mem->ww)(name, addr, val)
+#define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val)
+
+/* OS dependent functions */
+Bool MapCurrentInt10(xf86Int10InfoPtr pInt);
+/* x86 executor related functions */
+Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt);
+
+/* int.c */
+extern xf86Int10InfoPtr Int10Current;
+int int_handler(xf86Int10InfoPtr pInt);
+
+/* helper_exec.c */
+int setup_int(xf86Int10InfoPtr pInt);
+void finish_int(xf86Int10InfoPtr, int sig);
+CARD32 getIntVect(xf86Int10InfoPtr pInt, int num);
+void pushw(xf86Int10InfoPtr pInt, CARD16 val);
+int run_bios_int(int num, xf86Int10InfoPtr pInt);
+void dump_code(xf86Int10InfoPtr pInt);
+void dump_registers(xf86Int10InfoPtr pInt);
+void stack_trace(xf86Int10InfoPtr pInt);
+xf86Int10InfoPtr getInt10Rec(int entityIndex);
+CARD8 bios_checksum(CARD8 *start, int size);
+void LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
+void UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga);
+#if defined (_PC)
+void xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save);
+#endif
+int port_rep_inb(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count);
+int port_rep_inw(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count);
+int port_rep_inl(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count);
+int port_rep_outb(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count);
+int port_rep_outw(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count);
+int port_rep_outl(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count);
+
+CARD8 x_inb(CARD16 port);
+CARD16 x_inw(CARD16 port);
+void x_outb(CARD16 port, CARD8 val);
+void x_outw(CARD16 port, CARD16 val);
+CARD32 x_inl(CARD16 port);
+void x_outl(CARD16 port, CARD32 val);
+
+CARD8 Mem_rb(CARD32 addr);
+CARD16 Mem_rw(CARD32 addr);
+CARD32 Mem_rl(CARD32 addr);
+void Mem_wb(CARD32 addr, CARD8 val);
+void Mem_ww(CARD32 addr, CARD16 val);
+void Mem_wl(CARD32 addr, CARD32 val);
+
+/* helper_mem.c */
+void setup_int_vect(xf86Int10InfoPtr pInt);
+int setup_system_bios(void *base_addr);
+void reset_int_vect(xf86Int10InfoPtr pInt);
+void set_return_trap(xf86Int10InfoPtr pInt);
+void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex);
+Bool int10skip(void* options);
+Bool int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem);
+Bool initPrimary(void* options);
+void xf86int10ParseBiosLocation(void* options,
+ xf86int10BiosLocationPtr bios);
+#ifdef DEBUG
+void dprint(unsigned long start, unsigned long size);
+#endif
+
+/* pci.c */
+int mapPciRom(int pciEntity, unsigned char *address);
+
+#endif /* _INT10_PRIVATE */
+#endif /* _XF86INT10_H */
diff --git a/hw/xfree86/int10/xf86int10module.c b/hw/xfree86/int10/xf86int10module.c
new file mode 100644
index 000000000..9e679ca6a
--- /dev/null
+++ b/hw/xfree86/int10/xf86int10module.c
@@ -0,0 +1,63 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10module.c,v 1.2 2002/09/16 18:06:09 eich Exp $ */
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#include "xf86.h"
+#include "xf86str.h"
+#include "xf86Pci.h"
+#include "xf86int10.h"
+
+
+#ifdef XFree86LOADER
+
+
+#ifndef MOD_NAME
+# define MOD_NAME int10
+#endif
+
+#define stringify(x) #x
+#define STRING(x) stringify(x)
+#define concat(x,y) x ## y
+#define combine(a,b) concat(a,b)
+#define NAME(x) combine(MOD_NAME,x)
+
+static MODULESETUPPROTO(NAME(Setup));
+
+static XF86ModuleVersionInfo NAME(VersRec) =
+{
+ STRING(NAME( )),
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData NAME(ModuleData) = { &NAME(VersRec), NAME(Setup), NULL };
+
+static pointer
+NAME(Setup)(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+
+ if (!setupDone) {
+ setupDone = TRUE;
+ /*
+ * Tell the loader about symbols from other modules that this module
+ * might refer to.
+ */
+ }
+ /*
+ * The return value must be non-NULL on success even though there
+ * is no TearDownProc.
+ */
+ return (pointer)1;
+}
+
+#endif
diff --git a/hw/xfree86/int10/xf86x86emu.c b/hw/xfree86/int10/xf86x86emu.c
new file mode 100644
index 000000000..6998a0880
--- /dev/null
+++ b/hw/xfree86/int10/xf86x86emu.c
@@ -0,0 +1,88 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c,v 1.13 2002/09/16 18:06:09 eich Exp $ */
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#include <x86emu.h>
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "compiler.h"
+#include "xf86_OSproc.h"
+#include "xf86Pci.h"
+#include "xf86_libc.h"
+#define _INT10_PRIVATE
+#include "xf86int10.h"
+#include "int10Defines.h"
+
+#define M _X86EMU_env
+
+static void
+x86emu_do_int(int num)
+{
+ Int10Current->num = num;
+
+ if (!int_handler(Int10Current)) {
+ X86EMU_halt_sys();
+ }
+}
+
+void
+xf86ExecX86int10(xf86Int10InfoPtr pInt)
+{
+ int sig = setup_int(pInt);
+
+ if (sig < 0)
+ return;
+
+ if (int_handler(pInt)) {
+ X86EMU_exec();
+ }
+
+ finish_int(pInt, sig);
+}
+
+Bool
+xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
+{
+ int i;
+ X86EMU_intrFuncs intFuncs[256];
+ X86EMU_pioFuncs pioFuncs = {
+ (&x_inb),
+ (&x_inw),
+ (&x_inl),
+ (&x_outb),
+ (&x_outw),
+ (&x_outl)
+ };
+
+ X86EMU_memFuncs memFuncs = {
+ (&Mem_rb),
+ (&Mem_rw),
+ (&Mem_rl),
+ (&Mem_wb),
+ (&Mem_ww),
+ (&Mem_wl)
+ };
+
+ X86EMU_setupMemFuncs(&memFuncs);
+
+ pInt->cpuRegs = &M;
+ M.mem_base = 0;
+ M.mem_size = 1024*1024 + 1024;
+ X86EMU_setupPioFuncs(&pioFuncs);
+
+ for (i=0;i<256;i++)
+ intFuncs[i] = x86emu_do_int;
+ X86EMU_setupIntrFuncs(intFuncs);
+ return TRUE;
+}
+
+void
+printk(const char *fmt, ...)
+{
+ va_list argptr;
+ va_start(argptr, fmt);
+ VErrorF(fmt, argptr);
+ va_end(argptr);
+}
diff --git a/hw/xfree86/int10/xf86x86emu.h b/hw/xfree86/int10/xf86x86emu.h
new file mode 100644
index 000000000..67c37d5f4
--- /dev/null
+++ b/hw/xfree86/int10/xf86x86emu.h
@@ -0,0 +1,51 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.h,v 1.2 2001/01/06 20:19:13 tsi Exp $ */
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#ifndef XF86X86EMU_H_
+#define XF86X86EMU_H_
+#include <x86emu.h>
+
+#define M _X86EMU_env
+
+#define X86_EAX M.x86.R_EAX
+#define X86_EBX M.x86.R_EBX
+#define X86_ECX M.x86.R_ECX
+#define X86_EDX M.x86.R_EDX
+#define X86_ESI M.x86.R_ESI
+#define X86_EDI M.x86.R_EDI
+#define X86_EBP M.x86.R_EBP
+#define X86_EIP M.x86.R_EIP
+#define X86_ESP M.x86.R_ESP
+#define X86_EFLAGS M.x86.R_EFLG
+
+#define X86_FLAGS M.x86.R_FLG
+#define X86_AX M.x86.R_AX
+#define X86_BX M.x86.R_BX
+#define X86_CX M.x86.R_CX
+#define X86_DX M.x86.R_DX
+#define X86_SI M.x86.R_SI
+#define X86_DI M.x86.R_DI
+#define X86_BP M.x86.R_BP
+#define X86_IP M.x86.R_IP
+#define X86_SP M.x86.R_SP
+#define X86_CS M.x86.R_CS
+#define X86_DS M.x86.R_DS
+#define X86_ES M.x86.R_ES
+#define X86_SS M.x86.R_SS
+#define X86_FS M.x86.R_FS
+#define X86_GS M.x86.R_GS
+
+#define X86_AL M.x86.R_AL
+#define X86_BL M.x86.R_BL
+#define X86_CL M.x86.R_CL
+#define X86_DL M.x86.R_DL
+
+#define X86_AH M.x86.R_AH
+#define X86_BH M.x86.R_BH
+#define X86_CH M.x86.R_CH
+#define X86_DH M.x86.R_DH
+
+#endif
diff --git a/hw/xfree86/loader/SparcMulDiv.S b/hw/xfree86/loader/SparcMulDiv.S
new file mode 100644
index 000000000..e7281593c
--- /dev/null
+++ b/hw/xfree86/loader/SparcMulDiv.S
@@ -0,0 +1,87 @@
+/*
+ * Hardware integer division and multiplication routines for SPARC v8 and higher.
+ *
+ * Copyright (C) 1996 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
+ *
+ * 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
+ * JAKUB JELINEK OR DAVID MILLER 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/SparcMulDiv.S,v 1.1 2000/11/02 19:10:54 dawes Exp $ */
+
+ .globl urem_sparcv89, umul_sparcv89, udiv_sparcv89
+ .globl rem_sparcv89, mul_sparcv89, div_sparcv89
+
+ .align 32
+urem_sparcv89:
+ wr %g0, 0x0, %y
+ nop
+ nop
+ nop
+ udiv %o0, %o1, %o2
+ umul %o2, %o1, %o2
+ retl
+ sub %o0, %o2, %o0
+
+ .align 32
+umul_sparcv89:
+ umul %o0, %o1, %o0
+ retl
+ rd %y, %o1
+
+ .align 32
+udiv_sparcv89:
+ wr %g0, 0x0, %y
+ nop
+ nop
+ retl
+ udiv %o0, %o1, %o0
+
+ .align 32
+rem_sparcv89:
+ sra %o0, 0x1f, %o4
+ wr %o4, 0x0, %y
+ nop
+ nop
+ nop
+ sdivcc %o0, %o1, %o2
+ bvs,a 1f
+ xnor %o2, %g0, %o2
+1: smul %o2, %o1, %o2
+ retl
+ sub %o0, %o2, %o0
+
+ .align 32
+mul_sparcv89:
+ smul %o0, %o1, %o0
+ retl
+ rd %y, %o1
+ nop
+
+ .align 32
+div_sparcv89:
+ sra %o0, 0x1f, %o2
+ wr %o2, 0x0, %y
+ nop
+ nop
+ nop
+ sdivcc %o0, %o1, %o0
+ bvs,a 1f
+ xnor %o0, %g0, %o0
+1: retl
+ nop
diff --git a/hw/xfree86/loader/aout.h b/hw/xfree86/loader/aout.h
new file mode 100644
index 000000000..2e58f2cab
--- /dev/null
+++ b/hw/xfree86/loader/aout.h
@@ -0,0 +1,232 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aout.h,v 1.7 2002/05/31 18:46:00 dawes Exp $ */
+
+/*
+ * Borrowed from NetBSD's exec_aout.h
+ *
+ * Copyright (c) 1993, 1994 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.
+ */
+
+#ifndef _AOUT_H
+#define _AOUT_H
+
+#include "Xos.h"
+
+/* Get prototype for ntohl. */
+#include <ctype.h>
+
+/* OS/2 EMX has ntohl in this file */
+#ifdef __UNIXOS2__
+#include <sys/param.h>
+#endif
+
+#define __LDPGSZ 4096U
+#ifndef AOUT_PAGSIZ
+#define AOUT_PAGSIZ(ex) (__LDPGSZ)
+#endif
+
+/*
+ * a.out header
+ */
+typedef struct AOUT_exec {
+ unsigned long a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */
+ unsigned long a_text; /* text segment size */
+ unsigned long a_data; /* initialized data size */
+ unsigned long a_bss; /* uninitialized data size */
+ unsigned long a_syms; /* symbol table size */
+ unsigned long a_entry; /* entry point */
+ unsigned long a_trsize; /* text relocation size */
+ unsigned long a_drsize; /* data relocation size */
+} AOUTHDR;
+
+/* a_magic */
+#define OMAGIC 0407 /* old impure format */
+#define NMAGIC 0410 /* read-only text */
+#define ZMAGIC 0413 /* demand load format */
+#define QMAGIC 0314 /* "compact" demand load format; deprecated */
+
+/*
+ * a_mid - keep sorted in numerical order for sanity's sake
+ * ensure that: 0 < mid < 0x3ff
+ */
+#define MID_ZERO 0 /* unknown - implementation dependent */
+#define MID_SUN010 1 /* sun 68010/68020 binary */
+#define MID_SUN020 2 /* sun 68020-only binary */
+#define MID_PC386 100 /* 386 PC binary. (so quoth BFD) */
+#define MID_HP200 200 /* hp200 (68010) BSD binary */
+#define MID_I386 134 /* i386 BSD binary */
+#define MID_M68K 135 /* m68k BSD binary with 8K page sizes */
+#define MID_M68K4K 136 /* m68k BSD binary with 4K page sizes */
+#define MID_NS32532 137 /* ns32532 */
+#define MID_SPARC 138 /* sparc */
+#define MID_PMAX 139 /* pmax */
+#define MID_VAX 140 /* vax */
+#define MID_ALPHA 141 /* Alpha BSD binary */
+#define MID_MIPS 142 /* big-endian MIPS */
+#define MID_ARM6 143 /* ARM6 */
+#define MID_HP300 300 /* hp300 (68020+68881) BSD binary */
+#define MID_HPUX 0x20C /* hp200/300 HP-UX binary */
+#define MID_HPUX800 0x20B /* hp800 HP-UX binary */
+
+/*
+ * a_flags
+ */
+#define EX_DYNAMIC 0x20
+#define EX_PIC 0x10
+#define EX_DPMASK 0x30
+/*
+ * Interpretation of the (a_flags & EX_DPMASK) bits:
+ *
+ * 00 traditional executable or object file
+ * 01 object file contains PIC code (set by `as -k')
+ * 10 dynamic executable
+ * 11 position independent executable image
+ * (eg. a shared library)
+ *
+ */
+
+/*
+ * The a.out structure's a_midmag field is a network-byteorder encoding
+ * of this int
+ * FFFFFFmmmmmmmmmmMMMMMMMMMMMMMMMM
+ * Where `F' is 6 bits of flag like EX_DYNAMIC,
+ * `m' is 10 bits of machine-id like MID_I386, and
+ * `M' is 16 bits worth of magic number, ie. ZMAGIC.
+ * The macros below will set/get the needed fields.
+ */
+#define AOUT_GETMAGIC(ex) \
+ ( (((ex)->a_midmag)&0xffff0000U) ? (ntohl(((ex)->a_midmag))&0xffffU) : ((ex)->a_midmag))
+#define AOUT_GETMAGIC2(ex) \
+ ( (((ex)->a_midmag)&0xffff0000U) ? (ntohl(((ex)->a_midmag))&0xffffU) : \
+ (((ex)->a_midmag) | 0x10000) )
+#define AOUT_GETMID(ex) \
+ ( (((ex)->a_midmag)&0xffff0000U) ? ((ntohl(((ex)->a_midmag))>>16)&0x03ffU) : MID_ZERO )
+#define AOUT_GETFLAG(ex) \
+ ( (((ex)->a_midmag)&0xffff0000U) ? ((ntohl(((ex)->a_midmag))>>26)&0x3fU) : 0 )
+#define AOUT_SETMAGIC(ex,mag,mid,flag) \
+ ( (ex)->a_midmag = htonl( (((flag)&0x3fU)<<26) | (((mid)&0x03ffU)<<16) | \
+ (((mag)&0xffffU)) ) )
+
+#define AOUT_ALIGN(ex,x) \
+ (AOUT_GETMAGIC(ex) == ZMAGIC || AOUT_GETMAGIC(ex) == QMAGIC ? \
+ ((x) + __LDPGSZ - 1) & ~(__LDPGSZ - 1) : (x))
+
+/* Valid magic number check. */
+#define AOUT_BADMAG(ex) \
+ (AOUT_GETMAGIC(ex) != NMAGIC && AOUT_GETMAGIC(ex) != OMAGIC && \
+ AOUT_GETMAGIC(ex) != ZMAGIC && AOUT_GETMAGIC(ex) != QMAGIC)
+
+/* Address of the bottom of the text segment. */
+#define AOUT_TXTADDR(ex) (AOUT_GETMAGIC2(ex) == (ZMAGIC|0x10000) ? 0 : __LDPGSZ)
+
+/* Address of the bottom of the data segment. */
+#define AOUT_DATADDR(ex) \
+ (AOUT_GETMAGIC(ex) == OMAGIC ? AOUT_TXTADDR(ex) + (ex)->a_text : \
+ (AOUT_TXTADDR(ex) + (ex)->a_text + __LDPGSZ - 1) & ~(__LDPGSZ - 1))
+
+/* Address of the bottom of the bss segment. */
+#define AOUT_BSSADDR(ex) \
+ (AOUT_DATADDR(ex) + (ex)->a_data)
+
+/* Text segment offset. */
+#define AOUT_TXTOFF(ex) \
+ ( AOUT_GETMAGIC2(ex)==ZMAGIC || AOUT_GETMAGIC2(ex)==(QMAGIC|0x10000) ? \
+ 0 : (AOUT_GETMAGIC2(ex)==(ZMAGIC|0x10000) ? __LDPGSZ : \
+ sizeof(struct AOUT_exec)) )
+
+/* Data segment offset. */
+#define AOUT_DATOFF(ex) \
+ AOUT_ALIGN(ex, AOUT_TXTOFF(ex) + (ex)->a_text)
+
+/* Text relocation table offset. */
+#define AOUT_TRELOFF(ex) \
+ (AOUT_DATOFF(ex) + (ex)->a_data)
+
+/* Data relocation table offset. */
+#define AOUT_DRELOFF(ex) \
+ (AOUT_TRELOFF(ex) + (ex)->a_trsize)
+
+/* Symbol table offset. */
+#define AOUT_SYMOFF(ex) \
+ (AOUT_DRELOFF(ex) + (ex)->a_drsize)
+
+/* String table offset. */
+#define AOUT_STROFF(ex) \
+ (AOUT_SYMOFF(ex) + (ex)->a_syms)
+
+
+/* Relocation format. */
+struct relocation_info_i386 {
+ int r_address; /* offset in text or data segment */
+ unsigned int r_symbolnum : 24, /* ordinal number of add symbol */
+ r_pcrel : 1, /* 1 if value should be pc-relative */
+ r_length : 2, /* log base 2 of value's width */
+ r_extern : 1, /* 1 if need to add symbol to value */
+ r_baserel : 1, /* linkage table relative */
+ r_jmptable : 1, /* relocate to jump table */
+ r_relative : 1, /* load address relative */
+ r_copy : 1; /* run time copy */
+};
+#define relocation_info relocation_info_i386
+
+/*
+ * Symbol table entry format. The #ifdef's are so that programs including
+ * nlist.h can initialize nlist structures statically.
+ */
+typedef struct AOUT_nlist {
+ union {
+ char *n_name; /* symbol name (in memory) */
+ long n_strx; /* file string table offset (on disk) */
+ } n_un;
+
+
+#define AOUT_UNDF 0x00 /* undefined */
+#define AOUT_ABS 0x02 /* absolute address */
+#define AOUT_TEXT 0x04 /* text segment */
+#define AOUT_DATA 0x06 /* data segment */
+#define AOUT_BSS 0x08 /* bss segment */
+#define AOUT_INDR 0x0a /* alias definition */
+#define AOUT_SIZE 0x0c /* pseudo type, defines a symbol's size */
+#define AOUT_COMM 0x12 /* common reference */
+#define AOUT_FN 0x1e /* file name (AOUT_EXT on) */
+#define AOUT_WARN 0x1e /* warning message (AOUT_EXT off) */
+
+#define AOUT_EXT 0x01 /* external (global) bit, OR'ed in */
+#define AOUT_TYPE 0x1e /* mask for all the type bits */
+ unsigned char n_type; /* type defines */
+
+ char n_other; /* spare */
+#define n_hash n_desc /* used internally by ld(1); XXX */
+ short n_desc; /* used by stab entries */
+ unsigned long n_value; /* address/value of the symbol */
+} AOUT_nlist;
+
+#define AOUT_FORMAT "%08x" /* namelist value format; XXX */
+#define AOUT_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */
+
+#endif
diff --git a/hw/xfree86/loader/aoutloader.c b/hw/xfree86/loader/aoutloader.c
new file mode 100644
index 000000000..98e657dca
--- /dev/null
+++ b/hw/xfree86/loader/aoutloader.c
@@ -0,0 +1,858 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.c,v 1.17 2001/11/16 16:47:55 dawes Exp $ */
+
+/*
+ *
+ * Copyright (c) 1997 Matthieu Herrb
+ * Copyright 1995-1998 Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ *
+ * Modified 21/02/97 by Sebastien Marineau to support OS/2 a.out objects
+ */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef __QNX__
+#include <fcntl.h>
+#else
+#include <sys/fcntl.h>
+#endif
+#include <sys/stat.h>
+#include <netinet/in.h>
+
+#ifdef DBMALLOC
+#include <debug/malloc.h>
+#define Xalloc(size) malloc(size)
+#define Xcalloc(size) calloc(1,(size))
+#define Xfree(size) free(size)
+#endif
+
+#include "Xos.h"
+#include "os.h"
+#include "aout.h"
+
+#include "sym.h"
+#include "loader.h"
+#include "aoutloader.h"
+
+/*
+#define AOUTDEBUG ErrorF
+*/
+
+
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+
+/*
+ * This structure contains all of the information about a module
+ * that has been loaded.
+ */
+
+typedef struct {
+ int handle;
+ int module;
+ int fd;
+ loader_funcs *funcs;
+ AOUTHDR *header;/* file header */
+ unsigned char *text; /* Start address of the text section */
+ unsigned int textsize; /* Size of the text section */
+ unsigned char *data; /* Start address of the data section */
+ unsigned int datasize; /* Size of the data section */
+ unsigned char *bss; /* Start address of the bss data */
+ unsigned int bsssize; /* Size of the bss section */
+ struct relocation_info *txtrel; /* Start address of the text relocation table */
+ struct relocation_info *datarel; /* Start address of the data relocation table */
+ AOUT_nlist *symtab; /* Start address of the symbol table */
+ unsigned char *strings; /* Start address of the string table */
+ unsigned long strsize; /* size of string table */
+ unsigned char *common; /* Start address of the common data */
+ unsigned long comsize; /* size of common data */
+} AOUTModuleRec, *AOUTModulePtr;
+
+/*
+ * If an relocation is unable to be satisfied, then put it on a list
+ * to try later after more modules have been loaded.
+ */
+typedef struct AOUT_RELOC {
+ AOUTModulePtr file;
+ struct relocation_info *rel;
+ int type; /* AOUT_TEXT or AOUT_DATA */
+ struct AOUT_RELOC *next;
+} AOUTRelocRec;
+
+/*
+ * Symbols with a section number of 0 (N_UNDF) but a value of non-zero
+ * need to have space allocated for them.
+ *
+ * Gather all of these symbols together, and allocate one chunk when we
+ * are done.
+ */
+
+typedef struct AOUT_COMMON {
+ struct AOUT_nlist *sym;
+ int index;
+ struct AOUT_COMMON *next;
+} AOUTCommonRec;
+
+static AOUTCommonPtr listCOMMON = NULL;
+
+/* prototypes for static functions */
+static int AOUTHashCleanOut(void *, itemPtr);
+static char *AOUTGetSymbolName(AOUTModulePtr, struct AOUT_nlist *);
+static void *AOUTGetSymbolValue(AOUTModulePtr, int);
+static AOUTCommonPtr AOUTAddCommon(struct AOUT_nlist *, int);
+static LOOKUP *AOUTCreateCommon(AOUTModulePtr);
+static LOOKUP *AOUT_GetSymbols(AOUTModulePtr);
+static AOUTRelocPtr AOUTDelayRelocation(AOUTModulePtr, int, struct relocation_info_i386 *);
+static AOUTRelocPtr AOUTCollectRelocations(AOUTModulePtr);
+static void AOUT_Relocate(unsigned long *, unsigned long, int);
+static AOUTRelocPtr AOUT_RelocateEntry(AOUTModulePtr, int, struct relocation_info_i386 *);
+
+/*
+ * Return 1 if the symbol in item belongs to aoutfile
+ */
+static int
+AOUTHashCleanOut(void *voidptr, itemPtr item)
+{
+ AOUTModulePtr aoutfile = (AOUTModulePtr) voidptr;
+ return (aoutfile->handle == item->handle);
+}
+
+/*
+ * Manage listResolv
+ */
+static AOUTRelocPtr
+AOUTDelayRelocation(AOUTModulePtr aoutfile, int type,
+ struct relocation_info *rel)
+{
+ AOUTRelocPtr reloc;
+
+ if ((reloc = xf86loadermalloc(sizeof(AOUTRelocRec))) == NULL) {
+ ErrorF("AOUTDelayRelocation() Unable to allocate memory\n");
+ return NULL;
+ }
+ if ((unsigned long)rel < 0x200) {
+ ErrorF("bug");
+ }
+ reloc->file = aoutfile;
+ reloc->type = type;
+ reloc->rel = rel;
+ reloc->next = 0;
+ return reloc;
+}
+
+
+
+/*
+ * Manage listCOMMON
+ */
+
+static AOUTCommonPtr
+AOUTAddCommon(struct AOUT_nlist *sym, int index)
+{
+ AOUTCommonPtr common;
+
+ if ((common = xf86loadermalloc(sizeof (AOUTCommonRec))) == NULL) {
+ ErrorF( "AOUTAddCommon() Unable to allocate memory\n" );
+ return 0;
+ }
+ common->sym = sym;
+ common->index = index;
+ common->next = 0;
+ return common;
+}
+
+static LOOKUP *
+AOUTCreateCommon(AOUTModulePtr aoutfile)
+{
+ int numsyms = 0, size = 0, l = 0;
+ int offset = 0;
+ AOUTCommonPtr common;
+ LOOKUP *lookup;
+
+ if (listCOMMON == NULL)
+ return NULL;
+
+ common = listCOMMON;
+ for (common = listCOMMON; common; common = common->next) {
+ /* Ensure long word alignment */
+ if( (common->sym->n_value & (sizeof(long)-1)) != 0 )
+ common->sym->n_value = (common->sym->n_value + (sizeof(long)-1))
+ & ~(sizeof(long)-1);
+
+ /* accumulate the sizes */
+ size += common->sym->n_value;
+ numsyms++;
+ } /* while */
+
+#ifdef AOUTDEBUG
+ AOUTDEBUG("AOUTCreateCommon() %d entries (%d bytes) of COMMON data\n",
+ numsyms, size );
+#endif
+
+ if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) {
+ ErrorF( "AOUTCreateCommon() Unable to allocate memory\n" );
+ return NULL;
+ }
+
+ aoutfile->comsize = size;
+ if ((aoutfile->common = xf86loadercalloc(1,size)) == NULL) {
+ ErrorF( "AOUTCreateCommon() Unable to allocate memory\n" );
+ return NULL;
+ }
+
+ while (listCOMMON) {
+ common = listCOMMON;
+ lookup[l].symName= AOUTGetSymbolName(aoutfile, common->sym);
+ lookup[l].offset = (funcptr)(aoutfile->common+offset);
+#ifdef AOUTDEBUG
+ AOUTDEBUG("Adding %x %s\n", lookup[l].offset, lookup[l].symName );
+#endif
+ listCOMMON = common->next;
+ offset += common->sym->n_value;
+ xf86loaderfree(common);
+ l++;
+ } /* while */
+ /* listCOMMON == NULL */
+
+ lookup[l].symName=NULL; /* Terminate the list */
+ return lookup;
+}
+
+/*
+ * Symbol Table
+ */
+
+static char *
+AOUTGetString(AOUTModulePtr aoutfile, int index)
+{
+ char *symname = (char *) &(aoutfile->strings[index]);
+
+ if (symname[0] == '_') {
+ symname++;
+ }
+
+ return symname;
+}
+/*
+ * Return the name of a symbol
+ */
+static char *
+AOUTGetSymbolName(AOUTModulePtr aoutfile, struct AOUT_nlist *sym)
+{
+ char *symname = AOUTGetString(aoutfile,sym->n_un.n_strx);
+ char *name;
+
+ name=xf86loadermalloc(strlen(symname)+1);
+ if (!name)
+ FatalError("AOUTGetSymbolName: Out of memory\n");
+
+ strcpy(name,symname);
+
+ return name;
+}
+
+/*
+ * Return the value of a symbol in the loader's symbol table
+ */
+static void *
+AOUTGetSymbolValue(AOUTModulePtr aoutfile, int index)
+{
+ void *symval = NULL; /* value of the indicated symbol */
+ itemPtr symbol = NULL; /* name/value of symbol */
+ char *name = NULL;
+
+ name = AOUTGetSymbolName(aoutfile, aoutfile->symtab + index);
+
+ if( name )
+ symbol = LoaderHashFind(name);
+
+ if (symbol)
+ symval = (unsigned char *)symbol->address;
+
+ xf86loaderfree(name);
+ return symval;
+}
+
+
+/*
+ * Perform the actual relocation
+ */
+static void
+AOUT_Relocate(unsigned long *destl, unsigned long val, int pcrel)
+{
+#ifdef AOUTDEBUG
+ AOUTDEBUG("AOUT_Relocate %p : %08x %s",
+ destl, *destl, pcrel == 1 ? "rel" : "abs");
+
+#endif
+ if (pcrel) {
+ /* relative to PC */
+ *destl = val - ((unsigned long)destl + sizeof(long));
+ } else {
+ *destl += val;
+ }
+#ifdef AOUTDEBUG
+ AOUTDEBUG(" -> %08x\n", *destl);
+#endif
+}
+
+
+/*
+ * Fix the relocation for text or data section
+ */
+static AOUTRelocPtr
+AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
+ struct relocation_info *rel)
+{
+ AOUTHDR *header = aoutfile->header;
+ AOUT_nlist *symtab = aoutfile->symtab;
+ int symnum;
+ void *symval;
+ unsigned long *destl; /* address of the location to be modified */
+
+ symnum = rel->r_symbolnum;
+#ifdef AOUTDEBUG
+ {
+ char *name;
+ if (rel->r_extern) {
+ AOUTDEBUG("AOUT_RelocateEntry: extern %s\n",
+ name=AOUTGetSymbolName(aoutfile, symtab+symnum));
+ xf86loaderfree(name);
+ } else {
+ AOUTDEBUG("AOUT_RelocateEntry: intern\n");
+ }
+ AOUTDEBUG(" pcrel: %d", rel->r_pcrel);
+ AOUTDEBUG(" length: %d", rel->r_length);
+ AOUTDEBUG(" baserel: %d", rel->r_baserel);
+ AOUTDEBUG(" jmptable: %d", rel->r_jmptable);
+ AOUTDEBUG(" relative: %d", rel->r_relative);
+ AOUTDEBUG(" copy: %d\n", rel->r_copy);
+ }
+#endif /* AOUTDEBUG */
+
+ if (rel->r_length != 2) {
+ ErrorF("AOUT_ReloateEntry: length != 2\n");
+ }
+ /*
+ * First find the address to modify
+ */
+ switch (type) {
+ case AOUT_TEXT:
+ /* Check that the relocation offset is in the text segment */
+ if (rel->r_address > header->a_text) {
+ ErrorF("AOUT_RelocateEntry(): "
+ "text relocation out of text section\n");
+ }
+ destl = (unsigned long *)(aoutfile->text + rel->r_address);
+ break;
+ case AOUT_DATA:
+ /* Check that the relocation offset is in the data segment */
+ if (rel->r_address > header->a_data) {
+ ErrorF("AOUT_RelocateEntry():"
+ "data relocation out of data section\n");
+ }
+ destl = (unsigned long *)(aoutfile->data + rel->r_address);
+ break;
+ default:
+ ErrorF("AOUT_RelocateEntry(): unknown section type %d\n", type);
+ return 0;
+ } /* switch */
+
+ /*
+ * Now handle the relocation
+ */
+ if (rel->r_extern) {
+ /* Lookup the symbol in the loader's symbol table */
+ symval = AOUTGetSymbolValue(aoutfile, symnum);
+ if (symval != 0) {
+ /* we've got the value */
+ AOUT_Relocate(destl, (unsigned long) symval, rel->r_pcrel);
+ return 0;
+ } else {
+ /* The symbol should be undefined */
+ switch (symtab[symnum].n_type & AOUT_TYPE) {
+ case AOUT_UNDF:
+#ifdef AOUTDEBUG
+ AOUTDEBUG(" extern AOUT_UNDEF\n");
+#endif
+ /* Add this relocation back to the global list */
+ return AOUTDelayRelocation(aoutfile,type,rel);
+
+ default:
+ ErrorF("AOUT_RelocateEntry():"
+ " impossible intern relocation type: %d\n",
+ symtab[symnum].n_type);
+ return 0;
+ } /* switch */
+ }
+ } else {
+ /* intern */
+ switch (rel->r_symbolnum) {
+ case AOUT_TEXT:
+#ifdef AOUTDEBUG
+ AOUTDEBUG(" AOUT_TEXT\n");
+#endif
+ /* Only absolute intern text relocations need to be handled */
+ if (rel->r_pcrel == 0)
+ AOUT_Relocate(destl, (unsigned long)aoutfile->text,
+ rel->r_pcrel);
+ return 0;
+ case AOUT_DATA:
+#ifdef AOUTDEBUG
+ AOUTDEBUG(" AOUT_DATA\n");
+#endif
+ if (rel->r_pcrel == 0)
+ AOUT_Relocate(destl, (unsigned long)aoutfile->data
+ - header->a_text, rel->r_pcrel);
+ else
+ ErrorF("AOUT_RelocateEntry(): "
+ "don't know how to handle data pc-relative reloc\n");
+
+ return 0;
+ case AOUT_BSS:
+#ifdef AOUTDEBUG
+ AOUTDEBUG(" AOUT_BSS\n");
+#endif
+ if (rel->r_pcrel == 0)
+ AOUT_Relocate(destl, (unsigned long)aoutfile->bss
+ - header->a_text - header->a_data,
+ rel->r_pcrel);
+ else
+ ErrorF("AOUT_RelocateEntry(): "
+ "don't know how to handle bss pc-relative reloc\n");
+
+ return 0;
+ default:
+ ErrorF("AOUT_RelocateEntry():"
+ " unknown intern relocation type: %d\n", rel->r_symbolnum);
+ return 0;
+ } /* switch */
+ }
+} /* AOUT_RelocateEntry */
+
+static AOUTRelocPtr
+AOUTCollectRelocations(AOUTModulePtr aoutfile)
+{
+ AOUTHDR *header = aoutfile->header;
+ int i, nreloc;
+ struct relocation_info *rel;
+ AOUTRelocPtr reloc_head = NULL;
+ AOUTRelocPtr tmp;
+
+ /* Text relocations */
+ if (aoutfile->text != NULL && aoutfile->txtrel != NULL) {
+ nreloc = header->a_trsize/sizeof(struct relocation_info);
+
+ for (i = 0; i < nreloc; i++) {
+ rel = aoutfile->txtrel + i;
+ tmp = AOUTDelayRelocation(aoutfile, AOUT_TEXT, rel);
+ if (tmp) {
+ tmp->next = reloc_head;
+ reloc_head = tmp;
+ }
+ } /* for */
+ }
+ /* Data relocations */
+ if (aoutfile->data != NULL && aoutfile->datarel != NULL) {
+ nreloc = header->a_drsize/sizeof(struct relocation_info);
+
+ for (i = 0; i < nreloc; i++) {
+ rel = aoutfile->datarel + i;
+ tmp = AOUTDelayRelocation(aoutfile, AOUT_DATA, rel);
+ tmp->next = reloc_head;
+ reloc_head = tmp;
+ } /* for */
+ }
+ return reloc_head;
+} /* AOUTCollectRelocations */
+
+/*
+ * AOUT_GetSymbols()
+ *
+ * add the symbols to the loader's symbol table
+ */
+static LOOKUP *
+AOUT_GetSymbols(AOUTModulePtr aoutfile)
+{
+ int fd = aoutfile->fd;
+ AOUTHDR *header = aoutfile->header;
+ int nsyms, soff, i, l;
+ char *symname;
+ AOUT_nlist *s;
+ LOOKUP *lookup, *lookup_common;
+ AOUTCommonPtr tmp;
+
+ aoutfile->symtab = (AOUT_nlist *)_LoaderFileToMem(fd,
+ AOUT_SYMOFF(header),
+ header->a_syms,
+ "symbols");
+ nsyms = header->a_syms/sizeof(AOUT_nlist);
+ lookup = xf86loadermalloc(nsyms * sizeof(LOOKUP));
+ if (lookup == NULL) {
+ ErrorF("AOUT_GetSymbols(): can't allocate memory\n");
+ return NULL;
+ }
+ for (i = 0, l = 0; i < nsyms; i++) {
+ s = aoutfile->symtab + i;
+ soff=s->n_un.n_strx;
+ if (soff == 0 || (s->n_type & AOUT_STAB) != 0)
+ continue;
+ symname=AOUTGetSymbolName(aoutfile,s);
+#ifdef AOUTDEBUG
+ AOUTDEBUG("AOUT_GetSymbols(): %s %02x %02x %08x\n",
+ symname, s->n_type,
+ s->n_other, s->n_value);
+#endif
+ switch (s->n_type & AOUT_TYPE) {
+ case AOUT_UNDF:
+ if (s->n_value != 0) {
+ if (!LoaderHashFind(symname)) {
+#ifdef AOUTDEBUG
+ AOUTDEBUG("Adding common %s\n", symname);
+#endif
+ tmp = AOUTAddCommon(s, i);
+ if (tmp) {
+ tmp->next = listCOMMON;
+ listCOMMON = tmp;
+ }
+ }
+ } else {
+#ifdef AOUTDEBUG
+ AOUTDEBUG("Adding undef %s\n", symname);
+#endif
+ }
+ xf86loaderfree(symname);
+ break;
+ case AOUT_TEXT:
+ if (s->n_type & AOUT_EXT) {
+ lookup[l].symName = symname;
+ /* text symbols start at 0 */
+ lookup[l].offset = (funcptr)(aoutfile->text + s->n_value);
+#ifdef AOUTDEBUG
+ AOUTDEBUG("Adding text %s %08x\n", symname, lookup[l].offset);
+#endif
+ l++;
+ } else {
+ xf86loaderfree(symname);
+ }
+ break;
+ case AOUT_DATA :
+ if (s->n_type & AOUT_EXT) {
+ lookup[l].symName = symname;
+ /* data symbols are following text */
+ lookup[l].offset = (funcptr)(aoutfile->data +
+ s->n_value - header->a_text);
+#ifdef AOUTDEBUG
+ AOUTDEBUG("Adding data %s %08x\n", symname, lookup[l].offset);
+#endif
+ l++;
+ } else {
+ xf86loaderfree(symname);
+ }
+ break;
+ case AOUT_BSS:
+ if (s->n_type & AOUT_EXT) {
+ lookup[l].symName = symname;
+ /* bss symbols follow both text and data */
+ lookup[l].offset = (funcptr)(aoutfile->bss + s->n_value
+ - (header->a_data
+ + header->a_text));
+#ifdef AOUTDEBUG
+ AOUTDEBUG("Adding bss %s %08x\n", symname, lookup[l].offset);
+#endif
+ l++;
+ } else {
+ xf86loaderfree(symname);
+ }
+ break;
+ case AOUT_FN:
+#ifdef AOUTDEBUG
+ if (n->n_type& AOUT_EXT) {
+ AOUTDEBUG("Ignoring AOUT_FN %s\n", symname);
+ } else {
+ AOUTDEBUG("Ignoring AOUT_WARN %s\n", symname);
+ }
+#endif
+ xf86loaderfree(symname);
+ break;
+ default:
+ ErrorF("Unknown symbol type %x\n", s->n_type & AOUT_TYPE);
+ xf86loaderfree(symname);
+ } /* switch */
+ } /* for */
+ lookup[l].symName = NULL;
+
+ lookup_common = AOUTCreateCommon(aoutfile);
+ if (lookup_common) {
+ LOOKUP *p;
+
+ for (i = 0, p = lookup_common; p->symName; i++, p++)
+ ;
+ memcpy(&(lookup[l]), lookup_common, i * sizeof (LOOKUP));
+
+ xf86loaderfree(lookup_common);
+ l += i;
+ lookup[l].symName = NULL;
+ }
+ return lookup;
+} /* AOUT_GetSymbols */
+
+/*
+ * Public API for the a.out implementation of the loader
+ */
+void *
+AOUTLoadModule(loaderPtr modrec,
+ int aoutfd,
+ LOOKUP **ppLookup)
+{
+ AOUTModulePtr aoutfile = NULL;
+ AOUTHDR *header;
+ AOUTRelocPtr reloc, tail;
+ void *v;
+
+#ifdef AOUTDEBUG
+ AOUTDEBUG("AOUTLoadModule(%s, %d, %d)\n",
+ modrec->name, modrec->handle, aoutfd);
+#endif
+ if ((aoutfile=xf86loadercalloc(1,sizeof(AOUTModuleRec))) == NULL ) {
+ ErrorF( "Unable to allocate AOUTModuleRec\n" );
+ return NULL;
+ }
+
+ aoutfile->handle=modrec->handle;
+ aoutfile->module=modrec->module;
+ aoutfile->fd=aoutfd;
+ v=aoutfile->funcs=modrec->funcs;
+
+ /*
+ * Get the a.out header
+ */
+ aoutfile->header=(AOUTHDR *)_LoaderFileToMem(aoutfd,0,sizeof(AOUTHDR),
+ "header");
+ header= (AOUTHDR *)aoutfile->header;
+
+ /*
+ * Load the 6 other sections
+ */
+ /* text */
+ if (header->a_text != 0) {
+ aoutfile->text = _LoaderFileToMem(aoutfile->fd,
+ AOUT_TXTOFF(header),
+ header->a_text, "text");
+ aoutfile->textsize = header->a_text;
+ } else {
+ aoutfile->text = NULL;
+ }
+ /* data */
+ if (header->a_data != 0) {
+ aoutfile->data = _LoaderFileToMem(aoutfile->fd,
+ AOUT_DATOFF(header),
+ header->a_data, "data");
+ aoutfile->datasize = header->a_data;
+ } else {
+ aoutfile->data = NULL;
+ }
+ /* bss */
+ if (header->a_bss != 0) {
+ aoutfile->bss = xf86loadercalloc(1, header->a_bss);
+ aoutfile->bsssize = header->a_bss;
+ } else {
+ aoutfile->bss = NULL;
+ }
+ /* Text Relocations */
+ if (header->a_trsize != 0) {
+ aoutfile->txtrel = _LoaderFileToMem(aoutfile->fd,
+ AOUT_TRELOFF(header),
+ header->a_trsize, "txtrel");
+ } else {
+ aoutfile->txtrel = NULL;
+ }
+ /* Data Relocations */
+ if (header->a_drsize != 0) {
+ aoutfile->datarel = _LoaderFileToMem(aoutfile->fd,
+ AOUT_DRELOFF(header),
+ header->a_drsize, "datarel");
+ } else {
+ aoutfile->datarel = NULL;
+ }
+ /* String table */
+ _LoaderFileRead(aoutfile->fd, AOUT_STROFF(header),
+ &(aoutfile->strsize), sizeof(int));
+ if (aoutfile->strsize != 0) {
+ aoutfile->strings = _LoaderFileToMem(aoutfile->fd,
+ AOUT_STROFF(header),
+ aoutfile->strsize, "strings");
+ } else {
+ aoutfile->strings = NULL;
+ }
+ /* load symbol table */
+ *ppLookup = AOUT_GetSymbols(aoutfile);
+
+ /* Do relocations */
+ reloc = AOUTCollectRelocations(aoutfile);
+
+ if (reloc) {
+ for (tail = reloc; tail->next; tail = tail->next)
+ ;
+ tail->next = _LoaderGetRelocations(v)->aout_reloc;
+ _LoaderGetRelocations(v)->aout_reloc = reloc;
+ }
+
+ return (void *)aoutfile;
+}
+
+void
+AOUTResolveSymbols(mod)
+void *mod;
+{
+ AOUTRelocPtr newlist, p, tmp;
+
+#ifdef AOUTDEBUG
+ AOUTDEBUG("AOUTResolveSymbols()\n");
+#endif
+
+ newlist = 0;
+ for (p = _LoaderGetRelocations(mod)->aout_reloc; p; ) {
+ tmp = AOUT_RelocateEntry(p->file, p->type, p->rel);
+ if (tmp) {
+ /* Failed to relocate. Keep it in the list. */
+ tmp->next = newlist;
+ newlist = tmp;
+ }
+ tmp = p;
+ p = p->next;
+ xf86loaderfree(tmp);
+ }
+ _LoaderGetRelocations(mod)->aout_reloc = newlist;
+} /* AOUTResolveSymbols */
+
+int
+AOUTCheckForUnresolved(mod)
+void *mod;
+{
+ int symnum;
+ AOUTRelocPtr crel;
+ char *name;
+ int fatalsym = 0, flag;
+
+#ifdef AOUTDEBUG
+ AOUTDEBUG("AOUTCheckForUnResolved()\n");
+#endif
+ if ((crel = _LoaderGetRelocations(mod)->aout_reloc) == NULL)
+ return 0;
+
+ while (crel) {
+ if (crel->type == AOUT_TEXT) {
+ /* Attempt to make unresolved text references
+ point to a default function */
+ AOUT_Relocate((unsigned long *)(crel->file->text
+ + crel->rel->r_address) ,
+ (unsigned long)LoaderDefaultFunc,
+ crel->rel->r_pcrel);
+ }
+ symnum = crel->rel->r_symbolnum;
+ name=AOUTGetSymbolName(crel->file, crel->file->symtab + symnum);
+ flag = _LoaderHandleUnresolved(name,
+ _LoaderHandleToName(crel->file->handle));
+ xf86loaderfree(name);
+ if (flag) fatalsym = 1;
+ crel = crel->next;
+ }
+ return fatalsym;
+}
+
+void
+AOUTUnloadModule(void *modptr)
+{
+ AOUTModulePtr aoutfile = (AOUTModulePtr)modptr;
+ AOUTRelocPtr relptr, *prevptr;
+#ifdef AOUTDEBUG
+ AOUTDEBUG("AOUTUnLoadModule(0x%p)\n", modptr);
+#endif
+
+/*
+ * Delete any unresolved relocations
+ */
+
+ relptr=_LoaderGetRelocations(aoutfile->funcs)->aout_reloc;
+ prevptr=&(_LoaderGetRelocations(aoutfile->funcs)->aout_reloc);
+
+ while (relptr) {
+ if (relptr->file == aoutfile) {
+ *prevptr = relptr->next;
+ xf86loaderfree(relptr);
+ relptr = *prevptr;
+ } else {
+ prevptr = &(relptr->next);
+ relptr = relptr->next;
+ }
+ } /* while */
+
+ /* clean the symbols table */
+ LoaderHashTraverse((void *)aoutfile, AOUTHashCleanOut);
+
+#define CheckandFree(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size))
+
+ CheckandFree(aoutfile->strings,aoutfile->strsize);
+ CheckandFree(aoutfile->symtab,aoutfile->header->a_syms);
+ CheckandFree(aoutfile->datarel,aoutfile->header->a_drsize);
+ CheckandFree(aoutfile->txtrel,aoutfile->header->a_trsize);
+ CheckandFree(aoutfile->data,aoutfile->header->a_data);
+ CheckandFree(aoutfile->text,aoutfile->header->a_text);
+ /* Free allocated sections */
+ if (aoutfile->bss != NULL) {
+ xf86loaderfree(aoutfile->bss);
+ }
+ if (aoutfile->common != NULL) {
+ xf86loaderfree(aoutfile->common);
+ }
+
+ /* Free header */
+ _LoaderFreeFileMem(aoutfile->header, sizeof(AOUTHDR));
+
+ /* Free the module structure itself */
+ xf86loaderfree(aoutfile);
+
+ return;
+}
+
+char *
+AOUTAddressToSection(void *modptr, unsigned long address)
+{
+ AOUTModulePtr aoutfile = (AOUTModulePtr)modptr;
+
+ if( address >= (unsigned long)aoutfile->text &&
+ address <= (unsigned long)aoutfile->text+aoutfile->textsize ) {
+ return "text";
+ }
+ if( address >= (unsigned long)aoutfile->data &&
+ address <= (unsigned long)aoutfile->data+aoutfile->datasize ) {
+ return "data";
+ }
+ if( address >= (unsigned long)aoutfile->bss &&
+ address <= (unsigned long)aoutfile->bss+aoutfile->bsssize ) {
+ return "bss";
+ }
+
+ return NULL;
+}
+
diff --git a/hw/xfree86/loader/aoutloader.h b/hw/xfree86/loader/aoutloader.h
new file mode 100644
index 000000000..2714b140f
--- /dev/null
+++ b/hw/xfree86/loader/aoutloader.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 1997,1998 Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.h,v 1.3 1998/09/20 14:41:03 dawes Exp $ */
+
+#ifndef _AOUTLOADER_H
+#define _AOUTLOADER_H
+extern void *AOUTLoadModule(loaderPtr, int, LOOKUP **);
+extern void AOUTResolveSymbols(void *);
+extern int AOUTCheckForUnresolved(void *);
+extern char *AOUTAddressToSection(void *,unsigned long);
+extern void AOUTUnloadModule(void *);
+#endif
diff --git a/hw/xfree86/loader/ar.h b/hw/xfree86/loader/ar.h
new file mode 100644
index 000000000..4dbc97901
--- /dev/null
+++ b/hw/xfree86/loader/ar.h
@@ -0,0 +1,77 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/ar.h,v 1.3 1998/07/25 16:56:12 dawes Exp $ */
+
+
+#ifndef _AR_H
+#define _AR_H
+
+#define ARMAG "!<arch>\n"
+#define SARMAG 8
+#define ARFMAG "`\n"
+
+#if !(defined(__powerpc__) && defined(Lynx))
+struct ar_hdr {
+ char ar_name[16],
+ ar_date[12],
+ ar_uid[6],
+ ar_gid[6],
+ ar_mode[8],
+ ar_size[10],
+ ar_fmag[2];
+};
+
+#else
+
+#define AIAMAG "<aiaff>\n"
+#define SAIAMAG 8
+#define AIAFMAG "`\n"
+
+struct fl_hdr /* archive fixed length header - printable ascii */
+{
+ char fl_magic[SAIAMAG]; /* Archive file magic string */
+ char fl_memoff[12]; /* Offset to member table */
+ char fl_gstoff[12]; /* Offset to global symbol table */
+ char fl_fstmoff[12]; /* Offset to first archive member */
+ char fl_lstmoff[12]; /* Offset to last archive member */
+ char fl_freeoff[12]; /* Offset to first mem on free list */
+};
+
+#define FL_HDR struct fl_hdr
+#define FL_HSZ sizeof(FL_HDR)
+
+
+struct ar_hdr /* archive file member header - printable ascii */
+{
+ char ar_size[12]; /* file member size - decimal */
+ char ar_nxtmem[12]; /* pointer to next member - decimal */
+ char ar_prvmem[12]; /* pointer to previous member - decimal */
+ char ar_date[12]; /* file member date - decimal */
+ char ar_uid[12]; /* file member user id - decimal */
+ char ar_gid[12]; /* file member group id - decimal */
+ char ar_mode[12]; /* file member mode - octal */
+ char ar_namlen[4]; /* file member name length - decimal */
+ union
+ {
+ char an_name[2]; /* variable length member name */
+ char an_fmag[2]; /* AIAFMAG - string to end header */
+ } _ar_name; /* and variable length name */
+};
+
+#define ar_name _ar_name.an_name
+
+/*
+ * Note: 'ar_namlen' contains the length of the member name which
+ * may be up to 255 chars. The character string containing
+ * the name begins at '_ar_name.ar_name'. The terminating
+ * string AIAFMAG, is only cosmetic. File member contents begin
+ * at the first even byte boundary past 'header position +
+ * sizeof(struct ar_hdr) + ar_namlen', and continue for
+ * 'ar_size' bytes.
+*/
+
+#define AR_HDR struct ar_hdr
+#define AR_HSZ sizeof(AR_HDR)
+
+#endif /* !__powerpc__ && Lynx */
+
+#endif /* _AR_H */
+
diff --git a/hw/xfree86/loader/coff.h b/hw/xfree86/loader/coff.h
new file mode 100644
index 000000000..cebf5e179
--- /dev/null
+++ b/hw/xfree86/loader/coff.h
@@ -0,0 +1,244 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coff.h,v 1.5 1998/07/25 16:56:12 dawes Exp $ */
+
+
+/* This file was implemented from the information in the book
+ Understanding and Using COFF
+ Gintaras R. Gircys
+ O'Reilly, 1988
+ and by looking at the Linux kernel code.
+
+ It is therefore most likely free to use...
+
+ 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 the COFF structures.
+ Only those are included here. If you wish more information about
+ COFF, thein check out the book mentioned above.
+*/
+
+#ifndef _COFF_H
+#define _COFF_H
+
+#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
+/*
+ * Intel 386/486
+ */
+
+/*
+ * FILE HEADER
+ */
+
+typedef struct COFF_filehdr
+{
+ unsigned short f_magic; /* magic number */
+ unsigned short f_nscns; /* number of sections */
+ long f_timdat; /* time & date stamp */
+ long f_symptr; /* file pointer to symtab */
+ long f_nsyms; /* number of symtab entries */
+ unsigned short f_opthdr; /* sizeof(optional hdr) */
+ unsigned short f_flags; /* flags */
+} FILHDR;
+
+#define FILHSZ sizeof(FILHDR)
+
+/*
+ * SECTION HEADER
+ */
+
+typedef struct COFF_scnhdr
+{
+ char s_name[8]; /* section name */
+ long s_paddr; /* physical address */
+ long s_vaddr; /* virtual address */
+ long s_size; /* section size */
+ long s_scnptr; /* raw data for section */
+ long s_relptr; /* relocation */
+ long s_lnnoptr; /* line numbers */
+ unsigned short s_nreloc; /* number of relocation entries */
+ unsigned short s_nlnno; /* number of line number entries*/
+ long s_flags; /* flags */
+} SCNHDR;
+
+#define COFF_SCNHDR struct COFF_scnhdr
+#define COFF_SCNHSZ sizeof(COFF_SCNHDR)
+#define SCNHSZ COFF_SCNHSZ
+
+/*
+ * the optional COFF header as used by Linux COFF
+ */
+
+typedef struct
+{
+ char magic[2]; /* type of file */
+ char vstamp[2]; /* version stamp */
+ char tsize[4]; /* text size in bytes */
+ char dsize[4]; /* initialized data */
+ char bsize[4]; /* uninitialized data */
+ char entry[4]; /* entry point */
+ char text_start[4]; /* base of text */
+ char data_start[4]; /* base of data */
+} AOUTHDR;
+
+
+/*
+ * SYMBOLS
+ */
+
+typedef struct COFF_syment
+{
+ union
+ {
+ char _n_name[E_SYMNMLEN]; /* Symbol name (first 8 chars) */
+ struct
+ {
+ long _n_zeroes; /* Leading zeros */
+ long _n_offset; /* Offset for a header section */
+ } _n_n;
+ char *_n_nptr[2]; /* allows for overlaying */
+ } _n;
+
+ long n_value; /* address of the segment */
+ short n_scnum; /* Section number */
+ unsigned short n_type; /* Type of section */
+ char n_sclass; /* Loader class */
+ char n_numaux; /* Number of aux entries following */
+} SYMENT;
+
+#define n_name _n._n_name
+#define n_nptr _n._n_nptr[1]
+#define n_zeroes _n._n_n._n_zeroes
+#define n_offset _n._n_n._n_offset
+
+#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 aux entry */
+#define SYMNMLEN COFF_E_SYMNMLEN
+#define SYMESZ 18 /* not really sizeof(SYMENT) due to padding */
+
+/* Special section number found in the symbol section */
+#define N_UNDEF 0
+#define N_ABS -1
+#define N_DEBUG -2
+
+/* Symbol storage class values */
+#define C_NULL 0
+#define C_EXT 2
+#define C_FILE 103
+#define C_HIDEXT 107
+
+/*
+ * AUX Entries
+ */
+typedef struct COFF_auxent {
+ long x_scnlen;
+ long x_parmhash;
+ unsigned short x_snhash;
+ unsigned char x_smtyp;
+ unsigned char x_smclas;
+ long x_stab;
+ unsigned short x_snstab;
+} AUXENT;
+
+/* Auxillary Symbol type values */
+#define XTY_ER 0 /* Enternal Reference */
+#define XTY_SD 1 /* csect section definition */
+#define XTY_LD 2 /* Label definition */
+#define XTY_CM 3 /* common csect definition */
+
+/* Auxillary Symbol storage mapping class values */
+#define XMC_PR 0 /* Program code */
+#define XMC_RO 1 /* Read-only constant */
+#define XMC_DB 2 /* Debug dictionary */
+#define XMC_TC 3 /* TOC entry */
+#define XMC_UA 4 /* Unclassified */
+#define XMC_RW 5 /* Read/write data */
+#define XMC_GL 6 /* Global linkage */
+#define XMC_XO 7 /* Extended operation */
+#define XMC_SV 8 /* Supervisor call descriptor */
+#define XMC_BS 9 /* BSS class */
+#define XMC_DS 10 /* Function descriptor csect */
+#define XMC_UC 11 /* Unnamed FORTRAN comon */
+#define XMC_TI 12 /* Reserved */
+#define XMC_TB 13 /* Reserved */
+#define XMC_TC0 15 /* TOC anchor */
+#define XMC_TD 16 /* Scalar data entry in TOC */
+
+/*
+ * RELOCATION DIRECTIVES
+ */
+
+typedef struct COFF_reloc
+{
+ long r_vaddr; /* Virtual address of item */
+ long r_symndx; /* Symbol index in the symtab */
+#if defined(__powerpc__)
+ union
+ {
+ unsigned short _r_type; /* old style coff relocation type */
+ struct
+ {
+ char _r_rsize; /* sign and reloc bit len */
+ char _r_rtype; /* toc relocation type */
+ } _r_r;
+ } _r;
+#define r_otype _r._r_type /* old style reloc - original name */
+#define r_rsize _r._r_r._r_rsize /* extract sign and bit len */
+#define r_type _r._r_r._r_rtype /* extract toc relocation type */
+#else
+ unsigned short r_type; /* Relocation type */
+#endif
+} RELOC;
+
+#define COFF_RELOC struct COFF_reloc
+#define COFF_RELSZ 10
+#define RELSZ COFF_RELSZ
+
+/*
+ * x86 Relocation types
+ */
+#define R_ABS 000
+#define R_DIR32 006
+#define R_PCRLONG 024
+
+#if defined(__powerpc__)
+/*
+ * Power PC
+ */
+#define R_LEN 0x1F /* extract bit-length field */
+#define R_SIGN 0x80 /* extract sign of relocation */
+#define R_FIXUP 0x40 /* extract code-fixup bit */
+
+#define RELOC_RLEN(x) ((x)._r._r_r._r_rsize & R_LEN)
+#define RELOC_RSIGN(x) ((x)._r._r_r._r_rsize & R_SIGN)
+#define RELOC_RFIXUP(x) ((x)._r._r_r._r_rsize & R_FIXUP)
+#define RELOC_RTYPE(x) ((x)._r._r_r._r_rtype)
+
+/*
+ * POWER and PowerPC - relocation types
+ */
+#define R_POS 0x00 /* A(sym) Positive Relocation */
+#define R_NEG 0x01 /* -A(sym) Negative Relocation */
+#define R_REL 0x02 /* A(sym-*) Relative to self */
+#define R_TOC 0x03 /* A(sym-TOC) Relative to TOC */
+#define R_TRL 0x12 /* A(sym-TOC) TOC Relative indirect load. */
+ /* modifiable instruction */
+#define R_TRLA 0x13 /* A(sym-TOC) TOC Rel load address. modifiable inst */
+#define R_GL 0x05 /* A(external TOC of sym) Global Linkage */
+#define R_TCL 0x06 /* A(local TOC of sym) Local object TOC address */
+#define R_RL 0x0C /* A(sym) Pos indirect load. modifiable instruction */
+#define R_RLA 0x0D /* A(sym) Pos Load Address. modifiable instruction */
+#define R_REF 0x0F /* AL0(sym) Non relocating ref. No garbage collect */
+#define R_BA 0x08 /* A(sym) Branch absolute. Cannot modify instruction */
+#define R_RBA 0x18 /* A(sym) Branch absolute. modifiable instruction */
+#define R_RBAC 0x19 /* A(sym) Branch absolute constant. modifiable instr */
+#define R_BR 0x0A /* A(sym-*) Branch rel to self. non modifiable */
+#define R_RBR 0x1A /* A(sym-*) Branch rel to self. modifiable instr */
+#define R_RBRC 0x1B /* A(sym-*) Branch absolute const. */
+ /* modifiable to R_RBR */
+#define R_RTB 0x04 /* A((sym-*)/2) RT IAR Rel Branch. non modifiable */
+#define R_RRTBI 0x14 /* A((sym-*)/2) RT IAR Rel Br. modifiable to R_RRTBA */
+#define R_RRTBA 0x15 /* A((sym-*)/2) RT absolute br. modifiable to R_RRTBI */
+#endif /* __powerpc */
+
+#endif /* _COFF_H */
diff --git a/hw/xfree86/loader/coffloader.c b/hw/xfree86/loader/coffloader.c
new file mode 100644
index 000000000..7a1ef28ad
--- /dev/null
+++ b/hw/xfree86/loader/coffloader.c
@@ -0,0 +1,1358 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.18 2002/09/16 18:06:10 eich Exp $ */
+
+/*
+ *
+ * Copyright 1995,96 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdlib.h>
+#ifdef __QNX__
+#include <fcntl.h>
+#else
+#include <sys/fcntl.h>
+#endif
+#include <sys/stat.h>
+
+#ifdef DBMALLOC
+#include <debug/malloc.h>
+#define Xalloc(size) malloc(size)
+#define Xcalloc(size) calloc(1,(size))
+#define Xfree(size) free(size)
+#endif
+
+#include "Xos.h"
+#include "os.h"
+#include "coff.h"
+
+#include "sym.h"
+#include "loader.h"
+#include "coffloader.h"
+
+#include "compiler.h"
+/*
+#ifndef LDTEST
+#define COFFDEBUG ErrorF
+#endif
+*/
+
+/*
+ * This structure contains all of the information about a module
+ * that has been loaded.
+ */
+
+typedef struct {
+ int handle;
+ long module; /* Id of the module used to find inter module calls */
+ int fd;
+ loader_funcs *funcs;
+ FILHDR *header; /* file header */
+ AOUTHDR *optheader; /* optional file header */
+ unsigned short numsh;
+ SCNHDR *sections; /* Start address of the section table */
+ int secsize; /* size of the section table */
+ unsigned char **saddr;/* Start addresss of the sections table */
+ unsigned char **reladdr;/* Start addresss of the relocation table */
+ unsigned char *strtab; /* Start address of the string table */
+ int strsize; /* size of the string table */
+ unsigned char *text; /* Start address of the .text section */
+ int txtndx; /* index of the .text section */
+ long txtaddr; /* offset of the .text section */
+ int txtsize; /* size of the .text section */
+ int txtrelsize; /* size of the .rel.text section */
+ unsigned char *data; /* Start address of the .data section */
+ int datndx; /* index of the .data section */
+ long dataddr; /* offset of the .data section */
+ int datsize; /* size of the .data section */
+ int datrelsize; /* size of the .rel.data section */
+ unsigned char *bss; /* Start address of the .bss section */
+ int bssndx; /* index of the .bss section */
+ long bssaddr; /* offset of the .bss section */
+ int bsssize; /* size of the .bss section */
+ SYMENT *symtab; /* Start address of the .symtab section */
+ int symndx; /* index of the .symtab section */
+ int symsize; /* size of the .symtab section */
+ unsigned char *common; /* Start address of the .common section */
+ int comsize; /* size of the .common section */
+ long toc; /* Offset of the TOC csect */
+ unsigned char *tocaddr; /* Address of the TOC csect */
+ } COFFModuleRec, *COFFModulePtr;
+
+/*
+ * If any relocation is unable to be satisfied, then put it on a list
+ * to try later after more modules have been loaded.
+ */
+typedef struct _coff_reloc {
+ COFFModulePtr file;
+ RELOC *rel;
+ int secndx;
+ struct _coff_reloc *next;
+} COFFRelocRec;
+
+/*
+ * Symbols with a section number of 0 (N_UNDEF) but a value of non-zero
+ * need to have space allocated for them.
+ *
+ * Gather all of these symbols together, and allocate one chunk when we
+ * are done.
+ */
+
+typedef struct _coff_COMMON {
+ SYMENT *sym;
+ int index;
+ struct _coff_COMMON *next;
+ } COFFCommonRec;
+
+static COFFCommonPtr listCOMMON = NULL;
+
+/* Prototypes for static functions */
+static int COFFhashCleanOut(void *, itemPtr);
+static char *COFFGetSymbolName(COFFModulePtr, int);
+static COFFCommonPtr COFFAddCOMMON(SYMENT *, int);
+static LOOKUP *COFFCreateCOMMON(COFFModulePtr);
+static COFFRelocPtr COFFDelayRelocation(COFFModulePtr, int, RELOC *);
+static SYMENT *COFFGetSymbol(COFFModulePtr, int);
+static unsigned char *COFFGetSymbolValue(COFFModulePtr, int);
+static COFFRelocPtr COFF_RelocateEntry(COFFModulePtr, int, RELOC *);
+static LOOKUP *COFF_GetSymbols(COFFModulePtr);
+static void COFFCollectSections(COFFModulePtr);
+static COFFRelocPtr COFFCollectRelocations(COFFModulePtr);
+
+/*
+ * Utility Functions
+ */
+
+
+static int
+COFFhashCleanOut(voidptr, item)
+void *voidptr;
+itemPtr item ;
+{
+ COFFModulePtr module = (COFFModulePtr) voidptr;
+ return ( module->handle == item->handle ) ;
+}
+
+
+/*
+ * Manage listResolv
+ */
+static COFFRelocPtr
+COFFDelayRelocation(cofffile,secndx,rel)
+COFFModulePtr cofffile;
+int secndx;
+RELOC *rel;
+{
+ COFFRelocPtr reloc;
+
+ if ((reloc = xf86loadermalloc(sizeof(COFFRelocRec))) == NULL) {
+ ErrorF( "COFFDelayRelocation() Unable to allocate memory!!!!\n" );
+ return 0;
+ }
+
+ reloc->file=cofffile;
+ reloc->secndx=secndx;
+ reloc->rel=rel;
+ reloc->next = 0;
+
+ return reloc;
+}
+
+/*
+ * Manage listCOMMON
+ */
+
+static COFFCommonPtr
+COFFAddCOMMON(sym,index)
+SYMENT *sym;
+int index;
+{
+ COFFCommonPtr common;
+
+ if ((common = xf86loadermalloc(sizeof(COFFCommonRec))) == NULL) {
+ ErrorF( "COFFAddCOMMON() Unable to allocate memory!!!!\n" );
+ return 0;
+ }
+ common->sym=sym;
+ common->index=index;
+ common->next=0;
+
+ return common;
+}
+
+static LOOKUP *
+COFFCreateCOMMON(cofffile)
+COFFModulePtr cofffile;
+{
+ int numsyms=0,size=0,l=0;
+ int offset=0;
+ LOOKUP *lookup;
+ COFFCommonPtr common;
+
+ if (listCOMMON == NULL)
+ return NULL;
+
+ common=listCOMMON;
+ for (common = listCOMMON; common; common = common->next) {
+ /* Ensure long word alignment */
+ if( common->sym->n_value != 2
+ && common->sym->n_value != 1) /* But not for short and char ;-)(mr)*/
+ if( common->sym->n_value%4 != 0 )
+ common->sym->n_value+= 4-(common->sym->n_value%4);
+
+ /* accumulate the sizes */
+ size+=common->sym->n_value;
+ numsyms++;
+ }
+
+#ifdef COFFDEBUG
+ COFFDEBUG("COFFCreateCOMMON() %d entries (%d bytes) of COMMON data\n",
+ numsyms, size );
+#endif
+
+ if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) {
+ ErrorF( "COFFCreateCOMMON() Unable to allocate memory!!!!\n" );
+ return NULL;
+ }
+
+ cofffile->comsize=size;
+ if ((cofffile->common = xf86loadercalloc(1,size)) == NULL) {
+ ErrorF( "COFFCreateCOMMON() Unable to allocate memory!!!!\n" );
+ return NULL;
+ }
+
+ /* Traverse the common list and create a lookup table with all the
+ * common symbols. Destroy the common list in the process.
+ * See also ResolveSymbols.
+ */
+ while(listCOMMON) {
+ common=listCOMMON;
+ lookup[l].symName=COFFGetSymbolName(cofffile,common->index);
+ lookup[l].offset=(funcptr)(cofffile->common+offset);
+#ifdef COFFDEBUG
+ COFFDEBUG("Adding %x %s\n", lookup[l].offset, lookup[l].symName );
+#endif
+ listCOMMON=common->next;
+ offset+=common->sym->n_value;
+ xf86loaderfree(common);
+ l++;
+ }
+ /* listCOMMON == NULL */
+
+ lookup[l].symName=NULL; /* Terminate the list */
+ return lookup;
+}
+
+/*
+ * Symbol Table
+ */
+
+/*
+ * Get symbol name
+ */
+static char *
+COFFGetSymbolName(cofffile, index)
+COFFModulePtr cofffile;
+int index;
+{
+ char *name;
+ SYMENT *sym;
+
+ sym=(SYMENT *)(((unsigned char *)cofffile->symtab)+(index*SYMESZ));
+
+#ifdef COFFDEBUG
+ COFFDEBUG("COFFGetSymbolName(%x,%x) %x",cofffile, index, sym->n_zeroes );
+#endif
+
+ name = xf86loadermalloc(sym->n_zeroes ? SYMNMLEN + 1
+ : strlen((const char *)&cofffile->strtab[(int)sym->n_offset-4]) + 1);
+ if (!name)
+ FatalError("COFFGetSymbolName: Out of memory\n");
+
+ if( sym->n_zeroes )
+ {
+ strncpy(name,sym->n_name,SYMNMLEN);
+ name[SYMNMLEN]='\000';
+ }
+ else {
+ strcpy(name, (const char *)&cofffile->strtab[(int)sym->n_offset-4]);
+ }
+#ifdef COFFDEBUG
+ COFFDEBUG(" %s\n", name );
+#endif
+ return name;
+}
+
+static SYMENT *
+COFFGetSymbol(file, index)
+COFFModulePtr file;
+int index;
+{
+ return (SYMENT *)(((unsigned char *)file->symtab)+(index*SYMESZ));
+}
+
+static unsigned char *
+COFFGetSymbolValue(cofffile, index)
+COFFModulePtr cofffile;
+int index;
+{
+ unsigned char *symval=0; /* value of the indicated symbol */
+ itemPtr symbol; /* name/value of symbol */
+ char *symname;
+
+ symname=COFFGetSymbolName(cofffile, index);
+
+#ifdef COFFDEBUG
+ COFFDEBUG("COFFGetSymbolValue() for %s=", symname );
+#endif
+
+ symbol = LoaderHashFind(symname);
+
+ if( symbol )
+ symval=(unsigned char *)symbol->address;
+
+#ifdef COFFDEBUG
+ COFFDEBUG("%x\n", symval );
+#endif
+
+ xf86loaderfree(symname);
+ return symval;
+}
+
+#if defined(__powerpc__)
+/*
+ * This function returns the address of the glink routine for a symbol. This
+ * address is used in cases where the function being called is not in the
+ * same module as the calling function.
+ */
+static unsigned char *
+COFFGetSymbolGlinkValue(cofffile, index)
+COFFModulePtr cofffile;
+int index;
+{
+ unsigned char *symval=0; /* value of the indicated symbol */
+ itemPtr symbol; /* name/value of symbol */
+ char *name;
+
+ name=COFFGetSymbolName(cofffile, index);
+
+#ifdef COFFDEBUG
+ COFFDEBUG("COFFGetSymbolGlinkValue() for %s=", name );
+#endif
+
+ symbol = LoaderHashFind(name+1); /* Eat the '.' so we get the
+ Function descriptor instead */
+
+/* Here we are building up a glink function that will change the TOC
+ * pointer before calling a function that resides in a different module.
+ * The following code is being used to implement this.
+
+ 1 00000000 3d80xxxx lis r12,hi16(funcdesc)
+ 2 00000004 618cxxxx ori r12,r12,lo16(funcdesc)
+ 3 00000008 90410014 st r2,20(r1) # save old TOC pointer
+ 4 0000000c 804c0000 l r2,0(r12) # Get address of functions
+ 5 00000010 7c4903a6 mtctr r2 # load destination address
+ 6 00000014 804c0004 l r2,4(r12) # get TOC of function
+ 7 00000018 4e800420 bctr # branch to it
+
+ */
+ if( symbol ) {
+ symval=(unsigned char *)&symbol->code.glink;
+#ifdef COFFDEBUG
+ COFFDEBUG("%x\n", symval );
+ COFFDEBUG("glink_%s=%x\n", name,symval );
+#endif
+ symbol->code.glink[ 0]=0x3d80; /* lis r12 */
+ symbol->code.glink[ 1]=((unsigned long)symbol->address&0xffff0000)>>16;
+ symbol->code.glink[ 2]=0x618c; /* ori r12 */
+ symbol->code.glink[ 3]=((unsigned long)symbol->address&0x0000ffff);
+ symbol->code.glink[ 4]=0x9041; /* st r2,20(r1) */
+ symbol->code.glink[ 5]=0x0014;
+ symbol->code.glink[ 6]=0x804c; /* l r2,0(r12) */
+ symbol->code.glink[ 7]=0x0000;
+ symbol->code.glink[ 8]=0x7c49; /* mtctr r2 */
+ symbol->code.glink[ 9]=0x03a6;
+ symbol->code.glink[10]=0x804c; /* l r2,4(r12) */
+ symbol->code.glink[11]=0x0004;
+ symbol->code.glink[12]=0x4e80; /* bctr */
+ symbol->code.glink[13]=0x0420;
+ ppc_flush_icache(&symbol->code.glink[0]);
+ ppc_flush_icache(&symbol->code.glink[12]);
+ }
+
+ xf86loaderfree(name);
+ return symval;
+}
+#endif /* __powerpc__ */
+
+/*
+ * Fix all of the relocation for the given section.
+ */
+static COFFRelocPtr
+COFF_RelocateEntry(cofffile, secndx, rel)
+COFFModulePtr cofffile;
+int secndx; /* index of the target section */
+RELOC *rel;
+{
+ SYMENT *symbol; /* value of the indicated symbol */
+ unsigned long *dest32; /* address of the place being modified */
+#if defined(__powerpc__)
+ unsigned short *dest16; /* address of the place being modified */
+ itemPtr symitem; /* symbol structure from has table */
+ char *name;
+#endif
+ unsigned char *symval; /* value of the indicated symbol */
+
+/*
+ * Note: Section numbers are 1 biased, while the cofffile->saddr[] array
+ * of pointer is 0 biased, so alway have to account for the difference.
+ */
+
+/*
+ * Reminder: secndx is the section to which the relocation is applied.
+ * symbol->n_scnum is the section in which the symbol value resides.
+ */
+
+#ifdef COFFDEBUG
+ COFFDEBUG("%x %d %o ",
+ rel->r_vaddr,rel->r_symndx,rel->r_type );
+#if defined(__powerpc__)
+ COFFDEBUG("[%x %x %x] ",
+ RELOC_RSIGN(*rel), RELOC_RFIXUP(*rel), RELOC_RLEN(*rel));
+#endif
+#endif
+ symbol=COFFGetSymbol(cofffile,rel->r_symndx);
+#ifdef COFFDEBUG
+ COFFDEBUG("%d %x %d-%d\n", symbol->n_sclass, symbol->n_value, symbol->n_scnum, secndx );
+#endif
+
+/*
+ * Check to see if the relocation offset is part of the .text segment.
+ * If not, we must change the offset to be relative to the .data section
+ * which is NOT contiguous.
+ */
+ switch(secndx+1) { /* change the bias */
+ case N_TEXT:
+ if( (long)rel->r_vaddr < cofffile->txtaddr ||
+ (long)rel->r_vaddr > (long)(cofffile->txtaddr+cofffile->txtsize) ) {
+ FatalError("Relocation against N_TEXT not in .text section\n");
+ }
+ dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+
+ ((unsigned char *)rel->r_vaddr-cofffile->txtaddr));
+ break;
+ case N_DATA:
+ if( (long)rel->r_vaddr < cofffile->dataddr ||
+ (long)rel->r_vaddr > (long)(cofffile->dataddr+cofffile->datsize) ) {
+ FatalError("Relocation against N_DATA not in .data section\n");
+ }
+ dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+
+ ((unsigned char *)rel->r_vaddr-cofffile->dataddr));
+ break;
+ case N_BSS:
+ if( (long)rel->r_vaddr < cofffile->bssaddr ||
+ (long)rel->r_vaddr > (long)(cofffile->bssaddr+cofffile->bsssize) ) {
+ FatalError("Relocation against N_TEXT not in .bss section\n");
+ }
+ dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+
+ ((unsigned char *)rel->r_vaddr-cofffile->bssaddr));
+ break;
+ default:
+ FatalError("Relocation against unknown section %d\n", secndx );
+ }
+
+ if( symbol->n_sclass == 0 )
+ {
+ symval=(unsigned char *)(symbol->n_value+(*dest32)-symbol->n_type);
+#ifdef COFFDEBUG
+ COFFDEBUG( "symbol->n_sclass==0\n" );
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)symval;
+ return 0;
+ }
+
+ switch( rel->r_type )
+ {
+#if defined(i386)
+ case R_DIR32:
+ symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
+ if( symval ) {
+#ifdef COFFDEBUG
+ char *namestr;
+ COFFDEBUG( "R_DIR32 %s\n",
+ namestr=COFFGetSymbolName(cofffile,rel->r_symndx) );
+ xf86loaderfree(namestr);
+ COFFDEBUG( "txtsize=%x\t", cofffile->txtsize );
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)(symval+(*dest32)-symbol->n_value);
+ } else {
+ switch( symbol->n_scnum ) {
+ case N_UNDEF:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_DIR32 N_UNDEF\n" );
+#endif
+ return COFFDelayRelocation(cofffile,secndx,rel);
+ case N_ABS:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_DIR32 N_ABS\n" );
+#endif
+ return 0;
+ case N_DEBUG:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_DIR32 N_DEBUG\n" );
+#endif
+ return 0;
+ case N_COMMENT:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_DIR32 N_COMMENT\n" );
+#endif
+ return 0;
+ case N_TEXT:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_DIR32 N_TEXT\n" );
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)((*dest32)+
+ (unsigned long)(cofffile->saddr[N_TEXT-1]));
+ break;
+ case N_DATA:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_DIR32 N_DATA\n" );
+ COFFDEBUG( "txtsize=%x\t", cofffile->txtsize );
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)((*dest32)+
+ ((unsigned long)(cofffile->saddr[N_DATA-1]))-
+ cofffile->dataddr);
+ break;
+ case N_BSS:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_DIR32 N_BSS\n" );
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)((*dest32)+
+ (unsigned long)(cofffile->saddr[N_BSS-1])-
+ (cofffile->bssaddr));
+ break;
+ default:
+ ErrorF("R_DIR32 with unexpected section %d\n",
+ symbol->n_scnum );
+ }
+
+ }
+#ifdef COFFDEBUG
+ COFFDEBUG( "*dest32=%8.8x\n", *dest32 );
+#endif
+ break;
+ case R_PCRLONG:
+ if( symbol->n_scnum == N_TEXT )
+ break;
+
+ symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_PCRLONG ");
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ if( symval == 0 ) {
+#ifdef COFFDEBUG
+ char *name;
+ COFFDEBUG( "***Unable to resolve symbol %s\n",
+ name=COFFGetSymbolName(cofffile,rel->r_symndx) );
+ xf86loaderfree(name);
+#endif
+ return COFFDelayRelocation(cofffile,secndx,rel);
+ }
+ *dest32=(unsigned long)(symval-((long)dest32+sizeof(long)));
+
+#ifdef COFFDEBUG
+ COFFDEBUG( "*dest32=%8.8x\n", *dest32 );
+#endif
+ break;
+ case R_ABS:
+ /*
+ * Nothing to really do here.
+ * Usually, a dummy relocation for .file
+ */
+ break;
+#endif /* i386 */
+#if defined(__powerpc__)
+ case R_POS:
+ /*
+ * Positive Relocation
+ */
+ if( RELOC_RLEN(*rel) != 0x1f )
+ FatalError("R_POS with size != 32 bits" );
+ symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
+ if( symval ) {
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_POS ");
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)(symval+(*dest32)-symbol->n_value);
+ ppc_flush_icache(dest32);
+ } else {
+ switch( symbol->n_scnum ) {
+ case N_UNDEF:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_POS N_UNDEF\n" );
+#endif
+ return COFFDelayRelocation(cofffile,secndx,rel);
+ case N_ABS:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_POS N_ABS\n" );
+#endif
+ return 0;
+ case N_DEBUG:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_POS N_DEBUG\n" );
+#endif
+ return 0;
+ case N_COMMENT:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_POS N_COMMENT\n" );
+#endif
+ return 0;
+ case N_TEXT:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_POS N_TEXT\n" );
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)((*dest32)+
+ ((unsigned long)(cofffile->saddr[N_TEXT-1]))-
+ cofffile->txtaddr);
+ ppc_flush_icache(dest32);
+ break;
+ case N_DATA:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_POS N_DATA\n" );
+ COFFDEBUG( "txtsize=%x\t", cofffile->txtsize );
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)((*dest32)+
+ ((unsigned long)(cofffile->saddr[N_DATA-1]))-
+ cofffile->dataddr);
+ ppc_flush_icache(dest32);
+ break;
+ case N_BSS:
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_POS N_BSS\n" );
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ *dest32=(unsigned long)((*dest32)+
+ (unsigned long)(cofffile->saddr[N_BSS-1])-
+ (cofffile->bssaddr));
+ ppc_flush_icache(dest32);
+ break;
+ default:
+ ErrorF("R_POS with unexpected section %d\n",
+ symbol->n_scnum );
+ }
+ }
+#ifdef COFFDEBUG
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+ COFFDEBUG( "\n" );
+#endif
+ break;
+ case R_TOC:
+ /*
+ * Relative to TOC
+ */
+ {
+ dest16=(unsigned short *)dest32;
+ if( RELOC_RLEN(*rel) != 0x0f )
+ FatalError("R_TOC with size != 16 bits" );
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_TOC ");
+ COFFDEBUG( "dest16=%x\t", dest16 );
+ COFFDEBUG( "symbol=%x\t", symbol );
+ COFFDEBUG( "symbol->n_value=%x\t", symbol->n_value );
+ COFFDEBUG( "cofffile->toc=%x\t", cofffile->toc );
+ COFFDEBUG( "*dest16=%8.8x\t", *dest16 );
+#endif
+ *dest16=(unsigned long)((symbol->n_value-cofffile->toc));
+ ppc_flush_icache(dest16);
+ }
+#ifdef COFFDEBUG
+ COFFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ COFFDEBUG( "\n" );
+#endif
+ break;
+ case R_BR:
+ /*
+ * Branch relative to self, non-modifiable
+ */
+
+ if( RELOC_RLEN(*rel) != 0x19 )
+ FatalError("R_BR with size != 24 bits" );
+ name = COFFGetSymbolName(cofffile, rel->r_symndx);
+ symitem = LoaderHashFind(name);
+ if( symitem == 0 ) {
+ name++;
+ symitem = LoaderHashFind(name);
+ }
+ if( symitem && cofffile->module != symitem->module ) {
+#ifdef COFFDEBUG
+ COFFDEBUG("Symbol module %d != file module %d\n",
+ symitem->module, cofffile->module );
+#endif
+ symval=COFFGetSymbolGlinkValue(cofffile, rel->r_symndx);
+ }
+ else
+ symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
+ if( symval == 0 ) {
+#ifdef COFFDEBUG
+ char *name;
+ COFFDEBUG( "***Unable to resolve symbol %s\n",
+ name=COFFGetSymbolName(cofffile,rel->r_symndx) );
+ xf86loaderfree(name);
+#endif
+ return COFFDelayRelocation(cofffile,secndx,rel);
+ }
+#ifdef COFFDEBUG
+ COFFDEBUG( "R_BR ");
+ COFFDEBUG( "dest32=%x\t", dest32 );
+ COFFDEBUG( "symval=%x\t", symval );
+ COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+#endif
+ {
+ unsigned long val;
+ val=((unsigned long)symval-(unsigned long)dest32);
+#ifdef COFFDEBUG
+ COFFDEBUG( "val=%8.8x\n", val );
+#endif
+ val = val>>2;
+ if( (val & 0x3f000000) != 0x3f000000 &&
+ (val & 0x3f000000) != 0x00000000 ) {
+ FatalError( "R_BR offset %x too large\n", val<<2 );
+ break;
+ }
+ val &= 0x00ffffff;
+#ifdef COFFDEBUG
+ COFFDEBUG( "val=%8.8x\n", val );
+#endif
+ /*
+ * The address part contains the offset to the beginning
+ * of the .text section. Disreguard this since we have
+ * calculated the correct offset already.
+ */
+ (*dest32)=((*dest32)&0xfc000003)|(val<<2);
+#ifdef COFFDEBUG
+ COFFDEBUG( "*dest32=%8.8x\n", *dest32 );
+#endif
+ if( cofffile->module != symitem->module ) {
+ (*++dest32)=0x80410014; /* lwz r2,20(r1) */
+ }
+ ppc_flush_icache(--dest32);
+ }
+
+ break;
+#endif /* __powerpc__ */
+ default:
+ ErrorF(
+ "COFF_RelocateEntry() Unsupported relocation type %o\n",
+ rel->r_type );
+ break;
+ }
+ return 0;
+}
+
+static COFFRelocPtr
+COFFCollectRelocations(cofffile)
+COFFModulePtr cofffile;
+{
+ unsigned short i,j;
+ RELOC *rel;
+ SCNHDR *sec;
+ COFFRelocPtr reloc_head = NULL;
+ COFFRelocPtr tmp;
+
+ for(i=0; i<cofffile->numsh; i++ ) {
+ if( cofffile->saddr[i] == NULL )
+ continue; /* Section not loaded!! */
+ sec=&(cofffile->sections[i]);
+ for(j=0;j<sec->s_nreloc;j++) {
+ rel=(RELOC *)(cofffile->reladdr[i]+(j*RELSZ));
+ tmp = COFFDelayRelocation(cofffile,i,rel);
+ tmp->next = reloc_head;
+ reloc_head = tmp;
+ }
+ }
+
+ return reloc_head;
+}
+
+/*
+ * COFF_GetSymbols()
+ *
+ * add the symbols to the symbol table maintained by the loader.
+ */
+
+static LOOKUP *
+COFF_GetSymbols(cofffile)
+COFFModulePtr cofffile;
+{
+ SYMENT *sym;
+ AUXENT *aux=NULL;
+ int i, l, numsyms;
+ LOOKUP *lookup, *lookup_common, *p;
+ char *symname;
+
+/*
+ * Load the symbols into memory
+ */
+ numsyms=cofffile->header->f_nsyms;
+
+#ifdef COFFDEBUG
+ COFFDEBUG("COFF_GetSymbols(): %d symbols\n", numsyms );
+#endif
+
+ cofffile->symsize=(numsyms*SYMESZ);
+ cofffile->symtab=(SYMENT *)_LoaderFileToMem(cofffile->fd,cofffile->header->f_symptr,
+ (numsyms*SYMESZ),"symbols");
+
+ if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL)
+ return NULL;
+
+ for(i=0,l=0; i<numsyms; i++)
+ {
+ sym=(SYMENT *)(((unsigned char *)cofffile->symtab)+(i*SYMESZ));
+ symname=COFFGetSymbolName(cofffile,i);
+ if( sym->n_numaux > 0 )
+ aux=(AUXENT *)(((unsigned char *)cofffile->symtab)+((i+1)*SYMESZ));
+ else
+ aux=NULL;
+#ifdef COFFDEBUG
+ COFFDEBUG("\t%d %d %x %x %d %d %s\n",
+ i, sym->n_scnum, sym->n_value, sym->n_type,
+ sym->n_sclass, sym->n_numaux, symname );
+ if( aux )
+ COFFDEBUG("aux=\t%d %x %x %x %x %x %x\n",
+ aux->x_scnlen, aux->x_parmhash, aux->x_snhash,
+ aux->x_smtyp, aux->x_smclas, aux->x_stab,
+ aux->x_snstab );
+#endif
+ i+=sym->n_numaux;
+ /*
+ * check for TOC csect before discarding C_HIDEXT below
+ */
+ if( aux && aux->x_smclas == XMC_TC0 ) {
+ if( sym->n_scnum != N_DATA )
+ FatalError("TOC not in N_DATA section");
+ cofffile->toc=sym->n_value;
+ cofffile->tocaddr=(cofffile->saddr[sym->n_scnum-1]+
+ sym->n_value-(cofffile->dataddr));
+#ifdef COFFDEBUG
+ COFFDEBUG("TOC=%x\n", cofffile->toc );
+ COFFDEBUG("TOCaddr=%x\n", cofffile->tocaddr );
+#endif
+ continue;
+ }
+ if( sym->n_sclass == C_HIDEXT ) {
+/*
+ && aux && !(aux->x_smclas == XMC_DS
+ && aux->x_smtyp == XTY_SD) ) ) {
+*/
+#ifdef COFFDEBUG
+ COFFDEBUG("Skipping C_HIDEXT class symbol %s\n", symname );
+#endif
+ continue;
+ }
+ switch( sym->n_scnum )
+ {
+ case N_UNDEF:
+ if( sym->n_value != 0 ) {
+ char *name;
+ COFFCommonPtr tmp;
+
+ name = COFFGetSymbolName(cofffile,i);
+#ifdef COFFDEBUG
+ COFFDEBUG("Adding COMMON space for %s\n", name);
+#endif
+ if(!LoaderHashFind(name)) {
+ tmp = COFFAddCOMMON(sym,i);
+ if (tmp) {
+ tmp->next = listCOMMON;
+ listCOMMON = tmp;
+ }
+ }
+ xf86loaderfree(name);
+ }
+ xf86loaderfree(symname);
+ break;
+ case N_ABS:
+ case N_DEBUG:
+ case N_COMMENT:
+#ifdef COFFDEBUG
+ COFFDEBUG("Freeing %s, section %d\n",
+ symname, sym->n_scnum );
+#endif
+ xf86loaderfree(symname);
+ break;
+ case N_TEXT:
+ if( (sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT)
+ && cofffile->saddr[sym->n_scnum-1]) {
+ lookup[l].symName=symname;
+ lookup[l].offset=(funcptr)
+ (cofffile->saddr[sym->n_scnum-1]+
+ sym->n_value-cofffile->txtaddr);
+#ifdef COFFDEBUG
+ COFFDEBUG("Adding %x %s\n",
+ lookup[l].offset, lookup[l].symName );
+#endif
+ l++;
+ }
+ else {
+#ifdef COFFDEBUG
+ COFFDEBUG( "TEXT Section not loaded %d\n",
+ sym->n_scnum-1 );
+#endif
+ xf86loaderfree(symname);
+ }
+ break;
+ case N_DATA:
+ /*
+ * Note: COFF expects .data to be contiguous with
+ * .data, so that offsets for .data are relative to
+ * .text. We need to adjust for this, and make them
+ * relative to .data so that the relocation can be
+ * properly applied. This is needed becasue we allocate
+ * .data seperately from .text.
+ */
+ if( (sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT)
+ && cofffile->saddr[sym->n_scnum-1]) {
+ lookup[l].symName=symname;
+ lookup[l].offset=(funcptr)
+ (cofffile->saddr[sym->n_scnum-1]+
+ sym->n_value-cofffile->dataddr);
+#ifdef COFFDEBUG
+ COFFDEBUG("Adding %x %s\n",
+ lookup[l].offset, lookup[l].symName );
+#endif
+ l++;
+ }
+ else {
+#ifdef COFFDEBUG
+ COFFDEBUG( "DATA Section not loaded %d\n",
+ sym->n_scnum-1 );
+#endif
+ xf86loaderfree(symname);
+ }
+ break;
+ case N_BSS:
+ /*
+ * Note: COFF expects .bss to be contiguous with
+ * .data, so that offsets for .bss are relative to
+ * .text. We need to adjust for this, and make them
+ * relative to .bss so that the relocation can be
+ * properly applied. This is needed becasue we allocate
+ * .bss seperately from .text and .data.
+ */
+ if( (sym->n_sclass == C_EXT || sym->n_sclass == C_HIDEXT)
+ && cofffile->saddr[sym->n_scnum-1]) {
+ lookup[l].symName=symname;
+ lookup[l].offset=(funcptr)
+ (cofffile->saddr[sym->n_scnum-1]+
+ sym->n_value-cofffile->bssaddr);
+#ifdef COFFDEBUG
+ COFFDEBUG("Adding %x %s\n",
+ lookup[l].offset, lookup[l].symName );
+#endif
+ l++;
+ }
+ else {
+#ifdef COFFDEBUG
+ COFFDEBUG( "BSS Section not loaded %d\n",
+ sym->n_scnum-1 );
+#endif
+ xf86loaderfree(symname);
+ }
+ break;
+ default:
+ ErrorF("Unknown Section number %d\n", sym->n_scnum );
+ xf86loaderfree(symname);
+ break;
+ }
+ }
+
+ lookup[l].symName=NULL; /* Terminate the list */
+
+ lookup_common = COFFCreateCOMMON(cofffile);
+ if (lookup_common) {
+ for (i = 0, p = lookup_common; p->symName; i++, p++)
+ ;
+ memcpy(&(lookup[l]), lookup_common, i * sizeof (LOOKUP));
+
+ xf86loaderfree(lookup_common);
+ l += i;
+ lookup[l].symName = NULL;
+ }
+
+/*
+ * remove the COFF symbols that will show up in every module
+ */
+ for (i = 0, p = lookup; p->symName; i++, p++) {
+ while (p->symName && (!strcmp(lookup[i].symName, ".text")
+ || !strcmp(lookup[i].symName, ".data")
+ || !strcmp(lookup[i].symName, ".bss")
+ )) {
+ memmove(&(lookup[i]), &(lookup[i+1]), (l-- - i) * sizeof (LOOKUP));
+ }
+ }
+
+ return lookup;
+}
+
+#define SecOffset(index) cofffile->sections[index].s_scnptr
+#define SecSize(index) cofffile->sections[index].s_size
+#define SecAddr(index) cofffile->sections[index].s_paddr
+#define RelOffset(index) cofffile->sections[index].s_relptr
+#define RelSize(index) (cofffile->sections[index].s_nreloc*RELSZ)
+
+/*
+ * COFFCollectSections
+ *
+ * Do the work required to load each section into memory.
+ */
+static void
+COFFCollectSections(cofffile)
+COFFModulePtr cofffile;
+{
+ unsigned short i;
+
+/*
+ * Find and identify all of the Sections
+ */
+
+#ifdef COFFDEBUG
+ COFFDEBUG("COFFCollectSections(): %d sections\n", cofffile->numsh );
+#endif
+
+ for( i=0; i<cofffile->numsh; i++) {
+#ifdef COFFDEBUG
+ COFFDEBUG("%d %s\n", i, cofffile->sections[i].s_name );
+#endif
+ /* .text */
+ if( strcmp(cofffile->sections[i].s_name,
+ ".text" ) == 0 ) {
+ cofffile->text=_LoaderFileToMem(cofffile->fd,
+ SecOffset(i),SecSize(i),".text");
+ cofffile->saddr[i]=cofffile->text;
+ cofffile->txtndx=i;
+ cofffile->txtaddr=SecAddr(i);
+ cofffile->txtsize=SecSize(i);
+ cofffile->txtrelsize=RelSize(i);
+ cofffile->reladdr[i]=_LoaderFileToMem(cofffile->fd,
+ RelOffset(i), RelSize(i),".rel.text");
+#ifdef COFFDEBUG
+ COFFDEBUG(".text starts at %x (%x bytes)\n", cofffile->text, cofffile->txtsize );
+#endif
+ continue;
+ }
+ /* .data */
+ if( strcmp(cofffile->sections[i].s_name,
+ ".data" ) == 0 ) {
+ cofffile->data=_LoaderFileToMem(cofffile->fd,
+ SecOffset(i),SecSize(i),".data");
+ cofffile->saddr[i]=cofffile->data;
+ cofffile->datndx=i;
+ cofffile->dataddr=SecAddr(i);
+ cofffile->datsize=SecSize(i);
+ cofffile->datrelsize=RelSize(i);
+ cofffile->reladdr[i]=_LoaderFileToMem(cofffile->fd,
+ RelOffset(i), RelSize(i),".rel.data");
+#ifdef COFFDEBUG
+ COFFDEBUG(".data starts at %x (%x bytes)\n", cofffile->data, cofffile->datsize );
+#endif
+ continue;
+ }
+ /* .bss */
+ if( strcmp(cofffile->sections[i].s_name,
+ ".bss" ) == 0 ) {
+ if( SecSize(i) )
+ cofffile->bss=xf86loadercalloc(1,SecSize(i));
+ else
+ cofffile->bss=NULL;
+ cofffile->saddr[i]=cofffile->bss;
+ cofffile->bssndx=i;
+ cofffile->bssaddr=SecAddr(i);
+ cofffile->bsssize=SecSize(i);
+#ifdef COFFDEBUG
+ COFFDEBUG(".bss starts at %x (%x bytes)\n", cofffile->bss, cofffile->bsssize );
+#endif
+ continue;
+ }
+ /* .comment */
+ if( strncmp(cofffile->sections[i].s_name,
+ ".comment",strlen(".comment") ) == 0 ) {
+ continue;
+ }
+ /* .stab */
+ if( strcmp(cofffile->sections[i].s_name,
+ ".stab" ) == 0 ) {
+ continue;
+ }
+ /* .stabstr */
+ if( strcmp(cofffile->sections[i].s_name,
+ ".stabstr" ) == 0 ) {
+ continue;
+ }
+ /* .stab.* */
+ if( strncmp(cofffile->sections[i].s_name,
+ ".stab.", strlen(".stab.") ) == 0 ) {
+ continue;
+ }
+ ErrorF("COFF: Not loading %s\n", cofffile->sections[i].s_name );
+ }
+}
+
+/*
+ * Public API for the COFF implementation of the loader.
+ */
+void *
+COFFLoadModule(modrec, cofffd, ppLookup)
+loaderPtr modrec;
+int cofffd;
+LOOKUP **ppLookup;
+{
+ COFFModulePtr cofffile;
+ FILHDR *header;
+ int stroffset; /* offset of string table */
+ COFFRelocPtr coff_reloc, tail;
+ void *v;
+
+#ifdef COFFDEBUG
+ COFFDEBUG("COFFLoadModule(%s,%x,%x)\n",modrec->name,modrec->handle,cofffd);
+#endif
+
+ if ((cofffile = xf86loadercalloc(1,sizeof(COFFModuleRec))) == NULL) {
+ ErrorF( "Unable to allocate COFFModuleRec\n" );
+ return NULL;
+ }
+
+ cofffile->handle=modrec->handle;
+ cofffile->module=modrec->module;
+ cofffile->fd=cofffd;
+ v=cofffile->funcs=modrec->funcs;
+
+/*
+ * Get the COFF header
+ */
+ cofffile->header=(FILHDR *)_LoaderFileToMem(cofffd,0,sizeof(FILHDR),"header");
+ header=(FILHDR *)cofffile->header;
+
+ if( header->f_symptr == 0 || header->f_nsyms == 0 ) {
+ ErrorF("No symbols found in module\n");
+ _LoaderFreeFileMem(header,sizeof(FILHDR));
+ xf86loaderfree(cofffile);
+ return NULL;
+ }
+/*
+ * Get the section table
+ */
+ cofffile->numsh=header->f_nscns;
+ cofffile->secsize=(header->f_nscns*SCNHSZ);
+ cofffile->sections=(SCNHDR *)_LoaderFileToMem(cofffd,FILHSZ+header->f_opthdr,
+ cofffile->secsize, "sections");
+ cofffile->saddr=xf86loadercalloc(cofffile->numsh, sizeof(unsigned char *));
+ cofffile->reladdr=xf86loadercalloc(cofffile->numsh, sizeof(unsigned char *));
+
+/*
+ * Load the optional header if we need it ?????
+ */
+
+/*
+ * Load the rest of the desired sections
+ */
+ COFFCollectSections(cofffile);
+
+/*
+ * load the string table (must be done before we process symbols).
+ */
+ stroffset=header->f_symptr+(header->f_nsyms*SYMESZ);
+
+ _LoaderFileRead(cofffd,stroffset,&(cofffile->strsize),sizeof(int));
+
+ stroffset+=4; /* Move past the size */
+ cofffile->strsize-=sizeof(int); /* size includes itself, so reduce by 4 */
+ cofffile->strtab=_LoaderFileToMem(cofffd,stroffset,cofffile->strsize,"strings");
+
+/*
+ * add symbols
+ */
+ *ppLookup = COFF_GetSymbols(cofffile);
+
+/*
+ * Do relocations
+ */
+ coff_reloc = COFFCollectRelocations(cofffile);
+ if (coff_reloc) {
+ for (tail = coff_reloc; tail->next; tail = tail->next)
+ ;
+ tail->next = _LoaderGetRelocations(v)->coff_reloc;
+ _LoaderGetRelocations(v)->coff_reloc = coff_reloc;
+ }
+
+ return (void *)cofffile;
+}
+
+void
+COFFResolveSymbols(mod)
+void *mod;
+{
+ COFFRelocPtr newlist, p, tmp;
+
+ /* Try to relocate everything. Build a new list containing entries
+ * which we failed to relocate. Destroy the old list in the process.
+ */
+ newlist = 0;
+ for (p = _LoaderGetRelocations(mod)->coff_reloc; p; ) {
+ tmp = COFF_RelocateEntry(p->file, p->secndx, p->rel);
+ if (tmp) {
+ /* Failed to relocate. Keep it in the list. */
+ tmp->next = newlist;
+ newlist = tmp;
+ }
+ tmp = p;
+ p = p->next;
+ xf86loaderfree(tmp);
+ }
+ _LoaderGetRelocations(mod)->coff_reloc = newlist;
+}
+
+int
+COFFCheckForUnresolved( mod)
+void *mod;
+{
+ char *name;
+ COFFRelocPtr crel;
+ int flag, fatalsym = 0;
+
+ if ((crel = _LoaderGetRelocations(mod)->coff_reloc) == NULL)
+ return 0;
+
+ while( crel )
+ {
+ name = COFFGetSymbolName(crel->file, crel->rel->r_symndx);
+ flag = _LoaderHandleUnresolved(name,
+ _LoaderHandleToName(crel->file->handle));
+ if (flag) fatalsym = 1;
+ xf86loaderfree(name);
+ crel=crel->next;
+ }
+ return fatalsym;
+}
+
+void
+COFFUnloadModule(modptr)
+void *modptr;
+{
+ COFFModulePtr cofffile = (COFFModulePtr)modptr;
+ COFFRelocPtr relptr, reltptr, *brelptr;
+
+/*
+ * Delete any unresolved relocations
+ */
+
+ relptr=_LoaderGetRelocations(cofffile->funcs)->coff_reloc;
+ brelptr=&(_LoaderGetRelocations(cofffile->funcs)->coff_reloc);
+
+ while(relptr) {
+ if( relptr->file == cofffile ) {
+ *brelptr=relptr->next; /* take it out of the list */
+ reltptr=relptr; /* save pointer to this node */
+ relptr=relptr->next; /* advance the pointer */
+ xf86loaderfree(reltptr); /* free the node */
+ }
+ else {
+ brelptr=&(relptr->next);
+ relptr=relptr->next; /* advance the pointer */
+ }
+ }
+
+/*
+ * Delete any symbols in the symbols table.
+ */
+
+ LoaderHashTraverse((void *)cofffile, COFFhashCleanOut);
+
+/*
+ * Free the sections that were allocated.
+ */
+#define CheckandFree(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size))
+
+ CheckandFree(cofffile->strtab,cofffile->strsize);
+ CheckandFree(cofffile->symtab,cofffile->symsize);
+ CheckandFree(cofffile->text,cofffile->txtsize);
+ CheckandFree(cofffile->reladdr[cofffile->txtndx],cofffile->txtrelsize);
+ CheckandFree(cofffile->data,cofffile->datsize);
+ CheckandFree(cofffile->reladdr[cofffile->datndx],cofffile->datrelsize);
+ CheckandFree(cofffile->bss,cofffile->bsssize);
+ if( cofffile->common )
+ xf86loaderfree(cofffile->common);
+/*
+ * Free the section table, and section pointer array
+ */
+ _LoaderFreeFileMem(cofffile->sections,cofffile->secsize);
+ xf86loaderfree(cofffile->saddr);
+ xf86loaderfree(cofffile->reladdr);
+ _LoaderFreeFileMem(cofffile->header,sizeof(FILHDR));
+/*
+ * Free the COFFModuleRec
+ */
+ xf86loaderfree(cofffile);
+
+ return;
+}
+
+char *
+COFFAddressToSection(void *modptr, unsigned long address)
+{
+ COFFModulePtr cofffile = (COFFModulePtr)modptr;
+ int i;
+
+ for( i=1; i<cofffile->numsh; i++) {
+ if( address >= (unsigned long)cofffile->saddr[i] &&
+ address <= (unsigned long)cofffile->saddr[i]+SecSize(i) ) {
+ return cofffile->sections[i].s_name;
+ }
+ }
+return NULL;
+}
diff --git a/hw/xfree86/loader/coffloader.h b/hw/xfree86/loader/coffloader.h
new file mode 100644
index 000000000..35ce4b2c5
--- /dev/null
+++ b/hw/xfree86/loader/coffloader.h
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright 1997,1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.h,v 1.3 1998/09/20 14:41:04 dawes Exp $ */
+
+#ifndef _COFFLOADER_H
+#define _COFFLOADER_H
+/* coffloader.c */
+extern void *COFFLoadModule(loaderPtr, int, LOOKUP **);
+extern void COFFResolveSymbols(void *);
+extern int COFFCheckForUnresolved(void *);
+extern char *COFFAddressToSection(void *,unsigned long);
+extern void COFFUnloadModule(void *);
+#endif /* _COFFLOADER_H */
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
new file mode 100644
index 000000000..3c1d5b883
--- /dev/null
+++ b/hw/xfree86/loader/dixsym.c
@@ -0,0 +1,367 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dixsym.c,v 1.53 2003/01/26 16:40:42 eich Exp $ */
+
+
+/*
+ *
+ * Copyright 1995-1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+#undef DBMALLOC
+#include "sym.h"
+#include "colormap.h"
+#include "cursor.h"
+#include "dix.h"
+#include "dixevents.h"
+#include "dixfont.h"
+#include "dixstruct.h"
+#include "misc.h"
+#include "globals.h"
+#include "os.h"
+#include "osdep.h"
+#include "resource.h"
+#include "servermd.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "extension.h"
+#define EXTENSION_PROC_ARGS void *
+#include "extnsionst.h"
+#include "swaprep.h"
+#include "swapreq.h"
+#include "inputstr.h"
+#include "XIproto.h"
+#include "exevents.h"
+#include "extinit.h"
+#ifdef XV
+#include "xvmodproc.h"
+#endif
+#include "dgaproc.h"
+#ifdef RENDER
+#include "mipict.h"
+#endif
+#include "selection.h"
+#ifdef XKB
+#include <X11/extensions/XKBsrv.h>
+#endif
+
+extern Selection *CurrentSelections;
+extern int NumCurrentSelections;
+
+/* DIX things */
+
+LOOKUP dixLookupTab[] = {
+
+ /* dix */
+ /* atom.c */
+ SYMFUNC(MakeAtom)
+ SYMFUNC(ValidAtom)
+ /* colormap.c */
+ SYMFUNC(AllocColor)
+ SYMFUNC(CreateColormap)
+ SYMFUNC(FakeAllocColor)
+ SYMFUNC(FakeFreeColor)
+ SYMFUNC(FreeColors)
+ SYMFUNC(StoreColors)
+ SYMFUNC(TellLostMap)
+ SYMFUNC(TellGainedMap)
+ SYMFUNC(QueryColors)
+ /* cursor.c */
+ SYMFUNC(FreeCursor)
+ /* devices.c */
+ SYMFUNC(Ones)
+ SYMFUNC(InitButtonClassDeviceStruct)
+ SYMFUNC(InitFocusClassDeviceStruct)
+ SYMFUNC(InitLedFeedbackClassDeviceStruct)
+ SYMFUNC(InitPtrFeedbackClassDeviceStruct)
+ SYMFUNC(InitValuatorClassDeviceStruct)
+ SYMFUNC(InitKeyClassDeviceStruct)
+ SYMFUNC(InitKeyboardDeviceStruct)
+ SYMFUNC(SendMappingNotify)
+ /* dispatch.c */
+ SYMFUNC(SetInputCheck)
+ SYMFUNC(SendErrorToClient)
+ SYMFUNC(UpdateCurrentTime)
+ SYMFUNC(UpdateCurrentTimeIf)
+ SYMFUNC(ProcBadRequest)
+ SYMVAR(dispatchException)
+ SYMVAR(isItTimeToYield)
+ SYMVAR(ClientStateCallback)
+ SYMVAR(ServerGrabCallback)
+ SYMVAR(CurrentSelections)
+ SYMVAR(NumCurrentSelections)
+ /* dixfonts.c */
+ SYMFUNC(CloseFont)
+ SYMFUNC(FontToXError)
+ SYMFUNC(LoadGlyphs)
+ SYMVAR(fpe_functions)
+ /* dixutils.c */
+ SYMFUNC(AddCallback)
+ SYMFUNC(ClientSleep)
+ SYMFUNC(ClientTimeToServerTime)
+ SYMFUNC(ClientWakeup)
+ SYMFUNC(CompareTimeStamps)
+ SYMFUNC(CopyISOLatin1Lowered)
+ SYMFUNC(DeleteCallback)
+ SYMFUNC(LookupClient)
+ SYMFUNC(LookupDrawable)
+ SYMFUNC(LookupWindow)
+ SYMFUNC(NoopDDA)
+ SYMFUNC(QueueWorkProc)
+ SYMFUNC(RegisterBlockAndWakeupHandlers)
+ SYMFUNC(RemoveBlockAndWakeupHandlers)
+#ifdef XCSECURITY
+ SYMFUNC(SecurityLookupDrawable)
+ SYMFUNC(SecurityLookupWindow)
+#endif
+ /* events.c */
+ SYMFUNC(CheckCursorConfinement)
+ SYMFUNC(DeliverEvents)
+ SYMFUNC(NewCurrentScreen)
+ SYMFUNC(PointerConfinedToScreen)
+ SYMFUNC(TryClientEvents)
+ SYMFUNC(WriteEventsToClient)
+ SYMVAR(DeviceEventCallback)
+ SYMVAR(EventCallback)
+ SYMVAR(inputInfo)
+ SYMVAR(SetCriticalEvent)
+#ifdef PANORAMIX
+ SYMVAR(XineramaGetCursorScreen)
+#endif
+ /* property.c */
+ SYMFUNC(ChangeWindowProperty)
+ /* extension.c */
+ SYMFUNC(AddExtension)
+ SYMFUNC(AddExtensionAlias)
+ SYMFUNC(CheckExtension)
+ SYMFUNC(DeclareExtensionSecurity)
+ SYMFUNC(MinorOpcodeOfRequest)
+ SYMFUNC(StandardMinorOpcode)
+ /* gc.c */
+ SYMFUNC(CopyGC)
+ SYMFUNC(CreateGC)
+ SYMFUNC(CreateScratchGC)
+ SYMFUNC(ChangeGC)
+ SYMFUNC(dixChangeGC)
+ SYMFUNC(DoChangeGC)
+ SYMFUNC(FreeGC)
+ SYMFUNC(FreeScratchGC)
+ SYMFUNC(GetScratchGC)
+ SYMFUNC(SetClipRects)
+ SYMFUNC(ValidateGC)
+ SYMFUNC(VerifyRectOrder)
+ SYMFUNC(SetDashes)
+ /* globals.c */
+ SYMVAR(DPMSEnabled)
+ SYMVAR(DPMSCapableFlag)
+ SYMVAR(DPMSOffTime)
+ SYMVAR(DPMSPowerLevel)
+ SYMVAR(DPMSStandbyTime)
+ SYMVAR(DPMSSuspendTime)
+ SYMVAR(DPMSEnabledSwitch)
+ SYMVAR(DPMSDisabledSwitch)
+ SYMVAR(defaultDPMSEnabled)
+#ifdef XV
+ /* XXX These are exported from the DDX, not DIX. */
+ SYMVAR(XvScreenInitProc)
+ SYMVAR(XvGetScreenIndexProc)
+ SYMVAR(XvGetRTPortProc)
+ SYMVAR(XvMCScreenInitProc)
+#endif
+ SYMVAR(ScreenSaverBlanking)
+ SYMVAR(WindowTable)
+ SYMVAR(clients)
+ SYMVAR(currentMaxClients)
+ SYMVAR(currentTime)
+ SYMVAR(defaultColorVisualClass)
+ SYMVAR(globalSerialNumber)
+ SYMVAR(lastDeviceEventTime)
+ SYMVAR(monitorResolution)
+ SYMVAR(permitOldBugs)
+ SYMVAR(screenInfo)
+ SYMVAR(serverClient)
+ SYMVAR(serverGeneration)
+ /* main.c */
+ SYMFUNC(NotImplemented)
+ /* pixmap.c */
+ SYMFUNC(AllocatePixmap)
+ SYMFUNC(GetScratchPixmapHeader)
+ SYMFUNC(FreeScratchPixmapHeader)
+ SYMVAR(PixmapWidthPaddingInfo)
+ /* privates.c */
+ SYMFUNC(AllocateClientPrivate)
+ SYMFUNC(AllocateClientPrivateIndex)
+ SYMFUNC(AllocateGCPrivate)
+ SYMFUNC(AllocateGCPrivateIndex)
+ SYMFUNC(AllocateWindowPrivate)
+ SYMFUNC(AllocateWindowPrivateIndex)
+ SYMFUNC(AllocateScreenPrivateIndex)
+ SYMFUNC(AllocateColormapPrivateIndex)
+ /* resource.c */
+ SYMFUNC(AddResource)
+ SYMFUNC(ChangeResourceValue)
+ SYMFUNC(CreateNewResourceClass)
+ SYMFUNC(CreateNewResourceType)
+ SYMFUNC(FakeClientID)
+ SYMFUNC(FreeResource)
+ SYMFUNC(FreeResourceByType)
+ SYMFUNC(GetXIDList)
+ SYMFUNC(GetXIDRange)
+ SYMFUNC(LookupIDByType)
+ SYMFUNC(LookupIDByClass)
+ SYMFUNC(LegalNewID)
+#ifdef XCSECURITY
+ SYMFUNC(SecurityLookupIDByClass)
+ SYMFUNC(SecurityLookupIDByType)
+#endif
+ SYMFUNC(FindClientResourcesByType)
+ SYMFUNC(FindAllClientResources)
+ SYMVAR(lastResourceType)
+ SYMVAR(TypeMask)
+#ifdef RES
+ SYMFUNC(RegisterResourceName)
+ SYMVAR(ResourceNames)
+#endif
+ /* swaprep.c */
+ SYMFUNC(CopySwap32Write)
+ SYMFUNC(Swap32Write)
+ SYMFUNC(SwapConnSetupInfo)
+ SYMFUNC(SwapConnSetupPrefix)
+ SYMFUNC(SwapShorts)
+ SYMFUNC(SwapLongs)
+ /* swapreq.c */
+ SYMFUNC(SwapColorItem)
+ /* tables.c */
+ SYMVAR(EventSwapVector)
+ SYMVAR(ReplySwapVector)
+ SYMVAR(ProcVector)
+ /* window.c */
+ SYMFUNC(ChangeWindowAttributes)
+ SYMFUNC(CheckWindowOptionalNeed)
+ SYMFUNC(CreateUnclippedWinSize)
+ SYMFUNC(CreateWindow)
+ SYMFUNC(FindWindowWithOptional)
+ SYMFUNC(GravityTranslate)
+ SYMFUNC(MakeWindowOptional)
+ SYMFUNC(MapWindow)
+ SYMFUNC(MoveWindowInStack)
+ SYMFUNC(NotClippedByChildren)
+ SYMFUNC(ResizeChildrenWinSize)
+ SYMFUNC(SaveScreens)
+ SYMFUNC(SendVisibilityNotify)
+ SYMFUNC(SetWinSize)
+ SYMFUNC(SetBorderSize)
+ SYMFUNC(TraverseTree)
+ SYMFUNC(UnmapWindow)
+ SYMFUNC(WalkTree)
+ SYMFUNC(WindowsRestructured)
+ SYMVAR(deltaSaveUndersViewable)
+ SYMVAR(numSaveUndersViewable)
+ SYMVAR(savedScreenInfo)
+ SYMVAR(screenIsSaved)
+
+ /*os/ */
+ /* access.c */
+ SYMFUNC(LocalClient)
+ /* util.c */
+ SYMFUNC(Error)
+ SYMFUNC(VErrorF)
+ SYMFUNC(ErrorF)
+ SYMFUNC(FatalError)
+ SYMFUNC(Xstrdup)
+ SYMFUNC(XNFstrdup)
+ SYMVAR(Must_have_memory)
+ /* xalloc.c */
+ SYMFUNC(XNFalloc)
+ SYMFUNC(XNFcalloc)
+ SYMFUNC(XNFrealloc)
+ SYMFUNC(Xalloc)
+ SYMFUNC(Xcalloc)
+ SYMFUNC(Xfree)
+ SYMFUNC(Xrealloc)
+ /* WaitFor.c */
+ SYMFUNC(ScreenSaverTime)
+ SYMFUNC(TimerFree)
+ SYMFUNC(TimerSet)
+ SYMFUNC(TimerCancel)
+ /* io.c */
+ SYMFUNC(WriteToClient)
+ SYMFUNC(SetCriticalOutputPending)
+ SYMVAR(FlushCallback)
+ SYMVAR(ReplyCallback)
+ SYMVAR(SkippedRequestsCallback)
+ SYMFUNC(ResetCurrentRequest)
+ /* connection.c */
+ SYMFUNC(IgnoreClient)
+ SYMFUNC(AttendClient)
+ SYMFUNC(AddEnabledDevice)
+ SYMFUNC(RemoveEnabledDevice)
+ SYMFUNC(MakeClientGrabPervious)
+ SYMFUNC(MakeClientGrabImpervious)
+ SYMVAR(GrabInProgress)
+ /* utils.c */
+ SYMFUNC(AdjustWaitForDelay)
+ SYMVAR(noTestExtensions)
+
+ /* devices.c */
+ SYMFUNC(InitPointerDeviceStruct)
+ SYMFUNC(LookupKeyboardDevice)
+ SYMFUNC(LookupPointerDevice)
+
+#ifdef XKB
+ /* xkb/xkbInit.c */
+ SYMFUNC(XkbInitKeyboardDeviceStruct)
+ SYMFUNC(XkbSetRulesDflts)
+ SYMVAR(noXkbExtension)
+#endif
+
+#ifdef XINPUT
+ /* Xi */
+ /* exevents.c */
+ SYMFUNC(InitValuatorAxisStruct)
+ SYMFUNC(InitProximityClassDeviceStruct)
+ /* extinit.c */
+ SYMFUNC(AssignTypeAndName)
+#endif
+
+ /* xf86DGA.c */
+ /* XXX This is exported from the DDX, not DIX. */
+ SYMVAR(XDGAEventBase)
+
+ /* librender.a */
+#ifdef RENDER
+ SYMFUNC(PictureInit)
+ SYMFUNC(miPictureInit)
+ SYMFUNC(miComputeCompositeRegion)
+ SYMFUNC(miGlyphs)
+ SYMFUNC(miCompositeRects)
+ SYMVAR(PictureScreenPrivateIndex)
+ SYMFUNC(PictureTransformPoint)
+ SYMFUNC(PictureAddFilter)
+ SYMFUNC(PictureSetFilterAlias)
+ SYMFUNC(PictureGetSubpixelOrder)
+ SYMFUNC(PictureSetSubpixelOrder)
+#endif
+
+ /* os/utils.c */
+ SYMFUNC(GiveUp)
+
+ { 0, 0 },
+
+};
diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c
new file mode 100644
index 000000000..bf4c8c078
--- /dev/null
+++ b/hw/xfree86/loader/dlloader.c
@@ -0,0 +1,191 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dlloader.c,v 1.11 2000/08/23 22:10:14 tsi Exp $ */
+
+
+/*
+ *
+ * Copyright (c) 1997 The XFree86 Project, 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, and that the name of the
+ * XFree86 Project, Inc. not be used in advertising or publicity
+ * pertaining to distribution of the software without specific,
+ * written prior permission. The Xfree86 Project, Inc. makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE XFREE86 PROJECT, INC. 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. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+#include "Xos.h"
+#include "os.h"
+
+#include "sym.h"
+#include "loader.h"
+#include "dlloader.h"
+
+#ifdef DL_LAZY
+#define DLOPEN_LAZY DL_LAZY
+#else
+#ifdef RTLD_LAZY
+#define DLOPEN_LAZY RTLD_LAZY
+#else
+#ifdef __FreeBSD__
+#define DLOPEN_LAZY 1
+#else
+#define DLOPEN_LAZY 0
+#endif
+#endif
+#endif
+#ifdef LD_GLOBAL
+#define DLOPEN_GLOBAL LD_GLOBAL
+#else
+#ifdef RTLD_GLOBAL
+#define DLOPEN_GLOBAL RTLD_GLOBAL
+#else
+#define DLOPEN_GLOBAL 0
+#endif
+#endif
+
+#define DLOPEN_FLAGS ( DLOPEN_LAZY | DLOPEN_GLOBAL )
+
+#if defined(CSRG_BASED) && !defined(__ELF__)
+#define NEED_UNDERSCORE_FOR_DLLSYM
+#endif
+
+/*
+ * This structure contains all of the information about a module
+ * that has been loaded.
+ */
+typedef struct {
+ int handle;
+ void *dlhandle;
+} DLModuleRec, *DLModulePtr;
+
+/*
+ * a list of loaded modules XXX can be improved
+ */
+typedef struct DLModuleList {
+ DLModulePtr module;
+ struct DLModuleList *next;
+} DLModuleList;
+
+DLModuleList *dlModuleList = NULL;
+
+/*
+ * Search a symbol in the module list
+ */
+void *
+DLFindSymbol(const char *name)
+{
+ DLModuleList *l;
+ void *p;
+
+#ifdef NEED_UNDERSCORE_FOR_DLLSYM
+ char *n;
+
+ n = xf86loadermalloc(strlen(name) + 2);
+ sprintf(n, "_%s", name);
+#endif
+
+ (void)dlerror(); /* Clear out any previous error */
+ for (l = dlModuleList; l != NULL; l = l->next) {
+#ifdef NEED_UNDERSCORE_FOR_DLLSYM
+ p = dlsym(l->module->dlhandle, n);
+#else
+ p = dlsym(l->module->dlhandle, name);
+#endif
+ if (dlerror() == NULL) {
+#ifdef NEED_UNDERSCORE_FOR_DLLSYM
+ xf86loaderfree(n);
+#endif
+ return p;
+ }
+ }
+#ifdef NEED_UNDERSCORE_FOR_DLLSYM
+ xf86loaderfree(n);
+#endif
+
+ return NULL;
+}
+
+/*
+ * public interface
+ */
+void *
+DLLoadModule(loaderPtr modrec, int fd, LOOKUP **ppLookup)
+{
+ DLModulePtr dlfile;
+ DLModuleList *l;
+
+ if ((dlfile=xf86loadercalloc(1,sizeof(DLModuleRec)))==NULL) {
+ ErrorF("Unable to allocate DLModuleRec\n");
+ return NULL;
+ }
+ dlfile->handle = modrec->handle;
+ dlfile->dlhandle = dlopen(modrec->name, DLOPEN_FLAGS);
+ if (dlfile->dlhandle == NULL) {
+ ErrorF("dlopen: %s\n", dlerror());
+ xf86loaderfree(dlfile);
+ return NULL;
+ }
+ /* Add it to the module list */
+ l = xf86loadermalloc(sizeof(DLModuleList));
+ l->module = dlfile;
+ l->next = dlModuleList;
+ dlModuleList = l;
+ *ppLookup = NULL;
+
+ return (void *)dlfile;
+}
+
+void
+DLResolveSymbols(void *mod)
+{
+ return;
+}
+
+int
+DLCheckForUnresolved(void *mod)
+{
+ return 0;
+}
+
+void
+DLUnloadModule(void *modptr)
+{
+ DLModulePtr dlfile = (DLModulePtr)modptr;
+ DLModuleList *l, *p;
+
+ /* remove it from dlModuleList */
+ if (dlModuleList->module == modptr) {
+ l = dlModuleList;
+ dlModuleList = l->next;
+ xf86loaderfree(l);
+ } else {
+ p = dlModuleList;
+ for (l = dlModuleList->next; l != NULL; l = l->next) {
+ if (l->module == modptr) {
+ p->next = l->next;
+ xf86loaderfree(l);
+ break;
+ }
+ p = l;
+ }
+ }
+ dlclose(dlfile->dlhandle);
+ xf86loaderfree(modptr);
+}
diff --git a/hw/xfree86/loader/dlloader.h b/hw/xfree86/loader/dlloader.h
new file mode 100644
index 000000000..e9468e97b
--- /dev/null
+++ b/hw/xfree86/loader/dlloader.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 1997 Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/dlloader.h,v 1.3 1998/09/20 14:41:04 dawes Exp $ */
+
+#ifndef _DLLOADER_H
+#define _DLLOADER_H
+extern void *DLLoadModule(loaderPtr, int, LOOKUP **);
+extern void DLResolveSymbols(void *);
+extern int DLCheckForUnresolved(void *);
+extern void DLUnloadModule(void *);
+extern void *DLFindSymbol(const char *name);
+
+#endif
diff --git a/hw/xfree86/loader/elf.h b/hw/xfree86/loader/elf.h
new file mode 100644
index 000000000..ad072c199
--- /dev/null
+++ b/hw/xfree86/loader/elf.h
@@ -0,0 +1,710 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.15 2002/10/30 17:50:19 alanh Exp $ */
+
+
+typedef unsigned int Elf32_Addr;
+typedef unsigned short Elf32_Half;
+typedef unsigned int Elf32_Off;
+typedef long Elf32_Sword;
+typedef unsigned int Elf32_Word;
+
+typedef unsigned long Elf64_Addr;
+typedef unsigned short Elf64_Half;
+typedef unsigned long Elf64_Off;
+typedef int Elf64_Sword;
+typedef unsigned int Elf64_Word;
+typedef unsigned long Elf64_Xword;
+typedef long 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_LOPROC 0x70000000
+#define PT_HIPROC 0x7fffffff
+
+/* 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 5
+#define ET_HIPROC 6
+
+/* 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
+#define EM_MIPS_RS4_BE 10
+#define EM_PARISC 15
+#define EM_SPARC32PLUS 18
+#define EM_PPC 20
+#define EM_SPARCV9 43
+#define EM_IA_64 50
+#define EM_ALPHA 0x9026
+
+/* 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_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_LOPROC 13
+#define STT_HIPROC 15
+
+#define ELF32_ST_BIND(x) ((x) >> 4)
+#define ELF32_ST_TYPE(x) (((unsigned int) x) & 0xf)
+
+#define ELF64_ST_BIND(x) ELF32_ST_BIND (x)
+#define ELF64_ST_TYPE(x) ELF32_ST_TYPE (x)
+
+typedef struct dynamic32 {
+ Elf32_Sword d_tag;
+ union{
+ Elf32_Sword d_val;
+ Elf32_Addr d_ptr;
+ } d_un;
+} Elf32_Dyn;
+
+typedef struct dynamic64 {
+ Elf64_Sxword d_tag;
+ union{
+ Elf64_Xword d_val;
+ Elf64_Addr d_ptr;
+ } d_un;
+} Elf64_Dyn;
+
+#ifndef QNX4
+extern Elf32_Dyn _DYNAMIC [];
+#endif
+
+/* The following are used with relocations */
+#define ELF32_R_SYM(x) ((x) >> 8)
+#define ELF32_R_TYPE(x) ((x) & 0xff)
+
+#define ELF64_R_SYM(x) ((x) >> 32)
+#define ELF64_R_TYPE(x) ((x) & 0xffffffff)
+
+/* x86 Relocation Types */
+#define R_386_NONE 0
+#define R_386_32 1
+#define R_386_PC32 2
+#define R_386_GOT32 3
+#define R_386_PLT32 4
+#define R_386_COPY 5
+#define R_386_GLOB_DAT 6
+#define R_386_JMP_SLOT 7
+#define R_386_RELATIVE 8
+#define R_386_GOTOFF 9
+#define R_386_GOTPC 10
+#define R_386_NUM 11
+
+/* x86_64 Relocation Types */
+#define R_X86_64_NONE 0
+#define R_X86_64_64 1
+#define R_X86_64_PC32 2
+#define R_X86_64_GOT32 3
+#define R_X86_64_PLT32 4
+#define R_X86_64_COPY 5
+#define R_X86_64_GLOB_DAT 6
+#define R_X86_64_JUMP_SLOT 7
+#define R_X86_64_RELATIVE 8
+#define R_X86_64_GOTPCREL 9
+#define R_X86_64_32 10
+#define R_X86_64_32S 11
+#define R_X86_64_16 12
+#define R_X86_64_PC16 13
+#define R_X86_64_8 14
+#define R_X86_64_PC8 15
+#define R_X86_64_GNU_VTINHERIT 250
+#define R_X86_64_GNU_VTENTRY 251
+
+/* sparc Relocation Types */
+#define R_SPARC_NONE 0
+#define R_SPARC_8 1
+#define R_SPARC_16 2
+#define R_SPARC_32 3
+#define R_SPARC_DISP8 4
+#define R_SPARC_DISP16 5
+#define R_SPARC_DISP32 6
+#define R_SPARC_WDISP30 7
+#define R_SPARC_WDISP22 8
+#define R_SPARC_HI22 9
+#define R_SPARC_22 10
+#define R_SPARC_13 11
+#define R_SPARC_LO10 12
+#define R_SPARC_GOT10 13
+#define R_SPARC_GOT13 14
+#define R_SPARC_GOT22 15
+#define R_SPARC_PC10 16
+#define R_SPARC_PC22 17
+#define R_SPARC_WPLT30 18
+#define R_SPARC_COPY 19
+#define R_SPARC_GLOB_DAT 20
+#define R_SPARC_JMP_SLOT 21
+#define R_SPARC_RELATIVE 22
+#define R_SPARC_UA32 23
+#define R_SPARC_PLT32 24
+#define R_SPARC_HIPLT22 25
+#define R_SPARC_LOPLT10 26
+#define R_SPARC_PCPLT32 27
+#define R_SPARC_PCPLT22 28
+#define R_SPARC_PCPLT10 29
+#define R_SPARC_10 30
+#define R_SPARC_11 31
+#define R_SPARC_64 32
+#define R_SPARC_OLO10 33
+#define R_SPARC_HH22 34
+#define R_SPARC_HM10 35
+#define R_SPARC_LM22 36
+#define R_SPARC_PC_HH22 37
+#define R_SPARC_PC_HM10 38
+#define R_SPARC_PC_LM22 39
+#define R_SPARC_WDISP16 40
+#define R_SPARC_WDISP19 41
+#define R_SPARC_GLOB_JMP 42
+#define R_SPARC_7 43
+#define R_SPARC_5 44
+#define R_SPARC_6 45
+#define R_SPARC_DISP64 46
+#define R_SPARC_PLT64 47
+#define R_SPARC_HIX22 48
+#define R_SPARC_LOX10 49
+#define R_SPARC_H44 50
+#define R_SPARC_M44 51
+#define R_SPARC_L44 52
+#define R_SPARC_REGISTER 53
+#define R_SPARC_UA64 54
+#define R_SPARC_UA16 55
+#define R_SPARC_NUM 56
+
+/* m68k Relocation Types */
+#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 */
+
+/* Alpha Relocation Types */
+#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_OP_PUSH 12 /* OP stack push */
+#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */
+#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */
+#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */
+#define R_ALPHA_GPVALUE 16
+#define R_ALPHA_GPRELHIGH 17
+#define R_ALPHA_GPRELLOW 18
+#define R_ALPHA_GPREL16 19
+#define R_ALPHA_IMMED_GP_HI32 20
+#define R_ALPHA_IMMED_SCN_HI32 21
+#define R_ALPHA_IMMED_BR_HI32 22
+#define R_ALPHA_IMMED_LO32 23
+#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 */
+
+/* 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_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_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_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 0x70 /* symbol + addend, data4 MSB */
+#define R_IA64_LTV32LSB 0x71 /* symbol + addend, data4 LSB */
+#define R_IA64_LTV64MSB 0x72 /* symbol + addend, data8 MSB */
+#define R_IA64_LTV64LSB 0x73 /* symbol + addend, data8 LSB */
+#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */
+#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */
+#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */
+#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */
+
+#define R_IA64_TYPE(R) ((R) & -8)
+#define R_IA64_FORMAT(R) ((R) & 7)
+
+/*
+ * Apparantly, Linux and PowerMAXOS use different version of ELF as the
+ * Relocation types are very different.
+ */
+#if defined(PowerMAX_OS)
+/* PPC Relocation Types */
+#define R_PPC_NONE 0
+#define R_PPC_COPY 1
+#define R_PPC_GOTP_ENT 2
+#define R_PPC_8 4
+#define R_PPC_8S 5
+#define R_PPC_16S 7
+#define R_PPC_14 8
+#define R_PPC_DISP14 9
+#define R_PPC_24 10
+#define R_PPC_DISP24 11
+#define R_PPC_PLT_DISP24 14
+#define R_PPC_BBASED_16HU 15
+#define R_PPC_BBASED_32 16
+#define R_PPC_BBASED_32UA 17
+#define R_PPC_BBASED_16H 18
+#define R_PPC_BBASED_16L 19
+#define R_PPC_ABDIFF_16HU 23
+#define R_PPC_ABDIFF_32 24
+#define R_PPC_ABDIFF_32UA 25
+#define R_PPC_ABDIFF_16H 26
+#define R_PPC_ABDIFF_16L 27
+#define R_PPC_ABDIFF_16 28
+#define R_PPC_16HU 31
+#define R_PPC_32 32
+#define R_PPC_32UA 33
+#define R_PPC_16H 34
+#define R_PPC_16L 35
+#define R_PPC_16 36
+#define R_PPC_GOT_16HU 39
+#define R_PPC_GOT_32 40
+#define R_PPC_GOT_32UA 41
+#define R_PPC_GOT_16H 42
+#define R_PPC_GOT_16L 43
+#define R_PPC_GOT_16 44
+#define R_PPC_GOTP_16HU 47
+#define R_PPC_GOTP_32 48
+#define R_PPC_GOTP_32UA 49
+#define R_PPC_GOTP_16H 50
+#define R_PPC_GOTP_16L 51
+#define R_PPC_GOTP_16 52
+#define R_PPC_PLT_16HU 55
+#define R_PPC_PLT_32 56
+#define R_PPC_PLT_32UA 57
+#define R_PPC_PLT_16H 58
+#define R_PPC_PLT_16L 59
+#define R_PPC_PLT_16 60
+#define R_PPC_ABREL_16HU 63
+#define R_PPC_ABREL_32 64
+#define R_PPC_ABREL_32UA 65
+#define R_PPC_ABREL_16H 66
+#define R_PPC_ABREL_16L 67
+#define R_PPC_ABREL_16 68
+#define R_PPC_GOT_ABREL_16HU 71
+#define R_PPC_GOT_ABREL_32 72
+#define R_PPC_GOT_ABREL_32UA 73
+#define R_PPC_GOT_ABREL_16H 74
+#define R_PPC_GOT_ABREL_16L 75
+#define R_PPC_GOT_ABREL_16 76
+#define R_PPC_GOTP_ABREL_16HU 79
+#define R_PPC_GOTP_ABREL_32 80
+#define R_PPC_GOTP_ABREL_32UA 81
+#define R_PPC_GOTP_ABREL_16H 82
+#define R_PPC_GOTP_ABREL_16L 83
+#define R_PPC_GOTP_ABREL_16 84
+#define R_PPC_PLT_ABREL_16HU 87
+#define R_PPC_PLT_ABREL_32 88
+#define R_PPC_PLT_ABREL_32UA 89
+#define R_PPC_PLT_ABREL_16H 90
+#define R_PPC_PLT_ABREL_16L 91
+#define R_PPC_PLT_ABREL_16 92
+#define R_PPC_SREL_16HU 95
+#define R_PPC_SREL_32 96
+#define R_PPC_SREL_32UA 97
+#define R_PPC_SREL_16H 98
+#define R_PPC_SREL_16L 99
+#else
+/*
+ * The Linux version
+ */
+#define R_PPC_NONE 0
+#define R_PPC_ADDR32 1
+#define R_PPC_ADDR24 2
+#define R_PPC_ADDR16 3
+#define R_PPC_ADDR16_LO 4
+#define R_PPC_ADDR16_HI 5
+#define R_PPC_ADDR16_HA 6
+#define R_PPC_ADDR14 7
+#define R_PPC_ADDR14_BRTAKEN 8
+#define R_PPC_ADDR14_BRNTAKEN 9
+#define R_PPC_REL24 10
+#define R_PPC_REL14 11
+#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
+#endif
+
+/* 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_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
+
+typedef struct elf32_rel {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+} Elf32_Rel;
+
+typedef struct elf64_rel {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+} 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;
+ Elf64_Xword r_info;
+ Elf64_Sxword r_addend;
+} 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;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf64_Half st_shndx;
+ Elf64_Addr st_value;
+ Elf64_Xword st_size;
+} Elf64_Sym;
+
+#define EI_NIDENT 16
+
+typedef struct elf32hdr{
+ 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 elf64hdr {
+ unsigned char e_ident[EI_NIDENT];
+ Elf64_Half e_type;
+ Elf64_Half e_machine;
+ Elf64_Word e_version;
+ Elf64_Addr e_entry;
+ Elf64_Off e_phoff;
+ Elf64_Off e_shoff;
+ 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 elf_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_Word p_type;
+ Elf64_Word p_flags;
+ Elf64_Off p_offset;
+ Elf64_Addr p_vaddr;
+ Elf64_Addr p_paddr;
+ Elf64_Xword p_filesz;
+ Elf64_Xword p_memsz;
+ Elf64_Xword p_align;
+} 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
+
+#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */
+
+/* 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_Word sh_name;
+ Elf64_Word sh_type;
+ Elf64_Xword sh_flags;
+ Elf64_Addr sh_addr;
+ Elf64_Off sh_offset;
+ Elf64_Xword sh_size;
+ Elf64_Word sh_link;
+ Elf64_Word sh_info;
+ Elf64_Xword sh_addralign;
+ Elf64_Xword sh_entsize;
+} 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_PAD 7
+
+#define ELFMAG0 0x7f /* EI_MAG */
+#define ELFMAG1 'E'
+#define ELFMAG2 'L'
+#define ELFMAG3 'F'
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+
+#define ELFDLMAG 3
+#define ELFDLOFF 16
+
+#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
+
+/* Notes used in ET_CORE */
+#define NT_PRSTATUS 1
+#define NT_PRFPREG 2
+#define NT_PRPSINFO 3
+#define NT_TASKSTRUCT 4
+
+/* Note header in a PT_NOTE section */
+typedef struct elf_note {
+ Elf32_Word n_namesz; /* Name size */
+ Elf32_Word n_descsz; /* Content size */
+ Elf32_Word n_type; /* Content type */
+} Elf32_Nhdr;
+
+#define ELF_START_MMAP 0x80000000
diff --git a/hw/xfree86/loader/elfloader.c b/hw/xfree86/loader/elfloader.c
new file mode 100644
index 000000000..822a50efa
--- /dev/null
+++ b/hw/xfree86/loader/elfloader.c
@@ -0,0 +1,3024 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.49 2003/01/24 17:26:35 tsi Exp $ */
+
+/*
+ *
+ * Copyright 1995-1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#include <stdlib.h>
+#ifdef __QNX__
+# include <fcntl.h>
+#else
+# include <sys/fcntl.h>
+#endif
+#include <sys/stat.h>
+#if defined(linux) && defined (__ia64__)
+#include <sys/mman.h>
+#endif
+
+#ifdef DBMALLOC
+# include <debug/malloc.h>
+# define Xalloc(size) malloc(size)
+# define Xcalloc(size) calloc(1,(size))
+# define Xfree(size) free(size)
+#endif
+
+#include "Xos.h"
+#include "os.h"
+#include "elf.h"
+
+#include "sym.h"
+#include "loader.h"
+
+#include "compiler.h"
+
+#undef LDTEST
+
+/*
+#ifndef LDTEST
+# define ELFDEBUG ErrorF
+#endif
+*/
+
+#ifndef UseMMAP
+# if defined (__ia64__) || defined (__sparc__)
+# define MergeSectionAlloc
+# endif
+#endif
+
+#if defined (DoMMAPedMerge)
+# include <sys/mman.h>
+# define MergeSectionAlloc
+# define MMAP_PROT (PROT_READ | PROT_WRITE | PROT_EXEC)
+# if !defined(linux)
+# error No MAP_ANON?
+# endif
+# if !defined (__x86_64__)
+# define MMAP_FLAGS (MAP_PRIVATE | MAP_ANON)
+# else
+# define MMAP_FLAGS (MAP_PRIVATE | MAP_ANON | MAP_32BIT)
+# endif
+# if defined (MmapPageAlign)
+# define MMAP_ALIGN(size) do { \
+ int pagesize = getpagesize(); \
+ size = ( size + pagesize - 1) / pagesize; \
+ size *= pagesize; \
+ } while (0);
+# else
+# define MMAP_ALIGN(size)
+# endif
+#endif
+
+#if defined (__alpha__) || \
+ defined (__ia64__) || \
+ defined (__x86_64__) || \
+ (defined (__sparc__) && \
+ (defined (__arch64__) || \
+ defined (__sparcv9)))
+typedef Elf64_Ehdr Elf_Ehdr;
+typedef Elf64_Shdr Elf_Shdr;
+typedef Elf64_Sym Elf_Sym;
+typedef Elf64_Rel Elf_Rel;
+typedef Elf64_Rela Elf_Rela;
+typedef Elf64_Addr Elf_Addr;
+typedef Elf64_Half Elf_Half;
+typedef Elf64_Off Elf_Off;
+typedef Elf64_Sword Elf_Sword;
+typedef Elf64_Word Elf_Word;
+#define ELF_ST_BIND ELF64_ST_BIND
+#define ELF_ST_TYPE ELF64_ST_TYPE
+#define ELF_R_SYM ELF64_R_SYM
+#define ELF_R_TYPE ELF64_R_TYPE
+
+# if defined (__alpha__) || defined (__ia64__)
+/*
+ * The GOT is allocated dynamically. We need to keep a list of entries that
+ * have already been added to the GOT.
+ *
+ */
+typedef struct _elf_GOT_Entry {
+ Elf_Rela *rel;
+ int offset;
+ struct _elf_GOT_Entry *next;
+} ELFGotEntryRec, *ELFGotEntryPtr;
+
+typedef struct _elf_GOT {
+ unsigned int size;
+ unsigned int nuses;
+ unsigned char *freeptr;
+ struct _elf_GOT *next;
+ unsigned char section[1];
+} ELFGotRec, *ELFGotPtr;
+
+# ifdef MergeSectionAlloc
+static ELFGotPtr ELFSharedGOTs;
+# endif
+# endif
+
+# if defined (__ia64__)
+/*
+ * The PLT is allocated dynamically. We need to keep a list of entries that
+ * have already been added to the PLT.
+ */
+typedef struct _elf_PLT_Entry {
+ Elf_Rela *rel;
+ int offset;
+ int gotoffset;
+ struct _elf_PLT_Entry *next;
+} ELFPltEntryRec, *ELFPltEntryPtr;
+
+/*
+ * The OPD is allocated dynamically within the GOT. We need to keep a list
+ * of entries that have already been added to the OPD.
+ */
+typedef struct _elf_OPD {
+ LOOKUP *l;
+ int index;
+ int offset;
+ struct _elf_OPD *next;
+} ELFOpdRec, *ELFOpdPtr;
+# endif
+
+#else
+typedef Elf32_Ehdr Elf_Ehdr;
+typedef Elf32_Shdr Elf_Shdr;
+typedef Elf32_Sym Elf_Sym;
+typedef Elf32_Rel Elf_Rel;
+typedef Elf32_Rela Elf_Rela;
+typedef Elf32_Addr Elf_Addr;
+typedef Elf32_Half Elf_Half;
+typedef Elf32_Off Elf_Off;
+typedef Elf32_Sword Elf_Sword;
+typedef Elf32_Word Elf_Word;
+#define ELF_ST_BIND ELF32_ST_BIND
+#define ELF_ST_TYPE ELF32_ST_TYPE
+#define ELF_R_SYM ELF32_R_SYM
+#define ELF_R_TYPE ELF32_R_TYPE
+#endif
+
+#if defined(__powerpc__) || \
+ defined(__mc68000__) || \
+ defined(__alpha__) || \
+ defined(__sparc__) || \
+ defined(__ia64__) || \
+ defined(__x86_64__)
+typedef Elf_Rela Elf_Rel_t;
+#else
+typedef Elf_Rel Elf_Rel_t;
+#endif
+
+typedef struct {
+ void *saddr;
+ char *name;
+ int ndx;
+ int size;
+ int flags;
+} LoadSection;
+
+#define RELOC_SECTION 0x1
+#define LOADED_SECTION 0x2
+
+/*
+ * This structure contains all of the information about a module
+ * that has been loaded.
+ */
+
+typedef struct {
+ int handle;
+ int module;
+ int fd;
+ loader_funcs *funcs;
+ Elf_Ehdr *header;/* file header */
+ int numsh;
+ Elf_Shdr *sections;/* Address of the section header table */
+ int secsize; /* size of the section table */
+ unsigned char **saddr;/* Start addresss of the section pointer table */
+ unsigned char *shstraddr; /* Start address of the section header string table */
+ int shstrndx; /* index of the section header string table */
+ int shstrsize; /* size of the section header string table */
+#if defined(__alpha__) || defined(__ia64__)
+ unsigned char *got; /* Start address of the .got section */
+ ELFGotEntryPtr got_entries; /* List of entries in the .got section */
+ int gotndx; /* index of the .got section */
+ int gotsize; /* actual size of the .got section */
+ ELFGotPtr shared_got; /* Pointer to ELFGotRec if shared */
+#endif /*(__alpha__) || (__ia64__)*/
+#if defined(__ia64__)
+ ELFOpdPtr opd_entries; /* List of entries in the .opd section */
+ unsigned char *plt; /* Start address of the .plt section */
+ ELFPltEntryPtr plt_entries; /* List of entries in the .plt section */
+ int pltndx; /* index of the .plt section */
+ int pltsize; /* size of the .plt section */
+#endif /*__ia64__*/
+ Elf_Sym *symtab; /* Start address of the .symtab section */
+ int symndx; /* index of the .symtab section */
+ unsigned char *common; /* Start address of the SHN_COMMON space */
+ int comsize; /* size of the SHN_COMMON space */
+
+ unsigned char *base; /* Alloced address of section block */
+ unsigned long baseptr; /* Pointer to next free space in base */
+ int basesize; /* Size of that allocation */
+ unsigned char *straddr; /* Start address of the string table */
+ int strndx; /* index of the string table */
+ int strsize; /* size of the string table */
+ LoadSection *lsection;
+ int lsectidx;
+} ELFModuleRec, *ELFModulePtr;
+
+/*
+ * If a relocation is unable to be satisfied, then put it on a list
+ * to try later after more modules have been loaded.
+ */
+typedef struct _elf_reloc {
+ Elf_Rel_t *rel;
+ ELFModulePtr file;
+ Elf_Word secn;
+ struct _elf_reloc *next;
+} ELFRelocRec;
+
+/*
+ * symbols with a st_shndx of COMMON need to have space allocated for them.
+ *
+ * Gather all of these symbols together, and allocate one chunk when we
+ * are done.
+ */
+typedef struct _elf_COMMON {
+ Elf_Sym *sym;
+ struct _elf_COMMON *next;
+} ELFCommonRec;
+
+static ELFCommonPtr listCOMMON=NULL;
+
+/* Prototypes for static functions */
+static int ELFhashCleanOut(void *, itemPtr);
+static char *ElfGetStringIndex(ELFModulePtr, int, int);
+static char *ElfGetString(ELFModulePtr, int);
+static char *ElfGetSectionName(ELFModulePtr, int);
+static ELFRelocPtr ElfDelayRelocation(ELFModulePtr, Elf_Word, Elf_Rel_t *);
+static ELFCommonPtr ElfAddCOMMON(Elf_Sym *);
+static int ElfCOMMONSize(void);
+static int ElfCreateCOMMON(ELFModulePtr,LOOKUP *);
+static char *ElfGetSymbolNameIndex(ELFModulePtr, int, int);
+static char *ElfGetSymbolName(ELFModulePtr, int);
+static Elf_Addr ElfGetSymbolValue(ELFModulePtr, int);
+static ELFRelocPtr Elf_RelocateEntry(ELFModulePtr, Elf_Word, Elf_Rel_t *, int);
+static ELFRelocPtr ELFCollectRelocations(ELFModulePtr, int);
+static LOOKUP *ELF_GetSymbols(ELFModulePtr, unsigned short **);
+static void ELFCollectSections(ELFModulePtr, int, int *, int *);
+#if defined(__alpha__) || defined(__ia64__)
+static void ElfAddGOT(ELFModulePtr, Elf_Rel_t *);
+static int ELFCreateGOT(ELFModulePtr, int);
+#endif
+#if defined(__ia64__)
+static void ElfAddOPD(ELFModulePtr, int, LOOKUP *);
+static void ELFCreateOPD(ELFModulePtr);
+static void ElfAddPLT(ELFModulePtr, Elf_Rel_t *);
+static void ELFCreatePLT(ELFModulePtr);
+enum ia64_operand {
+ IA64_OPND_IMM22,
+ IA64_OPND_TGT25C
+};
+static void IA64InstallReloc(unsigned long *, int, enum ia64_operand, long);
+#endif /*__ia64__*/
+
+#ifdef MergeSectionAlloc
+static void *
+ELFLoaderSectToMem(elffile, align, offset, size, label)
+ELFModulePtr elffile;
+int align;
+unsigned long offset;
+int size;
+char *label;
+{
+ void *ret;
+ elffile->baseptr = (elffile->baseptr + align - 1) & ~(align - 1);
+ ret = (void *)elffile->baseptr;
+ _LoaderFileRead(elffile->fd, offset, ret, size);
+ elffile->baseptr += size;
+ return ret;
+}
+
+static void *
+ELFLoaderSectCalloc(elffile, align, size)
+ELFModulePtr elffile;
+int align;
+int size;
+{
+ void *ret;
+ elffile->baseptr = (elffile->baseptr + align - 1) & ~(align - 1);
+ ret = (void *)elffile->baseptr;
+ elffile->baseptr += size;
+#ifndef DoMMAPedMerge
+ memset(ret, 0, size); /* mmap() does this for us */
+#endif
+ return ret;
+}
+#else /* MergeSectionAlloc */
+# define ELFLoaderSectToMem(elffile,align,offset,size,label) \
+_LoaderFileToMem((elffile)->fd,offset,size,label)
+# define ELFLoaderSectCalloc(elffile,align,size) xf86loadercalloc(1,size)
+#endif
+
+/*
+ * Utility Functions
+ */
+
+
+static int
+ELFhashCleanOut(voidptr, item)
+void *voidptr;
+itemPtr item ;
+{
+ ELFModulePtr module = (ELFModulePtr) voidptr;
+ return (module->handle == item->handle);
+}
+
+/*
+ * Manage listResolv
+ */
+static ELFRelocPtr
+ElfDelayRelocation(elffile, secn, rel)
+ELFModulePtr elffile;
+Elf_Word secn;
+Elf_Rel_t *rel;
+{
+ ELFRelocPtr reloc;
+
+ if ((reloc = xf86loadermalloc(sizeof(ELFRelocRec))) == NULL) {
+ ErrorF( "ElfDelayRelocation() Unable to allocate memory!!!!\n" );
+ return 0;
+ }
+ reloc->file=elffile;
+ reloc->secn=secn;
+ reloc->rel=rel;
+ reloc->next=0;
+#ifdef ELFDEBUG
+ ELFDEBUG("ElfDelayRelocation %lx: file %lx, sec %d,"
+ " r_offset 0x%lx, r_info 0x%x",
+ reloc, elffile, secn, rel->r_offset, rel->r_info);
+# if defined(__powerpc__) || \
+ defined(__mc68000__) || \
+ defined(__alpha__) || \
+ defined(__sparc__) || \
+ defined(__ia64__) || \
+ defined(__x86_64__)
+ ELFDEBUG(", r_addend 0x%lx", rel->r_addend);
+# endif
+ ELFDEBUG("\n");
+#endif
+ return reloc;
+}
+
+/*
+ * Manage listCOMMON
+ */
+static ELFCommonPtr
+ElfAddCOMMON(sym)
+Elf_Sym *sym;
+{
+ ELFCommonPtr common;
+
+ if ((common = xf86loadermalloc(sizeof(ELFCommonRec))) == NULL) {
+ ErrorF( "ElfAddCOMMON() Unable to allocate memory!!!!\n" );
+ return 0;
+ }
+ common->sym=sym;
+ common->next=0;
+ return common;
+}
+
+static int
+ElfCOMMONSize(void)
+{
+ int size=0;
+ ELFCommonPtr common;
+
+ for (common = listCOMMON; common; common = common->next) {
+ size+=common->sym->st_size;
+#if defined(__alpha__) || \
+ defined(__ia64__) || \
+ defined(__x86_64__) || \
+ (defined(__sparc__) && \
+ (defined(__arch64__) || \
+ defined(__sparcv9)))
+ size = (size+7)&~0x7;
+#endif
+ }
+ return size;
+}
+
+static int
+ElfCreateCOMMON(elffile,pLookup)
+ELFModulePtr elffile;
+LOOKUP *pLookup;
+{
+ int numsyms=0,size=0,l=0;
+ int offset=0,firstcommon=0;
+ ELFCommonPtr common;
+
+ if (listCOMMON == NULL)
+ return TRUE;
+
+ for (common = listCOMMON; common; common = common->next) {
+ size+=common->sym->st_size;
+#if defined(__alpha__) || \
+ defined(__ia64__) || \
+ defined(__x86_64__) || \
+ (defined(__sparc__) && \
+ (defined(__arch64__) || \
+ defined(__sparcv9)))
+ size = (size+7)&~0x7;
+#endif
+ numsyms++;
+ }
+
+#ifdef ELFDEBUG
+ ELFDEBUG("ElfCreateCOMMON() %d entries (%d bytes) of COMMON data\n",
+ numsyms, size );
+#endif
+
+ elffile->comsize=size;
+ if((elffile->common = ELFLoaderSectCalloc(elffile,8,size)) == NULL) {
+ ErrorF( "ElfCreateCOMMON() Unable to allocate memory!!!!\n" );
+ return FALSE;
+ }
+
+ if (DebuggerPresent)
+ {
+ ldrCommons = xf86loadermalloc(numsyms*sizeof(LDRCommon));
+ nCommons = numsyms;
+ }
+
+ for (l = 0; pLookup[l].symName; l++)
+ ;
+ firstcommon=l;
+
+ /* Traverse the common list and create a lookup table with all the
+ * common symbols. Destroy the common list in the process.
+ * See also ResolveSymbols.
+ */
+ while(listCOMMON) {
+ common=listCOMMON;
+ /* this is xstrdup because is should be more efficient. it is freed
+ * with xf86loaderfree
+ */
+ pLookup[l].symName =
+ xf86loaderstrdup(ElfGetString(elffile,common->sym->st_name));
+ pLookup[l].offset = (funcptr)(elffile->common + offset);
+#ifdef ELFDEBUG
+ ELFDEBUG("Adding common %lx %s\n",
+ pLookup[l].offset, pLookup[l].symName);
+#endif
+
+ /* Record the symbol address for gdb */
+ if (DebuggerPresent && ldrCommons)
+ {
+ ldrCommons[l-firstcommon].addr = (void *)pLookup[l].offset;
+ ldrCommons[l-firstcommon].name = pLookup[l].symName;
+ ldrCommons[l-firstcommon].namelen = strlen(pLookup[l].symName);
+ }
+ listCOMMON=common->next;
+ offset+=common->sym->st_size;
+#if defined(__alpha__) || \
+ defined(__ia64__) || \
+ defined(__x86_64__) || \
+ (defined(__sparc__) && \
+ (defined(__arch64__) || \
+ defined(__sparcv9)))
+ offset = (offset+7)&~0x7;
+#endif
+ xf86loaderfree(common);
+ l++;
+ }
+ /* listCOMMON == 0 */
+ pLookup[l].symName=NULL; /* Terminate the list. */
+ return TRUE;
+}
+
+
+/*
+ * String Table
+ */
+static char *
+ElfGetStringIndex(file, offset, index)
+ELFModulePtr file;
+int offset;
+int index;
+{
+ if( !offset || !index )
+ return "";
+
+ return (char *)(file->saddr[index]+offset);
+}
+
+static char *
+ElfGetString(file, offset)
+ELFModulePtr file;
+int offset;
+{
+ return ElfGetStringIndex( file, offset, file->strndx );
+}
+
+static char *
+ElfGetSectionName(file, offset)
+ELFModulePtr file;
+int offset;
+{
+ return (char *)(file->shstraddr+offset);
+}
+
+
+
+/*
+ * Symbol Table
+ */
+
+/*
+ * Get symbol name
+ */
+static char *
+ElfGetSymbolNameIndex(elffile, index, secndx)
+ELFModulePtr elffile;
+int index;
+int secndx;
+{
+ Elf_Sym *syms;
+
+#ifdef ELFDEBUG
+ ELFDEBUG("ElfGetSymbolNameIndex(%x,%x) ",index, secndx );
+#endif
+
+ syms=(Elf_Sym *)elffile->saddr[secndx];
+
+#ifdef ELFDEBUG
+ ELFDEBUG("%s ",ElfGetString(elffile, syms[index].st_name));
+ ELFDEBUG("%x %x ",ELF_ST_BIND(syms[index].st_info),
+ ELF_ST_TYPE(syms[index].st_info));
+ ELFDEBUG("%lx\n",syms[index].st_value);
+#endif
+
+ return ElfGetString(elffile,syms[index].st_name );
+}
+
+static char *
+ElfGetSymbolName(elffile, index)
+ELFModulePtr elffile;
+int index;
+{
+ return ElfGetSymbolNameIndex(elffile, index, elffile->symndx);
+}
+
+static Elf_Addr
+ElfGetSymbolValue(elffile, index)
+ELFModulePtr elffile;
+int index;
+{
+ Elf_Sym *syms;
+ Elf_Addr symval=0; /* value of the indicated symbol */
+ char *symname = NULL; /* name of symbol in relocation */
+ itemPtr symbol = NULL; /* name/value of symbol */
+
+ syms=(Elf_Sym *)elffile->saddr[elffile->symndx];
+
+ switch( ELF_ST_TYPE(syms[index].st_info) )
+ {
+ case STT_NOTYPE:
+ case STT_OBJECT:
+ case STT_FUNC:
+ switch( ELF_ST_BIND(syms[index].st_info) )
+ {
+ case STB_LOCAL:
+ symval=(Elf_Addr)(
+ elffile->saddr[syms[index].st_shndx]+
+ syms[index].st_value);
+#ifdef __ia64__
+ if( ELF_ST_TYPE(syms[index].st_info) == STT_FUNC ) {
+ ELFOpdPtr opdent;
+ for (opdent = elffile->opd_entries; opdent; opdent = opdent->next)
+ if (opdent->index == index)
+ break;
+ if(opdent) {
+ ((unsigned long *)(elffile->got+opdent->offset))[0] = symval;
+ ((unsigned long *)(elffile->got+opdent->offset))[1] = (long)elffile->got;
+ symval = (Elf_Addr)(elffile->got+opdent->offset);
+ }
+ }
+#endif
+ break;
+ case STB_GLOBAL:
+ case STB_WEAK: /* STB_WEAK seems like a hack to cover for
+ some other problem */
+ symname=
+ ElfGetString(elffile,syms[index].st_name);
+ symbol = LoaderHashFind(symname);
+ if( symbol == 0 ) {
+ return 0;
+ }
+ symval=(Elf_Addr)symbol->address;
+ break;
+ default:
+ symval=0;
+ ErrorF(
+ "ElfGetSymbolValue(), unhandled symbol scope %x\n",
+ ELF_ST_BIND(syms[index].st_info) );
+ break;
+ }
+#ifdef ELFDEBUG
+ ELFDEBUG( "%lx\t", symbol );
+ ELFDEBUG( "%lx\t", symval );
+ ELFDEBUG( "%s\n", symname ? symname : "NULL");
+#endif
+ break;
+ case STT_SECTION:
+ symval=(Elf_Addr)elffile->saddr[syms[index].st_shndx];
+#ifdef ELFDEBUG
+ ELFDEBUG( "ST_SECTION %lx\n", symval );
+#endif
+ break;
+ case STT_FILE:
+ case STT_LOPROC:
+ case STT_HIPROC:
+ default:
+ symval=0;
+ ErrorF( "ElfGetSymbolValue(), unhandled symbol type %x\n",
+ ELF_ST_TYPE(syms[index].st_info) );
+ break;
+ }
+ return symval;
+}
+
+#if defined(__powerpc__)
+/*
+ * This function returns the address of a pseudo PLT routine which can
+ * be used to compute a function offset. This is needed because loaded
+ * modules have an offset from the .text section of greater than 24 bits.
+ * The code generated makes the assumption that all function entry points
+ * will be within a 24 bit offset (non-PIC code).
+ */
+static Elf_Addr
+ElfGetPltAddr(elffile, index)
+ELFModulePtr elffile;
+int index;
+{
+ Elf_Sym *syms;
+ Elf_Addr symval=0; /* value of the indicated symbol */
+ char *symname = NULL; /* name of symbol in relocation */
+ itemPtr symbol; /* name/value of symbol */
+
+ syms=(Elf_Sym *)elffile->saddr[elffile->symndx];
+
+ switch( ELF_ST_TYPE(syms[index].st_info) )
+ {
+ case STT_NOTYPE:
+ case STT_OBJECT:
+ case STT_FUNC:
+ switch( ELF_ST_BIND(syms[index].st_info) )
+ {
+ case STB_GLOBAL:
+ symname=
+ ElfGetString(elffile,syms[index].st_name);
+ symbol=LoaderHashFind(symname);
+ if( symbol == 0 )
+ return 0;
+/*
+ * Here we are building up a pseudo Plt function that can make a call to
+ * a function that has an offset greater than 24 bits. The following code
+ * is being used to implement this.
+
+ 1 00000000 .extern realfunc
+ 2 00000000 .global pltfunc
+ 3 00000000 pltfunc:
+ 4 00000000 3d 80 00 00 lis r12,hi16(realfunc)
+ 5 00000004 61 8c 00 00 ori r12,r12,lo16(realfunc)
+ 6 00000008 7d 89 03 a6 mtctr r12
+ 7 0000000c 4e 80 04 20 bctr
+
+ */
+
+ symbol->code.plt[0]=0x3d80; /* lis r12 */
+ symbol->code.plt[1]=(((Elf_Addr)symbol->address)&0xffff0000)>>16;
+ symbol->code.plt[2]=0x618c; /* ori r12,r12 */
+ symbol->code.plt[3]=(((Elf_Addr)symbol->address)&0xffff);
+ symbol->code.plt[4]=0x7d89; /* mtcr r12 */
+ symbol->code.plt[5]=0x03a6;
+ symbol->code.plt[6]=0x4e80; /* bctr */
+ symbol->code.plt[7]=0x0420;
+ symbol->address=(char *)&symbol->code.plt[0];
+ symval=(Elf_Addr)symbol->address;
+ ppc_flush_icache(&symbol->code.plt[0]);
+ ppc_flush_icache(&symbol->code.plt[6]);
+ break;
+ default:
+ symval=0;
+ ErrorF(
+ "ElfGetPltAddr(), unhandled symbol scope %x\n",
+ ELF_ST_BIND(syms[index].st_info) );
+ break;
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "ElfGetPlt: symbol=%lx\t", symbol );
+ ELFDEBUG( "newval=%lx\t", symval );
+ ELFDEBUG( "name=\"%s\"\n", symname ? symname : "NULL");
+# endif
+ break;
+ case STT_SECTION:
+ case STT_FILE:
+ case STT_LOPROC:
+ case STT_HIPROC:
+ default:
+ symval=0;
+ ErrorF( "ElfGetPltAddr(), Unexpected symbol type %x",
+ ELF_ST_TYPE(syms[index].st_info) );
+ ErrorF( "for a Plt request\n" );
+ break;
+ }
+ return symval;
+}
+#endif /* __powerpc__ */
+
+#if defined(__alpha__) || defined(__ia64__)
+/*
+ * Manage GOT Entries
+ */
+static void
+ElfAddGOT(elffile,rel)
+ELFModulePtr elffile;
+Elf_Rel_t *rel;
+{
+ ELFGotEntryPtr gotent;
+
+# ifdef ELFDEBUG
+ {
+ Elf_Sym *sym;
+
+ sym=(Elf_Sym *)&(elffile->symtab[ELF_R_SYM(rel->r_info)]);
+ if( sym->st_name) {
+ ELFDEBUG("ElfAddGOT: Adding GOT entry for %s\n",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ }
+ else
+ ELFDEBUG("ElfAddGOT: Adding GOT entry for %s\n",
+ ElfGetSectionName(elffile,elffile->sections[sym->st_shndx].sh_name));
+ }
+# endif
+
+ for (gotent=elffile->got_entries;gotent;gotent=gotent->next) {
+ if ( ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) &&
+ gotent->rel->r_addend == rel->r_addend )
+ break;
+ }
+
+ if( gotent ) {
+# ifdef ELFDEBUG
+ ELFDEBUG("Entry already present in GOT\n");
+# endif
+ return;
+ }
+
+ if ((gotent = xf86loadermalloc(sizeof(ELFGotEntryRec))) == NULL) {
+ ErrorF( "ElfAddGOT() Unable to allocate memory!!!!\n" );
+ return;
+ }
+
+# ifdef ELFDEBUG
+ ELFDEBUG("Entry added with offset %x\n",elffile->gotsize);
+# endif
+ gotent->rel=rel;
+ gotent->offset=elffile->gotsize;
+ gotent->next=elffile->got_entries;
+ elffile->got_entries=gotent;
+ elffile->gotsize+=8;
+ return;
+}
+
+static int
+ELFCreateGOT(elffile, maxalign)
+ELFModulePtr elffile;
+int maxalign;
+{
+# ifdef MergeSectionAlloc
+ ELFGotPtr gots;
+# endif
+ int gotsize;
+
+ /*
+ * XXX: Is it REALLY needed to ensure GOT's are non-null?
+ */
+# ifdef ELFDEBUG
+ ELFDEBUG( "ELFCreateGOT: %x entries in the GOT\n", elffile->gotsize/8 );
+
+ /*
+ * Hmmm. Someone is getting here without any got entries, but they
+ * may still have R_ALPHA_GPDISP relocations against the got.
+ */
+ if( elffile->gotsize == 0 )
+ ELFDEBUG( "Module %s doesn't have any GOT entries!\n",
+ _LoaderModuleToName(elffile->module) );
+# endif
+ if( elffile->gotsize == 0 ) elffile->gotsize=8;
+ elffile->sections[elffile->gotndx].sh_size=elffile->gotsize;
+ gotsize = elffile->gotsize;
+
+# ifdef MergeSectionAlloc
+# ifdef __alpha__
+# define GOTDistance 0x100000
+# endif
+# ifdef __ia64__
+# define GOTDistance 0x200000
+# endif
+ for (gots = ELFSharedGOTs; gots; gots = gots->next) {
+ if (gots->freeptr + elffile->gotsize > gots->section + gots->size)
+ continue;
+ if (gots->section > elffile->base) {
+ if (gots->section + gots->size - elffile->base >= GOTDistance)
+ continue;
+ } else {
+ if (elffile->base + elffile->basesize - gots->section >= GOTDistance)
+ continue;
+ }
+ elffile->got = gots->freeptr;
+ elffile->shared_got = gots;
+ gots->freeptr = gots->freeptr + elffile->gotsize;
+ gots->nuses++;
+# ifdef ELFDEBUG
+ ELFDEBUG( "ELFCreateGOT: GOT address %lx in shared GOT, nuses %d\n",
+ elffile->got, gots->nuses );
+# endif
+ return TRUE;
+ }
+
+ gotsize += 16383 + sizeof(ELFGotRec);
+# endif /*MergeSectionAlloc*/
+
+ if ((elffile->got = xf86loadermalloc(gotsize)) == NULL) {
+ ErrorF( "ELFCreateGOT() Unable to allocate memory!!!!\n" );
+ return FALSE;
+ }
+
+# ifdef MergeSectionAlloc
+ if (elffile->got > elffile->base) {
+ if (elffile->got + elffile->gotsize - elffile->base >= GOTDistance)
+ gotsize = 0;
+ } else {
+ if (elffile->base + elffile->basesize - elffile->got >= GOTDistance)
+ gotsize = 0;
+ }
+
+ if (!gotsize) {
+ xf86loaderfree(elffile->got);
+# if !defined(DoMMAPedMerge)
+ elffile->basesize += 8 + elffile->gotsize;
+ elffile->base = xf86loaderrealloc(elffile->base, elffile->basesize);
+ if (elffile->base == NULL) {
+ ErrorF( "ELFCreateGOT() Unable to reallocate memory!!!!\n" );
+ return FALSE;
+ }
+# if defined(linux) && defined(__ia64__) || defined(__OpenBSD__)
+ {
+ unsigned long page_size = getpagesize();
+ unsigned long round;
+
+ round = (unsigned long)elffile->base & (page_size-1);
+ mprotect(elffile->base - round, (elffile->basesize+round+page_size-1) & ~(page_size-1),
+ PROT_READ|PROT_WRITE|PROT_EXEC);
+ }
+# endif
+# else
+ {
+ int oldbasesize = elffile->basesize;
+ elffile->basesize += 8 + elffile->gotsize;
+ MMAP_ALIGN(elffile->basesize);
+ elffile->base = mremap(elffile->base,oldbasesize,
+ elffile->basesize,MREMAP_MAYMOVE);
+ if (elffile->base == NULL) {
+ ErrorF( "ELFCreateGOT() Unable to remap memory!!!!\n" );
+ return FALSE;
+ }
+ }
+# endif
+
+ elffile->baseptr = ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1);
+ elffile->got = (unsigned char *)((long)(elffile->base + elffile->basesize - elffile->gotsize) & ~7);
+ } else {
+ gots = (ELFGotPtr)elffile->got;
+ elffile->got = gots->section;
+ gots->size = gotsize - sizeof(ELFGotRec) + 1;
+ gots->nuses = 1;
+ gots->freeptr = gots->section + elffile->gotsize;
+ gots->next = ELFSharedGOTs;
+ ELFSharedGOTs = gots;
+ elffile->shared_got = gots;
+# ifdef ELFDEBUG
+ ELFDEBUG( "ELFCreateGOT: Created a shareable GOT with size %d\n", gots->size);
+# endif
+ }
+# endif/*MergeSectionAlloc*/
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "ELFCreateGOT: GOT address %lx\n", elffile->got );
+# endif
+
+ return TRUE;
+}
+#endif /* defined(__alpha__) || defined(__ia64__)*/
+
+#if defined(__ia64__)
+/*
+ * Manage OPD Entries
+ */
+static void
+ElfAddOPD(elffile,index,l)
+ELFModulePtr elffile;
+int index;
+LOOKUP *l;
+{
+ ELFOpdPtr opdent;
+
+ if (index != -1) {
+ for (opdent = elffile->opd_entries; opdent; opdent = opdent->next)
+ if (opdent->index == index)
+ return;
+ }
+
+ if ((opdent = xf86loadermalloc(sizeof(ELFOpdRec))) == NULL) {
+ ErrorF( "ElfAddOPD() Unable to allocate memory!!!!\n" );
+ return;
+ }
+
+# ifdef ELFDEBUG
+ ELFDEBUG("OPD Entry %d added with offset %x\n",index,elffile->gotsize);
+# endif
+ opdent->l=l;
+ opdent->index=index;
+ opdent->offset=elffile->gotsize;
+ opdent->next=elffile->opd_entries;
+ elffile->opd_entries=opdent;
+ elffile->gotsize+=16;
+ return ;
+}
+
+static void
+ELFCreateOPD(elffile)
+ELFModulePtr elffile;
+{
+ ELFOpdPtr opdent;
+
+ if (elffile->got == NULL)
+ ErrorF( "ELFCreateOPD() Unallocated GOT!!!!\n" );
+
+ for (opdent = elffile->opd_entries; opdent; opdent = opdent->next) {
+ if (opdent->index != -1)
+ continue;
+ ((unsigned long *)(elffile->got+opdent->offset))[0] = (long)opdent->l->offset;
+ ((unsigned long *)(elffile->got+opdent->offset))[1] = (long)elffile->got;
+ opdent->l->offset = (funcptr)(elffile->got+opdent->offset);
+ }
+}
+
+/*
+ * Manage PLT Entries
+ */
+static void
+ElfAddPLT(elffile,rel)
+ELFModulePtr elffile;
+Elf_Rel_t *rel;
+{
+ ELFPltEntryPtr pltent;
+
+# ifdef ELFDEBUG
+ {
+ Elf_Sym *sym;
+
+ sym=(Elf_Sym *)&(elffile->symtab[ELF_R_SYM(rel->r_info)]);
+ if( sym->st_name) {
+ ELFDEBUG("ElfAddPLT: Adding PLT entry for %s\n",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ }
+ else
+ ErrorF("ElfAddPLT: Add PLT entry for section??\n");
+ }
+# endif
+
+ if (rel->r_addend)
+ ErrorF("ElfAddPLT: Add PLT entry with non-zero addend??\n");
+
+ for (pltent=elffile->plt_entries;pltent;pltent=pltent->next) {
+ if ( ELF_R_SYM(pltent->rel->r_info) == ELF_R_SYM(rel->r_info) )
+ break;
+ }
+
+ if( pltent ) {
+# ifdef ELFDEBUG
+ ELFDEBUG("Entry already present in PLT\n");
+# endif
+ return;
+ }
+
+ if ((pltent = xf86loadermalloc(sizeof(ELFPltEntryRec))) == NULL) {
+ ErrorF( "ElfAddPLT() Unable to allocate memory!!!!\n" );
+ return;
+ }
+
+# ifdef ELFDEBUG
+ ELFDEBUG("Entry added with offset %x\n",elffile->pltsize);
+# endif
+ pltent->rel=rel;
+ pltent->offset=elffile->pltsize;
+ pltent->gotoffset=elffile->gotsize;
+ pltent->next=elffile->plt_entries;
+ elffile->plt_entries=pltent;
+ elffile->pltsize+=32;
+ elffile->gotsize+=16;
+ return ;
+}
+
+static void
+ELFCreatePLT(elffile)
+ELFModulePtr elffile;
+{
+# ifdef ELFDEBUG
+ ELFDEBUG( "ELFCreatePLT: %x entries in the PLT\n", elffile->pltsize/8 );
+# endif
+
+ if( elffile->pltsize == 0 ) return;
+
+ if ((elffile->plt = ELFLoaderSectCalloc(elffile,32,elffile->pltsize)) == NULL) {
+ ErrorF( "ELFCreatePLT() Unable to allocate memory!!!!\n" );
+ return;
+ }
+ elffile->sections[elffile->pltndx].sh_size=elffile->pltsize;
+# ifdef ELFDEBUG
+ ELFDEBUG( "ELFCreatePLT: PLT address %lx\n", elffile->plt );
+# endif
+
+ return;
+}
+
+static void
+IA64InstallReloc(data128, slot, opnd, value)
+unsigned long *data128;
+int slot;
+enum ia64_operand opnd;
+long value;
+{
+ unsigned long data = 0;
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "\nIA64InstallReloc %p %d %d %016lx\n", data128, slot, opnd, value);
+ ELFDEBUG( "Before [%016lx%016lx]\n", data128[1], data128[0]);
+# endif
+ switch (slot) {
+ case 0: data = *data128; break;
+ case 1: memcpy(&data, (char *)data128 + 5, 8); break;
+ case 2: memcpy(&data, (char *)data128 + 10, 6); break;
+ default: FatalError("Unexpected slot in IA64InstallReloc()\n");
+ }
+ switch (opnd) {
+ case IA64_OPND_IMM22:
+ data &= ~(0x3fff9fc0000UL << slot);
+ data |= (value & 0x7f) << (18 + slot); /* [13:19] + 5 + slot */
+ data |= (value & 0xff80) << (25 + slot); /* [27:35] + 5 + slot */
+ data |= (value & 0x1f0000) << (11 + slot); /* [22:26] + 5 + slot */
+ data |= (value & 0x200000) << (20 + slot); /* [36:36] + 5 + slot */
+ if (value << 42 >> 42 != value)
+ ErrorF("Relocation %016lx truncated to fit into IMM22\n", value);
+ break;
+ case IA64_OPND_TGT25C:
+ data &= ~(0x23ffffc0000UL << slot);
+ data |= (value & 0xfffff0) << (14 + slot); /* [13:32] + 5 + slot */
+ data |= (value & 0x1000000) << (17 + slot); /* [36:36] + 5 + slot */
+ if (value << 39 >> 39 != value || (value & 0xf))
+ ErrorF("Relocation %016lx truncated to fit into TGT25C\n", value);
+ break;
+ default:
+ FatalError("Unhandled operand in IA64InstallReloc()\n");
+ }
+ switch (slot) {
+ case 0: *data128 = data; break;
+ case 1: memcpy((char *)data128 + 5, &data, 8); break;
+ case 2: memcpy((char *)data128 + 10, &data, 6); break;
+ default: FatalError("Unexpected slot in IA64InstallReloc()\n");
+ }
+ ia64_flush_cache(data128);
+# ifdef ELFDEBUG
+ ELFDEBUG( "After [%016lx%016lx]\n", data128[1], data128[0]);
+# endif
+}
+
+#endif /*__ia64__*/
+
+/*
+ * Fix all of the relocations for the given section.
+ * If the argument 'force' is non-zero, then the relocation will be
+ * made even if the symbol can't be found (by substituting
+ * LoaderDefaultFunc) otherwise, the relocation will be deferred.
+ */
+
+static ELFRelocPtr
+Elf_RelocateEntry(elffile, secn, rel, force)
+ELFModulePtr elffile;
+Elf_Word secn;
+Elf_Rel_t *rel;
+int force;
+{
+ unsigned char *secp = elffile->saddr[secn];
+#if !defined(__ia64__)
+ unsigned int *dest32; /* address of the 32 bit place being modified */
+#endif
+#if defined(__powerpc__) || defined(__sparc__)
+ unsigned short *dest16; /* address of the 16 bit place being modified */
+#endif
+#if defined(__sparc__)
+ unsigned char *dest8; /* address of the 8 bit place being modified */
+#endif
+#if defined(__alpha__)
+ unsigned int *dest32h; /* address of the high 32 bit place being modified */
+ unsigned long *dest64;
+ unsigned short *dest16;
+#endif
+#if defined(__x86_64__)
+ unsigned long *dest64;
+ int *dest32s;
+#endif
+#if defined(__ia64__)
+ unsigned long *dest64;
+ unsigned long *dest128;
+#endif
+ Elf_Addr symval = 0; /* value of the indicated symbol */
+
+#ifdef ELFDEBUG
+ ELFDEBUG( "%lx %d %d\n", rel->r_offset,
+ ELF_R_SYM(rel->r_info), ELF_R_TYPE(rel->r_info) );
+# if defined(__powerpc__) || \
+ defined(__mc68000__) || \
+ defined(__alpha__) || \
+ defined(__sparc__) || \
+ defined(__ia64__) || \
+ defined(__x86_64__)
+ ELFDEBUG( "%lx", rel->r_addend );
+# endif
+ ELFDEBUG("\n");
+#endif /*ELFDEBUG*/
+#if defined(__alpha__)
+ if (ELF_R_SYM(rel->r_info) && ELF_R_TYPE(rel->r_info) != R_ALPHA_GPDISP)
+#else
+ if (ELF_R_SYM(rel->r_info))
+#endif
+ {
+ symval = ElfGetSymbolValue(elffile, ELF_R_SYM(rel->r_info));
+ if (symval == 0) {
+ if (force) {
+ symval = (Elf_Addr) &LoaderDefaultFunc;
+ } else {
+#ifdef ELFDEBUG
+ ELFDEBUG("***Unable to resolve symbol %s\n",
+ ElfGetSymbolName(elffile, ELF_R_SYM(rel->r_info)));
+#endif
+ return ElfDelayRelocation(elffile, secn, rel);
+ }
+ }
+ }
+
+ switch( ELF_R_TYPE(rel->r_info) )
+ {
+#if defined(i386)
+ case R_386_32:
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_386_32\t");
+ ELFDEBUG( "dest32=%x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8lx\t", *dest32 );
+# endif
+ *dest32=symval+(*dest32); /* S + A */
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+# endif
+ break;
+ case R_386_PC32:
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_386_PC32 %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest32=%x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8lx\t", *dest32 );
+# endif
+
+ *dest32=symval+(*dest32)-(Elf_Addr)dest32; /* S + A - P */
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+# endif
+
+ break;
+#endif /* i386 */
+#if defined(__x86_64__)
+ case R_X86_64_32:
+ dest32=(unsigned int *)(secp+rel->r_offset );
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_X86_32\t");
+ ELFDEBUG( "dest32=%x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8lx\t", *dest32 );
+ ELFDEBUG( "r_addend=%lx\t", rel->r_addend);
+# endif
+ *dest32=symval + rel->r_addend + (*dest32); /* S + A */
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+# endif
+ break;
+ case R_X86_64_32S:
+ dest32s=(int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_X86_64_32\t");
+ ELFDEBUG( "dest32s=%x\t", dest32s );
+ ELFDEBUG( "*dest32s=%8.8lx\t", *dest32s );
+ ELFDEBUG( "r_addend=%lx\t", rel->r_addend);
+# endif
+ *dest32s=symval + rel->r_addend + (*dest32s); /* S + A */
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32s=%8.8lx\n", *dest32s );
+# endif
+ break;
+ case R_X86_64_PC32:
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_X86_64_PC32 %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest32=%x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8lx\t", *dest32 );
+ ELFDEBUG( "r_addend=%lx\t", rel->r_addend);
+# endif
+ *dest32 = symval + rel->r_addend + (*dest32)-(Elf_Addr)dest32; /* S + A - P */
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+# endif
+ break;
+ case R_X86_64_64:
+ dest64=(unsigned long *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_x86_64_64\t");
+ ELFDEBUG( "dest64=%x\t", dest64 );
+ ELFDEBUG( "*dest64=%8.8lx\t", *dest64 );
+ ELFDEBUG( "r_addend=%lx\t", rel->r_addend);
+# endif
+ *dest64=symval + rel->r_addend + (*dest64); /* S + A */
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest64=%8.8lx\n", *dest64 );
+# endif
+ break;
+#endif /* __x86_64__ */
+#if defined(__alpha__)
+ case R_ALPHA_NONE:
+ case R_ALPHA_LITUSE:
+ break;
+
+ case R_ALPHA_REFQUAD:
+ dest64=(unsigned long *)(secp+rel->r_offset);
+ symval=ElfGetSymbolValue(elffile,
+ ELF_R_SYM(rel->r_info));
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_ALPHA_REFQUAD\t");
+ ELFDEBUG( "dest64=%lx\t", dest64 );
+ ELFDEBUG( "*dest64=%8.8lx\t", *dest64 );
+# endif
+ *dest64=symval+rel->r_addend+(*dest64); /* S + A + P */
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest64=%8.8lx\n", *dest64 );
+# endif
+ break;
+
+ case R_ALPHA_GPREL32:
+ {
+ dest64=(unsigned long *)(secp+rel->r_offset);
+ dest32=(unsigned int *)dest64;
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_ALPHA_GPREL32 %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest32=%lx\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\t", *dest32 );
+# endif
+ symval += rel->r_addend;
+ symval = ((unsigned char *)symval)-((unsigned char *)elffile->got);
+# ifdef ELFDEBUG
+ ELFDEBUG( "symval=%lx\t", symval );
+# endif
+ if( (symval&0xffffffff00000000) != 0x0000000000000000 &&
+ (symval&0xffffffff00000000) != 0xffffffff00000000 ) {
+ FatalError("R_ALPHA_GPREL32 symval-got is too large for %s\n",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)));
+ }
+
+ *dest32=symval;
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%x\n", *dest32 );
+# endif
+ break;
+ }
+
+ case R_ALPHA_GPRELLOW:
+ {
+ dest64=(unsigned long *)(secp+rel->r_offset);
+ dest16=(unsigned short *)dest64;
+
+ symval += rel->r_addend;
+ symval = ((unsigned char *)symval)-((unsigned char *)elffile->got);
+
+ *dest16=symval;
+ break;
+ }
+
+ case R_ALPHA_GPRELHIGH:
+ {
+ dest64=(unsigned long *)(secp+rel->r_offset);
+ dest16=(unsigned short *)dest64;
+
+ symval += rel->r_addend;
+ symval = ((unsigned char *)symval)-((unsigned char *)elffile->got);
+ symval = ((long)symval >> 16) + ((symval >> 15) & 1);
+ if( (long)symval > 0x7fff || (long)symval < -(long)0x8000 ) {
+ FatalError("R_ALPHA_GPRELHIGH symval-got is too large for %s:%lx\n",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)),symval);
+ }
+
+ *dest16=symval;
+ break;
+ }
+
+ case R_ALPHA_LITERAL:
+ {
+ ELFGotEntryPtr gotent;
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_ALPHA_LITERAL %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest32=%lx\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\t", *dest32 );
+# endif
+
+ for (gotent=elffile->got_entries;gotent;gotent=gotent->next) {
+ if ( ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) &&
+ gotent->rel->r_addend == rel->r_addend )
+ break;
+ }
+
+ /* Set the address in the GOT */
+ if( gotent ) {
+ *(unsigned long *)(elffile->got+gotent->offset) =
+ symval+rel->r_addend;
+# ifdef ELFDEBUG
+ ELFDEBUG("Setting gotent[%x]=%lx\t",
+ gotent->offset, symval+rel->r_addend);
+# endif
+ if ((gotent->offset & 0xffff0000) != 0)
+ FatalError("\nR_ALPHA_LITERAL offset %x too large\n",
+ gotent->offset);
+ (*dest32)|=(gotent->offset); /* The address part is always 0 */
+ }
+ else {
+ unsigned long val;
+
+ /* S + A - P >> 2 */
+ val=((symval+(rel->r_addend)-(Elf_Addr)dest32));
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A-P=%x\t",val);
+# endif
+ if( (val & 0xffff0000) != 0xffff0000 &&
+ (val & 0xffff0000) != 0x00000000 ) {
+ ErrorF("\nR_ALPHA_LITERAL offset %x too large\n", val);
+ break;
+ }
+ val &= 0x0000ffff;
+ (*dest32)|=(val); /* The address part is always 0 */
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+
+ break;
+ }
+
+ case R_ALPHA_GPDISP:
+ {
+ long offset;
+
+ dest32h=(unsigned int *)(secp+rel->r_offset);
+ dest32=(unsigned int *)((secp+rel->r_offset)+rel->r_addend);
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_ALPHA_GPDISP %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "got=%lx\t", elffile->got );
+ ELFDEBUG( "dest32=%lx\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\t", *dest32 );
+ ELFDEBUG( "dest32h=%lx\t", dest32h );
+ ELFDEBUG( "*dest32h=%8.8x\t", *dest32h );
+# endif
+ if ((*dest32h >> 26) != 9 || (*dest32 >> 26) != 8) {
+ ErrorF( "***Bad instructions in relocating %s\n",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ }
+
+ symval = (*dest32h & 0xffff) << 16 | (*dest32 & 0xffff);
+ symval = (symval ^ 0x80008000) - 0x80008000;
+
+ offset = ((unsigned char *)elffile->got - (unsigned char *)dest32h);
+# ifdef ELFDEBUG
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "got-dest32=%lx\t", offset );
+# endif
+
+ if( (offset >= 0x7fff8000L) || (offset < -0x80000000L) ) {
+ FatalError( "Offset overflow for R_ALPHA_GPDISP\n");
+ }
+
+ symval += (unsigned long)offset;
+# ifdef ELFDEBUG
+ ELFDEBUG( "symval=%lx\t", symval );
+# endif
+ *dest32=(*dest32&0xffff0000) | (symval&0xffff);
+ *dest32h=(*dest32h&0xffff0000)|
+ (((symval>>16)+((symval>>15)&1))&0xffff);
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\t", *dest32 );
+ ELFDEBUG( "*dest32h=%8.8x\n", *dest32h );
+# endif
+ break;
+ }
+
+ case R_ALPHA_HINT:
+ dest32=(unsigned int *)((secp+rel->r_offset)+rel->r_addend);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_ALPHA_HINT %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest32=%lx\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\t", *dest32 );
+# endif
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "symval=%lx\t", symval );
+# endif
+ symval -= (Elf_Addr)(((unsigned char *)dest32)+4);
+ if (symval % 4 ) {
+ ErrorF( "R_ALPHA_HINT bad alignment of offset\n");
+ }
+ symval=symval>>2;
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "symval=%lx\t", symval );
+# endif
+
+ if( symval & 0xffff8000 ) {
+# ifdef ELFDEBUG
+ ELFDEBUG("R_ALPHA_HINT symval too large\n" );
+# endif
+ }
+
+ *dest32 = (*dest32&~0x3fff) | (symval&0x3fff);
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+
+ case R_ALPHA_GPREL16:
+ {
+ dest64=(unsigned long *)(secp+rel->r_offset);
+ dest16=(unsigned short *)dest64;
+
+ symval += rel->r_addend;
+ symval = ((unsigned char *)symval)-((unsigned char *)elffile->got);
+ if( (long)symval > 0x7fff ||
+ (long)symval < -(long)0x8000 ) {
+ FatalError("R_ALPHA_GPREL16 symval-got is too large for %s:%lx\n",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)),symval);
+ }
+
+ *dest16=symval;
+ break;
+ }
+
+#endif /* alpha */
+#if defined(__mc68000__)
+ case R_68K_32:
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_68K_32\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned long val;
+ /* S + A */
+ val=symval+(rel->r_addend);
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A=%x\t",val);
+# endif
+ *dest32=val; /* S + A */
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_68K_PC32:
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_68K_PC32\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned long val;
+ /* S + A - P */
+ val=symval+(rel->r_addend);
+ val-=*dest32;
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A=%x\t",val);
+ ELFDEBUG("S+A-P=%x\t",val+(*dest32)-(Elf_Addr)dest32);
+# endif
+ *dest32=val+(*dest32)-(Elf_Addr)dest32; /* S + A - P */
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+#endif /* __mc68000__ */
+#if defined(__powerpc__)
+# if defined(PowerMAX_OS)
+ case R_PPC_DISP24: /* 11 */
+ dest32=(unsigned long *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_DISP24 %s\t", ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "dest32=%x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\t", *dest32 );
+# endif
+
+ {
+ unsigned long val;
+
+ /* S + A - P >> 2 */
+ val=((symval+(rel->r_addend)-(Elf_Addr)dest32));
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A-P=%x\t",val);
+# endif
+ val = val>>2;
+ if( (val & 0x3f000000) != 0x3f000000 &&
+ (val & 0x3f000000) != 0x00000000 ) {
+# ifdef ELFDEBUG
+ ELFDEBUG("R_PPC_DISP24 offset %x too large\n", val<<2);
+# endif
+ symval = ElfGetPltAddr(elffile,ELF_R_SYM(rel->r_info));
+ val=((symval+(rel->r_addend)-(Elf_Addr)dest32));
+# ifdef ELFDEBUG
+ ELFDEBUG("PLT offset is %x\n", val);
+# endif
+ val=val>>2;
+ if( (val & 0x3f000000) != 0x3f000000 &&
+ (val & 0x3f000000) != 0x00000000 )
+ FatalError("R_PPC_DISP24 PLT offset %x too large\n", val<<2);
+ }
+ val &= 0x00ffffff;
+ (*dest32)|=(val<<2); /* The address part is always 0 */
+ ppc_flush_icache(dest32);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_16HU: /* 31 */
+ dest16=(unsigned short *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ dest32=(unsigned long *)(dest16-1);
+
+# endif
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_16HU\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest16=%x\t", dest16 );
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned short val;
+ /* S + A */
+ val=((symval+(rel->r_addend))&0xffff0000)>>16;
+# ifdef ELFDEBUG
+ ELFDEBUG("uhi16(S+A)=%x\t",val);
+# endif
+ *dest16=val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_32: /* 32 */
+ dest32=(unsigned long *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_32\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned long val;
+ /* S + A */
+ val=symval+(rel->r_addend);
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A=%x\t",val);
+# endif
+ *dest32=val; /* S + A */
+ ppc_flush_icache(dest32);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_32UA: /* 33 */
+ dest32=(unsigned long *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_32UA\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned long val;
+ unsigned char *dest8 = (unsigned char *)dest32;
+ /* S + A */
+ val=symval+(rel->r_addend);
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A=%x\t",val);
+# endif
+ *dest8++=(val&0xff000000)>>24;
+ *dest8++=(val&0x00ff0000)>>16;
+ *dest8++=(val&0x0000ff00)>> 8;
+ *dest8++=(val&0x000000ff);
+ ppc_flush_icache(dest32);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_16H: /* 34 */
+ dest16=(unsigned short *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ dest32=(unsigned long *)(dest16-1);
+# endif
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_16H\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symbol=%s\t", ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest16=%x\t", dest16 );
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned short val;
+ unsigned short loval;
+ /* S + A */
+ val=((symval+(rel->r_addend))&0xffff0000)>>16;
+ loval=(symval+(rel->r_addend))&0xffff;
+ if( loval & 0x8000 ) {
+ /*
+ * This is hi16(), instead of uhi16(). Because of this,
+ * if the lo16() will produce a negative offset, then
+ * we have to increment this part of the address to get
+ * the correct final result.
+ */
+ val++;
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG("hi16(S+A)=%x\t",val);
+# endif
+ *dest16=val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_16L: /* 35 */
+ dest16=(unsigned short *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ dest32=(unsigned long *)(dest16-1);
+# endif
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_16L\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest16=%x\t", dest16 );
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned short val;
+ /* S + A */
+ val=(symval+(rel->r_addend))&0xffff;
+# ifdef ELFDEBUG
+ ELFDEBUG("lo16(S+A)=%x\t",val);
+# endif
+ *dest16=val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+# else /* PowerMAX_OS */
+ /* Linux PPC */
+ case R_PPC_ADDR32: /* 1 */
+ dest32=(unsigned int *)(secp+rel->r_offset);
+ symval=ElfGetSymbolValue(elffile,ELF_R_SYM(rel->r_info));
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_ADDR32\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned long val;
+ /* S + A */
+ val=symval+(rel->r_addend);
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A=%x\t",val);
+# endif
+ *dest32=val; /* S + A */
+ ppc_flush_icache(dest32);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_ADDR16_LO: /* 4 */
+ dest16=(unsigned short *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ dest32=(unsigned long *)(dest16-1);
+# endif
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_ADDR16_LO\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest16=%x\t", dest16 );
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+# endif
+ {
+ unsigned short val;
+ /* S + A */
+ val=(symval+(rel->r_addend))&0xffff;
+# ifdef ELFDEBUG
+ ELFDEBUG("lo16(S+A)=%x\t",val);
+# endif
+ *dest16=val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_ADDR16_HA: /* 6 */
+ dest16=(unsigned short *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ dest32=(unsigned long *)(dest16-1);
+# endif
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_ADDR16_HA\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest16=%x\t", dest16 );
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+# endif
+ {
+ unsigned short val;
+ unsigned short loval;
+ /* S + A */
+ val=((symval+(rel->r_addend))&0xffff0000)>>16;
+ loval=(symval+(rel->r_addend))&0xffff;
+ if( loval & 0x8000 ) {
+ /*
+ * This is hi16(), instead of uhi16(). Because of this,
+ * if the lo16() will produce a negative offset, then
+ * we have to increment this part of the address to get
+ * the correct final result.
+ */
+ val++;
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG("hi16(S+A)=%x\t",val);
+# endif
+ *dest16=val; /* S + A */
+ ppc_flush_icache(dest16);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest16=%8.8x\t", *dest16 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_REL24: /* 10 */
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_REL24 %s\t", ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "dest32=%x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\t", *dest32 );
+# endif
+
+ {
+ unsigned long val;
+
+ /* S + A - P >> 2 */
+ val=((symval+(rel->r_addend)-(Elf_Addr)dest32));
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A-P=%x\t",val);
+# endif
+ val = val>>2;
+ if( (val & 0x3f000000) != 0x3f000000 &&
+ (val & 0x3f000000) != 0x00000000 ) {
+# ifdef ELFDEBUG
+ ELFDEBUG("R_PPC_REL24 offset %x too large\n", val<<2);
+# endif
+ symval = ElfGetPltAddr(elffile,ELF_R_SYM(rel->r_info));
+ val=((symval+(rel->r_addend)-(Elf_Addr)dest32));
+# ifdef ELFDEBUG
+ ELFDEBUG("PLT offset is %x\n", val);
+# endif
+ val=val>>2;
+ if( (val & 0x3f000000) != 0x3f000000 &&
+ (val & 0x3f000000) != 0x00000000 )
+ FatalError("R_PPC_REL24 PLT offset %x too large\n", val<<2);
+ }
+ val &= 0x00ffffff;
+ (*dest32)|=(val<<2); /* The address part is always 0 */
+ ppc_flush_icache(dest32);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+ case R_PPC_REL32: /* 26 */
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_PPC_REL32\t" );
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%x\t", symval );
+ ELFDEBUG( "r_addend=%x\t", rel->r_addend );
+ ELFDEBUG( "dest32=%8.8x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ {
+ unsigned long val;
+ /* S + A - P */
+ val=symval+(rel->r_addend);
+ val-=*dest32;
+# ifdef ELFDEBUG
+ ELFDEBUG("S+A=%x\t",val);
+ ELFDEBUG("S+A-P=%x\t",val+(*dest32)-(Elf_Addr)dest32);
+# endif
+ *dest32=val+(*dest32)-(Elf_Addr)dest32; /* S + A - P */
+ ppc_flush_icache(dest32);
+ }
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8x\n", *dest32 );
+# endif
+ break;
+# endif /* PowerMAX_OS */
+#endif /* __powerpc__ */
+#ifdef __sparc__
+ case R_SPARC_NONE: /* 0 */
+ break;
+
+ case R_SPARC_8: /* 1 */
+ dest8 = (unsigned char *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest8 = symval;
+ break;
+
+ case R_SPARC_16: /* 2 */
+ dest16 = (unsigned short *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest16 = symval;
+ break;
+
+ case R_SPARC_32: /* 3 */
+ case R_SPARC_GLOB_DAT: /* 20 */
+ case R_SPARC_UA32: /* 23 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ ((unsigned char *)dest32)[0] = (unsigned char)(symval >> 24);
+ ((unsigned char *)dest32)[1] = (unsigned char)(symval >> 16);
+ ((unsigned char *)dest32)[2] = (unsigned char)(symval >> 8);
+ ((unsigned char *)dest32)[3] = (unsigned char)(symval );
+ break;
+
+ case R_SPARC_DISP8: /* 4 */
+ dest8 = (unsigned char *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest8 = (symval - (Elf32_Addr) dest8);
+ break;
+
+ case R_SPARC_DISP16: /* 5 */
+ dest16 = (unsigned short *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest16 = (symval - (Elf32_Addr) dest16);
+ break;
+
+ case R_SPARC_DISP32: /* 6 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = (symval - (Elf32_Addr) dest32);
+ break;
+
+ case R_SPARC_WDISP30: /* 7 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = ((*dest32 & 0xc0000000) |
+ ((symval - (Elf32_Addr) dest32) >> 2));
+ break;
+
+ case R_SPARC_HI22: /* 9 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = (*dest32 & 0xffc00000) | (symval >> 10);
+ break;
+
+ case R_SPARC_LO10: /* 12 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ symval += rel->r_addend;
+ *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff);
+ break;
+
+ case R_SPARC_COPY: /* 19 */
+ /* Fix your code... I'd rather dish out an error here
+ * so people will not link together PIC and non-PIC
+ * code into a final driver object file.
+ */
+ ErrorF("Elf_RelocateEntry():"
+ " Copy relocs not supported on Sparc.\n");
+ break;
+
+ case R_SPARC_JMP_SLOT: /* 21 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ /* Before we change it the PLT entry looks like:
+ *
+ * pltent: sethi %hi(rela_plt_offset), %g1
+ * b,a PLT0
+ * nop
+ *
+ * We change it into:
+ *
+ * pltent: sethi %hi(rela_plt_offset), %g1
+ * sethi %hi(symval), %g1
+ * jmp %g1 + %lo(symval), %g0
+ */
+ symval += rel->r_addend;
+ dest32[2] = 0x81c06000 | (symval & 0x3ff);
+ __asm __volatile("flush %0 + 0x8" : : "r" (dest32));
+ dest32[1] = 0x03000000 | (symval >> 10);
+ __asm __volatile("flush %0 + 0x4" : : "r" (dest32));
+ break;
+
+ case R_SPARC_RELATIVE: /* 22 */
+ dest32 = (unsigned int *)(secp + rel->r_offset);
+ *dest32 += (unsigned int)secp + rel->r_addend;
+ break;
+#endif /*__sparc__*/
+#ifdef __ia64__
+ case R_IA64_NONE:
+ break;
+
+ case R_IA64_LTOFF_FPTR22:
+ if (rel->r_addend)
+ FatalError("\nAddend for R_IA64_LTOFF_FPTR22 not supported\n");
+# ifdef ELFDEBUG
+ ELFDEBUG( "opd=%016lx.%016lx\n",
+ ((long *)symval)[0], ((long *)symval)[1] );
+# endif
+ /* FALLTHROUGH */
+ case R_IA64_LTOFF22:
+ {
+ ELFGotEntryPtr gotent;
+ dest128=(unsigned long *)(secp+(rel->r_offset&~3));
+# ifdef ELFDEBUG
+ ELFDEBUG( "%s %s\t", ELF_R_TYPE(rel->r_info) == R_IA64_LTOFF22 ?
+ "R_IA64_LTOFF22" : "R_IA64_LTOFF_FPTR22",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest128=%lx\t", dest128 );
+ ELFDEBUG( "slot=%d\n", rel->r_offset & 3);
+ ELFDEBUG( "*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]);
+# endif
+
+ for (gotent=elffile->got_entries;gotent;gotent=gotent->next) {
+ if ( ELF_R_SYM(gotent->rel->r_info) == ELF_R_SYM(rel->r_info) &&
+ gotent->rel->r_addend == rel->r_addend )
+ break;
+ }
+
+ /* Set the address in the GOT */
+ if( gotent ) {
+ *(unsigned long *)(elffile->got+gotent->offset) =
+ symval+rel->r_addend;
+# ifdef ELFDEBUG
+ ELFDEBUG("Setting gotent[%x]=%lx\n",
+ gotent->offset, symval+rel->r_addend);
+# endif
+ if ((gotent->offset & 0xffe00000) != 0)
+ FatalError("\nR_IA64_LTOFF22 offset %x too large\n",
+ gotent->offset);
+ IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22, gotent->offset);
+ }
+ else
+ FatalError("\nCould not find GOT entry\n");
+ }
+ break;
+
+ case R_IA64_PCREL21B:
+ {
+ ELFPltEntryPtr pltent;
+ dest128=(unsigned long *)(secp+(rel->r_offset&~3));
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_IA64_PCREL21B %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "opd=%lx.%lx\t", ((long *)symval)[0], ((long *)symval)[1]);
+ ELFDEBUG( "dest128=%lx\t", dest128 );
+ ELFDEBUG( "slot=%d\n", rel->r_offset & 3);
+ ELFDEBUG( "*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]);
+# endif
+ if (rel->r_addend)
+ FatalError("\nAddend for PCREL21B not supported\n");
+ if (((long *)symval)[1] == (long)elffile->got
+ && (((unsigned long)dest128 - ((unsigned long *)symval)[0]) + 0x2000000 < 0x4000000)) {
+ /* We can save the travel through PLT */
+ IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_TGT25C,
+ ((unsigned long *)symval)[0] - (unsigned long)dest128);
+ break;
+ }
+ for (pltent=elffile->plt_entries;pltent;pltent=pltent->next) {
+ if ( ELF_R_SYM(pltent->rel->r_info) == ELF_R_SYM(rel->r_info) &&
+ pltent->rel->r_addend == rel->r_addend )
+ break;
+ }
+
+ /* Set the address in the PLT */
+ if (pltent == NULL)
+ FatalError("\nCould not find PLT entry\n");
+ else {
+ unsigned long *p = (unsigned long *)(elffile->plt+pltent->offset);
+ unsigned long r = (unsigned long)symval - (unsigned long)elffile->got;
+
+ if (r + 0x200000 >= 0x400000) {
+ /* Too far from gp to use the official function descriptor,
+ * so we have to make a local one.
+ */
+ r = pltent->gotoffset;
+ memcpy(elffile->got+r, (char *)symval, 16);
+ }
+
+ /* [MMI] addl r15=NNN,r1;; ld8 r16=[r15],8; mov r14=r1;; */
+ p[0] = 0x410024000200780bUL;
+ p[1] = 0x84000801c028303cUL;
+ /* [MIB] ld8 r1=[r15]; mov b6=r16; br.few b6;; */
+ p[2] = 0x806010181e000811UL;
+ p[3] = 0x0080006000038004UL;
+ IA64InstallReloc(p, 0, IA64_OPND_IMM22, r);
+ IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_TGT25C,
+ (unsigned long)p - (unsigned long)dest128);
+ }
+ }
+ break;
+
+ case R_IA64_FPTR64LSB:
+ dest64=(unsigned long *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_IA64_FPTR64LSB %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest64=%lx\t", dest64 );
+ ELFDEBUG( "opd=%016lx.%016lx\n", ((long *)symval)[0], ((long *)symval)[1] );
+# endif
+
+ if (rel->r_addend)
+ FatalError("\nAddend not supported for R_IA64_FPTR64LSB\n");
+ *dest64 = symval;
+ ia64_flush_cache(dest64);
+ break;
+
+ case R_IA64_DIR64LSB:
+ dest64=(unsigned long *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_IA64_DIR64LSB %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest64=%lx\n", dest64 );
+# endif
+ *dest64 = symval + rel->r_addend;
+ ia64_flush_cache(dest64);
+ break;
+
+ case R_IA64_PCREL64LSB:
+ dest64=(unsigned long *)(secp+rel->r_offset);
+#ifdef ELFDEBUG
+ ELFDEBUG( "R_IA64_PCREL64LSB %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest64=%lx\n", dest64 );
+#endif
+ *dest64 = symval + rel->r_addend - (unsigned long)dest64;
+ break;
+
+ case R_IA64_GPREL22:
+ dest128=(unsigned long *)(secp+(rel->r_offset&~3));
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_IA64_GPREL22 %s\t",
+ ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ ELFDEBUG( "secp=%lx\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest128=%lx\t", dest128 );
+ ELFDEBUG( "slot=%d\n", rel->r_offset & 3);
+ ELFDEBUG( "*dest128=[%016lx%016lx]\n", dest128[1], dest128[0]);
+# endif
+ IA64InstallReloc(dest128, rel->r_offset & 3, IA64_OPND_IMM22,
+ symval + rel->r_addend - (long)elffile->got);
+ break;
+
+#endif /*__ia64__*/
+
+#if defined(__arm__)
+ case R_ARM_ABS32:
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ ELFDEBUG( "R_ARM_ABS32\t");
+ ELFDEBUG( "dest32=%x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8lx\t", *dest32 );
+# endif
+ *dest32=symval+(*dest32); /* S + A */
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+# endif
+ break;
+
+ case R_ARM_REL32:
+ dest32=(unsigned int *)(secp+rel->r_offset);
+# ifdef ELFDEBUG
+ {
+ char *namestr;
+ ELFDEBUG( "R_ARM_REL32 %s\t",
+ namestr=ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)) );
+ xf86loaderfree(namestr);
+ ELFDEBUG( "secp=%x\t", secp );
+ ELFDEBUG( "symval=%lx\t", symval );
+ ELFDEBUG( "dest32=%x\t", dest32 );
+ ELFDEBUG( "*dest32=%8.8lx\t", *dest32 );
+ }
+# endif
+
+ *dest32=symval+(*dest32)-(Elf_Addr)dest32; /* S + A - P */
+
+# ifdef ELFDEBUG
+ ELFDEBUG( "*dest32=%8.8lx\n", *dest32 );
+# endif
+
+ break;
+
+ case R_ARM_PC24:
+ {
+ unsigned long val;
+ dest32=(unsigned int *)(secp+rel->r_offset);
+ val = (*dest32 & 0x00ffffff) << 2;
+ val = symval - (unsigned long)dest32 + val;
+ val >>= 2;
+ *dest32 = (*dest32 & 0xff000000) | (val & 0x00ffffff);
+#ifdef NOTYET
+ arm_flush_cache(dest32);
+#endif
+ }
+ break;
+
+#endif /* (__arm__) */
+
+ default:
+ ErrorF("Elf_RelocateEntry() Unsupported relocation type %d\n",
+ ELF_R_TYPE(rel->r_info));
+ break;
+ }
+ return 0;
+}
+
+static ELFRelocPtr
+ELFCollectRelocations(elffile, index)
+ELFModulePtr elffile;
+int index; /* The section to use as relocation data */
+{
+ int i, numrel;
+ Elf_Shdr *sect=&(elffile->sections[index]);
+ Elf_Rel_t *rel=(Elf_Rel_t *)elffile->saddr[index];
+ Elf_Sym *syms;
+ ELFRelocPtr reloc_head = NULL;
+ ELFRelocPtr tmp;
+
+ syms = (Elf_Sym *) elffile->saddr[elffile->symndx];
+
+ numrel=sect->sh_size/sect->sh_entsize;
+
+ for(i=0; i<numrel; i++ ) {
+#if defined(__alpha__)
+ if( ELF_R_TYPE(rel[i].r_info) == R_ALPHA_LITERAL) {
+ ElfAddGOT(elffile,&rel[i]);
+ }
+#endif
+#if defined(__ia64__)
+ if (ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF22
+ || ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF_FPTR22) {
+ ElfAddGOT(elffile,&rel[i]);
+ }
+ if (ELF_R_TYPE(rel[i].r_info) == R_IA64_PCREL21B) {
+ ElfAddPLT(elffile,&rel[i]);
+ }
+ if (ELF_R_TYPE(rel[i].r_info) == R_IA64_LTOFF_FPTR22
+ || ELF_R_TYPE(rel[i].r_info) == R_IA64_FPTR64LSB) {
+ if (ELF_ST_BIND(syms[ELF_R_SYM(rel[i].r_info)].st_info) == STB_LOCAL) {
+ ElfAddOPD(elffile, ELF_R_SYM(rel[i].r_info), NULL);
+ }
+ }
+#endif
+ tmp = ElfDelayRelocation(elffile, sect->sh_info, &(rel[i]));
+ tmp->next = reloc_head;
+ reloc_head = tmp;
+ }
+
+ return reloc_head;
+}
+
+/*
+ * ELF_GetSymbols()
+ *
+ * add the symbols to the symbol table maintained by the loader.
+ */
+
+static LOOKUP *
+ELF_GetSymbols(elffile, psecttable)
+ELFModulePtr elffile;
+unsigned short **psecttable;
+{
+ Elf_Sym *syms;
+ Elf_Shdr *sect;
+ int i, l, numsyms;
+ LOOKUP *lookup, *p;
+ ELFCommonPtr tmp;
+ unsigned short *secttable;
+
+ syms=elffile->symtab;
+ sect=&(elffile->sections[elffile->symndx]);
+ numsyms=sect->sh_size/sect->sh_entsize;
+
+ if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL)
+ return 0;
+
+ if ((secttable = xf86loadercalloc(sizeof(unsigned short),(numsyms+1))) == NULL) {
+ xf86loaderfree(lookup);
+ return 0;
+ }
+ *psecttable = secttable;
+
+ for(i=0,l=0; i<numsyms; i++)
+ {
+#ifdef ELFDEBUG
+ ELFDEBUG("value=%lx\tsize=%lx\tBIND=%x\tTYPE=%x\tndx=%x\t%s\n",
+ syms[i].st_value,syms[i].st_size,
+ ELF_ST_BIND(syms[i].st_info),ELF_ST_TYPE(syms[i].st_info),
+ syms[i].st_shndx,ElfGetString(elffile,syms[i].st_name) );
+#endif
+
+ if( ELF_ST_BIND(syms[i].st_info) == STB_LOCAL )
+ /* Don't add static symbols to the symbol table */
+ continue;
+
+ switch( ELF_ST_TYPE(syms[i].st_info) )
+ {
+ case STT_OBJECT:
+ case STT_FUNC:
+ case STT_SECTION:
+ case STT_NOTYPE:
+ switch(syms[i].st_shndx)
+ {
+ case SHN_ABS:
+ ErrorF("ELF_GetSymbols() Don't know how to handle SHN_ABS\n" );
+ break;
+ case SHN_COMMON:
+#ifdef ELFDEBUG
+ ELFDEBUG("Adding COMMON space for %s\n",
+ ElfGetString(elffile,syms[i].st_name) );
+#endif
+ if (!LoaderHashFind(ElfGetString(elffile,
+ syms[i].st_name))) {
+ tmp = ElfAddCOMMON(&(syms[i]));
+ if (tmp) {
+ tmp->next = listCOMMON;
+ listCOMMON = tmp;
+ }
+ }
+ break;
+ case SHN_UNDEF:
+ /*
+ * UNDEF will get resolved later, so the value
+ * doesn't really matter here.
+ */
+ /* since we don't know the value don't advertise the symbol */
+ break;
+ default:
+ lookup[l].symName=xf86loaderstrdup(ElfGetString(elffile,syms[i].st_name));
+ lookup[l].offset=(funcptr)syms[i].st_value;
+ secttable[l] = syms[i].st_shndx;
+#ifdef ELFDEBUG
+ ELFDEBUG("Adding symbol %lx(%d) %s\n",
+ lookup[l].offset, secttable[l], lookup[l].symName );
+#endif
+#ifdef __ia64__
+ if ( ELF_ST_TYPE(syms[i].st_info) == STT_FUNC ) {
+ ElfAddOPD(elffile, -1, &lookup[l]);
+ }
+#endif
+ l++;
+ break;
+ }
+ break;
+ case STT_FILE:
+ case STT_LOPROC:
+ case STT_HIPROC:
+ /* Skip this type */
+#ifdef ELFDEBUG
+ ELFDEBUG("Skipping TYPE %d %s\n",
+ ELF_ST_TYPE(syms[i].st_info),
+ ElfGetString(elffile,syms[i].st_name));
+#endif
+ break;
+ default:
+ ErrorF("ELF_GetSymbols(): Unepected symbol type %d\n",
+ ELF_ST_TYPE(syms[i].st_info) );
+ break;
+ }
+ }
+
+ lookup[l].symName=NULL; /* Terminate the list */
+
+/*
+ * Remove the ELF symbols that will show up in every object module.
+ */
+ for (i = 0, p = lookup; p->symName; i++, p++) {
+ while (!strcmp(lookup[i].symName, ".text")
+ || !strcmp(lookup[i].symName, ".data")
+ || !strcmp(lookup[i].symName, ".bss")
+ || !strcmp(lookup[i].symName, ".comment")
+ || !strcmp(lookup[i].symName, ".note")
+ ) {
+ memmove(&(lookup[i]), &(lookup[i+1]), (l-- - i) * sizeof (LOOKUP));
+ }
+ }
+ return lookup;
+}
+
+#define SecOffset(index) elffile->sections[index].sh_offset
+#define SecSize(index) elffile->sections[index].sh_size
+#define SecAlign(index) elffile->sections[index].sh_addralign
+#define SecType(index) elffile->sections[index].sh_type
+#define SecFlags(index) elffile->sections[index].sh_flags
+#define SecInfo(index) elffile->sections[index].sh_info
+
+#define AdjustSize(i) \
+ if (!pass) { \
+ if (SecAlign(i) > *maxalign) \
+ *maxalign = SecAlign(i); \
+ *totalsize += (SecAlign(i) - 1); \
+ *totalsize &= ~(SecAlign(i) - 1); \
+ *totalsize += SecSize(i); \
+ continue; \
+ } do { } while (0)
+
+/*
+ * ELFCollectSections
+ *
+ * Do the work required to load each section into memory.
+ */
+static void
+ELFCollectSections(elffile,pass,totalsize,maxalign)
+ELFModulePtr elffile;
+int pass;
+int *totalsize;
+int *maxalign;
+{
+ int i;
+ int j;
+/*
+ * Find and identify all of the Sections
+ */
+ j = elffile->lsectidx;
+ for( i=1; i<elffile->numsh; i++) {
+ int flags = 0;
+ char *name = ElfGetSectionName(elffile, elffile->sections[i].sh_name);
+
+#if defined(__alpha__) || defined(__ia64__)
+ if (!strcmp(name,".got") /*Isn't there a more generic way to do this?*/
+# if defined(__ia64__)
+ || !strcmp(name,".plt") || !strcmp(name, ".IA_64.unwind_info")
+# endif
+ ) continue;
+#endif
+ switch (SecType(i)) {
+ case SHT_STRTAB:
+ if (!strcmp(name,".shstrtab")) /* already loaded */
+ continue;
+ if (!strcmp(name,".stabstr")) /* ignore debug info */
+ continue;
+ case SHT_SYMTAB:
+ if (pass) continue;
+ flags = LOADED_SECTION;
+ flags |= RELOC_SECTION;
+ break;
+ case SHT_REL:
+ case SHT_RELA:
+ if (pass) continue;
+ if (! (SecFlags(SecInfo(i)) & SHF_ALLOC))
+ continue;
+#ifdef __ia64__
+ if (SecType(SecInfo(i)) == SHT_IA_64_UNWIND)
+ continue;
+#endif
+ flags = LOADED_SECTION;
+ flags |= RELOC_SECTION;
+ break;
+ case SHT_PROGBITS:
+ flags |= LOADED_SECTION;
+ case SHT_NOBITS:
+ if (! (elffile->sections[i].sh_flags & SHF_ALLOC))
+ continue;
+ AdjustSize(i);
+ break;
+ default:
+#ifdef ELFDEBUG
+ if (pass)
+ ELFDEBUG("ELF: Not loading %s\n",name);
+#endif
+ continue;
+ }
+
+ elffile->lsection = xf86loaderrealloc(elffile->lsection,
+ (j + 1) * sizeof (LoadSection));
+ if (!(flags & RELOC_SECTION)) {
+ if (flags & LOADED_SECTION) {
+ elffile->lsection[j].saddr /* sect. contains data */
+ = ELFLoaderSectToMem(elffile,SecAlign(i),SecOffset(i),
+ SecSize(i), name);
+ } else {
+ if( SecSize(i) )
+ elffile->lsection[j].saddr
+ = ELFLoaderSectCalloc(elffile,SecAlign(i),
+ SecSize(i));
+ else
+ elffile->lsection[j].saddr = NULL;
+ }
+ } else {
+ elffile->lsection[j].saddr =
+ (Elf_Sym *)_LoaderFileToMem(elffile->fd,SecOffset(i),
+ SecSize(i),name);
+ }
+ elffile->saddr[i]=elffile->lsection[j].saddr;
+#ifdef ELFDEBUG
+ ELFDEBUG("%s starts at %lx size: %lx\n",
+ name, elffile->saddr[i], SecSize(i));
+#endif
+ elffile->lsection[j].name= name;
+ elffile->lsection[j].ndx = i;
+ elffile->lsection[j].size=SecSize(i);
+ elffile->lsection[j].flags=flags;
+ switch (SecType(i)) {
+#ifdef __OpenBSD__
+ case SHT_PROGBITS:
+ mprotect(elffile->lsection[j].saddr, SecSize(i),
+ PROT_READ|PROT_WRITE|PROT_EXEC);
+ break;
+#endif
+ case SHT_SYMTAB:
+ elffile->symtab = (Elf_Sym *)elffile->saddr[i];
+ elffile->symndx = i;
+ break;
+ case SHT_STRTAB:
+ elffile->straddr = elffile->saddr[i];
+ elffile->strsize = elffile->lsection[j].size;
+ elffile->strndx = i;
+ break;
+ default:
+ break;
+ }
+ elffile->lsectidx = ++j;
+ }
+}
+
+/*
+ * Public API for the ELF implementation of the loader.
+ */
+void *
+ELFLoadModule(modrec, elffd, ppLookup)
+loaderPtr modrec;
+int elffd;
+LOOKUP **ppLookup;
+{
+ ELFModulePtr elffile;
+ Elf_Ehdr *header;
+ ELFRelocPtr elf_reloc, tail;
+ void *v;
+ LDRModulePtr elfmod;
+ int totalsize, maxalign, i;
+ unsigned short *secttable;
+ LOOKUP *pLookup;
+
+ ldrCommons = 0;
+ nCommons = 0;
+
+#ifdef ELFDEBUG
+ ELFDEBUG("Loading %s %s\n", modrec->name, modrec->cname);
+#endif
+ if ((elffile = xf86loadercalloc(1, sizeof(ELFModuleRec))) == NULL) {
+ ErrorF( "Unable to allocate ELFModuleRec\n" );
+ return NULL;
+ }
+
+ elffile->handle=modrec->handle;
+ elffile->module=modrec->module;
+ elffile->fd=elffd;
+ v=elffile->funcs=modrec->funcs;
+
+/*
+ * Get the ELF header
+ */
+ elffile->header=
+ (Elf_Ehdr*)_LoaderFileToMem(elffd, 0, sizeof(Elf_Ehdr), "header");
+ header=(Elf_Ehdr *)elffile->header;
+
+/*
+ * Get the section table
+ */
+ elffile->numsh=header->e_shnum;
+ elffile->secsize=(header->e_shentsize * header->e_shnum);
+ elffile->sections=
+ (Elf_Shdr *)_LoaderFileToMem(elffd, header->e_shoff, elffile->secsize,
+ "sections");
+#if defined(__alpha__) || defined(__ia64__)
+ /*
+ * Need to allocate space for the .got section which will be
+ * fabricated later
+ */
+ elffile->gotndx=header->e_shnum;
+ header->e_shnum++;
+# if defined(__ia64__)
+ elffile->pltndx=header->e_shnum;
+ header->e_shnum++;
+# endif
+ elffile->numsh=header->e_shnum;
+ elffile->secsize=(header->e_shentsize*header->e_shnum);
+ elffile->sections=xf86loaderrealloc(elffile->sections,elffile->secsize);
+#endif /*defined(__alpha__) || defined(__ia64__)*/
+ elffile->saddr=xf86loadercalloc(elffile->numsh, sizeof(unsigned char *));
+
+#if defined(__alpha__) || defined(__ia64__)
+ /*
+ * Manually fill in the entry for the .got section so ELFCollectSections()
+ * will be able to find it.
+ */
+ elffile->sections[elffile->gotndx].sh_name=SecSize(header->e_shstrndx)+1;
+ elffile->sections[elffile->gotndx].sh_type=SHT_PROGBITS;
+ elffile->sections[elffile->gotndx].sh_flags=SHF_WRITE|SHF_ALLOC;
+ elffile->sections[elffile->gotndx].sh_size=0;
+ elffile->sections[elffile->gotndx].sh_addralign=8;
+ /* Add room to copy ".got", and maintain alignment */
+ SecSize(header->e_shstrndx)+=8;
+#endif
+#if defined(__ia64__)
+ /*
+ * Manually fill in the entry for the .plt section so ELFCollectSections()
+ * will be able to find it.
+ */
+ elffile->sections[elffile->pltndx].sh_name=SecSize(header->e_shstrndx)+1;
+ elffile->sections[elffile->pltndx].sh_type=SHT_PROGBITS;
+ elffile->sections[elffile->pltndx].sh_flags=SHF_EXECINSTR|SHF_ALLOC;
+ elffile->sections[elffile->pltndx].sh_size=0;
+ elffile->sections[elffile->pltndx].sh_addralign=32;
+ /* Add room to copy ".plt", and maintain alignment */
+ SecSize(header->e_shstrndx)+=32;
+#endif
+
+/*
+ * Get the section header string table
+ */
+ elffile->shstrsize = SecSize(header->e_shstrndx);
+ elffile->shstraddr =
+ _LoaderFileToMem(elffd, SecOffset(header->e_shstrndx),
+ SecSize(header->e_shstrndx), ".shstrtab");
+ elffile->shstrndx = header->e_shstrndx;
+#if defined(__alpha__) || defined(__ia64__)
+ /*
+ * Add the string for the .got section
+ */
+ strcpy((char*)(elffile->shstraddr+elffile->sections[elffile->gotndx].sh_name),
+ ".got");
+#endif
+#if defined(__ia64__)
+ /*
+ * Add the string for the .plt section
+ */
+ strcpy((char*)(elffile->shstraddr+elffile->sections[elffile->pltndx].sh_name),
+ ".plt");
+#endif
+
+/*
+ * Load some desired sections, compute size of the remaining ones
+ */
+ totalsize = 0;
+ maxalign = 0;
+ ELFCollectSections(elffile, 0, &totalsize, &maxalign);
+ if( elffile->straddr == NULL || elffile->strsize == 0 ) {
+#if 0
+ ErrorF("No symbols found in this module\n");
+#endif
+ ELFUnloadModule(elffile);
+ return (void *) -1L;
+ }
+/*
+ * add symbols
+ */
+ *ppLookup = pLookup = ELF_GetSymbols(elffile, &secttable);
+
+/*
+ * Do relocations
+ */
+ for (i = 0; i < elffile->lsectidx; i++) {
+ switch (SecType(elffile->lsection[i].ndx)) {
+ case SHT_REL:
+ case SHT_RELA:
+ break;
+ default:
+ continue;
+ }
+ elf_reloc = ELFCollectRelocations(elffile,elffile->lsection[i].ndx);
+ if (elf_reloc) {
+ for (tail = elf_reloc; tail->next; tail = tail->next)
+ ;
+ tail->next = _LoaderGetRelocations(v)->elf_reloc;
+ _LoaderGetRelocations(v)->elf_reloc = elf_reloc;
+ }
+ }
+
+#if defined(__ia64__)
+ totalsize += (elffile->sections[elffile->pltndx].sh_addralign - 1);
+ totalsize &= ~(elffile->sections[elffile->pltndx].sh_addralign - 1);
+ totalsize += elffile->pltsize;
+ if (maxalign < elffile->sections[elffile->pltndx].sh_addralign)
+ maxalign = elffile->sections[elffile->pltndx].sh_addralign;
+#endif
+
+ /* Space for COMMON */
+ totalsize = (totalsize + 7) & ~7;
+ totalsize += ElfCOMMONSize();
+
+#ifdef MergeSectionAlloc
+ elffile->basesize = totalsize + maxalign;
+
+# if !defined(DoMMAPedMerge)
+ elffile->base = xf86loadermalloc(elffile->basesize);
+ if (elffile->base == NULL) {
+ ErrorF( "Unable to allocate ELF sections\n" );
+ return NULL;
+ }
+# if defined(linux) && defined(__ia64__) || defined(__OpenBSD__)
+ {
+ unsigned long page_size = getpagesize();
+ unsigned long round;
+
+ round = (unsigned long)elffile->base & (page_size-1);
+ mprotect(elffile->base - round, (elffile->basesize+round+page_size-1) & ~(page_size-1),
+ PROT_READ|PROT_WRITE|PROT_EXEC);
+ }
+# endif
+# else
+ MMAP_ALIGN(elffile->basesize);
+ elffile->base = mmap( 0,elffile->basesize,MMAP_PROT,MMAP_FLAGS,-1,
+ (off_t)0);
+ if (elffile->base == NULL) {
+ ErrorF( "Unable to mmap ELF sections\n" );
+ return NULL;
+ }
+# endif
+ elffile->baseptr = ((long)elffile->base + (maxalign - 1)) & ~(maxalign - 1);
+#endif
+
+#if defined(__alpha__) || defined(__ia64__)
+ if (! ELFCreateGOT(elffile, maxalign))
+ return NULL;
+#endif
+#if defined(__ia64__)
+ ELFCreatePLT(elffile);
+#endif
+
+ ELFCollectSections(elffile, 1, NULL, NULL);
+
+ for (i = 0; pLookup[i].symName; i++)
+ if (secttable[i]) {
+ pLookup[i].offset = (funcptr)((long)pLookup[i].offset + (long)elffile->saddr[secttable[i]]);
+#ifdef ELFDEBUG
+ ELFDEBUG("Finalizing symbol %lx %s\n",
+ pLookup[i].offset, pLookup[i].symName);
+#endif
+ }
+ xf86loaderfree(secttable);
+
+#if defined(__ia64__)
+ ELFCreateOPD(elffile);
+#endif
+
+ if (! ElfCreateCOMMON(elffile, *ppLookup))
+ return NULL;
+
+ /* Record info for gdb - if we can't allocate the loader record fail
+ silently (the user will find out soon enough that there's no VM left */
+ if ((elfmod = xf86loadercalloc(1, sizeof(LDRModuleRec))) != NULL) {
+ elfmod->name = strdup(modrec->name);
+ elfmod->namelen = strlen(modrec->name);
+ elfmod->version = 1;
+ for (i=0; i < elffile->lsectidx;i++) {
+ char *name = elffile->lsection[i].name;
+ if (!strcmp(name,".text"))
+ elfmod->text = elffile->lsection[i].saddr;
+ else if (!strcmp(name,".data"))
+ elfmod->data = elffile->lsection[i].saddr;
+ else if (!strcmp(name,".rodata"))
+ elfmod->rodata = elffile->lsection[i].saddr;
+ else if (!strcmp(name,".bss"))
+ elfmod->bss = elffile->lsection[i].saddr;
+ }
+ elfmod->next = ModList;
+ elfmod->commons = ldrCommons;
+ elfmod->commonslen = nCommons;
+
+ ModList = elfmod;
+
+ /* Tell GDB something interesting happened */
+ _loader_debug_state();
+ }
+ return (void *)elffile;
+}
+
+void
+ELFResolveSymbols(mod)
+void *mod;
+{
+ ELFRelocPtr newlist, p, tmp;
+
+ /* Try to relocate everything. Build a new list containing entries
+ * which we failed to relocate. Destroy the old list in the process.
+ */
+ newlist = 0;
+ for (p = _LoaderGetRelocations(mod)->elf_reloc; p; ) {
+#ifdef ELFDEBUG
+ ErrorF("ResolveSymbols: file %lx, sec %d, r_offset 0x%x, r_info 0x%lx\n",
+ p->file, p->secn, p->rel->r_offset, p->rel->r_info);
+#endif
+ tmp = Elf_RelocateEntry(p->file, p->secn, p->rel, FALSE);
+ if (tmp) {
+ /* Failed to relocate. Keep it in the list. */
+ tmp->next = newlist;
+ newlist = tmp;
+ }
+ tmp = p;
+ p = p->next;
+ xf86loaderfree(tmp);
+ }
+ _LoaderGetRelocations(mod)->elf_reloc=newlist;
+}
+
+int
+ELFCheckForUnresolved(mod)
+void *mod;
+{
+ ELFRelocPtr erel;
+ char *name;
+ int flag, fatalsym=0;
+
+ if ((erel = _LoaderGetRelocations(mod)->elf_reloc) == NULL)
+ return 0;
+
+ while( erel ) {
+ Elf_RelocateEntry(erel->file, erel->secn, erel->rel, TRUE);
+ name = ElfGetSymbolName(erel->file, ELF_R_SYM(erel->rel->r_info));
+ flag = _LoaderHandleUnresolved(
+ name, _LoaderHandleToName(erel->file->handle));
+ if(flag) fatalsym = 1;
+ erel=erel->next;
+ }
+ return fatalsym;
+}
+
+void
+ELFUnloadModule(modptr)
+void *modptr;
+{
+ ELFModulePtr elffile = (ELFModulePtr)modptr;
+ ELFRelocPtr relptr, reltptr, *brelptr;
+ int i;
+
+/*
+ * Delete any unresolved relocations
+ */
+
+ relptr=_LoaderGetRelocations(elffile->funcs)->elf_reloc;
+ brelptr=&(_LoaderGetRelocations(elffile->funcs)->elf_reloc);
+
+ while(relptr) {
+ if( relptr->file == elffile ) {
+ *brelptr=relptr->next; /* take it out of the list */
+ reltptr=relptr; /* save pointer to this node */
+ relptr=relptr->next; /* advance the pointer */
+ xf86loaderfree(reltptr); /* free the node */
+ }
+ else {
+ brelptr=&(relptr->next);
+ relptr=relptr->next; /* advance the pointer */
+ }
+ }
+
+/*
+ * Delete any symbols in the symbols table.
+ */
+
+ LoaderHashTraverse((void *)elffile, ELFhashCleanOut);
+
+/*
+ * Free the sections that were allocated.
+ */
+#if !defined (DoMMAPedMerge)
+# define CheckandFree(ptr,size) if(ptr) xf86loaderfree(ptr)
+#else
+# define CheckandFree(ptr,size) if (ptr) munmap(ptr,size)
+#endif
+#define CheckandFreeFile(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size))
+
+#ifdef MergeSectionAlloc
+ CheckandFree(elffile->base,elffile->basesize);
+# if defined(__alpha__) || defined(__ia64__)
+ if (elffile->shared_got) {
+ elffile->shared_got->nuses--;
+ if (!elffile->shared_got->nuses) {
+ ELFGotPtr *pgot = &ELFSharedGOTs;
+ while (*pgot && *pgot != elffile->shared_got)
+ pgot = &(*pgot)->next;
+ if (*pgot)
+ *pgot = elffile->shared_got->next;
+ xf86loaderfree(elffile->shared_got);
+ }
+ }
+# endif
+#else /*MergeSectionAlloc*/
+ CheckandFree(elffile->common,elffile->comsize);
+# if defined(__alpha__) || defined(__ia64__)
+ CheckandFree(elffile->got,elffile->gotsize);
+# endif
+# if defined(__ia64__)
+ CheckandFree(elffile->plt,elffile->pltsize);
+# endif
+#endif
+#if defined(__alpha__) || defined(__ia64__)
+ {
+ ELFGotEntryPtr gotent;
+ while((gotent = elffile->got_entries)) {
+ elffile->got_entries = gotent->next;
+ xf86loaderfree(gotent);
+ }
+ }
+#endif
+#if defined(__ia64__)
+ {
+ ELFPltEntryPtr pltent;
+ while ((pltent = elffile->plt_entries)) {
+ elffile->plt_entries = pltent->next;
+ xf86loaderfree(pltent);
+ }
+ }
+ {
+ ELFOpdPtr opdent;
+ while ((opdent = elffile->opd_entries)) {
+ elffile->opd_entries = opdent->next;
+ xf86loaderfree(opdent);
+ }
+ }
+#endif
+
+ for (i = 0; i < elffile->lsectidx; i++) {
+#ifdef MergeSectionAlloc
+ if (!(elffile->lsection[i].flags & RELOC_SECTION))
+ continue;
+#endif
+ if (elffile->lsection[i].flags & LOADED_SECTION) {
+ CheckandFreeFile(elffile->lsection[i].saddr,
+ elffile->lsection[i].size);
+ } else {
+ CheckandFree(elffile->lsection[i].saddr,
+ elffile->lsection[i].size);
+ }
+ }
+ xf86loaderfree(elffile->lsection);
+
+/*
+ * Free the section table, section pointer array, and section names
+ */
+ _LoaderFreeFileMem(elffile->sections,elffile->secsize);
+ xf86loaderfree(elffile->saddr);
+ _LoaderFreeFileMem(elffile->header,sizeof(Elf_Ehdr));
+ _LoaderFreeFileMem(elffile->shstraddr,elffile->shstrsize);
+
+
+/*
+ * Free the ELFModuleRec
+ */
+ xf86loaderfree(elffile);
+
+ return;
+}
+
+char *
+ELFAddressToSection(void *modptr, unsigned long address)
+{
+ ELFModulePtr elffile = (ELFModulePtr)modptr;
+ int i;
+
+ for( i=1; i<elffile->numsh; i++) {
+ if( address >= (unsigned long)elffile->saddr[i] &&
+ address <= (unsigned long)elffile->saddr[i]+SecSize(i) ) {
+ return ElfGetSectionName(elffile, elffile->sections[i].sh_name);
+ }
+ }
+ return NULL;
+}
diff --git a/hw/xfree86/loader/elfloader.h b/hw/xfree86/loader/elfloader.h
new file mode 100644
index 000000000..cbd5f118a
--- /dev/null
+++ b/hw/xfree86/loader/elfloader.h
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright 1997,1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.h,v 1.3 1998/09/20 14:41:05 dawes Exp $ */
+
+#ifndef _ELFLOADER_H
+#define _ELFLOADER_H
+/* elfloader.c */
+extern void *ELFLoadModule(loaderPtr, int, LOOKUP **);
+extern void ELFResolveSymbols(void *);
+extern int ELFCheckForUnresolved(void *);
+extern char *ELFAddressToSection(void *,unsigned long);
+extern void ELFUnloadModule(void *);
+#endif /* _ELFLOADER_h */
diff --git a/hw/xfree86/loader/extsym.c b/hw/xfree86/loader/extsym.c
new file mode 100644
index 000000000..62a5ea98a
--- /dev/null
+++ b/hw/xfree86/loader/extsym.c
@@ -0,0 +1,79 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/extsym.c,v 1.6 2001/11/17 16:05:59 dawes Exp $ */
+
+/*
+ *
+ * Copyright 1999 by The XFree86 Project, 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, and that the name of The XFree86 Project, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The XFree86 Project, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE XFREE86 PROJECT, INC. 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.
+ */
+
+#include "resource.h"
+#include "sym.h"
+#include "misc.h"
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#endif
+#include "sleepuntil.h"
+
+#ifdef HAS_SHM
+extern int ShmCompletionCode;
+extern int BadShmSegCode;
+extern RESTYPE ShmSegType, ShmPixType;
+#endif
+
+#ifdef PANORAMIX
+extern Bool noPanoramiXExtension;
+extern int PanoramiXNumScreens;
+extern PanoramiXData *panoramiXdataPtr;
+extern unsigned long XRT_WINDOW;
+extern unsigned long XRT_PIXMAP;
+extern unsigned long XRT_GC;
+extern unsigned long XRT_COLORMAP;
+extern unsigned long XRC_DRAWABLE;
+extern Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
+extern int XineramaDeleteResource(pointer, XID);
+#endif
+
+LOOKUP extLookupTab[] = {
+
+ SYMFUNC(ClientSleepUntil)
+
+#ifdef HAS_SHM
+ SYMVAR(ShmCompletionCode)
+ SYMVAR(BadShmSegCode)
+ SYMVAR(ShmSegType)
+#endif
+
+#ifdef PANORAMIX
+ SYMFUNC(XineramaRegisterConnectionBlockCallback)
+ SYMFUNC(XineramaDeleteResource)
+ SYMVAR(noPanoramiXExtension)
+ SYMVAR(PanoramiXNumScreens)
+ SYMVAR(panoramiXdataPtr)
+ SYMVAR(XRT_WINDOW)
+ SYMVAR(XRT_PIXMAP)
+ SYMVAR(XRT_GC)
+ SYMVAR(XRT_COLORMAP)
+ SYMVAR(XRC_DRAWABLE)
+#endif
+
+ { 0, 0 },
+
+};
diff --git a/hw/xfree86/loader/fontsym.c b/hw/xfree86/loader/fontsym.c
new file mode 100644
index 000000000..50def63ea
--- /dev/null
+++ b/hw/xfree86/loader/fontsym.c
@@ -0,0 +1,79 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/fontsym.c,v 1.11 2002/12/09 17:30:12 dawes Exp $ */
+
+#include "font.h"
+#include "sym.h"
+#include "fntfilst.h"
+#include "fontenc.h"
+#ifdef FONTENC_COMPATIBILITY
+#include "fontencc.h"
+#endif
+#include "fntfilio.h"
+#include "fntfil.h"
+#include "fontutil.h"
+#include "fontxlfd.h"
+#define _FONTCACHE_SERVER_
+#include "fontcache.h"
+
+LOOKUP fontLookupTab[] = {
+
+ SYMFUNC(TwoByteSwap)
+ SYMFUNC(FourByteSwap)
+ SYMFUNC(FontCouldBeTerminal)
+ SYMFUNC(BufFileRead)
+ SYMFUNC(BufFileWrite)
+ SYMFUNC(CheckFSFormat)
+ SYMFUNC(FontFileOpen)
+ SYMFUNC(FontFilePriorityRegisterRenderer)
+ SYMFUNC(FontFileRegisterRenderer)
+ SYMFUNC(FontParseXLFDName)
+ SYMFUNC(FontFileCloseFont)
+ SYMFUNC(FontFileOpenBitmap)
+ SYMFUNC(FontFileCompleteXLFD)
+ SYMFUNC(FontFileCountDashes)
+ SYMFUNC(FontFileFindNameInDir)
+ SYMFUNC(FontFileClose)
+ SYMFUNC(FontComputeInfoAccelerators)
+ SYMFUNC(FontDefaultFormat)
+ SYMFUNC(NameForAtom)
+ SYMFUNC(BitOrderInvert)
+ SYMFUNC(FontFileMatchRenderer)
+ SYMFUNC(RepadBitmap)
+ SYMFUNC(FontEncName)
+ SYMFUNC(FontEncRecode)
+ SYMFUNC(FontEncFind)
+ SYMFUNC(FontMapFind)
+ SYMFUNC(FontEncMapFind)
+ SYMFUNC(FontEncFromXLFD)
+ SYMFUNC(FontEncDirectory)
+ SYMFUNC(FontMapReverse)
+ SYMFUNC(FontMapReverseFree)
+ SYMFUNC(CreateFontRec)
+ SYMFUNC(DestroyFontRec)
+ SYMFUNC(GetGlyphs)
+ SYMFUNC(QueryGlyphExtents)
+
+ SYMVAR(FontFileBitmapSources)
+
+#ifdef FONTENC_COMPATIBILITY
+ /* Obsolete backwards compatibility symbols -- fontencc.c */
+ SYMFUNC(font_encoding_from_xlfd)
+ SYMFUNC(font_encoding_find)
+ SYMFUNC(font_encoding_recode)
+ SYMFUNC(font_encoding_name)
+ SYMFUNC(identifyEncodingFile)
+#endif
+
+ /* fontcache.c */
+ SYMFUNC(FontCacheGetSettings)
+ SYMFUNC(FontCacheGetStatistics)
+ SYMFUNC(FontCacheChangeSettings)
+ SYMFUNC(FontCacheOpenCache)
+ SYMFUNC(FontCacheCloseCache)
+ SYMFUNC(FontCacheSearchEntry)
+ SYMFUNC(FontCacheGetEntry)
+ SYMFUNC(FontCacheInsertEntry)
+ SYMFUNC(FontCacheGetBitmap)
+
+ { 0, 0 },
+
+};
diff --git a/hw/xfree86/loader/hash.c b/hw/xfree86/loader/hash.c
new file mode 100644
index 000000000..22996f217
--- /dev/null
+++ b/hw/xfree86/loader/hash.c
@@ -0,0 +1,364 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.c,v 1.19 2001/07/25 15:05:07 dawes Exp $ */
+
+/*
+ *
+ * Copyright 1995-1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+#include "os.h"
+#include "Xos.h"
+#undef abs
+#include <stdlib.h>
+#include "sym.h"
+#include "loader.h"
+#include "hash.h"
+
+#if defined(Lynx)
+#define MAXINT 32000
+#else
+#include <limits.h>
+#undef MAXINT
+#define MAXINT INT_MAX
+#endif
+
+/* Prototypes for static functions. */
+static unsigned int hashFunc(const char *);
+static itemPtr LoaderHashFindNearest(
+#if NeedFunctionPrototypes
+unsigned long
+#endif
+);
+
+static itemPtr LoaderhashTable[ HASHSIZE ] ;
+
+#ifdef DEBUG
+static int hashhits[ HASHSIZE ] ;
+
+void
+DumpHashHits(void)
+{
+ int i;
+ int depth=0;
+ int dev=0;
+
+ for(i=0;i<HASHSIZE;i++) {
+ ErrorF("hashhits[%d]=%d\n", i, hashhits[i] );
+ depth += hashhits[i];
+ }
+
+ depth /= HASHSIZE;
+ ErrorF("Average hash depth=%d\n", depth );
+
+ for(i=0;i<HASHSIZE;i++) {
+ if( hashhits[i] < depth )
+ dev += depth-hashhits[i];
+ else
+ dev += hashhits[i]-depth;
+ }
+
+ dev /=HASHSIZE;
+ ErrorF("Average hash deviation=%d\n", dev );
+}
+#endif
+
+
+static unsigned int
+hashFunc(string)
+const char *string;
+{
+ int i=0;
+
+ while ( i < 10 && string[i] )
+ i ++ ;
+
+ if ( i < 5 ) {
+#ifdef DEBUG
+ hashhits[i]++;
+#endif
+ return i ;
+ }
+
+/*
+ * Original has function
+#define HASH ((string[ i-4 ] * string[i-3] + string[i-2] ) & (HASHSIZE-1))
+ */
+
+#define HASH ((string[i-5] * string[ i-4 ] + string[i-3] * string[i-2] ) & (HASHSIZE-1))
+
+#ifdef DEBUG
+ hashhits[HASH]++;
+#endif
+
+ return HASH;
+}
+
+void
+LoaderHashAdd( entry )
+ itemPtr entry ;
+{
+ int bucket = hashFunc( entry->name ) ;
+ itemPtr oentry;
+
+ if ((oentry = LoaderHashFind(entry->name)) != NULL)
+ LoaderDuplicateSymbol(entry->name, oentry->handle);
+
+ entry->next = LoaderhashTable[ bucket ] ;
+ LoaderhashTable[ bucket ] = entry ;
+ return;
+}
+
+void
+LoaderAddSymbols(handle, module, list)
+int handle;
+int module;
+LOOKUP *list ;
+{
+ LOOKUP *l = list, *exports = NULL;
+ itemPtr i, exportsItem = NULL;
+ char *modname;
+
+ if (!list)
+ return;
+
+ /*
+ * First look for a symbol called <name>ExportedSymbols. If it exists,
+ * only export the symbols that are listed in that array. Otherwise
+ * export all of the external symbols.
+ */
+ modname = _LoaderHandleToCanonicalName(handle);
+ if (modname) {
+ char *exportname;
+
+ exportname = xf86loadermalloc(strlen("ExportedSymbols") +
+ strlen(modname) + 1);
+ if (exportname) {
+ sprintf(exportname, "%sExportedSymbols", modname);
+ while (l->symName) {
+ if (strcmp(l->symName, exportname) == 0) {
+ exports = l;
+ ErrorF("LoaderAddSymbols: %s: %s found\n", modname,
+ exportname);
+ break;
+ }
+ l++;
+ }
+ }
+ }
+
+ /*
+ * Allocate the exports list item first.
+ */
+ if (exports) {
+ exportsItem = xf86loadermalloc( sizeof( itemRec )) ;
+ exportsItem->name = exports->symName ;
+ exportsItem->address = (char *) exports->offset ;
+ exportsItem->handle = handle ;
+ exportsItem->module = module ;
+ exportsItem->exports = NULL;
+ LoaderHashAdd( exportsItem );
+ }
+
+ /*
+ * Visit every symbol in the lookup table, tagging it with the
+ * reference to the export list, if present.
+ */
+ l = list;
+ while ( l->symName ) {
+ if (l != exports) {
+ i = xf86loadermalloc( sizeof( itemRec )) ;
+ i->name = l->symName ;
+ i->address = (char *) l->offset ;
+ i->handle = handle ;
+ i->module = module ;
+ i->exports = exportsItem;
+ LoaderHashAdd( i );
+ }
+ l ++ ;
+ }
+}
+
+itemPtr
+LoaderHashDelete(string)
+const char *string;
+{
+ int bucket = hashFunc( string ) ;
+ itemPtr entry;
+ itemPtr *entry2;
+
+ entry = LoaderhashTable[ bucket ] ;
+ entry2= &(LoaderhashTable[ bucket ]);
+ while ( entry ) {
+ if (! strcmp( entry->name, string )) {
+ *entry2=entry->next;
+ xf86loaderfree(entry->name);
+ xf86loaderfree( entry ) ;
+ return 0 ;
+ }
+ entry2 = &(entry->next) ;
+ entry = entry->next ;
+ }
+ return 0 ;
+}
+
+itemPtr
+LoaderHashFind(string)
+const char *string;
+{
+ int bucket = hashFunc( string ) ;
+ itemPtr entry ;
+ entry = LoaderhashTable[ bucket ] ;
+ while ( entry ) {
+ if (!strcmp(entry->name, string)) {
+ return entry;
+ }
+ entry = entry->next;
+ }
+ return 0;
+}
+
+static itemPtr
+LoaderHashFindNearest(address)
+unsigned long address;
+{
+ int i ;
+ itemPtr entry, best_entry = 0 ;
+ long best_difference = MAXINT;
+
+ for ( i = 0 ; i < HASHSIZE ; i ++ ) {
+ entry = LoaderhashTable[ i ] ;
+ while ( entry ) {
+ long difference = (long) address - (long) entry->address ;
+ if ( difference >= 0 ) {
+ if ( best_entry ) {
+ if ( difference < best_difference ) {
+ best_entry = entry ;
+ best_difference = difference ;
+ }
+ }
+ else {
+ best_entry = entry ;
+ best_difference = difference ;
+ }
+ }
+ entry = entry->next ;
+ }
+ }
+ return best_entry ;
+}
+
+void
+LoaderPrintSymbol(address)
+unsigned long address;
+{
+ itemPtr entry;
+ entry=LoaderHashFindNearest(address);
+ if (entry) {
+ const char *module, *section;
+#if defined(__alpha__) || defined(__ia64__)
+ ErrorF("0x%016lx %s+%lx\n", entry->address, entry->name,
+ address - (unsigned long) entry->address);
+#else
+ ErrorF("0x%x %s+%x\n", entry->address, entry->name,
+ address - (unsigned long) entry->address);
+#endif
+
+ if ( _LoaderAddressToSection(address, &module, &section) )
+ ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n",module, section );
+ } else {
+ ErrorF("(null)\n");
+ }
+}
+
+void
+LoaderPrintItem(itemPtr pItem)
+{
+ if (pItem) {
+ const char *module, *section;
+#if defined(__alpha__) || defined(__ia64__)
+ ErrorF("0x%016lx %s\n", pItem->address, pItem->name);
+#else
+ ErrorF("0x%lx %s\n", pItem->address, pItem->name);
+#endif
+ if ( _LoaderAddressToSection((unsigned long)pItem->address,
+ &module, &section) )
+ ErrorF("\tModule \"%s\"\n\tSection \"%s\"\n",module, section );
+ } else
+ ErrorF("(null)\n");
+}
+
+void
+LoaderPrintAddress(symbol)
+const char *symbol;
+{
+ itemPtr entry;
+ entry = LoaderHashFind(symbol);
+ LoaderPrintItem(entry);
+}
+
+void
+LoaderHashTraverse(card, fnp)
+ void *card;
+ int (*fnp)(void *, itemPtr);
+{
+ int i ;
+ itemPtr entry, last_entry = 0 ;
+
+ for ( i = 0 ; i < HASHSIZE ; i ++ ) {
+ last_entry = 0 ;
+ entry = LoaderhashTable[ i ] ;
+ while ( entry ) {
+ if (( * fnp )( card, entry )) {
+ if ( last_entry ) {
+ last_entry->next = entry->next ;
+ xf86loaderfree( entry->name ) ;
+ xf86loaderfree( entry ) ;
+ entry = last_entry->next ;
+ }
+ else {
+ LoaderhashTable[ i ] = entry->next ;
+ xf86loaderfree( entry->name ) ;
+ xf86loaderfree( entry ) ;
+ entry = LoaderhashTable[ i ] ;
+ }
+ }
+ else {
+ last_entry = entry ;
+ entry = entry->next ;
+ }
+ }
+ }
+}
+
+void
+LoaderDumpSymbols()
+{
+ itemPtr entry;
+ int j;
+
+ for (j=0; j<HASHSIZE; j++) {
+ entry = LoaderhashTable[j];
+ while (entry) {
+ LoaderPrintItem(entry);
+ entry = entry->next;
+ }
+ }
+
+}
diff --git a/hw/xfree86/loader/hash.h b/hw/xfree86/loader/hash.h
new file mode 100644
index 000000000..96cd41c02
--- /dev/null
+++ b/hw/xfree86/loader/hash.h
@@ -0,0 +1,36 @@
+/*
+ *
+ * Copyright 1995-1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/hash.h,v 1.3 1998/07/25 16:56:16 dawes Exp $ */
+
+#ifndef _HASH_H
+#define _HASH_H
+
+#include "loader.h"
+
+typedef struct _HashIterator {
+ itemPtr pItem;
+ int bucket;
+} HashIteratorRec, *HashIteratorPtr;
+
+#endif /* _HASH_H */
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
new file mode 100644
index 000000000..e09fa50b0
--- /dev/null
+++ b/hw/xfree86/loader/loader.c
@@ -0,0 +1,1412 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.c,v 1.63 2002/11/25 14:05:03 eich Exp $ */
+
+/*
+ *
+ * Copyright 1995-1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#if defined(UseMMAP) || (defined(linux) && defined(__ia64__))
+#include <sys/mman.h>
+#endif
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#if defined(linux) && \
+ (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
+ || defined(__x86_64__))
+#include <malloc.h>
+#endif
+#include <stdarg.h>
+#include "ar.h"
+#include "elf.h"
+#include "coff.h"
+
+#include "os.h"
+#include "sym.h"
+#include "loader.h"
+#include "loaderProcs.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#include "compiler.h"
+
+extern LOOKUP miLookupTab[];
+extern LOOKUP xfree86LookupTab[];
+extern LOOKUP dixLookupTab[];
+extern LOOKUP fontLookupTab[];
+extern LOOKUP extLookupTab[];
+
+/*
+#define DEBUG
+#define DEBUGAR
+#define DEBUGLIST
+#define DEBUGMEM
+*/
+
+int check_unresolved_sema = 0;
+
+#if defined(Lynx) && defined(sun)
+/* Cross build machine doesn;t have strerror() */
+#define strerror(err) "strerror unsupported"
+#endif
+
+#ifdef __UNIXOS2__
+void * os2ldcalloc(size_t,size_t);
+#endif
+
+#ifdef HANDLE_IN_HASH_ENTRY
+/*
+ * handles are used to identify files that are loaded. Even archives
+ * are counted as a single file.
+ */
+#define MAX_HANDLE 256
+#define HANDLE_FREE 0
+#define HANDLE_USED 1
+static char freeHandles[MAX_HANDLE] ;
+static int refCount[MAX_HANDLE] ;
+#endif
+
+#if defined(__sparc__) && defined(__GNUC__)
+# define SYMFUNCDOT(func) { "." #func, (funcptr)&__sparc_dot_ ## func },
+# if !defined(__OpenBSD__)
+# define SYMFUNCDOT89(func) { "." #func, (funcptr)&func ## _sparcv89 },
+# define DEFFUNCDOT(func) \
+extern void __sparc_dot_ ## func (void) __asm__ ("." #func); \
+extern void func ## _sparcv89 (void);
+# else
+# define SYMFUNCDOT(func) { "." #func, (funcptr)&__sparc_dot_ ## func },
+# define DEFFUNCDOT(func) \
+extern void __sparc_dot_ ## func (void) __asm__ ("." #func);
+#endif
+DEFFUNCDOT(rem)
+DEFFUNCDOT(urem)
+DEFFUNCDOT(mul)
+DEFFUNCDOT(umul)
+DEFFUNCDOT(div)
+DEFFUNCDOT(udiv)
+#ifdef linux
+static LOOKUP SparcV89LookupTab[] = {
+ SYMFUNCDOT89(rem)
+ SYMFUNCDOT89(urem)
+ SYMFUNCDOT89(mul)
+ SYMFUNCDOT89(umul)
+ SYMFUNCDOT89(div)
+ SYMFUNCDOT89(udiv)
+ { 0, 0 }
+};
+#endif
+static LOOKUP SparcLookupTab[] = {
+ SYMFUNCDOT(rem)
+ SYMFUNCDOT(urem)
+ SYMFUNCDOT(mul)
+ SYMFUNCDOT(umul)
+ SYMFUNCDOT(div)
+ SYMFUNCDOT(udiv)
+ { 0, 0 }
+};
+#ifdef linux
+#if defined(__GNUC__) && defined(__GLIBC__)
+#define HWCAP_SPARC_MULDIV 8
+extern unsigned long int _dl_hwcap;
+#endif
+
+static int
+sparcUseHWMulDiv(void)
+{
+ FILE *f;
+ char buffer[1024];
+ char *p;
+#if defined(__GNUC__) && defined(__GLIBC__)
+ unsigned long *hwcap;
+ __asm(".weak _dl_hwcap");
+
+ hwcap = &_dl_hwcap;
+ __asm("" : "=r" (hwcap) : "0" (hwcap));
+ if (hwcap) {
+ if (*hwcap & HWCAP_SPARC_MULDIV)
+ return 1;
+ else
+ return 0;
+ }
+#endif
+ f = fopen("/proc/cpuinfo","r");
+ if (!f) return 0;
+ while (fgets(buffer, 1024, f) != NULL) {
+ if (!strncmp (buffer, "type", 4)) {
+ p = strstr (buffer, "sun4");
+ if (p && (p[4] == 'u' || p[4] == 'd' || p[4] == 'm')) {
+ fclose(f);
+ return 1;
+ }
+ }
+ }
+ fclose(f);
+ return 0;
+}
+#endif
+#endif
+
+/*
+ * modules are used to identify compilation units (ie object modules).
+ * Archives contain multiple modules, each of which is treated seperately.
+ */
+static int moduleseq = 0;
+
+/*
+ * GDB Interface
+ * =============
+ *
+ * Linked list of loaded modules - gdb will traverse this to determine
+ * whether it needs to add the symbols for the loaded module.
+ */
+LDRModulePtr ModList = 0;
+
+/* Flag which gdb sets to let us know we're being debugged */
+char DebuggerPresent = 0;
+
+/* List of common symbols */
+LDRCommonPtr ldrCommons;
+int nCommons;
+
+typedef struct {
+ int num;
+ const char ** list;
+} symlist;
+
+/*
+ * List of symbols that may be referenced, and which are allowed to be
+ * unresolved providing that they don't appear on the "reqired" list.
+ */
+static symlist refList = { 0, NULL };
+
+/* List of symbols that must not be unresolved */
+static symlist reqList = { 0, NULL };
+
+static int fatalReqSym = 0;
+
+/* Prototypes for static functions. */
+static int _GetModuleType(int, long);
+static loaderPtr _LoaderListPush(void);
+static loaderPtr _LoaderListPop(int);
+/*ARGSUSED*/
+static void ARCHIVEResolveSymbols(void *unused) {}
+/*ARGSUSED*/
+static int ARCHIVECheckForUnresolved(void *v) { return 0; }
+/*ARGSUSED*/
+static char *ARCHIVEAddressToSection(void *modptr, unsigned long address)
+{ return NULL; }
+/*ARGSUSED*/
+static void ARCHIVEUnload(void *unused2) {}
+
+/*
+ * Array containing entry points for different formats.
+ */
+
+static loader_funcs funcs[] = {
+ /* LD_ARCHIVE */
+ {ARCHIVELoadModule,
+ ARCHIVEResolveSymbols,
+ ARCHIVECheckForUnresolved,
+ ARCHIVEAddressToSection,
+ ARCHIVEUnload, {0,0,0,0,0}},
+ /* LD_ELFOBJECT */
+ {ELFLoadModule,
+ ELFResolveSymbols,
+ ELFCheckForUnresolved,
+ ELFAddressToSection,
+ ELFUnloadModule, {0,0,0,0,0}},
+ /* LD_COFFOBJECT */
+ {COFFLoadModule,
+ COFFResolveSymbols,
+ COFFCheckForUnresolved,
+ COFFAddressToSection,
+ COFFUnloadModule, {0,0,0,0,0}},
+ /* LD_XCOFFOBJECT */
+ {COFFLoadModule,
+ COFFResolveSymbols,
+ COFFCheckForUnresolved,
+ COFFAddressToSection,
+ COFFUnloadModule, {0,0,0,0,0}},
+ /* LD_AOUTOBJECT */
+ {AOUTLoadModule,
+ AOUTResolveSymbols,
+ AOUTCheckForUnresolved,
+ AOUTAddressToSection,
+ AOUTUnloadModule, {0,0,0,0,0}},
+ /* LD_AOUTDLOBJECT */
+#ifdef DLOPEN_SUPPORT
+ {DLLoadModule,
+ DLResolveSymbols,
+ DLCheckForUnresolved,
+ ARCHIVEAddressToSection,
+ DLUnloadModule, {0,0,0,0,0}},
+#else
+ {AOUTLoadModule,
+ AOUTResolveSymbols,
+ AOUTCheckForUnresolved,
+ AOUTAddressToSection,
+ AOUTUnloadModule, {0,0,0,0,0}},
+#endif
+ /* LD_ELFDLOBJECT */
+#ifdef DLOPEN_SUPPORT
+ {DLLoadModule,
+ DLResolveSymbols,
+ DLCheckForUnresolved,
+ ARCHIVEAddressToSection,
+ DLUnloadModule, {0,0,0,0,0}},
+#else
+ {ELFLoadModule,
+ ELFResolveSymbols,
+ ELFCheckForUnresolved,
+ ELFAddressToSection,
+ ELFUnloadModule, {0,0,0,0,0}},
+#endif
+ };
+
+int numloaders=sizeof(funcs)/sizeof(loader_funcs);
+
+
+void
+LoaderInit(void)
+{
+ const char *osname = NULL;
+
+ LoaderAddSymbols(-1, -1, miLookupTab ) ;
+ LoaderAddSymbols(-1, -1, xfree86LookupTab ) ;
+ LoaderAddSymbols(-1, -1, dixLookupTab ) ;
+ LoaderAddSymbols(-1, -1, fontLookupTab ) ;
+ LoaderAddSymbols(-1, -1, extLookupTab );
+#ifdef __sparc__
+#ifdef linux
+ if (sparcUseHWMulDiv())
+ LoaderAddSymbols(-1, -1, SparcV89LookupTab ) ;
+ else
+#endif
+ LoaderAddSymbols(-1, -1, SparcLookupTab ) ;
+#endif
+
+ xf86MsgVerb(X_INFO, 2, "Module ABI versions:\n");
+ xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
+ GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.ansicVersion));
+ xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV,
+ GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion));
+ xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT,
+ GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.xinputVersion));
+ xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION,
+ GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
+ xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_FONT,
+ GET_ABI_MAJOR(LoaderVersionInfo.fontVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.fontVersion));
+
+ LoaderGetOS(&osname, NULL, NULL, NULL);
+ if (osname)
+ xf86MsgVerb(X_INFO, 2, "Loader running on %s\n", osname);
+
+#if defined(linux) && \
+ (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__) \
+ || ( defined __x86_64__ && ! defined UseMMAP && ! defined DoMMAPedMerge))
+ /*
+ * The glibc malloc uses mmap for large allocations anyway. This breaks
+ * some relocation types because the offset overflow. See loader.h for more
+ * details. We need to turn off this behavior here.
+ */
+ mallopt(M_MMAP_MAX,0);
+#endif
+}
+
+/*
+ * Determine what type of object is being loaded.
+ * This function is responsible for restoring the offset.
+ * The fd and offset are used here so that when Archive processing
+ * is enabled, individual elements of an archive can be evaluated
+ * so the correct loader_funcs can be determined.
+ */
+static int
+_GetModuleType(int fd, long offset)
+{
+ unsigned char buf[256]; /* long enough for the largest magic type */
+
+ if( read(fd,buf,sizeof(buf)) < 0 ) {
+ return -1;
+ }
+
+#ifdef DEBUG
+ ErrorF("Checking module type %10s\n", buf );
+ ErrorF("Checking module type %x %x %x %x\n", buf[0], buf[1], buf[2], buf[3] );
+#endif
+
+ lseek(fd,offset,SEEK_SET);
+
+ if (strncmp((char *) buf, ARMAG, SARMAG) == 0) {
+ return LD_ARCHIVE;
+ }
+
+#if defined(AIAMAG)
+ /* LynxOS PPC style archives */
+ if (strncmp((char *) buf, AIAMAG, SAIAMAG) == 0) {
+ return LD_ARCHIVE;
+ }
+#endif
+
+ if (strncmp((char *) buf, ELFMAG, SELFMAG) == 0) {
+ if( *((Elf32_Half *)(buf + ELFDLOFF)) == ELFDLMAG ) {
+ return LD_ELFDLOBJECT;
+ } else {
+ return LD_ELFOBJECT;
+ }
+ }
+
+ if( buf[0] == 0x4c && buf[1] == 0x01 ) {
+ /* I386MAGIC */
+ return LD_COFFOBJECT;
+ }
+ if( buf[0] == 0x01 && buf[1] == 0xdf ) {
+ /* XCOFFMAGIC */
+ return LD_COFFOBJECT;
+ }
+ if( buf[0] == 0x0d && buf[1] == 0x01 ) {
+ /* ZCOFFMAGIC (LynxOS) */
+ return LD_COFFOBJECT;
+ }
+ if( buf[0] == 0x00 && buf[1] == 0x86 && buf[2] == 0x01 && buf[3] == 0x07) {
+ /* AOUTMAGIC */
+ return LD_AOUTOBJECT;
+ }
+ if (buf[0] == 0x07 && buf[1] == 0x01 && (buf[2] == 0x64 || buf[2] == 0x86))
+ {
+ /* AOUTMAGIC, (Linux OMAGIC, old impure format, also used by OS/2 */
+ return LD_AOUTOBJECT;
+ }
+ if (buf[0] == 0x07 && buf[1] == 0x01 && buf[2] == 0x00 && buf[3] == 0x00)
+ {
+ /* AOUTMAGIC, BSDI */
+ return LD_AOUTOBJECT;
+ }
+ if ((buf[0] == 0xc0 && buf[1] == 0x86) || /* big endian form */
+ (buf[3] == 0xc0 && buf[2] == 0x86)) { /* little endian form */
+ /* i386 shared object */
+ return LD_AOUTDLOBJECT;
+ }
+
+ return LD_UNKNOWN;
+}
+
+
+static int offsetbias=0; /* offset into archive */
+/*
+ * _LoaderFileToMem() loads the contents of a file into memory using
+ * the most efficient method for a platform.
+ */
+void *
+_LoaderFileToMem(int fd, unsigned long offset,int size, char *label)
+{
+#ifdef UseMMAP
+ unsigned long ret;
+# ifdef MmapPageAlign
+ unsigned long pagesize;
+ unsigned long new_size;
+ unsigned long new_off;
+ unsigned long new_off_bias;
+# endif
+# define MMAP_PROT (PROT_READ|PROT_WRITE|PROT_EXEC)
+
+# ifdef DEBUGMEM
+ ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)",fd,offset,offsetbias,size,label);
+# endif
+# ifdef MmapPageAlign
+ pagesize = getpagesize();
+ new_size = (size + pagesize - 1) / pagesize;
+ new_size *= pagesize;
+ new_off = (offset + offsetbias) / pagesize;
+ new_off *= pagesize;
+ new_off_bias = (offset + offsetbias) - new_off;
+ if ((new_off_bias + size) > new_size) new_size += pagesize;
+ ret = (unsigned long) mmap(0,new_size,MMAP_PROT,MAP_PRIVATE
+# ifdef __x86_64__
+ | MAP_32BIT
+# endif
+ ,
+ fd,new_off);
+ if(ret == -1)
+ FatalError("mmap() failed: %s\n", strerror(errno) );
+ return (void *)(ret + new_off_bias);
+# else
+ ret = (unsigned long) mmap(0,size,MMAP_PROT,MAP_PRIVATE
+# ifdef __x86_64__
+ | MAP_32BIT
+# endif
+ ,
+ fd,offset + offsetbias);
+ if(ret == -1)
+ FatalError("mmap() failed: %s\n", strerror(errno) );
+ return (void *)ret;
+# endif
+#else
+ char *ptr;
+
+# ifdef DEBUGMEM
+ ErrorF("_LoaderFileToMem(%d,%u(%u),%d,%s)",fd,offset,offsetbias,size,label);
+# endif
+
+ if(size == 0){
+# ifdef DEBUGMEM
+ ErrorF("=NULL\n",ptr);
+# endif
+ return NULL;
+ }
+
+# ifndef __UNIXOS2__
+ if( (ptr=xf86loadercalloc(size,1)) == NULL )
+ FatalError("_LoaderFileToMem() malloc failed\n" );
+# else
+ if( (ptr=os2ldcalloc(size,1)) == NULL )
+ FatalError("_LoaderFileToMem() malloc failed\n" );
+# endif
+# if defined(linux) && defined(__ia64__)
+ {
+ unsigned long page_size = getpagesize();
+ unsigned long round;
+
+ round = (unsigned long)ptr & (page_size-1);
+ mprotect(ptr - round, (size+round+page_size-1) & ~(page_size-1),
+ PROT_READ|PROT_WRITE|PROT_EXEC);
+ }
+# endif
+
+ if(lseek(fd,offset+offsetbias,SEEK_SET)<0)
+ FatalError("\n_LoaderFileToMem() lseek() failed: %s\n",strerror(errno));
+
+ if(read(fd,ptr,size)!=size)
+ FatalError("\n_LoaderFileToMem() read() failed: %s\n",strerror(errno));
+
+# if (defined(linux) || defined(__NetBSD__) || defined(__OpenBSD__)) \
+ && defined(__powerpc__)
+ /*
+ * Keep the instruction cache in sync with changes in the
+ * main memory.
+ */
+ {
+ int i;
+ for (i = 0; i < size; i += 16)
+ ppc_flush_icache(ptr+i);
+ ppc_flush_icache(ptr+size-1);
+ }
+# endif
+
+# ifdef DEBUGMEM
+ ErrorF("=%lx\n",ptr);
+# endif
+
+ return (void *)ptr;
+#endif
+}
+
+/*
+ * _LoaderFreeFileMem() free the memory in which a file was loaded.
+ */
+void
+_LoaderFreeFileMem(void *addr, int size)
+{
+#if defined (UseMMAP) && defined (MmapPageAlign)
+ unsigned long pagesize = getpagesize();
+ memType i_addr = (memType)addr;
+ unsigned long new_size;
+#endif
+#ifdef DEBUGMEM
+ ErrorF("_LoaderFreeFileMem(%x,%d)\n",addr,size);
+#endif
+#ifdef UseMMAP
+# if defined (MmapPageAlign)
+ i_addr /= pagesize;
+ i_addr *= pagesize;
+ new_size = (size + pagesize - 1) / pagesize;
+ new_size *= pagesize;
+ if (((memType)addr - i_addr + size) > new_size) new_size += pagesize;
+ munmap((void *)i_addr,new_size);
+# else
+ munmap((void *)addr,size);
+# endif
+#else
+ if(size == 0)
+ return;
+
+ xf86loaderfree(addr);
+#endif
+
+ return;
+}
+
+int
+_LoaderFileRead(int fd, unsigned int offset, void *buf, int size)
+{
+ if(lseek(fd,offset+offsetbias,SEEK_SET)<0)
+ FatalError("_LoaderFileRead() lseek() failed: %s\n", strerror(errno) );
+
+ if(read(fd,buf,size)!=size)
+ FatalError("_LoaderFileRead() read() failed: %s\n", strerror(errno) );
+
+ return size;
+}
+
+static loaderPtr listHead = (loaderPtr) 0 ;
+
+static loaderPtr
+_LoaderListPush()
+{
+ loaderPtr item = xf86loadercalloc(1, sizeof (struct _loader));
+ item->next = listHead ;
+ listHead = item;
+
+ return item;
+}
+
+static loaderPtr
+_LoaderListPop(int handle)
+{
+ loaderPtr item=listHead;
+ loaderPtr *bptr=&listHead; /* pointer to previous node */
+
+ while(item) {
+ if( item->handle == handle ) {
+ *bptr=item->next; /* remove this from the list */
+ return item;
+ }
+ bptr=&(item->next);
+ item=item->next;
+ }
+
+ return 0;
+}
+
+/*
+ * _LoaderHandleToName() will return the name of the first module with a
+ * given handle. This requires getting the last module on the LIFO with
+ * the given handle.
+ */
+char *
+_LoaderHandleToName(int handle)
+{
+ loaderPtr item=listHead;
+ loaderPtr aritem=NULL;
+ loaderPtr lastitem=NULL;
+
+ if ( handle < 0 ) {
+ return "(built-in)";
+ }
+ while(item) {
+ if( item->handle == handle ) {
+ if( strchr(item->name,':') == NULL )
+ aritem=item;
+ else
+ lastitem=item;
+ }
+ item=item->next;
+ }
+
+ if( aritem )
+ return aritem->name;
+
+ if( lastitem )
+ return lastitem->name;
+
+ return 0;
+}
+
+/*
+ * _LoaderHandleToCanonicalName() will return the cname of the first module
+ * with a given handle. This requires getting the last module on the LIFO with
+ * the given handle.
+ */
+char *
+_LoaderHandleToCanonicalName(int handle)
+{
+ loaderPtr item=listHead;
+ loaderPtr lastitem=NULL;
+
+ if ( handle < 0 ) {
+ return "(built-in)";
+ }
+ while(item) {
+ if( item->handle == handle ) {
+ lastitem=item;
+ }
+ item=item->next;
+ }
+
+ if( lastitem )
+ return lastitem->cname;
+
+ return NULL;
+}
+
+/*
+ * _LoaderModuleToName() will return the name of the first module with a
+ * given handle. This requires getting the last module on the LIFO with
+ * the given handle.
+ */
+char *
+_LoaderModuleToName(int module)
+{
+ loaderPtr item=listHead;
+ loaderPtr aritem=NULL;
+ loaderPtr lastitem=NULL;
+
+ if ( module < 0 ) {
+ return "(built-in)";
+ }
+ while(item) {
+ if( item->module == module ) {
+ if( strchr(item->name,':') == NULL )
+ aritem=item;
+ else
+ lastitem=item;
+ }
+ item=item->next;
+ }
+
+ if( aritem )
+ return aritem->name;
+
+ if( lastitem )
+ return lastitem->name;
+
+ return 0;
+}
+
+/*
+ * _LoaderAddressToSection() will return the name of the file & section
+ * that contains the given address.
+ */
+int
+_LoaderAddressToSection(const unsigned long address, const char **module,
+ const char ** section)
+{
+ loaderPtr item=listHead;
+
+ while(item) {
+ if( (*section=item->funcs->AddressToSection(item->private, address)) != NULL ) {
+ *module=_LoaderModuleToName(item->module);
+ return 1;
+ }
+ item=item->next;
+ }
+
+ return 0;
+}
+
+
+/*
+ * Add a list of symbols to the referenced list.
+ */
+
+static void
+AppendSymbol(symlist *list, const char *sym)
+{
+ list->list = xnfrealloc(list->list, (list->num + 1) * sizeof(char **));
+ list->list[list->num] = sym;
+ list->num++;
+}
+
+static void
+AppendSymList(symlist *list, const char **syms)
+{
+ while (*syms) {
+ AppendSymbol(list, *syms);
+ syms++;
+ }
+}
+
+static int
+SymInList(symlist *list, char *sym)
+{
+ int i;
+
+ for (i = 0; i < list->num; i++)
+ if (strcmp(list->list[i], sym) == 0)
+ return 1;
+
+ return 0;
+}
+
+void
+LoaderVRefSymbols(const char *sym0, va_list args)
+{
+ const char *s;
+
+ if (sym0 == NULL)
+ return;
+
+ s = sym0;
+ do {
+ AppendSymbol(&refList, s);
+ s = va_arg(args, const char *);
+ } while (s != NULL);
+}
+
+void
+LoaderRefSymbols(const char *sym0, ...)
+{
+ va_list ap;
+
+ va_start(ap, sym0);
+ LoaderVRefSymbols(sym0, ap);
+ va_end(ap);
+}
+
+void
+LoaderVRefSymLists(const char **list0, va_list args)
+{
+ const char **l;
+
+ if (list0 == NULL)
+ return;
+
+ l = list0;
+ do {
+ AppendSymList(&refList, l);
+ l = va_arg(args, const char **);
+ } while (l != NULL);
+}
+
+void
+LoaderRefSymLists(const char **list0, ...)
+{
+ va_list ap;
+
+ va_start(ap, list0);
+ LoaderVRefSymLists(list0, ap);
+ va_end(ap);
+}
+
+void
+LoaderVReqSymLists(const char **list0, va_list args)
+{
+ const char **l;
+
+ if (list0 == NULL)
+ return;
+
+ l = list0;
+ do {
+ AppendSymList(&reqList, l);
+ l = va_arg(args, const char **);
+ } while (l != NULL);
+}
+
+void
+LoaderReqSymLists(const char **list0, ...)
+{
+ va_list ap;
+
+ va_start(ap, list0);
+ LoaderVReqSymLists(list0, ap);
+ va_end(ap);
+}
+
+void
+LoaderVReqSymbols(const char *sym0, va_list args)
+{
+ const char *s;
+
+ if (sym0 == NULL)
+ return;
+
+ s = sym0;
+ do {
+ AppendSymbol(&reqList, s);
+ s = va_arg(args, const char *);
+ } while (s != NULL);
+}
+
+void
+LoaderReqSymbols(const char *sym0, ...)
+{
+ va_list ap;
+
+ va_start(ap, sym0);
+ LoaderVReqSymbols(sym0, ap);
+ va_end(ap);
+}
+
+/*
+ * _LoaderHandleUnresolved() decides what to do with an unresolved
+ * symbol. Symbols that are not on the "referenced" or "required" lists
+ * get a warning if they are unresolved. Symbols that are on the "required"
+ * list generate a fatal error if they are unresolved.
+ */
+
+int
+_LoaderHandleUnresolved(char *symbol, char *module)
+{
+ int fatalsym = 0;
+
+ if (xf86ShowUnresolved && !fatalsym) {
+ if (SymInList(&reqList, symbol)) {
+ fatalReqSym = 1;
+ ErrorF("Required symbol %s from module %s is unresolved!\n",
+ symbol, module);
+ }
+ if (!SymInList(&refList, symbol)) {
+ ErrorF("Symbol %s from module %s is unresolved!\n",
+ symbol, module);
+ }
+ }
+ return(fatalsym);
+}
+
+/*
+ * Handle an archive.
+ */
+void *
+ARCHIVELoadModule(loaderPtr modrec, int arfd, LOOKUP **ppLookup)
+{
+ loaderPtr tmp = NULL;
+ void *ret = NULL;
+ unsigned char magic[SARMAG];
+ struct ar_hdr hdr;
+#if defined(__powerpc__) && defined(Lynx)
+ struct fl_hdr fhdr;
+ char name[255];
+ int namlen;
+#endif
+ unsigned int size;
+ unsigned int offset;
+ int arnamesize, modnamesize;
+ char *slash, *longname;
+ char *nametable = NULL;
+ int nametablelen = 0;
+ LOOKUP *lookup_ret, *p;
+ LOOKUP *myLookup = NULL; /* Does realloc behave if ptr == 0? */
+ int modtype;
+ int i;
+ int numsyms = 0;
+ int resetoff;
+
+ /* lookup_ret = xf86loadermalloc(sizeof (LOOKUP *)); */
+
+ arnamesize=strlen(modrec->name);
+
+#if !(defined(__powerpc__) && defined(Lynx))
+ read(arfd,magic,SARMAG);
+
+ if(strncmp((const char *)magic,ARMAG,SARMAG) != 0 ) {
+ ErrorF("ARCHIVELoadModule: wrong magic!!\n" );
+ return NULL;
+ }
+ resetoff=SARMAG;
+#else
+ read(arfd,&fhdr,FL_HSZ);
+
+ if(strncmp(fhdr.fl_magic,AIAMAG,SAIAMAG) != 0 ) {
+ ErrorF("ARCHIVELoadModule: wrong magic!!\n" );
+ return NULL;
+ }
+ resetoff=FL_HSZ;
+#endif /* __powerpc__ && Lynx */
+
+#ifdef DEBUGAR
+ ErrorF("Looking for archive members starting at offset %o\n", offset );
+#endif
+
+ while( read(arfd,&hdr,sizeof(struct ar_hdr)) ) {
+
+ longname = NULL;
+ sscanf(hdr.ar_size,"%d",&size);
+#if defined(__powerpc__) && defined(Lynx)
+ sscanf(hdr.ar_namlen,"%d",&namlen);
+ name[0]=hdr.ar_name[0];
+ name[1]=hdr.ar_name[1];
+ read(arfd,&name[2],namlen);
+ name[namlen]='\0';
+ offset=lseek(arfd,0,SEEK_CUR);
+ if( offset&0x1 ) /* odd value */
+ offset=lseek(arfd,1,SEEK_CUR); /* make it an even boundary */
+#endif
+ offset=lseek(arfd,0,SEEK_CUR);
+
+ /* Check for a Symbol Table */
+ if( (hdr.ar_name[0] == '/' && hdr.ar_name[1] == ' ') ||
+#if defined(__powerpc__) && defined(Lynx)
+ namlen == 0 ||
+#endif
+ strncmp(hdr.ar_name, "__.SYMDEF", 9) == 0 ) {
+ /* If the file name is NULL, then it is a symbol table */
+#ifdef DEBUGAR
+ ErrorF("Symbol Table Member '%16.16s', size %d, offset %d\n",
+ hdr.ar_name, size, offset );
+ ErrorF("Symbol table size %d\n", size );
+#endif
+ offset=lseek(arfd,offset+size,SEEK_SET);
+ if( offset&0x1 ) /* odd value */
+ offset=lseek(arfd,1,SEEK_CUR); /* make it an even boundary */
+ continue;
+ }
+
+ /* Check for a String Table */
+ if( hdr.ar_name[0] == '/' && hdr.ar_name[1] == '/') {
+ /* If the file name is '/', then it is a string table */
+#ifdef DEBUGAR
+ ErrorF("String Table Member '%16.16s', size %d, offset %d\n",
+ hdr.ar_name, size, offset );
+ ErrorF("String table size %d\n", size );
+#endif
+ nametablelen = size;
+ nametable=(char *)xf86loadermalloc(nametablelen);
+ read(arfd, nametable, size);
+ offset=lseek(arfd,0,SEEK_CUR);
+ /* offset=lseek(arfd,offset+size,SEEK_SET); */
+ if( offset&0x1 ) /* odd value */
+ offset=lseek(arfd,1,SEEK_CUR); /* make it an even boundary */
+ continue;
+ }
+
+ if (hdr.ar_name[0] == '/') {
+ /* SYS V r4 style long member name */
+ int nameoffset = atol(&hdr.ar_name[1]);
+ char *membername;
+ if (!nametable) {
+ ErrorF( "Missing string table whilst processing %s\n",
+ modrec->name ) ;
+ offsetbias = 0;
+ return NULL;
+ }
+ if (nameoffset > nametablelen) {
+ ErrorF( "Invalid string table offset (%s) whilst processing %s\n",
+ hdr.ar_name, modrec->name ) ;
+ offsetbias = 0;
+ xf86loaderfree(nametable);
+ return NULL;
+ }
+ membername = nametable + nameoffset;
+ slash=strchr(membername,'/');
+ if (slash)
+ *slash = '\0';
+ longname = xf86loadermalloc(arnamesize + strlen(membername) + 2);
+ strcpy(longname,modrec->name);
+ strcat(longname,":");
+ strcat(longname,membername);
+ } else if (hdr.ar_name[0] == '#' && hdr.ar_name[1] == '1' &&
+ hdr.ar_name[2] == '/') {
+ /* BSD 4.4 style long member name */
+ if (sscanf(hdr.ar_name+3, "%d", &modnamesize) != 1) {
+ ErrorF("Bad archive member %s\n", hdr.ar_name);
+ offsetbias = 0;
+ return NULL;
+ }
+ /* allocate space for fully qualified name */
+ longname = xf86loadermalloc(arnamesize + modnamesize + 2);
+ strcpy(longname,modrec->name);
+ strcat(longname,":");
+ i = read(arfd, longname+modnamesize+1, modnamesize);
+ if (i != modnamesize) {
+ ErrorF("Bad archive member %d\n", hdr.ar_name);
+ xf86loaderfree(longname);
+ offsetbias = 0;
+ return NULL;
+ }
+ longname[i] = '\0';
+ offset += i;
+ size -= i;
+ } else {
+ /* Regular archive member */
+#ifdef DEBUGAR
+ ErrorF("Member '%16.16s', size %d, offset %x\n",
+#if !(defined(__powerpc__) && defined(Lynx))
+ hdr.ar_name,
+#else
+ name,
+#endif
+ size, offset );
+#endif
+
+ slash=strchr(hdr.ar_name,'/');
+ if (slash == NULL) {
+ /* BSD format without trailing slash */
+ slash = strchr(hdr.ar_name,' ');
+ }
+ /* SM: Make sure we do not overwrite other parts of struct */
+
+ if((slash - hdr.ar_name) > sizeof(hdr.ar_name))
+ slash = hdr.ar_name + sizeof(hdr.ar_name) -1;
+ *slash='\000';
+ }
+ if( (modtype=_GetModuleType(arfd,offset)) < 0 ) {
+ ErrorF( "%s is an unrecognized module type\n", hdr.ar_name ) ;
+ offsetbias=0;
+ if (nametable)
+ xf86loaderfree(nametable);
+ return NULL;
+ }
+
+ tmp=_LoaderListPush();
+
+ tmp->handle = modrec->handle;
+ tmp->module = moduleseq++;
+ tmp->cname = xf86loadermalloc(strlen(modrec->cname) + 1);
+ strcpy(tmp->cname, modrec->cname);
+ tmp->funcs=&funcs[modtype];
+ if (longname == NULL) {
+ modnamesize=strlen(hdr.ar_name);
+ tmp->name=(char *)xf86loadermalloc(arnamesize+modnamesize+2 );
+ strcpy(tmp->name,modrec->name);
+ strcat(tmp->name,":");
+ strcat(tmp->name,hdr.ar_name);
+
+ } else {
+ tmp->name = longname;
+ }
+ offsetbias=offset;
+
+ if((tmp->private = funcs[modtype].LoadModule(tmp, arfd,
+ &lookup_ret))
+ == NULL) {
+ ErrorF( "Failed to load %s\n", hdr.ar_name ) ;
+ offsetbias=0;
+ if (nametable)
+ xf86loaderfree(nametable);
+ return NULL;
+ }
+
+ offset=lseek(arfd,offset+size,SEEK_SET);
+ if( offset&0x1 ) /* odd value */
+ lseek(arfd,1,SEEK_CUR); /* make it an even boundary */
+
+ if (tmp->private == (void *) -1L) {
+ ErrorF("Skipping \"%s\": No symbols found\n", tmp->name);
+ continue;
+ }
+ else
+ ret = tmp->private;
+
+ /* Add the lookup table returned from funcs.LoadModule to the
+ * one we're going to return.
+ */
+ for (i = 0, p = lookup_ret; p && p->symName; i++, p++)
+ ;
+ if (i) {
+ myLookup = xf86loaderrealloc(myLookup, (numsyms + i + 1)
+ * sizeof (LOOKUP));
+ if (!myLookup)
+ continue; /* Oh well! */
+
+ memcpy(&(myLookup[numsyms]), lookup_ret, i * sizeof (LOOKUP));
+ numsyms += i;
+ myLookup[numsyms].symName = 0;
+ }
+ xf86loaderfree(lookup_ret);
+ }
+ /* xf86loaderfree(lookup_ret); */
+ offsetbias=0;
+
+ *ppLookup = myLookup;
+ if (nametable)
+ xf86loaderfree(nametable);
+
+ return ret;
+}
+
+/*
+ * Relocation list manipulation routines
+ */
+
+/*
+ * _LoaderGetRelocations() Return the list of outstanding relocations
+ */
+LoaderRelocPtr
+_LoaderGetRelocations(void *mod)
+{
+ loader_funcs *formatrec = (loader_funcs *)mod;
+
+ return &(formatrec->pRelocs);
+}
+
+/*
+ * Public Interface to the loader.
+ */
+
+int
+LoaderOpen(const char *module, const char *cname, int handle,
+ int *errmaj, int *errmin, int *wasLoaded)
+{
+ loaderPtr tmp ;
+ int new_handle, modtype ;
+ int fd;
+ LOOKUP *pLookup;
+
+#if defined(DEBUG)
+ ErrorF("LoaderOpen(%s)\n", module );
+#endif
+
+ /*
+ * Check to see if the module is already loaded.
+ * Only if we are loading it into an existing namespace.
+ * If it is to be loaded into a new namespace, don't check.
+ * Note: We only have one namespace.
+ */
+ if (handle >= 0) {
+ tmp = listHead;
+ while ( tmp ) {
+#ifdef DEBUGLIST
+ ErrorF("strcmp(%x(%s),{%x} %x(%s))\n", module,module,&(tmp->name),
+ tmp->name,tmp->name );
+#endif
+ if ( ! strcmp( module, tmp->name )) {
+ refCount[tmp->handle]++;
+ if (wasLoaded)
+ *wasLoaded = 1;
+ xf86MsgVerb(X_INFO, 2, "Reloading %s\n", module);
+ return tmp->handle;
+ }
+ tmp = tmp->next ;
+ }
+ }
+
+ /*
+ * OK, it's a new one. Add it.
+ */
+ xf86Msg(X_INFO, "Loading %s\n", module ) ;
+ if (wasLoaded)
+ *wasLoaded = 0;
+
+ /*
+ * Find a free handle.
+ */
+ new_handle = 1;
+ while ( freeHandles[new_handle] && new_handle < MAX_HANDLE )
+ new_handle ++ ;
+
+ if ( new_handle == MAX_HANDLE ) {
+ xf86Msg(X_ERROR, "Out of loader space\n" ) ; /* XXX */
+ if(errmaj) *errmaj = LDR_NOSPACE;
+ if(errmin) *errmin = LDR_NOSPACE;
+ return -1 ;
+ }
+
+ freeHandles[new_handle] = HANDLE_USED ;
+ refCount[new_handle] = 1;
+
+ if( (fd=open(module, O_RDONLY)) < 0 ) {
+ xf86Msg(X_ERROR, "Unable to open %s\n", module );
+ freeHandles[new_handle] = HANDLE_FREE ;
+ if(errmaj) *errmaj = LDR_NOMODOPEN;
+ if(errmin) *errmin = errno;
+ return -1 ;
+ }
+
+ if( (modtype=_GetModuleType(fd,0)) < 0 ) {
+ xf86Msg(X_ERROR, "%s is an unrecognized module type\n", module ) ;
+ freeHandles[new_handle] = HANDLE_FREE ;
+ if(errmaj) *errmaj = LDR_UNKTYPE;
+ if(errmin) *errmin = LDR_UNKTYPE;
+ return -1;
+ }
+
+ tmp=_LoaderListPush();
+ tmp->name = xf86loadermalloc(strlen(module) + 1);
+ strcpy(tmp->name, module);
+ tmp->cname = xf86loadermalloc(strlen(cname) + 1);
+ strcpy(tmp->cname, cname);
+ tmp->handle = new_handle;
+ tmp->module = moduleseq++;
+ tmp->funcs=&funcs[modtype];
+
+ if((tmp->private = funcs[modtype].LoadModule(tmp,fd, &pLookup)) == NULL) {
+ xf86Msg(X_ERROR, "Failed to load %s\n", module ) ;
+ _LoaderListPop(new_handle);
+ freeHandles[new_handle] = HANDLE_FREE ;
+ if(errmaj) *errmaj = LDR_NOLOAD;
+ if(errmin) *errmin = LDR_NOLOAD;
+ return -1;
+ }
+
+ if (tmp->private != (void *) -1L) {
+ LoaderAddSymbols(new_handle, tmp->module, pLookup);
+ xf86loaderfree(pLookup);
+ }
+
+ close(fd);
+
+ return new_handle;
+}
+
+int
+LoaderHandleOpen(int handle)
+{
+ if (handle < 0 || handle >= MAX_HANDLE)
+ return -1;
+
+ if (freeHandles[handle] != HANDLE_USED)
+ return -1;
+
+ refCount[handle]++;
+ return handle;
+}
+
+void *
+LoaderSymbol(const char *sym)
+{
+ int i;
+ itemPtr item = NULL;
+ for (i = 0; i < numloaders; i++)
+ funcs[i].ResolveSymbols(&funcs[i]);
+
+ item = (itemPtr) LoaderHashFind(sym);
+
+ if ( item )
+ return item->address ;
+ else
+#ifdef DLOPEN_SUPPORT
+ return(DLFindSymbol(sym));
+#else
+ return NULL;
+#endif
+}
+
+int
+LoaderResolveSymbols(void)
+{
+ int i;
+ for(i=0;i<numloaders;i++)
+ funcs[i].ResolveSymbols(&funcs[i]);
+ return 0;
+}
+
+int
+LoaderCheckUnresolved(int delay_flag )
+{
+ int i,ret=0;
+ LoaderResolveOptions delayFlag = delay_flag;
+
+ LoaderResolveSymbols();
+
+ if (delayFlag == LD_RESOLV_NOW) {
+ if (check_unresolved_sema > 0)
+ check_unresolved_sema--;
+ else
+ xf86Msg(X_WARNING, "LoaderCheckUnresolved: not enough "
+ "MAGIC_DONT_CHECK_UNRESOLVED\n");
+ }
+
+ if (!check_unresolved_sema || delayFlag == LD_RESOLV_FORCE)
+ for(i=0;i<numloaders;i++)
+ if (funcs[i].CheckForUnresolved(&funcs[i]))
+ ret=1;
+
+ if (fatalReqSym)
+ FatalError("Some required symbols were unresolved\n");
+
+ return ret;
+}
+
+void xf86LoaderTrap(void);
+
+void
+xf86LoaderTrap(void)
+{
+}
+
+void
+LoaderDefaultFunc(void)
+{
+ ErrorF("\n\n\tThis should not happen!\n"
+ "\tAn unresolved function was called!\n");
+
+ xf86LoaderTrap();
+
+ FatalError("\n");
+}
+
+int
+LoaderUnload(int handle)
+{
+ loaderRec fakeHead ;
+ loaderPtr tmp = & fakeHead ;
+
+ if ( handle < 0 || handle > MAX_HANDLE )
+ return -1;
+
+ /*
+ * check the reference count, only free it if it goes to zero
+ */
+ if (--refCount[handle])
+ return 0;
+ /*
+ * find the loaderRecs associated with this handle.
+ */
+
+ while( (tmp=_LoaderListPop(handle)) != NULL ) {
+ if( strchr(tmp->name,':') == NULL ) {
+ /* It is not a member of an archive */
+ xf86Msg(X_INFO, "Unloading %s\n", tmp->name ) ;
+ }
+ tmp->funcs->LoaderUnload(tmp->private);
+ xf86loaderfree(tmp->name);
+ xf86loaderfree(tmp->cname);
+ xf86loaderfree(tmp);
+ }
+
+ freeHandles[handle] = HANDLE_FREE ;
+
+return 0;
+}
+
+void
+LoaderDuplicateSymbol(const char *symbol, const int handle)
+{
+ ErrorF("Duplicate symbol %s in %s\n", symbol,
+ listHead ? listHead->name : "(built-in)");
+ ErrorF("Also defined in %s\n", _LoaderHandleToName(handle));
+ FatalError("Module load failure\n");
+}
+
+/* GDB Sync function */
+void _loader_debug_state()
+{
+}
+
+unsigned long LoaderOptions = 0;
+
+void
+LoaderResetOptions(void)
+{
+ LoaderOptions = 0;
+}
+
+void
+LoaderSetOptions(unsigned long opts)
+{
+ LoaderOptions |= opts;
+}
+
+void
+LoaderClearOptions(unsigned long opts)
+{
+ LoaderOptions &= ~opts;
+}
+
diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h
new file mode 100644
index 000000000..a814544b8
--- /dev/null
+++ b/hw/xfree86/loader/loader.h
@@ -0,0 +1,269 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.h,v 1.25 2001/02/22 23:17:09 dawes Exp $ */
+
+/*
+ *
+ * Copyright 1995-1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+#ifndef _LOADER_H
+#define _LOADER_H
+
+#include "sym.h"
+
+#if defined(Lynx) && defined(sun)
+#define const /**/
+#endif
+
+#if (defined(__i386__) || defined(__ix86)) && !defined(i386)
+#define i386
+#endif
+
+#include <X11/Xosdefs.h>
+#include <X11/Xfuncproto.h>
+#include <X11/Xmd.h>
+
+/* For LOOKUP definition */
+#include "sym.h"
+
+#define LD_UNKNOWN -1
+#define LD_ARCHIVE 0
+#define LD_ELFOBJECT 1
+#define LD_COFFOBJECT 2
+#define LD_XCOFFOBJECT 3
+#define LD_AOUTOBJECT 4
+#define LD_AOUTDLOBJECT 5
+#define LD_ELFDLOBJECT 6
+
+#define LD_PROCESSED_ARCHIVE -1
+
+/* #define UNINIT_SECTION */
+#define HANDLE_IN_HASH_ENTRY
+
+/*
+ * COFF Section nmumbers
+ */
+#define N_TEXT 1
+#define N_DATA 2
+#define N_BSS 3
+#define N_COMMENT 4
+
+#define TestFree(a) if (a) { xfree (a); a = NULL; }
+
+#define HASHDIV 10
+#define HASHSIZE (1<<HASHDIV)
+
+typedef struct _elf_reloc *ELFRelocPtr;
+typedef struct _elf_COMMON *ELFCommonPtr;
+typedef struct _coff_reloc *COFFRelocPtr;
+typedef struct _coff_COMMON *COFFCommonPtr;
+typedef struct AOUT_RELOC *AOUTRelocPtr;
+typedef struct AOUT_COMMON *AOUTCommonPtr;
+
+typedef struct _LoaderReloc {
+ int modtype;
+ struct _LoaderReloc *next;
+ COFFRelocPtr coff_reloc;
+ ELFRelocPtr elf_reloc;
+ AOUTRelocPtr aout_reloc;
+} LoaderRelocRec, *LoaderRelocPtr;
+
+typedef struct _loader_item *itemPtr;
+typedef struct _loader_item {
+ char *name ;
+ void *address ;
+ itemPtr next ;
+ int handle ;
+ int module ;
+ itemPtr exports;
+#if defined(__powerpc__)
+ /*
+ * PowerPC file formats require special routines in some circumstances
+ * to assist in the linking process. See the specific loader for
+ * more details.
+ */
+ union {
+ unsigned short plt[8]; /* ELF */
+ unsigned short glink[14]; /* XCOFF */
+ } code ;
+#endif
+ } itemRec ;
+
+/* The following structures provide an interface to GDB (note that GDB
+ has copies of the definitions - if you change anything here make
+ sure that the changes are also made to GDB */
+
+typedef struct {
+ char *name; /* Name of this symbol */
+ unsigned int namelen; /* Name of this module */
+ void *addr; /* Start address of the .text section */
+} LDRCommon, *LDRCommonPtr;
+
+typedef struct x_LDRModuleRec{
+ unsigned int version; /* Version of this struct */
+ char *name; /* Name of this module */
+ unsigned int namelen; /* Length of name */
+ void *text; /* Start address of the .text section */
+ void *data; /* Start address of the .data section */
+ void *rodata; /* Start address of the .rodata section */
+ void *bss; /* Start address of the .bss section */
+ LDRCommonPtr commons; /* List of commmon symbols */
+ int commonslen; /* Number of common symbols */
+ struct x_LDRModuleRec *next; /* Next module record in chain */
+} LDRModuleRec, *LDRModulePtr;
+
+extern char DebuggerPresent;
+extern LDRModulePtr ModList;
+extern LDRCommonPtr ldrCommons;
+extern int nCommons;
+
+/*
+ * The loader uses loader specific alloc/calloc/free functions that
+ * are mapped to either to the regular Xserver functions, or in a couple
+ * of special cases, mapped to the C library functions.
+ */
+#if !defined(PowerMAX_OS) && !(defined(linux) && (defined(__alpha__) || defined(__powerpc__) || defined(__ia64__))) && 0
+#define xf86loadermalloc(size) xalloc(size)
+#define xf86loaderrealloc(ptr,size) xrealloc(ptr,size)
+#define xf86loadercalloc(num,size) xcalloc(num,size)
+#define xf86loaderfree(ptr) xfree(ptr)
+#define xf86loaderstrdup(ptr) xstrdup(ptr)
+#else
+/*
+ * On Some OSes, xalloc() et al uses mmap to allocate space for large
+ * allocation. This has the effect of placing the text section of some
+ * modules very far away from the rest which are placed on the heap.
+ * Certain relocations are limited in the size of the offsets that can be
+ * handled, and this seperation causes these relocation to overflow. This
+ * is fixed by just using the C library allocation functions for the loader
+ * to ensure that all text sections are located on the heap. OSes that have
+ * this problem are:
+ * PowerMAX_OS/PPC
+ * Linux/Alpha
+ * Linux/PPC
+ * Linux/IA-64
+ */
+#define xf86loadermalloc(size) malloc(size)
+#define xf86loaderrealloc(ptr,size) realloc(ptr,size)
+#define xf86loadercalloc(num,size) calloc(num,size)
+#define xf86loaderfree(ptr) free(ptr)
+#define xf86loaderstrdup(ptr) strdup(ptr)
+#endif
+
+typedef struct _loader *loaderPtr;
+
+/*
+ * _loader_funcs hold the entry points for a module format.
+ */
+
+typedef void * (*LoadModuleProcPtr)(loaderPtr modrec, int fd, LOOKUP **);
+typedef void (*ResolveSymbolsProcPtr)(void *);
+typedef int (*CheckForUnresolvedProcPtr)(void *);
+typedef char * (*AddressToSectionProcPtr)(void *, unsigned long);
+typedef void (*LoaderUnloadProcPtr)(void *);
+
+typedef struct _loader_funcs {
+ LoadModuleProcPtr LoadModule;
+ ResolveSymbolsProcPtr ResolveSymbols;
+ CheckForUnresolvedProcPtr CheckForUnresolved;
+ AddressToSectionProcPtr AddressToSection;
+ LoaderUnloadProcPtr LoaderUnload;
+ LoaderRelocRec pRelocs; /* type specific relocations */
+} loader_funcs;
+
+/* Each module loaded has a loaderRec */
+typedef struct _loader {
+ int handle; /* Unique id used to remove symbols from
+ this module when it is unloaded */
+ int module; /* Unique id to identify compilation units */
+ char *name;
+ char *cname;
+ void *private; /* format specific data */
+ loader_funcs *funcs; /* funcs for operating on this module */
+ loaderPtr next;
+} loaderRec;
+
+/* Compiled-in version information */
+typedef struct {
+ INT32 xf86Version;
+ INT32 ansicVersion;
+ INT32 videodrvVersion;
+ INT32 xinputVersion;
+ INT32 extensionVersion;
+ INT32 fontVersion;
+} ModuleVersions;
+extern ModuleVersions LoaderVersionInfo;
+
+extern unsigned long LoaderOptions;
+
+/* Internal Functions */
+
+void LoaderAddSymbols(int, int, LOOKUP *);
+void LoaderDefaultFunc(void);
+void LoaderDuplicateSymbol(const char *, const int);
+#if 0
+void LoaderFixups(void);
+#endif
+void LoaderResolve(void);
+int LoaderResolveSymbols(void);
+int _LoaderHandleUnresolved(char *, char *);
+void LoaderHashAdd(itemPtr);
+itemPtr LoaderHashDelete(const char *);
+itemPtr LoaderHashFind(const char *);
+void LoaderHashTraverse(void *, int (*)(void *, itemPtr));
+void LoaderPrintAddress(const char *);
+void LoaderPrintItem(itemPtr);
+void LoaderPrintSymbol(unsigned long);
+void LoaderDumpSymbols(void);
+char *_LoaderModuleToName(int);
+int _LoaderAddressToSection(const unsigned long, const char **, const char **);
+int LoaderOpen(const char *, const char *, int, int *, int *, int *);
+int LoaderHandleOpen(int);
+
+/*
+ * File interface functions
+ */
+void *_LoaderFileToMem(int fd, unsigned long offset, int size, char *label);
+void _LoaderFreeFileMem(void *addr, int size);
+int _LoaderFileRead(int fd, unsigned int offset, void *addr, int size);
+
+/*
+ * Relocation list manipulation routines
+ */
+LoaderRelocPtr _LoaderGetRelocations(void *);
+
+/*
+ * object to name lookup routines
+ */
+char * _LoaderHandleToName(int handle);
+char * _LoaderHandleToCanonicalName(int handle);
+
+/*
+ * Entry points for the different loader types
+ */
+#include "aoutloader.h"
+#include "coffloader.h"
+#include "elfloader.h"
+#include "dlloader.h"
+/* LD_ARCHIVE */
+void *ARCHIVELoadModule(loaderPtr, int, LOOKUP **);
+
+extern void _loader_debug_state(void);
+
+#endif /* _LOADER_H */
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
new file mode 100644
index 000000000..ff6c64b07
--- /dev/null
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -0,0 +1,96 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loaderProcs.h,v 1.19 2002/07/30 18:36:18 dawes Exp $ */
+
+/*
+ *
+ * Copyright 1995-1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+#ifndef _LOADERPROCS_H
+#define _LOADERPROCS_H
+
+#define IN_LOADER
+#include "xf86Module.h"
+#include "fontmod.h"
+
+typedef struct module_desc {
+ struct module_desc *child;
+ struct module_desc *sib;
+ struct module_desc *parent;
+ struct module_desc *demand_next;
+ char *name;
+ char *filename;
+ char *identifier;
+ XID client_id;
+ int in_use;
+ int handle;
+ ModuleSetupProc SetupProc;
+ ModuleTearDownProc TearDownProc;
+ void *TearDownData; /* returned from SetupProc */
+ const char *path;
+ const XF86ModuleVersionInfo *VersionInfo;
+} ModuleDesc, *ModuleDescPtr;
+
+
+/*
+ * Extenal API for the loader
+ */
+
+void LoaderInit(void);
+
+ModuleDescPtr LoadDriver(const char *, const char *, int, pointer, int *,
+ int *);
+ModuleDescPtr LoadModule(const char *, const char *, const char **,
+ const char **, pointer, const XF86ModReqInfo *,
+ int *, int *);
+ModuleDescPtr LoadSubModule(ModuleDescPtr, const char *,
+ const char **, const char **, pointer,
+ const XF86ModReqInfo *, int *, int *);
+ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
+void LoadFont (FontModule *);
+void UnloadModule (ModuleDescPtr);
+void UnloadSubModule (ModuleDescPtr);
+void UnloadDriver (ModuleDescPtr);
+void FreeModuleDesc (ModuleDescPtr mod);
+ModuleDescPtr NewModuleDesc (const char *);
+ModuleDescPtr AddSibling (ModuleDescPtr head, ModuleDescPtr new);
+void LoaderSetPath(const char *path);
+void LoaderSortExtensions(void);
+
+
+void LoaderVReqSymLists(const char **, va_list args);
+void LoaderVReqSymbols(const char *, va_list args);
+void LoaderVRefSymLists(const char **, va_list args);
+void LoaderVRefSymbols(const char *, va_list args);
+
+void LoaderShowStack(void);
+void *LoaderSymbolHandle(const char *, int);
+int LoaderUnload(int);
+unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
+
+void LoaderResetOptions(void);
+void LoaderSetOptions(unsigned long);
+void LoaderClearOptions(unsigned long);
+
+/* Options for LoaderSetOptions */
+#define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001
+
+
+#endif /* _LOADERPROCS_H */
diff --git a/hw/xfree86/loader/loadext.c b/hw/xfree86/loader/loadext.c
new file mode 100644
index 000000000..206c8296a
--- /dev/null
+++ b/hw/xfree86/loader/loadext.c
@@ -0,0 +1,419 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadext.c,v 1.6 2000/02/08 17:19:19 dawes Exp $ */
+
+/* Copyright 2000 by The XFree86 Project, Inc */
+
+/* Maybe this file belongs elsewhere? */
+
+#define LOADERDECLARATIONS
+#include "loaderProcs.h"
+#include "misc.h"
+#include "xf86.h"
+
+ExtensionModule *ExtensionModuleList = NULL;
+static int numExtensionModules = 0;
+
+
+static ExtensionModule *
+NewExtensionModule(void)
+{
+ ExtensionModule *save = ExtensionModuleList;
+ int n;
+
+ /* Sanity check */
+ if (!ExtensionModuleList)
+ numExtensionModules = 0;
+
+ n = numExtensionModules + 1;
+ ExtensionModuleList = xrealloc(ExtensionModuleList,
+ (n + 1) * sizeof(ExtensionModule));
+ if (ExtensionModuleList == NULL) {
+ ExtensionModuleList = save;
+ return NULL;
+ } else {
+ numExtensionModules++;
+ ExtensionModuleList[numExtensionModules].name = NULL;
+ return ExtensionModuleList + (numExtensionModules - 1);
+ }
+}
+
+void
+LoadExtension(ExtensionModule *e, Bool builtin)
+{
+ ExtensionModule *newext;
+
+ if (e == NULL || e->name == NULL)
+ return;
+
+ if (!(newext = NewExtensionModule()))
+ return;
+
+ if (builtin)
+ xf86MsgVerb(X_INFO, 2, "Initializing built-in extension %s\n",
+ e->name);
+ else
+ xf86MsgVerb(X_INFO, 2, "Loading extension %s\n", e->name);
+
+ newext->name = e->name;
+ newext->initFunc = e->initFunc;
+ newext->disablePtr = e->disablePtr;
+ newext->setupFunc = e->setupFunc;
+ newext->initDependencies = e->initDependencies;
+
+ if (e->setupFunc != NULL)
+ e->setupFunc();
+}
+
+
+/*
+ * Sort ExtensionModuleList according to the initialisation order
+ * dependencies. The code for this is taken from BSD's tsort,
+ * and carries the following copyright/license:
+ *
+ *
+ * Copyright (c) 1989, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Michael Rendell of Memorial University of Newfoundland.
+ *
+ * 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 the University of
+ * California, Berkeley and its contributors.
+ * 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.
+ */
+
+
+#define NF_MARK 0x1 /* marker for cycle detection */
+#define NF_ACYCLIC 0x2 /* this node is cycle free */
+#define NF_NODEST 0x4 /* Unreachable */
+
+typedef struct node_str NODE;
+struct node_str {
+ NODE **n_prevp; /* pointer to previous node's n_next */
+ NODE *n_next; /* next node in graph */
+ NODE **n_arcs; /* array of arcs to other nodes */
+ int n_narcs; /* number of arcs in n_arcs[] */
+ int n_arcsize; /* size of n_arcs[] array */
+ int n_refcnt; /* # of arcs pointing to this node */
+ int n_flags; /* NF_* */
+ const char *n_name; /* name of this node */
+};
+
+static NODE *graph = NULL, **cycle_buf = NULL, **longest_cycle = NULL;
+static int longest = 0;
+static NODE *sorted = NULL, *last = NULL;
+
+/* Find a node in the graph (insert if not found) and return a pointer to it. */
+static NODE *
+get_node(const char *name)
+{
+ NODE *n;
+
+ for (n = graph; n && n->n_name && strcmp(n->n_name, name); n = n->n_next)
+ ;
+ if (n)
+ return (n);
+
+ n = xnfalloc(sizeof(NODE));
+
+ n->n_narcs = 0;
+ n->n_arcsize = 0;
+ n->n_arcs = NULL;
+ n->n_refcnt = 0;
+ n->n_flags = 0;
+ n->n_name = name;
+
+ /* Add to linked list. */
+ if ((n->n_next = graph) != NULL)
+ graph->n_prevp = &n->n_next;
+ n->n_prevp = &graph;
+ graph = n;
+
+ return (n);
+}
+
+
+/*
+ * add an arc from node s1 to node s2 in the graph. If s1 or s2 are not in
+ * the graph, then add them.
+ */
+static void
+add_arc(const char *s1, const char *s2)
+{
+ NODE *n1;
+ NODE *n2;
+ int bsize, i;
+
+ n1 = get_node(s1);
+
+ if (!strcmp(s1, s2))
+ return;
+
+ n2 = get_node(s2);
+
+ /*
+ * Check if this arc is already here.
+ */
+ for (i = 0; i < n1->n_narcs; i++)
+ if (n1->n_arcs[i] == n2)
+ return;
+ /*
+ * Add it.
+ */
+ if (n1->n_narcs == n1->n_arcsize) {
+ if (!n1->n_arcsize)
+ n1->n_arcsize = 10;
+ bsize = n1->n_arcsize * sizeof(*n1->n_arcs) * 2;
+ n1->n_arcs = xnfrealloc(n1->n_arcs, bsize);
+ n1->n_arcsize = bsize / sizeof(*n1->n_arcs);
+ }
+ n1->n_arcs[n1->n_narcs++] = n2;
+ ++n2->n_refcnt;
+}
+
+/*
+ * Clear the NODEST flag from all nodes.
+ */
+static void
+clear_cycle(void)
+{
+ NODE *n;
+
+ for (n = graph; n != NULL; n = n->n_next)
+ n->n_flags &= ~NF_NODEST;
+}
+
+/* print node and remove from graph (does not actually free node) */
+static void
+remove_node(NODE *n)
+{
+ NODE **np;
+ NODE *newnode;
+ int i;
+
+#ifdef DEBUG
+ ErrorF("%s\n", n->n_name);
+#endif
+ newnode = xnfalloc(sizeof(NODE));
+ memcpy(newnode, n, sizeof(NODE));
+ if (last)
+ last->n_next = newnode;
+ else
+ sorted = newnode;
+ last = newnode;
+ newnode->n_next = NULL;
+
+ for (np = n->n_arcs, i = n->n_narcs; --i >= 0; np++)
+ --(*np)->n_refcnt;
+ n->n_narcs = 0;
+ *n->n_prevp = n->n_next;
+ if (n->n_next)
+ n->n_next->n_prevp = n->n_prevp;
+}
+
+
+static void
+free_nodes(NODE *nodelist)
+{
+ NODE *n, *nextnode;
+
+ for (n = nodelist; n;) {
+ nextnode = n->n_next;
+ xfree(n);
+ n = nextnode;
+ }
+}
+
+
+/* look for the longest? cycle from node from to node to. */
+static int
+find_cycle(NODE *from, NODE *to, int longest_len, int depth)
+{
+ NODE **np;
+ int i, len;
+
+ /*
+ * avoid infinite loops and ignore portions of the graph known
+ * to be acyclic
+ */
+ if (from->n_flags & (NF_NODEST|NF_MARK|NF_ACYCLIC))
+ return (0);
+ from->n_flags |= NF_MARK;
+
+ for (np = from->n_arcs, i = from->n_narcs; --i >= 0; np++) {
+ cycle_buf[depth] = *np;
+ if (*np == to) {
+ if (depth + 1 > longest_len) {
+ longest_len = depth + 1;
+ memcpy((char *)longest_cycle,
+ (char *)cycle_buf,
+ longest_len * sizeof(NODE *));
+ }
+ } else {
+ if ((*np)->n_flags & (NF_MARK|NF_ACYCLIC|NF_NODEST))
+ continue;
+ len = find_cycle(*np, to, longest_len, depth + 1);
+
+#ifdef DEBUG
+ ErrorF("%*s %s->%s %d\n", depth, "",
+ from->n_name, to->n_name, len);
+#endif
+
+ if (len == 0)
+ (*np)->n_flags |= NF_NODEST;
+
+ if (len > longest_len)
+ longest_len = len;
+
+ if (len > 0 && !longest)
+ break;
+ }
+ }
+ from->n_flags &= ~NF_MARK;
+ return (longest_len);
+}
+
+
+/* do topological sort on graph */
+static void
+tsort(void)
+{
+ NODE *n, *next;
+ int cnt, i;
+
+ while (graph != NULL) {
+ /*
+ * Keep getting rid of simple cases until there are none left,
+ * if there are any nodes still in the graph, then there is
+ * a cycle in it.
+ */
+ do {
+ for (cnt = 0, n = graph; n != NULL; n = next) {
+ next = n->n_next;
+ if (n->n_refcnt == 0) {
+ remove_node(n);
+ ++cnt;
+ }
+ }
+ } while (graph != NULL && cnt);
+
+ if (graph == NULL)
+ break;
+
+ if (!cycle_buf) {
+ /*
+ * Allocate space for two cycle logs - one to be used
+ * as scratch space, the other to save the longest
+ * cycle.
+ */
+ for (cnt = 0, n = graph; n != NULL; n = n->n_next)
+ ++cnt;
+ cycle_buf = xnfalloc(sizeof(NODE *) * cnt);
+ longest_cycle = xnfalloc(sizeof(NODE *) * cnt);
+ if (cycle_buf == NULL || longest_cycle == NULL)
+ return;
+ }
+ for (n = graph; n != NULL; n = n->n_next)
+ if (!(n->n_flags & NF_ACYCLIC)) {
+ if ((cnt = find_cycle(n, n, 0, 0))) {
+ ErrorF("tsort: cycle in data");
+ for (i = 0; i < cnt; i++)
+ ErrorF("%s",
+ longest_cycle[i]->n_name);
+ remove_node(n);
+ clear_cycle();
+ break;
+ } else {
+ /* to avoid further checks */
+ n->n_flags |= NF_ACYCLIC;
+ clear_cycle();
+ }
+ }
+
+ if (n == NULL)
+ ErrorF("tsort: internal error -- could not find cycle");
+ }
+ if (cycle_buf)
+ xfree(cycle_buf);
+ if (longest_cycle)
+ xfree(longest_cycle);
+ if (graph)
+ free_nodes(graph);
+}
+
+void
+LoaderSortExtensions()
+{
+ int i, j;
+ ExtensionModule *ext, *newList;
+ NODE *node;
+
+ graph = NULL;
+ longest = 0;
+ sorted = NULL;
+ last = NULL;
+ cycle_buf = NULL;
+ longest_cycle = NULL;
+
+ /*
+ * Parse list and build the graph. Enter them in reverse order
+ * because tsort() will reverse those that have no depedencies.
+ */
+ for (i = numExtensionModules - 1; i >= 0; i--) {
+ ext = &ExtensionModuleList[i];
+ add_arc(ext->name, ext->name);
+#ifdef DEBUG
+ ErrorF("Extension %s:\n", ext->name);
+#endif
+ if (ext->initDependencies)
+ for (j = 0; ext->initDependencies[j]; j++) {
+ add_arc(ext->initDependencies[j], ext->name);
+#ifdef DEBUG
+ ErrorF("\t%s\n", ext->initDependencies[j]);
+#endif
+ }
+ }
+ tsort();
+ newList = xnfalloc((numExtensionModules + 1) * sizeof(ExtensionModule));
+ i = 0;
+ for (node = sorted; node; node = node->n_next) {
+ for (j = 0; j < numExtensionModules; j++)
+ if (!strcmp(node->n_name, ExtensionModuleList[j].name))
+ break;
+ if (j != numExtensionModules)
+ newList[i++] = ExtensionModuleList[j];
+ }
+ if (sorted)
+ free_nodes(sorted);
+ newList[i].name = NULL;
+ xfree(ExtensionModuleList);
+ ExtensionModuleList = newList;
+#ifdef DEBUG
+ for (i = 0; ExtensionModuleList[i].name; i++)
+ ErrorF("Extension %s\n", ExtensionModuleList[i].name);
+#endif
+}
+
diff --git a/hw/xfree86/loader/loadfont.c b/hw/xfree86/loader/loadfont.c
new file mode 100644
index 000000000..8ab5d0d6e
--- /dev/null
+++ b/hw/xfree86/loader/loadfont.c
@@ -0,0 +1,53 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadfont.c,v 1.2 1998/12/13 12:42:41 dawes Exp $ */
+
+/* Maybe this file belongs in lib/font/fontfile/module/ ? */
+
+#define LOADERDECLARATIONS
+#include "loaderProcs.h"
+#include "misc.h"
+#include "xf86.h"
+
+FontModule *FontModuleList = NULL;
+static int numFontModules = 0;
+
+
+static FontModule *
+NewFontModule(void)
+{
+ FontModule *save = FontModuleList;
+ int n;
+
+ /* Sanity check */
+ if (!FontModuleList)
+ numFontModules = 0;
+
+ n = numFontModules + 1;
+ FontModuleList = xrealloc(FontModuleList, (n + 1) * sizeof(FontModule));
+ if (FontModuleList == NULL) {
+ FontModuleList = save;
+ return NULL;
+ } else {
+ numFontModules++;
+ FontModuleList[numFontModules].name = NULL;
+ return FontModuleList + (numFontModules - 1);
+ }
+}
+
+void
+LoadFont(FontModule *f)
+{
+ FontModule *newfont;
+
+ if (f == NULL)
+ return;
+
+ if (!(newfont = NewFontModule()))
+ return;
+
+ xf86MsgVerb(X_INFO, 2, "Loading font %s\n", f->name);
+
+ newfont->name = f->name;
+ newfont->initFunc = f->initFunc;
+ newfont->module = f->module;
+}
+
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
new file mode 100644
index 000000000..deba80643
--- /dev/null
+++ b/hw/xfree86/loader/loadmod.c
@@ -0,0 +1,1296 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadmod.c,v 1.68 2002/07/30 18:36:18 dawes Exp $ */
+
+/*
+ *
+ * Copyright 1995-1998 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+/* This file is best viewed with tab stops set to 4 spaces */
+
+#include "os.h"
+/* For stat() and related stuff */
+#define NO_OSLIB_PROTOTYPES
+#include "xf86_OSlib.h"
+#define LOADERDECLARATIONS
+#include "loaderProcs.h"
+#include "misc.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#ifdef XINPUT
+#include "xf86Xinput.h"
+#endif
+#include "loader.h"
+#include "xf86Optrec.h"
+
+#include <sys/types.h>
+#include <regex.h>
+#include <dirent.h>
+#include <limits.h>
+
+extern int check_unresolved_sema;
+
+typedef struct _pattern {
+ const char * pattern;
+ regex_t rex;
+} PatternRec, *PatternPtr;
+
+/* Prototypes for static functions */
+static char *FindModule (const char *, const char *, const char **, PatternPtr);
+static Bool CheckVersion (const char *, XF86ModuleVersionInfo *,
+ const XF86ModReqInfo *);
+static void UnloadModuleOrDriver (ModuleDescPtr mod);
+static char *LoaderGetCanonicalName(const char *, PatternPtr);
+static void RemoveChild(ModuleDescPtr);
+
+ModuleVersions LoaderVersionInfo = {
+ XF86_VERSION_CURRENT,
+ ABI_ANSIC_VERSION,
+ ABI_VIDEODRV_VERSION,
+ ABI_XINPUT_VERSION,
+ ABI_EXTENSION_VERSION,
+ ABI_FONT_VERSION
+};
+
+#if 0
+void
+LoaderFixups (void)
+{
+ /* Need to call LRS here because the frame buffers get loaded last,
+ * and the drivers depend on them. */
+
+ LoaderResolveSymbols ();
+}
+#endif
+
+static void
+FreeStringList(char **paths)
+{
+ char **p;
+
+ if (!paths)
+ return;
+
+ for (p = paths; *p; p++)
+ xfree(*p);
+
+ xfree(paths);
+}
+
+static char **defaultPathList = NULL;
+
+/*
+ * Convert a comma-separated path into a NULL-terminated array of path
+ * elements, rejecting any that are not full absolute paths, and appending
+ * a '/' when it isn't already present.
+ */
+static char **
+InitPathList(const char *path)
+{
+ char *fullpath = NULL;
+ char *elem = NULL;
+ char **list = NULL, **save = NULL;
+ int len;
+ int addslash;
+ int n = 0;
+
+ if (!path)
+ return defaultPathList;
+
+ fullpath = xstrdup(path);
+ if (!fullpath)
+ return NULL;
+ elem = strtok(fullpath, ",");
+ while (elem) {
+ /* Only allow fully specified paths */
+#ifndef __UNIXOS2__
+ if (*elem == '/')
+#else
+ if (*elem == '/' || (strlen(elem) > 2 && isalpha(elem[0]) &&
+ elem[1] == ':' && elem[2] == '/'))
+#endif
+ {
+ len = strlen(elem);
+ addslash = (elem[len - 1] != '/');
+ if (addslash)
+ len++;
+ save = list;
+ list = xrealloc(list, (n + 2) * sizeof(char *));
+ if (!list) {
+ if (save) {
+ save[n] = NULL;
+ FreeStringList(save);
+ }
+ xfree(fullpath);
+ return NULL;
+ }
+ list[n] = xalloc(len + 1);
+ if (!list[n]) {
+ FreeStringList(list);
+ xfree(fullpath);
+ return NULL;
+ }
+ strcpy(list[n], elem);
+ if (addslash) {
+ list[n][len - 1] = '/';
+ list[n][len] = '\0';
+ }
+ n++;
+ }
+ elem = strtok(NULL, ",");
+ }
+ if (list)
+ list[n] = NULL;
+ return list;
+}
+
+static void
+FreePathList(char **pathlist)
+{
+ if (pathlist && pathlist != defaultPathList)
+ FreeStringList(pathlist);
+}
+
+void
+LoaderSetPath(const char *path)
+{
+ if (!path)
+ return;
+
+ defaultPathList = InitPathList(path);
+}
+
+/* Standard set of module subdirectories to search, in order of preference */
+static const char *stdSubdirs[] =
+{
+ "drivers/",
+ "input/",
+ "multimedia/",
+ "extensions/",
+ "fonts/",
+ "internal/",
+ "",
+ NULL
+};
+
+/*
+ * Standard set of module name patterns to check, in order of preference
+ * These are regular expressions (suitable for use with POSIX regex(3)).
+ */
+static PatternRec stdPatterns[] = {
+ { "^lib(.*)\\.so$", },
+ { "^lib(.*)\\.a$", },
+ { "(.*)_drv\\.so$", },
+ { "(.*)_drv\\.o$", },
+ { "(.*)\\.so$", },
+ { "(.*)\\.a$", },
+ { "(.*)\\.o$", },
+ { NULL, }
+};
+
+static PatternPtr
+InitPatterns(const char **patternlist)
+{
+ char errmsg[80];
+ int i, e;
+ PatternPtr patterns = NULL;
+ PatternPtr p = NULL;
+ static int firstTime = 1;
+ const char **s;
+
+ if (firstTime) {
+ /* precompile stdPatterns */
+ firstTime = 0;
+ for (p = stdPatterns; p->pattern; p++)
+ if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) {
+ regerror(e, &p->rex, errmsg, sizeof(errmsg));
+ FatalError("InitPatterns: regcomp error for `%s': %s\n",
+ p->pattern, errmsg);
+ }
+ }
+
+ if (patternlist) {
+ for (i = 0, s = patternlist; *s; i++, s++)
+ if (*s == DEFAULT_LIST)
+ i += sizeof(stdPatterns) / sizeof(stdPatterns[0]) - 1 - 1;
+ patterns = xalloc((i + 1) * sizeof(PatternRec));
+ if (!patterns) {
+ return NULL;
+ }
+ for (i = 0, s = patternlist; *s; i++, s++)
+ if (*s != DEFAULT_LIST) {
+ p = patterns + i;
+ p->pattern = *s;
+ if ((e = regcomp(&p->rex, p->pattern, REG_EXTENDED)) != 0) {
+ regerror(e, &p->rex, errmsg, sizeof(errmsg));
+ ErrorF("InitPatterns: regcomp error for `%s': %s\n",
+ p->pattern, errmsg);
+ i--;
+ }
+ } else {
+ for (p = stdPatterns; p->pattern; p++, i++)
+ patterns[i] = *p;
+ if (p != stdPatterns)
+ i--;
+ }
+ patterns[i].pattern = NULL;
+ } else
+ patterns = stdPatterns;
+ return patterns;
+}
+
+static void
+FreePatterns(PatternPtr patterns)
+{
+ if (patterns && patterns != stdPatterns)
+ xfree(patterns);
+}
+
+static const char **
+InitSubdirs(const char **subdirlist)
+{
+ int i;
+ char **subdirs = NULL;
+ const char **s, **stmp = NULL;
+ const char *osname;
+ const char *slash;
+ int oslen = 0, len;
+ Bool indefault;
+
+ if (subdirlist == NULL) {
+ subdirlist = xalloc(2 * sizeof(char *));
+ if (subdirlist == NULL)
+ return NULL;
+ subdirlist[0] = DEFAULT_LIST;
+ subdirlist[1] = NULL;
+ }
+
+ LoaderGetOS(&osname, NULL, NULL, NULL);
+ oslen = strlen(osname);
+
+ {
+ /* Count number of entries and check for invalid paths */
+ for (i = 0, s = subdirlist; *s; i++, s++) {
+ if (*s == DEFAULT_LIST) {
+ i += sizeof(stdSubdirs) / sizeof(stdSubdirs[0]) - 1 - 1;
+ } else {
+ /*
+ * Path validity check. Don't allow absolute paths, or
+ * paths containing "..". To catch absolute paths on
+ * platforms that use driver letters, don't allow the ':'
+ * character to appear at all.
+ */
+ if (**s == '/' || **s == '\\' || strchr(*s, ':') ||
+ strstr(*s, "..")) {
+ xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s);
+ return NULL;
+ }
+ }
+ }
+ subdirs = xalloc((i * 2 + 1) * sizeof(char *));
+ if (!subdirs)
+ return NULL;
+ i = 0;
+ s = subdirlist;
+ indefault = FALSE;
+ while (*s) {
+ if (*s == DEFAULT_LIST) {
+ /* Divert to the default list */
+ indefault = TRUE;
+ stmp = ++s;
+ s = stdSubdirs;
+ }
+ len = strlen(*s);
+ if (**s && (*s)[len - 1] != '/') {
+ slash = "/";
+ len++;
+ } else
+ slash = "";
+ len += oslen + 2;
+ if (!(subdirs[i] = xalloc(len)))
+ return NULL;
+ /* tack on the OS name */
+ sprintf(subdirs[i], "%s%s%s/", *s, slash, osname);
+ i++;
+ /* path as given */
+ subdirs[i] = xstrdup(*s);
+ i++;
+ s++;
+ if (indefault && !s) {
+ /* revert back to the main list */
+ indefault = FALSE;
+ s = stmp;
+ }
+ }
+ subdirs[i] = NULL;
+ }
+ return (const char **)subdirs;
+}
+
+static void
+FreeSubdirs(const char **subdirs)
+{
+ const char **s;
+
+ if (subdirs) {
+ for (s = subdirs; *s; s++)
+ xfree(*s);
+ xfree(subdirs);
+ }
+}
+
+static char *
+FindModule (const char *module, const char *dir, const char **subdirlist,
+ PatternPtr patterns)
+{
+ char buf[PATH_MAX + 1];
+ char *dirpath = NULL;
+ char *name = NULL;
+ struct stat stat_buf;
+ int len, dirlen;
+ char *fp;
+ DIR *d;
+ const char **subdirs = NULL;
+ PatternPtr p = NULL;
+ const char **s;
+ struct dirent *dp;
+ regmatch_t match[2];
+
+ subdirs = InitSubdirs(subdirlist);
+ if (!subdirs)
+ return NULL;
+
+#ifndef __EMX__
+ dirpath = (char *)dir;
+#else
+ dirpath = xalloc(strlen(dir) + 10);
+ strcpy(dirpath, (char *) __XOS2RedirRoot (dir));
+#endif
+ if (strlen(dirpath) > PATH_MAX)
+ return NULL;
+ /*xf86Msg(X_INFO,"OS2DIAG: FindModule: dirpath=%s\n",dirpath);*/
+
+ for (s = subdirs; *s; s++) {
+ if ((dirlen = strlen(dirpath) + strlen(*s)) > PATH_MAX)
+ continue;
+ strcpy(buf, dirpath);
+ strcat(buf, *s);
+ /*xf86Msg(X_INFO,"OS2DIAG: FindModule: buf=%s\n",buf);*/
+ fp = buf + dirlen;
+ if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) &&
+ (d = opendir(buf))) {
+ if (buf[dirlen - 1] != '/') {
+ buf[dirlen++] = '/';
+ fp++;
+ }
+ while ((dp = readdir(d))) {
+ if (dirlen + strlen(dp->d_name) + 1 > PATH_MAX)
+ continue;
+ strcpy(fp, dp->d_name);
+ if (!(stat(buf, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode)))
+ continue;
+ for (p = patterns; p->pattern; p++) {
+ if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 &&
+ match[1].rm_so != -1) {
+ len = match[1].rm_eo - match[1].rm_so;
+ if (len == strlen(module) &&
+ strncmp(module, dp->d_name + match[1].rm_so, len) == 0) {
+ /*xf86Msg(X_INFO,"OS2DIAG: matching %s\n",buf);*/
+ name = buf;
+ break;
+ }
+ }
+ }
+ if (name)
+ break;
+ }
+ closedir(d);
+ if (name)
+ break;
+ }
+ }
+ FreeSubdirs(subdirs);
+ if (dirpath != dir)
+ xfree(dirpath);
+
+ if (name) {
+ return xstrdup(name);
+ }
+ return NULL;
+}
+
+char **
+LoaderListDirs(const char **subdirlist, const char **patternlist)
+{
+ char buf[PATH_MAX + 1];
+ char **pathlist;
+ char **elem;
+ const char **subdirs;
+ const char **s;
+ PatternPtr patterns;
+ PatternPtr p;
+ DIR *d;
+ struct dirent *dp;
+ regmatch_t match[2];
+ struct stat stat_buf;
+ int len, dirlen;
+ char *fp;
+ char **listing = NULL;
+ char **save;
+ int n = 0;
+
+ if (!(pathlist = InitPathList(NULL)))
+ return NULL;
+ if (!(subdirs = InitSubdirs(subdirlist))) {
+ FreePathList(pathlist);
+ return NULL;
+ }
+ if (!(patterns = InitPatterns(patternlist))) {
+ FreePathList(pathlist);
+ FreeSubdirs(subdirs);
+ return NULL;
+ }
+
+ for (elem = pathlist; *elem; elem++) {
+ for (s = subdirs; *s; s++) {
+ if ((dirlen = strlen(*elem) + strlen(*s)) > PATH_MAX)
+ continue;
+ strcpy(buf, *elem);
+ strcat(buf, *s);
+ fp = buf + dirlen;
+ if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) &&
+ (d = opendir(buf))) {
+ if (buf[dirlen - 1] != '/') {
+ buf[dirlen++] = '/';
+ fp++;
+ }
+ while ((dp = readdir(d))) {
+ if (dirlen + strlen(dp->d_name) > PATH_MAX)
+ continue;
+ strcpy(fp, dp->d_name);
+ if (!(stat(buf, &stat_buf) == 0 &&
+ S_ISREG(stat_buf.st_mode)))
+ continue;
+ for (p = patterns; p->pattern; p++) {
+ if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 &&
+ match[1].rm_so != -1) {
+ len = match[1].rm_eo - match[1].rm_so;
+ save = listing;
+ listing = xrealloc(listing,
+ (n + 2) * sizeof(char *));
+ if (!listing) {
+ if (save) {
+ save[n] = NULL;
+ FreeStringList(save);
+ }
+ FreePathList(pathlist);
+ FreeSubdirs(subdirs);
+ FreePatterns(patterns);
+ return NULL;
+ }
+ listing[n] = xalloc(len + 1);
+ if (!listing[n]) {
+ FreeStringList(listing);
+ FreePathList(pathlist);
+ FreeSubdirs(subdirs);
+ FreePatterns(patterns);
+ return NULL;
+ }
+ strncpy(listing[n], dp->d_name + match[1].rm_so,
+ len);
+ listing[n][len] = '\0';
+ n++;
+ break;
+ }
+ }
+ }
+ closedir(d);
+ }
+ }
+ }
+ if (listing)
+ listing[n] = NULL;
+ return listing;
+}
+
+void
+LoaderFreeDirList(char **list)
+{
+ FreeStringList(list);
+}
+
+
+static Bool
+CheckVersion (const char *module, XF86ModuleVersionInfo *data,
+ const XF86ModReqInfo *req)
+{
+ int vercode[4];
+ char verstr[4];
+ long ver = data->xf86version;
+ int errtype = 0;
+
+ xf86Msg (X_INFO, "Module %s: vendor=\"%s\"\n",
+ data->modname ? data->modname : "UNKNOWN!",
+ data->vendor ? data->vendor : "UNKNOWN!");
+
+ if (ver > (4 << 24)) {
+ /* 4.0.x and earlier */
+ verstr[1] = verstr[3] = 0;
+ verstr[2] = (ver & 0x1f) ? (ver & 0x1f) + 'a' - 1 : 0;
+ ver >>= 5;
+ verstr[0] = (ver & 0x1f) ? (ver & 0x1f) + 'A' - 1 : 0;
+ ver >>= 5;
+ vercode[2] = ver & 0x7f;
+ ver >>= 7;
+ vercode[1] = ver & 0x7f;
+ ver >>= 7;
+ vercode[0] = ver;
+ xf86ErrorF("\tcompiled for %d.%d", vercode[0], vercode[1]);
+ if (vercode[2] != 0)
+ xf86ErrorF(".%d", vercode[2]);
+ xf86ErrorF("%s%s, module version = %d.%d.%d\n", verstr, verstr + 2,
+ data->majorversion, data->minorversion, data->patchlevel);
+ } else {
+ vercode[0] = ver / 10000000;
+ vercode[1] = (ver / 100000) % 100;
+ vercode[2] = (ver / 1000) % 100;
+ vercode[3] = ver % 1000;
+ xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1],
+ vercode[2]);
+ if (vercode[3] != 0)
+ xf86ErrorF(".%d", vercode[3]);
+ xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion,
+ data->minorversion, data->patchlevel);
+ }
+
+ if (data->moduleclass)
+ xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass);
+
+ ver = -1;
+ if (data->abiclass) {
+ int abimaj, abimin;
+ int vermaj, vermin;
+
+ if (!strcmp(data->abiclass, ABI_CLASS_ANSIC))
+ ver = LoaderVersionInfo.ansicVersion;
+ else if (!strcmp(data->abiclass, ABI_CLASS_VIDEODRV))
+ ver = LoaderVersionInfo.videodrvVersion;
+ else if (!strcmp(data->abiclass, ABI_CLASS_XINPUT))
+ ver = LoaderVersionInfo.xinputVersion;
+ else if (!strcmp(data->abiclass, ABI_CLASS_EXTENSION))
+ ver = LoaderVersionInfo.extensionVersion;
+ else if (!strcmp(data->abiclass, ABI_CLASS_FONT))
+ ver = LoaderVersionInfo.fontVersion;
+
+ abimaj = GET_ABI_MAJOR(data->abiversion);
+ abimin = GET_ABI_MINOR(data->abiversion);
+ xf86ErrorFVerb(2, "\tABI class: %s, version %d.%d\n",
+ data->abiclass, abimaj, abimin);
+ if (ver != -1) {
+ vermaj = GET_ABI_MAJOR(ver);
+ vermin = GET_ABI_MINOR(ver);
+ if (abimaj != vermaj) {
+ if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
+ errtype = X_WARNING;
+ else
+ errtype = X_ERROR;
+ xf86MsgVerb(errtype, 0,
+ "module ABI major version (%d) doesn't"
+ " match the server's version (%d)\n",
+ abimaj, vermaj);
+ if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL))
+ return FALSE;
+ } else if (abimin > vermin) {
+ if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL)
+ errtype = X_WARNING;
+ else
+ errtype = X_ERROR;
+ xf86MsgVerb(errtype, 0,
+ "module ABI minor version (%d) is "
+ "newer than the server's version "
+ "(%d)\n", abimin, vermin);
+ if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL))
+ return FALSE;
+ }
+ }
+ }
+
+ /* Check against requirements that the caller has specified */
+ if (req) {
+ if (req->majorversion != MAJOR_UNSPEC) {
+ if (data->majorversion != req->majorversion) {
+ xf86MsgVerb(X_WARNING, 2, "module major version (%d) "
+ "doesn't match required major version (%d)\n",
+ data->majorversion, req->majorversion);
+ return FALSE;
+ } else if (req->minorversion != MINOR_UNSPEC) {
+ if (data->minorversion < req->minorversion) {
+ xf86MsgVerb(X_WARNING, 2, "module minor version (%d) "
+ "is less than the required minor version (%d)\n",
+ data->minorversion, req->minorversion);
+ return FALSE;
+ } else if (data->minorversion == req->minorversion &&
+ req->patchlevel != PATCH_UNSPEC) {
+ if (data->patchlevel < req->patchlevel) {
+ xf86MsgVerb(X_WARNING, 2, "module patch level (%d) "
+ "is less than the required patch level (%d)\n",
+ data->patchlevel, req->patchlevel);
+ return FALSE;
+ }
+ }
+ }
+ }
+ if (req->moduleclass) {
+ if (!data->moduleclass ||
+ strcmp(req->moduleclass, data->moduleclass)) {
+ xf86MsgVerb(X_WARNING, 2, "Module class (%s) doesn't match "
+ "the required class (%s)\n",
+ data->moduleclass ? data->moduleclass : "<NONE>",
+ req->moduleclass);
+ return FALSE;
+ }
+ } else if (req->abiclass != ABI_CLASS_NONE) {
+ if (!data->abiclass || strcmp(req->abiclass, data->moduleclass)) {
+ xf86MsgVerb(X_WARNING, 2, "ABI class (%s) doesn't match the "
+ "required ABI class (%s)\n",
+ data->abiclass ? data->abiclass : "<NONE>",
+ req->abiclass);
+ return FALSE;
+ }
+ }
+ if ((req->abiclass != ABI_CLASS_NONE) &&
+ req->abiversion != ABI_VERS_UNSPEC) {
+ int reqmaj, reqmin, maj, min;
+ reqmaj = GET_ABI_MAJOR(req->abiversion);
+ reqmin = GET_ABI_MINOR(req->abiversion);
+ maj = GET_ABI_MAJOR(data->abiversion);
+ min = GET_ABI_MINOR(data->abiversion);
+ if (maj != reqmaj) {
+ xf86MsgVerb(X_WARNING, 2, "ABI major version (%d) doesn't "
+ "match the required ABI major version (%d)\n",
+ maj, reqmaj);
+ return FALSE;
+ }
+ /* XXX Maybe this should be the other way around? */
+ if (min > reqmin) {
+ xf86MsgVerb(X_WARNING, 2, "module ABI minor version (%d) "
+ "is new than that available (%d)\n",
+ min, reqmin);
+ return FALSE;
+ }
+ }
+ }
+
+#ifdef NOTYET
+ if (data->checksum)
+ {
+ /* verify the checksum field */
+ /* TO BE DONE */
+ }
+ else
+ {
+ ErrorF ("\t*** Checksum field is 0 - this module is untrusted!\n");
+ }
+#endif
+ return TRUE;
+}
+
+ModuleDescPtr
+LoadSubModule(ModuleDescPtr parent, const char *module,
+ const char **subdirlist, const char **patternlist,
+ pointer options, const XF86ModReqInfo *modreq,
+ int *errmaj, int *errmin)
+{
+ ModuleDescPtr submod;
+
+ xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module);
+
+ /* Absolute module paths are not allowed here */
+#ifndef __UNIXOS2__
+ if (module[0] == '/')
+#else
+ if (isalpha (module[0]) && module[1] == ':' && module[2] == '/')
+#endif
+ {
+ xf86Msg(X_ERROR,
+ "LoadSubModule: Absolute module path not permitted: \"%s\"\n",
+ module);
+ if (errmaj)
+ *errmaj = LDR_BADUSAGE;
+ if (errmin)
+ *errmin = 0;
+ return NULL;
+ }
+
+ submod = LoadModule (module, NULL, subdirlist, patternlist, options,
+ modreq, errmaj, errmin);
+ if (submod) {
+ parent->child = AddSibling (parent->child, submod);
+ submod->parent = parent;
+ }
+ return submod;
+}
+
+ModuleDescPtr
+DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
+{
+ ModuleDescPtr ret;
+
+ if (!mod)
+ return NULL;
+
+ ret = NewModuleDesc(mod->name);
+ if (ret == NULL)
+ return NULL;
+
+ if (LoaderHandleOpen(mod->handle) == -1)
+ return NULL;
+
+ ret->filename = xstrdup(mod->filename);
+ ret->identifier = mod->identifier;
+ ret->client_id = mod->client_id;
+ ret->in_use = mod->in_use;
+ ret->handle = mod->handle;
+ ret->SetupProc = mod->SetupProc;
+ ret->TearDownProc = mod->TearDownProc;
+ ret->TearDownData = NULL;
+ ret->path = mod->path;
+ ret->child = DuplicateModule(mod->child, ret);
+ ret->sib = DuplicateModule(mod->sib, parent);
+ ret->parent = parent;
+ ret->VersionInfo = mod->VersionInfo;
+
+ return ret;
+}
+
+/*
+ * LoadModule: load a module
+ *
+ * module The module name. Normally this is not a filename but the
+ * module's "canonical name. A full pathname is, however,
+ * also accepted.
+ * path A comma separated list of module directories.
+ * subdirlist A NULL terminated list of subdirectories to search. When
+ * NULL, the default "stdSubdirs" list is used. The default
+ * list is also substituted for entries with value DEFAULT_LIST.
+ * patternlist A NULL terminated list of regular expressions used to find
+ * module filenames. Each regex should contain exactly one
+ * subexpression that corresponds to the canonical module name.
+ * When NULL, the default "stdPatterns" list is used. The
+ * default list is also substituted for entries with value
+ * DEFAULT_LIST.
+ * options A NULL terminated list of Options that are passed to the
+ * module's SetupProc function.
+ * modreq An optional XF86ModReqInfo* containing
+ * version/ABI/vendor-ABI requirements to check for when
+ * loading the module. The following fields of the
+ * XF86ModReqInfo struct are checked:
+ * majorversion - must match the module's majorversion exactly
+ * minorversion - the module's minorversion must be >= this
+ * patchlevel - the module's minorversion.patchlevel must be
+ * >= this. Patchlevel is ignored when
+ * minorversion is not set.
+ * abiclass - (string) must match the module's abiclass
+ * abiversion - must be consistent with the module's
+ * abiversion (major equal, minor no older)
+ * moduleclass - string must match the module's moduleclass
+ * string
+ * "don't care" values are ~0 for numbers, and NULL for strings
+ * errmaj Major error return.
+ * errmin Minor error return.
+ *
+ */
+
+ModuleDescPtr
+LoadModule (const char *module, const char *path, const char **subdirlist,
+ const char **patternlist, pointer options,
+ const XF86ModReqInfo * modreq,
+ int *errmaj, int *errmin)
+{
+ XF86ModuleData *initdata = NULL;
+ char **pathlist = NULL;
+ char *found = NULL;
+ char *name = NULL;
+ char **path_elem = NULL;
+ char *p = NULL;
+ ModuleDescPtr ret = NULL;
+ int wasLoaded = 0;
+ PatternPtr patterns = NULL;
+ int noncanonical = 0;
+ char *m = NULL;
+
+ /*xf86Msg(X_INFO,"OS2DIAG: LoadModule: %s\n",module);*/
+ xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module);
+
+ patterns = InitPatterns(patternlist);
+ name = LoaderGetCanonicalName(module, patterns);
+ noncanonical = (name && strcmp(module, name) != 0);
+ if (noncanonical)
+ {
+ xf86ErrorFVerb(3, " (%s)\n", name);
+ xf86MsgVerb(X_WARNING, 1,
+ "LoadModule: given non-canonical module name \"%s\"\n",
+ module);
+ m = name;
+ }
+ else
+ {
+ xf86ErrorFVerb(3, "\n");
+ m = (char *)module;
+ }
+ if (!name) {
+ if (errmaj)
+ *errmaj = LDR_BADUSAGE;
+ if (errmin)
+ *errmin = 0;
+ goto LoadModule_fail;
+ }
+ ret = NewModuleDesc (name);
+ if (!ret) {
+ if (errmaj)
+ *errmaj = LDR_NOMEM;
+ if (errmin)
+ *errmin = 0;
+ goto LoadModule_fail;
+ }
+
+ pathlist = InitPathList(path);
+ if (!pathlist) {
+ /* This could be a malloc failure too */
+ if (errmaj)
+ *errmaj = LDR_BADUSAGE;
+ if (errmin)
+ *errmin = 1;
+ goto LoadModule_fail;
+ }
+
+ /*
+ * if the module name is not a full pathname, we need to
+ * check the elements in the path
+ */
+#ifndef __UNIXOS2__
+ if (module[0] == '/')
+ found = xstrdup(module);
+#else
+ /* accept a drive name here */
+ if (isalpha (module[0]) && module[1] == ':' && module[2] == '/')
+ found = xstrdup(module);
+#endif
+ path_elem = pathlist;
+ while (!found && *path_elem != NULL)
+ {
+ found = FindModule (m, *path_elem, subdirlist, patterns);
+ path_elem++;
+ /*
+ * When the module name isn't the canonical name, search for the
+ * former if no match was found for the latter.
+ */
+ if (!*path_elem && m == name)
+ {
+ path_elem = pathlist;
+ m = (char *)module;
+ }
+ }
+
+ /*
+ * did we find the module?
+ */
+ if (!found)
+ {
+ xf86Msg (X_WARNING, "Warning, couldn't open module %s\n",
+ module);
+ if (errmaj)
+ *errmaj = LDR_NOENT;
+ if (errmin)
+ *errmin = 0;
+ goto LoadModule_fail;
+ }
+ ret->handle = LoaderOpen (found, name, 0, errmaj, errmin, &wasLoaded);
+ if (ret->handle < 0)
+ goto LoadModule_fail;
+
+ ret->filename = xstrdup(found);
+
+ /*
+ * now check if the special data object <modulename>ModuleData is
+ * present.
+ */
+ p = xalloc (strlen (name) + strlen ("ModuleData") + 1);
+ if (!p) {
+ if (errmaj)
+ *errmaj = LDR_NOMEM;
+ if (errmin)
+ *errmin = 0;
+ goto LoadModule_fail;
+ }
+ strcpy (p, name);
+ strcat (p, "ModuleData");
+ initdata = LoaderSymbol (p);
+ if (initdata)
+ {
+ ModuleSetupProc setup;
+ ModuleTearDownProc teardown;
+ XF86ModuleVersionInfo *vers;
+
+ vers = initdata->vers;
+ setup = initdata->setup;
+ teardown = initdata->teardown;
+
+ if (!wasLoaded) {
+ if (vers) {
+ if (!CheckVersion (module, vers, modreq)) {
+ if (errmaj)
+ *errmaj = LDR_MISMATCH;
+ if (errmin)
+ *errmin = 0;
+ goto LoadModule_fail;
+ }
+ } else {
+ xf86Msg(X_ERROR,
+ "LoadModule: Module %s does not supply"
+ " version information\n", module);
+ if (errmaj)
+ *errmaj = LDR_INVALID;
+ if (errmin)
+ *errmin = 0;
+ goto LoadModule_fail;
+ }
+ }
+ if (setup)
+ ret->SetupProc = setup;
+ if (teardown)
+ ret->TearDownProc = teardown;
+ ret->path = path;
+ ret->VersionInfo = vers;
+ }
+ else
+ {
+ /* No initdata is OK for external modules */
+ if (options == EXTERN_MODULE)
+ goto LoadModule_exit;
+
+ /* no initdata, fail the load */
+ xf86Msg (X_ERROR, "LoadModule: Module %s does not have a %s "
+ "data object.\n", module, p);
+ if (errmaj)
+ *errmaj = LDR_INVALID;
+ if (errmin)
+ *errmin = 0;
+ goto LoadModule_fail;
+ }
+ if (ret->SetupProc)
+ {
+ ret->TearDownData = ret->SetupProc (ret, options, errmaj, errmin);
+ if (!ret->TearDownData)
+ {
+ goto LoadModule_fail;
+ }
+ }
+ else if (options)
+ {
+ xf86Msg (X_WARNING, "Module Options present, but no SetupProc "
+ "available for %s\n", module);
+ }
+ goto LoadModule_exit;
+
+ LoadModule_fail:
+ UnloadModule (ret);
+ ret = NULL;
+
+ LoadModule_exit:
+ FreePathList(pathlist);
+ FreePatterns(patterns);
+ TestFree (found);
+ TestFree (name);
+ TestFree (p);
+
+ /*
+ * If you need to do something to keep the
+ * instruction cache in sync with the main
+ * memory before jumping to that code, you may
+ * do it here.
+ */
+#ifdef __alpha__
+ istream_mem_barrier();
+#endif
+ return ret;
+}
+
+ModuleDescPtr
+LoadDriver (const char *module, const char *path, int handle, pointer options,
+ int *errmaj, int *errmin)
+{
+return LoadModule (module, path, NULL, NULL, options, NULL, errmaj, errmin);
+}
+
+void
+UnloadModule (ModuleDescPtr mod)
+{
+ UnloadModuleOrDriver (mod);
+}
+
+void
+UnloadDriver (ModuleDescPtr mod)
+{
+ UnloadModuleOrDriver (mod);
+}
+
+static void
+UnloadModuleOrDriver (ModuleDescPtr mod)
+{
+ if (mod == NULL || mod->name == NULL)
+ return;
+
+ xf86MsgVerb(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
+
+ if ((mod->TearDownProc) && (mod->TearDownData))
+ mod->TearDownProc (mod->TearDownData);
+ LoaderUnload (mod->handle);
+
+ if (mod->child)
+ UnloadModuleOrDriver (mod->child);
+ if (mod->sib)
+ UnloadModuleOrDriver (mod->sib);
+ TestFree (mod->name);
+ TestFree (mod->filename);
+ xfree (mod);
+#ifdef __alpha__
+ istream_mem_barrier();
+#endif
+}
+
+void
+UnloadSubModule(ModuleDescPtr mod)
+{
+ if (mod == NULL || mod->name == NULL)
+ return;
+
+ xf86MsgVerb(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name);
+
+ if ((mod->TearDownProc) && (mod->TearDownData))
+ mod->TearDownProc (mod->TearDownData);
+ LoaderUnload (mod->handle);
+
+ RemoveChild(mod);
+
+ if (mod->child)
+ UnloadModuleOrDriver (mod->child);
+
+ TestFree (mod->name);
+ TestFree (mod->filename);
+ xfree (mod);
+}
+
+void
+FreeModuleDesc (ModuleDescPtr head)
+{
+ ModuleDescPtr sibs, prev;
+
+ /*
+ * only free it if it's not marked as in use. In use means that it may
+ * be unloaded someday, and UnloadModule or UnloadDriver will free it
+ */
+ if (head->in_use)
+ return;
+ if (head->child)
+ FreeModuleDesc (head->child);
+ sibs = head;
+ while (sibs)
+ {
+ prev = sibs;
+ sibs = sibs->sib;
+ TestFree (prev->name);
+ xfree (prev);
+ }
+}
+
+ModuleDescPtr
+NewModuleDesc (const char *name)
+{
+ ModuleDescPtr mdp = xalloc (sizeof (ModuleDesc));
+
+ if (mdp)
+ {
+ mdp->child = NULL;
+ mdp->sib = NULL;
+ mdp->parent = NULL;
+ mdp->demand_next = NULL;
+ mdp->name = xstrdup (name);
+ mdp->filename = NULL;
+ mdp->identifier = NULL;
+ mdp->client_id = 0;
+ mdp->in_use = 0;
+ mdp->handle = -1;
+ mdp->SetupProc = NULL;
+ mdp->TearDownProc = NULL;
+ mdp->TearDownData = NULL;
+ }
+
+ return (mdp);
+}
+
+ModuleDescPtr
+AddSibling (ModuleDescPtr head, ModuleDescPtr new)
+{
+ new->sib = head;
+ return (new);
+
+}
+
+static void
+RemoveChild (ModuleDescPtr child)
+{
+ ModuleDescPtr mdp;
+ ModuleDescPtr prevsib;
+ ModuleDescPtr parent;
+
+ if (!child->parent)
+ return;
+
+ parent = child->parent;
+ if (parent->child == child) {
+ parent->child = child->sib;
+ return;
+ }
+
+ prevsib = parent->child;
+ mdp = prevsib->sib;
+ while (mdp && mdp != child) {
+ prevsib = mdp;
+ mdp = mdp->sib;
+ }
+ if (mdp == child)
+ prevsib->sib = child->sib;
+ return;
+}
+
+void
+LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
+{
+ const char *msg;
+
+ switch (errmaj) {
+ case LDR_NOERROR:
+ msg = "no error";
+ break;
+ case LDR_NOMEM:
+ msg = "out of memory";
+ break;
+ case LDR_NOENT:
+ msg = "module does not exist";
+ break;
+ case LDR_NOSUBENT:
+ msg = "a required submodule could not be loaded";
+ break;
+ case LDR_NOSPACE:
+ msg = "too many modules";
+ break;
+ case LDR_NOMODOPEN:
+ msg = "open failed";
+ break;
+ case LDR_UNKTYPE:
+ msg = "unknown module type";
+ break;
+ case LDR_NOLOAD:
+ msg = "loader failed";
+ break;
+ case LDR_ONCEONLY:
+ msg = "once-only module";
+ break;
+ case LDR_NOPORTOPEN:
+ msg = "port open failed";
+ break;
+ case LDR_NOHARDWARE:
+ msg = "no hardware found";
+ break;
+ case LDR_MISMATCH:
+ msg = "module requirement mismatch";
+ break;
+ case LDR_BADUSAGE:
+ msg = "invalid argument(s) to LoadModule()";
+ break;
+ case LDR_INVALID:
+ msg = "invalid module";
+ break;
+ case LDR_BADOS:
+ msg = "module doesn't support this OS";
+ break;
+ case LDR_MODSPECIFIC:
+ msg = "module-specific error";
+ break;
+ default:
+ msg = "uknown error";
+ }
+ if (name)
+ xf86Msg(X_ERROR, "%s: Failed to load module \"%s\" (%s, %d)\n",
+ name, modname, msg, errmin);
+ else
+ xf86Msg(X_ERROR, "Failed to load module \"%s\" (%s, %d)\n",
+ modname, msg, errmin);
+}
+
+
+/* Given a module path or file name, return the module's canonical name */
+static char *
+LoaderGetCanonicalName(const char *modname, PatternPtr patterns)
+{
+ char *str;
+ const char *s;
+ int len;
+ PatternPtr p;
+ regmatch_t match[2];
+
+ /* Strip off any leading path */
+ s = strrchr(modname, '/');
+ if (s == NULL)
+ s = modname;
+ else
+ s++;
+
+ /* Find the first regex that is matched */
+ for (p = patterns; p->pattern; p++)
+ if (regexec(&p->rex, s, 2, match, 0) == 0 &&
+ match[1].rm_so != -1) {
+ len = match[1].rm_eo - match[1].rm_so;
+ str = xalloc(len + 1);
+ if (!str)
+ return NULL;
+ strncpy(str, s + match[1].rm_so, len);
+ str[len] = '\0';
+ return str;
+ }
+
+ /* If there is no match, return the whole name minus the leading path */
+ return xstrdup(s);
+}
+
+/*
+ * Return the module version information.
+ */
+unsigned long
+LoaderGetModuleVersion (ModuleDescPtr mod)
+{
+ if (!mod || !mod->VersionInfo)
+ return 0;
+
+ return MODULE_VERSION_NUMERIC(mod->VersionInfo->majorversion,
+ mod->VersionInfo->minorversion,
+ mod->VersionInfo->patchlevel);
+}
diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c
new file mode 100644
index 000000000..989978330
--- /dev/null
+++ b/hw/xfree86/loader/misym.c
@@ -0,0 +1,180 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/misym.c,v 1.35 2002/09/16 18:06:11 eich Exp $ */
+
+/*
+ *
+ * Copyright 1995,96 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+#include "sym.h"
+#include "misc.h"
+#include "mi.h"
+#include "mibank.h"
+#include "miwideline.h"
+#include "mibstore.h"
+#include "cursor.h"
+#include "mipointer.h"
+#include "migc.h"
+#include "miline.h"
+#include "mizerarc.h"
+#include "mifillarc.h"
+#include "micmap.h"
+#include "mioverlay.h"
+#ifdef PANORAMIX
+#include "resource.h"
+#include "panoramiX.h"
+#endif
+#ifdef RENDER
+#include "mipict.h"
+#endif
+
+/* mi things */
+
+extern miPointerSpriteFuncRec miSpritePointerFuncs;
+
+LOOKUP miLookupTab[] = {
+ SYMFUNC(miClearToBackground)
+ SYMFUNC(miSendGraphicsExpose)
+ SYMFUNC(miModifyPixmapHeader)
+ SYMFUNC(miHandleValidateExposures)
+ SYMFUNC(miSetShape)
+ SYMFUNC(miChangeBorderWidth)
+ SYMFUNC(miShapedWindowIn)
+ SYMFUNC(miRectIn)
+ SYMFUNC(miZeroClipLine)
+ SYMFUNC(miZeroDashLine)
+ SYMFUNC(miClearDrawable)
+ SYMFUNC(miPolyPoint)
+ SYMFUNC(miStepDash)
+ SYMFUNC(miEmptyBox)
+ SYMFUNC(miEmptyData)
+ SYMFUNC(miIntersect)
+ SYMFUNC(miRegionAppend)
+ SYMFUNC(miRegionCopy)
+ SYMFUNC(miRegionDestroy)
+ SYMFUNC(miRegionEmpty)
+ SYMFUNC(miRegionExtents)
+ SYMFUNC(miRegionInit)
+ SYMFUNC(miRegionNotEmpty)
+ SYMFUNC(miRegionReset)
+ SYMFUNC(miRegionUninit)
+ SYMFUNC(miRegionValidate)
+ SYMFUNC(miTranslateRegion)
+ SYMFUNC(miHandleExposures)
+ SYMFUNC(miPolyFillRect)
+ SYMFUNC(miPolyFillArc)
+ SYMFUNC(miImageGlyphBlt)
+ SYMFUNC(miPolyGlyphBlt)
+ SYMFUNC(miFillPolygon)
+ SYMFUNC(miFillConvexPoly)
+ SYMFUNC(miPolySegment)
+ SYMFUNC(miZeroLine)
+ SYMFUNC(miWideLine)
+ SYMFUNC(miWideDash)
+ SYMFUNC(miZeroPolyArc)
+ SYMFUNC(miPolyArc)
+ SYMFUNC(miCreateGCOps)
+ SYMFUNC(miDestroyGCOps)
+ SYMFUNC(miComputeCompositeClip)
+ SYMFUNC(miChangeGC)
+ SYMFUNC(miCopyGC)
+ SYMFUNC(miDestroyGC)
+ SYMFUNC(miChangeClip)
+ SYMFUNC(miDestroyClip)
+ SYMFUNC(miCopyClip)
+ SYMFUNC(miPolyRectangle)
+ SYMFUNC(miPolyText8)
+ SYMFUNC(miPolyText16)
+ SYMFUNC(miImageText8)
+ SYMFUNC(miImageText16)
+ SYMFUNC(miRegionCreate)
+ SYMFUNC(miPaintWindow)
+ SYMFUNC(miZeroArcSetup)
+ SYMFUNC(miFillArcSetup)
+ SYMFUNC(miFillArcSliceSetup)
+ SYMFUNC(miFindMaxBand)
+ SYMFUNC(miClipSpans)
+ SYMFUNC(miAllocateGCPrivateIndex)
+ SYMFUNC(miScreenInit)
+ SYMFUNC(miGetScreenPixmap)
+ SYMFUNC(miSetScreenPixmap)
+ SYMFUNC(miPointerCurrentScreen)
+ SYMFUNC(miRectAlloc)
+ SYMFUNC(miInitializeBackingStore)
+ SYMFUNC(miInitializeBanking)
+ SYMFUNC(miModifyBanking)
+ SYMFUNC(miCopyPlane)
+ SYMFUNC(miCopyArea)
+ SYMFUNC(miCreateScreenResources)
+ SYMFUNC(miGetImage)
+ SYMFUNC(miPutImage)
+ SYMFUNC(miPushPixels)
+ SYMFUNC(miPointerInitialize)
+ SYMFUNC(miPointerPosition)
+ SYMFUNC(miRecolorCursor)
+ SYMFUNC(miPointerWarpCursor)
+ SYMFUNC(miDCInitialize)
+ SYMFUNC(miRectsToRegion)
+ SYMFUNC(miPointInRegion)
+ SYMFUNC(miInverse)
+ SYMFUNC(miSubtract)
+ SYMFUNC(miUnion)
+ SYMFUNC(miPolyBuildEdge)
+ SYMFUNC(miPolyBuildPoly)
+ SYMFUNC(miRoundJoinClip)
+ SYMFUNC(miRoundCapClip)
+ SYMFUNC(miSetZeroLineBias)
+ SYMFUNC(miResolveColor)
+ SYMFUNC(miInitializeColormap)
+ SYMFUNC(miInstallColormap)
+ SYMFUNC(miUninstallColormap)
+ SYMFUNC(miListInstalledColormaps)
+ SYMFUNC(miExpandDirectColors)
+ SYMFUNC(miCreateDefColormap)
+ SYMFUNC(miClearVisualTypes)
+ SYMFUNC(miSetVisualTypes)
+ SYMFUNC(miSetVisualTypesAndMasks)
+ SYMFUNC(miGetDefaultVisualMask)
+ SYMFUNC(miSetPixmapDepths)
+ SYMFUNC(miInitVisuals)
+ SYMFUNC(miWindowExposures)
+ SYMFUNC(miSegregateChildren)
+ SYMFUNC(miClipNotify)
+ SYMFUNC(miHookInitVisuals)
+ SYMFUNC(miPointerAbsoluteCursor)
+ SYMFUNC(miPointerGetMotionEvents)
+ SYMFUNC(miPointerGetMotionBufferSize)
+ SYMFUNC(miOverlayCopyUnderlay)
+ SYMFUNC(miOverlaySetTransFunction)
+ SYMFUNC(miOverlayCollectUnderlayRegions)
+ SYMFUNC(miInitOverlay)
+ SYMFUNC(miOverlayComputeCompositeClip)
+ SYMFUNC(miOverlayGetPrivateClips)
+ SYMFUNC(miOverlaySetRootClip)
+ SYMVAR(miZeroLineScreenIndex)
+ SYMVAR(miSpritePointerFuncs)
+ SYMVAR(miPointerScreenIndex)
+ SYMVAR(miInstalledMaps)
+ SYMVAR(miInitVisualsProc)
+#ifdef RENDER
+ SYMVAR(miGlyphExtents)
+#endif
+ { 0, 0 },
+
+};
diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c
new file mode 100644
index 000000000..e2e710077
--- /dev/null
+++ b/hw/xfree86/loader/os.c
@@ -0,0 +1,49 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/os.c,v 1.2 2002/05/31 18:46:00 dawes Exp $ */
+
+#include "loaderProcs.h"
+
+/*
+ * OSNAME is a standard form of the OS name that may be used by the
+ * loader and by OS-specific modules.
+ */
+
+#if defined(__linux__)
+#define OSNAME "linux"
+#elif defined(__FreeBSD__)
+#define OSNAME "freebsd"
+#elif defined(__NetBSD__)
+#define OSNAME "netbsd"
+#elif defined(__OpenBSD__)
+#define OSNAME "openbsd"
+#elif defined(Lynx)
+#define OSNAME "lynxos"
+#elif defined(__GNU__)
+#define OSNAME "hurd"
+#elif defined(SCO)
+#define OSNAME "sco"
+#elif defined(DGUX)
+#define OSNAME "dgux"
+#elif defined(ISC)
+#define OSNAME "isc"
+#elif defined(SVR4) && defined(sun)
+#define OSNAME "solaris"
+#elif defined(SVR4)
+#define OSNAME "svr4"
+#elif defined(__UNIXOS2__)
+#define OSNAME "os2"
+#else
+#define OSNAME "unknown"
+#endif
+
+
+/* Return the OS name, and run-time OS version */
+
+void
+LoaderGetOS(const char **name, int *major, int *minor, int *teeny)
+{
+ if (name)
+ *name = OSNAME;
+
+ /* reporting runtime versions isn't supported yet */
+}
+
diff --git a/hw/xfree86/loader/sym.h b/hw/xfree86/loader/sym.h
new file mode 100644
index 000000000..6ad38aa49
--- /dev/null
+++ b/hw/xfree86/loader/sym.h
@@ -0,0 +1,46 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/sym.h,v 1.6 2000/10/24 00:06:55 anderson Exp $ */
+
+/*
+ *
+ * Copyright 1995,96 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+#ifndef _SYM_H
+#define _SYM_H
+
+/*
+ * This structure is used to pass in symbol information that is being
+ * added to the symbol table.
+ */
+
+typedef void (*funcptr)(void);
+
+typedef struct {
+ char *symName;
+ funcptr offset;
+} LOOKUP;
+
+#define SYMFUNC( func ) { #func, (funcptr)&func },
+#define SYMFUNCALIAS( name, func ) { name, (funcptr)&func },
+#define SYMVAR( var ) { #var, (funcptr)&var },
+#define SYMVARALIAS( name, var ) { name, (funcptr)&var },
+
+#endif /* _SYM_H */
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
new file mode 100644
index 000000000..8e8bdadfc
--- /dev/null
+++ b/hw/xfree86/loader/xf86sym.c
@@ -0,0 +1,1133 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.227.2.1 2003/03/13 04:10:47 tsi Exp $ */
+
+/*
+ *
+ * Copyright 1995,96 by Metro Link, 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, and that the name of Metro Link, Inc. not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Metro Link, Inc. makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * METRO LINK, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL METRO LINK, INC. 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.
+ */
+
+#define INCLUDE_DEPRECATED 1
+
+#include <fcntl.h>
+#include <setjmp.h>
+#include "sym.h"
+#include "misc.h"
+#include "mi.h"
+#include "cursor.h"
+#include "mipointer.h"
+#include "loaderProcs.h"
+#include "xf86Pci.h"
+#include "xf86.h"
+#include "xf86Resources.h"
+#include "xf86_OSproc.h"
+#include "xf86Parser.h"
+#include "xf86Config.h"
+#ifdef XINPUT
+# include "xf86Xinput.h"
+#endif
+#include "xf86OSmouse.h"
+#include "xf86OSKbd.h"
+#include "xf86xv.h"
+#include "xf86xvmc.h"
+#include "xf86cmap.h"
+#include "xf86fbman.h"
+#include "dgaproc.h"
+#include "dpmsproc.h"
+#include "vidmodeproc.h"
+#include "xf86miscproc.h"
+#include "loader.h"
+#define DONT_DEFINE_WRAPPERS
+#include "xf86_ansic.h"
+#include "xisb.h"
+#include "vbe.h"
+#ifndef __OpenBSD__
+#include "xf86sbusBus.h"
+#endif
+#include "compiler.h"
+
+#ifndef HAS_GLIBC_SIGSETJMP
+#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
+ (!defined(__GLIBC__) || (__GLIBC__ < 2) || \
+ ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3)))
+#define HAS_GLIBC_SIGSETJMP 1
+#endif
+#endif
+
+#ifdef __FreeBSD__
+/* XXX used in drmOpen(). This should change to use a less os-specific
+ * method. */
+int sysctlbyname(const char*, void *, size_t *, void *, size_t);
+#endif
+
+#if defined(__alpha__)
+# ifdef linux
+extern unsigned long _bus_base(void);
+extern void _outb(char val, unsigned short port);
+extern void _outw(short val, unsigned short port);
+extern void _outl(int val, unsigned short port);
+extern unsigned int _inb(unsigned short port);
+extern unsigned int _inw(unsigned short port);
+extern unsigned int _inl(unsigned short port);
+# endif
+
+# ifdef __FreeBSD__
+# include <sys/types.h>
+extern void outb(u_int32_t port, u_int8_t val);
+extern void outw(u_int32_t port, u_int16_t val);
+extern void outl(u_int32_t port, u_int32_t val);
+extern u_int8_t inb(u_int32_t port);
+extern u_int16_t inw(u_int32_t port);
+extern u_int32_t inl(u_int32_t port);
+# endif
+
+extern void* __divl(long, long);
+extern void* __reml(long, long);
+extern void* __divlu(long, long);
+extern void* __remlu(long, long);
+extern void* __divq(long, long);
+extern void* __divqu(long, long);
+extern void* __remq(long, long);
+extern void* __remqu(long, long);
+#endif
+
+#if defined(__GNUC__)
+extern long __div64(long, long);
+extern long __divdf3(long, long);
+extern long __divdi3(long, long);
+extern long __divsf3(long, long);
+extern long __divsi3(long, long);
+extern long __moddi3(long, long);
+extern long __modsi3(long, long);
+extern long __mul64(long, long);
+extern long __muldf3(long, long);
+extern long __muldi3(long, long);
+extern long __mulsf3(long, long);
+extern long __mulsi3(long, long);
+extern long __udivdi3(long, long);
+extern long __udivsi3(long, long);
+extern long __umoddi3(long, long);
+extern long __umodsi3(long, long);
+#pragma weak __div64
+#pragma weak __divdf3
+#pragma weak __divdi3
+#pragma weak __divsf3
+#pragma weak __divsi3
+#pragma weak __moddi3
+#pragma weak __modsi3
+#pragma weak __mul64
+#pragma weak __muldf3
+#pragma weak __muldi3
+#pragma weak __mulsf3
+#pragma weak __mulsi3
+#pragma weak __udivdi3
+#pragma weak __udivsi3
+#pragma weak __umoddi3
+#pragma weak __umodsi3
+#endif
+
+#if defined(__arm__) && defined(__linux__)
+#include <sys/io.h>
+#endif
+
+#if defined(__powerpc__) && (defined(Lynx) || defined(linux))
+void _restf14();
+void _restf17();
+void _restf18();
+void _restf19();
+void _restf20();
+void _restf22();
+void _restf23();
+void _restf24();
+void _restf25();
+void _restf26();
+void _restf27();
+void _restf28();
+void _restf29();
+void _savef14();
+void _savef17();
+void _savef18();
+void _savef19();
+void _savef20();
+void _savef22();
+void _savef23();
+void _savef24();
+void _savef25();
+void _savef26();
+void _savef27();
+void _savef28();
+void _savef29();
+
+/* even if we compile without -DNO_INLINE we still provide
+ * the usual port i/o functions for module use
+ */
+
+extern volatile unsigned char *ioBase;
+
+/* XXX Should get all of these from elsewhere */
+#ifndef linux
+extern void outb(IOADDRESS, unsigned char);
+extern void outw(IOADDRESS, unsigned short);
+extern void outl(IOADDRESS, unsigned int);
+extern unsigned int inb(IOADDRESS);
+extern unsigned int inw(IOADDRESS);
+extern unsigned int inl(IOADDRESS);
+#endif
+extern void stl_brx(unsigned long, volatile unsigned char *, int);
+extern void stw_brx(unsigned short, volatile unsigned char *, int);
+extern unsigned long ldl_brx(volatile unsigned char *, int);
+extern unsigned short ldw_brx(volatile unsigned char *, int);
+#endif
+
+/* XFree86 things */
+
+LOOKUP xfree86LookupTab[] = {
+
+ /* Public OSlib functions */
+ SYMFUNC(xf86ReadBIOS)
+ SYMFUNC(xf86EnableIO)
+ SYMFUNC(xf86DisableIO)
+ SYMFUNC(xf86DisableInterrupts)
+ SYMFUNC(xf86EnableInterrupts)
+ SYMFUNC(xf86LinearVidMem)
+ SYMFUNC(xf86CheckMTRR)
+ SYMFUNC(xf86MapVidMem)
+ SYMFUNC(xf86UnMapVidMem)
+ SYMFUNC(xf86MapReadSideEffects)
+ SYMFUNC(xf86GetPciDomain)
+ SYMFUNC(xf86MapDomainMemory)
+ SYMFUNC(xf86MapDomainIO)
+ SYMFUNC(xf86ReadDomainMemory)
+ SYMFUNC(xf86UDelay)
+ SYMFUNC(xf86IODelay)
+ SYMFUNC(xf86SlowBcopy)
+#ifdef __alpha__
+ SYMFUNC(xf86SlowBCopyToBus)
+ SYMFUNC(xf86SlowBCopyFromBus)
+#endif
+ SYMFUNC(xf86BusToMem)
+ SYMFUNC(xf86MemToBus)
+ SYMFUNC(xf86OpenSerial)
+ SYMFUNC(xf86SetSerial)
+ SYMFUNC(xf86SetSerialSpeed)
+ SYMFUNC(xf86ReadSerial)
+ SYMFUNC(xf86WriteSerial)
+ SYMFUNC(xf86CloseSerial)
+ SYMFUNC(xf86GetErrno)
+ SYMFUNC(xf86WaitForInput)
+ SYMFUNC(xf86SerialSendBreak)
+ SYMFUNC(xf86FlushInput)
+ SYMFUNC(xf86SetSerialModemState)
+ SYMFUNC(xf86GetSerialModemState)
+ SYMFUNC(xf86SerialModemSetBits)
+ SYMFUNC(xf86SerialModemClearBits)
+ SYMFUNC(xf86LoadKernelModule)
+ SYMFUNC(xf86OSMouseInit)
+ SYMFUNC(xf86OSKbdPreInit)
+ SYMFUNC(xf86AgpGARTSupported)
+ SYMFUNC(xf86GetAGPInfo)
+ SYMFUNC(xf86AcquireGART)
+ SYMFUNC(xf86ReleaseGART)
+ SYMFUNC(xf86AllocateGARTMemory)
+ SYMFUNC(xf86BindGARTMemory)
+ SYMFUNC(xf86UnbindGARTMemory)
+ SYMFUNC(xf86EnableAGP)
+ SYMFUNC(xf86SoundKbdBell)
+ SYMFUNC(xf86GARTCloseScreen)
+#ifdef XINPUT
+/* XISB routines (Merged from Metrolink tree) */
+ SYMFUNC(XisbNew)
+ SYMFUNC(XisbFree)
+ SYMFUNC(XisbRead)
+ SYMFUNC(XisbWrite)
+ SYMFUNC(XisbTrace)
+ SYMFUNC(XisbBlockDuration)
+#endif
+
+ /* xf86Bus.c */
+ SYMFUNC(xf86CheckPciSlot)
+ SYMFUNC(xf86ClaimPciSlot)
+ SYMFUNC(xf86GetPciVideoInfo)
+ SYMFUNC(xf86GetPciEntity)
+ SYMFUNC(xf86GetPciConfigInfo)
+ SYMFUNC(xf86SetPciVideo)
+ SYMFUNC(xf86ClaimIsaSlot)
+ SYMFUNC(xf86ClaimFbSlot)
+ SYMFUNC(xf86ClaimNoSlot)
+ SYMFUNC(xf86ParsePciBusString)
+ SYMFUNC(xf86ComparePciBusString)
+ SYMFUNC(xf86FormatPciBusNumber)
+ SYMFUNC(xf86ParseIsaBusString)
+ SYMFUNC(xf86EnableAccess)
+ SYMFUNC(xf86SetCurrentAccess)
+ SYMFUNC(xf86IsPrimaryPci)
+ SYMFUNC(xf86IsPrimaryIsa)
+ SYMFUNC(xf86CheckPciGAType)
+ SYMFUNC(xf86PrintResList)
+ SYMFUNC(xf86AddResToList)
+ SYMFUNC(xf86JoinResLists)
+ SYMFUNC(xf86DupResList)
+ SYMFUNC(xf86FreeResList)
+ SYMFUNC(xf86ClaimFixedResources)
+ SYMFUNC(xf86AddEntityToScreen)
+ SYMFUNC(xf86SetEntityInstanceForScreen)
+ SYMFUNC(xf86RemoveEntityFromScreen)
+ SYMFUNC(xf86GetEntityInfo)
+ SYMFUNC(xf86GetNumEntityInstances)
+ SYMFUNC(xf86GetDevFromEntity)
+ SYMFUNC(xf86GetPciInfoForEntity)
+ SYMFUNC(xf86SetEntityFuncs)
+ SYMFUNC(xf86DeallocateResourcesForEntity)
+ SYMFUNC(xf86RegisterResources)
+ SYMFUNC(xf86CheckPciMemBase)
+ SYMFUNC(xf86SetAccessFuncs)
+ SYMFUNC(xf86IsEntityPrimary)
+ SYMFUNC(xf86FixPciResource)
+ SYMFUNC(xf86SetOperatingState)
+ SYMFUNC(xf86EnterServerState)
+ SYMFUNC(xf86GetBlock)
+ SYMFUNC(xf86GetSparse)
+ SYMFUNC(xf86ReallocatePciResources)
+ SYMFUNC(xf86ChkConflict)
+ SYMFUNC(xf86IsPciDevPresent)
+ SYMFUNC(xf86FindScreenForEntity)
+ SYMFUNC(xf86FindPciDeviceVendor)
+ SYMFUNC(xf86FindPciClass)
+#ifdef INCLUDE_DEPRECATED
+ SYMFUNC(xf86EnablePciBusMaster)
+#endif
+ SYMFUNC(xf86RegisterStateChangeNotificationCallback)
+ SYMFUNC(xf86DeregisterStateChangeNotificationCallback)
+ SYMFUNC(xf86NoSharedResources)
+#ifdef async
+ SYMFUNC(xf86QueueAsyncEvent)
+#endif
+ /* Shared Accel Accessor Functions */
+ SYMFUNC(xf86GetLastScrnFlag)
+ SYMFUNC(xf86SetLastScrnFlag)
+ SYMFUNC(xf86IsEntityShared)
+ SYMFUNC(xf86SetEntityShared)
+ SYMFUNC(xf86IsEntitySharable)
+ SYMFUNC(xf86SetEntitySharable)
+ SYMFUNC(xf86IsPrimInitDone)
+ SYMFUNC(xf86SetPrimInitDone)
+ SYMFUNC(xf86ClearPrimInitDone)
+ SYMFUNC(xf86AllocateEntityPrivateIndex)
+ SYMFUNC(xf86GetEntityPrivate)
+
+ /* xf86Configure.c */
+ SYMFUNC(xf86AddDeviceToConfigure)
+
+ /* xf86Cursor.c */
+ SYMFUNC(xf86GetPointerScreenFuncs)
+
+ /* xf86DGA.c */
+ /* For drivers */
+ SYMFUNC(DGAInit)
+ /* For extmod */
+ SYMFUNC(DGAAvailable)
+ SYMFUNC(DGAActive)
+ SYMFUNC(DGASetMode)
+ SYMFUNC(DGASetInputMode)
+ SYMFUNC(DGASelectInput)
+ SYMFUNC(DGAGetViewportStatus)
+ SYMFUNC(DGASetViewport)
+ SYMFUNC(DGAInstallCmap)
+ SYMFUNC(DGASync)
+ SYMFUNC(DGAFillRect)
+ SYMFUNC(DGABlitRect)
+ SYMFUNC(DGABlitTransRect)
+ SYMFUNC(DGAGetModes)
+ SYMFUNC(DGAGetOldDGAMode)
+ SYMFUNC(DGAGetModeInfo)
+ SYMFUNC(DGAChangePixmapMode)
+ SYMFUNC(DGACreateColormap)
+ SYMFUNC(DGAOpenFramebuffer)
+ SYMFUNC(DGACloseFramebuffer)
+
+ /* xf86DPMS.c */
+ SYMFUNC(xf86DPMSInit)
+
+ /* xf86Events.c */
+ SYMFUNC(SetTimeSinceLastInputEvent)
+ SYMFUNC(xf86AddInputHandler)
+ SYMFUNC(xf86RemoveInputHandler)
+ SYMFUNC(xf86DisableInputHandler)
+ SYMFUNC(xf86EnableInputHandler)
+ SYMFUNC(xf86AddEnabledDevice)
+ SYMFUNC(xf86RemoveEnabledDevice)
+ SYMFUNC(xf86InterceptSignals)
+ SYMFUNC(xf86EnableVTSwitch)
+
+ /* xf86Helper.c */
+ SYMFUNC(xf86AddDriver)
+ SYMFUNC(xf86AddInputDriver)
+ SYMFUNC(xf86DeleteDriver)
+ SYMFUNC(xf86DeleteInput)
+ SYMFUNC(xf86AllocateInput)
+ SYMFUNC(xf86AllocateScreen)
+ SYMFUNC(xf86DeleteScreen)
+ SYMFUNC(xf86AllocateScrnInfoPrivateIndex)
+ SYMFUNC(xf86AddPixFormat)
+ SYMFUNC(xf86SetDepthBpp)
+ SYMFUNC(xf86PrintDepthBpp)
+ SYMFUNC(xf86SetWeight)
+ SYMFUNC(xf86SetDefaultVisual)
+ SYMFUNC(xf86SetGamma)
+ SYMFUNC(xf86SetDpi)
+ SYMFUNC(xf86SetBlackWhitePixels)
+ SYMFUNC(xf86EnableDisableFBAccess)
+ SYMFUNC(xf86VDrvMsgVerb)
+ SYMFUNC(xf86DrvMsgVerb)
+ SYMFUNC(xf86DrvMsg)
+ SYMFUNC(xf86MsgVerb)
+ SYMFUNC(xf86Msg)
+ SYMFUNC(xf86ErrorFVerb)
+ SYMFUNC(xf86ErrorF)
+ SYMFUNC(xf86TokenToString)
+ SYMFUNC(xf86StringToToken)
+ SYMFUNC(xf86ShowClocks)
+ SYMFUNC(xf86PrintChipsets)
+ SYMFUNC(xf86MatchDevice)
+ SYMFUNC(xf86MatchPciInstances)
+ SYMFUNC(xf86MatchIsaInstances)
+ SYMFUNC(xf86GetVerbosity)
+ SYMFUNC(xf86GetVisualName)
+ SYMFUNC(xf86GetPix24)
+ SYMFUNC(xf86GetDepth)
+ SYMFUNC(xf86GetWeight)
+ SYMFUNC(xf86GetGamma)
+ SYMFUNC(xf86GetFlipPixels)
+ SYMFUNC(xf86GetServerName)
+ SYMFUNC(xf86ServerIsExiting)
+ SYMFUNC(xf86ServerIsOnlyDetecting)
+ SYMFUNC(xf86ServerIsOnlyProbing)
+ SYMFUNC(xf86ServerIsResetting)
+ SYMFUNC(xf86CaughtSignal)
+ SYMFUNC(xf86GetVidModeAllowNonLocal)
+ SYMFUNC(xf86GetVidModeEnabled)
+ SYMFUNC(xf86GetModInDevAllowNonLocal)
+ SYMFUNC(xf86GetModInDevEnabled)
+ SYMFUNC(xf86GetAllowMouseOpenFail)
+ SYMFUNC(xf86CommonSpecialKey)
+ SYMFUNC(xf86IsPc98)
+ SYMFUNC(xf86DisableRandR)
+ SYMFUNC(xf86GetVersion)
+ SYMFUNC(xf86GetModuleVersion)
+ SYMFUNC(xf86GetClocks)
+ SYMFUNC(xf86SetPriority)
+ SYMFUNC(xf86LoadDrvSubModule)
+ SYMFUNC(xf86LoadSubModule)
+ SYMFUNC(xf86LoadOneModule)
+ SYMFUNC(xf86UnloadSubModule)
+ SYMFUNC(xf86LoaderCheckSymbol)
+ SYMFUNC(xf86LoaderRefSymLists)
+ SYMFUNC(xf86LoaderRefSymbols)
+ SYMFUNC(xf86LoaderReqSymLists)
+ SYMFUNC(xf86LoaderReqSymbols)
+ SYMFUNC(xf86SetBackingStore)
+ SYMFUNC(xf86SetSilkenMouse)
+ /* SYMFUNC(xf86NewSerialNumber) */
+ SYMFUNC(xf86FindXvOptions)
+ SYMFUNC(xf86GetOS)
+ SYMFUNC(xf86ConfigPciEntity)
+ SYMFUNC(xf86ConfigIsaEntity)
+ SYMFUNC(xf86ConfigFbEntity)
+ SYMFUNC(xf86ConfigActivePciEntity)
+ SYMFUNC(xf86ConfigActiveIsaEntity)
+ SYMFUNC(xf86ConfigPciEntityInactive)
+ SYMFUNC(xf86ConfigIsaEntityInactive)
+ SYMFUNC(xf86IsScreenPrimary)
+ SYMFUNC(xf86RegisterRootWindowProperty)
+ SYMFUNC(xf86IsUnblank)
+ SYMFUNC(xf86AddModuleInfo)
+ SYMFUNC(xf86DeleteModuleInfo)
+
+#if defined(__sparc__) && !defined(__OpenBSD__)
+ /* xf86sbusBus.c */
+ SYMFUNC(xf86MatchSbusInstances)
+ SYMFUNC(xf86GetSbusInfoForEntity)
+ SYMFUNC(xf86GetEntityForSbusInfo)
+ SYMFUNC(xf86SbusUseBuiltinMode)
+ SYMFUNC(xf86MapSbusMem)
+ SYMFUNC(xf86UnmapSbusMem)
+ SYMFUNC(xf86SbusHideOsHwCursor)
+ SYMFUNC(xf86SbusSetOsHwCursorCmap)
+ SYMFUNC(xf86SbusHandleColormaps)
+ SYMFUNC(sparcPromInit)
+ SYMFUNC(sparcPromClose)
+ SYMFUNC(sparcPromGetProperty)
+ SYMFUNC(sparcPromGetBool)
+#endif
+
+ /* xf86Init.c */
+ SYMFUNC(xf86GetPixFormat)
+ SYMFUNC(xf86GetBppFromDepth)
+
+ /* xf86Mode.c */
+ SYMFUNC(xf86GetNearestClock)
+ SYMFUNC(xf86ModeStatusToString)
+ SYMFUNC(xf86LookupMode)
+ SYMFUNC(xf86CheckModeForMonitor)
+ SYMFUNC(xf86InitialCheckModeForDriver)
+ SYMFUNC(xf86CheckModeForDriver)
+ SYMFUNC(xf86ValidateModes)
+ SYMFUNC(xf86DeleteMode)
+ SYMFUNC(xf86PruneDriverModes)
+ SYMFUNC(xf86SetCrtcForModes)
+ SYMFUNC(xf86PrintModes)
+ SYMFUNC(xf86ShowClockRanges)
+
+ /* xf86Option.c */
+ SYMFUNC(xf86CollectOptions)
+ SYMFUNC(xf86CollectInputOptions)
+ /* Merging of XInput stuff */
+ SYMFUNC(xf86AddNewOption)
+ SYMFUNC(xf86SetBoolOption)
+ SYMFUNC(xf86NewOption)
+ SYMFUNC(xf86NextOption)
+ SYMFUNC(xf86OptionListCreate)
+ SYMFUNC(xf86OptionListMerge)
+ SYMFUNC(xf86OptionListFree)
+ SYMFUNC(xf86OptionName)
+ SYMFUNC(xf86OptionValue)
+ SYMFUNC(xf86OptionListReport)
+ SYMFUNC(xf86SetIntOption)
+ SYMFUNC(xf86SetRealOption)
+ SYMFUNC(xf86SetStrOption)
+ SYMFUNC(xf86ReplaceIntOption)
+ SYMFUNC(xf86ReplaceStrOption)
+ SYMFUNC(xf86ReplaceBoolOption)
+ SYMFUNC(xf86FindOption)
+ SYMFUNC(xf86FindOptionValue)
+ SYMFUNC(xf86MarkOptionUsed)
+ SYMFUNC(xf86MarkOptionUsedByName)
+ SYMFUNC(xf86CheckIfOptionUsed)
+ SYMFUNC(xf86CheckIfOptionUsedByName)
+ SYMFUNC(xf86ShowUnusedOptions)
+ SYMFUNC(xf86ProcessOptions)
+ SYMFUNC(xf86TokenToOptinfo)
+ SYMFUNC(xf86TokenToOptName)
+ SYMFUNC(xf86IsOptionSet)
+ SYMFUNC(xf86GetOptValString)
+ SYMFUNC(xf86GetOptValInteger)
+ SYMFUNC(xf86GetOptValULong)
+ SYMFUNC(xf86GetOptValReal)
+ SYMFUNC(xf86GetOptValFreq)
+ SYMFUNC(xf86GetOptValBool)
+ SYMFUNC(xf86ReturnOptValBool)
+ SYMFUNC(xf86NameCmp)
+ SYMFUNC(xf86InitValuatorAxisStruct)
+ SYMFUNC(xf86InitValuatorDefaults)
+
+
+ /* xf86fbman.c */
+ SYMFUNC(xf86InitFBManager)
+ SYMFUNC(xf86InitFBManagerArea)
+ SYMFUNC(xf86InitFBManagerRegion)
+ SYMFUNC(xf86RegisterFreeBoxCallback)
+ SYMFUNC(xf86FreeOffscreenArea)
+ SYMFUNC(xf86AllocateOffscreenArea)
+ SYMFUNC(xf86AllocateLinearOffscreenArea)
+ SYMFUNC(xf86ResizeOffscreenArea)
+ SYMFUNC(xf86FBManagerRunning)
+ SYMFUNC(xf86QueryLargestOffscreenArea)
+ SYMFUNC(xf86PurgeUnlockedOffscreenAreas)
+ SYMFUNC(xf86RegisterOffscreenManager)
+ SYMFUNC(xf86AllocateOffscreenLinear)
+ SYMFUNC(xf86ResizeOffscreenLinear)
+ SYMFUNC(xf86QueryLargestOffscreenLinear)
+ SYMFUNC(xf86FreeOffscreenLinear)
+
+
+ /* xf86cmap.c */
+ SYMFUNC(xf86HandleColormaps)
+
+ /* xf86xv.c */
+ SYMFUNC(xf86XVScreenInit)
+ SYMFUNC(xf86XVRegisterGenericAdaptorDriver)
+ SYMFUNC(xf86XVListGenericAdaptors)
+ SYMFUNC(xf86XVRegisterOffscreenImages)
+ SYMFUNC(xf86XVQueryOffscreenImages)
+ SYMFUNC(xf86XVAllocateVideoAdaptorRec)
+ SYMFUNC(xf86XVFreeVideoAdaptorRec)
+ SYMFUNC(xf86XVFillKeyHelper)
+ SYMFUNC(xf86XVClipVideoHelper)
+
+ /* xf86xvmc.c */
+ SYMFUNC(xf86XvMCScreenInit)
+
+ /* xf86VidMode.c */
+ SYMFUNC(VidModeExtensionInit)
+#ifdef XF86VIDMODE
+ SYMFUNC(VidModeGetCurrentModeline)
+ SYMFUNC(VidModeGetFirstModeline)
+ SYMFUNC(VidModeGetNextModeline)
+ SYMFUNC(VidModeDeleteModeline)
+ SYMFUNC(VidModeZoomViewport)
+ SYMFUNC(VidModeGetViewPort)
+ SYMFUNC(VidModeSetViewPort)
+ SYMFUNC(VidModeSwitchMode)
+ SYMFUNC(VidModeLockZoom)
+ SYMFUNC(VidModeGetMonitor)
+ SYMFUNC(VidModeGetNumOfClocks)
+ SYMFUNC(VidModeGetClocks)
+ SYMFUNC(VidModeCheckModeForMonitor)
+ SYMFUNC(VidModeCheckModeForDriver)
+ SYMFUNC(VidModeSetCrtcForMode)
+ SYMFUNC(VidModeAddModeline)
+ SYMFUNC(VidModeGetDotClock)
+ SYMFUNC(VidModeGetNumOfModes)
+ SYMFUNC(VidModeSetGamma)
+ SYMFUNC(VidModeGetGamma)
+ SYMFUNC(VidModeCreateMode)
+ SYMFUNC(VidModeCopyMode)
+ SYMFUNC(VidModeGetModeValue)
+ SYMFUNC(VidModeSetModeValue)
+ SYMFUNC(VidModeGetMonitorValue)
+ SYMFUNC(VidModeSetGammaRamp)
+ SYMFUNC(VidModeGetGammaRamp)
+ SYMFUNC(VidModeGetGammaRampSize)
+#endif
+
+ /* xf86MiscExt.c */
+#ifdef XF86MISC
+ SYMFUNC(MiscExtGetMouseSettings)
+ SYMFUNC(MiscExtGetMouseValue)
+ SYMFUNC(MiscExtSetMouseValue)
+ SYMFUNC(MiscExtSetMouseDevice)
+ SYMFUNC(MiscExtGetKbdSettings)
+ SYMFUNC(MiscExtGetKbdValue)
+ SYMFUNC(MiscExtSetKbdValue)
+ SYMFUNC(MiscExtSetGrabKeysState)
+ SYMFUNC(MiscExtCreateStruct)
+ SYMFUNC(MiscExtDestroyStruct)
+ SYMFUNC(MiscExtApply)
+ SYMFUNC(MiscExtGetFilePaths)
+#endif
+
+ /* Misc */
+ SYMFUNC(GetTimeInMillis)
+
+ /* xf86Xinput.c */
+#ifdef XINPUT
+ SYMFUNC(xf86ProcessCommonOptions)
+ SYMFUNC(xf86IsCorePointer)
+ SYMFUNC(xf86PostMotionEvent)
+ SYMFUNC(xf86PostProximityEvent)
+ SYMFUNC(xf86PostButtonEvent)
+ SYMFUNC(xf86PostKeyEvent)
+ SYMFUNC(xf86PostKeyboardEvent)
+ SYMFUNC(xf86GetMotionEvents)
+ SYMFUNC(xf86MotionHistoryAllocate)
+ SYMFUNC(xf86FirstLocalDevice)
+ SYMFUNC(xf86eqEnqueue)
+/* The following segment merged from Metrolink tree */
+ SYMFUNC(xf86XInputSetScreen)
+ SYMFUNC(xf86ScaleAxis)
+ SYMFUNC(xf86XInputSetSendCoreEvents)
+/* End merged segment */
+#endif
+ SYMFUNC(DPMSGet)
+ SYMFUNC(DPMSSet)
+ SYMFUNC(DPMSSupported)
+/* xf86Debug.c */
+#ifdef BUILDDEBUG
+ SYMFUNC(xf86Break1)
+ SYMFUNC(xf86Break2)
+ SYMFUNC(xf86Break3)
+ SYMFUNC(xf86SPTimestamp)
+ SYMFUNC(xf86STimestamp)
+#endif
+
+#if 0 /* we want to move the hw stuff in a module */
+ SYMFUNC(xf86dactopel)
+ SYMFUNC(xf86dactocomm)
+ SYMFUNC(xf86getdaccomm)
+ SYMFUNC(xf86setdaccomm)
+ SYMFUNC(xf86setdaccommbit)
+ SYMFUNC(xf86clrdaccommbit)
+ SYMFUNC(s3IBMRGB_Probe)
+ SYMFUNC(s3IBMRGB_Init)
+ SYMFUNC(s3InIBMRGBIndReg)
+ SYMFUNC(Ti3025SetClock)
+ SYMFUNC(Ti3026SetClock)
+ SYMFUNC(Ti3030SetClock)
+ SYMFUNC(AltICD2061SetClock)
+ SYMFUNC(SC11412SetClock)
+ SYMFUNC(ICS2595SetClock)
+ SYMFUNC(Att409SetClock)
+ SYMFUNC(Chrontel8391SetClock)
+ SYMFUNC(IBMRGBSetClock)
+ SYMFUNC(ICS5342SetClock)
+ SYMFUNC(S3TrioSetClock)
+ SYMFUNC(S3Trio64V2SetClock)
+ SYMFUNC(S3gendacSetClock)
+ SYMFUNC(STG1703SetClock)
+ SYMFUNC(ET6000SetClock)
+ SYMFUNC(S3AuroraSetClock)
+ SYMFUNC(commonCalcClock)
+ SYMFUNC(xf86writepci)
+ SYMFUNC(dacOutTi3026IndReg)
+ SYMFUNC(dacInTi3026IndReg)
+ SYMFUNC(s3OutIBMRGBIndReg)
+ SYMFUNC(CirrusFindClock)
+ SYMFUNC(CirrusSetClock)
+ SYMFUNC(STG1703getIndex)
+ SYMFUNC(STG1703setIndex)
+ SYMFUNC(STG1703magic)
+ SYMFUNC(gendacMNToClock)
+ SYMFUNC(Et4000AltICD2061SetClock)
+ SYMFUNC(ET4000stg1703SetClock)
+ SYMFUNC(ET4000gendacSetClock)
+
+#endif
+
+ SYMFUNC(pciFindFirst)
+ SYMFUNC(pciFindNext)
+ SYMFUNC(pciWriteByte)
+ SYMFUNC(pciWriteWord)
+ SYMFUNC(pciWriteLong)
+ SYMFUNC(pciReadByte)
+ SYMFUNC(pciReadWord)
+ SYMFUNC(pciReadLong)
+ SYMFUNC(pciSetBitsLong)
+ SYMFUNC(pciTag)
+ SYMFUNC(pciBusAddrToHostAddr)
+ SYMFUNC(pciHostAddrToBusAddr)
+ SYMFUNC(xf86MapPciMem)
+ SYMFUNC(xf86scanpci)
+ SYMFUNC(xf86ReadPciBIOS)
+ SYMFUNC(AllocatePixmapPrivateIndex)
+ SYMFUNC(AllocatePixmapPrivate)
+
+ /* Loader functions */
+ SYMFUNC(LoaderDefaultFunc)
+ SYMFUNC(LoadSubModule)
+ SYMFUNC(DuplicateModule)
+ SYMFUNC(LoaderErrorMsg)
+ SYMFUNC(LoaderCheckUnresolved)
+ SYMFUNC(LoadExtension)
+ SYMFUNC(LoadFont)
+ SYMFUNC(LoaderReqSymbols)
+ SYMFUNC(LoaderReqSymLists)
+ SYMFUNC(LoaderRefSymbols)
+ SYMFUNC(LoaderRefSymLists)
+ SYMFUNC(UnloadSubModule)
+ SYMFUNC(LoaderSymbol)
+ SYMFUNC(LoaderListDirs)
+ SYMFUNC(LoaderFreeDirList)
+ SYMFUNC(LoaderGetOS)
+
+ /*
+ * these here are our own interfaces to libc functions
+ */
+ SYMFUNC(xf86abort)
+ SYMFUNC(xf86abs)
+ SYMFUNC(xf86acos)
+ SYMFUNC(xf86asin)
+ SYMFUNC(xf86atan)
+ SYMFUNC(xf86atan2)
+ SYMFUNC(xf86atof)
+ SYMFUNC(xf86atoi)
+ SYMFUNC(xf86atol)
+ SYMFUNC(xf86bsearch)
+ SYMFUNC(xf86ceil)
+ SYMFUNC(xf86calloc)
+ SYMFUNC(xf86clearerr)
+ SYMFUNC(xf86close)
+ SYMFUNC(xf86cos)
+ SYMFUNC(xf86exit)
+ SYMFUNC(xf86exp)
+ SYMFUNC(xf86fabs)
+ SYMFUNC(xf86fclose)
+ SYMFUNC(xf86feof)
+ SYMFUNC(xf86ferror)
+ SYMFUNC(xf86fflush)
+ SYMFUNC(xf86fgetc)
+ SYMFUNC(xf86fgetpos)
+ SYMFUNC(xf86fgets)
+ SYMFUNC(xf86finite)
+ SYMFUNC(xf86floor)
+ SYMFUNC(xf86fmod)
+ SYMFUNC(xf86fopen)
+ SYMFUNC(xf86fprintf)
+ SYMFUNC(xf86fputc)
+ SYMFUNC(xf86fputs)
+ SYMFUNC(xf86fread)
+ SYMFUNC(xf86free)
+ SYMFUNC(xf86freopen)
+ SYMFUNC(xf86frexp)
+ SYMFUNC(xf86fscanf)
+ SYMFUNC(xf86fseek)
+ SYMFUNC(xf86fsetpos)
+ SYMFUNC(xf86ftell)
+ SYMFUNC(xf86fwrite)
+ SYMFUNC(xf86getc)
+ SYMFUNC(xf86getenv)
+ SYMFUNC(xf86getpagesize)
+ SYMFUNC(xf86hypot)
+ SYMFUNC(xf86ioctl)
+ SYMFUNC(xf86isalnum)
+ SYMFUNC(xf86isalpha)
+ SYMFUNC(xf86iscntrl)
+ SYMFUNC(xf86isdigit)
+ SYMFUNC(xf86isgraph)
+ SYMFUNC(xf86islower)
+ SYMFUNC(xf86isprint)
+ SYMFUNC(xf86ispunct)
+ SYMFUNC(xf86isspace)
+ SYMFUNC(xf86isupper)
+ SYMFUNC(xf86isxdigit)
+ SYMFUNC(xf86labs)
+ SYMFUNC(xf86ldexp)
+ SYMFUNC(xf86log)
+ SYMFUNC(xf86log10)
+ SYMFUNC(xf86lseek)
+ SYMFUNC(xf86malloc)
+ SYMFUNC(xf86memchr)
+ SYMFUNC(xf86memcmp)
+ SYMFUNC(xf86memcpy)
+ /*
+ * Some compilers generate calls to memcpy to handle structure copies
+ * or run-time initializations.
+ */
+ SYMFUNCALIAS("memcpy",xf86memcpy)
+ SYMFUNC(xf86memset)
+ /*
+ * Some compilers generate calls to memset to handle aggregate
+ * initializations.
+ */
+ SYMFUNCALIAS("memset",xf86memset)
+ SYMFUNC(xf86memmove)
+ SYMFUNC(xf86mmap)
+ SYMFUNC(xf86modf)
+ SYMFUNC(xf86munmap)
+ SYMFUNC(xf86open)
+ SYMFUNC(xf86perror)
+ SYMFUNC(xf86pow)
+ SYMFUNC(xf86printf)
+ SYMFUNC(xf86qsort)
+ SYMFUNC(xf86read)
+ SYMFUNC(xf86realloc)
+ SYMFUNC(xf86remove)
+ SYMFUNC(xf86rename)
+ SYMFUNC(xf86rewind)
+ SYMFUNC(xf86setbuf)
+ SYMFUNC(xf86setvbuf)
+ SYMFUNC(xf86sin)
+ SYMFUNC(xf86snprintf)
+ SYMFUNC(xf86sprintf)
+ SYMFUNC(xf86sqrt)
+ SYMFUNC(xf86sscanf)
+ SYMFUNC(xf86strcat)
+ SYMFUNC(xf86strcmp)
+ SYMFUNC(xf86strcasecmp)
+ SYMFUNC(xf86strcpy)
+ SYMFUNC(xf86strcspn)
+ SYMFUNC(xf86strerror)
+ SYMFUNC(xf86strlen)
+ SYMFUNC(xf86strncasecmp)
+ SYMFUNC(xf86strncat)
+ SYMFUNC(xf86strncmp)
+ SYMFUNC(xf86strncpy)
+ SYMFUNC(xf86strpbrk)
+ SYMFUNC(xf86strchr)
+ SYMFUNC(xf86strrchr)
+ SYMFUNC(xf86strspn)
+ SYMFUNC(xf86strstr)
+ SYMFUNC(xf86strtod)
+ SYMFUNC(xf86strtok)
+ SYMFUNC(xf86strtol)
+ SYMFUNC(xf86strtoul)
+ SYMFUNC(xf86tan)
+ SYMFUNC(xf86tmpfile)
+ SYMFUNC(xf86tolower)
+ SYMFUNC(xf86toupper)
+ SYMFUNC(xf86ungetc)
+ SYMFUNC(xf86vfprintf)
+ SYMFUNC(xf86vsnprintf)
+ SYMFUNC(xf86vsprintf)
+ SYMFUNC(xf86write)
+
+/* non-ANSI C functions */
+ SYMFUNC(xf86opendir)
+ SYMFUNC(xf86closedir)
+ SYMFUNC(xf86readdir)
+ SYMFUNC(xf86rewinddir)
+ SYMFUNC(xf86ffs)
+ SYMFUNC(xf86strdup)
+ SYMFUNC(xf86bzero)
+ SYMFUNC(xf86usleep)
+ SYMFUNC(xf86execl)
+
+ SYMFUNC(xf86getsecs)
+ SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */
+
+ /* These provide for DRI support. */
+ SYMFUNC(xf86stat)
+ SYMFUNC(xf86fstat)
+ SYMFUNC(xf86access)
+ SYMFUNC(xf86geteuid)
+ SYMFUNC(xf86getegid)
+ SYMFUNC(xf86getpid)
+ SYMFUNC(xf86mknod)
+ SYMFUNC(xf86chmod)
+ SYMFUNC(xf86chown)
+ SYMFUNC(xf86sleep)
+ SYMFUNC(xf86mkdir)
+ SYMFUNC(xf86shmget)
+ SYMFUNC(xf86shmat)
+ SYMFUNC(xf86shmdt)
+ SYMFUNC(xf86shmctl)
+#ifdef HAS_GLIBC_SIGSETJMP
+ SYMFUNC(xf86setjmp)
+ SYMFUNC(xf86setjmp0)
+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+ SYMFUNCALIAS("xf86setjmp1",__sigsetjmp)
+#else
+ SYMFUNC(xf86setjmp1) /* For libc5 */
+#endif
+#else
+ SYMFUNCALIAS("xf86setjmp",setjmp)
+ SYMFUNCALIAS("xf86setjmp0",setjmp)
+ SYMFUNC(xf86setjmp1)
+#endif
+ SYMFUNCALIAS("xf86longjmp",longjmp)
+ SYMFUNC(xf86getjmptype)
+ SYMFUNC(xf86setjmp1_arg2)
+ SYMFUNC(xf86setjmperror)
+#ifdef XF86DRI
+ /* These may have more general uses, but
+ for now, they are only used by the DRI.
+ Loading them only when the DRI is built
+ may make porting (the non-DRI portions
+ of the X server) easier. */
+ SYMFUNC(xf86InstallSIGIOHandler)
+ SYMFUNC(xf86RemoveSIGIOHandler)
+# if defined(__alpha__) && defined(linux)
+ SYMFUNC(_bus_base)
+# endif
+#endif
+ SYMFUNC(xf86BlockSIGIO)
+ SYMFUNC(xf86UnblockSIGIO)
+
+#if defined(__alpha__)
+ SYMFUNC(__divl)
+ SYMFUNC(__reml)
+ SYMFUNC(__divlu)
+ SYMFUNC(__remlu)
+ SYMFUNC(__divq)
+ SYMFUNC(__divqu)
+ SYMFUNC(__remq)
+ SYMFUNC(__remqu)
+
+# ifdef linux
+ SYMFUNC(_outw)
+ SYMFUNC(_outb)
+ SYMFUNC(_outl)
+ SYMFUNC(_inb)
+ SYMFUNC(_inw)
+ SYMFUNC(_inl)
+ SYMFUNC(_alpha_outw)
+ SYMFUNC(_alpha_outb)
+ SYMFUNC(_alpha_outl)
+ SYMFUNC(_alpha_inb)
+ SYMFUNC(_alpha_inw)
+ SYMFUNC(_alpha_inl)
+# else
+ SYMFUNC(outw)
+ SYMFUNC(outb)
+ SYMFUNC(outl)
+ SYMFUNC(inb)
+ SYMFUNC(inw)
+ SYMFUNC(inl)
+# endif
+ SYMFUNC(xf86ReadMmio32)
+ SYMFUNC(xf86ReadMmio16)
+ SYMFUNC(xf86ReadMmio8)
+ SYMFUNC(xf86WriteMmio32)
+ SYMFUNC(xf86WriteMmio16)
+ SYMFUNC(xf86WriteMmio8)
+ SYMFUNC(xf86WriteMmioNB32)
+ SYMFUNC(xf86WriteMmioNB16)
+ SYMFUNC(xf86WriteMmioNB8)
+#endif
+#if defined(sun) && defined(SVR4)
+ SYMFUNC(inb)
+ SYMFUNC(inw)
+ SYMFUNC(inl)
+ SYMFUNC(outb)
+ SYMFUNC(outw)
+ SYMFUNC(outl)
+#endif
+#if defined(__powerpc__) && !defined(__OpenBSD__)
+ SYMFUNC(inb)
+ SYMFUNC(inw)
+ SYMFUNC(inl)
+ SYMFUNC(outb)
+ SYMFUNC(outw)
+ SYMFUNC(outl)
+# if defined(NO_INLINE) || defined(Lynx)
+ SYMFUNC(mem_barrier)
+ SYMFUNC(ldl_u)
+ SYMFUNC(eieio)
+ SYMFUNC(ldl_brx)
+ SYMFUNC(ldw_brx)
+ SYMFUNC(stl_brx)
+ SYMFUNC(stw_brx)
+ SYMFUNC(ldq_u)
+ SYMFUNC(ldw_u)
+ SYMFUNC(stl_u)
+ SYMFUNC(stq_u)
+ SYMFUNC(stw_u)
+ SYMFUNC(write_mem_barrier)
+# endif
+# if defined(Lynx)
+ SYMFUNC(_restf14)
+ SYMFUNC(_restf17)
+ SYMFUNC(_restf18)
+ SYMFUNC(_restf19)
+ SYMFUNC(_restf20)
+ SYMFUNC(_restf22)
+ SYMFUNC(_restf23)
+ SYMFUNC(_restf24)
+ SYMFUNC(_restf25)
+ SYMFUNC(_restf26)
+ SYMFUNC(_restf27)
+ SYMFUNC(_restf28)
+ SYMFUNC(_restf29)
+ SYMFUNC(_savef14)
+ SYMFUNC(_savef17)
+ SYMFUNC(_savef18)
+ SYMFUNC(_savef19)
+ SYMFUNC(_savef20)
+ SYMFUNC(_savef22)
+ SYMFUNC(_savef23)
+ SYMFUNC(_savef24)
+ SYMFUNC(_savef25)
+ SYMFUNC(_savef26)
+ SYMFUNC(_savef27)
+ SYMFUNC(_savef28)
+ SYMFUNC(_savef29)
+# endif
+# if PPCIO_DEBUG
+ SYMFUNC(debug_inb)
+ SYMFUNC(debug_inw)
+ SYMFUNC(debug_inl)
+ SYMFUNC(debug_outb)
+ SYMFUNC(debug_outw)
+ SYMFUNC(debug_outl)
+# endif
+#endif
+#if defined(__GNUC__)
+ SYMFUNC(__div64)
+ SYMFUNC(__divdf3)
+ SYMFUNC(__divdi3)
+ SYMFUNC(__divsf3)
+ SYMFUNC(__divsi3)
+ SYMFUNC(__moddi3)
+ SYMFUNC(__modsi3)
+ SYMFUNC(__mul64)
+ SYMFUNC(__muldf3)
+ SYMFUNC(__muldi3)
+ SYMFUNC(__mulsf3)
+ SYMFUNC(__mulsi3)
+ SYMFUNC(__udivdi3)
+ SYMFUNC(__udivsi3)
+ SYMFUNC(__umoddi3)
+ SYMFUNC(__umodsi3)
+#endif
+#if defined(__ia64__)
+ SYMFUNC(_outw)
+ SYMFUNC(_outb)
+ SYMFUNC(_outl)
+ SYMFUNC(_inb)
+ SYMFUNC(_inw)
+ SYMFUNC(_inl)
+#endif
+#if defined(__arm__)
+ SYMFUNC(outw)
+ SYMFUNC(outb)
+ SYMFUNC(outl)
+ SYMFUNC(inb)
+ SYMFUNC(inw)
+ SYMFUNC(inl)
+#endif
+
+#ifdef __FreeBSD__
+ SYMFUNC(sysctlbyname)
+#endif
+
+/*
+ * and now some variables
+ */
+
+ SYMVAR(xf86stdin)
+ SYMVAR(xf86stdout)
+ SYMVAR(xf86stderr)
+ SYMVAR(xf86errno)
+ SYMVAR(xf86HUGE_VAL)
+
+ /* General variables (from xf86.h) */
+ SYMVAR(xf86ScreenIndex)
+ SYMVAR(xf86PixmapIndex)
+ SYMVAR(xf86Screens)
+ SYMVAR(byte_reversed)
+ SYMVAR(xf86inSuspend)
+ /* debugging variables */
+#ifdef BUILDDEBUG
+ SYMVAR(xf86p8bit)
+ SYMVAR(xf86DummyVar1)
+ SYMVAR(xf86DummyVar2)
+ SYMVAR(xf86DummyVar3)
+#endif
+
+#ifdef async
+ SYMVAR(xf86CurrentScreen)
+#endif
+ /* predefined resource lists from xf86Bus.h */
+ SYMVAR(resVgaExclusive)
+ SYMVAR(resVgaShared)
+ SYMVAR(resVgaMemShared)
+ SYMVAR(resVgaIoShared)
+ SYMVAR(resVgaUnusedExclusive)
+ SYMVAR(resVgaUnusedShared)
+ SYMVAR(resVgaSparseExclusive)
+ SYMVAR(resVgaSparseShared)
+ SYMVAR(res8514Exclusive)
+ SYMVAR(res8514Shared)
+ SYMVAR(PciAvoid)
+
+#if defined(__powerpc__) && (!defined(NO_INLINE) || defined(Lynx))
+ SYMVAR(ioBase)
+#endif
+
+ /* Globals from xf86Globals.c and xf86Priv.h */
+ SYMVAR(xf86ConfigDRI)
+
+ /* Globals from xf86Configure.c */
+ SYMVAR(ConfiguredMonitor)
+
+ /* Pci.c */
+ SYMVAR(pciNumBuses)
+
+ { 0, 0 },
+
+};
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
new file mode 100644
index 000000000..d3aa25961
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -0,0 +1,709 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.2.2.1 2003/05/09 02:30:43 dawes Exp $ */
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * 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 names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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.
+ *
+ */
+
+/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#include <sys/param.h>
+#ifndef __NetBSD__
+# include <sys/sysctl.h>
+# ifdef __FreeBSD__
+# include <machine/sysarch.h>
+# endif
+# else
+# include <machine/sysarch.h>
+#endif
+
+#include "xf86Axp.h"
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#if defined(__NetBSD__) && !defined(MAP_FILE)
+#define MAP_FLAGS MAP_SHARED
+#else
+#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
+#endif
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+axpDevice bsdGetAXP(void);
+
+#ifndef __NetBSD__
+extern unsigned long dense_base(void);
+
+static int axpSystem = -1;
+static unsigned long hae_thresh;
+static unsigned long hae_mask;
+static unsigned long bus_base;
+static unsigned long sparse_size;
+
+static unsigned long
+memory_base(void)
+{
+ static unsigned long base = 0;
+
+ if (base == 0) {
+ size_t len = sizeof(base);
+ int error;
+#ifdef __OpenBSD__
+ int mib[3];
+
+ mib[0] = CTL_MACHDEP;
+ mib[1] = CPU_CHIPSET;
+ mib[2] = CPU_CHIPSET_MEM;
+
+ if ((error = sysctl(mib, 3, &base, &len, NULL, 0)) < 0)
+#else
+ if ((error = sysctlbyname("hw.chipset.memory", &base, &len,
+ 0, 0)) < 0)
+#endif
+ FatalError("xf86MapVidMem: can't find memory\n");
+ }
+
+ return base;
+}
+
+static int
+has_bwx(void)
+{
+ static int bwx = 0;
+ size_t len = sizeof(bwx);
+ int error;
+#ifdef __OpenBSD__
+ int mib[3];
+
+ mib[0] = CTL_MACHDEP;
+ mib[1] = CPU_CHIPSET;
+ mib[2] = CPU_CHIPSET_BWX;
+
+ if ((error = sysctl(mib, 3, &bwx, &len, NULL, 0)) < 0)
+ return FALSE;
+ else
+ return bwx;
+#else
+ if ((error = sysctlbyname("hw.chipset.bwx", &bwx, &len, 0, 0)) < 0)
+ return FALSE;
+ else
+ return bwx;
+#endif
+}
+#else /* __NetBSD__ */
+static struct alpha_bus_window *abw;
+static int abw_count = -1;
+
+static void
+init_abw()
+{
+ if (abw_count < 0) {
+ abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw);
+ if (abw_count <= 0)
+ FatalError("init_abw: alpha_bus_getwindows failed\n");
+ }
+}
+
+static int
+has_bwx(void)
+{
+ if (abw_count < 0)
+ init_abw();
+
+ xf86Msg(X_INFO, "has_bwx = %d\n",
+ abw[0].abw_abst.abst_flags & ABST_BWX ? 1 : 0); /* XXXX */
+ return abw[0].abw_abst.abst_flags & ABST_BWX;
+}
+
+static unsigned long
+dense_base()
+{
+ if (abw_count < 0)
+ init_abw();
+
+ /* XXX check abst_flags for ABST_DENSE just to be safe? */
+ xf86Msg(X_INFO, "dense base = %#lx\n",
+ abw[0].abw_abst.abst_sys_start); /* XXXX */
+ return abw[0].abw_abst.abst_sys_start;
+}
+
+static unsigned long
+memory_base()
+{
+ if (abw_count < 0)
+ init_abw();
+
+ if (abw_count > 0) {
+ xf86Msg(X_INFO, "memory base = %#lx\n",
+ abw[1].abw_abst.abst_sys_start); /* XXXX */
+ return abw[1].abw_abst.abst_sys_start;
+ } else {
+ xf86Msg(X_INFO, "no memory base\n"); /* XXXX */
+ return 0;
+ }
+}
+#endif /* __NetBSD__ */
+
+#define BUS_BASE dense_base()
+#define BUS_BASE_BWX memory_base()
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+#ifdef __OpenBSD__
+#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
+ "\tin /etc/sysctl.conf and reboot your machine\n" \
+ "\trefer to xf86(4) for details"
+#endif
+
+static Bool useDevMem = FALSE;
+static int devMemFd = -1;
+
+#ifdef HAS_APERTURE_DRV
+#define DEV_APERTURE "/dev/xf86"
+#endif
+#define DEV_MEM "/dev/mem"
+
+static pointer mapVidMem(int, unsigned long, unsigned long, int);
+static void unmapVidMem(int, pointer, unsigned long);
+static pointer mapVidMemSparse(int, unsigned long, unsigned long, int);
+static void unmapVidMemSparse(int, pointer, unsigned long);
+
+/*
+ * Check if /dev/mem can be mmap'd. If it can't print a warning when
+ * "warn" is TRUE.
+ */
+static void
+checkDevMem(Bool warn)
+{
+ static Bool devMemChecked = FALSE;
+ int fd;
+ pointer base;
+
+ if (devMemChecked)
+ return;
+ devMemChecked = TRUE;
+
+#ifdef HAS_APERTURE_DRV
+ /* Try the aperture driver first */
+ if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
+
+ if (base != MAP_FAILED) {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
+ DEV_APERTURE);
+ return;
+ } else {
+ if (warn) {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_APERTURE, strerror(errno));
+ }
+ }
+ }
+#endif
+ if ((fd = open(DEV_MEM, O_RDWR)) >= 0) {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
+
+ if (base != MAP_FAILED) {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ return;
+ } else {
+ if (warn) {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ }
+ }
+ if (warn) {
+#ifndef HAS_APERTURE_DRV
+ xf86Msg(X_WARNING, "checkDevMem: failed to open/mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+#else
+#ifndef __OpenBSD__
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
+ "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno));
+#else /* __OpenBSD__ */
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
+ "\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno),
+ SYSCTL_MSG);
+#endif /* __OpenBSD__ */
+#endif
+ xf86ErrorF("\tlinear framebuffer access unavailable\n");
+ }
+ useDevMem = FALSE;
+ return;
+}
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+ checkDevMem(TRUE);
+ pVidMem->linearSupported = useDevMem;
+
+ if (has_bwx()) {
+ xf86Msg(X_PROBED,"Machine type has 8/16 bit access\n");
+ pVidMem->mapMem = mapVidMem;
+ pVidMem->unmapMem = unmapVidMem;
+ } else {
+ xf86Msg(X_PROBED,"Machine needs sparse mapping\n");
+ pVidMem->mapMem = mapVidMemSparse;
+ pVidMem->unmapMem = unmapVidMemSparse;
+ if (axpSystem == -1)
+ axpSystem = bsdGetAXP();
+ hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
+ hae_mask = xf86AXPParams[axpSystem].hae_mask;
+ sparse_size = xf86AXPParams[axpSystem].size;
+ }
+ pVidMem->initialised = TRUE;
+}
+
+static pointer
+mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ pointer base;
+
+ checkDevMem(FALSE);
+ Base = Base & ((1L<<32) - 1);
+
+ if (useDevMem)
+ {
+ if (devMemFd < 0)
+ {
+ FatalError("xf86MapVidMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
+ if (base == MAP_FAILED)
+ {
+ FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
+ "xf86MapVidMem", DEV_MEM, Size, Base,
+ strerror(errno));
+ }
+ return(base);
+ }
+
+ /* else, mmap /dev/vga */
+ if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
+ {
+ FatalError("%s: Address 0x%x outside allowable range\n",
+ "xf86MapVidMem", Base);
+ }
+ base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS,
+ xf86Info.screenFd,
+ (unsigned long)Base + BUS_BASE);
+ if (base == MAP_FAILED)
+ {
+ FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
+ strerror(errno));
+ }
+ return(base);
+}
+
+static void
+unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap((caddr_t)Base, Size);
+}
+
+/*
+ * Read BIOS via mmap()ing DEV_MEM
+ */
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ unsigned char *ptr;
+ int psize;
+ int mlen;
+
+ checkDevMem(TRUE);
+ if (devMemFd == -1) {
+ return(-1);
+ }
+
+ psize = xf86getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
+ if ((long)ptr == -1)
+ {
+ xf86Msg(X_WARNING,
+ "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
+ DEV_MEM, Len, Base, Offset, strerror(errno));
+ return(-1);
+ }
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ Base, ptr[0] | (ptr[1] << 8));
+#endif
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
+ "-> %02x %02x %02x %02x...\n",
+ Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
+#endif
+ return(Len);
+}
+
+
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
+
+extern int ioperm(unsigned long from, unsigned long num, int on);
+
+void
+xf86EnableIO()
+{
+ ioperm(0, 65536, TRUE);
+ return;
+}
+
+void
+xf86DisableIO()
+{
+ return;
+}
+
+#endif /* __FreeBSD__ || __OpenBSD__ */
+
+#ifdef USE_ALPHA_PIO
+
+void
+xf86EnableIO()
+{
+ alpha_pci_io_enable(1);
+}
+
+void
+xf86DisableIO()
+{
+ alpha_pci_io_enable(0);
+}
+
+#endif /* USE_ALPHA_PIO */
+
+/***************************************************************************/
+/* Interrupt Handling section */
+/***************************************************************************/
+
+Bool
+xf86DisableInterrupts()
+{
+
+ return(TRUE);
+}
+
+void
+xf86EnableInterrupts()
+{
+ return;
+}
+
+
+#define vuip volatile unsigned int *
+
+static unsigned long msb_set = 0;
+static pointer memSBase = 0;
+static pointer memBase = 0;
+
+extern int readDense8(pointer Base, register unsigned long Offset);
+extern int readDense16(pointer Base, register unsigned long Offset);
+extern int readDense32(pointer Base, register unsigned long Offset);
+extern void
+writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDense8(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDense16(int Value, pointer Base, register unsigned long Offset);
+extern void
+writeDense32(int Value, pointer Base, register unsigned long Offset);
+
+static int readSparse8(pointer Base, register unsigned long Offset);
+static int readSparse16(pointer Base, register unsigned long Offset);
+static int readSparse32(pointer Base, register unsigned long Offset);
+static void
+writeSparseNB8(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparseNB16(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparseNB32(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparse8(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparse16(int Value, pointer Base, register unsigned long Offset);
+static void
+writeSparse32(int Value, pointer Base, register unsigned long Offset);
+
+#ifdef __FreeBSD__
+extern int sysarch(int, char *);
+#endif
+
+struct parms {
+ u_int64_t hae;
+};
+
+static int
+sethae(u_int64_t hae)
+{
+#ifdef __FreeBSD__
+#ifndef ALPHA_SETHAE
+#define ALPHA_SETHAE 0
+#endif
+ struct parms p;
+ p.hae = hae;
+ return (sysarch(ALPHA_SETHAE, (char *)&p));
+#endif
+#ifdef __OpenBSD__
+ return -1;
+#endif
+}
+
+static pointer
+mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ static Bool was_here = FALSE;
+
+ if (!was_here) {
+ was_here = TRUE;
+
+ checkDevMem(FALSE);
+
+ xf86WriteMmio8 = writeSparse8;
+ xf86WriteMmio16 = writeSparse16;
+ xf86WriteMmio32 = writeSparse32;
+ xf86WriteMmioNB8 = writeSparseNB8;
+ xf86WriteMmioNB16 = writeSparseNB16;
+ xf86WriteMmioNB32 = writeSparseNB32;
+ xf86ReadMmio8 = readSparse8;
+ xf86ReadMmio16 = readSparse16;
+ xf86ReadMmio32 = readSparse32;
+
+ memBase = mmap((caddr_t)0, 0x100000000,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, devMemFd,
+ (off_t) BUS_BASE);
+ memSBase = mmap((caddr_t)0, 0x100000000,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, devMemFd,
+ (off_t) BUS_BASE_BWX);
+
+ if (memSBase == MAP_FAILED || memBase == MAP_FAILED) {
+ FatalError("xf86MapVidMem: Could not mmap framebuffer (%s)\n",
+ strerror(errno));
+ }
+ }
+ return (pointer)((unsigned long)memBase + Base);
+}
+
+static void
+unmapVidMemSparse(int ScreenNum, pointer Base, unsigned long Size)
+{
+}
+
+static int
+readSparse8(pointer Base, register unsigned long Offset)
+{
+ register unsigned long result, shift;
+ register unsigned long msb;
+
+ mem_barrier();
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ shift = (Offset & 0x3) << 3;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+ sethae(msb);
+ msb_set = msb;
+ }
+ }
+
+ result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
+ result >>= shift;
+ return 0xffUL & result;
+}
+
+static int
+readSparse16(pointer Base, register unsigned long Offset)
+{
+ register unsigned long result, shift;
+ register unsigned long msb;
+
+ mem_barrier();
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ shift = (Offset & 0x2) << 3;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+ sethae(msb);
+ msb_set = msb;
+ }
+ }
+ result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2)));
+ result >>= shift;
+ return 0xffffUL & result;
+}
+
+static int
+readSparse32(pointer Base, register unsigned long Offset)
+{
+ mem_barrier();
+ return *(vuip)((unsigned long)Base+(Offset));
+}
+
+static void
+writeSparse8(int Value, pointer Base, register unsigned long Offset)
+{
+ register unsigned long msb;
+ register unsigned int b = Value & 0xffU;
+
+ write_mem_barrier();
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+ sethae(msb);
+ msb_set = msb;
+ }
+ }
+ *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
+}
+
+static void
+writeSparse16(int Value, pointer Base, register unsigned long Offset)
+{
+ register unsigned long msb;
+ register unsigned int w = Value & 0xffffU;
+
+ write_mem_barrier();
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+ sethae(msb);
+ msb_set = msb;
+ }
+ }
+ *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
+ w * 0x00010001;
+
+}
+
+static void
+writeSparse32(int Value, pointer Base, register unsigned long Offset)
+{
+ write_mem_barrier();
+ *(vuip)((unsigned long)Base + (Offset)) = Value;
+ return;
+}
+
+static void
+writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
+{
+ register unsigned long msb;
+ register unsigned int b = Value & 0xffU;
+
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask;
+ Offset -= msb;
+ if (msb_set != msb) {
+ sethae(msb);
+ msb_set = msb;
+ }
+ }
+ *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
+}
+
+static void
+writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
+{
+ register unsigned long msb;
+ register unsigned int w = Value & 0xffffU;
+
+ Offset += (unsigned long)Base - (unsigned long)memBase;
+ if (Offset >= (hae_thresh)) {
+ msb = Offset & hae_mask ;
+ Offset -= msb;
+ if (msb_set != msb) {
+ sethae(msb);
+ msb_set = msb;
+ }
+ }
+ *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
+ w * 0x00010001;
+}
+
+static void
+writeSparseNB32(int Value, pointer Base, register unsigned long Offset)
+{
+ *(vuip)((unsigned long)Base + (Offset)) = Value;
+ return;
+}
+
+void (*xf86WriteMmio8)(int Value, pointer Base, unsigned long Offset)
+ = writeDense8;
+void (*xf86WriteMmio16)(int Value, pointer Base, unsigned long Offset)
+ = writeDense16;
+void (*xf86WriteMmio32)(int Value, pointer Base, unsigned long Offset)
+ = writeDense32;
+void (*xf86WriteMmioNB8)(int Value, pointer Base, unsigned long Offset)
+ = writeDenseNB8;
+void (*xf86WriteMmioNB16)(int Value, pointer Base, unsigned long Offset)
+ = writeDenseNB16;
+void (*xf86WriteMmioNB32)(int Value, pointer Base, unsigned long Offset)
+ = writeDenseNB32;
+int (*xf86ReadMmio8)(pointer Base, unsigned long Offset)
+ = readDense8;
+int (*xf86ReadMmio16)(pointer Base, unsigned long Offset)
+ = readDense16;
+int (*xf86ReadMmio32)(pointer Base, unsigned long Offset)
+ = readDense32;
+
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
new file mode 100644
index 000000000..96abe2ea4
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -0,0 +1,677 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/arm_video.c,v 1.1 2002/08/06 13:08:38 herrb Exp $ */
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * 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 names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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.
+ *
+ */
+
+/*
+ * The ARM32 code here carries the following copyright:
+ *
+ * Copyright 1997
+ * Digital Equipment 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
+ * 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 Digital
+ * Equipment Corporation. Neither the "Digital Equipment Corporation"
+ * name nor any trademark or logo of Digital Equipment Corporation may be
+ * used to endorse or promote products derived from this software without
+ * the prior written permission of Digital Equipment 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 DIGITAL be liable for any damages whatsoever, and in
+ * particular, DIGITAL shall not be liable for special, indirect,
+ * consequential, or incidental damages or damages for lost profits, loss
+ * of revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise, even
+ * if advised of the possibility of such damage.
+ *
+ */
+
+/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#ifdef __arm32__
+#include "machine/devmap.h"
+struct memAccess
+{
+ int ioctl;
+ struct map_info memInfo;
+ pointer regionVirtBase;
+ Bool Checked;
+ Bool OK;
+};
+
+static pointer xf86MapInfoMap();
+static void xf86MapInfoUnmap();
+static struct memAccess *checkMapInfo();
+extern int vgaPhysLinearBase;
+
+/* A memAccess structure is needed for each possible region */
+struct memAccess vgaMemInfo = { CONSOLE_GET_MEM_INFO, NULL, NULL,
+ FALSE, FALSE };
+struct memAccess linearMemInfo = { CONSOLE_GET_LINEAR_INFO, NULL, NULL,
+ FALSE, FALSE };
+struct memAccess ioMemInfo = { CONSOLE_GET_IO_INFO, NULL, NULL,
+ FALSE, FALSE };
+#endif /* __arm32__ */
+
+#if defined(__NetBSD__) && !defined(MAP_FILE)
+#define MAP_FLAGS MAP_SHARED
+#else
+#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
+#endif
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+
+#define BUS_BASE 0L
+#define BUS_BASE_BWX 0L
+
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+static Bool useDevMem = FALSE;
+static int devMemFd = -1;
+
+#define DEV_MEM "/dev/mem"
+
+static pointer mapVidMem(int, unsigned long, unsigned long, int);
+static void unmapVidMem(int, pointer, unsigned long);
+
+/*
+ * Check if /dev/mem can be mmap'd. If it can't print a warning when
+ * "warn" is TRUE.
+ */
+static void
+checkDevMem(Bool warn)
+{
+ static Bool devMemChecked = FALSE;
+ int fd;
+ pointer base;
+
+ if (devMemChecked)
+ return;
+ devMemChecked = TRUE;
+
+ if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
+ {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE);
+
+ if (base != MAP_FAILED)
+ {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ return;
+ } else {
+ /* This should not happen */
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ useDevMem = FALSE;
+ return;
+ }
+ }
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ useDevMem = FALSE;
+ return;
+}
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+
+ checkDevMem(TRUE);
+ pVidMem->linearSupported = useDevMem;
+ pVidMem->mapMem = armMapVidMem;
+ pVidMem->unmapVidMem = armUnmapVidMem;
+
+ pVidMem->initialised = TRUE;
+}
+
+static pointer
+mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ pointer base;
+
+ checkDevMem(FALSE);
+
+ if (useDevMem)
+ {
+ if (devMemFd < 0)
+ {
+ FatalError("xf86MapVidMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
+ if (base == MAP_FAILED)
+ {
+ FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
+ "xf86MapVidMem", DEV_MEM, Size, Base,
+ strerror(errno));
+ }
+ return(base);
+ }
+
+ /* else, mmap /dev/vga */
+ if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
+ {
+ FatalError("%s: Address 0x%x outside allowable range\n",
+ "xf86MapVidMem", Base);
+ }
+ base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS,
+ xf86Info.screenFd,
+ (unsigned long)Base - 0xA0000);
+ if (base == MAP_FAILED)
+ {
+ FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
+ strerror(errno));
+ }
+ return(base);
+}
+
+static void
+unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap((caddr_t)Base, Size);
+}
+
+/*
+ * Read BIOS via mmap()ing DEV_MEM
+ */
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ unsigned char *ptr;
+ int psize;
+ int mlen;
+
+ checkDevMem(TRUE);
+ if (devMemFd == -1) {
+ return(-1);
+ }
+
+ psize = xf86getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE);
+ if ((long)ptr == -1)
+ {
+ xf86Msg(X_WARNING,
+ "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
+ DEV_MEM, Len, Base, Offset, strerror(errno));
+ return(-1);
+ }
+#ifdef DEBUG
+ ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ Base, ptr[0] | (ptr[1] << 8));
+#endif
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
+ "-> %02x %02x %02x %02x...\n",
+ Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
+#endif
+ return(Len);
+}
+
+
+/* XXX This needs to be updated for the ND */
+
+/*
+** Find out whether the console driver provides memory mapping information
+** for the specified region and return the map_info pointer. Print a warning if required.
+*/
+static struct memAccess *
+checkMapInfo(Bool warn, int Region)
+{
+ struct memAccess *memAccP;
+
+ switch (Region)
+ {
+ case VGA_REGION:
+ memAccP = &vgaMemInfo;
+ break;
+
+ case LINEAR_REGION:
+ memAccP = &linearMemInfo;
+ break;
+
+ case MMIO_REGION:
+ memAccP = &ioMemInfo;
+ break;
+
+ default:
+ return NULL;
+ break;
+ }
+
+ if(!memAccP->Checked)
+ {
+ if(ioctl(xf86Info.screenFd, memAccP->ioctl, &(memAccP->memInfo)) == -1)
+ {
+ if(warn)
+ {
+ xf86Msg(X_WARNING,
+ "checkMapInfo: failed to get map info for region %d\n\t(%s)\n",
+ Region, strerror(errno));
+ }
+ }
+ else
+ {
+ if(memAccP->memInfo.u.map_info_mmap.map_offset
+ != MAP_INFO_UNKNOWN)
+ memAccP->OK = TRUE;
+ }
+ memAccP->Checked = TRUE;
+ }
+ if (memAccP->OK)
+ {
+ return memAccP;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+static pointer
+xf86MapInfoMap(struct memAccess *memInfoP, pointer Base, unsigned long Size)
+{
+ struct map_info *mapInfoP = &(memInfoP->memInfo);
+
+ if (mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
+ {
+ Size = (unsigned long)Base + Size;
+ }
+ else
+ {
+ Size = mapInfoP->u.map_info_mmap.map_size;
+ }
+
+ switch(mapInfoP->method)
+ {
+ case MAP_MMAP:
+ /* Need to remap if size is unknown because we may not have
+ mapped the whole region initially */
+ if(memInfoP->regionVirtBase == NULL ||
+ mapInfoP->u.map_info_mmap.map_size == MAP_INFO_UNKNOWN)
+ {
+ if((memInfoP->regionVirtBase =
+ mmap((caddr_t)0,
+ Size,
+ PROT_READ|PROT_WRITE,
+ MAP_SHARED,
+ xf86Info.screenFd,
+ (unsigned long)mapInfoP->u.map_info_mmap.map_offset))
+ == (pointer)-1)
+ {
+ FatalError("xf86MapInfoMap: Failed to map memory at 0x%x\n\t%s\n",
+ mapInfoP->u.map_info_mmap.map_offset, strerror(errno));
+ }
+ if(mapInfoP->u.map_info_mmap.internal_offset > 0)
+ memInfoP->regionVirtBase +=
+ mapInfoP->u.map_info_mmap.internal_offset;
+ }
+ break;
+
+ default:
+ FatalError("xf86MapInfoMap: Unsuported mapping method\n");
+ break;
+ }
+
+ return (pointer)((int)memInfoP->regionVirtBase + (int)Base);
+}
+
+static void
+xf86MapInfoUnmap(struct memAccess *memInfoP, unsigned long Size)
+{
+ struct map_info *mapInfoP = &(memInfoP->memInfo);
+
+ switch(mapInfoP->method)
+ {
+ case MAP_MMAP:
+ if(memInfoP->regionVirtBase != NULL)
+ {
+ if(mapInfoP->u.map_info_mmap.map_size != MAP_INFO_UNKNOWN)
+ Size = mapInfoP->u.map_info_mmap.map_size;
+ munmap((caddr_t)memInfoP->regionVirtBase, Size);
+ memInfoP->regionVirtBase = NULL;
+ }
+ break;
+ default:
+ FatalError("xf86MapInfoMap: Unsuported mapping method\n");
+ break;
+ }
+}
+
+static pointer
+armMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ struct memAccess *memInfoP;
+
+ if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
+ {
+ /*
+ ** xf86 passes in a physical address offset from the start
+ ** of physical memory, but xf86MapInfoMap expects an
+ ** offset from the start of the specified region - it gets
+ ** the physical address of the region from the display driver.
+ */
+ switch(Region)
+ {
+ case LINEAR_REGION:
+ if (vgaPhysLinearBase)
+ {
+ Base -= vgaPhysLinearBase;
+ }
+ break;
+ case VGA_REGION:
+ Base -= 0xA0000;
+ break;
+ }
+
+ base = xf86MapInfoMap(memInfoP, Base, Size);
+ return (base);
+ }
+ return mapVidMem(ScreenNum, Base, Size, flags);
+}
+
+static void
+armUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ struct memAccess *memInfoP;
+
+ if((memInfoP = checkMapInfo(FALSE, Region)) != NULL)
+ {
+ xf86MapInfoUnmap(memInfoP, Base, Size);
+ }
+ unmapVidMem(ScreenNum, Base, Size);
+}
+
+#ifdef USE_DEV_IO
+static int IoFd = -1;
+
+void
+xf86EnableIO()
+{
+ if (IoFd >= 0)
+ return;
+
+ if ((IoFd = open("/dev/io", O_RDWR)) == -1)
+ {
+ FatalError("xf86EnableIO: "
+ "Failed to open /dev/io for extended I/O\n");
+ }
+ return;
+}
+
+void
+xf86DisableIO()
+{
+ if (IoFd < 0)
+ return;
+
+ close(IoFd);
+ IoFd = -1;
+ return;
+}
+
+#endif
+
+#if defined(USE_ARC_MMAP) || defined(__arm32__)
+
+void
+xf86EnableIO()
+{
+ int fd;
+ pointer base;
+
+ if (ExtendedEnabled)
+ return;
+
+ if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
+ /* Try to map a page at the pccons I/O space */
+ base = (pointer)mmap((caddr_t)0, 65536, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0x0000);
+
+ if (base != (pointer)-1) {
+ IOPortBase = base;
+ }
+ else {
+ FatalError("EnableIO: failed to mmap %s (%s)\n",
+ "/dev/ttyC0", strerror(errno));
+ }
+ }
+ else {
+ FatalError("EnableIO: failed to open %s (%s)\n",
+ "/dev/ttyC0", strerror(errno));
+ }
+
+ ExtendedEnabled = TRUE;
+
+ return;
+}
+
+void
+xf86DisableIO()
+{
+ return;
+}
+
+#endif /* USE_ARC_MMAP */
+
+
+/***************************************************************************/
+/* Interrupt Handling section */
+/***************************************************************************/
+
+Bool
+xf86DisableInterrupts()
+{
+
+ return(TRUE);
+}
+
+void
+xf86EnableInterrupts()
+{
+
+ return;
+}
+
+
+
+#if 0
+/*
+ * XXX This is here for reference. It needs to be handled differently for the
+ * ND.
+ */
+#if defined(USE_ARC_MMAP) || defined(__arm32__)
+
+#ifdef USE_ARM32_MMAP
+#define DEV_MEM_IOBASE 0x43000000
+#endif
+
+static Bool ScreenEnabled[MAXSCREENS];
+static Bool ExtendedEnabled = FALSE;
+static Bool InitDone = FALSE;
+
+void
+xf86EnableIOPorts(ScreenNum)
+int ScreenNum;
+{
+ int i;
+ int fd;
+ pointer base;
+
+#ifdef __arm32__
+ struct memAccess *memInfoP;
+ int *Size;
+#endif
+
+ ScreenEnabled[ScreenNum] = TRUE;
+
+ if (ExtendedEnabled)
+ return;
+
+#ifdef USE_ARC_MMAP
+ if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
+ /* Try to map a page at the pccons I/O space */
+ base = (pointer)mmap((caddr_t)0, 65536, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0x0000);
+
+ if (base != (pointer)-1) {
+ IOPortBase = base;
+ }
+ else {
+ xf86Msg(X_ERROR,
+ "EnableIOPorts: failed to mmap %s (%s)\n",
+ "/dev/ttyC0", strerror(errno));
+ }
+ }
+ else {
+ xf86Msg(X_ERROR, "EnableIOPorts: failed to open %s (%s)\n",
+ "/dev/ttyC0", strerror(errno));
+ }
+#endif
+
+#ifdef __arm32__
+ IOPortBase = (unsigned int)-1;
+
+ if((memInfoP = checkMapInfo(TRUE, MMIO_REGION)) != NULL)
+ {
+ /*
+ * xf86MapInfoMap maps an offset from the start of video IO
+ * space (e.g. 0x3B0), but IOPortBase is expected to map to
+ * physical address 0x000, so subtract the start of video I/O
+ * space from the result. This is safe for now becase we
+ * actually mmap the start of the page, then the start of video
+ * I/O space is added as an internal offset.
+ */
+ IOPortBase = (unsigned int)xf86MapInfoMap(memInfoP,
+ (caddr_t)0x0, 0L)
+ - memInfoP->memInfo.u.map_info_mmap.internal_offset;
+ ExtendedEnabled = TRUE;
+ return;
+ }
+#ifdef USE_ARM32_MMAP
+ checkDevMem(TRUE);
+
+ if (devMemFd >= 0 && useDevMem)
+ {
+ base = (pointer)mmap((caddr_t)0, 0x400, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, devMemFd, (off_t)DEV_MEM_IOBASE);
+
+ if (base != (pointer)-1)
+ IOPortBase = (unsigned int)base;
+ }
+
+ if (IOPortBase == (unsigned int)-1)
+ {
+ FatalError("xf86EnableIOPorts: failed to open mem device or map IO base. \n\
+Make sure you have the Aperture Driver installed, or a kernel built with the INSECURE option\n");
+ }
+#else
+ /* We don't have the IOBASE, so we can't map the address */
+ FatalError("xf86EnableIOPorts: failed to open mem device or map IO base. \n\
+Try building the server with USE_ARM32_MMAP defined\n");
+#endif
+#endif
+
+ ExtendedEnabled = TRUE;
+
+ return;
+}
+
+void
+xf86DisableIOPorts(ScreenNum)
+int ScreenNum;
+{
+ int i;
+#ifdef __arm32__
+ struct memAccess *memInfoP;
+#endif
+
+ ScreenEnabled[ScreenNum] = FALSE;
+
+#ifdef __arm32__
+ if((memInfoP = checkMapInfo(FALSE, MMIO_REGION)) != NULL)
+ {
+ xf86MapInfoUnmap(memInfoP, 0);
+ }
+#endif
+
+#ifdef USE_ARM32_MMAP
+ if (!ExtendedEnabled)
+ return;
+
+ for (i = 0; i < MAXSCREENS; i++)
+ if (ScreenEnabled[i])
+ return;
+
+ munmap((caddr_t)IOPortBase, 0x400);
+ IOPortBase = (unsigned int)-1;
+ ExtendedEnabled = FALSE;
+#endif
+
+ return;
+}
+
+#endif /* USE_ARC_MMAP || USE_ARM32_MMAP */
+#endif
+
+
diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c
new file mode 100644
index 000000000..f999561cf
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsdResource.c
@@ -0,0 +1,190 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v 1.8 2002/05/22 21:38:29 herrb Exp $ */
+
+/* Resource information code */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Privstr.h"
+#include "xf86Pci.h"
+#include "xf86Resources.h"
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSlib.h"
+
+/* Avoid Imakefile changes */
+#include "bus/Pci.h"
+
+resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END};
+
+#ifdef INCLUDE_XF86_NO_DOMAIN
+
+#if defined(__alpha__) || defined(__sparc64__)
+
+resPtr
+xf86BusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86PciBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ /*
+ * Only allow the upper half of the pci memory range to be used
+ * for allocation. The lower half includes magic regions for DMA.
+ * XXX this is not right for XP1000's and similar where we use the
+ * region 0x40000000-0xbfffffff for DMA but this only matters if
+ * the bios screws up the pci region mappings.
+ */
+ RANGE(range, 0x80000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#ifdef INCLUDE_UNUSED
+
+resPtr
+xf86IsaBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#endif /* INCLUDE_UNUSED */
+
+resPtr
+xf86AccResFromOS(resPtr ret)
+{
+ resRange range;
+
+ /*
+ * Fallback is to claim the following areas:
+ *
+ * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
+ */
+
+ RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /*
+ * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
+ * along with their sparse I/O aliases, but that's too imprecise. Instead
+ * claim a bare minimum here.
+ */
+ RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+/* RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1); */
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /* XXX add others */
+ return ret;
+}
+
+#elif defined(__powerpc__)
+
+resPtr
+xf86BusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86PciBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#ifdef INCLUDE_UNUSED
+
+resPtr
+xf86IsaBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#endif /* INCLUDE_UNUSED */
+
+resPtr
+xf86AccResFromOS(resPtr ret)
+{
+ resRange range;
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ return ret;
+}
+
+#else
+
+#error : Put your platform dependent code here!!
+
+#endif
+
+#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/bsd/bsd_KbdMap.c b/hw/xfree86/os-support/bsd/bsd_KbdMap.c
new file mode 100644
index 000000000..a47dc2384
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_KbdMap.c
@@ -0,0 +1,1075 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_KbdMap.c,v 1.1 2002/10/11 01:40:34 dawes Exp $ */
+
+/*
+ * Slightly modified xf86KbdBSD.c which is
+ *
+ * Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk)
+ * which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ * and from xf86KbdCODrv.c by Holger Veit
+ */
+
+#include "X.h"
+#include "Xmd.h"
+#include "input.h"
+#include "scrnintstr.h"
+
+#include "compiler.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86Xinput.h"
+#include "xf86OSKbd.h"
+#include "atKeynames.h"
+#include "xf86Keymap.h"
+#include "bsd_kbd.h"
+
+#if (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)) && defined(GIO_KEYMAP)
+#define KD_GET_ENTRY(i,n) \
+ eascii_to_x[((keymap.key[i].spcl << (n+1)) & 0x100) + keymap.key[i].map[n]]
+
+static unsigned char remap[NUM_KEYCODES] = {
+ 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */
+ 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */
+ 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */
+ 0, 0, 0x69, 0x65, 0, 0, 0, 0, /* 0x70 - 0x77 */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
+};
+
+/* This table assumes the ibm code page 437 coding for characters
+ * > 0x80. They are returned in this form by PCVT */
+static KeySym eascii_to_x[512] = {
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+ NoSymbol, XK_Return, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+ XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+ XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+ XK_comma, XK_minus, XK_period, XK_slash,
+ XK_0, XK_1, XK_2, XK_3,
+ XK_4, XK_5, XK_6, XK_7,
+ XK_8, XK_9, XK_colon, XK_semicolon,
+ XK_less, XK_equal, XK_greater, XK_question,
+ XK_at, XK_A, XK_B, XK_C,
+ XK_D, XK_E, XK_F, XK_G,
+ XK_H, XK_I, XK_J, XK_K,
+ XK_L, XK_M, XK_N, XK_O,
+ XK_P, XK_Q, XK_R, XK_S,
+ XK_T, XK_U, XK_V, XK_W,
+ XK_X, XK_Y, XK_Z, XK_bracketleft,
+ XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
+ XK_grave, XK_a, XK_b, XK_c,
+ XK_d, XK_e, XK_f, XK_g,
+ XK_h, XK_i, XK_j, XK_k,
+ XK_l, XK_m, XK_n, XK_o,
+ XK_p, XK_q, XK_r, XK_s,
+ XK_t, XK_u, XK_v, XK_w,
+ XK_x, XK_y, XK_z, XK_braceleft,
+ XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
+ XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex,
+ XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla,
+ XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis,
+ XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring,
+ XK_Eacute, XK_ae, XK_AE, XK_ocircumflex,
+ XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave,
+ XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent,
+ XK_sterling, XK_yen, XK_paragraph, XK_section,
+ XK_aacute, XK_iacute, XK_oacute, XK_uacute,
+ XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine,
+ XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf,
+ XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi,
+ XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau,
+ XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta,
+ XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection,
+ XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal,
+ XK_topintegral, XK_botintegral, XK_division, XK_similarequal,
+ XK_degree, NoSymbol, NoSymbol, XK_radical,
+ XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol,
+
+ /*
+ * special marked entries (256 + x)
+ */
+
+ /* This has been checked against what syscons actually does */
+ NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R,
+ XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L,
+ XK_ISO_Left_Tab,XK_Control_L, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_F1,
+ XK_F2, XK_F3, XK_F4, XK_F5,
+ XK_F6, XK_F7, XK_F8, XK_F9,
+ XK_F10, XK_F11, XK_F12, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_Control_R, XK_Alt_R, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol
+};
+
+#ifdef __OpenBSD__
+/* don't mark AltR and CtrlR for remapping, since they
+ * cannot be remapped by pccons */
+static unsigned char pccons_remap[128] = {
+ 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */
+ 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */
+ 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x77 */
+ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */
+};
+
+/* This table assumes an iso8859_1 encoding for the characters
+ * > 80, as returned by pccons */
+static KeySym latin1_to_x[256] = {
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+ NoSymbol, XK_Return, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+ XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+ XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+ XK_comma, XK_minus, XK_period, XK_slash,
+ XK_0, XK_1, XK_2, XK_3,
+ XK_4, XK_5, XK_6, XK_7,
+ XK_8, XK_9, XK_colon, XK_semicolon,
+ XK_less, XK_equal, XK_greater, XK_question,
+ XK_at, XK_A, XK_B, XK_C,
+ XK_D, XK_E, XK_F, XK_G,
+ XK_H, XK_I, XK_J, XK_K,
+ XK_L, XK_M, XK_N, XK_O,
+ XK_P, XK_Q, XK_R, XK_S,
+ XK_T, XK_U, XK_V, XK_W,
+ XK_X, XK_Y, XK_Z, XK_bracketleft,
+ XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
+ XK_grave, XK_a, XK_b, XK_c,
+ XK_d, XK_e, XK_f, XK_g,
+ XK_h, XK_i, XK_j, XK_k,
+ XK_l, XK_m, XK_n, XK_o,
+ XK_p, XK_q, XK_r, XK_s,
+ XK_t, XK_u, XK_v, XK_w,
+ XK_x, XK_y, XK_z, XK_braceleft,
+ XK_bar, XK_braceright, XK_asciitilde, XK_Delete,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
+ XK_currency, XK_yen, XK_brokenbar, XK_section,
+ XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
+ XK_notsign, XK_hyphen, XK_registered, XK_macron,
+ XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
+ XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
+ XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
+ XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
+ XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
+ XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
+ XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
+ XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
+ XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
+ XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
+ XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
+ XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
+ XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
+ XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
+ XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
+ XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
+ XK_eth, XK_ntilde, XK_ograve, XK_oacute,
+ XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
+ XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
+ XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
+ };
+#endif
+
+#ifdef SYSCONS_SUPPORT
+static
+unsigned char sysconsCODEMap[] = {
+ KEY_KP_Enter, KEY_RCtrl, KEY_KP_Divide, KEY_Print,
+ KEY_AltLang, KEY_KP_7, KEY_KP_8, KEY_KP_9,
+ KEY_KP_4, KEY_KP_6, KEY_KP_1, KEY_KP_2,
+ KEY_KP_3, KEY_KP_0, KEY_KP_Decimal, KEY_Pause,
+ KEY_LMeta, KEY_RMeta, KEY_Menu, KEY_Break
+};
+static
+TransMapRec sysconsCODE = {
+ 0x59,
+ 0x6d,
+ sysconsCODEMap
+};
+#endif
+#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
+
+#ifdef WSCONS_SUPPORT
+
+static CARD8 wsUsbMap[] = {
+ /* 0 */ KEY_NOTUSED,
+ /* 1 */ KEY_NOTUSED,
+ /* 2 */ KEY_NOTUSED,
+ /* 3 */ KEY_NOTUSED,
+ /* 4 */ KEY_A,
+ /* 5 */ KEY_B,
+ /* 6 */ KEY_C,
+ /* 7 */ KEY_D,
+ /* 8 */ KEY_E,
+ /* 9 */ KEY_F,
+ /* 10 */ KEY_G,
+ /* 11 */ KEY_H,
+ /* 12 */ KEY_I,
+ /* 13 */ KEY_J,
+ /* 14 */ KEY_K,
+ /* 15 */ KEY_L,
+ /* 16 */ KEY_M,
+ /* 17 */ KEY_N,
+ /* 18 */ KEY_O,
+ /* 19 */ KEY_P,
+ /* 20 */ KEY_Q,
+ /* 21 */ KEY_R,
+ /* 22 */ KEY_S,
+ /* 23 */ KEY_T,
+ /* 24 */ KEY_U,
+ /* 25 */ KEY_V,
+ /* 26 */ KEY_W,
+ /* 27 */ KEY_X,
+ /* 28 */ KEY_Y,
+ /* 29 */ KEY_Z,
+ /* 30 */ KEY_1, /* 1 !*/
+ /* 31 */ KEY_2, /* 2 @ */
+ /* 32 */ KEY_3, /* 3 # */
+ /* 33 */ KEY_4, /* 4 $ */
+ /* 34 */ KEY_5, /* 5 % */
+ /* 35 */ KEY_6, /* 6 ^ */
+ /* 36 */ KEY_7, /* 7 & */
+ /* 37 */ KEY_8, /* 8 * */
+ /* 38 */ KEY_9, /* 9 ( */
+ /* 39 */ KEY_0, /* 0 ) */
+ /* 40 */ KEY_Enter, /* Return */
+ /* 41 */ KEY_Escape, /* Escape */
+ /* 42 */ KEY_BackSpace, /* Backspace Delete */
+ /* 43 */ KEY_Tab, /* Tab */
+ /* 44 */ KEY_Space, /* Space */
+ /* 45 */ KEY_Minus, /* - _ */
+ /* 46 */ KEY_Equal, /* = + */
+ /* 47 */ KEY_LBrace, /* [ { */
+ /* 48 */ KEY_RBrace, /* ] } */
+ /* 49 */ KEY_BSlash, /* \ | */
+ /* 50 */ KEY_BSlash2, /* \ _ # ~ on some keyboards */
+ /* 51 */ KEY_SemiColon, /* ; : */
+ /* 52 */ KEY_Quote, /* ' " */
+ /* 53 */ KEY_Tilde, /* ` ~ */
+ /* 54 */ KEY_Comma, /* , < */
+ /* 55 */ KEY_Period, /* . > */
+ /* 56 */ KEY_Slash, /* / ? */
+ /* 57 */ KEY_CapsLock, /* Caps Lock */
+ /* 58 */ KEY_F1, /* F1 */
+ /* 59 */ KEY_F2, /* F2 */
+ /* 60 */ KEY_F3, /* F3 */
+ /* 61 */ KEY_F4, /* F4 */
+ /* 62 */ KEY_F5, /* F5 */
+ /* 63 */ KEY_F6, /* F6 */
+ /* 64 */ KEY_F7, /* F7 */
+ /* 65 */ KEY_F8, /* F8 */
+ /* 66 */ KEY_F9, /* F9 */
+ /* 67 */ KEY_F10, /* F10 */
+ /* 68 */ KEY_F11, /* F11 */
+ /* 69 */ KEY_F12, /* F12 */
+ /* 70 */ KEY_Print, /* PrintScrn SysReq */
+ /* 71 */ KEY_ScrollLock, /* Scroll Lock */
+ /* 72 */ KEY_Pause, /* Pause Break */
+ /* 73 */ KEY_Insert, /* Insert XXX Help on some Mac Keyboards */
+ /* 74 */ KEY_Home, /* Home */
+ /* 75 */ KEY_PgUp, /* Page Up */
+ /* 76 */ KEY_Delete, /* Delete */
+ /* 77 */ KEY_End, /* End */
+ /* 78 */ KEY_PgDown, /* Page Down */
+ /* 79 */ KEY_Right, /* Right Arrow */
+ /* 80 */ KEY_Left, /* Left Arrow */
+ /* 81 */ KEY_Down, /* Down Arrow */
+ /* 82 */ KEY_Up, /* Up Arrow */
+ /* 83 */ KEY_NumLock, /* Num Lock */
+ /* 84 */ KEY_KP_Divide, /* Keypad / */
+ /* 85 */ KEY_KP_Multiply, /* Keypad * */
+ /* 86 */ KEY_KP_Minus, /* Keypad - */
+ /* 87 */ KEY_KP_Plus, /* Keypad + */
+ /* 88 */ KEY_KP_Enter, /* Keypad Enter */
+ /* 89 */ KEY_KP_1, /* Keypad 1 End */
+ /* 90 */ KEY_KP_2, /* Keypad 2 Down */
+ /* 91 */ KEY_KP_3, /* Keypad 3 Pg Down */
+ /* 92 */ KEY_KP_4, /* Keypad 4 Left */
+ /* 93 */ KEY_KP_5, /* Keypad 5 */
+ /* 94 */ KEY_KP_6, /* Keypad 6 */
+ /* 95 */ KEY_KP_7, /* Keypad 7 Home */
+ /* 96 */ KEY_KP_8, /* Keypad 8 Up */
+ /* 97 */ KEY_KP_9, /* KEypad 9 Pg Up */
+ /* 98 */ KEY_KP_0, /* Keypad 0 Ins */
+ /* 99 */ KEY_KP_Decimal, /* Keypad . Del */
+ /* 100 */ KEY_Less, /* < > on some keyboards */
+ /* 101 */ KEY_Menu, /* Menu */
+ /* 102 */ KEY_NOTUSED,
+ /* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */
+ /* 104 */ KEY_NOTUSED,
+ /* 105 */ KEY_NOTUSED,
+ /* 106 */ KEY_NOTUSED,
+ /* 107 */ KEY_NOTUSED,
+ /* 108 */ KEY_NOTUSED,
+ /* 109 */ KEY_NOTUSED,
+ /* 110 */ KEY_NOTUSED,
+ /* 111 */ KEY_NOTUSED,
+ /* 112 */ KEY_NOTUSED,
+ /* 113 */ KEY_NOTUSED,
+ /* 114 */ KEY_NOTUSED,
+ /* 115 */ KEY_NOTUSED,
+ /* 116 */ KEY_NOTUSED,
+ /* 117 */ KEY_NOTUSED,
+ /* 118 */ KEY_NOTUSED,
+ /* 119 */ KEY_NOTUSED,
+ /* 120 */ KEY_NOTUSED,
+ /* 121 */ KEY_NOTUSED,
+ /* 122 */ KEY_NOTUSED,
+ /* 123 */ KEY_NOTUSED,
+ /* 124 */ KEY_NOTUSED,
+ /* 125 */ KEY_NOTUSED,
+ /* 126 */ KEY_NOTUSED,
+ /* 127 */ KEY_NOTUSED,
+ /* 128 */ KEY_NOTUSED,
+ /* 129 */ KEY_NOTUSED,
+ /* 130 */ KEY_NOTUSED,
+ /* 131 */ KEY_NOTUSED,
+ /* 132 */ KEY_NOTUSED,
+ /* 133 */ KEY_NOTUSED,
+ /* 134 */ KEY_NOTUSED,
+ /* 135 */ KEY_NOTUSED,
+ /* 136 */ KEY_NOTUSED,
+ /* 137 */ KEY_NOTUSED,
+ /* 138 */ KEY_NOTUSED,
+ /* 139 */ KEY_NOTUSED,
+ /* 140 */ KEY_NOTUSED,
+ /* 141 */ KEY_NOTUSED,
+ /* 142 */ KEY_NOTUSED,
+ /* 143 */ KEY_NOTUSED,
+ /* 144 */ KEY_NOTUSED,
+ /* 145 */ KEY_NOTUSED,
+ /* 146 */ KEY_NOTUSED,
+ /* 147 */ KEY_NOTUSED,
+ /* 148 */ KEY_NOTUSED,
+ /* 149 */ KEY_NOTUSED,
+ /* 150 */ KEY_NOTUSED,
+ /* 151 */ KEY_NOTUSED,
+ /* 152 */ KEY_NOTUSED,
+ /* 153 */ KEY_NOTUSED,
+ /* 154 */ KEY_NOTUSED,
+ /* 155 */ KEY_NOTUSED,
+ /* 156 */ KEY_NOTUSED,
+ /* 157 */ KEY_NOTUSED,
+ /* 158 */ KEY_NOTUSED,
+ /* 159 */ KEY_NOTUSED,
+ /* 160 */ KEY_NOTUSED,
+ /* 161 */ KEY_NOTUSED,
+ /* 162 */ KEY_NOTUSED,
+ /* 163 */ KEY_NOTUSED,
+ /* 164 */ KEY_NOTUSED,
+ /* 165 */ KEY_NOTUSED,
+ /* 166 */ KEY_NOTUSED,
+ /* 167 */ KEY_NOTUSED,
+ /* 168 */ KEY_NOTUSED,
+ /* 169 */ KEY_NOTUSED,
+ /* 170 */ KEY_NOTUSED,
+ /* 171 */ KEY_NOTUSED,
+ /* 172 */ KEY_NOTUSED,
+ /* 173 */ KEY_NOTUSED,
+ /* 174 */ KEY_NOTUSED,
+ /* 175 */ KEY_NOTUSED,
+ /* 176 */ KEY_NOTUSED,
+ /* 177 */ KEY_NOTUSED,
+ /* 178 */ KEY_NOTUSED,
+ /* 179 */ KEY_NOTUSED,
+ /* 180 */ KEY_NOTUSED,
+ /* 181 */ KEY_NOTUSED,
+ /* 182 */ KEY_NOTUSED,
+ /* 183 */ KEY_NOTUSED,
+ /* 184 */ KEY_NOTUSED,
+ /* 185 */ KEY_NOTUSED,
+ /* 186 */ KEY_NOTUSED,
+ /* 187 */ KEY_NOTUSED,
+ /* 188 */ KEY_NOTUSED,
+ /* 189 */ KEY_NOTUSED,
+ /* 190 */ KEY_NOTUSED,
+ /* 191 */ KEY_NOTUSED,
+ /* 192 */ KEY_NOTUSED,
+ /* 193 */ KEY_NOTUSED,
+ /* 194 */ KEY_NOTUSED,
+ /* 195 */ KEY_NOTUSED,
+ /* 196 */ KEY_NOTUSED,
+ /* 197 */ KEY_NOTUSED,
+ /* 198 */ KEY_NOTUSED,
+ /* 199 */ KEY_NOTUSED,
+ /* 200 */ KEY_NOTUSED,
+ /* 201 */ KEY_NOTUSED,
+ /* 202 */ KEY_NOTUSED,
+ /* 203 */ KEY_NOTUSED,
+ /* 204 */ KEY_NOTUSED,
+ /* 205 */ KEY_NOTUSED,
+ /* 206 */ KEY_NOTUSED,
+ /* 207 */ KEY_NOTUSED,
+ /* 208 */ KEY_NOTUSED,
+ /* 209 */ KEY_NOTUSED,
+ /* 210 */ KEY_NOTUSED,
+ /* 211 */ KEY_NOTUSED,
+ /* 212 */ KEY_NOTUSED,
+ /* 213 */ KEY_NOTUSED,
+ /* 214 */ KEY_NOTUSED,
+ /* 215 */ KEY_NOTUSED,
+ /* 216 */ KEY_NOTUSED,
+ /* 217 */ KEY_NOTUSED,
+ /* 218 */ KEY_NOTUSED,
+ /* 219 */ KEY_NOTUSED,
+ /* 220 */ KEY_NOTUSED,
+ /* 221 */ KEY_NOTUSED,
+ /* 222 */ KEY_NOTUSED,
+ /* 223 */ KEY_NOTUSED,
+ /* 224 */ KEY_LCtrl, /* Left Control */
+ /* 225 */ KEY_ShiftL, /* Left Shift */
+ /* 226 */ KEY_Alt, /* Left Alt */
+ /* 227 */ KEY_LMeta, /* Left Meta */
+ /* 228 */ KEY_RCtrl, /* Right Control */
+ /* 229 */ KEY_ShiftR, /* Right Shift */
+ /* 230 */ KEY_AltLang, /* Right Alt, AKA AltGr */
+ /* 231 */ KEY_LMeta, /* Right Meta XXX */
+};
+#define WS_USB_MAP_SIZE (sizeof(wsUsbMap)/sizeof(unsigned char))
+
+static
+TransMapRec wsUsb = {
+ 0,
+ WS_USB_MAP_SIZE,
+ wsUsbMap
+};
+
+/* Map for adb keyboards */
+static CARD8 wsAdbMap[] = {
+ /* 0 */ KEY_A,
+ /* 1 */ KEY_S,
+ /* 2 */ KEY_D,
+ /* 3 */ KEY_F,
+ /* 4 */ KEY_H,
+ /* 5 */ KEY_G,
+ /* 6 */ KEY_Z,
+ /* 7 */ KEY_X,
+ /* 8 */ KEY_C,
+ /* 9 */ KEY_V,
+ /* 10 */ KEY_UNKNOWN, /* @ # on french keyboards */
+ /* 11 */ KEY_B,
+ /* 12 */ KEY_Q,
+ /* 13 */ KEY_W,
+ /* 14 */ KEY_E,
+ /* 15 */ KEY_R,
+ /* 16 */ KEY_Y,
+ /* 17 */ KEY_T,
+ /* 18 */ KEY_1,
+ /* 19 */ KEY_2,
+ /* 20 */ KEY_3,
+ /* 21 */ KEY_4,
+ /* 22 */ KEY_6,
+ /* 23 */ KEY_5,
+ /* 24 */ KEY_Equal,
+ /* 25 */ KEY_9,
+ /* 26 */ KEY_7,
+ /* 27 */ KEY_Minus,
+ /* 28 */ KEY_8,
+ /* 29 */ KEY_0,
+ /* 30 */ KEY_RBrace,
+ /* 31 */ KEY_O,
+ /* 32 */ KEY_U,
+ /* 33 */ KEY_LBrace,
+ /* 34 */ KEY_I,
+ /* 35 */ KEY_P,
+ /* 36 */ KEY_Enter,
+ /* 37 */ KEY_L,
+ /* 38 */ KEY_J,
+ /* 39 */ KEY_Quote,
+ /* 40 */ KEY_K,
+ /* 41 */ KEY_SemiColon,
+ /* 42 */ KEY_BSlash,
+ /* 43 */ KEY_Comma,
+ /* 44 */ KEY_Slash,
+ /* 45 */ KEY_N,
+ /* 46 */ KEY_M,
+ /* 47 */ KEY_Period,
+ /* 48 */ KEY_Tab,
+ /* 49 */ KEY_Space,
+ /* 50 */ KEY_Tilde,
+ /* 51 */ KEY_Delete,
+ /* 52 */ KEY_AltLang,
+ /* 53 */ KEY_Escape,
+ /* 54 */ KEY_LCtrl,
+ /* 55 */ KEY_Alt,
+ /* 56 */ KEY_ShiftL,
+ /* 57 */ KEY_CapsLock,
+ /* 58 */ KEY_LMeta,
+ /* 59 */ KEY_Left,
+ /* 60 */ KEY_Right,
+ /* 61 */ KEY_Down,
+ /* 62 */ KEY_Up,
+ /* 63 */ KEY_UNKNOWN, /* Fn */
+ /* 64 */ KEY_NOTUSED,
+ /* 65 */ KEY_KP_Decimal,
+ /* 66 */ KEY_NOTUSED,
+ /* 67 */ KEY_KP_Multiply,
+ /* 68 */ KEY_NOTUSED,
+ /* 69 */ KEY_KP_Plus,
+ /* 70 */ KEY_NOTUSED,
+ /* 71 */ KEY_UNKNOWN, /* Clear */
+ /* 72 */ KEY_NOTUSED,
+ /* 73 */ KEY_NOTUSED,
+ /* 74 */ KEY_NOTUSED,
+ /* 75 */ KEY_KP_Divide,
+ /* 76 */ KEY_KP_Enter,
+ /* 77 */ KEY_NOTUSED,
+ /* 78 */ KEY_KP_Minus,
+ /* 79 */ KEY_NOTUSED,
+ /* 80 */ KEY_NOTUSED,
+ /* 81 */ KEY_KP_Equal, /* Keypad = */
+ /* 82 */ KEY_KP_0,
+ /* 83 */ KEY_KP_1,
+ /* 84 */ KEY_KP_2,
+ /* 85 */ KEY_KP_3,
+ /* 86 */ KEY_KP_4,
+ /* 87 */ KEY_KP_5,
+ /* 88 */ KEY_KP_6,
+ /* 89 */ KEY_KP_7,
+ /* 90 */ KEY_NOTUSED,
+ /* 91 */ KEY_KP_8,
+ /* 92 */ KEY_KP_9,
+ /* 93 */ KEY_NOTUSED,
+ /* 94 */ KEY_NOTUSED,
+ /* 95 */ KEY_UNKNOWN, /* Keypad , */
+ /* 96 */ KEY_F5,
+ /* 97 */ KEY_F6,
+ /* 98 */ KEY_F7,
+ /* 99 */ KEY_F3,
+ /* 100 */ KEY_F8,
+ /* 101 */ KEY_F9,
+ /* 102 */ KEY_NOTUSED,
+ /* 103 */ KEY_F11,
+ /* 104 */ KEY_NOTUSED,
+ /* 105 */ KEY_NOTUSED,
+ /* 106 */ KEY_KP_Enter,
+ /* 107 */ KEY_NOTUSED,
+ /* 108 */ KEY_NOTUSED,
+ /* 109 */ KEY_F10,
+ /* 110 */ KEY_NOTUSED,
+ /* 111 */ KEY_F12,
+ /* 112 */ KEY_NOTUSED,
+ /* 113 */ KEY_NOTUSED,
+ /* 114 */ KEY_NOTUSED,
+ /* 115 */ KEY_Home,
+ /* 116 */ KEY_PgUp,
+ /* 117 */ KEY_NOTUSED,
+ /* 118 */ KEY_F4,
+ /* 119 */ KEY_End,
+ /* 120 */ KEY_F2,
+ /* 121 */ KEY_PgDown,
+ /* 122 */ KEY_F1
+};
+#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char))
+
+static
+TransMapRec wsAdb = {
+ 0,
+ WS_ADB_MAP_SIZE,
+ wsAdbMap
+};
+
+static CARD8 wsSunMap[] = {
+ /* 0x00 */ KEY_NOTUSED,
+ /* 0x01 */ KEY_NOTUSED, /* stop */
+ /* 0x02 */ KEY_NOTUSED, /* BrightnessDown / S-VolumeDown */
+ /* 0x03 */ KEY_NOTUSED, /* again */
+ /* 0x04 */ KEY_NOTUSED, /* BridgtnessUp / S-VolumeUp */
+ /* 0x05 */ KEY_F1,
+ /* 0x06 */ KEY_F2,
+ /* 0x07 */ KEY_F10,
+ /* 0x08 */ KEY_F3,
+ /* 0x09 */ KEY_F11,
+ /* 0x0a */ KEY_F4,
+ /* 0x0b */ KEY_F12,
+ /* 0x0c */ KEY_F5,
+ /* 0x0d */ KEY_AltLang,
+ /* 0x0e */ KEY_F6,
+ /* 0x0f */ KEY_NOTUSED,
+ /* 0x10 */ KEY_F7,
+ /* 0x11 */ KEY_F8,
+ /* 0x12 */ KEY_F9,
+ /* 0x13 */ KEY_Alt,
+ /* 0x14 */ KEY_Up,
+ /* 0x15 */ KEY_Pause,
+ /* 0x16 */ KEY_Print,
+ /* 0x17 */ KEY_NOTUSED, /* props */
+ /* 0x18 */ KEY_Left,
+ /* 0x19 */ KEY_ScrollLock,
+ /* 0x1a */ KEY_NOTUSED, /* undo */
+ /* 0x1b */ KEY_Down,
+ /* 0x1c */ KEY_Right,
+ /* 0x1d */ KEY_Escape,
+ /* 0x1e */ KEY_1,
+ /* 0x1f */ KEY_2,
+ /* 0x20 */ KEY_3,
+ /* 0x21 */ KEY_4,
+ /* 0x22 */ KEY_5,
+ /* 0x23 */ KEY_6,
+ /* 0x24 */ KEY_7,
+ /* 0x25 */ KEY_8,
+ /* 0x26 */ KEY_9,
+ /* 0x27 */ KEY_0,
+ /* 0x28 */ KEY_Minus,
+ /* 0x29 */ KEY_Equal,
+ /* 0x2a */ KEY_Tilde,
+ /* 0x2b */ KEY_BackSpace,
+ /* 0x2c */ KEY_Insert,
+ /* 0x2d */ KEY_KP_Equal,
+ /* 0x2e */ KEY_KP_Divide,
+ /* 0x2f */ KEY_KP_Multiply,
+ /* 0x30 */ KEY_NOTUSED,
+ /* 0x31 */ KEY_NOTUSED, /* front */
+ /* 0x32 */ KEY_KP_Decimal,
+ /* 0x33 */ KEY_NOTUSED, /* copy */
+ /* 0x34 */ KEY_Home,
+ /* 0x35 */ KEY_Tab,
+ /* 0x36 */ KEY_Q,
+ /* 0x37 */ KEY_W,
+ /* 0x38 */ KEY_E,
+ /* 0x39 */ KEY_R,
+ /* 0x3a */ KEY_T,
+ /* 0x3b */ KEY_Y,
+ /* 0x3c */ KEY_U,
+ /* 0x3d */ KEY_I,
+ /* 0x3e */ KEY_O,
+ /* 0x3f */ KEY_P,
+ /* 0x40 */ KEY_LBrace,
+ /* 0x41 */ KEY_RBrace,
+ /* 0x42 */ KEY_Delete,
+ /* 0x43 */ KEY_NOTUSED, /* compose */
+ /* 0x44 */ KEY_KP_7,
+ /* 0x45 */ KEY_KP_8,
+ /* 0x46 */ KEY_KP_9,
+ /* 0x47 */ KEY_KP_Minus,
+ /* 0x48 */ KEY_NOTUSED, /* open */
+ /* 0x49 */ KEY_NOTUSED, /* paste */
+ /* 0x4a */ KEY_End,
+ /* 0x4b */ KEY_NOTUSED,
+ /* 0x4c */ KEY_LCtrl,
+ /* 0x4d */ KEY_A,
+ /* 0x4e */ KEY_S,
+ /* 0x4f */ KEY_D,
+ /* 0x50 */ KEY_F,
+ /* 0x51 */ KEY_G,
+ /* 0x52 */ KEY_H,
+ /* 0x53 */ KEY_J,
+ /* 0x54 */ KEY_K,
+ /* 0x55 */ KEY_L,
+ /* 0x56 */ KEY_SemiColon,
+ /* 0x57 */ KEY_Quote,
+ /* 0x58 */ KEY_BSlash,
+ /* 0x59 */ KEY_Enter,
+ /* 0x5a */ KEY_KP_Enter,
+ /* 0x5b */ KEY_KP_4,
+ /* 0x5c */ KEY_KP_5,
+ /* 0x5d */ KEY_KP_6,
+ /* 0x5e */ KEY_KP_0,
+ /* 0x5f */ KEY_NOTUSED, /* find */
+ /* 0x60 */ KEY_PgUp,
+ /* 0x61 */ KEY_NOTUSED, /* cut */
+ /* 0x62 */ KEY_NumLock,
+ /* 0x63 */ KEY_ShiftL,
+ /* 0x64 */ KEY_Z,
+ /* 0x65 */ KEY_X,
+ /* 0x66 */ KEY_C,
+ /* 0x67 */ KEY_V,
+ /* 0x68 */ KEY_B,
+ /* 0x69 */ KEY_N,
+ /* 0x6a */ KEY_M,
+ /* 0x6b */ KEY_Comma,
+ /* 0x6c */ KEY_Period,
+ /* 0x6d */ KEY_Slash,
+ /* 0x6e */ KEY_ShiftR,
+ /* 0x6f */ KEY_NOTUSED, /* linefeed */
+ /* 0x70 */ KEY_KP_1,
+ /* 0x71 */ KEY_KP_2,
+ /* 0x72 */ KEY_KP_3,
+ /* 0x73 */ KEY_NOTUSED,
+ /* 0x74 */ KEY_NOTUSED,
+ /* 0x75 */ KEY_NOTUSED,
+ /* 0x76 */ KEY_NOTUSED, /* help */
+ /* 0x77 */ KEY_CapsLock,
+ /* 0x78 */ KEY_LMeta,
+ /* 0x79 */ KEY_Space,
+ /* 0x7a */ KEY_RMeta,
+ /* 0x7b */ KEY_PgDown,
+ /* 0x7c */ KEY_NOTUSED,
+ /* 0x7d */ KEY_KP_Plus,
+ /* 0x7e */ KEY_NOTUSED,
+ /* 0x7f */ KEY_NOTUSED
+};
+#define WS_SUN_MAP_SIZE (sizeof(wsSunMap)/sizeof(unsigned char))
+
+static
+TransMapRec wsSun = {
+ 0,
+ WS_SUN_MAP_SIZE,
+ wsSunMap
+};
+
+#endif /* WSCONS_SUPPORT */
+
+/*ARGSUSED*/
+
+/*
+ * KbdGetMapping --
+ * Get the national keyboard mapping. The keyboard type is set, a new map
+ * and the modifiermap is computed.
+ */
+
+void
+KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ KeySym *k;
+ int i;
+
+#ifndef __bsdi__
+ switch (pKbd->consType) {
+
+#ifdef PCCONS_SUPPORT
+ case PCCONS:
+#if defined(__OpenBSD__)
+ /*
+ * on OpenBSD, the pccons keymap is programmable, too
+ */
+ {
+ pccons_keymap_t keymap[KB_NUM_KEYS];
+ if (ioctl(pInfo->fd, CONSOLE_GET_KEYMAP, &keymap) != -1) {
+ for (i = 0; i < KB_NUM_KEYS; i++)
+ if (pccons_remap[i]) {
+ k = map + (pccons_remap[i] << 2);
+ switch (keymap[i].type) {
+ case KB_ASCII:
+ /* For ASCII keys, there is only one char in the keymap */
+ k[0] = latin1_to_x[(unsigned char)keymap[i].unshift[0]];
+ k[1] = latin1_to_x[(unsigned char)keymap[i].shift[0]];
+ k[2] = latin1_to_x[(unsigned char)keymap[i].altgr[0]];
+ k[3] = latin1_to_x[(unsigned char)keymap[i].shift_altgr[0]];
+ break;
+ case KB_SCROLL:
+ k[0] = XK_Scroll_Lock;
+ goto special;
+ case KB_NUM:
+ k[0] = XK_Num_Lock;
+ goto special;
+ case KB_CAPS:
+ k[0] = XK_Caps_Lock;
+ goto special;
+ case KB_SHIFT:
+ switch (keymap[i].unshift[0]) {
+ case 1:
+ /* left shift */
+ k[0] = XK_Shift_L;
+ break;
+ case 2:
+ /* right shift */
+ k[0] = XK_Shift_R;
+ break;
+ default:
+ k[0] = NoSymbol;
+ }
+ goto special;
+ case KB_CTL:
+ k[0] = XK_Control_L;
+ goto special;
+ case KB_ALT:
+ k[0] = XK_Alt_L;
+ goto special;
+ case KB_FUNC:
+ switch (keymap[i].unshift[2]) {
+ case 'M':
+ k[0] = XK_F1;
+ break;
+ case 'N':
+ k[0] = XK_F2;
+ break;
+ case 'O':
+ k[0] = XK_F3;
+ break;
+ case 'P':
+ k[0] = XK_F4;
+ break;
+ case 'Q':
+ k[0] = XK_F5;
+ break;
+ case 'R':
+ k[0] = XK_F6;
+ break;
+ case 'S':
+ k[0] = XK_F7;
+ break;
+ case 'T':
+ k[0] = XK_F8;
+ break;
+ case 'U':
+ k[0] = XK_F9;
+ break;
+ case 'V':
+ k[0] = XK_F10;
+ break;
+ case 'W':
+ k[0] = XK_F11;
+ break;
+ case 'X':
+ k[0] = XK_F12;
+ break;
+ default:
+ k[0] = NoSymbol;
+ break;
+ }
+ goto special;
+ default:
+ k[0] = NoSymbol;
+ special:
+ k[1] = k[2] = k[3] = NoSymbol;
+ }
+ }
+ } else {
+ ErrorF("Can't read pccons keymap\n");
+ }
+ }
+#endif /* __OpenBSD__ */
+ break;
+#endif
+
+/*
+ * XXX wscons has no GIO_KEYMAP
+ */
+#if (defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)) && defined(GIO_KEYMAP)
+ case SYSCONS:
+ case PCVT:
+ {
+ keymap_t keymap;
+
+ if (ioctl(pInfo->fd, GIO_KEYMAP, &keymap) != -1) {
+ for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++)
+ if (remap[i]) {
+ k = map + (remap[i] << 2);
+ k[0] = KD_GET_ENTRY(i,0); /* non-shifed */
+ k[1] = KD_GET_ENTRY(i,1); /* shifted */
+ k[2] = KD_GET_ENTRY(i,4); /* alt */
+ k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */
+ if (k[3] == k[2]) k[3] = NoSymbol;
+ if (k[2] == k[1]) k[2] = NoSymbol;
+ if (k[1] == k[0]) k[1] = NoSymbol;
+ if (k[0] == k[2] && k[1] == k[3])
+ k[2] = k[3] = NoSymbol;
+ }
+ }
+ }
+ break;
+#endif /* SYSCONS || PCVT */
+
+ }
+#endif /* !bsdi */
+
+ /*
+ * compute the modifier map
+ */
+ for (i = 0; i < MAP_LENGTH; i++)
+ pModMap[i] = NoSymbol; /* make sure it is restored */
+
+ for (k = map, i = MIN_KEYCODE;
+ i < (NUM_KEYCODES + MIN_KEYCODE);
+ i++, k += 4)
+
+ switch(*k) {
+
+ case XK_Shift_L:
+ case XK_Shift_R:
+ pModMap[i] = ShiftMask;
+ break;
+
+ case XK_Control_L:
+ case XK_Control_R:
+ pModMap[i] = ControlMask;
+ break;
+
+ case XK_Caps_Lock:
+ pModMap[i] = LockMask;
+ break;
+
+ case XK_Alt_L:
+ case XK_Alt_R:
+ pModMap[i] = AltMask;
+ break;
+
+ case XK_Num_Lock:
+ pModMap[i] = NumLockMask;
+ break;
+
+ case XK_Scroll_Lock:
+ pModMap[i] = ScrollLockMask;
+ break;
+
+ /* kana support */
+ case XK_Kana_Lock:
+ case XK_Kana_Shift:
+ pModMap[i] = KanaMask;
+ break;
+
+ /* alternate toggle for multinational support */
+ case XK_Mode_switch:
+ pModMap[i] = AltLangMask;
+ break;
+
+ }
+
+ pKbd->kbdType = 0;
+
+ pKeySyms->map = map;
+ pKeySyms->mapWidth = GLYPHS_PER_KEY;
+ pKeySyms->minKeyCode = MIN_KEYCODE;
+ pKeySyms->maxKeyCode = MAX_KEYCODE;
+
+ switch(pKbd->consType) {
+#ifdef SYSCONS_SUPPORT
+ case SYSCONS:
+ if (pKbd->CustomKeycodes)
+ pKbd->scancodeMap = &sysconsCODE;
+ else
+ pKbd->RemapScanCode = ATScancode;
+ break;
+#endif
+#if defined(PCCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ case PCCONS:
+ case PCVT:
+ pKbd->RemapScanCode = ATScancode;
+#endif
+#ifdef WSCONS_SUPPORT
+ case WSCONS:
+ switch (pKbd->wsKbdType) {
+ case WSKBD_TYPE_PC_XT:
+ case WSKBD_TYPE_PC_AT:
+ pKbd->RemapScanCode = ATScancode;
+ break;
+ case WSKBD_TYPE_USB:
+ pKbd->scancodeMap = &wsUsb;
+ break;
+#ifdef WSKBD_TYPE_ADB
+ case WSKBD_TYPE_ADB:
+ pKbd->scancodeMap = &wsAdb;
+ break;
+#endif
+#ifdef WSKBD_TYPE_SUN
+ case WSKBD_TYPE_SUN:
+ pKbd->scancodeMap = &wsSun;
+ break;
+#endif
+ default:
+ ErrorF("Unknown wskbd type %d\n", pKbd->wsKbdType);
+ }
+ break;
+#endif
+ }
+ return;
+}
diff --git a/hw/xfree86/os-support/bsd/bsd_apm.c b/hw/xfree86/os-support/bsd/bsd_apm.c
new file mode 100644
index 000000000..250e5cb55
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_apm.c
@@ -0,0 +1,137 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_apm.c,v 1.1 2000/02/29 03:09:25 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+#include "xf86_OSlib.h"
+
+#include <machine/apmvar.h>
+
+#define APM_DEVICE "/dev/apm"
+
+static pointer APMihPtr = NULL;
+static void bsdCloseAPM(void);
+
+static struct {
+ u_int apmBsd;
+ pmEvent xf86;
+} bsdToXF86Array [] = {
+ { APM_STANDBY_REQ, XF86_APM_SYS_STANDBY },
+ { APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND },
+ { APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME },
+ { APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME },
+ { APM_BATTERY_LOW, XF86_APM_LOW_BATTERY },
+ { APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE },
+ { APM_UPDATE_TIME, XF86_APM_UPDATE_TIME },
+ { APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND },
+ { APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY },
+ { APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND },
+ { APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME },
+#ifdef APM_CAPABILITY_CHANGE
+ { APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED },
+#endif
+};
+
+#define numApmEvents (sizeof(bsdToXF86Array) / sizeof(bsdToXF86Array[0]))
+
+static pmEvent
+bsdToXF86(int type)
+{
+ int i;
+
+ for (i = 0; i < numApmEvents; i++) {
+ if (type == bsdToXF86Array[i].apmBsd) {
+ return bsdToXF86Array[i].xf86;
+ }
+ }
+ return XF86_APM_UNKNOWN;
+}
+
+/*
+ * APM events can be requested direclty from /dev/apm
+ */
+static int
+bsdPMGetEventFromOS(int fd, pmEvent *events, int num)
+{
+ struct apm_event_info bsdEvent;
+ int i;
+
+ for (i = 0; i < num; i++) {
+
+ if (ioctl(fd, APM_IOC_NEXTEVENT, &bsdEvent) < 0) {
+ if (errno != EAGAIN) {
+ xf86Msg(X_WARNING, "bsdPMGetEventFromOS: APM_IOC_NEXTEVENT"
+ " errno = %d\n", errno);
+ }
+ break;
+ }
+ events[i] = bsdToXF86(bsdEvent.type);
+ }
+ return i;
+}
+
+/*
+ * XXX This won't work on /dev/apm !
+ * We should either use /dev/apm_ctl (and kill apmd(8))
+ * or talk to apmd (but its protocol is not publically available)...
+ */
+static pmWait
+bsdPMConfirmEventToOs(int fd, pmEvent event)
+{
+ switch (event) {
+ case XF86_APM_SYS_STANDBY:
+ case XF86_APM_USER_STANDBY:
+ if (ioctl( fd, APM_IOC_STANDBY, NULL ) == 0)
+ return PM_WAIT; /* should we stop the Xserver in standby, too? */
+ else
+ return PM_NONE;
+ case XF86_APM_SYS_SUSPEND:
+ case XF86_APM_CRITICAL_SUSPEND:
+ case XF86_APM_USER_SUSPEND:
+ if (ioctl( fd, APM_IOC_SUSPEND, NULL ) == 0)
+ return PM_WAIT;
+ else
+ return PM_NONE;
+ case XF86_APM_STANDBY_RESUME:
+ case XF86_APM_NORMAL_RESUME:
+ case XF86_APM_CRITICAL_RESUME:
+ case XF86_APM_STANDBY_FAILED:
+ case XF86_APM_SUSPEND_FAILED:
+ return PM_CONTINUE;
+ default:
+ return PM_NONE;
+ }
+}
+
+PMClose
+xf86OSPMOpen(void)
+{
+ int fd;
+
+ if (APMihPtr || !xf86Info.pmFlag) {
+ return NULL;
+ }
+
+ if ((fd = open(APM_DEVICE, O_RDWR)) == -1) {
+ return NULL;
+ }
+ xf86PMGetEventFromOs = bsdPMGetEventFromOS;
+ xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
+ APMihPtr = xf86AddInputHandler(fd, xf86HandlePMEvents, NULL);
+ return bsdCloseAPM;
+}
+
+static void
+bsdCloseAPM(void)
+{
+ int fd;
+
+ if (APMihPtr) {
+ fd = xf86RemoveInputHandler(APMihPtr);
+ close(fd);
+ APMihPtr = NULL;
+ }
+}
diff --git a/hw/xfree86/os-support/bsd/bsd_axp.c b/hw/xfree86/os-support/bsd/bsd_axp.c
new file mode 100644
index 000000000..c38ac073c
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_axp.c
@@ -0,0 +1,69 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_axp.c,v 1.2 2002/10/29 23:19:13 herrb Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Axp.h"
+#include <sys/param.h>
+#include "xf86_OSlib.h"
+#include <stdio.h>
+#include <sys/sysctl.h>
+
+axpDevice bsdGetAXP(void);
+
+/*
+ * BSD does a very nice job providing system information to
+ * user space programs. Unfortunately it doesn't provide all
+ * the information required. Therefore we just obtain the
+ * system type and look up the rest from a list we maintain
+ * ourselves.
+ */
+
+typedef struct {
+ char *name;
+ int type;
+} AXP;
+
+static AXP axpList[] = {
+ {"apecs",APECS},
+ {"pyxis",PYXIS},
+ {"cia",CIA},
+ {"irongate",IRONGATE},
+ {"lca",LCA},
+ {"t2",T2},
+ {"tsunami",TSUNAMI},
+ {NULL,NONE}
+};
+
+axpDevice
+bsdGetAXP(void)
+{
+ int i;
+ char sysname[64];
+ size_t len = sizeof(sysname);
+
+#ifdef __OpenBSD__
+ int mib[3];
+ int error;
+
+ mib[0] = CTL_MACHDEP;
+ mib[1] = CPU_CHIPSET;
+ mib[2] = CPU_CHIPSET_TYPE;
+
+ if ((error = sysctl(mib, 3, &sysname, &len, NULL, 0)) < 0)
+#else
+ if ((sysctlbyname("hw.chipset.type", &sysname, &len,
+ 0, 0)) < 0)
+#endif
+ FatalError("bsdGetAXP: can't find machine type\n");
+#ifdef DEBUG
+ xf86Msg(X_INFO,"AXP is a: %s\n",sysname);
+#endif
+ for (i=0;;i++) {
+ if (axpList[i].name == NULL)
+ return NONE;
+ if (!strcmp(sysname, axpList[i].name))
+ return axpList[i].type;
+ }
+}
diff --git a/hw/xfree86/os-support/bsd/bsd_ev56.c b/hw/xfree86/os-support/bsd/bsd_ev56.c
new file mode 100644
index 000000000..ec95306e8
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_ev56.c
@@ -0,0 +1,87 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_ev56.c,v 1.2 2001/02/27 23:05:00 alanh Exp $ */
+
+#include "X.h"
+#include "input.h"
+#include "scrnintstr.h"
+#include "compiler.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+int readDense8(pointer Base, register unsigned long Offset);
+int readDense16(pointer Base, register unsigned long Offset);
+int readDense32(pointer Base, register unsigned long Offset);
+void
+writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
+void
+writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
+void
+writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
+void
+writeDense8(int Value, pointer Base, register unsigned long Offset);
+void
+writeDense16(int Value, pointer Base, register unsigned long Offset);
+void
+writeDense32(int Value, pointer Base, register unsigned long Offset);
+
+int
+readDense8(pointer Base, register unsigned long Offset)
+{
+ mem_barrier();
+ return *(volatile CARD8*) ((unsigned long)Base+(Offset));
+}
+
+int
+readDense16(pointer Base, register unsigned long Offset)
+{
+ mem_barrier();
+ return *(volatile CARD16*) ((unsigned long)Base+(Offset));
+}
+
+int
+readDense32(pointer Base, register unsigned long Offset)
+{
+ mem_barrier();
+ return *(volatile CARD32*)((unsigned long)Base+(Offset));
+}
+
+void
+writeDenseNB8(int Value, pointer Base, register unsigned long Offset)
+{
+ *(volatile CARD8*)((unsigned long)Base+(Offset)) = Value;
+}
+
+void
+writeDenseNB16(int Value, pointer Base, register unsigned long Offset)
+{
+ *(volatile CARD16*)((unsigned long)Base + (Offset)) = Value;
+}
+
+void
+writeDenseNB32(int Value, pointer Base, register unsigned long Offset)
+{
+ *(volatile CARD32*)((unsigned long)Base+(Offset)) = Value;
+}
+
+void
+writeDense8(int Value, pointer Base, register unsigned long Offset)
+{
+ write_mem_barrier();
+ *(volatile CARD8 *)((unsigned long)Base+(Offset)) = Value;
+}
+
+void
+writeDense16(int Value, pointer Base, register unsigned long Offset)
+{
+ write_mem_barrier();
+ *(volatile CARD16 *)((unsigned long)Base+(Offset)) = Value;
+}
+
+void
+writeDense32(int Value, pointer Base, register unsigned long Offset)
+{
+ write_mem_barrier();
+ *(volatile CARD32 *)((unsigned long)Base+(Offset)) = Value;
+}
diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.c b/hw/xfree86/os-support/bsd/bsd_kbd.c
new file mode 100644
index 000000000..20d8b04d4
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_kbd.c
@@ -0,0 +1,536 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.5 2003/02/17 15:11:56 dawes Exp $ */
+
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ * Author: Ivan Pascal.
+ *
+ * Based on the code from bsd_io.c which is
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Dawes <dawes@xfree86.org>
+ */
+
+#define NEED_EVENTS
+#include "X.h"
+
+#include "compiler.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#include "xf86Xinput.h"
+#include "xf86OSKbd.h"
+#include "atKeynames.h"
+#include "bsd_kbd.h"
+
+extern Bool VTSwitchEnabled;
+#ifdef USE_VT_SYSREQ
+extern Bool VTSysreqToggle;
+#endif
+
+static KbdProtocolRec protocols[] = {
+ {"standard", PROT_STD },
+#ifdef WSCONS_SUPPORT
+ {"wskbd", PROT_WSCONS },
+#endif
+ { NULL, PROT_UNKNOWN }
+};
+
+typedef struct {
+ struct termio kbdtty;
+} BsdKbdPrivRec, *BsdKbdPrivPtr;
+
+static
+int KbdInit(InputInfoPtr pInfo, int what)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
+
+ if (pKbd->isConsole) {
+ switch (pKbd->consType) {
+#if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) || defined (WSCONS_SUPPORT)
+ case PCCONS:
+ case SYSCONS:
+ case PCVT:
+#if defined WSCONS_SUPPORT
+ case WSCONS:
+#endif
+ tcgetattr(pInfo->fd, &(priv->kbdtty));
+#endif
+ break;
+ }
+ }
+
+ return Success;
+}
+
+static void
+SetKbdLeds(InputInfoPtr pInfo, int leds)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ int real_leds = 0;
+
+ if (leds & XLED1) real_leds |= LED_CAP;
+ if (leds & XLED2) real_leds |= LED_NUM;
+ if (leds & XLED3) real_leds |= LED_SCR;
+ if (leds & XLED4) real_leds |= LED_SCR;
+
+ switch (pKbd->consType) {
+
+ case PCCONS:
+ break;
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ case SYSCONS:
+ case PCVT:
+ ioctl(pInfo->fd, KDSETLED, real_leds);
+ break;
+#endif
+#if defined(WSCONS_SUPPORT)
+ case WSCONS:
+ ioctl(pInfo->fd, WSKBDIO_SETLEDS, &real_leds);
+ break;
+#endif
+ }
+}
+
+static int
+GetKbdLeds(InputInfoPtr pInfo)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ int leds = 0, real_leds = 0;
+
+ switch (pKbd->consType) {
+ case PCCONS:
+ break;
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ case SYSCONS:
+ case PCVT:
+ ioctl(pInfo->fd, KDGETLED, &real_leds);
+ break;
+#endif
+#if defined(WSCONS_SUPPORT)
+ case WSCONS:
+ ioctl(pInfo->fd, WSKBDIO_GETLEDS, &real_leds);
+ break;
+#endif
+ }
+
+ if (real_leds & LED_CAP) leds |= XLED1;
+ if (real_leds & LED_NUM) leds |= XLED2;
+ if (real_leds & LED_SCR) leds |= XLED3;
+
+ return(leds);
+}
+
+static void
+SetKbdRepeat(InputInfoPtr pInfo, char rad)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ switch (pKbd->consType) {
+
+ case PCCONS:
+ break;
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ case SYSCONS:
+ case PCVT:
+ ioctl(pInfo->fd, KDSETRAD, rad);
+ break;
+#endif
+ }
+}
+
+static int
+KbdOn(InputInfoPtr pInfo, int what)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
+ struct termios nTty;
+#ifdef WSCONS_SUPPORT
+ int option;
+#endif
+
+ if (pKbd->isConsole) {
+ switch (pKbd->consType) {
+
+#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
+ case SYSCONS:
+ case PCCONS:
+ case PCVT:
+#ifdef WSCONS_SUPPORT
+ case WSCONS:
+#endif
+ nTty = priv->kbdtty;
+ nTty.c_iflag = IGNPAR | IGNBRK;
+ nTty.c_oflag = 0;
+ nTty.c_cflag = CREAD | CS8;
+ nTty.c_lflag = 0;
+ nTty.c_cc[VTIME] = 0;
+ nTty.c_cc[VMIN] = 1;
+ cfsetispeed(&nTty, 9600);
+ cfsetospeed(&nTty, 9600);
+ tcsetattr(pInfo->fd, TCSANOW, &nTty);
+ break;
+#endif
+ }
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) || defined (WSCONS_SUPPORT)
+ switch (pKbd->consType) {
+ case SYSCONS:
+ case PCVT:
+#ifdef K_CODE
+ if (pKbd->CustomKeycodes)
+ ioctl(pInfo->fd, KDSKBMODE, K_CODE);
+ else
+ ioctl(pInfo->fd, KDSKBMODE, K_RAW);
+#else
+ ioctl(pInfo->fd, KDSKBMODE, K_RAW);
+#endif
+ break;
+#endif
+#ifdef WSCONS_SUPPORT
+ case WSCONS:
+ option = WSKBD_RAW;
+ if (ioctl(pInfo->fd, WSKBDIO_SETMODE, &option) == -1) {
+ FatalError("can't switch keyboard to raw mode. "
+ "Enable support for it in the kernel\n"
+ "or use for example:\n\n"
+ "Option \"Protocol\" \"wskbd\"\n"
+ "Option \"Device\" \"/dev/wskbd0\"\n"
+ "\nin your XF86Config(5) file\n");
+ }
+ break;
+#endif
+ }
+ }
+ return Success;
+}
+
+static int
+KbdOff(InputInfoPtr pInfo, int what)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ BsdKbdPrivPtr priv = (BsdKbdPrivPtr) pKbd->private;
+#ifdef WSCONS_SUPPORT
+ int option;
+#endif
+
+ if (pKbd->isConsole) {
+ switch (pKbd->consType) {
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ case SYSCONS:
+ case PCVT:
+ ioctl(pInfo->fd, KDSKBMODE, K_XLATE);
+ /* FALL THROUGH */
+#endif
+#if defined(SYSCONS_SUPPORT) || defined(PCCONS_SUPPORT) || defined(PCVT_SUPPORT)
+ case PCCONS:
+ tcsetattr(pInfo->fd, TCSANOW, &(priv->kbdtty));
+ break;
+#endif
+#ifdef WSCONS_SUPPORT
+ case WSCONS:
+ option = WSKBD_TRANSLATED;
+ ioctl(xf86Info.consoleFd, WSKBDIO_SETMODE, &option);
+ tcsetattr(xf86Info.consoleFd, TCSANOW, &(priv->kbdtty));
+ break;
+#endif
+ }
+ }
+ return Success;
+}
+
+static void
+SoundBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+#ifdef WSCONS_SUPPORT
+ struct wskbd_bell_data wsb;
+#endif
+
+ if (loudness && pitch) {
+ switch (pKbd->consType) {
+#ifdef PCCONS_SUPPORT
+ case PCCONS:
+ { int data[2];
+ data[0] = pitch;
+ data[1] = (duration * loudness) / 50;
+ ioctl(pInfo->fd, CONSOLE_X_BELL, data);
+ break;
+ }
+#endif
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ case SYSCONS:
+ case PCVT:
+ ioctl(pInfo->fd, KDMKTONE,
+ ((1193190 / pitch) & 0xffff) |
+ (((unsigned long)duration*loudness/50)<<16));
+ break;
+#endif
+#if defined (WSCONS_SUPPORT)
+ case WSCONS:
+ wsb.which = WSKBD_BELL_DOALL;
+ wsb.pitch = pitch;
+ wsb.period = duration;
+ wsb.volume = loudness;
+ ioctl(pInfo->fd, WSKBDIO_COMPLEXBELL, &wsb);
+ break;
+#endif
+ }
+ }
+}
+
+#define ModifierSet(k) ((modifiers & (k)) == (k))
+
+static
+Bool SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+
+ if(!pKbd->vtSwitchSupported)
+ return FALSE;
+
+ if ((ModifierSet(ControlMask | AltMask)) ||
+ (ModifierSet(ControlMask | AltLangMask))) {
+ if (VTSwitchEnabled && !xf86Info.vtSysreq) {
+ switch (key) {
+ case KEY_F1:
+ case KEY_F2:
+ case KEY_F3:
+ case KEY_F4:
+ case KEY_F5:
+ case KEY_F6:
+ case KEY_F7:
+ case KEY_F8:
+ case KEY_F9:
+ case KEY_F10:
+ if (down) {
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
+ return TRUE;
+ }
+ case KEY_F11:
+ case KEY_F12:
+ if (down) {
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
+ return TRUE;
+ }
+ }
+ }
+ }
+#ifdef USE_VT_SYSREQ
+ if (VTSwitchEnabled && xf86Info.vtSysreq) {
+ switch (key) {
+ case KEY_F1:
+ case KEY_F2:
+ case KEY_F3:
+ case KEY_F4:
+ case KEY_F5:
+ case KEY_F6:
+ case KEY_F7:
+ case KEY_F8:
+ case KEY_F9:
+ case KEY_F10:
+ if (VTSysreqToggle && down) {
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
+ VTSysreqToggle = FALSE;
+ return TRUE;
+ }
+ break;
+ case KEY_F11:
+ case KEY_F12:
+ if (VTSysreqToggle && down) {
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
+ VTSysreqToggle = FALSE;
+ return TRUE;
+ }
+ break;
+ /* Ignore these keys -- ie don't let them cancel an alt-sysreq */
+ case KEY_Alt:
+ case KEY_AltLang:
+ break;
+ case KEY_SysReqest:
+ if ((ModifierSet(AltMask) || ModifierSet(AltLangMask)) && down)
+ VTSysreqToggle = TRUE;
+ break;
+ default:
+ /*
+ * We only land here when Alt-SysReq is followed by a
+ * non-switching key.
+ */
+ if (VTSysreqToggle)
+ VTSysreqToggle = FALSE;
+ }
+ }
+#endif /* USE_VT_SYSREQ */
+
+ return FALSE;
+}
+
+static void
+stdReadInput(InputInfoPtr pInfo)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ unsigned char rBuf[64];
+ int nBytes, i;
+ if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) {
+ for (i = 0; i < nBytes; i++)
+ pKbd->PostEvent(pInfo, rBuf[i] & 0x7f,
+ rBuf[i] & 0x80 ? FALSE : TRUE);
+ }
+}
+
+#ifdef WSCONS_SUPPORT
+static void
+WSReadInput(InputInfoPtr pInfo)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ struct wscons_event events[64];
+ int n, i;
+ if ((n = read( pInfo->fd, events, sizeof(events))) > 0) {
+ n /= sizeof(struct wscons_event);
+ for (i = 0; i < n; i++)
+ pKbd->PostEvent(pInfo, events[i].value,
+ events[i].type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
+ }
+}
+#endif
+
+#ifdef WSCONS_SUPPORT
+static void
+printWsType(char *type, char *devname)
+{
+ xf86Msg(X_PROBED, "%s: Keyboard type: %s\n", type, devname);
+}
+#endif
+
+static Bool
+OpenKeyboard(InputInfoPtr pInfo)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ int i;
+ KbdProtocolId prot = PROT_UNKNOWN;
+ char *s;
+
+ s = xf86SetStrOption(pInfo->options, "Protocol", NULL);
+ for (i = 0; protocols[i].name; i++) {
+ if (xf86NameCmp(s, protocols[i].name) == 0) {
+ prot = protocols[i].id;
+ break;
+ }
+ }
+
+ switch (prot) {
+ case PROT_STD:
+ pInfo->read_input = stdReadInput;
+ break;
+#ifdef WSCONS_SUPPORT
+ case PROT_WSCONS:
+ pInfo->read_input = WSReadInput;
+ break;
+#endif
+ default:
+ xf86Msg(X_ERROR,"\"%s\" is not a valid keyboard protocol name\n", s);
+ xfree(s);
+ return FALSE;
+ }
+ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, s);
+ xfree(s);
+
+ s = xf86SetStrOption(pInfo->options, "Device", NULL);
+ if (s == NULL) {
+ if (prot == PROT_WSCONS) {
+ xf86Msg(X_ERROR,"A \"device\" option is required with"
+ " the \"wskbd\" keyboard protocol\n");
+ return FALSE;
+ } else {
+ pInfo->fd = xf86Info.consoleFd;
+ pKbd->isConsole = TRUE;
+ pKbd->consType = xf86Info.consType;
+ }
+ } else {
+ pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
+ if (pInfo->fd == -1) {
+ xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
+ xfree(s);
+ return FALSE;
+ }
+ pKbd->isConsole = FALSE;
+ /* XXX What is consType here? */
+ pKbd->consType = SYSCONS;
+ xfree(s);
+ }
+
+#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
+ if (pKbd->isConsole &&
+ ((pKbd->consType == SYSCONS) || (pKbd->consType == PCVT)))
+ pKbd->vtSwitchSupported = TRUE;
+#endif
+
+#ifdef WSCONS_SUPPORT
+ if( prot == PROT_WSCONS) {
+ pKbd->consType = WSCONS;
+ /* Find out keyboard type */
+ if (ioctl(pInfo->fd, WSKBDIO_GTYPE, &(pKbd->wsKbdType)) == -1) {
+ xf86Msg(X_ERROR, "%s: cannot get keyboard type", pInfo->name);
+ close(pInfo->fd);
+ return FALSE;
+ }
+ switch (pKbd->wsKbdType) {
+ case WSKBD_TYPE_PC_XT:
+ printWsType("XT", pInfo->name);
+ break;
+ case WSKBD_TYPE_PC_AT:
+ printWsType("AT", pInfo->name);
+ break;
+ case WSKBD_TYPE_USB:
+ printWsType("USB", pInfo->name);
+ break;
+#ifdef WSKBD_TYPE_ADB
+ case WSKBD_TYPE_ADB:
+ printWsType("ADB", pInfo->name);
+ break;
+#endif
+#ifdef WSKBD_TYPE_SUN
+ case WSKBD_TYPE_SUN:
+ printWsType("Sun", pInfo->name);
+ break;
+#endif
+ default:
+ xf86Msg(X_ERROR, "%s: Unsupported wskbd type \"%d\"",
+ pKbd->wsKbdType, pInfo->name);
+ close(pInfo->fd);
+ return FALSE;
+ }
+ }
+#endif
+ return TRUE;
+}
+
+Bool
+xf86OSKbdPreInit(InputInfoPtr pInfo)
+{
+ KbdDevPtr pKbd = pInfo->private;
+
+ pKbd->KbdInit = KbdInit;
+ pKbd->KbdOn = KbdOn;
+ pKbd->KbdOff = KbdOff;
+ pKbd->Bell = SoundBell;
+ pKbd->SetLeds = SetKbdLeds;
+ pKbd->GetLeds = GetKbdLeds;
+ pKbd->SetKbdRepeat = SetKbdRepeat;
+ pKbd->KbdGetMapping = KbdGetMapping;
+ pKbd->SpecialKey = SpecialKey;
+
+ pKbd->RemapScanCode = NULL;
+ pKbd->GetSpecialKey = NULL;
+
+ pKbd->OpenKeyboard = OpenKeyboard;
+ pKbd->vtSwitchSupported = FALSE;
+ pKbd->CustomKeycodes = FALSE;
+
+ pKbd->private = xcalloc(sizeof(BsdKbdPrivRec), 1);
+ if (pKbd->private == NULL) {
+ xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n");
+ return FALSE;
+ }
+ return TRUE;
+}
+
diff --git a/hw/xfree86/os-support/bsd/bsd_kbd.h b/hw/xfree86/os-support/bsd/bsd_kbd.h
new file mode 100644
index 000000000..c042d88bf
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_kbd.h
@@ -0,0 +1,5 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.h,v 1.1 2002/10/11 01:40:34 dawes Exp $ */
+
+extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
+ CARD8 *pModMap);
+
diff --git a/hw/xfree86/os-support/bsd/bsd_kmod.c b/hw/xfree86/os-support/bsd/bsd_kmod.c
new file mode 100644
index 000000000..74345654b
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_kmod.c
@@ -0,0 +1,27 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kmod.c,v 3.2 2002/11/29 17:47:24 tsi Exp $ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/linker.h>
+
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+
+/*
+ * Load a FreeBSD kernel module.
+ * This is used by the DRI/DRM to load a DRM kernel module when
+ * the X server starts. It could be used for other purposes in the future.
+ * Input:
+ * modName - name of the kernel module (Ex: "tdfx")
+ * Return:
+ * 0 for failure, 1 for success
+ */
+int xf86LoadKernelModule(const char *modName)
+{
+ if (kldload(modName) != -1)
+ return 1;
+ else
+ return 0;
+}
diff --git a/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
new file mode 100644
index 000000000..53fe8c3be
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c
@@ -0,0 +1,199 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c,v 1.5 2002/07/30 23:24:32 herrb Exp $ */
+/*
+ * Copyright (C) 2001 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * from the XFree86 Project.
+ */
+/* $OpenBSD: bsd_kqueue_apm.c,v 1.5 2002/07/30 23:07:42 matthieu Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+#include "xf86_OSlib.h"
+
+#include <sys/event.h>
+#include <machine/apmvar.h>
+
+#define _PATH_APM_SOCKET "/var/run/apmdev"
+#define _PATH_APM_DEV "/dev/apm"
+#define _PATH_APM_CTLDEV "/dev/apmctl"
+
+static pointer APMihPtr = NULL;
+static int devFd = -1;
+static int ctlFd = -1;
+static void bsdCloseAPM(void);
+
+static struct {
+ u_int apmBsd;
+ pmEvent xf86;
+} bsdToXF86Array [] = {
+ { APM_STANDBY_REQ, XF86_APM_SYS_STANDBY },
+ { APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND },
+ { APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME },
+ { APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME },
+ { APM_BATTERY_LOW, XF86_APM_LOW_BATTERY },
+ { APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE },
+ { APM_UPDATE_TIME, XF86_APM_UPDATE_TIME },
+ { APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND },
+ { APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY },
+ { APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND },
+ { APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME },
+#ifdef APM_CAPABILITY_CHANGE
+ { APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED },
+#endif
+};
+
+#define numApmEvents (sizeof(bsdToXF86Array) / sizeof(bsdToXF86Array[0]))
+
+static pmEvent
+bsdToXF86(int type)
+{
+ int i;
+
+ for (i = 0; i < numApmEvents; i++) {
+ if (type == bsdToXF86Array[i].apmBsd) {
+ return bsdToXF86Array[i].xf86;
+ }
+ }
+ return XF86_APM_UNKNOWN;
+}
+
+/*
+ * APM events can be requested direclty from /dev/apm
+ */
+static int
+bsdPMGetEventFromOS(int kq, pmEvent *events, int num)
+{
+ struct kevent ev;
+ int i, result;
+ struct timespec ts = { 0, 0 };
+
+ for (i = 0; i < num; i++) {
+ result = kevent(kq, NULL, 0, &ev, 1, &ts);
+ if (result == 0 || APM_EVENT_TYPE(ev.data) == APM_NOEVENT) {
+ /* no event */
+ break;
+ } else if (result < 0) {
+ xf86Msg(X_WARNING, "bsdPMGetEventFromOS: kevent returns"
+ " errno = %d\n", errno);
+ break;
+ }
+ events[i] = bsdToXF86(APM_EVENT_TYPE(ev.data));
+ }
+ return i;
+}
+
+/*
+ * If apmd(8) is running, he will get the events and handle them,
+ * so, we've nothing to do here.
+ * Otherwise, opening /dev/apmctl will succeed and we have to send the
+ * confirmations to /dev/apmctl.
+ */
+static pmWait
+bsdPMConfirmEventToOs(int dummyfd, pmEvent event)
+{
+ if (ctlFd < 0) {
+ if ((ctlFd = open(_PATH_APM_CTLDEV, O_RDWR)) < 0) {
+ return PM_NONE;
+ }
+ }
+ /* apmctl open succeedeed */
+ switch (event) {
+ case XF86_APM_SYS_STANDBY:
+ case XF86_APM_USER_STANDBY:
+ if (ioctl( ctlFd, APM_IOC_STANDBY, NULL ) == 0)
+ return PM_WAIT; /* should we stop the Xserver in standby, too? */
+ else
+ return PM_NONE;
+
+ case XF86_APM_SYS_SUSPEND:
+ case XF86_APM_CRITICAL_SUSPEND:
+ case XF86_APM_USER_SUSPEND:
+ if (ioctl( ctlFd, APM_IOC_SUSPEND, NULL ) == 0)
+ return PM_WAIT;
+ else
+ return PM_NONE;
+ break;
+ case XF86_APM_STANDBY_RESUME:
+ case XF86_APM_NORMAL_RESUME:
+ case XF86_APM_CRITICAL_RESUME:
+ case XF86_APM_STANDBY_FAILED:
+ case XF86_APM_SUSPEND_FAILED:
+ return PM_CONTINUE;
+ break;
+ default:
+ return PM_NONE;
+ }
+}
+
+PMClose
+xf86OSPMOpen(void)
+{
+ int kq;
+ struct kevent ev;
+
+ if (APMihPtr || !xf86Info.pmFlag) {
+ return NULL;
+ }
+ if ((devFd = open(_PATH_APM_DEV, O_RDONLY)) == -1) {
+ return NULL;
+ }
+ if ((kq = kqueue()) <= 0) {
+ close(devFd);
+ return NULL;
+ }
+ EV_SET(&ev, devFd, EVFILT_READ, EV_ADD | EV_ENABLE | EV_CLEAR,
+ 0, 0, NULL);
+ if (kevent(kq, &ev, 1, NULL, 0, NULL) < 0) {
+ close(devFd);
+ return NULL;
+ }
+
+ xf86PMGetEventFromOs = bsdPMGetEventFromOS;
+ xf86PMConfirmEventToOs = bsdPMConfirmEventToOs;
+ APMihPtr = xf86AddInputHandler(kq, xf86HandlePMEvents, NULL);
+ return bsdCloseAPM;
+}
+
+static void
+bsdCloseAPM(void)
+{
+ int kq;
+
+ if (APMihPtr) {
+ kq = xf86RemoveInputHandler(APMihPtr);
+ close(devFd);
+ devFd = -1;
+ close(kq);
+ if (ctlFd >= 0) {
+ close(ctlFd);
+ ctlFd = -1;
+ }
+ APMihPtr = NULL;
+ }
+}
diff --git a/hw/xfree86/os-support/bsd/bsd_mouse.c b/hw/xfree86/os-support/bsd/bsd_mouse.c
new file mode 100644
index 000000000..f681d90d9
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/bsd_mouse.c
@@ -0,0 +1,594 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.24 2003/02/15 05:37:59 paulo Exp $ */
+
+/*
+ * Copyright 1999 by The XFree86 Project, Inc.
+ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86Xinput.h"
+#include "xf86OSmouse.h"
+#include "xisb.h"
+#include "mipointer.h"
+#ifdef WSCONS_SUPPORT
+#include <dev/wscons/wsconsio.h>
+#endif
+#ifdef USBMOUSE_SUPPORT
+#ifdef HAS_LIB_USB_HID
+#include <usbhid.h>
+#else
+#include "usb.h"
+#endif
+
+#include <dev/usb/usb.h>
+#ifdef USB_GET_REPORT_ID
+#define USB_NEW_HID
+#endif
+
+#define HUP_GENERIC_DESKTOP 0x0001
+#define HUP_BUTTON 0x0009
+
+#define HUG_X 0x0030
+#define HUG_Y 0x0031
+#define HUG_Z 0x0032
+#define HUG_WHEEL 0x0038
+
+#define HID_USAGE2(p,u) (((p) << 16) | u)
+
+/* The UMS mices have middle button as number 3 */
+#define UMS_BUT(i) ((i) == 0 ? 2 : (i) == 1 ? 0 : (i) == 2 ? 1 : (i))
+#endif /* USBMOUSE_SUPPORT */
+
+#ifdef USBMOUSE_SUPPORT
+static void usbSigioReadInput (int fd, void *closure);
+#endif
+
+static int
+SupportedInterfaces(void)
+{
+#if defined(__NetBSD__)
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
+#elif defined(__FreeBSD__)
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_MISC;
+#else
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
+#endif
+}
+
+/* Names of protocols that are handled internally here. */
+static const char *internalNames[] = {
+#if defined(WSCONS_SUPPORT)
+ "WSMouse",
+#endif
+#if defined(USBMOUSE_SUPPORT)
+ "usb",
+#endif
+ NULL
+};
+
+/*
+ * Names of MSC_MISC protocols that the OS supports. These are decoded by
+ * main "mouse" driver.
+ */
+static const char *miscNames[] = {
+#if defined(__FreeBSD__)
+ "SysMouse",
+#endif
+ NULL
+};
+
+static const char **
+BuiltinNames(void)
+{
+ return internalNames;
+}
+
+static Bool
+CheckProtocol(const char *protocol)
+{
+ int i;
+
+ for (i = 0; internalNames[i]; i++)
+ if (xf86NameCmp(protocol, internalNames[i]) == 0)
+ return TRUE;
+ for (i = 0; miscNames[i]; i++)
+ if (xf86NameCmp(protocol, miscNames[i]) == 0)
+ return TRUE;
+ return FALSE;
+}
+
+static const char *
+DefaultProtocol(void)
+{
+#if defined(__FreeBSD__)
+ return "Auto";
+#else
+ return NULL;
+#endif
+}
+
+#if defined(__FreeBSD__) && defined(MOUSE_PROTO_SYSMOUSE)
+static struct {
+ int dproto;
+ const char *name;
+} devproto[] = {
+ { MOUSE_PROTO_MS, "Microsoft" },
+ { MOUSE_PROTO_MSC, "MouseSystems" },
+ { MOUSE_PROTO_LOGI, "Logitech" },
+ { MOUSE_PROTO_MM, "MMSeries" },
+ { MOUSE_PROTO_LOGIMOUSEMAN, "MouseMan" },
+ { MOUSE_PROTO_BUS, "BusMouse" },
+ { MOUSE_PROTO_INPORT, "BusMouse" },
+ { MOUSE_PROTO_PS2, "PS/2" },
+ { MOUSE_PROTO_HITTAB, "MMHitTab" },
+ { MOUSE_PROTO_GLIDEPOINT, "GlidePoint" },
+ { MOUSE_PROTO_INTELLI, "Intellimouse" },
+ { MOUSE_PROTO_THINK, "ThinkingMouse" },
+ { MOUSE_PROTO_SYSMOUSE, "SysMouse" }
+};
+
+static const char *
+SetupAuto(InputInfoPtr pInfo, int *protoPara)
+{
+ int i;
+ mousehw_t hw;
+ mousemode_t mode;
+
+ if (pInfo->fd == -1)
+ return NULL;
+
+ /* set the driver operation level, if applicable */
+ i = 1;
+ ioctl(pInfo->fd, MOUSE_SETLEVEL, &i);
+
+ /* interrogate the driver and get some intelligence on the device. */
+ hw.iftype = MOUSE_IF_UNKNOWN;
+ hw.model = MOUSE_MODEL_GENERIC;
+ ioctl(pInfo->fd, MOUSE_GETHWINFO, &hw);
+ xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: hw.iftype is %d, hw.model is %d\n",
+ pInfo->name, hw.iftype, hw.model);
+ if (ioctl(pInfo->fd, MOUSE_GETMODE, &mode) == 0) {
+ for (i = 0; i < sizeof(devproto)/sizeof(devproto[0]); ++i) {
+ if (mode.protocol == devproto[i].dproto) {
+ /* override some parameters */
+ if (protoPara) {
+ protoPara[4] = mode.packetsize;
+ protoPara[0] = mode.syncmask[0];
+ protoPara[1] = mode.syncmask[1];
+ }
+ xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
+ pInfo->name, devproto[i].name);
+ return devproto[i].name;
+ }
+ }
+ }
+ return NULL;
+}
+
+static void
+SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res)
+{
+ mousemode_t mode;
+ MouseDevPtr pMse;
+
+ pMse = pInfo->private;
+
+ mode.rate = rate > 0 ? rate : -1;
+ mode.resolution = res > 0 ? res : -1;
+ mode.accelfactor = -1;
+#if defined(__FreeBSD__)
+ if (pMse->autoProbe ||
+ (protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
+ /*
+ * As the FreeBSD sysmouse driver defaults to protocol level 0
+ * everytime it is opened we enforce protocol level 1 again at
+ * this point.
+ */
+ mode.level = 1;
+ } else
+ mode.level = -1;
+#else
+ mode.level = -1;
+#endif
+ ioctl(pInfo->fd, MOUSE_SETMODE, &mode);
+}
+#endif
+
+#if defined(WSCONS_SUPPORT)
+#define NUMEVENTS 64
+
+static void
+wsconsReadInput(InputInfoPtr pInfo)
+{
+ MouseDevPtr pMse;
+ static struct wscons_event eventList[NUMEVENTS];
+ int n, c;
+ struct wscons_event *event = eventList;
+ unsigned char *pBuf;
+
+ pMse = pInfo->private;
+
+ XisbBlockDuration(pMse->buffer, -1);
+ pBuf = (unsigned char *)eventList;
+ n = 0;
+ while ((c = XisbRead(pMse->buffer)) >= 0 && n < sizeof(eventList)) {
+ pBuf[n++] = (unsigned char)c;
+ }
+
+ if (n == 0)
+ return;
+
+ n /= sizeof(struct wscons_event);
+ while( n-- ) {
+ int buttons = pMse->lastButtons;
+ int dx = 0, dy = 0, dz = 0, dw = 0;
+ switch (event->type) {
+ case WSCONS_EVENT_MOUSE_UP:
+#define BUTBIT (1 << (event->value <= 2 ? 2 - event->value : event->value))
+ buttons &= ~BUTBIT;
+ break;
+ case WSCONS_EVENT_MOUSE_DOWN:
+ buttons |= BUTBIT;
+ break;
+ case WSCONS_EVENT_MOUSE_DELTA_X:
+ dx = event->value;
+ break;
+ case WSCONS_EVENT_MOUSE_DELTA_Y:
+ dy = -event->value;
+ break;
+#ifdef WSCONS_EVENT_MOUSE_DELTA_Z
+ case WSCONS_EVENT_MOUSE_DELTA_Z:
+ dz = event->value;
+ break;
+#endif
+ default:
+ xf86Msg(X_WARNING, "%s: bad wsmouse event type=%d\n", pInfo->name,
+ event->type);
+ continue;
+ }
+
+ pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
+ ++event;
+ }
+ return;
+}
+
+
+/* This function is called when the protocol is "wsmouse". */
+static Bool
+wsconsPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ MouseDevPtr pMse = pInfo->private;
+
+ pMse->protocol = protocol;
+ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
+
+ /* Collect the options, and process the common options. */
+ xf86CollectInputOptions(pInfo, NULL, NULL);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ /* Check if the device can be opened. */
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1) {
+ if (xf86GetAllowMouseOpenFail())
+ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+ else {
+ xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
+ xfree(pMse);
+ return FALSE;
+ }
+ }
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+
+ /* Process common mouse options (like Emulate3Buttons, etc). */
+ pMse->CommonOptions(pInfo);
+
+ /* Setup the local input proc. */
+ pInfo->read_input = wsconsReadInput;
+
+ pInfo->flags |= XI86_CONFIGURED;
+ return TRUE;
+}
+#endif
+
+#if defined(USBMOUSE_SUPPORT)
+
+typedef struct _UsbMseRec {
+ int packetSize;
+ int iid;
+ hid_item_t loc_x; /* x locator item */
+ hid_item_t loc_y; /* y locator item */
+ hid_item_t loc_z; /* z (wheel) locator item */
+ hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
+ unsigned char *buffer;
+} UsbMseRec, *UsbMsePtr;
+
+static int
+usbMouseProc(DeviceIntPtr pPointer, int what)
+{
+ InputInfoPtr pInfo;
+ MouseDevPtr pMse;
+ UsbMsePtr pUsbMse;
+ unsigned char map[MSE_MAXBUTTONS + 1];
+ int nbuttons;
+
+ pInfo = pPointer->public.devicePrivate;
+ pMse = pInfo->private;
+ pMse->device = pPointer;
+ pUsbMse = pMse->mousePriv;
+
+ switch (what) {
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
+ map[nbuttons + 1] = nbuttons + 1;
+
+ InitPointerDeviceStruct((DevicePtr)pPointer,
+ map,
+ min(pMse->buttons, MSE_MAXBUTTONS),
+ miPointerGetMotionEvents,
+ pMse->Ctrl,
+ miPointerGetMotionBufferSize());
+
+ /* X valuator */
+ xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
+ xf86InitValuatorDefaults(pPointer, 0);
+ /* Y valuator */
+ xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
+ xf86InitValuatorDefaults(pPointer, 1);
+ xf86MotionHistoryAllocate(pInfo);
+ break;
+
+ case DEVICE_ON:
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1)
+ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+ else {
+ pMse->buffer = XisbNew(pInfo->fd, pUsbMse->packetSize);
+ if (!pMse->buffer) {
+ xfree(pMse);
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ } else {
+ xf86FlushInput(pInfo->fd);
+ if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput,
+ pInfo))
+ AddEnabledDevice(pInfo->fd);
+ }
+ }
+ pMse->lastButtons = 0;
+ pMse->emulateState = 0;
+ pPointer->public.on = TRUE;
+ break;
+
+ case DEVICE_OFF:
+ case DEVICE_CLOSE:
+ if (pInfo->fd != -1) {
+ RemoveEnabledDevice(pInfo->fd);
+ if (pUsbMse->packetSize > 8 && pUsbMse->buffer) {
+ xfree(pUsbMse->buffer);
+ }
+ if (pMse->buffer) {
+ XisbFree(pMse->buffer);
+ pMse->buffer = NULL;
+ }
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ }
+ pPointer->public.on = FALSE;
+ usleep(300000);
+ break;
+ }
+ return Success;
+}
+
+static void
+usbReadInput(InputInfoPtr pInfo)
+{
+ MouseDevPtr pMse;
+ UsbMsePtr pUsbMse;
+ int buttons = pMse->lastButtons;
+ int dx = 0, dy = 0, dz = 0, dw = 0;
+ int n, c;
+ unsigned char *pBuf;
+
+ pMse = pInfo->private;
+ pUsbMse = pMse->mousePriv;
+
+ XisbBlockDuration(pMse->buffer, -1);
+ pBuf = pUsbMse->buffer;
+ n = 0;
+ while ((c = XisbRead(pMse->buffer)) >= 0 && n < pUsbMse->packetSize) {
+ pBuf[n++] = (unsigned char)c;
+ }
+ if (n == 0)
+ return;
+ if (n != pUsbMse->packetSize) {
+ xf86Msg(X_WARNING, "%s: incomplete packet, size %d\n", pInfo->name,
+ n);
+ }
+ /* discard packets with an id that don't match the mouse */
+ /* XXX this is probably not the right thing */
+ if (pUsbMse->iid != 0) {
+ if (*pBuf++ != pUsbMse->iid)
+ return;
+ }
+ dx = hid_get_data(pBuf, &pUsbMse->loc_x);
+ dy = hid_get_data(pBuf, &pUsbMse->loc_y);
+ dz = hid_get_data(pBuf, &pUsbMse->loc_z);
+
+ buttons = 0;
+ for (n = 0; n < pMse->buttons; n++) {
+ if (hid_get_data(pBuf, &pUsbMse->loc_btn[n]))
+ buttons |= (1 << UMS_BUT(n));
+ }
+ pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
+ return;
+}
+
+static void
+usbSigioReadInput (int fd, void *closure)
+{
+ usbReadInput ((InputInfoPtr) closure);
+}
+
+/* This function is called when the protocol is "usb". */
+static Bool
+usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ MouseDevPtr pMse = pInfo->private;
+ UsbMsePtr pUsbMse;
+ report_desc_t reportDesc;
+ int i;
+
+ pUsbMse = xalloc(sizeof(UsbMseRec));
+ if (pUsbMse == NULL) {
+ xf86Msg(X_ERROR, "%s: cannot allocate UsbMouseRec\n", pInfo->name);
+ xfree(pMse);
+ return FALSE;
+ }
+
+ pMse->protocol = protocol;
+ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
+
+ /* Collect the options, and process the common options. */
+ xf86CollectInputOptions(pInfo, NULL, NULL);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ /* Check if the device can be opened. */
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1) {
+ if (xf86GetAllowMouseOpenFail())
+ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+ else {
+ xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
+ xfree(pUsbMse);
+ xfree(pMse);
+ return FALSE;
+ }
+ }
+ /* Get USB informations */
+ reportDesc = hid_get_report_desc(pInfo->fd);
+ /* Get packet size & iid */
+#ifdef USB_NEW_HID
+ if (ioctl(pInfo->fd, USB_GET_REPORT_ID, &pUsbMse->iid) == -1) {
+ xf86Msg(X_ERROR, "Error ioctl USB_GET_REPORT_ID on %s : %s\n",
+ pInfo->name, strerror(errno));
+ return FALSE;
+ }
+ pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
+ pUsbMse->iid);
+#else
+ pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
+ &pUsbMse->iid);
+#endif
+ /* Allocate buffer */
+ if (pUsbMse->packetSize <= 8) {
+ pUsbMse->buffer = pMse->protoBuf;
+ } else {
+ pUsbMse->buffer = xalloc(pUsbMse->packetSize);
+ }
+ if (pUsbMse->buffer == NULL) {
+ xf86Msg(X_ERROR, "%s: cannot allocate buffer\n", pInfo->name);
+ xfree(pUsbMse);
+ xfree(pMse);
+ xf86CloseSerial(pInfo->fd);
+ return FALSE;
+ }
+#ifdef USB_NEW_HID
+ if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
+ hid_input, &pUsbMse->loc_x, pUsbMse->iid) < 0) {
+ xf86Msg(X_WARNING, "%s: no x locator\n");
+ }
+ if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
+ hid_input, &pUsbMse->loc_y, pUsbMse->iid) < 0) {
+ xf86Msg(X_WARNING, "%s: no y locator\n");
+ }
+ if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
+ hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) {
+ }
+#else
+ if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
+ hid_input, &pUsbMse->loc_x) < 0) {
+ xf86Msg(X_WARNING, "%s: no x locator\n");
+ }
+ if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
+ hid_input, &pUsbMse->loc_y) < 0) {
+ xf86Msg(X_WARNING, "%s: no y locator\n");
+ }
+ if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
+ hid_input, &pUsbMse->loc_z) < 0) {
+ }
+#endif
+ /* Probe for number of buttons */
+ for (i = 1; i <= MSE_MAXBUTTONS; i++) {
+ if (!hid_locate(reportDesc, HID_USAGE2(HUP_BUTTON, i),
+ hid_input, &pUsbMse->loc_btn[i-1]
+#ifdef USB_NEW_HID
+ , pUsbMse->iid
+#endif
+ ))
+ break;
+ }
+ pMse->buttons = i-1;
+
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+
+ /* Private structure */
+ pMse->mousePriv = pUsbMse;
+
+ /* Process common mouse options (like Emulate3Buttons, etc). */
+ pMse->CommonOptions(pInfo);
+
+ /* Setup the local procs. */
+ pInfo->device_control = usbMouseProc;
+ pInfo->read_input = usbReadInput;
+
+ pInfo->flags |= XI86_CONFIGURED;
+ return TRUE;
+}
+#endif /* USBMOUSE */
+
+static Bool
+bsdMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ /* The protocol is guaranteed to be one of the internalNames[] */
+#ifdef WSCONS_SUPPORT
+ if (xf86NameCmp(protocol, "WSMouse") == 0) {
+ return wsconsPreInit(pInfo, protocol, flags);
+ }
+#endif
+#ifdef USBMOUSE_SUPPORT
+ if (xf86NameCmp(protocol, "usb") == 0) {
+ return usbPreInit(pInfo, protocol, flags);
+ }
+#endif
+ return TRUE;
+}
+
+OSMouseInfoPtr
+xf86OSMouseInit(int flags)
+{
+ OSMouseInfoPtr p;
+
+ p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ if (!p)
+ return NULL;
+ p->SupportedInterfaces = SupportedInterfaces;
+ p->BuiltinNames = BuiltinNames;
+ p->DefaultProtocol = DefaultProtocol;
+ p->CheckProtocol = CheckProtocol;
+#if defined(__FreeBSD__) && defined(MOUSE_PROTO_SYSMOUSE)
+ p->SetupAuto = SetupAuto;
+ p->SetPS2Res = SetSysMouseRes;
+ p->SetBMRes = SetSysMouseRes;
+ p->SetMiscRes = SetSysMouseRes;
+#endif
+ p->PreInit = bsdMousePreInit;
+ return p;
+}
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
new file mode 100644
index 000000000..3c056ce55
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -0,0 +1,877 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c,v 1.2 2002/09/10 15:53:31 dawes Exp $ */
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * 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 names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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.
+ *
+ */
+
+/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#ifdef HAS_MTRR_SUPPORT
+#ifndef __NetBSD__
+#include <sys/types.h>
+#include <sys/memrange.h>
+#else
+#include "memrange.h"
+#endif
+#define X_MTRR_ID "XFree86"
+#endif
+
+#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
+#include <machine/mtrr.h>
+#include <machine/sysarch.h>
+#include <sys/queue.h>
+#endif
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#if defined(__NetBSD__) && !defined(MAP_FILE)
+#define MAP_FLAGS MAP_SHARED
+#else
+#define MAP_FLAGS (MAP_FILE | MAP_SHARED)
+#endif
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+#ifdef __OpenBSD__
+#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\
+ "\tin /etc/sysctl.conf and reboot your machine\n" \
+ "\trefer to xf86(4) for details\n"
+#define SYSCTL_MSG2 \
+ "Check that you have set 'machdep.allowaperture=2'\n" \
+ "\tin /etc/sysctl.conf and reboot your machine\n" \
+ "\trefer to xf86(4) for details\n"
+#endif
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+static Bool useDevMem = FALSE;
+static int devMemFd = -1;
+
+#ifdef HAS_APERTURE_DRV
+#define DEV_APERTURE "/dev/xf86"
+#endif
+#define DEV_MEM "/dev/mem"
+
+static pointer mapVidMem(int, unsigned long, unsigned long, int);
+static void unmapVidMem(int, pointer, unsigned long);
+
+#ifdef HAS_MTRR_SUPPORT
+static pointer setWC(int, unsigned long, unsigned long, Bool, MessageType);
+static void undoWC(int, pointer);
+static Bool cleanMTRR(void);
+#endif
+#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
+static pointer NetBSDsetWC(int, unsigned long, unsigned long, Bool,
+ MessageType);
+static void NetBSDundoWC(int, pointer);
+#endif
+
+
+/*
+ * Check if /dev/mem can be mmap'd. If it can't print a warning when
+ * "warn" is TRUE.
+ */
+static void
+checkDevMem(Bool warn)
+{
+ static Bool devMemChecked = FALSE;
+ int fd;
+ pointer base;
+
+ if (devMemChecked)
+ return;
+ devMemChecked = TRUE;
+
+ if ((fd = open(DEV_MEM, O_RDWR)) >= 0)
+ {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000);
+
+ if (base != MAP_FAILED)
+ {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ return;
+ } else {
+ /* This should not happen */
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ useDevMem = FALSE;
+ return;
+ }
+ }
+#ifndef HAS_APERTURE_DRV
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ useDevMem = FALSE;
+ return;
+#else
+ /* Failed to open /dev/mem, try the aperture driver */
+ if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0)
+ {
+ /* Try to map a page at the VGA address */
+ base = mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, fd, (off_t)0xA0000);
+
+ if (base != MAP_FAILED)
+ {
+ munmap((caddr_t)base, 4096);
+ devMemFd = fd;
+ useDevMem = TRUE;
+ xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n",
+ DEV_APERTURE);
+ return;
+ } else {
+
+ if (warn)
+ {
+ xf86Msg(X_WARNING, "checkDevMem: failed to mmap %s (%s)\n",
+ DEV_APERTURE, strerror(errno));
+ }
+ }
+ } else {
+ if (warn)
+ {
+#ifndef __OpenBSD__
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
+ "\t(%s)\n", DEV_MEM, DEV_APERTURE, strerror(errno));
+#else /* __OpenBSD__ */
+ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n"
+ "\t(%s)\n%s", DEV_MEM, DEV_APERTURE, strerror(errno),
+ SYSCTL_MSG);
+#endif /* __OpenBSD__ */
+ }
+ }
+
+ useDevMem = FALSE;
+ return;
+
+#endif
+}
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+ checkDevMem(TRUE);
+ pVidMem->linearSupported = useDevMem;
+ pVidMem->mapMem = mapVidMem;
+ pVidMem->unmapMem = unmapVidMem;
+
+#ifdef HAS_MTRR_SUPPORT
+ if (useDevMem) {
+ if (cleanMTRR()) {
+ pVidMem->setWC = setWC;
+ pVidMem->undoWC = undoWC;
+ }
+ }
+#endif
+#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
+ pVidMem->setWC = NetBSDsetWC;
+ pVidMem->undoWC = NetBSDundoWC;
+#endif
+ pVidMem->initialised = TRUE;
+}
+
+static pointer
+mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ pointer base;
+
+ checkDevMem(FALSE);
+
+ if (useDevMem)
+ {
+ if (devMemFd < 0)
+ {
+ FatalError("xf86MapVidMem: failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ }
+ base = mmap((caddr_t)0, Size, PROT_READ|PROT_WRITE,
+ MAP_FLAGS, devMemFd, (off_t)Base);
+ if (base == MAP_FAILED)
+ {
+ FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
+ "xf86MapVidMem", DEV_MEM, Size, Base,
+ strerror(errno));
+ }
+ return(base);
+ }
+
+ /* else, mmap /dev/vga */
+ if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
+ {
+ FatalError("%s: Address 0x%x outside allowable range\n",
+ "xf86MapVidMem", Base);
+ }
+ base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_FLAGS,
+ xf86Info.screenFd,
+ (unsigned long)Base - 0xA0000
+ );
+ if (base == MAP_FAILED)
+ {
+ FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n",
+ strerror(errno));
+ }
+ return(base);
+}
+
+static void
+unmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap((caddr_t)Base, Size);
+}
+
+/*
+ * Read BIOS via mmap()ing DEV_MEM
+ */
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ unsigned char *ptr;
+ int psize;
+ int mlen;
+
+ checkDevMem(TRUE);
+ if (devMemFd == -1) {
+ return(-1);
+ }
+
+ psize = xf86getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, devMemFd, (off_t)Base);
+ if ((long)ptr == -1)
+ {
+ xf86Msg(X_WARNING,
+ "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
+ DEV_MEM, Len, Base, Offset, strerror(errno));
+#ifdef __OpenBSD__
+ if (Base < 0xa0000) {
+ xf86Msg(X_WARNING, SYSCTL_MSG2);
+ }
+#endif
+ return(-1);
+ }
+#ifdef DEBUG
+ ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ Base, ptr[0] | (ptr[1] << 8));
+#endif
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)"
+ "-> %02x %02x %02x %02x...\n",
+ Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]);
+#endif
+ return(Len);
+}
+
+
+#ifdef USE_I386_IOPL
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+
+static Bool ExtendedEnabled = FALSE;
+
+void
+xf86EnableIO()
+{
+ if (ExtendedEnabled)
+ return;
+
+ if (i386_iopl(TRUE) < 0)
+ {
+#ifndef __OpenBSD__
+ FatalError("%s: Failed to set IOPL for extended I/O\n",
+ "xf86EnableIO");
+#else
+ FatalError("%s: Failed to set IOPL for extended I/O\n%s",
+ "xf86EnableIO", SYSCTL_MSG);
+#endif
+ }
+ ExtendedEnabled = TRUE;
+
+ return;
+}
+
+void
+xf86DisableIO()
+{
+ if (!ExtendedEnabled)
+ return;
+
+ i386_iopl(FALSE);
+ ExtendedEnabled = FALSE;
+
+ return;
+}
+
+#endif /* USE_I386_IOPL */
+
+#ifdef USE_DEV_IO
+static int IoFd = -1;
+
+void
+xf86EnableIO()
+{
+ if (IoFd >= 0)
+ return;
+
+ if ((IoFd = open("/dev/io", O_RDWR)) == -1)
+ {
+ FatalError("xf86EnableIO: "
+ "Failed to open /dev/io for extended I/O\n");
+ }
+ return;
+}
+
+void
+xf86DisableIO()
+{
+ if (IoFd < 0)
+ return;
+
+ close(IoFd);
+ IoFd = -1;
+ return;
+}
+
+#endif
+
+
+/***************************************************************************/
+/* Interrupt Handling section */
+/***************************************************************************/
+
+Bool
+xf86DisableInterrupts()
+{
+
+#ifdef __GNUC__
+ __asm__ __volatile__("cli");
+#else
+ asm("cli");
+#endif /* __GNUC__ */
+
+ return(TRUE);
+}
+
+void
+xf86EnableInterrupts()
+{
+
+#ifdef __GNUC__
+ __asm__ __volatile__("sti");
+#else
+ asm("sti");
+#endif /* __GNUC__ */
+
+ return;
+}
+
+
+#ifdef __NetBSD__
+/***************************************************************************/
+/* Set TV output mode */
+/***************************************************************************/
+void
+xf86SetTVOut(int mode)
+{
+ switch (xf86Info.consType)
+ {
+#ifdef PCCONS_SUPPORT
+ case PCCONS:{
+
+ if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0)
+ {
+ xf86Msg(X_WARNING,
+ "xf86SetTVOut: Could not set console to TV output, %s\n",
+ strerror(errno));
+ }
+ }
+ break;
+#endif /* PCCONS_SUPPORT */
+
+ default:
+ FatalError("Xf86SetTVOut: Unsupported console\n");
+ break;
+ }
+ return;
+}
+
+void
+xf86SetRGBOut()
+{
+ switch (xf86Info.consType)
+ {
+#ifdef PCCONS_SUPPORT
+ case PCCONS:{
+
+ if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0)
+ {
+ xf86Msg(X_WARNING,
+ "xf86SetTVOut: Could not set console to RGB output, %s\n",
+ strerror(errno));
+ }
+ }
+ break;
+#endif /* PCCONS_SUPPORT */
+
+ default:
+ FatalError("Xf86SetTVOut: Unsupported console\n");
+ break;
+ }
+ return;
+}
+#endif
+
+
+#ifdef HAS_MTRR_SUPPORT
+/* memory range (MTRR) support for FreeBSD */
+
+/*
+ * This code is experimental. Some parts may be overkill, and other parts
+ * may be incomplete.
+ */
+
+/*
+ * getAllRanges returns the full list of memory ranges with attributes set.
+ */
+
+static struct mem_range_desc *
+getAllRanges(int *nmr)
+{
+ struct mem_range_desc *mrd;
+ struct mem_range_op mro;
+
+ /*
+ * Find how many ranges there are. If this fails, then the kernel
+ * probably doesn't have MTRR support.
+ */
+ mro.mo_arg[0] = 0;
+ if (ioctl(devMemFd, MEMRANGE_GET, &mro))
+ return NULL;
+ *nmr = mro.mo_arg[0];
+ mrd = xnfalloc(*nmr * sizeof(struct mem_range_desc));
+ mro.mo_arg[0] = *nmr;
+ mro.mo_desc = mrd;
+ if (ioctl(devMemFd, MEMRANGE_GET, &mro)) {
+ xfree(mrd);
+ return NULL;
+ }
+ return mrd;
+}
+
+/*
+ * cleanMTRR removes any memory attribute that may be left by a previous
+ * X server. Normally there won't be any, but this takes care of the
+ * case where a server crashed without being able finish cleaning up.
+ */
+
+static Bool
+cleanMTRR()
+{
+ struct mem_range_desc *mrd;
+ struct mem_range_op mro;
+ int nmr, i;
+
+ /* This shouldn't happen */
+ if (devMemFd < 0)
+ return FALSE;
+
+ if (!(mrd = getAllRanges(&nmr)))
+ return FALSE;
+
+ for (i = 0; i < nmr; i++) {
+ if (strcmp(mrd[i].mr_owner, X_MTRR_ID) == 0 &&
+ (mrd[i].mr_flags & MDF_ACTIVE)) {
+#ifdef DEBUG
+ ErrorF("Clean for (0x%lx,0x%lx)\n",
+ (unsigned long)mrd[i].mr_base,
+ (unsigned long)rd[i].mr_len);
+#endif
+ if (mrd[i].mr_flags & MDF_FIXACTIVE) {
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ mrd[i].mr_flags = MDF_UNCACHEABLE;
+ } else {
+ mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
+ }
+ mro.mo_desc = mrd + i;
+ ioctl(devMemFd, MEMRANGE_SET, &mro);
+ }
+ }
+#ifdef DEBUG
+ sleep(10);
+#endif
+ xfree(mrd);
+ return TRUE;
+}
+
+typedef struct x_RangeRec {
+ struct mem_range_desc mrd;
+ Bool wasWC;
+ struct x_RangeRec * next;
+} RangeRec, *RangePtr;
+
+static void
+freeRangeList(RangePtr range)
+{
+ RangePtr rp;
+
+ while (range) {
+ rp = range;
+ range = rp->next;
+ xfree(rp);
+ }
+}
+
+static RangePtr
+dupRangeList(RangePtr list)
+{
+ RangePtr new = NULL, rp, p;
+
+ rp = list;
+ while (rp) {
+ p = xnfalloc(sizeof(RangeRec));
+ *p = *rp;
+ p->next = new;
+ new = p;
+ rp = rp->next;
+ }
+ return new;
+}
+
+static RangePtr
+sortRangeList(RangePtr list)
+{
+ RangePtr rp1, rp2, copy, sorted = NULL, minp, prev, minprev;
+ unsigned long minBase;
+
+ /* Sort by base address */
+ rp1 = copy = dupRangeList(list);
+ while (rp1) {
+ minBase = rp1->mrd.mr_base;
+ minp = rp1;
+ minprev = NULL;
+ prev = rp1;
+ rp2 = rp1->next;
+ while (rp2) {
+ if (rp2->mrd.mr_base < minBase) {
+ minBase = rp2->mrd.mr_base;
+ minp = rp2;
+ minprev = prev;
+ }
+ prev = rp2;
+ rp2 = rp2->next;
+ }
+ if (minprev) {
+ minprev->next = minp->next;
+ rp1 = copy;
+ } else {
+ rp1 = minp->next;
+ }
+ minp->next = sorted;
+ sorted = minp;
+ }
+ return sorted;
+}
+
+/*
+ * findRanges returns a list of ranges that overlap the specified range.
+ */
+
+static void
+findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp)
+{
+ struct mem_range_desc *mrd;
+ int nmr, i;
+ RangePtr rp, *p;
+
+ if (!(mrd = getAllRanges(&nmr)))
+ return;
+
+ for (i = 0; i < nmr; i++) {
+ if ((mrd[i].mr_flags & MDF_ACTIVE) &&
+ mrd[i].mr_base < base + size &&
+ mrd[i].mr_base + mrd[i].mr_len > base) {
+ if (mrd[i].mr_flags & MDF_WRITECOMBINE)
+ p = wcp;
+ else if (mrd[i].mr_flags & MDF_UNCACHEABLE)
+ p = ucp;
+ else
+ continue;
+ rp = xnfalloc(sizeof(RangeRec));
+ rp->mrd = mrd[i];
+ rp->next = *p;
+ *p = rp;
+ }
+ }
+ xfree(mrd);
+}
+
+/*
+ * This checks if the existing overlapping ranges fully cover the requested
+ * range. Is this overkill?
+ */
+
+static Bool
+fullCoverage(unsigned long base, unsigned long size, RangePtr overlap)
+{
+ RangePtr rp1, sorted = NULL;
+ unsigned long end;
+
+ sorted = sortRangeList(overlap);
+ /* Look for gaps */
+ rp1 = sorted;
+ end = base + size;
+ while (rp1) {
+ if (rp1->mrd.mr_base > base) {
+ freeRangeList(sorted);
+ return FALSE;
+ } else {
+ base = rp1->mrd.mr_base + rp1->mrd.mr_len;
+ }
+ if (base >= end) {
+ freeRangeList(sorted);
+ return TRUE;
+ }
+ rp1 = rp1->next;
+ }
+ freeRangeList(sorted);
+ return FALSE;
+}
+
+static pointer
+addWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
+{
+ RangePtr uc = NULL, wc = NULL, retlist = NULL;
+ struct mem_range_desc mrd;
+ struct mem_range_op mro;
+
+ findRanges(base, size, &uc, &wc);
+
+ /* See of the full range is already WC */
+ if (!uc && fullCoverage(base, size, wc)) {
+ xf86DrvMsg(screenNum, from,
+ "Write-combining range (0x%lx,0x%lx) was already set\n",
+ base, size);
+ return NULL;
+ }
+
+ /* Otherwise, try to add the new range */
+ mrd.mr_base = base;
+ mrd.mr_len = size;
+ strcpy(mrd.mr_owner, X_MTRR_ID);
+ mrd.mr_flags = MDF_WRITECOMBINE;
+ mro.mo_desc = &mrd;
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "Failed to set write-combining range "
+ "(0x%lx,0x%lx)\n", base, size);
+ return NULL;
+ } else {
+ xf86DrvMsg(screenNum, from,
+ "Write-combining range (0x%lx,0x%lx)\n", base, size);
+ retlist = xnfalloc(sizeof(RangeRec));
+ retlist->mrd = mrd;
+ retlist->wasWC = FALSE;
+ retlist->next = NULL;
+ return retlist;
+ }
+}
+
+static pointer
+delWC(int screenNum, unsigned long base, unsigned long size, MessageType from)
+{
+ RangePtr uc = NULL, wc = NULL, retlist = NULL;
+ struct mem_range_desc mrd;
+ struct mem_range_op mro;
+
+ findRanges(base, size, &uc, &wc);
+
+ /*
+ * See of the full range is already not WC, or if there is full
+ * coverage from UC ranges.
+ */
+ if (!wc || fullCoverage(base, size, uc)) {
+ xf86DrvMsg(screenNum, from,
+ "Write-combining range (0x%lx,0x%lx) was already clear\n",
+ base, size);
+ return NULL;
+ }
+
+ /* Otherwise, try to add the new range */
+ mrd.mr_base = base;
+ mrd.mr_len = size;
+ strcpy(mrd.mr_owner, X_MTRR_ID);
+ mrd.mr_flags = MDF_UNCACHEABLE;
+ mro.mo_desc = &mrd;
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "Failed to remove write-combining range "
+ "(0x%lx,0x%lx)\n", base, size);
+ /* XXX Should then remove all of the overlapping WC ranges */
+ return NULL;
+ } else {
+ xf86DrvMsg(screenNum, from,
+ "Removed Write-combining range (0x%lx,0x%lx)\n",
+ base, size);
+ retlist = xnfalloc(sizeof(RangeRec));
+ retlist->mrd = mrd;
+ retlist->wasWC = TRUE;
+ retlist->next = NULL;
+ return retlist;
+ }
+}
+
+static pointer
+setWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
+ MessageType from)
+{
+ if (enable)
+ return addWC(screenNum, base, size, from);
+ else
+ return delWC(screenNum, base, size, from);
+}
+
+static void
+undoWC(int screenNum, pointer list)
+{
+ RangePtr rp;
+ struct mem_range_op mro;
+ Bool failed;
+
+ rp = list;
+ while (rp) {
+#ifdef DEBUG
+ ErrorF("Undo for (0x%lx,0x%lx), %d\n",
+ (unsigned long)rp->mrd.mr_base,
+ (unsigned long)rp->mrd.mr_len, rp->wasWC);
+#endif
+ failed = FALSE;
+ if (rp->wasWC) {
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ rp->mrd.mr_flags = MDF_WRITECOMBINE;
+ strcpy(rp->mrd.mr_owner, "unknown");
+ } else {
+ mro.mo_arg[0] = MEMRANGE_SET_REMOVE;
+ }
+ mro.mo_desc = &rp->mrd;
+
+ if (ioctl(devMemFd, MEMRANGE_SET, &mro)) {
+ if (!rp->wasWC) {
+ mro.mo_arg[0] = MEMRANGE_SET_UPDATE;
+ rp->mrd.mr_flags = MDF_UNCACHEABLE;
+ strcpy(rp->mrd.mr_owner, "unknown");
+ if (ioctl(devMemFd, MEMRANGE_SET, &mro))
+ failed = TRUE;
+ } else
+ failed = TRUE;
+ }
+ if (failed) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "Failed to restore MTRR range (0x%lx,0x%lx)\n",
+ (unsigned long)rp->mrd.mr_base,
+ (unsigned long)rp->mrd.mr_len);
+ }
+ rp = rp->next;
+ }
+}
+
+#endif /* HAS_MTRR_SUPPORT */
+
+
+#if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__)
+static pointer
+NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable,
+ MessageType from)
+{
+ struct mtrr *mtrrp;
+ int n;
+
+ xf86DrvMsg(screenNum, X_WARNING,
+ "%s MTRR %lx - %lx\n", enable ? "set" : "remove",
+ base, (base + size));
+
+ mtrrp = xnfalloc(sizeof (struct mtrr));
+ mtrrp->base = base;
+ mtrrp->len = size;
+ mtrrp->type = MTRR_TYPE_WC;
+
+ /*
+ * MTRR_PRIVATE will make this MTRR get reset automatically
+ * if this process exits, so we have no need for an explicit
+ * cleanup operation when starting a new server.
+ */
+
+ if (enable)
+ mtrrp->flags = MTRR_VALID | MTRR_PRIVATE;
+ else
+ mtrrp->flags = 0;
+ n = 1;
+
+ if (i386_set_mtrr(mtrrp, &n) < 0) {
+ xfree(mtrrp);
+ return NULL;
+ }
+ return mtrrp;
+}
+
+static void
+NetBSDundoWC(int screenNum, pointer list)
+{
+ struct mtrr *mtrrp = (struct mtrr *)list;
+ int n;
+
+ if (mtrrp == NULL)
+ return;
+ n = 1;
+ mtrrp->flags &= ~MTRR_VALID;
+ i386_set_mtrr(mtrrp, &n);
+ xfree(mtrrp);
+}
+#endif
diff --git a/hw/xfree86/os-support/bsd/libusb/data.c b/hw/xfree86/os-support/bsd/libusb/data.c
new file mode 100644
index 000000000..bb84e5566
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/libusb/data.c
@@ -0,0 +1,91 @@
+/* $NetBSD: data.c,v 1.6 1999/09/20 04:48:12 lukem Exp $ */
+
+/*
+ * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
+ * 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/data.c,v 1.1 2000/02/11 18:06:49 dawes Exp $ */
+
+#include <assert.h>
+#include <stdlib.h>
+#include "usb.h"
+
+int
+hid_get_data(void *p, hid_item_t *h)
+{
+ unsigned char *buf;
+ unsigned int hpos;
+ unsigned int hsize;
+ int data;
+ int i, end, offs;
+
+ _DIAGASSERT(p != NULL);
+ _DIAGASSERT(h != NULL);
+
+ buf = p;
+ hpos = h->pos; /* bit position of data */
+ hsize = h->report_size; /* bit length of data */
+
+ if (hsize == 0)
+ return (0);
+ offs = hpos / 8;
+ end = (hpos + hsize) / 8 - offs;
+ data = 0;
+ for (i = 0; i <= end; i++)
+ data |= buf[offs + i] << (i*8);
+ data >>= hpos % 8;
+ data &= (1 << hsize) - 1;
+ if (h->logical_minimum < 0) {
+ /* Need to sign extend */
+ hsize = sizeof data * 8 - hsize;
+ data = (data << hsize) >> hsize;
+ }
+ return (data);
+}
+
+void
+hid_set_data(void *p, hid_item_t *h, int data)
+{
+ unsigned char *buf;
+ unsigned int hpos;
+ unsigned int hsize;
+ int i, end, offs;
+
+ _DIAGASSERT(p != NULL);
+ _DIAGASSERT(h != NULL);
+
+ buf = p;
+ hpos = h->pos; /* bit position of data */
+ hsize = h->report_size; /* bit length of data */
+
+ if (hsize != 32)
+ data &= (1 << hsize) - 1;
+ data <<= (hpos % 8);
+
+ offs = hpos / 8;
+ end = (hpos + hsize) / 8 - offs;
+ data = 0;
+ for (i = 0; i <= end; i++)
+ buf[offs + i] |= (data >> (i*8)) & 0xff;
+}
diff --git a/hw/xfree86/os-support/bsd/libusb/descr.c b/hw/xfree86/os-support/bsd/libusb/descr.c
new file mode 100644
index 000000000..f75418964
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/libusb/descr.c
@@ -0,0 +1,72 @@
+/* $NetBSD: descr.c,v 1.7 1999/10/13 17:48:04 drochner Exp $ */
+
+/*
+ * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
+ * 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/descr.c,v 1.1 2000/02/11 18:06:50 dawes Exp $ */
+
+#include <sys/types.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#include <dev/usb/usb.h>
+
+#include "usb.h"
+#include "usbvar.h"
+
+report_desc_t
+hid_get_report_desc(fd)
+ int fd;
+{
+ struct usb_ctl_report_desc rep;
+ report_desc_t r;
+
+ _DIAGASSERT(fd != -1);
+
+ rep.size = 0;
+ if (ioctl(fd, USB_GET_REPORT_DESC, &rep) < 0)
+ return (0);
+ r = malloc(sizeof *r + rep.size);
+ if (r == 0) {
+ errno = ENOMEM;
+ return (0);
+ }
+ r->size = rep.size;
+ memcpy(r->data, rep.data, (unsigned int)rep.size);
+ return (r);
+}
+
+void
+hid_dispose_report_desc(r)
+ report_desc_t r;
+{
+
+ free(r);
+}
diff --git a/hw/xfree86/os-support/bsd/libusb/parse.c b/hw/xfree86/os-support/bsd/libusb/parse.c
new file mode 100644
index 000000000..8c1a8b8a2
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/libusb/parse.c
@@ -0,0 +1,400 @@
+/* $NetBSD: parse.c,v 1.7 1999/10/13 17:48:04 drochner Exp $ */
+
+/*
+ * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
+ * 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/parse.c,v 1.1 2000/02/11 18:06:50 dawes Exp $ */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbhid.h>
+
+#include "usb.h"
+#include "usbvar.h"
+
+#define MAXUSAGE 100
+struct hid_data {
+ u_char *start;
+ u_char *end;
+ u_char *p;
+ hid_item_t cur;
+ unsigned int usages[MAXUSAGE];
+ int nusage;
+ int minset;
+ int multi;
+ int multimax;
+ int kindset;
+};
+
+static int min(int x, int y) { return x < y ? x : y; }
+
+static void
+hid_clear_local(hid_item_t *c)
+{
+
+ _DIAGASSERT(c != NULL);
+
+ c->usage = 0;
+ c->usage_minimum = 0;
+ c->usage_maximum = 0;
+ c->designator_index = 0;
+ c->designator_minimum = 0;
+ c->designator_maximum = 0;
+ c->string_index = 0;
+ c->string_minimum = 0;
+ c->string_maximum = 0;
+ c->set_delimiter = 0;
+}
+
+hid_data_t
+hid_start_parse(report_desc_t d, int kindset)
+{
+ struct hid_data *s;
+
+ _DIAGASSERT(d != NULL);
+
+ s = malloc(sizeof *s);
+ memset(s, 0, sizeof *s);
+ s->start = s->p = d->data;
+ s->end = d->data + d->size;
+ s->kindset = kindset;
+ return (s);
+}
+
+void
+hid_end_parse(hid_data_t s)
+{
+
+ _DIAGASSERT(s != NULL);
+
+ while (s->cur.next) {
+ hid_item_t *hi = s->cur.next->next;
+ free(s->cur.next);
+ s->cur.next = hi;
+ }
+ free(s);
+}
+
+int
+hid_get_item(hid_data_t s, hid_item_t *h)
+{
+ hid_item_t *c;
+ unsigned int bTag = 0, bType = 0, bSize;
+ unsigned char *data;
+ int dval;
+ unsigned char *p;
+ hid_item_t *hi;
+ int i;
+
+ _DIAGASSERT(s != NULL);
+ _DIAGASSERT(h != NULL);
+
+ c = &s->cur;
+
+ top:
+ if (s->multimax) {
+ if (s->multi < s->multimax) {
+ c->usage = s->usages[min(s->multi, s->nusage-1)];
+ s->multi++;
+ *h = *c;
+ c->pos += c->report_size;
+ h->next = 0;
+ return (1);
+ } else {
+ c->report_count = s->multimax;
+ s->multimax = 0;
+ s->nusage = 0;
+ hid_clear_local(c);
+ }
+ }
+ for (;;) {
+ p = s->p;
+ if (p >= s->end)
+ return (0);
+
+ bSize = *p++;
+ if (bSize == 0xfe) {
+ /* long item */
+ bSize = *p++;
+ bSize |= *p++ << 8;
+ bTag = *p++;
+ data = p;
+ p += bSize;
+ } else {
+ /* short item */
+ bTag = bSize >> 4;
+ bType = (bSize >> 2) & 3;
+ bSize &= 3;
+ if (bSize == 3) bSize = 4;
+ data = p;
+ p += bSize;
+ }
+ s->p = p;
+ /*
+ * The spec is unclear if the data is signed or unsigned.
+ */
+ switch(bSize) {
+ case 0:
+ dval = 0;
+ break;
+ case 1:
+ dval = (int8_t)*data++;
+ break;
+ case 2:
+ dval = *data++;
+ dval |= *data++ << 8;
+ dval = (int16_t)dval;
+ break;
+ case 4:
+ dval = *data++;
+ dval |= *data++ << 8;
+ dval |= *data++ << 16;
+ dval |= *data++ << 24;
+ break;
+ default:
+ return (-1);
+ }
+
+ switch (bType) {
+ case 0: /* Main */
+ switch (bTag) {
+ case 8: /* Input */
+ if (!(s->kindset & (1 << hid_input)))
+ continue;
+ c->kind = hid_input;
+ c->flags = dval;
+ ret:
+ if (c->flags & HIO_VARIABLE) {
+ s->multimax = c->report_count;
+ s->multi = 0;
+ c->report_count = 1;
+ if (s->minset) {
+ for (i = c->usage_minimum;
+ i <= c->usage_maximum;
+ i++) {
+ s->usages[s->nusage] = i;
+ if (s->nusage < MAXUSAGE-1)
+ s->nusage++;
+ }
+ s->minset = 0;
+ }
+ goto top;
+ } else {
+ if (s->minset)
+ c->usage = c->usage_minimum;
+ *h = *c;
+ h->next = 0;
+ c->pos += c->report_size * c->report_count;
+ hid_clear_local(c);
+ s->minset = 0;
+ return (1);
+ }
+ case 9: /* Output */
+ if (!(s->kindset & (1 << hid_output)))
+ continue;
+ c->kind = hid_output;
+ c->flags = dval;
+ goto ret;
+ case 10: /* Collection */
+ c->kind = hid_collection;
+ c->collection = dval;
+ c->collevel++;
+ *h = *c;
+ hid_clear_local(c);
+ s->nusage = 0;
+ return (1);
+ case 11: /* Feature */
+ if (!(s->kindset & (1 << hid_feature)))
+ continue;
+ c->kind = hid_feature;
+ c->flags = dval;
+ goto ret;
+ case 12: /* End collection */
+ c->kind = hid_endcollection;
+ c->collevel--;
+ *h = *c;
+ hid_clear_local(c);
+ s->nusage = 0;
+ return (1);
+ default:
+ return (-2);
+ }
+
+ case 1: /* Global */
+ switch (bTag) {
+ case 0:
+ c->_usage_page = dval << 16;
+ break;
+ case 1:
+ c->logical_minimum = dval;
+ break;
+ case 2:
+ c->logical_maximum = dval;
+ break;
+ case 3:
+ c->physical_maximum = dval;
+ break;
+ case 4:
+ c->physical_maximum = dval;
+ break;
+ case 5:
+ c->unit_exponent = dval;
+ break;
+ case 6:
+ c->unit = dval;
+ break;
+ case 7:
+ c->report_size = dval;
+ break;
+ case 8:
+ c->report_ID = dval;
+ break;
+ case 9:
+ c->report_count = dval;
+ break;
+ case 10: /* Push */
+ hi = malloc(sizeof *hi);
+ *hi = s->cur;
+ c->next = hi;
+ break;
+ case 11: /* Pop */
+ hi = c->next;
+ s->cur = *hi;
+ free(hi);
+ break;
+ default:
+ return (-3);
+ }
+ break;
+ case 2: /* Local */
+ switch (bTag) {
+ case 0:
+ if (bSize == 1)
+ dval = c->_usage_page | (dval&0xff);
+ else if (bSize == 2)
+ dval = c->_usage_page | (dval&0xffff);
+ c->usage = dval;
+ if (s->nusage < MAXUSAGE)
+ s->usages[s->nusage++] = dval;
+ /* else XXX */
+ break;
+ case 1:
+ s->minset = 1;
+ if (bSize == 1)
+ dval = c->_usage_page | (dval&0xff);
+ else if (bSize == 2)
+ dval = c->_usage_page | (dval&0xffff);
+ c->usage_minimum = dval;
+ break;
+ case 2:
+ if (bSize == 1)
+ dval = c->_usage_page | (dval&0xff);
+ else if (bSize == 2)
+ dval = c->_usage_page | (dval&0xffff);
+ c->usage_maximum = dval;
+ break;
+ case 3:
+ c->designator_index = dval;
+ break;
+ case 4:
+ c->designator_minimum = dval;
+ break;
+ case 5:
+ c->designator_maximum = dval;
+ break;
+ case 7:
+ c->string_index = dval;
+ break;
+ case 8:
+ c->string_minimum = dval;
+ break;
+ case 9:
+ c->string_maximum = dval;
+ break;
+ case 10:
+ c->set_delimiter = dval;
+ break;
+ default:
+ return (-4);
+ }
+ break;
+ default:
+ return (-5);
+ }
+ }
+}
+
+int
+hid_report_size(report_desc_t r, enum hid_kind k, int *idp)
+{
+ struct hid_data *d;
+ hid_item_t h;
+ int size, id;
+
+ _DIAGASSERT(r != NULL);
+ /* idp may be NULL */
+
+ id = 0;
+ if (idp)
+ *idp = 0;
+ memset(&h, 0, sizeof h);
+ for (d = hid_start_parse(r, 1<<k); hid_get_item(d, &h); ) {
+ if (h.report_ID != 0) {
+ if (idp)
+ *idp = h.report_ID;
+ id = 8;
+ }
+ }
+ hid_end_parse(d);
+ size = h.pos + id;
+ return ((size + 7) / 8);
+}
+
+int
+hid_locate(desc, u, k, h)
+ report_desc_t desc;
+ unsigned int u;
+ enum hid_kind k;
+ hid_item_t *h;
+{
+ hid_data_t d;
+
+ _DIAGASSERT(desc != NULL);
+ _DIAGASSERT(h != NULL);
+
+ for (d = hid_start_parse(desc, 1<<k); hid_get_item(d, h); ) {
+ if (h->kind == k && !(h->flags & HIO_CONST) && h->usage == u) {
+ hid_end_parse(d);
+ return (1);
+ }
+ }
+ hid_end_parse(d);
+ h->report_size = 0;
+ return (0);
+}
diff --git a/hw/xfree86/os-support/bsd/libusb/usage.c b/hw/xfree86/os-support/bsd/libusb/usage.c
new file mode 100644
index 000000000..9338e61d4
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/libusb/usage.c
@@ -0,0 +1,195 @@
+/* $NetBSD: usage.c,v 1.4 1999/07/02 15:46:53 simonb Exp $ */
+
+/*
+ * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
+ * 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usage.c,v 1.1 2000/02/11 18:06:50 dawes Exp $ */
+
+#include <ctype.h>
+#include <err.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "usb.h"
+
+#define _PATH_HIDTABLE "/usr/share/misc/usb_hid_usages"
+
+struct usage_in_page {
+ char *name;
+ int usage;
+};
+
+static struct usage_page {
+ char *name;
+ int usage;
+ struct usage_in_page *page_contents;
+ int pagesize, pagesizemax;
+} *pages;
+static int npages, npagesmax;
+
+#ifdef DEBUG
+void
+dump_hid_table(void)
+{
+ int i, j;
+
+ for (i = 0; i < npages; i++) {
+ printf("%d\t%s\n", pages[i].usage, pages[i].name);
+ for (j = 0; j < pages[i].pagesize; j++) {
+ printf("\t%d\t%s\n", pages[i].page_contents[j].usage,
+ pages[i].page_contents[j].name);
+ }
+ }
+}
+#endif
+
+void
+hid_init(char *hidname)
+{
+ FILE *f;
+ char line[100], name[100], *p, *n;
+ int no;
+ int lineno;
+ struct usage_page *curpage = 0;
+
+ if (hidname == 0)
+ hidname = _PATH_HIDTABLE;
+
+ f = fopen(hidname, "r");
+ if (f == NULL)
+ err(1, "%s", hidname);
+ for (lineno = 1; ; lineno++) {
+ if (fgets(line, sizeof line, f) == NULL)
+ break;
+ if (line[0] == '#')
+ continue;
+ for (p = line; *p && isspace(*p); p++)
+ ;
+ if (!*p)
+ continue;
+ if (sscanf(line, " * %[^\n]", name) == 1)
+ no = -1;
+ else if (sscanf(line, " 0x%x %[^\n]", &no, name) != 2 &&
+ sscanf(line, " %d %[^\n]", &no, name) != 2)
+ errx(1, "file %s, line %d, syntax error\n",
+ hidname, lineno);
+ for (p = name; *p; p++)
+ if (isspace(*p) || *p == '.')
+ *p = '_';
+ n = strdup(name);
+ if (!n)
+ err(1, "strdup");
+ if (isspace(line[0])) {
+ if (!curpage)
+ errx(1, "file %s, line %d, syntax error\n",
+ hidname, lineno);
+ if (curpage->pagesize >= curpage->pagesizemax) {
+ curpage->pagesizemax += 10;
+ curpage->page_contents =
+ realloc(curpage->page_contents,
+ curpage->pagesizemax *
+ sizeof (struct usage_in_page));
+ if (!curpage->page_contents)
+ err(1, "realloc");
+ }
+ curpage->page_contents[curpage->pagesize].name = n;
+ curpage->page_contents[curpage->pagesize].usage = no;
+ curpage->pagesize++;
+ } else {
+ if (npages >= npagesmax) {
+ if (pages == 0) {
+ npagesmax = 5;
+ pages = malloc(npagesmax *
+ sizeof (struct usage_page));
+ } else {
+ npagesmax += 5;
+ pages = realloc(pages,
+ npagesmax *
+ sizeof (struct usage_page));
+ }
+ if (!pages)
+ err(1, "alloc");
+ }
+ curpage = &pages[npages++];
+ curpage->name = n;
+ curpage->usage = no;
+ curpage->pagesize = 0;
+ curpage->pagesizemax = 10;
+ curpage->page_contents =
+ malloc(curpage->pagesizemax *
+ sizeof (struct usage_in_page));
+ if (!curpage->page_contents)
+ err(1, "malloc");
+ }
+ }
+ fclose(f);
+#ifdef DEBUG
+ dump_hid_table();
+#endif
+}
+
+char *
+hid_usage_page(int i)
+{
+ static char b[10];
+ int k;
+
+ if (!pages)
+ errx(1, "no hid table\n");
+
+ for (k = 0; k < npages; k++)
+ if (pages[k].usage == i)
+ return pages[k].name;
+ sprintf(b, "0x%02x", i);
+ return b;
+}
+
+char *
+hid_usage_in_page(unsigned int u)
+{
+ int page = HID_PAGE(u);
+ int i = HID_USAGE(u);
+ static char b[100];
+ int j, k, us;
+
+ for (k = 0; k < npages; k++)
+ if (pages[k].usage == page)
+ break;
+ if (k >= npages)
+ goto bad;
+ for (j = 0; j < pages[k].pagesize; j++) {
+ us = pages[k].page_contents[j].usage;
+ if (us == -1) {
+ sprintf(b, pages[k].page_contents[j].name, i);
+ return b;
+ }
+ if (us == i)
+ return pages[k].page_contents[j].name;
+ }
+ bad:
+ sprintf(b, "0x%02x", i);
+ return b;
+}
diff --git a/hw/xfree86/os-support/bsd/libusb/usb.3 b/hw/xfree86/os-support/bsd/libusb/usb.3
new file mode 100644
index 000000000..f88a28cd6
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/libusb/usb.3
@@ -0,0 +1,191 @@
+.\" $NetBSD: usb.3,v 1.9 1999/11/08 22:33:40 augustss Exp $
+.\"
+.\" Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
+.\" 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.
+.\"
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.3,v 1.1 2000/02/11 18:06:50 dawes Exp $
+.\"
+.Dd May 11, 1999
+.Dt USB 3
+.Os
+.Sh NAME
+.Nm usb ,
+.Nm hid_get_report_desc ,
+.Nm hid_dispose_report_desc ,
+.Nm hid_start_parse ,
+.Nm hid_end_parse ,
+.Nm hid_get_item ,
+.Nm hid_report_size ,
+.Nm hid_locate ,
+.Nm hid_usage_page ,
+.Nm hid_usage_in_page ,
+.Nm hid_init ,
+.Nm hid_get_data ,
+.Nm hid_set_data
+.Nd USB HID access routines
+.Sh LIBRARY
+.Lb libusb
+.Sh SYNOPSIS
+.Fd #include <usb.h>
+.Ft report_desc_t
+.Fn hid_get_report_desc "int file"
+.Ft void
+.Fn hid_dispose_report_desc "report_desc_t d"
+.Ft hid_data_t
+.Fn hid_start_parse "report_desc_t d" "int kindset"
+.Ft void
+.Fn hid_end_parse "hid_data_t s"
+.Ft int
+.Fn hid_get_item "hid_data_t s" "hid_item_t *h"
+.Ft int
+.Fn hid_report_size "report_desc_t d" "hid_kind_t k" "int *idp"
+.Ft int
+.Fn hid_locate "report_desc_t d" "u_int usage" "hid_kind_t k" "hid_item_t *h"
+.Ft char *
+.Fn hid_usage_page "int i"
+.Ft char *
+.Fn hid_usage_in_page "u_int u"
+.Ft void
+.Fn hid_init "char *file"
+.Ft int
+.Fn hid_get_data "void *data" "hid_item_t *h"
+.Ft void
+.Fn hid_set_data "void *data" "hid_item_t *h" "u_int data"
+.Sh DESCRIPTION
+The
+.Nm
+library provides routines to extract data from USB Human Interface Devices.
+.Ss INTRODUCTION
+USB HID devices send and receive data layed out a device dependent
+way. The
+.Nm
+library contains routines to extract the
+.Em report descriptor
+which contains the data layout information and then use this information.
+.Pp
+The routines can be divided into four parts: extraction of the descriptor,
+parsing of the descriptor, translating to/from symbolic names, and
+data manipulation.
+.Ss DESCRIPTOR FUNCTIONS
+A report descriptor can be obtained by calling
+.Fn hid_get_report_desc
+with a file descriptor obtained by opening a
+.Xr uhid 4
+device.
+When the report descriptor is no longer needed it should be freed
+by calling
+.Fn hid_dispose_report_desc .
+The type
+.Fa report_desc_t
+is opaque and should be used when calling the parsing functions.
+.Ss DESCRIPTOR PARSING FUNCTIONS
+To parse the report descriptor the
+.Fn hid_start_parse
+function should be called with a report descriptor and a set that
+describes which items that are interesting. The set is obtained
+by oring together values
+.Fa "(1 << k)"
+where
+.Fa k
+is an item of type
+.Fa hid_kind_t .
+The function returns
+.Fa NULL
+if the initialization fails, otherwise an opaque value to be used
+in subsequent calls.
+After parsing the
+.Fn hid_end_parse
+function should be called to free internal data structures.
+.Pp
+To iterate through all the items in the report descriptor
+.Fn hid_get_item
+should be called while it returns a value greater than 0.
+When the report descriptor ends it will returns 0; a syntax
+error within the report descriptor will cause a return value less
+than 0.
+The struct pointed to by
+.Fa h
+will be filled with the relevant data for the item.
+The definition of
+.Fa hid_item_t
+can be found in
+.Pa <usb.h>
+and the meaning of the components in the USB HID documentation.
+.Pp
+Data should be read/written to the device in the size of
+the report. The size of a report (of a certain kind) can be
+computed by the
+.Fn hid_report_size
+function. If the report is prefixed by an ID byte it is
+stored at
+.Fa idp ,
+otherwise it will contain 0.
+.Pp
+To locate a single item the
+.Fn hid_locate
+function can be used. It should be given the usage code of
+the item and its kind and it will fill the item and return
+non-zero if the item was found.
+.Pp
+.Ss NAME TRANSLATION FUNCTIONS
+The function
+.Fn hid_usage_page
+will return the symbolic name of a usage page, and the function
+.Fn hid_usage_in_page
+will return the symbolic name of the usage within the page.
+Both these functions may return a pointer to static data.
+Before either of these functions can be called the usage table
+must be parsed, this is done by calling
+.Fn hid_init
+with the name of the table. Passing
+.Fa NULL
+to this function will cause it to use the default table.
+.Ss DATA EXTRACTION FUNCTIONS
+Given the data obtained from a HID device and an item in the
+report descriptor the
+.Fn hid_get_data
+function extracts the value of the item.
+Conversely
+.Fn hid_set_data
+can be used to put data into a report (which must be zeroed first).
+.Sh EXAMPLE
+Not yet.
+.Sh FILES
+.Pa /usr/share/misc/usb_hid_usages
+The default HID usage table.
+.Sh BUGS
+This man page is woefully incomplete.
+.Sh SEE ALSO
+The
+.Tn USB
+specifications can be found at
+.Dv http://www.usb.org/developers/docs.htm .
+.Pp
+.Xr hid 4 ,
+.Xr usb 4 .
+.Sh HISTORY
+The
+.Nm
+library first appeared in
+.Nx 1.5 .
diff --git a/hw/xfree86/os-support/bsd/libusb/usb.h b/hw/xfree86/os-support/bsd/libusb/usb.h
new file mode 100644
index 000000000..69ef79a62
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/libusb/usb.h
@@ -0,0 +1,95 @@
+/* $NetBSD: usb.h,v 1.5 1999/07/02 15:46:53 simonb Exp $ */
+
+/*
+ * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
+ * 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
+
+#define _DIAGASSERT(e) assert(e)
+
+typedef struct report_desc *report_desc_t;
+
+typedef struct hid_data *hid_data_t;
+
+typedef enum hid_kind {
+ hid_input, hid_output, hid_feature, hid_collection, hid_endcollection
+}hid_kind_t;
+
+typedef struct hid_item {
+ /* Global */
+ int _usage_page;
+ int logical_minimum;
+ int logical_maximum;
+ int physical_minimum;
+ int physical_maximum;
+ int unit_exponent;
+ int unit;
+ int report_size;
+ int report_ID;
+ int report_count;
+ /* Local */
+ unsigned int usage;
+ int usage_minimum;
+ int usage_maximum;
+ int designator_index;
+ int designator_minimum;
+ int designator_maximum;
+ int string_index;
+ int string_minimum;
+ int string_maximum;
+ int set_delimiter;
+ /* Misc */
+ int collection;
+ int collevel;
+ enum hid_kind kind;
+ unsigned int flags;
+ /* Absolute data position (bits) */
+ unsigned int pos;
+ /* */
+ struct hid_item *next;
+} hid_item_t;
+
+#define HID_PAGE(u) ((u) >> 16)
+#define HID_USAGE(u) ((u) & 0xffff)
+
+/* Obtaining a report descriptor, descr.c: */
+report_desc_t hid_get_report_desc __P((int file));
+void hid_dispose_report_desc __P((report_desc_t));
+
+/* Parsing of a HID report descriptor, parse.c: */
+hid_data_t hid_start_parse __P((report_desc_t d, int kindset));
+void hid_end_parse __P((hid_data_t s));
+int hid_get_item __P((hid_data_t s, hid_item_t *h));
+int hid_report_size __P((report_desc_t d, enum hid_kind k, int *idp));
+int hid_locate __P((report_desc_t d, unsigned int usage, enum hid_kind k, hid_item_t *h));
+
+/* Conversion to/from usage names, usage.c: */
+char *hid_usage_page __P((int i));
+char *hid_usage_in_page __P((unsigned int u));
+void hid_init __P((char *file));
+
+/* Extracting/insertion of data, data.c: */
+int hid_get_data __P((void *p, hid_item_t *h));
+void hid_set_data __P((void *p, hid_item_t *h, int data));
diff --git a/hw/xfree86/os-support/bsd/libusb/usb_hid_usages b/hw/xfree86/os-support/bsd/libusb/usb_hid_usages
new file mode 100644
index 000000000..711ba206a
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/libusb/usb_hid_usages
@@ -0,0 +1,1079 @@
+# $NetBSD: usb_hid_usages,v 1.3 1999/07/02 15:46:53 simonb Exp $
+#
+# USB HID usage table
+# Syntax:
+# - lines that do not start with a white space give the number and name of
+# a usage page.
+# - lines that start with a white space give the number and name of
+# a usage with the last given page.
+# If the number is * then the line matches all usages and the name
+# is a printf formatting string that will be given the usage number.
+#
+# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usb_hid_usages,v 1.1 2000/02/11 18:06:51 dawes Exp $
+#
+1 Generic Desktop
+ 0x00 Undefined
+ 0x01 Pointer
+ 0x02 Mouse
+ 0x03 Reserved
+ 0x04 Joystick
+ 0x05 Game Pad
+ 0x06 Keyboard
+ 0x07 Keypad
+ 0x08 Multi-axis Controller
+ 0x30 X
+ 0x31 Y
+ 0x32 Z
+ 0x33 Rx
+ 0x34 Ry
+ 0x35 Rz
+ 0x36 Slider
+ 0x37 Dial
+ 0x38 Wheel
+ 0x39 Hat Switch
+ 0x3A Counted Buffer
+ 0x3B Byte Count
+ 0x3C Motion Wakeup
+ 0x40 Vx
+ 0x41 Vy
+ 0x42 Vz
+ 0x43 Vbrx
+ 0x44 Vbry
+ 0x45 Vbrx
+ 0x46 Vno
+ 0x80 System Control
+ 0x81 System Power Down
+ 0x82 System Sleep
+ 0x83 System Wake Up
+ 0x84 System Context Menu
+ 0x85 System Main Menu
+ 0x86 System App Menu
+ 0x87 System Menu Help
+ 0x88 System Menu Exit
+ 0x89 System Menu Select
+ 0x8A System Menu Right
+ 0x8B System Menu Left
+ 0x8C System Menu Up
+ 0x8D System Menu Down
+ 0x90 D-pad Up
+ 0x91 D-pad Down
+ 0x92 D-pad Right
+ 0x93 D-pad Left
+
+2 Simulation Controls
+ 0x00 Undefined
+ 0x01 Flight Simulation Device
+ 0x02 Automobile Simulation Device
+ 0x03 Tank Simulation Device
+ 0x04 Spaceship Simulation Device
+ 0x05 Submarine Simulation Device
+ 0x06 Sailing Simulation Device
+ 0x07 Motorcycle Simulation Device
+ 0x08 Sports Simulation Device
+ 0x09 Airplane Simulation Device
+ 0x0A Helicopter Simulation Device
+ 0x0B Magic Carpet Simulation Device
+ 0x0C Bicycle
+ 0x20 Flight Control Stick
+ 0x21 Flight Stick
+ 0x22 Cyclic Control
+ 0x23 Cyclic Trim
+ 0x24 Flight Yoke
+ 0x25 Track Control
+ 0x26 Driving Control
+ 0xB0 Aileron
+ 0xB1 Aileron Trim
+ 0xB2 Anti-Torque Control
+ 0xB3 Auto-pilot Enable
+ 0xB4 Chaff Release
+ 0xB5 Collective Control
+ 0xB6 Dive Brake
+ 0xB7 Electronic Counter Measures
+ 0xB8 Elevator
+ 0xB9 Elevator Trim
+ 0xBA Rudder
+ 0xBB Throttle
+ 0xBC Flight Communication
+ 0xBD Flare Release
+ 0xBE Landing Gear
+ 0xBF Toe Brake
+ 0xC0 Trigger
+ 0xC1 Weapons Arm
+ 0xC2 Weapons Select
+ 0xC3 Wing Flaps
+ 0xC4 Accelerator
+ 0xC5 Brake
+ 0xC6 Clutch
+ 0xC7 Shifter
+ 0xC8 Steering
+ 0xC9 Turret Direction
+ 0xCA Barrel Elevation
+ 0xCB Dive Plane
+ 0xCC Ballast
+ 0xCD Bicycle Crank
+ 0xCE Handle Bars
+ 0xCF Front Brake
+ 0xD0 Rear Brake
+
+3 VR Controls
+ 0x00 Unidentified
+ 0x01 Belt
+ 0x02 Body Suit
+ 0x03 Flexor
+ 0x04 Glove
+ 0x05 Head Tracker
+ 0x06 Head Mounted Display
+ 0x07 Hand Tracker
+ 0x08 Oculometer
+ 0x09 Vest
+ 0x0A Animatronic Device
+ 0x20 Stereo Enable
+ 0x21 Display Enable
+
+4 Sports Controls
+ 0x00 Unidentified
+ 0x01 Baseball Bat
+ 0x02 Golf Club
+ 0x03 Rowing Machine
+ 0x04 Treadmill
+ 0x30 Oar
+ 0x31 Slope
+ 0x32 Rate
+ 0x33 Stick Speed
+ 0x34 Stick Face Angle
+ 0x35 Stick Heel/Toe
+ 0x36 Stick Follow Through
+ 0x37 Stick Tempo
+ 0x38 Stick Type
+ 0x39 Stick Height
+ 0x50 Putter
+ 0x51 1 Iron
+ 0x52 2 Iron
+ 0x53 3 Iron
+ 0x54 4 Iron
+ 0x55 5 Iron
+ 0x56 6 Iron
+ 0x57 7 Iron
+ 0x58 8 Iron
+ 0x59 9 Iron
+ 0x5A 10 Iron
+ 0x5B 11 Iron
+ 0x5C Sand Wedge
+ 0x5D Loft Wedge
+ 0x5E Power Wedge
+ 0x5F 1 Wood
+ 0x60 3 Wood
+ 0x61 5 Wood
+ 0x62 7 Wood
+ 0x63 9 Wood
+
+5 Game Controls
+ 0x00 Undefined
+ 0x01 3D Game Controller
+ 0x02 Pinball Device
+ 0x03 Gun Device
+ 0x20 Point of View
+ 0x21 Turn Right/Left
+ 0x22 Pitch Right/Left
+ 0x23 Roll Forward/Backward
+ 0x24 Move Right/Left
+ 0x25 Move Forward/Backward
+ 0x26 Move Up/Down
+ 0x27 Lean Right/Left
+ 0x28 Lean Forward/Backward
+ 0x29 Height of POV
+ 0x2A Flipper
+ 0x2B Secondary Flipper
+ 0x2C Bump
+ 0x2D New Game
+ 0x2E Shoot Ball
+ 0x2F Player
+ 0x30 Gun Bolt
+ 0x31 Gun Clip
+ 0x32 Gun Selector
+ 0x33 Gun Single Shot
+ 0x34 Gun Burst
+ 0x35 Gun Automatic
+ 0x36 Gun Safety
+ 0x37 Gamepad Fire/Jump
+ 0x39 Gamepad Trigger
+
+7 Keyboard
+ 0x00 Reserved (no event indicated)
+ 0x01 Keyboard ErrorRollOver
+ 0x02 Keyboard POSTFail
+ 0x03 Keyboard ErrorUndefined
+ 0x04 Keyboard a and A
+ 0x05 Keyboard b and B
+ 0x06 Keyboard c and C
+ 0x07 Keyboard d and D
+ 0x08 Keyboard e and E
+ 0x09 Keyboard f and F
+ 0x0A Keyboard g and G
+ 0x0B Keyboard h and H
+ 0x0C Keyboard i and I
+ 0x0D Keyboard j and J
+ 0x0E Keyboard k and K
+ 0x0F Keyboard l and L
+ 0x10 Keyboard m and M
+ 0x11 Keyboard n and N
+ 0x12 Keyboard o and O
+ 0x13 Keyboard p and P
+ 0x14 Keyboard q and Q
+ 0x15 Keyboard r and R
+ 0x16 Keyboard s and S
+ 0x17 Keyboard t and T
+ 0x18 Keyboard u and U
+ 0x19 Keyboard v and V
+ 0x1A Keyboard w and W
+ 0x1B Keyboard x and X
+ 0x1C Keyboard y and Y
+ 0x1D Keyboard z and Z
+ 0x1E Keyboard 1 and !
+ 0x1F Keyboard 2 and @
+ 0x20 Keyboard 3 and #
+ 0x21 Keyboard 4 and $
+ 0x22 Keyboard 5 and %
+ 0x23 Keyboard 6 and ^
+ 0x24 Keyboard 7 and &
+ 0x25 Keyboard 8 and *
+ 0x26 Keyboard 9 and (
+ 0x27 Keyboard 0 and )
+ 0x28 Keyboard Return (ENTER)
+ 0x29 Keyboard ESCAPE
+ 0x2A Keyboard DELETE (Backspace)
+ 0x2B Keyboard Tab
+ 0x2C Keyboard Spacebar
+ 0x2D Keyboard - and (underscore)
+ 0x2E Keyboard = and +
+ 0x2F Keyboard [ and {
+ 0x30 Keyboard ] and }
+ 0x31 Keyboard \ and |
+ 0x32 Keyboard Non-US # and ~
+ 0x33 Keyboard ; and :
+ 0x34 Keyboard ' and "
+ 0x35 Keyboard Grave Accent and Tilde
+ 0x36 Keyboard, and <
+ 0x37 Keyboard . and >
+ 0x38 Keyboard / and ?
+ 0x39 Keyboard Caps Lock
+ 0x3A Keyboard F1
+ 0x3B Keyboard F2
+ 0x3C Keyboard F3
+ 0x3D Keyboard F4
+ 0x3E Keyboard F5
+ 0x3F Keyboard F6
+ 0x40 Keyboard F7
+ 0x41 Keyboard F8
+ 0x42 Keyboard F9
+ 0x43 Keyboard F10
+ 0x44 Keyboard F11
+ 0x45 Keyboard F12
+ 0x46 Keyboard PrintScreen
+ 0x47 Keyboard Scroll Lock
+ 0x48 Keyboard Pause
+ 0x49 Keyboard Insert
+ 0x4A Keyboard Home
+ 0x4B Keyboard PageUp
+ 0x4C Keyboard Delete Forward
+ 0x4D Keyboard End
+ 0x4E Keyboard PageDown
+ 0x4F Keyboard RightArrow
+ 0x50 Keyboard LeftArrow
+ 0x51 Keyboard DownArrow
+ 0x52 Keyboard UpArrow
+ 0x53 Keypad Num Lock and Clear
+ 0x54 Keypad /
+ 0x55 Keypad *
+ 0x56 Keypad -
+ 0x57 Keypad +
+ 0x58 Keypad ENTER
+ 0x59 Keypad 1 and End
+ 0x5A Keypad 2 and Down Arrow
+ 0x5B Keypad 3 and PageDn
+ 0x5C Keypad 4 and Left Arrow
+ 0x5D Keypad 5
+ 0x5E Keypad 6 and Right Arrow
+ 0x5F Keypad 7 and Home
+ 0x60 Keypad 8 and Up Arrow
+ 0x61 Keypad 9 and PageUp
+ 0x62 Keypad 0 and Insert
+ 0x63 Keypad . and Delete
+ 0x64 Keyboard Non-US \ and |
+ 0x65 Keyboard Application
+ 0x66 Keyboard Power
+ 0x67 Keypad =
+ 0x68 Keyboard F13
+ 0x69 Keyboard F14
+ 0x6A Keyboard F15
+ 0x6B Keyboard F16
+ 0x6C Keyboard F17
+ 0x6D Keyboard F18
+ 0x6E Keyboard F19
+ 0x6F Keyboard F20
+ 0x70 Keyboard F21
+ 0x71 Keyboard F22
+ 0x72 Keyboard F23
+ 0x73 Keyboard F24
+ 0x74 Keyboard Execute
+ 0x75 Keyboard Help
+ 0x76 Keyboard Menu
+ 0x77 Keyboard Select
+ 0x78 Keyboard Stop
+ 0x79 Keyboard Again
+ 0x7A Keyboard Undo
+ 0x7B Keyboard Cut
+ 0x7C Keyboard Copy
+ 0x7D Keyboard Paste
+ 0x7E Keyboard Find
+ 0x7F Keyboard Mute
+ 0x80 Keyboard Volume Up
+ 0x81 Keyboard Volume Down
+ 0x82 Keyboard Locking Caps Lock
+ 0x83 Keyboard Locking Num Lock
+ 0x84 Keyboard Locking Scroll Lock
+ 0x85 Keypad Comma
+ 0x86 Keypad Equal Sign
+ 0x87 Keyboard International1
+ 0x88 Keyboard International2
+ 0x89 Keyboard International3
+ 0x8A Keyboard International4
+ 0x8B Keyboard International5
+ 0x8C Keyboard International6
+ 0x8D Keyboard International7
+ 0x8E Keyboard International8
+ 0x8F Keyboard International9
+ 0x90 Keyboard LANG1
+ 0x91 Keyboard LANG2
+ 0x92 Keyboard LANG3
+ 0x93 Keyboard LANG4
+ 0x94 Keyboard LANG5
+ 0x95 Keyboard LANG6
+ 0x96 Keyboard LANG7
+ 0x97 Keyboard LANG8
+ 0x98 Keyboard LANG9
+ 0x99 Keyboard Alternate Erase
+ 0x9A Keyboard SysReq/Attention
+ 0x9B Keyboard Cancel
+ 0x9C Keyboard Clear
+ 0x9D Keyboard Prior
+ 0x9E Keyboard Return
+ 0x9F Keyboard Separator
+ 0xA0 Keyboard Out
+ 0xA1 Keyboard Oper
+ 0xA2 Keyboard Clear/Again
+ 0xA3 Keyboard CrSel/Props
+ 0xA4 Keyboard ExSel
+ 0xE0 Keyboard LeftControl
+ 0xE1 Keyboard LeftShift
+ 0xE2 Keyboard LeftAlt
+ 0xE3 Keyboard Left GUI
+ 0xE4 Keyboard RightControl
+ 0xE5 Keyboard RightShift
+ 0xE6 Keyboard RightAlt
+ 0xE7 Keyboard Right GUI
+
+8 LEDs
+ 0x00 Undefined
+ 0x01 Num Lock
+ 0x02 Caps Lock
+ 0x03 Scroll Lock
+ 0x04 Compose
+ 0x05 Kana
+ 0x06 Power
+ 0x07 Shift
+ 0x08 Do Not Disturb
+ 0x09 Mute
+ 0x0A Tone Enable
+ 0x0B High Cut Filter
+ 0x0C Low Cut Filter
+ 0x0D Equalizer Enable
+ 0x0E Sound Field On
+ 0x0F Surround Field On
+ 0x10 Repeat
+ 0x11 Stereo
+ 0x12 Sampling Rate Detect
+ 0x13 Spinning
+ 0x14 CAV
+ 0x15 CLV
+ 0x16 Recording Format Detect
+ 0x17 Off-Hook
+ 0x18 Ring
+ 0x19 Message Waiting
+ 0x1A Data Mode
+ 0x1B Battery Operation
+ 0x1C Battery OK
+ 0x1D Battery Low
+ 0x1E Speaker
+ 0x1F Head Set
+ 0x20 Hold
+ 0x21 Microphone
+ 0x22 Coverage
+ 0x23 Night Mode
+ 0x24 Send Calls
+ 0x25 Call Pickup
+ 0x26 Conference
+ 0x27 Stand-by
+ 0x28 Camera On
+ 0x29 Camera Off
+ 0x2A On-Line
+ 0x2B Off-Line
+ 0x2C Busy
+ 0x2D Ready
+ 0x2E Paper-Out
+ 0x2F Paper-Jam
+ 0x30 Remote
+ 0x31 Forward
+ 0x32 Reverse
+ 0x33 Stop
+ 0x34 Rewind
+ 0x35 Fast Forward
+ 0x36 Play
+ 0x37 Pause
+ 0x38 Record
+ 0x39 Error
+ 0x3A Usage Selected Indicator
+ 0x3B Usage In Use Indicator
+ 0x3C Usage Multi Mode Indicator
+ 0x3D Indicator On
+ 0x3E Indicator Flash
+ 0x3F Indicator Slow Blink
+ 0x40 Indicator Fast Blink
+ 0x41 Indicator Off
+ 0x42 Flash On Time
+ 0x43 Slow Blink On Time
+ 0x44 Slow Blink Off Time
+ 0x45 Fast Blink On Time
+ 0x46 Fast Blink Off Time
+ 0x47 Usage Indicator Color
+ 0x48 Red
+ 0x49 Green
+ 0x4A Amber
+ 0x4B Generic Indicator
+ 0x4C System Suspend
+ 0x4D External Power Connected
+ 0x4C-FFFF Reserved
+
+9 Button
+ 0x00 No Button Pressed
+ * Button %d
+
+10 Ordinal
+ 0x00 Unused
+ * Instance %d
+
+11 Telephony
+ 0x00 Unassigned
+ 0x01 Phone
+ 0x02 Answering Machine
+ 0x03 Message Controls
+ 0x04 Handset
+ 0x05 Headset
+ 0x06 Telephony Key Pad
+ 0x07 Programmable Button
+ 0x20 Hook Switch
+ 0x21 Flash
+ 0x22 Feature
+ 0x23 Hold
+ 0x24 Redial
+ 0x25 Transfer
+ 0x26 Drop
+ 0x27 Park
+ 0x28 Forward Calls
+ 0x29 Alternate Function
+ 0x2A Line
+ 0x2B Speaker Phone
+ 0x2C Conference
+ 0x2D Ring Enable
+ 0x2E Ring Select
+ 0x2F Phone Mute
+ 0x30 Caller ID
+ 0x50 Speed Dial
+ 0x51 Store Number
+ 0x52 Recall Number
+ 0x53 Phone Directory
+ 0x70 Voice Mail
+ 0x71 Screen Calls
+ 0x72 Do Not Disturb
+ 0x73 Message
+ 0x74 Answer On/Off
+ 0x90 Inside Dial Tone
+ 0x91 Outside Dial Tone
+ 0x92 Inside Ring Tone
+ 0x93 Outside Ring Tone
+ 0x94 Priority Ring Tone
+ 0x95 Inside Ringback
+ 0x96 Priority Ringback
+ 0x97 Line Busy Tone
+ 0x98 Reorder Tone
+ 0x99 Call Waiting Tone
+ 0x9A Confirmation Tone 1
+ 0x9B Confirmation Tone 2
+ 0x9C Tones Off
+ 0xB0 Phone Key 0
+ 0xB1 Phone Key 1
+ 0xB2 Phone Key 2
+ 0xB3 Phone Key 3
+ 0xB4 Phone Key 4
+ 0xB5 Phone Key 5
+ 0xB6 Phone Key 6
+ 0xB7 Phone Key 7
+ 0xB8 Phone Key 8
+ 0xB9 Phone Key 9
+ 0xBA Phone Key Star
+ 0xBB Phone Key Pound
+ 0xBC Phone Key A
+ 0xBD Phone Key B
+ 0xBE Phone Key C
+ 0xBF Phone Key D
+
+12 Consumer
+ 0x00 Unassigned
+ 0x01 Consumer Control
+ 0x02 Numeric Key Pad
+ 0x03 Programmable Buttons
+ 0x20 +10
+ 0x21 +100
+ 0x22 AM/PM
+ 0x30 Power
+ 0x31 Reset
+ 0x32 Sleep
+ 0x33 Sleep After
+ 0x34 Sleep Mode
+ 0x35 Illumination
+ 0x36 Function Buttons
+ 0x40 Menu
+ 0x41 Menu Pick
+ 0x42 Menu Up
+ 0x43 Menu Down
+ 0x44 Menu Left
+ 0x45 Menu Right
+ 0x46 Menu Escape
+ 0x47 Menu Value Increase
+ 0x48 Menu Value Decrease
+ 0x60 Data On Screen
+ 0x61 Closed Caption
+ 0x62 Closed Caption Select
+ 0x63 VCR/TV
+ 0x64 Broadcast Mode
+ 0x65 Snapshot
+ 0x66 Still
+ 0x80 Selection
+ 0x81 Assign Selection
+ 0x82 Mode Step
+ 0x83 Recall Last
+ 0x84 Enter Channel
+ 0x85 Order Movie
+ 0x86 Channel
+ 0x87 Media Selection
+ 0x88 Media Select Computer
+ 0x89 Media Select TV
+ 0x8A Media Select WWW
+ 0x8B Media Select DVD
+ 0x8C Media Select Telephone
+ 0x8D Media Select Program Guide
+ 0x8E Media Select Video Phone
+ 0x8F Media Select Games
+ 0x90 Media Select Messages
+ 0x91 Media Select CD
+ 0x92 Media Select VCR
+ 0x93 Media Select Tuner
+ 0x94 Quit
+ 0x95 Help
+ 0x96 Media Select Tape
+ 0x97 Media Select Cable
+ 0x98 Media Select Satellite
+ 0x99 Media Select Security
+ 0x9A Media Select Home
+ 0x9B Media Select Call
+ 0x9C Channel Increment
+ 0x9D Channel Decrement
+ 0x9E Media Select SAP
+ 0xA0 VCR Plus
+ 0xA1 Once
+ 0xA2 Daily
+ 0xA3 Weekly
+ 0xA4 Monthly
+ 0xB0 Play
+ 0xB1 Pause
+ 0xB2 Record
+ 0xB3 Fast Forward
+ 0xB4 Rewind
+ 0xB5 Scan Next Track
+ 0xB6 Scan Previous Track
+ 0xB7 Stop
+ 0xB8 Eject
+ 0xB9 Random Play
+ 0xBA Select DisC
+ 0xBB Enter Disc
+ 0xBC Repeat
+ 0xBD Tracking
+ 0xBE Track Normal
+ 0xBF Slow Tracking
+ 0xC0 Frame Forward
+ 0xC1 Frame Back
+ 0xC2 Mark
+ 0xC3 Clear Mark
+ 0xC4 Repeat From Mark
+ 0xC5 Return To Mark
+ 0xC6 Search Mark Forward
+ 0xC7 Search Mark Backwards
+ 0xC8 Counter Reset
+ 0xC9 Show Counter
+ 0xCA Tracking Increment
+ 0xCB Tracking Decrement
+ 0xE0 Volume
+ 0xE1 Balance
+ 0xE2 Mute
+ 0xE3 Bass
+ 0xE4 Treble
+ 0xE5 Bass Boost
+ 0xE6 Surround Mode
+ 0xE7 Loudness
+ 0xE8 MPX
+ 0xE9 Volume Up
+ 0xEA Volume Down
+ 0xF0 Speed Select
+ 0xF1 Playback Speed
+ 0xF2 Standard Play
+ 0xF3 Long Play
+ 0xF4 Extended Play
+ 0xF5 Slow
+ 0x100 Fan Enable
+ 0x101 Fan Speed
+ 0x102 Light
+ 0x103 Light Illumination Level
+ 0x104 Climate Control Enable
+ 0x105 Room Temperature
+ 0x106 Security Enable
+ 0x107 Fire Alarm
+ 0x108 Police Alarm
+ 0x150 Balance Right
+ 0x151 Balance Left
+ 0x152 Bass Increment
+ 0x153 Bass Decrement
+ 0x154 Treble Increment
+ 0x155 Treble Decrement
+ 0x160 Speaker System
+ 0x161 Channel Left
+ 0x162 Channel Right
+ 0x163 Channel Center
+ 0x164 Channel Front
+ 0x165 Channel Center Front
+ 0x166 Channel Side
+ 0x167 Channel Surround
+ 0x168 Channel Low Frequency Enhancement
+ 0x169 Channel Top
+ 0x16A Channel Unknown
+ 0x170 Sub-channel
+ 0x171 Sub-channel Increment
+ 0x172 Sub-channel Decrement
+ 0x173 Alternate Audio Increment
+ 0x174 Alternate Audio Decrement
+ 0x180 Application Launch Buttons
+ 0x181 AL Launch Button Configuration Tool
+ 0x182 AL Programmable Button Configuration
+ 0x183 AL Consumer Control Configuration
+ 0x184 AL Word Processor
+ 0x185 AL Text Editor
+ 0x186 AL Spreadsheet
+ 0x187 AL Graphics Editor
+ 0x188 AL Presentation App
+ 0x189 AL Database App
+ 0x18A AL Email Reader
+ 0x18B AL Newsreader
+ 0x18C AL Voicemail
+ 0x18D AL Contacts/Address Book
+ 0x18E AL Calendar/Schedule
+ 0x18F AL Task/Project Manager
+ 0x190 AL Log/Journal/Timecard
+ 0x191 AL Checkbook/Finance
+ 0x192 AL Calculator
+ 0x193 AL A/V Capture/Playback
+ 0x194 AL Local Machine Browser
+ 0x195 AL LAN/WAN Browser
+ 0x196 AL Internet Browser
+ 0x197 AL Remote Networking/ISP Connect
+ 0x198 AL Network Conference
+ 0x199 AL Network Chat
+ 0x19A AL Telephony/Dialer
+ 0x19B AL Logon
+ 0x19C AL Logoff
+ 0x19D AL Logon/Logoff
+ 0x19E AL Terminal Lock/Screensaver
+ 0x19F AL Control Panel
+ 0x1A0 AL Command Line Processor/Run
+ 0x1A1 AL Process/Task Manager
+ 0x1A2 AL Select Tast/Application
+ 0x1A3 AL Next Task/Application
+ 0x1A4 AL Previous Task/Application
+ 0x1A5 AL Preemptive Halt Task/Application
+ 0x200 Generic GUI Application Controls
+ 0x201 AC New
+ 0x202 AC Open
+ 0x203 AC Close
+ 0x204 AC Exit
+ 0x205 AC Maximize
+ 0x206 AC Minimize
+ 0x207 AC Save
+ 0x208 AC Print
+ 0x209 AC Properties
+ 0x21A AC Undo
+ 0x21B AC Copy
+ 0x21C AC Cut
+ 0x21D AC Paste
+ 0x21E AC Select All
+ 0x21F AC Find
+ 0x220 AC Find and Replace
+ 0x221 AC Search
+ 0x222 AC Go To
+ 0x223 AC Home
+ 0x224 AC Back
+ 0x225 AC Forward
+ 0x226 AC Stop
+ 0x227 AC Refresh
+ 0x228 AC Previous Link
+ 0x229 AC Next Link
+ 0x22A AC Bookmarks
+ 0x22B AC History
+ 0x22C AC Subscriptions
+ 0x22D AC Zoom In
+ 0x22E AC Zoom Out
+ 0x22F AC Zoom
+ 0x230 AC Full Screen View
+ 0x231 AC Normal View
+ 0x232 AC View Toggle
+ 0x233 AC Scroll Up
+ 0x234 AC Scroll Down
+ 0x235 AC Scroll
+ 0x236 AC Pan Left
+ 0x237 AC Pan Right
+ 0x238 AC Pan
+ 0x239 AC New Window
+ 0x23A AC Tile Horizontally
+ 0x23B AC Tile Vertically
+ 0x23C AC Format
+
+13 Digitizer
+ 0x00 Undefined
+ 0x01 Digitizer
+ 0x02 Pen
+ 0x03 Light Pen
+ 0x04 Touch Screen
+ 0x05 Touch Pad
+ 0x06 White Board
+ 0x07 Coordinate Measuring Machine
+ 0x08 3-D Digitizer
+ 0x09 Stereo Plotter
+ 0x0A Articulated Arm
+ 0x0B Armature
+ 0x0C Multiple Point Digitizer
+ 0x0D Free Space Wand
+ 0x20 Stylus
+ 0x21 Puck
+ 0x22 Finger
+ 0x30 Tip Pressure
+ 0x31 Barrel Pressure
+ 0x32 In Range
+ 0x33 Touch
+ 0x34 Untouch
+ 0x35 Tap
+ 0x36 Quality
+ 0x37 Data Valid
+ 0x38 Transducer Index
+ 0x39 Tablet Function Keys
+ 0x3A Program Change Keys
+ 0x3B Battery Strength
+ 0x3C Invert
+ 0x3D X Tilt
+ 0x3E Y Tilt
+ 0x3F Azimuth
+ 0x40 Altitude
+ 0x41 Twist
+ 0x42 Tip Switch
+ 0x43 Secondary Tip Switch
+ 0x44 Barrel Switch
+ 0x45 Eraser
+ 0x46 Tablet Pick
+
+15 Physical Interface Device
+
+16 Unicode
+ * Unicode Char u%04x
+
+20 Alphnumeric Display
+ 0x00 Undefined
+ 0x01 Alphanumeric Display
+ 0x20 Display Attributes Report
+ 0x21 ASCII Character Set
+ 0x22 Data Read Back
+ 0x23 Font Read Back
+ 0x24 Display Control Report
+ 0x25 Clear Display
+ 0x26 Display Enable
+ 0x27 Screen Saver Delay
+ 0x28 Screen Saver Enable
+ 0x29 Vertical Scroll
+ 0x2A Horizontal Scroll
+ 0x2B Character Report
+ 0x2C Display Data
+ 0x2D Display Status
+ 0x2E Stat Not Ready
+ 0x2F Stat Ready
+ 0x30 Err Not a loadable character
+ 0x31 Err Font data cannot be read
+ 0x32 Cursor Position Report
+ 0x33 Row
+ 0x34 Column
+ 0x35 Rows
+ 0x36 Columns
+ 0x37 Cursor Pixel Positioning
+ 0x38 Cursor Mode
+ 0x39 Cursor Enable
+ 0x3A Cursor Blink
+ 0x3B Font Report
+ 0x3C Font Data
+ 0x3D Character Width
+ 0x3E Character Height
+ 0x3F Character Spacing Horizontal
+ 0x40 Character Spacing Vertical
+ 0x41 Unicode Character Set
+
+128 Monitor
+ 0x00 Undefined
+ 0x01 Monitor Control
+ 0x02 EDID Information
+ 0x03 VDIF Information
+ 0x04 VESA Version
+ 0x05 On Screen Display
+ 0x06 Auto Size Center
+ 0x07 Polarity Horz Synch
+ 0x08 Polarity Vert Synch
+ 0x09 Sync Type
+ 0x0A Screen Position
+ 0x0B Horizontal Frequency
+ 0x0C Vertical Frequency
+
+129 Monitor Enumerated Values
+ 0x00 unassigned
+ * ENUM %d
+
+130 VESA Virtual Controls
+ 0x10 Brightness
+ 0x12 Contrast
+ 0x16 Video Gain Red
+ 0x18 Video Gain Green
+ 0x1A Video Gain Blue
+ 0x1C Focus
+ 0x20 Horizontal Position
+ 0x22 Horizontal Size
+ 0x24 Horizontal Pincushion
+ 0x26 Horizontal Pincushion Balance
+ 0x28 Horizontal Misconvergence
+ 0x2A Horizontal Linearity
+ 0x2C Horizontal Linearity Balance
+ 0x30 Vertical Position
+ 0x32 Vertical Size
+ 0x34 Vertical Pincushion
+ 0x36 Vertical Pincushion Balance
+ 0x38 Vertical Misconvergence
+ 0x3A Vertical Linearity
+ 0x3C Vertical Linearity Balance
+ 0x40 Parallelogram Distortion
+ 0x42 Trapezoidal Distortion
+ 0x44 Tilt
+ 0x46 Top Corner Distortion Control
+ 0x48 Top Corner Distortion Balance
+ 0x4A Bottom Corner Distortion Control
+ 0x4C Bottom Corner Distortion Balance
+ 0x56 Moiré Horizontal
+ 0x58 Moiré Vertical
+ 0x5E Input Level Select
+ 0x60 Input Source Select
+ 0x62 Stereo Mode
+ 0x6C Video Black Level Red
+ 0x6E Video Black Level Green
+ 0x70 Video Black Level Blue
+
+131 VESA Command
+ 0x00 Undefined
+ 0x01 Settings
+ 0x02 Degauss
+
+132 Power Device
+ 0x00 Undefined
+ 0x01 iName
+ 0x02 PresentStatus
+ 0x03 ChangedStatus
+ 0x04 UPS
+ 0x05 PowerSupply
+ 0x10 BatterySystem
+ 0x11 BatterySystemID
+ 0x12 Battery
+ 0x13 BatteryID
+ 0x14 Charger
+ 0x15 ChargerID
+ 0x16 PowerConverter
+ 0x17 PowerConverterID
+ 0x18 OutletSystem
+ 0x19 OutletSystemID
+ 0x1A Input
+ 0x1B InputID
+ 0x1C Output
+ 0x1D OutputID
+ 0x1E Flow
+ 0x1F FlowID
+ 0x20 Outlet
+ 0x21 OutletID
+ 0x22 Gang
+ 0x23 GangID
+ 0x24 Sink
+ 0x25 SinkID
+ 0x30 Voltage
+ 0x31 Current
+ 0x32 Frequency
+ 0x33 ApparentPower
+ 0x34 ActivePower
+ 0x35 PercentLoad
+ 0x36 Temperature
+ 0x37 Humidity
+ 0x40 ConfigVoltage
+ 0x41 ConfigCurrent
+ 0x42 ConfigFrequency
+ 0x43 ConfigApparentPower
+ 0x44 ConfigActivePower
+ 0x45 ConfigPercentLoad
+ 0x46 ConfigTemperature
+ 0x47 ConfigHumidity
+ 0x50 SwitchOnControl
+ 0x51 SwitchOffControl
+ 0x52 ToggleControl
+ 0x53 LowVoltageTransfer
+ 0x54 HighVoltageTransfer
+ 0x55 DelayBeforeReboot
+ 0x56 DelayBeforeStartup
+ 0x57 DelayBeforeShutdown
+ 0x58 Test
+ 0x59 Vendorspecificcommand
+ 0x60 Present
+ 0x61 Good
+ 0x62 InternalFailure
+ 0x63 VoltageOutOfRange
+ 0x64 FrequencyOutOfRange
+ 0x65 Overload
+ 0x66 OverCharged
+ 0x67 OverTemperature
+ 0x68 ShutdownRequested
+ 0x69 ShutdownImminent
+ 0x6A VendorSpecificAnswerValid
+ 0x6B SwitchOn/Off
+ 0x6C Switcheble
+ 0x6D Used
+ 0x6E Boost
+ 0x6F Buck
+ 0x70 Initialized
+ 0x71 Tested
+
+133 Battery System
+ 0x00 Undefined
+ 0x01 SMBBatteryMode
+ 0x02 SMBBatteryStatus
+ 0x03 SMBAlarmWarning
+ 0x04 SMBChargerMode
+ 0x05 SMBChargerStatus
+ 0x06 SMBChargerSpecInfo
+ 0x07 SMBSelectorState
+ 0x08 SMBSelectorPreset
+ 0x09 SMBSelectorInfo
+ 0x10 OptionalMfgFunction1
+ 0x11 OptionalMfgFunction2
+ 0x12 OptionalMfgFunction3
+ 0x13 OptionalMfgFunction4
+ 0x14 OptionalMfgFunction5
+ 0x15 ConnectionToSMBus
+ 0x16 OutputConnection
+ 0x17 ChargerConnection
+ 0x18 BatteryInsertion
+ 0x19 Usenext
+ 0x1A OKToUse
+ 0x28 ManufacturerAccess
+ 0x29 RemainingCapacityLimit
+ 0x2A RemainingTimeLimit
+ 0x2B AtRate
+ 0x2C CapacityMode
+ 0x2D BroadcastToCharger
+ 0x2E PrimaryBattery
+ 0x2F ChargeController
+ 0x40 TerminateCharge
+ 0x41 TermminateDischarge
+ 0x42 BelowRemainingCapacityLimit
+ 0x43 RemainingTimeLimitExpired
+ 0x44 Charging
+ 0x45 Discharging
+ 0x46 FullyCharged
+ 0x47 FullyDischarged
+ 0x48 ConditionningFlag
+ 0x49 AtRateOK
+ 0x4A SMBErrorCode
+ 0x4B NeedReplacement
+ 0x60 AtRateTimeToFull
+ 0x61 AtRateTimeToEmpty
+ 0x62 AverageCurrent
+ 0x63 Maxerror
+ 0x64 RelativeStateOfCharge
+ 0x65 AbsoluteStateOfCharge
+ 0x66 RemainingCapacity
+ 0x67 FullChargeCapacity
+ 0x68 RunTimeToEmpty
+ 0x69 AverageTimeToEmpty
+ 0x6A AverageTimeToFull
+ 0x6B CycleCount
+ 0x80 BattPackModelLevel
+ 0x81 InternalChargeController
+ 0x82 PrimaryBatterySupport
+ 0x83 DesignCapacity
+ 0x84 SpecificationInfo
+ 0x85 ManufacturerDate
+ 0x86 SerialNumber
+ 0x87 iManufacturerName
+ 0x88 iDevicename
+ 0x89 iDeviceChemistery
+ 0x8A iManufacturerData
+ 0x8B Rechargeable
+ 0x8C WarningCapacityLimit
+ 0x8D CapacityGranularity1
+ 0x8E CapacityGranularity2
+ 0xC0 InhibitCharge
+ 0xC1 EnablePolling
+ 0xC2 ResetToZero
+ 0xD0 ACPresent
+ 0xD1 BatteryPresent
+ 0xD2 PowerFail
+ 0xD3 AlarmInhibited
+ 0xD4 ThermistorUnderRange
+ 0xD5 ThermistorHot
+ 0xD6 ThermistorCold
+ 0xD7 ThermistorOverRange
+ 0xD8 VoltageOutOfRange
+ 0xD9 CurrentOutOfRange
+ 0xDA CurrentNotRegulated
+ 0xDB VoltageNotRegulated
+ 0xDC MasterMode
+ 0xDD ChargerBattery/HostControlled
+ 0xF0 ChargerSpecInfo
+ 0xF1 ChargerSpecRef
+ 0xF2 Level2
+ 0xF3 Level3
+
+140 Bar Code Scanner
+
+141 Scale Device
+
+144 Camera Control
+
+145 Arcade Device
+
+# Some Micro$oft non-standard extensions
+0xff00 Microsoft
+ 0xe9 Base Up
+ 0xea Base Down
diff --git a/hw/xfree86/os-support/bsd/libusb/usbvar.h b/hw/xfree86/os-support/bsd/libusb/usbvar.h
new file mode 100644
index 000000000..cb0bf33ec
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/libusb/usbvar.h
@@ -0,0 +1,34 @@
+/* $NetBSD: usbvar.h,v 1.2 1999/05/11 21:15:46 augustss Exp $ */
+
+/*
+ * Copyright (c) 1999 Lennart Augustsson <augustss@netbsd.org>
+ * 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/libusb/usbvar.h,v 1.1 2000/02/11 18:06:51 dawes Exp $ */
+
+struct report_desc {
+ unsigned int size;
+ unsigned char data[1];
+};
+
diff --git a/hw/xfree86/os-support/bsd/memrange.h b/hw/xfree86/os-support/bsd/memrange.h
new file mode 100644
index 000000000..99be9ea2f
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/memrange.h
@@ -0,0 +1,68 @@
+/*
+ * Memory range attribute operations, peformed on /dev/mem
+ *
+ * $FreeBSD: src/sys/sys/memrange.h,v 1.4 1999/12/29 04:24:44 peter Exp $
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/memrange.h,v 1.1 2002/08/06 13:25:36 herrb Exp $ */
+
+#ifndef _MEMRANGE_H
+#define _MEMRANGE_H
+
+/* Memory range attributes */
+#define MDF_UNCACHEABLE (1<<0) /* region not cached */
+#define MDF_WRITECOMBINE (1<<1) /* region supports "write combine"
+ * action */
+#define MDF_WRITETHROUGH (1<<2) /* write-through cached */
+#define MDF_WRITEBACK (1<<3) /* write-back cached */
+#define MDF_WRITEPROTECT (1<<4) /* read-only region */
+#define MDF_ATTRMASK (0x00ffffff)
+
+#define MDF_FIXBASE (1<<24) /* fixed base */
+#define MDF_FIXLEN (1<<25) /* fixed length */
+#define MDF_FIRMWARE (1<<26) /* set by firmware (XXX not useful?) */
+#define MDF_ACTIVE (1<<27) /* currently active */
+#define MDF_BOGUS (1<<28) /* we don't like it */
+#define MDF_FIXACTIVE (1<<29) /* can't be turned off */
+#define MDF_BUSY (1<<30) /* range is in use */
+
+struct mem_range_desc {
+ u_int64_t mr_base;
+ u_int64_t mr_len;
+ int mr_flags;
+ char mr_owner[8];
+};
+
+struct mem_range_op {
+ struct mem_range_desc *mo_desc;
+ int mo_arg[2];
+#define MEMRANGE_SET_UPDATE 0
+#define MEMRANGE_SET_REMOVE 1
+ /* XXX want a flag that says "set and undo when I exit" */
+};
+#define MEMRANGE_GET _IOWR('m', 50, struct mem_range_op)
+#define MEMRANGE_SET _IOW('m', 51, struct mem_range_op)
+
+#ifdef _KERNEL
+
+struct mem_range_softc;
+struct mem_range_ops {
+ void (*init) __P((struct mem_range_softc * sc));
+ int (*set) __P((struct mem_range_softc * sc, struct mem_range_desc * mrd, int *arg));
+ void (*initAP) __P((struct mem_range_softc * sc));
+};
+
+struct mem_range_softc {
+ struct mem_range_ops *mr_op;
+ int mr_cap;
+ int mr_ndesc;
+ struct mem_range_desc *mr_desc;
+};
+
+extern struct mem_range_softc mem_range_softc;
+
+extern int mem_range_attr_get __P((struct mem_range_desc * mrd, int *arg));
+extern int mem_range_attr_set __P((struct mem_range_desc * mrd, int *arg));
+extern void mem_range_AP_init __P((void));
+#endif
+
+#endif
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
new file mode 100644
index 000000000..4ec7045e8
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -0,0 +1,130 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.3 2002/11/09 17:28:08 herrb Exp $ */
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * 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 names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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.
+ *
+ */
+
+/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#include "bus/Pci.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+#define DEV_MEM "/dev/mem"
+
+static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags);
+static void ppcUnmapVidMem(int, pointer, unsigned long);
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+ pVidMem->linearSupported = TRUE;
+ pVidMem->mapMem = ppcMapVidMem;
+ pVidMem->unmapMem = ppcUnmapVidMem;
+ pVidMem->initialised = TRUE;
+}
+
+
+volatile unsigned char *ioBase = MAP_FAILED;
+
+static pointer
+ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
+{
+ int fd = xf86Info.screenFd;
+ pointer base;
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
+ Base, Size, fd);
+#endif
+
+ base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base);
+ if (base == MAP_FAILED)
+ FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)\n",
+ "xf86MapVidMem", Size, Base, strerror(errno));
+
+ return base;
+}
+
+static void
+ppcUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap(Base, Size);
+}
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ int rv;
+ static int kmem = -1;
+
+ if (kmem == -1) {
+ kmem = open("/dev/xf86", 2);
+ if (kmem == -1) {
+ FatalError("xf86ReadBIOS: open /dev/xf86\n");
+ }
+ }
+
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n",
+ Base, Offset, Len);
+#endif
+
+
+ lseek(kmem, Base + Offset, 0);
+ rv = read(kmem, Buf, Len);
+
+ return rv;
+}
+
+/***************************************************************************/
+/* Interrupt Handling section */
+/***************************************************************************/
+
+Bool
+xf86DisableInterrupts()
+{
+
+ return(TRUE);
+}
+
+void
+xf86EnableInterrupts()
+{
+
+ return;
+}
diff --git a/hw/xfree86/os-support/bsd/sparc64_video.c b/hw/xfree86/os-support/bsd/sparc64_video.c
new file mode 100644
index 000000000..877550154
--- /dev/null
+++ b/hw/xfree86/os-support/bsd/sparc64_video.c
@@ -0,0 +1,106 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/sparc64_video.c,v 1.1 2002/08/06 13:08:39 herrb Exp $ */
+/*
+ * Copyright 1992 by Rich Murphey <Rich@Rice.edu>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * 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 names of Rich Murphey and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Rich Murphey and
+ * David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO
+ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT 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.
+ *
+ */
+
+
+/* $XConsortium: bsd_video.c /main/10 1996/10/25 11:37:57 kaleb $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+static pointer sparc64MapVidMem(int, unsigned long, unsigned long, int);
+static void sparc64UnmapVidMem(int, pointer, unsigned long);
+
+void
+xf86OSInitVidMem(VidMemInfoPtr pVidMem)
+{
+ pVidMem->linearSupported = TRUE;
+ pVidMem->mapMem = sparc64MapVidMem;
+ pVidMem->unmapMem = sparc64UnmapVidMem;
+ pVidMem->initialised = TRUE;
+}
+
+static pointer
+sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size,
+ int flags)
+{
+ int fd = xf86Info.screenFd;
+ pointer base;
+
+#ifdef DEBUG
+ xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d",
+ Base, Size, fd);
+#endif
+
+ base = mmap(0, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base);
+ if (base == MAP_FAILED)
+ FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)\n",
+ "xf86MapVidMem", Size, Base, strerror(errno));
+ return base;
+}
+
+static void
+sparc64UnmapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap(Base, Size);
+}
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+
+ return (0);
+}
+
+/***************************************************************************/
+/* Interrupt Handling section */
+/***************************************************************************/
+
+Bool
+xf86DisableInterrupts()
+{
+
+ return(TRUE);
+}
+
+void
+xf86EnableInterrupts()
+{
+
+ return;
+}
diff --git a/hw/xfree86/os-support/bus/460gxPCI.c b/hw/xfree86/os-support/bus/460gxPCI.c
new file mode 100644
index 000000000..4840fd144
--- /dev/null
+++ b/hw/xfree86/os-support/bus/460gxPCI.c
@@ -0,0 +1,451 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c,v 1.2 2003/01/10 22:05:45 tsi Exp $ */
+/*
+ * Copyright (C) 2002-2003 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+/*
+ * This file contains the glue necessary for support of Intel's 460GX chipset.
+ */
+
+#include "460gxPCI.h"
+#include "xf86.h"
+#include "Pci.h"
+
+/* 460GX register definitions */
+/* SAC at 0:10:0 */
+#define CBN 0x0040
+/* SAC at CBN:0:0 */
+#define DEVNPRES 0x0070
+/* SAC at CBN:1[0-7]:0 */
+#define BUSNO 0x0048
+#define SUBNO 0x0049
+#define VGASE 0x0080
+#define PCIS 0x0084
+#define IOR 0x008C
+#define IORD 0x008E /* CBN:10:0 only */
+/* PXB at CBN:1[0-7]:1 */
+#define ERRCMD 0x0046
+
+static int cbn_460gx = -1;
+static CARD32 cbdevs_460gx = 0;
+static CARD16 iord_460gx;
+static int busno_460gx[8], subno_460gx[8];
+static CARD8 pcis_460gx[8], ior_460gx[8];
+static CARD8 has_err_460gx[8], err_460gx[8];
+static CARD8 iomap_460gx[16]; /* One for each 4k */
+static pciBusFuncs_t BusFuncs_460gx;
+
+static pciConfigPtr
+Verify460GXBus(int bus)
+{
+ pciConfigPtr pPCI;
+
+ if ((bus < 0) || (bus >= pciNumBuses) ||
+ !pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) ||
+ (pPCI->busnum != cbn_460gx) || (pPCI->funcnum != 0) ||
+ (pPCI->devnum < 0x10) || (pPCI->devnum > 0x17))
+ return NULL;
+
+ return pPCI;
+}
+
+/*
+ * This function is called to emulate the various settings in a P2P or CardBus
+ * bridge's control register using one of a 460GX's SAC host bridges.
+ */
+static CARD16
+Control460GXBridge(int bus, CARD16 mask, CARD16 value)
+{
+ pciConfigPtr pPCI;
+ PCITAG tag;
+ CARD16 current = 0;
+ CARD8 tmp;
+
+ if ((pPCI = Verify460GXBus(bus))) {
+ /* Start with VGA enablement */
+ tmp = pciReadByte(pPCI->tag, VGASE);
+ if (tmp & 0x01) {
+ current |= PCI_PCI_BRIDGE_VGA_EN;
+ if ((mask & PCI_PCI_BRIDGE_VGA_EN) &&
+ !(value & PCI_PCI_BRIDGE_VGA_EN))
+ pciWriteByte(pPCI->tag, VGASE, tmp & ~0x01);
+ } else {
+ if (mask & value & PCI_PCI_BRIDGE_VGA_EN)
+ pciWriteByte(pPCI->tag, VGASE, tmp | 0x01);
+ }
+
+ /* Move on to master abort failure enablement */
+ if (has_err_460gx[pPCI->devnum - 0x10]) {
+ tag = PCI_MAKE_TAG(pPCI->busnum, pPCI->devnum, pPCI->funcnum + 1);
+ tmp = pciReadByte(tag, ERRCMD);
+ if (tmp & 0x01) {
+ current |= PCI_PCI_BRIDGE_MASTER_ABORT_EN;
+ if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) &&
+ !(value & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
+ pciWriteByte(tag, ERRCMD, tmp & ~0x01);
+ } else {
+ if (mask & value & PCI_PCI_BRIDGE_MASTER_ABORT_EN)
+ pciWriteByte(tag, ERRCMD, tmp | 0x01);
+ }
+ }
+
+ /* Put emulation of any other P2P bridge control here */
+ }
+
+ return (current & ~mask) | (value & mask);
+}
+
+/*
+ * Retrieve various bus numbers representing the connections provided by 460GX
+ * host bridges.
+ */
+static void
+Get460GXBridgeBusses(int bus, int *primary, int *secondary, int *subordinate)
+{
+ pciConfigPtr pPCI = Verify460GXBus(bus);
+ int i;
+
+ /* The returned bus numbers are initialised by the caller */
+
+ if (!pPCI)
+ return;
+
+ i = pPCI->devnum - 0x10;
+
+ /* These are not modified, so no need to re-read them */
+ if (primary)
+ *primary = pPCI->busnum;
+ if (secondary)
+ *secondary = busno_460gx[i];
+ if (subordinate)
+ *subordinate = subno_460gx[i];
+}
+
+/* Retrieves a list of the resources routed to a host bridge's secondary bus */
+static void
+Get460GXBridgeResources(int bus,
+ pointer *ppIoRes,
+ pointer *ppMemRes,
+ pointer *ppPmemRes)
+{
+ pciConfigPtr pPCI = Verify460GXBus(bus);
+ resRange range;
+ unsigned int i, j;
+
+ if (ppIoRes) {
+ xf86FreeResList(*ppIoRes);
+ *ppIoRes = NULL;
+
+ if (pPCI) {
+ for (i = 0; i <= 0x0F; i++) {
+ if (iomap_460gx[i] != pPCI->devnum)
+ continue;
+
+ RANGE(range, i << 12, ((i + 1) << 12) - 1,
+ RANGE_TYPE(ResExcIoBlock, 0));
+ *ppIoRes = xf86AddResToList(*ppIoRes, &range, -1);
+ }
+ }
+ }
+
+ if (ppMemRes) {
+ xf86FreeResList(*ppMemRes);
+ *ppMemRes = NULL;
+
+ if (pPCI) {
+ if (!(i = (pPCI->devnum - 0x10)))
+ j = 127; /* (4GB - 32M) / 32M */
+ else
+ j = pcis_460gx[i - 1] & 0x7F;
+
+ i = pcis_460gx[i] & 0x7F;
+ if (i < j) {
+ RANGE(range, i << 25, (j << 25) - 1,
+ RANGE_TYPE(ResExcMemBlock, 0));
+ *ppMemRes = xf86AddResToList(*ppMemRes, &range, -1);
+ }
+ }
+ }
+
+ if (ppPmemRes) {
+ xf86FreeResList(*ppPmemRes);
+ *ppPmemRes = NULL;
+ }
+}
+
+/*
+ * This checks for, and validates, the presence of the 460GX chipset, and sets
+ * cbn_460gx to a positive value accordingly. This function returns TRUE if
+ * the chipset scan is to be stopped, or FALSE if the scan is to move on to the
+ * next chipset.
+ */
+Bool
+xf86PreScan460GX(void)
+{
+ pciBusInfo_t *pBusInfo;
+ PCITAG tag;
+ CARD32 tmp;
+ int i, devno;
+
+ /* Bus zero should already be set up */
+ if (!(pBusInfo = pciBusInfo[0])) {
+ cbn_460gx = -1;
+ return FALSE;
+ }
+
+ /* First look for a 460GX's primary host bridge */
+ tag = PCI_MAKE_TAG(0, 0x10, 0);
+ if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 460GX_SAC)) {
+ cbn_460gx = -1;
+ return FALSE;
+ }
+
+ /* Get CBN (Chipset bus number) */
+ if (!(cbn_460gx = (unsigned int)pciReadByte(tag, CBN))) {
+ /* Sanity check failed */
+ cbn_460gx = -1;
+ return TRUE;
+ }
+
+ if (pciNumBuses <= cbn_460gx)
+ pciNumBuses = cbn_460gx + 1;
+
+ /* Set up bus CBN */
+ if (!pciBusInfo[cbn_460gx]) {
+ pciBusInfo[cbn_460gx] = xnfalloc(sizeof(pciBusInfo_t));
+ *pciBusInfo[cbn_460gx] = *pBusInfo;
+ }
+
+ tag = PCI_MAKE_TAG(cbn_460gx, 0, 0);
+ if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 460GX_SAC)) {
+ /* Sanity check failed */
+ cbn_460gx = -1;
+ return TRUE;
+ }
+
+ /*
+ * Find out which CBN devices the firmware thinks are present. Of these,
+ * we are only interested in devices 0x10 through 0x17.
+ */
+ cbdevs_460gx = pciReadLong(tag, DEVNPRES);
+
+ for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
+ tag = PCI_MAKE_TAG(cbn_460gx, devno, 0);
+ if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 460GX_SAC)) {
+ /* Sanity check failed */
+ cbn_460gx = -1;
+ return TRUE;
+ }
+
+ if (devno == 0x10)
+ iord_460gx = pciReadWord(tag, IORD);
+
+ busno_460gx[i] = (unsigned int)pciReadByte(tag, BUSNO);
+ subno_460gx[i] = (unsigned int)pciReadByte(tag, SUBNO);
+ pcis_460gx[i] = pciReadByte(tag, PCIS);
+ ior_460gx[i] = pciReadByte(tag, IOR);
+
+ has_err_460gx[i] = err_460gx[i] = 0; /* Insurance */
+
+ tag = PCI_MAKE_TAG(cbn_460gx, devno, 1);
+ tmp = pciReadLong(tag, PCI_ID_REG);
+ switch (tmp) {
+ case DEVID(INTEL, 460GX_PXB):
+ case DEVID(INTEL, 460GX_WXB):
+ if (cbdevs_460gx & (1 << devno)) {
+ /* Sanity check failed */
+ cbn_460gx = -1;
+ return TRUE;
+ }
+
+ /*
+ * XXX I don't have WXB docs, but PCI register dumps indicate that
+ * the registers we are interested in are consistent with those of
+ * the PXB.
+ */
+ err_460gx[i] = pciReadByte(tag, ERRCMD);
+ has_err_460gx[i] = 1;
+ break;
+
+ case DEVID(INTEL, 460GX_GXB_1):
+ if (cbdevs_460gx & (1 << devno)) {
+ /* Sanity check failed */
+ cbn_460gx = -1;
+ return TRUE;
+ }
+
+ /*
+ * XXX GXB isn't documented to have an ERRCMD register, nor any
+ * other means of failing master aborts. For now, assume master
+ * aborts are always allowed to complete normally.
+ */
+ break;
+
+ default:
+ if (((CARD16)(tmp + 1U) <= (CARD16)1U) &&
+ (cbdevs_460gx & (1U << devno)))
+ break;
+ /* Sanity check failed */
+ cbn_460gx = -1;
+ return TRUE;
+ }
+ }
+
+ /* Allow master aborts to complete normally */
+ for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
+ if (!(err_460gx[i] & 0x01))
+ continue;
+
+ pciWriteByte(PCI_MAKE_TAG(cbn_460gx, devno, 1),
+ ERRCMD, err_460gx[i] & ~0x01);
+ }
+
+ /*
+ * The 460GX spec says that any access to busses higher than CBN will be
+ * master-aborted. It seems possible however that this is not the case in
+ * all 460GX implementations. For now, limit the bus scan to CBN, unless
+ * we have already found a higher bus number.
+ */
+ for (i = 0; subno_460gx[i] < cbn_460gx; ) {
+ if (++i < 8)
+ continue;
+
+ pciMaxBusNum = cbn_460gx + 1;
+ break;
+ }
+
+ return TRUE;
+}
+
+/* This does some 460GX-related processing after the PCI bus scan */
+void
+xf86PostScan460GX(void)
+{
+ pciConfigPtr pPCI, *ppPCI;
+ pciBusInfo_t *pBusInfo;
+ int i, j, devno;
+
+ if (cbn_460gx <= 0)
+ return;
+
+ /* Set up our extra bus functions */
+ BusFuncs_460gx = *(pciBusInfo[0]->funcs);
+ BusFuncs_460gx.pciControlBridge = Control460GXBridge;
+ BusFuncs_460gx.pciGetBridgeBusses = Get460GXBridgeBusses;
+ BusFuncs_460gx.pciGetBridgeResources = Get460GXBridgeResources;
+
+ /*
+ * Mark all host bridges so that they are ignored by the upper-level
+ * xf86GetPciBridgeInfo() function. This marking is later clobbered by the
+ * tail end of xf86scanpci() for those bridges that actually have bus
+ * segments associated with them.
+ */
+ ppPCI = xf86scanpci(0); /* Recursion is only apparent */
+ while ((pPCI = *ppPCI++)) {
+ if ((pPCI->pci_base_class == PCI_CLASS_BRIDGE) &&
+ (pPCI->pci_sub_class == PCI_SUBCLASS_BRIDGE_HOST))
+ pPCI->businfo = HOST_NO_BUS;
+ }
+
+ ppPCI = xf86scanpci(0); /* Recursion is only apparent */
+ j = 0;
+
+ /*
+ * Fix up CBN bus linkage. This is somewhat arbitrary. The bridge chosen
+ * for this must be a CBN device so that bus CBN can be recognised as the
+ * root segment. It also cannot be any of the bus expanders (devices
+ * CBN:0x10:0 through CBN:0x17:0 nor any of their functions). For now, we
+ * chose the SAC host bridge at CBN:0:0.
+ */
+ pBusInfo = pciBusInfo[cbn_460gx];
+ pBusInfo->bridge = pciBusInfo[0]->bridge; /* Just in case */
+ while ((pPCI = *ppPCI++)) {
+ if (pPCI->busnum < cbn_460gx)
+ continue;
+ if (pPCI->busnum > cbn_460gx)
+ break;
+ if (pPCI->devnum < 0)
+ continue;
+ if (pPCI->devnum > 0)
+ break;
+ if (pPCI->funcnum < 0)
+ continue;
+ if (pPCI->funcnum > 0)
+ break;
+
+ pBusInfo->bridge = pPCI;
+ pBusInfo->secondary = FALSE;
+ pBusInfo->primary_bus = cbn_460gx;
+ break;
+ }
+
+ for (i = 0, devno = 0x10; devno <= 0x17; i++, devno++) {
+ /* Restore ERRCMD registers */
+ if (err_460gx[i] & 0x01)
+ pciWriteByte(PCI_MAKE_TAG(cbn_460gx, devno, 1),
+ ERRCMD, err_460gx[i]);
+
+ if (!(cbdevs_460gx & (1 << devno))) {
+ while ((pPCI = *ppPCI++)) {
+ if (pPCI->busnum < cbn_460gx)
+ continue;
+ if (pPCI->busnum > cbn_460gx)
+ break;
+ if (pPCI->devnum < devno)
+ continue;
+ if (pPCI->devnum > devno)
+ break;
+ if (pPCI->funcnum < 0)
+ continue;
+ if (pPCI->funcnum > 0)
+ break;
+
+ if ((pBusInfo = pciBusInfo[busno_460gx[i]]))
+ break;
+
+ /* Fix bus linkage */
+ pBusInfo->bridge = pPCI;
+ pBusInfo->secondary = TRUE;
+ pBusInfo->primary_bus = cbn_460gx;
+
+ /* Plug in chipset routines */
+ pBusInfo->funcs = &BusFuncs_460gx;
+ break;
+ }
+ }
+
+ /* Decode IOR registers */
+ for(; j <= (ior_460gx[i] & 0x0F); j++)
+ iomap_460gx[j] = devno;
+ }
+
+ /* The bottom 4k of I/O space is always routed to PCI0a */
+ iomap_460gx[0] = 0x10;
+
+ /* Decode IORD register */
+ for (j = 1; j <= 0x0F; j++)
+ if (iord_460gx & (1 << j))
+ iomap_460gx[j] = 0x10;
+}
diff --git a/hw/xfree86/os-support/bus/460gxPCI.h b/hw/xfree86/os-support/bus/460gxPCI.h
new file mode 100644
index 000000000..2ae9c3528
--- /dev/null
+++ b/hw/xfree86/os-support/bus/460gxPCI.h
@@ -0,0 +1,36 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.h,v 1.1 2003/01/02 18:12:48 tsi Exp $ */
+/*
+ * Copyright (C) 2002-2003 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifndef PCI_460GX_H
+#define PCI_460GX_H 1
+
+#include <X11/Xdefs.h>
+
+Bool xf86PreScan460GX(void);
+void xf86PostScan460GX(void);
+
+#endif
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
new file mode 100644
index 000000000..c7777827d
--- /dev/null
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -0,0 +1,1456 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.71.2.2 2003/05/06 17:00:45 tsi Exp $ */
+/*
+ * Pci.c - New server PCI access functions
+ *
+ * The XFree86 server PCI access functions have been reimplemented as a
+ * framework that allows each supported platform/OS to have their own
+ * platform/OS specific pci driver.
+ *
+ * All of the public PCI access functions exported to the other parts of
+ * the server are declared in Pci.h and defined herein. These include:
+ * pciInit() - Initialize PCI access functions
+ * pciFindFirst() - Find a PCI device by dev/vend id
+ * pciFindNext() - Find another PCI device by dev/vend id
+ * pciReadLong() - Read a 32 bit value from a device's cfg space
+ * pciReadWord() - Read a 16 bit value from a device's cfg space
+ * pciReadByte() - Read an 8 bit value from a device's cfg space
+ * pciWriteLong() - Write a 32 bit value to a device's cfg space
+ * pciWriteWord() - Write a 16 bit value to a device's cfg space
+ * pciWriteByte() - Write an 8 bit value to a device's cfg space
+ * pciSetBitsLong() - Write a 32 bit value against a mask
+ * pciSetBitsByte() - Write an 8 bit value against a mask
+ * pciLongFunc() - Return pointer to the requested low level
+ * function
+ * pciTag() - Return tag for a given PCI bus, device, &
+ * function
+ * pciBusAddrToHostAddr() - Convert a PCI address to a host address
+ * pciHostAddrToBusAddr() - Convert a host address to a PCI address
+ * pciGetBaseSize() - Returns the number of bits in a PCI base
+ * addr mapping
+ * xf86MapPciMem() - Like xf86MapVidMem() except function expects
+ * a PCI address and a PCITAG that identifies
+ * a PCI device
+ * xf86ReadPciBIOS() - Like xf86ReadBIOS() but can handle PCI/host
+ * address translation and BIOS decode enabling
+ * xf86scanpci() - Return info about all PCI devices
+ * xf86GetPciDomain() - Return domain number from a PCITAG
+ * xf86MapDomainMemory() - Like xf86MapPciMem() but can handle
+ * domain/host address translation
+ * xf86MapDomainIO() - Maps PCI I/O spaces
+ * xf86ReadDomainMemory() - Like xf86ReadPciBIOS() but can handle
+ * domain/host address translation
+ *
+ * The actual PCI backend driver is selected by the pciInit() function
+ * (see below) using either compile time definitions, run-time checks,
+ * or both.
+ *
+ * Certain generic functions are provided that make the implementation
+ * of certain well behaved platforms (e.g. those supporting PCI config
+ * mechanism 1 or some thing close to it) very easy.
+ *
+ * Less well behaved platforms/OS's can roll their own functions.
+ *
+ * To add support for another platform/OS, add a call to fooPciInit() within
+ * pciInit() below under the correct compile time definition or run-time
+ * conditional.
+ *
+ * The fooPciInit() procedure must do three things:
+ * 1) Initialize the pciBusTable[] for all primary PCI buses including
+ * the per domain PCI access functions (readLong, writeLong,
+ * addrBusToHost, and addrHostToBus).
+ *
+ * 2) Add entries to pciBusTable[] for configured secondary buses. This
+ * step may be skipped if a platform is using the generic findFirst/
+ * findNext functions because these procedures will automatically
+ * discover and add secondary buses dynamically.
+ *
+ * 3) Overide default settings for global PCI access functions if
+ * required. These include pciFindFirstFP, pciFindNextFP,
+ * Of course, if you choose not to use one of the generic
+ * functions, you will need to provide a platform specifc replacement.
+ *
+ * Gary Barton
+ * Concurrent Computer Corporation
+ * garyb@gate.net
+ *
+ */
+
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ *
+ * This software is derived from the original XFree86 PCI code
+ * which includes the following copyright notices as well:
+ *
+ * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
+ *
+ * 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 names of the above listed copyright holder(s)
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holder(s) make(s) no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * This code is also based heavily on the code in FreeBSD-current, which was
+ * written by Wolfgang Stanglmeier, and contains the following copyright:
+ *
+ * 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 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.
+ *
+ */
+#include <errno.h>
+#include <signal.h>
+#include "Xarch.h"
+#include "compiler.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+#include "Pci.h"
+
+#define PCI_MFDEV_SUPPORT 1 /* Include PCI multifunction device support */
+#define PCI_BRIDGE_SUPPORT 1 /* Include support for PCI-to-PCI bridges */
+
+#ifdef PC98
+#define outb(port,data) _outb(port,data)
+#define outl(port,data) _outl(port,data)
+#define inb(port) _inb(port)
+#define inl(port) _inl(port)
+#endif
+
+/*
+ * Global data
+ */
+static int pciInitialized = 0;
+
+CARD32 pciDevid; /* Requested device/vendor ID (after mask) */
+CARD32 pciDevidMask; /* Bit mask applied (AND) before comparison */
+ /* of real devid's with requested */
+
+int pciBusNum; /* Bus Number of current device */
+int pciDevNum; /* Device number of current device */
+int pciFuncNum; /* Function number of current device */
+PCITAG pciDeviceTag; /* Tag for current device */
+
+pciBusInfo_t *pciBusInfo[MAX_PCI_BUSES] = { NULL, };
+int pciNumBuses = 0; /* Actual number of PCI buses */
+int pciMaxBusNum = MAX_PCI_BUSES;
+static Bool inProbe = FALSE;
+
+static pciConfigPtr pci_devp[MAX_PCI_DEVICES + 1] = {NULL, };
+
+/*
+ * Platform specific PCI function pointers.
+ *
+ * NOTE: A platform/OS specific pci init procedure can override these defaults
+ * by setting them to the appropriate platform dependent functions.
+ */
+PCITAG (*pciFindFirstFP)(void) = pciGenFindFirst;
+PCITAG (*pciFindNextFP)(void) = pciGenFindNext;
+
+/*
+ * pciInit - choose correct platform/OS specific PCI init routine
+ */
+void
+pciInit()
+{
+ if (pciInitialized)
+ return;
+
+ pciInitialized = 1;
+
+ /* XXX */
+#if defined(DEBUGPCI)
+ if (DEBUGPCI >= xf86Verbose)
+ xf86Verbose = DEBUGPCI;
+#endif
+
+ ARCH_PCI_INIT();
+#if defined(ARCH_PCI_OS_INIT)
+ if (pciNumBuses <= 0)
+ ARCH_PCI_OS_INIT();
+#endif
+}
+
+PCITAG
+pciFindFirst(CARD32 id, CARD32 mask)
+{
+#ifdef DEBUGPCI
+ ErrorF("pciFindFirst(0x%lx, 0x%lx), pciInit = %d\n", id, mask, pciInitialized);
+#endif
+ pciInit();
+
+ pciDevid = id & mask;
+ pciDevidMask = mask;
+
+ return((*pciFindFirstFP)());
+}
+
+PCITAG
+pciFindNext(void)
+{
+#ifdef DEBUGPCI
+ ErrorF("pciFindNext(), pciInit = %d\n", pciInitialized);
+#endif
+ pciInit();
+
+ return((*pciFindNextFP)());
+}
+
+CARD32
+pciReadLong(PCITAG tag, int offset)
+{
+ int bus = PCI_BUS_FROM_TAG(tag);
+
+#ifdef DEBUGPCI
+ ErrorF("pciReadLong(0x%lx, %d)\n", tag, offset);
+#endif
+ pciInit();
+
+ if ((bus >= 0) && ((bus < pciNumBuses) || inProbe) && pciBusInfo[bus] &&
+ pciBusInfo[bus]->funcs->pciReadLong) {
+ CARD32 rv = (*pciBusInfo[bus]->funcs->pciReadLong)(tag, offset);
+
+ PCITRACE(1, ("pciReadLong: tag=0x%x [b=%d,d=%d,f=%d] returns 0x%08x\n",
+ tag, bus, PCI_DEV_FROM_TAG(tag), PCI_FUNC_FROM_TAG(tag), rv));
+ return(rv);
+ }
+
+ return(PCI_NOT_FOUND);
+}
+
+CARD16
+pciReadWord(PCITAG tag, int offset)
+{
+ CARD32 tmp;
+ int shift = (offset & 3) * 8;
+ int aligned_offset = offset & ~3;
+
+ if (shift != 0 && shift != 16)
+ FatalError("pciReadWord: Alignment error: Cannot read 16 bits "
+ "at offset %d\n", offset);
+
+ tmp = pciReadLong(tag, aligned_offset);
+
+ return((CARD16)((tmp >> shift) & 0xffff));
+}
+
+CARD8
+pciReadByte(PCITAG tag, int offset)
+{
+ CARD32 tmp;
+ int shift = (offset & 3) * 8;
+ int aligned_offset = offset & ~3;
+
+ tmp = pciReadLong(tag, aligned_offset);
+
+ return((CARD8)((tmp >> shift) & 0xff));
+}
+
+void
+pciWriteLong(PCITAG tag, int offset, CARD32 val)
+{
+ int bus = PCI_BUS_FROM_TAG(tag);
+
+ pciInit();
+
+ if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
+ pciBusInfo[bus]->funcs->pciWriteLong)
+ (*pciBusInfo[bus]->funcs->pciWriteLong)(tag, offset, val);
+}
+
+void
+pciWriteWord(PCITAG tag, int offset, CARD16 val)
+{
+ CARD32 tmp;
+ int aligned_offset = offset & ~3;
+ int shift = (offset & 3) * 8;
+
+ if (shift != 0 && shift != 16)
+ FatalError("pciWriteWord: Alignment Error: Cannot read 16 bits "
+ "from offset %d\n", offset);
+
+ tmp = pciReadLong(tag, aligned_offset);
+
+ tmp &= ~(0xffffL << shift);
+ tmp |= (((CARD32)val) << shift);
+
+ pciWriteLong(tag, aligned_offset, tmp);
+}
+
+void
+pciWriteByte(PCITAG tag, int offset, CARD8 val)
+{
+ CARD32 tmp;
+ int aligned_offset = offset & ~3;
+ int shift = (offset & 3) *8 ;
+
+ tmp = pciReadLong(tag, aligned_offset);
+
+ tmp &= ~(0xffL << shift);
+ tmp |= (((CARD32)val) << shift);
+
+ pciWriteLong(tag, aligned_offset, tmp);
+}
+
+void
+pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val)
+{
+ int bus = PCI_BUS_FROM_TAG(tag);
+
+#ifdef DEBUGPCI
+ ErrorF("pciReadLong(0x%lx, %d)\n", tag, offset);
+#endif
+ pciInit();
+
+ if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
+ pciBusInfo[bus]->funcs->pciReadLong) {
+ (*pciBusInfo[bus]->funcs->pciSetBitsLong)(tag, offset, mask, val);
+ }
+}
+
+void
+pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val)
+{
+ CARD32 tmp_mask, tmp_val;
+ int aligned_offset = offset & ~3;
+ int shift = (offset & 3) *8 ;
+
+ tmp_mask = mask << shift;
+ tmp_val = val << shift;
+ pciSetBitsLong(tag, aligned_offset, tmp_mask, tmp_val);
+}
+
+pointer
+pciLongFunc(PCITAG tag, pciFunc func)
+{
+ int bus = PCI_BUS_FROM_TAG(tag);
+
+ pciInit();
+
+ if ((bus < 0) || (bus > pciNumBuses) || !pciBusInfo[bus] ||
+ !pciBusInfo[bus]->funcs->pciReadLong) return NULL;
+
+ switch (func) {
+ case WRITE:
+ return (void *)pciBusInfo[bus]->funcs->pciWriteLong;
+ case READ:
+ return (void *)pciBusInfo[bus]->funcs->pciReadLong;
+ case SET_BITS:
+ return (void *)pciBusInfo[bus]->funcs->pciSetBitsLong;
+ }
+ return NULL;
+}
+
+ADDRESS
+pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
+{
+ int bus = PCI_BUS_FROM_TAG(tag);
+
+ pciInit();
+
+ if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
+ pciBusInfo[bus]->funcs->pciAddrBusToHost)
+ return (*pciBusInfo[bus]->funcs->pciAddrBusToHost)(tag, type, addr);
+ else
+ return(addr);
+}
+
+ADDRESS
+pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
+{
+ int bus = PCI_BUS_FROM_TAG(tag);
+
+ pciInit();
+
+ if ((bus >= 0) && (bus < pciNumBuses) && pciBusInfo[bus] &&
+ pciBusInfo[bus]->funcs->pciAddrHostToBus)
+ return (*pciBusInfo[bus]->funcs->pciAddrHostToBus)(tag, type, addr);
+ else
+ return(addr);
+}
+
+/*
+ * pciGetBaseSize() returns the size of a PCI base address mapping in bits.
+ * The index identifies the base register: 0-5 are the six standard registers,
+ * and 6 is the ROM base register. If destructive is TRUE, it will write
+ * to the base address register to get an accurate result. Otherwise it
+ * makes a conservative guess based on the alignment of the already allocated
+ * address. If the result is accurate (ie, not an over-estimate), this is
+ * indicated by setting *min to TRUE (when min is non-NULL). This currently
+ * only happens when the destructive flag is set, but in future it may be
+ * possible to get the information from the OS when supported.
+ */
+
+int
+pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min)
+{
+ int offset;
+ CARD32 addr1;
+ CARD32 addr2;
+ CARD32 mask1;
+ CARD32 mask2;
+ int bits = 0;
+
+ /*
+ * Eventually a function for this should be added to pciBusFuncs_t, but for
+ * now we'll just use a simple method based on the alignment of the already
+ * allocated address.
+ */
+
+ /*
+ * silently ignore bogus index values. Valid values are 0-6. 0-5 are
+ * the 6 base address registers, and 6 is the ROM base address register.
+ */
+ if (index < 0 || index > 6)
+ return 0;
+
+ pciInit();
+
+ if (xf86GetPciSizeFromOS(tag, index, &bits)) {
+ if (min)
+ *min = TRUE;
+ return bits;
+ }
+
+ if (min)
+ *min = destructive;
+
+ /* Get the PCI offset */
+ if (index == 6)
+ offset = PCI_MAP_ROM_REG;
+ else
+ offset = PCI_MAP_REG_START + (index << 2);
+
+ addr1 = pciReadLong(tag, offset);
+ /*
+ * Check if this is the second part of a 64 bit address.
+ * XXX need to check how endianness affects 64 bit addresses.
+ */
+ if (index > 0 && index < 6) {
+ addr2 = pciReadLong(tag, offset - 4);
+ if (PCI_MAP_IS_MEM(addr2) && PCI_MAP_IS64BITMEM(addr2))
+ return 0;
+ }
+
+ if (destructive) {
+ pciWriteLong(tag, offset, 0xffffffff);
+ mask1 = pciReadLong(tag, offset);
+ pciWriteLong(tag, offset, addr1);
+ } else {
+ mask1 = addr1;
+ }
+
+ /* Check if this is the first part of a 64 bit address. */
+ if (index < 5 && PCI_MAP_IS_MEM(mask1) && PCI_MAP_IS64BITMEM(mask1)) {
+ if (PCIGETMEMORY(mask1) == 0) {
+ addr2 = pciReadLong(tag, offset + 4);
+ if (destructive) {
+ pciWriteLong(tag, offset + 4, 0xffffffff);
+ mask2 = pciReadLong(tag, offset + 4);
+ pciWriteLong(tag, offset + 4, addr2);
+ } else {
+ mask2 = addr2;
+ }
+ if (mask2 == 0)
+ return 0;
+ bits = 32;
+ while ((mask2 & 1) == 0) {
+ bits++;
+ mask2 >>= 1;
+ }
+ if (bits > 32)
+ return bits;
+ }
+ }
+ if (index < 6)
+ if (PCI_MAP_IS_MEM(mask1))
+ mask1 = PCIGETMEMORY(mask1);
+ else
+ mask1 = PCIGETIO(mask1);
+ else
+ mask1 = PCIGETROM(mask1);
+ if (mask1 == 0)
+ return 0;
+ bits = 0;
+ while ((mask1 & 1) == 0) {
+ bits++;
+ mask1 >>= 1;
+ }
+ /* I/O maps can be no larger than 8 bits */
+
+#if defined(Lynx) && defined(__powerpc__)
+ if (PCI_MAP_IS_IO(addr1) && bits > 8)
+#else
+ if ((index < 6) && PCI_MAP_IS_IO(addr1) && bits > 8)
+#endif
+ bits = 8;
+ /* ROM maps can be no larger than 24 bits */
+ if (index == 6 && bits > 24)
+ bits = 24;
+ return bits;
+}
+
+PCITAG
+pciTag(int busnum, int devnum, int funcnum)
+{
+ return(PCI_MAKE_TAG(busnum,devnum,funcnum));
+}
+
+Bool
+pciMfDev(int busnum, int devnum)
+{
+ PCITAG tag0, tag1;
+ unsigned long id0, id1, val;
+
+ /* Detect a multi-function device that complies to the PCI 2.0 spec */
+
+ tag0 = PCI_MAKE_TAG(busnum, devnum, 0);
+ id0 = pciReadLong(tag0, PCI_ID_REG);
+ if (id0 == 0xffffffff)
+ return FALSE;
+
+ val = pciReadLong(tag0, PCI_HEADER_MISC) & 0x00ff0000;
+ if ((val != 0x00ff0000) && (val & PCI_HEADER_MULTIFUNCTION))
+ return TRUE;
+
+ /*
+ * Now, to find non-compliant devices...
+ * If there is a valid ID for function 1 and the ID for func 0 and 1
+ * are different, or the base0 values of func 0 and 1 are differend,
+ * then assume there is a multi-function device.
+ */
+ tag1 = PCI_MAKE_TAG(busnum, devnum, 1);
+ id1 = pciReadLong(tag1, PCI_ID_REG);
+ if (id1 == 0xffffffff || id1 == 0x00000000)
+ return FALSE;
+
+ if ((id0 != id1) ||
+ (pciReadLong(tag0, PCI_MAP_REG_START) !=
+ pciReadLong(tag1, PCI_MAP_REG_START)))
+ return TRUE;
+
+ return FALSE;
+}
+
+/*
+ * Generic find/read/write functions
+ */
+PCITAG
+pciGenFindNext(void)
+{
+ CARD32 devid, tmp;
+ int sec_bus, pri_bus;
+ static int previousBus = 0;
+ Bool speculativeProbe = FALSE;
+ unsigned char base_class, sub_class;
+
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext\n");
+#endif
+
+ for (;;) {
+
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum);
+#endif
+ if (pciBusNum == -1) {
+ /*
+ * Start at top of the order
+ */
+ if (pciNumBuses <= 0)
+ return(PCI_NOT_FOUND);
+
+ /* Skip ahead to the first bus defined by pciInit() */
+ for (pciBusNum = 0; !pciBusInfo[pciBusNum]; ++pciBusNum);
+ pciFuncNum = 0;
+ pciDevNum = 0;
+ previousBus = pciBusNum; /* make sure previousBus exists */
+ } else {
+#ifdef PCI_MFDEV_SUPPORT
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: pciFuncNum %d\n", pciFuncNum);
+#endif
+ /*
+ * Somewhere in middle of order. Determine who's
+ * next up
+ */
+ if (pciFuncNum == 0) {
+ /*
+ * Is current dev a multifunction device?
+ */
+ if (!speculativeProbe && pciMfDev(pciBusNum, pciDevNum))
+ /* Probe for other functions */
+ pciFuncNum = 1;
+ else
+ /*
+ * No more functions this device. Next
+ * device please
+ */
+ pciDevNum ++;
+ } else if (++pciFuncNum >= 8) {
+ /* No more functions for this device. Next device please */
+ pciFuncNum = 0;
+ pciDevNum ++;
+ }
+#else
+ pciDevNum ++;
+#endif
+ if (pciDevNum >= 32 ||
+ !pciBusInfo[pciBusNum] ||
+ pciDevNum >= pciBusInfo[pciBusNum]->numDevices) {
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: next bus\n");
+#endif
+ /*
+ * No more devices for this bus. Next bus please
+ */
+ if (speculativeProbe) {
+ xfree(pciBusInfo[pciBusNum]);
+ pciBusInfo[pciBusNum] = NULL;
+ speculativeProbe = FALSE;
+ }
+
+ if (++pciBusNum >= pciMaxBusNum) {
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: out of buses\n");
+#endif
+ /* No more buses. All done for now */
+ return(PCI_NOT_FOUND);
+ }
+
+ pciDevNum = 0;
+ }
+ }
+
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: pciBusInfo[%d] = 0x%lx\n", pciBusNum, pciBusInfo[pciBusNum]);
+#endif
+ if (!pciBusInfo[pciBusNum]) {
+ pciBusInfo[pciBusNum] = xnfalloc(sizeof(pciBusInfo_t));
+ *pciBusInfo[pciBusNum] = *pciBusInfo[previousBus];
+
+ speculativeProbe = TRUE;
+ }
+
+ /*
+ * At this point, pciBusNum, pciDevNum, and pciFuncNum have been
+ * advanced to the next device. Compute the tag, and read the
+ * device/vendor ID field.
+ */
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: [%d, %d, %d]\n", pciBusNum, pciDevNum, pciFuncNum);
+#endif
+ pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum);
+ inProbe = TRUE;
+ devid = pciReadLong(pciDeviceTag, 0);
+ inProbe = FALSE;
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid);
+#endif
+ if ((CARD16)(devid + 1U) <= (CARD16)1UL)
+ continue; /* Nobody home. Next device please */
+
+ if (pciNumBuses <= pciBusNum)
+ pciNumBuses = pciBusNum + 1;
+
+ speculativeProbe = FALSE;
+ previousBus = pciBusNum;
+
+ /*
+ * Before checking for a specific devid, look for enabled
+ * PCI to PCI bridge devices. If one is found, create and
+ * initialize a bus info record (if one does not already exist).
+ */
+#ifdef PCI_BRIDGE_SUPPORT
+ tmp = pciReadLong(pciDeviceTag, PCI_CLASS_REG);
+ base_class = PCI_CLASS_EXTRACT(tmp);
+ sub_class = PCI_SUBCLASS_EXTRACT(tmp);
+ if ((base_class == PCI_CLASS_BRIDGE) &&
+ ((sub_class == PCI_SUBCLASS_BRIDGE_PCI) ||
+ (sub_class == PCI_SUBCLASS_BRIDGE_CARDBUS))) {
+ tmp = pciReadLong(pciDeviceTag, PCI_PCI_BRIDGE_BUS_REG);
+ sec_bus = PCI_SECONDARY_BUS_EXTRACT(tmp, pciDeviceTag);
+ pri_bus = PCI_PRIMARY_BUS_EXTRACT(tmp, pciDeviceTag);
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: pri_bus %d sec_bus %d\n",
+ pri_bus, sec_bus);
+#endif
+ if (pciBusNum != pri_bus) {
+ /* Some bridges do not implement the primary bus register */
+ if ((PCI_BUS_NO_DOMAIN(pri_bus) != 0) ||
+ (sub_class != PCI_SUBCLASS_BRIDGE_CARDBUS))
+ xf86Msg(X_WARNING,
+ "pciGenFindNext: primary bus mismatch on PCI"
+ " bridge 0x%08x (0x%02x, 0x%02x)\n",
+ pciDeviceTag, pciBusNum, pri_bus);
+ pri_bus = pciBusNum;
+ }
+ if ((pri_bus < sec_bus) && (sec_bus < pciMaxBusNum) &&
+ pciBusInfo[pri_bus]) {
+ /*
+ * Found a secondary PCI bus
+ */
+ if (!pciBusInfo[sec_bus]) {
+ pciBusInfo[sec_bus] = xnfalloc(sizeof(pciBusInfo_t));
+
+ /* Copy parents settings... */
+ *pciBusInfo[sec_bus] = *pciBusInfo[pri_bus];
+ }
+
+ /* ...but not everything same as parent */
+ pciBusInfo[sec_bus]->primary_bus = pri_bus;
+ pciBusInfo[sec_bus]->secondary = TRUE;
+ pciBusInfo[sec_bus]->numDevices = 32;
+
+ if (pciNumBuses <= sec_bus)
+ pciNumBuses = sec_bus + 1;
+ }
+ }
+#endif
+
+ /*
+ * Does this device match the requested devid after
+ * applying mask?
+ */
+#ifdef DEBUGPCI
+ ErrorF("pciGenFindNext: pciDevidMask = 0x%lx, pciDevid = 0x%lx\n", pciDevidMask, pciDevid);
+#endif
+ if ((devid & pciDevidMask) == pciDevid)
+ /* Yes - Return it. Otherwise, next device */
+ return(pciDeviceTag); /* got a match */
+
+ } /* for */
+ /*NOTREACHED*/
+}
+
+PCITAG
+pciGenFindFirst(void)
+{
+ /* Reset PCI bus number to start from top */
+ pciBusNum = -1;
+
+ return pciGenFindNext();
+}
+
+#if defined (__powerpc__)
+static int buserr_detected;
+
+static
+void buserr(int sig)
+{
+ buserr_detected = 1;
+}
+#endif
+
+CARD32
+pciCfgMech1Read(PCITAG tag, int offset)
+{
+ unsigned long rv = 0xffffffff;
+#ifdef DEBUGPCI
+ ErrorF("pciCfgMech1Read(tag=%08x,offset=%08x)\n", tag, offset);
+#endif
+
+#if defined(__powerpc__)
+ signal(SIGBUS, buserr);
+ buserr_detected = 0;
+#endif
+
+ outl(0xCF8, PCI_EN | tag | (offset & 0xfc));
+ rv = inl(0xCFC);
+
+#if defined(__powerpc__)
+ signal(SIGBUS, SIG_DFL);
+ if (buserr_detected)
+ {
+#ifdef DEBUGPCI
+ ErrorF("pciCfgMech1Read() BUS ERROR\n");
+#endif
+ return(0xffffffff);
+ }
+ else
+#endif
+ return(rv);
+}
+
+void
+pciCfgMech1Write(PCITAG tag, int offset, CARD32 val)
+{
+#ifdef DEBUGPCI
+ ErrorF("pciCfgMech1Write(tag=%08x,offset=%08x,val=%08x)\n",
+ tag, offset,val);
+#endif
+
+#if defined(__powerpc__)
+ signal(SIGBUS, SIG_IGN);
+#endif
+
+ outl(0xCF8, PCI_EN | tag | (offset & 0xfc));
+#if defined(Lynx) && defined(__powerpc__)
+ outb(0x80, 0x00); /* without this the next access fails
+ * on my Powerstack system when we use
+ * assembler inlines for outl */
+#endif
+ outl(0xCFC, val);
+
+#if defined(__powerpc__)
+ signal(SIGBUS, SIG_DFL);
+#endif
+}
+
+void
+pciCfgMech1SetBits(PCITAG tag, int offset, CARD32 mask, CARD32 val)
+{
+ unsigned long rv = 0xffffffff;
+
+#if defined(__powerpc__)
+ signal(SIGBUS, buserr);
+#endif
+
+ outl(0xCF8, PCI_EN | tag | (offset & 0xfc));
+ rv = inl(0xCFC);
+ rv = (rv & ~mask) | val;
+ outl(0xCFC, rv);
+
+#if defined(__powerpc__)
+ signal(SIGBUS, SIG_DFL);
+#endif
+}
+
+CARD32
+pciByteSwap(CARD32 u)
+{
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+# if defined(__powerpc__) && defined(PowerMAX_OS)
+ CARD32 tmp;
+
+ __inst_stwbrx(u, &tmp, 0);
+
+ return(tmp);
+
+# else /* !PowerMAX_OS */
+
+ return lswapl(u);
+
+# endif /* !PowerMAX_OS */
+
+#else /* !BIG_ENDIAN */
+
+ return(u);
+
+#endif
+}
+
+ADDRESS
+pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS addr)
+{
+ return(addr);
+}
+
+pciConfigPtr *
+xf86scanpci(int flags)
+{
+ pciConfigPtr devp;
+ pciBusInfo_t *busp;
+ int idx = 0, i;
+ PCITAG tag;
+
+ if (pci_devp[0])
+ return pci_devp;
+
+ pciInit();
+
+#ifdef XF86SCANPCI_WRAPPER
+ XF86SCANPCI_WRAPPER(SCANPCI_INIT);
+#endif
+
+ tag = pciFindFirst(0,0); /* 0 mask means match any valid device */
+ /* Check if no devices, return now */
+ if (tag == PCI_NOT_FOUND) {
+#ifdef XF86SCANPCI_WRAPPER
+ XF86SCANPCI_WRAPPER(SCANPCI_TERM);
+#endif
+ return NULL;
+ }
+
+#ifdef DEBUGPCI
+ ErrorF("xf86scanpci: tag = 0x%lx\n", tag);
+#endif
+#ifndef OLD_FORMAT
+ xf86MsgVerb(X_INFO, 2, "PCI: PCI scan (all values are in hex)\n");
+#endif
+
+ while (idx < MAX_PCI_DEVICES && tag != PCI_NOT_FOUND) {
+ devp = xcalloc(1, sizeof(pciDevice));
+ if (!devp) {
+ xf86Msg(X_ERROR,
+ "xf86scanpci: Out of memory after %d devices!!\n", idx);
+ return (pciConfigPtr *)NULL;
+ }
+
+ /* Identify pci device by bus, dev, func, and tag */
+ devp->tag = tag;
+ devp->busnum = PCI_BUS_FROM_TAG(tag);
+ devp->devnum = PCI_DEV_FROM_TAG(tag);
+ devp->funcnum = PCI_FUNC_FROM_TAG(tag);
+
+ /* Read config space for this device */
+ for (i = 0; i < 17; i++) /* PCI hdr plus 1st dev spec dword */
+ devp->cfgspc.dwords[i] = pciReadLong(tag, i * sizeof(CARD32));
+
+#ifdef ARCH_PCI_HOST_BRIDGE
+ if ((devp->pci_base_class == PCI_CLASS_BRIDGE) &&
+ (devp->pci_sub_class == PCI_SUBCLASS_BRIDGE_HOST))
+ ARCH_PCI_HOST_BRIDGE(devp);
+#endif
+
+ /* Some broken devices don't implement this field... */
+ if (devp->pci_header_type == 0xff)
+ devp->pci_header_type = 0;
+
+ switch (devp->pci_header_type & 0x7f) {
+ case 0:
+ /* Get base address sizes for type 0 headers */
+ for (i = 0; i < 7; i++)
+ devp->basesize[i] =
+ pciGetBaseSize(tag, i, FALSE, &devp->minBasesize);
+ break;
+
+ case 1:
+ case 2:
+ /* Allow master aborts to complete normally on secondary buses */
+ if (!(devp->pci_bridge_control & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
+ break;
+ pciWriteByte(tag, PCI_PCI_BRIDGE_CONTROL_REG,
+ devp->pci_bridge_control & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
+ break;
+
+ default:
+ break;
+ }
+
+#ifdef OLD_FORMAT
+ xf86MsgVerb(X_INFO, 2, "PCI: BusID 0x%.2x,0x%02x,0x%1x "
+ "ID 0x%04x,0x%04x Rev 0x%02x Class 0x%02x,0x%02x\n",
+ devp->busnum, devp->devnum, devp->funcnum,
+ devp->pci_vendor, devp->pci_device, devp->pci_rev_id,
+ devp->pci_base_class, devp->pci_sub_class);
+#else
+ xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x"
+ " card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n",
+ devp->busnum, devp->devnum, devp->funcnum,
+ devp->pci_vendor, devp->pci_device,
+ devp->pci_subsys_vendor, devp->pci_subsys_card,
+ devp->pci_rev_id, devp->pci_base_class,
+ devp->pci_sub_class, devp->pci_prog_if,
+ devp->pci_header_type);
+#endif
+
+ pci_devp[idx++] = devp;
+ tag = pciFindNext();
+
+#ifdef DEBUGPCI
+ ErrorF("xf86scanpci: tag = pciFindNext = 0x%lx\n", tag);
+#endif
+ }
+
+ /* Restore modified data (in reverse order), and link buses */
+ while (--idx >= 0) {
+ devp = pci_devp[idx];
+ switch (devp->pci_header_type & 0x7f) {
+ case 0:
+ if ((devp->pci_base_class != PCI_CLASS_BRIDGE) ||
+ (devp->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST))
+ break;
+ pciBusInfo[devp->busnum]->bridge = devp;
+ pciBusInfo[devp->busnum]->primary_bus = devp->busnum;
+ break;
+
+ case 1:
+ case 2:
+ i = PCI_SECONDARY_BUS_EXTRACT(devp->pci_pp_bus_register, devp->tag);
+ if (i > devp->busnum) {
+ if (pciBusInfo[i]) {
+ pciBusInfo[i]->bridge = devp;
+ /*
+ * The back link needs to be set here, and is unlikely to
+ * change.
+ */
+ devp->businfo = pciBusInfo[i];
+ }
+#ifdef ARCH_PCI_PCI_BRIDGE
+ ARCH_PCI_PCI_BRIDGE(devp);
+#endif
+ }
+ if (!(devp->pci_bridge_control & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
+ break;
+ pciWriteByte(devp->tag, PCI_PCI_BRIDGE_CONTROL_REG,
+ devp->pci_bridge_control);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+#ifdef XF86SCANPCI_WRAPPER
+ XF86SCANPCI_WRAPPER(SCANPCI_TERM);
+#endif
+
+ /*
+ * Lastly, link bridges to their secondary bus, after the architecture has
+ * had a chance to modify these assignments.
+ */
+ for (idx = 0; idx < pciNumBuses; idx++) {
+ if (!(busp = pciBusInfo[idx]) || !(devp = busp->bridge))
+ continue;
+ devp->businfo = busp;
+ }
+
+#ifndef OLD_FORMAT
+ xf86MsgVerb(X_INFO, 2, "PCI: End of PCI scan\n");
+#endif
+
+ return pci_devp;
+}
+
+CARD32
+pciCheckForBrokenBase(PCITAG Tag,int basereg)
+{
+ pciWriteLong(Tag, PCI_MAP_REG_START + (basereg << 2), 0xffffffff);
+ return pciReadLong(Tag, PCI_MAP_REG_START + (basereg << 2));
+}
+
+#if defined(INCLUDE_XF86_MAP_PCI_MEM)
+
+pointer
+xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag, ADDRESS Base,
+ unsigned long Size)
+{
+ ADDRESS hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM,Base);
+ pointer base;
+ CARD32 save = 0;
+
+ /*
+ * If there are possible read side-effects, disable memory while
+ * doing the mapping.
+ */
+ if (Flags & VIDMEM_READSIDEEFFECT) {
+ save = pciReadLong(Tag, PCI_CMD_STAT_REG);
+ pciWriteLong(Tag, PCI_CMD_STAT_REG,
+ save & ~PCI_CMD_MEM_ENABLE);
+ }
+ base = xf86MapDomainMemory(ScreenNum, Flags, Tag, hostbase, Size);
+ if (!base) {
+ FatalError("xf86MapPciMem: Could not mmap PCI memory "
+ "[base=0x%x,hostbase=0x%x,size=%x] (%s)\n",
+ Base, hostbase, Size, strerror(errno));
+ }
+ /*
+ * If read side-effects, do whatever might be needed to prevent
+ * unintended reads, then restore PCI_CMD_STAT_REG.
+ */
+ if (Flags & VIDMEM_READSIDEEFFECT) {
+ xf86MapReadSideEffects(ScreenNum, Flags, base, Size);
+ pciWriteLong(Tag, PCI_CMD_STAT_REG, save);
+ }
+ return((pointer)base);
+}
+
+static int
+handlePciBIOS(PCITAG Tag, int basereg,
+ int (*func)(PCITAG, CARD8*, ADDRESS, pointer),
+ pointer args)
+{
+ CARD32 romsave = 0;
+ int i;
+ romBaseSource b_reg;
+ ADDRESS hostbase;
+ CARD8 tmp[64];
+ int ret = 0;
+
+ romsave = pciReadLong(Tag, PCI_MAP_ROM_REG);
+
+ for (i = ROM_BASE_PRESET; i <= ROM_BASE_FIND; i++) {
+ memType savebase = 0, newbase, romaddr;
+
+ if (i == ROM_BASE_PRESET) {
+ /* Does the driver have a preference? */
+ if (basereg > ROM_BASE_PRESET && basereg <= ROM_BASE_FIND)
+ b_reg = basereg;
+ else
+ b_reg = ++i;
+ } else
+ b_reg = i;
+
+ if (!(newbase = getValidBIOSBase(Tag, b_reg)))
+ continue; /* no valid address found */
+
+ romaddr = PCIGETROM(newbase);
+
+ /* if we use a mem base save it and move it out of the way */
+ if (b_reg >= 0 && b_reg <= 5) {
+ savebase = pciReadLong(Tag, PCI_MAP_REG_START+(b_reg<<2));
+ xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]"
+ " for device %i:%i:%i\n", basereg,
+ PCI_BUS_FROM_TAG(Tag), PCI_DEV_FROM_TAG(Tag),
+ PCI_FUNC_FROM_TAG(Tag));
+ pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
+ (CARD32)~0);
+ }
+ /* Set ROM base address and enable ROM address decoding */
+ pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr
+ | PCI_MAP_ROM_DECODE_ENABLE);
+
+ hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM, PCIGETROM(romaddr));
+
+ if ((xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp) !=
+ sizeof(tmp)) ||
+ (tmp[0] != 0x55) || (tmp[1] != 0xaa) || !tmp[2] ) {
+ /* Restore the base register if it was changed. */
+ if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
+ (CARD32) savebase);
+
+ /* No BIOS found: try another address */
+ continue;
+ }
+
+ ret = (*func)(Tag, tmp, hostbase, args);
+
+ /* Restore the base register if it was changed. */
+ if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2),
+ (CARD32) savebase);
+ /* Restore ROM address decoding */
+ pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave);
+
+ return ret;
+ }
+ /* Restore ROM address decoding */
+ pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave);
+ return 0;
+}
+
+typedef struct {
+ unsigned long Offset;
+ int Len;
+ unsigned char *Buf;
+ PciBiosType BiosType;
+} readBios, *readBiosPtr;
+
+static int
+readPciBios(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer args)
+{
+ unsigned int image_length = 0;
+ readBiosPtr rd = args;
+ int ret;
+
+ /* We found a PCI BIOS Image. Now we look for the correct type */
+ while ((tmp[0] == 0x55) && (tmp[1] == 0xAA)) {
+ unsigned short data_off = tmp[0x18] | (tmp[0x19] << 8);
+ unsigned char data[0x18];
+ unsigned char type;
+
+ if ((xf86ReadDomainMemory(Tag, hostbase + data_off, sizeof(data), data)
+ != sizeof(data)) ||
+ (data[0] != 'P') ||
+ (data[1] != 'C') ||
+ (data[2] != 'I') ||
+ (data[3] != 'R'))
+ break;
+ type = data[0x14];
+#ifdef PRINT_PCI
+ ErrorF("data segment in BIOS: 0x%x, type: 0x%x\n", data_off, type);
+#endif
+ if (type != rd->BiosType) { /* not correct image: find next one */
+ unsigned char indicator = data[0x15];
+ unsigned int i_length;
+ if (indicator & 0x80) /* last image */
+ break;
+ i_length = (data[0x10] | (data[0x11] << 8)) << 9;
+#ifdef PRINT_PCI
+ ErrorF("data image length: 0x%x, ind: 0x%x\n",
+ image_length, indicator);
+#endif
+ hostbase += i_length;
+ if (xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp)
+ != sizeof(tmp))
+ break;
+ continue;
+ }
+ /* OK, we have a PCI BIOS Image of the correct type */
+
+ if (rd->BiosType == PCI_BIOS_PC)
+ image_length = tmp[2] << 9;
+ else
+ image_length = (data[0x10] | (data[0x11] << 8)) << 9;
+#ifdef PRINT_PCI
+ ErrorF("BIOS length: 0x%x\n", image_length);
+#endif
+ break;
+ }
+
+ ret = 0;
+ if (image_length) {
+
+ /*
+ * if no length is given return the full lenght,
+ * Offset 0. Beware: Area pointed to by Buf must
+ * be large enough!
+ */
+ if (rd->Len == 0) {
+ rd->Len = image_length;
+ rd->Offset = 0;
+ }
+ if ((rd->Offset) > (image_length)) {
+ xf86Msg(X_WARNING,"xf86ReadPciBios: requesting data past "
+ "end of BIOS %i > %i\n",(rd->Offset) , (image_length));
+ } else {
+ if ((rd->Offset + rd->Len) > (image_length)) {
+ rd->Len = (image_length) - rd->Offset;
+ xf86MsgVerb(X_INFO,3,"Truncating PCI BIOS Length to %i\n",rd->Len);
+ }
+ }
+
+ /* Read BIOS */
+ ret = xf86ReadDomainMemory(Tag, hostbase + rd->Offset, rd->Len, rd->Buf);
+ }
+
+ return ret;
+}
+
+static int
+getPciBIOSTypes(PCITAG Tag, CARD8* tmp, ADDRESS hostbase, pointer arg)
+{
+ int n = 0;
+ PciBiosType *Buf = arg;
+
+ /* We found a PCI BIOS Image. Now we collect the types type */
+ do {
+ unsigned short data_off = tmp[0x18] | (tmp[0x19] << 8);
+ unsigned char data[16];
+ unsigned int i_length;
+
+ if ((xf86ReadDomainMemory(Tag, hostbase + data_off, sizeof(data), data)
+ != sizeof(data)) ||
+ (data[0] != 'P') ||
+ (data[1] != 'C') ||
+ (data[2] != 'I') ||
+ (data[3] != 'R'))
+ break;
+
+ if (data[0x14] >= PCI_BIOS_OTHER)
+ *Buf++ = PCI_BIOS_OTHER;
+ else
+ *Buf++ = data[0x14];
+
+ n++;
+ if (data[0x15] & 0x80) /* last image */
+ break;
+#ifdef PRINT_PCI
+ ErrorF("data segment in BIOS: 0x%x, type: 0x%x\n", data_off, type);
+#endif
+ i_length = (data[0x10] | (data[0x11] << 8)) << 9;
+#ifdef PRINT_PCI
+ ErrorF("data image length: 0x%x, ind: 0x%x\n",
+ image_length, indicator);
+#endif
+ hostbase += i_length;
+ if (xf86ReadDomainMemory(Tag, hostbase, sizeof(tmp), tmp)
+ != sizeof(tmp))
+ break;
+ continue;
+ } while ((tmp[0] == 0x55) && (tmp[1] == 0xAA));
+ return n;
+}
+
+typedef CARD32 (*ReadProcPtr)(PCITAG, int);
+typedef void (*WriteProcPtr)(PCITAG, int, CARD32);
+
+static int
+HandlePciBios(PCITAG Tag, int basereg,
+ int (*func)(PCITAG, CARD8*, ADDRESS, pointer),
+ pointer ptr)
+{
+ int n, num;
+ CARD32 Acc1, Acc2;
+ PCITAG *pTag;
+ int i;
+
+ n = handlePciBIOS(Tag,basereg,func,ptr);
+ if (n)
+ return n;
+
+ num = pciTestMultiDeviceCard(PCI_BUS_FROM_TAG(Tag),
+ PCI_DEV_FROM_TAG(Tag),
+ PCI_FUNC_FROM_TAG(Tag),&pTag);
+
+ if (!num) return 0;
+
+#define PCI_ENA (PCI_CMD_MEM_ENABLE | PCI_CMD_IO_ENABLE)
+ Acc1 = ((ReadProcPtr)(pciLongFunc(Tag,READ)))(Tag,PCI_CMD_STAT_REG);
+ ((WriteProcPtr)(pciLongFunc(Tag,WRITE)))(Tag,
+ PCI_CMD_STAT_REG,(Acc1 & ~PCI_ENA));
+
+ for (i = 0; i < num; i++) {
+ Acc2 = ((ReadProcPtr)(pciLongFunc(pTag[i],READ)))(pTag[i],PCI_CMD_STAT_REG);
+ ((WriteProcPtr)(pciLongFunc(pTag[i],WRITE)))(pTag[i],
+ PCI_CMD_STAT_REG,(Acc2 | PCI_ENA));
+
+ n = handlePciBIOS(pTag[i],0,func,ptr);
+
+ ((WriteProcPtr)(pciLongFunc(pTag[i],WRITE)))(pTag[i],PCI_CMD_STAT_REG,Acc2);
+ if (n)
+ break;
+ }
+ ((WriteProcPtr)(pciLongFunc(Tag,WRITE)))(Tag,PCI_CMD_STAT_REG,Acc1);
+ return n;
+}
+
+int
+xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg,
+ unsigned char *Buf, int Len)
+{
+ return xf86ReadPciBIOSByType(Offset, Tag, basereg, Buf, Len, PCI_BIOS_PC);
+}
+
+int
+xf86ReadPciBIOSByType(unsigned long Offset, PCITAG Tag, int basereg,
+ unsigned char *Buf, int Len, PciBiosType Type)
+{
+
+ readBios rb;
+ rb.Offset = Offset;
+ rb.Len = Len;
+ rb.Buf = Buf;
+ rb.BiosType = Type;
+
+ return HandlePciBios(Tag, basereg, readPciBios, &rb);
+}
+
+int
+xf86GetAvailablePciBIOSTypes(PCITAG Tag, int basereg, PciBiosType *Buf)
+{
+ return HandlePciBios(Tag, basereg, getPciBIOSTypes, (pointer) Buf);
+}
+
+#endif /* INCLUDE_XF86_MAP_PCI_MEM */
+
+#ifdef INCLUDE_XF86_NO_DOMAIN
+
+int
+xf86GetPciDomain(PCITAG Tag)
+{
+ return 0;
+}
+
+pointer
+xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
+ ADDRESS Base, unsigned long Size)
+{
+ return xf86MapVidMem(ScreenNum, Flags, Base, Size);
+}
+
+IOADDRESS
+xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
+ IOADDRESS Base, unsigned long Size)
+{
+ return Base;
+}
+
+int
+xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
+{
+ int ret, length, rlength;
+
+ /* Read in 64kB chunks */
+ ret = 0;
+ while ((length = Len) > 0) {
+ if (length > 0x010000) length = 0x010000;
+ rlength = xf86ReadBIOS(Base, 0, Buf, length);
+ if (rlength < 0) {
+ ret = rlength;
+ break;
+ }
+ ret += rlength;
+ if (rlength < length) break;
+ Base += rlength;
+ Buf += rlength;
+ Len -= rlength;
+ }
+
+ return ret;
+}
+
+#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
new file mode 100644
index 000000000..8fb421b34
--- /dev/null
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -0,0 +1,403 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.36.2.1 2003/03/21 22:29:59 tsi Exp $ */
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ *
+ * This file is derived in part from the original xf86_PCI.h that included
+ * following copyright message:
+ *
+ * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
+ *
+ * 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 names of the above listed copyright holder(s)
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holder(s) make(s) no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ */
+
+/*
+ * This file has the private Pci definitions. The public ones are imported
+ * from xf86Pci.h. Drivers should not use this file.
+ */
+#ifndef _PCI_H
+#define _PCI_H 1
+
+#include "Xarch.h"
+#include "Xfuncproto.h"
+#include "xf86Pci.h"
+#include "xf86PciInfo.h"
+
+/*
+ * Global Definitions
+ */
+#define MAX_PCI_DEVICES 64 /* Max number of devices accomodated */
+ /* by xf86scanpci */
+#if defined(sun) && defined(SVR4) && defined(sparc)
+# define MAX_PCI_BUSES 4096 /* Max number of PCI buses */
+#elif defined(__alpha__) && defined (linux)
+# define MAX_PCI_DOMAINS 512
+# define PCI_DOM_MASK 0x01fful
+# define MAX_PCI_BUSES (MAX_PCI_DOMAINS*256) /* 256 per domain */
+#else
+# define MAX_PCI_BUSES 256 /* Max number of PCI buses */
+#endif
+
+#define DEVID(vendor, device) \
+ ((CARD32)((PCI_CHIP_##device << 16) | PCI_VENDOR_##vendor))
+
+#ifndef PCI_DOM_MASK
+# define PCI_DOM_MASK 0x0ffu
+#endif
+#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu)
+
+/*
+ * "b" contains an optional domain number.
+ */
+#define PCI_MAKE_TAG(b,d,f) ((((b) & (PCI_DOMBUS_MASK)) << 16) | \
+ (((d) & 0x00001fu) << 11) | \
+ (((f) & 0x000007u) << 8))
+
+#define PCI_MAKE_BUS(d,b) ((((d) & (PCI_DOM_MASK)) << 8) | ((b) & 0xffu))
+
+#define PCI_DOM_FROM_TAG(tag) (((tag) >> 24) & (PCI_DOM_MASK))
+#define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK))
+#define PCI_DEV_FROM_TAG(tag) (((tag) & 0x0000f800u) >> 11)
+#define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8)
+
+#define PCI_DFN_FROM_TAG(tag) (((tag) & 0x0000ff00u) >> 8)
+#define PCI_BDEV_FROM_TAG(tag) ((tag) & 0x00fff800u)
+
+#define PCI_DOM_FROM_BUS(bus) (((bus) >> 8) & (PCI_DOM_MASK))
+#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
+#define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u)
+
+/*
+ * Macros for bus numbers found in P2P headers.
+ */
+#define PCI_PRIMARY_BUS_EXTRACT(x, tag) \
+ ((((x) & PCI_PRIMARY_BUS_MASK ) >> 0) | (PCI_DOM_FROM_TAG(tag) << 8))
+#define PCI_SECONDARY_BUS_EXTRACT(x, tag) \
+ ((((x) & PCI_SECONDARY_BUS_MASK ) >> 8) | (PCI_DOM_FROM_TAG(tag) << 8))
+#define PCI_SUBORDINATE_BUS_EXTRACT(x, tag) \
+ ((((x) & PCI_SUBORDINATE_BUS_MASK) >> 16) | (PCI_DOM_FROM_TAG(tag) << 8))
+
+#define PCI_PRIMARY_BUS_INSERT(x, y) \
+ (((x) & ~PCI_PRIMARY_BUS_MASK ) | (((y) & 0xffu) << 0))
+#define PCI_SECONDARY_BUS_INSERT(x, y) \
+ (((x) & ~PCI_SECONDARY_BUS_MASK ) | (((y) & 0xffu) << 8))
+#define PCI_SUBORDINATE_BUS_INSERT(x, y) \
+ (((x) & ~PCI_SUBORDINATE_BUS_MASK) | (((y) & 0xffu) << 16))
+
+/* Ditto for CardBus bridges */
+#define PCI_CB_PRIMARY_BUS_EXTRACT(x, tag) \
+ PCI_PRIMARY_BUS_EXTRACT(x, tag)
+#define PCI_CB_CARDBUS_BUS_EXTRACT(x, tag) \
+ PCI_SECONDARY_BUS_EXTRACT(x, tag)
+#define PCI_CB_SUBORDINATE_BUS_EXTRACT(x, tag) \
+ PCI_SUBORDINATE_BUS_EXTRACT(x, tag)
+
+#define PCI_CB_PRIMARY_BUS_INSERT(x, tag) \
+ PCI_PRIMARY_BUS_INSERT(x, tag)
+#define PCI_CB_CARDBUS_BUS_INSERT(x, tag) \
+ PCI_SECONDARY_BUS_INSERT(x, tag)
+#define PCI_CB_SUBORDINATE_BUS_INSERT(x, tag) \
+ PCI_SUBORDINATE_BUS_INSERT(x, tag)
+
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \
+ ((val >> 8) & 0x0000ff00) | \
+ ((val << 8) & 0x00ff0000) | \
+ ((val << 24) & 0xff000000))
+#else
+#define PCI_CPU(val) (val)
+#endif
+
+/*
+ * Debug Macros/Definitions
+ */
+/* #define DEBUGPCI 2 */ /* Disable/enable trace in PCI code */
+
+#if defined(DEBUGPCI)
+
+# define PCITRACE(lvl,printfargs) \
+ if (lvl > xf86Verbose) { \
+ ErrorF printfargs; \
+ }
+
+#else /* !defined(DEBUGPCI) */
+
+# define PCITRACE(lvl,printfargs)
+
+#endif /* !defined(DEBUGPCI) */
+
+/*
+ * PCI Config mechanism definitions
+ */
+#define PCI_EN 0x80000000
+
+#define PCI_CFGMECH1_ADDRESS_REG 0xCF8
+#define PCI_CFGMECH1_DATA_REG 0xCFC
+
+#define PCI_CFGMECH1_MAXDEV 32
+
+/*
+ * Select architecture specific PCI init function
+ */
+#if defined(__alpha__)
+# if defined(linux)
+# define ARCH_PCI_INIT axpPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# elif defined(__FreeBSD__) || defined(__OpenBSD__)
+# define ARCH_PCI_INIT freebsdPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# elif defined(__NetBSD__)
+# define ARCH_PCI_INIT netbsdPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+#elif defined(__arm__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+#elif defined(__hppa__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+#elif defined(__ia64__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+# define XF86SCANPCI_WRAPPER ia64ScanPCIWrapper
+#elif defined(__i386__)
+# define ARCH_PCI_INIT ix86PciInit
+# define ARCH_PCI_HOST_BRIDGE ix86PciHostBridge
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# if defined(linux)
+# define ARCH_PCI_OS_INIT linuxPciInit
+# endif
+#elif defined(__mc68000__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+#elif defined(__mips__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+#elif defined(__powerpc__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN /* Needs kernel work to remove */
+# elif defined(__OpenBSD__)
+# define ARCH_PCI_INIT freebsdPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# elif defined(__NetBSD__)
+# define ARCH_PCI_INIT netbsdPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# elif defined(PowerMAX_OS) /* This port is broken */
+# define ARCH_PCI_INIT ppcPciInit
+# else
+# define ARCH_PCI_INIT ppcPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+#elif defined(__s390__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+#elif defined(__sh__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+#elif defined(__sparc__)
+# if defined(linux)
+# define ARCH_PCI_INIT linuxPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# elif defined(sun)
+# define ARCH_PCI_INIT sparcPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# elif defined(__OpenBSD__) && defined(__sparc64__)
+# define ARCH_PCI_INIT freebsdPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# endif
+# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
+#elif defined(__x86_64__)
+# define ARCH_PCI_INIT ix86PciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
+# define INCLUDE_XF86_NO_DOMAIN
+# if defined(linux)
+# define ARCH_PCI_OS_INIT linuxPciInit
+# endif
+#endif
+
+#ifndef ARCH_PCI_INIT
+#error No PCI support available for this architecture/OS combination
+#endif
+
+extern void ARCH_PCI_INIT(void);
+#if defined(ARCH_PCI_OS_INIT)
+extern void ARCH_PCI_OS_INIT(void);
+#endif
+
+#if defined(ARCH_PCI_HOST_BRIDGE)
+extern void ARCH_PCI_HOST_BRIDGE(pciConfigPtr pPCI);
+#endif
+
+#if defined(ARCH_PCI_PCI_BRIDGE)
+extern void ARCH_PCI_PCI_BRIDGE(pciConfigPtr pPCI);
+#endif
+
+#if defined(XF86SCANPCI_WRAPPER)
+typedef enum {
+ SCANPCI_INIT,
+ SCANPCI_TERM
+} scanpciWrapperOpt;
+extern void XF86SCANPCI_WRAPPER(scanpciWrapperOpt flags);
+#endif
+
+/*
+ * Table of functions used to access a specific PCI bus domain
+ * (e.g. a primary PCI bus and all of its secondaries)
+ */
+typedef struct pci_bus_funcs {
+ CARD32 (*pciReadLong)(PCITAG, int);
+ void (*pciWriteLong)(PCITAG, int, CARD32);
+ void (*pciSetBitsLong)(PCITAG, int, CARD32, CARD32);
+ ADDRESS (*pciAddrHostToBus)(PCITAG, PciAddrType, ADDRESS);
+ ADDRESS (*pciAddrBusToHost)(PCITAG, PciAddrType, ADDRESS);
+ /*
+ * The next three are optional. If NULL, the corresponding function is
+ * to be performed generically.
+ */
+ CARD16 (*pciControlBridge)(int, CARD16, CARD16);
+ void (*pciGetBridgeBusses)(int, int *, int *, int *);
+ /* Use pointer's to avoid #include recursion */
+ void (*pciGetBridgeResources)(int, pointer *, pointer *, pointer *);
+} pciBusFuncs_t, *pciBusFuncs_p;
+
+/*
+ * pciBusInfo_t - One structure per defined PCI bus
+ */
+typedef struct pci_bus_info {
+ unsigned char configMech; /* PCI config type to use */
+ unsigned char numDevices; /* Range of valid devnums */
+ unsigned char secondary; /* Boolean: bus is a secondary */
+ int primary_bus; /* Parent bus */
+#ifdef PowerMAX_OS
+ unsigned long ppc_io_base; /* PowerPC I/O spc membase */
+ unsigned long ppc_io_size; /* PowerPC I/O spc size */
+#endif
+ pciBusFuncs_p funcs; /* PCI access functions */
+ void *pciBusPriv; /* Implementation private data */
+ pciConfigPtr bridge; /* bridge that opens this bus */
+} pciBusInfo_t;
+
+#define HOST_NO_BUS ((pciBusInfo_t *)(-1))
+
+/* configMech values */
+#define PCI_CFG_MECH_UNKNOWN 0 /* Not yet known */
+#define PCI_CFG_MECH_1 1 /* Most machines */
+#define PCI_CFG_MECH_2 2 /* Older PC's */
+#define PCI_CFG_MECH_OTHER 3 /* Something else */
+
+/* Generic PCI service functions and helpers */
+PCITAG pciGenFindFirst(void);
+PCITAG pciGenFindNext(void);
+CARD32 pciCfgMech1Read(PCITAG tag, int offset);
+void pciCfgMech1Write(PCITAG tag, int offset, CARD32 val);
+void pciCfgMech1SetBits(PCITAG tag, int offset, CARD32 mask,
+ CARD32 val);
+CARD32 pciByteSwap(CARD32);
+Bool pciMfDev(int, int);
+ADDRESS pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS);
+
+extern PCITAG (*pciFindFirstFP)(void);
+extern PCITAG (*pciFindNextFP)(void);
+
+extern CARD32 pciDevid;
+extern CARD32 pciDevidMask;
+
+extern int pciMaxBusNum;
+
+extern int pciBusNum;
+extern int pciDevNum;
+extern int pciFuncNum;
+extern PCITAG pciDeviceTag;
+
+extern pciBusInfo_t *pciBusInfo[];
+
+#endif /* _PCI_H */
diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
new file mode 100644
index 000000000..c730c1559
--- /dev/null
+++ b/hw/xfree86/os-support/bus/Sbus.c
@@ -0,0 +1,624 @@
+/*
+ * SBUS and OpenPROM access functions.
+ *
+ * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
+ *
+ * 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
+ * JAKUB JELINEK 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Sbus.c,v 1.2 2001/10/28 03:34:01 tsi Exp $ */
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#ifdef sun
+#include <sys/utsname.h>
+#endif
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#include "xf86sbusBus.h"
+#include "xf86Sbus.h"
+
+int promRootNode;
+
+static int promFd = -1;
+static int promCurrentNode;
+static int promOpenCount = 0;
+static int promP1275 = -1;
+#define MAX_PROP 128
+#define MAX_VAL (4096-128-4)
+static struct openpromio *promOpio;
+
+sbusDevicePtr *xf86SbusInfo = NULL;
+
+struct sbus_devtable sbusDeviceTable[] = {
+ { SBUS_DEVICE_BW2, FBTYPE_SUN2BW, "bwtwo", "Sun Monochrome (bwtwo)" },
+ { SBUS_DEVICE_CG2, FBTYPE_SUN2COLOR, "cgtwo", "Sun Color2 (cgtwo)" },
+ { SBUS_DEVICE_CG3, FBTYPE_SUN3COLOR, "cgthree", "Sun Color3 (cgthree)" },
+ { SBUS_DEVICE_CG4, FBTYPE_SUN4COLOR, "cgfour", "Sun Color4 (cgfour)" },
+ { SBUS_DEVICE_CG6, FBTYPE_SUNFAST_COLOR, "cgsix", "Sun GX" },
+ { SBUS_DEVICE_CG8, FBTYPE_MEMCOLOR, "cgeight", "Sun CG8/RasterOps" },
+ { SBUS_DEVICE_CG12, FBTYPE_SUNGP3, "cgtwelve", "Sun GS (cgtwelve)" },
+ { SBUS_DEVICE_CG14, FBTYPE_MDICOLOR, "cgfourteen", "Sun SX" },
+ { SBUS_DEVICE_GT, FBTYPE_SUNGT, "gt", "Sun Graphics Tower" },
+ { SBUS_DEVICE_MGX, -1, "mgx", "Quantum 3D MGXplus" },
+ { SBUS_DEVICE_LEO, FBTYPE_SUNLEO, "leo", "Sun ZX or Turbo ZX" },
+ { SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, "tcx", "Sun TCX" },
+ { SBUS_DEVICE_FFB, FBTYPE_CREATOR, "ffb", "Sun FFB" },
+ { SBUS_DEVICE_FFB, FBTYPE_CREATOR, "afb", "Sun Elite3D" },
+ { 0, 0, NULL }
+};
+
+int
+promGetSibling(int node)
+{
+ promOpio->oprom_size = sizeof(int);
+
+ if (node == -1) return 0;
+ *(int *)promOpio->oprom_array = node;
+ if (ioctl(promFd, OPROMNEXT, promOpio) < 0)
+ return 0;
+ promCurrentNode = *(int *)promOpio->oprom_array;
+ return *(int *)promOpio->oprom_array;
+}
+
+int
+promGetChild(int node)
+{
+ promOpio->oprom_size = sizeof(int);
+
+ if (!node || node == -1) return 0;
+ *(int *)promOpio->oprom_array = node;
+ if (ioctl(promFd, OPROMCHILD, promOpio) < 0)
+ return 0;
+ promCurrentNode = *(int *)promOpio->oprom_array;
+ return *(int *)promOpio->oprom_array;
+}
+
+char *
+promGetProperty(const char *prop, int *lenp)
+{
+ promOpio->oprom_size = MAX_VAL;
+
+ strcpy(promOpio->oprom_array, prop);
+ if (ioctl(promFd, OPROMGETPROP, promOpio) < 0)
+ return 0;
+ if (lenp) *lenp = promOpio->oprom_size;
+ return promOpio->oprom_array;
+}
+
+int
+promGetBool(const char *prop)
+{
+ promOpio->oprom_size = 0;
+
+ *(int *)promOpio->oprom_array = 0;
+ for (;;) {
+ promOpio->oprom_size = MAX_PROP;
+ if (ioctl(promFd, OPROMNXTPROP, promOpio) < 0)
+ return 0;
+ if (!promOpio->oprom_size)
+ return 0;
+ if (!strcmp(promOpio->oprom_array, prop))
+ return 1;
+ }
+}
+
+#define PROM_NODE_SIBLING 0x01
+#define PROM_NODE_PREF 0x02
+#define PROM_NODE_SBUS 0x04
+#define PROM_NODE_EBUS 0x08
+#define PROM_NODE_PCI 0x10
+
+static int
+promSetNode(sbusPromNodePtr pnode)
+{
+ int node;
+
+ if (!pnode->node || pnode->node == -1)
+ return -1;
+ if (pnode->cookie[0] & PROM_NODE_SIBLING)
+ node = promGetSibling(pnode->cookie[1]);
+ else
+ node = promGetChild(pnode->cookie[1]);
+ if (pnode->node != node)
+ return -1;
+ return 0;
+}
+
+static void
+promIsP1275(void)
+{
+#ifdef linux
+ FILE *f;
+ char buffer[1024];
+
+ if (promP1275 != -1)
+ return;
+ promP1275 = 0;
+ f = fopen("/proc/cpuinfo","r");
+ if (!f) return;
+ while (fgets(buffer, 1024, f) != NULL)
+ if (!strncmp (buffer, "type", 4) && strstr (buffer, "sun4u")) {
+ promP1275 = 1;
+ break;
+ }
+ fclose(f);
+#elif defined(sun)
+ struct utsname buffer;
+
+ if ((uname(&buffer) == 0) && !strcmp(buffer.machine, "sun4u"))
+ promP1275 = TRUE;
+ else
+ promP1275 = FALSE;
+#else
+#error Missing promIsP1275() function for this OS
+#endif
+}
+
+void
+sparcPromClose(void)
+{
+ if (promOpenCount > 1) {
+ promOpenCount--;
+ return;
+ }
+ if (promFd != -1) {
+ close(promFd);
+ promFd = -1;
+ }
+ if (promOpio) {
+ xfree(promOpio);
+ promOpio = NULL;
+ }
+ promOpenCount = 0;
+}
+
+int
+sparcPromInit(void)
+{
+ if (promOpenCount) {
+ promOpenCount++;
+ return 0;
+ }
+ promFd = open("/dev/openprom", O_RDONLY, 0);
+ if (promFd == -1)
+ return -1;
+ promOpio = (struct openpromio *)xalloc(4096);
+ if (!promOpio) {
+ sparcPromClose();
+ return -1;
+ }
+ promRootNode = promGetSibling(0);
+ if (!promRootNode) {
+ sparcPromClose();
+ return -1;
+ }
+ promIsP1275();
+ promOpenCount++;
+
+ return 0;
+}
+
+char *
+sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp)
+{
+ if (promSetNode(pnode))
+ return NULL;
+ return promGetProperty(prop, lenp);
+}
+
+int
+sparcPromGetBool(sbusPromNodePtr pnode, const char *prop)
+{
+ if (promSetNode(pnode))
+ return 0;
+ return promGetBool(prop);
+}
+
+static void
+promWalkAssignNodes(int node, int oldnode, int flags, sbusDevicePtr *devicePtrs)
+{
+ int nextnode;
+ int len, sbus = flags & PROM_NODE_SBUS;
+ char *prop;
+ int devId, i, j;
+ sbusPromNode pNode, pNode2;
+
+ prop = promGetProperty("device_type", &len);
+ if (prop && (len > 0)) do {
+ if (!strcmp(prop, "display")) {
+ prop = promGetProperty("name", &len);
+ if (!prop || len <= 0)
+ break;
+ while ((*prop >= 'A' && *prop <= 'Z') || *prop == ',')
+ prop++;
+ for (i = 0; sbusDeviceTable[i].devId; i++)
+ if (!strcmp(prop, sbusDeviceTable[i].promName))
+ break;
+ devId = sbusDeviceTable[i].devId;
+ if (!devId)
+ break;
+ if (!sbus) {
+ if (devId == SBUS_DEVICE_FFB) {
+ /*
+ * All /SUNW,ffb outside of SBUS tree come before all
+ * /SUNW,afb outside of SBUS tree in Linux.
+ */
+ if (!strcmp(prop, "afb"))
+ flags |= PROM_NODE_PREF;
+ } else if (devId != SBUS_DEVICE_CG14)
+ break;
+ }
+ for (i = 0; i < 32; i++) {
+ if (!devicePtrs[i] || devicePtrs[i]->devId != devId)
+ continue;
+ if (devicePtrs[i]->node.node) {
+ if ((devicePtrs[i]->node.cookie[0] & ~PROM_NODE_SIBLING) <=
+ (flags & ~PROM_NODE_SIBLING))
+ continue;
+ for (j = i + 1, pNode = devicePtrs[i]->node; j < 32; j++) {
+ if (!devicePtrs[j] || devicePtrs[j]->devId != devId)
+ continue;
+ pNode2 = devicePtrs[j]->node;
+ devicePtrs[j]->node = pNode;
+ pNode = pNode2;
+ }
+ }
+ devicePtrs[i]->node.node = node;
+ devicePtrs[i]->node.cookie[0] = flags;
+ devicePtrs[i]->node.cookie[1] = oldnode;
+ break;
+ }
+ break;
+ }
+ } while (0);
+
+ prop = promGetProperty("name", &len);
+ if (prop && len > 0) {
+ if (!strcmp(prop, "sbus") || !strcmp(prop, "sbi"))
+ sbus = PROM_NODE_SBUS;
+ }
+
+ nextnode = promGetChild(node);
+ if (nextnode)
+ promWalkAssignNodes(nextnode, node, sbus, devicePtrs);
+
+ nextnode = promGetSibling(node);
+ if (nextnode)
+ promWalkAssignNodes(nextnode, node, PROM_NODE_SIBLING | sbus, devicePtrs);
+}
+
+void
+sparcPromAssignNodes(void)
+{
+ sbusDevicePtr psdp, *psdpp;
+ int n, holes = 0, i, j;
+ FILE *f;
+ sbusDevicePtr devicePtrs[32];
+
+ (void)memset(devicePtrs, 0, sizeof(devicePtrs));
+ for (psdpp = xf86SbusInfo, n = 0; (psdp = *psdpp); psdpp++, n++) {
+ if (psdp->fbNum != n)
+ holes = 1;
+ devicePtrs[psdp->fbNum] = psdp;
+ }
+ if (holes && (f = fopen("/proc/fb", "r")) != NULL) {
+ /* We could not open one of fb devices, check /proc/fb to see what
+ * were the types of the cards missed. */
+ char buffer[64];
+ int fbNum, devId;
+ static struct {
+ int devId;
+ char *prefix;
+ } procFbPrefixes[] = {
+ { SBUS_DEVICE_BW2, "BWtwo" },
+ { SBUS_DEVICE_CG14, "CGfourteen" },
+ { SBUS_DEVICE_CG6, "CGsix" },
+ { SBUS_DEVICE_CG3, "CGthree" },
+ { SBUS_DEVICE_FFB, "Creator" },
+ { SBUS_DEVICE_FFB, "Elite 3D" },
+ { SBUS_DEVICE_LEO, "Leo" },
+ { SBUS_DEVICE_TCX, "TCX" },
+ { 0, NULL },
+ };
+
+ while (fscanf(f, "%d %63s\n", &fbNum, buffer) == 2) {
+ for (i = 0; procFbPrefixes[i].devId; i++)
+ if (! strncmp(procFbPrefixes[i].prefix, buffer,
+ strlen(procFbPrefixes[i].prefix)))
+ break;
+ devId = procFbPrefixes[i].devId;
+ if (! devId) continue;
+ if (devicePtrs[fbNum]) {
+ if (devicePtrs[fbNum]->devId != devId)
+ xf86ErrorF("Inconsistent /proc/fb with FBIOGATTR\n");
+ } else if (!devicePtrs[fbNum]) {
+ devicePtrs[fbNum] = psdp = xnfcalloc(sizeof (sbusDevice), 1);
+ psdp->devId = devId;
+ psdp->fbNum = fbNum;
+ psdp->fd = -2;
+ }
+ }
+ fclose(f);
+ }
+ promGetSibling(0);
+ promWalkAssignNodes(promRootNode, 0, PROM_NODE_PREF, devicePtrs);
+ for (i = 0, j = 0; i < 32; i++)
+ if (devicePtrs[i] && devicePtrs[i]->fbNum == -1)
+ j++;
+ xf86SbusInfo = xnfrealloc(xf86SbusInfo, sizeof(psdp) * (n + j + 1));
+ for (i = 0, psdpp = xf86SbusInfo; i < 32; i++)
+ if (devicePtrs[i]) {
+ if (devicePtrs[i]->fbNum == -1) {
+ memmove(psdpp + 1, psdpp, sizeof(psdpp) * (n + 1));
+ *psdpp = devicePtrs[i];
+ } else
+ n--;
+ }
+}
+
+static char *
+promGetReg(int type)
+{
+ char *prop;
+ int len;
+ static char regstr[40];
+
+ regstr[0] = 0;
+ prop = promGetProperty("reg", &len);
+ if (prop && len >= 4) {
+ unsigned int *reg = (unsigned int *)prop;
+ if (!promP1275 || (type == PROM_NODE_SBUS) || (type == PROM_NODE_EBUS))
+ sprintf (regstr, "@%x,%x", reg[0], reg[1]);
+ else if (type == PROM_NODE_PCI) {
+ if ((reg[0] >> 8) & 7)
+ sprintf (regstr, "@%x,%x", (reg[0] >> 11) & 0x1f, (reg[0] >> 8) & 7);
+ else
+ sprintf (regstr, "@%x", (reg[0] >> 11) & 0x1f);
+ } else if (len == 4)
+ sprintf (regstr, "@%x", reg[0]);
+ else {
+ unsigned int regs[2];
+
+ /* Things get more complicated on UPA. If upa-portid exists,
+ then address is @upa-portid,second-int-in-reg, otherwise
+ it is @first-int-in-reg/16,second-int-in-reg (well, probably
+ upa-portid always exists, but just to be safe). */
+ memcpy (regs, reg, sizeof(regs));
+ prop = promGetProperty("upa-portid", &len);
+ if (prop && len == 4) {
+ reg = (unsigned int *)prop;
+ sprintf (regstr, "@%x,%x", reg[0], regs[1]);
+ } else
+ sprintf (regstr, "@%x,%x", regs[0] >> 4, regs[1]);
+ }
+ }
+ return regstr;
+}
+
+static int
+promWalkNode2Pathname(char *path, int parent, int node, int searchNode, int type)
+{
+ int nextnode;
+ int len, ntype = type;
+ char *prop, *p;
+
+ prop = promGetProperty("name", &len);
+ *path = '/';
+ if (!prop || len <= 0)
+ return 0;
+ if ((!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) && !type)
+ ntype = PROM_NODE_SBUS;
+ else if (!strcmp(prop, "ebus") && type == PROM_NODE_PCI)
+ ntype = PROM_NODE_EBUS;
+ else if (!strcmp(prop, "pci") && !type)
+ ntype = PROM_NODE_PCI;
+ strcpy (path + 1, prop);
+ p = promGetReg(type);
+ if (*p)
+ strcat (path, p);
+ if (node == searchNode)
+ return 1;
+ nextnode = promGetChild(node);
+ if (nextnode &&
+ promWalkNode2Pathname(strchr(path, 0), node, nextnode, searchNode, ntype))
+ return 1;
+ nextnode = promGetSibling(node);
+ if (nextnode &&
+ promWalkNode2Pathname(path, parent, nextnode, searchNode, type))
+ return 1;
+ return 0;
+}
+
+char *
+sparcPromNode2Pathname(sbusPromNodePtr pnode)
+{
+ char *ret;
+
+ if (!pnode->node) return NULL;
+ ret = xalloc(4096);
+ if (!ret) return NULL;
+ if (promWalkNode2Pathname(ret, promRootNode, promGetChild(promRootNode), pnode->node, 0))
+ return ret;
+ xfree(ret);
+ return NULL;
+}
+
+static int
+promWalkPathname2Node(char *name, char *regstr, int parent, int type)
+{
+ int len, node, ret;
+ char *prop, *p;
+
+ for (;;) {
+ prop = promGetProperty("name", &len);
+ if (!prop || len <= 0)
+ return 0;
+ if ((!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) && !type)
+ type = PROM_NODE_SBUS;
+ else if (!strcmp(prop, "ebus") && type == PROM_NODE_PCI)
+ type = PROM_NODE_EBUS;
+ else if (!strcmp(prop, "pci") && !type)
+ type = PROM_NODE_PCI;
+ for (node = promGetChild(parent); node; node = promGetSibling(node)) {
+ prop = promGetProperty("name", &len);
+ if (!prop || len <= 0)
+ continue;
+ if (*name && strcmp(name, prop))
+ continue;
+ if (*regstr) {
+ p = promGetReg(type);
+ if (! *p || strcmp(p + 1, regstr))
+ continue;
+ }
+ break;
+ }
+ if (!node) {
+ for (node = promGetChild(parent); node; node = promGetSibling(node)) {
+ ret = promWalkPathname2Node(name, regstr, node, type);
+ if (ret) return ret;
+ }
+ return 0;
+ }
+ name = strchr(regstr, 0) + 1;
+ if (! *name)
+ return node;
+ p = strchr(name, '/');
+ if (p)
+ *p = 0;
+ else
+ p = strchr(name, 0);
+ regstr = strchr(name, '@');
+ if (regstr)
+ *regstr++ = 0;
+ else
+ regstr = p;
+ if (name == regstr)
+ return 0;
+ parent = node;
+ }
+}
+
+int
+sparcPromPathname2Node(const char *pathName)
+{
+ int i;
+ char *name, *regstr, *p;
+
+ i = strlen(pathName);
+ name = xalloc(i + 2);
+ if (! name) return 0;
+ strcpy (name, pathName);
+ name [i + 1] = 0;
+ if (name[0] != '/')
+ return 0;
+ p = strchr(name + 1, '/');
+ if (p)
+ *p = 0;
+ else
+ p = strchr(name, 0);
+ regstr = strchr(name, '@');
+ if (regstr)
+ *regstr++ = 0;
+ else
+ regstr = p;
+ if (name + 1 == regstr)
+ return 0;
+ promGetSibling(0);
+ i = promWalkPathname2Node(name + 1, regstr, promRootNode, 0);
+ xfree(name);
+ return i;
+}
+
+pointer
+xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
+{
+ pointer ret;
+
+ if (psdp->fd == -1) {
+ psdp->fd = open(psdp->device, O_RDWR);
+ if (psdp->fd == -1)
+ return NULL;
+ } else if (psdp->fd < 0)
+ return NULL;
+
+ ret = (pointer) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ psdp->fd, offset);
+ if (ret == (pointer) -1) {
+ ret = (pointer) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
+ psdp->fd, offset);
+ }
+ if (ret == (pointer) -1)
+ return NULL;
+
+ return ret;
+}
+
+void
+xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size)
+{
+ munmap (addr, size);
+}
+
+/* Tell OS that we are driving the HW cursor ourselves. */
+void
+xf86SbusHideOsHwCursor(sbusDevicePtr psdp)
+{
+ struct fbcursor fbcursor;
+ unsigned char zeros[8];
+
+ memset(&fbcursor, 0, sizeof(fbcursor));
+ memset(&zeros, 0, sizeof(zeros));
+ fbcursor.cmap.count = 2;
+ fbcursor.cmap.red = zeros;
+ fbcursor.cmap.green = zeros;
+ fbcursor.cmap.blue = zeros;
+ fbcursor.image = (char *)zeros;
+ fbcursor.mask = (char *)zeros;
+ fbcursor.size.x = 32;
+ fbcursor.size.y = 1;
+ fbcursor.set = FB_CUR_SETALL;
+ ioctl(psdp->fd, FBIOSCURSOR, &fbcursor);
+}
+
+/* Set HW cursor colormap. */
+void
+xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg)
+{
+ struct fbcursor fbcursor;
+ unsigned char red[2], green[2], blue[2];
+
+ memset(&fbcursor, 0, sizeof(fbcursor));
+ red[0] = bg >> 16;
+ green[0] = bg >> 8;
+ blue[0] = bg;
+ red[1] = fg >> 16;
+ green[1] = fg >> 8;
+ blue[1] = fg;
+ fbcursor.cmap.count = 2;
+ fbcursor.cmap.red = red;
+ fbcursor.cmap.green = green;
+ fbcursor.cmap.blue = blue;
+ fbcursor.set = FB_CUR_SETCMAP;
+ ioctl(psdp->fd, FBIOSCURSOR, &fbcursor);
+}
diff --git a/hw/xfree86/os-support/bus/axpPci.c b/hw/xfree86/os-support/bus/axpPci.c
new file mode 100644
index 000000000..04ff8b956
--- /dev/null
+++ b/hw/xfree86/os-support/bus/axpPci.c
@@ -0,0 +1,474 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/axpPci.c,v 1.15 2002/12/12 04:12:02 dawes Exp $ */
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ */
+
+#include <stdio.h>
+#include "compiler.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "Pci.h"
+
+#include <asm/unistd.h>
+#include "../linux/lnx.h" /* for _iobase */
+
+/*
+ * Alpha/Linux platform specific PCI access functions
+ */
+static CARD32 axpPciCfgRead(PCITAG tag, int off);
+static void axpPciCfgWrite(PCITAG, int off, CARD32 val);
+static void axpPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
+
+static pciBusFuncs_t axpFuncs0 = {
+/* pciReadLong */ axpPciCfgRead,
+/* pciWriteLong */ axpPciCfgWrite,
+/* pciSetBitsLong */ axpPciCfgSetBits,
+/* pciAddrHostToBus */ pciAddrNOOP,
+/* pciAddrBusToHost */ pciAddrNOOP
+};
+
+typedef struct _axpDomainRec {
+ int domain, hose;
+ int root_bus;
+ unsigned long dense_io, sparse_io;
+ unsigned long dense_mem, sparse_mem;
+ IOADDRESS mapped_io;
+} axpDomainRec, *axpDomainPtr;
+
+#define MAX_DOMAINS (MAX_PCI_BUSES / 256)
+static axpDomainPtr xf86DomainInfo[MAX_DOMAINS] = { NULL, };
+static int pciNumDomains = 0;
+
+/*
+ * For debug, domain assignment can start downward from a fixed base
+ * (instead of up from 0) by defining FORCE_HIGH_DOMAINS. This allows
+ * debug of large domain numbers and sparse domain numbering on systems
+ * which don't have as many hoses.
+ */
+#if 0
+# define FORCE_HIGH_DOMAINS MAX_DOMAINS /* assign domains downward from here */
+#endif
+
+/*
+ * If FORCE_HIGH_DOMAINS is set, make sure it's not larger than the
+ * max domain
+ */
+#if defined(FORCE_HIGH_DOMAINS) && (FORCE_HIGH_DOMAINS > MAX_DOMAINS)
+# undef FORCE_HIGH_DOMAINS
+# define FORCE_HIGH_DOMAINS MAX_DOMAINS
+#endif
+
+static int
+axpSetupDomains(void)
+{
+ axpDomainRec axpDomain;
+ int numDomains = 0;
+ int hose;
+
+#ifndef INCLUDE_XF86_NO_DOMAIN
+
+#ifdef FORCE_HIGH_DOMAINS
+ xf86Msg(X_WARNING,
+ "DEBUG OPTION FORCE_HIGH_DOMAINS in use - DRI will *NOT* work\n");
+ numDomains = FORCE_HIGH_DOMAINS;
+#endif
+
+ /*
+ * Since each hose has a different address space, hoses are a perfect
+ * overlay for domains, so set up one domain for each hose present
+ * in the system. We have to loop through all possible hoses because
+ * some systems allow sparse I/O controllers.
+ */
+ for(hose = 0; hose < MAX_DOMAINS; hose++) {
+ axpDomain.root_bus = _iobase(IOBASE_ROOT_BUS, hose, -1, -1);
+ if (axpDomain.root_bus < 0) continue;
+
+ axpDomain.hose = hose;
+
+#ifndef FORCE_HIGH_DOMAINS
+
+ axpDomain.domain = axpDomain.hose = hose;
+ numDomains = axpDomain.domain + 1;
+
+#else /* FORCE_HIGH_DOMAINS */
+
+ axpDomain.domain = numDomains - hose - 1;
+
+ xf86Msg(X_WARNING,
+ "FORCE_HIGH_DOMAINS - assigned hose %d to domain %d\n",
+ axpDomain.hose, axpDomain.domain);
+
+#endif /* FORCE_HIGH_DOMAINS */
+
+ axpDomain.dense_io = _iobase(IOBASE_DENSE_IO, hose, -1, -1);
+ axpDomain.sparse_io = _iobase(IOBASE_SPARSE_IO, hose, -1, -1);
+ axpDomain.mapped_io = 0;
+ axpDomain.dense_mem = _iobase(IOBASE_DENSE_MEM, hose, -1, -1);
+ axpDomain.sparse_mem = _iobase(IOBASE_SPARSE_MEM, hose, -1, -1);
+
+ xf86DomainInfo[axpDomain.domain] = xnfalloc(sizeof(axpDomainRec));
+ *(xf86DomainInfo[axpDomain.domain]) = axpDomain;
+
+ /*
+ * For now, only allow a single domain (hose) on sparse i/o systems.
+ *
+ * Allowing multiple domains on sparse systems would require:
+ * 1) either
+ * a) revamping the sparse video mapping code to allow
+ * for multiple unrelated address regions
+ * -- OR --
+ * b) implementing sparse mapping directly in
+ * xf86MapDomainMemory
+ * 2) revaming read/write sparse routines to correctly handle
+ * the solution to 1)
+ * 3) implementing a sparse I/O system (mapping, inX/outX)
+ * independent of glibc, since the glibc version only
+ * supports hose 0
+ */
+ if (axpDomain.sparse_io) {
+ if (_iobase(IOBASE_ROOT_BUS, hose + 1, -1, -1) >= 0) {
+ /*
+ * It's a sparse i/o system with (at least) one more hose,
+ * show a message indicating that video is constrained to
+ * hose 0
+ */
+ xf86Msg(X_INFO,
+ "Sparse I/O system - constraining video to hose 0\n");
+ }
+ break;
+ }
+ }
+
+#else /* INCLUDE_XF86_NO_DOMAIN */
+
+ /*
+ * domain support is not included, so just set up a single domain (0)
+ * to represent the first hose so that axpPciInit will still have
+ * be able to set up the root bus
+ */
+ xf86DomainInfo[0] = xnfalloc(sizeof(axpDomainRec));
+ *(xf86DomainInfo[0]) = axpDomain;
+ numDomains = 1;
+
+#endif /* INCLUDE_XF86_NO_DOMAIN */
+
+ return numDomains;
+}
+
+void
+axpPciInit()
+{
+ axpDomainPtr pDomain;
+ int domain, bus;
+
+ pciNumDomains = axpSetupDomains();
+
+ for(domain = 0; domain < pciNumDomains; domain++) {
+ if (!(pDomain = xf86DomainInfo[domain])) continue;
+
+ /*
+ * Since any bridged buses will be behind a probed pci-pci bridge,
+ * only set up the root bus for each domain (hose) and the bridged
+ * buses will be set up as they are found.
+ */
+ bus = PCI_MAKE_BUS(domain, 0);
+ pciBusInfo[bus] = xnfalloc(sizeof(pciBusInfo_t));
+ (void)memset(pciBusInfo[bus], 0, sizeof(pciBusInfo_t));
+
+ pciBusInfo[bus]->configMech = PCI_CFG_MECH_OTHER;
+ pciBusInfo[bus]->numDevices = 32;
+ pciBusInfo[bus]->funcs = &axpFuncs0;
+ pciBusInfo[bus]->pciBusPriv = pDomain;
+
+ pciNumBuses = bus + 1;
+ }
+
+ pciFindFirstFP = pciGenFindFirst;
+ pciFindNextFP = pciGenFindNext;
+}
+
+/*
+ * Alpha/Linux PCI configuration space access routines
+ */
+static int
+axpPciBusFromTag(PCITAG tag)
+{
+ pciBusInfo_t *pBusInfo;
+ axpDomainPtr pDomain;
+ int bus, dfn;
+
+ bus = PCI_BUS_FROM_TAG(tag);
+ if ((bus >= pciNumBuses)
+ || !(pBusInfo = pciBusInfo[bus])
+ || !(pDomain = pBusInfo->pciBusPriv)
+ || (pDomain->domain != PCI_DOM_FROM_TAG(tag))) return -1;
+
+ bus = PCI_BUS_NO_DOMAIN(bus) + pDomain->root_bus;
+ dfn = PCI_DFN_FROM_TAG(tag);
+ if (_iobase(IOBASE_HOSE, -1, bus, dfn) != pDomain->hose) return -1;
+
+ return bus;
+}
+
+static CARD32
+axpPciCfgRead(PCITAG tag, int off)
+{
+ int bus, dfn;
+ CARD32 val = 0xffffffff;
+
+ if ((bus = axpPciBusFromTag(tag)) >= 0) {
+ dfn = PCI_DFN_FROM_TAG(tag);
+
+ syscall(__NR_pciconfig_read, bus, dfn, off, 4, &val);
+ }
+ return(val);
+}
+
+static void
+axpPciCfgWrite(PCITAG tag, int off, CARD32 val)
+{
+ int bus, dfn;
+
+ if ((bus = axpPciBusFromTag(tag)) >= 0) {
+ dfn = PCI_DFN_FROM_TAG(tag);
+ syscall(__NR_pciconfig_write, bus, dfn, off, 4, &val);
+ }
+}
+
+static void
+axpPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
+{
+ int bus, dfn;
+ CARD32 val = 0xffffffff;
+
+ if ((bus = axpPciBusFromTag(tag)) >= 0) {
+ dfn = PCI_DFN_FROM_TAG(tag);
+
+ syscall(__NR_pciconfig_read, bus, dfn, off, 4, &val);
+ val = (val & ~mask) | (bits & mask);
+ syscall(__NR_pciconfig_write, bus, dfn, off, 4, &val);
+ }
+}
+
+#ifndef INCLUDE_XF86_NO_DOMAIN
+
+/*
+ * Alpha/Linux addressing domain support
+ */
+
+int
+xf86GetPciDomain(PCITAG Tag)
+{
+ return PCI_DOM_FROM_TAG(Tag);
+}
+
+pointer
+xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
+ ADDRESS Base, unsigned long Size)
+{
+ axpDomainPtr pDomain;
+ int domain = PCI_DOM_FROM_TAG(Tag);
+
+ if ((domain < 0) || (domain >= pciNumDomains) ||
+ !(pDomain = xf86DomainInfo[domain]))
+ FatalError("%s called with invalid parameters\n", __FUNCTION__);
+
+ /*
+ * xf86MapVidMem already does what we need, but remember to subtract
+ * _bus_base() (the physical dense memory root of hose 0) since
+ * xf86MapVidMem is expecting an offset relative to _bus_base() rather
+ * than an actual physical address.
+ */
+ return xf86MapVidMem(ScreenNum, Flags,
+ pDomain->dense_mem + Base - _bus_base(), Size);
+}
+
+IOADDRESS
+xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
+ IOADDRESS Base, unsigned long Size)
+{
+ axpDomainPtr pDomain;
+ int domain = PCI_DOM_FROM_TAG(Tag);
+
+ if ((domain < 0) || (domain >= pciNumDomains) ||
+ !(pDomain = xf86DomainInfo[domain]))
+ FatalError("%s called with invalid parameters\n", __FUNCTION__);
+
+ /*
+ * Use glibc inx/outx routines for sparse I/O, so just return the
+ * base [this is ok since we also constrain sparse I/O systems to
+ * a single domain in axpSetupDomains()]
+ */
+ if (pDomain->sparse_io) return Base;
+
+ /*
+ * I/O addresses on Alpha are really just different physical memory
+ * addresses that the system corelogic turns into I/O commands on the
+ * bus, so just use xf86MapVidMem to map I/O as well, but remember
+ * to subtract _bus_base() (the physical dense memory root of hose 0)
+ * since xf86MapVidMem is expecting an offset relative to _bus_base()
+ * rather than an actual physical address.
+ *
+ * Map the entire I/O space (64kB) at once and only once.
+ */
+ if (!pDomain->mapped_io)
+ pDomain->mapped_io = (IOADDRESS)xf86MapVidMem(ScreenNum, Flags,
+ pDomain->dense_io - _bus_base(),
+ 0x10000);
+
+ return pDomain->mapped_io + Base;
+}
+
+int
+xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
+{
+ static unsigned long pagemask = 0;
+ unsigned char *MappedAddr;
+ unsigned long MapSize;
+ ADDRESS MapBase;
+ int i;
+
+ if (!pagemask) pagemask = xf86getpagesize() - 1;
+
+ /* Ensure page boundaries */
+ MapBase = Base & ~pagemask;
+ MapSize = ((Base + Len + pagemask) & ~pagemask) - MapBase;
+
+ /*
+ * VIDMEM_MMIO in order to get sparse mapping on sparse memory systems
+ * so we can use mmio functions to read (that way we can really get byte
+ * at a time reads on dense memory systems with byte/word instructions.
+ */
+ MappedAddr = xf86MapDomainMemory(-1, VIDMEM_READONLY | VIDMEM_MMIO,
+ Tag, MapBase, MapSize);
+
+ for (i = 0; i < Len; i++) {
+ *Buf++ = xf86ReadMmio8(MappedAddr, Base - MapBase + i);
+ }
+
+ xf86UnMapVidMem(-1, MappedAddr, MapSize);
+ return Len;
+}
+
+resPtr
+xf86PciBusAccWindowsFromOS(void)
+{
+ resPtr pRes = NULL;
+ resRange range;
+ int domain;
+
+ for(domain = 0; domain < pciNumDomains; domain++) {
+ if (!xf86DomainInfo[domain]) continue;
+
+ RANGE(range, 0, 0xffffffffUL,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, 0, 0x0000ffffUL,
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ }
+
+ return pRes;
+}
+
+resPtr
+xf86BusAccWindowsFromOS(void)
+{
+ return xf86PciBusAccWindowsFromOS();
+}
+
+resPtr
+xf86AccResFromOS(resPtr pRes)
+{
+ resRange range;
+ int domain;
+
+ for(domain = 0; domain < pciNumDomains; domain++) {
+ if (!xf86DomainInfo[domain]) continue;
+
+ /*
+ * Fallback is to claim the following areas:
+ *
+ * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
+ */
+
+ RANGE(range, 0x000c0000, 0x000effff,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ /*
+ * Fallback would be to claim well known ports in the 0x0 - 0x3ff
+ * range along with their sparse I/O aliases, but that's too
+ * imprecise. Instead claim a bare minimum here.
+ */
+ RANGE(range, 0x00000000, 0x000000ff,
+ RANGE_TYPE(ResExcIoBlock, domain)); /* For mainboard */
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+/* RANGE(range, 0x00000000, 0x00000000,
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1); */
+ RANGE(range, 0xffffffff, 0xffffffff,
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ }
+
+ return pRes;
+}
+
+#endif /* !INCLUDE_XF86_NO_DOMAIN */
+
diff --git a/hw/xfree86/os-support/bus/e8870PCI.c b/hw/xfree86/os-support/bus/e8870PCI.c
new file mode 100644
index 000000000..829de03c0
--- /dev/null
+++ b/hw/xfree86/os-support/bus/e8870PCI.c
@@ -0,0 +1,54 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
+/*
+ * Copyright (C) 2002-2003 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+/*
+ * This file contains the glue necessary for support of Intel's E8870 chipset.
+ */
+
+#include "e8870PCI.h"
+#include "xf86.h"
+#include "Pci.h"
+
+Bool
+xf86PreScanE8870(void)
+{
+ PCITAG tag;
+
+ /* Look for an E8870's Hub interface */
+ tag = PCI_MAKE_TAG(0, 0x1E, 0);
+ if (pciReadLong(tag, PCI_ID_REG) != DEVID(INTEL, 82801_P2P))
+ return FALSE;
+
+ /* XXX Fill me in... */
+ return TRUE;
+}
+
+void
+xf86PostScanE8870(void)
+{
+ /* XXX Fill me in... */
+}
diff --git a/hw/xfree86/os-support/bus/e8870PCI.h b/hw/xfree86/os-support/bus/e8870PCI.h
new file mode 100644
index 000000000..b910bcfd8
--- /dev/null
+++ b/hw/xfree86/os-support/bus/e8870PCI.h
@@ -0,0 +1,36 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.h,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
+/*
+ * Copyright (C) 2002-2003 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifndef PCI_E8870_H
+#define PCI_E8870_H 1
+
+#include <X11/Xdefs.h>
+
+Bool xf86PreScanE8870(void);
+void xf86PostScanE8870(void);
+
+#endif
diff --git a/hw/xfree86/os-support/bus/freebsdPci.c b/hw/xfree86/os-support/bus/freebsdPci.c
new file mode 100644
index 000000000..c3e621daf
--- /dev/null
+++ b/hw/xfree86/os-support/bus/freebsdPci.c
@@ -0,0 +1,167 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/freebsdPci.c,v 1.5 2002/08/27 22:07:07 tsi Exp $ */
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ */
+
+#include <stdio.h>
+#include "compiler.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "Pci.h"
+
+#include <sys/pciio.h>
+
+/*
+ * freebsd platform specific PCI access functions -- using /dev/pci
+ * needs kernel version 2.2.x
+ */
+static CARD32 freebsdPciCfgRead(PCITAG tag, int off);
+static void freebsdPciCfgWrite(PCITAG, int off, CARD32 val);
+static void freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
+
+static pciBusFuncs_t freebsdFuncs0 = {
+/* pciReadLong */ freebsdPciCfgRead,
+/* pciWriteLong */ freebsdPciCfgWrite,
+/* pciSetBitsLong */ freebsdPciCfgSetBits,
+/* pciAddrHostToBus */ pciAddrNOOP,
+/* pciAddrBusToHost */ pciAddrNOOP
+};
+
+static pciBusInfo_t freebsdPci0 = {
+/* configMech */ PCI_CFG_MECH_OTHER,
+/* numDevices */ 32,
+/* secondary */ FALSE,
+/* primary_bus */ 0,
+#ifdef PowerMAX_OS
+/* ppc_io_base */ 0,
+/* ppc_io_size */ 0,
+#endif
+/* funcs */ &freebsdFuncs0,
+/* pciBusPriv */ NULL,
+/* bridge */ NULL
+};
+
+#if !defined(__OpenBSD__)
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+#ifdef __sparc__
+#ifndef ASI_PL
+#define ASI_PL 0x88
+#endif
+#define PCI_CPU(val) ({ \
+int __ret; \
+__asm__ __volatile__("lduwa [%1] %2, %0" : "=r" (__ret) : "r" (&val), "i" (ASI_PL)); \
+__ret; \
+})
+#else
+#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \
+ ((val >> 8) & 0x0000ff00) | \
+ ((val << 8) & 0x00ff0000) | \
+ ((val << 24) & 0xff000000))
+#endif
+#else
+#define PCI_CPU(val) (val)
+#endif
+#else /* ! OpenBSD */
+/* OpenBSD has already the bytes in the right order
+ for all architectures */
+#define PCI_CPU(val) (val)
+#endif
+
+
+#define BUS(tag) (((tag)>>16)&0xff)
+#define DFN(tag) (((tag)>>8)&0xff)
+
+static int pciFd = -1;
+
+void
+freebsdPciInit()
+{
+ pciFd = open("/dev/pci", O_RDWR);
+ if (pciFd < 0)
+ return;
+
+ pciNumBuses = 1;
+ pciBusInfo[0] = &freebsdPci0;
+ pciFindFirstFP = pciGenFindFirst;
+ pciFindNextFP = pciGenFindNext;
+}
+
+static CARD32
+freebsdPciCfgRead(PCITAG tag, int off)
+{
+ struct pci_io io;
+ int error;
+ io.pi_sel.pc_bus = BUS(tag);
+ io.pi_sel.pc_dev = DFN(tag) >> 3;
+ io.pi_sel.pc_func = DFN(tag) & 7;
+ io.pi_reg = off;
+ io.pi_width = 4;
+ error = ioctl(pciFd, PCIOCREAD, &io);
+ if (error)
+ return ~0;
+ return PCI_CPU(io.pi_data);
+}
+
+static void
+freebsdPciCfgWrite(PCITAG tag, int off, CARD32 val)
+{
+ struct pci_io io;
+ io.pi_sel.pc_bus = BUS(tag);
+ io.pi_sel.pc_dev = DFN(tag) >> 3;
+ io.pi_sel.pc_func = DFN(tag) & 7;
+ io.pi_reg = off;
+ io.pi_width = 4;
+ io.pi_data = PCI_CPU(val);
+ ioctl(pciFd, PCIOCWRITE, &io);
+}
+
+static void
+freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
+{
+ CARD32 val = freebsdPciCfgRead(tag, off);
+ val = (val & ~mask) | (bits & mask);
+ freebsdPciCfgWrite(tag, off, val);
+}
diff --git a/hw/xfree86/os-support/bus/ix86Pci.c b/hw/xfree86/os-support/bus/ix86Pci.c
new file mode 100644
index 000000000..e07f5497c
--- /dev/null
+++ b/hw/xfree86/os-support/bus/ix86Pci.c
@@ -0,0 +1,690 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.18 2003/01/27 00:01:44 tsi Exp $ */
+/*
+ * ix86Pci.c - x86 PCI driver
+ *
+ * The XFree86 server PCI access functions have been reimplemented as a
+ * framework that allows each supported platform/OS to have their own
+ * platform/OS specific PCI driver.
+ *
+ * Most of the code of these functions was simply lifted from the
+ * Intel architecture specifric portion of the original Xfree86
+ * PCI code in hw/xfree86/common_hw/xf86_PCI.C...
+ *
+ * Gary Barton
+ * Concurrent Computer Corporation
+ * garyb@gate.net
+ */
+
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ *
+ * This software is derived from the original XFree86 PCI code
+ * which includes the following copyright notices as well:
+ *
+ * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
+ *
+ * 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 names of the above listed copyright holder(s)
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holder(s) make(s) no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ * This code is also based heavily on the code in FreeBSD-current, which was
+ * written by Wolfgang Stanglmeier, and contains the following copyright:
+ *
+ * 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 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.
+ */
+#include <stdio.h>
+#include "compiler.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "Pci.h"
+
+#ifdef PC98
+#define outb(port,data) _outb(port,data)
+#define outl(port,data) _outl(port,data)
+#define inb(port) _inb(port)
+#define inl(port) _inl(port)
+#endif
+
+#define PCI_CFGMECH2_ENABLE_REG 0xCF8
+#ifdef PC98
+#define PCI_CFGMECH2_FORWARD_REG 0xCF9
+#else
+#define PCI_CFGMECH2_FORWARD_REG 0xCFA
+#endif
+
+#define PCI_CFGMECH2_MAXDEV 16
+
+#define PCI_ADDR_FROM_TAG_CFG1(tag,reg) (PCI_EN | tag | (reg & 0xfc))
+#define PCI_FORWARD_FROM_TAG(tag) PCI_BUS_FROM_TAG(tag)
+#define PCI_ENABLE_FROM_TAG(tag) (0xf0 | (((tag) & 0x00000700) >> 7))
+#define PCI_ADDR_FROM_TAG_CFG2(tag,reg) (0xc000 | (((tag) & 0x0000f800) >> 3) \
+ | (reg & 0xfc))
+
+/*
+ * Intel x86 platform specific PCI access functions
+ */
+static CARD32 ix86PciReadLongSetup(PCITAG tag, int off);
+static void ix86PciWriteLongSetup(PCITAG, int off, CARD32 val);
+static void ix86PciSetBitsLongSetup(PCITAG, int off, CARD32 mask, CARD32 val);
+static CARD32 ix86PciReadLongCFG1(PCITAG tag, int off);
+static void ix86PciWriteLongCFG1(PCITAG, int off, CARD32 val);
+static void ix86PciSetBitsLongCFG1(PCITAG, int off, CARD32 mask, CARD32 val);
+static CARD32 ix86PciReadLongCFG2(PCITAG tag, int off);
+static void ix86PciWriteLongCFG2(PCITAG, int off, CARD32 val);
+static void ix86PciSetBitsLongCFG2(PCITAG, int off, CARD32 mask, CARD32 val);
+
+static pciBusFuncs_t ix86Funcs0 = {
+/* pciReadLong */ ix86PciReadLongSetup,
+/* pciWriteLong */ ix86PciWriteLongSetup,
+/* pciSetBitsLong */ ix86PciSetBitsLongSetup,
+/* pciAddrHostToBus */ pciAddrNOOP,
+/* pciAddrBusToHost */ pciAddrNOOP
+};
+
+static pciBusFuncs_t ix86Funcs1 = {
+/* pciReadLong */ ix86PciReadLongCFG1,
+/* pciWriteLong */ ix86PciWriteLongCFG1,
+/* pciSetBitsLong */ ix86PciSetBitsLongCFG1,
+/* pciAddrHostToBus */ pciAddrNOOP,
+/* pciAddrBusToHost */ pciAddrNOOP
+};
+
+static pciBusFuncs_t ix86Funcs2 = {
+/* pciReadLong */ ix86PciReadLongCFG2,
+/* pciWriteLong */ ix86PciWriteLongCFG2,
+/* pciSetBitsLong */ ix86PciSetBitsLongCFG2,
+/* pciAddrHostToBus */ pciAddrNOOP,
+/* pciAddrBusToHost */ pciAddrNOOP
+};
+
+static pciBusInfo_t ix86Pci0 = {
+/* configMech */ PCI_CFG_MECH_UNKNOWN, /* Set by ix86PciInit() */
+/* numDevices */ 0, /* Set by ix86PciInit() */
+/* secondary */ FALSE,
+/* primary_bus */ 0,
+#ifdef PowerMAX_OS
+/* ppc_io_base */ 0,
+/* ppc_io_size */ 0,
+#endif
+/* funcs */ &ix86Funcs0, /* Set by ix86PciInit() */
+/* pciBusPriv */ NULL,
+/* bridge */ NULL
+};
+
+static Bool
+ix86PciBusCheck(void)
+{
+ PCITAG tag;
+ CARD32 id, class;
+ CARD8 device;
+
+ for (device = 0; device < ix86Pci0.numDevices; device++) {
+ tag = PCI_MAKE_TAG(0, device, 0);
+ id = (*ix86Pci0.funcs->pciReadLong)(tag, PCI_ID_REG);
+
+ if ((CARD16)(id + 1U) <= (CARD16)1UL)
+ continue;
+
+ /* The rest of this is inspired by the Linux kernel */
+ class = (*ix86Pci0.funcs->pciReadLong)(tag, PCI_CLASS_REG);
+
+ /* Ignore revision id and programming interface */
+ switch (class >> 16) {
+ case (PCI_CLASS_PREHISTORIC << 8) | PCI_SUBCLASS_PREHISTORIC_MISC:
+ /* Check for vendors of known buggy chipsets */
+ id &= 0x0000ffff;
+ if ((id == PCI_VENDOR_INTEL) || (id == PCI_VENDOR_COMPAQ))
+ return TRUE;
+ continue;
+
+ case (PCI_CLASS_PREHISTORIC << 8) | PCI_SUBCLASS_PREHISTORIC_VGA:
+ case (PCI_CLASS_DISPLAY << 8) | PCI_SUBCLASS_DISPLAY_VGA:
+ case (PCI_CLASS_BRIDGE << 8) | PCI_SUBCLASS_BRIDGE_HOST:
+ return TRUE;
+
+ default:
+ break;
+ }
+ }
+ return FALSE;
+}
+
+static
+void ix86PciSelectCfgmech(void)
+{
+ static Bool beenhere = FALSE;
+ CARD32 mode1Res1 = 0, mode1Res2 = 0, oldVal1 = 0;
+ CARD8 mode2Res1 = 0, mode2Res2 = 0, oldVal2 = 0;
+ int stages = 0;
+
+ if (beenhere)
+ return; /* Been there, done that */
+
+ beenhere = TRUE;
+
+ /*
+ * Determine if motherboard chipset supports PCI Config Mech 1 or 2
+ * We rely on xf86Info.pciFlags to tell which mechanisms to try....
+ */
+ switch (xf86Info.pciFlags) {
+
+ case PCIProbe1: /* { */
+
+ xf86MsgVerb(X_INFO, 2, "PCI: Probing config type using method 1\n");
+ oldVal1 = inl(PCI_CFGMECH1_ADDRESS_REG);
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("Checking config type 1:\n"
+ "\tinitial value of MODE1_ADDR_REG is 0x%08x\n", oldVal1);
+ ErrorF("\tChecking that all bits in mask 0x7f000000 are clear\n");
+ }
+#endif
+
+ /* Assuming config type 1 to start with */
+ if ((oldVal1 & 0x7f000000) == 0) {
+
+ stages |= 0x01;
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("\tValue indicates possibly config type 1\n");
+ ErrorF("\tWriting 32-bit value 0x%08x to MODE1_ADDR_REG\n", PCI_EN);
+#if 0
+ ErrorF("\tWriting 8-bit value 0x00 to MODE1_ADDR_REG + 3\n");
+#endif
+ }
+#endif
+
+ ix86Pci0.configMech = PCI_CFG_MECH_1;
+ ix86Pci0.numDevices = PCI_CFGMECH1_MAXDEV;
+ ix86Pci0.funcs = &ix86Funcs1;
+
+ outl(PCI_CFGMECH1_ADDRESS_REG, PCI_EN);
+
+#if 0
+ /*
+ * This seems to cause some Neptune-based PCI machines to switch
+ * from config type 1 to config type 2
+ */
+ outb(PCI_CFGMECH1_ADDRESS_REG + 3, 0);
+#endif
+ mode1Res1 = inl(PCI_CFGMECH1_ADDRESS_REG);
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("\tValue read back from MODE1_ADDR_REG is 0x%08x\n",
+ mode1Res1);
+ ErrorF("\tRestoring original contents of MODE1_ADDR_REG\n");
+ }
+#endif
+
+ outl(PCI_CFGMECH1_ADDRESS_REG, oldVal1);
+
+ if (mode1Res1) {
+
+ stages |= 0x02;
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("\tValue read back is non-zero, and indicates possible"
+ " config type 1\n");
+ }
+#endif
+
+ if (ix86PciBusCheck()) {
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2)
+ ErrorF("\tBus check Confirms this: ");
+#endif
+
+ xf86MsgVerb(X_INFO, 2, "PCI: Config type is 1\n");
+ xf86MsgVerb(X_INFO, 3,
+ "PCI: stages = 0x%02x, oldVal1 = 0x%08x, mode1Res1"
+ " = 0x%08x\n", stages, oldVal1, mode1Res1);
+ return;
+ }
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("\tBus check fails to confirm this, continuing type 1"
+ " check ...\n");
+ }
+#endif
+
+ }
+
+ stages |= 0x04;
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("\tWriting 0xff000001 to MODE1_ADDR_REG\n");
+ }
+#endif
+ outl(PCI_CFGMECH1_ADDRESS_REG, 0xff000001);
+ mode1Res2 = inl(PCI_CFGMECH1_ADDRESS_REG);
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("\tValue read back from MODE1_ADDR_REG is 0x%08x\n",
+ mode1Res2);
+ ErrorF("\tRestoring original contents of MODE1_ADDR_REG\n");
+ }
+#endif
+
+ outl(PCI_CFGMECH1_ADDRESS_REG, oldVal1);
+
+ if ((mode1Res2 & 0x80000001) == 0x80000000) {
+
+ stages |= 0x08;
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("\tValue read back has only the msb set\n"
+ "\tThis indicates possible config type 1\n");
+ }
+#endif
+
+ if (ix86PciBusCheck()) {
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2)
+ ErrorF("\tBus check Confirms this: ");
+#endif
+
+ xf86MsgVerb(X_INFO, 2, "PCI: Config type is 1\n");
+ xf86MsgVerb(X_INFO, 3,
+ "PCI: stages = 0x%02x, oldVal1 = 0x%08x,\n"
+ "\tmode1Res1 = 0x%08x, mode1Res2 = 0x%08x\n",
+ stages, oldVal1, mode1Res1, mode1Res2);
+ return;
+ }
+
+#ifdef DEBUGPCI
+ if (xf86Verbose > 2) {
+ ErrorF("\tBus check fails to confirm this.\n");
+ }
+#endif
+
+ }
+ }
+
+ xf86MsgVerb(X_INFO, 3, "PCI: Standard check for type 1 failed.\n");
+ xf86MsgVerb(X_INFO, 3, "PCI: stages = 0x%02x, oldVal1 = 0x%08x,\n"
+ "\tmode1Res1 = 0x%08x, mode1Res2 = 0x%08x\n",
+ stages, oldVal1, mode1Res1, mode1Res2);
+
+ /* Try config type 2 */
+ oldVal2 = inb(PCI_CFGMECH2_ENABLE_REG);
+ if ((oldVal2 & 0xf0) == 0) {
+ ix86Pci0.configMech = PCI_CFG_MECH_2;
+ ix86Pci0.numDevices = PCI_CFGMECH2_MAXDEV;
+ ix86Pci0.funcs = &ix86Funcs2;
+
+ outb(PCI_CFGMECH2_ENABLE_REG, 0x0e);
+ mode2Res1 = inb(PCI_CFGMECH2_ENABLE_REG);
+ outb(PCI_CFGMECH2_ENABLE_REG, oldVal2);
+
+ if (mode2Res1 == 0x0e) {
+ if (ix86PciBusCheck()) {
+ xf86MsgVerb(X_INFO, 2, "PCI: Config type is 2\n");
+ return;
+ }
+ }
+ }
+ break; /* } */
+
+ case PCIProbe2: /* { */
+
+ /* The scanpci-style detection method */
+
+ xf86MsgVerb(X_INFO, 2, "PCI: Probing config type using method 2\n");
+
+ outb(PCI_CFGMECH2_ENABLE_REG, 0x00);
+ outb(PCI_CFGMECH2_FORWARD_REG, 0x00);
+ mode2Res1 = inb(PCI_CFGMECH2_ENABLE_REG);
+ mode2Res2 = inb(PCI_CFGMECH2_FORWARD_REG);
+
+ if (mode2Res1 == 0 && mode2Res2 == 0) {
+ xf86MsgVerb(X_INFO, 2, "PCI: Config type is 2\n");
+ ix86Pci0.configMech = PCI_CFG_MECH_2;
+ ix86Pci0.numDevices = PCI_CFGMECH2_MAXDEV;
+ ix86Pci0.funcs = &ix86Funcs2;
+ return;
+ }
+
+ oldVal1 = inl(PCI_CFGMECH1_ADDRESS_REG);
+ outl(PCI_CFGMECH1_ADDRESS_REG, PCI_EN);
+ mode1Res1 = inl(PCI_CFGMECH1_ADDRESS_REG);
+ outl(PCI_CFGMECH1_ADDRESS_REG, oldVal1);
+ if (mode1Res1 == PCI_EN) {
+ xf86MsgVerb(X_INFO, 2, "PCI: Config type is 1\n");
+ ix86Pci0.configMech = PCI_CFG_MECH_1;
+ ix86Pci0.numDevices = PCI_CFGMECH1_MAXDEV;
+ ix86Pci0.funcs = &ix86Funcs1;
+ return;
+ }
+ break; /* } */
+
+ case PCIForceConfig1:
+
+ xf86MsgVerb(X_INFO, 2, "PCI: Forcing config type 1\n");
+
+ ix86Pci0.configMech = PCI_CFG_MECH_1;
+ ix86Pci0.numDevices = PCI_CFGMECH1_MAXDEV;
+ ix86Pci0.funcs = &ix86Funcs1;
+ return;
+
+ case PCIForceConfig2:
+
+ xf86MsgVerb(X_INFO, 2, "PCI: Forcing config type 2\n");
+
+ ix86Pci0.configMech = PCI_CFG_MECH_2;
+ ix86Pci0.numDevices = PCI_CFGMECH2_MAXDEV;
+ ix86Pci0.funcs = &ix86Funcs2;
+ return;
+
+ case PCIOsConfig:
+ return;
+
+ case PCIForceNone:
+ break;
+ }
+
+ /* No PCI found */
+ ix86Pci0.configMech = PCI_CFG_MECH_UNKNOWN;
+ xf86MsgVerb(X_INFO, 2, "PCI: No PCI bus found or probed for\n");
+}
+
+#if 0
+static pciTagRec
+ix86PcibusTag(CARD8 bus, CARD8 cardnum, CARD8 func)
+{
+ pciTagRec tag;
+
+ tag.cfg1 = 0;
+
+ if (func > 7 || cardnum >= pciBusInfo[bus]->numDevices)
+ return tag;
+
+ switch (ix86Pci0.configMech) {
+ case PCI_CFG_MECH_1:
+ tag.cfg1 = PCI_EN | ((CARD32)bus << 16) |
+ ((CARD32)cardnum << 11) |
+ ((CARD32)func << 8);
+ break;
+
+ case PCI_CFG_MECH_2:
+ tag.cfg2.port = 0xc000 | ((CARD16)cardnum << 8);
+ tag.cfg2.enable = 0xf0 | (func << 1);
+ tag.cfg2.forward = bus;
+ break;
+ }
+
+ return tag;
+}
+#endif
+
+static CARD32
+ix86PciReadLongSetup(PCITAG Tag, int reg)
+{
+ ix86PciSelectCfgmech();
+ return (*ix86Pci0.funcs->pciReadLong)(Tag,reg);
+}
+
+static CARD32
+ix86PciReadLongCFG1(PCITAG Tag, int reg)
+{
+ CARD32 addr, data = 0;
+
+#ifdef DEBUGPCI
+ ErrorF("ix86PciReadLong 0x%lx, %d\n", Tag, reg);
+#endif
+
+ addr = PCI_ADDR_FROM_TAG_CFG1(Tag,reg);
+ outl(PCI_CFGMECH1_ADDRESS_REG, addr);
+ data = inl(PCI_CFGMECH1_DATA_REG);
+ outl(PCI_CFGMECH1_ADDRESS_REG, 0);
+
+#ifdef DEBUGPCI
+ ErrorF("ix86PciReadLong 0x%lx\n", data);
+#endif
+
+ return data;
+}
+
+static CARD32
+ix86PciReadLongCFG2(PCITAG Tag, int reg)
+{
+ CARD32 addr, data = 0;
+ CARD8 forward, enable;
+
+#ifdef DEBUGPCI
+ ErrorF("ix86PciReadLong 0x%lx, %d\n", Tag, reg);
+#endif
+
+ forward = PCI_FORWARD_FROM_TAG(Tag);
+ enable = PCI_ENABLE_FROM_TAG(Tag);
+ addr = PCI_ADDR_FROM_TAG_CFG2(Tag,reg);
+
+ outb(PCI_CFGMECH2_ENABLE_REG, enable);
+ outb(PCI_CFGMECH2_FORWARD_REG, forward);
+ data = inl((CARD16)addr);
+ outb(PCI_CFGMECH2_ENABLE_REG, 0);
+ outb(PCI_CFGMECH2_FORWARD_REG, 0);
+
+#ifdef DEBUGPCI
+ ErrorF("ix86PciReadLong 0x%lx\n", data);
+#endif
+
+ return data;
+}
+
+static void
+ix86PciWriteLongSetup(PCITAG Tag, int reg, CARD32 data)
+{
+ ix86PciSelectCfgmech();
+ (*ix86Pci0.funcs->pciWriteLong)(Tag,reg,data);
+}
+
+static void
+ix86PciWriteLongCFG1(PCITAG Tag, int reg, CARD32 data)
+{
+ CARD32 addr;
+
+ addr = PCI_ADDR_FROM_TAG_CFG1(Tag,reg);
+ outl(PCI_CFGMECH1_ADDRESS_REG, addr);
+ outl(PCI_CFGMECH1_DATA_REG, data);
+ outl(PCI_CFGMECH1_ADDRESS_REG, 0);
+}
+
+static void
+ix86PciWriteLongCFG2(PCITAG Tag, int reg, CARD32 data)
+{
+ CARD32 addr;
+ CARD8 forward, enable;
+
+ forward = PCI_FORWARD_FROM_TAG(Tag);
+ enable = PCI_ENABLE_FROM_TAG(Tag);
+ addr = PCI_ADDR_FROM_TAG_CFG2(Tag,reg);
+
+ outb(PCI_CFGMECH2_ENABLE_REG, enable);
+ outb(PCI_CFGMECH2_FORWARD_REG, forward);
+ outl((CARD16)addr, data);
+ outb(PCI_CFGMECH2_ENABLE_REG, 0);
+ outb(PCI_CFGMECH2_FORWARD_REG, 0);
+}
+
+static void
+ix86PciSetBitsLongSetup(PCITAG Tag, int reg, CARD32 mask, CARD32 val)
+{
+ ix86PciSelectCfgmech();
+ (*ix86Pci0.funcs->pciSetBitsLong)(Tag,reg,mask,val);
+}
+
+static void
+ix86PciSetBitsLongCFG1(PCITAG Tag, int reg, CARD32 mask, CARD32 val)
+{
+ CARD32 addr, data = 0;
+
+#ifdef DEBUGPCI
+ ErrorF("ix86PciSetBitsLong 0x%lx, %d\n", Tag, reg);
+#endif
+
+ addr = PCI_ADDR_FROM_TAG_CFG1(Tag,reg);
+ outl(PCI_CFGMECH1_ADDRESS_REG, addr);
+ data = inl(PCI_CFGMECH1_DATA_REG);
+ data = (data & ~mask) | (val & mask);
+ outl(PCI_CFGMECH1_DATA_REG, data);
+ outl(PCI_CFGMECH1_ADDRESS_REG, 0);
+}
+
+static void
+ix86PciSetBitsLongCFG2(PCITAG Tag, int reg, CARD32 mask, CARD32 val)
+{
+ CARD32 addr, data = 0;
+ CARD8 enable, forward;
+
+#ifdef DEBUGPCI
+ ErrorF("ix86PciSetBitsLong 0x%lx, %d\n", Tag, reg);
+#endif
+
+ forward = PCI_FORWARD_FROM_TAG(Tag);
+ enable = PCI_ENABLE_FROM_TAG(Tag);
+ addr = PCI_ADDR_FROM_TAG_CFG2(Tag,reg);
+
+ outb(PCI_CFGMECH2_ENABLE_REG, enable);
+ outb(PCI_CFGMECH2_FORWARD_REG, forward);
+ data = inl((CARD16)addr);
+ data = (data & ~mask) | (val & mask);
+ outl((CARD16)addr, data);
+ outb(PCI_CFGMECH2_ENABLE_REG, 0);
+ outb(PCI_CFGMECH2_FORWARD_REG, 0);
+}
+
+void
+ix86PciInit()
+{
+ /* Initialize pciBusInfo[] array and function pointers */
+ pciNumBuses = 1;
+ pciBusInfo[0] = &ix86Pci0;
+ pciFindFirstFP = pciGenFindFirst;
+ pciFindNextFP = pciGenFindNext;
+
+ /* Make sure that there is a PCI bus present. */
+ ix86PciSelectCfgmech();
+ if (ix86Pci0.configMech == PCI_CFG_MECH_UNKNOWN) {
+ pciNumBuses = 0;
+ pciBusInfo[0] = NULL;
+ }
+}
+
+#ifdef ARCH_PCI_HOST_BRIDGE
+
+/*
+ * A small table of host bridges that limit the number of PCI buses to less
+ * than the maximum of 256.
+ */
+static struct {
+ CARD32 devid;
+ int maxpcibus;
+} host_bridges[] = {
+ { DEVID(ALI_2, M1541), 128},
+ { DEVID(VIA, APOLLOVP1), 64},
+ { DEVID(VIA, APOLLOPRO133X), 64},
+ { DEVID(INTEL, 430HX_BRIDGE), 16},
+ { DEVID(INTEL, 440BX_BRIDGE), 32},
+};
+#define NUM_BRIDGES (sizeof(host_bridges) / sizeof(host_bridges[0]))
+
+void ARCH_PCI_HOST_BRIDGE(pciConfigPtr pPCI)
+{
+ int i;
+
+ for (i = 0; i < NUM_BRIDGES; i++) {
+ if (pPCI->pci_device_vendor == host_bridges[i].devid) {
+ pciMaxBusNum = host_bridges[i].maxpcibus;
+ break;
+ }
+ }
+}
+
+#endif /* ARCH_PCI_HOST_BRIDGE */
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
new file mode 100644
index 000000000..76194802f
--- /dev/null
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -0,0 +1,584 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c,v 1.10 2002/11/17 18:42:01 alanh Exp $ */
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ */
+
+#include <stdio.h>
+#include "compiler.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "Pci.h"
+
+/*
+ * linux platform specific PCI access functions -- using /proc/bus/pci
+ * needs kernel version 2.2.x
+ */
+static CARD32 linuxPciCfgRead(PCITAG tag, int off);
+static void linuxPciCfgWrite(PCITAG, int off, CARD32 val);
+static void linuxPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
+
+static pciBusFuncs_t linuxFuncs0 = {
+/* pciReadLong */ linuxPciCfgRead,
+/* pciWriteLong */ linuxPciCfgWrite,
+/* pciSetBitsLong */ linuxPciCfgSetBits,
+/* pciAddrHostToBus */ pciAddrNOOP,
+/* pciAddrBusToHost */ pciAddrNOOP
+};
+
+static pciBusInfo_t linuxPci0 = {
+/* configMech */ PCI_CFG_MECH_OTHER,
+/* numDevices */ 32,
+/* secondary */ FALSE,
+/* primary_bus */ 0,
+#ifdef PowerMAX_OS
+/* ppc_io_base */ 0,
+/* ppc_io_size */ 0,
+#endif
+/* funcs */ &linuxFuncs0,
+/* pciBusPriv */ NULL,
+/* bridge */ NULL
+};
+
+void
+linuxPciInit()
+{
+ struct stat st;
+ if ((xf86Info.pciFlags == PCIForceNone) ||
+ (-1 == stat("/proc/bus/pci", &st))) {
+ /* when using this as default for all linux architectures,
+ we'll need a fallback for 2.0 kernels here */
+ return;
+ }
+ pciNumBuses = 1;
+ pciBusInfo[0] = &linuxPci0;
+ pciFindFirstFP = pciGenFindFirst;
+ pciFindNextFP = pciGenFindNext;
+}
+
+static int
+linuxPciOpenFile(PCITAG tag)
+{
+ static int lbus,ldev,lfunc,fd = -1;
+ int bus, dev, func;
+ char file[32];
+
+ bus = PCI_BUS_FROM_TAG(tag);
+ dev = PCI_DEV_FROM_TAG(tag);
+ func = PCI_FUNC_FROM_TAG(tag);
+ if (fd == -1 || bus != lbus || dev != ldev || func != lfunc) {
+ if (fd != -1)
+ close(fd);
+ if (bus < 256)
+ sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
+ bus, dev, func);
+ else
+ sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
+ bus, dev, func);
+ fd = open(file,O_RDWR);
+ lbus = bus;
+ ldev = dev;
+ lfunc = func;
+ }
+ return fd;
+}
+
+static CARD32
+linuxPciCfgRead(PCITAG tag, int off)
+{
+ int fd;
+ CARD32 val = 0xffffffff;
+
+ if (-1 != (fd = linuxPciOpenFile(tag))) {
+ lseek(fd,off,SEEK_SET);
+ read(fd,&val,4);
+ }
+ return PCI_CPU(val);
+}
+
+static void
+linuxPciCfgWrite(PCITAG tag, int off, CARD32 val)
+{
+ int fd;
+
+ if (-1 != (fd = linuxPciOpenFile(tag))) {
+ lseek(fd,off,SEEK_SET);
+ val = PCI_CPU(val);
+ write(fd,&val,4);
+ }
+}
+
+static void
+linuxPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
+{
+ int fd;
+ CARD32 val = 0xffffffff;
+
+ if (-1 != (fd = linuxPciOpenFile(tag))) {
+ lseek(fd,off,SEEK_SET);
+ read(fd,&val,4);
+ val = PCI_CPU(val);
+ val = (val & ~mask) | (bits & mask);
+ val = PCI_CPU(val);
+ lseek(fd,off,SEEK_SET);
+ write(fd,&val,4);
+ }
+}
+
+#ifndef INCLUDE_XF86_NO_DOMAIN
+
+/*
+ * Compiling the following simply requires the presence of <linux/pci.c>.
+ * Actually running this is another matter altogether...
+ *
+ * This scheme requires that the kernel allow mmap()'ing of a host bridge's I/O
+ * and memory spaces through its /proc/bus/pci/BUS/DFN entry. Which one is
+ * determined by a prior ioctl().
+ *
+ * For the sparc64 port, this means 2.4.12 or later. For ppc, this
+ * functionality is almost, but not quite there yet. Alpha and other kernel
+ * ports to multi-domain architectures still need to implement this.
+ *
+ * This scheme is also predicated on the use of an IOADDRESS compatible type to
+ * designate I/O addresses. Although IOADDRESS is defined as an unsigned
+ * integral type, it is actually the virtual address of, i.e. a pointer to, the
+ * I/O port to access. And so, the inX/outX macros in "compiler.h" need to be
+ * #define'd appropriately (as is done on SPARC's).
+ *
+ * Another requirement to port this scheme to another multi-domain architecture
+ * is to add the appropriate entries in the pciControllerSizes array below.
+ *
+ * TO DO: Address the deleterious reaction some host bridges have to master
+ * aborts. This is already done for secondary PCI buses, but not yet
+ * for accesses to primary buses (except for the SPARC port, where
+ * master aborts are avoided during PCI scans).
+ */
+
+#include <linux/pci.h>
+
+#ifndef PCIIOC_BASE /* Ioctls for /proc/bus/pci/X/Y nodes. */
+#define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8)
+
+/* Get controller for PCI device. */
+#define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00)
+/* Set mmap state to I/O space. */
+#define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01)
+/* Set mmap state to MEM space. */
+#define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02)
+/* Enable/disable write-combining. */
+#define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03)
+
+#endif
+
+/* This probably shouldn't be Linux-specific */
+static pciConfigPtr
+xf86GetPciHostConfigFromTag(PCITAG Tag)
+{
+ int bus = PCI_BUS_FROM_TAG(Tag);
+ pciBusInfo_t *pBusInfo;
+
+ while ((bus < pciNumBuses) && (pBusInfo = pciBusInfo[bus])) {
+ if (bus == pBusInfo->primary_bus)
+ return pBusInfo->bridge;
+ bus = pBusInfo->primary_bus;
+ }
+
+ return NULL; /* Bad data */
+}
+
+/*
+ * This is ugly, but until I can extract this information from the kernel,
+ * it'll have to do. The default I/O space size is 64K, and 4G for memory.
+ * Anything else needs to go in this table. (PowerPC folk take note.)
+ *
+ * Note that Linux/SPARC userland is 32-bit, so 4G overflows to zero here.
+ *
+ * Please keep this table in ascending vendor/device order.
+ */
+static struct pciSizes {
+ unsigned short vendor, device;
+ unsigned long io_size, mem_size;
+} pciControllerSizes[] = {
+ {
+ PCI_VENDOR_SUN, PCI_CHIP_PSYCHO,
+ 1U << 16, 1U << 31
+ },
+ {
+ PCI_VENDOR_SUN, PCI_CHIP_SCHIZO,
+ 1U << 24, 1U << 31 /* ??? */
+ },
+ {
+ PCI_VENDOR_SUN, PCI_CHIP_SABRE,
+ 1U << 24, (unsigned long)(1ULL << 32)
+ },
+ {
+ PCI_VENDOR_SUN, PCI_CHIP_HUMMINGBIRD,
+ 1U << 24, (unsigned long)(1ULL << 32)
+ }
+};
+#define NUM_SIZES (sizeof(pciControllerSizes) / sizeof(pciControllerSizes[0]))
+
+static unsigned long
+linuxGetIOSize(PCITAG Tag)
+{
+ pciConfigPtr pPCI;
+ int i;
+
+ /* Find host bridge */
+ if ((pPCI = xf86GetPciHostConfigFromTag(Tag))) {
+ /* Look up vendor/device */
+ for (i = 0; i < NUM_SIZES; i++) {
+ if (pPCI->pci_vendor > pciControllerSizes[i].vendor)
+ continue;
+ if (pPCI->pci_vendor < pciControllerSizes[i].vendor)
+ break;
+ if (pPCI->pci_device > pciControllerSizes[i].device)
+ continue;
+ if (pPCI->pci_device < pciControllerSizes[i].device)
+ break;
+ return pciControllerSizes[i].io_size;
+ }
+ }
+
+ return 1U << 16; /* Default to 64K */
+}
+
+static void
+linuxGetSizes(PCITAG Tag, unsigned long *io_size, unsigned long *mem_size)
+{
+ pciConfigPtr pPCI;
+ int i;
+
+ *io_size = (1U << 16); /* Default to 64K */
+ *mem_size = (unsigned long)(1ULL << 32); /* Default to 4G */
+
+ /* Find host bridge */
+ if ((pPCI = xf86GetPciHostConfigFromTag(Tag))) {
+ /* Look up vendor/device */
+ for (i = 0; i < NUM_SIZES; i++) {
+ if (pPCI->pci_vendor > pciControllerSizes[i].vendor)
+ continue;
+ if (pPCI->pci_vendor < pciControllerSizes[i].vendor)
+ break;
+ if (pPCI->pci_device > pciControllerSizes[i].device)
+ continue;
+ if (pPCI->pci_device < pciControllerSizes[i].device)
+ break;
+ *io_size = pciControllerSizes[i].io_size;
+ *mem_size = pciControllerSizes[i].mem_size;
+ break;
+ }
+ }
+}
+
+int
+xf86GetPciDomain(PCITAG Tag)
+{
+ pciConfigPtr pPCI;
+ int fd, result;
+
+ pPCI = xf86GetPciHostConfigFromTag(Tag);
+
+ if (pPCI && (result = PCI_DOM_FROM_BUS(pPCI->busnum)))
+ return result;
+
+ if ((fd = linuxPciOpenFile(pPCI ? pPCI->tag : 0)) < 0)
+ return 0;
+
+ if ((result = ioctl(fd, PCIIOC_CONTROLLER, 0)) < 0)
+ return 0;
+
+ return result + 1; /* Domain 0 is reserved */
+}
+
+static pointer
+linuxMapPci(int ScreenNum, int Flags, PCITAG Tag,
+ ADDRESS Base, unsigned long Size, int mmap_ioctl)
+{
+ do {
+ pciConfigPtr pPCI;
+ unsigned char *result;
+ ADDRESS realBase, Offset;
+ int fd, mmapflags, prot;
+
+ xf86InitVidMem();
+
+ pPCI = xf86GetPciHostConfigFromTag(Tag);
+
+ if (((fd = linuxPciOpenFile(pPCI ? pPCI->tag : 0)) < 0) ||
+ (ioctl(fd, mmap_ioctl, 0) < 0))
+ break;
+
+/* Note: IA-64 doesn't compile this and doesn't need to */
+#ifdef __ia64__
+
+# ifndef MAP_WRITECOMBINED
+# define MAP_WRITECOMBINED 0x00010000
+# endif
+# ifndef MAP_NONCACHED
+# define MAP_NONCACHED 0x00020000
+# endif
+
+ if (Flags & VIDMEM_FRAMEBUFFER)
+ mmapflags = MAP_SHARED | MAP_WRITECOMBINED;
+ else
+ mmapflags = MAP_SHARED | MAP_NONCACHED
+
+#else /* !__ia64__ */
+
+ mmapflags = (Flags & VIDMEM_FRAMEBUFFER) / VIDMEM_FRAMEBUFFER;
+
+ if (ioctl(fd, PCIIOC_WRITE_COMBINE, mmapflags) < 0)
+ break;
+
+ mmapflags = MAP_SHARED;
+
+#endif /* ?__ia64__ */
+
+ /* Align to page boundary */
+ realBase = Base & ~(getpagesize() - 1);
+ Offset = Base - realBase;
+
+ if (Flags & VIDMEM_READONLY)
+ prot = PROT_READ;
+ else
+ prot = PROT_READ | PROT_WRITE;
+
+ result = mmap(NULL, Size + Offset, prot, mmapflags, fd, realBase);
+
+ if (!result || ((pointer)result == MAP_FAILED))
+ FatalError("linuxMapPci() mmap failure: %s\n", strerror(errno));
+
+ xf86MakeNewMapping(ScreenNum, Flags, realBase, Size + Offset, result);
+
+ return result + Offset;
+ } while (0);
+
+ if (mmap_ioctl == PCIIOC_MMAP_IS_MEM)
+ return xf86MapVidMem(ScreenNum, Flags, Base, Size);
+
+ return NULL;
+}
+
+pointer
+xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
+ ADDRESS Base, unsigned long Size)
+{
+ return linuxMapPci(ScreenNum, Flags, Tag, Base, Size, PCIIOC_MMAP_IS_MEM);
+}
+
+#define MAX_DOMAINS 257
+static pointer DomainMmappedIO[MAX_DOMAINS];
+
+/* This has no means of returning failure, so all errors are fatal */
+IOADDRESS
+xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
+ IOADDRESS Base, unsigned long Size)
+{
+ int domain = xf86GetPciDomain(Tag);
+
+ if ((domain <= 0) || (domain >= MAX_DOMAINS))
+ FatalError("xf86MapDomainIO(): domain out of range\n");
+
+ /* Permanently map all of I/O space */
+ if (!DomainMmappedIO[domain]) {
+ DomainMmappedIO[domain] = linuxMapPci(ScreenNum, Flags, Tag,
+ 0, linuxGetIOSize(Tag),
+ PCIIOC_MMAP_IS_IO);
+ if (!DomainMmappedIO[domain])
+ FatalError("xf86MapDomainIO(): mmap() failure\n");
+ }
+
+ return (IOADDRESS)DomainMmappedIO[domain] + Base;
+}
+
+int
+xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
+{
+ unsigned char *ptr, *src;
+ ADDRESS offset;
+ unsigned long size;
+ int len, pagemask = getpagesize() - 1;
+
+ /* Ensure page boundaries */
+ offset = Base & ~pagemask;
+ size = ((Base + Len + pagemask) & ~pagemask) - offset;
+
+ ptr = xf86MapDomainMemory(-1, VIDMEM_READONLY, Tag, offset, size);
+
+ if (!ptr)
+ return -1;
+
+ /* Using memcpy() here can hang the system */
+ src = ptr + (Base - offset);
+ for (len = Len; len-- > 0;)
+ *Buf++ = *src++;
+
+ xf86UnMapVidMem(-1, ptr, size);
+
+ return Len;
+}
+
+resPtr
+xf86BusAccWindowsFromOS(void)
+{
+ pciConfigPtr *ppPCI, pPCI;
+ resPtr pRes = NULL;
+ resRange range;
+ unsigned long io_size, mem_size;
+ int domain;
+
+ if ((ppPCI = xf86scanpci(0))) {
+ for (; (pPCI = *ppPCI); ppPCI++) {
+ if ((pPCI->pci_base_class != PCI_CLASS_BRIDGE) ||
+ (pPCI->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST))
+ continue;
+
+ domain = xf86GetPciDomain(pPCI->tag);
+ linuxGetSizes(pPCI->tag, &io_size, &mem_size);
+
+ RANGE(range, 0, (ADDRESS)(mem_size - 1),
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, 0, (IOADDRESS)(io_size - 1),
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ if (domain <= 0)
+ break;
+ }
+ }
+
+ return pRes;
+}
+
+resPtr
+xf86PciBusAccWindowsFromOS(void)
+{
+ pciConfigPtr *ppPCI, pPCI;
+ resPtr pRes = NULL;
+ resRange range;
+ unsigned long io_size, mem_size;
+ int domain;
+
+ if ((ppPCI = xf86scanpci(0))) {
+ for (; (pPCI = *ppPCI); ppPCI++) {
+ if ((pPCI->pci_base_class != PCI_CLASS_BRIDGE) ||
+ (pPCI->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST))
+ continue;
+
+ domain = xf86GetPciDomain(pPCI->tag);
+ linuxGetSizes(pPCI->tag, &io_size, &mem_size);
+
+ RANGE(range, 0, (ADDRESS)(mem_size - 1),
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, 0, (IOADDRESS)(io_size - 1),
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ if (domain <= 0)
+ break;
+ }
+ }
+
+ return pRes;
+}
+
+
+resPtr
+xf86AccResFromOS(resPtr pRes)
+{
+ pciConfigPtr *ppPCI, pPCI;
+ resRange range;
+ unsigned long io_size, mem_size;
+ int domain;
+
+ if ((ppPCI = xf86scanpci(0))) {
+ for (; (pPCI = *ppPCI); ppPCI++) {
+ if ((pPCI->pci_base_class != PCI_CLASS_BRIDGE) ||
+ (pPCI->pci_sub_class != PCI_SUBCLASS_BRIDGE_HOST))
+ continue;
+
+ domain = xf86GetPciDomain(pPCI->tag);
+ linuxGetSizes(pPCI->tag, &io_size, &mem_size);
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so
+ * that resources that are (or appear to be) unallocated can be
+ * relocated.
+ */
+ RANGE(range, 0x00000000u, 0x0009ffffu,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ RANGE(range, 0x000c0000u, 0x000effffu,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ RANGE(range, 0x000f0000u, 0x000fffffu,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, (ADDRESS)(mem_size - 1), (ADDRESS)(mem_size - 1),
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, 0x00000000u, 0x00000000u,
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ RANGE(range, (IOADDRESS)(io_size - 1), (IOADDRESS)(io_size - 1),
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ if (domain <= 0)
+ break;
+ }
+ }
+
+ return pRes;
+}
+
+#endif /* !INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/bus/netbsdPci.c b/hw/xfree86/os-support/bus/netbsdPci.c
new file mode 100644
index 000000000..637bd7021
--- /dev/null
+++ b/hw/xfree86/os-support/bus/netbsdPci.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 1994-2002 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project
+ * shall not be used in advertising or otherwise to promote the sale,
+ * use or other dealings in this Software without prior written
+ * authorization from the XFree86 Project.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v 1.2 2002/08/27 22:07:07 tsi Exp $ */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <dev/pci/pciio.h>
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86OSpriv.h"
+
+#include "Pci.h"
+
+static CARD32 netbsdPciConfRead(PCITAG, int);
+static void netbsdPciConfWrite(PCITAG, int, CARD32);
+static void netbsdPciSetBits(PCITAG, int, CARD32, CARD32);
+
+static int devpci = -1;
+
+static pciBusFuncs_t netbsdFuncs0 = {
+/* pciReadLong */ netbsdPciConfRead,
+/* pciWriteLong */ netbsdPciConfWrite,
+/* pciSetBitsLong */ netbsdPciSetBits,
+/* pciAddrHostToBus */ pciAddrNOOP,
+/* pciAddrBusToHost */ pciAddrNOOP
+};
+
+static pciBusInfo_t netbsdPci0 = {
+/* configMech */ PCI_CFG_MECH_OTHER,
+/* numDevices */ 32,
+/* secondary */ FALSE,
+/* primary_bus */ 0,
+#ifdef PowerMAX_OS
+/* io_base */ 0,
+/* io_size */ 0,
+#endif
+/* funcs */ &netbsdFuncs0,
+/* pciBusPriv */ NULL,
+/* bridge */ NULL
+};
+
+void
+netbsdPciInit()
+{
+
+ devpci = open("/dev/pci0", O_RDWR);
+ if (devpci == -1)
+ FatalError("netbsdPciInit: can't open /dev/pci0\n");
+
+ pciNumBuses = 1;
+ pciBusInfo[0] = &netbsdPci0;
+ pciFindFirstFP = pciGenFindFirst;
+ pciFindNextFP = pciGenFindNext;
+}
+
+static CARD32
+netbsdPciConfRead(PCITAG tag, int reg)
+{
+ struct pciio_bdf_cfgreg bdfr;
+
+ bdfr.bus = PCI_BUS_FROM_TAG(tag);
+ bdfr.device = PCI_DEV_FROM_TAG(tag);
+ bdfr.function = PCI_FUNC_FROM_TAG(tag);
+ bdfr.cfgreg.reg = reg;
+
+ if (ioctl(devpci, PCI_IOC_BDF_CFGREAD, &bdfr) == -1)
+ FatalError("netbsdPciConfRead: failed on %d/%d/%d\n",
+ bdfr.bus, bdfr.device, bdfr.function);
+
+ return (bdfr.cfgreg.val);
+}
+
+static void
+netbsdPciConfWrite(PCITAG tag, int reg, CARD32 val)
+{
+ struct pciio_bdf_cfgreg bdfr;
+
+ bdfr.bus = PCI_BUS_FROM_TAG(tag);
+ bdfr.device = PCI_DEV_FROM_TAG(tag);
+ bdfr.function = PCI_FUNC_FROM_TAG(tag);
+ bdfr.cfgreg.reg = reg;
+ bdfr.cfgreg.val = val;
+
+ if (ioctl(devpci, PCI_IOC_BDF_CFGWRITE, &bdfr) == -1)
+ FatalError("netbsdPciConfWrite: failed on %d/%d/%d\n",
+ bdfr.bus, bdfr.device, bdfr.function);
+}
+
+static void
+netbsdPciSetBits(PCITAG tag, int reg, CARD32 mask, CARD32 bits)
+{
+ CARD32 val;
+
+ val = netbsdPciConfRead(tag, reg);
+ val = (val & ~mask) | (bits & mask);
+ netbsdPciConfWrite(tag, reg, val);
+}
diff --git a/hw/xfree86/os-support/bus/ppcPci.c b/hw/xfree86/os-support/bus/ppcPci.c
new file mode 100644
index 000000000..2aa98355b
--- /dev/null
+++ b/hw/xfree86/os-support/bus/ppcPci.c
@@ -0,0 +1,212 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.9 2002/08/27 22:07:07 tsi Exp $ */
+/*
+ * ppcPci.c - PowerPC PCI access functions
+ *
+ * PCI driver functions supporting Motorola PowerPC platforms
+ * including Powerstack(RiscPC/RiscPC+), PowerStackII, MTX, and
+ * MVME 160x/260x/360x/460x VME boards
+ *
+ * Gary Barton
+ * Concurrent Computer Corporation
+ * garyb@gate.net
+ *
+ */
+
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ */
+
+#include <stdio.h>
+#include "compiler.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "Pci.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED (pointer)(-1)
+#endif
+
+void
+ppcPciInit()
+{
+#if defined(PowerMAX_OS)
+ extern void pmaxPciInit(void);
+
+ pmaxPciInit();
+
+#else
+
+ extern void motoppcPciInit(void);
+
+ motoppcPciInit();
+
+#endif
+}
+
+/*
+ * Motorola PowerPC platform support
+ *
+ * The following code should support the MVME 1600 & 2600 VME boards
+ * as well as the various PowerStack and RiscPC models. All of these
+ * machines support PCI config mechanism #1 and use the std config
+ * address and data regs locations:
+ * cfg address reg = 0xcf8 (PCI I/O)
+ * cfg data reg = 0xcfc (PCI I/O)
+ *
+ * The moto machines do have different address maps on either side
+ * of the PCI-host bridge though.
+ */
+static ADDRESS motoppcBusAddrToHostAddr(PCITAG, PciAddrType, ADDRESS);
+static ADDRESS motoppcHostAddrToBusAddr(PCITAG, PciAddrType, ADDRESS);
+
+static pciBusFuncs_t motoppcFuncs0 = {
+/* pciReadLong */ pciCfgMech1Read,
+/* pciWriteLong */ pciCfgMech1Write,
+/* pciSetBitsLong */ pciCfgMech1SetBits,
+/* pciAddrHostToBus */ motoppcHostAddrToBusAddr,
+/* pciAddrBusToHost */ motoppcBusAddrToHostAddr
+};
+
+static pciBusInfo_t motoppcPci0 = {
+/* configMech */ PCI_CFG_MECH_1,
+/* numDevices */ 32,
+/* secondary */ FALSE,
+/* primary_bus */ 0,
+#ifdef PowerMAX_OS
+/* ppc_io_base */ 0x80000000,
+/* ppc_io_size */ 64 * 1024,
+#endif
+/* funcs */ &motoppcFuncs0,
+/* pciBusPriv */ NULL,
+/* bridge */ NULL
+};
+
+extern volatile unsigned char *ioBase;
+
+void
+motoppcPciInit()
+{
+ pciNumBuses = 1;
+ pciBusInfo[0] = &motoppcPci0;
+ pciFindFirstFP = pciGenFindFirst;
+ pciFindNextFP = pciGenFindNext;
+
+ if (ioBase == MAP_FAILED) {
+ ppcPciIoMap(0); /* Make inb/outb et al work for pci0 and its secondaries */
+
+ if (ioBase == MAP_FAILED) {
+ FatalError("motoppcPciInit: Cannot map pci0 I/O segment!!!\n");
+ /*NOTREACHED*/
+ }
+ }
+}
+
+extern unsigned long motoPciMemBase = 0;
+
+#if defined(Lynx) && defined(__powerpc__)
+extern unsigned long motoPciMemLen = 0x40000000;
+#else
+extern unsigned long motoPciMemLen = 0x3f000000;
+#endif
+
+extern unsigned long motoPciMemBaseCPU = 0xc0000000;
+
+static ADDRESS
+motoppcBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
+{
+ unsigned long addr_l = (unsigned long)addr;
+
+ if (type == PCI_MEM) {
+ if (addr_l >= motoPciMemBase && addr_l < motoPciMemLen)
+ /*
+ * PCI memory space addresses [0-0x3effffff] are
+ * are seen at [0xc0000000,0xfeffffff] on moto host
+ */
+ return((ADDRESS)((motoPciMemBaseCPU - motoPciMemBase) + addr_l));
+
+ else if (addr_l >= 0x80000000)
+ /*
+ * Moto host memory [0,0x7fffffff] is seen at
+ * [0x80000000,0xffffffff] on PCI bus
+ */
+ return((ADDRESS)(addr_l & 0x7fffffff));
+ else
+ FatalError("motoppcBusAddrToHostAddr: PCI addr 0x%x is not accessible to host!!!\n",
+ addr_l);
+ } else
+ return addr;
+
+ /*NOTREACHED*/
+}
+
+static ADDRESS
+motoppcHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
+{
+ unsigned long addr_l = (unsigned long)addr;
+
+ if (type == PCI_MEM) {
+ if (addr_l < 0x80000000)
+ /*
+ * Moto host memory [0,0x7fffffff] is seen at
+ * [0x80000000,0xffffffff] on PCI bus
+ */
+ return((ADDRESS)(0x80000000 | addr_l));
+
+ else if (addr_l >= motoPciMemBaseCPU && addr_l < motoPciMemBaseCPU + motoPciMemLen)
+ /*
+ * PCI memory space addresses [0-0x3effffff] are
+ * are seen at [0xc0000000,0xfeffffff] on moto host
+ */
+ return((ADDRESS)(addr_l - (motoPciMemBaseCPU - motoPciMemBase)));
+
+ else
+ FatalError("motoppcHostAddrToBusAddr: Host addr 0x%x is not accessible to PCI!!!\n",
+ addr_l);
+ } else
+ return addr;
+
+ /*NOTREACHED*/
+}
diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c
new file mode 100644
index 000000000..24bbec44c
--- /dev/null
+++ b/hw/xfree86/os-support/bus/sparcPci.c
@@ -0,0 +1,1048 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/sparcPci.c,v 1.12 2003/01/02 18:11:32 tsi Exp $ */
+/*
+ * Copyright (C) 2001 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "Pci.h"
+#include "xf86sbusBus.h"
+
+#if defined(sun)
+
+extern char *apertureDevName;
+static int apertureFd = -1;
+
+/*
+ * A version of xf86MapVidMem() that allows for 64-bit displacements (but not
+ * sizes). Areas thus mapped can be unmapped by xf86UnMapVidMem().
+ */
+static pointer
+sparcMapAperture(int iScreen, int Flags,
+ unsigned long long Base, unsigned long Size)
+{
+ pointer result;
+ static int lastFlags = 0;
+
+ /* Assume both Base & Size are multiples of the page size */
+
+ if ((apertureFd < 0) || (Flags != lastFlags)) {
+ if (apertureFd >= 0)
+ close(apertureFd);
+ lastFlags = Flags;
+ apertureFd = open(apertureDevName,
+ (Flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
+ if (apertureFd < 0)
+ FatalError("sparcMapAperture: open failure: %s\n",
+ strerror(errno));
+ }
+
+ result = mmap(NULL, Size,
+ (Flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, apertureFd, (off_t)Base);
+
+ if (result == MAP_FAILED)
+ FatalError("sparcMapAperture: mmap failure: %s\n", strerror(errno));
+
+ return result;
+}
+
+/*
+ * Platform-specific bus privates.
+ */
+typedef struct _sparcDomainRec {
+ unsigned long long io_addr, io_size;
+ unsigned long long mem_addr, mem_size;
+ pointer pci, io;
+ int bus_min, bus_max;
+ unsigned char dfn_mask[256 / 8];
+} sparcDomainRec, *sparcDomainPtr;
+
+#define SetBitInMap(bit, map) \
+ do { \
+ int _bit = (bit); \
+ (map)[_bit >> 3] |= 1 << (_bit & 7); \
+ } while (0)
+
+#define IsBitSetInMap(bit, map) \
+ ((map)[(bit) >> 3] & (1 << ((bit) & 7)))
+
+/*
+ * Domain 0 is reserved for the one that represents the system as a whole, i.e.
+ * the one without any resource relocations.
+ */
+#define MAX_DOMAINS (MAX_PCI_BUSES / 256)
+static sparcDomainPtr xf86DomainInfo[MAX_DOMAINS];
+static int pciNumDomains = 1;
+
+/* Variables that are assigned this must be declared volatile */
+#define PciReg(base, tag, off, type) \
+ *(volatile type *)(pointer)((char *)(base) + \
+ (PCI_TAG_NO_DOMAIN(tag) | (off)))
+
+/* Generic SPARC PCI access functions */
+static CARD32
+sparcPciCfgRead32(PCITAG tag, int off)
+{
+ pciBusInfo_t *pBusInfo;
+ sparcDomainPtr pDomain;
+ volatile CARD32 result = (CARD32)(-1); /* Must be volatile */
+ int bus;
+
+ if ((off >= 0) && (off <= 252) && !(off & 3) &&
+ ((bus = PCI_BUS_FROM_TAG(tag)) < pciNumBuses) &&
+ (pBusInfo = pciBusInfo[bus]) && (pDomain = pBusInfo->pciBusPriv) &&
+ (bus >= pDomain->bus_min) && (bus < pDomain->bus_max) &&
+ ((bus > pDomain->bus_min) ||
+ IsBitSetInMap(PCI_DFN_FROM_TAG(tag), pDomain->dfn_mask))) {
+ result = PciReg(pDomain->pci, tag, off, CARD32);
+
+ result = PCI_CPU(result);
+ }
+
+ return result;
+}
+
+static void
+sparcPciCfgWrite32(PCITAG tag, int off, CARD32 val)
+{
+ pciBusInfo_t *pBusInfo;
+ sparcDomainPtr pDomain;
+ int bus;
+
+ if ((off < 0) || (off > 252) || (off & 3) ||
+ ((bus = PCI_BUS_FROM_TAG(tag)) >= pciNumBuses) ||
+ !(pBusInfo = pciBusInfo[bus]) || !(pDomain = pBusInfo->pciBusPriv) ||
+ (bus < pDomain->bus_min) || (bus >= pDomain->bus_max) ||
+ ((bus == pDomain->bus_min) &&
+ !IsBitSetInMap(PCI_DFN_FROM_TAG(tag), pDomain->dfn_mask)))
+ return;
+
+ val = PCI_CPU(val);
+ PciReg(pDomain->pci, tag, off, CARD32) = val;
+}
+
+static void
+sparcPciCfgSetBits32(PCITAG tag, int off, CARD32 mask, CARD32 bits)
+{
+ CARD32 PciVal;
+
+ PciVal = sparcPciCfgRead32(tag, off);
+ PciVal &= ~mask;
+ PciVal |= bits;
+ sparcPciCfgWrite32(tag, off, PciVal);
+}
+
+static pciBusFuncs_t sparcPCIFunctions =
+{
+ sparcPciCfgRead32,
+ sparcPciCfgWrite32,
+ sparcPciCfgSetBits32,
+ pciAddrNOOP,
+ pciAddrNOOP
+};
+
+/*
+ * Sabre-specific versions of the above because of its peculiar access size
+ * requirements.
+ */
+static CARD32
+sabrePciCfgRead32(PCITAG tag, int off)
+{
+ pciBusInfo_t *pBusInfo;
+ sparcDomainPtr pDomain;
+ volatile CARD32 result; /* Must be volatile */
+ int bus;
+
+ if (PCI_BDEV_FROM_TAG(tag))
+ return sparcPciCfgRead32(tag, off);
+
+ if (PCI_FUNC_FROM_TAG(tag) || (off < 0) || (off > 252) || (off & 3) ||
+ ((bus = PCI_BUS_FROM_TAG(tag)) >= pciNumBuses) ||
+ !(pBusInfo = pciBusInfo[bus]) || !(pDomain = pBusInfo->pciBusPriv) ||
+ (bus != pDomain->bus_min))
+ return (CARD32)(-1);
+
+ if (off < 8) {
+ result = (PciReg(pDomain->pci, tag, off, CARD16) << 16) |
+ PciReg(pDomain->pci, tag, off + 2, CARD16);
+ return PCI_CPU(result);
+ }
+
+ result = (PciReg(pDomain->pci, tag, off + 3, CARD8) << 24) |
+ (PciReg(pDomain->pci, tag, off + 2, CARD8) << 16) |
+ (PciReg(pDomain->pci, tag, off + 1, CARD8) << 8) |
+ (PciReg(pDomain->pci, tag, off , CARD8) );
+ return result;
+}
+
+static void
+sabrePciCfgWrite32(PCITAG tag, int off, CARD32 val)
+{
+ pciBusInfo_t *pBusInfo;
+ sparcDomainPtr pDomain;
+ int bus;
+
+ if (PCI_BDEV_FROM_TAG(tag))
+ sparcPciCfgWrite32(tag, off, val);
+ else if (!PCI_FUNC_FROM_TAG(tag) &&
+ (off >= 0) && (off <= 252) && !(off & 3) &&
+ ((bus = PCI_BUS_FROM_TAG(tag)) < pciNumBuses) &&
+ (pBusInfo = pciBusInfo[bus]) &&
+ (pDomain = pBusInfo->pciBusPriv) &&
+ (bus == pDomain->bus_min)) {
+ if (off < 8) {
+ val = PCI_CPU(val);
+ PciReg(pDomain->pci, tag, off , CARD16) = val >> 16;
+ PciReg(pDomain->pci, tag, off + 2, CARD16) = val;
+ } else {
+ PciReg(pDomain->pci, tag, off , CARD8) = val;
+ PciReg(pDomain->pci, tag, off + 1, CARD8) = val >> 8;
+ PciReg(pDomain->pci, tag, off + 2, CARD8) = val >> 16;
+ PciReg(pDomain->pci, tag, off + 3, CARD8) = val >> 24;
+ }
+ }
+}
+
+static void
+sabrePciCfgSetBits32(PCITAG tag, int off, CARD32 mask, CARD32 bits)
+{
+ CARD32 PciVal;
+
+ PciVal = sabrePciCfgRead32(tag, off);
+ PciVal &= ~mask;
+ PciVal |= bits;
+ sabrePciCfgWrite32(tag, off, PciVal);
+}
+
+static pciBusFuncs_t sabrePCIFunctions =
+{
+ sabrePciCfgRead32,
+ sabrePciCfgWrite32,
+ sabrePciCfgSetBits32,
+ pciAddrNOOP,
+ pciAddrNOOP
+};
+
+static int pagemask;
+
+/* Scan PROM for all PCI host bridges in the system */
+void
+sparcPciInit(void)
+{
+ int node, node2;
+
+ if (!xf86LinearVidMem())
+ return;
+
+ apertureFd = open(apertureDevName, O_RDWR);
+ if (apertureFd < 0) {
+ xf86Msg(X_ERROR,
+ "sparcPciInit: open failure: %s\n", strerror(errno));
+ return;
+ }
+
+ sparcPromInit();
+ pagemask = xf86getpagesize() - 1;
+
+ for (node = promGetChild(promRootNode);
+ node;
+ node = promGetSibling(node)) {
+ unsigned long long pci_addr;
+ sparcDomainRec domain;
+ sparcDomainPtr pDomain;
+ pciBusFuncs_p pFunctions;
+ char *prop_val;
+ int prop_len, bus;
+
+ prop_val = promGetProperty("name", &prop_len);
+ /* Some PROMs include the trailing null; some don't */
+ if (!prop_val || (prop_len < 3) || (prop_len > 4) ||
+ strcmp(prop_val, "pci"))
+ continue;
+
+ prop_val = promGetProperty("model", &prop_len);
+ if (!prop_val || (prop_len <= 0)) {
+ prop_val = promGetProperty("compatible", &prop_len);
+ if (!prop_val || (prop_len <= 0))
+ continue;
+ }
+
+ pFunctions = &sparcPCIFunctions;
+ (void)memset(&domain, 0, sizeof(domain));
+
+ if (!strncmp("SUNW,sabre", prop_val, prop_len) ||
+ !strncmp("pci108e,a000", prop_val, prop_len) ||
+ !strncmp("pci108e,a001", prop_val, prop_len)) {
+ /*
+ * There can only be one "Sabre" bridge in a system. It provides
+ * PCI configuration space, a 24-bit I/O space and a 32-bit memory
+ * space, all three of which are at fixed physical CPU addresses.
+ */
+ static Bool sabre_seen = FALSE;
+
+ xf86Msg(X_INFO,
+ "Sabre or Hummingbird PCI host bridge found (\"%s\")\n",
+ prop_val);
+
+ /* There can only be one Sabre */
+ if (sabre_seen)
+ continue;
+ sabre_seen = TRUE;
+
+ /* Get "bus-range" property */
+ prop_val = promGetProperty("bus-range", &prop_len);
+ if (!prop_val || (prop_len != 8) ||
+ (((unsigned int *)prop_val)[0]) ||
+ (((unsigned int *)prop_val)[1] >= 256))
+ continue;
+
+ pci_addr = 0x01fe01000000ull;
+ domain.io_addr = 0x01fe02000000ull;
+ domain.io_size = 0x000001000000ull;
+ domain.mem_addr = 0x01ff00000000ull;
+ domain.mem_size = 0x000100000000ull;
+ domain.bus_min = 0; /* Always */
+ domain.bus_max = ((int *)prop_val)[1];
+
+ pFunctions = &sabrePCIFunctions;
+ } else
+ if (!strncmp("SUNW,psycho", prop_val, prop_len) ||
+ !strncmp("pci108e,8000", prop_val, prop_len)) {
+ /*
+ * A "Psycho" host bridge provides two PCI interfaces, each with
+ * its own 16-bit I/O and 31-bit memory spaces. Both share the
+ * same PCI configuration space. Here, they are assigned separate
+ * domain numbers to prevent unintentional I/O and/or memory
+ * resource conflicts.
+ */
+ xf86Msg(X_INFO,
+ "Psycho PCI host bridge found (\"%s\")\n", prop_val);
+
+ /* Get "bus-range" property */
+ prop_val = promGetProperty("bus-range", &prop_len);
+ if (!prop_val || (prop_len != 8) ||
+ (((unsigned int *)prop_val)[1] >= 256) ||
+ (((unsigned int *)prop_val)[0] > ((unsigned int *)prop_val)[1]))
+ continue;
+
+ domain.bus_min = ((int *)prop_val)[0];
+ domain.bus_max = ((int *)prop_val)[1];
+
+ /* Get "ranges" property */
+ prop_val = promGetProperty("ranges", &prop_len);
+ if (!prop_val || (prop_len != 112) ||
+ prop_val[0] || (prop_val[28] != 0x01u) ||
+ (prop_val[56] != 0x02u) || (prop_val[84] != 0x03u) ||
+ (((unsigned int *)prop_val)[4] != 0x01000000u) ||
+ ((unsigned int *)prop_val)[5] ||
+ ((unsigned int *)prop_val)[12] ||
+ (((unsigned int *)prop_val)[13] != 0x00010000u) ||
+ ((unsigned int *)prop_val)[19] ||
+ (((unsigned int *)prop_val)[20] != 0x80000000u) ||
+ ((((unsigned int *)prop_val)[11] & ~0x00010000u) !=
+ 0x02000000u) ||
+ (((unsigned int *)prop_val)[18] & ~0x80000000u) ||
+ (((unsigned int *)prop_val)[3] !=
+ ((unsigned int *)prop_val)[10]) ||
+ (((unsigned int *)prop_val)[17] !=
+ ((unsigned int *)prop_val)[24]) ||
+ (((unsigned int *)prop_val)[18] !=
+ ((unsigned int *)prop_val)[25]) ||
+ (((unsigned int *)prop_val)[19] !=
+ ((unsigned int *)prop_val)[26]) ||
+ (((unsigned int *)prop_val)[20] !=
+ ((unsigned int *)prop_val)[27]))
+ continue;
+
+ /* Use memcpy() to avoid alignment issues */
+ (void)memcpy(&pci_addr, prop_val + 12,
+ sizeof(pci_addr));
+ (void)memcpy(&domain.io_addr, prop_val + 40,
+ sizeof(domain.io_addr));
+ (void)memcpy(&domain.mem_addr, prop_val + 68,
+ sizeof(domain.mem_addr));
+
+ domain.io_size = 0x000000010000ull;
+ domain.mem_size = 0x000080000000ull;
+ } else
+ if (!strncmp("SUNW,schizo", prop_val, prop_len) ||
+ !strncmp("pci108e,8001", prop_val, prop_len)) {
+ /*
+ * I have no docs on the "Schizo", but judging from the Linux
+ * kernel, it also provides two PCI domains. Each PCI
+ * configuration space is the usual 16M in size, followed by a
+ * variable-length I/O space. Each domain also provides a
+ * variable-length memory space. The kernel seems to think the I/O
+ * spaces are 16M long, and the memory spaces, 2G, but these
+ * assumptions are actually only present in source code comments.
+ * Sun has, however, confirmed to me the validity of these
+ * assumptions.
+ */
+ volatile unsigned long long mem_match, mem_mask, io_match, io_mask;
+ unsigned long Offset;
+ pointer pSchizo;
+
+ xf86Msg(X_INFO,
+ "Schizo PCI host bridge found (\"%s\")\n", prop_val);
+
+ /* Get "bus-range" property */
+ prop_val = promGetProperty("bus-range", &prop_len);
+ if (!prop_val || (prop_len != 8) ||
+ (((unsigned int *)prop_val)[1] >= 256) ||
+ (((unsigned int *)prop_val)[0] > ((unsigned int *)prop_val)[1]))
+ continue;
+
+ domain.bus_min = ((int *)prop_val)[0];
+ domain.bus_max = ((int *)prop_val)[1];
+
+ /* Get "reg" property */
+ prop_val = promGetProperty("reg", &prop_len);
+ if (!prop_val || (prop_len != 48))
+ continue;
+
+ /* Temporarily map some of Schizo's registers */
+ pSchizo = sparcMapAperture(-1, VIDMEM_MMIO,
+ ((unsigned long long *)prop_val)[2] - 0x000000010000ull,
+ 0x00010000ul);
+
+ /* Determine where PCI config, I/O and memory spaces reside */
+ if ((((unsigned long long *)prop_val)[0] & 0x000000700000ull) ==
+ 0x000000600000ull)
+ Offset = 0x0040;
+ else
+ Offset = 0x0060;
+
+ mem_match = PciReg(pSchizo, 0, Offset, unsigned long long);
+ mem_mask = PciReg(pSchizo, 0, Offset + 8, unsigned long long);
+ io_match = PciReg(pSchizo, 0, Offset + 16, unsigned long long);
+ io_mask = PciReg(pSchizo, 0, Offset + 24, unsigned long long);
+
+ /* Unmap Schizo registers */
+ xf86UnMapVidMem(-1, pSchizo, 0x00010000ul);
+
+ /* Calculate sizes */
+ mem_mask = (((mem_mask - 1) ^ mem_mask) >> 1) + 1;
+ io_mask = (((io_mask - 1) ^ io_mask ) >> 1) + 1;
+
+ if (io_mask <= 0x000001000000ull) /* Nothing left for I/O */
+ continue;
+
+ domain.mem_addr = mem_match & ~0x8000000000000000ull;
+ domain.mem_size = mem_mask;
+ pci_addr = io_match & ~0x8000000000000000ull;
+ domain.io_addr = pci_addr + 0x0000000001000000ull;
+ domain.io_size = io_mask - 0x0000000001000000ull;
+ } else {
+ xf86Msg(X_WARNING, "Unknown PCI host bridge: \"%s\"\n", prop_val);
+ continue;
+ }
+
+ /* Only map as much PCI configuration as we need */
+ domain.pci = (char *)sparcMapAperture(-1, VIDMEM_MMIO,
+ pci_addr + PCI_MAKE_TAG(domain.bus_min, 0, 0),
+ PCI_MAKE_TAG(domain.bus_max - domain.bus_min + 1, 0, 0)) -
+ PCI_MAKE_TAG(domain.bus_min, 0, 0);
+
+ /* Allocate a domain record */
+ pDomain = xnfalloc(sizeof(sparcDomainRec));
+ *pDomain = domain;
+
+ /*
+ * Allocate and prime pciBusInfo records. These are allocated one at a
+ * time because those for empty buses are eventually released.
+ */
+ bus = pDomain->bus_min =
+ PCI_MAKE_BUS(pciNumDomains, domain.bus_min);
+ pciNumBuses = pDomain->bus_max =
+ PCI_MAKE_BUS(pciNumDomains, domain.bus_max) + 1;
+
+ pciBusInfo[bus] = xnfcalloc(1, sizeof(pciBusInfo_t));
+ pciBusInfo[bus]->configMech = PCI_CFG_MECH_OTHER;
+ pciBusInfo[bus]->numDevices = 32;
+ pciBusInfo[bus]->funcs = pFunctions;
+ pciBusInfo[bus]->pciBusPriv = pDomain;
+ while (++bus < pciNumBuses) {
+ pciBusInfo[bus] = xnfalloc(sizeof(pciBusInfo_t));
+ *(pciBusInfo[bus]) = *(pciBusInfo[bus - 1]);
+ pciBusInfo[bus]->funcs = &sparcPCIFunctions;
+ }
+
+ /* Next domain, please... */
+ xf86DomainInfo[pciNumDomains++] = pDomain;
+
+ /*
+ * OK, enough of the straight-forward stuff. Time to deal with some
+ * brokenness...
+ *
+ * The PCI specs require that when a bus transaction remains unclaimed
+ * for too long, the master entity on that bus is to cancel the
+ * transaction it issued or passed on with a master abort. Two
+ * outcomes are possible:
+ *
+ * - the master abort can be treated as an error that is propogated
+ * back through the bus tree to the entity that ultimately originated
+ * the transaction; or
+ * - the transaction can be allowed to complete normally, which means
+ * that writes are ignored and reads return all ones.
+ *
+ * In the first case, if the CPU happens to be at the tail end of the
+ * tree path through one of its host bridges, it will be told there is
+ * a hardware mal-function, despite being generated by software.
+ *
+ * For a software function (be it firmware, OS or userland application)
+ * to determine how a PCI bus tree is populated, it must be able to
+ * detect when master aborts occur. Obviously, PCI discovery is much
+ * simpler when master aborts are allowed to complete normally.
+ *
+ * Unfortunately, a number of non-Intel PCI implementations have chosen
+ * to treat master aborts as severe errors. The net effect is to
+ * cripple PCI discovery algorithms in userland.
+ *
+ * On SPARCs, master aborts cause a number of different behaviours,
+ * including delivering a signal to the userland application, rebooting
+ * the system, "dropping down" to firmware, or, worst of all, bus
+ * lockouts. Even in the first case, the SIGBUS signal that is
+ * eventually generated isn't delivered in a timely enough fashion to
+ * allow an application to reliably detect the master abort that
+ * ultimately caused it.
+ *
+ * This can be somewhat mitigated. On all architectures, master aborts
+ * that occur on secondary buses can be forced to complete normally
+ * because the PCI-to-PCI bridges that serve them are governed by an
+ * industry-wide specification. (This is just another way of saying
+ * that whatever justification there might be for erroring out master
+ * aborts is deemed by the industry as insufficient to generate more
+ * PCI non-compliance than there already is...)
+ *
+ * This leaves us with master aborts that occur on primary buses.
+ * There is no specification for host-to-PCI bridges. Bridges used in
+ * SPARCs can be told to ignore all PCI errors, but not specifically
+ * master aborts. Not only is this too coarse-grained, but
+ * master-aborted read transactions on the primary bus end up returning
+ * garbage rather than all ones.
+ *
+ * I have elected to work around this the only way I can think of doing
+ * so right now. The following scans an additional PROM level and
+ * builds a device/function map for the primary bus. I can only hope
+ * this PROM information represents all devices on the primary bus,
+ * rather than only a subset of them.
+ *
+ * Master aborts are useful in other ways too, that are not addressed
+ * here. These include determining whether or not a domain provides
+ * VGA, or if a PCI device actually implements PCI disablement.
+ *
+ * --- TSI @ UQV 2001.09.19
+ */
+ for (node2 = promGetChild(node);
+ node2;
+ node2 = promGetSibling(node2)) {
+ /* Get "reg" property */
+ prop_val = promGetProperty("reg", &prop_len);
+ if (!prop_val || (prop_len % 20))
+ continue;
+
+ /*
+ * It's unnecessary to scan the entire "reg" property, but I'll do
+ * so anyway.
+ */
+ prop_len /= 20;
+ for (; prop_len--; prop_val += 20)
+ SetBitInMap(PCI_DFN_FROM_TAG(*(PCITAG *)prop_val),
+ pDomain->dfn_mask);
+ }
+
+ /* Assume the host bridge is device 0, function 0 on its bus */
+ SetBitInMap(0, pDomain->dfn_mask);
+ }
+
+ sparcPromClose();
+
+ close(apertureFd);
+ apertureFd = -1;
+}
+
+#ifndef INCLUDE_XF86_NO_DOMAIN
+
+int
+xf86GetPciDomain(PCITAG Tag)
+{
+ return PCI_DOM_FROM_TAG(Tag);
+}
+
+pointer
+xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
+ ADDRESS Base, unsigned long Size)
+{
+ sparcDomainPtr pDomain;
+ pointer result;
+ int domain = PCI_DOM_FROM_TAG(Tag);
+
+ if ((domain <= 0) || (domain >= pciNumDomains) ||
+ !(pDomain = xf86DomainInfo[domain]) ||
+ (((unsigned long long)Base + (unsigned long long)Size) >
+ pDomain->mem_size))
+ FatalError("xf86MapDomainMemory() called with invalid parameters.\n");
+
+ result = sparcMapAperture(ScreenNum, Flags, pDomain->mem_addr + Base, Size);
+
+ if (apertureFd >= 0) {
+ close(apertureFd);
+ apertureFd = -1;
+ }
+
+ return result;
+}
+
+IOADDRESS
+xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
+ IOADDRESS Base, unsigned long Size)
+{
+ sparcDomainPtr pDomain;
+ int domain = PCI_DOM_FROM_TAG(Tag);
+
+ if ((domain <= 0) || (domain >= pciNumDomains) ||
+ !(pDomain = xf86DomainInfo[domain]) ||
+ (((unsigned long long)Base + (unsigned long long)Size) >
+ pDomain->io_size))
+ FatalError("xf86MapDomainIO() called with invalid parameters.\n");
+
+ /* Permanently map all of I/O space */
+ if (!pDomain->io) {
+ pDomain->io = sparcMapAperture(ScreenNum, Flags,
+ pDomain->io_addr, pDomain->io_size);
+
+ if (apertureFd >= 0) {
+ close(apertureFd);
+ apertureFd = -1;
+ }
+ }
+
+ return (IOADDRESS)pDomain->io + Base;
+}
+
+int
+xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
+{
+ unsigned char *ptr, *src;
+ ADDRESS offset;
+ unsigned long size;
+ int len;
+
+ /* Ensure page boundaries */
+ offset = Base & ~pagemask;
+ size = ((Base + Len + pagemask) & ~pagemask) - offset;
+
+ ptr = xf86MapDomainMemory(-1, VIDMEM_READONLY, Tag, offset, size);
+
+ /* Using memcpy() here hangs the system */
+ src = ptr + (Base - offset);
+ for (len = Len; len-- > 0;)
+ *Buf++ = *src++;
+
+ xf86UnMapVidMem(-1, ptr, size);
+
+ return Len;
+}
+
+resPtr
+xf86BusAccWindowsFromOS(void)
+{
+ sparcDomainPtr pDomain;
+ resPtr pRes = NULL;
+ resRange range;
+ int domain;
+
+ for (domain = 1; domain < pciNumDomains; domain++) {
+ if (!(pDomain = xf86DomainInfo[domain]))
+ continue;
+
+ RANGE(range, 0, pDomain->mem_size - 1,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, 0, pDomain->io_size - 1,
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ }
+
+ return pRes;
+}
+
+resPtr
+xf86PciBusAccWindowsFromOS(void)
+{
+ sparcDomainPtr pDomain;
+ resPtr pRes = NULL;
+ resRange range;
+ int domain;
+
+ for (domain = 1; domain < pciNumDomains; domain++) {
+ if (!(pDomain = xf86DomainInfo[domain]))
+ continue;
+
+ RANGE(range, 0, pDomain->mem_size - 1,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, 0, pDomain->io_size - 1,
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ }
+
+ return pRes;
+}
+
+resPtr
+xf86AccResFromOS(resPtr pRes)
+{
+ sparcDomainPtr pDomain;
+ resRange range;
+ int domain;
+
+ for (domain = 1; domain < pciNumDomains; domain++) {
+ if (!(pDomain = xf86DomainInfo[domain]))
+ continue;
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000u, 0x0009ffffu,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ RANGE(range, 0x000c0000u, 0x000effffu,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ RANGE(range, 0x000f0000u, 0x000fffffu,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, pDomain->mem_size - 1, pDomain->mem_size - 1,
+ RANGE_TYPE(ResExcMemBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+
+ RANGE(range, 0x00000000u, 0x00000000u,
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ RANGE(range, pDomain->io_size - 1, pDomain->io_size - 1,
+ RANGE_TYPE(ResExcIoBlock, domain));
+ pRes = xf86AddResToList(pRes, &range, -1);
+ }
+
+ return pRes;
+}
+
+#endif /* !INCLUDE_XF86_NO_DOMAIN */
+
+#endif /* defined(sun) */
+
+#if defined(ARCH_PCI_PCI_BRIDGE)
+
+/* Definitions specific to Sun's APB P2P bridge (a.k.a. Simba) */
+#define APB_IO_ADDRESS_MAP 0xDE
+#define APB_MEM_ADDRESS_MAP 0xDF
+
+/*
+ * Simba's can only occur on bus 0. Furthermore, Simba's must have a non-zero
+ * device/function number because the Sabre interface they must connect to
+ * occupies the 0:0:0 slot. Also, there can be only one Sabre interface in the
+ * system, and therefore, only one Simba function can route any particular
+ * resource. Thus, it is appropriate to use a single set of static variables
+ * to hold the tag of the Simba function routing a VGA resource range at any
+ * one time, and to test these variables for non-zero to determine whether or
+ * not the Sabre would master-abort a VGA access (and kill the system).
+ *
+ * The trick is to determine when it is safe to re-route VGA, because doing so
+ * re-routes much more.
+ */
+static PCITAG simbavgaIOTag = 0, simbavgaMemTag = 0;
+static Bool simbavgaRoutingAllow = TRUE;
+
+/*
+ * Scan the bus subtree rooted at 'bus' for a non-display device that might be
+ * decoding the bottom 2 MB of I/O space and/or the bottom 512 MB of memory
+ * space. Reset simbavgaRoutingAllow if such a device is found.
+ *
+ * XXX For now, this is very conservative and should be made less so as the
+ * need arises.
+ */
+static void
+simbaCheckBus(CARD16 pcicommand, int bus)
+{
+ pciConfigPtr pPCI, *ppPCI = xf86scanpci(0);
+
+ while ((pPCI = *ppPCI++)) {
+ if (pPCI->busnum < bus)
+ continue;
+ if (pPCI->busnum > bus)
+ break;
+
+ /* XXX Assume all devices respect PCI disablement */
+ if (!(pcicommand & pPCI->pci_command))
+ continue;
+
+ /* XXX This doesn't deal with mis-advertised classes */
+ switch (pPCI->pci_base_class) {
+ case PCI_CLASS_PREHISTORIC:
+ if (pPCI->pci_sub_class == PCI_SUBCLASS_PREHISTORIC_VGA)
+ continue; /* Ignore VGA */
+ break;
+
+ case PCI_CLASS_DISPLAY:
+ continue;
+
+ case PCI_CLASS_BRIDGE:
+ switch (pPCI->pci_sub_class) {
+ case PCI_SUBCLASS_BRIDGE_PCI:
+ case PCI_SUBCLASS_BRIDGE_CARDBUS:
+ /* Scan secondary bus */
+ /* XXX First check bridge routing? */
+ simbaCheckBus(pcicommand & pPCI->pci_command,
+ PCI_SECONDARY_BUS_EXTRACT(pPCI->pci_pp_bus_register,
+ pPCI->tag));
+ if (!simbavgaRoutingAllow)
+ return;
+
+ default:
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ /*
+ * XXX We could check the device's bases here, but PCI doesn't limit
+ * the device's decoding to them.
+ */
+
+ simbavgaRoutingAllow = FALSE;
+ break;
+ }
+}
+
+static pciConfigPtr
+simbaVerifyBus(int bus)
+{
+ pciConfigPtr pPCI;
+ if ((bus < 0) || (bus >= pciNumBuses) ||
+ !pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) ||
+ (pPCI->pci_device_vendor != DEVID(SUN, SIMBA)))
+ return NULL;
+
+ return pPCI;
+}
+
+static CARD16
+simbaControlBridge(int bus, CARD16 mask, CARD16 value)
+{
+ pciConfigPtr pPCI;
+ CARD16 current = 0, tmp;
+ CARD8 iomap, memmap;
+
+ if ((pPCI = simbaVerifyBus(bus))) {
+ /*
+ * The Simba does not implement VGA enablement as described in the P2P
+ * spec. It does however route I/O and memory in large enough chunks
+ * so that we can determine were VGA resources would be routed
+ * (including ISA VGA I/O aliases). We can allow changes to that
+ * routing only under certain circumstances.
+ */
+ iomap = pciReadByte(pPCI->tag, APB_IO_ADDRESS_MAP);
+ memmap = pciReadByte(pPCI->tag, APB_MEM_ADDRESS_MAP);
+ if (iomap & memmap & 0x01) {
+ current |= PCI_PCI_BRIDGE_VGA_EN;
+ if ((mask & PCI_PCI_BRIDGE_VGA_EN) &&
+ !(value & PCI_PCI_BRIDGE_VGA_EN)) {
+ if (!simbavgaRoutingAllow) {
+ xf86MsgVerb(X_WARNING, 3, "Attempt to disable VGA routing"
+ " through Simba at %x:%x:%x disallowed.\n",
+ pPCI->busnum, pPCI->devnum, pPCI->funcnum);
+ value |= PCI_PCI_BRIDGE_VGA_EN;
+ } else {
+ pciWriteByte(pPCI->tag, APB_IO_ADDRESS_MAP,
+ iomap & ~0x01);
+ pciWriteByte(pPCI->tag, APB_MEM_ADDRESS_MAP,
+ memmap & ~0x01);
+ simbavgaIOTag = simbavgaMemTag = 0;
+ }
+ }
+ } else {
+ if (mask & value & PCI_PCI_BRIDGE_VGA_EN) {
+ if (!simbavgaRoutingAllow) {
+ xf86MsgVerb(X_WARNING, 3, "Attempt to enable VGA routing"
+ " through Simba at %x:%x:%x disallowed.\n",
+ pPCI->busnum, pPCI->devnum, pPCI->funcnum);
+ value &= ~PCI_PCI_BRIDGE_VGA_EN;
+ } else {
+ if (pPCI->tag != simbavgaIOTag) {
+ if (simbavgaIOTag) {
+ tmp = pciReadByte(simbavgaIOTag,
+ APB_IO_ADDRESS_MAP);
+ pciWriteByte(simbavgaIOTag, APB_IO_ADDRESS_MAP,
+ tmp & ~0x01);
+ }
+
+ pciWriteByte(pPCI->tag, APB_IO_ADDRESS_MAP,
+ iomap | 0x01);
+ simbavgaIOTag = pPCI->tag;
+ }
+
+ if (pPCI->tag != simbavgaMemTag) {
+ if (simbavgaMemTag) {
+ tmp = pciReadByte(simbavgaMemTag,
+ APB_MEM_ADDRESS_MAP);
+ pciWriteByte(simbavgaMemTag, APB_MEM_ADDRESS_MAP,
+ tmp & ~0x01);
+ }
+
+ pciWriteByte(pPCI->tag, APB_MEM_ADDRESS_MAP,
+ memmap | 0x01);
+ simbavgaMemTag = pPCI->tag;
+ }
+ }
+ }
+ }
+
+ /* Move on to master abort failure enablement (as per P2P spec) */
+ tmp = pciReadWord(pPCI->tag, PCI_PCI_BRIDGE_CONTROL_REG);
+ current |= tmp;
+ if (tmp & PCI_PCI_BRIDGE_MASTER_ABORT_EN) {
+ if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) &&
+ !(value & PCI_PCI_BRIDGE_MASTER_ABORT_EN))
+ pciWriteWord(pPCI->tag, PCI_PCI_BRIDGE_CONTROL_REG,
+ tmp & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
+ } else {
+ if (mask & value & PCI_PCI_BRIDGE_MASTER_ABORT_EN)
+ pciWriteWord(pPCI->tag, PCI_PCI_BRIDGE_CONTROL_REG,
+ tmp | PCI_PCI_BRIDGE_MASTER_ABORT_EN);
+ }
+
+ /* Insert emulation of other P2P controls here */
+ }
+
+ return (current & ~mask) | (value & mask);
+}
+
+static void
+simbaGetBridgeResources(int bus,
+ pointer *ppIoRes,
+ pointer *ppMemRes,
+ pointer *ppPmemRes)
+{
+ pciConfigPtr pPCI = simbaVerifyBus(bus);
+ resRange range;
+ int i;
+
+ if (!pPCI)
+ return;
+
+ if (ppIoRes) {
+ xf86FreeResList(*ppIoRes);
+ *ppIoRes = NULL;
+
+ if (pPCI->pci_command & PCI_CMD_IO_ENABLE) {
+ unsigned char iomap = pciReadByte(pPCI->tag, APB_IO_ADDRESS_MAP);
+ if (simbavgaRoutingAllow)
+ iomap |= 0x01;
+ for (i = 0; i < 8; i++) {
+ if (iomap & (1 << i)) {
+ RANGE(range, i << 21, ((i + 1) << 21) - 1,
+ RANGE_TYPE(ResExcIoBlock,
+ xf86GetPciDomain(pPCI->tag)));
+ *ppIoRes = xf86AddResToList(*ppIoRes, &range, -1);
+ }
+ }
+ }
+ }
+
+ if (ppMemRes) {
+ xf86FreeResList(*ppMemRes);
+ *ppMemRes = NULL;
+
+ if (pPCI->pci_command & PCI_CMD_MEM_ENABLE) {
+ unsigned char memmap = pciReadByte(pPCI->tag, APB_MEM_ADDRESS_MAP);
+ if (simbavgaRoutingAllow)
+ memmap |= 0x01;
+ for (i = 0; i < 8; i++) {
+ if (memmap & (1 << i)) {
+ RANGE(range, i << 29, ((i + 1) << 29) - 1,
+ RANGE_TYPE(ResExcMemBlock,
+ xf86GetPciDomain(pPCI->tag)));
+ *ppMemRes = xf86AddResToList(*ppMemRes, &range, -1);
+ }
+ }
+ }
+ }
+
+ if (ppPmemRes) {
+ xf86FreeResList(*ppPmemRes);
+ *ppPmemRes = NULL;
+ }
+}
+
+void ARCH_PCI_PCI_BRIDGE(pciConfigPtr pPCI)
+{
+ static pciBusFuncs_t simbaBusFuncs;
+ pciBusInfo_t *pBusInfo;
+ CARD16 pcicommand;
+
+ if (pPCI->pci_device_vendor != DEVID(SUN, SIMBA))
+ return;
+
+ pBusInfo = pPCI->businfo;
+
+ simbaBusFuncs = *(pBusInfo->funcs);
+ simbaBusFuncs.pciControlBridge = simbaControlBridge;
+ simbaBusFuncs.pciGetBridgeResources = simbaGetBridgeResources;
+
+ pBusInfo->funcs = &simbaBusFuncs;
+
+ if (!simbavgaRoutingAllow)
+ return;
+
+ pcicommand = 0;
+
+ if (pciReadByte(pPCI->tag, APB_IO_ADDRESS_MAP) & 0x01) {
+ pcicommand |= PCI_CMD_IO_ENABLE;
+ simbavgaIOTag = pPCI->tag;
+ }
+
+ if (pciReadByte(pPCI->tag, APB_MEM_ADDRESS_MAP) & 0x01) {
+ pcicommand |= PCI_CMD_MEM_ENABLE;
+ simbavgaMemTag = pPCI->tag;
+ }
+
+ if (!pcicommand)
+ return;
+
+ simbaCheckBus(pcicommand,
+ PCI_SECONDARY_BUS_EXTRACT(pPCI->pci_pp_bus_register, pPCI->tag));
+}
+
+#endif /* defined(ARCH_PCI_PCI_BRIDGE) */
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
new file mode 100644
index 000000000..3ffc7d544
--- /dev/null
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -0,0 +1,787 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.36.2.1 2003/03/21 22:29:59 tsi Exp $ */
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ *
+ * This file is derived in part from the original xf86_PCI.h that included
+ * following copyright message:
+ *
+ * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
+ *
+ * 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 names of the above listed copyright holder(s)
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holder(s) make(s) no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ */
+
+/*
+ * This file contains just the public interface to the PCI code.
+ * Drivers should use this file rather than Pci.h.
+ */
+
+#ifndef _XF86PCI_H
+#define _XF86PCI_H 1
+#include "Xarch.h"
+#include "Xfuncproto.h"
+#include "misc.h"
+
+#define PCI_NOT_FOUND 0xFFFFFFFFU
+
+/*
+ * PCI cfg space definitions (e.g. stuff right out of the PCI spec)
+ */
+
+/* Device identification register */
+#define PCI_ID_REG 0x00
+
+/* Command and status register */
+#define PCI_CMD_STAT_REG 0x04
+#define PCI_CMD_BASE_REG 0x10
+#define PCI_CMD_BIOS_REG 0x30
+#define PCI_CMD_MASK 0xffff
+#define PCI_CMD_IO_ENABLE 0x01
+#define PCI_CMD_MEM_ENABLE 0x02
+#define PCI_CMD_MASTER_ENABLE 0x04
+#define PCI_CMD_SPECIAL_ENABLE 0x08
+#define PCI_CMD_INVALIDATE_ENABLE 0x10
+#define PCI_CMD_PALETTE_ENABLE 0x20
+#define PCI_CMD_PARITY_ENABLE 0x40
+#define PCI_CMD_STEPPING_ENABLE 0x80
+#define PCI_CMD_SERR_ENABLE 0x100
+#define PCI_CMD_BACKTOBACK_ENABLE 0x200
+#define PCI_CMD_BIOS_ENABLE 0x01
+
+/* base class */
+#define PCI_CLASS_REG 0x08
+#define PCI_CLASS_MASK 0xff000000
+#define PCI_CLASS_SHIFT 24
+#define PCI_CLASS_EXTRACT(x) \
+ (((x) & PCI_CLASS_MASK) >> PCI_CLASS_SHIFT)
+
+/* base class values */
+#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_SYSPERIPH 0x08
+#define PCI_CLASS_INPUT 0x09
+#define PCI_CLASS_DOCKING 0x0a
+#define PCI_CLASS_PROCESSOR 0x0b
+#define PCI_CLASS_SERIALBUS 0x0c
+#define PCI_CLASS_WIRELESS 0x0d
+#define PCI_CLASS_I2O 0x0e
+#define PCI_CLASS_SATELLITE 0x0f
+#define PCI_CLASS_CRYPT 0x10
+#define PCI_CLASS_DATA_ACQUISTION 0x11
+#define PCI_CLASS_UNDEFINED 0xff
+
+/* sub class */
+#define PCI_SUBCLASS_MASK 0x00ff0000
+#define PCI_SUBCLASS_SHIFT 16
+#define PCI_SUBCLASS_EXTRACT(x) \
+ (((x) & PCI_SUBCLASS_MASK) >> PCI_SUBCLASS_SHIFT)
+
+/* Sub class values */
+/* 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_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_MISC 0x80
+
+/* 0x03 display subclasses */
+#define PCI_SUBCLASS_DISPLAY_VGA 0x00
+#define PCI_SUBCLASS_DISPLAY_XGA 0x01
+#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_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_MC 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_MISC 0x80
+#define PCI_IF_BRIDGE_PCI_SUBTRACTIVE 0x01
+
+/* 0x07 communications controller subclasses */
+#define PCI_SUBCLASS_COMMUNICATIONS_SERIAL 0x00
+#define PCI_SUBCLASS_COMMUNICATIONS_PARALLEL 0x01
+#define PCI_SUBCLASS_COMMUNICATIONS_MULTISERIAL 0x02
+#define PCI_SUBCLASS_COMMUNICATIONS_MODEM 0x03
+#define PCI_SUBCLASS_COMMUNICATIONS_MISC 0x80
+
+/* 0x08 generic system peripherals subclasses */
+#define PCI_SUBCLASS_SYSPERIPH_PIC 0x00
+#define PCI_SUBCLASS_SYSPERIPH_DMA 0x01
+#define PCI_SUBCLASS_SYSPERIPH_TIMER 0x02
+#define PCI_SUBCLASS_SYSPERIPH_RTC 0x03
+#define PCI_SUBCLASS_SYSPERIPH_HOTPCI 0x04
+#define PCI_SUBCLASS_SYSPERIPH_MISC 0x80
+
+/* 0x09 input device 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 docking station subclasses */
+#define PCI_SUBCLASS_DOCKING_GENERIC 0x00
+#define PCI_SUBCLASS_DOCKING_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 controller subclasses */
+#define PCI_SUBCLASS_SERIAL_FIREWIRE 0x00
+#define PCI_SUBCLASS_SERIAL_ACCESS 0x01
+#define PCI_SUBCLASS_SERIAL_SSA 0x02
+#define PCI_SUBCLASS_SERIAL_USB 0x03
+#define PCI_SUBCLASS_SERIAL_FIBRECHANNEL 0x04
+#define PCI_SUBCLASS_SERIAL_SMBUS 0x05
+
+/* 0x0d wireless controller subclasses */
+#define PCI_SUBCLASS_WIRELESS_IRDA 0x00
+#define PCI_SUBCLASS_WIRELESS_CONSUMER_IR 0x01
+#define PCI_SUBCLASS_WIRELESS_RF 0x02
+#define PCI_SUBCLASS_WIRELESS_MISC 0x80
+
+/* 0x0e intelligent I/O controller subclasses */
+#define PCI_SUBCLASS_I2O_I2O 0x00
+
+/* 0x0f satellite communications controller subclasses */
+#define PCI_SUBCLASS_SATELLITE_TV 0x01
+#define PCI_SUBCLASS_SATELLITE_AUDIO 0x02
+#define PCI_SUBCLASS_SATELLITE_VOICE 0x03
+#define PCI_SUBCLASS_SATELLITE_DATA 0x04
+
+/* 0x10 encryption/decryption controller subclasses */
+#define PCI_SUBCLASS_CRYPT_NET_COMPUTING 0x00
+#define PCI_SUBCLASS_CRYPT_ENTERTAINMENT 0x10
+#define PCI_SUBCLASS_CRYPT_MISC 0x80
+
+/* 0x11 data acquisition and signal processing controller subclasses */
+#define PCI_SUBCLASS_DATAACQ_DPIO 0x00
+#define PCI_SUBCLASS_DATAACQ_MISC 0x80
+
+
+/* Header */
+#define PCI_HEADER_MISC 0x0c
+#define PCI_HEADER_MULTIFUNCTION 0x00800000
+
+/* Interrupt configration register */
+#define PCI_INTERRUPT_REG 0x3c
+#define PCI_INTERRUPT_PIN_MASK 0x0000ff00
+#define PCI_INTERRUPT_PIN_EXTRACT(x) \
+ ((((x) & PCI_INTERRUPT_PIN_MASK) >> 8) & 0xff)
+#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_LINE_MASK 0x000000ff
+#define PCI_INTERRUPT_LINE_EXTRACT(x) \
+ ((((x) & PCI_INTERRUPT_LINE_MASK) >> 0) & 0xff)
+#define PCI_INTERRUPT_LINE_INSERT(x,v) \
+ (((x) & ~PCI_INTERRUPT_LINE_MASK) | ((v) << 0))
+
+/* Base registers */
+#define PCI_MAP_REG_START 0x10
+#define PCI_MAP_REG_END 0x28
+#define PCI_MAP_ROM_REG 0x30
+
+#define PCI_MAP_MEMORY 0x00000000
+#define PCI_MAP_IO 0x00000001
+
+#define PCI_MAP_MEMORY_TYPE 0x00000007
+#define PCI_MAP_IO_TYPE 0x00000003
+
+#define PCI_MAP_MEMORY_TYPE_32BIT 0x00000000
+#define PCI_MAP_MEMORY_TYPE_32BIT_1M 0x00000002
+#define PCI_MAP_MEMORY_TYPE_64BIT 0x00000004
+#define PCI_MAP_MEMORY_TYPE_MASK 0x00000006
+#define PCI_MAP_MEMORY_CACHABLE 0x00000008
+#define PCI_MAP_MEMORY_ATTR_MASK 0x0000000e
+#define PCI_MAP_MEMORY_ADDRESS_MASK 0xfffffff0
+
+#define PCI_MAP_IO_ATTR_MASK 0x00000003
+
+#define PCI_MAP_IS_IO(b) ((b) & PCI_MAP_IO)
+#define PCI_MAP_IS_MEM(b) (!PCI_MAP_IS_IO(b))
+
+#define PCI_MAP_IS64BITMEM(b) \
+ (((b) & PCI_MAP_MEMORY_TYPE_MASK) == PCI_MAP_MEMORY_TYPE_64BIT)
+
+#define PCIGETMEMORY(b) ((b) & PCI_MAP_MEMORY_ADDRESS_MASK)
+#define PCIGETMEMORY64HIGH(b) (*((CARD32*)&b + 1))
+#define PCIGETMEMORY64(b) \
+ (PCIGETMEMORY(b) | ((CARD64)PCIGETMEMORY64HIGH(b) << 32))
+
+#define PCI_MAP_IO_ADDRESS_MASK 0xfffffffc
+
+#define PCIGETIO(b) ((b) & PCI_MAP_IO_ADDRESS_MASK)
+
+#define PCI_MAP_ROM_DECODE_ENABLE 0x00000001
+#define PCI_MAP_ROM_ADDRESS_MASK 0xfffff800
+
+#define PCIGETROM(b) ((b) & PCI_MAP_ROM_ADDRESS_MASK)
+
+/* PCI-PCI bridge mapping registers */
+#define PCI_PCI_BRIDGE_BUS_REG 0x18
+#define PCI_SUBORDINATE_BUS_MASK 0x00ff0000
+#define PCI_SECONDARY_BUS_MASK 0x0000ff00
+#define PCI_PRIMARY_BUS_MASK 0x000000ff
+
+#define PCI_PCI_BRIDGE_IO_REG 0x1c
+#define PCI_PCI_BRIDGE_MEM_REG 0x20
+#define PCI_PCI_BRIDGE_PMEM_REG 0x24
+
+#define PCI_PPB_IOBASE_EXTRACT(x) (((x) << 8) & 0xFF00)
+#define PCI_PPB_IOLIMIT_EXTRACT(x) (((x) << 0) & 0xFF00)
+
+#define PCI_PPB_MEMBASE_EXTRACT(x) (((x) << 16) & 0xFFFF0000)
+#define PCI_PPB_MEMLIMIT_EXTRACT(x) (((x) << 0) & 0xFFFF0000)
+
+#define PCI_PCI_BRIDGE_CONTROL_REG 0x3E
+#define PCI_PCI_BRIDGE_PARITY_EN 0x01
+#define PCI_PCI_BRIDGE_SERR_EN 0x02
+#define PCI_PCI_BRIDGE_ISA_EN 0x04
+#define PCI_PCI_BRIDGE_VGA_EN 0x08
+#define PCI_PCI_BRIDGE_MASTER_ABORT_EN 0x20
+#define PCI_PCI_BRIDGE_SECONDARY_RESET 0x40
+#define PCI_PCI_BRIDGE_FAST_B2B_EN 0x80
+/* header type 2 extensions */
+#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
+#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
+#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
+
+#define PCI_CB_SEC_STATUS_REG 0x16 /* Secondary status */
+#define PCI_CB_PRIMARY_BUS_REG 0x18 /* PCI bus number */
+#define PCI_CB_CARD_BUS_REG 0x19 /* CardBus bus number */
+#define PCI_CB_SUBORDINATE_BUS_REG 0x1a /* Subordinate bus number */
+#define PCI_CB_LATENCY_TIMER_REG 0x1b /* CardBus latency timer */
+#define PCI_CB_MEM_BASE_0_REG 0x1c
+#define PCI_CB_MEM_LIMIT_0_REG 0x20
+#define PCI_CB_MEM_BASE_1_REG 0x24
+#define PCI_CB_MEM_LIMIT_1_REG 0x28
+#define PCI_CB_IO_BASE_0_REG 0x2c
+#define PCI_CB_IO_LIMIT_0_REG 0x30
+#define PCI_CB_IO_BASE_1_REG 0x34
+#define PCI_CB_IO_LIMIT_1_REG 0x38
+#define PCI_CB_BRIDGE_CONTROL_REG 0x3E
+
+#define PCI_CB_IO_RANGE_MASK ~0x03
+#define PCI_CB_IOBASE(x) (x & PCI_CB_IO_RANGE_MASK)
+#define PCI_CB_IOLIMIT(x) ((x & PCI_CB_IO_RANGE_MASK) + 3)
+
+/* Subsystem identification register */
+#define PCI_SUBSYSTEM_ID_REG 0x2c
+
+/* User defined cfg space regs */
+#define PCI_REG_USERCONFIG 0x40
+#define PCI_OPTION_REG 0x40
+
+/*
+ * Typedefs, etc...
+ */
+
+/* Primitive Types */
+typedef unsigned long ADDRESS; /* Memory/PCI address */
+typedef unsigned long IOADDRESS; /* Must be large enough for a pointer */
+typedef unsigned long PCITAG;
+
+/*
+ * PCI configuration space
+ */
+typedef struct pci_cfg_regs {
+ /* start of official PCI config space header */
+ union { /* Offset 0x0 - 0x3 */
+ CARD32 device_vendor;
+ struct {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD16 device;
+ CARD16 vendor;
+#else
+ CARD16 vendor;
+ CARD16 device;
+#endif
+ } dv;
+ } dv_id;
+
+ union { /* Offset 0x4 - 0x8 */
+ CARD32 status_command;
+ struct {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD16 status;
+ CARD16 command;
+#else
+ CARD16 command;
+ CARD16 status;
+#endif
+ } sc;
+ } stat_cmd;
+
+ union { /* Offset 0x8 - 0xb */
+ CARD32 class_revision;
+ struct {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD8 base_class;
+ CARD8 sub_class;
+ CARD8 prog_if;
+ CARD8 rev_id;
+#else
+ CARD8 rev_id;
+ CARD8 prog_if;
+ CARD8 sub_class;
+ CARD8 base_class;
+#endif
+ } cr;
+ } class_rev;
+
+ union { /* Offset 0xc - 0xf */
+ CARD32 bist_header_latency_cache;
+ struct {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD8 bist;
+ CARD8 header_type;
+ CARD8 latency_timer;
+ CARD8 cache_line_size;
+#else
+ CARD8 cache_line_size;
+ CARD8 latency_timer;
+ CARD8 header_type;
+ CARD8 bist;
+#endif
+ } bhlc;
+ } bhlc;
+ union { /* Offset 0x10 - 0x3b */
+ struct { /* header type 2 */
+ CARD32 cg_rsrvd1; /* 0x10 */
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD16 secondary_status; /* 0x16 */
+ CARD16 cg_rsrvd2; /* 0x14 */
+
+ union {
+ CARD32 cg_bus_reg;
+ struct {
+ CARD8 latency_timer; /* 0x1b */
+ CARD8 subordinate_bus_number; /* 0x1a */
+ CARD8 cardbus_bus_number; /* 0x19 */
+ CARD8 primary_bus_number; /* 0x18 */
+ } cgbr;
+ } cgbr;
+#else
+ CARD16 cg_rsrvd2; /* 0x14 */
+ CARD16 secondary_status; /* 0x16 */
+
+ union {
+ CARD32 cg_bus_reg;
+ struct {
+ CARD8 primary_bus_number; /* 0x18 */
+ CARD8 cardbus_bus_number; /* 0x19 */
+ CARD8 subordinate_bus_number; /* 0x1a */
+ CARD8 latency_timer; /* 0x1b */
+ } cgbr;
+ } cgbr;
+#endif
+ CARD32 mem_base0; /* 0x1c */
+ CARD32 mem_limit0; /* 0x20 */
+ CARD32 mem_base1; /* 0x24 */
+ CARD32 mem_limit1; /* 0x28 */
+ CARD32 io_base0; /* 0x2c */
+ CARD32 io_limit0; /* 0x30 */
+ CARD32 io_base1; /* 0x34 */
+ CARD32 io_limit1; /* 0x38 */
+ } cg;
+ struct {
+ union { /* Offset 0x10 - 0x27 */
+ struct { /* header type 0 */
+ CARD32 dv_base0;
+ CARD32 dv_base1;
+ CARD32 dv_base2;
+ CARD32 dv_base3;
+ CARD32 dv_base4;
+ CARD32 dv_base5;
+ } dv;
+ struct { /* header type 1 */
+ CARD32 bg_rsrvd[2];
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ union {
+ CARD32 pp_bus_reg;
+ struct {
+ CARD8 secondary_latency_timer;
+ CARD8 subordinate_bus_number;
+ CARD8 secondary_bus_number;
+ CARD8 primary_bus_number;
+ } ppbr;
+ } ppbr;
+
+ CARD16 secondary_status;
+ CARD8 io_limit;
+ CARD8 io_base;
+
+ CARD16 mem_limit;
+ CARD16 mem_base;
+
+ CARD16 prefetch_mem_limit;
+ CARD16 prefetch_mem_base;
+#else
+ union {
+ CARD32 pp_bus_reg;
+ struct {
+ CARD8 primary_bus_number;
+ CARD8 secondary_bus_number;
+ CARD8 subordinate_bus_number;
+ CARD8 secondary_latency_timer;
+ } ppbr;
+ } ppbr;
+
+ CARD8 io_base;
+ CARD8 io_limit;
+ CARD16 secondary_status;
+
+ CARD16 mem_base;
+ CARD16 mem_limit;
+
+ CARD16 prefetch_mem_base;
+ CARD16 prefetch_mem_limit;
+#endif
+ } bg;
+ } bc;
+ union { /* Offset 0x28 - 0x2b */
+ CARD32 rsvd1;
+ CARD32 pftch_umem_base;
+ CARD32 cardbus_cis_ptr;
+ } um_c_cis;
+ union { /* Offset 0x2c - 0x2f */
+ CARD32 subsys_card_vendor;
+ CARD32 pftch_umem_limit;
+ CARD32 rsvd2;
+ struct {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD16 subsys_card;
+ CARD16 subsys_vendor;
+#else
+ CARD16 subsys_vendor;
+ CARD16 subsys_card;
+#endif
+ } ssys;
+ } um_ssys_id;
+ union { /* Offset 0x30 - 0x33 */
+ CARD32 baserom;
+ struct {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD16 io_ulimit;
+ CARD16 io_ubase;
+#else
+ CARD16 io_ubase;
+ CARD16 io_ulimit;
+#endif
+ } b_u_io;
+ } uio_rom;
+ struct {
+ CARD32 rsvd3; /* Offset 0x34 - 0x37 */
+ CARD32 rsvd4; /* Offset 0x38 - 0x3b */
+ } rsvd;
+ } cd;
+ } cx;
+ union { /* Offset 0x3c - 0x3f */
+ union { /* header type 0 */
+ CARD32 max_min_ipin_iline;
+ struct {
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD8 max_lat;
+ CARD8 min_gnt;
+ CARD8 int_pin;
+ CARD8 int_line;
+#else
+ CARD8 int_line;
+ CARD8 int_pin;
+ CARD8 min_gnt;
+ CARD8 max_lat;
+#endif
+ } mmii;
+ } mmii;
+ struct { /* header type 1 */
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+ CARD16 bridge_control; /* upper 8 bits reserved */
+ CARD8 rsvd2;
+ CARD8 rsvd1;
+#else
+ CARD8 rsvd1;
+ CARD8 rsvd2;
+ CARD16 bridge_control; /* upper 8 bits reserved */
+#endif
+ } bctrl;
+ } bm;
+ union { /* Offset 0x40 - 0xff */
+ CARD32 dwords[48];
+ CARD8 bytes[192];
+ } devspf;
+} pciCfgRegs;
+
+typedef union pci_cfg_spc {
+ pciCfgRegs regs;
+ CARD32 dwords[256/sizeof(CARD32)];
+ CARD8 bytes[256/sizeof(CARD8)];
+} pciCfgSpc;
+
+/*
+ * Data structure returned by xf86scanpci including contents of
+ * PCI config space header
+ */
+typedef struct pci_device {
+ PCITAG tag;
+ int busnum;
+ int devnum;
+ int funcnum;
+ pciCfgSpc cfgspc;
+ int basesize[7]; /* number of bits in base addr allocations */
+ Bool minBasesize;
+ CARD32 listed_class;
+ pointer businfo; /* pointer to secondary's bus info structure */
+ Bool fakeDevice; /* Device added by system chipset support */
+} pciDevice, *pciConfigPtr;
+
+typedef enum {
+ WRITE,
+ READ,
+ SET_BITS
+} pciFunc;
+
+typedef enum {
+ PCI_MEM,
+ PCI_MEM_SIZE,
+ PCI_MEM_SPARSE_BASE,
+ PCI_MEM_SPARSE_MASK,
+ PCI_IO,
+ PCI_IO_SIZE,
+ PCI_IO_SPARSE_BASE,
+ PCI_IO_SPARSE_MASK
+} PciAddrType;
+
+#define pci_device_vendor cfgspc.regs.dv_id.device_vendor
+#define pci_vendor cfgspc.regs.dv_id.dv.vendor
+#define pci_device cfgspc.regs.dv_id.dv.device
+#define pci_status_command cfgspc.regs.stat_cmd.status_command
+#define pci_command cfgspc.regs.stat_cmd.sc.command
+#define pci_status cfgspc.regs.stat_cmd.sc.status
+#define pci_class_revision cfgspc.regs.class_rev.class_revision
+#define pci_rev_id cfgspc.regs.class_rev.cr.rev_id
+#define pci_prog_if cfgspc.regs.class_rev.cr.prog_if
+#define pci_sub_class cfgspc.regs.class_rev.cr.sub_class
+#define pci_base_class cfgspc.regs.class_rev.cr.base_class
+#define pci_bist_header_latency_cache cfgspc.regs.bhlc.bist_header_latency_cache
+#define pci_cache_line_size cfgspc.regs.bhlc.bhlc.cache_line_size
+#define pci_latency_timer cfgspc.regs.bhlc.bhlc.latency_timer
+#define pci_header_type cfgspc.regs.bhlc.bhlc.header_type
+#define pci_bist cfgspc.regs.bhlc.bhlc.bist
+#define pci_cb_secondary_status cfgspc.regs.cx.cg.secondary_status
+#define pci_cb_bus_register cfgspc.regs.cx.cg.cgbr.cg_bus_reg
+#define pci_cb_primary_bus_number cfgspc.regs.cx.cg.cgbr.cgbr.primary_bus_number
+#define pci_cb_cardbus_bus_number cfgspc.regs.cx.cg.cgbr.cgbr.cardbus_bus_number
+#define pci_cb_subordinate_bus_number cfgspc.regs.cx.cg.cgbr.cgbr.subordinate_bus_number
+#define pci_cb_latency_timer cfgspc.regs.cx.cg.cgbr.cgbr.latency_timer
+#define pci_cb_membase0 cfgspc.regs.cx.cg.mem_base0
+#define pci_cb_memlimit0 cfgspc.regs.cx.cg.mem_limit0
+#define pci_cb_membase1 cfgspc.regs.cx.cg.mem_base1
+#define pci_cb_memlimit1 cfgspc.regs.cx.cg.mem_limit1
+#define pci_cb_iobase0 cfgspc.regs.cx.cg.io_base0
+#define pci_cb_iolimit0 cfgspc.regs.cx.cg.io_limit0
+#define pci_cb_iobase1 cfgspc.regs.cx.cg.io_base1
+#define pci_cb_iolimit1 cfgspc.regs.cx.cg.io_limit1
+#define pci_base0 cfgspc.regs.cx.cd.bc.dv.dv_base0
+#define pci_base1 cfgspc.regs.cx.cd.bc.dv.dv_base1
+#define pci_base2 cfgspc.regs.cx.cd.bc.dv.dv_base2
+#define pci_base3 cfgspc.regs.cx.cd.bc.dv.dv_base3
+#define pci_base4 cfgspc.regs.cx.cd.bc.dv.dv_base4
+#define pci_base5 cfgspc.regs.cx.cd.bc.dv.dv_base5
+#define pci_cardbus_cis_ptr cfgspc.regs.cx.cd.umem_c_cis.cardbus_cis_ptr
+#define pci_subsys_card_vendor cfgspc.regs.cx.cd.um_ssys_id.subsys_card_vendor
+#define pci_subsys_vendor cfgspc.regs.cx.cd.um_ssys_id.ssys.subsys_vendor
+#define pci_subsys_card cfgspc.regs.cx.cd.um_ssys_id.ssys.subsys_card
+#define pci_baserom cfgspc.regs.cx.cd.uio_rom.baserom
+#define pci_pp_bus_register cfgspc.regs.cx.cd.bc.bg.ppbr.pp_bus_reg
+#define pci_primary_bus_number cfgspc.regs.cx.cd.bc.bg.ppbr.ppbr.primary_bus_number
+#define pci_secondary_bus_number cfgspc.regs.cx.cd.bc.bg.ppbr.ppbr.secondary_bus_number
+#define pci_subordinate_bus_number cfgspc.regs.cx.cd.bc.bg.ppbr.ppbr.subordinate_bus_number
+#define pci_secondary_latency_timer cfgspc.regs.cx.cd.bc.bg.ppbr.ppbr.secondary_latency_timer
+#define pci_io_base cfgspc.regs.cx.cd.bc.bg.io_base
+#define pci_io_limit cfgspc.regs.cx.cd.bc.bg.io_limit
+#define pci_secondary_status cfgspc.regs.cx.cd.bc.bg.secondary_status
+#define pci_mem_base cfgspc.regs.cx.cd.bc.bg.mem_base
+#define pci_mem_limit cfgspc.regs.cx.cd.bc.bg.mem_limit
+#define pci_prefetch_mem_base cfgspc.regs.cx.cd.bc.bg.prefetch_mem_base
+#define pci_prefetch_mem_limit cfgspc.regs.cx.cd.bc.bg.prefetch_mem_limit
+#define pci_rsvd1 cfgspc.regs.cx.cd.um_c_cis.rsvd1
+#define pci_rsvd2 cfgspc.regs.cx.cd.um_ssys_id.rsvd2
+#define pci_prefetch_upper_mem_base cfgspc.regs.cx.cd.um_c_cis.pftch_umem_base
+#define pci_prefetch_upper_mem_limit cfgspc.regs.cx.cd.um_ssys_id.pftch_umem_limit
+#define pci_upper_io_base cfgspc.regs.cx.cd.uio_rom.b_u_io.io_ubase
+#define pci_upper_io_limit cfgspc.regs.cx.cd.uio_rom.b_u_io.io_ulimit
+#define pci_int_line cfgspc.regs.bm.mmii.mmii.int_line
+#define pci_int_pin cfgspc.regs.bm.mmii.mmii.int_pin
+#define pci_min_gnt cfgspc.regs.bm.mmii.mmii.min_gnt
+#define pci_max_lat cfgspc.regs.bm.mmii.mmii.max_lat
+#define pci_max_min_ipin_iline cfgspc.regs.bm.mmii.max_min_ipin_iline
+#define pci_bridge_control cfgspc.regs.bm.bctrl.bridge_control
+#define pci_user_config cfgspc.regs.devspf.dwords[0]
+#define pci_user_config_0 cfgspc.regs.devspf.bytes[0]
+#define pci_user_config_1 cfgspc.regs.devspf.bytes[1]
+#define pci_user_config_2 cfgspc.regs.devspf.bytes[2]
+#define pci_user_config_3 cfgspc.regs.devspf.bytes[3]
+
+typedef enum {
+ PCI_BIOS_PC = 0,
+ PCI_BIOS_OPEN_FIRMARE,
+ PCI_BIOS_HP_PA_RISC,
+ PCI_BIOS_OTHER
+} PciBiosType;
+
+/* Public PCI access functions */
+void pciInit(void);
+PCITAG pciFindFirst(CARD32 id, CARD32 mask);
+PCITAG pciFindNext(void);
+CARD32 pciReadLong(PCITAG tag, int offset);
+CARD16 pciReadWord(PCITAG tag, int offset);
+CARD8 pciReadByte(PCITAG tag, int offset);
+void pciWriteLong(PCITAG tag, int offset, CARD32 val);
+void pciWriteWord(PCITAG tag, int offset, CARD16 val);
+void pciWriteByte(PCITAG tag, int offset, CARD8 val);
+void pciSetBitsLong(PCITAG tag, int offset, CARD32 mask, CARD32 val);
+void pciSetBitsByte(PCITAG tag, int offset, CARD8 mask, CARD8 val);
+pointer pciLongFunc(PCITAG tag, pciFunc func);
+ADDRESS pciBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
+ADDRESS pciHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr);
+PCITAG pciTag(int busnum, int devnum, int funcnum);
+int pciGetBaseSize(PCITAG tag, int indx, Bool destructive, Bool *min);
+CARD32 pciCheckForBrokenBase(PCITAG tag,int basereg);
+pointer xf86MapPciMem(int ScreenNum, int Flags, PCITAG Tag,
+ ADDRESS Base, unsigned long Size);
+int xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg,
+ unsigned char *Buf, int Len);
+int xf86ReadPciBIOSByType(unsigned long Offset, PCITAG Tag,
+ int basereg, unsigned char *Buf,
+ int Len, PciBiosType Type);
+int xf86GetAvailablePciBIOSTypes(PCITAG Tag, int basereg,
+ PciBiosType *Buf);
+pciConfigPtr *xf86scanpci(int flags);
+
+extern int pciNumBuses;
+
+/* Domain access functions. Some of these probably shouldn't be public */
+int xf86GetPciDomain(PCITAG tag);
+pointer xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
+ ADDRESS Base, unsigned long Size);
+IOADDRESS xf86MapDomainIO(int ScreenNum, int Flags, PCITAG Tag,
+ IOADDRESS Base, unsigned long Size);
+int xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len,
+ unsigned char *Buf);
+
+typedef enum {
+ ROM_BASE_PRESET = -2,
+ ROM_BASE_BIOS,
+ ROM_BASE_MEM0 = 0,
+ ROM_BASE_MEM1,
+ ROM_BASE_MEM2,
+ ROM_BASE_MEM3,
+ ROM_BASE_MEM4,
+ ROM_BASE_MEM5,
+ ROM_BASE_FIND
+} romBaseSource;
+
+#endif /* _XF86PCI_H */
diff --git a/hw/xfree86/os-support/bus/xf86Sbus.h b/hw/xfree86/os-support/bus/xf86Sbus.h
new file mode 100644
index 000000000..5c8acfd4b
--- /dev/null
+++ b/hw/xfree86/os-support/bus/xf86Sbus.h
@@ -0,0 +1,59 @@
+/*
+ * Platform specific SBUS and OpenPROM access declarations.
+ *
+ * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
+ *
+ * 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
+ * JAKUB JELINEK 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.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.5 2002/05/22 21:38:30 herrb Exp $ */
+
+#ifndef _XF86_SBUS_H
+#define _XF86_SBUS_H
+
+#if defined(linux)
+#include <asm/types.h>
+#include <asm/fbio.h>
+#include <asm/openpromio.h>
+#elif defined(SVR4)
+#include <sys/fbio.h>
+#include <sys/openpromio.h>
+#elif defined(__OpenBSD__) && defined(__sparc64__)
+/* XXX */
+#elif defined(CSRG_BASED)
+#include <machine/fbio.h>
+#else
+#include <sun/fbio.h>
+#endif
+
+#ifndef FBTYPE_SUNGP3
+#define FBTYPE_SUNGP3 -1
+#endif
+#ifndef FBTYPE_MDICOLOR
+#define FBTYPE_MDICOLOR -1
+#endif
+#ifndef FBTYPE_SUNLEO
+#define FBTYPE_SUNLEO -1
+#endif
+#ifndef FBTYPE_TCXCOLOR
+#define FBTYPE_TCXCOLOR -1
+#endif
+#ifndef FBTYPE_CREATOR
+#define FBTYPE_CREATOR -1
+#endif
+
+#endif /* _XF86_SBUS_H */
diff --git a/hw/xfree86/os-support/bus/zx1PCI.c b/hw/xfree86/os-support/bus/zx1PCI.c
new file mode 100644
index 000000000..dc4d062f3
--- /dev/null
+++ b/hw/xfree86/os-support/bus/zx1PCI.c
@@ -0,0 +1,1047 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
+/*
+ * Copyright (C) 2002-2003 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+/*
+ * This file contains the glue necessary for support of HP's ZX1 chipset.
+ * Keep in mind that this chipset is used in both Itanium2 and PA-RISC
+ * architectures.
+ */
+
+#include "zx1PCI.h"
+#include "xf86.h"
+#include "xf86_OSlib.h"
+#include "Pci.h"
+
+#define MIO_BASE 0xFED00000UL /* mio register base */
+#define MIO_SIZE 0x00002000UL /* 8k, minimum */
+
+/* ZX1 mio register definitions */
+#define MIO_FUNCTION0 0x0000U
+
+#define MODULE_INFO 0x0100U
+#define STATUS_CONTROL 0x0108U
+#define DILLON_PRESENT 0x02UL
+
+#define LMMIO_DIR_BASE0 0x0300U
+#define LMMIO_DIR_MASK0 0x0308U
+#define LMMIO_DIR_ROUTE0 0x0310U
+#define LMMIO_DIR_BASE1 0x0318U
+#define LMMIO_DIR_MASK1 0x0320U
+#define LMMIO_DIR_ROUTE1 0x0328U
+#define LMMIO_DIR_BASE2 0x0330U
+#define LMMIO_DIR_MASK2 0x0338U
+#define LMMIO_DIR_ROUTE2 0x0340U
+#define LMMIO_DIR_BASE3 0x0348U
+#define LMMIO_DIR_MASK3 0x0350U
+#define LMMIO_DIR_ROUTE3 0x0358U
+#define LMMIO_DIST_BASE 0x0360U
+#define LMMIO_DIST_MASK 0x0368U
+#define LMMIO_DIST_ROUTE 0x0370U
+#define GMMIO_DIST_BASE 0x0378U
+#define PORT_DISABLE 0x02UL
+#define MAP_TO_LMMIO 0x04UL
+#define GMMIO_DIST_MASK 0x0380U
+#define GMMIO_DIST_ROUTE 0x0388U
+#define IOS_DIST_BASE 0x0390U
+#define IOS_DIST_MASK 0x0398U
+#define IOS_DIST_ROUTE 0x03A0U
+#define ROPE_CONFIG_BASE 0x03A8U
+#define VGA_ROUTE 0x03B0U
+#define VGA_ENABLE 0x8000000000000000UL
+#define VGA_LIGHT 0x4000000000000000UL
+
+#define IOS_DIR_BASE 0x03C0U
+#define IOS_DIR_MASK 0x03C8U
+#define IOS_DIR_ROUTE 0x03D0U
+#define IOS_BASE 0x03D8U
+
+#define MIO_FUNCTION1 0x1000U
+
+#define ROPE_CONFIG 0x1040U
+#define ROPE_D0 0x0100UL
+#define ROPE_D2 0x0200UL
+#define ROPE_D4 0x0400UL
+#define ROPE_D6 0x0800UL
+#define ROPE_Q0 0x1000UL
+#define ROPE_Q4 0x2000UL
+
+#define LBA_PORT0_CNTRL 0x1200U
+#define LBA_PORT1_CNTRL 0x1208U
+#define LBA_PORT2_CNTRL 0x1210U
+#define LBA_PORT3_CNTRL 0x1218U
+#define LBA_PORT4_CNTRL 0x1220U
+#define LBA_PORT5_CNTRL 0x1228U
+#define LBA_PORT6_CNTRL 0x1230U
+#define LBA_PORT7_CNTRL 0x1238U
+#define LBA_HARD_FAIL 0x40UL
+
+#define ROPE_PAGE_CONTROL 0x1418U
+
+/*
+ * Total ioa configuration space size is actually 128k, but we only need the
+ * first 64k.
+ */
+#define IOA_SIZE 0x00010000UL
+
+/* ZX1 ioa register definitions */
+#define IOA_CONFIG_ADDR 0x0040U
+#define IOA_CONFIG_DATA 0x0048U
+
+#define IOA_SECONDARY_BUS 0x0058U
+#define IOA_SUBORDINATE_BUS 0x0059U
+
+#define IOA_CONTROL 0x0108U
+#define IOA_FORWARD_VGA 0x08UL
+#define IOA_HARD_FAIL 0x40UL
+
+#define IOA_LMMIO_BASE 0x0200U
+#define IOA_LMMIO_MASK 0x0208U
+#define IOA_GMMIO_BASE 0x0210U
+#define IOA_GMMIO_MASK 0x0218U
+#define IOA_WLMMIO_BASE 0x0220U
+#define IOA_WLMMIO_MASK 0x0228U
+#define IOA_WGMMIO_BASE 0x0230U
+#define IOA_WGMMIO_MASK 0x0238U
+#define IOA_IOS_BASE 0x0240U
+#define IOA_IOS_MASK 0x0248U
+#define IOA_ELMMIO_BASE 0x0250U
+#define IOA_ELMMIO_MASK 0x0258U
+#define IOA_EIOS_BASE 0x0260U
+#define IOA_EIOS_MASK 0x0268U
+
+#define IOA_SLAVE_CONTROL 0x0278U
+#define IOA_VGA_PEER_ENABLE 0x2000UL
+#define IOA_MSI_BASE 0x0280U
+#define IOA_MSI_MASK 0x0288U
+
+#define RANGE_ENABLE 0x01UL /* In various base registers */
+
+#define IO_MASK ((1UL << 16) - 1UL)
+#define LMMIO_MASK ((1UL << 32) - 1UL)
+#ifdef __ia64__
+#define GMMIO_MASK ((1UL << 44) - 1UL)
+#else /* PA-RISC */
+#define GMMIO_MASK ((1UL << 40) - 1UL)
+#endif
+
+#define PDH_START 0xFF000000UL
+#define PDH_LAST 0xFFFFFFFFUL
+
+static CARD8 *pZX1mio = NULL,
+ *pZX1ioa = NULL;
+
+static INT8 zx1_ropemap[8]; /* One for each (potential) rope */
+static CARD64 zx1_lbacntl[8]; /* " " " " " */
+static int zx1_busno[8], zx1_subno[8];
+
+static pciBusFuncs_t zx1BusFuncs;
+static int zx1_fakebus = -1;
+static Bool zx1_hasvga = FALSE;
+
+static pointer pZX1IoRes[8], pZX1MemRes[8]; /* Rope resources */
+
+/* Non-PCI configuration space access macros */
+#define MIO_BYTE(offset) \
+ (*(volatile CARD8 *)(pointer)(pZX1mio + (offset)))
+#define MIO_WORD(offset) \
+ (*(volatile CARD16 *)(pointer)(pZX1mio + (offset)))
+#define MIO_LONG(offset) \
+ (*(volatile CARD32 *)(pointer)(pZX1mio + (offset)))
+#define MIO_QUAD(offset) \
+ (*(volatile CARD64 *)(pointer)(pZX1mio + (offset)))
+#define IOA_BYTE(ioa, offset) \
+ (*(volatile CARD8 *)(pointer)(pZX1ioa + ((offset) + ((ioa) << 13))))
+#define IOA_WORD(ioa, offset) \
+ (*(volatile CARD16 *)(pointer)(pZX1ioa + ((offset) + ((ioa) << 13))))
+#define IOA_LONG(ioa, offset) \
+ (*(volatile CARD32 *)(pointer)(pZX1ioa + ((offset) + ((ioa) << 13))))
+#define IOA_QUAD(ioa, offset) \
+ (*(volatile CARD64 *)(pointer)(pZX1ioa + ((offset) + ((ioa) << 13))))
+
+/* Range definitions */
+#define MAX_RANGE 16
+static CARD64 bot[MAX_RANGE], top[MAX_RANGE], msk[MAX_RANGE], siz[MAX_RANGE];
+static INT8 *pDecode[MAX_RANGE];
+static int nRange = 0;
+
+/* Track a resource range and assign a granularity to it */
+static void
+SetRange(CARD64 base, CARD64 last, CARD8 width)
+{
+ int i;
+
+ bot[nRange] = base;
+ top[nRange] = last;
+ msk[nRange] = (CARD64)(-1L);
+ if (base)
+ msk[nRange] &= (base ^ (base - 1UL)) >> 1;
+ if (last + 1UL)
+ msk[nRange] &= (last ^ (last + 1UL)) >> 1;
+ if (width < 64)
+ msk[nRange] &= (1UL << width) - 1UL;
+
+ /* Look for overlapping ranges */
+ for (i = 0; i < nRange; i++) {
+ if ((bot[i] > top[i]) ||
+ (top[nRange] < bot[i]) ||
+ (top[i] < bot[nRange]))
+ continue;
+
+ /* Merge in overlapping range */
+ if (bot[nRange] > bot[i])
+ bot[nRange] = bot[i];
+ if (top[nRange] < top[i])
+ top[nRange] = top[i];
+
+ /* Assign finer granularity */
+ msk[nRange] &= msk[i];
+ bot[i] = 1UL;
+ top[i] = 0;
+ }
+
+ nRange++;
+}
+
+/* Lookup granularity associated with the range containing 'base' */
+static int
+GetRange(CARD64 base)
+{
+ int i;
+
+ for (i = 0; i < nRange; i++) {
+ if ((bot[i] > top[i]) ||
+ (base < bot[i]) ||
+ (base > top[i]))
+ continue;
+
+ if (pDecode[i])
+ break;
+
+ /* Allocate decoding array */
+ msk[i]++;
+ siz[i] = ((top[i] - bot[i] + 1UL) / msk[i]) + 1UL;
+ pDecode[i] = xnfalloc(siz[i]);
+ (void)memset(pDecode[i], -1, siz[i]);
+ break;
+ }
+
+ return i;
+}
+
+/*
+ * Verify that 'bus' is a rope's secondary bus and return the pciConfigPtr of
+ * the associated fake PCI-to-PCI bridge.
+ */
+static pciConfigPtr
+VerifyZX1Bus(int bus)
+{
+ pciConfigPtr pPCI;
+
+ if ((bus < 0) || (bus >= pciNumBuses) ||
+ !pciBusInfo[bus] || !(pPCI = pciBusInfo[bus]->bridge) ||
+ (pPCI->busnum != zx1_fakebus) || (pPCI->funcnum != 0) ||
+ (pPCI->devnum < 0x10) || (pPCI->devnum > 0x17))
+ return NULL;
+
+ return pPCI;
+}
+
+/*
+ * This function is called to emulate the various settings in a P2P or CardBus
+ * bridge's control register on a ZX1-based system.
+ */
+static CARD16
+ControlZX1Bridge(int bus, CARD16 mask, CARD16 value)
+{
+ pciConfigPtr pPCI;
+ CARD64 tmp1, tmp2, tmp3, ropenum;
+ CARD16 current = 0;
+
+ if ((pPCI = VerifyZX1Bus(bus))) {
+ ropenum = pPCI->devnum & 0x07;
+
+ /*
+ * Start with VGA enablement. This preserves the "VGA-lite" bit
+ * in mio's VGA_ROUTE register, and the VPE bit in each ioa's
+ * SLAVE_CONTROL register.
+ */
+ tmp1 = MIO_QUAD(VGA_ROUTE);
+ tmp2 = IOA_QUAD(ropenum, IOA_CONTROL);
+ if ((tmp1 & VGA_ENABLE) && ((tmp1 & 0x07UL) == ropenum)) {
+ current |= PCI_PCI_BRIDGE_VGA_EN;
+ if ((mask & PCI_PCI_BRIDGE_VGA_EN) &&
+ !(value & PCI_PCI_BRIDGE_VGA_EN)) {
+ MIO_QUAD(VGA_ROUTE) = tmp1 & ~VGA_ENABLE;
+ tmp2 &= ~IOA_FORWARD_VGA;
+ IOA_QUAD(ropenum, IOA_CONTROL) = tmp2;
+ }
+ } else if (mask & value & PCI_PCI_BRIDGE_VGA_EN) {
+ if (!zx1_hasvga) {
+ xf86MsgVerb(X_WARNING, 3,
+ "HP ZX1: Attempt to enable VGA routing to bus %d"
+ " through rope %ld disallowed\n", bus, ropenum);
+ value &= ~PCI_PCI_BRIDGE_VGA_EN;
+ } else {
+ if (tmp1 & VGA_ENABLE) {
+ /*
+ * VGA is routed somewhere else. Disable it.
+ */
+ MIO_QUAD(VGA_ROUTE) = 0UL;
+ tmp3 = IOA_QUAD(tmp1 & 0x07UL, IOA_CONTROL);
+ if (tmp3 & IOA_FORWARD_VGA)
+ IOA_QUAD(tmp1 & 0x07UL, IOA_CONTROL) =
+ tmp3 & ~IOA_FORWARD_VGA;
+ }
+ if (!(tmp2 & IOA_FORWARD_VGA)) {
+ tmp2 |= IOA_FORWARD_VGA;
+ IOA_QUAD(ropenum, IOA_CONTROL) = tmp2;
+ }
+ tmp1 = (tmp1 & ~0x07UL) | ropenum | VGA_ENABLE;
+ MIO_QUAD(VGA_ROUTE) = tmp1;
+ }
+ }
+
+ /* Move on to master abort failure enablement */
+ tmp1 = MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL);
+ if ((tmp1 & LBA_HARD_FAIL) || (tmp2 & IOA_HARD_FAIL)) {
+ current |= PCI_PCI_BRIDGE_MASTER_ABORT_EN;
+ if ((mask & PCI_PCI_BRIDGE_MASTER_ABORT_EN) &&
+ !(value & PCI_PCI_BRIDGE_MASTER_ABORT_EN)) {
+ if (tmp1 & LBA_HARD_FAIL)
+ MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL) =
+ tmp1 & ~LBA_HARD_FAIL;
+ if (tmp2 & IOA_HARD_FAIL) {
+ tmp2 &= ~IOA_HARD_FAIL;
+ IOA_QUAD(ropenum, IOA_CONTROL) = tmp2;
+ }
+ }
+ } else {
+ if (mask & value & PCI_PCI_BRIDGE_MASTER_ABORT_EN) {
+ if (!(tmp1 & LBA_HARD_FAIL))
+ MIO_QUAD((ropenum << 3) + LBA_PORT0_CNTRL) =
+ tmp1 | LBA_HARD_FAIL;
+ if (!(tmp2 & IOA_HARD_FAIL)) {
+ tmp2 |= IOA_HARD_FAIL;
+ IOA_QUAD(ropenum, IOA_CONTROL) = tmp2;
+ }
+ }
+ }
+
+ /* Put emulation of any other P2P bridge control here */
+ }
+
+ return (current & ~mask) | (value & mask);
+}
+
+/* Retrieves a list of the resources routed to a rope's secondary bus */
+static void
+GetZX1BridgeResources(int bus,
+ pointer *ppIoRes,
+ pointer *ppMemRes,
+ pointer *ppPmemRes)
+{
+ pciConfigPtr pPCI = VerifyZX1Bus(bus);
+
+ if (ppIoRes) {
+ xf86FreeResList(*ppIoRes);
+ *ppIoRes =
+ pPCI ? xf86DupResList(pZX1IoRes[pPCI->devnum & 0x07]) : NULL;
+ }
+
+ if (ppMemRes) {
+ xf86FreeResList(*ppMemRes);
+ *ppMemRes =
+ pPCI ? xf86DupResList(pZX1MemRes[pPCI->devnum & 0x07]) : NULL;
+ }
+
+ if (ppPmemRes) {
+ xf86FreeResList(*ppPmemRes);
+ *ppPmemRes = NULL;
+ }
+}
+
+/* The fake bus */
+static CARD32
+zx1FakeReadLong(PCITAG tag, int offset)
+{
+ FatalError("zx1FakeReadLong(0x%X, 0x%X) called\n", tag, offset);
+}
+
+static void
+zx1FakeWriteLong(PCITAG tag, int offset, CARD32 val)
+{
+ FatalError("zx1FakeWriteLong(0x%X, 0x%X, 0x%08X) called\n",
+ tag, offset, val);
+}
+
+static void
+zx1FakeSetBits(PCITAG tag, int offset, CARD32 mask, CARD32 bits)
+{
+ CARD32 val;
+
+ val = zx1FakeReadLong(tag, offset);
+ val &= ~mask;
+ val |= bits;
+ zx1FakeWriteLong(tag, offset, val);
+}
+
+static pciBusFuncs_t zx1FakeBusFuncs = {
+ zx1FakeReadLong,
+ zx1FakeWriteLong,
+ zx1FakeSetBits
+};
+
+static pciBusInfo_t zx1FakeBus = {
+ 0, /* configMech -- copied from bus 0 */
+ 0, /* numDevices -- copied from bus 0 */
+ FALSE, /* secondary */
+ 0, /* primary_bus -- dynamically set */
+#ifdef PowerMAX_OS
+ 0, /* ppc_io_base -- ignored */
+ 0, /* ppc_io_size -- ignored */
+#endif
+ &zx1FakeBusFuncs, /* funcs */
+ NULL, /* pciBusPriv -- none */
+ NULL, /* bridge -- dynamically set */
+};
+
+/*
+ * This checks for, and validates, the presence of the ZX1 chipset, and sets
+ * pZX1mio to a non-NULL pointer accordingly. This function is called before
+ * the server's PCI bus scan and returns TRUE if the chipset scan is to be
+ * stopped, or FALSE if the scan is to move on to the next chipset.
+ */
+Bool
+xf86PreScanZX1(void)
+{
+ resRange range;
+ unsigned long mapSize = xf86getpagesize();
+ unsigned long tmp, base, ioaaddr;
+ unsigned long flagsd = 0, based = 0, lastd = 0, maskd = 0, routed = 0;
+ unsigned long flags0 = 0, base0 = 0, last0 = 0, mask0 = 0, route0 = 0;
+ unsigned long flags1 = 0, base1 = 0, last1 = 0, mask1 = 0, route1 = 0;
+ unsigned long flags2 = 0, base2 = 0, last2 = 0, mask2 = 0, route2 = 0;
+ unsigned long flags3 = 0, base3 = 0, last3 = 0, mask3 = 0, route3 = 0;
+ unsigned long flagsg = 0, baseg = 0, lastg = 0, maskg = 0, routeg = 0;
+ unsigned long flagsl = 0, basel = 0, lastl = 0;
+ int i, rope;
+
+ /* Map mio registers (minimum 8k) */
+ if (mapSize < MIO_SIZE)
+ mapSize = MIO_SIZE;
+
+ if (!(pZX1mio = xf86MapVidMem(-1, VIDMEM_MMIO, MIO_BASE, mapSize)))
+ return FALSE;
+
+ /* Look for ZX1's SBA and IOC */
+ if ((MIO_LONG(MIO_FUNCTION0 + PCI_ID_REG) != DEVID(HP, ZX1_SBA)) ||
+ (MIO_LONG(MIO_FUNCTION1 + PCI_ID_REG) != DEVID(HP, ZX1_IOC))) {
+ xf86UnMapVidMem(-1, pZX1mio, mapSize);
+ pZX1mio = NULL;
+ return FALSE;
+ }
+
+ /* Map rope configuration space */
+ ioaaddr = MIO_QUAD(ROPE_CONFIG_BASE);
+ if (!(ioaaddr & RANGE_ENABLE) || /* No ropes */
+ ((ioaaddr = ioaaddr & ~RANGE_ENABLE) & 0x01FFFFUL) || /* Not aligned */
+ !(pZX1ioa = xf86MapVidMem(-1, VIDMEM_MMIO, ioaaddr, IOA_SIZE))) {
+ xf86UnMapVidMem(-1, pZX1mio, mapSize);
+ pZX1mio = NULL;
+ return TRUE;
+ }
+
+ for (i = 0; i < 8; i++) {
+ zx1_ropemap[i] = i;
+ zx1_lbacntl[i] = 0;
+ xf86FreeResList(pZX1IoRes[i]);
+ xf86FreeResList(pZX1MemRes[i]);
+ pZX1IoRes[i] = pZX1MemRes[i] = NULL;
+ }
+
+ /*
+ * Determine which of 8 possible ropes exist in the system. This is done
+ * by looking at their "coupling" to generate a list of candidates,
+ * whittling this list down by factoring in ROPE_PAGE_CONTROL register
+ * contents, then poking each candidate's configuration space to determine
+ * its existence.
+ */
+ tmp = MIO_QUAD(ROPE_CONFIG);
+ if (tmp & ROPE_D0)
+ zx1_ropemap[1] = 0;
+ if (tmp & ROPE_D2)
+ zx1_ropemap[3] = 2;
+ if (tmp & ROPE_D4)
+ zx1_ropemap[5] = 4;
+ if (tmp & ROPE_D6)
+ zx1_ropemap[7] = 6;
+ if (tmp & ROPE_Q0)
+ zx1_ropemap[1] = zx1_ropemap[2] = zx1_ropemap[3] = 0;
+ if (tmp & ROPE_Q4)
+ zx1_ropemap[5] = zx1_ropemap[6] = zx1_ropemap[7] = 4;
+
+ tmp = MIO_QUAD(ROPE_PAGE_CONTROL);
+ for (i = 0; i < 8; i++, tmp >>= 8)
+ if (!(CARD8)tmp)
+ zx1_ropemap[i] = -1;
+
+ for (i = 0; i < 8; ) {
+ if (zx1_ropemap[i] == i) {
+
+ /* Prevent hard-fails */
+ zx1_lbacntl[i] = MIO_QUAD((i << 3) + LBA_PORT0_CNTRL);
+ if (zx1_lbacntl[i] & LBA_HARD_FAIL)
+ MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) =
+ zx1_lbacntl[i] & ~LBA_HARD_FAIL;
+
+ /* Poke for an ioa */
+ tmp = IOA_LONG(i, PCI_ID_REG);
+ switch ((CARD32)tmp) {
+ case DEVID(HP, ELROY): /* Expected vendor/device id's */
+ case DEVID(HP, ZX1_LBA):
+ zx1_busno[i] =
+ (unsigned int)IOA_BYTE(i, IOA_SECONDARY_BUS);
+ zx1_subno[i] =
+ (unsigned int)IOA_BYTE(i, IOA_SUBORDINATE_BUS);
+ break;
+
+ default:
+ if ((CARD16)(tmp + 1U) > (CARD16)1U)
+ xf86MsgVerb(X_NOTICE, 0,
+ "HP ZX1: Unexpected vendor/device id 0x%08X"
+ " on rope %d\n", (CARD32)tmp, i);
+ /* Nobody home, or not the "right" kind of rope guest */
+
+ /*
+ * Restore hard-fail setting. For "active" ropes, this is done
+ * later.
+ */
+ if (zx1_lbacntl[i] & LBA_HARD_FAIL) {
+ MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) = zx1_lbacntl[i];
+ zx1_lbacntl[i] = 0;
+ }
+
+ /* Ignore this rope and its couplings */
+ do {
+ zx1_ropemap[i++] = -1;
+ } while ((i < 8) && (zx1_ropemap[i] < i));
+ continue; /* Avoid over-incrementing 'i' */
+ }
+ }
+ i++;
+ }
+
+ /* Determine if VGA is currently routed */
+ tmp = MIO_QUAD(VGA_ROUTE);
+ if (tmp & VGA_ENABLE)
+ zx1_hasvga = TRUE;
+
+ /*
+ * Decode mio resource "coarse" routing (i.e. ignoring VGA). Due to the
+ * rather unusual flexibility of this chipset, this is done in a number of
+ * stages. For each of I/O and memory, first decode the relevant registers
+ * to generate ranges with an associated granularity. Overlapping ranges
+ * are merged into a larger range with the finer granularity. Each
+ * original range is then more thoroughly decoded using the granularity
+ * associated with the merged range that contains it. The result is then
+ * converted into resource lists for the common layer.
+ *
+ * Note that this doesn't care whether or not read-only bits are actually
+ * set as documented, nor that mask bits are contiguous. This does,
+ * however, factor in upper limits on I/O, LMMIO anf GMMIO addresses, and
+ * thus assumes high-order address bits are ignored rather than decoded.
+ * For example, an I/O address of 0x76543210 will be treated as 0x3210
+ * rather than considered out-of-range. In part, this handling is a
+ * consequence of the fact that high-order mask bits are zeroes instead of
+ * ones.
+ */
+
+ if ((tmp = MIO_QUAD(IOS_DIST_BASE)) & RANGE_ENABLE) {
+ flagsd = RANGE_ENABLE;
+ maskd = MIO_QUAD(IOS_DIST_MASK);
+ based = tmp & maskd & (~RANGE_ENABLE & IO_MASK);
+ lastd = based | (~maskd & IO_MASK);
+ routed = MIO_QUAD(IOS_DIST_ROUTE) >> 58;
+ SetRange(based, lastd, routed);
+ }
+
+ if ((tmp = MIO_QUAD(IOS_DIR_BASE)) & RANGE_ENABLE) {
+ flags0 = RANGE_ENABLE;
+ mask0 = MIO_QUAD(IOS_DIR_MASK);
+ base0 = tmp & mask0 & (~RANGE_ENABLE & IO_MASK);
+ last0 = base0 | (~mask0 & IO_MASK);
+ route0 = MIO_QUAD(IOS_DIR_ROUTE) & 0x07U;
+ SetRange(base0, last0, 64);
+ }
+
+ if (flagsd) {
+ i = GetRange(based);
+ for (tmp = based; tmp <= lastd; tmp += msk[i]) {
+ if ((tmp & maskd) == based) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = zx1_ropemap[(tmp >> routed) & 0x07U];
+ }
+ }
+
+ flagsd = 0;
+ }
+
+ if (flags0) {
+ i = GetRange(base0);
+ for (tmp = base0; tmp <= last0; tmp += msk[i]) {
+ if ((tmp & mask0) == base0) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = zx1_ropemap[route0];
+ }
+ }
+
+ flags0 = 0;
+ }
+
+ for (i = 0; i < nRange; i++) {
+ if (!pDecode[i])
+ continue;
+
+ rope = pDecode[i][0];
+ for (base = tmp = 0; ++tmp < siz[i]; ) {
+ if (rope == pDecode[i][tmp])
+ continue;
+
+ if (rope >= 0) {
+ RANGE(range, (base * msk[i]) + bot[i],
+ (tmp * msk[i]) + bot[i] - 1UL,
+ RANGE_TYPE(ResExcIoBlock, 0));
+ pZX1IoRes[rope] =
+ xf86AddResToList(pZX1IoRes[rope], &range, -1);
+ }
+
+ base = tmp;
+ rope = pDecode[i][base];
+ }
+
+ xfree(pDecode[i]);
+ pDecode[i] = NULL;
+ }
+
+ nRange = 0;
+
+ /*
+ * Move on to CPU memory access decoding. For now, don't tell the common
+ * layer about CPU memory ranges that are either relocated to 0 or
+ * translated into PCI I/O.
+ */
+
+ SetRange(MIO_BASE, MIO_BASE + MIO_SIZE - 1UL, 64); /* mio */
+ SetRange(ioaaddr, ioaaddr + ((IOA_SIZE << 1) - 1UL), 64); /* ioa */
+ SetRange(PDH_START, PDH_LAST, 64); /* PDH */
+
+ SetRange(MIO_BASE, LMMIO_MASK, 64); /* Completeness */
+
+ if ((tmp = MIO_QUAD(LMMIO_DIST_BASE)) & RANGE_ENABLE) {
+ flagsd = RANGE_ENABLE;
+ maskd = MIO_QUAD(LMMIO_DIST_MASK);
+ based = tmp & maskd & (~RANGE_ENABLE & LMMIO_MASK);
+ lastd = based | (~maskd & LMMIO_MASK);
+ routed = MIO_QUAD(LMMIO_DIST_ROUTE) >> 58;
+ SetRange(based, lastd, routed);
+ }
+
+ if ((tmp = MIO_QUAD(LMMIO_DIR_BASE0)) & RANGE_ENABLE) {
+ flags0 = RANGE_ENABLE;
+ mask0 = MIO_QUAD(LMMIO_DIR_MASK0);
+ base0 = tmp & mask0 & (~RANGE_ENABLE & LMMIO_MASK);
+ last0 = base0 | (~mask0 & LMMIO_MASK);
+ route0 = MIO_QUAD(LMMIO_DIR_ROUTE0) & 0x07U;
+ SetRange(base0, last0, 64);
+ }
+
+ if ((tmp = MIO_QUAD(LMMIO_DIR_BASE1)) & RANGE_ENABLE) {
+ flags1 = RANGE_ENABLE;
+ mask1 = MIO_QUAD(LMMIO_DIR_MASK1);
+ base1 = tmp & mask1 & (~RANGE_ENABLE & LMMIO_MASK);
+ last1 = base1 | (~mask1 & LMMIO_MASK);
+ route1 = MIO_QUAD(LMMIO_DIR_ROUTE1) & 0x07U;
+ SetRange(base1, last1, 64);
+ }
+
+ if ((tmp = MIO_QUAD(LMMIO_DIR_BASE2)) & RANGE_ENABLE) {
+ flags2 = RANGE_ENABLE;
+ mask2 = MIO_QUAD(LMMIO_DIR_MASK2);
+ base2 = tmp & mask2 & (~RANGE_ENABLE & LMMIO_MASK);
+ last2 = base2 | (~mask2 & LMMIO_MASK);
+ route2 = MIO_QUAD(LMMIO_DIR_ROUTE2) & 0x07U;
+ SetRange(base2, last2, 64);
+ }
+
+ if ((tmp = MIO_QUAD(LMMIO_DIR_BASE3)) & RANGE_ENABLE) {
+ flags3 = RANGE_ENABLE;
+ mask3 = MIO_QUAD(LMMIO_DIR_MASK3);
+ base3 = tmp & mask3 & (~RANGE_ENABLE & LMMIO_MASK);
+ last3 = base3 | (~mask3 & LMMIO_MASK);
+ route3 = MIO_QUAD(LMMIO_DIR_ROUTE3) & 0x07U;
+ SetRange(base3, last3, 64);
+ }
+
+ if ((tmp = MIO_QUAD(GMMIO_DIST_BASE)) & RANGE_ENABLE) {
+ flagsg = tmp & (RANGE_ENABLE | PORT_DISABLE | MAP_TO_LMMIO);
+ maskg = MIO_QUAD(GMMIO_DIST_MASK);
+ baseg = tmp & maskg &
+ (~(RANGE_ENABLE | PORT_DISABLE | MAP_TO_LMMIO) & GMMIO_MASK);
+ lastg = baseg | (~maskg & GMMIO_MASK);
+ tmp = routeg = MIO_QUAD(GMMIO_DIST_ROUTE) >> 58;
+ if (!(flagsg & (PORT_DISABLE & MAP_TO_LMMIO)) && (tmp > 26))
+ tmp = 26;
+ SetRange(baseg, lastg, tmp);
+ }
+
+ if ((tmp = MIO_QUAD(IOS_BASE)) & RANGE_ENABLE) {
+ flagsl = RANGE_ENABLE;
+ basel = tmp & (~RANGE_ENABLE & GMMIO_MASK);
+ lastl = basel | 0x001FFFFFUL;
+ SetRange(basel, lastl, 64);
+ }
+
+ if (flagsd) {
+ i = GetRange(based);
+ for (tmp = based; tmp <= lastd; tmp += msk[i]) {
+ if ((tmp & maskd) == based) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = zx1_ropemap[(tmp >> routed) & 0x07U];
+ }
+ }
+
+ flagsd = 0;
+ }
+
+ /* LMMIO distributed range does not address anything beyond 0xFED00000 */
+ i = GetRange(MIO_BASE);
+ for (tmp = MIO_BASE; tmp <= LMMIO_MASK; tmp += msk[i]) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = -1;
+ }
+
+ /* Dillon space can sometimes be redirected to rope 0 */
+ tmp = MIO_QUAD(STATUS_CONTROL);
+ if (!(tmp & DILLON_PRESENT)) {
+ i = GetRange(PDH_START);
+ for (tmp = PDH_START; tmp <= PDH_LAST; tmp += msk[i]) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = zx1_ropemap[0];
+ }
+ }
+
+ if (flagsg) {
+ unsigned long mask = (0x07UL << routeg) | maskg;
+
+ i = GetRange(baseg);
+ for (tmp = baseg; tmp <= lastg; tmp += msk[i]) {
+ if ((tmp & maskg) == baseg) {
+ base = (tmp - bot[i]) / msk[i];
+
+ if ((flagsg & MAP_TO_LMMIO) ||
+ (!(flagsg & PORT_DISABLE) &&
+ (tmp <= ((tmp & mask) | 0x03FFFFFFUL)))) {
+ pDecode[i][base] = -1;
+ } else {
+ pDecode[i][base] = zx1_ropemap[(tmp >> routeg) & 0x07U];
+ }
+ }
+ }
+
+ flagsg = 0;
+ }
+
+ if (flagsl) {
+ i = GetRange(basel);
+ for (tmp = basel; tmp <= lastl; tmp += msk[i]) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = -1;
+ }
+
+ flagsl = 0;
+ }
+
+ /* For now, assume directed LMMIO ranges don't overlap with each other */
+ if (flags0) {
+ i = GetRange(base0);
+ for (tmp = base0; tmp <= last0; tmp += msk[i]) {
+ if ((tmp & mask0) == base0) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = zx1_ropemap[route0];
+ }
+ }
+
+ flags0 = 0;
+ }
+
+ if (flags1) {
+ i = GetRange(base1);
+ for (tmp = base1; tmp <= last1; tmp += msk[i]) {
+ if ((tmp & mask1) == base1) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = zx1_ropemap[route1];
+ }
+ }
+
+ flags1 = 0;
+ }
+
+ if (flags2) {
+ i = GetRange(base2);
+ for (tmp = base2; tmp <= last2; tmp += msk[i]) {
+ if ((tmp & mask2) == base2) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = zx1_ropemap[route2];
+ }
+ }
+
+ flags2 = 0;
+ }
+
+ if (flags3) {
+ i = GetRange(base3);
+ for (tmp = base3; tmp <= last3; tmp += msk[i]) {
+ if ((tmp & mask3) == base3) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = zx1_ropemap[route3];
+ }
+ }
+
+ flags3 = 0;
+ }
+
+ /* Claim iao config area */
+ i = GetRange(ioaaddr);
+ for (tmp = ioaaddr; tmp < ioaaddr + (IOA_SIZE << 1); tmp += msk[i]) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = -1;
+ }
+
+ /* Claim mio config area */
+ i = GetRange(MIO_BASE);
+ for (tmp = MIO_BASE; tmp < (MIO_BASE + MIO_SIZE); tmp += msk[i]) {
+ base = (tmp - bot[i]) / msk[i];
+ pDecode[i][base] = -1;
+ }
+
+ for (i = 0; i < nRange; i++) {
+ if (!pDecode[i])
+ continue;
+
+ rope = pDecode[i][0];
+ for (base = tmp = 0; ++tmp < siz[i]; ) {
+ if (rope == pDecode[i][tmp])
+ continue;
+
+ if (rope >= 0) {
+ RANGE(range, (base * msk[i]) + bot[i],
+ (tmp * msk[i]) + bot[i] - 1UL,
+ RANGE_TYPE(ResExcMemBlock, 0));
+ pZX1MemRes[rope] =
+ xf86AddResToList(pZX1MemRes[rope], &range, -1);
+ }
+
+ base = tmp;
+ rope = pDecode[i][base];
+ }
+
+ xfree(pDecode[i]);
+ pDecode[i] = NULL;
+ }
+
+ nRange = 0;
+
+ return TRUE;
+}
+
+/* This is called to finalise the results of a PCI bus scan */
+void
+xf86PostScanZX1(void)
+{
+ pciConfigPtr pPCI, *ppPCI, *ppPCI2;
+ pciBusInfo_t *pBusInfo;
+ int i, idx;
+
+ if (!pZX1mio)
+ return;
+
+ /*
+ * Certain 2.4 & 2.5 Linux kernels add fake PCI devices. Remove them to
+ * prevent any possible interference with our PCI validation.
+ *
+ * Also, if VGA isn't routed on server entry, determine if VGA routing
+ * needs to be enabled while the server is running.
+ */
+ idx = 0;
+ ppPCI = ppPCI2 = xf86scanpci(0); /* Recursion is only apparent */
+ while ((pPCI = *ppPCI2++)) {
+ switch (pPCI->pci_device_vendor) {
+ case DEVID(HP, ZX1_SBA):
+ case DEVID(HP, ZX1_IOC):
+ case DEVID(HP, ZX1_LBA):
+ xfree(pPCI); /* Remove it */
+ continue;
+
+ default:
+ *ppPCI++ = pPCI;
+ idx++;
+
+ if (zx1_hasvga)
+ continue;
+
+ switch (pPCI->pci_base_class) {
+ case PCI_CLASS_PREHISTORIC:
+ if (pPCI->pci_sub_class == PCI_SUBCLASS_PREHISTORIC_VGA)
+ break;
+ continue;
+
+ case PCI_CLASS_DISPLAY:
+ if (pPCI->pci_sub_class == PCI_SUBCLASS_DISPLAY_VGA)
+ break;
+ continue;
+
+ default:
+ continue;
+ }
+
+ zx1_hasvga = TRUE;
+ continue;
+ }
+ }
+
+ /*
+ * Restore hard-fail settings and figure out the actual subordinate bus
+ * numbers.
+ */
+ for (i = 0; i < 8; i++) {
+ if (zx1_ropemap[i] != i)
+ continue;
+
+ if (zx1_lbacntl[i] & LBA_HARD_FAIL)
+ MIO_QUAD((i << 3) + LBA_PORT0_CNTRL) = zx1_lbacntl[i];
+
+ while ((zx1_busno[i] < zx1_subno[i]) && !pciBusInfo[zx1_subno[i]])
+ zx1_subno[i]--;
+
+ if (zx1_fakebus <= zx1_subno[i])
+ zx1_fakebus = zx1_subno[i] + 1;
+ }
+
+ if (zx1_fakebus >= pciNumBuses) {
+ if (zx1_fakebus >= pciMaxBusNum)
+ FatalError("HP ZX1: No room for fake PCI bus\n");
+ pciNumBuses = zx1_fakebus + 1;
+ }
+
+ /* Set up our extra bus functions */
+ zx1BusFuncs = *(pciBusInfo[0]->funcs);
+ zx1BusFuncs.pciControlBridge = ControlZX1Bridge;
+ zx1BusFuncs.pciGetBridgeResources = GetZX1BridgeResources;
+
+ /* Set up our own fake bus to act as the root segment */
+ zx1FakeBus.configMech = pciBusInfo[0]->configMech;
+ zx1FakeBus.numDevices = pciBusInfo[0]->numDevices;
+ zx1FakeBus.primary_bus = zx1_fakebus;
+ pciBusInfo[zx1_fakebus] = &zx1FakeBus;
+
+ /* Add the fake bus' host bridge */
+ if (++idx >= MAX_PCI_DEVICES)
+ FatalError("HP ZX1: No room for fake Host-to-PCI bridge\n");
+ *ppPCI++ = zx1FakeBus.bridge = pPCI = xnfcalloc(1, sizeof(pciDevice));
+ pPCI->tag = PCI_MAKE_TAG(zx1_fakebus, 0, 0);
+ pPCI->busnum = zx1_fakebus;
+ /* pPCI->devnum = pPCI->funcnum = 0; */
+ pPCI->pci_device_vendor = DEVID(HP, ZX1_SBA);
+ pPCI->pci_base_class = PCI_CLASS_BRIDGE;
+ /* pPCI->pci_sub_class = PCI_SUBCLASS_BRIDGE_HOST; */
+ pPCI->fakeDevice = TRUE;
+
+#ifdef OLD_FORMAT
+ xf86MsgVerb(X_INFO, 2, "PCI: BusID 0x%.2x,0x%02x,0x%1x "
+ "ID 0x%04x,0x%04x Rev 0x%02x Class 0x%02x,0x%02x\n",
+ pPCI->busnum, pPCI->devnum, pPCI->funcnum,
+ pPCI->pci_vendor, pPCI->pci_device, pPCI->pci_rev_id,
+ pPCI->pci_base_class, pPCI->pci_sub_class);
+#else
+ xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x"
+ " card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n",
+ pPCI->busnum, pPCI->devnum, pPCI->funcnum,
+ pPCI->pci_vendor, pPCI->pci_device,
+ pPCI->pci_subsys_vendor, pPCI->pci_subsys_card,
+ pPCI->pci_rev_id, pPCI->pci_base_class,
+ pPCI->pci_sub_class, pPCI->pci_prog_if,
+ pPCI->pci_header_type);
+#endif
+
+ /* Add a fake PCI-to-PCI bridge to represent each active rope */
+ for (i = 0; i < 8; i++) {
+ if ((zx1_ropemap[i] != i) || !(pBusInfo = pciBusInfo[zx1_busno[i]]))
+ continue;
+
+ if (++idx >= MAX_PCI_DEVICES)
+ FatalError("HP ZX1: No room for fake PCI-to-PCI bridge\n");
+ *ppPCI++ = pPCI = xnfcalloc(1, sizeof(pciDevice));
+ pPCI->busnum = zx1_fakebus;
+ pPCI->devnum = i | 0x10;
+ /* pPCI->funcnum = 0; */
+ pPCI->tag = PCI_MAKE_TAG(zx1_fakebus, pPCI->devnum, 0);
+ pPCI->pci_device_vendor = DEVID(HP, ZX1_LBA);
+ pPCI->pci_base_class = PCI_CLASS_BRIDGE;
+ pPCI->pci_sub_class = PCI_SUBCLASS_BRIDGE_PCI;
+ pPCI->pci_header_type = 1;
+ pPCI->pci_primary_bus_number = zx1_fakebus;
+ pPCI->pci_secondary_bus_number = zx1_busno[i];
+ pPCI->pci_subordinate_bus_number = zx1_subno[i];
+ pPCI->fakeDevice = TRUE;
+
+ pBusInfo->bridge = pPCI;
+ pBusInfo->secondary = TRUE;
+ pBusInfo->primary_bus = zx1_fakebus;
+
+ /* Plug in chipset routines */
+ pBusInfo->funcs = &zx1BusFuncs;
+
+#ifdef OLD_FORMAT
+ xf86MsgVerb(X_INFO, 2, "PCI: BusID 0x%.2x,0x%02x,0x%1x "
+ "ID 0x%04x,0x%04x Rev 0x%02x Class 0x%02x,0x%02x\n",
+ pPCI->busnum, pPCI->devnum, pPCI->funcnum,
+ pPCI->pci_vendor, pPCI->pci_device, pPCI->pci_rev_id,
+ pPCI->pci_base_class, pPCI->pci_sub_class);
+#else
+ xf86MsgVerb(X_INFO, 2, "PCI: %.2x:%02x:%1x: chip %04x,%04x"
+ " card %04x,%04x rev %02x class %02x,%02x,%02x hdr %02x\n",
+ pPCI->busnum, pPCI->devnum, pPCI->funcnum,
+ pPCI->pci_vendor, pPCI->pci_device,
+ pPCI->pci_subsys_vendor, pPCI->pci_subsys_card,
+ pPCI->pci_rev_id, pPCI->pci_base_class,
+ pPCI->pci_sub_class, pPCI->pci_prog_if,
+ pPCI->pci_header_type);
+#endif
+ }
+
+ *ppPCI = NULL; /* Terminate array */
+}
diff --git a/hw/xfree86/os-support/bus/zx1PCI.h b/hw/xfree86/os-support/bus/zx1PCI.h
new file mode 100644
index 000000000..b1e8a95b5
--- /dev/null
+++ b/hw/xfree86/os-support/bus/zx1PCI.h
@@ -0,0 +1,36 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.h,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
+/*
+ * Copyright (C) 2002-2003 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifndef PCI_ZX1_H
+#define PCI_ZX1_H 1
+
+#include <X11/Xdefs.h>
+
+Bool xf86PreScanZX1(void);
+void xf86PostScanZX1(void);
+
+#endif
diff --git a/hw/xfree86/os-support/drm/drmmodule.c b/hw/xfree86/os-support/drm/drmmodule.c
new file mode 100644
index 000000000..8be822445
--- /dev/null
+++ b/hw/xfree86/os-support/drm/drmmodule.c
@@ -0,0 +1,56 @@
+/* drmmodule.c -- Module initialization
+ * Created: Fri Jun 4 09:05:48 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, 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: Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/drmmodule.c,v 1.3 2000/06/17 00:03:34 martin Exp $
+ *
+ */
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(drmSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "drm",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_EXTENSION,
+ ABI_EXTENSION_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData drmModuleData = { &VersRec, drmSetup, NULL };
+
+static pointer
+drmSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ return (void *)1;
+}
diff --git a/hw/xfree86/os-support/int10Defines.h b/hw/xfree86/os-support/int10Defines.h
new file mode 100644
index 000000000..d99ea8672
--- /dev/null
+++ b/hw/xfree86/os-support/int10Defines.h
@@ -0,0 +1,60 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/int10Defines.h,v 1.3 2001/06/30 21:54:03 tsi Exp $ */
+
+#ifndef _INT10DEFINES_H_
+#define _INT10DEFINES_H_ 1
+
+#ifdef _VM86_LINUX
+
+#include <asm/vm86.h>
+
+#define CPU_R(type,name,num) \
+ (((type *)&(((struct vm86_struct *)REG->cpuRegs)->regs.name))[num])
+#define CPU_RD(name,num) CPU_R(CARD32,name,num)
+#define CPU_RW(name,num) CPU_R(CARD16,name,num)
+#define CPU_RB(name,num) CPU_R(CARD8,name,num)
+
+#define X86_EAX CPU_RD(eax,0)
+#define X86_EBX CPU_RD(ebx,0)
+#define X86_ECX CPU_RD(ecx,0)
+#define X86_EDX CPU_RD(edx,0)
+#define X86_ESI CPU_RD(esi,0)
+#define X86_EDI CPU_RD(edi,0)
+#define X86_EBP CPU_RD(ebp,0)
+#define X86_EIP CPU_RD(eip,0)
+#define X86_ESP CPU_RD(esp,0)
+#define X86_EFLAGS CPU_RD(eflags,0)
+
+#define X86_FLAGS CPU_RW(eflags,0)
+#define X86_AX CPU_RW(eax,0)
+#define X86_BX CPU_RW(ebx,0)
+#define X86_CX CPU_RW(ecx,0)
+#define X86_DX CPU_RW(edx,0)
+#define X86_SI CPU_RW(esi,0)
+#define X86_DI CPU_RW(edi,0)
+#define X86_BP CPU_RW(ebp,0)
+#define X86_IP CPU_RW(eip,0)
+#define X86_SP CPU_RW(esp,0)
+#define X86_CS CPU_RW(cs,0)
+#define X86_DS CPU_RW(ds,0)
+#define X86_ES CPU_RW(es,0)
+#define X86_SS CPU_RW(ss,0)
+#define X86_FS CPU_RW(fs,0)
+#define X86_GS CPU_RW(gs,0)
+
+#define X86_AL CPU_RB(eax,0)
+#define X86_BL CPU_RB(ebx,0)
+#define X86_CL CPU_RB(ecx,0)
+#define X86_DL CPU_RB(edx,0)
+
+#define X86_AH CPU_RB(eax,1)
+#define X86_BH CPU_RB(ebx,1)
+#define X86_CH CPU_RB(ecx,1)
+#define X86_DH CPU_RB(edx,1)
+
+#elif defined(_X86EMU)
+
+#include "xf86x86emu.h"
+
+#endif
+
+#endif
diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c
new file mode 100644
index 000000000..4ef765451
--- /dev/null
+++ b/hw/xfree86/os-support/linux/int10/linux.c
@@ -0,0 +1,627 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.29 2002/10/16 21:13:47 dawes Exp $ */
+/*
+ * linux specific part of the int10 module
+ * Copyright 1999 Egbert Eich
+ */
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+#include "xf86Pci.h"
+#include "compiler.h"
+#define _INT10_PRIVATE
+#include "xf86int10.h"
+#ifdef __sparc__
+#define DEV_MEM "/dev/fb"
+#else
+#define DEV_MEM "/dev/mem"
+#endif
+#ifndef XFree86LOADER
+#include <sys/mman.h>
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+#endif
+#define ALLOC_ENTRIES(x) ((V_RAM / x) - 1)
+#define SHMERRORPTR (pointer)(-1)
+
+static int counter = 0;
+static unsigned long int10Generation = 0;
+
+static CARD8 read_b(xf86Int10InfoPtr pInt, int addr);
+static CARD16 read_w(xf86Int10InfoPtr pInt, int addr);
+static CARD32 read_l(xf86Int10InfoPtr pInt, int addr);
+static void write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val);
+static void write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val);
+static void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val);
+
+int10MemRec linuxMem = {
+ read_b,
+ read_w,
+ read_l,
+ write_b,
+ write_w,
+ write_l
+};
+
+typedef struct {
+ int lowMem;
+ int highMem;
+ char* base;
+ char* base_high;
+ int screen;
+ char* alloc;
+} linuxInt10Priv;
+
+#if defined DoSubModules
+
+typedef enum {
+ INT10_NOT_LOADED,
+ INT10_LOADED_VM86,
+ INT10_LOADED_X86EMU,
+ INT10_LOAD_FAILED
+} Int10LinuxSubModuleState;
+
+static Int10LinuxSubModuleState loadedSubModule = INT10_NOT_LOADED;
+
+static Int10LinuxSubModuleState int10LinuxLoadSubModule(ScrnInfoPtr pScrn);
+
+#endif /* DoSubModules */
+
+xf86Int10InfoPtr
+xf86InitInt10(int entityIndex)
+{
+ return xf86ExtendedInitInt10(entityIndex, 0);
+}
+
+xf86Int10InfoPtr
+xf86ExtendedInitInt10(int entityIndex, int Flags)
+{
+ xf86Int10InfoPtr pInt = NULL;
+ CARD8 *bios_base;
+ int screen;
+ int fd;
+ static void* vidMem = NULL;
+ static void* sysMem = NULL;
+ void* vMem = NULL;
+ void *options = NULL;
+ int low_mem;
+ int high_mem = -1;
+ char *base = SHMERRORPTR;
+ char *base_high = SHMERRORPTR;
+ int pagesize;
+ memType cs;
+ legacyVGARec vga;
+ xf86int10BiosLocation bios;
+ Bool videoBiosMapped = FALSE;
+
+ if (int10Generation != serverGeneration) {
+ counter = 0;
+ int10Generation = serverGeneration;
+ }
+
+ screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
+
+ options = xf86HandleInt10Options(xf86Screens[screen],entityIndex);
+
+ if (int10skip(options)) {
+ xfree(options);
+ return NULL;
+ }
+
+#if defined DoSubModules
+ if (loadedSubModule == INT10_NOT_LOADED)
+ loadedSubModule = int10LinuxLoadSubModule(xf86Screens[screen]);
+
+ if (loadedSubModule == INT10_LOAD_FAILED)
+ return NULL;
+#endif
+
+ if ((!vidMem) || (!sysMem)) {
+ if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
+ if (!sysMem) {
+#ifdef DEBUG
+ ErrorF("Mapping sys bios area\n");
+#endif
+ if ((sysMem = mmap((void *)(SYS_BIOS), BIOS_SIZE,
+ PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_SHARED | MAP_FIXED, fd, SYS_BIOS))
+ == MAP_FAILED) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot map SYS BIOS\n");
+ close(fd);
+ goto error0;
+ }
+ }
+ if (!vidMem) {
+#ifdef DEBUG
+ ErrorF("Mapping VRAM area\n");
+#endif
+ if ((vidMem = mmap((void *)(V_RAM), VRAM_SIZE,
+ PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_SHARED | MAP_FIXED, fd, V_RAM))
+ == MAP_FAILED) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot map V_RAM\n");
+ close(fd);
+ goto error0;
+ }
+ }
+ close(fd);
+ } else {
+ xf86DrvMsg(screen, X_ERROR, "Cannot open %s\n", DEV_MEM);
+ goto error0;
+ }
+ }
+
+ pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
+ pInt->scrnIndex = screen;
+ pInt->entityIndex = entityIndex;
+ if (!xf86Int10ExecSetup(pInt))
+ goto error0;
+ pInt->mem = &linuxMem;
+ pagesize = getpagesize();
+ pInt->private = (pointer)xnfcalloc(1, sizeof(linuxInt10Priv));
+ ((linuxInt10Priv*)pInt->private)->screen = screen;
+ ((linuxInt10Priv*)pInt->private)->alloc =
+ (pointer)xnfcalloc(1, ALLOC_ENTRIES(pagesize));
+
+ if (!xf86IsEntityPrimary(entityIndex)) {
+#ifdef DEBUG
+ ErrorF("Mapping high memory area\n");
+#endif
+ if ((high_mem = shmget(counter++, HIGH_MEM_SIZE,
+ IPC_CREAT | SHM_R | SHM_W)) == -1) {
+ if (errno == ENOSYS)
+ xf86DrvMsg(screen, X_ERROR, "shmget error\n Please reconfigure"
+ " your kernel to include System V IPC support\n");
+ goto error1;
+ }
+ } else {
+#ifdef DEBUG
+ ErrorF("Mapping Video BIOS\n");
+#endif
+ videoBiosMapped = TRUE;
+ if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
+ if ((vMem = mmap((void *)(V_BIOS), SYS_BIOS - V_BIOS,
+ PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_SHARED | MAP_FIXED, fd, V_BIOS))
+ == MAP_FAILED) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot map V_BIOS\n");
+ close(fd);
+ goto error1;
+ }
+ close (fd);
+ } else
+ goto error1;
+ }
+ ((linuxInt10Priv*)pInt->private)->highMem = high_mem;
+
+#ifdef DEBUG
+ ErrorF("Mapping 640kB area\n");
+#endif
+ if ((low_mem = shmget(counter++, V_RAM,
+ IPC_CREAT | SHM_R | SHM_W)) == -1)
+ goto error2;
+
+ ((linuxInt10Priv*)pInt->private)->lowMem = low_mem;
+ base = shmat(low_mem, 0, 0);
+ if (base == SHMERRORPTR) goto error4;
+ ((linuxInt10Priv *)pInt->private)->base = base;
+ if (high_mem > -1) {
+ base_high = shmat(high_mem, 0, 0);
+ if (base_high == SHMERRORPTR) goto error4;
+ ((linuxInt10Priv*)pInt->private)->base_high = base_high;
+ } else
+ ((linuxInt10Priv*)pInt->private)->base_high = NULL;
+
+ MapCurrentInt10(pInt);
+ Int10Current = pInt;
+
+#ifdef DEBUG
+ ErrorF("Mapping int area\n");
+#endif
+ if (xf86ReadBIOS(0, 0, (unsigned char *)0, LOW_PAGE_SIZE) < 0) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
+ goto error3;
+ }
+#ifdef DEBUG
+ ErrorF("done\n");
+#endif
+ /*
+ * Read in everything between V_BIOS and SYS_BIOS as some system BIOSes
+ * have executable code there. Note that xf86ReadBIOS() can only bring in
+ * 64K bytes at a time.
+ */
+ if (!videoBiosMapped) {
+ (void)memset((pointer)V_BIOS, 0, SYS_BIOS - V_BIOS);
+#ifdef DEBUG
+ ErrorF("Reading BIOS\n");
+#endif
+ for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE)
+ if (xf86ReadBIOS(cs, 0, (pointer)cs, V_BIOS_SIZE) < V_BIOS_SIZE)
+ xf86DrvMsg(screen, X_WARNING,
+ "Unable to retrieve all of segment 0x%06X.\n", cs);
+#ifdef DEBUG
+ ErrorF("done\n");
+#endif
+ }
+
+ xf86int10ParseBiosLocation(options,&bios);
+
+ if (xf86IsEntityPrimary(entityIndex)
+ && !(initPrimary(options))) {
+ if (bios.bus == BUS_ISA && bios.location.legacy) {
+ xf86DrvMsg(screen, X_CONFIG,
+ "Overriding BIOS location: 0x%lx\n",
+ bios.location.legacy);
+ cs = bios.location.legacy >> 4;
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ xf86DrvMsg(screen, X_ERROR,
+ "No V_BIOS at specified address 0x%x\n",cs << 4);
+ goto error3;
+ }
+ } else {
+ if (bios.bus == BUS_PCI) {
+ xf86DrvMsg(screen, X_WARNING,
+ "Option BiosLocation for primary device ignored: "
+ "It points to PCI.\n");
+ xf86DrvMsg(screen, X_WARNING,
+ "You must set Option InitPrimary also\n");
+ }
+
+ cs = ((CARD16*)0)[(0x10<<1) + 1];
+
+ bios_base = (unsigned char *)(cs << 4);
+
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ cs = ((CARD16*)0)[(0x42 << 1) + 1];
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ cs = V_BIOS >> 4;
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n");
+ goto error3;
+ }
+ }
+ }
+ }
+
+ xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs);
+
+ pInt->BIOSseg = cs;
+ set_return_trap(pInt);
+#ifdef _PC
+ pInt->Flags = Flags & (SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH);
+ if (! (pInt->Flags & SET_BIOS_SCRATCH))
+ pInt->Flags &= ~RESTORE_BIOS_SCRATCH;
+ xf86Int10SaveRestoreBIOSVars(pInt, TRUE);
+#endif
+ } else {
+ EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
+ BusType location_type;
+
+ if (bios.bus != BUS_NONE) {
+ switch (location_type = bios.bus) {
+ case BUS_PCI:
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "PCI:%i:%i%i\n",bios.location.pci.bus,
+ bios.location.pci.dev,bios.location.pci.func);
+ break;
+ case BUS_ISA:
+ if (bios.location.legacy)
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "Legacy:0x%x\n",bios.location.legacy);
+ else
+ xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: "
+ "Legacy\n");
+ break;
+ default:
+ break;
+ }
+ } else
+ location_type = pEnt->location.type;
+
+ switch (location_type) {
+ case BUS_PCI:
+ {
+ int pci_entity;
+
+ if (bios.bus == BUS_PCI)
+ pci_entity = xf86GetPciEntity(bios.location.pci.bus,
+ bios.location.pci.dev,
+ bios.location.pci.func);
+ else
+ pci_entity = pInt->entityIndex;
+ if (!mapPciRom(pci_entity, (unsigned char *)(V_BIOS))) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS\n");
+ goto error3;
+ }
+ pInt->BIOSseg = V_BIOS >> 4;
+ break;
+ }
+ case BUS_ISA:
+ if (bios.bus == BUS_ISA && bios.location.legacy) {
+ cs = bios.location.legacy >> 4;
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ xf86DrvMsg(screen,X_ERROR,"No V_BIOS found "
+ "on override address 0x%x\n",bios_base);
+ goto error3;
+ }
+ } else {
+ cs = ((CARD16*)0)[(0x10<<1)+1];
+ bios_base = (unsigned char *)(cs << 4);
+
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ cs = ((CARD16*)0)[(0x42<<1)+1];
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ cs = V_BIOS >> 4;
+ bios_base = (unsigned char *)(cs << 4);
+ if (!int10_check_bios(screen, cs, bios_base)) {
+ xf86DrvMsg(screen,X_ERROR,"No V_BIOS found\n");
+ goto error3;
+ }
+ }
+ }
+ }
+ xf86DrvMsg(screen,X_INFO,"Primary V_BIOS segment is: 0x%x\n",cs);
+ pInt->BIOSseg = cs;
+ break;
+ default:
+ goto error3;
+ }
+ xfree(pEnt);
+ pInt->num = 0xe6;
+ reset_int_vect(pInt);
+ set_return_trap(pInt);
+ LockLegacyVGA(pInt, &vga);
+ xf86ExecX86int10(pInt);
+ UnlockLegacyVGA(pInt, &vga);
+ }
+#ifdef DEBUG
+ dprint(0xc0000, 0x20);
+#endif
+
+ xfree(options);
+ return pInt;
+
+error4:
+ xf86DrvMsg(screen, X_ERROR, "shmat() call retruned errno %d\n", errno);
+error3:
+ if (base_high)
+ shmdt(base_high);
+ shmdt(base);
+ shmdt(0);
+ if (base_high)
+ shmdt((char*)HIGH_MEM);
+ shmctl(low_mem, IPC_RMID, NULL);
+ Int10Current = NULL;
+error2:
+ if (high_mem > -1)
+ shmctl(high_mem, IPC_RMID,NULL);
+error1:
+ if (vMem)
+ munmap(vMem, SYS_BIOS - V_BIOS);
+ xfree(((linuxInt10Priv*)pInt->private)->alloc);
+ xfree(pInt->private);
+error0:
+ xfree(options);
+ xfree(pInt);
+ return NULL;
+}
+
+Bool
+MapCurrentInt10(xf86Int10InfoPtr pInt)
+{
+ pointer addr;
+ int fd = -1;
+
+ if (Int10Current) {
+ shmdt(0);
+ if (((linuxInt10Priv*)Int10Current->private)->highMem >= 0)
+ shmdt((char*)HIGH_MEM);
+ else
+ munmap((pointer)V_BIOS, (SYS_BIOS - V_BIOS));
+ }
+ addr = shmat(((linuxInt10Priv*)pInt->private)->lowMem, (char*)1, SHM_RND);
+ if (addr == SHMERRORPTR) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() low memory\n");
+ return FALSE;
+ }
+
+ if (((linuxInt10Priv*)pInt->private)->highMem >= 0) {
+ addr = shmat(((linuxInt10Priv*)pInt->private)->highMem,
+ (char*)HIGH_MEM, 0);
+ if (addr == SHMERRORPTR) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "Cannot shmat() high memory\n");
+ return FALSE;
+ }
+ } else {
+ if ((fd = open(DEV_MEM, O_RDWR, 0)) >= 0) {
+ if (mmap((void *)(V_BIOS), SYS_BIOS - V_BIOS,
+ PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_SHARED | MAP_FIXED, fd, V_BIOS)
+ == MAP_FAILED) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot map V_BIOS\n");
+ close (fd);
+ return FALSE;
+ }
+ } else {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot open %s\n",DEV_MEM);
+ return FALSE;
+ }
+ close (fd);
+ }
+
+ return TRUE;
+}
+
+void
+xf86FreeInt10(xf86Int10InfoPtr pInt)
+{
+ if (!pInt)
+ return;
+
+#ifdef _PC
+ xf86Int10SaveRestoreBIOSVars(pInt, FALSE);
+#endif
+ if (Int10Current == pInt) {
+ shmdt(0);
+ if (((linuxInt10Priv*)pInt->private)->highMem >= 0)
+ shmdt((char*)HIGH_MEM);
+ else
+ munmap((pointer)V_BIOS, (SYS_BIOS - V_BIOS));
+ Int10Current = NULL;
+ }
+
+ if (((linuxInt10Priv*)pInt->private)->base_high)
+ shmdt(((linuxInt10Priv*)pInt->private)->base_high);
+ shmdt(((linuxInt10Priv*)pInt->private)->base);
+ shmctl(((linuxInt10Priv*)pInt->private)->lowMem, IPC_RMID, NULL);
+ if (((linuxInt10Priv*)pInt->private)->highMem >= 0)
+ shmctl(((linuxInt10Priv*)pInt->private)->highMem, IPC_RMID, NULL);
+ xfree(((linuxInt10Priv*)pInt->private)->alloc);
+ xfree(pInt->private);
+ xfree(pInt);
+}
+
+void *
+xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
+{
+ int pagesize = getpagesize();
+ int num_pages = ALLOC_ENTRIES(pagesize);
+ int i, j;
+
+ for (i = 0; i < (num_pages - num); i++) {
+ if (((linuxInt10Priv*)pInt->private)->alloc[i] == 0) {
+ for (j = i; j < (num + i); j++)
+ if ((((linuxInt10Priv*)pInt->private)->alloc[j] != 0))
+ break;
+ if (j == (num + i))
+ break;
+ else
+ i = i + num;
+ }
+ }
+ if (i == (num_pages - num))
+ return NULL;
+
+ for (j = i; j < (i + num); j++)
+ ((linuxInt10Priv*)pInt->private)->alloc[j] = 1;
+
+ *off = (i + 1) * pagesize;
+
+ return ((linuxInt10Priv*)pInt->private)->base + ((i + 1) * pagesize);
+}
+
+void
+xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
+{
+ int pagesize = getpagesize();
+ int first = (((unsigned long)pbase
+ - (unsigned long)((linuxInt10Priv*)pInt->private)->base)
+ / pagesize) - 1;
+ int i;
+
+ for (i = first; i < (first + num); i++)
+ ((linuxInt10Priv*)pInt->private)->alloc[i] = 0;
+}
+
+static CARD8
+read_b(xf86Int10InfoPtr pInt, int addr)
+{
+ return *((CARD8 *)(memType)addr);
+}
+
+static CARD16
+read_w(xf86Int10InfoPtr pInt, int addr)
+{
+ return *((CARD16 *)(memType)addr);
+}
+
+static CARD32
+read_l(xf86Int10InfoPtr pInt, int addr)
+{
+ return *((CARD32 *)(memType)addr);
+}
+
+static void
+write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val)
+{
+ *((CARD8 *)(memType)addr) = val;
+}
+
+static void
+write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val)
+{
+ *((CARD16 *)(memType)addr) = val;
+}
+
+static
+void write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
+{
+ *((CARD32 *)(memType) addr) = val;
+}
+
+pointer
+xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
+{
+ if (addr < V_RAM)
+ return ((linuxInt10Priv*)pInt->private)->base + addr;
+ else if (addr < V_BIOS)
+ return (pointer)(memType)addr;
+ else if (addr < SYS_BIOS) {
+ if (((linuxInt10Priv*)pInt->private)->base_high)
+ return (pointer)(((linuxInt10Priv*)pInt->private)->base_high
+ - V_BIOS + addr);
+ else
+ return (pointer) (memType)addr;
+ } else
+ return (pointer) (memType)addr;
+}
+
+#if defined DoSubModules
+
+static Bool
+vm86_tst(void)
+{
+ int __res;
+
+#ifdef __PIC__
+ /* When compiling with -fPIC, we can't use asm constraint "b" because
+ %ebx is already taken by gcc. */
+ __asm__ __volatile__("pushl %%ebx\n\t"
+ "movl %2,%%ebx\n\t"
+ "movl %1,%%eax\n\t"
+ "int $0x80\n\t"
+ "popl %%ebx"
+ :"=a" (__res)
+ :"n" ((int)113), "r" (NULL));
+#else
+ __asm__ __volatile__("int $0x80\n\t"
+ :"=a" (__res):"a" ((int)113),
+ "b" ((struct vm86_struct *)NULL));
+#endif
+
+ if (__res < 0 && __res == -ENOSYS)
+ return FALSE;
+
+ return TRUE;
+}
+
+static Int10LinuxSubModuleState
+int10LinuxLoadSubModule(ScrnInfoPtr pScrn)
+{
+ if (vm86_tst()) {
+ if (xf86LoadSubModule(pScrn,"vm86"))
+ return INT10_LOADED_VM86;
+ }
+ if (xf86LoadSubModule(pScrn,"x86emu"))
+ return INT10_LOADED_X86EMU;
+
+ return INT10_LOAD_FAILED;
+}
+
+#endif /* DoSubModules */
diff --git a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
new file mode 100644
index 000000000..6203cc3c3
--- /dev/null
+++ b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
@@ -0,0 +1,292 @@
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+#include "xf86Pci.h"
+#include "compiler.h"
+#define _INT10_PRIVATE
+#include "xf86int10.h"
+
+#define REG pInt
+
+#ifdef _VM86_LINUX
+#include "int10Defines.h"
+
+static int vm86_rep(struct vm86_struct *ptr);
+static struct vm86_struct vm86_s;
+
+Bool
+xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
+{
+#define VM86S ((struct vm86_struct *)pInt->cpuRegs)
+
+ pInt->cpuRegs = &vm86_s;
+ VM86S->flags = 0;
+ VM86S->screen_bitmap = 0;
+ VM86S->cpu_type = CPU_586;
+ memset(&VM86S->int_revectored, 0xff, sizeof(VM86S->int_revectored));
+ memset(&VM86S->int21_revectored, 0xff, sizeof(VM86S->int21_revectored));
+ return TRUE;
+}
+
+/* get the linear address */
+#define LIN_PREF_SI ((pref_seg << 4) + X86_SI)
+#define LWECX ((prefix66 ^ prefix67) ? X86_ECX : X86_CX)
+#define LWECX_ZERO {if (prefix66 ^ prefix67) X86_ECX = 0; else X86_CX = 0;}
+#define DF (1 << 10)
+
+/* vm86 fault handling */
+static Bool
+vm86_GP_fault(xf86Int10InfoPtr pInt)
+{
+ unsigned char *csp, *lina;
+ CARD32 org_eip;
+ int pref_seg;
+ int done, is_rep, prefix66, prefix67;
+
+ csp = lina = SEG_ADR((unsigned char *), X86_CS, IP);
+
+ is_rep = 0;
+ prefix66 = prefix67 = 0;
+ pref_seg = -1;
+
+ /* eat up prefixes */
+ done = 0;
+ do {
+ switch (MEM_RB(pInt, (int)csp++)) {
+ case 0x66: /* operand prefix */ prefix66=1; break;
+ case 0x67: /* address prefix */ prefix67=1; break;
+ case 0x2e: /* CS */ pref_seg=X86_CS; break;
+ case 0x3e: /* DS */ pref_seg=X86_DS; break;
+ case 0x26: /* ES */ pref_seg=X86_ES; break;
+ case 0x36: /* SS */ pref_seg=X86_SS; break;
+ case 0x65: /* GS */ pref_seg=X86_GS; break;
+ case 0x64: /* FS */ pref_seg=X86_FS; break;
+ case 0xf0: /* lock */ break;
+ case 0xf2: /* repnz */
+ case 0xf3: /* rep */ is_rep=1; break;
+ default: done=1;
+ }
+ } while (!done);
+ csp--; /* oops one too many */
+ org_eip = X86_EIP;
+ X86_IP += (csp - lina);
+
+ switch (MEM_RB(pInt, (int)csp)) {
+ case 0x6c: /* insb */
+ /* NOTE: ES can't be overwritten; prefixes 66,67 should use esi,edi,ecx
+ * but is anyone using extended regs in real mode? */
+ /* WARNING: no test for DI wrapping! */
+ X86_EDI += port_rep_inb(pInt, X86_DX, SEG_EADR((CARD32), X86_ES, DI),
+ X86_FLAGS & DF, is_rep ? LWECX : 1);
+ if (is_rep) LWECX_ZERO;
+ X86_IP++;
+ break;
+
+ case 0x6d: /* (rep) insw / insd */
+ /* NOTE: ES can't be overwritten */
+ /* WARNING: no test for _DI wrapping! */
+ if (prefix66) {
+ X86_DI += port_rep_inl(pInt, X86_DX, SEG_ADR((CARD32), X86_ES, DI),
+ X86_EFLAGS & DF, is_rep ? LWECX : 1);
+ }
+ else {
+ X86_DI += port_rep_inw(pInt, X86_DX, SEG_ADR((CARD32), X86_ES, DI),
+ X86_FLAGS & DF, is_rep ? LWECX : 1);
+ }
+ if (is_rep) LWECX_ZERO;
+ X86_IP++;
+ break;
+
+ case 0x6e: /* (rep) outsb */
+ if (pref_seg < 0) pref_seg = X86_DS;
+ /* WARNING: no test for _SI wrapping! */
+ X86_SI += port_rep_outb(pInt, X86_DX, (CARD32)LIN_PREF_SI,
+ X86_FLAGS & DF, is_rep ? LWECX : 1);
+ if (is_rep) LWECX_ZERO;
+ X86_IP++;
+ break;
+
+ case 0x6f: /* (rep) outsw / outsd */
+ if (pref_seg < 0) pref_seg = X86_DS;
+ /* WARNING: no test for _SI wrapping! */
+ if (prefix66) {
+ X86_SI += port_rep_outl(pInt, X86_DX, (CARD32)LIN_PREF_SI,
+ X86_EFLAGS & DF, is_rep ? LWECX : 1);
+ }
+ else {
+ X86_SI += port_rep_outw(pInt, X86_DX, (CARD32)LIN_PREF_SI,
+ X86_FLAGS & DF, is_rep ? LWECX : 1);
+ }
+ if (is_rep) LWECX_ZERO;
+ X86_IP++;
+ break;
+
+ case 0xe5: /* inw xx, inl xx */
+ if (prefix66) X86_EAX = x_inl(csp[1]);
+ else X86_AX = x_inw(csp[1]);
+ X86_IP += 2;
+ break;
+
+ case 0xe4: /* inb xx */
+ X86_AL = x_inb(csp[1]);
+ X86_IP += 2;
+ break;
+
+ case 0xed: /* inw dx, inl dx */
+ if (prefix66) X86_EAX = x_inl(X86_DX);
+ else X86_AX = x_inw(X86_DX);
+ X86_IP += 1;
+ break;
+
+ case 0xec: /* inb dx */
+ X86_AL = x_inb(X86_DX);
+ X86_IP += 1;
+ break;
+
+ case 0xe7: /* outw xx */
+ if (prefix66) x_outl(csp[1], X86_EAX);
+ else x_outw(csp[1], X86_AX);
+ X86_IP += 2;
+ break;
+
+ case 0xe6: /* outb xx */
+ x_outb(csp[1], X86_AL);
+ X86_IP += 2;
+ break;
+
+ case 0xef: /* outw dx */
+ if (prefix66) x_outl(X86_DX, X86_EAX);
+ else x_outw(X86_DX, X86_AX);
+ X86_IP += 1;
+ break;
+
+ case 0xee: /* outb dx */
+ x_outb(X86_DX, X86_AL);
+ X86_IP += 1;
+ break;
+
+ case 0xf4:
+#ifdef DEBUG
+ ErrorF("hlt at %p\n", lina);
+#endif
+ return FALSE;
+
+ case 0x0f:
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8x\n", X86_CS, X86_EIP);
+ goto op0ferr;
+
+ default:
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown reason for exception\n");
+
+ op0ferr:
+ dump_registers(pInt);
+ stack_trace(pInt);
+ dump_code(pInt);
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "cannot continue\n");
+ return FALSE;
+ } /* end of switch() */
+ return TRUE;
+}
+
+static int
+do_vm86(xf86Int10InfoPtr pInt)
+{
+ int retval, signo;
+
+ xf86InterceptSignals(&signo);
+ retval = vm86_rep(VM86S);
+ xf86InterceptSignals(NULL);
+
+ if (signo >= 0) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "vm86() syscall generated signal %d.\n", signo);
+ dump_registers(pInt);
+ dump_code(pInt);
+ stack_trace(pInt);
+ return 0;
+ }
+
+ switch (VM86_TYPE(retval)) {
+ case VM86_UNKNOWN:
+ if (!vm86_GP_fault(pInt)) return 0;
+ break;
+ case VM86_STI:
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86_sti :-((\n");
+ dump_registers(pInt);
+ dump_code(pInt);
+ stack_trace(pInt);
+ return 0;
+ case VM86_INTx:
+ pInt->num = VM86_ARG(retval);
+ if (!int_handler(pInt)) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR,
+ "Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval));
+ dump_registers(pInt);
+ dump_code(pInt);
+ stack_trace(pInt);
+ return 0;
+ }
+ /* I'm not sure yet what to do if we can handle ints */
+ break;
+ case VM86_SIGNAL:
+ return 1;
+ /*
+ * we used to warn here and bail out - but now the sigio stuff
+ * always fires signals at us. So we just ignore them for now.
+ */
+ xf86DrvMsg(pInt->scrnIndex, X_WARNING, "received signal\n");
+ return 0;
+ default:
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n",
+ VM86_ARG(retval), VM86_TYPE(retval));
+ dump_registers(pInt);
+ dump_code(pInt);
+ stack_trace(pInt);
+ return 0;
+ }
+
+ return 1;
+}
+
+void
+xf86ExecX86int10(xf86Int10InfoPtr pInt)
+{
+ int sig = setup_int(pInt);
+
+ if (int_handler(pInt))
+ while(do_vm86(pInt)) {};
+
+ finish_int(pInt, sig);
+}
+
+static int
+vm86_rep(struct vm86_struct *ptr)
+{
+ int __res;
+
+#ifdef __PIC__
+ /* When compiling with -fPIC, we can't use asm constraint "b" because
+ %ebx is already taken by gcc. */
+ __asm__ __volatile__("pushl %%ebx\n\t"
+ "movl %2,%%ebx\n\t"
+ "movl %1,%%eax\n\t"
+ "int $0x80\n\t"
+ "popl %%ebx"
+ :"=a" (__res)
+ :"n" ((int)113), "r" ((struct vm86_struct *)ptr));
+#else
+ __asm__ __volatile__("int $0x80\n\t"
+ :"=a" (__res):"a" ((int)113),
+ "b" ((struct vm86_struct *)ptr));
+#endif
+
+ if (__res < 0) {
+ errno = -__res;
+ __res = -1;
+ }
+ else errno = 0;
+ return __res;
+}
+
+#endif
diff --git a/hw/xfree86/os-support/linux/lnx.h b/hw/xfree86/os-support/linux/lnx.h
new file mode 100644
index 000000000..f2dd16267
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx.h
@@ -0,0 +1,44 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx.h,v 3.3 2002/11/25 14:05:04 eich Exp $ */
+
+#ifndef LNX_H_
+# ifdef __alpha__
+extern unsigned long _bus_base __P ((void)) __attribute__ ((const));
+extern unsigned long _bus_base_sparse __P ((void)) __attribute__ ((const));
+extern int iopl __P ((int __level));
+
+/* new pciconfig_iobase syscall added in 2.2.15 and 2.3.99 */
+# include <linux/unistd.h>
+# include <asm/pci.h>
+extern long (*_iobase)(unsigned, int, int, int);
+
+/*
+ * _iobase deals with the case the __NR_pciconfig_iobase is either undefined
+ * or unsupported by the kernel, but we need to make sure that the `which'
+ * argument symbols are defined.
+ */
+# ifndef IOBASE_HOSE
+# define IOBASE_HOSE 0
+# endif
+# ifndef IOBASE_SPARSE_MEM
+# define IOBASE_SPARSE_MEM 1
+# endif
+# ifndef IOBASE_DENSE_MEM
+# define IOBASE_DENSE_MEM 2
+# endif
+# ifndef IOBASE_SPARSE_IO
+# define IOBASE_SPARSE_IO 3
+# endif
+# ifndef IOBASE_DENSE_IO
+# define IOBASE_DENSE_IO 4
+# endif
+# ifndef IOBASE_ROOT_BUS
+# define IOBASE_ROOT_BUS 5
+# endif
+# ifndef IOBASE_FROM_HOSE
+# define IOBASE_FROM_HOSE 0x10000
+# endif
+# endif /* __alpha__ */
+
+#define LNX_H_
+
+#endif
diff --git a/hw/xfree86/os-support/linux/lnxResource.c b/hw/xfree86/os-support/linux/lnxResource.c
new file mode 100644
index 000000000..04e2f07c0
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnxResource.c
@@ -0,0 +1,286 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnxResource.c,v 3.18 2002/01/25 21:56:19 tsi Exp $ */
+
+/* Resource information code */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Privstr.h"
+#include "xf86Pci.h"
+#include "xf86Resources.h"
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSlib.h"
+#include "lnx.h"
+
+/* Avoid Imakefile changes */
+#include "bus/Pci.h"
+
+resRange PciAvoid[] =
+{
+#if !defined(__sparc__) || !defined(INCLUDE_XF86_NO_DOMAIN)
+ _PCI_AVOID_PC_STYLE,
+#endif
+ _END
+};
+
+#ifdef INCLUDE_XF86_NO_DOMAIN
+
+#ifdef __alpha__
+
+resPtr
+xf86BusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86PciBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+ /*
+ * On the Alpha the first 16MB of every 128 Mb segment in
+ * sparse address space are an image of the ISA bus range
+ */
+ if (_bus_base_sparse()) {
+ RANGE(range, 0x00000000, 0x07ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x09000000, 0x0fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x11000000, 0x17ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x19000000, 0x1fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x21000000, 0x27ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x29000000, 0x2fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x31000000, 0x37ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x39000000, 0x3fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x41000000, 0x47ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x49000000, 0x4fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x51000000, 0x57ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x59000000, 0x5fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x61000000, 0x67ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x69000000, 0x6fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x71000000, 0x77ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x79000000, 0x7fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x81000000, 0x87ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x89000000, 0x8fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x91000000, 0x97ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x99000000, 0x9fffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xa1000000, 0xa7ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xa9000000, 0xafffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xb1000000, 0xb7ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xb9000000, 0xbfffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xc1000000, 0xc7ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xc9000000, 0xcfffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xd1000000, 0xd7ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xd9000000, 0xdfffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xe1000000, 0xe7ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xe9000000, 0xefffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xf1000000, 0xf7ffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xf9000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ } else {
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ }
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#ifdef INCLUDE_UNUSED
+
+resPtr
+xf86IsaBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#endif /* INCLUDE_UNUSED */
+
+resPtr
+xf86AccResFromOS(resPtr ret)
+{
+ resRange range;
+
+ /*
+ * Fallback is to claim the following areas:
+ *
+ * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
+ */
+
+ RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /*
+ * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
+ * along with their sparse I/O aliases, but that's too imprecise. Instead
+ * claim a bare minimum here.
+ */
+ RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+/* RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1); */
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /* XXX add others */
+ return ret;
+}
+
+#elif defined(__powerpc__) || \
+ defined(__sparc__) || \
+ defined(__mips__) || \
+ defined(__sh__) || \
+ defined(__mc68000__) || \
+ defined(__arm__) || \
+ defined(__s390__) || \
+ defined(__hppa__)
+
+ /* XXX this isn't exactly correct but it will get the server working
+ * for now until we get something better.
+ */
+
+resPtr
+xf86BusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+#ifdef __sparc__
+ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
+#else
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+#endif
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86PciBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+#ifdef __sparc__
+ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
+#else
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+#endif
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#ifdef INCLUDE_UNUSED */
+
+resPtr
+xf86IsaBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+#ifdef __sparc__
+ RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
+#else
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+#endif
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#endif /* INCLUDE_UNUSED */
+
+resPtr
+xf86AccResFromOS(resPtr ret)
+{
+ resRange range;
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+#ifdef __sparc__
+ RANGE(range, 0x00ffffff, 0x00ffffff, ResExcIoBlock);
+#else
+ RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
+#endif
+ ret = xf86AddResToList(ret, &range, -1);
+
+ return ret;
+}
+
+#else
+
+#error : Put your platform dependent code here!!
+
+#endif
+
+#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/linux/lnx_KbdMap.c b/hw/xfree86/os-support/linux/lnx_KbdMap.c
new file mode 100644
index 000000000..25639d72d
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_KbdMap.c
@@ -0,0 +1,603 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_KbdMap.c,v 1.1 2002/10/11 01:40:35 dawes Exp $ */
+
+/*
+ * Slightly modified xf86KbdLnx.c which is
+ *
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ */
+
+#include "X.h"
+#include "Xmd.h"
+#include "input.h"
+#include "scrnintstr.h"
+
+#include "compiler.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86Xinput.h"
+#include "xf86OSKbd.h"
+#include "atKeynames.h"
+
+#include "xf86Keymap.h"
+#include "DECkeysym.h"
+
+#include "lnx_kbd.h"
+
+/*ARGSUSED*/
+
+/*
+ * KbdGetMapping --
+ * Get the national keyboard mapping. The keyboard type is set, a new map
+ * and the modifiermap is computed.
+ */
+
+static void readKernelMapping(InputInfoPtr pInfo,
+ KeySymsPtr pKeySyms, CARD8 *pModMap);
+void
+KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ KeySym *k;
+ char type;
+ int i;
+
+ readKernelMapping(pInfo, pKeySyms, pModMap);
+
+ /*
+ * compute the modifier map
+ */
+ for (i = 0; i < MAP_LENGTH; i++)
+ pModMap[i] = NoSymbol; /* make sure it is restored */
+
+ for (k = map, i = MIN_KEYCODE;
+ i < (NUM_KEYCODES + MIN_KEYCODE);
+ i++, k += 4)
+
+ switch(*k) {
+
+ case XK_Shift_L:
+ case XK_Shift_R:
+ pModMap[i] = ShiftMask;
+ break;
+
+ case XK_Control_L:
+ case XK_Control_R:
+ pModMap[i] = ControlMask;
+ break;
+
+ case XK_Caps_Lock:
+ pModMap[i] = LockMask;
+ break;
+
+ case XK_Alt_L:
+ case XK_Alt_R:
+ pModMap[i] = AltMask;
+ break;
+
+ case XK_Num_Lock:
+ pModMap[i] = NumLockMask;
+ break;
+
+ case XK_Scroll_Lock:
+ pModMap[i] = ScrollLockMask;
+ break;
+
+ /* kana support */
+ case XK_Kana_Lock:
+ case XK_Kana_Shift:
+ pModMap[i] = KanaMask;
+ break;
+
+ /* alternate toggle for multinational support */
+ case XK_Mode_switch:
+ pModMap[i] = AltLangMask;
+ break;
+
+ }
+
+ pKbd->kbdType = ioctl(pInfo->fd, KDGKBTYPE, &type) != -1 ? type : KB_101;
+
+ pKeySyms->map = map;
+ pKeySyms->mapWidth = GLYPHS_PER_KEY;
+ pKeySyms->minKeyCode = MIN_KEYCODE;
+ pKeySyms->maxKeyCode = MAX_KEYCODE;
+}
+
+#include <linux/keyboard.h>
+
+static KeySym linux_to_x[256] = {
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+ XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+ XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+ XK_comma, XK_minus, XK_period, XK_slash,
+ XK_0, XK_1, XK_2, XK_3,
+ XK_4, XK_5, XK_6, XK_7,
+ XK_8, XK_9, XK_colon, XK_semicolon,
+ XK_less, XK_equal, XK_greater, XK_question,
+ XK_at, XK_A, XK_B, XK_C,
+ XK_D, XK_E, XK_F, XK_G,
+ XK_H, XK_I, XK_J, XK_K,
+ XK_L, XK_M, XK_N, XK_O,
+ XK_P, XK_Q, XK_R, XK_S,
+ XK_T, XK_U, XK_V, XK_W,
+ XK_X, XK_Y, XK_Z, XK_bracketleft,
+ XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
+ XK_grave, XK_a, XK_b, XK_c,
+ XK_d, XK_e, XK_f, XK_g,
+ XK_h, XK_i, XK_j, XK_k,
+ XK_l, XK_m, XK_n, XK_o,
+ XK_p, XK_q, XK_r, XK_s,
+ XK_t, XK_u, XK_v, XK_w,
+ XK_x, XK_y, XK_z, XK_braceleft,
+ XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
+ XK_currency, XK_yen, XK_brokenbar, XK_section,
+ XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
+ XK_notsign, XK_hyphen, XK_registered, XK_macron,
+ XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
+ XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
+ XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
+ XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
+ XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
+ XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
+ XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
+ XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
+ XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
+ XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
+ XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
+ XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
+ XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
+ XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
+ XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
+ XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
+ XK_eth, XK_ntilde, XK_ograve, XK_oacute,
+ XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
+ XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
+ XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
+};
+
+/*
+ * Maps the AT keycodes to Linux keycodes
+ */
+static unsigned char at2lnx[NUM_KEYCODES] =
+{
+ 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */
+ 0x03, /* KEY_2 */ 0x04, /* KEY_3 */
+ 0x05, /* KEY_4 */ 0x06, /* KEY_5 */
+ 0x07, /* KEY_6 */ 0x08, /* KEY_7 */
+ 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */
+ 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */
+ 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */
+ 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */
+ 0x11, /* KEY_W */ 0x12, /* KEY_E */
+ 0x13, /* KEY_R */ 0x14, /* KEY_T */
+ 0x15, /* KEY_Y */ 0x16, /* KEY_U */
+ 0x17, /* KEY_I */ 0x18, /* KEY_O */
+ 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */
+ 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */
+ 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */
+ 0x1f, /* KEY_S */ 0x20, /* KEY_D */
+ 0x21, /* KEY_F */ 0x22, /* KEY_G */
+ 0x23, /* KEY_H */ 0x24, /* KEY_J */
+ 0x25, /* KEY_K */ 0x26, /* KEY_L */
+ 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */
+ 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */
+ 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */
+ 0x2d, /* KEY_X */ 0x2e, /* KEY_C */
+ 0x2f, /* KEY_V */ 0x30, /* KEY_B */
+ 0x31, /* KEY_N */ 0x32, /* KEY_M */
+ 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */
+ 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */
+ 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */
+ 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */
+ 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */
+ 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */
+ 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */
+ 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */
+ 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */
+ 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */
+ 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */
+ 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */
+ 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */
+ 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */
+ 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */
+ 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */
+ 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */
+ 0x00, /* 0x55 */ 0x56, /* KEY_Less */
+ 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */
+ 0x66, /* KEY_Home */ 0x67, /* KEY_Up */
+ 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */
+ 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */
+ 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */
+ 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */
+ 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */
+ 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */
+ 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */
+ 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */
+ 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */
+ 0x7A, /* KEY_Menu/FOCUS_PF11*/0x00, /* 0x6e */
+ 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */
+ 0x00, /* 0x71 */ 0x00, /* 0x72 */
+ 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */
+ 0x00, /* 0x75 */ 0x00, /* 0x76 */
+ 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */
+ 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */
+ 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */
+ 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */
+ 0x00, /* 0x7f */
+};
+#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
+
+#define NUM_CUSTOMKEYS NR_KEYS
+
+static void
+readKernelMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ KeySym *k;
+ int i;
+ int maxkey;
+ static unsigned char tbl[GLYPHS_PER_KEY] =
+ {
+ 0, /* unshifted */
+ 1, /* shifted */
+ 0, /* modeswitch unshifted */
+ 0 /* modeswitch shifted */
+ };
+
+ /*
+ * Read the mapping from the kernel.
+ * Since we're still using the XFree86 scancode->AT keycode mapping
+ * routines, we need to convert the AT keycodes to Linux keycodes,
+ * then translate the Linux keysyms into X keysyms.
+ *
+ * First, figure out which tables to use for the modeswitch columns
+ * above, from the XF86Config fields.
+ */
+ tbl[2] = 8; /* alt */
+ tbl[3] = tbl[2] | 1;
+
+ if (pKbd->CustomKeycodes) {
+ k = map;
+ maxkey = NUM_CUSTOMKEYS;
+ }
+ else {
+ k = map+GLYPHS_PER_KEY;
+ maxkey = NUM_AT2LNX;
+ }
+
+ for (i = 0; i < maxkey; ++i)
+ {
+ struct kbentry kbe;
+ int j;
+
+ if (pKbd->CustomKeycodes)
+ kbe.kb_index = i;
+ else
+ kbe.kb_index = at2lnx[i];
+
+ for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k)
+ {
+ unsigned short kval;
+
+ *k = NoSymbol;
+
+ kbe.kb_table = tbl[j];
+ if (
+ (!pKbd->CustomKeycodes && kbe.kb_index == 0) ||
+ ioctl(pInfo->fd, KDGKBENT, &kbe))
+ continue;
+
+ kval = KVAL(kbe.kb_value);
+ switch (KTYP(kbe.kb_value))
+ {
+ case KT_LATIN:
+ case KT_LETTER:
+ *k = linux_to_x[kval];
+ break;
+
+ case KT_FN:
+ if (kval <= 19)
+ *k = XK_F1 + kval;
+ else switch (kbe.kb_value)
+ {
+ case K_FIND:
+ *k = XK_Home; /* or XK_Find */
+ break;
+ case K_INSERT:
+ *k = XK_Insert;
+ break;
+ case K_REMOVE:
+ *k = XK_Delete;
+ break;
+ case K_SELECT:
+ *k = XK_End; /* or XK_Select */
+ break;
+ case K_PGUP:
+ *k = XK_Prior;
+ break;
+ case K_PGDN:
+ *k = XK_Next;
+ break;
+ case K_HELP:
+ *k = XK_Help;
+ break;
+ case K_DO:
+ *k = XK_Execute;
+ break;
+ case K_PAUSE:
+ *k = XK_Pause;
+ break;
+ case K_MACRO:
+ *k = XK_Menu;
+ break;
+ default:
+ break;
+ }
+ break;
+
+ case KT_SPEC:
+ switch (kbe.kb_value)
+ {
+ case K_ENTER:
+ *k = XK_Return;
+ break;
+ case K_BREAK:
+ *k = XK_Break;
+ break;
+ case K_CAPS:
+ *k = XK_Caps_Lock;
+ break;
+ case K_NUM:
+ *k = XK_Num_Lock;
+ break;
+ case K_HOLD:
+ *k = XK_Scroll_Lock;
+ break;
+ case K_COMPOSE:
+ *k = XK_Multi_key;
+ break;
+ default:
+ break;
+ }
+ break;
+
+ case KT_PAD:
+ switch (kbe.kb_value)
+ {
+ case K_PPLUS:
+ *k = XK_KP_Add;
+ break;
+ case K_PMINUS:
+ *k = XK_KP_Subtract;
+ break;
+ case K_PSTAR:
+ *k = XK_KP_Multiply;
+ break;
+ case K_PSLASH:
+ *k = XK_KP_Divide;
+ break;
+ case K_PENTER:
+ *k = XK_KP_Enter;
+ break;
+ case K_PCOMMA:
+ *k = XK_KP_Separator;
+ break;
+ case K_PDOT:
+ *k = XK_KP_Decimal;
+ break;
+ case K_PPLUSMINUS:
+ *k = XK_KP_Subtract;
+ break;
+ default:
+ if (kval <= 9)
+ *k = XK_KP_0 + kval;
+ break;
+ }
+ break;
+
+ /*
+ * KT_DEAD keys are for accelerated diacritical creation.
+ */
+ case KT_DEAD:
+ switch (kbe.kb_value)
+ {
+ case K_DGRAVE:
+ *k = XK_dead_grave;
+ break;
+ case K_DACUTE:
+ *k = XK_dead_acute;
+ break;
+ case K_DCIRCM:
+ *k = XK_dead_circumflex;
+ break;
+ case K_DTILDE:
+ *k = XK_dead_tilde;
+ break;
+ case K_DDIERE:
+ *k = XK_dead_diaeresis;
+ break;
+ }
+ break;
+
+ case KT_CUR:
+ switch (kbe.kb_value)
+ {
+ case K_DOWN:
+ *k = XK_Down;
+ break;
+ case K_LEFT:
+ *k = XK_Left;
+ break;
+ case K_RIGHT:
+ *k = XK_Right;
+ break;
+ case K_UP:
+ *k = XK_Up;
+ break;
+ }
+ break;
+
+ case KT_SHIFT:
+ switch (kbe.kb_value)
+ {
+ case K_ALTGR:
+ *k = XK_Alt_R;
+ break;
+ case K_ALT:
+ *k = (kbe.kb_index == 0x64 ?
+ XK_Alt_R : XK_Alt_L);
+ break;
+ case K_CTRL:
+ *k = (kbe.kb_index == 0x61 ?
+ XK_Control_R : XK_Control_L);
+ break;
+ case K_CTRLL:
+ *k = XK_Control_L;
+ break;
+ case K_CTRLR:
+ *k = XK_Control_R;
+ break;
+ case K_SHIFT:
+ *k = (kbe.kb_index == 0x36 ?
+ XK_Shift_R : XK_Shift_L);
+ break;
+ case K_SHIFTL:
+ *k = XK_Shift_L;
+ break;
+ case K_SHIFTR:
+ *k = XK_Shift_R;
+ break;
+ default:
+ break;
+ }
+ break;
+
+ /*
+ * KT_ASCII keys accumulate a 3 digit decimal number that gets
+ * emitted when the shift state changes. We can't emulate that.
+ */
+ case KT_ASCII:
+ break;
+
+ case KT_LOCK:
+ if (kbe.kb_value == K_SHIFTLOCK)
+ *k = XK_Shift_Lock;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (k[-1] == k[-2]) k[-1] = NoSymbol;
+ if (k[-2] == k[-3]) k[-2] = NoSymbol;
+ if (k[-3] == k[-4]) k[-3] = NoSymbol;
+ if (k[-4] == k[-2] && k[-3] == k[-1]) k[-2] = k[-1] = NoSymbol;
+ if (k[-1] == k[-4] && k[-2] == k[-3] && k[-2] == NoSymbol) k[-1] =NoSymbol;
+ }
+
+ if (!pKbd->CustomKeycodes)
+ return;
+
+ /*
+ * Find the Mapping for the special server functions
+ */
+ pKbd->specialMap = (TransMapPtr) xcalloc(NUM_CUSTOMKEYS, 1);
+ if (pKbd->specialMap != NULL) {
+ pKbd->specialMap->end = NUM_CUSTOMKEYS;
+ pKbd->specialMap->map = (unsigned char*) xcalloc(NUM_CUSTOMKEYS, 1);
+ if (pKbd->specialMap == NULL) {
+ xfree(pKbd->specialMap);
+ pKbd->specialMap = NULL;
+ }
+ }
+ if (pKbd->specialMap == NULL) {
+ xf86Msg(X_ERROR, "%s can't allocate \"special map\"\n", pInfo->name);
+ return;
+ }
+
+ for (i = 0; i < NUM_CUSTOMKEYS; ++i) {
+ struct kbentry kbe;
+ int special = 0;
+
+ kbe.kb_index = i;
+ kbe.kb_table = 0; /* Plain map */
+ if (!ioctl(pInfo->fd, KDGKBENT, &kbe))
+ switch (kbe.kb_value) {
+ case K(KT_LATIN,0x7f): /* This catches DEL too... But who cares? */
+ special = KEY_BackSpace;
+ break;
+ case K_PMINUS:
+ special = KEY_KP_Minus;
+ break;
+ case K_PPLUS:
+ special = KEY_KP_Plus;
+ break;
+ case K_F1:
+ special = KEY_F1;
+ break;
+ case K_F2:
+ special = KEY_F2;
+ break;
+ case K_F3:
+ special = KEY_F3;
+ break;
+ case K_F4:
+ special = KEY_F4;
+ break;
+ case K_F5:
+ special = KEY_F5;
+ break;
+ case K_F6:
+ special = KEY_F6;
+ break;
+ case K_F7:
+ special = KEY_F7;
+ break;
+ case K_F8:
+ special = KEY_F8;
+ break;
+ case K_F9:
+ special = KEY_F9;
+ break;
+ case K_F10:
+ special = KEY_F10;
+ break;
+ case K_F11:
+ special = KEY_F11;
+ break;
+ case K_F12:
+ special = KEY_F12;
+ break;
+ case K_ALT:
+ special = KEY_Alt;
+ break;
+ case K_ALTGR:
+ special = KEY_AltLang;
+ break;
+ case K_CONS:
+ special = KEY_SysReqest;
+ break;
+ }
+ pKbd->specialMap->map[i] = special;
+ }
+}
diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c
new file mode 100644
index 000000000..13e423433
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_agp.c
@@ -0,0 +1,342 @@
+/*
+ * Abstraction of the AGP GART interface.
+ *
+ * This version is for both Linux and FreeBSD.
+ *
+ * Copyright © 2000 VA Linux Systems, Inc.
+ * Copyright © 2001 The XFree86 Project, Inc.
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.10 2002/12/12 18:29:11 eich Exp $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+#if defined(linux)
+#include <asm/ioctl.h>
+#include <linux/agpgart.h>
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#include <sys/ioctl.h>
+#include <sys/agpio.h>
+#endif
+
+#ifndef AGP_DEVICE
+#define AGP_DEVICE "/dev/agpgart"
+#endif
+/* AGP page size is independent of the host page size. */
+#ifndef AGP_PAGE_SIZE
+#define AGP_PAGE_SIZE 4096
+#endif
+#define AGPGART_MAJOR_VERSION 0
+#define AGPGART_MINOR_VERSION 99
+
+static int gartFd = -1;
+static int acquiredScreen = -1;
+static Bool initDone = FALSE;
+/*
+ * Close /dev/agpgart. This frees all associated memory allocated during
+ * this server generation.
+ */
+Bool
+xf86GARTCloseScreen(int screenNum)
+{
+ if(gartFd != -1) {
+ close(gartFd);
+ acquiredScreen = -1;
+ gartFd = -1;
+ initDone = FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * Open /dev/agpgart. Keep it open until xf86GARTCloseScreen is called.
+ */
+static Bool
+GARTInit(int screenNum)
+{
+ struct _agp_info agpinf;
+
+ if (initDone)
+ return (gartFd != -1);
+
+ initDone = TRUE;
+
+ if (gartFd == -1)
+ gartFd = open(AGP_DEVICE, O_RDWR, 0);
+ else
+ return FALSE;
+
+ if (gartFd == -1) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "GARTInit: Unable to open " AGP_DEVICE " (%s)\n",
+ strerror(errno));
+ return FALSE;
+ }
+
+ xf86AcquireGART(-1);
+ /* Check the kernel driver version. */
+ if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "GARTInit: AGPIOC_INFO failed (%s)\n", strerror(errno));
+ close(gartFd);
+ gartFd = -1;
+ return FALSE;
+ }
+ xf86ReleaseGART(-1);
+
+#if defined(linux)
+ /* Per Dave Jones, every effort will be made to keep the
+ * agpgart interface backwards compatible, so allow all
+ * future versions.
+ */
+ if (
+#if (AGPGART_MAJOR_VERSION > 0) /* quiet compiler */
+ agpinf.version.major < AGPGART_MAJOR_VERSION ||
+#endif
+ (agpinf.version.major == AGPGART_MAJOR_VERSION &&
+ agpinf.version.minor < AGPGART_MINOR_VERSION)) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "GARTInit: Kernel agpgart driver version is not current"
+ " (%d.%d vs %d.%d)\n",
+ agpinf.version.major, agpinf.version.minor,
+ AGPGART_MAJOR_VERSION, AGPGART_MINOR_VERSION);
+ close(gartFd);
+ gartFd = -1;
+ return FALSE;
+ }
+#endif
+
+ return TRUE;
+}
+
+Bool
+xf86AgpGARTSupported()
+{
+ return GARTInit(-1);
+}
+
+AgpInfoPtr
+xf86GetAGPInfo(int screenNum)
+{
+ struct _agp_info agpinf;
+ AgpInfoPtr info;
+
+ if (!GARTInit(screenNum))
+ return NULL;
+
+
+ if ((info = xcalloc(sizeof(AgpInfo), 1)) == NULL) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "xf86GetAGPInfo: Failed to allocate AgpInfo\n");
+ return NULL;
+ }
+
+ if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "xf86GetAGPInfo: AGPIOC_INFO failed (%s)\n",
+ strerror(errno));
+ return NULL;
+ }
+
+ info->bridgeId = agpinf.bridge_id;
+ info->agpMode = agpinf.agp_mode;
+ info->base = agpinf.aper_base;
+ info->size = agpinf.aper_size;
+ info->totalPages = agpinf.pg_total;
+ info->systemPages = agpinf.pg_system;
+ info->usedPages = agpinf.pg_used;
+
+ return info;
+}
+
+/*
+ * XXX If multiple screens can acquire the GART, should we have a reference
+ * count instead of using acquiredScreen?
+ */
+
+Bool
+xf86AcquireGART(int screenNum)
+{
+ if (screenNum != -1 && !GARTInit(screenNum))
+ return FALSE;
+
+ if (screenNum == -1 || acquiredScreen != screenNum) {
+ if (ioctl(gartFd, AGPIOC_ACQUIRE, 0) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "xf86AcquireGART: AGPIOC_ACQUIRE failed (%s)\n",
+ strerror(errno));
+ return FALSE;
+ }
+ acquiredScreen = screenNum;
+ }
+ return TRUE;
+}
+
+Bool
+xf86ReleaseGART(int screenNum)
+{
+ if (screenNum != -1 && !GARTInit(screenNum))
+ return FALSE;
+
+ if (acquiredScreen == screenNum) {
+ /*
+ * The FreeBSD agp driver removes allocations on release.
+ * The Linux driver doesn't. xf86ReleaseGART() is expected
+ * to give up access to the GART, but not to remove any
+ * allocations.
+ */
+#if !defined(linux)
+ if (screenNum == -1)
+#endif
+ {
+ if (ioctl(gartFd, AGPIOC_RELEASE, 0) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING,
+ "xf86ReleaseGART: AGPIOC_RELEASE failed (%s)\n",
+ strerror(errno));
+ return FALSE;
+ }
+ acquiredScreen = -1;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+int
+xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
+ unsigned long *physical)
+{
+ struct _agp_allocate alloc;
+ int pages;
+
+ /*
+ * Allocates "size" bytes of GART memory (rounds up to the next
+ * page multiple) or type "type". A handle (key) for the allocated
+ * memory is returned. On error, the return value is -1.
+ */
+
+ if (!GARTInit(screenNum) || acquiredScreen != screenNum)
+ return -1;
+
+ pages = (size / AGP_PAGE_SIZE);
+ if (size % AGP_PAGE_SIZE != 0)
+ pages++;
+
+ /* XXX check for pages == 0? */
+
+ alloc.pg_count = pages;
+ alloc.type = type;
+
+ if (ioctl(gartFd, AGPIOC_ALLOCATE, &alloc) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86AllocateGARTMemory: "
+ "allocation of %d pages failed\n\t(%s)\n", pages,
+ strerror(errno));
+ return -1;
+ }
+
+ if (physical)
+ *physical = alloc.physical;
+
+ return alloc.key;
+}
+
+
+/* Bind GART memory with "key" at "offset" */
+Bool
+xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
+{
+ struct _agp_bind bind;
+ int pageOffset;
+
+ if (!GARTInit(screenNum) || acquiredScreen != screenNum)
+ return FALSE;
+
+ if (acquiredScreen != screenNum) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "xf86BindGARTMemory: AGP not acquired by this screen\n");
+ return FALSE;
+ }
+
+ if (offset % AGP_PAGE_SIZE != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: "
+ "offset (0x%x) is not page-aligned (%d)\n",
+ offset, AGP_PAGE_SIZE);
+ return FALSE;
+ }
+ pageOffset = offset / AGP_PAGE_SIZE;
+
+ xf86DrvMsgVerb(screenNum, X_INFO, 3,
+ "xf86BindGARTMemory: bind key %d at 0x%08x "
+ "(pgoffset %d)\n", key, offset, pageOffset);
+
+ bind.pg_start = pageOffset;
+ bind.key = key;
+
+ if (ioctl(gartFd, AGPIOC_BIND, &bind) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86BindGARTMemory: "
+ "binding of gart memory with key %d\n"
+ "\tat offset 0x%x failed (%s)\n",
+ key, offset, strerror(errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/* Unbind GART memory with "key" */
+Bool
+xf86UnbindGARTMemory(int screenNum, int key)
+{
+ struct _agp_unbind unbind;
+
+ if (!GARTInit(screenNum) || acquiredScreen != screenNum)
+ return FALSE;
+
+ if (acquiredScreen != screenNum) {
+ xf86DrvMsg(screenNum, X_ERROR,
+ "xf86UnbindGARTMemory: AGP not acquired by this screen\n");
+ return FALSE;
+ }
+
+ unbind.priority = 0;
+ unbind.key = key;
+
+ if (ioctl(gartFd, AGPIOC_UNBIND, &unbind) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86UnbindGARTMemory: "
+ "unbinding of gart memory with key %d "
+ "failed (%s)\n", key, strerror(errno));
+ return FALSE;
+ }
+
+ xf86DrvMsgVerb(screenNum, X_INFO, 3,
+ "xf86UnbindGARTMemory: unbind key %d\n", key);
+
+ return TRUE;
+}
+
+
+/* XXX Interface may change. */
+Bool
+xf86EnableAGP(int screenNum, CARD32 mode)
+{
+ agp_setup setup;
+
+ if (!GARTInit(screenNum) || acquiredScreen != screenNum)
+ return FALSE;
+
+ setup.agp_mode = mode;
+ if (ioctl(gartFd, AGPIOC_SETUP, &setup) != 0) {
+ xf86DrvMsg(screenNum, X_WARNING, "xf86EnableAGP: "
+ "AGPIOC_SETUP with mode %d failed (%s)\n",
+ mode, strerror(errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
diff --git a/hw/xfree86/os-support/linux/lnx_apm.c b/hw/xfree86/os-support/linux/lnx_apm.c
new file mode 100644
index 000000000..f2f326959
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_apm.c
@@ -0,0 +1,166 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c,v 3.13 2002/10/16 01:24:28 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+#include "lnx.h"
+#include <linux/apm_bios.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#define APM_PROC "/proc/apm"
+#define APM_DEVICE "/dev/apm_bios"
+
+#ifndef APM_STANDBY_FAILED
+# define APM_STANDBY_FAILED 0xf000
+#endif
+#ifndef APM_SUSPEND_FAILED
+# define APM_SUSPEND_FAILED 0xf001
+#endif
+
+static void lnxCloseAPM(void);
+static pointer APMihPtr = NULL;
+
+static struct {
+ apm_event_t apmLinux;
+ pmEvent xf86;
+} LinuxToXF86[] = {
+ { APM_SYS_STANDBY, XF86_APM_SYS_STANDBY },
+ { APM_SYS_SUSPEND, XF86_APM_SYS_SUSPEND },
+ { APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME },
+ { APM_CRITICAL_RESUME, XF86_APM_CRITICAL_RESUME },
+ { APM_LOW_BATTERY, XF86_APM_LOW_BATTERY },
+ { APM_POWER_STATUS_CHANGE, XF86_APM_POWER_STATUS_CHANGE },
+ { APM_UPDATE_TIME, XF86_APM_UPDATE_TIME },
+ { APM_CRITICAL_SUSPEND, XF86_APM_CRITICAL_SUSPEND },
+ { APM_USER_STANDBY, XF86_APM_USER_STANDBY },
+ { APM_USER_SUSPEND, XF86_APM_USER_SUSPEND },
+ { APM_STANDBY_RESUME, XF86_APM_STANDBY_RESUME },
+#if defined(APM_CAPABILITY_CHANGED)
+ { APM_CAPABILITY_CHANGED, XF86_CAPABILITY_CHANGED },
+#endif
+#if 0
+ { APM_STANDBY_FAILED, XF86_APM_STANDBY_FAILED },
+ { APM_SUSPEND_FAILED, XF86_APM_SUSPEND_FAILED }
+#endif
+};
+
+#define numApmEvents (sizeof(LinuxToXF86) / sizeof(LinuxToXF86[0]))
+
+/*
+ * APM is still under construction.
+ * I'm not sure if the places where I initialize/deinitialize
+ * apm is correct. Also I don't know what to do in SETUP state.
+ * This depends if wakeup gets called in this situation, too.
+ * Also we need to check if the action that is taken on an
+ * event is reasonable.
+ */
+static int
+lnxPMGetEventFromOs(int fd, pmEvent *events, int num)
+{
+ int i,j,n;
+ apm_event_t linuxEvents[8];
+
+ if ((n = read( fd, linuxEvents, num * sizeof(apm_event_t) )) == -1)
+ return 0;
+ n /= sizeof(apm_event_t);
+ if (n > num)
+ n = num;
+ for (i = 0; i < n; i++) {
+ for (j = 0; j < numApmEvents; j++)
+ if (LinuxToXF86[j].apmLinux == linuxEvents[i]) {
+ events[i] = LinuxToXF86[j].xf86;
+ break;
+ }
+ if (j == numApmEvents)
+ events[i] = XF86_APM_UNKNOWN;
+ }
+ return n;
+}
+
+static pmWait
+lnxPMConfirmEventToOs(int fd, pmEvent event)
+{
+ switch (event) {
+ case XF86_APM_SYS_STANDBY:
+ case XF86_APM_USER_STANDBY:
+ if (ioctl( fd, APM_IOC_STANDBY, NULL ))
+ return PM_FAILED;
+ return PM_CONTINUE;
+ case XF86_APM_SYS_SUSPEND:
+ case XF86_APM_CRITICAL_SUSPEND:
+ case XF86_APM_USER_SUSPEND:
+ if (ioctl( fd, APM_IOC_SUSPEND, NULL )) {
+ if (errno == EBUSY)
+ return PM_CONTINUE;
+ else
+ return PM_FAILED;
+ }
+ return PM_CONTINUE;
+ case XF86_APM_STANDBY_RESUME:
+ case XF86_APM_NORMAL_RESUME:
+ case XF86_APM_CRITICAL_RESUME:
+ case XF86_APM_STANDBY_FAILED:
+ case XF86_APM_SUSPEND_FAILED:
+ return PM_CONTINUE;
+ default:
+ return PM_NONE;
+ }
+}
+
+PMClose
+xf86OSPMOpen(void)
+{
+ int fd, pfd;
+
+#ifdef DEBUG
+ ErrorF("APM: OSPMOpen called\n");
+#endif
+ if (APMihPtr || !xf86Info.pmFlag)
+ return NULL;
+
+#ifdef DEBUG
+ ErrorF("APM: Opening device\n");
+#endif
+ if ((fd = open( APM_DEVICE, O_RDWR )) > -1) {
+ if (access( APM_PROC, R_OK ) ||
+ ((pfd = open( APM_PROC, O_RDONLY)) == -1)) {
+ xf86MsgVerb(X_WARNING,3,"Cannot open APM (%s) (%s)\n",
+ APM_PROC, strerror(errno));
+ close(fd);
+ return NULL;
+ } else
+ close(pfd);
+ xf86PMGetEventFromOs = lnxPMGetEventFromOs;
+ xf86PMConfirmEventToOs = lnxPMConfirmEventToOs;
+ APMihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL);
+ xf86MsgVerb(X_INFO,3,"Open APM successful\n");
+ return lnxCloseAPM;
+ }
+ xf86MsgVerb(X_WARNING,3,"Open APM failed (%s) (%s)\n", APM_DEVICE,
+ strerror(errno));
+ return NULL;
+}
+
+static void
+lnxCloseAPM(void)
+{
+ int fd;
+
+#ifdef DEBUG
+ ErrorF("APM: Closing device\n");
+#endif
+ if (APMihPtr) {
+ fd = xf86RemoveInputHandler(APMihPtr);
+ close(fd);
+ APMihPtr = NULL;
+ }
+}
+
diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c
new file mode 100644
index 000000000..5813ef4e9
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_axp.c
@@ -0,0 +1,196 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_axp.c,v 1.5 2002/11/25 14:05:04 eich Exp $ */
+
+#include <stdio.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Axp.h"
+
+axpDevice lnxGetAXP(void);
+
+typedef struct
+ { char* sysName;
+ char* sysVari;
+ char* cpu;
+ axpDevice sys; }
+AXP;
+
+static AXP axpList[] = {
+ { "Tsunami", NULL, NULL, TSUNAMI },
+ { "Eiger", NULL, NULL, TSUNAMI },
+ {"Noname", NULL, NULL, LCA },
+ { "AlphaBook1", NULL, NULL, LCA },
+ {"EB66", NULL, NULL, LCA},
+ {"EB64+",NULL,NULL, APECS},
+ {"Noritake",NULL,"EV5",CIA},
+ {"Noritake",NULL,"EV56",CIA},
+ {"Noritake",NULL,NULL,APECS},
+ {"XL",NULL,NULL,APECS},
+ {"Avanti",NULL,NULL,APECS},
+ {"Mikasa",NULL,"EV5",CIA},
+ {"Mikasa",NULL,"EV56",CIA},
+ {"Mikasa",NULL,NULL,APECS},
+ {"EB164","EB164",NULL,CIA},
+ {"EB164","PC164", NULL,CIA},
+ {"EB164","LX164",NULL, PYXIS},
+ {"EB164","SX164",NULL, PYXIS},
+ {"EB164","RX164",NULL, POLARIS},
+ {"Alcor",NULL,NULL,CIA},
+ {"Takara",NULL,NULL,CIA},
+ {"Sable",NULL, "EV5",T2_GAMMA},
+ {"Sable",NULL,"EV56",T2_GAMMA},
+ {"Sable",NULL,NULL,T2},
+ {"Rawhide",NULL,NULL,MCPCIA},
+ {"Jensen",NULL,NULL,JENSEN},
+ {"Miata",NULL,NULL,PYXIS_CIA},
+ {"Ruffian",NULL,NULL,PYXIS_CIA},
+ {"Nautilus",NULL,NULL,IRONGATE},
+ {NULL,NULL,NULL,NONE}
+};
+
+
+axpDevice
+lnxGetAXP(void)
+{
+ FILE *file;
+ int count = 0;
+ char res[256];
+ char cpu[255];
+ char systype[255];
+ char sysvari[255];
+ if (!(file = fopen("/proc/cpuinfo","r")))
+ return SYS_NONE;
+ do {
+ if (!fgets(res,0xff,file)) return SYS_NONE;
+ switch (count) {
+ case 1:
+ sscanf(res, "cpu model : %s",cpu);
+#ifdef DEBUG
+ ErrorF("CPU %s\n",cpu);
+#endif
+ break;
+ case 5:
+ sscanf(res, "system type : %s",systype);
+#ifdef DEBUG
+ ErrorF("system type : %s\n",systype);
+#endif
+ break;
+ case 6:
+ sscanf(res, "system variation : %s",sysvari);
+#ifdef DEBUG
+ ErrorF("system variation: %s\n",sysvari);
+#endif
+ break;
+ }
+ count++;
+ } while (count < 8);
+
+ fclose(file);
+
+ count = 0;
+
+ do {
+ if (!axpList[count].sysName || !strcmp(axpList[count].sysName,systype)) {
+ if (axpList[count].sysVari && strcmp(axpList[count].sysVari,sysvari)) {
+ count++;
+ continue;
+ };
+ if (axpList[count].cpu && strcmp(axpList[count].cpu,cpu)) {
+ count++;
+ continue;
+ }
+ return axpList[count].sys;
+ }
+ count++;
+ } while (1);
+}
+
+/*
+ * pciconfig_iobase wrappers and dynamic i/o selection
+ */
+#include <linux/unistd.h>
+#include <asm/pci.h>
+#include <errno.h>
+
+/* glibc versions (single hose only) */
+extern void _outb(char val, unsigned long port);
+extern void _outw(short val, unsigned long port);
+extern void _outl(int val, unsigned long port);
+extern unsigned int _inb(unsigned long port);
+extern unsigned int _inw(unsigned long port);
+extern unsigned int _inl(unsigned long port);
+
+extern void _dense_outb(char, unsigned long);
+extern void _dense_outw(short, unsigned long);
+extern void _dense_outl(int, unsigned long);
+extern unsigned int _dense_inb(unsigned long);
+extern unsigned int _dense_inw(unsigned long);
+extern unsigned int _dense_inl(unsigned long);
+
+void (*_alpha_outb)(char, unsigned long) = _outb;
+void (*_alpha_outw)(short, unsigned long) = _outw;
+void (*_alpha_outl)(int, unsigned long) = _outl;
+unsigned int (*_alpha_inb)(unsigned long) = _inb;
+unsigned int (*_alpha_inw)(unsigned long) = _inw;
+unsigned int (*_alpha_inl)(unsigned long) = _inl;
+
+static long _alpha_iobase_query(unsigned, int, int, int);
+long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query;
+
+static long
+_alpha_iobase(unsigned flags, int hose, int bus, int devfn)
+{
+#ifdef __NR_pciconfig_iobase
+ if (bus < 0) {
+ bus = hose;
+ flags |= IOBASE_FROM_HOSE;
+ }
+
+ return syscall(__NR_pciconfig_iobase, flags, bus, devfn);
+#else
+ return -ENOSYS
+#endif
+}
+
+static long
+_alpha_iobase_legacy(unsigned flags, int hose, int bus, int devfn)
+{
+ if (hose > 0) return -ENODEV;
+ if (flags & IOBASE_DENSE_MEM) return _bus_base();
+ if (flags & IOBASE_SPARSE_MEM) return _bus_base_sparse();
+ return 0;
+}
+
+static long
+_alpha_iobase_query(unsigned flags, int hose, int bus, int devfn)
+{
+ /*
+ * Only use iobase if the syscall is supported *and* it's
+ * a dense io system
+ */
+ if (_alpha_iobase(IOBASE_DENSE_IO, 0, 0, 0) > 0) {
+ /*
+ * The syscall worked and it's a dense io system - take over the
+ * io subsystem
+ */
+ _iobase = _alpha_iobase;
+
+#ifndef INCLUDE_XF86_NO_DOMAIN
+ /*
+ * Only take over the inx/outx functions if this is a dense I/O
+ * system *and* addressing domains are being used. The dense I/O
+ * routines expect I/O to be mapped (as done in xf86MapDomainIO)
+ */
+ _alpha_outb = _dense_outb;
+ _alpha_outw = _dense_outw;
+ _alpha_outl = _dense_outl;
+ _alpha_inb = _dense_inb;
+ _alpha_inw = _dense_inw;
+ _alpha_inl = _dense_inl;
+#endif /* !INCLUDE_XF86_NO_DOMAIN */
+ } else _iobase = _alpha_iobase_legacy;
+
+ return _iobase(flags, hose, bus, devfn);
+}
+
diff --git a/hw/xfree86/os-support/linux/lnx_ev56.c b/hw/xfree86/os-support/linux/lnx_ev56.c
new file mode 100644
index 000000000..bfcb0d70f
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_ev56.c
@@ -0,0 +1,147 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_ev56.c,v 3.7 2002/11/25 14:05:04 eich Exp $ */
+
+#include "X.h"
+#include "input.h"
+#include "scrnintstr.h"
+#include "compiler.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+int readDense8(pointer Base, register unsigned long Offset);
+int readDense16(pointer Base, register unsigned long Offset);
+int readDense32(pointer Base, register unsigned long Offset);
+void
+writeDenseNB8(int Value, pointer Base, register unsigned long Offset);
+void
+writeDenseNB16(int Value, pointer Base, register unsigned long Offset);
+void
+writeDenseNB32(int Value, pointer Base, register unsigned long Offset);
+void
+writeDense8(int Value, pointer Base, register unsigned long Offset);
+void
+writeDense16(int Value, pointer Base, register unsigned long Offset);
+void
+writeDense32(int Value, pointer Base, register unsigned long Offset);
+
+int
+readDense8(pointer Base, register unsigned long Offset)
+{
+ mem_barrier();
+ return *(volatile CARD8*) ((unsigned long)Base+(Offset));
+}
+
+int
+readDense16(pointer Base, register unsigned long Offset)
+{
+ mem_barrier();
+ return *(volatile CARD16*) ((unsigned long)Base+(Offset));
+}
+
+int
+readDense32(pointer Base, register unsigned long Offset)
+{
+ mem_barrier();
+ return *(volatile CARD32*)((unsigned long)Base+(Offset));
+}
+
+void
+writeDenseNB8(int Value, pointer Base, register unsigned long Offset)
+{
+ *(volatile CARD8*)((unsigned long)Base+(Offset)) = Value;
+}
+
+void
+writeDenseNB16(int Value, pointer Base, register unsigned long Offset)
+{
+ *(volatile CARD16*)((unsigned long)Base + (Offset)) = Value;
+}
+
+void
+writeDenseNB32(int Value, pointer Base, register unsigned long Offset)
+{
+ *(volatile CARD32*)((unsigned long)Base+(Offset)) = Value;
+}
+
+void
+writeDense8(int Value, pointer Base, register unsigned long Offset)
+{
+ write_mem_barrier();
+ *(volatile CARD8 *)((unsigned long)Base+(Offset)) = Value;
+}
+
+void
+writeDense16(int Value, pointer Base, register unsigned long Offset)
+{
+ write_mem_barrier();
+ *(volatile CARD16 *)((unsigned long)Base+(Offset)) = Value;
+}
+
+void
+writeDense32(int Value, pointer Base, register unsigned long Offset)
+{
+ write_mem_barrier();
+ *(volatile CARD32 *)((unsigned long)Base+(Offset)) = Value;
+}
+
+
+#ifndef INCLUDE_XF86_NO_DOMAIN
+
+void
+_dense_outb(char val, unsigned long port)
+{
+ if ((port & ~0xffff) == 0) return _outb(val, port);
+
+ write_mem_barrier();
+ *(volatile CARD8 *)port = val;
+}
+
+void
+_dense_outw(short val, unsigned long port)
+{
+ if ((port & ~0xffff) == 0) return _outw(val, port);
+
+ write_mem_barrier();
+ *(volatile CARD16 *)port = val;
+}
+
+void
+_dense_outl(int val, unsigned long port)
+{
+ if ((port & ~0xffff) == 0) return _outl(val, port);
+
+ write_mem_barrier();
+ *(volatile CARD32 *)port = val;
+}
+
+unsigned int
+_dense_inb(unsigned long port)
+{
+ if ((port & ~0xffff) == 0) return _inb(port);
+
+ mem_barrier();
+ return *(volatile CARD8 *)port;
+}
+
+unsigned int
+_dense_inw(unsigned long port)
+{
+ if ((port & ~0xffff) == 0) return _inw(port);
+
+ mem_barrier();
+ return *(volatile CARD16 *)port;
+}
+
+unsigned int
+_dense_inl(unsigned long port)
+{
+ if ((port & ~0xffff) == 0) return _inl(port);
+
+ mem_barrier();
+ return *(volatile CARD32 *)port;
+}
+
+#endif /* !INCLUDE_XF86_NO_DOMAIN */
+
diff --git a/hw/xfree86/os-support/linux/lnx_kbd.c b/hw/xfree86/os-support/linux/lnx_kbd.c
new file mode 100644
index 000000000..f2d508c04
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_kbd.c
@@ -0,0 +1,523 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.c,v 1.2 2003/02/17 15:11:57 dawes Exp $ */
+
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ * Author: Ivan Pascal.
+ *
+ * Based on the code from lnx_io.c which is
+ * Copyright 1992 by Orest Zborowski <obz@Kodak.com>
+ * Copyright 1993 by David Dawes <dawes@xfree86.org>
+ */
+
+#define NEED_EVENTS
+#include "X.h"
+
+#include "compiler.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#include "xf86Xinput.h"
+#include "xf86OSKbd.h"
+#include "atKeynames.h"
+#include "lnx_kbd.h"
+
+#define KBC_TIMEOUT 250 /* Timeout in ms for sending to keyboard controller */
+
+static KbdProtocolRec protocols[] = {
+ {"standard", PROT_STD },
+ { NULL, PROT_UNKNOWN }
+};
+
+extern Bool VTSwitchEnabled;
+#ifdef USE_VT_SYSREQ
+extern Bool VTSysreqToggle;
+#endif
+
+static void
+SoundBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
+{
+ if (loudness && pitch)
+ {
+ ioctl(pInfo->fd, KDMKTONE,
+ ((1193190 / pitch) & 0xffff) |
+ (((unsigned long)duration *
+ loudness / 50) << 16));
+ }
+}
+
+static void
+SetKbdLeds(InputInfoPtr pInfo, int leds)
+{
+ int real_leds = 0;
+
+#if defined (__sparc__)
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ if (pKbd->sunKbd) {
+ if (leds & 0x08) real_leds |= XLED1;
+ if (leds & 0x04) real_leds |= XLED3;
+ if (leds & 0x02) real_leds |= XLED4;
+ if (leds & 0x01) real_leds |= XLED2;
+ leds = real_leds;
+ real_leds = 0;
+ }
+#endif /* defined (__sparc__) */
+#ifdef LED_CAP
+ if (leds & XLED1) real_leds |= LED_CAP;
+ if (leds & XLED2) real_leds |= LED_NUM;
+ if (leds & XLED3) real_leds |= LED_SCR;
+#ifdef LED_COMP
+ if (leds & XLED4) real_leds |= LED_COMP;
+#else
+ if (leds & XLED4) real_leds |= LED_SCR;
+#endif
+#endif
+ ioctl(pInfo->fd, KDSETLED, real_leds);
+}
+
+static int
+GetKbdLeds(InputInfoPtr pInfo)
+{
+ int real_leds, leds = 0;
+
+ ioctl(pInfo->fd, KDGETLED, &real_leds);
+
+ if (real_leds & LED_CAP) leds |= XLED1;
+ if (real_leds & LED_NUM) leds |= XLED2;
+ if (real_leds & LED_SCR) leds |= XLED3;
+
+ return(leds);
+}
+
+/* kbd rate stuff based on kbdrate.c from Rik Faith <faith@cs.unc.edu> et.al.
+ * from util-linux-2.9t package */
+
+
+#ifdef __sparc__
+#include <asm/param.h>
+#include <asm/kbio.h>
+#endif
+
+static int
+KDKBDREP_ioctl_ok(int rate, int delay) {
+#if defined(KDKBDREP) && !defined(__sparc__)
+ /* This ioctl is defined in <linux/kd.h> but is not
+ implemented anywhere - must be in some m68k patches. */
+ struct kbd_repeat kbdrep_s;
+
+ /* don't change, just test */
+ kbdrep_s.rate = -1;
+ kbdrep_s.delay = -1;
+ if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
+ return 0;
+ }
+
+ /* do the change */
+ if (rate == 0) /* switch repeat off */
+ kbdrep_s.rate = 0;
+ else
+ kbdrep_s.rate = 10000 / rate; /* convert cps to msec */
+ if (kbdrep_s.rate < 1)
+ kbdrep_s.rate = 1;
+ kbdrep_s.delay = delay;
+ if (kbdrep_s.delay < 1)
+ kbdrep_s.delay = 1;
+
+ if (ioctl( 0, KDKBDREP, &kbdrep_s )) {
+ return 0;
+ }
+
+ return 1; /* success! */
+#else /* no KDKBDREP */
+ return 0;
+#endif /* KDKBDREP */
+}
+
+static int
+KIOCSRATE_ioctl_ok(int rate, int delay) {
+#ifdef KIOCSRATE
+ struct kbd_rate kbdrate_s;
+ int fd;
+
+ fd = open("/dev/kbd", O_RDONLY);
+ if (fd == -1)
+ return 0;
+
+ kbdrate_s.rate = (rate + 5) / 10; /* must be integer, so round up */
+ kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */
+ if (kbdrate_s.rate > 50)
+ kbdrate_s.rate = 50;
+
+ if (ioctl( fd, KIOCSRATE, &kbdrate_s ))
+ return 0;
+
+ close( fd );
+
+ return 1;
+#else /* no KIOCSRATE */
+ return 0;
+#endif /* KIOCSRATE */
+}
+
+static void
+SetKbdRepeat(InputInfoPtr pInfo, char rad)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ int i;
+ int timeout;
+ int value = 0x7f; /* Maximum delay with slowest rate */
+
+#ifdef __sparc__
+ int rate = 500; /* Default rate */
+ int delay = 200; /* Default delay */
+#else
+ int rate = 300; /* Default rate */
+ int delay = 250; /* Default delay */
+#endif
+
+ static int valid_rates[] = { 300, 267, 240, 218, 200, 185, 171, 160, 150,
+ 133, 120, 109, 100, 92, 86, 80, 75, 67,
+ 60, 55, 50, 46, 43, 40, 37, 33, 30, 27,
+ 25, 23, 21, 20 };
+#define RATE_COUNT (sizeof( valid_rates ) / sizeof( int ))
+
+ static int valid_delays[] = { 250, 500, 750, 1000 };
+#define DELAY_COUNT (sizeof( valid_delays ) / sizeof( int ))
+
+ if (pKbd->rate >= 0)
+ rate = pKbd->rate * 10;
+ if (pKbd->delay >= 0)
+ delay = pKbd->delay;
+
+ if(KDKBDREP_ioctl_ok(rate, delay)) /* m68k? */
+ return;
+
+ if(KIOCSRATE_ioctl_ok(rate, delay)) /* sparc? */
+ return;
+
+ if (xf86IsPc98())
+ return;
+
+#if defined(__alpha__) || defined (__i386__) || defined(__ia64__)
+
+ /* The ioport way */
+
+ for (i = 0; i < RATE_COUNT; i++)
+ if (rate >= valid_rates[i]) {
+ value &= 0x60;
+ value |= i;
+ break;
+ }
+
+ for (i = 0; i < DELAY_COUNT; i++)
+ if (delay <= valid_delays[i]) {
+ value &= 0x1f;
+ value |= i << 5;
+ break;
+ }
+
+ timeout = KBC_TIMEOUT;
+ while (((inb(0x64) & 2) == 2) && --timeout)
+ usleep(1000); /* wait */
+
+ if (timeout == 0)
+ return;
+
+ outb(0x60, 0xf3); /* set typematic rate */
+ while (((inb(0x64) & 2) == 2) && --timeout)
+ usleep(1000); /* wait */
+
+ usleep(10000);
+ outb(0x60, value);
+
+#endif /* __alpha__ || __i386__ || __ia64__ */
+}
+
+typedef struct {
+ int kbdtrans;
+ struct termios kbdtty;
+} LnxKbdPrivRec, *LnxKbdPrivPtr;
+
+static int
+KbdInit(InputInfoPtr pInfo, int what)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ LnxKbdPrivPtr priv = (LnxKbdPrivPtr) pKbd->private;
+
+ if (pKbd->isConsole) {
+ ioctl (pInfo->fd, KDGKBMODE, &(priv->kbdtrans));
+ tcgetattr (pInfo->fd, &(priv->kbdtty));
+ }
+ if (!pKbd->CustomKeycodes) {
+ pKbd->RemapScanCode = ATScancode;
+ }
+
+ return Success;
+}
+
+static int
+KbdOn(InputInfoPtr pInfo, int what)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ LnxKbdPrivPtr priv = (LnxKbdPrivPtr) pKbd->private;
+ struct termios nTty;
+
+ if (pKbd->isConsole) {
+ if (pKbd->CustomKeycodes)
+ ioctl(pInfo->fd, KDSKBMODE, K_MEDIUMRAW);
+ else
+ ioctl(pInfo->fd, KDSKBMODE, K_RAW);
+
+ nTty = priv->kbdtty;
+ nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
+ nTty.c_oflag = 0;
+ nTty.c_cflag = CREAD | CS8;
+ nTty.c_lflag = 0;
+ nTty.c_cc[VTIME]=0;
+ nTty.c_cc[VMIN]=1;
+ cfsetispeed(&nTty, 9600);
+ cfsetospeed(&nTty, 9600);
+ tcsetattr(pInfo->fd, TCSANOW, &nTty);
+ }
+ return Success;
+}
+
+static int
+KbdOff(InputInfoPtr pInfo, int what)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ LnxKbdPrivPtr priv = (LnxKbdPrivPtr) pKbd->private;
+
+ if (pKbd->isConsole) {
+ ioctl(pInfo->fd, KDSKBMODE, priv->kbdtrans);
+ tcsetattr(pInfo->fd, TCSANOW, &(priv->kbdtty));
+ }
+ return Success;
+}
+
+static int
+GetSpecialKey(InputInfoPtr pInfo, int scanCode)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ int specialkey = scanCode;
+
+#if defined (__sparc__)
+ if (pKbd->sunKbd) {
+ switch (scanCode) {
+ case 0x2b: specialkey = KEY_BackSpace; break;
+ case 0x47: specialkey = KEY_KP_Minus; break;
+ case 0x7d: specialkey = KEY_KP_Plus; break;
+ /* XXX needs cases for KEY_KP_Divide and KEY_KP_Multiply */
+ case 0x05: specialkey = KEY_F1; break;
+ case 0x06: specialkey = KEY_F2; break;
+ case 0x08: specialkey = KEY_F3; break;
+ case 0x0a: specialkey = KEY_F4; break;
+ case 0x0c: specialkey = KEY_F5; break;
+ case 0x0e: specialkey = KEY_F6; break;
+ case 0x10: specialkey = KEY_F7; break;
+ case 0x11: specialkey = KEY_F8; break;
+ case 0x12: specialkey = KEY_F9; break;
+ case 0x07: specialkey = KEY_F10; break;
+ case 0x09: specialkey = KEY_F11; break;
+ case 0x0b: specialkey = KEY_F12; break;
+ default: specialkey = 0; break;
+ }
+ return specialkey;
+ }
+#endif
+
+ if (pKbd->CustomKeycodes) {
+ specialkey = pKbd->specialMap->map[scanCode];
+ }
+ return specialkey;
+}
+
+#define ModifierSet(k) ((modifiers & (k)) == (k))
+
+static
+Bool SpecialKey(InputInfoPtr pInfo, int key, Bool down, int modifiers)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+
+ if(!pKbd->vtSwitchSupported)
+ return FALSE;
+
+ if ((ModifierSet(ControlMask | AltMask)) ||
+ (ModifierSet(ControlMask | AltLangMask))) {
+ if (VTSwitchEnabled && !xf86Info.vtSysreq) {
+ switch (key) {
+ case KEY_F1:
+ case KEY_F2:
+ case KEY_F3:
+ case KEY_F4:
+ case KEY_F5:
+ case KEY_F6:
+ case KEY_F7:
+ case KEY_F8:
+ case KEY_F9:
+ case KEY_F10:
+ if (down) {
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
+ return TRUE;
+ }
+ case KEY_F11:
+ case KEY_F12:
+ if (down) {
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
+ return TRUE;
+ }
+ }
+ }
+ }
+#ifdef USE_VT_SYSREQ
+ if (VTSwitchEnabled && xf86Info.vtSysreq) {
+ switch (key) {
+ case KEY_F1:
+ case KEY_F2:
+ case KEY_F3:
+ case KEY_F4:
+ case KEY_F5:
+ case KEY_F6:
+ case KEY_F7:
+ case KEY_F8:
+ case KEY_F9:
+ case KEY_F10:
+ if (VTSysreqToggle && down) {
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F1 + 1);
+ VTSysreqToggle = FALSE;
+ return TRUE;
+ }
+ break;
+ case KEY_F11:
+ case KEY_F12:
+ if (VTSysreqToggle && down) {
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, key - KEY_F11 + 11);
+ VTSysreqToggle = FALSE;
+ return TRUE;
+ }
+ break;
+ /* Ignore these keys -- ie don't let them cancel an alt-sysreq */
+ case KEY_Alt:
+ case KEY_AltLang:
+ break;
+ case KEY_SysReqest:
+ if ((ModifierSet(AltMask) || ModifierSet(AltLangMask)) && down)
+ VTSysreqToggle = TRUE;
+ break;
+ default:
+ /*
+ * We only land here when Alt-SysReq is followed by a
+ * non-switching key.
+ */
+ if (VTSysreqToggle)
+ VTSysreqToggle = FALSE;
+ }
+ }
+#endif /* USE_VT_SYSREQ */
+ return FALSE;
+}
+
+static void
+stdReadInput(InputInfoPtr pInfo)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ unsigned char rBuf[64];
+ int nBytes, i;
+ if ((nBytes = read( pInfo->fd, (char *)rBuf, sizeof(rBuf))) > 0) {
+ for (i = 0; i < nBytes; i++)
+ pKbd->PostEvent(pInfo, rBuf[i] & 0x7f,
+ rBuf[i] & 0x80 ? FALSE : TRUE);
+ }
+}
+
+static Bool
+OpenKeyboard(InputInfoPtr pInfo)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+ int i;
+ KbdProtocolId prot = PROT_UNKNOWN;
+ char *s;
+
+ s = xf86SetStrOption(pInfo->options, "Protocol", NULL);
+ for (i = 0; protocols[i].name; i++) {
+ if (xf86NameCmp(s, protocols[i].name) == 0) {
+ prot = protocols[i].id;
+ break;
+ }
+ }
+
+ switch (prot) {
+ case PROT_STD:
+ pInfo->read_input = stdReadInput;
+ break;
+ default:
+ xf86Msg(X_ERROR,"\"%s\" is not a valid keyboard protocol name\n", s);
+ xfree(s);
+ return FALSE;
+ }
+
+ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, s);
+ xfree(s);
+
+ s = xf86SetStrOption(pInfo->options, "Device", NULL);
+ if (s == NULL) {
+ pInfo->fd = xf86Info.consoleFd;
+ pKbd->isConsole = TRUE;
+ } else {
+ pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
+ if (pInfo->fd == -1) {
+ xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
+ xfree(s);
+ return FALSE;
+ }
+ pKbd->isConsole = FALSE;
+ xfree(s);
+ }
+
+ if (pKbd->isConsole)
+ pKbd->vtSwitchSupported = TRUE;
+
+ return TRUE;
+}
+
+Bool
+xf86OSKbdPreInit(InputInfoPtr pInfo)
+{
+ KbdDevPtr pKbd = pInfo->private;
+
+ pKbd->KbdInit = KbdInit;
+ pKbd->KbdOn = KbdOn;
+ pKbd->KbdOff = KbdOff;
+ pKbd->Bell = SoundBell;
+ pKbd->SetLeds = SetKbdLeds;
+ pKbd->GetLeds = GetKbdLeds;
+ pKbd->SetKbdRepeat = SetKbdRepeat;
+ pKbd->KbdGetMapping = KbdGetMapping;
+ pKbd->SpecialKey = SpecialKey;
+
+ pKbd->RemapScanCode = NULL;
+ pKbd->GetSpecialKey = GetSpecialKey;
+
+ pKbd->OpenKeyboard = OpenKeyboard;
+ pKbd->vtSwitchSupported = FALSE;
+
+ pKbd->private = xcalloc(sizeof(LnxKbdPrivRec), 1);
+ if (pKbd->private == NULL) {
+ xf86Msg(X_ERROR,"can't allocate keyboard OS private data\n");
+ return FALSE;
+ }
+
+#if defined(__powerpc__)
+ {
+ FILE *f;
+ f = fopen("/proc/sys/dev/mac_hid/keyboard_sends_linux_keycodes","r");
+ if (f) {
+ if (fgetc(f) == '0')
+ pKbd->CustomKeycodes = TRUE;
+ fclose(f);
+ }
+ }
+#endif
+ return TRUE;
+}
diff --git a/hw/xfree86/os-support/linux/lnx_kbd.h b/hw/xfree86/os-support/linux/lnx_kbd.h
new file mode 100644
index 000000000..ac783bfbc
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_kbd.h
@@ -0,0 +1,5 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kbd.h,v 1.1 2002/10/11 01:40:35 dawes Exp $ */
+
+extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms,
+ CARD8 *pModMap);
+
diff --git a/hw/xfree86/os-support/linux/lnx_kmod.c b/hw/xfree86/os-support/linux/lnx_kmod.c
new file mode 100644
index 000000000..0cb69b209
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_kmod.c
@@ -0,0 +1,109 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_kmod.c,v 3.6 2001/10/31 22:50:30 tsi Exp $ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include "xf86_OSlib.h"
+#include "xf86.h"
+
+
+#define MODPROBE_PATH_FILE "/proc/sys/kernel/modprobe"
+#define MAX_PATH 1024
+
+
+#if 0
+/* XFree86 #defines execl to be the xf86execl() function which does
+ * a fork AND exec. We don't want that. We want the regular,
+ * standard execl().
+ */
+#ifdef execl
+#undef execl
+#endif
+#endif
+
+
+/*
+ * Load a Linux kernel module.
+ * This is used by the DRI/DRM to load a DRM kernel module when
+ * the X server starts. It could be used for other purposes in the future.
+ * Input:
+ * modName - name of the kernel module (Ex: "tdfx")
+ * Return:
+ * 0 for failure, 1 for success
+ */
+int
+xf86LoadKernelModule(const char *modName)
+{
+ char mpPath[MAX_PATH] = "";
+ int fd = -1, status, n;
+ pid_t pid;
+
+ /* get the path to the modprobe program */
+ fd = open(MODPROBE_PATH_FILE, O_RDONLY);
+ if (fd >= 0) {
+ int count = read(fd, mpPath, MAX_PATH - 1);
+ if (count <= 0) {
+ mpPath[0] = 0;
+ }
+ else if (mpPath[count - 1] == '\n') {
+ mpPath[count - 1] = 0; /* replaces \n with \0 */
+ }
+ close(fd);
+ /* if this worked, mpPath will be "/sbin/modprobe" or similar. */
+ }
+
+ if (mpPath[0] == 0) {
+ /* we failed to get the path from the system, use a default */
+ strcpy(mpPath, "/sbin/modprobe");
+ }
+
+ /* now fork/exec the modprobe command */
+ /*
+ * It would be good to capture stdout/stderr so that it can be directed
+ * to the log file. modprobe errors currently are missing from the log
+ * file.
+ */
+ switch (pid = fork()) {
+ case 0: /* child */
+ /* change real/effective user ID to 0/0 as we need to
+ * preinstall agpgart module for some DRM modules
+ */
+ if (setreuid(0,0)) {
+ xf86Msg(X_WARNING,"LoadKernelModule: "
+ "Setting of real/effective user Id to 0/0 failed");
+ }
+ setenv("PATH","/sbin",1);
+ n = execl(mpPath, "modprobe", modName, NULL);
+ xf86Msg(X_WARNING,"LoadKernelModule %s\n",strerror(errno));
+ exit(EXIT_FAILURE); /* if we get here the child's exec failed */
+ break;
+ case -1: /* fork failed */
+ return 0;
+ default: /* fork worked */
+ {
+ /* XXX we loop over waitpid() because it sometimes fails on
+ * the first attempt. Don't know why!
+ */
+ int count = 0, p;
+ do {
+ p = waitpid(pid, &status, 0);
+ } while (p == -1 && count++ < 4);
+
+ if (p == -1) {
+ return 0;
+ }
+
+ if (WIFEXITED(status) && WEXITSTATUS(status) == 0) {
+ return 1; /* success! */
+ }
+ else {
+ return 0;
+ }
+ }
+ }
+
+ /* never get here */
+ return 0;
+}
diff --git a/hw/xfree86/os-support/linux/lnx_mouse.c b/hw/xfree86/os-support/linux/lnx_mouse.c
new file mode 100644
index 000000000..8bc7e6331
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_mouse.c
@@ -0,0 +1,29 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_mouse.c,v 1.1 1999/05/17 13:17:18 dawes Exp $ */
+
+/*
+ * Copyright 1999 by The XFree86 Project, Inc.
+ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Xinput.h"
+#include "xf86OSmouse.h"
+
+static int
+SupportedInterfaces(void)
+{
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO;
+}
+
+OSMouseInfoPtr
+xf86OSMouseInit(int flags)
+{
+ OSMouseInfoPtr p;
+
+ p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ if (!p)
+ return NULL;
+ p->SupportedInterfaces = SupportedInterfaces;
+ return p;
+}
+
diff --git a/hw/xfree86/os-support/linux/lnx_pci.c b/hw/xfree86/os-support/linux/lnx_pci.c
new file mode 100644
index 000000000..5477b9130
--- /dev/null
+++ b/hw/xfree86/os-support/linux/lnx_pci.c
@@ -0,0 +1,85 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c,v 3.9 2003/02/17 15:29:22 dawes Exp $ */
+
+#include <stdio.h>
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+#include "xf86Pci.h"
+
+#ifdef __sparc__
+#define PCIADDR_TYPE long long
+#define PCIADDR_IGNORE_FMT "%*x"
+#define PCIADDR_FMT "%llx"
+#else
+#define PCIADDR_TYPE long
+#define PCIADDR_IGNORE_FMT "%*x"
+#define PCIADDR_FMT "%lx"
+#endif
+
+Bool
+xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits)
+{
+ FILE *file;
+ char c[0x200];
+ char *res;
+ unsigned int bus, devfn, dev, fn;
+ unsigned PCIADDR_TYPE size[7];
+ unsigned int num;
+ signed PCIADDR_TYPE Size;
+
+ if (index > 7)
+ return FALSE;
+
+ if (!(file = fopen("/proc/bus/pci/devices","r")))
+ return FALSE;
+ do {
+ res = fgets(c,0x1ff,file);
+ if (res) {
+ num = sscanf(res,
+ /*bus+dev vendorid deviceid irq */
+ "%02x%02x\t%*04x%*04x\t%*x"
+ /* 7 PCI resource base addresses */
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ "\t" PCIADDR_IGNORE_FMT
+ /* 7 PCI resource sizes, and then optionally a driver name */
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT
+ "\t" PCIADDR_FMT,
+ &bus,&devfn,&size[0],&size[1],&size[2],&size[3],
+ &size[4],&size[5],&size[6]);
+ if (num != 9) { /* apparantly not 2.3 style */
+ fclose(file);
+ return FALSE;
+ }
+ dev = devfn >> 3;
+ fn = devfn & 0x7;
+ if (tag == pciTag(bus,dev,fn)) {
+ *bits = 0;
+ if (size[index] != 0) {
+ Size = size[index] - ((PCIADDR_TYPE) 1);
+ while (Size & ((PCIADDR_TYPE) 0x01)) {
+ Size = Size >> ((PCIADDR_TYPE) 1);
+ (*bits)++;
+ }
+ }
+ fclose(file);
+ return TRUE;
+ }
+ }
+ } while (res);
+
+ fclose(file);
+ return FALSE;
+}
diff --git a/hw/xfree86/os-support/lynxos/lynx_mouse.c b/hw/xfree86/os-support/lynxos/lynx_mouse.c
new file mode 100644
index 000000000..1dc5ff8af
--- /dev/null
+++ b/hw/xfree86/os-support/lynxos/lynx_mouse.c
@@ -0,0 +1,30 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_mouse.c,v 1.1 1999/05/22 08:40:14 dawes Exp $ */
+
+/*
+ * Copyright 1999 by The XFree86 Project, Inc.
+ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Xinput.h"
+#include "xf86OSmouse.h"
+
+static int
+SupportedInterfaces(void)
+{
+ /* XXX Need to check this. */
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
+}
+
+OSMouseInfoPtr
+xf86OSMouseInit(int flags)
+{
+ OSMouseInfoPtr p;
+
+ p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ if (!p)
+ return NULL;
+ p->SupportedInterfaces = SupportedInterfaces;
+ return p;
+}
+
diff --git a/hw/xfree86/os-support/lynxos/lynx_noinline.c b/hw/xfree86/os-support/lynxos/lynx_noinline.c
new file mode 100644
index 000000000..858b0eb65
--- /dev/null
+++ b/hw/xfree86/os-support/lynxos/lynx_noinline.c
@@ -0,0 +1,174 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_noinline.c,v 3.6 2002/01/25 21:56:20 tsi Exp $ */
+/*
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ */
+
+#if /* NO_INLINE && */ defined(__powerpc__)
+
+#include "xf86Pci.h"
+
+extern volatile unsigned char *ioBase;
+
+void
+eieio()
+{
+ __asm__ __volatile__ ("eieio");
+}
+
+unsigned long
+ldl_brx(volatile unsigned char *base, int ndx)
+{
+ register unsigned long tmp = *(volatile unsigned long *)(base+ndx);
+ return( ((tmp & 0x000000ff) << 24) |
+ ((tmp & 0x0000ff00) << 8) |
+ ((tmp & 0x00ff0000) >> 8) |
+ ((tmp & 0xff000000) >> 24) );
+}
+
+unsigned short
+ldw_brx(volatile unsigned char *base, int ndx)
+{
+ register unsigned short tmp = *(volatile unsigned short *)(base+ndx);
+ return((tmp << 8) | (tmp >> 8));
+}
+
+void
+stl_brx(unsigned long val, volatile unsigned char *base, int ndx)
+{
+ unsigned char *p = (unsigned char *)&val;
+ unsigned long tmp = (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | (p[0] << 0);
+ *(volatile unsigned long *)(base+ndx) = tmp;
+}
+
+void
+stw_brx(unsigned short val, volatile unsigned char *base, int ndx)
+{
+ unsigned char *p = (unsigned char *)&val;
+ unsigned short tmp = (p[1] << 8) | p[0];
+ *(volatile unsigned short *)(base+ndx) = tmp;
+}
+
+void
+outb(IOADDRESS port, unsigned char value)
+{
+ *((volatile unsigned char *)(ioBase + port)) = value; eieio();
+}
+
+void
+outw(IOADDRESS port, unsigned short value)
+{
+ stw_brx(value, ioBase, port); eieio();
+}
+
+void
+outl(IOADDRESS port, unsigned int value)
+{
+ stl_brx(value, ioBase, port); eieio();
+}
+
+unsigned char
+inb(IOADDRESS port)
+{
+ unsigned char val;
+
+ val = *((volatile unsigned char *)(ioBase + port)); eieio();
+ return(val);
+}
+
+unsigned short
+inw(IOADDRESS port)
+{
+ unsigned short val;
+
+ val = ldw_brx(ioBase, port); eieio();
+ return(val);
+}
+
+unsigned int
+inl(IOADDRESS port)
+{
+ unsigned int val;
+
+ val = ldl_brx(ioBase, port); eieio();
+ return(val);
+}
+
+unsigned long
+ldl_u(void *p)
+{
+ return (((*(unsigned char *)(p)) |
+ (*((unsigned char *)(p)+1)<<8) |
+ (*((unsigned char *)(p)+2)<<16) |
+ (*((unsigned char *)(p)+3)<<24)));
+}
+
+unsigned long
+ldq_u(void *p)
+{
+ return ldl_u(p);
+}
+
+unsigned short
+ldw_u(void *p)
+{
+ return(((*(unsigned char *)(p)) |
+ (*((unsigned char *)(p)+1)<<8)));
+}
+
+void
+stl_u(unsigned long v, void *p)
+{
+
+ (*(unsigned char *)(p)) = (v);
+ (*((unsigned char *)(p)+1)) = ((v) >> 8);
+ (*((unsigned char *)(p)+2)) = ((v) >> 16);
+ (*((unsigned char *)(p)+3)) = ((v) >> 24);
+}
+
+void
+stq_u(unsigned long v, void *p)
+{
+ stl_u(v,p);
+}
+
+void
+stw_u(unsigned short v, void *p)
+{
+ (*(unsigned char *)(p)) = (v);
+ (*((unsigned char *)(p)+1)) = ((v) >> 8);
+}
+
+
+void
+mem_barrier(void)
+{
+ __asm__ __volatile__("eieio");
+}
+
+void
+write_mem_barrier(void)
+{
+ __asm__ __volatile__("eieio");
+}
+
+#endif /* NO_INLINE && __powerpc__ */
diff --git a/hw/xfree86/os-support/lynxos/lynx_ppc.c b/hw/xfree86/os-support/lynxos/lynx_ppc.c
new file mode 100644
index 000000000..e587b7ee0
--- /dev/null
+++ b/hw/xfree86/os-support/lynxos/lynx_ppc.c
@@ -0,0 +1,52 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/lynxos/lynx_ppc.c,v 1.1 2002/12/14 04:41:14 dawes Exp $ */
+/*
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ */
+
+void ppc_flush_icache()
+{
+__asm__ __volatile__ (" \
+ mflr 0 ;\
+ stw 31,-4(1) ;\
+ stw 0,8(1) ;\
+ stwu 1,-64(1) ;\
+ mr 31,1 ;\
+ stw 3,88(31) ;\
+ li 6, 0 ;\
+ dcbf 3, 6 ;\
+ li 5, 32 ;\
+ dcbf 3, 5 ;\
+ sync ;\
+ li 4,0 ;\
+ icbi 3,4 ;\
+ li 7,32 ;\
+ icbi 3,7 ;\
+ sync ;\
+ isync ;\
+ lwz 1,0(1) ;\
+ lwz 0,8(1) ;\
+ mtlr 0 ;\
+ lwz 31,-4(1) ;\
+ blr ;\
+");
+}
diff --git a/hw/xfree86/os-support/misc/BUSmemcpy.S b/hw/xfree86/os-support/misc/BUSmemcpy.S
new file mode 100644
index 000000000..e4ff36c62
--- /dev/null
+++ b/hw/xfree86/os-support/misc/BUSmemcpy.S
@@ -0,0 +1,156 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/BUSmemcpy.S,v 1.1 1999/07/10 07:24:49 dawes Exp $ */
+/******************************************************************************
+ Copyright 1993 by Glenn G. Lai
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Glenn G. Lai not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+Glenn G. Lai DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+Glenn G. Lai
+P.O. Box 4314
+Austin, Tx 78765
+(glenn@cs.utexas.edu)
+8/9/93
+******************************************************************************/
+/* $XConsortium: BUSmemcpy.s /main/4 1996/02/21 17:39:34 kaleb $ */
+
+/*
+ * Modified to use long-alignment of video memory rather than word-alignment
+ * to improve performance for LocalBus video cards. Function names changed
+ * from ISAToMem and MemToISA to BusToMem and MemToBus.
+ *
+ * David Dawes <dawes@XFree86.org>, 25 August 1993.
+ */
+
+
+#include "assyntax.h"
+
+ FILE("BUSmemcpy.s")
+
+ AS_BEGIN
+
+/* BusToMem copies from video memory to main memory
+ MemToBus copies from main memory to video memory
+
+ void xf86BusToMem(unsigned char *dst, unsigned char *src, int len);
+ void xf86MemToBus(unsigned char *dst, unsigned char *src, int len);
+*/
+
+#define dst REGOFF(4,ESP)
+#define src REGOFF(8,ESP)
+#define len REGOFF(12,ESP)
+
+ GLOBL GLNAME(xf86BusToMem)
+ GLOBL GLNAME(xf86MemToBus)
+
+ SEG_DATA
+copyright:
+ STRING("Copyright 8/9/1993 by Glenn G. Lai")
+
+ ALIGNDATA4
+tmp: D_LONG 0
+
+ SEG_TEXT
+ ALIGNTEXT4
+GLNAME(xf86BusToMem):
+ CLD
+ MOV_L (ESI, CONTENT(tmp))
+ MOV_L (EDI, EDX)
+
+ MOV_L (src, ESI)
+ MOV_L (dst, EDI)
+ MOV_L (len, ECX)
+
+ CMP_L (CONST(7), ECX)
+ JC (quickBM)
+
+ TEST_L (CONST(1), ESI)
+ JZ (BwM)
+
+ MOVS_B
+ DEC_L (ECX)
+
+BwM:
+ TEST_L (CONST(2), ESI)
+ JZ (BlM)
+
+ MOVS_W
+ DEC_L (ECX)
+ DEC_L (ECX)
+
+BlM:
+ MOV_L (ECX, EAX)
+ AND_L (CONST(3), EAX)
+ SHR_L (CONST(2), ECX)
+ REP
+ MOVS_L
+ MOV_L (EAX, ECX)
+quickBM:
+ OR_L (ECX, ECX)
+ JZ (return)
+ REP
+ MOVS_B
+return:
+ MOV_L (CONTENT(tmp), ESI)
+ MOV_L (EDX, EDI)
+ RET
+/************************/
+
+ ALIGNTEXT4
+GLNAME(xf86MemToBus):
+ CLD
+ MOV_L (ESI, CONTENT(tmp))
+ MOV_L (EDI, EDX)
+
+ MOV_L (src, ESI)
+ MOV_L (dst, EDI)
+ MOV_L (len, ECX)
+
+ CMP_L (CONST(7), ECX)
+ JC (quickMB)
+
+ TEST_L (CONST(1), EDI)
+ JZ (MwB)
+
+ MOVS_B
+ DEC_L (ECX)
+
+MwB:
+ TEST_L (CONST(2), EDI)
+ JZ (MlB)
+
+ MOVS_W
+ DEC_L (ECX)
+ DEC_L (ECX)
+
+MlB:
+ MOV_L (ECX, EAX)
+ AND_L (CONST(3), EAX)
+ SHR_L (CONST(2), ECX)
+ REP
+ MOVS_L
+ MOV_L (EAX, ECX)
+quickMB:
+ OR_L (ECX, ECX)
+ JZ (return)
+ REP
+ MOVS_B
+
+ MOV_L (CONTENT(tmp), ESI)
+ MOV_L (EDX, EDI)
+ RET
+
diff --git a/hw/xfree86/os-support/misc/BUSmemcpy.c b/hw/xfree86/os-support/misc/BUSmemcpy.c
new file mode 100644
index 000000000..acef268a1
--- /dev/null
+++ b/hw/xfree86/os-support/misc/BUSmemcpy.c
@@ -0,0 +1,409 @@
+
+/****************************************************************************
+
+ For Alpha Linux, BusToMem() and MemToBus() can be simply memcpy(), BUT:
+ we need to prevent unaligned operations when accessing DENSE space on the BUS,
+ as the video memory is mmap'd that way. The below code does this.
+
+NOTE: we could simply use the "memcpy()" from LIBC here, but that, currently, is
+ not as fast.
+
+Thanks to Linus Torvalds for contributing this code.
+
+****************************************************************************/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/BUSmemcpy.c,v 1.4 2000/02/12 20:45:44 dawes Exp $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#ifdef __alpha__
+
+#include "compiler.h"
+
+/*
+ * The Jensen lacks dense memory, thus we have to address the bus via
+ * the sparse addressing scheme. These routines are only used in s3im.c
+ * Non time critical code uses SlowBCopy_{from/to} bus.
+ *
+ * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996
+ */
+
+#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */
+#define LWORD_CODING (0x18)
+#define SPARSE (5)
+#else
+#define LWORD_CODING (0x60)
+#define SPARSE (7)
+#endif
+
+void
+xf86JensenMemToBus(char *Base, long dst, long src, int count)
+{
+ if( ((long)src^((long)dst)) & 3) {
+ /* src & dst are NOT aligned to each other */
+ unsigned long addr;
+ unsigned long low_word, high_word,last_read;
+ long rm,loop;
+ unsigned long tmp,org,org2,mask,src_org,count_org;
+
+ src_org=src;
+ count_org=count;
+
+ /* add EISA longword coding and round off*/
+ addr = (long)(Base+(dst<<SPARSE) + LWORD_CODING) & ~(3<<SPARSE);
+ rm = (long)dst & 3;
+ count += rm;
+
+ count = count_org + rm;
+ org = *(volatile unsigned int *)addr;
+ __asm__("ldq_u %0,%1"
+ :"=r" (low_word):"m" (*(unsigned long *)(src_org)));
+ src = src_org - rm;
+ if( count > 4 ) {
+ last_read = src_org+count_org - 1;
+ __asm__("ldq_u %0,%1"
+ :"=r" (high_word):"m" (*(unsigned long *)(src+4)));
+ __asm__("extll %1,%2,%0"
+ :"=r" (low_word)
+ :"r" (low_word), "r" ((unsigned long)(src)));
+ __asm__("extlh %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (high_word), "r" ((unsigned long)(src)));
+ tmp |= low_word;
+ src += 4;
+ __asm__("mskqh %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (tmp), "r" (rm));
+ __asm__("mskql %1,%2,%0"
+ :"=r" (org2)
+ :"r" (org), "r" (rm));
+ tmp |= org2;
+
+ loop = (count-4) >> 2; /* loop eqv. count>=4 ; count -= 4 */
+ while (loop) {
+ /* tmp to be stored completly -- need to read next word*/
+ low_word = high_word;
+ *(volatile unsigned int *) (addr) = tmp;
+ __asm__("ldq_u %0,%1"
+ :"=r" (high_word):"m" (*(unsigned long*)(src+4)));
+ loop --;
+ __asm__("extll %1,%2,%0"
+ :"=r" (low_word)
+ :"r" (low_word), "r" ((unsigned long)src));
+ __asm__("extlh %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (high_word), "r" ((unsigned long)src));
+ src += 4;
+ tmp |= low_word;
+ addr += 4<<SPARSE;
+ }
+ if ( count & 3 ) {
+ /* Store tmp completly, and possibly read one more word.*/
+ *(volatile unsigned int *) (addr) = tmp;
+ __asm__("ldq_u %0,%1"
+ :"=r" (tmp):"m" (*((unsigned long *)(last_read)) ));
+ addr += 4<<SPARSE;
+ __asm__("extll %1,%2,%0"
+ :"=r" (low_word)
+ :"r" (high_word), "r" ((unsigned long)src));
+ __asm__("extlh %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (tmp), "r" ((unsigned long)src));
+ tmp |= low_word;
+ org = *(volatile unsigned int *)addr;
+
+ __asm__("mskql %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (tmp), "r" (count&3));
+ __asm__("mskqh %1,%2,%0"
+ :"=r" (org)
+ :"r" (org), "r" (count&3));
+
+ tmp |= org;
+ }
+ *(volatile unsigned int *) (addr) = tmp;
+ return;
+ } else { /* count > 4 */
+ __asm__("ldq_u %0,%1"
+ :"=r" (high_word):"m" (*(unsigned long *)(src+4)));
+ __asm__("extll %1,%2,%0"
+ :"=r" (low_word)
+ :"r" (low_word), "r" ((unsigned long)(src)));
+ __asm__("extlh %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (high_word), "r" ((unsigned long)(src)));
+ tmp |= low_word;
+ if( count < 4 ) {
+
+ mask = -1;
+ __asm__("mskqh %1,%2,%0"
+ :"=r" (mask)
+ :"r" (mask), "r" (rm));
+ __asm__("mskql %1,%2,%0"
+ :"=r" (mask)
+ :"r" (mask), "r" (count));
+ tmp = (tmp & mask) | (org & ~mask);
+ *(volatile unsigned int *) (addr) = tmp;
+ return;
+ } else {
+ __asm__("mskqh %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (tmp), "r" (rm));
+ __asm__("mskql %1,%2,%0"
+ :"=r" (org2)
+ :"r" (org), "r" (rm));
+
+ tmp |= org2;
+ *(volatile unsigned int *) (addr) = tmp;
+ return;
+ }
+ }
+ } else { /* src & dst are aligned to each other */
+ unsigned long addr;
+ unsigned int tmp,org,rm;
+ unsigned int *src_r;
+
+ /* add EISA longword coding and round off*/
+ addr = (long)(Base+(dst<<SPARSE) + LWORD_CODING) & ~(3<<SPARSE);
+
+ src_r = (unsigned int*)((long)src & ~3L);
+ rm=(long)src & 3;
+ count += rm;
+
+ tmp = *src_r;
+ org = *(volatile unsigned int *)addr;
+
+ __asm__("mskqh %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (tmp), "r" (rm));
+ __asm__("mskql %1,%2,%0"
+ :"=r" (org)
+ :"r" (org), "r" (rm));
+
+ tmp |= org;
+
+ while (count > 4) {
+ *(volatile unsigned int *) addr = tmp;
+ addr += 4<<SPARSE;
+ src_r += 1;
+ tmp = *src_r;
+ count -= 4;
+ }
+
+ org = *(volatile unsigned int *)addr;
+ __asm__("mskql %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (tmp), "r" (count));
+ __asm__("mskqh %1,%2,%0"
+ :"=r" (org)
+ :"r" (org), "r" (count));
+ tmp |= org;
+ *(volatile unsigned int *) (addr) = tmp;
+ }
+}
+
+void
+xf86JensenBusToMem(char *Base, char *dst, unsigned long src, int count)
+{
+#if 0
+ /* Optimization of BusToMem() is left as an exercise to the reader ;-)
+ * Consider that ldq_u/extlh/extll won't work because of the bus being
+ * only 4 bytes wide!
+ */
+#else
+ unsigned long addr;
+ long result;
+
+ addr = (unsigned long)(Base+(src<<SPARSE)) ;
+ while( addr & (3<<SPARSE) ){
+ if(count <= 0) return;
+ result = *(volatile int *) addr;
+ result >>= ((addr>>SPARSE) & 3) * 8;
+ *dst++ = (char) result;
+ addr += 1<<SPARSE;
+ count--;
+ }
+ count -=4;
+ while(count >= 0){
+ int i;
+
+ result = *(volatile int *) (addr+LWORD_CODING);
+ for(i=4;i--;) {
+ *dst++ = (char) result;
+ result >>= 8;
+ }
+ addr += 4<<SPARSE;
+ count -= 4;
+ }
+ count +=4;
+
+ while( count ){
+ result = *(volatile int *) addr;
+ result >>= ((addr>>SPARSE) & 3) * 8;
+ *dst++ = (char) result;
+ addr += 1<<SPARSE;
+ count--;
+ }
+#endif
+}
+
+
+static unsigned long __memcpy(unsigned long dest, unsigned long src, int n);
+
+void
+xf86BusToMem(unsigned char *dst, unsigned char *src, int len)
+{
+ __memcpy((unsigned long)dst, (unsigned long)src, len);
+}
+void
+xf86MemToBus(unsigned char *dst, unsigned char *src, int len)
+{
+ if (len == sizeof(int))
+ if (!(((long)src | (long)dst) & 3))
+ *((unsigned int*)dst) = *((unsigned int*)(src));
+ else {
+ int i;
+ if (((long)src) & 3)
+ i = ldl_u((unsigned int*)src);
+ else
+ i = *(unsigned int*)src;
+ if (((long)dst) & 3)
+ stl_u(i,(unsigned int*)dst);
+ else
+ *(unsigned int*)dst = i;
+ }
+ else
+ __memcpy((unsigned long)dst, (unsigned long)src, len);
+}
+
+/*
+ * linux/arch/alpha/lib/memcpy.c
+ *
+ * Copyright (C) 1995 Linus Torvalds, used with his permission.
+ */
+
+/*
+ * This is a reasonably optimized memcpy() routine.
+ */
+
+/*
+ * Note that the C code is written to be optimized into good assembly. However,
+ * at this point gcc is unable to sanely compile "if (n >= 0)", resulting in a
+ * explicit compare against 0 (instead of just using the proper "blt reg, xx" or
+ * "bge reg, xx"). I hope alpha-gcc will be fixed to notice this eventually..
+ */
+
+/*
+ * This should be done in one go with ldq_u*2/mask/stq_u. Do it
+ * with a macro so that we can fix it up later..
+ */
+#define ALIGN_DEST_TO8(d,s,n) \
+ while (d & 7) { \
+ if (n <= 0) return; \
+ n--; \
+ *(char *) d = *(char *) s; \
+ d++; s++; \
+ }
+
+/*
+ * This should similarly be done with ldq_u*2/mask/stq. The destination
+ * is aligned, but we don't fill in a full quad-word
+ */
+#define DO_REST(d,s,n) \
+ while (n > 0) { \
+ n--; \
+ *(char *) d = *(char *) s; \
+ d++; s++; \
+ }
+
+/*
+ * This should be done with ldq/mask/stq. The source and destination are
+ * aligned, but we don't fill in a full quad-word
+ */
+#define DO_REST_ALIGNED(d,s,n) DO_REST(d,s,n)
+
+/*
+ * This does unaligned memory copies. We want to avoid storing to
+ * an unaligned address, as that would do a read-modify-write cycle.
+ * We also want to avoid double-reading the unaligned reads.
+ *
+ * Note the ordering to try to avoid load (and address generation) latencies.
+ */
+static __inline__ void __memcpy_unaligned(unsigned long d, unsigned long s, long n)
+{
+ ALIGN_DEST_TO8(d,s,n);
+ n -= 8; /* to avoid compare against 8 in the loop */
+ if (n >= 0) {
+ unsigned long low_word, high_word;
+ __asm__("ldq_u %0,%1":"=r" (low_word):"m" (*(unsigned long *) s));
+ do {
+ unsigned long tmp;
+ __asm__("ldq_u %0,%1":"=r" (high_word):"m" (*(unsigned long *)(s+8)));
+ n -= 8;
+ __asm__("extql %1,%2,%0"
+ :"=r" (low_word)
+ :"r" (low_word), "r" (s));
+ __asm__("extqh %1,%2,%0"
+ :"=r" (tmp)
+ :"r" (high_word), "r" (s));
+ s += 8;
+ *(unsigned long *) d = low_word | tmp;
+ d += 8;
+ low_word = high_word;
+ } while (n >= 0);
+ }
+ n += 8;
+ DO_REST(d,s,n);
+}
+
+/*
+ * Hmm.. Strange. The __asm__ here is there to make gcc use a integer register
+ * for the load-store. I don't know why, but it would seem that using a floating
+ * point register for the move seems to slow things down (very small difference,
+ * though).
+ *
+ * Note the ordering to try to avoid load (and address generation) latencies.
+ */
+static __inline__ void __memcpy_aligned(unsigned long d, unsigned long s, long n)
+{
+ ALIGN_DEST_TO8(d,s,n);
+ n -= 8;
+ while (n >= 0) {
+ unsigned long tmp;
+ __asm__("ldq %0,%1":"=r" (tmp):"m" (*(unsigned long *) s));
+ n -= 8;
+ s += 8;
+ *(unsigned long *) d = tmp;
+ d += 8;
+ }
+ n += 8;
+ DO_REST_ALIGNED(d,s,n);
+}
+
+static unsigned long __memcpy(unsigned long dest, unsigned long src, int n)
+{
+ if (!((dest ^ src) & 7)) {
+ __memcpy_aligned(dest, src, n);
+ return dest;
+ }
+ __memcpy_unaligned(dest, src, n);
+ return dest;
+}
+
+#else /* __alpha__ */
+
+void
+xf86BusToMem(unsigned char *dst, unsigned char *src, int len)
+{
+ memcpy(dst, src, len);
+}
+void
+xf86MemToBus(unsigned char *dst, unsigned char *src, int len)
+{
+ memcpy(dst, src, len);
+}
+
+#endif /* __alpha__ */
diff --git a/hw/xfree86/os-support/misc/Delay.c b/hw/xfree86/os-support/misc/Delay.c
new file mode 100644
index 000000000..7d5dad40b
--- /dev/null
+++ b/hw/xfree86/os-support/misc/Delay.c
@@ -0,0 +1,37 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.3 2000/12/08 20:13:38 eich Exp $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#include <time.h>
+
+void
+xf86UDelay(long usec)
+{
+#if 0
+ struct timeval start, interrupt;
+#else
+ int sigio;
+
+ sigio = xf86BlockSIGIO();
+ xf86usleep(usec);
+ xf86UnblockSIGIO(sigio);
+#endif
+
+#if 0
+ gettimeofday(&start,NULL);
+
+ do {
+ usleep(usec);
+ gettimeofday(&interrupt,NULL);
+
+ if ((usec = usec - (interrupt.tv_sec - start.tv_sec) * 1000000
+ - (interrupt.tv_usec - start.tv_usec)) < 0)
+ break;
+ start = interrupt;
+ } while (1);
+#endif
+}
+
diff --git a/hw/xfree86/os-support/misc/IODelay.S b/hw/xfree86/os-support/misc/IODelay.S
new file mode 100644
index 000000000..4c6e32f3f
--- /dev/null
+++ b/hw/xfree86/os-support/misc/IODelay.S
@@ -0,0 +1,53 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.S,v 1.1 1999/07/10 07:24:50 dawes Exp $ */
+/*******************************************************************************
+ Copyright 1994 by Glenn G. Lai
+
+ 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 copyr notice appear in all copies and that
+both that copyr notice and this permission notice appear in
+supporting documentation, and that the name of Glenn G. Lai not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+Glenn G. Lai DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+Glenn G. Lai
+P.O. Box 4314
+Austin, Tx 78765
+glenn@cs.utexas.edu)
+7/21/94
+*******************************************************************************/
+/* $XConsortium: IODelay.s /main/4 1996/02/21 17:40:21 kaleb $ */
+
+/*
+ * All we really need is a delay of about 40ns for I/O recovery for just
+ * about any occasion, but we'll be more conservative here: On a
+ * 100-MHz CPU, produce at least a delay of 1,000ns.
+ */
+
+#include "assyntax.h"
+
+ FILE("DACDelay.s")
+
+ AS_BEGIN
+
+ GLOBL GLNAME(xf86IODelay)
+
+ SEG_TEXT
+ ALIGNTEXT4
+GLNAME(xf86IODelay):
+ MOV_L (CONST(100), EAX)
+delay_it:
+ DEC_L (EAX)
+ JNE (delay_it)
+ RET
+
diff --git a/hw/xfree86/os-support/misc/IODelay.c b/hw/xfree86/os-support/misc/IODelay.c
new file mode 100644
index 000000000..57176c5d5
--- /dev/null
+++ b/hw/xfree86/os-support/misc/IODelay.c
@@ -0,0 +1,24 @@
+
+/* $XConsortium: IODelay.c /main/1 1996/05/07 17:13:43 kaleb $ */
+/*******************************************************************************
+ Stub for Alpha Linux
+*******************************************************************************/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/IODelay.c,v 1.3 2000/08/04 16:13:41 eich Exp $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+/*
+ * All we really need is a delay of about 40ns for I/O recovery for just
+ * about any occasion, but we'll be more conservative here: On a
+ * 100-MHz CPU, produce at least a delay of 1,000ns.
+ */
+void
+xf86IODelay()
+{
+ xf86UDelay(1);
+}
+
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.S b/hw/xfree86/os-support/misc/SlowBcopy.S
new file mode 100644
index 000000000..9b6af1d69
--- /dev/null
+++ b/hw/xfree86/os-support/misc/SlowBcopy.S
@@ -0,0 +1,108 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.S,v 1.1 1999/07/10 07:24:51 dawes Exp $ */
+/*******************************************************************************
+ Copyright 1994 by Glenn G. Lai
+
+ 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 copyr notice appear in all copies and that
+both that copyr notice and this permission notice appear in
+supporting documentation, and that the name of Glenn G. Lai not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+Glenn G. Lai DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+Glenn G. Lai
+P.O. Box 4314
+Austin, Tx 78765
+glenn@cs.utexas.edu)
+7/21/94
+*******************************************************************************/
+/* $XConsortium: SlowBcopy.s /main/4 1996/02/21 17:40:52 kaleb $ */
+
+/*
+ * Modified from the output generated by GCC
+ *
+ * Create a dependency that should be immune from the effect of register
+ * renaming as is commonly seen in superscalar processors. This should
+ * insert a minimum of 100-ns delays between reads/writes at clock rates
+ * up to 100 MHz---GGL
+ *
+ * Slowbcopy(char *src, char *dst, int count)
+ *
+ */
+
+#include "assyntax.h"
+
+ FILE("SlowBcopy.s")
+
+ AS_BEGIN
+
+gcc2_compiled.:
+___gnu_compiled_c:
+
+ GLOBL GLNAME(xf86SlowBcopy)
+
+ SEG_TEXT
+ ALIGNTEXT4
+GLNAME(xf86SlowBcopy):
+ PUSH_L (EBP)
+ MOV_L (ESP,EBP)
+ PUSH_L (ESI)
+ PUSH_L (EBX)
+ MOV_L (REGOFF(8,EBP),ECX)
+ MOV_L (REGOFF(12,EBP),EDX)
+ MOV_L (REGOFF(16,EBP),ESI)
+ XOR_L (EAX,EAX)
+ CMP_L (ESI,EAX)
+ JGE (L3)
+
+ ALIGNTEXT4
+L5:
+ MOV_B (REGIND(ECX),BL)
+
+ MOV_B (BL, BH)
+ MOV_B (BH, BL)
+ MOV_B (BL, BH)
+ MOV_B (BH, BL)
+ MOV_B (BL, BH)
+ MOV_B (BH, BL)
+ MOV_B (BL, BH)
+ MOV_B (BH, BL)
+ MOV_B (BL, BH)
+ MOV_B (BH, BL)
+
+ MOV_B (BL,REGIND(EDX))
+
+ INC_L (ECX)
+ DEC_L (ECX)
+ INC_L (ECX)
+ DEC_L (ECX)
+ INC_L (ECX)
+ DEC_L (ECX)
+ INC_L (ECX)
+ DEC_L (ECX)
+ INC_L (ECX)
+ DEC_L (ECX)
+
+ INC_L (ECX)
+ INC_L (EDX)
+ INC_L (EAX)
+ CMP_L (ESI,EAX)
+ JL (L5)
+L3:
+ LEA_L (REGOFF(-8,EBP),ESP)
+ POP_L (EBX)
+ POP_L (ESI)
+ MOV_L (EBP,ESP)
+ POP_L (EBP)
+ RET
+
diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c
new file mode 100644
index 000000000..f705e0f42
--- /dev/null
+++ b/hw/xfree86/os-support/misc/SlowBcopy.c
@@ -0,0 +1,107 @@
+
+/* $XConsortium: SlowBcopy.c /main/1 1996/05/07 17:14:10 kaleb $ */
+/*******************************************************************************
+ for Alpha Linux
+*******************************************************************************/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/SlowBcopy.c,v 1.5 2001/11/19 15:44:18 tsi Exp $ */
+
+/*
+ * Create a dependency that should be immune from the effect of register
+ * renaming as is commonly seen in superscalar processors. This should
+ * insert a minimum of 100-ns delays between reads/writes at clock rates
+ * up to 100 MHz---GGL
+ *
+ * Slowbcopy(char *src, char *dst, int count)
+ *
+ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "compiler.h"
+
+/* The outb() isn't needed on my machine, but who knows ... -- ost */
+void
+xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
+{
+ while(len--)
+ {
+ *dst++ = *src++;
+#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
+ outb(0x80, 0x00);
+#endif
+ }
+}
+
+#ifdef __alpha__
+/*
+ * The Jensen lacks dense memory, thus we have to address the bus via
+ * the sparse addressing scheme. Time critical code uses routines from
+ * BUSmemcpy.c
+ *
+ * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996
+ */
+
+#ifdef linux
+
+unsigned long _bus_base(void);
+
+#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */
+#define SPARSE (5)
+#else
+#define SPARSE (7)
+#endif
+
+#define isJensen() (!_bus_base())
+
+#else
+
+#define isJensen() 0
+#define SPARSE 0
+
+#endif
+
+void
+xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count)
+{
+ if (isJensen())
+ {
+ unsigned long addr;
+ long result;
+
+ addr = (unsigned long) src;
+ while( count ){
+ result = *(volatile int *) addr;
+ result >>= ((addr>>SPARSE) & 3) * 8;
+ *dst++ = (unsigned char) (0xffUL & result);
+ addr += 1<<SPARSE;
+ count--;
+ outb(0x80, 0x00);
+ }
+ }
+ else
+ xf86SlowBcopy(src,dst,count);
+}
+
+void
+xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count)
+{
+ if (isJensen())
+ {
+ unsigned long addr;
+
+ addr = (unsigned long) dst;
+ while(count) {
+ *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101;
+ src++;
+ addr += 1<<SPARSE;
+ count--;
+ outb(0x80, 0x00);
+ }
+ }
+ else
+ xf86SlowBcopy(src,dst,count);
+}
+#endif
diff --git a/hw/xfree86/os-support/sco/sco_iop.c b/hw/xfree86/os-support/sco/sco_iop.c
new file mode 100644
index 000000000..85b4bbd41
--- /dev/null
+++ b/hw/xfree86/os-support/sco/sco_iop.c
@@ -0,0 +1,124 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/sco_iop.c,v 1.1 2002/06/03 21:22:10 dawes Exp $ */
+/*
+ * Copyright 2001 by J. Kean Johnston <jkj@caldera.com>
+ *
+ * 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 J. Kean Johnston not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. J. Kean Johnston makes no
+ * representations about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ * J. KEAN JOHNSTON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL J. KEAN JOHNSTON 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.
+ */
+/* $XConsortium$ */
+
+
+#include "X.h"
+
+#include "compiler.h"
+
+#define _NEED_SYSI86
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86OSpriv.h"
+#include "xf86_OSlib.h"
+
+
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+
+/*
+ * There is a right way and a wrong way of doing this. Unfortunately, we
+ * are forced to do it the wrong way. The right way is to be told the range
+ * or ranges of I/O ports the driver(s) need access to, in order to use the
+ * CONS_IOPERM ioctl() to grant access only to those ports we care about.
+ * This way we can guarantee some small level of stability because a driver
+ * does not have access to all ports (which would mean it could play with
+ * the PIT and thus affect scheduling times, or a whole slew of other
+ * nasty things). However, because XFree86 currently only enables or disables
+ * ALL port access, we need to run at IOPL 3, which basically means the
+ * X Server runs at the same level as the kernel. You can image why this is
+ * unsafe. Oh, and this is not a problem unique to OSR5, other OSes are
+ * affected by this as well.
+ *
+ * So, for the time being, we change our IOPL until such time as the XFree86
+ * architecture is changed to allow for tighter control of I/O ports. If and
+ * when it is, then the CONS_ADDIOP/DELIOP ioctl() should be used to enable
+ * or disable access to the desired ports.
+ */
+
+extern long sysi86 (int cmd, ...);
+
+static Bool IOEnabled = FALSE;
+
+void xf86EnableIO(void)
+{
+ if (IOEnabled)
+ return;
+
+ if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
+ FatalError("Failed to set IOPL for extended I/O\n");
+ IOEnabled = TRUE;
+}
+
+void xf86DisableIO(void)
+{
+ if (!IOEnabled)
+ return;
+
+ sysi86(SI86V86, V86SC_IOPL, 0);
+ IOEnabled = FALSE;
+}
+
+/***************************************************************************/
+/* Interrupt Handling section */
+/***************************************************************************/
+
+Bool xf86DisableInterrupts()
+{
+ if (!IOEnabled) {
+ if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
+ return FALSE;
+ }
+
+#ifdef __GNUC__
+ __asm__ __volatile__("cli");
+#else
+ asm("cli");
+#endif /* __GNUC__ */
+
+ if (!IOEnabled) {
+ sysi86(SI86V86, V86SC_IOPL, PS_IOPL);
+ }
+
+ return(TRUE);
+}
+
+void xf86EnableInterrupts()
+{
+ if (!IOEnabled) {
+ if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
+ return;
+ }
+
+#ifdef __GNUC__
+ __asm__ __volatile__("sti");
+#else
+ asm("sti");
+#endif /* __GNUC__ */
+
+ if (!IOEnabled) {
+ sysi86(SI86V86, V86SC_IOPL, PS_IOPL);
+ }
+}
diff --git a/hw/xfree86/os-support/shared/agp_noop.c b/hw/xfree86/os-support/shared/agp_noop.c
new file mode 100644
index 000000000..c1100e67b
--- /dev/null
+++ b/hw/xfree86/os-support/shared/agp_noop.c
@@ -0,0 +1,69 @@
+/*
+ * Abstraction of the AGP GART interface. Stubs for platforms without
+ * AGP GART support.
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.3 2001/05/19 00:26:46 dawes Exp $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+Bool
+xf86GARTCloseScreen(int screenNum)
+{
+ return FALSE;
+}
+
+Bool
+xf86AgpGARTSupported()
+{
+ return FALSE;
+}
+
+AgpInfoPtr
+xf86GetAGPInfo(int screenNum)
+{
+ return NULL;
+}
+
+Bool
+xf86AcquireGART(int screenNum)
+{
+ return FALSE;
+}
+
+Bool
+xf86ReleaseGART(int screenNum)
+{
+ return FALSE;
+}
+
+int
+xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
+ unsigned long *physical)
+{
+ return -1;
+}
+
+
+Bool
+xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
+{
+ return FALSE;
+}
+
+
+Bool
+xf86UnbindGARTMemory(int screenNum, int key)
+{
+ return FALSE;
+}
+
+Bool
+xf86EnableAGP(int screenNum, CARD32 mode)
+{
+ return FALSE;
+}
diff --git a/hw/xfree86/os-support/shared/at_scancode.c b/hw/xfree86/os-support/shared/at_scancode.c
new file mode 100644
index 000000000..a1529579f
--- /dev/null
+++ b/hw/xfree86/os-support/shared/at_scancode.c
@@ -0,0 +1,74 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/at_scancode.c,v 1.1 2002/10/11 01:40:37 dawes Exp $ */
+
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ */
+
+#include "xf86.h"
+#include "xf86Xinput.h"
+#include "xf86OSKbd.h"
+#include "atKeynames.h"
+
+Bool
+ATScancode(InputInfoPtr pInfo, int *scanCode)
+{
+ KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
+
+ switch (pKbd->scanPrefix) {
+ case 0:
+ switch (*scanCode) {
+ case KEY_Prefix0:
+ case KEY_Prefix1:
+ pKbd->scanPrefix = *scanCode; /* special prefixes */
+ return TRUE;
+ }
+ break;
+ case KEY_Prefix0:
+ pKbd->scanPrefix = 0;
+ switch (*scanCode) {
+ case KEY_KP_7: *scanCode = KEY_Home; break; /* curs home */
+ case KEY_KP_8: *scanCode = KEY_Up; break; /* curs up */
+ case KEY_KP_9: *scanCode = KEY_PgUp; break; /* curs pgup */
+ case KEY_KP_4: *scanCode = KEY_Left; break; /* curs left */
+ case KEY_KP_5: *scanCode = KEY_Begin; break; /* curs begin */
+ case KEY_KP_6: *scanCode = KEY_Right; break; /* curs right */
+ case KEY_KP_1: *scanCode = KEY_End; break; /* curs end */
+ case KEY_KP_2: *scanCode = KEY_Down; break; /* curs down */
+ case KEY_KP_3: *scanCode = KEY_PgDown; break; /* curs pgdown */
+ case KEY_KP_0: *scanCode = KEY_Insert; break; /* curs insert */
+ case KEY_KP_Decimal: *scanCode = KEY_Delete; break; /* curs delete */
+ case KEY_Enter: *scanCode = KEY_KP_Enter; break; /* keypad enter */
+ case KEY_LCtrl: *scanCode = KEY_RCtrl; break; /* right ctrl */
+ case KEY_KP_Multiply: *scanCode = KEY_Print; break; /* print */
+ case KEY_Slash: *scanCode = KEY_KP_Divide; break; /* keyp divide */
+ case KEY_Alt: *scanCode = KEY_AltLang; break; /* right alt */
+ case KEY_ScrollLock: *scanCode = KEY_Break; break; /* curs break */
+ case 0x5b: *scanCode = KEY_LMeta; break;
+ case 0x5c: *scanCode = KEY_RMeta; break;
+ case 0x5d: *scanCode = KEY_Menu; break;
+ case KEY_F3: *scanCode = KEY_F13; break;
+ case KEY_F4: *scanCode = KEY_F14; break;
+ case KEY_F5: *scanCode = KEY_F15; break;
+ case KEY_F6: *scanCode = KEY_F16; break;
+ case KEY_F7: *scanCode = KEY_F17; break;
+ case KEY_KP_Plus: *scanCode = KEY_KP_DEC; break;
+ case 0x2A:
+ case 0x36:
+ return TRUE;
+ default:
+ xf86MsgVerb(X_INFO, 4, "Unreported Prefix0 scancode: 0x%02x\n",
+ *scanCode);
+ *scanCode += 0x78;
+ }
+ break;
+ case KEY_Prefix1:
+ pKbd->scanPrefix = (*scanCode == KEY_LCtrl) ? KEY_LCtrl : 0;
+ return TRUE;
+ case KEY_LCtrl:
+ pKbd->scanPrefix = 0;
+ if (*scanCode != KEY_NumLock)
+ return TRUE;
+ *scanCode = KEY_Pause; /* pause */
+ }
+ return FALSE;
+}
diff --git a/hw/xfree86/os-support/shared/bios_mmap.c b/hw/xfree86/os-support/shared/bios_mmap.c
new file mode 100644
index 000000000..ee7584222
--- /dev/null
+++ b/hw/xfree86/os-support/shared/bios_mmap.c
@@ -0,0 +1,160 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c,v 1.9 2001/05/23 14:46:05 alanh Exp $ */
+/*
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * 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 David Wexelblat not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. David Wexelblat makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL DAVID WEXELBLAT 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.
+ *
+ */
+/* $XConsortium: bios_V4mmap.c /main/4 1996/02/21 17:54:27 kaleb $ */
+
+#include "X.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+/*
+ * Read BIOS via mmap()ing DEV_MEM
+ */
+
+#ifndef __alpha__
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ int fd;
+ unsigned char *ptr;
+ int psize;
+ int mlen;
+
+ if ((fd = open(DEV_MEM, O_RDONLY)) < 0)
+ {
+ xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ return(-1);
+ }
+ psize = xf86getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, fd, (off_t)Base);
+ if (ptr == MAP_FAILED)
+ {
+ xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed (%s)\n",
+ DEV_MEM, strerror(errno));
+ close(fd);
+ return(-1);
+ }
+#ifdef DEBUG
+ ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n",
+ Base, ptr[0] | (ptr[1] << 8));
+#endif
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+ (void)close(fd);
+ return(Len);
+}
+
+#else /* __alpha__ */
+
+ /*
+ * We trick "mmap" into mapping BUS memory for us via BUS_BASE,
+ * which is the KSEG address of the start of the DENSE memory
+ * area.
+ */
+
+ /*
+ * NOTE: there prolly ought to be more validity checks and all
+ * re: boundaries and sizes and such...
+ */
+
+/*
+ * The Jensen lacks dense memory, thus we have to address the bus via
+ * the sparse addressing scheme.
+ *
+ * Martin Ostermann (ost@comnets.rwth-aachen.de) - Apr.-Sep. 1996
+ */
+
+#ifdef linux
+
+#ifdef TEST_JENSEN_CODE /* define to test the Sparse addressing on a non-Jensen */
+#define SPARSE (5)
+#define isJensen (1)
+#else
+#define isJensen (!_bus_base())
+#define SPARSE (7)
+#endif
+
+extern unsigned long _bus_base(void);
+extern unsigned long _bus_base_sparse(void);
+#define BUS_BASE (isJensen ? _bus_base_sparse() : _bus_base())
+#define JENSEN_SHIFT(x) (isJensen ? ((long)x<<SPARSE) : (long)x)
+
+#else
+
+extern u_int64_t dense_base(void);
+#define BUS_BASE dense_base()
+#define JENSEN_SHIFT(x) ((long) x)
+
+#endif
+
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ caddr_t base;
+ int fd;
+ int psize;
+ int mlen;
+
+ if ((fd = open(DEV_MEM, O_RDONLY)) < 0)
+ {
+ xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ return(-1);
+ }
+
+ psize = xf86getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+ base = mmap((caddr_t)0, JENSEN_SHIFT(mlen), PROT_READ,
+ MAP_SHARED, fd, (off_t)(JENSEN_SHIFT(Base) + BUS_BASE));
+
+ if (base == MAP_FAILED)
+ {
+ xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to mmap %s (%s)\n",
+ DEV_MEM, strerror(errno));
+ return(-1);
+ }
+
+ xf86SlowBCopyFromBus((unsigned char *)(base+JENSEN_SHIFT(Offset)),
+ Buf, Len);
+
+ munmap((caddr_t)JENSEN_SHIFT(base), JENSEN_SHIFT(mlen));
+ close(fd);
+ return(Len);
+}
+
+#endif /* __alpha__ */
diff --git a/hw/xfree86/os-support/shared/inout.S b/hw/xfree86/os-support/shared/inout.S
new file mode 100644
index 000000000..80c47c419
--- /dev/null
+++ b/hw/xfree86/os-support/shared/inout.S
@@ -0,0 +1,111 @@
+/* $XConsortium: inout.s /main/6 1996/02/21 17:53:35 kaleb $ */
+
+
+
+
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/inout.S,v 1.1 1999/07/10 07:24:52 dawes Exp $ */
+
+#include "assyntax.h"
+
+/*
+ * Make i80386 io primitives available at C-level.
+ */
+
+ FILE("inout.s")
+ AS_BEGIN
+ SEG_TEXT
+
+/*
+ *-----------------------------------------------------------------------
+ * inb ---
+ * Input one byte.
+ *
+ * Results:
+ * Byte in al.
+ *-----------------------------------------------------------------------
+ */
+ GLOBL GLNAME(inb)
+GLNAME(inb):
+ MOV_L (REGOFF(4,ESP),EDX)
+ SUB_L (EAX,EAX)
+ IN_B
+ RET
+
+/*
+ *-----------------------------------------------------------------------
+ * outb ---
+ * Output one byte.
+ *
+ * Results:
+ * None.
+ *-----------------------------------------------------------------------
+ */
+ GLOBL GLNAME(outb)
+GLNAME(outb):
+ MOV_L (REGOFF(4,sp),EDX)
+ MOV_L (REGOFF(8,sp),EAX)
+ OUT_B
+ RET
+/*
+ *-----------------------------------------------------------------------
+ * inw ---
+ * Input one 16-bit word.
+ *
+ * Results:
+ * Word in ax.
+ *-----------------------------------------------------------------------
+ */
+ GLOBL GLNAME(inw)
+GLNAME(inw):
+ MOV_L (REGOFF(4,ESP),EDX)
+ IN_W
+ RET
+
+/*
+ *-----------------------------------------------------------------------
+ * outw ---
+ * Output one 16-bit word.
+ *
+ * Results:
+ * None.
+ *-----------------------------------------------------------------------
+ */
+ GLOBL GLNAME(outw)
+GLNAME(outw):
+ MOV_L (REGOFF(4,ESP),EDX)
+ MOV_L (REGOFF(8,ESP),EAX)
+ OUT_W
+ RET
+
+/*
+ *-----------------------------------------------------------------------
+ * inl ---
+ * Input one 32-bit longword.
+ *
+ * Results:
+ * Word in eax.
+ *-----------------------------------------------------------------------
+ */
+ GLOBL GLNAME(inl)
+GLNAME(inl):
+ MOV_L (REGOFF(4,ESP),EDX)
+ IN_L
+ RET
+
+/*
+ *-----------------------------------------------------------------------
+ * outl ---
+ * Output one 32-bit longword.
+ *
+ * Results:
+ * None.
+ *-----------------------------------------------------------------------
+ */
+ GLOBL GLNAME(outl)
+GLNAME(outl):
+ MOV_L (REGOFF(4,ESP),EDX)
+ MOV_L (REGOFF(8,ESP),EAX)
+ OUT_L
+ RET
+
diff --git a/hw/xfree86/os-support/shared/kbd.c b/hw/xfree86/os-support/shared/kbd.c
new file mode 100644
index 000000000..0ebf729ac
--- /dev/null
+++ b/hw/xfree86/os-support/shared/kbd.c
@@ -0,0 +1,13 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/kbd.c,v 1.2 2003/02/17 15:11:59 dawes Exp $ */
+
+/*
+ * Copyright (c) 2001 by The XFree86 Project, Inc.
+ */
+
+#include "xf86OSKbd.h"
+
+Bool
+xf86OSKbdPreInit(InputInfoPtr pInfo)
+{
+ return FALSE;
+}
diff --git a/hw/xfree86/os-support/shared/kmod_noop.c b/hw/xfree86/os-support/shared/kmod_noop.c
new file mode 100644
index 000000000..80f487593
--- /dev/null
+++ b/hw/xfree86/os-support/shared/kmod_noop.c
@@ -0,0 +1,8 @@
+
+#include "xf86_OSproc.h"
+
+int xf86LoadKernelModule(const char *pathname)
+{
+ (void) pathname;
+ return 0; /* failure */
+}
diff --git a/hw/xfree86/os-support/shared/libc_wrapper.c b/hw/xfree86/os-support/shared/libc_wrapper.c
new file mode 100644
index 000000000..e72997cc3
--- /dev/null
+++ b/hw/xfree86/os-support/shared/libc_wrapper.c
@@ -0,0 +1,2015 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.88.2.2 2003/03/13 21:49:53 tsi Exp $ */
+/*
+ * Copyright 1997 by The XFree86 Project, 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, and that the names of Orest Zborowski and David Wexelblat
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Orest Zborowski
+ * and David Wexelblat make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE XFREE86 PROJECT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID WEXELBLAT 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.
+ *
+ */
+
+#if defined(linux) && !defined(__GLIBC__)
+#undef __STRICT_ANSI__
+#endif
+#include <X.h>
+#include <Xmd.h>
+#include <Xos.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined(__bsdi__)
+#undef _POSIX_SOURCE
+#undef _ANSI_SOURCE
+#endif
+#include <sys/time.h>
+#include <math.h>
+#ifdef sun
+#include <ieeefp.h>
+#endif
+#include <stdarg.h>
+#include <fcntl.h>
+#include "Xfuncproto.h"
+#include "os.h"
+#include <ctype.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#ifdef __UNIXOS2__
+#define NO_MMAP
+#include <sys/param.h>
+#endif
+#ifdef HAS_SVR3_MMAPDRV
+#define NO_MMAP
+#ifdef SELF_CONTAINED_WRAPPER
+#include <sys/at_ansi.h>
+#include <sys/kd.h>
+#include <sys/sysmacros.h>
+#if !defined(_NEED_SYSI86)
+# include <sys/immu.h>
+# include <sys/region.h>
+#endif
+#include <sys/mmap.h>
+struct kd_memloc MapDSC;
+int mmapFd = -2;
+#else
+extern struct kd_memloc MapDSC;
+extern int mmapFd;
+#endif
+#endif
+#ifndef NO_MMAP
+#include <sys/mman.h>
+#ifndef MAP_FAILED
+#define MAP_FAILED ((caddr_t)-1)
+#endif
+#endif
+#if !defined(ISC)
+#include <stdlib.h>
+#endif
+
+#define NEED_XF86_TYPES
+#define NEED_XF86_PROTOTYPES
+#define DONT_DEFINE_WRAPPERS
+#include "xf86_ansic.h"
+
+#ifndef SELF_CONTAINED_WRAPPER
+#include "xf86.h"
+#include "xf86Priv.h"
+#define NO_OSLIB_PROTOTYPES
+#define XF86_OS_PRIVS
+#define HAVE_WRAPPER_DECLS
+#include "xf86_OSlib.h"
+#else
+void xf86WrapperInit(void);
+#endif
+
+
+#ifndef X_NOT_POSIX
+#include <dirent.h>
+#else
+#ifdef SYSV
+#include <dirent.h>
+#else
+#ifdef USG
+#include <dirent.h>
+#else
+#include <sys/dir.h>
+#ifndef dirent
+#define dirent direct
+#endif
+#endif
+#endif
+#endif
+typedef struct dirent DIRENTRY;
+
+#ifdef __UNIXOS2__
+#define _POSIX_SOURCE
+#endif
+#ifdef ISC202
+#include <sys/types.h>
+#define WIFEXITED(a) ((a & 0x00ff) == 0) /* LSB will be 0 */
+#define WEXITSTATUS(a) ((a & 0xff00) >> 8)
+#define WIFSIGNALED(a) ((a & 0xff00) == 0) /* MSB will be 0 */
+#define WTERMSIG(a) (a & 0x00ff)
+#else
+#if defined(ISC) && !defined(_POSIX_SOURCE)
+#define _POSIX_SOURCE
+#include <sys/types.h>
+#include <sys/wait.h>
+#undef _POSIX_SOURCE
+#else
+#if (defined(ISC) && defined(_POSIX_SOURCE)) || defined(Lynx) || (defined (__alpha__) && defined(linux))
+#include <sys/types.h>
+#endif
+#include <sys/wait.h>
+#endif
+#endif
+#ifdef Lynx
+#if !defined(S_IFIFO) && defined(S_IFFIFO)
+#define S_IFIFO S_IFFIFO
+#endif
+#endif
+
+/* For xf86getpagesize() */
+#if defined(linux)
+#define HAS_SC_PAGESIZE
+#define HAS_GETPAGESIZE
+#elif defined(CSRG_BASED)
+#define HAS_GETPAGESIZE
+#elif defined(DGUX)
+#define HAS_GETPAGESIZE
+#elif defined(sun) && !defined(SVR4)
+#define HAS_GETPAGESIZE
+#endif
+#ifdef XNO_SYSCONF
+#undef _SC_PAGESIZE
+#endif
+#ifdef HAVE_SYSV_IPC
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#endif
+#include <setjmp.h>
+
+#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
+ (!defined(__GLIBC__) || (__GLIBC__ < 2) || \
+ ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3)))
+#define HAS_GLIBC_SIGSETJMP 1
+#endif
+
+#if 0
+#define SETBUF_RETURNS_INT
+#endif
+
+double xf86HUGE_VAL;
+
+#ifndef SELF_CONTAINED_WRAPPERS
+extern void xf86DisableIO(void);
+#endif
+
+/*
+ * This file contains the XFree86 wrappers for libc functions that can be
+ * called by loadable modules
+ */
+
+double
+xf86hypot(double x, double y)
+{
+ return(hypot(x,y));
+}
+
+void
+xf86qsort(void *base, xf86size_t nmemb, xf86size_t size,
+ int (*comp)(const void *, const void *))
+{
+ qsort(base, nmemb, size, comp);
+}
+
+/* string functions */
+
+char*
+xf86strcat(char* dest, const char* src)
+{
+ return(strcat(dest,src));
+}
+
+char*
+xf86strchr(const char* s, int c)
+{
+ return strchr(s,c);
+}
+
+int
+xf86strcmp(const char* s1, const char* s2)
+{
+ return strcmp(s1,s2);
+}
+
+/* Just like the BSD version. It assumes that tolower() is ANSI-compliant */
+int
+xf86strcasecmp(const char* s1, const char* s2)
+{
+ const unsigned char *us1 = (const unsigned char *)s1;
+ const unsigned char *us2 = (const unsigned char *)s2;
+
+ while (tolower(*us1) == tolower(*us2++))
+ if (*us1++ == '\0')
+ return 0;
+
+ return tolower(*us1) - tolower(*--us2);
+}
+
+char*
+xf86strcpy(char* dest, const char* src)
+{
+ return strcpy(dest,src);
+}
+
+xf86size_t
+xf86strcspn(const char* s1, const char* s2)
+{
+ return (xf86size_t)strcspn(s1,s2);
+}
+
+xf86size_t
+xf86strlen(const char* s)
+{
+ return (xf86size_t)strlen(s);
+}
+
+char*
+xf86strncat(char* dest, const char* src, xf86size_t n)
+{
+ return strncat(dest,src,(size_t)n);
+}
+
+int
+xf86strncmp(const char* s1, const char* s2, xf86size_t n)
+{
+ return strncmp(s1,s2,(size_t)n);
+}
+
+/* Just like the BSD version. It assumes that tolower() is ANSI-compliant */
+int
+xf86strncasecmp(const char* s1, const char* s2, xf86size_t n)
+{
+ if (n != 0) {
+ const unsigned char *us1 = (const unsigned char *)s1;
+ const unsigned char *us2 = (const unsigned char *)s2;
+
+ do {
+ if (tolower(*us1) != tolower(*us2++))
+ return tolower(*us1) - tolower(*--us2);
+ if (*us1++ == '\0')
+ break;
+ } while (--n != 0);
+ }
+ return 0;
+}
+
+char*
+xf86strncpy(char* dest, const char* src, xf86size_t n)
+{
+ return strncpy(dest,src,(size_t)n);
+}
+
+char*
+xf86strpbrk(const char* s1, const char* s2)
+{
+ return strpbrk(s1,s2);
+}
+
+char*
+xf86strrchr(const char* s, int c)
+{
+ return strrchr(s,c);
+}
+
+xf86size_t
+xf86strspn(const char* s1, const char* s2)
+{
+ return strspn(s1,s2);
+}
+
+char*
+xf86strstr(const char* s1, const char* s2)
+{
+ return strstr(s1,s2);
+}
+
+char*
+xf86strtok(char* s1, const char* s2)
+{
+ return strtok(s1,s2);
+}
+
+char*
+xf86strdup(const char* s)
+{
+ return xstrdup(s);
+}
+
+int
+xf86sprintf(char *s, const char *format, ...)
+{
+ int ret;
+ va_list args;
+ va_start(args, format);
+ ret = vsprintf(s, format, args);
+ va_end(args);
+ return ret;
+}
+
+int
+xf86snprintf(char *s, xf86size_t len, const char *format, ...)
+{
+ int ret;
+ va_list args;
+ va_start(args, format);
+ ret = vsnprintf(s, (size_t)len, format, args);
+ va_end(args);
+ return ret;
+}
+
+void
+xf86bzero(void* s, unsigned int n)
+{
+ memset(s, 0, n);
+}
+
+#ifdef HAVE_VSSCANF
+int
+xf86sscanf(char *s, const char *format, ...)
+#else
+int
+xf86sscanf(char *s, const char *format, char *a0, char *a1, char *a2,
+ char *a3, char *a4, char *a5, char *a6, char *a7, char *a8,
+ char *a9) /* limit of ten args */
+#endif
+{
+#ifdef HAVE_VSSCANF
+ int ret;
+ va_list args;
+ va_start(args, format);
+
+ ret = vsscanf(s,format,args);
+ va_end(args);
+ return ret;
+#else
+ return sscanf(s, format, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
+#endif
+}
+
+/* Basic I/O */
+
+int xf86errno;
+
+/* XXX This is not complete */
+
+static int
+xfToOsOpenFlags(int xfflags)
+{
+ int flags = 0;
+
+ /* XXX This assumes O_RDONLY is 0 */
+ if (xfflags & XF86_O_WRONLY)
+ flags |= O_WRONLY;
+ if (xfflags & XF86_O_RDWR)
+ flags |= O_RDWR;
+ if (xfflags & XF86_O_CREAT)
+ flags |= O_CREAT;
+
+ return flags;
+}
+
+int
+xf86open(const char *path, int flags, ...)
+{
+ int fd;
+ va_list ap;
+
+ va_start(ap, flags);
+ flags = xfToOsOpenFlags(flags);
+ if (flags & O_CREAT) {
+ /* can't request a mode_t directly on systems where mode_t
+ is an unsigned short */
+ mode_t mode = (mode_t)va_arg(ap, unsigned int);
+ fd = open(path, flags, mode);
+ } else {
+ fd = open(path, flags);
+ }
+ va_end(ap);
+ xf86errno = xf86GetErrno();
+ return fd;
+}
+
+int
+xf86close(int fd)
+{
+ int status = close(fd);
+
+ xf86errno = xf86GetErrno();
+ return status;
+}
+
+long
+xf86lseek(int fd, long offset, int whence)
+{
+ switch (whence) {
+ case XF86_SEEK_SET:
+ whence = SEEK_SET;
+ break;
+ case XF86_SEEK_CUR:
+ whence = SEEK_CUR;
+ break;
+ case XF86_SEEK_END:
+ whence = SEEK_END;
+ break;
+ }
+ return (long)lseek(fd, (off_t)offset, whence);
+}
+
+int
+xf86ioctl(int fd, unsigned long request, pointer argp)
+{
+ int status = ioctl(fd, request, argp);
+
+ xf86errno = xf86GetErrno();
+ return status;
+}
+
+xf86ssize_t
+xf86read(int fd, void *buf, xf86size_t nbytes)
+{
+ xf86ssize_t n = read(fd, buf, (size_t)nbytes);
+
+ xf86errno = xf86GetErrno();
+ return n;
+}
+
+xf86ssize_t
+xf86write(int fd, const void *buf, xf86size_t nbytes)
+{
+ xf86ssize_t n = write(fd, buf, (size_t)nbytes);
+
+ xf86errno = xf86GetErrno();
+ return n;
+}
+
+void*
+xf86mmap(void *start, xf86size_t length, int prot,
+ int flags, int fd, xf86size_t /* off_t */ offset)
+{
+#ifndef NO_MMAP
+ int p=0, f=0;
+ void *rc;
+
+ if (flags & XF86_MAP_FIXED) f |= MAP_FIXED;
+ if (flags & XF86_MAP_SHARED) f |= MAP_SHARED;
+ if (flags & XF86_MAP_PRIVATE) f |= MAP_PRIVATE;
+#ifdef __x86_64__
+ if (flags & XF86_MAP_32BIT) f |= MAP_32BIT;
+#endif
+ if (prot & XF86_PROT_EXEC) p |= PROT_EXEC;
+ if (prot & XF86_PROT_READ) p |= PROT_READ;
+ if (prot & XF86_PROT_WRITE) p |= PROT_WRITE;
+ if (prot & XF86_PROT_NONE) p |= PROT_NONE;
+
+ rc = mmap(start,(size_t)length,p,f,fd,(off_t)offset);
+
+ xf86errno = xf86GetErrno();
+ if (rc == MAP_FAILED)
+ return XF86_MAP_FAILED;
+ else
+ return rc;
+#else
+#ifdef HAS_SVR3_MMAPDRV
+ void *rc;
+#ifdef SELF_CONTAINED_WRAPPER
+ if(mmapFd < 0) {
+ if ((mmapFd = open("/dev/mmap", O_RDWR)) == -1) {
+ ErrorF("Warning: failed to open /dev/mmap \n");
+ xf86errno = xf86_ENOSYS;
+ return XF86_MAP_FAILED;
+ }
+ }
+#endif
+ MapDSC.vaddr = (char *)start;
+ MapDSC.physaddr = (char *)offset;
+ MapDSC.length = length;
+ MapDSC.ioflg = 1;
+
+ rc = (pointer)ioctl(mmapFd, MAP, &MapDSC);
+ xf86errno = xf86GetErrno();
+ if (rc == NULL)
+ return XF86_MAP_FAILED;
+ else
+ return rc;
+#else
+ ErrorF("Warning: mmap() is not supported on this platform\n");
+ xf86errno = xf86_ENOSYS;
+ return XF86_MAP_FAILED;
+#endif
+#endif
+}
+
+int
+xf86munmap(void *start, xf86size_t length)
+{
+#ifndef NO_MMAP
+ int rc = munmap(start,(size_t)length);
+
+ xf86errno = xf86GetErrno();
+ return rc;
+#else
+#ifdef HAS_SVR3_MMAPDRV
+ int rc = ioctl(mmapFd, UNMAPRM , start);
+
+ xf86errno = xf86GetErrno();
+ return rc;
+#else
+ ErrorF("Warning: munmap() is not supported on this platform\n");
+ xf86errno = xf86_ENOSYS;
+ return -1;
+#endif
+#endif
+}
+
+int
+xf86stat(const char *file_name, struct xf86stat *xfst)
+{
+ int rc;
+ struct stat st;
+
+ rc = stat(file_name, &st);
+ xf86errno = xf86GetErrno();
+ xfst->st_rdev = st.st_rdev; /* Not much is currently supported */
+ return rc;
+}
+
+int
+xf86fstat(int fd, struct xf86stat *xfst)
+{
+ int rc;
+ struct stat st;
+
+ rc = fstat(fd, &st);
+ xf86errno = xf86GetErrno();
+ xfst->st_rdev = st.st_rdev; /* Not much is currently supported */
+ return rc;
+}
+
+static int
+xfToOsAccessMode(int xfmode)
+{
+ switch(xfmode) {
+ case XF86_R_OK: return R_OK;
+ case XF86_W_OK: return W_OK;
+ case XF86_X_OK: return X_OK;
+ case XF86_F_OK: return F_OK;
+ }
+ return 0;
+}
+
+int
+xf86access(const char *pathname, int mode)
+{
+ int rc;
+
+ mode = xfToOsAccessMode(mode);
+ rc = access(pathname, mode);
+ xf86errno = xf86GetErrno();
+ return rc;
+}
+
+
+
+/* limited stdio support */
+
+#define XF86FILE_magic 0x58464856 /* "XFHV" */
+
+typedef struct _xf86_file_ {
+ INT32 fileno;
+ INT32 magic;
+ FILE* filehnd;
+ char* fname;
+} XF86FILE_priv;
+
+XF86FILE_priv stdhnd[3] = {
+ { 0, XF86FILE_magic, NULL, "$stdinp$" },
+ { 0, XF86FILE_magic, NULL, "$stdout$" },
+ { 0, XF86FILE_magic, NULL, "$stderr$" }
+};
+
+XF86FILE* xf86stdin = (XF86FILE*)&stdhnd[0];
+XF86FILE* xf86stdout = (XF86FILE*)&stdhnd[1];
+XF86FILE* xf86stderr = (XF86FILE*)&stdhnd[2];
+
+void
+xf86WrapperInit()
+{
+ if (stdhnd[0].filehnd == NULL)
+ stdhnd[0].filehnd = stdin;
+ if (stdhnd[1].filehnd == NULL)
+ stdhnd[1].filehnd = stdout;
+ if (stdhnd[2].filehnd == NULL)
+ stdhnd[2].filehnd = stderr;
+ xf86HUGE_VAL = HUGE_VAL;
+}
+
+XF86FILE*
+xf86fopen(const char* fn, const char* mode)
+{
+ XF86FILE_priv* fp;
+ FILE *f = fopen(fn,mode);
+ xf86errno = xf86GetErrno();
+ if (!f) return 0;
+
+ fp = xalloc(sizeof(XF86FILE_priv));
+ fp->magic = XF86FILE_magic;
+ fp->filehnd = f;
+ fp->fileno = fileno(f);
+ fp->fname = xf86strdup(fn);
+#ifdef DEBUG
+ ErrorF("xf86fopen(%s,%s) yields FILE %p XF86FILE %p\n",
+ fn,mode,f,fp);
+#endif
+ return (XF86FILE*)fp;
+}
+
+static void _xf86checkhndl(XF86FILE_priv* f,const char *func)
+{
+ if (!f || f->magic != XF86FILE_magic ||
+ !f->filehnd || !f->fname) {
+ FatalError("libc_wrapper error: passed invalid FILE handle to %s\n",
+ func);
+ exit(42);
+ }
+}
+
+int
+xf86fclose(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+ int ret;
+
+ _xf86checkhndl(fp,"xf86fclose");
+
+ /* somewhat bad check */
+ if (fp->fileno < 3 && fp->fname[0]=='$') {
+ /* assume this is stdin/out/err, don't dispose */
+ ret = fclose(fp->filehnd);
+ } else {
+ ret = fclose(fp->filehnd);
+ fp->magic = 0; /* invalidate */
+ xfree(fp->fname);
+ xfree(fp);
+ }
+ return ret ? -1 : 0;
+}
+
+int
+xf86printf(const char *format, ...)
+{
+ int ret;
+ va_list args;
+ va_start(args, format);
+
+ ret = printf(format,args);
+ va_end(args);
+ return ret;
+}
+
+int
+xf86fprintf(XF86FILE* f, const char *format, ...)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ int ret;
+ va_list args;
+ va_start(args, format);
+
+#ifdef DEBUG
+ ErrorF("xf86fprintf for XF86FILE %p\n", fp);
+#endif
+ _xf86checkhndl(fp,"xf86fprintf");
+
+ ret = vfprintf(fp->filehnd,format,args);
+ va_end(args);
+ return ret;
+}
+
+int
+xf86vfprintf(XF86FILE* f, const char *format, va_list ap)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+#ifdef DEBUG
+ ErrorF("xf86vfprintf for XF86FILE %p\n", fp);
+#endif
+ _xf86checkhndl(fp,"xf86vfprintf");
+
+ return vfprintf(fp->filehnd,format,ap);
+}
+
+int
+xf86vsprintf(char *s, const char *format, va_list ap)
+{
+ return vsprintf(s, format, ap);
+}
+
+int
+xf86vsnprintf(char *s, xf86size_t len, const char *format, va_list ap)
+{
+ return vsnprintf(s, (size_t)len, format, ap);
+}
+
+#ifdef HAVE_VFSCANF
+int
+xf86fscanf(XF86FILE* f, const char *format, ...)
+#else
+int
+xf86fscanf(XF86FILE* f, const char *format, char *a0, char *a1, char *a2,
+ char *a3, char *a4, char *a5, char *a6, char *a7, char *a8,
+ char *a9) /* limit of ten args */
+#endif
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+#ifdef HAVE_VFSCANF
+ int ret;
+ va_list args;
+ va_start(args, format);
+
+ _xf86checkhndl(fp,"xf86fscanf");
+
+ ret = vfscanf(fp->filehnd,format,args);
+ va_end(args);
+ return ret;
+#else
+ _xf86checkhndl(fp,"xf86fscanf");
+ return fscanf(fp->filehnd, format, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
+#endif
+}
+
+char *
+xf86fgets(char *buf, INT32 n, XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fgets");
+ return fgets(buf,(int)n,fp->filehnd);
+}
+
+int
+xf86fputs(const char *buf, XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fputs");
+ return fputs(buf,fp->filehnd);
+}
+
+int
+xf86getc(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86getc");
+ return getc(fp->filehnd);
+}
+
+int
+xf86fgetc(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fgetc");
+ return fgetc(fp->filehnd);
+}
+
+int
+xf86fputc(int c,XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fputc");
+ return fputc(c,fp->filehnd);
+}
+
+int
+xf86fflush(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fflush");
+ return fflush(fp->filehnd);
+}
+
+xf86size_t
+xf86fread(void* buf, xf86size_t sz, xf86size_t cnt, XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+#ifdef DEBUG
+ ErrorF("xf86fread for XF86FILE %p\n", fp);
+#endif
+ _xf86checkhndl(fp,"xf86fread");
+ return fread(buf,(size_t)sz,(size_t)cnt,fp->filehnd);
+}
+
+xf86size_t
+xf86fwrite(const void* buf, xf86size_t sz, xf86size_t cnt, XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fwrite");
+ return fwrite(buf,(size_t)sz,(size_t)cnt,fp->filehnd);
+}
+
+int
+xf86fseek(XF86FILE* f, long offset, int whence)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fseek");
+ switch (whence) {
+ case XF86_SEEK_SET:
+ whence = SEEK_SET;
+ break;
+ case XF86_SEEK_CUR:
+ whence = SEEK_CUR;
+ break;
+ case XF86_SEEK_END:
+ whence = SEEK_END;
+ break;
+ }
+ return fseek(fp->filehnd,offset,whence);
+}
+
+long
+xf86ftell(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86ftell");
+ return ftell(fp->filehnd);
+}
+
+#define mapnum(e) case (xf86_##e): err = e; break;
+
+char*
+xf86strerror(int n)
+{
+ int err;
+
+ switch (n)
+ {
+ case 0: err = 0; break;
+ mapnum (EACCES);
+ mapnum (EAGAIN);
+ mapnum (EBADF);
+ mapnum (EEXIST);
+ mapnum (EFAULT);
+ mapnum (EINTR);
+ mapnum (EINVAL);
+ mapnum (EISDIR);
+ mapnum (ELOOP); /* not POSIX 1 */
+ mapnum (EMFILE);
+ mapnum (ENAMETOOLONG);
+ mapnum (ENFILE);
+ mapnum (ENOENT);
+ mapnum (ENOMEM);
+ mapnum (ENOSPC);
+ mapnum (ENOTDIR);
+ mapnum (EPIPE);
+ mapnum (EROFS);
+#ifndef __UNIXOS2__
+ mapnum (ETXTBSY); /* not POSIX 1 */
+#endif
+ mapnum (ENOTTY);
+ mapnum (EBUSY);
+ mapnum (ENODEV);
+ mapnum (EIO);
+
+ default:
+ err = 999;
+ }
+ return strerror(err);
+}
+
+#undef mapnum
+
+
+/* required for portable fgetpos/fsetpos,
+ * use as
+ * XF86fpos_t* pos = xalloc(xf86fpossize());
+ */
+long
+xf86fpossize()
+{
+ return sizeof(fpos_t);
+}
+
+int
+xf86fgetpos(XF86FILE* f,XF86fpos_t* pos)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+ fpos_t *ppos = (fpos_t*)pos;
+
+ _xf86checkhndl(fp,"xf86fgetpos");
+#ifndef ISC
+ return fgetpos(fp->filehnd,ppos);
+#else
+ *ppos = ftell(fp->filehnd);
+ if (*ppos < 0L)
+ return(-1);
+ return(0);
+#endif
+}
+
+int
+xf86fsetpos(XF86FILE* f,const XF86fpos_t* pos)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+ fpos_t *ppos = (fpos_t*)pos;
+
+ /* XXX need to handle xf86errno here */
+ _xf86checkhndl(fp,"xf86fsetpos");
+#ifndef ISC
+ return fsetpos(fp->filehnd,ppos);
+#else
+ if (ppos == NULL)
+ {
+ errno = EINVAL;
+ return EOF;
+ }
+ return fseek(fp->filehnd, *ppos, SEEK_SET);
+#endif
+}
+
+void
+xf86perror(const char *s)
+{
+ perror(s);
+}
+
+int
+xf86remove(const char *s)
+{
+#ifdef _POSIX_SOURCE
+ return remove(s);
+#else
+ return unlink(s);
+#endif
+}
+
+int
+xf86rename(const char *old, const char *new)
+{
+#ifdef _POSIX_SOURCE
+ return rename(old,new);
+#else
+ int ret = link(old,new);
+ if (!ret) {
+ ret = unlink(old);
+ if (ret) unlink(new);
+ } else
+ ret = unlink(new);
+ return ret;
+#endif
+}
+
+void
+xf86rewind(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fsetpos");
+ rewind(fp->filehnd);
+}
+
+void
+xf86clearerr(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86clearerr");
+ clearerr(fp->filehnd);
+}
+
+int
+xf86feof(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86feof");
+ return feof(fp->filehnd);
+}
+
+int
+xf86ferror(XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86ferror");
+ return ferror(fp->filehnd);
+}
+
+XF86FILE*
+xf86freopen(const char* fname,const char* mode,XF86FILE* fold)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)fold;
+ FILE *fnew;
+
+ _xf86checkhndl(fp,"xf86freopen");
+ fnew = freopen(fname,mode,fp->filehnd);
+ xf86errno = xf86GetErrno();
+ if (!fnew) {
+ xf86fclose(fold); /* discard old XF86FILE structure */
+ return 0;
+ }
+ /* recycle the old XF86FILE structure */
+ fp->magic = XF86FILE_magic;
+ fp->filehnd = fnew;
+ fp->fileno = fileno(fnew);
+ fp->fname = xf86strdup(fname);
+#ifdef DEBUG
+ ErrorF("xf86freopen(%s,%s,%p) yields FILE %p XF86FILE %p\n",
+ fname,mode,fold,fnew,fp);
+#endif
+ return (XF86FILE*)fp;
+}
+
+int
+xf86setbuf(XF86FILE* f, char *buf)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86fsetbuf");
+#ifdef SETBUF_RETURNS_INT
+ return setbuf(fp->filehnd, buf);
+#else
+ setbuf(fp->filehnd, buf);
+ return 0;
+#endif
+}
+
+int
+xf86setvbuf(XF86FILE* f, char *buf, int mode, xf86size_t size)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+ int vbufmode;
+
+ _xf86checkhndl(fp,"xf86fsetvbuf");
+
+ switch (mode) {
+ case XF86_IONBF:
+ vbufmode = _IONBF;
+ break;
+ case XF86_IOLBF:
+ vbufmode = _IOFBF;
+ break;
+ case XF86_IOFBF:
+ vbufmode = _IOLBF;
+ break;
+ default:
+ FatalError("libc_wrapper error: mode in setvbuf incorrect\n");
+ exit(42);
+ }
+
+ return setvbuf(fp->filehnd,buf,vbufmode,(size_t)size);
+}
+
+XF86FILE*
+xf86tmpfile(void)
+{
+#ifdef NEED_TMPFILE
+ return xf86fopen(tmpnam((char*)0),"w+");
+#else
+ XF86FILE_priv* fp;
+ FILE *f = tmpfile();
+ xf86errno = xf86GetErrno();
+ if (!f) return 0;
+
+ fp = xalloc(sizeof(XF86FILE_priv));
+ fp->magic = XF86FILE_magic;
+ fp->filehnd = f;
+ fp->fileno = fileno(f);
+ fp->fname = xf86strdup("*tmpfile*"); /* so that it can be xfree()'d */
+#ifdef DEBUG
+ ErrorF("xf86tmpfile() yields FILE %p XF86FILE %p\n",f,fp);
+#endif
+ return (XF86FILE*)fp;
+}
+#endif /* HAS_TMPFILE */
+
+
+int
+xf86ungetc(int c,XF86FILE* f)
+{
+ XF86FILE_priv* fp = (XF86FILE_priv*)f;
+
+ _xf86checkhndl(fp,"xf86ungetc");
+ return ungetc(c,fp->filehnd);
+}
+
+/* Misc functions. Some are ANSI C, some are not. */
+
+void
+xf86usleep(usec)
+ unsigned long usec;
+{
+#if (defined(SYSV) || defined(SVR4)) && !defined(sun)
+ syscall(3112, (usec) / 1000 + 1);
+#else
+ usleep(usec);
+#endif
+}
+
+void
+xf86getsecs(long * secs, long * usecs)
+{
+ struct timeval tv;
+
+ X_GETTIMEOFDAY(&tv);
+ if (secs)
+ *secs = tv.tv_sec;
+ if (usecs)
+ *usecs= tv.tv_usec;
+
+ return;
+}
+
+int
+xf86ffs(int mask)
+{
+ int n;
+ if (mask == 0) return 0;
+ for (n = 1; (mask & 1)==0; n++)
+ mask >>= 1;
+ return n;
+}
+
+char *
+xf86getenv(const char * a)
+{
+ /* Only allow this when the real and effective uids are the same */
+ if (getuid() != geteuid())
+ return NULL;
+ else
+ return(getenv(a));
+}
+
+void *
+xf86bsearch(const void *key, const void *base, xf86size_t nmemb,
+ xf86size_t size, int (*compar)(const void *, const void *))
+{
+ return bsearch(key, base, (size_t)nmemb, (size_t)size, compar);
+}
+
+int
+xf86execl(const char *pathname, const char *arg, ...)
+{
+#ifndef __UNIXOS2__
+ int i;
+ pid_t pid;
+ int exit_status;
+ char *arglist[5];
+ va_list args;
+ va_start(args, arg);
+ arglist[0] = (char*)&args;
+ i = 1;
+ while (i < 5 && (arglist[i++] = va_arg(args, char *)) != NULL)
+ ;
+ va_end(args);
+
+ if ((pid = fork()) < 0) {
+ ErrorF("Fork failed (%s)\n", strerror(errno));
+ return -1;
+ } else if (pid == 0) { /* child */
+ /*
+ * Make sure that the child doesn't inherit any I/O permissions it
+ * shouldn't have. It's better to put constraints on the development
+ * of a clock program than to give I/O permissions to a bogus program
+ * in someone's XF86Config file
+ */
+#ifndef SELF_CONTAINED_WRAPPER
+ xf86DisableIO();
+#endif
+ setuid(getuid());
+#if !defined(SELF_CONTAINED_WRAPPER)
+ /* set stdin, stdout to the consoleFD, and leave stderr alone */
+ for (i = 0; i < 2; i++)
+ {
+ if (xf86Info.consoleFd != i)
+ {
+ close(i);
+ dup(xf86Info.consoleFd);
+ }
+ }
+#endif
+
+ execv(pathname, arglist);
+ ErrorF("Exec failed for command \"%s\" (%s)\n",
+ pathname, strerror(errno));
+ exit(255);
+ }
+
+ /* parent */
+ wait(&exit_status);
+ if (WIFEXITED(exit_status))
+ {
+ switch (WEXITSTATUS(exit_status))
+ {
+ case 0: /* OK */
+ return 0;
+ case 255: /* exec() failed */
+ return(255);
+ default: /* bad exit status */
+ ErrorF("Program \"%s\" had bad exit status %d\n",
+ pathname, WEXITSTATUS(exit_status));
+ return(WEXITSTATUS(exit_status));
+ }
+ }
+ else if (WIFSIGNALED(exit_status))
+ {
+ ErrorF("Program \"%s\" died on signal %d\n",
+ pathname, WTERMSIG(exit_status));
+ return(WTERMSIG(exit_status));
+ }
+#ifdef WIFSTOPPED
+ else if (WIFSTOPPED(exit_status))
+ {
+ ErrorF("Program \"%s\" stopped by signal %d\n",
+ pathname, WSTOPSIG(exit_status));
+ return(WSTOPSIG(exit_status));
+ }
+#endif
+ else /* should never get to this point */
+ {
+ ErrorF("Program \"%s\" has unknown exit condition\n",
+ pathname);
+ return(1);
+ }
+#else
+ return(1);
+#endif /* __UNIXOS2__ Disable this crazy business for now */
+}
+
+void
+xf86abort(void)
+{
+ ErrorF("Module called abort() function\n");
+ abort();
+}
+
+void
+xf86exit(int ex)
+{
+ ErrorF("Module called exit() function with value=%d\n",ex);
+ exit(ex);
+}
+
+/* directory handling functions */
+#define XF86DIR_magic 0x78666876 /* "xfhv" */
+
+typedef struct _xf86_dir_ {
+ DIR *dir;
+ INT32 magic;
+ XF86DIRENT *dirent;
+} XF86DIR_priv;
+
+static void
+_xf86checkdirhndl(XF86DIR_priv* f,const char *func)
+{
+ if (!f || f->magic != XF86DIR_magic || !f->dir || !f->dirent) {
+ FatalError("libc_wrapper error: passed invalid DIR handle to %s\n",
+ func);
+ exit(42);
+ }
+}
+
+XF86DIR *
+xf86opendir(const char *name)
+{
+ XF86DIR_priv *dp;
+ DIR *dirp;
+
+ dirp = opendir(name);
+ if (!dirp)
+ return (XF86DIR*)0;
+
+ dp = xalloc(sizeof(XF86DIR_priv));
+ dp->magic = XF86DIR_magic; /* This time I have this, Dirk! :-) */
+ dp->dir = dirp;
+ dp->dirent = xalloc(sizeof(struct _xf86dirent));
+
+ return (XF86DIR*)dp;
+}
+
+XF86DIRENT*
+xf86readdir(XF86DIR* dirp)
+{
+ XF86DIR_priv* dp = (XF86DIR_priv*)dirp;
+ DIRENTRY *de;
+ XF86DIRENT* xde;
+ int sz;
+
+ _xf86checkdirhndl(dp,"xf86readdir");
+
+ de = readdir(dp->dir);
+ if (!de)
+ return (XF86DIRENT*)0;
+ xde = dp->dirent;
+ sz = strlen(de->d_name);
+ strncpy(xde->d_name,de->d_name, sz>_XF86NAMELEN ? (_XF86NAMELEN+1) : (sz+1));
+ xde->d_name[_XF86NAMELEN] = '\0'; /* be sure to have a 0 byte */
+ return xde;
+}
+
+void
+xf86rewinddir(XF86DIR* dirp)
+{
+ XF86DIR_priv* dp = (XF86DIR_priv*)dirp;
+
+ _xf86checkdirhndl(dp,"xf86readdir");
+ rewinddir(dp->dir);
+}
+
+int
+xf86closedir(XF86DIR* dir)
+{
+ XF86DIR_priv* dp = (XF86DIR_priv*)dir;
+ int n;
+
+ _xf86checkdirhndl(dp,"xf86readdir");
+
+ n = closedir(dp->dir);
+ dp->magic = 0;
+ xfree(dp->dirent);
+ xfree(dp);
+
+ return n;
+}
+
+static mode_t
+xfToOsChmodMode(xf86mode_t xfmode)
+{
+ mode_t mode = 0;
+
+ if (xfmode & XF86_S_ISUID) mode |= S_ISUID;
+ if (xfmode & XF86_S_ISGID) mode |= S_ISGID;
+#ifndef __UNIXOS2__
+ if (xfmode & XF86_S_ISVTX) mode |= S_ISVTX;
+#endif
+ if (xfmode & XF86_S_IRUSR) mode |= S_IRUSR;
+ if (xfmode & XF86_S_IWUSR) mode |= S_IWUSR;
+ if (xfmode & XF86_S_IXUSR) mode |= S_IXUSR;
+ if (xfmode & XF86_S_IRGRP) mode |= S_IRGRP;
+ if (xfmode & XF86_S_IWGRP) mode |= S_IWGRP;
+ if (xfmode & XF86_S_IXGRP) mode |= S_IXGRP;
+ if (xfmode & XF86_S_IROTH) mode |= S_IROTH;
+ if (xfmode & XF86_S_IWOTH) mode |= S_IWOTH;
+ if (xfmode & XF86_S_IXOTH) mode |= S_IXOTH;
+
+ return mode;
+}
+
+int
+xf86chmod(const char *path, xf86mode_t xfmode)
+{
+ mode_t mode = xfToOsChmodMode(xfmode);
+ int rc = chmod(path, mode);
+
+ xf86errno = xf86GetErrno();
+ return rc;
+}
+
+int
+xf86chown(const char *path, xf86uid_t owner, xf86gid_t group)
+{
+#ifndef __UNIXOS2__
+ int rc = chown(path, owner, group);
+#else
+ int rc = 0;
+#endif
+ xf86errno = xf86GetErrno();
+ return rc;
+}
+
+xf86uid_t
+xf86geteuid(void)
+{
+ return geteuid();
+}
+
+xf86gid_t
+xf86getegid(void)
+{
+ return getegid();
+}
+
+int
+xf86getpid(void)
+{
+ return getpid();
+}
+
+static mode_t
+xfToOsMknodMode(xf86mode_t xfmode)
+{
+ mode_t mode = xfToOsChmodMode(xfmode);
+
+ if (xfmode & XF86_S_IFREG) mode |= S_IFREG;
+ if (xfmode & XF86_S_IFCHR) mode |= S_IFCHR;
+#ifndef __UNIXOS2__
+ if (xfmode & XF86_S_IFBLK) mode |= S_IFBLK;
+#endif
+ if (xfmode & XF86_S_IFIFO) mode |= S_IFIFO;
+
+ return mode;
+}
+
+int xf86mknod(const char *pathname, xf86mode_t xfmode, xf86dev_t dev)
+{
+ mode_t mode = xfToOsMknodMode(xfmode);
+#ifndef __UNIXOS2__
+ int rc = mknod(pathname, mode, dev);
+#else
+ int rc = 0;
+#endif
+ xf86errno = xf86GetErrno();
+ return rc;
+}
+
+unsigned int xf86sleep(unsigned int seconds)
+{
+ return sleep(seconds);
+}
+
+int xf86mkdir(const char *pathname, xf86mode_t xfmode)
+{
+ mode_t mode = xfToOsChmodMode(xfmode);
+ int rc = mkdir(pathname, mode);
+
+ xf86errno = xf86GetErrno();
+ return rc;
+}
+
+
+/* Several math functions */
+
+int
+xf86abs(int x)
+{
+ return abs(x);
+}
+
+double
+xf86acos(double x)
+{
+ return acos(x);
+}
+
+double
+xf86asin(double x)
+{
+ return asin(x);
+}
+
+double
+xf86atan(double x)
+{
+ return atan(x);
+}
+
+double
+xf86atan2(double x,double y)
+{
+ return atan2(x,y);
+}
+
+double
+xf86atof(const char* s)
+{
+ return atof(s);
+}
+
+int
+xf86atoi(const char* s)
+{
+ return atoi(s);
+}
+
+long
+xf86atol(const char* s)
+{
+ return atol(s);
+}
+
+double
+xf86ceil(double x)
+{
+ return ceil(x);
+}
+
+double
+xf86cos(double x)
+{
+ return(cos(x));
+}
+
+double
+xf86exp(double x)
+{
+ return(exp(x));
+}
+
+double
+xf86fabs(double x)
+{
+ return(fabs(x));
+}
+
+int
+xf86finite(double x)
+{
+#ifndef QNX4
+ return(finite(x));
+#else
+ /* XXX Replace this with something that really works. */
+ return 1;
+#endif
+}
+
+double
+xf86floor(double x)
+{
+ return floor(x);
+}
+
+double
+xf86fmod(double x,double y)
+{
+ return fmod(x,y);
+}
+
+long
+xf86labs(long x)
+{
+ return labs(x);
+}
+
+double
+xf86ldexp(double x, int exp)
+{
+ return ldexp(x, exp);
+}
+
+double
+xf86log(double x)
+{
+ return(log(x));
+}
+
+double
+xf86log10(double x)
+{
+ return(log10(x));
+}
+
+double
+xf86modf(double x,double* y)
+{
+ return modf(x,y);
+}
+
+double
+xf86pow(double x, double y)
+{
+ return(pow(x,y));
+}
+
+double
+xf86sin(double x)
+{
+ return sin(x);
+}
+
+double
+xf86sqrt(double x)
+{
+ return(sqrt(x));
+}
+
+double
+xf86strtod(const char *s, char **end)
+{
+ return strtod(s,end);
+}
+
+long
+xf86strtol(const char *s, char **end, int radix)
+{
+ return strtol(s,end,radix);
+}
+
+unsigned long
+xf86strtoul(const char *s, char **end,int radix)
+{
+ return strtoul(s,end,radix);
+}
+
+double
+xf86tan(double x)
+{
+ return tan(x);
+}
+
+/* memory functions */
+void*
+xf86memchr(const void* s, int c, xf86size_t n)
+{
+ return memchr(s,c,(size_t)n);
+}
+
+int
+xf86memcmp(const void* s1, const void* s2, xf86size_t n)
+{
+ return(memcmp(s1,s2,(size_t)n));
+}
+
+void*
+xf86memcpy(void* dest, const void* src, xf86size_t n)
+{
+ return(memcpy(dest,src,(size_t)n));
+}
+
+void*
+xf86memmove(void* dest, const void* src, xf86size_t n)
+{
+ return(memmove(dest,src,(size_t)n));
+}
+
+void*
+xf86memset(void* s, int c, xf86size_t n)
+{
+ return(memset(s,c,(size_t)n));
+}
+
+/* ctype functions */
+
+int
+xf86isalnum(int c)
+{
+ return isalnum(c) ? 1 : 0;
+}
+
+int
+xf86isalpha(int c)
+{
+ return isalpha(c) ? 1 : 0;
+}
+
+int
+xf86iscntrl(int c)
+{
+ return iscntrl(c) ? 1 : 0;
+}
+
+int
+xf86isdigit(int c)
+{
+ return isdigit(c) ? 1 : 0;
+}
+
+int
+xf86isgraph(int c)
+{
+ return isgraph(c) ? 1 : 0;
+}
+
+int
+xf86islower(int c)
+{
+ return islower(c) ? 1 : 0;
+}
+
+int
+xf86isprint(int c)
+{
+ return isprint(c) ? 1 : 0;
+}
+
+int
+xf86ispunct(int c)
+{
+ return ispunct(c) ? 1 : 0;
+}
+
+int
+xf86isspace(int c)
+{
+ return isspace(c) ? 1 : 0;
+}
+
+int
+xf86isupper(int c)
+{
+ return isupper(c) ? 1 : 0;
+}
+
+int
+xf86isxdigit(int c)
+{
+ return isxdigit(c) ? 1 : 0;
+}
+
+int
+xf86tolower(int c)
+{
+ return tolower(c);
+}
+
+int
+xf86toupper(int c)
+{
+ return toupper(c);
+}
+
+/* memory allocation functions */
+void*
+xf86calloc(xf86size_t sz,xf86size_t n)
+{
+ return xcalloc(sz, n);
+}
+
+void
+xf86free(void* p)
+{
+ xfree(p);
+}
+
+double
+xf86frexp(double x, int *exp)
+{
+ return frexp(x, exp);
+}
+
+void*
+xf86malloc(xf86size_t n)
+{
+ return xalloc(n);
+}
+
+void*
+xf86realloc(void* p, xf86size_t n)
+{
+ return xrealloc(p,n);
+}
+
+/*
+ * XXX This probably doesn't belong here.
+ */
+int
+xf86getpagesize()
+{
+ static int pagesize = -1;
+
+ if (pagesize != -1)
+ return pagesize;
+
+#if defined(_SC_PAGESIZE) || defined(HAS_SC_PAGESIZE)
+ pagesize = sysconf(_SC_PAGESIZE);
+#endif
+#ifdef _SC_PAGE_SIZE
+ if (pagesize == -1)
+ pagesize = sysconf(_SC_PAGE_SIZE);
+#endif
+#ifdef HAS_GETPAGESIZE
+ if (pagesize == -1)
+ pagesize = getpagesize();
+#endif
+#ifdef PAGE_SIZE
+ if (pagesize == -1)
+ pagesize = PAGE_SIZE;
+#endif
+ if (pagesize == -1)
+ FatalError("xf86getpagesize: Cannot determine page size\n");
+
+ return pagesize;
+}
+
+
+#define mapnum(e) case (e): return (xf86_##e)
+
+int
+xf86GetErrno ()
+{
+ switch (errno)
+ {
+ case 0: return 0;
+ mapnum (EACCES);
+ mapnum (EAGAIN);
+ mapnum (EBADF);
+ mapnum (EEXIST);
+ mapnum (EFAULT);
+ mapnum (EINTR);
+ mapnum (EINVAL);
+ mapnum (EISDIR);
+ mapnum (ELOOP); /* not POSIX 1 */
+ mapnum (EMFILE);
+ mapnum (ENAMETOOLONG);
+ mapnum (ENFILE);
+ mapnum (ENOENT);
+ mapnum (ENOMEM);
+ mapnum (ENOSPC);
+ mapnum (ENOTDIR);
+ mapnum (EPIPE);
+ mapnum (EROFS);
+#ifndef __UNIXOS2__
+ mapnum (ETXTBSY); /* not POSIX 1 */
+#endif
+ mapnum (ENOTTY);
+ mapnum (EBUSY);
+ mapnum (ENODEV);
+ mapnum (EIO);
+
+ default:
+ return (xf86_UNKNOWN);
+ }
+}
+
+#undef mapnum
+
+
+
+#ifdef NEED_SNPRINTF
+#include "snprintf.c"
+#endif
+
+#ifdef HAVE_SYSV_IPC
+
+int
+xf86shmget(xf86key_t key, int size, int xf86shmflg)
+{
+ int shmflg = xf86shmflg & 0777;
+
+ if (key == XF86IPC_PRIVATE) key = IPC_PRIVATE;
+
+
+ if (xf86shmflg & XF86SHM_R) shmflg |= SHM_R;
+ if (xf86shmflg & XF86SHM_W) shmflg |= SHM_W;
+ if (xf86shmflg & XF86IPC_CREAT) shmflg |= IPC_CREAT;
+ if (xf86shmflg & XF86IPC_EXCL) shmflg |= IPC_EXCL;
+ if (xf86shmflg & XF86IPC_NOWAIT) shmflg |= IPC_NOWAIT;
+ return shmget((key_t) key, size, shmflg);
+}
+
+char *
+xf86shmat(int id, char *addr, int xf86shmflg)
+{
+ int shmflg = 0;
+
+#ifdef SHM_RDONLY
+ if (xf86shmflg & XF86SHM_RDONLY) shmflg |= SHM_RDONLY;
+#endif
+#ifdef SHM_RND
+ if (xf86shmflg & XF86SHM_RND) shmflg |= SHM_RND;
+#endif
+#ifdef SHM_REMAP
+ if (xf86shmflg & XF86SHM_REMAP) shmflg |= SHM_REMAP;
+#endif
+
+ return shmat(id,addr,shmflg);
+}
+
+int
+xf86shmdt(char *addr)
+{
+ return shmdt(addr);
+}
+
+/*
+ * for now only implement the rmid command.
+ */
+int
+xf86shmctl(int id, int xf86cmd, pointer buf)
+{
+ int cmd;
+
+ switch (xf86cmd) {
+ case XF86IPC_RMID:
+ cmd = IPC_RMID;
+ break;
+ default:
+ return 0;
+ }
+
+ return shmctl(id, cmd, buf);
+}
+#else
+
+int
+xf86shmget(xf86key_t key, int size, int xf86shmflg)
+{
+ return -1;
+
+}
+
+char *
+xf86shmat(int id, char *addr, int xf86shmflg)
+{
+ return (char *)-1;
+}
+
+int
+xf86shmctl(int id, int xf86cmd, pointer buf)
+{
+ return -1;
+}
+
+int
+xf86shmdt(char *addr)
+{
+ return -1;
+}
+#endif /* HAVE_SYSV_IPC */
+
+int
+xf86getjmptype()
+{
+#ifdef HAS_GLIBC_SIGSETJMP
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+#ifdef HAS_GLIBC_SIGSETJMP
+
+int
+xf86setjmp(xf86jmp_buf env)
+{
+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+ return __sigsetjmp(env, xf86setjmp1_arg2());
+#else
+ return xf86setjmp1(env, xf86setjmp1_arg2());
+#endif
+}
+
+int
+xf86setjmp0(xf86jmp_buf env)
+{
+ FatalError("setjmp: type 0 called instead of type %d\n", xf86getjmptype());
+}
+
+#if !defined(__GLIBC__) || (__GLIBC__ < 2) /* libc5 */
+
+int
+xf86setjmp1(xf86jmp_buf env, int arg2)
+{
+ __sigjmp_save((void *)env, arg2);
+ return __setjmp((void *)env);
+}
+
+#endif
+
+#else /* HAS_GLIBC_SIGSETJMP */
+
+int
+xf86setjmp1(xf86jmp_buf env, int arg2)
+{
+ FatalError("setjmp: type 1 called instead of type %d\n", xf86getjmptype());
+}
+
+#endif /* HAS_GLIBC_SIGSETJMP */
+
+int
+xf86setjmp1_arg2()
+{
+ return 1;
+}
+
+int
+xf86setjmperror(xf86jmp_buf env)
+{
+ FatalError("setjmp: don't know how to handle setjmp() type %d\n",
+ xf86getjmptype());
+}
+
diff --git a/hw/xfree86/os-support/shared/pm_noop.c b/hw/xfree86/os-support/shared/pm_noop.c
new file mode 100644
index 000000000..fc02b3a20
--- /dev/null
+++ b/hw/xfree86/os-support/shared/pm_noop.c
@@ -0,0 +1,18 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/pm_noop.c,v 1.1 2000/02/13 03:36:11 dawes Exp $ */
+
+/* Stubs for the OS-support layer power-management functions. */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#define XF86_OS_PRIVS
+#include "xf86_OSproc.h"
+
+PMClose
+xf86OSPMOpen(void)
+{
+ return NULL;
+}
+
+
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
new file mode 100644
index 000000000..077c566a6
--- /dev/null
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -0,0 +1,277 @@
+/* sigio.c -- Support for SIGIO handler installation and removal
+ * Created: Thu Jun 3 15:39:18 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, 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: Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigio.c,v 1.14 2002/05/05 19:18:14 herrb Exp $
+ *
+ */
+
+
+#ifdef XFree86Server
+# include "X.h"
+# include "xf86.h"
+# include "xf86drm.h"
+# include "xf86Priv.h"
+# include "xf86_OSlib.h"
+# include "xf86drm.h"
+# include "inputstr.h"
+#else
+# include <unistd.h>
+# include <signal.h>
+# include <fcntl.h>
+# include <sys/time.h>
+# include <errno.h>
+# include <stdio.h>
+# include <string.h>
+# define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
+#endif
+
+/*
+ * Linux libc5 defines FASYNC, but not O_ASYNC. Don't know if it is
+ * functional or not.
+ */
+#if defined(FASYNC) && !defined(O_ASYNC)
+# define O_ASYNC FASYNC
+#endif
+
+#ifdef MAX_DEVICES
+/* MAX_DEVICES represents the maximimum number of input devices usable
+ * at the same time plus one entry for DRM support.
+ */
+# define MAX_FUNCS (MAX_DEVICES + 1)
+#else
+# define MAX_FUNCS 16
+#endif
+
+typedef struct _xf86SigIOFunc {
+ void (*f) (int, void *);
+ int fd;
+ void *closure;
+} Xf86SigIOFunc;
+
+static Xf86SigIOFunc xf86SigIOFuncs[MAX_FUNCS];
+static int xf86SigIOMax;
+static int xf86SigIOMaxFd;
+static fd_set xf86SigIOMask;
+
+/*
+ * SIGIO gives no way of discovering which fd signalled, select
+ * to discover
+ */
+static void
+xf86SIGIO (int sig)
+{
+ int i;
+ fd_set ready;
+ struct timeval to;
+ int r;
+
+ ready = xf86SigIOMask;
+ to.tv_sec = 0;
+ to.tv_usec = 0;
+ SYSCALL (r = select (xf86SigIOMaxFd, &ready, 0, 0, &to));
+ for (i = 0; r > 0 && i < xf86SigIOMax; i++)
+ if (xf86SigIOFuncs[i].f && FD_ISSET (xf86SigIOFuncs[i].fd, &ready))
+ {
+ (*xf86SigIOFuncs[i].f)(xf86SigIOFuncs[i].fd,
+ xf86SigIOFuncs[i].closure);
+ r--;
+ }
+#ifdef XFree86Server
+ if (r > 0) {
+ xf86Msg(X_ERROR, "SIGIO %d descriptors not handled\n", r);
+ }
+#endif
+}
+
+static int
+xf86IsPipe (int fd)
+{
+ struct stat buf;
+
+ if (fstat (fd, &buf) < 0)
+ return 0;
+ return S_ISFIFO(buf.st_mode);
+}
+
+int
+xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
+{
+ struct sigaction sa;
+ struct sigaction osa;
+ int i;
+ int blocked;
+
+ for (i = 0; i < MAX_FUNCS; i++)
+ {
+ if (!xf86SigIOFuncs[i].f)
+ {
+ if (xf86IsPipe (fd))
+ return 0;
+ blocked = xf86BlockSIGIO();
+ if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
+#ifdef XFree86Server
+ xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n",
+ fd, strerror(errno));
+#else
+ fprintf(stderr,"fcntl(%d, O_ASYNC): %s\n",
+ fd, strerror(errno));
+#endif
+ xf86UnblockSIGIO(blocked);
+ return 0;
+ }
+ if (fcntl(fd, F_SETOWN, getpid()) == -1) {
+#ifdef XFree86Server
+ xf86Msg(X_WARNING, "fcntl(%d, F_SETOWN): %s\n",
+ fd, strerror(errno));
+#else
+ fprintf(stderr,"fcntl(%d, F_SETOWN): %s\n",
+ fd, strerror(errno));
+#endif
+ return 0;
+ }
+ sigemptyset(&sa.sa_mask);
+ sigaddset(&sa.sa_mask, SIGIO);
+ sa.sa_flags = 0;
+ sa.sa_handler = xf86SIGIO;
+ sigaction(SIGIO, &sa, &osa);
+ xf86SigIOFuncs[i].fd = fd;
+ xf86SigIOFuncs[i].closure = closure;
+ xf86SigIOFuncs[i].f = f;
+ if (i >= xf86SigIOMax)
+ xf86SigIOMax = i+1;
+ if (fd >= xf86SigIOMaxFd)
+ xf86SigIOMaxFd = fd + 1;
+ FD_SET (fd, &xf86SigIOMask);
+ xf86UnblockSIGIO(blocked);
+ return 1;
+ }
+ /* Allow overwriting of the closure and callback */
+ else if (xf86SigIOFuncs[i].fd == fd)
+ {
+ xf86SigIOFuncs[i].closure = closure;
+ xf86SigIOFuncs[i].f = f;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+int
+xf86RemoveSIGIOHandler(int fd)
+{
+ struct sigaction sa;
+ struct sigaction osa;
+ int i;
+ int max;
+ int maxfd;
+ int ret;
+
+ max = 0;
+ maxfd = -1;
+ ret = 0;
+ for (i = 0; i < MAX_FUNCS; i++)
+ {
+ if (xf86SigIOFuncs[i].f)
+ {
+ if (xf86SigIOFuncs[i].fd == fd)
+ {
+ xf86SigIOFuncs[i].f = 0;
+ xf86SigIOFuncs[i].fd = 0;
+ xf86SigIOFuncs[i].closure = 0;
+ FD_CLR (fd, &xf86SigIOMask);
+ ret = 1;
+ }
+ else
+ {
+ max = i + 1;
+ if (xf86SigIOFuncs[i].fd >= maxfd)
+ maxfd = xf86SigIOFuncs[i].fd + 1;
+ }
+ }
+ }
+ if (ret)
+ {
+ fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_ASYNC);
+ xf86SigIOMax = max;
+ xf86SigIOMaxFd = maxfd;
+ if (!max)
+ {
+ sigemptyset(&sa.sa_mask);
+ sigaddset(&sa.sa_mask, SIGIO);
+ sa.sa_flags = 0;
+ sa.sa_handler = SIG_DFL;
+ sigaction(SIGIO, &sa, &osa);
+ }
+ }
+ return ret;
+}
+
+int
+xf86BlockSIGIO (void)
+{
+ sigset_t set, old;
+
+ sigemptyset (&set);
+ sigaddset (&set, SIGIO);
+ sigprocmask (SIG_BLOCK, &set, &old);
+ return sigismember (&old, SIGIO);
+}
+
+void
+xf86UnblockSIGIO (int wasset)
+{
+ sigset_t set;
+
+ if (!wasset)
+ {
+ sigemptyset (&set);
+ sigaddset (&set, SIGIO);
+ sigprocmask (SIG_UNBLOCK, &set, NULL);
+ }
+}
+
+#ifdef XFree86Server
+void
+xf86AssertBlockedSIGIO (char *where)
+{
+ sigset_t set, old;
+
+ sigemptyset (&set);
+ sigprocmask (SIG_BLOCK, &set, &old);
+ if (!sigismember (&old, SIGIO))
+ xf86Msg (X_ERROR, "SIGIO not blocked at %s\n", where);
+}
+
+/* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */
+
+int
+xf86SIGIOSupported (void)
+{
+ return 1;
+}
+
+#endif
diff --git a/hw/xfree86/os-support/shared/sigiostubs.c b/hw/xfree86/os-support/shared/sigiostubs.c
new file mode 100644
index 000000000..0fdebda1d
--- /dev/null
+++ b/hw/xfree86/os-support/shared/sigiostubs.c
@@ -0,0 +1,54 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/sigiostubs.c,v 1.2 1999/10/14 04:25:01 dawes Exp $ */
+
+#ifdef XFree86Server
+# include "X.h"
+# include "xf86.h"
+# include "xf86drm.h"
+# include "xf86Priv.h"
+# include "xf86_OSlib.h"
+# include "xf86drm.h"
+#else
+# include <unistd.h>
+# include <signal.h>
+# include <fcntl.h>
+# include <sys/time.h>
+# include <errno.h>
+#endif
+
+int
+xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *closure)
+{
+ return 0;
+}
+
+int
+xf86RemoveSIGIOHandler(int fd)
+{
+ return 0;
+}
+
+int
+xf86BlockSIGIO (void)
+{
+ return 0;
+}
+
+void
+xf86UnblockSIGIO (int wasset)
+{
+}
+
+#ifdef XFree86Server
+void
+xf86AssertBlockedSIGIO (char *where)
+{
+}
+#endif
+
+/* XXX This is a quick hack for the benefit of xf86SetSilkenMouse() */
+Bool
+xf86SIGIOSupported ()
+{
+ return FALSE;
+}
+
diff --git a/hw/xfree86/os-support/shared/stdPci.c b/hw/xfree86/os-support/shared/stdPci.c
new file mode 100644
index 000000000..b21acabcc
--- /dev/null
+++ b/hw/xfree86/os-support/shared/stdPci.c
@@ -0,0 +1,19 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdPci.c,v 3.2 1999/12/06 03:55:13 robin Exp $ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Privstr.h"
+#include "xf86Pci.h"
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSlib.h"
+
+#ifndef HAVE_PCI_SIZE_FUNC
+#define xf86StdGetPciSizeFromOS xf86GetPciSizeFromOS
+#endif
+
+Bool
+xf86StdGetPciSizeFromOS(PCITAG tag, int index, int* bits)
+{
+ return FALSE;
+}
diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c
new file mode 100644
index 000000000..5aae4ae9d
--- /dev/null
+++ b/hw/xfree86/os-support/shared/stdResource.c
@@ -0,0 +1,146 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/stdResource.c,v 1.20 2002/01/25 21:56:20 tsi Exp $ */
+
+/* Standard resource information code */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Privstr.h"
+#include "xf86Pci.h"
+#define NEED_OS_RAC_PROTOS
+#include "xf86_OSlib.h"
+#include "xf86Resources.h"
+
+/* Avoid Imakefile changes */
+#include "bus/Pci.h"
+
+#ifdef USESTDRES
+#define xf86StdBusAccWindowsFromOS xf86BusAccWindowsFromOS
+#define xf86StdAccResFromOS xf86AccResFromOS
+#define xf86StdPciBusAccWindowsFromOS xf86PciBusAccWindowsFromOS
+#define xf86StdIsaBusAccWindowsFromOS xf86IsaBusAccWindowsFromOS
+
+resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END};
+#endif
+
+#ifdef INCLUDE_XF86_NO_DOMAIN
+
+resPtr
+xf86StdBusAccWindowsFromOS(void)
+{
+ /* Fallback is to allow addressing of all memory space */
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /* Fallback is to allow addressing of all I/O space */
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86StdPciBusAccWindowsFromOS(void)
+{
+ /* Fallback is to allow addressing of all memory space */
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /* Fallback is to allow addressing of all I/O space */
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#ifdef INCLUDE_UNUSED
+
+resPtr
+xf86StdIsaBusAccWindowsFromOS(void)
+{
+ /* Fallback is to allow addressing of all memory space */
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /* Fallback is to allow addressing of all I/O space */
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+#endif /* INCLUDE_UNUSED */
+
+resPtr
+xf86StdAccResFromOS(resPtr ret)
+{
+ resRange range;
+
+ /*
+ * Fallback is to claim the following areas:
+ *
+ * 0x00000000 - 0x0009ffff low 640k host memory
+ * 0x000c0000 - 0x000effff location of VGA and other extensions ROMS
+ * 0x000f0000 - 0x000fffff system BIOS
+ * 0x00100000 - 0x3fffffff low 1G - 1MB host memory
+ * 0xfec00000 - 0xfecfffff default I/O APIC config space
+ * 0xfee00000 - 0xfeefffff default Local APIC config space
+ * 0xffe00000 - 0xffffffff high BIOS area (should this be included?)
+ *
+ * reference: Intel 440BX AGP specs
+ *
+ * The two APIC spaces appear to be BX-specific and should be dealt with
+ * elsewhere.
+ */
+
+ /* Fallback is to claim 0x0 - 0x9ffff and 0x100000 - 0x7fffffff */
+ RANGE(range, 0x00000000, 0x0009ffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x000c0000, 0x000effff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x000f0000, 0x000fffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x00100000, 0x3fffffff,
+ ResExcMemBlock | ResBios | ResEstimated);
+ ret = xf86AddResToList(ret, &range, -1);
+#if 0
+ RANGE(range, 0xfec00000, 0xfecfffff, ResExcMemBlock | ResBios);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xfee00000, 0xfeefffff, ResExcMemBlock | ResBios);
+ ret = xf86AddResToList(ret, &range, -1);
+#endif
+ RANGE(range, 0xffe00000, 0xffffffff, ResExcMemBlock | ResBios);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /*
+ * Fallback would be to claim well known ports in the 0x0 - 0x3ff range
+ * along with their sparse I/O aliases, but that's too imprecise. Instead
+ * claim a bare minimum here.
+ */
+ RANGE(range, 0x00000000, 0x000000ff, ResExcIoBlock); /* For mainboard */
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+/* RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1); */
+ RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ /* XXX add others */
+ return ret;
+}
+
+#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/shared/vidmem.c b/hw/xfree86/os-support/shared/vidmem.c
new file mode 100644
index 000000000..872cd7aa9
--- /dev/null
+++ b/hw/xfree86/os-support/shared/vidmem.c
@@ -0,0 +1,270 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.15 2001/10/28 03:34:02 tsi Exp $ */
+/*
+ * Copyright 1993-1999 by The XFree86 Project, Inc
+ *
+ */
+
+#include "X.h"
+#include "input.h"
+#include "scrnintstr.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "xf86OSpriv.h"
+
+/*
+ * This file contains the common part of the video memory mapping functions
+ */
+
+/*
+ * Get a piece of the ScrnInfoRec. At the moment, this is only used to hold
+ * the MTRR option information, but it is likely to be expanded if we do
+ * auto unmapping of memory at VT switch.
+ *
+ */
+
+typedef struct {
+ unsigned long physBase;
+ unsigned long size;
+ pointer virtBase;
+ pointer mtrrInfo;
+ int flags;
+} MappingRec, *MappingPtr;
+
+typedef struct {
+ int numMappings;
+ MappingPtr * mappings;
+ Bool mtrrEnabled;
+ MessageType mtrrFrom;
+ Bool mtrrOptChecked;
+ ScrnInfoPtr pScrn;
+} VidMapRec, *VidMapPtr;
+
+static int vidMapIndex = -1;
+
+#define VIDMAPPTR(p) ((VidMapPtr)((p)->privates[vidMapIndex].ptr))
+
+static VidMemInfo vidMemInfo = {FALSE, };
+static VidMapRec vidMapRec = {0, NULL, TRUE, X_DEFAULT, FALSE, NULL};
+
+static VidMapPtr
+getVidMapRec(int scrnIndex)
+{
+ VidMapPtr vp;
+ ScrnInfoPtr pScrn;
+
+ if ((scrnIndex < 0) ||
+ !(pScrn = xf86Screens[scrnIndex]))
+ return &vidMapRec;
+
+ if (vidMapIndex < 0)
+ vidMapIndex = xf86AllocateScrnInfoPrivateIndex();
+
+ if (VIDMAPPTR(pScrn) != NULL)
+ return VIDMAPPTR(pScrn);
+
+ vp = pScrn->privates[vidMapIndex].ptr = xnfcalloc(sizeof(VidMapRec), 1);
+ vp->mtrrEnabled = TRUE; /* default to enabled */
+ vp->mtrrFrom = X_DEFAULT;
+ vp->mtrrOptChecked = FALSE;
+ vp->pScrn = pScrn;
+ return vp;
+}
+
+static MappingPtr
+newMapping(VidMapPtr vp)
+{
+ vp->mappings = xnfrealloc(vp->mappings, sizeof(MappingPtr) *
+ (vp->numMappings + 1));
+ vp->mappings[vp->numMappings] = xnfcalloc(sizeof(MappingRec), 1);
+ return vp->mappings[vp->numMappings++];
+}
+
+static MappingPtr
+findMapping(VidMapPtr vp, pointer vbase, unsigned long size)
+{
+ int i;
+
+ for (i = 0; i < vp->numMappings; i++) {
+ if (vp->mappings[i]->virtBase == vbase &&
+ vp->mappings[i]->size == size)
+ return vp->mappings[i];
+ }
+ return NULL;
+}
+
+static void
+removeMapping(VidMapPtr vp, MappingPtr mp)
+{
+ int i, found = 0;
+
+ for (i = 0; i < vp->numMappings; i++) {
+ if (vp->mappings[i] == mp) {
+ found = 1;
+ xfree(vp->mappings[i]);
+ } else if (found) {
+ vp->mappings[i - 1] = vp->mappings[i];
+ }
+ }
+ vp->numMappings--;
+ vp->mappings[vp->numMappings] = NULL;
+}
+
+enum { OPTION_MTRR };
+static const OptionInfoRec opts[] =
+{
+ { OPTION_MTRR, "mtrr", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+};
+
+static void
+checkMtrrOption(VidMapPtr vp)
+{
+ if (!vp->mtrrOptChecked && vp->pScrn && vp->pScrn->options != NULL) {
+ OptionInfoPtr options;
+
+ options = xnfalloc(sizeof(opts));
+ (void)memcpy(options, opts, sizeof(opts));
+ xf86ProcessOptions(vp->pScrn->scrnIndex, vp->pScrn->options,
+ options);
+ if (xf86GetOptValBool(options, OPTION_MTRR, &vp->mtrrEnabled))
+ vp->mtrrFrom = X_CONFIG;
+ xfree(options);
+ vp->mtrrOptChecked = TRUE;
+ }
+}
+
+void
+xf86MakeNewMapping(int ScreenNum, int Flags, unsigned long Base, unsigned long Size, pointer Vbase)
+{
+ VidMapPtr vp;
+ MappingPtr mp;
+
+ vp = getVidMapRec(ScreenNum);
+ mp = newMapping(vp);
+ mp->physBase = Base;
+ mp->size = Size;
+ mp->virtBase = Vbase;
+ mp->flags = Flags;
+}
+
+void
+xf86InitVidMem(void)
+{
+ if (!vidMemInfo.initialised) {
+ memset(&vidMemInfo, 0, sizeof(VidMemInfo));
+ xf86OSInitVidMem(&vidMemInfo);
+ }
+}
+
+pointer
+xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
+{
+ pointer vbase = NULL;
+ VidMapPtr vp;
+ MappingPtr mp;
+
+ if (((Flags & VIDMEM_FRAMEBUFFER) &&
+ (Flags & (VIDMEM_MMIO | VIDMEM_MMIO_32BIT))))
+ FatalError("Mapping memory with more than one type\n");
+
+ xf86InitVidMem();
+ if (!vidMemInfo.initialised || !vidMemInfo.mapMem)
+ return NULL;
+
+ vbase = vidMemInfo.mapMem(ScreenNum, Base, Size, Flags);
+
+ if (!vbase || vbase == (pointer)-1)
+ return NULL;
+
+ vp = getVidMapRec(ScreenNum);
+ mp = newMapping(vp);
+ mp->physBase = Base;
+ mp->size = Size;
+ mp->virtBase = vbase;
+ mp->flags = Flags;
+
+ /*
+ * Check the "mtrr" option even when MTRR isn't supported to avoid
+ * warnings about unrecognised options.
+ */
+ checkMtrrOption(vp);
+
+ if (vp->mtrrEnabled && vidMemInfo.setWC) {
+ if (Flags & (VIDMEM_MMIO | VIDMEM_MMIO_32BIT))
+ mp->mtrrInfo =
+ vidMemInfo.setWC(ScreenNum, Base, Size, FALSE,
+ vp->mtrrFrom);
+ else if (Flags & VIDMEM_FRAMEBUFFER)
+ mp->mtrrInfo =
+ vidMemInfo.setWC(ScreenNum, Base, Size, TRUE,
+ vp->mtrrFrom);
+ }
+ return vbase;
+}
+
+void
+xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ VidMapPtr vp;
+ MappingPtr mp;
+
+ if (!vidMemInfo.initialised || !vidMemInfo.unmapMem) {
+ xf86DrvMsg(ScreenNum, X_WARNING,
+ "xf86UnMapVidMem() called before xf86MapVidMem()\n");
+ return;
+ }
+
+ vp = getVidMapRec(ScreenNum);
+ mp = findMapping(vp, Base, Size);
+ if (!mp) {
+ xf86DrvMsg(ScreenNum, X_WARNING,
+ "xf86UnMapVidMem: cannot find region for [%p,0x%lx]\n",
+ Base, Size);
+ return;
+ }
+ if (vp->mtrrEnabled && vidMemInfo.undoWC && mp)
+ vidMemInfo.undoWC(ScreenNum, mp->mtrrInfo);
+
+ vidMemInfo.unmapMem(ScreenNum, Base, Size);
+ removeMapping(vp, mp);
+}
+
+Bool
+xf86CheckMTRR(int ScreenNum)
+{
+ VidMapPtr vp = getVidMapRec(ScreenNum);
+
+ /*
+ * Check the "mtrr" option even when MTRR isn't supported to avoid
+ * warnings about unrecognised options.
+ */
+ checkMtrrOption(vp);
+
+ if (vp->mtrrEnabled && vidMemInfo.setWC)
+ return TRUE;
+
+ return FALSE;
+}
+
+Bool
+xf86LinearVidMem()
+{
+ xf86InitVidMem();
+ return vidMemInfo.linearSupported;
+}
+
+void
+xf86MapReadSideEffects(int ScreenNum, int Flags, pointer base,
+ unsigned long Size)
+{
+ if (!(Flags & VIDMEM_READSIDEEFFECT))
+ return;
+
+ if (!vidMemInfo.initialised || !vidMemInfo.readSideEffects)
+ return;
+
+ vidMemInfo.readSideEffects(ScreenNum, base, Size);
+}
+
diff --git a/hw/xfree86/os-support/shared/xf86Axp.c b/hw/xfree86/os-support/shared/xf86Axp.c
new file mode 100644
index 000000000..24d31db59
--- /dev/null
+++ b/hw/xfree86/os-support/shared/xf86Axp.c
@@ -0,0 +1,20 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.c,v 1.2 2000/11/06 21:57:11 dawes Exp $ */
+
+#include "xf86Axp.h"
+
+axpParams xf86AXPParams[] = {
+ {SYS_NONE, 0, 0, 0},
+ {TSUNAMI, 0, 0, 0},
+ {LCA, 1<<24,0xf8000000, 1UL << 32},
+ {APECS, 1<<24,0xf8000000, 1UL << 32},
+ {T2, 0,0xFC000000, 1UL << 31},
+ {T2_GAMMA, 0,0xFC000000, 1UL << 31},
+ {CIA, 0,0xE0000000, 1UL << 34},
+ {MCPCIA, 0,0xf8000000, 1UL << 31},
+ {JENSEN, 0, 0xE000000, 1UL << 32},
+ {POLARIS, 0, 0, 0},
+ {PYXIS, 0, 0, 0},
+ {PYXIS_CIA, 0,0xE0000000, 1UL << 34},
+ {IRONGATE, 0, 0, 0}
+};
+
diff --git a/hw/xfree86/os-support/shared/xf86Axp.h b/hw/xfree86/os-support/shared/xf86Axp.h
new file mode 100644
index 000000000..e63619e3a
--- /dev/null
+++ b/hw/xfree86/os-support/shared/xf86Axp.h
@@ -0,0 +1,32 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/xf86Axp.h,v 1.3 2001/02/15 19:46:03 eich Exp $ */
+
+#ifndef _XF86_AXP_H_
+#define _XF86_AXP_H_
+
+typedef enum {
+ SYS_NONE,
+ TSUNAMI,
+ LCA,
+ APECS,
+ T2,
+ T2_GAMMA,
+ CIA,
+ MCPCIA,
+ JENSEN,
+ POLARIS,
+ PYXIS,
+ PYXIS_CIA,
+ IRONGATE
+} axpDevice;
+
+typedef struct {
+ axpDevice id;
+ unsigned long hae_thresh;
+ unsigned long hae_mask;
+ unsigned long size;
+} axpParams;
+
+extern axpParams xf86AXPParams[];
+
+#endif
+
diff --git a/hw/xfree86/os-support/solaris/apSolaris.shar b/hw/xfree86/os-support/solaris/apSolaris.shar
new file mode 100644
index 000000000..33cecdc4d
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/apSolaris.shar
@@ -0,0 +1,768 @@
+#!/bin/sh
+# $XFree86: xc/programs/Xserver/hw/xfree86/etc/apSolaris.shar,v 1.3 2002/10/04 19:45:33 tsi Exp $
+# This is a shell archive (produced by GNU sharutils 4.2c).
+# To extract the files from this archive, save it to some FILE, remove
+# everything before the `!/bin/sh' line above, then type `sh FILE'.
+#
+# Made on 2002-10-04 13:41 MDT by <root@abcyxhiz>.
+# Source directory was `/archives'.
+#
+# Existing files will *not* be overwritten unless `-c' is specified.
+# This format requires very little intelligence at unshar time.
+# "if test", "echo", "mkdir", and "sed" may be needed.
+#
+# This shar contains:
+# length mode name
+# ------ ---------- ------------------------------------------
+# 1521 -rw-r--r-- aperture/Makefile
+# 1659 -rw-r--r-- aperture/README
+# 7557 -rw-r--r-- aperture/aperture.c
+# 450 -rw-r--r-- aperture/aperture.conf
+# 87 -rw-r--r-- aperture/devlink.tab
+# 1062 -rw-r--r-- aperture/Makefile.sun4u
+#
+echo=echo
+shar_tty= shar_n= shar_c='
+'
+mkdir _sh09806 || ( echo 'failed to create locking directory' '_sh09806'; exit 1 )
+# ============= aperture/Makefile ==============
+if test ! -d 'aperture'; then
+ $echo $echo_n 'x -' 'aperture: '$echo_c
+ if mkdir 'aperture'; then $echo 'created'; else $echo 'failed to create'; fi
+fi
+if test -f 'aperture/Makefile' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'aperture/Makefile' '(file already exists)'
+else
+ $echo 'x -' extracting 'aperture/Makefile' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'aperture/Makefile' &&
+X#
+X# File: makefile for aperture Framebuffer Driver
+X# Author: Doug Anson (danson@lgc.com)
+X# Date: 2/15/94
+X# Modified: David Holland (davidh@use.com)
+X# Date: 2/23/94
+X# - Changed name, and debugging structure
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Date: 2001.06.08
+X# - SPARC support, cleanup and turf aptest.
+X#
+X# >>NOTE<< Have a look at Makefile.sun4u for sun4u specifics.
+X#
+X# GNU gcc compiler
+XCC=gcc
+XCFLGS=-fno-builtin -Wall -O3
+X
+X#
+X# Proworks compiler
+X#CC=/opt/SUNWspro/bin/cc
+X#CFLGS=-Xa -xnolib -xO3
+X
+X#
+X# Debug error reporting
+X#DEBUG_FLG=
+X#DEBUG_FLG=-DAPERTURE_DEBUG
+X
+X#
+X# Files and object declarations
+XKERNEL_FLGS=-D_KERNEL -DSUNDDI
+XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
+XCFILES= aperture.c
+XOBJS= aperture.o
+XDRIVER= aperture
+X
+X#
+X# Make rules
+Xall: $(DRIVER)
+X
+X$(DRIVER): $(OBJS)
+X @if [ -f "Makefile.`uname -m`" ]; then \
+X make -f Makefile.`uname -m` $(DRIVER); \
+X else \
+X rm -f $(DRIVER); \
+X ld -r -o $(DRIVER) $(OBJS); \
+X fi
+X
+Xinstall: $(DRIVER)
+X @if [ -f "Makefile.`uname -m`" ]; then \
+X make -f Makefile.`uname -m` install; \
+X else \
+X cp aperture.conf /kernel/drv; \
+X cp $(DRIVER) /kernel/drv; \
+X fi
+X
+Xadd_drv:
+X @if [ -f "Makefile.`uname -m`" ]; then \
+X make -f Makefile.`uname -m` add_drv; \
+X else \
+X add_drv /kernel/drv/aperture; \
+X fi
+X
+Xclean:
+X rm -f *% *.BAK $(OBJS) $(DRIVER) core
+X
+X.SUFFIXES: .i
+X
+X.c.i:
+X $(CC) -E $(CFLAGS) $*.c > $@
+X
+X.c.o:
+X @if [ -f "Makefile.`uname -m`" ]; then \
+X make -f Makefile.`uname -m` $@; \
+X else \
+X rm -f $@; \
+X $(CC) -c $(CFLAGS) $*.c -o $@; \
+X fi
+SHAR_EOF
+ : || $echo 'restore of' 'aperture/Makefile' 'failed'
+fi
+# ============= aperture/README ==============
+if test -f 'aperture/README' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'aperture/README' '(file already exists)'
+else
+ $echo 'x -' extracting 'aperture/README' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'aperture/README' &&
+XFramebuffer apperture driver.
+X
+XThis driver was written to provide a device that, unlike /dev/mem, allows
+Xmmap()'ing of ranges beyond installed memory.
+X
+XThe original x86-based version of this driver was the corroborative work of
+XDoug Anson (danson@lgc.com), and David Holland (davidh@use.com). It has since
+Xbeen rewritten to also work on sun4u machines.
+X
+X
+XInstallation instructions:
+X
+X1) Check the Makefile, for appropriate CC, and CFLAGS definitions. Compiling
+X with APERTURE_DEBUG defined means the driver will generate reams of
+X debugging output. You'll probably want to leave this off...
+X
+X2) type 'make'. The driver and test program should compile with out any
+X problems. There also should not be any warning messages.
+X
+X3) Become 'root'.
+X
+X4) type 'make install' and 'make add_drv'. The screen should look something
+X like this:
+X
+X # make install
+X cp aperture aperture.conf /kernel/drv
+X # make add_drv
+X add_drv /kernel/drv/aperture
+X
+X On a sun4u machine this will mention the /kernel/drv/sparcv9 directory
+X instead of /kernel/drv.
+X
+X This installs the driver in the system.
+X
+X5) While as root modify the file /etc/devlink.tab, adding these lines:
+X
+X# The following entry is for the framebuffer driver
+Xtype=ddi_pseudo;name=aperture fbs/\M0
+X
+X Add that line exactly as shown. You may also simply add the
+X contents of the devlink.tab file supplied to /etc/devlink.tab.
+X It contains the lines as well. (Yes, that is a tab between
+X aperture, and fbs, not spaces - very important)
+X
+X6) Perform a reconfiguration boot of the system.
+X
+X # touch /reconfigure
+X # init 6
+X
+XBug reports, questions, suggestions, etc can be sent to xfree86@xfree86.org.
+SHAR_EOF
+ : || $echo 'restore of' 'aperture/README' 'failed'
+fi
+# ============= aperture/aperture.c ==============
+if test -f 'aperture/aperture.c' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'aperture/aperture.c' '(file already exists)'
+else
+ $echo 'x -' extracting 'aperture/aperture.c' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'aperture/aperture.c' &&
+X/*
+X * Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
+X *
+X * Permission is hereby granted, free of charge, to any person obtaining a copy
+X * of this software and associated documentation files (the "Software"), to
+X * deal in the Software without restriction, including without limitation the
+X * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+X * sell copies of the Software, and to permit persons to whom the Software is
+X * furnished to do so, subject to the following conditions:
+X *
+X * The above copyright notice and this permission notice shall be included in
+X * all copies or substantial portions of the Software.
+X *
+X * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+X * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+X * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+X * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+X * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+X * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+X *
+X * Except as contained in this notice, the name of the XFree86 Project shall
+X * not be used in advertising or otherwise to promote the sale, use or other
+X * dealings in this Software without prior written authorization from the
+X * XFree86 Project.
+X */
+X
+X/*
+X * Aperture driver for Solaris.
+X */
+X
+X#include <sys/conf.h>
+X#include <sys/ddi.h>
+X#include <sys/modctl.h>
+X#include <sys/open.h>
+X#include <sys/stat.h>
+X#include <sys/sunddi.h>
+X
+X#define DEV_IDENT "aperture"
+X#define DEV_BANNER "XFree86 aperture driver"
+X
+X#ifndef D_64BIT
+X#define D_64BIT 0
+X#endif
+X
+X#ifndef NULL
+X#define NULL ((void *)0)
+X#endif
+X
+X/*
+X * open(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_open
+X(
+X#ifdef __STDC__
+X dev_t *devp,
+X int flag,
+X int typ,
+X struct cred *cred
+X#endif
+X)
+X#ifndef __STDC__
+X dev_t *devp;
+X int flag;
+X int typ;
+X struct cred *cred;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering open()\n");
+X
+X#endif
+X
+X if ((typ != OTYP_CHR) || (getminor(*devp)))
+X error = EINVAL;
+X else
+X error = 0;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving open() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * mmap(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_mmap
+X(
+X#ifdef __STDC__
+X dev_t dev,
+X off_t off,
+X int prot
+X#endif
+X)
+X#ifndef __STDC__
+X dev_t dev;
+X off_t off;
+X int prot;
+X#endif
+X{
+X pfn_t pf;
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering mmap(0x%016lx)\n", off);
+X
+X#endif
+X
+X pf = btop((unsigned long)off);
+X
+X /* Deal with mmap(9E) interface limits */
+X error = (int)pf;
+X if ((error < 0) || (pf != (pfn_t)error))
+X error = -1;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving mmap() = 0x%08lx", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+Xstatic struct cb_ops aperture_cb_ops =
+X{
+X aperture_open, /* open */
+X nulldev, /* close */
+X nodev, /* strategy */
+X nodev, /* print */
+X nodev, /* dump */
+X nodev, /* read */
+X nodev, /* write */
+X nodev, /* ioctl */
+X nodev, /* devmap */
+X aperture_mmap, /* mmap */
+X ddi_segmap, /* segmap */
+X nochpoll, /* poll */
+X ddi_prop_op, /* cb_prop_op */
+X 0, /* streamtab */
+X D_NEW | D_MP | D_64BIT /* Driver compatibility flag */
+X};
+X
+X
+Xstatic dev_info_t *aperture_dip; /* private copy of devinfo pointer */
+X
+X/*
+X * getinfo(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_getinfo
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_info_cmd_t infocmd,
+X void *arg,
+X void **result
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_info_cmd_t infocmd;
+X void *arg;
+X void **result;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering getinfo()\n");
+X
+X#endif
+X
+X switch (infocmd) {
+X case DDI_INFO_DEVT2DEVINFO:
+X *result = aperture_dip;
+X error = DDI_SUCCESS;
+X break;
+X case DDI_INFO_DEVT2INSTANCE:
+X *result = NULL;
+X error = DDI_SUCCESS;
+X break;
+X default:
+X error = DDI_FAILURE;
+X }
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving getinfo() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * identify(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_identify
+X(
+X#ifdef __STDC__
+X dev_info_t *dip
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering identify()\n");
+X
+X#endif
+X
+X if (strcmp(ddi_get_name(dip), DEV_IDENT))
+X error = DDI_NOT_IDENTIFIED;
+X else
+X error = DDI_IDENTIFIED;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving identify() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * attach(9E)
+X */
+X/*ARGSUSED*/
+Xstatic int
+Xaperture_attach
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_attach_cmd_t cmd
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_attach_cmd_t cmd;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering attach()\n");
+X
+X#endif
+X
+X if (cmd != DDI_ATTACH)
+X {
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": not attach(, DDI_ATTACH)\n");
+X
+X#endif
+X
+X error = DDI_FAILURE;
+X }
+X else
+X {
+X error = ddi_create_minor_node(dip, ddi_get_name(dip), S_IFCHR,
+X (minor_t)ddi_get_instance(dip),
+X NULL, NODESPECIFIC_DEV);
+X
+X if (error == DDI_SUCCESS)
+X {
+X aperture_dip = dip;
+X ddi_report_dev(dip);
+X }
+X }
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving attach() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * detach(9E)
+X */
+Xstatic int
+Xaperture_detach
+X(
+X#ifdef __STDC__
+X dev_info_t *dip,
+X ddi_detach_cmd_t cmd
+X#endif
+X)
+X#ifndef __STDC__
+X dev_info_t *dip;
+X ddi_detach_cmd_t cmd;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering detach()\n");
+X
+X#endif
+X
+X if (cmd != DDI_DETACH)
+X {
+X error = DDI_FAILURE;
+X }
+X else
+X {
+X ddi_remove_minor_node(dip, NULL);
+X aperture_dip = NULL;
+X error = DDI_SUCCESS;
+X }
+X
+X#if APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving detach() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X
+Xstatic struct dev_ops aperture_ops =
+X{
+X DEVO_REV, /* revision */
+X 0, /* refcnt */
+X aperture_getinfo, /* getinfo */
+X aperture_identify, /* identify */
+X nulldev, /* probe */
+X aperture_attach, /* attach */
+X aperture_detach, /* detach */
+X nodev, /* reset */
+X &aperture_cb_ops, /* driver operations */
+X NULL /* bus operations */
+X};
+X
+X
+Xstatic struct modldrv modldrv =
+X{
+X &mod_driverops, /* mod_ops structure pointer */
+X DEV_BANNER, /* driver banner string */
+X &aperture_ops, /* dev_ops structure pointer */
+X};
+X
+X
+Xstatic struct modlinkage modlinkage =
+X{
+X MODREV_1, /* module API revision */
+X {
+X &modldrv, /* module driver structure pointer */
+X NULL /* list termination */
+X }
+X};
+X
+X
+X/*
+X * _init(9E)
+X */
+Xint
+X_init
+X(
+X#ifdef __STDC__
+X void
+X#endif
+X)
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _init()\n");
+X
+X#endif
+X
+X error = mod_install(&modlinkage);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _init() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * _info(9E)
+X */
+Xint
+X_info
+X(
+X#ifdef __STDC__
+X struct modinfo *modinfop
+X#endif
+X)
+X#ifndef __STDC__
+X struct modinfo *modinfop;
+X#endif
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _info()\n");
+X
+X#endif
+X
+X error = mod_info(&modlinkage, modinfop);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _info() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+X
+X/*
+X * _fini(9E)
+X */
+Xint
+X_fini
+X(
+X#ifdef __STDC__
+X void
+X#endif
+X)
+X{
+X int error;
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": entering _fini()\n");
+X
+X#endif
+X
+X error = mod_remove(&modlinkage);
+X
+X#ifdef APERTURE_DEBUG
+X
+X cmn_err(CE_CONT, DEV_IDENT ": leaving _fini() = %d\n", error);
+X
+X#endif
+X
+X return error;
+X}
+SHAR_EOF
+ : || $echo 'restore of' 'aperture/aperture.c' 'failed'
+fi
+# ============= aperture/aperture.conf ==============
+if test -f 'aperture/aperture.conf' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'aperture/aperture.conf' '(file already exists)'
+else
+ $echo 'x -' extracting 'aperture/aperture.conf' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'aperture/aperture.conf' &&
+X#
+X# Copyright 1994 Doug Anson, danson@lgc.com & David Holland, davidh@use.com
+X#
+X# File: aperture.conf
+X# Author: Doug Anson (danson@lgc.com)
+X#
+X# Modified: David Holland (davidh@use.com)
+X# Log: Change comments 02/23/94
+X# Change defaults/comments 09/25/94
+X#
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Log: SPARC changes 2001.09
+X#
+X# Purpose: This conf file is used by the aperture driver.
+X#
+Xname="aperture" parent="pseudo";
+SHAR_EOF
+ : || $echo 'restore of' 'aperture/aperture.conf' 'failed'
+fi
+# ============= aperture/devlink.tab ==============
+if test -f 'aperture/devlink.tab' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'aperture/devlink.tab' '(file already exists)'
+else
+ $echo 'x -' extracting 'aperture/devlink.tab' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'aperture/devlink.tab' &&
+X# The following entry is for the aperture driver
+Xtype=ddi_pseudo;name=aperture fbs/\M0
+SHAR_EOF
+ : || $echo 'restore of' 'aperture/devlink.tab' 'failed'
+fi
+# ============= aperture/Makefile.sun4u ==============
+if test -f 'aperture/Makefile.sun4u' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'aperture/Makefile.sun4u' '(file already exists)'
+else
+ $echo 'x -' extracting 'aperture/Makefile.sun4u' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'aperture/Makefile.sun4u' &&
+X#
+X# File: makefile for aperture Framebuffer Driver
+X# Author: Doug Anson (danson@lgc.com)
+X# Date: 2/15/94
+X# Modified: David Holland (davidh@use.com)
+X# Date: 2/23/94
+X# - Changed name, and debugging structure
+X# Modified: Marc Aurele La France (tsi@xfree86.org)
+X# Date: 2001.06.08
+X# - SPARC support, cleanup and turf aptest.
+X#
+X
+X#
+X# GNU gcc compiler, version 3.2 or later
+X#
+XCC=gcc
+XCFLGS=-fno-builtin -Wall -O3 -m64
+X
+X#
+X# Proworks compiler
+X#CC=/opt/SUNWspro/bin/cc
+X#CFLGS=-Xa -xarch=v9 -xnolib -xO3
+X
+X#
+X# Debug error reporting
+X#DEBUG_FLG=
+X#DEBUG_FLG=-DAPERTURE_DEBUG
+X
+X#
+X# Files and object declarations
+XKERNEL_FLGS=-D_KERNEL -DSUNDDI
+XCFLAGS= $(CFLGS) $(KERNEL_FLGS) $(DEBUG_FLG)
+XCFILES= aperture.c
+XOBJS= aperture.o
+XDRIVER= aperture
+X
+X#
+X# Make rules
+Xall: $(DRIVER)
+X
+X$(DRIVER): $(OBJS)
+X rm -f $(DRIVER)
+X ld -r -o $(DRIVER) $(OBJS)
+X
+Xinstall: $(DRIVER)
+X cp aperture.conf /kernel/drv
+X cp $(DRIVER) /kernel/drv/sparcv9
+X
+Xadd_drv:
+X add_drv /kernel/drv/sparcv9/aperture
+X
+Xclean:
+X rm -f *% *.BAK $(OBJS) $(DRIVER) core
+X
+X.SUFFIXES: .i
+X
+X.c.i:
+X $(CC) -E $(CFLAGS) $*.c > $@
+SHAR_EOF
+ : || $echo 'restore of' 'aperture/Makefile.sun4u' 'failed'
+fi
+$echo $shar_n 'x -' 'lock directory' "\`_sh09806': " $shar_c
+if rm -fr _sh09806; then
+ $echo 'removed'
+else
+ $echo 'failed to remove'
+fi
+exit 0
diff --git a/hw/xfree86/os-support/solaris/sun_bios.c b/hw/xfree86/os-support/solaris/sun_bios.c
new file mode 100644
index 000000000..d1c79888b
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_bios.c
@@ -0,0 +1,100 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_bios.c,v 1.2 2001/10/28 03:34:02 tsi Exp $ */
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ * Copyright 1999 by David Holland <davidh@iquest.net>
+ *
+ * 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 names of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+ * SHALL THE COPYRIGHT HOLDERS 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.
+ */
+
+#ifdef i386
+#define _NEED_SYSI86
+#endif
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+extern char *apertureDevName;
+
+/*
+ * Read BIOS via mmap()ing physical memory.
+ */
+int
+xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf,
+ int Len)
+{
+ int fd;
+ unsigned char *ptr;
+ char solx86_vtname[20];
+ int psize;
+ int mlen;
+
+ /*
+ * Solaris 2.1 x86 SVR4 (10/27/93)
+ * The server must treat the virtual terminal device file
+ * as the standard SVR4 /dev/pmem. By default, then used VT
+ * is considered the "default" file to open.
+ *
+ * Solaris 2.8 x86 (7/26/99) - DWH
+ *
+ * Use /dev/xsvc for everything.
+ */
+ psize = xf86getpagesize();
+ Offset += Base & (psize - 1);
+ Base &= ~(psize - 1);
+ mlen = (Offset + Len + psize - 1) & ~(psize - 1);
+#if defined(i386) && !defined(__SOL8__)
+ if (Base >= 0xA0000 && Base + mlen < 0xFFFFF && xf86Info.vtno >= 0)
+ sprintf(solx86_vtname, "/dev/vt%02d", xf86Info.vtno);
+ else
+#endif
+ {
+ if (!xf86LinearVidMem())
+ FatalError("xf86ReadBIOS: Could not mmap BIOS"
+ " [a=%x]\n", Base);
+ sprintf(solx86_vtname, apertureDevName);
+ }
+
+ if ((fd = open(solx86_vtname, O_RDONLY)) < 0)
+ {
+ xf86Msg(X_WARNING, "xf86ReadBIOS: Failed to open %s (%s)\n",
+ solx86_vtname, strerror(errno));
+ return(-1);
+ }
+ ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ,
+ MAP_SHARED, fd, (off_t)Base);
+ if (ptr == MAP_FAILED)
+ {
+ xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap failed "
+ "[0x%05x, 0x%04x]\n",
+ solx86_vtname, Base, mlen);
+ close(fd);
+ return -1;
+ }
+
+ (void)memcpy(Buf, (void *)(ptr + Offset), Len);
+ (void)munmap((caddr_t)ptr, mlen);
+ (void)close(fd);
+
+ return Len;
+}
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
new file mode 100644
index 000000000..b08529a00
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_init.c
@@ -0,0 +1,375 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_init.c,v 1.6 2002/06/06 13:49:34 dawes Exp $ */
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ * Copyright 1999 by David Holland <davidh@iquest.net>
+ *
+ * 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 names of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS 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.
+ */
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+static Bool KeepTty = FALSE;
+static Bool Protect0 = FALSE;
+#ifdef HAS_USL_VTS
+static int VTnum = -1;
+static int xf86StartVT = -1;
+#endif
+
+static char fb_dev[PATH_MAX] = "/dev/console";
+
+void
+xf86OpenConsole(void)
+{
+#ifdef HAS_USL_VTS
+ int fd, i;
+ struct vt_mode VT;
+ struct vt_stat vtinfo;
+ int FreeVTslot;
+ MessageType from = X_PROBED;
+#endif
+
+ if (serverGeneration == 1)
+ {
+ /* Check if we're run with euid==0 */
+ if (geteuid() != 0)
+ FatalError("xf86OpenConsole: Server must be suid root\n");
+
+ /* Protect page 0 to help find NULL dereferencing */
+ /* mprotect() doesn't seem to work */
+ if (Protect0)
+ {
+ int fd = -1;
+
+ if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0)
+ {
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: cannot open /dev/zero (%s)\n",
+ strerror(errno));
+ }
+ else
+ {
+ if ((int)mmap(0, 0x1000, PROT_NONE,
+ MAP_FIXED | MAP_SHARED, fd, 0) == -1)
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: failed to protect page 0 (%s)\n",
+ strerror(errno));
+
+ close(fd);
+ }
+ }
+
+#ifdef HAS_USL_VTS
+
+ /*
+ * Setup the virtual terminal manager
+ */
+ if (VTnum != -1)
+ {
+ xf86Info.vtno = VTnum;
+ from = X_CMDLINE;
+ }
+ else
+ {
+ if ((fd = open("/dev/vt00",O_RDWR,0)) < 0)
+ FatalError("xf86OpenConsole: Cannot open /dev/vt00 (%s)\n",
+ strerror(errno));
+
+ if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
+ FatalError("xf86OpenConsole: Cannot determine current VT\n");
+
+ xf86StartVT = vtinfo.v_active;
+
+ /*
+ * There is a SEVERE problem with x86's VT's. The VT_OPENQRY
+ * ioctl() will panic the entire system if all 8 (7 VT's+Console)
+ * terminals are used. The only other way I've found to determine
+ * if there is a free VT is to try activating all the the available
+ * VT's and see if they all succeed - if they do, there there is no
+ * free VT, and the Xserver cannot continue without panic'ing the
+ * system. (It's ugly, but it seems to work.) Note there is a
+ * possible race condition here.
+ *
+ * David Holland 2/23/94
+ */
+
+ FreeVTslot = 0;
+ for (i = 7; (i >= 0) && !FreeVTslot; i--)
+ if (ioctl(fd, VT_ACTIVATE, i) != 0)
+ FreeVTslot = 1;
+
+ if (!FreeVTslot ||
+ (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
+ (xf86Info.vtno == -1))
+ FatalError("xf86OpenConsole: Cannot find a free VT\n");
+
+ close(fd);
+ }
+
+ xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
+
+ sprintf(fb_dev, "/dev/vt%02d", xf86Info.vtno); /* Solaris 2.1 x86 */
+
+#endif /* HAS_USL_VTS */
+
+ if (!KeepTty)
+ setpgrp();
+
+ if (((xf86Info.consoleFd = open(fb_dev, O_RDWR | O_NDELAY, 0)) < 0))
+ FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
+ fb_dev, strerror(errno));
+
+#ifdef HAS_USL_VTS
+
+ /* Change ownership of the vt */
+ chown(fb_dev, getuid(), getgid());
+
+ /*
+ * Now get the VT
+ */
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_GETMODE failed\n");
+
+ signal(SIGUSR1, xf86VTRequest);
+
+ VT.mode = VT_PROCESS;
+ VT.relsig = SIGUSR1;
+ VT.acqsig = SIGUSR1;
+
+ if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
+
+ if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
+ FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed\n");
+ }
+ else /* serverGeneration != 1 */
+ {
+ /*
+ * Now re-get the VT
+ */
+ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
+
+ /*
+ * If the server doesn't have the VT when the reset occurs,
+ * this is to make sure we don't continue until the activate
+ * signal is received.
+ */
+ if (!xf86Screens[0]->vtSema)
+ sleep(5);
+
+#endif /* HAS_USL_VTS */
+
+ }
+}
+
+void
+xf86CloseConsole(void)
+{
+#ifdef HAS_USL_VTS
+ struct vt_mode VT;
+#endif
+#if defined(__SOL8__) || !defined(i386)
+ int tmp;
+#endif
+
+#ifndef i386
+
+ if (!xf86DoProbe && !xf86DoConfigure) {
+ int fd;
+
+ /*
+ * Wipe out framebuffer just like the non-SI Xsun server does. This
+ * could be improved by saving framebuffer contents in
+ * xf86OpenConsole() above and restoring them here. Also, it's unclear
+ * at this point whether this should be done for all framebuffers in
+ * the system, rather than only the console.
+ */
+ if ((fd = open("/dev/fb", O_RDWR, 0)) < 0) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to open framebuffer (%s)\n",
+ strerror(errno));
+ } else {
+ struct fbgattr fbattr;
+
+ if ((ioctl(fd, FBIOGATTR, &fbattr) < 0) &&
+ (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0)) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to retrieve framebuffer"
+ " attributes (%s)\n", strerror(errno));
+ } else {
+ pointer fbdata;
+
+ fbdata = mmap(NULL, fbattr.fbtype.fb_size,
+ PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (fbdata == MAP_FAILED) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to mmap framebuffer"
+ " (%s)\n", strerror(errno));
+ } else {
+ (void)memset(fbdata, 0, fbattr.fbtype.fb_size);
+ (void)munmap(fbdata, fbattr.fbtype.fb_size);
+ }
+ }
+
+ close(fd);
+ }
+ }
+
+#endif
+
+#ifdef HAS_USL_VTS
+
+ /*
+ * Solaris 2.1 x86 doesn't seem to "switch" back to the console when the VT
+ * is relinquished and its mode is reset to auto. Also, Solaris 2.1 seems
+ * to associate vt00 with the console so I've opened the "console" back up
+ * and made it the active vt again in text mode and then closed it. There
+ * must be a better hack for this but I'm not aware of one at this time.
+ *
+ * Doug Anson 11/6/93
+ * danson@lgc.com
+ *
+ * Fixed - 12/5/93 - David Holland - davidh@dorite.use.com
+ * Did the whole thing similarly to the way linux does it
+ */
+
+ /* Reset the display back to text mode */
+ ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT);
+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
+ {
+ VT.mode = VT_AUTO; /* Set default vt handling */
+ ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
+ }
+
+ /* Activate the VT that X was started on */
+ ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT);
+
+#endif /* HAS_USL_VTS */
+
+ close(xf86Info.consoleFd);
+
+#if defined(__SOL8__) || !defined(i386)
+
+ /*
+ * This probably shouldn't be here. However, there is no corresponding
+ * xf86CloseKbd() routine - DWH
+ */
+
+ /* Set the keyboard into "indirect" mode and turn off even translation */
+ tmp = 0;
+ (void) ioctl(xf86Info.kbdFd, KIOCSDIRECT, &tmp);
+ tmp = TR_ASCII;
+ (void) ioctl(xf86Info.kbdFd, KIOCTRANS, &tmp);
+
+ close(xf86Info.kbdFd);
+
+#endif
+}
+
+int
+xf86ProcessArgument(int argc, char **argv, int i)
+{
+ /*
+ * Keep server from detaching from controlling tty. This is useful when
+ * debugging, so the server can receive keyboard signals.
+ */
+ if (!strcmp(argv[i], "-keeptty"))
+ {
+ KeepTty = TRUE;
+ return 1;
+ }
+
+ /*
+ * Undocumented flag to protect page 0 from read/write to help catch NULL
+ * pointer dereferences. This is purely a debugging flag.
+ */
+ if (!strcmp(argv[i], "-protect0"))
+ {
+ Protect0 = TRUE;
+ return 1;
+ }
+
+#ifdef HAS_USL_VTS
+
+ if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
+ {
+ if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
+ {
+ UseMsg();
+ VTnum = -1;
+ return 0;
+ }
+
+ return 1;
+ }
+
+#endif /* HAS_USL_VTS */
+
+#if defined(__SOL8__) || !defined(i386)
+
+ if ((i + 1) < argc) {
+ if (!strcmp(argv[i], "-dev")) {
+ strncpy(fb_dev, argv[i+1], PATH_MAX);
+ fb_dev[PATH_MAX - 1] = '\0';
+ return 2;
+ }
+
+ if (!strcmp(argv[i], "-ar1")) {
+ xf86Info.kbdDelay = atoi(argv[i + 1]) * 1000;
+ return 2;
+ }
+
+ if (!strcmp(argv[i], "-ar2")) {
+ xf86Info.kbdRate = atoi(argv[i + 1]) * 1000;
+ return 2;
+ }
+ }
+
+#endif
+
+ return 0;
+}
+
+void xf86UseMsg()
+{
+#ifdef HAS_USL_VTS
+ ErrorF("vtXX Use the specified VT number\n");
+#endif
+#if defined(__SOL8__) || !defined(i386)
+ ErrorF("-dev <fb> Framebuffer device\n");
+ ErrorF("-ar1 <float> Set autorepeat initiate time (sec)\n");
+ ErrorF(" (if not using XKB)\n");
+ ErrorF("-ar2 <float> Set autorepeat interval time (sec)\n");
+ ErrorF(" (if not using XKB)\n");
+#endif
+ ErrorF("-keeptty Don't detach controlling tty\n");
+ ErrorF(" (for debugging only)\n");
+}
diff --git a/hw/xfree86/os-support/solaris/sun_inout.s b/hw/xfree86/os-support/solaris/sun_inout.s
new file mode 100644
index 000000000..e8f03d0e8
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_inout.s
@@ -0,0 +1,124 @@
+/ $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_inout.s,v 1.1 2001/05/28 02:42:31 tsi Exp $
+/
+/ Copyright 1994-2001 The XFree86 Project, 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, 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
+/ XFREE86 PROJECT 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.
+/
+/ Except as contained in this notice, the name of the XFree86 Project shall not
+/ be used in advertising or otherwise to promote the sale, use or other
+/ dealings in this Software without prior written authorization from the
+/ XFree86 Project.
+/
+/
+/ File: sun_inout.s
+/
+/ Purpose: Provide inb(), inw(), inl(), outb(), outw(), outl() functions
+/ for Solaris x86 using the ProWorks compiler by SunPro
+/
+/ Author: Installed into XFree86 SuperProbe by Doug Anson (danson@lgc.com)
+/ Portions donated to XFree86 by Steve Dever (Steve.Dever@Eng.Sun.Com)
+/
+/ Synopsis: (c callable external declarations)
+/ extern unsigned char inb(int port);
+/ extern unsigned short inw(int port);
+/ extern unsigned long inl(int port);
+/ extern void outb(int port, unsigned char value);
+/ extern void outw(int port, unsigned short value);
+/ extern void outl(int port, unsigned long value);
+/
+
+.file "sunos_inout.s"
+.text
+
+.globl inb
+.globl inw
+.globl inl
+.globl outb
+.globl outw
+.globl outl
+
+/
+/ unsigned char inb(int port);
+/
+.align 4
+inb:
+ movl 4(%esp),%edx
+ subl %eax,%eax
+ inb (%dx)
+ ret
+.type inb,@function
+.size inb,.-inb
+
+/
+/ unsigned short inw(int port);
+/
+.align 4
+inw:
+ movl 4(%esp),%edx
+ subl %eax,%eax
+ inw (%dx)
+ ret
+.type inw,@function
+.size inw,.-inw
+
+/
+/ unsigned long inl(int port);
+/
+.align 4
+inl:
+ movl 4(%esp),%edx
+ inl (%dx)
+ ret
+.type inl,@function
+.size inl,.-inl
+
+/
+/ void outb(int port, unsigned char value);
+/
+.align 4
+outb:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ outb (%dx)
+ ret
+.type outb,@function
+.size outb,.-outb
+
+/
+/ void outw(int port, unsigned short value);
+/
+.align 4
+outw:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ outw (%dx)
+ ret
+.type outw,@function
+.size outw,.-outw
+
+/
+/ void outl(int port, unsigned long value);
+/
+.align 4
+outl:
+ movl 4(%esp),%edx
+ movl 8(%esp),%eax
+ outl (%dx)
+ ret
+.type outl,@function
+.size outl,.-outl
diff --git a/hw/xfree86/os-support/solaris/sun_io.c b/hw/xfree86/os-support/solaris/sun_io.c
new file mode 100644
index 000000000..27996d312
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_io.c
@@ -0,0 +1,64 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_io.c,v 1.3 2003/02/17 15:12:00 dawes Exp $ */
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1993 by David Dawes <dawes@xfree86.org>
+ *
+ * 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 names of Thomas Roell and David Dawes
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Thomas Roell and
+ * David Dawes makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THOMAS ROELL AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+ * IN NO EVENT SHALL THOMAS ROELL OR DAVID DAWES 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.
+ *
+ */
+
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+void
+xf86SoundKbdBell(int loudness, int pitch, int duration)
+{
+ int kbdCmd;
+
+ if (loudness && pitch)
+ {
+ kbdCmd = KBD_CMD_BELL;
+ if (ioctl (xf86Info.kbdFd, KIOCCMD, &kbdCmd) == -1) {
+ ErrorF("Failed to activate bell\n");
+ return;
+ }
+
+ usleep(xf86Info.bell_duration * loudness * 20);
+
+ kbdCmd = KBD_CMD_NOBELL;
+ if (ioctl (xf86Info.kbdFd, KIOCCMD, &kbdCmd) == -1)
+ ErrorF ("Failed to deactivate bell\n");
+ }
+}
+
+void
+xf86SetKbdLeds(int leds)
+{
+ if( ioctl(xf86Info.kbdFd, KIOCSLED, &leds) < 0 )
+ ErrorF("Failed to set Keyboard LED's\n");
+}
+
+#include "xf86OSKbd.h"
+
+Bool
+xf86OSKbdPreInit(InputInfoPtr pInfo)
+{
+ return FALSE;
+}
diff --git a/hw/xfree86/os-support/solaris/sun_kbd.c b/hw/xfree86/os-support/solaris/sun_kbd.c
new file mode 100644
index 000000000..7e4998817
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_kbd.c
@@ -0,0 +1,112 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbd.c,v 1.1 2001/05/28 02:42:31 tsi Exp $ */
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1993 by David Dawes <dawes@XFree86.org>
+ * Copyright 1999 by David Holland <davidh@iquest.net)
+ *
+ * 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 names of Thomas Roell, David Dawes, and David Holland not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Thomas Roell, David Dawes, and
+ * David Holland make no representations about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THOMAS ROELL, DAVID DAWES, AND DAVID HOLLAND DISCLAIM ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL THOMAS ROELL, DAVID DAWES, OR DAVID HOLLAND
+ * 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.
+ */
+
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+static int sun_otranslation = -1;
+static int sun_odirect = -1;
+
+int
+xf86GetKbdLeds()
+{
+ int leds;
+
+ ioctl(xf86Info.kbdFd, KIOCGLED, &leds);
+ return leds;
+}
+
+void
+xf86SetKbdRepeat(char rad)
+{
+ /* Nothing to do */
+}
+
+/*
+ * Save initial keyboard state. This is called at the start of each server
+ * generation.
+ */
+
+void
+xf86KbdInit()
+{
+ int ktype, klayout;
+
+ if (xf86Info.kbdFd < 0) {
+ xf86Info.kbdFd = open("/dev/kbd", O_RDWR|O_NONBLOCK);
+ if(xf86Info.kbdFd < 0)
+ FatalError("Unable to open keyboard: /dev/kbd\n");
+ }
+
+ /*
+ * None of the followin should ever fail. If it does, something is
+ * broken (IMO) - DWH 8/21/99
+ */
+
+ if (ioctl(xf86Info.kbdFd, KIOCTYPE, &ktype) < 0)
+ FatalError("Unable to determine keyboard type: %d\n", errno);
+
+ if (ioctl(xf86Info.kbdFd, KIOCLAYOUT, &klayout) < 0)
+ FatalError("Unable to determine keyboard layout: %d\n", errno);
+
+ if (ioctl(xf86Info.kbdFd, KIOCGTRANS, &sun_otranslation) < 0)
+ FatalError("Unable to determine keyboard translation mode\n");
+
+ if (ioctl(xf86Info.kbdFd, KIOCGDIRECT, &sun_odirect) < 0)
+ FatalError("Unable to determine keyboard direct setting\n");
+}
+
+int
+xf86KbdOn(void)
+{
+ int tmp = 1;
+
+ if (ioctl(xf86Info.kbdFd, KIOCSDIRECT, &tmp) == -1)
+ FatalError("Setting keyboard direct mode on\n");
+
+ /* Setup translation */
+
+ tmp = TR_UNTRANS_EVENT;
+
+ if (ioctl(xf86Info.kbdFd, KIOCTRANS, &tmp) == -1)
+ FatalError("Setting keyboard translation\n");
+
+ return xf86Info.kbdFd;
+}
+
+int
+xf86KbdOff()
+{
+ if ((sun_otranslation != -1) &&
+ (ioctl(xf86Info.kbdFd, KIOCTRANS, &sun_otranslation) < 0))
+ FatalError("Unable to restore keyboard translation mode\n");
+
+ if ((sun_odirect != 0) &&
+ (ioctl(xf86Info.kbdFd, KIOCSDIRECT, &sun_odirect) < 0 ))
+ FatalError("Unable to restore keyboard direct setting\n");
+
+ return xf86Info.kbdFd;
+}
diff --git a/hw/xfree86/os-support/solaris/sun_kbdEv.c b/hw/xfree86/os-support/solaris/sun_kbdEv.c
new file mode 100644
index 000000000..ff4ef3288
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_kbdEv.c
@@ -0,0 +1,672 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_kbdEv.c,v 1.4 2001/11/08 04:15:33 tsi Exp $ */
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ * Copyright 1993 by David Dawes <dawes@xfree86.org>
+ *
+ * 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 names of Thomas Roell and David Dawes not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Thomas Roell and David Dawes make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THOMAS ROELL AND DAVID DAWES DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL THOMAS ROELL OR DAVID DAWES 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.
+ */
+
+/* [JCH-96/01/21] Extended std reverse map to four buttons. */
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#ifdef XINPUT
+#include "XI.h"
+#include "XIproto.h"
+#include "xf86Xinput.h"
+#else
+#include "inputstr.h"
+#endif
+
+#ifdef XFreeXDGA
+#include "dgaproc.h"
+#endif
+
+#include <sys/vuid_event.h>
+#include "atKeynames.h"
+
+#ifdef XKB
+extern Bool noXkbExtension;
+#endif
+
+#define XE_POINTER 1
+#define XE_KEYBOARD 2
+
+#ifdef XTESTEXT1
+
+#define XTestSERVER_SIDE
+#include "xtestext1.h"
+extern short xtest_mousex;
+extern short xtest_mousey;
+extern int on_steal_input;
+extern Bool XTestStealKeyData();
+extern void XTestStealMotionData();
+
+#ifdef XINPUT
+#define ENQUEUE(ev, code, direction, dev_type) \
+ (ev)->u.u.detail = (code); \
+ (ev)->u.u.type = (direction); \
+ if (!on_steal_input || \
+ XTestStealKeyData((ev)->u.u.detail, (ev)->u.u.type, dev_type, \
+ xtest_mousex, xtest_mousey)) \
+ xf86eqEnqueue((ev))
+#else
+#define ENQUEUE(ev, code, direction, dev_type) \
+ (ev)->u.u.detail = (code); \
+ (ev)->u.u.type = (direction); \
+ if (!on_steal_input || \
+ XTestStealKeyData((ev)->u.u.detail, (ev)->u.u.type, dev_type, \
+ xtest_mousex, xtest_mousey)) \
+ mieqEnqueue((ev))
+#endif
+
+#else /* ! XTESTEXT1 */
+
+#ifdef XINPUT
+#define ENQUEUE(ev, code, direction, dev_type) \
+ (ev)->u.u.detail = (code); \
+ (ev)->u.u.type = (direction); \
+ xf86eqEnqueue((ev))
+#else
+#define ENQUEUE(ev, code, direction, dev_type) \
+ (ev)->u.u.detail = (code); \
+ (ev)->u.u.type = (direction); \
+ mieqEnqueue((ev))
+#endif
+
+#endif
+
+static void startautorepeat(long keycode);
+static CARD32 processautorepeat(OsTimerPtr timer, CARD32 now, pointer arg);
+
+static OsTimerPtr sunTimer = NULL;
+
+/* Map the Solaris keycodes to the "XFree86" keycodes. */
+/*
+ * This doesn't seem right. It probably needs to be dependent on a keyboard
+ * type.
+ */
+static unsigned char map[256] = {
+#if defined(i368) || defined(__i386) || defined(__i386__)
+ KEY_NOTUSED, /* 0 */
+ KEY_Tilde, /* 1 */
+ KEY_1, /* 2 */
+ KEY_2, /* 3 */
+ KEY_3, /* 4 */
+ KEY_4, /* 5 */
+ KEY_5, /* 6 */
+ KEY_6, /* 7 */
+ KEY_7, /* 8 */
+ KEY_8, /* 9 */
+ KEY_9, /* 10 */
+ KEY_0, /* 11 */
+ KEY_Minus, /* 12 */
+ KEY_Equal, /* 13 */
+ 0x7D, /*KEY_P_YEN*/ /* 14 */
+ KEY_BackSpace, /* 15 */
+ KEY_Tab, /* 16 */
+ KEY_Q, /* 17 */
+ KEY_W, /* 18 */
+ KEY_E, /* 19 */
+ KEY_R, /* 20 */
+ KEY_T, /* 21 */
+ KEY_Y, /* 22 */
+ KEY_U, /* 23 */
+ KEY_I, /* 24 */
+ KEY_O, /* 25 */
+ KEY_P, /* 26 */
+ KEY_LBrace, /* 27 */
+ KEY_RBrace, /* 28 */
+ KEY_BSlash, /* 29 */
+ KEY_CapsLock, /* 30 */
+ KEY_A, /* 31 */
+ KEY_S, /* 32 */
+ KEY_D, /* 33 */
+ KEY_F, /* 34 */
+ KEY_G, /* 35 */
+ KEY_H, /* 36 */
+ KEY_J, /* 37 */
+ KEY_K, /* 38 */
+ KEY_L, /* 39 */
+ KEY_SemiColon, /* 40 */
+ KEY_Quote, /* 41 */
+ KEY_UNKNOWN, /* 42 */
+ KEY_Enter, /* 43 */
+ KEY_ShiftL, /* 44 */
+ KEY_Less, /* 45 */
+ KEY_Z, /* 46 */
+ KEY_X, /* 47 */
+ KEY_C, /* 48 */
+ KEY_V, /* 49 */
+ KEY_B, /* 50 */
+ KEY_N, /* 51 */
+ KEY_M, /* 52 */
+ KEY_Comma, /* 53 */
+ KEY_Period, /* 54 */
+ KEY_Slash, /* 55 */
+ KEY_BSlash2, /* 56 */
+ KEY_ShiftR, /* 57 */
+ KEY_LCtrl, /* 58 */
+ KEY_LMeta, /* 59 */
+ KEY_Alt, /* 60 */
+ KEY_Space, /* 61 */
+ KEY_AltLang, /* 62 */
+ KEY_RMeta, /* 63 */
+ KEY_RCtrl, /* 64 */
+ KEY_Menu, /* 65 */
+ KEY_UNKNOWN, /* 66 */
+ KEY_UNKNOWN, /* 67 */
+ KEY_UNKNOWN, /* 68 */
+ KEY_UNKNOWN, /* 69 */
+ KEY_UNKNOWN, /* 70 */
+ KEY_UNKNOWN, /* 71 */
+ KEY_UNKNOWN, /* 72 */
+ KEY_UNKNOWN, /* 73 */
+ KEY_UNKNOWN, /* 74 */
+ KEY_Insert, /* 75 */
+ KEY_Delete, /* 76 */
+ KEY_UNKNOWN, /* 77 */
+ KEY_UNKNOWN, /* 78 */
+ KEY_Left, /* 79 */
+ KEY_Home, /* 80 */
+ KEY_End, /* 81 */
+ KEY_UNKNOWN, /* 82 */
+ KEY_Up, /* 83 */
+ KEY_Down, /* 84 */
+ KEY_PgUp, /* 85 */
+ KEY_PgDown, /* 86 */
+ KEY_UNKNOWN, /* 87 */
+ KEY_UNKNOWN, /* 88 */
+ KEY_Right, /* 89 */
+ KEY_NumLock, /* 90 */
+ KEY_KP_7, /* 91 */
+ KEY_KP_4, /* 92 */
+ KEY_KP_1, /* 93 */
+ KEY_UNKNOWN, /* 94 */
+ KEY_KP_Divide, /* 95 */
+ KEY_KP_8, /* 96 */
+ KEY_KP_5, /* 97 */
+ KEY_KP_2, /* 98 */
+ KEY_KP_0, /* 99 */
+ KEY_KP_Multiply, /* 100 */
+ KEY_KP_9, /* 101 */
+ KEY_KP_6, /* 102 */
+ KEY_KP_3, /* 103 */
+ KEY_KP_Decimal, /* 104 */
+ KEY_KP_Minus, /* 105 */
+ KEY_KP_Plus, /* 106 */
+ KEY_UNKNOWN, /* 107 */
+ KEY_KP_Enter, /* 108 */
+ KEY_UNKNOWN, /* 109 */
+ KEY_Escape, /* 110 */
+ KEY_UNKNOWN, /* 111 */
+ KEY_F1, /* 112 */
+ KEY_F2, /* 113 */
+ KEY_F3, /* 114 */
+ KEY_F4, /* 115 */
+ KEY_F5, /* 116 */
+ KEY_F6, /* 117 */
+ KEY_F7, /* 118 */
+ KEY_F8, /* 119 */
+ KEY_F9, /* 120 */
+ KEY_F10, /* 121 */
+ KEY_F11, /* 122 */
+ KEY_F12, /* 123 */
+ KEY_Print, /* 124 */
+ KEY_ScrollLock, /* 125 */
+ KEY_Pause, /* 126 */
+ KEY_UNKNOWN, /* 127 */
+ KEY_UNKNOWN, /* 128 */
+ KEY_UNKNOWN, /* 129 */
+ KEY_UNKNOWN, /* 130 */
+ KEY_NFER, /* 131 */
+ KEY_XFER, /* 132 */
+ KEY_HKTG, /* 133 */
+ KEY_UNKNOWN, /* 134 */
+#elif defined(sparc) || defined(__sparc__)
+ KEY_UNKNOWN, /* 0x00 */
+ KEY_UNKNOWN, /* 0x01 */
+ KEY_UNKNOWN, /* 0x02 */
+ KEY_UNKNOWN, /* 0x03 */
+ KEY_UNKNOWN, /* 0x04 */
+ KEY_F1, /* 0x05 */
+ KEY_F2, /* 0x06 */
+ KEY_F10, /* 0x07 */
+ KEY_F3, /* 0x08 */
+ KEY_F11, /* 0x09 */
+ KEY_F4, /* 0x0A */
+ KEY_F12, /* 0x0B */
+ KEY_F5, /* 0x0C */
+ KEY_UNKNOWN, /* 0x0D */
+ KEY_F6, /* 0x0E */
+ KEY_UNKNOWN, /* 0x0F */
+ KEY_F7, /* 0x10 */
+ KEY_F8, /* 0x11 */
+ KEY_F9, /* 0x12 */
+ KEY_Alt, /* 0x13 */
+ KEY_Up, /* 0x14 */
+ KEY_Pause, /* 0x15 */
+ KEY_SysReqest, /* 0x16 */
+ KEY_ScrollLock, /* 0x17 */
+ KEY_Left, /* 0x18 */
+ KEY_UNKNOWN, /* 0x19 */
+ KEY_UNKNOWN, /* 0x1A */
+ KEY_Down, /* 0x1B */
+ KEY_Right, /* 0x1C */
+ KEY_Escape, /* 0x1D */
+ KEY_1, /* 0x1E */
+ KEY_2, /* 0x1F */
+ KEY_3, /* 0x20 */
+ KEY_4, /* 0x21 */
+ KEY_5, /* 0x22 */
+ KEY_6, /* 0x23 */
+ KEY_7, /* 0x24 */
+ KEY_8, /* 0x25 */
+ KEY_9, /* 0x26 */
+ KEY_0, /* 0x27 */
+ KEY_Minus, /* 0x28 */
+ KEY_Equal, /* 0x29 */
+ KEY_Tilde, /* 0x2A */
+ KEY_BackSpace, /* 0x2B */
+ KEY_Insert, /* 0x2C */
+ KEY_UNKNOWN, /* 0x2D */
+ KEY_KP_Divide, /* 0x2E */
+ KEY_KP_Multiply, /* 0x2F */
+ KEY_UNKNOWN, /* 0x30 */
+ KEY_UNKNOWN, /* 0x31 */
+ KEY_KP_Decimal, /* 0x32 */
+ KEY_UNKNOWN, /* 0x33 */
+ KEY_Home, /* 0x34 */
+ KEY_Tab, /* 0x35 */
+ KEY_Q, /* 0x36 */
+ KEY_W, /* 0x37 */
+ KEY_E, /* 0x38 */
+ KEY_R, /* 0x39 */
+ KEY_T, /* 0x3A */
+ KEY_Y, /* 0x3B */
+ KEY_U, /* 0x3C */
+ KEY_I, /* 0x3D */
+ KEY_O, /* 0x3E */
+ KEY_P, /* 0x3F */
+ KEY_LBrace, /* 0x40 */
+ KEY_RBrace, /* 0x41 */
+ KEY_Delete, /* 0x42 */
+ KEY_UNKNOWN, /* 0x43 */
+ KEY_KP_7, /* 0x44 */
+ KEY_KP_8, /* 0x45 */
+ KEY_KP_9, /* 0x46 */
+ KEY_KP_Minus, /* 0x47 */
+ KEY_UNKNOWN, /* 0x48 */
+ KEY_UNKNOWN, /* 0x49 */
+ KEY_End, /* 0x4A */
+ KEY_UNKNOWN, /* 0x4B */
+ KEY_LCtrl, /* 0x4C */
+ KEY_A, /* 0x4D */
+ KEY_S, /* 0x4E */
+ KEY_D, /* 0x4F */
+ KEY_F, /* 0x50 */
+ KEY_G, /* 0x51 */
+ KEY_H, /* 0x52 */
+ KEY_J, /* 0x53 */
+ KEY_K, /* 0x54 */
+ KEY_L, /* 0x55 */
+ KEY_SemiColon, /* 0x56 */
+ KEY_Quote, /* 0x57 */
+ KEY_BSlash, /* 0x58 */
+ KEY_Enter, /* 0x59 */
+ KEY_KP_Enter, /* 0x5A */
+ KEY_KP_4, /* 0x5B */
+ KEY_KP_5, /* 0x5C */
+ KEY_KP_6, /* 0x5D */
+ KEY_KP_0, /* 0x5E */
+ KEY_UNKNOWN, /* 0x5F */
+ KEY_PgUp, /* 0x60 */
+ KEY_UNKNOWN, /* 0x61 */
+ KEY_NumLock, /* 0x62 */
+ KEY_ShiftL, /* 0x63 */
+ KEY_Z, /* 0x64 */
+ KEY_X, /* 0x65 */
+ KEY_C, /* 0x66 */
+ KEY_V, /* 0x67 */
+ KEY_B, /* 0x68 */
+ KEY_N, /* 0x69 */
+ KEY_M, /* 0x6A */
+ KEY_Comma, /* 0x6B */
+ KEY_Period, /* 0x6C */
+ KEY_Slash, /* 0x6D */
+ KEY_ShiftR, /* 0x6E */
+ KEY_UNKNOWN, /* 0x6F */
+ KEY_KP_1, /* 0x70 */
+ KEY_KP_2, /* 0x71 */
+ KEY_KP_3, /* 0x72 */
+ KEY_UNKNOWN, /* 0x73 */
+ KEY_UNKNOWN, /* 0x74 */
+ KEY_UNKNOWN, /* 0x75 */
+ KEY_UNKNOWN, /* 0x76 */
+ KEY_CapsLock, /* 0x77 */
+ KEY_LMeta, /* 0x78 */
+ KEY_Space, /* 0x79 */
+ KEY_RMeta, /* 0x7A */
+ KEY_PgDown, /* 0x7B */
+ KEY_UNKNOWN, /* 0x7C */
+ KEY_KP_Plus, /* 0x7D */
+ KEY_UNKNOWN, /* 0x7E */
+ KEY_UNKNOWN, /* 0x7F */
+#endif
+ /* The rest default to KEY_UNKNOWN */
+};
+
+/*
+ * sunPostKbdEvent --
+ * Translate the raw hardware Firm_event into an XEvent, and tell DIX
+ * about it. KeyCode preprocessing and so on is done ...
+ *
+ * Most of the Solaris stuff has whacked Panix/PC98 support in the
+ * interests of simplicity - DWH 8/30/99
+ */
+
+static void
+sunPostKbdEvent(Firm_event *event)
+{
+ Bool down;
+ KeyClassRec *keyc = ((DeviceIntPtr)xf86Info.pKeyboard)->key;
+ Bool updateLeds = FALSE;
+ xEvent kevent;
+ KeySym *keysym;
+ int keycode;
+ static int lockkeys = 0;
+
+ /* Give down a value */
+ if (event->value == VKEY_DOWN)
+ down = TRUE;
+ else
+ down = FALSE;
+
+ /*
+ * and now get some special keysequences
+ */
+
+ keycode = map[event->id];
+
+ if ((ModifierDown(ControlMask | AltMask)) ||
+ (ModifierDown(ControlMask | AltLangMask)))
+ {
+ switch (keycode) {
+ /*
+ * The idea here is to pass the scancode down to a list of registered
+ * routines. There should be some standard conventions for processing
+ * certain keys.
+ */
+
+ case KEY_BackSpace:
+ if (!xf86Info.dontZap) {
+ DGAShutdown();
+ GiveUp(0);
+ }
+ break;
+
+ /* Check grabs */
+ case KEY_KP_Divide:
+ if (!xf86Info.grabInfo.disabled &&
+ xf86Info.grabInfo.allowDeactivate) {
+ if (inputInfo.pointer && inputInfo.pointer->grab != NULL &&
+ inputInfo.pointer->DeactivateGrab)
+ (*inputInfo.pointer->DeactivateGrab)(inputInfo.pointer);
+ if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL &&
+ inputInfo.keyboard->DeactivateGrab)
+ (*inputInfo.keyboard->DeactivateGrab)(inputInfo.keyboard);
+ }
+ break;
+
+ case KEY_KP_Multiply:
+ if (!xf86Info.grabInfo.disabled &&
+ xf86Info.grabInfo.allowClosedown) {
+ ClientPtr pointer, keyboard, server;
+
+ pointer = keyboard = server = NULL;
+ if (inputInfo.pointer && inputInfo.pointer->grab != NULL)
+ pointer =
+ clients[CLIENT_ID(inputInfo.pointer->grab->resource)];
+
+ if (inputInfo.keyboard && inputInfo.keyboard->grab != NULL) {
+ keyboard =
+ clients[CLIENT_ID(inputInfo.keyboard->grab->resource)];
+ if (keyboard == pointer)
+ keyboard = NULL;
+ }
+
+ if ((xf86Info.grabInfo.server.grabstate == SERVER_GRABBED) &&
+ (((server = xf86Info.grabInfo.server.client) == pointer) ||
+ (server == keyboard)))
+ server = NULL;
+
+ if (pointer)
+ CloseDownClient(pointer);
+ if (keyboard)
+ CloseDownClient(keyboard);
+ if (server)
+ CloseDownClient(server);
+ }
+ break;
+
+ case KEY_KP_Minus: /* Keypad - */
+ if (!xf86Info.dontZoom) {
+ if (down)
+ xf86ZoomViewport(xf86Info.currentScreen, -1);
+ return;
+ }
+ break;
+
+ case KEY_KP_Plus: /* Keypad + */
+ if (!xf86Info.dontZoom) {
+ if (down)
+ xf86ZoomViewport(xf86Info.currentScreen, 1);
+ return;
+ }
+ break;
+ }
+ }
+
+ /*
+ * Now map the scancodes to real X-keycodes ...
+ */
+ if (keycode == KEY_NOTUSED) {
+ xf86MsgVerb(X_INFO, 0,
+ "raw code %d mapped to KEY_NOTUSED -- please report\n", event->id);
+ return;
+ }
+ if (keycode == KEY_UNKNOWN) {
+ xf86MsgVerb(X_INFO, 0,
+ "raw code %d mapped to KEY_UNKNOWN -- please report\n", event->id);
+ return;
+ }
+ keycode += MIN_KEYCODE;
+ keysym = keyc->curKeySyms.map +
+ (keyc->curKeySyms.mapWidth *
+ (keycode - keyc->curKeySyms.minKeyCode));
+
+#ifdef XKB
+ if (noXkbExtension)
+#endif
+ {
+ /*
+ * Toggle lock keys.
+ */
+#define CAPSFLAG 0x01
+#define NUMFLAG 0x02
+#define SCROLLFLAG 0x04
+#define MODEFLAG 0x08
+
+ if (down) {
+ /*
+ * Handle the KeyPresses of the lock keys.
+ */
+
+ switch (keysym[0]) {
+
+ case XK_Caps_Lock:
+ if (lockkeys & CAPSFLAG) {
+ lockkeys &= ~CAPSFLAG;
+ return;
+ }
+ lockkeys |= CAPSFLAG;
+ updateLeds = TRUE;
+ xf86Info.capsLock = down;
+ break;
+
+ case XK_Num_Lock:
+ if (lockkeys & NUMFLAG) {
+ lockkeys &= ~NUMFLAG;
+ return;
+ }
+ lockkeys |= NUMFLAG;
+ updateLeds = TRUE;
+ xf86Info.numLock = down;
+ break;
+
+ case XK_Scroll_Lock:
+ if (lockkeys & SCROLLFLAG) {
+ lockkeys &= ~SCROLLFLAG;
+ return;
+ }
+ lockkeys |= SCROLLFLAG;
+ updateLeds = TRUE;
+ xf86Info.scrollLock = down;
+ break;
+ }
+ } else {
+ /*
+ * Handle the releases of the lock keys.
+ */
+
+ switch (keysym[0]) {
+
+ case XK_Caps_Lock:
+ if (lockkeys & CAPSFLAG)
+ return;
+ updateLeds = TRUE;
+ xf86Info.capsLock = down;
+ break;
+
+ case XK_Num_Lock:
+ if (lockkeys & NUMFLAG)
+ return;
+ updateLeds = TRUE;
+ xf86Info.numLock = down;
+ break;
+
+ case XK_Scroll_Lock:
+ if (lockkeys & SCROLLFLAG)
+ return;
+ updateLeds = TRUE;
+ xf86Info.scrollLock = down;
+ break;
+ }
+ }
+
+ if (updateLeds)
+ xf86KbdLeds();
+
+ /*
+ * If this keycode is not a modifier key, and its down initiate the
+ * autorepeate sequence. (Only necessary if not using XKB).
+ *
+ * If its not down, then reset the timer.
+ */
+ if (!keyc->modifierMap[keycode]) {
+ if (down) {
+ startautorepeat(keycode);
+ } else {
+ TimerFree(sunTimer);
+ sunTimer = NULL;
+ }
+ }
+ }
+
+ xf86Info.lastEventTime =
+ kevent.u.keyButtonPointer.time =
+ GetTimeInMillis();
+
+ /*
+ * And now send these prefixes ...
+ * NOTE: There cannot be multiple Mode_Switch keys !!!!
+ */
+
+ ENQUEUE(&kevent, keycode, (down ? KeyPress : KeyRelease), XE_KEYBOARD);
+}
+
+/*
+ * Lets try reading more than one keyboard event at a time in the hopes that
+ * this will be slightly more efficient. Or we could just try the MicroSoft
+ * method, and forget about efficiency. :-)
+ */
+void
+xf86KbdEvents()
+{
+ Firm_event event[64];
+ int nBytes, i;
+
+ /* I certainly hope its not possible to read partial events */
+
+ if ((nBytes = read(xf86Info.kbdFd, (char *)event, sizeof(event))) > 0)
+ {
+ for (i = 0; i < (nBytes / sizeof(Firm_event)); i++)
+ sunPostKbdEvent(&event[i]);
+ }
+}
+
+/*
+ * Autorepeat stuff
+ */
+
+void
+startautorepeat(long keycode)
+{
+ sunTimer = TimerSet(sunTimer, /* Timer */
+ 0, /* Flags */
+ xf86Info.kbdDelay, /* millis */
+ processautorepeat, /* callback */
+ (pointer) keycode); /* arg for timer */
+}
+
+CARD32
+processautorepeat(OsTimerPtr timer, CARD32 now, pointer arg)
+{
+ xEvent kevent;
+ int keycode;
+
+ keycode = (long)arg;
+
+ xf86Info.lastEventTime =
+ kevent.u.keyButtonPointer.time =
+ GetTimeInMillis();
+
+ /*
+ * Repeat a key by faking a KeyRelease, and a KeyPress event in rapid
+ * succession
+ */
+
+ ENQUEUE(&kevent, keycode, KeyRelease, XE_KEYBOARD);
+ ENQUEUE(&kevent, keycode, KeyPress, XE_KEYBOARD);
+
+ /* And return the appropriate value so we get rescheduled */
+ return xf86Info.kbdRate;
+}
diff --git a/hw/xfree86/os-support/solaris/sun_mouse.c b/hw/xfree86/os-support/solaris/sun_mouse.c
new file mode 100644
index 000000000..2e9cee2b1
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_mouse.c
@@ -0,0 +1,322 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_mouse.c,v 1.4 2002/01/25 21:56:21 tsi Exp $ */
+/*
+ * Copyright 1999-2001 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#include "xf86.h"
+#include "xf86_OSlib.h"
+#include "xf86OSmouse.h"
+
+#if defined(__SOL8__) || !defined(i386)
+
+#include "xisb.h"
+#include "mipointer.h"
+#include <sys/vuid_event.h>
+
+/* Names of protocols that are handled internally here. */
+
+static const char *internalNames[] = {
+ "VUID",
+ NULL
+};
+
+typedef struct _VuidMseRec {
+ Firm_event event;
+ unsigned char *buffer;
+} VuidMseRec, *VuidMsePtr;
+
+
+static int vuidMouseProc(DeviceIntPtr pPointer, int what);
+static void vuidReadInput(InputInfoPtr pInfo);
+
+/* This function is called when the protocol is "VUID". */
+static Bool
+vuidPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ MouseDevPtr pMse = pInfo->private;
+ VuidMsePtr pVuidMse;
+
+ pVuidMse = xalloc(sizeof(VuidMseRec));
+ if (pVuidMse == NULL) {
+ xf86Msg(X_ERROR, "%s: cannot allocate VuidMouseRec\n", pInfo->name);
+ xfree(pMse);
+ return FALSE;
+ }
+
+ pMse->protocol = protocol;
+ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
+
+ /* Collect the options, and process the common options. */
+ xf86CollectInputOptions(pInfo, NULL, NULL);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ /* Check if the device can be opened. */
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1) {
+ if (xf86GetAllowMouseOpenFail())
+ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+ else {
+ xf86Msg(X_ERROR, "%s: cannot open input device\n", pInfo->name);
+ xfree(pVuidMse);
+ xfree(pMse);
+ return FALSE;
+ }
+ }
+ pVuidMse->buffer = (unsigned char *)&pVuidMse->event;
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+
+ /* Private structure */
+ pMse->mousePriv = pVuidMse;
+
+ /* Process common mouse options (like Emulate3Buttons, etc). */
+ pMse->CommonOptions(pInfo);
+
+ /* Setup the local procs. */
+ pInfo->device_control = vuidMouseProc;
+ pInfo->read_input = vuidReadInput;
+
+ pInfo->flags |= XI86_CONFIGURED;
+ return TRUE;
+}
+
+static void
+vuidReadInput(InputInfoPtr pInfo)
+{
+ MouseDevPtr pMse;
+ VuidMsePtr pVuidMse;
+ int buttons;
+ int dx = 0, dy = 0, dz = 0, dw = 0;
+ unsigned int n;
+ int c;
+ unsigned char *pBuf;
+
+ pMse = pInfo->private;
+ pVuidMse = pMse->mousePriv;
+ buttons = pMse->lastButtons;
+ XisbBlockDuration(pMse->buffer, -1);
+ pBuf = pVuidMse->buffer;
+ n = 0;
+
+ do {
+ while (n < sizeof(Firm_event) && (c = XisbRead(pMse->buffer)) >= 0) {
+ pBuf[n++] = (unsigned char)c;
+ }
+
+ if (n == 0)
+ return;
+
+ if (n != sizeof(Firm_event)) {
+ xf86Msg(X_WARNING, "%s: incomplete packet, size %d\n",
+ pInfo->name, n);
+ }
+
+ if (pVuidMse->event.id >= BUT_FIRST && pVuidMse->event.id <= BUT_LAST) {
+ /* button */
+ int butnum = pVuidMse->event.id - BUT_FIRST;
+ if (butnum < 3)
+ butnum = 2 - butnum;
+ if (!pVuidMse->event.value)
+ buttons &= ~(1 << butnum);
+ else
+ buttons |= (1 << butnum);
+ } else if (pVuidMse->event.id >= VLOC_FIRST &&
+ pVuidMse->event.id <= VLOC_LAST) {
+ /* axis */
+ int delta = pVuidMse->event.value;
+ switch(pVuidMse->event.id) {
+ case LOC_X_DELTA:
+ dx += delta;
+ break;
+ case LOC_Y_DELTA:
+ dy -= delta;
+ break;
+ }
+ }
+
+ n = 0;
+ if ((c = XisbRead(pMse->buffer)) >= 0) {
+ /* Another packet. Handle it right away. */
+ pBuf[n++] = c;
+ }
+ } while (n != 0);
+
+ pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
+ return;
+}
+
+#define NUMEVENTS 64
+
+static int
+vuidMouseProc(DeviceIntPtr pPointer, int what)
+{
+ InputInfoPtr pInfo;
+ MouseDevPtr pMse;
+ VuidMsePtr pVuidMse;
+ unsigned char map[MSE_MAXBUTTONS + 1];
+ int nbuttons;
+
+ pInfo = pPointer->public.devicePrivate;
+ pMse = pInfo->private;
+ pMse->device = pPointer;
+ pVuidMse = pMse->mousePriv;
+
+ switch (what) {
+ case DEVICE_INIT:
+ pPointer->public.on = FALSE;
+
+ for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
+ map[nbuttons + 1] = nbuttons + 1;
+
+ InitPointerDeviceStruct((DevicePtr)pPointer,
+ map,
+ min(pMse->buttons, MSE_MAXBUTTONS),
+ miPointerGetMotionEvents,
+ pMse->Ctrl,
+ miPointerGetMotionBufferSize());
+
+ /* X valuator */
+ xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
+ xf86InitValuatorDefaults(pPointer, 0);
+ /* Y valuator */
+ xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
+ xf86InitValuatorDefaults(pPointer, 1);
+ xf86MotionHistoryAllocate(pInfo);
+ break;
+
+ case DEVICE_ON:
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd == -1)
+ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+ else {
+ pMse->buffer = XisbNew(pInfo->fd,
+ NUMEVENTS * sizeof(Firm_event));
+ if (!pMse->buffer) {
+ xfree(pMse);
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ } else {
+ int fmt = VUID_FIRM_EVENT;
+ ioctl(pInfo->fd, VUIDSFORMAT, &fmt);
+ xf86FlushInput(pInfo->fd);
+ AddEnabledDevice(pInfo->fd);
+ }
+ }
+ pMse->lastButtons = 0;
+ pMse->emulateState = 0;
+ pPointer->public.on = TRUE;
+ break;
+
+ case DEVICE_OFF:
+ case DEVICE_CLOSE:
+ if (pInfo->fd != -1) {
+ RemoveEnabledDevice(pInfo->fd);
+ if (pMse->buffer) {
+ XisbFree(pMse->buffer);
+ pMse->buffer = NULL;
+ }
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ }
+ pPointer->public.on = FALSE;
+ usleep(300000);
+ break;
+ }
+ return Success;
+}
+
+static Bool
+sunMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+ /* The protocol is guaranteed to be one of the internalNames[] */
+ if (xf86NameCmp(protocol, "VUID") == 0) {
+ return vuidPreInit(pInfo, protocol, flags);
+ }
+ return TRUE;
+}
+
+static const char **
+BuiltinNames(void)
+{
+ return internalNames;
+}
+
+static Bool
+CheckProtocol(const char *protocol)
+{
+ int i;
+
+ for (i = 0; internalNames[i]; i++)
+ if (xf86NameCmp(protocol, internalNames[i]) == 0)
+ return TRUE;
+
+ return FALSE;
+}
+
+static const char *
+DefaultProtocol(void)
+{
+ return "VUID";
+}
+
+static const char *
+SetupAuto(InputInfoPtr pInfo, int *protoPara)
+{
+ return DefaultProtocol();
+}
+
+#else /* __SOL8__ || !i386 */
+
+#undef MSE_MISC
+#define MSE_MISC 0
+
+#endif /* !__SOL8__ && i386 */
+
+static int
+SupportedInterfaces(void)
+{
+ /* XXX This needs to be checked. */
+ return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO | MSE_XPS2 | MSE_MISC;
+}
+
+OSMouseInfoPtr
+xf86OSMouseInit(int flags)
+{
+ OSMouseInfoPtr p;
+
+ p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ if (!p)
+ return NULL;
+ p->SupportedInterfaces = SupportedInterfaces;
+#if defined(__SOL8__) || !defined(i386)
+ p->BuiltinNames = BuiltinNames;
+ p->CheckProtocol = CheckProtocol;
+ p->PreInit = sunMousePreInit;
+ p->DefaultProtocol = DefaultProtocol;
+ p->SetupAuto = SetupAuto;
+#endif
+ return p;
+}
+
diff --git a/hw/xfree86/os-support/solaris/sun_vid.c b/hw/xfree86/os-support/solaris/sun_vid.c
new file mode 100644
index 000000000..2f4b84e99
--- /dev/null
+++ b/hw/xfree86/os-support/solaris/sun_vid.c
@@ -0,0 +1,229 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sunos/sun_vid.c,v 1.3 2002/10/03 02:04:19 tsi Exp $ */
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ *
+ * 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 names of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
+ * SHALL THE COPYRIGHT HOLDERS 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.
+ *
+ */
+
+#ifdef i386
+#define _NEED_SYSI86
+#endif
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+/***************************************************************************/
+/* Video Memory Mapping section */
+/***************************************************************************/
+
+char *apertureDevName = NULL;
+
+Bool
+xf86LinearVidMem(void)
+{
+ int mmapFd;
+
+ if (apertureDevName)
+ return TRUE;
+
+ apertureDevName = "/dev/xsvc";
+ if ((mmapFd = open(apertureDevName, O_RDWR)) < 0)
+ {
+ apertureDevName = "/dev/fbs/aperture";
+ if((mmapFd = open(apertureDevName, O_RDWR)) < 0)
+ {
+ xf86MsgVerb(X_WARNING, 0,
+ "xf86LinearVidMem: failed to open %s (%s)\n",
+ apertureDevName, strerror(errno));
+ xf86MsgVerb(X_WARNING, 0,
+ "xf86LinearVidMem: either /dev/fbs/aperture or /dev/xsvc"
+ " device driver required\n");
+ xf86MsgVerb(X_WARNING, 0,
+ "xf86LinearVidMem: linear memory access disabled\n");
+ apertureDevName = NULL;
+ return FALSE;
+ }
+ }
+ close(mmapFd);
+ return TRUE;
+}
+
+pointer
+xf86MapVidMem(int ScreenNum, int Flags, unsigned long Base, unsigned long Size)
+{
+ pointer base;
+ int fd;
+ char vtname[20];
+
+ /*
+ * Solaris 2.1 x86 SVR4 (10/27/93)
+ * The server must treat the virtual terminal device file as the
+ * standard SVR4 /dev/pmem.
+ *
+ * Using the /dev/vtXX device as /dev/pmem only works for the
+ * A0000-FFFFF region - If we wish you mmap the linear aperture
+ * it requires a device driver.
+ *
+ * So what we'll do is use /dev/vtXX for the A0000-FFFFF stuff, and
+ * try to use the /dev/fbs/aperture or /dev/xsvc driver if the server
+ * tries to mmap anything > FFFFF. Its very very unlikely that the
+ * server will try to mmap anything below FFFFF that can't be handled
+ * by /dev/vtXX.
+ *
+ * DWH - 2/23/94
+ * DWH - 1/31/99 (Gee has it really been 5 years?)
+ *
+ * Solaris 2.8 7/26/99
+ * Use /dev/xsvc for everything
+ *
+ * DWH - 7/26/99 - Solaris8/dev/xsvc changes
+ *
+ * TSI - 2001.09 - SPARC changes
+ */
+
+#if defined(i386) && !defined(__SOL8__)
+ if(Base < 0xFFFFF)
+ sprintf(vtname, "/dev/vt%02d", xf86Info.vtno);
+ else
+#endif
+ {
+ if (!xf86LinearVidMem())
+ FatalError("xf86MapVidMem: no aperture device\n");
+
+ strcpy(vtname, apertureDevName);
+ }
+
+ fd = open(vtname, (Flags & VIDMEM_READONLY) ? O_RDONLY : O_RDWR);
+ if (fd < 0)
+ FatalError("xf86MapVidMem: failed to open %s (%s)\n",
+ vtname, strerror(errno));
+
+ base = mmap(NULL, Size,
+ (Flags & VIDMEM_READONLY) ?
+ PROT_READ : (PROT_READ | PROT_WRITE),
+ MAP_SHARED, fd, (off_t)Base);
+ close(fd);
+ if (base == MAP_FAILED)
+ FatalError("xf86MapVidMem: mmap failure: %s\n",
+ strerror(errno));
+
+ return(base);
+}
+
+/* ARGSUSED */
+void
+xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size)
+{
+ munmap(Base, Size);
+}
+
+/***************************************************************************/
+/* I/O Permissions section */
+/***************************************************************************/
+
+#ifdef i386
+static Bool ExtendedEnabled = FALSE;
+#endif
+
+void
+xf86EnableIO(void)
+{
+#ifdef i386
+ if (ExtendedEnabled)
+ return;
+
+ if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
+ FatalError("xf86EnableIOPorts: Failed to set IOPL for I/O\n");
+
+ ExtendedEnabled = TRUE;
+#endif /* i386 */
+}
+
+void
+xf86DisableIO(void)
+{
+#ifdef i386
+ if(!ExtendedEnabled)
+ return;
+
+ sysi86(SI86V86, V86SC_IOPL, 0);
+
+ ExtendedEnabled = FALSE;
+#endif /* i386 */
+}
+
+
+/***************************************************************************/
+/* Interrupt Handling section */
+/***************************************************************************/
+
+Bool xf86DisableInterrupts(void)
+{
+#ifdef i386
+ if (!ExtendedEnabled && (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0))
+ return FALSE;
+
+#ifdef __GNUC__
+ __asm__ __volatile__("cli");
+#else
+ asm("cli");
+#endif /* __GNUC__ */
+
+ if (!ExtendedEnabled)
+ sysi86(SI86V86, V86SC_IOPL, 0);
+#endif /* i386 */
+
+ return TRUE;
+}
+
+void xf86EnableInterrupts(void)
+{
+#ifdef i386
+ if (!ExtendedEnabled && (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0))
+ return;
+
+#ifdef __GNUC__
+ __asm__ __volatile__("sti");
+#else
+ asm("sti");
+#endif /* __GNUC__ */
+
+ if (!ExtendedEnabled)
+ sysi86(SI86V86, V86SC_IOPL, 0);
+#endif /* i386 */
+}
+
+void
+xf86MapReadSideEffects(int ScreenNum, int Flags, pointer Base,
+ unsigned long Size)
+{
+}
+
+Bool
+xf86CheckMTRR(int ScreenNum)
+{
+ return FALSE;
+}
+
diff --git a/hw/xfree86/os-support/sysv/sysv_mouse.c b/hw/xfree86/os-support/sysv/sysv_mouse.c
new file mode 100644
index 000000000..cfba52c2c
--- /dev/null
+++ b/hw/xfree86/os-support/sysv/sysv_mouse.c
@@ -0,0 +1,60 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/sysv_mouse.c,v 1.3 1999/09/04 13:04:49 dawes Exp $ */
+
+/*
+ * Copyright 1999 by The XFree86 Project, Inc.
+ */
+
+#include "X.h"
+#include "xf86.h"
+#include "xf86Xinput.h"
+#include "xf86OSmouse.h"
+#include "xqueue.h"
+
+static int
+SupportedInterfaces(void)
+{
+ /* XXX Need to check this. */
+ return MSE_SERIAL | MSE_AUTO;
+}
+
+#ifndef ISC
+static const char *internalNames[] = {
+ "Xqueue",
+ NULL
+};
+
+static const char **
+BuiltinNames(void)
+{
+ return internalNames;
+}
+
+static Bool
+CheckProtocol(const char *protocol)
+{
+ int i;
+
+ for (i = 0; internalNames[i]; i++)
+ if (xf86NameCmp(protocol, internalNames[i]) == 0)
+ return TRUE;
+ return FALSE;
+}
+#endif
+
+OSMouseInfoPtr
+xf86OSMouseInit(int flags)
+{
+ OSMouseInfoPtr p;
+
+ p = xcalloc(sizeof(OSMouseInfoRec), 1);
+ if (!p)
+ return NULL;
+ p->SupportedInterfaces = SupportedInterfaces;
+#ifndef ISC
+ p->BuiltinNames = BuiltinNames;
+ p->CheckProtocol = CheckProtocol;
+ p->PreInit = XqueueMousePreInit;
+#endif
+ return p;
+}
+
diff --git a/hw/xfree86/os-support/sysv/xqueue.h b/hw/xfree86/os-support/sysv/xqueue.h
new file mode 100644
index 000000000..2085a3e70
--- /dev/null
+++ b/hw/xfree86/os-support/sysv/xqueue.h
@@ -0,0 +1,8 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sysv/xqueue.h,v 1.1 1999/05/22 08:40:18 dawes Exp $ */
+
+#ifndef _XF86_XQUEUE_H_
+#define _XF86_XQUEUE_H_
+
+Bool XqueueMousePreInit(InputInfoPtr pInfo, const char *protocol, int flags);
+
+#endif
diff --git a/hw/xfree86/os-support/xf86OSKbd.h b/hw/xfree86/os-support/xf86OSKbd.h
new file mode 100644
index 000000000..e63d7759c
--- /dev/null
+++ b/hw/xfree86/os-support/xf86OSKbd.h
@@ -0,0 +1,92 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSKbd.h,v 1.3 2003/02/17 15:11:55 dawes Exp $ */
+
+/*
+ * Copyright (c) 2002 by The XFree86 Project, Inc.
+ * Author: Ivan Pascal.
+ */
+
+#include "xf86Xinput.h"
+
+Bool ATScancode(InputInfoPtr pInfo, int *scanCode);
+
+/* Public interface to OS-specific keyboard support. */
+
+typedef int (*KbdInitProc)(InputInfoPtr pInfo, int what);
+typedef int (*KbdOnProc)(InputInfoPtr pInfo, int what);
+typedef int (*KbdOffProc)(InputInfoPtr pInfo, int what);
+typedef void (*BellProc)(InputInfoPtr pInfo,
+ int loudness, int pitch, int duration);
+typedef void (*SetLedsProc)(InputInfoPtr pInfo, int leds);
+typedef int (*GetLedsProc)(InputInfoPtr pInfo);
+typedef void (*SetKbdRepeatProc)(InputInfoPtr pInfo, char rad);
+typedef void (*KbdGetMappingProc)(InputInfoPtr pInfo,
+ KeySymsPtr pKeySyms, CARD8* pModMap);
+typedef int (*GetSpecialKeyProc)(InputInfoPtr pInfo, int scanCode);
+typedef Bool (*SpecialKeyProc)(InputInfoPtr pInfo,
+ int key, Bool down, int modifiers);
+typedef int (*RemapScanCodeProc)(InputInfoPtr pInfo, int *scanCode);
+typedef Bool (*OpenKeyboardProc)(InputInfoPtr pInfo);
+typedef void (*PostEventProc)(InputInfoPtr pInfo,
+ unsigned int key, Bool down);
+typedef struct {
+ int begin;
+ int end;
+ unsigned char *map;
+} TransMapRec, *TransMapPtr;
+
+typedef struct {
+ KbdInitProc KbdInit;
+ KbdOnProc KbdOn;
+ KbdOffProc KbdOff;
+ BellProc Bell;
+ SetLedsProc SetLeds;
+ GetLedsProc GetLeds;
+ SetKbdRepeatProc SetKbdRepeat;
+ KbdGetMappingProc KbdGetMapping;
+ RemapScanCodeProc RemapScanCode;
+ GetSpecialKeyProc GetSpecialKey;
+ SpecialKeyProc SpecialKey;
+
+ OpenKeyboardProc OpenKeyboard;
+ PostEventProc PostEvent;
+
+ int rate;
+ int delay;
+ int bell_pitch;
+ int bell_duration;
+ Bool autoRepeat;
+ unsigned long leds;
+ unsigned long xledsMask;
+ unsigned long keyLeds;
+ int scanPrefix;
+ Bool vtSwitchSupported;
+ Bool CustomKeycodes;
+ Bool noXkb;
+ Bool isConsole;
+ TransMapPtr scancodeMap;
+ TransMapPtr specialMap;
+
+ /* os specific */
+ pointer private;
+ int kbdType;
+ int consType;
+ int wsKbdType;
+ Bool sunKbd;
+ Bool Panix106;
+
+} KbdDevRec, *KbdDevPtr;
+
+typedef enum {
+ PROT_STD,
+ PROT_XQUEUE,
+ PROT_WSCONS,
+ PROT_USB,
+ PROT_UNKNOWN
+} KbdProtocolId;
+
+typedef struct {
+ const char *name;
+ KbdProtocolId id;
+} KbdProtocolRec;
+
+Bool xf86OSKbdPreInit(InputInfoPtr pInfo);
diff --git a/hw/xfree86/os-support/xf86OSmouse.h b/hw/xfree86/os-support/xf86OSmouse.h
new file mode 100644
index 000000000..a4486b987
--- /dev/null
+++ b/hw/xfree86/os-support/xf86OSmouse.h
@@ -0,0 +1,181 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.20 2002/12/17 20:55:23 dawes Exp $ */
+
+/*
+ * Copyright (c) 1997-1999 by The XFree86 Project, Inc.
+ */
+
+/* Public interface to OS-specific mouse support. */
+
+#ifndef _XF86OSMOUSE_H_
+#define _XF86OSMOUSE_H_
+
+#include "xf86Xinput.h"
+
+/* Mouse interface classes */
+#define MSE_NONE 0x00
+#define MSE_SERIAL 0x01 /* serial port */
+#define MSE_BUS 0x02 /* old bus mouse */
+#define MSE_PS2 0x04 /* standard read-only PS/2 */
+#define MSE_XPS2 0x08 /* extended PS/2 */
+#define MSE_AUTO 0x10 /* auto-detect (PnP) */
+#define MSE_MISC 0x20 /* The OS layer will identify the
+ * specific protocol names that are
+ * supported for this class. */
+
+struct _MouseDevRec;
+
+typedef int (*GetInterfaceTypesProc)(void);
+typedef const char **(*BuiltinNamesProc)(void);
+typedef Bool (*CheckProtocolProc)(const char *protocol);
+typedef Bool (*BuiltinPreInitProc)(InputInfoPtr pInfo, const char *protocol,
+ int flags);
+typedef const char *(*DefaultProtocolProc)(void);
+typedef const char *(*SetupAutoProc)(InputInfoPtr pInfo, int *protoPara);
+typedef void (*SetResProc)(InputInfoPtr pInfo, const char* protocol, int rate,
+ int res);
+typedef void (*checkMovementsProc)(InputInfoPtr,int, int);
+typedef void (*autoProbeProc)(InputInfoPtr, Bool, Bool);
+typedef Bool (*collectDataProc)(struct _MouseDevRec *, unsigned char);
+typedef Bool (*dataGoodProc)(struct _MouseDevRec *);
+
+/*
+ * OSMouseInfoRec is used to pass information from the OSMouse layer to the
+ * OS-independent mouse driver.
+ */
+typedef struct {
+ GetInterfaceTypesProc SupportedInterfaces;
+ BuiltinNamesProc BuiltinNames;
+ CheckProtocolProc CheckProtocol;
+ BuiltinPreInitProc PreInit;
+ DefaultProtocolProc DefaultProtocol;
+ SetupAutoProc SetupAuto;
+ SetResProc SetPS2Res;
+ SetResProc SetBMRes;
+ SetResProc SetMiscRes;
+} OSMouseInfoRec, *OSMouseInfoPtr;
+
+/*
+ * SupportedInterfaces: Returns the mouse interface types that the OS support.
+ * If MSE_MISC is returned, then the BuiltinNames and
+ * CheckProtocol should be set.
+ *
+ * BuiltinNames: Returns the names of the protocols that are fully handled
+ * in the OS-specific code. These are names that don't appear
+ * directly in the main "mouse" driver.
+ *
+ * CheckProtocol: Checks if the protocol name given is supported by the
+ * OS. It should return TRUE for both "builtin" protocols and
+ * protocols of type MSE_MISC that are supported by the OS.
+ *
+ * PreInit: The PreInit function for protocols that are builtin. This
+ * function is passed the protocol name.
+ *
+ * DefaultProtocol: Returns the name of a default protocol that should be used
+ * for the OS when none has been supplied in the config file.
+ * This should only be set when there is a reasonable default.
+ *
+ * SetupAuto: This function can be used to do OS-specific protocol
+ * auto-detection. It returns the name of the detected protocol,
+ * or NULL when detection fails. It may also adjust one or more
+ * of the "protoPara" values for the detected protocol by setting
+ * then to something other than -1.
+ *
+ * SetPS2Res: Set the resolution and sample rate for MSE_PS2 and MSE_XPS2
+ * protocol types.
+ *
+ * SetBMRes: Set the resolution and sample rate for MSE_BM protocol types.
+ *
+ * SetMiscRes: Set the resolution and sample rate for MSE_MISC protocol types.
+ */
+
+extern OSMouseInfoPtr xf86OSMouseInit(int flags);
+
+/*
+ * Mouse device record. This is shared by the mouse driver and the OSMouse
+ * layer.
+ */
+
+typedef void (*PostMseEventProc)(InputInfoPtr pInfo, int buttons,
+ int dx, int dy, int dz, int dw);
+typedef void (*MouseCommonOptProc)(InputInfoPtr pInfo);
+
+typedef struct _MouseDevRec {
+ PtrCtrlProcPtr Ctrl;
+ PostMseEventProc PostEvent;
+ MouseCommonOptProc CommonOptions;
+ DeviceIntPtr device;
+ const char * mseDevice;
+ const char * protocol;
+ int protocolID;
+ int oldProtocolID; /* hack */
+ int class;
+ int mseModel;
+ int baudRate;
+ int oldBaudRate;
+ int sampleRate;
+ int lastButtons;
+ int threshold; /* acceleration */
+ int num;
+ int den;
+ int buttons; /* # of buttons */
+ int emulateState; /* automata state for 2 button mode */
+ Bool emulate3Buttons;
+ Bool emulate3ButtonsSoft;
+ int emulate3Timeout;/* Timeout for 3 button emulation */
+ Bool chordMiddle;
+ Bool flipXY;
+ int invX;
+ int invY;
+ int mouseFlags; /* Flags to Clear after opening
+ * mouse dev */
+ int truebuttons; /* (not used)
+ * Arg to maintain before
+ * emulate3buttons timer callback */
+ int resolution;
+ int negativeZ; /* button mask */
+ int positiveZ; /* button mask */
+ int negativeW; /* button mask */
+ int positiveW; /* button mask */
+ pointer buffer; /* usually an XISBuffer* */
+ int protoBufTail;
+ unsigned char protoBuf[8];
+ unsigned char protoPara[8];
+ unsigned char inSync; /* driver in sync with datastream */
+ pointer mousePriv; /* private area */
+ InputInfoPtr pInfo;
+ int origProtocolID;
+ const char * origProtocol;
+ Bool emulate3Pending;/* timer waiting */
+ CARD32 emulate3Expires;/* time to fire emulation code */
+ Bool emulateWheel;
+ int wheelInertia;
+ int wheelButtonMask;
+ int negativeX; /* Button values. Unlike the Z and */
+ int positiveX; /* W equivalents, these are button */
+ int negativeY; /* values rather than button masks. */
+ int positiveY;
+ int wheelYDistance;
+ int wheelXDistance;
+ Bool autoProbe;
+ checkMovementsProc checkMovements;
+ autoProbeProc autoProbeMouse;
+ collectDataProc collectData;
+ dataGoodProc dataGood;
+ int angleOffset;
+ pointer pDragLock; /* drag lock area */
+} MouseDevRec, *MouseDevPtr;
+
+/* Z axis mapping */
+#define MSE_NOZMAP 0
+#define MSE_MAPTOX -1
+#define MSE_MAPTOY -2
+#define MSE_MAPTOZ -3
+#define MSE_MAPTOW -4
+
+/* Generalize for other axes. */
+#define MSE_NOAXISMAP MSE_NOZMAP
+
+#define MSE_MAXBUTTONS 12
+#define MSE_DFLTBUTTONS 3
+
+#endif /* _XF86OSMOUSE_H_ */
diff --git a/hw/xfree86/os-support/xf86OSpriv.h b/hw/xfree86/os-support/xf86OSpriv.h
new file mode 100644
index 000000000..c3224aeeb
--- /dev/null
+++ b/hw/xfree86/os-support/xf86OSpriv.h
@@ -0,0 +1,27 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSpriv.h,v 1.5 2000/10/28 01:42:24 mvojkovi Exp $ */
+
+#ifndef _XF86OSPRIV_H
+#define _XF86OSPRIV_H
+
+typedef pointer (*MapMemProcPtr)(int, unsigned long, unsigned long, int);
+typedef void (*UnmapMemProcPtr)(int, pointer, unsigned long);
+typedef pointer (*SetWCProcPtr)(int, unsigned long, unsigned long, Bool,
+ MessageType);
+typedef void (*ProtectMemProcPtr)(int, pointer, unsigned long, Bool);
+typedef void (*UndoWCProcPtr)(int, pointer);
+typedef void (*ReadSideEffectsProcPtr)(int, pointer, unsigned long);
+
+typedef struct {
+ Bool initialised;
+ MapMemProcPtr mapMem;
+ UnmapMemProcPtr unmapMem;
+ ProtectMemProcPtr protectMem;
+ SetWCProcPtr setWC;
+ UndoWCProcPtr undoWC;
+ ReadSideEffectsProcPtr readSideEffects;
+ Bool linearSupported;
+} VidMemInfo, *VidMemInfoPtr;
+
+void xf86OSInitVidMem(VidMemInfoPtr);
+
+#endif /* _XF86OSPRIV_H */
diff --git a/hw/xfree86/os-support/xf86_ansic.h b/hw/xfree86/os-support/xf86_ansic.h
new file mode 100644
index 000000000..03fa33417
--- /dev/null
+++ b/hw/xfree86/os-support/xf86_ansic.h
@@ -0,0 +1,352 @@
+/*
+ * Copyright 1997-2000 by The XFree86 Project, 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, and that the names of the above listed copyright holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holders make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS 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.
+ *
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.49.2.1 2003/03/13 04:10:49 tsi Exp $ */
+
+#ifndef _XF86_ANSIC_H
+#define _XF86_ANSIC_H
+
+/* Handle <stdarg.h> */
+
+#ifndef IN_MODULE
+# include <stdarg.h>
+#else /* !IN_MODULE */
+# ifndef __OS2ELF__
+# include <stdarg.h>
+# else /* __OS2ELF__ */
+ /* EMX/gcc_elf under OS/2 does not have native header files */
+# if !defined (_VA_LIST)
+# define _VA_LIST
+ typedef char *va_list;
+# endif
+# define _VA_ROUND(t) ((sizeof (t) + 3) & -4)
+# if !defined (va_start)
+# define va_start(ap,v) ap = (va_list)&v + ((sizeof (v) + 3) & -4)
+# define va_end(ap) (ap = 0, (void)0)
+# define va_arg(ap,t) (ap += _VA_ROUND (t), *(t *)(ap - _VA_ROUND (t)))
+# endif
+# endif /* __OS2ELF__ */
+#endif /* IN_MODULE */
+
+/*
+ * The first set of definitions are required both for modules and
+ * libc_wrapper.c.
+ */
+
+#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
+
+#if !defined(SYSV) && !defined(SVR4) && !defined(Lynx) || defined(SCO)
+#define HAVE_VSSCANF
+#define HAVE_VFSCANF
+#endif
+
+#ifndef NULL
+#if (defined(SVR4) || defined(SYSV)) && !defined(__GNUC__)
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+#ifndef EOF
+#define EOF (-1)
+#endif
+
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+/* <limits.h> stuff */
+#define x_BITSPERBYTE 8
+#define x_BITS(type) (x_BITSPERBYTE * (int)sizeof(type))
+#define x_SHORTBITS x_BITS(short)
+#define x_INTBITS x_BITS(int)
+#define x_LONGBITS x_BITS(long)
+#ifndef SHRT_MIN
+#define SHRT_MIN ((short)(1 << (x_SHORTBITS - 1)))
+#endif
+
+#ifndef FONTMODULE
+#include "misc.h"
+#endif
+#include "xf86_libc.h"
+#ifndef SHRT_MAX
+#define SHRT_MAX ((short)~SHRT_MIN)
+#endif
+#ifndef USHRT_MAX
+#define USHRT_MAX ((unsigned short)~0)
+#endif
+#ifndef MINSHORT
+#define MINSHORT SHRT_MIN
+#endif
+#ifndef MAXSHORT
+#define MAXSHORT SHRT_MAX
+#endif
+#ifndef INT_MIN
+#define INT_MIN (1 << (x_INTBITS - 1))
+#endif
+#ifndef INT_MAX
+#define INT_MAX (~INT_MIN)
+#endif
+#ifndef UINT_MAX
+#define UINT_MAX (~0)
+#endif
+#ifndef MININT
+#define MININT INT_MIN
+#endif
+#ifndef MAXINT
+#define MAXINT INT_MAX
+#endif
+#ifndef LONG_MIN
+#define LONG_MIN ((long)(1 << (x_LONGBITS - 1)))
+#endif
+#ifndef LONG_MAX
+#define LONG_MAX ((long)~LONG_MIN)
+#endif
+#ifndef ULONG_MAX
+#define ULONG_MAX ((unsigned long)~0UL)
+#endif
+#ifndef MINLONG
+#define MINLONG LONG_MIN
+#endif
+#ifndef MAXLONG
+#define MAXLONG LONG_MAX
+#endif
+
+#endif /* XFree86LOADER || NEED_XF86_TYPES */
+
+#if defined(XFree86LOADER) || defined(NEED_XF86_PROTOTYPES)
+/*
+ * ANSI C compilers only.
+ */
+
+/* ANSI C emulation library */
+
+extern void xf86abort(void);
+extern int xf86abs(int);
+extern double xf86acos(double);
+extern double xf86asin(double);
+extern double xf86atan(double);
+extern double xf86atan2(double,double);
+extern double xf86atof(const char*);
+extern int xf86atoi(const char*);
+extern long xf86atol(const char*);
+extern void *xf86bsearch(const void *, const void *, xf86size_t, xf86size_t,
+ int (*)(const void *, const void *));
+extern double xf86ceil(double);
+extern void* xf86calloc(xf86size_t,xf86size_t);
+extern void xf86clearerr(XF86FILE*);
+extern double xf86cos(double);
+extern void xf86exit(int);
+extern double xf86exp(double);
+extern double xf86fabs(double);
+extern int xf86fclose(XF86FILE*);
+extern int xf86feof(XF86FILE*);
+extern int xf86ferror(XF86FILE*);
+extern int xf86fflush(XF86FILE*);
+extern int xf86fgetc(XF86FILE*);
+extern int xf86getc(XF86FILE*);
+extern int xf86fgetpos(XF86FILE*,XF86fpos_t*);
+extern char* xf86fgets(char*,INT32,XF86FILE*);
+extern int xf86finite(double);
+extern double xf86floor(double);
+extern double xf86fmod(double,double);
+extern XF86FILE* xf86fopen(const char*,const char*);
+extern double xf86frexp(double, int*);
+extern int xf86printf(const char*,...);
+extern int xf86fprintf(XF86FILE*,const char*,...);
+extern int xf86fputc(int,XF86FILE*);
+extern int xf86fputs(const char*,XF86FILE*);
+extern xf86size_t xf86fread(void*,xf86size_t,xf86size_t,XF86FILE*);
+extern void xf86free(void*);
+extern XF86FILE* xf86freopen(const char*,const char*,XF86FILE*);
+#if defined(HAVE_VFSCANF) || !defined(NEED_XF86_PROTOTYPES)
+extern int xf86fscanf(XF86FILE*,const char*,...);
+#else
+extern int xf86fscanf(/*XF86FILE*,const char*,char *,char *,char *,char *,
+ char *,char *,char *,char *,char *,char * */);
+#endif
+extern int xf86fseek(XF86FILE*,long,int);
+extern int xf86fsetpos(XF86FILE*,const XF86fpos_t*);
+extern long xf86ftell(XF86FILE*);
+extern xf86size_t xf86fwrite(const void*,xf86size_t,xf86size_t,XF86FILE*);
+extern char* xf86getenv(const char*);
+extern int xf86isalnum(int);
+extern int xf86isalpha(int);
+extern int xf86iscntrl(int);
+extern int xf86isdigit(int);
+extern int xf86isgraph(int);
+extern int xf86islower(int);
+extern int xf86isprint(int);
+extern int xf86ispunct(int);
+extern int xf86isspace(int);
+extern int xf86isupper(int);
+extern int xf86isxdigit(int);
+extern long xf86labs(long);
+extern double xf86ldexp(double,int);
+extern double xf86log(double);
+extern double xf86log10(double);
+extern void* xf86malloc(xf86size_t);
+extern void* xf86memchr(const void*,int,xf86size_t);
+extern int xf86memcmp(const void*,const void*,xf86size_t);
+extern void* xf86memcpy(void*,const void*,xf86size_t);
+extern void* xf86memmove(void*,const void*,xf86size_t);
+extern void* xf86memset(void*,int,xf86size_t);
+extern double xf86modf(double,double*);
+extern void xf86perror(const char*);
+extern double xf86pow(double,double);
+extern void xf86qsort(void*, xf86size_t, xf86size_t,
+ int(*)(const void*, const void*));
+extern void* xf86realloc(void*,xf86size_t);
+extern int xf86remove(const char*);
+extern int xf86rename(const char*,const char*);
+extern void xf86rewind(XF86FILE*);
+extern int xf86setbuf(XF86FILE*,char*);
+extern int xf86setvbuf(XF86FILE*,char*,int,xf86size_t);
+extern double xf86sin(double);
+extern int xf86sprintf(char*,const char*,...);
+extern int xf86snprintf(char*,xf86size_t,const char*,...);
+extern double xf86sqrt(double);
+#if defined(HAVE_VSSCANF) || !defined(NEED_XF86_PROTOTYPES)
+extern int xf86sscanf(char*,const char*,...);
+#else
+extern int xf86sscanf(/*char*,const char*,char *,char *,char *,char *,
+ char *,char *,char *,char *,char *,char * */);
+#endif
+extern char* xf86strcat(char*,const char*);
+extern char* xf86strchr(const char*, int c);
+extern int xf86strcmp(const char*,const char*);
+extern int xf86strcasecmp(const char*,const char*);
+extern char* xf86strcpy(char*,const char*);
+extern xf86size_t xf86strcspn(const char*,const char*);
+extern char* xf86strerror(int);
+extern xf86size_t xf86strlen(const char*);
+extern char* xf86strncat(char *, const char *, xf86size_t);
+extern int xf86strncmp(const char*,const char*,xf86size_t);
+extern int xf86strncasecmp(const char*,const char*,xf86size_t);
+extern char* xf86strncpy(char*,const char*,xf86size_t);
+extern char* xf86strpbrk(const char*,const char*);
+extern char* xf86strrchr(const char*,int);
+extern xf86size_t xf86strspn(const char*,const char*);
+extern char* xf86strstr(const char*,const char*);
+extern double xf86strtod(const char*,char**);
+extern char* xf86strtok(char*,const char*);
+extern long xf86strtol(const char*,char**,int);
+extern unsigned long xf86strtoul(const char*,char**,int);
+extern double xf86tan(double);
+extern XF86FILE* xf86tmpfile(void);
+extern char* xf86tmpnam(char*);
+extern int xf86tolower(int);
+extern int xf86toupper(int);
+extern int xf86ungetc(int,XF86FILE*);
+extern int xf86vfprintf(XF86FILE*,const char*,va_list);
+extern int xf86vsprintf(char*,const char*,va_list);
+extern int xf86vsnprintf(char*,xf86size_t,const char*,va_list);
+
+extern int xf86open(const char*, int,...);
+extern int xf86close(int);
+extern long xf86lseek(int, long, int);
+extern int xf86ioctl(int, unsigned long, pointer);
+extern xf86ssize_t xf86read(int, void *, xf86size_t);
+extern xf86ssize_t xf86write(int, const void *, xf86size_t);
+extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */);
+extern int xf86munmap(void*, xf86size_t);
+extern int xf86stat(const char *, struct xf86stat *);
+extern int xf86fstat(int, struct xf86stat *);
+extern int xf86access(const char *, int);
+extern int xf86errno;
+extern int xf86GetErrno(void);
+
+extern double xf86HUGE_VAL;
+
+extern double xf86hypot(double,double);
+
+/* non-ANSI C functions */
+extern XF86DIR* xf86opendir(const char*);
+extern int xf86closedir(XF86DIR*);
+extern XF86DIRENT* xf86readdir(XF86DIR*);
+extern void xf86rewinddir(XF86DIR*);
+extern void xf86bcopy(const void*,void*,xf86size_t);
+extern int xf86ffs(int);
+extern char* xf86strdup(const char*);
+extern void xf86bzero(void*,unsigned int);
+extern int xf86execl(const char *, const char *, ...);
+extern long xf86fpossize(void);
+extern int xf86chmod(const char *, xf86mode_t);
+extern int xf86chown(const char *, xf86uid_t, xf86gid_t);
+extern xf86uid_t xf86geteuid(void);
+extern xf86gid_t xf86getegid(void);
+extern int xf86getpid(void);
+extern int xf86mknod(const char *, xf86mode_t, xf86dev_t);
+extern int xf86mkdir(const char *, xf86mode_t);
+unsigned int xf86sleep(unsigned int seconds);
+/* sysv IPC */
+extern int xf86shmget(xf86key_t key, int size, int xf86shmflg);
+extern char * xf86shmat(int id, char *addr, int xf86shmflg);
+extern int xf86shmdt(char *addr);
+extern int xf86shmctl(int id, int xf86cmd, pointer buf);
+
+extern int xf86setjmp(xf86jmp_buf env);
+extern int xf86setjmp0(xf86jmp_buf env);
+extern int xf86setjmp1(xf86jmp_buf env, int);
+extern int xf86setjmp1_arg2(void);
+extern int xf86setjmperror(xf86jmp_buf env);
+extern int xf86getjmptype(void);
+extern void xf86longjmp(xf86jmp_buf env, int val);
+#define xf86setjmp_macro(env) \
+ (xf86getjmptype() == 0 ? xf86setjmp0((env)) : \
+ (xf86getjmptype() == 1 ? xf86setjmp1((env), xf86setjmp1_arg2()) : \
+ xf86setjmperror((env))))
+
+#else /* XFree86LOADER || NEED_XF86_PROTOTYPES */
+#include <unistd.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <ctype.h>
+#ifdef HAVE_SYSV_IPC
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#endif
+#include <sys/stat.h>
+#define stat_t struct stat
+#endif /* XFree86LOADER || NEED_XF86_PROTOTYPES */
+
+/*
+ * These things are always required by drivers (but not by libc_wrapper.c),
+ * even for a static server because some OSs don't provide them.
+ */
+
+extern int xf86getpagesize(void);
+extern void xf86usleep(unsigned long);
+extern void xf86getsecs(long *, long *);
+#ifndef DONT_DEFINE_WRAPPERS
+#undef getpagesize
+#define getpagesize() xf86getpagesize()
+#undef usleep
+#define usleep(ul) xf86usleep(ul)
+#undef getsecs
+#define getsecs(a, b) xf86getsecs(a, b)
+#endif
+#endif /* _XF86_ANSIC_H */
diff --git a/hw/xfree86/os-support/xf86_libc.h b/hw/xfree86/os-support/xf86_libc.h
new file mode 100644
index 000000000..b97599ed5
--- /dev/null
+++ b/hw/xfree86/os-support/xf86_libc.h
@@ -0,0 +1,672 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.56 2003/02/22 06:00:39 dawes Exp $ */
+
+
+
+/*
+ * This file is an attempt to make developing code for the new loadable module
+ * architecure simpler. It tries to use macros to hide all libc wrappers so
+ * that all that is needed to "port" a module to this architecture is to
+ * include this one header file
+ *
+ * Revision history:
+ *
+ *
+ * 0.4 Apr 12 1997 add the ANSI defines
+ * 0.3 Feb 24 1997 handle getenv
+ * 0.2 Feb 24 1997 hide few FILE functions
+ * 0.1 Feb 24 1997 hide the trivial functions mem* str*
+ */
+
+#ifndef XF86_LIBC_H
+#define XF86_LIBC_H 1
+
+#include "Xfuncs.h"
+
+/*
+ * The first set of definitions are required both for modules and
+ * libc_wrapper.c.
+ */
+
+#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
+
+/*
+ * First, the new data types
+ *
+ * note: if some pointer is declared "opaque" here, pass it between
+ * xf86* functions only, and don't rely on it having a whatever internal
+ * structure, even if some source file might reveal the existence of
+ * such a structure.
+ */
+typedef void XF86FILE; /* opaque FILE replacement */
+extern XF86FILE* xf86stdin;
+extern XF86FILE* xf86stdout;
+extern XF86FILE* xf86stderr;
+
+typedef void XF86fpos_t; /* opaque fpos_t replacement */
+
+#define _XF86NAMELEN 263 /* enough for a larger filename */
+ /* (divisble by 8) */
+typedef void XF86DIR; /* opaque DIR replacement */
+
+/* Note: the following is POSIX! POSIX only requires the d_name member.
+ * Normal Unix has often a number of other members, but don't rely on that
+ */
+struct _xf86dirent { /* types in struct dirent/direct: */
+ char d_name[_XF86NAMELEN+1]; /* char [MAXNAMLEN]; might be smaller or unaligned */
+};
+typedef struct _xf86dirent XF86DIRENT;
+
+typedef unsigned long xf86size_t;
+typedef signed long xf86ssize_t;
+typedef unsigned long xf86dev_t;
+typedef unsigned int xf86mode_t;
+typedef unsigned int xf86uid_t;
+typedef unsigned int xf86gid_t;
+
+struct xf86stat {
+ xf86dev_t st_rdev; /* This is incomplete, and makes assumptions */
+};
+
+/* sysv IPC */
+typedef int xf86key_t;
+
+/* setjmp/longjmp */
+typedef int xf86jmp_buf[1024];
+
+/* for setvbuf */
+#define XF86_IONBF 1
+#define XF86_IOFBF 2
+#define XF86_IOLBF 3
+
+/* for open (XXX not complete) */
+#define XF86_O_RDONLY 0x0000
+#define XF86_O_WRONLY 0x0001
+#define XF86_O_RDWR 0x0002
+#define XF86_O_CREAT 0x0200
+
+/* for mmap */
+#define XF86_PROT_EXEC 0x0001
+#define XF86_PROT_READ 0x0002
+#define XF86_PROT_WRITE 0x0004
+#define XF86_PROT_NONE 0x0008
+#define XF86_MAP_FIXED 0x0001
+#define XF86_MAP_SHARED 0x0002
+#define XF86_MAP_PRIVATE 0x0004
+#define XF86_MAP_32BIT 0x0040
+#define XF86_MAP_FAILED ((void *)-1)
+
+/* for fseek */
+#define XF86_SEEK_SET 0
+#define XF86_SEEK_CUR 1
+#define XF86_SEEK_END 2
+
+/* for access */
+#define XF86_R_OK 0
+#define XF86_W_OK 1
+#define XF86_X_OK 2
+#define XF86_F_OK 3
+
+/* for chmod */
+#define XF86_S_ISUID 04000 /* set user ID on execution */
+#define XF86_S_ISGID 02000 /* set group ID on execution */
+#define XF86_S_ISVTX 01000 /* sticky bit */
+#define XF86_S_IRUSR 00400 /* read by owner */
+#define XF86_S_IWUSR 00200 /* write by owner */
+#define XF86_S_IXUSR 00100 /* execute/search by owner */
+#define XF86_S_IRGRP 00040 /* read by group */
+#define XF86_S_IWGRP 00020 /* write by group */
+#define XF86_S_IXGRP 00010 /* execute/search by group */
+#define XF86_S_IROTH 00004 /* read by others */
+#define XF86_S_IWOTH 00002 /* write by others */
+#define XF86_S_IXOTH 00001 /* execute/search by others */
+
+/* for mknod */
+#define XF86_S_IFREG 0010000
+#define XF86_S_IFCHR 0020000
+#define XF86_S_IFBLK 0040000
+#define XF86_S_IFIFO 0100000
+
+/*
+ * errno values
+ * They start at 1000 just so they don't match real errnos at all
+ */
+#define xf86_UNKNOWN 1000
+#define xf86_EACCES 1001
+#define xf86_EAGAIN 1002
+#define xf86_EBADF 1003
+#define xf86_EEXIST 1004
+#define xf86_EFAULT 1005
+#define xf86_EINTR 1006
+#define xf86_EINVAL 1007
+#define xf86_EISDIR 1008
+#define xf86_ELOOP 1009
+#define xf86_EMFILE 1010
+#define xf86_ENAMETOOLONG 1011
+#define xf86_ENFILE 1012
+#define xf86_ENOENT 1013
+#define xf86_ENOMEM 1014
+#define xf86_ENOSPC 1015
+#define xf86_ENOTDIR 1016
+#define xf86_EPIPE 1017
+#define xf86_EROFS 1018
+#define xf86_ETXTBSY 1019
+#define xf86_ENOTTY 1020
+#define xf86_ENOSYS 1021
+#define xf86_EBUSY 1022
+#define xf86_ENODEV 1023
+#define xf86_EIO 1024
+
+/* sysv IPV */
+/* xf86shmget() */
+#define XF86IPC_CREAT 01000
+#define XF86IPC_EXCL 02000
+#define XF86IPC_NOWAIT 04000
+#define XF86SHM_R 0400
+#define XF86SHM_W 0200
+#define XF86IPC_PRIVATE ((xf86key_t)0)
+/* xf86shmat() */
+#define XF86SHM_RDONLY 010000 /* attach read-only else read-write */
+#define XF86SHM_RND 020000 /* round attach address to SHMLBA */
+#define XF86SHM_REMAP 040000 /* take-over region on attach */
+/* xf86shmclt() */
+#define XF86IPC_RMID 0
+
+#endif /* defined(XFree86LOADER) || defined(NEED_XF86_TYPES) */
+
+/*
+ * the rest of this file should only be included for code that is supposed
+ * to go into modules
+ */
+
+#if defined(XFree86LOADER) && !defined(DONT_DEFINE_WRAPPERS)
+
+#undef abort
+#define abort() xf86abort()
+#undef abs
+#define abs(i) xf86abs(i)
+#undef acos
+#define acos(d) xf86acos(d)
+#undef asin
+#define asin(d) xf86asin(d)
+#undef atan
+#define atan(d) xf86atan(d)
+#undef atan2
+#define atan2(d1,d2) xf86atan2(d1,d2)
+#undef atof
+#define atof(ccp) xf86atof(ccp)
+#undef atoi
+#define atoi(ccp) xf86atoi(ccp)
+#undef atol
+#define atol(ccp) xf86atol(ccp)
+#undef bsearch
+#define bsearch(a,b,c,d,e) xf86bsearch(a,b,c,d,e)
+#undef ceil
+#define ceil(d) xf86ceil(d)
+#undef calloc
+#define calloc(I1,I2) xf86calloc(I1,I2)
+#undef clearerr
+#define clearerr(FP) xf86clearerr(FP)
+#undef cos
+#define cos(d) xf86cos(d)
+#undef exit
+#define exit(i) xf86exit(i)
+#undef exp
+#define exp(d) xf86exp(d)
+#undef fabs
+#define fabs(d) xf86fabs(d)
+#undef fclose
+#define fclose(FP) xf86fclose(FP)
+#undef feof
+#define feof(FP) xf86feof(FP)
+#undef ferror
+#define ferror(FP) xf86ferror(FP)
+#undef fflush
+#define fflush(FP) xf86fflush(FP)
+#undef fgetc
+#define fgetc(FP) xf86fgetc(FP)
+#undef getc
+#define getc(FP) xf86getc(FP)
+#undef fgetpos
+#define fgetpos(FP,fpp) xf86fgetpos(FP,fpp)
+#undef fgets
+#define fgets(cp,i,FP) xf86fgets(cp,i,FP)
+#undef finite
+#define finite(d) xf86finite(d)
+#undef floor
+#define floor(d) xf86floor(d)
+#undef fmod
+#define fmod(d1,d2) xf86fmod(d1,d2)
+#undef fopen
+#define fopen(ccp1,ccp2) xf86fopen(ccp1,ccp2)
+#undef printf
+#define printf xf86printf
+#undef fprintf
+#define fprintf xf86fprintf
+#undef fputc
+#define fputc(i,FP) xf86fputc(i,FP)
+#undef fputs
+#define fputs(ccp,FP) xf86fputs(ccp,FP)
+#undef fread
+#define fread(vp,I1,I2,FP) xf86fread(vp,I1,I2,FP)
+#undef free
+#define free(vp) xf86free(vp)
+#undef freopen
+#define freopen(ccp1,ccp2,FP) xf86freopen(ccp1,ccp2,FP)
+#undef frexp
+#define frexp(x,exp) xf86frexp(x,exp)
+#undef fscanf
+#define fscanf xf86fscanf
+#undef fseek
+#define fseek(FP,l,i) xf86fseek(FP,l,i)
+#undef fsetpos
+#define fsetpos(FP,cfpp) xf86fsetpos(FP,cfpp)
+#undef ftell
+#define ftell(FP) xf86ftell(FP)
+#undef fwrite
+#define fwrite(cvp,I1,I2,FP) xf86fwrite(cvp,I1,I2,FP)
+#undef getenv
+#define getenv(ccp) xf86getenv(ccp)
+#undef isalnum
+#define isalnum(i) xf86isalnum(i)
+#undef isalpha
+#define isalpha(i) xf86isalpha(i)
+#undef iscntrl
+#define iscntrl(i) xf86iscntrl(i)
+#undef isdigit
+#define isdigit(i) xf86isdigit(i)
+#undef isgraph
+#define isgraph(i) xf86isgraph(i)
+#undef islower
+#define islower(i) xf86islower(i)
+#undef isprint
+#define isprint(i) xf86isprint(i)
+#undef ispunct
+#define ispunct(i) xf86ispunct(i)
+#undef isspace
+#define isspace(i) xf86isspace(i)
+#undef isupper
+#define isupper(i) xf86isupper(i)
+#undef isxdigit
+#define isxdigit(i) xf86isxdigit(i)
+#undef labs
+#define labs(l) xf86labs(l)
+#undef ldexp
+#define ldexp(x, exp) xf86ldexp(x, exp)
+#undef log
+#define log(d) xf86log(d)
+#undef log10
+#define log10(d) xf86log10(d)
+#undef malloc
+#define malloc(I) xf86malloc(I)
+#undef memchr
+#define memchr(cvp,i,I) xf86memchr(cvp,i,I)
+#undef memcmp
+#define memcmp(cvp1,cvp2,I) xf86memcmp(cvp1,cvp2,I)
+#undef memcpy
+#define memcpy(vp,cvp,I) xf86memcpy(vp,cvp,I)
+#undef memmove
+#define memmove(vp,cvp,I) xf86memmove(vp,cvp,I)
+#undef memset
+#define memset(vp,int,I) xf86memset(vp,int,I)
+#undef modf
+#define modf(d,dp) xf86modf(d,dp)
+#undef perror
+#define perror(ccp) xf86perror(ccp)
+#undef pow
+#define pow(d1,d2) xf86pow(d1,d2)
+#undef realloc
+#define realloc(vp,I) xf86realloc(vp,I)
+#undef remove
+#define remove(ccp) xf86remove(ccp)
+#undef rename
+#define rename(ccp1,ccp2) xf86rename(ccp1,ccp2)
+#undef rewind
+#define rewind(FP) xf86rewind(FP)
+#undef setbuf
+#define setbuf(FP,cp) xf86setbuf(FP,cp)
+#undef setvbuf
+#define setvbuf(FP,cp,i,I) xf86setvbuf(FP,cp,i,I)
+#undef sin
+#define sin(d) xf86sin(d)
+#undef snprintf
+#define snprintf xf86snprintf
+#undef sprintf
+#define sprintf xf86sprintf
+#undef sqrt
+#define sqrt(d) xf86sqrt(d)
+#undef sscanf
+#define sscanf xf86sscanf
+#undef strcat
+#define strcat(cp,ccp) xf86strcat(cp,ccp)
+#undef strcmp
+#define strcmp(ccp1,ccp2) xf86strcmp(ccp1,ccp2)
+#undef strcasecmp
+#define strcasecmp(ccp1,ccp2) xf86strcasecmp(ccp1,ccp2)
+#undef strcpy
+#define strcpy(cp,ccp) xf86strcpy(cp,ccp)
+#undef strcspn
+#define strcspn(ccp1,ccp2) xf86strcspn(ccp1,ccp2)
+#undef strerror
+#define strerror(i) xf86strerror(i)
+#undef strlen
+#define strlen(ccp) xf86strlen(ccp)
+#undef strncmp
+#define strncmp(ccp1,ccp2,I) xf86strncmp(ccp1,ccp2,I)
+#undef strncasecmp
+#define strncasecmp(ccp1,ccp2,I) xf86strncasecmp(ccp1,ccp2,I)
+#undef strncpy
+#define strncpy(cp,ccp,I) xf86strncpy(cp,ccp,I)
+#undef strpbrk
+#define strpbrk(ccp1,ccp2) xf86strpbrk(ccp1,ccp2)
+#undef strchr
+#define strchr(ccp,i) xf86strchr(ccp,i)
+#undef strrchr
+#define strrchr(ccp,i) xf86strrchr(ccp,i)
+#undef strspn
+#define strspn(ccp1,ccp2) xf86strspn(ccp1,ccp2)
+#undef strstr
+#define strstr(ccp1,ccp2) xf86strstr(ccp1,ccp2)
+#undef srttod
+#define strtod(ccp,cpp) xf86strtod(ccp,cpp)
+#undef strtok
+#define strtok(cp,ccp) xf86strtok(cp,ccp)
+#undef strtol
+#define strtol(ccp,cpp,i) xf86strtol(ccp,cpp,i)
+#undef strtoul
+#define strtoul(ccp,cpp,i) xf86strtoul(ccp,cpp,i)
+#undef tan
+#define tan(d) xf86tan(d)
+#undef tmpfile
+#define tmpfile() xf86tmpfile()
+#undef tolower
+#define tolower(i) xf86tolower(i)
+#undef toupper
+#define toupper(i) xf86toupper(i)
+#undef ungetc
+#define ungetc(i,FP) xf86ungetc(i,FP)
+#undef vfprinf
+#define vfprintf xf86vfprintf
+#undef vsnprintf
+#define vsnprintf xf86vsnprintf
+#undef vsprintf
+#define vsprintf xf86vsprintf
+/* XXX Disable assert as if NDEBUG was defined */
+/* Some X headers defined this away too */
+#undef assert
+#define assert(a) ((void)0)
+#undef HUGE_VAL
+#define HUGE_VAL xf86HUGE_VAL
+
+#undef hypot
+#define hypot(x,y) xf86hypot(x,y)
+
+#undef qsort
+#define qsort(b, n, s, f) xf86qsort(b, n, s, f)
+
+/* non-ANSI C functions */
+#undef opendir
+#define opendir(cp) xf86opendir(cp)
+#undef closedir
+#define closedir(DP) xf86closedir(DP)
+#undef readdir
+#define readdir(DP) xf86readdir(DP)
+#undef rewinddir
+#define rewinddir(DP) xf86rewinddir(DP)
+#undef bcopy
+#define bcopy(vp,cvp,I) xf86memmove(cvp,vp,I)
+#undef ffs
+#define ffs(i) xf86ffs(i)
+#undef strdup
+#define strdup(ccp) xf86strdup(ccp)
+#undef bzero
+#define bzero(vp,ui) xf86bzero(vp,ui)
+#undef execl
+#define execl xf86execl
+#undef chmod
+#define chmod(a,b) xf86chmod(a,b)
+#undef chown
+#define chown(a,b,c) xf86chown(a,b,c)
+#undef geteuid
+#define geteuid xf86geteuid
+#undef getegid
+#define getegid xf86getegid
+#undef getpid
+#define getpid xf86getpid
+#undef mknod
+#define mknod(a,b,c) xf86mknod(a,b,c)
+#undef sleep
+#define sleep(a) xf86sleep(a)
+#undef mkdir
+#define mkdir(a,b) xf86mkdir(a,b)
+#undef getpagesize
+#define getpagesize xf86getpagesize
+#undef shmget
+#define shmget(a,b,c) xf86shmget(a,b,c)
+#undef shmat
+#define shmat(a,b,c) xf86shmat(a,b,c)
+#undef shmdt
+#define shmdt(a) xf86shmdt(a)
+#undef shmctl
+#define shmctl(a,b,c) xf86shmctl(a,b,c)
+
+#undef S_ISUID
+#define S_ISUID XF86_S_ISUID
+#undef S_ISGID
+#define S_ISGID XF86_S_ISGID
+#undef S_ISVTX
+#define S_ISVTX XF86_S_ISVTX
+#undef S_IRUSR
+#define S_IRUSR XF86_S_IRUSR
+#undef S_IWUSR
+#define S_IWUSR XF86_S_IWUSR
+#undef S_IXUSR
+#define S_IXUSR XF86_S_IXUSR
+#undef S_IRGRP
+#define S_IRGRP XF86_S_IRGRP
+#undef S_IWGRP
+#define S_IWGRP XF86_S_IWGRP
+#undef S_IXGRP
+#define S_IXGRP XF86_S_IXGRP
+#undef S_IROTH
+#define S_IROTH XF86_S_IROTH
+#undef S_IWOTH
+#define S_IWOTH XF86_S_IWOTH
+#undef S_IXOTH
+#define S_IXOTH XF86_S_IXOTH
+#undef S_IFREG
+#define S_IFREG XF86_S_IFREG
+#undef S_IFCHR
+#define S_IFCHR XF86_S_IFCHR
+#undef S_IFBLK
+#define S_IFBLK XF86_S_IFBLK
+#undef S_IFIFO
+#define S_IFIFO XF86_S_IFIFO
+
+/* some types */
+#undef FILE
+#define FILE XF86FILE
+#undef fpos_t
+#define fpos_t XF86fpos_t
+#undef DIR
+#define DIR XF86DIR
+#undef DIRENT
+#define DIRENT XF86DIRENT
+#undef size_t
+#define size_t xf86size_t
+#undef ssize_t
+#define ssize_t xf86ssize_t
+#undef dev_t
+#define dev_t xf86dev_t
+#undef mode_t
+#define mode_t xf86mode_t
+#undef uid_t
+#define uid_t xf86uid_t
+#undef gid_t
+#define gid_t xf86gid_t
+#undef stat_t
+#define stat_t struct xf86stat
+
+#undef ulong
+#define ulong unsigned long
+
+/*
+ * There should be no need to #undef any of these. If they are already
+ * defined it is because some illegal header has been included.
+ */
+
+/* some vars */
+#undef stdin
+#define stdin xf86stdin
+#undef stdout
+#define stdout xf86stdout
+#undef stderr
+#define stderr xf86stderr
+
+#undef SEEK_SET
+#define SEEK_SET XF86_SEEK_SET
+#undef SEEK_CUR
+#define SEEK_CUR XF86_SEEK_CUR
+#undef SEEK_END
+#define SEEK_END XF86_SEEK_END
+
+/*
+ * XXX Basic I/O functions BAD,BAD,BAD!
+ */
+#define open xf86open
+#define close(a) xf86close(a)
+#define lseek(a,b,c) xf86lseek(a,b,c)
+#define ioctl(a,b,c) xf86ioctl(a,b,c)
+#define read(a,b,c) xf86read(a,b,c)
+#define write(a,b,c) xf86write(a,b,c)
+#define mmap(a,b,c,d,e,f) xf86mmap(a,b,c,d,e,f)
+#define munmap(a,b) xf86munmap(a,b)
+#define stat(a,b) xf86stat(a,b)
+#define fstat(a,b) xf86fstat(a,b)
+#define access(a,b) xf86access(a,b)
+#undef O_RDONLY
+#define O_RDONLY XF86_O_RDONLY
+#undef O_WRONLY
+#define O_WRONLY XF86_O_WRONLY
+#undef O_RDWR
+#define O_RDWR XF86_O_RDWR
+#undef O_CREAT
+#define O_CREAT XF86_O_CREAT
+#undef PROT_EXEC
+#define PROT_EXEC XF86_PROT_EXEC
+#undef PROT_READ
+#define PROT_READ XF86_PROT_READ
+#undef PROT_WRITE
+#define PROT_WRITE XF86_PROT_WRITE
+#undef PROT_NONE
+#define PROT_NONE XF86_PROT_NONE
+#undef MAP_FIXED
+#define MAP_FIXED XF86_MAP_FIXED
+#undef MAP_SHARED
+#define MAP_SHARED XF86_MAP_SHARED
+#undef MAP_PRIVATE
+#define MAP_PRIVATE XF86_MAP_PRIVATE
+#undef MAP_FAILED
+#define MAP_FAILED XF86_MAP_FAILED
+#undef R_OK
+#define R_OK XF86_R_OK
+#undef W_OK
+#define W_OK XF86_W_OK
+#undef X_OK
+#define X_OK XF86_X_OK
+#undef F_OK
+#define F_OK XF86_F_OK
+#undef errno
+#define errno xf86errno
+#undef putchar
+#define putchar(i) xf86fputc(i, xf86stdout)
+#undef puts
+#define puts(s) xf86fputs(s, xf86stdout)
+
+#undef EACCES
+#define EACCES xf86_EACCES
+#undef EAGAIN
+#define EAGAIN xf86_EAGAIN
+#undef EBADF
+#define EBADF xf86_EBADF
+#undef EEXIST
+#define EEXIST xf86_EEXIST
+#undef EFAULT
+#define EFAULT xf86_EFAULT
+#undef EINTR
+#define EINTR xf86_EINTR
+#undef EINVAL
+#define EINVAL xf86_EINVAL
+#undef EISDIR
+#define EISDIR xf86_EISDIR
+#undef ELOOP
+#define ELOOP xf86_ELOOP
+#undef EMFILE
+#define EMFILE xf86_EMFILE
+#undef ENAMETOOLONG
+#define ENAMETOOLONG xf86_ENAMETOOLONG
+#undef ENFILE
+#define ENFILE xf86_ENFILE
+#undef ENOENT
+#define ENOENT xf86_ENOENT
+#undef ENOMEM
+#define ENOMEM xf86_ENOMEM
+#undef ENOSPC
+#define ENOSPC xf86_ENOSPC
+#undef ENOTDIR
+#define ENOTDIR xf86_ENOTDIR
+#undef EPIPE
+#define EPIPE xf86_EPIPE
+#undef EROFS
+#define EROFS xf86_EROFS
+#undef ETXTBSY
+#define ETXTBSY xf86_ETXTBSY
+#undef ENOTTY
+#define ENOTTY xf86_ENOTTY
+#undef ENOSYS
+#define ENOSYS xf86_ENOSYS
+#undef EBUSY
+#define EBUSY xf86_EBUSY
+#undef ENODEV
+#define ENODEV xf86_ENODEV
+#undef EIO
+#define EIO xf86_EIO
+
+/* IPC stuff */
+#undef SHM_RDONLY
+#define SHM_RDONLY XF86SHM_RDONLY
+#undef SHM_RND
+#define SHM_RND XF86SHM_RND
+#undef SHM_REMAP
+#define SHM_REMAP XF86SHM_REMAP
+#undef IPC_RMID
+#define IPC_RMID XF86IPC_RMID
+#undef IPC_CREAT
+#define IPC_CREAT XF86IPC_CREAT
+#undef IPC_EXCL
+#define IPC_EXCL XF86IPC_EXCL
+#undef PC_NOWAIT
+#define IPC_NOWAIT XF86IPC_NOWAIT
+#undef SHM_R
+#define SHM_R XF86SHM_R
+#undef SHM_W
+#define SHM_W XF86SHM_W
+#undef IPC_PRIVATE
+#define IPC_PRIVATE XF86IPC_PRIVATE
+
+/* Some ANSI macros */
+#undef FILENAME_MAX
+#define FILENAME_MAX 1024
+
+#endif /* XFree86LOADER && !DONT_DEFINE_WRAPPERS */
+
+#if defined(XFree86LOADER) && \
+ (!defined(DONT_DEFINE_WRAPPERS) || defined(DEFINE_SETJMP_WRAPPERS))
+#undef setjmp
+#define setjmp(a) xf86setjmp_macro(a)
+#undef longjmp
+#define longjmp(a,b) xf86longjmp(a,b)
+#undef jmp_buf
+#define jmp_buf xf86jmp_buf
+#endif
+
+#endif /* XF86_LIBC_H */
diff --git a/hw/xfree86/parser/Configint.h b/hw/xfree86/parser/Configint.h
new file mode 100644
index 000000000..43605dac3
--- /dev/null
+++ b/hw/xfree86/parser/Configint.h
@@ -0,0 +1,195 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Configint.h,v 1.20 2002/03/04 16:11:06 dawes Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/*
+ * These definitions are used through out the configuration file parser, but
+ * they should not be visible outside of the parser.
+ */
+
+#ifndef _Configint_h_
+#define _Configint_h_
+
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include "xf86Parser.h"
+
+typedef struct
+{
+ int num; /* returned number */
+ char *str; /* private copy of the return-string */
+ double realnum; /* returned number as a real */
+}
+LexRec, *LexPtr;
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+#include "configProcs.h"
+#include <stdlib.h>
+#define xf86confmalloc malloc
+#define xf86confrealloc realloc
+#define xf86confcalloc calloc
+#define xf86conffree free
+
+#define TestFree(a) if (a) { xf86conffree (a); a = NULL; }
+
+#define parsePrologue(typeptr,typerec) typeptr ptr; \
+if( (ptr=(typeptr)xf86confcalloc(1,sizeof(typerec))) == NULL ) { return NULL; } \
+memset(ptr,0,sizeof(typerec));
+
+#define parsePrologueVoid(typeptr,typerec) int token; typeptr ptr; \
+if( (ptr=(typeptr)xf86confcalloc(1,sizeof(typerec))) == NULL ) { return; } \
+memset(ptr,0,sizeof(typerec));
+
+#define HANDLE_RETURN(f,func)\
+if ((ptr->f=func) == NULL)\
+{\
+ CLEANUP (ptr);\
+ return (NULL);\
+}
+
+#define HANDLE_LIST(field,func,type)\
+{\
+type p = func ();\
+if (p == NULL)\
+{\
+ CLEANUP (ptr);\
+ return (NULL);\
+}\
+else\
+{\
+ ptr->field = (type) xf86addListItem ((glp) ptr->field, (glp) p);\
+}\
+}
+
+#define Error(a,b) do { \
+ xf86parseError (a, b); CLEANUP (ptr); return NULL; \
+ } while (0)
+
+/*
+ * These are defines for error messages to promote consistency.
+ * error messages are preceded by the line number, section and file name,
+ * so these messages should be about the specific keyword and syntax in error.
+ * To help limit namespace polution, end each with _MSG.
+ * limit messages to 70 characters if possible.
+ */
+
+#define BAD_OPTION_MSG \
+"The Option keyword requires 1 or 2 quoted strings to follow it."
+#define INVALID_KEYWORD_MSG \
+"\"%s\" is not a valid keyword in this section."
+#define INVALID_SECTION_MSG \
+"\"%s\" is not a valid section name."
+#define UNEXPECTED_EOF_MSG \
+"Unexpected EOF. Missing EndSection keyword?"
+#define QUOTE_MSG \
+"The %s keyword requires a quoted string to follow it."
+#define NUMBER_MSG \
+"The %s keyword requires a number to follow it."
+#define POSITIVE_INT_MSG \
+"The %s keyword requires a positive integer to follow it."
+#define ZAXISMAPPING_MSG \
+"The ZAxisMapping keyword requires 2 positive numbers or X or Y to follow it."
+#define AUTOREPEAT_MSG \
+"The AutoRepeat keyword requires 2 numbers (delay and rate) to follow it."
+#define XLEDS_MSG \
+"The XLeds keyword requries one or more numbers to follow it."
+#define DACSPEED_MSG \
+"The DacSpeed keyword must be followed by a list of up to %d numbers."
+#define DISPLAYSIZE_MSG \
+"The DisplaySize keyword must be followed by the width and height in mm."
+#define HORIZSYNC_MSG \
+"The HorizSync keyword must be followed by a list of numbers or ranges."
+#define VERTREFRESH_MSG \
+"The VertRefresh keyword must be followed by a list of numbers or ranges."
+#define VIEWPORT_MSG \
+"The Viewport keyword must be followed by an X and Y value."
+#define VIRTUAL_MSG \
+"The Virtual keyword must be followed by a width and height value."
+#define WEIGHT_MSG \
+"The Weight keyword must be followed by red, green and blue values."
+#define BLACK_MSG \
+"The Black keyword must be followed by red, green and blue values."
+#define WHITE_MSG \
+"The White keyword must be followed by red, green and blue values."
+#define SCREEN_MSG \
+"The Screen keyword must be followed by an optional number, a screen name\n" \
+"\tin quotes, and optional position/layout information."
+#define INVALID_SCR_MSG \
+"Invalid Screen line."
+#define INPUTDEV_MSG \
+"The InputDevice keyword must be followed by an input device name in quotes."
+#define INACTIVE_MSG \
+"The Inactive keyword must be followed by a Device name in quotes."
+#define UNDEFINED_SCREEN_MSG \
+"Undefined Screen \"%s\" referenced by ServerLayout \"%s\"."
+#define UNDEFINED_MONITOR_MSG \
+"Undefined Monitor \"%s\" referenced by Screen \"%s\"."
+#define UNDEFINED_MODES_MSG \
+"Undefined Modes Section \"%s\" referenced by Monitor \"%s\"."
+#define UNDEFINED_DEVICE_MSG \
+"Undefined Device \"%s\" referenced by Screen \"%s\"."
+#define UNDEFINED_ADAPTOR_MSG \
+"Undefined VideoAdaptor \"%s\" referenced by Screen \"%s\"."
+#define ADAPTOR_REF_TWICE_MSG \
+"VideoAdaptor \"%s\" already referenced by Screen \"%s\"."
+#define UNDEFINED_DEVICE_LAY_MSG \
+"Undefined Device \"%s\" referenced by ServerLayout \"%s\"."
+#define UNDEFINED_INPUT_MSG \
+"Undefined InputDevice \"%s\" referenced by ServerLayout \"%s\"."
+#define NO_IDENT_MSG \
+"This section must have an Identifier line."
+#define ONLY_ONE_MSG \
+"This section must have only one of either %s line."
+#define UNDEFINED_DRIVER_MSG \
+"Device section \"%s\" must have a Driver line."
+#define UNDEFINED_INPUTDRIVER_MSG \
+"InputDevice section \"%s\" must have a Driver line."
+#define INVALID_GAMMA_MSG \
+"gamma correction value(s) expected\n either one value or three r/g/b values."
+#define GROUP_MSG \
+"The Group keyword must be followed by either a group name in quotes or\n" \
+"\ta numerical group id."
+#define MULTIPLE_MSG \
+"Multiple \"%s\" lines."
+
+/* Warning messages */
+#define OBSOLETE_MSG \
+"Ignoring obsolete keyword \"%s\"."
+#define MOVED_TO_FLAGS_MSG \
+"Keyword \"%s\" is now an Option flag in the ServerFlags section."
+
+#endif /* _Configint_h_ */
diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c
new file mode 100644
index 000000000..fa22e220d
--- /dev/null
+++ b/hw/xfree86/parser/DRI.c
@@ -0,0 +1,183 @@
+/* DRI.c -- DRI Section in XF86Config file
+ * Created: Fri Mar 19 08:40:22 1999 by faith@precisioninsight.com
+ * Revised: Thu Jun 17 16:08:05 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, 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.
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/parser/DRI.c,v 1.14 2003/01/04 20:20:22 paulo Exp $
+ *
+ */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec DRITab[] =
+{
+ {ENDSECTION, "endsection"},
+ {GROUP, "group"},
+ {BUFFERS, "buffers"},
+ {MODE, "mode"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeBuffersList
+
+XF86ConfBuffersPtr
+xf86parseBuffers (void)
+{
+ int token;
+ parsePrologue (XF86ConfBuffersPtr, XF86ConfBuffersRec)
+
+ if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER)
+ Error ("Buffers count expected", NULL);
+ ptr->buf_count = val.num;
+
+ if (xf86getSubToken (&(ptr->buf_comment)) != NUMBER)
+ Error ("Buffers size expected", NULL);
+ ptr->buf_size = val.num;
+
+ if ((token = xf86getSubToken (&(ptr->buf_comment))) == STRING) {
+ ptr->buf_flags = val.str;
+ if ((token = xf86getToken (NULL)) == COMMENT)
+ ptr->buf_comment = xf86addComment(ptr->buf_comment, val.str);
+ else
+ xf86unGetToken(token);
+ }
+
+#ifdef DEBUG
+ printf ("Buffers parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+#define CLEANUP xf86freeDRI
+
+XF86ConfDRIPtr
+xf86parseDRISection (void)
+{
+ int token;
+ parsePrologue (XF86ConfDRIPtr, XF86ConfDRIRec);
+
+ /* Zero is a valid value for this. */
+ ptr->dri_group = -1;
+ while ((token = xf86getToken (DRITab)) != ENDSECTION) {
+ switch (token)
+ {
+ case GROUP:
+ if ((token = xf86getSubToken (&(ptr->dri_comment))) == STRING)
+ ptr->dri_group_name = val.str;
+ else if (token == NUMBER)
+ ptr->dri_group = val.num;
+ else
+ Error (GROUP_MSG, NULL);
+ break;
+ case MODE:
+ if (xf86getSubToken (&(ptr->dri_comment)) != NUMBER)
+ Error (NUMBER_MSG, "Mode");
+ ptr->dri_mode = val.num;
+ break;
+ case BUFFERS:
+ HANDLE_LIST (dri_buffers_lst, xf86parseBuffers,
+ XF86ConfBuffersPtr);
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ case COMMENT:
+ ptr->dri_comment = xf86addComment(ptr->dri_comment, val.str);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+#ifdef DEBUG
+ ErrorF("DRI section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr)
+{
+ XF86ConfBuffersPtr bufs;
+
+ if (ptr == NULL)
+ return;
+
+ fprintf (cf, "Section \"DRI\"\n");
+ if (ptr->dri_comment)
+ fprintf (cf, "%s", ptr->dri_comment);
+ if (ptr->dri_group_name)
+ fprintf (cf, "\tGroup \"%s\"\n", ptr->dri_group_name);
+ else if (ptr->dri_group >= 0)
+ fprintf (cf, "\tGroup %d\n", ptr->dri_group);
+ if (ptr->dri_mode)
+ fprintf (cf, "\tMode 0%o\n", ptr->dri_mode);
+ for (bufs = ptr->dri_buffers_lst; bufs; bufs = bufs->list.next) {
+ fprintf (cf, "\tBuffers %d %d",
+ bufs->buf_count, bufs->buf_size);
+ if (bufs->buf_flags) fprintf (cf, " \"%s\"", bufs->buf_flags);
+ if (bufs->buf_comment)
+ fprintf(cf, "%s", bufs->buf_comment);
+ else
+ fprintf (cf, "\n");
+ }
+ fprintf (cf, "EndSection\n\n");
+}
+
+void
+xf86freeDRI (XF86ConfDRIPtr ptr)
+{
+ if (ptr == NULL)
+ return;
+
+ xf86freeBuffersList (ptr->dri_buffers_lst);
+ TestFree (ptr->dri_comment);
+ xf86conffree (ptr);
+}
+
+void
+xf86freeBuffersList (XF86ConfBuffersPtr ptr)
+{
+ XF86ConfBuffersPtr prev;
+
+ while (ptr) {
+ TestFree (ptr->buf_flags);
+ TestFree (ptr->buf_comment);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
diff --git a/hw/xfree86/parser/Device.c b/hw/xfree86/parser/Device.c
new file mode 100644
index 000000000..e929641c9
--- /dev/null
+++ b/hw/xfree86/parser/Device.c
@@ -0,0 +1,372 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Device.c,v 1.26 2003/01/04 20:20:22 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static
+xf86ConfigSymTabRec DeviceTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {IDENTIFIER, "identifier"},
+ {VENDOR, "vendorname"},
+ {BOARD, "boardname"},
+ {CHIPSET, "chipset"},
+ {RAMDAC, "ramdac"},
+ {DACSPEED, "dacspeed"},
+ {CLOCKS, "clocks"},
+ {OPTION, "option"},
+ {VIDEORAM, "videoram"},
+ {BIOSBASE, "biosbase"},
+ {MEMBASE, "membase"},
+ {IOBASE, "iobase"},
+ {CLOCKCHIP, "clockchip"},
+ {CHIPID, "chipid"},
+ {CHIPREV, "chiprev"},
+ {CARD, "card"},
+ {DRIVER, "driver"},
+ {BUSID, "busid"},
+ {TEXTCLOCKFRQ, "textclockfreq"},
+ {IRQ, "irq"},
+ {SCREEN, "screen"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeDeviceList
+
+XF86ConfDevicePtr
+xf86parseDeviceSection (void)
+{
+ int i;
+ int has_ident = FALSE;
+ int token;
+ parsePrologue (XF86ConfDevicePtr, XF86ConfDeviceRec)
+
+ /* Zero is a valid value for these */
+ ptr->dev_chipid = -1;
+ ptr->dev_chiprev = -1;
+ ptr->dev_irq = -1;
+ while ((token = xf86getToken (DeviceTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->dev_comment = xf86addComment(ptr->dev_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ ptr->dev_identifier = val.str;
+ has_ident = TRUE;
+ break;
+ case VENDOR:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "Vendor");
+ ptr->dev_vendor = val.str;
+ break;
+ case BOARD:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "Board");
+ ptr->dev_board = val.str;
+ break;
+ case CHIPSET:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "Chipset");
+ ptr->dev_chipset = val.str;
+ break;
+ case CARD:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "Card");
+ ptr->dev_card = val.str;
+ break;
+ case DRIVER:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "Driver");
+ ptr->dev_driver = val.str;
+ break;
+ case RAMDAC:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "Ramdac");
+ ptr->dev_ramdac = val.str;
+ break;
+ case DACSPEED:
+ for (i = 0; i < CONF_MAXDACSPEEDS; i++)
+ ptr->dev_dacSpeeds[i] = 0;
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ {
+ Error (DACSPEED_MSG, CONF_MAXDACSPEEDS);
+ }
+ else
+ {
+ ptr->dev_dacSpeeds[0] = (int) (val.realnum * 1000.0 + 0.5);
+ for (i = 1; i < CONF_MAXDACSPEEDS; i++)
+ {
+ if (xf86getSubToken (&(ptr->dev_comment)) == NUMBER)
+ ptr->dev_dacSpeeds[i] = (int)
+ (val.realnum * 1000.0 + 0.5);
+ else
+ {
+ xf86unGetToken (token);
+ break;
+ }
+ }
+ }
+ break;
+ case VIDEORAM:
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ Error (NUMBER_MSG, "VideoRam");
+ ptr->dev_videoram = val.num;
+ break;
+ case BIOSBASE:
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ Error (NUMBER_MSG, "BIOSBase");
+ ptr->dev_bios_base = val.num;
+ break;
+ case MEMBASE:
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ Error (NUMBER_MSG, "MemBase");
+ ptr->dev_mem_base = val.num;
+ break;
+ case IOBASE:
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ Error (NUMBER_MSG, "IOBase");
+ ptr->dev_io_base = val.num;
+ break;
+ case CLOCKCHIP:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "ClockChip");
+ ptr->dev_clockchip = val.str;
+ break;
+ case CHIPID:
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ Error (NUMBER_MSG, "ChipID");
+ ptr->dev_chipid = val.num;
+ break;
+ case CHIPREV:
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ Error (NUMBER_MSG, "ChipRev");
+ ptr->dev_chiprev = val.num;
+ break;
+
+ case CLOCKS:
+ token = xf86getSubToken(&(ptr->dev_comment));
+ for( i = ptr->dev_clocks;
+ token == NUMBER && i < CONF_MAXCLOCKS; i++ ) {
+ ptr->dev_clock[i] = (int)(val.realnum * 1000.0 + 0.5);
+ token = xf86getSubToken(&(ptr->dev_comment));
+ }
+ ptr->dev_clocks = i;
+ xf86unGetToken (token);
+ break;
+ case TEXTCLOCKFRQ:
+ if ((token = xf86getSubToken(&(ptr->dev_comment))) != NUMBER)
+ Error (NUMBER_MSG, "TextClockFreq");
+ ptr->dev_textclockfreq = (int)(val.realnum * 1000.0 + 0.5);
+ break;
+ case OPTION:
+ ptr->dev_option_lst = xf86parseOption(ptr->dev_option_lst);
+ break;
+ case BUSID:
+ if (xf86getSubToken (&(ptr->dev_comment)) != STRING)
+ Error (QUOTE_MSG, "BusID");
+ ptr->dev_busid = val.str;
+ break;
+ case IRQ:
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ Error (QUOTE_MSG, "IRQ");
+ ptr->dev_irq = val.num;
+ break;
+ case SCREEN:
+ if (xf86getSubToken (&(ptr->dev_comment)) != NUMBER)
+ Error (NUMBER_MSG, "Screen");
+ ptr->dev_screen = val.num;
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+ if (!has_ident)
+ Error (NO_IDENT_MSG, NULL);
+
+#ifdef DEBUG
+ printf ("Device section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printDeviceSection (FILE * cf, XF86ConfDevicePtr ptr)
+{
+ int i;
+
+ while (ptr)
+ {
+ fprintf (cf, "Section \"Device\"\n");
+ if (ptr->dev_comment)
+ fprintf (cf, "%s", ptr->dev_comment);
+ if (ptr->dev_identifier)
+ fprintf (cf, "\tIdentifier \"%s\"\n", ptr->dev_identifier);
+ if (ptr->dev_driver)
+ fprintf (cf, "\tDriver \"%s\"\n", ptr->dev_driver);
+ if (ptr->dev_vendor)
+ fprintf (cf, "\tVendorName \"%s\"\n", ptr->dev_vendor);
+ if (ptr->dev_board)
+ fprintf (cf, "\tBoardName \"%s\"\n", ptr->dev_board);
+ if (ptr->dev_chipset)
+ fprintf (cf, "\tChipSet \"%s\"\n", ptr->dev_chipset);
+ if (ptr->dev_card)
+ fprintf (cf, "\tCard \"%s\"\n", ptr->dev_card);
+ if (ptr->dev_ramdac)
+ fprintf (cf, "\tRamDac \"%s\"\n", ptr->dev_ramdac);
+ if (ptr->dev_dacSpeeds[0] > 0 ) {
+ fprintf (cf, "\tDacSpeed ");
+ for (i = 0; i < CONF_MAXDACSPEEDS
+ && ptr->dev_dacSpeeds[i] > 0; i++ )
+ fprintf (cf, "%g ", (double) (ptr->dev_dacSpeeds[i])/ 1000.0 );
+ fprintf (cf, "\n");
+ }
+ if (ptr->dev_videoram)
+ fprintf (cf, "\tVideoRam %d\n", ptr->dev_videoram);
+ if (ptr->dev_bios_base)
+ fprintf (cf, "\tBiosBase 0x%lx\n", ptr->dev_bios_base);
+ if (ptr->dev_mem_base)
+ fprintf (cf, "\tMemBase 0x%lx\n", ptr->dev_mem_base);
+ if (ptr->dev_io_base)
+ fprintf (cf, "\tIOBase 0x%lx\n", ptr->dev_io_base);
+ if (ptr->dev_clockchip)
+ fprintf (cf, "\tClockChip \"%s\"\n", ptr->dev_clockchip);
+ if (ptr->dev_chipid != -1)
+ fprintf (cf, "\tChipId 0x%x\n", ptr->dev_chipid);
+ if (ptr->dev_chiprev != -1)
+ fprintf (cf, "\tChipRev 0x%x\n", ptr->dev_chiprev);
+
+ xf86printOptionList(cf, ptr->dev_option_lst, 1);
+ if (ptr->dev_clocks > 0 ) {
+ fprintf (cf, "\tClocks ");
+ for (i = 0; i < ptr->dev_clocks; i++ )
+ fprintf (cf, "%.1f ", (double)ptr->dev_clock[i] / 1000.0 );
+ fprintf (cf, "\n");
+ }
+ if (ptr->dev_textclockfreq) {
+ fprintf (cf, "\tTextClockFreq %.1f\n",
+ (double)ptr->dev_textclockfreq / 1000.0);
+ }
+ if (ptr->dev_busid)
+ fprintf (cf, "\tBusID \"%s\"\n", ptr->dev_busid);
+ if (ptr->dev_screen > 0)
+ fprintf (cf, "\tScreen %d\n", ptr->dev_screen);
+ if (ptr->dev_irq >= 0)
+ fprintf (cf, "\tIRQ %d\n", ptr->dev_irq);
+ fprintf (cf, "EndSection\n\n");
+ ptr = ptr->list.next;
+ }
+}
+
+void
+xf86freeDeviceList (XF86ConfDevicePtr ptr)
+{
+ XF86ConfDevicePtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->dev_identifier);
+ TestFree (ptr->dev_vendor);
+ TestFree (ptr->dev_board);
+ TestFree (ptr->dev_chipset);
+ TestFree (ptr->dev_card);
+ TestFree (ptr->dev_driver);
+ TestFree (ptr->dev_ramdac);
+ TestFree (ptr->dev_clockchip);
+ TestFree (ptr->dev_comment);
+ xf86optionListFree (ptr->dev_option_lst);
+
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+int
+xf86validateDevice (XF86ConfigPtr p)
+{
+ XF86ConfDevicePtr device = p->conf_device_lst;
+
+ if (!device) {
+ xf86validationError ("At least one Device section is required.");
+ return (FALSE);
+ }
+
+ while (device) {
+ if (!device->dev_driver) {
+ xf86validationError (UNDEFINED_DRIVER_MSG, device->dev_identifier);
+ return (FALSE);
+ }
+ device = device->list.next;
+ }
+ return (TRUE);
+}
+
+XF86ConfDevicePtr
+xf86findDevice (const char *ident, XF86ConfDevicePtr p)
+{
+ while (p)
+ {
+ if (xf86nameCompare (ident, p->dev_identifier) == 0)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
+
+char *
+xf86configStrdup (const char *s)
+{
+ char *tmp;
+ if (!s) return NULL;
+ tmp = xf86confmalloc (sizeof (char) * (strlen (s) + 1));
+ if (tmp)
+ strcpy (tmp, s);
+ return (tmp);
+}
diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c
new file mode 100644
index 000000000..4be58b512
--- /dev/null
+++ b/hw/xfree86/parser/Files.c
@@ -0,0 +1,264 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Files.c,v 1.15 2003/01/04 20:20:22 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "X11/Xos.h"
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec FilesTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {FONTPATH, "fontpath"},
+ {RGBPATH, "rgbpath"},
+ {MODULEPATH, "modulepath"},
+ {INPUTDEVICES, "inputdevices"},
+ {LOGFILEPATH, "logfile"},
+ {-1, ""},
+};
+
+static char *
+prependRoot (char *pathname)
+{
+#ifndef __EMX__
+ return pathname;
+#else
+ /* XXXX caveat: multiple path components in line */
+ return (char *) __XOS2RedirRoot (pathname);
+#endif
+}
+
+#define CLEANUP xf86freeFiles
+
+XF86ConfFilesPtr
+xf86parseFilesSection (void)
+{
+ int i, j;
+ int k, l;
+ char *str;
+ int token;
+ parsePrologue (XF86ConfFilesPtr, XF86ConfFilesRec)
+
+ while ((token = xf86getToken (FilesTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->file_comment = xf86addComment(ptr->file_comment, val.str);
+ break;
+ case FONTPATH:
+ if (xf86getSubToken (&(ptr->file_comment)) != STRING)
+ Error (QUOTE_MSG, "FontPath");
+ j = FALSE;
+ str = prependRoot (val.str);
+ if (ptr->file_fontpath == NULL)
+ {
+ ptr->file_fontpath = xf86confmalloc (1);
+ ptr->file_fontpath[0] = '\0';
+ i = strlen (str) + 1;
+ }
+ else
+ {
+ i = strlen (ptr->file_fontpath) + strlen (str) + 1;
+ if (ptr->file_fontpath[strlen (ptr->file_fontpath) - 1] != ',')
+ {
+ i++;
+ j = TRUE;
+ }
+ }
+ ptr->file_fontpath =
+ xf86confrealloc (ptr->file_fontpath, i);
+ if (j)
+ strcat (ptr->file_fontpath, ",");
+
+ strcat (ptr->file_fontpath, str);
+ xf86conffree (val.str);
+ break;
+ case RGBPATH:
+ if (xf86getSubToken (&(ptr->file_comment)) != STRING)
+ Error (QUOTE_MSG, "RGBPath");
+ ptr->file_rgbpath = val.str;
+ break;
+ case MODULEPATH:
+ if (xf86getSubToken (&(ptr->file_comment)) != STRING)
+ Error (QUOTE_MSG, "ModulePath");
+ l = FALSE;
+ str = prependRoot (val.str);
+ if (ptr->file_modulepath == NULL)
+ {
+ ptr->file_modulepath = xf86confmalloc (1);
+ ptr->file_modulepath[0] = '\0';
+ k = strlen (str) + 1;
+ }
+ else
+ {
+ k = strlen (ptr->file_modulepath) + strlen (str) + 1;
+ if (ptr->file_modulepath[strlen (ptr->file_modulepath) - 1] != ',')
+ {
+ k++;
+ l = TRUE;
+ }
+ }
+ ptr->file_modulepath = xf86confrealloc (ptr->file_modulepath, k);
+ if (l)
+ strcat (ptr->file_modulepath, ",");
+
+ strcat (ptr->file_modulepath, str);
+ xf86conffree (val.str);
+ break;
+ case INPUTDEVICES:
+ if (xf86getSubToken (&(ptr->file_comment)) != STRING)
+ Error (QUOTE_MSG, "InputDevices");
+ l = FALSE;
+ str = prependRoot (val.str);
+ if (ptr->file_inputdevs == NULL)
+ {
+ ptr->file_inputdevs = xf86confmalloc (1);
+ ptr->file_inputdevs[0] = '\0';
+ k = strlen (str) + 1;
+ }
+ else
+ {
+ k = strlen (ptr->file_inputdevs) + strlen (str) + 1;
+ if (ptr->file_inputdevs[strlen (ptr->file_inputdevs) - 1] != ',')
+ {
+ k++;
+ l = TRUE;
+ }
+ }
+ ptr->file_inputdevs = xf86confrealloc (ptr->file_inputdevs, k);
+ if (l)
+ strcat (ptr->file_inputdevs, ",");
+
+ strcat (ptr->file_inputdevs, str);
+ xf86conffree (val.str);
+ break;
+ case LOGFILEPATH:
+ if (xf86getSubToken (&(ptr->file_comment)) != STRING)
+ Error (QUOTE_MSG, "LogFile");
+ ptr->file_logfile = val.str;
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+#ifdef DEBUG
+ printf ("File section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printFileSection (FILE * cf, XF86ConfFilesPtr ptr)
+{
+ char *p, *s;
+
+ if (ptr == NULL)
+ return;
+
+ if (ptr->file_comment)
+ fprintf (cf, "%s", ptr->file_comment);
+ if (ptr->file_logfile)
+ fprintf (cf, "\tLogFile \"%s\"\n", ptr->file_logfile);
+ if (ptr->file_rgbpath)
+ fprintf (cf, "\tRgbPath \"%s\"\n", ptr->file_rgbpath);
+ if (ptr->file_modulepath)
+ {
+ s = ptr->file_modulepath;
+ p = index (s, ',');
+ while (p)
+ {
+ *p = '\000';
+ fprintf (cf, "\tModulePath \"%s\"\n", s);
+ *p = ',';
+ s = p;
+ s++;
+ p = index (s, ',');
+ }
+ fprintf (cf, "\tModulePath \"%s\"\n", s);
+ }
+ if (ptr->file_inputdevs)
+ {
+ s = ptr->file_inputdevs;
+ p = index (s, ',');
+ while (p)
+ {
+ *p = '\000';
+ fprintf (cf, "\tInputDevices \"%s\"\n", s);
+ *p = ',';
+ s = p;
+ s++;
+ p = index (s, ',');
+ }
+ fprintf (cf, "\tInputdevs \"%s\"\n", s);
+ }
+ if (ptr->file_fontpath)
+ {
+ s = ptr->file_fontpath;
+ p = index (s, ',');
+ while (p)
+ {
+ *p = '\000';
+ fprintf (cf, "\tFontPath \"%s\"\n", s);
+ *p = ',';
+ s = p;
+ s++;
+ p = index (s, ',');
+ }
+ fprintf (cf, "\tFontPath \"%s\"\n", s);
+ }
+}
+
+void
+xf86freeFiles (XF86ConfFilesPtr p)
+{
+ if (p == NULL)
+ return;
+
+ TestFree (p->file_logfile);
+ TestFree (p->file_rgbpath);
+ TestFree (p->file_modulepath);
+ TestFree (p->file_inputdevs);
+ TestFree (p->file_fontpath);
+ TestFree (p->file_comment);
+
+ xf86conffree (p);
+}
diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c
new file mode 100644
index 000000000..dfd3ab0bd
--- /dev/null
+++ b/hw/xfree86/parser/Flags.c
@@ -0,0 +1,494 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Flags.c,v 1.22 2003/01/04 20:20:22 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+#include <math.h>
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec ServerFlagsTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {NOTRAPSIGNALS, "notrapsignals"},
+ {DONTZAP, "dontzap"},
+ {DONTZOOM, "dontzoom"},
+ {DISABLEVIDMODE, "disablevidmodeextension"},
+ {ALLOWNONLOCAL, "allownonlocalxvidtune"},
+ {DISABLEMODINDEV, "disablemodindev"},
+ {MODINDEVALLOWNONLOCAL, "allownonlocalmodindev"},
+ {ALLOWMOUSEOPENFAIL, "allowmouseopenfail"},
+ {OPTION, "option"},
+ {BLANKTIME, "blanktime"},
+ {STANDBYTIME, "standbytime"},
+ {SUSPENDTIME, "suspendtime"},
+ {OFFTIME, "offtime"},
+ {DEFAULTLAYOUT, "defaultserverlayout"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeFlags
+
+XF86ConfFlagsPtr
+xf86parseFlagsSection (void)
+{
+ int token;
+ parsePrologue (XF86ConfFlagsPtr, XF86ConfFlagsRec)
+
+ while ((token = xf86getToken (ServerFlagsTab)) != ENDSECTION)
+ {
+ int hasvalue = FALSE;
+ int strvalue = FALSE;
+ int tokentype;
+ switch (token)
+ {
+ case COMMENT:
+ ptr->flg_comment = xf86addComment(ptr->flg_comment, val.str);
+ break;
+ /*
+ * these old keywords are turned into standard generic options.
+ * we fall through here on purpose
+ */
+ case DEFAULTLAYOUT:
+ strvalue = TRUE;
+ case BLANKTIME:
+ case STANDBYTIME:
+ case SUSPENDTIME:
+ case OFFTIME:
+ hasvalue = TRUE;
+ case NOTRAPSIGNALS:
+ case DONTZAP:
+ case DONTZOOM:
+ case DISABLEVIDMODE:
+ case ALLOWNONLOCAL:
+ case DISABLEMODINDEV:
+ case MODINDEVALLOWNONLOCAL:
+ case ALLOWMOUSEOPENFAIL:
+ {
+ int i = 0;
+ while (ServerFlagsTab[i].token != -1)
+ {
+ char *tmp;
+
+ if (ServerFlagsTab[i].token == token)
+ {
+ char *valstr = NULL;
+ /* can't use strdup because it calls malloc */
+ tmp = xf86configStrdup (ServerFlagsTab[i].name);
+ if (hasvalue)
+ {
+ tokentype = xf86getSubToken(&(ptr->flg_comment));
+ if (strvalue) {
+ if (tokentype != STRING)
+ Error (QUOTE_MSG, tmp);
+ valstr = val.str;
+ } else {
+ if (tokentype != NUMBER)
+ Error (NUMBER_MSG, tmp);
+ valstr = xf86confmalloc(16);
+ if (valstr)
+ sprintf(valstr, "%d", val.num);
+ }
+ }
+ ptr->flg_option_lst = xf86addNewOption
+ (ptr->flg_option_lst, tmp, valstr);
+ }
+ i++;
+ }
+ }
+ break;
+ case OPTION:
+ ptr->flg_option_lst = xf86parseOption(ptr->flg_option_lst);
+ break;
+
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+#ifdef DEBUG
+ printf ("Flags section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printServerFlagsSection (FILE * f, XF86ConfFlagsPtr flags)
+{
+ XF86OptionPtr p;
+
+ if ((!flags) || (!flags->flg_option_lst))
+ return;
+ p = flags->flg_option_lst;
+ fprintf (f, "Section \"ServerFlags\"\n");
+ if (flags->flg_comment)
+ fprintf (f, "%s", flags->flg_comment);
+ xf86printOptionList(f, p, 1);
+ fprintf (f, "EndSection\n\n");
+}
+
+static XF86OptionPtr
+addNewOption2 (XF86OptionPtr head, char *name, char *val, int used)
+{
+ XF86OptionPtr new, old = NULL;
+
+ /* Don't allow duplicates */
+ if (head != NULL && (old = xf86findOption(head, name)) != NULL)
+ new = old;
+ else {
+ new = xf86confcalloc (1, sizeof (XF86OptionRec));
+ new->list.next = NULL;
+ }
+ new->opt_name = name;
+ new->opt_val = val;
+ new->opt_used = used;
+
+ if (old == NULL)
+ return ((XF86OptionPtr) xf86addListItem ((glp) head, (glp) new));
+ else
+ return head;
+}
+
+XF86OptionPtr
+xf86addNewOption (XF86OptionPtr head, char *name, char *val)
+{
+ return addNewOption2(head, name, val, 0);
+}
+
+void
+xf86freeFlags (XF86ConfFlagsPtr flags)
+{
+ if (flags == NULL)
+ return;
+ xf86optionListFree (flags->flg_option_lst);
+ TestFree(flags->flg_comment);
+ xf86conffree (flags);
+}
+
+XF86OptionPtr
+xf86optionListDup (XF86OptionPtr opt)
+{
+ XF86OptionPtr newopt = NULL;
+
+ while (opt)
+ {
+ newopt = xf86addNewOption(newopt, xf86configStrdup(opt->opt_name),
+ xf86configStrdup(opt->opt_val));
+ newopt->opt_used = opt->opt_used;
+ if (opt->opt_comment)
+ newopt->opt_comment = xf86configStrdup(opt->opt_comment);
+ opt = opt->list.next;
+ }
+ return newopt;
+}
+
+void
+xf86optionListFree (XF86OptionPtr opt)
+{
+ XF86OptionPtr prev;
+
+ while (opt)
+ {
+ TestFree (opt->opt_name);
+ TestFree (opt->opt_val);
+ TestFree (opt->opt_comment);
+ prev = opt;
+ opt = opt->list.next;
+ xf86conffree (prev);
+ }
+}
+
+char *
+xf86optionName(XF86OptionPtr opt)
+{
+ if (opt)
+ return opt->opt_name;
+ return 0;
+}
+
+char *
+xf86optionValue(XF86OptionPtr opt)
+{
+ if (opt)
+ return opt->opt_val;
+ return 0;
+}
+
+XF86OptionPtr
+xf86newOption(char *name, char *value)
+{
+ XF86OptionPtr opt;
+
+ opt = xf86confcalloc(1, sizeof (XF86OptionRec));
+ if (!opt)
+ return NULL;
+
+ opt->opt_used = 0;
+ opt->list.next = 0;
+ opt->opt_name = name;
+ opt->opt_val = value;
+
+ return opt;
+}
+
+XF86OptionPtr
+xf86nextOption(XF86OptionPtr list)
+{
+ if (!list)
+ return NULL;
+ return list->list.next;
+}
+
+/*
+ * this function searches the given option list for the named option and
+ * returns a pointer to the option rec if found. If not found, it returns
+ * NULL
+ */
+
+XF86OptionPtr
+xf86findOption (XF86OptionPtr list, const char *name)
+{
+ while (list)
+ {
+ if (xf86nameCompare (list->opt_name, name) == 0)
+ return (list);
+ list = list->list.next;
+ }
+ return (NULL);
+}
+
+/*
+ * this function searches the given option list for the named option. If
+ * found and the option has a parameter, a pointer to the parameter is
+ * returned. If the option does not have a parameter an empty string is
+ * returned. If the option is not found, a NULL is returned.
+ */
+
+char *
+xf86findOptionValue (XF86OptionPtr list, const char *name)
+{
+ XF86OptionPtr p = xf86findOption (list, name);
+
+ if (p)
+ {
+ if (p->opt_val)
+ return (p->opt_val);
+ else
+ return "";
+ }
+ return (NULL);
+}
+
+XF86OptionPtr
+xf86optionListCreate( const char **options, int count, int used )
+{
+ XF86OptionPtr p = NULL;
+ char *t1, *t2;
+ int i;
+
+ if (count == -1)
+ {
+ for (count = 0; options[count]; count++)
+ ;
+ }
+ if( (count % 2) != 0 )
+ {
+ fprintf( stderr, "xf86optionListCreate: count must be an even number.\n" );
+ return (NULL);
+ }
+ for (i = 0; i < count; i += 2)
+ {
+ /* can't use strdup because it calls malloc */
+ t1 = xf86confmalloc (sizeof (char) *
+ (strlen (options[i]) + 1));
+ strcpy (t1, options[i]);
+ t2 = xf86confmalloc (sizeof (char) *
+ (strlen (options[i + 1]) + 1));
+ strcpy (t2, options[i + 1]);
+ p = addNewOption2 (p, t1, t2, used);
+ }
+
+ return (p);
+}
+
+/* the 2 given lists are merged. If an option with the same name is present in
+ * both, the option from the user list - specified in the second argument -
+ * is used. The end result is a single valid list of options. Duplicates
+ * are freed, and the original lists are no longer guaranteed to be complete.
+ */
+XF86OptionPtr
+xf86optionListMerge (XF86OptionPtr head, XF86OptionPtr tail)
+{
+ XF86OptionPtr a, b, ap = NULL, bp = NULL;
+
+ a = tail;
+ b = head;
+ while (tail && b) {
+ if (xf86nameCompare (a->opt_name, b->opt_name) == 0) {
+ if (b == head)
+ head = a;
+ else
+ bp->list.next = a;
+ if (a == tail)
+ tail = a->list.next;
+ else
+ ap->list.next = a->list.next;
+ a->list.next = b->list.next;
+ b->list.next = NULL;
+ xf86optionListFree (b);
+ b = a->list.next;
+ bp = a;
+ a = tail;
+ ap = NULL;
+ } else {
+ ap = a;
+ if (!(a = a->list.next)) {
+ a = tail;
+ bp = b;
+ b = b->list.next;
+ ap = NULL;
+ }
+ }
+ }
+
+ if (head) {
+ for (a = head; a->list.next; a = a->list.next)
+ ;
+ a->list.next = tail;
+ } else
+ head = tail;
+
+ return (head);
+}
+
+char *
+xf86uLongToString(unsigned long i)
+{
+ char *s;
+ int l;
+
+ l = (int)(ceil(log10((double)i) + 2.5));
+ s = xf86confmalloc(l);
+ if (!s)
+ return NULL;
+ sprintf(s, "%lu", i);
+ return s;
+}
+
+void
+xf86debugListOptions(XF86OptionPtr Options)
+{
+ while (Options) {
+ ErrorF("Option: %s Value: %s\n",Options->opt_name,Options->opt_val);
+ Options = Options->list.next;
+ }
+}
+
+XF86OptionPtr
+xf86parseOption(XF86OptionPtr head)
+{
+ XF86OptionPtr option, cnew, old;
+ char *name, *comment = NULL;
+ int token;
+
+ if ((token = xf86getSubToken(&comment)) != STRING) {
+ xf86parseError(BAD_OPTION_MSG, NULL);
+ if (comment)
+ xf86conffree(comment);
+ return (head);
+ }
+
+ name = val.str;
+ if ((token = xf86getSubToken(&comment)) == STRING) {
+ option = xf86newOption(name, val.str);
+ option->opt_comment = comment;
+ if ((token = xf86getToken(NULL)) == COMMENT)
+ option->opt_comment = xf86addComment(option->opt_comment, val.str);
+ else
+ xf86unGetToken(token);
+ }
+ else {
+ option = xf86newOption(name, NULL);
+ option->opt_comment = comment;
+ if (token == COMMENT)
+ option->opt_comment = xf86addComment(option->opt_comment, val.str);
+ else
+ xf86unGetToken(token);
+ }
+
+ old = NULL;
+
+ /* Don't allow duplicates */
+ if (head != NULL && (old = xf86findOption(head, name)) != NULL) {
+ cnew = old;
+ xf86conffree(option->opt_name);
+ TestFree(option->opt_val);
+ TestFree(option->opt_comment);
+ xf86conffree(option);
+ }
+ else
+ cnew = option;
+
+ if (old == NULL)
+ return ((XF86OptionPtr)xf86addListItem((glp)head, (glp)cnew));
+
+ return (head);
+}
+
+void
+xf86printOptionList(FILE *fp, XF86OptionPtr list, int tabs)
+{
+ int i;
+
+ if (!list)
+ return;
+ while (list) {
+ for (i = 0; i < tabs; i++)
+ fputc('\t', fp);
+ if (list->opt_val)
+ fprintf(fp, "Option \"%s\" \"%s\"", list->opt_name, list->opt_val);
+ else
+ fprintf(fp, "Option \"%s\"", list->opt_name);
+ if (list->opt_comment)
+ fprintf(fp, "%s", list->opt_comment);
+ else
+ fputc('\n', fp);
+ list = list->list.next;
+ }
+}
diff --git a/hw/xfree86/parser/Input.c b/hw/xfree86/parser/Input.c
new file mode 100644
index 000000000..f5387b384
--- /dev/null
+++ b/hw/xfree86/parser/Input.c
@@ -0,0 +1,184 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Input.c,v 1.13 2003/01/04 20:20:22 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static
+xf86ConfigSymTabRec InputTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {IDENTIFIER, "identifier"},
+ {OPTION, "option"},
+ {DRIVER, "driver"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeInputList
+
+XF86ConfInputPtr
+xf86parseInputSection (void)
+{
+ int has_ident = FALSE;
+ int token;
+ parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
+
+ while ((token = xf86getToken (InputTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->inp_comment = xf86addComment(ptr->inp_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ ptr->inp_identifier = val.str;
+ has_ident = TRUE;
+ break;
+ case DRIVER:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "Driver");
+ ptr->inp_driver = val.str;
+ break;
+ case OPTION:
+ ptr->inp_option_lst = xf86parseOption(ptr->inp_option_lst);
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+ if (!has_ident)
+ Error (NO_IDENT_MSG, NULL);
+
+#ifdef DEBUG
+ printf ("InputDevice section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printInputSection (FILE * cf, XF86ConfInputPtr ptr)
+{
+ while (ptr)
+ {
+ fprintf (cf, "Section \"InputDevice\"\n");
+ if (ptr->inp_comment)
+ fprintf (cf, "%s", ptr->inp_comment);
+ if (ptr->inp_identifier)
+ fprintf (cf, "\tIdentifier \"%s\"\n", ptr->inp_identifier);
+ if (ptr->inp_driver)
+ fprintf (cf, "\tDriver \"%s\"\n", ptr->inp_driver);
+ xf86printOptionList(cf, ptr->inp_option_lst, 1);
+ fprintf (cf, "EndSection\n\n");
+ ptr = ptr->list.next;
+ }
+}
+
+void
+xf86freeInputList (XF86ConfInputPtr ptr)
+{
+ XF86ConfInputPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->inp_identifier);
+ TestFree (ptr->inp_driver);
+ TestFree (ptr->inp_comment);
+ xf86optionListFree (ptr->inp_option_lst);
+
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+int
+xf86validateInput (XF86ConfigPtr p)
+{
+ XF86ConfInputPtr input = p->conf_input_lst;
+
+#if 0 /* Enable this later */
+ if (!input) {
+ xf86validationError ("At least one InputDevice section is required.");
+ return (FALSE);
+ }
+#endif
+
+ while (input) {
+ if (!input->inp_driver) {
+ xf86validationError (UNDEFINED_INPUTDRIVER_MSG, input->inp_identifier);
+ return (FALSE);
+ }
+ input = input->list.next;
+ }
+ return (TRUE);
+}
+
+XF86ConfInputPtr
+xf86findInput (const char *ident, XF86ConfInputPtr p)
+{
+ while (p)
+ {
+ if (xf86nameCompare (ident, p->inp_identifier) == 0)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
+
+XF86ConfInputPtr
+xf86findInputByDriver (const char *driver, XF86ConfInputPtr p)
+{
+ while (p)
+ {
+ if (xf86nameCompare (driver, p->inp_driver) == 0)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
+
diff --git a/hw/xfree86/parser/Keyboard.c b/hw/xfree86/parser/Keyboard.c
new file mode 100644
index 000000000..68cbaf3c0
--- /dev/null
+++ b/hw/xfree86/parser/Keyboard.c
@@ -0,0 +1,275 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Keyboard.c,v 1.15 2003/01/04 20:20:22 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+#include "ctype.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec KeyboardTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {KPROTOCOL, "protocol"},
+ {AUTOREPEAT, "autorepeat"},
+ {XLEDS, "xleds"},
+ {PANIX106, "panix106"},
+ {XKBKEYMAP, "xkbkeymap"},
+ {XKBCOMPAT, "xkbcompat"},
+ {XKBTYPES, "xkbtypes"},
+ {XKBKEYCODES, "xkbkeycodes"},
+ {XKBGEOMETRY, "xkbgeometry"},
+ {XKBSYMBOLS, "xkbsymbols"},
+ {XKBDISABLE, "xkbdisable"},
+ {XKBRULES, "xkbrules"},
+ {XKBMODEL, "xkbmodel"},
+ {XKBLAYOUT, "xkblayout"},
+ {XKBVARIANT, "xkbvariant"},
+ {XKBOPTIONS, "xkboptions"},
+ /* The next two have become ServerFlags options */
+ {VTINIT, "vtinit"},
+ {VTSYSREQ, "vtsysreq"},
+ /* Obsolete keywords */
+ {SERVERNUM, "servernumlock"},
+ {LEFTALT, "leftalt"},
+ {RIGHTALT, "rightalt"},
+ {RIGHTALT, "altgr"},
+ {SCROLLLOCK_TOK, "scrolllock"},
+ {RIGHTCTL, "rightctl"},
+ {-1, ""},
+};
+
+/* Obsolete */
+static xf86ConfigSymTabRec KeyMapTab[] =
+{
+ {CONF_KM_META, "meta"},
+ {CONF_KM_COMPOSE, "compose"},
+ {CONF_KM_MODESHIFT, "modeshift"},
+ {CONF_KM_MODELOCK, "modelock"},
+ {CONF_KM_SCROLLLOCK, "scrolllock"},
+ {CONF_KM_CONTROL, "control"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeInputList
+
+XF86ConfInputPtr
+xf86parseKeyboardSection (void)
+{
+ char *s, *s1, *s2;
+ int l;
+ int token, ntoken;
+ parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
+
+ while ((token = xf86getToken (KeyboardTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->inp_comment = xf86addComment(ptr->inp_comment, val.str);
+ break;
+ case KPROTOCOL:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "Protocol");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("Protocol"),
+ val.str);
+ break;
+ case AUTOREPEAT:
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER)
+ Error (AUTOREPEAT_MSG, NULL);
+ s1 = xf86uLongToString(val.num);
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER)
+ Error (AUTOREPEAT_MSG, NULL);
+ s2 = xf86uLongToString(val.num);
+ l = strlen(s1) + 1 + strlen(s2) + 1;
+ s = xf86confmalloc(l);
+ sprintf(s, "%s %s", s1, s2);
+ xf86conffree(s1);
+ xf86conffree(s2);
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("AutoRepeat"), s);
+ break;
+ case XLEDS:
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER)
+ Error (XLEDS_MSG, NULL);
+ s = xf86uLongToString(val.num);
+ l = strlen(s) + 1;
+ while ((token = xf86getSubToken (&(ptr->inp_comment))) == NUMBER)
+ {
+ s1 = xf86uLongToString(val.num);
+ l += (1 + strlen(s1));
+ s = xf86confrealloc(s, l);
+ strcat(s, " ");
+ strcat(s, s1);
+ xf86conffree(s1);
+ }
+ xf86unGetToken (token);
+ break;
+ case SERVERNUM:
+ xf86parseWarning(OBSOLETE_MSG, xf86tokenString());
+ break;
+ case LEFTALT:
+ case RIGHTALT:
+ case SCROLLLOCK_TOK:
+ case RIGHTCTL:
+ xf86parseWarning(OBSOLETE_MSG, xf86tokenString());
+ break;
+ ntoken = xf86getToken (KeyMapTab);
+ switch (ntoken)
+ {
+ case EOF_TOKEN:
+ xf86parseError (UNEXPECTED_EOF_MSG);
+ CLEANUP (ptr);
+ return (NULL);
+ break;
+
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ break;
+ case VTINIT:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "VTInit");
+ xf86parseWarning(MOVED_TO_FLAGS_MSG, "VTInit");
+ break;
+ case VTSYSREQ:
+ xf86parseWarning(MOVED_TO_FLAGS_MSG, "VTSysReq");
+ break;
+ case XKBDISABLE:
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbDisable"),
+ NULL);
+ break;
+ case XKBKEYMAP:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBKeymap");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbKeymap"),
+ val.str);
+ break;
+ case XKBCOMPAT:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBCompat");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbCompat"),
+ val.str);
+ break;
+ case XKBTYPES:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBTypes");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbTypes"),
+ val.str);
+ break;
+ case XKBKEYCODES:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBKeycodes");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbKeycodes"),
+ val.str);
+ break;
+ case XKBGEOMETRY:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBGeometry");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbGeometry"),
+ val.str);
+ break;
+ case XKBSYMBOLS:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBSymbols");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbSymbols"),
+ val.str);
+ break;
+ case XKBRULES:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBRules");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbRules"),
+ val.str);
+ break;
+ case XKBMODEL:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBModel");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbModel"),
+ val.str);
+ break;
+ case XKBLAYOUT:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBLayout");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbLayout"),
+ val.str);
+ break;
+ case XKBVARIANT:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBVariant");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbVariant"),
+ val.str);
+ break;
+ case XKBOPTIONS:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "XKBOptions");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("XkbOptions"),
+ val.str);
+ break;
+ case PANIX106:
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("Panix106"), NULL);
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+ ptr->inp_identifier = xf86configStrdup(CONF_IMPLICIT_KEYBOARD);
+ ptr->inp_driver = xf86configStrdup("keyboard");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("CoreKeyboard"), NULL);
+
+#ifdef DEBUG
+ printf ("Keyboard section parsed\n");
+#endif
+
+ return ptr;
+}
+
diff --git a/hw/xfree86/parser/Layout.c b/hw/xfree86/parser/Layout.c
new file mode 100644
index 000000000..cd351c9c6
--- /dev/null
+++ b/hw/xfree86/parser/Layout.c
@@ -0,0 +1,482 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Layout.c,v 1.23 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+#include <string.h>
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec LayoutTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {SCREEN, "screen"},
+ {IDENTIFIER, "identifier"},
+ {INACTIVE, "inactive"},
+ {INPUTDEVICE, "inputdevice"},
+ {OPTION, "option"},
+ {-1, ""},
+};
+
+static xf86ConfigSymTabRec AdjTab[] =
+{
+ {RIGHTOF, "rightof"},
+ {LEFTOF, "leftof"},
+ {ABOVE, "above"},
+ {BELOW, "below"},
+ {RELATIVE, "relative"},
+ {ABSOLUTE, "absolute"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeLayoutList
+
+XF86ConfLayoutPtr
+xf86parseLayoutSection (void)
+{
+ int has_ident = FALSE;
+ int token;
+ parsePrologue (XF86ConfLayoutPtr, XF86ConfLayoutRec)
+
+ while ((token = xf86getToken (LayoutTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->lay_comment = xf86addComment(ptr->lay_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ ptr->lay_identifier = val.str;
+ has_ident = TRUE;
+ break;
+ case INACTIVE:
+ {
+ XF86ConfInactivePtr iptr;
+
+ iptr = xf86confcalloc (1, sizeof (XF86ConfInactiveRec));
+ iptr->list.next = NULL;
+ if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
+ Error (INACTIVE_MSG, NULL);
+ iptr->inactive_device_str = val.str;
+ ptr->lay_inactive_lst = (XF86ConfInactivePtr)
+ xf86addListItem ((glp) ptr->lay_inactive_lst, (glp) iptr);
+ }
+ break;
+ case SCREEN:
+ {
+ XF86ConfAdjacencyPtr aptr;
+ int absKeyword = 0;
+
+ aptr = xf86confcalloc (1, sizeof (XF86ConfAdjacencyRec));
+ aptr->list.next = NULL;
+ aptr->adj_scrnum = -1;
+ aptr->adj_where = CONF_ADJ_OBSOLETE;
+ aptr->adj_x = 0;
+ aptr->adj_y = 0;
+ aptr->adj_refscreen = NULL;
+ if ((token = xf86getSubToken (&(ptr->lay_comment))) == NUMBER)
+ aptr->adj_scrnum = val.num;
+ else
+ xf86unGetToken (token);
+ token = xf86getSubToken(&(ptr->lay_comment));
+ if (token != STRING)
+ Error (SCREEN_MSG, NULL);
+ aptr->adj_screen_str = val.str;
+
+ token = xf86getSubTokenWithTab(&(ptr->lay_comment), AdjTab);
+ switch (token)
+ {
+ case RIGHTOF:
+ aptr->adj_where = CONF_ADJ_RIGHTOF;
+ break;
+ case LEFTOF:
+ aptr->adj_where = CONF_ADJ_LEFTOF;
+ break;
+ case ABOVE:
+ aptr->adj_where = CONF_ADJ_ABOVE;
+ break;
+ case BELOW:
+ aptr->adj_where = CONF_ADJ_BELOW;
+ break;
+ case RELATIVE:
+ aptr->adj_where = CONF_ADJ_RELATIVE;
+ break;
+ case ABSOLUTE:
+ aptr->adj_where = CONF_ADJ_ABSOLUTE;
+ absKeyword = 1;
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ xf86unGetToken (token);
+ token = xf86getSubToken(&(ptr->lay_comment));
+ if (token == STRING)
+ aptr->adj_where = CONF_ADJ_OBSOLETE;
+ else
+ aptr->adj_where = CONF_ADJ_ABSOLUTE;
+ }
+ switch (aptr->adj_where)
+ {
+ case CONF_ADJ_ABSOLUTE:
+ if (absKeyword)
+ token = xf86getSubToken(&(ptr->lay_comment));
+ if (token == NUMBER)
+ {
+ aptr->adj_x = val.num;
+ token = xf86getSubToken(&(ptr->lay_comment));
+ if (token != NUMBER)
+ Error(INVALID_SCR_MSG, NULL);
+ aptr->adj_y = val.num;
+ } else {
+ if (absKeyword)
+ Error(INVALID_SCR_MSG, NULL);
+ else
+ xf86unGetToken (token);
+ }
+ break;
+ case CONF_ADJ_RIGHTOF:
+ case CONF_ADJ_LEFTOF:
+ case CONF_ADJ_ABOVE:
+ case CONF_ADJ_BELOW:
+ case CONF_ADJ_RELATIVE:
+ token = xf86getSubToken(&(ptr->lay_comment));
+ if (token != STRING)
+ Error(INVALID_SCR_MSG, NULL);
+ aptr->adj_refscreen = val.str;
+ if (aptr->adj_where == CONF_ADJ_RELATIVE)
+ {
+ token = xf86getSubToken(&(ptr->lay_comment));
+ if (token != NUMBER)
+ Error(INVALID_SCR_MSG, NULL);
+ aptr->adj_x = val.num;
+ token = xf86getSubToken(&(ptr->lay_comment));
+ if (token != NUMBER)
+ Error(INVALID_SCR_MSG, NULL);
+ aptr->adj_y = val.num;
+ }
+ break;
+ case CONF_ADJ_OBSOLETE:
+ /* top */
+ aptr->adj_top_str = val.str;
+
+ /* bottom */
+ if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
+ Error (SCREEN_MSG, NULL);
+ aptr->adj_bottom_str = val.str;
+
+ /* left */
+ if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
+ Error (SCREEN_MSG, NULL);
+ aptr->adj_left_str = val.str;
+
+ /* right */
+ if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
+ Error (SCREEN_MSG, NULL);
+ aptr->adj_right_str = val.str;
+
+ }
+ ptr->lay_adjacency_lst = (XF86ConfAdjacencyPtr)
+ xf86addListItem ((glp) ptr->lay_adjacency_lst, (glp) aptr);
+ }
+ break;
+ case INPUTDEVICE:
+ {
+ XF86ConfInputrefPtr iptr;
+
+ iptr = xf86confcalloc (1, sizeof (XF86ConfInputrefRec));
+ iptr->list.next = NULL;
+ iptr->iref_option_lst = NULL;
+ if (xf86getSubToken (&(ptr->lay_comment)) != STRING)
+ Error (INPUTDEV_MSG, NULL);
+ iptr->iref_inputdev_str = val.str;
+ while ((token = xf86getSubToken (&(ptr->lay_comment))) == STRING)
+ {
+ iptr->iref_option_lst =
+ xf86addNewOption (iptr->iref_option_lst, val.str, NULL);
+ }
+ xf86unGetToken (token);
+ ptr->lay_input_lst = (XF86ConfInputrefPtr)
+ xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr);
+ }
+ break;
+ case OPTION:
+ ptr->lay_option_lst = xf86parseOption(ptr->lay_option_lst);
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+ if (!has_ident)
+ Error (NO_IDENT_MSG, NULL);
+
+#ifdef DEBUG
+ printf ("Layout section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printLayoutSection (FILE * cf, XF86ConfLayoutPtr ptr)
+{
+ XF86ConfAdjacencyPtr aptr;
+ XF86ConfInactivePtr iptr;
+ XF86ConfInputrefPtr inptr;
+ XF86OptionPtr optr;
+
+ while (ptr)
+ {
+ fprintf (cf, "Section \"ServerLayout\"\n");
+ if (ptr->lay_comment)
+ fprintf (cf, "%s", ptr->lay_comment);
+ if (ptr->lay_identifier)
+ fprintf (cf, "\tIdentifier \"%s\"\n", ptr->lay_identifier);
+
+ for (aptr = ptr->lay_adjacency_lst; aptr; aptr = aptr->list.next)
+ {
+ fprintf (cf, "\tScreen ");
+ if (aptr->adj_scrnum >= 0)
+ fprintf (cf, "%2d", aptr->adj_scrnum);
+ else
+ fprintf (cf, " ");
+ fprintf (cf, " \"%s\"", aptr->adj_screen_str);
+ switch(aptr->adj_where)
+ {
+ case CONF_ADJ_OBSOLETE:
+ fprintf (cf, " \"%s\"", aptr->adj_top_str);
+ fprintf (cf, " \"%s\"", aptr->adj_bottom_str);
+ fprintf (cf, " \"%s\"", aptr->adj_right_str);
+ fprintf (cf, " \"%s\"\n", aptr->adj_left_str);
+ break;
+ case CONF_ADJ_ABSOLUTE:
+ if (aptr->adj_x != -1)
+ fprintf (cf, " %d %d\n", aptr->adj_x, aptr->adj_y);
+ else
+ fprintf (cf, "\n");
+ break;
+ case CONF_ADJ_RIGHTOF:
+ fprintf (cf, " RightOf \"%s\"\n", aptr->adj_refscreen);
+ break;
+ case CONF_ADJ_LEFTOF:
+ fprintf (cf, " LeftOf \"%s\"\n", aptr->adj_refscreen);
+ break;
+ case CONF_ADJ_ABOVE:
+ fprintf (cf, " Above \"%s\"\n", aptr->adj_refscreen);
+ break;
+ case CONF_ADJ_BELOW:
+ fprintf (cf, " Below \"%s\"\n", aptr->adj_refscreen);
+ break;
+ case CONF_ADJ_RELATIVE:
+ fprintf (cf, " Relative \"%s\" %d %d\n", aptr->adj_refscreen,
+ aptr->adj_x, aptr->adj_y);
+ break;
+ }
+ }
+ for (iptr = ptr->lay_inactive_lst; iptr; iptr = iptr->list.next)
+ fprintf (cf, "\tInactive \"%s\"\n", iptr->inactive_device_str);
+ for (inptr = ptr->lay_input_lst; inptr; inptr = inptr->list.next)
+ {
+ fprintf (cf, "\tInputDevice \"%s\"", inptr->iref_inputdev_str);
+ for (optr = inptr->iref_option_lst; optr; optr = optr->list.next)
+ {
+ fprintf(cf, " \"%s\"", optr->opt_name);
+ }
+ fprintf(cf, "\n");
+ }
+ xf86printOptionList(cf, ptr->lay_option_lst, 1);
+ fprintf (cf, "EndSection\n\n");
+ ptr = ptr->list.next;
+ }
+}
+
+void
+xf86freeLayoutList (XF86ConfLayoutPtr ptr)
+{
+ XF86ConfLayoutPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->lay_identifier);
+ TestFree (ptr->lay_comment);
+ xf86freeAdjacencyList (ptr->lay_adjacency_lst);
+ xf86freeInputrefList (ptr->lay_input_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+void
+xf86freeAdjacencyList (XF86ConfAdjacencyPtr ptr)
+{
+ XF86ConfAdjacencyPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->adj_screen_str);
+ TestFree (ptr->adj_top_str);
+ TestFree (ptr->adj_bottom_str);
+ TestFree (ptr->adj_left_str);
+ TestFree (ptr->adj_right_str);
+
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+
+}
+
+void
+xf86freeInputrefList (XF86ConfInputrefPtr ptr)
+{
+ XF86ConfInputrefPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->iref_inputdev_str);
+ xf86optionListFree (ptr->iref_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+
+}
+
+#define CheckScreen(str, ptr)\
+if (str[0] != '\0') \
+{ \
+screen = xf86findScreen (str, p->conf_screen_lst); \
+if (!screen) \
+{ \
+ xf86validationError (UNDEFINED_SCREEN_MSG, \
+ str, layout->lay_identifier); \
+ return (FALSE); \
+} \
+else \
+ ptr = screen; \
+}
+
+int
+xf86validateLayout (XF86ConfigPtr p)
+{
+ XF86ConfLayoutPtr layout = p->conf_layout_lst;
+ XF86ConfAdjacencyPtr adj;
+ XF86ConfInactivePtr iptr;
+ XF86ConfInputrefPtr inptr;
+ XF86ConfScreenPtr screen;
+ XF86ConfDevicePtr device;
+ XF86ConfInputPtr input;
+
+ while (layout)
+ {
+ adj = layout->lay_adjacency_lst;
+ while (adj)
+ {
+ /* the first one can't be "" but all others can */
+ screen = xf86findScreen (adj->adj_screen_str, p->conf_screen_lst);
+ if (!screen)
+ {
+ xf86validationError (UNDEFINED_SCREEN_MSG,
+ adj->adj_screen_str, layout->lay_identifier);
+ return (FALSE);
+ }
+ else
+ adj->adj_screen = screen;
+
+#if 0
+ CheckScreen (adj->adj_top_str, adj->adj_top);
+ CheckScreen (adj->adj_bottom_str, adj->adj_bottom);
+ CheckScreen (adj->adj_left_str, adj->adj_left);
+ CheckScreen (adj->adj_right_str, adj->adj_right);
+#endif
+
+ adj = adj->list.next;
+ }
+ iptr = layout->lay_inactive_lst;
+ while (iptr)
+ {
+ device = xf86findDevice (iptr->inactive_device_str,
+ p->conf_device_lst);
+ if (!device)
+ {
+ xf86validationError (UNDEFINED_DEVICE_LAY_MSG,
+ iptr->inactive_device_str, layout->lay_identifier);
+ return (FALSE);
+ }
+ else
+ iptr->inactive_device = device;
+ iptr = iptr->list.next;
+ }
+ inptr = layout->lay_input_lst;
+ while (inptr)
+ {
+ input = xf86findInput (inptr->iref_inputdev_str,
+ p->conf_input_lst);
+ if (!input)
+ {
+ xf86validationError (UNDEFINED_INPUT_MSG,
+ inptr->iref_inputdev_str, layout->lay_identifier);
+ return (FALSE);
+ }
+ else
+ inptr->iref_inputdev = input;
+ inptr = inptr->list.next;
+ }
+ layout = layout->list.next;
+ }
+ return (TRUE);
+}
+
+XF86ConfLayoutPtr
+xf86findLayout (const char *name, XF86ConfLayoutPtr list)
+{
+ while (list)
+ {
+ if (xf86nameCompare (list->lay_identifier, name) == 0)
+ return (list);
+ list = list->list.next;
+ }
+ return (NULL);
+}
+
diff --git a/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c
new file mode 100644
index 000000000..1d61da9a6
--- /dev/null
+++ b/hw/xfree86/parser/Module.c
@@ -0,0 +1,230 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Module.c,v 1.11 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec SubModuleTab[] =
+{
+ {ENDSUBSECTION, "endsubsection"},
+ {OPTION, "option"},
+ {-1, ""},
+};
+
+static xf86ConfigSymTabRec ModuleTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {LOAD, "load"},
+ {LOAD_DRIVER, "loaddriver"},
+ {SUBSECTION, "subsection"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeModules
+
+XF86LoadPtr
+xf86parseModuleSubSection (XF86LoadPtr head, char *name)
+{
+ int token;
+ parsePrologue (XF86LoadPtr, XF86LoadRec)
+
+ ptr->load_name = name;
+ ptr->load_type = XF86_LOAD_MODULE;
+ ptr->load_opt = NULL;
+ ptr->list.next = NULL;
+
+ while ((token = xf86getToken (SubModuleTab)) != ENDSUBSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->load_comment = xf86addComment(ptr->load_comment, val.str);
+ break;
+ case OPTION:
+ ptr->load_opt = xf86parseOption(ptr->load_opt);
+ break;
+ case EOF_TOKEN:
+ xf86parseError (UNEXPECTED_EOF_MSG, NULL);
+ xf86conffree(ptr);
+ return NULL;
+ default:
+ xf86parseError (INVALID_KEYWORD_MSG, xf86tokenString ());
+ xf86conffree(ptr);
+ return NULL;
+ break;
+ }
+
+ }
+
+ return ((XF86LoadPtr) xf86addListItem ((glp) head, (glp) ptr));
+}
+
+XF86ConfModulePtr
+xf86parseModuleSection (void)
+{
+ int token;
+ parsePrologue (XF86ConfModulePtr, XF86ConfModuleRec)
+
+ while ((token = xf86getToken (ModuleTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->mod_comment = xf86addComment(ptr->mod_comment, val.str);
+ break;
+ case LOAD:
+ if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
+ Error (QUOTE_MSG, "Load");
+ ptr->mod_load_lst =
+ xf86addNewLoadDirective (ptr->mod_load_lst, val.str,
+ XF86_LOAD_MODULE, NULL);
+ break;
+ case LOAD_DRIVER:
+ if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
+ Error (QUOTE_MSG, "LoadDriver");
+ ptr->mod_load_lst =
+ xf86addNewLoadDirective (ptr->mod_load_lst, val.str,
+ XF86_LOAD_DRIVER, NULL);
+ break;
+ case SUBSECTION:
+ if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
+ Error (QUOTE_MSG, "SubSection");
+ ptr->mod_load_lst =
+ xf86parseModuleSubSection (ptr->mod_load_lst, val.str);
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+#ifdef DEBUG
+ printf ("Module section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printModuleSection (FILE * cf, XF86ConfModulePtr ptr)
+{
+ XF86LoadPtr lptr;
+
+ if (ptr == NULL)
+ return;
+
+ if (ptr->mod_comment)
+ fprintf(cf, "%s", ptr->mod_comment);
+ for (lptr = ptr->mod_load_lst; lptr; lptr = lptr->list.next)
+ {
+ switch (lptr->load_type)
+ {
+ case XF86_LOAD_MODULE:
+ if( lptr->load_opt == NULL ) {
+ fprintf (cf, "\tLoad \"%s\"", lptr->load_name);
+ if (lptr->load_comment)
+ fprintf(cf, "%s", lptr->load_comment);
+ else
+ fputc('\n', cf);
+ }
+ else
+ {
+ fprintf (cf, "\tSubSection \"%s\"\n", lptr->load_name);
+ if (lptr->load_comment)
+ fprintf(cf, "%s", lptr->load_comment);
+ xf86printOptionList(cf, lptr->load_opt, 2);
+ fprintf (cf, "\tEndSubSection\n");
+ }
+ break;
+ case XF86_LOAD_DRIVER:
+ fprintf (cf, "\tLoadDriver \"%s\"", lptr->load_name);
+ if (lptr->load_comment)
+ fprintf(cf, "%s", lptr->load_comment);
+ else
+ fputc('\n', cf);
+ break;
+#if 0
+ default:
+ fprintf (cf, "#\tUnknown type \"%s\"\n", lptr->load_name);
+ break;
+#endif
+ }
+ }
+}
+
+XF86LoadPtr
+xf86addNewLoadDirective (XF86LoadPtr head, char *name, int type, XF86OptionPtr opts)
+{
+ XF86LoadPtr new;
+ int token;
+
+ new = xf86confcalloc (1, sizeof (XF86LoadRec));
+ new->load_name = name;
+ new->load_type = type;
+ new->load_opt = opts;
+ new->list.next = NULL;
+
+ if ((token = xf86getToken(NULL)) == COMMENT)
+ new->load_comment = xf86addComment(new->load_comment, val.str);
+ else
+ xf86unGetToken(token);
+
+ return ((XF86LoadPtr) xf86addListItem ((glp) head, (glp) new));
+}
+
+void
+xf86freeModules (XF86ConfModulePtr ptr)
+{
+ XF86LoadPtr lptr;
+ XF86LoadPtr prev;
+
+ if (ptr == NULL)
+ return;
+ lptr = ptr->mod_load_lst;
+ while (lptr)
+ {
+ TestFree (lptr->load_name);
+ TestFree (lptr->load_comment);
+ prev = lptr;
+ lptr = lptr->list.next;
+ xf86conffree (prev);
+ }
+ TestFree (ptr->mod_comment);
+ xf86conffree (ptr);
+}
diff --git a/hw/xfree86/parser/Monitor.c b/hw/xfree86/parser/Monitor.c
new file mode 100644
index 000000000..939b621ea
--- /dev/null
+++ b/hw/xfree86/parser/Monitor.c
@@ -0,0 +1,874 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v 1.27 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec MonitorTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {IDENTIFIER, "identifier"},
+ {VENDOR, "vendorname"},
+ {MODEL, "modelname"},
+ {USEMODES, "usemodes"},
+ {MODELINE, "modeline"},
+ {DISPLAYSIZE, "displaysize"},
+ {HORIZSYNC, "horizsync"},
+ {VERTREFRESH, "vertrefresh"},
+ {MODE, "mode"},
+ {GAMMA, "gamma"},
+ {OPTION, "option"},
+ {-1, ""},
+};
+
+static xf86ConfigSymTabRec ModesTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {IDENTIFIER, "identifier"},
+ {MODELINE, "modeline"},
+ {MODE, "mode"},
+ {-1, ""},
+};
+
+static xf86ConfigSymTabRec TimingTab[] =
+{
+ {TT_INTERLACE, "interlace"},
+ {TT_PHSYNC, "+hsync"},
+ {TT_NHSYNC, "-hsync"},
+ {TT_PVSYNC, "+vsync"},
+ {TT_NVSYNC, "-vsync"},
+ {TT_CSYNC, "composite"},
+ {TT_PCSYNC, "+csync"},
+ {TT_NCSYNC, "-csync"},
+ {TT_DBLSCAN, "doublescan"},
+ {TT_HSKEW, "hskew"},
+ {TT_BCAST, "bcast"},
+ {TT_VSCAN, "vscan"},
+ {TT_CUSTOM, "CUSTOM"},
+ {-1, ""},
+};
+
+static xf86ConfigSymTabRec ModeTab[] =
+{
+ {DOTCLOCK, "dotclock"},
+ {HTIMINGS, "htimings"},
+ {VTIMINGS, "vtimings"},
+ {FLAGS, "flags"},
+ {HSKEW, "hskew"},
+ {BCAST, "bcast"},
+ {VSCAN, "vscan"},
+ {ENDMODE, "endmode"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeModeLineList
+
+XF86ConfModeLinePtr
+xf86parseModeLine (void)
+{
+ int token;
+ parsePrologue (XF86ConfModeLinePtr, XF86ConfModeLineRec)
+
+ /* Identifier */
+ if (xf86getSubToken (&(ptr->ml_comment)) != STRING)
+ Error ("ModeLine identifier expected", NULL);
+ ptr->ml_identifier = val.str;
+
+ /* DotClock */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine dotclock expected", NULL);
+ ptr->ml_clock = (int) (val.realnum * 1000.0 + 0.5);
+
+ /* HDisplay */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine Hdisplay expected", NULL);
+ ptr->ml_hdisplay = val.num;
+
+ /* HSyncStart */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine HSyncStart expected", NULL);
+ ptr->ml_hsyncstart = val.num;
+
+ /* HSyncEnd */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine HSyncEnd expected", NULL);
+ ptr->ml_hsyncend = val.num;
+
+ /* HTotal */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine HTotal expected", NULL);
+ ptr->ml_htotal = val.num;
+
+ /* VDisplay */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine Vdisplay expected", NULL);
+ ptr->ml_vdisplay = val.num;
+
+ /* VSyncStart */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine VSyncStart expected", NULL);
+ ptr->ml_vsyncstart = val.num;
+
+ /* VSyncEnd */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine VSyncEnd expected", NULL);
+ ptr->ml_vsyncend = val.num;
+
+ /* VTotal */
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("ModeLine VTotal expected", NULL);
+ ptr->ml_vtotal = val.num;
+
+ token = xf86getSubTokenWithTab (&(ptr->ml_comment), TimingTab);
+ while ((token == TT_INTERLACE) || (token == TT_PHSYNC) ||
+ (token == TT_NHSYNC) || (token == TT_PVSYNC) ||
+ (token == TT_NVSYNC) || (token == TT_CSYNC) ||
+ (token == TT_PCSYNC) || (token == TT_NCSYNC) ||
+ (token == TT_DBLSCAN) || (token == TT_HSKEW) ||
+ (token == TT_VSCAN) || (token == TT_BCAST))
+ {
+ switch (token)
+ {
+
+ case TT_INTERLACE:
+ ptr->ml_flags |= XF86CONF_INTERLACE;
+ break;
+ case TT_PHSYNC:
+ ptr->ml_flags |= XF86CONF_PHSYNC;
+ break;
+ case TT_NHSYNC:
+ ptr->ml_flags |= XF86CONF_NHSYNC;
+ break;
+ case TT_PVSYNC:
+ ptr->ml_flags |= XF86CONF_PVSYNC;
+ break;
+ case TT_NVSYNC:
+ ptr->ml_flags |= XF86CONF_NVSYNC;
+ break;
+ case TT_CSYNC:
+ ptr->ml_flags |= XF86CONF_CSYNC;
+ break;
+ case TT_PCSYNC:
+ ptr->ml_flags |= XF86CONF_PCSYNC;
+ break;
+ case TT_NCSYNC:
+ ptr->ml_flags |= XF86CONF_NCSYNC;
+ break;
+ case TT_DBLSCAN:
+ ptr->ml_flags |= XF86CONF_DBLSCAN;
+ break;
+ case TT_HSKEW:
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error (NUMBER_MSG, "Hskew");
+ ptr->ml_hskew = val.num;
+ ptr->ml_flags |= XF86CONF_HSKEW;
+ break;
+ case TT_BCAST:
+ ptr->ml_flags |= XF86CONF_BCAST;
+ break;
+ case TT_VSCAN:
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error (NUMBER_MSG, "Vscan");
+ ptr->ml_vscan = val.num;
+ ptr->ml_flags |= XF86CONF_VSCAN;
+ break;
+ case TT_CUSTOM:
+ ptr->ml_flags |= XF86CONF_CUSTOM;
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ token = xf86getSubTokenWithTab (&(ptr->ml_comment), TimingTab);
+ }
+ xf86unGetToken (token);
+
+#ifdef DEBUG
+ printf ("ModeLine parsed\n");
+#endif
+ return (ptr);
+}
+
+XF86ConfModeLinePtr
+xf86parseVerboseMode (void)
+{
+ int token, token2;
+ int had_dotclock = 0, had_htimings = 0, had_vtimings = 0;
+ parsePrologue (XF86ConfModeLinePtr, XF86ConfModeLineRec)
+
+ if (xf86getSubToken (&(ptr->ml_comment)) != STRING)
+ Error ("Mode name expected", NULL);
+ ptr->ml_identifier = val.str;
+ while ((token = xf86getToken (ModeTab)) != ENDMODE)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->ml_comment = xf86addComment(ptr->ml_comment, val.str);
+ break;
+ case DOTCLOCK:
+ if ((token = xf86getSubToken (&(ptr->ml_comment))) != NUMBER)
+ Error (NUMBER_MSG, "DotClock");
+ ptr->ml_clock = (int) (val.realnum * 1000.0 + 0.5);
+ had_dotclock = 1;
+ break;
+ case HTIMINGS:
+ if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
+ ptr->ml_hdisplay = val.num;
+ else
+ Error ("Horizontal display expected", NULL);
+
+ if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
+ ptr->ml_hsyncstart = val.num;
+ else
+ Error ("Horizontal sync start expected", NULL);
+
+ if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
+ ptr->ml_hsyncend = val.num;
+ else
+ Error ("Horizontal sync end expected", NULL);
+
+ if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
+ ptr->ml_htotal = val.num;
+ else
+ Error ("Horizontal total expected", NULL);
+ had_htimings = 1;
+ break;
+ case VTIMINGS:
+ if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
+ ptr->ml_vdisplay = val.num;
+ else
+ Error ("Vertical display expected", NULL);
+
+ if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
+ ptr->ml_vsyncstart = val.num;
+ else
+ Error ("Vertical sync start expected", NULL);
+
+ if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
+ ptr->ml_vsyncend = val.num;
+ else
+ Error ("Vertical sync end expected", NULL);
+
+ if (xf86getSubToken (&(ptr->ml_comment)) == NUMBER)
+ ptr->ml_vtotal = val.num;
+ else
+ Error ("Vertical total expected", NULL);
+ had_vtimings = 1;
+ break;
+ case FLAGS:
+ token = xf86getSubToken (&(ptr->ml_comment));
+ if (token != STRING)
+ Error (QUOTE_MSG, "Flags");
+ while (token == STRING)
+ {
+ token2 = xf86getStringToken (TimingTab);
+ switch (token2)
+ {
+ case TT_INTERLACE:
+ ptr->ml_flags |= XF86CONF_INTERLACE;
+ break;
+ case TT_PHSYNC:
+ ptr->ml_flags |= XF86CONF_PHSYNC;
+ break;
+ case TT_NHSYNC:
+ ptr->ml_flags |= XF86CONF_NHSYNC;
+ break;
+ case TT_PVSYNC:
+ ptr->ml_flags |= XF86CONF_PVSYNC;
+ break;
+ case TT_NVSYNC:
+ ptr->ml_flags |= XF86CONF_NVSYNC;
+ break;
+ case TT_CSYNC:
+ ptr->ml_flags |= XF86CONF_CSYNC;
+ break;
+ case TT_PCSYNC:
+ ptr->ml_flags |= XF86CONF_PCSYNC;
+ break;
+ case TT_NCSYNC:
+ ptr->ml_flags |= XF86CONF_NCSYNC;
+ break;
+ case TT_DBLSCAN:
+ ptr->ml_flags |= XF86CONF_DBLSCAN;
+ break;
+ case TT_CUSTOM:
+ ptr->ml_flags |= XF86CONF_CUSTOM;
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error ("Unknown flag string", NULL);
+ break;
+ }
+ token = xf86getSubToken (&(ptr->ml_comment));
+ }
+ xf86unGetToken (token);
+ break;
+ case HSKEW:
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("Horizontal skew expected", NULL);
+ ptr->ml_flags |= XF86CONF_HSKEW;
+ ptr->ml_hskew = val.num;
+ break;
+ case VSCAN:
+ if (xf86getSubToken (&(ptr->ml_comment)) != NUMBER)
+ Error ("Vertical scan count expected", NULL);
+ ptr->ml_flags |= XF86CONF_VSCAN;
+ ptr->ml_vscan = val.num;
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error ("Unexepcted token in verbose \"Mode\" entry\n", NULL);
+ }
+ }
+ if (!had_dotclock)
+ Error ("the dotclock is missing", NULL);
+ if (!had_htimings)
+ Error ("the horizontal timings are missing", NULL);
+ if (!had_vtimings)
+ Error ("the vertical timings are missing", NULL);
+
+#ifdef DEBUG
+ printf ("Verbose Mode parsed\n");
+#endif
+ return (ptr);
+}
+
+#undef CLEANUP
+
+#define CLEANUP xf86freeMonitorList
+
+XF86ConfMonitorPtr
+xf86parseMonitorSection (void)
+{
+ int has_ident = FALSE;
+ int token;
+ parsePrologue (XF86ConfMonitorPtr, XF86ConfMonitorRec)
+
+ while ((token = xf86getToken (MonitorTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->mon_comment = xf86addComment(ptr->mon_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->mon_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ ptr->mon_identifier = val.str;
+ has_ident = TRUE;
+ break;
+ case VENDOR:
+ if (xf86getSubToken (&(ptr->mon_comment)) != STRING)
+ Error (QUOTE_MSG, "Vendor");
+ ptr->mon_vendor = val.str;
+ break;
+ case MODEL:
+ if (xf86getSubToken (&(ptr->mon_comment)) != STRING)
+ Error (QUOTE_MSG, "ModelName");
+ ptr->mon_modelname = val.str;
+ break;
+ case MODE:
+ HANDLE_LIST (mon_modeline_lst, xf86parseVerboseMode,
+ XF86ConfModeLinePtr);
+ break;
+ case MODELINE:
+ HANDLE_LIST (mon_modeline_lst, xf86parseModeLine,
+ XF86ConfModeLinePtr);
+ break;
+ case DISPLAYSIZE:
+ if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
+ Error (DISPLAYSIZE_MSG, NULL);
+ ptr->mon_width = val.realnum;
+ if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
+ Error (DISPLAYSIZE_MSG, NULL);
+ ptr->mon_height = val.realnum;
+ break;
+
+ case HORIZSYNC:
+ if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
+ Error (HORIZSYNC_MSG, NULL);
+ do {
+ ptr->mon_hsync[ptr->mon_n_hsync].lo = val.realnum;
+ switch (token = xf86getSubToken (&(ptr->mon_comment)))
+ {
+ case COMMA:
+ ptr->mon_hsync[ptr->mon_n_hsync].hi =
+ ptr->mon_hsync[ptr->mon_n_hsync].lo;
+ break;
+ case DASH:
+ if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER ||
+ (float)val.realnum < ptr->mon_hsync[ptr->mon_n_hsync].lo)
+ Error (HORIZSYNC_MSG, NULL);
+ ptr->mon_hsync[ptr->mon_n_hsync].hi = val.realnum;
+ if ((token = xf86getSubToken (&(ptr->mon_comment))) == COMMA)
+ break;
+ ptr->mon_n_hsync++;
+ goto HorizDone;
+ default:
+ /* We cannot currently know if a '\n' was found,
+ * or this is a real error
+ */
+ ptr->mon_hsync[ptr->mon_n_hsync].hi =
+ ptr->mon_hsync[ptr->mon_n_hsync].lo;
+ ptr->mon_n_hsync++;
+ goto HorizDone;
+ }
+ if (ptr->mon_n_hsync >= CONF_MAX_HSYNC)
+ Error ("Sorry. Too many horizontal sync intervals.", NULL);
+ ptr->mon_n_hsync++;
+ } while ((token = xf86getSubToken (&(ptr->mon_comment))) == NUMBER);
+HorizDone:
+ xf86unGetToken (token);
+ break;
+
+ case VERTREFRESH:
+ if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER)
+ Error (VERTREFRESH_MSG, NULL);
+ do {
+ ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo = val.realnum;
+ switch (token = xf86getSubToken (&(ptr->mon_comment)))
+ {
+ case COMMA:
+ ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi =
+ ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo;
+ break;
+ case DASH:
+ if (xf86getSubToken (&(ptr->mon_comment)) != NUMBER ||
+ (float)val.realnum < ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo)
+ Error (VERTREFRESH_MSG, NULL);
+ ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = val.realnum;
+ if ((token = xf86getSubToken (&(ptr->mon_comment))) == COMMA)
+ break;
+ ptr->mon_n_vrefresh++;
+ goto VertDone;
+ default:
+ /* We cannot currently know if a '\n' was found,
+ * or this is a real error
+ */
+ ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi =
+ ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo;
+ ptr->mon_n_vrefresh++;
+ goto VertDone;
+ }
+ if (ptr->mon_n_vrefresh >= CONF_MAX_VREFRESH)
+ Error ("Sorry. Too many vertical refresh intervals.", NULL);
+ ptr->mon_n_vrefresh++;
+ } while ((token = xf86getSubToken (&(ptr->mon_comment))) == NUMBER);
+VertDone:
+ xf86unGetToken (token);
+ break;
+
+ case GAMMA:
+ if( xf86getSubToken (&(ptr->mon_comment)) != NUMBER )
+ {
+ Error (INVALID_GAMMA_MSG, NULL);
+ }
+ else
+ {
+ ptr->mon_gamma_red = ptr->mon_gamma_green =
+ ptr->mon_gamma_blue = val.realnum;
+ if( xf86getSubToken (&(ptr->mon_comment)) == NUMBER )
+ {
+ ptr->mon_gamma_green = val.realnum;
+ if( xf86getSubToken (&(ptr->mon_comment)) == NUMBER )
+ {
+ ptr->mon_gamma_blue = val.realnum;
+ }
+ else
+ {
+ Error (INVALID_GAMMA_MSG, NULL);
+ }
+ }
+ else
+ xf86unGetToken (token);
+ }
+ break;
+ case OPTION:
+ ptr->mon_option_lst = xf86parseOption(ptr->mon_option_lst);
+ break;
+ case USEMODES:
+ {
+ XF86ConfModesLinkPtr mptr;
+
+ if ((token = xf86getSubToken (&(ptr->mon_comment))) != STRING)
+ Error (QUOTE_MSG, "UseModes");
+
+ /* add to the end of the list of modes sections
+ referenced here */
+ mptr = xf86confcalloc (1, sizeof (XF86ConfModesLinkRec));
+ mptr->list.next = NULL;
+ mptr->ml_modes_str = val.str;
+ mptr->ml_modes = NULL;
+ ptr->mon_modes_sect_lst = (XF86ConfModesLinkPtr)
+ xf86addListItem((GenericListPtr)ptr->mon_modes_sect_lst,
+ (GenericListPtr)mptr);
+ }
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ xf86parseError (INVALID_KEYWORD_MSG, xf86tokenString ());
+ CLEANUP (ptr);
+ return NULL;
+ break;
+ }
+ }
+
+ if (!has_ident)
+ Error (NO_IDENT_MSG, NULL);
+
+#ifdef DEBUG
+ printf ("Monitor section parsed\n");
+#endif
+ return ptr;
+}
+
+#undef CLEANUP
+#define CLEANUP xf86freeModesList
+
+XF86ConfModesPtr
+xf86parseModesSection (void)
+{
+ int has_ident = FALSE;
+ int token;
+ parsePrologue (XF86ConfModesPtr, XF86ConfModesRec)
+
+ while ((token = xf86getToken (ModesTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->modes_comment = xf86addComment(ptr->modes_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->modes_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ ptr->modes_identifier = val.str;
+ has_ident = TRUE;
+ break;
+ case MODE:
+ HANDLE_LIST (mon_modeline_lst, xf86parseVerboseMode,
+ XF86ConfModeLinePtr);
+ break;
+ case MODELINE:
+ HANDLE_LIST (mon_modeline_lst, xf86parseModeLine,
+ XF86ConfModeLinePtr);
+ break;
+ default:
+ xf86parseError (INVALID_KEYWORD_MSG, xf86tokenString ());
+ CLEANUP (ptr);
+ return NULL;
+ break;
+ }
+ }
+
+ if (!has_ident)
+ Error (NO_IDENT_MSG, NULL);
+
+#ifdef DEBUG
+ printf ("Modes section parsed\n");
+#endif
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printMonitorSection (FILE * cf, XF86ConfMonitorPtr ptr)
+{
+ int i;
+ XF86ConfModeLinePtr mlptr;
+ XF86ConfModesLinkPtr mptr;
+
+ while (ptr)
+ {
+ mptr = ptr->mon_modes_sect_lst;
+ fprintf (cf, "Section \"Monitor\"\n");
+ if (ptr->mon_comment)
+ fprintf (cf, "%s", ptr->mon_comment);
+ if (ptr->mon_identifier)
+ fprintf (cf, "\tIdentifier \"%s\"\n", ptr->mon_identifier);
+ if (ptr->mon_vendor)
+ fprintf (cf, "\tVendorName \"%s\"\n", ptr->mon_vendor);
+ if (ptr->mon_modelname)
+ fprintf (cf, "\tModelName \"%s\"\n", ptr->mon_modelname);
+ while (mptr) {
+ fprintf (cf, "\tUseModes \"%s\"\n", mptr->ml_modes_str);
+ mptr = mptr->list.next;
+ }
+ if (ptr->mon_width)
+ fprintf (cf, "\tDisplaySize %d\t%d\n",
+ ptr->mon_width,
+ ptr->mon_height);
+ for (i = 0; i < ptr->mon_n_hsync; i++)
+ {
+ fprintf (cf, "\tHorizSync %2.1f - %2.1f\n",
+ ptr->mon_hsync[i].lo,
+ ptr->mon_hsync[i].hi);
+ }
+ for (i = 0; i < ptr->mon_n_vrefresh; i++)
+ {
+ fprintf (cf, "\tVertRefresh %2.1f - %2.1f\n",
+ ptr->mon_vrefresh[i].lo,
+ ptr->mon_vrefresh[i].hi);
+ }
+ if (ptr->mon_gamma_red) {
+ if (ptr->mon_gamma_red == ptr->mon_gamma_green
+ && ptr->mon_gamma_red == ptr->mon_gamma_blue)
+ {
+ fprintf (cf, "\tGamma %.4g\n",
+ ptr->mon_gamma_red);
+ } else {
+ fprintf (cf, "\tGamma %.4g %.4g %.4g\n",
+ ptr->mon_gamma_red,
+ ptr->mon_gamma_green,
+ ptr->mon_gamma_blue);
+ }
+ }
+ for (mlptr = ptr->mon_modeline_lst; mlptr; mlptr = mlptr->list.next)
+ {
+ fprintf (cf, "\tModeLine \"%s\" %2.1f ",
+ mlptr->ml_identifier, mlptr->ml_clock / 1000.0);
+ fprintf (cf, "%d %d %d %d %d %d %d %d",
+ mlptr->ml_hdisplay, mlptr->ml_hsyncstart,
+ mlptr->ml_hsyncend, mlptr->ml_htotal,
+ mlptr->ml_vdisplay, mlptr->ml_vsyncstart,
+ mlptr->ml_vsyncend, mlptr->ml_vtotal);
+ if (mlptr->ml_flags & XF86CONF_PHSYNC)
+ fprintf (cf, " +hsync");
+ if (mlptr->ml_flags & XF86CONF_NHSYNC)
+ fprintf (cf, " -hsync");
+ if (mlptr->ml_flags & XF86CONF_PVSYNC)
+ fprintf (cf, " +vsync");
+ if (mlptr->ml_flags & XF86CONF_NVSYNC)
+ fprintf (cf, " -vsync");
+ if (mlptr->ml_flags & XF86CONF_INTERLACE)
+ fprintf (cf, " interlace");
+ if (mlptr->ml_flags & XF86CONF_CSYNC)
+ fprintf (cf, " composite");
+ if (mlptr->ml_flags & XF86CONF_PCSYNC)
+ fprintf (cf, " +csync");
+ if (mlptr->ml_flags & XF86CONF_NCSYNC)
+ fprintf (cf, " -csync");
+ if (mlptr->ml_flags & XF86CONF_DBLSCAN)
+ fprintf (cf, " doublescan");
+ if (mlptr->ml_flags & XF86CONF_HSKEW)
+ fprintf (cf, " hskew %d", mlptr->ml_hskew);
+ if (mlptr->ml_flags & XF86CONF_BCAST)
+ fprintf (cf, " bcast");
+ fprintf (cf, "\n");
+ }
+ xf86printOptionList(cf, ptr->mon_option_lst, 1);
+ fprintf (cf, "EndSection\n\n");
+ ptr = ptr->list.next;
+ }
+}
+
+void
+xf86printModesSection (FILE * cf, XF86ConfModesPtr ptr)
+{
+ XF86ConfModeLinePtr mlptr;
+
+ while (ptr)
+ {
+ fprintf (cf, "Section \"Modes\"\n");
+ if (ptr->modes_comment)
+ fprintf (cf, "%s", ptr->modes_comment);
+ if (ptr->modes_identifier)
+ fprintf (cf, "\tIdentifier \"%s\"\n", ptr->modes_identifier);
+ for (mlptr = ptr->mon_modeline_lst; mlptr; mlptr = mlptr->list.next)
+ {
+ fprintf (cf, "\tModeLine \"%s\" %2.1f ",
+ mlptr->ml_identifier, mlptr->ml_clock / 1000.0);
+ fprintf (cf, "%d %d %d %d %d %d %d %d",
+ mlptr->ml_hdisplay, mlptr->ml_hsyncstart,
+ mlptr->ml_hsyncend, mlptr->ml_htotal,
+ mlptr->ml_vdisplay, mlptr->ml_vsyncstart,
+ mlptr->ml_vsyncend, mlptr->ml_vtotal);
+ if (mlptr->ml_flags & XF86CONF_PHSYNC)
+ fprintf (cf, " +hsync");
+ if (mlptr->ml_flags & XF86CONF_NHSYNC)
+ fprintf (cf, " -hsync");
+ if (mlptr->ml_flags & XF86CONF_PVSYNC)
+ fprintf (cf, " +vsync");
+ if (mlptr->ml_flags & XF86CONF_NVSYNC)
+ fprintf (cf, " -vsync");
+ if (mlptr->ml_flags & XF86CONF_INTERLACE)
+ fprintf (cf, " interlace");
+ if (mlptr->ml_flags & XF86CONF_CSYNC)
+ fprintf (cf, " composite");
+ if (mlptr->ml_flags & XF86CONF_PCSYNC)
+ fprintf (cf, " +csync");
+ if (mlptr->ml_flags & XF86CONF_NCSYNC)
+ fprintf (cf, " -csync");
+ if (mlptr->ml_flags & XF86CONF_DBLSCAN)
+ fprintf (cf, " doublescan");
+ if (mlptr->ml_flags & XF86CONF_HSKEW)
+ fprintf (cf, " hskew %d", mlptr->ml_hskew);
+ if (mlptr->ml_flags & XF86CONF_VSCAN)
+ fprintf (cf, " vscan %d", mlptr->ml_vscan);
+ if (mlptr->ml_flags & XF86CONF_BCAST)
+ fprintf (cf, " bcast");
+ if (mlptr->ml_comment)
+ fprintf (cf, "%s", mlptr->ml_comment);
+ else
+ fprintf (cf, "\n");
+ }
+ fprintf (cf, "EndSection\n\n");
+ ptr = ptr->list.next;
+ }
+}
+
+void
+xf86freeMonitorList (XF86ConfMonitorPtr ptr)
+{
+ XF86ConfMonitorPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->mon_identifier);
+ TestFree (ptr->mon_vendor);
+ TestFree (ptr->mon_modelname);
+ TestFree (ptr->mon_comment);
+ xf86optionListFree (ptr->mon_option_lst);
+ xf86freeModeLineList (ptr->mon_modeline_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+void
+xf86freeModesList (XF86ConfModesPtr ptr)
+{
+ XF86ConfModesPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->modes_identifier);
+ TestFree (ptr->modes_comment);
+ xf86freeModeLineList (ptr->mon_modeline_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+void
+xf86freeModeLineList (XF86ConfModeLinePtr ptr)
+{
+ XF86ConfModeLinePtr prev;
+ while (ptr)
+ {
+ TestFree (ptr->ml_identifier);
+ TestFree (ptr->ml_comment);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+XF86ConfMonitorPtr
+xf86findMonitor (const char *ident, XF86ConfMonitorPtr p)
+{
+ while (p)
+ {
+ if (xf86nameCompare (ident, p->mon_identifier) == 0)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
+
+XF86ConfModesPtr
+xf86findModes (const char *ident, XF86ConfModesPtr p)
+{
+ while (p)
+ {
+ if (xf86nameCompare (ident, p->modes_identifier) == 0)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
+
+XF86ConfModeLinePtr
+xf86findModeLine (const char *ident, XF86ConfModeLinePtr p)
+{
+ while (p)
+ {
+ if (xf86nameCompare (ident, p->ml_identifier) == 0)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
+
+int
+xf86validateMonitor (XF86ConfigPtr p, XF86ConfScreenPtr screen)
+{
+ XF86ConfMonitorPtr monitor = screen->scrn_monitor;
+ XF86ConfModesLinkPtr modeslnk = monitor->mon_modes_sect_lst;
+ XF86ConfModesPtr modes;
+ while(modeslnk)
+ {
+ modes = xf86findModes (modeslnk->ml_modes_str, p->conf_modes_lst);
+ if (!modes)
+ {
+ xf86validationError (UNDEFINED_MODES_MSG,
+ modeslnk->ml_modes_str,
+ screen->scrn_identifier);
+ return (FALSE);
+ }
+ modeslnk->ml_modes = modes;
+ modeslnk = modeslnk->list.next;
+ }
+ return (TRUE);
+}
diff --git a/hw/xfree86/parser/Pointer.c b/hw/xfree86/parser/Pointer.c
new file mode 100644
index 000000000..fac4260a4
--- /dev/null
+++ b/hw/xfree86/parser/Pointer.c
@@ -0,0 +1,205 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Pointer.c,v 1.12 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec PointerTab[] =
+{
+ {PROTOCOL, "protocol"},
+ {EMULATE3, "emulate3buttons"},
+ {EM3TIMEOUT, "emulate3timeout"},
+ {ENDSUBSECTION, "endsubsection"},
+ {ENDSECTION, "endsection"},
+ {PDEVICE, "device"},
+ {PDEVICE, "port"},
+ {BAUDRATE, "baudrate"},
+ {SAMPLERATE, "samplerate"},
+ {CLEARDTR, "cleardtr"},
+ {CLEARRTS, "clearrts"},
+ {CHORDMIDDLE, "chordmiddle"},
+ {PRESOLUTION, "resolution"},
+ {DEVICE_NAME, "devicename"},
+ {ALWAYSCORE, "alwayscore"},
+ {PBUTTONS, "buttons"},
+ {ZAXISMAPPING, "zaxismapping"},
+ {-1, ""},
+};
+
+static xf86ConfigSymTabRec ZMapTab[] =
+{
+ {XAXIS, "x"},
+ {YAXIS, "y"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeInputList
+
+XF86ConfInputPtr
+xf86parsePointerSection (void)
+{
+ char *s, *s1, *s2;
+ int l;
+ int token;
+ parsePrologue (XF86ConfInputPtr, XF86ConfInputRec)
+
+ while ((token = xf86getToken (PointerTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->inp_comment = xf86addComment(ptr->inp_comment, val.str);
+ break;
+ case PROTOCOL:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "Protocol");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("Protocol"),
+ val.str);
+ break;
+ case PDEVICE:
+ if (xf86getSubToken (&(ptr->inp_comment)) != STRING)
+ Error (QUOTE_MSG, "Device");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("Device"),
+ val.str);
+ break;
+ case EMULATE3:
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("Emulate3Buttons"),
+ NULL);
+ break;
+ case EM3TIMEOUT:
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
+ Error (POSITIVE_INT_MSG, "Emulate3Timeout");
+ s = xf86uLongToString(val.num);
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("Emulate3Timeout"),
+ s);
+ break;
+ case CHORDMIDDLE:
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("ChordMiddle"),
+ NULL);
+ break;
+ case PBUTTONS:
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
+ Error (POSITIVE_INT_MSG, "Buttons");
+ s = xf86uLongToString(val.num);
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("Buttons"), s);
+ break;
+ case BAUDRATE:
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
+ Error (POSITIVE_INT_MSG, "BaudRate");
+ s = xf86uLongToString(val.num);
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("BaudRate"), s);
+ break;
+ case SAMPLERATE:
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
+ Error (POSITIVE_INT_MSG, "SampleRate");
+ s = xf86uLongToString(val.num);
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("SampleRate"), s);
+ break;
+ case PRESOLUTION:
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
+ Error (POSITIVE_INT_MSG, "Resolution");
+ s = xf86uLongToString(val.num);
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("Resolution"), s);
+ break;
+ case CLEARDTR:
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("ClearDTR"), NULL);
+ break;
+ case CLEARRTS:
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("ClearRTS"), NULL);
+ break;
+ case ZAXISMAPPING:
+ switch (xf86getToken(ZMapTab)) {
+ case NUMBER:
+ if (val.num < 0)
+ Error (ZAXISMAPPING_MSG, NULL);
+ s1 = xf86uLongToString(val.num);
+ if (xf86getSubToken (&(ptr->inp_comment)) != NUMBER || val.num < 0)
+ Error (ZAXISMAPPING_MSG, NULL);
+ s2 = xf86uLongToString(val.num);
+ l = strlen(s1) + 1 + strlen(s2) + 1;
+ s = xf86confmalloc(l);
+ sprintf(s, "%s %s", s1, s2);
+ xf86conffree(s1);
+ xf86conffree(s2);
+ break;
+ case XAXIS:
+ s = xf86configStrdup("x");
+ break;
+ case YAXIS:
+ s = xf86configStrdup("y");
+ break;
+ default:
+ Error (ZAXISMAPPING_MSG, NULL);
+ break;
+ }
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("ZAxisMapping"),
+ s);
+ break;
+ case ALWAYSCORE:
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+ ptr->inp_identifier = xf86configStrdup(CONF_IMPLICIT_POINTER);
+ ptr->inp_driver = xf86configStrdup("mouse");
+ ptr->inp_option_lst = xf86addNewOption(ptr->inp_option_lst,
+ xf86configStrdup("CorePointer"), NULL);
+
+#ifdef DEBUG
+ printf ("Pointer section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
diff --git a/hw/xfree86/parser/Screen.c b/hw/xfree86/parser/Screen.c
new file mode 100644
index 000000000..af8c407a9
--- /dev/null
+++ b/hw/xfree86/parser/Screen.c
@@ -0,0 +1,555 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Screen.c,v 1.24 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec DisplayTab[] =
+{
+ {ENDSUBSECTION, "endsubsection"},
+ {MODES, "modes"},
+ {VIEWPORT, "viewport"},
+ {VIRTUAL, "virtual"},
+ {VISUAL, "visual"},
+ {BLACK_TOK, "black"},
+ {WHITE_TOK, "white"},
+ {DEPTH, "depth"},
+ {BPP, "fbbpp"},
+ {WEIGHT, "weight"},
+ {OPTION, "option"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeDisplayList
+
+XF86ConfDisplayPtr
+xf86parseDisplaySubSection (void)
+{
+ int token;
+ parsePrologue (XF86ConfDisplayPtr, XF86ConfDisplayRec)
+
+ ptr->disp_black.red = ptr->disp_black.green = ptr->disp_black.blue = -1;
+ ptr->disp_white.red = ptr->disp_white.green = ptr->disp_white.blue = -1;
+ while ((token = xf86getToken (DisplayTab)) != ENDSUBSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->disp_comment = xf86addComment(ptr->disp_comment, val.str);
+ break;
+ case VIEWPORT:
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (VIEWPORT_MSG, NULL);
+ ptr->disp_frameX0 = val.num;
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (VIEWPORT_MSG, NULL);
+ ptr->disp_frameY0 = val.num;
+ break;
+ case VIRTUAL:
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (VIRTUAL_MSG, NULL);
+ ptr->disp_virtualX = val.num;
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (VIRTUAL_MSG, NULL);
+ ptr->disp_virtualY = val.num;
+ break;
+ case DEPTH:
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (NUMBER_MSG, "Display");
+ ptr->disp_depth = val.num;
+ break;
+ case BPP:
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (NUMBER_MSG, "Display");
+ ptr->disp_bpp = val.num;
+ break;
+ case VISUAL:
+ if (xf86getSubToken (&(ptr->disp_comment)) != STRING)
+ Error (QUOTE_MSG, "Display");
+ ptr->disp_visual = val.str;
+ break;
+ case WEIGHT:
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (WEIGHT_MSG, NULL);
+ ptr->disp_weight.red = val.num;
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (WEIGHT_MSG, NULL);
+ ptr->disp_weight.green = val.num;
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (WEIGHT_MSG, NULL);
+ ptr->disp_weight.blue = val.num;
+ break;
+ case BLACK_TOK:
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (BLACK_MSG, NULL);
+ ptr->disp_black.red = val.num;
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (BLACK_MSG, NULL);
+ ptr->disp_black.green = val.num;
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (BLACK_MSG, NULL);
+ ptr->disp_black.blue = val.num;
+ break;
+ case WHITE_TOK:
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (WHITE_MSG, NULL);
+ ptr->disp_white.red = val.num;
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (WHITE_MSG, NULL);
+ ptr->disp_white.green = val.num;
+ if (xf86getSubToken (&(ptr->disp_comment)) != NUMBER)
+ Error (WHITE_MSG, NULL);
+ ptr->disp_white.blue = val.num;
+ break;
+ case MODES:
+ {
+ XF86ModePtr mptr;
+
+ while ((token = xf86getSubTokenWithTab (&(ptr->disp_comment), DisplayTab)) == STRING)
+ {
+ mptr = xf86confcalloc (1, sizeof (XF86ModeRec));
+ mptr->mode_name = val.str;
+ mptr->list.next = NULL;
+ ptr->disp_mode_lst = (XF86ModePtr)
+ xf86addListItem ((glp) ptr->disp_mode_lst, (glp) mptr);
+ }
+ xf86unGetToken (token);
+ }
+ break;
+ case OPTION:
+ ptr->disp_option_lst = xf86parseOption(ptr->disp_option_lst);
+ break;
+
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+#ifdef DEBUG
+ printf ("Display subsection parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+static xf86ConfigSymTabRec ScreenTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {IDENTIFIER, "identifier"},
+ {OBSDRIVER, "driver"},
+ {MDEVICE, "device"},
+ {MONITOR, "monitor"},
+ {VIDEOADAPTOR, "videoadaptor"},
+ {SCREENNO, "screenno"},
+ {SUBSECTION, "subsection"},
+ {DEFAULTDEPTH, "defaultcolordepth"},
+ {DEFAULTDEPTH, "defaultdepth"},
+ {DEFAULTBPP, "defaultbpp"},
+ {DEFAULTFBBPP, "defaultfbbpp"},
+ {OPTION, "option"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeScreenList
+XF86ConfScreenPtr
+xf86parseScreenSection (void)
+{
+ int has_ident = FALSE;
+ int has_driver= FALSE;
+ int token;
+
+ parsePrologue (XF86ConfScreenPtr, XF86ConfScreenRec)
+
+ while ((token = xf86getToken (ScreenTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->scrn_comment = xf86addComment(ptr->scrn_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ ptr->scrn_identifier = val.str;
+ if (has_ident || has_driver)
+ Error (ONLY_ONE_MSG,"Identifier or Driver");
+ has_ident = TRUE;
+ break;
+ case OBSDRIVER:
+ if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
+ Error (QUOTE_MSG, "Driver");
+ ptr->scrn_obso_driver = val.str;
+ if (has_ident || has_driver)
+ Error (ONLY_ONE_MSG,"Identifier or Driver");
+ has_driver = TRUE;
+ break;
+ case DEFAULTDEPTH:
+ if (xf86getSubToken (&(ptr->scrn_comment)) != NUMBER)
+ Error (NUMBER_MSG, "DefaultDepth");
+ ptr->scrn_defaultdepth = val.num;
+ break;
+ case DEFAULTBPP:
+ if (xf86getSubToken (&(ptr->scrn_comment)) != NUMBER)
+ Error (NUMBER_MSG, "DefaultBPP");
+ ptr->scrn_defaultbpp = val.num;
+ break;
+ case DEFAULTFBBPP:
+ if (xf86getSubToken (&(ptr->scrn_comment)) != NUMBER)
+ Error (NUMBER_MSG, "DefaultFbBPP");
+ ptr->scrn_defaultfbbpp = val.num;
+ break;
+ case MDEVICE:
+ if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
+ Error (QUOTE_MSG, "Device");
+ ptr->scrn_device_str = val.str;
+ break;
+ case MONITOR:
+ if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
+ Error (QUOTE_MSG, "Monitor");
+ ptr->scrn_monitor_str = val.str;
+ break;
+ case VIDEOADAPTOR:
+ {
+ XF86ConfAdaptorLinkPtr aptr;
+
+ if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
+ Error (QUOTE_MSG, "VideoAdaptor");
+
+ /* Don't allow duplicates */
+ for (aptr = ptr->scrn_adaptor_lst; aptr;
+ aptr = (XF86ConfAdaptorLinkPtr) aptr->list.next)
+ if (xf86nameCompare (val.str, aptr->al_adaptor_str) == 0)
+ break;
+
+ if (aptr == NULL)
+ {
+ aptr = xf86confcalloc (1, sizeof (XF86ConfAdaptorLinkRec));
+ aptr->list.next = NULL;
+ aptr->al_adaptor_str = val.str;
+ ptr->scrn_adaptor_lst = (XF86ConfAdaptorLinkPtr)
+ xf86addListItem ((glp) ptr->scrn_adaptor_lst, (glp) aptr);
+ }
+ }
+ break;
+ case OPTION:
+ ptr->scrn_option_lst = xf86parseOption(ptr->scrn_option_lst);
+ break;
+ case SUBSECTION:
+ if (xf86getSubToken (&(ptr->scrn_comment)) != STRING)
+ Error (QUOTE_MSG, "SubSection");
+ {
+ xf86conffree(val.str);
+ HANDLE_LIST (scrn_display_lst, xf86parseDisplaySubSection,
+ XF86ConfDisplayPtr);
+ }
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+ if (!has_ident && !has_driver)
+ Error (NO_IDENT_MSG, NULL);
+
+#ifdef DEBUG
+ printf ("Screen section parsed\n");
+#endif
+
+ return ptr;
+}
+
+void
+xf86printScreenSection (FILE * cf, XF86ConfScreenPtr ptr)
+{
+ XF86ConfAdaptorLinkPtr aptr;
+ XF86ConfDisplayPtr dptr;
+ XF86ModePtr mptr;
+
+ while (ptr)
+ {
+ fprintf (cf, "Section \"Screen\"\n");
+ if (ptr->scrn_comment)
+ fprintf (cf, "%s", ptr->scrn_comment);
+ if (ptr->scrn_identifier)
+ fprintf (cf, "\tIdentifier \"%s\"\n", ptr->scrn_identifier);
+ if (ptr->scrn_obso_driver)
+ fprintf (cf, "\tDriver \"%s\"\n", ptr->scrn_obso_driver);
+ if (ptr->scrn_device_str)
+ fprintf (cf, "\tDevice \"%s\"\n", ptr->scrn_device_str);
+ if (ptr->scrn_monitor_str)
+ fprintf (cf, "\tMonitor \"%s\"\n", ptr->scrn_monitor_str);
+ if (ptr->scrn_defaultdepth)
+ fprintf (cf, "\tDefaultDepth %d\n",
+ ptr->scrn_defaultdepth);
+ if (ptr->scrn_defaultbpp)
+ fprintf (cf, "\tDefaultBPP %d\n",
+ ptr->scrn_defaultbpp);
+ if (ptr->scrn_defaultfbbpp)
+ fprintf (cf, "\tDefaultFbBPP %d\n",
+ ptr->scrn_defaultfbbpp);
+ xf86printOptionList(cf, ptr->scrn_option_lst, 1);
+ for (aptr = ptr->scrn_adaptor_lst; aptr; aptr = aptr->list.next)
+ {
+ fprintf (cf, "\tVideoAdaptor \"%s\"\n", aptr->al_adaptor_str);
+ }
+ for (dptr = ptr->scrn_display_lst; dptr; dptr = dptr->list.next)
+ {
+ fprintf (cf, "\tSubSection \"Display\"\n");
+ if (dptr->disp_comment)
+ fprintf (cf, "%s", dptr->disp_comment);
+ if (dptr->disp_frameX0 != 0 || dptr->disp_frameY0 != 0)
+ {
+ fprintf (cf, "\t\tViewport %d %d\n",
+ dptr->disp_frameX0, dptr->disp_frameY0);
+ }
+ if (dptr->disp_virtualX != 0 || dptr->disp_virtualY != 0)
+ {
+ fprintf (cf, "\t\tVirtual %d %d\n",
+ dptr->disp_virtualX, dptr->disp_virtualY);
+ }
+ if (dptr->disp_depth)
+ {
+ fprintf (cf, "\t\tDepth %d\n", dptr->disp_depth);
+ }
+ if (dptr->disp_bpp)
+ {
+ fprintf (cf, "\t\tFbBPP %d\n", dptr->disp_bpp);
+ }
+ if (dptr->disp_visual)
+ {
+ fprintf (cf, "\t\tVisual \"%s\"\n", dptr->disp_visual);
+ }
+ if (dptr->disp_weight.red != 0)
+ {
+ fprintf (cf, "\t\tWeight %d %d %d\n",
+ dptr->disp_weight.red, dptr->disp_weight.green, dptr->disp_weight.blue);
+ }
+ if (dptr->disp_black.red != -1)
+ {
+ fprintf (cf, "\t\tBlack 0x%04x 0x%04x 0x%04x\n",
+ dptr->disp_black.red, dptr->disp_black.green, dptr->disp_black.blue);
+ }
+ if (dptr->disp_white.red != -1)
+ {
+ fprintf (cf, "\t\tWhite 0x%04x 0x%04x 0x%04x\n",
+ dptr->disp_white.red, dptr->disp_white.green, dptr->disp_white.blue);
+ }
+ if (dptr->disp_mode_lst)
+ {
+ fprintf (cf, "\t\tModes ");
+ }
+ for (mptr = dptr->disp_mode_lst; mptr; mptr = mptr->list.next)
+ {
+ fprintf (cf, " \"%s\"", mptr->mode_name);
+ }
+ if (dptr->disp_mode_lst)
+ {
+ fprintf (cf, "\n");
+ }
+ xf86printOptionList(cf, dptr->disp_option_lst, 2);
+ fprintf (cf, "\tEndSubSection\n");
+ }
+ fprintf (cf, "EndSection\n\n");
+ ptr = ptr->list.next;
+ }
+
+}
+
+void
+xf86freeScreenList (XF86ConfScreenPtr ptr)
+{
+ XF86ConfScreenPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->scrn_identifier);
+ TestFree (ptr->scrn_monitor_str);
+ TestFree (ptr->scrn_device_str);
+ TestFree (ptr->scrn_comment);
+ xf86optionListFree (ptr->scrn_option_lst);
+ xf86freeAdaptorLinkList (ptr->scrn_adaptor_lst);
+ xf86freeDisplayList (ptr->scrn_display_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+void
+xf86freeAdaptorLinkList (XF86ConfAdaptorLinkPtr ptr)
+{
+ XF86ConfAdaptorLinkPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->al_adaptor_str);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+void
+xf86freeDisplayList (XF86ConfDisplayPtr ptr)
+{
+ XF86ConfDisplayPtr prev;
+
+ while (ptr)
+ {
+ xf86freeModeList (ptr->disp_mode_lst);
+ xf86optionListFree (ptr->disp_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+void
+xf86freeModeList (XF86ModePtr ptr)
+{
+ XF86ModePtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->mode_name);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+int
+xf86validateScreen (XF86ConfigPtr p)
+{
+ XF86ConfScreenPtr screen = p->conf_screen_lst;
+ XF86ConfMonitorPtr monitor;
+ XF86ConfDevicePtr device;
+ XF86ConfAdaptorLinkPtr adaptor;
+
+ if (!screen)
+ {
+ xf86validationError ("At least one Screen section is required.");
+ return (FALSE);
+ }
+
+ while (screen)
+ {
+ if (screen->scrn_obso_driver && !screen->scrn_identifier)
+ screen->scrn_identifier = screen->scrn_obso_driver;
+
+ monitor = xf86findMonitor (screen->scrn_monitor_str, p->conf_monitor_lst);
+ if (!monitor)
+ {
+ xf86validationError (UNDEFINED_MONITOR_MSG,
+ screen->scrn_monitor_str, screen->scrn_identifier);
+ return (FALSE);
+ }
+ else
+ {
+ screen->scrn_monitor = monitor;
+ if (!xf86validateMonitor(p, screen))
+ return (FALSE);
+ }
+
+ device = xf86findDevice (screen->scrn_device_str, p->conf_device_lst);
+ if (!device)
+ {
+ xf86validationError (UNDEFINED_DEVICE_MSG,
+ screen->scrn_device_str, screen->scrn_identifier);
+ return (FALSE);
+ }
+ else
+ screen->scrn_device = device;
+
+ adaptor = screen->scrn_adaptor_lst;
+ while (adaptor)
+ {
+ adaptor->al_adaptor = xf86findVideoAdaptor (adaptor->al_adaptor_str, p->conf_videoadaptor_lst);
+ if (!adaptor->al_adaptor)
+ {
+ xf86validationError (UNDEFINED_ADAPTOR_MSG, adaptor->al_adaptor_str, screen->scrn_identifier);
+ return (FALSE);
+ }
+ else if (adaptor->al_adaptor->va_fwdref)
+ {
+ xf86validationError (ADAPTOR_REF_TWICE_MSG, adaptor->al_adaptor_str,
+ adaptor->al_adaptor->va_fwdref);
+ return (FALSE);
+ }
+
+ adaptor->al_adaptor->va_fwdref = xf86configStrdup(screen->scrn_identifier);
+ adaptor = adaptor->list.next;
+ }
+
+ screen = screen->list.next;
+ }
+
+ return (TRUE);
+}
+
+XF86ConfScreenPtr
+xf86findScreen (const char *ident, XF86ConfScreenPtr p)
+{
+ while (p)
+ {
+ if (xf86nameCompare (ident, p->scrn_identifier) == 0)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
+
+XF86ConfDisplayPtr
+xf86findDisplay (int depth, XF86ConfDisplayPtr p)
+{
+ while (p)
+ {
+ if (depth == p->disp_depth)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
diff --git a/hw/xfree86/parser/Vendor.c b/hw/xfree86/parser/Vendor.c
new file mode 100644
index 000000000..f2e98872c
--- /dev/null
+++ b/hw/xfree86/parser/Vendor.c
@@ -0,0 +1,227 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Vendor.c,v 1.16 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec VendorSubTab[] =
+{
+ {ENDSUBSECTION, "endsubsection"},
+ {IDENTIFIER, "identifier"},
+ {OPTION, "option"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeVendorSubList
+
+XF86ConfVendSubPtr
+xf86parseVendorSubSection (void)
+{
+ int has_ident = FALSE;
+ int token;
+ parsePrologue (XF86ConfVendSubPtr, XF86ConfVendSubRec)
+
+ while ((token = xf86getToken (VendorSubTab)) != ENDSUBSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->vs_comment = xf86addComment(ptr->vs_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->vs_comment)))
+ Error (QUOTE_MSG, "Identifier");
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ ptr->vs_identifier = val.str;
+ has_ident = TRUE;
+ break;
+ case OPTION:
+ ptr->vs_option_lst = xf86parseOption(ptr->vs_option_lst);
+ break;
+
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+#ifdef DEBUG
+ printf ("Vendor subsection parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+static xf86ConfigSymTabRec VendorTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {IDENTIFIER, "identifier"},
+ {OPTION, "option"},
+ {SUBSECTION, "subsection"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeVendorList
+
+XF86ConfVendorPtr
+xf86parseVendorSection (void)
+{
+ int has_ident = FALSE;
+ int token;
+ parsePrologue (XF86ConfVendorPtr, XF86ConfVendorRec)
+
+ while ((token = xf86getToken (VendorTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->vnd_comment = xf86addComment(ptr->vnd_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->vnd_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ ptr->vnd_identifier = val.str;
+ has_ident = TRUE;
+ break;
+ case OPTION:
+ ptr->vnd_option_lst = xf86parseOption(ptr->vnd_option_lst);
+ break;
+ case SUBSECTION:
+ if (xf86getSubToken (&(ptr->vnd_comment)) != STRING)
+ Error (QUOTE_MSG, "SubSection");
+ {
+ HANDLE_LIST (vnd_sub_lst, xf86parseVendorSubSection,
+ XF86ConfVendSubPtr);
+ }
+ break;
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+
+ }
+
+ if (!has_ident)
+ Error (NO_IDENT_MSG, NULL);
+
+#ifdef DEBUG
+ printf ("Vendor section parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+void
+xf86printVendorSection (FILE * cf, XF86ConfVendorPtr ptr)
+{
+ XF86ConfVendSubPtr pptr;
+
+ while (ptr)
+ {
+ fprintf (cf, "Section \"Vendor\"\n");
+ if (ptr->vnd_comment)
+ fprintf (cf, "%s", ptr->vnd_comment);
+ if (ptr->vnd_identifier)
+ fprintf (cf, "\tIdentifier \"%s\"\n", ptr->vnd_identifier);
+
+ xf86printOptionList(cf, ptr->vnd_option_lst, 1);
+ for (pptr = ptr->vnd_sub_lst; pptr; pptr = pptr->list.next)
+ {
+ fprintf (cf, "\tSubSection \"Vendor\"\n");
+ if (pptr->vs_comment)
+ fprintf (cf, "%s", pptr->vs_comment);
+ if (pptr->vs_identifier)
+ fprintf (cf, "\t\tIdentifier \"%s\"\n", pptr->vs_identifier);
+ xf86printOptionList(cf, pptr->vs_option_lst, 2);
+ fprintf (cf, "\tEndSubSection\n");
+ }
+ fprintf (cf, "EndSection\n\n");
+ ptr = ptr->list.next;
+ }
+}
+
+void
+xf86freeVendorList (XF86ConfVendorPtr p)
+{
+ if (p == NULL)
+ return;
+ xf86freeVendorSubList (p->vnd_sub_lst);
+ TestFree (p->vnd_identifier);
+ TestFree (p->vnd_comment);
+ xf86optionListFree (p->vnd_option_lst);
+ xf86conffree (p);
+}
+
+void
+xf86freeVendorSubList (XF86ConfVendSubPtr ptr)
+{
+ XF86ConfVendSubPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->vs_identifier);
+ TestFree (ptr->vs_name);
+ TestFree (ptr->vs_comment);
+ xf86optionListFree (ptr->vs_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+XF86ConfVendorPtr
+xf86findVendor (const char *name, XF86ConfVendorPtr list)
+{
+ while (list)
+ {
+ if (xf86nameCompare (list->vnd_identifier, name) == 0)
+ return (list);
+ list = list->list.next;
+ }
+ return (NULL);
+}
+
diff --git a/hw/xfree86/parser/Video.c b/hw/xfree86/parser/Video.c
new file mode 100644
index 000000000..b899f0d3d
--- /dev/null
+++ b/hw/xfree86/parser/Video.c
@@ -0,0 +1,267 @@
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Video.c,v 1.12 2003/01/04 20:20:23 paulo Exp $ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec VideoPortTab[] =
+{
+ {ENDSUBSECTION, "endsubsection"},
+ {IDENTIFIER, "identifier"},
+ {OPTION, "option"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeVideoPortList
+
+XF86ConfVideoPortPtr
+xf86parseVideoPortSubSection (void)
+{
+ int has_ident = FALSE;
+ int token;
+ parsePrologue (XF86ConfVideoPortPtr, XF86ConfVideoPortRec)
+
+ while ((token = xf86getToken (VideoPortTab)) != ENDSUBSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->vp_comment = xf86addComment(ptr->vp_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->vp_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ ptr->vp_identifier = val.str;
+ has_ident = TRUE;
+ break;
+ case OPTION:
+ ptr->vp_option_lst = xf86parseOption(ptr->vp_option_lst);
+ break;
+
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+#ifdef DEBUG
+ printf ("VideoPort subsection parsed\n");
+#endif
+
+ return ptr;
+}
+
+#undef CLEANUP
+
+static xf86ConfigSymTabRec VideoAdaptorTab[] =
+{
+ {ENDSECTION, "endsection"},
+ {IDENTIFIER, "identifier"},
+ {VENDOR, "vendorname"},
+ {BOARD, "boardname"},
+ {BUSID, "busid"},
+ {DRIVER, "driver"},
+ {OPTION, "option"},
+ {SUBSECTION, "subsection"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeVideoAdaptorList
+
+XF86ConfVideoAdaptorPtr
+xf86parseVideoAdaptorSection (void)
+{
+ int has_ident = FALSE;
+ int token;
+
+ parsePrologue (XF86ConfVideoAdaptorPtr, XF86ConfVideoAdaptorRec)
+
+ while ((token = xf86getToken (VideoAdaptorTab)) != ENDSECTION)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->va_comment = xf86addComment(ptr->va_comment, val.str);
+ break;
+ case IDENTIFIER:
+ if (xf86getSubToken (&(ptr->va_comment)) != STRING)
+ Error (QUOTE_MSG, "Identifier");
+ ptr->va_identifier = val.str;
+ if (has_ident == TRUE)
+ Error (MULTIPLE_MSG, "Identifier");
+ has_ident = TRUE;
+ break;
+ case VENDOR:
+ if (xf86getSubToken (&(ptr->va_comment)) != STRING)
+ Error (QUOTE_MSG, "Vendor");
+ ptr->va_vendor = val.str;
+ break;
+ case BOARD:
+ if (xf86getSubToken (&(ptr->va_comment)) != STRING)
+ Error (QUOTE_MSG, "Board");
+ ptr->va_board = val.str;
+ break;
+ case BUSID:
+ if (xf86getSubToken (&(ptr->va_comment)) != STRING)
+ Error (QUOTE_MSG, "BusID");
+ ptr->va_busid = val.str;
+ break;
+ case DRIVER:
+ if (xf86getSubToken (&(ptr->va_comment)) != STRING)
+ Error (QUOTE_MSG, "Driver");
+ ptr->va_driver = val.str;
+ break;
+ case OPTION:
+ ptr->va_option_lst = xf86parseOption(ptr->va_option_lst);
+ break;
+ case SUBSECTION:
+ if (xf86getSubToken (&(ptr->va_comment)) != STRING)
+ Error (QUOTE_MSG, "SubSection");
+ {
+ HANDLE_LIST (va_port_lst, xf86parseVideoPortSubSection,
+ XF86ConfVideoPortPtr);
+ }
+ break;
+
+ case EOF_TOKEN:
+ Error (UNEXPECTED_EOF_MSG, NULL);
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ break;
+ }
+ }
+
+ if (!has_ident)
+ Error (NO_IDENT_MSG, NULL);
+
+#ifdef DEBUG
+ printf ("VideoAdaptor section parsed\n");
+#endif
+
+ return ptr;
+}
+
+void
+xf86printVideoAdaptorSection (FILE * cf, XF86ConfVideoAdaptorPtr ptr)
+{
+ XF86ConfVideoPortPtr pptr;
+
+ while (ptr)
+ {
+ fprintf (cf, "Section \"VideoAdaptor\"\n");
+ if (ptr->va_comment)
+ fprintf (cf, "%s", ptr->va_comment);
+ if (ptr->va_identifier)
+ fprintf (cf, "\tIdentifier \"%s\"\n", ptr->va_identifier);
+ if (ptr->va_vendor)
+ fprintf (cf, "\tVendorName \"%s\"\n", ptr->va_vendor);
+ if (ptr->va_board)
+ fprintf (cf, "\tBoardName \"%s\"\n", ptr->va_board);
+ if (ptr->va_busid)
+ fprintf (cf, "\tBusID \"%s\"\n", ptr->va_busid);
+ if (ptr->va_driver)
+ fprintf (cf, "\tDriver \"%s\"\n", ptr->va_driver);
+ xf86printOptionList(cf, ptr->va_option_lst, 1);
+ for (pptr = ptr->va_port_lst; pptr; pptr = pptr->list.next)
+ {
+ fprintf (cf, "\tSubSection \"VideoPort\"\n");
+ if (pptr->vp_comment)
+ fprintf (cf, "%s", pptr->vp_comment);
+ if (pptr->vp_identifier)
+ fprintf (cf, "\t\tIdentifier \"%s\"\n", pptr->vp_identifier);
+ xf86printOptionList(cf, pptr->vp_option_lst, 2);
+ fprintf (cf, "\tEndSubSection\n");
+ }
+ fprintf (cf, "EndSection\n\n");
+ ptr = ptr->list.next;
+ }
+
+}
+
+void
+xf86freeVideoAdaptorList (XF86ConfVideoAdaptorPtr ptr)
+{
+ XF86ConfVideoAdaptorPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->va_identifier);
+ TestFree (ptr->va_vendor);
+ TestFree (ptr->va_board);
+ TestFree (ptr->va_busid);
+ TestFree (ptr->va_driver);
+ TestFree (ptr->va_fwdref);
+ TestFree (ptr->va_comment);
+ xf86freeVideoPortList (ptr->va_port_lst);
+ xf86optionListFree (ptr->va_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+void
+xf86freeVideoPortList (XF86ConfVideoPortPtr ptr)
+{
+ XF86ConfVideoPortPtr prev;
+
+ while (ptr)
+ {
+ TestFree (ptr->vp_identifier);
+ TestFree (ptr->vp_comment);
+ xf86optionListFree (ptr->vp_option_lst);
+ prev = ptr;
+ ptr = ptr->list.next;
+ xf86conffree (prev);
+ }
+}
+
+XF86ConfVideoAdaptorPtr
+xf86findVideoAdaptor (const char *ident, XF86ConfVideoAdaptorPtr p)
+{
+ while (p)
+ {
+ if (xf86nameCompare (ident, p->va_identifier) == 0)
+ return (p);
+
+ p = p->list.next;
+ }
+ return (NULL);
+}
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
new file mode 100644
index 000000000..a2440540d
--- /dev/null
+++ b/hw/xfree86/parser/configProcs.h
@@ -0,0 +1,98 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/configProcs.h,v 1.16 2001/08/06 20:51:15 dawes Exp $ */
+
+/* Private procs. Public procs are in xf86Parser.h and xf86Optrec.h */
+
+/* Device.c */
+XF86ConfDevicePtr xf86parseDeviceSection(void);
+void xf86printDeviceSection(FILE *cf, XF86ConfDevicePtr ptr);
+void xf86freeDeviceList(XF86ConfDevicePtr ptr);
+int xf86validateDevice(XF86ConfigPtr p);
+/* Files.c */
+XF86ConfFilesPtr xf86parseFilesSection(void);
+void xf86printFileSection(FILE *cf, XF86ConfFilesPtr ptr);
+void xf86freeFiles(XF86ConfFilesPtr p);
+/* Flags.c */
+XF86ConfFlagsPtr xf86parseFlagsSection(void);
+void xf86printServerFlagsSection(FILE *f, XF86ConfFlagsPtr flags);
+void xf86freeFlags(XF86ConfFlagsPtr flags);
+/* Input.c */
+XF86ConfInputPtr xf86parseInputSection(void);
+void xf86printInputSection(FILE *f, XF86ConfInputPtr ptr);
+void xf86freeInputList(XF86ConfInputPtr ptr);
+int xf86validateInput (XF86ConfigPtr p);
+/* Keyboard.c */
+XF86ConfInputPtr xf86parseKeyboardSection(void);
+/* Layout.c */
+XF86ConfLayoutPtr xf86parseLayoutSection(void);
+void xf86printLayoutSection(FILE *cf, XF86ConfLayoutPtr ptr);
+void xf86freeLayoutList(XF86ConfLayoutPtr ptr);
+void xf86freeAdjacencyList(XF86ConfAdjacencyPtr ptr);
+void xf86freeInputrefList(XF86ConfInputrefPtr ptr);
+int xf86validateLayout(XF86ConfigPtr p);
+/* Module.c */
+XF86LoadPtr xf86parseModuleSubSection(XF86LoadPtr head, char *name);
+XF86ConfModulePtr xf86parseModuleSection(void);
+void xf86printModuleSection(FILE *cf, XF86ConfModulePtr ptr);
+XF86LoadPtr xf86addNewLoadDirective(XF86LoadPtr head, char *name, int type, XF86OptionPtr opts);
+void xf86freeModules(XF86ConfModulePtr ptr);
+/* Monitor.c */
+XF86ConfModeLinePtr xf86parseModeLine(void);
+XF86ConfModeLinePtr xf86parseVerboseMode(void);
+XF86ConfMonitorPtr xf86parseMonitorSection(void);
+XF86ConfModesPtr xf86parseModesSection(void);
+void xf86printMonitorSection(FILE *cf, XF86ConfMonitorPtr ptr);
+void xf86printModesSection(FILE *cf, XF86ConfModesPtr ptr);
+void xf86freeMonitorList(XF86ConfMonitorPtr ptr);
+void xf86freeModesList(XF86ConfModesPtr ptr);
+void xf86freeModeLineList(XF86ConfModeLinePtr ptr);
+int xf86validateMonitor(XF86ConfigPtr p, XF86ConfScreenPtr screen);
+/* Pointer.c */
+XF86ConfInputPtr xf86parsePointerSection(void);
+/* Screen.c */
+XF86ConfDisplayPtr xf86parseDisplaySubSection(void);
+XF86ConfScreenPtr xf86parseScreenSection(void);
+void xf86printScreenSection(FILE *cf, XF86ConfScreenPtr ptr);
+void xf86freeScreenList(XF86ConfScreenPtr ptr);
+void xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr ptr);
+void xf86freeDisplayList(XF86ConfDisplayPtr ptr);
+void xf86freeModeList(XF86ModePtr ptr);
+int xf86validateScreen(XF86ConfigPtr p);
+/* Vendor.c */
+XF86ConfVendorPtr xf86parseVendorSection(void);
+XF86ConfVendSubPtr xf86parseVendorSubSection (void);
+void xf86freeVendorList(XF86ConfVendorPtr p);
+void xf86printVendorSection(FILE * cf, XF86ConfVendorPtr ptr);
+void xf86freeVendorSubList (XF86ConfVendSubPtr ptr);
+/* Video.c */
+XF86ConfVideoPortPtr xf86parseVideoPortSubSection(void);
+XF86ConfVideoAdaptorPtr xf86parseVideoAdaptorSection(void);
+void xf86printVideoAdaptorSection(FILE *cf, XF86ConfVideoAdaptorPtr ptr);
+void xf86freeVideoAdaptorList(XF86ConfVideoAdaptorPtr ptr);
+void xf86freeVideoPortList(XF86ConfVideoPortPtr ptr);
+/* read.c */
+int xf86validateConfig(XF86ConfigPtr p);
+/* scan.c */
+unsigned int xf86strToUL(char *str);
+int xf86getToken(xf86ConfigSymTabRec *tab);
+int xf86getSubToken(char **comment);
+int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec *tab);
+void xf86unGetToken(int token);
+char *xf86tokenString(void);
+void xf86parseError(char *format, ...);
+void xf86parseWarning(char *format, ...);
+void xf86validationError(char *format, ...);
+void xf86setSection(char *section);
+int xf86getStringToken(xf86ConfigSymTabRec *tab);
+/* write.c */
+/* DRI.c */
+XF86ConfBuffersPtr xf86parseBuffers (void);
+void xf86freeBuffersList (XF86ConfBuffersPtr ptr);
+XF86ConfDRIPtr xf86parseDRISection (void);
+void xf86printDRISection (FILE * cf, XF86ConfDRIPtr ptr);
+void xf86freeDRI (XF86ConfDRIPtr ptr);
+
+#ifndef IN_XSERVER
+/* Externally provided functions */
+void ErrorF(const char *f, ...);
+void VErrorF(const char *f, va_list args);
+#endif
diff --git a/hw/xfree86/parser/cpconfig.c b/hw/xfree86/parser/cpconfig.c
new file mode 100644
index 000000000..3cd3749ed
--- /dev/null
+++ b/hw/xfree86/parser/cpconfig.c
@@ -0,0 +1,119 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/cpconfig.c,v 1.7 2003/02/17 16:08:29 dawes Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include "xf86Parser.h"
+#include "configProcs.h"
+
+#ifdef MALLOC_FUNCTIONS
+void
+xfree (void *p)
+{
+ free (p);
+ return;
+}
+
+void *
+xalloc (int size)
+{
+ return malloc (size);
+}
+
+void *
+xrealloc (void *p, int size)
+{
+ return realloc (p, size);
+}
+
+#endif
+
+#define CONFPATH "%A,%R,/etc/X11/%R,%P/etc/X11/%R,%E,%F,/etc/X11/%F," \
+ "%P/etc/X11/%F,%D/%X,/etc/X11/%X,/etc/%X,%P/etc/X11/%X.%H," \
+ "%P/etc/X11/%X,%P/lib/X11/%X.%H,%P/lib/X11/%X"
+
+int
+main (int argc, char *argv[])
+{
+ const char *filename;
+ char *cmdline = NULL;
+ XF86ConfigPtr conf;
+
+ if (argc > 1)
+ {
+ cmdline = argv[1];
+ }
+ if ((filename = xf86openConfigFile (CONFPATH, cmdline, NULL)))
+ {
+ fprintf (stderr, "Opened %s for the config file\n", filename);
+ }
+ else
+ {
+ fprintf (stderr, "Unable to open config file\n");
+ exit (1);
+ }
+
+ if ((conf = xf86readConfigFile ()) == NULL)
+ {
+ fprintf (stderr, "Problem when parsing config file\n");
+ }
+ else
+ {
+ fprintf (stderr, "Config file parsed OK\n");
+ }
+ xf86closeConfigFile ();
+
+ if (argc > 2) {
+ fprintf(stderr, "Writing config file to `%s'\n", argv[2]);
+ xf86writeConfigFile (argv[2], conf);
+ }
+ exit(0);
+}
+
+/* Functions that the parser requires */
+
+void
+VErrorF(const char *f, va_list args)
+{
+ vfprintf(stderr, f, args);
+}
+
+void
+ErrorF(const char *f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ vfprintf(stderr, f, args);
+ va_end(args);
+}
diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
new file mode 100644
index 000000000..cd7bbf10b
--- /dev/null
+++ b/hw/xfree86/parser/read.c
@@ -0,0 +1,283 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/read.c,v 1.23 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+extern LexRec val;
+
+static xf86ConfigSymTabRec TopLevelTab[] =
+{
+ {SECTION, "section"},
+ {-1, ""},
+};
+
+#define CLEANUP xf86freeConfig
+
+XF86ConfigPtr
+xf86readConfigFile (void)
+{
+ int token;
+ XF86ConfigPtr ptr = NULL;
+
+ if ((ptr = xf86confcalloc (1, sizeof (XF86ConfigRec))) == NULL)
+ {
+ return NULL;
+ }
+ memset (ptr, 0, sizeof (XF86ConfigRec));
+
+ while ((token = xf86getToken (TopLevelTab)) != EOF_TOKEN)
+ {
+ switch (token)
+ {
+ case COMMENT:
+ ptr->conf_comment = xf86addComment(ptr->conf_comment, val.str);
+ break;
+ case SECTION:
+ if (xf86getSubToken (&(ptr->conf_comment)) != STRING)
+ {
+ xf86parseError (QUOTE_MSG, "Section");
+ CLEANUP (ptr);
+ return (NULL);
+ }
+ xf86setSection (val.str);
+ if (xf86nameCompare (val.str, "files") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_RETURN (conf_files, xf86parseFilesSection ());
+ }
+ else if (xf86nameCompare (val.str, "serverflags") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_RETURN (conf_flags, xf86parseFlagsSection ());
+ }
+ else if (xf86nameCompare (val.str, "keyboard") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_input_lst, xf86parseKeyboardSection,
+ XF86ConfInputPtr);
+ }
+ else if (xf86nameCompare (val.str, "pointer") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_input_lst, xf86parsePointerSection,
+ XF86ConfInputPtr);
+ }
+ else if (xf86nameCompare (val.str, "videoadaptor") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_videoadaptor_lst, xf86parseVideoAdaptorSection,
+ XF86ConfVideoAdaptorPtr);
+ }
+ else if (xf86nameCompare (val.str, "device") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_device_lst, xf86parseDeviceSection,
+ XF86ConfDevicePtr);
+ }
+ else if (xf86nameCompare (val.str, "monitor") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_monitor_lst, xf86parseMonitorSection,
+ XF86ConfMonitorPtr);
+ }
+ else if (xf86nameCompare (val.str, "modes") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_modes_lst, xf86parseModesSection,
+ XF86ConfModesPtr);
+ }
+ else if (xf86nameCompare (val.str, "screen") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_screen_lst, xf86parseScreenSection,
+ XF86ConfScreenPtr);
+ }
+ else if (xf86nameCompare(val.str, "inputdevice") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_input_lst, xf86parseInputSection,
+ XF86ConfInputPtr);
+ }
+ else if (xf86nameCompare (val.str, "module") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_RETURN (conf_modules, xf86parseModuleSection ());
+ }
+ else if (xf86nameCompare (val.str, "serverlayout") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_layout_lst, xf86parseLayoutSection,
+ XF86ConfLayoutPtr);
+ }
+ else if (xf86nameCompare (val.str, "vendor") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_LIST (conf_vendor_lst, xf86parseVendorSection,
+ XF86ConfVendorPtr);
+ }
+ else if (xf86nameCompare (val.str, "dri") == 0)
+ {
+ xf86conffree(val.str);
+ val.str = NULL;
+ HANDLE_RETURN (conf_dri, xf86parseDRISection ());
+ }
+ else
+ {
+ Error (INVALID_SECTION_MSG, xf86tokenString ());
+ xf86conffree(val.str);
+ val.str = NULL;
+ }
+ break;
+ default:
+ Error (INVALID_KEYWORD_MSG, xf86tokenString ());
+ xf86conffree(val.str);
+ val.str = NULL;
+ }
+ }
+
+ if (xf86validateConfig (ptr))
+ return (ptr);
+ else
+ {
+ CLEANUP (ptr);
+ return (NULL);
+ }
+}
+
+#undef CLEANUP
+
+/*
+ * This function resolves name references and reports errors if the named
+ * objects cannot be found.
+ */
+int
+xf86validateConfig (XF86ConfigPtr p)
+{
+ if (!xf86validateDevice (p))
+ return FALSE;
+ if (!xf86validateScreen (p))
+ return FALSE;
+ if (!xf86validateInput (p))
+ return FALSE;
+ if (!xf86validateLayout (p))
+ return FALSE;
+
+ return (TRUE);
+}
+
+/*
+ * adds an item to the end of the linked list. Any record whose first field
+ * is a GenericListRec can be cast to this type and used with this function.
+ * A pointer to the head of the list is returned to handle the addition of
+ * the first item.
+ */
+GenericListPtr
+xf86addListItem (GenericListPtr head, GenericListPtr new)
+{
+ GenericListPtr p = head;
+ GenericListPtr last = NULL;
+
+ while (p)
+ {
+ last = p;
+ p = p->next;
+ }
+
+ if (last)
+ {
+ last->next = new;
+ return (head);
+ }
+ else
+ return (new);
+}
+
+/*
+ * Test if one chained list contains the other.
+ * In this case both list have the same endpoint (provided they don't loop)
+ */
+int
+xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2)
+{
+ GenericListPtr p = list_1;
+ GenericListPtr last_1 = NULL, last_2 = NULL;
+
+ while (p) {
+ last_1 = p;
+ p = p->next;
+ }
+
+ p = list_2;
+ while (p) {
+ last_2 = p;
+ p = p->next;
+ }
+
+ return (!(last_1 == last_2));
+}
+
+void
+xf86freeConfig (XF86ConfigPtr p)
+{
+ if (p == NULL)
+ return;
+
+ xf86freeFiles (p->conf_files);
+ xf86freeModules (p->conf_modules);
+ xf86freeFlags (p->conf_flags);
+ xf86freeMonitorList (p->conf_monitor_lst);
+ xf86freeModesList (p->conf_modes_lst);
+ xf86freeVideoAdaptorList (p->conf_videoadaptor_lst);
+ xf86freeDeviceList (p->conf_device_lst);
+ xf86freeScreenList (p->conf_screen_lst);
+ xf86freeLayoutList (p->conf_layout_lst);
+ xf86freeInputList (p->conf_input_lst);
+ xf86freeVendorList (p->conf_vendor_lst);
+ xf86freeDRI (p->conf_dri);
+ TestFree(p->conf_comment);
+
+ xf86conffree (p);
+}
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
new file mode 100644
index 000000000..4d8167622
--- /dev/null
+++ b/hw/xfree86/parser/scan.c
@@ -0,0 +1,1073 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/scan.c,v 1.24 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+#if !defined(X_NOT_POSIX)
+#if defined(_POSIX_SOURCE)
+#include <limits.h>
+#else
+#define _POSIX_SOURCE
+#include <limits.h>
+#undef _POSIX_SOURCE
+#endif /* _POSIX_SOURCE */
+#endif /* !X_NOT_POSIX */
+#if !defined(PATH_MAX)
+#if defined(MAXPATHLEN)
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif /* MAXPATHLEN */
+#endif /* !PATH_MAX */
+
+#if !defined(MAXHOSTNAMELEN)
+#define MAXHOSTNAMELEN 32
+#endif /* !MAXHOSTNAMELEN */
+
+#include "Configint.h"
+#include "xf86tokens.h"
+
+#define CONFIG_BUF_LEN 1024
+
+static int StringToToken (char *, xf86ConfigSymTabRec *);
+
+static FILE *configFile = NULL;
+static int configStart = 0; /* start of the current token */
+static int configPos = 0; /* current readers position */
+static int configLineNo = 0; /* linenumber */
+static char *configBuf, *configRBuf; /* buffer for lines */
+static char *configPath; /* path to config file */
+static char *configSection = NULL; /* name of current section being parsed */
+static int pushToken = LOCK_TOKEN;
+static int eol_seen = 0; /* private state to handle comments */
+LexRec val;
+
+#ifdef __UNIXOS2__
+extern char *__XOS2RedirRoot(char *path);
+#endif
+
+/*
+ * xf86strToUL --
+ *
+ * A portable, but restricted, version of strtoul(). It only understands
+ * hex, octal, and decimal. But it's good enough for our needs.
+ */
+unsigned int
+xf86strToUL (char *str)
+{
+ int base = 10;
+ char *p = str;
+ unsigned int tot = 0;
+
+ if (*p == '0')
+ {
+ p++;
+ if ((*p == 'x') || (*p == 'X'))
+ {
+ p++;
+ base = 16;
+ }
+ else
+ base = 8;
+ }
+ while (*p)
+ {
+ if ((*p >= '0') && (*p <= ((base == 8) ? '7' : '9')))
+ {
+ tot = tot * base + (*p - '0');
+ }
+ else if ((base == 16) && (*p >= 'a') && (*p <= 'f'))
+ {
+ tot = tot * base + 10 + (*p - 'a');
+ }
+ else if ((base == 16) && (*p >= 'A') && (*p <= 'F'))
+ {
+ tot = tot * base + 10 + (*p - 'A');
+ }
+ else
+ {
+ return (tot);
+ }
+ p++;
+ }
+ return (tot);
+}
+
+/*
+ * xf86getToken --
+ * Read next Token form the config file. Handle the global variable
+ * pushToken.
+ */
+int
+xf86getToken (xf86ConfigSymTabRec * tab)
+{
+ int c, i;
+
+ /*
+ * First check whether pushToken has a different value than LOCK_TOKEN.
+ * In this case rBuf[] contains a valid STRING/TOKEN/NUMBER. But in the
+ * oth * case the next token must be read from the input.
+ */
+ if (pushToken == EOF_TOKEN)
+ return (EOF_TOKEN);
+ else if (pushToken == LOCK_TOKEN)
+ {
+ /*
+ * eol_seen is only set for the first token after a newline.
+ */
+ eol_seen = 0;
+
+ c = configBuf[configPos];
+
+ /*
+ * Get start of next Token. EOF is handled,
+ * whitespaces are skipped.
+ */
+
+again:
+ if (!c)
+ {
+ if (fgets (configBuf, CONFIG_BUF_LEN - 1, configFile) == NULL)
+ {
+ return (pushToken = EOF_TOKEN);
+ }
+ configLineNo++;
+ configStart = configPos = 0;
+ eol_seen = 1;
+ }
+
+ i = 0;
+ for (;;) {
+ c = configBuf[configPos++];
+ configRBuf[i++] = c;
+ switch (c) {
+ case ' ':
+ case '\t':
+ case '\r':
+ continue;
+ case '\n':
+ i = 0;
+ continue;
+ }
+ break;
+ }
+ if (c == '\0')
+ goto again;
+
+ if (c == '#')
+ {
+ do
+ {
+ configRBuf[i++] = (c = configBuf[configPos++]);
+ }
+ while ((c != '\n') && (c != '\r') && (c != '\0'));
+ configRBuf[i] = '\0';
+ /* XXX no private copy.
+ * Use xf86addComment when setting a comment.
+ */
+ val.str = configRBuf;
+ return (COMMENT);
+ }
+
+ /* GJA -- handle '-' and ',' * Be careful: "-hsync" is a keyword. */
+ else if ((c == ',') && !isalpha (configBuf[configPos]))
+ {
+ configStart = configPos;
+ return COMMA;
+ }
+ else if ((c == '-') && !isalpha (configBuf[configPos]))
+ {
+ configStart = configPos;
+ return DASH;
+ }
+
+ configStart = configPos;
+ /*
+ * Numbers are returned immediately ...
+ */
+ if (isdigit (c))
+ {
+ int base;
+
+ if (c == '0')
+ if ((configBuf[configPos] == 'x') ||
+ (configBuf[configPos] == 'X'))
+ base = 16;
+ else
+ base = 8;
+ else
+ base = 10;
+
+ configRBuf[0] = c;
+ i = 1;
+ while (isdigit (c = configBuf[configPos++]) ||
+ (c == '.') || (c == 'x') || (c == 'X') ||
+ ((base == 16) && (((c >= 'a') && (c <= 'f')) ||
+ ((c >= 'A') && (c <= 'F')))))
+ configRBuf[i++] = c;
+ configPos--; /* GJA -- one too far */
+ configRBuf[i] = '\0';
+ val.num = xf86strToUL (configRBuf);
+ val.realnum = atof (configRBuf);
+ return (NUMBER);
+ }
+
+ /*
+ * All Strings START with a \" ...
+ */
+ else if (c == '\"')
+ {
+ i = -1;
+ do
+ {
+ configRBuf[++i] = (c = configBuf[configPos++]);
+ }
+ while ((c != '\"') && (c != '\n') && (c != '\r') && (c != '\0'));
+ configRBuf[i] = '\0';
+ val.str = xf86confmalloc (strlen (configRBuf) + 1);
+ strcpy (val.str, configRBuf); /* private copy ! */
+ return (STRING);
+ }
+
+ /*
+ * ... and now we MUST have a valid token. The search is
+ * handled later along with the pushed tokens.
+ */
+ else
+ {
+ configRBuf[0] = c;
+ i = 0;
+ do
+ {
+ configRBuf[++i] = (c = configBuf[configPos++]);;
+ }
+ while ((c != ' ') && (c != '\t') && (c != '\n') && (c != '\r') && (c != '\0') && (c != '#'));
+ --configPos;
+ configRBuf[i] = '\0';
+ i = 0;
+ }
+
+ }
+ else
+ {
+
+ /*
+ * Here we deal with pushed tokens. Reinitialize pushToken again. If
+ * the pushed token was NUMBER || STRING return them again ...
+ */
+ int temp = pushToken;
+ pushToken = LOCK_TOKEN;
+
+ if (temp == COMMA || temp == DASH)
+ return (temp);
+ if (temp == NUMBER || temp == STRING)
+ return (temp);
+ }
+
+ /*
+ * Joop, at last we have to lookup the token ...
+ */
+ if (tab)
+ {
+ i = 0;
+ while (tab[i].token != -1)
+ if (xf86nameCompare (configRBuf, tab[i].name) == 0)
+ return (tab[i].token);
+ else
+ i++;
+ }
+
+ return (ERROR_TOKEN); /* Error catcher */
+}
+
+int
+xf86getSubToken (char **comment)
+{
+ int token;
+
+ for (;;) {
+ token = xf86getToken(NULL);
+ if (token == COMMENT) {
+ if (comment)
+ *comment = xf86addComment(*comment, val.str);
+ }
+ else
+ return (token);
+ }
+ /*NOTREACHED*/
+}
+
+int
+xf86getSubTokenWithTab (char **comment, xf86ConfigSymTabRec *tab)
+{
+ int token;
+
+ for (;;) {
+ token = xf86getToken(tab);
+ if (token == COMMENT) {
+ if (comment)
+ *comment = xf86addComment(*comment, val.str);
+ }
+ else
+ return (token);
+ }
+ /*NOTREACHED*/
+}
+
+void
+xf86unGetToken (int token)
+{
+ pushToken = token;
+}
+
+char *
+xf86tokenString (void)
+{
+ return configRBuf;
+}
+
+#if 1
+int
+xf86pathIsAbsolute(const char *path)
+{
+ if (path && path[0] == '/')
+ return 1;
+#ifdef __UNIXOS2__
+ if (path && (path[0] == '\\' || (path[1] == ':')))
+ return 0;
+#endif
+ return 0;
+}
+
+/* A path is "safe" if it is relative and if it contains no ".." elements. */
+int
+xf86pathIsSafe(const char *path)
+{
+ if (xf86pathIsAbsolute(path))
+ return 0;
+
+ /* Compare with ".." */
+ if (!strcmp(path, ".."))
+ return 0;
+
+ /* Look for leading "../" */
+ if (!strncmp(path, "../", 3))
+ return 0;
+
+ /* Look for trailing "/.." */
+ if ((strlen(path) > 3) && !strcmp(path + strlen(path) - 3, "/.."))
+ return 0;
+
+ /* Look for "/../" */
+ if (strstr(path, "/../"))
+ return 0;
+
+ return 1;
+}
+
+/*
+ * This function substitutes the following escape sequences:
+ *
+ * %A cmdline argument as an absolute path (must be absolute to match)
+ * %R cmdline argument as a relative path
+ * %S cmdline argument as a "safe" path (relative, and no ".." elements)
+ * %X default config file name ("XF86Config")
+ * %H hostname
+ * %E config file environment ($XF86CONFIG) as an absolute path
+ * %F config file environment ($XF86CONFIG) as a relative path
+ * %G config file environment ($XF86CONFIG) as a safe path
+ * %D $HOME
+ * %P projroot
+ * %M major version number
+ * %% %
+ * %& UNIXOS2 only: prepend X11ROOT env var
+ */
+
+#ifndef XCONFIGFILE
+#define XCONFIGFILE "XF86Config"
+#endif
+#ifndef PROJECTROOT
+#define PROJECTROOT "/usr/X11R6"
+#endif
+#ifndef XCONFENV
+#define XCONFENV "XF86CONFIG"
+#endif
+#ifndef XF86_VERSION_MAJOR
+#ifdef XVERSION
+#if XVERSION > 40000000
+#define XF86_VERSION_MAJOR (XVERSION / 10000000)
+#else
+#define XF86_VERSION_MAJOR (XVERSION / 1000)
+#endif
+#else
+#define XF86_VERSION_MAJOR 4
+#endif
+#endif
+
+#define BAIL_OUT do { \
+ xf86conffree(result); \
+ return NULL; \
+ } while (0)
+
+#define CHECK_LENGTH do { \
+ if (l > PATH_MAX) { \
+ BAIL_OUT; \
+ } \
+ } while (0)
+
+#define APPEND_STR(s) do { \
+ if (strlen(s) + l > PATH_MAX) { \
+ BAIL_OUT; \
+ } else { \
+ strcpy(result + l, s); \
+ l += strlen(s); \
+ } \
+ } while (0)
+
+static char *
+DoSubstitution(const char *template, const char *cmdline, const char *projroot,
+ int *cmdlineUsed, int *envUsed)
+{
+ char *result;
+ int i, l;
+ static const char *env = NULL, *home = NULL;
+ static char *hostname = NULL;
+ static char majorvers[3] = "";
+#ifdef __UNIXOS2__
+ static char *x11root = NULL;
+#endif
+
+ if (!template)
+ return NULL;
+
+ if (cmdlineUsed)
+ *cmdlineUsed = 0;
+ if (envUsed)
+ *envUsed = 0;
+
+ result = xf86confmalloc(PATH_MAX + 1);
+ l = 0;
+ for (i = 0; template[i]; i++) {
+ if (template[i] != '%') {
+ result[l++] = template[i];
+ CHECK_LENGTH;
+ } else {
+ switch (template[++i]) {
+ case 'A':
+ if (cmdline && xf86pathIsAbsolute(cmdline)) {
+ APPEND_STR(cmdline);
+ if (cmdlineUsed)
+ *cmdlineUsed = 1;
+ } else
+ BAIL_OUT;
+ break;
+ case 'R':
+ if (cmdline && !xf86pathIsAbsolute(cmdline)) {
+ APPEND_STR(cmdline);
+ if (cmdlineUsed)
+ *cmdlineUsed = 1;
+ } else
+ BAIL_OUT;
+ break;
+ case 'S':
+ if (cmdline && xf86pathIsSafe(cmdline)) {
+ APPEND_STR(cmdline);
+ if (cmdlineUsed)
+ *cmdlineUsed = 1;
+ } else
+ BAIL_OUT;
+ break;
+ case 'X':
+ APPEND_STR(XCONFIGFILE);
+ break;
+ case 'H':
+ if (!hostname) {
+ if ((hostname = xf86confmalloc(MAXHOSTNAMELEN + 1))) {
+ if (gethostname(hostname, MAXHOSTNAMELEN) == 0) {
+ hostname[MAXHOSTNAMELEN] = '\0';
+ } else {
+ xf86conffree(hostname);
+ hostname = NULL;
+ }
+ }
+ }
+ if (hostname)
+ APPEND_STR(hostname);
+ break;
+ case 'E':
+ if (!env)
+ env = getenv(XCONFENV);
+ if (env && xf86pathIsAbsolute(env)) {
+ APPEND_STR(env);
+ if (envUsed)
+ *envUsed = 1;
+ } else
+ BAIL_OUT;
+ break;
+ case 'F':
+ if (!env)
+ env = getenv(XCONFENV);
+ if (env && !xf86pathIsAbsolute(env)) {
+ APPEND_STR(env);
+ if (envUsed)
+ *envUsed = 1;
+ } else
+ BAIL_OUT;
+ break;
+ case 'G':
+ if (!env)
+ env = getenv(XCONFENV);
+ if (env && xf86pathIsSafe(env)) {
+ APPEND_STR(env);
+ if (envUsed)
+ *envUsed = 1;
+ } else
+ BAIL_OUT;
+ break;
+ case 'D':
+ if (!home)
+ home = getenv("HOME");
+ if (home && xf86pathIsAbsolute(home))
+ APPEND_STR(home);
+ else
+ BAIL_OUT;
+ break;
+ case 'P':
+ if (projroot && xf86pathIsAbsolute(projroot))
+ APPEND_STR(projroot);
+ else
+ BAIL_OUT;
+ break;
+ case 'M':
+ if (!majorvers[0]) {
+ if (XF86_VERSION_MAJOR < 0 || XF86_VERSION_MAJOR > 99) {
+ fprintf(stderr, "XF86_VERSION_MAJOR is out of range\n");
+ BAIL_OUT;
+ } else
+ sprintf(majorvers, "%d", XF86_VERSION_MAJOR);
+ }
+ APPEND_STR(majorvers);
+ break;
+ case '%':
+ result[l++] = '%';
+ CHECK_LENGTH;
+ break;
+#ifdef __UNIXOS2__
+ case '&':
+ if (!x11root)
+ x11root = getenv("X11ROOT");
+ if (x11root)
+ APPEND_STR(x11root);
+ else
+ BAIL_OUT;
+ break;
+#endif
+ default:
+ fprintf(stderr, "invalid escape %%%c found in path template\n",
+ template[i]);
+ BAIL_OUT;
+ break;
+ }
+ }
+ }
+#ifdef DEBUG
+ fprintf(stderr, "Converted `%s' to `%s'\n", template, result);
+#endif
+ return result;
+}
+
+/*
+ * xf86openConfigFile --
+ *
+ * This function take a config file search path (optional), a command-line
+ * specified file name (optional) and the ProjectRoot path (optional) and
+ * locates and opens a config file based on that information. If a
+ * command-line file name is specified, then this function fails if none
+ * of the located files.
+ *
+ * The return value is a pointer to the actual name of the file that was
+ * opened. When no file is found, the return value is NULL.
+ *
+ * The escape sequences allowed in the search path are defined above.
+ *
+ */
+
+#ifndef DEFAULT_CONF_PATH
+#define DEFAULT_CONF_PATH "/etc/X11/%S," \
+ "%P/etc/X11/%S," \
+ "/etc/X11/%G," \
+ "%P/etc/X11/%G," \
+ "/etc/X11/%X-%M," \
+ "/etc/X11/%X," \
+ "/etc/%X," \
+ "%P/etc/X11/%X.%H," \
+ "%P/etc/X11/%X-%M," \
+ "%P/etc/X11/%X," \
+ "%P/lib/X11/%X.%H," \
+ "%P/lib/X11/%X-%M," \
+ "%P/lib/X11/%X"
+#endif
+
+const char *
+xf86openConfigFile(const char *path, const char *cmdline, const char *projroot)
+{
+ char *pathcopy;
+ const char *template;
+ int cmdlineUsed = 0;
+
+ configFile = NULL;
+ configStart = 0; /* start of the current token */
+ configPos = 0; /* current readers position */
+ configLineNo = 0; /* linenumber */
+ pushToken = LOCK_TOKEN;
+
+ if (!path || !path[0])
+ path = DEFAULT_CONF_PATH;
+ pathcopy = xf86confmalloc(strlen(path) + 1);
+ strcpy(pathcopy, path);
+ if (!projroot || !projroot[0])
+ projroot = PROJECTROOT;
+
+ template = strtok(pathcopy, ",");
+
+ /* First, search for a config file. */
+ while (template && !configFile) {
+ if ((configPath = DoSubstitution(template, cmdline, projroot,
+ &cmdlineUsed, NULL))) {
+ if ((configFile = fopen(configPath, "r")) != 0) {
+ if (cmdline && !cmdlineUsed) {
+ fclose(configFile);
+ configFile = NULL;
+ }
+ }
+ }
+ if (configPath && !configFile) {
+ xf86conffree(configPath);
+ configPath = NULL;
+ }
+ template = strtok(NULL, ",");
+ }
+ xf86conffree(pathcopy);
+ if (!configFile) {
+
+ return NULL;
+ }
+
+ configBuf = xf86confmalloc (CONFIG_BUF_LEN);
+ configRBuf = xf86confmalloc (CONFIG_BUF_LEN);
+ configBuf[0] = '\0'; /* sanity ... */
+
+ return configPath;
+}
+#else
+/*
+ * xf86openConfigFile --
+ *
+ * Formerly findConfigFile(). This function take a pointer to a location
+ * in which to place the actual name of the file that was opened.
+ * This function uses the global character array xf86ConfigFile
+ * This function returns the following results.
+ *
+ * 0 unable to open the config file
+ * 1 file opened and ready to read
+ *
+ */
+
+int
+xf86openConfigFile (char *filename)
+{
+#define MAXPTRIES 6
+ char *home = NULL;
+ char *xconfig = NULL;
+ char *xwinhome = NULL;
+ char *configPaths[MAXPTRIES];
+ int pcount = 0, idx;
+
+/*
+ * First open if necessary the config file.
+ * If the -xf86config flag was used, use the name supplied there (root only).
+ * If $XF86CONFIG is a pathname, use it as the name of the config file (root)
+ * If $XF86CONFIG is set but doesn't contain a '/', append it to 'XF86Config'
+ * and search the standard places (root only).
+ * If $XF86CONFIG is not set, just search the standard places.
+ */
+ configFile = NULL;
+ configStart = 0; /* start of the current token */
+ configPos = 0; /* current readers position */
+ configLineNo = 0; /* linenumber */
+ pushToken = LOCK_TOKEN;
+ while (!configFile)
+ {
+
+ /*
+ * configPaths[0] is used as a buffer for -xf86config
+ * and $XF86CONFIG if it contains a path
+ * configPaths[1...MAXPTRIES-1] is used to store the paths of each of
+ * the other attempts
+ */
+ for (pcount = idx = 0; idx < MAXPTRIES; idx++)
+ configPaths[idx] = NULL;
+
+ /*
+ * First check if the -xf86config option was used.
+ */
+ configPaths[pcount] = xf86confmalloc (PATH_MAX);
+ if (xf86ConfigFile[0])
+ {
+ strcpy (configPaths[pcount], xf86ConfigFile);
+ if ((configFile = fopen (configPaths[pcount], "r")) != 0)
+ break;
+ else
+ return 0;
+ }
+ /*
+ * Check if XF86CONFIG is set.
+ */
+#ifndef __UNIXOS2__
+ if (getuid () == 0
+ && (xconfig = getenv ("XF86CONFIG")) != 0
+ && strchr (xconfig, '/'))
+#else
+ /* no root available, and filenames start with drive letter */
+ if ((xconfig = getenv ("XF86CONFIG")) != 0
+ && isalpha (xconfig[0])
+ && xconfig[1] == ':')
+#endif
+ {
+ strcpy (configPaths[pcount], xconfig);
+ if ((configFile = fopen (configPaths[pcount], "r")) != 0)
+ break;
+ else
+ return 0;
+ }
+
+#ifndef __UNIXOS2__
+ /*
+ * ~/XF86Config ...
+ */
+ if (getuid () == 0 && (home = getenv ("HOME")) != NULL)
+ {
+ configPaths[++pcount] = xf86confmalloc (PATH_MAX);
+ strcpy (configPaths[pcount], home);
+ strcat (configPaths[pcount], "/" XCONFIGFILE);
+ if (xconfig)
+ strcat (configPaths[pcount], xconfig);
+ if ((configFile = fopen (configPaths[pcount], "r")) != 0)
+ break;
+ }
+
+ /*
+ * /etc/XF86Config
+ */
+ configPaths[++pcount] = xf86confmalloc (PATH_MAX);
+ strcpy (configPaths[pcount], "/etc/" XCONFIGFILE);
+ if (xconfig)
+ strcat (configPaths[pcount], xconfig);
+ if ((configFile = fopen (configPaths[pcount], "r")) != 0)
+ break;
+
+ /*
+ * $(XCONFIGDIR)/XF86Config.<hostname>
+ */
+
+ configPaths[++pcount] = xf86confmalloc (PATH_MAX);
+ if (getuid () == 0 && (xwinhome = getenv ("XWINHOME")) != NULL)
+ sprintf (configPaths[pcount], "%s/lib/X11/" XCONFIGFILE, xwinhome);
+ else
+ strcpy (configPaths[pcount], XCONFIGDIR "/" XCONFIGFILE);
+ if (getuid () == 0 && xconfig)
+ strcat (configPaths[pcount], xconfig);
+ strcat (configPaths[pcount], ".");
+ gethostname (configPaths[pcount] + strlen (configPaths[pcount]),
+ MAXHOSTNAMELEN);
+ if ((configFile = fopen (configPaths[pcount], "r")) != 0)
+ break;
+#endif /* !__UNIXOS2__ */
+
+ /*
+ * $(XCONFIGDIR)/XF86Config
+ */
+ configPaths[++pcount] = xf86confmalloc (PATH_MAX);
+#ifndef __UNIXOS2__
+ if (getuid () == 0 && xwinhome)
+ sprintf (configPaths[pcount], "%s/lib/X11/" XCONFIGFILE, xwinhome);
+ else
+ strcpy (configPaths[pcount], XCONFIGDIR "/" XCONFIGFILE);
+ if (getuid () == 0 && xconfig)
+ strcat (configPaths[pcount], xconfig);
+#else
+ /*
+ * we explicitly forbid numerous config files everywhere for OS/2;
+ * users should consider them lucky to have one in a standard place
+ * and another one with the -xf86config option
+ */
+ xwinhome = getenv ("X11ROOT"); /* get drive letter */
+ if (!xwinhome) {
+ fprintf (stderr,"X11ROOT environment variable not set\n");
+ exit(2);
+ }
+ strcpy (configPaths[pcount], __XOS2RedirRoot ("/XFree86/lib/X11/XConfig"));
+#endif
+
+ if ((configFile = fopen (configPaths[pcount], "r")) != 0)
+ break;
+
+ return 0;
+ }
+ configBuf = xf86confmalloc (CONFIG_BUF_LEN);
+ configRBuf = xf86confmalloc (CONFIG_BUF_LEN);
+ configPath = xf86confmalloc (PATH_MAX);
+
+ strcpy (configPath, configPaths[pcount]);
+
+ if (filename)
+ strcpy (filename, configPaths[pcount]);
+ for (idx = 0; idx <= pcount; idx++)
+ if (configPaths[idx] != NULL)
+ xf86conffree (configPaths[idx]);
+
+ configBuf[0] = '\0'; /* sanity ... */
+
+ return 1;
+}
+#endif
+
+void
+xf86closeConfigFile (void)
+{
+ xf86conffree (configPath);
+ configPath = NULL;
+ xf86conffree (configRBuf);
+ configRBuf = NULL;
+ xf86conffree (configBuf);
+ configBuf = NULL;
+
+ fclose (configFile);
+ configFile = NULL;
+}
+
+void
+xf86parseError (char *format,...)
+{
+ va_list ap;
+
+#if 0
+ fprintf (stderr, "Parse error on line %d of section %s in file %s\n",
+ configLineNo, configSection, configPath);
+ fprintf (stderr, "\t");
+ va_start (ap, format);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
+
+ fprintf (stderr, "\n");
+#else
+ ErrorF ("Parse error on line %d of section %s in file %s\n\t",
+ configLineNo, configSection, configPath);
+ va_start (ap, format);
+ VErrorF (format, ap);
+ va_end (ap);
+
+ ErrorF ("\n");
+#endif
+
+}
+
+void
+xf86parseWarning (char *format,...)
+{
+ va_list ap;
+
+#if 0
+ fprintf (stderr, "Parse warning on line %d of section %s in file %s\n",
+ configLineNo, configSection, configPath);
+ fprintf (stderr, "\t");
+ va_start (ap, format);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
+
+ fprintf (stderr, "\n");
+#else
+ ErrorF ("Parse warning on line %d of section %s in file %s\n\t",
+ configLineNo, configSection, configPath);
+ va_start (ap, format);
+ VErrorF (format, ap);
+ va_end (ap);
+
+ ErrorF ("\n");
+#endif
+}
+
+void
+xf86validationError (char *format,...)
+{
+ va_list ap;
+
+#if 0
+ fprintf (stderr, "Data incomplete in file %s\n",
+ configPath);
+ fprintf (stderr, "\t");
+ va_start (ap, format);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
+
+ fprintf (stderr, "\n");
+#else
+ ErrorF ("Data incomplete in file %s\n\t", configPath);
+ va_start (ap, format);
+ VErrorF (format, ap);
+ va_end (ap);
+
+ ErrorF ("\n");
+#endif
+}
+
+void
+xf86setSection (char *section)
+{
+ if (configSection)
+ xf86conffree(configSection);
+ configSection = xf86confmalloc(strlen (section) + 1);
+ strcpy (configSection, section);
+}
+
+/*
+ * xf86getToken --
+ * Lookup a string if it is actually a token in disguise.
+ */
+int
+xf86getStringToken (xf86ConfigSymTabRec * tab)
+{
+ return StringToToken (val.str, tab);
+}
+
+static int
+StringToToken (char *str, xf86ConfigSymTabRec * tab)
+{
+ int i;
+
+ for (i = 0; tab[i].token != -1; i++)
+ {
+ if (!xf86nameCompare (tab[i].name, str))
+ return tab[i].token;
+ }
+ return (ERROR_TOKEN);
+}
+
+
+/*
+ * Compare two names. The characters '_', ' ', and '\t' are ignored
+ * in the comparison.
+ */
+int
+xf86nameCompare (const char *s1, const char *s2)
+{
+ char c1, c2;
+
+ if (!s1 || *s1 == 0) {
+ if (!s2 || *s2 == 0)
+ return (0);
+ else
+ return (1);
+ }
+
+ while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
+ s1++;
+ while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
+ s2++;
+ c1 = (isupper (*s1) ? tolower (*s1) : *s1);
+ c2 = (isupper (*s2) ? tolower (*s2) : *s2);
+ while (c1 == c2)
+ {
+ if (c1 == '\0')
+ return (0);
+ s1++;
+ s2++;
+ while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
+ s1++;
+ while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
+ s2++;
+ c1 = (isupper (*s1) ? tolower (*s1) : *s1);
+ c2 = (isupper (*s2) ? tolower (*s2) : *s2);
+ }
+ return (c1 - c2);
+}
+
+char *
+xf86addComment(char *cur, char *add)
+{
+ char *str;
+ int len, curlen, iscomment, hasnewline = 0, endnewline;
+
+ if (add == NULL || add[0] == '\0')
+ return (cur);
+
+ if (cur) {
+ curlen = strlen(cur);
+ if (curlen)
+ hasnewline = cur[curlen - 1] == '\n';
+ eol_seen = 0;
+ }
+ else
+ curlen = 0;
+
+ str = add;
+ iscomment = 0;
+ while (*str) {
+ if (*str != ' ' && *str != '\t')
+ break;
+ ++str;
+ }
+ iscomment = (*str == '#');
+
+ len = strlen(add);
+ endnewline = add[len - 1] == '\n';
+ len += 1 + iscomment + (!hasnewline) + (!endnewline) + eol_seen;
+
+ if ((str = xf86confrealloc(cur, len + curlen)) == NULL)
+ return (cur);
+
+ cur = str;
+
+ if (eol_seen || (curlen && !hasnewline))
+ cur[curlen++] = '\n';
+ if (!iscomment)
+ cur[curlen++] = '#';
+ strcpy(cur + curlen, add);
+ if (!endnewline)
+ strcat(cur, "\n");
+
+ return (cur);
+}
diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c
new file mode 100644
index 000000000..1d7472a5c
--- /dev/null
+++ b/hw/xfree86/parser/write.c
@@ -0,0 +1,187 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/write.c,v 1.17 2002/09/17 18:54:16 dawes Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/* View/edit this file with tab stops set to 4 */
+
+#include "xf86Parser.h"
+#include "xf86tokens.h"
+#include "Configint.h"
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <errno.h>
+
+#if ((defined(sun) && !defined(SVR4)) || defined(macII)) && !defined(__GLIBC__)
+#ifndef strerror
+extern char *sys_errlist[];
+extern int sys_nerr;
+#define strerror(n) \
+ (((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error")
+#endif
+#endif
+
+#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
+#define HAS_SAVED_IDS_AND_SETEUID
+#endif
+#if defined(__UNIXOS2__) || defined(WIN32)
+#define HAS_NO_UIDS
+#endif
+
+#ifdef HAS_NO_UIDS
+#define doWriteConfigFile xf86writeConfigFile
+#define Local /**/
+#else
+#define Local static
+#endif
+
+Local int
+doWriteConfigFile (const char *filename, XF86ConfigPtr cptr)
+{
+ FILE *cf;
+
+ if ((cf = fopen (filename, "w")) == NULL)
+ {
+ return 0;
+ }
+
+ if (cptr->conf_comment)
+ fprintf (cf, "%s\n", cptr->conf_comment);
+
+ xf86printLayoutSection (cf, cptr->conf_layout_lst);
+
+ fprintf (cf, "Section \"Files\"\n");
+ xf86printFileSection (cf, cptr->conf_files);
+ fprintf (cf, "EndSection\n\n");
+
+ fprintf (cf, "Section \"Module\"\n");
+ xf86printModuleSection (cf, cptr->conf_modules);
+ fprintf (cf, "EndSection\n\n");
+
+ xf86printVendorSection (cf, cptr->conf_vendor_lst);
+
+ xf86printServerFlagsSection (cf, cptr->conf_flags);
+
+ xf86printInputSection (cf, cptr->conf_input_lst);
+
+ xf86printVideoAdaptorSection (cf, cptr->conf_videoadaptor_lst);
+
+ xf86printModesSection (cf, cptr->conf_modes_lst);
+
+ xf86printMonitorSection (cf, cptr->conf_monitor_lst);
+
+ xf86printDeviceSection (cf, cptr->conf_device_lst);
+
+ xf86printScreenSection (cf, cptr->conf_screen_lst);
+
+ xf86printDRISection (cf, cptr->conf_dri);
+
+ fclose(cf);
+ return 1;
+}
+
+#ifndef HAS_NO_UIDS
+
+int
+xf86writeConfigFile (const char *filename, XF86ConfigPtr cptr)
+{
+ int ret;
+
+#if !defined(HAS_SAVED_IDS_AND_SETEUID)
+ int pid, p;
+ int status;
+ void (*csig)(int);
+#else
+ int ruid, euid;
+#endif
+
+ if (getuid() != geteuid())
+ {
+
+#if !defined(HAS_SAVED_IDS_AND_SETEUID)
+ /* Need to fork to change ruid without loosing euid */
+#ifdef SIGCHLD
+ csig = signal(SIGCHLD, SIG_DFL);
+#endif
+ switch ((pid = fork()))
+ {
+ case -1:
+ ErrorF("xf86writeConfigFile(): fork failed (%s)\n",
+ strerror(errno));
+ return 0;
+ case 0: /* child */
+ setuid(getuid());
+ ret = doWriteConfigFile(filename, cptr);
+ exit(ret);
+ break;
+ default: /* parent */
+ do
+ {
+ p = waitpid(pid, &status, 0);
+ } while (p == -1 && errno == EINTR);
+ }
+#ifdef SIGCHLD
+ signal(SIGCHLD, csig);
+#endif
+ if (p != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0)
+ return 1; /* success */
+ else
+ return 0;
+
+#else /* HAS_SAVED_IDS_AND_SETEUID */
+
+ ruid = getuid();
+ euid = geteuid();
+
+ if (seteuid(ruid) == -1)
+ {
+ ErrorF("xf86writeConfigFile(): seteuid(%d) failed (%s)\n",
+ ruid, strerror(errno));
+ return 0;
+ }
+ ret = doWriteConfigFile(filename, cptr);
+
+ if (seteuid(euid) == -1)
+ {
+ ErrorF("xf86writeConfigFile(): seteuid(%d) failed (%s)\n",
+ euid, strerror(errno));
+ }
+ return ret;
+
+#endif /* HAS_SAVED_IDS_AND_SETEUID */
+
+ }
+ else
+ {
+ return doWriteConfigFile(filename, cptr);
+ }
+}
+
+#endif /* !HAS_NO_UIDS */
diff --git a/hw/xfree86/parser/xf86Optrec.h b/hw/xfree86/parser/xf86Optrec.h
new file mode 100644
index 000000000..25f91a037
--- /dev/null
+++ b/hw/xfree86/parser/xf86Optrec.h
@@ -0,0 +1,82 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Optrec.h,v 1.10 2001/06/30 04:00:24 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/*
+ * This file contains the Option Record that is passed between the Parser,
+ * and Module setup procs.
+ */
+#ifndef _xf86Optrec_h_
+#define _xf86Optrec_h_
+#include <stdio.h>
+
+/*
+ * all records that need to be linked lists should contain a GenericList as
+ * their first field.
+ */
+typedef struct generic_list_rec
+{
+ void *next;
+}
+GenericListRec, *GenericListPtr, *glp;
+
+/*
+ * All options are stored using this data type.
+ */
+typedef struct
+{
+ GenericListRec list;
+ char *opt_name;
+ char *opt_val;
+ int opt_used;
+ char *opt_comment;
+}
+XF86OptionRec, *XF86OptionPtr;
+
+
+XF86OptionPtr xf86addNewOption(XF86OptionPtr head, char *name, char *val);
+XF86OptionPtr xf86optionListDup(XF86OptionPtr opt);
+void xf86optionListFree(XF86OptionPtr opt);
+char *xf86optionName(XF86OptionPtr opt);
+char *xf86optionValue(XF86OptionPtr opt);
+XF86OptionPtr xf86newOption(char *name, char *value);
+XF86OptionPtr xf86nextOption(XF86OptionPtr list);
+XF86OptionPtr xf86findOption(XF86OptionPtr list, const char *name);
+char *xf86findOptionValue(XF86OptionPtr list, const char *name);
+int xf86findOptionBoolean (XF86OptionPtr, const char *, int);
+XF86OptionPtr xf86optionListCreate(const char **options, int count, int used);
+XF86OptionPtr xf86optionListMerge(XF86OptionPtr head, XF86OptionPtr tail);
+char *xf86configStrdup (const char *s);
+int xf86nameCompare (const char *s1, const char *s2);
+char *xf86uLongToString(unsigned long i);
+void xf86debugListOptions(XF86OptionPtr);
+XF86OptionPtr xf86parseOption(XF86OptionPtr head);
+void xf86printOptionList(FILE *fp, XF86OptionPtr list, int tabs);
+
+
+#endif /* _xf86Optrec_h_ */
diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h
new file mode 100644
index 000000000..ae89005a4
--- /dev/null
+++ b/hw/xfree86/parser/xf86Parser.h
@@ -0,0 +1,444 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.30 2002/09/16 18:06:16 eich Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+/*
+ * This file contains the external interfaces for the XFree86 configuration
+ * file parser.
+ */
+#ifndef _xf86Parser_h_
+#define _xf86Parser_h_
+
+#include "xf86Optrec.h"
+
+#define HAVE_PARSER_DECLS
+
+typedef struct
+{
+ char *file_logfile;
+ char *file_rgbpath;
+ char *file_modulepath;
+ char *file_inputdevs;
+ char *file_fontpath;
+ char *file_comment;
+}
+XF86ConfFilesRec, *XF86ConfFilesPtr;
+
+/* Values for load_type */
+#define XF86_LOAD_MODULE 0
+#define XF86_LOAD_DRIVER 1
+
+typedef struct
+{
+ GenericListRec list;
+ int load_type;
+ char *load_name;
+ XF86OptionPtr load_opt;
+ char *load_comment;
+}
+XF86LoadRec, *XF86LoadPtr;
+
+typedef struct
+{
+ XF86LoadPtr mod_load_lst;
+ char *mod_comment;
+}
+XF86ConfModuleRec, *XF86ConfModulePtr;
+
+#define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard"
+
+#define CONF_IMPLICIT_POINTER "Implicit Core Pointer"
+
+#define XF86CONF_PHSYNC 0x0001
+#define XF86CONF_NHSYNC 0x0002
+#define XF86CONF_PVSYNC 0x0004
+#define XF86CONF_NVSYNC 0x0008
+#define XF86CONF_INTERLACE 0x0010
+#define XF86CONF_DBLSCAN 0x0020
+#define XF86CONF_CSYNC 0x0040
+#define XF86CONF_PCSYNC 0x0080
+#define XF86CONF_NCSYNC 0x0100
+#define XF86CONF_HSKEW 0x0200 /* hskew provided */
+#define XF86CONF_BCAST 0x0400
+#define XF86CONF_CUSTOM 0x0800 /* timing numbers customized by editor */
+#define XF86CONF_VSCAN 0x1000
+
+typedef struct
+{
+ GenericListRec list;
+ char *ml_identifier;
+ int ml_clock;
+ int ml_hdisplay;
+ int ml_hsyncstart;
+ int ml_hsyncend;
+ int ml_htotal;
+ int ml_vdisplay;
+ int ml_vsyncstart;
+ int ml_vsyncend;
+ int ml_vtotal;
+ int ml_vscan;
+ int ml_flags;
+ int ml_hskew;
+ char *ml_comment;
+}
+XF86ConfModeLineRec, *XF86ConfModeLinePtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *vp_identifier;
+ XF86OptionPtr vp_option_lst;
+ char *vp_comment;
+}
+XF86ConfVideoPortRec, *XF86ConfVideoPortPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *va_identifier;
+ char *va_vendor;
+ char *va_board;
+ char *va_busid;
+ char *va_driver;
+ XF86OptionPtr va_option_lst;
+ XF86ConfVideoPortPtr va_port_lst;
+ char *va_fwdref;
+ char *va_comment;
+}
+XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr;
+
+#define CONF_MAX_HSYNC 8
+#define CONF_MAX_VREFRESH 8
+
+typedef struct
+{
+ float hi, lo;
+}
+parser_range;
+
+typedef struct
+{
+ int red, green, blue;
+}
+parser_rgb;
+
+typedef struct
+{
+ GenericListRec list;
+ char *modes_identifier;
+ XF86ConfModeLinePtr mon_modeline_lst;
+ char *modes_comment;
+}
+XF86ConfModesRec, *XF86ConfModesPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *ml_modes_str;
+ XF86ConfModesPtr ml_modes;
+}
+XF86ConfModesLinkRec, *XF86ConfModesLinkPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *mon_identifier;
+ char *mon_vendor;
+ char *mon_modelname;
+ int mon_width; /* in mm */
+ int mon_height; /* in mm */
+ XF86ConfModeLinePtr mon_modeline_lst;
+ int mon_n_hsync;
+ parser_range mon_hsync[CONF_MAX_HSYNC];
+ int mon_n_vrefresh;
+ parser_range mon_vrefresh[CONF_MAX_VREFRESH];
+ float mon_gamma_red;
+ float mon_gamma_green;
+ float mon_gamma_blue;
+ XF86OptionPtr mon_option_lst;
+ XF86ConfModesLinkPtr mon_modes_sect_lst;
+ char *mon_comment;
+}
+XF86ConfMonitorRec, *XF86ConfMonitorPtr;
+
+#define CONF_MAXDACSPEEDS 4
+#define CONF_MAXCLOCKS 128
+
+typedef struct
+{
+ GenericListRec list;
+ char *dev_identifier;
+ char *dev_vendor;
+ char *dev_board;
+ char *dev_chipset;
+ char *dev_busid;
+ char *dev_card;
+ char *dev_driver;
+ char *dev_ramdac;
+ int dev_dacSpeeds[CONF_MAXDACSPEEDS];
+ int dev_videoram;
+ int dev_textclockfreq;
+ unsigned long dev_bios_base;
+ unsigned long dev_mem_base;
+ unsigned long dev_io_base;
+ char *dev_clockchip;
+ int dev_clocks;
+ int dev_clock[CONF_MAXCLOCKS];
+ int dev_chipid;
+ int dev_chiprev;
+ int dev_irq;
+ int dev_screen;
+ XF86OptionPtr dev_option_lst;
+ char *dev_comment;
+}
+XF86ConfDeviceRec, *XF86ConfDevicePtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *mode_name;
+}
+XF86ModeRec, *XF86ModePtr;
+
+typedef struct
+{
+ GenericListRec list;
+ int disp_frameX0;
+ int disp_frameY0;
+ int disp_virtualX;
+ int disp_virtualY;
+ int disp_depth;
+ int disp_bpp;
+ char *disp_visual;
+ parser_rgb disp_weight;
+ parser_rgb disp_black;
+ parser_rgb disp_white;
+ XF86ModePtr disp_mode_lst;
+ XF86OptionPtr disp_option_lst;
+ char *disp_comment;
+}
+XF86ConfDisplayRec, *XF86ConfDisplayPtr;
+
+typedef struct
+{
+ XF86OptionPtr flg_option_lst;
+ char *flg_comment;
+}
+XF86ConfFlagsRec, *XF86ConfFlagsPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *al_adaptor_str;
+ XF86ConfVideoAdaptorPtr al_adaptor;
+}
+XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *scrn_identifier;
+ char *scrn_obso_driver;
+ int scrn_defaultdepth;
+ int scrn_defaultbpp;
+ int scrn_defaultfbbpp;
+ char *scrn_monitor_str;
+ XF86ConfMonitorPtr scrn_monitor;
+ char *scrn_device_str;
+ XF86ConfDevicePtr scrn_device;
+ XF86ConfAdaptorLinkPtr scrn_adaptor_lst;
+ XF86ConfDisplayPtr scrn_display_lst;
+ XF86OptionPtr scrn_option_lst;
+ char *scrn_comment;
+}
+XF86ConfScreenRec, *XF86ConfScreenPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *inp_identifier;
+ char *inp_driver;
+ XF86OptionPtr inp_option_lst;
+ char *inp_comment;
+}
+XF86ConfInputRec, *XF86ConfInputPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ XF86ConfInputPtr iref_inputdev;
+ char *iref_inputdev_str;
+ XF86OptionPtr iref_option_lst;
+}
+XF86ConfInputrefRec, *XF86ConfInputrefPtr;
+
+/* Values for adj_where */
+#define CONF_ADJ_OBSOLETE -1
+#define CONF_ADJ_ABSOLUTE 0
+#define CONF_ADJ_RIGHTOF 1
+#define CONF_ADJ_LEFTOF 2
+#define CONF_ADJ_ABOVE 3
+#define CONF_ADJ_BELOW 4
+#define CONF_ADJ_RELATIVE 5
+
+typedef struct
+{
+ GenericListRec list;
+ int adj_scrnum;
+ XF86ConfScreenPtr adj_screen;
+ char *adj_screen_str;
+ XF86ConfScreenPtr adj_top;
+ char *adj_top_str;
+ XF86ConfScreenPtr adj_bottom;
+ char *adj_bottom_str;
+ XF86ConfScreenPtr adj_left;
+ char *adj_left_str;
+ XF86ConfScreenPtr adj_right;
+ char *adj_right_str;
+ int adj_where;
+ int adj_x;
+ int adj_y;
+ char *adj_refscreen;
+}
+XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *inactive_device_str;
+ XF86ConfDevicePtr inactive_device;
+}
+XF86ConfInactiveRec, *XF86ConfInactivePtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *lay_identifier;
+ XF86ConfAdjacencyPtr lay_adjacency_lst;
+ XF86ConfInactivePtr lay_inactive_lst;
+ XF86ConfInputrefPtr lay_input_lst;
+ XF86OptionPtr lay_option_lst;
+ char *lay_comment;
+}
+XF86ConfLayoutRec, *XF86ConfLayoutPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *vs_name;
+ char *vs_identifier;
+ XF86OptionPtr vs_option_lst;
+ char *vs_comment;
+}
+XF86ConfVendSubRec, *XF86ConfVendSubPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ char *vnd_identifier;
+ XF86OptionPtr vnd_option_lst;
+ XF86ConfVendSubPtr vnd_sub_lst;
+ char *vnd_comment;
+}
+XF86ConfVendorRec, *XF86ConfVendorPtr;
+
+typedef struct
+{
+ GenericListRec list;
+ int buf_count;
+ int buf_size;
+ char *buf_flags;
+ char *buf_comment;
+}
+XF86ConfBuffersRec, *XF86ConfBuffersPtr;
+
+typedef struct
+{
+ char *dri_group_name;
+ int dri_group;
+ int dri_mode;
+ XF86ConfBuffersPtr dri_buffers_lst;
+ char *dri_comment;
+}
+XF86ConfDRIRec, *XF86ConfDRIPtr;
+
+typedef struct
+{
+ XF86ConfFilesPtr conf_files;
+ XF86ConfModulePtr conf_modules;
+ XF86ConfFlagsPtr conf_flags;
+ XF86ConfVideoAdaptorPtr conf_videoadaptor_lst;
+ XF86ConfModesPtr conf_modes_lst;
+ XF86ConfMonitorPtr conf_monitor_lst;
+ XF86ConfDevicePtr conf_device_lst;
+ XF86ConfScreenPtr conf_screen_lst;
+ XF86ConfInputPtr conf_input_lst;
+ XF86ConfLayoutPtr conf_layout_lst;
+ XF86ConfVendorPtr conf_vendor_lst;
+ XF86ConfDRIPtr conf_dri;
+ char *conf_comment;
+}
+XF86ConfigRec, *XF86ConfigPtr;
+
+typedef struct
+{
+ int token; /* id of the token */
+ char *name; /* pointer to the LOWERCASED name */
+}
+xf86ConfigSymTabRec, *xf86ConfigSymTabPtr;
+
+/*
+ * prototypes for public functions
+ */
+extern const char *xf86openConfigFile (const char *, const char *,
+ const char *);
+extern XF86ConfigPtr xf86readConfigFile (void);
+extern void xf86closeConfigFile (void);
+extern void xf86freeConfig (XF86ConfigPtr p);
+extern int xf86writeConfigFile (const char *, XF86ConfigPtr);
+XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p);
+XF86ConfLayoutPtr xf86findLayout(const char *name, XF86ConfLayoutPtr list);
+XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p);
+XF86ConfModesPtr xf86findModes(const char *ident, XF86ConfModesPtr p);
+XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p);
+XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p);
+XF86ConfDisplayPtr xf86findDisplay(int depth, XF86ConfDisplayPtr p);
+XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p);
+XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p);
+XF86ConfVendorPtr xf86findVendor(const char *name, XF86ConfVendorPtr list);
+XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
+ XF86ConfVideoAdaptorPtr p);
+
+GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr c_new);
+int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2);
+
+int xf86pathIsAbsolute(const char *path);
+int xf86pathIsSafe(const char *path);
+char *xf86addComment(char *cur, char *add);
+
+#endif /* _xf86Parser_h_ */
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
new file mode 100644
index 000000000..eb8eab766
--- /dev/null
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -0,0 +1,249 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86tokens.h,v 1.19 2003/01/04 20:20:23 paulo Exp $ */
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+
+#ifndef _xf86_tokens_h
+#define _xf86_tokens_h
+
+/* Undefine symbols that some OSs might define */
+#undef IOBASE
+
+/*
+ * Each token should have a unique value regardless of the section
+ * it is used in.
+ */
+
+typedef enum {
+ /* errno-style tokens */
+ EOF_TOKEN = -4,
+ LOCK_TOKEN = -3,
+ ERROR_TOKEN = -2,
+
+ /* value type tokens */
+ NUMBER = 1,
+ STRING,
+
+ /* Tokens that can appear in many sections */
+ SECTION,
+ SUBSECTION,
+ ENDSECTION,
+ ENDSUBSECTION,
+ IDENTIFIER,
+ VENDOR,
+ DASH,
+ COMMA,
+ OPTION,
+ COMMENT,
+
+ /* Frequency units */
+ HRZ,
+ KHZ,
+ MHZ,
+
+ /* File tokens */
+ FONTPATH,
+ RGBPATH,
+ MODULEPATH,
+ INPUTDEVICES,
+ LOGFILEPATH,
+
+ /* Server Flag tokens. These are deprecated in favour of generic Options */
+ NOTRAPSIGNALS,
+ DONTZAP,
+ DONTZOOM,
+ DISABLEVIDMODE,
+ ALLOWNONLOCAL,
+ DISABLEMODINDEV,
+ MODINDEVALLOWNONLOCAL,
+ ALLOWMOUSEOPENFAIL,
+ BLANKTIME,
+ STANDBYTIME,
+ SUSPENDTIME,
+ OFFTIME,
+ DEFAULTLAYOUT,
+
+ /* Monitor tokens */
+ MODEL,
+ MODELINE,
+ DISPLAYSIZE,
+ HORIZSYNC,
+ VERTREFRESH,
+ MODE,
+ GAMMA,
+ USEMODES,
+
+ /* Modes tokens */
+ /* no new ones */
+
+ /* Mode tokens */
+ DOTCLOCK,
+ HTIMINGS,
+ VTIMINGS,
+ FLAGS,
+ HSKEW,
+ BCAST,
+ VSCAN,
+ ENDMODE,
+
+ /* Screen tokens */
+ OBSDRIVER,
+ MDEVICE,
+ MONITOR,
+ SCREENNO,
+ DEFAULTDEPTH,
+ DEFAULTBPP,
+ DEFAULTFBBPP,
+
+ /* VideoAdaptor tokens */
+ VIDEOADAPTOR,
+
+ /* Mode timing tokens */
+ TT_INTERLACE,
+ TT_PHSYNC,
+ TT_NHSYNC,
+ TT_PVSYNC,
+ TT_NVSYNC,
+ TT_CSYNC,
+ TT_PCSYNC,
+ TT_NCSYNC,
+ TT_DBLSCAN,
+ TT_HSKEW,
+ TT_BCAST,
+ TT_VSCAN,
+ TT_CUSTOM,
+
+ /* Module tokens */
+ LOAD,
+ LOAD_DRIVER,
+
+ /* Device tokens */
+ DRIVER,
+ CHIPSET,
+ CLOCKS,
+ VIDEORAM,
+ BOARD,
+ IOBASE,
+ RAMDAC,
+ DACSPEED,
+ BIOSBASE,
+ MEMBASE,
+ CLOCKCHIP,
+ CHIPID,
+ CHIPREV,
+ CARD,
+ BUSID,
+ TEXTCLOCKFRQ,
+ IRQ,
+
+ /* Keyboard tokens */
+ AUTOREPEAT,
+ XLEDS,
+ KPROTOCOL,
+ XKBKEYMAP,
+ XKBCOMPAT,
+ XKBTYPES,
+ XKBKEYCODES,
+ XKBGEOMETRY,
+ XKBSYMBOLS,
+ XKBDISABLE,
+ PANIX106,
+ XKBRULES,
+ XKBMODEL,
+ XKBLAYOUT,
+ XKBVARIANT,
+ XKBOPTIONS,
+ /* The next two have become ServerFlags options */
+ VTINIT,
+ VTSYSREQ,
+ /* Obsolete keyboard tokens */
+ SERVERNUM,
+ LEFTALT,
+ RIGHTALT,
+ SCROLLLOCK_TOK,
+ RIGHTCTL,
+ /* arguments for the above obsolete tokens */
+ CONF_KM_META,
+ CONF_KM_COMPOSE,
+ CONF_KM_MODESHIFT,
+ CONF_KM_MODELOCK,
+ CONF_KM_SCROLLLOCK,
+ CONF_KM_CONTROL,
+
+ /* Pointer tokens */
+ EMULATE3,
+ BAUDRATE,
+ SAMPLERATE,
+ PRESOLUTION,
+ CLEARDTR,
+ CLEARRTS,
+ CHORDMIDDLE,
+ PROTOCOL,
+ PDEVICE,
+ EM3TIMEOUT,
+ DEVICE_NAME,
+ ALWAYSCORE,
+ PBUTTONS,
+ ZAXISMAPPING,
+
+ /* Pointer Z axis mapping tokens */
+ XAXIS,
+ YAXIS,
+
+ /* Display tokens */
+ MODES,
+ VIEWPORT,
+ VIRTUAL,
+ VISUAL,
+ BLACK_TOK,
+ WHITE_TOK,
+ DEPTH,
+ BPP,
+ WEIGHT,
+
+ /* Layout Tokens */
+ SCREEN,
+ INACTIVE,
+ INPUTDEVICE,
+
+ /* Adjaceny Tokens */
+ RIGHTOF,
+ LEFTOF,
+ ABOVE,
+ BELOW,
+ RELATIVE,
+ ABSOLUTE,
+
+ /* Vendor Tokens */
+ VENDORNAME,
+
+ /* DRI Tokens */
+ GROUP,
+ BUFFERS
+} ParserTokens;
+
+#endif /* _xf86_tokens_h */
diff --git a/hw/xfree86/rac/xf86RAC.c b/hw/xfree86/rac/xf86RAC.c
new file mode 100644
index 000000000..d8d5332f9
--- /dev/null
+++ b/hw/xfree86/rac/xf86RAC.c
@@ -0,0 +1,1256 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/rac/xf86RAC.c,v 1.7 2002/09/16 18:06:18 eich Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "colormapst.h"
+#include "scrnintstr.h"
+#include "screenint.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "pixmap.h"
+#include "windowstr.h"
+#include "window.h"
+#include "xf86str.h"
+#include "xf86RAC.h"
+#include "mipointer.h"
+#include "mipointrst.h"
+#ifdef RENDER
+# include "picturestr.h"
+#endif
+
+#ifdef DEBUG
+#define DPRINT_S(x,y) ErrorF(x ": %i\n",y);
+#define DPRINT(x) ErrorF(x "\n");
+#else
+#define DPRINT_S(x,y)
+#define DPRINT(x)
+#endif
+
+#define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x;\
+ pScreen->x = y;}
+#define WRAP_SCREEN_COND(x,y,cond) \
+ {pScreenPriv->x = pScreen->x;\
+ if (flag & (cond))\
+ pScreen->x = y;}
+#define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x
+
+#define SCREEN_PROLOG(x) \
+ pScreen->x = \
+ ((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->x
+#define SCREEN_EPILOG(x,y) pScreen->x = y;
+
+#define WRAP_PICT_COND(x,y,cond) if (ps)\
+ {pScreenPriv->x = ps->x;\
+ if (flag & (cond))\
+ ps->x = y;}
+#define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;}
+
+#define PICTURE_PROLOGUE(field) \
+ ps->field = \
+ ((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr)->field
+#define PICTURE_EPILOGUE(field, wrap) \
+ ps->field = wrap
+
+#define WRAP_SCREEN_INFO(x,y) {pScreenPriv->x = pScrn->x;\
+ pScrn->x = y;}
+#define WRAP_SCREEN_INFO_COND(x,y,cond) \
+ {pScreenPriv->x = pScrn->x;\
+ if (flag & (cond))\
+ pScrn->x = y;}
+#define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
+
+#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \
+(miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;\
+ RACScreenPtr pScreenPriv = \
+((RACScreenPtr) (pScreen)->devPrivates[RACScreenIndex].ptr);\
+ PointPriv->spriteFuncs = pScreenPriv->miSprite;
+#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\
+ PointPriv->spriteFuncs = &RACSpriteFuncs;
+#define WRAP_SPRITE_COND(cond){pScreenPriv->miSprite = PointPriv->spriteFuncs;\
+ if(flag & (cond))\
+ PointPriv->spriteFuncs = &RACSpriteFuncs;}
+#define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite
+
+
+#define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\
+ pGCPriv->wrapFuncs = (x)->funcs;\
+ (x)->ops = &RACGCOps;\
+ (x)->funcs = &RACGCFuncs;
+#define GC_UNWRAP(x)\
+ RACGCPtr pGCPriv = (RACGCPtr) (x)->devPrivates[RACGCIndex].ptr;\
+ (x)->ops = pGCPriv->wrapOps;\
+ (x)->funcs = pGCPriv->wrapFuncs;
+
+#define GC_SCREEN register ScrnInfoPtr pScrn \
+ = xf86Screens[pGC->pScreen->myNum]
+
+#define ENABLE xf86EnableAccess(xf86Screens[pScreen->myNum])
+#define ENABLE_GC xf86EnableAccess(xf86Screens[pGC->pScreen->myNum])
+
+typedef struct _RACScreen {
+ CreateGCProcPtr CreateGC;
+ CloseScreenProcPtr CloseScreen;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ SourceValidateProcPtr SourceValidate;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ BSFuncRec BackingStoreFuncs;
+ CreatePixmapProcPtr CreatePixmap;
+ SaveScreenProcPtr SaveScreen;
+ /* Colormap */
+ StoreColorsProcPtr StoreColors;
+ /* Cursor */
+ DisplayCursorProcPtr DisplayCursor;
+ RealizeCursorProcPtr RealizeCursor;
+ UnrealizeCursorProcPtr UnrealizeCursor;
+ RecolorCursorProcPtr RecolorCursor;
+ SetCursorPositionProcPtr SetCursorPosition;
+ void (*AdjustFrame)(int,int,int,int);
+ Bool (*SwitchMode)(int, DisplayModePtr,int);
+ Bool (*EnterVT)(int, int);
+ void (*LeaveVT)(int, int);
+ void (*FreeScreen)(int, int);
+ miPointerSpriteFuncPtr miSprite;
+#ifdef RENDER
+ CompositeProcPtr Composite;
+ GlyphsProcPtr Glyphs;
+ CompositeRectsProcPtr CompositeRects;
+#endif
+} RACScreenRec, *RACScreenPtr;
+
+typedef struct _RACGC {
+ GCOps *wrapOps;
+ GCFuncs *wrapFuncs;
+} RACGCRec, *RACGCPtr;
+
+/* Screen funcs */
+static Bool RACCloseScreen (int i, ScreenPtr pScreen);
+static void RACGetImage (DrawablePtr pDrawable, int sx, int sy,
+ int w, int h, unsigned int format,
+ unsigned long planemask, char *pdstLine);
+static void RACGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
+ int *pwidth, int nspans, char *pdstStart);
+static void RACSourceValidate (DrawablePtr pDrawable,
+ int x, int y, int width, int height );
+static void RACPaintWindowBackground(WindowPtr pWin, RegionPtr prgn, int what);
+static void RACPaintWindowBorder(WindowPtr pWin, RegionPtr prgn, int what);
+static void RACCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc );
+static void RACClearToBackground (WindowPtr pWin, int x, int y,
+ int w, int h, Bool generateExposures );
+static void RACSaveAreas (PixmapPtr pPixmap, RegionPtr prgnSave,
+ int xorg, int yorg, WindowPtr pWin);
+static void RACRestoreAreas (PixmapPtr pPixmap, RegionPtr prgnRestore,
+ int xorg, int yorg, WindowPtr pWin);
+static PixmapPtr RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth);
+static Bool RACCreateGC(GCPtr pGC);
+static Bool RACSaveScreen(ScreenPtr pScreen, Bool unblank);
+static void RACStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
+static void RACRecolorCursor (ScreenPtr pScreen, CursorPtr pCurs,
+ Bool displayed);
+static Bool RACRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor);
+static Bool RACUnrealizeCursor (ScreenPtr pScreen, CursorPtr pCursor);
+static Bool RACDisplayCursor (ScreenPtr pScreen, CursorPtr pCursor);
+static Bool RACSetCursorPosition (ScreenPtr pScreen, int x, int y,
+ Bool generateEvent);
+static void RACAdjustFrame(int index, int x, int y, int flags);
+static Bool RACSwitchMode(int index, DisplayModePtr mode, int flags);
+static Bool RACEnterVT(int index, int flags);
+static void RACLeaveVT(int index, int flags);
+static void RACFreeScreen(int index, int flags);
+/* GC funcs */
+static void RACValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
+static void RACChangeGC(GCPtr pGC, unsigned long mask);
+static void RACCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
+static void RACDestroyGC(GCPtr pGC);
+static void RACChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
+static void RACDestroyClip(GCPtr pGC);
+static void RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
+/* GC ops */
+static void RACFillSpans( DrawablePtr pDraw, GC *pGC, int nInit,
+ DDXPointPtr pptInit, int *pwidthInit, int fSorted );
+static void RACSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc,
+ register DDXPointPtr ppt, int *pwidth, int nspans,
+ int fSorted );
+static void RACPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
+ int x, int y, int w, int h, int leftPad,
+ int format, char *pImage );
+static RegionPtr RACCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
+ GC *pGC, int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty );
+static RegionPtr RACCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
+ GCPtr pGC, int srcx, int srcy,
+ int width, int height, int dstx, int dsty,
+ unsigned long bitPlane );
+static void RACPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode,
+ int npt, xPoint *pptInit );
+static void RACPolylines(DrawablePtr pDraw, GCPtr pGC, int mode,
+ int npt, DDXPointPtr pptInit );
+static void RACPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg,
+ xSegment *pSeg );
+static void RACPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nRectsInit,
+ xRectangle *pRectsInit );
+static void RACPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
+ xArc *parcs );
+static void RACFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape, int mode,
+ int count, DDXPointPtr ptsIn );
+static void RACPolyFillRect( DrawablePtr pDraw, GCPtr pGC, int nrectFill,
+ xRectangle *prectInit );
+static void RACPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
+ xArc *parcs );
+static int RACPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars );
+static int RACPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars );
+static void RACImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars );
+static void RACImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars );
+static void RACImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph,
+ CharInfoPtr *ppci, pointer pglyphBase );
+static void RACPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph,
+ CharInfoPtr *ppci, pointer pglyphBase );
+static void RACPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg );
+/* miSpriteFuncs */
+static Bool RACSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCur);
+static Bool RACSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCur);
+static void RACSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCur,
+ int x, int y);
+static void RACSpriteMoveCursor(ScreenPtr pScreen, int x, int y);
+#ifdef RENDER
+static void RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
+ PicturePtr pDst, INT16 xSrc, INT16 ySrc,
+ INT16 xMask, INT16 yMask, INT16 xDst,
+ INT16 yDst, CARD16 width, CARD16 height);
+static void RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
+ int nlist, GlyphListPtr list, GlyphPtr *glyphs);
+static void RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color,
+ int nRect, xRectangle *rects);
+#endif
+
+GCFuncs RACGCFuncs = {
+ RACValidateGC, RACChangeGC, RACCopyGC, RACDestroyGC,
+ RACChangeClip, RACDestroyClip, RACCopyClip
+};
+
+GCOps RACGCOps = {
+ RACFillSpans, RACSetSpans, RACPutImage, RACCopyArea,
+ RACCopyPlane, RACPolyPoint, RACPolylines, RACPolySegment,
+ RACPolyRectangle, RACPolyArc, RACFillPolygon, RACPolyFillRect,
+ RACPolyFillArc, RACPolyText8, RACPolyText16, RACImageText8,
+ RACImageText16, RACImageGlyphBlt, RACPolyGlyphBlt, RACPushPixels,
+#ifdef NEED_LINEHELPER
+ NULL,
+#endif
+ {NULL} /* devPrivate */
+};
+
+miPointerSpriteFuncRec RACSpriteFuncs = {
+ RACSpriteRealizeCursor, RACSpriteUnrealizeCursor, RACSpriteSetCursor,
+ RACSpriteMoveCursor
+};
+
+int RACScreenIndex = -1;
+int RACGCIndex = -1;
+static unsigned long RACGeneration = 0;
+
+
+Bool
+xf86RACInit(ScreenPtr pScreen, unsigned int flag)
+{
+ ScrnInfoPtr pScrn;
+ RACScreenPtr pScreenPriv;
+ miPointerScreenPtr PointPriv;
+#ifdef RENDER
+ PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+#endif
+
+ pScrn = xf86Screens[pScreen->myNum];
+ PointPriv = (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;
+
+ DPRINT_S("RACInit",pScreen->myNum);
+ if (RACGeneration != serverGeneration) {
+ if ( ((RACScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
+ ((RACGCIndex = AllocateGCPrivateIndex()) < 0))
+ return FALSE;
+
+ RACGeneration = serverGeneration;
+ }
+
+ if (!AllocateGCPrivate(pScreen, RACGCIndex, sizeof(RACGCRec)))
+ return FALSE;
+
+ if (!(pScreenPriv = xalloc(sizeof(RACScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[RACScreenIndex].ptr = (pointer)pScreenPriv;
+
+ WRAP_SCREEN(CloseScreen, RACCloseScreen);
+ WRAP_SCREEN(SaveScreen, RACSaveScreen);
+ WRAP_SCREEN_COND(CreateGC, RACCreateGC, RAC_FB);
+ WRAP_SCREEN_COND(GetImage, RACGetImage, RAC_FB);
+ WRAP_SCREEN_COND(GetSpans, RACGetSpans, RAC_FB);
+ WRAP_SCREEN_COND(SourceValidate, RACSourceValidate, RAC_FB);
+ WRAP_SCREEN_COND(PaintWindowBackground, RACPaintWindowBackground, RAC_FB);
+ WRAP_SCREEN_COND(PaintWindowBorder, RACPaintWindowBorder, RAC_FB);
+ WRAP_SCREEN_COND(CopyWindow, RACCopyWindow, RAC_FB);
+ WRAP_SCREEN_COND(ClearToBackground, RACClearToBackground, RAC_FB);
+ WRAP_SCREEN_COND(CreatePixmap, RACCreatePixmap, RAC_FB);
+ WRAP_SCREEN_COND(BackingStoreFuncs.RestoreAreas, RACRestoreAreas, RAC_FB);
+ WRAP_SCREEN_COND(BackingStoreFuncs.SaveAreas, RACSaveAreas, RAC_FB);
+ WRAP_SCREEN_COND(StoreColors, RACStoreColors, RAC_COLORMAP);
+ WRAP_SCREEN_COND(DisplayCursor, RACDisplayCursor, RAC_CURSOR);
+ WRAP_SCREEN_COND(RealizeCursor, RACRealizeCursor, RAC_CURSOR);
+ WRAP_SCREEN_COND(UnrealizeCursor, RACUnrealizeCursor, RAC_CURSOR);
+ WRAP_SCREEN_COND(RecolorCursor, RACRecolorCursor, RAC_CURSOR);
+ WRAP_SCREEN_COND(SetCursorPosition, RACSetCursorPosition, RAC_CURSOR);
+#ifdef RENDER
+ WRAP_PICT_COND(Composite,RACComposite,RAC_FB);
+ WRAP_PICT_COND(Glyphs,RACGlyphs,RAC_FB);
+ WRAP_PICT_COND(CompositeRects,RACCompositeRects,RAC_FB);
+#endif
+ WRAP_SCREEN_INFO_COND(AdjustFrame, RACAdjustFrame, RAC_VIEWPORT);
+ WRAP_SCREEN_INFO(SwitchMode, RACSwitchMode);
+ WRAP_SCREEN_INFO(EnterVT, RACEnterVT);
+ WRAP_SCREEN_INFO(LeaveVT, RACLeaveVT);
+ WRAP_SCREEN_INFO(FreeScreen, RACFreeScreen);
+ WRAP_SPRITE_COND(RAC_CURSOR);
+
+ return TRUE;
+}
+
+/* Screen funcs */
+static Bool
+RACCloseScreen (int i, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ RACScreenPtr pScreenPriv =
+ (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
+ miPointerScreenPtr PointPriv
+ = (miPointerScreenPtr)pScreen->devPrivates[miPointerScreenIndex].ptr;
+#ifdef RENDER
+ PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+#endif
+
+ DPRINT_S("RACCloseScreen",pScreen->myNum);
+ UNWRAP_SCREEN(CreateGC);
+ UNWRAP_SCREEN(CloseScreen);
+ UNWRAP_SCREEN(GetImage);
+ UNWRAP_SCREEN(GetSpans);
+ UNWRAP_SCREEN(SourceValidate);
+ UNWRAP_SCREEN(PaintWindowBackground);
+ UNWRAP_SCREEN(PaintWindowBorder);
+ UNWRAP_SCREEN(CopyWindow);
+ UNWRAP_SCREEN(ClearToBackground);
+ UNWRAP_SCREEN(BackingStoreFuncs.RestoreAreas);
+ UNWRAP_SCREEN(BackingStoreFuncs.SaveAreas);
+ UNWRAP_SCREEN(SaveScreen);
+ UNWRAP_SCREEN(StoreColors);
+ UNWRAP_SCREEN(DisplayCursor);
+ UNWRAP_SCREEN(RealizeCursor);
+ UNWRAP_SCREEN(UnrealizeCursor);
+ UNWRAP_SCREEN(RecolorCursor);
+ UNWRAP_SCREEN(SetCursorPosition);
+#ifdef RENDER
+ UNWRAP_PICT(Composite);
+ UNWRAP_PICT(Glyphs);
+ UNWRAP_PICT(CompositeRects);
+#endif
+ UNWRAP_SCREEN_INFO(AdjustFrame);
+ UNWRAP_SCREEN_INFO(SwitchMode);
+ UNWRAP_SCREEN_INFO(EnterVT);
+ UNWRAP_SCREEN_INFO(LeaveVT);
+ UNWRAP_SCREEN_INFO(FreeScreen);
+ UNWRAP_SPRITE;
+
+ xfree ((pointer) pScreenPriv);
+
+ if (xf86Screens[pScreen->myNum]->vtSema) {
+ xf86EnterServerState(SETUP);
+ ENABLE;
+ }
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+static void
+RACGetImage (
+ DrawablePtr pDrawable,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planemask,
+ char *pdstLine
+ )
+{
+ ScreenPtr pScreen = pDrawable->pScreen;
+ DPRINT_S("RACGetImage",pScreen->myNum);
+ SCREEN_PROLOG(GetImage);
+ if (xf86Screens[pScreen->myNum]->vtSema) {
+ ENABLE;
+ }
+ (*pScreen->GetImage) (pDrawable, sx, sy, w, h,
+ format, planemask, pdstLine);
+ SCREEN_EPILOG (GetImage, RACGetImage);
+}
+
+static void
+RACGetSpans (
+ DrawablePtr pDrawable,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pdstStart
+ )
+{
+ ScreenPtr pScreen = pDrawable->pScreen;
+
+ DPRINT_S("RACGetSpans",pScreen->myNum);
+ SCREEN_PROLOG (GetSpans);
+ ENABLE;
+ (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
+ SCREEN_EPILOG (GetSpans, RACGetSpans);
+}
+
+static void
+RACSourceValidate (
+ DrawablePtr pDrawable,
+ int x, int y, int width, int height )
+{
+ ScreenPtr pScreen = pDrawable->pScreen;
+ DPRINT_S("RACSourceValidate",pScreen->myNum);
+ SCREEN_PROLOG (SourceValidate);
+ ENABLE;
+ if (pScreen->SourceValidate)
+ (*pScreen->SourceValidate) (pDrawable, x, y, width, height);
+ SCREEN_EPILOG (SourceValidate, RACSourceValidate);
+}
+
+static void
+RACPaintWindowBackground(
+ WindowPtr pWin,
+ RegionPtr prgn,
+ int what
+ )
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ DPRINT_S("RACPaintWindowBackground",pScreen->myNum);
+ SCREEN_PROLOG (PaintWindowBackground);
+ ENABLE;
+ (*pScreen->PaintWindowBackground) (pWin, prgn, what);
+ SCREEN_EPILOG (PaintWindowBackground, RACPaintWindowBackground);
+}
+
+static void
+RACPaintWindowBorder(
+ WindowPtr pWin,
+ RegionPtr prgn,
+ int what
+)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ DPRINT_S("RACPaintWindowBorder",pScreen->myNum);
+ SCREEN_PROLOG (PaintWindowBorder);
+ ENABLE;
+ (*pScreen->PaintWindowBorder) (pWin, prgn, what);
+ SCREEN_EPILOG (PaintWindowBorder, RACPaintWindowBorder);
+}
+
+static void
+RACCopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc )
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ DPRINT_S("RACCopyWindow",pScreen->myNum);
+ SCREEN_PROLOG (CopyWindow);
+ ENABLE;
+ (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
+ SCREEN_EPILOG (CopyWindow, RACCopyWindow);
+}
+
+static void
+RACClearToBackground (
+ WindowPtr pWin,
+ int x, int y,
+ int w, int h,
+ Bool generateExposures )
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+
+ DPRINT_S("RACClearToBackground",pScreen->myNum);
+ SCREEN_PROLOG ( ClearToBackground);
+ ENABLE;
+ (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
+ SCREEN_EPILOG (ClearToBackground, RACClearToBackground);
+}
+
+static void
+RACSaveAreas (
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+ )
+{
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ DPRINT_S("RACSaveAreas",pScreen->myNum);
+ SCREEN_PROLOG (BackingStoreFuncs.SaveAreas);
+ ENABLE;
+ (*pScreen->BackingStoreFuncs.SaveAreas) (
+ pPixmap, prgnSave, xorg, yorg, pWin);
+
+ SCREEN_EPILOG (BackingStoreFuncs.SaveAreas, RACSaveAreas);
+}
+
+static void
+RACRestoreAreas (
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+ )
+{
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+
+ DPRINT_S("RACRestoreAreas",pScreen->myNum);
+ SCREEN_PROLOG (BackingStoreFuncs.RestoreAreas);
+ ENABLE;
+ (*pScreen->BackingStoreFuncs.RestoreAreas) (
+ pPixmap, prgnRestore, xorg, yorg, pWin);
+
+ SCREEN_EPILOG ( BackingStoreFuncs.RestoreAreas, RACRestoreAreas);
+}
+
+static PixmapPtr
+RACCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
+{
+ PixmapPtr pPix;
+
+ DPRINT_S("RACCreatePixmap",pScreen->myNum);
+ SCREEN_PROLOG ( CreatePixmap);
+ ENABLE;
+ pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
+ SCREEN_EPILOG (CreatePixmap, RACCreatePixmap);
+
+ return pPix;
+}
+
+static Bool
+RACSaveScreen(ScreenPtr pScreen, Bool unblank)
+{
+ Bool val;
+
+ DPRINT_S("RACSaveScreen",pScreen->myNum);
+ SCREEN_PROLOG (SaveScreen);
+ ENABLE;
+ val = (*pScreen->SaveScreen) (pScreen, unblank);
+ SCREEN_EPILOG (SaveScreen, RACSaveScreen);
+
+ return val;
+}
+
+static void
+RACStoreColors (
+ ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+
+ DPRINT_S("RACStoreColors",pScreen->myNum);
+ SCREEN_PROLOG (StoreColors);
+ ENABLE;
+ (*pScreen->StoreColors) (pmap,ndef,pdefs);
+
+ SCREEN_EPILOG ( StoreColors, RACStoreColors);
+}
+
+static void
+RACRecolorCursor (
+ ScreenPtr pScreen,
+ CursorPtr pCurs,
+ Bool displayed
+ )
+{
+ DPRINT_S("RACRecolorCursor",pScreen->myNum);
+ SCREEN_PROLOG (RecolorCursor);
+ ENABLE;
+ (*pScreen->RecolorCursor) (pScreen,pCurs,displayed);
+
+ SCREEN_EPILOG ( RecolorCursor, RACRecolorCursor);
+}
+
+static Bool
+RACRealizeCursor (
+ ScreenPtr pScreen,
+ CursorPtr pCursor
+ )
+{
+ Bool val;
+
+ DPRINT_S("RACRealizeCursor",pScreen->myNum);
+ SCREEN_PROLOG (RealizeCursor);
+ ENABLE;
+ val = (*pScreen->RealizeCursor) (pScreen,pCursor);
+
+ SCREEN_EPILOG ( RealizeCursor, RACRealizeCursor);
+ return val;
+}
+
+static Bool
+RACUnrealizeCursor (
+ ScreenPtr pScreen,
+ CursorPtr pCursor
+ )
+{
+ Bool val;
+
+ DPRINT_S("RACUnrealizeCursor",pScreen->myNum);
+ SCREEN_PROLOG (UnrealizeCursor);
+ ENABLE;
+ val = (*pScreen->UnrealizeCursor) (pScreen,pCursor);
+
+ SCREEN_EPILOG ( UnrealizeCursor, RACUnrealizeCursor);
+ return val;
+}
+
+static Bool
+RACDisplayCursor (
+ ScreenPtr pScreen,
+ CursorPtr pCursor
+ )
+{
+ Bool val;
+
+ DPRINT_S("RACDisplayCursor",pScreen->myNum);
+ SCREEN_PROLOG (DisplayCursor);
+ ENABLE;
+ val = (*pScreen->DisplayCursor) (pScreen,pCursor);
+
+ SCREEN_EPILOG ( DisplayCursor, RACDisplayCursor);
+ return val;
+}
+
+static Bool
+RACSetCursorPosition (
+ ScreenPtr pScreen,
+ int x, int y,
+ Bool generateEvent)
+{
+ Bool val;
+
+ DPRINT_S("RACSetCursorPosition",pScreen->myNum);
+ SCREEN_PROLOG (SetCursorPosition);
+ ENABLE;
+ val = (*pScreen->SetCursorPosition) (pScreen,x,y,generateEvent);
+
+ SCREEN_EPILOG ( SetCursorPosition, RACSetCursorPosition);
+ return val;
+}
+
+static void
+RACAdjustFrame(int index, int x, int y, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ RACScreenPtr pScreenPriv =
+ (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
+
+ DPRINT_S("RACAdjustFrame",index);
+ xf86EnableAccess(xf86Screens[index]);
+
+ (*pScreenPriv->AdjustFrame)(index, x, y, flags);
+}
+
+static Bool
+RACSwitchMode(int index, DisplayModePtr mode, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ RACScreenPtr pScreenPriv =
+ (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
+
+ DPRINT_S("RACSwitchMode",index);
+ xf86EnableAccess(xf86Screens[index]);
+
+ return (*pScreenPriv->SwitchMode)(index, mode, flags);
+}
+
+static Bool
+RACEnterVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ RACScreenPtr pScreenPriv =
+ (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
+
+ DPRINT_S("RACEnterVT",index);
+ xf86EnableAccess(xf86Screens[index]);
+
+ return (*pScreenPriv->EnterVT)(index, flags);
+}
+
+static void
+RACLeaveVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ RACScreenPtr pScreenPriv =
+ (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
+
+ DPRINT_S("RACLeaveVT",index);
+ xf86EnableAccess(xf86Screens[index]);
+
+ (*pScreenPriv->LeaveVT)(index, flags);
+}
+
+static void
+RACFreeScreen(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ RACScreenPtr pScreenPriv =
+ (RACScreenPtr) pScreen->devPrivates[RACScreenIndex].ptr;
+
+ DPRINT_S("RACFreeScreen",index);
+ xf86EnableAccess(xf86Screens[index]);
+
+ (*pScreenPriv->FreeScreen)(index, flags);
+}
+
+static Bool
+RACCreateGC(GCPtr pGC)
+{
+ ScreenPtr pScreen = pGC->pScreen;
+ RACGCPtr pGCPriv = (RACGCPtr) (pGC)->devPrivates[RACGCIndex].ptr;
+ Bool ret;
+
+ DPRINT_S("RACCreateGC",pScreen->myNum);
+ SCREEN_PROLOG(CreateGC);
+
+ ret = (*pScreen->CreateGC)(pGC);
+
+ GC_WRAP(pGC);
+ SCREEN_EPILOG(CreateGC,RACCreateGC);
+
+ return ret;
+}
+
+/* GC funcs */
+static void
+RACValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACValidateGC");
+ (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
+ GC_WRAP(pGC);
+}
+
+
+static void
+RACDestroyGC(GCPtr pGC)
+{
+ GC_UNWRAP (pGC);
+ DPRINT("RACDestroyGC");
+ (*pGC->funcs->DestroyGC)(pGC);
+ GC_WRAP (pGC);
+}
+
+static void
+RACChangeGC (
+ GCPtr pGC,
+ unsigned long mask)
+{
+ GC_UNWRAP (pGC);
+ DPRINT("RACChangeGC");
+ (*pGC->funcs->ChangeGC) (pGC, mask);
+ GC_WRAP (pGC);
+}
+
+static void
+RACCopyGC (
+ GCPtr pGCSrc,
+ unsigned long mask,
+ GCPtr pGCDst)
+{
+ GC_UNWRAP (pGCDst);
+ DPRINT("RACCopyGC");
+ (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
+ GC_WRAP (pGCDst);
+}
+
+static void
+RACChangeClip (
+ GCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects )
+{
+ GC_UNWRAP (pGC);
+ DPRINT("RACChangeClip");
+ (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
+ GC_WRAP (pGC);
+}
+
+static void
+RACCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
+{
+ GC_UNWRAP (pgcDst);
+ DPRINT("RACCopyClip");
+ (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
+ GC_WRAP (pgcDst);
+}
+
+static void
+RACDestroyClip(GCPtr pGC)
+{
+ GC_UNWRAP (pGC);
+ DPRINT("RACDestroyClip");
+ (* pGC->funcs->DestroyClip)(pGC);
+ GC_WRAP (pGC);
+}
+
+/* GC Ops */
+static void
+RACFillSpans(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACFillSpans");
+ ENABLE_GC;
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ GC_WRAP(pGC);
+}
+
+static void
+RACSetSpans(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACSetSpans");
+ ENABLE_GC;
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ GC_WRAP(pGC);
+}
+
+static void
+RACPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPutImage");
+ ENABLE_GC;
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ GC_WRAP(pGC);
+}
+
+static RegionPtr
+RACCopyArea(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty )
+{
+ RegionPtr ret;
+
+ GC_UNWRAP(pGC);
+ DPRINT("RACCopyArea");
+ ENABLE_GC;
+ ret = (*pGC->ops->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ GC_WRAP(pGC);
+ return ret;
+}
+
+static RegionPtr
+RACCopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane )
+{
+ RegionPtr ret;
+
+ GC_UNWRAP(pGC);
+ DPRINT("RACCopyPlane");
+ ENABLE_GC;
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
+ width, height, dstx, dsty, bitPlane);
+ GC_WRAP(pGC);
+ return ret;
+}
+
+static void
+RACPolyPoint(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolyPoint");
+ ENABLE_GC;
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ GC_WRAP(pGC);
+}
+
+
+static void
+RACPolylines(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolylines");
+ ENABLE_GC;
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ GC_WRAP(pGC);
+}
+
+static void
+RACPolySegment(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolySegment");
+ ENABLE_GC;
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ GC_WRAP(pGC);
+}
+
+static void
+RACPolyRectangle(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolyRectangle");
+ ENABLE_GC;
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ GC_WRAP(pGC);
+}
+
+static void
+RACPolyArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolyArc");
+ ENABLE_GC;
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ GC_WRAP(pGC);
+}
+
+static void
+RACFillPolygon(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACFillPolygon");
+ ENABLE_GC;
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ GC_WRAP(pGC);
+}
+
+
+static void
+RACPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolyFillRect");
+ ENABLE_GC;
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ GC_WRAP(pGC);
+}
+
+
+static void
+RACPolyFillArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolyFillArc");
+ ENABLE_GC;
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ GC_WRAP(pGC);
+}
+
+static int
+RACPolyText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars )
+{
+ int ret;
+
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolyText8");
+ ENABLE_GC;
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ GC_WRAP(pGC);
+ return ret;
+}
+
+static int
+RACPolyText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars )
+{
+ int ret;
+
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolyText16");
+ ENABLE_GC;
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ GC_WRAP(pGC);
+ return ret;
+}
+
+static void
+RACImageText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACImageText8");
+ ENABLE_GC;
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ GC_WRAP(pGC);
+}
+
+static void
+RACImageText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACImageText16");
+ ENABLE_GC;
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ GC_WRAP(pGC);
+}
+
+
+static void
+RACImageGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACImageGlyphBlt");
+ ENABLE_GC;
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
+ nglyph, ppci, pglyphBase);
+ GC_WRAP(pGC);
+}
+
+static void
+RACPolyGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPolyGlyphBlt");
+ ENABLE_GC;
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
+ nglyph, ppci, pglyphBase);
+ GC_WRAP(pGC);
+}
+
+static void
+RACPushPixels(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg )
+{
+ GC_UNWRAP(pGC);
+ DPRINT("RACPushPixels");
+ ENABLE_GC;
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ GC_WRAP(pGC);
+}
+
+
+/* miSpriteFuncs */
+static Bool
+RACSpriteRealizeCursor(ScreenPtr pScreen, CursorPtr pCur)
+{
+ Bool val;
+ SPRITE_PROLOG;
+ DPRINT_S("RACSpriteRealizeCursor",pScreen->myNum);
+ ENABLE;
+ val = PointPriv->spriteFuncs->RealizeCursor(pScreen, pCur);
+ SPRITE_EPILOG;
+ return val;
+}
+
+static Bool
+RACSpriteUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCur)
+{
+ Bool val;
+ SPRITE_PROLOG;
+ DPRINT_S("RACSpriteUnrealizeCursor",pScreen->myNum);
+ ENABLE;
+ val = PointPriv->spriteFuncs->UnrealizeCursor(pScreen, pCur);
+ SPRITE_EPILOG;
+ return val;
+}
+
+static void
+RACSpriteSetCursor(ScreenPtr pScreen, CursorPtr pCur, int x, int y)
+{
+ SPRITE_PROLOG;
+ DPRINT_S("RACSpriteSetCursor",pScreen->myNum);
+ ENABLE;
+ PointPriv->spriteFuncs->SetCursor(pScreen, pCur, x, y);
+ SPRITE_EPILOG;
+}
+
+static void
+RACSpriteMoveCursor(ScreenPtr pScreen, int x, int y)
+{
+ SPRITE_PROLOG;
+ DPRINT_S("RACSpriteMoveCursor",pScreen->myNum);
+ ENABLE;
+ PointPriv->spriteFuncs->MoveCursor(pScreen, x, y);
+ SPRITE_EPILOG;
+}
+
+#ifdef RENDER
+static void
+RACComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
+ PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask,
+ INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width,
+ CARD16 height)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+
+ PICTURE_PROLOGUE(Composite);
+
+ ENABLE;
+ (*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst,
+ yDst, width, height);
+
+ PICTURE_EPILOGUE(Composite, RACComposite);
+}
+
+static void
+RACGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist,
+ GlyphListPtr list, GlyphPtr *glyphs)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+
+ PICTURE_PROLOGUE(Glyphs);
+
+ ENABLE;
+ (*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
+
+ PICTURE_EPILOGUE (Glyphs, RACGlyphs);
+}
+
+static void
+RACCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRect,
+ xRectangle *rects)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+
+ PICTURE_PROLOGUE(CompositeRects);
+
+ ENABLE;
+ (*ps->CompositeRects)(op, pDst, color, nRect, rects);
+
+ PICTURE_EPILOGUE (CompositeRects, RACCompositeRects);
+}
+#endif
+
diff --git a/hw/xfree86/rac/xf86RAC.h b/hw/xfree86/rac/xf86RAC.h
new file mode 100644
index 000000000..c704bd75e
--- /dev/null
+++ b/hw/xfree86/rac/xf86RAC.h
@@ -0,0 +1,18 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/rac/xf86RAC.h,v 1.3 1999/06/12 07:19:05 dawes Exp $ */
+
+#ifndef __XF86RAC_H
+#define __XF86RAC_H 1
+
+#include "screenint.h"
+#include "misc.h"
+#include "xf86.h"
+
+Bool xf86RACInit(ScreenPtr pScreen, unsigned int flag);
+
+/* flags */
+#define RAC_FB 0x01
+#define RAC_CURSOR 0x02
+#define RAC_COLORMAP 0x04
+#define RAC_VIEWPORT 0x08
+
+#endif /* __XF86RAC_H */
diff --git a/hw/xfree86/rac/xf86RACmodule.c b/hw/xfree86/rac/xf86RACmodule.c
new file mode 100644
index 000000000..f0a960a66
--- /dev/null
+++ b/hw/xfree86/rac/xf86RACmodule.c
@@ -0,0 +1,21 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/rac/xf86RACmodule.c,v 1.4 1999/01/26 05:54:14 dawes Exp $ */
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo racVersRec =
+{
+ "rac",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+
+XF86ModuleData racModuleData = { &racVersRec, NULL, NULL };
+
diff --git a/hw/xfree86/ramdac/BT.c b/hw/xfree86/ramdac/BT.c
new file mode 100644
index 000000000..9ddd3b20b
--- /dev/null
+++ b/hw/xfree86/ramdac/BT.c
@@ -0,0 +1,163 @@
+/*
+ * Copyright 1998 by Alan Hourihane, Wigan, England.
+ *
+ * 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 Alan Hourihane not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Alan Hourihane makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ALAN HOURIHANE 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.
+ *
+ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ *
+ * BT RAMDAC routines.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BT.c,v 1.7 2000/10/20 12:57:27 alanh Exp $ */
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+
+#define INIT_BT_RAMDAC_INFO
+#include "BTPriv.h"
+#include "xf86RamDacPriv.h"
+
+void
+BTramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
+ RamDacRegRecPtr ramdacReg)
+{
+ int i;
+
+ /* Here we pass a short, so that we can evaluate a mask too */
+ /* So that the mask is the high byte and the data the low byte */
+ /* Just the command/status registers */
+ for (i=0x06;i<0x0A;i++)
+ (*ramdacPtr->WriteDAC)
+ (pScrn, i, (ramdacReg->DacRegs[i] & 0xFF00) >> 8,
+ ramdacReg->DacRegs[i]);
+}
+
+void
+BTramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
+ RamDacRegRecPtr ramdacReg)
+{
+ int i;
+
+ (*ramdacPtr->ReadAddress)(pScrn, 0); /* Start at index 0 */
+ for (i=0;i<768;i++)
+ ramdacReg->DAC[i] = (*ramdacPtr->ReadData)(pScrn);
+
+ /* Just the command/status registers */
+ for (i=0x06;i<0x0A;i++)
+ ramdacReg->DacRegs[i] = (*ramdacPtr->ReadDAC)(pScrn, i);
+}
+
+RamDacHelperRecPtr
+BTramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs/*, RamDacRecPtr ramdacPtr*/)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+ Bool RamDacIsSupported = FALSE;
+ RamDacHelperRecPtr ramdacHelperPtr = NULL;
+ int BTramdac_ID = -1;
+ int i, status, cmd0;
+
+ /* Save COMMAND Register 0 */
+ cmd0 = (*ramdacPtr->ReadDAC)(pScrn, BT_COMMAND_REG_0);
+ /* Ensure were going to access the STATUS Register on next read */
+ (*ramdacPtr->WriteDAC)(pScrn, BT_COMMAND_REG_0, 0x7F, 0x00);
+
+ status = (*ramdacPtr->ReadDAC)(pScrn, BT_STATUS_REG);
+ switch (status) {
+ case 0x40:
+ BTramdac_ID = ATT20C504_RAMDAC;
+ break;
+ case 0xD0:
+ BTramdac_ID = ATT20C505_RAMDAC;
+ break;
+ default:
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Unknown BT RAMDAC type (0x%x), assuming BT485\n",
+ status);
+ case 0x80:
+ case 0x90:
+ case 0xA0:
+ case 0xB0:
+ case 0x28: /* This is for the DEC TGA - Questionable ? */
+ BTramdac_ID = BT485_RAMDAC;
+ break;
+ }
+
+ /* Restore COMMAND Register 0 */
+ (*ramdacPtr->WriteDAC)(pScrn, BT_COMMAND_REG_0, 0x00, cmd0);
+
+ if (BTramdac_ID == -1) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Cannot determine BT RAMDAC type, aborting\n");
+ return NULL;
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Attached RAMDAC is %s\n", BTramdacDeviceInfo[BTramdac_ID&0xFFFF]);
+ }
+
+ for (i=0;ramdacs[i].token != -1;i++) {
+ if (ramdacs[i].token == BTramdac_ID)
+ RamDacIsSupported = TRUE;
+ }
+
+ if (!RamDacIsSupported) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "This BT RAMDAC is NOT supported by this driver, aborting\n");
+ return NULL;
+ }
+
+ ramdacHelperPtr = RamDacHelperCreateInfoRec();
+ switch(BTramdac_ID) {
+ case BT485_RAMDAC:
+ ramdacHelperPtr->SetBpp = BTramdacSetBpp;
+ break;
+ }
+ ramdacPtr->RamDacType = BTramdac_ID;
+ ramdacHelperPtr->RamDacType = BTramdac_ID;
+ ramdacHelperPtr->Save = BTramdacSave;
+ ramdacHelperPtr->Restore = BTramdacRestore;
+
+ return ramdacHelperPtr;
+}
+
+void
+BTramdacSetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
+{
+ /* We need to deal with Direct Colour visuals for 8bpp and other
+ * good stuff for colours */
+ switch (pScrn->bitsPerPixel) {
+ case 32:
+ ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x10;
+ break;
+ case 24:
+ ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x10;
+ break;
+ case 16:
+ ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x38;
+ break;
+ case 15:
+ ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x30;
+ break;
+ case 8:
+ ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x40;
+ break;
+ case 4:
+ ramdacReg->DacRegs[BT_COMMAND_REG_1] = 0x60;
+ break;
+ }
+}
diff --git a/hw/xfree86/ramdac/BT.h b/hw/xfree86/ramdac/BT.h
new file mode 100644
index 000000000..ea1180285
--- /dev/null
+++ b/hw/xfree86/ramdac/BT.h
@@ -0,0 +1,33 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BT.h,v 1.3 1998/08/20 08:56:03 dawes Exp $ */
+
+#include "xf86RamDac.h"
+
+RamDacHelperRecPtr BTramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs);
+void BTramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
+void BTramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
+void BTramdacSetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
+
+#define ATT20C504_RAMDAC (VENDOR_BT << 16) | 0x00
+#define ATT20C505_RAMDAC (VENDOR_BT << 16) | 0x01
+#define BT485_RAMDAC (VENDOR_BT << 16) | 0x02
+
+/*
+ * BT registers
+ */
+
+#define BT_WRITE_ADDR 0x00
+#define BT_RAMDAC_DATA 0x01
+#define BT_PIXEL_MASK 0x02
+#define BT_READ_ADDR 0x03
+#define BT_CURS_WR_ADDR 0x04
+#define BT_CURS_DATA 0x05
+#define BT_COMMAND_REG_0 0x06
+#define BT_CURS_RD_ADDR 0x07
+#define BT_COMMAND_REG_1 0x08
+#define BT_COMMAND_REG_2 0x09
+#define BT_STATUS_REG 0x0A
+#define BT_CURS_RAM_DATA 0x0B
+#define BT_CURS_X_LOW 0x0C
+#define BT_CURS_X_HIGH 0x0D
+#define BT_CURS_Y_LOW 0x0E
+#define BT_CURS_Y_HIGH 0x0F
diff --git a/hw/xfree86/ramdac/BTPriv.h b/hw/xfree86/ramdac/BTPriv.h
new file mode 100644
index 000000000..bea623b78
--- /dev/null
+++ b/hw/xfree86/ramdac/BTPriv.h
@@ -0,0 +1,17 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/BTPriv.h,v 1.2 1998/07/25 16:57:18 dawes Exp $ */
+
+#include "BT.h"
+
+typedef struct {
+ char *DeviceName;
+} xf86BTramdacInfo;
+
+extern xf86BTramdacInfo BTramdacDeviceInfo[];
+
+#ifdef INIT_BT_RAMDAC_INFO
+xf86BTramdacInfo BTramdacDeviceInfo[] = {
+ {"AT&T 20C504"},
+ {"AT&T 20C505"},
+ {"BT485/484"}
+};
+#endif
diff --git a/hw/xfree86/ramdac/CURSOR.NOTES b/hw/xfree86/ramdac/CURSOR.NOTES
new file mode 100644
index 000000000..3e901e380
--- /dev/null
+++ b/hw/xfree86/ramdac/CURSOR.NOTES
@@ -0,0 +1,191 @@
+ CURSOR.NOTES
+
+ This file describes how to add hardware cursor support to a chipset
+driver. Though the cursor support itself is in the ramdac module,
+cursor management is separate from the rest of the module.
+
+
+1) CURSOR INITIALIZATION AND SHUTDOWN
+
+ All relevant prototypes and defines are in xf86Cursor.h.
+
+ To initialize the cursor, the driver should allocate an
+xf86CursorInfoRec via xf86CreateCursorInfoRec(), fill it out as described
+later in this document and pass it to xf86InitCursor(). xf86InitCursor()
+must be called _after_ the software cursor initialization (usually
+miDCInitialize).
+
+ When shutting down, the driver should free the xf86CursorInfoRec
+structure in its CloseScreen function via xf86DestroyCursorInfoRec().
+
+
+2) FILLING OUT THE xf86CursorInfoRec
+
+ The driver informs the ramdac module of it's hardware cursor capablities by
+filling out an xf86CursorInfoRec structure and passing it to xf86InitCursor().
+The xf86CursorInfoRec contains the following function pointers:
+
+
+/**** These functions are required ****/
+
+void ShowCursor(ScrnInfoPtr pScrn)
+
+ ShowCursor should display the current cursor.
+
+void HideCursor(ScrnInfoPtr pScrn)
+
+ HideCursor should hide the current cursor.
+
+void SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
+
+ Set the cursor position to (x,y). X and/or y may be negative
+ indicating that the cursor image is partially offscreen on
+ the left and/or top edges of the screen. It is up to the
+ driver to trap for this and deal with that situation.
+
+void SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
+
+ Set the cursor foreground and background colors. In 8bpp, fg and
+ bg are indicies into the current colormap unless the
+ HARDWARE_CURSOR_TRUECOLOR_AT_8BPP flag is set. In that case
+ and in all other bpps the fg and bg are in 8-8-8 RGB format.
+
+void LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits)
+
+ LoadCursorImage is how the hardware cursor bits computed by the
+ RealizeCursor function will be passed to the driver when the cursor
+ shape needs to be changed.
+
+
+/**** These functions are optional ****/
+
+
+unsigned char* RealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+
+ If RealizeCursor is not provided by the driver, one will be provided
+ for you based on the Flags field described below. The driver must
+ provide this function if the hardware cursor format is not one of
+ the common ones supported by this module.
+
+
+Bool UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs)
+
+ If the driver is unable to use a hardware cursor for reasons
+ other than the cursor being larger than the maximum specified
+ in the MaxWidth or MaxHeight field below, it can supply the
+ UseHWCursor function. If UseHWCursor is provided by the driver,
+ it will be called whenever the cursor shape changes or the video
+ mode changes. This is useful for when the hardware cursor cannot
+ be used in interlaced or doublescan modes.
+
+
+/**** The following fields are required ****/
+
+MaxWidth
+MaxHeight
+
+ These indicate the largest sized cursor that can be a hardware
+ cursor. It will fall back to a software cursor when a cursor
+ exceeding this size needs to be used.
+
+
+Flags
+
+ /* Color related flags */
+
+ HARDWARE_CURSOR_TRUECOLOR_AT_8BPP
+
+ This indicates that the colors passed to the SetCursorColors
+ function should not be in 8-8-8 RGB format in 8bpp but rather,
+ they should be the pixel values from the current colormap.
+
+
+ /* Cursor data loading flags */
+
+ HARDWARE_CURSOR_SHOW_TRANSPARENT
+
+ The HideCursor entry will normally be called instead of displaying a
+ completely transparent cursor, or when a switch to a software cursor
+ needs to occur. This flag prevents this behaviour, thus causing the
+ LoadCursorImage entry to be called with transparent cursor data.
+ NOTE: If you use this flag and provide your own RealizeCursor() entry,
+ ensure this entry returns transparent cursor data when called
+ with a NULL pCurs parameter.
+
+ HARDWARE_CURSOR_UPDATE_UNHIDDEN
+
+ This flag prevents the HideCursor call that would normally occur just before
+ the LoadCursorImage entry is to be called to load a new hardware cursor
+ image.
+
+
+ /* Cursor data packing flags */
+
+ Hardware cursor data consists of two pieces, a source and a mask.
+ The mask is a bitmap indicating which parts of the cursor are
+ transparent and which parts are drawn. The source is a bitmap
+ indicating which parts of the non-transparent portion of the the
+ cursor should be painted in the foreground color and which should
+ be painted in the background color.
+
+ HARDWARE_CURSOR_INVERT_MASK
+
+ By default, set bits indicate the opaque part of the mask bitmap
+ and clear bits indicate the transparent part. If your hardware
+ wants this the opposite way, this flag will invert the mask.
+
+ HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK
+
+ By default, RealizeCursor will store the source first and then
+ the mask. If the hardware needs this order reversed then this
+ flag should be set.
+
+ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK
+
+ This flag will have the module logical AND the source with the mask to make
+ sure there are no source bits set if the corresponding mask bits
+ aren't set. Some hardware will not care if source bits are set where
+ there are supposed to be transparent areas, but some hardware will
+ interpret this as a third cursor color or similar. That type of
+ hardware will need this flag set.
+
+ HARDWARE_CURSOR_BIT_ORDER_MSBFIRST
+
+ By default, it is assumed that the least significant bit in each byte
+ corresponds to the leftmost pixel on the screen. If your hardware
+ has this reversed you should set this flag.
+
+ HARDWARE_CURSOR_NIBBLE_SWAPPED
+
+ If your hardware requires byte swapping of the hardware cursor, enable
+ this option.
+
+
+ /* Source-Mask interleaving flags */
+
+ By default the source and mask data are inlined (source first unless
+ the HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK flag is set). Some hardware
+ will require the source and mask to be interleaved, that is, X number
+ of source bits should packed and then X number of mask bits repeating
+ until the entire pattern is stored. The following flags describe the
+ bit interleave.
+
+ HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED
+
+ This one is the default.
+
+ The following are for interleaved cursors.
+
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64
+
+ And once again, if your hardware requires something different than
+ these packing styles, your driver can supply its own RealizeCursor
+ function.
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES,v 1.5 2003/02/13 20:28:41 tsi Exp $
diff --git a/hw/xfree86/ramdac/IBM.c b/hw/xfree86/ramdac/IBM.c
new file mode 100644
index 000000000..d62a9ba56
--- /dev/null
+++ b/hw/xfree86/ramdac/IBM.c
@@ -0,0 +1,633 @@
+/*
+ * Copyright 1998 by Alan Hourihane, Wigan, England.
+ *
+ * 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 Alan Hourihane not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Alan Hourihane makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ALAN HOURIHANE 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.
+ *
+ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ *
+ * IBM RAMDAC routines.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBM.c,v 1.12 2003/02/17 16:08:29 dawes Exp $ */
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+
+#include "xf86Cursor.h"
+
+#define INIT_IBM_RAMDAC_INFO
+#include "IBMPriv.h"
+#include "xf86RamDacPriv.h"
+
+#define INITIALFREQERR 100000
+
+unsigned long
+IBMramdac640CalculateMNPCForClock(
+ unsigned long RefClock, /* In 100Hz units */
+ unsigned long ReqClock, /* In 100Hz units */
+ char IsPixClock, /* boolean, is this the pixel or the sys clock */
+ unsigned long MinClock, /* Min VCO rating */
+ unsigned long MaxClock, /* Max VCO rating */
+ unsigned long *rM, /* M Out */
+ unsigned long *rN, /* N Out */
+ unsigned long *rP, /* Min P In, P Out */
+ unsigned long *rC /* C Out */
+)
+{
+ unsigned long M, N, P, iP = *rP;
+ unsigned long IntRef, VCO, Clock;
+ long freqErr, lowestFreqErr = INITIALFREQERR;
+ unsigned long ActualClock = 0;
+
+ for (N = 0; N <= 63; N++)
+ {
+ IntRef = RefClock / (N + 1);
+ if (IntRef < 10000)
+ break; /* IntRef needs to be >= 1MHz */
+ for (M = 2; M <= 127; M++)
+ {
+ VCO = IntRef * (M + 1);
+ if ((VCO < MinClock) || (VCO > MaxClock))
+ continue;
+ for (P = iP; P <= 4; P++)
+ {
+ if (P != 0)
+ Clock = (RefClock * (M + 1)) / ((N + 1) * 2 * P);
+ else
+ Clock = (RefClock * (M + 1)) / (N + 1);
+
+ freqErr = (Clock - ReqClock);
+
+ if (freqErr < 0)
+ {
+ /* PixelClock gets rounded up always so monitor reports
+ correct frequency. */
+ if (IsPixClock)
+ continue;
+ freqErr = -freqErr;
+ }
+
+ if (freqErr < lowestFreqErr)
+ {
+ *rM = M;
+ *rN = N;
+ *rP = P;
+ *rC = (VCO <= 1280000 ? 1 : 2);
+ ActualClock = Clock;
+
+ lowestFreqErr = freqErr;
+ /* Return if we found an exact match */
+ if (freqErr == 0)
+ return (ActualClock);
+ }
+ }
+ }
+ }
+
+ return (ActualClock);
+}
+
+unsigned long
+IBMramdac526CalculateMNPCForClock(
+ unsigned long RefClock, /* In 100Hz units */
+ unsigned long ReqClock, /* In 100Hz units */
+ char IsPixClock, /* boolean, is this the pixel or the sys clock */
+ unsigned long MinClock, /* Min VCO rating */
+ unsigned long MaxClock, /* Max VCO rating */
+ unsigned long *rM, /* M Out */
+ unsigned long *rN, /* N Out */
+ unsigned long *rP, /* Min P In, P Out */
+ unsigned long *rC /* C Out */
+)
+{
+ unsigned long M, N, P, iP = *rP;
+ unsigned long IntRef, VCO, Clock;
+ long freqErr, lowestFreqErr = INITIALFREQERR;
+ unsigned long ActualClock = 0;
+
+ for (N = 0; N <= 63; N++)
+ {
+ IntRef = RefClock / (N + 1);
+ if (IntRef < 10000)
+ break; /* IntRef needs to be >= 1MHz */
+ for (M = 0; M <= 63; M++)
+ {
+ VCO = IntRef * (M + 1);
+ if ((VCO < MinClock) || (VCO > MaxClock))
+ continue;
+ for (P = iP; P <= 4; P++)
+ {
+ if (P)
+ Clock = (RefClock * (M + 1)) / ((N + 1) * 2 * P);
+ else
+ Clock = VCO;
+
+ freqErr = (Clock - ReqClock);
+
+ if (freqErr < 0)
+ {
+ /* PixelClock gets rounded up always so monitor reports
+ correct frequency. */
+ if (IsPixClock)
+ continue;
+ freqErr = -freqErr;
+ }
+
+ if (freqErr < lowestFreqErr)
+ {
+ *rM = M;
+ *rN = N;
+ *rP = P;
+ *rC = (VCO <= 1280000 ? 1 : 2);
+ ActualClock = Clock;
+
+ lowestFreqErr = freqErr;
+ /* Return if we found an exact match */
+ if (freqErr == 0)
+ return (ActualClock);
+ }
+ }
+ }
+ }
+
+ return (ActualClock);
+}
+
+void
+IBMramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
+ RamDacRegRecPtr ramdacReg)
+{
+ int i, maxreg, dacreg;
+
+ switch (ramdacPtr->RamDacType) {
+ case IBM640_RAMDAC:
+ maxreg = 0x300;
+ dacreg = 1024;
+ break;
+ default:
+ maxreg = 0x100;
+ dacreg = 768;
+ break;
+ }
+
+ /* Here we pass a short, so that we can evaluate a mask too */
+ /* So that the mask is the high byte and the data the low byte */
+ for (i=0;i<maxreg;i++)
+ (*ramdacPtr->WriteDAC)
+ (pScrn, i, (ramdacReg->DacRegs[i] & 0xFF00) >> 8,
+ ramdacReg->DacRegs[i]);
+
+ (*ramdacPtr->WriteAddress)(pScrn, 0);
+ for (i=0;i<dacreg;i++)
+ (*ramdacPtr->WriteData)(pScrn, ramdacReg->DAC[i]);
+}
+
+void
+IBMramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
+ RamDacRegRecPtr ramdacReg)
+{
+ int i, maxreg, dacreg;
+
+ switch (ramdacPtr->RamDacType) {
+ case IBM640_RAMDAC:
+ maxreg = 0x300;
+ dacreg = 1024;
+ break;
+ default:
+ maxreg = 0x100;
+ dacreg = 768;
+ break;
+ }
+
+ (*ramdacPtr->ReadAddress)(pScrn, 0);
+ for (i=0;i<dacreg;i++)
+ ramdacReg->DAC[i] = (*ramdacPtr->ReadData)(pScrn);
+
+ for (i=0;i<maxreg;i++)
+ ramdacReg->DacRegs[i] = (*ramdacPtr->ReadDAC)(pScrn, i);
+}
+
+RamDacHelperRecPtr
+IBMramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs/* , RamDacRecPtr ramdacPtr*/)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+ RamDacHelperRecPtr ramdacHelperPtr = NULL;
+ Bool RamDacIsSupported = FALSE;
+ int IBMramdac_ID = -1;
+ int i;
+ unsigned char id, rev, id2, rev2;
+
+ /* read ID and revision */
+ rev = (*ramdacPtr->ReadDAC)(pScrn, IBMRGB_rev);
+ id = (*ramdacPtr->ReadDAC)(pScrn, IBMRGB_id);
+
+ /* check if ID and revision are read only */
+ (*ramdacPtr->WriteDAC)(pScrn, ~rev, 0, IBMRGB_rev);
+ (*ramdacPtr->WriteDAC)(pScrn, ~id, 0, IBMRGB_id);
+ rev2 = (*ramdacPtr->ReadDAC)(pScrn, IBMRGB_rev);
+ id2 = (*ramdacPtr->ReadDAC)(pScrn, IBMRGB_id);
+
+ switch (id) {
+ case 0x30:
+ if (rev == 0xc0) IBMramdac_ID = IBM624_RAMDAC;
+ if (rev == 0x80) IBMramdac_ID = IBM624DB_RAMDAC;
+ break;
+ case 0x12:
+ if (rev == 0x1c) IBMramdac_ID = IBM640_RAMDAC;
+ break;
+ case 0x01:
+ IBMramdac_ID = IBM525_RAMDAC;
+ break;
+ case 0x02:
+ if (rev == 0xf0) IBMramdac_ID = IBM524_RAMDAC;
+ if (rev == 0xe0) IBMramdac_ID = IBM524A_RAMDAC;
+ if (rev == 0xc0) IBMramdac_ID = IBM526_RAMDAC;
+ if (rev == 0x80) IBMramdac_ID = IBM526DB_RAMDAC;
+ break;
+ }
+
+ if (id == 1 || id == 2) {
+ if (id == id2 && rev == rev2) { /* IBM RGB52x found */
+ /* check for 128bit VRAM -> RGB528 */
+ if (((*ramdacPtr->ReadDAC)(pScrn, IBMRGB_misc1) & 0x03) == 0x03) {
+ IBMramdac_ID = IBM528_RAMDAC; /* 128bit DAC found */
+ if (rev == 0xe0)
+ IBMramdac_ID = IBM528A_RAMDAC;
+ }
+ }
+ }
+
+ (*ramdacPtr->WriteDAC)(pScrn, rev, 0, IBMRGB_rev);
+ (*ramdacPtr->WriteDAC)(pScrn, id, 0, IBMRGB_id);
+
+ if (IBMramdac_ID == -1) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Cannot determine IBM RAMDAC type, aborting\n");
+ return NULL;
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Attached RAMDAC is %s\n", IBMramdacDeviceInfo[IBMramdac_ID&0xFFFF]);
+ }
+
+ for (i=0;ramdacs[i].token != -1;i++) {
+ if (ramdacs[i].token == IBMramdac_ID)
+ RamDacIsSupported = TRUE;
+ }
+
+ if (!RamDacIsSupported) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "This IBM RAMDAC is NOT supported by this driver, aborting\n");
+ return NULL;
+ }
+
+ ramdacHelperPtr = RamDacHelperCreateInfoRec();
+ switch (IBMramdac_ID) {
+ case IBM526_RAMDAC:
+ case IBM526DB_RAMDAC:
+ ramdacHelperPtr->SetBpp = IBMramdac526SetBpp;
+ ramdacHelperPtr->HWCursorInit = IBMramdac526HWCursorInit;
+ break;
+ case IBM640_RAMDAC:
+ ramdacHelperPtr->SetBpp = IBMramdac640SetBpp;
+ ramdacHelperPtr->HWCursorInit = IBMramdac640HWCursorInit;
+ break;
+ }
+ ramdacPtr->RamDacType = IBMramdac_ID;
+ ramdacHelperPtr->RamDacType = IBMramdac_ID;
+ ramdacHelperPtr->Save = IBMramdacSave;
+ ramdacHelperPtr->Restore = IBMramdacRestore;
+
+ return ramdacHelperPtr;
+}
+
+void
+IBMramdac526SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
+{
+ ramdacReg->DacRegs[IBMRGB_key_control] = 0x00; /* Disable Chroma Key */
+
+ switch (pScrn->bitsPerPixel) {
+ case 32:
+ ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_32BPP;
+ ramdacReg->DacRegs[IBMRGB_32bpp] = B32_DCOL_DIRECT;
+ ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_16bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
+ if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
+ ramdacReg->DacRegs[IBMRGB_key_control] = 0x01; /* Enable Key */
+ ramdacReg->DacRegs[IBMRGB_key] = 0xFF;
+ ramdacReg->DacRegs[IBMRGB_key_mask] = 0xFF;
+ }
+ break;
+ case 24:
+ ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_24BPP;
+ ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_24bpp] = B24_DCOL_DIRECT;
+ ramdacReg->DacRegs[IBMRGB_16bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
+ break;
+ case 16:
+ if (pScrn->depth == 16) {
+ ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_16BPP;
+ ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_16bpp] = B16_DCOL_DIRECT|B16_LINEAR |
+ B16_CONTIGUOUS | B16_565;
+ ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
+ } else {
+ ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_16BPP;
+ ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_16bpp] = B16_DCOL_DIRECT|B16_LINEAR |
+ B16_CONTIGUOUS | B16_555;
+ ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
+ }
+ break;
+ case 8:
+ ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_8BPP;
+ ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_16bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_8bpp] = B8_DCOL_INDIRECT;
+ break;
+ case 4:
+ ramdacReg->DacRegs[IBMRGB_pix_fmt] = PIXEL_FORMAT_4BPP;
+ ramdacReg->DacRegs[IBMRGB_32bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_24bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_16bpp] = 0;
+ ramdacReg->DacRegs[IBMRGB_8bpp] = 0;
+ }
+}
+
+void
+IBMramdac640SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
+{
+ unsigned char bpp = 0x00;
+ unsigned char overlaybpp = 0x00;
+ unsigned char offset = 0x00;
+ unsigned char dispcont = 0x44;
+
+ ramdacReg->DacRegs[RGB640_SER_WID_03_00] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_WID_07_04] = 0x00;
+ ramdacReg->DacRegs[RGB640_DIAGS] = 0x07;
+
+ switch (pScrn->depth) {
+ case 8:
+ ramdacReg->DacRegs[RGB640_SER_07_00] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_15_08] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_16_1; /*16:1 Mux*/
+ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */
+ bpp = 0x03;
+ break;
+ case 15:
+ ramdacReg->DacRegs[RGB640_SER_07_00] = 0x10;
+ ramdacReg->DacRegs[RGB640_SER_15_08] = 0x11;
+ ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_8_1; /* 8:1 Mux*/
+ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */
+ bpp = 0x0E;
+ break;
+ case 16:
+ ramdacReg->DacRegs[RGB640_SER_07_00] = 0x10;
+ ramdacReg->DacRegs[RGB640_SER_15_08] = 0x11;
+ ramdacReg->DacRegs[RGB640_SER_23_16] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_31_24] = 0x00;
+ ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_8_1; /* 8:1 Mux*/
+ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */
+ bpp = 0x05;
+ break;
+ case 24:
+ ramdacReg->DacRegs[RGB640_SER_07_00] = 0x30;
+ ramdacReg->DacRegs[RGB640_SER_15_08] = 0x31;
+ ramdacReg->DacRegs[RGB640_SER_23_16] = 0x32;
+ ramdacReg->DacRegs[RGB640_SER_31_24] = 0x33;
+ ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_4_1; /* 4:1 Mux*/
+ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PCLK_8; /* pll / 8 */
+ bpp = 0x09;
+ if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
+ ramdacReg->DacRegs[RGB640_SER_WID_07_04] = 0x04;
+ ramdacReg->DacRegs[RGB640_CHROMA_KEY0] = 0xFF;
+ ramdacReg->DacRegs[RGB640_CHROMA_MASK0] = 0xFF;
+ offset = 0x04;
+ overlaybpp = 0x04;
+ dispcont = 0x48;
+ }
+ break;
+ case 30: /* 10 bit dac */
+ ramdacReg->DacRegs[RGB640_SER_07_00] = 0x30;
+ ramdacReg->DacRegs[RGB640_SER_15_08] = 0x31;
+ ramdacReg->DacRegs[RGB640_SER_23_16] = 0x32;
+ ramdacReg->DacRegs[RGB640_SER_31_24] = 0x33;
+ ramdacReg->DacRegs[RGB640_SER_MODE] = IBM640_SER_4_1; /* 4:1 Mux*/
+ ramdacReg->DacRegs[RGB640_MISC_CONF] = IBM640_PSIZE10 |
+ IBM640_PCLK_8; /* pll / 8 */
+ bpp = 0x0D;
+ break;
+ }
+
+ {
+ int i;
+ for (i=0x100;i<0x140;i+=4) {
+ /* Initialize FrameBuffer Window Attribute Table */
+ ramdacReg->DacRegs[i+0] = bpp;
+ ramdacReg->DacRegs[i+1] = offset;
+ ramdacReg->DacRegs[i+2] = 0x00;
+ ramdacReg->DacRegs[i+3] = 0x00;
+ /* Initialize Overlay Window Attribute Table */
+ ramdacReg->DacRegs[i+0x100] = overlaybpp;
+ ramdacReg->DacRegs[i+0x101] = 0x00;
+ ramdacReg->DacRegs[i+0x102] = 0x00;
+ ramdacReg->DacRegs[i+0x103] = dispcont;
+ }
+ }
+}
+
+static void
+IBMramdac526ShowCursor(ScrnInfoPtr pScrn)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ /* Enable cursor - X11 mode */
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs, 0x00, 0x07);
+}
+
+static void
+IBMramdac640ShowCursor(ScrnInfoPtr pScrn)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ /* Enable cursor - mode2 (x11 mode) */
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURSOR_CONTROL, 0x00, 0x0B);
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CROSSHAIR_CONTROL, 0x00, 0x00);
+}
+
+static void
+IBMramdac526HideCursor(ScrnInfoPtr pScrn)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ /* Disable cursor - X11 mode */
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs, 0x00, 0x24);
+}
+
+static void
+IBMramdac640HideCursor(ScrnInfoPtr pScrn)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ /* Disable cursor - mode2 (x11 mode) */
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURSOR_CONTROL, 0x00, 0x08);
+}
+
+static void
+IBMramdac526SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ x += 64;
+ y += 64;
+
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_hot_x, 0x00, 0x3f);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_hot_y, 0x00, 0x3f);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_xl, 0x00, x & 0xff);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_xh, 0x00, (x>>8) & 0xf);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_yl, 0x00, y & 0xff);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_yh, 0x00, (y>>8) & 0xf);
+}
+
+static void
+IBMramdac640SetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ x += 64;
+ y += 64;
+
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_OFFSETX, 0x00, 0x3f);
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_OFFSETY, 0x00, 0x3f);
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_X_LOW, 0x00, x & 0xff);
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_X_HIGH, 0x00, (x>>8) & 0xf);
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_Y_LOW, 0x00, y & 0xff);
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_Y_HIGH, 0x00, (y>>8) & 0xf);
+}
+
+static void
+IBMramdac526SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col1_r, 0x00, bg >> 16);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col1_g, 0x00, bg >> 8);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col1_b, 0x00, bg);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col2_r, 0x00, fg >> 16);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col2_g, 0x00, fg >> 8);
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_col2_b, 0x00, fg);
+}
+
+static void
+IBMramdac640SetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_COL0, 0x00, 0);
+ (*ramdacPtr->WriteData)(pScrn, fg>>16);
+ (*ramdacPtr->WriteData)(pScrn, fg>>8);
+ (*ramdacPtr->WriteData)(pScrn, fg);
+ (*ramdacPtr->WriteData)(pScrn, bg>>16);
+ (*ramdacPtr->WriteData)(pScrn, bg>>8);
+ (*ramdacPtr->WriteData)(pScrn, bg);
+ (*ramdacPtr->WriteData)(pScrn, fg>>16);
+ (*ramdacPtr->WriteData)(pScrn, fg>>8);
+ (*ramdacPtr->WriteData)(pScrn, fg);
+ (*ramdacPtr->WriteData)(pScrn, bg>>16);
+ (*ramdacPtr->WriteData)(pScrn, bg>>8);
+ (*ramdacPtr->WriteData)(pScrn, bg);
+}
+
+static void
+IBMramdac526LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+ int i;
+ /*
+ * Output the cursor data. The realize function has put the planes into
+ * their correct order, so we can just blast this out.
+ */
+ for (i = 0; i < 1024; i++)
+ (*ramdacPtr->WriteDAC)(pScrn, IBMRGB_curs_array + i, 0x00, (*src++));
+}
+
+static void
+IBMramdac640LoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+ int i;
+ /*
+ * Output the cursor data. The realize function has put the planes into
+ * their correct order, so we can just blast this out.
+ */
+ for (i = 0; i < 1024; i++)
+ (*ramdacPtr->WriteDAC)(pScrn, RGB640_CURS_WRITE + i, 0x00, (*src++));
+}
+
+static Bool
+IBMramdac526UseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
+{
+ return TRUE;
+}
+
+static Bool
+IBMramdac640UseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
+{
+ return TRUE;
+}
+
+void
+IBMramdac526HWCursorInit(xf86CursorInfoPtr infoPtr)
+{
+ infoPtr->MaxWidth = 64;
+ infoPtr->MaxHeight = 64;
+ infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
+ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;
+ infoPtr->SetCursorColors = IBMramdac526SetCursorColors;
+ infoPtr->SetCursorPosition = IBMramdac526SetCursorPosition;
+ infoPtr->LoadCursorImage = IBMramdac526LoadCursorImage;
+ infoPtr->HideCursor = IBMramdac526HideCursor;
+ infoPtr->ShowCursor = IBMramdac526ShowCursor;
+ infoPtr->UseHWCursor = IBMramdac526UseHWCursor;
+}
+
+void
+IBMramdac640HWCursorInit(xf86CursorInfoPtr infoPtr)
+{
+ infoPtr->MaxWidth = 64;
+ infoPtr->MaxHeight = 64;
+ infoPtr->Flags = HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
+ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
+ HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1;
+ infoPtr->SetCursorColors = IBMramdac640SetCursorColors;
+ infoPtr->SetCursorPosition = IBMramdac640SetCursorPosition;
+ infoPtr->LoadCursorImage = IBMramdac640LoadCursorImage;
+ infoPtr->HideCursor = IBMramdac640HideCursor;
+ infoPtr->ShowCursor = IBMramdac640ShowCursor;
+ infoPtr->UseHWCursor = IBMramdac640UseHWCursor;
+}
diff --git a/hw/xfree86/ramdac/IBM.h b/hw/xfree86/ramdac/IBM.h
new file mode 100644
index 000000000..546296630
--- /dev/null
+++ b/hw/xfree86/ramdac/IBM.h
@@ -0,0 +1,383 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBM.h,v 1.8 2001/10/28 03:34:03 tsi Exp $ */
+
+#include <xf86RamDac.h>
+
+RamDacHelperRecPtr IBMramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs);
+void IBMramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
+void IBMramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
+void IBMramdac526SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
+void IBMramdac640SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
+unsigned long IBMramdac526CalculateMNPCForClock(unsigned long RefClock,
+ unsigned long ReqClock, char IsPixClock, unsigned long MinClock,
+ unsigned long MaxClock, unsigned long *rM, unsigned long *rN,
+ unsigned long *rP, unsigned long *rC);
+unsigned long IBMramdac640CalculateMNPCForClock(unsigned long RefClock,
+ unsigned long ReqClock, char IsPixClock, unsigned long MinClock,
+ unsigned long MaxClock, unsigned long *rM, unsigned long *rN,
+ unsigned long *rP, unsigned long *rC);
+void IBMramdac526HWCursorInit(xf86CursorInfoPtr infoPtr);
+void IBMramdac640HWCursorInit(xf86CursorInfoPtr infoPtr);
+
+#define IBM524_RAMDAC ((VENDOR_IBM << 16) | 0x00)
+#define IBM524A_RAMDAC ((VENDOR_IBM << 16) | 0x01)
+#define IBM525_RAMDAC ((VENDOR_IBM << 16) | 0x02)
+#define IBM526_RAMDAC ((VENDOR_IBM << 16) | 0x03)
+#define IBM526DB_RAMDAC ((VENDOR_IBM << 16) | 0x04)
+#define IBM528_RAMDAC ((VENDOR_IBM << 16) | 0x05)
+#define IBM528A_RAMDAC ((VENDOR_IBM << 16) | 0x06)
+#define IBM624_RAMDAC ((VENDOR_IBM << 16) | 0x07)
+#define IBM624DB_RAMDAC ((VENDOR_IBM << 16) | 0x08)
+#define IBM640_RAMDAC ((VENDOR_IBM << 16) | 0x09)
+
+/*
+ * IBM Ramdac registers
+ */
+
+#define IBMRGB_REF_FREQ_1 14.31818
+#define IBMRGB_REF_FREQ_2 50.00000
+
+#define IBMRGB_rev 0x00
+#define IBMRGB_id 0x01
+#define IBMRGB_misc_clock 0x02
+#define IBMRGB_sync 0x03
+#define IBMRGB_hsync_pos 0x04
+#define IBMRGB_pwr_mgmt 0x05
+#define IBMRGB_dac_op 0x06
+#define IBMRGB_pal_ctrl 0x07
+#define IBMRGB_sysclk 0x08 /* not RGB525 */
+#define IBMRGB_pix_fmt 0x0a
+#define IBMRGB_8bpp 0x0b
+#define IBMRGB_16bpp 0x0c
+#define IBMRGB_24bpp 0x0d
+#define IBMRGB_32bpp 0x0e
+#define IBMRGB_pll_ctrl1 0x10
+#define IBMRGB_pll_ctrl2 0x11
+#define IBMRGB_pll_ref_div_fix 0x14
+#define IBMRGB_sysclk_ref_div 0x15 /* not RGB525 */
+#define IBMRGB_sysclk_vco_div 0x16 /* not RGB525 */
+/* #define IBMRGB_f0 0x20 */
+
+#define IBMRGB_sysclk_n 0x15
+#define IBMRGB_sysclk_m 0x16
+#define IBMRGB_sysclk_p 0x17
+#define IBMRGB_sysclk_c 0x18
+
+#define IBMRGB_m0 0x20
+#define IBMRGB_n0 0x21
+#define IBMRGB_p0 0x22
+#define IBMRGB_c0 0x23
+#define IBMRGB_m1 0x24
+#define IBMRGB_n1 0x25
+#define IBMRGB_p1 0x26
+#define IBMRGB_c1 0x27
+#define IBMRGB_m2 0x28
+#define IBMRGB_n2 0x29
+#define IBMRGB_p2 0x2a
+#define IBMRGB_c2 0x2b
+#define IBMRGB_m3 0x2c
+#define IBMRGB_n3 0x2d
+#define IBMRGB_p3 0x2e
+#define IBMRGB_c3 0x2f
+
+#define IBMRGB_curs 0x30
+#define IBMRGB_curs_xl 0x31
+#define IBMRGB_curs_xh 0x32
+#define IBMRGB_curs_yl 0x33
+#define IBMRGB_curs_yh 0x34
+#define IBMRGB_curs_hot_x 0x35
+#define IBMRGB_curs_hot_y 0x36
+#define IBMRGB_curs_col1_r 0x40
+#define IBMRGB_curs_col1_g 0x41
+#define IBMRGB_curs_col1_b 0x42
+#define IBMRGB_curs_col2_r 0x43
+#define IBMRGB_curs_col2_g 0x44
+#define IBMRGB_curs_col2_b 0x45
+#define IBMRGB_curs_col3_r 0x46
+#define IBMRGB_curs_col3_g 0x47
+#define IBMRGB_curs_col3_b 0x48
+#define IBMRGB_border_col_r 0x60
+#define IBMRGB_border_col_g 0x61
+#define IBMRGB_botder_col_b 0x62
+#define IBMRGB_key 0x68
+#define IBMRGB_key_mask 0x6C
+#define IBMRGB_misc1 0x70
+#define IBMRGB_misc2 0x71
+#define IBMRGB_misc3 0x72
+#define IBMRGB_misc4 0x73 /* not RGB525 */
+#define IBMRGB_key_control 0x78
+#define IBMRGB_dac_sense 0x82
+#define IBMRGB_misr_r 0x84
+#define IBMRGB_misr_g 0x86
+#define IBMRGB_misr_b 0x88
+#define IBMRGB_pll_vco_div_in 0x8e
+#define IBMRGB_pll_ref_div_in 0x8f
+#define IBMRGB_vram_mask_0 0x90
+#define IBMRGB_vram_mask_1 0x91
+#define IBMRGB_vram_mask_2 0x92
+#define IBMRGB_vram_mask_3 0x93
+#define IBMRGB_curs_array 0x100
+
+
+
+/* Constants rgb525.h */
+
+/* RGB525_REVISION_LEVEL */
+#define RGB525_PRODUCT_REV_LEVEL 0xf0
+
+/* RGB525_ID */
+#define RGB525_PRODUCT_ID 0x01
+
+/* RGB525_MISC_CTRL_1 */
+#define MISR_CNTL_ENABLE 0x80
+#define VMSK_CNTL_ENABLE 0x40
+#define PADR_RDMT_RDADDR 0x0
+#define PADR_RDMT_PAL_STATE 0x20
+#define SENS_DSAB_DISABLE 0x10
+#define SENS_SEL_BIT3 0x0
+#define SENS_SEL_BIT7 0x08
+#define VRAM_SIZE_32 0x0
+#define VRAM_SIZE_64 0x01
+
+/* RGB525_MISC_CTRL_2 */
+#define PCLK_SEL_LCLK 0x0
+#define PCLK_SEL_PLL 0x40
+#define PCLK_SEL_EXT 0x80
+#define INTL_MODE_ENABLE 0x20
+#define BLANK_CNTL_ENABLE 0x10
+#define COL_RES_6BIT 0x0
+#define COL_RES_8BIT 0x04
+#define PORT_SEL_VGA 0x0
+#define PORT_SEL_VRAM 0x01
+
+/* RGB525_MISC_CTRL_3 */
+#define SWAP_RB 0x80
+#define SWAP_WORD_LOHI 0x0
+#define SWAP_WORD_HILO 0x10
+#define SWAP_NIB_HILO 0x0
+#define SWAP_NIB_LOHI 0x02
+
+/* RGB525_MISC_CLK_CTRL */
+#define DDOT_CLK_ENABLE 0x0
+#define DDOT_CLK_DISABLE 0x80
+#define SCLK_ENABLE 0x0
+#define SCLK_DISABLE 0x40
+#define B24P_DDOT_PLL 0x0
+#define B24P_DDOT_SCLK 0x20
+#define DDOT_DIV_PLL_1 0x0
+#define DDOT_DIV_PLL_2 0x02
+#define DDOT_DIV_PLL_4 0x04
+#define DDOT_DIV_PLL_8 0x06
+#define DDOT_DIV_PLL_16 0x08
+#define PLL_DISABLE 0x0
+#define PLL_ENABLE 0x01
+
+/* RGB525_SYNC_CTRL */
+#define DLY_CNTL_ADD 0x0
+#define DLY_SYNC_NOADD 0x80
+#define CSYN_INVT_DISABLE 0x0
+#define CSYN_INVT_ENABLE 0x40
+#define VSYN_INVT_DISABLE 0x0
+#define VSYN_INVT_ENABLE 0x20
+#define HSYN_INVT_DISABLE 0x0
+#define HSYN_INVT_ENABLE 0x10
+#define VSYN_CNTL_NORMAL 0x0
+#define VSYN_CNTL_HIGH 0x04
+#define VSYN_CNTL_LOW 0x08
+#define VSYN_CNTL_DISABLE 0x0C
+#define HSYN_CNTL_NORMAL 0x0
+#define HSYN_CNTL_HIGH 0x01
+#define HSYN_CNTL_LOW 0x02
+#define HSYN_CNTL_DISABLE 0x03
+
+/* RGB525_HSYNC_CTRL */
+#define HSYN_POS(n) (n)
+
+/* RGB525_POWER_MANAGEMENT */
+#define SCLK_PWR_NORMAL 0x0
+#define SCLK_PWR_DISABLE 0x10
+#define DDOT_PWR_NORMAL 0x0
+#define DDOT_PWR_DISABLE 0x08
+#define SYNC_PWR_NORMAL 0x0
+#define SYNC_PWR_DISABLE 0x04
+#define ICLK_PWR_NORMAL 0x0
+#define ICLK_PWR_DISABLE 0x02
+#define DAC_PWR_NORMAL 0x0
+#define DAC_PWR_DISABLE 0x01
+
+/* RGB525_DAC_OPERATION */
+#define SOG_DISABLE 0x0
+#define SOG_ENABLE 0x08
+#define BRB_NORMAL 0x0
+#define BRB_ALWAYS 0x04
+#define DSR_DAC_SLOW 0x02
+#define DSR_DAC_FAST 0x0
+#define DPE_DISABLE 0x0
+#define DPE_ENABLE 0x01
+
+/* RGB525_PALETTE_CTRL */
+#define SIXBIT_LINEAR_ENABLE 0x0
+#define SIXBIT_LINEAR_DISABLE 0x80
+#define PALETTE_PARITION(n) (n)
+
+/* RGB525_PIXEL_FORMAT */
+#define PIXEL_FORMAT_4BPP 0x02
+#define PIXEL_FORMAT_8BPP 0x03
+#define PIXEL_FORMAT_16BPP 0x04
+#define PIXEL_FORMAT_24BPP 0x05
+#define PIXEL_FORMAT_32BPP 0x06
+
+/* RGB525_8BPP_CTRL */
+#define B8_DCOL_INDIRECT 0x0
+#define B8_DCOL_DIRECT 0x01
+
+/* RGB525_16BPP_CTRL */
+#define B16_DCOL_INDIRECT 0x0
+#define B16_DCOL_DYNAMIC 0x40
+#define B16_DCOL_DIRECT 0xC0
+#define B16_POL_FORCE_BYPASS 0x0
+#define B16_POL_FORCE_LOOKUP 0x20
+#define B16_ZIB 0x0
+#define B16_LINEAR 0x04
+#define B16_555 0x0
+#define B16_565 0x02
+#define B16_SPARSE 0x0
+#define B16_CONTIGUOUS 0x01
+
+/* RGB525_24BPP_CTRL */
+#define B24_DCOL_INDIRECT 0x0
+#define B24_DCOL_DIRECT 0x01
+
+/* RGB525_32BPP_CTRL */
+#define B32_POL_FORCE_BYPASS 0x0
+#define B32_POL_FORCE_LOOKUP 0x04
+#define B32_DCOL_INDIRECT 0x0
+#define B32_DCOL_DYNAMIC 0x01
+#define B32_DCOL_DIRECT 0x03
+
+/* RGB525_PLL_CTRL_1 */
+#define REF_SRC_REFCLK 0x0
+#define REF_SRC_EXTCLK 0x10
+#define PLL_EXT_FS_3_0 0x0
+#define PLL_EXT_FS_2_0 0x01
+#define PLL_CNTL2_3_0 0x02
+#define PLL_CNTL2_2_0 0x03
+
+/* RGB525_PLL_CTRL_2 */
+#define PLL_INT_FS_3_0(n) (n)
+#define PLL_INT_FS_2_0(n) (n)
+
+/* RGB525_PLL_REF_DIV_COUNT */
+#define REF_DIV_COUNT(n) (n)
+
+/* RGB525_F0 - RGB525_F15 */
+#define VCO_DIV_COUNT(n) (n)
+
+/* RGB525_PLL_REFCLK values */
+#define RGB525_PLL_REFCLK_MHz(n) ((n)/2)
+
+/* RGB525_CURSOR_CONTROL */
+#define SMLC_PART_0 0x0
+#define SMLC_PART_1 0x40
+#define SMLC_PART_2 0x80
+#define SMLC_PART_3 0xC0
+#define PIX_ORDER_RL 0x0
+#define PIX_ORDER_LR 0x20
+#define LOC_READ_LAST 0x0
+#define LOC_READ_ACTUAL 0x10
+#define UPDT_CNTL_DELAYED 0x0
+#define UPDT_CNTL_IMMEDIATE 0x08
+#define CURSOR_SIZE_32 0x0
+#define CURSOR_SIZE_64 0x40
+#define CURSOR_MODE_OFF 0x0
+#define CURSOR_MODE_3_COLOR 0x01
+#define CURSOR_MODE_2_COLOR_HL 0x02
+#define CURSOR_MODE_2_COLOR 0x03
+
+/* RGB525_REVISION_LEVEL */
+#define REVISION_LEVEL 0xF0 /* predefined */
+
+/* RGB525_ID */
+#define ID_CODE 0x01 /* predefined */
+
+/* MISR status */
+#define RGB525_MISR_DONE 0x01
+
+/* the IBMRGB640 is rather different from the rest of the RAMDACs,
+ so we define a completely new set of register names for it */
+#define RGB640_SER_07_00 0x02
+#define RGB640_SER_15_08 0x03
+#define RGB640_SER_23_16 0x04
+#define RGB640_SER_31_24 0x05
+#define RGB640_SER_WID_03_00 0x06
+#define RGB640_SER_WID_07_04 0x07
+#define RGB640_SER_MODE 0x08
+#define IBM640_SER_2_1 0x00
+#define IBM640_SER_4_1 0x01
+#define IBM640_SER_8_1 0x02
+#define IBM640_SER_16_1 0x03
+#define IBM640_SER_16_3 0x05
+#define IBM640_SER_5_1 0x06
+#define RGB640_PIXEL_INTERLEAVE 0x09
+#define RGB640_MISC_CONF 0x0a
+#define IBM640_PCLK 0x00
+#define IBM640_PCLK_2 0x40
+#define IBM640_PCLK_4 0x80
+#define IBM640_PCLK_8 0xc0
+#define IBM640_PSIZE10 0x10
+#define IBM640_LCI 0x08
+#define IBM640_WIDCTL_MASK 0x07
+#define RGB640_VGA_CONTROL 0x0b
+#define IBM640_RDBK 0x04
+#define IBM640_PSIZE8 0x02
+#define IBM640_VRAM 0x01
+#define RGB640_DAC_CONTROL 0x0d
+#define IBM640_MONO 0x08
+#define IBM640_DACENBL 0x04
+#define IBM640_SHUNT 0x02
+#define IBM640_SLOWSLEW 0x01
+#define RGB640_OUTPUT_CONTROL 0x0e
+#define IBM640_RDAI 0x04
+#define IBM640_WDAI 0x02
+#define IBM640_WATCTL 0x01
+#define RGB640_SYNC_CONTROL 0x0f
+#define IBM640_PWR 0x20
+#define IBM640_VSP 0x10
+#define IBM640_HSP 0x08
+#define IBM640_CSE 0x04
+#define IBM640_CSG 0x02
+#define IBM640_BPE 0x01
+#define RGB640_PLL_N 0x10
+#define RGB640_PLL_M 0x11
+#define RGB640_PLL_P 0x12
+#define RGB640_PLL_CTL 0x13
+#define IBM640_PLL_EN 0x04
+#define IBM640_PLL_HIGH 0x10
+#define IBM640_PLL_LOW 0x01
+#define RGB640_AUX_PLL_CTL 0x17
+#define IBM640_AUXPLL 0x04
+#define IBM640_AUX_HI 0x02
+#define IBM640_AUX_LO 0x01
+#define RGB640_CHROMA_KEY0 0x20
+#define RGB640_CHROMA_MASK0 0x21
+#define RGB640_CURS_X_LOW 0x40
+#define RGB640_CURS_X_HIGH 0x41
+#define RGB640_CURS_Y_LOW 0x42
+#define RGB640_CURS_Y_HIGH 0x43
+#define RGB640_CURS_OFFSETX 0x44
+#define RGB640_CURS_OFFSETY 0x45
+#define RGB640_CURSOR_CONTROL 0x4B
+#define IBM640_CURS_OFF 0x00
+#define IBM640_CURS_MODE0 0x01
+#define IBM640_CURS_MODE1 0x02
+#define IBM640_CURS_MODE2 0x03
+#define IBM640_CURS_ADV 0x04
+#define RGB640_CROSSHAIR_CONTROL 0x57
+#define RGB640_VRAM_MASK0 0xf0
+#define RGB640_VRAM_MASK1 0xf1
+#define RGB640_VRAM_MASK2 0xf2
+#define RGB640_DIAGS 0xfa
+#define RGB640_CURS_WRITE 0x1000
+#define RGB640_CURS_COL0 0x4800
+#define RGB640_CURS_COL1 0x4801
+#define RGB640_CURS_COL2 0x4802
+#define RGB640_CURS_COL3 0x4803
diff --git a/hw/xfree86/ramdac/IBMPriv.h b/hw/xfree86/ramdac/IBMPriv.h
new file mode 100644
index 000000000..6fecb7705
--- /dev/null
+++ b/hw/xfree86/ramdac/IBMPriv.h
@@ -0,0 +1,24 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/IBMPriv.h,v 1.2 1998/07/25 16:57:19 dawes Exp $ */
+
+#include "IBM.h"
+
+typedef struct {
+ char *DeviceName;
+} xf86IBMramdacInfo;
+
+extern xf86IBMramdacInfo IBMramdacDeviceInfo[];
+
+#ifdef INIT_IBM_RAMDAC_INFO
+xf86IBMramdacInfo IBMramdacDeviceInfo[] = {
+ {"IBM 524"},
+ {"IBM 524A"},
+ {"IBM 525"},
+ {"IBM 526"},
+ {"IBM 526DB(DoubleBuffer)"},
+ {"IBM 528"},
+ {"IBM 528A"},
+ {"IBM 624"},
+ {"IBM 624DB(DoubleBuffer)"},
+ {"IBM 640"}
+};
+#endif
diff --git a/hw/xfree86/ramdac/TI.c b/hw/xfree86/ramdac/TI.c
new file mode 100644
index 000000000..267a13f9f
--- /dev/null
+++ b/hw/xfree86/ramdac/TI.c
@@ -0,0 +1,713 @@
+/*
+ * Copyright 1998 by Alan Hourihane, Wigan, England.
+ *
+ * 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 Alan Hourihane not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Alan Hourihane makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ALAN HOURIHANE 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.
+ *
+ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ *
+ * Modified from IBM.c to support TI RAMDAC routines
+ * by Jens Owen, <jens@tungstengraphics.com>.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TI.c,v 1.7 2003/02/17 16:08:29 dawes Exp $ */
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+
+#include "xf86Cursor.h"
+
+#define INIT_TI_RAMDAC_INFO
+#include "TIPriv.h"
+#include "xf86RamDacPriv.h"
+
+/* The following values are in kHz */
+#define TI_MIN_VCO_FREQ 110000
+#define TI_MAX_VCO_FREQ 220000
+
+unsigned long
+TIramdacCalculateMNPForClock(
+ unsigned long RefClock, /* In 100Hz units */
+ unsigned long ReqClock, /* In 100Hz units */
+ char IsPixClock, /* boolean, is this the pixel or the sys clock */
+ unsigned long MinClock, /* Min VCO rating */
+ unsigned long MaxClock, /* Max VCO rating */
+ unsigned long *rM, /* M Out */
+ unsigned long *rN, /* N Out */
+ unsigned long *rP /* Min P In, P Out */
+)
+{
+ unsigned long n, p;
+ unsigned long best_m = 0, best_n = 0;
+ double VCO, IntRef = (double)RefClock;
+ double m_err, inc_m, calc_m;
+ unsigned long ActualClock;
+
+ /* Make sure that MinClock <= ReqClock <= MaxClock */
+ if ( ReqClock < MinClock)
+ ReqClock = MinClock;
+ if ( ReqClock > MaxClock )
+ ReqClock = MaxClock;
+
+ /*
+ * ActualClock = VCO / 2 ^ p
+ * Choose p so that TI_MIN_VCO_FREQ <= VCO <= TI_MAX_VCO_FREQ
+ * Note that since TI_MAX_VCO_FREQ = 2 * TI_MIN_VCO_FREQ
+ * we don't have to bother checking for this maximum limit.
+ */
+ VCO = (double)ReqClock;
+ for ( p = 0; p < 3 && VCO < TI_MIN_VCO_FREQ; ( p )++ )
+ VCO *= 2.0;
+
+ /*
+ * We avoid doing multiplications by ( 65 - n ),
+ * and add an increment instead - this keeps any error small.
+ */
+ inc_m = VCO / ( IntRef * 8.0 );
+
+ /* Initial value of calc_m for the loop */
+ calc_m = inc_m + inc_m + inc_m;
+
+ /* Initial amount of error for an integer - impossibly large */
+ m_err = 2.0;
+
+ /* Search for the closest INTEGER value of ( 65 - m ) */
+ for ( n = 3; n <= 25; ( n )++, calc_m += inc_m ) {
+
+ /* Ignore values of ( 65 - m ) which we can't use */
+ if ( calc_m < 3.0 || calc_m > 64.0 )
+ continue;
+
+ /*
+ * Pick the closest INTEGER (has smallest fractional part).
+ * The optimizer should clean this up for us.
+ */
+ if (( calc_m - ( int ) calc_m ) < m_err ) {
+ m_err = calc_m - ( int ) calc_m;
+ best_m = ( int ) calc_m;
+ best_n = n;
+ }
+ }
+
+ /* 65 - ( 65 - x ) = x */
+ *rM = 65 - best_m;
+ *rN = 65 - best_n;
+ *rP = p;
+
+ /* Now all the calculations can be completed */
+ VCO = 8.0 * IntRef * best_m / best_n;
+ ActualClock = VCO / ( 1 << p );
+
+#ifdef DEBUG
+ ErrorF( "f_out=%ld f_vco=%.1f n=%d m=%d p=%d\n",
+ ActualClock, VCO, *rN, *rM, *rP);
+#endif
+
+ return (ActualClock);
+}
+
+void
+TIramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
+ RamDacRegRecPtr ramdacReg)
+{
+ int i;
+ unsigned long status;
+
+ /* Here we pass a short, so that we can evaluate a mask too
+ * So that the mask is the high byte and the data the low byte
+ * Order is important
+ */
+ TIRESTORE(TIDAC_latch_ctrl);
+ TIRESTORE(TIDAC_true_color_ctrl);
+ TIRESTORE(TIDAC_multiplex_ctrl);
+ TIRESTORE(TIDAC_clock_select);
+ TIRESTORE(TIDAC_palette_page);
+ TIRESTORE(TIDAC_general_ctrl);
+ TIRESTORE(TIDAC_misc_ctrl);
+ /* 0x2A & 0x2B are reserved */
+ TIRESTORE(TIDAC_key_over_low);
+ TIRESTORE(TIDAC_key_over_high);
+ TIRESTORE(TIDAC_key_red_low);
+ TIRESTORE(TIDAC_key_red_high);
+ TIRESTORE(TIDAC_key_green_low);
+ TIRESTORE(TIDAC_key_green_high);
+ TIRESTORE(TIDAC_key_blue_low);
+ TIRESTORE(TIDAC_key_blue_high);
+ TIRESTORE(TIDAC_key_ctrl);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_clock_ctrl, 0, 0x30);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_clock_ctrl, 0, 0x38);
+ TIRESTORE(TIDAC_clock_ctrl);
+ TIRESTORE(TIDAC_sense_test);
+ TIRESTORE(TIDAC_ind_curs_ctrl);
+
+ /* only restore clocks if they were valid to begin with */
+
+ if (ramdacReg->DacRegs[TIDAC_PIXEL_VALID]) {
+ /* Reset pixel clock */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x22);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_pixel_data, 0, 0x3c);
+
+ /* Restore N, M & P values for pixel clocks */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_pixel_data, 0,
+ ramdacReg->DacRegs[TIDAC_PIXEL_N]);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_pixel_data, 0,
+ ramdacReg->DacRegs[TIDAC_PIXEL_M]);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_pixel_data, 0,
+ ramdacReg->DacRegs[TIDAC_PIXEL_P]);
+
+ /* wait for pixel clock to lock */
+ i = 1000000;
+ do {
+ status = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_pixel_data);
+ } while ((!(status & 0x40)) && (--i));
+ if (!(status & 0x40)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Pixel clock setup timed out\n");
+ return;
+ }
+ }
+
+ if (ramdacReg->DacRegs[TIDAC_LOOP_VALID]) {
+ /* Reset loop clock */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x22);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_loop_data, 0, 0x70);
+
+ /* Restore N, M & P values for pixel clocks */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_loop_data, 0,
+ ramdacReg->DacRegs[TIDAC_LOOP_N]);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_loop_data, 0,
+ ramdacReg->DacRegs[TIDAC_LOOP_M]);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_loop_data, 0,
+ ramdacReg->DacRegs[TIDAC_LOOP_P]);
+
+ /* wait for loop clock to lock */
+ i = 1000000;
+ do {
+ status = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_loop_data);
+ } while ((!(status & 0x40)) && (--i));
+ if (!(status & 0x40)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Loop clock setup timed out\n");
+ return;
+ }
+ }
+
+ /* restore palette */
+ (*ramdacPtr->WriteAddress)(pScrn, 0);
+#ifndef NOT_DONE
+ for (i=0;i<768;i++)
+ (*ramdacPtr->WriteData)(pScrn, ramdacReg->DAC[i]);
+#else
+ (*ramdacPtr->WriteData)(pScrn, 0);
+ (*ramdacPtr->WriteData)(pScrn, 0);
+ (*ramdacPtr->WriteData)(pScrn, 0);
+ for (i=0;i<765;i++)
+ (*ramdacPtr->WriteData)(pScrn, 0xff);
+#endif
+}
+
+void
+TIramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPtr,
+ RamDacRegRecPtr ramdacReg)
+{
+ int i;
+
+ (*ramdacPtr->ReadAddress)(pScrn, 0);
+ for (i=0;i<768;i++)
+ ramdacReg->DAC[i] = (*ramdacPtr->ReadData)(pScrn);
+
+ /* Read back N,M and P values for pixel clock */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0);
+ ramdacReg->DacRegs[TIDAC_PIXEL_N] =
+ (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_pixel_data);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x11);
+ ramdacReg->DacRegs[TIDAC_PIXEL_M] =
+ (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_pixel_data);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x22);
+ ramdacReg->DacRegs[TIDAC_PIXEL_P] =
+ (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_pixel_data);
+
+ /* Read back N,M and P values for loop clock */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0);
+ ramdacReg->DacRegs[TIDAC_LOOP_N] =
+ (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_loop_data);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x11);
+ ramdacReg->DacRegs[TIDAC_LOOP_M] =
+ (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_loop_data);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_pll_addr, 0, 0x22);
+ ramdacReg->DacRegs[TIDAC_LOOP_P] =
+ (*ramdacPtr->ReadDAC)(pScrn, TIDAC_pll_loop_data);
+
+ /* Order is important */
+ TISAVE(TIDAC_latch_ctrl);
+ TISAVE(TIDAC_true_color_ctrl);
+ TISAVE(TIDAC_multiplex_ctrl);
+ TISAVE(TIDAC_clock_select);
+ TISAVE(TIDAC_palette_page);
+ TISAVE(TIDAC_general_ctrl);
+ TISAVE(TIDAC_misc_ctrl);
+ /* 0x2A & 0x2B are reserved */
+ TISAVE(TIDAC_key_over_low);
+ TISAVE(TIDAC_key_over_high);
+ TISAVE(TIDAC_key_red_low);
+ TISAVE(TIDAC_key_red_high);
+ TISAVE(TIDAC_key_green_low);
+ TISAVE(TIDAC_key_green_high);
+ TISAVE(TIDAC_key_blue_low);
+ TISAVE(TIDAC_key_blue_high);
+ TISAVE(TIDAC_key_ctrl);
+ TISAVE(TIDAC_clock_ctrl);
+ TISAVE(TIDAC_sense_test);
+ TISAVE(TIDAC_ind_curs_ctrl);
+}
+
+RamDacHelperRecPtr
+TIramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+ RamDacHelperRecPtr ramdacHelperPtr = NULL;
+ Bool RamDacIsSupported = FALSE;
+ int TIramdac_ID = -1;
+ int i;
+ unsigned char id, rev, rev2, id2;
+
+ /* read ID and revision */
+ rev = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_rev);
+ id = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_id);
+
+ /* check if ID and revision are read only */
+ (*ramdacPtr->WriteDAC)(pScrn, ~rev, 0, TIDAC_rev);
+ (*ramdacPtr->WriteDAC)(pScrn, ~id, 0, TIDAC_id);
+ rev2 = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_rev);
+ id2 = (*ramdacPtr->ReadDAC)(pScrn, TIDAC_id);
+
+ switch (id) {
+ case TIDAC_TVP_3030_ID:
+ if (id == id2 && rev == rev2) /* check for READ ONLY */
+ TIramdac_ID = TI3030_RAMDAC;
+ break;
+ case TIDAC_TVP_3026_ID:
+ if (id == id2 && rev == rev2) /* check for READ ONLY */
+ TIramdac_ID = TI3026_RAMDAC;
+ break;
+ }
+
+ (*ramdacPtr->WriteDAC)(pScrn, rev, 0, TIDAC_rev);
+ (*ramdacPtr->WriteDAC)(pScrn, id, 0, TIDAC_id);
+
+ if (TIramdac_ID == -1) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Cannot determine TI RAMDAC type, aborting\n");
+ return NULL;
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Attached RAMDAC is %s\n", TIramdacDeviceInfo[TIramdac_ID&0xFFFF]);
+ }
+
+ for (i=0;ramdacs[i].token != -1;i++) {
+ if (ramdacs[i].token == TIramdac_ID)
+ RamDacIsSupported = TRUE;
+ }
+
+ if (!RamDacIsSupported) {
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "This TI RAMDAC is NOT supported by this driver, aborting\n");
+ return NULL;
+ }
+
+ ramdacHelperPtr = RamDacHelperCreateInfoRec();
+ switch (TIramdac_ID) {
+ case TI3030_RAMDAC:
+ ramdacHelperPtr->SetBpp = TIramdac3030SetBpp;
+ ramdacHelperPtr->HWCursorInit = TIramdacHWCursorInit;
+ break;
+ case TI3026_RAMDAC:
+ ramdacHelperPtr->SetBpp = TIramdac3026SetBpp;
+ ramdacHelperPtr->HWCursorInit = TIramdacHWCursorInit;
+ break;
+ }
+ ramdacPtr->RamDacType = TIramdac_ID;
+ ramdacHelperPtr->RamDacType = TIramdac_ID;
+ ramdacHelperPtr->Save = TIramdacSave;
+ ramdacHelperPtr->Restore = TIramdacRestore;
+
+ return ramdacHelperPtr;
+}
+
+void
+TIramdac3026SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
+{
+ switch (pScrn->bitsPerPixel) {
+ case 32:
+ /* order is important */
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x46;
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x5c;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C;
+ /* 0x2A & 0x2B are reserved */
+ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
+ if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x06;
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x01;
+ }
+ ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
+ break;
+ case 24:
+ /* order is important */
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x56;
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x58;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x25;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00;
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C;
+ /* 0x2A & 0x2B are reserved */
+ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
+ ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
+ break;
+ case 16:
+ /* order is important */
+#if 0
+ /* Matrox driver uses this */
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x07;
+#else
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
+#endif
+ if (pScrn->depth == 16) {
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x45;
+ } else {
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x44;
+ }
+#if 0
+ /* Matrox driver uses this */
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x50;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x15;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00;
+#else
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x54;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
+#endif
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C;
+ /* 0x2A & 0x2B are reserved */
+ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
+ ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
+ break;
+ case 8:
+ /* order is important */
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x80;
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x4c;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x1C;
+ /* 0x2A & 0x2B are reserved */
+ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_low] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x00;
+ ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
+ ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
+ break;
+ }
+}
+
+void
+TIramdac3030SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr ramdacReg)
+{
+ switch (pScrn->bitsPerPixel) {
+ case 32:
+ /* order is important */
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x46;
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x5D;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C;
+ /* 0x2A & 0x2B are reserved */
+ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
+ if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) {
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x06;
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x3C;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x01;
+ }
+ ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
+ break;
+ case 24:
+ /* order is important */
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x56;
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x58;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x25;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00;
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C;
+ /* 0x2A & 0x2B are reserved */
+ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
+ ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
+ break;
+ case 16:
+ /* order is important */
+#if 0
+ /* Matrox driver uses this */
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x07;
+#else
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
+#endif
+ if (pScrn->depth == 16) {
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x45;
+ } else {
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x44;
+ }
+#if 0
+ /* Matrox driver uses this */
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x50;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x15;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x00;
+#else
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x55;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x85;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
+#endif
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x2C;
+ /* 0x2A & 0x2B are reserved */
+ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
+ ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
+ break;
+ case 8:
+ /* order is important */
+ ramdacReg->DacRegs[TIDAC_latch_ctrl] = 0x06;
+ ramdacReg->DacRegs[TIDAC_true_color_ctrl] = 0x80;
+ ramdacReg->DacRegs[TIDAC_multiplex_ctrl] = 0x4d;
+ ramdacReg->DacRegs[TIDAC_clock_select] = 0x05;
+ ramdacReg->DacRegs[TIDAC_palette_page] = 0x00;
+ ramdacReg->DacRegs[TIDAC_general_ctrl] = 0x10;
+ ramdacReg->DacRegs[TIDAC_misc_ctrl] = 0x1C;
+ /* 0x2A & 0x2B are reserved */
+ ramdacReg->DacRegs[TIDAC_key_over_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_over_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_red_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_low] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_green_high] = 0xFF;
+ ramdacReg->DacRegs[TIDAC_key_blue_low] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_blue_high] = 0x00;
+ ramdacReg->DacRegs[TIDAC_key_ctrl] = 0x00;
+ ramdacReg->DacRegs[TIDAC_sense_test] = 0x00;
+ ramdacReg->DacRegs[TIDAC_ind_curs_ctrl] = 0x00;
+ break;
+ }
+}
+
+static void
+TIramdacShowCursor(ScrnInfoPtr pScrn)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ /* Enable cursor - X11 mode */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_ind_curs_ctrl, 0, 0x03);
+}
+
+static void
+TIramdacHideCursor(ScrnInfoPtr pScrn)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ /* Disable cursor - X11 mode */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_ind_curs_ctrl, 0, 0x00);
+}
+
+static void
+TIramdacSetCursorPosition(ScrnInfoPtr pScrn, int x, int y)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ x += 64;
+ y += 64;
+
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_XLOW, 0, x & 0xff);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_XHIGH, 0, (x >> 8) & 0x0f);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_YLOW, 0, y & 0xff);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_YHIGH, 0, (y >> 8) & 0x0f);
+}
+
+static void
+TIramdacSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+
+ /* Background color */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_WRITE_ADDR, 0, 1);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, ((bg&0x00ff0000) >> 16));
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, ((bg&0x0000ff00) >> 8));
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, (bg&0x000000ff) );
+
+ /* Foreground color */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_WRITE_ADDR, 0, 2);
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, ((fg&0x00ff0000) >> 16));
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, ((fg&0x0000ff00) >> 8));
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_COLOR, 0, (fg&0x000000ff) );
+}
+
+static void
+TIramdacLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src)
+{
+ RamDacRecPtr ramdacPtr = RAMDACSCRPTR(pScrn);
+ int i = 1024;
+
+ /* reset A9,A8 */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_ind_curs_ctrl, 0, 0x00);
+ /* reset cursor RAM load address A7..A0 */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_INDEX, 0x00, 0x00);
+
+ while(i--) {
+ /* NOT_DONE: might need a delay here */
+ (*ramdacPtr->WriteDAC)(pScrn, TIDAC_CURS_RAM_DATA, 0, *(src++));
+ }
+}
+
+static Bool
+TIramdacUseHWCursor(ScreenPtr pScr, CursorPtr pCurs)
+{
+ return TRUE;
+}
+
+void
+TIramdacHWCursorInit(xf86CursorInfoPtr infoPtr)
+{
+ infoPtr->MaxWidth = 64;
+ infoPtr->MaxHeight = 64;
+ infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
+ HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
+ HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
+ infoPtr->SetCursorColors = TIramdacSetCursorColors;
+ infoPtr->SetCursorPosition = TIramdacSetCursorPosition;
+ infoPtr->LoadCursorImage = TIramdacLoadCursorImage;
+ infoPtr->HideCursor = TIramdacHideCursor;
+ infoPtr->ShowCursor = TIramdacShowCursor;
+ infoPtr->UseHWCursor = TIramdacUseHWCursor;
+}
+
+void TIramdacLoadPalette(
+ ScrnInfoPtr pScrn,
+ int numColors,
+ int *indices,
+ LOCO *colors,
+ VisualPtr pVisual
+){
+ RamDacRecPtr hwp = RAMDACSCRPTR(pScrn);
+ int i, index, shift;
+
+ if (pScrn->depth == 16) {
+ for(i = 0; i < numColors; i++) {
+ index = indices[i];
+ (*hwp->WriteAddress)(pScrn, index << 2);
+ (*hwp->WriteData)(pScrn, colors[index >> 1].red);
+ (*hwp->WriteData)(pScrn, colors[index].green);
+ (*hwp->WriteData)(pScrn, colors[index >> 1].blue);
+
+ if(index <= 31) {
+ (*hwp->WriteAddress)(pScrn, index << 3);
+ (*hwp->WriteData)(pScrn, colors[index].red);
+ (*hwp->WriteData)(pScrn, colors[(index << 1) + 1].green);
+ (*hwp->WriteData)(pScrn, colors[index].blue);
+ }
+ }
+} else {
+ shift = (pScrn->depth == 15) ? 3 : 0;
+
+ for(i = 0; i < numColors; i++) {
+ index = indices[i];
+ (*hwp->WriteAddress)(pScrn, index << shift);
+ (*hwp->WriteData)(pScrn, colors[index].red);
+ (*hwp->WriteData)(pScrn, colors[index].green);
+ (*hwp->WriteData)(pScrn, colors[index].blue);
+ }
+}
+}
diff --git a/hw/xfree86/ramdac/TI.h b/hw/xfree86/ramdac/TI.h
new file mode 100644
index 000000000..9451f814c
--- /dev/null
+++ b/hw/xfree86/ramdac/TI.h
@@ -0,0 +1,93 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TI.h,v 1.5 2003/02/17 16:08:29 dawes Exp $ */
+
+#include <xf86RamDac.h>
+
+unsigned long TIramdacCalculateMNPForClock(unsigned long RefClock,
+ unsigned long ReqClock, char IsPixClock, unsigned long MinClock,
+ unsigned long MaxClock, unsigned long *rM, unsigned long *rN,
+ unsigned long *rP);
+RamDacHelperRecPtr TIramdacProbe(ScrnInfoPtr pScrn, RamDacSupportedInfoRecPtr ramdacs);
+void TIramdacSave(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
+void TIramdacRestore(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec, RamDacRegRecPtr RamDacRegRec);
+void TIramdac3026SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
+void TIramdac3030SetBpp(ScrnInfoPtr pScrn, RamDacRegRecPtr RamDacRegRec);
+unsigned long TIramdac3030CalculateMNPForClock(unsigned long RefClock,
+ unsigned long ReqClock, char IsPixClock, unsigned long MinClock,
+ unsigned long MaxClock, unsigned long *rM, unsigned long *rN,
+ unsigned long *rP);
+void TIramdacHWCursorInit(xf86CursorInfoPtr infoPtr);
+void TIramdacLoadPalette( ScrnInfoPtr pScrn, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual);
+
+
+#define TI3030_RAMDAC (VENDOR_TI << 16) | 0x00
+#define TI3026_RAMDAC (VENDOR_TI << 16) | 0x01
+
+/*
+ * TI Ramdac registers
+ */
+
+#define TIDAC_rev 0x01
+#define TIDAC_ind_curs_ctrl 0x06
+#define TIDAC_byte_router_ctrl 0x07
+#define TIDAC_latch_ctrl 0x0f
+#define TIDAC_true_color_ctrl 0x18
+#define TIDAC_multiplex_ctrl 0x19
+#define TIDAC_clock_select 0x1a
+#define TIDAC_palette_page 0x1c
+#define TIDAC_general_ctrl 0x1d
+#define TIDAC_misc_ctrl 0x1e
+#define TIDAC_pll_addr 0x2c
+#define TIDAC_pll_pixel_data 0x2d
+#define TIDAC_pll_memory_data 0x2e
+#define TIDAC_pll_loop_data 0x2f
+#define TIDAC_key_over_low 0x30
+#define TIDAC_key_over_high 0x31
+#define TIDAC_key_red_low 0x32
+#define TIDAC_key_red_high 0x33
+#define TIDAC_key_green_low 0x34
+#define TIDAC_key_green_high 0x35
+#define TIDAC_key_blue_low 0x36
+#define TIDAC_key_blue_high 0x37
+#define TIDAC_key_ctrl 0x38
+#define TIDAC_clock_ctrl 0x39
+#define TIDAC_sense_test 0x3a
+#define TIDAC_test_mode_data 0x3b
+#define TIDAC_crc_remain_lsb 0x3c
+#define TIDAC_crc_remain_msb 0x3d
+#define TIDAC_crc_bit_select 0x3e
+#define TIDAC_id 0x3f
+
+/* These are pll values that are accessed via TIDAC_pll_pixel_data */
+#define TIDAC_PIXEL_N 0x80
+#define TIDAC_PIXEL_M 0x81
+#define TIDAC_PIXEL_P 0x82
+#define TIDAC_PIXEL_VALID 0x83
+
+/* These are pll values that are accessed via TIDAC_pll_loop_data */
+#define TIDAC_LOOP_N 0x90
+#define TIDAC_LOOP_M 0x91
+#define TIDAC_LOOP_P 0x92
+#define TIDAC_LOOP_VALID 0x93
+
+/* Direct mapping addresses */
+#define TIDAC_INDEX 0xa0
+#define TIDAC_PALETTE_DATA 0xa1
+#define TIDAC_READ_MASK 0xa2
+#define TIDAC_READ_ADDR 0xa3
+#define TIDAC_CURS_WRITE_ADDR 0xa4
+#define TIDAC_CURS_COLOR 0xa5
+#define TIDAC_CURS_READ_ADDR 0xa7
+#define TIDAC_CURS_CTL 0xa9
+#define TIDAC_INDEXED_DATA 0xaa
+#define TIDAC_CURS_RAM_DATA 0xab
+#define TIDAC_CURS_XLOW 0xac
+#define TIDAC_CURS_XHIGH 0xad
+#define TIDAC_CURS_YLOW 0xae
+#define TIDAC_CURS_YHIGH 0xaf
+
+#define TIDAC_sw_reset 0xff
+
+/* Constants */
+#define TIDAC_TVP_3026_ID 0x26
+#define TIDAC_TVP_3030_ID 0x30
diff --git a/hw/xfree86/ramdac/TIPriv.h b/hw/xfree86/ramdac/TIPriv.h
new file mode 100644
index 000000000..d81552764
--- /dev/null
+++ b/hw/xfree86/ramdac/TIPriv.h
@@ -0,0 +1,26 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/TIPriv.h,v 1.2 2000/03/21 21:15:28 alanh Exp $ */
+
+#include "TI.h"
+
+typedef struct {
+ char *DeviceName;
+} xf86TIramdacInfo;
+
+extern xf86TIramdacInfo TIramdacDeviceInfo[];
+
+#ifdef INIT_TI_RAMDAC_INFO
+xf86TIramdacInfo TIramdacDeviceInfo[] = {
+ {"TI TVP3030"},
+ {"TI TVP3026"}
+};
+#endif
+
+#define TISAVE(_reg) do { \
+ ramdacReg->DacRegs[_reg] = (*ramdacPtr->ReadDAC)(pScrn, _reg); \
+} while (0)
+
+#define TIRESTORE(_reg) do { \
+ (*ramdacPtr->WriteDAC)(pScrn, _reg, \
+ (ramdacReg->DacRegs[_reg] & 0xFF00) >> 8, \
+ ramdacReg->DacRegs[_reg]); \
+} while (0)
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
new file mode 100644
index 000000000..49379e934
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -0,0 +1,437 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c,v 1.20 2003/02/24 20:43:54 tsi Exp $ */
+
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86CursorPriv.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+
+int xf86CursorScreenIndex = -1;
+static unsigned long xf86CursorGeneration = 0;
+
+/* sprite functions */
+
+static Bool xf86CursorRealizeCursor(ScreenPtr, CursorPtr);
+static Bool xf86CursorUnrealizeCursor(ScreenPtr, CursorPtr);
+static void xf86CursorSetCursor(ScreenPtr, CursorPtr, int, int);
+static void xf86CursorMoveCursor(ScreenPtr, int, int);
+
+static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
+ xf86CursorRealizeCursor,
+ xf86CursorUnrealizeCursor,
+ xf86CursorSetCursor,
+ xf86CursorMoveCursor
+};
+
+/* Screen functions */
+
+static void xf86CursorInstallColormap(ColormapPtr);
+static void xf86CursorRecolorCursor(ScreenPtr, CursorPtr, Bool);
+static Bool xf86CursorCloseScreen(int, ScreenPtr);
+static void xf86CursorQueryBestSize(int, unsigned short*, unsigned short*,
+ ScreenPtr);
+
+/* ScrnInfoRec functions */
+
+static Bool xf86CursorSwitchMode(int, DisplayModePtr,int);
+static Bool xf86CursorEnterVT(int, int);
+static void xf86CursorLeaveVT(int, int);
+static int xf86CursorSetDGAMode(int, int, DGADevicePtr);
+
+Bool
+xf86InitCursor(
+ ScreenPtr pScreen,
+ xf86CursorInfoPtr infoPtr
+)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ xf86CursorScreenPtr ScreenPriv;
+ miPointerScreenPtr PointPriv;
+
+ if (xf86CursorGeneration != serverGeneration) {
+ if ((xf86CursorScreenIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ xf86CursorGeneration = serverGeneration;
+ }
+
+ if (!xf86InitHardwareCursor(pScreen, infoPtr))
+ return FALSE;
+
+ ScreenPriv = xcalloc(1, sizeof(xf86CursorScreenRec));
+ if (!ScreenPriv)
+ return FALSE;
+
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr = ScreenPriv;
+
+ ScreenPriv->SWCursor = TRUE;
+ ScreenPriv->isUp = FALSE;
+ ScreenPriv->CurrentCursor = NULL;
+ ScreenPriv->CursorInfoPtr = infoPtr;
+ ScreenPriv->PalettedCursor = FALSE;
+ ScreenPriv->pInstalledMap = NULL;
+
+ ScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = xf86CursorCloseScreen;
+ ScreenPriv->QueryBestSize = pScreen->QueryBestSize;
+ pScreen->QueryBestSize = xf86CursorQueryBestSize;
+ ScreenPriv->RecolorCursor = pScreen->RecolorCursor;
+ pScreen->RecolorCursor = xf86CursorRecolorCursor;
+
+ if ((infoPtr->pScrn->bitsPerPixel == 8) &&
+ !(infoPtr->Flags & HARDWARE_CURSOR_TRUECOLOR_AT_8BPP)) {
+ ScreenPriv->InstallColormap = pScreen->InstallColormap;
+ pScreen->InstallColormap = xf86CursorInstallColormap;
+ ScreenPriv->PalettedCursor = TRUE;
+ }
+
+ PointPriv = pScreen->devPrivates[miPointerScreenIndex].ptr;
+
+ ScreenPriv->showTransparent = PointPriv->showTransparent;
+ if (infoPtr->Flags & HARDWARE_CURSOR_SHOW_TRANSPARENT)
+ PointPriv->showTransparent = TRUE;
+ else
+ PointPriv->showTransparent = FALSE;
+ ScreenPriv->spriteFuncs = PointPriv->spriteFuncs;
+ PointPriv->spriteFuncs = &xf86CursorSpriteFuncs;
+
+ ScreenPriv->SwitchMode = pScrn->SwitchMode;
+ ScreenPriv->EnterVT = pScrn->EnterVT;
+ ScreenPriv->LeaveVT = pScrn->LeaveVT;
+ ScreenPriv->SetDGAMode = pScrn->SetDGAMode;
+
+ ScreenPriv->ForceHWCursorCount = 0;
+ ScreenPriv->HWCursorForced = FALSE;
+
+ if (pScrn->SwitchMode)
+ pScrn->SwitchMode = xf86CursorSwitchMode;
+ pScrn->EnterVT = xf86CursorEnterVT;
+ pScrn->LeaveVT = xf86CursorLeaveVT;
+ pScrn->SetDGAMode = xf86CursorSetDGAMode;
+
+ return TRUE;
+}
+
+/***** Screen functions *****/
+
+static Bool
+xf86CursorCloseScreen(int i, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ miPointerScreenPtr PointPriv =
+ pScreen->devPrivates[miPointerScreenIndex].ptr;
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ if (ScreenPriv->isUp && pScrn->vtSema)
+ xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
+
+ pScreen->CloseScreen = ScreenPriv->CloseScreen;
+ pScreen->QueryBestSize = ScreenPriv->QueryBestSize;
+ pScreen->RecolorCursor = ScreenPriv->RecolorCursor;
+ if (ScreenPriv->InstallColormap)
+ pScreen->InstallColormap = ScreenPriv->InstallColormap;
+
+ PointPriv->spriteFuncs = ScreenPriv->spriteFuncs;
+ PointPriv->showTransparent = ScreenPriv->showTransparent;
+
+ pScrn->SwitchMode = ScreenPriv->SwitchMode;
+ pScrn->EnterVT = ScreenPriv->EnterVT;
+ pScrn->LeaveVT = ScreenPriv->LeaveVT;
+ pScrn->SetDGAMode = ScreenPriv->SetDGAMode;
+
+ xfree(ScreenPriv->transparentData);
+ xfree(ScreenPriv);
+
+ return (*pScreen->CloseScreen)(i, pScreen);
+}
+
+static void
+xf86CursorQueryBestSize(
+ int class,
+ unsigned short *width,
+ unsigned short *height,
+ ScreenPtr pScreen)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ if (class == CursorShape) {
+ if(*width > ScreenPriv->CursorInfoPtr->MaxWidth)
+ *width = ScreenPriv->CursorInfoPtr->MaxWidth;
+ if(*height > ScreenPriv->CursorInfoPtr->MaxHeight)
+ *height = ScreenPriv->CursorInfoPtr->MaxHeight;
+ } else
+ (*ScreenPriv->QueryBestSize)(class, width, height, pScreen);
+}
+
+static void
+xf86CursorInstallColormap(ColormapPtr pMap)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pMap->pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ ScreenPriv->pInstalledMap = pMap;
+
+ (*ScreenPriv->InstallColormap)(pMap);
+}
+
+static void
+xf86CursorRecolorCursor(
+ ScreenPtr pScreen,
+ CursorPtr pCurs,
+ Bool displayed)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ if (!displayed)
+ return;
+
+ if (ScreenPriv->SWCursor)
+ (*ScreenPriv->RecolorCursor)(pScreen, pCurs, displayed);
+ else
+ xf86RecolorCursor(pScreen, pCurs, displayed);
+}
+
+/***** ScrnInfoRec functions *********/
+
+static Bool
+xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags)
+{
+ Bool ret;
+ ScreenPtr pScreen = screenInfo.screens[index];
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+ miPointerScreenPtr PointPriv =
+ pScreen->devPrivates[miPointerScreenIndex].ptr;
+
+ if (ScreenPriv->isUp) {
+ xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
+ ScreenPriv->isUp = FALSE;
+ }
+
+ ret = (*ScreenPriv->SwitchMode)(index, mode, flags);
+
+ /*
+ * Cannot restore cursor here because the new frame[XY][01] haven't been
+ * calculated yet. However, because the hardware cursor was removed above,
+ * ensure the cursor is repainted by miPointerWarpCursor().
+ */
+ ScreenPriv->CursorToRestore = ScreenPriv->CurrentCursor;
+ PointPriv->waitForUpdate = FALSE; /* Force cursor repaint */
+
+ return ret;
+}
+
+static Bool
+xf86CursorEnterVT(int index, int flags)
+{
+ Bool ret;
+ ScreenPtr pScreen = screenInfo.screens[index];
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ ret = (*ScreenPriv->EnterVT)(index, flags);
+
+ if (ScreenPriv->CurrentCursor)
+ xf86CursorSetCursor(pScreen, ScreenPriv->CurrentCursor,
+ ScreenPriv->x, ScreenPriv->y);
+ return ret;
+}
+
+static void
+xf86CursorLeaveVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ if (ScreenPriv->isUp) {
+ xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
+ ScreenPriv->isUp = FALSE;
+ }
+ ScreenPriv->SWCursor = TRUE;
+
+ (*ScreenPriv->LeaveVT)(index, flags);
+}
+
+static int
+xf86CursorSetDGAMode(int index, int num, DGADevicePtr devRet)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+ int ret;
+
+ if (num && ScreenPriv->isUp) {
+ xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
+ ScreenPriv->isUp = FALSE;
+ ScreenPriv->SWCursor = TRUE;
+ }
+
+ ret = (*ScreenPriv->SetDGAMode)(index, num, devRet);
+
+ if (ScreenPriv->CurrentCursor && (!num || (ret != Success))) {
+ xf86CursorSetCursor(pScreen, ScreenPriv->CurrentCursor,
+ ScreenPriv->x, ScreenPriv->y);
+ }
+
+ return ret;
+}
+
+/****** miPointerSpriteFunctions *******/
+
+static Bool
+xf86CursorRealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ if (pCurs->refcnt <= 1)
+ pCurs->devPriv[pScreen->myNum] = NULL;
+
+ return (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCurs);
+}
+
+static Bool
+xf86CursorUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCurs)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ if (pCurs->refcnt <= 1) {
+ xfree(pCurs->devPriv[pScreen->myNum]);
+ pCurs->devPriv[pScreen->myNum] = NULL;
+ }
+
+ return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCurs);
+}
+
+static void
+xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+ miPointerScreenPtr PointPriv;
+
+ ScreenPriv->CurrentCursor = pCurs;
+ ScreenPriv->x = x;
+ ScreenPriv->y = y;
+ ScreenPriv->CursorToRestore = NULL;
+
+ if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */
+ if (ScreenPriv->SWCursor)
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);
+ else if (ScreenPriv->isUp) {
+ xf86SetCursor(pScreen, NullCursor, x, y);
+ ScreenPriv->isUp = FALSE;
+ }
+ return;
+ }
+
+ ScreenPriv->HotX = pCurs->bits->xhot;
+ ScreenPriv->HotY = pCurs->bits->yhot;
+
+ PointPriv = pScreen->devPrivates[miPointerScreenIndex].ptr;
+
+ if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || ((
+#ifdef ARGB_CURSOR
+ pCurs->bits->argb && infoPtr->UseHWCursorARGB &&
+ (*infoPtr->UseHWCursorARGB) (pScreen, pCurs) ) || (
+ pCurs->bits->argb == 0 &&
+#endif
+ (pCurs->bits->height <= infoPtr->MaxHeight) &&
+ (pCurs->bits->width <= infoPtr->MaxWidth) &&
+ (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor)(pScreen, pCurs))))))
+ {
+
+ if (ScreenPriv->SWCursor) /* remove the SW cursor */
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, NullCursor, x, y);
+
+ xf86SetCursor(pScreen, pCurs, x, y);
+ ScreenPriv->SWCursor = FALSE;
+ ScreenPriv->isUp = TRUE;
+ PointPriv->waitForUpdate = !infoPtr->pScrn->silkenMouse;
+ return;
+ }
+
+ PointPriv->waitForUpdate = TRUE;
+
+ if (ScreenPriv->isUp) {
+ /* Remove the HW cursor, or make it transparent */
+ if (infoPtr->Flags & HARDWARE_CURSOR_SHOW_TRANSPARENT) {
+ xf86SetTransparentCursor(pScreen);
+ } else {
+ xf86SetCursor(pScreen, NullCursor, x, y);
+ ScreenPriv->isUp = FALSE;
+ }
+ }
+
+ ScreenPriv->SWCursor = TRUE;
+
+ if (pCurs->bits->emptyMask && !ScreenPriv->showTransparent)
+ pCurs = NullCursor;
+ (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCurs, x, y);
+}
+
+static void
+xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ ScreenPriv->x = x;
+ ScreenPriv->y = y;
+
+ if (ScreenPriv->CursorToRestore)
+ xf86CursorSetCursor(pScreen, ScreenPriv->CursorToRestore,
+ ScreenPriv->x, ScreenPriv->y);
+ else if (ScreenPriv->SWCursor)
+ (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y);
+ else if (ScreenPriv->isUp)
+ xf86MoveCursor(pScreen, x, y);
+}
+
+void
+xf86ForceHWCursor (ScreenPtr pScreen, Bool on)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+
+ if (on)
+ {
+ if (ScreenPriv->ForceHWCursorCount++ == 0)
+ {
+ if (ScreenPriv->SWCursor && ScreenPriv->CurrentCursor)
+ {
+ ScreenPriv->HWCursorForced = TRUE;
+ xf86CursorSetCursor (pScreen, ScreenPriv->CurrentCursor,
+ ScreenPriv->x, ScreenPriv->y);
+ }
+ else
+ ScreenPriv->HWCursorForced = FALSE;
+ }
+ }
+ else
+ {
+ if (--ScreenPriv->ForceHWCursorCount == 0)
+ {
+ if (ScreenPriv->HWCursorForced && ScreenPriv->CurrentCursor)
+ xf86CursorSetCursor (pScreen, ScreenPriv->CurrentCursor,
+ ScreenPriv->x, ScreenPriv->y);
+ }
+ }
+}
+
+xf86CursorInfoPtr
+xf86CreateCursorInfoRec(void)
+{
+ return xcalloc(1, sizeof(xf86CursorInfoRec));
+}
+
+void
+xf86DestroyCursorInfoRec(xf86CursorInfoPtr infoPtr)
+{
+ xfree(infoPtr);
+}
diff --git a/hw/xfree86/ramdac/xf86Cursor.h b/hw/xfree86/ramdac/xf86Cursor.h
new file mode 100644
index 000000000..5e5df46f3
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86Cursor.h
@@ -0,0 +1,49 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h,v 1.11 2003/02/15 03:14:47 tsi Exp $ */
+
+#ifndef _XF86CURSOR_H
+#define _XF86CURSOR_H
+
+#include "xf86str.h"
+#include "mipointer.h"
+
+typedef struct _xf86CursorInfoRec {
+ ScrnInfoPtr pScrn;
+ int Flags;
+ int MaxWidth;
+ int MaxHeight;
+ void (*SetCursorColors)(ScrnInfoPtr pScrn, int bg, int fg);
+ void (*SetCursorPosition)(ScrnInfoPtr pScrn, int x, int y);
+ void (*LoadCursorImage)(ScrnInfoPtr pScrn, unsigned char *bits);
+ void (*HideCursor)(ScrnInfoPtr pScrn);
+ void (*ShowCursor)(ScrnInfoPtr pScrn);
+ unsigned char* (*RealizeCursor)(struct _xf86CursorInfoRec *, CursorPtr);
+ Bool (*UseHWCursor)(ScreenPtr, CursorPtr);
+
+#ifdef ARGB_CURSOR
+ Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
+ void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
+#endif
+
+} xf86CursorInfoRec, *xf86CursorInfoPtr;
+
+Bool xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr);
+xf86CursorInfoPtr xf86CreateCursorInfoRec(void);
+void xf86DestroyCursorInfoRec(xf86CursorInfoPtr);
+void xf86ForceHWCursor (ScreenPtr pScreen, Bool on);
+
+#define HARDWARE_CURSOR_INVERT_MASK 0x00000001
+#define HARDWARE_CURSOR_AND_SOURCE_WITH_MASK 0x00000002
+#define HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK 0x00000004
+#define HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED 0x00000008
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 0x00000010
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 0x00000020
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 0x00000040
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 0x00000080
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 0x00000100
+#define HARDWARE_CURSOR_TRUECOLOR_AT_8BPP 0x00000200
+#define HARDWARE_CURSOR_BIT_ORDER_MSBFIRST 0x00000400
+#define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800
+#define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000
+#define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000
+
+#endif /* _XF86CURSOR_H */
diff --git a/hw/xfree86/ramdac/xf86CursorPriv.h b/hw/xfree86/ramdac/xf86CursorPriv.h
new file mode 100644
index 000000000..5a6ab118a
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86CursorPriv.h
@@ -0,0 +1,48 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h,v 1.5 2003/02/15 03:14:47 tsi Exp $ */
+
+#ifndef _XF86CURSORPRIV_H
+#define _XF86CURSORPRIV_H
+
+#include "xf86Cursor.h"
+#include "mipointrst.h"
+
+typedef struct {
+ Bool SWCursor;
+ Bool isUp;
+ Bool showTransparent;
+ short HotX;
+ short HotY;
+ short x;
+ short y;
+ CursorPtr CurrentCursor, CursorToRestore;
+ xf86CursorInfoPtr CursorInfoPtr;
+ CloseScreenProcPtr CloseScreen;
+ RecolorCursorProcPtr RecolorCursor;
+ InstallColormapProcPtr InstallColormap;
+ QueryBestSizeProcPtr QueryBestSize;
+ miPointerSpriteFuncPtr spriteFuncs;
+ Bool PalettedCursor;
+ ColormapPtr pInstalledMap;
+ Bool (*SwitchMode)(int, DisplayModePtr,int);
+ Bool (*EnterVT)(int, int);
+ void (*LeaveVT)(int, int);
+ int (*SetDGAMode)(int, int, DGADevicePtr);
+
+ /* Number of requests to force HW cursor */
+ int ForceHWCursorCount;
+ Bool HWCursorForced;
+
+ pointer transparentData;
+} xf86CursorScreenRec, *xf86CursorScreenPtr;
+
+void xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y);
+void xf86SetTransparentCursor(ScreenPtr pScreen);
+void xf86MoveCursor(ScreenPtr pScreen, int x, int y);
+void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed);
+Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr);
+
+CARD32 xf86ReverseBitOrder(CARD32 data);
+
+extern int xf86CursorScreenIndex;
+
+#endif /* _XF86CURSORPRIV_H */
diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
new file mode 100644
index 000000000..e911f8066
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -0,0 +1,516 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.12 2003/02/13 20:28:41 tsi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "cursorstr.h"
+#include "mi.h"
+#include "mipointer.h"
+#include "xf86CursorPriv.h"
+
+#include "servermd.h"
+
+#if BITMAP_SCANLINE_PAD == 64
+
+#if 1
+/* Cursors might be only 32 wide. Give'em a chance */
+#define SCANLINE CARD32
+#define CUR_BITMAP_SCANLINE_PAD 32
+#define CUR_LOG2_BITMAP_PAD 5
+#define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w)
+#else
+#define SCANLINE CARD64
+#define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD
+#define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD
+#define REVERSE_BIT_ORDER(w) xf86CARD64ReverseBits(w)
+static CARD64 xf86CARD64ReverseBits(CARD64 w);
+
+static CARD64
+xf86CARD64ReverseBits(CARD64 w)
+{
+ unsigned char *p = (unsigned char *)&w;
+
+ p[0] = byte_reversed[p[0]];
+ p[1] = byte_reversed[p[1]];
+ p[2] = byte_reversed[p[2]];
+ p[3] = byte_reversed[p[3]];
+ p[4] = byte_reversed[p[4]];
+ p[5] = byte_reversed[p[5]];
+ p[6] = byte_reversed[p[6]];
+ p[7] = byte_reversed[p[7]];
+
+ return w;
+}
+#endif
+
+#else
+
+#define SCANLINE CARD32
+#define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD
+#define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD
+#define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w)
+
+#endif /* BITMAP_SCANLINE_PAD == 64 */
+
+static unsigned char* RealizeCursorInterleave0(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave1(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave8(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave16(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave32(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave64(xf86CursorInfoPtr, CursorPtr);
+
+Bool
+xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
+{
+ if ((infoPtr->MaxWidth <= 0) || (infoPtr->MaxHeight <= 0))
+ return FALSE;
+
+ /* These are required for now */
+ if (!infoPtr->SetCursorPosition ||
+ !infoPtr->LoadCursorImage ||
+ !infoPtr->HideCursor ||
+ !infoPtr->ShowCursor ||
+ !infoPtr->SetCursorColors)
+ return FALSE;
+
+ if (infoPtr->RealizeCursor) {
+ /* Don't overwrite a driver provided Realize Cursor function */
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave1;
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave8;
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave16;
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave32;
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave64;
+ } else { /* not interleaved */
+ infoPtr->RealizeCursor = RealizeCursorInterleave0;
+ }
+
+ infoPtr->pScrn = xf86Screens[pScreen->myNum];
+
+ return TRUE;
+}
+
+void
+xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+ unsigned char *bits;
+
+ if (pCurs == NullCursor) {
+ (*infoPtr->HideCursor)(infoPtr->pScrn);
+ return;
+ }
+
+ bits = pCurs->devPriv[pScreen->myNum];
+
+ x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
+ y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
+
+#ifdef ARGB_CURSOR
+ if (!pCurs->bits->argb || !infoPtr->LoadCursorARGB)
+#endif
+ if (!bits) {
+ bits = (*infoPtr->RealizeCursor)(infoPtr, pCurs);
+ pCurs->devPriv[pScreen->myNum] = bits;
+ }
+
+ if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
+ (*infoPtr->HideCursor)(infoPtr->pScrn);
+
+#ifdef ARGB_CURSOR
+ if (pCurs->bits->argb && infoPtr->LoadCursorARGB)
+ (*infoPtr->LoadCursorARGB) (infoPtr->pScrn, pCurs);
+ else
+#endif
+ if (bits)
+ (*infoPtr->LoadCursorImage)(infoPtr->pScrn, bits);
+
+ xf86RecolorCursor(pScreen, pCurs, 1);
+
+ (*infoPtr->SetCursorPosition)(infoPtr->pScrn, x, y);
+
+ (*infoPtr->ShowCursor)(infoPtr->pScrn);
+}
+
+void
+xf86SetTransparentCursor(ScreenPtr pScreen)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+
+ if (!ScreenPriv->transparentData)
+ ScreenPriv->transparentData =
+ (*infoPtr->RealizeCursor)(infoPtr, NullCursor);
+
+ if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
+ (*infoPtr->HideCursor)(infoPtr->pScrn);
+
+ if (ScreenPriv->transparentData)
+ (*infoPtr->LoadCursorImage)(infoPtr->pScrn,
+ ScreenPriv->transparentData);
+
+ (*infoPtr->ShowCursor)(infoPtr->pScrn);
+}
+
+void
+xf86MoveCursor(ScreenPtr pScreen, int x, int y)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+
+ x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
+ y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
+
+ (*infoPtr->SetCursorPosition)(infoPtr->pScrn, x, y);
+}
+
+void
+xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
+{
+ xf86CursorScreenPtr ScreenPriv =
+ pScreen->devPrivates[xf86CursorScreenIndex].ptr;
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+
+ if (ScreenPriv->PalettedCursor) {
+ xColorItem sourceColor, maskColor;
+ ColormapPtr pmap = ScreenPriv->pInstalledMap;
+
+ if (!pmap)
+ return;
+
+ sourceColor.red = pCurs->foreRed;
+ sourceColor.green = pCurs->foreGreen;
+ sourceColor.blue = pCurs->foreBlue;
+ FakeAllocColor(pmap, &sourceColor);
+ maskColor.red = pCurs->backRed;
+ maskColor.green = pCurs->backGreen;
+ maskColor.blue = pCurs->backBlue;
+ FakeAllocColor(pmap, &maskColor);
+ FakeFreeColor(pmap, sourceColor.pixel);
+ FakeFreeColor(pmap, maskColor.pixel);
+ (*infoPtr->SetCursorColors)(infoPtr->pScrn,
+ maskColor.pixel, sourceColor.pixel);
+ } else { /* Pass colors in 8-8-8 RGB format */
+ (*infoPtr->SetCursorColors)(infoPtr->pScrn,
+ (pCurs->backBlue >> 8) |
+ ((pCurs->backGreen >> 8) << 8) |
+ ((pCurs->backRed >> 8) << 16),
+ (pCurs->foreBlue >> 8) |
+ ((pCurs->foreGreen >> 8) << 8) |
+ ((pCurs->foreRed >> 8) << 16)
+ );
+ }
+}
+
+/* These functions assume that MaxWidth is a multiple of 32 */
+static unsigned char*
+RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+
+ SCANLINE *SrcS, *SrcM, *DstS, *DstM;
+ SCANLINE *pSrc, *pMsk;
+ unsigned char *mem;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+ int SrcPitch, DstPitch, Pitch, y, x;
+ /* how many words are in the source or mask */
+ int words = size / (CUR_BITMAP_SCANLINE_PAD / 4);
+
+
+ if (!(mem = xcalloc(1, size)))
+ return NULL;
+
+ if (pCurs == NullCursor) {
+ if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) {
+ DstM = (SCANLINE*)mem;
+ if (!(infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK))
+ DstM += words;
+ (void)memset(DstM, -1, words * sizeof(SCANLINE));
+ }
+ return mem;
+ }
+
+ /* SrcPitch == the number of scanlines wide the cursor image is */
+ SrcPitch = (pCurs->bits->width + (BITMAP_SCANLINE_PAD - 1)) >>
+ CUR_LOG2_BITMAP_PAD;
+
+ /* DstPitch is the width of the hw cursor in scanlines */
+ DstPitch = infoPtr->MaxWidth >> CUR_LOG2_BITMAP_PAD;
+ Pitch = SrcPitch < DstPitch ? SrcPitch : DstPitch;
+
+ SrcS = (SCANLINE*)pCurs->bits->source;
+ SrcM = (SCANLINE*)pCurs->bits->mask;
+ DstS = (SCANLINE*)mem;
+ DstM = DstS + words;
+
+ if (infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK) {
+ SCANLINE *tmp;
+ tmp = DstS; DstS = DstM; DstM = tmp;
+ }
+
+ if (infoPtr->Flags & HARDWARE_CURSOR_AND_SOURCE_WITH_MASK) {
+ for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
+ y--;
+ pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
+ for(x = 0; x < Pitch; x++) {
+ pSrc[x] = SrcS[x] & SrcM[x];
+ pMsk[x] = SrcM[x];
+ }
+ }
+ } else {
+ for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
+ y--;
+ pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
+ for(x = 0; x < Pitch; x++) {
+ pSrc[x] = SrcS[x];
+ pMsk[x] = SrcM[x];
+ }
+ }
+ }
+
+ if (infoPtr->Flags & HARDWARE_CURSOR_NIBBLE_SWAPPED) {
+ int count = size;
+ unsigned char* pntr1 = (unsigned char *)DstS;
+ unsigned char* pntr2 = (unsigned char *)DstM;
+ unsigned char a, b;
+ while (count) {
+
+ a = *pntr1;
+ b = *pntr2;
+ *pntr1 = ((a & 0xF0) >> 4) | ((a & 0x0F) << 4);
+ *pntr2 = ((b & 0xF0) >> 4) | ((b & 0x0F) << 4);
+ pntr1++; pntr2++;
+ count-=2;
+ }
+ }
+
+ /*
+ * Must be _after_ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK to avoid wiping
+ * out entire source mask.
+ */
+ if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) {
+ int count = words;
+ SCANLINE* pntr = DstM;
+ while (count--) {
+ *pntr = ~(*pntr);
+ pntr++;
+ }
+ }
+
+ if (infoPtr->Flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST) {
+ for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
+ y--;
+ pSrc+=DstPitch, pMsk+=DstPitch) {
+ for(x = 0; x < Pitch; x++) {
+ pSrc[x] = REVERSE_BIT_ORDER(pSrc[x]);
+ pMsk[x] = REVERSE_BIT_ORDER(pMsk[x]);
+ }
+ }
+ }
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave1(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ unsigned char *DstS, *DstM;
+ unsigned char *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = xcalloc(1, size))) {
+ xfree(mem2);
+ return NULL;
+ }
+
+ /* 1 bit interleave */
+ DstS = mem2;
+ DstM = DstS + (size >> 1);
+ pntr = mem;
+ count = size;
+ while (count) {
+ *pntr++ = ((*DstS&0x01) ) | ((*DstM&0x01) << 1) |
+ ((*DstS&0x02) << 1) | ((*DstM&0x02) << 2) |
+ ((*DstS&0x04) << 2) | ((*DstM&0x04) << 3) |
+ ((*DstS&0x08) << 3) | ((*DstM&0x08) << 4);
+ *pntr++ = ((*DstS&0x10) >> 4) | ((*DstM&0x10) >> 3) |
+ ((*DstS&0x20) >> 3) | ((*DstM&0x20) >> 2) |
+ ((*DstS&0x40) >> 2) | ((*DstM&0x40) >> 1) |
+ ((*DstS&0x80) >> 1) | ((*DstM&0x80) );
+ DstS++;
+ DstM++;
+ count-=2;
+ }
+
+ /* Free the uninterleaved cursor */
+ xfree(mem2);
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave8(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ unsigned char *DstS, *DstM;
+ unsigned char *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = xcalloc(1, size))) {
+ xfree(mem2);
+ return NULL;
+ }
+
+ /* 8 bit interleave */
+ DstS = mem2;
+ DstM = DstS + (size >> 1);
+ pntr = mem;
+ count = size;
+ while (count) {
+ *pntr++ = *DstS++;
+ *pntr++ = *DstM++;
+ count-=2;
+ }
+
+ /* Free the uninterleaved cursor */
+ xfree(mem2);
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave16(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ unsigned short *DstS, *DstM;
+ unsigned short *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = xcalloc(1, size))) {
+ xfree(mem2);
+ return NULL;
+ }
+
+ /* 16 bit interleave */
+ DstS = (pointer)mem2;
+ DstM = DstS + (size >> 2);
+ pntr = (pointer)mem;
+ count = (size >> 1);
+ while (count) {
+ *pntr++ = *DstS++;
+ *pntr++ = *DstM++;
+ count-=2;
+ }
+
+ /* Free the uninterleaved cursor */
+ xfree(mem2);
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave32(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ CARD32 *DstS, *DstM;
+ CARD32 *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = xcalloc(1, size))) {
+ xfree(mem2);
+ return NULL;
+ }
+
+ /* 32 bit interleave */
+ DstS = (pointer)mem2;
+ DstM = DstS + (size >> 3);
+ pntr = (pointer)mem;
+ count = (size >> 2);
+ while (count) {
+ *pntr++ = *DstS++;
+ *pntr++ = *DstM++;
+ count-=2;
+ }
+
+ /* Free the uninterleaved cursor */
+ xfree(mem2);
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave64(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ CARD32 *DstS, *DstM;
+ CARD32 *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = xcalloc(1, size))) {
+ xfree(mem2);
+ return NULL;
+ }
+
+ /* 64 bit interleave */
+ DstS = (pointer)mem2;
+ DstM = DstS + (size >> 3);
+ pntr = (pointer)mem;
+ count = (size >> 2);
+ while (count) {
+ *pntr++ = *DstS++;
+ *pntr++ = *DstS++;
+ *pntr++ = *DstM++;
+ *pntr++ = *DstM++;
+ count-=4;
+ }
+
+ /* Free the uninterleaved cursor */
+ xfree(mem2);
+
+ return mem;
+}
diff --git a/hw/xfree86/ramdac/xf86RamDac.c b/hw/xfree86/ramdac/xf86RamDac.c
new file mode 100644
index 000000000..7db16e394
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86RamDac.c
@@ -0,0 +1,160 @@
+/*
+ * Copyright 1998 by Alan Hourihane, Wigan, England.
+ *
+ * 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 Alan Hourihane not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Alan Hourihane makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ALAN HOURIHANE 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.
+ *
+ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ *
+ * Generic RAMDAC access routines.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.c,v 1.6 2000/09/26 15:57:21 tsi Exp $ */
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+
+#include "xf86RamDacPriv.h"
+
+int RamDacHWPrivateIndex = -1;
+int RamDacScreenPrivateIndex = -1;
+
+RamDacRecPtr
+RamDacCreateInfoRec()
+{
+ RamDacRecPtr infoRec;
+
+ infoRec = xcalloc(1, sizeof(RamDacRec));
+
+ return infoRec;
+}
+
+RamDacHelperRecPtr
+RamDacHelperCreateInfoRec()
+{
+ RamDacHelperRecPtr infoRec;
+
+ infoRec = xcalloc(1, sizeof(RamDacHelperRec));
+
+ return infoRec;
+}
+
+void
+RamDacDestroyInfoRec(RamDacRecPtr infoRec)
+{
+ xfree(infoRec);
+}
+
+void
+RamDacHelperDestroyInfoRec(RamDacHelperRecPtr infoRec)
+{
+ xfree(infoRec);
+}
+
+Bool
+RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr ramdacPriv)
+{
+ RamDacHWRecPtr ramdacHWPtr;
+ RamDacRegRecPtr ramdacReg;
+ RamDacScreenRecPtr ramdacScrPtr;
+
+ /*
+ * make sure the RamDacRec is allocated
+ */
+ if (!RamDacGetRec(pScrn))
+ return FALSE;
+ ramdacHWPtr = RAMDACHWPTR(pScrn);
+ ramdacReg = &ramdacHWPtr->ModeReg;
+ ramdacScrPtr = ((RamDacScreenRecPtr)
+ (pScrn)->privates[RamDacGetScreenIndex()].ptr);
+ ramdacScrPtr->RamDacRec = ramdacPriv;
+
+ return(TRUE);
+}
+
+void
+RamDacGetRecPrivate()
+{
+ if (RamDacHWPrivateIndex < 0)
+ RamDacHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
+ if (RamDacScreenPrivateIndex < 0)
+ RamDacScreenPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
+ return;
+}
+
+Bool
+RamDacGetRec(ScrnInfoPtr scrp)
+{
+ RamDacRegRecPtr regp;
+
+ RamDacGetRecPrivate();
+ /*
+ * New privates are always set to NULL, so we can check if the allocation
+ * has already been done.
+ */
+ if (scrp->privates[RamDacHWPrivateIndex].ptr != NULL)
+ return TRUE;
+ if (scrp->privates[RamDacScreenPrivateIndex].ptr != NULL)
+ return TRUE;
+
+ scrp->privates[RamDacHWPrivateIndex].ptr =
+ xnfcalloc(sizeof(RamDacHWRec), 1);
+ scrp->privates[RamDacScreenPrivateIndex].ptr =
+ xnfcalloc(sizeof(RamDacScreenRec), 1);
+ /* Does this really belong here? */
+ regp = &((RamDacHWRecPtr)scrp->privates[RamDacHWPrivateIndex].ptr)->ModeReg;
+
+ return TRUE;
+}
+
+void
+RamDacFreeRec(ScrnInfoPtr pScrn)
+{
+ RamDacHWRecPtr ramdacHWPtr;
+ RamDacScreenRecPtr ramdacScrPtr;
+
+ if (RamDacHWPrivateIndex < 0)
+ return;
+
+ if (RamDacScreenPrivateIndex < 0)
+ return;
+
+ ramdacHWPtr = RAMDACHWPTR(pScrn);
+ ramdacScrPtr = ((RamDacScreenRecPtr)
+ (pScrn)->privates[RamDacGetScreenIndex()].ptr);
+
+ if (ramdacHWPtr)
+ xfree(ramdacHWPtr);
+ ramdacHWPtr = NULL;
+
+ if (ramdacScrPtr)
+ xfree(ramdacScrPtr);
+ ramdacScrPtr = NULL;
+}
+
+int
+RamDacGetHWIndex()
+{
+ return RamDacHWPrivateIndex;
+}
+
+int
+RamDacGetScreenIndex()
+{
+ return RamDacScreenPrivateIndex;
+}
diff --git a/hw/xfree86/ramdac/xf86RamDac.h b/hw/xfree86/ramdac/xf86RamDac.h
new file mode 100644
index 000000000..626a8b2b9
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86RamDac.h
@@ -0,0 +1,124 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDac.h,v 1.11 2000/03/21 21:15:28 alanh Exp $ */
+
+#ifndef _XF86RAMDAC_H
+#define _XF86RAMDAC_H 1
+
+#include "colormapst.h"
+#include "xf86Cursor.h"
+
+/* Define unique vendor codes for RAMDAC's */
+#define VENDOR_IBM 0x0000
+#define VENDOR_BT 0x0001
+#define VENDOR_TI 0x0002
+
+typedef struct _RamDacRegRec {
+/* This is probably the nastiest assumption, we allocate 1024 slots for
+ * ramdac registers, should be enough. I've checked IBM and TVP series
+ * and they seem o.k
+ * Then we allocate 768 entries for the DAC too. IBM640 needs 1024 -FIXME
+ */
+ unsigned short DacRegs[0x400]; /* register set */
+ unsigned char DAC[0x300]; /* colour map */
+ Bool Overlay;
+} RamDacRegRec, *RamDacRegRecPtr;
+
+typedef struct _RamDacHWRegRec {
+ RamDacRegRec SavedReg;
+ RamDacRegRec ModeReg;
+} RamDacHWRec, *RamDacHWRecPtr;
+
+typedef struct _RamDacRec {
+ CARD32 RamDacType;
+
+ void (*LoadPalette)(
+ ScrnInfoPtr pScrn,
+ int numColors,
+ int *indices,
+ LOCO *colors,
+ VisualPtr pVisual
+ );
+
+ unsigned char (*ReadDAC)(
+ ScrnInfoPtr pScrn,
+ CARD32
+ );
+
+ void (*WriteDAC)(
+ ScrnInfoPtr pScrn,
+ CARD32,
+ unsigned char,
+ unsigned char
+ );
+
+ void (*WriteAddress)(
+ ScrnInfoPtr pScrn,
+ CARD32
+ );
+
+ void (*WriteData)(
+ ScrnInfoPtr pScrn,
+ unsigned char
+ );
+
+ void (*ReadAddress)(
+ ScrnInfoPtr pScrn,
+ CARD32
+ );
+
+ unsigned char (*ReadData)(
+ ScrnInfoPtr pScrn
+ );
+} RamDacRec, *RamDacRecPtr;
+
+typedef struct _RamDacHelperRec {
+ CARD32 RamDacType;
+
+ void (*Restore)(
+ ScrnInfoPtr pScrn,
+ RamDacRecPtr ramdacPtr,
+ RamDacRegRecPtr ramdacReg
+ );
+
+ void (*Save)(
+ ScrnInfoPtr pScrn,
+ RamDacRecPtr ramdacPtr,
+ RamDacRegRecPtr ramdacReg
+ );
+
+ void (*SetBpp)(
+ ScrnInfoPtr pScrn,
+ RamDacRegRecPtr ramdacReg
+ );
+
+ void (*HWCursorInit)(
+ xf86CursorInfoPtr infoPtr
+ );
+} RamDacHelperRec, *RamDacHelperRecPtr;
+
+#define RAMDACHWPTR(p) ((RamDacHWRecPtr)((p)->privates[RamDacGetHWIndex()].ptr))
+
+typedef struct _RamdacScreenRec {
+ RamDacRecPtr RamDacRec;
+} RamDacScreenRec, *RamDacScreenRecPtr;
+#define RAMDACSCRPTR(p) ((RamDacScreenRecPtr)((p)->privates[RamDacGetScreenIndex()].ptr))->RamDacRec
+
+extern int RamDacHWPrivateIndex;
+extern int RamDacScreenPrivateIndex;
+
+typedef struct {
+ int token;
+} RamDacSupportedInfoRec, *RamDacSupportedInfoRecPtr;
+
+RamDacRecPtr RamDacCreateInfoRec(void);
+RamDacHelperRecPtr RamDacHelperCreateInfoRec(void);
+void RamDacDestroyInfoRec(RamDacRecPtr RamDacRec);
+void RamDacHelperDestroyInfoRec(RamDacHelperRecPtr RamDacRec);
+Bool RamDacInit(ScrnInfoPtr pScrn, RamDacRecPtr RamDacRec);
+void RamDacSetGamma(ScrnInfoPtr pScrn, Bool Real8BitDac);
+void RamDacRestoreDACValues(ScrnInfoPtr pScrn);
+Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits,
+ unsigned int flags);
+void RamDacFreeRec(ScrnInfoPtr pScrn);
+int RamDacGetHWIndex(void);
+
+#endif /* _XF86RAMDAC_H */
diff --git a/hw/xfree86/ramdac/xf86RamDacCmap.c b/hw/xfree86/ramdac/xf86RamDacCmap.c
new file mode 100644
index 000000000..3b01081df
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86RamDacCmap.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright 1998 by Alan Hourihane, Wigan, England.
+ *
+ * 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 Alan Hourihane not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Alan Hourihane makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ALAN HOURIHANE 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.
+ *
+ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ *
+ * Generic RAMDAC access to colormaps.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDacCmap.c,v 1.7 2000/07/26 01:52:24 tsi Exp $ */
+
+#include "X.h"
+#include "Xproto.h"
+#include "windowstr.h"
+#include "mipointer.h"
+#include "micmap.h"
+
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "compiler.h"
+#include "colormapst.h"
+#include "xf86RamDacPriv.h"
+
+#include "xf86PciInfo.h"
+#include "xf86Pci.h"
+
+void
+RamDacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
+ VisualPtr pVisual)
+{
+ RamDacRecPtr hwp = RAMDACSCRPTR(pScrn);
+ int i, index;
+
+ for (i = 0; i < numColors; i++) {
+ index = indices[i];
+ (*hwp->WriteAddress)(pScrn, index);
+ (*hwp->WriteData)(pScrn, colors[index].red);
+ (*hwp->WriteData)(pScrn, colors[index].green);
+ (*hwp->WriteData)(pScrn, colors[index].blue);
+ }
+}
+
+Bool
+RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits,
+ unsigned int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ RamDacRecPtr hwp = RAMDACSCRPTR(pScrn);
+
+ if (hwp->LoadPalette == NULL)
+ return xf86HandleColormaps(pScreen, maxColors, sigRGBbits,
+ RamDacLoadPalette, NULL, flags);
+ else
+ return xf86HandleColormaps(pScreen, maxColors, sigRGBbits,
+ hwp->LoadPalette, NULL, flags);
+}
diff --git a/hw/xfree86/ramdac/xf86RamDacMod.c b/hw/xfree86/ramdac/xf86RamDacMod.c
new file mode 100644
index 000000000..754949606
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86RamDacMod.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright 1998 by Alan Hourihane, Wigan, England.
+ *
+ * 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 Alan Hourihane not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Alan Hourihane makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL ALAN HOURIHANE 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.
+ *
+ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
+ *
+ * Generic RAMDAC module.
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDacMod.c,v 1.6 1999/01/26 05:54:18 dawes Exp $ */
+
+#include "xf86Module.h"
+
+
+static XF86ModuleVersionInfo VersRec = {
+ "ramdac",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 0, 1, 0,
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0, 0, 0, 0}
+};
+
+XF86ModuleData ramdacModuleData = { &VersRec, NULL, NULL };
+
diff --git a/hw/xfree86/ramdac/xf86RamDacPriv.h b/hw/xfree86/ramdac/xf86RamDacPriv.h
new file mode 100644
index 000000000..f1eeb3a7d
--- /dev/null
+++ b/hw/xfree86/ramdac/xf86RamDacPriv.h
@@ -0,0 +1,10 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86RamDacPriv.h,v 1.4 1999/07/18 03:27:02 dawes Exp $ */
+
+#include "xf86RamDac.h"
+#include "xf86cmap.h"
+
+void RamDacGetRecPrivate(void);
+Bool RamDacGetRec(ScrnInfoPtr pScrn);
+int RamDacGetScreenIndex(void);
+void RamDacLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
+ LOCO *colors, VisualPtr pVisual);
diff --git a/hw/xfree86/scanpci/extrapci.ids b/hw/xfree86/scanpci/extrapci.ids
new file mode 100644
index 000000000..926e1a75f
--- /dev/null
+++ b/hw/xfree86/scanpci/extrapci.ids
@@ -0,0 +1,45 @@
+#
+# Modifications and additions to the standard list of PCI IDs in
+# pci.ids.
+#
+# To modify an entry, simply add the modified version here.
+# To leave part of an entry unchanged, use '"' for the name
+# (e.g., leave the vendor name unchanged while adding/modifying
+# a device). To delete an entry, set the name to '-'.
+#
+# One syntax extension is allowing a 16-bit class value to be
+# specified for a device (see the syntax description below).
+#
+# Don't make gratuitous changes, and please send back
+# changes/additions that aren't XFree86-specific to the pciids
+# project (http://pciids.sf.net/).
+#
+# $XFree86: xc/programs/Xserver/hw/xfree86/etc/extrapci.ids,v 1.7 2003/02/06 04:18:09 dawes Exp $
+#
+
+# Vendors, devices and subsystems. Please keep sorted.
+
+# Syntax:
+# vendor vendor_name
+# device device_name <-- single tab
+# C class <-- two tabs
+# subvendor subdevice subsystem_name <-- two tabs
+#
+# Use lower-case hex digits for all numeric values.
+
+# Example: Add a new chipset for vendor who's ID is xyzw
+#
+# xyzw "
+# 20ce New Chipset Description
+
+1102 "
+ 0002 "
+ C 0401
+
+# Intel(R) 852GM/855GM, 865G
+8086 "
+ 3580 852GM/852GME/855GM/855GME Chipset Host-Hub Bridge
+ 3582 852GM/852GME/855GM/855GME Chipset Graphics Controller
+ 2570 865G Chipset Host-Hub Bridge
+ 2572 865G Chipset Graphics Controller
+
diff --git a/hw/xfree86/scanpci/pci.ids b/hw/xfree86/scanpci/pci.ids
new file mode 100644
index 000000000..a6bb2fa1c
--- /dev/null
+++ b/hw/xfree86/scanpci/pci.ids
@@ -0,0 +1,7299 @@
+#
+# List of PCI ID's
+#
+# Maintained by Martin Mares <mj@ucw.cz> and other volunteers from the
+# Linux PCI ID's Project at http://pciids.sf.net/. New data are always
+# welcome (if they are accurate), we're eagerly expecting new entries,
+# so if you have anything to contribute, please visit the home page or
+# send a diff -u against the most recent pci.ids to pci-ids@ucw.cz.
+#
+# Daily snapshot on Tue 2003-02-25 11:00:06
+#
+
+# Vendors, devices and subsystems. Please keep sorted.
+
+# Syntax:
+# vendor vendor_name
+# device device_name <-- single tab
+# subvendor subdevice subsystem_name <-- two tabs
+
+0000 Gammagraphx, Inc.
+001a Ascend Communications, Inc.
+0033 Paradyne corp.
+003d Lockheed Martin-Marietta Corp
+# Real TJN ID is e159, but they got it wrong several times --mj
+0059 Tiger Jet Network Inc. (Wrong ID)
+0070 Hauppauge computer works Inc.
+0100 Ncipher Corp Ltd
+0675 Dynalink
+ 1700 IS64PH ISDN Adapter
+ 1702 IS64PH ISDN Adapter
+# Wrong ID used in subsystem ID of VIA USB controllers.
+0925 VIA Technologies, Inc. (Wrong ID)
+09c1 Arris
+ 0704 CM 200E Cable Modem
+0a89 BREA Technologies Inc
+0e11 Compaq Computer Corporation
+ 0001 PCI to EISA Bridge
+ 0002 PCI to ISA Bridge
+ 0049 NC7132 Gigabit Upgrade Module
+ 004a NC6136 Gigabit Server Adapter
+ 0508 Netelligent 4/16 Token Ring
+ 1000 Triflex/Pentium Bridge, Model 1000
+ 2000 Triflex/Pentium Bridge, Model 2000
+ 3032 QVision 1280/p
+ 3033 QVision 1280/p
+ 3034 QVision 1280/p
+ 4000 4000 [Triflex]
+ 6010 HotPlug PCI Bridge 6010
+ 7020 USB Controller
+ a0ec Fibre Channel Host Controller
+ a0f0 Advanced System Management Controller
+ a0f3 Triflex PCI to ISA Bridge
+ a0f7 PCI Hotplug Controller
+ 8086 002a PCI Hotplug Controller A
+ 8086 002b PCI Hotplug Controller B
+ a0f8 ZFMicro Chipset USB
+ a0fc Fibre Channel Host Controller
+ ae10 Smart-2/P RAID Controller
+ 0e11 4030 Smart-2/P Array Controller
+ 0e11 4031 Smart-2SL Array Controller
+ 0e11 4032 Smart Array Controller
+ 0e11 4033 Smart 3100ES Array Controller
+ ae29 MIS-L
+ ae2a MPC
+ ae2b MIS-E
+ ae31 System Management Controller
+ ae32 Netelligent 10/100
+ ae33 Triflex Dual EIDE Controller
+ ae34 Netelligent 10
+ ae35 Integrated NetFlex-3/P
+ ae40 Netelligent 10/100 Dual
+ ae43 ProLiant Integrated Netelligent 10/100
+ ae69 CETUS-L
+ ae6c Northstar
+ ae6d NorthStar CPU to PCI Bridge
+ b011 Integrated Netelligent 10/100
+ b012 Netelligent 10 T/2
+ b01e NC3120 Fast Ethernet NIC
+ b01f NC3122 Fast Ethernet NIC
+ b02f NC1120 Ethernet NIC
+ b030 Netelligent WS 5100
+ b04a 10/100 TX PCI Intel WOL UTP Controller
+ b060 Smart Array 5300 Controller
+ b0c6 NC3161 Fast Ethernet NIC
+ b0c7 NC3160 Fast Ethernet NIC
+ b0d7 NC3121 Fast Ethernet NIC
+ b0dd NC3131 Fast Ethernet NIC
+ b0de NC3132 Fast Ethernet Module
+ b0df NC6132 Gigabit Module
+ b0e0 NC6133 Gigabit Module
+ b0e1 NC3133 Fast Ethernet Module
+ b123 NC6134 Gigabit NIC
+ b134 NC3163 Fast Ethernet NIC
+ b13c NC3162 Fast Ethernet NIC
+ b144 NC3123 Fast Ethernet NIC
+ b163 NC3134 Fast Ethernet NIC
+ b164 NC3165 Fast Ethernet Upgrade Module
+ b178 Smart Array 5i/532
+ b1a4 NC7131 Gigabit Server Adapter
+ f130 NetFlex-3/P ThunderLAN 1.0
+ f150 NetFlex-3/P ThunderLAN 2.3
+0e55 HaSoTec GmbH
+# Formerly NCR
+1000 LSI Logic / Symbios Logic
+ 0001 53c810
+ 1000 1000 8100S
+ 0002 53c820
+ 0003 53c825
+ 0004 53c815
+ 0005 53c810AP
+ 0006 53c860
+ 000a 53c1510
+ 000b 53c896
+ 000c 53c895
+ 1de1 3907 DC-390U2W
+ 000d 53c885
+ 000f 53c875
+ 0e11 7004 Embedded Ultra Wide SCSI Controller
+ 1092 8760 FirePort 40 Dual SCSI Controller
+ 1de1 3904 DC390F Ultra Wide SCSI Controller
+ 0010 53c895
+ 0e11 4040 Integrated Array Controller
+ 0e11 4048 Integrated Array Controller
+ 0012 53c895a
+ 0013 53c875a
+ 0020 53c1010 Ultra3 SCSI Adapter
+ 1de1 1020 DC-390U3W
+ 0021 53c1010 66MHz Ultra3 SCSI Adapter
+ 0030 53c1030
+ 1028 1010 LSI U320 SCSI Controller
+ 0040 53c1035
+ 008f 53c875J
+ 1092 8000 FirePort 40 SCSI Controller
+ 1092 8760 FirePort 40 Dual SCSI Host Adapter
+ 0621 FC909
+ 0622 FC929
+ 0623 FC929 LAN
+ 0624 FC919
+ 0625 FC919 LAN
+ 0626 FC929X
+ 0627 FC929X LAN
+ 0628 FC919X
+ 0629 FC919X LAN
+ 0701 83C885 NT50 DigitalScape Fast Ethernet
+ 0702 Yellowfin G-NIC gigabit ethernet
+ 1318 0000 PEI100X
+ 0901 61C102
+ 1000 63C815
+ 1960 PowerEdge Expandable RAID Controller 4
+ 1028 0518 PowerEdge Expandable RAID Controller 4/DC
+ 1028 0520 PowerEdge Expandable RAID Controller 4/SC
+ 1028 0531 PowerEdge Expandable RAID Controller 4/QC
+1001 Kolter Electronic
+ 0010 PCI 1616 Measurement card with 32 digital I/O lines
+ 0011 OPTO-PCI Opto-Isolated digital I/O board
+ 0012 PCI-AD/DA Analogue I/O board
+ 0013 PCI-OPTO-RELAIS Digital I/O board with relay outputs
+ 0014 PCI-Counter/Timer Counter Timer board
+ 0015 PCI-DAC416 Analogue output board
+ 0016 PCI-MFB Analogue I/O board
+ 0017 PROTO-3 PCI Prototyping board
+ 9100 INI-9100/9100W SCSI Host
+1002 ATI Technologies Inc
+# New support forthcoming in XFree86 4.3.0
+ 4144 Radeon R300 AD [Radeon 9500 Pro]
+# New support forthcoming in XFree86 4.3.0
+ 4145 Radeon R300 AE [Radeon 9500 Pro]
+# New support forthcoming in XFree86 4.3.0
+ 4146 Radeon R300 AF [Radeon 9500 Pro]
+# Update: Oops, AF was a typo above for 4147, should be AG
+ 4147 Radeon R300 AG [FireGL Z1/X1]
+ 4158 68800AX [Mach32]
+ 4242 Radeon R200 BB [Radeon All in Wonder 8500DV]
+ 1002 02aa Radeon 8500 AIW DV Edition
+ 4336 Radeon Mobility U1
+ 4337 Radeon IGP 340M
+ 4354 215CT [Mach64 CT]
+ 4358 210888CX [Mach64 CX]
+ 4554 210888ET [Mach64 ET]
+ 4654 Mach64 VT
+ 4742 3D Rage Pro AGP 1X/2X
+ 1002 0040 Rage Pro Turbo AGP 2X
+ 1002 0044 Rage Pro Turbo AGP 2X
+ 1002 0061 Rage Pro AIW AGP 2X
+ 1002 0062 Rage Pro AIW AGP 2X
+ 1002 0063 Rage Pro AIW AGP 2X
+ 1002 0080 Rage Pro Turbo AGP 2X
+ 1002 0084 Rage Pro Turbo AGP 2X
+ 1002 4742 Rage Pro Turbo AGP 2X
+ 1002 8001 Rage Pro Turbo AGP 2X
+ 1028 0082 Rage Pro Turbo AGP 2X
+ 1028 4082 Optiplex GX1 Onboard Display Adapter
+ 1028 8082 Rage Pro Turbo AGP 2X
+ 1028 c082 Rage Pro Turbo AGP 2X
+ 8086 4152 Xpert 98D AGP 2X
+ 8086 464a Rage Pro Turbo AGP 2X
+ 4744 3D Rage Pro AGP 1X
+ 1002 4744 Rage Pro Turbo AGP
+ 4747 3D Rage Pro
+ 4749 3D Rage Pro
+ 1002 0061 Rage Pro AIW
+ 1002 0062 Rage Pro AIW
+ 474c Rage XC
+ 474d Rage XL AGP 2X
+ 1002 0004 Xpert 98 RXL AGP 2X
+ 1002 0008 Xpert 98 RXL AGP 2X
+ 1002 0080 Rage XL AGP 2X
+ 1002 0084 Xpert 98 AGP 2X
+ 1002 474d Rage XL AGP
+ 1033 806a Rage XL AGP
+ 474e Rage XC AGP
+ 1002 474e Rage XC AGP
+ 474f Rage XL
+ 1002 0008 Rage XL
+ 1002 474f Rage XL
+ 4750 3D Rage Pro 215GP
+ 1002 0040 Rage Pro Turbo
+ 1002 0044 Rage Pro Turbo
+ 1002 0080 Rage Pro Turbo
+ 1002 0084 Rage Pro Turbo
+ 1002 4750 Rage Pro Turbo
+ 4751 3D Rage Pro 215GQ
+ 4752 Rage XL
+ 1002 0008 Rage XL
+ 1002 4752 Rage XL
+ 1002 8008 Rage XL
+ 1028 00d1 PowerEdge 2550
+ 4753 Rage XC
+ 1002 4753 Rage XC
+ 4754 3D Rage I/II 215GT [Mach64 GT]
+ 4755 3D Rage II+ 215GTB [Mach64 GTB]
+ 4756 3D Rage IIC 215IIC [Mach64 GT IIC]
+ 1002 4756 Rage IIC
+ 4757 3D Rage IIC AGP
+ 1002 4757 Rage IIC AGP
+ 1028 0089 Rage 3D IIC
+ 1028 4082 Rage 3D IIC
+ 1028 8082 Rage 3D IIC
+ 1028 c082 Rage 3D IIC
+ 4758 210888GX [Mach64 GX]
+ 4759 3D Rage IIC
+ 475a 3D Rage IIC AGP
+ 1002 0087 Rage 3D IIC
+ 1002 475a Rage IIC AGP
+ 4964 Radeon R250 Id [Radeon 9000]
+ 4965 Radeon R250 Ie [Radeon 9000]
+ 4966 Radeon R250 If [Radeon 9000]
+ 10f1 0002 R250 If [Tachyon G9000 PRO]
+ 148c 2039 R250 If [Radeon 9000 Pro "Evil Commando"]
+ 1509 9a00 R250 If [Radeon 9000 "AT009"]
+# New subdevice - 3D Prophet 9000 PCI by Hercules. AGP version probably would have same ID, so not specified.
+ 1681 0040 R250 If [3D prophet 9000]
+ 174b 7176 R250 If [Sapphire Radeon 9000 Pro]
+ 174b 7192 R250 If [Radeon 9000 "Atlantis"]
+ 17af 2005 R250 If [Excalibur Radeon 9000 Pro]
+ 17af 2006 R250 If [Excalibur Radeon 9000]
+ 4967 Radeon R250 Ig [Radeon 9000]
+ 496e Radeon R250 [Radeon 9000] (Secondary)
+ 4c42 3D Rage LT Pro AGP-133
+ 0e11 b0e8 Rage 3D LT Pro
+ 0e11 b10e 3D Rage LT Pro (Compaq Armada 1750)
+ 1002 0040 Rage LT Pro AGP 2X
+ 1002 0044 Rage LT Pro AGP 2X
+ 1002 4c42 Rage LT Pro AGP 2X
+ 1002 8001 Rage LT Pro AGP 2X
+ 1028 0085 Rage 3D LT Pro
+ 4c44 3D Rage LT Pro AGP-66
+ 4c45 Rage Mobility M3 AGP
+ 4c46 Rage Mobility M3 AGP 2x
+ 4c47 3D Rage LT-G 215LG
+ 4c49 3D Rage LT Pro
+ 1002 0004 Rage LT Pro
+ 1002 0040 Rage LT Pro
+ 1002 0044 Rage LT Pro
+ 1002 4c49 Rage LT Pro
+ 4c4d Rage Mobility P/M AGP 2x
+ 0e11 b111 Armada M700
+ 1002 0084 Xpert 98 AGP 2X (Mobility)
+ 1014 0154 ThinkPad A20m
+ 4c4e Rage Mobility L AGP 2x
+ 4c50 3D Rage LT Pro
+ 1002 4c50 Rage LT Pro
+ 4c51 3D Rage LT Pro
+ 4c52 Rage Mobility P/M
+ 4c53 Rage Mobility L
+ 4c54 264LT [Mach64 LT]
+ 4c57 Radeon Mobility M7 LW [Radeon Mobility 7500]
+ 1014 0517 ThinkPad T30
+ 1028 00e6 Radeon Mobility M7 LW (Dell Inspiron 8100)
+ 144d c006 Radeon Mobility M7 LW in vpr Matrix 170B4
+# Update: More correct labelling for this FireGL chipset
+ 4c58 Radeon RV200 LX [Mobility FireGL 7800 M7]
+ 4c59 Radeon Mobility M6 LY
+ 1014 0235 ThinkPad A30p (2653-64G)
+ 1014 0239 ThinkPad X22/X23/X24
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 4c5a Radeon Mobility M6 LZ
+# Update: Add M9 to product name
+ 4c64 Radeon R250 Ld [Radeon Mobility 9000 M9]
+# Update: Add M9 to product name
+ 4c65 Radeon R250 Le [Radeon Mobility 9000 M9]
+# Update: Add M9 to product name
+ 4c66 Radeon R250 Lf [Radeon Mobility 9000 M9]
+# Update: Add M9 to product name
+ 4c67 Radeon R250 Lg [Radeon Mobility 9000 M9]
+ 4d46 Rage Mobility M4 AGP
+ 4d4c Rage Mobility M4 AGP
+ 4e44 Radeon R300 ND [Radeon 9700]
+ 4e45 Radeon R300 NE [Radeon 9700]
+ 4e46 Radeon R300 NF [Radeon 9700]
+# Update: This is FireGL X1, not Radeon 9700
+ 4e47 Radeon R300 NG [FireGL X1]
+# Update
+ 4e64 Radeon R300 [Radeon 9700 Pro] (Secondary)
+ 4e65 Radeon R300 [Radeon 9700] (Secondary)
+ 4e66 Radeon R300 [Radeon 9700] (Secondary)
+ 4e67 Radeon R300 [FireGL X1] (Secondary)
+ 5041 Rage 128 PA/PRO
+ 5042 Rage 128 PB/PRO AGP 2x
+ 5043 Rage 128 PC/PRO AGP 4x
+ 5044 Rage 128 PD/PRO TMDS
+ 1002 0028 Rage 128 AIW
+ 1002 0029 Rage 128 AIW
+ 5045 Rage 128 PE/PRO AGP 2x TMDS
+ 5046 Rage 128 PF/PRO AGP 4x TMDS
+ 1002 0004 Rage Fury Pro
+ 1002 0008 Rage Fury Pro/Xpert 2000 Pro
+ 1002 0014 Rage Fury Pro
+ 1002 0018 Rage Fury Pro/Xpert 2000 Pro
+ 1002 0028 Rage 128 Pro AIW AGP
+ 1002 002a Rage 128 Pro AIW AGP
+ 1002 0048 Rage Fury Pro
+ 1002 2000 Rage Fury MAXX AGP 4x (TMDS) (VGA device)
+ 1002 2001 Rage Fury MAXX AGP 4x (TMDS) (Extra device?!)
+ 5047 Rage 128 PG/PRO
+ 5048 Rage 128 PH/PRO AGP 2x
+ 5049 Rage 128 PI/PRO AGP 4x
+ 504a Rage 128 PJ/PRO TMDS
+ 504b Rage 128 PK/PRO AGP 2x TMDS
+ 504c Rage 128 PL/PRO AGP 4x TMDS
+ 504d Rage 128 PM/PRO
+ 504e Rage 128 PN/PRO AGP 2x
+ 504f Rage 128 PO/PRO AGP 4x
+ 5050 Rage 128 PP/PRO TMDS [Xpert 128]
+ 1002 0008 Xpert 128
+ 5051 Rage 128 PQ/PRO AGP 2x TMDS
+ 5052 Rage 128 PR/PRO AGP 4x TMDS
+ 5053 Rage 128 PS/PRO
+ 5054 Rage 128 PT/PRO AGP 2x
+ 5055 Rage 128 PU/PRO AGP 4x
+ 5056 Rage 128 PV/PRO TMDS
+ 5057 Rage 128 PW/PRO AGP 2x TMDS
+ 5058 Rage 128 PX/PRO AGP 4x TMDS
+# Update: This same chip is used in all 32Mb and 64Mb SDR/DDR orig Radeons, and is now known as 7200
+ 5144 Radeon R100 QD [Radeon 7200]
+ 1002 0008 Radeon 7000/Radeon VE
+ 1002 0009 Radeon 7000/Radeon
+ 1002 000a Radeon 7000/Radeon
+ 1002 001a Radeon 7000/Radeon
+ 1002 0029 Radeon AIW
+ 1002 0038 Radeon 7000/Radeon
+ 1002 0039 Radeon 7000/Radeon
+ 1002 008a Radeon 7000/Radeon
+ 1002 00ba Radeon 7000/Radeon
+ 1002 0139 Radeon 7000/Radeon
+ 1002 028a Radeon 7000/Radeon
+ 1002 02aa Radeon AIW
+ 1002 053a Radeon 7000/Radeon
+ 5145 Radeon R100 QE
+ 5146 Radeon R100 QF
+ 5147 Radeon R100 QG
+ 5148 Radeon R200 QH [Radeon 8500]
+ 1002 010a FireGL 8800 64Mb
+ 1002 0152 FireGL 8800 128Mb
+ 1002 0162 FireGL 8700 32Mb
+ 1002 0172 FireGL 8700 64Mb
+ 5149 Radeon R200 QI
+ 514a Radeon R200 QJ
+ 514b Radeon R200 QK
+ 514c Radeon R200 QL [Radeon 8500 LE]
+ 1002 003a Radeon R200 QL [Radeon 8500 LE]
+ 1002 013a Radeon 8500
+ 148c 2026 R200 QL [Radeon 8500 Evil Master II Multi Display Edition]
+ 174b 7149 Radeon R200 QL [Sapphire Radeon 8500 LE]
+# New: Radeon 9100 is basically a Radeon 8500LE branded as 9100 by Sapphire
+ 514d Radeon R200 QM [Radeon 9100]
+# New: Radeon 8500LE chip
+ 514e Radeon R200 QN [Radeon 8500LE]
+# New: Radeon 8500LE chip
+ 514f Radeon R200 QO [Radeon 8500LE]
+ 5157 Radeon RV200 QW [Radeon 7500]
+ 1002 013a Radeon 7500
+ 1458 4000 RV200 QW [RADEON 7500 PRO MAYA AR]
+ 148c 2024 RV200 QW [Radeon 7500LE Dual Display]
+ 148c 2025 RV200 QW [Radeon 7500 Evil Master Multi Display Edition]
+ 148c 2036 RV200 QW [Radeon 7500 PCI Dual Display]
+ 174b 7147 RV200 QW [Sapphire Radeon 7500LE]
+ 174b 7161 Radeon RV200 QW [Radeon 7500 LE]
+ 17af 0202 RV200 QW [Excalibur Radeon 7500LE]
+ 5158 Radeon RV200 QX [Radeon 7500]
+# Update: More correct name
+ 5159 Radeon RV100 QY [Radeon 7000/VE]
+ 1002 000a Radeon 7000/Radeon VE
+ 1002 000b Radeon 7000
+ 1002 0038 Radeon 7000/Radeon VE
+ 1002 003a Radeon 7000/Radeon VE
+ 1002 00ba Radeon 7000/Radeon VE
+ 1002 013a Radeon 7000/Radeon VE
+ 1458 4002 RV100 QY [RADEON 7000 PRO MAYA AV Series]
+ 148c 2003 RV100 QY [Radeon 7000 Multi-Display Edition]
+ 148c 2023 RV100 QY [Radeon 7000 Evil Master Multi-Display]
+ 174b 7112 RV100 QY [Sapphire Radeon VE 7000]
+ 1787 0202 RV100 QY [Excalibur Radeon 7000]
+# Update: More correct name
+ 515a Radeon RV100 QZ [Radeon 7000/VE]
+ 5168 Radeon R200 Qh
+ 5169 Radeon R200 Qi
+ 516a Radeon R200 Qj
+ 516b Radeon R200 Qk
+# new: This one is not in ATI documentation, but is in XFree86 source code
+ 516c Radeon R200 Ql
+ 5245 Rage 128 RE/SG
+ 1002 0008 Xpert 128
+ 1002 0028 Rage 128 AIW
+ 1002 0029 Rage 128 AIW
+ 1002 0068 Rage 128 AIW
+ 5246 Rage 128 RF/SG AGP
+ 1002 0004 Magnum/Xpert 128/Xpert 99
+ 1002 0008 Magnum/Xpert128/X99/Xpert2000
+ 1002 0028 Rage 128 AIW AGP
+ 1002 0044 Rage Fury/Xpert 128/Xpert 2000
+ 1002 0068 Rage 128 AIW AGP
+ 1002 0448 Rage Fury
+ 5247 Rage 128 RG
+ 524b Rage 128 RK/VR
+ 524c Rage 128 RL/VR AGP
+ 1002 0008 Xpert 99/Xpert 2000
+ 1002 0088 Xpert 99
+ 5345 Rage 128 SE/4x
+ 5346 Rage 128 SF/4x AGP 2x
+ 5347 Rage 128 SG/4x AGP 4x
+ 5348 Rage 128 SH
+ 534b Rage 128 SK/4x
+ 534c Rage 128 SL/4x AGP 2x
+ 534d Rage 128 SM/4x AGP 4x
+ 1002 0008 Xpert 99/Xpert 2000
+ 1002 0018 Xpert 2000
+ 534e Rage 128 4x
+ 5354 Mach 64 VT
+ 1002 5654 Mach 64 reference
+ 5446 Rage 128 Pro Ultra TF
+ 1002 0004 Rage Fury Pro
+ 1002 0008 Rage Fury Pro/Xpert 2000 Pro
+ 1002 0018 Rage Fury Pro/Xpert 2000 Pro
+ 1002 0028 Rage 128 AIW Pro AGP
+ 1002 0029 Rage 128 AIW
+ 1002 002a Rage 128 AIW Pro AGP
+ 1002 002b Rage 128 AIW
+ 1002 0048 Xpert 2000 Pro
+ 544c Rage 128 Pro Ultra TL
+ 5452 Rage 128 Pro Ultra TR
+ 1002 001c Rage 128 Pro 4XL
+ 103c 1279 Rage 128 Pro 4XL
+ 5453 Rage 128 Pro Ultra TS
+ 5454 Rage 128 Pro Ultra TT
+ 5455 Rage 128 Pro Ultra TU
+ 5654 264VT [Mach64 VT]
+ 1002 5654 Mach64VT Reference
+ 5655 264VT3 [Mach64 VT3]
+ 5656 264VT4 [Mach64 VT4]
+ 700f U1/A3 AGP Bridge [IGP 320M]
+1003 ULSI Systems
+ 0201 US201
+1004 VLSI Technology Inc
+ 0005 82C592-FC1
+ 0006 82C593-FC1
+ 0007 82C594-AFC2
+ 0008 82C596/7 [Wildcat]
+ 0009 82C597-AFC2
+ 000c 82C541 [Lynx]
+ 000d 82C543 [Lynx]
+ 0101 82C532
+ 0102 82C534 [Eagle]
+ 0103 82C538
+ 0104 82C535
+ 0105 82C147
+ 0200 82C975
+ 0280 82C925
+ 0304 QSound ThunderBird PCI Audio
+ 1004 0304 QSound ThunderBird PCI Audio
+ 122d 1206 DSP368 Audio
+ 1483 5020 XWave Thunder 3D Audio
+ 0305 QSound ThunderBird PCI Audio Gameport
+ 1004 0305 QSound ThunderBird PCI Audio Gameport
+ 122d 1207 DSP368 Audio Gameport
+ 1483 5021 XWave Thunder 3D Audio Gameport
+ 0306 QSound ThunderBird PCI Audio Support Registers
+ 1004 0306 QSound ThunderBird PCI Audio Support Registers
+ 122d 1208 DSP368 Audio Support Registers
+ 1483 5022 XWave Thunder 3D Audio Support Registers
+ 0307 Thunderbird
+ 0308 Thunderbird
+ 0702 VAS96011 [Golden Gate II]
+ 0703 Tollgate
+1005 Avance Logic Inc. [ALI]
+ 2064 ALG2032/2064
+ 2128 ALG2364A
+ 2301 ALG2301
+ 2302 ALG2302
+ 2364 ALG2364
+ 2464 ALG2364A
+ 2501 ALG2564A/25128A
+1006 Reply Group
+1007 NetFrame Systems Inc
+1008 Epson
+100a Phoenix Technologies
+100b National Semiconductor Corporation
+ 0001 DP83810
+ 0002 87415/87560 IDE
+ 000e 87560 Legacy I/O
+ 000f FireWire Controller
+ 0011 NS87560 National PCI System I/O
+ 0012 USB Controller
+ 0020 DP83815 (MacPhyter) Ethernet Controller
+ 0022 DP83820 10/100/1000 Ethernet Controller
+ 0500 SCx200 Bridge
+ 0501 SCx200 SMI
+ 0502 SCx200 IDE
+ 0503 SCx200 Audio
+ 0504 SCx200 Video
+ 0505 SCx200 XBus
+ d001 87410 IDE
+100c Tseng Labs Inc
+ 3202 ET4000/W32p rev A
+ 3205 ET4000/W32p rev B
+ 3206 ET4000/W32p rev C
+ 3207 ET4000/W32p rev D
+ 3208 ET6000
+ 4702 ET6300
+100d AST Research Inc
+100e Weitek
+ 9000 P9000 Viper
+ 9001 P9000 Viper
+ 9002 P9000 Viper
+ 9100 P9100 Viper Pro/SE
+1010 Video Logic, Ltd.
+1011 Digital Equipment Corporation
+ 0001 DECchip 21050
+ 0002 DECchip 21040 [Tulip]
+ 0004 DECchip 21030 [TGA]
+ 0007 NVRAM [Zephyr NVRAM]
+ 0008 KZPSA [KZPSA]
+ 0009 DECchip 21140 [FasterNet]
+ 1025 0310 21140 Fast Ethernet
+ 10b8 2001 SMC9332BDT EtherPower 10/100
+ 10b8 2002 SMC9332BVT EtherPower T4 10/100
+ 10b8 2003 SMC9334BDT EtherPower 10/100 (1-port)
+ 1109 2400 ANA-6944A/TX Fast Ethernet
+ 1112 2300 RNS2300 Fast Ethernet
+ 1112 2320 RNS2320 Fast Ethernet
+ 1112 2340 RNS2340 Fast Ethernet
+ 1113 1207 EN-1207-TX Fast Ethernet
+ 1186 1100 DFE-500TX Fast Ethernet
+ 1186 1112 DFE-570TX Fast Ethernet
+ 1186 1140 DFE-660 Cardbus Ethernet 10/100
+ 1186 1142 DFE-660 Cardbus Ethernet 10/100
+ 11f6 0503 Freedomline Fast Ethernet
+ 1282 9100 AEF-380TXD Fast Ethernet
+ 1385 1100 FA310TX Fast Ethernet
+ 2646 0001 KNE100TX Fast Ethernet
+ 000a 21230 Video Codec
+ 000d PBXGB [TGA2]
+ 000f DEFPA
+ 0014 DECchip 21041 [Tulip Pass 3]
+ 1186 0100 DE-530+
+ 0016 DGLPB [OPPO]
+ 0019 DECchip 21142/43
+ 1011 500a DE500A Fast Ethernet
+ 1011 500b DE500B Fast Ethernet
+ 1014 0001 10/100 EtherJet Cardbus
+ 1025 0315 ALN315 Fast Ethernet
+ 1033 800c PC-9821-CS01 100BASE-TX Interface Card
+ 1033 800d PC-9821NR-B06 100BASE-TX Interface Card
+ 108d 0016 Rapidfire 2327 10/100 Ethernet
+ 108d 0017 GoCard 2250 Ethernet 10/100 Cardbus
+ 10b8 2005 SMC8032DT Extreme Ethernet 10/100
+ 10b8 8034 SMC8034 Extreme Ethernet 10/100
+ 10ef 8169 Cardbus Fast Ethernet
+ 1109 2a00 ANA-6911A/TX Fast Ethernet
+ 1109 2b00 ANA-6911A/TXC Fast Ethernet
+ 1109 3000 ANA-6922/TX Fast Ethernet
+ 1113 1207 Cheetah Fast Ethernet
+ 1113 2220 Cardbus Fast Ethernet
+ 115d 0002 Cardbus Ethernet 10/100
+ 1179 0203 Fast Ethernet
+ 1179 0204 Cardbus Fast Ethernet
+ 1186 1100 DFE-500TX Fast Ethernet
+ 1186 1101 DFE-500TX Fast Ethernet
+ 1186 1102 DFE-500TX Fast Ethernet
+ 1259 2800 AT-2800Tx Fast Ethernet
+ 1266 0004 Eagle Fast EtherMAX
+ 12af 0019 NetFlyer Cardbus Fast Ethernet
+ 1374 0001 Cardbus Ethernet Card 10/100
+ 1374 0002 Cardbus Ethernet Card 10/100
+ 1374 0007 Cardbus Ethernet Card 10/100
+ 1374 0008 Cardbus Ethernet Card 10/100
+ 1385 2100 FA510
+ 1395 0001 10/100 Ethernet CardBus PC Card
+ 13d1 ab01 EtherFast 10/100 Cardbus (PCMPC200)
+ 8086 0001 EtherExpress PRO/100 Mobile CardBus 32
+ 001a Farallon PN9000SX
+ 0021 DECchip 21052
+ 0022 DECchip 21150
+ 0023 DECchip 21150
+ 0024 DECchip 21152
+ 0025 DECchip 21153
+ 0026 DECchip 21154
+ 0034 56k Modem Cardbus
+ 1374 0003 56k Modem Cardbus
+ 0045 DECchip 21553
+ 0046 DECchip 21554
+ 0e11 4050 Integrated Smart Array
+ 0e11 4051 Integrated Smart Array
+ 0e11 4058 Integrated Smart Array
+ 103c 10c2 Hewlett-Packard NetRAID-4M
+ 12d9 000a VoIP PCI Gateway
+ 9005 0365 Adaptec 5400S
+ 9005 1364 Dell PowerEdge RAID Controller 2
+ 9005 1365 Dell PowerEdge RAID Controller 2
+ e4bf 1000 CC8-1-BLUES
+ 1065 StrongARM DC21285
+ 1069 0020 DAC960P / DAC1164P
+1012 Micronics Computers Inc
+1013 Cirrus Logic
+ 0038 GD 7548
+ 0040 GD 7555 Flat Panel GUI Accelerator
+ 004c GD 7556 Video/Graphics LCD/CRT Ctrlr
+ 00a0 GD 5430/40 [Alpine]
+ 00a2 GD 5432 [Alpine]
+ 00a4 GD 5434-4 [Alpine]
+ 00a8 GD 5434-8 [Alpine]
+ 00ac GD 5436 [Alpine]
+ 00b0 GD 5440
+ 00b8 GD 5446
+ 00bc GD 5480
+ 1013 00bc CL-GD5480
+ 00d0 GD 5462
+ 00d2 GD 5462 [Laguna I]
+ 00d4 GD 5464 [Laguna]
+ 00d5 GD 5464 BD [Laguna]
+ 00d6 GD 5465 [Laguna]
+ 13ce 8031 Barco Metheus 2 Megapixel, Dual Head
+ 13cf 8031 Barco Metheus 2 Megapixel, Dual Head
+ 00e8 GD 5436U
+ 1100 CL 6729
+ 1110 PD 6832 PCMCIA/CardBus Ctrlr
+ 1112 PD 6834 PCMCIA/CardBus Ctrlr
+ 1113 PD 6833 PCMCIA/CardBus Ctrlr
+ 1200 GD 7542 [Nordic]
+ 1202 GD 7543 [Viking]
+ 1204 GD 7541 [Nordic Light]
+ 4400 CD 4400
+ 6001 CS 4610/11 [CrystalClear SoundFusion Audio Accelerator]
+ 1014 1010 CS4610 SoundFusion Audio Accelerator
+ 6003 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]
+ 1013 4280 Crystal SoundFusion PCI Audio Accelerator
+ 1681 0050 Game Theater XP
+ 1681 a011 Fortissimo III 7.1
+ 6004 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]
+ 6005 Crystal CS4281 PCI Audio
+ 1013 4281 Crystal CS4281 PCI Audio
+ 10cf 10a8 Crystal CS4281 PCI Audio
+ 10cf 10a9 Crystal CS4281 PCI Audio
+ 10cf 10aa Crystal CS4281 PCI Audio
+ 10cf 10ab Crystal CS4281 PCI Audio
+ 10cf 10ac Crystal CS4281 PCI Audio
+ 10cf 10ad Crystal CS4281 PCI Audio
+ 10cf 10b4 Crystal CS4281 PCI Audio
+ 1179 0001 Crystal CS4281 PCI Audio
+ 14c0 000c Crystal CS4281 PCI Audio
+1014 IBM
+ 0002 PCI to MCA Bridge
+ 0005 Alta Lite
+ 0007 Alta MP
+ 000a Fire Coral
+ 0017 CPU to PCI Bridge
+ 0018 TR Auto LANstreamer
+ 001b GXT-150P
+ 001c Carrera
+ 001d 82G2675
+ 0020 MCA
+ 0022 IBM27-82351
+ 002d Python
+ 002e ServeRAID Controller
+ 1014 002e ServeRAID-3x
+ 1014 022e ServeRAID-4H
+ 0036 Miami
+ 003a CPU to PCI Bridge
+ 003e 16/4 Token ring UTP/STP controller
+ 1014 003e Token-Ring Adapter
+ 1014 00cd Token-Ring Adapter + Wake-On-LAN
+ 1014 00ce 16/4 Token-Ring Adapter 2
+ 1014 00cf 16/4 Token-Ring Adapter Special
+ 1014 00e4 High-Speed 100/16/4 Token-Ring Adapter
+ 1014 00e5 16/4 Token-Ring Adapter 2 + Wake-On-LAN
+ 1014 016d iSeries 2744 Card
+ 0045 SSA Adapter
+ 0046 MPIC interrupt controller
+ 0047 PCI to PCI Bridge
+ 0048 PCI to PCI Bridge
+ 0049 Warhead SCSI Controller
+ 004e ATM Controller (14104e00)
+ 004f ATM Controller (14104f00)
+ 0050 ATM Controller (14105000)
+ 0053 25 MBit ATM Controller
+ 0057 MPEG PCI Bridge
+ 005c i82557B 10/100
+ 007c ATM Controller (14107c00)
+ 007d 3780IDSP [MWave]
+ 0090 GXT 3000P
+ 1014 008e GXT-3000P
+ 0095 20H2999 PCI Docking Bridge
+ 0096 Chukar chipset SCSI controller
+ 1014 0097 iSeries 2778 DASD IOA
+ 1014 0098 iSeries 2763 DASD IOA
+ 1014 0099 iSeries 2748 DASD IOA
+ 00a5 ATM Controller (1410a500)
+ 00a6 ATM 155MBPS MM Controller (1410a600)
+ 00b7 256-bit Graphics Rasterizer [Fire GL1]
+ 00be ATM 622MBPS Controller (1410be00)
+ 00dc Advanced Systems Management Adapter (ASMA)
+ 00fc CPC710 Dual Bridge and Memory Controller (PCI-64)
+ 0105 CPC710 Dual Bridge and Memory Controller (PCI-32)
+ 010f Remote Supervisor Adapter (RSA)
+ 0142 Yotta Video Compositor Input
+ 1014 0143 Yotta Input Controller (ytin)
+ 0144 Yotta Video Compositor Output
+ 1014 0145 Yotta Output Controller (ytout)
+ 0156 405GP PLB to PCI Bridge
+ 01a7 PCI-X to PCI-X Bridge
+ 01bd ServeRAID Controller
+ 1014 01be ServeRAID-4M
+ 1014 01bf ServeRAID-4L
+ 1014 0208 ServeRAID-4Mx
+ 1014 020e ServeRAID-4Lx
+ 1014 022e ServeRAID-4H
+ 1014 0258 ServeRAID-5i
+ 1014 0259 ServeRAID-5i
+ 0302 XA-32 chipset [Summit]
+ ffff MPIC-2 interrupt controller
+1015 LSI Logic Corp of Canada
+1016 ICL Personal Systems
+1017 SPEA Software AG
+ 5343 SPEA 3D Accelerator
+1018 Unisys Systems
+1019 Elitegroup Computer Systems
+101a AT&T GIS (NCR)
+ 0005 100VG ethernet
+101b Vitesse Semiconductor
+101c Western Digital
+ 0193 33C193A
+ 0196 33C196A
+ 0197 33C197A
+ 0296 33C296A
+ 3193 7193
+ 3197 7197
+ 3296 33C296A
+ 4296 34C296
+ 9710 Pipeline 9710
+ 9712 Pipeline 9712
+ c24a 90C
+101e American Megatrends Inc.
+ 1960 MegaRAID
+ 101e 0471 MegaRAID 471 Enterprise 1600 RAID Controller
+ 101e 0475 MegaRAID 475 Express 500 RAID Controller
+ 101e 0493 MegaRAID 493 Elite 1600 RAID Controller
+ 1028 0471 PowerEdge RAID Controller 3/QC
+ 1028 0475 PowerEdge RAID Controller 3/SC
+ 1028 0493 PowerEdge RAID Controller 3/DC
+ 1028 0511 PowerEdge Cost Effective RAID Controller ATA100/4Ch
+ 9010 MegaRAID 428 Ultra RAID Controller
+ 9030 EIDE Controller
+ 9031 EIDE Controller
+ 9032 EIDE & SCSI Controller
+ 9033 SCSI Controller
+ 9040 Multimedia card
+ 9060 MegaRAID 434 Ultra GT RAID Controller
+ 9063 MegaRAC
+ 101e 0767 Dell Remote Assistant Card 2
+101f PictureTel
+1020 Hitachi Computer Products
+1021 OKI Electric Industry Co. Ltd.
+1022 Advanced Micro Devices [AMD]
+ 1100 K8 NorthBridge
+ 1101 K8 NorthBridge
+ 1102 K8 NorthBridge
+ 1103 K8 NorthBridge
+ 2000 79c970 [PCnet32 LANCE]
+ 1014 2000 NetFinity 10/100 Fast Ethernet
+ 103c 104c Ethernet with LAN remote power Adapter
+ 103c 1064 Ethernet with LAN remote power Adapter
+ 103c 1065 Ethernet with LAN remote power Adapter
+ 103c 106c Ethernet with LAN remote power Adapter
+ 103c 106e Ethernet with LAN remote power Adapter
+ 103c 10ea Ethernet with LAN remote power Adapter
+ 1113 1220 EN1220 10/100 Fast Ethernet
+ 1259 2450 AT-2450 10/100 Fast Ethernet
+ 1259 2454 AT-2450v4 10Mb Ethernet Adapter
+ 1259 2700 AT-2700TX 10/100 Fast Ethernet
+ 1259 2701 AT-2700FX 100Mb Ethernet
+ 2001 79c978 [HomePNA]
+ 1092 0a78 Multimedia Home Network Adapter
+ 1668 0299 ActionLink Home Network Adapter
+ 2020 53c974 [PCscsi]
+ 2040 79c974
+ 3000 ELanSC520 Microcontroller
+ 7006 AMD-751 [Irongate] System Controller
+ 7007 AMD-751 [Irongate] AGP Bridge
+ 700c AMD-760 MP [IGD4-2P] System Controller
+ 700d AMD-760 MP [IGD4-2P] AGP Bridge
+ 700e AMD-760 [IGD4-1P] System Controller
+ 700f AMD-760 [IGD4-1P] AGP Bridge
+ 7400 AMD-755 [Cobra] ISA
+ 7401 AMD-755 [Cobra] IDE
+ 7403 AMD-755 [Cobra] ACPI
+ 7404 AMD-755 [Cobra] USB
+ 7408 AMD-756 [Viper] ISA
+ 7409 AMD-756 [Viper] IDE
+ 740b AMD-756 [Viper] ACPI
+ 740c AMD-756 [Viper] USB
+ 7410 AMD-766 [ViperPlus] ISA
+ 7411 AMD-766 [ViperPlus] IDE
+ 7413 AMD-766 [ViperPlus] ACPI
+ 7414 AMD-766 [ViperPlus] USB
+ 7440 AMD-768 [Opus] ISA
+ 1043 8044 A7M-D Mainboard
+ 7441 AMD-768 [Opus] IDE
+ 7443 AMD-768 [Opus] ACPI
+ 1043 8044 A7M-D Mainboard
+ 7445 AMD-768 [Opus] Audio
+ 7446 AMD-768 [Opus] MC97 Modem (Smart Link HAMR5600 compatible)
+ 7448 AMD-768 [Opus] PCI
+ 7449 AMD-768 [Opus] USB
+ 7450 AMD-8131 PCI-X Bridge
+ 7451 AMD-8131 PCI-X APIC
+ 7454 AMD-8151 System Controller
+ 7455 AMD-8151 AGP Bridge
+ 7460 AMD-8111 PCI
+ 7461 AMD-8111 USB
+ 7462 AMD-8111 Ethernet
+ 7464 AMD-8111 USB
+ 7468 AMD-8111 LPC
+ 7469 AMD-8111 IDE
+ 746a AMD-8111 SMBus 2.0
+ 746b AMD-8111 ACPI
+ 746d AMD-8111 AC97 Audio
+ 746e AMD-8111 MC97 Modem
+1023 Trident Microsystems
+ 0194 82C194
+ 2000 4DWave DX
+ 2001 4DWave NX
+ 8400 CyberBlade/i7
+ 1023 8400 CyberBlade i7 AGP
+ 8420 CyberBlade/i7d
+ 0e11 b15a CyberBlade i7 AGP
+ 8500 CyberBlade/i1
+ 8520 CyberBlade i1
+ 0e11 b16e CyberBlade i1 AGP
+ 1023 8520 CyberBlade i1 AGP
+ 8620 CyberBlade/i1
+ 1014 0502 ThinkPad T30
+ 8820 CyberBlade XPAi1
+ 9320 TGUI 9320
+ 9350 GUI Accelerator
+ 9360 Flat panel GUI Accelerator
+ 9382 Cyber 9382 [Reference design]
+ 9383 Cyber 9383 [Reference design]
+ 9385 Cyber 9385 [Reference design]
+ 9386 Cyber 9386
+ 9388 Cyber 9388
+ 9397 Cyber 9397
+ 939a Cyber 9397DVD
+ 9420 TGUI 9420
+ 9430 TGUI 9430
+ 9440 TGUI 9440
+ 9460 TGUI 9460
+ 9470 TGUI 9470
+ 9520 Cyber 9520
+ 9525 Cyber 9525
+ 10cf 1094 Lifebook C6155
+ 9540 Cyber 9540
+ 9660 TGUI 9660/938x/968x
+ 9680 TGUI 9680
+ 9682 TGUI 9682
+ 9683 TGUI 9683
+ 9685 ProVIDIA 9685
+ 9750 3DImage 9750
+ 1014 9750 3DImage 9750
+ 1023 9750 3DImage 9750
+ 9753 TGUI 9753
+ 9754 TGUI 9754
+ 9759 TGUI 975
+ 9783 TGUI 9783
+ 9785 TGUI 9785
+ 9850 3DImage 9850
+ 9880 Blade 3D PCI/AGP
+ 1023 9880 Blade 3D
+ 9910 CyberBlade/XP
+ 9930 CyberBlade/XPm
+1024 Zenith Data Systems
+1025 Acer Incorporated [ALI]
+ 1435 M1435
+ 1445 M1445
+ 1449 M1449
+ 1451 M1451
+ 1461 M1461
+ 1489 M1489
+ 1511 M1511
+ 1512 ALI M1512 Aladdin
+ 1513 M1513
+ 1521 ALI M1521 Aladdin III CPU Bridge
+ 10b9 1521 ALI M1521 Aladdin III CPU Bridge
+ 1523 ALI M1523 ISA Bridge
+ 10b9 1523 ALI M1523 ISA Bridge
+ 1531 M1531 Northbridge [Aladdin IV/IV+]
+ 1533 M1533 PCI-to-ISA Bridge
+ 10b9 1533 ALI M1533 Aladdin IV/V ISA South Bridge
+ 1535 M1535 PCI Bridge + Super I/O + FIR
+ 1541 M1541 Northbridge [Aladdin V]
+ 10b9 1541 ALI M1541 Aladdin V/V+ AGP+PCI North Bridge
+ 1542 M1542 Northbridge [Aladdin V]
+ 1543 M1543 PCI-to-ISA Bridge + Super I/O + FIR
+ 1561 M1561 Northbridge [Aladdin 7]
+ 1621 M1621 Northbridge [Aladdin-Pro II]
+ 1631 M1631 Northbridge+3D Graphics [Aladdin TNT2]
+ 1641 M1641 Northbridge [Aladdin-Pro IV]
+ 1647 M1647 [MaGiK1] PCI North Bridge
+ 3141 M3141
+ 3143 M3143
+ 3145 M3145
+ 3147 M3147
+ 3149 M3149
+ 3151 M3151
+ 3307 M3307 MPEG-I Video Controller
+ 3309 M3309 MPEG-II Video w/ Software Audio Decoder
+ 3321 M3321 MPEG-II Audio/Video Decoder
+ 5212 M4803
+ 5215 ALI PCI EIDE Controller
+ 5217 M5217H
+ 5219 M5219
+ 5225 M5225
+ 5229 M5229
+ 5235 M5235
+ 5237 M5237 PCI USB Host Controller
+ 5240 EIDE Controller
+ 5241 PCMCIA Bridge
+ 5242 General Purpose Controller
+ 5243 PCI to PCI Bridge Controller
+ 5244 Floppy Disk Controller
+ 5247 M1541 PCI to PCI Bridge
+ 5251 M5251 P1394 Controller
+ 5427 PCI to AGP Bridge
+ 5451 M5451 PCI AC-Link Controller Audio Device
+ 5453 M5453 PCI AC-Link Controller Modem Device
+ 7101 M7101 PCI PMU Power Management Controller
+ 10b9 7101 M7101 PCI PMU Power Management Controller
+1028 Dell Computer Corporation
+ 0001 PowerEdge Expandable RAID Controller 2/Si
+ 1028 0001 PowerEdge Expandable RAID Controller 2/Si
+ 0002 PowerEdge Expandable RAID Controller 3
+ 1028 0002 PowerEdge Expandable RAID Controller 3/Di
+ 1028 00d1 PowerEdge Expandable RAID Controller 3/Di
+ 1028 00d9 PowerEdge Expandable RAID Controller 3/Di
+ 0003 PowerEdge Expandable RAID Controller 3/Si
+ 1028 0003 PowerEdge Expandable RAID Controller 3/Si
+ 0004 PowerEdge Expandable RAID Controller 3/Si
+ 1028 00d0 PowerEdge Expandable RAID Controller 3/Si
+ 0005 PowerEdge Expandable RAID Controller 3/Di
+ 0006 PowerEdge Expandable RAID Controller 3/Di
+ 0007 Remote Assistant Card 3
+ 0008 PowerEdge Expandable RAID Controller 3/Di
+ 000a PowerEdge Expandable RAID Controller 3
+ 1028 0106 PowerEdge Expandable RAID Controller 3/Di
+ 1028 011b PowerEdge Expandable RAID Controller 3/Di
+ 1028 0121 PowerEdge Expandable RAID Controller 3/Di
+ 000c Embedded Systems Management Device 4
+ 000e PowerEdge Expandable RAID Controller
+ 000f PowerEdge Expandable RAID Controller 4/Di
+1029 Siemens Nixdorf IS
+102a LSI Logic
+ 0000 HYDRA
+ 0010 ASPEN
+102b Matrox Graphics, Inc.
+# DJ: I've a suspicion that 0010 is a duplicate of 0d10.
+ 0010 MGA-I [Impression?]
+ 0518 MGA-II [Athena]
+ 0519 MGA 2064W [Millennium]
+ 051a MGA 1064SG [Mystique]
+ 102b 0100 MGA-1064SG Mystique
+ 102b 1100 MGA-1084SG Mystique
+ 102b 1200 MGA-1084SG Mystique
+ 1100 102b MGA-1084SG Mystique
+ 110a 0018 Scenic Pro C5 (D1025)
+ 051b MGA 2164W [Millennium II]
+ 102b 051b MGA-2164W Millennium II
+ 102b 1100 MGA-2164W Millennium II
+ 102b 1200 MGA-2164W Millennium II
+ 051e MGA 1064SG [Mystique] AGP
+ 051f MGA 2164W [Millennium II] AGP
+ 0520 MGA G200
+ 102b dbc2 G200 Multi-Monitor
+ 102b dbc8 G200 Multi-Monitor
+ 102b dbe2 G200 Multi-Monitor
+ 102b dbe8 G200 Multi-Monitor
+ 102b ff03 Millennium G200 SD
+ 102b ff04 Marvel G200
+ 0521 MGA G200 AGP
+ 1014 ff03 Millennium G200 AGP
+ 102b 48e9 Mystique G200 AGP
+ 102b 48f8 Millennium G200 SD AGP
+ 102b 4a60 Millennium G200 LE AGP
+ 102b 4a64 Millennium G200 AGP
+ 102b c93c Millennium G200 AGP
+ 102b c9b0 Millennium G200 AGP
+ 102b c9bc Millennium G200 AGP
+ 102b ca60 Millennium G250 LE AGP
+ 102b ca6c Millennium G250 AGP
+ 102b dbbc Millennium G200 AGP
+ 102b dbc2 Millennium G200 MMS (Dual G200)
+ 102b dbc3 G200 Multi-Monitor
+ 102b dbc8 Millennium G200 MMS (Dual G200)
+ 102b dbd2 G200 Multi-Monitor
+ 102b dbd3 G200 Multi-Monitor
+ 102b dbd4 G200 Multi-Monitor
+ 102b dbd5 G200 Multi-Monitor
+ 102b dbd8 G200 Multi-Monitor
+ 102b dbd9 G200 Multi-Monitor
+ 102b dbe2 Millennium G200 MMS (Quad G200)
+ 102b dbe3 G200 Multi-Monitor
+ 102b dbe8 Millennium G200 MMS (Quad G200)
+ 102b dbf2 G200 Multi-Monitor
+ 102b dbf3 G200 Multi-Monitor
+ 102b dbf4 G200 Multi-Monitor
+ 102b dbf5 G200 Multi-Monitor
+ 102b dbf8 G200 Multi-Monitor
+ 102b dbf9 G200 Multi-Monitor
+ 102b f806 Mystique G200 Video AGP
+ 102b ff00 MGA-G200 AGP
+ 102b ff02 Mystique G200 AGP
+ 102b ff03 Millennium G200 AGP
+ 102b ff04 Marvel G200 AGP
+ 110a 0032 MGA-G200 AGP
+ 0525 MGA G400 AGP
+ 0e11 b16f MGA-G400 AGP
+ 102b 0328 Millennium G400 16Mb SDRAM
+ 102b 0338 Millennium G400 16Mb SDRAM
+ 102b 0378 Millennium G400 32Mb SDRAM
+ 102b 0541 Millennium G450 Dual Head
+ 102b 0542 Millennium G450 Dual Head LX
+ 102b 0543 Millennium G450 Single Head LX
+ 102b 0641 Millennium G450 32Mb SDRAM Dual Head
+ 102b 0642 Millennium G450 32Mb SDRAM Dual Head LX
+ 102b 0643 Millennium G450 32Mb SDRAM Single Head LX
+ 102b 07c0 Millennium G450 Dual Head LE
+ 102b 07c1 Millennium G450 SDR Dual Head LE
+ 102b 0d41 Millennium G450 Dual Head PCI
+ 102b 0d42 Millennium G450 Dual Head LX PCI
+ 102b 0e00 Marvel G450 eTV
+ 102b 0e01 Marvel G450 eTV
+ 102b 0e02 Marvel G450 eTV
+ 102b 0e03 Marvel G450 eTV
+ 102b 0f80 Millennium G450 Low Profile
+ 102b 0f81 Millennium G450 Low Profile
+ 102b 0f82 Millennium G450 Low Profile DVI
+ 102b 0f83 Millennium G450 Low Profile DVI
+ 102b 19d8 Millennium G400 16Mb SGRAM
+ 102b 19f8 Millennium G400 32Mb SGRAM
+ 102b 2159 Millennium G400 Dual Head 16Mb
+ 102b 2179 Millennium G400 MAX/Dual Head 32Mb
+ 102b 217d Millennium G400 Dual Head Max
+ 102b 23c0 Millennium G450
+ 102b 23c1 Millennium G450
+ 102b 23c2 Millennium G450 DVI
+ 102b 23c3 Millennium G450 DVI
+ 102b 2f58 Millennium G400
+ 102b 2f78 Millennium G400
+ 102b 3693 Marvel G400 AGP
+ 102b 5dd0 4Sight II
+ 102b 5f50 4Sight II
+ 102b 5f51 4Sight II
+ 102b 5f52 4Sight II
+ 102b 9010 Millennium G400 Dual Head
+ 1458 0400 GA-G400
+ 1705 0001 Millennium G450 32MB SGRAM
+ 1705 0002 Millennium G450 16MB SGRAM
+ 1705 0003 Millennium G450 32MB
+ 1705 0004 Millennium G450 16MB
+ 0527 MGA Parhelia AGP
+ 102b 0840 Parhelia 128Mb
+ 0d10 MGA Ultima/Impression
+ 1000 MGA G100 [Productiva]
+ 102b ff01 Productiva G100
+ 102b ff05 Productiva G100 Multi-Monitor
+ 1001 MGA G100 [Productiva] AGP
+ 102b 1001 MGA-G100 AGP
+ 102b ff00 MGA-G100 AGP
+ 102b ff01 MGA-G100 Productiva AGP
+ 102b ff03 Millennium G100 AGP
+ 102b ff04 MGA-G100 AGP
+ 102b ff05 MGA-G100 Productiva AGP Multi-Monitor
+ 110a 001e MGA-G100 AGP
+ 2007 MGA Mistral
+ 2527 MGA G550 AGP
+ 102b 0f83 Millennium G550
+ 102b 0f84 Millennium G550 Dual Head DDR 32Mb
+ 102b 1e41 Millennium G550
+ 4536 VIA Framegrabber
+ 6573 Shark 10/100 Multiport SwitchNIC
+102c Chips and Technologies
+ 00b8 F64310
+ 00c0 F69000 HiQVideo
+ 102c 00c0 F69000 HiQVideo
+ 00d0 F65545
+ 00d8 F65545
+ 00dc F65548
+ 00e0 F65550
+ 00e4 F65554
+ 00e5 F65555 HiQVPro
+ 0e11 b049 Armada 1700 Laptop Display Controller
+ 00f0 F68554
+ 00f4 F68554 HiQVision
+ 00f5 F68555
+ 0c30 F69030
+102d Wyse Technology Inc.
+ 50dc 3328 Audio
+102e Olivetti Advanced Technology
+102f Toshiba America
+ 0009 r4x00
+ 0020 ATM Meteor 155
+ 102f 00f8 ATM Meteor 155
+1030 TMC Research
+1031 Miro Computer Products AG
+ 5601 DC20 ASIC
+ 5607 Video I/O & motion JPEG compressor
+ 5631 Media 3D
+ 6057 MiroVideo DC10/DC30+
+1032 Compaq
+1033 NEC Corporation
+ 0001 PCI to 486-like bus Bridge
+ 0002 PCI to VL98 Bridge
+ 0003 ATM Controller
+ 0004 R4000 PCI Bridge
+ 0005 PCI to 486-like bus Bridge
+ 0006 PC-9800 Graphic Accelerator
+ 0007 PCI to UX-Bus Bridge
+ 0008 PC-9800 Graphic Accelerator
+ 0009 PCI to PC9800 Core-Graph Bridge
+ 0016 PCI to VL Bridge
+ 001a [Nile II]
+ 0021 Vrc4373 [Nile I]
+ 0029 PowerVR PCX1
+ 002a PowerVR 3D
+ 002c Star Alpha 2
+ 002d PCI to C-bus Bridge
+ 0035 USB
+ 1179 0001 USB
+ 12ee 7000 Root Hub
+ 1799 0001 Root Hub
+ 003b PCI to C-bus Bridge
+ 003e NAPCCARD Cardbus Controller
+ 0046 PowerVR PCX2 [midas]
+ 005a Vrc5074 [Nile 4]
+ 0063 Firewarden
+ 0067 PowerVR Neon 250 Chipset
+ 1010 0020 PowerVR Neon 250 AGP 32Mb
+ 1010 0080 PowerVR Neon 250 AGP 16Mb
+ 1010 0088 PowerVR Neon 250 16Mb
+ 1010 0090 PowerVR Neon 250 AGP 16Mb
+ 1010 0098 PowerVR Neon 250 16Mb
+ 1010 00a0 PowerVR Neon 250 AGP 32Mb
+ 1010 00a8 PowerVR Neon 250 32Mb
+ 1010 0120 PowerVR Neon 250 AGP 32Mb
+ 0074 56k Voice Modem
+ 1033 8014 RCV56ACF 56k Voice Modem
+ 009b Vrc5476
+ 00a6 VRC5477 AC97
+ 00cd IEEE 1394 [OrangeLink] Host Controller
+ 12ee 8011 Root hub
+ 00e0 USB 2.0
+ 12ee 7001 Root hub
+ 1799 0002 Root Hub
+1034 Framatome Connectors USA Inc.
+1035 Comp. & Comm. Research Lab
+1036 Future Domain Corp.
+ 0000 TMC-18C30 [36C70]
+1037 Hitachi Micro Systems
+1038 AMP, Inc
+1039 Silicon Integrated Systems [SiS]
+# This is what all my tests report. I don't know if this is equivalent to "5591/5592 AGP".
+ 0001 SiS 530 Virtual PCI-to-PCI bridge (AGP)
+ 0002 SG86C202
+ 0006 85C501/2/3
+ 0008 85C503/5513
+ 0009 ACPI
+ 0018 SiS85C503/5513 (LPC Bridge)
+ 0200 5597/5598/6326 VGA
+ 1039 0000 SiS5597 SVGA (Shared RAM)
+ 0204 82C204
+ 0205 SG86C205
+ 0300 SiS300/305 PCI/AGP VGA Display Adapter
+ 107d 2720 Leadtek WinFast VR300
+ 0310 SiS315H PCI/AGP VGA Display Adapter
+ 0315 SiS315 PCI/AGP VGA Display Adapter
+ 0325 SiS315PRO PCI/AGP VGA Display Adapter
+ 0330 SiS330 [Xabre] PCI/AGP VGA Display Adapter
+ 0406 85C501/2
+ 0496 85C496
+ 0530 530 Host
+ 0540 540 Host
+ 0597 5513C
+ 0601 85C601
+ 0620 620 Host
+ 0630 630 Host
+ 0633 633 Host
+ 0635 635 Host
+ 0645 SiS645 Host & Memory & AGP Controller
+ 0646 SiS645DX Host & Memory & AGP Controller
+ 0650 650 Host
+ 0651 SiS651 Host
+ 0730 730 Host
+ 0733 733 Host
+ 0735 735 Host
+ 0740 740 Host
+ 0745 745 Host
+ 0900 SiS900 10/100 Ethernet
+ 1039 0900 SiS900 10/100 Ethernet Adapter
+ 0961 SiS961 [MuTIOL Media IO]
+ 0962 SiS962 [MuTIOL Media IO]
+ 3602 83C602
+ 5107 5107
+ 5300 SiS540 PCI Display Adapter
+ 5315 SiS550 AGP/VGA VGA Display Adapter
+ 5401 486 PCI Chipset
+ 5511 5511/5512
+ 5513 5513 [IDE]
+ 1019 0970 P6STP-FL motherboard
+ 1039 5513 SiS5513 EIDE Controller (A,B step)
+ 5517 5517
+ 5571 5571
+ 5581 5581 Pentium Chipset
+ 5582 5582
+ 5591 5591/5592 Host
+ 5596 5596 Pentium Chipset
+ 5597 5597 [SiS5582]
+ 5600 5600 Host
+ 6204 Video decoder & MPEG interface
+ 6205 VGA Controller
+ 6236 6236 3D-AGP
+ 6300 SiS630 GUI Accelerator+3D
+ 1019 0970 P6STP-FL motherboard
+ 6306 SiS530 3D PCI/AGP
+ 1039 6306 SiS530,620 GUI Accelerator+3D
+ 6325 SiS650/651/M650/740 PCI/AGP VGA Display Adapter
+ 6326 86C326 5598/6326
+ 1039 6326 SiS6326 GUI Accelerator
+ 1092 0a50 SpeedStar A50
+ 1092 0a70 SpeedStar A70
+ 1092 4910 SpeedStar A70
+ 1092 4920 SpeedStar A70
+ 1569 6326 SiS6326 GUI Accelerator
+ 7001 SiS7001 USB Controller
+ 1039 7000 Onboard USB Controller
+ 7002 SiS7002 USB 2.0
+ 1509 7002 Onboard USB Controller
+ 7007 FireWire Controller
+ 7012 SiS7012 PCI Audio Accelerator
+ 7013 Intel 537 [56k Winmodem]
+ 7016 SiS7016 10/100 Ethernet Adapter
+ 1039 7016 SiS7016 10/100 Ethernet Adapter
+ 7018 SiS PCI Audio Accelerator
+ 1014 01b6 SiS PCI Audio Accelerator
+ 1014 01b7 SiS PCI Audio Accelerator
+ 1019 7018 SiS PCI Audio Accelerator
+ 1025 000e SiS PCI Audio Accelerator
+ 1025 0018 SiS PCI Audio Accelerator
+ 1039 7018 SiS PCI Audio Accelerator
+ 1043 800b SiS PCI Audio Accelerator
+ 1054 7018 SiS PCI Audio Accelerator
+ 107d 5330 SiS PCI Audio Accelerator
+ 107d 5350 SiS PCI Audio Accelerator
+ 1170 3209 SiS PCI Audio Accelerator
+ 1462 400a SiS PCI Audio Accelerator
+ 14a4 2089 SiS PCI Audio Accelerator
+ 14cd 2194 SiS PCI Audio Accelerator
+ 14ff 1100 SiS PCI Audio Accelerator
+ 152d 8808 SiS PCI Audio Accelerator
+ 1558 1103 SiS PCI Audio Accelerator
+ 1558 2200 SiS PCI Audio Accelerator
+ 1563 7018 SiS PCI Audio Accelerator
+ 15c5 0111 SiS PCI Audio Accelerator
+ 270f a171 SiS PCI Audio Accelerator
+ a0a0 0022 SiS PCI Audio Accelerator
+103a Seiko Epson Corporation
+103b Tatung Co. of America
+103c Hewlett-Packard Company
+ 1005 A4977A Visualize EG
+ 1006 Visualize FX6
+ 1008 Visualize FX4
+ 100a Visualize FX2
+ 1028 Tach TL Fibre Channel Host Adapter
+ 1029 Tach XL2 Fibre Channel Host Adapter
+ 107e 000f Interphase 5560 Fibre Channel Adapter
+ 9004 9210 1Gb/2Gb Family Fibre Channel Controller
+ 9004 9211 1Gb/2Gb Family Fibre Channel Controller
+ 102a Tach TS Fibre Channel Host Adapter
+ 107e 000e Interphase 5540/5541 Fibre Channel Adapter
+ 9004 9110 1Gb/2Gb Family Fibre Channel Controller
+ 9004 9111 1Gb/2Gb Family Fibre Channel Controller
+ 1030 J2585A DeskDirect 10/100VG NIC
+ 1031 J2585B HP 10/100VG PCI LAN Adapter
+ 103c 1040 J2973A DeskDirect 10BaseT NIC
+ 103c 1041 J2585B DeskDirect 10/100VG NIC
+ 103c 1042 J2970A DeskDirect 10BaseT/2 NIC
+ 1040 J2973A DeskDirect 10BaseT NIC
+ 1041 J2585B DeskDirect 10/100 NIC
+ 1042 J2970A DeskDirect 10BaseT/2 NIC
+ 1048 Diva Serial [GSP] Multiport UART
+ 103c 1049 Tosca Console
+ 103c 104a Tosca Secondary
+ 103c 104b Maestro SP2
+ 103c 1223 Halfdome Console
+ 103c 1226 Keystone SP2
+ 103c 1227 Powerbar SP2
+ 103c 1282 Everest SP2
+ 1064 79C970 PCnet Ethernet Controller
+ 108b Visualize FXe
+ 10c1 NetServer Smart IRQ Router
+ 10ed TopTools Remote Control
+ 1200 82557B 10/100 NIC
+ 1219 NetServer PCI Hot-Plug Controller
+ 121a NetServer SMIC Controller
+ 121b NetServer Legacy COM Port Decoder
+ 121c NetServer PCI COM Port Decoder
+ 1229 zx1 System Bus Adapter
+ 122a zx1 I/O Controller
+ 122e zx1 Local Bus Adapter
+ 1290 Auxiliary Diva Serial Port
+ 2910 E2910A PCIBus Exerciser
+ 2925 E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer
+103e Solliday Engineering
+103f Synopsys/Logic Modeling Group
+1040 Accelgraphics Inc.
+1041 Computrend
+1042 Micron
+ 1000 FDC 37C665
+ 1001 37C922
+ 3000 Samurai_0
+ 3010 Samurai_1
+ 3020 Samurai_IDE
+1043 Asustek Computer, Inc.
+ 0675 ISDNLink P-IN100-ST-D
+ 4021 v7100 Combo Deluxe [GeForce2 MX + TV tuner]
+1044 Distributed Processing Technology
+ 1012 Domino RAID Engine
+ a400 SmartCache/Raid I-IV Controller
+ a500 PCI Bridge
+ a501 SmartRAID V Controller
+ 1044 c001 PM1554U2 Ultra2 Single Channel
+ 1044 c002 PM1654U2 Ultra2 Single Channel
+ 1044 c003 PM1564U3 Ultra3 Single Channel
+ 1044 c004 PM1564U3 Ultra3 Dual Channel
+ 1044 c005 PM1554U2 Ultra2 Single Channel (NON ACPI)
+ 1044 c00a PM2554U2 Ultra2 Single Channel
+ 1044 c00b PM2654U2 Ultra2 Single Channel
+ 1044 c00c PM2664U3 Ultra3 Single Channel
+ 1044 c00d PM2664U3 Ultra3 Dual Channel
+ 1044 c00e PM2554U2 Ultra2 Single Channel (NON ACPI)
+ 1044 c00f PM2654U2 Ultra2 Single Channel (NON ACPI)
+ 1044 c014 PM3754U2 Ultra2 Single Channel (NON ACPI)
+ 1044 c015 PM3755U2B Ultra2 Single Channel (NON ACPI)
+ 1044 c016 PM3755F Fibre Channel (NON ACPI)
+ 1044 c01e PM3757U2 Ultra2 Single Channel
+ 1044 c01f PM3757U2 Ultra2 Dual Channel
+ 1044 c020 PM3767U3 Ultra3 Dual Channel
+ 1044 c021 PM3767U3 Ultra3 Quad Channel
+ 1044 c028 PM2865U3 Ultra3 Single Channel
+ 1044 c029 PM2865U3 Ultra3 Dual Channel
+ 1044 c02a PM2865F Fibre Channel
+ 1044 c03c 2000S Ultra3 Single Channel
+ 1044 c03d 2000S Ultra3 Dual Channel
+ 1044 c03e 2000F Fibre Channel
+ 1044 c046 3000S Ultra3 Single Channel
+ 1044 c047 3000S Ultra3 Dual Channel
+ 1044 c048 3000F Fibre Channel
+ 1044 c050 5000S Ultra3 Single Channel
+ 1044 c051 5000S Ultra3 Dual Channel
+ 1044 c052 5000F Fibre Channel
+ 1044 c05a 2400A UDMA Four Channel
+ 1044 c05b 2400A UDMA Four Channel DAC
+ 1044 c064 3010S Ultra3 Dual Channel
+ 1044 c065 3010S Ultra3 Four Channel
+ 1044 c066 3010S Fibre Channel
+ a511 SmartRAID V Controller
+1045 OPTi Inc.
+ a0f8 82C750 [Vendetta] USB Controller
+ c101 92C264
+ c178 92C178
+ c556 82X556 [Viper]
+ c557 82C557 [Viper-M]
+ c558 82C558 [Viper-M ISA+IDE]
+ c567 82C750 [Vendetta], device 0
+ c568 82C750 [Vendetta], device 1
+ c569 82C579 [Viper XPress+ Chipset]
+ c621 82C621 [Viper-M/N+]
+ c700 82C700 [FireStar]
+ c701 82C701 [FireStar Plus]
+ c814 82C814 [Firebridge 1]
+ c822 82C822
+ c824 82C824
+ c825 82C825 [Firebridge 2]
+ c832 82C832
+ c861 82C861
+ c895 82C895
+ c935 EV1935 ECTIVA MachOne PCI Audio
+ d568 82C825 [Firebridge 2]
+ d721 IDE [FireStar]
+1046 IPC Corporation, Ltd.
+1047 Genoa Systems Corp
+1048 Elsa AG
+ 0d22 Quadro4 900XGL [ELSA GLoria4 900XGL]
+ 1000 QuickStep 1000
+ 3000 QuickStep 3000
+1049 Fountain Technologies, Inc.
+104a SGS Thomson Microelectronics
+ 0008 STG 2000X
+ 0009 STG 1764X
+ 0010 STG4000 [3D Prophet Kyro Series]
+# From <http://gatekeeper.dec.com/pub/BSD/FreeBSD/FreeBSD-stable/src/share/misc/pci_vendors>
+ 0210 STPC Atlas ISA Bridge
+ 0981 DEC-Tulip compatible 10/100 Ethernet
+ 1746 STG 1764X
+ 2774 DEC-Tulip compatible 10/100 Ethernet
+ 3520 MPEG-II decoder card
+104b BusLogic
+ 0140 BT-946C (old) [multimaster 01]
+ 1040 BT-946C (BA80C30) [MultiMaster 10]
+ 8130 Flashpoint LT
+104c Texas Instruments
+ 0500 100 MBit LAN Controller
+ 0508 TMS380C2X Compressor Interface
+ 1000 Eagle i/f AS
+ 104c PCI1510 PC card Cardbus Controller
+ 3d04 TVP4010 [Permedia]
+ 3d07 TVP4020 [Permedia 2]
+ 1011 4d10 Comet
+ 1040 000f AccelStar II
+ 1040 0011 AccelStar II
+ 1048 0a31 WINNER 2000
+ 1048 0a32 GLoria Synergy
+ 1048 0a35 GLoria Synergy
+ 107d 2633 WinFast 3D L2300
+ 1092 0127 FIRE GL 1000 PRO
+ 1092 0136 FIRE GL 1000 PRO
+ 1092 0141 FIRE GL 1000 PRO
+ 1092 0146 FIRE GL 1000 PRO
+ 1092 0148 FIRE GL 1000 PRO
+ 1092 0149 FIRE GL 1000 PRO
+ 1092 0152 FIRE GL 1000 PRO
+ 1092 0154 FIRE GL 1000 PRO
+ 1092 0155 FIRE GL 1000 PRO
+ 1092 0156 FIRE GL 1000 PRO
+ 1092 0157 FIRE GL 1000 PRO
+ 1097 3d01 Jeronimo Pro
+ 1102 100f Graphics Blaster Extreme
+ 3d3d 0100 Reference Permedia 2 3D
+ 8000 PCILynx/PCILynx2 IEEE 1394 Link Layer Controller
+ e4bf 1010 CF1-1-SNARE
+ e4bf 1020 CF1-2-SNARE
+ 8009 FireWire Controller
+ 104d 8032 8032 OHCI i.LINK (IEEE 1394) Controller
+ 8017 PCI4410 FireWire Controller
+ 8019 TSB12LV23 IEEE-1394 Controller
+ 11bd 000a Studio DV500-1394
+ 11bd 000e Studio DV
+ e4bf 1010 CF2-1-CYMBAL
+ 8020 TSB12LV26 IEEE-1394 Controller (Link)
+ 8021 TSB43AA22 IEEE-1394 Controller (PHY/Link Integrated)
+ 104d 80df Vaio PCG-FX403
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 8022 TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link)
+ 8023 TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)
+ 8024 TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
+ 8026 TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)
+ 8027 PCI4451 IEEE-1394 Controller
+ 1028 00e6 PCI4451 IEEE-1394 Controller (Dell Inspiron 8100)
+ 8400 ACX 100 22Mbps Wireless Interface
+ a001 TDC1570
+ a100 TDC1561
+ a102 TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f
+ a106 TMS320C6205
+ ac10 PCI1050
+ ac11 PCI1053
+ ac12 PCI1130
+ ac13 PCI1031
+ ac15 PCI1131
+ ac16 PCI1250
+ ac17 PCI1220
+ ac18 PCI1260
+ ac19 PCI1221
+ ac1a PCI1210
+ ac1b PCI1450
+ 0e11 b113 Armada M700
+ ac1c PCI1225
+ ac1d PCI1251A
+ ac1e PCI1211
+ ac1f PCI1251B
+ ac20 TI 2030
+ ac21 PCI2031
+ ac22 PCI2032 PCI Docking Bridge
+ ac23 PCI2250 PCI-to-PCI Bridge
+ ac28 PCI2050 PCI-to-PCI Bridge
+ ac30 PCI1260 PC card Cardbus Controller
+ ac40 PCI4450 PC card Cardbus Controller
+ ac41 PCI4410 PC card Cardbus Controller
+ ac42 PCI4451 PC card Cardbus Controller
+ 1028 00e6 PCI4451 PC card CardBus Controller (Dell Inspiron 8100)
+ ac50 PCI1410 PC card Cardbus Controller
+ ac51 PCI1420
+ 1014 023b ThinkPad T23 (2647-4MG)
+ 10cf 1095 Lifebook C6155
+ e4bf 1000 CP2-2-HIPHOP
+ ac52 PCI1451 PC card Cardbus Controller
+ ac53 PCI1421 PC card Cardbus Controller
+ ac55 PCI1250 PC card Cardbus Controller
+ 1014 0512 ThinkPad T30
+ ac56 PCI1510 PC card Cardbus Controller
+ ac60 PCI2040 PCI to DSP Bridge Controller
+ fe00 FireWire Host Controller
+ fe03 12C01A FireWire Host Controller
+104d Sony Corporation
+ 8009 CXD1947Q i.LINK Controller
+ 8039 CXD3222 i.LINK Controller
+ 8056 Rockwell HCF 56K modem
+ 808a Memory Stick Controller
+104e Oak Technology, Inc
+ 0017 OTI-64017
+ 0107 OTI-107 [Spitfire]
+ 0109 Video Adapter
+ 0111 OTI-64111 [Spitfire]
+ 0217 OTI-64217
+ 0317 OTI-64317
+104f Co-time Computer Ltd
+1050 Winbond Electronics Corp
+ 0000 NE2000
+ 0001 W83769F
+ 0105 W82C105
+ 0840 W89C840
+ 1050 0001 W89C840 Ethernet Adapter
+ 1050 0840 W89C840 Ethernet Adapter
+ 0940 W89C940
+ 5a5a W89C940F
+ 6692 W6692
+ 9970 W9970CF
+1051 Anigma, Inc.
+1052 ?Young Micro Systems
+1053 Young Micro Systems
+1054 Hitachi, Ltd
+1055 Efar Microsystems
+ 9130 SLC90E66 [Victory66] IDE
+ 9460 SLC90E66 [Victory66] ISA
+ 9462 SLC90E66 [Victory66] USB
+ 9463 SLC90E66 [Victory66] ACPI
+1056 ICL
+# Motorola made a mistake and used 1507 instead of 1057 in some chips. Please look at the 1507 entry as well when updating this.
+1057 Motorola
+ 0001 MPC105 [Eagle]
+ 0002 MPC106 [Grackle]
+ 0003 MPC8240 [Kahlua]
+ 0004 MPC107
+ 0006 MPC8245 [Unity]
+ 0100 MC145575 [HFC-PCI]
+ 0431 KTI829c 100VG
+ 1801 Audio I/O Controller (MIDI)
+ ecc0 0030 Layla
+ 18c0 MPC8265A/MPC8266
+ 4801 Raven
+ 4802 Falcon
+ 4803 Hawk
+ 4806 CPX8216
+ 4d68 20268
+ 5600 SM56 PCI Modem
+ 1057 0300 SM56 PCI Speakerphone Modem
+ 1057 0301 SM56 PCI Voice Modem
+ 1057 0302 SM56 PCI Fax Modem
+ 1057 5600 SM56 PCI Voice modem
+ 13d2 0300 SM56 PCI Speakerphone Modem
+ 13d2 0301 SM56 PCI Voice modem
+ 13d2 0302 SM56 PCI Fax Modem
+ 1436 0300 SM56 PCI Speakerphone Modem
+ 1436 0301 SM56 PCI Voice modem
+ 1436 0302 SM56 PCI Fax Modem
+ 144f 100c SM56 PCI Fax Modem
+ 1494 0300 SM56 PCI Speakerphone Modem
+ 1494 0301 SM56 PCI Voice modem
+ 14c8 0300 SM56 PCI Speakerphone Modem
+ 14c8 0302 SM56 PCI Fax Modem
+ 1668 0300 SM56 PCI Speakerphone Modem
+ 1668 0302 SM56 PCI Fax Modem
+ 6400 MPC190 Security Processor (S1 family, encryption)
+1058 Electronics & Telecommunications RSH
+1059 Teknor Industrial Computers Inc
+105a Promise Technology, Inc.
+ 0d30 20265
+ 105a 4d33 Ultra100
+ 0d38 20263
+ 105a 4d39 Fasttrak66
+ 1275 20275
+ 3376 PDC20376
+ 4d30 20267
+ 105a 4d33 Ultra100
+ 105a 4d39 Fasttrak100
+ 4d33 20246
+ 105a 4d33 20246 IDE Controller
+ 4d38 20262
+ 105a 4d30 Ultra Device on SuperTrak
+ 105a 4d33 Ultra66
+ 105a 4d39 Fasttrak66
+ 4d68 20268
+ 105a 4d68 Ultra100TX2
+ 4d69 20269
+ 5275 PDC20276 IDE
+ 105a 0275 SuperTrak SX6000 IDE
+ 5300 DC5300
+ 6268 20268R
+ 6269 PDC20271
+ 105a 6269 FastTrak TX2/TX2000
+ 6621 PDC20621 [SX4000] 4 Channel IDE RAID Controller
+ 7275 PDC20277
+105b Foxconn International, Inc.
+105c Wipro Infotech Limited
+105d Number 9 Computer Company
+ 2309 Imagine 128
+ 2339 Imagine 128-II
+ 105d 0000 Imagine 128 series 2 4Mb VRAM
+ 105d 0001 Imagine 128 series 2 4Mb VRAM
+ 105d 0002 Imagine 128 series 2 4Mb VRAM
+ 105d 0003 Imagine 128 series 2 4Mb VRAM
+ 105d 0004 Imagine 128 series 2 4Mb VRAM
+ 105d 0005 Imagine 128 series 2 4Mb VRAM
+ 105d 0006 Imagine 128 series 2 4Mb VRAM
+ 105d 0007 Imagine 128 series 2 4Mb VRAM
+ 105d 0008 Imagine 128 series 2e 4Mb DRAM
+ 105d 0009 Imagine 128 series 2e 4Mb DRAM
+ 105d 000a Imagine 128 series 2 8Mb VRAM
+ 105d 000b Imagine 128 series 2 8Mb H-VRAM
+ 11a4 000a Barco Metheus 5 Megapixel
+ 13cc 0000 Barco Metheus 5 Megapixel
+ 13cc 0004 Barco Metheus 5 Megapixel
+ 13cc 0005 Barco Metheus 5 Megapixel
+ 13cc 0006 Barco Metheus 5 Megapixel
+ 13cc 0008 Barco Metheus 5 Megapixel
+ 13cc 0009 Barco Metheus 5 Megapixel
+ 13cc 000a Barco Metheus 5 Megapixel
+ 13cc 000c Barco Metheus 5 Megapixel
+ 493d Imagine 128 T2R [Ticket to Ride]
+ 11a4 000a Barco Metheus 5 Megapixel, Dual Head
+ 11a4 000b Barco Metheus 5 Megapixel, Dual Head
+ 13cc 0002 Barco Metheus 4 Megapixel, Dual Head
+ 13cc 0003 Barco Metheus 5 Megapixel, Dual Head
+ 13cc 0007 Barco Metheus 5 Megapixel, Dual Head
+ 13cc 0008 Barco Metheus 5 Megapixel, Dual Head
+ 13cc 0009 Barco Metheus 5 Megapixel, Dual Head
+ 13cc 000a Barco Metheus 5 Megapixel, Dual Head
+ 5348 Revolution 4
+105e Vtech Computers Ltd
+105f Infotronic America Inc
+1060 United Microelectronics [UMC]
+ 0001 UM82C881
+ 0002 UM82C886
+ 0101 UM8673F
+ 0881 UM8881
+ 0886 UM8886F
+ 0891 UM8891A
+ 1001 UM886A
+ 673a UM8886BF
+ 673b EIDE Master/DMA
+ 8710 UM8710
+ 886a UM8886A
+ 8881 UM8881F
+ 8886 UM8886F
+ 888a UM8886A
+ 8891 UM8891A
+ 9017 UM9017F
+ 9018 UM9018
+ 9026 UM9026
+ e881 UM8881N
+ e886 UM8886N
+ e88a UM8886N
+ e891 UM8891N
+1061 I.I.T.
+ 0001 AGX016
+ 0002 IIT3204/3501
+1062 Maspar Computer Corp
+1063 Ocean Office Automation
+1064 Alcatel
+1065 Texas Microsystems
+1066 PicoPower Technology
+ 0000 PT80C826
+ 0001 PT86C521 [Vesuvius v1] Host Bridge
+ 0002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Master
+ 0003 PT86C524 [Nile] PCI-to-PCI Bridge
+ 0004 PT86C525 [Nile-II] PCI-to-PCI Bridge
+ 0005 National PC87550 System Controller
+ 8002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Slave
+1067 Mitsubishi Electric
+ 1002 VG500 [VolumePro Volume Rendering Accelerator]
+1068 Diversified Technology
+1069 Mylex Corporation
+ 0001 DAC960P
+ 0002 DAC960PD
+ 0010 DAC960PX
+ 0050 AcceleRAID 352/170/160 support Device
+ ba55 eXtremeRAID 1100 support Device
+ ba56 eXtremeRAID 2000/3000 support Device
+106a Aten Research Inc
+106b Apple Computer Inc.
+ 0001 Bandit PowerPC host bridge
+ 0002 Grand Central I/O
+ 0003 Control Video
+ 0004 PlanB Video-In
+ 0007 O'Hare I/O
+ 000e Hydra Mac I/O
+ 0010 Heathrow Mac I/O
+ 0017 Paddington Mac I/O
+ 0018 UniNorth FireWire
+ 0019 KeyLargo USB
+ 001e UniNorth Internal PCI
+ 001f UniNorth PCI
+ 0020 UniNorth AGP
+ 0021 UniNorth GMAC (Sun GEM)
+ 0022 KeyLargo Mac I/O
+ 0024 UniNorth/Pangea GMAC (Sun GEM)
+ 0025 KeyLargo/Pangea Mac I/O
+ 0026 KeyLargo/Pangea USB
+ 0027 UniNorth/Pangea AGP
+ 0028 UniNorth/Pangea PCI
+ 0029 UniNorth/Pangea Internal PCI
+ 002d UniNorth 1.5 AGP
+ 002e UniNorth 1.5 PCI
+ 002f UniNorth 1.5 Internal PCI
+ 0030 UniNorth/Pangea FireWire
+ 0031 UniNorth 2 FireWire
+ 0032 UniNorth 2 GMAC (Sun GEM)
+ 0033 UniNorth 2 ATA/100
+ 0034 UniNorth 2 AGP
+ 1645 Tigon3 Gigabit Ethernet NIC (BCM5701)
+106c Hyundai Electronics America
+ 8801 Dual Pentium ISA/PCI Motherboard
+ 8802 PowerPC ISA/PCI Motherboard
+ 8803 Dual Window Graphics Accelerator
+ 8804 LAN Controller
+ 8805 100-BaseT LAN
+106d Sequent Computer Systems
+106e DFI, Inc
+106f City Gate Development Ltd
+1070 Daewoo Telecom Ltd
+1071 Mitac
+1072 GIT Co Ltd
+1073 Yamaha Corporation
+ 0001 3D GUI Accelerator
+ 0002 YGV615 [RPA3 3D-Graphics Controller]
+ 0003 YMF-740
+ 0004 YMF-724
+ 1073 0004 YMF724-Based PCI Audio Adapter
+ 0005 DS1 Audio
+ 1073 0005 DS-XG PCI Audio CODEC
+ 0006 DS1 Audio
+ 0008 DS1 Audio
+ 1073 0008 DS-XG PCI Audio CODEC
+ 000a DS1L Audio
+ 1073 0004 DS-XG PCI Audio CODEC
+ 1073 000a DS-XG PCI Audio CODEC
+ 000c YMF-740C [DS-1L Audio Controller]
+ 107a 000c DS-XG PCI Audio CODEC
+ 000d YMF-724F [DS-1 Audio Controller]
+ 1073 000d DS-XG PCI Audio CODEC
+ 0010 YMF-744B [DS-1S Audio Controller]
+ 1073 0006 DS-XG PCI Audio CODEC
+ 1073 0010 DS-XG PCI Audio CODEC
+ 0012 YMF-754 [DS-1E Audio Controller]
+ 1073 0012 DS-XG PCI Audio Codec
+ 0020 DS-1 Audio
+ 2000 DS2416 Digital Mixing Card
+ 1073 2000 DS2416 Digital Mixing Card
+1074 NexGen Microsystems
+ 4e78 82c500/1
+1075 Advanced Integrations Research
+1076 Chaintech Computer Co. Ltd
+1077 QLogic Corp.
+ 1016 ISP10160 Single Channel Ultra3 SCSI Processor
+ 1020 ISP1020 Fast-wide SCSI
+ 1022 ISP1022 Fast-wide SCSI
+ 1080 ISP1080 SCSI Host Adapter
+ 1216 ISP12160 Dual Channel Ultra3 SCSI Processor
+ 101e 8471 QLA12160 on AMI MegaRAID
+ 101e 8493 QLA12160 on AMI MegaRAID
+ 1240 ISP1240 SCSI Host Adapter
+ 1280 ISP1280
+ 2020 ISP2020A Fast!SCSI Basic Adapter
+ 2100 QLA2100 64-bit Fibre Channel Adapter
+ 1077 0001 QLA2100 64-bit Fibre Channel Adapter
+ 2200 QLA2200
+ 2300 QLA2300 64-bit FC-AL Adapter
+ 2312 QLA2312 Fibre Channel Adapter
+1078 Cyrix Corporation
+ 0000 5510 [Grappa]
+ 0001 PCI Master
+ 0002 5520 [Cognac]
+ 0100 5530 Legacy [Kahlua]
+ 0101 5530 SMI [Kahlua]
+ 0102 5530 IDE [Kahlua]
+ 0103 5530 Audio [Kahlua]
+ 0104 5530 Video [Kahlua]
+ 0400 ZFMicro PCI Bridge
+ 0401 ZFMicro Chipset SMI
+ 0402 ZFMicro Chipset IDE
+ 0403 ZFMicro Expansion Bus
+1079 I-Bus
+107a NetWorth
+107b Gateway 2000
+107c LG Electronics [Lucky Goldstar Co. Ltd]
+107d LeadTek Research Inc.
+ 0000 P86C850
+107e Interphase Corporation
+ 0001 5515 ATM Adapter [Flipper]
+ 0002 100 VG AnyLan Controller
+ 0004 5526 Fibre Channel Host Adapter
+ 0005 x526 Fibre Channel Host Adapter
+ 0008 5525/5575 ATM Adapter (155 Mbit) [Atlantic]
+ 9003 5535-4P-BRI-ST
+ 9007 5535-4P-BRI-U
+ 9008 5535-1P-SR
+ 900c 5535-1P-SR-ST
+ 900e 5535-1P-SR-U
+ 9011 5535-1P-PRI
+ 9013 5535-2P-PRI
+ 9023 5536-4P-BRI-ST
+ 9027 5536-4P-BRI-U
+ 9031 5536-1P-PRI
+ 9033 5536-2P-PRI
+107f Data Technology Corporation
+ 0802 SL82C105
+1080 Contaq Microsystems
+ 0600 82C599
+ c691 Cypress CY82C691
+ c693 82c693
+1081 Supermac Technology
+ 0d47 Radius PCI to NuBUS Bridge
+1082 EFA Corporation of America
+1083 Forex Computer Corporation
+ 0001 FR710
+1084 Parador
+1085 Tulip Computers Int.B.V.
+1086 J. Bond Computer Systems
+1087 Cache Computer
+1088 Microcomputer Systems (M) Son
+1089 Data General Corporation
+# Formerly Bit3 Computer Corp.
+108a SBS Technologies
+ 0001 VME Bridge Model 617
+ 0010 VME Bridge Model 618
+ 0040 dataBLIZZARD
+ 3000 VME Bridge Model 2706
+108c Oakleigh Systems Inc.
+108d Olicom
+ 0001 Token-Ring 16/4 PCI Adapter (3136/3137)
+ 0002 16/4 Token Ring
+ 0004 RapidFire 3139 Token-Ring 16/4 PCI Adapter
+ 108d 0004 OC-3139/3140 RapidFire Token-Ring 16/4 Adapter
+ 0005 GoCard 3250 Token-Ring 16/4 CardBus PC Card
+ 0006 OC-3530 RapidFire Token-Ring 100
+ 0007 RapidFire 3141 Token-Ring 16/4 PCI Fiber Adapter
+ 108d 0007 OC-3141 RapidFire Token-Ring 16/4 Adapter
+ 0008 RapidFire 3540 HSTR 100/16/4 PCI Adapter
+ 108d 0008 OC-3540 RapidFire HSTR 100/16/4 Adapter
+ 0011 OC-2315
+ 0012 OC-2325
+ 0013 OC-2183/2185
+ 0014 OC-2326
+ 0019 OC-2327/2250 10/100 Ethernet Adapter
+ 108d 0016 OC-2327 Rapidfire 10/100 Ethernet Adapter
+ 108d 0017 OC-2250 GoCard 10/100 Ethernet Adapter
+ 0021 OC-6151/6152 [RapidFire ATM 155]
+ 0022 ATM Adapter
+108e Sun Microsystems Computer Corp.
+ 0001 EBUS
+ 1000 EBUS
+ 1001 Happy Meal
+ 1100 RIO EBUS
+ 1101 RIO GEM
+ 1102 RIO 1394
+ 1103 RIO USB
+ 2bad GEM
+ 5000 Simba Advanced PCI Bridge
+ 5043 SunPCI Co-processor
+ 8000 Psycho PCI Bus Module
+ 8001 Schizo PCI Bus Module
+ a000 Ultra IIi
+ a001 Ultra IIe
+108f Systemsoft
+1090 Encore Computer Corporation
+1091 Intergraph Corporation
+ 0020 3D graphics processor
+ 0021 3D graphics processor w/Texturing
+ 0040 3D graphics frame buffer
+ 0041 3D graphics frame buffer
+ 0060 Proprietary bus bridge
+ 00e4 Powerstorm 4D50T
+ 0720 Motion JPEG codec
+1092 Diamond Multimedia Systems
+ 00a0 Speedstar Pro SE
+ 00a8 Speedstar 64
+ 0550 Viper V550
+ 08d4 Supra 2260 Modem
+ 094c SupraExpress 56i Pro
+ 1092 Viper V330
+ 6120 Maximum DVD
+ 8810 Stealth SE
+ 8811 Stealth 64/SE
+ 8880 Stealth
+ 8881 Stealth
+ 88b0 Stealth 64
+ 88b1 Stealth 64
+ 88c0 Stealth 64
+ 88c1 Stealth 64
+ 88d0 Stealth 64
+ 88d1 Stealth 64
+ 88f0 Stealth 64
+ 88f1 Stealth 64
+ 9999 DMD-I0928-1 "Monster sound" sound chip
+1093 National Instruments
+ 0160 PCI-DIO-96
+ 0162 PCI-MIO-16XE-50
+ 1170 PCI-MIO-16XE-10
+ 1180 PCI-MIO-16E-1
+ 1190 PCI-MIO-16E-4
+ 1330 PCI-6031E
+ 1350 PCI-6071E
+ 2a60 PCI-6023E
+ b001 IMAQ-PCI-1408
+ b011 IMAQ-PXI-1408
+ b021 IMAQ-PCI-1424
+ b031 IMAQ-PCI-1413
+ b041 IMAQ-PCI-1407
+ b051 IMAQ-PXI-1407
+ b061 IMAQ-PCI-1411
+ b071 IMAQ-PCI-1422
+ b081 IMAQ-PXI-1422
+ b091 IMAQ-PXI-1411
+ c801 PCI-GPIB
+ c831 PCI-GPIB bridge
+1094 First International Computers [FIC]
+1095 CMD Technology Inc
+ 0640 PCI0640
+ 0643 PCI0643
+ 0646 PCI0646
+ 0647 PCI0647
+ 0648 PCI0648
+ 0649 PCI0649
+ 0e11 005d Integrated Ultra ATA-100 Dual Channel Controller
+ 0e11 007e Integrated Ultra ATA-100 IDE RAID Controller
+ 101e 0649 AMI MegaRAID IDE 100 Controller
+ 0650 PBC0650A
+ 0670 USB0670
+ 1095 0670 USB0670
+ 0673 USB0673
+ 0680 PCI0680
+ 3112 Silicon Image SiI 3112 SATARaid Controller
+1096 Alacron
+1097 Appian Technology
+1098 Quantum Designs (H.K.) Ltd
+ 0001 QD-8500
+ 0002 QD-8580
+1099 Samsung Electronics Co., Ltd
+109a Packard Bell
+109b Gemlight Computer Ltd.
+109c Megachips Corporation
+109d Zida Technologies Ltd.
+109e Brooktree Corporation
+ 0350 Bt848 Video Capture
+ 0351 Bt849A Video capture
+ 0369 Bt878 Video Capture
+ 1002 0001 TV-Wonder
+ 1002 0003 TV-Wonder/VE
+ 036c Bt879(??) Video Capture
+ 13e9 0070 Win/TV (Video Section)
+ 036e Bt878 Video Capture
+ 0070 13eb WinTV Series
+ 0070 ff01 Viewcast Osprey 200
+ 107d 6606 WinFast TV 2000
+ 11bd 0012 PCTV pro (TV + FM stereo receiver)
+ 11bd 001c PCTV Sat (DBC receiver)
+ 127a 0001 Bt878 Mediastream Controller NTSC
+ 127a 0002 Bt878 Mediastream Controller PAL BG
+ 127a 0003 Bt878a Mediastream Controller PAL BG
+ 127a 0048 Bt878/832 Mediastream Controller
+ 144f 3000 MagicTView CPH060 - Video
+ 1461 0004 AVerTV WDM Video Capture
+ 14f1 0001 Bt878 Mediastream Controller NTSC
+ 14f1 0002 Bt878 Mediastream Controller PAL BG
+ 14f1 0003 Bt878a Mediastream Controller PAL BG
+ 14f1 0048 Bt878/832 Mediastream Controller
+ 1851 1850 FlyVideo'98 - Video
+ 1851 1851 FlyVideo II
+ 1852 1852 FlyVideo'98 - Video (with FM Tuner)
+ bd11 1200 PCTV pro (TV + FM stereo receiver)
+ 036f Bt879 Video Capture
+ 127a 0044 Bt879 Video Capture NTSC
+ 127a 0122 Bt879 Video Capture PAL I
+ 127a 0144 Bt879 Video Capture NTSC
+ 127a 0222 Bt879 Video Capture PAL BG
+ 127a 0244 Bt879a Video Capture NTSC
+ 127a 0322 Bt879 Video Capture NTSC
+ 127a 0422 Bt879 Video Capture NTSC
+ 127a 1122 Bt879 Video Capture PAL I
+ 127a 1222 Bt879 Video Capture PAL BG
+ 127a 1322 Bt879 Video Capture NTSC
+ 127a 1522 Bt879a Video Capture PAL I
+ 127a 1622 Bt879a Video Capture PAL BG
+ 127a 1722 Bt879a Video Capture NTSC
+ 14f1 0044 Bt879 Video Capture NTSC
+ 14f1 0122 Bt879 Video Capture PAL I
+ 14f1 0144 Bt879 Video Capture NTSC
+ 14f1 0222 Bt879 Video Capture PAL BG
+ 14f1 0244 Bt879a Video Capture NTSC
+ 14f1 0322 Bt879 Video Capture NTSC
+ 14f1 0422 Bt879 Video Capture NTSC
+ 14f1 1122 Bt879 Video Capture PAL I
+ 14f1 1222 Bt879 Video Capture PAL BG
+ 14f1 1322 Bt879 Video Capture NTSC
+ 14f1 1522 Bt879a Video Capture PAL I
+ 14f1 1622 Bt879a Video Capture PAL BG
+ 14f1 1722 Bt879a Video Capture NTSC
+ 1851 1850 FlyVideo'98 - Video
+ 1851 1851 FlyVideo II
+ 1852 1852 FlyVideo'98 - Video (with FM Tuner)
+ 0370 Bt880 Video Capture
+ 1851 1850 FlyVideo'98
+ 1851 1851 FlyVideo'98 EZ - video
+ 1852 1852 FlyVideo'98 (with FM Tuner)
+ 0878 Bt878 Audio Capture
+ 0070 13eb WinTV Series
+ 0070 ff01 Viewcast Osprey 200
+ 1002 0001 TV-Wonder
+ 1002 0003 TV-Wonder/VE
+ 11bd 0012 PCTV pro (TV + FM stereo receiver, audio section)
+ 11bd 001c PCTV Sat (DBC receiver)
+ 127a 0001 Bt878 Video Capture (Audio Section)
+ 127a 0002 Bt878 Video Capture (Audio Section)
+ 127a 0003 Bt878 Video Capture (Audio Section)
+ 127a 0048 Bt878 Video Capture (Audio Section)
+ 13e9 0070 Win/TV (Audio Section)
+ 144f 3000 MagicTView CPH060 - Audio
+ 1461 0004 AVerTV WDM Audio Capture
+ 14f1 0001 Bt878 Video Capture (Audio Section)
+ 14f1 0002 Bt878 Video Capture (Audio Section)
+ 14f1 0003 Bt878 Video Capture (Audio Section)
+ 14f1 0048 Bt878 Video Capture (Audio Section)
+ bd11 1200 PCTV pro (TV + FM stereo receiver, audio section)
+ 0879 Bt879 Audio Capture
+ 127a 0044 Bt879 Video Capture (Audio Section)
+ 127a 0122 Bt879 Video Capture (Audio Section)
+ 127a 0144 Bt879 Video Capture (Audio Section)
+ 127a 0222 Bt879 Video Capture (Audio Section)
+ 127a 0244 Bt879 Video Capture (Audio Section)
+ 127a 0322 Bt879 Video Capture (Audio Section)
+ 127a 0422 Bt879 Video Capture (Audio Section)
+ 127a 1122 Bt879 Video Capture (Audio Section)
+ 127a 1222 Bt879 Video Capture (Audio Section)
+ 127a 1322 Bt879 Video Capture (Audio Section)
+ 127a 1522 Bt879 Video Capture (Audio Section)
+ 127a 1622 Bt879 Video Capture (Audio Section)
+ 127a 1722 Bt879 Video Capture (Audio Section)
+ 14f1 0044 Bt879 Video Capture (Audio Section)
+ 14f1 0122 Bt879 Video Capture (Audio Section)
+ 14f1 0144 Bt879 Video Capture (Audio Section)
+ 14f1 0222 Bt879 Video Capture (Audio Section)
+ 14f1 0244 Bt879 Video Capture (Audio Section)
+ 14f1 0322 Bt879 Video Capture (Audio Section)
+ 14f1 0422 Bt879 Video Capture (Audio Section)
+ 14f1 1122 Bt879 Video Capture (Audio Section)
+ 14f1 1222 Bt879 Video Capture (Audio Section)
+ 14f1 1322 Bt879 Video Capture (Audio Section)
+ 14f1 1522 Bt879 Video Capture (Audio Section)
+ 14f1 1622 Bt879 Video Capture (Audio Section)
+ 14f1 1722 Bt879 Video Capture (Audio Section)
+ 0880 Bt880 Audio Capture
+ 2115 BtV 2115 Mediastream controller
+ 2125 BtV 2125 Mediastream controller
+ 2164 BtV 2164
+ 2165 BtV 2165
+ 8230 Bt8230 ATM Segment/Reassembly Ctrlr (SRC)
+ 8472 Bt8472
+ 8474 Bt8474
+109f Trigem Computer Inc.
+10a0 Meidensha Corporation
+10a1 Juko Electronics Ind. Co. Ltd
+10a2 Quantum Corporation
+10a3 Everex Systems Inc
+10a4 Globe Manufacturing Sales
+10a5 Smart Link Ltd.
+ 5449 SmartPCI561 modem
+10a6 Informtech Industrial Ltd.
+10a7 Benchmarq Microelectronics
+10a8 Sierra Semiconductor
+ 0000 STB Horizon 64
+10a9 Silicon Graphics, Inc.
+ 0001 Crosstalk to PCI Bridge
+ 0002 Linc I/O controller
+ 0003 IOC3 I/O controller
+ 0004 O2 MACE
+ 0005 RAD Audio
+ 0006 HPCEX
+ 0007 RPCEX
+ 0008 DiVO VIP
+ 0009 Alteon Gigabit Ethernet
+ 0010 AMP Video I/O
+ 0011 GRIP
+ 0012 SGH PSHAC GSN
+ 1001 Magic Carpet
+ 1002 Lithium
+ 1003 Dual JPEG 1
+ 1004 Dual JPEG 2
+ 1005 Dual JPEG 3
+ 1006 Dual JPEG 4
+ 1007 Dual JPEG 5
+ 1008 Cesium
+ 2001 Fibre Channel
+ 2002 ASDE
+ 8001 O2 1394
+ 8002 G-net NT
+10aa ACC Microelectronics
+ 0000 ACCM 2188
+10ab Digicom
+10ac Honeywell IAC
+10ad Symphony Labs
+ 0001 W83769F
+ 0003 SL82C103
+ 0005 SL82C105
+ 0103 SL82c103
+ 0105 SL82c105
+ 0565 W83C553
+10ae Cornerstone Technology
+10af Micro Computer Systems Inc
+10b0 CardExpert Technology
+10b1 Cabletron Systems Inc
+10b2 Raytheon Company
+10b3 Databook Inc
+ 3106 DB87144
+ b106 DB87144
+10b4 STB Systems Inc
+ 1b1d Velocity 128 3D
+ 10b4 237e Velocity 4400
+10b5 PLX Technology, Inc.
+ 0001 i960 PCI bus interface
+ 1076 VScom 800 8 port serial adaptor
+ 1077 VScom 400 4 port serial adaptor
+ 1078 VScom 210 2 port serial and 1 port parallel adaptor
+ 1103 VScom 200 2 port serial adaptor
+ 1146 VScom 010 1 port parallel adaptor
+ 1147 VScom 020 2 port parallel adaptor
+ 2724 Thales PCSM Security Card
+ 9030 PCI <-> IOBus Bridge Hot Swap
+ 15ed 1002 MCCS 8-port Serial Hot Swap
+ 15ed 1003 MCCS 16-port Serial Hot Swap
+ 9036 9036
+ 9050 PCI <-> IOBus Bridge
+ 10b5 2036 SatPak GPS
+ 10b5 2273 SH-ARC SoHard ARCnet card
+ 10b5 9050 MP9050
+ 1522 0001 RockForce 4 Port V.90 Data/Fax/Voice Modem
+ 1522 0002 RockForce 2 Port V.90 Data/Fax/Voice Modem
+ 1522 0003 RockForce 6 Port V.90 Data/Fax/Voice Modem
+ 1522 0004 RockForce 8 Port V.90 Data/Fax/Voice Modem
+ 1522 0010 RockForce2000 4 Port V.90 Data/Fax/Voice Modem
+ 1522 0020 RockForce2000 2 Port V.90 Data/Fax/Voice Modem
+ 15ed 1000 Macrolink MCCS 8-port Serial
+ 15ed 1001 Macrolink MCCS 16-port Serial
+ 15ed 1002 Macrolink MCCS 8-port Serial Hot Swap
+ 15ed 1003 Macrolink MCCS 16-port Serial Hot Swap
+ 5654 5634 OpenLine4 Telephony Card
+ d531 c002 PCIntelliCAN 2xSJA1000 CAN bus
+ d84d 4006 EX-4006 1P
+ d84d 4008 EX-4008 1P EPP/ECP
+ d84d 4014 EX-4014 2P
+ d84d 4018 EX-4018 3P EPP/ECP
+ d84d 4025 EX-4025 1S(16C550) RS-232
+ d84d 4027 EX-4027 1S(16C650) RS-232
+ d84d 4028 EX-4028 1S(16C850) RS-232
+ d84d 4036 EX-4036 2S(16C650) RS-232
+ d84d 4037 EX-4037 2S(16C650) RS-232
+ d84d 4038 EX-4038 2S(16C850) RS-232
+ d84d 4052 EX-4052 1S(16C550) RS-422/485
+ d84d 4053 EX-4053 2S(16C550) RS-422/485
+ d84d 4055 EX-4055 4S(16C550) RS-232
+ d84d 4058 EX-4055 4S(16C650) RS-232
+ d84d 4065 EX-4065 8S(16C550) RS-232
+ d84d 4068 EX-4068 8S(16C650) RS-232
+ d84d 4078 EX-4078 2S(16C552) RS-232+1P
+ 9054 PCI <-> IOBus Bridge
+ 10b5 2455 Wessex Techology PHIL-PCI
+ 9060 9060
+ 906d 9060SD
+ 125c 0640 Aries 16000P
+ 906e 9060ES
+ 9080 9080
+ 10b5 9080 9080 [real subsystem ID not set]
+ 129d 0002 Aculab PCI Prosidy card
+10b6 Madge Networks
+ 0001 Smart 16/4 PCI Ringnode
+ 0002 Smart 16/4 PCI Ringnode Mk2
+ 10b6 0002 Smart 16/4 PCI Ringnode Mk2
+ 10b6 0006 16/4 CardBus Adapter
+ 0003 Smart 16/4 PCI Ringnode Mk3
+ 0e11 b0fd Compaq NC4621 PCI, 4/16, WOL
+ 10b6 0003 Smart 16/4 PCI Ringnode Mk3
+ 10b6 0007 Presto PCI Plus Adapter
+ 0004 Smart 16/4 PCI Ringnode Mk1
+ 0006 16/4 Cardbus Adapter
+ 10b6 0006 16/4 CardBus Adapter
+ 0007 Presto PCI Adapter
+ 10b6 0007 Presto PCI
+ 0009 Smart 100/16/4 PCI-HS Ringnode
+ 10b6 0009 Smart 100/16/4 PCI-HS Ringnode
+ 000a Smart 100/16/4 PCI Ringnode
+ 10b6 000a Smart 100/16/4 PCI Ringnode
+ 000b 16/4 CardBus Adapter Mk2
+ 10b6 0008 16/4 CardBus Adapter Mk2
+ 10b6 000b 16/4 Cardbus Adapter Mk2
+ 000c RapidFire 3140V2 16/4 TR Adapter
+ 10b6 000c RapidFire 3140V2 16/4 TR Adapter
+ 1000 Collage 25/155 ATM Client Adapter
+ 1001 Collage 155 ATM Server Adapter
+10b7 3Com Corporation
+ 0001 3c985 1000BaseSX (SX/TX)
+ 1006 MINI PCI type 3B Data Fax Modem
+ 1007 Mini PCI 56k Winmodem
+ 10b7 615c Mini PCI 56K Modem
+ 3390 3c339 TokenLink Velocity
+ 3590 3c359 TokenLink Velocity XL
+ 10b7 3590 TokenLink Velocity XL Adapter (3C359/359B)
+ 4500 3c450 Cyclone/unknown
+ 5055 3c555 Laptop Hurricane
+ 5057 3c575 [Megahertz] 10/100 LAN CardBus
+ 10b7 5a57 3C575 Megahertz 10/100 LAN Cardbus PC Card
+ 5157 3c575 [Megahertz] 10/100 LAN CardBus
+ 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card
+ 5257 3CCFE575CT Cyclone CardBus
+ 10b7 5c57 FE575C-3Com 10/100 LAN CardBus-Fast Ethernet
+ 5900 3c590 10BaseT [Vortex]
+ 5920 3c592 EISA 10mbps Demon/Vortex
+ 5950 3c595 100BaseTX [Vortex]
+ 5951 3c595 100BaseT4 [Vortex]
+ 5952 3c595 100Base-MII [Vortex]
+ 5970 3c597 EISA Fast Demon/Vortex
+ 5b57 3c595 [Megahertz] 10/100 LAN CardBus
+ 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card
+ 6055 3c556 Hurricane CardBus
+ 6056 3c556B Hurricane CardBus
+ 10b7 6556 10/100 Mini PCI Ethernet Adapter
+ 6560 3CCFE656 Cyclone CardBus
+ 10b7 656a 3CCFEM656 10/100 LAN+56K Modem CardBus
+ 6561 3CCFEM656 10/100 LAN+56K Modem CardBus
+ 10b7 656b 3CCFEM656 10/100 LAN+56K Modem CardBus
+ 6562 3CCFEM656 [id 6562] Cyclone CardBus
+ 10b7 656b 3CCFEM656B 10/100 LAN+56K Modem CardBus
+ 6563 3CCFEM656B 10/100 LAN+56K Modem CardBus
+ 10b7 656b 3CCFEM656 10/100 LAN+56K Modem CardBus
+ 6564 3CCFEM656 [id 6564] Cyclone CardBus
+ 7646 3cSOHO100-TX Hurricane
+ 7940 3c803 FDDILink UTP Controller
+ 7980 3c804 FDDILink SAS Controller
+ 7990 3c805 FDDILink DAS Controller
+ 8811 Token ring
+ 9000 3c900 10BaseT [Boomerang]
+ 9001 3c900 Combo [Boomerang]
+ 9004 3c900B-TPO [Etherlink XL TPO]
+ 10b7 9004 3C900B-TPO Etherlink XL TPO 10Mb
+ 9005 3c900B-Combo [Etherlink XL Combo]
+ 10b7 9005 3C900B-Combo Etherlink XL Combo
+ 9006 3c900B-TPC [Etherlink XL TPC]
+ 900a 3c900B-FL [Etherlink XL FL]
+ 9050 3c905 100BaseTX [Boomerang]
+ 9051 3c905 100BaseT4 [Boomerang]
+ 9055 3c905B 100BaseTX [Cyclone]
+ 1028 0080 3C905B Fast Etherlink XL 10/100
+ 1028 0081 3C905B Fast Etherlink XL 10/100
+ 1028 0082 3C905B Fast Etherlink XL 10/100
+ 1028 0083 3C905B Fast Etherlink XL 10/100
+ 1028 0084 3C905B Fast Etherlink XL 10/100
+ 1028 0085 3C905B Fast Etherlink XL 10/100
+ 1028 0086 3C905B Fast Etherlink XL 10/100
+ 1028 0087 3C905B Fast Etherlink XL 10/100
+ 1028 0088 3C905B Fast Etherlink XL 10/100
+ 1028 0089 3C905B Fast Etherlink XL 10/100
+ 1028 0090 3C905B Fast Etherlink XL 10/100
+ 1028 0091 3C905B Fast Etherlink XL 10/100
+ 1028 0092 3C905B Fast Etherlink XL 10/100
+ 1028 0093 3C905B Fast Etherlink XL 10/100
+ 1028 0094 3C905B Fast Etherlink XL 10/100
+ 1028 0095 3C905B Fast Etherlink XL 10/100
+ 1028 0096 3C905B Fast Etherlink XL 10/100
+ 1028 0097 3C905B Fast Etherlink XL 10/100
+ 1028 0098 3C905B Fast Etherlink XL 10/100
+ 1028 0099 3C905B Fast Etherlink XL 10/100
+ 10b7 9055 3C905B Fast Etherlink XL 10/100
+ 9056 3c905B-T4 [Fast EtherLink XL 10/100]
+ 9058 3c905B-Combo [Deluxe Etherlink XL 10/100]
+ 905a 3c905B-FX [Fast Etherlink XL FX 10/100]
+ 9200 3c905C-TX/TX-M [Tornado]
+ 1028 0095 Integrated 3C905C-TX Fast Etherlink for PC Management NIC
+ 10b7 1000 3C905C-TX Fast Etherlink for PC Management NIC
+ 10b7 7000 10/100 Mini PCI Ethernet Adapter
+ 9201 3C920B-EMB Integrated Fast Ethernet Controller
+ 9300 3CSOHO100B-TX [910-A01]
+ 9800 3c980-TX [Fast Etherlink XL Server Adapter]
+ 10b7 9800 3c980-TX Fast Etherlink XL Server Adapter
+ 9805 3c980-TX 10/100baseTX NIC [Python-T]
+ 10b7 1201 3c982-TXM 10/100baseTX Dual Port A [Hydra]
+ 10b7 1202 3c982-TXM 10/100baseTX Dual Port B [Hydra]
+ 10b7 9805 3c980 10/100baseTX NIC [Python-T]
+ 10f1 2462 Thunder K7 S2462
+ 9900 3C990-TX [Typhoon]
+ 9902 3CR990-TX-95 [Typhoon 56-bit]
+ 9903 3CR990-TX-97 [Typhoon 168-bit]
+ 9904 3C990B-TX-M/3C990BSVR [Typhoon2]
+ 10b7 1000 3CR990B-TX-M [Typhoon2]
+ 10b7 2000 3CR990BSVR [Typhoon2 Server]
+ 9905 3CR990-FX-95/97/95 [Typhon Fiber]
+ 10b7 1101 3CR990-FX-95 [Typhoon Fiber 56-bit]
+ 10b7 1102 3CR990-FX-97 [Typhoon Fiber 168-bit]
+ 10b7 2101 3CR990-FX-95 Server [Typhoon Fiber 56-bit]
+ 10b7 2102 3CR990-FX-97 Server [Typhoon Fiber 168-bit]
+ 9908 3CR990SVR95 [Typhoon Server 56-bit]
+ 9909 3CR990SVR97 [Typhoon Server 168-bit]
+ 990b 3C990SVR [Typhoon Server]
+10b8 Standard Microsystems Corp [SMC]
+ 0005 83C170QF
+ 1055 e000 LANEPIC 10/100 [EVB171Q-PCI]
+ 1055 e002 LANEPIC 10/100 [EVB171G-PCI]
+ 10b8 a011 EtherPower II 10/100
+ 10b8 a014 EtherPower II 10/100
+ 10b8 a015 EtherPower II 10/100
+ 10b8 a016 EtherPower II 10/100
+ 10b8 a017 EtherPower II 10/100
+ 0006 LANEPIC
+ 1055 e100 LANEPIC Cardbus Fast Ethernet Adapter
+ 1055 e102 LANEPIC Cardbus Fast Ethernet Adapter
+ 1055 e300 LANEPIC Cardbus Fast Ethernet Adapter
+ 1055 e302 LANEPIC Cardbus Fast Ethernet Adapter
+ 10b8 a012 LANEPIC Cardbus Fast Ethernet Adapter
+ 13a2 8002 LANEPIC Cardbus Fast Ethernet Adapter
+ 13a2 8006 LANEPIC Cardbus Fast Ethernet Adapter
+ 1000 FDC 37c665
+ 1001 FDC 37C922
+ a011 83C170QF
+ b106 SMC34C90
+10b9 ALi Corporation
+ 0111 C-Media CMI8738/C3DX Audio Device (OEM)
+ 10b9 0111 C-Media CMI8738/C3DX Audio Device (OEM)
+ 1435 M1435
+ 1445 M1445
+ 1449 M1449
+ 1451 M1451
+ 1461 M1461
+ 1489 M1489
+ 1511 M1511 [Aladdin]
+ 1512 M1512 [Aladdin]
+ 1513 M1513 [Aladdin]
+ 1521 M1521 [Aladdin III]
+ 10b9 1521 ALI M1521 Aladdin III CPU Bridge
+ 1523 M1523
+ 10b9 1523 ALI M1523 ISA Bridge
+ 1531 M1531 [Aladdin IV]
+ 1533 M1533 PCI to ISA Bridge [Aladdin IV]
+ 10b9 1533 ALI M1533 Aladdin IV ISA Bridge
+ 1541 M1541
+ 10b9 1541 ALI M1541 Aladdin V/V+ AGP System Controller
+ 1543 M1543
+ 1563 M1563 HyperTransport South Bridge
+ 1621 M1621
+ 1631 ALI M1631 PCI North Bridge Aladdin Pro III
+ 1632 M1632M Northbridge+Trident
+ 1641 ALI M1641 PCI North Bridge Aladdin Pro IV
+ 1644 M1644/M1644T Northbridge+Trident
+ 1646 M1646 Northbridge+Trident
+ 1647 M1647 Northbridge [MAGiK 1 / MobileMAGiK 1]
+ 1651 M1651/M1651T Northbridge [Aladdin-Pro 5/5M,Aladdin-Pro 5T/5TM]
+ 1671 M1671 Super P4 Northbridge [AGP4X,PCI and SDR/DDR]
+ 1681 M1681 P4 Northbridge [AGP8X,HyperTransport and SDR/DDR]
+ 1687 M1687 K8 Northbridge [AGP8X and HyperTransport]
+ 3141 M3141
+ 3143 M3143
+ 3145 M3145
+ 3147 M3147
+ 3149 M3149
+ 3151 M3151
+ 3307 M3307
+ 3309 M3309
+ 5212 M4803
+ 5215 MS4803
+ 5217 M5217H
+ 5219 M5219
+ 5225 M5225
+ 5229 M5229 IDE
+ 1043 8053 A7A266 Motherboard IDE
+ 5235 M5225
+ 5237 USB 1.1 Controller
+ 5239 USB 2.0 Controller
+ 5243 M1541 PCI to AGP Controller
+ 5247 PCI to AGP Controller
+ 5249 M5249 HTT to PCI Bridge
+ 5251 M5251 P1394 OHCI 1.0 Controller
+ 5253 M5253 P1394 OHCI 1.1 Controller
+ 5261 M5261 Ethernet Controller
+ 5451 M5451 PCI AC-Link Controller Audio Device
+ 1014 0506 ThinkPad R30
+ 5453 M5453 PCI AC-Link Controller Modem Device
+ 5455 M5455 PCI AC-Link Controller Audio Device
+ 5457 Intel 537 [M5457 AC-Link Modem]
+# Same but more usefull for driver's lookup
+ 5459 SmartLink SmartPCI561 56K Modem
+# SmartLink PCI SoftModem
+ 545a SmartLink SmartPCI563 56K Modem
+ 5471 M5471 Memory Stick Controller
+ 5473 M5473 SD-MMC Controller
+ 7101 M7101 PMU
+ 10b9 7101 ALI M7101 Power Management Controller
+10ba Mitsubishi Electric Corp.
+ 0301 AccelGraphics AccelECLIPSE
+10bb Dapha Electronics Corporation
+10bc Advanced Logic Research
+10bd Surecom Technology
+ 0e34 NE-34
+10be Tseng Labs International Co.
+10bf Most Inc
+10c0 Boca Research Inc.
+10c1 ICM Co., Ltd.
+10c2 Auspex Systems Inc.
+10c3 Samsung Semiconductors, Inc.
+ 1100 Smartether100 SC1100 LAN Adapter (i82557B)
+10c4 Award Software International Inc.
+10c5 Xerox Corporation
+10c6 Rambus Inc.
+10c7 Media Vision
+10c8 Neomagic Corporation
+ 0001 NM2070 [MagicGraph 128]
+ 0002 NM2090 [MagicGraph 128V]
+ 0003 NM2093 [MagicGraph 128ZV]
+ 0004 NM2160 [MagicGraph 128XD]
+ 1014 00ba MagicGraph 128XD
+ 1025 1007 MagicGraph 128XD
+ 1028 0074 MagicGraph 128XD
+ 1028 0075 MagicGraph 128XD
+ 1028 007d MagicGraph 128XD
+ 1028 007e MagicGraph 128XD
+ 1033 802f MagicGraph 128XD
+ 104d 801b MagicGraph 128XD
+ 104d 802f MagicGraph 128XD
+ 104d 830b MagicGraph 128XD
+ 10ba 0e00 MagicGraph 128XD
+ 10c8 0004 MagicGraph 128XD
+ 10cf 1029 MagicGraph 128XD
+ 10f7 8308 MagicGraph 128XD
+ 10f7 8309 MagicGraph 128XD
+ 10f7 830b MagicGraph 128XD
+ 10f7 830d MagicGraph 128XD
+ 10f7 8312 MagicGraph 128XD
+ 0005 NM2200 [MagicGraph 256AV]
+ 1014 00dd ThinkPad 570
+ 0006 NM2360 [MagicMedia 256ZX]
+ 0016 NM2380 [MagicMedia 256XL+]
+ 10c8 0016 MagicMedia 256XL+
+ 0025 NM2230 [MagicGraph 256AV+]
+ 0083 NM2093 [MagicGraph 128ZV+]
+ 8005 NM2200 [MagicMedia 256AV Audio]
+ 0e11 b0d1 MagicMedia 256AV Audio Device on Discovery
+ 0e11 b126 MagicMedia 256AV Audio Device on Durango
+ 1014 00dd MagicMedia 256AV Audio Device on BlackTip Thinkpad
+ 1025 1003 MagicMedia 256AV Audio Device on TravelMate 720
+ 1028 008f MagicMedia 256AV Audio Device on Colorado Inspiron
+ 103c 0007 MagicMedia 256AV Audio Device on Voyager II
+ 103c 0008 MagicMedia 256AV Audio Device on Voyager III
+ 103c 000d MagicMedia 256AV Audio Device on Omnibook 900
+ 10c8 8005 MagicMedia 256AV Audio Device on FireAnt
+ 110a 8005 MagicMedia 256AV Audio Device
+ 14c0 0004 MagicMedia 256AV Audio Device
+ 8006 NM2360 [MagicMedia 256ZX Audio]
+ 8016 NM2380 [MagicMedia 256XL+ Audio]
+10c9 Dataexpert Corporation
+10ca Fujitsu Microelectr., Inc.
+10cb Omron Corporation
+10cc Mentor ARC Inc
+10cd Advanced System Products, Inc
+ 1100 ASC1100
+ 1200 ASC1200 [(abp940) Fast SCSI-II]
+ 1300 ABP940-U / ABP960-U
+ 10cd 1310 ASC1300 SCSI Adapter
+ 2300 ABP940-UW
+ 2500 ABP940-U2W
+10ce Radius
+10cf Citicorp TTI
+ 2001 mb86605
+10d0 Fujitsu Limited
+10d1 FuturePlus Systems Corp.
+10d2 Molex Incorporated
+10d3 Jabil Circuit Inc
+10d4 Hualon Microelectronics
+10d5 Autologic Inc.
+10d6 Cetia
+10d7 BCM Advanced Research
+10d8 Advanced Peripherals Labs
+10d9 Macronix, Inc. [MXIC]
+ 0512 MX98713
+ 0531 MX987x5
+ 1186 1200 DFE-540TX ProFAST 10/100 Adapter
+ 8625 MX86250
+ 8888 MX86200
+10da Compaq IPG-Austin
+ 0508 TC4048 Token Ring 4/16
+ 3390 Tl3c3x9
+10db Rohm LSI Systems, Inc.
+10dc CERN/ECP/EDU
+ 0001 STAR/RD24 SCI-PCI (PMC)
+ 0002 TAR/RD24 SCI-PCI (PMC)
+ 0021 HIPPI destination
+ 0022 HIPPI source
+ 10dc ATT2C15-3 FPGA
+10dd Evans & Sutherland
+10de nVidia Corporation
+ 0008 NV1 [EDGE 3D]
+ 0009 NV1 [EDGE 3D]
+ 0010 NV2 [Mutara V08]
+ 0020 NV4 [RIVA TNT]
+ 1043 0200 V3400 TNT
+ 1048 0c18 Erazor II SGRAM
+ 1048 0c1b Erazor II
+ 1092 0550 Viper V550
+ 1092 0552 Viper V550
+ 1092 4804 Viper V550
+ 1092 4808 Viper V550
+ 1092 4810 Viper V550
+ 1092 4812 Viper V550
+ 1092 4815 Viper V550
+ 1092 4820 Viper V550 with TV out
+ 1092 4822 Viper V550
+ 1092 4904 Viper V550
+ 1092 4914 Viper V550
+ 1092 8225 Viper V550
+ 10b4 273d Velocity 4400
+ 10b4 273e Velocity 4400
+ 10b4 2740 Velocity 4400
+ 10de 0020 Riva TNT
+ 1102 1015 Graphics Blaster CT6710
+ 1102 1016 Graphics Blaster RIVA TNT
+ 0028 NV5 [RIVA TNT2/TNT2 Pro]
+ 1043 0200 AGP-V3800 SGRAM
+ 1043 0201 AGP-V3800 SDRAM
+ 1043 0205 PCI-V3800
+ 1043 4000 AGP-V3800PRO
+ 1092 4804 Viper V770
+ 1092 4a00 Viper V770
+ 1092 4a02 Viper V770 Ultra
+ 1092 5a00 RIVA TNT2/TNT2 Pro
+ 1092 6a02 Viper V770 Ultra
+ 1092 7a02 Viper V770 Ultra
+ 10de 0005 RIVA TNT2 Pro
+ 10de 000f Compaq NVIDIA TNT2 Pro
+ 1102 1020 3D Blaster RIVA TNT2
+ 1102 1026 3D Blaster RIVA TNT2 Digital
+ 14af 5810 Maxi Gamer Xentor
+ 0029 NV5 [RIVA TNT2 Ultra]
+ 1043 0200 AGP-V3800 Deluxe
+ 1043 0201 AGP-V3800 Ultra SDRAM
+ 1043 0205 PCI-V3800 Ultra
+ 1102 1021 3D Blaster RIVA TNT2 Ultra
+ 1102 1029 3D Blaster RIVA TNT2 Ultra
+ 1102 102f 3D Blaster RIVA TNT2 Ultra
+ 14af 5820 Maxi Gamer Xentor 32
+ 002a NV5 [Riva TnT2]
+ 002b NV5 [Riva TnT2]
+ 002c NV6 [Vanta/Vanta LT]
+ 1043 0200 AGP-V3800 Combat SDRAM
+ 1043 0201 AGP-V3800 Combat
+ 1092 6820 Viper V730
+ 1102 1031 CT6938 VANTA 8MB
+ 1102 1034 CT6894 VANTA 16MB
+ 14af 5008 Maxi Gamer Phoenix 2
+ 002d NV5M64 [RIVA TNT2 Model 64/Model 64 Pro]
+ 1043 0200 AGP-V3800M
+ 1043 0201 AGP-V3800M
+ 1048 0c3a Erazor III LT
+ 10de 001e M64 AGP4x
+ 1102 1023 CT6892 RIVA TNT2 Value
+ 1102 1024 CT6932 RIVA TNT2 Value 32Mb
+ 1102 102c CT6931 RIVA TNT2 Value [Jumper]
+ 1462 8808 MSI-8808
+ 1554 1041 PixelView RIVA TNT2 M64 32MB
+ 002e NV6 [Vanta]
+ 002f NV6 [Vanta]
+ 0060 nForce2 ISA Bridge
+ 1043 80ad A7N8X Mainboard
+ 0064 nForce2 SMBus (MCP)
+ 0065 nForce2 IDE
+ 0066 nForce2 Ethernet Controller
+ 0067 nForce2 USB Controller
+ 1043 0c11 A7N8X Mainboard
+ 0068 nForce2 USB Controller
+ 1043 0c11 A7N8X Mainboard
+ 006a nForce2 AC97 Audio Controler (MCP)
+ 006b nForce MultiMedia audio [Via VT82C686B]
+ 006e nForce2 FireWire (IEEE 1394) Controller
+ 00a0 NV5 [Aladdin TNT2]
+ 14af 5810 Maxi Gamer Xentor
+ 0100 NV10 [GeForce 256 SDR]
+ 1043 0200 AGP-V6600 SGRAM
+ 1043 0201 AGP-V6600 SDRAM
+ 1043 4008 AGP-V6600 SGRAM
+ 1043 4009 AGP-V6600 SDRAM
+ 1102 102d CT6941 GeForce 256
+ 14af 5022 3D Prophet SE
+ 0101 NV10DDR [GeForce 256 DDR]
+ 1043 0202 AGP-V6800 DDR
+ 1043 400a AGP-V6800 DDR SGRAM
+ 1043 400b AGP-V6800 DDR SDRAM
+ 1102 102e CT6971 GeForce 256 DDR
+ 14af 5021 3D Prophet DDR-DVI
+ 0103 NV10GL [Quadro]
+ 0110 NV11 [GeForce2 MX/MX 400]
+ 1043 4015 AGP-V7100 Pro
+ 1043 4031 V7100 Pro with TV output
+ 1462 8817 MSI GeForce2 MX400 Pro32S [MS-8817]
+ 14af 7102 3D Prophet II MX
+ 14af 7103 3D Prophet II MX Dual-Display
+ 0111 NV11DDR [GeForce2 MX 100 DDR/200 DDR]
+ 0112 NV11 [GeForce2 Go]
+ 0113 NV11GL [Quadro2 MXR/EX]
+ 0150 NV15 [GeForce2 GTS/Pro]
+ 1043 4016 V7700 AGP Video Card
+ 107d 2840 WinFast GeForce2 GTS with TV output
+ 1462 8831 Creative GeForce2 Pro
+ 0151 NV15DDR [GeForce2 Ti]
+ 1043 405f V7700Ti
+ 0152 NV15BR [GeForce2 Ultra, Bladerunner]
+ 1048 0c56 GLADIAC Ultra
+ 0153 NV15GL [Quadro2 Pro]
+ 0170 NV17 [GeForce4 MX 460]
+ 0171 NV17 [GeForce4 MX 440]
+ 1462 8661 G4MX440-VTP
+ 1462 8730 MX440SES-T (MS-8873)
+ 147b 8f00 Abit Siluro GeForce4MX440
+ 0172 NV17 [GeForce4 MX 420]
+ 0173 NV17 [GeForce4 MX 440-SE]
+ 0174 NV17 [GeForce4 440 Go]
+ 0175 NV17 [GeForce4 420 Go]
+ 0176 NV17 [GeForce4 420 Go 32M]
+ 0178 NV17GL [Quadro4 550 XGL]
+ 0179 NV17 [GeForce4 440 Go 64M]
+ 017a NV17GL [Quadro4 200/400 NVS]
+ 017b NV17GL [Quadro4 550 XGL]
+ 017c NV17GL [Quadro4 550 GoGL]
+ 0181 NV18 [GeForce4 MX 440 AGP 8x]
+ 0182 NV18 [GeForce4 MX 440SE AGP 8x]
+ 0183 NV18 [GeForce4 MX 420 AGP 8x]
+ 0188 NV18GL [Quadro4 580 XGL]
+ 018a NV18GL [Quadro4 NVS]
+ 018b NV18GL [Quadro4 380 XGL]
+ 01a0 NV15 [GeForce2 - nForce GPU]
+ 01a4 nForce CPU bridge
+ 01ab nForce 420 Memory Controller (DDR)
+ 01ac nForce 220/420 Memory Controller
+ 01ad nForce 220/420 Memory Controller
+ 01b1 nForce Audio
+ 01b2 nForce ISA Bridge
+ 01b4 nForce PCI System Management
+ 01b7 nForce AGP to PCI Bridge
+ 01b8 nForce PCI-to-PCI bridge
+ 01bc nForce IDE
+ 01c1 Intel 537 [nForce MC97 Modem]
+ 01c2 nForce USB Controller
+ 01c3 nForce Ethernet Controller
+ 01e8 nForce2 AGP
+ 01f0 NV18 [GeForce4 MX - nForce GPU]
+ 0200 NV20 [GeForce3]
+ 1043 402f AGP-V8200 DDR
+ 0201 NV20 [GeForce3 Ti 200]
+ 0202 NV20 [GeForce3 Ti 500]
+ 1043 405b V8200 T5
+ 1545 002f Xtasy 6964
+ 0203 NV20DCC [Quadro DCC]
+ 0250 NV25 [GeForce4 Ti 4600]
+ 0251 NV25 [GeForce4 Ti 4400]
+ 0252 NV25 [GeForce4 Ti]
+ 0253 NV25 [GeForce4 Ti 4200]
+ 107d 2896 WinFast A250 LE TD (Dual VGA/TV-out/DVI)
+ 147b 8f09 Siluro (Dual VGA/TV-out/DVI)
+ 0258 NV25GL [Quadro4 900 XGL]
+ 0259 NV25GL [Quadro4 750 XGL]
+ 025b NV25GL [Quadro4 700 XGL]
+ 0280 NV28 [GeForce4 Ti 4800]
+ 0281 NV28 [GeForce4 Ti 4200 AGP 8x]
+ 0282 NV28 [GeForce4 Ti 4800 SE]
+ 0288 NV28GL [Quadro4 980 XGL]
+ 0289 NV28GL [Quadro4 780 XGL]
+ 0300 NV30 [GeForce FX]
+ 0301 NV30 [GeForce FX 5800 Ultra]
+ 0302 NV30 [GeForce FX 5800]
+ 0308 NV30GL [Quadro FX 2000]
+ 0309 NV30GL [Quadro FX 1000]
+10df Emulex Corporation
+ 1ae5 LP6000 Fibre Channel Host Adapter
+ f085 LP850 Fibre Channel Adapter
+ f095 LP952 Fibre Channel Adapter
+ f098 LP982 Fibre Channel Adapter
+ f700 LP7000 Fibre Channel Host Adapter
+ f800 LP8000 Fibre Channel Host Adapter
+ f900 LP9000 Fibre Channel Host Adapter
+ f980 LP9802 Fibre Channel Adapter
+10e0 Integrated Micro Solutions Inc.
+ 5026 IMS5026/27/28
+ 5027 IMS5027
+ 5028 IMS5028
+ 8849 IMS8849
+ 8853 IMS8853
+ 9128 IMS9128 [Twin turbo 128]
+10e1 Tekram Technology Co.,Ltd.
+ 0391 TRM-S1040
+ 10e1 0391 DC-315U SCSI-3 Host Adapter
+ 690c DC-690c
+ dc29 DC-290
+10e2 Aptix Corporation
+10e3 Tundra Semiconductor Corp.
+ 0000 CA91C042 [Universe]
+ 0860 CA91C860 [QSpan]
+ 0862 CA91C862A [QSpan-II]
+10e4 Tandem Computers
+10e5 Micro Industries Corporation
+10e6 Gainbery Computer Products Inc.
+10e7 Vadem
+10e8 Applied Micro Circuits Corp.
+ 2011 Q-Motion Video Capture/Edit board
+ 4750 S5930 [Matchmaker]
+ 5920 S5920
+ 8043 LANai4.x [Myrinet LANai interface chip]
+ 8062 S5933_PARASTATION
+ 807d S5933 [Matchmaker]
+ 8088 Kongsberg Spacetec Format Synchronizer
+ 8089 Kongsberg Spacetec Serial Output Board
+ 809c S5933_HEPC3
+ 80d7 PCI-9112
+ 80d9 PCI-9118
+ 80da PCI-9812
+ 811a PCI-IEEE1355-DS-DE Interface
+ 8170 S5933 [Matchmaker] (Chipset Development Tool)
+ 82db AJA HDNTV HD SDI Framestore
+10e9 Alps Electric Co., Ltd.
+10ea Intergraphics Systems
+ 1680 IGA-1680
+ 1682 IGA-1682
+ 1683 IGA-1683
+ 2000 CyberPro 2000
+ 2010 CyberPro 2000A
+ 5000 CyberPro 5000
+ 5050 CyberPro 5050
+ 5202 CyberPro 5202
+10eb Artists Graphics
+ 0101 3GA
+ 8111 Twist3 Frame Grabber
+10ec Realtek Semiconductor Co., Ltd.
+ 8029 RTL-8029(AS)
+ 10b8 2011 EZ-Card (SMC1208)
+ 10ec 8029 RTL-8029(AS)
+ 1113 1208 EN1208
+ 1186 0300 DE-528
+ 1259 2400 AT-2400
+ 8129 RTL-8129
+ 10ec 8129 RT8129 Fast Ethernet Adapter
+ 8138 RT8139 (B/C) Cardbus Fast Ethernet Adapter
+ 10ec 8138 RT8139 (B/C) Fast Ethernet Adapter
+ 8139 RTL-8139/8139C/8139C+
+ 1025 8920 ALN-325
+ 1025 8921 ALN-325
+ 10bd 0320 EP-320X-R
+ 10ec 8139 RT8139
+ 1186 1300 DFE-538TX
+ 1186 1320 SN5200
+ 1186 8139 DRN-32TX
+ 11f6 8139 FN22-3(A) LinxPRO Ethernet Adapter
+ 1259 2500 AT-2500TX
+ 1259 2503 AT-2500TX/ACPI
+ 1429 d010 ND010
+ 1432 9130 EN-9130TX
+ 1436 8139 RT8139
+ 146c 1439 FE-1439TX
+ 1489 6001 GF100TXRII
+ 1489 6002 GF100TXRA
+ 149c 139a LFE-8139ATX
+ 149c 8139 LFE-8139TX
+ 2646 0001 EtheRx
+ 8e2e 7000 KF-230TX
+ 8e2e 7100 KF-230TX/2
+ a0a0 0007 ALN-325C
+ 8169 RTL-8169
+ 1371 434e ProG-2000L
+ 8197 SmartLAN56 56K Modem
+10ed Ascii Corporation
+ 7310 V7310
+10ee Xilinx Corporation
+ 3fc0 RME Digi96
+ 3fc1 RME Digi96/8
+ 3fc2 RME Digi96/8 Pro
+ 3fc3 RME Digi96/8 Pad
+ 3fc4 RME Digi9652 (Hammerfall)
+ 3fc5 RME Hammerfall DSP
+10ef Racore Computer Products, Inc.
+ 8154 M815x Token Ring Adapter
+10f0 Peritek Corporation
+10f1 Tyan Computer
+10f2 Achme Computer, Inc.
+10f3 Alaris, Inc.
+10f4 S-MOS Systems, Inc.
+10f5 NKK Corporation
+ a001 NDR4000 [NR4600 Bridge]
+10f6 Creative Electronic Systems SA
+10f7 Matsushita Electric Industrial Co., Ltd.
+10f8 Altos India Ltd
+10f9 PC Direct
+10fa Truevision
+ 000c TARGA 1000
+10fb Thesys Gesellschaft für Mikroelektronik mbH
+ 186f TH 6255
+10fc I-O Data Device, Inc.
+# What's in the cardbus end of a Sony ACR-A01 card, comes with newer Vaio CD-RW drives
+ 0003 Cardbus IDE Controller
+ 0005 Cardbus SCSI CBSC II
+10fd Soyo Computer, Inc
+10fe Fast Multimedia AG
+10ff NCube
+1100 Jazz Multimedia
+1101 Initio Corporation
+ 1060 INI-A100U2W
+ 9100 INI-9100/9100W
+ 9400 INI-940
+ 9401 INI-950
+ 9500 360P
+1102 Creative Labs
+ 0002 SB Live! EMU10k1
+ 1102 0020 CT4850 SBLive! Value
+ 1102 0021 CT4620 SBLive!
+ 1102 002f SBLive! mainboard implementation
+ 1102 4001 E-mu APS
+ 1102 8022 CT4780 SBLive! Value
+ 1102 8023 CT4790 SoundBlaster PCI512
+ 1102 8024 CT4760 SBLive!
+ 1102 8025 SBLive! Mainboard Implementation
+ 1102 8026 CT4830 SBLive! Value
+ 1102 8027 CT4832 SBLive! Value
+ 1102 8028 CT4760 SBLive! OEM version
+ 1102 8031 CT4831 SBLive! Value
+ 1102 8040 CT4760 SBLive!
+ 1102 8051 CT4850 SBLive! Value
+ 1102 8061 SBLive! Player 5.1
+ 0004 SB Audigy
+ 1102 0051 SB0090 Audigy Player
+ 1102 0053 SB0090 Audigy Player/OEM
+ 0006 [SB Live! Value] EMU10k1X
+ 4001 SB Audigy FireWire Port
+ 1102 0010 SB Audigy FireWire Port
+ 7002 SB Live! MIDI/Game Port
+ 1102 0020 Gameport Joystick
+ 7003 SB Audigy MIDI/Game port
+ 1102 0040 SB Audigy MIDI/Game Port
+ 7004 [SB Live! Value] Input device controller
+ 8064 SB0100 [SBLive! 5.1 OEM]
+ 8938 ES1371
+1103 Triones Technologies, Inc.
+ 0003 HPT343
+# Revisions: 01=HPT366, 03=HPT370, 04=HPT370A, 05=HPT372
+ 0004 HPT366/368/370/370A/372
+ 1103 0001 HPT370A
+ 1103 0005 HPT370 UDMA100
+ 0005 HPT372A
+ 0006 HPT302
+ 0007 HPT371
+ 0008 HPT374
+1104 RasterOps Corp.
+1105 Sigma Designs, Inc.
+ 1105 REALmagic Xcard MPEG 1/2/3/4 DVD Decoder
+ 8300 REALmagic Hollywood Plus DVD Decoder
+ 8400 EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder
+1106 VIA Technologies, Inc.
+ 0102 Embedded VIA Ethernet Controller
+ 0130 VT6305 1394.A Controller
+ 0305 VT8363/8365 [KT133/KM133]
+ 1043 8033 A7V Mainboard
+ 1043 803e A7V-E Mainboard
+ 1043 8042 A7V133/A7V133-C Mainboard
+ 147b a401 KT7/KT7-RAID/KT7A/KT7A-RAID Mainboard
+ 0391 VT8371 [KX133]
+ 0501 VT8501 [Apollo MVP4]
+ 0505 VT82C505
+ 0561 VT82C561
+ 0571 VT82C586/B/686A/B PIPC Bus Master IDE
+ 1043 8052 VT8233A Bus Master ATA100/66/33 IDE
+ 1106 0571 VT8235 Bus Master ATA133/100/66/33 IDE
+ 1179 0001 Magnia Z310
+ 1458 5002 GA-7VAX Mainboard
+ 0576 VT82C576 3V [Apollo Master]
+ 0585 VT82C585VP [Apollo VP1/VPX]
+ 0586 VT82C586/A/B PCI-to-ISA [Apollo VP]
+ 1106 0000 MVP3 ISA Bridge
+ 0595 VT82C595 [Apollo VP2]
+ 0596 VT82C596 ISA [Mobile South]
+ 1106 0000 VT82C596/A/B PCI to ISA Bridge
+ 1458 0596 VT82C596/A/B PCI to ISA Bridge
+ 0597 VT82C597 [Apollo VP3]
+ 0598 VT82C598 [Apollo MVP3]
+ 0601 VT8601 [Apollo ProMedia]
+ 0605 VT8605 [ProSavage PM133]
+ 0680 VT82C680 [Apollo P6]
+ 0686 VT82C686 [Apollo Super South]
+ 1043 8033 A7V Mainboard
+ 1043 803e A7V-E Mainboard
+ 1043 8040 A7M266 Mainboard
+ 1043 8042 A7V133/A7V133-C Mainboard
+ 1106 0000 VT82C686/A PCI to ISA Bridge
+ 1106 0686 VT82C686/A PCI to ISA Bridge
+ 1179 0001 Magnia Z310
+ 147b a702 KG7-Lite Mainboard
+ 0691 VT82C693A/694x [Apollo PRO133x]
+ 1179 0001 Magnia Z310
+ 1458 0691 VT82C691 Apollo Pro System Controller
+ 0693 VT82C693 [Apollo Pro Plus]
+ 0698 VT82C693A [Apollo Pro133 AGP]
+ 0926 VT82C926 [Amazon]
+ 1000 VT82C570MV
+ 1106 VT82C570MV
+ 1571 VT82C416MV
+ 1595 VT82C595/97 [Apollo VP2/97]
+ 3038 USB
+ 0925 1234 USB Controller
+ 1179 0001 Magnia Z310
+ 3040 VT82C586B ACPI
+ 3043 VT86C100A [Rhine]
+ 10bd 0000 VT86C100A Fast Ethernet Adapter
+ 1106 0100 VT86C100A Fast Ethernet Adapter
+ 1186 1400 DFE-530TX rev A
+ 3044 IEEE 1394 Host Controller
+ 3050 VT82C596 Power Management
+ 3051 VT82C596 Power Management
+ 3057 VT82C686 [Apollo Super ACPI]
+ 1043 8033 A7V Mainboard
+ 1043 803e A7V-E Mainboard
+ 1043 8040 A7M266 Mainboard
+ 1043 8042 A7V133/A7V133-C Mainboard
+ 1179 0001 Magnia Z310
+ 3058 VT82C686 AC97 Audio Controller
+ 0e11 b194 Soundmax integrated digital audio
+ 1106 4511 Onboard Audio on EP7KXA
+ 1458 7600 Onboard Audio
+ 1462 3091 MS-6309 Onboard Audio
+ 15dd 7609 Onboard Audio
+ 3059 VT8233 AC97 Audio Controller
+ 1458 a002 GA-7VAX Onboard Audio (Realtek ALC650)
+ 3065 VT6102 [Rhine-II]
+ 1106 0102 VT6102 [Rhine II] Embeded Ethernet Controller on VT8235
+ 1186 1400 DFE-530TX rev A
+ 1186 1401 DFE-530TX rev B
+ 3068 Intel 537 [AC97 Modem]
+ 3074 VT8233 PCI to ISA Bridge
+ 1043 8052 VT8233A
+ 3091 VT8633 [Apollo Pro266]
+ 3099 VT8366/A/7 [Apollo KT266/A/333]
+ 1043 8064 A7V266-E Mainboard
+ 1043 807f A7V333 Mainboard
+ 3101 VT8653 Host Bridge
+ 3102 VT8662 Host Bridge
+ 3103 VT8615 Host Bridge
+ 3104 USB 2.0
+ 1458 5004 GA-7VAX Mainboard
+ 3106 VT6105 [Rhine-III]
+ 3109 VT8233C PCI to ISA Bridge
+ 3112 VT8361 [KLE133] Host Bridge
+ 3116 VT8375 [KM266] Host Bridge
+# found on EPIA M6000/9000 mainboard
+ 3122 VT8623 [Apollo CLE266] integrated CastleRock graphics
+# found on EPIA M6000/9000 mainboard
+ 3123 VT8623 [Apollo CLE266]
+ 3128 VT8753 [P4X266 AGP]
+ 3133 VT3133 Host Bridge
+ 3147 VT8233A ISA Bridge
+ 3148 P4M266 Host Bridge
+ 3156 P/KN266 Host Bridge
+ 3168 VT8374 P4X400 Host Controller/AGP Bridge
+ 3177 VT8235 ISA Bridge
+ 1458 5001 GA-7VAX Mainboard
+ 3189 VT8377 [KT400 AGP] Host Bridge
+ 1458 5000 GA-7VAX Mainboard
+ 5030 VT82C596 ACPI [Apollo PRO]
+ 6100 VT85C100A [Rhine II]
+ 8231 VT8231 [PCI-to-ISA Bridge]
+ 8235 VT8235 ACPI
+ 8305 VT8363/8365 [KT133/KM133 AGP]
+ 8391 VT8371 [KX133 AGP]
+ 8501 VT8501 [Apollo MVP4 AGP]
+ 8596 VT82C596 [Apollo PRO AGP]
+ 8597 VT82C597 [Apollo VP3 AGP]
+ 8598 VT82C598/694x [Apollo MVP3/Pro133x AGP]
+ 8601 VT8601 [Apollo ProMedia AGP]
+ 8605 VT8605 [PM133 AGP]
+ 8691 VT82C691 [Apollo Pro]
+ 8693 VT82C693 [Apollo Pro Plus] PCI Bridge
+ b091 VT8633 [Apollo Pro266 AGP]
+ b099 VT8366/A/7 [Apollo KT266/A/333 AGP]
+ b101 VT8653 AGP Bridge
+ b102 VT8362 AGP Bridge
+ b103 VT8615 AGP Bridge
+ b112 VT8361 [KLE133] AGP Bridge
+ b168 VT8235 PCI Bridge
+1107 Stratus Computers
+ 0576 VIA VT82C570MV [Apollo] (Wrong vendor ID!)
+1108 Proteon, Inc.
+ 0100 p1690plus_AA
+ 0101 p1690plus_AB
+ 0105 P1690Plus
+ 0108 P1690Plus
+ 0138 P1690Plus
+ 0139 P1690Plus
+ 013c P1690Plus
+ 013d P1690Plus
+1109 Cogent Data Technologies, Inc.
+ 1400 EM110TX [EX110TX]
+110a Siemens Nixdorf AG
+ 0002 Pirahna 2-port
+ 0005 Tulip controller, power management, switch extender
+ 2102 DSCC4 WAN adapter
+ 4942 FPGA I-Bus Tracer for MBD
+ 6120 SZB6120
+110b Chromatic Research Inc.
+ 0001 Mpact Media Processor
+ 0004 Mpact 2
+110c Mini-Max Technology, Inc.
+110d Znyx Advanced Systems
+110e CPU Technology
+110f Ross Technology
+1110 Powerhouse Systems
+ 6037 Firepower Powerized SMP I/O ASIC
+ 6073 Firepower Powerized SMP I/O ASIC
+1111 Santa Cruz Operation
+# Also claimed to be RNS or Rockwell International, current PCISIG records list Osicom
+1112 Osicom Technologies Inc
+ 2200 FDDI Adapter
+ 2300 Fast Ethernet Adapter
+ 2340 4 Port Fast Ethernet Adapter
+ 2400 ATM Adapter
+1113 Accton Technology Corporation
+ 1211 SMC2-1211TX
+ 103c 1207 EN-1207D Fast Ethernet Adapter
+ 1113 1211 EN-1207D Fast Ethernet Adapter
+ 1216 EN-1216 Ethernet Adapter
+ 111a 1020 SpeedStream 1020 PCI 10/100 Ethernet Adaptor [EN-1207F-TX ?]
+ 1217 EN-1217 Ethernet Adapter
+ 5105 10Mbps Network card
+ 9211 EN-1207D Fast Ethernet Adapter
+ 1113 9211 EN-1207D Fast Ethernet Adapter
+ 9511 Fast Ethernet Adapter
+1114 Atmel Corporation
+1115 3D Labs
+1116 Data Translation
+ 0022 DT3001
+ 0023 DT3002
+ 0024 DT3003
+ 0025 DT3004
+ 0026 DT3005
+ 0027 DT3001-PGL
+ 0028 DT3003-PGL
+1117 Datacube, Inc
+ 9500 Max-1C SVGA card
+ 9501 Max-1C image processing
+1118 Berg Electronics
+1119 ICP Vortex Computersysteme GmbH
+ 0000 GDT 6000/6020/6050
+ 0001 GDT 6000B/6010
+ 0002 GDT 6110/6510
+ 0003 GDT 6120/6520
+ 0004 GDT 6530
+ 0005 GDT 6550
+ 0006 GDT 6x17
+ 0007 GDT 6x27
+ 0008 GDT 6537
+ 0009 GDT 6557
+ 000a GDT 6115/6515
+ 000b GDT 6125/6525
+ 000c GDT 6535
+ 000d GDT 6555
+ 0100 GDT 6117RP/6517RP
+ 0101 GDT 6127RP/6527RP
+ 0102 GDT 6537RP
+ 0103 GDT 6557RP
+ 0104 GDT 6111RP/6511RP
+ 0105 GDT 6121RP/6521RP
+ 0110 GDT 6117RD/6517RD
+ 0111 GDT 6127RD/6527RD
+ 0112 GDT 6537RD
+ 0113 GDT 6557RD
+ 0114 GDT 6111RD/6511RD
+ 0115 GDT 6121RD/6521RD
+ 0118 GDT 6118RD/6518RD/6618RD
+ 0119 GDT 6128RD/6528RD/6628RD
+ 011a GDT 6538RD/6638RD
+ 011b GDT 6558RD/6658RD
+ 0120 GDT 6117RP2/6517RP2
+ 0121 GDT 6127RP2/6527RP2
+ 0122 GDT 6537RP2
+ 0123 GDT 6557RP2
+ 0124 GDT 6111RP2/6511RP2
+ 0125 GDT 6121RP2/6521RP2
+ 0136 GDT 6113RS/6513RS
+ 0137 GDT 6123RS/6523RS
+ 0138 GDT 6118RS/6518RS/6618RS
+ 0139 GDT 6128RS/6528RS/6628RS
+ 013a GDT 6538RS/6638RS
+ 013b GDT 6558RS/6658RS
+ 013c GDT 6533RS/6633RS
+ 013d GDT 6543RS/6643RS
+ 013e GDT 6553RS/6653RS
+ 013f GDT 6563RS/6663RS
+ 0166 GDT 7113RN/7513RN/7613RN
+ 0167 GDT 7123RN/7523RN/7623RN
+ 0168 GDT 7118RN/7518RN/7518RN
+ 0169 GDT 7128RN/7528RN/7628RN
+ 016a GDT 7538RN/7638RN
+ 016b GDT 7558RN/7658RN
+ 016c GDT 7533RN/7633RN
+ 016d GDT 7543RN/7643RN
+ 016e GDT 7553RN/7653RN
+ 016f GDT 7563RN/7663RN
+ 01d6 GDT 4x13RZ
+ 01d7 GDT 4x23RZ
+ 01f6 GDT 8x13RZ
+ 01f7 GDT 8x23RZ
+ 01fc GDT 8x33RZ
+ 01fd GDT 8x43RZ
+ 01fe GDT 8x53RZ
+ 01ff GDT 8x63RZ
+ 0210 GDT 6519RD/6619RD
+ 0211 GDT 6529RD/6629RD
+ 0260 GDT 7519RN/7619RN
+ 0261 GDT 7529RN/7629RN
+ 0300 GDT Raid Controller
+111a Efficient Networks, Inc
+ 0000 155P-MF1 (FPGA)
+ 0002 155P-MF1 (ASIC)
+ 0003 ENI-25P ATM
+ 111a 0000 ENI-25p Miniport ATM Adapter
+ 0005 SpeedStream (LANAI)
+ 111a 0001 ENI-3010 ATM
+ 111a 0009 ENI-3060 ADSL (VPI=0)
+ 111a 0101 ENI-3010 ATM
+ 111a 0109 ENI-3060CO ADSL (VPI=0)
+ 111a 0809 ENI-3060 ADSL (VPI=0 or 8)
+ 111a 0909 ENI-3060CO ADSL (VPI=0 or 8)
+ 111a 0a09 ENI-3060 ADSL (VPI=<0..15>)
+ 0007 SpeedStream ADSL
+ 111a 1001 ENI-3061 ADSL [ASIC]
+111b Teledyne Electronic Systems
+111c Tricord Systems Inc.
+ 0001 Powerbis Bridge
+111d Integrated Device Tech
+ 0001 IDT77211 ATM Adapter
+ 0003 IDT77252 ATM network controller
+111e Eldec
+111f Precision Digital Images
+ 4a47 Precision MX Video engine interface
+ 5243 Frame capture bus interface
+1120 EMC Corporation
+1121 Zilog
+1122 Multi-tech Systems, Inc.
+1123 Excellent Design, Inc.
+1124 Leutron Vision AG
+1125 Eurocore
+1126 Vigra
+1127 FORE Systems Inc
+ 0200 ForeRunner PCA-200 ATM
+ 0210 PCA-200PC
+ 0250 ATM
+ 0300 ForeRunner PCA-200EPC ATM
+ 0310 ATM
+ 0400 ForeRunnerHE ATM Adapter
+ 1127 0400 ForeRunnerHE ATM
+1129 Firmworks
+112a Hermes Electronics Company, Ltd.
+112b Linotype - Hell AG
+112c Zenith Data Systems
+112d Ravicad
+112e Infomedia Microelectronics Inc.
+112f Imaging Technology Inc
+ 0000 MVC IC-PCI
+ 0001 MVC IM-PCI Video frame grabber/processor
+1130 Computervision
+1131 Philips Semiconductors
+ 1561 USB 1.1 Host Controller
+ 1562 USB 2.0 Host Controller
+ 3400 SmartPCI56(UCB1500) 56K Modem
+ 7130 SAA7130 Video Broadcast Decoder
+ 7133 SAA7133 Audio+video broadcast decoder
+# PCI audio and video broadcast decoder (http://www.semiconductors.philips.com/pip/saa7134hl)
+ 7134 SAA7134
+ 7135 SAA7135 Audio+video broadcast decoder
+ 7145 SAA7145
+ 7146 SAA7146
+ 114b 2003 DVRaptor Video Edit/Capture Card
+ 11bd 0006 DV500 Overlay
+ 11bd 000a DV500 Overlay
+1132 Mitel Corp.
+1133 Eicon Technology Corporation
+ 7901 EiconCard S90
+ 7902 EiconCard S90
+ 7911 EiconCard S91
+ 7912 EiconCard S91
+ 7941 EiconCard S94
+ 7942 EiconCard S94
+ 7943 EiconCard S94
+ 7944 EiconCard S94
+ b921 EiconCard P92
+ b922 EiconCard P92
+ b923 EiconCard P92
+ e001 DIVA 20PRO
+ 1133 e001 DIVA Pro 2.0 S/T
+ e002 DIVA 20
+ 1133 e002 DIVA 2.0 S/T
+ e003 DIVA 20PRO_U
+ 1133 e003 DIVA Pro 2.0 U
+ e004 DIVA 20_U
+ 1133 e004 DIVA 2.0 U
+ e005 DIVA LOW
+ 1133 e005 DIVA 2.01 S/T
+ e00b DIVA 2.02
+ e010 DIVA Server BRI-2M
+ 1133 e010 DIVA Server BRI-2M
+ e012 DIVA Server BRI-8M
+ 1133 e012 DIVA Server BRI-8M
+ e014 DIVA Server PRI-30M
+ 1133 e014 DIVA Server PRI-30M
+ e018 DIVA Server BRI-2M/-2F
+1134 Mercury Computer Systems
+ 0001 Raceway Bridge
+1135 Fuji Xerox Co Ltd
+ 0001 Printer controller
+1136 Momentum Data Systems
+1137 Cisco Systems Inc
+1138 Ziatech Corporation
+ 8905 8905 [STD 32 Bridge]
+1139 Dynamic Pictures, Inc
+ 0001 VGA Compatable 3D Graphics
+113a FWB Inc
+113b Network Computing Devices
+113c Cyclone Microsystems, Inc.
+ 0000 PCI-9060 i960 Bridge
+ 0001 PCI-SDK [PCI i960 Evaluation Platform]
+ 0911 PCI-911 [i960Jx-based Intelligent I/O Controller]
+ 0912 PCI-912 [i960CF-based Intelligent I/O Controller]
+ 0913 PCI-913
+ 0914 PCI-914 [I/O Controller w/ secondary PCI bus]
+113d Leading Edge Products Inc
+113e Sanyo Electric Co - Computer Engineering Dept
+113f Equinox Systems, Inc.
+ 0808 SST-64P Adapter
+ 1010 SST-128P Adapter
+ 80c0 SST-16P DB Adapter
+ 80c4 SST-16P RJ Adapter
+ 80c8 SST-16P Adapter
+ 8888 SST-4P Adapter
+ 9090 SST-8P Adapter
+1140 Intervoice Inc
+1141 Crest Microsystem Inc
+1142 Alliance Semiconductor Corporation
+ 3210 AP6410
+ 6422 ProVideo 6422
+ 6424 ProVideo 6424
+ 6425 ProMotion AT25
+ 643d ProMotion AT3D
+1143 NetPower, Inc
+1144 Cincinnati Milacron
+ 0001 Noservo controller
+1145 Workbit Corporation
+ 8007 NinjaSCSI-32 Workbit
+ f007 NinjaSCSI-32 KME
+ f010 NinjaSCSI-32 Workbit
+ f012 NinjaSCSI-32 Logitec
+ f013 NinjaSCSI-32 Logitec
+ f015 NinjaSCSI-32 Melco
+1146 Force Computers
+1147 Interface Corp
+1148 Syskonnect (Schneider & Koch)
+ 4000 FDDI Adapter
+ 0e11 b03b Netelligent 100 FDDI DAS Fibre SC
+ 0e11 b03c Netelligent 100 FDDI SAS Fibre SC
+ 0e11 b03d Netelligent 100 FDDI DAS UTP
+ 0e11 b03e Netelligent 100 FDDI SAS UTP
+ 0e11 b03f Netelligent 100 FDDI SAS Fibre MIC
+ 1148 5521 FDDI SK-5521 (SK-NET FDDI-UP)
+ 1148 5522 FDDI SK-5522 (SK-NET FDDI-UP DAS)
+ 1148 5541 FDDI SK-5541 (SK-NET FDDI-FP)
+ 1148 5543 FDDI SK-5543 (SK-NET FDDI-LP)
+ 1148 5544 FDDI SK-5544 (SK-NET FDDI-LP DAS)
+ 1148 5821 FDDI SK-5821 (SK-NET FDDI-UP64)
+ 1148 5822 FDDI SK-5822 (SK-NET FDDI-UP64 DAS)
+ 1148 5841 FDDI SK-5841 (SK-NET FDDI-FP64)
+ 1148 5843 FDDI SK-5843 (SK-NET FDDI-LP64)
+ 1148 5844 FDDI SK-5844 (SK-NET FDDI-LP64 DAS)
+ 4200 Token Ring adapter
+ 4300 Gigabit Ethernet
+ 1148 9821 SK-9821 (1000Base-T single link)
+ 1148 9822 SK-9822 (1000Base-T dual link)
+ 1148 9841 SK-9841 (1000Base-LX single link)
+ 1148 9842 SK-9842 (1000Base-LX dual link)
+ 1148 9843 SK-9843 (1000Base-SX single link)
+ 1148 9844 SK-9844 (1000Base-SX dual link)
+ 1148 9861 SK-9861 (1000Base-SX VF45 single link)
+ 1148 9862 SK-9862 (1000Base-SX VF45 dual link)
+# Information got from SysKonnekt
+ 1148 9871 SK-9871 (1000Base-ZX single link)
+# Information got from SysKonnekt
+ 1148 9872 SK-9872 (1000Base-ZX dual link)
+ 1259 2970 AT-2970SX [Allied Telesyn]
+ 1259 2972 AT-2970T [Allied Telesyn]
+ 1259 2975 AT-2970SX [Allied Telesyn]
+ 1259 2977 AT-2970T [Allied Telesyn]
+ 4320 SK-98xx Gigabit Ethernet Server Adapter
+ 1148 5021 SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter
+ 1148 5041 SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter
+ 1148 5043 SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter
+ 1148 5051 SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter
+ 1148 5061 SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter
+ 1148 5071 SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter
+ 1148 9521 SK-9521 10/100/1000Base-T Adapter
+ 4400 Gigabit Ethernet
+1149 Win System Corporation
+114a VMIC
+ 5579 VMIPCI-5579 (Reflective Memory Card)
+ 5587 VMIPCI-5587 (Reflective Memory Card)
+ 6504 VMIC PCI 7755 FPGA
+ 7587 VMIVME-7587
+114b Canopus Co., Ltd
+114c Annabooks
+114d IC Corporation
+114e Nikon Systems Inc
+114f Digi International
+ 0002 AccelePort EPC
+ 0003 RightSwitch SE-6
+ 0004 AccelePort Xem
+ 0005 AccelePort Xr
+ 0006 AccelePort Xr,C/X
+ 0009 AccelePort Xr/J
+ 000a AccelePort EPC/J
+ 000c DataFirePRIme T1 (1-port)
+ 000d SyncPort 2-Port (x.25/FR)
+ 0011 AccelePort 8r EIA-232 (IBM)
+ 0012 AccelePort 8r EIA-422
+ 0013 AccelePort Xr
+ 0014 AccelePort 8r EIA-422
+ 0015 AccelePort Xem
+ 0016 AccelePort EPC/X
+ 0017 AccelePort C/X
+ 001a DataFirePRIme E1 (1-port)
+ 001b AccelePort C/X (IBM)
+ 001d DataFire RAS T1/E1/PRI
+ 114f 0050 DataFire RAS E1 Adapter
+ 114f 0051 DataFire RAS Dual E1 Adapter
+ 114f 0052 DataFire RAS T1 Adapter
+ 114f 0053 DataFire RAS Dual T1 Adapter
+ 0023 AccelePort RAS
+ 0024 DataFire RAS B4 ST/U
+ 114f 0030 DataFire RAS BRI U Adapter
+ 114f 0031 DataFire RAS BRI S/T Adapter
+ 0026 AccelePort 4r 920
+ 0027 AccelePort Xr 920
+ 0034 AccelePort 2r 920
+ 0035 DataFire DSP T1/E1/PRI cPCI
+ 0040 AccelePort Xp
+ 0042 AccelePort 2p PCI
+ 0070 Datafire Micro V IOM2 (Europe)
+ 0071 Datafire Micro V (Europe)
+ 0072 Datafire Micro V IOM2 (North America)
+ 0073 Datafire Micro V (North America)
+ 6001 Avanstar
+1150 Thinking Machines Corp
+1151 JAE Electronics Inc.
+1152 Megatek
+1153 Land Win Electronic Corp
+1154 Melco Inc
+1155 Pine Technology Ltd
+1156 Periscope Engineering
+1157 Avsys Corporation
+1158 Voarx R & D Inc
+ 3011 Tokenet/vg 1001/10m anylan
+ 9050 Lanfleet/Truevalue
+ 9051 Lanfleet/Truevalue
+1159 Mutech Corp
+ 0001 MV-1000
+115a Harlequin Ltd
+115b Parallax Graphics
+115c Photron Ltd.
+115d Xircom
+ 0003 Cardbus Ethernet 10/100
+ 1014 0181 10/100 EtherJet Cardbus Adapter
+ 1014 1181 10/100 EtherJet Cardbus Adapter
+ 1014 8181 10/100 EtherJet Cardbus Adapter
+ 1014 9181 10/100 EtherJet Cardbus Adapter
+ 115d 0181 Cardbus Ethernet 10/100
+ 115d 1181 Cardbus Ethernet 10/100
+ 1179 0181 Cardbus Ethernet 10/100
+ 8086 8181 EtherExpress PRO/100 Mobile CardBus 32 Adapter
+ 8086 9181 EtherExpress PRO/100 Mobile CardBus 32 Adapter
+ 0005 Cardbus Ethernet 10/100
+ 1014 0182 10/100 EtherJet Cardbus Adapter
+ 1014 1182 10/100 EtherJet Cardbus Adapter
+ 115d 0182 Cardbus Ethernet 10/100
+ 115d 1182 Cardbus Ethernet 10/100
+ 0007 Cardbus Ethernet 10/100
+ 1014 0182 10/100 EtherJet Cardbus Adapter
+ 1014 1182 10/100 EtherJet Cardbus Adapter
+ 115d 0182 Cardbus Ethernet 10/100
+ 115d 1182 Cardbus Ethernet 10/100
+ 000b Cardbus Ethernet 10/100
+ 1014 0183 10/100 EtherJet Cardbus Adapter
+ 115d 0183 Cardbus Ethernet 10/100
+ 000c Mini-PCI V.90 56k Modem
+ 000f Cardbus Ethernet 10/100
+ 1014 0183 10/100 EtherJet Cardbus Adapter
+ 115d 0183 Cardbus Ethernet 10/100
+ 0101 Cardbus 56k modem
+ 115d 1081 Cardbus 56k Modem
+ 0103 Cardbus Ethernet + 56k Modem
+ 1014 9181 Cardbus 56k Modem
+ 1115 1181 Cardbus Ethernet 100 + 56k Modem
+ 115d 1181 CBEM56G-100 Ethernet + 56k Modem
+ 8086 9181 PRO/100 LAN + Modem56 CardBus
+115e Peer Protocols Inc
+115f Maxtor Corporation
+1160 Megasoft Inc
+1161 PFU Limited
+1162 OA Laboratory Co Ltd
+1163 Rendition
+ 0001 Verite 1000
+ 2000 Verite V2000/V2100/V2200
+ 1092 2000 Stealth II S220
+1164 Advanced Peripherals Technologies
+1165 Imagraph Corporation
+ 0001 Motion TPEG Recorder/Player with audio
+1166 ServerWorks
+ 0005 CNB20-LE Host Bridge
+ 0007 CNB20-LE Host Bridge
+ 0008 CNB20HE Host Bridge
+ 0009 CNB20LE Host Bridge
+ 0010 CIOB30
+ 0011 CMIC-HE
+ 0012 CMIC-LE
+ 0013 CNB20-HE Host Bridge
+ 0014 CNB20-HE Host Bridge
+ 0015 CMIC-GC Host Bridge
+ 0016 CMIC-GC Host Bridge
+ 0017 GCNB-LE Host Bridge
+ 0200 OSB4 South Bridge
+ 0201 CSB5 South Bridge
+ 0203 CSB6 South Bridge
+ 0211 OSB4 IDE Controller
+ 0212 CSB5 IDE Controller
+ 0213 CSB6 RAID/IDE Controller
+ 0220 OSB4/CSB5 OHCI USB Controller
+ 0221 CSB6 OHCI USB Controller
+ 0225 GCLE Host Bridge
+ 0227 GCLE-2 Host Bridge
+1167 Mutoh Industries Inc
+1168 Thine Electronics Inc
+1169 Centre for Development of Advanced Computing
+116a Polaris Communications
+ 6100 Bus/Tag Channel
+ 6800 Escon Channel
+ 7100 Bus/Tag Channel
+ 7800 Escon Channel
+116b Connectware Inc
+116c Intelligent Resources Integrated Systems
+116d Martin-Marietta
+116e Electronics for Imaging
+116f Workstation Technology
+1170 Inventec Corporation
+1171 Loughborough Sound Images Plc
+1172 Altera Corporation
+1173 Adobe Systems, Inc
+1174 Bridgeport Machines
+1175 Mitron Computer Inc.
+1176 SBE Incorporated
+1177 Silicon Engineering
+1178 Alfa, Inc.
+ afa1 Fast Ethernet Adapter
+1179 Toshiba America Info Systems
+ 0103 EX-IDE Type-B
+ 0404 DVD Decoder card
+ 0406 Tecra Video Capture device
+ 0407 DVD Decoder card (Version 2)
+ 0601 601
+ 0603 ToPIC95 PCI to CardBus Bridge for Notebooks
+ 060a ToPIC95
+ 060f ToPIC97
+ 0617 ToPIC95 PCI to Cardbus Bridge with ZV Support
+ 0618 CPU to PCI and PCI to ISA bridge
+# Claimed to be Lucent DSP1645 [Mars], but that's apparently incorrect. Does anyone know the correct ID?
+ 0701 FIR Port
+ 0804 TC6371AF SmartMedia Controller
+ 0805 SD TypA Controller
+ 0d01 FIR Port Type-DO
+ 1179 0001 FIR Port Type-DO
+117a A-Trend Technology
+117b L G Electronics, Inc.
+117c Atto Technology
+117d Becton & Dickinson
+117e T/R Systems
+117f Integrated Circuit Systems
+1180 Ricoh Co Ltd
+ 0465 RL5c465
+ 0466 RL5c466
+ 0475 RL5c475
+ 144d c006 vpr Matrix 170B4 CardBus bridge
+ 0476 RL5c476 II
+ 1014 0185 ThinkPad A/T/X Series
+ 104d 80df Vaio PCG-FX403
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 0477 RL5c477
+ 0478 RL5c478
+ 1014 0184 ThinkPad A30p (2653-64G)
+ 0522 R5C522 IEEE 1394 Controller
+ 1014 01cf ThinkPad A30p (2653-64G)
+ 0551 R5C551 IEEE 1394 Controller
+ 144d c006 vpr Matrix 170B4
+ 0552 R5C552 IEEE 1394 Controller
+ 1014 0511 ThinkPad A/T/X Series
+1181 Telmatics International
+1183 Fujikura Ltd
+1184 Forks Inc
+1185 Dataworld International Ltd
+1186 D-Link System Inc
+ 0100 DC21041
+ 1002 DL10050 Sundance Ethernet
+ 1186 1002 DFE-550TX
+ 1186 1012 DFE-580TX
+ 1300 RTL8139 Ethernet
+ 1186 1300 DFE-538TX 10/100 Ethernet Adapter
+ 1186 1301 DFE-530TX+ 10/100 Ethernet Adapter
+ 1340 DFE-690TXD CardBus PC Card
+ 1561 DRP-32TXD Cardbus PC Card
+ 4000 DL2K Ethernet
+1187 Advanced Technology Laboratories, Inc.
+1188 Shima Seiki Manufacturing Ltd.
+1189 Matsushita Electronics Co Ltd
+118a Hilevel Technology
+118b Hypertec Pty Limited
+118c Corollary, Inc
+ 0014 PCIB [C-bus II to PCI bus host bridge chip]
+ 1117 Intel 8-way XEON Profusion Chipset [Cache Coherency Filter]
+118d BitFlow Inc
+ 0001 Raptor-PCI framegrabber
+ 0012 Model 12 Road Runner Frame Grabber
+ 0014 Model 14 Road Runner Frame Grabber
+ 0024 Model 24 Road Runner Frame Grabber
+ 0044 Model 44 Road Runner Frame Grabber
+ 0112 Model 12 Road Runner Frame Grabber
+ 0114 Model 14 Road Runner Frame Grabber
+ 0124 Model 24 Road Runner Frame Grabber
+ 0144 Model 44 Road Runner Frame Grabber
+ 0212 Model 12 Road Runner Frame Grabber
+ 0214 Model 14 Road Runner Frame Grabber
+ 0224 Model 24 Road Runner Frame Grabber
+ 0244 Model 44 Road Runner Frame Grabber
+ 0312 Model 12 Road Runner Frame Grabber
+ 0314 Model 14 Road Runner Frame Grabber
+ 0324 Model 24 Road Runner Frame Grabber
+ 0344 Model 44 Road Runner Frame Grabber
+118e Hermstedt GmbH
+118f Green Logic
+1190 Tripace
+ c731 TP-910/920/940 PCI Ultra(Wide) SCSI Adapter
+1191 Artop Electronic Corp
+ 0003 SCSI Cache Host Adapter
+ 0004 ATP8400
+ 0005 ATP850UF
+ 0006 ATP860 NO-BIOS
+ 0007 ATP860
+ 0008 ATP865 NO-ROM
+ 0009 ATP865
+ 8002 AEC6710 SCSI-2 Host Adapter
+ 8010 AEC6712UW SCSI
+ 8020 AEC6712U SCSI
+ 8030 AEC6712S SCSI
+ 8040 AEC6712D SCSI
+ 8050 AEC6712SUW SCSI
+1192 Densan Company Ltd
+1193 Zeitnet Inc.
+ 0001 1221
+ 0002 1225
+1194 Toucan Technology
+1195 Ratoc System Inc
+1196 Hytec Electronics Ltd
+1197 Gage Applied Sciences, Inc.
+1198 Lambda Systems Inc
+1199 Attachmate Corporation
+119a Mind Share, Inc.
+119b Omega Micro Inc.
+ 1221 82C092G
+119c Information Technology Inst.
+119d Bug, Inc. Sapporo Japan
+119e Fujitsu Microelectronics Ltd.
+ 0001 FireStream 155
+ 0003 FireStream 50
+119f Bull HN Information Systems
+11a0 Convex Computer Corporation
+11a1 Hamamatsu Photonics K.K.
+11a2 Sierra Research and Technology
+11a3 Deuretzbacher GmbH & Co. Eng. KG
+11a4 Barco Graphics NV
+11a5 Microunity Systems Eng. Inc
+11a6 Pure Data Ltd.
+11a7 Power Computing Corp.
+11a8 Systech Corp.
+11a9 InnoSys Inc.
+ 4240 AMCC S933Q Intelligent Serial Card
+11aa Actel
+11ab Galileo Technology Ltd.
+ 0146 GT-64010/64010A System Controller
+ 4611 GT-64115 System Controller
+ 4620 GT-64120/64120A/64121A System Controller
+ 4801 GT-48001
+ f003 GT-64010 Primary Image Piranha Image Generator
+11ac Canon Information Systems Research Aust.
+11ad Lite-On Communications Inc
+ 0002 LNE100TX
+ 11ad 0002 LNE100TX
+ 11ad 0003 LNE100TX
+ 11ad f003 LNE100TX
+ 11ad ffff LNE100TX
+ 1385 f004 FA310TX
+ c115 LNE100TX [Linksys EtherFast 10/100]
+ 11ad c001 LNE100TX [ver 2.0]
+11ae Aztech System Ltd
+11af Avid Technology Inc.
+11b0 V3 Semiconductor Inc.
+ 0002 V300PSC
+ 0292 V292PBC [Am29030/40 Bridge]
+ 0960 V96xPBC
+ c960 V96DPC
+11b1 Apricot Computers
+11b2 Eastman Kodak
+11b3 Barr Systems Inc.
+11b4 Leitch Technology International
+11b5 Radstone Technology Plc
+11b6 United Video Corp
+11b7 Motorola
+11b8 XPoint Technologies, Inc
+ 0001 Quad PeerMaster
+11b9 Pathlight Technology Inc.
+ c0ed SSA Controller
+11ba Videotron Corp
+11bb Pyramid Technology
+11bc Network Peripherals Inc
+ 0001 NP-PCI
+11bd Pinnacle Systems Inc.
+11be International Microcircuits Inc
+11bf Astrodesign, Inc.
+11c0 Hewlett Packard
+11c1 Lucent Microelectronics
+ 0440 56k WinModem
+ 1033 8015 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 1033 8047 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 1033 804f LT WinModem 56k Data+Fax+Voice+Dsvd
+ 10cf 102c LB LT Modem V.90 56k
+ 10cf 104a BIBLO LT Modem 56k
+ 10cf 105f LB2 LT Modem V.90 56k
+ 1179 0001 Internal V.90 Modem
+ 11c1 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 122d 4101 MDP7800-U Modem
+ 122d 4102 MDP7800SP-U Modem
+ 13e0 0040 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 13e0 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 13e0 0441 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 13e0 0450 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 13e0 f100 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 13e0 f101 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 144d 2101 LT56PV Modem
+ 149f 0440 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 0441 56k WinModem
+ 1033 804d LT WinModem 56k Data+Fax
+ 1033 8065 LT WinModem 56k Data+Fax
+ 1092 0440 Supra 56i
+ 1179 0001 Internal V.90 Modem
+ 11c1 0440 LT WinModem 56k Data+Fax
+ 11c1 0441 LT WinModem 56k Data+Fax
+ 122d 4100 MDP7800-U Modem
+ 13e0 0040 LT WinModem 56k Data+Fax
+ 13e0 0100 LT WinModem 56k Data+Fax
+ 13e0 0410 LT WinModem 56k Data+Fax
+ 13e0 0420 TelePath Internet 56k WinModem
+ 13e0 0440 LT WinModem 56k Data+Fax
+ 13e0 0443 LT WinModem 56k Data+Fax
+ 13e0 f102 LT WinModem 56k Data+Fax
+ 1416 9804 CommWave 56k Modem
+ 141d 0440 LT WinModem 56k Data+Fax
+ 144f 0441 Lucent 56k V.90 DF Modem
+ 144f 0449 Lucent 56k V.90 DF Modem
+ 144f 110d Lucent Win Modem
+ 1468 0441 Presario 56k V.90 DF Modem
+ 1668 0440 Lucent Win Modem
+ 0442 56k WinModem
+ 11c1 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 11c1 0442 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 13e0 0412 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 13e0 0442 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 13fc 2471 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 144d 2104 LT56PT Modem
+ 144f 1104 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 149f 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 1668 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 0443 LT WinModem
+ 0444 LT WinModem
+ 0445 LT WinModem
+ 0446 LT WinModem
+ 0447 LT WinModem
+ 0448 WinModem 56k
+ 1014 0131 Lucent Win Modem
+ 1033 8066 LT WinModem 56k Data+Fax+Voice+Dsvd
+ 13e0 0030 56k Voice Modem
+ 13e0 0040 LT WinModem 56k Data+Fax+Voice+Dsvd
+# Actiontech eth+modem card as used by Dell &c.
+ 1668 2400 LT WinModem 56k (MiniPCI Ethernet+Modem)
+ 0449 WinModem 56k
+ 0e11 b14d 56k V.90 Modem
+ 13e0 0020 LT WinModem 56k Data+Fax
+ 13e0 0041 TelePath Internet 56k WinModem
+ 1436 0440 Lucent Win Modem
+ 144f 0449 Lucent 56k V.90 DFi Modem
+ 1468 0410 IBM ThinkPad T23 (2647-4MG)
+ 1468 0440 Lucent Win Modem
+ 1468 0449 Presario 56k V.90 DFi Modem
+ 044a F-1156IV WinModem (V90, 56KFlex)
+ 10cf 1072 LB Global LT Modem
+ 13e0 0012 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 13e0 0042 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 144f 1005 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd
+ 044b LT WinModem
+ 044c LT WinModem
+ 044d LT WinModem
+ 044e LT WinModem
+ 044f V90 WildWire Modem
+ 0450 LT WinModem
+ 144f 4005 Magnia SG20
+ 0451 LT WinModem
+ 0452 LT WinModem
+ 0453 LT WinModem
+ 0454 LT WinModem
+ 0455 LT WinModem
+ 0456 LT WinModem
+ 0457 LT WinModem
+ 0458 LT WinModem
+ 0459 LT WinModem
+ 045a LT WinModem
+ 045c LT WinModem
+ 0461 V90 WildWire Modem
+ 0462 V90 WildWire Modem
+ 0480 Venus Modem (V90, 56KFlex)
+ 5801 USB
+ 5802 USS-312 USB Controller
+# 4 port PCI USB Controller made by Agere (formely Lucent)
+ 5803 USS-344S USB Controller
+ 5811 FW323
+ dead 0800 FireWire Host Bus Adapter
+11c2 Sand Microelectronics
+11c3 NEC Corporation
+11c4 Document Technologies, Inc
+11c5 Shiva Corporation
+11c6 Dainippon Screen Mfg. Co. Ltd
+11c7 D.C.M. Data Systems
+11c8 Dolphin Interconnect Solutions AS
+ 0658 PSB32 SCI-Adapter D31x
+ d665 PSB64 SCI-Adapter D32x
+ d667 PSB66 SCI-Adapter D33x
+11c9 Magma
+ 0010 16-line serial port w/- DMA
+ 0011 4-line serial port w/- DMA
+11ca LSI Systems, Inc
+11cb Specialix Research Ltd.
+ 2000 PCI_9050
+ 11cb 0200 SX
+ 11cb b008 I/O8+
+ 4000 SUPI_1
+ 8000 T225
+11cc Michels & Kleberhoff Computer GmbH
+11cd HAL Computer Systems, Inc.
+11ce Netaccess
+11cf Pioneer Electronic Corporation
+11d0 Lockheed Martin Federal Systems-Manassas
+11d1 Auravision
+ 01f7 VxP524
+11d2 Intercom Inc.
+11d3 Trancell Systems Inc
+11d4 Analog Devices
+ 1805 SM56 PCI modem
+ 1889 AD1889 sound chip
+11d5 Ikon Corporation
+ 0115 10115
+ 0117 10117
+11d6 Tekelec Telecom
+11d7 Trenton Technology, Inc.
+11d8 Image Technologies Development
+11d9 TEC Corporation
+11da Novell
+11db Sega Enterprises Ltd
+11dc Questra Corporation
+11dd Crosfield Electronics Limited
+11de Zoran Corporation
+ 6057 ZR36057PQC Video cutting chipset
+ 1031 7efe DC10 Plus
+ 1031 fc00 MiroVIDEO DC50, Motion JPEG Capture/CODEC Board
+ 13ca 4231 JPEG/TV Card
+ 6120 ZR36120
+ 1328 f001 Cinemaster C DVD Decoder
+11df New Wave PDG
+11e0 Cray Communications A/S
+11e1 GEC Plessey Semi Inc.
+11e2 Samsung Information Systems America
+11e3 Quicklogic Corporation
+ 5030 PC Watchdog
+11e4 Second Wave Inc
+11e5 IIX Consulting
+11e6 Mitsui-Zosen System Research
+11e7 Toshiba America, Elec. Company
+11e8 Digital Processing Systems Inc.
+11e9 Highwater Designs Ltd.
+11ea Elsag Bailey
+11eb Formation Inc.
+11ec Coreco Inc
+11ed Mediamatics
+11ee Dome Imaging Systems Inc
+11ef Nicolet Technologies B.V.
+11f0 Compu-Shack
+ 4231 FDDI
+ 4232 FASTline UTP Quattro
+ 4233 FASTline FO
+ 4234 FASTline UTP
+ 4235 FASTline-II UTP
+ 4236 FASTline-II FO
+ 4731 GIGAline
+11f1 Symbios Logic Inc
+11f2 Picture Tel Japan K.K.
+11f3 Keithley Metrabyte
+11f4 Kinetic Systems Corporation
+ 2915 CAMAC controller
+11f5 Computing Devices International
+11f6 Compex
+ 0112 ENet100VG4
+ 0113 FreedomLine 100
+ 1401 ReadyLink 2000
+ 2011 RL100-ATX 10/100
+ 11f6 2011 RL100-ATX
+ 2201 ReadyLink 100TX (Winbond W89C840)
+ 11f6 2011 ReadyLink 100TX
+ 9881 RL100TX
+11f7 Scientific Atlanta
+11f8 PMC-Sierra Inc.
+ 7375 PM7375 [LASAR-155 ATM SAR]
+11f9 I-Cube Inc
+11fa Kasan Electronics Company, Ltd.
+11fb Datel Inc
+11fc Silicon Magic
+11fd High Street Consultants
+11fe Comtrol Corporation
+ 0001 RocketPort 8 Oct
+ 0002 RocketPort 8 Intf
+ 0003 RocketPort 16 Intf
+ 0004 RocketPort 32 Intf
+ 0005 RocketPort Octacable
+ 0006 RocketPort 8J
+ 0007 RocketPort 4-port
+ 0008 RocketPort 8-port
+ 0009 RocketPort 16-port
+ 000a RocketPort Plus Quadcable
+ 000b RocketPort Plus Octacable
+ 000c RocketPort 8-port Modem
+ 8015 RocketPort 4-port UART 16954
+11ff Scion Corporation
+1200 CSS Corporation
+1201 Vista Controls Corp
+1202 Network General Corp.
+ 4300 Gigabit Ethernet Adapter
+ 1202 9841 SK-9841 LX
+ 1202 9842 SK-9841 LX dual link
+ 1202 9843 SK-9843 SX
+ 1202 9844 SK-9843 SX dual link
+1203 Bayer Corporation, Agfa Division
+1204 Lattice Semiconductor Corporation
+1205 Array Corporation
+1206 Amdahl Corporation
+1208 Parsytec GmbH
+ 4853 HS-Link Device
+1209 SCI Systems Inc
+120a Synaptel
+120b Adaptive Solutions
+120c Technical Corp.
+120d Compression Labs, Inc.
+120e Cyclades Corporation
+ 0100 Cyclom-Y below first megabyte
+ 0101 Cyclom-Y above first megabyte
+ 0102 Cyclom-4Y below first megabyte
+ 0103 Cyclom-4Y above first megabyte
+ 0104 Cyclom-8Y below first megabyte
+ 0105 Cyclom-8Y above first megabyte
+ 0200 Cyclades-Z below first megabyte
+ 0201 Cyclades-Z above first megabyte
+ 0300 PC300/RSV or /X21 (2 ports)
+ 0301 PC300/RSV or /X21 (1 port)
+ 0310 PC300/TE (2 ports)
+ 0311 PC300/TE (1 port)
+ 0320 PC300/TE-M (2 ports)
+ 0321 PC300/TE-M (1 port)
+ 0400 PC400
+120f Essential Communications
+ 0001 Roadrunner serial HIPPI
+1210 Hyperparallel Technologies
+1211 Braintech Inc
+1212 Kingston Technology Corp.
+1213 Applied Intelligent Systems, Inc.
+1214 Performance Technologies, Inc.
+1215 Interware Co., Ltd
+1216 Purup Prepress A/S
+1217 O2 Micro, Inc.
+ 6729 OZ6729
+ 673a OZ6730
+ 6832 OZ6832/6833 Cardbus Controller
+ 6836 OZ6836/6860 Cardbus Controller
+ 6872 OZ6812 Cardbus Controller
+ 6925 OZ6922 Cardbus Controller
+ 6933 OZ6933 Cardbus Controller
+ 1025 1016 Travelmate 612 TX
+ 6972 OZ6912 Cardbus Controller
+ 1179 0001 Magnia Z310
+1218 Hybricon Corp.
+1219 First Virtual Corporation
+121a 3Dfx Interactive, Inc.
+ 0001 Voodoo
+ 0002 Voodoo 2
+ 0003 Voodoo Banshee
+ 1092 0003 Monster Fusion
+ 1092 4000 Monster Fusion
+ 1092 4002 Monster Fusion
+ 1092 4801 Monster Fusion AGP
+ 1092 4803 Monster Fusion AGP
+ 1092 8030 Monster Fusion
+ 1092 8035 Monster Fusion AGP
+ 10b0 0001 Dragon 4000
+ 1102 1018 3D Blaster Banshee VE
+ 121a 0001 Voodoo Banshee AGP
+ 121a 0003 Voodoo Banshee AGP SGRAM
+ 121a 0004 Voodoo Banshee
+ 139c 0016 Raven
+ 139c 0017 Raven
+ 14af 0002 Maxi Gamer Phoenix
+ 0004 Voodoo Banshee [Velocity 100]
+ 0005 Voodoo 3
+ 121a 0004 Voodoo3 AGP
+ 121a 0030 Voodoo3 AGP
+ 121a 0031 Voodoo3 AGP
+ 121a 0034 Voodoo3 AGP
+ 121a 0036 Voodoo3
+ 121a 0037 Voodoo3 AGP
+ 121a 0038 Voodoo3 AGP
+ 121a 003a Voodoo3 AGP
+ 121a 0044 Voodoo3
+ 121a 004b Velocity 100
+ 121a 004c Velocity 200
+ 121a 004d Voodoo3 AGP
+ 121a 004e Voodoo3 AGP
+ 121a 0051 Voodoo3 AGP
+ 121a 0052 Voodoo3 AGP
+ 121a 0060 Voodoo3 3500 TV (NTSC)
+ 121a 0061 Voodoo3 3500 TV (PAL)
+ 121a 0062 Voodoo3 3500 TV (SECAM)
+ 0009 Voodoo 4 / Voodoo 5
+ 121a 0009 Voodoo5 AGP 5500/6000
+ 0057 Voodoo 3/3000 [Avenger]
+121b Advanced Telecommunications Modules
+121c Nippon Texaco., Ltd
+121d Lippert Automationstechnik GmbH
+121e CSPI
+121f Arcus Technology, Inc.
+1220 Ariel Corporation
+ 1220 AMCC 5933 TMS320C80 DSP/Imaging board
+1221 Contec Co., Ltd
+1222 Ancor Communications, Inc.
+1223 Artesyn Communication Products
+ 0003 PM/Link
+ 0004 PM/T1
+ 0005 PM/E1
+ 0008 PM/SLS
+ 0009 BajaSpan Resource Target
+ 000a BajaSpan Section 0
+ 000b BajaSpan Section 1
+ 000c BajaSpan Section 2
+ 000d BajaSpan Section 3
+ 000e PM/PPC
+1224 Interactive Images
+1225 Power I/O, Inc.
+1227 Tech-Source
+1228 Norsk Elektro Optikk A/S
+1229 Data Kinesis Inc.
+122a Integrated Telecom
+122b LG Industrial Systems Co., Ltd
+122c Sican GmbH
+122d Aztech System Ltd
+ 1206 368DSP
+ 50dc 3328 Audio
+ 122d 0001 3328 Audio
+ 80da 3328 Audio
+ 122d 0001 3328 Audio
+122e Xyratex
+122f Andrew Corporation
+1230 Fishcamp Engineering
+1231 Woodward McCoach, Inc.
+1232 GPT Limited
+1233 Bus-Tech, Inc.
+1234 Technical Corp.
+1235 Risq Modular Systems, Inc.
+1236 Sigma Designs Corporation
+ 0000 RealMagic64/GX
+ 6401 REALmagic 64/GX (SD 6425)
+1237 Alta Technology Corporation
+1238 Adtran
+1239 3DO Company
+123a Visicom Laboratories, Inc.
+123b Seeq Technology, Inc.
+123c Century Systems, Inc.
+123d Engineering Design Team, Inc.
+ 0000 EasyConnect 8/32
+ 0002 EasyConnect 8/64
+ 0003 EasyIO
+123e Simutech, Inc.
+123f C-Cube Microsystems
+ 00e4 MPEG
+ 8120 E4?
+ 11bd 0006 DV500 E4
+ 11bd 000a DV500 E4
+ 8888 Cinemaster C 3.0 DVD Decoder
+ 1002 0001 Cinemaster C 3.0 DVD Decoder
+ 1002 0002 Cinemaster C 3.0 DVD Decoder
+ 1328 0001 Cinemaster C 3.0 DVD Decoder
+1240 Marathon Technologies Corp.
+1241 DSC Communications
+# Formerly Jaycor Networks, Inc.
+1242 JNI Corporation
+ 1560 JNIC-1560 PCI-X Fibre Channel Controller
+ 1242 6562 FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter
+ 1242 656a FCX-6562 PCI-X Fibre Channel Adapter
+ 4643 FCI-1063 Fibre Channel Adapter
+1243 Delphax
+1244 AVM Audiovisuelles MKTG & Computer System GmbH
+ 0700 B1 ISDN
+ 0800 C4 ISDN
+ 0a00 A1 ISDN [Fritz]
+ 1244 0a00 FRITZ!Card ISDN Controller
+ 0e00 Fritz!PCI v2.0 ISDN
+ 1100 C2 ISDN
+ 1200 T1 ISDN
+1245 A.P.D., S.A.
+1246 Dipix Technologies, Inc.
+1247 Xylon Research, Inc.
+1248 Central Data Corporation
+1249 Samsung Electronics Co., Ltd.
+124a AEG Electrocom GmbH
+124b SBS/Greenspring Modular I/O
+ 0040 PCI-40A or cPCI-200 Quad IndustryPack carrier
+ 124b 9080 PCI9080 Bridge
+124c Solitron Technologies, Inc.
+124d Stallion Technologies, Inc.
+ 0000 EasyConnection 8/32
+ 0002 EasyConnection 8/64
+ 0003 EasyIO
+ 0004 EasyConnection/RA
+124e Cylink
+124f Infotrend Technology, Inc.
+ 0041 IFT-2000 Series RAID Controller
+1250 Hitachi Microcomputer System Ltd
+1251 VLSI Solutions Oy
+1253 Guzik Technical Enterprises
+1254 Linear Systems Ltd.
+1255 Optibase Ltd
+ 1110 MPEG Forge
+ 1210 MPEG Fusion
+ 2110 VideoPlex
+ 2120 VideoPlex CC
+ 2130 VideoQuest
+1256 Perceptive Solutions, Inc.
+ 4201 PCI-2220I
+ 4401 PCI-2240I
+ 5201 PCI-2000
+1257 Vertex Networks, Inc.
+1258 Gilbarco, Inc.
+1259 Allied Telesyn International
+ 2560 AT-2560 Fast Ethernet Adapter (i82557B)
+125a ABB Power Systems
+125b Asix Electronics Corporation
+ 1400 ALFA GFC2204
+125c Aurora Technologies, Inc.
+ 0640 Aries 16000P
+125d ESS Technology
+ 0000 ES336H Fax Modem (Early Model)
+ 1948 Solo?
+ 1968 ES1968 Maestro 2
+ 1028 0085 ES1968 Maestro-2 PCI
+ 1033 8051 ES1968 Maestro-2 Audiodrive
+ 1969 ES1969 Solo-1 Audiodrive
+ 1014 0166 ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard
+ 125d 8888 Solo-1 Audio Adapter
+ 1978 ES1978 Maestro 2E
+ 0e11 b112 Armada M700
+ 1033 803c ES1978 Maestro-2E Audiodrive
+ 1033 8058 ES1978 Maestro-2E Audiodrive
+ 1092 4000 Monster Sound MX400
+ 1179 0001 ES1978 Maestro-2E Audiodrive
+ 1988 ES1988 Allegro-1
+ 1092 4100 Sonic Impact S100
+ 125d 1988 ESS Allegro-1 Audiodrive
+ 1989 ESS Modem
+ 125d 1989 ESS Modem
+ 1998 ES1983S Maestro-3i PCI Audio Accelerator
+ 1028 00e6 ES1983S Maestro-3i (Dell Inspiron 8100)
+ 1999 ES1983S Maestro-3i PCI Modem Accelerator
+ 199a ES1983S Maestro-3i PCI Audio Accelerator
+ 199b ES1983S Maestro-3i PCI Modem Accelerator
+ 2808 ES336H Fax Modem (Later Model)
+ 2838 ES2838/2839 SuperLink Modem
+ 2898 ES2898 Modem
+ 125d 0424 ES56-PI Data Fax Modem
+ 125d 0425 ES56T-PI Data Fax Modem
+ 125d 0426 ES56V-PI Data Fax Modem
+ 125d 0427 VW-PI Data Fax Modem
+ 125d 0428 ES56ST-PI Data Fax Modem
+ 125d 0429 ES56SV-PI Data Fax Modem
+ 147a c001 ES56-PI Data Fax Modem
+ 14fe 0428 ES56-PI Data Fax Modem
+ 14fe 0429 ES56-PI Data Fax Modem
+125e Specialvideo Engineering SRL
+125f Concurrent Technologies, Inc.
+1260 Harris Semiconductor
+ 3873 Prism 2.5 Wavelan chipset
+ 1186 3501 DWL-520 Wireless PCI Adapter
+ 1668 0414 HWP01170-01 802.11b PCI Wireless Adapter
+ 1737 3874 WMP11 Wireless 802.11b PCI Adapter
+ 8086 2513 Wireless 802.11b MiniPCI Adapter
+ 8130 HMP8130 NTSC/PAL Video Decoder
+ 8131 HMP8131 NTSC/PAL Video Decoder
+1261 Matsushita-Kotobuki Electronics Industries, Ltd.
+1262 ES Computer Company, Ltd.
+1263 Sonic Solutions
+1264 Aval Nagasaki Corporation
+1265 Casio Computer Co., Ltd.
+1266 Microdyne Corporation
+ 0001 NE10/100 Adapter (i82557B)
+ 1910 NE2000Plus (RT8029) Ethernet Adapter
+ 1266 1910 NE2000Plus Ethernet Adapter
+1267 S. A. Telecommunications
+ 5352 PCR2101
+ 5a4b Telsat Turbo
+1268 Tektronix
+1269 Thomson-CSF/TTM
+126a Lexmark International, Inc.
+126b Adax, Inc.
+126c Northern Telecom
+126d Splash Technology, Inc.
+126e Sumitomo Metal Industries, Ltd.
+126f Silicon Motion, Inc.
+ 0710 SM710 LynxEM
+ 0712 SM712 LynxEM+
+ 0720 SM720 Lynx3DM
+ 0810 SM810 LynxE
+ 0811 SM811 LynxE
+ 0820 SM820 Lynx3D
+ 0910 SM910
+1270 Olympus Optical Co., Ltd.
+1271 GW Instruments
+1272 Telematics International
+1273 Hughes Network Systems
+ 0002 DirecPC
+1274 Ensoniq
+ 1371 ES1371 [AudioPCI-97]
+ 0e11 0024 AudioPCI on Motherboard Compaq Deskpro
+ 0e11 b1a7 ES1371, ES1373 AudioPCI
+ 1033 80ac ES1371, ES1373 AudioPCI
+ 1042 1854 Tazer
+ 107b 8054 Tabor2
+ 1274 1371 Creative Sound Blaster AudioPCI64V, AudioPCI128
+ 1462 6470 ES1371, ES1373 AudioPCI On Motherboard MS-6147 1.1A
+ 1462 6560 ES1371, ES1373 AudioPCI On Motherboard MS-6156 1.10
+ 1462 6630 ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 1.0A
+ 1462 6631 ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 1.0A
+ 1462 6632 ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 2.0A
+ 1462 6633 ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 2.0A
+ 1462 6820 ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00
+ 1462 6822 ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00A
+ 1462 6830 ES1371, ES1373 AudioPCI On Motherboard MS-6183 1.00
+ 1462 6880 ES1371, ES1373 AudioPCI On Motherboard MS-6188 1.00
+ 1462 6900 ES1371, ES1373 AudioPCI On Motherboard MS-6190 1.00
+ 1462 6910 ES1371, ES1373 AudioPCI On Motherboard MS-6191
+ 1462 6930 ES1371, ES1373 AudioPCI On Motherboard MS-6193
+ 1462 6990 ES1371, ES1373 AudioPCI On Motherboard MS-6199BX 2.0A
+ 1462 6991 ES1371, ES1373 AudioPCI On Motherboard MS-6199VIA 2.0A
+ 14a4 2077 ES1371, ES1373 AudioPCI On Motherboard KR639
+ 14a4 2105 ES1371, ES1373 AudioPCI On Motherboard MR800
+ 14a4 2107 ES1371, ES1373 AudioPCI On Motherboard MR801
+ 14a4 2172 ES1371, ES1373 AudioPCI On Motherboard DR739
+ 1509 9902 ES1371, ES1373 AudioPCI On Motherboard KW11
+ 1509 9903 ES1371, ES1373 AudioPCI On Motherboard KW31
+ 1509 9904 ES1371, ES1373 AudioPCI On Motherboard KA11
+ 1509 9905 ES1371, ES1373 AudioPCI On Motherboard KC13
+ 152d 8801 ES1371, ES1373 AudioPCI On Motherboard CP810E
+ 152d 8802 ES1371, ES1373 AudioPCI On Motherboard CP810
+ 152d 8803 ES1371, ES1373 AudioPCI On Motherboard P3810E
+ 152d 8804 ES1371, ES1373 AudioPCI On Motherboard P3810-S
+ 152d 8805 ES1371, ES1373 AudioPCI On Motherboard P3820-S
+ 270f 2001 ES1371, ES1373 AudioPCI On Motherboard 6CTR
+ 270f 2200 ES1371, ES1373 AudioPCI On Motherboard 6WTX
+ 270f 3000 ES1371, ES1373 AudioPCI On Motherboard 6WSV
+ 270f 3100 ES1371, ES1373 AudioPCI On Motherboard 6WIV2
+ 270f 3102 ES1371, ES1373 AudioPCI On Motherboard 6WIV
+ 270f 7060 ES1371, ES1373 AudioPCI On Motherboard 6ASA2
+ 8086 4249 ES1371, ES1373 AudioPCI On Motherboard BI440ZX
+ 8086 424c ES1371, ES1373 AudioPCI On Motherboard BL440ZX
+ 8086 425a ES1371, ES1373 AudioPCI On Motherboard BZ440ZX
+ 8086 4341 ES1371, ES1373 AudioPCI On Motherboard Cayman
+ 8086 4343 ES1371, ES1373 AudioPCI On Motherboard Cape Cod
+ 8086 4649 ES1371, ES1373 AudioPCI On Motherboard Fire Island
+ 8086 464a ES1371, ES1373 AudioPCI On Motherboard FJ440ZX
+ 8086 4d4f ES1371, ES1373 AudioPCI On Motherboard Montreal
+ 8086 4f43 ES1371, ES1373 AudioPCI On Motherboard OC440LX
+ 8086 5243 ES1371, ES1373 AudioPCI On Motherboard RC440BX
+ 8086 5352 ES1371, ES1373 AudioPCI On Motherboard SunRiver
+ 8086 5643 ES1371, ES1373 AudioPCI On Motherboard Vancouver
+ 8086 5753 ES1371, ES1373 AudioPCI On Motherboard WS440BX
+ 5000 ES1370 [AudioPCI]
+ 5880 5880 AudioPCI
+ 1274 2000 Creative Sound Blaster AudioPCI128
+ 1274 2003 Creative SoundBlaster AudioPCI 128
+ 1274 5880 Creative Sound Blaster AudioPCI128
+ 1458 a000 5880 AudioPCI On Motherboard 6OXET
+ 1462 6880 5880 AudioPCI On Motherboard MS-6188 1.00
+ 270f 2001 5880 AudioPCI On Motherboard 6CTR
+ 270f 2200 5880 AudioPCI On Motherboard 6WTX
+ 270f 7040 5880 AudioPCI On Motherboard 6ATA4
+1275 Network Appliance Corporation
+1276 Switched Network Technologies, Inc.
+1277 Comstream
+1278 Transtech Parallel Systems Ltd.
+ 0701 TPE3/TM3 PowerPC Node
+1279 Transmeta Corporation
+ 0295 Northbridge
+ 0395 LongRun Northbridge
+ 0396 SDRAM controller
+ 0397 BIOS scratchpad
+127a Rockwell International
+ 1002 HCF 56k Data/Fax Modem
+ 1092 094c SupraExpress 56i PRO [Diamond SUP2380]
+ 122d 4002 HPG / MDP3858-U
+ 122d 4005 MDP3858-E
+ 122d 4007 MDP3858-A/-NZ
+ 122d 4012 MDP3858-SA
+ 122d 4017 MDP3858-W
+ 122d 4018 MDP3858-W
+ 127a 1002 Rockwell 56K D/F HCF Modem
+ 1003 HCF 56k Data/Fax Modem
+ 0e11 b0bc 229-DF Zephyr
+ 0e11 b114 229-DF Cheetah
+ 1033 802b 229-DF
+ 13df 1003 PCI56RX Modem
+ 13e0 0117 IBM
+ 13e0 0147 IBM F-1156IV+/R3 Spain V.90 Modem
+ 13e0 0197 IBM
+ 13e0 01c7 IBM F-1156IV+/R3 WW V.90 Modem
+ 13e0 01f7 IBM
+ 1436 1003 IBM
+ 1436 1103 IBM 5614PM3G V.90 Modem
+ 1436 1602 Compaq 229-DF Ducati
+ 1004 HCF 56k Data/Fax/Voice Modem
+ 1048 1500 MicroLink 56k Modem
+ 10cf 1059 Fujitsu 229-DFRT
+ 1005 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 1033 8029 229-DFSV
+ 1033 8054 Modem
+ 10cf 103c Fujitsu
+ 10cf 1055 Fujitsu 229-DFSV
+ 10cf 1056 Fujitsu 229-DFSV
+ 122d 4003 MDP3858SP-U
+ 122d 4006 Packard Bell MDP3858V-E
+ 122d 4008 MDP3858SP-A/SP-NZ
+ 122d 4009 MDP3858SP-E
+ 122d 4010 MDP3858V-U
+ 122d 4011 MDP3858SP-SA
+ 122d 4013 MDP3858V-A/V-NZ
+ 122d 4015 MDP3858SP-W
+ 122d 4016 MDP3858V-W
+ 122d 4019 MDP3858V-SA
+ 13df 1005 PCI56RVP Modem
+ 13e0 0187 IBM
+ 13e0 01a7 IBM
+ 13e0 01b7 IBM DF-1156IV+/R3 Spain V.90 Modem
+ 13e0 01d7 IBM DF-1156IV+/R3 WW V.90 Modem
+ 1436 1005 IBM
+ 1436 1105 IBM
+ 1437 1105 IBM 5614PS3G V.90 Modem
+ 1022 HCF 56k Modem
+ 1436 1303 M3-5614PM3G V.90 Modem
+ 1023 HCF 56k Data/Fax Modem
+ 122d 4020 Packard Bell MDP3858-WE
+ 122d 4023 MDP3858-UE
+ 13e0 0247 IBM F-1156IV+/R6 Spain V.90 Modem
+ 13e0 0297 IBM
+ 13e0 02c7 IBM F-1156IV+/R6 WW V.90 Modem
+ 1436 1203 IBM
+ 1436 1303 IBM
+ 1024 HCF 56k Data/Fax/Voice Modem
+ 1025 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 10cf 106a Fujitsu 235-DFSV
+ 122d 4021 Packard Bell MDP3858V-WE
+ 122d 4022 MDP3858SP-WE
+ 122d 4024 MDP3858V-UE
+ 122d 4025 MDP3858SP-UE
+ 1026 HCF 56k PCI Speakerphone Modem
+ 1032 HCF 56k Modem
+ 1033 HCF 56k Modem
+ 1034 HCF 56k Modem
+ 1035 HCF 56k PCI Speakerphone Modem
+ 1036 HCF 56k Modem
+ 1085 HCF 56k Volcano PCI Modem
+ 2005 HCF 56k Data/Fax Modem
+ 104d 8044 229-DFSV
+ 104d 8045 229-DFSV
+ 104d 8055 PBE/Aztech 235W-DFSV
+ 104d 8056 235-DFSV
+ 104d 805a Modem
+ 104d 805f Modem
+ 104d 8074 Modem
+ 2013 HSF 56k Data/Fax Modem
+ 1179 0001 Modem
+ 1179 ff00 Modem
+ 2014 HSF 56k Data/Fax/Voice Modem
+ 10cf 1057 Fujitsu Citicorp III
+ 122d 4050 MSP3880-U
+ 122d 4055 MSP3880-W
+ 2015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 10cf 1063 Fujitsu
+ 10cf 1064 Fujitsu
+ 1468 2015 Fujitsu
+ 2016 HSF 56k Data/Fax/Voice/Spkp Modem
+ 122d 4051 MSP3880V-W
+ 122d 4052 MSP3880SP-W
+ 122d 4054 MSP3880V-U
+ 122d 4056 MSP3880SP-U
+ 122d 4057 MSP3880SP-A
+ 4311 Riptide HSF 56k PCI Modem
+ 127a 4311 Ring Modular? Riptide HSF RT HP Dom
+ 13e0 0210 HP-GVC
+ 4320 Riptide PCI Audio Controller
+ 1235 4320 Riptide PCI Audio Controller
+ 4321 Riptide HCF 56k PCI Modem
+ 1235 4321 Hewlett Packard DF
+ 1235 4324 Hewlett Packard DF
+ 13e0 0210 Hewlett Packard DF
+ 144d 2321 Riptide
+ 4322 Riptide PCI Game Controller
+ 1235 4322 Riptide PCI Game Controller
+ 8234 RapidFire 616X ATM155 Adapter
+ 108d 0022 RapidFire 616X ATM155 Adapter
+ 108d 0027 RapidFire 616X ATM155 Adapter
+127b Pixera Corporation
+127c Crosspoint Solutions, Inc.
+127d Vela Research
+127e Winnov, L.P.
+127f Fujifilm
+1280 Photoscript Group Ltd.
+1281 Yokogawa Electric Corporation
+1282 Davicom Semiconductor, Inc.
+ 9009 Ethernet 100/10 MBit
+ 9100 Ethernet 100/10 MBit
+ 9102 Ethernet 100/10 MBit
+ 9132 Ethernet 100/10 MBit
+1283 Integrated Technology Express, Inc.
+ 673a IT8330G
+ 8330 IT8330G
+ 8888 IT8888F PCI to ISA Bridge with SMB
+ 8889 IT8889F PCI to ISA Bridge
+ e886 IT8330G
+1284 Sahara Networks, Inc.
+1285 Platform Technologies, Inc.
+ 0100 AGOGO sound chip (aka ESS Maestro 1)
+1286 Mazet GmbH
+1287 M-Pact, Inc.
+ 001e LS220D DVD Decoder
+ 001f LS220C DVD Decoder
+1288 Timestep Corporation
+1289 AVC Technology, Inc.
+128a Asante Technologies, Inc.
+128b Transwitch Corporation
+128c Retix Corporation
+128d G2 Networks, Inc.
+ 0021 ATM155 Adapter
+128e Hoontech Corporation/Samho Multi Tech Ltd.
+ 0008 ST128 WSS/SB
+ 0009 ST128 SAM9407
+ 000a ST128 Game Port
+ 000b ST128 MPU Port
+ 000c ST128 Ctrl Port
+128f Tateno Dennou, Inc.
+1290 Sord Computer Corporation
+1291 NCS Computer Italia
+1292 Tritech Microelectronics Inc
+1293 Media Reality Technology
+1294 Rhetorex, Inc.
+1295 Imagenation Corporation
+1296 Kofax Image Products
+1297 Holco Enterprise Co, Ltd/Shuttle Computer
+1298 Spellcaster Telecommunications Inc.
+1299 Knowledge Technology Lab.
+129a VMetro, inc.
+ 0615 PBT-615 PCI-X Bus Analyzer
+129b Image Access
+129c Jaycor
+129d Compcore Multimedia, Inc.
+129e Victor Company of Japan, Ltd.
+129f OEC Medical Systems, Inc.
+12a0 Allen-Bradley Company
+12a1 Simpact Associates, Inc.
+12a2 Newgen Systems Corporation
+12a3 Lucent Technologies
+12a4 NTT Electronics Technology Company
+12a5 Vision Dynamics Ltd.
+12a6 Scalable Networks, Inc.
+12a7 AMO GmbH
+12a8 News Datacom
+12a9 Xiotech Corporation
+12aa SDL Communications, Inc.
+12ab Yuan Yuan Enterprise Co., Ltd.
+ 3000 MPG-200C PCI DVD Decoder Card
+12ac Measurex Corporation
+12ad Multidata GmbH
+12ae Alteon Networks Inc.
+ 0001 AceNIC Gigabit Ethernet
+ 12ae 0001 Gigabit Ethernet-SX (Universal)
+ 1410 0104 Gigabit Ethernet-SX PCI Adapter
+ 0002 AceNIC Gigabit Ethernet (Copper)
+ 12ae 0002 Gigabit Ethernet-T (3C986-T)
+12af TDK USA Corp
+12b0 Jorge Scientific Corp
+12b1 GammaLink
+12b2 General Signal Networks
+12b3 Inter-Face Co Ltd
+12b4 FutureTel Inc
+12b5 Granite Systems Inc.
+12b6 Natural Microsystems
+12b7 Cognex Modular Vision Systems Div. - Acumen Inc.
+12b8 Korg
+12b9 US Robotics/3Com
+ 1006 WinModem
+ 12b9 005c USR 56k Internal Voice WinModem (Model 3472)
+ 12b9 005e USR 56k Internal WinModem (Models 662975)
+ 12b9 0062 USR 56k Internal Voice WinModem (Model 662978)
+ 12b9 0068 USR 56k Internal Voice WinModem (Model 5690)
+ 12b9 007a USR 56k Internal Voice WinModem (Model 662974)
+ 12b9 007f USR 56k Internal WinModem (Models 5698, 5699)
+ 12b9 0080 USR 56k Internal WinModem (Models 2975, 3528)
+ 12b9 0081 USR 56k Internal Voice WinModem (Models 2974, 3529)
+ 12b9 0091 USR 56k Internal Voice WinModem (Model 2978)
+ 1007 USR 56k Internal WinModem
+ 12b9 00a3 USR 56k Internal WinModem (Model 3595)
+ 1008 56K FaxModem Model 5610
+ 12b9 00a2 USR 56k Internal FAX Modem (Model 2977)
+ 12b9 00aa USR 56k Internal Voice Modem (Model 2976)
+ 12b9 00ab USR 56k Internal Voice Modem (Model 5609)
+ 12b9 00ac USR 56k Internal Voice Modem (Model 3298)
+ 12b9 00ad USR 56k Internal FAX Modem (Model 5610)
+12ba BittWare, Inc.
+12bb Nippon Unisoft Corporation
+12bc Array Microsystems
+12bd Computerm Corp.
+12be Anchor Chips Inc.
+ 3041 AN3041Q CO-MEM
+ 3042 AN3042Q CO-MEM Lite
+ 12be 3042 Anchor Chips Lite Evaluation Board
+12bf Fujifilm Microdevices
+12c0 Infimed
+12c1 GMM Research Corp
+12c2 Mentec Limited
+12c3 Holtek Microelectronics Inc
+ 0058 PCI NE2K Ethernet
+ 5598 PCI NE2K Ethernet
+12c4 Connect Tech Inc
+12c5 Picture Elements Incorporated
+ 007e Imaging/Scanning Subsystem Engine
+ 007f Imaging/Scanning Subsystem Engine
+ 0081 PCIVST [Grayscale Thresholding Engine]
+ 0085 Video Simulator/Sender
+ 0086 THR2 Multi-scale Thresholder
+12c6 Mitani Corporation
+12c7 Dialogic Corp
+12c8 G Force Co, Ltd
+12c9 Gigi Operations
+12ca Integrated Computing Engines
+12cb Antex Electronics Corporation
+12cc Pluto Technologies International
+12cd Aims Lab
+12ce Netspeed Inc.
+12cf Prophet Systems, Inc.
+12d0 GDE Systems, Inc.
+12d1 PSITech
+12d2 NVidia / SGS Thomson (Joint Venture)
+ 0008 NV1
+ 0009 DAC64
+ 0018 Riva128
+ 1048 0c10 VICTORY Erazor
+ 107b 8030 STB Velocity 128
+ 1092 0350 Viper V330
+ 1092 1092 Viper V330
+ 10b4 1b1b STB Velocity 128
+ 10b4 1b1d STB Velocity 128
+ 10b4 1b1e STB Velocity 128, PAL TV-Out
+ 10b4 1b20 STB Velocity 128 Sapphire
+ 10b4 1b21 STB Velocity 128
+ 10b4 1b22 STB Velocity 128 AGP, NTSC TV-Out
+ 10b4 1b23 STB Velocity 128 AGP, PAL TV-Out
+ 10b4 1b27 STB Velocity 128 DVD
+ 10b4 1b88 MVP Pro 128
+ 10b4 222a STB Velocity 128 AGP
+ 10b4 2230 STB Velocity 128
+ 10b4 2232 STB Velocity 128
+ 10b4 2235 STB Velocity 128 AGP
+ 2a15 54a3 3DVision-SAGP / 3DexPlorer 3000
+ 0019 Riva128ZX
+ 0020 TNT
+ 0028 TNT2
+ 0029 UTNT2
+ 002c VTNT2
+ 00a0 ITNT2
+12d3 Vingmed Sound A/S
+12d4 Ulticom (Formerly DGM&S)
+12d5 Equator Technologies
+12d6 Analogic Corp
+12d7 Biotronic SRL
+12d8 Pericom Semiconductor
+12d9 Aculab PLC
+12da True Time Inc.
+12db Annapolis Micro Systems, Inc
+12dc Symicron Computer Communication Ltd.
+12dd Management Graphics
+12de Rainbow Technologies
+12df SBS Technologies Inc
+12e0 Chase Research
+ 0010 ST16C654 Quad UART
+ 0020 ST16C654 Quad UART
+ 0030 ST16C654 Quad UART
+12e1 Nintendo Co, Ltd
+12e2 Datum Inc. Bancomm-Timing Division
+12e3 Imation Corp - Medical Imaging Systems
+12e4 Brooktrout Technology Inc
+12e5 Apex Semiconductor Inc
+12e6 Cirel Systems
+12e7 Sunsgroup Corporation
+12e8 Crisc Corp
+12e9 GE Spacenet
+12ea Zuken
+12eb Aureal Semiconductor
+ 0001 Vortex 1
+ 104d 8036 AU8820 Vortex Digital Audio Processor
+ 1092 2000 Sonic Impact A3D
+ 1092 2100 Sonic Impact A3D
+ 1092 2110 Sonic Impact A3D
+ 1092 2200 Sonic Impact A3D
+ 122d 1002 AU8820 Vortex Digital Audio Processor
+ 12eb 0001 AU8820 Vortex Digital Audio Processor
+ 5053 3355 Montego
+ 0002 Vortex 2
+ 104d 8049 AU8830 Vortex 3D Digital Audio Processor
+ 104d 807b AU8830 Vortex 3D Digital Audio Processor
+ 1092 3000 Monster Sound II
+ 1092 3001 Monster Sound II
+ 1092 3002 Monster Sound II
+ 1092 3003 Monster Sound II
+ 1092 3004 Monster Sound II
+ 12eb 0001 AU8830 Vortex 3D Digital Audio Processor
+ 12eb 0002 AU8830 Vortex 3D Digital Audio Processor
+ 12eb 0088 AU8830 Vortex 3D Digital Audio Processor
+ 144d 3510 AU8830 Vortex 3D Digital Audio Processor
+ 5053 3356 Montego II
+ 0003 AU8810 Vortex Digital Audio Processor
+ 104d 8049 AU8810 Vortex Digital Audio Processor
+ 104d 8077 AU8810 Vortex Digital Audio Processor
+ 109f 1000 AU8810 Vortex Digital Audio Processor
+ 12eb 0003 AU8810 Vortex Digital Audio Processor
+ 1462 6780 AU8810 Vortex Digital Audio Processor
+ 14a4 2073 AU8810 Vortex Digital Audio Processor
+ 14a4 2091 AU8810 Vortex Digital Audio Processor
+ 14a4 2104 AU8810 Vortex Digital Audio Processor
+ 14a4 2106 AU8810 Vortex Digital Audio Processor
+ 8803 Vortex 56k Software Modem
+ 12eb 8803 Vortex 56k Software Modem
+12ec 3A International, Inc.
+12ed Optivision Inc.
+12ee Orange Micro
+12ef Vienna Systems
+12f0 Pentek
+12f1 Sorenson Vision Inc
+12f2 Gammagraphx, Inc.
+12f3 Radstone Technology
+12f4 Megatel
+12f5 Forks
+12f6 Dawson France
+12f7 Cognex
+12f8 Electronic Design GmbH
+ 0002 VideoMaker
+12f9 Four Fold Ltd
+12fb Spectrum Signal Processing
+12fc Capital Equipment Corp
+12fd I2S
+12fe ESD Electronic System Design GmbH
+12ff Lexicon
+1300 Harman International Industries Inc
+1302 Computer Sciences Corp
+1303 Innovative Integration
+1304 Juniper Networks
+1305 Netphone, Inc
+1306 Duet Technologies
+1307 Computer Boards
+ 0001 PCI-DAS1602/16
+ 000b PCI-DIO48H
+ 000c PCI-PDISO8
+ 000d PCI-PDISO16
+ 000f PCI-DAS1200
+ 0010 PCI-DAS1602/12
+ 0014 PCI-DIO24H
+ 0015 PCI-DIO24H/CTR3
+ 0016 PCI-DIO48H/CTR15
+ 0017 PCI-DIO96H
+ 0018 PCI-CTR05
+ 0019 PCI-DAS1200/JR
+ 001a PCI-DAS1001
+ 001b PCI-DAS1002
+ 001c PCI-DAS1602JR/16
+ 001d PCI-DAS6402/16
+ 001e PCI-DAS6402/12
+ 001f PCI-DAS16/M1
+ 0020 PCI-DDA02/12
+ 0021 PCI-DDA04/12
+ 0022 PCI-DDA08/12
+ 0023 PCI-DDA02/16
+ 0024 PCI-DDA04/16
+ 0025 PCI-DDA08/16
+ 0026 PCI-DAC04/12-HS
+ 0027 PCI-DAC04/16-HS
+ 0028 PCI-DIO24
+ 0029 PCI-DAS08
+ 002c PCI-INT32
+ 0033 PCI-DUAL-AC5
+ 0034 PCI-DAS-TC
+ 0035 PCI-DAS64/M1/16
+ 0036 PCI-DAS64/M2/16
+ 0037 PCI-DAS64/M3/16
+ 004c PCI-DAS1000
+1308 Jato Technologies Inc.
+ 0001 NetCelerator Adapter
+ 1308 0001 NetCelerator Adapter
+1309 AB Semiconductor Ltd
+130a Mitsubishi Electric Microcomputer
+130b Colorgraphic Communications Corp
+130c Ambex Technologies, Inc
+130d Accelerix Inc
+130e Yamatake-Honeywell Co. Ltd
+130f Advanet Inc
+1310 Gespac
+1311 Videoserver, Inc
+1312 Acuity Imaging, Inc
+1313 Yaskawa Electric Co.
+1316 Teradyne Inc
+1317 Linksys
+ 0981 Fast Ethernet 10/100
+ 0985 Network Everywhere Fast Ethernet 10/100 model NC100
+ 1985 Fast Ethernet 10/100
+1318 Packet Engines Inc.
+ 0911 PCI Ethernet Adapter
+1319 Fortemedia, Inc
+ 0801 Xwave QS3000A [FM801]
+ 0802 Xwave QS3000A [FM801 game port]
+ 1000 FM801 PCI Audio
+ 1001 FM801 PCI Joystick
+131a Finisar Corp.
+131c Nippon Electro-Sensory Devices Corp
+131d Sysmic, Inc.
+131e Xinex Networks Inc
+131f Siig Inc
+ 1000 CyberSerial (1-port) 16550
+ 1001 CyberSerial (1-port) 16650
+ 1002 CyberSerial (1-port) 16850
+ 1010 Duet 1S(16550)+1P
+ 1011 Duet 1S(16650)+1P
+ 1012 Duet 1S(16850)+1P
+ 1020 CyberParallel (1-port)
+ 1021 CyberParallel (2-port)
+ 1030 CyberSerial (2-port) 16550
+ 1031 CyberSerial (2-port) 16650
+ 1032 CyberSerial (2-port) 16850
+ 1034 Trio 2S(16550)+1P
+ 1035 Trio 2S(16650)+1P
+ 1036 Trio 2S(16850)+1P
+ 1050 CyberSerial (4-port) 16550
+ 1051 CyberSerial (4-port) 16650
+ 1052 CyberSerial (4-port) 16850
+ 2000 CyberSerial (1-port) 16550
+ 2001 CyberSerial (1-port) 16650
+ 2002 CyberSerial (1-port) 16850
+ 2010 Duet 1S(16550)+1P
+ 2011 Duet 1S(16650)+1P
+ 2012 Duet 1S(16850)+1P
+ 2020 CyberParallel (1-port)
+ 2021 CyberParallel (2-port)
+ 2030 CyberSerial (2-port) 16550
+ 131f 2030 PCI Serial Card
+ 2031 CyberSerial (2-port) 16650
+ 2032 CyberSerial (2-port) 16850
+ 2040 Trio 1S(16550)+2P
+ 2041 Trio 1S(16650)+2P
+ 2042 Trio 1S(16850)+2P
+ 2050 CyberSerial (4-port) 16550
+ 2051 CyberSerial (4-port) 16650
+ 2052 CyberSerial (4-port) 16850
+ 2060 Trio 2S(16550)+1P
+ 2061 Trio 2S(16650)+1P
+ 2062 Trio 2S(16850)+1P
+1320 Crypto AG
+1321 Arcobel Graphics BV
+1322 MTT Co., Ltd
+1323 Dome Inc
+1324 Sphere Communications
+1325 Salix Technologies, Inc
+1326 Seachange international
+1327 Voss scientific
+1328 quadrant international
+1329 Productivity Enhancement
+132a Microcom Inc.
+132b Broadband Technologies
+132c Micrel Inc
+132d Integrated Silicon Solution, Inc.
+1330 MMC Networks
+1331 Radisys Corp.
+1332 Micro Memory
+ 5415 MM-5415CN PCI Memory Module with Battery Backup
+1334 Redcreek Communications, Inc
+1335 Videomail, Inc
+1337 Third Planet Publishing
+1338 BT Electronics
+133a Vtel Corp
+133b Softcom Microsystems
+133c Holontech Corp
+133d SS Technologies
+133e Virtual Computer Corp
+133f SCM Microsystems
+1340 Atalla Corp
+1341 Kyoto Microcomputer Co
+1342 Promax Systems Inc
+1343 Phylon Communications Inc
+1344 Crucial Technology
+1345 Arescom Inc
+1347 Odetics
+1349 Sumitomo Electric Industries, Ltd.
+134a DTC Technology Corp.
+ 0001 Domex 536
+ 0002 Domex DMX3194UP SCSI Adapter
+134b ARK Research Corp.
+134c Chori Joho System Co. Ltd
+134d PCTel Inc
+ 7890 HSP MicroModem 56
+ 7891 HSP MicroModem 56
+ 134d 0001 HSP MicroModem 56
+ 7892 HSP MicroModem 56
+ 7893 HSP MicroModem 56
+ 7894 HSP MicroModem 56
+ 7895 HSP MicroModem 56
+ 7896 HSP MicroModem 56
+ 7897 HSP MicroModem 56
+134e CSTI
+134f Algo System Co Ltd
+1350 Systec Co. Ltd
+1351 Sonix Inc
+1353 Thales Idatys
+ 0002 Proserver
+ 0003 PCI-FUT
+ 0004 PCI-S0
+ 0005 PCI-FUT-S0
+1354 Dwave System Inc
+1355 Kratos Analytical Ltd
+1356 The Logical Co
+1359 Prisa Networks
+135a Brain Boxes
+135b Giganet Inc
+135c Quatech Inc
+ 0010 QSC-100
+ 0020 DSC-100
+ 0030 DSC-200/300
+ 0040 QSC-200/300
+ 0050 ESC-100D
+ 0060 ESC-100M
+ 00f0 MPAC-100 Syncronous Serial Card (Zilog 85230)
+ 0170 QSCLP-100
+ 0180 DSCLP-100
+ 0190 SSCLP-100
+ 01a0 QSCLP-200/300
+ 01b0 DSCLP-200/300
+ 01c0 SSCLP-200/300
+135d ABB Network Partner AB
+135e Sealevel Systems Inc
+ 7101 Single Port RS-232/422/485/530
+ 7201 Dual Port RS-232/422/485 Interface
+ 7202 Dual Port RS-232 Interface
+ 7401 Four Port RS-232 Interface
+ 7402 Four Port RS-422/485 Interface
+ 7801 Eight Port RS-232 Interface
+ 8001 8001 Digital I/O Adapter
+135f I-Data International A-S
+1360 Meinberg Funkuhren
+1361 Soliton Systems K.K.
+1362 Fujifacom Corporation
+1363 Phoenix Technology Ltd
+1364 ATM Communications Inc
+1365 Hypercope GmbH
+1366 Teijin Seiki Co. Ltd
+1367 Hitachi Zosen Corporation
+1368 Skyware Corporation
+1369 Digigram
+136a High Soft Tech
+136b Kawasaki Steel Corporation
+136c Adtek System Science Co Ltd
+136d Gigalabs Inc
+136f Applied Magic Inc
+1370 ATL Products
+1371 CNet Technology Inc
+1373 Silicon Vision Inc
+1374 Silicom Ltd
+1375 Argosystems Inc
+1376 LMC
+1377 Electronic Equipment Production & Distribution GmbH
+1378 Telemann Co. Ltd
+1379 Asahi Kasei Microsystems Co Ltd
+137a Mark of the Unicorn Inc
+137b PPT Vision
+137c Iwatsu Electric Co Ltd
+137d Dynachip Corporation
+137e Patriot Scientific Corporation
+137f Japan Satellite Systems Inc
+1380 Sanritz Automation Co Ltd
+1381 Brains Co. Ltd
+1382 Marian - Electronic & Software
+1383 Controlnet Inc
+1384 Reality Simulation Systems Inc
+1385 Netgear
+ 4100 802.11b Wireless Adapter (MA301)
+ 620a GA620
+ 622a GA622
+ 630a GA630
+ f311 FA311
+1386 Video Domain Technologies
+1387 Systran Corp
+1388 Hitachi Information Technology Co Ltd
+1389 Applicom International
+ 0001 PCI1500PFB [Intelligent fieldbus adaptor]
+138a Fusion Micromedia Corp
+138b Tokimec Inc
+138c Silicon Reality
+138d Future Techno Designs pte Ltd
+138e Basler GmbH
+138f Patapsco Designs Inc
+1390 Concept Development Inc
+1391 Development Concepts Inc
+1392 Medialight Inc
+1393 Moxa Technologies Co Ltd
+ 1040 Smartio C104H/PCI
+ 1680 Smartio C168H/PCI
+ 2040 Intellio CP-204J
+ 2180 Intellio C218 Turbo PCI
+ 3200 Intellio C320 Turbo PCI
+1394 Level One Communications
+ 0001 LXT1001 Gigabit Ethernet
+ 1394 0001 NetCelerator Adapter
+1395 Ambicom Inc
+1396 Cipher Systems Inc
+1397 Cologne Chip Designs GmbH
+ 2bd0 ISDN network controller [HFC-PCI]
+ 1397 2bd0 ISDN Board
+ e4bf 1000 CI1-1-Harp
+1398 Clarion co. Ltd
+1399 Rios systems Co Ltd
+139a Alacritech Inc
+ 0001 Quad Port 10/100 Server Accelerator
+ 0003 Single Port 10/100 Server Accelerator
+ 0005 Single Port Gigabit Server Accelerator
+139b Mediasonic Multimedia Systems Ltd
+139c Quantum 3d Inc
+139d EPL limited
+139e Media4
+139f Aethra s.r.l.
+13a0 Crystal Group Inc
+13a1 Kawasaki Heavy Industries Ltd
+13a2 Ositech Communications Inc
+13a3 Hifn Inc.
+ 0005 7751 Security Processor
+ 0006 6500 Public Key Processor
+ 0007 7811 Security Processor
+ 0012 7951 Security Processor
+ 0014 78XX Security Processor
+ 0016 8065 Security Processor
+ 0017 8165 Security Processor
+ 0018 8154 Security Processor
+13a4 Rascom Inc
+13a5 Audio Digital Imaging Inc
+13a6 Videonics Inc
+13a7 Teles AG
+13a8 Exar Corp.
+ 0158 XR17C158 Octal UART
+13a9 Siemens Medical Systems, Ultrasound Group
+13aa Broadband Networks Inc
+13ab Arcom Control Systems Ltd
+13ac Motion Media Technology Ltd
+13ad Nexus Inc
+13ae ALD Technology Ltd
+13af T.Sqware
+13b0 Maxspeed Corp
+13b1 Tamura corporation
+13b2 Techno Chips Co. Ltd
+13b3 Lanart Corporation
+13b4 Wellbean Co Inc
+13b5 ARM
+13b6 Dlog GmbH
+13b7 Logic Devices Inc
+13b8 Nokia Telecommunications oy
+13b9 Elecom Co Ltd
+13ba Oxford Instruments
+13bb Sanyo Technosound Co Ltd
+13bc Bitran Corporation
+13bd Sharp corporation
+13be Miroku Jyoho Service Co. Ltd
+13bf Sharewave Inc
+13c0 Microgate Corporation
+ 0010 SyncLink WAN Adapter
+13c1 3ware Inc
+ 1000 3ware ATA-RAID
+ 1001 3ware 7000-series ATA-RAID
+ 1002 3ware ATA-RAID
+13c2 Technotrend Systemtechnik GmbH
+13c3 Janz Computer AG
+13c4 Phase Metrics
+13c5 Alphi Technology Corp
+13c6 Condor Engineering Inc
+13c7 Blue Chip Technology Ltd
+13c8 Apptech Inc
+13c9 Eaton Corporation
+13ca Iomega Corporation
+13cb Yano Electric Co Ltd
+13cc Metheus Corporation
+13cd Compatible Systems Corporation
+13ce Cocom A/S
+13cf Studio Audio & Video Ltd
+13d0 Techsan Electronics Co Ltd
+# http://www.b2c2inc.com/products/pc-specs.html
+ 2103 B2C2 Sky2PC PCI [SkyStar2]
+13d1 Abocom Systems Inc
+ ab02 ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter
+ ab06 RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter
+13d2 Shark Multimedia Inc
+13d3 IMC Networks
+13d4 Graphics Microsystems Inc
+13d5 Media 100 Inc
+13d6 K.I. Technology Co Ltd
+13d7 Toshiba Engineering Corporation
+13d8 Phobos corporation
+13d9 Apex PC Solutions Inc
+13da Intresource Systems pte Ltd
+13db Janich & Klass Computertechnik GmbH
+13dc Netboost Corporation
+13dd Multimedia Bundle Inc
+13de ABB Robotics Products AB
+13df E-Tech Inc
+ 0001 PCI56RVP Modem
+ 13df 0001 PCI56RVP Modem
+13e0 GVC Corporation
+13e1 Silicom Multimedia Systems Inc
+13e2 Dynamics Research Corporation
+13e3 Nest Inc
+13e4 Calculex Inc
+13e5 Telesoft Design Ltd
+13e6 Argosy research Inc
+13e7 NAC Incorporated
+13e8 Chip Express Corporation
+13e9 Chip Express Corporation
+13ea Dallas Semiconductor
+13eb Hauppauge Computer Works Inc
+13ec Zydacron Inc
+13ed Raytheion E-Systems
+13ee Hayes Microcomputer Products Inc
+13ef Coppercom Inc
+13f0 Sundance Technology Inc
+ 0201 ST201 Sundance Ethernet
+13f1 Oce' - Technologies B.V.
+13f2 Ford Microelectronics Inc
+13f3 Mcdata Corporation
+13f4 Troika Networks, Inc.
+ 1401 Zentai Fibre Channel Adapter
+13f5 Kansai Electric Co. Ltd
+13f6 C-Media Electronics Inc
+ 0100 CM8338A
+ 13f6 ffff CMI8338/C3DX PCI Audio Device
+ 0101 CM8338B
+ 13f6 0101 CMI8338-031 PCI Audio Device
+ 0111 CM8738
+ 1019 0970 P6STP-FL motherboard
+ 1043 8077 CMI8738 6-channel audio controller
+ 1043 80e2 CMI8738 6ch-MX
+ 13f6 0111 CMI8738/C3DX PCI Audio Device
+ 0211 CM8738
+13f7 Wildfire Communications
+13f8 Ad Lib Multimedia Inc
+13f9 NTT Advanced Technology Corp.
+13fa Pentland Systems Ltd
+13fb Aydin Corp
+13fc Computer Peripherals International
+13fd Micro Science Inc
+13fe Advantech Co. Ltd
+ 1756 PCI-1756
+13ff Silicon Spice Inc
+1400 Artx Inc
+ 1401 9432 TX
+1401 CR-Systems A/S
+1402 Meilhaus Electronic GmbH
+1403 Ascor Inc
+1404 Fundamental Software Inc
+1405 Excalibur Systems Inc
+1406 Oce' Printing Systems GmbH
+1407 Lava Computer mfg Inc
+ 0100 Lava Dual Serial
+ 0101 Lava Quatro A
+ 0102 Lava Quatro B
+ 0200 Lava Port Plus
+ 0201 Lava Quad A
+ 0202 Lava Quad B
+ 0500 Lava Single Serial
+ 0600 Lava Port 650
+ 8000 Lava Parallel
+ 8001 Dual parallel port controller A
+ 8002 Lava Dual Parallel port A
+ 8003 Lava Dual Parallel port B
+ 8800 BOCA Research IOPPAR
+1408 Aloka Co. Ltd
+1409 Timedia Technology Co Ltd
+ 7168 PCI2S550 (Dual 16550 UART)
+140a DSP Research Inc
+140b Ramix Inc
+140c Elmic Systems Inc
+140d Matsushita Electric Works Ltd
+140e Goepel Electronic GmbH
+140f Salient Systems Corp
+1410 Midas lab Inc
+1411 Ikos Systems Inc
+1412 IC Ensemble Inc
+ 1712 ICE1712 [Envy24]
+ 1724 ICE1724 [Envy24HT]
+1413 Addonics
+1414 Microsoft Corporation
+1415 Oxford Semiconductor Ltd
+ 8403 VScom 011H-EP1 1 port parallel adaptor
+ 9501 OX16PCI954 (Quad 16950 UART) function 0
+ 15ed 2000 MCCR Serial p0-3 of 8
+ 15ed 2001 MCCR Serial p0-3 of 16
+ 950a EXSYS EX-41092 Dual 16950 Serial adapter
+ 950b OXCB950 Cardbus 16950 UART
+ 9511 OX16PCI954 (Quad 16950 UART) function 1
+ 15ed 2000 MCCR Serial p4-7 of 8
+ 15ed 2001 MCCR Serial p4-15 of 16
+ 9521 OX16PCI952 (Dual 16950 UART)
+1416 Multiwave Innovation pte Ltd
+1417 Convergenet Technologies Inc
+1418 Kyushu electronics systems Inc
+1419 Excel Switching Corp
+141a Apache Micro Peripherals Inc
+141b Zoom Telephonics Inc
+141d Digitan Systems Inc
+141e Fanuc Ltd
+141f Visiontech Ltd
+1420 Psion Dacom plc
+1421 Ads Technologies Inc
+1422 Ygrec Systems Co Ltd
+1423 Custom Technology Corp.
+1424 Videoserver Connections
+1425 ASIC Designers Inc
+1426 Storage Technology Corp.
+1427 Better On-Line Solutions
+1428 Edec Co Ltd
+1429 Unex Technology Corp.
+142a Kingmax Technology Inc
+142b Radiolan
+142c Minton Optic Industry Co Ltd
+142d Pix stream Inc
+142e Vitec Multimedia
+142f Radicom Research Inc
+1430 ITT Aerospace/Communications Division
+1431 Gilat Satellite Networks
+1432 Edimax Computer Co.
+1433 Eltec Elektronik GmbH
+1435 Real Time Devices US Inc.
+1436 CIS Technology Inc
+1437 Nissin Inc Co
+1438 Atmel-dream
+1439 Outsource Engineering & Mfg. Inc
+143a Stargate Solutions Inc
+143b Canon Research Center, America
+143c Amlogic Inc
+143d Tamarack Microelectronics Inc
+143e Jones Futurex Inc
+143f Lightwell Co Ltd - Zax Division
+1440 ALGOL Corp.
+1441 AGIE Ltd
+1442 Phoenix Contact GmbH & Co.
+1443 Unibrain S.A.
+1444 TRW
+1445 Logical DO Ltd
+1446 Graphin Co Ltd
+1447 AIM GmBH
+1448 Alesis Studio Electronics
+1449 TUT Systems Inc
+144a Adlink Technology
+ 7296 PCI-7296
+ 7432 PCI-7432
+ 7433 PCI-7433
+ 7434 PCI-7434
+ 7841 PCI-7841
+ 8133 PCI-8133
+ 8554 PCI-8554
+ 9111 PCI-9111
+ 9113 PCI-9113
+ 9114 PCI-9114
+144b Loronix Information Systems Inc
+144c Catalina Research Inc
+144d Samsung Electronics Co Ltd
+144e OLITEC
+144f Askey Computer Corp.
+1450 Octave Communications Ind.
+1451 SP3D Chip Design GmBH
+1453 MYCOM Inc
+1454 Altiga Networks
+1455 Logic Plus Plus Inc
+1456 Advanced Hardware Architectures
+1457 Nuera Communications Inc
+1458 Giga-byte Technology
+1459 DOOIN Electronics
+145a Escalate Networks Inc
+145b PRAIM SRL
+145c Cryptek
+145d Gallant Computer Inc
+145e Aashima Technology B.V.
+145f Baldor Electric Company
+ 0001 NextMove PCI
+1460 DYNARC INC
+1461 Avermedia Technologies Inc
+1462 Micro-Star International Co., Ltd.
+1463 Fast Corporation
+1464 Interactive Circuits & Systems Ltd
+1465 GN NETTEST Telecom DIV.
+1466 Designpro Inc.
+1467 DIGICOM SPA
+1468 AMBIT Microsystem Corp.
+1469 Cleveland Motion Controls
+146a IFR
+146b Parascan Technologies Ltd
+146c Ruby Tech Corp.
+146d Tachyon, INC.
+146e Williams Electronics Games, Inc.
+146f Multi Dimensional Consulting Inc
+1470 Bay Networks
+1471 Integrated Telecom Express Inc
+1472 DAIKIN Industries, Ltd
+1473 ZAPEX Technologies Inc
+1474 Doug Carson & Associates
+1475 PICAZO Communications
+1476 MORTARA Instrument Inc
+1477 Net Insight
+1478 DIATREND Corporation
+1479 TORAY Industries Inc
+147a FORMOSA Industrial Computing
+147b ABIT Computer Corp.
+147c AWARE, Inc.
+147d Interworks Computer Products
+147e Matsushita Graphic Communication Systems, Inc.
+147f NIHON UNISYS, Ltd.
+1480 SCII Telecom
+1481 BIOPAC Systems Inc
+1482 ISYTEC - Integrierte Systemtechnik GmBH
+1483 LABWAY Corporation
+1484 Logic Corporation
+1485 ERMA - Electronic GmBH
+1486 L3 Communications Telemetry & Instrumentation
+1487 MARQUETTE Medical Systems
+1488 KONTRON Electronik GmBH
+1489 KYE Systems Corporation
+148a OPTO
+148b INNOMEDIALOGIC Inc.
+148c C.P. Technology Co. Ltd
+148d DIGICOM Systems, Inc.
+ 1003 HCF 56k Data/Fax Modem
+148e OSI Plus Corporation
+148f Plant Equipment, Inc.
+1490 Stone Microsystems PTY Ltd.
+1491 ZEAL Corporation
+1492 Time Logic Corporation
+1493 MAKER Communications
+1494 WINTOP Technology, Inc.
+1495 TOKAI Communications Industry Co. Ltd
+1496 JOYTECH Computer Co., Ltd.
+1497 SMA Regelsysteme GmBH
+1498 TEWS Datentechnik GmBH
+1499 EMTEC CO., Ltd
+149a ANDOR Technology Ltd
+149b SEIKO Instruments Inc
+149c OVISLINK Corp.
+149d NEWTEK Inc
+149e Mapletree Networks Inc.
+149f LECTRON Co Ltd
+14a0 SOFTING GmBH
+14a1 Systembase Co Ltd
+14a2 Millennium Engineering Inc
+14a3 Maverick Networks
+14a4 GVC/BCM Advanced Research
+14a5 XIONICS Document Technologies Inc
+14a6 INOVA Computers GmBH & Co KG
+14a7 MYTHOS Systems Inc
+14a8 FEATRON Technologies Corporation
+14a9 HIVERTEC Inc
+14aa Advanced MOS Technology Inc
+14ab Mentor Graphics Corp.
+14ac Novaweb Technologies Inc
+14ad Time Space Radio AB
+14ae CTI, Inc
+14af Guillemot Corporation
+ 7102 3D Prophet II MX
+14b0 BST Communication Technology Ltd
+14b1 Nextcom K.K.
+14b2 ENNOVATE Networks Inc
+14b3 XPEED Inc
+ 0000 DSL NIC
+14b4 PHILIPS Business Electronics B.V.
+14b5 Creamware GmBH
+ 0200 Scope
+ 0300 Pulsar
+ 0400 Pulsar2
+ 0600 Pulsar2
+ 0800 DSP-Board
+ 0900 DSP-Board
+ 0a00 DSP-Board
+ 0b00 DSP-Board
+14b6 Quantum Data Corp.
+14b7 PROXIM Inc
+ 0001 Symphony 4110
+14b8 Techsoft Technology Co Ltd
+14b9 AIRONET Wireless Communications
+ 0001 PC4800
+ 0340 PC4800
+ 0350 PC4800
+ 4500 PC4500
+ 4800 PC4800
+ a504 Cisco Aironet Wireless 802.11b
+14ba INTERNIX Inc.
+14bb SEMTECH Corporation
+14bc Globespan Semiconductor Inc.
+14bd CARDIO Control N.V.
+14be L3 Communications
+14bf SPIDER Communications Inc.
+14c0 COMPAL Electronics Inc
+14c1 MYRICOM Inc.
+14c2 DTK Computer
+14c3 MEDIATEK Corp.
+14c4 IWASAKI Information Systems Co Ltd
+14c5 Automation Products AB
+14c6 Data Race Inc
+14c7 Modular Technology Holdings Ltd
+14c8 Turbocomm Tech. Inc.
+14c9 ODIN Telesystems Inc
+14ca PE Logic Corp.
+14cb Billionton Systems Inc
+14cc NAKAYO Telecommunications Inc
+14cd Universal Scientific Ind.
+14ce Whistle Communications
+14cf TEK Microsystems Inc.
+14d0 Ericsson Axe R & D
+14d1 Computer Hi-Tech Co Ltd
+14d2 Titan Electronics Inc
+ 8001 VScom 010L 1 port parallel adaptor
+ 8002 VScom 020L 2 port parallel adaptor
+ 8010 VScom 100L 1 port serial adaptor
+ 8011 VScom 110L 1 port serial and 1 port parallel adaptor
+ 8020 VScom 200L 1 port serial adaptor
+ 8021 VScom 210L 2 port serial and 1 port parallel adaptor
+ 8040 VScom 400L 4 port serial adaptor
+ 8080 VScom 800L 8 port serial adaptor
+ a000 VScom 010H 1 port parallel adaptor
+ a001 VScom 100H 1 port serial adaptor
+ a003 VScom 400H 4 port serial adaptor
+ a004 VScom 400HF1 4 port serial adaptor
+ a005 VScom 200H 2 port serial adaptor
+ e001 VScom 010HV2 1 port parallel adaptor
+ e010 VScom 100HV2 1 port serial adaptor
+ e020 VScom 200HV2 2 port serial adaptor
+14d3 CIRTECH (UK) Ltd
+14d4 Panacom Technology Corp
+14d5 Nitsuko Corporation
+14d6 Accusys Inc
+14d7 Hirakawa Hewtech Corp
+14d8 HOPF Elektronik GmBH
+14d9 Alpha Processor Inc
+14da National Aerospace Laboratories
+14db AFAVLAB Technology Inc
+ 2120 TK9902
+14dc Amplicon Liveline Ltd
+ 0000 PCI230
+ 0001 PCI242
+ 0002 PCI244
+ 0003 PCI247
+ 0004 PCI248
+ 0005 PCI249
+ 0006 PCI260
+ 0007 PCI224
+ 0008 PCI234
+ 0009 PCI236
+ 000a PCI272
+ 000b PCI215
+14dd Boulder Design Labs Inc
+14de Applied Integration Corporation
+14df ASIC Communications Corp
+14e1 INVERTEX
+14e2 INFOLIBRIA
+14e3 AMTELCO
+14e4 Broadcom Corporation
+ 1644 NetXtreme BCM5700 Gigabit Ethernet
+ 1014 0277 Broadcom Vigil B5700 1000Base-T
+ 1028 00d1 Broadcom BCM5700
+ 1028 0106 Broadcom BCM5700
+ 1028 0109 Broadcom BCM5700 1000Base-T
+ 1028 010a Broadcom BCM5700 1000BaseTX
+ 10b7 1000 3C996-T 1000Base-T
+ 10b7 1001 3C996B-T 1000Base-T
+ 10b7 1002 3C996C-T 1000Base-T
+ 10b7 1003 3C997-T 1000Base-T Dual Port
+ 10b7 1004 3C996-SX 1000Base-SX
+ 10b7 1005 3C997-SX 1000Base-SX Dual Port
+ 10b7 1008 3C942 Gigabit LOM (31X31)
+ 14e4 0002 NetXtreme 1000Base-SX
+ 14e4 0003 NetXtreme 1000Base-SX
+ 14e4 0004 NetXtreme 1000Base-T
+ 14e4 1028 NetXtreme 1000BaseTX
+ 14e4 1644 BCM5700 1000Base-T
+ 1645 NetXtreme BCM5701 Gigabit Ethernet
+ 0e11 007c NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
+ 0e11 007d NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)
+ 0e11 0085 NC7780 Gigabit Server Adapter (embedded, WOL)
+ 0e11 0099 NC7780 Gigabit Server Adapter (embedded, WOL)
+ 0e11 009a NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
+ 0e11 00c1 NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)
+ 1028 0121 Broadcom BCM5701 1000Base-T
+ 10b7 1004 3C996-SX 1000Base-SX
+ 10b7 1006 3C996B-T 1000Base-T
+ 10b7 1007 3C1000-T 1000Base-T
+ 10b7 1008 3C940-BR01 1000Base-T
+ 14e4 0001 BCM5701 1000Base-T
+ 14e4 0005 BCM5701 1000Base-T
+ 14e4 0006 BCM5701 1000Base-T
+ 14e4 0007 BCM5701 1000Base-SX
+ 14e4 0008 BCM5701 1000Base-T
+ 14e4 8008 BCM5701 1000Base-T
+ 1646 NetXtreme BCM5702 Gigabit Ethernet
+ 0e11 00bb NC7760 1000BaseTX
+ 1028 0126 Broadcom BCM5702 1000BaseTX
+ 14e4 8009 BCM5702 1000BaseTX
+ 1647 NetXtreme BCM5703 Gigabit Ethernet
+ 0e11 0099 NC7780 1000BaseTX
+ 0e11 009a NC7770 1000BaseTX
+ 14e4 0009 BCM5703 1000BaseTX
+ 14e4 000a BCM5703 1000BaseSX
+ 14e4 000b BCM5703 1000BaseTX
+ 14e4 8009 BCM5703 1000BaseTX
+ 14e4 800a BCM5703 1000BaseTX
+ 1648 NetXtreme BCM5704 Gigabit Ethernet
+ 0e11 00cf NC7772 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
+ 0e11 00d0 NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
+ 0e11 00d1 NC7783 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
+ 10b7 2000 3C998-T Dual Port 10/100/1000 PCI-X
+ 10b7 3000 3C999-T Quad Port 10/100/1000 PCI-X
+ 1166 1648 NetXtreme CIOB-E 1000Base-T
+ 164d NetXtreme BCM5702FE Gigabit Ethernet
+ 1653 NetXtreme BCM5705 Gigabit Ethernet
+ 165d NetXtreme BCM5705M Gigabit Ethernet
+ 1696 NetXtreme BCM5782 Gigabit Ethernet
+ 14e4 000d NetXtreme BCM5782 1000Base-T
+ 16a6 NetXtreme BCM5702 Gigabit Ethernet
+ 0e11 00bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T)
+ 1028 0126 BCM5702 1000Base-T
+ 14e4 000c BCM5702 1000Base-T
+ 14e4 8009 BCM5702 1000Base-T
+ 16a7 NetXtreme BCM5703 Gigabit Ethernet
+ 0e11 00ca NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
+ 0e11 00cb NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
+ 14e4 0009 NetXtreme BCM5703 1000Base-T
+ 14e4 000a NetXtreme BCM5703 1000Base-SX
+ 14e4 000b NetXtreme BCM5703 1000Base-T
+ 14e4 800a NetXtreme BCM5703 1000Base-T
+ 16a8 NetXtreme BCM5704S Gigabit Ethernet
+ 10b7 2001 3C998-SX Dual Port 1000-SX PCI-X
+ 16c6 NetXtreme BCM5702 Gigabit Ethernet
+ 10b7 1100 3C1000B-T 10/100/1000 PCI
+ 14e4 000c BCM5702 1000Base-T
+ 14e4 8009 BCM5702 1000Base-T
+ 16c7 NetXtreme BCM5703 Gigabit Ethernet
+ 14e4 0009 NetXtreme BCM5703 1000Base-T
+ 14e4 000a NetXtreme BCM5703 1000Base-SX
+ 4210 BCM4210 iLine10 HomePNA 2.0
+ 4211 BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem
+ 4212 BCM4212 v.90 56k modem
+ 4301 BCM4301 802.11b
+ 4401 BCM4401 100Base-T
+ 4402 BCM4402 Integrated 10/100BaseT
+ 4410 BCM4413 iLine32 HomePNA 2.0
+ 4411 BCM4413 V.90 56k modem
+ 4412 BCM4413 10/100BaseT
+ 5820 BCM5820 Crypto Accelerator
+ 5821 BCM5821 Crypto Accelerator
+14e5 Pixelfusion Ltd
+14e6 SHINING Technology Inc
+14e7 3CX
+14e8 RAYCER Inc
+14e9 GARNETS System CO Ltd
+14ea Planex Communications, Inc
+ ab06 FNW-3603-TX CardBus Fast Ethernet
+14eb SEIKO EPSON Corp
+14ec ACQIRIS
+14ed DATAKINETICS Ltd
+14ee MASPRO KENKOH Corp
+14ef CARRY Computer ENG. CO Ltd
+14f0 CANON RESEACH CENTRE FRANCE
+14f1 Conexant
+ 1002 HCF 56k Modem
+ 1003 HCF 56k Modem
+ 1004 HCF 56k Modem
+ 1005 HCF 56k Modem
+ 1006 HCF 56k Modem
+ 1022 HCF 56k Modem
+ 1023 HCF 56k Modem
+ 1024 HCF 56k Modem
+ 1025 HCF 56k Modem
+ 1026 HCF 56k Modem
+ 1032 HCF 56k Modem
+ 1033 HCF 56k Data/Fax Modem
+ 1033 8077 NEC
+ 122d 4027 Dell Zeus - MDP3880-W(B) Data Fax Modem
+ 122d 4030 Dell Mercury - MDP3880-U(B) Data Fax Modem
+ 122d 4034 Dell Thor - MDP3880-W(U) Data Fax Modem
+ 13e0 020d Dell Copper
+ 13e0 020e Dell Silver
+ 13e0 0261 IBM
+ 13e0 0290 Compaq Goldwing
+ 13e0 02a0 IBM
+ 13e0 02b0 IBM
+ 13e0 02c0 Compaq Scooter
+ 13e0 02d0 IBM
+ 144f 1500 IBM P85-DF (1)
+ 144f 1501 IBM P85-DF (2)
+ 144f 150a IBM P85-DF (3)
+ 144f 150b IBM P85-DF Low Profile (1)
+ 144f 1510 IBM P85-DF Low Profile (2)
+ 1034 HCF 56k Data/Fax/Voice Modem
+ 1035 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 10cf 1098 Fujitsu P85-DFSV
+ 1036 HCF 56k Data/Fax/Voice/Spkp Modem
+ 104d 8067 HCF 56k Modem
+ 122d 4029 MDP3880SP-W
+ 122d 4031 MDP3880SP-U
+ 13e0 0209 Dell Titanium
+ 13e0 020a Dell Graphite
+ 13e0 0260 Gateway Red Owl
+ 13e0 0270 Gateway White Horse
+ 1052 HCF 56k Data/Fax Modem (Worldwide)
+ 1053 HCF 56k Data/Fax Modem (Worldwide)
+ 1054 HCF 56k Data/Fax/Voice Modem (Worldwide)
+ 1055 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (Worldwide)
+ 1056 HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)
+ 1057 HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)
+ 1059 HCF 56k Data/Fax/Voice Modem (Worldwide)
+ 1063 HCF 56k Data/Fax Modem
+ 1064 HCF 56k Data/Fax/Voice Modem
+ 1065 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 1066 HCF 56k Data/Fax/Voice/Spkp Modem
+ 122d 4033 Dell Athena - MDP3900V-U
+ 1433 HCF 56k Data/Fax Modem
+ 1434 HCF 56k Data/Fax/Voice Modem
+ 1435 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 1436 HCF 56k Data/Fax Modem
+ 1453 HCF 56k Data/Fax Modem
+ 13e0 0240 IBM
+ 13e0 0250 IBM
+ 144f 1502 IBM P95-DF (1)
+ 144f 1503 IBM P95-DF (2)
+ 1454 HCF 56k Data/Fax/Voice Modem
+ 1455 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 1456 HCF 56k Data/Fax/Voice/Spkp Modem
+ 122d 4035 Dell Europa - MDP3900V-W
+ 122d 4302 Dell MP3930V-W(C) MiniPCI
+ 1610 ADSL AccessRunner PCI Arbitration Device
+ 1611 AccessRunner PCI ADSL Interface Device
+ 1803 HCF 56k Modem
+ 0e11 0023 623-LAN Grizzly
+ 0e11 0043 623-LAN Yogi
+ 1815 HCF 56k Modem
+ 0e11 0022 Grizzly
+ 0e11 0042 Yogi
+ 2003 HSF 56k Data/Fax Modem
+ 2004 HSF 56k Data/Fax/Voice Modem
+ 2005 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 2006 HSF 56k Data/Fax/Voice/Spkp Modem
+ 2013 HSF 56k Data/Fax Modem
+ 0e11 b195 Bear
+ 0e11 b196 Seminole 1
+ 0e11 b1be Seminole 2
+ 1025 8013 Acer
+ 1033 809d NEC
+ 1033 80bc NEC
+ 155d 6793 HP
+ 155d 8850 E Machines
+ 2014 HSF 56k Data/Fax/Voice Modem
+ 2015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem
+ 2016 HSF 56k Data/Fax/Voice/Spkp Modem
+ 2043 HSF 56k Data/Fax Modem (WorldW SmartDAA)
+ 2044 HSF 56k Data/Fax/Voice Modem (WorldW SmartDAA)
+ 2045 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (WorldW SmartDAA)
+ 2046 HSF 56k Data/Fax/Voice/Spkp Modem (WorldW SmartDAA)
+ 2063 HSF 56k Data/Fax Modem (SmartDAA)
+ 2064 HSF 56k Data/Fax/Voice Modem (SmartDAA)
+ 2065 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (SmartDAA)
+ 2066 HSF 56k Data/Fax/Voice/Spkp Modem (SmartDAA)
+ 2093 HSF 56k Modem
+ 155d 2f07 Legend
+ 2143 HSF 56k Data/Fax/Cell Modem (Mob WorldW SmartDAA)
+ 2144 HSF 56k Data/Fax/Voice/Cell Modem (Mob WorldW SmartDAA)
+ 2145 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob WorldW SmartDAA)
+ 2146 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob WorldW SmartDAA)
+ 2163 HSF 56k Data/Fax/Cell Modem (Mob SmartDAA)
+ 2164 HSF 56k Data/Fax/Voice/Cell Modem (Mob SmartDAA)
+ 2165 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob SmartDAA)
+ 2166 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob SmartDAA)
+ 2343 HSF 56k Data/Fax CardBus Modem (Mob WorldW SmartDAA)
+ 2344 HSF 56k Data/Fax/Voice CardBus Modem (Mob WorldW SmartDAA)
+ 2345 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob WorldW SmartDAA)
+ 2346 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob WorldW SmartDAA)
+ 2363 HSF 56k Data/Fax CardBus Modem (Mob SmartDAA)
+ 2364 HSF 56k Data/Fax/Voice CardBus Modem (Mob SmartDAA)
+ 2365 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob SmartDAA)
+ 2366 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob SmartDAA)
+ 2443 HSF 56k Data/Fax Modem (Mob WorldW SmartDAA)
+ 104d 8075 Modem
+ 104d 8083 Modem
+ 104d 8097 Modem
+ 2444 HSF 56k Data/Fax/Voice Modem (Mob WorldW SmartDAA)
+ 2445 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob WorldW SmartDAA)
+ 2446 HSF 56k Data/Fax/Voice/Spkp Modem (Mob WorldW SmartDAA)
+ 2463 HSF 56k Data/Fax Modem (Mob SmartDAA)
+ 2464 HSF 56k Data/Fax/Voice Modem (Mob SmartDAA)
+ 2465 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob SmartDAA)
+ 2466 HSF 56k Data/Fax/Voice/Spkp Modem (Mob SmartDAA)
+ 2f00 HSF 56k HSFi Modem
+ 13e0 8d84 IBM HSFi V.90
+ 13e0 8d85 Compaq Stinger
+ 14f1 2004 Dynalink 56PMi
+ 8234 RS8234 ATM SAR Controller [ServiceSAR Plus]
+14f2 MOBILITY Electronics
+14f3 BROADLOGIC
+14f4 TOKYO Electronic Industry CO Ltd
+14f5 SOPAC Ltd
+14f6 COYOTE Technologies LLC
+14f7 WOLF Technology Inc
+14f8 AUDIOCODES Inc
+14f9 AG COMMUNICATIONS
+14fa WANDEL & GOCHERMANN
+14fb TRANSAS MARINE (UK) Ltd
+14fc QUADRICS Supercomputers World
+14fd JAPAN Computer Industry Inc
+14fe ARCHTEK TELECOM Corp
+14ff TWINHEAD INTERNATIONAL Corp
+1500 DELTA Electronics, Inc
+1501 BANKSOFT CANADA Ltd
+1502 MITSUBISHI ELECTRIC LOGISTICS SUPPORT Co Ltd
+1503 KAWASAKI LSI USA Inc
+1504 KAISER Electronics
+1505 ITA INGENIEURBURO FUR TESTAUFGABEN GmbH
+1506 CHAMELEON Systems Inc
+# Should be HTEC Ltd, but there are no known HTEC chips and 1507 is already used by mistake by Motorola (see vendor ID 1057).
+1507 Motorola ?? / HTEC
+ 0001 MPC105 [Eagle]
+ 0002 MPC106 [Grackle]
+ 0003 MPC8240 [Kahlua]
+ 0100 MC145575 [HFC-PCI]
+ 0431 KTI829c 100VG
+ 4801 Raven
+ 4802 Falcon
+ 4803 Hawk
+ 4806 CPX8216
+1508 HONDA CONNECTORS/MHOTRONICS Inc
+1509 FIRST INTERNATIONAL Computer Inc
+150a FORVUS RESEARCH Inc
+150b YAMASHITA Systems Corp
+150c KYOPAL CO Ltd
+150d WARPSPPED Inc
+150e C-PORT Corp
+150f INTEC GmbH
+1510 BEHAVIOR TECH Computer Corp
+1511 CENTILLIUM Technology Corp
+1512 ROSUN Technologies Inc
+1513 Raychem
+1514 TFL LAN Inc
+1515 Advent design
+1516 MYSON Technology Inc
+ 0803 SURECOM EP-320X-S 100/10M Ethernet PCI Adapter
+ 1320 10bd SURECOM EP-320X-S 100/10M Ethernet PCI Adapter
+1517 ECHOTEK Corp
+1518 PEP MODULAR Computers GmbH
+1519 TELEFON AKTIEBOLAGET LM Ericsson
+151a Globetek
+ 1002 PCI-1002
+ 1004 PCI-1004
+ 1008 PCI-1008
+151b COMBOX Ltd
+151c DIGITAL AUDIO LABS Inc
+151d Fujitsu Computer Products Of America
+151e MATRIX Corp
+151f TOPIC SEMICONDUCTOR Corp
+ 0000 TP560 Data/Fax/Voice 56k modem
+1520 CHAPLET System Inc
+1521 BELL Corp
+1522 MainPine Ltd
+ 0100 PCI <-> IOBus Bridge
+ 1522 0200 RockForceDUO 2 Port V.92/V.44 Data/Fax/Voice Modem
+ 1522 0300 RockForceQUATRO 4 Port V.92/V.44 Data/Fax/Voice Modem
+ 1522 0400 RockForceDUO+ 2 Port V.92/V.44 Data/Fax/Voice Modem
+ 1522 0500 RockForceQUATRO+ 4 Port V.92/V.44 Data/Fax/Voice Modem
+ 1522 0600 RockForce+ 2 Port V.90 Data/Fax/Voice Modem
+ 1522 0700 RockForce+ 4 Port V.90 Data/Fax/Voice Modem
+ 1522 0800 RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem
+1523 MUSIC Semiconductors
+1524 ENE Technology Inc
+ 1211 CB1211 Cardbus Controller
+ 1225 CB1225 Cardbus Controller
+ 1410 CB1410 Cardbus Controller
+ 1420 CB1420 Cardbus Controller
+1525 IMPACT Technologies
+1526 ISS, Inc
+1527 SOLECTRON
+1528 ACKSYS
+1529 AMERICAN MICROSystems Inc
+152a QUICKTURN DESIGN Systems
+152b FLYTECH Technology CO Ltd
+152c MACRAIGOR Systems LLC
+152d QUANTA Computer Inc
+152e MELEC Inc
+152f PHILIPS - CRYPTO
+1530 ACQIS Technology Inc
+1531 CHRYON Corp
+1532 ECHELON Corp
+1533 BALTIMORE
+1534 ROAD Corp
+1535 EVERGREEN Technologies Inc
+1537 DATALEX COMMUNCATIONS
+1538 ARALION Inc
+1539 ATELIER INFORMATIQUES et ELECTRONIQUE ETUDES S.A.
+153a ONO SOKKI
+153b TERRATEC Electronic GmbH
+153c ANTAL Electronic
+153d FILANET Corp
+153e TECHWELL Inc
+153f MIPS DENMARK
+1540 PROVIDEO MULTIMEDIA Co Ltd
+1541 MACHONE Communications
+1542 VIVID Technology Inc
+1543 SILICON Laboratories
+ 3052 Intel 537 [Winmodem]
+ 4c22 Si3036 MC'97 DAA
+1544 DCM DATA Systems
+1545 VISIONTEK
+1546 IOI Technology Corp
+1547 MITUTOYO Corp
+1548 JET PROPULSION Laboratory
+1549 INTERCONNECT Systems Solutions
+154a MAX Technologies Inc
+154b COMPUTEX Co Ltd
+154c VISUAL Technology Inc
+154d PAN INTERNATIONAL Industrial Corp
+154e SERVOTEST Ltd
+154f STRATABEAM Technology
+1550 OPEN NETWORK Co Ltd
+1551 SMART Electronic DEVELOPMENT GmBH
+1552 RACAL AIRTECH Ltd
+1553 CHICONY Electronics Co Ltd
+1554 PROLINK Microsystems Corp
+1555 GESYTEC GmBH
+1556 PLD APPLICATIONS
+1557 MEDIASTAR Co Ltd
+1558 CLEVO/KAPOK Computer
+1559 SI LOGIC Ltd
+155a INNOMEDIA Inc
+155b PROTAC INTERNATIONAL Corp
+155c Cemax-Icon Inc
+155d Mac System Co Ltd
+155e LP Elektronik GmbH
+155f Perle Systems Ltd
+1560 Terayon Communications Systems
+1561 Viewgraphics Inc
+1562 Symbol Technologies
+1563 A-Trend Technology Co Ltd
+1564 Yamakatsu Electronics Industry Co Ltd
+1565 Biostar Microtech Int'l Corp
+1566 Ardent Technologies Inc
+1567 Jungsoft
+1568 DDK Electronics Inc
+1569 Palit Microsystems Inc.
+156a Avtec Systems
+156b 2wire Inc
+156c Vidac Electronics GmbH
+156d Alpha-Top Corp
+156e Alfa Inc
+156f M-Systems Flash Disk Pioneers Ltd
+1570 Lecroy Corp
+1571 Contemporary Controls
+ a001 CCSI PCI20-485 ARCnet
+ a002 CCSI PCI20-485D ARCnet
+ a003 CCSI PCI20-485X ARCnet
+ a004 CCSI PCI20-CXB ARCnet
+ a005 CCSI PCI20-CXS ARCnet
+ a006 CCSI PCI20-FOG-SMA ARCnet
+ a007 CCSI PCI20-FOG-ST ARCnet
+ a008 CCSI PCI20-TB5 ARCnet
+ a009 CCSI PCI20-5-485 5Mbit ARCnet
+ a00a CCSI PCI20-5-485D 5Mbit ARCnet
+ a00b CCSI PCI20-5-485X 5Mbit ARCnet
+ a00c CCSI PCI20-5-FOG-ST 5Mbit ARCnet
+ a00d CCSI PCI20-5-FOG-SMA 5Mbit ARCnet
+ a201 CCSI PCI22-485 10Mbit ARCnet
+ a202 CCSI PCI22-485D 10Mbit ARCnet
+ a203 CCSI PCI22-485X 10Mbit ARCnet
+ a204 CCSI PCI22-CHB 10Mbit ARCnet
+ a205 CCSI PCI22-FOG_ST 10Mbit ARCnet
+ a206 CCSI PCI22-THB 10Mbit ARCnet
+1572 Otis Elevator Company
+1573 Lattice - Vantis
+1574 Fairchild Semiconductor
+1575 Voltaire Advanced Data Security Ltd
+1576 Viewcast COM
+1578 HITT
+1579 Dual Technology Corp
+157a Japan Elecronics Ind Inc
+157b Star Multimedia Corp
+157c Eurosoft (UK)
+ 8001 Fix2000 PCI Y2K Compliance Card
+157d Gemflex Networks
+157e Transition Networks
+157f PX Instruments Technology Ltd
+1580 Primex Aerospace Co
+1581 SEH Computertechnik GmbH
+1582 Cytec Corp
+1583 Inet Technologies Inc
+1584 Uniwill Computer Corp
+1585 Logitron
+1586 Lancast Inc
+1587 Konica Corp
+1588 Solidum Systems Corp
+1589 Atlantek Microsystems Pty Ltd
+158a Digalog Systems Inc
+158b Allied Data Technologies
+158c Hitachi Semiconductor & Devices Sales Co Ltd
+158d Point Multimedia Systems
+158e Lara Technology Inc
+158f Ditect Coop
+1590 3pardata Inc
+1591 ARN
+1592 Syba Tech Ltd
+ 0781 Multi-IO Card
+ 0782 Parallel Port Card 2xEPP
+ 0783 Multi-IO Card
+ 0785 Multi-IO Card
+ 0786 Multi-IO Card
+ 0787 Multi-IO Card
+ 0788 Multi-IO Card
+ 078a Multi-IO Card
+1593 Bops Inc
+1594 Netgame Ltd
+1595 Diva Systems Corp
+1596 Folsom Research Inc
+1597 Memec Design Services
+1598 Granite Microsystems
+1599 Delta Electronics Inc
+159a General Instrument
+159b Faraday Technology Corp
+159c Stratus Computer Systems
+159d Ningbo Harrison Electronics Co Ltd
+159e A-Max Technology Co Ltd
+159f Galea Network Security
+15a0 Compumaster SRL
+15a1 Geocast Network Systems
+15a2 Catalyst Enterprises Inc
+ 0001 TA700 PCI Bus Analyzer/Exerciser
+15a3 Italtel
+15a4 X-Net OY
+15a5 Toyota Macs Inc
+15a6 Sunlight Ultrasound Technologies Ltd
+15a7 SSE Telecom Inc
+15a8 Shanghai Communications Technologies Center
+15aa Moreton Bay
+15ab Bluesteel Networks Inc
+15ac North Atlantic Instruments
+15ad VMWare Inc
+ 0710 Virtual SVGA
+15ae Amersham Pharmacia Biotech
+15b0 Zoltrix International Ltd
+15b1 Source Technology Inc
+15b2 Mosaid Technologies Inc
+15b3 Mellanox Technology
+ 5274 MT21108 InfiniBridge
+15b4 CCI/TRIAD
+15b5 Cimetrics Inc
+15b6 Texas Memory Systems Inc
+15b7 Sandisk Corp
+15b8 ADDI-DATA GmbH
+15b9 Maestro Digital Communications
+15ba Impacct Technology Corp
+15bb Portwell Inc
+15bc Agilent Technologies
+ 2929 E2929A PCI/PCI-X Bus Analyzer
+15bd DFI Inc
+15be Sola Electronics
+15bf High Tech Computer Corp (HTC)
+15c0 BVM Ltd
+15c1 Quantel
+15c2 Newer Technology Inc
+15c3 Taiwan Mycomp Co Ltd
+15c4 EVSX Inc
+15c5 Procomp Informatics Ltd
+15c6 Technical University of Budapest
+15c7 Tateyama System Laboratory Co Ltd
+ 0349 Tateyama C-PCI PLC/NC card Rev.01A
+15c8 Penta Media Co Ltd
+15c9 Serome Technology Inc
+15ca Bitboys OY
+15cb AG Electronics Ltd
+15cc Hotrail Inc
+15cd Dreamtech Co Ltd
+15ce Genrad Inc
+15cf Hilscher GmbH
+15d1 Infineon Technologies AG
+15d2 FIC (First International Computer Inc)
+15d3 NDS Technologies Israel Ltd
+15d4 Iwill Corp
+15d5 Tatung Co
+15d6 Entridia Corp
+15d7 Rockwell-Collins Inc
+15d8 Cybernetics Technology Co Ltd
+15d9 Super Micro Computer Inc
+15da Cyberfirm Inc
+15db Applied Computing Systems Inc
+15dc Litronic Inc
+ 0001 Argus 300 PCI Cryptography Module
+15dd Sigmatel Inc
+15de Malleable Technologies Inc
+15df Infinilink Corp
+15e0 Cacheflow Inc
+15e1 Voice Technologies Group Inc
+15e2 Quicknet Technologies Inc
+15e3 Networth Technologies Inc
+15e4 VSN Systemen BV
+15e5 Valley technologies Inc
+15e6 Agere Inc
+15e7 Get Engineering Corp
+15e8 National Datacomm Corp
+ 0130 Wireless PCI Card
+15e9 Pacific Digital Corp
+15ea Tokyo Denshi Sekei K.K.
+15eb Drsearch GmbH
+15ec Beckhoff GmbH
+15ed Macrolink Inc
+15ee In Win Development Inc
+15ef Intelligent Paradigm Inc
+15f0 B-Tree Systems Inc
+15f1 Times N Systems Inc
+15f2 Diagnostic Instruments Inc
+15f3 Digitmedia Corp
+15f4 Valuesoft
+15f5 Power Micro Research
+15f6 Extreme Packet Device Inc
+15f7 Banctec
+15f8 Koga Electronics Co
+15f9 Zenith Electronics Corp
+15fa J.P. Axzam Corp
+15fb Zilog Inc
+15fc Techsan Electronics Co Ltd
+15fd N-CUBED.NET
+15fe Kinpo Electronics Inc
+15ff Fastpoint Technologies Inc
+1600 Northrop Grumman - Canada Ltd
+1601 Tenta Technology
+1602 Prosys-tec Inc
+1603 Nokia Wireless Communications
+1604 Central System Research Co Ltd
+1605 Pairgain Technologies
+1606 Europop AG
+1607 Lava Semiconductor Manufacturing Inc
+1608 Automated Wagering International
+1609 Scimetric Instruments Inc
+1612 Telesynergy Research Inc.
+1619 FarSite Communications Ltd
+ 0400 FarSync T2P (2 port X.21/V.35/V.24)
+ 0440 FarSync T4P (4 port X.21/V.35/V.24)
+1629 Kongsberg Spacetec AS
+ 1003 Format synchronizer v3.0
+ 2002 Fast Universal Data Output
+1638 Standard Microsystems Corp [SMC]
+ 1100 SMC2602W EZConnect / Addtron AWA-100
+163c Smart Link Ltd.
+ 5449 SmartPCI561 Modem
+1657 Brocade Communications Systems, Inc.
+165a Epix Inc
+ c100 PIXCI(R) CL1 Camera Link Video Capture Board [custom QL5232]
+ d200 PIXCI(R) D2X Digital Video Capture Board [custom QL5232]
+ d300 PIXCI(R) D3X Digital Video Capture Board [custom QL5232]
+165d Hsing Tech. Enterprise Co., Ltd.
+1661 Worldspace Corp.
+1668 Actiontec Electronics Inc
+1681 Hercules
+16ab Global Sun Technology Inc
+ 1102 PCMCIA-to-PCI Wireless Network Bridge
+16be Creatix Polymedia GmbH
+16ec U.S. Robotics
+ 3685 Wireless Access PCI Adapter Model 022415
+16f6 VideoTele.com, Inc.
+1705 Digital First, Inc.
+170b NetOctave Inc
+170c YottaYotta Inc.
+172a Accelerated Encryption
+1737 Linksys
+173b Altima (nee Broadcom)
+ 03e8 AC1000 Gigabit Ethernet
+ 03ea AC9100 Gigabit Ethernet
+ 173b 0001 AC1002
+1743 Peppercon AG
+ 8139 ROL/F-100 Fast Ethernet Adapter with ROL
+174b PC Partner Limited
+175e Sanera Systems, Inc.
+1787 Hightech Information System Ltd.
+# also used by Struck Innovative Systeme for joint developments
+1796 Research Centre Juelich
+ 0001 SIS1100 [Gigabit link]
+ 0002 HOTlink
+ 0003 Counter Timer
+ 0004 CAMAC Controller
+ 0005 PROFIBUS
+ 0006 AMCC HOTlink
+1799 Belkin
+17af Hightech Information System Ltd.
+17cc NetChip Technology, Inc
+ 2280 USB 2.0
+1813 Ambient Technologies Inc
+ 4000 HaM controllerless modem
+ 16be 0001 V9x HAM Data Fax Modem
+ 4100 HaM plus Data Fax Modem
+ 16be 0002 V9x HAM 1394
+1851 Microtune, Inc.
+1852 Anritsu Corp.
+1888 Varisys Ltd
+ 0301 VMFX1 FPGA PMC module
+ 0601 VSM2 dual PMC carrier
+ 0710 VS14x series PowerPC PCI board
+ 0720 VS24x series PowerPC PCI board
+1a08 Sierra semiconductor
+ 0000 SC15064
+1b13 Jaton Corp
+1c1c Symphony
+ 0001 82C101
+1d44 DPT
+ a400 PM2x24/PM3224
+1de1 Tekram Technology Co.,Ltd.
+ 0391 TRM-S1040
+ 2020 DC-390
+ 690c 690c
+ dc29 DC290
+2000 Smart Link Ltd.
+2001 Temporal Research Ltd
+2003 Smart Link Ltd.
+2004 Smart Link Ltd.
+21c3 21st Century Computer Corp.
+2348 Racore
+ 2010 8142 100VG/AnyLAN
+2646 Kingston Technologies
+270b Xantel Corporation
+270f Chaintech Computer Co. Ltd
+2711 AVID Technology Inc.
+2a15 3D Vision(???)
+3000 Hansol Electronics Inc.
+3142 Post Impression Systems.
+3388 Hint Corp
+ 0013 HiNT HC4 PCI to ISDN bridge, Multimedia audio controller
+ 0014 HiNT HC4 PCI to ISDN bridge, Network controller
+ 0021 HB1-SE33 PCI-PCI Bridge
+ 8011 VXPro II Chipset
+ 3388 8011 VXPro II Chipset CPU to PCI Bridge
+ 8012 VXPro II Chipset
+ 3388 8012 VXPro II Chipset PCI to ISA Bridge
+ 8013 VXPro II IDE
+ 3388 8013 VXPro II Chipset EIDE Controller
+3411 Quantum Designs (H.K.) Inc
+3513 ARCOM Control Systems Ltd
+38ef 4Links
+3d3d 3DLabs
+ 0001 GLINT 300SX
+ 0002 GLINT 500TX
+ 0003 GLINT Delta
+ 0004 Permedia
+ 0005 Permedia
+ 0006 GLINT MX
+ 0007 3D Extreme
+ 0008 GLINT Gamma G1
+ 0009 Permedia II 2D+3D
+ 1040 0011 AccelStar II
+ 3d3d 0100 AccelStar II 3D Accelerator
+ 3d3d 0111 Permedia 3:16
+ 3d3d 0114 Santa Ana
+ 3d3d 0116 Oxygen GVX1
+ 3d3d 0119 Scirocco
+ 3d3d 0120 Santa Ana PCL
+ 3d3d 0125 Oxygen VX1
+ 3d3d 0127 Permedia3 Create!
+ 000a GLINT R3
+ 3d3d 0121 Oxygen VX1
+ 000c GLINT R3 [Oxygen VX1]
+ 3d3d 0144 Oxygen VX1-4X AGP [Permedia 4]
+ 0100 Permedia II 2D+3D
+ 1004 Permedia
+ 3d04 Permedia
+ ffff Glint VGA
+4005 Avance Logic Inc.
+ 0300 ALS300 PCI Audio Device
+ 0308 ALS300+ PCI Audio Device
+ 0309 PCI Input Controller
+ 1064 ALG-2064
+ 2064 ALG-2064i
+ 2128 ALG-2364A GUI Accelerator
+ 2301 ALG-2301
+ 2302 ALG-2302
+ 2303 AVG-2302 GUI Accelerator
+ 2364 ALG-2364A
+ 2464 ALG-2464
+ 2501 ALG-2564A/25128A
+ 4000 ALS4000 Audio Chipset
+ 4005 4000 ALS4000 Audio Chipset
+ 4710 ALC200/200P
+4033 Addtron Technology Co, Inc.
+ 1360 RTL8139 Ethernet
+4143 Digital Equipment Corp
+416c Aladdin Knowledge Systems
+ 0100 AladdinCARD
+ 0200 CPC
+4444 Internext Compression Inc
+ 0803 iTVC15 MPEG-2 Encoder
+4468 Bridgeport machines
+4594 Cogetec Informatique Inc
+45fb Baldor Electric Company
+4680 Umax Computer Corp
+4843 Hercules Computer Technology Inc
+4916 RedCreek Communications Inc
+ 1960 RedCreek PCI adapter
+4943 Growth Networks
+4978 Axil Computer Inc
+4a14 NetVin
+ 5000 NV5000SC
+ 4a14 5000 RT8029-Based Ethernet Adapter
+4b10 Buslogic Inc.
+4c48 LUNG HWA Electronics
+4c53 SBS Technologies
+4ca1 Seanix Technology Inc
+4d51 MediaQ Inc.
+ 0200 MQ-200
+4d54 Microtechnica Co Ltd
+4ddc ILC Data Device Corp
+ 0100 DD-42924I5-300 (ARINC 429 Data Bus)
+ 0801 BU-65570I1 MIL-STD-1553 Test and Simulation
+ 0802 BU-65570I2 MIL-STD-1553 Test and Simulation
+ 0811 BU-65572I1 MIL-STD-1553 Test and Simulation
+ 0812 BU-65572I2 MIL-STD-1553 Test and Simulation
+ 0881 BU-65570T1 MIL-STD-1553 Test and Simulation
+ 0882 BU-65570T2 MIL-STD-1553 Test and Simulation
+ 0891 BU-65572T1 MIL-STD-1553 Test and Simulation
+ 0892 BU-65572T2 MIL-STD-1553 Test and Simulation
+ 0901 BU-65565C1 MIL-STD-1553 Data Bus
+ 0902 BU-65565C2 MIL-STD-1553 Data Bus
+ 0903 BU-65565C3 MIL-STD-1553 Data Bus
+ 0904 BU-65565C4 MIL-STD-1553 Data Bus
+ 0b01 BU-65569I1 MIL-STD-1553 Data Bus
+ 0b02 BU-65569I2 MIL-STD-1553 Data Bus
+ 0b03 BU-65569I3 MIL-STD-1553 Data Bus
+ 0b04 BU-65569I4 MIL-STD-1553 Data Bus
+5046 GemTek Technology Corporation
+ 1001 PCI Radio
+5053 Voyetra Technologies
+ 2010 Daytona Audio Adapter
+5136 S S Technologies
+5143 Qualcomm Inc
+5145 Ensoniq (Old)
+ 3031 Concert AudioPCI
+5168 Animation Technologies Inc.
+5301 Alliance Semiconductor Corp.
+ 0001 ProMotion aT3D
+5333 S3 Inc.
+ 0551 Plato/PX (system)
+ 5631 86c325 [ViRGE]
+ 8800 86c866 [Vision 866]
+ 8801 86c964 [Vision 964]
+ 8810 86c764_0 [Trio 32 vers 0]
+ 8811 86c764/765 [Trio32/64/64V+]
+ 8812 86cM65 [Aurora64V+]
+ 8813 86c764_3 [Trio 32/64 vers 3]
+ 8814 86c767 [Trio 64UV+]
+ 8815 86cM65 [Aurora 128]
+ 883d 86c988 [ViRGE/VX]
+ 8870 FireGL
+ 8880 86c868 [Vision 868 VRAM] vers 0
+ 8881 86c868 [Vision 868 VRAM] vers 1
+ 8882 86c868 [Vision 868 VRAM] vers 2
+ 8883 86c868 [Vision 868 VRAM] vers 3
+ 88b0 86c928 [Vision 928 VRAM] vers 0
+ 88b1 86c928 [Vision 928 VRAM] vers 1
+ 88b2 86c928 [Vision 928 VRAM] vers 2
+ 88b3 86c928 [Vision 928 VRAM] vers 3
+ 88c0 86c864 [Vision 864 DRAM] vers 0
+ 88c1 86c864 [Vision 864 DRAM] vers 1
+ 88c2 86c864 [Vision 864-P DRAM] vers 2
+ 88c3 86c864 [Vision 864-P DRAM] vers 3
+ 88d0 86c964 [Vision 964 VRAM] vers 0
+ 88d1 86c964 [Vision 964 VRAM] vers 1
+ 88d2 86c964 [Vision 964-P VRAM] vers 2
+ 88d3 86c964 [Vision 964-P VRAM] vers 3
+ 88f0 86c968 [Vision 968 VRAM] rev 0
+ 88f1 86c968 [Vision 968 VRAM] rev 1
+ 88f2 86c968 [Vision 968 VRAM] rev 2
+ 88f3 86c968 [Vision 968 VRAM] rev 3
+ 8900 86c755 [Trio 64V2/DX]
+ 5333 8900 86C775 Trio64V2/DX
+ 8901 86c775/86c785 [Trio 64V2/DX or /GX]
+ 5333 8901 86C775 Trio64V2/DX, 86C785 Trio64V2/GX
+ 8902 Plato/PX
+ 8903 Trio 3D business multimedia
+ 8904 Trio 64 3D
+ 1014 00db Integrated Trio3D
+ 5333 8904 86C365 Trio3D AGP
+ 8905 Trio 64V+ family
+ 8906 Trio 64V+ family
+ 8907 Trio 64V+ family
+ 8908 Trio 64V+ family
+ 8909 Trio 64V+ family
+ 890a Trio 64V+ family
+ 890b Trio 64V+ family
+ 890c Trio 64V+ family
+ 890d Trio 64V+ family
+ 890e Trio 64V+ family
+ 890f Trio 64V+ family
+ 8a01 ViRGE/DX or /GX
+ 0e11 b032 ViRGE/GX
+ 10b4 1617 Nitro 3D
+ 10b4 1717 Nitro 3D
+ 5333 8a01 ViRGE/DX
+ 8a10 ViRGE/GX2
+ 1092 8a10 Stealth 3D 4000
+ 8a13 86c368 [Trio 3D/2X]
+ 5333 8a13 Trio3D/2X
+ 8a20 86c794 [Savage 3D]
+ 5333 8a20 86C391 Savage3D
+ 8a21 86c390 [Savage 3D/MV]
+ 5333 8a21 86C390 Savage3D/MV
+ 8a22 Savage 4
+ 1033 8068 Savage 4
+ 1033 8069 Savage 4
+ 105d 0018 SR9 8Mb SDRAM
+ 105d 002a SR9 Pro 16Mb SDRAM
+ 105d 003a SR9 Pro 32Mb SDRAM
+ 105d 092f SR9 Pro+ 16Mb SGRAM
+ 1092 4207 Stealth III S540
+ 1092 4800 Stealth III S540
+ 1092 4807 SpeedStar A90
+ 1092 4808 Stealth III S540
+ 1092 4809 Stealth III S540
+ 1092 480e Stealth III S540
+ 1092 4904 Stealth III S520
+ 1092 4905 SpeedStar A200
+ 1092 4a09 Stealth III S540
+ 1092 4a0b Stealth III S540 Xtreme
+ 1092 4a0f Stealth III S540
+ 1092 4e01 Stealth III S540
+ 1102 101d 3d Blaster Savage 4
+ 1102 101e 3d Blaster Savage 4
+ 5333 8100 86C394-397 Savage4 SDRAM 100
+ 5333 8110 86C394-397 Savage4 SDRAM 110
+ 5333 8125 86C394-397 Savage4 SDRAM 125
+ 5333 8143 86C394-397 Savage4 SDRAM 143
+ 5333 8a22 86C394-397 Savage4
+ 5333 8a2e 86C394-397 Savage4 32bit
+ 5333 9125 86C394-397 Savage4 SGRAM 125
+ 5333 9143 86C394-397 Savage4 SGRAM 143
+ 8a23 Savage 4
+ 8a25 ProSavage PM133
+ 8a26 ProSavage KM133
+ 8c00 ViRGE/M3
+ 8c01 ViRGE/MX
+ 1179 0001 ViRGE/MX
+ 8c02 ViRGE/MX+
+ 8c03 ViRGE/MX+MV
+ 8c10 86C270-294 Savage/MX-MV
+ 8c11 82C270-294 Savage/MX
+ 8c12 86C270-294 Savage/IX-MV
+ 1014 017f ThinkPad T20
+ 8c13 86C270-294 Savage/IX
+ 1179 0001 Magnia Z310
+ 8c22 SuperSavage MX/128
+ 8c24 SuperSavage MX/64
+ 8c26 SuperSavage MX/64C
+ 8c2a SuperSavage IX/128 SDR
+ 8c2b SuperSavage IX/128 DDR
+ 8c2c SuperSavage IX/64 SDR
+ 8c2d SuperSavage IX/64 DDR
+ 8c2e SuperSavage IX/C SDR
+ 1014 01fc ThinkPad T23 (2647-4MG)
+ 8c2f SuperSavage IX/C DDR
+ 8d01 86C380 [ProSavageDDR K4M266]
+ 8d02 VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK)
+ 8d03 VT8751 [ProSavageDDR P4M266]
+ 8d04 [ProSavageDDR K4M266]
+ 9102 86C410 Savage 2000
+ 1092 5932 Viper II Z200
+ 1092 5934 Viper II Z200
+ 1092 5952 Viper II Z200
+ 1092 5954 Viper II Z200
+ 1092 5a35 Viper II Z200
+ 1092 5a37 Viper II Z200
+ 1092 5a55 Viper II Z200
+ 1092 5a57 Viper II Z200
+ ca00 SonicVibes
+544c Teralogic Inc
+5455 Technische University Berlin
+ 4458 S5933
+5519 Cnet Technologies, Inc.
+5544 Dunord Technologies
+ 0001 I-30xx Scanner Interface
+5555 Genroco, Inc
+ 0003 TURBOstor HFP-832 [HiPPI NIC]
+5654 VoiceTronix Pty Ltd
+5700 Netpower
+6356 UltraStor
+6374 c't Magazin für Computertechnik
+ 6773 GPPCI
+6409 Logitec Corp.
+6666 Decision Computer International Co.
+ 0001 PCCOM4
+ 0002 PCCOM8
+7604 O.N. Electronic Co Ltd.
+7bde MIDAC Corporation
+7fed PowerTV
+8008 Quancom Electronic GmbH
+ 0010 WDOG1 [PCI-Watchdog 1]
+ 0011 PWDOG2 [PCI-Watchdog 2]
+8086 Intel Corp.
+ 0007 82379AB
+ 0008 Extended Express System Support Controller
+ 0039 21145
+ 0122 82437FX
+ 0482 82375EB
+ 0483 82424ZX [Saturn]
+ 0484 82378IB [SIO ISA Bridge]
+ 0486 82430ZX [Aries]
+ 04a3 82434LX [Mercury/Neptune]
+ 04d0 82437FX [Triton FX]
+ 0600 RAID Controller
+ 0960 80960RP [i960 RP Microprocessor/Bridge]
+ 0962 80960RM [i960RM Bridge]
+ 0964 80960RP [i960 RP Microprocessor/Bridge]
+ 1000 82542 Gigabit Ethernet Controller
+ 0e11 b0df NC1632 Gigabit Ethernet Adapter (1000-SX)
+ 0e11 b0e0 NC1633 Gigabit Ethernet Adapter (1000-LX)
+ 0e11 b123 NC1634 Gigabit Ethernet Adapter (1000-SX)
+ 1014 0119 Netfinity Gigabit Ethernet SX Adapter
+ 8086 1000 PRO/1000 Gigabit Server Adapter
+ 1001 82543GC Gigabit Ethernet Controller (Fiber)
+ 0e11 004a NC6136 Gigabit Server Adapter
+ 1014 01ea Netfinity Gigabit Ethernet SX Adapter
+ 8086 1003 PRO/1000 F Server Adapter
+ 1002 Pro 100 LAN+Modem 56 Cardbus II
+ 8086 200e Pro 100 LAN+Modem 56 Cardbus II
+ 8086 2013 Pro 100 SR Mobile Combo Adapter
+ 8086 2017 Pro 100 S Combo Mobile Adapter
+ 1004 82543GC Gigabit Ethernet Controller (Copper)
+ 0e11 0049 NC7132 Gigabit Upgrade Module
+ 0e11 b1a4 NC7131 Gigabit Server Adapter
+ 1014 10f2 Gigabit Ethernet Server Adapter
+ 8086 1004 PRO/1000 T Server Adapter
+ 8086 2004 PRO/1000 T Server Adapter
+ 1008 82544EI Gigabit Ethernet Controller (Copper)
+ 8086 1107 PRO/1000 XT Server Adapter
+ 8086 2107 PRO/1000 XT Server Adapter
+ 8086 2110 PRO/1000 XT Server Adapter
+ 1009 82544EI Gigabit Ethernet Controller (Fiber)
+ 8086 1109 PRO/1000 XF Server Adapter
+ 8086 2109 PRO/1000 XF Server Adapter
+ 100c 82544GC Gigabit Ethernet Controller (Copper)
+ 8086 1112 PRO/1000 T Desktop Adapter
+ 8086 2112 PRO/1000 T Desktop Adapter
+ 100d 82544GC Gigabit Ethernet Controller (LOM)
+ 100e 82540EM Gigabit Ethernet Controller
+ 8086 001e PRO/1000 MT Desktop Adapter
+ 8086 002e PRO/1000 MT Desktop Adapter
+ 100f 82545EM Gigabit Ethernet Controller (Copper)
+ 8086 1001 PRO/1000 MT Server Adapter
+ 1010 82546EB Gigabit Ethernet Controller (Copper)
+ 8086 1011 PRO/1000 MT Dual Port Server Adapter
+ 1011 82545EM Gigabit Ethernet Controller (Fiber)
+ 8086 1002 PRO/1000 MF Server Adapter
+ 1012 82546EB Gigabit Ethernet Controller (Fiber)
+ 8086 1012 PRO/1000 MF Dual Port Server Adapter
+ 1015 82540EM Gigabit Ethernet Controller (LOM)
+ 1029 82559 Ethernet Controller
+ 1030 82559 InBusiness 10/100
+ 1031 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller
+ 1014 0209 ThinkPad A/T/X Series
+ 104d 80e7 Vaio PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 107b 5350 EtherExpress PRO/100 VE
+ 1179 0001 EtherExpress PRO/100 VE
+ 144d c000 EtherExpress PRO/100 VE
+ 144d c001 EtherExpress PRO/100 VE
+ 144d c003 EtherExpress PRO/100 VE
+ 144d c006 vpr Matrix 170B4
+ 1032 82801CAM (ICH3) PRO/100 VE Ethernet Controller
+ 1033 82801CAM (ICH3) PRO/100 VM (LOM) Ethernet Controller
+ 1034 82801CAM (ICH3) PRO/100 VM Ethernet Controller
+ 1035 82801CAM (ICH3)/82562EH (LOM) Ethernet Controller
+ 1036 82801CAM (ICH3) 82562EH Ethernet Controller
+ 1037 82801CAM (ICH3) Chipset Ethernet Controller
+ 1038 82801CAM (ICH3) PRO/100 VM (KM) Ethernet Controller
+ 1039 82801BD PRO/100 VE (LOM) Ethernet Controller
+ 103a 82801BD PRO/100 VE (CNR) Ethernet Controller
+ 103b 82801BD PRO/100 VM (LOM) Ethernet Controller
+ 103c 82801BD PRO/100 VM (CNR) Ethernet Controller
+ 103d 82801BD PRO/100 VE (MOB) Ethernet Controller
+ 103e 82801BD PRO/100 VM (MOB) Ethernet Controller
+ 1040 536EP Data Fax Modem
+ 16be 1040 V.9X DSP Data Fax Modem
+ 1059 82551QM Ethernet Controller
+ 1130 82815 815 Chipset Host Bridge and Memory Controller Hub
+ 1025 1016 Travelmate 612 TX
+ 1043 8027 TUSL2-C Mainboard
+ 104d 80df Vaio PCG-FX403
+ 1131 82815 815 Chipset AGP Bridge
+ 1132 82815 CGC [Chipset Graphics Controller]
+ 1025 1016 Travelmate 612 TX
+ 104d 80df Vaio PCG-FX403
+ 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller
+ 8086 1161 82806AA PCI64 Hub APIC
+ 1162 Xscale 80200 Big Endian Companion Chip
+ 1200 Intel IXP1200 Network Processor
+ 172a 0000 AEP SSL Accelerator
+ 1209 82559ER
+ 1221 82092AA_0
+ 1222 82092AA_1
+ 1223 SAA7116
+ 1225 82452KX/GX [Orion]
+ 1226 82596 PRO/10 PCI
+ 1227 82865 EtherExpress PRO/100A
+ 1228 82556 EtherExpress PRO/100 Smart
+# the revision field differentiates between them (1-3 is 82557, 4-5 is 82558, 6-8 is 82559, 9 is 82559ER)
+ 1229 82557/8/9 [Ethernet Pro 100]
+ 0e11 3001 82559 Fast Ethernet LOM with Alert on LAN*
+ 0e11 3002 82559 Fast Ethernet LOM with Alert on LAN*
+ 0e11 3003 82559 Fast Ethernet LOM with Alert on LAN*
+ 0e11 3004 82559 Fast Ethernet LOM with Alert on LAN*
+ 0e11 3005 82559 Fast Ethernet LOM with Alert on LAN*
+ 0e11 3006 82559 Fast Ethernet LOM with Alert on LAN*
+ 0e11 3007 82559 Fast Ethernet LOM with Alert on LAN*
+ 0e11 b01e NC3120 Fast Ethernet NIC
+ 0e11 b01f NC3122 Fast Ethernet NIC (dual port)
+ 0e11 b02f NC1120 Ethernet NIC
+ 0e11 b04a Netelligent 10/100TX NIC with Wake on LAN
+ 0e11 b0c6 NC3161 Fast Ethernet NIC (embedded, WOL)
+ 0e11 b0c7 NC3160 Fast Ethernet NIC (embedded)
+ 0e11 b0d7 NC3121 Fast Ethernet NIC (WOL)
+ 0e11 b0dd NC3131 Fast Ethernet NIC (dual port)
+ 0e11 b0de NC3132 Fast Ethernet Module (dual port)
+ 0e11 b0e1 NC3133 Fast Ethernet Module (100-FX)
+ 0e11 b134 NC3163 Fast Ethernet NIC (embedded, WOL)
+ 0e11 b13c NC3162 Fast Ethernet NIC (embedded)
+ 0e11 b144 NC3123 Fast Ethernet NIC (WOL)
+ 0e11 b163 NC3134 Fast Ethernet NIC (dual port)
+ 0e11 b164 NC3135 Fast Ethernet Upgrade Module (dual port)
+ 0e11 b1a4 NC7131 Gigabit Server Adapter
+ 1014 005c 82558B Ethernet Pro 10/100
+ 1014 01bc 82559 Fast Ethernet LAN On Motherboard
+ 1014 01f1 10/100 Ethernet Server Adapter
+ 1014 01f2 10/100 Ethernet Server Adapter
+ 1014 0207 Ethernet Pro/100 S
+ 1014 0232 10/100 Dual Port Server Adapter
+ 1014 023a ThinkPad R30
+ 1014 105c Netfinity 10/100
+ 1014 2205 ThinkPad A22p
+ 1014 305c 10/100 EtherJet Management Adapter
+ 1014 405c 10/100 EtherJet Adapter with Alert on LAN
+ 1014 505c 10/100 EtherJet Secure Management Adapter
+ 1014 605c 10/100 EtherJet Secure Management Adapter
+ 1014 705c 10/100 Netfinity 10/100 Ethernet Security Adapter
+ 1014 805c 10/100 Netfinity 10/100 Ethernet Security Adapter
+ 1028 009b PowerEdge 2550
+ 1033 8000 PC-9821X-B06
+ 1033 8016 PK-UG-X006
+ 1033 801f PK-UG-X006
+ 1033 8026 PK-UG-X006
+ 1033 8063 82559-based Fast Ethernet Adapter
+ 1033 8064 82559-based Fast Ethernet Adapter
+ 103c 10c0 NetServer 10/100TX
+ 103c 10c3 NetServer 10/100TX
+ 103c 10ca NetServer 10/100TX
+ 103c 10cb NetServer 10/100TX
+ 103c 10e3 NetServer 10/100TX
+ 103c 10e4 NetServer 10/100TX
+ 103c 1200 NetServer 10/100TX
+ 10c3 1100 SmartEther100 SC1100
+ 10cf 1115 8255x-based Ethernet Adapter (10/100)
+ 10cf 1143 8255x-based Ethernet Adapter (10/100)
+ 1179 0001 8255x-based Ethernet Adapter (10/100)
+ 1179 0002 PCI FastEther LAN on Docker
+ 1179 0003 8255x-based Fast Ethernet
+ 1259 2560 AT-2560 100
+ 1259 2561 AT-2560 100 FX Ethernet Adapter
+ 1266 0001 NE10/100 Adapter
+ 144d 2501 SEM-2000 MiniPCI LAN Adapter
+ 144d 2502 SEM-2100IL MiniPCI LAN Adapter
+ 1668 1100 EtherExpress PRO/100B (TX) (MiniPCI Ethernet+Modem)
+ 8086 0001 EtherExpress PRO/100B (TX)
+ 8086 0002 EtherExpress PRO/100B (T4)
+ 8086 0003 EtherExpress PRO/10+
+ 8086 0004 EtherExpress PRO/100 WfM
+ 8086 0005 82557 10/100
+ 8086 0006 82557 10/100 with Wake on LAN
+ 8086 0007 82558 10/100 Adapter
+ 8086 0008 82558 10/100 with Wake on LAN
+ 8086 0009 EtherExpress PRO/100+
+ 8086 000a EtherExpress PRO/100+ Management Adapter
+ 8086 000b EtherExpress PRO/100+
+ 8086 000c EtherExpress PRO/100+ Management Adapter
+ 8086 000d EtherExpress PRO/100+ Alert On LAN II* Adapter
+ 8086 000e EtherExpress PRO/100+ Management Adapter with Alert On LAN*
+ 8086 000f EtherExpress PRO/100 Desktop Adapter
+ 8086 0010 EtherExpress PRO/100 S Management Adapter
+ 8086 0011 EtherExpress PRO/100 S Management Adapter
+ 8086 0012 EtherExpress PRO/100 S Advanced Management Adapter (D)
+ 8086 0013 EtherExpress PRO/100 S Advanced Management Adapter (E)
+ 8086 0030 EtherExpress PRO/100 Management Adapter with Alert On LAN* GC
+ 8086 0031 EtherExpress PRO/100 Desktop Adapter
+ 8086 0040 EtherExpress PRO/100 S Desktop Adapter
+ 8086 0041 EtherExpress PRO/100 S Desktop Adapter
+ 8086 0042 EtherExpress PRO/100 Desktop Adapter
+ 8086 0050 EtherExpress PRO/100 S Desktop Adapter
+ 8086 1009 EtherExpress PRO/100+ Server Adapter
+ 8086 100c EtherExpress PRO/100+ Server Adapter (PILA8470B)
+ 8086 1012 EtherExpress PRO/100 S Server Adapter (D)
+ 8086 1013 EtherExpress PRO/100 S Server Adapter (E)
+ 8086 1015 EtherExpress PRO/100 S Dual Port Server Adapter
+ 8086 1017 EtherExpress PRO/100+ Dual Port Server Adapter
+ 8086 1030 EtherExpress PRO/100+ Management Adapter with Alert On LAN* G Server
+ 8086 1040 EtherExpress PRO/100 S Server Adapter
+ 8086 1041 EtherExpress PRO/100 S Server Adapter
+ 8086 1042 EtherExpress PRO/100 Server Adapter
+ 8086 1050 EtherExpress PRO/100 S Server Adapter
+ 8086 1051 EtherExpress PRO/100 Server Adapter
+ 8086 1052 EtherExpress PRO/100 Server Adapter
+ 8086 10f0 EtherExpress PRO/100+ Dual Port Adapter
+ 8086 2009 EtherExpress PRO/100 S Mobile Adapter
+ 8086 200d EtherExpress PRO/100 Cardbus
+ 8086 200e EtherExpress PRO/100 LAN+V90 Cardbus Modem
+ 8086 200f EtherExpress PRO/100 SR Mobile Adapter
+ 8086 2010 EtherExpress PRO/100 S Mobile Combo Adapter
+ 8086 2013 EtherExpress PRO/100 SR Mobile Combo Adapter
+ 8086 2016 EtherExpress PRO/100 S Mobile Adapter
+ 8086 2017 EtherExpress PRO/100 S Combo Mobile Adapter
+ 8086 2018 EtherExpress PRO/100 SR Mobile Adapter
+ 8086 2019 EtherExpress PRO/100 SR Combo Mobile Adapter
+ 8086 2101 EtherExpress PRO/100 P Mobile Adapter
+ 8086 2102 EtherExpress PRO/100 SP Mobile Adapter
+ 8086 2103 EtherExpress PRO/100 SP Mobile Adapter
+ 8086 2104 EtherExpress PRO/100 SP Mobile Adapter
+ 8086 2105 EtherExpress PRO/100 SP Mobile Adapter
+ 8086 2106 EtherExpress PRO/100 P Mobile Adapter
+ 8086 2107 EtherExpress PRO/100 Network Connection
+ 8086 2108 EtherExpress PRO/100 Network Connection
+ 8086 2200 EtherExpress PRO/100 P Mobile Combo Adapter
+ 8086 2201 EtherExpress PRO/100 P Mobile Combo Adapter
+ 8086 2202 EtherExpress PRO/100 SP Mobile Combo Adapter
+ 8086 2203 EtherExpress PRO/100+ MiniPCI
+ 8086 2204 EtherExpress PRO/100+ MiniPCI
+ 8086 2205 EtherExpress PRO/100 SP Mobile Combo Adapter
+ 8086 2206 EtherExpress PRO/100 SP Mobile Combo Adapter
+ 8086 2207 EtherExpress PRO/100 SP Mobile Combo Adapter
+ 8086 2208 EtherExpress PRO/100 P Mobile Combo Adapter
+ 8086 2402 EtherExpress PRO/100+ MiniPCI
+ 8086 2407 EtherExpress PRO/100+ MiniPCI
+ 8086 2408 EtherExpress PRO/100+ MiniPCI
+ 8086 2409 EtherExpress PRO/100+ MiniPCI
+ 8086 240f EtherExpress PRO/100+ MiniPCI
+ 8086 2410 EtherExpress PRO/100+ MiniPCI
+ 8086 2411 EtherExpress PRO/100+ MiniPCI
+ 8086 2412 EtherExpress PRO/100+ MiniPCI
+ 8086 2413 EtherExpress PRO/100+ MiniPCI
+ 8086 3000 82559 Fast Ethernet LAN on Motherboard
+ 8086 3001 82559 Fast Ethernet LOM with Basic Alert on LAN*
+ 8086 3002 82559 Fast Ethernet LOM with Alert on LAN II*
+ 8086 3006 EtherExpress PRO/100 S Network Connection
+ 8086 3007 EtherExpress PRO/100 S Network Connection
+ 8086 3008 EtherExpress PRO/100 Network Connection
+ 8086 3010 EtherExpress PRO/100 S Network Connection
+ 8086 3011 EtherExpress PRO/100 S Network Connection
+ 8086 3012 EtherExpress PRO/100 Network Connection
+ 122d 430FX - 82437FX TSC [Triton I]
+ 122e 82371FB PIIX ISA [Triton I]
+ 1230 82371FB PIIX IDE [Triton I]
+ 1231 DSVD Modem
+ 1234 430MX - 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)
+ 1235 430MX - 82437MX Mob. System Ctrlr (MTSC) & 82438MX Data Path (MTDP)
+ 1237 440FX - 82441FX PMC [Natoma]
+ 1239 82371FB
+ 123b 82380PB
+ 123c 82380AB
+ 123d 683053 Programmable Interrupt Device
+ 123f 82466GX Integrated Hot-Plug Controller (IHPC)
+ 1240 752 AGP
+ 124b 82380FB
+ 1250 430HX - 82439HX TXC [Triton II]
+ 1360 82806AA PCI64 Hub PCI Bridge
+ 1361 82806AA PCI64 Hub Controller (HRes)
+ 8086 1361 82806AA PCI64 Hub Controller (HRes)
+ 8086 8000 82806AA PCI64 Hub Controller (HRes)
+ 1460 82870P2 P64H2 Hub PCI Bridge
+ 1461 82870P2 P64H2 I/OxAPIC
+ 15d9 3480 P4DP6
+ 1462 82870P2 P64H2 Hot Plug Controller
+ 1960 80960RP [i960RP Microprocessor]
+ 101e 0431 MegaRAID 431 RAID Controller
+ 101e 0438 MegaRAID 438 Ultra2 LVD RAID Controller
+ 101e 0466 MegaRAID 466 Express Plus RAID Controller
+ 101e 0467 MegaRAID 467 Enterprise 1500 RAID Controller
+ 101e 0490 MegaRAID 490 Express 300 RAID Controller
+ 101e 0762 MegaRAID 762 Express RAID Controller
+ 101e 09a0 PowerEdge Expandable RAID Controller 2/SC
+ 1028 0467 PowerEdge Expandable RAID Controller 2/DC
+ 1028 1111 PowerEdge Expandable RAID Controller 2/SC
+ 103c 03a2 MegaRAID
+ 103c 10c6 MegaRAID 438, HP NetRAID-3Si
+ 103c 10c7 MegaRAID T5, Integrated HP NetRAID
+ 103c 10cc MegaRAID, Integrated HP NetRAID
+ 103c 10cd HP NetRAID-1Si
+ 105a 0000 SuperTrak
+ 105a 2168 SuperTrak Pro
+ 105a 5168 SuperTrak66/100
+ 1111 1111 MegaRAID 466, PowerEdge Expandable RAID Controller 2/SC
+ 1111 1112 PowerEdge Expandable RAID Controller 2/SC
+ 113c 03a2 MegaRAID
+ 1962 80960RM [i960RM Microprocessor]
+ 105a 0000 SuperTrak SX6000 I2O CPU
+ 1a21 82840 840 (Carmel) Chipset Host Bridge (Hub A)
+ 1a23 82840 840 (Carmel) Chipset AGP Bridge
+ 1a24 82840 840 (Carmel) Chipset PCI Bridge (Hub B)
+ 1a30 82845 845 (Brookdale) Chipset Host Bridge
+ 1a31 82845 845 (Brookdale) Chipset AGP Bridge
+ 2410 82801AA ISA Bridge (LPC)
+ 2411 82801AA IDE
+ 2412 82801AA USB
+ 2413 82801AA SMBus
+ 2415 82801AA AC'97 Audio
+ 1028 0095 Precision Workstation 220 Integrated Digital Audio
+ 11d4 0040 SoundMAX Integrated Digital Audio
+ 11d4 0048 SoundMAX Integrated Digital Audio
+ 11d4 5340 SoundMAX Integrated Digital Audio
+ 2416 82801AA AC'97 Modem
+ 2418 82801AA PCI Bridge
+ 2420 82801AB ISA Bridge (LPC)
+ 2421 82801AB IDE
+ 2422 82801AB USB
+ 2423 82801AB SMBus
+ 2425 82801AB AC'97 Audio
+ 11d4 0040 SoundMAX Integrated Digital Audio
+ 11d4 0048 SoundMAX Integrated Digital Audio
+ 2426 82801AB AC'97 Modem
+ 2428 82801AB PCI Bridge
+ 2440 82801BA ISA Bridge (LPC)
+ 2442 82801BA/BAM USB (Hub #1)
+ 1014 01c6 Netvista A40/A40p
+ 1025 1016 Travelmate 612 TX
+ 104d 80df Vaio PCG-FX403
+ 147b 0507 TH7II-RAID
+ 2443 82801BA/BAM SMBus
+ 1014 01c6 Netvista A40/A40p
+ 1025 1016 Travelmate 612 TX
+ 1043 8027 TUSL2-C Mainboard
+ 104d 80df Vaio PCG-FX403
+ 147b 0507 TH7II-RAID
+ 2444 82801BA/BAM USB (Hub #2)
+ 1025 1016 Travelmate 612 TX
+ 104d 80df Vaio PCG-FX403
+ 147b 0507 TH7II-RAID
+ 2445 82801BA/BAM AC'97 Audio
+ 1014 01c6 Netvista A40/A40p
+ 1025 1016 Travelmate 612 TX
+ 104d 80df Vaio PCG-FX403
+ 1462 3370 STAC9721 AC
+ 147b 0507 TH7II-RAID
+ 2446 Intel 537 [82801BA/BAM AC'97 Modem]
+ 1025 1016 Travelmate 612 TX
+ 104d 80df Vaio PCG-FX403
+ 2448 82801BAM/CAM PCI Bridge
+ 2449 82801BA/BAM/CA/CAM Ethernet Controller
+ 0e11 0012 EtherExpress PRO/100 VM
+ 0e11 0091 EtherExpress PRO/100 VE
+ 1014 01ce EtherExpress PRO/100 VE
+ 1014 01dc EtherExpress PRO/100 VE
+ 1014 01eb EtherExpress PRO/100 VE
+ 1014 01ec EtherExpress PRO/100 VE
+ 1014 0202 EtherExpress PRO/100 VE
+ 1014 0205 EtherExpress PRO/100 VE
+ 1014 0217 EtherExpress PRO/100 VE
+ 1014 0234 EtherExpress PRO/100 VE
+ 1014 023d EtherExpress PRO/100 VE
+ 1014 0244 EtherExpress PRO/100 VE
+ 1014 0245 EtherExpress PRO/100 VE
+ 109f 315d EtherExpress PRO/100 VE
+ 109f 3181 EtherExpress PRO/100 VE
+ 1186 7801 EtherExpress PRO/100 VE
+ 144d 2602 HomePNA 1M CNR
+ 8086 3010 EtherExpress PRO/100 VE
+ 8086 3011 EtherExpress PRO/100 VM
+ 8086 3012 82562EH based Phoneline
+ 8086 3013 EtherExpress PRO/100 VE
+ 8086 3014 EtherExpress PRO/100 VM
+ 8086 3015 82562EH based Phoneline
+ 8086 3016 EtherExpress PRO/100 P Mobile Combo
+ 8086 3017 EtherExpress PRO/100 P Mobile
+ 8086 3018 EtherExpress PRO/100
+ 244a 82801BAM IDE U100
+ 1025 1016 Travelmate 612TX
+ 104d 80df Vaio PCG-FX403
+ 244b 82801BA IDE U100
+ 1014 01c6 Netvista A40/A40p
+ 1043 8027 TUSL2-C Mainboard
+ 147b 0507 TH7II-RAID
+ 244c 82801BAM ISA Bridge (LPC)
+ 244e 82801BA/CA/DB PCI Bridge
+ 2450 82801E ISA Bridge (LPC)
+ 2452 82801E USB
+ 2453 82801E SMBus
+ 2459 82801E Ethernet Controller 0
+ 245b 82801E IDE U100
+ 245d 82801E Ethernet Controller 1
+ 245e 82801E PCI Bridge
+ 2480 82801CA ISA Bridge (LPC)
+ 2482 82801CA/CAM USB (Hub #1)
+ 1014 0220 ThinkPad A/T/X Series
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 15d9 3480 P4DP6
+ 8086 1958 vpr Matrix 170B4
+ 2483 82801CA/CAM SMBus
+ 1014 0220 ThinkPad A/T/X Series
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 15d9 3480 P4DP6
+ 8086 1958 vpr Matrix 170B4
+ 2484 82801CA/CAM USB (Hub #2)
+ 1014 0220 ThinkPad A/T/X Series
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 15d9 3480 P4DP6
+ 8086 1958 vpr Matrix 170B4
+ 2485 82801CA/CAM AC'97 Audio
+ 1014 0222 ThinkPad T23 (2647-4MG) or A30p (2653-64G)
+ 1014 0508 ThinkPad T30
+ 1014 051c ThinkPad A/T/X Series
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 144d c006 vpr Matrix 170B4
+ 2486 82801CA/CAM AC'97 Modem
+ 1014 0223 ThinkPad A/T/X Series
+ 1014 0503 ThinkPad R31 2656BBG
+ 1014 051a ThinkPad A/T/X Series
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 1179 0001 Toshiba Satellite 1110 Z15 internal Modem
+ 134d 4c21 Dell Inspiron 2100 internal modem
+ 144d 2115 vpr Matrix 170B4 internal modem
+ 14f1 5421 MD56ORD V.92 MDC Modem
+ 2487 82801CA/CAM USB (Hub #3)
+ 1014 0220 ThinkPad A/T/X Series
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 15d9 3480 P4DP6
+ 8086 1958 vpr Matrix 170B4
+ 248a 82801CAM IDE U100
+ 1014 0220 ThinkPad A/T/X Series
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 8086 1958 vpr Matrix 170B4
+ 248b 82801CA IDE U100
+ 15d9 3480 P4DP6
+ 248c 82801CAM ISA Bridge (LPC)
+ 24c0 82801DB ISA Bridge (LPC)
+ 1462 5800 845PE Max (MS-6580)
+ 24c2 82801DB USB (Hub #1)
+ 1462 5800 845PE Max (MS-6580)
+ 24c3 82801DB SMBus
+ 1462 5800 845PE Max (MS-6580)
+ 24c4 82801DB USB (Hub #2)
+ 1462 5800 845PE Max (MS-6580)
+ 24c5 82801DB AC'97 Audio
+ 1462 5800 845PE Max (MS-6580)
+ 24c6 82801DB AC'97 Modem
+ 24c7 82801DB USB (Hub #3)
+ 1462 5800 845PE Max (MS-6580)
+ 24cb 82801DB ICH4 IDE
+ 1462 5800 845PE Max (MS-6580)
+ 24cd 82801DB USB EHCI Controller
+ 1462 3981 845PE Max (MS-6580) Onboard USB EHCI Controller
+ 2500 82820 820 (Camino) Chipset Host Bridge (MCH)
+ 1028 0095 Precision Workstation 220 Chipset
+ 1043 801c P3C-2000 system chipset
+ 2501 82820 820 (Camino) Chipset Host Bridge (MCH)
+ 1043 801c P3C-2000 system chipset
+ 250b 82820 820 (Camino) Chipset Host Bridge
+ 250f 82820 820 (Camino) Chipset AGP Bridge
+ 2520 82805AA MTH Memory Translator Hub
+ 2521 82804AA MRH-S Memory Repeater Hub for SDRAM
+ 2530 82850 850 (Tehama) Chipset Host Bridge (MCH)
+ 147b 0507 TH7II-RAID
+ 2531 82860 860 (Wombat) Chipset Host Bridge (MCH)
+ 2532 82850 850 (Tehama) Chipset AGP Bridge
+ 2533 82860 860 (Wombat) Chipset AGP Bridge
+ 2534 82860 860 (Wombat) Chipset PCI Bridge
+ 2540 e7500 [Plumas] DRAM Controller
+ 15d9 3480 P4DP6
+ 2541 e7500 [Plumas] DRAM Controller Error Reporting
+ 15d9 3480 P4DP6
+ 2543 e7500 [Plumas] HI_B Virtual PCI Bridge (F0)
+ 2544 e7500 [Plumas] HI_B Virtual PCI Bridge (F1)
+ 2545 e7500 [Plumas] HI_C Virtual PCI Bridge (F0)
+ 2546 e7500 [Plumas] HI_C Virtual PCI Bridge (F1)
+ 2547 e7500 [Plumas] HI_D Virtual PCI Bridge (F0)
+ 2548 e7500 [Plumas] HI_D Virtual PCI Bridge (F1)
+ 2560 82845G/GL [Brookdale-G] Chipset Host Bridge
+ 1462 5800 845PE Max (MS-6580)
+ 2561 82845G/GL [Brookdale-G] Chipset AGP Bridge
+ 2562 82845G/GL [Brookdale-G] Chipset Integrated Graphics Device
+ 3092 Integrated RAID
+ 3575 82830 830 Chipset Host Bridge
+ 1014 021d ThinkPad A/T/X Series
+ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP
+ 3576 82830 830 Chipset AGP Bridge
+ 3577 82830 CGC [Chipset Graphics Controller]
+ 1014 0513 ThinkPad A/T/X Series
+ 3578 82830 830 Chipset Host Bridge
+ 5200 EtherExpress PRO/100 Intelligent Server
+ 5201 EtherExpress PRO/100 Intelligent Server
+ 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter
+ 530d 80310 IOP [IO Processor]
+ 7000 82371SB PIIX3 ISA [Natoma/Triton II]
+ 7010 82371SB PIIX3 IDE [Natoma/Triton II]
+ 7020 82371SB PIIX3 USB [Natoma/Triton II]
+ 7030 430VX - 82437VX TVX [Triton VX]
+ 7100 430TX - 82439TX MTXC
+ 7110 82371AB/EB/MB PIIX4 ISA
+ 7111 82371AB/EB/MB PIIX4 IDE
+ 7112 82371AB/EB/MB PIIX4 USB
+ 7113 82371AB/EB/MB PIIX4 ACPI
+ 7120 82810 GMCH [Graphics Memory Controller Hub]
+ 7121 82810 CGC [Chipset Graphics Controller]
+ 7122 82810 DC-100 GMCH [Graphics Memory Controller Hub]
+ 7123 82810 DC-100 CGC [Chipset Graphics Controller]
+ 7124 82810E DC-133 GMCH [Graphics Memory Controller Hub]
+ 7125 82810E DC-133 CGC [Chipset Graphics Controller]
+ 7126 82810 DC-133 System and Graphics Controller
+ 7128 82810-M DC-100 System and Graphics Controller
+ 712a 82810-M DC-133 System and Graphics Controller
+ 7180 440LX/EX - 82443LX/EX Host bridge
+ 7181 440LX/EX - 82443LX/EX AGP bridge
+ 7190 440BX/ZX/DX - 82443BX/ZX/DX Host bridge
+ 0e11 0500 Armada 1750 Laptop System Chipset
+ 0e11 b110 Armada M700
+ 1179 0001 Toshiba Tecra 8100 Laptop System Chipset
+ 7191 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge
+ 7192 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled)
+ 0e11 0460 Armada 1700 Laptop System Chipset
+ 7194 82440MX Host Bridge
+ 7195 82440MX AC'97 Audio Controller
+ 10cf 1099 QSound_SigmaTel Stac97 PCI Audio
+ 11d4 0040 SoundMAX Integrated Digital Audio
+ 11d4 0048 SoundMAX Integrated Digital Audio
+ 7196 82440MX AC'97 Modem Controller
+ 7198 82440MX ISA Bridge
+ 7199 82440MX EIDE Controller
+ 719a 82440MX USB Universal Host Controller
+ 719b 82440MX Power Management Controller
+ 71a0 440GX - 82443GX Host bridge
+ 71a1 440GX - 82443GX AGP bridge
+ 71a2 440GX - 82443GX Host bridge (AGP disabled)
+ 7600 82372FB PIIX5 ISA
+ 7601 82372FB PIIX5 IDE
+ 7602 82372FB PIIX5 USB
+ 7603 82372FB PIIX5 SMBus
+ 7800 i740
+ 003d 0008 Starfighter AGP
+ 003d 000b Starfighter AGP
+ 1092 0100 Stealth II G460
+ 10b4 201a Lightspeed 740
+ 10b4 202f Lightspeed 740
+ 8086 0000 Terminator 2x/i
+ 8086 0100 Intel740 Graphics Accelerator
+ 84c4 450KX/GX [Orion] - 82454KX/GX PCI bridge
+ 84c5 450KX/GX [Orion] - 82453KX/GX Memory controller
+ 84ca 450NX - 82451NX Memory & I/O Controller
+ 84cb 450NX - 82454NX/84460GX PCI Expander Bridge
+ 84e0 460GX - 84460GX System Address Controller (SAC)
+ 84e1 460GX - 84460GX System Data Controller (SDC)
+ 84e2 460GX - 84460GX AGP Bridge (GXB function 2)
+ 84e3 460GX - 84460GX Memory Address Controller (MAC)
+ 84e4 460GX - 84460GX Memory Data Controller (MDC)
+ 84e6 460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB)
+ 84ea 460GX - 84460GX AGP Bridge (GXB function 1)
+ 9621 Integrated RAID
+ 9622 Integrated RAID
+ 9641 Integrated RAID
+ 96a1 Integrated RAID
+ b152 21152 PCI-to-PCI Bridge
+# observed, and documented in Intel revision note; new mask of 1011:0026
+ b154 21154 PCI-to-PCI Bridge
+ b555 21555 Non transparent PCI-to-PCI Bridge
+ e4bf 1000 CC8-1-BLUES
+ ffff 450NX/GX [Orion] - 82453KX/GX Memory controller [BUG]
+8800 Trigem Computer Inc.
+ 2008 Video assistent component
+8866 T-Square Design Inc.
+8888 Silicon Magic
+8e0e Computone Corporation
+8e2e KTI
+ 3000 ET32P2
+9004 Adaptec
+ 1078 AIC-7810
+ 1160 AIC-1160 [Family Fibre Channel Adapter]
+ 2178 AIC-7821
+ 3860 AHA-2930CU
+ 3b78 AHA-4844W/4844UW
+ 5075 AIC-755x
+ 5078 AHA-7850
+ 9004 7850 AHA-2904/Integrated AIC-7850
+ 5175 AIC-755x
+ 5178 AIC-7851
+ 5275 AIC-755x
+ 5278 AIC-7852
+ 5375 AIC-755x
+ 5378 AIC-7850
+ 5475 AIC-755x
+ 5478 AIC-7850
+ 5575 AVA-2930
+ 5578 AIC-7855
+ 5647 ANA-7711 TCP Offload Engine
+ 9004 7710 ANA-7711F TCP Offload Engine - Optical
+ 9004 7711 ANA-7711LP TCP Offload Engine - Copper
+ 5675 AIC-755x
+ 5678 AIC-7856
+ 5775 AIC-755x
+ 5778 AIC-7850
+ 5800 AIC-5800
+ 5900 ANA-5910/5930/5940 ATM155 & 25 LAN Adapter
+ 5905 ANA-5910A/5930A/5940A ATM Adapter
+ 6038 AIC-3860
+ 6075 AIC-1480 / APA-1480
+ 9004 7560 AIC-1480 / APA-1480 Cardbus
+ 6078 AIC-7860
+ 6178 AIC-7861
+ 9004 7861 AHA-2940AU Single
+ 6278 AIC-7860
+ 6378 AIC-7860
+ 6478 AIC-786x
+ 6578 AIC-786x
+ 6678 AIC-786x
+ 6778 AIC-786x
+ 6915 ANA620xx/ANA69011A
+ 9004 0008 ANA69011A/TX 10/100
+ 9004 0009 ANA69011A/TX 10/100
+ 9004 0010 ANA62022 2-port 10/100
+ 9004 0018 ANA62044 4-port 10/100
+ 9004 0019 ANA62044 4-port 10/100
+ 9004 0020 ANA62022 2-port 10/100
+ 9004 0028 ANA69011A/TX 10/100
+ 9004 8008 ANA69011A/TX 64 bit 10/100
+ 9004 8009 ANA69011A/TX 64 bit 10/100
+ 9004 8010 ANA62022 2-port 64 bit 10/100
+ 9004 8018 ANA62044 4-port 64 bit 10/100
+ 9004 8019 ANA62044 4-port 64 bit 10/100
+ 9004 8020 ANA62022 2-port 64 bit 10/100
+ 9004 8028 ANA69011A/TX 64 bit 10/100
+ 7078 AHA-294x / AIC-7870
+ 7178 AHA-2940/2940W / AIC-7871
+ 7278 AHA-3940/3940W / AIC-7872
+ 7378 AHA-3985 / AIC-7873
+ 7478 AHA-2944/2944W / AIC-7874
+ 7578 AHA-3944/3944W / AIC-7875
+ 7678 AHA-4944W/UW / AIC-7876
+ 7778 AIC-787x
+ 7810 AIC-7810
+ 7815 AIC-7815 RAID+Memory Controller IC
+ 9004 7815 ARO-1130U2 RAID Controller
+ 9004 7840 AIC-7815 RAID+Memory Controller IC
+ 7850 AIC-7850
+ 7855 AHA-2930
+ 7860 AIC-7860
+ 7870 AIC-7870
+ 7871 AHA-2940
+ 7872 AHA-3940
+ 7873 AHA-3980
+ 7874 AHA-2944
+ 7880 AIC-7880P
+ 7890 AIC-7890
+ 7891 AIC-789x
+ 7892 AIC-789x
+ 7893 AIC-789x
+ 7894 AIC-789x
+ 7895 AHA-2940U/UW / AHA-39xx / AIC-7895
+ 9004 7890 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B
+ 9004 7891 AHA-2940U/2940UW Dual
+ 9004 7892 AHA-3940AU/AUW/AUWD/UWD
+ 9004 7894 AHA-3944AUWD
+ 9004 7895 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B
+ 9004 7896 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B
+ 9004 7897 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B
+ 7896 AIC-789x
+ 7897 AIC-789x
+ 8078 AIC-7880U
+ 9004 7880 AIC-7880P Ultra/Ultra Wide SCSI Chipset
+ 8178 AHA-2940U/UW/D / AIC-7881U
+ 9004 7881 AHA-2940UW SCSI Host Adapter
+ 8278 AHA-3940U/UW/UWD / AIC-7882U
+ 8378 AHA-3940U/UW / AIC-7883U
+ 8478 AHA-2944UW / AIC-7884U
+ 8578 AHA-3944U/UWD / AIC-7885
+ 8678 AHA-4944UW / AIC-7886
+ 8778 AHA-2940UW Pro / AIC-788x
+ 9004 7887 2940UW Pro Ultra-Wide SCSI Controller
+ 8878 AHA-2930UW / AIC-7888
+ 9004 7888 AHA-2930UW SCSI Controller
+ 8b78 ABA-1030
+ ec78 AHA-4944W/UW
+9005 Adaptec
+ 0010 AHA-2940U2/U2W
+ 9005 2180 AHA-2940U2 SCSI Controller
+ 9005 8100 AHA-2940U2B SCSI Controller
+ 9005 a180 AHA-2940U2W SCSI Controller
+ 9005 e100 AHA-2950U2B SCSI Controller
+ 0011 AHA-2930U2
+ 0013 78902
+ 9005 0003 AAA-131U2 Array1000 1 Channel RAID Controller
+ 001f AHA-2940U2/U2W / 7890/7891
+ 9005 000f 2940U2W SCSI Controller
+ 9005 a180 2940U2W SCSI Controller
+ 0020 AIC-7890
+ 002f AIC-7890
+ 0030 AIC-7890
+ 003f AIC-7890
+ 0050 AHA-3940U2x/395U2x
+ 9005 f500 AHA-3950U2B
+ 0051 AHA-3950U2D
+ 9005 b500 AHA-3950U2D
+ 0053 AIC-7896 SCSI Controller
+ 9005 ffff AIC-7896 SCSI Controller mainboard implementation
+ 005f AIC-7896U2/7897U2
+ 0080 AIC-7892A U160/m
+ 0e11 e2a0 Compaq 64-Bit/66MHz Wide Ultra3 SCSI Adapter
+ 9005 62a0 29160N Ultra160 SCSI Controller
+ 9005 e220 29160LP Low Profile Ultra160 SCSI Controller
+ 9005 e2a0 29160 Ultra160 SCSI Controller
+ 0081 AIC-7892B U160/m
+ 9005 62a1 19160 Ultra160 SCSI Controller
+ 0083 AIC-7892D U160/m
+ 008f AIC-7892P U160/m
+ 1179 0001 Magnia Z310
+ 15d9 9005 Onboard SCSI Host Adapter
+ 00c0 AHA-3960D / AIC-7899A U160/m
+ 0e11 f620 Compaq 64-Bit/66MHz Dual Channel Wide Ultra3 SCSI Adapter
+ 9005 f620 AHA-3960D U160/m
+ 00c1 AIC-7899B U160/m
+ 00c3 AIC-7899D U160/m
+ 00c5 RAID subsystem HBA
+ 1028 00c5 PowerEdge 2550
+ 00cf AIC-7899P U160/m
+ 1028 00d1 PowerEdge 2550
+ 10f1 2462 Thunder K7 S2462
+ 15d9 9005 Onboard SCSI Host Adapter
+ 0250 ServeRAID Controller
+ 1014 0279 ServeRAID-xx
+ 1014 028c ServeRAID-xx
+ 0285 AAC-RAID
+ 1028 0287 PowerEdge Expandable RAID Controller 320/DC
+ 8000 ASC-29320A U320
+ 800f AIC-7901 U320
+ 8010 ASC-39320 U320
+ 8011 ASC-32320D U320
+ 0e11 00ac U320
+ 9005 0041 ASC-39320D U320
+ 8012 ASC-29320 U320
+ 8013 ASC-29320B U320
+ 8014 ASC-29320LP U320
+ 801e AIC-7901A U320
+ 801f AIC-7902 U320
+ 8090 ASC-39320 U320 w/HostRAID
+ 8091 ASC-39320D U320 w/HostRAID
+ 8092 ASC-29320 U320 w/HostRAID
+ 8093 ASC-29320B U320 w/HostRAID
+ 8094 ASC-29320LP U320 w/HostRAID
+ 809e AIC-7901A U320 w/HostRAID
+ 809f AIC-7902 U320 w/HostRAID
+907f Atronics
+ 2015 IDE-2015PL
+919a Gigapixel Corp
+9412 Holtek
+ 6565 6565
+9699 Omni Media Technology Inc
+ 6565 6565
+9710 NetMos Technology
+ 9815 VScom 021H-EP2 2 port parallel adaptor
+ 9835 222N-2 I/O Card (2S+1P)
+a0a0 AOPEN Inc.
+a0f1 UNISYS Corporation
+a200 NEC Corporation
+a259 Hewlett Packard
+a25b Hewlett Packard GmbH PL24-MKT
+a304 Sony
+a727 3Com Corporation
+aa42 Scitex Digital Video
+ac1e Digital Receiver Technology Inc
+b1b3 Shiva Europe Limited
+# Pinnacle should be 11bd, but they got it wrong several times --mj
+bd11 Pinnacle Systems, Inc. (Wrong ID)
+c001 TSI Telsys
+c0a9 Micron/Crucial Technology
+c0de Motorola
+c0fe Motion Engineering, Inc.
+ca50 Varian Australia Pty Ltd
+cafe Chrysalis-ITS
+cccc Catapult Communications
+cddd Tyzx, Inc.
+ 0101 DeepSea 1 High Speed Stereo Vision Frame Grabber
+ 0200 DeepSea 2 High Speed Stereo Vision Frame Grabber
+d4d4 Dy4 Systems Inc
+ 0601 PCI Mezzanine Card
+d531 I+ME ACTIA GmbH
+d84d Exsys
+dead Indigita Corporation
+e000 Winbond
+ e000 W89C940
+e159 Tiger Jet Network Inc.
+ 0001 Intel 537
+ 0059 0001 128k ISDN-S/T Adapter
+ 0059 0003 128k ISDN-U Adapter
+ 0002 Tiger100APC ISDN chipset
+e4bf EKF Elektronik GmbH
+ea01 Eagle Technology
+# The main chip of all these devices is by Xilinx -> It could also be a Xilinx ID.
+ea60 RME
+ 9896 Digi32
+ 9897 Digi32 Pro
+ 9898 Digi32/8
+eabb Aashima Technology B.V.
+eace Endace Measurement Systems, Ltd
+ 3100 DAG 3.10 OC-3/OC-12
+ 3200 DAG 3.2x OC-3/OC-12
+ 320e DAG 3.2E Fast Ethernet
+ 340e DAG 3.4E Fast Ethernet
+ 341e DAG 3.41E Fast Ethernet
+ 3500 DAG 3.5 OC-3/OC-12
+ 351c DAG 3.5ECM Fast Ethernet
+ 4100 DAG 4.10 OC-48
+ 4110 DAG 4.11 OC-48
+ 4220 DAG 4.2 OC-48
+ 422e DAG 4.2E Dual Gigabit Ethernet
+ec80 Belkin Corporation
+ ec00 F5D6000
+ecc0 Echo Digital Audio Corporation
+ 0050 Gina24_301
+ 0051 Gina24_361
+ 0060 Layla24
+ 0070 Mona_301_80
+ 0071 Mona_301_66
+ 0072 Mona_361
+ 0080 Mia
+edd8 ARK Logic Inc
+ a091 1000PV [Stingray]
+ a099 2000PV [Stingray]
+ a0a1 2000MT
+ a0a9 2000MI
+f1d0 AJA Video
+# All boards I have seen have this ID not efac, though all docs say efac...
+ cafe KONA SD SMPTE 259M I/O
+ efac KONA SD SMPTE 259M I/O
+ facd KONA HD SMPTE 292M I/O
+fa57 Fast Search & Transfer ASA
+febd Ultraview Corp.
+feda Broadcom Inc (nee Epigram)
+ a0fa BCM4210 iLine10 HomePNA 2.0
+ a10e BCM4230 iLine10 HomePNA 2.0
+fffe VMWare Inc
+ 0710 Virtual SVGA
+ffff Illegal Vendor ID
+
+
+# List of known device classes, subclasses and programming interfaces
+
+# Syntax:
+# C class class_name
+# subclass subclass_name <-- single tab
+# prog-if prog-if_name <-- two tabs
+
+C 00 Unclassified device
+ 00 Non-VGA unclassified device
+ 01 VGA compatible unclassified device
+C 01 Mass storage controller
+ 00 SCSI storage controller
+ 01 IDE interface
+ 02 Floppy disk controller
+ 03 IPI bus controller
+ 04 RAID bus controller
+ 80 Unknown mass storage controller
+C 02 Network controller
+ 00 Ethernet controller
+ 01 Token ring network controller
+ 02 FDDI network controller
+ 03 ATM network controller
+ 04 ISDN controller
+ 80 Network controller
+C 03 Display controller
+ 00 VGA compatible controller
+ 00 VGA
+ 01 8514
+ 01 XGA compatible controller
+ 02 3D controller
+ 80 Display controller
+C 04 Multimedia controller
+ 00 Multimedia video controller
+ 01 Multimedia audio controller
+ 02 Computer telephony device
+ 80 Multimedia controller
+C 05 Memory controller
+ 00 RAM memory
+ 01 FLASH memory
+ 80 Memory controller
+C 06 Bridge
+ 00 Host bridge
+ 01 ISA bridge
+ 02 EISA bridge
+ 03 MicroChannel bridge
+ 04 PCI bridge
+ 00 Normal decode
+ 01 Subtractive decode
+ 05 PCMCIA bridge
+ 06 NuBus bridge
+ 07 CardBus bridge
+ 08 RACEway bridge
+ 00 Transparent mode
+ 01 Endpoint mode
+ 09 Semi-transparent PCI-to-PCI bridge
+ 40 Primary bus towards host CPU
+ 80 Secondary bus towards host CPU
+ 0a InfiniBand to PCI host bridge
+ 80 Bridge
+C 07 Communication controller
+ 00 Serial controller
+ 00 8250
+ 01 16450
+ 02 16550
+ 03 16650
+ 04 16750
+ 05 16850
+ 06 16950
+ 01 Parallel controller
+ 00 SPP
+ 01 BiDir
+ 02 ECP
+ 03 IEEE1284
+ fe IEEE1284 Target
+ 02 Multiport serial controller
+ 03 Modem
+ 00 Generic
+ 01 Hayes/16450
+ 02 Hayes/16550
+ 03 Hayes/16650
+ 04 Hayes/16750
+ 80 Communication controller
+C 08 Generic system peripheral
+ 00 PIC
+ 00 8259
+ 01 ISA PIC
+ 02 EISA PIC
+ 10 IO-APIC
+ 20 IO(X)-APIC
+ 01 DMA controller
+ 00 8237
+ 01 ISA DMA
+ 02 EISA DMA
+ 02 Timer
+ 00 8254
+ 01 ISA Timer
+ 02 EISA Timers
+ 03 RTC
+ 00 Generic
+ 01 ISA RTC
+ 04 PCI Hot-plug controller
+ 80 System peripheral
+C 09 Input device controller
+ 00 Keyboard controller
+ 01 Digitizer Pen
+ 02 Mouse controller
+ 03 Scanner controller
+ 04 Gameport controller
+ 00 Generic
+ 10 Extended
+ 80 Input device controller
+C 0a Docking station
+ 00 Generic Docking Station
+ 80 Docking Station
+C 0b Processor
+ 00 386
+ 01 486
+ 02 Pentium
+ 10 Alpha
+ 20 Power PC
+ 30 MIPS
+ 40 Co-processor
+C 0c Serial bus controller
+ 00 FireWire (IEEE 1394)
+ 00 Generic
+ 10 OHCI
+ 01 ACCESS Bus
+ 02 SSA
+ 03 USB Controller
+ 00 UHCI
+ 10 OHCI
+ 20 EHCI
+ 80 Unspecified
+ fe USB Device
+ 04 Fibre Channel
+ 05 SMBus
+ 06 InfiniBand
+C 0d Wireless controller
+ 00 IRDA controller
+ 01 Consumer IR controller
+ 10 RF controller
+ 80 Wireless controller
+C 0e Intelligent controller
+ 00 I2O
+C 0f Satellite communications controller
+ 00 Satellite TV controller
+ 01 Satellite audio communication controller
+ 03 Satellite voice communication controller
+ 04 Satellite data communication controller
+C 10 Encryption controller
+ 00 Network and computing encryption device
+ 10 Entertainment encryption device
+ 80 Encryption controller
+C 11 Signal processing controller
+ 00 DPIO module
+ 01 Performance counters
+ 10 Communication synchronizer
+ 80 Signal processing controller
diff --git a/hw/xfree86/scanpci/pciid2c.pl b/hw/xfree86/scanpci/pciid2c.pl
new file mode 100644
index 000000000..a43bc5be6
--- /dev/null
+++ b/hw/xfree86/scanpci/pciid2c.pl
@@ -0,0 +1,362 @@
+#!/usr/bin/perl
+
+# Automatically generate the data structures for PCI vendor/device lists
+# from the pci.ids file.
+#
+# It should be run as:
+#
+# perl pciid2c.pl ../common/xf86PciInfo.h < pci.ids > xf86PciIds.h
+#
+#
+# Copyright © 2002 by The XFree86 Project, Inc.
+#
+# Author: David Dawes
+#
+# $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/pciid2c.pl,v 1.2 2002/12/23 16:45:19 tsi Exp $
+#
+
+if (@ARGV[0]) {
+ $infofile = @ARGV[0];
+}
+
+#
+# The basic pci.ids format is:
+# - Vendor lines start with four (lower case) hex digits
+# - Device lines start with one tab followed by four hex digits
+# - Subsystem lines start with two tabs followed by two sets of four
+# hex digits.
+# - Class overrides for devices start with two tabs followed by a "C",
+# followed by four hex digits with the class/subclass value.
+# - Class lines start with a "C".
+# - Comment lines start with a '#'.
+# - Blank lines are ignored.
+#
+# We allow for extra lines to be appended to modify existing entries or
+# add new ones. To add/modify Device entries without modifying the
+# Vendor name, a special vendor name of '"' is used (mnemonic: "ditto").
+# Similarly for adding subsystem names without modifying (or adding)
+# a corresponding device entry. To rename an existing entry, simply
+# provide the new name. To remove an existing entry, use the special
+# name '-'.
+#
+
+while (<STDIN>) {
+ # Process data lines
+ if (/^([0-9a-f]{4})\s+(.*)/) {
+ $vendor = $1;
+ if ($2 eq '-') {
+ delete($vendors{$vendor});
+ } elsif ($2 ne '"') {
+ $vendors{$vendor} = $2;
+ # Remove " characters
+ $vendors{$vendor} =~ s/"//g;
+ # Remove multiple "?" sequences to avoid trigraphs
+ $vendors{$vendor} =~ s/\?+/\?/g;
+ }
+ } elsif (/^\t([0-9a-f]{4})\s+(.*)/) {
+ $device = $1;
+ if ($2 eq '-') {
+ delete($devices{$vendor}{$device});
+ } elsif ($2 ne '"') {
+ $devices{$vendor}{$device} = $2;
+ # Remove " characters
+ $devices{$vendor}{$device} =~ s/"//g;
+ # Remove multiple "?" sequences to avoid trigraphs
+ $devices{$vendor}{$device} =~ s/\?+/\?/g;
+ }
+ } elsif (/^\t\t([0-9a-f]{4})\s+([0-9a-f]{4})\s+(.*)/) {
+ $v = $1;
+ $s = $2;
+ if ($3 eq '-') {
+ delete($subsystems{$v}{$s});
+ delete($devsubsystems{$vendor}{$device}{"$v-$s"});
+ } elsif ($3 ne '"') {
+ if ($subsystems{$v}{$s}) {
+ #print STDERR "Duplicate subsytem: $v, $s, \"$subsystems{$v}{$s}\", \"$3\"\n";
+ }
+ $subsystems{$v}{$s} = $3;
+ # Remove " characters
+ $subsystems{$v}{$s} =~ s/"//g;
+ # Remove multiple "?" sequences to avoid trigraphs
+ $subsystems{$v}{$s} =~ s/\?+/\?/g;
+ $devsubsystems{$vendor}{$device}{"$v-$s"} = $subsystems{$v}{$s};
+ }
+ } elsif (/^\t\tC\s+([0-9a-f]{4})/) {
+ $classes{$vendor}{$device} = $1;
+ }
+ # Ignore all other lines.
+}
+
+# Find which vendors are "video" vendors.
+if ($infofile) {
+ open(INFO, "<$infofile") || die "Can't open $infofile";
+ while (<INFO>) {
+ if (/^#define\s+PCI_VENDOR_.*0x([0-9a-fA-F]{4})/) {
+ $vendor = $1;
+ $vendor =~ tr/A-F/a-f/;
+ $video{$vendor} = 1;
+ }
+ }
+}
+
+#
+# This layout is quite different from that used in the old xf86PciInfo.h
+# file. One main difference is that the list is initialised at runtime.
+# It's currently a flat list. This could be improved.
+#
+
+# Print out header information.
+
+$proj = "XFree86";
+print "/* \$$proj\$ */
+
+/*
+ * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
+ *
+ * It is generated by pciid2c.pl using data from the following files:
+ *
+ * ../etc/pci.ids
+ * ../etc/extrapci.ids
+ * ../common/xf86PciInfo.h
+ */
+
+/*
+ * Copyright © 2002 by the XFree86 Project, Inc.
+ *
+ * The pci.ids file and the data it contains are from the Linux PCI ID's
+ * Project (http://pciids.sf.net/). It is maintained by Martin Mares
+ * <mj\@ucw.cz> and other volunteers. The pci.ids file contains no
+ * copyright notice.
+ */
+
+#include \"xf86PciInfo.h\"
+#ifndef NULL
+#define NULL (void *)0
+#endif
+
+";
+
+# The following #ifdefs are used:
+# - INIT_SUBSYS_INFO -- initialise subsystem data
+# - INIT_VENDOR_SUBSYS_INFO -- initialise a vendor<->subsystem table.
+# - VENDOR_INCLUDE_NONVIDEO -- include data for non-video vendors.
+
+# Define static variables with all of the strings.
+
+foreach $vendor (sort keys %vendors) {
+ if ($infofile && !$video{$vendor}) {
+ print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ }
+ print "static const char pci_vendor_${vendor}[] = \"$vendors{$vendor}\";\n";
+ foreach $device (sort keys %{$devices{$vendor}}) {
+ print "static const char pci_device_${vendor}_${device}[] = " .
+ "\"$devices{$vendor}{$device}\";\n";
+ foreach $subsys (sort keys %{$devsubsystems{$vendor}{$device}}) {
+ $s = $subsys;
+ ($v) = split /-/, $s;
+ if ($infofile && !$video{$vendor} && $video{$v}) {
+ print "#endif\n";
+ }
+ $s =~ s/-/_/;
+ print "#ifdef INIT_SUBSYS_INFO\n";
+ print "static const char pci_subsys_${vendor}_${device}_${s}[] = " .
+ "\"$devsubsystems{$vendor}{$device}{$subsys}\";\n";
+ print "#endif\n";
+ if ($infofile && !$video{$vendor} && $video{$v}) {
+ print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ }
+ }
+ }
+ if ($infofile && !$video{$vendor}) {
+ print "#endif\n";
+ }
+}
+
+
+# Pre-initialise the table structures (from the inner to the outer).
+
+# First, the subsys structures.
+
+print "#ifdef INIT_SUBSYS_INFO\n";
+foreach $vendor (sort keys %vendors) {
+ if ($infofile && !$video{$vendor}) {
+ $pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ } else {
+ undef($pre);
+ undef($post);
+ }
+ foreach $device (sort keys %{$devices{$vendor}}) {
+ foreach $subsys (sort keys %{$devsubsystems{$vendor}{$device}}) {
+ $s = $subsys;
+ $s =~ tr/-/_/;
+ ($vid, $sid) = split /_/, $s;
+ if ($pre) {
+ print $pre;
+ undef($pre);
+ $post = "#endif\n";
+ }
+ if ($infofile && !$video{$vendor} && $video{$vid}) {
+ print "#endif\n";
+ }
+ print "static const pciSubsystemInfo " .
+ "pci_ss_info_${vendor}_${device}_$s =\n";
+ print "\t{0x$vid, 0x$sid, pci_subsys_${vendor}_${device}_$s, 0};\n";
+ print "#undef pci_ss_info_$s\n";
+ print "#define pci_ss_info_$s pci_ss_info_${vendor}_${device}_$s\n";
+ if ($infofile && !$video{$vendor} && $video{$vid}) {
+ print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ }
+ }
+ }
+ if ($post) {
+ print $post;
+ undef($post);
+ }
+}
+
+# Next, the list of per vendor+device subsystem arrays
+
+foreach $vendor (sort keys %vendors) {
+ if ($infofile && !$video{$vendor}) {
+ $pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ } else {
+ undef($pre);
+ undef($post);
+ }
+ foreach $device (sort keys %{$devices{$vendor}}) {
+ if (scalar(keys %{$devsubsystems{$vendor}{$device}}) > 0) {
+ if ($pre) {
+ print $pre;
+ undef($pre);
+ $post = "#endif\n";
+ }
+ print "static const pciSubsystemInfo *pci_ss_list_${vendor}_${device}[] = {\n";
+ foreach $sub (sort keys %{$devsubsystems{$vendor}{$device}}) {
+ $sub =~ s/-/_/;
+ print "\t&pci_ss_info_${vendor}_${device}_${sub},\n";
+ }
+ print "\tNULL\n};\n";
+ } else {
+ print "#define pci_ss_list_${vendor}_${device} NULL\n";
+ }
+ }
+ if ($post) {
+ print $post;
+ undef($post);
+ }
+}
+
+# Next, the list of per vendor subsystem arrays
+
+print "#ifdef INIT_VENDOR_SUBSYS_INFO\n";
+foreach $vendor (sort keys %vendors) {
+ if (scalar(keys %{$subsystems{$vendor}}) > 0) {
+ if ($infofile && !$video{$vendor}) {
+ print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ }
+ print "static const pciSubsystemInfo *pci_ss_list_${vendor}[] = {\n";
+ foreach $sub (sort keys %{$subsystems{$vendor}}) {
+ print "\t&pci_ss_info_${vendor}_${sub},\n";
+ }
+ print "\tNULL\n};\n";
+ if ($infofile && !$video{$vendor}) {
+ print "#endif\n";
+ }
+ } else {
+ print "#define pci_ss_list_${vendor} NULL\n";
+ }
+}
+print "#endif /* INIT_VENDOR_SUBSYS_INFO */\n";
+print "#endif /* INIT_SUBSYS_INFO */\n";
+
+# Next the device structures
+
+foreach $vendor (sort keys %vendors) {
+ if ($infofile && !$video{$vendor}) {
+ $pre = "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ } else {
+ undef($pre);
+ undef($post);
+ }
+ foreach $device (sort keys %{$devices{$vendor}}) {
+ if ($pre) {
+ print $pre;
+ undef($pre);
+ $post = "#endif\n";
+ }
+ if ($classes{$vendor}{$device}) {
+ $class = "0x$classes{$vendor}{$device}";
+ } else {
+ $class = "0";
+ }
+ print "static const pciDeviceInfo " .
+ "pci_dev_info_${vendor}_${device} = {\n";
+ print "\t0x$device, pci_device_${vendor}_${device},\n";
+ print "#ifdef INIT_SUBSYS_INFO\n";
+ print "\tpci_ss_list_${vendor}_${device},\n";
+ print "#else\n";
+ print "\tNULL,\n";
+ print "#endif\n";
+ print "\t$class\n};\n";
+ }
+ if ($post) {
+ print $post;
+ undef($post);
+ }
+}
+
+# Next, the list of per vendor device arrays
+
+foreach $vendor (sort keys %vendors) {
+ if (scalar(keys %{$devices{$vendor}}) > 0) {
+ if ($infofile && !$video{$vendor}) {
+ print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ }
+ print "static const pciDeviceInfo *pci_dev_list_${vendor}[] = {\n";
+ foreach $device (sort keys %{$devices{$vendor}}) {
+ print "\t&pci_dev_info_${vendor}_${device},\n";
+ }
+ print "\tNULL\n};\n";
+ if ($infofile && !$video{$vendor}) {
+ print "#endif\n";
+ }
+ } else {
+ print "#define pci_dev_list_${vendor} NULL\n";
+ }
+}
+
+# Next, the main vendor list
+
+print "
+static const pciVendorInfo pciVendorInfoList[] = {
+";
+
+foreach $vendor (sort keys %vendors) {
+ if ($infofile && !$video{$vendor}) {
+ print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ }
+ print "\t{0x$vendor, pci_vendor_$vendor, pci_dev_list_$vendor},\n";
+ if ($infofile && !$video{$vendor}) {
+ print "#endif\n";
+ }
+}
+print "\t{0x0000, NULL, NULL}\n};\n";
+
+# Finally, the main vendor/subsystem list
+
+print "
+#if defined(INIT_VENDOR_SUBSYS_INFO) && defined(INIT_SUBSYS_INFO)
+static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
+";
+
+foreach $vendor (sort keys %vendors) {
+ if ($infofile && !$video{$vendor}) {
+ print "#ifdef VENDOR_INCLUDE_NONVIDEO\n";
+ }
+ print "\t{0x$vendor, pci_vendor_$vendor, pci_ss_list_$vendor},\n";
+ if ($infofile && !$video{$vendor}) {
+ print "#endif\n";
+ }
+}
+print "\t{0x0000, NULL, NULL}\n};\n";
+print "#endif\n";
diff --git a/hw/xfree86/scanpci/xf86PciData.h b/hw/xfree86/scanpci/xf86PciData.h
new file mode 100644
index 000000000..0fa21b6db
--- /dev/null
+++ b/hw/xfree86/scanpci/xf86PciData.h
@@ -0,0 +1,51 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciData.h,v 1.2 2002/07/15 20:46:02 dawes Exp $ */
+
+
+
+#ifndef PCI_DATA_H_
+#define PCI_DATA_H_
+
+#define NOVENDOR 0xFFFF
+#define NODEVICE 0xFFFF
+#define NOSUBSYS 0xFFFF
+
+typedef Bool (*ScanPciSetupProcPtr)(void);
+typedef void (*ScanPciCloseProcPtr)(void);
+typedef int (*ScanPciFindByDeviceProcPtr)(
+ unsigned short vendor, unsigned short device,
+ unsigned short svendor, unsigned short subsys,
+ const char **vname, const char **dname,
+ const char **svname, const char **sname);
+typedef int (*ScanPciFindBySubsysProcPtr)(
+ unsigned short svendor, unsigned short subsys,
+ const char **svname, const char **sname);
+typedef CARD32 (*ScanPciFindClassBySubsysProcPtr)(
+ unsigned short vendor, unsigned short subsystem);
+typedef CARD32 (*ScanPciFindClassByDeviceProcPtr)(
+ unsigned short vendor, unsigned short device);
+
+/*
+ * Whoever loads this module needs to define these and initialise them
+ * after loading.
+ */
+extern ScanPciSetupProcPtr xf86SetupPciIds;
+extern ScanPciCloseProcPtr xf86ClosePciIds;
+extern ScanPciFindByDeviceProcPtr xf86FindPciNamesByDevice;
+extern ScanPciFindBySubsysProcPtr xf86FindPciNamesBySubsys;
+extern ScanPciFindClassBySubsysProcPtr xf86FindPciClassBySubsys;
+extern ScanPciFindClassByDeviceProcPtr xf86FindPciClassByDevice;
+
+Bool ScanPciSetupPciIds(void);
+void ScanPciClosePciIds(void);
+int ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device,
+ unsigned short svendor, unsigned short subsys,
+ const char **vname, const char **dname,
+ const char **svname, const char **sname);
+int ScanPciFindPciNamesBySubsys(unsigned short svendor, unsigned short subsys,
+ const char **svname, const char **sname);
+CARD32 ScanPciFindPciClassBySubsys(unsigned short vendor,
+ unsigned short subsystem);
+CARD32 ScanPciFindPciClassByDevice(unsigned short vendor,
+ unsigned short device);
+
+#endif
diff --git a/hw/xfree86/scanpci/xf86PciStdIds.h b/hw/xfree86/scanpci/xf86PciStdIds.h
new file mode 100644
index 000000000..58403ccf7
--- /dev/null
+++ b/hw/xfree86/scanpci/xf86PciStdIds.h
@@ -0,0 +1,80800 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStdIds.h,v 1.10 2003/02/26 16:33:03 dawes Exp $ */
+
+/*
+ * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
+ *
+ * It is generated by pciid2c.pl using data from the following files:
+ *
+ * ../etc/pci.ids
+ * ../etc/extrapci.ids
+ * ../common/xf86PciInfo.h
+ */
+
+/*
+ * Copyright © 2002 by the XFree86 Project, Inc.
+ *
+ * The pci.ids file and the data it contains are from the Linux PCI ID's
+ * Project (http://pciids.sf.net/). It is maintained by Martin Mares
+ * <mj@ucw.cz> and other volunteers. The pci.ids file contains no
+ * copyright notice.
+ */
+
+#include "xf86PciInfo.h"
+#ifndef NULL
+#define NULL (void *)0
+#endif
+
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0000[] = "Gammagraphx, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_001a[] = "Ascend Communications, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0033[] = "Paradyne corp.";
+#endif
+static const char pci_vendor_003d[] = "Lockheed Martin-Marietta Corp";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0059[] = "Tiger Jet Network Inc. (Wrong ID)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0070[] = "Hauppauge computer works Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0100[] = "Ncipher Corp Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0675[] = "Dynalink";
+static const char pci_device_0675_1700[] = "IS64PH ISDN Adapter";
+static const char pci_device_0675_1702[] = "IS64PH ISDN Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0925[] = "VIA Technologies, Inc. (Wrong ID)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_09c1[] = "Arris";
+static const char pci_device_09c1_0704[] = "CM 200E Cable Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0a89[] = "BREA Technologies Inc";
+#endif
+static const char pci_vendor_0e11[] = "Compaq Computer Corporation";
+static const char pci_device_0e11_0001[] = "PCI to EISA Bridge";
+static const char pci_device_0e11_0002[] = "PCI to ISA Bridge";
+static const char pci_device_0e11_0049[] = "NC7132 Gigabit Upgrade Module";
+static const char pci_device_0e11_004a[] = "NC6136 Gigabit Server Adapter";
+static const char pci_device_0e11_0508[] = "Netelligent 4/16 Token Ring";
+static const char pci_device_0e11_1000[] = "Triflex/Pentium Bridge, Model 1000";
+static const char pci_device_0e11_2000[] = "Triflex/Pentium Bridge, Model 2000";
+static const char pci_device_0e11_3032[] = "QVision 1280/p";
+static const char pci_device_0e11_3033[] = "QVision 1280/p";
+static const char pci_device_0e11_3034[] = "QVision 1280/p";
+static const char pci_device_0e11_4000[] = "4000 [Triflex]";
+static const char pci_device_0e11_6010[] = "HotPlug PCI Bridge 6010";
+static const char pci_device_0e11_7020[] = "USB Controller";
+static const char pci_device_0e11_a0ec[] = "Fibre Channel Host Controller";
+static const char pci_device_0e11_a0f0[] = "Advanced System Management Controller";
+static const char pci_device_0e11_a0f3[] = "Triflex PCI to ISA Bridge";
+static const char pci_device_0e11_a0f7[] = "PCI Hotplug Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_0e11_a0f7_8086_002a[] = "PCI Hotplug Controller A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_0e11_a0f7_8086_002b[] = "PCI Hotplug Controller B";
+#endif
+static const char pci_device_0e11_a0f8[] = "ZFMicro Chipset USB";
+static const char pci_device_0e11_a0fc[] = "Fibre Channel Host Controller";
+static const char pci_device_0e11_ae10[] = "Smart-2/P RAID Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_0e11_ae10_0e11_4030[] = "Smart-2/P Array Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_0e11_ae10_0e11_4031[] = "Smart-2SL Array Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_0e11_ae10_0e11_4032[] = "Smart Array Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_0e11_ae10_0e11_4033[] = "Smart 3100ES Array Controller";
+#endif
+static const char pci_device_0e11_ae29[] = "MIS-L";
+static const char pci_device_0e11_ae2a[] = "MPC";
+static const char pci_device_0e11_ae2b[] = "MIS-E";
+static const char pci_device_0e11_ae31[] = "System Management Controller";
+static const char pci_device_0e11_ae32[] = "Netelligent 10/100";
+static const char pci_device_0e11_ae33[] = "Triflex Dual EIDE Controller";
+static const char pci_device_0e11_ae34[] = "Netelligent 10";
+static const char pci_device_0e11_ae35[] = "Integrated NetFlex-3/P";
+static const char pci_device_0e11_ae40[] = "Netelligent 10/100 Dual";
+static const char pci_device_0e11_ae43[] = "ProLiant Integrated Netelligent 10/100";
+static const char pci_device_0e11_ae69[] = "CETUS-L";
+static const char pci_device_0e11_ae6c[] = "Northstar";
+static const char pci_device_0e11_ae6d[] = "NorthStar CPU to PCI Bridge";
+static const char pci_device_0e11_b011[] = "Integrated Netelligent 10/100";
+static const char pci_device_0e11_b012[] = "Netelligent 10 T/2";
+static const char pci_device_0e11_b01e[] = "NC3120 Fast Ethernet NIC";
+static const char pci_device_0e11_b01f[] = "NC3122 Fast Ethernet NIC";
+static const char pci_device_0e11_b02f[] = "NC1120 Ethernet NIC";
+static const char pci_device_0e11_b030[] = "Netelligent WS 5100";
+static const char pci_device_0e11_b04a[] = "10/100 TX PCI Intel WOL UTP Controller";
+static const char pci_device_0e11_b060[] = "Smart Array 5300 Controller";
+static const char pci_device_0e11_b0c6[] = "NC3161 Fast Ethernet NIC";
+static const char pci_device_0e11_b0c7[] = "NC3160 Fast Ethernet NIC";
+static const char pci_device_0e11_b0d7[] = "NC3121 Fast Ethernet NIC";
+static const char pci_device_0e11_b0dd[] = "NC3131 Fast Ethernet NIC";
+static const char pci_device_0e11_b0de[] = "NC3132 Fast Ethernet Module";
+static const char pci_device_0e11_b0df[] = "NC6132 Gigabit Module";
+static const char pci_device_0e11_b0e0[] = "NC6133 Gigabit Module";
+static const char pci_device_0e11_b0e1[] = "NC3133 Fast Ethernet Module";
+static const char pci_device_0e11_b123[] = "NC6134 Gigabit NIC";
+static const char pci_device_0e11_b134[] = "NC3163 Fast Ethernet NIC";
+static const char pci_device_0e11_b13c[] = "NC3162 Fast Ethernet NIC";
+static const char pci_device_0e11_b144[] = "NC3123 Fast Ethernet NIC";
+static const char pci_device_0e11_b163[] = "NC3134 Fast Ethernet NIC";
+static const char pci_device_0e11_b164[] = "NC3165 Fast Ethernet Upgrade Module";
+static const char pci_device_0e11_b178[] = "Smart Array 5i/532";
+static const char pci_device_0e11_b1a4[] = "NC7131 Gigabit Server Adapter";
+static const char pci_device_0e11_f130[] = "NetFlex-3/P ThunderLAN 1.0";
+static const char pci_device_0e11_f150[] = "NetFlex-3/P ThunderLAN 2.3";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_0e55[] = "HaSoTec GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1000[] = "LSI Logic / Symbios Logic";
+static const char pci_device_1000_0001[] = "53c810";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_0001_1000_1000[] = "8100S";
+#endif
+static const char pci_device_1000_0002[] = "53c820";
+static const char pci_device_1000_0003[] = "53c825";
+static const char pci_device_1000_0004[] = "53c815";
+static const char pci_device_1000_0005[] = "53c810AP";
+static const char pci_device_1000_0006[] = "53c860";
+static const char pci_device_1000_000a[] = "53c1510";
+static const char pci_device_1000_000b[] = "53c896";
+static const char pci_device_1000_000c[] = "53c895";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_000c_1de1_3907[] = "DC-390U2W";
+#endif
+static const char pci_device_1000_000d[] = "53c885";
+static const char pci_device_1000_000f[] = "53c875";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_000f_0e11_7004[] = "Embedded Ultra Wide SCSI Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_000f_1092_8760[] = "FirePort 40 Dual SCSI Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_000f_1de1_3904[] = "DC390F Ultra Wide SCSI Controller";
+#endif
+static const char pci_device_1000_0010[] = "53c895";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_0010_0e11_4040[] = "Integrated Array Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_0010_0e11_4048[] = "Integrated Array Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_1000_0012[] = "53c895a";
+static const char pci_device_1000_0013[] = "53c875a";
+static const char pci_device_1000_0020[] = "53c1010 Ultra3 SCSI Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_0020_1de1_1020[] = "DC-390U3W";
+#endif
+static const char pci_device_1000_0021[] = "53c1010 66MHz Ultra3 SCSI Adapter";
+static const char pci_device_1000_0030[] = "53c1030";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_0030_1028_1010[] = "LSI U320 SCSI Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_1000_0040[] = "53c1035";
+static const char pci_device_1000_008f[] = "53c875J";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_008f_1092_8000[] = "FirePort 40 SCSI Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_008f_1092_8760[] = "FirePort 40 Dual SCSI Host Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_1000_0621[] = "FC909";
+static const char pci_device_1000_0622[] = "FC929";
+static const char pci_device_1000_0623[] = "FC929 LAN";
+static const char pci_device_1000_0624[] = "FC919";
+static const char pci_device_1000_0625[] = "FC919 LAN";
+static const char pci_device_1000_0626[] = "FC929X";
+static const char pci_device_1000_0627[] = "FC929X LAN";
+static const char pci_device_1000_0628[] = "FC919X";
+static const char pci_device_1000_0629[] = "FC919X LAN";
+static const char pci_device_1000_0701[] = "83C885 NT50 DigitalScape Fast Ethernet";
+static const char pci_device_1000_0702[] = "Yellowfin G-NIC gigabit ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_0702_1318_0000[] = "PEI100X";
+#endif
+static const char pci_device_1000_0901[] = "61C102";
+static const char pci_device_1000_1000[] = "63C815";
+static const char pci_device_1000_1960[] = "PowerEdge Expandable RAID Controller 4";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_1960_1028_0518[] = "PowerEdge Expandable RAID Controller 4/DC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_1960_1028_0520[] = "PowerEdge Expandable RAID Controller 4/SC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1000_1960_1028_0531[] = "PowerEdge Expandable RAID Controller 4/QC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1001[] = "Kolter Electronic";
+static const char pci_device_1001_0010[] = "PCI 1616 Measurement card with 32 digital I/O lines";
+static const char pci_device_1001_0011[] = "OPTO-PCI Opto-Isolated digital I/O board";
+static const char pci_device_1001_0012[] = "PCI-AD/DA Analogue I/O board";
+static const char pci_device_1001_0013[] = "PCI-OPTO-RELAIS Digital I/O board with relay outputs";
+static const char pci_device_1001_0014[] = "PCI-Counter/Timer Counter Timer board";
+static const char pci_device_1001_0015[] = "PCI-DAC416 Analogue output board";
+static const char pci_device_1001_0016[] = "PCI-MFB Analogue I/O board";
+static const char pci_device_1001_0017[] = "PROTO-3 PCI Prototyping board";
+static const char pci_device_1001_9100[] = "INI-9100/9100W SCSI Host";
+#endif
+static const char pci_vendor_1002[] = "ATI Technologies Inc";
+static const char pci_device_1002_4144[] = "Radeon R300 AD [Radeon 9500 Pro]";
+static const char pci_device_1002_4145[] = "Radeon R300 AE [Radeon 9500 Pro]";
+static const char pci_device_1002_4146[] = "Radeon R300 AF [Radeon 9500 Pro]";
+static const char pci_device_1002_4147[] = "Radeon R300 AG [FireGL Z1/X1]";
+static const char pci_device_1002_4158[] = "68800AX [Mach32]";
+static const char pci_device_1002_4242[] = "Radeon R200 BB [Radeon All in Wonder 8500DV]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4242_1002_02aa[] = "Radeon 8500 AIW DV Edition";
+#endif
+static const char pci_device_1002_4336[] = "Radeon Mobility U1";
+static const char pci_device_1002_4337[] = "Radeon IGP 340M";
+static const char pci_device_1002_4354[] = "215CT [Mach64 CT]";
+static const char pci_device_1002_4358[] = "210888CX [Mach64 CX]";
+static const char pci_device_1002_4554[] = "210888ET [Mach64 ET]";
+static const char pci_device_1002_4654[] = "Mach64 VT";
+static const char pci_device_1002_4742[] = "3D Rage Pro AGP 1X/2X";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_0040[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_0044[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_0061[] = "Rage Pro AIW AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_0062[] = "Rage Pro AIW AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_0063[] = "Rage Pro AIW AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_0080[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_0084[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_4742[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1002_8001[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1028_0082[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1028_4082[] = "Optiplex GX1 Onboard Display Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1028_8082[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_1028_c082[] = "Rage Pro Turbo AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_8086_4152[] = "Xpert 98D AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4742_8086_464a[] = "Rage Pro Turbo AGP 2X";
+#endif
+static const char pci_device_1002_4744[] = "3D Rage Pro AGP 1X";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4744_1002_4744[] = "Rage Pro Turbo AGP";
+#endif
+static const char pci_device_1002_4747[] = "3D Rage Pro";
+static const char pci_device_1002_4749[] = "3D Rage Pro";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4749_1002_0061[] = "Rage Pro AIW";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4749_1002_0062[] = "Rage Pro AIW";
+#endif
+static const char pci_device_1002_474c[] = "Rage XC";
+static const char pci_device_1002_474d[] = "Rage XL AGP 2X";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474d_1002_0004[] = "Xpert 98 RXL AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474d_1002_0008[] = "Xpert 98 RXL AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474d_1002_0080[] = "Rage XL AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474d_1002_0084[] = "Xpert 98 AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474d_1002_474d[] = "Rage XL AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474d_1033_806a[] = "Rage XL AGP";
+#endif
+static const char pci_device_1002_474e[] = "Rage XC AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474e_1002_474e[] = "Rage XC AGP";
+#endif
+static const char pci_device_1002_474f[] = "Rage XL";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474f_1002_0008[] = "Rage XL";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_474f_1002_474f[] = "Rage XL";
+#endif
+static const char pci_device_1002_4750[] = "3D Rage Pro 215GP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4750_1002_0040[] = "Rage Pro Turbo";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4750_1002_0044[] = "Rage Pro Turbo";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4750_1002_0080[] = "Rage Pro Turbo";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4750_1002_0084[] = "Rage Pro Turbo";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4750_1002_4750[] = "Rage Pro Turbo";
+#endif
+static const char pci_device_1002_4751[] = "3D Rage Pro 215GQ";
+static const char pci_device_1002_4752[] = "Rage XL";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4752_1002_0008[] = "Rage XL";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4752_1002_4752[] = "Rage XL";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4752_1002_8008[] = "Rage XL";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4752_1028_00d1[] = "PowerEdge 2550";
+#endif
+static const char pci_device_1002_4753[] = "Rage XC";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4753_1002_4753[] = "Rage XC";
+#endif
+static const char pci_device_1002_4754[] = "3D Rage I/II 215GT [Mach64 GT]";
+static const char pci_device_1002_4755[] = "3D Rage II+ 215GTB [Mach64 GTB]";
+static const char pci_device_1002_4756[] = "3D Rage IIC 215IIC [Mach64 GT IIC]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4756_1002_4756[] = "Rage IIC";
+#endif
+static const char pci_device_1002_4757[] = "3D Rage IIC AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4757_1002_4757[] = "Rage IIC AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4757_1028_0089[] = "Rage 3D IIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4757_1028_4082[] = "Rage 3D IIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4757_1028_8082[] = "Rage 3D IIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4757_1028_c082[] = "Rage 3D IIC";
+#endif
+static const char pci_device_1002_4758[] = "210888GX [Mach64 GX]";
+static const char pci_device_1002_4759[] = "3D Rage IIC";
+static const char pci_device_1002_475a[] = "3D Rage IIC AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_475a_1002_0087[] = "Rage 3D IIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_475a_1002_475a[] = "Rage IIC AGP";
+#endif
+static const char pci_device_1002_4964[] = "Radeon R250 Id [Radeon 9000]";
+static const char pci_device_1002_4965[] = "Radeon R250 Ie [Radeon 9000]";
+static const char pci_device_1002_4966[] = "Radeon R250 If [Radeon 9000]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4966_10f1_0002[] = "R250 If [Tachyon G9000 PRO]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4966_148c_2039[] = "R250 If [Radeon 9000 Pro Evil Commando]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4966_1509_9a00[] = "R250 If [Radeon 9000 AT009]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4966_1681_0040[] = "R250 If [3D prophet 9000]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4966_174b_7176[] = "R250 If [Sapphire Radeon 9000 Pro]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4966_174b_7192[] = "R250 If [Radeon 9000 Atlantis]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4966_17af_2005[] = "R250 If [Excalibur Radeon 9000 Pro]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4966_17af_2006[] = "R250 If [Excalibur Radeon 9000]";
+#endif
+static const char pci_device_1002_4967[] = "Radeon R250 Ig [Radeon 9000]";
+static const char pci_device_1002_496e[] = "Radeon R250 [Radeon 9000] (Secondary)";
+static const char pci_device_1002_4c42[] = "3D Rage LT Pro AGP-133";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c42_0e11_b0e8[] = "Rage 3D LT Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c42_0e11_b10e[] = "3D Rage LT Pro (Compaq Armada 1750)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c42_1002_0040[] = "Rage LT Pro AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c42_1002_0044[] = "Rage LT Pro AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c42_1002_4c42[] = "Rage LT Pro AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c42_1002_8001[] = "Rage LT Pro AGP 2X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c42_1028_0085[] = "Rage 3D LT Pro";
+#endif
+static const char pci_device_1002_4c44[] = "3D Rage LT Pro AGP-66";
+static const char pci_device_1002_4c45[] = "Rage Mobility M3 AGP";
+static const char pci_device_1002_4c46[] = "Rage Mobility M3 AGP 2x";
+static const char pci_device_1002_4c47[] = "3D Rage LT-G 215LG";
+static const char pci_device_1002_4c49[] = "3D Rage LT Pro";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c49_1002_0004[] = "Rage LT Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c49_1002_0040[] = "Rage LT Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c49_1002_0044[] = "Rage LT Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c49_1002_4c49[] = "Rage LT Pro";
+#endif
+static const char pci_device_1002_4c4d[] = "Rage Mobility P/M AGP 2x";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c4d_0e11_b111[] = "Armada M700";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c4d_1002_0084[] = "Xpert 98 AGP 2X (Mobility)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c4d_1014_0154[] = "ThinkPad A20m";
+#endif
+static const char pci_device_1002_4c4e[] = "Rage Mobility L AGP 2x";
+static const char pci_device_1002_4c50[] = "3D Rage LT Pro";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c50_1002_4c50[] = "Rage LT Pro";
+#endif
+static const char pci_device_1002_4c51[] = "3D Rage LT Pro";
+static const char pci_device_1002_4c52[] = "Rage Mobility P/M";
+static const char pci_device_1002_4c53[] = "Rage Mobility L";
+static const char pci_device_1002_4c54[] = "264LT [Mach64 LT]";
+static const char pci_device_1002_4c57[] = "Radeon Mobility M7 LW [Radeon Mobility 7500]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c57_1014_0517[] = "ThinkPad T30";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c57_1028_00e6[] = "Radeon Mobility M7 LW (Dell Inspiron 8100)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c57_144d_c006[] = "Radeon Mobility M7 LW in vpr Matrix 170B4";
+#endif
+static const char pci_device_1002_4c58[] = "Radeon RV200 LX [Mobility FireGL 7800 M7]";
+static const char pci_device_1002_4c59[] = "Radeon Mobility M6 LY";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c59_1014_0235[] = "ThinkPad A30p (2653-64G)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c59_1014_0239[] = "ThinkPad X22/X23/X24";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_4c59_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+static const char pci_device_1002_4c5a[] = "Radeon Mobility M6 LZ";
+static const char pci_device_1002_4c64[] = "Radeon R250 Ld [Radeon Mobility 9000 M9]";
+static const char pci_device_1002_4c65[] = "Radeon R250 Le [Radeon Mobility 9000 M9]";
+static const char pci_device_1002_4c66[] = "Radeon R250 Lf [Radeon Mobility 9000 M9]";
+static const char pci_device_1002_4c67[] = "Radeon R250 Lg [Radeon Mobility 9000 M9]";
+static const char pci_device_1002_4d46[] = "Rage Mobility M4 AGP";
+static const char pci_device_1002_4d4c[] = "Rage Mobility M4 AGP";
+static const char pci_device_1002_4e44[] = "Radeon R300 ND [Radeon 9700]";
+static const char pci_device_1002_4e45[] = "Radeon R300 NE [Radeon 9700]";
+static const char pci_device_1002_4e46[] = "Radeon R300 NF [Radeon 9700]";
+static const char pci_device_1002_4e47[] = "Radeon R300 NG [FireGL X1]";
+static const char pci_device_1002_4e64[] = "Radeon R300 [Radeon 9700 Pro] (Secondary)";
+static const char pci_device_1002_4e65[] = "Radeon R300 [Radeon 9700] (Secondary)";
+static const char pci_device_1002_4e66[] = "Radeon R300 [Radeon 9700] (Secondary)";
+static const char pci_device_1002_4e67[] = "Radeon R300 [FireGL X1] (Secondary)";
+static const char pci_device_1002_5041[] = "Rage 128 PA/PRO";
+static const char pci_device_1002_5042[] = "Rage 128 PB/PRO AGP 2x";
+static const char pci_device_1002_5043[] = "Rage 128 PC/PRO AGP 4x";
+static const char pci_device_1002_5044[] = "Rage 128 PD/PRO TMDS";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5044_1002_0028[] = "Rage 128 AIW";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5044_1002_0029[] = "Rage 128 AIW";
+#endif
+static const char pci_device_1002_5045[] = "Rage 128 PE/PRO AGP 2x TMDS";
+static const char pci_device_1002_5046[] = "Rage 128 PF/PRO AGP 4x TMDS";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_0004[] = "Rage Fury Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_0008[] = "Rage Fury Pro/Xpert 2000 Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_0014[] = "Rage Fury Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_0018[] = "Rage Fury Pro/Xpert 2000 Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_0028[] = "Rage 128 Pro AIW AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_002a[] = "Rage 128 Pro AIW AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_0048[] = "Rage Fury Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_2000[] = "Rage Fury MAXX AGP 4x (TMDS) (VGA device)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5046_1002_2001[] = "Rage Fury MAXX AGP 4x (TMDS) (Extra device?!)";
+#endif
+static const char pci_device_1002_5047[] = "Rage 128 PG/PRO";
+static const char pci_device_1002_5048[] = "Rage 128 PH/PRO AGP 2x";
+static const char pci_device_1002_5049[] = "Rage 128 PI/PRO AGP 4x";
+static const char pci_device_1002_504a[] = "Rage 128 PJ/PRO TMDS";
+static const char pci_device_1002_504b[] = "Rage 128 PK/PRO AGP 2x TMDS";
+static const char pci_device_1002_504c[] = "Rage 128 PL/PRO AGP 4x TMDS";
+static const char pci_device_1002_504d[] = "Rage 128 PM/PRO";
+static const char pci_device_1002_504e[] = "Rage 128 PN/PRO AGP 2x";
+static const char pci_device_1002_504f[] = "Rage 128 PO/PRO AGP 4x";
+static const char pci_device_1002_5050[] = "Rage 128 PP/PRO TMDS [Xpert 128]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5050_1002_0008[] = "Xpert 128";
+#endif
+static const char pci_device_1002_5051[] = "Rage 128 PQ/PRO AGP 2x TMDS";
+static const char pci_device_1002_5052[] = "Rage 128 PR/PRO AGP 4x TMDS";
+static const char pci_device_1002_5053[] = "Rage 128 PS/PRO";
+static const char pci_device_1002_5054[] = "Rage 128 PT/PRO AGP 2x";
+static const char pci_device_1002_5055[] = "Rage 128 PU/PRO AGP 4x";
+static const char pci_device_1002_5056[] = "Rage 128 PV/PRO TMDS";
+static const char pci_device_1002_5057[] = "Rage 128 PW/PRO AGP 2x TMDS";
+static const char pci_device_1002_5058[] = "Rage 128 PX/PRO AGP 4x TMDS";
+static const char pci_device_1002_5144[] = "Radeon R100 QD [Radeon 7200]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_0008[] = "Radeon 7000/Radeon VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_0009[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_000a[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_001a[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_0029[] = "Radeon AIW";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_0038[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_0039[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_008a[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_00ba[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_0139[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_028a[] = "Radeon 7000/Radeon";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_02aa[] = "Radeon AIW";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5144_1002_053a[] = "Radeon 7000/Radeon";
+#endif
+static const char pci_device_1002_5145[] = "Radeon R100 QE";
+static const char pci_device_1002_5146[] = "Radeon R100 QF";
+static const char pci_device_1002_5147[] = "Radeon R100 QG";
+static const char pci_device_1002_5148[] = "Radeon R200 QH [Radeon 8500]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5148_1002_010a[] = "FireGL 8800 64Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5148_1002_0152[] = "FireGL 8800 128Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5148_1002_0162[] = "FireGL 8700 32Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5148_1002_0172[] = "FireGL 8700 64Mb";
+#endif
+static const char pci_device_1002_5149[] = "Radeon R200 QI";
+static const char pci_device_1002_514a[] = "Radeon R200 QJ";
+static const char pci_device_1002_514b[] = "Radeon R200 QK";
+static const char pci_device_1002_514c[] = "Radeon R200 QL [Radeon 8500 LE]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_514c_1002_003a[] = "Radeon R200 QL [Radeon 8500 LE]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_514c_1002_013a[] = "Radeon 8500";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_514c_148c_2026[] = "R200 QL [Radeon 8500 Evil Master II Multi Display Edition]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_514c_174b_7149[] = "Radeon R200 QL [Sapphire Radeon 8500 LE]";
+#endif
+static const char pci_device_1002_514d[] = "Radeon R200 QM [Radeon 9100]";
+static const char pci_device_1002_514e[] = "Radeon R200 QN [Radeon 8500LE]";
+static const char pci_device_1002_514f[] = "Radeon R200 QO [Radeon 8500LE]";
+static const char pci_device_1002_5157[] = "Radeon RV200 QW [Radeon 7500]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5157_1002_013a[] = "Radeon 7500";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5157_1458_4000[] = "RV200 QW [RADEON 7500 PRO MAYA AR]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5157_148c_2024[] = "RV200 QW [Radeon 7500LE Dual Display]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5157_148c_2025[] = "RV200 QW [Radeon 7500 Evil Master Multi Display Edition]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5157_148c_2036[] = "RV200 QW [Radeon 7500 PCI Dual Display]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5157_174b_7147[] = "RV200 QW [Sapphire Radeon 7500LE]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5157_174b_7161[] = "Radeon RV200 QW [Radeon 7500 LE]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5157_17af_0202[] = "RV200 QW [Excalibur Radeon 7500LE]";
+#endif
+static const char pci_device_1002_5158[] = "Radeon RV200 QX [Radeon 7500]";
+static const char pci_device_1002_5159[] = "Radeon RV100 QY [Radeon 7000/VE]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_1002_000a[] = "Radeon 7000/Radeon VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_1002_000b[] = "Radeon 7000";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_1002_0038[] = "Radeon 7000/Radeon VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_1002_003a[] = "Radeon 7000/Radeon VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_1002_00ba[] = "Radeon 7000/Radeon VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_1002_013a[] = "Radeon 7000/Radeon VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_1458_4002[] = "RV100 QY [RADEON 7000 PRO MAYA AV Series]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_148c_2003[] = "RV100 QY [Radeon 7000 Multi-Display Edition]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_148c_2023[] = "RV100 QY [Radeon 7000 Evil Master Multi-Display]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_174b_7112[] = "RV100 QY [Sapphire Radeon VE 7000]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5159_1787_0202[] = "RV100 QY [Excalibur Radeon 7000]";
+#endif
+static const char pci_device_1002_515a[] = "Radeon RV100 QZ [Radeon 7000/VE]";
+static const char pci_device_1002_5168[] = "Radeon R200 Qh";
+static const char pci_device_1002_5169[] = "Radeon R200 Qi";
+static const char pci_device_1002_516a[] = "Radeon R200 Qj";
+static const char pci_device_1002_516b[] = "Radeon R200 Qk";
+static const char pci_device_1002_516c[] = "Radeon R200 Ql";
+static const char pci_device_1002_5245[] = "Rage 128 RE/SG";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5245_1002_0008[] = "Xpert 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5245_1002_0028[] = "Rage 128 AIW";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5245_1002_0029[] = "Rage 128 AIW";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5245_1002_0068[] = "Rage 128 AIW";
+#endif
+static const char pci_device_1002_5246[] = "Rage 128 RF/SG AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5246_1002_0004[] = "Magnum/Xpert 128/Xpert 99";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5246_1002_0008[] = "Magnum/Xpert128/X99/Xpert2000";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5246_1002_0028[] = "Rage 128 AIW AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5246_1002_0044[] = "Rage Fury/Xpert 128/Xpert 2000";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5246_1002_0068[] = "Rage 128 AIW AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5246_1002_0448[] = "Rage Fury";
+#endif
+static const char pci_device_1002_5247[] = "Rage 128 RG";
+static const char pci_device_1002_524b[] = "Rage 128 RK/VR";
+static const char pci_device_1002_524c[] = "Rage 128 RL/VR AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_524c_1002_0008[] = "Xpert 99/Xpert 2000";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_524c_1002_0088[] = "Xpert 99";
+#endif
+static const char pci_device_1002_5345[] = "Rage 128 SE/4x";
+static const char pci_device_1002_5346[] = "Rage 128 SF/4x AGP 2x";
+static const char pci_device_1002_5347[] = "Rage 128 SG/4x AGP 4x";
+static const char pci_device_1002_5348[] = "Rage 128 SH";
+static const char pci_device_1002_534b[] = "Rage 128 SK/4x";
+static const char pci_device_1002_534c[] = "Rage 128 SL/4x AGP 2x";
+static const char pci_device_1002_534d[] = "Rage 128 SM/4x AGP 4x";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_534d_1002_0008[] = "Xpert 99/Xpert 2000";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_534d_1002_0018[] = "Xpert 2000";
+#endif
+static const char pci_device_1002_534e[] = "Rage 128 4x";
+static const char pci_device_1002_5354[] = "Mach 64 VT";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5354_1002_5654[] = "Mach 64 reference";
+#endif
+static const char pci_device_1002_5446[] = "Rage 128 Pro Ultra TF";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5446_1002_0004[] = "Rage Fury Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5446_1002_0008[] = "Rage Fury Pro/Xpert 2000 Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5446_1002_0018[] = "Rage Fury Pro/Xpert 2000 Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5446_1002_0028[] = "Rage 128 AIW Pro AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5446_1002_0029[] = "Rage 128 AIW";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5446_1002_002a[] = "Rage 128 AIW Pro AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5446_1002_002b[] = "Rage 128 AIW";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5446_1002_0048[] = "Xpert 2000 Pro";
+#endif
+static const char pci_device_1002_544c[] = "Rage 128 Pro Ultra TL";
+static const char pci_device_1002_5452[] = "Rage 128 Pro Ultra TR";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5452_1002_001c[] = "Rage 128 Pro 4XL";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5452_103c_1279[] = "Rage 128 Pro 4XL";
+#endif
+static const char pci_device_1002_5453[] = "Rage 128 Pro Ultra TS";
+static const char pci_device_1002_5454[] = "Rage 128 Pro Ultra TT";
+static const char pci_device_1002_5455[] = "Rage 128 Pro Ultra TU";
+static const char pci_device_1002_5654[] = "264VT [Mach64 VT]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1002_5654_1002_5654[] = "Mach64VT Reference";
+#endif
+static const char pci_device_1002_5655[] = "264VT3 [Mach64 VT3]";
+static const char pci_device_1002_5656[] = "264VT4 [Mach64 VT4]";
+static const char pci_device_1002_700f[] = "U1/A3 AGP Bridge [IGP 320M]";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1003[] = "ULSI Systems";
+static const char pci_device_1003_0201[] = "US201";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1004[] = "VLSI Technology Inc";
+static const char pci_device_1004_0005[] = "82C592-FC1";
+static const char pci_device_1004_0006[] = "82C593-FC1";
+static const char pci_device_1004_0007[] = "82C594-AFC2";
+static const char pci_device_1004_0008[] = "82C596/7 [Wildcat]";
+static const char pci_device_1004_0009[] = "82C597-AFC2";
+static const char pci_device_1004_000c[] = "82C541 [Lynx]";
+static const char pci_device_1004_000d[] = "82C543 [Lynx]";
+static const char pci_device_1004_0101[] = "82C532";
+static const char pci_device_1004_0102[] = "82C534 [Eagle]";
+static const char pci_device_1004_0103[] = "82C538";
+static const char pci_device_1004_0104[] = "82C535";
+static const char pci_device_1004_0105[] = "82C147";
+static const char pci_device_1004_0200[] = "82C975";
+static const char pci_device_1004_0280[] = "82C925";
+static const char pci_device_1004_0304[] = "QSound ThunderBird PCI Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0304_1004_0304[] = "QSound ThunderBird PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0304_122d_1206[] = "DSP368 Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0304_1483_5020[] = "XWave Thunder 3D Audio";
+#endif
+static const char pci_device_1004_0305[] = "QSound ThunderBird PCI Audio Gameport";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0305_1004_0305[] = "QSound ThunderBird PCI Audio Gameport";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0305_122d_1207[] = "DSP368 Audio Gameport";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0305_1483_5021[] = "XWave Thunder 3D Audio Gameport";
+#endif
+static const char pci_device_1004_0306[] = "QSound ThunderBird PCI Audio Support Registers";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0306_1004_0306[] = "QSound ThunderBird PCI Audio Support Registers";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0306_122d_1208[] = "DSP368 Audio Support Registers";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1004_0306_1483_5022[] = "XWave Thunder 3D Audio Support Registers";
+#endif
+static const char pci_device_1004_0307[] = "Thunderbird";
+static const char pci_device_1004_0308[] = "Thunderbird";
+static const char pci_device_1004_0702[] = "VAS96011 [Golden Gate II]";
+static const char pci_device_1004_0703[] = "Tollgate";
+#endif
+static const char pci_vendor_1005[] = "Avance Logic Inc. [ALI]";
+static const char pci_device_1005_2064[] = "ALG2032/2064";
+static const char pci_device_1005_2128[] = "ALG2364A";
+static const char pci_device_1005_2301[] = "ALG2301";
+static const char pci_device_1005_2302[] = "ALG2302";
+static const char pci_device_1005_2364[] = "ALG2364";
+static const char pci_device_1005_2464[] = "ALG2364A";
+static const char pci_device_1005_2501[] = "ALG2564A/25128A";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1006[] = "Reply Group";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1007[] = "NetFrame Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1008[] = "Epson";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_100a[] = "Phoenix Technologies";
+#endif
+static const char pci_vendor_100b[] = "National Semiconductor Corporation";
+static const char pci_device_100b_0001[] = "DP83810";
+static const char pci_device_100b_0002[] = "87415/87560 IDE";
+static const char pci_device_100b_000e[] = "87560 Legacy I/O";
+static const char pci_device_100b_000f[] = "FireWire Controller";
+static const char pci_device_100b_0011[] = "NS87560 National PCI System I/O";
+static const char pci_device_100b_0012[] = "USB Controller";
+static const char pci_device_100b_0020[] = "DP83815 (MacPhyter) Ethernet Controller";
+static const char pci_device_100b_0022[] = "DP83820 10/100/1000 Ethernet Controller";
+static const char pci_device_100b_0500[] = "SCx200 Bridge";
+static const char pci_device_100b_0501[] = "SCx200 SMI";
+static const char pci_device_100b_0502[] = "SCx200 IDE";
+static const char pci_device_100b_0503[] = "SCx200 Audio";
+static const char pci_device_100b_0504[] = "SCx200 Video";
+static const char pci_device_100b_0505[] = "SCx200 XBus";
+static const char pci_device_100b_d001[] = "87410 IDE";
+static const char pci_vendor_100c[] = "Tseng Labs Inc";
+static const char pci_device_100c_3202[] = "ET4000/W32p rev A";
+static const char pci_device_100c_3205[] = "ET4000/W32p rev B";
+static const char pci_device_100c_3206[] = "ET4000/W32p rev C";
+static const char pci_device_100c_3207[] = "ET4000/W32p rev D";
+static const char pci_device_100c_3208[] = "ET6000";
+static const char pci_device_100c_4702[] = "ET6300";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_100d[] = "AST Research Inc";
+#endif
+static const char pci_vendor_100e[] = "Weitek";
+static const char pci_device_100e_9000[] = "P9000 Viper";
+static const char pci_device_100e_9001[] = "P9000 Viper";
+static const char pci_device_100e_9002[] = "P9000 Viper";
+static const char pci_device_100e_9100[] = "P9100 Viper Pro/SE";
+static const char pci_vendor_1010[] = "Video Logic, Ltd.";
+static const char pci_vendor_1011[] = "Digital Equipment Corporation";
+static const char pci_device_1011_0001[] = "DECchip 21050";
+static const char pci_device_1011_0002[] = "DECchip 21040 [Tulip]";
+static const char pci_device_1011_0004[] = "DECchip 21030 [TGA]";
+static const char pci_device_1011_0007[] = "NVRAM [Zephyr NVRAM]";
+static const char pci_device_1011_0008[] = "KZPSA [KZPSA]";
+static const char pci_device_1011_0009[] = "DECchip 21140 [FasterNet]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1025_0310[] = "21140 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_10b8_2001[] = "SMC9332BDT EtherPower 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_10b8_2002[] = "SMC9332BVT EtherPower T4 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_10b8_2003[] = "SMC9334BDT EtherPower 10/100 (1-port)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1109_2400[] = "ANA-6944A/TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1112_2300[] = "RNS2300 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1112_2320[] = "RNS2320 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1112_2340[] = "RNS2340 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1113_1207[] = "EN-1207-TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1186_1100[] = "DFE-500TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1186_1112[] = "DFE-570TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1186_1140[] = "DFE-660 Cardbus Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1186_1142[] = "DFE-660 Cardbus Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_11f6_0503[] = "Freedomline Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1282_9100[] = "AEF-380TXD Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_1385_1100[] = "FA310TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0009_2646_0001[] = "KNE100TX Fast Ethernet";
+#endif
+static const char pci_device_1011_000a[] = "21230 Video Codec";
+static const char pci_device_1011_000d[] = "PBXGB [TGA2]";
+static const char pci_device_1011_000f[] = "DEFPA";
+static const char pci_device_1011_0014[] = "DECchip 21041 [Tulip Pass 3]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0014_1186_0100[] = "DE-530+";
+#endif
+static const char pci_device_1011_0016[] = "DGLPB [OPPO]";
+static const char pci_device_1011_0019[] = "DECchip 21142/43";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1011_500a[] = "DE500A Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1011_500b[] = "DE500B Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1014_0001[] = "10/100 EtherJet Cardbus";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1025_0315[] = "ALN315 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1033_800c[] = "PC-9821-CS01 100BASE-TX Interface Card";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1033_800d[] = "PC-9821NR-B06 100BASE-TX Interface Card";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_108d_0016[] = "Rapidfire 2327 10/100 Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_108d_0017[] = "GoCard 2250 Ethernet 10/100 Cardbus";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_10b8_2005[] = "SMC8032DT Extreme Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_10b8_8034[] = "SMC8034 Extreme Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_10ef_8169[] = "Cardbus Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1109_2a00[] = "ANA-6911A/TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1109_2b00[] = "ANA-6911A/TXC Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1109_3000[] = "ANA-6922/TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1113_1207[] = "Cheetah Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1113_2220[] = "Cardbus Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_115d_0002[] = "Cardbus Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1179_0203[] = "Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1179_0204[] = "Cardbus Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1186_1100[] = "DFE-500TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1186_1101[] = "DFE-500TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1186_1102[] = "DFE-500TX Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1259_2800[] = "AT-2800Tx Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1266_0004[] = "Eagle Fast EtherMAX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_12af_0019[] = "NetFlyer Cardbus Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1374_0001[] = "Cardbus Ethernet Card 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1374_0002[] = "Cardbus Ethernet Card 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1374_0007[] = "Cardbus Ethernet Card 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1374_0008[] = "Cardbus Ethernet Card 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1385_2100[] = "FA510";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_1395_0001[] = "10/100 Ethernet CardBus PC Card";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_13d1_ab01[] = "EtherFast 10/100 Cardbus (PCMPC200)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0019_8086_0001[] = "EtherExpress PRO/100 Mobile CardBus 32";
+#endif
+static const char pci_device_1011_001a[] = "Farallon PN9000SX";
+static const char pci_device_1011_0021[] = "DECchip 21052";
+static const char pci_device_1011_0022[] = "DECchip 21150";
+static const char pci_device_1011_0023[] = "DECchip 21150";
+static const char pci_device_1011_0024[] = "DECchip 21152";
+static const char pci_device_1011_0025[] = "DECchip 21153";
+static const char pci_device_1011_0026[] = "DECchip 21154";
+static const char pci_device_1011_0034[] = "56k Modem Cardbus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0034_1374_0003[] = "56k Modem Cardbus";
+#endif
+static const char pci_device_1011_0045[] = "DECchip 21553";
+static const char pci_device_1011_0046[] = "DECchip 21554";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_0e11_4050[] = "Integrated Smart Array";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_0e11_4051[] = "Integrated Smart Array";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_0e11_4058[] = "Integrated Smart Array";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_103c_10c2[] = "Hewlett-Packard NetRAID-4M";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_12d9_000a[] = "VoIP PCI Gateway";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_9005_0365[] = "Adaptec 5400S";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_9005_1364[] = "Dell PowerEdge RAID Controller 2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_9005_1365[] = "Dell PowerEdge RAID Controller 2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_0046_e4bf_1000[] = "CC8-1-BLUES";
+#endif
+static const char pci_device_1011_1065[] = "StrongARM DC21285";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1011_1065_1069_0020[] = "DAC960P / DAC1164P";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1012[] = "Micronics Computers Inc";
+#endif
+static const char pci_vendor_1013[] = "Cirrus Logic";
+static const char pci_device_1013_0038[] = "GD 7548";
+static const char pci_device_1013_0040[] = "GD 7555 Flat Panel GUI Accelerator";
+static const char pci_device_1013_004c[] = "GD 7556 Video/Graphics LCD/CRT Ctrlr";
+static const char pci_device_1013_00a0[] = "GD 5430/40 [Alpine]";
+static const char pci_device_1013_00a2[] = "GD 5432 [Alpine]";
+static const char pci_device_1013_00a4[] = "GD 5434-4 [Alpine]";
+static const char pci_device_1013_00a8[] = "GD 5434-8 [Alpine]";
+static const char pci_device_1013_00ac[] = "GD 5436 [Alpine]";
+static const char pci_device_1013_00b0[] = "GD 5440";
+static const char pci_device_1013_00b8[] = "GD 5446";
+static const char pci_device_1013_00bc[] = "GD 5480";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_00bc_1013_00bc[] = "CL-GD5480";
+#endif
+static const char pci_device_1013_00d0[] = "GD 5462";
+static const char pci_device_1013_00d2[] = "GD 5462 [Laguna I]";
+static const char pci_device_1013_00d4[] = "GD 5464 [Laguna]";
+static const char pci_device_1013_00d5[] = "GD 5464 BD [Laguna]";
+static const char pci_device_1013_00d6[] = "GD 5465 [Laguna]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_00d6_13ce_8031[] = "Barco Metheus 2 Megapixel, Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_00d6_13cf_8031[] = "Barco Metheus 2 Megapixel, Dual Head";
+#endif
+static const char pci_device_1013_00e8[] = "GD 5436U";
+static const char pci_device_1013_1100[] = "CL 6729";
+static const char pci_device_1013_1110[] = "PD 6832 PCMCIA/CardBus Ctrlr";
+static const char pci_device_1013_1112[] = "PD 6834 PCMCIA/CardBus Ctrlr";
+static const char pci_device_1013_1113[] = "PD 6833 PCMCIA/CardBus Ctrlr";
+static const char pci_device_1013_1200[] = "GD 7542 [Nordic]";
+static const char pci_device_1013_1202[] = "GD 7543 [Viking]";
+static const char pci_device_1013_1204[] = "GD 7541 [Nordic Light]";
+static const char pci_device_1013_4400[] = "CD 4400";
+static const char pci_device_1013_6001[] = "CS 4610/11 [CrystalClear SoundFusion Audio Accelerator]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6001_1014_1010[] = "CS4610 SoundFusion Audio Accelerator";
+#endif
+static const char pci_device_1013_6003[] = "CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6003_1013_4280[] = "Crystal SoundFusion PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6003_1681_0050[] = "Game Theater XP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6003_1681_a011[] = "Fortissimo III 7.1";
+#endif
+static const char pci_device_1013_6004[] = "CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]";
+static const char pci_device_1013_6005[] = "Crystal CS4281 PCI Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_1013_4281[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_10cf_10a8[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_10cf_10a9[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_10cf_10aa[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_10cf_10ab[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_10cf_10ac[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_10cf_10ad[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_10cf_10b4[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_1179_0001[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1013_6005_14c0_000c[] = "Crystal CS4281 PCI Audio";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1014[] = "IBM";
+static const char pci_device_1014_0002[] = "PCI to MCA Bridge";
+static const char pci_device_1014_0005[] = "Alta Lite";
+static const char pci_device_1014_0007[] = "Alta MP";
+static const char pci_device_1014_000a[] = "Fire Coral";
+static const char pci_device_1014_0017[] = "CPU to PCI Bridge";
+static const char pci_device_1014_0018[] = "TR Auto LANstreamer";
+static const char pci_device_1014_001b[] = "GXT-150P";
+static const char pci_device_1014_001c[] = "Carrera";
+static const char pci_device_1014_001d[] = "82G2675";
+static const char pci_device_1014_0020[] = "MCA";
+static const char pci_device_1014_0022[] = "IBM27-82351";
+static const char pci_device_1014_002d[] = "Python";
+static const char pci_device_1014_002e[] = "ServeRAID Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_002e_1014_002e[] = "ServeRAID-3x";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_002e_1014_022e[] = "ServeRAID-4H";
+#endif
+static const char pci_device_1014_0036[] = "Miami";
+static const char pci_device_1014_003a[] = "CPU to PCI Bridge";
+static const char pci_device_1014_003e[] = "16/4 Token ring UTP/STP controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_003e_1014_003e[] = "Token-Ring Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_003e_1014_00cd[] = "Token-Ring Adapter + Wake-On-LAN";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_003e_1014_00ce[] = "16/4 Token-Ring Adapter 2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_003e_1014_00cf[] = "16/4 Token-Ring Adapter Special";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_003e_1014_00e4[] = "High-Speed 100/16/4 Token-Ring Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_003e_1014_00e5[] = "16/4 Token-Ring Adapter 2 + Wake-On-LAN";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_003e_1014_016d[] = "iSeries 2744 Card";
+#endif
+static const char pci_device_1014_0045[] = "SSA Adapter";
+static const char pci_device_1014_0046[] = "MPIC interrupt controller";
+static const char pci_device_1014_0047[] = "PCI to PCI Bridge";
+static const char pci_device_1014_0048[] = "PCI to PCI Bridge";
+static const char pci_device_1014_0049[] = "Warhead SCSI Controller";
+static const char pci_device_1014_004e[] = "ATM Controller (14104e00)";
+static const char pci_device_1014_004f[] = "ATM Controller (14104f00)";
+static const char pci_device_1014_0050[] = "ATM Controller (14105000)";
+static const char pci_device_1014_0053[] = "25 MBit ATM Controller";
+static const char pci_device_1014_0057[] = "MPEG PCI Bridge";
+static const char pci_device_1014_005c[] = "i82557B 10/100";
+static const char pci_device_1014_007c[] = "ATM Controller (14107c00)";
+static const char pci_device_1014_007d[] = "3780IDSP [MWave]";
+static const char pci_device_1014_0090[] = "GXT 3000P";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_0090_1014_008e[] = "GXT-3000P";
+#endif
+static const char pci_device_1014_0095[] = "20H2999 PCI Docking Bridge";
+static const char pci_device_1014_0096[] = "Chukar chipset SCSI controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_0096_1014_0097[] = "iSeries 2778 DASD IOA";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_0096_1014_0098[] = "iSeries 2763 DASD IOA";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_0096_1014_0099[] = "iSeries 2748 DASD IOA";
+#endif
+static const char pci_device_1014_00a5[] = "ATM Controller (1410a500)";
+static const char pci_device_1014_00a6[] = "ATM 155MBPS MM Controller (1410a600)";
+static const char pci_device_1014_00b7[] = "256-bit Graphics Rasterizer [Fire GL1]";
+static const char pci_device_1014_00be[] = "ATM 622MBPS Controller (1410be00)";
+static const char pci_device_1014_00dc[] = "Advanced Systems Management Adapter (ASMA)";
+static const char pci_device_1014_00fc[] = "CPC710 Dual Bridge and Memory Controller (PCI-64)";
+static const char pci_device_1014_0105[] = "CPC710 Dual Bridge and Memory Controller (PCI-32)";
+static const char pci_device_1014_010f[] = "Remote Supervisor Adapter (RSA)";
+static const char pci_device_1014_0142[] = "Yotta Video Compositor Input";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_0142_1014_0143[] = "Yotta Input Controller (ytin)";
+#endif
+static const char pci_device_1014_0144[] = "Yotta Video Compositor Output";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_0144_1014_0145[] = "Yotta Output Controller (ytout)";
+#endif
+static const char pci_device_1014_0156[] = "405GP PLB to PCI Bridge";
+static const char pci_device_1014_01a7[] = "PCI-X to PCI-X Bridge";
+static const char pci_device_1014_01bd[] = "ServeRAID Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_01bd_1014_01be[] = "ServeRAID-4M";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_01bd_1014_01bf[] = "ServeRAID-4L";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_01bd_1014_0208[] = "ServeRAID-4Mx";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_01bd_1014_020e[] = "ServeRAID-4Lx";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_01bd_1014_022e[] = "ServeRAID-4H";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_01bd_1014_0258[] = "ServeRAID-5i";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1014_01bd_1014_0259[] = "ServeRAID-5i";
+#endif
+static const char pci_device_1014_0302[] = "XA-32 chipset [Summit]";
+static const char pci_device_1014_ffff[] = "MPIC-2 interrupt controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1015[] = "LSI Logic Corp of Canada";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1016[] = "ICL Personal Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1017[] = "SPEA Software AG";
+static const char pci_device_1017_5343[] = "SPEA 3D Accelerator";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1018[] = "Unisys Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1019[] = "Elitegroup Computer Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_101a[] = "AT&T GIS (NCR)";
+static const char pci_device_101a_0005[] = "100VG ethernet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_101b[] = "Vitesse Semiconductor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_101c[] = "Western Digital";
+static const char pci_device_101c_0193[] = "33C193A";
+static const char pci_device_101c_0196[] = "33C196A";
+static const char pci_device_101c_0197[] = "33C197A";
+static const char pci_device_101c_0296[] = "33C296A";
+static const char pci_device_101c_3193[] = "7193";
+static const char pci_device_101c_3197[] = "7197";
+static const char pci_device_101c_3296[] = "33C296A";
+static const char pci_device_101c_4296[] = "34C296";
+static const char pci_device_101c_9710[] = "Pipeline 9710";
+static const char pci_device_101c_9712[] = "Pipeline 9712";
+static const char pci_device_101c_c24a[] = "90C";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_101e[] = "American Megatrends Inc.";
+static const char pci_device_101e_1960[] = "MegaRAID";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_101e_1960_101e_0471[] = "MegaRAID 471 Enterprise 1600 RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_101e_1960_101e_0475[] = "MegaRAID 475 Express 500 RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_101e_1960_101e_0493[] = "MegaRAID 493 Elite 1600 RAID Controller";
+#endif
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_101e_1960_1028_0471[] = "PowerEdge RAID Controller 3/QC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_101e_1960_1028_0475[] = "PowerEdge RAID Controller 3/SC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_101e_1960_1028_0493[] = "PowerEdge RAID Controller 3/DC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_101e_1960_1028_0511[] = "PowerEdge Cost Effective RAID Controller ATA100/4Ch";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_101e_9010[] = "MegaRAID 428 Ultra RAID Controller";
+static const char pci_device_101e_9030[] = "EIDE Controller";
+static const char pci_device_101e_9031[] = "EIDE Controller";
+static const char pci_device_101e_9032[] = "EIDE & SCSI Controller";
+static const char pci_device_101e_9033[] = "SCSI Controller";
+static const char pci_device_101e_9040[] = "Multimedia card";
+static const char pci_device_101e_9060[] = "MegaRAID 434 Ultra GT RAID Controller";
+static const char pci_device_101e_9063[] = "MegaRAC";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_101e_9063_101e_0767[] = "Dell Remote Assistant Card 2";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_101f[] = "PictureTel";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1020[] = "Hitachi Computer Products";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1021[] = "OKI Electric Industry Co. Ltd.";
+#endif
+static const char pci_vendor_1022[] = "Advanced Micro Devices [AMD]";
+static const char pci_device_1022_1100[] = "K8 NorthBridge";
+static const char pci_device_1022_1101[] = "K8 NorthBridge";
+static const char pci_device_1022_1102[] = "K8 NorthBridge";
+static const char pci_device_1022_1103[] = "K8 NorthBridge";
+static const char pci_device_1022_2000[] = "79c970 [PCnet32 LANCE]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_1014_2000[] = "NetFinity 10/100 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_103c_104c[] = "Ethernet with LAN remote power Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_103c_1064[] = "Ethernet with LAN remote power Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_103c_1065[] = "Ethernet with LAN remote power Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_103c_106c[] = "Ethernet with LAN remote power Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_103c_106e[] = "Ethernet with LAN remote power Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_103c_10ea[] = "Ethernet with LAN remote power Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_1113_1220[] = "EN1220 10/100 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_1259_2450[] = "AT-2450 10/100 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_1259_2454[] = "AT-2450v4 10Mb Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_1259_2700[] = "AT-2700TX 10/100 Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2000_1259_2701[] = "AT-2700FX 100Mb Ethernet";
+#endif
+static const char pci_device_1022_2001[] = "79c978 [HomePNA]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2001_1092_0a78[] = "Multimedia Home Network Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_2001_1668_0299[] = "ActionLink Home Network Adapter";
+#endif
+static const char pci_device_1022_2020[] = "53c974 [PCscsi]";
+static const char pci_device_1022_2040[] = "79c974";
+static const char pci_device_1022_3000[] = "ELanSC520 Microcontroller";
+static const char pci_device_1022_7006[] = "AMD-751 [Irongate] System Controller";
+static const char pci_device_1022_7007[] = "AMD-751 [Irongate] AGP Bridge";
+static const char pci_device_1022_700c[] = "AMD-760 MP [IGD4-2P] System Controller";
+static const char pci_device_1022_700d[] = "AMD-760 MP [IGD4-2P] AGP Bridge";
+static const char pci_device_1022_700e[] = "AMD-760 [IGD4-1P] System Controller";
+static const char pci_device_1022_700f[] = "AMD-760 [IGD4-1P] AGP Bridge";
+static const char pci_device_1022_7400[] = "AMD-755 [Cobra] ISA";
+static const char pci_device_1022_7401[] = "AMD-755 [Cobra] IDE";
+static const char pci_device_1022_7403[] = "AMD-755 [Cobra] ACPI";
+static const char pci_device_1022_7404[] = "AMD-755 [Cobra] USB";
+static const char pci_device_1022_7408[] = "AMD-756 [Viper] ISA";
+static const char pci_device_1022_7409[] = "AMD-756 [Viper] IDE";
+static const char pci_device_1022_740b[] = "AMD-756 [Viper] ACPI";
+static const char pci_device_1022_740c[] = "AMD-756 [Viper] USB";
+static const char pci_device_1022_7410[] = "AMD-766 [ViperPlus] ISA";
+static const char pci_device_1022_7411[] = "AMD-766 [ViperPlus] IDE";
+static const char pci_device_1022_7413[] = "AMD-766 [ViperPlus] ACPI";
+static const char pci_device_1022_7414[] = "AMD-766 [ViperPlus] USB";
+static const char pci_device_1022_7440[] = "AMD-768 [Opus] ISA";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_7440_1043_8044[] = "A7M-D Mainboard";
+#endif
+static const char pci_device_1022_7441[] = "AMD-768 [Opus] IDE";
+static const char pci_device_1022_7443[] = "AMD-768 [Opus] ACPI";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1022_7443_1043_8044[] = "A7M-D Mainboard";
+#endif
+static const char pci_device_1022_7445[] = "AMD-768 [Opus] Audio";
+static const char pci_device_1022_7446[] = "AMD-768 [Opus] MC97 Modem (Smart Link HAMR5600 compatible)";
+static const char pci_device_1022_7448[] = "AMD-768 [Opus] PCI";
+static const char pci_device_1022_7449[] = "AMD-768 [Opus] USB";
+static const char pci_device_1022_7450[] = "AMD-8131 PCI-X Bridge";
+static const char pci_device_1022_7451[] = "AMD-8131 PCI-X APIC";
+static const char pci_device_1022_7454[] = "AMD-8151 System Controller";
+static const char pci_device_1022_7455[] = "AMD-8151 AGP Bridge";
+static const char pci_device_1022_7460[] = "AMD-8111 PCI";
+static const char pci_device_1022_7461[] = "AMD-8111 USB";
+static const char pci_device_1022_7462[] = "AMD-8111 Ethernet";
+static const char pci_device_1022_7464[] = "AMD-8111 USB";
+static const char pci_device_1022_7468[] = "AMD-8111 LPC";
+static const char pci_device_1022_7469[] = "AMD-8111 IDE";
+static const char pci_device_1022_746a[] = "AMD-8111 SMBus 2.0";
+static const char pci_device_1022_746b[] = "AMD-8111 ACPI";
+static const char pci_device_1022_746d[] = "AMD-8111 AC97 Audio";
+static const char pci_device_1022_746e[] = "AMD-8111 MC97 Modem";
+static const char pci_vendor_1023[] = "Trident Microsystems";
+static const char pci_device_1023_0194[] = "82C194";
+static const char pci_device_1023_2000[] = "4DWave DX";
+static const char pci_device_1023_2001[] = "4DWave NX";
+static const char pci_device_1023_8400[] = "CyberBlade/i7";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_8400_1023_8400[] = "CyberBlade i7 AGP";
+#endif
+static const char pci_device_1023_8420[] = "CyberBlade/i7d";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_8420_0e11_b15a[] = "CyberBlade i7 AGP";
+#endif
+static const char pci_device_1023_8500[] = "CyberBlade/i1";
+static const char pci_device_1023_8520[] = "CyberBlade i1";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_8520_0e11_b16e[] = "CyberBlade i1 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_8520_1023_8520[] = "CyberBlade i1 AGP";
+#endif
+static const char pci_device_1023_8620[] = "CyberBlade/i1";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_8620_1014_0502[] = "ThinkPad T30";
+#endif
+static const char pci_device_1023_8820[] = "CyberBlade XPAi1";
+static const char pci_device_1023_9320[] = "TGUI 9320";
+static const char pci_device_1023_9350[] = "GUI Accelerator";
+static const char pci_device_1023_9360[] = "Flat panel GUI Accelerator";
+static const char pci_device_1023_9382[] = "Cyber 9382 [Reference design]";
+static const char pci_device_1023_9383[] = "Cyber 9383 [Reference design]";
+static const char pci_device_1023_9385[] = "Cyber 9385 [Reference design]";
+static const char pci_device_1023_9386[] = "Cyber 9386";
+static const char pci_device_1023_9388[] = "Cyber 9388";
+static const char pci_device_1023_9397[] = "Cyber 9397";
+static const char pci_device_1023_939a[] = "Cyber 9397DVD";
+static const char pci_device_1023_9420[] = "TGUI 9420";
+static const char pci_device_1023_9430[] = "TGUI 9430";
+static const char pci_device_1023_9440[] = "TGUI 9440";
+static const char pci_device_1023_9460[] = "TGUI 9460";
+static const char pci_device_1023_9470[] = "TGUI 9470";
+static const char pci_device_1023_9520[] = "Cyber 9520";
+static const char pci_device_1023_9525[] = "Cyber 9525";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_9525_10cf_1094[] = "Lifebook C6155";
+#endif
+static const char pci_device_1023_9540[] = "Cyber 9540";
+static const char pci_device_1023_9660[] = "TGUI 9660/938x/968x";
+static const char pci_device_1023_9680[] = "TGUI 9680";
+static const char pci_device_1023_9682[] = "TGUI 9682";
+static const char pci_device_1023_9683[] = "TGUI 9683";
+static const char pci_device_1023_9685[] = "ProVIDIA 9685";
+static const char pci_device_1023_9750[] = "3DImage 9750";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_9750_1014_9750[] = "3DImage 9750";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_9750_1023_9750[] = "3DImage 9750";
+#endif
+static const char pci_device_1023_9753[] = "TGUI 9753";
+static const char pci_device_1023_9754[] = "TGUI 9754";
+static const char pci_device_1023_9759[] = "TGUI 975";
+static const char pci_device_1023_9783[] = "TGUI 9783";
+static const char pci_device_1023_9785[] = "TGUI 9785";
+static const char pci_device_1023_9850[] = "3DImage 9850";
+static const char pci_device_1023_9880[] = "Blade 3D PCI/AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1023_9880_1023_9880[] = "Blade 3D";
+#endif
+static const char pci_device_1023_9910[] = "CyberBlade/XP";
+static const char pci_device_1023_9930[] = "CyberBlade/XPm";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1024[] = "Zenith Data Systems";
+#endif
+static const char pci_vendor_1025[] = "Acer Incorporated [ALI]";
+static const char pci_device_1025_1435[] = "M1435";
+static const char pci_device_1025_1445[] = "M1445";
+static const char pci_device_1025_1449[] = "M1449";
+static const char pci_device_1025_1451[] = "M1451";
+static const char pci_device_1025_1461[] = "M1461";
+static const char pci_device_1025_1489[] = "M1489";
+static const char pci_device_1025_1511[] = "M1511";
+static const char pci_device_1025_1512[] = "ALI M1512 Aladdin";
+static const char pci_device_1025_1513[] = "M1513";
+static const char pci_device_1025_1521[] = "ALI M1521 Aladdin III CPU Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1025_1521_10b9_1521[] = "ALI M1521 Aladdin III CPU Bridge";
+#endif
+static const char pci_device_1025_1523[] = "ALI M1523 ISA Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1025_1523_10b9_1523[] = "ALI M1523 ISA Bridge";
+#endif
+static const char pci_device_1025_1531[] = "M1531 Northbridge [Aladdin IV/IV+]";
+static const char pci_device_1025_1533[] = "M1533 PCI-to-ISA Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1025_1533_10b9_1533[] = "ALI M1533 Aladdin IV/V ISA South Bridge";
+#endif
+static const char pci_device_1025_1535[] = "M1535 PCI Bridge + Super I/O + FIR";
+static const char pci_device_1025_1541[] = "M1541 Northbridge [Aladdin V]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1025_1541_10b9_1541[] = "ALI M1541 Aladdin V/V+ AGP+PCI North Bridge";
+#endif
+static const char pci_device_1025_1542[] = "M1542 Northbridge [Aladdin V]";
+static const char pci_device_1025_1543[] = "M1543 PCI-to-ISA Bridge + Super I/O + FIR";
+static const char pci_device_1025_1561[] = "M1561 Northbridge [Aladdin 7]";
+static const char pci_device_1025_1621[] = "M1621 Northbridge [Aladdin-Pro II]";
+static const char pci_device_1025_1631[] = "M1631 Northbridge+3D Graphics [Aladdin TNT2]";
+static const char pci_device_1025_1641[] = "M1641 Northbridge [Aladdin-Pro IV]";
+static const char pci_device_1025_1647[] = "M1647 [MaGiK1] PCI North Bridge";
+static const char pci_device_1025_3141[] = "M3141";
+static const char pci_device_1025_3143[] = "M3143";
+static const char pci_device_1025_3145[] = "M3145";
+static const char pci_device_1025_3147[] = "M3147";
+static const char pci_device_1025_3149[] = "M3149";
+static const char pci_device_1025_3151[] = "M3151";
+static const char pci_device_1025_3307[] = "M3307 MPEG-I Video Controller";
+static const char pci_device_1025_3309[] = "M3309 MPEG-II Video w/ Software Audio Decoder";
+static const char pci_device_1025_3321[] = "M3321 MPEG-II Audio/Video Decoder";
+static const char pci_device_1025_5212[] = "M4803";
+static const char pci_device_1025_5215[] = "ALI PCI EIDE Controller";
+static const char pci_device_1025_5217[] = "M5217H";
+static const char pci_device_1025_5219[] = "M5219";
+static const char pci_device_1025_5225[] = "M5225";
+static const char pci_device_1025_5229[] = "M5229";
+static const char pci_device_1025_5235[] = "M5235";
+static const char pci_device_1025_5237[] = "M5237 PCI USB Host Controller";
+static const char pci_device_1025_5240[] = "EIDE Controller";
+static const char pci_device_1025_5241[] = "PCMCIA Bridge";
+static const char pci_device_1025_5242[] = "General Purpose Controller";
+static const char pci_device_1025_5243[] = "PCI to PCI Bridge Controller";
+static const char pci_device_1025_5244[] = "Floppy Disk Controller";
+static const char pci_device_1025_5247[] = "M1541 PCI to PCI Bridge";
+static const char pci_device_1025_5251[] = "M5251 P1394 Controller";
+static const char pci_device_1025_5427[] = "PCI to AGP Bridge";
+static const char pci_device_1025_5451[] = "M5451 PCI AC-Link Controller Audio Device";
+static const char pci_device_1025_5453[] = "M5453 PCI AC-Link Controller Modem Device";
+static const char pci_device_1025_7101[] = "M7101 PCI PMU Power Management Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1025_7101_10b9_7101[] = "M7101 PCI PMU Power Management Controller";
+#endif
+static const char pci_vendor_1028[] = "Dell Computer Corporation";
+static const char pci_device_1028_0001[] = "PowerEdge Expandable RAID Controller 2/Si";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_0001_1028_0001[] = "PowerEdge Expandable RAID Controller 2/Si";
+#endif
+static const char pci_device_1028_0002[] = "PowerEdge Expandable RAID Controller 3";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_0002_1028_0002[] = "PowerEdge Expandable RAID Controller 3/Di";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_0002_1028_00d1[] = "PowerEdge Expandable RAID Controller 3/Di";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_0002_1028_00d9[] = "PowerEdge Expandable RAID Controller 3/Di";
+#endif
+static const char pci_device_1028_0003[] = "PowerEdge Expandable RAID Controller 3/Si";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_0003_1028_0003[] = "PowerEdge Expandable RAID Controller 3/Si";
+#endif
+static const char pci_device_1028_0004[] = "PowerEdge Expandable RAID Controller 3/Si";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_0004_1028_00d0[] = "PowerEdge Expandable RAID Controller 3/Si";
+#endif
+static const char pci_device_1028_0005[] = "PowerEdge Expandable RAID Controller 3/Di";
+static const char pci_device_1028_0006[] = "PowerEdge Expandable RAID Controller 3/Di";
+static const char pci_device_1028_0007[] = "Remote Assistant Card 3";
+static const char pci_device_1028_0008[] = "PowerEdge Expandable RAID Controller 3/Di";
+static const char pci_device_1028_000a[] = "PowerEdge Expandable RAID Controller 3";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_000a_1028_0106[] = "PowerEdge Expandable RAID Controller 3/Di";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_000a_1028_011b[] = "PowerEdge Expandable RAID Controller 3/Di";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1028_000a_1028_0121[] = "PowerEdge Expandable RAID Controller 3/Di";
+#endif
+static const char pci_device_1028_000c[] = "Embedded Systems Management Device 4";
+static const char pci_device_1028_000e[] = "PowerEdge Expandable RAID Controller";
+static const char pci_device_1028_000f[] = "PowerEdge Expandable RAID Controller 4/Di";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1029[] = "Siemens Nixdorf IS";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_102a[] = "LSI Logic";
+static const char pci_device_102a_0000[] = "HYDRA";
+static const char pci_device_102a_0010[] = "ASPEN";
+#endif
+static const char pci_vendor_102b[] = "Matrox Graphics, Inc.";
+static const char pci_device_102b_0010[] = "MGA-I [Impression?]";
+static const char pci_device_102b_0518[] = "MGA-II [Athena]";
+static const char pci_device_102b_0519[] = "MGA 2064W [Millennium]";
+static const char pci_device_102b_051a[] = "MGA 1064SG [Mystique]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_051a_102b_0100[] = "MGA-1064SG Mystique";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_051a_102b_1100[] = "MGA-1084SG Mystique";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_051a_102b_1200[] = "MGA-1084SG Mystique";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_051a_1100_102b[] = "MGA-1084SG Mystique";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_051a_110a_0018[] = "Scenic Pro C5 (D1025)";
+#endif
+static const char pci_device_102b_051b[] = "MGA 2164W [Millennium II]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_051b_102b_051b[] = "MGA-2164W Millennium II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_051b_102b_1100[] = "MGA-2164W Millennium II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_051b_102b_1200[] = "MGA-2164W Millennium II";
+#endif
+static const char pci_device_102b_051e[] = "MGA 1064SG [Mystique] AGP";
+static const char pci_device_102b_051f[] = "MGA 2164W [Millennium II] AGP";
+static const char pci_device_102b_0520[] = "MGA G200";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0520_102b_dbc2[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0520_102b_dbc8[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0520_102b_dbe2[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0520_102b_dbe8[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0520_102b_ff03[] = "Millennium G200 SD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0520_102b_ff04[] = "Marvel G200";
+#endif
+static const char pci_device_102b_0521[] = "MGA G200 AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_1014_ff03[] = "Millennium G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_48e9[] = "Mystique G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_48f8[] = "Millennium G200 SD AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_4a60[] = "Millennium G200 LE AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_4a64[] = "Millennium G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_c93c[] = "Millennium G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_c9b0[] = "Millennium G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_c9bc[] = "Millennium G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_ca60[] = "Millennium G250 LE AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_ca6c[] = "Millennium G250 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbbc[] = "Millennium G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbc2[] = "Millennium G200 MMS (Dual G200)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbc3[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbc8[] = "Millennium G200 MMS (Dual G200)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbd2[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbd3[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbd4[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbd5[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbd8[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbd9[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbe2[] = "Millennium G200 MMS (Quad G200)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbe3[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbe8[] = "Millennium G200 MMS (Quad G200)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbf2[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbf3[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbf4[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbf5[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbf8[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_dbf9[] = "G200 Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_f806[] = "Mystique G200 Video AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_ff00[] = "MGA-G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_ff02[] = "Mystique G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_ff03[] = "Millennium G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_102b_ff04[] = "Marvel G200 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0521_110a_0032[] = "MGA-G200 AGP";
+#endif
+static const char pci_device_102b_0525[] = "MGA G400 AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_0e11_b16f[] = "MGA-G400 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0328[] = "Millennium G400 16Mb SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0338[] = "Millennium G400 16Mb SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0378[] = "Millennium G400 32Mb SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0541[] = "Millennium G450 Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0542[] = "Millennium G450 Dual Head LX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0543[] = "Millennium G450 Single Head LX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0641[] = "Millennium G450 32Mb SDRAM Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0642[] = "Millennium G450 32Mb SDRAM Dual Head LX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0643[] = "Millennium G450 32Mb SDRAM Single Head LX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_07c0[] = "Millennium G450 Dual Head LE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_07c1[] = "Millennium G450 SDR Dual Head LE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0d41[] = "Millennium G450 Dual Head PCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0d42[] = "Millennium G450 Dual Head LX PCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0e00[] = "Marvel G450 eTV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0e01[] = "Marvel G450 eTV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0e02[] = "Marvel G450 eTV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0e03[] = "Marvel G450 eTV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0f80[] = "Millennium G450 Low Profile";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0f81[] = "Millennium G450 Low Profile";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0f82[] = "Millennium G450 Low Profile DVI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_0f83[] = "Millennium G450 Low Profile DVI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_19d8[] = "Millennium G400 16Mb SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_19f8[] = "Millennium G400 32Mb SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_2159[] = "Millennium G400 Dual Head 16Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_2179[] = "Millennium G400 MAX/Dual Head 32Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_217d[] = "Millennium G400 Dual Head Max";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_23c0[] = "Millennium G450";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_23c1[] = "Millennium G450";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_23c2[] = "Millennium G450 DVI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_23c3[] = "Millennium G450 DVI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_2f58[] = "Millennium G400";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_2f78[] = "Millennium G400";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_3693[] = "Marvel G400 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_5dd0[] = "4Sight II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_5f50[] = "4Sight II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_5f51[] = "4Sight II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_5f52[] = "4Sight II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_102b_9010[] = "Millennium G400 Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_1458_0400[] = "GA-G400";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_1705_0001[] = "Millennium G450 32MB SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_1705_0002[] = "Millennium G450 16MB SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_1705_0003[] = "Millennium G450 32MB";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0525_1705_0004[] = "Millennium G450 16MB";
+#endif
+static const char pci_device_102b_0527[] = "MGA Parhelia AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_0527_102b_0840[] = "Parhelia 128Mb";
+#endif
+static const char pci_device_102b_0d10[] = "MGA Ultima/Impression";
+static const char pci_device_102b_1000[] = "MGA G100 [Productiva]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1000_102b_ff01[] = "Productiva G100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1000_102b_ff05[] = "Productiva G100 Multi-Monitor";
+#endif
+static const char pci_device_102b_1001[] = "MGA G100 [Productiva] AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1001_102b_1001[] = "MGA-G100 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1001_102b_ff00[] = "MGA-G100 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1001_102b_ff01[] = "MGA-G100 Productiva AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1001_102b_ff03[] = "Millennium G100 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1001_102b_ff04[] = "MGA-G100 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1001_102b_ff05[] = "MGA-G100 Productiva AGP Multi-Monitor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_1001_110a_001e[] = "MGA-G100 AGP";
+#endif
+static const char pci_device_102b_2007[] = "MGA Mistral";
+static const char pci_device_102b_2527[] = "MGA G550 AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_2527_102b_0f83[] = "Millennium G550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_2527_102b_0f84[] = "Millennium G550 Dual Head DDR 32Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102b_2527_102b_1e41[] = "Millennium G550";
+#endif
+static const char pci_device_102b_4536[] = "VIA Framegrabber";
+static const char pci_device_102b_6573[] = "Shark 10/100 Multiport SwitchNIC";
+static const char pci_vendor_102c[] = "Chips and Technologies";
+static const char pci_device_102c_00b8[] = "F64310";
+static const char pci_device_102c_00c0[] = "F69000 HiQVideo";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102c_00c0_102c_00c0[] = "F69000 HiQVideo";
+#endif
+static const char pci_device_102c_00d0[] = "F65545";
+static const char pci_device_102c_00d8[] = "F65545";
+static const char pci_device_102c_00dc[] = "F65548";
+static const char pci_device_102c_00e0[] = "F65550";
+static const char pci_device_102c_00e4[] = "F65554";
+static const char pci_device_102c_00e5[] = "F65555 HiQVPro";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102c_00e5_0e11_b049[] = "Armada 1700 Laptop Display Controller";
+#endif
+static const char pci_device_102c_00f0[] = "F68554";
+static const char pci_device_102c_00f4[] = "F68554 HiQVision";
+static const char pci_device_102c_00f5[] = "F68555";
+static const char pci_device_102c_0c30[] = "F69030";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_102d[] = "Wyse Technology Inc.";
+static const char pci_device_102d_50dc[] = "3328 Audio";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_102e[] = "Olivetti Advanced Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_102f[] = "Toshiba America";
+static const char pci_device_102f_0009[] = "r4x00";
+static const char pci_device_102f_0020[] = "ATM Meteor 155";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_102f_0020_102f_00f8[] = "ATM Meteor 155";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1030[] = "TMC Research";
+#endif
+static const char pci_vendor_1031[] = "Miro Computer Products AG";
+static const char pci_device_1031_5601[] = "DC20 ASIC";
+static const char pci_device_1031_5607[] = "Video I/O & motion JPEG compressor";
+static const char pci_device_1031_5631[] = "Media 3D";
+static const char pci_device_1031_6057[] = "MiroVideo DC10/DC30+";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1032[] = "Compaq";
+#endif
+static const char pci_vendor_1033[] = "NEC Corporation";
+static const char pci_device_1033_0001[] = "PCI to 486-like bus Bridge";
+static const char pci_device_1033_0002[] = "PCI to VL98 Bridge";
+static const char pci_device_1033_0003[] = "ATM Controller";
+static const char pci_device_1033_0004[] = "R4000 PCI Bridge";
+static const char pci_device_1033_0005[] = "PCI to 486-like bus Bridge";
+static const char pci_device_1033_0006[] = "PC-9800 Graphic Accelerator";
+static const char pci_device_1033_0007[] = "PCI to UX-Bus Bridge";
+static const char pci_device_1033_0008[] = "PC-9800 Graphic Accelerator";
+static const char pci_device_1033_0009[] = "PCI to PC9800 Core-Graph Bridge";
+static const char pci_device_1033_0016[] = "PCI to VL Bridge";
+static const char pci_device_1033_001a[] = "[Nile II]";
+static const char pci_device_1033_0021[] = "Vrc4373 [Nile I]";
+static const char pci_device_1033_0029[] = "PowerVR PCX1";
+static const char pci_device_1033_002a[] = "PowerVR 3D";
+static const char pci_device_1033_002c[] = "Star Alpha 2";
+static const char pci_device_1033_002d[] = "PCI to C-bus Bridge";
+static const char pci_device_1033_0035[] = "USB";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0035_1179_0001[] = "USB";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0035_12ee_7000[] = "Root Hub";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0035_1799_0001[] = "Root Hub";
+#endif
+static const char pci_device_1033_003b[] = "PCI to C-bus Bridge";
+static const char pci_device_1033_003e[] = "NAPCCARD Cardbus Controller";
+static const char pci_device_1033_0046[] = "PowerVR PCX2 [midas]";
+static const char pci_device_1033_005a[] = "Vrc5074 [Nile 4]";
+static const char pci_device_1033_0063[] = "Firewarden";
+static const char pci_device_1033_0067[] = "PowerVR Neon 250 Chipset";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0067_1010_0020[] = "PowerVR Neon 250 AGP 32Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0067_1010_0080[] = "PowerVR Neon 250 AGP 16Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0067_1010_0088[] = "PowerVR Neon 250 16Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0067_1010_0090[] = "PowerVR Neon 250 AGP 16Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0067_1010_0098[] = "PowerVR Neon 250 16Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0067_1010_00a0[] = "PowerVR Neon 250 AGP 32Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0067_1010_00a8[] = "PowerVR Neon 250 32Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0067_1010_0120[] = "PowerVR Neon 250 AGP 32Mb";
+#endif
+static const char pci_device_1033_0074[] = "56k Voice Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_0074_1033_8014[] = "RCV56ACF 56k Voice Modem";
+#endif
+static const char pci_device_1033_009b[] = "Vrc5476";
+static const char pci_device_1033_00a6[] = "VRC5477 AC97";
+static const char pci_device_1033_00cd[] = "IEEE 1394 [OrangeLink] Host Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_00cd_12ee_8011[] = "Root hub";
+#endif
+static const char pci_device_1033_00e0[] = "USB 2.0";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_00e0_12ee_7001[] = "Root hub";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1033_00e0_1799_0002[] = "Root Hub";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1034[] = "Framatome Connectors USA Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1035[] = "Comp. & Comm. Research Lab";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1036[] = "Future Domain Corp.";
+static const char pci_device_1036_0000[] = "TMC-18C30 [36C70]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1037[] = "Hitachi Micro Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1038[] = "AMP, Inc";
+#endif
+static const char pci_vendor_1039[] = "Silicon Integrated Systems [SiS]";
+static const char pci_device_1039_0001[] = "SiS 530 Virtual PCI-to-PCI bridge (AGP)";
+static const char pci_device_1039_0002[] = "SG86C202";
+static const char pci_device_1039_0006[] = "85C501/2/3";
+static const char pci_device_1039_0008[] = "85C503/5513";
+static const char pci_device_1039_0009[] = "ACPI";
+static const char pci_device_1039_0018[] = "SiS85C503/5513 (LPC Bridge)";
+static const char pci_device_1039_0200[] = "5597/5598/6326 VGA";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_0200_1039_0000[] = "SiS5597 SVGA (Shared RAM)";
+#endif
+static const char pci_device_1039_0204[] = "82C204";
+static const char pci_device_1039_0205[] = "SG86C205";
+static const char pci_device_1039_0300[] = "SiS300/305 PCI/AGP VGA Display Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_0300_107d_2720[] = "Leadtek WinFast VR300";
+#endif
+static const char pci_device_1039_0310[] = "SiS315H PCI/AGP VGA Display Adapter";
+static const char pci_device_1039_0315[] = "SiS315 PCI/AGP VGA Display Adapter";
+static const char pci_device_1039_0325[] = "SiS315PRO PCI/AGP VGA Display Adapter";
+static const char pci_device_1039_0330[] = "SiS330 [Xabre] PCI/AGP VGA Display Adapter";
+static const char pci_device_1039_0406[] = "85C501/2";
+static const char pci_device_1039_0496[] = "85C496";
+static const char pci_device_1039_0530[] = "530 Host";
+static const char pci_device_1039_0540[] = "540 Host";
+static const char pci_device_1039_0597[] = "5513C";
+static const char pci_device_1039_0601[] = "85C601";
+static const char pci_device_1039_0620[] = "620 Host";
+static const char pci_device_1039_0630[] = "630 Host";
+static const char pci_device_1039_0633[] = "633 Host";
+static const char pci_device_1039_0635[] = "635 Host";
+static const char pci_device_1039_0645[] = "SiS645 Host & Memory & AGP Controller";
+static const char pci_device_1039_0646[] = "SiS645DX Host & Memory & AGP Controller";
+static const char pci_device_1039_0650[] = "650 Host";
+static const char pci_device_1039_0651[] = "SiS651 Host";
+static const char pci_device_1039_0730[] = "730 Host";
+static const char pci_device_1039_0733[] = "733 Host";
+static const char pci_device_1039_0735[] = "735 Host";
+static const char pci_device_1039_0740[] = "740 Host";
+static const char pci_device_1039_0745[] = "745 Host";
+static const char pci_device_1039_0900[] = "SiS900 10/100 Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_0900_1039_0900[] = "SiS900 10/100 Ethernet Adapter";
+#endif
+static const char pci_device_1039_0961[] = "SiS961 [MuTIOL Media IO]";
+static const char pci_device_1039_0962[] = "SiS962 [MuTIOL Media IO]";
+static const char pci_device_1039_3602[] = "83C602";
+static const char pci_device_1039_5107[] = "5107";
+static const char pci_device_1039_5300[] = "SiS540 PCI Display Adapter";
+static const char pci_device_1039_5315[] = "SiS550 AGP/VGA VGA Display Adapter";
+static const char pci_device_1039_5401[] = "486 PCI Chipset";
+static const char pci_device_1039_5511[] = "5511/5512";
+static const char pci_device_1039_5513[] = "5513 [IDE]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_5513_1019_0970[] = "P6STP-FL motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_5513_1039_5513[] = "SiS5513 EIDE Controller (A,B step)";
+#endif
+static const char pci_device_1039_5517[] = "5517";
+static const char pci_device_1039_5571[] = "5571";
+static const char pci_device_1039_5581[] = "5581 Pentium Chipset";
+static const char pci_device_1039_5582[] = "5582";
+static const char pci_device_1039_5591[] = "5591/5592 Host";
+static const char pci_device_1039_5596[] = "5596 Pentium Chipset";
+static const char pci_device_1039_5597[] = "5597 [SiS5582]";
+static const char pci_device_1039_5600[] = "5600 Host";
+static const char pci_device_1039_6204[] = "Video decoder & MPEG interface";
+static const char pci_device_1039_6205[] = "VGA Controller";
+static const char pci_device_1039_6236[] = "6236 3D-AGP";
+static const char pci_device_1039_6300[] = "SiS630 GUI Accelerator+3D";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_6300_1019_0970[] = "P6STP-FL motherboard";
+#endif
+static const char pci_device_1039_6306[] = "SiS530 3D PCI/AGP";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_6306_1039_6306[] = "SiS530,620 GUI Accelerator+3D";
+#endif
+static const char pci_device_1039_6325[] = "SiS650/651/M650/740 PCI/AGP VGA Display Adapter";
+static const char pci_device_1039_6326[] = "86C326 5598/6326";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_6326_1039_6326[] = "SiS6326 GUI Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_6326_1092_0a50[] = "SpeedStar A50";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_6326_1092_0a70[] = "SpeedStar A70";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_6326_1092_4910[] = "SpeedStar A70";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_6326_1092_4920[] = "SpeedStar A70";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_6326_1569_6326[] = "SiS6326 GUI Accelerator";
+#endif
+static const char pci_device_1039_7001[] = "SiS7001 USB Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7001_1039_7000[] = "Onboard USB Controller";
+#endif
+static const char pci_device_1039_7002[] = "SiS7002 USB 2.0";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7002_1509_7002[] = "Onboard USB Controller";
+#endif
+static const char pci_device_1039_7007[] = "FireWire Controller";
+static const char pci_device_1039_7012[] = "SiS7012 PCI Audio Accelerator";
+static const char pci_device_1039_7013[] = "Intel 537 [56k Winmodem]";
+static const char pci_device_1039_7016[] = "SiS7016 10/100 Ethernet Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7016_1039_7016[] = "SiS7016 10/100 Ethernet Adapter";
+#endif
+static const char pci_device_1039_7018[] = "SiS PCI Audio Accelerator";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1014_01b6[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1014_01b7[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1019_7018[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1025_000e[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1025_0018[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1039_7018[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1043_800b[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1054_7018[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_107d_5330[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_107d_5350[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1170_3209[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1462_400a[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_14a4_2089[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_14cd_2194[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_14ff_1100[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_152d_8808[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1558_1103[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1558_2200[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_1563_7018[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_15c5_0111[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_270f_a171[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1039_7018_a0a0_0022[] = "SiS PCI Audio Accelerator";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_103a[] = "Seiko Epson Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_103b[] = "Tatung Co. of America";
+#endif
+static const char pci_vendor_103c[] = "Hewlett-Packard Company";
+static const char pci_device_103c_1005[] = "A4977A Visualize EG";
+static const char pci_device_103c_1006[] = "Visualize FX6";
+static const char pci_device_103c_1008[] = "Visualize FX4";
+static const char pci_device_103c_100a[] = "Visualize FX2";
+static const char pci_device_103c_1028[] = "Tach TL Fibre Channel Host Adapter";
+static const char pci_device_103c_1029[] = "Tach XL2 Fibre Channel Host Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1029_107e_000f[] = "Interphase 5560 Fibre Channel Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1029_9004_9210[] = "1Gb/2Gb Family Fibre Channel Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1029_9004_9211[] = "1Gb/2Gb Family Fibre Channel Controller";
+#endif
+static const char pci_device_103c_102a[] = "Tach TS Fibre Channel Host Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_102a_107e_000e[] = "Interphase 5540/5541 Fibre Channel Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_102a_9004_9110[] = "1Gb/2Gb Family Fibre Channel Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_102a_9004_9111[] = "1Gb/2Gb Family Fibre Channel Controller";
+#endif
+static const char pci_device_103c_1030[] = "J2585A DeskDirect 10/100VG NIC";
+static const char pci_device_103c_1031[] = "J2585B HP 10/100VG PCI LAN Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1031_103c_1040[] = "J2973A DeskDirect 10BaseT NIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1031_103c_1041[] = "J2585B DeskDirect 10/100VG NIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1031_103c_1042[] = "J2970A DeskDirect 10BaseT/2 NIC";
+#endif
+static const char pci_device_103c_1040[] = "J2973A DeskDirect 10BaseT NIC";
+static const char pci_device_103c_1041[] = "J2585B DeskDirect 10/100 NIC";
+static const char pci_device_103c_1042[] = "J2970A DeskDirect 10BaseT/2 NIC";
+static const char pci_device_103c_1048[] = "Diva Serial [GSP] Multiport UART";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1048_103c_1049[] = "Tosca Console";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1048_103c_104a[] = "Tosca Secondary";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1048_103c_104b[] = "Maestro SP2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1048_103c_1223[] = "Halfdome Console";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1048_103c_1226[] = "Keystone SP2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1048_103c_1227[] = "Powerbar SP2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_103c_1048_103c_1282[] = "Everest SP2";
+#endif
+static const char pci_device_103c_1064[] = "79C970 PCnet Ethernet Controller";
+static const char pci_device_103c_108b[] = "Visualize FXe";
+static const char pci_device_103c_10c1[] = "NetServer Smart IRQ Router";
+static const char pci_device_103c_10ed[] = "TopTools Remote Control";
+static const char pci_device_103c_1200[] = "82557B 10/100 NIC";
+static const char pci_device_103c_1219[] = "NetServer PCI Hot-Plug Controller";
+static const char pci_device_103c_121a[] = "NetServer SMIC Controller";
+static const char pci_device_103c_121b[] = "NetServer Legacy COM Port Decoder";
+static const char pci_device_103c_121c[] = "NetServer PCI COM Port Decoder";
+static const char pci_device_103c_1229[] = "zx1 System Bus Adapter";
+static const char pci_device_103c_122a[] = "zx1 I/O Controller";
+static const char pci_device_103c_122e[] = "zx1 Local Bus Adapter";
+static const char pci_device_103c_1290[] = "Auxiliary Diva Serial Port";
+static const char pci_device_103c_2910[] = "E2910A PCIBus Exerciser";
+static const char pci_device_103c_2925[] = "E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_103e[] = "Solliday Engineering";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_103f[] = "Synopsys/Logic Modeling Group";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1040[] = "Accelgraphics Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1041[] = "Computrend";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1042[] = "Micron";
+static const char pci_device_1042_1000[] = "FDC 37C665";
+static const char pci_device_1042_1001[] = "37C922";
+static const char pci_device_1042_3000[] = "Samurai_0";
+static const char pci_device_1042_3010[] = "Samurai_1";
+static const char pci_device_1042_3020[] = "Samurai_IDE";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1043[] = "Asustek Computer, Inc.";
+static const char pci_device_1043_0675[] = "ISDNLink P-IN100-ST-D";
+static const char pci_device_1043_4021[] = "v7100 Combo Deluxe [GeForce2 MX + TV tuner]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1044[] = "Distributed Processing Technology";
+static const char pci_device_1044_1012[] = "Domino RAID Engine";
+static const char pci_device_1044_a400[] = "SmartCache/Raid I-IV Controller";
+static const char pci_device_1044_a500[] = "PCI Bridge";
+static const char pci_device_1044_a501[] = "SmartRAID V Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c001[] = "PM1554U2 Ultra2 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c002[] = "PM1654U2 Ultra2 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c003[] = "PM1564U3 Ultra3 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c004[] = "PM1564U3 Ultra3 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c005[] = "PM1554U2 Ultra2 Single Channel (NON ACPI)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c00a[] = "PM2554U2 Ultra2 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c00b[] = "PM2654U2 Ultra2 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c00c[] = "PM2664U3 Ultra3 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c00d[] = "PM2664U3 Ultra3 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c00e[] = "PM2554U2 Ultra2 Single Channel (NON ACPI)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c00f[] = "PM2654U2 Ultra2 Single Channel (NON ACPI)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c014[] = "PM3754U2 Ultra2 Single Channel (NON ACPI)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c015[] = "PM3755U2B Ultra2 Single Channel (NON ACPI)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c016[] = "PM3755F Fibre Channel (NON ACPI)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c01e[] = "PM3757U2 Ultra2 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c01f[] = "PM3757U2 Ultra2 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c020[] = "PM3767U3 Ultra3 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c021[] = "PM3767U3 Ultra3 Quad Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c028[] = "PM2865U3 Ultra3 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c029[] = "PM2865U3 Ultra3 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c02a[] = "PM2865F Fibre Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c03c[] = "2000S Ultra3 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c03d[] = "2000S Ultra3 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c03e[] = "2000F Fibre Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c046[] = "3000S Ultra3 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c047[] = "3000S Ultra3 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c048[] = "3000F Fibre Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c050[] = "5000S Ultra3 Single Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c051[] = "5000S Ultra3 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c052[] = "5000F Fibre Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c05a[] = "2400A UDMA Four Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c05b[] = "2400A UDMA Four Channel DAC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c064[] = "3010S Ultra3 Dual Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c065[] = "3010S Ultra3 Four Channel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1044_a501_1044_c066[] = "3010S Fibre Channel";
+#endif
+static const char pci_device_1044_a511[] = "SmartRAID V Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1045[] = "OPTi Inc.";
+static const char pci_device_1045_a0f8[] = "82C750 [Vendetta] USB Controller";
+static const char pci_device_1045_c101[] = "92C264";
+static const char pci_device_1045_c178[] = "92C178";
+static const char pci_device_1045_c556[] = "82X556 [Viper]";
+static const char pci_device_1045_c557[] = "82C557 [Viper-M]";
+static const char pci_device_1045_c558[] = "82C558 [Viper-M ISA+IDE]";
+static const char pci_device_1045_c567[] = "82C750 [Vendetta], device 0";
+static const char pci_device_1045_c568[] = "82C750 [Vendetta], device 1";
+static const char pci_device_1045_c569[] = "82C579 [Viper XPress+ Chipset]";
+static const char pci_device_1045_c621[] = "82C621 [Viper-M/N+]";
+static const char pci_device_1045_c700[] = "82C700 [FireStar]";
+static const char pci_device_1045_c701[] = "82C701 [FireStar Plus]";
+static const char pci_device_1045_c814[] = "82C814 [Firebridge 1]";
+static const char pci_device_1045_c822[] = "82C822";
+static const char pci_device_1045_c824[] = "82C824";
+static const char pci_device_1045_c825[] = "82C825 [Firebridge 2]";
+static const char pci_device_1045_c832[] = "82C832";
+static const char pci_device_1045_c861[] = "82C861";
+static const char pci_device_1045_c895[] = "82C895";
+static const char pci_device_1045_c935[] = "EV1935 ECTIVA MachOne PCI Audio";
+static const char pci_device_1045_d568[] = "82C825 [Firebridge 2]";
+static const char pci_device_1045_d721[] = "IDE [FireStar]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1046[] = "IPC Corporation, Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1047[] = "Genoa Systems Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1048[] = "Elsa AG";
+static const char pci_device_1048_0d22[] = "Quadro4 900XGL [ELSA GLoria4 900XGL]";
+static const char pci_device_1048_1000[] = "QuickStep 1000";
+static const char pci_device_1048_3000[] = "QuickStep 3000";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1049[] = "Fountain Technologies, Inc.";
+#endif
+static const char pci_vendor_104a[] = "SGS Thomson Microelectronics";
+static const char pci_device_104a_0008[] = "STG 2000X";
+static const char pci_device_104a_0009[] = "STG 1764X";
+static const char pci_device_104a_0010[] = "STG4000 [3D Prophet Kyro Series]";
+static const char pci_device_104a_0210[] = "STPC Atlas ISA Bridge";
+static const char pci_device_104a_0981[] = "DEC-Tulip compatible 10/100 Ethernet";
+static const char pci_device_104a_1746[] = "STG 1764X";
+static const char pci_device_104a_2774[] = "DEC-Tulip compatible 10/100 Ethernet";
+static const char pci_device_104a_3520[] = "MPEG-II decoder card";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_104b[] = "BusLogic";
+static const char pci_device_104b_0140[] = "BT-946C (old) [multimaster 01]";
+static const char pci_device_104b_1040[] = "BT-946C (BA80C30) [MultiMaster 10]";
+static const char pci_device_104b_8130[] = "Flashpoint LT";
+#endif
+static const char pci_vendor_104c[] = "Texas Instruments";
+static const char pci_device_104c_0500[] = "100 MBit LAN Controller";
+static const char pci_device_104c_0508[] = "TMS380C2X Compressor Interface";
+static const char pci_device_104c_1000[] = "Eagle i/f AS";
+static const char pci_device_104c_104c[] = "PCI1510 PC card Cardbus Controller";
+static const char pci_device_104c_3d04[] = "TVP4010 [Permedia]";
+static const char pci_device_104c_3d07[] = "TVP4020 [Permedia 2]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1011_4d10[] = "Comet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1040_000f[] = "AccelStar II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1040_0011[] = "AccelStar II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1048_0a31[] = "WINNER 2000";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1048_0a32[] = "GLoria Synergy";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1048_0a35[] = "GLoria Synergy";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_107d_2633[] = "WinFast 3D L2300";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0127[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0136[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0141[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0146[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0148[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0149[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0152[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0154[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0155[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0156[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1092_0157[] = "FIRE GL 1000 PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1097_3d01[] = "Jeronimo Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_1102_100f[] = "Graphics Blaster Extreme";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_3d07_3d3d_0100[] = "Reference Permedia 2 3D";
+#endif
+static const char pci_device_104c_8000[] = "PCILynx/PCILynx2 IEEE 1394 Link Layer Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8000_e4bf_1010[] = "CF1-1-SNARE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8000_e4bf_1020[] = "CF1-2-SNARE";
+#endif
+static const char pci_device_104c_8009[] = "FireWire Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8009_104d_8032[] = "8032 OHCI i.LINK (IEEE 1394) Controller";
+#endif
+static const char pci_device_104c_8017[] = "PCI4410 FireWire Controller";
+static const char pci_device_104c_8019[] = "TSB12LV23 IEEE-1394 Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8019_11bd_000a[] = "Studio DV500-1394";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8019_11bd_000e[] = "Studio DV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8019_e4bf_1010[] = "CF2-1-CYMBAL";
+#endif
+static const char pci_device_104c_8020[] = "TSB12LV26 IEEE-1394 Controller (Link)";
+static const char pci_device_104c_8021[] = "TSB43AA22 IEEE-1394 Controller (PHY/Link Integrated)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8021_104d_80df[] = "Vaio PCG-FX403";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8021_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+static const char pci_device_104c_8022[] = "TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link)";
+static const char pci_device_104c_8023[] = "TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)";
+static const char pci_device_104c_8024[] = "TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)";
+static const char pci_device_104c_8026[] = "TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)";
+static const char pci_device_104c_8027[] = "PCI4451 IEEE-1394 Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_8027_1028_00e6[] = "PCI4451 IEEE-1394 Controller (Dell Inspiron 8100)";
+#endif
+static const char pci_device_104c_8400[] = "ACX 100 22Mbps Wireless Interface";
+static const char pci_device_104c_a001[] = "TDC1570";
+static const char pci_device_104c_a100[] = "TDC1561";
+static const char pci_device_104c_a102[] = "TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f";
+static const char pci_device_104c_a106[] = "TMS320C6205";
+static const char pci_device_104c_ac10[] = "PCI1050";
+static const char pci_device_104c_ac11[] = "PCI1053";
+static const char pci_device_104c_ac12[] = "PCI1130";
+static const char pci_device_104c_ac13[] = "PCI1031";
+static const char pci_device_104c_ac15[] = "PCI1131";
+static const char pci_device_104c_ac16[] = "PCI1250";
+static const char pci_device_104c_ac17[] = "PCI1220";
+static const char pci_device_104c_ac18[] = "PCI1260";
+static const char pci_device_104c_ac19[] = "PCI1221";
+static const char pci_device_104c_ac1a[] = "PCI1210";
+static const char pci_device_104c_ac1b[] = "PCI1450";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_ac1b_0e11_b113[] = "Armada M700";
+#endif
+static const char pci_device_104c_ac1c[] = "PCI1225";
+static const char pci_device_104c_ac1d[] = "PCI1251A";
+static const char pci_device_104c_ac1e[] = "PCI1211";
+static const char pci_device_104c_ac1f[] = "PCI1251B";
+static const char pci_device_104c_ac20[] = "TI 2030";
+static const char pci_device_104c_ac21[] = "PCI2031";
+static const char pci_device_104c_ac22[] = "PCI2032 PCI Docking Bridge";
+static const char pci_device_104c_ac23[] = "PCI2250 PCI-to-PCI Bridge";
+static const char pci_device_104c_ac28[] = "PCI2050 PCI-to-PCI Bridge";
+static const char pci_device_104c_ac30[] = "PCI1260 PC card Cardbus Controller";
+static const char pci_device_104c_ac40[] = "PCI4450 PC card Cardbus Controller";
+static const char pci_device_104c_ac41[] = "PCI4410 PC card Cardbus Controller";
+static const char pci_device_104c_ac42[] = "PCI4451 PC card Cardbus Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_ac42_1028_00e6[] = "PCI4451 PC card CardBus Controller (Dell Inspiron 8100)";
+#endif
+static const char pci_device_104c_ac50[] = "PCI1410 PC card Cardbus Controller";
+static const char pci_device_104c_ac51[] = "PCI1420";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_ac51_1014_023b[] = "ThinkPad T23 (2647-4MG)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_ac51_10cf_1095[] = "Lifebook C6155";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_ac51_e4bf_1000[] = "CP2-2-HIPHOP";
+#endif
+static const char pci_device_104c_ac52[] = "PCI1451 PC card Cardbus Controller";
+static const char pci_device_104c_ac53[] = "PCI1421 PC card Cardbus Controller";
+static const char pci_device_104c_ac55[] = "PCI1250 PC card Cardbus Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_104c_ac55_1014_0512[] = "ThinkPad T30";
+#endif
+static const char pci_device_104c_ac56[] = "PCI1510 PC card Cardbus Controller";
+static const char pci_device_104c_ac60[] = "PCI2040 PCI to DSP Bridge Controller";
+static const char pci_device_104c_fe00[] = "FireWire Host Controller";
+static const char pci_device_104c_fe03[] = "12C01A FireWire Host Controller";
+static const char pci_vendor_104d[] = "Sony Corporation";
+static const char pci_device_104d_8009[] = "CXD1947Q i.LINK Controller";
+static const char pci_device_104d_8039[] = "CXD3222 i.LINK Controller";
+static const char pci_device_104d_8056[] = "Rockwell HCF 56K modem";
+static const char pci_device_104d_808a[] = "Memory Stick Controller";
+static const char pci_vendor_104e[] = "Oak Technology, Inc";
+static const char pci_device_104e_0017[] = "OTI-64017";
+static const char pci_device_104e_0107[] = "OTI-107 [Spitfire]";
+static const char pci_device_104e_0109[] = "Video Adapter";
+static const char pci_device_104e_0111[] = "OTI-64111 [Spitfire]";
+static const char pci_device_104e_0217[] = "OTI-64217";
+static const char pci_device_104e_0317[] = "OTI-64317";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_104f[] = "Co-time Computer Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1050[] = "Winbond Electronics Corp";
+static const char pci_device_1050_0000[] = "NE2000";
+static const char pci_device_1050_0001[] = "W83769F";
+static const char pci_device_1050_0105[] = "W82C105";
+static const char pci_device_1050_0840[] = "W89C840";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1050_0840_1050_0001[] = "W89C840 Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1050_0840_1050_0840[] = "W89C840 Ethernet Adapter";
+#endif
+static const char pci_device_1050_0940[] = "W89C940";
+static const char pci_device_1050_5a5a[] = "W89C940F";
+static const char pci_device_1050_6692[] = "W6692";
+static const char pci_device_1050_9970[] = "W9970CF";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1051[] = "Anigma, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1052[] = "?Young Micro Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1053[] = "Young Micro Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1054[] = "Hitachi, Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1055[] = "Efar Microsystems";
+static const char pci_device_1055_9130[] = "SLC90E66 [Victory66] IDE";
+static const char pci_device_1055_9460[] = "SLC90E66 [Victory66] ISA";
+static const char pci_device_1055_9462[] = "SLC90E66 [Victory66] USB";
+static const char pci_device_1055_9463[] = "SLC90E66 [Victory66] ACPI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1056[] = "ICL";
+#endif
+static const char pci_vendor_1057[] = "Motorola";
+static const char pci_device_1057_0001[] = "MPC105 [Eagle]";
+static const char pci_device_1057_0002[] = "MPC106 [Grackle]";
+static const char pci_device_1057_0003[] = "MPC8240 [Kahlua]";
+static const char pci_device_1057_0004[] = "MPC107";
+static const char pci_device_1057_0006[] = "MPC8245 [Unity]";
+static const char pci_device_1057_0100[] = "MC145575 [HFC-PCI]";
+static const char pci_device_1057_0431[] = "KTI829c 100VG";
+static const char pci_device_1057_1801[] = "Audio I/O Controller (MIDI)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_1801_ecc0_0030[] = "Layla";
+#endif
+static const char pci_device_1057_18c0[] = "MPC8265A/MPC8266";
+static const char pci_device_1057_4801[] = "Raven";
+static const char pci_device_1057_4802[] = "Falcon";
+static const char pci_device_1057_4803[] = "Hawk";
+static const char pci_device_1057_4806[] = "CPX8216";
+static const char pci_device_1057_4d68[] = "20268";
+static const char pci_device_1057_5600[] = "SM56 PCI Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1057_0300[] = "SM56 PCI Speakerphone Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1057_0301[] = "SM56 PCI Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1057_0302[] = "SM56 PCI Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1057_5600[] = "SM56 PCI Voice modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_13d2_0300[] = "SM56 PCI Speakerphone Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_13d2_0301[] = "SM56 PCI Voice modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_13d2_0302[] = "SM56 PCI Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1436_0300[] = "SM56 PCI Speakerphone Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1436_0301[] = "SM56 PCI Voice modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1436_0302[] = "SM56 PCI Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_144f_100c[] = "SM56 PCI Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1494_0300[] = "SM56 PCI Speakerphone Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1494_0301[] = "SM56 PCI Voice modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_14c8_0300[] = "SM56 PCI Speakerphone Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_14c8_0302[] = "SM56 PCI Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1668_0300[] = "SM56 PCI Speakerphone Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1057_5600_1668_0302[] = "SM56 PCI Fax Modem";
+#endif
+static const char pci_device_1057_6400[] = "MPC190 Security Processor (S1 family, encryption)";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1058[] = "Electronics & Telecommunications RSH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1059[] = "Teknor Industrial Computers Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_105a[] = "Promise Technology, Inc.";
+static const char pci_device_105a_0d30[] = "20265";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_0d30_105a_4d33[] = "Ultra100";
+#endif
+static const char pci_device_105a_0d38[] = "20263";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_0d38_105a_4d39[] = "Fasttrak66";
+#endif
+static const char pci_device_105a_1275[] = "20275";
+static const char pci_device_105a_3376[] = "PDC20376";
+static const char pci_device_105a_4d30[] = "20267";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_4d30_105a_4d33[] = "Ultra100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_4d30_105a_4d39[] = "Fasttrak100";
+#endif
+static const char pci_device_105a_4d33[] = "20246";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_4d33_105a_4d33[] = "20246 IDE Controller";
+#endif
+static const char pci_device_105a_4d38[] = "20262";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_4d38_105a_4d30[] = "Ultra Device on SuperTrak";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_4d38_105a_4d33[] = "Ultra66";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_4d38_105a_4d39[] = "Fasttrak66";
+#endif
+static const char pci_device_105a_4d68[] = "20268";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_4d68_105a_4d68[] = "Ultra100TX2";
+#endif
+static const char pci_device_105a_4d69[] = "20269";
+static const char pci_device_105a_5275[] = "PDC20276 IDE";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_5275_105a_0275[] = "SuperTrak SX6000 IDE";
+#endif
+static const char pci_device_105a_5300[] = "DC5300";
+static const char pci_device_105a_6268[] = "20268R";
+static const char pci_device_105a_6269[] = "PDC20271";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105a_6269_105a_6269[] = "FastTrak TX2/TX2000";
+#endif
+static const char pci_device_105a_6621[] = "PDC20621 [SX4000] 4 Channel IDE RAID Controller";
+static const char pci_device_105a_7275[] = "PDC20277";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_105b[] = "Foxconn International, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_105c[] = "Wipro Infotech Limited";
+#endif
+static const char pci_vendor_105d[] = "Number 9 Computer Company";
+static const char pci_device_105d_2309[] = "Imagine 128";
+static const char pci_device_105d_2339[] = "Imagine 128-II";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0000[] = "Imagine 128 series 2 4Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0001[] = "Imagine 128 series 2 4Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0002[] = "Imagine 128 series 2 4Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0003[] = "Imagine 128 series 2 4Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0004[] = "Imagine 128 series 2 4Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0005[] = "Imagine 128 series 2 4Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0006[] = "Imagine 128 series 2 4Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0007[] = "Imagine 128 series 2 4Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0008[] = "Imagine 128 series 2e 4Mb DRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_0009[] = "Imagine 128 series 2e 4Mb DRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_000a[] = "Imagine 128 series 2 8Mb VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_105d_000b[] = "Imagine 128 series 2 8Mb H-VRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_11a4_000a[] = "Barco Metheus 5 Megapixel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_13cc_0000[] = "Barco Metheus 5 Megapixel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_13cc_0004[] = "Barco Metheus 5 Megapixel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_13cc_0005[] = "Barco Metheus 5 Megapixel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_13cc_0006[] = "Barco Metheus 5 Megapixel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_13cc_0008[] = "Barco Metheus 5 Megapixel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_13cc_0009[] = "Barco Metheus 5 Megapixel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_13cc_000a[] = "Barco Metheus 5 Megapixel";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_2339_13cc_000c[] = "Barco Metheus 5 Megapixel";
+#endif
+static const char pci_device_105d_493d[] = "Imagine 128 T2R [Ticket to Ride]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_493d_11a4_000a[] = "Barco Metheus 5 Megapixel, Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_493d_11a4_000b[] = "Barco Metheus 5 Megapixel, Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_493d_13cc_0002[] = "Barco Metheus 4 Megapixel, Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_493d_13cc_0003[] = "Barco Metheus 5 Megapixel, Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_493d_13cc_0007[] = "Barco Metheus 5 Megapixel, Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_493d_13cc_0008[] = "Barco Metheus 5 Megapixel, Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_493d_13cc_0009[] = "Barco Metheus 5 Megapixel, Dual Head";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_105d_493d_13cc_000a[] = "Barco Metheus 5 Megapixel, Dual Head";
+#endif
+static const char pci_device_105d_5348[] = "Revolution 4";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_105e[] = "Vtech Computers Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_105f[] = "Infotronic America Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1060[] = "United Microelectronics [UMC]";
+static const char pci_device_1060_0001[] = "UM82C881";
+static const char pci_device_1060_0002[] = "UM82C886";
+static const char pci_device_1060_0101[] = "UM8673F";
+static const char pci_device_1060_0881[] = "UM8881";
+static const char pci_device_1060_0886[] = "UM8886F";
+static const char pci_device_1060_0891[] = "UM8891A";
+static const char pci_device_1060_1001[] = "UM886A";
+static const char pci_device_1060_673a[] = "UM8886BF";
+static const char pci_device_1060_673b[] = "EIDE Master/DMA";
+static const char pci_device_1060_8710[] = "UM8710";
+static const char pci_device_1060_886a[] = "UM8886A";
+static const char pci_device_1060_8881[] = "UM8881F";
+static const char pci_device_1060_8886[] = "UM8886F";
+static const char pci_device_1060_888a[] = "UM8886A";
+static const char pci_device_1060_8891[] = "UM8891A";
+static const char pci_device_1060_9017[] = "UM9017F";
+static const char pci_device_1060_9018[] = "UM9018";
+static const char pci_device_1060_9026[] = "UM9026";
+static const char pci_device_1060_e881[] = "UM8881N";
+static const char pci_device_1060_e886[] = "UM8886N";
+static const char pci_device_1060_e88a[] = "UM8886N";
+static const char pci_device_1060_e891[] = "UM8891N";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1061[] = "I.I.T.";
+static const char pci_device_1061_0001[] = "AGX016";
+static const char pci_device_1061_0002[] = "IIT3204/3501";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1062[] = "Maspar Computer Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1063[] = "Ocean Office Automation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1064[] = "Alcatel";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1065[] = "Texas Microsystems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1066[] = "PicoPower Technology";
+static const char pci_device_1066_0000[] = "PT80C826";
+static const char pci_device_1066_0001[] = "PT86C521 [Vesuvius v1] Host Bridge";
+static const char pci_device_1066_0002[] = "PT86C523 [Vesuvius v3] PCI-ISA Bridge Master";
+static const char pci_device_1066_0003[] = "PT86C524 [Nile] PCI-to-PCI Bridge";
+static const char pci_device_1066_0004[] = "PT86C525 [Nile-II] PCI-to-PCI Bridge";
+static const char pci_device_1066_0005[] = "National PC87550 System Controller";
+static const char pci_device_1066_8002[] = "PT86C523 [Vesuvius v3] PCI-ISA Bridge Slave";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1067[] = "Mitsubishi Electric";
+static const char pci_device_1067_1002[] = "VG500 [VolumePro Volume Rendering Accelerator]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1068[] = "Diversified Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1069[] = "Mylex Corporation";
+static const char pci_device_1069_0001[] = "DAC960P";
+static const char pci_device_1069_0002[] = "DAC960PD";
+static const char pci_device_1069_0010[] = "DAC960PX";
+static const char pci_device_1069_0050[] = "AcceleRAID 352/170/160 support Device";
+static const char pci_device_1069_ba55[] = "eXtremeRAID 1100 support Device";
+static const char pci_device_1069_ba56[] = "eXtremeRAID 2000/3000 support Device";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_106a[] = "Aten Research Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_106b[] = "Apple Computer Inc.";
+static const char pci_device_106b_0001[] = "Bandit PowerPC host bridge";
+static const char pci_device_106b_0002[] = "Grand Central I/O";
+static const char pci_device_106b_0003[] = "Control Video";
+static const char pci_device_106b_0004[] = "PlanB Video-In";
+static const char pci_device_106b_0007[] = "O'Hare I/O";
+static const char pci_device_106b_000e[] = "Hydra Mac I/O";
+static const char pci_device_106b_0010[] = "Heathrow Mac I/O";
+static const char pci_device_106b_0017[] = "Paddington Mac I/O";
+static const char pci_device_106b_0018[] = "UniNorth FireWire";
+static const char pci_device_106b_0019[] = "KeyLargo USB";
+static const char pci_device_106b_001e[] = "UniNorth Internal PCI";
+static const char pci_device_106b_001f[] = "UniNorth PCI";
+static const char pci_device_106b_0020[] = "UniNorth AGP";
+static const char pci_device_106b_0021[] = "UniNorth GMAC (Sun GEM)";
+static const char pci_device_106b_0022[] = "KeyLargo Mac I/O";
+static const char pci_device_106b_0024[] = "UniNorth/Pangea GMAC (Sun GEM)";
+static const char pci_device_106b_0025[] = "KeyLargo/Pangea Mac I/O";
+static const char pci_device_106b_0026[] = "KeyLargo/Pangea USB";
+static const char pci_device_106b_0027[] = "UniNorth/Pangea AGP";
+static const char pci_device_106b_0028[] = "UniNorth/Pangea PCI";
+static const char pci_device_106b_0029[] = "UniNorth/Pangea Internal PCI";
+static const char pci_device_106b_002d[] = "UniNorth 1.5 AGP";
+static const char pci_device_106b_002e[] = "UniNorth 1.5 PCI";
+static const char pci_device_106b_002f[] = "UniNorth 1.5 Internal PCI";
+static const char pci_device_106b_0030[] = "UniNorth/Pangea FireWire";
+static const char pci_device_106b_0031[] = "UniNorth 2 FireWire";
+static const char pci_device_106b_0032[] = "UniNorth 2 GMAC (Sun GEM)";
+static const char pci_device_106b_0033[] = "UniNorth 2 ATA/100";
+static const char pci_device_106b_0034[] = "UniNorth 2 AGP";
+static const char pci_device_106b_1645[] = "Tigon3 Gigabit Ethernet NIC (BCM5701)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_106c[] = "Hyundai Electronics America";
+static const char pci_device_106c_8801[] = "Dual Pentium ISA/PCI Motherboard";
+static const char pci_device_106c_8802[] = "PowerPC ISA/PCI Motherboard";
+static const char pci_device_106c_8803[] = "Dual Window Graphics Accelerator";
+static const char pci_device_106c_8804[] = "LAN Controller";
+static const char pci_device_106c_8805[] = "100-BaseT LAN";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_106d[] = "Sequent Computer Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_106e[] = "DFI, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_106f[] = "City Gate Development Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1070[] = "Daewoo Telecom Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1071[] = "Mitac";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1072[] = "GIT Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1073[] = "Yamaha Corporation";
+static const char pci_device_1073_0001[] = "3D GUI Accelerator";
+static const char pci_device_1073_0002[] = "YGV615 [RPA3 3D-Graphics Controller]";
+static const char pci_device_1073_0003[] = "YMF-740";
+static const char pci_device_1073_0004[] = "YMF-724";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_0004_1073_0004[] = "YMF724-Based PCI Audio Adapter";
+#endif
+static const char pci_device_1073_0005[] = "DS1 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_0005_1073_0005[] = "DS-XG PCI Audio CODEC";
+#endif
+static const char pci_device_1073_0006[] = "DS1 Audio";
+static const char pci_device_1073_0008[] = "DS1 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_0008_1073_0008[] = "DS-XG PCI Audio CODEC";
+#endif
+static const char pci_device_1073_000a[] = "DS1L Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_000a_1073_0004[] = "DS-XG PCI Audio CODEC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_000a_1073_000a[] = "DS-XG PCI Audio CODEC";
+#endif
+static const char pci_device_1073_000c[] = "YMF-740C [DS-1L Audio Controller]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_000c_107a_000c[] = "DS-XG PCI Audio CODEC";
+#endif
+static const char pci_device_1073_000d[] = "YMF-724F [DS-1 Audio Controller]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_000d_1073_000d[] = "DS-XG PCI Audio CODEC";
+#endif
+static const char pci_device_1073_0010[] = "YMF-744B [DS-1S Audio Controller]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_0010_1073_0006[] = "DS-XG PCI Audio CODEC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_0010_1073_0010[] = "DS-XG PCI Audio CODEC";
+#endif
+static const char pci_device_1073_0012[] = "YMF-754 [DS-1E Audio Controller]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_0012_1073_0012[] = "DS-XG PCI Audio Codec";
+#endif
+static const char pci_device_1073_0020[] = "DS-1 Audio";
+static const char pci_device_1073_2000[] = "DS2416 Digital Mixing Card";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1073_2000_1073_2000[] = "DS2416 Digital Mixing Card";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1074[] = "NexGen Microsystems";
+static const char pci_device_1074_4e78[] = "82c500/1";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1075[] = "Advanced Integrations Research";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1076[] = "Chaintech Computer Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1077[] = "QLogic Corp.";
+static const char pci_device_1077_1016[] = "ISP10160 Single Channel Ultra3 SCSI Processor";
+static const char pci_device_1077_1020[] = "ISP1020 Fast-wide SCSI";
+static const char pci_device_1077_1022[] = "ISP1022 Fast-wide SCSI";
+static const char pci_device_1077_1080[] = "ISP1080 SCSI Host Adapter";
+static const char pci_device_1077_1216[] = "ISP12160 Dual Channel Ultra3 SCSI Processor";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1077_1216_101e_8471[] = "QLA12160 on AMI MegaRAID";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1077_1216_101e_8493[] = "QLA12160 on AMI MegaRAID";
+#endif
+static const char pci_device_1077_1240[] = "ISP1240 SCSI Host Adapter";
+static const char pci_device_1077_1280[] = "ISP1280";
+static const char pci_device_1077_2020[] = "ISP2020A Fast!SCSI Basic Adapter";
+static const char pci_device_1077_2100[] = "QLA2100 64-bit Fibre Channel Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1077_2100_1077_0001[] = "QLA2100 64-bit Fibre Channel Adapter";
+#endif
+static const char pci_device_1077_2200[] = "QLA2200";
+static const char pci_device_1077_2300[] = "QLA2300 64-bit FC-AL Adapter";
+static const char pci_device_1077_2312[] = "QLA2312 Fibre Channel Adapter";
+#endif
+static const char pci_vendor_1078[] = "Cyrix Corporation";
+static const char pci_device_1078_0000[] = "5510 [Grappa]";
+static const char pci_device_1078_0001[] = "PCI Master";
+static const char pci_device_1078_0002[] = "5520 [Cognac]";
+static const char pci_device_1078_0100[] = "5530 Legacy [Kahlua]";
+static const char pci_device_1078_0101[] = "5530 SMI [Kahlua]";
+static const char pci_device_1078_0102[] = "5530 IDE [Kahlua]";
+static const char pci_device_1078_0103[] = "5530 Audio [Kahlua]";
+static const char pci_device_1078_0104[] = "5530 Video [Kahlua]";
+static const char pci_device_1078_0400[] = "ZFMicro PCI Bridge";
+static const char pci_device_1078_0401[] = "ZFMicro Chipset SMI";
+static const char pci_device_1078_0402[] = "ZFMicro Chipset IDE";
+static const char pci_device_1078_0403[] = "ZFMicro Expansion Bus";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1079[] = "I-Bus";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_107a[] = "NetWorth";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_107b[] = "Gateway 2000";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_107c[] = "LG Electronics [Lucky Goldstar Co. Ltd]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_107d[] = "LeadTek Research Inc.";
+static const char pci_device_107d_0000[] = "P86C850";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_107e[] = "Interphase Corporation";
+static const char pci_device_107e_0001[] = "5515 ATM Adapter [Flipper]";
+static const char pci_device_107e_0002[] = "100 VG AnyLan Controller";
+static const char pci_device_107e_0004[] = "5526 Fibre Channel Host Adapter";
+static const char pci_device_107e_0005[] = "x526 Fibre Channel Host Adapter";
+static const char pci_device_107e_0008[] = "5525/5575 ATM Adapter (155 Mbit) [Atlantic]";
+static const char pci_device_107e_9003[] = "5535-4P-BRI-ST";
+static const char pci_device_107e_9007[] = "5535-4P-BRI-U";
+static const char pci_device_107e_9008[] = "5535-1P-SR";
+static const char pci_device_107e_900c[] = "5535-1P-SR-ST";
+static const char pci_device_107e_900e[] = "5535-1P-SR-U";
+static const char pci_device_107e_9011[] = "5535-1P-PRI";
+static const char pci_device_107e_9013[] = "5535-2P-PRI";
+static const char pci_device_107e_9023[] = "5536-4P-BRI-ST";
+static const char pci_device_107e_9027[] = "5536-4P-BRI-U";
+static const char pci_device_107e_9031[] = "5536-1P-PRI";
+static const char pci_device_107e_9033[] = "5536-2P-PRI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_107f[] = "Data Technology Corporation";
+static const char pci_device_107f_0802[] = "SL82C105";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1080[] = "Contaq Microsystems";
+static const char pci_device_1080_0600[] = "82C599";
+static const char pci_device_1080_c691[] = "Cypress CY82C691";
+static const char pci_device_1080_c693[] = "82c693";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1081[] = "Supermac Technology";
+static const char pci_device_1081_0d47[] = "Radius PCI to NuBUS Bridge";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1082[] = "EFA Corporation of America";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1083[] = "Forex Computer Corporation";
+static const char pci_device_1083_0001[] = "FR710";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1084[] = "Parador";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1085[] = "Tulip Computers Int.B.V.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1086[] = "J. Bond Computer Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1087[] = "Cache Computer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1088[] = "Microcomputer Systems (M) Son";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1089[] = "Data General Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_108a[] = "SBS Technologies";
+static const char pci_device_108a_0001[] = "VME Bridge Model 617";
+static const char pci_device_108a_0010[] = "VME Bridge Model 618";
+static const char pci_device_108a_0040[] = "dataBLIZZARD";
+static const char pci_device_108a_3000[] = "VME Bridge Model 2706";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_108c[] = "Oakleigh Systems Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_108d[] = "Olicom";
+static const char pci_device_108d_0001[] = "Token-Ring 16/4 PCI Adapter (3136/3137)";
+static const char pci_device_108d_0002[] = "16/4 Token Ring";
+static const char pci_device_108d_0004[] = "RapidFire 3139 Token-Ring 16/4 PCI Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_108d_0004_108d_0004[] = "OC-3139/3140 RapidFire Token-Ring 16/4 Adapter";
+#endif
+static const char pci_device_108d_0005[] = "GoCard 3250 Token-Ring 16/4 CardBus PC Card";
+static const char pci_device_108d_0006[] = "OC-3530 RapidFire Token-Ring 100";
+static const char pci_device_108d_0007[] = "RapidFire 3141 Token-Ring 16/4 PCI Fiber Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_108d_0007_108d_0007[] = "OC-3141 RapidFire Token-Ring 16/4 Adapter";
+#endif
+static const char pci_device_108d_0008[] = "RapidFire 3540 HSTR 100/16/4 PCI Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_108d_0008_108d_0008[] = "OC-3540 RapidFire HSTR 100/16/4 Adapter";
+#endif
+static const char pci_device_108d_0011[] = "OC-2315";
+static const char pci_device_108d_0012[] = "OC-2325";
+static const char pci_device_108d_0013[] = "OC-2183/2185";
+static const char pci_device_108d_0014[] = "OC-2326";
+static const char pci_device_108d_0019[] = "OC-2327/2250 10/100 Ethernet Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_108d_0019_108d_0016[] = "OC-2327 Rapidfire 10/100 Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_108d_0019_108d_0017[] = "OC-2250 GoCard 10/100 Ethernet Adapter";
+#endif
+static const char pci_device_108d_0021[] = "OC-6151/6152 [RapidFire ATM 155]";
+static const char pci_device_108d_0022[] = "ATM Adapter";
+#endif
+static const char pci_vendor_108e[] = "Sun Microsystems Computer Corp.";
+static const char pci_device_108e_0001[] = "EBUS";
+static const char pci_device_108e_1000[] = "EBUS";
+static const char pci_device_108e_1001[] = "Happy Meal";
+static const char pci_device_108e_1100[] = "RIO EBUS";
+static const char pci_device_108e_1101[] = "RIO GEM";
+static const char pci_device_108e_1102[] = "RIO 1394";
+static const char pci_device_108e_1103[] = "RIO USB";
+static const char pci_device_108e_2bad[] = "GEM";
+static const char pci_device_108e_5000[] = "Simba Advanced PCI Bridge";
+static const char pci_device_108e_5043[] = "SunPCI Co-processor";
+static const char pci_device_108e_8000[] = "Psycho PCI Bus Module";
+static const char pci_device_108e_8001[] = "Schizo PCI Bus Module";
+static const char pci_device_108e_a000[] = "Ultra IIi";
+static const char pci_device_108e_a001[] = "Ultra IIe";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_108f[] = "Systemsoft";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1090[] = "Encore Computer Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1091[] = "Intergraph Corporation";
+static const char pci_device_1091_0020[] = "3D graphics processor";
+static const char pci_device_1091_0021[] = "3D graphics processor w/Texturing";
+static const char pci_device_1091_0040[] = "3D graphics frame buffer";
+static const char pci_device_1091_0041[] = "3D graphics frame buffer";
+static const char pci_device_1091_0060[] = "Proprietary bus bridge";
+static const char pci_device_1091_00e4[] = "Powerstorm 4D50T";
+static const char pci_device_1091_0720[] = "Motion JPEG codec";
+#endif
+static const char pci_vendor_1092[] = "Diamond Multimedia Systems";
+static const char pci_device_1092_00a0[] = "Speedstar Pro SE";
+static const char pci_device_1092_00a8[] = "Speedstar 64";
+static const char pci_device_1092_0550[] = "Viper V550";
+static const char pci_device_1092_08d4[] = "Supra 2260 Modem";
+static const char pci_device_1092_094c[] = "SupraExpress 56i Pro";
+static const char pci_device_1092_1092[] = "Viper V330";
+static const char pci_device_1092_6120[] = "Maximum DVD";
+static const char pci_device_1092_8810[] = "Stealth SE";
+static const char pci_device_1092_8811[] = "Stealth 64/SE";
+static const char pci_device_1092_8880[] = "Stealth";
+static const char pci_device_1092_8881[] = "Stealth";
+static const char pci_device_1092_88b0[] = "Stealth 64";
+static const char pci_device_1092_88b1[] = "Stealth 64";
+static const char pci_device_1092_88c0[] = "Stealth 64";
+static const char pci_device_1092_88c1[] = "Stealth 64";
+static const char pci_device_1092_88d0[] = "Stealth 64";
+static const char pci_device_1092_88d1[] = "Stealth 64";
+static const char pci_device_1092_88f0[] = "Stealth 64";
+static const char pci_device_1092_88f1[] = "Stealth 64";
+static const char pci_device_1092_9999[] = "DMD-I0928-1 Monster sound sound chip";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1093[] = "National Instruments";
+static const char pci_device_1093_0160[] = "PCI-DIO-96";
+static const char pci_device_1093_0162[] = "PCI-MIO-16XE-50";
+static const char pci_device_1093_1170[] = "PCI-MIO-16XE-10";
+static const char pci_device_1093_1180[] = "PCI-MIO-16E-1";
+static const char pci_device_1093_1190[] = "PCI-MIO-16E-4";
+static const char pci_device_1093_1330[] = "PCI-6031E";
+static const char pci_device_1093_1350[] = "PCI-6071E";
+static const char pci_device_1093_2a60[] = "PCI-6023E";
+static const char pci_device_1093_b001[] = "IMAQ-PCI-1408";
+static const char pci_device_1093_b011[] = "IMAQ-PXI-1408";
+static const char pci_device_1093_b021[] = "IMAQ-PCI-1424";
+static const char pci_device_1093_b031[] = "IMAQ-PCI-1413";
+static const char pci_device_1093_b041[] = "IMAQ-PCI-1407";
+static const char pci_device_1093_b051[] = "IMAQ-PXI-1407";
+static const char pci_device_1093_b061[] = "IMAQ-PCI-1411";
+static const char pci_device_1093_b071[] = "IMAQ-PCI-1422";
+static const char pci_device_1093_b081[] = "IMAQ-PXI-1422";
+static const char pci_device_1093_b091[] = "IMAQ-PXI-1411";
+static const char pci_device_1093_c801[] = "PCI-GPIB";
+static const char pci_device_1093_c831[] = "PCI-GPIB bridge";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1094[] = "First International Computers [FIC]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1095[] = "CMD Technology Inc";
+static const char pci_device_1095_0640[] = "PCI0640";
+static const char pci_device_1095_0643[] = "PCI0643";
+static const char pci_device_1095_0646[] = "PCI0646";
+static const char pci_device_1095_0647[] = "PCI0647";
+static const char pci_device_1095_0648[] = "PCI0648";
+static const char pci_device_1095_0649[] = "PCI0649";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1095_0649_0e11_005d[] = "Integrated Ultra ATA-100 Dual Channel Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1095_0649_0e11_007e[] = "Integrated Ultra ATA-100 IDE RAID Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1095_0649_101e_0649[] = "AMI MegaRAID IDE 100 Controller";
+#endif
+static const char pci_device_1095_0650[] = "PBC0650A";
+static const char pci_device_1095_0670[] = "USB0670";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1095_0670_1095_0670[] = "USB0670";
+#endif
+static const char pci_device_1095_0673[] = "USB0673";
+static const char pci_device_1095_0680[] = "PCI0680";
+static const char pci_device_1095_3112[] = "Silicon Image SiI 3112 SATARaid Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1096[] = "Alacron";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1097[] = "Appian Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1098[] = "Quantum Designs (H.K.) Ltd";
+static const char pci_device_1098_0001[] = "QD-8500";
+static const char pci_device_1098_0002[] = "QD-8580";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1099[] = "Samsung Electronics Co., Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_109a[] = "Packard Bell";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_109b[] = "Gemlight Computer Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_109c[] = "Megachips Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_109d[] = "Zida Technologies Ltd.";
+#endif
+static const char pci_vendor_109e[] = "Brooktree Corporation";
+static const char pci_device_109e_0350[] = "Bt848 Video Capture";
+static const char pci_device_109e_0351[] = "Bt849A Video capture";
+static const char pci_device_109e_0369[] = "Bt878 Video Capture";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0369_1002_0001[] = "TV-Wonder";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0369_1002_0003[] = "TV-Wonder/VE";
+#endif
+static const char pci_device_109e_036c[] = "Bt879(?) Video Capture";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036c_13e9_0070[] = "Win/TV (Video Section)";
+#endif
+static const char pci_device_109e_036e[] = "Bt878 Video Capture";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_0070_13eb[] = "WinTV Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_0070_ff01[] = "Viewcast Osprey 200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_107d_6606[] = "WinFast TV 2000";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_11bd_0012[] = "PCTV pro (TV + FM stereo receiver)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_11bd_001c[] = "PCTV Sat (DBC receiver)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_127a_0001[] = "Bt878 Mediastream Controller NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_127a_0002[] = "Bt878 Mediastream Controller PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_127a_0003[] = "Bt878a Mediastream Controller PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_127a_0048[] = "Bt878/832 Mediastream Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_144f_3000[] = "MagicTView CPH060 - Video";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_1461_0004[] = "AVerTV WDM Video Capture";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_14f1_0001[] = "Bt878 Mediastream Controller NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_14f1_0002[] = "Bt878 Mediastream Controller PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_14f1_0003[] = "Bt878a Mediastream Controller PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_14f1_0048[] = "Bt878/832 Mediastream Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_1851_1850[] = "FlyVideo'98 - Video";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_1851_1851[] = "FlyVideo II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_1852_1852[] = "FlyVideo'98 - Video (with FM Tuner)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036e_bd11_1200[] = "PCTV pro (TV + FM stereo receiver)";
+#endif
+static const char pci_device_109e_036f[] = "Bt879 Video Capture";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_0044[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_0122[] = "Bt879 Video Capture PAL I";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_0144[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_0222[] = "Bt879 Video Capture PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_0244[] = "Bt879a Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_0322[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_0422[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_1122[] = "Bt879 Video Capture PAL I";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_1222[] = "Bt879 Video Capture PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_1322[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_1522[] = "Bt879a Video Capture PAL I";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_1622[] = "Bt879a Video Capture PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_127a_1722[] = "Bt879a Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_0044[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_0122[] = "Bt879 Video Capture PAL I";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_0144[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_0222[] = "Bt879 Video Capture PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_0244[] = "Bt879a Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_0322[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_0422[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_1122[] = "Bt879 Video Capture PAL I";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_1222[] = "Bt879 Video Capture PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_1322[] = "Bt879 Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_1522[] = "Bt879a Video Capture PAL I";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_1622[] = "Bt879a Video Capture PAL BG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_14f1_1722[] = "Bt879a Video Capture NTSC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_1851_1850[] = "FlyVideo'98 - Video";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_1851_1851[] = "FlyVideo II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_036f_1852_1852[] = "FlyVideo'98 - Video (with FM Tuner)";
+#endif
+static const char pci_device_109e_0370[] = "Bt880 Video Capture";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0370_1851_1850[] = "FlyVideo'98";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0370_1851_1851[] = "FlyVideo'98 EZ - video";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0370_1852_1852[] = "FlyVideo'98 (with FM Tuner)";
+#endif
+static const char pci_device_109e_0878[] = "Bt878 Audio Capture";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_0070_13eb[] = "WinTV Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_0070_ff01[] = "Viewcast Osprey 200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_1002_0001[] = "TV-Wonder";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_1002_0003[] = "TV-Wonder/VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_11bd_0012[] = "PCTV pro (TV + FM stereo receiver, audio section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_11bd_001c[] = "PCTV Sat (DBC receiver)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_127a_0001[] = "Bt878 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_127a_0002[] = "Bt878 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_127a_0003[] = "Bt878 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_127a_0048[] = "Bt878 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_13e9_0070[] = "Win/TV (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_144f_3000[] = "MagicTView CPH060 - Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_1461_0004[] = "AVerTV WDM Audio Capture";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_14f1_0001[] = "Bt878 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_14f1_0002[] = "Bt878 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_14f1_0003[] = "Bt878 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_14f1_0048[] = "Bt878 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0878_bd11_1200[] = "PCTV pro (TV + FM stereo receiver, audio section)";
+#endif
+static const char pci_device_109e_0879[] = "Bt879 Audio Capture";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_0044[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_0122[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_0144[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_0222[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_0244[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_0322[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_0422[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_1122[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_1222[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_1322[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_1522[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_1622[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_127a_1722[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_0044[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_0122[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_0144[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_0222[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_0244[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_0322[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_0422[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_1122[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_1222[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_1322[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_1522[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_1622[] = "Bt879 Video Capture (Audio Section)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_109e_0879_14f1_1722[] = "Bt879 Video Capture (Audio Section)";
+#endif
+static const char pci_device_109e_0880[] = "Bt880 Audio Capture";
+static const char pci_device_109e_2115[] = "BtV 2115 Mediastream controller";
+static const char pci_device_109e_2125[] = "BtV 2125 Mediastream controller";
+static const char pci_device_109e_2164[] = "BtV 2164";
+static const char pci_device_109e_2165[] = "BtV 2165";
+static const char pci_device_109e_8230[] = "Bt8230 ATM Segment/Reassembly Ctrlr (SRC)";
+static const char pci_device_109e_8472[] = "Bt8472";
+static const char pci_device_109e_8474[] = "Bt8474";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_109f[] = "Trigem Computer Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a0[] = "Meidensha Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a1[] = "Juko Electronics Ind. Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a2[] = "Quantum Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a3[] = "Everex Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a4[] = "Globe Manufacturing Sales";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a5[] = "Smart Link Ltd.";
+static const char pci_device_10a5_5449[] = "SmartPCI561 modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a6[] = "Informtech Industrial Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a7[] = "Benchmarq Microelectronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a8[] = "Sierra Semiconductor";
+static const char pci_device_10a8_0000[] = "STB Horizon 64";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10a9[] = "Silicon Graphics, Inc.";
+static const char pci_device_10a9_0001[] = "Crosstalk to PCI Bridge";
+static const char pci_device_10a9_0002[] = "Linc I/O controller";
+static const char pci_device_10a9_0003[] = "IOC3 I/O controller";
+static const char pci_device_10a9_0004[] = "O2 MACE";
+static const char pci_device_10a9_0005[] = "RAD Audio";
+static const char pci_device_10a9_0006[] = "HPCEX";
+static const char pci_device_10a9_0007[] = "RPCEX";
+static const char pci_device_10a9_0008[] = "DiVO VIP";
+static const char pci_device_10a9_0009[] = "Alteon Gigabit Ethernet";
+static const char pci_device_10a9_0010[] = "AMP Video I/O";
+static const char pci_device_10a9_0011[] = "GRIP";
+static const char pci_device_10a9_0012[] = "SGH PSHAC GSN";
+static const char pci_device_10a9_1001[] = "Magic Carpet";
+static const char pci_device_10a9_1002[] = "Lithium";
+static const char pci_device_10a9_1003[] = "Dual JPEG 1";
+static const char pci_device_10a9_1004[] = "Dual JPEG 2";
+static const char pci_device_10a9_1005[] = "Dual JPEG 3";
+static const char pci_device_10a9_1006[] = "Dual JPEG 4";
+static const char pci_device_10a9_1007[] = "Dual JPEG 5";
+static const char pci_device_10a9_1008[] = "Cesium";
+static const char pci_device_10a9_2001[] = "Fibre Channel";
+static const char pci_device_10a9_2002[] = "ASDE";
+static const char pci_device_10a9_8001[] = "O2 1394";
+static const char pci_device_10a9_8002[] = "G-net NT";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10aa[] = "ACC Microelectronics";
+static const char pci_device_10aa_0000[] = "ACCM 2188";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ab[] = "Digicom";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ac[] = "Honeywell IAC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ad[] = "Symphony Labs";
+static const char pci_device_10ad_0001[] = "W83769F";
+static const char pci_device_10ad_0003[] = "SL82C103";
+static const char pci_device_10ad_0005[] = "SL82C105";
+static const char pci_device_10ad_0103[] = "SL82c103";
+static const char pci_device_10ad_0105[] = "SL82c105";
+static const char pci_device_10ad_0565[] = "W83C553";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ae[] = "Cornerstone Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10af[] = "Micro Computer Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b0[] = "CardExpert Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b1[] = "Cabletron Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b2[] = "Raytheon Company";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b3[] = "Databook Inc";
+static const char pci_device_10b3_3106[] = "DB87144";
+static const char pci_device_10b3_b106[] = "DB87144";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b4[] = "STB Systems Inc";
+static const char pci_device_10b4_1b1d[] = "Velocity 128 3D";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b4_1b1d_10b4_237e[] = "Velocity 4400";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b5[] = "PLX Technology, Inc.";
+static const char pci_device_10b5_0001[] = "i960 PCI bus interface";
+static const char pci_device_10b5_1076[] = "VScom 800 8 port serial adaptor";
+static const char pci_device_10b5_1077[] = "VScom 400 4 port serial adaptor";
+static const char pci_device_10b5_1078[] = "VScom 210 2 port serial and 1 port parallel adaptor";
+static const char pci_device_10b5_1103[] = "VScom 200 2 port serial adaptor";
+static const char pci_device_10b5_1146[] = "VScom 010 1 port parallel adaptor";
+static const char pci_device_10b5_1147[] = "VScom 020 2 port parallel adaptor";
+static const char pci_device_10b5_2724[] = "Thales PCSM Security Card";
+static const char pci_device_10b5_9030[] = "PCI <-> IOBus Bridge Hot Swap";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9030_15ed_1002[] = "MCCS 8-port Serial Hot Swap";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9030_15ed_1003[] = "MCCS 16-port Serial Hot Swap";
+#endif
+static const char pci_device_10b5_9036[] = "9036";
+static const char pci_device_10b5_9050[] = "PCI <-> IOBus Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_10b5_2036[] = "SatPak GPS";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_10b5_2273[] = "SH-ARC SoHard ARCnet card";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_10b5_9050[] = "MP9050";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_1522_0001[] = "RockForce 4 Port V.90 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_1522_0002[] = "RockForce 2 Port V.90 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_1522_0003[] = "RockForce 6 Port V.90 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_1522_0004[] = "RockForce 8 Port V.90 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_1522_0010[] = "RockForce2000 4 Port V.90 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_1522_0020[] = "RockForce2000 2 Port V.90 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_15ed_1000[] = "Macrolink MCCS 8-port Serial";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_15ed_1001[] = "Macrolink MCCS 16-port Serial";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_15ed_1002[] = "Macrolink MCCS 8-port Serial Hot Swap";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_15ed_1003[] = "Macrolink MCCS 16-port Serial Hot Swap";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_5654_5634[] = "OpenLine4 Telephony Card";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d531_c002[] = "PCIntelliCAN 2xSJA1000 CAN bus";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4006[] = "EX-4006 1P";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4008[] = "EX-4008 1P EPP/ECP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4014[] = "EX-4014 2P";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4018[] = "EX-4018 3P EPP/ECP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4025[] = "EX-4025 1S(16C550) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4027[] = "EX-4027 1S(16C650) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4028[] = "EX-4028 1S(16C850) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4036[] = "EX-4036 2S(16C650) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4037[] = "EX-4037 2S(16C650) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4038[] = "EX-4038 2S(16C850) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4052[] = "EX-4052 1S(16C550) RS-422/485";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4053[] = "EX-4053 2S(16C550) RS-422/485";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4055[] = "EX-4055 4S(16C550) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4058[] = "EX-4055 4S(16C650) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4065[] = "EX-4065 8S(16C550) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4068[] = "EX-4068 8S(16C650) RS-232";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9050_d84d_4078[] = "EX-4078 2S(16C552) RS-232+1P";
+#endif
+static const char pci_device_10b5_9054[] = "PCI <-> IOBus Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9054_10b5_2455[] = "Wessex Techology PHIL-PCI";
+#endif
+static const char pci_device_10b5_9060[] = "9060";
+static const char pci_device_10b5_906d[] = "9060SD";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_906d_125c_0640[] = "Aries 16000P";
+#endif
+static const char pci_device_10b5_906e[] = "9060ES";
+static const char pci_device_10b5_9080[] = "9080";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9080_10b5_9080[] = "9080 [real subsystem ID not set]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b5_9080_129d_0002[] = "Aculab PCI Prosidy card";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b6[] = "Madge Networks";
+static const char pci_device_10b6_0001[] = "Smart 16/4 PCI Ringnode";
+static const char pci_device_10b6_0002[] = "Smart 16/4 PCI Ringnode Mk2";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_0002_10b6_0002[] = "Smart 16/4 PCI Ringnode Mk2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_0002_10b6_0006[] = "16/4 CardBus Adapter";
+#endif
+static const char pci_device_10b6_0003[] = "Smart 16/4 PCI Ringnode Mk3";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_0003_0e11_b0fd[] = "Compaq NC4621 PCI, 4/16, WOL";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_0003_10b6_0003[] = "Smart 16/4 PCI Ringnode Mk3";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_0003_10b6_0007[] = "Presto PCI Plus Adapter";
+#endif
+static const char pci_device_10b6_0004[] = "Smart 16/4 PCI Ringnode Mk1";
+static const char pci_device_10b6_0006[] = "16/4 Cardbus Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_0006_10b6_0006[] = "16/4 CardBus Adapter";
+#endif
+static const char pci_device_10b6_0007[] = "Presto PCI Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_0007_10b6_0007[] = "Presto PCI";
+#endif
+static const char pci_device_10b6_0009[] = "Smart 100/16/4 PCI-HS Ringnode";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_0009_10b6_0009[] = "Smart 100/16/4 PCI-HS Ringnode";
+#endif
+static const char pci_device_10b6_000a[] = "Smart 100/16/4 PCI Ringnode";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_000a_10b6_000a[] = "Smart 100/16/4 PCI Ringnode";
+#endif
+static const char pci_device_10b6_000b[] = "16/4 CardBus Adapter Mk2";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_000b_10b6_0008[] = "16/4 CardBus Adapter Mk2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_000b_10b6_000b[] = "16/4 Cardbus Adapter Mk2";
+#endif
+static const char pci_device_10b6_000c[] = "RapidFire 3140V2 16/4 TR Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b6_000c_10b6_000c[] = "RapidFire 3140V2 16/4 TR Adapter";
+#endif
+static const char pci_device_10b6_1000[] = "Collage 25/155 ATM Client Adapter";
+static const char pci_device_10b6_1001[] = "Collage 155 ATM Server Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b7[] = "3Com Corporation";
+static const char pci_device_10b7_0001[] = "3c985 1000BaseSX (SX/TX)";
+static const char pci_device_10b7_1006[] = "MINI PCI type 3B Data Fax Modem";
+static const char pci_device_10b7_1007[] = "Mini PCI 56k Winmodem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_1007_10b7_615c[] = "Mini PCI 56K Modem";
+#endif
+static const char pci_device_10b7_3390[] = "3c339 TokenLink Velocity";
+static const char pci_device_10b7_3590[] = "3c359 TokenLink Velocity XL";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_3590_10b7_3590[] = "TokenLink Velocity XL Adapter (3C359/359B)";
+#endif
+static const char pci_device_10b7_4500[] = "3c450 Cyclone/unknown";
+static const char pci_device_10b7_5055[] = "3c555 Laptop Hurricane";
+static const char pci_device_10b7_5057[] = "3c575 [Megahertz] 10/100 LAN CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_5057_10b7_5a57[] = "3C575 Megahertz 10/100 LAN Cardbus PC Card";
+#endif
+static const char pci_device_10b7_5157[] = "3c575 [Megahertz] 10/100 LAN CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_5157_10b7_5b57[] = "3C575 Megahertz 10/100 LAN Cardbus PC Card";
+#endif
+static const char pci_device_10b7_5257[] = "3CCFE575CT Cyclone CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_5257_10b7_5c57[] = "FE575C-3Com 10/100 LAN CardBus-Fast Ethernet";
+#endif
+static const char pci_device_10b7_5900[] = "3c590 10BaseT [Vortex]";
+static const char pci_device_10b7_5920[] = "3c592 EISA 10mbps Demon/Vortex";
+static const char pci_device_10b7_5950[] = "3c595 100BaseTX [Vortex]";
+static const char pci_device_10b7_5951[] = "3c595 100BaseT4 [Vortex]";
+static const char pci_device_10b7_5952[] = "3c595 100Base-MII [Vortex]";
+static const char pci_device_10b7_5970[] = "3c597 EISA Fast Demon/Vortex";
+static const char pci_device_10b7_5b57[] = "3c595 [Megahertz] 10/100 LAN CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_5b57_10b7_5b57[] = "3C575 Megahertz 10/100 LAN Cardbus PC Card";
+#endif
+static const char pci_device_10b7_6055[] = "3c556 Hurricane CardBus";
+static const char pci_device_10b7_6056[] = "3c556B Hurricane CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_6056_10b7_6556[] = "10/100 Mini PCI Ethernet Adapter";
+#endif
+static const char pci_device_10b7_6560[] = "3CCFE656 Cyclone CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_6560_10b7_656a[] = "3CCFEM656 10/100 LAN+56K Modem CardBus";
+#endif
+static const char pci_device_10b7_6561[] = "3CCFEM656 10/100 LAN+56K Modem CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_6561_10b7_656b[] = "3CCFEM656 10/100 LAN+56K Modem CardBus";
+#endif
+static const char pci_device_10b7_6562[] = "3CCFEM656 [id 6562] Cyclone CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_6562_10b7_656b[] = "3CCFEM656B 10/100 LAN+56K Modem CardBus";
+#endif
+static const char pci_device_10b7_6563[] = "3CCFEM656B 10/100 LAN+56K Modem CardBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_6563_10b7_656b[] = "3CCFEM656 10/100 LAN+56K Modem CardBus";
+#endif
+static const char pci_device_10b7_6564[] = "3CCFEM656 [id 6564] Cyclone CardBus";
+static const char pci_device_10b7_7646[] = "3cSOHO100-TX Hurricane";
+static const char pci_device_10b7_7940[] = "3c803 FDDILink UTP Controller";
+static const char pci_device_10b7_7980[] = "3c804 FDDILink SAS Controller";
+static const char pci_device_10b7_7990[] = "3c805 FDDILink DAS Controller";
+static const char pci_device_10b7_8811[] = "Token ring";
+static const char pci_device_10b7_9000[] = "3c900 10BaseT [Boomerang]";
+static const char pci_device_10b7_9001[] = "3c900 Combo [Boomerang]";
+static const char pci_device_10b7_9004[] = "3c900B-TPO [Etherlink XL TPO]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9004_10b7_9004[] = "3C900B-TPO Etherlink XL TPO 10Mb";
+#endif
+static const char pci_device_10b7_9005[] = "3c900B-Combo [Etherlink XL Combo]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9005_10b7_9005[] = "3C900B-Combo Etherlink XL Combo";
+#endif
+static const char pci_device_10b7_9006[] = "3c900B-TPC [Etherlink XL TPC]";
+static const char pci_device_10b7_900a[] = "3c900B-FL [Etherlink XL FL]";
+static const char pci_device_10b7_9050[] = "3c905 100BaseTX [Boomerang]";
+static const char pci_device_10b7_9051[] = "3c905 100BaseT4 [Boomerang]";
+static const char pci_device_10b7_9055[] = "3c905B 100BaseTX [Cyclone]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0080[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0081[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0082[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0083[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0084[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0085[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0086[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0087[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0088[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0089[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0090[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0091[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0092[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0093[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0094[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0095[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0096[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0097[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0098[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_1028_0099[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9055_10b7_9055[] = "3C905B Fast Etherlink XL 10/100";
+#endif
+static const char pci_device_10b7_9056[] = "3c905B-T4 [Fast EtherLink XL 10/100]";
+static const char pci_device_10b7_9058[] = "3c905B-Combo [Deluxe Etherlink XL 10/100]";
+static const char pci_device_10b7_905a[] = "3c905B-FX [Fast Etherlink XL FX 10/100]";
+static const char pci_device_10b7_9200[] = "3c905C-TX/TX-M [Tornado]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9200_1028_0095[] = "Integrated 3C905C-TX Fast Etherlink for PC Management NIC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9200_10b7_1000[] = "3C905C-TX Fast Etherlink for PC Management NIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9200_10b7_7000[] = "10/100 Mini PCI Ethernet Adapter";
+#endif
+static const char pci_device_10b7_9201[] = "3C920B-EMB Integrated Fast Ethernet Controller";
+static const char pci_device_10b7_9300[] = "3CSOHO100B-TX [910-A01]";
+static const char pci_device_10b7_9800[] = "3c980-TX [Fast Etherlink XL Server Adapter]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9800_10b7_9800[] = "3c980-TX Fast Etherlink XL Server Adapter";
+#endif
+static const char pci_device_10b7_9805[] = "3c980-TX 10/100baseTX NIC [Python-T]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9805_10b7_1201[] = "3c982-TXM 10/100baseTX Dual Port A [Hydra]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9805_10b7_1202[] = "3c982-TXM 10/100baseTX Dual Port B [Hydra]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9805_10b7_9805[] = "3c980 10/100baseTX NIC [Python-T]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9805_10f1_2462[] = "Thunder K7 S2462";
+#endif
+static const char pci_device_10b7_9900[] = "3C990-TX [Typhoon]";
+static const char pci_device_10b7_9902[] = "3CR990-TX-95 [Typhoon 56-bit]";
+static const char pci_device_10b7_9903[] = "3CR990-TX-97 [Typhoon 168-bit]";
+static const char pci_device_10b7_9904[] = "3C990B-TX-M/3C990BSVR [Typhoon2]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9904_10b7_1000[] = "3CR990B-TX-M [Typhoon2]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9904_10b7_2000[] = "3CR990BSVR [Typhoon2 Server]";
+#endif
+static const char pci_device_10b7_9905[] = "3CR990-FX-95/97/95 [Typhon Fiber]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9905_10b7_1101[] = "3CR990-FX-95 [Typhoon Fiber 56-bit]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9905_10b7_1102[] = "3CR990-FX-97 [Typhoon Fiber 168-bit]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9905_10b7_2101[] = "3CR990-FX-95 Server [Typhoon Fiber 56-bit]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b7_9905_10b7_2102[] = "3CR990-FX-97 Server [Typhoon Fiber 168-bit]";
+#endif
+static const char pci_device_10b7_9908[] = "3CR990SVR95 [Typhoon Server 56-bit]";
+static const char pci_device_10b7_9909[] = "3CR990SVR97 [Typhoon Server 168-bit]";
+static const char pci_device_10b7_990b[] = "3C990SVR [Typhoon Server]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10b8[] = "Standard Microsystems Corp [SMC]";
+static const char pci_device_10b8_0005[] = "83C170QF";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0005_1055_e000[] = "LANEPIC 10/100 [EVB171Q-PCI]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0005_1055_e002[] = "LANEPIC 10/100 [EVB171G-PCI]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0005_10b8_a011[] = "EtherPower II 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0005_10b8_a014[] = "EtherPower II 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0005_10b8_a015[] = "EtherPower II 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0005_10b8_a016[] = "EtherPower II 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0005_10b8_a017[] = "EtherPower II 10/100";
+#endif
+static const char pci_device_10b8_0006[] = "LANEPIC";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0006_1055_e100[] = "LANEPIC Cardbus Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0006_1055_e102[] = "LANEPIC Cardbus Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0006_1055_e300[] = "LANEPIC Cardbus Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0006_1055_e302[] = "LANEPIC Cardbus Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0006_10b8_a012[] = "LANEPIC Cardbus Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0006_13a2_8002[] = "LANEPIC Cardbus Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b8_0006_13a2_8006[] = "LANEPIC Cardbus Fast Ethernet Adapter";
+#endif
+static const char pci_device_10b8_1000[] = "FDC 37c665";
+static const char pci_device_10b8_1001[] = "FDC 37C922";
+static const char pci_device_10b8_a011[] = "83C170QF";
+static const char pci_device_10b8_b106[] = "SMC34C90";
+#endif
+static const char pci_vendor_10b9[] = "ALi Corporation";
+static const char pci_device_10b9_0111[] = "C-Media CMI8738/C3DX Audio Device (OEM)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b9_0111_10b9_0111[] = "C-Media CMI8738/C3DX Audio Device (OEM)";
+#endif
+static const char pci_device_10b9_1435[] = "M1435";
+static const char pci_device_10b9_1445[] = "M1445";
+static const char pci_device_10b9_1449[] = "M1449";
+static const char pci_device_10b9_1451[] = "M1451";
+static const char pci_device_10b9_1461[] = "M1461";
+static const char pci_device_10b9_1489[] = "M1489";
+static const char pci_device_10b9_1511[] = "M1511 [Aladdin]";
+static const char pci_device_10b9_1512[] = "M1512 [Aladdin]";
+static const char pci_device_10b9_1513[] = "M1513 [Aladdin]";
+static const char pci_device_10b9_1521[] = "M1521 [Aladdin III]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b9_1521_10b9_1521[] = "ALI M1521 Aladdin III CPU Bridge";
+#endif
+static const char pci_device_10b9_1523[] = "M1523";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b9_1523_10b9_1523[] = "ALI M1523 ISA Bridge";
+#endif
+static const char pci_device_10b9_1531[] = "M1531 [Aladdin IV]";
+static const char pci_device_10b9_1533[] = "M1533 PCI to ISA Bridge [Aladdin IV]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b9_1533_10b9_1533[] = "ALI M1533 Aladdin IV ISA Bridge";
+#endif
+static const char pci_device_10b9_1541[] = "M1541";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b9_1541_10b9_1541[] = "ALI M1541 Aladdin V/V+ AGP System Controller";
+#endif
+static const char pci_device_10b9_1543[] = "M1543";
+static const char pci_device_10b9_1563[] = "M1563 HyperTransport South Bridge";
+static const char pci_device_10b9_1621[] = "M1621";
+static const char pci_device_10b9_1631[] = "ALI M1631 PCI North Bridge Aladdin Pro III";
+static const char pci_device_10b9_1632[] = "M1632M Northbridge+Trident";
+static const char pci_device_10b9_1641[] = "ALI M1641 PCI North Bridge Aladdin Pro IV";
+static const char pci_device_10b9_1644[] = "M1644/M1644T Northbridge+Trident";
+static const char pci_device_10b9_1646[] = "M1646 Northbridge+Trident";
+static const char pci_device_10b9_1647[] = "M1647 Northbridge [MAGiK 1 / MobileMAGiK 1]";
+static const char pci_device_10b9_1651[] = "M1651/M1651T Northbridge [Aladdin-Pro 5/5M,Aladdin-Pro 5T/5TM]";
+static const char pci_device_10b9_1671[] = "M1671 Super P4 Northbridge [AGP4X,PCI and SDR/DDR]";
+static const char pci_device_10b9_1681[] = "M1681 P4 Northbridge [AGP8X,HyperTransport and SDR/DDR]";
+static const char pci_device_10b9_1687[] = "M1687 K8 Northbridge [AGP8X and HyperTransport]";
+static const char pci_device_10b9_3141[] = "M3141";
+static const char pci_device_10b9_3143[] = "M3143";
+static const char pci_device_10b9_3145[] = "M3145";
+static const char pci_device_10b9_3147[] = "M3147";
+static const char pci_device_10b9_3149[] = "M3149";
+static const char pci_device_10b9_3151[] = "M3151";
+static const char pci_device_10b9_3307[] = "M3307";
+static const char pci_device_10b9_3309[] = "M3309";
+static const char pci_device_10b9_5212[] = "M4803";
+static const char pci_device_10b9_5215[] = "MS4803";
+static const char pci_device_10b9_5217[] = "M5217H";
+static const char pci_device_10b9_5219[] = "M5219";
+static const char pci_device_10b9_5225[] = "M5225";
+static const char pci_device_10b9_5229[] = "M5229 IDE";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b9_5229_1043_8053[] = "A7A266 Motherboard IDE";
+#endif
+static const char pci_device_10b9_5235[] = "M5225";
+static const char pci_device_10b9_5237[] = "USB 1.1 Controller";
+static const char pci_device_10b9_5239[] = "USB 2.0 Controller";
+static const char pci_device_10b9_5243[] = "M1541 PCI to AGP Controller";
+static const char pci_device_10b9_5247[] = "PCI to AGP Controller";
+static const char pci_device_10b9_5249[] = "M5249 HTT to PCI Bridge";
+static const char pci_device_10b9_5251[] = "M5251 P1394 OHCI 1.0 Controller";
+static const char pci_device_10b9_5253[] = "M5253 P1394 OHCI 1.1 Controller";
+static const char pci_device_10b9_5261[] = "M5261 Ethernet Controller";
+static const char pci_device_10b9_5451[] = "M5451 PCI AC-Link Controller Audio Device";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b9_5451_1014_0506[] = "ThinkPad R30";
+#endif
+static const char pci_device_10b9_5453[] = "M5453 PCI AC-Link Controller Modem Device";
+static const char pci_device_10b9_5455[] = "M5455 PCI AC-Link Controller Audio Device";
+static const char pci_device_10b9_5457[] = "Intel 537 [M5457 AC-Link Modem]";
+static const char pci_device_10b9_5459[] = "SmartLink SmartPCI561 56K Modem";
+static const char pci_device_10b9_545a[] = "SmartLink SmartPCI563 56K Modem";
+static const char pci_device_10b9_5471[] = "M5471 Memory Stick Controller";
+static const char pci_device_10b9_5473[] = "M5473 SD-MMC Controller";
+static const char pci_device_10b9_7101[] = "M7101 PMU";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10b9_7101_10b9_7101[] = "ALI M7101 Power Management Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ba[] = "Mitsubishi Electric Corp.";
+static const char pci_device_10ba_0301[] = "AccelGraphics AccelECLIPSE";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10bb[] = "Dapha Electronics Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10bc[] = "Advanced Logic Research";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10bd[] = "Surecom Technology";
+static const char pci_device_10bd_0e34[] = "NE-34";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10be[] = "Tseng Labs International Co.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10bf[] = "Most Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c0[] = "Boca Research Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c1[] = "ICM Co., Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c2[] = "Auspex Systems Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c3[] = "Samsung Semiconductors, Inc.";
+static const char pci_device_10c3_1100[] = "Smartether100 SC1100 LAN Adapter (i82557B)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c4[] = "Award Software International Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c5[] = "Xerox Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c6[] = "Rambus Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c7[] = "Media Vision";
+#endif
+static const char pci_vendor_10c8[] = "Neomagic Corporation";
+static const char pci_device_10c8_0001[] = "NM2070 [MagicGraph 128]";
+static const char pci_device_10c8_0002[] = "NM2090 [MagicGraph 128V]";
+static const char pci_device_10c8_0003[] = "NM2093 [MagicGraph 128ZV]";
+static const char pci_device_10c8_0004[] = "NM2160 [MagicGraph 128XD]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_1014_00ba[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_1025_1007[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_1028_0074[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_1028_0075[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_1028_007d[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_1028_007e[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_1033_802f[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_104d_801b[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_104d_802f[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_104d_830b[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_10ba_0e00[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_10c8_0004[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_10cf_1029[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_10f7_8308[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_10f7_8309[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_10f7_830b[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_10f7_830d[] = "MagicGraph 128XD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0004_10f7_8312[] = "MagicGraph 128XD";
+#endif
+static const char pci_device_10c8_0005[] = "NM2200 [MagicGraph 256AV]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0005_1014_00dd[] = "ThinkPad 570";
+#endif
+static const char pci_device_10c8_0006[] = "NM2360 [MagicMedia 256ZX]";
+static const char pci_device_10c8_0016[] = "NM2380 [MagicMedia 256XL+]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_0016_10c8_0016[] = "MagicMedia 256XL+";
+#endif
+static const char pci_device_10c8_0025[] = "NM2230 [MagicGraph 256AV+]";
+static const char pci_device_10c8_0083[] = "NM2093 [MagicGraph 128ZV+]";
+static const char pci_device_10c8_8005[] = "NM2200 [MagicMedia 256AV Audio]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_0e11_b0d1[] = "MagicMedia 256AV Audio Device on Discovery";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_0e11_b126[] = "MagicMedia 256AV Audio Device on Durango";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_1014_00dd[] = "MagicMedia 256AV Audio Device on BlackTip Thinkpad";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_1025_1003[] = "MagicMedia 256AV Audio Device on TravelMate 720";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_1028_008f[] = "MagicMedia 256AV Audio Device on Colorado Inspiron";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_103c_0007[] = "MagicMedia 256AV Audio Device on Voyager II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_103c_0008[] = "MagicMedia 256AV Audio Device on Voyager III";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_103c_000d[] = "MagicMedia 256AV Audio Device on Omnibook 900";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_10c8_8005[] = "MagicMedia 256AV Audio Device on FireAnt";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_110a_8005[] = "MagicMedia 256AV Audio Device";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10c8_8005_14c0_0004[] = "MagicMedia 256AV Audio Device";
+#endif
+static const char pci_device_10c8_8006[] = "NM2360 [MagicMedia 256ZX Audio]";
+static const char pci_device_10c8_8016[] = "NM2380 [MagicMedia 256XL+ Audio]";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10c9[] = "Dataexpert Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ca[] = "Fujitsu Microelectr., Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10cb[] = "Omron Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10cc[] = "Mentor ARC Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10cd[] = "Advanced System Products, Inc";
+static const char pci_device_10cd_1100[] = "ASC1100";
+static const char pci_device_10cd_1200[] = "ASC1200 [(abp940) Fast SCSI-II]";
+static const char pci_device_10cd_1300[] = "ABP940-U / ABP960-U";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10cd_1300_10cd_1310[] = "ASC1300 SCSI Adapter";
+#endif
+static const char pci_device_10cd_2300[] = "ABP940-UW";
+static const char pci_device_10cd_2500[] = "ABP940-U2W";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ce[] = "Radius";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10cf[] = "Citicorp TTI";
+static const char pci_device_10cf_2001[] = "mb86605";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d0[] = "Fujitsu Limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d1[] = "FuturePlus Systems Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d2[] = "Molex Incorporated";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d3[] = "Jabil Circuit Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d4[] = "Hualon Microelectronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d5[] = "Autologic Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d6[] = "Cetia";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d7[] = "BCM Advanced Research";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d8[] = "Advanced Peripherals Labs";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10d9[] = "Macronix, Inc. [MXIC]";
+static const char pci_device_10d9_0512[] = "MX98713";
+static const char pci_device_10d9_0531[] = "MX987x5";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10d9_0531_1186_1200[] = "DFE-540TX ProFAST 10/100 Adapter";
+#endif
+static const char pci_device_10d9_8625[] = "MX86250";
+static const char pci_device_10d9_8888[] = "MX86200";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10da[] = "Compaq IPG-Austin";
+static const char pci_device_10da_0508[] = "TC4048 Token Ring 4/16";
+static const char pci_device_10da_3390[] = "Tl3c3x9";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10db[] = "Rohm LSI Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10dc[] = "CERN/ECP/EDU";
+static const char pci_device_10dc_0001[] = "STAR/RD24 SCI-PCI (PMC)";
+static const char pci_device_10dc_0002[] = "TAR/RD24 SCI-PCI (PMC)";
+static const char pci_device_10dc_0021[] = "HIPPI destination";
+static const char pci_device_10dc_0022[] = "HIPPI source";
+static const char pci_device_10dc_10dc[] = "ATT2C15-3 FPGA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10dd[] = "Evans & Sutherland";
+#endif
+static const char pci_vendor_10de[] = "nVidia Corporation";
+static const char pci_device_10de_0008[] = "NV1 [EDGE 3D]";
+static const char pci_device_10de_0009[] = "NV1 [EDGE 3D]";
+static const char pci_device_10de_0010[] = "NV2 [Mutara V08]";
+static const char pci_device_10de_0020[] = "NV4 [RIVA TNT]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1043_0200[] = "V3400 TNT";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1048_0c18[] = "Erazor II SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1048_0c1b[] = "Erazor II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_0550[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_0552[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4804[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4808[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4810[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4812[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4815[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4820[] = "Viper V550 with TV out";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4822[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4904[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_4914[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1092_8225[] = "Viper V550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_10b4_273d[] = "Velocity 4400";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_10b4_273e[] = "Velocity 4400";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_10b4_2740[] = "Velocity 4400";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_10de_0020[] = "Riva TNT";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1102_1015[] = "Graphics Blaster CT6710";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0020_1102_1016[] = "Graphics Blaster RIVA TNT";
+#endif
+static const char pci_device_10de_0028[] = "NV5 [RIVA TNT2/TNT2 Pro]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1043_0200[] = "AGP-V3800 SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1043_0201[] = "AGP-V3800 SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1043_0205[] = "PCI-V3800";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1043_4000[] = "AGP-V3800PRO";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1092_4804[] = "Viper V770";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1092_4a00[] = "Viper V770";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1092_4a02[] = "Viper V770 Ultra";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1092_5a00[] = "RIVA TNT2/TNT2 Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1092_6a02[] = "Viper V770 Ultra";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1092_7a02[] = "Viper V770 Ultra";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_10de_0005[] = "RIVA TNT2 Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_10de_000f[] = "Compaq NVIDIA TNT2 Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1102_1020[] = "3D Blaster RIVA TNT2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_1102_1026[] = "3D Blaster RIVA TNT2 Digital";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0028_14af_5810[] = "Maxi Gamer Xentor";
+#endif
+static const char pci_device_10de_0029[] = "NV5 [RIVA TNT2 Ultra]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0029_1043_0200[] = "AGP-V3800 Deluxe";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0029_1043_0201[] = "AGP-V3800 Ultra SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0029_1043_0205[] = "PCI-V3800 Ultra";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0029_1102_1021[] = "3D Blaster RIVA TNT2 Ultra";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0029_1102_1029[] = "3D Blaster RIVA TNT2 Ultra";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0029_1102_102f[] = "3D Blaster RIVA TNT2 Ultra";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0029_14af_5820[] = "Maxi Gamer Xentor 32";
+#endif
+static const char pci_device_10de_002a[] = "NV5 [Riva TnT2]";
+static const char pci_device_10de_002b[] = "NV5 [Riva TnT2]";
+static const char pci_device_10de_002c[] = "NV6 [Vanta/Vanta LT]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002c_1043_0200[] = "AGP-V3800 Combat SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002c_1043_0201[] = "AGP-V3800 Combat";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002c_1092_6820[] = "Viper V730";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002c_1102_1031[] = "CT6938 VANTA 8MB";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002c_1102_1034[] = "CT6894 VANTA 16MB";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002c_14af_5008[] = "Maxi Gamer Phoenix 2";
+#endif
+static const char pci_device_10de_002d[] = "NV5M64 [RIVA TNT2 Model 64/Model 64 Pro]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_1043_0200[] = "AGP-V3800M";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_1043_0201[] = "AGP-V3800M";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_1048_0c3a[] = "Erazor III LT";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_10de_001e[] = "M64 AGP4x";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_1102_1023[] = "CT6892 RIVA TNT2 Value";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_1102_1024[] = "CT6932 RIVA TNT2 Value 32Mb";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_1102_102c[] = "CT6931 RIVA TNT2 Value [Jumper]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_1462_8808[] = "MSI-8808";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_002d_1554_1041[] = "PixelView RIVA TNT2 M64 32MB";
+#endif
+static const char pci_device_10de_002e[] = "NV6 [Vanta]";
+static const char pci_device_10de_002f[] = "NV6 [Vanta]";
+static const char pci_device_10de_0060[] = "nForce2 ISA Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0060_1043_80ad[] = "A7N8X Mainboard";
+#endif
+static const char pci_device_10de_0064[] = "nForce2 SMBus (MCP)";
+static const char pci_device_10de_0065[] = "nForce2 IDE";
+static const char pci_device_10de_0066[] = "nForce2 Ethernet Controller";
+static const char pci_device_10de_0067[] = "nForce2 USB Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0067_1043_0c11[] = "A7N8X Mainboard";
+#endif
+static const char pci_device_10de_0068[] = "nForce2 USB Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0068_1043_0c11[] = "A7N8X Mainboard";
+#endif
+static const char pci_device_10de_006a[] = "nForce2 AC97 Audio Controler (MCP)";
+static const char pci_device_10de_006b[] = "nForce MultiMedia audio [Via VT82C686B]";
+static const char pci_device_10de_006e[] = "nForce2 FireWire (IEEE 1394) Controller";
+static const char pci_device_10de_00a0[] = "NV5 [Aladdin TNT2]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_00a0_14af_5810[] = "Maxi Gamer Xentor";
+#endif
+static const char pci_device_10de_0100[] = "NV10 [GeForce 256 SDR]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0100_1043_0200[] = "AGP-V6600 SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0100_1043_0201[] = "AGP-V6600 SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0100_1043_4008[] = "AGP-V6600 SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0100_1043_4009[] = "AGP-V6600 SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0100_1102_102d[] = "CT6941 GeForce 256";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0100_14af_5022[] = "3D Prophet SE";
+#endif
+static const char pci_device_10de_0101[] = "NV10DDR [GeForce 256 DDR]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0101_1043_0202[] = "AGP-V6800 DDR";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0101_1043_400a[] = "AGP-V6800 DDR SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0101_1043_400b[] = "AGP-V6800 DDR SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0101_1102_102e[] = "CT6971 GeForce 256 DDR";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0101_14af_5021[] = "3D Prophet DDR-DVI";
+#endif
+static const char pci_device_10de_0103[] = "NV10GL [Quadro]";
+static const char pci_device_10de_0110[] = "NV11 [GeForce2 MX/MX 400]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0110_1043_4015[] = "AGP-V7100 Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0110_1043_4031[] = "V7100 Pro with TV output";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0110_1462_8817[] = "MSI GeForce2 MX400 Pro32S [MS-8817]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0110_14af_7102[] = "3D Prophet II MX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0110_14af_7103[] = "3D Prophet II MX Dual-Display";
+#endif
+static const char pci_device_10de_0111[] = "NV11DDR [GeForce2 MX 100 DDR/200 DDR]";
+static const char pci_device_10de_0112[] = "NV11 [GeForce2 Go]";
+static const char pci_device_10de_0113[] = "NV11GL [Quadro2 MXR/EX]";
+static const char pci_device_10de_0150[] = "NV15 [GeForce2 GTS/Pro]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0150_1043_4016[] = "V7700 AGP Video Card";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0150_107d_2840[] = "WinFast GeForce2 GTS with TV output";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0150_1462_8831[] = "Creative GeForce2 Pro";
+#endif
+static const char pci_device_10de_0151[] = "NV15DDR [GeForce2 Ti]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0151_1043_405f[] = "V7700Ti";
+#endif
+static const char pci_device_10de_0152[] = "NV15BR [GeForce2 Ultra, Bladerunner]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0152_1048_0c56[] = "GLADIAC Ultra";
+#endif
+static const char pci_device_10de_0153[] = "NV15GL [Quadro2 Pro]";
+static const char pci_device_10de_0170[] = "NV17 [GeForce4 MX 460]";
+static const char pci_device_10de_0171[] = "NV17 [GeForce4 MX 440]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0171_1462_8661[] = "G4MX440-VTP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0171_1462_8730[] = "MX440SES-T (MS-8873)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0171_147b_8f00[] = "Abit Siluro GeForce4MX440";
+#endif
+static const char pci_device_10de_0172[] = "NV17 [GeForce4 MX 420]";
+static const char pci_device_10de_0173[] = "NV17 [GeForce4 MX 440-SE]";
+static const char pci_device_10de_0174[] = "NV17 [GeForce4 440 Go]";
+static const char pci_device_10de_0175[] = "NV17 [GeForce4 420 Go]";
+static const char pci_device_10de_0176[] = "NV17 [GeForce4 420 Go 32M]";
+static const char pci_device_10de_0178[] = "NV17GL [Quadro4 550 XGL]";
+static const char pci_device_10de_0179[] = "NV17 [GeForce4 440 Go 64M]";
+static const char pci_device_10de_017a[] = "NV17GL [Quadro4 200/400 NVS]";
+static const char pci_device_10de_017b[] = "NV17GL [Quadro4 550 XGL]";
+static const char pci_device_10de_017c[] = "NV17GL [Quadro4 550 GoGL]";
+static const char pci_device_10de_0181[] = "NV18 [GeForce4 MX 440 AGP 8x]";
+static const char pci_device_10de_0182[] = "NV18 [GeForce4 MX 440SE AGP 8x]";
+static const char pci_device_10de_0183[] = "NV18 [GeForce4 MX 420 AGP 8x]";
+static const char pci_device_10de_0188[] = "NV18GL [Quadro4 580 XGL]";
+static const char pci_device_10de_018a[] = "NV18GL [Quadro4 NVS]";
+static const char pci_device_10de_018b[] = "NV18GL [Quadro4 380 XGL]";
+static const char pci_device_10de_01a0[] = "NV15 [GeForce2 - nForce GPU]";
+static const char pci_device_10de_01a4[] = "nForce CPU bridge";
+static const char pci_device_10de_01ab[] = "nForce 420 Memory Controller (DDR)";
+static const char pci_device_10de_01ac[] = "nForce 220/420 Memory Controller";
+static const char pci_device_10de_01ad[] = "nForce 220/420 Memory Controller";
+static const char pci_device_10de_01b1[] = "nForce Audio";
+static const char pci_device_10de_01b2[] = "nForce ISA Bridge";
+static const char pci_device_10de_01b4[] = "nForce PCI System Management";
+static const char pci_device_10de_01b7[] = "nForce AGP to PCI Bridge";
+static const char pci_device_10de_01b8[] = "nForce PCI-to-PCI bridge";
+static const char pci_device_10de_01bc[] = "nForce IDE";
+static const char pci_device_10de_01c1[] = "Intel 537 [nForce MC97 Modem]";
+static const char pci_device_10de_01c2[] = "nForce USB Controller";
+static const char pci_device_10de_01c3[] = "nForce Ethernet Controller";
+static const char pci_device_10de_01e8[] = "nForce2 AGP";
+static const char pci_device_10de_01f0[] = "NV18 [GeForce4 MX - nForce GPU]";
+static const char pci_device_10de_0200[] = "NV20 [GeForce3]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0200_1043_402f[] = "AGP-V8200 DDR";
+#endif
+static const char pci_device_10de_0201[] = "NV20 [GeForce3 Ti 200]";
+static const char pci_device_10de_0202[] = "NV20 [GeForce3 Ti 500]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0202_1043_405b[] = "V8200 T5";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0202_1545_002f[] = "Xtasy 6964";
+#endif
+static const char pci_device_10de_0203[] = "NV20DCC [Quadro DCC]";
+static const char pci_device_10de_0250[] = "NV25 [GeForce4 Ti 4600]";
+static const char pci_device_10de_0251[] = "NV25 [GeForce4 Ti 4400]";
+static const char pci_device_10de_0252[] = "NV25 [GeForce4 Ti]";
+static const char pci_device_10de_0253[] = "NV25 [GeForce4 Ti 4200]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0253_107d_2896[] = "WinFast A250 LE TD (Dual VGA/TV-out/DVI)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10de_0253_147b_8f09[] = "Siluro (Dual VGA/TV-out/DVI)";
+#endif
+static const char pci_device_10de_0258[] = "NV25GL [Quadro4 900 XGL]";
+static const char pci_device_10de_0259[] = "NV25GL [Quadro4 750 XGL]";
+static const char pci_device_10de_025b[] = "NV25GL [Quadro4 700 XGL]";
+static const char pci_device_10de_0280[] = "NV28 [GeForce4 Ti 4800]";
+static const char pci_device_10de_0281[] = "NV28 [GeForce4 Ti 4200 AGP 8x]";
+static const char pci_device_10de_0282[] = "NV28 [GeForce4 Ti 4800 SE]";
+static const char pci_device_10de_0288[] = "NV28GL [Quadro4 980 XGL]";
+static const char pci_device_10de_0289[] = "NV28GL [Quadro4 780 XGL]";
+static const char pci_device_10de_0300[] = "NV30 [GeForce FX]";
+static const char pci_device_10de_0301[] = "NV30 [GeForce FX 5800 Ultra]";
+static const char pci_device_10de_0302[] = "NV30 [GeForce FX 5800]";
+static const char pci_device_10de_0308[] = "NV30GL [Quadro FX 2000]";
+static const char pci_device_10de_0309[] = "NV30GL [Quadro FX 1000]";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10df[] = "Emulex Corporation";
+static const char pci_device_10df_1ae5[] = "LP6000 Fibre Channel Host Adapter";
+static const char pci_device_10df_f085[] = "LP850 Fibre Channel Adapter";
+static const char pci_device_10df_f095[] = "LP952 Fibre Channel Adapter";
+static const char pci_device_10df_f098[] = "LP982 Fibre Channel Adapter";
+static const char pci_device_10df_f700[] = "LP7000 Fibre Channel Host Adapter";
+static const char pci_device_10df_f800[] = "LP8000 Fibre Channel Host Adapter";
+static const char pci_device_10df_f900[] = "LP9000 Fibre Channel Host Adapter";
+static const char pci_device_10df_f980[] = "LP9802 Fibre Channel Adapter";
+#endif
+static const char pci_vendor_10e0[] = "Integrated Micro Solutions Inc.";
+static const char pci_device_10e0_5026[] = "IMS5026/27/28";
+static const char pci_device_10e0_5027[] = "IMS5027";
+static const char pci_device_10e0_5028[] = "IMS5028";
+static const char pci_device_10e0_8849[] = "IMS8849";
+static const char pci_device_10e0_8853[] = "IMS8853";
+static const char pci_device_10e0_9128[] = "IMS9128 [Twin turbo 128]";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e1[] = "Tekram Technology Co.,Ltd.";
+static const char pci_device_10e1_0391[] = "TRM-S1040";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10e1_0391_10e1_0391[] = "DC-315U SCSI-3 Host Adapter";
+#endif
+static const char pci_device_10e1_690c[] = "DC-690c";
+static const char pci_device_10e1_dc29[] = "DC-290";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e2[] = "Aptix Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e3[] = "Tundra Semiconductor Corp.";
+static const char pci_device_10e3_0000[] = "CA91C042 [Universe]";
+static const char pci_device_10e3_0860[] = "CA91C860 [QSpan]";
+static const char pci_device_10e3_0862[] = "CA91C862A [QSpan-II]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e4[] = "Tandem Computers";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e5[] = "Micro Industries Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e6[] = "Gainbery Computer Products Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e7[] = "Vadem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e8[] = "Applied Micro Circuits Corp.";
+static const char pci_device_10e8_2011[] = "Q-Motion Video Capture/Edit board";
+static const char pci_device_10e8_4750[] = "S5930 [Matchmaker]";
+static const char pci_device_10e8_5920[] = "S5920";
+static const char pci_device_10e8_8043[] = "LANai4.x [Myrinet LANai interface chip]";
+static const char pci_device_10e8_8062[] = "S5933_PARASTATION";
+static const char pci_device_10e8_807d[] = "S5933 [Matchmaker]";
+static const char pci_device_10e8_8088[] = "Kongsberg Spacetec Format Synchronizer";
+static const char pci_device_10e8_8089[] = "Kongsberg Spacetec Serial Output Board";
+static const char pci_device_10e8_809c[] = "S5933_HEPC3";
+static const char pci_device_10e8_80d7[] = "PCI-9112";
+static const char pci_device_10e8_80d9[] = "PCI-9118";
+static const char pci_device_10e8_80da[] = "PCI-9812";
+static const char pci_device_10e8_811a[] = "PCI-IEEE1355-DS-DE Interface";
+static const char pci_device_10e8_8170[] = "S5933 [Matchmaker] (Chipset Development Tool)";
+static const char pci_device_10e8_82db[] = "AJA HDNTV HD SDI Framestore";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10e9[] = "Alps Electric Co., Ltd.";
+#endif
+static const char pci_vendor_10ea[] = "Intergraphics Systems";
+static const char pci_device_10ea_1680[] = "IGA-1680";
+static const char pci_device_10ea_1682[] = "IGA-1682";
+static const char pci_device_10ea_1683[] = "IGA-1683";
+static const char pci_device_10ea_2000[] = "CyberPro 2000";
+static const char pci_device_10ea_2010[] = "CyberPro 2000A";
+static const char pci_device_10ea_5000[] = "CyberPro 5000";
+static const char pci_device_10ea_5050[] = "CyberPro 5050";
+static const char pci_device_10ea_5202[] = "CyberPro 5202";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10eb[] = "Artists Graphics";
+static const char pci_device_10eb_0101[] = "3GA";
+static const char pci_device_10eb_8111[] = "Twist3 Frame Grabber";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ec[] = "Realtek Semiconductor Co., Ltd.";
+static const char pci_device_10ec_8029[] = "RTL-8029(AS)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8029_10b8_2011[] = "EZ-Card (SMC1208)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8029_10ec_8029[] = "RTL-8029(AS)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8029_1113_1208[] = "EN1208";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8029_1186_0300[] = "DE-528";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8029_1259_2400[] = "AT-2400";
+#endif
+static const char pci_device_10ec_8129[] = "RTL-8129";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8129_10ec_8129[] = "RT8129 Fast Ethernet Adapter";
+#endif
+static const char pci_device_10ec_8138[] = "RT8139 (B/C) Cardbus Fast Ethernet Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8138_10ec_8138[] = "RT8139 (B/C) Fast Ethernet Adapter";
+#endif
+static const char pci_device_10ec_8139[] = "RTL-8139/8139C/8139C+";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1025_8920[] = "ALN-325";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1025_8921[] = "ALN-325";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_10bd_0320[] = "EP-320X-R";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_10ec_8139[] = "RT8139";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1186_1300[] = "DFE-538TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1186_1320[] = "SN5200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1186_8139[] = "DRN-32TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_11f6_8139[] = "FN22-3(A) LinxPRO Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1259_2500[] = "AT-2500TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1259_2503[] = "AT-2500TX/ACPI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1429_d010[] = "ND010";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1432_9130[] = "EN-9130TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1436_8139[] = "RT8139";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_146c_1439[] = "FE-1439TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1489_6001[] = "GF100TXRII";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_1489_6002[] = "GF100TXRA";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_149c_139a[] = "LFE-8139ATX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_149c_8139[] = "LFE-8139TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_2646_0001[] = "EtheRx";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_8e2e_7000[] = "KF-230TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_8e2e_7100[] = "KF-230TX/2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8139_a0a0_0007[] = "ALN-325C";
+#endif
+static const char pci_device_10ec_8169[] = "RTL-8169";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_10ec_8169_1371_434e[] = "ProG-2000L";
+#endif
+static const char pci_device_10ec_8197[] = "SmartLAN56 56K Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ed[] = "Ascii Corporation";
+static const char pci_device_10ed_7310[] = "V7310";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ee[] = "Xilinx Corporation";
+static const char pci_device_10ee_3fc0[] = "RME Digi96";
+static const char pci_device_10ee_3fc1[] = "RME Digi96/8";
+static const char pci_device_10ee_3fc2[] = "RME Digi96/8 Pro";
+static const char pci_device_10ee_3fc3[] = "RME Digi96/8 Pad";
+static const char pci_device_10ee_3fc4[] = "RME Digi9652 (Hammerfall)";
+static const char pci_device_10ee_3fc5[] = "RME Hammerfall DSP";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ef[] = "Racore Computer Products, Inc.";
+static const char pci_device_10ef_8154[] = "M815x Token Ring Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f0[] = "Peritek Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f1[] = "Tyan Computer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f2[] = "Achme Computer, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f3[] = "Alaris, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f4[] = "S-MOS Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f5[] = "NKK Corporation";
+static const char pci_device_10f5_a001[] = "NDR4000 [NR4600 Bridge]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f6[] = "Creative Electronic Systems SA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f7[] = "Matsushita Electric Industrial Co., Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f8[] = "Altos India Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10f9[] = "PC Direct";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10fa[] = "Truevision";
+static const char pci_device_10fa_000c[] = "TARGA 1000";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10fb[] = "Thesys Gesellschaft für Mikroelektronik mbH";
+static const char pci_device_10fb_186f[] = "TH 6255";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10fc[] = "I-O Data Device, Inc.";
+static const char pci_device_10fc_0003[] = "Cardbus IDE Controller";
+static const char pci_device_10fc_0005[] = "Cardbus SCSI CBSC II";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10fd[] = "Soyo Computer, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10fe[] = "Fast Multimedia AG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_10ff[] = "NCube";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1100[] = "Jazz Multimedia";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1101[] = "Initio Corporation";
+static const char pci_device_1101_1060[] = "INI-A100U2W";
+static const char pci_device_1101_9100[] = "INI-9100/9100W";
+static const char pci_device_1101_9400[] = "INI-940";
+static const char pci_device_1101_9401[] = "INI-950";
+static const char pci_device_1101_9500[] = "360P";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1102[] = "Creative Labs";
+static const char pci_device_1102_0002[] = "SB Live! EMU10k1";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_0020[] = "CT4850 SBLive! Value";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_0021[] = "CT4620 SBLive!";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_002f[] = "SBLive! mainboard implementation";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_4001[] = "E-mu APS";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8022[] = "CT4780 SBLive! Value";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8023[] = "CT4790 SoundBlaster PCI512";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8024[] = "CT4760 SBLive!";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8025[] = "SBLive! Mainboard Implementation";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8026[] = "CT4830 SBLive! Value";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8027[] = "CT4832 SBLive! Value";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8028[] = "CT4760 SBLive! OEM version";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8031[] = "CT4831 SBLive! Value";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8040[] = "CT4760 SBLive!";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8051[] = "CT4850 SBLive! Value";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0002_1102_8061[] = "SBLive! Player 5.1";
+#endif
+static const char pci_device_1102_0004[] = "SB Audigy";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0004_1102_0051[] = "SB0090 Audigy Player";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_0004_1102_0053[] = "SB0090 Audigy Player/OEM";
+#endif
+static const char pci_device_1102_0006[] = "[SB Live! Value] EMU10k1X";
+static const char pci_device_1102_4001[] = "SB Audigy FireWire Port";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_4001_1102_0010[] = "SB Audigy FireWire Port";
+#endif
+static const char pci_device_1102_7002[] = "SB Live! MIDI/Game Port";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_7002_1102_0020[] = "Gameport Joystick";
+#endif
+static const char pci_device_1102_7003[] = "SB Audigy MIDI/Game port";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1102_7003_1102_0040[] = "SB Audigy MIDI/Game Port";
+#endif
+static const char pci_device_1102_7004[] = "[SB Live! Value] Input device controller";
+static const char pci_device_1102_8064[] = "SB0100 [SBLive! 5.1 OEM]";
+static const char pci_device_1102_8938[] = "ES1371";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1103[] = "Triones Technologies, Inc.";
+static const char pci_device_1103_0003[] = "HPT343";
+static const char pci_device_1103_0004[] = "HPT366/368/370/370A/372";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1103_0004_1103_0001[] = "HPT370A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1103_0004_1103_0005[] = "HPT370 UDMA100";
+#endif
+static const char pci_device_1103_0005[] = "HPT372A";
+static const char pci_device_1103_0006[] = "HPT302";
+static const char pci_device_1103_0007[] = "HPT371";
+static const char pci_device_1103_0008[] = "HPT374";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1104[] = "RasterOps Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1105[] = "Sigma Designs, Inc.";
+static const char pci_device_1105_1105[] = "REALmagic Xcard MPEG 1/2/3/4 DVD Decoder";
+static const char pci_device_1105_8300[] = "REALmagic Hollywood Plus DVD Decoder";
+static const char pci_device_1105_8400[] = "EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder";
+#endif
+static const char pci_vendor_1106[] = "VIA Technologies, Inc.";
+static const char pci_device_1106_0102[] = "Embedded VIA Ethernet Controller";
+static const char pci_device_1106_0130[] = "VT6305 1394.A Controller";
+static const char pci_device_1106_0305[] = "VT8363/8365 [KT133/KM133]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0305_1043_8033[] = "A7V Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0305_1043_803e[] = "A7V-E Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0305_1043_8042[] = "A7V133/A7V133-C Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0305_147b_a401[] = "KT7/KT7-RAID/KT7A/KT7A-RAID Mainboard";
+#endif
+static const char pci_device_1106_0391[] = "VT8371 [KX133]";
+static const char pci_device_1106_0501[] = "VT8501 [Apollo MVP4]";
+static const char pci_device_1106_0505[] = "VT82C505";
+static const char pci_device_1106_0561[] = "VT82C561";
+static const char pci_device_1106_0571[] = "VT82C586/B/686A/B PIPC Bus Master IDE";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0571_1043_8052[] = "VT8233A Bus Master ATA100/66/33 IDE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0571_1106_0571[] = "VT8235 Bus Master ATA133/100/66/33 IDE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0571_1179_0001[] = "Magnia Z310";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0571_1458_5002[] = "GA-7VAX Mainboard";
+#endif
+static const char pci_device_1106_0576[] = "VT82C576 3V [Apollo Master]";
+static const char pci_device_1106_0585[] = "VT82C585VP [Apollo VP1/VPX]";
+static const char pci_device_1106_0586[] = "VT82C586/A/B PCI-to-ISA [Apollo VP]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0586_1106_0000[] = "MVP3 ISA Bridge";
+#endif
+static const char pci_device_1106_0595[] = "VT82C595 [Apollo VP2]";
+static const char pci_device_1106_0596[] = "VT82C596 ISA [Mobile South]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0596_1106_0000[] = "VT82C596/A/B PCI to ISA Bridge";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0596_1458_0596[] = "VT82C596/A/B PCI to ISA Bridge";
+#endif
+static const char pci_device_1106_0597[] = "VT82C597 [Apollo VP3]";
+static const char pci_device_1106_0598[] = "VT82C598 [Apollo MVP3]";
+static const char pci_device_1106_0601[] = "VT8601 [Apollo ProMedia]";
+static const char pci_device_1106_0605[] = "VT8605 [ProSavage PM133]";
+static const char pci_device_1106_0680[] = "VT82C680 [Apollo P6]";
+static const char pci_device_1106_0686[] = "VT82C686 [Apollo Super South]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_1043_8033[] = "A7V Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_1043_803e[] = "A7V-E Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_1043_8040[] = "A7M266 Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_1043_8042[] = "A7V133/A7V133-C Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_1106_0000[] = "VT82C686/A PCI to ISA Bridge";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_1106_0686[] = "VT82C686/A PCI to ISA Bridge";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_1179_0001[] = "Magnia Z310";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0686_147b_a702[] = "KG7-Lite Mainboard";
+#endif
+static const char pci_device_1106_0691[] = "VT82C693A/694x [Apollo PRO133x]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0691_1179_0001[] = "Magnia Z310";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_0691_1458_0691[] = "VT82C691 Apollo Pro System Controller";
+#endif
+static const char pci_device_1106_0693[] = "VT82C693 [Apollo Pro Plus]";
+static const char pci_device_1106_0698[] = "VT82C693A [Apollo Pro133 AGP]";
+static const char pci_device_1106_0926[] = "VT82C926 [Amazon]";
+static const char pci_device_1106_1000[] = "VT82C570MV";
+static const char pci_device_1106_1106[] = "VT82C570MV";
+static const char pci_device_1106_1571[] = "VT82C416MV";
+static const char pci_device_1106_1595[] = "VT82C595/97 [Apollo VP2/97]";
+static const char pci_device_1106_3038[] = "USB";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3038_0925_1234[] = "USB Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3038_1179_0001[] = "Magnia Z310";
+#endif
+static const char pci_device_1106_3040[] = "VT82C586B ACPI";
+static const char pci_device_1106_3043[] = "VT86C100A [Rhine]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3043_10bd_0000[] = "VT86C100A Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3043_1106_0100[] = "VT86C100A Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3043_1186_1400[] = "DFE-530TX rev A";
+#endif
+static const char pci_device_1106_3044[] = "IEEE 1394 Host Controller";
+static const char pci_device_1106_3050[] = "VT82C596 Power Management";
+static const char pci_device_1106_3051[] = "VT82C596 Power Management";
+static const char pci_device_1106_3057[] = "VT82C686 [Apollo Super ACPI]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3057_1043_8033[] = "A7V Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3057_1043_803e[] = "A7V-E Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3057_1043_8040[] = "A7M266 Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3057_1043_8042[] = "A7V133/A7V133-C Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3057_1179_0001[] = "Magnia Z310";
+#endif
+static const char pci_device_1106_3058[] = "VT82C686 AC97 Audio Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3058_0e11_b194[] = "Soundmax integrated digital audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3058_1106_4511[] = "Onboard Audio on EP7KXA";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3058_1458_7600[] = "Onboard Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3058_1462_3091[] = "MS-6309 Onboard Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3058_15dd_7609[] = "Onboard Audio";
+#endif
+static const char pci_device_1106_3059[] = "VT8233 AC97 Audio Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3059_1458_a002[] = "GA-7VAX Onboard Audio (Realtek ALC650)";
+#endif
+static const char pci_device_1106_3065[] = "VT6102 [Rhine-II]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3065_1106_0102[] = "VT6102 [Rhine II] Embeded Ethernet Controller on VT8235";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3065_1186_1400[] = "DFE-530TX rev A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3065_1186_1401[] = "DFE-530TX rev B";
+#endif
+static const char pci_device_1106_3068[] = "Intel 537 [AC97 Modem]";
+static const char pci_device_1106_3074[] = "VT8233 PCI to ISA Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3074_1043_8052[] = "VT8233A";
+#endif
+static const char pci_device_1106_3091[] = "VT8633 [Apollo Pro266]";
+static const char pci_device_1106_3099[] = "VT8366/A/7 [Apollo KT266/A/333]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3099_1043_8064[] = "A7V266-E Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3099_1043_807f[] = "A7V333 Mainboard";
+#endif
+static const char pci_device_1106_3101[] = "VT8653 Host Bridge";
+static const char pci_device_1106_3102[] = "VT8662 Host Bridge";
+static const char pci_device_1106_3103[] = "VT8615 Host Bridge";
+static const char pci_device_1106_3104[] = "USB 2.0";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3104_1458_5004[] = "GA-7VAX Mainboard";
+#endif
+static const char pci_device_1106_3106[] = "VT6105 [Rhine-III]";
+static const char pci_device_1106_3109[] = "VT8233C PCI to ISA Bridge";
+static const char pci_device_1106_3112[] = "VT8361 [KLE133] Host Bridge";
+static const char pci_device_1106_3116[] = "VT8375 [KM266] Host Bridge";
+static const char pci_device_1106_3122[] = "VT8623 [Apollo CLE266] integrated CastleRock graphics";
+static const char pci_device_1106_3123[] = "VT8623 [Apollo CLE266]";
+static const char pci_device_1106_3128[] = "VT8753 [P4X266 AGP]";
+static const char pci_device_1106_3133[] = "VT3133 Host Bridge";
+static const char pci_device_1106_3147[] = "VT8233A ISA Bridge";
+static const char pci_device_1106_3148[] = "P4M266 Host Bridge";
+static const char pci_device_1106_3156[] = "P/KN266 Host Bridge";
+static const char pci_device_1106_3168[] = "VT8374 P4X400 Host Controller/AGP Bridge";
+static const char pci_device_1106_3177[] = "VT8235 ISA Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3177_1458_5001[] = "GA-7VAX Mainboard";
+#endif
+static const char pci_device_1106_3189[] = "VT8377 [KT400 AGP] Host Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1106_3189_1458_5000[] = "GA-7VAX Mainboard";
+#endif
+static const char pci_device_1106_5030[] = "VT82C596 ACPI [Apollo PRO]";
+static const char pci_device_1106_6100[] = "VT85C100A [Rhine II]";
+static const char pci_device_1106_8231[] = "VT8231 [PCI-to-ISA Bridge]";
+static const char pci_device_1106_8235[] = "VT8235 ACPI";
+static const char pci_device_1106_8305[] = "VT8363/8365 [KT133/KM133 AGP]";
+static const char pci_device_1106_8391[] = "VT8371 [KX133 AGP]";
+static const char pci_device_1106_8501[] = "VT8501 [Apollo MVP4 AGP]";
+static const char pci_device_1106_8596[] = "VT82C596 [Apollo PRO AGP]";
+static const char pci_device_1106_8597[] = "VT82C597 [Apollo VP3 AGP]";
+static const char pci_device_1106_8598[] = "VT82C598/694x [Apollo MVP3/Pro133x AGP]";
+static const char pci_device_1106_8601[] = "VT8601 [Apollo ProMedia AGP]";
+static const char pci_device_1106_8605[] = "VT8605 [PM133 AGP]";
+static const char pci_device_1106_8691[] = "VT82C691 [Apollo Pro]";
+static const char pci_device_1106_8693[] = "VT82C693 [Apollo Pro Plus] PCI Bridge";
+static const char pci_device_1106_b091[] = "VT8633 [Apollo Pro266 AGP]";
+static const char pci_device_1106_b099[] = "VT8366/A/7 [Apollo KT266/A/333 AGP]";
+static const char pci_device_1106_b101[] = "VT8653 AGP Bridge";
+static const char pci_device_1106_b102[] = "VT8362 AGP Bridge";
+static const char pci_device_1106_b103[] = "VT8615 AGP Bridge";
+static const char pci_device_1106_b112[] = "VT8361 [KLE133] AGP Bridge";
+static const char pci_device_1106_b168[] = "VT8235 PCI Bridge";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1107[] = "Stratus Computers";
+static const char pci_device_1107_0576[] = "VIA VT82C570MV [Apollo] (Wrong vendor ID!)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1108[] = "Proteon, Inc.";
+static const char pci_device_1108_0100[] = "p1690plus_AA";
+static const char pci_device_1108_0101[] = "p1690plus_AB";
+static const char pci_device_1108_0105[] = "P1690Plus";
+static const char pci_device_1108_0108[] = "P1690Plus";
+static const char pci_device_1108_0138[] = "P1690Plus";
+static const char pci_device_1108_0139[] = "P1690Plus";
+static const char pci_device_1108_013c[] = "P1690Plus";
+static const char pci_device_1108_013d[] = "P1690Plus";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1109[] = "Cogent Data Technologies, Inc.";
+static const char pci_device_1109_1400[] = "EM110TX [EX110TX]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_110a[] = "Siemens Nixdorf AG";
+static const char pci_device_110a_0002[] = "Pirahna 2-port";
+static const char pci_device_110a_0005[] = "Tulip controller, power management, switch extender";
+static const char pci_device_110a_2102[] = "DSCC4 WAN adapter";
+static const char pci_device_110a_4942[] = "FPGA I-Bus Tracer for MBD";
+static const char pci_device_110a_6120[] = "SZB6120";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_110b[] = "Chromatic Research Inc.";
+static const char pci_device_110b_0001[] = "Mpact Media Processor";
+static const char pci_device_110b_0004[] = "Mpact 2";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_110c[] = "Mini-Max Technology, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_110d[] = "Znyx Advanced Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_110e[] = "CPU Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_110f[] = "Ross Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1110[] = "Powerhouse Systems";
+static const char pci_device_1110_6037[] = "Firepower Powerized SMP I/O ASIC";
+static const char pci_device_1110_6073[] = "Firepower Powerized SMP I/O ASIC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1111[] = "Santa Cruz Operation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1112[] = "Osicom Technologies Inc";
+static const char pci_device_1112_2200[] = "FDDI Adapter";
+static const char pci_device_1112_2300[] = "Fast Ethernet Adapter";
+static const char pci_device_1112_2340[] = "4 Port Fast Ethernet Adapter";
+static const char pci_device_1112_2400[] = "ATM Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1113[] = "Accton Technology Corporation";
+static const char pci_device_1113_1211[] = "SMC2-1211TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1113_1211_103c_1207[] = "EN-1207D Fast Ethernet Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1113_1211_1113_1211[] = "EN-1207D Fast Ethernet Adapter";
+#endif
+static const char pci_device_1113_1216[] = "EN-1216 Ethernet Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1113_1216_111a_1020[] = "SpeedStream 1020 PCI 10/100 Ethernet Adaptor [EN-1207F-TX ?]";
+#endif
+static const char pci_device_1113_1217[] = "EN-1217 Ethernet Adapter";
+static const char pci_device_1113_5105[] = "10Mbps Network card";
+static const char pci_device_1113_9211[] = "EN-1207D Fast Ethernet Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1113_9211_1113_9211[] = "EN-1207D Fast Ethernet Adapter";
+#endif
+static const char pci_device_1113_9511[] = "Fast Ethernet Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1114[] = "Atmel Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1115[] = "3D Labs";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1116[] = "Data Translation";
+static const char pci_device_1116_0022[] = "DT3001";
+static const char pci_device_1116_0023[] = "DT3002";
+static const char pci_device_1116_0024[] = "DT3003";
+static const char pci_device_1116_0025[] = "DT3004";
+static const char pci_device_1116_0026[] = "DT3005";
+static const char pci_device_1116_0027[] = "DT3001-PGL";
+static const char pci_device_1116_0028[] = "DT3003-PGL";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1117[] = "Datacube, Inc";
+static const char pci_device_1117_9500[] = "Max-1C SVGA card";
+static const char pci_device_1117_9501[] = "Max-1C image processing";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1118[] = "Berg Electronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1119[] = "ICP Vortex Computersysteme GmbH";
+static const char pci_device_1119_0000[] = "GDT 6000/6020/6050";
+static const char pci_device_1119_0001[] = "GDT 6000B/6010";
+static const char pci_device_1119_0002[] = "GDT 6110/6510";
+static const char pci_device_1119_0003[] = "GDT 6120/6520";
+static const char pci_device_1119_0004[] = "GDT 6530";
+static const char pci_device_1119_0005[] = "GDT 6550";
+static const char pci_device_1119_0006[] = "GDT 6x17";
+static const char pci_device_1119_0007[] = "GDT 6x27";
+static const char pci_device_1119_0008[] = "GDT 6537";
+static const char pci_device_1119_0009[] = "GDT 6557";
+static const char pci_device_1119_000a[] = "GDT 6115/6515";
+static const char pci_device_1119_000b[] = "GDT 6125/6525";
+static const char pci_device_1119_000c[] = "GDT 6535";
+static const char pci_device_1119_000d[] = "GDT 6555";
+static const char pci_device_1119_0100[] = "GDT 6117RP/6517RP";
+static const char pci_device_1119_0101[] = "GDT 6127RP/6527RP";
+static const char pci_device_1119_0102[] = "GDT 6537RP";
+static const char pci_device_1119_0103[] = "GDT 6557RP";
+static const char pci_device_1119_0104[] = "GDT 6111RP/6511RP";
+static const char pci_device_1119_0105[] = "GDT 6121RP/6521RP";
+static const char pci_device_1119_0110[] = "GDT 6117RD/6517RD";
+static const char pci_device_1119_0111[] = "GDT 6127RD/6527RD";
+static const char pci_device_1119_0112[] = "GDT 6537RD";
+static const char pci_device_1119_0113[] = "GDT 6557RD";
+static const char pci_device_1119_0114[] = "GDT 6111RD/6511RD";
+static const char pci_device_1119_0115[] = "GDT 6121RD/6521RD";
+static const char pci_device_1119_0118[] = "GDT 6118RD/6518RD/6618RD";
+static const char pci_device_1119_0119[] = "GDT 6128RD/6528RD/6628RD";
+static const char pci_device_1119_011a[] = "GDT 6538RD/6638RD";
+static const char pci_device_1119_011b[] = "GDT 6558RD/6658RD";
+static const char pci_device_1119_0120[] = "GDT 6117RP2/6517RP2";
+static const char pci_device_1119_0121[] = "GDT 6127RP2/6527RP2";
+static const char pci_device_1119_0122[] = "GDT 6537RP2";
+static const char pci_device_1119_0123[] = "GDT 6557RP2";
+static const char pci_device_1119_0124[] = "GDT 6111RP2/6511RP2";
+static const char pci_device_1119_0125[] = "GDT 6121RP2/6521RP2";
+static const char pci_device_1119_0136[] = "GDT 6113RS/6513RS";
+static const char pci_device_1119_0137[] = "GDT 6123RS/6523RS";
+static const char pci_device_1119_0138[] = "GDT 6118RS/6518RS/6618RS";
+static const char pci_device_1119_0139[] = "GDT 6128RS/6528RS/6628RS";
+static const char pci_device_1119_013a[] = "GDT 6538RS/6638RS";
+static const char pci_device_1119_013b[] = "GDT 6558RS/6658RS";
+static const char pci_device_1119_013c[] = "GDT 6533RS/6633RS";
+static const char pci_device_1119_013d[] = "GDT 6543RS/6643RS";
+static const char pci_device_1119_013e[] = "GDT 6553RS/6653RS";
+static const char pci_device_1119_013f[] = "GDT 6563RS/6663RS";
+static const char pci_device_1119_0166[] = "GDT 7113RN/7513RN/7613RN";
+static const char pci_device_1119_0167[] = "GDT 7123RN/7523RN/7623RN";
+static const char pci_device_1119_0168[] = "GDT 7118RN/7518RN/7518RN";
+static const char pci_device_1119_0169[] = "GDT 7128RN/7528RN/7628RN";
+static const char pci_device_1119_016a[] = "GDT 7538RN/7638RN";
+static const char pci_device_1119_016b[] = "GDT 7558RN/7658RN";
+static const char pci_device_1119_016c[] = "GDT 7533RN/7633RN";
+static const char pci_device_1119_016d[] = "GDT 7543RN/7643RN";
+static const char pci_device_1119_016e[] = "GDT 7553RN/7653RN";
+static const char pci_device_1119_016f[] = "GDT 7563RN/7663RN";
+static const char pci_device_1119_01d6[] = "GDT 4x13RZ";
+static const char pci_device_1119_01d7[] = "GDT 4x23RZ";
+static const char pci_device_1119_01f6[] = "GDT 8x13RZ";
+static const char pci_device_1119_01f7[] = "GDT 8x23RZ";
+static const char pci_device_1119_01fc[] = "GDT 8x33RZ";
+static const char pci_device_1119_01fd[] = "GDT 8x43RZ";
+static const char pci_device_1119_01fe[] = "GDT 8x53RZ";
+static const char pci_device_1119_01ff[] = "GDT 8x63RZ";
+static const char pci_device_1119_0210[] = "GDT 6519RD/6619RD";
+static const char pci_device_1119_0211[] = "GDT 6529RD/6629RD";
+static const char pci_device_1119_0260[] = "GDT 7519RN/7619RN";
+static const char pci_device_1119_0261[] = "GDT 7529RN/7629RN";
+static const char pci_device_1119_0300[] = "GDT Raid Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_111a[] = "Efficient Networks, Inc";
+static const char pci_device_111a_0000[] = "155P-MF1 (FPGA)";
+static const char pci_device_111a_0002[] = "155P-MF1 (ASIC)";
+static const char pci_device_111a_0003[] = "ENI-25P ATM";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0003_111a_0000[] = "ENI-25p Miniport ATM Adapter";
+#endif
+static const char pci_device_111a_0005[] = "SpeedStream (LANAI)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0005_111a_0001[] = "ENI-3010 ATM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0005_111a_0009[] = "ENI-3060 ADSL (VPI=0)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0005_111a_0101[] = "ENI-3010 ATM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0005_111a_0109[] = "ENI-3060CO ADSL (VPI=0)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0005_111a_0809[] = "ENI-3060 ADSL (VPI=0 or 8)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0005_111a_0909[] = "ENI-3060CO ADSL (VPI=0 or 8)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0005_111a_0a09[] = "ENI-3060 ADSL (VPI=<0..15>)";
+#endif
+static const char pci_device_111a_0007[] = "SpeedStream ADSL";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_111a_0007_111a_1001[] = "ENI-3061 ADSL [ASIC]";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_111b[] = "Teledyne Electronic Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_111c[] = "Tricord Systems Inc.";
+static const char pci_device_111c_0001[] = "Powerbis Bridge";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_111d[] = "Integrated Device Tech";
+static const char pci_device_111d_0001[] = "IDT77211 ATM Adapter";
+static const char pci_device_111d_0003[] = "IDT77252 ATM network controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_111e[] = "Eldec";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_111f[] = "Precision Digital Images";
+static const char pci_device_111f_4a47[] = "Precision MX Video engine interface";
+static const char pci_device_111f_5243[] = "Frame capture bus interface";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1120[] = "EMC Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1121[] = "Zilog";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1122[] = "Multi-tech Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1123[] = "Excellent Design, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1124[] = "Leutron Vision AG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1125[] = "Eurocore";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1126[] = "Vigra";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1127[] = "FORE Systems Inc";
+static const char pci_device_1127_0200[] = "ForeRunner PCA-200 ATM";
+static const char pci_device_1127_0210[] = "PCA-200PC";
+static const char pci_device_1127_0250[] = "ATM";
+static const char pci_device_1127_0300[] = "ForeRunner PCA-200EPC ATM";
+static const char pci_device_1127_0310[] = "ATM";
+static const char pci_device_1127_0400[] = "ForeRunnerHE ATM Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1127_0400_1127_0400[] = "ForeRunnerHE ATM";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1129[] = "Firmworks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_112a[] = "Hermes Electronics Company, Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_112b[] = "Linotype - Hell AG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_112c[] = "Zenith Data Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_112d[] = "Ravicad";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_112e[] = "Infomedia Microelectronics Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_112f[] = "Imaging Technology Inc";
+static const char pci_device_112f_0000[] = "MVC IC-PCI";
+static const char pci_device_112f_0001[] = "MVC IM-PCI Video frame grabber/processor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1130[] = "Computervision";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1131[] = "Philips Semiconductors";
+static const char pci_device_1131_1561[] = "USB 1.1 Host Controller";
+static const char pci_device_1131_1562[] = "USB 2.0 Host Controller";
+static const char pci_device_1131_3400[] = "SmartPCI56(UCB1500) 56K Modem";
+static const char pci_device_1131_7130[] = "SAA7130 Video Broadcast Decoder";
+static const char pci_device_1131_7133[] = "SAA7133 Audio+video broadcast decoder";
+static const char pci_device_1131_7134[] = "SAA7134";
+static const char pci_device_1131_7135[] = "SAA7135 Audio+video broadcast decoder";
+static const char pci_device_1131_7145[] = "SAA7145";
+static const char pci_device_1131_7146[] = "SAA7146";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1131_7146_114b_2003[] = "DVRaptor Video Edit/Capture Card";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1131_7146_11bd_0006[] = "DV500 Overlay";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1131_7146_11bd_000a[] = "DV500 Overlay";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1132[] = "Mitel Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1133[] = "Eicon Technology Corporation";
+static const char pci_device_1133_7901[] = "EiconCard S90";
+static const char pci_device_1133_7902[] = "EiconCard S90";
+static const char pci_device_1133_7911[] = "EiconCard S91";
+static const char pci_device_1133_7912[] = "EiconCard S91";
+static const char pci_device_1133_7941[] = "EiconCard S94";
+static const char pci_device_1133_7942[] = "EiconCard S94";
+static const char pci_device_1133_7943[] = "EiconCard S94";
+static const char pci_device_1133_7944[] = "EiconCard S94";
+static const char pci_device_1133_b921[] = "EiconCard P92";
+static const char pci_device_1133_b922[] = "EiconCard P92";
+static const char pci_device_1133_b923[] = "EiconCard P92";
+static const char pci_device_1133_e001[] = "DIVA 20PRO";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1133_e001_1133_e001[] = "DIVA Pro 2.0 S/T";
+#endif
+static const char pci_device_1133_e002[] = "DIVA 20";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1133_e002_1133_e002[] = "DIVA 2.0 S/T";
+#endif
+static const char pci_device_1133_e003[] = "DIVA 20PRO_U";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1133_e003_1133_e003[] = "DIVA Pro 2.0 U";
+#endif
+static const char pci_device_1133_e004[] = "DIVA 20_U";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1133_e004_1133_e004[] = "DIVA 2.0 U";
+#endif
+static const char pci_device_1133_e005[] = "DIVA LOW";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1133_e005_1133_e005[] = "DIVA 2.01 S/T";
+#endif
+static const char pci_device_1133_e00b[] = "DIVA 2.02";
+static const char pci_device_1133_e010[] = "DIVA Server BRI-2M";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1133_e010_1133_e010[] = "DIVA Server BRI-2M";
+#endif
+static const char pci_device_1133_e012[] = "DIVA Server BRI-8M";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1133_e012_1133_e012[] = "DIVA Server BRI-8M";
+#endif
+static const char pci_device_1133_e014[] = "DIVA Server PRI-30M";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1133_e014_1133_e014[] = "DIVA Server PRI-30M";
+#endif
+static const char pci_device_1133_e018[] = "DIVA Server BRI-2M/-2F";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1134[] = "Mercury Computer Systems";
+static const char pci_device_1134_0001[] = "Raceway Bridge";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1135[] = "Fuji Xerox Co Ltd";
+static const char pci_device_1135_0001[] = "Printer controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1136[] = "Momentum Data Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1137[] = "Cisco Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1138[] = "Ziatech Corporation";
+static const char pci_device_1138_8905[] = "8905 [STD 32 Bridge]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1139[] = "Dynamic Pictures, Inc";
+static const char pci_device_1139_0001[] = "VGA Compatable 3D Graphics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_113a[] = "FWB Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_113b[] = "Network Computing Devices";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_113c[] = "Cyclone Microsystems, Inc.";
+static const char pci_device_113c_0000[] = "PCI-9060 i960 Bridge";
+static const char pci_device_113c_0001[] = "PCI-SDK [PCI i960 Evaluation Platform]";
+static const char pci_device_113c_0911[] = "PCI-911 [i960Jx-based Intelligent I/O Controller]";
+static const char pci_device_113c_0912[] = "PCI-912 [i960CF-based Intelligent I/O Controller]";
+static const char pci_device_113c_0913[] = "PCI-913";
+static const char pci_device_113c_0914[] = "PCI-914 [I/O Controller w/ secondary PCI bus]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_113d[] = "Leading Edge Products Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_113e[] = "Sanyo Electric Co - Computer Engineering Dept";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_113f[] = "Equinox Systems, Inc.";
+static const char pci_device_113f_0808[] = "SST-64P Adapter";
+static const char pci_device_113f_1010[] = "SST-128P Adapter";
+static const char pci_device_113f_80c0[] = "SST-16P DB Adapter";
+static const char pci_device_113f_80c4[] = "SST-16P RJ Adapter";
+static const char pci_device_113f_80c8[] = "SST-16P Adapter";
+static const char pci_device_113f_8888[] = "SST-4P Adapter";
+static const char pci_device_113f_9090[] = "SST-8P Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1140[] = "Intervoice Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1141[] = "Crest Microsystem Inc";
+#endif
+static const char pci_vendor_1142[] = "Alliance Semiconductor Corporation";
+static const char pci_device_1142_3210[] = "AP6410";
+static const char pci_device_1142_6422[] = "ProVideo 6422";
+static const char pci_device_1142_6424[] = "ProVideo 6424";
+static const char pci_device_1142_6425[] = "ProMotion AT25";
+static const char pci_device_1142_643d[] = "ProMotion AT3D";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1143[] = "NetPower, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1144[] = "Cincinnati Milacron";
+static const char pci_device_1144_0001[] = "Noservo controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1145[] = "Workbit Corporation";
+static const char pci_device_1145_8007[] = "NinjaSCSI-32 Workbit";
+static const char pci_device_1145_f007[] = "NinjaSCSI-32 KME";
+static const char pci_device_1145_f010[] = "NinjaSCSI-32 Workbit";
+static const char pci_device_1145_f012[] = "NinjaSCSI-32 Logitec";
+static const char pci_device_1145_f013[] = "NinjaSCSI-32 Logitec";
+static const char pci_device_1145_f015[] = "NinjaSCSI-32 Melco";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1146[] = "Force Computers";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1147[] = "Interface Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1148[] = "Syskonnect (Schneider & Koch)";
+static const char pci_device_1148_4000[] = "FDDI Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_0e11_b03b[] = "Netelligent 100 FDDI DAS Fibre SC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_0e11_b03c[] = "Netelligent 100 FDDI SAS Fibre SC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_0e11_b03d[] = "Netelligent 100 FDDI DAS UTP";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_0e11_b03e[] = "Netelligent 100 FDDI SAS UTP";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_0e11_b03f[] = "Netelligent 100 FDDI SAS Fibre MIC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5521[] = "FDDI SK-5521 (SK-NET FDDI-UP)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5522[] = "FDDI SK-5522 (SK-NET FDDI-UP DAS)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5541[] = "FDDI SK-5541 (SK-NET FDDI-FP)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5543[] = "FDDI SK-5543 (SK-NET FDDI-LP)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5544[] = "FDDI SK-5544 (SK-NET FDDI-LP DAS)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5821[] = "FDDI SK-5821 (SK-NET FDDI-UP64)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5822[] = "FDDI SK-5822 (SK-NET FDDI-UP64 DAS)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5841[] = "FDDI SK-5841 (SK-NET FDDI-FP64)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5843[] = "FDDI SK-5843 (SK-NET FDDI-LP64)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4000_1148_5844[] = "FDDI SK-5844 (SK-NET FDDI-LP64 DAS)";
+#endif
+static const char pci_device_1148_4200[] = "Token Ring adapter";
+static const char pci_device_1148_4300[] = "Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9821[] = "SK-9821 (1000Base-T single link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9822[] = "SK-9822 (1000Base-T dual link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9841[] = "SK-9841 (1000Base-LX single link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9842[] = "SK-9842 (1000Base-LX dual link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9843[] = "SK-9843 (1000Base-SX single link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9844[] = "SK-9844 (1000Base-SX dual link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9861[] = "SK-9861 (1000Base-SX VF45 single link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9862[] = "SK-9862 (1000Base-SX VF45 dual link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9871[] = "SK-9871 (1000Base-ZX single link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1148_9872[] = "SK-9872 (1000Base-ZX dual link)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1259_2970[] = "AT-2970SX [Allied Telesyn]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1259_2972[] = "AT-2970T [Allied Telesyn]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1259_2975[] = "AT-2970SX [Allied Telesyn]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4300_1259_2977[] = "AT-2970T [Allied Telesyn]";
+#endif
+static const char pci_device_1148_4320[] = "SK-98xx Gigabit Ethernet Server Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4320_1148_5021[] = "SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4320_1148_5041[] = "SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4320_1148_5043[] = "SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4320_1148_5051[] = "SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4320_1148_5061[] = "SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4320_1148_5071[] = "SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1148_4320_1148_9521[] = "SK-9521 10/100/1000Base-T Adapter";
+#endif
+static const char pci_device_1148_4400[] = "Gigabit Ethernet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1149[] = "Win System Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_114a[] = "VMIC";
+static const char pci_device_114a_5579[] = "VMIPCI-5579 (Reflective Memory Card)";
+static const char pci_device_114a_5587[] = "VMIPCI-5587 (Reflective Memory Card)";
+static const char pci_device_114a_6504[] = "VMIC PCI 7755 FPGA";
+static const char pci_device_114a_7587[] = "VMIVME-7587";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_114b[] = "Canopus Co., Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_114c[] = "Annabooks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_114d[] = "IC Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_114e[] = "Nikon Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_114f[] = "Digi International";
+static const char pci_device_114f_0002[] = "AccelePort EPC";
+static const char pci_device_114f_0003[] = "RightSwitch SE-6";
+static const char pci_device_114f_0004[] = "AccelePort Xem";
+static const char pci_device_114f_0005[] = "AccelePort Xr";
+static const char pci_device_114f_0006[] = "AccelePort Xr,C/X";
+static const char pci_device_114f_0009[] = "AccelePort Xr/J";
+static const char pci_device_114f_000a[] = "AccelePort EPC/J";
+static const char pci_device_114f_000c[] = "DataFirePRIme T1 (1-port)";
+static const char pci_device_114f_000d[] = "SyncPort 2-Port (x.25/FR)";
+static const char pci_device_114f_0011[] = "AccelePort 8r EIA-232 (IBM)";
+static const char pci_device_114f_0012[] = "AccelePort 8r EIA-422";
+static const char pci_device_114f_0013[] = "AccelePort Xr";
+static const char pci_device_114f_0014[] = "AccelePort 8r EIA-422";
+static const char pci_device_114f_0015[] = "AccelePort Xem";
+static const char pci_device_114f_0016[] = "AccelePort EPC/X";
+static const char pci_device_114f_0017[] = "AccelePort C/X";
+static const char pci_device_114f_001a[] = "DataFirePRIme E1 (1-port)";
+static const char pci_device_114f_001b[] = "AccelePort C/X (IBM)";
+static const char pci_device_114f_001d[] = "DataFire RAS T1/E1/PRI";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_114f_001d_114f_0050[] = "DataFire RAS E1 Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_114f_001d_114f_0051[] = "DataFire RAS Dual E1 Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_114f_001d_114f_0052[] = "DataFire RAS T1 Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_114f_001d_114f_0053[] = "DataFire RAS Dual T1 Adapter";
+#endif
+static const char pci_device_114f_0023[] = "AccelePort RAS";
+static const char pci_device_114f_0024[] = "DataFire RAS B4 ST/U";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_114f_0024_114f_0030[] = "DataFire RAS BRI U Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_114f_0024_114f_0031[] = "DataFire RAS BRI S/T Adapter";
+#endif
+static const char pci_device_114f_0026[] = "AccelePort 4r 920";
+static const char pci_device_114f_0027[] = "AccelePort Xr 920";
+static const char pci_device_114f_0034[] = "AccelePort 2r 920";
+static const char pci_device_114f_0035[] = "DataFire DSP T1/E1/PRI cPCI";
+static const char pci_device_114f_0040[] = "AccelePort Xp";
+static const char pci_device_114f_0042[] = "AccelePort 2p PCI";
+static const char pci_device_114f_0070[] = "Datafire Micro V IOM2 (Europe)";
+static const char pci_device_114f_0071[] = "Datafire Micro V (Europe)";
+static const char pci_device_114f_0072[] = "Datafire Micro V IOM2 (North America)";
+static const char pci_device_114f_0073[] = "Datafire Micro V (North America)";
+static const char pci_device_114f_6001[] = "Avanstar";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1150[] = "Thinking Machines Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1151[] = "JAE Electronics Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1152[] = "Megatek";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1153[] = "Land Win Electronic Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1154[] = "Melco Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1155[] = "Pine Technology Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1156[] = "Periscope Engineering";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1157[] = "Avsys Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1158[] = "Voarx R & D Inc";
+static const char pci_device_1158_3011[] = "Tokenet/vg 1001/10m anylan";
+static const char pci_device_1158_9050[] = "Lanfleet/Truevalue";
+static const char pci_device_1158_9051[] = "Lanfleet/Truevalue";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1159[] = "Mutech Corp";
+static const char pci_device_1159_0001[] = "MV-1000";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_115a[] = "Harlequin Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_115b[] = "Parallax Graphics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_115c[] = "Photron Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_115d[] = "Xircom";
+static const char pci_device_115d_0003[] = "Cardbus Ethernet 10/100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_1014_0181[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_1014_1181[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_1014_8181[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_1014_9181[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_115d_0181[] = "Cardbus Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_115d_1181[] = "Cardbus Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_1179_0181[] = "Cardbus Ethernet 10/100";
+#endif
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_8086_8181[] = "EtherExpress PRO/100 Mobile CardBus 32 Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0003_8086_9181[] = "EtherExpress PRO/100 Mobile CardBus 32 Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_115d_0005[] = "Cardbus Ethernet 10/100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0005_1014_0182[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0005_1014_1182[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0005_115d_0182[] = "Cardbus Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0005_115d_1182[] = "Cardbus Ethernet 10/100";
+#endif
+static const char pci_device_115d_0007[] = "Cardbus Ethernet 10/100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0007_1014_0182[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0007_1014_1182[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0007_115d_0182[] = "Cardbus Ethernet 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0007_115d_1182[] = "Cardbus Ethernet 10/100";
+#endif
+static const char pci_device_115d_000b[] = "Cardbus Ethernet 10/100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_000b_1014_0183[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_000b_115d_0183[] = "Cardbus Ethernet 10/100";
+#endif
+static const char pci_device_115d_000c[] = "Mini-PCI V.90 56k Modem";
+static const char pci_device_115d_000f[] = "Cardbus Ethernet 10/100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_000f_1014_0183[] = "10/100 EtherJet Cardbus Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_000f_115d_0183[] = "Cardbus Ethernet 10/100";
+#endif
+static const char pci_device_115d_0101[] = "Cardbus 56k modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0101_115d_1081[] = "Cardbus 56k Modem";
+#endif
+static const char pci_device_115d_0103[] = "Cardbus Ethernet + 56k Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0103_1014_9181[] = "Cardbus 56k Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0103_1115_1181[] = "Cardbus Ethernet 100 + 56k Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0103_115d_1181[] = "CBEM56G-100 Ethernet + 56k Modem";
+#endif
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_115d_0103_8086_9181[] = "PRO/100 LAN + Modem56 CardBus";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_115e[] = "Peer Protocols Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_115f[] = "Maxtor Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1160[] = "Megasoft Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1161[] = "PFU Limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1162[] = "OA Laboratory Co Ltd";
+#endif
+static const char pci_vendor_1163[] = "Rendition";
+static const char pci_device_1163_0001[] = "Verite 1000";
+static const char pci_device_1163_2000[] = "Verite V2000/V2100/V2200";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1163_2000_1092_2000[] = "Stealth II S220";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1164[] = "Advanced Peripherals Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1165[] = "Imagraph Corporation";
+static const char pci_device_1165_0001[] = "Motion TPEG Recorder/Player with audio";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1166[] = "ServerWorks";
+static const char pci_device_1166_0005[] = "CNB20-LE Host Bridge";
+static const char pci_device_1166_0007[] = "CNB20-LE Host Bridge";
+static const char pci_device_1166_0008[] = "CNB20HE Host Bridge";
+static const char pci_device_1166_0009[] = "CNB20LE Host Bridge";
+static const char pci_device_1166_0010[] = "CIOB30";
+static const char pci_device_1166_0011[] = "CMIC-HE";
+static const char pci_device_1166_0012[] = "CMIC-LE";
+static const char pci_device_1166_0013[] = "CNB20-HE Host Bridge";
+static const char pci_device_1166_0014[] = "CNB20-HE Host Bridge";
+static const char pci_device_1166_0015[] = "CMIC-GC Host Bridge";
+static const char pci_device_1166_0016[] = "CMIC-GC Host Bridge";
+static const char pci_device_1166_0017[] = "GCNB-LE Host Bridge";
+static const char pci_device_1166_0200[] = "OSB4 South Bridge";
+static const char pci_device_1166_0201[] = "CSB5 South Bridge";
+static const char pci_device_1166_0203[] = "CSB6 South Bridge";
+static const char pci_device_1166_0211[] = "OSB4 IDE Controller";
+static const char pci_device_1166_0212[] = "CSB5 IDE Controller";
+static const char pci_device_1166_0213[] = "CSB6 RAID/IDE Controller";
+static const char pci_device_1166_0220[] = "OSB4/CSB5 OHCI USB Controller";
+static const char pci_device_1166_0221[] = "CSB6 OHCI USB Controller";
+static const char pci_device_1166_0225[] = "GCLE Host Bridge";
+static const char pci_device_1166_0227[] = "GCLE-2 Host Bridge";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1167[] = "Mutoh Industries Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1168[] = "Thine Electronics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1169[] = "Centre for Development of Advanced Computing";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_116a[] = "Polaris Communications";
+static const char pci_device_116a_6100[] = "Bus/Tag Channel";
+static const char pci_device_116a_6800[] = "Escon Channel";
+static const char pci_device_116a_7100[] = "Bus/Tag Channel";
+static const char pci_device_116a_7800[] = "Escon Channel";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_116b[] = "Connectware Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_116c[] = "Intelligent Resources Integrated Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_116d[] = "Martin-Marietta";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_116e[] = "Electronics for Imaging";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_116f[] = "Workstation Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1170[] = "Inventec Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1171[] = "Loughborough Sound Images Plc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1172[] = "Altera Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1173[] = "Adobe Systems, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1174[] = "Bridgeport Machines";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1175[] = "Mitron Computer Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1176[] = "SBE Incorporated";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1177[] = "Silicon Engineering";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1178[] = "Alfa, Inc.";
+static const char pci_device_1178_afa1[] = "Fast Ethernet Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1179[] = "Toshiba America Info Systems";
+static const char pci_device_1179_0103[] = "EX-IDE Type-B";
+static const char pci_device_1179_0404[] = "DVD Decoder card";
+static const char pci_device_1179_0406[] = "Tecra Video Capture device";
+static const char pci_device_1179_0407[] = "DVD Decoder card (Version 2)";
+static const char pci_device_1179_0601[] = "601";
+static const char pci_device_1179_0603[] = "ToPIC95 PCI to CardBus Bridge for Notebooks";
+static const char pci_device_1179_060a[] = "ToPIC95";
+static const char pci_device_1179_060f[] = "ToPIC97";
+static const char pci_device_1179_0617[] = "ToPIC95 PCI to Cardbus Bridge with ZV Support";
+static const char pci_device_1179_0618[] = "CPU to PCI and PCI to ISA bridge";
+static const char pci_device_1179_0701[] = "FIR Port";
+static const char pci_device_1179_0804[] = "TC6371AF SmartMedia Controller";
+static const char pci_device_1179_0805[] = "SD TypA Controller";
+static const char pci_device_1179_0d01[] = "FIR Port Type-DO";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1179_0d01_1179_0001[] = "FIR Port Type-DO";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_117a[] = "A-Trend Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_117b[] = "L G Electronics, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_117c[] = "Atto Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_117d[] = "Becton & Dickinson";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_117e[] = "T/R Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_117f[] = "Integrated Circuit Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1180[] = "Ricoh Co Ltd";
+static const char pci_device_1180_0465[] = "RL5c465";
+static const char pci_device_1180_0466[] = "RL5c466";
+static const char pci_device_1180_0475[] = "RL5c475";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1180_0475_144d_c006[] = "vpr Matrix 170B4 CardBus bridge";
+#endif
+static const char pci_device_1180_0476[] = "RL5c476 II";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1180_0476_1014_0185[] = "ThinkPad A/T/X Series";
+#endif
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1180_0476_104d_80df[] = "Vaio PCG-FX403";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1180_0476_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_1180_0477[] = "RL5c477";
+static const char pci_device_1180_0478[] = "RL5c478";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1180_0478_1014_0184[] = "ThinkPad A30p (2653-64G)";
+#endif
+static const char pci_device_1180_0522[] = "R5C522 IEEE 1394 Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1180_0522_1014_01cf[] = "ThinkPad A30p (2653-64G)";
+#endif
+static const char pci_device_1180_0551[] = "R5C551 IEEE 1394 Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1180_0551_144d_c006[] = "vpr Matrix 170B4";
+#endif
+static const char pci_device_1180_0552[] = "R5C552 IEEE 1394 Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1180_0552_1014_0511[] = "ThinkPad A/T/X Series";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1181[] = "Telmatics International";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1183[] = "Fujikura Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1184[] = "Forks Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1185[] = "Dataworld International Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1186[] = "D-Link System Inc";
+static const char pci_device_1186_0100[] = "DC21041";
+static const char pci_device_1186_1002[] = "DL10050 Sundance Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1186_1002_1186_1002[] = "DFE-550TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1186_1002_1186_1012[] = "DFE-580TX";
+#endif
+static const char pci_device_1186_1300[] = "RTL8139 Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1186_1300_1186_1300[] = "DFE-538TX 10/100 Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1186_1300_1186_1301[] = "DFE-530TX+ 10/100 Ethernet Adapter";
+#endif
+static const char pci_device_1186_1340[] = "DFE-690TXD CardBus PC Card";
+static const char pci_device_1186_1561[] = "DRP-32TXD Cardbus PC Card";
+static const char pci_device_1186_4000[] = "DL2K Ethernet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1187[] = "Advanced Technology Laboratories, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1188[] = "Shima Seiki Manufacturing Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1189[] = "Matsushita Electronics Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_118a[] = "Hilevel Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_118b[] = "Hypertec Pty Limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_118c[] = "Corollary, Inc";
+static const char pci_device_118c_0014[] = "PCIB [C-bus II to PCI bus host bridge chip]";
+static const char pci_device_118c_1117[] = "Intel 8-way XEON Profusion Chipset [Cache Coherency Filter]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_118d[] = "BitFlow Inc";
+static const char pci_device_118d_0001[] = "Raptor-PCI framegrabber";
+static const char pci_device_118d_0012[] = "Model 12 Road Runner Frame Grabber";
+static const char pci_device_118d_0014[] = "Model 14 Road Runner Frame Grabber";
+static const char pci_device_118d_0024[] = "Model 24 Road Runner Frame Grabber";
+static const char pci_device_118d_0044[] = "Model 44 Road Runner Frame Grabber";
+static const char pci_device_118d_0112[] = "Model 12 Road Runner Frame Grabber";
+static const char pci_device_118d_0114[] = "Model 14 Road Runner Frame Grabber";
+static const char pci_device_118d_0124[] = "Model 24 Road Runner Frame Grabber";
+static const char pci_device_118d_0144[] = "Model 44 Road Runner Frame Grabber";
+static const char pci_device_118d_0212[] = "Model 12 Road Runner Frame Grabber";
+static const char pci_device_118d_0214[] = "Model 14 Road Runner Frame Grabber";
+static const char pci_device_118d_0224[] = "Model 24 Road Runner Frame Grabber";
+static const char pci_device_118d_0244[] = "Model 44 Road Runner Frame Grabber";
+static const char pci_device_118d_0312[] = "Model 12 Road Runner Frame Grabber";
+static const char pci_device_118d_0314[] = "Model 14 Road Runner Frame Grabber";
+static const char pci_device_118d_0324[] = "Model 24 Road Runner Frame Grabber";
+static const char pci_device_118d_0344[] = "Model 44 Road Runner Frame Grabber";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_118e[] = "Hermstedt GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_118f[] = "Green Logic";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1190[] = "Tripace";
+static const char pci_device_1190_c731[] = "TP-910/920/940 PCI Ultra(Wide) SCSI Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1191[] = "Artop Electronic Corp";
+static const char pci_device_1191_0003[] = "SCSI Cache Host Adapter";
+static const char pci_device_1191_0004[] = "ATP8400";
+static const char pci_device_1191_0005[] = "ATP850UF";
+static const char pci_device_1191_0006[] = "ATP860 NO-BIOS";
+static const char pci_device_1191_0007[] = "ATP860";
+static const char pci_device_1191_0008[] = "ATP865 NO-ROM";
+static const char pci_device_1191_0009[] = "ATP865";
+static const char pci_device_1191_8002[] = "AEC6710 SCSI-2 Host Adapter";
+static const char pci_device_1191_8010[] = "AEC6712UW SCSI";
+static const char pci_device_1191_8020[] = "AEC6712U SCSI";
+static const char pci_device_1191_8030[] = "AEC6712S SCSI";
+static const char pci_device_1191_8040[] = "AEC6712D SCSI";
+static const char pci_device_1191_8050[] = "AEC6712SUW SCSI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1192[] = "Densan Company Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1193[] = "Zeitnet Inc.";
+static const char pci_device_1193_0001[] = "1221";
+static const char pci_device_1193_0002[] = "1225";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1194[] = "Toucan Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1195[] = "Ratoc System Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1196[] = "Hytec Electronics Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1197[] = "Gage Applied Sciences, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1198[] = "Lambda Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1199[] = "Attachmate Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_119a[] = "Mind Share, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_119b[] = "Omega Micro Inc.";
+static const char pci_device_119b_1221[] = "82C092G";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_119c[] = "Information Technology Inst.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_119d[] = "Bug, Inc. Sapporo Japan";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_119e[] = "Fujitsu Microelectronics Ltd.";
+static const char pci_device_119e_0001[] = "FireStream 155";
+static const char pci_device_119e_0003[] = "FireStream 50";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_119f[] = "Bull HN Information Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a0[] = "Convex Computer Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a1[] = "Hamamatsu Photonics K.K.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a2[] = "Sierra Research and Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a3[] = "Deuretzbacher GmbH & Co. Eng. KG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a4[] = "Barco Graphics NV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a5[] = "Microunity Systems Eng. Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a6[] = "Pure Data Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a7[] = "Power Computing Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a8[] = "Systech Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11a9[] = "InnoSys Inc.";
+static const char pci_device_11a9_4240[] = "AMCC S933Q Intelligent Serial Card";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11aa[] = "Actel";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ab[] = "Galileo Technology Ltd.";
+static const char pci_device_11ab_0146[] = "GT-64010/64010A System Controller";
+static const char pci_device_11ab_4611[] = "GT-64115 System Controller";
+static const char pci_device_11ab_4620[] = "GT-64120/64120A/64121A System Controller";
+static const char pci_device_11ab_4801[] = "GT-48001";
+static const char pci_device_11ab_f003[] = "GT-64010 Primary Image Piranha Image Generator";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ac[] = "Canon Information Systems Research Aust.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ad[] = "Lite-On Communications Inc";
+static const char pci_device_11ad_0002[] = "LNE100TX";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11ad_0002_11ad_0002[] = "LNE100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11ad_0002_11ad_0003[] = "LNE100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11ad_0002_11ad_f003[] = "LNE100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11ad_0002_11ad_ffff[] = "LNE100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11ad_0002_1385_f004[] = "FA310TX";
+#endif
+static const char pci_device_11ad_c115[] = "LNE100TX [Linksys EtherFast 10/100]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11ad_c115_11ad_c001[] = "LNE100TX [ver 2.0]";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ae[] = "Aztech System Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11af[] = "Avid Technology Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b0[] = "V3 Semiconductor Inc.";
+static const char pci_device_11b0_0002[] = "V300PSC";
+static const char pci_device_11b0_0292[] = "V292PBC [Am29030/40 Bridge]";
+static const char pci_device_11b0_0960[] = "V96xPBC";
+static const char pci_device_11b0_c960[] = "V96DPC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b1[] = "Apricot Computers";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b2[] = "Eastman Kodak";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b3[] = "Barr Systems Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b4[] = "Leitch Technology International";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b5[] = "Radstone Technology Plc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b6[] = "United Video Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b7[] = "Motorola";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b8[] = "XPoint Technologies, Inc";
+static const char pci_device_11b8_0001[] = "Quad PeerMaster";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11b9[] = "Pathlight Technology Inc.";
+static const char pci_device_11b9_c0ed[] = "SSA Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ba[] = "Videotron Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11bb[] = "Pyramid Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11bc[] = "Network Peripherals Inc";
+static const char pci_device_11bc_0001[] = "NP-PCI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11bd[] = "Pinnacle Systems Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11be[] = "International Microcircuits Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11bf[] = "Astrodesign, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c0[] = "Hewlett Packard";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c1[] = "Lucent Microelectronics";
+static const char pci_device_11c1_0440[] = "56k WinModem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_1033_8015[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_1033_8047[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_1033_804f[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_10cf_102c[] = "LB LT Modem V.90 56k";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_10cf_104a[] = "BIBLO LT Modem 56k";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_10cf_105f[] = "LB2 LT Modem V.90 56k";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_1179_0001[] = "Internal V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_11c1_0440[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_122d_4101[] = "MDP7800-U Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_122d_4102[] = "MDP7800SP-U Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_13e0_0040[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_13e0_0440[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_13e0_0441[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_13e0_0450[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_13e0_f100[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_13e0_f101[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_144d_2101[] = "LT56PV Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0440_149f_0440[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+static const char pci_device_11c1_0441[] = "56k WinModem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_1033_804d[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_1033_8065[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_1092_0440[] = "Supra 56i";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_1179_0001[] = "Internal V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_11c1_0440[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_11c1_0441[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_122d_4100[] = "MDP7800-U Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_13e0_0040[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_13e0_0100[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_13e0_0410[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_13e0_0420[] = "TelePath Internet 56k WinModem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_13e0_0440[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_13e0_0443[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_13e0_f102[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_1416_9804[] = "CommWave 56k Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_141d_0440[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_144f_0441[] = "Lucent 56k V.90 DF Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_144f_0449[] = "Lucent 56k V.90 DF Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_144f_110d[] = "Lucent Win Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_1468_0441[] = "Presario 56k V.90 DF Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0441_1668_0440[] = "Lucent Win Modem";
+#endif
+static const char pci_device_11c1_0442[] = "56k WinModem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_11c1_0440[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_11c1_0442[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_13e0_0412[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_13e0_0442[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_13fc_2471[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_144d_2104[] = "LT56PT Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_144f_1104[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_149f_0440[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0442_1668_0440[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+static const char pci_device_11c1_0443[] = "LT WinModem";
+static const char pci_device_11c1_0444[] = "LT WinModem";
+static const char pci_device_11c1_0445[] = "LT WinModem";
+static const char pci_device_11c1_0446[] = "LT WinModem";
+static const char pci_device_11c1_0447[] = "LT WinModem";
+static const char pci_device_11c1_0448[] = "WinModem 56k";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0448_1014_0131[] = "Lucent Win Modem";
+#endif
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0448_1033_8066[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0448_13e0_0030[] = "56k Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0448_13e0_0040[] = "LT WinModem 56k Data+Fax+Voice+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0448_1668_2400[] = "LT WinModem 56k (MiniPCI Ethernet+Modem)";
+#endif
+static const char pci_device_11c1_0449[] = "WinModem 56k";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0449_0e11_b14d[] = "56k V.90 Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0449_13e0_0020[] = "LT WinModem 56k Data+Fax";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0449_13e0_0041[] = "TelePath Internet 56k WinModem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0449_1436_0440[] = "Lucent Win Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0449_144f_0449[] = "Lucent 56k V.90 DFi Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0449_1468_0410[] = "IBM ThinkPad T23 (2647-4MG)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0449_1468_0440[] = "Lucent Win Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0449_1468_0449[] = "Presario 56k V.90 DFi Modem";
+#endif
+static const char pci_device_11c1_044a[] = "F-1156IV WinModem (V90, 56KFlex)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_044a_10cf_1072[] = "LB Global LT Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_044a_13e0_0012[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_044a_13e0_0042[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_044a_144f_1005[] = "LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd";
+#endif
+static const char pci_device_11c1_044b[] = "LT WinModem";
+static const char pci_device_11c1_044c[] = "LT WinModem";
+static const char pci_device_11c1_044d[] = "LT WinModem";
+static const char pci_device_11c1_044e[] = "LT WinModem";
+static const char pci_device_11c1_044f[] = "V90 WildWire Modem";
+static const char pci_device_11c1_0450[] = "LT WinModem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_0450_144f_4005[] = "Magnia SG20";
+#endif
+static const char pci_device_11c1_0451[] = "LT WinModem";
+static const char pci_device_11c1_0452[] = "LT WinModem";
+static const char pci_device_11c1_0453[] = "LT WinModem";
+static const char pci_device_11c1_0454[] = "LT WinModem";
+static const char pci_device_11c1_0455[] = "LT WinModem";
+static const char pci_device_11c1_0456[] = "LT WinModem";
+static const char pci_device_11c1_0457[] = "LT WinModem";
+static const char pci_device_11c1_0458[] = "LT WinModem";
+static const char pci_device_11c1_0459[] = "LT WinModem";
+static const char pci_device_11c1_045a[] = "LT WinModem";
+static const char pci_device_11c1_045c[] = "LT WinModem";
+static const char pci_device_11c1_0461[] = "V90 WildWire Modem";
+static const char pci_device_11c1_0462[] = "V90 WildWire Modem";
+static const char pci_device_11c1_0480[] = "Venus Modem (V90, 56KFlex)";
+static const char pci_device_11c1_5801[] = "USB";
+static const char pci_device_11c1_5802[] = "USS-312 USB Controller";
+static const char pci_device_11c1_5803[] = "USS-344S USB Controller";
+static const char pci_device_11c1_5811[] = "FW323";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11c1_5811_dead_0800[] = "FireWire Host Bus Adapter";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c2[] = "Sand Microelectronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c3[] = "NEC Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c4[] = "Document Technologies, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c5[] = "Shiva Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c6[] = "Dainippon Screen Mfg. Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c7[] = "D.C.M. Data Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c8[] = "Dolphin Interconnect Solutions AS";
+static const char pci_device_11c8_0658[] = "PSB32 SCI-Adapter D31x";
+static const char pci_device_11c8_d665[] = "PSB64 SCI-Adapter D32x";
+static const char pci_device_11c8_d667[] = "PSB66 SCI-Adapter D33x";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11c9[] = "Magma";
+static const char pci_device_11c9_0010[] = "16-line serial port w/- DMA";
+static const char pci_device_11c9_0011[] = "4-line serial port w/- DMA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ca[] = "LSI Systems, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11cb[] = "Specialix Research Ltd.";
+static const char pci_device_11cb_2000[] = "PCI_9050";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11cb_2000_11cb_0200[] = "SX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11cb_2000_11cb_b008[] = "I/O8+";
+#endif
+static const char pci_device_11cb_4000[] = "SUPI_1";
+static const char pci_device_11cb_8000[] = "T225";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11cc[] = "Michels & Kleberhoff Computer GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11cd[] = "HAL Computer Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ce[] = "Netaccess";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11cf[] = "Pioneer Electronic Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d0[] = "Lockheed Martin Federal Systems-Manassas";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d1[] = "Auravision";
+static const char pci_device_11d1_01f7[] = "VxP524";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d2[] = "Intercom Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d3[] = "Trancell Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d4[] = "Analog Devices";
+static const char pci_device_11d4_1805[] = "SM56 PCI modem";
+static const char pci_device_11d4_1889[] = "AD1889 sound chip";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d5[] = "Ikon Corporation";
+static const char pci_device_11d5_0115[] = "10115";
+static const char pci_device_11d5_0117[] = "10117";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d6[] = "Tekelec Telecom";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d7[] = "Trenton Technology, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d8[] = "Image Technologies Development";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11d9[] = "TEC Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11da[] = "Novell";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11db[] = "Sega Enterprises Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11dc[] = "Questra Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11dd[] = "Crosfield Electronics Limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11de[] = "Zoran Corporation";
+static const char pci_device_11de_6057[] = "ZR36057PQC Video cutting chipset";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11de_6057_1031_7efe[] = "DC10 Plus";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11de_6057_1031_fc00[] = "MiroVIDEO DC50, Motion JPEG Capture/CODEC Board";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11de_6057_13ca_4231[] = "JPEG/TV Card";
+#endif
+static const char pci_device_11de_6120[] = "ZR36120";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11de_6120_1328_f001[] = "Cinemaster C DVD Decoder";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11df[] = "New Wave PDG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e0[] = "Cray Communications A/S";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e1[] = "GEC Plessey Semi Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e2[] = "Samsung Information Systems America";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e3[] = "Quicklogic Corporation";
+static const char pci_device_11e3_5030[] = "PC Watchdog";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e4[] = "Second Wave Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e5[] = "IIX Consulting";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e6[] = "Mitsui-Zosen System Research";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e7[] = "Toshiba America, Elec. Company";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e8[] = "Digital Processing Systems Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11e9[] = "Highwater Designs Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ea[] = "Elsag Bailey";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11eb[] = "Formation Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ec[] = "Coreco Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ed[] = "Mediamatics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ee[] = "Dome Imaging Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ef[] = "Nicolet Technologies B.V.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f0[] = "Compu-Shack";
+static const char pci_device_11f0_4231[] = "FDDI";
+static const char pci_device_11f0_4232[] = "FASTline UTP Quattro";
+static const char pci_device_11f0_4233[] = "FASTline FO";
+static const char pci_device_11f0_4234[] = "FASTline UTP";
+static const char pci_device_11f0_4235[] = "FASTline-II UTP";
+static const char pci_device_11f0_4236[] = "FASTline-II FO";
+static const char pci_device_11f0_4731[] = "GIGAline";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f1[] = "Symbios Logic Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f2[] = "Picture Tel Japan K.K.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f3[] = "Keithley Metrabyte";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f4[] = "Kinetic Systems Corporation";
+static const char pci_device_11f4_2915[] = "CAMAC controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f5[] = "Computing Devices International";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f6[] = "Compex";
+static const char pci_device_11f6_0112[] = "ENet100VG4";
+static const char pci_device_11f6_0113[] = "FreedomLine 100";
+static const char pci_device_11f6_1401[] = "ReadyLink 2000";
+static const char pci_device_11f6_2011[] = "RL100-ATX 10/100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11f6_2011_11f6_2011[] = "RL100-ATX";
+#endif
+static const char pci_device_11f6_2201[] = "ReadyLink 100TX (Winbond W89C840)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_11f6_2201_11f6_2011[] = "ReadyLink 100TX";
+#endif
+static const char pci_device_11f6_9881[] = "RL100TX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f7[] = "Scientific Atlanta";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f8[] = "PMC-Sierra Inc.";
+static const char pci_device_11f8_7375[] = "PM7375 [LASAR-155 ATM SAR]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11f9[] = "I-Cube Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11fa[] = "Kasan Electronics Company, Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11fb[] = "Datel Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11fc[] = "Silicon Magic";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11fd[] = "High Street Consultants";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11fe[] = "Comtrol Corporation";
+static const char pci_device_11fe_0001[] = "RocketPort 8 Oct";
+static const char pci_device_11fe_0002[] = "RocketPort 8 Intf";
+static const char pci_device_11fe_0003[] = "RocketPort 16 Intf";
+static const char pci_device_11fe_0004[] = "RocketPort 32 Intf";
+static const char pci_device_11fe_0005[] = "RocketPort Octacable";
+static const char pci_device_11fe_0006[] = "RocketPort 8J";
+static const char pci_device_11fe_0007[] = "RocketPort 4-port";
+static const char pci_device_11fe_0008[] = "RocketPort 8-port";
+static const char pci_device_11fe_0009[] = "RocketPort 16-port";
+static const char pci_device_11fe_000a[] = "RocketPort Plus Quadcable";
+static const char pci_device_11fe_000b[] = "RocketPort Plus Octacable";
+static const char pci_device_11fe_000c[] = "RocketPort 8-port Modem";
+static const char pci_device_11fe_8015[] = "RocketPort 4-port UART 16954";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_11ff[] = "Scion Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1200[] = "CSS Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1201[] = "Vista Controls Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1202[] = "Network General Corp.";
+static const char pci_device_1202_4300[] = "Gigabit Ethernet Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1202_4300_1202_9841[] = "SK-9841 LX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1202_4300_1202_9842[] = "SK-9841 LX dual link";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1202_4300_1202_9843[] = "SK-9843 SX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1202_4300_1202_9844[] = "SK-9843 SX dual link";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1203[] = "Bayer Corporation, Agfa Division";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1204[] = "Lattice Semiconductor Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1205[] = "Array Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1206[] = "Amdahl Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1208[] = "Parsytec GmbH";
+static const char pci_device_1208_4853[] = "HS-Link Device";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1209[] = "SCI Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_120a[] = "Synaptel";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_120b[] = "Adaptive Solutions";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_120c[] = "Technical Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_120d[] = "Compression Labs, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_120e[] = "Cyclades Corporation";
+static const char pci_device_120e_0100[] = "Cyclom-Y below first megabyte";
+static const char pci_device_120e_0101[] = "Cyclom-Y above first megabyte";
+static const char pci_device_120e_0102[] = "Cyclom-4Y below first megabyte";
+static const char pci_device_120e_0103[] = "Cyclom-4Y above first megabyte";
+static const char pci_device_120e_0104[] = "Cyclom-8Y below first megabyte";
+static const char pci_device_120e_0105[] = "Cyclom-8Y above first megabyte";
+static const char pci_device_120e_0200[] = "Cyclades-Z below first megabyte";
+static const char pci_device_120e_0201[] = "Cyclades-Z above first megabyte";
+static const char pci_device_120e_0300[] = "PC300/RSV or /X21 (2 ports)";
+static const char pci_device_120e_0301[] = "PC300/RSV or /X21 (1 port)";
+static const char pci_device_120e_0310[] = "PC300/TE (2 ports)";
+static const char pci_device_120e_0311[] = "PC300/TE (1 port)";
+static const char pci_device_120e_0320[] = "PC300/TE-M (2 ports)";
+static const char pci_device_120e_0321[] = "PC300/TE-M (1 port)";
+static const char pci_device_120e_0400[] = "PC400";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_120f[] = "Essential Communications";
+static const char pci_device_120f_0001[] = "Roadrunner serial HIPPI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1210[] = "Hyperparallel Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1211[] = "Braintech Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1212[] = "Kingston Technology Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1213[] = "Applied Intelligent Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1214[] = "Performance Technologies, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1215[] = "Interware Co., Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1216[] = "Purup Prepress A/S";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1217[] = "O2 Micro, Inc.";
+static const char pci_device_1217_6729[] = "OZ6729";
+static const char pci_device_1217_673a[] = "OZ6730";
+static const char pci_device_1217_6832[] = "OZ6832/6833 Cardbus Controller";
+static const char pci_device_1217_6836[] = "OZ6836/6860 Cardbus Controller";
+static const char pci_device_1217_6872[] = "OZ6812 Cardbus Controller";
+static const char pci_device_1217_6925[] = "OZ6922 Cardbus Controller";
+static const char pci_device_1217_6933[] = "OZ6933 Cardbus Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1217_6933_1025_1016[] = "Travelmate 612 TX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_1217_6972[] = "OZ6912 Cardbus Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1217_6972_1179_0001[] = "Magnia Z310";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1218[] = "Hybricon Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1219[] = "First Virtual Corporation";
+#endif
+static const char pci_vendor_121a[] = "3Dfx Interactive, Inc.";
+static const char pci_device_121a_0001[] = "Voodoo";
+static const char pci_device_121a_0002[] = "Voodoo 2";
+static const char pci_device_121a_0003[] = "Voodoo Banshee";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_1092_0003[] = "Monster Fusion";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_1092_4000[] = "Monster Fusion";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_1092_4002[] = "Monster Fusion";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_1092_4801[] = "Monster Fusion AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_1092_4803[] = "Monster Fusion AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_1092_8030[] = "Monster Fusion";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_1092_8035[] = "Monster Fusion AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_10b0_0001[] = "Dragon 4000";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_1102_1018[] = "3D Blaster Banshee VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_121a_0001[] = "Voodoo Banshee AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_121a_0003[] = "Voodoo Banshee AGP SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_121a_0004[] = "Voodoo Banshee";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_139c_0016[] = "Raven";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_139c_0017[] = "Raven";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0003_14af_0002[] = "Maxi Gamer Phoenix";
+#endif
+static const char pci_device_121a_0004[] = "Voodoo Banshee [Velocity 100]";
+static const char pci_device_121a_0005[] = "Voodoo 3";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0004[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0030[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0031[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0034[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0036[] = "Voodoo3";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0037[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0038[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_003a[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0044[] = "Voodoo3";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_004b[] = "Velocity 100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_004c[] = "Velocity 200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_004d[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_004e[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0051[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0052[] = "Voodoo3 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0060[] = "Voodoo3 3500 TV (NTSC)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0061[] = "Voodoo3 3500 TV (PAL)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0005_121a_0062[] = "Voodoo3 3500 TV (SECAM)";
+#endif
+static const char pci_device_121a_0009[] = "Voodoo 4 / Voodoo 5";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_121a_0009_121a_0009[] = "Voodoo5 AGP 5500/6000";
+#endif
+static const char pci_device_121a_0057[] = "Voodoo 3/3000 [Avenger]";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_121b[] = "Advanced Telecommunications Modules";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_121c[] = "Nippon Texaco., Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_121d[] = "Lippert Automationstechnik GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_121e[] = "CSPI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_121f[] = "Arcus Technology, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1220[] = "Ariel Corporation";
+static const char pci_device_1220_1220[] = "AMCC 5933 TMS320C80 DSP/Imaging board";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1221[] = "Contec Co., Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1222[] = "Ancor Communications, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1223[] = "Artesyn Communication Products";
+static const char pci_device_1223_0003[] = "PM/Link";
+static const char pci_device_1223_0004[] = "PM/T1";
+static const char pci_device_1223_0005[] = "PM/E1";
+static const char pci_device_1223_0008[] = "PM/SLS";
+static const char pci_device_1223_0009[] = "BajaSpan Resource Target";
+static const char pci_device_1223_000a[] = "BajaSpan Section 0";
+static const char pci_device_1223_000b[] = "BajaSpan Section 1";
+static const char pci_device_1223_000c[] = "BajaSpan Section 2";
+static const char pci_device_1223_000d[] = "BajaSpan Section 3";
+static const char pci_device_1223_000e[] = "PM/PPC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1224[] = "Interactive Images";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1225[] = "Power I/O, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1227[] = "Tech-Source";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1228[] = "Norsk Elektro Optikk A/S";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1229[] = "Data Kinesis Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_122a[] = "Integrated Telecom";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_122b[] = "LG Industrial Systems Co., Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_122c[] = "Sican GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_122d[] = "Aztech System Ltd";
+static const char pci_device_122d_1206[] = "368DSP";
+static const char pci_device_122d_50dc[] = "3328 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_122d_50dc_122d_0001[] = "3328 Audio";
+#endif
+static const char pci_device_122d_80da[] = "3328 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_122d_80da_122d_0001[] = "3328 Audio";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_122e[] = "Xyratex";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_122f[] = "Andrew Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1230[] = "Fishcamp Engineering";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1231[] = "Woodward McCoach, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1232[] = "GPT Limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1233[] = "Bus-Tech, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1234[] = "Technical Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1235[] = "Risq Modular Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1236[] = "Sigma Designs Corporation";
+static const char pci_device_1236_0000[] = "RealMagic64/GX";
+static const char pci_device_1236_6401[] = "REALmagic 64/GX (SD 6425)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1237[] = "Alta Technology Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1238[] = "Adtran";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1239[] = "3DO Company";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_123a[] = "Visicom Laboratories, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_123b[] = "Seeq Technology, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_123c[] = "Century Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_123d[] = "Engineering Design Team, Inc.";
+static const char pci_device_123d_0000[] = "EasyConnect 8/32";
+static const char pci_device_123d_0002[] = "EasyConnect 8/64";
+static const char pci_device_123d_0003[] = "EasyIO";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_123e[] = "Simutech, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_123f[] = "C-Cube Microsystems";
+static const char pci_device_123f_00e4[] = "MPEG";
+static const char pci_device_123f_8120[] = "E4?";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_123f_8120_11bd_0006[] = "DV500 E4";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_123f_8120_11bd_000a[] = "DV500 E4";
+#endif
+static const char pci_device_123f_8888[] = "Cinemaster C 3.0 DVD Decoder";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_123f_8888_1002_0001[] = "Cinemaster C 3.0 DVD Decoder";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_123f_8888_1002_0002[] = "Cinemaster C 3.0 DVD Decoder";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_123f_8888_1328_0001[] = "Cinemaster C 3.0 DVD Decoder";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1240[] = "Marathon Technologies Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1241[] = "DSC Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1242[] = "JNI Corporation";
+static const char pci_device_1242_1560[] = "JNIC-1560 PCI-X Fibre Channel Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1242_1560_1242_6562[] = "FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1242_1560_1242_656a[] = "FCX-6562 PCI-X Fibre Channel Adapter";
+#endif
+static const char pci_device_1242_4643[] = "FCI-1063 Fibre Channel Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1243[] = "Delphax";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1244[] = "AVM Audiovisuelles MKTG & Computer System GmbH";
+static const char pci_device_1244_0700[] = "B1 ISDN";
+static const char pci_device_1244_0800[] = "C4 ISDN";
+static const char pci_device_1244_0a00[] = "A1 ISDN [Fritz]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1244_0a00_1244_0a00[] = "FRITZ!Card ISDN Controller";
+#endif
+static const char pci_device_1244_0e00[] = "Fritz!PCI v2.0 ISDN";
+static const char pci_device_1244_1100[] = "C2 ISDN";
+static const char pci_device_1244_1200[] = "T1 ISDN";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1245[] = "A.P.D., S.A.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1246[] = "Dipix Technologies, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1247[] = "Xylon Research, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1248[] = "Central Data Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1249[] = "Samsung Electronics Co., Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_124a[] = "AEG Electrocom GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_124b[] = "SBS/Greenspring Modular I/O";
+static const char pci_device_124b_0040[] = "PCI-40A or cPCI-200 Quad IndustryPack carrier";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_124b_0040_124b_9080[] = "PCI9080 Bridge";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_124c[] = "Solitron Technologies, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_124d[] = "Stallion Technologies, Inc.";
+static const char pci_device_124d_0000[] = "EasyConnection 8/32";
+static const char pci_device_124d_0002[] = "EasyConnection 8/64";
+static const char pci_device_124d_0003[] = "EasyIO";
+static const char pci_device_124d_0004[] = "EasyConnection/RA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_124e[] = "Cylink";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_124f[] = "Infotrend Technology, Inc.";
+static const char pci_device_124f_0041[] = "IFT-2000 Series RAID Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1250[] = "Hitachi Microcomputer System Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1251[] = "VLSI Solutions Oy";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1253[] = "Guzik Technical Enterprises";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1254[] = "Linear Systems Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1255[] = "Optibase Ltd";
+static const char pci_device_1255_1110[] = "MPEG Forge";
+static const char pci_device_1255_1210[] = "MPEG Fusion";
+static const char pci_device_1255_2110[] = "VideoPlex";
+static const char pci_device_1255_2120[] = "VideoPlex CC";
+static const char pci_device_1255_2130[] = "VideoQuest";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1256[] = "Perceptive Solutions, Inc.";
+static const char pci_device_1256_4201[] = "PCI-2220I";
+static const char pci_device_1256_4401[] = "PCI-2240I";
+static const char pci_device_1256_5201[] = "PCI-2000";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1257[] = "Vertex Networks, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1258[] = "Gilbarco, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1259[] = "Allied Telesyn International";
+static const char pci_device_1259_2560[] = "AT-2560 Fast Ethernet Adapter (i82557B)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_125a[] = "ABB Power Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_125b[] = "Asix Electronics Corporation";
+static const char pci_device_125b_1400[] = "ALFA GFC2204";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_125c[] = "Aurora Technologies, Inc.";
+static const char pci_device_125c_0640[] = "Aries 16000P";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_125d[] = "ESS Technology";
+static const char pci_device_125d_0000[] = "ES336H Fax Modem (Early Model)";
+static const char pci_device_125d_1948[] = "Solo?";
+static const char pci_device_125d_1968[] = "ES1968 Maestro 2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1968_1028_0085[] = "ES1968 Maestro-2 PCI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1968_1033_8051[] = "ES1968 Maestro-2 Audiodrive";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_125d_1969[] = "ES1969 Solo-1 Audiodrive";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1969_1014_0166[] = "ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1969_125d_8888[] = "Solo-1 Audio Adapter";
+#endif
+static const char pci_device_125d_1978[] = "ES1978 Maestro 2E";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1978_0e11_b112[] = "Armada M700";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1978_1033_803c[] = "ES1978 Maestro-2E Audiodrive";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1978_1033_8058[] = "ES1978 Maestro-2E Audiodrive";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1978_1092_4000[] = "Monster Sound MX400";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1978_1179_0001[] = "ES1978 Maestro-2E Audiodrive";
+#endif
+static const char pci_device_125d_1988[] = "ES1988 Allegro-1";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1988_1092_4100[] = "Sonic Impact S100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1988_125d_1988[] = "ESS Allegro-1 Audiodrive";
+#endif
+static const char pci_device_125d_1989[] = "ESS Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1989_125d_1989[] = "ESS Modem";
+#endif
+static const char pci_device_125d_1998[] = "ES1983S Maestro-3i PCI Audio Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_1998_1028_00e6[] = "ES1983S Maestro-3i (Dell Inspiron 8100)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_125d_1999[] = "ES1983S Maestro-3i PCI Modem Accelerator";
+static const char pci_device_125d_199a[] = "ES1983S Maestro-3i PCI Audio Accelerator";
+static const char pci_device_125d_199b[] = "ES1983S Maestro-3i PCI Modem Accelerator";
+static const char pci_device_125d_2808[] = "ES336H Fax Modem (Later Model)";
+static const char pci_device_125d_2838[] = "ES2838/2839 SuperLink Modem";
+static const char pci_device_125d_2898[] = "ES2898 Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_125d_0424[] = "ES56-PI Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_125d_0425[] = "ES56T-PI Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_125d_0426[] = "ES56V-PI Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_125d_0427[] = "VW-PI Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_125d_0428[] = "ES56ST-PI Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_125d_0429[] = "ES56SV-PI Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_147a_c001[] = "ES56-PI Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_14fe_0428[] = "ES56-PI Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_125d_2898_14fe_0429[] = "ES56-PI Data Fax Modem";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_125e[] = "Specialvideo Engineering SRL";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_125f[] = "Concurrent Technologies, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1260[] = "Harris Semiconductor";
+static const char pci_device_1260_3873[] = "Prism 2.5 Wavelan chipset";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1260_3873_1186_3501[] = "DWL-520 Wireless PCI Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1260_3873_1668_0414[] = "HWP01170-01 802.11b PCI Wireless Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1260_3873_1737_3874[] = "WMP11 Wireless 802.11b PCI Adapter";
+#endif
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1260_3873_8086_2513[] = "Wireless 802.11b MiniPCI Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_1260_8130[] = "HMP8130 NTSC/PAL Video Decoder";
+static const char pci_device_1260_8131[] = "HMP8131 NTSC/PAL Video Decoder";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1261[] = "Matsushita-Kotobuki Electronics Industries, Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1262[] = "ES Computer Company, Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1263[] = "Sonic Solutions";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1264[] = "Aval Nagasaki Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1265[] = "Casio Computer Co., Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1266[] = "Microdyne Corporation";
+static const char pci_device_1266_0001[] = "NE10/100 Adapter (i82557B)";
+static const char pci_device_1266_1910[] = "NE2000Plus (RT8029) Ethernet Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1266_1910_1266_1910[] = "NE2000Plus Ethernet Adapter";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1267[] = "S. A. Telecommunications";
+static const char pci_device_1267_5352[] = "PCR2101";
+static const char pci_device_1267_5a4b[] = "Telsat Turbo";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1268[] = "Tektronix";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1269[] = "Thomson-CSF/TTM";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_126a[] = "Lexmark International, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_126b[] = "Adax, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_126c[] = "Northern Telecom";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_126d[] = "Splash Technology, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_126e[] = "Sumitomo Metal Industries, Ltd.";
+#endif
+static const char pci_vendor_126f[] = "Silicon Motion, Inc.";
+static const char pci_device_126f_0710[] = "SM710 LynxEM";
+static const char pci_device_126f_0712[] = "SM712 LynxEM+";
+static const char pci_device_126f_0720[] = "SM720 Lynx3DM";
+static const char pci_device_126f_0810[] = "SM810 LynxE";
+static const char pci_device_126f_0811[] = "SM811 LynxE";
+static const char pci_device_126f_0820[] = "SM820 Lynx3D";
+static const char pci_device_126f_0910[] = "SM910";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1270[] = "Olympus Optical Co., Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1271[] = "GW Instruments";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1272[] = "Telematics International";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1273[] = "Hughes Network Systems";
+static const char pci_device_1273_0002[] = "DirecPC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1274[] = "Ensoniq";
+static const char pci_device_1274_1371[] = "ES1371 [AudioPCI-97]";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_0e11_0024[] = "AudioPCI on Motherboard Compaq Deskpro";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_0e11_b1a7[] = "ES1371, ES1373 AudioPCI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1033_80ac[] = "ES1371, ES1373 AudioPCI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1042_1854[] = "Tazer";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_107b_8054[] = "Tabor2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1274_1371[] = "Creative Sound Blaster AudioPCI64V, AudioPCI128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6470[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6147 1.1A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6560[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6156 1.10";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6630[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 1.0A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6631[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 1.0A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6632[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 2.0A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6633[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 2.0A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6820[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6822[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6830[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6183 1.00";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6880[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6188 1.00";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6900[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6190 1.00";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6910[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6191";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6930[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6193";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6990[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6199BX 2.0A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1462_6991[] = "ES1371, ES1373 AudioPCI On Motherboard MS-6199VIA 2.0A";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_14a4_2077[] = "ES1371, ES1373 AudioPCI On Motherboard KR639";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_14a4_2105[] = "ES1371, ES1373 AudioPCI On Motherboard MR800";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_14a4_2107[] = "ES1371, ES1373 AudioPCI On Motherboard MR801";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_14a4_2172[] = "ES1371, ES1373 AudioPCI On Motherboard DR739";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1509_9902[] = "ES1371, ES1373 AudioPCI On Motherboard KW11";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1509_9903[] = "ES1371, ES1373 AudioPCI On Motherboard KW31";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1509_9904[] = "ES1371, ES1373 AudioPCI On Motherboard KA11";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_1509_9905[] = "ES1371, ES1373 AudioPCI On Motherboard KC13";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_152d_8801[] = "ES1371, ES1373 AudioPCI On Motherboard CP810E";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_152d_8802[] = "ES1371, ES1373 AudioPCI On Motherboard CP810";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_152d_8803[] = "ES1371, ES1373 AudioPCI On Motherboard P3810E";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_152d_8804[] = "ES1371, ES1373 AudioPCI On Motherboard P3810-S";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_152d_8805[] = "ES1371, ES1373 AudioPCI On Motherboard P3820-S";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_270f_2001[] = "ES1371, ES1373 AudioPCI On Motherboard 6CTR";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_270f_2200[] = "ES1371, ES1373 AudioPCI On Motherboard 6WTX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_270f_3000[] = "ES1371, ES1373 AudioPCI On Motherboard 6WSV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_270f_3100[] = "ES1371, ES1373 AudioPCI On Motherboard 6WIV2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_270f_3102[] = "ES1371, ES1373 AudioPCI On Motherboard 6WIV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_270f_7060[] = "ES1371, ES1373 AudioPCI On Motherboard 6ASA2";
+#endif
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_4249[] = "ES1371, ES1373 AudioPCI On Motherboard BI440ZX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_424c[] = "ES1371, ES1373 AudioPCI On Motherboard BL440ZX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_425a[] = "ES1371, ES1373 AudioPCI On Motherboard BZ440ZX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_4341[] = "ES1371, ES1373 AudioPCI On Motherboard Cayman";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_4343[] = "ES1371, ES1373 AudioPCI On Motherboard Cape Cod";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_4649[] = "ES1371, ES1373 AudioPCI On Motherboard Fire Island";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_464a[] = "ES1371, ES1373 AudioPCI On Motherboard FJ440ZX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_4d4f[] = "ES1371, ES1373 AudioPCI On Motherboard Montreal";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_4f43[] = "ES1371, ES1373 AudioPCI On Motherboard OC440LX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_5243[] = "ES1371, ES1373 AudioPCI On Motherboard RC440BX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_5352[] = "ES1371, ES1373 AudioPCI On Motherboard SunRiver";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_5643[] = "ES1371, ES1373 AudioPCI On Motherboard Vancouver";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_1371_8086_5753[] = "ES1371, ES1373 AudioPCI On Motherboard WS440BX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_1274_5000[] = "ES1370 [AudioPCI]";
+static const char pci_device_1274_5880[] = "5880 AudioPCI";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_5880_1274_2000[] = "Creative Sound Blaster AudioPCI128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_5880_1274_2003[] = "Creative SoundBlaster AudioPCI 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_5880_1274_5880[] = "Creative Sound Blaster AudioPCI128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_5880_1458_a000[] = "5880 AudioPCI On Motherboard 6OXET";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_5880_1462_6880[] = "5880 AudioPCI On Motherboard MS-6188 1.00";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_5880_270f_2001[] = "5880 AudioPCI On Motherboard 6CTR";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_5880_270f_2200[] = "5880 AudioPCI On Motherboard 6WTX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1274_5880_270f_7040[] = "5880 AudioPCI On Motherboard 6ATA4";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1275[] = "Network Appliance Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1276[] = "Switched Network Technologies, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1277[] = "Comstream";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1278[] = "Transtech Parallel Systems Ltd.";
+static const char pci_device_1278_0701[] = "TPE3/TM3 PowerPC Node";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1279[] = "Transmeta Corporation";
+static const char pci_device_1279_0295[] = "Northbridge";
+static const char pci_device_1279_0395[] = "LongRun Northbridge";
+static const char pci_device_1279_0396[] = "SDRAM controller";
+static const char pci_device_1279_0397[] = "BIOS scratchpad";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_127a[] = "Rockwell International";
+static const char pci_device_127a_1002[] = "HCF 56k Data/Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1002_1092_094c[] = "SupraExpress 56i PRO [Diamond SUP2380]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1002_122d_4002[] = "HPG / MDP3858-U";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1002_122d_4005[] = "MDP3858-E";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1002_122d_4007[] = "MDP3858-A/-NZ";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1002_122d_4012[] = "MDP3858-SA";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1002_122d_4017[] = "MDP3858-W";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1002_122d_4018[] = "MDP3858-W";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1002_127a_1002[] = "Rockwell 56K D/F HCF Modem";
+#endif
+static const char pci_device_127a_1003[] = "HCF 56k Data/Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_0e11_b0bc[] = "229-DF Zephyr";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_0e11_b114[] = "229-DF Cheetah";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_1033_802b[] = "229-DF";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_13df_1003[] = "PCI56RX Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_13e0_0117[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_13e0_0147[] = "IBM F-1156IV+/R3 Spain V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_13e0_0197[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_13e0_01c7[] = "IBM F-1156IV+/R3 WW V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_13e0_01f7[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_1436_1003[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_1436_1103[] = "IBM 5614PM3G V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1003_1436_1602[] = "Compaq 229-DF Ducati";
+#endif
+static const char pci_device_127a_1004[] = "HCF 56k Data/Fax/Voice Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1004_1048_1500[] = "MicroLink 56k Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1004_10cf_1059[] = "Fujitsu 229-DFRT";
+#endif
+static const char pci_device_127a_1005[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_1033_8029[] = "229-DFSV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_1033_8054[] = "Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_10cf_103c[] = "Fujitsu";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_10cf_1055[] = "Fujitsu 229-DFSV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_10cf_1056[] = "Fujitsu 229-DFSV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4003[] = "MDP3858SP-U";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4006[] = "Packard Bell MDP3858V-E";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4008[] = "MDP3858SP-A/SP-NZ";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4009[] = "MDP3858SP-E";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4010[] = "MDP3858V-U";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4011[] = "MDP3858SP-SA";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4013[] = "MDP3858V-A/V-NZ";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4015[] = "MDP3858SP-W";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4016[] = "MDP3858V-W";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_122d_4019[] = "MDP3858V-SA";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_13df_1005[] = "PCI56RVP Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_13e0_0187[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_13e0_01a7[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_13e0_01b7[] = "IBM DF-1156IV+/R3 Spain V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_13e0_01d7[] = "IBM DF-1156IV+/R3 WW V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_1436_1005[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_1436_1105[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1005_1437_1105[] = "IBM 5614PS3G V.90 Modem";
+#endif
+static const char pci_device_127a_1022[] = "HCF 56k Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1022_1436_1303[] = "M3-5614PM3G V.90 Modem";
+#endif
+static const char pci_device_127a_1023[] = "HCF 56k Data/Fax Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1023_122d_4020[] = "Packard Bell MDP3858-WE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1023_122d_4023[] = "MDP3858-UE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1023_13e0_0247[] = "IBM F-1156IV+/R6 Spain V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1023_13e0_0297[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1023_13e0_02c7[] = "IBM F-1156IV+/R6 WW V.90 Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1023_1436_1203[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1023_1436_1303[] = "IBM";
+#endif
+static const char pci_device_127a_1024[] = "HCF 56k Data/Fax/Voice Modem";
+static const char pci_device_127a_1025[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1025_10cf_106a[] = "Fujitsu 235-DFSV";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1025_122d_4021[] = "Packard Bell MDP3858V-WE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1025_122d_4022[] = "MDP3858SP-WE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1025_122d_4024[] = "MDP3858V-UE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_1025_122d_4025[] = "MDP3858SP-UE";
+#endif
+static const char pci_device_127a_1026[] = "HCF 56k PCI Speakerphone Modem";
+static const char pci_device_127a_1032[] = "HCF 56k Modem";
+static const char pci_device_127a_1033[] = "HCF 56k Modem";
+static const char pci_device_127a_1034[] = "HCF 56k Modem";
+static const char pci_device_127a_1035[] = "HCF 56k PCI Speakerphone Modem";
+static const char pci_device_127a_1036[] = "HCF 56k Modem";
+static const char pci_device_127a_1085[] = "HCF 56k Volcano PCI Modem";
+static const char pci_device_127a_2005[] = "HCF 56k Data/Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2005_104d_8044[] = "229-DFSV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2005_104d_8045[] = "229-DFSV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2005_104d_8055[] = "PBE/Aztech 235W-DFSV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2005_104d_8056[] = "235-DFSV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2005_104d_805a[] = "Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2005_104d_805f[] = "Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2005_104d_8074[] = "Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_127a_2013[] = "HSF 56k Data/Fax Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2013_1179_0001[] = "Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2013_1179_ff00[] = "Modem";
+#endif
+static const char pci_device_127a_2014[] = "HSF 56k Data/Fax/Voice Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2014_10cf_1057[] = "Fujitsu Citicorp III";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2014_122d_4050[] = "MSP3880-U";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2014_122d_4055[] = "MSP3880-W";
+#endif
+static const char pci_device_127a_2015[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2015_10cf_1063[] = "Fujitsu";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2015_10cf_1064[] = "Fujitsu";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2015_1468_2015[] = "Fujitsu";
+#endif
+static const char pci_device_127a_2016[] = "HSF 56k Data/Fax/Voice/Spkp Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2016_122d_4051[] = "MSP3880V-W";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2016_122d_4052[] = "MSP3880SP-W";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2016_122d_4054[] = "MSP3880V-U";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2016_122d_4056[] = "MSP3880SP-U";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_2016_122d_4057[] = "MSP3880SP-A";
+#endif
+static const char pci_device_127a_4311[] = "Riptide HSF 56k PCI Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_4311_127a_4311[] = "Ring Modular? Riptide HSF RT HP Dom";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_4311_13e0_0210[] = "HP-GVC";
+#endif
+static const char pci_device_127a_4320[] = "Riptide PCI Audio Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_4320_1235_4320[] = "Riptide PCI Audio Controller";
+#endif
+static const char pci_device_127a_4321[] = "Riptide HCF 56k PCI Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_4321_1235_4321[] = "Hewlett Packard DF";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_4321_1235_4324[] = "Hewlett Packard DF";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_4321_13e0_0210[] = "Hewlett Packard DF";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_4321_144d_2321[] = "Riptide";
+#endif
+static const char pci_device_127a_4322[] = "Riptide PCI Game Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_4322_1235_4322[] = "Riptide PCI Game Controller";
+#endif
+static const char pci_device_127a_8234[] = "RapidFire 616X ATM155 Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_8234_108d_0022[] = "RapidFire 616X ATM155 Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_127a_8234_108d_0027[] = "RapidFire 616X ATM155 Adapter";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_127b[] = "Pixera Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_127c[] = "Crosspoint Solutions, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_127d[] = "Vela Research";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_127e[] = "Winnov, L.P.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_127f[] = "Fujifilm";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1280[] = "Photoscript Group Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1281[] = "Yokogawa Electric Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1282[] = "Davicom Semiconductor, Inc.";
+static const char pci_device_1282_9009[] = "Ethernet 100/10 MBit";
+static const char pci_device_1282_9100[] = "Ethernet 100/10 MBit";
+static const char pci_device_1282_9102[] = "Ethernet 100/10 MBit";
+static const char pci_device_1282_9132[] = "Ethernet 100/10 MBit";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1283[] = "Integrated Technology Express, Inc.";
+static const char pci_device_1283_673a[] = "IT8330G";
+static const char pci_device_1283_8330[] = "IT8330G";
+static const char pci_device_1283_8888[] = "IT8888F PCI to ISA Bridge with SMB";
+static const char pci_device_1283_8889[] = "IT8889F PCI to ISA Bridge";
+static const char pci_device_1283_e886[] = "IT8330G";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1284[] = "Sahara Networks, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1285[] = "Platform Technologies, Inc.";
+static const char pci_device_1285_0100[] = "AGOGO sound chip (aka ESS Maestro 1)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1286[] = "Mazet GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1287[] = "M-Pact, Inc.";
+static const char pci_device_1287_001e[] = "LS220D DVD Decoder";
+static const char pci_device_1287_001f[] = "LS220C DVD Decoder";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1288[] = "Timestep Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1289[] = "AVC Technology, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_128a[] = "Asante Technologies, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_128b[] = "Transwitch Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_128c[] = "Retix Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_128d[] = "G2 Networks, Inc.";
+static const char pci_device_128d_0021[] = "ATM155 Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_128e[] = "Hoontech Corporation/Samho Multi Tech Ltd.";
+static const char pci_device_128e_0008[] = "ST128 WSS/SB";
+static const char pci_device_128e_0009[] = "ST128 SAM9407";
+static const char pci_device_128e_000a[] = "ST128 Game Port";
+static const char pci_device_128e_000b[] = "ST128 MPU Port";
+static const char pci_device_128e_000c[] = "ST128 Ctrl Port";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_128f[] = "Tateno Dennou, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1290[] = "Sord Computer Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1291[] = "NCS Computer Italia";
+#endif
+static const char pci_vendor_1292[] = "Tritech Microelectronics Inc";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1293[] = "Media Reality Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1294[] = "Rhetorex, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1295[] = "Imagenation Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1296[] = "Kofax Image Products";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1297[] = "Holco Enterprise Co, Ltd/Shuttle Computer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1298[] = "Spellcaster Telecommunications Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1299[] = "Knowledge Technology Lab.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_129a[] = "VMetro, inc.";
+static const char pci_device_129a_0615[] = "PBT-615 PCI-X Bus Analyzer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_129b[] = "Image Access";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_129c[] = "Jaycor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_129d[] = "Compcore Multimedia, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_129e[] = "Victor Company of Japan, Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_129f[] = "OEC Medical Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a0[] = "Allen-Bradley Company";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a1[] = "Simpact Associates, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a2[] = "Newgen Systems Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a3[] = "Lucent Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a4[] = "NTT Electronics Technology Company";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a5[] = "Vision Dynamics Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a6[] = "Scalable Networks, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a7[] = "AMO GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a8[] = "News Datacom";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12a9[] = "Xiotech Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12aa[] = "SDL Communications, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ab[] = "Yuan Yuan Enterprise Co., Ltd.";
+static const char pci_device_12ab_3000[] = "MPG-200C PCI DVD Decoder Card";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ac[] = "Measurex Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ad[] = "Multidata GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ae[] = "Alteon Networks Inc.";
+static const char pci_device_12ae_0001[] = "AceNIC Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12ae_0001_12ae_0001[] = "Gigabit Ethernet-SX (Universal)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12ae_0001_1410_0104[] = "Gigabit Ethernet-SX PCI Adapter";
+#endif
+static const char pci_device_12ae_0002[] = "AceNIC Gigabit Ethernet (Copper)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12ae_0002_12ae_0002[] = "Gigabit Ethernet-T (3C986-T)";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12af[] = "TDK USA Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b0[] = "Jorge Scientific Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b1[] = "GammaLink";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b2[] = "General Signal Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b3[] = "Inter-Face Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b4[] = "FutureTel Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b5[] = "Granite Systems Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b6[] = "Natural Microsystems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b7[] = "Cognex Modular Vision Systems Div. - Acumen Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b8[] = "Korg";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12b9[] = "US Robotics/3Com";
+static const char pci_device_12b9_1006[] = "WinModem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_005c[] = "USR 56k Internal Voice WinModem (Model 3472)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_005e[] = "USR 56k Internal WinModem (Models 662975)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_0062[] = "USR 56k Internal Voice WinModem (Model 662978)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_0068[] = "USR 56k Internal Voice WinModem (Model 5690)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_007a[] = "USR 56k Internal Voice WinModem (Model 662974)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_007f[] = "USR 56k Internal WinModem (Models 5698, 5699)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_0080[] = "USR 56k Internal WinModem (Models 2975, 3528)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_0081[] = "USR 56k Internal Voice WinModem (Models 2974, 3529)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1006_12b9_0091[] = "USR 56k Internal Voice WinModem (Model 2978)";
+#endif
+static const char pci_device_12b9_1007[] = "USR 56k Internal WinModem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1007_12b9_00a3[] = "USR 56k Internal WinModem (Model 3595)";
+#endif
+static const char pci_device_12b9_1008[] = "56K FaxModem Model 5610";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1008_12b9_00a2[] = "USR 56k Internal FAX Modem (Model 2977)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1008_12b9_00aa[] = "USR 56k Internal Voice Modem (Model 2976)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1008_12b9_00ab[] = "USR 56k Internal Voice Modem (Model 5609)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1008_12b9_00ac[] = "USR 56k Internal Voice Modem (Model 3298)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12b9_1008_12b9_00ad[] = "USR 56k Internal FAX Modem (Model 5610)";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ba[] = "BittWare, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12bb[] = "Nippon Unisoft Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12bc[] = "Array Microsystems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12bd[] = "Computerm Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12be[] = "Anchor Chips Inc.";
+static const char pci_device_12be_3041[] = "AN3041Q CO-MEM";
+static const char pci_device_12be_3042[] = "AN3042Q CO-MEM Lite";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12be_3042_12be_3042[] = "Anchor Chips Lite Evaluation Board";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12bf[] = "Fujifilm Microdevices";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c0[] = "Infimed";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c1[] = "GMM Research Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c2[] = "Mentec Limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c3[] = "Holtek Microelectronics Inc";
+static const char pci_device_12c3_0058[] = "PCI NE2K Ethernet";
+static const char pci_device_12c3_5598[] = "PCI NE2K Ethernet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c4[] = "Connect Tech Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c5[] = "Picture Elements Incorporated";
+static const char pci_device_12c5_007e[] = "Imaging/Scanning Subsystem Engine";
+static const char pci_device_12c5_007f[] = "Imaging/Scanning Subsystem Engine";
+static const char pci_device_12c5_0081[] = "PCIVST [Grayscale Thresholding Engine]";
+static const char pci_device_12c5_0085[] = "Video Simulator/Sender";
+static const char pci_device_12c5_0086[] = "THR2 Multi-scale Thresholder";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c6[] = "Mitani Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c7[] = "Dialogic Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c8[] = "G Force Co, Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12c9[] = "Gigi Operations";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ca[] = "Integrated Computing Engines";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12cb[] = "Antex Electronics Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12cc[] = "Pluto Technologies International";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12cd[] = "Aims Lab";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ce[] = "Netspeed Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12cf[] = "Prophet Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d0[] = "GDE Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d1[] = "PSITech";
+#endif
+static const char pci_vendor_12d2[] = "NVidia / SGS Thomson (Joint Venture)";
+static const char pci_device_12d2_0008[] = "NV1";
+static const char pci_device_12d2_0009[] = "DAC64";
+static const char pci_device_12d2_0018[] = "Riva128";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_1048_0c10[] = "VICTORY Erazor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_107b_8030[] = "STB Velocity 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_1092_0350[] = "Viper V330";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_1092_1092[] = "Viper V330";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b1b[] = "STB Velocity 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b1d[] = "STB Velocity 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b1e[] = "STB Velocity 128, PAL TV-Out";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b20[] = "STB Velocity 128 Sapphire";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b21[] = "STB Velocity 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b22[] = "STB Velocity 128 AGP, NTSC TV-Out";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b23[] = "STB Velocity 128 AGP, PAL TV-Out";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b27[] = "STB Velocity 128 DVD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_1b88[] = "MVP Pro 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_222a[] = "STB Velocity 128 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_2230[] = "STB Velocity 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_2232[] = "STB Velocity 128";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_10b4_2235[] = "STB Velocity 128 AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12d2_0018_2a15_54a3[] = "3DVision-SAGP / 3DexPlorer 3000";
+#endif
+static const char pci_device_12d2_0019[] = "Riva128ZX";
+static const char pci_device_12d2_0020[] = "TNT";
+static const char pci_device_12d2_0028[] = "TNT2";
+static const char pci_device_12d2_0029[] = "UTNT2";
+static const char pci_device_12d2_002c[] = "VTNT2";
+static const char pci_device_12d2_00a0[] = "ITNT2";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d3[] = "Vingmed Sound A/S";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d4[] = "Ulticom (Formerly DGM&S)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d5[] = "Equator Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d6[] = "Analogic Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d7[] = "Biotronic SRL";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d8[] = "Pericom Semiconductor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12d9[] = "Aculab PLC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12da[] = "True Time Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12db[] = "Annapolis Micro Systems, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12dc[] = "Symicron Computer Communication Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12dd[] = "Management Graphics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12de[] = "Rainbow Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12df[] = "SBS Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e0[] = "Chase Research";
+static const char pci_device_12e0_0010[] = "ST16C654 Quad UART";
+static const char pci_device_12e0_0020[] = "ST16C654 Quad UART";
+static const char pci_device_12e0_0030[] = "ST16C654 Quad UART";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e1[] = "Nintendo Co, Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e2[] = "Datum Inc. Bancomm-Timing Division";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e3[] = "Imation Corp - Medical Imaging Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e4[] = "Brooktrout Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e5[] = "Apex Semiconductor Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e6[] = "Cirel Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e7[] = "Sunsgroup Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e8[] = "Crisc Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12e9[] = "GE Spacenet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ea[] = "Zuken";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12eb[] = "Aureal Semiconductor";
+static const char pci_device_12eb_0001[] = "Vortex 1";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0001_104d_8036[] = "AU8820 Vortex Digital Audio Processor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0001_1092_2000[] = "Sonic Impact A3D";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0001_1092_2100[] = "Sonic Impact A3D";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0001_1092_2110[] = "Sonic Impact A3D";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0001_1092_2200[] = "Sonic Impact A3D";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0001_122d_1002[] = "AU8820 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0001_12eb_0001[] = "AU8820 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0001_5053_3355[] = "Montego";
+#endif
+static const char pci_device_12eb_0002[] = "Vortex 2";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_104d_8049[] = "AU8830 Vortex 3D Digital Audio Processor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_104d_807b[] = "AU8830 Vortex 3D Digital Audio Processor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_1092_3000[] = "Monster Sound II";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_1092_3001[] = "Monster Sound II";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_1092_3002[] = "Monster Sound II";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_1092_3003[] = "Monster Sound II";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_1092_3004[] = "Monster Sound II";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_12eb_0001[] = "AU8830 Vortex 3D Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_12eb_0002[] = "AU8830 Vortex 3D Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_12eb_0088[] = "AU8830 Vortex 3D Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_144d_3510[] = "AU8830 Vortex 3D Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0002_5053_3356[] = "Montego II";
+#endif
+static const char pci_device_12eb_0003[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_104d_8049[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_104d_8077[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_109f_1000[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_12eb_0003[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_1462_6780[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_14a4_2073[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_14a4_2091[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_14a4_2104[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_0003_14a4_2106[] = "AU8810 Vortex Digital Audio Processor";
+#endif
+static const char pci_device_12eb_8803[] = "Vortex 56k Software Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_12eb_8803_12eb_8803[] = "Vortex 56k Software Modem";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ec[] = "3A International, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ed[] = "Optivision Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ee[] = "Orange Micro";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ef[] = "Vienna Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f0[] = "Pentek";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f1[] = "Sorenson Vision Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f2[] = "Gammagraphx, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f3[] = "Radstone Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f4[] = "Megatel";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f5[] = "Forks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f6[] = "Dawson France";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f7[] = "Cognex";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f8[] = "Electronic Design GmbH";
+static const char pci_device_12f8_0002[] = "VideoMaker";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12f9[] = "Four Fold Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12fb[] = "Spectrum Signal Processing";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12fc[] = "Capital Equipment Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12fd[] = "I2S";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12fe[] = "ESD Electronic System Design GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_12ff[] = "Lexicon";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1300[] = "Harman International Industries Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1302[] = "Computer Sciences Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1303[] = "Innovative Integration";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1304[] = "Juniper Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1305[] = "Netphone, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1306[] = "Duet Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1307[] = "Computer Boards";
+static const char pci_device_1307_0001[] = "PCI-DAS1602/16";
+static const char pci_device_1307_000b[] = "PCI-DIO48H";
+static const char pci_device_1307_000c[] = "PCI-PDISO8";
+static const char pci_device_1307_000d[] = "PCI-PDISO16";
+static const char pci_device_1307_000f[] = "PCI-DAS1200";
+static const char pci_device_1307_0010[] = "PCI-DAS1602/12";
+static const char pci_device_1307_0014[] = "PCI-DIO24H";
+static const char pci_device_1307_0015[] = "PCI-DIO24H/CTR3";
+static const char pci_device_1307_0016[] = "PCI-DIO48H/CTR15";
+static const char pci_device_1307_0017[] = "PCI-DIO96H";
+static const char pci_device_1307_0018[] = "PCI-CTR05";
+static const char pci_device_1307_0019[] = "PCI-DAS1200/JR";
+static const char pci_device_1307_001a[] = "PCI-DAS1001";
+static const char pci_device_1307_001b[] = "PCI-DAS1002";
+static const char pci_device_1307_001c[] = "PCI-DAS1602JR/16";
+static const char pci_device_1307_001d[] = "PCI-DAS6402/16";
+static const char pci_device_1307_001e[] = "PCI-DAS6402/12";
+static const char pci_device_1307_001f[] = "PCI-DAS16/M1";
+static const char pci_device_1307_0020[] = "PCI-DDA02/12";
+static const char pci_device_1307_0021[] = "PCI-DDA04/12";
+static const char pci_device_1307_0022[] = "PCI-DDA08/12";
+static const char pci_device_1307_0023[] = "PCI-DDA02/16";
+static const char pci_device_1307_0024[] = "PCI-DDA04/16";
+static const char pci_device_1307_0025[] = "PCI-DDA08/16";
+static const char pci_device_1307_0026[] = "PCI-DAC04/12-HS";
+static const char pci_device_1307_0027[] = "PCI-DAC04/16-HS";
+static const char pci_device_1307_0028[] = "PCI-DIO24";
+static const char pci_device_1307_0029[] = "PCI-DAS08";
+static const char pci_device_1307_002c[] = "PCI-INT32";
+static const char pci_device_1307_0033[] = "PCI-DUAL-AC5";
+static const char pci_device_1307_0034[] = "PCI-DAS-TC";
+static const char pci_device_1307_0035[] = "PCI-DAS64/M1/16";
+static const char pci_device_1307_0036[] = "PCI-DAS64/M2/16";
+static const char pci_device_1307_0037[] = "PCI-DAS64/M3/16";
+static const char pci_device_1307_004c[] = "PCI-DAS1000";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1308[] = "Jato Technologies Inc.";
+static const char pci_device_1308_0001[] = "NetCelerator Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1308_0001_1308_0001[] = "NetCelerator Adapter";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1309[] = "AB Semiconductor Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_130a[] = "Mitsubishi Electric Microcomputer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_130b[] = "Colorgraphic Communications Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_130c[] = "Ambex Technologies, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_130d[] = "Accelerix Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_130e[] = "Yamatake-Honeywell Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_130f[] = "Advanet Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1310[] = "Gespac";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1311[] = "Videoserver, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1312[] = "Acuity Imaging, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1313[] = "Yaskawa Electric Co.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1316[] = "Teradyne Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1317[] = "Linksys";
+static const char pci_device_1317_0981[] = "Fast Ethernet 10/100";
+static const char pci_device_1317_0985[] = "Network Everywhere Fast Ethernet 10/100 model NC100";
+static const char pci_device_1317_1985[] = "Fast Ethernet 10/100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1318[] = "Packet Engines Inc.";
+static const char pci_device_1318_0911[] = "PCI Ethernet Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1319[] = "Fortemedia, Inc";
+static const char pci_device_1319_0801[] = "Xwave QS3000A [FM801]";
+static const char pci_device_1319_0802[] = "Xwave QS3000A [FM801 game port]";
+static const char pci_device_1319_1000[] = "FM801 PCI Audio";
+static const char pci_device_1319_1001[] = "FM801 PCI Joystick";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_131a[] = "Finisar Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_131c[] = "Nippon Electro-Sensory Devices Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_131d[] = "Sysmic, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_131e[] = "Xinex Networks Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_131f[] = "Siig Inc";
+static const char pci_device_131f_1000[] = "CyberSerial (1-port) 16550";
+static const char pci_device_131f_1001[] = "CyberSerial (1-port) 16650";
+static const char pci_device_131f_1002[] = "CyberSerial (1-port) 16850";
+static const char pci_device_131f_1010[] = "Duet 1S(16550)+1P";
+static const char pci_device_131f_1011[] = "Duet 1S(16650)+1P";
+static const char pci_device_131f_1012[] = "Duet 1S(16850)+1P";
+static const char pci_device_131f_1020[] = "CyberParallel (1-port)";
+static const char pci_device_131f_1021[] = "CyberParallel (2-port)";
+static const char pci_device_131f_1030[] = "CyberSerial (2-port) 16550";
+static const char pci_device_131f_1031[] = "CyberSerial (2-port) 16650";
+static const char pci_device_131f_1032[] = "CyberSerial (2-port) 16850";
+static const char pci_device_131f_1034[] = "Trio 2S(16550)+1P";
+static const char pci_device_131f_1035[] = "Trio 2S(16650)+1P";
+static const char pci_device_131f_1036[] = "Trio 2S(16850)+1P";
+static const char pci_device_131f_1050[] = "CyberSerial (4-port) 16550";
+static const char pci_device_131f_1051[] = "CyberSerial (4-port) 16650";
+static const char pci_device_131f_1052[] = "CyberSerial (4-port) 16850";
+static const char pci_device_131f_2000[] = "CyberSerial (1-port) 16550";
+static const char pci_device_131f_2001[] = "CyberSerial (1-port) 16650";
+static const char pci_device_131f_2002[] = "CyberSerial (1-port) 16850";
+static const char pci_device_131f_2010[] = "Duet 1S(16550)+1P";
+static const char pci_device_131f_2011[] = "Duet 1S(16650)+1P";
+static const char pci_device_131f_2012[] = "Duet 1S(16850)+1P";
+static const char pci_device_131f_2020[] = "CyberParallel (1-port)";
+static const char pci_device_131f_2021[] = "CyberParallel (2-port)";
+static const char pci_device_131f_2030[] = "CyberSerial (2-port) 16550";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_131f_2030_131f_2030[] = "PCI Serial Card";
+#endif
+static const char pci_device_131f_2031[] = "CyberSerial (2-port) 16650";
+static const char pci_device_131f_2032[] = "CyberSerial (2-port) 16850";
+static const char pci_device_131f_2040[] = "Trio 1S(16550)+2P";
+static const char pci_device_131f_2041[] = "Trio 1S(16650)+2P";
+static const char pci_device_131f_2042[] = "Trio 1S(16850)+2P";
+static const char pci_device_131f_2050[] = "CyberSerial (4-port) 16550";
+static const char pci_device_131f_2051[] = "CyberSerial (4-port) 16650";
+static const char pci_device_131f_2052[] = "CyberSerial (4-port) 16850";
+static const char pci_device_131f_2060[] = "Trio 2S(16550)+1P";
+static const char pci_device_131f_2061[] = "Trio 2S(16650)+1P";
+static const char pci_device_131f_2062[] = "Trio 2S(16850)+1P";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1320[] = "Crypto AG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1321[] = "Arcobel Graphics BV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1322[] = "MTT Co., Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1323[] = "Dome Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1324[] = "Sphere Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1325[] = "Salix Technologies, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1326[] = "Seachange international";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1327[] = "Voss scientific";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1328[] = "quadrant international";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1329[] = "Productivity Enhancement";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_132a[] = "Microcom Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_132b[] = "Broadband Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_132c[] = "Micrel Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_132d[] = "Integrated Silicon Solution, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1330[] = "MMC Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1331[] = "Radisys Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1332[] = "Micro Memory";
+static const char pci_device_1332_5415[] = "MM-5415CN PCI Memory Module with Battery Backup";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1334[] = "Redcreek Communications, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1335[] = "Videomail, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1337[] = "Third Planet Publishing";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1338[] = "BT Electronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_133a[] = "Vtel Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_133b[] = "Softcom Microsystems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_133c[] = "Holontech Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_133d[] = "SS Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_133e[] = "Virtual Computer Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_133f[] = "SCM Microsystems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1340[] = "Atalla Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1341[] = "Kyoto Microcomputer Co";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1342[] = "Promax Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1343[] = "Phylon Communications Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1344[] = "Crucial Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1345[] = "Arescom Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1347[] = "Odetics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1349[] = "Sumitomo Electric Industries, Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_134a[] = "DTC Technology Corp.";
+static const char pci_device_134a_0001[] = "Domex 536";
+static const char pci_device_134a_0002[] = "Domex DMX3194UP SCSI Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_134b[] = "ARK Research Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_134c[] = "Chori Joho System Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_134d[] = "PCTel Inc";
+static const char pci_device_134d_7890[] = "HSP MicroModem 56";
+static const char pci_device_134d_7891[] = "HSP MicroModem 56";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_134d_7891_134d_0001[] = "HSP MicroModem 56";
+#endif
+static const char pci_device_134d_7892[] = "HSP MicroModem 56";
+static const char pci_device_134d_7893[] = "HSP MicroModem 56";
+static const char pci_device_134d_7894[] = "HSP MicroModem 56";
+static const char pci_device_134d_7895[] = "HSP MicroModem 56";
+static const char pci_device_134d_7896[] = "HSP MicroModem 56";
+static const char pci_device_134d_7897[] = "HSP MicroModem 56";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_134e[] = "CSTI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_134f[] = "Algo System Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1350[] = "Systec Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1351[] = "Sonix Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1353[] = "Thales Idatys";
+static const char pci_device_1353_0002[] = "Proserver";
+static const char pci_device_1353_0003[] = "PCI-FUT";
+static const char pci_device_1353_0004[] = "PCI-S0";
+static const char pci_device_1353_0005[] = "PCI-FUT-S0";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1354[] = "Dwave System Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1355[] = "Kratos Analytical Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1356[] = "The Logical Co";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1359[] = "Prisa Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_135a[] = "Brain Boxes";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_135b[] = "Giganet Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_135c[] = "Quatech Inc";
+static const char pci_device_135c_0010[] = "QSC-100";
+static const char pci_device_135c_0020[] = "DSC-100";
+static const char pci_device_135c_0030[] = "DSC-200/300";
+static const char pci_device_135c_0040[] = "QSC-200/300";
+static const char pci_device_135c_0050[] = "ESC-100D";
+static const char pci_device_135c_0060[] = "ESC-100M";
+static const char pci_device_135c_00f0[] = "MPAC-100 Syncronous Serial Card (Zilog 85230)";
+static const char pci_device_135c_0170[] = "QSCLP-100";
+static const char pci_device_135c_0180[] = "DSCLP-100";
+static const char pci_device_135c_0190[] = "SSCLP-100";
+static const char pci_device_135c_01a0[] = "QSCLP-200/300";
+static const char pci_device_135c_01b0[] = "DSCLP-200/300";
+static const char pci_device_135c_01c0[] = "SSCLP-200/300";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_135d[] = "ABB Network Partner AB";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_135e[] = "Sealevel Systems Inc";
+static const char pci_device_135e_7101[] = "Single Port RS-232/422/485/530";
+static const char pci_device_135e_7201[] = "Dual Port RS-232/422/485 Interface";
+static const char pci_device_135e_7202[] = "Dual Port RS-232 Interface";
+static const char pci_device_135e_7401[] = "Four Port RS-232 Interface";
+static const char pci_device_135e_7402[] = "Four Port RS-422/485 Interface";
+static const char pci_device_135e_7801[] = "Eight Port RS-232 Interface";
+static const char pci_device_135e_8001[] = "8001 Digital I/O Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_135f[] = "I-Data International A-S";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1360[] = "Meinberg Funkuhren";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1361[] = "Soliton Systems K.K.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1362[] = "Fujifacom Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1363[] = "Phoenix Technology Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1364[] = "ATM Communications Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1365[] = "Hypercope GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1366[] = "Teijin Seiki Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1367[] = "Hitachi Zosen Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1368[] = "Skyware Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1369[] = "Digigram";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_136a[] = "High Soft Tech";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_136b[] = "Kawasaki Steel Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_136c[] = "Adtek System Science Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_136d[] = "Gigalabs Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_136f[] = "Applied Magic Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1370[] = "ATL Products";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1371[] = "CNet Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1373[] = "Silicon Vision Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1374[] = "Silicom Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1375[] = "Argosystems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1376[] = "LMC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1377[] = "Electronic Equipment Production & Distribution GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1378[] = "Telemann Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1379[] = "Asahi Kasei Microsystems Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_137a[] = "Mark of the Unicorn Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_137b[] = "PPT Vision";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_137c[] = "Iwatsu Electric Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_137d[] = "Dynachip Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_137e[] = "Patriot Scientific Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_137f[] = "Japan Satellite Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1380[] = "Sanritz Automation Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1381[] = "Brains Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1382[] = "Marian - Electronic & Software";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1383[] = "Controlnet Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1384[] = "Reality Simulation Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1385[] = "Netgear";
+static const char pci_device_1385_4100[] = "802.11b Wireless Adapter (MA301)";
+static const char pci_device_1385_620a[] = "GA620";
+static const char pci_device_1385_622a[] = "GA622";
+static const char pci_device_1385_630a[] = "GA630";
+static const char pci_device_1385_f311[] = "FA311";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1386[] = "Video Domain Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1387[] = "Systran Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1388[] = "Hitachi Information Technology Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1389[] = "Applicom International";
+static const char pci_device_1389_0001[] = "PCI1500PFB [Intelligent fieldbus adaptor]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_138a[] = "Fusion Micromedia Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_138b[] = "Tokimec Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_138c[] = "Silicon Reality";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_138d[] = "Future Techno Designs pte Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_138e[] = "Basler GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_138f[] = "Patapsco Designs Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1390[] = "Concept Development Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1391[] = "Development Concepts Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1392[] = "Medialight Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1393[] = "Moxa Technologies Co Ltd";
+static const char pci_device_1393_1040[] = "Smartio C104H/PCI";
+static const char pci_device_1393_1680[] = "Smartio C168H/PCI";
+static const char pci_device_1393_2040[] = "Intellio CP-204J";
+static const char pci_device_1393_2180[] = "Intellio C218 Turbo PCI";
+static const char pci_device_1393_3200[] = "Intellio C320 Turbo PCI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1394[] = "Level One Communications";
+static const char pci_device_1394_0001[] = "LXT1001 Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1394_0001_1394_0001[] = "NetCelerator Adapter";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1395[] = "Ambicom Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1396[] = "Cipher Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1397[] = "Cologne Chip Designs GmbH";
+static const char pci_device_1397_2bd0[] = "ISDN network controller [HFC-PCI]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1397_2bd0_1397_2bd0[] = "ISDN Board";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1397_2bd0_e4bf_1000[] = "CI1-1-Harp";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1398[] = "Clarion co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1399[] = "Rios systems Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_139a[] = "Alacritech Inc";
+static const char pci_device_139a_0001[] = "Quad Port 10/100 Server Accelerator";
+static const char pci_device_139a_0003[] = "Single Port 10/100 Server Accelerator";
+static const char pci_device_139a_0005[] = "Single Port Gigabit Server Accelerator";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_139b[] = "Mediasonic Multimedia Systems Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_139c[] = "Quantum 3d Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_139d[] = "EPL limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_139e[] = "Media4";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_139f[] = "Aethra s.r.l.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a0[] = "Crystal Group Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a1[] = "Kawasaki Heavy Industries Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a2[] = "Ositech Communications Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a3[] = "Hifn Inc.";
+static const char pci_device_13a3_0005[] = "7751 Security Processor";
+static const char pci_device_13a3_0006[] = "6500 Public Key Processor";
+static const char pci_device_13a3_0007[] = "7811 Security Processor";
+static const char pci_device_13a3_0012[] = "7951 Security Processor";
+static const char pci_device_13a3_0014[] = "78XX Security Processor";
+static const char pci_device_13a3_0016[] = "8065 Security Processor";
+static const char pci_device_13a3_0017[] = "8165 Security Processor";
+static const char pci_device_13a3_0018[] = "8154 Security Processor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a4[] = "Rascom Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a5[] = "Audio Digital Imaging Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a6[] = "Videonics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a7[] = "Teles AG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a8[] = "Exar Corp.";
+static const char pci_device_13a8_0158[] = "XR17C158 Octal UART";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13a9[] = "Siemens Medical Systems, Ultrasound Group";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13aa[] = "Broadband Networks Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ab[] = "Arcom Control Systems Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ac[] = "Motion Media Technology Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ad[] = "Nexus Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ae[] = "ALD Technology Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13af[] = "T.Sqware";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b0[] = "Maxspeed Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b1[] = "Tamura corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b2[] = "Techno Chips Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b3[] = "Lanart Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b4[] = "Wellbean Co Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b5[] = "ARM";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b6[] = "Dlog GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b7[] = "Logic Devices Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b8[] = "Nokia Telecommunications oy";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13b9[] = "Elecom Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ba[] = "Oxford Instruments";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13bb[] = "Sanyo Technosound Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13bc[] = "Bitran Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13bd[] = "Sharp corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13be[] = "Miroku Jyoho Service Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13bf[] = "Sharewave Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c0[] = "Microgate Corporation";
+static const char pci_device_13c0_0010[] = "SyncLink WAN Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c1[] = "3ware Inc";
+static const char pci_device_13c1_1000[] = "3ware ATA-RAID";
+static const char pci_device_13c1_1001[] = "3ware 7000-series ATA-RAID";
+static const char pci_device_13c1_1002[] = "3ware ATA-RAID";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c2[] = "Technotrend Systemtechnik GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c3[] = "Janz Computer AG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c4[] = "Phase Metrics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c5[] = "Alphi Technology Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c6[] = "Condor Engineering Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c7[] = "Blue Chip Technology Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c8[] = "Apptech Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13c9[] = "Eaton Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ca[] = "Iomega Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13cb[] = "Yano Electric Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13cc[] = "Metheus Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13cd[] = "Compatible Systems Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ce[] = "Cocom A/S";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13cf[] = "Studio Audio & Video Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d0[] = "Techsan Electronics Co Ltd";
+static const char pci_device_13d0_2103[] = "B2C2 Sky2PC PCI [SkyStar2]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d1[] = "Abocom Systems Inc";
+static const char pci_device_13d1_ab02[] = "ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter";
+static const char pci_device_13d1_ab06[] = "RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d2[] = "Shark Multimedia Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d3[] = "IMC Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d4[] = "Graphics Microsystems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d5[] = "Media 100 Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d6[] = "K.I. Technology Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d7[] = "Toshiba Engineering Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d8[] = "Phobos corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13d9[] = "Apex PC Solutions Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13da[] = "Intresource Systems pte Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13db[] = "Janich & Klass Computertechnik GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13dc[] = "Netboost Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13dd[] = "Multimedia Bundle Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13de[] = "ABB Robotics Products AB";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13df[] = "E-Tech Inc";
+static const char pci_device_13df_0001[] = "PCI56RVP Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_13df_0001_13df_0001[] = "PCI56RVP Modem";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e0[] = "GVC Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e1[] = "Silicom Multimedia Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e2[] = "Dynamics Research Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e3[] = "Nest Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e4[] = "Calculex Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e5[] = "Telesoft Design Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e6[] = "Argosy research Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e7[] = "NAC Incorporated";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e8[] = "Chip Express Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13e9[] = "Chip Express Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ea[] = "Dallas Semiconductor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13eb[] = "Hauppauge Computer Works Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ec[] = "Zydacron Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ed[] = "Raytheion E-Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ee[] = "Hayes Microcomputer Products Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ef[] = "Coppercom Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f0[] = "Sundance Technology Inc";
+static const char pci_device_13f0_0201[] = "ST201 Sundance Ethernet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f1[] = "Oce' - Technologies B.V.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f2[] = "Ford Microelectronics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f3[] = "Mcdata Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f4[] = "Troika Networks, Inc.";
+static const char pci_device_13f4_1401[] = "Zentai Fibre Channel Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f5[] = "Kansai Electric Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f6[] = "C-Media Electronics Inc";
+static const char pci_device_13f6_0100[] = "CM8338A";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_13f6_0100_13f6_ffff[] = "CMI8338/C3DX PCI Audio Device";
+#endif
+static const char pci_device_13f6_0101[] = "CM8338B";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_13f6_0101_13f6_0101[] = "CMI8338-031 PCI Audio Device";
+#endif
+static const char pci_device_13f6_0111[] = "CM8738";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_13f6_0111_1019_0970[] = "P6STP-FL motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_13f6_0111_1043_8077[] = "CMI8738 6-channel audio controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_13f6_0111_1043_80e2[] = "CMI8738 6ch-MX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_13f6_0111_13f6_0111[] = "CMI8738/C3DX PCI Audio Device";
+#endif
+static const char pci_device_13f6_0211[] = "CM8738";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f7[] = "Wildfire Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f8[] = "Ad Lib Multimedia Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13f9[] = "NTT Advanced Technology Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13fa[] = "Pentland Systems Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13fb[] = "Aydin Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13fc[] = "Computer Peripherals International";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13fd[] = "Micro Science Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13fe[] = "Advantech Co. Ltd";
+static const char pci_device_13fe_1756[] = "PCI-1756";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_13ff[] = "Silicon Spice Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1400[] = "Artx Inc";
+static const char pci_device_1400_1401[] = "9432 TX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1401[] = "CR-Systems A/S";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1402[] = "Meilhaus Electronic GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1403[] = "Ascor Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1404[] = "Fundamental Software Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1405[] = "Excalibur Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1406[] = "Oce' Printing Systems GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1407[] = "Lava Computer mfg Inc";
+static const char pci_device_1407_0100[] = "Lava Dual Serial";
+static const char pci_device_1407_0101[] = "Lava Quatro A";
+static const char pci_device_1407_0102[] = "Lava Quatro B";
+static const char pci_device_1407_0200[] = "Lava Port Plus";
+static const char pci_device_1407_0201[] = "Lava Quad A";
+static const char pci_device_1407_0202[] = "Lava Quad B";
+static const char pci_device_1407_0500[] = "Lava Single Serial";
+static const char pci_device_1407_0600[] = "Lava Port 650";
+static const char pci_device_1407_8000[] = "Lava Parallel";
+static const char pci_device_1407_8001[] = "Dual parallel port controller A";
+static const char pci_device_1407_8002[] = "Lava Dual Parallel port A";
+static const char pci_device_1407_8003[] = "Lava Dual Parallel port B";
+static const char pci_device_1407_8800[] = "BOCA Research IOPPAR";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1408[] = "Aloka Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1409[] = "Timedia Technology Co Ltd";
+static const char pci_device_1409_7168[] = "PCI2S550 (Dual 16550 UART)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_140a[] = "DSP Research Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_140b[] = "Ramix Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_140c[] = "Elmic Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_140d[] = "Matsushita Electric Works Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_140e[] = "Goepel Electronic GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_140f[] = "Salient Systems Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1410[] = "Midas lab Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1411[] = "Ikos Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1412[] = "IC Ensemble Inc";
+static const char pci_device_1412_1712[] = "ICE1712 [Envy24]";
+static const char pci_device_1412_1724[] = "ICE1724 [Envy24HT]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1413[] = "Addonics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1414[] = "Microsoft Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1415[] = "Oxford Semiconductor Ltd";
+static const char pci_device_1415_8403[] = "VScom 011H-EP1 1 port parallel adaptor";
+static const char pci_device_1415_9501[] = "OX16PCI954 (Quad 16950 UART) function 0";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1415_9501_15ed_2000[] = "MCCR Serial p0-3 of 8";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1415_9501_15ed_2001[] = "MCCR Serial p0-3 of 16";
+#endif
+static const char pci_device_1415_950a[] = "EXSYS EX-41092 Dual 16950 Serial adapter";
+static const char pci_device_1415_950b[] = "OXCB950 Cardbus 16950 UART";
+static const char pci_device_1415_9511[] = "OX16PCI954 (Quad 16950 UART) function 1";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1415_9511_15ed_2000[] = "MCCR Serial p4-7 of 8";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1415_9511_15ed_2001[] = "MCCR Serial p4-15 of 16";
+#endif
+static const char pci_device_1415_9521[] = "OX16PCI952 (Dual 16950 UART)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1416[] = "Multiwave Innovation pte Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1417[] = "Convergenet Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1418[] = "Kyushu electronics systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1419[] = "Excel Switching Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_141a[] = "Apache Micro Peripherals Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_141b[] = "Zoom Telephonics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_141d[] = "Digitan Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_141e[] = "Fanuc Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_141f[] = "Visiontech Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1420[] = "Psion Dacom plc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1421[] = "Ads Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1422[] = "Ygrec Systems Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1423[] = "Custom Technology Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1424[] = "Videoserver Connections";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1425[] = "ASIC Designers Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1426[] = "Storage Technology Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1427[] = "Better On-Line Solutions";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1428[] = "Edec Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1429[] = "Unex Technology Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_142a[] = "Kingmax Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_142b[] = "Radiolan";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_142c[] = "Minton Optic Industry Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_142d[] = "Pix stream Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_142e[] = "Vitec Multimedia";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_142f[] = "Radicom Research Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1430[] = "ITT Aerospace/Communications Division";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1431[] = "Gilat Satellite Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1432[] = "Edimax Computer Co.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1433[] = "Eltec Elektronik GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1435[] = "Real Time Devices US Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1436[] = "CIS Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1437[] = "Nissin Inc Co";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1438[] = "Atmel-dream";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1439[] = "Outsource Engineering & Mfg. Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_143a[] = "Stargate Solutions Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_143b[] = "Canon Research Center, America";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_143c[] = "Amlogic Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_143d[] = "Tamarack Microelectronics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_143e[] = "Jones Futurex Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_143f[] = "Lightwell Co Ltd - Zax Division";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1440[] = "ALGOL Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1441[] = "AGIE Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1442[] = "Phoenix Contact GmbH & Co.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1443[] = "Unibrain S.A.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1444[] = "TRW";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1445[] = "Logical DO Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1446[] = "Graphin Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1447[] = "AIM GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1448[] = "Alesis Studio Electronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1449[] = "TUT Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_144a[] = "Adlink Technology";
+static const char pci_device_144a_7296[] = "PCI-7296";
+static const char pci_device_144a_7432[] = "PCI-7432";
+static const char pci_device_144a_7433[] = "PCI-7433";
+static const char pci_device_144a_7434[] = "PCI-7434";
+static const char pci_device_144a_7841[] = "PCI-7841";
+static const char pci_device_144a_8133[] = "PCI-8133";
+static const char pci_device_144a_8554[] = "PCI-8554";
+static const char pci_device_144a_9111[] = "PCI-9111";
+static const char pci_device_144a_9113[] = "PCI-9113";
+static const char pci_device_144a_9114[] = "PCI-9114";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_144b[] = "Loronix Information Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_144c[] = "Catalina Research Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_144d[] = "Samsung Electronics Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_144e[] = "OLITEC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_144f[] = "Askey Computer Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1450[] = "Octave Communications Ind.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1451[] = "SP3D Chip Design GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1453[] = "MYCOM Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1454[] = "Altiga Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1455[] = "Logic Plus Plus Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1456[] = "Advanced Hardware Architectures";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1457[] = "Nuera Communications Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1458[] = "Giga-byte Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1459[] = "DOOIN Electronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_145a[] = "Escalate Networks Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_145b[] = "PRAIM SRL";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_145c[] = "Cryptek";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_145d[] = "Gallant Computer Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_145e[] = "Aashima Technology B.V.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_145f[] = "Baldor Electric Company";
+static const char pci_device_145f_0001[] = "NextMove PCI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1460[] = "DYNARC INC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1461[] = "Avermedia Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1462[] = "Micro-Star International Co., Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1463[] = "Fast Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1464[] = "Interactive Circuits & Systems Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1465[] = "GN NETTEST Telecom DIV.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1466[] = "Designpro Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1467[] = "DIGICOM SPA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1468[] = "AMBIT Microsystem Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1469[] = "Cleveland Motion Controls";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_146a[] = "IFR";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_146b[] = "Parascan Technologies Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_146c[] = "Ruby Tech Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_146d[] = "Tachyon, INC.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_146e[] = "Williams Electronics Games, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_146f[] = "Multi Dimensional Consulting Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1470[] = "Bay Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1471[] = "Integrated Telecom Express Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1472[] = "DAIKIN Industries, Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1473[] = "ZAPEX Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1474[] = "Doug Carson & Associates";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1475[] = "PICAZO Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1476[] = "MORTARA Instrument Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1477[] = "Net Insight";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1478[] = "DIATREND Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1479[] = "TORAY Industries Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_147a[] = "FORMOSA Industrial Computing";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_147b[] = "ABIT Computer Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_147c[] = "AWARE, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_147d[] = "Interworks Computer Products";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_147e[] = "Matsushita Graphic Communication Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_147f[] = "NIHON UNISYS, Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1480[] = "SCII Telecom";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1481[] = "BIOPAC Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1482[] = "ISYTEC - Integrierte Systemtechnik GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1483[] = "LABWAY Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1484[] = "Logic Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1485[] = "ERMA - Electronic GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1486[] = "L3 Communications Telemetry & Instrumentation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1487[] = "MARQUETTE Medical Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1488[] = "KONTRON Electronik GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1489[] = "KYE Systems Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_148a[] = "OPTO";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_148b[] = "INNOMEDIALOGIC Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_148c[] = "C.P. Technology Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_148d[] = "DIGICOM Systems, Inc.";
+static const char pci_device_148d_1003[] = "HCF 56k Data/Fax Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_148e[] = "OSI Plus Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_148f[] = "Plant Equipment, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1490[] = "Stone Microsystems PTY Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1491[] = "ZEAL Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1492[] = "Time Logic Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1493[] = "MAKER Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1494[] = "WINTOP Technology, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1495[] = "TOKAI Communications Industry Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1496[] = "JOYTECH Computer Co., Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1497[] = "SMA Regelsysteme GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1498[] = "TEWS Datentechnik GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1499[] = "EMTEC CO., Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_149a[] = "ANDOR Technology Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_149b[] = "SEIKO Instruments Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_149c[] = "OVISLINK Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_149d[] = "NEWTEK Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_149e[] = "Mapletree Networks Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_149f[] = "LECTRON Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a0[] = "SOFTING GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a1[] = "Systembase Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a2[] = "Millennium Engineering Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a3[] = "Maverick Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a4[] = "GVC/BCM Advanced Research";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a5[] = "XIONICS Document Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a6[] = "INOVA Computers GmBH & Co KG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a7[] = "MYTHOS Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a8[] = "FEATRON Technologies Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14a9[] = "HIVERTEC Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14aa[] = "Advanced MOS Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ab[] = "Mentor Graphics Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ac[] = "Novaweb Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ad[] = "Time Space Radio AB";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ae[] = "CTI, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14af[] = "Guillemot Corporation";
+static const char pci_device_14af_7102[] = "3D Prophet II MX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b0[] = "BST Communication Technology Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b1[] = "Nextcom K.K.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b2[] = "ENNOVATE Networks Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b3[] = "XPEED Inc";
+static const char pci_device_14b3_0000[] = "DSL NIC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b4[] = "PHILIPS Business Electronics B.V.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b5[] = "Creamware GmBH";
+static const char pci_device_14b5_0200[] = "Scope";
+static const char pci_device_14b5_0300[] = "Pulsar";
+static const char pci_device_14b5_0400[] = "Pulsar2";
+static const char pci_device_14b5_0600[] = "Pulsar2";
+static const char pci_device_14b5_0800[] = "DSP-Board";
+static const char pci_device_14b5_0900[] = "DSP-Board";
+static const char pci_device_14b5_0a00[] = "DSP-Board";
+static const char pci_device_14b5_0b00[] = "DSP-Board";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b6[] = "Quantum Data Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b7[] = "PROXIM Inc";
+static const char pci_device_14b7_0001[] = "Symphony 4110";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b8[] = "Techsoft Technology Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14b9[] = "AIRONET Wireless Communications";
+static const char pci_device_14b9_0001[] = "PC4800";
+static const char pci_device_14b9_0340[] = "PC4800";
+static const char pci_device_14b9_0350[] = "PC4800";
+static const char pci_device_14b9_4500[] = "PC4500";
+static const char pci_device_14b9_4800[] = "PC4800";
+static const char pci_device_14b9_a504[] = "Cisco Aironet Wireless 802.11b";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ba[] = "INTERNIX Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14bb[] = "SEMTECH Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14bc[] = "Globespan Semiconductor Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14bd[] = "CARDIO Control N.V.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14be[] = "L3 Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14bf[] = "SPIDER Communications Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c0[] = "COMPAL Electronics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c1[] = "MYRICOM Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c2[] = "DTK Computer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c3[] = "MEDIATEK Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c4[] = "IWASAKI Information Systems Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c5[] = "Automation Products AB";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c6[] = "Data Race Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c7[] = "Modular Technology Holdings Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c8[] = "Turbocomm Tech. Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14c9[] = "ODIN Telesystems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ca[] = "PE Logic Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14cb[] = "Billionton Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14cc[] = "NAKAYO Telecommunications Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14cd[] = "Universal Scientific Ind.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ce[] = "Whistle Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14cf[] = "TEK Microsystems Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d0[] = "Ericsson Axe R & D";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d1[] = "Computer Hi-Tech Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d2[] = "Titan Electronics Inc";
+static const char pci_device_14d2_8001[] = "VScom 010L 1 port parallel adaptor";
+static const char pci_device_14d2_8002[] = "VScom 020L 2 port parallel adaptor";
+static const char pci_device_14d2_8010[] = "VScom 100L 1 port serial adaptor";
+static const char pci_device_14d2_8011[] = "VScom 110L 1 port serial and 1 port parallel adaptor";
+static const char pci_device_14d2_8020[] = "VScom 200L 1 port serial adaptor";
+static const char pci_device_14d2_8021[] = "VScom 210L 2 port serial and 1 port parallel adaptor";
+static const char pci_device_14d2_8040[] = "VScom 400L 4 port serial adaptor";
+static const char pci_device_14d2_8080[] = "VScom 800L 8 port serial adaptor";
+static const char pci_device_14d2_a000[] = "VScom 010H 1 port parallel adaptor";
+static const char pci_device_14d2_a001[] = "VScom 100H 1 port serial adaptor";
+static const char pci_device_14d2_a003[] = "VScom 400H 4 port serial adaptor";
+static const char pci_device_14d2_a004[] = "VScom 400HF1 4 port serial adaptor";
+static const char pci_device_14d2_a005[] = "VScom 200H 2 port serial adaptor";
+static const char pci_device_14d2_e001[] = "VScom 010HV2 1 port parallel adaptor";
+static const char pci_device_14d2_e010[] = "VScom 100HV2 1 port serial adaptor";
+static const char pci_device_14d2_e020[] = "VScom 200HV2 2 port serial adaptor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d3[] = "CIRTECH (UK) Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d4[] = "Panacom Technology Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d5[] = "Nitsuko Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d6[] = "Accusys Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d7[] = "Hirakawa Hewtech Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d8[] = "HOPF Elektronik GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14d9[] = "Alpha Processor Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14da[] = "National Aerospace Laboratories";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14db[] = "AFAVLAB Technology Inc";
+static const char pci_device_14db_2120[] = "TK9902";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14dc[] = "Amplicon Liveline Ltd";
+static const char pci_device_14dc_0000[] = "PCI230";
+static const char pci_device_14dc_0001[] = "PCI242";
+static const char pci_device_14dc_0002[] = "PCI244";
+static const char pci_device_14dc_0003[] = "PCI247";
+static const char pci_device_14dc_0004[] = "PCI248";
+static const char pci_device_14dc_0005[] = "PCI249";
+static const char pci_device_14dc_0006[] = "PCI260";
+static const char pci_device_14dc_0007[] = "PCI224";
+static const char pci_device_14dc_0008[] = "PCI234";
+static const char pci_device_14dc_0009[] = "PCI236";
+static const char pci_device_14dc_000a[] = "PCI272";
+static const char pci_device_14dc_000b[] = "PCI215";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14dd[] = "Boulder Design Labs Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14de[] = "Applied Integration Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14df[] = "ASIC Communications Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e1[] = "INVERTEX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e2[] = "INFOLIBRIA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e3[] = "AMTELCO";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e4[] = "Broadcom Corporation";
+static const char pci_device_14e4_1644[] = "NetXtreme BCM5700 Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_1014_0277[] = "Broadcom Vigil B5700 1000Base-T";
+#endif
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_1028_00d1[] = "Broadcom BCM5700";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_1028_0106[] = "Broadcom BCM5700";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_1028_0109[] = "Broadcom BCM5700 1000Base-T";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_1028_010a[] = "Broadcom BCM5700 1000BaseTX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_10b7_1000[] = "3C996-T 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_10b7_1001[] = "3C996B-T 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_10b7_1002[] = "3C996C-T 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_10b7_1003[] = "3C997-T 1000Base-T Dual Port";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_10b7_1004[] = "3C996-SX 1000Base-SX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_10b7_1005[] = "3C997-SX 1000Base-SX Dual Port";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_10b7_1008[] = "3C942 Gigabit LOM (31X31)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_14e4_0002[] = "NetXtreme 1000Base-SX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_14e4_0003[] = "NetXtreme 1000Base-SX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_14e4_0004[] = "NetXtreme 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_14e4_1028[] = "NetXtreme 1000BaseTX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1644_14e4_1644[] = "BCM5700 1000Base-T";
+#endif
+static const char pci_device_14e4_1645[] = "NetXtreme BCM5701 Gigabit Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_0e11_007c[] = "NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_0e11_007d[] = "NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_0e11_0085[] = "NC7780 Gigabit Server Adapter (embedded, WOL)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_0e11_0099[] = "NC7780 Gigabit Server Adapter (embedded, WOL)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_0e11_009a[] = "NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_0e11_00c1[] = "NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_1028_0121[] = "Broadcom BCM5701 1000Base-T";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_10b7_1004[] = "3C996-SX 1000Base-SX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_10b7_1006[] = "3C996B-T 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_10b7_1007[] = "3C1000-T 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_10b7_1008[] = "3C940-BR01 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_14e4_0001[] = "BCM5701 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_14e4_0005[] = "BCM5701 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_14e4_0006[] = "BCM5701 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_14e4_0007[] = "BCM5701 1000Base-SX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_14e4_0008[] = "BCM5701 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1645_14e4_8008[] = "BCM5701 1000Base-T";
+#endif
+static const char pci_device_14e4_1646[] = "NetXtreme BCM5702 Gigabit Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1646_0e11_00bb[] = "NC7760 1000BaseTX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1646_1028_0126[] = "Broadcom BCM5702 1000BaseTX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1646_14e4_8009[] = "BCM5702 1000BaseTX";
+#endif
+static const char pci_device_14e4_1647[] = "NetXtreme BCM5703 Gigabit Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1647_0e11_0099[] = "NC7780 1000BaseTX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1647_0e11_009a[] = "NC7770 1000BaseTX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1647_14e4_0009[] = "BCM5703 1000BaseTX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1647_14e4_000a[] = "BCM5703 1000BaseSX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1647_14e4_000b[] = "BCM5703 1000BaseTX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1647_14e4_8009[] = "BCM5703 1000BaseTX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1647_14e4_800a[] = "BCM5703 1000BaseTX";
+#endif
+static const char pci_device_14e4_1648[] = "NetXtreme BCM5704 Gigabit Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1648_0e11_00cf[] = "NC7772 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1648_0e11_00d0[] = "NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1648_0e11_00d1[] = "NC7783 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1648_10b7_2000[] = "3C998-T Dual Port 10/100/1000 PCI-X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1648_10b7_3000[] = "3C999-T Quad Port 10/100/1000 PCI-X";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1648_1166_1648[] = "NetXtreme CIOB-E 1000Base-T";
+#endif
+static const char pci_device_14e4_164d[] = "NetXtreme BCM5702FE Gigabit Ethernet";
+static const char pci_device_14e4_1653[] = "NetXtreme BCM5705 Gigabit Ethernet";
+static const char pci_device_14e4_165d[] = "NetXtreme BCM5705M Gigabit Ethernet";
+static const char pci_device_14e4_1696[] = "NetXtreme BCM5782 Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_1696_14e4_000d[] = "NetXtreme BCM5782 1000Base-T";
+#endif
+static const char pci_device_14e4_16a6[] = "NetXtreme BCM5702 Gigabit Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a6_0e11_00bb[] = "NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a6_1028_0126[] = "BCM5702 1000Base-T";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a6_14e4_000c[] = "BCM5702 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a6_14e4_8009[] = "BCM5702 1000Base-T";
+#endif
+static const char pci_device_14e4_16a7[] = "NetXtreme BCM5703 Gigabit Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a7_0e11_00ca[] = "NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a7_0e11_00cb[] = "NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a7_14e4_0009[] = "NetXtreme BCM5703 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a7_14e4_000a[] = "NetXtreme BCM5703 1000Base-SX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a7_14e4_000b[] = "NetXtreme BCM5703 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a7_14e4_800a[] = "NetXtreme BCM5703 1000Base-T";
+#endif
+static const char pci_device_14e4_16a8[] = "NetXtreme BCM5704S Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16a8_10b7_2001[] = "3C998-SX Dual Port 1000-SX PCI-X";
+#endif
+static const char pci_device_14e4_16c6[] = "NetXtreme BCM5702 Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16c6_10b7_1100[] = "3C1000B-T 10/100/1000 PCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16c6_14e4_000c[] = "BCM5702 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16c6_14e4_8009[] = "BCM5702 1000Base-T";
+#endif
+static const char pci_device_14e4_16c7[] = "NetXtreme BCM5703 Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16c7_14e4_0009[] = "NetXtreme BCM5703 1000Base-T";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14e4_16c7_14e4_000a[] = "NetXtreme BCM5703 1000Base-SX";
+#endif
+static const char pci_device_14e4_4210[] = "BCM4210 iLine10 HomePNA 2.0";
+static const char pci_device_14e4_4211[] = "BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem";
+static const char pci_device_14e4_4212[] = "BCM4212 v.90 56k modem";
+static const char pci_device_14e4_4301[] = "BCM4301 802.11b";
+static const char pci_device_14e4_4401[] = "BCM4401 100Base-T";
+static const char pci_device_14e4_4402[] = "BCM4402 Integrated 10/100BaseT";
+static const char pci_device_14e4_4410[] = "BCM4413 iLine32 HomePNA 2.0";
+static const char pci_device_14e4_4411[] = "BCM4413 V.90 56k modem";
+static const char pci_device_14e4_4412[] = "BCM4413 10/100BaseT";
+static const char pci_device_14e4_5820[] = "BCM5820 Crypto Accelerator";
+static const char pci_device_14e4_5821[] = "BCM5821 Crypto Accelerator";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e5[] = "Pixelfusion Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e6[] = "SHINING Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e7[] = "3CX";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e8[] = "RAYCER Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14e9[] = "GARNETS System CO Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ea[] = "Planex Communications, Inc";
+static const char pci_device_14ea_ab06[] = "FNW-3603-TX CardBus Fast Ethernet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14eb[] = "SEIKO EPSON Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ec[] = "ACQIRIS";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ed[] = "DATAKINETICS Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ee[] = "MASPRO KENKOH Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ef[] = "CARRY Computer ENG. CO Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f0[] = "CANON RESEACH CENTRE FRANCE";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f1[] = "Conexant";
+static const char pci_device_14f1_1002[] = "HCF 56k Modem";
+static const char pci_device_14f1_1003[] = "HCF 56k Modem";
+static const char pci_device_14f1_1004[] = "HCF 56k Modem";
+static const char pci_device_14f1_1005[] = "HCF 56k Modem";
+static const char pci_device_14f1_1006[] = "HCF 56k Modem";
+static const char pci_device_14f1_1022[] = "HCF 56k Modem";
+static const char pci_device_14f1_1023[] = "HCF 56k Modem";
+static const char pci_device_14f1_1024[] = "HCF 56k Modem";
+static const char pci_device_14f1_1025[] = "HCF 56k Modem";
+static const char pci_device_14f1_1026[] = "HCF 56k Modem";
+static const char pci_device_14f1_1032[] = "HCF 56k Modem";
+static const char pci_device_14f1_1033[] = "HCF 56k Data/Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_1033_8077[] = "NEC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_122d_4027[] = "Dell Zeus - MDP3880-W(B) Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_122d_4030[] = "Dell Mercury - MDP3880-U(B) Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_122d_4034[] = "Dell Thor - MDP3880-W(U) Data Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_13e0_020d[] = "Dell Copper";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_13e0_020e[] = "Dell Silver";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_13e0_0261[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_13e0_0290[] = "Compaq Goldwing";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_13e0_02a0[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_13e0_02b0[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_13e0_02c0[] = "Compaq Scooter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_13e0_02d0[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_144f_1500[] = "IBM P85-DF (1)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_144f_1501[] = "IBM P85-DF (2)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_144f_150a[] = "IBM P85-DF (3)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_144f_150b[] = "IBM P85-DF Low Profile (1)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1033_144f_1510[] = "IBM P85-DF Low Profile (2)";
+#endif
+static const char pci_device_14f1_1034[] = "HCF 56k Data/Fax/Voice Modem";
+static const char pci_device_14f1_1035[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1035_10cf_1098[] = "Fujitsu P85-DFSV";
+#endif
+static const char pci_device_14f1_1036[] = "HCF 56k Data/Fax/Voice/Spkp Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1036_104d_8067[] = "HCF 56k Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1036_122d_4029[] = "MDP3880SP-W";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1036_122d_4031[] = "MDP3880SP-U";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1036_13e0_0209[] = "Dell Titanium";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1036_13e0_020a[] = "Dell Graphite";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1036_13e0_0260[] = "Gateway Red Owl";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1036_13e0_0270[] = "Gateway White Horse";
+#endif
+static const char pci_device_14f1_1052[] = "HCF 56k Data/Fax Modem (Worldwide)";
+static const char pci_device_14f1_1053[] = "HCF 56k Data/Fax Modem (Worldwide)";
+static const char pci_device_14f1_1054[] = "HCF 56k Data/Fax/Voice Modem (Worldwide)";
+static const char pci_device_14f1_1055[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (Worldwide)";
+static const char pci_device_14f1_1056[] = "HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)";
+static const char pci_device_14f1_1057[] = "HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)";
+static const char pci_device_14f1_1059[] = "HCF 56k Data/Fax/Voice Modem (Worldwide)";
+static const char pci_device_14f1_1063[] = "HCF 56k Data/Fax Modem";
+static const char pci_device_14f1_1064[] = "HCF 56k Data/Fax/Voice Modem";
+static const char pci_device_14f1_1065[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+static const char pci_device_14f1_1066[] = "HCF 56k Data/Fax/Voice/Spkp Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1066_122d_4033[] = "Dell Athena - MDP3900V-U";
+#endif
+static const char pci_device_14f1_1433[] = "HCF 56k Data/Fax Modem";
+static const char pci_device_14f1_1434[] = "HCF 56k Data/Fax/Voice Modem";
+static const char pci_device_14f1_1435[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+static const char pci_device_14f1_1436[] = "HCF 56k Data/Fax Modem";
+static const char pci_device_14f1_1453[] = "HCF 56k Data/Fax Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1453_13e0_0240[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1453_13e0_0250[] = "IBM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1453_144f_1502[] = "IBM P95-DF (1)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1453_144f_1503[] = "IBM P95-DF (2)";
+#endif
+static const char pci_device_14f1_1454[] = "HCF 56k Data/Fax/Voice Modem";
+static const char pci_device_14f1_1455[] = "HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+static const char pci_device_14f1_1456[] = "HCF 56k Data/Fax/Voice/Spkp Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1456_122d_4035[] = "Dell Europa - MDP3900V-W";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1456_122d_4302[] = "Dell MP3930V-W(C) MiniPCI";
+#endif
+static const char pci_device_14f1_1610[] = "ADSL AccessRunner PCI Arbitration Device";
+static const char pci_device_14f1_1611[] = "AccessRunner PCI ADSL Interface Device";
+static const char pci_device_14f1_1803[] = "HCF 56k Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1803_0e11_0023[] = "623-LAN Grizzly";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1803_0e11_0043[] = "623-LAN Yogi";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_14f1_1815[] = "HCF 56k Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1815_0e11_0022[] = "Grizzly";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_1815_0e11_0042[] = "Yogi";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_14f1_2003[] = "HSF 56k Data/Fax Modem";
+static const char pci_device_14f1_2004[] = "HSF 56k Data/Fax/Voice Modem";
+static const char pci_device_14f1_2005[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+static const char pci_device_14f1_2006[] = "HSF 56k Data/Fax/Voice/Spkp Modem";
+static const char pci_device_14f1_2013[] = "HSF 56k Data/Fax Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2013_0e11_b195[] = "Bear";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2013_0e11_b196[] = "Seminole 1";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2013_0e11_b1be[] = "Seminole 2";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2013_1025_8013[] = "Acer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2013_1033_809d[] = "NEC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2013_1033_80bc[] = "NEC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2013_155d_6793[] = "HP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2013_155d_8850[] = "E Machines";
+#endif
+static const char pci_device_14f1_2014[] = "HSF 56k Data/Fax/Voice Modem";
+static const char pci_device_14f1_2015[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem";
+static const char pci_device_14f1_2016[] = "HSF 56k Data/Fax/Voice/Spkp Modem";
+static const char pci_device_14f1_2043[] = "HSF 56k Data/Fax Modem (WorldW SmartDAA)";
+static const char pci_device_14f1_2044[] = "HSF 56k Data/Fax/Voice Modem (WorldW SmartDAA)";
+static const char pci_device_14f1_2045[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (WorldW SmartDAA)";
+static const char pci_device_14f1_2046[] = "HSF 56k Data/Fax/Voice/Spkp Modem (WorldW SmartDAA)";
+static const char pci_device_14f1_2063[] = "HSF 56k Data/Fax Modem (SmartDAA)";
+static const char pci_device_14f1_2064[] = "HSF 56k Data/Fax/Voice Modem (SmartDAA)";
+static const char pci_device_14f1_2065[] = "HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (SmartDAA)";
+static const char pci_device_14f1_2066[] = "HSF 56k Data/Fax/Voice/Spkp Modem (SmartDAA)";
+static const char pci_device_14f1_2093[] = "HSF 56k Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2093_155d_2f07[] = "Legend";
+#endif
+static const char pci_device_14f1_2143[] = "HSF 56k Data/Fax/Cell Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2144[] = "HSF 56k Data/Fax/Voice/Cell Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2145[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2146[] = "HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2163[] = "HSF 56k Data/Fax/Cell Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2164[] = "HSF 56k Data/Fax/Voice/Cell Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2165[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2166[] = "HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2343[] = "HSF 56k Data/Fax CardBus Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2344[] = "HSF 56k Data/Fax/Voice CardBus Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2345[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2346[] = "HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2363[] = "HSF 56k Data/Fax CardBus Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2364[] = "HSF 56k Data/Fax/Voice CardBus Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2365[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2366[] = "HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2443[] = "HSF 56k Data/Fax Modem (Mob WorldW SmartDAA)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2443_104d_8075[] = "Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2443_104d_8083[] = "Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2443_104d_8097[] = "Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_14f1_2444[] = "HSF 56k Data/Fax/Voice Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2445[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2446[] = "HSF 56k Data/Fax/Voice/Spkp Modem (Mob WorldW SmartDAA)";
+static const char pci_device_14f1_2463[] = "HSF 56k Data/Fax Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2464[] = "HSF 56k Data/Fax/Voice Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2465[] = "HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2466[] = "HSF 56k Data/Fax/Voice/Spkp Modem (Mob SmartDAA)";
+static const char pci_device_14f1_2f00[] = "HSF 56k HSFi Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2f00_13e0_8d84[] = "IBM HSFi V.90";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2f00_13e0_8d85[] = "Compaq Stinger";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_14f1_2f00_14f1_2004[] = "Dynalink 56PMi";
+#endif
+static const char pci_device_14f1_8234[] = "RS8234 ATM SAR Controller [ServiceSAR Plus]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f2[] = "MOBILITY Electronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f3[] = "BROADLOGIC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f4[] = "TOKYO Electronic Industry CO Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f5[] = "SOPAC Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f6[] = "COYOTE Technologies LLC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f7[] = "WOLF Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f8[] = "AUDIOCODES Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14f9[] = "AG COMMUNICATIONS";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14fa[] = "WANDEL & GOCHERMANN";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14fb[] = "TRANSAS MARINE (UK) Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14fc[] = "QUADRICS Supercomputers World";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14fd[] = "JAPAN Computer Industry Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14fe[] = "ARCHTEK TELECOM Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_14ff[] = "TWINHEAD INTERNATIONAL Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1500[] = "DELTA Electronics, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1501[] = "BANKSOFT CANADA Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1502[] = "MITSUBISHI ELECTRIC LOGISTICS SUPPORT Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1503[] = "KAWASAKI LSI USA Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1504[] = "KAISER Electronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1505[] = "ITA INGENIEURBURO FUR TESTAUFGABEN GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1506[] = "CHAMELEON Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1507[] = "Motorola ? / HTEC";
+static const char pci_device_1507_0001[] = "MPC105 [Eagle]";
+static const char pci_device_1507_0002[] = "MPC106 [Grackle]";
+static const char pci_device_1507_0003[] = "MPC8240 [Kahlua]";
+static const char pci_device_1507_0100[] = "MC145575 [HFC-PCI]";
+static const char pci_device_1507_0431[] = "KTI829c 100VG";
+static const char pci_device_1507_4801[] = "Raven";
+static const char pci_device_1507_4802[] = "Falcon";
+static const char pci_device_1507_4803[] = "Hawk";
+static const char pci_device_1507_4806[] = "CPX8216";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1508[] = "HONDA CONNECTORS/MHOTRONICS Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1509[] = "FIRST INTERNATIONAL Computer Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_150a[] = "FORVUS RESEARCH Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_150b[] = "YAMASHITA Systems Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_150c[] = "KYOPAL CO Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_150d[] = "WARPSPPED Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_150e[] = "C-PORT Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_150f[] = "INTEC GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1510[] = "BEHAVIOR TECH Computer Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1511[] = "CENTILLIUM Technology Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1512[] = "ROSUN Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1513[] = "Raychem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1514[] = "TFL LAN Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1515[] = "Advent design";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1516[] = "MYSON Technology Inc";
+static const char pci_device_1516_0803[] = "SURECOM EP-320X-S 100/10M Ethernet PCI Adapter";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1516_0803_1320_10bd[] = "SURECOM EP-320X-S 100/10M Ethernet PCI Adapter";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1517[] = "ECHOTEK Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1518[] = "PEP MODULAR Computers GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1519[] = "TELEFON AKTIEBOLAGET LM Ericsson";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_151a[] = "Globetek";
+static const char pci_device_151a_1002[] = "PCI-1002";
+static const char pci_device_151a_1004[] = "PCI-1004";
+static const char pci_device_151a_1008[] = "PCI-1008";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_151b[] = "COMBOX Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_151c[] = "DIGITAL AUDIO LABS Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_151d[] = "Fujitsu Computer Products Of America";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_151e[] = "MATRIX Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_151f[] = "TOPIC SEMICONDUCTOR Corp";
+static const char pci_device_151f_0000[] = "TP560 Data/Fax/Voice 56k modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1520[] = "CHAPLET System Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1521[] = "BELL Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1522[] = "MainPine Ltd";
+static const char pci_device_1522_0100[] = "PCI <-> IOBus Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1522_0100_1522_0200[] = "RockForceDUO 2 Port V.92/V.44 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1522_0100_1522_0300[] = "RockForceQUATRO 4 Port V.92/V.44 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1522_0100_1522_0400[] = "RockForceDUO+ 2 Port V.92/V.44 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1522_0100_1522_0500[] = "RockForceQUATRO+ 4 Port V.92/V.44 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1522_0100_1522_0600[] = "RockForce+ 2 Port V.90 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1522_0100_1522_0700[] = "RockForce+ 4 Port V.90 Data/Fax/Voice Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1522_0100_1522_0800[] = "RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1523[] = "MUSIC Semiconductors";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1524[] = "ENE Technology Inc";
+static const char pci_device_1524_1211[] = "CB1211 Cardbus Controller";
+static const char pci_device_1524_1225[] = "CB1225 Cardbus Controller";
+static const char pci_device_1524_1410[] = "CB1410 Cardbus Controller";
+static const char pci_device_1524_1420[] = "CB1420 Cardbus Controller";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1525[] = "IMPACT Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1526[] = "ISS, Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1527[] = "SOLECTRON";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1528[] = "ACKSYS";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1529[] = "AMERICAN MICROSystems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_152a[] = "QUICKTURN DESIGN Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_152b[] = "FLYTECH Technology CO Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_152c[] = "MACRAIGOR Systems LLC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_152d[] = "QUANTA Computer Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_152e[] = "MELEC Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_152f[] = "PHILIPS - CRYPTO";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1530[] = "ACQIS Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1531[] = "CHRYON Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1532[] = "ECHELON Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1533[] = "BALTIMORE";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1534[] = "ROAD Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1535[] = "EVERGREEN Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1537[] = "DATALEX COMMUNCATIONS";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1538[] = "ARALION Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1539[] = "ATELIER INFORMATIQUES et ELECTRONIQUE ETUDES S.A.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_153a[] = "ONO SOKKI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_153b[] = "TERRATEC Electronic GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_153c[] = "ANTAL Electronic";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_153d[] = "FILANET Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_153e[] = "TECHWELL Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_153f[] = "MIPS DENMARK";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1540[] = "PROVIDEO MULTIMEDIA Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1541[] = "MACHONE Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1542[] = "VIVID Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1543[] = "SILICON Laboratories";
+static const char pci_device_1543_3052[] = "Intel 537 [Winmodem]";
+static const char pci_device_1543_4c22[] = "Si3036 MC'97 DAA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1544[] = "DCM DATA Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1545[] = "VISIONTEK";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1546[] = "IOI Technology Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1547[] = "MITUTOYO Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1548[] = "JET PROPULSION Laboratory";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1549[] = "INTERCONNECT Systems Solutions";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_154a[] = "MAX Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_154b[] = "COMPUTEX Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_154c[] = "VISUAL Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_154d[] = "PAN INTERNATIONAL Industrial Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_154e[] = "SERVOTEST Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_154f[] = "STRATABEAM Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1550[] = "OPEN NETWORK Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1551[] = "SMART Electronic DEVELOPMENT GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1552[] = "RACAL AIRTECH Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1553[] = "CHICONY Electronics Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1554[] = "PROLINK Microsystems Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1555[] = "GESYTEC GmBH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1556[] = "PLD APPLICATIONS";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1557[] = "MEDIASTAR Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1558[] = "CLEVO/KAPOK Computer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1559[] = "SI LOGIC Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_155a[] = "INNOMEDIA Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_155b[] = "PROTAC INTERNATIONAL Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_155c[] = "Cemax-Icon Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_155d[] = "Mac System Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_155e[] = "LP Elektronik GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_155f[] = "Perle Systems Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1560[] = "Terayon Communications Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1561[] = "Viewgraphics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1562[] = "Symbol Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1563[] = "A-Trend Technology Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1564[] = "Yamakatsu Electronics Industry Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1565[] = "Biostar Microtech Int'l Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1566[] = "Ardent Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1567[] = "Jungsoft";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1568[] = "DDK Electronics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1569[] = "Palit Microsystems Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_156a[] = "Avtec Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_156b[] = "2wire Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_156c[] = "Vidac Electronics GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_156d[] = "Alpha-Top Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_156e[] = "Alfa Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_156f[] = "M-Systems Flash Disk Pioneers Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1570[] = "Lecroy Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1571[] = "Contemporary Controls";
+static const char pci_device_1571_a001[] = "CCSI PCI20-485 ARCnet";
+static const char pci_device_1571_a002[] = "CCSI PCI20-485D ARCnet";
+static const char pci_device_1571_a003[] = "CCSI PCI20-485X ARCnet";
+static const char pci_device_1571_a004[] = "CCSI PCI20-CXB ARCnet";
+static const char pci_device_1571_a005[] = "CCSI PCI20-CXS ARCnet";
+static const char pci_device_1571_a006[] = "CCSI PCI20-FOG-SMA ARCnet";
+static const char pci_device_1571_a007[] = "CCSI PCI20-FOG-ST ARCnet";
+static const char pci_device_1571_a008[] = "CCSI PCI20-TB5 ARCnet";
+static const char pci_device_1571_a009[] = "CCSI PCI20-5-485 5Mbit ARCnet";
+static const char pci_device_1571_a00a[] = "CCSI PCI20-5-485D 5Mbit ARCnet";
+static const char pci_device_1571_a00b[] = "CCSI PCI20-5-485X 5Mbit ARCnet";
+static const char pci_device_1571_a00c[] = "CCSI PCI20-5-FOG-ST 5Mbit ARCnet";
+static const char pci_device_1571_a00d[] = "CCSI PCI20-5-FOG-SMA 5Mbit ARCnet";
+static const char pci_device_1571_a201[] = "CCSI PCI22-485 10Mbit ARCnet";
+static const char pci_device_1571_a202[] = "CCSI PCI22-485D 10Mbit ARCnet";
+static const char pci_device_1571_a203[] = "CCSI PCI22-485X 10Mbit ARCnet";
+static const char pci_device_1571_a204[] = "CCSI PCI22-CHB 10Mbit ARCnet";
+static const char pci_device_1571_a205[] = "CCSI PCI22-FOG_ST 10Mbit ARCnet";
+static const char pci_device_1571_a206[] = "CCSI PCI22-THB 10Mbit ARCnet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1572[] = "Otis Elevator Company";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1573[] = "Lattice - Vantis";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1574[] = "Fairchild Semiconductor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1575[] = "Voltaire Advanced Data Security Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1576[] = "Viewcast COM";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1578[] = "HITT";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1579[] = "Dual Technology Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_157a[] = "Japan Elecronics Ind Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_157b[] = "Star Multimedia Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_157c[] = "Eurosoft (UK)";
+static const char pci_device_157c_8001[] = "Fix2000 PCI Y2K Compliance Card";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_157d[] = "Gemflex Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_157e[] = "Transition Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_157f[] = "PX Instruments Technology Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1580[] = "Primex Aerospace Co";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1581[] = "SEH Computertechnik GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1582[] = "Cytec Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1583[] = "Inet Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1584[] = "Uniwill Computer Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1585[] = "Logitron";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1586[] = "Lancast Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1587[] = "Konica Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1588[] = "Solidum Systems Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1589[] = "Atlantek Microsystems Pty Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_158a[] = "Digalog Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_158b[] = "Allied Data Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_158c[] = "Hitachi Semiconductor & Devices Sales Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_158d[] = "Point Multimedia Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_158e[] = "Lara Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_158f[] = "Ditect Coop";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1590[] = "3pardata Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1591[] = "ARN";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1592[] = "Syba Tech Ltd";
+static const char pci_device_1592_0781[] = "Multi-IO Card";
+static const char pci_device_1592_0782[] = "Parallel Port Card 2xEPP";
+static const char pci_device_1592_0783[] = "Multi-IO Card";
+static const char pci_device_1592_0785[] = "Multi-IO Card";
+static const char pci_device_1592_0786[] = "Multi-IO Card";
+static const char pci_device_1592_0787[] = "Multi-IO Card";
+static const char pci_device_1592_0788[] = "Multi-IO Card";
+static const char pci_device_1592_078a[] = "Multi-IO Card";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1593[] = "Bops Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1594[] = "Netgame Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1595[] = "Diva Systems Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1596[] = "Folsom Research Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1597[] = "Memec Design Services";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1598[] = "Granite Microsystems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1599[] = "Delta Electronics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_159a[] = "General Instrument";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_159b[] = "Faraday Technology Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_159c[] = "Stratus Computer Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_159d[] = "Ningbo Harrison Electronics Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_159e[] = "A-Max Technology Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_159f[] = "Galea Network Security";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a0[] = "Compumaster SRL";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a1[] = "Geocast Network Systems";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a2[] = "Catalyst Enterprises Inc";
+static const char pci_device_15a2_0001[] = "TA700 PCI Bus Analyzer/Exerciser";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a3[] = "Italtel";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a4[] = "X-Net OY";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a5[] = "Toyota Macs Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a6[] = "Sunlight Ultrasound Technologies Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a7[] = "SSE Telecom Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15a8[] = "Shanghai Communications Technologies Center";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15aa[] = "Moreton Bay";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ab[] = "Bluesteel Networks Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ac[] = "North Atlantic Instruments";
+#endif
+static const char pci_vendor_15ad[] = "VMWare Inc";
+static const char pci_device_15ad_0710[] = "Virtual SVGA";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ae[] = "Amersham Pharmacia Biotech";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b0[] = "Zoltrix International Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b1[] = "Source Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b2[] = "Mosaid Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b3[] = "Mellanox Technology";
+static const char pci_device_15b3_5274[] = "MT21108 InfiniBridge";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b4[] = "CCI/TRIAD";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b5[] = "Cimetrics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b6[] = "Texas Memory Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b7[] = "Sandisk Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b8[] = "ADDI-DATA GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15b9[] = "Maestro Digital Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ba[] = "Impacct Technology Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15bb[] = "Portwell Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15bc[] = "Agilent Technologies";
+static const char pci_device_15bc_2929[] = "E2929A PCI/PCI-X Bus Analyzer";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15bd[] = "DFI Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15be[] = "Sola Electronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15bf[] = "High Tech Computer Corp (HTC)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c0[] = "BVM Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c1[] = "Quantel";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c2[] = "Newer Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c3[] = "Taiwan Mycomp Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c4[] = "EVSX Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c5[] = "Procomp Informatics Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c6[] = "Technical University of Budapest";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c7[] = "Tateyama System Laboratory Co Ltd";
+static const char pci_device_15c7_0349[] = "Tateyama C-PCI PLC/NC card Rev.01A";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c8[] = "Penta Media Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15c9[] = "Serome Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ca[] = "Bitboys OY";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15cb[] = "AG Electronics Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15cc[] = "Hotrail Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15cd[] = "Dreamtech Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ce[] = "Genrad Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15cf[] = "Hilscher GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d1[] = "Infineon Technologies AG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d2[] = "FIC (First International Computer Inc)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d3[] = "NDS Technologies Israel Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d4[] = "Iwill Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d5[] = "Tatung Co";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d6[] = "Entridia Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d7[] = "Rockwell-Collins Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d8[] = "Cybernetics Technology Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15d9[] = "Super Micro Computer Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15da[] = "Cyberfirm Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15db[] = "Applied Computing Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15dc[] = "Litronic Inc";
+static const char pci_device_15dc_0001[] = "Argus 300 PCI Cryptography Module";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15dd[] = "Sigmatel Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15de[] = "Malleable Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15df[] = "Infinilink Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e0[] = "Cacheflow Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e1[] = "Voice Technologies Group Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e2[] = "Quicknet Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e3[] = "Networth Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e4[] = "VSN Systemen BV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e5[] = "Valley technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e6[] = "Agere Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e7[] = "Get Engineering Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e8[] = "National Datacomm Corp";
+static const char pci_device_15e8_0130[] = "Wireless PCI Card";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15e9[] = "Pacific Digital Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ea[] = "Tokyo Denshi Sekei K.K.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15eb[] = "Drsearch GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ec[] = "Beckhoff GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ed[] = "Macrolink Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ee[] = "In Win Development Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ef[] = "Intelligent Paradigm Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f0[] = "B-Tree Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f1[] = "Times N Systems Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f2[] = "Diagnostic Instruments Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f3[] = "Digitmedia Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f4[] = "Valuesoft";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f5[] = "Power Micro Research";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f6[] = "Extreme Packet Device Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f7[] = "Banctec";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f8[] = "Koga Electronics Co";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15f9[] = "Zenith Electronics Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15fa[] = "J.P. Axzam Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15fb[] = "Zilog Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15fc[] = "Techsan Electronics Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15fd[] = "N-CUBED.NET";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15fe[] = "Kinpo Electronics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_15ff[] = "Fastpoint Technologies Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1600[] = "Northrop Grumman - Canada Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1601[] = "Tenta Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1602[] = "Prosys-tec Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1603[] = "Nokia Wireless Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1604[] = "Central System Research Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1605[] = "Pairgain Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1606[] = "Europop AG";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1607[] = "Lava Semiconductor Manufacturing Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1608[] = "Automated Wagering International";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1609[] = "Scimetric Instruments Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1612[] = "Telesynergy Research Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1619[] = "FarSite Communications Ltd";
+static const char pci_device_1619_0400[] = "FarSync T2P (2 port X.21/V.35/V.24)";
+static const char pci_device_1619_0440[] = "FarSync T4P (4 port X.21/V.35/V.24)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1629[] = "Kongsberg Spacetec AS";
+static const char pci_device_1629_1003[] = "Format synchronizer v3.0";
+static const char pci_device_1629_2002[] = "Fast Universal Data Output";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1638[] = "Standard Microsystems Corp [SMC]";
+static const char pci_device_1638_1100[] = "SMC2602W EZConnect / Addtron AWA-100";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_163c[] = "Smart Link Ltd.";
+static const char pci_device_163c_5449[] = "SmartPCI561 Modem";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1657[] = "Brocade Communications Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_165a[] = "Epix Inc";
+static const char pci_device_165a_c100[] = "PIXCI(R) CL1 Camera Link Video Capture Board [custom QL5232]";
+static const char pci_device_165a_d200[] = "PIXCI(R) D2X Digital Video Capture Board [custom QL5232]";
+static const char pci_device_165a_d300[] = "PIXCI(R) D3X Digital Video Capture Board [custom QL5232]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_165d[] = "Hsing Tech. Enterprise Co., Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1661[] = "Worldspace Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1668[] = "Actiontec Electronics Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1681[] = "Hercules";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_16ab[] = "Global Sun Technology Inc";
+static const char pci_device_16ab_1102[] = "PCMCIA-to-PCI Wireless Network Bridge";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_16be[] = "Creatix Polymedia GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_16ec[] = "U.S. Robotics";
+static const char pci_device_16ec_3685[] = "Wireless Access PCI Adapter Model 022415";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_16f6[] = "VideoTele.com, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1705[] = "Digital First, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_170b[] = "NetOctave Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_170c[] = "YottaYotta Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_172a[] = "Accelerated Encryption";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1737[] = "Linksys";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_173b[] = "Altima (nee Broadcom)";
+static const char pci_device_173b_03e8[] = "AC1000 Gigabit Ethernet";
+static const char pci_device_173b_03ea[] = "AC9100 Gigabit Ethernet";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_173b_03ea_173b_0001[] = "AC1002";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1743[] = "Peppercon AG";
+static const char pci_device_1743_8139[] = "ROL/F-100 Fast Ethernet Adapter with ROL";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_174b[] = "PC Partner Limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_175e[] = "Sanera Systems, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1787[] = "Hightech Information System Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1796[] = "Research Centre Juelich";
+static const char pci_device_1796_0001[] = "SIS1100 [Gigabit link]";
+static const char pci_device_1796_0002[] = "HOTlink";
+static const char pci_device_1796_0003[] = "Counter Timer";
+static const char pci_device_1796_0004[] = "CAMAC Controller";
+static const char pci_device_1796_0005[] = "PROFIBUS";
+static const char pci_device_1796_0006[] = "AMCC HOTlink";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1799[] = "Belkin";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_17af[] = "Hightech Information System Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_17cc[] = "NetChip Technology, Inc";
+static const char pci_device_17cc_2280[] = "USB 2.0";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1813[] = "Ambient Technologies Inc";
+static const char pci_device_1813_4000[] = "HaM controllerless modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1813_4000_16be_0001[] = "V9x HAM Data Fax Modem";
+#endif
+static const char pci_device_1813_4100[] = "HaM plus Data Fax Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_1813_4100_16be_0002[] = "V9x HAM 1394";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1851[] = "Microtune, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1852[] = "Anritsu Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1888[] = "Varisys Ltd";
+static const char pci_device_1888_0301[] = "VMFX1 FPGA PMC module";
+static const char pci_device_1888_0601[] = "VSM2 dual PMC carrier";
+static const char pci_device_1888_0710[] = "VS14x series PowerPC PCI board";
+static const char pci_device_1888_0720[] = "VS24x series PowerPC PCI board";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1a08[] = "Sierra semiconductor";
+static const char pci_device_1a08_0000[] = "SC15064";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1b13[] = "Jaton Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1c1c[] = "Symphony";
+static const char pci_device_1c1c_0001[] = "82C101";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1d44[] = "DPT";
+static const char pci_device_1d44_a400[] = "PM2x24/PM3224";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_1de1[] = "Tekram Technology Co.,Ltd.";
+static const char pci_device_1de1_0391[] = "TRM-S1040";
+static const char pci_device_1de1_2020[] = "DC-390";
+static const char pci_device_1de1_690c[] = "690c";
+static const char pci_device_1de1_dc29[] = "DC290";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_2000[] = "Smart Link Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_2001[] = "Temporal Research Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_2003[] = "Smart Link Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_2004[] = "Smart Link Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_21c3[] = "21st Century Computer Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_2348[] = "Racore";
+static const char pci_device_2348_2010[] = "8142 100VG/AnyLAN";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_2646[] = "Kingston Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_270b[] = "Xantel Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_270f[] = "Chaintech Computer Co. Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_2711[] = "AVID Technology Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_2a15[] = "3D Vision(?)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_3000[] = "Hansol Electronics Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_3142[] = "Post Impression Systems.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_3388[] = "Hint Corp";
+static const char pci_device_3388_0013[] = "HiNT HC4 PCI to ISDN bridge, Multimedia audio controller";
+static const char pci_device_3388_0014[] = "HiNT HC4 PCI to ISDN bridge, Network controller";
+static const char pci_device_3388_0021[] = "HB1-SE33 PCI-PCI Bridge";
+static const char pci_device_3388_8011[] = "VXPro II Chipset";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3388_8011_3388_8011[] = "VXPro II Chipset CPU to PCI Bridge";
+#endif
+static const char pci_device_3388_8012[] = "VXPro II Chipset";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3388_8012_3388_8012[] = "VXPro II Chipset PCI to ISA Bridge";
+#endif
+static const char pci_device_3388_8013[] = "VXPro II IDE";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3388_8013_3388_8013[] = "VXPro II Chipset EIDE Controller";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_3411[] = "Quantum Designs (H.K.) Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_3513[] = "ARCOM Control Systems Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_38ef[] = "4Links";
+#endif
+static const char pci_vendor_3d3d[] = "3DLabs";
+static const char pci_device_3d3d_0001[] = "GLINT 300SX";
+static const char pci_device_3d3d_0002[] = "GLINT 500TX";
+static const char pci_device_3d3d_0003[] = "GLINT Delta";
+static const char pci_device_3d3d_0004[] = "Permedia";
+static const char pci_device_3d3d_0005[] = "Permedia";
+static const char pci_device_3d3d_0006[] = "GLINT MX";
+static const char pci_device_3d3d_0007[] = "3D Extreme";
+static const char pci_device_3d3d_0008[] = "GLINT Gamma G1";
+static const char pci_device_3d3d_0009[] = "Permedia II 2D+3D";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_1040_0011[] = "AccelStar II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_3d3d_0100[] = "AccelStar II 3D Accelerator";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_3d3d_0111[] = "Permedia 3:16";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_3d3d_0114[] = "Santa Ana";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_3d3d_0116[] = "Oxygen GVX1";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_3d3d_0119[] = "Scirocco";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_3d3d_0120[] = "Santa Ana PCL";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_3d3d_0125[] = "Oxygen VX1";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_0009_3d3d_0127[] = "Permedia3 Create!";
+#endif
+static const char pci_device_3d3d_000a[] = "GLINT R3";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_000a_3d3d_0121[] = "Oxygen VX1";
+#endif
+static const char pci_device_3d3d_000c[] = "GLINT R3 [Oxygen VX1]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_3d3d_000c_3d3d_0144[] = "Oxygen VX1-4X AGP [Permedia 4]";
+#endif
+static const char pci_device_3d3d_0100[] = "Permedia II 2D+3D";
+static const char pci_device_3d3d_1004[] = "Permedia";
+static const char pci_device_3d3d_3d04[] = "Permedia";
+static const char pci_device_3d3d_ffff[] = "Glint VGA";
+static const char pci_vendor_4005[] = "Avance Logic Inc.";
+static const char pci_device_4005_0300[] = "ALS300 PCI Audio Device";
+static const char pci_device_4005_0308[] = "ALS300+ PCI Audio Device";
+static const char pci_device_4005_0309[] = "PCI Input Controller";
+static const char pci_device_4005_1064[] = "ALG-2064";
+static const char pci_device_4005_2064[] = "ALG-2064i";
+static const char pci_device_4005_2128[] = "ALG-2364A GUI Accelerator";
+static const char pci_device_4005_2301[] = "ALG-2301";
+static const char pci_device_4005_2302[] = "ALG-2302";
+static const char pci_device_4005_2303[] = "AVG-2302 GUI Accelerator";
+static const char pci_device_4005_2364[] = "ALG-2364A";
+static const char pci_device_4005_2464[] = "ALG-2464";
+static const char pci_device_4005_2501[] = "ALG-2564A/25128A";
+static const char pci_device_4005_4000[] = "ALS4000 Audio Chipset";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_4005_4000_4005_4000[] = "ALS4000 Audio Chipset";
+#endif
+static const char pci_device_4005_4710[] = "ALC200/200P";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4033[] = "Addtron Technology Co, Inc.";
+static const char pci_device_4033_1360[] = "RTL8139 Ethernet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4143[] = "Digital Equipment Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_416c[] = "Aladdin Knowledge Systems";
+static const char pci_device_416c_0100[] = "AladdinCARD";
+static const char pci_device_416c_0200[] = "CPC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4444[] = "Internext Compression Inc";
+static const char pci_device_4444_0803[] = "iTVC15 MPEG-2 Encoder";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4468[] = "Bridgeport machines";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4594[] = "Cogetec Informatique Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_45fb[] = "Baldor Electric Company";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4680[] = "Umax Computer Corp";
+#endif
+static const char pci_vendor_4843[] = "Hercules Computer Technology Inc";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4916[] = "RedCreek Communications Inc";
+static const char pci_device_4916_1960[] = "RedCreek PCI adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4943[] = "Growth Networks";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4978[] = "Axil Computer Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4a14[] = "NetVin";
+static const char pci_device_4a14_5000[] = "NV5000SC";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_4a14_5000_4a14_5000[] = "RT8029-Based Ethernet Adapter";
+#endif
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4b10[] = "Buslogic Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4c48[] = "LUNG HWA Electronics";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4c53[] = "SBS Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4ca1[] = "Seanix Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4d51[] = "MediaQ Inc.";
+static const char pci_device_4d51_0200[] = "MQ-200";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4d54[] = "Microtechnica Co Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_4ddc[] = "ILC Data Device Corp";
+static const char pci_device_4ddc_0100[] = "DD-42924I5-300 (ARINC 429 Data Bus)";
+static const char pci_device_4ddc_0801[] = "BU-65570I1 MIL-STD-1553 Test and Simulation";
+static const char pci_device_4ddc_0802[] = "BU-65570I2 MIL-STD-1553 Test and Simulation";
+static const char pci_device_4ddc_0811[] = "BU-65572I1 MIL-STD-1553 Test and Simulation";
+static const char pci_device_4ddc_0812[] = "BU-65572I2 MIL-STD-1553 Test and Simulation";
+static const char pci_device_4ddc_0881[] = "BU-65570T1 MIL-STD-1553 Test and Simulation";
+static const char pci_device_4ddc_0882[] = "BU-65570T2 MIL-STD-1553 Test and Simulation";
+static const char pci_device_4ddc_0891[] = "BU-65572T1 MIL-STD-1553 Test and Simulation";
+static const char pci_device_4ddc_0892[] = "BU-65572T2 MIL-STD-1553 Test and Simulation";
+static const char pci_device_4ddc_0901[] = "BU-65565C1 MIL-STD-1553 Data Bus";
+static const char pci_device_4ddc_0902[] = "BU-65565C2 MIL-STD-1553 Data Bus";
+static const char pci_device_4ddc_0903[] = "BU-65565C3 MIL-STD-1553 Data Bus";
+static const char pci_device_4ddc_0904[] = "BU-65565C4 MIL-STD-1553 Data Bus";
+static const char pci_device_4ddc_0b01[] = "BU-65569I1 MIL-STD-1553 Data Bus";
+static const char pci_device_4ddc_0b02[] = "BU-65569I2 MIL-STD-1553 Data Bus";
+static const char pci_device_4ddc_0b03[] = "BU-65569I3 MIL-STD-1553 Data Bus";
+static const char pci_device_4ddc_0b04[] = "BU-65569I4 MIL-STD-1553 Data Bus";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5046[] = "GemTek Technology Corporation";
+static const char pci_device_5046_1001[] = "PCI Radio";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5053[] = "Voyetra Technologies";
+static const char pci_device_5053_2010[] = "Daytona Audio Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5136[] = "S S Technologies";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5143[] = "Qualcomm Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5145[] = "Ensoniq (Old)";
+static const char pci_device_5145_3031[] = "Concert AudioPCI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5168[] = "Animation Technologies Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5301[] = "Alliance Semiconductor Corp.";
+static const char pci_device_5301_0001[] = "ProMotion aT3D";
+#endif
+static const char pci_vendor_5333[] = "S3 Inc.";
+static const char pci_device_5333_0551[] = "Plato/PX (system)";
+static const char pci_device_5333_5631[] = "86c325 [ViRGE]";
+static const char pci_device_5333_8800[] = "86c866 [Vision 866]";
+static const char pci_device_5333_8801[] = "86c964 [Vision 964]";
+static const char pci_device_5333_8810[] = "86c764_0 [Trio 32 vers 0]";
+static const char pci_device_5333_8811[] = "86c764/765 [Trio32/64/64V+]";
+static const char pci_device_5333_8812[] = "86cM65 [Aurora64V+]";
+static const char pci_device_5333_8813[] = "86c764_3 [Trio 32/64 vers 3]";
+static const char pci_device_5333_8814[] = "86c767 [Trio 64UV+]";
+static const char pci_device_5333_8815[] = "86cM65 [Aurora 128]";
+static const char pci_device_5333_883d[] = "86c988 [ViRGE/VX]";
+static const char pci_device_5333_8870[] = "FireGL";
+static const char pci_device_5333_8880[] = "86c868 [Vision 868 VRAM] vers 0";
+static const char pci_device_5333_8881[] = "86c868 [Vision 868 VRAM] vers 1";
+static const char pci_device_5333_8882[] = "86c868 [Vision 868 VRAM] vers 2";
+static const char pci_device_5333_8883[] = "86c868 [Vision 868 VRAM] vers 3";
+static const char pci_device_5333_88b0[] = "86c928 [Vision 928 VRAM] vers 0";
+static const char pci_device_5333_88b1[] = "86c928 [Vision 928 VRAM] vers 1";
+static const char pci_device_5333_88b2[] = "86c928 [Vision 928 VRAM] vers 2";
+static const char pci_device_5333_88b3[] = "86c928 [Vision 928 VRAM] vers 3";
+static const char pci_device_5333_88c0[] = "86c864 [Vision 864 DRAM] vers 0";
+static const char pci_device_5333_88c1[] = "86c864 [Vision 864 DRAM] vers 1";
+static const char pci_device_5333_88c2[] = "86c864 [Vision 864-P DRAM] vers 2";
+static const char pci_device_5333_88c3[] = "86c864 [Vision 864-P DRAM] vers 3";
+static const char pci_device_5333_88d0[] = "86c964 [Vision 964 VRAM] vers 0";
+static const char pci_device_5333_88d1[] = "86c964 [Vision 964 VRAM] vers 1";
+static const char pci_device_5333_88d2[] = "86c964 [Vision 964-P VRAM] vers 2";
+static const char pci_device_5333_88d3[] = "86c964 [Vision 964-P VRAM] vers 3";
+static const char pci_device_5333_88f0[] = "86c968 [Vision 968 VRAM] rev 0";
+static const char pci_device_5333_88f1[] = "86c968 [Vision 968 VRAM] rev 1";
+static const char pci_device_5333_88f2[] = "86c968 [Vision 968 VRAM] rev 2";
+static const char pci_device_5333_88f3[] = "86c968 [Vision 968 VRAM] rev 3";
+static const char pci_device_5333_8900[] = "86c755 [Trio 64V2/DX]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8900_5333_8900[] = "86C775 Trio64V2/DX";
+#endif
+static const char pci_device_5333_8901[] = "86c775/86c785 [Trio 64V2/DX or /GX]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8901_5333_8901[] = "86C775 Trio64V2/DX, 86C785 Trio64V2/GX";
+#endif
+static const char pci_device_5333_8902[] = "Plato/PX";
+static const char pci_device_5333_8903[] = "Trio 3D business multimedia";
+static const char pci_device_5333_8904[] = "Trio 64 3D";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8904_1014_00db[] = "Integrated Trio3D";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8904_5333_8904[] = "86C365 Trio3D AGP";
+#endif
+static const char pci_device_5333_8905[] = "Trio 64V+ family";
+static const char pci_device_5333_8906[] = "Trio 64V+ family";
+static const char pci_device_5333_8907[] = "Trio 64V+ family";
+static const char pci_device_5333_8908[] = "Trio 64V+ family";
+static const char pci_device_5333_8909[] = "Trio 64V+ family";
+static const char pci_device_5333_890a[] = "Trio 64V+ family";
+static const char pci_device_5333_890b[] = "Trio 64V+ family";
+static const char pci_device_5333_890c[] = "Trio 64V+ family";
+static const char pci_device_5333_890d[] = "Trio 64V+ family";
+static const char pci_device_5333_890e[] = "Trio 64V+ family";
+static const char pci_device_5333_890f[] = "Trio 64V+ family";
+static const char pci_device_5333_8a01[] = "ViRGE/DX or /GX";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a01_0e11_b032[] = "ViRGE/GX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a01_10b4_1617[] = "Nitro 3D";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a01_10b4_1717[] = "Nitro 3D";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a01_5333_8a01[] = "ViRGE/DX";
+#endif
+static const char pci_device_5333_8a10[] = "ViRGE/GX2";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a10_1092_8a10[] = "Stealth 3D 4000";
+#endif
+static const char pci_device_5333_8a13[] = "86c368 [Trio 3D/2X]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a13_5333_8a13[] = "Trio3D/2X";
+#endif
+static const char pci_device_5333_8a20[] = "86c794 [Savage 3D]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a20_5333_8a20[] = "86C391 Savage3D";
+#endif
+static const char pci_device_5333_8a21[] = "86c390 [Savage 3D/MV]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a21_5333_8a21[] = "86C390 Savage3D/MV";
+#endif
+static const char pci_device_5333_8a22[] = "Savage 4";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1033_8068[] = "Savage 4";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1033_8069[] = "Savage 4";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_105d_0018[] = "SR9 8Mb SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_105d_002a[] = "SR9 Pro 16Mb SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_105d_003a[] = "SR9 Pro 32Mb SDRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_105d_092f[] = "SR9 Pro+ 16Mb SGRAM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4207[] = "Stealth III S540";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4800[] = "Stealth III S540";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4807[] = "SpeedStar A90";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4808[] = "Stealth III S540";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4809[] = "Stealth III S540";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_480e[] = "Stealth III S540";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4904[] = "Stealth III S520";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4905[] = "SpeedStar A200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4a09[] = "Stealth III S540";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4a0b[] = "Stealth III S540 Xtreme";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4a0f[] = "Stealth III S540";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1092_4e01[] = "Stealth III S540";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1102_101d[] = "3d Blaster Savage 4";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_1102_101e[] = "3d Blaster Savage 4";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_5333_8100[] = "86C394-397 Savage4 SDRAM 100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_5333_8110[] = "86C394-397 Savage4 SDRAM 110";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_5333_8125[] = "86C394-397 Savage4 SDRAM 125";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_5333_8143[] = "86C394-397 Savage4 SDRAM 143";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_5333_8a22[] = "86C394-397 Savage4";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_5333_8a2e[] = "86C394-397 Savage4 32bit";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_5333_9125[] = "86C394-397 Savage4 SGRAM 125";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8a22_5333_9143[] = "86C394-397 Savage4 SGRAM 143";
+#endif
+static const char pci_device_5333_8a23[] = "Savage 4";
+static const char pci_device_5333_8a25[] = "ProSavage PM133";
+static const char pci_device_5333_8a26[] = "ProSavage KM133";
+static const char pci_device_5333_8c00[] = "ViRGE/M3";
+static const char pci_device_5333_8c01[] = "ViRGE/MX";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8c01_1179_0001[] = "ViRGE/MX";
+#endif
+static const char pci_device_5333_8c02[] = "ViRGE/MX+";
+static const char pci_device_5333_8c03[] = "ViRGE/MX+MV";
+static const char pci_device_5333_8c10[] = "86C270-294 Savage/MX-MV";
+static const char pci_device_5333_8c11[] = "82C270-294 Savage/MX";
+static const char pci_device_5333_8c12[] = "86C270-294 Savage/IX-MV";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8c12_1014_017f[] = "ThinkPad T20";
+#endif
+static const char pci_device_5333_8c13[] = "86C270-294 Savage/IX";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8c13_1179_0001[] = "Magnia Z310";
+#endif
+static const char pci_device_5333_8c22[] = "SuperSavage MX/128";
+static const char pci_device_5333_8c24[] = "SuperSavage MX/64";
+static const char pci_device_5333_8c26[] = "SuperSavage MX/64C";
+static const char pci_device_5333_8c2a[] = "SuperSavage IX/128 SDR";
+static const char pci_device_5333_8c2b[] = "SuperSavage IX/128 DDR";
+static const char pci_device_5333_8c2c[] = "SuperSavage IX/64 SDR";
+static const char pci_device_5333_8c2d[] = "SuperSavage IX/64 DDR";
+static const char pci_device_5333_8c2e[] = "SuperSavage IX/C SDR";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_8c2e_1014_01fc[] = "ThinkPad T23 (2647-4MG)";
+#endif
+static const char pci_device_5333_8c2f[] = "SuperSavage IX/C DDR";
+static const char pci_device_5333_8d01[] = "86C380 [ProSavageDDR K4M266]";
+static const char pci_device_5333_8d02[] = "VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK)";
+static const char pci_device_5333_8d03[] = "VT8751 [ProSavageDDR P4M266]";
+static const char pci_device_5333_8d04[] = "[ProSavageDDR K4M266]";
+static const char pci_device_5333_9102[] = "86C410 Savage 2000";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_9102_1092_5932[] = "Viper II Z200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_9102_1092_5934[] = "Viper II Z200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_9102_1092_5952[] = "Viper II Z200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_9102_1092_5954[] = "Viper II Z200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_9102_1092_5a35[] = "Viper II Z200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_9102_1092_5a37[] = "Viper II Z200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_9102_1092_5a55[] = "Viper II Z200";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_5333_9102_1092_5a57[] = "Viper II Z200";
+#endif
+static const char pci_device_5333_ca00[] = "SonicVibes";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_544c[] = "Teralogic Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5455[] = "Technische University Berlin";
+static const char pci_device_5455_4458[] = "S5933";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5519[] = "Cnet Technologies, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5544[] = "Dunord Technologies";
+static const char pci_device_5544_0001[] = "I-30xx Scanner Interface";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5555[] = "Genroco, Inc";
+static const char pci_device_5555_0003[] = "TURBOstor HFP-832 [HiPPI NIC]";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5654[] = "VoiceTronix Pty Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_5700[] = "Netpower";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_6356[] = "UltraStor";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_6374[] = "c't Magazin für Computertechnik";
+static const char pci_device_6374_6773[] = "GPPCI";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_6409[] = "Logitec Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_6666[] = "Decision Computer International Co.";
+static const char pci_device_6666_0001[] = "PCCOM4";
+static const char pci_device_6666_0002[] = "PCCOM8";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_7604[] = "O.N. Electronic Co Ltd.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_7bde[] = "MIDAC Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_7fed[] = "PowerTV";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_8008[] = "Quancom Electronic GmbH";
+static const char pci_device_8008_0010[] = "WDOG1 [PCI-Watchdog 1]";
+static const char pci_device_8008_0011[] = "PWDOG2 [PCI-Watchdog 2]";
+#endif
+static const char pci_vendor_8086[] = "Intel Corp.";
+static const char pci_device_8086_0007[] = "82379AB";
+static const char pci_device_8086_0008[] = "Extended Express System Support Controller";
+static const char pci_device_8086_0039[] = "21145";
+static const char pci_device_8086_0122[] = "82437FX";
+static const char pci_device_8086_0482[] = "82375EB";
+static const char pci_device_8086_0483[] = "82424ZX [Saturn]";
+static const char pci_device_8086_0484[] = "82378IB [SIO ISA Bridge]";
+static const char pci_device_8086_0486[] = "82430ZX [Aries]";
+static const char pci_device_8086_04a3[] = "82434LX [Mercury/Neptune]";
+static const char pci_device_8086_04d0[] = "82437FX [Triton FX]";
+static const char pci_device_8086_0600[] = "RAID Controller";
+static const char pci_device_8086_0960[] = "80960RP [i960 RP Microprocessor/Bridge]";
+static const char pci_device_8086_0962[] = "80960RM [i960RM Bridge]";
+static const char pci_device_8086_0964[] = "80960RP [i960 RP Microprocessor/Bridge]";
+static const char pci_device_8086_1000[] = "82542 Gigabit Ethernet Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1000_0e11_b0df[] = "NC1632 Gigabit Ethernet Adapter (1000-SX)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1000_0e11_b0e0[] = "NC1633 Gigabit Ethernet Adapter (1000-LX)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1000_0e11_b123[] = "NC1634 Gigabit Ethernet Adapter (1000-SX)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1000_1014_0119[] = "Netfinity Gigabit Ethernet SX Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1000_8086_1000[] = "PRO/1000 Gigabit Server Adapter";
+#endif
+static const char pci_device_8086_1001[] = "82543GC Gigabit Ethernet Controller (Fiber)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1001_0e11_004a[] = "NC6136 Gigabit Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1001_1014_01ea[] = "Netfinity Gigabit Ethernet SX Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1001_8086_1003[] = "PRO/1000 F Server Adapter";
+#endif
+static const char pci_device_8086_1002[] = "Pro 100 LAN+Modem 56 Cardbus II";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1002_8086_200e[] = "Pro 100 LAN+Modem 56 Cardbus II";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1002_8086_2013[] = "Pro 100 SR Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1002_8086_2017[] = "Pro 100 S Combo Mobile Adapter";
+#endif
+static const char pci_device_8086_1004[] = "82543GC Gigabit Ethernet Controller (Copper)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1004_0e11_0049[] = "NC7132 Gigabit Upgrade Module";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1004_0e11_b1a4[] = "NC7131 Gigabit Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1004_1014_10f2[] = "Gigabit Ethernet Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1004_8086_1004[] = "PRO/1000 T Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1004_8086_2004[] = "PRO/1000 T Server Adapter";
+#endif
+static const char pci_device_8086_1008[] = "82544EI Gigabit Ethernet Controller (Copper)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1008_8086_1107[] = "PRO/1000 XT Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1008_8086_2107[] = "PRO/1000 XT Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1008_8086_2110[] = "PRO/1000 XT Server Adapter";
+#endif
+static const char pci_device_8086_1009[] = "82544EI Gigabit Ethernet Controller (Fiber)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1009_8086_1109[] = "PRO/1000 XF Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1009_8086_2109[] = "PRO/1000 XF Server Adapter";
+#endif
+static const char pci_device_8086_100c[] = "82544GC Gigabit Ethernet Controller (Copper)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_100c_8086_1112[] = "PRO/1000 T Desktop Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_100c_8086_2112[] = "PRO/1000 T Desktop Adapter";
+#endif
+static const char pci_device_8086_100d[] = "82544GC Gigabit Ethernet Controller (LOM)";
+static const char pci_device_8086_100e[] = "82540EM Gigabit Ethernet Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_100e_8086_001e[] = "PRO/1000 MT Desktop Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_100e_8086_002e[] = "PRO/1000 MT Desktop Adapter";
+#endif
+static const char pci_device_8086_100f[] = "82545EM Gigabit Ethernet Controller (Copper)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_100f_8086_1001[] = "PRO/1000 MT Server Adapter";
+#endif
+static const char pci_device_8086_1010[] = "82546EB Gigabit Ethernet Controller (Copper)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1010_8086_1011[] = "PRO/1000 MT Dual Port Server Adapter";
+#endif
+static const char pci_device_8086_1011[] = "82545EM Gigabit Ethernet Controller (Fiber)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1011_8086_1002[] = "PRO/1000 MF Server Adapter";
+#endif
+static const char pci_device_8086_1012[] = "82546EB Gigabit Ethernet Controller (Fiber)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1012_8086_1012[] = "PRO/1000 MF Dual Port Server Adapter";
+#endif
+static const char pci_device_8086_1015[] = "82540EM Gigabit Ethernet Controller (LOM)";
+static const char pci_device_8086_1029[] = "82559 Ethernet Controller";
+static const char pci_device_8086_1030[] = "82559 InBusiness 10/100";
+static const char pci_device_8086_1031[] = "82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1031_1014_0209[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1031_104d_80e7[] = "Vaio PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1031_107b_5350[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1031_1179_0001[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1031_144d_c000[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1031_144d_c001[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1031_144d_c003[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1031_144d_c006[] = "vpr Matrix 170B4";
+#endif
+static const char pci_device_8086_1032[] = "82801CAM (ICH3) PRO/100 VE Ethernet Controller";
+static const char pci_device_8086_1033[] = "82801CAM (ICH3) PRO/100 VM (LOM) Ethernet Controller";
+static const char pci_device_8086_1034[] = "82801CAM (ICH3) PRO/100 VM Ethernet Controller";
+static const char pci_device_8086_1035[] = "82801CAM (ICH3)/82562EH (LOM) Ethernet Controller";
+static const char pci_device_8086_1036[] = "82801CAM (ICH3) 82562EH Ethernet Controller";
+static const char pci_device_8086_1037[] = "82801CAM (ICH3) Chipset Ethernet Controller";
+static const char pci_device_8086_1038[] = "82801CAM (ICH3) PRO/100 VM (KM) Ethernet Controller";
+static const char pci_device_8086_1039[] = "82801BD PRO/100 VE (LOM) Ethernet Controller";
+static const char pci_device_8086_103a[] = "82801BD PRO/100 VE (CNR) Ethernet Controller";
+static const char pci_device_8086_103b[] = "82801BD PRO/100 VM (LOM) Ethernet Controller";
+static const char pci_device_8086_103c[] = "82801BD PRO/100 VM (CNR) Ethernet Controller";
+static const char pci_device_8086_103d[] = "82801BD PRO/100 VE (MOB) Ethernet Controller";
+static const char pci_device_8086_103e[] = "82801BD PRO/100 VM (MOB) Ethernet Controller";
+static const char pci_device_8086_1040[] = "536EP Data Fax Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1040_16be_1040[] = "V.9X DSP Data Fax Modem";
+#endif
+static const char pci_device_8086_1059[] = "82551QM Ethernet Controller";
+static const char pci_device_8086_1130[] = "82815 815 Chipset Host Bridge and Memory Controller Hub";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1130_1025_1016[] = "Travelmate 612 TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1130_1043_8027[] = "TUSL2-C Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1130_104d_80df[] = "Vaio PCG-FX403";
+#endif
+static const char pci_device_8086_1131[] = "82815 815 Chipset AGP Bridge";
+static const char pci_device_8086_1132[] = "82815 CGC [Chipset Graphics Controller]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1132_1025_1016[] = "Travelmate 612 TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1132_104d_80df[] = "Vaio PCG-FX403";
+#endif
+static const char pci_device_8086_1161[] = "82806AA PCI64 Hub Advanced Programmable Interrupt Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1161_8086_1161[] = "82806AA PCI64 Hub APIC";
+#endif
+static const char pci_device_8086_1162[] = "Xscale 80200 Big Endian Companion Chip";
+static const char pci_device_8086_1200[] = "Intel IXP1200 Network Processor";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1200_172a_0000[] = "AEP SSL Accelerator";
+#endif
+static const char pci_device_8086_1209[] = "82559ER";
+static const char pci_device_8086_1221[] = "82092AA_0";
+static const char pci_device_8086_1222[] = "82092AA_1";
+static const char pci_device_8086_1223[] = "SAA7116";
+static const char pci_device_8086_1225[] = "82452KX/GX [Orion]";
+static const char pci_device_8086_1226[] = "82596 PRO/10 PCI";
+static const char pci_device_8086_1227[] = "82865 EtherExpress PRO/100A";
+static const char pci_device_8086_1228[] = "82556 EtherExpress PRO/100 Smart";
+static const char pci_device_8086_1229[] = "82557/8/9 [Ethernet Pro 100]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_3001[] = "82559 Fast Ethernet LOM with Alert on LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_3002[] = "82559 Fast Ethernet LOM with Alert on LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_3003[] = "82559 Fast Ethernet LOM with Alert on LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_3004[] = "82559 Fast Ethernet LOM with Alert on LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_3005[] = "82559 Fast Ethernet LOM with Alert on LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_3006[] = "82559 Fast Ethernet LOM with Alert on LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_3007[] = "82559 Fast Ethernet LOM with Alert on LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b01e[] = "NC3120 Fast Ethernet NIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b01f[] = "NC3122 Fast Ethernet NIC (dual port)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b02f[] = "NC1120 Ethernet NIC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b04a[] = "Netelligent 10/100TX NIC with Wake on LAN";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b0c6[] = "NC3161 Fast Ethernet NIC (embedded, WOL)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b0c7[] = "NC3160 Fast Ethernet NIC (embedded)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b0d7[] = "NC3121 Fast Ethernet NIC (WOL)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b0dd[] = "NC3131 Fast Ethernet NIC (dual port)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b0de[] = "NC3132 Fast Ethernet Module (dual port)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b0e1[] = "NC3133 Fast Ethernet Module (100-FX)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b134[] = "NC3163 Fast Ethernet NIC (embedded, WOL)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b13c[] = "NC3162 Fast Ethernet NIC (embedded)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b144[] = "NC3123 Fast Ethernet NIC (WOL)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b163[] = "NC3134 Fast Ethernet NIC (dual port)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b164[] = "NC3135 Fast Ethernet Upgrade Module (dual port)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_0e11_b1a4[] = "NC7131 Gigabit Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_005c[] = "82558B Ethernet Pro 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_01bc[] = "82559 Fast Ethernet LAN On Motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_01f1[] = "10/100 Ethernet Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_01f2[] = "10/100 Ethernet Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_0207[] = "Ethernet Pro/100 S";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_0232[] = "10/100 Dual Port Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_023a[] = "ThinkPad R30";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_105c[] = "Netfinity 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_2205[] = "ThinkPad A22p";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_305c[] = "10/100 EtherJet Management Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_405c[] = "10/100 EtherJet Adapter with Alert on LAN";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_505c[] = "10/100 EtherJet Secure Management Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_605c[] = "10/100 EtherJet Secure Management Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_705c[] = "10/100 Netfinity 10/100 Ethernet Security Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1014_805c[] = "10/100 Netfinity 10/100 Ethernet Security Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1028_009b[] = "PowerEdge 2550";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1033_8000[] = "PC-9821X-B06";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1033_8016[] = "PK-UG-X006";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1033_801f[] = "PK-UG-X006";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1033_8026[] = "PK-UG-X006";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1033_8063[] = "82559-based Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1033_8064[] = "82559-based Fast Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_103c_10c0[] = "NetServer 10/100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_103c_10c3[] = "NetServer 10/100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_103c_10ca[] = "NetServer 10/100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_103c_10cb[] = "NetServer 10/100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_103c_10e3[] = "NetServer 10/100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_103c_10e4[] = "NetServer 10/100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_103c_1200[] = "NetServer 10/100TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_10c3_1100[] = "SmartEther100 SC1100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_10cf_1115[] = "8255x-based Ethernet Adapter (10/100)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_10cf_1143[] = "8255x-based Ethernet Adapter (10/100)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1179_0001[] = "8255x-based Ethernet Adapter (10/100)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1179_0002[] = "PCI FastEther LAN on Docker";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1179_0003[] = "8255x-based Fast Ethernet";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1259_2560[] = "AT-2560 100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1259_2561[] = "AT-2560 100 FX Ethernet Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1266_0001[] = "NE10/100 Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_144d_2501[] = "SEM-2000 MiniPCI LAN Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_144d_2502[] = "SEM-2100IL MiniPCI LAN Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_1668_1100[] = "EtherExpress PRO/100B (TX) (MiniPCI Ethernet+Modem)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0001[] = "EtherExpress PRO/100B (TX)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0002[] = "EtherExpress PRO/100B (T4)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0003[] = "EtherExpress PRO/10+";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0004[] = "EtherExpress PRO/100 WfM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0005[] = "82557 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0006[] = "82557 10/100 with Wake on LAN";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0007[] = "82558 10/100 Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0008[] = "82558 10/100 with Wake on LAN";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0009[] = "EtherExpress PRO/100+";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_000a[] = "EtherExpress PRO/100+ Management Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_000b[] = "EtherExpress PRO/100+";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_000c[] = "EtherExpress PRO/100+ Management Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_000d[] = "EtherExpress PRO/100+ Alert On LAN II* Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_000e[] = "EtherExpress PRO/100+ Management Adapter with Alert On LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_000f[] = "EtherExpress PRO/100 Desktop Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0010[] = "EtherExpress PRO/100 S Management Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0011[] = "EtherExpress PRO/100 S Management Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0012[] = "EtherExpress PRO/100 S Advanced Management Adapter (D)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0013[] = "EtherExpress PRO/100 S Advanced Management Adapter (E)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0030[] = "EtherExpress PRO/100 Management Adapter with Alert On LAN* GC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0031[] = "EtherExpress PRO/100 Desktop Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0040[] = "EtherExpress PRO/100 S Desktop Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0041[] = "EtherExpress PRO/100 S Desktop Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0042[] = "EtherExpress PRO/100 Desktop Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_0050[] = "EtherExpress PRO/100 S Desktop Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1009[] = "EtherExpress PRO/100+ Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_100c[] = "EtherExpress PRO/100+ Server Adapter (PILA8470B)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1012[] = "EtherExpress PRO/100 S Server Adapter (D)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1013[] = "EtherExpress PRO/100 S Server Adapter (E)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1015[] = "EtherExpress PRO/100 S Dual Port Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1017[] = "EtherExpress PRO/100+ Dual Port Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1030[] = "EtherExpress PRO/100+ Management Adapter with Alert On LAN* G Server";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1040[] = "EtherExpress PRO/100 S Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1041[] = "EtherExpress PRO/100 S Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1042[] = "EtherExpress PRO/100 Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1050[] = "EtherExpress PRO/100 S Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1051[] = "EtherExpress PRO/100 Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_1052[] = "EtherExpress PRO/100 Server Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_10f0[] = "EtherExpress PRO/100+ Dual Port Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2009[] = "EtherExpress PRO/100 S Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_200d[] = "EtherExpress PRO/100 Cardbus";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_200e[] = "EtherExpress PRO/100 LAN+V90 Cardbus Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_200f[] = "EtherExpress PRO/100 SR Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2010[] = "EtherExpress PRO/100 S Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2013[] = "EtherExpress PRO/100 SR Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2016[] = "EtherExpress PRO/100 S Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2017[] = "EtherExpress PRO/100 S Combo Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2018[] = "EtherExpress PRO/100 SR Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2019[] = "EtherExpress PRO/100 SR Combo Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2101[] = "EtherExpress PRO/100 P Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2102[] = "EtherExpress PRO/100 SP Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2103[] = "EtherExpress PRO/100 SP Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2104[] = "EtherExpress PRO/100 SP Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2105[] = "EtherExpress PRO/100 SP Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2106[] = "EtherExpress PRO/100 P Mobile Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2107[] = "EtherExpress PRO/100 Network Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2108[] = "EtherExpress PRO/100 Network Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2200[] = "EtherExpress PRO/100 P Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2201[] = "EtherExpress PRO/100 P Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2202[] = "EtherExpress PRO/100 SP Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2203[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2204[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2205[] = "EtherExpress PRO/100 SP Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2206[] = "EtherExpress PRO/100 SP Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2207[] = "EtherExpress PRO/100 SP Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2208[] = "EtherExpress PRO/100 P Mobile Combo Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2402[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2407[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2408[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2409[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_240f[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2410[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2411[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2412[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_2413[] = "EtherExpress PRO/100+ MiniPCI";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3000[] = "82559 Fast Ethernet LAN on Motherboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3001[] = "82559 Fast Ethernet LOM with Basic Alert on LAN*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3002[] = "82559 Fast Ethernet LOM with Alert on LAN II*";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3006[] = "EtherExpress PRO/100 S Network Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3007[] = "EtherExpress PRO/100 S Network Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3008[] = "EtherExpress PRO/100 Network Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3010[] = "EtherExpress PRO/100 S Network Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3011[] = "EtherExpress PRO/100 S Network Connection";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1229_8086_3012[] = "EtherExpress PRO/100 Network Connection";
+#endif
+static const char pci_device_8086_122d[] = "430FX - 82437FX TSC [Triton I]";
+static const char pci_device_8086_122e[] = "82371FB PIIX ISA [Triton I]";
+static const char pci_device_8086_1230[] = "82371FB PIIX IDE [Triton I]";
+static const char pci_device_8086_1231[] = "DSVD Modem";
+static const char pci_device_8086_1234[] = "430MX - 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)";
+static const char pci_device_8086_1235[] = "430MX - 82437MX Mob. System Ctrlr (MTSC) & 82438MX Data Path (MTDP)";
+static const char pci_device_8086_1237[] = "440FX - 82441FX PMC [Natoma]";
+static const char pci_device_8086_1239[] = "82371FB";
+static const char pci_device_8086_123b[] = "82380PB";
+static const char pci_device_8086_123c[] = "82380AB";
+static const char pci_device_8086_123d[] = "683053 Programmable Interrupt Device";
+static const char pci_device_8086_123f[] = "82466GX Integrated Hot-Plug Controller (IHPC)";
+static const char pci_device_8086_1240[] = "752 AGP";
+static const char pci_device_8086_124b[] = "82380FB";
+static const char pci_device_8086_1250[] = "430HX - 82439HX TXC [Triton II]";
+static const char pci_device_8086_1360[] = "82806AA PCI64 Hub PCI Bridge";
+static const char pci_device_8086_1361[] = "82806AA PCI64 Hub Controller (HRes)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1361_8086_1361[] = "82806AA PCI64 Hub Controller (HRes)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1361_8086_8000[] = "82806AA PCI64 Hub Controller (HRes)";
+#endif
+static const char pci_device_8086_1460[] = "82870P2 P64H2 Hub PCI Bridge";
+static const char pci_device_8086_1461[] = "82870P2 P64H2 I/OxAPIC";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1461_15d9_3480[] = "P4DP6";
+#endif
+static const char pci_device_8086_1462[] = "82870P2 P64H2 Hot Plug Controller";
+static const char pci_device_8086_1960[] = "80960RP [i960RP Microprocessor]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_101e_0431[] = "MegaRAID 431 RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_101e_0438[] = "MegaRAID 438 Ultra2 LVD RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_101e_0466[] = "MegaRAID 466 Express Plus RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_101e_0467[] = "MegaRAID 467 Enterprise 1500 RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_101e_0490[] = "MegaRAID 490 Express 300 RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_101e_0762[] = "MegaRAID 762 Express RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_101e_09a0[] = "PowerEdge Expandable RAID Controller 2/SC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_1028_0467[] = "PowerEdge Expandable RAID Controller 2/DC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_1028_1111[] = "PowerEdge Expandable RAID Controller 2/SC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_103c_03a2[] = "MegaRAID";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_103c_10c6[] = "MegaRAID 438, HP NetRAID-3Si";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_103c_10c7[] = "MegaRAID T5, Integrated HP NetRAID";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_103c_10cc[] = "MegaRAID, Integrated HP NetRAID";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_103c_10cd[] = "HP NetRAID-1Si";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_105a_0000[] = "SuperTrak";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_105a_2168[] = "SuperTrak Pro";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_105a_5168[] = "SuperTrak66/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_1111_1111[] = "MegaRAID 466, PowerEdge Expandable RAID Controller 2/SC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_1111_1112[] = "PowerEdge Expandable RAID Controller 2/SC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1960_113c_03a2[] = "MegaRAID";
+#endif
+static const char pci_device_8086_1962[] = "80960RM [i960RM Microprocessor]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_1962_105a_0000[] = "SuperTrak SX6000 I2O CPU";
+#endif
+static const char pci_device_8086_1a21[] = "82840 840 (Carmel) Chipset Host Bridge (Hub A)";
+static const char pci_device_8086_1a23[] = "82840 840 (Carmel) Chipset AGP Bridge";
+static const char pci_device_8086_1a24[] = "82840 840 (Carmel) Chipset PCI Bridge (Hub B)";
+static const char pci_device_8086_1a30[] = "82845 845 (Brookdale) Chipset Host Bridge";
+static const char pci_device_8086_1a31[] = "82845 845 (Brookdale) Chipset AGP Bridge";
+static const char pci_device_8086_2410[] = "82801AA ISA Bridge (LPC)";
+static const char pci_device_8086_2411[] = "82801AA IDE";
+static const char pci_device_8086_2412[] = "82801AA USB";
+static const char pci_device_8086_2413[] = "82801AA SMBus";
+static const char pci_device_8086_2415[] = "82801AA AC'97 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2415_1028_0095[] = "Precision Workstation 220 Integrated Digital Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2415_11d4_0040[] = "SoundMAX Integrated Digital Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2415_11d4_0048[] = "SoundMAX Integrated Digital Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2415_11d4_5340[] = "SoundMAX Integrated Digital Audio";
+#endif
+static const char pci_device_8086_2416[] = "82801AA AC'97 Modem";
+static const char pci_device_8086_2418[] = "82801AA PCI Bridge";
+static const char pci_device_8086_2420[] = "82801AB ISA Bridge (LPC)";
+static const char pci_device_8086_2421[] = "82801AB IDE";
+static const char pci_device_8086_2422[] = "82801AB USB";
+static const char pci_device_8086_2423[] = "82801AB SMBus";
+static const char pci_device_8086_2425[] = "82801AB AC'97 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2425_11d4_0040[] = "SoundMAX Integrated Digital Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2425_11d4_0048[] = "SoundMAX Integrated Digital Audio";
+#endif
+static const char pci_device_8086_2426[] = "82801AB AC'97 Modem";
+static const char pci_device_8086_2428[] = "82801AB PCI Bridge";
+static const char pci_device_8086_2440[] = "82801BA ISA Bridge (LPC)";
+static const char pci_device_8086_2442[] = "82801BA/BAM USB (Hub #1)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2442_1014_01c6[] = "Netvista A40/A40p";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2442_1025_1016[] = "Travelmate 612 TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2442_104d_80df[] = "Vaio PCG-FX403";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2442_147b_0507[] = "TH7II-RAID";
+#endif
+static const char pci_device_8086_2443[] = "82801BA/BAM SMBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2443_1014_01c6[] = "Netvista A40/A40p";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2443_1025_1016[] = "Travelmate 612 TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2443_1043_8027[] = "TUSL2-C Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2443_104d_80df[] = "Vaio PCG-FX403";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2443_147b_0507[] = "TH7II-RAID";
+#endif
+static const char pci_device_8086_2444[] = "82801BA/BAM USB (Hub #2)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2444_1025_1016[] = "Travelmate 612 TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2444_104d_80df[] = "Vaio PCG-FX403";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2444_147b_0507[] = "TH7II-RAID";
+#endif
+static const char pci_device_8086_2445[] = "82801BA/BAM AC'97 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2445_1014_01c6[] = "Netvista A40/A40p";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2445_1025_1016[] = "Travelmate 612 TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2445_104d_80df[] = "Vaio PCG-FX403";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2445_1462_3370[] = "STAC9721 AC";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2445_147b_0507[] = "TH7II-RAID";
+#endif
+static const char pci_device_8086_2446[] = "Intel 537 [82801BA/BAM AC'97 Modem]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2446_1025_1016[] = "Travelmate 612 TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2446_104d_80df[] = "Vaio PCG-FX403";
+#endif
+static const char pci_device_8086_2448[] = "82801BAM/CAM PCI Bridge";
+static const char pci_device_8086_2449[] = "82801BA/BAM/CA/CAM Ethernet Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_0e11_0012[] = "EtherExpress PRO/100 VM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_0e11_0091[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_01ce[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_01dc[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_01eb[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_01ec[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_0202[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_0205[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_0217[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_0234[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_023d[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_0244[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1014_0245[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_109f_315d[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_109f_3181[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_1186_7801[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_144d_2602[] = "HomePNA 1M CNR";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3010[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3011[] = "EtherExpress PRO/100 VM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3012[] = "82562EH based Phoneline";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3013[] = "EtherExpress PRO/100 VE";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3014[] = "EtherExpress PRO/100 VM";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3015[] = "82562EH based Phoneline";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3016[] = "EtherExpress PRO/100 P Mobile Combo";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3017[] = "EtherExpress PRO/100 P Mobile";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2449_8086_3018[] = "EtherExpress PRO/100";
+#endif
+static const char pci_device_8086_244a[] = "82801BAM IDE U100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_244a_1025_1016[] = "Travelmate 612TX";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_244a_104d_80df[] = "Vaio PCG-FX403";
+#endif
+static const char pci_device_8086_244b[] = "82801BA IDE U100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_244b_1014_01c6[] = "Netvista A40/A40p";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_244b_1043_8027[] = "TUSL2-C Mainboard";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_244b_147b_0507[] = "TH7II-RAID";
+#endif
+static const char pci_device_8086_244c[] = "82801BAM ISA Bridge (LPC)";
+static const char pci_device_8086_244e[] = "82801BA/CA/DB PCI Bridge";
+static const char pci_device_8086_2450[] = "82801E ISA Bridge (LPC)";
+static const char pci_device_8086_2452[] = "82801E USB";
+static const char pci_device_8086_2453[] = "82801E SMBus";
+static const char pci_device_8086_2459[] = "82801E Ethernet Controller 0";
+static const char pci_device_8086_245b[] = "82801E IDE U100";
+static const char pci_device_8086_245d[] = "82801E Ethernet Controller 1";
+static const char pci_device_8086_245e[] = "82801E PCI Bridge";
+static const char pci_device_8086_2480[] = "82801CA ISA Bridge (LPC)";
+static const char pci_device_8086_2482[] = "82801CA/CAM USB (Hub #1)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2482_1014_0220[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2482_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2482_15d9_3480[] = "P4DP6";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2482_8086_1958[] = "vpr Matrix 170B4";
+#endif
+static const char pci_device_8086_2483[] = "82801CA/CAM SMBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2483_1014_0220[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2483_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2483_15d9_3480[] = "P4DP6";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2483_8086_1958[] = "vpr Matrix 170B4";
+#endif
+static const char pci_device_8086_2484[] = "82801CA/CAM USB (Hub #2)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2484_1014_0220[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2484_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2484_15d9_3480[] = "P4DP6";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2484_8086_1958[] = "vpr Matrix 170B4";
+#endif
+static const char pci_device_8086_2485[] = "82801CA/CAM AC'97 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2485_1014_0222[] = "ThinkPad T23 (2647-4MG) or A30p (2653-64G)";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2485_1014_0508[] = "ThinkPad T30";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2485_1014_051c[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2485_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2485_144d_c006[] = "vpr Matrix 170B4";
+#endif
+static const char pci_device_8086_2486[] = "82801CA/CAM AC'97 Modem";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2486_1014_0223[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2486_1014_0503[] = "ThinkPad R31 2656BBG";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2486_1014_051a[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2486_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2486_1179_0001[] = "Toshiba Satellite 1110 Z15 internal Modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2486_134d_4c21[] = "Dell Inspiron 2100 internal modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2486_144d_2115[] = "vpr Matrix 170B4 internal modem";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2486_14f1_5421[] = "MD56ORD V.92 MDC Modem";
+#endif
+static const char pci_device_8086_2487[] = "82801CA/CAM USB (Hub #3)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2487_1014_0220[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2487_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2487_15d9_3480[] = "P4DP6";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2487_8086_1958[] = "vpr Matrix 170B4";
+#endif
+static const char pci_device_8086_248a[] = "82801CAM IDE U100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_248a_1014_0220[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_248a_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_248a_8086_1958[] = "vpr Matrix 170B4";
+#endif
+static const char pci_device_8086_248b[] = "82801CA IDE U100";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_248b_15d9_3480[] = "P4DP6";
+#endif
+static const char pci_device_8086_248c[] = "82801CAM ISA Bridge (LPC)";
+static const char pci_device_8086_24c0[] = "82801DB ISA Bridge (LPC)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_24c0_1462_5800[] = "845PE Max (MS-6580)";
+#endif
+static const char pci_device_8086_24c2[] = "82801DB USB (Hub #1)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_24c2_1462_5800[] = "845PE Max (MS-6580)";
+#endif
+static const char pci_device_8086_24c3[] = "82801DB SMBus";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_24c3_1462_5800[] = "845PE Max (MS-6580)";
+#endif
+static const char pci_device_8086_24c4[] = "82801DB USB (Hub #2)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_24c4_1462_5800[] = "845PE Max (MS-6580)";
+#endif
+static const char pci_device_8086_24c5[] = "82801DB AC'97 Audio";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_24c5_1462_5800[] = "845PE Max (MS-6580)";
+#endif
+static const char pci_device_8086_24c6[] = "82801DB AC'97 Modem";
+static const char pci_device_8086_24c7[] = "82801DB USB (Hub #3)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_24c7_1462_5800[] = "845PE Max (MS-6580)";
+#endif
+static const char pci_device_8086_24cb[] = "82801DB ICH4 IDE";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_24cb_1462_5800[] = "845PE Max (MS-6580)";
+#endif
+static const char pci_device_8086_24cd[] = "82801DB USB EHCI Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_24cd_1462_3981[] = "845PE Max (MS-6580) Onboard USB EHCI Controller";
+#endif
+static const char pci_device_8086_2500[] = "82820 820 (Camino) Chipset Host Bridge (MCH)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2500_1028_0095[] = "Precision Workstation 220 Chipset";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2500_1043_801c[] = "P3C-2000 system chipset";
+#endif
+static const char pci_device_8086_2501[] = "82820 820 (Camino) Chipset Host Bridge (MCH)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2501_1043_801c[] = "P3C-2000 system chipset";
+#endif
+static const char pci_device_8086_250b[] = "82820 820 (Camino) Chipset Host Bridge";
+static const char pci_device_8086_250f[] = "82820 820 (Camino) Chipset AGP Bridge";
+static const char pci_device_8086_2520[] = "82805AA MTH Memory Translator Hub";
+static const char pci_device_8086_2521[] = "82804AA MRH-S Memory Repeater Hub for SDRAM";
+static const char pci_device_8086_2530[] = "82850 850 (Tehama) Chipset Host Bridge (MCH)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2530_147b_0507[] = "TH7II-RAID";
+#endif
+static const char pci_device_8086_2531[] = "82860 860 (Wombat) Chipset Host Bridge (MCH)";
+static const char pci_device_8086_2532[] = "82850 850 (Tehama) Chipset AGP Bridge";
+static const char pci_device_8086_2533[] = "82860 860 (Wombat) Chipset AGP Bridge";
+static const char pci_device_8086_2534[] = "82860 860 (Wombat) Chipset PCI Bridge";
+static const char pci_device_8086_2540[] = "e7500 [Plumas] DRAM Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2540_15d9_3480[] = "P4DP6";
+#endif
+static const char pci_device_8086_2541[] = "e7500 [Plumas] DRAM Controller Error Reporting";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2541_15d9_3480[] = "P4DP6";
+#endif
+static const char pci_device_8086_2543[] = "e7500 [Plumas] HI_B Virtual PCI Bridge (F0)";
+static const char pci_device_8086_2544[] = "e7500 [Plumas] HI_B Virtual PCI Bridge (F1)";
+static const char pci_device_8086_2545[] = "e7500 [Plumas] HI_C Virtual PCI Bridge (F0)";
+static const char pci_device_8086_2546[] = "e7500 [Plumas] HI_C Virtual PCI Bridge (F1)";
+static const char pci_device_8086_2547[] = "e7500 [Plumas] HI_D Virtual PCI Bridge (F0)";
+static const char pci_device_8086_2548[] = "e7500 [Plumas] HI_D Virtual PCI Bridge (F1)";
+static const char pci_device_8086_2560[] = "82845G/GL [Brookdale-G] Chipset Host Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_2560_1462_5800[] = "845PE Max (MS-6580)";
+#endif
+static const char pci_device_8086_2561[] = "82845G/GL [Brookdale-G] Chipset AGP Bridge";
+static const char pci_device_8086_2562[] = "82845G/GL [Brookdale-G] Chipset Integrated Graphics Device";
+static const char pci_device_8086_2570[] = "865G Chipset Host-Hub Bridge";
+static const char pci_device_8086_2572[] = "865G Chipset Graphics Controller";
+static const char pci_device_8086_3092[] = "Integrated RAID";
+static const char pci_device_8086_3575[] = "82830 830 Chipset Host Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_3575_1014_021d[] = "ThinkPad A/T/X Series";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_3575_104d_80e7[] = "VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP";
+#endif
+static const char pci_device_8086_3576[] = "82830 830 Chipset AGP Bridge";
+static const char pci_device_8086_3577[] = "82830 CGC [Chipset Graphics Controller]";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_3577_1014_0513[] = "ThinkPad A/T/X Series";
+#endif
+static const char pci_device_8086_3578[] = "82830 830 Chipset Host Bridge";
+static const char pci_device_8086_3580[] = "852GM/852GME/855GM/855GME Chipset Host-Hub Bridge";
+static const char pci_device_8086_3582[] = "852GM/852GME/855GM/855GME Chipset Graphics Controller";
+static const char pci_device_8086_5200[] = "EtherExpress PRO/100 Intelligent Server";
+static const char pci_device_8086_5201[] = "EtherExpress PRO/100 Intelligent Server";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_5201_8086_0001[] = "EtherExpress PRO/100 Server Ethernet Adapter";
+#endif
+static const char pci_device_8086_530d[] = "80310 IOP [IO Processor]";
+static const char pci_device_8086_7000[] = "82371SB PIIX3 ISA [Natoma/Triton II]";
+static const char pci_device_8086_7010[] = "82371SB PIIX3 IDE [Natoma/Triton II]";
+static const char pci_device_8086_7020[] = "82371SB PIIX3 USB [Natoma/Triton II]";
+static const char pci_device_8086_7030[] = "430VX - 82437VX TVX [Triton VX]";
+static const char pci_device_8086_7100[] = "430TX - 82439TX MTXC";
+static const char pci_device_8086_7110[] = "82371AB/EB/MB PIIX4 ISA";
+static const char pci_device_8086_7111[] = "82371AB/EB/MB PIIX4 IDE";
+static const char pci_device_8086_7112[] = "82371AB/EB/MB PIIX4 USB";
+static const char pci_device_8086_7113[] = "82371AB/EB/MB PIIX4 ACPI";
+static const char pci_device_8086_7120[] = "82810 GMCH [Graphics Memory Controller Hub]";
+static const char pci_device_8086_7121[] = "82810 CGC [Chipset Graphics Controller]";
+static const char pci_device_8086_7122[] = "82810 DC-100 GMCH [Graphics Memory Controller Hub]";
+static const char pci_device_8086_7123[] = "82810 DC-100 CGC [Chipset Graphics Controller]";
+static const char pci_device_8086_7124[] = "82810E DC-133 GMCH [Graphics Memory Controller Hub]";
+static const char pci_device_8086_7125[] = "82810E DC-133 CGC [Chipset Graphics Controller]";
+static const char pci_device_8086_7126[] = "82810 DC-133 System and Graphics Controller";
+static const char pci_device_8086_7128[] = "82810-M DC-100 System and Graphics Controller";
+static const char pci_device_8086_712a[] = "82810-M DC-133 System and Graphics Controller";
+static const char pci_device_8086_7180[] = "440LX/EX - 82443LX/EX Host bridge";
+static const char pci_device_8086_7181[] = "440LX/EX - 82443LX/EX AGP bridge";
+static const char pci_device_8086_7190[] = "440BX/ZX/DX - 82443BX/ZX/DX Host bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7190_0e11_0500[] = "Armada 1750 Laptop System Chipset";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7190_0e11_b110[] = "Armada M700";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7190_1179_0001[] = "Toshiba Tecra 8100 Laptop System Chipset";
+#endif
+static const char pci_device_8086_7191[] = "440BX/ZX/DX - 82443BX/ZX/DX AGP bridge";
+static const char pci_device_8086_7192[] = "440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled)";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7192_0e11_0460[] = "Armada 1700 Laptop System Chipset";
+#endif
+static const char pci_device_8086_7194[] = "82440MX Host Bridge";
+static const char pci_device_8086_7195[] = "82440MX AC'97 Audio Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7195_10cf_1099[] = "QSound_SigmaTel Stac97 PCI Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7195_11d4_0040[] = "SoundMAX Integrated Digital Audio";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7195_11d4_0048[] = "SoundMAX Integrated Digital Audio";
+#endif
+static const char pci_device_8086_7196[] = "82440MX AC'97 Modem Controller";
+static const char pci_device_8086_7198[] = "82440MX ISA Bridge";
+static const char pci_device_8086_7199[] = "82440MX EIDE Controller";
+static const char pci_device_8086_719a[] = "82440MX USB Universal Host Controller";
+static const char pci_device_8086_719b[] = "82440MX Power Management Controller";
+static const char pci_device_8086_71a0[] = "440GX - 82443GX Host bridge";
+static const char pci_device_8086_71a1[] = "440GX - 82443GX AGP bridge";
+static const char pci_device_8086_71a2[] = "440GX - 82443GX Host bridge (AGP disabled)";
+static const char pci_device_8086_7600[] = "82372FB PIIX5 ISA";
+static const char pci_device_8086_7601[] = "82372FB PIIX5 IDE";
+static const char pci_device_8086_7602[] = "82372FB PIIX5 USB";
+static const char pci_device_8086_7603[] = "82372FB PIIX5 SMBus";
+static const char pci_device_8086_7800[] = "i740";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7800_003d_0008[] = "Starfighter AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7800_003d_000b[] = "Starfighter AGP";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7800_1092_0100[] = "Stealth II G460";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7800_10b4_201a[] = "Lightspeed 740";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7800_10b4_202f[] = "Lightspeed 740";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7800_8086_0000[] = "Terminator 2x/i";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_7800_8086_0100[] = "Intel740 Graphics Accelerator";
+#endif
+static const char pci_device_8086_84c4[] = "450KX/GX [Orion] - 82454KX/GX PCI bridge";
+static const char pci_device_8086_84c5[] = "450KX/GX [Orion] - 82453KX/GX Memory controller";
+static const char pci_device_8086_84ca[] = "450NX - 82451NX Memory & I/O Controller";
+static const char pci_device_8086_84cb[] = "450NX - 82454NX/84460GX PCI Expander Bridge";
+static const char pci_device_8086_84e0[] = "460GX - 84460GX System Address Controller (SAC)";
+static const char pci_device_8086_84e1[] = "460GX - 84460GX System Data Controller (SDC)";
+static const char pci_device_8086_84e2[] = "460GX - 84460GX AGP Bridge (GXB function 2)";
+static const char pci_device_8086_84e3[] = "460GX - 84460GX Memory Address Controller (MAC)";
+static const char pci_device_8086_84e4[] = "460GX - 84460GX Memory Data Controller (MDC)";
+static const char pci_device_8086_84e6[] = "460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB)";
+static const char pci_device_8086_84ea[] = "460GX - 84460GX AGP Bridge (GXB function 1)";
+static const char pci_device_8086_9621[] = "Integrated RAID";
+static const char pci_device_8086_9622[] = "Integrated RAID";
+static const char pci_device_8086_9641[] = "Integrated RAID";
+static const char pci_device_8086_96a1[] = "Integrated RAID";
+static const char pci_device_8086_b152[] = "21152 PCI-to-PCI Bridge";
+static const char pci_device_8086_b154[] = "21154 PCI-to-PCI Bridge";
+static const char pci_device_8086_b555[] = "21555 Non transparent PCI-to-PCI Bridge";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_8086_b555_e4bf_1000[] = "CC8-1-BLUES";
+#endif
+static const char pci_device_8086_ffff[] = "450NX/GX [Orion] - 82453KX/GX Memory controller [BUG]";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_8800[] = "Trigem Computer Inc.";
+static const char pci_device_8800_2008[] = "Video assistent component";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_8866[] = "T-Square Design Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_8888[] = "Silicon Magic";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_8e0e[] = "Computone Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_8e2e[] = "KTI";
+static const char pci_device_8e2e_3000[] = "ET32P2";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_9004[] = "Adaptec";
+static const char pci_device_9004_1078[] = "AIC-7810";
+static const char pci_device_9004_1160[] = "AIC-1160 [Family Fibre Channel Adapter]";
+static const char pci_device_9004_2178[] = "AIC-7821";
+static const char pci_device_9004_3860[] = "AHA-2930CU";
+static const char pci_device_9004_3b78[] = "AHA-4844W/4844UW";
+static const char pci_device_9004_5075[] = "AIC-755x";
+static const char pci_device_9004_5078[] = "AHA-7850";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_5078_9004_7850[] = "AHA-2904/Integrated AIC-7850";
+#endif
+static const char pci_device_9004_5175[] = "AIC-755x";
+static const char pci_device_9004_5178[] = "AIC-7851";
+static const char pci_device_9004_5275[] = "AIC-755x";
+static const char pci_device_9004_5278[] = "AIC-7852";
+static const char pci_device_9004_5375[] = "AIC-755x";
+static const char pci_device_9004_5378[] = "AIC-7850";
+static const char pci_device_9004_5475[] = "AIC-755x";
+static const char pci_device_9004_5478[] = "AIC-7850";
+static const char pci_device_9004_5575[] = "AVA-2930";
+static const char pci_device_9004_5578[] = "AIC-7855";
+static const char pci_device_9004_5647[] = "ANA-7711 TCP Offload Engine";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_5647_9004_7710[] = "ANA-7711F TCP Offload Engine - Optical";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_5647_9004_7711[] = "ANA-7711LP TCP Offload Engine - Copper";
+#endif
+static const char pci_device_9004_5675[] = "AIC-755x";
+static const char pci_device_9004_5678[] = "AIC-7856";
+static const char pci_device_9004_5775[] = "AIC-755x";
+static const char pci_device_9004_5778[] = "AIC-7850";
+static const char pci_device_9004_5800[] = "AIC-5800";
+static const char pci_device_9004_5900[] = "ANA-5910/5930/5940 ATM155 & 25 LAN Adapter";
+static const char pci_device_9004_5905[] = "ANA-5910A/5930A/5940A ATM Adapter";
+static const char pci_device_9004_6038[] = "AIC-3860";
+static const char pci_device_9004_6075[] = "AIC-1480 / APA-1480";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6075_9004_7560[] = "AIC-1480 / APA-1480 Cardbus";
+#endif
+static const char pci_device_9004_6078[] = "AIC-7860";
+static const char pci_device_9004_6178[] = "AIC-7861";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6178_9004_7861[] = "AHA-2940AU Single";
+#endif
+static const char pci_device_9004_6278[] = "AIC-7860";
+static const char pci_device_9004_6378[] = "AIC-7860";
+static const char pci_device_9004_6478[] = "AIC-786x";
+static const char pci_device_9004_6578[] = "AIC-786x";
+static const char pci_device_9004_6678[] = "AIC-786x";
+static const char pci_device_9004_6778[] = "AIC-786x";
+static const char pci_device_9004_6915[] = "ANA620xx/ANA69011A";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_0008[] = "ANA69011A/TX 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_0009[] = "ANA69011A/TX 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_0010[] = "ANA62022 2-port 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_0018[] = "ANA62044 4-port 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_0019[] = "ANA62044 4-port 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_0020[] = "ANA62022 2-port 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_0028[] = "ANA69011A/TX 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_8008[] = "ANA69011A/TX 64 bit 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_8009[] = "ANA69011A/TX 64 bit 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_8010[] = "ANA62022 2-port 64 bit 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_8018[] = "ANA62044 4-port 64 bit 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_8019[] = "ANA62044 4-port 64 bit 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_8020[] = "ANA62022 2-port 64 bit 10/100";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_6915_9004_8028[] = "ANA69011A/TX 64 bit 10/100";
+#endif
+static const char pci_device_9004_7078[] = "AHA-294x / AIC-7870";
+static const char pci_device_9004_7178[] = "AHA-2940/2940W / AIC-7871";
+static const char pci_device_9004_7278[] = "AHA-3940/3940W / AIC-7872";
+static const char pci_device_9004_7378[] = "AHA-3985 / AIC-7873";
+static const char pci_device_9004_7478[] = "AHA-2944/2944W / AIC-7874";
+static const char pci_device_9004_7578[] = "AHA-3944/3944W / AIC-7875";
+static const char pci_device_9004_7678[] = "AHA-4944W/UW / AIC-7876";
+static const char pci_device_9004_7778[] = "AIC-787x";
+static const char pci_device_9004_7810[] = "AIC-7810";
+static const char pci_device_9004_7815[] = "AIC-7815 RAID+Memory Controller IC";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7815_9004_7815[] = "ARO-1130U2 RAID Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7815_9004_7840[] = "AIC-7815 RAID+Memory Controller IC";
+#endif
+static const char pci_device_9004_7850[] = "AIC-7850";
+static const char pci_device_9004_7855[] = "AHA-2930";
+static const char pci_device_9004_7860[] = "AIC-7860";
+static const char pci_device_9004_7870[] = "AIC-7870";
+static const char pci_device_9004_7871[] = "AHA-2940";
+static const char pci_device_9004_7872[] = "AHA-3940";
+static const char pci_device_9004_7873[] = "AHA-3980";
+static const char pci_device_9004_7874[] = "AHA-2944";
+static const char pci_device_9004_7880[] = "AIC-7880P";
+static const char pci_device_9004_7890[] = "AIC-7890";
+static const char pci_device_9004_7891[] = "AIC-789x";
+static const char pci_device_9004_7892[] = "AIC-789x";
+static const char pci_device_9004_7893[] = "AIC-789x";
+static const char pci_device_9004_7894[] = "AIC-789x";
+static const char pci_device_9004_7895[] = "AHA-2940U/UW / AHA-39xx / AIC-7895";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7895_9004_7890[] = "AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7895_9004_7891[] = "AHA-2940U/2940UW Dual";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7895_9004_7892[] = "AHA-3940AU/AUW/AUWD/UWD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7895_9004_7894[] = "AHA-3944AUWD";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7895_9004_7895[] = "AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7895_9004_7896[] = "AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_7895_9004_7897[] = "AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B";
+#endif
+static const char pci_device_9004_7896[] = "AIC-789x";
+static const char pci_device_9004_7897[] = "AIC-789x";
+static const char pci_device_9004_8078[] = "AIC-7880U";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_8078_9004_7880[] = "AIC-7880P Ultra/Ultra Wide SCSI Chipset";
+#endif
+static const char pci_device_9004_8178[] = "AHA-2940U/UW/D / AIC-7881U";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_8178_9004_7881[] = "AHA-2940UW SCSI Host Adapter";
+#endif
+static const char pci_device_9004_8278[] = "AHA-3940U/UW/UWD / AIC-7882U";
+static const char pci_device_9004_8378[] = "AHA-3940U/UW / AIC-7883U";
+static const char pci_device_9004_8478[] = "AHA-2944UW / AIC-7884U";
+static const char pci_device_9004_8578[] = "AHA-3944U/UWD / AIC-7885";
+static const char pci_device_9004_8678[] = "AHA-4944UW / AIC-7886";
+static const char pci_device_9004_8778[] = "AHA-2940UW Pro / AIC-788x";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_8778_9004_7887[] = "2940UW Pro Ultra-Wide SCSI Controller";
+#endif
+static const char pci_device_9004_8878[] = "AHA-2930UW / AIC-7888";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9004_8878_9004_7888[] = "AHA-2930UW SCSI Controller";
+#endif
+static const char pci_device_9004_8b78[] = "ABA-1030";
+static const char pci_device_9004_ec78[] = "AHA-4944W/UW";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_9005[] = "Adaptec";
+static const char pci_device_9005_0010[] = "AHA-2940U2/U2W";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0010_9005_2180[] = "AHA-2940U2 SCSI Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0010_9005_8100[] = "AHA-2940U2B SCSI Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0010_9005_a180[] = "AHA-2940U2W SCSI Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0010_9005_e100[] = "AHA-2950U2B SCSI Controller";
+#endif
+static const char pci_device_9005_0011[] = "AHA-2930U2";
+static const char pci_device_9005_0013[] = "78902";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0013_9005_0003[] = "AAA-131U2 Array1000 1 Channel RAID Controller";
+#endif
+static const char pci_device_9005_001f[] = "AHA-2940U2/U2W / 7890/7891";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_001f_9005_000f[] = "2940U2W SCSI Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_001f_9005_a180[] = "2940U2W SCSI Controller";
+#endif
+static const char pci_device_9005_0020[] = "AIC-7890";
+static const char pci_device_9005_002f[] = "AIC-7890";
+static const char pci_device_9005_0030[] = "AIC-7890";
+static const char pci_device_9005_003f[] = "AIC-7890";
+static const char pci_device_9005_0050[] = "AHA-3940U2x/395U2x";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0050_9005_f500[] = "AHA-3950U2B";
+#endif
+static const char pci_device_9005_0051[] = "AHA-3950U2D";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0051_9005_b500[] = "AHA-3950U2D";
+#endif
+static const char pci_device_9005_0053[] = "AIC-7896 SCSI Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0053_9005_ffff[] = "AIC-7896 SCSI Controller mainboard implementation";
+#endif
+static const char pci_device_9005_005f[] = "AIC-7896U2/7897U2";
+static const char pci_device_9005_0080[] = "AIC-7892A U160/m";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0080_0e11_e2a0[] = "Compaq 64-Bit/66MHz Wide Ultra3 SCSI Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0080_9005_62a0[] = "29160N Ultra160 SCSI Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0080_9005_e220[] = "29160LP Low Profile Ultra160 SCSI Controller";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0080_9005_e2a0[] = "29160 Ultra160 SCSI Controller";
+#endif
+static const char pci_device_9005_0081[] = "AIC-7892B U160/m";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0081_9005_62a1[] = "19160 Ultra160 SCSI Controller";
+#endif
+static const char pci_device_9005_0083[] = "AIC-7892D U160/m";
+static const char pci_device_9005_008f[] = "AIC-7892P U160/m";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_008f_1179_0001[] = "Magnia Z310";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_008f_15d9_9005[] = "Onboard SCSI Host Adapter";
+#endif
+static const char pci_device_9005_00c0[] = "AHA-3960D / AIC-7899A U160/m";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_00c0_0e11_f620[] = "Compaq 64-Bit/66MHz Dual Channel Wide Ultra3 SCSI Adapter";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_00c0_9005_f620[] = "AHA-3960D U160/m";
+#endif
+static const char pci_device_9005_00c1[] = "AIC-7899B U160/m";
+static const char pci_device_9005_00c3[] = "AIC-7899D U160/m";
+static const char pci_device_9005_00c5[] = "RAID subsystem HBA";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_00c5_1028_00c5[] = "PowerEdge 2550";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_9005_00cf[] = "AIC-7899P U160/m";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_00cf_1028_00d1[] = "PowerEdge 2550";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_00cf_10f1_2462[] = "Thunder K7 S2462";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_00cf_15d9_9005[] = "Onboard SCSI Host Adapter";
+#endif
+static const char pci_device_9005_0250[] = "ServeRAID Controller";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0250_1014_0279[] = "ServeRAID-xx";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0250_1014_028c[] = "ServeRAID-xx";
+#endif
+static const char pci_device_9005_0285[] = "AAC-RAID";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_0285_1028_0287[] = "PowerEdge Expandable RAID Controller 320/DC";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_device_9005_8000[] = "ASC-29320A U320";
+static const char pci_device_9005_800f[] = "AIC-7901 U320";
+static const char pci_device_9005_8010[] = "ASC-39320 U320";
+static const char pci_device_9005_8011[] = "ASC-32320D U320";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_8011_0e11_00ac[] = "U320";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_9005_8011_9005_0041[] = "ASC-39320D U320";
+#endif
+static const char pci_device_9005_8012[] = "ASC-29320 U320";
+static const char pci_device_9005_8013[] = "ASC-29320B U320";
+static const char pci_device_9005_8014[] = "ASC-29320LP U320";
+static const char pci_device_9005_801e[] = "AIC-7901A U320";
+static const char pci_device_9005_801f[] = "AIC-7902 U320";
+static const char pci_device_9005_8090[] = "ASC-39320 U320 w/HostRAID";
+static const char pci_device_9005_8091[] = "ASC-39320D U320 w/HostRAID";
+static const char pci_device_9005_8092[] = "ASC-29320 U320 w/HostRAID";
+static const char pci_device_9005_8093[] = "ASC-29320B U320 w/HostRAID";
+static const char pci_device_9005_8094[] = "ASC-29320LP U320 w/HostRAID";
+static const char pci_device_9005_809e[] = "AIC-7901A U320 w/HostRAID";
+static const char pci_device_9005_809f[] = "AIC-7902 U320 w/HostRAID";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_907f[] = "Atronics";
+static const char pci_device_907f_2015[] = "IDE-2015PL";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_919a[] = "Gigapixel Corp";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_9412[] = "Holtek";
+static const char pci_device_9412_6565[] = "6565";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_9699[] = "Omni Media Technology Inc";
+static const char pci_device_9699_6565[] = "6565";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_9710[] = "NetMos Technology";
+static const char pci_device_9710_9815[] = "VScom 021H-EP2 2 port parallel adaptor";
+static const char pci_device_9710_9835[] = "222N-2 I/O Card (2S+1P)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_a0a0[] = "AOPEN Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_a0f1[] = "UNISYS Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_a200[] = "NEC Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_a259[] = "Hewlett Packard";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_a25b[] = "Hewlett Packard GmbH PL24-MKT";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_a304[] = "Sony";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_a727[] = "3Com Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_aa42[] = "Scitex Digital Video";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_ac1e[] = "Digital Receiver Technology Inc";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_b1b3[] = "Shiva Europe Limited";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_bd11[] = "Pinnacle Systems, Inc. (Wrong ID)";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_c001[] = "TSI Telsys";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_c0a9[] = "Micron/Crucial Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_c0de[] = "Motorola";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_c0fe[] = "Motion Engineering, Inc.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_ca50[] = "Varian Australia Pty Ltd";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_cafe[] = "Chrysalis-ITS";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_cccc[] = "Catapult Communications";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_cddd[] = "Tyzx, Inc.";
+static const char pci_device_cddd_0101[] = "DeepSea 1 High Speed Stereo Vision Frame Grabber";
+static const char pci_device_cddd_0200[] = "DeepSea 2 High Speed Stereo Vision Frame Grabber";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_d4d4[] = "Dy4 Systems Inc";
+static const char pci_device_d4d4_0601[] = "PCI Mezzanine Card";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_d531[] = "I+ME ACTIA GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_d84d[] = "Exsys";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_dead[] = "Indigita Corporation";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_e000[] = "Winbond";
+static const char pci_device_e000_e000[] = "W89C940";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_e159[] = "Tiger Jet Network Inc.";
+static const char pci_device_e159_0001[] = "Intel 537";
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_e159_0001_0059_0001[] = "128k ISDN-S/T Adapter";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const char pci_subsys_e159_0001_0059_0003[] = "128k ISDN-U Adapter";
+#endif
+static const char pci_device_e159_0002[] = "Tiger100APC ISDN chipset";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_e4bf[] = "EKF Elektronik GmbH";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_ea01[] = "Eagle Technology";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_ea60[] = "RME";
+static const char pci_device_ea60_9896[] = "Digi32";
+static const char pci_device_ea60_9897[] = "Digi32 Pro";
+static const char pci_device_ea60_9898[] = "Digi32/8";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_eabb[] = "Aashima Technology B.V.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_eace[] = "Endace Measurement Systems, Ltd";
+static const char pci_device_eace_3100[] = "DAG 3.10 OC-3/OC-12";
+static const char pci_device_eace_3200[] = "DAG 3.2x OC-3/OC-12";
+static const char pci_device_eace_320e[] = "DAG 3.2E Fast Ethernet";
+static const char pci_device_eace_340e[] = "DAG 3.4E Fast Ethernet";
+static const char pci_device_eace_341e[] = "DAG 3.41E Fast Ethernet";
+static const char pci_device_eace_3500[] = "DAG 3.5 OC-3/OC-12";
+static const char pci_device_eace_351c[] = "DAG 3.5ECM Fast Ethernet";
+static const char pci_device_eace_4100[] = "DAG 4.10 OC-48";
+static const char pci_device_eace_4110[] = "DAG 4.11 OC-48";
+static const char pci_device_eace_4220[] = "DAG 4.2 OC-48";
+static const char pci_device_eace_422e[] = "DAG 4.2E Dual Gigabit Ethernet";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_ec80[] = "Belkin Corporation";
+static const char pci_device_ec80_ec00[] = "F5D6000";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_ecc0[] = "Echo Digital Audio Corporation";
+static const char pci_device_ecc0_0050[] = "Gina24_301";
+static const char pci_device_ecc0_0051[] = "Gina24_361";
+static const char pci_device_ecc0_0060[] = "Layla24";
+static const char pci_device_ecc0_0070[] = "Mona_301_80";
+static const char pci_device_ecc0_0071[] = "Mona_301_66";
+static const char pci_device_ecc0_0072[] = "Mona_361";
+static const char pci_device_ecc0_0080[] = "Mia";
+#endif
+static const char pci_vendor_edd8[] = "ARK Logic Inc";
+static const char pci_device_edd8_a091[] = "1000PV [Stingray]";
+static const char pci_device_edd8_a099[] = "2000PV [Stingray]";
+static const char pci_device_edd8_a0a1[] = "2000MT";
+static const char pci_device_edd8_a0a9[] = "2000MI";
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_f1d0[] = "AJA Video";
+static const char pci_device_f1d0_cafe[] = "KONA SD SMPTE 259M I/O";
+static const char pci_device_f1d0_efac[] = "KONA SD SMPTE 259M I/O";
+static const char pci_device_f1d0_facd[] = "KONA HD SMPTE 292M I/O";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_fa57[] = "Fast Search & Transfer ASA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_febd[] = "Ultraview Corp.";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_feda[] = "Broadcom Inc (nee Epigram)";
+static const char pci_device_feda_a0fa[] = "BCM4210 iLine10 HomePNA 2.0";
+static const char pci_device_feda_a10e[] = "BCM4230 iLine10 HomePNA 2.0";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_fffe[] = "VMWare Inc";
+static const char pci_device_fffe_0710[] = "Virtual SVGA";
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const char pci_vendor_ffff[] = "Illegal Vendor ID";
+#endif
+#ifdef INIT_SUBSYS_INFO
+static const pciSubsystemInfo pci_ss_info_0e11_a0f7_8086_002a =
+ {0x8086, 0x002a, pci_subsys_0e11_a0f7_8086_002a, 0};
+#undef pci_ss_info_8086_002a
+#define pci_ss_info_8086_002a pci_ss_info_0e11_a0f7_8086_002a
+static const pciSubsystemInfo pci_ss_info_0e11_a0f7_8086_002b =
+ {0x8086, 0x002b, pci_subsys_0e11_a0f7_8086_002b, 0};
+#undef pci_ss_info_8086_002b
+#define pci_ss_info_8086_002b pci_ss_info_0e11_a0f7_8086_002b
+static const pciSubsystemInfo pci_ss_info_0e11_ae10_0e11_4030 =
+ {0x0e11, 0x4030, pci_subsys_0e11_ae10_0e11_4030, 0};
+#undef pci_ss_info_0e11_4030
+#define pci_ss_info_0e11_4030 pci_ss_info_0e11_ae10_0e11_4030
+static const pciSubsystemInfo pci_ss_info_0e11_ae10_0e11_4031 =
+ {0x0e11, 0x4031, pci_subsys_0e11_ae10_0e11_4031, 0};
+#undef pci_ss_info_0e11_4031
+#define pci_ss_info_0e11_4031 pci_ss_info_0e11_ae10_0e11_4031
+static const pciSubsystemInfo pci_ss_info_0e11_ae10_0e11_4032 =
+ {0x0e11, 0x4032, pci_subsys_0e11_ae10_0e11_4032, 0};
+#undef pci_ss_info_0e11_4032
+#define pci_ss_info_0e11_4032 pci_ss_info_0e11_ae10_0e11_4032
+static const pciSubsystemInfo pci_ss_info_0e11_ae10_0e11_4033 =
+ {0x0e11, 0x4033, pci_subsys_0e11_ae10_0e11_4033, 0};
+#undef pci_ss_info_0e11_4033
+#define pci_ss_info_0e11_4033 pci_ss_info_0e11_ae10_0e11_4033
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1000_0001_1000_1000 =
+ {0x1000, 0x1000, pci_subsys_1000_0001_1000_1000, 0};
+#undef pci_ss_info_1000_1000
+#define pci_ss_info_1000_1000 pci_ss_info_1000_0001_1000_1000
+static const pciSubsystemInfo pci_ss_info_1000_000c_1de1_3907 =
+ {0x1de1, 0x3907, pci_subsys_1000_000c_1de1_3907, 0};
+#undef pci_ss_info_1de1_3907
+#define pci_ss_info_1de1_3907 pci_ss_info_1000_000c_1de1_3907
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_000f_0e11_7004 =
+ {0x0e11, 0x7004, pci_subsys_1000_000f_0e11_7004, 0};
+#undef pci_ss_info_0e11_7004
+#define pci_ss_info_0e11_7004 pci_ss_info_1000_000f_0e11_7004
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_000f_1092_8760 =
+ {0x1092, 0x8760, pci_subsys_1000_000f_1092_8760, 0};
+#undef pci_ss_info_1092_8760
+#define pci_ss_info_1092_8760 pci_ss_info_1000_000f_1092_8760
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1000_000f_1de1_3904 =
+ {0x1de1, 0x3904, pci_subsys_1000_000f_1de1_3904, 0};
+#undef pci_ss_info_1de1_3904
+#define pci_ss_info_1de1_3904 pci_ss_info_1000_000f_1de1_3904
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_0010_0e11_4040 =
+ {0x0e11, 0x4040, pci_subsys_1000_0010_0e11_4040, 0};
+#undef pci_ss_info_0e11_4040
+#define pci_ss_info_0e11_4040 pci_ss_info_1000_0010_0e11_4040
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_0010_0e11_4048 =
+ {0x0e11, 0x4048, pci_subsys_1000_0010_0e11_4048, 0};
+#undef pci_ss_info_0e11_4048
+#define pci_ss_info_0e11_4048 pci_ss_info_1000_0010_0e11_4048
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1000_0020_1de1_1020 =
+ {0x1de1, 0x1020, pci_subsys_1000_0020_1de1_1020, 0};
+#undef pci_ss_info_1de1_1020
+#define pci_ss_info_1de1_1020 pci_ss_info_1000_0020_1de1_1020
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_0030_1028_1010 =
+ {0x1028, 0x1010, pci_subsys_1000_0030_1028_1010, 0};
+#undef pci_ss_info_1028_1010
+#define pci_ss_info_1028_1010 pci_ss_info_1000_0030_1028_1010
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_008f_1092_8000 =
+ {0x1092, 0x8000, pci_subsys_1000_008f_1092_8000, 0};
+#undef pci_ss_info_1092_8000
+#define pci_ss_info_1092_8000 pci_ss_info_1000_008f_1092_8000
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_008f_1092_8760 =
+ {0x1092, 0x8760, pci_subsys_1000_008f_1092_8760, 0};
+#undef pci_ss_info_1092_8760
+#define pci_ss_info_1092_8760 pci_ss_info_1000_008f_1092_8760
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1000_0702_1318_0000 =
+ {0x1318, 0x0000, pci_subsys_1000_0702_1318_0000, 0};
+#undef pci_ss_info_1318_0000
+#define pci_ss_info_1318_0000 pci_ss_info_1000_0702_1318_0000
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_1960_1028_0518 =
+ {0x1028, 0x0518, pci_subsys_1000_1960_1028_0518, 0};
+#undef pci_ss_info_1028_0518
+#define pci_ss_info_1028_0518 pci_ss_info_1000_1960_1028_0518
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_1960_1028_0520 =
+ {0x1028, 0x0520, pci_subsys_1000_1960_1028_0520, 0};
+#undef pci_ss_info_1028_0520
+#define pci_ss_info_1028_0520 pci_ss_info_1000_1960_1028_0520
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1000_1960_1028_0531 =
+ {0x1028, 0x0531, pci_subsys_1000_1960_1028_0531, 0};
+#undef pci_ss_info_1028_0531
+#define pci_ss_info_1028_0531 pci_ss_info_1000_1960_1028_0531
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1002_4242_1002_02aa =
+ {0x1002, 0x02aa, pci_subsys_1002_4242_1002_02aa, 0};
+#undef pci_ss_info_1002_02aa
+#define pci_ss_info_1002_02aa pci_ss_info_1002_4242_1002_02aa
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0040 =
+ {0x1002, 0x0040, pci_subsys_1002_4742_1002_0040, 0};
+#undef pci_ss_info_1002_0040
+#define pci_ss_info_1002_0040 pci_ss_info_1002_4742_1002_0040
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0044 =
+ {0x1002, 0x0044, pci_subsys_1002_4742_1002_0044, 0};
+#undef pci_ss_info_1002_0044
+#define pci_ss_info_1002_0044 pci_ss_info_1002_4742_1002_0044
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0061 =
+ {0x1002, 0x0061, pci_subsys_1002_4742_1002_0061, 0};
+#undef pci_ss_info_1002_0061
+#define pci_ss_info_1002_0061 pci_ss_info_1002_4742_1002_0061
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0062 =
+ {0x1002, 0x0062, pci_subsys_1002_4742_1002_0062, 0};
+#undef pci_ss_info_1002_0062
+#define pci_ss_info_1002_0062 pci_ss_info_1002_4742_1002_0062
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0063 =
+ {0x1002, 0x0063, pci_subsys_1002_4742_1002_0063, 0};
+#undef pci_ss_info_1002_0063
+#define pci_ss_info_1002_0063 pci_ss_info_1002_4742_1002_0063
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0080 =
+ {0x1002, 0x0080, pci_subsys_1002_4742_1002_0080, 0};
+#undef pci_ss_info_1002_0080
+#define pci_ss_info_1002_0080 pci_ss_info_1002_4742_1002_0080
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_0084 =
+ {0x1002, 0x0084, pci_subsys_1002_4742_1002_0084, 0};
+#undef pci_ss_info_1002_0084
+#define pci_ss_info_1002_0084 pci_ss_info_1002_4742_1002_0084
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_4742 =
+ {0x1002, 0x4742, pci_subsys_1002_4742_1002_4742, 0};
+#undef pci_ss_info_1002_4742
+#define pci_ss_info_1002_4742 pci_ss_info_1002_4742_1002_4742
+static const pciSubsystemInfo pci_ss_info_1002_4742_1002_8001 =
+ {0x1002, 0x8001, pci_subsys_1002_4742_1002_8001, 0};
+#undef pci_ss_info_1002_8001
+#define pci_ss_info_1002_8001 pci_ss_info_1002_4742_1002_8001
+static const pciSubsystemInfo pci_ss_info_1002_4742_1028_0082 =
+ {0x1028, 0x0082, pci_subsys_1002_4742_1028_0082, 0};
+#undef pci_ss_info_1028_0082
+#define pci_ss_info_1028_0082 pci_ss_info_1002_4742_1028_0082
+static const pciSubsystemInfo pci_ss_info_1002_4742_1028_4082 =
+ {0x1028, 0x4082, pci_subsys_1002_4742_1028_4082, 0};
+#undef pci_ss_info_1028_4082
+#define pci_ss_info_1028_4082 pci_ss_info_1002_4742_1028_4082
+static const pciSubsystemInfo pci_ss_info_1002_4742_1028_8082 =
+ {0x1028, 0x8082, pci_subsys_1002_4742_1028_8082, 0};
+#undef pci_ss_info_1028_8082
+#define pci_ss_info_1028_8082 pci_ss_info_1002_4742_1028_8082
+static const pciSubsystemInfo pci_ss_info_1002_4742_1028_c082 =
+ {0x1028, 0xc082, pci_subsys_1002_4742_1028_c082, 0};
+#undef pci_ss_info_1028_c082
+#define pci_ss_info_1028_c082 pci_ss_info_1002_4742_1028_c082
+static const pciSubsystemInfo pci_ss_info_1002_4742_8086_4152 =
+ {0x8086, 0x4152, pci_subsys_1002_4742_8086_4152, 0};
+#undef pci_ss_info_8086_4152
+#define pci_ss_info_8086_4152 pci_ss_info_1002_4742_8086_4152
+static const pciSubsystemInfo pci_ss_info_1002_4742_8086_464a =
+ {0x8086, 0x464a, pci_subsys_1002_4742_8086_464a, 0};
+#undef pci_ss_info_8086_464a
+#define pci_ss_info_8086_464a pci_ss_info_1002_4742_8086_464a
+static const pciSubsystemInfo pci_ss_info_1002_4744_1002_4744 =
+ {0x1002, 0x4744, pci_subsys_1002_4744_1002_4744, 0};
+#undef pci_ss_info_1002_4744
+#define pci_ss_info_1002_4744 pci_ss_info_1002_4744_1002_4744
+static const pciSubsystemInfo pci_ss_info_1002_4749_1002_0061 =
+ {0x1002, 0x0061, pci_subsys_1002_4749_1002_0061, 0};
+#undef pci_ss_info_1002_0061
+#define pci_ss_info_1002_0061 pci_ss_info_1002_4749_1002_0061
+static const pciSubsystemInfo pci_ss_info_1002_4749_1002_0062 =
+ {0x1002, 0x0062, pci_subsys_1002_4749_1002_0062, 0};
+#undef pci_ss_info_1002_0062
+#define pci_ss_info_1002_0062 pci_ss_info_1002_4749_1002_0062
+static const pciSubsystemInfo pci_ss_info_1002_474d_1002_0004 =
+ {0x1002, 0x0004, pci_subsys_1002_474d_1002_0004, 0};
+#undef pci_ss_info_1002_0004
+#define pci_ss_info_1002_0004 pci_ss_info_1002_474d_1002_0004
+static const pciSubsystemInfo pci_ss_info_1002_474d_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_474d_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_474d_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_474d_1002_0080 =
+ {0x1002, 0x0080, pci_subsys_1002_474d_1002_0080, 0};
+#undef pci_ss_info_1002_0080
+#define pci_ss_info_1002_0080 pci_ss_info_1002_474d_1002_0080
+static const pciSubsystemInfo pci_ss_info_1002_474d_1002_0084 =
+ {0x1002, 0x0084, pci_subsys_1002_474d_1002_0084, 0};
+#undef pci_ss_info_1002_0084
+#define pci_ss_info_1002_0084 pci_ss_info_1002_474d_1002_0084
+static const pciSubsystemInfo pci_ss_info_1002_474d_1002_474d =
+ {0x1002, 0x474d, pci_subsys_1002_474d_1002_474d, 0};
+#undef pci_ss_info_1002_474d
+#define pci_ss_info_1002_474d pci_ss_info_1002_474d_1002_474d
+static const pciSubsystemInfo pci_ss_info_1002_474d_1033_806a =
+ {0x1033, 0x806a, pci_subsys_1002_474d_1033_806a, 0};
+#undef pci_ss_info_1033_806a
+#define pci_ss_info_1033_806a pci_ss_info_1002_474d_1033_806a
+static const pciSubsystemInfo pci_ss_info_1002_474e_1002_474e =
+ {0x1002, 0x474e, pci_subsys_1002_474e_1002_474e, 0};
+#undef pci_ss_info_1002_474e
+#define pci_ss_info_1002_474e pci_ss_info_1002_474e_1002_474e
+static const pciSubsystemInfo pci_ss_info_1002_474f_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_474f_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_474f_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_474f_1002_474f =
+ {0x1002, 0x474f, pci_subsys_1002_474f_1002_474f, 0};
+#undef pci_ss_info_1002_474f
+#define pci_ss_info_1002_474f pci_ss_info_1002_474f_1002_474f
+static const pciSubsystemInfo pci_ss_info_1002_4750_1002_0040 =
+ {0x1002, 0x0040, pci_subsys_1002_4750_1002_0040, 0};
+#undef pci_ss_info_1002_0040
+#define pci_ss_info_1002_0040 pci_ss_info_1002_4750_1002_0040
+static const pciSubsystemInfo pci_ss_info_1002_4750_1002_0044 =
+ {0x1002, 0x0044, pci_subsys_1002_4750_1002_0044, 0};
+#undef pci_ss_info_1002_0044
+#define pci_ss_info_1002_0044 pci_ss_info_1002_4750_1002_0044
+static const pciSubsystemInfo pci_ss_info_1002_4750_1002_0080 =
+ {0x1002, 0x0080, pci_subsys_1002_4750_1002_0080, 0};
+#undef pci_ss_info_1002_0080
+#define pci_ss_info_1002_0080 pci_ss_info_1002_4750_1002_0080
+static const pciSubsystemInfo pci_ss_info_1002_4750_1002_0084 =
+ {0x1002, 0x0084, pci_subsys_1002_4750_1002_0084, 0};
+#undef pci_ss_info_1002_0084
+#define pci_ss_info_1002_0084 pci_ss_info_1002_4750_1002_0084
+static const pciSubsystemInfo pci_ss_info_1002_4750_1002_4750 =
+ {0x1002, 0x4750, pci_subsys_1002_4750_1002_4750, 0};
+#undef pci_ss_info_1002_4750
+#define pci_ss_info_1002_4750 pci_ss_info_1002_4750_1002_4750
+static const pciSubsystemInfo pci_ss_info_1002_4752_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_4752_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_4752_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_4752_1002_4752 =
+ {0x1002, 0x4752, pci_subsys_1002_4752_1002_4752, 0};
+#undef pci_ss_info_1002_4752
+#define pci_ss_info_1002_4752 pci_ss_info_1002_4752_1002_4752
+static const pciSubsystemInfo pci_ss_info_1002_4752_1002_8008 =
+ {0x1002, 0x8008, pci_subsys_1002_4752_1002_8008, 0};
+#undef pci_ss_info_1002_8008
+#define pci_ss_info_1002_8008 pci_ss_info_1002_4752_1002_8008
+static const pciSubsystemInfo pci_ss_info_1002_4752_1028_00d1 =
+ {0x1028, 0x00d1, pci_subsys_1002_4752_1028_00d1, 0};
+#undef pci_ss_info_1028_00d1
+#define pci_ss_info_1028_00d1 pci_ss_info_1002_4752_1028_00d1
+static const pciSubsystemInfo pci_ss_info_1002_4753_1002_4753 =
+ {0x1002, 0x4753, pci_subsys_1002_4753_1002_4753, 0};
+#undef pci_ss_info_1002_4753
+#define pci_ss_info_1002_4753 pci_ss_info_1002_4753_1002_4753
+static const pciSubsystemInfo pci_ss_info_1002_4756_1002_4756 =
+ {0x1002, 0x4756, pci_subsys_1002_4756_1002_4756, 0};
+#undef pci_ss_info_1002_4756
+#define pci_ss_info_1002_4756 pci_ss_info_1002_4756_1002_4756
+static const pciSubsystemInfo pci_ss_info_1002_4757_1002_4757 =
+ {0x1002, 0x4757, pci_subsys_1002_4757_1002_4757, 0};
+#undef pci_ss_info_1002_4757
+#define pci_ss_info_1002_4757 pci_ss_info_1002_4757_1002_4757
+static const pciSubsystemInfo pci_ss_info_1002_4757_1028_0089 =
+ {0x1028, 0x0089, pci_subsys_1002_4757_1028_0089, 0};
+#undef pci_ss_info_1028_0089
+#define pci_ss_info_1028_0089 pci_ss_info_1002_4757_1028_0089
+static const pciSubsystemInfo pci_ss_info_1002_4757_1028_4082 =
+ {0x1028, 0x4082, pci_subsys_1002_4757_1028_4082, 0};
+#undef pci_ss_info_1028_4082
+#define pci_ss_info_1028_4082 pci_ss_info_1002_4757_1028_4082
+static const pciSubsystemInfo pci_ss_info_1002_4757_1028_8082 =
+ {0x1028, 0x8082, pci_subsys_1002_4757_1028_8082, 0};
+#undef pci_ss_info_1028_8082
+#define pci_ss_info_1028_8082 pci_ss_info_1002_4757_1028_8082
+static const pciSubsystemInfo pci_ss_info_1002_4757_1028_c082 =
+ {0x1028, 0xc082, pci_subsys_1002_4757_1028_c082, 0};
+#undef pci_ss_info_1028_c082
+#define pci_ss_info_1028_c082 pci_ss_info_1002_4757_1028_c082
+static const pciSubsystemInfo pci_ss_info_1002_475a_1002_0087 =
+ {0x1002, 0x0087, pci_subsys_1002_475a_1002_0087, 0};
+#undef pci_ss_info_1002_0087
+#define pci_ss_info_1002_0087 pci_ss_info_1002_475a_1002_0087
+static const pciSubsystemInfo pci_ss_info_1002_475a_1002_475a =
+ {0x1002, 0x475a, pci_subsys_1002_475a_1002_475a, 0};
+#undef pci_ss_info_1002_475a
+#define pci_ss_info_1002_475a pci_ss_info_1002_475a_1002_475a
+static const pciSubsystemInfo pci_ss_info_1002_4966_10f1_0002 =
+ {0x10f1, 0x0002, pci_subsys_1002_4966_10f1_0002, 0};
+#undef pci_ss_info_10f1_0002
+#define pci_ss_info_10f1_0002 pci_ss_info_1002_4966_10f1_0002
+static const pciSubsystemInfo pci_ss_info_1002_4966_148c_2039 =
+ {0x148c, 0x2039, pci_subsys_1002_4966_148c_2039, 0};
+#undef pci_ss_info_148c_2039
+#define pci_ss_info_148c_2039 pci_ss_info_1002_4966_148c_2039
+static const pciSubsystemInfo pci_ss_info_1002_4966_1509_9a00 =
+ {0x1509, 0x9a00, pci_subsys_1002_4966_1509_9a00, 0};
+#undef pci_ss_info_1509_9a00
+#define pci_ss_info_1509_9a00 pci_ss_info_1002_4966_1509_9a00
+static const pciSubsystemInfo pci_ss_info_1002_4966_1681_0040 =
+ {0x1681, 0x0040, pci_subsys_1002_4966_1681_0040, 0};
+#undef pci_ss_info_1681_0040
+#define pci_ss_info_1681_0040 pci_ss_info_1002_4966_1681_0040
+static const pciSubsystemInfo pci_ss_info_1002_4966_174b_7176 =
+ {0x174b, 0x7176, pci_subsys_1002_4966_174b_7176, 0};
+#undef pci_ss_info_174b_7176
+#define pci_ss_info_174b_7176 pci_ss_info_1002_4966_174b_7176
+static const pciSubsystemInfo pci_ss_info_1002_4966_174b_7192 =
+ {0x174b, 0x7192, pci_subsys_1002_4966_174b_7192, 0};
+#undef pci_ss_info_174b_7192
+#define pci_ss_info_174b_7192 pci_ss_info_1002_4966_174b_7192
+static const pciSubsystemInfo pci_ss_info_1002_4966_17af_2005 =
+ {0x17af, 0x2005, pci_subsys_1002_4966_17af_2005, 0};
+#undef pci_ss_info_17af_2005
+#define pci_ss_info_17af_2005 pci_ss_info_1002_4966_17af_2005
+static const pciSubsystemInfo pci_ss_info_1002_4966_17af_2006 =
+ {0x17af, 0x2006, pci_subsys_1002_4966_17af_2006, 0};
+#undef pci_ss_info_17af_2006
+#define pci_ss_info_17af_2006 pci_ss_info_1002_4966_17af_2006
+static const pciSubsystemInfo pci_ss_info_1002_4c42_0e11_b0e8 =
+ {0x0e11, 0xb0e8, pci_subsys_1002_4c42_0e11_b0e8, 0};
+#undef pci_ss_info_0e11_b0e8
+#define pci_ss_info_0e11_b0e8 pci_ss_info_1002_4c42_0e11_b0e8
+static const pciSubsystemInfo pci_ss_info_1002_4c42_0e11_b10e =
+ {0x0e11, 0xb10e, pci_subsys_1002_4c42_0e11_b10e, 0};
+#undef pci_ss_info_0e11_b10e
+#define pci_ss_info_0e11_b10e pci_ss_info_1002_4c42_0e11_b10e
+static const pciSubsystemInfo pci_ss_info_1002_4c42_1002_0040 =
+ {0x1002, 0x0040, pci_subsys_1002_4c42_1002_0040, 0};
+#undef pci_ss_info_1002_0040
+#define pci_ss_info_1002_0040 pci_ss_info_1002_4c42_1002_0040
+static const pciSubsystemInfo pci_ss_info_1002_4c42_1002_0044 =
+ {0x1002, 0x0044, pci_subsys_1002_4c42_1002_0044, 0};
+#undef pci_ss_info_1002_0044
+#define pci_ss_info_1002_0044 pci_ss_info_1002_4c42_1002_0044
+static const pciSubsystemInfo pci_ss_info_1002_4c42_1002_4c42 =
+ {0x1002, 0x4c42, pci_subsys_1002_4c42_1002_4c42, 0};
+#undef pci_ss_info_1002_4c42
+#define pci_ss_info_1002_4c42 pci_ss_info_1002_4c42_1002_4c42
+static const pciSubsystemInfo pci_ss_info_1002_4c42_1002_8001 =
+ {0x1002, 0x8001, pci_subsys_1002_4c42_1002_8001, 0};
+#undef pci_ss_info_1002_8001
+#define pci_ss_info_1002_8001 pci_ss_info_1002_4c42_1002_8001
+static const pciSubsystemInfo pci_ss_info_1002_4c42_1028_0085 =
+ {0x1028, 0x0085, pci_subsys_1002_4c42_1028_0085, 0};
+#undef pci_ss_info_1028_0085
+#define pci_ss_info_1028_0085 pci_ss_info_1002_4c42_1028_0085
+static const pciSubsystemInfo pci_ss_info_1002_4c49_1002_0004 =
+ {0x1002, 0x0004, pci_subsys_1002_4c49_1002_0004, 0};
+#undef pci_ss_info_1002_0004
+#define pci_ss_info_1002_0004 pci_ss_info_1002_4c49_1002_0004
+static const pciSubsystemInfo pci_ss_info_1002_4c49_1002_0040 =
+ {0x1002, 0x0040, pci_subsys_1002_4c49_1002_0040, 0};
+#undef pci_ss_info_1002_0040
+#define pci_ss_info_1002_0040 pci_ss_info_1002_4c49_1002_0040
+static const pciSubsystemInfo pci_ss_info_1002_4c49_1002_0044 =
+ {0x1002, 0x0044, pci_subsys_1002_4c49_1002_0044, 0};
+#undef pci_ss_info_1002_0044
+#define pci_ss_info_1002_0044 pci_ss_info_1002_4c49_1002_0044
+static const pciSubsystemInfo pci_ss_info_1002_4c49_1002_4c49 =
+ {0x1002, 0x4c49, pci_subsys_1002_4c49_1002_4c49, 0};
+#undef pci_ss_info_1002_4c49
+#define pci_ss_info_1002_4c49 pci_ss_info_1002_4c49_1002_4c49
+static const pciSubsystemInfo pci_ss_info_1002_4c4d_0e11_b111 =
+ {0x0e11, 0xb111, pci_subsys_1002_4c4d_0e11_b111, 0};
+#undef pci_ss_info_0e11_b111
+#define pci_ss_info_0e11_b111 pci_ss_info_1002_4c4d_0e11_b111
+static const pciSubsystemInfo pci_ss_info_1002_4c4d_1002_0084 =
+ {0x1002, 0x0084, pci_subsys_1002_4c4d_1002_0084, 0};
+#undef pci_ss_info_1002_0084
+#define pci_ss_info_1002_0084 pci_ss_info_1002_4c4d_1002_0084
+static const pciSubsystemInfo pci_ss_info_1002_4c4d_1014_0154 =
+ {0x1014, 0x0154, pci_subsys_1002_4c4d_1014_0154, 0};
+#undef pci_ss_info_1014_0154
+#define pci_ss_info_1014_0154 pci_ss_info_1002_4c4d_1014_0154
+static const pciSubsystemInfo pci_ss_info_1002_4c50_1002_4c50 =
+ {0x1002, 0x4c50, pci_subsys_1002_4c50_1002_4c50, 0};
+#undef pci_ss_info_1002_4c50
+#define pci_ss_info_1002_4c50 pci_ss_info_1002_4c50_1002_4c50
+static const pciSubsystemInfo pci_ss_info_1002_4c57_1014_0517 =
+ {0x1014, 0x0517, pci_subsys_1002_4c57_1014_0517, 0};
+#undef pci_ss_info_1014_0517
+#define pci_ss_info_1014_0517 pci_ss_info_1002_4c57_1014_0517
+static const pciSubsystemInfo pci_ss_info_1002_4c57_1028_00e6 =
+ {0x1028, 0x00e6, pci_subsys_1002_4c57_1028_00e6, 0};
+#undef pci_ss_info_1028_00e6
+#define pci_ss_info_1028_00e6 pci_ss_info_1002_4c57_1028_00e6
+static const pciSubsystemInfo pci_ss_info_1002_4c57_144d_c006 =
+ {0x144d, 0xc006, pci_subsys_1002_4c57_144d_c006, 0};
+#undef pci_ss_info_144d_c006
+#define pci_ss_info_144d_c006 pci_ss_info_1002_4c57_144d_c006
+static const pciSubsystemInfo pci_ss_info_1002_4c59_1014_0235 =
+ {0x1014, 0x0235, pci_subsys_1002_4c59_1014_0235, 0};
+#undef pci_ss_info_1014_0235
+#define pci_ss_info_1014_0235 pci_ss_info_1002_4c59_1014_0235
+static const pciSubsystemInfo pci_ss_info_1002_4c59_1014_0239 =
+ {0x1014, 0x0239, pci_subsys_1002_4c59_1014_0239, 0};
+#undef pci_ss_info_1014_0239
+#define pci_ss_info_1014_0239 pci_ss_info_1002_4c59_1014_0239
+static const pciSubsystemInfo pci_ss_info_1002_4c59_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_1002_4c59_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_1002_4c59_104d_80e7
+static const pciSubsystemInfo pci_ss_info_1002_5044_1002_0028 =
+ {0x1002, 0x0028, pci_subsys_1002_5044_1002_0028, 0};
+#undef pci_ss_info_1002_0028
+#define pci_ss_info_1002_0028 pci_ss_info_1002_5044_1002_0028
+static const pciSubsystemInfo pci_ss_info_1002_5044_1002_0029 =
+ {0x1002, 0x0029, pci_subsys_1002_5044_1002_0029, 0};
+#undef pci_ss_info_1002_0029
+#define pci_ss_info_1002_0029 pci_ss_info_1002_5044_1002_0029
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0004 =
+ {0x1002, 0x0004, pci_subsys_1002_5046_1002_0004, 0};
+#undef pci_ss_info_1002_0004
+#define pci_ss_info_1002_0004 pci_ss_info_1002_5046_1002_0004
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_5046_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_5046_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0014 =
+ {0x1002, 0x0014, pci_subsys_1002_5046_1002_0014, 0};
+#undef pci_ss_info_1002_0014
+#define pci_ss_info_1002_0014 pci_ss_info_1002_5046_1002_0014
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0018 =
+ {0x1002, 0x0018, pci_subsys_1002_5046_1002_0018, 0};
+#undef pci_ss_info_1002_0018
+#define pci_ss_info_1002_0018 pci_ss_info_1002_5046_1002_0018
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0028 =
+ {0x1002, 0x0028, pci_subsys_1002_5046_1002_0028, 0};
+#undef pci_ss_info_1002_0028
+#define pci_ss_info_1002_0028 pci_ss_info_1002_5046_1002_0028
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_002a =
+ {0x1002, 0x002a, pci_subsys_1002_5046_1002_002a, 0};
+#undef pci_ss_info_1002_002a
+#define pci_ss_info_1002_002a pci_ss_info_1002_5046_1002_002a
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_0048 =
+ {0x1002, 0x0048, pci_subsys_1002_5046_1002_0048, 0};
+#undef pci_ss_info_1002_0048
+#define pci_ss_info_1002_0048 pci_ss_info_1002_5046_1002_0048
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_2000 =
+ {0x1002, 0x2000, pci_subsys_1002_5046_1002_2000, 0};
+#undef pci_ss_info_1002_2000
+#define pci_ss_info_1002_2000 pci_ss_info_1002_5046_1002_2000
+static const pciSubsystemInfo pci_ss_info_1002_5046_1002_2001 =
+ {0x1002, 0x2001, pci_subsys_1002_5046_1002_2001, 0};
+#undef pci_ss_info_1002_2001
+#define pci_ss_info_1002_2001 pci_ss_info_1002_5046_1002_2001
+static const pciSubsystemInfo pci_ss_info_1002_5050_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_5050_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_5050_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_5144_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_5144_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0009 =
+ {0x1002, 0x0009, pci_subsys_1002_5144_1002_0009, 0};
+#undef pci_ss_info_1002_0009
+#define pci_ss_info_1002_0009 pci_ss_info_1002_5144_1002_0009
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_000a =
+ {0x1002, 0x000a, pci_subsys_1002_5144_1002_000a, 0};
+#undef pci_ss_info_1002_000a
+#define pci_ss_info_1002_000a pci_ss_info_1002_5144_1002_000a
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_001a =
+ {0x1002, 0x001a, pci_subsys_1002_5144_1002_001a, 0};
+#undef pci_ss_info_1002_001a
+#define pci_ss_info_1002_001a pci_ss_info_1002_5144_1002_001a
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0029 =
+ {0x1002, 0x0029, pci_subsys_1002_5144_1002_0029, 0};
+#undef pci_ss_info_1002_0029
+#define pci_ss_info_1002_0029 pci_ss_info_1002_5144_1002_0029
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0038 =
+ {0x1002, 0x0038, pci_subsys_1002_5144_1002_0038, 0};
+#undef pci_ss_info_1002_0038
+#define pci_ss_info_1002_0038 pci_ss_info_1002_5144_1002_0038
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0039 =
+ {0x1002, 0x0039, pci_subsys_1002_5144_1002_0039, 0};
+#undef pci_ss_info_1002_0039
+#define pci_ss_info_1002_0039 pci_ss_info_1002_5144_1002_0039
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_008a =
+ {0x1002, 0x008a, pci_subsys_1002_5144_1002_008a, 0};
+#undef pci_ss_info_1002_008a
+#define pci_ss_info_1002_008a pci_ss_info_1002_5144_1002_008a
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_00ba =
+ {0x1002, 0x00ba, pci_subsys_1002_5144_1002_00ba, 0};
+#undef pci_ss_info_1002_00ba
+#define pci_ss_info_1002_00ba pci_ss_info_1002_5144_1002_00ba
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_0139 =
+ {0x1002, 0x0139, pci_subsys_1002_5144_1002_0139, 0};
+#undef pci_ss_info_1002_0139
+#define pci_ss_info_1002_0139 pci_ss_info_1002_5144_1002_0139
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_028a =
+ {0x1002, 0x028a, pci_subsys_1002_5144_1002_028a, 0};
+#undef pci_ss_info_1002_028a
+#define pci_ss_info_1002_028a pci_ss_info_1002_5144_1002_028a
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_02aa =
+ {0x1002, 0x02aa, pci_subsys_1002_5144_1002_02aa, 0};
+#undef pci_ss_info_1002_02aa
+#define pci_ss_info_1002_02aa pci_ss_info_1002_5144_1002_02aa
+static const pciSubsystemInfo pci_ss_info_1002_5144_1002_053a =
+ {0x1002, 0x053a, pci_subsys_1002_5144_1002_053a, 0};
+#undef pci_ss_info_1002_053a
+#define pci_ss_info_1002_053a pci_ss_info_1002_5144_1002_053a
+static const pciSubsystemInfo pci_ss_info_1002_5148_1002_010a =
+ {0x1002, 0x010a, pci_subsys_1002_5148_1002_010a, 0};
+#undef pci_ss_info_1002_010a
+#define pci_ss_info_1002_010a pci_ss_info_1002_5148_1002_010a
+static const pciSubsystemInfo pci_ss_info_1002_5148_1002_0152 =
+ {0x1002, 0x0152, pci_subsys_1002_5148_1002_0152, 0};
+#undef pci_ss_info_1002_0152
+#define pci_ss_info_1002_0152 pci_ss_info_1002_5148_1002_0152
+static const pciSubsystemInfo pci_ss_info_1002_5148_1002_0162 =
+ {0x1002, 0x0162, pci_subsys_1002_5148_1002_0162, 0};
+#undef pci_ss_info_1002_0162
+#define pci_ss_info_1002_0162 pci_ss_info_1002_5148_1002_0162
+static const pciSubsystemInfo pci_ss_info_1002_5148_1002_0172 =
+ {0x1002, 0x0172, pci_subsys_1002_5148_1002_0172, 0};
+#undef pci_ss_info_1002_0172
+#define pci_ss_info_1002_0172 pci_ss_info_1002_5148_1002_0172
+static const pciSubsystemInfo pci_ss_info_1002_514c_1002_003a =
+ {0x1002, 0x003a, pci_subsys_1002_514c_1002_003a, 0};
+#undef pci_ss_info_1002_003a
+#define pci_ss_info_1002_003a pci_ss_info_1002_514c_1002_003a
+static const pciSubsystemInfo pci_ss_info_1002_514c_1002_013a =
+ {0x1002, 0x013a, pci_subsys_1002_514c_1002_013a, 0};
+#undef pci_ss_info_1002_013a
+#define pci_ss_info_1002_013a pci_ss_info_1002_514c_1002_013a
+static const pciSubsystemInfo pci_ss_info_1002_514c_148c_2026 =
+ {0x148c, 0x2026, pci_subsys_1002_514c_148c_2026, 0};
+#undef pci_ss_info_148c_2026
+#define pci_ss_info_148c_2026 pci_ss_info_1002_514c_148c_2026
+static const pciSubsystemInfo pci_ss_info_1002_514c_174b_7149 =
+ {0x174b, 0x7149, pci_subsys_1002_514c_174b_7149, 0};
+#undef pci_ss_info_174b_7149
+#define pci_ss_info_174b_7149 pci_ss_info_1002_514c_174b_7149
+static const pciSubsystemInfo pci_ss_info_1002_5157_1002_013a =
+ {0x1002, 0x013a, pci_subsys_1002_5157_1002_013a, 0};
+#undef pci_ss_info_1002_013a
+#define pci_ss_info_1002_013a pci_ss_info_1002_5157_1002_013a
+static const pciSubsystemInfo pci_ss_info_1002_5157_1458_4000 =
+ {0x1458, 0x4000, pci_subsys_1002_5157_1458_4000, 0};
+#undef pci_ss_info_1458_4000
+#define pci_ss_info_1458_4000 pci_ss_info_1002_5157_1458_4000
+static const pciSubsystemInfo pci_ss_info_1002_5157_148c_2024 =
+ {0x148c, 0x2024, pci_subsys_1002_5157_148c_2024, 0};
+#undef pci_ss_info_148c_2024
+#define pci_ss_info_148c_2024 pci_ss_info_1002_5157_148c_2024
+static const pciSubsystemInfo pci_ss_info_1002_5157_148c_2025 =
+ {0x148c, 0x2025, pci_subsys_1002_5157_148c_2025, 0};
+#undef pci_ss_info_148c_2025
+#define pci_ss_info_148c_2025 pci_ss_info_1002_5157_148c_2025
+static const pciSubsystemInfo pci_ss_info_1002_5157_148c_2036 =
+ {0x148c, 0x2036, pci_subsys_1002_5157_148c_2036, 0};
+#undef pci_ss_info_148c_2036
+#define pci_ss_info_148c_2036 pci_ss_info_1002_5157_148c_2036
+static const pciSubsystemInfo pci_ss_info_1002_5157_174b_7147 =
+ {0x174b, 0x7147, pci_subsys_1002_5157_174b_7147, 0};
+#undef pci_ss_info_174b_7147
+#define pci_ss_info_174b_7147 pci_ss_info_1002_5157_174b_7147
+static const pciSubsystemInfo pci_ss_info_1002_5157_174b_7161 =
+ {0x174b, 0x7161, pci_subsys_1002_5157_174b_7161, 0};
+#undef pci_ss_info_174b_7161
+#define pci_ss_info_174b_7161 pci_ss_info_1002_5157_174b_7161
+static const pciSubsystemInfo pci_ss_info_1002_5157_17af_0202 =
+ {0x17af, 0x0202, pci_subsys_1002_5157_17af_0202, 0};
+#undef pci_ss_info_17af_0202
+#define pci_ss_info_17af_0202 pci_ss_info_1002_5157_17af_0202
+static const pciSubsystemInfo pci_ss_info_1002_5159_1002_000a =
+ {0x1002, 0x000a, pci_subsys_1002_5159_1002_000a, 0};
+#undef pci_ss_info_1002_000a
+#define pci_ss_info_1002_000a pci_ss_info_1002_5159_1002_000a
+static const pciSubsystemInfo pci_ss_info_1002_5159_1002_000b =
+ {0x1002, 0x000b, pci_subsys_1002_5159_1002_000b, 0};
+#undef pci_ss_info_1002_000b
+#define pci_ss_info_1002_000b pci_ss_info_1002_5159_1002_000b
+static const pciSubsystemInfo pci_ss_info_1002_5159_1002_0038 =
+ {0x1002, 0x0038, pci_subsys_1002_5159_1002_0038, 0};
+#undef pci_ss_info_1002_0038
+#define pci_ss_info_1002_0038 pci_ss_info_1002_5159_1002_0038
+static const pciSubsystemInfo pci_ss_info_1002_5159_1002_003a =
+ {0x1002, 0x003a, pci_subsys_1002_5159_1002_003a, 0};
+#undef pci_ss_info_1002_003a
+#define pci_ss_info_1002_003a pci_ss_info_1002_5159_1002_003a
+static const pciSubsystemInfo pci_ss_info_1002_5159_1002_00ba =
+ {0x1002, 0x00ba, pci_subsys_1002_5159_1002_00ba, 0};
+#undef pci_ss_info_1002_00ba
+#define pci_ss_info_1002_00ba pci_ss_info_1002_5159_1002_00ba
+static const pciSubsystemInfo pci_ss_info_1002_5159_1002_013a =
+ {0x1002, 0x013a, pci_subsys_1002_5159_1002_013a, 0};
+#undef pci_ss_info_1002_013a
+#define pci_ss_info_1002_013a pci_ss_info_1002_5159_1002_013a
+static const pciSubsystemInfo pci_ss_info_1002_5159_1458_4002 =
+ {0x1458, 0x4002, pci_subsys_1002_5159_1458_4002, 0};
+#undef pci_ss_info_1458_4002
+#define pci_ss_info_1458_4002 pci_ss_info_1002_5159_1458_4002
+static const pciSubsystemInfo pci_ss_info_1002_5159_148c_2003 =
+ {0x148c, 0x2003, pci_subsys_1002_5159_148c_2003, 0};
+#undef pci_ss_info_148c_2003
+#define pci_ss_info_148c_2003 pci_ss_info_1002_5159_148c_2003
+static const pciSubsystemInfo pci_ss_info_1002_5159_148c_2023 =
+ {0x148c, 0x2023, pci_subsys_1002_5159_148c_2023, 0};
+#undef pci_ss_info_148c_2023
+#define pci_ss_info_148c_2023 pci_ss_info_1002_5159_148c_2023
+static const pciSubsystemInfo pci_ss_info_1002_5159_174b_7112 =
+ {0x174b, 0x7112, pci_subsys_1002_5159_174b_7112, 0};
+#undef pci_ss_info_174b_7112
+#define pci_ss_info_174b_7112 pci_ss_info_1002_5159_174b_7112
+static const pciSubsystemInfo pci_ss_info_1002_5159_1787_0202 =
+ {0x1787, 0x0202, pci_subsys_1002_5159_1787_0202, 0};
+#undef pci_ss_info_1787_0202
+#define pci_ss_info_1787_0202 pci_ss_info_1002_5159_1787_0202
+static const pciSubsystemInfo pci_ss_info_1002_5245_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_5245_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_5245_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_5245_1002_0028 =
+ {0x1002, 0x0028, pci_subsys_1002_5245_1002_0028, 0};
+#undef pci_ss_info_1002_0028
+#define pci_ss_info_1002_0028 pci_ss_info_1002_5245_1002_0028
+static const pciSubsystemInfo pci_ss_info_1002_5245_1002_0029 =
+ {0x1002, 0x0029, pci_subsys_1002_5245_1002_0029, 0};
+#undef pci_ss_info_1002_0029
+#define pci_ss_info_1002_0029 pci_ss_info_1002_5245_1002_0029
+static const pciSubsystemInfo pci_ss_info_1002_5245_1002_0068 =
+ {0x1002, 0x0068, pci_subsys_1002_5245_1002_0068, 0};
+#undef pci_ss_info_1002_0068
+#define pci_ss_info_1002_0068 pci_ss_info_1002_5245_1002_0068
+static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0004 =
+ {0x1002, 0x0004, pci_subsys_1002_5246_1002_0004, 0};
+#undef pci_ss_info_1002_0004
+#define pci_ss_info_1002_0004 pci_ss_info_1002_5246_1002_0004
+static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_5246_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_5246_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0028 =
+ {0x1002, 0x0028, pci_subsys_1002_5246_1002_0028, 0};
+#undef pci_ss_info_1002_0028
+#define pci_ss_info_1002_0028 pci_ss_info_1002_5246_1002_0028
+static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0044 =
+ {0x1002, 0x0044, pci_subsys_1002_5246_1002_0044, 0};
+#undef pci_ss_info_1002_0044
+#define pci_ss_info_1002_0044 pci_ss_info_1002_5246_1002_0044
+static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0068 =
+ {0x1002, 0x0068, pci_subsys_1002_5246_1002_0068, 0};
+#undef pci_ss_info_1002_0068
+#define pci_ss_info_1002_0068 pci_ss_info_1002_5246_1002_0068
+static const pciSubsystemInfo pci_ss_info_1002_5246_1002_0448 =
+ {0x1002, 0x0448, pci_subsys_1002_5246_1002_0448, 0};
+#undef pci_ss_info_1002_0448
+#define pci_ss_info_1002_0448 pci_ss_info_1002_5246_1002_0448
+static const pciSubsystemInfo pci_ss_info_1002_524c_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_524c_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_524c_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_524c_1002_0088 =
+ {0x1002, 0x0088, pci_subsys_1002_524c_1002_0088, 0};
+#undef pci_ss_info_1002_0088
+#define pci_ss_info_1002_0088 pci_ss_info_1002_524c_1002_0088
+static const pciSubsystemInfo pci_ss_info_1002_534d_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_534d_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_534d_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_534d_1002_0018 =
+ {0x1002, 0x0018, pci_subsys_1002_534d_1002_0018, 0};
+#undef pci_ss_info_1002_0018
+#define pci_ss_info_1002_0018 pci_ss_info_1002_534d_1002_0018
+static const pciSubsystemInfo pci_ss_info_1002_5354_1002_5654 =
+ {0x1002, 0x5654, pci_subsys_1002_5354_1002_5654, 0};
+#undef pci_ss_info_1002_5654
+#define pci_ss_info_1002_5654 pci_ss_info_1002_5354_1002_5654
+static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0004 =
+ {0x1002, 0x0004, pci_subsys_1002_5446_1002_0004, 0};
+#undef pci_ss_info_1002_0004
+#define pci_ss_info_1002_0004 pci_ss_info_1002_5446_1002_0004
+static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0008 =
+ {0x1002, 0x0008, pci_subsys_1002_5446_1002_0008, 0};
+#undef pci_ss_info_1002_0008
+#define pci_ss_info_1002_0008 pci_ss_info_1002_5446_1002_0008
+static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0018 =
+ {0x1002, 0x0018, pci_subsys_1002_5446_1002_0018, 0};
+#undef pci_ss_info_1002_0018
+#define pci_ss_info_1002_0018 pci_ss_info_1002_5446_1002_0018
+static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0028 =
+ {0x1002, 0x0028, pci_subsys_1002_5446_1002_0028, 0};
+#undef pci_ss_info_1002_0028
+#define pci_ss_info_1002_0028 pci_ss_info_1002_5446_1002_0028
+static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0029 =
+ {0x1002, 0x0029, pci_subsys_1002_5446_1002_0029, 0};
+#undef pci_ss_info_1002_0029
+#define pci_ss_info_1002_0029 pci_ss_info_1002_5446_1002_0029
+static const pciSubsystemInfo pci_ss_info_1002_5446_1002_002a =
+ {0x1002, 0x002a, pci_subsys_1002_5446_1002_002a, 0};
+#undef pci_ss_info_1002_002a
+#define pci_ss_info_1002_002a pci_ss_info_1002_5446_1002_002a
+static const pciSubsystemInfo pci_ss_info_1002_5446_1002_002b =
+ {0x1002, 0x002b, pci_subsys_1002_5446_1002_002b, 0};
+#undef pci_ss_info_1002_002b
+#define pci_ss_info_1002_002b pci_ss_info_1002_5446_1002_002b
+static const pciSubsystemInfo pci_ss_info_1002_5446_1002_0048 =
+ {0x1002, 0x0048, pci_subsys_1002_5446_1002_0048, 0};
+#undef pci_ss_info_1002_0048
+#define pci_ss_info_1002_0048 pci_ss_info_1002_5446_1002_0048
+static const pciSubsystemInfo pci_ss_info_1002_5452_1002_001c =
+ {0x1002, 0x001c, pci_subsys_1002_5452_1002_001c, 0};
+#undef pci_ss_info_1002_001c
+#define pci_ss_info_1002_001c pci_ss_info_1002_5452_1002_001c
+static const pciSubsystemInfo pci_ss_info_1002_5452_103c_1279 =
+ {0x103c, 0x1279, pci_subsys_1002_5452_103c_1279, 0};
+#undef pci_ss_info_103c_1279
+#define pci_ss_info_103c_1279 pci_ss_info_1002_5452_103c_1279
+static const pciSubsystemInfo pci_ss_info_1002_5654_1002_5654 =
+ {0x1002, 0x5654, pci_subsys_1002_5654_1002_5654, 0};
+#undef pci_ss_info_1002_5654
+#define pci_ss_info_1002_5654 pci_ss_info_1002_5654_1002_5654
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1004_0304_1004_0304 =
+ {0x1004, 0x0304, pci_subsys_1004_0304_1004_0304, 0};
+#undef pci_ss_info_1004_0304
+#define pci_ss_info_1004_0304 pci_ss_info_1004_0304_1004_0304
+static const pciSubsystemInfo pci_ss_info_1004_0304_122d_1206 =
+ {0x122d, 0x1206, pci_subsys_1004_0304_122d_1206, 0};
+#undef pci_ss_info_122d_1206
+#define pci_ss_info_122d_1206 pci_ss_info_1004_0304_122d_1206
+static const pciSubsystemInfo pci_ss_info_1004_0304_1483_5020 =
+ {0x1483, 0x5020, pci_subsys_1004_0304_1483_5020, 0};
+#undef pci_ss_info_1483_5020
+#define pci_ss_info_1483_5020 pci_ss_info_1004_0304_1483_5020
+static const pciSubsystemInfo pci_ss_info_1004_0305_1004_0305 =
+ {0x1004, 0x0305, pci_subsys_1004_0305_1004_0305, 0};
+#undef pci_ss_info_1004_0305
+#define pci_ss_info_1004_0305 pci_ss_info_1004_0305_1004_0305
+static const pciSubsystemInfo pci_ss_info_1004_0305_122d_1207 =
+ {0x122d, 0x1207, pci_subsys_1004_0305_122d_1207, 0};
+#undef pci_ss_info_122d_1207
+#define pci_ss_info_122d_1207 pci_ss_info_1004_0305_122d_1207
+static const pciSubsystemInfo pci_ss_info_1004_0305_1483_5021 =
+ {0x1483, 0x5021, pci_subsys_1004_0305_1483_5021, 0};
+#undef pci_ss_info_1483_5021
+#define pci_ss_info_1483_5021 pci_ss_info_1004_0305_1483_5021
+static const pciSubsystemInfo pci_ss_info_1004_0306_1004_0306 =
+ {0x1004, 0x0306, pci_subsys_1004_0306_1004_0306, 0};
+#undef pci_ss_info_1004_0306
+#define pci_ss_info_1004_0306 pci_ss_info_1004_0306_1004_0306
+static const pciSubsystemInfo pci_ss_info_1004_0306_122d_1208 =
+ {0x122d, 0x1208, pci_subsys_1004_0306_122d_1208, 0};
+#undef pci_ss_info_122d_1208
+#define pci_ss_info_122d_1208 pci_ss_info_1004_0306_122d_1208
+static const pciSubsystemInfo pci_ss_info_1004_0306_1483_5022 =
+ {0x1483, 0x5022, pci_subsys_1004_0306_1483_5022, 0};
+#undef pci_ss_info_1483_5022
+#define pci_ss_info_1483_5022 pci_ss_info_1004_0306_1483_5022
+#endif
+static const pciSubsystemInfo pci_ss_info_1011_0009_1025_0310 =
+ {0x1025, 0x0310, pci_subsys_1011_0009_1025_0310, 0};
+#undef pci_ss_info_1025_0310
+#define pci_ss_info_1025_0310 pci_ss_info_1011_0009_1025_0310
+static const pciSubsystemInfo pci_ss_info_1011_0009_10b8_2001 =
+ {0x10b8, 0x2001, pci_subsys_1011_0009_10b8_2001, 0};
+#undef pci_ss_info_10b8_2001
+#define pci_ss_info_10b8_2001 pci_ss_info_1011_0009_10b8_2001
+static const pciSubsystemInfo pci_ss_info_1011_0009_10b8_2002 =
+ {0x10b8, 0x2002, pci_subsys_1011_0009_10b8_2002, 0};
+#undef pci_ss_info_10b8_2002
+#define pci_ss_info_10b8_2002 pci_ss_info_1011_0009_10b8_2002
+static const pciSubsystemInfo pci_ss_info_1011_0009_10b8_2003 =
+ {0x10b8, 0x2003, pci_subsys_1011_0009_10b8_2003, 0};
+#undef pci_ss_info_10b8_2003
+#define pci_ss_info_10b8_2003 pci_ss_info_1011_0009_10b8_2003
+static const pciSubsystemInfo pci_ss_info_1011_0009_1109_2400 =
+ {0x1109, 0x2400, pci_subsys_1011_0009_1109_2400, 0};
+#undef pci_ss_info_1109_2400
+#define pci_ss_info_1109_2400 pci_ss_info_1011_0009_1109_2400
+static const pciSubsystemInfo pci_ss_info_1011_0009_1112_2300 =
+ {0x1112, 0x2300, pci_subsys_1011_0009_1112_2300, 0};
+#undef pci_ss_info_1112_2300
+#define pci_ss_info_1112_2300 pci_ss_info_1011_0009_1112_2300
+static const pciSubsystemInfo pci_ss_info_1011_0009_1112_2320 =
+ {0x1112, 0x2320, pci_subsys_1011_0009_1112_2320, 0};
+#undef pci_ss_info_1112_2320
+#define pci_ss_info_1112_2320 pci_ss_info_1011_0009_1112_2320
+static const pciSubsystemInfo pci_ss_info_1011_0009_1112_2340 =
+ {0x1112, 0x2340, pci_subsys_1011_0009_1112_2340, 0};
+#undef pci_ss_info_1112_2340
+#define pci_ss_info_1112_2340 pci_ss_info_1011_0009_1112_2340
+static const pciSubsystemInfo pci_ss_info_1011_0009_1113_1207 =
+ {0x1113, 0x1207, pci_subsys_1011_0009_1113_1207, 0};
+#undef pci_ss_info_1113_1207
+#define pci_ss_info_1113_1207 pci_ss_info_1011_0009_1113_1207
+static const pciSubsystemInfo pci_ss_info_1011_0009_1186_1100 =
+ {0x1186, 0x1100, pci_subsys_1011_0009_1186_1100, 0};
+#undef pci_ss_info_1186_1100
+#define pci_ss_info_1186_1100 pci_ss_info_1011_0009_1186_1100
+static const pciSubsystemInfo pci_ss_info_1011_0009_1186_1112 =
+ {0x1186, 0x1112, pci_subsys_1011_0009_1186_1112, 0};
+#undef pci_ss_info_1186_1112
+#define pci_ss_info_1186_1112 pci_ss_info_1011_0009_1186_1112
+static const pciSubsystemInfo pci_ss_info_1011_0009_1186_1140 =
+ {0x1186, 0x1140, pci_subsys_1011_0009_1186_1140, 0};
+#undef pci_ss_info_1186_1140
+#define pci_ss_info_1186_1140 pci_ss_info_1011_0009_1186_1140
+static const pciSubsystemInfo pci_ss_info_1011_0009_1186_1142 =
+ {0x1186, 0x1142, pci_subsys_1011_0009_1186_1142, 0};
+#undef pci_ss_info_1186_1142
+#define pci_ss_info_1186_1142 pci_ss_info_1011_0009_1186_1142
+static const pciSubsystemInfo pci_ss_info_1011_0009_11f6_0503 =
+ {0x11f6, 0x0503, pci_subsys_1011_0009_11f6_0503, 0};
+#undef pci_ss_info_11f6_0503
+#define pci_ss_info_11f6_0503 pci_ss_info_1011_0009_11f6_0503
+static const pciSubsystemInfo pci_ss_info_1011_0009_1282_9100 =
+ {0x1282, 0x9100, pci_subsys_1011_0009_1282_9100, 0};
+#undef pci_ss_info_1282_9100
+#define pci_ss_info_1282_9100 pci_ss_info_1011_0009_1282_9100
+static const pciSubsystemInfo pci_ss_info_1011_0009_1385_1100 =
+ {0x1385, 0x1100, pci_subsys_1011_0009_1385_1100, 0};
+#undef pci_ss_info_1385_1100
+#define pci_ss_info_1385_1100 pci_ss_info_1011_0009_1385_1100
+static const pciSubsystemInfo pci_ss_info_1011_0009_2646_0001 =
+ {0x2646, 0x0001, pci_subsys_1011_0009_2646_0001, 0};
+#undef pci_ss_info_2646_0001
+#define pci_ss_info_2646_0001 pci_ss_info_1011_0009_2646_0001
+static const pciSubsystemInfo pci_ss_info_1011_0014_1186_0100 =
+ {0x1186, 0x0100, pci_subsys_1011_0014_1186_0100, 0};
+#undef pci_ss_info_1186_0100
+#define pci_ss_info_1186_0100 pci_ss_info_1011_0014_1186_0100
+static const pciSubsystemInfo pci_ss_info_1011_0019_1011_500a =
+ {0x1011, 0x500a, pci_subsys_1011_0019_1011_500a, 0};
+#undef pci_ss_info_1011_500a
+#define pci_ss_info_1011_500a pci_ss_info_1011_0019_1011_500a
+static const pciSubsystemInfo pci_ss_info_1011_0019_1011_500b =
+ {0x1011, 0x500b, pci_subsys_1011_0019_1011_500b, 0};
+#undef pci_ss_info_1011_500b
+#define pci_ss_info_1011_500b pci_ss_info_1011_0019_1011_500b
+static const pciSubsystemInfo pci_ss_info_1011_0019_1014_0001 =
+ {0x1014, 0x0001, pci_subsys_1011_0019_1014_0001, 0};
+#undef pci_ss_info_1014_0001
+#define pci_ss_info_1014_0001 pci_ss_info_1011_0019_1014_0001
+static const pciSubsystemInfo pci_ss_info_1011_0019_1025_0315 =
+ {0x1025, 0x0315, pci_subsys_1011_0019_1025_0315, 0};
+#undef pci_ss_info_1025_0315
+#define pci_ss_info_1025_0315 pci_ss_info_1011_0019_1025_0315
+static const pciSubsystemInfo pci_ss_info_1011_0019_1033_800c =
+ {0x1033, 0x800c, pci_subsys_1011_0019_1033_800c, 0};
+#undef pci_ss_info_1033_800c
+#define pci_ss_info_1033_800c pci_ss_info_1011_0019_1033_800c
+static const pciSubsystemInfo pci_ss_info_1011_0019_1033_800d =
+ {0x1033, 0x800d, pci_subsys_1011_0019_1033_800d, 0};
+#undef pci_ss_info_1033_800d
+#define pci_ss_info_1033_800d pci_ss_info_1011_0019_1033_800d
+static const pciSubsystemInfo pci_ss_info_1011_0019_108d_0016 =
+ {0x108d, 0x0016, pci_subsys_1011_0019_108d_0016, 0};
+#undef pci_ss_info_108d_0016
+#define pci_ss_info_108d_0016 pci_ss_info_1011_0019_108d_0016
+static const pciSubsystemInfo pci_ss_info_1011_0019_108d_0017 =
+ {0x108d, 0x0017, pci_subsys_1011_0019_108d_0017, 0};
+#undef pci_ss_info_108d_0017
+#define pci_ss_info_108d_0017 pci_ss_info_1011_0019_108d_0017
+static const pciSubsystemInfo pci_ss_info_1011_0019_10b8_2005 =
+ {0x10b8, 0x2005, pci_subsys_1011_0019_10b8_2005, 0};
+#undef pci_ss_info_10b8_2005
+#define pci_ss_info_10b8_2005 pci_ss_info_1011_0019_10b8_2005
+static const pciSubsystemInfo pci_ss_info_1011_0019_10b8_8034 =
+ {0x10b8, 0x8034, pci_subsys_1011_0019_10b8_8034, 0};
+#undef pci_ss_info_10b8_8034
+#define pci_ss_info_10b8_8034 pci_ss_info_1011_0019_10b8_8034
+static const pciSubsystemInfo pci_ss_info_1011_0019_10ef_8169 =
+ {0x10ef, 0x8169, pci_subsys_1011_0019_10ef_8169, 0};
+#undef pci_ss_info_10ef_8169
+#define pci_ss_info_10ef_8169 pci_ss_info_1011_0019_10ef_8169
+static const pciSubsystemInfo pci_ss_info_1011_0019_1109_2a00 =
+ {0x1109, 0x2a00, pci_subsys_1011_0019_1109_2a00, 0};
+#undef pci_ss_info_1109_2a00
+#define pci_ss_info_1109_2a00 pci_ss_info_1011_0019_1109_2a00
+static const pciSubsystemInfo pci_ss_info_1011_0019_1109_2b00 =
+ {0x1109, 0x2b00, pci_subsys_1011_0019_1109_2b00, 0};
+#undef pci_ss_info_1109_2b00
+#define pci_ss_info_1109_2b00 pci_ss_info_1011_0019_1109_2b00
+static const pciSubsystemInfo pci_ss_info_1011_0019_1109_3000 =
+ {0x1109, 0x3000, pci_subsys_1011_0019_1109_3000, 0};
+#undef pci_ss_info_1109_3000
+#define pci_ss_info_1109_3000 pci_ss_info_1011_0019_1109_3000
+static const pciSubsystemInfo pci_ss_info_1011_0019_1113_1207 =
+ {0x1113, 0x1207, pci_subsys_1011_0019_1113_1207, 0};
+#undef pci_ss_info_1113_1207
+#define pci_ss_info_1113_1207 pci_ss_info_1011_0019_1113_1207
+static const pciSubsystemInfo pci_ss_info_1011_0019_1113_2220 =
+ {0x1113, 0x2220, pci_subsys_1011_0019_1113_2220, 0};
+#undef pci_ss_info_1113_2220
+#define pci_ss_info_1113_2220 pci_ss_info_1011_0019_1113_2220
+static const pciSubsystemInfo pci_ss_info_1011_0019_115d_0002 =
+ {0x115d, 0x0002, pci_subsys_1011_0019_115d_0002, 0};
+#undef pci_ss_info_115d_0002
+#define pci_ss_info_115d_0002 pci_ss_info_1011_0019_115d_0002
+static const pciSubsystemInfo pci_ss_info_1011_0019_1179_0203 =
+ {0x1179, 0x0203, pci_subsys_1011_0019_1179_0203, 0};
+#undef pci_ss_info_1179_0203
+#define pci_ss_info_1179_0203 pci_ss_info_1011_0019_1179_0203
+static const pciSubsystemInfo pci_ss_info_1011_0019_1179_0204 =
+ {0x1179, 0x0204, pci_subsys_1011_0019_1179_0204, 0};
+#undef pci_ss_info_1179_0204
+#define pci_ss_info_1179_0204 pci_ss_info_1011_0019_1179_0204
+static const pciSubsystemInfo pci_ss_info_1011_0019_1186_1100 =
+ {0x1186, 0x1100, pci_subsys_1011_0019_1186_1100, 0};
+#undef pci_ss_info_1186_1100
+#define pci_ss_info_1186_1100 pci_ss_info_1011_0019_1186_1100
+static const pciSubsystemInfo pci_ss_info_1011_0019_1186_1101 =
+ {0x1186, 0x1101, pci_subsys_1011_0019_1186_1101, 0};
+#undef pci_ss_info_1186_1101
+#define pci_ss_info_1186_1101 pci_ss_info_1011_0019_1186_1101
+static const pciSubsystemInfo pci_ss_info_1011_0019_1186_1102 =
+ {0x1186, 0x1102, pci_subsys_1011_0019_1186_1102, 0};
+#undef pci_ss_info_1186_1102
+#define pci_ss_info_1186_1102 pci_ss_info_1011_0019_1186_1102
+static const pciSubsystemInfo pci_ss_info_1011_0019_1259_2800 =
+ {0x1259, 0x2800, pci_subsys_1011_0019_1259_2800, 0};
+#undef pci_ss_info_1259_2800
+#define pci_ss_info_1259_2800 pci_ss_info_1011_0019_1259_2800
+static const pciSubsystemInfo pci_ss_info_1011_0019_1266_0004 =
+ {0x1266, 0x0004, pci_subsys_1011_0019_1266_0004, 0};
+#undef pci_ss_info_1266_0004
+#define pci_ss_info_1266_0004 pci_ss_info_1011_0019_1266_0004
+static const pciSubsystemInfo pci_ss_info_1011_0019_12af_0019 =
+ {0x12af, 0x0019, pci_subsys_1011_0019_12af_0019, 0};
+#undef pci_ss_info_12af_0019
+#define pci_ss_info_12af_0019 pci_ss_info_1011_0019_12af_0019
+static const pciSubsystemInfo pci_ss_info_1011_0019_1374_0001 =
+ {0x1374, 0x0001, pci_subsys_1011_0019_1374_0001, 0};
+#undef pci_ss_info_1374_0001
+#define pci_ss_info_1374_0001 pci_ss_info_1011_0019_1374_0001
+static const pciSubsystemInfo pci_ss_info_1011_0019_1374_0002 =
+ {0x1374, 0x0002, pci_subsys_1011_0019_1374_0002, 0};
+#undef pci_ss_info_1374_0002
+#define pci_ss_info_1374_0002 pci_ss_info_1011_0019_1374_0002
+static const pciSubsystemInfo pci_ss_info_1011_0019_1374_0007 =
+ {0x1374, 0x0007, pci_subsys_1011_0019_1374_0007, 0};
+#undef pci_ss_info_1374_0007
+#define pci_ss_info_1374_0007 pci_ss_info_1011_0019_1374_0007
+static const pciSubsystemInfo pci_ss_info_1011_0019_1374_0008 =
+ {0x1374, 0x0008, pci_subsys_1011_0019_1374_0008, 0};
+#undef pci_ss_info_1374_0008
+#define pci_ss_info_1374_0008 pci_ss_info_1011_0019_1374_0008
+static const pciSubsystemInfo pci_ss_info_1011_0019_1385_2100 =
+ {0x1385, 0x2100, pci_subsys_1011_0019_1385_2100, 0};
+#undef pci_ss_info_1385_2100
+#define pci_ss_info_1385_2100 pci_ss_info_1011_0019_1385_2100
+static const pciSubsystemInfo pci_ss_info_1011_0019_1395_0001 =
+ {0x1395, 0x0001, pci_subsys_1011_0019_1395_0001, 0};
+#undef pci_ss_info_1395_0001
+#define pci_ss_info_1395_0001 pci_ss_info_1011_0019_1395_0001
+static const pciSubsystemInfo pci_ss_info_1011_0019_13d1_ab01 =
+ {0x13d1, 0xab01, pci_subsys_1011_0019_13d1_ab01, 0};
+#undef pci_ss_info_13d1_ab01
+#define pci_ss_info_13d1_ab01 pci_ss_info_1011_0019_13d1_ab01
+static const pciSubsystemInfo pci_ss_info_1011_0019_8086_0001 =
+ {0x8086, 0x0001, pci_subsys_1011_0019_8086_0001, 0};
+#undef pci_ss_info_8086_0001
+#define pci_ss_info_8086_0001 pci_ss_info_1011_0019_8086_0001
+static const pciSubsystemInfo pci_ss_info_1011_0034_1374_0003 =
+ {0x1374, 0x0003, pci_subsys_1011_0034_1374_0003, 0};
+#undef pci_ss_info_1374_0003
+#define pci_ss_info_1374_0003 pci_ss_info_1011_0034_1374_0003
+static const pciSubsystemInfo pci_ss_info_1011_0046_0e11_4050 =
+ {0x0e11, 0x4050, pci_subsys_1011_0046_0e11_4050, 0};
+#undef pci_ss_info_0e11_4050
+#define pci_ss_info_0e11_4050 pci_ss_info_1011_0046_0e11_4050
+static const pciSubsystemInfo pci_ss_info_1011_0046_0e11_4051 =
+ {0x0e11, 0x4051, pci_subsys_1011_0046_0e11_4051, 0};
+#undef pci_ss_info_0e11_4051
+#define pci_ss_info_0e11_4051 pci_ss_info_1011_0046_0e11_4051
+static const pciSubsystemInfo pci_ss_info_1011_0046_0e11_4058 =
+ {0x0e11, 0x4058, pci_subsys_1011_0046_0e11_4058, 0};
+#undef pci_ss_info_0e11_4058
+#define pci_ss_info_0e11_4058 pci_ss_info_1011_0046_0e11_4058
+static const pciSubsystemInfo pci_ss_info_1011_0046_103c_10c2 =
+ {0x103c, 0x10c2, pci_subsys_1011_0046_103c_10c2, 0};
+#undef pci_ss_info_103c_10c2
+#define pci_ss_info_103c_10c2 pci_ss_info_1011_0046_103c_10c2
+static const pciSubsystemInfo pci_ss_info_1011_0046_12d9_000a =
+ {0x12d9, 0x000a, pci_subsys_1011_0046_12d9_000a, 0};
+#undef pci_ss_info_12d9_000a
+#define pci_ss_info_12d9_000a pci_ss_info_1011_0046_12d9_000a
+static const pciSubsystemInfo pci_ss_info_1011_0046_9005_0365 =
+ {0x9005, 0x0365, pci_subsys_1011_0046_9005_0365, 0};
+#undef pci_ss_info_9005_0365
+#define pci_ss_info_9005_0365 pci_ss_info_1011_0046_9005_0365
+static const pciSubsystemInfo pci_ss_info_1011_0046_9005_1364 =
+ {0x9005, 0x1364, pci_subsys_1011_0046_9005_1364, 0};
+#undef pci_ss_info_9005_1364
+#define pci_ss_info_9005_1364 pci_ss_info_1011_0046_9005_1364
+static const pciSubsystemInfo pci_ss_info_1011_0046_9005_1365 =
+ {0x9005, 0x1365, pci_subsys_1011_0046_9005_1365, 0};
+#undef pci_ss_info_9005_1365
+#define pci_ss_info_9005_1365 pci_ss_info_1011_0046_9005_1365
+static const pciSubsystemInfo pci_ss_info_1011_0046_e4bf_1000 =
+ {0xe4bf, 0x1000, pci_subsys_1011_0046_e4bf_1000, 0};
+#undef pci_ss_info_e4bf_1000
+#define pci_ss_info_e4bf_1000 pci_ss_info_1011_0046_e4bf_1000
+static const pciSubsystemInfo pci_ss_info_1011_1065_1069_0020 =
+ {0x1069, 0x0020, pci_subsys_1011_1065_1069_0020, 0};
+#undef pci_ss_info_1069_0020
+#define pci_ss_info_1069_0020 pci_ss_info_1011_1065_1069_0020
+static const pciSubsystemInfo pci_ss_info_1013_00bc_1013_00bc =
+ {0x1013, 0x00bc, pci_subsys_1013_00bc_1013_00bc, 0};
+#undef pci_ss_info_1013_00bc
+#define pci_ss_info_1013_00bc pci_ss_info_1013_00bc_1013_00bc
+static const pciSubsystemInfo pci_ss_info_1013_00d6_13ce_8031 =
+ {0x13ce, 0x8031, pci_subsys_1013_00d6_13ce_8031, 0};
+#undef pci_ss_info_13ce_8031
+#define pci_ss_info_13ce_8031 pci_ss_info_1013_00d6_13ce_8031
+static const pciSubsystemInfo pci_ss_info_1013_00d6_13cf_8031 =
+ {0x13cf, 0x8031, pci_subsys_1013_00d6_13cf_8031, 0};
+#undef pci_ss_info_13cf_8031
+#define pci_ss_info_13cf_8031 pci_ss_info_1013_00d6_13cf_8031
+static const pciSubsystemInfo pci_ss_info_1013_6001_1014_1010 =
+ {0x1014, 0x1010, pci_subsys_1013_6001_1014_1010, 0};
+#undef pci_ss_info_1014_1010
+#define pci_ss_info_1014_1010 pci_ss_info_1013_6001_1014_1010
+static const pciSubsystemInfo pci_ss_info_1013_6003_1013_4280 =
+ {0x1013, 0x4280, pci_subsys_1013_6003_1013_4280, 0};
+#undef pci_ss_info_1013_4280
+#define pci_ss_info_1013_4280 pci_ss_info_1013_6003_1013_4280
+static const pciSubsystemInfo pci_ss_info_1013_6003_1681_0050 =
+ {0x1681, 0x0050, pci_subsys_1013_6003_1681_0050, 0};
+#undef pci_ss_info_1681_0050
+#define pci_ss_info_1681_0050 pci_ss_info_1013_6003_1681_0050
+static const pciSubsystemInfo pci_ss_info_1013_6003_1681_a011 =
+ {0x1681, 0xa011, pci_subsys_1013_6003_1681_a011, 0};
+#undef pci_ss_info_1681_a011
+#define pci_ss_info_1681_a011 pci_ss_info_1013_6003_1681_a011
+static const pciSubsystemInfo pci_ss_info_1013_6005_1013_4281 =
+ {0x1013, 0x4281, pci_subsys_1013_6005_1013_4281, 0};
+#undef pci_ss_info_1013_4281
+#define pci_ss_info_1013_4281 pci_ss_info_1013_6005_1013_4281
+static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10a8 =
+ {0x10cf, 0x10a8, pci_subsys_1013_6005_10cf_10a8, 0};
+#undef pci_ss_info_10cf_10a8
+#define pci_ss_info_10cf_10a8 pci_ss_info_1013_6005_10cf_10a8
+static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10a9 =
+ {0x10cf, 0x10a9, pci_subsys_1013_6005_10cf_10a9, 0};
+#undef pci_ss_info_10cf_10a9
+#define pci_ss_info_10cf_10a9 pci_ss_info_1013_6005_10cf_10a9
+static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10aa =
+ {0x10cf, 0x10aa, pci_subsys_1013_6005_10cf_10aa, 0};
+#undef pci_ss_info_10cf_10aa
+#define pci_ss_info_10cf_10aa pci_ss_info_1013_6005_10cf_10aa
+static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10ab =
+ {0x10cf, 0x10ab, pci_subsys_1013_6005_10cf_10ab, 0};
+#undef pci_ss_info_10cf_10ab
+#define pci_ss_info_10cf_10ab pci_ss_info_1013_6005_10cf_10ab
+static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10ac =
+ {0x10cf, 0x10ac, pci_subsys_1013_6005_10cf_10ac, 0};
+#undef pci_ss_info_10cf_10ac
+#define pci_ss_info_10cf_10ac pci_ss_info_1013_6005_10cf_10ac
+static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10ad =
+ {0x10cf, 0x10ad, pci_subsys_1013_6005_10cf_10ad, 0};
+#undef pci_ss_info_10cf_10ad
+#define pci_ss_info_10cf_10ad pci_ss_info_1013_6005_10cf_10ad
+static const pciSubsystemInfo pci_ss_info_1013_6005_10cf_10b4 =
+ {0x10cf, 0x10b4, pci_subsys_1013_6005_10cf_10b4, 0};
+#undef pci_ss_info_10cf_10b4
+#define pci_ss_info_10cf_10b4 pci_ss_info_1013_6005_10cf_10b4
+static const pciSubsystemInfo pci_ss_info_1013_6005_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1013_6005_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1013_6005_1179_0001
+static const pciSubsystemInfo pci_ss_info_1013_6005_14c0_000c =
+ {0x14c0, 0x000c, pci_subsys_1013_6005_14c0_000c, 0};
+#undef pci_ss_info_14c0_000c
+#define pci_ss_info_14c0_000c pci_ss_info_1013_6005_14c0_000c
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1014_002e_1014_002e =
+ {0x1014, 0x002e, pci_subsys_1014_002e_1014_002e, 0};
+#undef pci_ss_info_1014_002e
+#define pci_ss_info_1014_002e pci_ss_info_1014_002e_1014_002e
+static const pciSubsystemInfo pci_ss_info_1014_002e_1014_022e =
+ {0x1014, 0x022e, pci_subsys_1014_002e_1014_022e, 0};
+#undef pci_ss_info_1014_022e
+#define pci_ss_info_1014_022e pci_ss_info_1014_002e_1014_022e
+static const pciSubsystemInfo pci_ss_info_1014_003e_1014_003e =
+ {0x1014, 0x003e, pci_subsys_1014_003e_1014_003e, 0};
+#undef pci_ss_info_1014_003e
+#define pci_ss_info_1014_003e pci_ss_info_1014_003e_1014_003e
+static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00cd =
+ {0x1014, 0x00cd, pci_subsys_1014_003e_1014_00cd, 0};
+#undef pci_ss_info_1014_00cd
+#define pci_ss_info_1014_00cd pci_ss_info_1014_003e_1014_00cd
+static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00ce =
+ {0x1014, 0x00ce, pci_subsys_1014_003e_1014_00ce, 0};
+#undef pci_ss_info_1014_00ce
+#define pci_ss_info_1014_00ce pci_ss_info_1014_003e_1014_00ce
+static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00cf =
+ {0x1014, 0x00cf, pci_subsys_1014_003e_1014_00cf, 0};
+#undef pci_ss_info_1014_00cf
+#define pci_ss_info_1014_00cf pci_ss_info_1014_003e_1014_00cf
+static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00e4 =
+ {0x1014, 0x00e4, pci_subsys_1014_003e_1014_00e4, 0};
+#undef pci_ss_info_1014_00e4
+#define pci_ss_info_1014_00e4 pci_ss_info_1014_003e_1014_00e4
+static const pciSubsystemInfo pci_ss_info_1014_003e_1014_00e5 =
+ {0x1014, 0x00e5, pci_subsys_1014_003e_1014_00e5, 0};
+#undef pci_ss_info_1014_00e5
+#define pci_ss_info_1014_00e5 pci_ss_info_1014_003e_1014_00e5
+static const pciSubsystemInfo pci_ss_info_1014_003e_1014_016d =
+ {0x1014, 0x016d, pci_subsys_1014_003e_1014_016d, 0};
+#undef pci_ss_info_1014_016d
+#define pci_ss_info_1014_016d pci_ss_info_1014_003e_1014_016d
+static const pciSubsystemInfo pci_ss_info_1014_0090_1014_008e =
+ {0x1014, 0x008e, pci_subsys_1014_0090_1014_008e, 0};
+#undef pci_ss_info_1014_008e
+#define pci_ss_info_1014_008e pci_ss_info_1014_0090_1014_008e
+static const pciSubsystemInfo pci_ss_info_1014_0096_1014_0097 =
+ {0x1014, 0x0097, pci_subsys_1014_0096_1014_0097, 0};
+#undef pci_ss_info_1014_0097
+#define pci_ss_info_1014_0097 pci_ss_info_1014_0096_1014_0097
+static const pciSubsystemInfo pci_ss_info_1014_0096_1014_0098 =
+ {0x1014, 0x0098, pci_subsys_1014_0096_1014_0098, 0};
+#undef pci_ss_info_1014_0098
+#define pci_ss_info_1014_0098 pci_ss_info_1014_0096_1014_0098
+static const pciSubsystemInfo pci_ss_info_1014_0096_1014_0099 =
+ {0x1014, 0x0099, pci_subsys_1014_0096_1014_0099, 0};
+#undef pci_ss_info_1014_0099
+#define pci_ss_info_1014_0099 pci_ss_info_1014_0096_1014_0099
+static const pciSubsystemInfo pci_ss_info_1014_0142_1014_0143 =
+ {0x1014, 0x0143, pci_subsys_1014_0142_1014_0143, 0};
+#undef pci_ss_info_1014_0143
+#define pci_ss_info_1014_0143 pci_ss_info_1014_0142_1014_0143
+static const pciSubsystemInfo pci_ss_info_1014_0144_1014_0145 =
+ {0x1014, 0x0145, pci_subsys_1014_0144_1014_0145, 0};
+#undef pci_ss_info_1014_0145
+#define pci_ss_info_1014_0145 pci_ss_info_1014_0144_1014_0145
+static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_01be =
+ {0x1014, 0x01be, pci_subsys_1014_01bd_1014_01be, 0};
+#undef pci_ss_info_1014_01be
+#define pci_ss_info_1014_01be pci_ss_info_1014_01bd_1014_01be
+static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_01bf =
+ {0x1014, 0x01bf, pci_subsys_1014_01bd_1014_01bf, 0};
+#undef pci_ss_info_1014_01bf
+#define pci_ss_info_1014_01bf pci_ss_info_1014_01bd_1014_01bf
+static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_0208 =
+ {0x1014, 0x0208, pci_subsys_1014_01bd_1014_0208, 0};
+#undef pci_ss_info_1014_0208
+#define pci_ss_info_1014_0208 pci_ss_info_1014_01bd_1014_0208
+static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_020e =
+ {0x1014, 0x020e, pci_subsys_1014_01bd_1014_020e, 0};
+#undef pci_ss_info_1014_020e
+#define pci_ss_info_1014_020e pci_ss_info_1014_01bd_1014_020e
+static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_022e =
+ {0x1014, 0x022e, pci_subsys_1014_01bd_1014_022e, 0};
+#undef pci_ss_info_1014_022e
+#define pci_ss_info_1014_022e pci_ss_info_1014_01bd_1014_022e
+static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_0258 =
+ {0x1014, 0x0258, pci_subsys_1014_01bd_1014_0258, 0};
+#undef pci_ss_info_1014_0258
+#define pci_ss_info_1014_0258 pci_ss_info_1014_01bd_1014_0258
+static const pciSubsystemInfo pci_ss_info_1014_01bd_1014_0259 =
+ {0x1014, 0x0259, pci_subsys_1014_01bd_1014_0259, 0};
+#undef pci_ss_info_1014_0259
+#define pci_ss_info_1014_0259 pci_ss_info_1014_01bd_1014_0259
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_101e_1960_101e_0471 =
+ {0x101e, 0x0471, pci_subsys_101e_1960_101e_0471, 0};
+#undef pci_ss_info_101e_0471
+#define pci_ss_info_101e_0471 pci_ss_info_101e_1960_101e_0471
+static const pciSubsystemInfo pci_ss_info_101e_1960_101e_0475 =
+ {0x101e, 0x0475, pci_subsys_101e_1960_101e_0475, 0};
+#undef pci_ss_info_101e_0475
+#define pci_ss_info_101e_0475 pci_ss_info_101e_1960_101e_0475
+static const pciSubsystemInfo pci_ss_info_101e_1960_101e_0493 =
+ {0x101e, 0x0493, pci_subsys_101e_1960_101e_0493, 0};
+#undef pci_ss_info_101e_0493
+#define pci_ss_info_101e_0493 pci_ss_info_101e_1960_101e_0493
+#endif
+static const pciSubsystemInfo pci_ss_info_101e_1960_1028_0471 =
+ {0x1028, 0x0471, pci_subsys_101e_1960_1028_0471, 0};
+#undef pci_ss_info_1028_0471
+#define pci_ss_info_1028_0471 pci_ss_info_101e_1960_1028_0471
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_101e_1960_1028_0475 =
+ {0x1028, 0x0475, pci_subsys_101e_1960_1028_0475, 0};
+#undef pci_ss_info_1028_0475
+#define pci_ss_info_1028_0475 pci_ss_info_101e_1960_1028_0475
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_101e_1960_1028_0493 =
+ {0x1028, 0x0493, pci_subsys_101e_1960_1028_0493, 0};
+#undef pci_ss_info_1028_0493
+#define pci_ss_info_1028_0493 pci_ss_info_101e_1960_1028_0493
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_101e_1960_1028_0511 =
+ {0x1028, 0x0511, pci_subsys_101e_1960_1028_0511, 0};
+#undef pci_ss_info_1028_0511
+#define pci_ss_info_1028_0511 pci_ss_info_101e_1960_1028_0511
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_101e_9063_101e_0767 =
+ {0x101e, 0x0767, pci_subsys_101e_9063_101e_0767, 0};
+#undef pci_ss_info_101e_0767
+#define pci_ss_info_101e_0767 pci_ss_info_101e_9063_101e_0767
+#endif
+static const pciSubsystemInfo pci_ss_info_1022_2000_1014_2000 =
+ {0x1014, 0x2000, pci_subsys_1022_2000_1014_2000, 0};
+#undef pci_ss_info_1014_2000
+#define pci_ss_info_1014_2000 pci_ss_info_1022_2000_1014_2000
+static const pciSubsystemInfo pci_ss_info_1022_2000_103c_104c =
+ {0x103c, 0x104c, pci_subsys_1022_2000_103c_104c, 0};
+#undef pci_ss_info_103c_104c
+#define pci_ss_info_103c_104c pci_ss_info_1022_2000_103c_104c
+static const pciSubsystemInfo pci_ss_info_1022_2000_103c_1064 =
+ {0x103c, 0x1064, pci_subsys_1022_2000_103c_1064, 0};
+#undef pci_ss_info_103c_1064
+#define pci_ss_info_103c_1064 pci_ss_info_1022_2000_103c_1064
+static const pciSubsystemInfo pci_ss_info_1022_2000_103c_1065 =
+ {0x103c, 0x1065, pci_subsys_1022_2000_103c_1065, 0};
+#undef pci_ss_info_103c_1065
+#define pci_ss_info_103c_1065 pci_ss_info_1022_2000_103c_1065
+static const pciSubsystemInfo pci_ss_info_1022_2000_103c_106c =
+ {0x103c, 0x106c, pci_subsys_1022_2000_103c_106c, 0};
+#undef pci_ss_info_103c_106c
+#define pci_ss_info_103c_106c pci_ss_info_1022_2000_103c_106c
+static const pciSubsystemInfo pci_ss_info_1022_2000_103c_106e =
+ {0x103c, 0x106e, pci_subsys_1022_2000_103c_106e, 0};
+#undef pci_ss_info_103c_106e
+#define pci_ss_info_103c_106e pci_ss_info_1022_2000_103c_106e
+static const pciSubsystemInfo pci_ss_info_1022_2000_103c_10ea =
+ {0x103c, 0x10ea, pci_subsys_1022_2000_103c_10ea, 0};
+#undef pci_ss_info_103c_10ea
+#define pci_ss_info_103c_10ea pci_ss_info_1022_2000_103c_10ea
+static const pciSubsystemInfo pci_ss_info_1022_2000_1113_1220 =
+ {0x1113, 0x1220, pci_subsys_1022_2000_1113_1220, 0};
+#undef pci_ss_info_1113_1220
+#define pci_ss_info_1113_1220 pci_ss_info_1022_2000_1113_1220
+static const pciSubsystemInfo pci_ss_info_1022_2000_1259_2450 =
+ {0x1259, 0x2450, pci_subsys_1022_2000_1259_2450, 0};
+#undef pci_ss_info_1259_2450
+#define pci_ss_info_1259_2450 pci_ss_info_1022_2000_1259_2450
+static const pciSubsystemInfo pci_ss_info_1022_2000_1259_2454 =
+ {0x1259, 0x2454, pci_subsys_1022_2000_1259_2454, 0};
+#undef pci_ss_info_1259_2454
+#define pci_ss_info_1259_2454 pci_ss_info_1022_2000_1259_2454
+static const pciSubsystemInfo pci_ss_info_1022_2000_1259_2700 =
+ {0x1259, 0x2700, pci_subsys_1022_2000_1259_2700, 0};
+#undef pci_ss_info_1259_2700
+#define pci_ss_info_1259_2700 pci_ss_info_1022_2000_1259_2700
+static const pciSubsystemInfo pci_ss_info_1022_2000_1259_2701 =
+ {0x1259, 0x2701, pci_subsys_1022_2000_1259_2701, 0};
+#undef pci_ss_info_1259_2701
+#define pci_ss_info_1259_2701 pci_ss_info_1022_2000_1259_2701
+static const pciSubsystemInfo pci_ss_info_1022_2001_1092_0a78 =
+ {0x1092, 0x0a78, pci_subsys_1022_2001_1092_0a78, 0};
+#undef pci_ss_info_1092_0a78
+#define pci_ss_info_1092_0a78 pci_ss_info_1022_2001_1092_0a78
+static const pciSubsystemInfo pci_ss_info_1022_2001_1668_0299 =
+ {0x1668, 0x0299, pci_subsys_1022_2001_1668_0299, 0};
+#undef pci_ss_info_1668_0299
+#define pci_ss_info_1668_0299 pci_ss_info_1022_2001_1668_0299
+static const pciSubsystemInfo pci_ss_info_1022_7440_1043_8044 =
+ {0x1043, 0x8044, pci_subsys_1022_7440_1043_8044, 0};
+#undef pci_ss_info_1043_8044
+#define pci_ss_info_1043_8044 pci_ss_info_1022_7440_1043_8044
+static const pciSubsystemInfo pci_ss_info_1022_7443_1043_8044 =
+ {0x1043, 0x8044, pci_subsys_1022_7443_1043_8044, 0};
+#undef pci_ss_info_1043_8044
+#define pci_ss_info_1043_8044 pci_ss_info_1022_7443_1043_8044
+static const pciSubsystemInfo pci_ss_info_1023_8400_1023_8400 =
+ {0x1023, 0x8400, pci_subsys_1023_8400_1023_8400, 0};
+#undef pci_ss_info_1023_8400
+#define pci_ss_info_1023_8400 pci_ss_info_1023_8400_1023_8400
+static const pciSubsystemInfo pci_ss_info_1023_8420_0e11_b15a =
+ {0x0e11, 0xb15a, pci_subsys_1023_8420_0e11_b15a, 0};
+#undef pci_ss_info_0e11_b15a
+#define pci_ss_info_0e11_b15a pci_ss_info_1023_8420_0e11_b15a
+static const pciSubsystemInfo pci_ss_info_1023_8520_0e11_b16e =
+ {0x0e11, 0xb16e, pci_subsys_1023_8520_0e11_b16e, 0};
+#undef pci_ss_info_0e11_b16e
+#define pci_ss_info_0e11_b16e pci_ss_info_1023_8520_0e11_b16e
+static const pciSubsystemInfo pci_ss_info_1023_8520_1023_8520 =
+ {0x1023, 0x8520, pci_subsys_1023_8520_1023_8520, 0};
+#undef pci_ss_info_1023_8520
+#define pci_ss_info_1023_8520 pci_ss_info_1023_8520_1023_8520
+static const pciSubsystemInfo pci_ss_info_1023_8620_1014_0502 =
+ {0x1014, 0x0502, pci_subsys_1023_8620_1014_0502, 0};
+#undef pci_ss_info_1014_0502
+#define pci_ss_info_1014_0502 pci_ss_info_1023_8620_1014_0502
+static const pciSubsystemInfo pci_ss_info_1023_9525_10cf_1094 =
+ {0x10cf, 0x1094, pci_subsys_1023_9525_10cf_1094, 0};
+#undef pci_ss_info_10cf_1094
+#define pci_ss_info_10cf_1094 pci_ss_info_1023_9525_10cf_1094
+static const pciSubsystemInfo pci_ss_info_1023_9750_1014_9750 =
+ {0x1014, 0x9750, pci_subsys_1023_9750_1014_9750, 0};
+#undef pci_ss_info_1014_9750
+#define pci_ss_info_1014_9750 pci_ss_info_1023_9750_1014_9750
+static const pciSubsystemInfo pci_ss_info_1023_9750_1023_9750 =
+ {0x1023, 0x9750, pci_subsys_1023_9750_1023_9750, 0};
+#undef pci_ss_info_1023_9750
+#define pci_ss_info_1023_9750 pci_ss_info_1023_9750_1023_9750
+static const pciSubsystemInfo pci_ss_info_1023_9880_1023_9880 =
+ {0x1023, 0x9880, pci_subsys_1023_9880_1023_9880, 0};
+#undef pci_ss_info_1023_9880
+#define pci_ss_info_1023_9880 pci_ss_info_1023_9880_1023_9880
+static const pciSubsystemInfo pci_ss_info_1025_1521_10b9_1521 =
+ {0x10b9, 0x1521, pci_subsys_1025_1521_10b9_1521, 0};
+#undef pci_ss_info_10b9_1521
+#define pci_ss_info_10b9_1521 pci_ss_info_1025_1521_10b9_1521
+static const pciSubsystemInfo pci_ss_info_1025_1523_10b9_1523 =
+ {0x10b9, 0x1523, pci_subsys_1025_1523_10b9_1523, 0};
+#undef pci_ss_info_10b9_1523
+#define pci_ss_info_10b9_1523 pci_ss_info_1025_1523_10b9_1523
+static const pciSubsystemInfo pci_ss_info_1025_1533_10b9_1533 =
+ {0x10b9, 0x1533, pci_subsys_1025_1533_10b9_1533, 0};
+#undef pci_ss_info_10b9_1533
+#define pci_ss_info_10b9_1533 pci_ss_info_1025_1533_10b9_1533
+static const pciSubsystemInfo pci_ss_info_1025_1541_10b9_1541 =
+ {0x10b9, 0x1541, pci_subsys_1025_1541_10b9_1541, 0};
+#undef pci_ss_info_10b9_1541
+#define pci_ss_info_10b9_1541 pci_ss_info_1025_1541_10b9_1541
+static const pciSubsystemInfo pci_ss_info_1025_7101_10b9_7101 =
+ {0x10b9, 0x7101, pci_subsys_1025_7101_10b9_7101, 0};
+#undef pci_ss_info_10b9_7101
+#define pci_ss_info_10b9_7101 pci_ss_info_1025_7101_10b9_7101
+static const pciSubsystemInfo pci_ss_info_1028_0001_1028_0001 =
+ {0x1028, 0x0001, pci_subsys_1028_0001_1028_0001, 0};
+#undef pci_ss_info_1028_0001
+#define pci_ss_info_1028_0001 pci_ss_info_1028_0001_1028_0001
+static const pciSubsystemInfo pci_ss_info_1028_0002_1028_0002 =
+ {0x1028, 0x0002, pci_subsys_1028_0002_1028_0002, 0};
+#undef pci_ss_info_1028_0002
+#define pci_ss_info_1028_0002 pci_ss_info_1028_0002_1028_0002
+static const pciSubsystemInfo pci_ss_info_1028_0002_1028_00d1 =
+ {0x1028, 0x00d1, pci_subsys_1028_0002_1028_00d1, 0};
+#undef pci_ss_info_1028_00d1
+#define pci_ss_info_1028_00d1 pci_ss_info_1028_0002_1028_00d1
+static const pciSubsystemInfo pci_ss_info_1028_0002_1028_00d9 =
+ {0x1028, 0x00d9, pci_subsys_1028_0002_1028_00d9, 0};
+#undef pci_ss_info_1028_00d9
+#define pci_ss_info_1028_00d9 pci_ss_info_1028_0002_1028_00d9
+static const pciSubsystemInfo pci_ss_info_1028_0003_1028_0003 =
+ {0x1028, 0x0003, pci_subsys_1028_0003_1028_0003, 0};
+#undef pci_ss_info_1028_0003
+#define pci_ss_info_1028_0003 pci_ss_info_1028_0003_1028_0003
+static const pciSubsystemInfo pci_ss_info_1028_0004_1028_00d0 =
+ {0x1028, 0x00d0, pci_subsys_1028_0004_1028_00d0, 0};
+#undef pci_ss_info_1028_00d0
+#define pci_ss_info_1028_00d0 pci_ss_info_1028_0004_1028_00d0
+static const pciSubsystemInfo pci_ss_info_1028_000a_1028_0106 =
+ {0x1028, 0x0106, pci_subsys_1028_000a_1028_0106, 0};
+#undef pci_ss_info_1028_0106
+#define pci_ss_info_1028_0106 pci_ss_info_1028_000a_1028_0106
+static const pciSubsystemInfo pci_ss_info_1028_000a_1028_011b =
+ {0x1028, 0x011b, pci_subsys_1028_000a_1028_011b, 0};
+#undef pci_ss_info_1028_011b
+#define pci_ss_info_1028_011b pci_ss_info_1028_000a_1028_011b
+static const pciSubsystemInfo pci_ss_info_1028_000a_1028_0121 =
+ {0x1028, 0x0121, pci_subsys_1028_000a_1028_0121, 0};
+#undef pci_ss_info_1028_0121
+#define pci_ss_info_1028_0121 pci_ss_info_1028_000a_1028_0121
+static const pciSubsystemInfo pci_ss_info_102b_051a_102b_0100 =
+ {0x102b, 0x0100, pci_subsys_102b_051a_102b_0100, 0};
+#undef pci_ss_info_102b_0100
+#define pci_ss_info_102b_0100 pci_ss_info_102b_051a_102b_0100
+static const pciSubsystemInfo pci_ss_info_102b_051a_102b_1100 =
+ {0x102b, 0x1100, pci_subsys_102b_051a_102b_1100, 0};
+#undef pci_ss_info_102b_1100
+#define pci_ss_info_102b_1100 pci_ss_info_102b_051a_102b_1100
+static const pciSubsystemInfo pci_ss_info_102b_051a_102b_1200 =
+ {0x102b, 0x1200, pci_subsys_102b_051a_102b_1200, 0};
+#undef pci_ss_info_102b_1200
+#define pci_ss_info_102b_1200 pci_ss_info_102b_051a_102b_1200
+static const pciSubsystemInfo pci_ss_info_102b_051a_1100_102b =
+ {0x1100, 0x102b, pci_subsys_102b_051a_1100_102b, 0};
+#undef pci_ss_info_1100_102b
+#define pci_ss_info_1100_102b pci_ss_info_102b_051a_1100_102b
+static const pciSubsystemInfo pci_ss_info_102b_051a_110a_0018 =
+ {0x110a, 0x0018, pci_subsys_102b_051a_110a_0018, 0};
+#undef pci_ss_info_110a_0018
+#define pci_ss_info_110a_0018 pci_ss_info_102b_051a_110a_0018
+static const pciSubsystemInfo pci_ss_info_102b_051b_102b_051b =
+ {0x102b, 0x051b, pci_subsys_102b_051b_102b_051b, 0};
+#undef pci_ss_info_102b_051b
+#define pci_ss_info_102b_051b pci_ss_info_102b_051b_102b_051b
+static const pciSubsystemInfo pci_ss_info_102b_051b_102b_1100 =
+ {0x102b, 0x1100, pci_subsys_102b_051b_102b_1100, 0};
+#undef pci_ss_info_102b_1100
+#define pci_ss_info_102b_1100 pci_ss_info_102b_051b_102b_1100
+static const pciSubsystemInfo pci_ss_info_102b_051b_102b_1200 =
+ {0x102b, 0x1200, pci_subsys_102b_051b_102b_1200, 0};
+#undef pci_ss_info_102b_1200
+#define pci_ss_info_102b_1200 pci_ss_info_102b_051b_102b_1200
+static const pciSubsystemInfo pci_ss_info_102b_0520_102b_dbc2 =
+ {0x102b, 0xdbc2, pci_subsys_102b_0520_102b_dbc2, 0};
+#undef pci_ss_info_102b_dbc2
+#define pci_ss_info_102b_dbc2 pci_ss_info_102b_0520_102b_dbc2
+static const pciSubsystemInfo pci_ss_info_102b_0520_102b_dbc8 =
+ {0x102b, 0xdbc8, pci_subsys_102b_0520_102b_dbc8, 0};
+#undef pci_ss_info_102b_dbc8
+#define pci_ss_info_102b_dbc8 pci_ss_info_102b_0520_102b_dbc8
+static const pciSubsystemInfo pci_ss_info_102b_0520_102b_dbe2 =
+ {0x102b, 0xdbe2, pci_subsys_102b_0520_102b_dbe2, 0};
+#undef pci_ss_info_102b_dbe2
+#define pci_ss_info_102b_dbe2 pci_ss_info_102b_0520_102b_dbe2
+static const pciSubsystemInfo pci_ss_info_102b_0520_102b_dbe8 =
+ {0x102b, 0xdbe8, pci_subsys_102b_0520_102b_dbe8, 0};
+#undef pci_ss_info_102b_dbe8
+#define pci_ss_info_102b_dbe8 pci_ss_info_102b_0520_102b_dbe8
+static const pciSubsystemInfo pci_ss_info_102b_0520_102b_ff03 =
+ {0x102b, 0xff03, pci_subsys_102b_0520_102b_ff03, 0};
+#undef pci_ss_info_102b_ff03
+#define pci_ss_info_102b_ff03 pci_ss_info_102b_0520_102b_ff03
+static const pciSubsystemInfo pci_ss_info_102b_0520_102b_ff04 =
+ {0x102b, 0xff04, pci_subsys_102b_0520_102b_ff04, 0};
+#undef pci_ss_info_102b_ff04
+#define pci_ss_info_102b_ff04 pci_ss_info_102b_0520_102b_ff04
+static const pciSubsystemInfo pci_ss_info_102b_0521_1014_ff03 =
+ {0x1014, 0xff03, pci_subsys_102b_0521_1014_ff03, 0};
+#undef pci_ss_info_1014_ff03
+#define pci_ss_info_1014_ff03 pci_ss_info_102b_0521_1014_ff03
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_48e9 =
+ {0x102b, 0x48e9, pci_subsys_102b_0521_102b_48e9, 0};
+#undef pci_ss_info_102b_48e9
+#define pci_ss_info_102b_48e9 pci_ss_info_102b_0521_102b_48e9
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_48f8 =
+ {0x102b, 0x48f8, pci_subsys_102b_0521_102b_48f8, 0};
+#undef pci_ss_info_102b_48f8
+#define pci_ss_info_102b_48f8 pci_ss_info_102b_0521_102b_48f8
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_4a60 =
+ {0x102b, 0x4a60, pci_subsys_102b_0521_102b_4a60, 0};
+#undef pci_ss_info_102b_4a60
+#define pci_ss_info_102b_4a60 pci_ss_info_102b_0521_102b_4a60
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_4a64 =
+ {0x102b, 0x4a64, pci_subsys_102b_0521_102b_4a64, 0};
+#undef pci_ss_info_102b_4a64
+#define pci_ss_info_102b_4a64 pci_ss_info_102b_0521_102b_4a64
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_c93c =
+ {0x102b, 0xc93c, pci_subsys_102b_0521_102b_c93c, 0};
+#undef pci_ss_info_102b_c93c
+#define pci_ss_info_102b_c93c pci_ss_info_102b_0521_102b_c93c
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_c9b0 =
+ {0x102b, 0xc9b0, pci_subsys_102b_0521_102b_c9b0, 0};
+#undef pci_ss_info_102b_c9b0
+#define pci_ss_info_102b_c9b0 pci_ss_info_102b_0521_102b_c9b0
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_c9bc =
+ {0x102b, 0xc9bc, pci_subsys_102b_0521_102b_c9bc, 0};
+#undef pci_ss_info_102b_c9bc
+#define pci_ss_info_102b_c9bc pci_ss_info_102b_0521_102b_c9bc
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ca60 =
+ {0x102b, 0xca60, pci_subsys_102b_0521_102b_ca60, 0};
+#undef pci_ss_info_102b_ca60
+#define pci_ss_info_102b_ca60 pci_ss_info_102b_0521_102b_ca60
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ca6c =
+ {0x102b, 0xca6c, pci_subsys_102b_0521_102b_ca6c, 0};
+#undef pci_ss_info_102b_ca6c
+#define pci_ss_info_102b_ca6c pci_ss_info_102b_0521_102b_ca6c
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbbc =
+ {0x102b, 0xdbbc, pci_subsys_102b_0521_102b_dbbc, 0};
+#undef pci_ss_info_102b_dbbc
+#define pci_ss_info_102b_dbbc pci_ss_info_102b_0521_102b_dbbc
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbc2 =
+ {0x102b, 0xdbc2, pci_subsys_102b_0521_102b_dbc2, 0};
+#undef pci_ss_info_102b_dbc2
+#define pci_ss_info_102b_dbc2 pci_ss_info_102b_0521_102b_dbc2
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbc3 =
+ {0x102b, 0xdbc3, pci_subsys_102b_0521_102b_dbc3, 0};
+#undef pci_ss_info_102b_dbc3
+#define pci_ss_info_102b_dbc3 pci_ss_info_102b_0521_102b_dbc3
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbc8 =
+ {0x102b, 0xdbc8, pci_subsys_102b_0521_102b_dbc8, 0};
+#undef pci_ss_info_102b_dbc8
+#define pci_ss_info_102b_dbc8 pci_ss_info_102b_0521_102b_dbc8
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd2 =
+ {0x102b, 0xdbd2, pci_subsys_102b_0521_102b_dbd2, 0};
+#undef pci_ss_info_102b_dbd2
+#define pci_ss_info_102b_dbd2 pci_ss_info_102b_0521_102b_dbd2
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd3 =
+ {0x102b, 0xdbd3, pci_subsys_102b_0521_102b_dbd3, 0};
+#undef pci_ss_info_102b_dbd3
+#define pci_ss_info_102b_dbd3 pci_ss_info_102b_0521_102b_dbd3
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd4 =
+ {0x102b, 0xdbd4, pci_subsys_102b_0521_102b_dbd4, 0};
+#undef pci_ss_info_102b_dbd4
+#define pci_ss_info_102b_dbd4 pci_ss_info_102b_0521_102b_dbd4
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd5 =
+ {0x102b, 0xdbd5, pci_subsys_102b_0521_102b_dbd5, 0};
+#undef pci_ss_info_102b_dbd5
+#define pci_ss_info_102b_dbd5 pci_ss_info_102b_0521_102b_dbd5
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd8 =
+ {0x102b, 0xdbd8, pci_subsys_102b_0521_102b_dbd8, 0};
+#undef pci_ss_info_102b_dbd8
+#define pci_ss_info_102b_dbd8 pci_ss_info_102b_0521_102b_dbd8
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbd9 =
+ {0x102b, 0xdbd9, pci_subsys_102b_0521_102b_dbd9, 0};
+#undef pci_ss_info_102b_dbd9
+#define pci_ss_info_102b_dbd9 pci_ss_info_102b_0521_102b_dbd9
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbe2 =
+ {0x102b, 0xdbe2, pci_subsys_102b_0521_102b_dbe2, 0};
+#undef pci_ss_info_102b_dbe2
+#define pci_ss_info_102b_dbe2 pci_ss_info_102b_0521_102b_dbe2
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbe3 =
+ {0x102b, 0xdbe3, pci_subsys_102b_0521_102b_dbe3, 0};
+#undef pci_ss_info_102b_dbe3
+#define pci_ss_info_102b_dbe3 pci_ss_info_102b_0521_102b_dbe3
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbe8 =
+ {0x102b, 0xdbe8, pci_subsys_102b_0521_102b_dbe8, 0};
+#undef pci_ss_info_102b_dbe8
+#define pci_ss_info_102b_dbe8 pci_ss_info_102b_0521_102b_dbe8
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf2 =
+ {0x102b, 0xdbf2, pci_subsys_102b_0521_102b_dbf2, 0};
+#undef pci_ss_info_102b_dbf2
+#define pci_ss_info_102b_dbf2 pci_ss_info_102b_0521_102b_dbf2
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf3 =
+ {0x102b, 0xdbf3, pci_subsys_102b_0521_102b_dbf3, 0};
+#undef pci_ss_info_102b_dbf3
+#define pci_ss_info_102b_dbf3 pci_ss_info_102b_0521_102b_dbf3
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf4 =
+ {0x102b, 0xdbf4, pci_subsys_102b_0521_102b_dbf4, 0};
+#undef pci_ss_info_102b_dbf4
+#define pci_ss_info_102b_dbf4 pci_ss_info_102b_0521_102b_dbf4
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf5 =
+ {0x102b, 0xdbf5, pci_subsys_102b_0521_102b_dbf5, 0};
+#undef pci_ss_info_102b_dbf5
+#define pci_ss_info_102b_dbf5 pci_ss_info_102b_0521_102b_dbf5
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf8 =
+ {0x102b, 0xdbf8, pci_subsys_102b_0521_102b_dbf8, 0};
+#undef pci_ss_info_102b_dbf8
+#define pci_ss_info_102b_dbf8 pci_ss_info_102b_0521_102b_dbf8
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_dbf9 =
+ {0x102b, 0xdbf9, pci_subsys_102b_0521_102b_dbf9, 0};
+#undef pci_ss_info_102b_dbf9
+#define pci_ss_info_102b_dbf9 pci_ss_info_102b_0521_102b_dbf9
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_f806 =
+ {0x102b, 0xf806, pci_subsys_102b_0521_102b_f806, 0};
+#undef pci_ss_info_102b_f806
+#define pci_ss_info_102b_f806 pci_ss_info_102b_0521_102b_f806
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ff00 =
+ {0x102b, 0xff00, pci_subsys_102b_0521_102b_ff00, 0};
+#undef pci_ss_info_102b_ff00
+#define pci_ss_info_102b_ff00 pci_ss_info_102b_0521_102b_ff00
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ff02 =
+ {0x102b, 0xff02, pci_subsys_102b_0521_102b_ff02, 0};
+#undef pci_ss_info_102b_ff02
+#define pci_ss_info_102b_ff02 pci_ss_info_102b_0521_102b_ff02
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ff03 =
+ {0x102b, 0xff03, pci_subsys_102b_0521_102b_ff03, 0};
+#undef pci_ss_info_102b_ff03
+#define pci_ss_info_102b_ff03 pci_ss_info_102b_0521_102b_ff03
+static const pciSubsystemInfo pci_ss_info_102b_0521_102b_ff04 =
+ {0x102b, 0xff04, pci_subsys_102b_0521_102b_ff04, 0};
+#undef pci_ss_info_102b_ff04
+#define pci_ss_info_102b_ff04 pci_ss_info_102b_0521_102b_ff04
+static const pciSubsystemInfo pci_ss_info_102b_0521_110a_0032 =
+ {0x110a, 0x0032, pci_subsys_102b_0521_110a_0032, 0};
+#undef pci_ss_info_110a_0032
+#define pci_ss_info_110a_0032 pci_ss_info_102b_0521_110a_0032
+static const pciSubsystemInfo pci_ss_info_102b_0525_0e11_b16f =
+ {0x0e11, 0xb16f, pci_subsys_102b_0525_0e11_b16f, 0};
+#undef pci_ss_info_0e11_b16f
+#define pci_ss_info_0e11_b16f pci_ss_info_102b_0525_0e11_b16f
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0328 =
+ {0x102b, 0x0328, pci_subsys_102b_0525_102b_0328, 0};
+#undef pci_ss_info_102b_0328
+#define pci_ss_info_102b_0328 pci_ss_info_102b_0525_102b_0328
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0338 =
+ {0x102b, 0x0338, pci_subsys_102b_0525_102b_0338, 0};
+#undef pci_ss_info_102b_0338
+#define pci_ss_info_102b_0338 pci_ss_info_102b_0525_102b_0338
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0378 =
+ {0x102b, 0x0378, pci_subsys_102b_0525_102b_0378, 0};
+#undef pci_ss_info_102b_0378
+#define pci_ss_info_102b_0378 pci_ss_info_102b_0525_102b_0378
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0541 =
+ {0x102b, 0x0541, pci_subsys_102b_0525_102b_0541, 0};
+#undef pci_ss_info_102b_0541
+#define pci_ss_info_102b_0541 pci_ss_info_102b_0525_102b_0541
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0542 =
+ {0x102b, 0x0542, pci_subsys_102b_0525_102b_0542, 0};
+#undef pci_ss_info_102b_0542
+#define pci_ss_info_102b_0542 pci_ss_info_102b_0525_102b_0542
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0543 =
+ {0x102b, 0x0543, pci_subsys_102b_0525_102b_0543, 0};
+#undef pci_ss_info_102b_0543
+#define pci_ss_info_102b_0543 pci_ss_info_102b_0525_102b_0543
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0641 =
+ {0x102b, 0x0641, pci_subsys_102b_0525_102b_0641, 0};
+#undef pci_ss_info_102b_0641
+#define pci_ss_info_102b_0641 pci_ss_info_102b_0525_102b_0641
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0642 =
+ {0x102b, 0x0642, pci_subsys_102b_0525_102b_0642, 0};
+#undef pci_ss_info_102b_0642
+#define pci_ss_info_102b_0642 pci_ss_info_102b_0525_102b_0642
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0643 =
+ {0x102b, 0x0643, pci_subsys_102b_0525_102b_0643, 0};
+#undef pci_ss_info_102b_0643
+#define pci_ss_info_102b_0643 pci_ss_info_102b_0525_102b_0643
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_07c0 =
+ {0x102b, 0x07c0, pci_subsys_102b_0525_102b_07c0, 0};
+#undef pci_ss_info_102b_07c0
+#define pci_ss_info_102b_07c0 pci_ss_info_102b_0525_102b_07c0
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_07c1 =
+ {0x102b, 0x07c1, pci_subsys_102b_0525_102b_07c1, 0};
+#undef pci_ss_info_102b_07c1
+#define pci_ss_info_102b_07c1 pci_ss_info_102b_0525_102b_07c1
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0d41 =
+ {0x102b, 0x0d41, pci_subsys_102b_0525_102b_0d41, 0};
+#undef pci_ss_info_102b_0d41
+#define pci_ss_info_102b_0d41 pci_ss_info_102b_0525_102b_0d41
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0d42 =
+ {0x102b, 0x0d42, pci_subsys_102b_0525_102b_0d42, 0};
+#undef pci_ss_info_102b_0d42
+#define pci_ss_info_102b_0d42 pci_ss_info_102b_0525_102b_0d42
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0e00 =
+ {0x102b, 0x0e00, pci_subsys_102b_0525_102b_0e00, 0};
+#undef pci_ss_info_102b_0e00
+#define pci_ss_info_102b_0e00 pci_ss_info_102b_0525_102b_0e00
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0e01 =
+ {0x102b, 0x0e01, pci_subsys_102b_0525_102b_0e01, 0};
+#undef pci_ss_info_102b_0e01
+#define pci_ss_info_102b_0e01 pci_ss_info_102b_0525_102b_0e01
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0e02 =
+ {0x102b, 0x0e02, pci_subsys_102b_0525_102b_0e02, 0};
+#undef pci_ss_info_102b_0e02
+#define pci_ss_info_102b_0e02 pci_ss_info_102b_0525_102b_0e02
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0e03 =
+ {0x102b, 0x0e03, pci_subsys_102b_0525_102b_0e03, 0};
+#undef pci_ss_info_102b_0e03
+#define pci_ss_info_102b_0e03 pci_ss_info_102b_0525_102b_0e03
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0f80 =
+ {0x102b, 0x0f80, pci_subsys_102b_0525_102b_0f80, 0};
+#undef pci_ss_info_102b_0f80
+#define pci_ss_info_102b_0f80 pci_ss_info_102b_0525_102b_0f80
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0f81 =
+ {0x102b, 0x0f81, pci_subsys_102b_0525_102b_0f81, 0};
+#undef pci_ss_info_102b_0f81
+#define pci_ss_info_102b_0f81 pci_ss_info_102b_0525_102b_0f81
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0f82 =
+ {0x102b, 0x0f82, pci_subsys_102b_0525_102b_0f82, 0};
+#undef pci_ss_info_102b_0f82
+#define pci_ss_info_102b_0f82 pci_ss_info_102b_0525_102b_0f82
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_0f83 =
+ {0x102b, 0x0f83, pci_subsys_102b_0525_102b_0f83, 0};
+#undef pci_ss_info_102b_0f83
+#define pci_ss_info_102b_0f83 pci_ss_info_102b_0525_102b_0f83
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_19d8 =
+ {0x102b, 0x19d8, pci_subsys_102b_0525_102b_19d8, 0};
+#undef pci_ss_info_102b_19d8
+#define pci_ss_info_102b_19d8 pci_ss_info_102b_0525_102b_19d8
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_19f8 =
+ {0x102b, 0x19f8, pci_subsys_102b_0525_102b_19f8, 0};
+#undef pci_ss_info_102b_19f8
+#define pci_ss_info_102b_19f8 pci_ss_info_102b_0525_102b_19f8
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_2159 =
+ {0x102b, 0x2159, pci_subsys_102b_0525_102b_2159, 0};
+#undef pci_ss_info_102b_2159
+#define pci_ss_info_102b_2159 pci_ss_info_102b_0525_102b_2159
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_2179 =
+ {0x102b, 0x2179, pci_subsys_102b_0525_102b_2179, 0};
+#undef pci_ss_info_102b_2179
+#define pci_ss_info_102b_2179 pci_ss_info_102b_0525_102b_2179
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_217d =
+ {0x102b, 0x217d, pci_subsys_102b_0525_102b_217d, 0};
+#undef pci_ss_info_102b_217d
+#define pci_ss_info_102b_217d pci_ss_info_102b_0525_102b_217d
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_23c0 =
+ {0x102b, 0x23c0, pci_subsys_102b_0525_102b_23c0, 0};
+#undef pci_ss_info_102b_23c0
+#define pci_ss_info_102b_23c0 pci_ss_info_102b_0525_102b_23c0
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_23c1 =
+ {0x102b, 0x23c1, pci_subsys_102b_0525_102b_23c1, 0};
+#undef pci_ss_info_102b_23c1
+#define pci_ss_info_102b_23c1 pci_ss_info_102b_0525_102b_23c1
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_23c2 =
+ {0x102b, 0x23c2, pci_subsys_102b_0525_102b_23c2, 0};
+#undef pci_ss_info_102b_23c2
+#define pci_ss_info_102b_23c2 pci_ss_info_102b_0525_102b_23c2
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_23c3 =
+ {0x102b, 0x23c3, pci_subsys_102b_0525_102b_23c3, 0};
+#undef pci_ss_info_102b_23c3
+#define pci_ss_info_102b_23c3 pci_ss_info_102b_0525_102b_23c3
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_2f58 =
+ {0x102b, 0x2f58, pci_subsys_102b_0525_102b_2f58, 0};
+#undef pci_ss_info_102b_2f58
+#define pci_ss_info_102b_2f58 pci_ss_info_102b_0525_102b_2f58
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_2f78 =
+ {0x102b, 0x2f78, pci_subsys_102b_0525_102b_2f78, 0};
+#undef pci_ss_info_102b_2f78
+#define pci_ss_info_102b_2f78 pci_ss_info_102b_0525_102b_2f78
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_3693 =
+ {0x102b, 0x3693, pci_subsys_102b_0525_102b_3693, 0};
+#undef pci_ss_info_102b_3693
+#define pci_ss_info_102b_3693 pci_ss_info_102b_0525_102b_3693
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_5dd0 =
+ {0x102b, 0x5dd0, pci_subsys_102b_0525_102b_5dd0, 0};
+#undef pci_ss_info_102b_5dd0
+#define pci_ss_info_102b_5dd0 pci_ss_info_102b_0525_102b_5dd0
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_5f50 =
+ {0x102b, 0x5f50, pci_subsys_102b_0525_102b_5f50, 0};
+#undef pci_ss_info_102b_5f50
+#define pci_ss_info_102b_5f50 pci_ss_info_102b_0525_102b_5f50
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_5f51 =
+ {0x102b, 0x5f51, pci_subsys_102b_0525_102b_5f51, 0};
+#undef pci_ss_info_102b_5f51
+#define pci_ss_info_102b_5f51 pci_ss_info_102b_0525_102b_5f51
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_5f52 =
+ {0x102b, 0x5f52, pci_subsys_102b_0525_102b_5f52, 0};
+#undef pci_ss_info_102b_5f52
+#define pci_ss_info_102b_5f52 pci_ss_info_102b_0525_102b_5f52
+static const pciSubsystemInfo pci_ss_info_102b_0525_102b_9010 =
+ {0x102b, 0x9010, pci_subsys_102b_0525_102b_9010, 0};
+#undef pci_ss_info_102b_9010
+#define pci_ss_info_102b_9010 pci_ss_info_102b_0525_102b_9010
+static const pciSubsystemInfo pci_ss_info_102b_0525_1458_0400 =
+ {0x1458, 0x0400, pci_subsys_102b_0525_1458_0400, 0};
+#undef pci_ss_info_1458_0400
+#define pci_ss_info_1458_0400 pci_ss_info_102b_0525_1458_0400
+static const pciSubsystemInfo pci_ss_info_102b_0525_1705_0001 =
+ {0x1705, 0x0001, pci_subsys_102b_0525_1705_0001, 0};
+#undef pci_ss_info_1705_0001
+#define pci_ss_info_1705_0001 pci_ss_info_102b_0525_1705_0001
+static const pciSubsystemInfo pci_ss_info_102b_0525_1705_0002 =
+ {0x1705, 0x0002, pci_subsys_102b_0525_1705_0002, 0};
+#undef pci_ss_info_1705_0002
+#define pci_ss_info_1705_0002 pci_ss_info_102b_0525_1705_0002
+static const pciSubsystemInfo pci_ss_info_102b_0525_1705_0003 =
+ {0x1705, 0x0003, pci_subsys_102b_0525_1705_0003, 0};
+#undef pci_ss_info_1705_0003
+#define pci_ss_info_1705_0003 pci_ss_info_102b_0525_1705_0003
+static const pciSubsystemInfo pci_ss_info_102b_0525_1705_0004 =
+ {0x1705, 0x0004, pci_subsys_102b_0525_1705_0004, 0};
+#undef pci_ss_info_1705_0004
+#define pci_ss_info_1705_0004 pci_ss_info_102b_0525_1705_0004
+static const pciSubsystemInfo pci_ss_info_102b_0527_102b_0840 =
+ {0x102b, 0x0840, pci_subsys_102b_0527_102b_0840, 0};
+#undef pci_ss_info_102b_0840
+#define pci_ss_info_102b_0840 pci_ss_info_102b_0527_102b_0840
+static const pciSubsystemInfo pci_ss_info_102b_1000_102b_ff01 =
+ {0x102b, 0xff01, pci_subsys_102b_1000_102b_ff01, 0};
+#undef pci_ss_info_102b_ff01
+#define pci_ss_info_102b_ff01 pci_ss_info_102b_1000_102b_ff01
+static const pciSubsystemInfo pci_ss_info_102b_1000_102b_ff05 =
+ {0x102b, 0xff05, pci_subsys_102b_1000_102b_ff05, 0};
+#undef pci_ss_info_102b_ff05
+#define pci_ss_info_102b_ff05 pci_ss_info_102b_1000_102b_ff05
+static const pciSubsystemInfo pci_ss_info_102b_1001_102b_1001 =
+ {0x102b, 0x1001, pci_subsys_102b_1001_102b_1001, 0};
+#undef pci_ss_info_102b_1001
+#define pci_ss_info_102b_1001 pci_ss_info_102b_1001_102b_1001
+static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff00 =
+ {0x102b, 0xff00, pci_subsys_102b_1001_102b_ff00, 0};
+#undef pci_ss_info_102b_ff00
+#define pci_ss_info_102b_ff00 pci_ss_info_102b_1001_102b_ff00
+static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff01 =
+ {0x102b, 0xff01, pci_subsys_102b_1001_102b_ff01, 0};
+#undef pci_ss_info_102b_ff01
+#define pci_ss_info_102b_ff01 pci_ss_info_102b_1001_102b_ff01
+static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff03 =
+ {0x102b, 0xff03, pci_subsys_102b_1001_102b_ff03, 0};
+#undef pci_ss_info_102b_ff03
+#define pci_ss_info_102b_ff03 pci_ss_info_102b_1001_102b_ff03
+static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff04 =
+ {0x102b, 0xff04, pci_subsys_102b_1001_102b_ff04, 0};
+#undef pci_ss_info_102b_ff04
+#define pci_ss_info_102b_ff04 pci_ss_info_102b_1001_102b_ff04
+static const pciSubsystemInfo pci_ss_info_102b_1001_102b_ff05 =
+ {0x102b, 0xff05, pci_subsys_102b_1001_102b_ff05, 0};
+#undef pci_ss_info_102b_ff05
+#define pci_ss_info_102b_ff05 pci_ss_info_102b_1001_102b_ff05
+static const pciSubsystemInfo pci_ss_info_102b_1001_110a_001e =
+ {0x110a, 0x001e, pci_subsys_102b_1001_110a_001e, 0};
+#undef pci_ss_info_110a_001e
+#define pci_ss_info_110a_001e pci_ss_info_102b_1001_110a_001e
+static const pciSubsystemInfo pci_ss_info_102b_2527_102b_0f83 =
+ {0x102b, 0x0f83, pci_subsys_102b_2527_102b_0f83, 0};
+#undef pci_ss_info_102b_0f83
+#define pci_ss_info_102b_0f83 pci_ss_info_102b_2527_102b_0f83
+static const pciSubsystemInfo pci_ss_info_102b_2527_102b_0f84 =
+ {0x102b, 0x0f84, pci_subsys_102b_2527_102b_0f84, 0};
+#undef pci_ss_info_102b_0f84
+#define pci_ss_info_102b_0f84 pci_ss_info_102b_2527_102b_0f84
+static const pciSubsystemInfo pci_ss_info_102b_2527_102b_1e41 =
+ {0x102b, 0x1e41, pci_subsys_102b_2527_102b_1e41, 0};
+#undef pci_ss_info_102b_1e41
+#define pci_ss_info_102b_1e41 pci_ss_info_102b_2527_102b_1e41
+static const pciSubsystemInfo pci_ss_info_102c_00c0_102c_00c0 =
+ {0x102c, 0x00c0, pci_subsys_102c_00c0_102c_00c0, 0};
+#undef pci_ss_info_102c_00c0
+#define pci_ss_info_102c_00c0 pci_ss_info_102c_00c0_102c_00c0
+static const pciSubsystemInfo pci_ss_info_102c_00e5_0e11_b049 =
+ {0x0e11, 0xb049, pci_subsys_102c_00e5_0e11_b049, 0};
+#undef pci_ss_info_0e11_b049
+#define pci_ss_info_0e11_b049 pci_ss_info_102c_00e5_0e11_b049
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_102f_0020_102f_00f8 =
+ {0x102f, 0x00f8, pci_subsys_102f_0020_102f_00f8, 0};
+#undef pci_ss_info_102f_00f8
+#define pci_ss_info_102f_00f8 pci_ss_info_102f_0020_102f_00f8
+#endif
+static const pciSubsystemInfo pci_ss_info_1033_0035_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1033_0035_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1033_0035_1179_0001
+static const pciSubsystemInfo pci_ss_info_1033_0035_12ee_7000 =
+ {0x12ee, 0x7000, pci_subsys_1033_0035_12ee_7000, 0};
+#undef pci_ss_info_12ee_7000
+#define pci_ss_info_12ee_7000 pci_ss_info_1033_0035_12ee_7000
+static const pciSubsystemInfo pci_ss_info_1033_0035_1799_0001 =
+ {0x1799, 0x0001, pci_subsys_1033_0035_1799_0001, 0};
+#undef pci_ss_info_1799_0001
+#define pci_ss_info_1799_0001 pci_ss_info_1033_0035_1799_0001
+static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0020 =
+ {0x1010, 0x0020, pci_subsys_1033_0067_1010_0020, 0};
+#undef pci_ss_info_1010_0020
+#define pci_ss_info_1010_0020 pci_ss_info_1033_0067_1010_0020
+static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0080 =
+ {0x1010, 0x0080, pci_subsys_1033_0067_1010_0080, 0};
+#undef pci_ss_info_1010_0080
+#define pci_ss_info_1010_0080 pci_ss_info_1033_0067_1010_0080
+static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0088 =
+ {0x1010, 0x0088, pci_subsys_1033_0067_1010_0088, 0};
+#undef pci_ss_info_1010_0088
+#define pci_ss_info_1010_0088 pci_ss_info_1033_0067_1010_0088
+static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0090 =
+ {0x1010, 0x0090, pci_subsys_1033_0067_1010_0090, 0};
+#undef pci_ss_info_1010_0090
+#define pci_ss_info_1010_0090 pci_ss_info_1033_0067_1010_0090
+static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0098 =
+ {0x1010, 0x0098, pci_subsys_1033_0067_1010_0098, 0};
+#undef pci_ss_info_1010_0098
+#define pci_ss_info_1010_0098 pci_ss_info_1033_0067_1010_0098
+static const pciSubsystemInfo pci_ss_info_1033_0067_1010_00a0 =
+ {0x1010, 0x00a0, pci_subsys_1033_0067_1010_00a0, 0};
+#undef pci_ss_info_1010_00a0
+#define pci_ss_info_1010_00a0 pci_ss_info_1033_0067_1010_00a0
+static const pciSubsystemInfo pci_ss_info_1033_0067_1010_00a8 =
+ {0x1010, 0x00a8, pci_subsys_1033_0067_1010_00a8, 0};
+#undef pci_ss_info_1010_00a8
+#define pci_ss_info_1010_00a8 pci_ss_info_1033_0067_1010_00a8
+static const pciSubsystemInfo pci_ss_info_1033_0067_1010_0120 =
+ {0x1010, 0x0120, pci_subsys_1033_0067_1010_0120, 0};
+#undef pci_ss_info_1010_0120
+#define pci_ss_info_1010_0120 pci_ss_info_1033_0067_1010_0120
+static const pciSubsystemInfo pci_ss_info_1033_0074_1033_8014 =
+ {0x1033, 0x8014, pci_subsys_1033_0074_1033_8014, 0};
+#undef pci_ss_info_1033_8014
+#define pci_ss_info_1033_8014 pci_ss_info_1033_0074_1033_8014
+static const pciSubsystemInfo pci_ss_info_1033_00cd_12ee_8011 =
+ {0x12ee, 0x8011, pci_subsys_1033_00cd_12ee_8011, 0};
+#undef pci_ss_info_12ee_8011
+#define pci_ss_info_12ee_8011 pci_ss_info_1033_00cd_12ee_8011
+static const pciSubsystemInfo pci_ss_info_1033_00e0_12ee_7001 =
+ {0x12ee, 0x7001, pci_subsys_1033_00e0_12ee_7001, 0};
+#undef pci_ss_info_12ee_7001
+#define pci_ss_info_12ee_7001 pci_ss_info_1033_00e0_12ee_7001
+static const pciSubsystemInfo pci_ss_info_1033_00e0_1799_0002 =
+ {0x1799, 0x0002, pci_subsys_1033_00e0_1799_0002, 0};
+#undef pci_ss_info_1799_0002
+#define pci_ss_info_1799_0002 pci_ss_info_1033_00e0_1799_0002
+static const pciSubsystemInfo pci_ss_info_1039_0200_1039_0000 =
+ {0x1039, 0x0000, pci_subsys_1039_0200_1039_0000, 0};
+#undef pci_ss_info_1039_0000
+#define pci_ss_info_1039_0000 pci_ss_info_1039_0200_1039_0000
+static const pciSubsystemInfo pci_ss_info_1039_0300_107d_2720 =
+ {0x107d, 0x2720, pci_subsys_1039_0300_107d_2720, 0};
+#undef pci_ss_info_107d_2720
+#define pci_ss_info_107d_2720 pci_ss_info_1039_0300_107d_2720
+static const pciSubsystemInfo pci_ss_info_1039_0900_1039_0900 =
+ {0x1039, 0x0900, pci_subsys_1039_0900_1039_0900, 0};
+#undef pci_ss_info_1039_0900
+#define pci_ss_info_1039_0900 pci_ss_info_1039_0900_1039_0900
+static const pciSubsystemInfo pci_ss_info_1039_5513_1019_0970 =
+ {0x1019, 0x0970, pci_subsys_1039_5513_1019_0970, 0};
+#undef pci_ss_info_1019_0970
+#define pci_ss_info_1019_0970 pci_ss_info_1039_5513_1019_0970
+static const pciSubsystemInfo pci_ss_info_1039_5513_1039_5513 =
+ {0x1039, 0x5513, pci_subsys_1039_5513_1039_5513, 0};
+#undef pci_ss_info_1039_5513
+#define pci_ss_info_1039_5513 pci_ss_info_1039_5513_1039_5513
+static const pciSubsystemInfo pci_ss_info_1039_6300_1019_0970 =
+ {0x1019, 0x0970, pci_subsys_1039_6300_1019_0970, 0};
+#undef pci_ss_info_1019_0970
+#define pci_ss_info_1019_0970 pci_ss_info_1039_6300_1019_0970
+static const pciSubsystemInfo pci_ss_info_1039_6306_1039_6306 =
+ {0x1039, 0x6306, pci_subsys_1039_6306_1039_6306, 0};
+#undef pci_ss_info_1039_6306
+#define pci_ss_info_1039_6306 pci_ss_info_1039_6306_1039_6306
+static const pciSubsystemInfo pci_ss_info_1039_6326_1039_6326 =
+ {0x1039, 0x6326, pci_subsys_1039_6326_1039_6326, 0};
+#undef pci_ss_info_1039_6326
+#define pci_ss_info_1039_6326 pci_ss_info_1039_6326_1039_6326
+static const pciSubsystemInfo pci_ss_info_1039_6326_1092_0a50 =
+ {0x1092, 0x0a50, pci_subsys_1039_6326_1092_0a50, 0};
+#undef pci_ss_info_1092_0a50
+#define pci_ss_info_1092_0a50 pci_ss_info_1039_6326_1092_0a50
+static const pciSubsystemInfo pci_ss_info_1039_6326_1092_0a70 =
+ {0x1092, 0x0a70, pci_subsys_1039_6326_1092_0a70, 0};
+#undef pci_ss_info_1092_0a70
+#define pci_ss_info_1092_0a70 pci_ss_info_1039_6326_1092_0a70
+static const pciSubsystemInfo pci_ss_info_1039_6326_1092_4910 =
+ {0x1092, 0x4910, pci_subsys_1039_6326_1092_4910, 0};
+#undef pci_ss_info_1092_4910
+#define pci_ss_info_1092_4910 pci_ss_info_1039_6326_1092_4910
+static const pciSubsystemInfo pci_ss_info_1039_6326_1092_4920 =
+ {0x1092, 0x4920, pci_subsys_1039_6326_1092_4920, 0};
+#undef pci_ss_info_1092_4920
+#define pci_ss_info_1092_4920 pci_ss_info_1039_6326_1092_4920
+static const pciSubsystemInfo pci_ss_info_1039_6326_1569_6326 =
+ {0x1569, 0x6326, pci_subsys_1039_6326_1569_6326, 0};
+#undef pci_ss_info_1569_6326
+#define pci_ss_info_1569_6326 pci_ss_info_1039_6326_1569_6326
+static const pciSubsystemInfo pci_ss_info_1039_7001_1039_7000 =
+ {0x1039, 0x7000, pci_subsys_1039_7001_1039_7000, 0};
+#undef pci_ss_info_1039_7000
+#define pci_ss_info_1039_7000 pci_ss_info_1039_7001_1039_7000
+static const pciSubsystemInfo pci_ss_info_1039_7002_1509_7002 =
+ {0x1509, 0x7002, pci_subsys_1039_7002_1509_7002, 0};
+#undef pci_ss_info_1509_7002
+#define pci_ss_info_1509_7002 pci_ss_info_1039_7002_1509_7002
+static const pciSubsystemInfo pci_ss_info_1039_7016_1039_7016 =
+ {0x1039, 0x7016, pci_subsys_1039_7016_1039_7016, 0};
+#undef pci_ss_info_1039_7016
+#define pci_ss_info_1039_7016 pci_ss_info_1039_7016_1039_7016
+static const pciSubsystemInfo pci_ss_info_1039_7018_1014_01b6 =
+ {0x1014, 0x01b6, pci_subsys_1039_7018_1014_01b6, 0};
+#undef pci_ss_info_1014_01b6
+#define pci_ss_info_1014_01b6 pci_ss_info_1039_7018_1014_01b6
+static const pciSubsystemInfo pci_ss_info_1039_7018_1014_01b7 =
+ {0x1014, 0x01b7, pci_subsys_1039_7018_1014_01b7, 0};
+#undef pci_ss_info_1014_01b7
+#define pci_ss_info_1014_01b7 pci_ss_info_1039_7018_1014_01b7
+static const pciSubsystemInfo pci_ss_info_1039_7018_1019_7018 =
+ {0x1019, 0x7018, pci_subsys_1039_7018_1019_7018, 0};
+#undef pci_ss_info_1019_7018
+#define pci_ss_info_1019_7018 pci_ss_info_1039_7018_1019_7018
+static const pciSubsystemInfo pci_ss_info_1039_7018_1025_000e =
+ {0x1025, 0x000e, pci_subsys_1039_7018_1025_000e, 0};
+#undef pci_ss_info_1025_000e
+#define pci_ss_info_1025_000e pci_ss_info_1039_7018_1025_000e
+static const pciSubsystemInfo pci_ss_info_1039_7018_1025_0018 =
+ {0x1025, 0x0018, pci_subsys_1039_7018_1025_0018, 0};
+#undef pci_ss_info_1025_0018
+#define pci_ss_info_1025_0018 pci_ss_info_1039_7018_1025_0018
+static const pciSubsystemInfo pci_ss_info_1039_7018_1039_7018 =
+ {0x1039, 0x7018, pci_subsys_1039_7018_1039_7018, 0};
+#undef pci_ss_info_1039_7018
+#define pci_ss_info_1039_7018 pci_ss_info_1039_7018_1039_7018
+static const pciSubsystemInfo pci_ss_info_1039_7018_1043_800b =
+ {0x1043, 0x800b, pci_subsys_1039_7018_1043_800b, 0};
+#undef pci_ss_info_1043_800b
+#define pci_ss_info_1043_800b pci_ss_info_1039_7018_1043_800b
+static const pciSubsystemInfo pci_ss_info_1039_7018_1054_7018 =
+ {0x1054, 0x7018, pci_subsys_1039_7018_1054_7018, 0};
+#undef pci_ss_info_1054_7018
+#define pci_ss_info_1054_7018 pci_ss_info_1039_7018_1054_7018
+static const pciSubsystemInfo pci_ss_info_1039_7018_107d_5330 =
+ {0x107d, 0x5330, pci_subsys_1039_7018_107d_5330, 0};
+#undef pci_ss_info_107d_5330
+#define pci_ss_info_107d_5330 pci_ss_info_1039_7018_107d_5330
+static const pciSubsystemInfo pci_ss_info_1039_7018_107d_5350 =
+ {0x107d, 0x5350, pci_subsys_1039_7018_107d_5350, 0};
+#undef pci_ss_info_107d_5350
+#define pci_ss_info_107d_5350 pci_ss_info_1039_7018_107d_5350
+static const pciSubsystemInfo pci_ss_info_1039_7018_1170_3209 =
+ {0x1170, 0x3209, pci_subsys_1039_7018_1170_3209, 0};
+#undef pci_ss_info_1170_3209
+#define pci_ss_info_1170_3209 pci_ss_info_1039_7018_1170_3209
+static const pciSubsystemInfo pci_ss_info_1039_7018_1462_400a =
+ {0x1462, 0x400a, pci_subsys_1039_7018_1462_400a, 0};
+#undef pci_ss_info_1462_400a
+#define pci_ss_info_1462_400a pci_ss_info_1039_7018_1462_400a
+static const pciSubsystemInfo pci_ss_info_1039_7018_14a4_2089 =
+ {0x14a4, 0x2089, pci_subsys_1039_7018_14a4_2089, 0};
+#undef pci_ss_info_14a4_2089
+#define pci_ss_info_14a4_2089 pci_ss_info_1039_7018_14a4_2089
+static const pciSubsystemInfo pci_ss_info_1039_7018_14cd_2194 =
+ {0x14cd, 0x2194, pci_subsys_1039_7018_14cd_2194, 0};
+#undef pci_ss_info_14cd_2194
+#define pci_ss_info_14cd_2194 pci_ss_info_1039_7018_14cd_2194
+static const pciSubsystemInfo pci_ss_info_1039_7018_14ff_1100 =
+ {0x14ff, 0x1100, pci_subsys_1039_7018_14ff_1100, 0};
+#undef pci_ss_info_14ff_1100
+#define pci_ss_info_14ff_1100 pci_ss_info_1039_7018_14ff_1100
+static const pciSubsystemInfo pci_ss_info_1039_7018_152d_8808 =
+ {0x152d, 0x8808, pci_subsys_1039_7018_152d_8808, 0};
+#undef pci_ss_info_152d_8808
+#define pci_ss_info_152d_8808 pci_ss_info_1039_7018_152d_8808
+static const pciSubsystemInfo pci_ss_info_1039_7018_1558_1103 =
+ {0x1558, 0x1103, pci_subsys_1039_7018_1558_1103, 0};
+#undef pci_ss_info_1558_1103
+#define pci_ss_info_1558_1103 pci_ss_info_1039_7018_1558_1103
+static const pciSubsystemInfo pci_ss_info_1039_7018_1558_2200 =
+ {0x1558, 0x2200, pci_subsys_1039_7018_1558_2200, 0};
+#undef pci_ss_info_1558_2200
+#define pci_ss_info_1558_2200 pci_ss_info_1039_7018_1558_2200
+static const pciSubsystemInfo pci_ss_info_1039_7018_1563_7018 =
+ {0x1563, 0x7018, pci_subsys_1039_7018_1563_7018, 0};
+#undef pci_ss_info_1563_7018
+#define pci_ss_info_1563_7018 pci_ss_info_1039_7018_1563_7018
+static const pciSubsystemInfo pci_ss_info_1039_7018_15c5_0111 =
+ {0x15c5, 0x0111, pci_subsys_1039_7018_15c5_0111, 0};
+#undef pci_ss_info_15c5_0111
+#define pci_ss_info_15c5_0111 pci_ss_info_1039_7018_15c5_0111
+static const pciSubsystemInfo pci_ss_info_1039_7018_270f_a171 =
+ {0x270f, 0xa171, pci_subsys_1039_7018_270f_a171, 0};
+#undef pci_ss_info_270f_a171
+#define pci_ss_info_270f_a171 pci_ss_info_1039_7018_270f_a171
+static const pciSubsystemInfo pci_ss_info_1039_7018_a0a0_0022 =
+ {0xa0a0, 0x0022, pci_subsys_1039_7018_a0a0_0022, 0};
+#undef pci_ss_info_a0a0_0022
+#define pci_ss_info_a0a0_0022 pci_ss_info_1039_7018_a0a0_0022
+static const pciSubsystemInfo pci_ss_info_103c_1029_107e_000f =
+ {0x107e, 0x000f, pci_subsys_103c_1029_107e_000f, 0};
+#undef pci_ss_info_107e_000f
+#define pci_ss_info_107e_000f pci_ss_info_103c_1029_107e_000f
+static const pciSubsystemInfo pci_ss_info_103c_1029_9004_9210 =
+ {0x9004, 0x9210, pci_subsys_103c_1029_9004_9210, 0};
+#undef pci_ss_info_9004_9210
+#define pci_ss_info_9004_9210 pci_ss_info_103c_1029_9004_9210
+static const pciSubsystemInfo pci_ss_info_103c_1029_9004_9211 =
+ {0x9004, 0x9211, pci_subsys_103c_1029_9004_9211, 0};
+#undef pci_ss_info_9004_9211
+#define pci_ss_info_9004_9211 pci_ss_info_103c_1029_9004_9211
+static const pciSubsystemInfo pci_ss_info_103c_102a_107e_000e =
+ {0x107e, 0x000e, pci_subsys_103c_102a_107e_000e, 0};
+#undef pci_ss_info_107e_000e
+#define pci_ss_info_107e_000e pci_ss_info_103c_102a_107e_000e
+static const pciSubsystemInfo pci_ss_info_103c_102a_9004_9110 =
+ {0x9004, 0x9110, pci_subsys_103c_102a_9004_9110, 0};
+#undef pci_ss_info_9004_9110
+#define pci_ss_info_9004_9110 pci_ss_info_103c_102a_9004_9110
+static const pciSubsystemInfo pci_ss_info_103c_102a_9004_9111 =
+ {0x9004, 0x9111, pci_subsys_103c_102a_9004_9111, 0};
+#undef pci_ss_info_9004_9111
+#define pci_ss_info_9004_9111 pci_ss_info_103c_102a_9004_9111
+static const pciSubsystemInfo pci_ss_info_103c_1031_103c_1040 =
+ {0x103c, 0x1040, pci_subsys_103c_1031_103c_1040, 0};
+#undef pci_ss_info_103c_1040
+#define pci_ss_info_103c_1040 pci_ss_info_103c_1031_103c_1040
+static const pciSubsystemInfo pci_ss_info_103c_1031_103c_1041 =
+ {0x103c, 0x1041, pci_subsys_103c_1031_103c_1041, 0};
+#undef pci_ss_info_103c_1041
+#define pci_ss_info_103c_1041 pci_ss_info_103c_1031_103c_1041
+static const pciSubsystemInfo pci_ss_info_103c_1031_103c_1042 =
+ {0x103c, 0x1042, pci_subsys_103c_1031_103c_1042, 0};
+#undef pci_ss_info_103c_1042
+#define pci_ss_info_103c_1042 pci_ss_info_103c_1031_103c_1042
+static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1049 =
+ {0x103c, 0x1049, pci_subsys_103c_1048_103c_1049, 0};
+#undef pci_ss_info_103c_1049
+#define pci_ss_info_103c_1049 pci_ss_info_103c_1048_103c_1049
+static const pciSubsystemInfo pci_ss_info_103c_1048_103c_104a =
+ {0x103c, 0x104a, pci_subsys_103c_1048_103c_104a, 0};
+#undef pci_ss_info_103c_104a
+#define pci_ss_info_103c_104a pci_ss_info_103c_1048_103c_104a
+static const pciSubsystemInfo pci_ss_info_103c_1048_103c_104b =
+ {0x103c, 0x104b, pci_subsys_103c_1048_103c_104b, 0};
+#undef pci_ss_info_103c_104b
+#define pci_ss_info_103c_104b pci_ss_info_103c_1048_103c_104b
+static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1223 =
+ {0x103c, 0x1223, pci_subsys_103c_1048_103c_1223, 0};
+#undef pci_ss_info_103c_1223
+#define pci_ss_info_103c_1223 pci_ss_info_103c_1048_103c_1223
+static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1226 =
+ {0x103c, 0x1226, pci_subsys_103c_1048_103c_1226, 0};
+#undef pci_ss_info_103c_1226
+#define pci_ss_info_103c_1226 pci_ss_info_103c_1048_103c_1226
+static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1227 =
+ {0x103c, 0x1227, pci_subsys_103c_1048_103c_1227, 0};
+#undef pci_ss_info_103c_1227
+#define pci_ss_info_103c_1227 pci_ss_info_103c_1048_103c_1227
+static const pciSubsystemInfo pci_ss_info_103c_1048_103c_1282 =
+ {0x103c, 0x1282, pci_subsys_103c_1048_103c_1282, 0};
+#undef pci_ss_info_103c_1282
+#define pci_ss_info_103c_1282 pci_ss_info_103c_1048_103c_1282
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c001 =
+ {0x1044, 0xc001, pci_subsys_1044_a501_1044_c001, 0};
+#undef pci_ss_info_1044_c001
+#define pci_ss_info_1044_c001 pci_ss_info_1044_a501_1044_c001
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c002 =
+ {0x1044, 0xc002, pci_subsys_1044_a501_1044_c002, 0};
+#undef pci_ss_info_1044_c002
+#define pci_ss_info_1044_c002 pci_ss_info_1044_a501_1044_c002
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c003 =
+ {0x1044, 0xc003, pci_subsys_1044_a501_1044_c003, 0};
+#undef pci_ss_info_1044_c003
+#define pci_ss_info_1044_c003 pci_ss_info_1044_a501_1044_c003
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c004 =
+ {0x1044, 0xc004, pci_subsys_1044_a501_1044_c004, 0};
+#undef pci_ss_info_1044_c004
+#define pci_ss_info_1044_c004 pci_ss_info_1044_a501_1044_c004
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c005 =
+ {0x1044, 0xc005, pci_subsys_1044_a501_1044_c005, 0};
+#undef pci_ss_info_1044_c005
+#define pci_ss_info_1044_c005 pci_ss_info_1044_a501_1044_c005
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00a =
+ {0x1044, 0xc00a, pci_subsys_1044_a501_1044_c00a, 0};
+#undef pci_ss_info_1044_c00a
+#define pci_ss_info_1044_c00a pci_ss_info_1044_a501_1044_c00a
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00b =
+ {0x1044, 0xc00b, pci_subsys_1044_a501_1044_c00b, 0};
+#undef pci_ss_info_1044_c00b
+#define pci_ss_info_1044_c00b pci_ss_info_1044_a501_1044_c00b
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00c =
+ {0x1044, 0xc00c, pci_subsys_1044_a501_1044_c00c, 0};
+#undef pci_ss_info_1044_c00c
+#define pci_ss_info_1044_c00c pci_ss_info_1044_a501_1044_c00c
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00d =
+ {0x1044, 0xc00d, pci_subsys_1044_a501_1044_c00d, 0};
+#undef pci_ss_info_1044_c00d
+#define pci_ss_info_1044_c00d pci_ss_info_1044_a501_1044_c00d
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00e =
+ {0x1044, 0xc00e, pci_subsys_1044_a501_1044_c00e, 0};
+#undef pci_ss_info_1044_c00e
+#define pci_ss_info_1044_c00e pci_ss_info_1044_a501_1044_c00e
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c00f =
+ {0x1044, 0xc00f, pci_subsys_1044_a501_1044_c00f, 0};
+#undef pci_ss_info_1044_c00f
+#define pci_ss_info_1044_c00f pci_ss_info_1044_a501_1044_c00f
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c014 =
+ {0x1044, 0xc014, pci_subsys_1044_a501_1044_c014, 0};
+#undef pci_ss_info_1044_c014
+#define pci_ss_info_1044_c014 pci_ss_info_1044_a501_1044_c014
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c015 =
+ {0x1044, 0xc015, pci_subsys_1044_a501_1044_c015, 0};
+#undef pci_ss_info_1044_c015
+#define pci_ss_info_1044_c015 pci_ss_info_1044_a501_1044_c015
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c016 =
+ {0x1044, 0xc016, pci_subsys_1044_a501_1044_c016, 0};
+#undef pci_ss_info_1044_c016
+#define pci_ss_info_1044_c016 pci_ss_info_1044_a501_1044_c016
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c01e =
+ {0x1044, 0xc01e, pci_subsys_1044_a501_1044_c01e, 0};
+#undef pci_ss_info_1044_c01e
+#define pci_ss_info_1044_c01e pci_ss_info_1044_a501_1044_c01e
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c01f =
+ {0x1044, 0xc01f, pci_subsys_1044_a501_1044_c01f, 0};
+#undef pci_ss_info_1044_c01f
+#define pci_ss_info_1044_c01f pci_ss_info_1044_a501_1044_c01f
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c020 =
+ {0x1044, 0xc020, pci_subsys_1044_a501_1044_c020, 0};
+#undef pci_ss_info_1044_c020
+#define pci_ss_info_1044_c020 pci_ss_info_1044_a501_1044_c020
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c021 =
+ {0x1044, 0xc021, pci_subsys_1044_a501_1044_c021, 0};
+#undef pci_ss_info_1044_c021
+#define pci_ss_info_1044_c021 pci_ss_info_1044_a501_1044_c021
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c028 =
+ {0x1044, 0xc028, pci_subsys_1044_a501_1044_c028, 0};
+#undef pci_ss_info_1044_c028
+#define pci_ss_info_1044_c028 pci_ss_info_1044_a501_1044_c028
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c029 =
+ {0x1044, 0xc029, pci_subsys_1044_a501_1044_c029, 0};
+#undef pci_ss_info_1044_c029
+#define pci_ss_info_1044_c029 pci_ss_info_1044_a501_1044_c029
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c02a =
+ {0x1044, 0xc02a, pci_subsys_1044_a501_1044_c02a, 0};
+#undef pci_ss_info_1044_c02a
+#define pci_ss_info_1044_c02a pci_ss_info_1044_a501_1044_c02a
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c03c =
+ {0x1044, 0xc03c, pci_subsys_1044_a501_1044_c03c, 0};
+#undef pci_ss_info_1044_c03c
+#define pci_ss_info_1044_c03c pci_ss_info_1044_a501_1044_c03c
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c03d =
+ {0x1044, 0xc03d, pci_subsys_1044_a501_1044_c03d, 0};
+#undef pci_ss_info_1044_c03d
+#define pci_ss_info_1044_c03d pci_ss_info_1044_a501_1044_c03d
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c03e =
+ {0x1044, 0xc03e, pci_subsys_1044_a501_1044_c03e, 0};
+#undef pci_ss_info_1044_c03e
+#define pci_ss_info_1044_c03e pci_ss_info_1044_a501_1044_c03e
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c046 =
+ {0x1044, 0xc046, pci_subsys_1044_a501_1044_c046, 0};
+#undef pci_ss_info_1044_c046
+#define pci_ss_info_1044_c046 pci_ss_info_1044_a501_1044_c046
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c047 =
+ {0x1044, 0xc047, pci_subsys_1044_a501_1044_c047, 0};
+#undef pci_ss_info_1044_c047
+#define pci_ss_info_1044_c047 pci_ss_info_1044_a501_1044_c047
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c048 =
+ {0x1044, 0xc048, pci_subsys_1044_a501_1044_c048, 0};
+#undef pci_ss_info_1044_c048
+#define pci_ss_info_1044_c048 pci_ss_info_1044_a501_1044_c048
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c050 =
+ {0x1044, 0xc050, pci_subsys_1044_a501_1044_c050, 0};
+#undef pci_ss_info_1044_c050
+#define pci_ss_info_1044_c050 pci_ss_info_1044_a501_1044_c050
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c051 =
+ {0x1044, 0xc051, pci_subsys_1044_a501_1044_c051, 0};
+#undef pci_ss_info_1044_c051
+#define pci_ss_info_1044_c051 pci_ss_info_1044_a501_1044_c051
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c052 =
+ {0x1044, 0xc052, pci_subsys_1044_a501_1044_c052, 0};
+#undef pci_ss_info_1044_c052
+#define pci_ss_info_1044_c052 pci_ss_info_1044_a501_1044_c052
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c05a =
+ {0x1044, 0xc05a, pci_subsys_1044_a501_1044_c05a, 0};
+#undef pci_ss_info_1044_c05a
+#define pci_ss_info_1044_c05a pci_ss_info_1044_a501_1044_c05a
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c05b =
+ {0x1044, 0xc05b, pci_subsys_1044_a501_1044_c05b, 0};
+#undef pci_ss_info_1044_c05b
+#define pci_ss_info_1044_c05b pci_ss_info_1044_a501_1044_c05b
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c064 =
+ {0x1044, 0xc064, pci_subsys_1044_a501_1044_c064, 0};
+#undef pci_ss_info_1044_c064
+#define pci_ss_info_1044_c064 pci_ss_info_1044_a501_1044_c064
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c065 =
+ {0x1044, 0xc065, pci_subsys_1044_a501_1044_c065, 0};
+#undef pci_ss_info_1044_c065
+#define pci_ss_info_1044_c065 pci_ss_info_1044_a501_1044_c065
+static const pciSubsystemInfo pci_ss_info_1044_a501_1044_c066 =
+ {0x1044, 0xc066, pci_subsys_1044_a501_1044_c066, 0};
+#undef pci_ss_info_1044_c066
+#define pci_ss_info_1044_c066 pci_ss_info_1044_a501_1044_c066
+#endif
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1011_4d10 =
+ {0x1011, 0x4d10, pci_subsys_104c_3d07_1011_4d10, 0};
+#undef pci_ss_info_1011_4d10
+#define pci_ss_info_1011_4d10 pci_ss_info_104c_3d07_1011_4d10
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1040_000f =
+ {0x1040, 0x000f, pci_subsys_104c_3d07_1040_000f, 0};
+#undef pci_ss_info_1040_000f
+#define pci_ss_info_1040_000f pci_ss_info_104c_3d07_1040_000f
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1040_0011 =
+ {0x1040, 0x0011, pci_subsys_104c_3d07_1040_0011, 0};
+#undef pci_ss_info_1040_0011
+#define pci_ss_info_1040_0011 pci_ss_info_104c_3d07_1040_0011
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1048_0a31 =
+ {0x1048, 0x0a31, pci_subsys_104c_3d07_1048_0a31, 0};
+#undef pci_ss_info_1048_0a31
+#define pci_ss_info_1048_0a31 pci_ss_info_104c_3d07_1048_0a31
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1048_0a32 =
+ {0x1048, 0x0a32, pci_subsys_104c_3d07_1048_0a32, 0};
+#undef pci_ss_info_1048_0a32
+#define pci_ss_info_1048_0a32 pci_ss_info_104c_3d07_1048_0a32
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1048_0a35 =
+ {0x1048, 0x0a35, pci_subsys_104c_3d07_1048_0a35, 0};
+#undef pci_ss_info_1048_0a35
+#define pci_ss_info_1048_0a35 pci_ss_info_104c_3d07_1048_0a35
+static const pciSubsystemInfo pci_ss_info_104c_3d07_107d_2633 =
+ {0x107d, 0x2633, pci_subsys_104c_3d07_107d_2633, 0};
+#undef pci_ss_info_107d_2633
+#define pci_ss_info_107d_2633 pci_ss_info_104c_3d07_107d_2633
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0127 =
+ {0x1092, 0x0127, pci_subsys_104c_3d07_1092_0127, 0};
+#undef pci_ss_info_1092_0127
+#define pci_ss_info_1092_0127 pci_ss_info_104c_3d07_1092_0127
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0136 =
+ {0x1092, 0x0136, pci_subsys_104c_3d07_1092_0136, 0};
+#undef pci_ss_info_1092_0136
+#define pci_ss_info_1092_0136 pci_ss_info_104c_3d07_1092_0136
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0141 =
+ {0x1092, 0x0141, pci_subsys_104c_3d07_1092_0141, 0};
+#undef pci_ss_info_1092_0141
+#define pci_ss_info_1092_0141 pci_ss_info_104c_3d07_1092_0141
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0146 =
+ {0x1092, 0x0146, pci_subsys_104c_3d07_1092_0146, 0};
+#undef pci_ss_info_1092_0146
+#define pci_ss_info_1092_0146 pci_ss_info_104c_3d07_1092_0146
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0148 =
+ {0x1092, 0x0148, pci_subsys_104c_3d07_1092_0148, 0};
+#undef pci_ss_info_1092_0148
+#define pci_ss_info_1092_0148 pci_ss_info_104c_3d07_1092_0148
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0149 =
+ {0x1092, 0x0149, pci_subsys_104c_3d07_1092_0149, 0};
+#undef pci_ss_info_1092_0149
+#define pci_ss_info_1092_0149 pci_ss_info_104c_3d07_1092_0149
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0152 =
+ {0x1092, 0x0152, pci_subsys_104c_3d07_1092_0152, 0};
+#undef pci_ss_info_1092_0152
+#define pci_ss_info_1092_0152 pci_ss_info_104c_3d07_1092_0152
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0154 =
+ {0x1092, 0x0154, pci_subsys_104c_3d07_1092_0154, 0};
+#undef pci_ss_info_1092_0154
+#define pci_ss_info_1092_0154 pci_ss_info_104c_3d07_1092_0154
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0155 =
+ {0x1092, 0x0155, pci_subsys_104c_3d07_1092_0155, 0};
+#undef pci_ss_info_1092_0155
+#define pci_ss_info_1092_0155 pci_ss_info_104c_3d07_1092_0155
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0156 =
+ {0x1092, 0x0156, pci_subsys_104c_3d07_1092_0156, 0};
+#undef pci_ss_info_1092_0156
+#define pci_ss_info_1092_0156 pci_ss_info_104c_3d07_1092_0156
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1092_0157 =
+ {0x1092, 0x0157, pci_subsys_104c_3d07_1092_0157, 0};
+#undef pci_ss_info_1092_0157
+#define pci_ss_info_1092_0157 pci_ss_info_104c_3d07_1092_0157
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1097_3d01 =
+ {0x1097, 0x3d01, pci_subsys_104c_3d07_1097_3d01, 0};
+#undef pci_ss_info_1097_3d01
+#define pci_ss_info_1097_3d01 pci_ss_info_104c_3d07_1097_3d01
+static const pciSubsystemInfo pci_ss_info_104c_3d07_1102_100f =
+ {0x1102, 0x100f, pci_subsys_104c_3d07_1102_100f, 0};
+#undef pci_ss_info_1102_100f
+#define pci_ss_info_1102_100f pci_ss_info_104c_3d07_1102_100f
+static const pciSubsystemInfo pci_ss_info_104c_3d07_3d3d_0100 =
+ {0x3d3d, 0x0100, pci_subsys_104c_3d07_3d3d_0100, 0};
+#undef pci_ss_info_3d3d_0100
+#define pci_ss_info_3d3d_0100 pci_ss_info_104c_3d07_3d3d_0100
+static const pciSubsystemInfo pci_ss_info_104c_8000_e4bf_1010 =
+ {0xe4bf, 0x1010, pci_subsys_104c_8000_e4bf_1010, 0};
+#undef pci_ss_info_e4bf_1010
+#define pci_ss_info_e4bf_1010 pci_ss_info_104c_8000_e4bf_1010
+static const pciSubsystemInfo pci_ss_info_104c_8000_e4bf_1020 =
+ {0xe4bf, 0x1020, pci_subsys_104c_8000_e4bf_1020, 0};
+#undef pci_ss_info_e4bf_1020
+#define pci_ss_info_e4bf_1020 pci_ss_info_104c_8000_e4bf_1020
+static const pciSubsystemInfo pci_ss_info_104c_8009_104d_8032 =
+ {0x104d, 0x8032, pci_subsys_104c_8009_104d_8032, 0};
+#undef pci_ss_info_104d_8032
+#define pci_ss_info_104d_8032 pci_ss_info_104c_8009_104d_8032
+static const pciSubsystemInfo pci_ss_info_104c_8019_11bd_000a =
+ {0x11bd, 0x000a, pci_subsys_104c_8019_11bd_000a, 0};
+#undef pci_ss_info_11bd_000a
+#define pci_ss_info_11bd_000a pci_ss_info_104c_8019_11bd_000a
+static const pciSubsystemInfo pci_ss_info_104c_8019_11bd_000e =
+ {0x11bd, 0x000e, pci_subsys_104c_8019_11bd_000e, 0};
+#undef pci_ss_info_11bd_000e
+#define pci_ss_info_11bd_000e pci_ss_info_104c_8019_11bd_000e
+static const pciSubsystemInfo pci_ss_info_104c_8019_e4bf_1010 =
+ {0xe4bf, 0x1010, pci_subsys_104c_8019_e4bf_1010, 0};
+#undef pci_ss_info_e4bf_1010
+#define pci_ss_info_e4bf_1010 pci_ss_info_104c_8019_e4bf_1010
+static const pciSubsystemInfo pci_ss_info_104c_8021_104d_80df =
+ {0x104d, 0x80df, pci_subsys_104c_8021_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_104c_8021_104d_80df
+static const pciSubsystemInfo pci_ss_info_104c_8021_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_104c_8021_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_104c_8021_104d_80e7
+static const pciSubsystemInfo pci_ss_info_104c_8027_1028_00e6 =
+ {0x1028, 0x00e6, pci_subsys_104c_8027_1028_00e6, 0};
+#undef pci_ss_info_1028_00e6
+#define pci_ss_info_1028_00e6 pci_ss_info_104c_8027_1028_00e6
+static const pciSubsystemInfo pci_ss_info_104c_ac1b_0e11_b113 =
+ {0x0e11, 0xb113, pci_subsys_104c_ac1b_0e11_b113, 0};
+#undef pci_ss_info_0e11_b113
+#define pci_ss_info_0e11_b113 pci_ss_info_104c_ac1b_0e11_b113
+static const pciSubsystemInfo pci_ss_info_104c_ac42_1028_00e6 =
+ {0x1028, 0x00e6, pci_subsys_104c_ac42_1028_00e6, 0};
+#undef pci_ss_info_1028_00e6
+#define pci_ss_info_1028_00e6 pci_ss_info_104c_ac42_1028_00e6
+static const pciSubsystemInfo pci_ss_info_104c_ac51_1014_023b =
+ {0x1014, 0x023b, pci_subsys_104c_ac51_1014_023b, 0};
+#undef pci_ss_info_1014_023b
+#define pci_ss_info_1014_023b pci_ss_info_104c_ac51_1014_023b
+static const pciSubsystemInfo pci_ss_info_104c_ac51_10cf_1095 =
+ {0x10cf, 0x1095, pci_subsys_104c_ac51_10cf_1095, 0};
+#undef pci_ss_info_10cf_1095
+#define pci_ss_info_10cf_1095 pci_ss_info_104c_ac51_10cf_1095
+static const pciSubsystemInfo pci_ss_info_104c_ac51_e4bf_1000 =
+ {0xe4bf, 0x1000, pci_subsys_104c_ac51_e4bf_1000, 0};
+#undef pci_ss_info_e4bf_1000
+#define pci_ss_info_e4bf_1000 pci_ss_info_104c_ac51_e4bf_1000
+static const pciSubsystemInfo pci_ss_info_104c_ac55_1014_0512 =
+ {0x1014, 0x0512, pci_subsys_104c_ac55_1014_0512, 0};
+#undef pci_ss_info_1014_0512
+#define pci_ss_info_1014_0512 pci_ss_info_104c_ac55_1014_0512
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1050_0840_1050_0001 =
+ {0x1050, 0x0001, pci_subsys_1050_0840_1050_0001, 0};
+#undef pci_ss_info_1050_0001
+#define pci_ss_info_1050_0001 pci_ss_info_1050_0840_1050_0001
+static const pciSubsystemInfo pci_ss_info_1050_0840_1050_0840 =
+ {0x1050, 0x0840, pci_subsys_1050_0840_1050_0840, 0};
+#undef pci_ss_info_1050_0840
+#define pci_ss_info_1050_0840 pci_ss_info_1050_0840_1050_0840
+#endif
+static const pciSubsystemInfo pci_ss_info_1057_1801_ecc0_0030 =
+ {0xecc0, 0x0030, pci_subsys_1057_1801_ecc0_0030, 0};
+#undef pci_ss_info_ecc0_0030
+#define pci_ss_info_ecc0_0030 pci_ss_info_1057_1801_ecc0_0030
+static const pciSubsystemInfo pci_ss_info_1057_5600_1057_0300 =
+ {0x1057, 0x0300, pci_subsys_1057_5600_1057_0300, 0};
+#undef pci_ss_info_1057_0300
+#define pci_ss_info_1057_0300 pci_ss_info_1057_5600_1057_0300
+static const pciSubsystemInfo pci_ss_info_1057_5600_1057_0301 =
+ {0x1057, 0x0301, pci_subsys_1057_5600_1057_0301, 0};
+#undef pci_ss_info_1057_0301
+#define pci_ss_info_1057_0301 pci_ss_info_1057_5600_1057_0301
+static const pciSubsystemInfo pci_ss_info_1057_5600_1057_0302 =
+ {0x1057, 0x0302, pci_subsys_1057_5600_1057_0302, 0};
+#undef pci_ss_info_1057_0302
+#define pci_ss_info_1057_0302 pci_ss_info_1057_5600_1057_0302
+static const pciSubsystemInfo pci_ss_info_1057_5600_1057_5600 =
+ {0x1057, 0x5600, pci_subsys_1057_5600_1057_5600, 0};
+#undef pci_ss_info_1057_5600
+#define pci_ss_info_1057_5600 pci_ss_info_1057_5600_1057_5600
+static const pciSubsystemInfo pci_ss_info_1057_5600_13d2_0300 =
+ {0x13d2, 0x0300, pci_subsys_1057_5600_13d2_0300, 0};
+#undef pci_ss_info_13d2_0300
+#define pci_ss_info_13d2_0300 pci_ss_info_1057_5600_13d2_0300
+static const pciSubsystemInfo pci_ss_info_1057_5600_13d2_0301 =
+ {0x13d2, 0x0301, pci_subsys_1057_5600_13d2_0301, 0};
+#undef pci_ss_info_13d2_0301
+#define pci_ss_info_13d2_0301 pci_ss_info_1057_5600_13d2_0301
+static const pciSubsystemInfo pci_ss_info_1057_5600_13d2_0302 =
+ {0x13d2, 0x0302, pci_subsys_1057_5600_13d2_0302, 0};
+#undef pci_ss_info_13d2_0302
+#define pci_ss_info_13d2_0302 pci_ss_info_1057_5600_13d2_0302
+static const pciSubsystemInfo pci_ss_info_1057_5600_1436_0300 =
+ {0x1436, 0x0300, pci_subsys_1057_5600_1436_0300, 0};
+#undef pci_ss_info_1436_0300
+#define pci_ss_info_1436_0300 pci_ss_info_1057_5600_1436_0300
+static const pciSubsystemInfo pci_ss_info_1057_5600_1436_0301 =
+ {0x1436, 0x0301, pci_subsys_1057_5600_1436_0301, 0};
+#undef pci_ss_info_1436_0301
+#define pci_ss_info_1436_0301 pci_ss_info_1057_5600_1436_0301
+static const pciSubsystemInfo pci_ss_info_1057_5600_1436_0302 =
+ {0x1436, 0x0302, pci_subsys_1057_5600_1436_0302, 0};
+#undef pci_ss_info_1436_0302
+#define pci_ss_info_1436_0302 pci_ss_info_1057_5600_1436_0302
+static const pciSubsystemInfo pci_ss_info_1057_5600_144f_100c =
+ {0x144f, 0x100c, pci_subsys_1057_5600_144f_100c, 0};
+#undef pci_ss_info_144f_100c
+#define pci_ss_info_144f_100c pci_ss_info_1057_5600_144f_100c
+static const pciSubsystemInfo pci_ss_info_1057_5600_1494_0300 =
+ {0x1494, 0x0300, pci_subsys_1057_5600_1494_0300, 0};
+#undef pci_ss_info_1494_0300
+#define pci_ss_info_1494_0300 pci_ss_info_1057_5600_1494_0300
+static const pciSubsystemInfo pci_ss_info_1057_5600_1494_0301 =
+ {0x1494, 0x0301, pci_subsys_1057_5600_1494_0301, 0};
+#undef pci_ss_info_1494_0301
+#define pci_ss_info_1494_0301 pci_ss_info_1057_5600_1494_0301
+static const pciSubsystemInfo pci_ss_info_1057_5600_14c8_0300 =
+ {0x14c8, 0x0300, pci_subsys_1057_5600_14c8_0300, 0};
+#undef pci_ss_info_14c8_0300
+#define pci_ss_info_14c8_0300 pci_ss_info_1057_5600_14c8_0300
+static const pciSubsystemInfo pci_ss_info_1057_5600_14c8_0302 =
+ {0x14c8, 0x0302, pci_subsys_1057_5600_14c8_0302, 0};
+#undef pci_ss_info_14c8_0302
+#define pci_ss_info_14c8_0302 pci_ss_info_1057_5600_14c8_0302
+static const pciSubsystemInfo pci_ss_info_1057_5600_1668_0300 =
+ {0x1668, 0x0300, pci_subsys_1057_5600_1668_0300, 0};
+#undef pci_ss_info_1668_0300
+#define pci_ss_info_1668_0300 pci_ss_info_1057_5600_1668_0300
+static const pciSubsystemInfo pci_ss_info_1057_5600_1668_0302 =
+ {0x1668, 0x0302, pci_subsys_1057_5600_1668_0302, 0};
+#undef pci_ss_info_1668_0302
+#define pci_ss_info_1668_0302 pci_ss_info_1057_5600_1668_0302
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_105a_0d30_105a_4d33 =
+ {0x105a, 0x4d33, pci_subsys_105a_0d30_105a_4d33, 0};
+#undef pci_ss_info_105a_4d33
+#define pci_ss_info_105a_4d33 pci_ss_info_105a_0d30_105a_4d33
+static const pciSubsystemInfo pci_ss_info_105a_0d38_105a_4d39 =
+ {0x105a, 0x4d39, pci_subsys_105a_0d38_105a_4d39, 0};
+#undef pci_ss_info_105a_4d39
+#define pci_ss_info_105a_4d39 pci_ss_info_105a_0d38_105a_4d39
+static const pciSubsystemInfo pci_ss_info_105a_4d30_105a_4d33 =
+ {0x105a, 0x4d33, pci_subsys_105a_4d30_105a_4d33, 0};
+#undef pci_ss_info_105a_4d33
+#define pci_ss_info_105a_4d33 pci_ss_info_105a_4d30_105a_4d33
+static const pciSubsystemInfo pci_ss_info_105a_4d30_105a_4d39 =
+ {0x105a, 0x4d39, pci_subsys_105a_4d30_105a_4d39, 0};
+#undef pci_ss_info_105a_4d39
+#define pci_ss_info_105a_4d39 pci_ss_info_105a_4d30_105a_4d39
+static const pciSubsystemInfo pci_ss_info_105a_4d33_105a_4d33 =
+ {0x105a, 0x4d33, pci_subsys_105a_4d33_105a_4d33, 0};
+#undef pci_ss_info_105a_4d33
+#define pci_ss_info_105a_4d33 pci_ss_info_105a_4d33_105a_4d33
+static const pciSubsystemInfo pci_ss_info_105a_4d38_105a_4d30 =
+ {0x105a, 0x4d30, pci_subsys_105a_4d38_105a_4d30, 0};
+#undef pci_ss_info_105a_4d30
+#define pci_ss_info_105a_4d30 pci_ss_info_105a_4d38_105a_4d30
+static const pciSubsystemInfo pci_ss_info_105a_4d38_105a_4d33 =
+ {0x105a, 0x4d33, pci_subsys_105a_4d38_105a_4d33, 0};
+#undef pci_ss_info_105a_4d33
+#define pci_ss_info_105a_4d33 pci_ss_info_105a_4d38_105a_4d33
+static const pciSubsystemInfo pci_ss_info_105a_4d38_105a_4d39 =
+ {0x105a, 0x4d39, pci_subsys_105a_4d38_105a_4d39, 0};
+#undef pci_ss_info_105a_4d39
+#define pci_ss_info_105a_4d39 pci_ss_info_105a_4d38_105a_4d39
+static const pciSubsystemInfo pci_ss_info_105a_4d68_105a_4d68 =
+ {0x105a, 0x4d68, pci_subsys_105a_4d68_105a_4d68, 0};
+#undef pci_ss_info_105a_4d68
+#define pci_ss_info_105a_4d68 pci_ss_info_105a_4d68_105a_4d68
+static const pciSubsystemInfo pci_ss_info_105a_5275_105a_0275 =
+ {0x105a, 0x0275, pci_subsys_105a_5275_105a_0275, 0};
+#undef pci_ss_info_105a_0275
+#define pci_ss_info_105a_0275 pci_ss_info_105a_5275_105a_0275
+static const pciSubsystemInfo pci_ss_info_105a_6269_105a_6269 =
+ {0x105a, 0x6269, pci_subsys_105a_6269_105a_6269, 0};
+#undef pci_ss_info_105a_6269
+#define pci_ss_info_105a_6269 pci_ss_info_105a_6269_105a_6269
+#endif
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0000 =
+ {0x105d, 0x0000, pci_subsys_105d_2339_105d_0000, 0};
+#undef pci_ss_info_105d_0000
+#define pci_ss_info_105d_0000 pci_ss_info_105d_2339_105d_0000
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0001 =
+ {0x105d, 0x0001, pci_subsys_105d_2339_105d_0001, 0};
+#undef pci_ss_info_105d_0001
+#define pci_ss_info_105d_0001 pci_ss_info_105d_2339_105d_0001
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0002 =
+ {0x105d, 0x0002, pci_subsys_105d_2339_105d_0002, 0};
+#undef pci_ss_info_105d_0002
+#define pci_ss_info_105d_0002 pci_ss_info_105d_2339_105d_0002
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0003 =
+ {0x105d, 0x0003, pci_subsys_105d_2339_105d_0003, 0};
+#undef pci_ss_info_105d_0003
+#define pci_ss_info_105d_0003 pci_ss_info_105d_2339_105d_0003
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0004 =
+ {0x105d, 0x0004, pci_subsys_105d_2339_105d_0004, 0};
+#undef pci_ss_info_105d_0004
+#define pci_ss_info_105d_0004 pci_ss_info_105d_2339_105d_0004
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0005 =
+ {0x105d, 0x0005, pci_subsys_105d_2339_105d_0005, 0};
+#undef pci_ss_info_105d_0005
+#define pci_ss_info_105d_0005 pci_ss_info_105d_2339_105d_0005
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0006 =
+ {0x105d, 0x0006, pci_subsys_105d_2339_105d_0006, 0};
+#undef pci_ss_info_105d_0006
+#define pci_ss_info_105d_0006 pci_ss_info_105d_2339_105d_0006
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0007 =
+ {0x105d, 0x0007, pci_subsys_105d_2339_105d_0007, 0};
+#undef pci_ss_info_105d_0007
+#define pci_ss_info_105d_0007 pci_ss_info_105d_2339_105d_0007
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0008 =
+ {0x105d, 0x0008, pci_subsys_105d_2339_105d_0008, 0};
+#undef pci_ss_info_105d_0008
+#define pci_ss_info_105d_0008 pci_ss_info_105d_2339_105d_0008
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_0009 =
+ {0x105d, 0x0009, pci_subsys_105d_2339_105d_0009, 0};
+#undef pci_ss_info_105d_0009
+#define pci_ss_info_105d_0009 pci_ss_info_105d_2339_105d_0009
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_000a =
+ {0x105d, 0x000a, pci_subsys_105d_2339_105d_000a, 0};
+#undef pci_ss_info_105d_000a
+#define pci_ss_info_105d_000a pci_ss_info_105d_2339_105d_000a
+static const pciSubsystemInfo pci_ss_info_105d_2339_105d_000b =
+ {0x105d, 0x000b, pci_subsys_105d_2339_105d_000b, 0};
+#undef pci_ss_info_105d_000b
+#define pci_ss_info_105d_000b pci_ss_info_105d_2339_105d_000b
+static const pciSubsystemInfo pci_ss_info_105d_2339_11a4_000a =
+ {0x11a4, 0x000a, pci_subsys_105d_2339_11a4_000a, 0};
+#undef pci_ss_info_11a4_000a
+#define pci_ss_info_11a4_000a pci_ss_info_105d_2339_11a4_000a
+static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0000 =
+ {0x13cc, 0x0000, pci_subsys_105d_2339_13cc_0000, 0};
+#undef pci_ss_info_13cc_0000
+#define pci_ss_info_13cc_0000 pci_ss_info_105d_2339_13cc_0000
+static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0004 =
+ {0x13cc, 0x0004, pci_subsys_105d_2339_13cc_0004, 0};
+#undef pci_ss_info_13cc_0004
+#define pci_ss_info_13cc_0004 pci_ss_info_105d_2339_13cc_0004
+static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0005 =
+ {0x13cc, 0x0005, pci_subsys_105d_2339_13cc_0005, 0};
+#undef pci_ss_info_13cc_0005
+#define pci_ss_info_13cc_0005 pci_ss_info_105d_2339_13cc_0005
+static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0006 =
+ {0x13cc, 0x0006, pci_subsys_105d_2339_13cc_0006, 0};
+#undef pci_ss_info_13cc_0006
+#define pci_ss_info_13cc_0006 pci_ss_info_105d_2339_13cc_0006
+static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0008 =
+ {0x13cc, 0x0008, pci_subsys_105d_2339_13cc_0008, 0};
+#undef pci_ss_info_13cc_0008
+#define pci_ss_info_13cc_0008 pci_ss_info_105d_2339_13cc_0008
+static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_0009 =
+ {0x13cc, 0x0009, pci_subsys_105d_2339_13cc_0009, 0};
+#undef pci_ss_info_13cc_0009
+#define pci_ss_info_13cc_0009 pci_ss_info_105d_2339_13cc_0009
+static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_000a =
+ {0x13cc, 0x000a, pci_subsys_105d_2339_13cc_000a, 0};
+#undef pci_ss_info_13cc_000a
+#define pci_ss_info_13cc_000a pci_ss_info_105d_2339_13cc_000a
+static const pciSubsystemInfo pci_ss_info_105d_2339_13cc_000c =
+ {0x13cc, 0x000c, pci_subsys_105d_2339_13cc_000c, 0};
+#undef pci_ss_info_13cc_000c
+#define pci_ss_info_13cc_000c pci_ss_info_105d_2339_13cc_000c
+static const pciSubsystemInfo pci_ss_info_105d_493d_11a4_000a =
+ {0x11a4, 0x000a, pci_subsys_105d_493d_11a4_000a, 0};
+#undef pci_ss_info_11a4_000a
+#define pci_ss_info_11a4_000a pci_ss_info_105d_493d_11a4_000a
+static const pciSubsystemInfo pci_ss_info_105d_493d_11a4_000b =
+ {0x11a4, 0x000b, pci_subsys_105d_493d_11a4_000b, 0};
+#undef pci_ss_info_11a4_000b
+#define pci_ss_info_11a4_000b pci_ss_info_105d_493d_11a4_000b
+static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0002 =
+ {0x13cc, 0x0002, pci_subsys_105d_493d_13cc_0002, 0};
+#undef pci_ss_info_13cc_0002
+#define pci_ss_info_13cc_0002 pci_ss_info_105d_493d_13cc_0002
+static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0003 =
+ {0x13cc, 0x0003, pci_subsys_105d_493d_13cc_0003, 0};
+#undef pci_ss_info_13cc_0003
+#define pci_ss_info_13cc_0003 pci_ss_info_105d_493d_13cc_0003
+static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0007 =
+ {0x13cc, 0x0007, pci_subsys_105d_493d_13cc_0007, 0};
+#undef pci_ss_info_13cc_0007
+#define pci_ss_info_13cc_0007 pci_ss_info_105d_493d_13cc_0007
+static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0008 =
+ {0x13cc, 0x0008, pci_subsys_105d_493d_13cc_0008, 0};
+#undef pci_ss_info_13cc_0008
+#define pci_ss_info_13cc_0008 pci_ss_info_105d_493d_13cc_0008
+static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_0009 =
+ {0x13cc, 0x0009, pci_subsys_105d_493d_13cc_0009, 0};
+#undef pci_ss_info_13cc_0009
+#define pci_ss_info_13cc_0009 pci_ss_info_105d_493d_13cc_0009
+static const pciSubsystemInfo pci_ss_info_105d_493d_13cc_000a =
+ {0x13cc, 0x000a, pci_subsys_105d_493d_13cc_000a, 0};
+#undef pci_ss_info_13cc_000a
+#define pci_ss_info_13cc_000a pci_ss_info_105d_493d_13cc_000a
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1073_0004_1073_0004 =
+ {0x1073, 0x0004, pci_subsys_1073_0004_1073_0004, 0};
+#undef pci_ss_info_1073_0004
+#define pci_ss_info_1073_0004 pci_ss_info_1073_0004_1073_0004
+static const pciSubsystemInfo pci_ss_info_1073_0005_1073_0005 =
+ {0x1073, 0x0005, pci_subsys_1073_0005_1073_0005, 0};
+#undef pci_ss_info_1073_0005
+#define pci_ss_info_1073_0005 pci_ss_info_1073_0005_1073_0005
+static const pciSubsystemInfo pci_ss_info_1073_0008_1073_0008 =
+ {0x1073, 0x0008, pci_subsys_1073_0008_1073_0008, 0};
+#undef pci_ss_info_1073_0008
+#define pci_ss_info_1073_0008 pci_ss_info_1073_0008_1073_0008
+static const pciSubsystemInfo pci_ss_info_1073_000a_1073_0004 =
+ {0x1073, 0x0004, pci_subsys_1073_000a_1073_0004, 0};
+#undef pci_ss_info_1073_0004
+#define pci_ss_info_1073_0004 pci_ss_info_1073_000a_1073_0004
+static const pciSubsystemInfo pci_ss_info_1073_000a_1073_000a =
+ {0x1073, 0x000a, pci_subsys_1073_000a_1073_000a, 0};
+#undef pci_ss_info_1073_000a
+#define pci_ss_info_1073_000a pci_ss_info_1073_000a_1073_000a
+static const pciSubsystemInfo pci_ss_info_1073_000c_107a_000c =
+ {0x107a, 0x000c, pci_subsys_1073_000c_107a_000c, 0};
+#undef pci_ss_info_107a_000c
+#define pci_ss_info_107a_000c pci_ss_info_1073_000c_107a_000c
+static const pciSubsystemInfo pci_ss_info_1073_000d_1073_000d =
+ {0x1073, 0x000d, pci_subsys_1073_000d_1073_000d, 0};
+#undef pci_ss_info_1073_000d
+#define pci_ss_info_1073_000d pci_ss_info_1073_000d_1073_000d
+static const pciSubsystemInfo pci_ss_info_1073_0010_1073_0006 =
+ {0x1073, 0x0006, pci_subsys_1073_0010_1073_0006, 0};
+#undef pci_ss_info_1073_0006
+#define pci_ss_info_1073_0006 pci_ss_info_1073_0010_1073_0006
+static const pciSubsystemInfo pci_ss_info_1073_0010_1073_0010 =
+ {0x1073, 0x0010, pci_subsys_1073_0010_1073_0010, 0};
+#undef pci_ss_info_1073_0010
+#define pci_ss_info_1073_0010 pci_ss_info_1073_0010_1073_0010
+static const pciSubsystemInfo pci_ss_info_1073_0012_1073_0012 =
+ {0x1073, 0x0012, pci_subsys_1073_0012_1073_0012, 0};
+#undef pci_ss_info_1073_0012
+#define pci_ss_info_1073_0012 pci_ss_info_1073_0012_1073_0012
+static const pciSubsystemInfo pci_ss_info_1073_2000_1073_2000 =
+ {0x1073, 0x2000, pci_subsys_1073_2000_1073_2000, 0};
+#undef pci_ss_info_1073_2000
+#define pci_ss_info_1073_2000 pci_ss_info_1073_2000_1073_2000
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1077_1216_101e_8471 =
+ {0x101e, 0x8471, pci_subsys_1077_1216_101e_8471, 0};
+#undef pci_ss_info_101e_8471
+#define pci_ss_info_101e_8471 pci_ss_info_1077_1216_101e_8471
+static const pciSubsystemInfo pci_ss_info_1077_1216_101e_8493 =
+ {0x101e, 0x8493, pci_subsys_1077_1216_101e_8493, 0};
+#undef pci_ss_info_101e_8493
+#define pci_ss_info_101e_8493 pci_ss_info_1077_1216_101e_8493
+static const pciSubsystemInfo pci_ss_info_1077_2100_1077_0001 =
+ {0x1077, 0x0001, pci_subsys_1077_2100_1077_0001, 0};
+#undef pci_ss_info_1077_0001
+#define pci_ss_info_1077_0001 pci_ss_info_1077_2100_1077_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_108d_0004_108d_0004 =
+ {0x108d, 0x0004, pci_subsys_108d_0004_108d_0004, 0};
+#undef pci_ss_info_108d_0004
+#define pci_ss_info_108d_0004 pci_ss_info_108d_0004_108d_0004
+static const pciSubsystemInfo pci_ss_info_108d_0007_108d_0007 =
+ {0x108d, 0x0007, pci_subsys_108d_0007_108d_0007, 0};
+#undef pci_ss_info_108d_0007
+#define pci_ss_info_108d_0007 pci_ss_info_108d_0007_108d_0007
+static const pciSubsystemInfo pci_ss_info_108d_0008_108d_0008 =
+ {0x108d, 0x0008, pci_subsys_108d_0008_108d_0008, 0};
+#undef pci_ss_info_108d_0008
+#define pci_ss_info_108d_0008 pci_ss_info_108d_0008_108d_0008
+static const pciSubsystemInfo pci_ss_info_108d_0019_108d_0016 =
+ {0x108d, 0x0016, pci_subsys_108d_0019_108d_0016, 0};
+#undef pci_ss_info_108d_0016
+#define pci_ss_info_108d_0016 pci_ss_info_108d_0019_108d_0016
+static const pciSubsystemInfo pci_ss_info_108d_0019_108d_0017 =
+ {0x108d, 0x0017, pci_subsys_108d_0019_108d_0017, 0};
+#undef pci_ss_info_108d_0017
+#define pci_ss_info_108d_0017 pci_ss_info_108d_0019_108d_0017
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1095_0649_0e11_005d =
+ {0x0e11, 0x005d, pci_subsys_1095_0649_0e11_005d, 0};
+#undef pci_ss_info_0e11_005d
+#define pci_ss_info_0e11_005d pci_ss_info_1095_0649_0e11_005d
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1095_0649_0e11_007e =
+ {0x0e11, 0x007e, pci_subsys_1095_0649_0e11_007e, 0};
+#undef pci_ss_info_0e11_007e
+#define pci_ss_info_0e11_007e pci_ss_info_1095_0649_0e11_007e
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1095_0649_101e_0649 =
+ {0x101e, 0x0649, pci_subsys_1095_0649_101e_0649, 0};
+#undef pci_ss_info_101e_0649
+#define pci_ss_info_101e_0649 pci_ss_info_1095_0649_101e_0649
+static const pciSubsystemInfo pci_ss_info_1095_0670_1095_0670 =
+ {0x1095, 0x0670, pci_subsys_1095_0670_1095_0670, 0};
+#undef pci_ss_info_1095_0670
+#define pci_ss_info_1095_0670 pci_ss_info_1095_0670_1095_0670
+#endif
+static const pciSubsystemInfo pci_ss_info_109e_0369_1002_0001 =
+ {0x1002, 0x0001, pci_subsys_109e_0369_1002_0001, 0};
+#undef pci_ss_info_1002_0001
+#define pci_ss_info_1002_0001 pci_ss_info_109e_0369_1002_0001
+static const pciSubsystemInfo pci_ss_info_109e_0369_1002_0003 =
+ {0x1002, 0x0003, pci_subsys_109e_0369_1002_0003, 0};
+#undef pci_ss_info_1002_0003
+#define pci_ss_info_1002_0003 pci_ss_info_109e_0369_1002_0003
+static const pciSubsystemInfo pci_ss_info_109e_036c_13e9_0070 =
+ {0x13e9, 0x0070, pci_subsys_109e_036c_13e9_0070, 0};
+#undef pci_ss_info_13e9_0070
+#define pci_ss_info_13e9_0070 pci_ss_info_109e_036c_13e9_0070
+static const pciSubsystemInfo pci_ss_info_109e_036e_0070_13eb =
+ {0x0070, 0x13eb, pci_subsys_109e_036e_0070_13eb, 0};
+#undef pci_ss_info_0070_13eb
+#define pci_ss_info_0070_13eb pci_ss_info_109e_036e_0070_13eb
+static const pciSubsystemInfo pci_ss_info_109e_036e_0070_ff01 =
+ {0x0070, 0xff01, pci_subsys_109e_036e_0070_ff01, 0};
+#undef pci_ss_info_0070_ff01
+#define pci_ss_info_0070_ff01 pci_ss_info_109e_036e_0070_ff01
+static const pciSubsystemInfo pci_ss_info_109e_036e_107d_6606 =
+ {0x107d, 0x6606, pci_subsys_109e_036e_107d_6606, 0};
+#undef pci_ss_info_107d_6606
+#define pci_ss_info_107d_6606 pci_ss_info_109e_036e_107d_6606
+static const pciSubsystemInfo pci_ss_info_109e_036e_11bd_0012 =
+ {0x11bd, 0x0012, pci_subsys_109e_036e_11bd_0012, 0};
+#undef pci_ss_info_11bd_0012
+#define pci_ss_info_11bd_0012 pci_ss_info_109e_036e_11bd_0012
+static const pciSubsystemInfo pci_ss_info_109e_036e_11bd_001c =
+ {0x11bd, 0x001c, pci_subsys_109e_036e_11bd_001c, 0};
+#undef pci_ss_info_11bd_001c
+#define pci_ss_info_11bd_001c pci_ss_info_109e_036e_11bd_001c
+static const pciSubsystemInfo pci_ss_info_109e_036e_127a_0001 =
+ {0x127a, 0x0001, pci_subsys_109e_036e_127a_0001, 0};
+#undef pci_ss_info_127a_0001
+#define pci_ss_info_127a_0001 pci_ss_info_109e_036e_127a_0001
+static const pciSubsystemInfo pci_ss_info_109e_036e_127a_0002 =
+ {0x127a, 0x0002, pci_subsys_109e_036e_127a_0002, 0};
+#undef pci_ss_info_127a_0002
+#define pci_ss_info_127a_0002 pci_ss_info_109e_036e_127a_0002
+static const pciSubsystemInfo pci_ss_info_109e_036e_127a_0003 =
+ {0x127a, 0x0003, pci_subsys_109e_036e_127a_0003, 0};
+#undef pci_ss_info_127a_0003
+#define pci_ss_info_127a_0003 pci_ss_info_109e_036e_127a_0003
+static const pciSubsystemInfo pci_ss_info_109e_036e_127a_0048 =
+ {0x127a, 0x0048, pci_subsys_109e_036e_127a_0048, 0};
+#undef pci_ss_info_127a_0048
+#define pci_ss_info_127a_0048 pci_ss_info_109e_036e_127a_0048
+static const pciSubsystemInfo pci_ss_info_109e_036e_144f_3000 =
+ {0x144f, 0x3000, pci_subsys_109e_036e_144f_3000, 0};
+#undef pci_ss_info_144f_3000
+#define pci_ss_info_144f_3000 pci_ss_info_109e_036e_144f_3000
+static const pciSubsystemInfo pci_ss_info_109e_036e_1461_0004 =
+ {0x1461, 0x0004, pci_subsys_109e_036e_1461_0004, 0};
+#undef pci_ss_info_1461_0004
+#define pci_ss_info_1461_0004 pci_ss_info_109e_036e_1461_0004
+static const pciSubsystemInfo pci_ss_info_109e_036e_14f1_0001 =
+ {0x14f1, 0x0001, pci_subsys_109e_036e_14f1_0001, 0};
+#undef pci_ss_info_14f1_0001
+#define pci_ss_info_14f1_0001 pci_ss_info_109e_036e_14f1_0001
+static const pciSubsystemInfo pci_ss_info_109e_036e_14f1_0002 =
+ {0x14f1, 0x0002, pci_subsys_109e_036e_14f1_0002, 0};
+#undef pci_ss_info_14f1_0002
+#define pci_ss_info_14f1_0002 pci_ss_info_109e_036e_14f1_0002
+static const pciSubsystemInfo pci_ss_info_109e_036e_14f1_0003 =
+ {0x14f1, 0x0003, pci_subsys_109e_036e_14f1_0003, 0};
+#undef pci_ss_info_14f1_0003
+#define pci_ss_info_14f1_0003 pci_ss_info_109e_036e_14f1_0003
+static const pciSubsystemInfo pci_ss_info_109e_036e_14f1_0048 =
+ {0x14f1, 0x0048, pci_subsys_109e_036e_14f1_0048, 0};
+#undef pci_ss_info_14f1_0048
+#define pci_ss_info_14f1_0048 pci_ss_info_109e_036e_14f1_0048
+static const pciSubsystemInfo pci_ss_info_109e_036e_1851_1850 =
+ {0x1851, 0x1850, pci_subsys_109e_036e_1851_1850, 0};
+#undef pci_ss_info_1851_1850
+#define pci_ss_info_1851_1850 pci_ss_info_109e_036e_1851_1850
+static const pciSubsystemInfo pci_ss_info_109e_036e_1851_1851 =
+ {0x1851, 0x1851, pci_subsys_109e_036e_1851_1851, 0};
+#undef pci_ss_info_1851_1851
+#define pci_ss_info_1851_1851 pci_ss_info_109e_036e_1851_1851
+static const pciSubsystemInfo pci_ss_info_109e_036e_1852_1852 =
+ {0x1852, 0x1852, pci_subsys_109e_036e_1852_1852, 0};
+#undef pci_ss_info_1852_1852
+#define pci_ss_info_1852_1852 pci_ss_info_109e_036e_1852_1852
+static const pciSubsystemInfo pci_ss_info_109e_036e_bd11_1200 =
+ {0xbd11, 0x1200, pci_subsys_109e_036e_bd11_1200, 0};
+#undef pci_ss_info_bd11_1200
+#define pci_ss_info_bd11_1200 pci_ss_info_109e_036e_bd11_1200
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0044 =
+ {0x127a, 0x0044, pci_subsys_109e_036f_127a_0044, 0};
+#undef pci_ss_info_127a_0044
+#define pci_ss_info_127a_0044 pci_ss_info_109e_036f_127a_0044
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0122 =
+ {0x127a, 0x0122, pci_subsys_109e_036f_127a_0122, 0};
+#undef pci_ss_info_127a_0122
+#define pci_ss_info_127a_0122 pci_ss_info_109e_036f_127a_0122
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0144 =
+ {0x127a, 0x0144, pci_subsys_109e_036f_127a_0144, 0};
+#undef pci_ss_info_127a_0144
+#define pci_ss_info_127a_0144 pci_ss_info_109e_036f_127a_0144
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0222 =
+ {0x127a, 0x0222, pci_subsys_109e_036f_127a_0222, 0};
+#undef pci_ss_info_127a_0222
+#define pci_ss_info_127a_0222 pci_ss_info_109e_036f_127a_0222
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0244 =
+ {0x127a, 0x0244, pci_subsys_109e_036f_127a_0244, 0};
+#undef pci_ss_info_127a_0244
+#define pci_ss_info_127a_0244 pci_ss_info_109e_036f_127a_0244
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0322 =
+ {0x127a, 0x0322, pci_subsys_109e_036f_127a_0322, 0};
+#undef pci_ss_info_127a_0322
+#define pci_ss_info_127a_0322 pci_ss_info_109e_036f_127a_0322
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_0422 =
+ {0x127a, 0x0422, pci_subsys_109e_036f_127a_0422, 0};
+#undef pci_ss_info_127a_0422
+#define pci_ss_info_127a_0422 pci_ss_info_109e_036f_127a_0422
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1122 =
+ {0x127a, 0x1122, pci_subsys_109e_036f_127a_1122, 0};
+#undef pci_ss_info_127a_1122
+#define pci_ss_info_127a_1122 pci_ss_info_109e_036f_127a_1122
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1222 =
+ {0x127a, 0x1222, pci_subsys_109e_036f_127a_1222, 0};
+#undef pci_ss_info_127a_1222
+#define pci_ss_info_127a_1222 pci_ss_info_109e_036f_127a_1222
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1322 =
+ {0x127a, 0x1322, pci_subsys_109e_036f_127a_1322, 0};
+#undef pci_ss_info_127a_1322
+#define pci_ss_info_127a_1322 pci_ss_info_109e_036f_127a_1322
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1522 =
+ {0x127a, 0x1522, pci_subsys_109e_036f_127a_1522, 0};
+#undef pci_ss_info_127a_1522
+#define pci_ss_info_127a_1522 pci_ss_info_109e_036f_127a_1522
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1622 =
+ {0x127a, 0x1622, pci_subsys_109e_036f_127a_1622, 0};
+#undef pci_ss_info_127a_1622
+#define pci_ss_info_127a_1622 pci_ss_info_109e_036f_127a_1622
+static const pciSubsystemInfo pci_ss_info_109e_036f_127a_1722 =
+ {0x127a, 0x1722, pci_subsys_109e_036f_127a_1722, 0};
+#undef pci_ss_info_127a_1722
+#define pci_ss_info_127a_1722 pci_ss_info_109e_036f_127a_1722
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0044 =
+ {0x14f1, 0x0044, pci_subsys_109e_036f_14f1_0044, 0};
+#undef pci_ss_info_14f1_0044
+#define pci_ss_info_14f1_0044 pci_ss_info_109e_036f_14f1_0044
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0122 =
+ {0x14f1, 0x0122, pci_subsys_109e_036f_14f1_0122, 0};
+#undef pci_ss_info_14f1_0122
+#define pci_ss_info_14f1_0122 pci_ss_info_109e_036f_14f1_0122
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0144 =
+ {0x14f1, 0x0144, pci_subsys_109e_036f_14f1_0144, 0};
+#undef pci_ss_info_14f1_0144
+#define pci_ss_info_14f1_0144 pci_ss_info_109e_036f_14f1_0144
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0222 =
+ {0x14f1, 0x0222, pci_subsys_109e_036f_14f1_0222, 0};
+#undef pci_ss_info_14f1_0222
+#define pci_ss_info_14f1_0222 pci_ss_info_109e_036f_14f1_0222
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0244 =
+ {0x14f1, 0x0244, pci_subsys_109e_036f_14f1_0244, 0};
+#undef pci_ss_info_14f1_0244
+#define pci_ss_info_14f1_0244 pci_ss_info_109e_036f_14f1_0244
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0322 =
+ {0x14f1, 0x0322, pci_subsys_109e_036f_14f1_0322, 0};
+#undef pci_ss_info_14f1_0322
+#define pci_ss_info_14f1_0322 pci_ss_info_109e_036f_14f1_0322
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_0422 =
+ {0x14f1, 0x0422, pci_subsys_109e_036f_14f1_0422, 0};
+#undef pci_ss_info_14f1_0422
+#define pci_ss_info_14f1_0422 pci_ss_info_109e_036f_14f1_0422
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1122 =
+ {0x14f1, 0x1122, pci_subsys_109e_036f_14f1_1122, 0};
+#undef pci_ss_info_14f1_1122
+#define pci_ss_info_14f1_1122 pci_ss_info_109e_036f_14f1_1122
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1222 =
+ {0x14f1, 0x1222, pci_subsys_109e_036f_14f1_1222, 0};
+#undef pci_ss_info_14f1_1222
+#define pci_ss_info_14f1_1222 pci_ss_info_109e_036f_14f1_1222
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1322 =
+ {0x14f1, 0x1322, pci_subsys_109e_036f_14f1_1322, 0};
+#undef pci_ss_info_14f1_1322
+#define pci_ss_info_14f1_1322 pci_ss_info_109e_036f_14f1_1322
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1522 =
+ {0x14f1, 0x1522, pci_subsys_109e_036f_14f1_1522, 0};
+#undef pci_ss_info_14f1_1522
+#define pci_ss_info_14f1_1522 pci_ss_info_109e_036f_14f1_1522
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1622 =
+ {0x14f1, 0x1622, pci_subsys_109e_036f_14f1_1622, 0};
+#undef pci_ss_info_14f1_1622
+#define pci_ss_info_14f1_1622 pci_ss_info_109e_036f_14f1_1622
+static const pciSubsystemInfo pci_ss_info_109e_036f_14f1_1722 =
+ {0x14f1, 0x1722, pci_subsys_109e_036f_14f1_1722, 0};
+#undef pci_ss_info_14f1_1722
+#define pci_ss_info_14f1_1722 pci_ss_info_109e_036f_14f1_1722
+static const pciSubsystemInfo pci_ss_info_109e_036f_1851_1850 =
+ {0x1851, 0x1850, pci_subsys_109e_036f_1851_1850, 0};
+#undef pci_ss_info_1851_1850
+#define pci_ss_info_1851_1850 pci_ss_info_109e_036f_1851_1850
+static const pciSubsystemInfo pci_ss_info_109e_036f_1851_1851 =
+ {0x1851, 0x1851, pci_subsys_109e_036f_1851_1851, 0};
+#undef pci_ss_info_1851_1851
+#define pci_ss_info_1851_1851 pci_ss_info_109e_036f_1851_1851
+static const pciSubsystemInfo pci_ss_info_109e_036f_1852_1852 =
+ {0x1852, 0x1852, pci_subsys_109e_036f_1852_1852, 0};
+#undef pci_ss_info_1852_1852
+#define pci_ss_info_1852_1852 pci_ss_info_109e_036f_1852_1852
+static const pciSubsystemInfo pci_ss_info_109e_0370_1851_1850 =
+ {0x1851, 0x1850, pci_subsys_109e_0370_1851_1850, 0};
+#undef pci_ss_info_1851_1850
+#define pci_ss_info_1851_1850 pci_ss_info_109e_0370_1851_1850
+static const pciSubsystemInfo pci_ss_info_109e_0370_1851_1851 =
+ {0x1851, 0x1851, pci_subsys_109e_0370_1851_1851, 0};
+#undef pci_ss_info_1851_1851
+#define pci_ss_info_1851_1851 pci_ss_info_109e_0370_1851_1851
+static const pciSubsystemInfo pci_ss_info_109e_0370_1852_1852 =
+ {0x1852, 0x1852, pci_subsys_109e_0370_1852_1852, 0};
+#undef pci_ss_info_1852_1852
+#define pci_ss_info_1852_1852 pci_ss_info_109e_0370_1852_1852
+static const pciSubsystemInfo pci_ss_info_109e_0878_0070_13eb =
+ {0x0070, 0x13eb, pci_subsys_109e_0878_0070_13eb, 0};
+#undef pci_ss_info_0070_13eb
+#define pci_ss_info_0070_13eb pci_ss_info_109e_0878_0070_13eb
+static const pciSubsystemInfo pci_ss_info_109e_0878_0070_ff01 =
+ {0x0070, 0xff01, pci_subsys_109e_0878_0070_ff01, 0};
+#undef pci_ss_info_0070_ff01
+#define pci_ss_info_0070_ff01 pci_ss_info_109e_0878_0070_ff01
+static const pciSubsystemInfo pci_ss_info_109e_0878_1002_0001 =
+ {0x1002, 0x0001, pci_subsys_109e_0878_1002_0001, 0};
+#undef pci_ss_info_1002_0001
+#define pci_ss_info_1002_0001 pci_ss_info_109e_0878_1002_0001
+static const pciSubsystemInfo pci_ss_info_109e_0878_1002_0003 =
+ {0x1002, 0x0003, pci_subsys_109e_0878_1002_0003, 0};
+#undef pci_ss_info_1002_0003
+#define pci_ss_info_1002_0003 pci_ss_info_109e_0878_1002_0003
+static const pciSubsystemInfo pci_ss_info_109e_0878_11bd_0012 =
+ {0x11bd, 0x0012, pci_subsys_109e_0878_11bd_0012, 0};
+#undef pci_ss_info_11bd_0012
+#define pci_ss_info_11bd_0012 pci_ss_info_109e_0878_11bd_0012
+static const pciSubsystemInfo pci_ss_info_109e_0878_11bd_001c =
+ {0x11bd, 0x001c, pci_subsys_109e_0878_11bd_001c, 0};
+#undef pci_ss_info_11bd_001c
+#define pci_ss_info_11bd_001c pci_ss_info_109e_0878_11bd_001c
+static const pciSubsystemInfo pci_ss_info_109e_0878_127a_0001 =
+ {0x127a, 0x0001, pci_subsys_109e_0878_127a_0001, 0};
+#undef pci_ss_info_127a_0001
+#define pci_ss_info_127a_0001 pci_ss_info_109e_0878_127a_0001
+static const pciSubsystemInfo pci_ss_info_109e_0878_127a_0002 =
+ {0x127a, 0x0002, pci_subsys_109e_0878_127a_0002, 0};
+#undef pci_ss_info_127a_0002
+#define pci_ss_info_127a_0002 pci_ss_info_109e_0878_127a_0002
+static const pciSubsystemInfo pci_ss_info_109e_0878_127a_0003 =
+ {0x127a, 0x0003, pci_subsys_109e_0878_127a_0003, 0};
+#undef pci_ss_info_127a_0003
+#define pci_ss_info_127a_0003 pci_ss_info_109e_0878_127a_0003
+static const pciSubsystemInfo pci_ss_info_109e_0878_127a_0048 =
+ {0x127a, 0x0048, pci_subsys_109e_0878_127a_0048, 0};
+#undef pci_ss_info_127a_0048
+#define pci_ss_info_127a_0048 pci_ss_info_109e_0878_127a_0048
+static const pciSubsystemInfo pci_ss_info_109e_0878_13e9_0070 =
+ {0x13e9, 0x0070, pci_subsys_109e_0878_13e9_0070, 0};
+#undef pci_ss_info_13e9_0070
+#define pci_ss_info_13e9_0070 pci_ss_info_109e_0878_13e9_0070
+static const pciSubsystemInfo pci_ss_info_109e_0878_144f_3000 =
+ {0x144f, 0x3000, pci_subsys_109e_0878_144f_3000, 0};
+#undef pci_ss_info_144f_3000
+#define pci_ss_info_144f_3000 pci_ss_info_109e_0878_144f_3000
+static const pciSubsystemInfo pci_ss_info_109e_0878_1461_0004 =
+ {0x1461, 0x0004, pci_subsys_109e_0878_1461_0004, 0};
+#undef pci_ss_info_1461_0004
+#define pci_ss_info_1461_0004 pci_ss_info_109e_0878_1461_0004
+static const pciSubsystemInfo pci_ss_info_109e_0878_14f1_0001 =
+ {0x14f1, 0x0001, pci_subsys_109e_0878_14f1_0001, 0};
+#undef pci_ss_info_14f1_0001
+#define pci_ss_info_14f1_0001 pci_ss_info_109e_0878_14f1_0001
+static const pciSubsystemInfo pci_ss_info_109e_0878_14f1_0002 =
+ {0x14f1, 0x0002, pci_subsys_109e_0878_14f1_0002, 0};
+#undef pci_ss_info_14f1_0002
+#define pci_ss_info_14f1_0002 pci_ss_info_109e_0878_14f1_0002
+static const pciSubsystemInfo pci_ss_info_109e_0878_14f1_0003 =
+ {0x14f1, 0x0003, pci_subsys_109e_0878_14f1_0003, 0};
+#undef pci_ss_info_14f1_0003
+#define pci_ss_info_14f1_0003 pci_ss_info_109e_0878_14f1_0003
+static const pciSubsystemInfo pci_ss_info_109e_0878_14f1_0048 =
+ {0x14f1, 0x0048, pci_subsys_109e_0878_14f1_0048, 0};
+#undef pci_ss_info_14f1_0048
+#define pci_ss_info_14f1_0048 pci_ss_info_109e_0878_14f1_0048
+static const pciSubsystemInfo pci_ss_info_109e_0878_bd11_1200 =
+ {0xbd11, 0x1200, pci_subsys_109e_0878_bd11_1200, 0};
+#undef pci_ss_info_bd11_1200
+#define pci_ss_info_bd11_1200 pci_ss_info_109e_0878_bd11_1200
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0044 =
+ {0x127a, 0x0044, pci_subsys_109e_0879_127a_0044, 0};
+#undef pci_ss_info_127a_0044
+#define pci_ss_info_127a_0044 pci_ss_info_109e_0879_127a_0044
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0122 =
+ {0x127a, 0x0122, pci_subsys_109e_0879_127a_0122, 0};
+#undef pci_ss_info_127a_0122
+#define pci_ss_info_127a_0122 pci_ss_info_109e_0879_127a_0122
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0144 =
+ {0x127a, 0x0144, pci_subsys_109e_0879_127a_0144, 0};
+#undef pci_ss_info_127a_0144
+#define pci_ss_info_127a_0144 pci_ss_info_109e_0879_127a_0144
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0222 =
+ {0x127a, 0x0222, pci_subsys_109e_0879_127a_0222, 0};
+#undef pci_ss_info_127a_0222
+#define pci_ss_info_127a_0222 pci_ss_info_109e_0879_127a_0222
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0244 =
+ {0x127a, 0x0244, pci_subsys_109e_0879_127a_0244, 0};
+#undef pci_ss_info_127a_0244
+#define pci_ss_info_127a_0244 pci_ss_info_109e_0879_127a_0244
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0322 =
+ {0x127a, 0x0322, pci_subsys_109e_0879_127a_0322, 0};
+#undef pci_ss_info_127a_0322
+#define pci_ss_info_127a_0322 pci_ss_info_109e_0879_127a_0322
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_0422 =
+ {0x127a, 0x0422, pci_subsys_109e_0879_127a_0422, 0};
+#undef pci_ss_info_127a_0422
+#define pci_ss_info_127a_0422 pci_ss_info_109e_0879_127a_0422
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1122 =
+ {0x127a, 0x1122, pci_subsys_109e_0879_127a_1122, 0};
+#undef pci_ss_info_127a_1122
+#define pci_ss_info_127a_1122 pci_ss_info_109e_0879_127a_1122
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1222 =
+ {0x127a, 0x1222, pci_subsys_109e_0879_127a_1222, 0};
+#undef pci_ss_info_127a_1222
+#define pci_ss_info_127a_1222 pci_ss_info_109e_0879_127a_1222
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1322 =
+ {0x127a, 0x1322, pci_subsys_109e_0879_127a_1322, 0};
+#undef pci_ss_info_127a_1322
+#define pci_ss_info_127a_1322 pci_ss_info_109e_0879_127a_1322
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1522 =
+ {0x127a, 0x1522, pci_subsys_109e_0879_127a_1522, 0};
+#undef pci_ss_info_127a_1522
+#define pci_ss_info_127a_1522 pci_ss_info_109e_0879_127a_1522
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1622 =
+ {0x127a, 0x1622, pci_subsys_109e_0879_127a_1622, 0};
+#undef pci_ss_info_127a_1622
+#define pci_ss_info_127a_1622 pci_ss_info_109e_0879_127a_1622
+static const pciSubsystemInfo pci_ss_info_109e_0879_127a_1722 =
+ {0x127a, 0x1722, pci_subsys_109e_0879_127a_1722, 0};
+#undef pci_ss_info_127a_1722
+#define pci_ss_info_127a_1722 pci_ss_info_109e_0879_127a_1722
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0044 =
+ {0x14f1, 0x0044, pci_subsys_109e_0879_14f1_0044, 0};
+#undef pci_ss_info_14f1_0044
+#define pci_ss_info_14f1_0044 pci_ss_info_109e_0879_14f1_0044
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0122 =
+ {0x14f1, 0x0122, pci_subsys_109e_0879_14f1_0122, 0};
+#undef pci_ss_info_14f1_0122
+#define pci_ss_info_14f1_0122 pci_ss_info_109e_0879_14f1_0122
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0144 =
+ {0x14f1, 0x0144, pci_subsys_109e_0879_14f1_0144, 0};
+#undef pci_ss_info_14f1_0144
+#define pci_ss_info_14f1_0144 pci_ss_info_109e_0879_14f1_0144
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0222 =
+ {0x14f1, 0x0222, pci_subsys_109e_0879_14f1_0222, 0};
+#undef pci_ss_info_14f1_0222
+#define pci_ss_info_14f1_0222 pci_ss_info_109e_0879_14f1_0222
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0244 =
+ {0x14f1, 0x0244, pci_subsys_109e_0879_14f1_0244, 0};
+#undef pci_ss_info_14f1_0244
+#define pci_ss_info_14f1_0244 pci_ss_info_109e_0879_14f1_0244
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0322 =
+ {0x14f1, 0x0322, pci_subsys_109e_0879_14f1_0322, 0};
+#undef pci_ss_info_14f1_0322
+#define pci_ss_info_14f1_0322 pci_ss_info_109e_0879_14f1_0322
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_0422 =
+ {0x14f1, 0x0422, pci_subsys_109e_0879_14f1_0422, 0};
+#undef pci_ss_info_14f1_0422
+#define pci_ss_info_14f1_0422 pci_ss_info_109e_0879_14f1_0422
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1122 =
+ {0x14f1, 0x1122, pci_subsys_109e_0879_14f1_1122, 0};
+#undef pci_ss_info_14f1_1122
+#define pci_ss_info_14f1_1122 pci_ss_info_109e_0879_14f1_1122
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1222 =
+ {0x14f1, 0x1222, pci_subsys_109e_0879_14f1_1222, 0};
+#undef pci_ss_info_14f1_1222
+#define pci_ss_info_14f1_1222 pci_ss_info_109e_0879_14f1_1222
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1322 =
+ {0x14f1, 0x1322, pci_subsys_109e_0879_14f1_1322, 0};
+#undef pci_ss_info_14f1_1322
+#define pci_ss_info_14f1_1322 pci_ss_info_109e_0879_14f1_1322
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1522 =
+ {0x14f1, 0x1522, pci_subsys_109e_0879_14f1_1522, 0};
+#undef pci_ss_info_14f1_1522
+#define pci_ss_info_14f1_1522 pci_ss_info_109e_0879_14f1_1522
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1622 =
+ {0x14f1, 0x1622, pci_subsys_109e_0879_14f1_1622, 0};
+#undef pci_ss_info_14f1_1622
+#define pci_ss_info_14f1_1622 pci_ss_info_109e_0879_14f1_1622
+static const pciSubsystemInfo pci_ss_info_109e_0879_14f1_1722 =
+ {0x14f1, 0x1722, pci_subsys_109e_0879_14f1_1722, 0};
+#undef pci_ss_info_14f1_1722
+#define pci_ss_info_14f1_1722 pci_ss_info_109e_0879_14f1_1722
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10b4_1b1d_10b4_237e =
+ {0x10b4, 0x237e, pci_subsys_10b4_1b1d_10b4_237e, 0};
+#undef pci_ss_info_10b4_237e
+#define pci_ss_info_10b4_237e pci_ss_info_10b4_1b1d_10b4_237e
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10b5_9030_15ed_1002 =
+ {0x15ed, 0x1002, pci_subsys_10b5_9030_15ed_1002, 0};
+#undef pci_ss_info_15ed_1002
+#define pci_ss_info_15ed_1002 pci_ss_info_10b5_9030_15ed_1002
+static const pciSubsystemInfo pci_ss_info_10b5_9030_15ed_1003 =
+ {0x15ed, 0x1003, pci_subsys_10b5_9030_15ed_1003, 0};
+#undef pci_ss_info_15ed_1003
+#define pci_ss_info_15ed_1003 pci_ss_info_10b5_9030_15ed_1003
+static const pciSubsystemInfo pci_ss_info_10b5_9050_10b5_2036 =
+ {0x10b5, 0x2036, pci_subsys_10b5_9050_10b5_2036, 0};
+#undef pci_ss_info_10b5_2036
+#define pci_ss_info_10b5_2036 pci_ss_info_10b5_9050_10b5_2036
+static const pciSubsystemInfo pci_ss_info_10b5_9050_10b5_2273 =
+ {0x10b5, 0x2273, pci_subsys_10b5_9050_10b5_2273, 0};
+#undef pci_ss_info_10b5_2273
+#define pci_ss_info_10b5_2273 pci_ss_info_10b5_9050_10b5_2273
+static const pciSubsystemInfo pci_ss_info_10b5_9050_10b5_9050 =
+ {0x10b5, 0x9050, pci_subsys_10b5_9050_10b5_9050, 0};
+#undef pci_ss_info_10b5_9050
+#define pci_ss_info_10b5_9050 pci_ss_info_10b5_9050_10b5_9050
+static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0001 =
+ {0x1522, 0x0001, pci_subsys_10b5_9050_1522_0001, 0};
+#undef pci_ss_info_1522_0001
+#define pci_ss_info_1522_0001 pci_ss_info_10b5_9050_1522_0001
+static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0002 =
+ {0x1522, 0x0002, pci_subsys_10b5_9050_1522_0002, 0};
+#undef pci_ss_info_1522_0002
+#define pci_ss_info_1522_0002 pci_ss_info_10b5_9050_1522_0002
+static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0003 =
+ {0x1522, 0x0003, pci_subsys_10b5_9050_1522_0003, 0};
+#undef pci_ss_info_1522_0003
+#define pci_ss_info_1522_0003 pci_ss_info_10b5_9050_1522_0003
+static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0004 =
+ {0x1522, 0x0004, pci_subsys_10b5_9050_1522_0004, 0};
+#undef pci_ss_info_1522_0004
+#define pci_ss_info_1522_0004 pci_ss_info_10b5_9050_1522_0004
+static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0010 =
+ {0x1522, 0x0010, pci_subsys_10b5_9050_1522_0010, 0};
+#undef pci_ss_info_1522_0010
+#define pci_ss_info_1522_0010 pci_ss_info_10b5_9050_1522_0010
+static const pciSubsystemInfo pci_ss_info_10b5_9050_1522_0020 =
+ {0x1522, 0x0020, pci_subsys_10b5_9050_1522_0020, 0};
+#undef pci_ss_info_1522_0020
+#define pci_ss_info_1522_0020 pci_ss_info_10b5_9050_1522_0020
+static const pciSubsystemInfo pci_ss_info_10b5_9050_15ed_1000 =
+ {0x15ed, 0x1000, pci_subsys_10b5_9050_15ed_1000, 0};
+#undef pci_ss_info_15ed_1000
+#define pci_ss_info_15ed_1000 pci_ss_info_10b5_9050_15ed_1000
+static const pciSubsystemInfo pci_ss_info_10b5_9050_15ed_1001 =
+ {0x15ed, 0x1001, pci_subsys_10b5_9050_15ed_1001, 0};
+#undef pci_ss_info_15ed_1001
+#define pci_ss_info_15ed_1001 pci_ss_info_10b5_9050_15ed_1001
+static const pciSubsystemInfo pci_ss_info_10b5_9050_15ed_1002 =
+ {0x15ed, 0x1002, pci_subsys_10b5_9050_15ed_1002, 0};
+#undef pci_ss_info_15ed_1002
+#define pci_ss_info_15ed_1002 pci_ss_info_10b5_9050_15ed_1002
+static const pciSubsystemInfo pci_ss_info_10b5_9050_15ed_1003 =
+ {0x15ed, 0x1003, pci_subsys_10b5_9050_15ed_1003, 0};
+#undef pci_ss_info_15ed_1003
+#define pci_ss_info_15ed_1003 pci_ss_info_10b5_9050_15ed_1003
+static const pciSubsystemInfo pci_ss_info_10b5_9050_5654_5634 =
+ {0x5654, 0x5634, pci_subsys_10b5_9050_5654_5634, 0};
+#undef pci_ss_info_5654_5634
+#define pci_ss_info_5654_5634 pci_ss_info_10b5_9050_5654_5634
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d531_c002 =
+ {0xd531, 0xc002, pci_subsys_10b5_9050_d531_c002, 0};
+#undef pci_ss_info_d531_c002
+#define pci_ss_info_d531_c002 pci_ss_info_10b5_9050_d531_c002
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4006 =
+ {0xd84d, 0x4006, pci_subsys_10b5_9050_d84d_4006, 0};
+#undef pci_ss_info_d84d_4006
+#define pci_ss_info_d84d_4006 pci_ss_info_10b5_9050_d84d_4006
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4008 =
+ {0xd84d, 0x4008, pci_subsys_10b5_9050_d84d_4008, 0};
+#undef pci_ss_info_d84d_4008
+#define pci_ss_info_d84d_4008 pci_ss_info_10b5_9050_d84d_4008
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4014 =
+ {0xd84d, 0x4014, pci_subsys_10b5_9050_d84d_4014, 0};
+#undef pci_ss_info_d84d_4014
+#define pci_ss_info_d84d_4014 pci_ss_info_10b5_9050_d84d_4014
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4018 =
+ {0xd84d, 0x4018, pci_subsys_10b5_9050_d84d_4018, 0};
+#undef pci_ss_info_d84d_4018
+#define pci_ss_info_d84d_4018 pci_ss_info_10b5_9050_d84d_4018
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4025 =
+ {0xd84d, 0x4025, pci_subsys_10b5_9050_d84d_4025, 0};
+#undef pci_ss_info_d84d_4025
+#define pci_ss_info_d84d_4025 pci_ss_info_10b5_9050_d84d_4025
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4027 =
+ {0xd84d, 0x4027, pci_subsys_10b5_9050_d84d_4027, 0};
+#undef pci_ss_info_d84d_4027
+#define pci_ss_info_d84d_4027 pci_ss_info_10b5_9050_d84d_4027
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4028 =
+ {0xd84d, 0x4028, pci_subsys_10b5_9050_d84d_4028, 0};
+#undef pci_ss_info_d84d_4028
+#define pci_ss_info_d84d_4028 pci_ss_info_10b5_9050_d84d_4028
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4036 =
+ {0xd84d, 0x4036, pci_subsys_10b5_9050_d84d_4036, 0};
+#undef pci_ss_info_d84d_4036
+#define pci_ss_info_d84d_4036 pci_ss_info_10b5_9050_d84d_4036
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4037 =
+ {0xd84d, 0x4037, pci_subsys_10b5_9050_d84d_4037, 0};
+#undef pci_ss_info_d84d_4037
+#define pci_ss_info_d84d_4037 pci_ss_info_10b5_9050_d84d_4037
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4038 =
+ {0xd84d, 0x4038, pci_subsys_10b5_9050_d84d_4038, 0};
+#undef pci_ss_info_d84d_4038
+#define pci_ss_info_d84d_4038 pci_ss_info_10b5_9050_d84d_4038
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4052 =
+ {0xd84d, 0x4052, pci_subsys_10b5_9050_d84d_4052, 0};
+#undef pci_ss_info_d84d_4052
+#define pci_ss_info_d84d_4052 pci_ss_info_10b5_9050_d84d_4052
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4053 =
+ {0xd84d, 0x4053, pci_subsys_10b5_9050_d84d_4053, 0};
+#undef pci_ss_info_d84d_4053
+#define pci_ss_info_d84d_4053 pci_ss_info_10b5_9050_d84d_4053
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4055 =
+ {0xd84d, 0x4055, pci_subsys_10b5_9050_d84d_4055, 0};
+#undef pci_ss_info_d84d_4055
+#define pci_ss_info_d84d_4055 pci_ss_info_10b5_9050_d84d_4055
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4058 =
+ {0xd84d, 0x4058, pci_subsys_10b5_9050_d84d_4058, 0};
+#undef pci_ss_info_d84d_4058
+#define pci_ss_info_d84d_4058 pci_ss_info_10b5_9050_d84d_4058
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4065 =
+ {0xd84d, 0x4065, pci_subsys_10b5_9050_d84d_4065, 0};
+#undef pci_ss_info_d84d_4065
+#define pci_ss_info_d84d_4065 pci_ss_info_10b5_9050_d84d_4065
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4068 =
+ {0xd84d, 0x4068, pci_subsys_10b5_9050_d84d_4068, 0};
+#undef pci_ss_info_d84d_4068
+#define pci_ss_info_d84d_4068 pci_ss_info_10b5_9050_d84d_4068
+static const pciSubsystemInfo pci_ss_info_10b5_9050_d84d_4078 =
+ {0xd84d, 0x4078, pci_subsys_10b5_9050_d84d_4078, 0};
+#undef pci_ss_info_d84d_4078
+#define pci_ss_info_d84d_4078 pci_ss_info_10b5_9050_d84d_4078
+static const pciSubsystemInfo pci_ss_info_10b5_9054_10b5_2455 =
+ {0x10b5, 0x2455, pci_subsys_10b5_9054_10b5_2455, 0};
+#undef pci_ss_info_10b5_2455
+#define pci_ss_info_10b5_2455 pci_ss_info_10b5_9054_10b5_2455
+static const pciSubsystemInfo pci_ss_info_10b5_906d_125c_0640 =
+ {0x125c, 0x0640, pci_subsys_10b5_906d_125c_0640, 0};
+#undef pci_ss_info_125c_0640
+#define pci_ss_info_125c_0640 pci_ss_info_10b5_906d_125c_0640
+static const pciSubsystemInfo pci_ss_info_10b5_9080_10b5_9080 =
+ {0x10b5, 0x9080, pci_subsys_10b5_9080_10b5_9080, 0};
+#undef pci_ss_info_10b5_9080
+#define pci_ss_info_10b5_9080 pci_ss_info_10b5_9080_10b5_9080
+static const pciSubsystemInfo pci_ss_info_10b5_9080_129d_0002 =
+ {0x129d, 0x0002, pci_subsys_10b5_9080_129d_0002, 0};
+#undef pci_ss_info_129d_0002
+#define pci_ss_info_129d_0002 pci_ss_info_10b5_9080_129d_0002
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10b6_0002_10b6_0002 =
+ {0x10b6, 0x0002, pci_subsys_10b6_0002_10b6_0002, 0};
+#undef pci_ss_info_10b6_0002
+#define pci_ss_info_10b6_0002 pci_ss_info_10b6_0002_10b6_0002
+static const pciSubsystemInfo pci_ss_info_10b6_0002_10b6_0006 =
+ {0x10b6, 0x0006, pci_subsys_10b6_0002_10b6_0006, 0};
+#undef pci_ss_info_10b6_0006
+#define pci_ss_info_10b6_0006 pci_ss_info_10b6_0002_10b6_0006
+#endif
+static const pciSubsystemInfo pci_ss_info_10b6_0003_0e11_b0fd =
+ {0x0e11, 0xb0fd, pci_subsys_10b6_0003_0e11_b0fd, 0};
+#undef pci_ss_info_0e11_b0fd
+#define pci_ss_info_0e11_b0fd pci_ss_info_10b6_0003_0e11_b0fd
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10b6_0003_10b6_0003 =
+ {0x10b6, 0x0003, pci_subsys_10b6_0003_10b6_0003, 0};
+#undef pci_ss_info_10b6_0003
+#define pci_ss_info_10b6_0003 pci_ss_info_10b6_0003_10b6_0003
+static const pciSubsystemInfo pci_ss_info_10b6_0003_10b6_0007 =
+ {0x10b6, 0x0007, pci_subsys_10b6_0003_10b6_0007, 0};
+#undef pci_ss_info_10b6_0007
+#define pci_ss_info_10b6_0007 pci_ss_info_10b6_0003_10b6_0007
+static const pciSubsystemInfo pci_ss_info_10b6_0006_10b6_0006 =
+ {0x10b6, 0x0006, pci_subsys_10b6_0006_10b6_0006, 0};
+#undef pci_ss_info_10b6_0006
+#define pci_ss_info_10b6_0006 pci_ss_info_10b6_0006_10b6_0006
+static const pciSubsystemInfo pci_ss_info_10b6_0007_10b6_0007 =
+ {0x10b6, 0x0007, pci_subsys_10b6_0007_10b6_0007, 0};
+#undef pci_ss_info_10b6_0007
+#define pci_ss_info_10b6_0007 pci_ss_info_10b6_0007_10b6_0007
+static const pciSubsystemInfo pci_ss_info_10b6_0009_10b6_0009 =
+ {0x10b6, 0x0009, pci_subsys_10b6_0009_10b6_0009, 0};
+#undef pci_ss_info_10b6_0009
+#define pci_ss_info_10b6_0009 pci_ss_info_10b6_0009_10b6_0009
+static const pciSubsystemInfo pci_ss_info_10b6_000a_10b6_000a =
+ {0x10b6, 0x000a, pci_subsys_10b6_000a_10b6_000a, 0};
+#undef pci_ss_info_10b6_000a
+#define pci_ss_info_10b6_000a pci_ss_info_10b6_000a_10b6_000a
+static const pciSubsystemInfo pci_ss_info_10b6_000b_10b6_0008 =
+ {0x10b6, 0x0008, pci_subsys_10b6_000b_10b6_0008, 0};
+#undef pci_ss_info_10b6_0008
+#define pci_ss_info_10b6_0008 pci_ss_info_10b6_000b_10b6_0008
+static const pciSubsystemInfo pci_ss_info_10b6_000b_10b6_000b =
+ {0x10b6, 0x000b, pci_subsys_10b6_000b_10b6_000b, 0};
+#undef pci_ss_info_10b6_000b
+#define pci_ss_info_10b6_000b pci_ss_info_10b6_000b_10b6_000b
+static const pciSubsystemInfo pci_ss_info_10b6_000c_10b6_000c =
+ {0x10b6, 0x000c, pci_subsys_10b6_000c_10b6_000c, 0};
+#undef pci_ss_info_10b6_000c
+#define pci_ss_info_10b6_000c pci_ss_info_10b6_000c_10b6_000c
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10b7_1007_10b7_615c =
+ {0x10b7, 0x615c, pci_subsys_10b7_1007_10b7_615c, 0};
+#undef pci_ss_info_10b7_615c
+#define pci_ss_info_10b7_615c pci_ss_info_10b7_1007_10b7_615c
+static const pciSubsystemInfo pci_ss_info_10b7_3590_10b7_3590 =
+ {0x10b7, 0x3590, pci_subsys_10b7_3590_10b7_3590, 0};
+#undef pci_ss_info_10b7_3590
+#define pci_ss_info_10b7_3590 pci_ss_info_10b7_3590_10b7_3590
+static const pciSubsystemInfo pci_ss_info_10b7_5057_10b7_5a57 =
+ {0x10b7, 0x5a57, pci_subsys_10b7_5057_10b7_5a57, 0};
+#undef pci_ss_info_10b7_5a57
+#define pci_ss_info_10b7_5a57 pci_ss_info_10b7_5057_10b7_5a57
+static const pciSubsystemInfo pci_ss_info_10b7_5157_10b7_5b57 =
+ {0x10b7, 0x5b57, pci_subsys_10b7_5157_10b7_5b57, 0};
+#undef pci_ss_info_10b7_5b57
+#define pci_ss_info_10b7_5b57 pci_ss_info_10b7_5157_10b7_5b57
+static const pciSubsystemInfo pci_ss_info_10b7_5257_10b7_5c57 =
+ {0x10b7, 0x5c57, pci_subsys_10b7_5257_10b7_5c57, 0};
+#undef pci_ss_info_10b7_5c57
+#define pci_ss_info_10b7_5c57 pci_ss_info_10b7_5257_10b7_5c57
+static const pciSubsystemInfo pci_ss_info_10b7_5b57_10b7_5b57 =
+ {0x10b7, 0x5b57, pci_subsys_10b7_5b57_10b7_5b57, 0};
+#undef pci_ss_info_10b7_5b57
+#define pci_ss_info_10b7_5b57 pci_ss_info_10b7_5b57_10b7_5b57
+static const pciSubsystemInfo pci_ss_info_10b7_6056_10b7_6556 =
+ {0x10b7, 0x6556, pci_subsys_10b7_6056_10b7_6556, 0};
+#undef pci_ss_info_10b7_6556
+#define pci_ss_info_10b7_6556 pci_ss_info_10b7_6056_10b7_6556
+static const pciSubsystemInfo pci_ss_info_10b7_6560_10b7_656a =
+ {0x10b7, 0x656a, pci_subsys_10b7_6560_10b7_656a, 0};
+#undef pci_ss_info_10b7_656a
+#define pci_ss_info_10b7_656a pci_ss_info_10b7_6560_10b7_656a
+static const pciSubsystemInfo pci_ss_info_10b7_6561_10b7_656b =
+ {0x10b7, 0x656b, pci_subsys_10b7_6561_10b7_656b, 0};
+#undef pci_ss_info_10b7_656b
+#define pci_ss_info_10b7_656b pci_ss_info_10b7_6561_10b7_656b
+static const pciSubsystemInfo pci_ss_info_10b7_6562_10b7_656b =
+ {0x10b7, 0x656b, pci_subsys_10b7_6562_10b7_656b, 0};
+#undef pci_ss_info_10b7_656b
+#define pci_ss_info_10b7_656b pci_ss_info_10b7_6562_10b7_656b
+static const pciSubsystemInfo pci_ss_info_10b7_6563_10b7_656b =
+ {0x10b7, 0x656b, pci_subsys_10b7_6563_10b7_656b, 0};
+#undef pci_ss_info_10b7_656b
+#define pci_ss_info_10b7_656b pci_ss_info_10b7_6563_10b7_656b
+static const pciSubsystemInfo pci_ss_info_10b7_9004_10b7_9004 =
+ {0x10b7, 0x9004, pci_subsys_10b7_9004_10b7_9004, 0};
+#undef pci_ss_info_10b7_9004
+#define pci_ss_info_10b7_9004 pci_ss_info_10b7_9004_10b7_9004
+static const pciSubsystemInfo pci_ss_info_10b7_9005_10b7_9005 =
+ {0x10b7, 0x9005, pci_subsys_10b7_9005_10b7_9005, 0};
+#undef pci_ss_info_10b7_9005
+#define pci_ss_info_10b7_9005 pci_ss_info_10b7_9005_10b7_9005
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0080 =
+ {0x1028, 0x0080, pci_subsys_10b7_9055_1028_0080, 0};
+#undef pci_ss_info_1028_0080
+#define pci_ss_info_1028_0080 pci_ss_info_10b7_9055_1028_0080
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0081 =
+ {0x1028, 0x0081, pci_subsys_10b7_9055_1028_0081, 0};
+#undef pci_ss_info_1028_0081
+#define pci_ss_info_1028_0081 pci_ss_info_10b7_9055_1028_0081
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0082 =
+ {0x1028, 0x0082, pci_subsys_10b7_9055_1028_0082, 0};
+#undef pci_ss_info_1028_0082
+#define pci_ss_info_1028_0082 pci_ss_info_10b7_9055_1028_0082
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0083 =
+ {0x1028, 0x0083, pci_subsys_10b7_9055_1028_0083, 0};
+#undef pci_ss_info_1028_0083
+#define pci_ss_info_1028_0083 pci_ss_info_10b7_9055_1028_0083
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0084 =
+ {0x1028, 0x0084, pci_subsys_10b7_9055_1028_0084, 0};
+#undef pci_ss_info_1028_0084
+#define pci_ss_info_1028_0084 pci_ss_info_10b7_9055_1028_0084
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0085 =
+ {0x1028, 0x0085, pci_subsys_10b7_9055_1028_0085, 0};
+#undef pci_ss_info_1028_0085
+#define pci_ss_info_1028_0085 pci_ss_info_10b7_9055_1028_0085
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0086 =
+ {0x1028, 0x0086, pci_subsys_10b7_9055_1028_0086, 0};
+#undef pci_ss_info_1028_0086
+#define pci_ss_info_1028_0086 pci_ss_info_10b7_9055_1028_0086
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0087 =
+ {0x1028, 0x0087, pci_subsys_10b7_9055_1028_0087, 0};
+#undef pci_ss_info_1028_0087
+#define pci_ss_info_1028_0087 pci_ss_info_10b7_9055_1028_0087
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0088 =
+ {0x1028, 0x0088, pci_subsys_10b7_9055_1028_0088, 0};
+#undef pci_ss_info_1028_0088
+#define pci_ss_info_1028_0088 pci_ss_info_10b7_9055_1028_0088
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0089 =
+ {0x1028, 0x0089, pci_subsys_10b7_9055_1028_0089, 0};
+#undef pci_ss_info_1028_0089
+#define pci_ss_info_1028_0089 pci_ss_info_10b7_9055_1028_0089
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0090 =
+ {0x1028, 0x0090, pci_subsys_10b7_9055_1028_0090, 0};
+#undef pci_ss_info_1028_0090
+#define pci_ss_info_1028_0090 pci_ss_info_10b7_9055_1028_0090
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0091 =
+ {0x1028, 0x0091, pci_subsys_10b7_9055_1028_0091, 0};
+#undef pci_ss_info_1028_0091
+#define pci_ss_info_1028_0091 pci_ss_info_10b7_9055_1028_0091
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0092 =
+ {0x1028, 0x0092, pci_subsys_10b7_9055_1028_0092, 0};
+#undef pci_ss_info_1028_0092
+#define pci_ss_info_1028_0092 pci_ss_info_10b7_9055_1028_0092
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0093 =
+ {0x1028, 0x0093, pci_subsys_10b7_9055_1028_0093, 0};
+#undef pci_ss_info_1028_0093
+#define pci_ss_info_1028_0093 pci_ss_info_10b7_9055_1028_0093
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0094 =
+ {0x1028, 0x0094, pci_subsys_10b7_9055_1028_0094, 0};
+#undef pci_ss_info_1028_0094
+#define pci_ss_info_1028_0094 pci_ss_info_10b7_9055_1028_0094
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0095 =
+ {0x1028, 0x0095, pci_subsys_10b7_9055_1028_0095, 0};
+#undef pci_ss_info_1028_0095
+#define pci_ss_info_1028_0095 pci_ss_info_10b7_9055_1028_0095
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0096 =
+ {0x1028, 0x0096, pci_subsys_10b7_9055_1028_0096, 0};
+#undef pci_ss_info_1028_0096
+#define pci_ss_info_1028_0096 pci_ss_info_10b7_9055_1028_0096
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0097 =
+ {0x1028, 0x0097, pci_subsys_10b7_9055_1028_0097, 0};
+#undef pci_ss_info_1028_0097
+#define pci_ss_info_1028_0097 pci_ss_info_10b7_9055_1028_0097
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0098 =
+ {0x1028, 0x0098, pci_subsys_10b7_9055_1028_0098, 0};
+#undef pci_ss_info_1028_0098
+#define pci_ss_info_1028_0098 pci_ss_info_10b7_9055_1028_0098
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9055_1028_0099 =
+ {0x1028, 0x0099, pci_subsys_10b7_9055_1028_0099, 0};
+#undef pci_ss_info_1028_0099
+#define pci_ss_info_1028_0099 pci_ss_info_10b7_9055_1028_0099
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10b7_9055_10b7_9055 =
+ {0x10b7, 0x9055, pci_subsys_10b7_9055_10b7_9055, 0};
+#undef pci_ss_info_10b7_9055
+#define pci_ss_info_10b7_9055 pci_ss_info_10b7_9055_10b7_9055
+#endif
+static const pciSubsystemInfo pci_ss_info_10b7_9200_1028_0095 =
+ {0x1028, 0x0095, pci_subsys_10b7_9200_1028_0095, 0};
+#undef pci_ss_info_1028_0095
+#define pci_ss_info_1028_0095 pci_ss_info_10b7_9200_1028_0095
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10b7_9200_10b7_1000 =
+ {0x10b7, 0x1000, pci_subsys_10b7_9200_10b7_1000, 0};
+#undef pci_ss_info_10b7_1000
+#define pci_ss_info_10b7_1000 pci_ss_info_10b7_9200_10b7_1000
+static const pciSubsystemInfo pci_ss_info_10b7_9200_10b7_7000 =
+ {0x10b7, 0x7000, pci_subsys_10b7_9200_10b7_7000, 0};
+#undef pci_ss_info_10b7_7000
+#define pci_ss_info_10b7_7000 pci_ss_info_10b7_9200_10b7_7000
+static const pciSubsystemInfo pci_ss_info_10b7_9800_10b7_9800 =
+ {0x10b7, 0x9800, pci_subsys_10b7_9800_10b7_9800, 0};
+#undef pci_ss_info_10b7_9800
+#define pci_ss_info_10b7_9800 pci_ss_info_10b7_9800_10b7_9800
+static const pciSubsystemInfo pci_ss_info_10b7_9805_10b7_1201 =
+ {0x10b7, 0x1201, pci_subsys_10b7_9805_10b7_1201, 0};
+#undef pci_ss_info_10b7_1201
+#define pci_ss_info_10b7_1201 pci_ss_info_10b7_9805_10b7_1201
+static const pciSubsystemInfo pci_ss_info_10b7_9805_10b7_1202 =
+ {0x10b7, 0x1202, pci_subsys_10b7_9805_10b7_1202, 0};
+#undef pci_ss_info_10b7_1202
+#define pci_ss_info_10b7_1202 pci_ss_info_10b7_9805_10b7_1202
+static const pciSubsystemInfo pci_ss_info_10b7_9805_10b7_9805 =
+ {0x10b7, 0x9805, pci_subsys_10b7_9805_10b7_9805, 0};
+#undef pci_ss_info_10b7_9805
+#define pci_ss_info_10b7_9805 pci_ss_info_10b7_9805_10b7_9805
+static const pciSubsystemInfo pci_ss_info_10b7_9805_10f1_2462 =
+ {0x10f1, 0x2462, pci_subsys_10b7_9805_10f1_2462, 0};
+#undef pci_ss_info_10f1_2462
+#define pci_ss_info_10f1_2462 pci_ss_info_10b7_9805_10f1_2462
+static const pciSubsystemInfo pci_ss_info_10b7_9904_10b7_1000 =
+ {0x10b7, 0x1000, pci_subsys_10b7_9904_10b7_1000, 0};
+#undef pci_ss_info_10b7_1000
+#define pci_ss_info_10b7_1000 pci_ss_info_10b7_9904_10b7_1000
+static const pciSubsystemInfo pci_ss_info_10b7_9904_10b7_2000 =
+ {0x10b7, 0x2000, pci_subsys_10b7_9904_10b7_2000, 0};
+#undef pci_ss_info_10b7_2000
+#define pci_ss_info_10b7_2000 pci_ss_info_10b7_9904_10b7_2000
+static const pciSubsystemInfo pci_ss_info_10b7_9905_10b7_1101 =
+ {0x10b7, 0x1101, pci_subsys_10b7_9905_10b7_1101, 0};
+#undef pci_ss_info_10b7_1101
+#define pci_ss_info_10b7_1101 pci_ss_info_10b7_9905_10b7_1101
+static const pciSubsystemInfo pci_ss_info_10b7_9905_10b7_1102 =
+ {0x10b7, 0x1102, pci_subsys_10b7_9905_10b7_1102, 0};
+#undef pci_ss_info_10b7_1102
+#define pci_ss_info_10b7_1102 pci_ss_info_10b7_9905_10b7_1102
+static const pciSubsystemInfo pci_ss_info_10b7_9905_10b7_2101 =
+ {0x10b7, 0x2101, pci_subsys_10b7_9905_10b7_2101, 0};
+#undef pci_ss_info_10b7_2101
+#define pci_ss_info_10b7_2101 pci_ss_info_10b7_9905_10b7_2101
+static const pciSubsystemInfo pci_ss_info_10b7_9905_10b7_2102 =
+ {0x10b7, 0x2102, pci_subsys_10b7_9905_10b7_2102, 0};
+#undef pci_ss_info_10b7_2102
+#define pci_ss_info_10b7_2102 pci_ss_info_10b7_9905_10b7_2102
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10b8_0005_1055_e000 =
+ {0x1055, 0xe000, pci_subsys_10b8_0005_1055_e000, 0};
+#undef pci_ss_info_1055_e000
+#define pci_ss_info_1055_e000 pci_ss_info_10b8_0005_1055_e000
+static const pciSubsystemInfo pci_ss_info_10b8_0005_1055_e002 =
+ {0x1055, 0xe002, pci_subsys_10b8_0005_1055_e002, 0};
+#undef pci_ss_info_1055_e002
+#define pci_ss_info_1055_e002 pci_ss_info_10b8_0005_1055_e002
+static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a011 =
+ {0x10b8, 0xa011, pci_subsys_10b8_0005_10b8_a011, 0};
+#undef pci_ss_info_10b8_a011
+#define pci_ss_info_10b8_a011 pci_ss_info_10b8_0005_10b8_a011
+static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a014 =
+ {0x10b8, 0xa014, pci_subsys_10b8_0005_10b8_a014, 0};
+#undef pci_ss_info_10b8_a014
+#define pci_ss_info_10b8_a014 pci_ss_info_10b8_0005_10b8_a014
+static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a015 =
+ {0x10b8, 0xa015, pci_subsys_10b8_0005_10b8_a015, 0};
+#undef pci_ss_info_10b8_a015
+#define pci_ss_info_10b8_a015 pci_ss_info_10b8_0005_10b8_a015
+static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a016 =
+ {0x10b8, 0xa016, pci_subsys_10b8_0005_10b8_a016, 0};
+#undef pci_ss_info_10b8_a016
+#define pci_ss_info_10b8_a016 pci_ss_info_10b8_0005_10b8_a016
+static const pciSubsystemInfo pci_ss_info_10b8_0005_10b8_a017 =
+ {0x10b8, 0xa017, pci_subsys_10b8_0005_10b8_a017, 0};
+#undef pci_ss_info_10b8_a017
+#define pci_ss_info_10b8_a017 pci_ss_info_10b8_0005_10b8_a017
+static const pciSubsystemInfo pci_ss_info_10b8_0006_1055_e100 =
+ {0x1055, 0xe100, pci_subsys_10b8_0006_1055_e100, 0};
+#undef pci_ss_info_1055_e100
+#define pci_ss_info_1055_e100 pci_ss_info_10b8_0006_1055_e100
+static const pciSubsystemInfo pci_ss_info_10b8_0006_1055_e102 =
+ {0x1055, 0xe102, pci_subsys_10b8_0006_1055_e102, 0};
+#undef pci_ss_info_1055_e102
+#define pci_ss_info_1055_e102 pci_ss_info_10b8_0006_1055_e102
+static const pciSubsystemInfo pci_ss_info_10b8_0006_1055_e300 =
+ {0x1055, 0xe300, pci_subsys_10b8_0006_1055_e300, 0};
+#undef pci_ss_info_1055_e300
+#define pci_ss_info_1055_e300 pci_ss_info_10b8_0006_1055_e300
+static const pciSubsystemInfo pci_ss_info_10b8_0006_1055_e302 =
+ {0x1055, 0xe302, pci_subsys_10b8_0006_1055_e302, 0};
+#undef pci_ss_info_1055_e302
+#define pci_ss_info_1055_e302 pci_ss_info_10b8_0006_1055_e302
+static const pciSubsystemInfo pci_ss_info_10b8_0006_10b8_a012 =
+ {0x10b8, 0xa012, pci_subsys_10b8_0006_10b8_a012, 0};
+#undef pci_ss_info_10b8_a012
+#define pci_ss_info_10b8_a012 pci_ss_info_10b8_0006_10b8_a012
+static const pciSubsystemInfo pci_ss_info_10b8_0006_13a2_8002 =
+ {0x13a2, 0x8002, pci_subsys_10b8_0006_13a2_8002, 0};
+#undef pci_ss_info_13a2_8002
+#define pci_ss_info_13a2_8002 pci_ss_info_10b8_0006_13a2_8002
+static const pciSubsystemInfo pci_ss_info_10b8_0006_13a2_8006 =
+ {0x13a2, 0x8006, pci_subsys_10b8_0006_13a2_8006, 0};
+#undef pci_ss_info_13a2_8006
+#define pci_ss_info_13a2_8006 pci_ss_info_10b8_0006_13a2_8006
+#endif
+static const pciSubsystemInfo pci_ss_info_10b9_0111_10b9_0111 =
+ {0x10b9, 0x0111, pci_subsys_10b9_0111_10b9_0111, 0};
+#undef pci_ss_info_10b9_0111
+#define pci_ss_info_10b9_0111 pci_ss_info_10b9_0111_10b9_0111
+static const pciSubsystemInfo pci_ss_info_10b9_1521_10b9_1521 =
+ {0x10b9, 0x1521, pci_subsys_10b9_1521_10b9_1521, 0};
+#undef pci_ss_info_10b9_1521
+#define pci_ss_info_10b9_1521 pci_ss_info_10b9_1521_10b9_1521
+static const pciSubsystemInfo pci_ss_info_10b9_1523_10b9_1523 =
+ {0x10b9, 0x1523, pci_subsys_10b9_1523_10b9_1523, 0};
+#undef pci_ss_info_10b9_1523
+#define pci_ss_info_10b9_1523 pci_ss_info_10b9_1523_10b9_1523
+static const pciSubsystemInfo pci_ss_info_10b9_1533_10b9_1533 =
+ {0x10b9, 0x1533, pci_subsys_10b9_1533_10b9_1533, 0};
+#undef pci_ss_info_10b9_1533
+#define pci_ss_info_10b9_1533 pci_ss_info_10b9_1533_10b9_1533
+static const pciSubsystemInfo pci_ss_info_10b9_1541_10b9_1541 =
+ {0x10b9, 0x1541, pci_subsys_10b9_1541_10b9_1541, 0};
+#undef pci_ss_info_10b9_1541
+#define pci_ss_info_10b9_1541 pci_ss_info_10b9_1541_10b9_1541
+static const pciSubsystemInfo pci_ss_info_10b9_5229_1043_8053 =
+ {0x1043, 0x8053, pci_subsys_10b9_5229_1043_8053, 0};
+#undef pci_ss_info_1043_8053
+#define pci_ss_info_1043_8053 pci_ss_info_10b9_5229_1043_8053
+static const pciSubsystemInfo pci_ss_info_10b9_5451_1014_0506 =
+ {0x1014, 0x0506, pci_subsys_10b9_5451_1014_0506, 0};
+#undef pci_ss_info_1014_0506
+#define pci_ss_info_1014_0506 pci_ss_info_10b9_5451_1014_0506
+static const pciSubsystemInfo pci_ss_info_10b9_7101_10b9_7101 =
+ {0x10b9, 0x7101, pci_subsys_10b9_7101_10b9_7101, 0};
+#undef pci_ss_info_10b9_7101
+#define pci_ss_info_10b9_7101 pci_ss_info_10b9_7101_10b9_7101
+static const pciSubsystemInfo pci_ss_info_10c8_0004_1014_00ba =
+ {0x1014, 0x00ba, pci_subsys_10c8_0004_1014_00ba, 0};
+#undef pci_ss_info_1014_00ba
+#define pci_ss_info_1014_00ba pci_ss_info_10c8_0004_1014_00ba
+static const pciSubsystemInfo pci_ss_info_10c8_0004_1025_1007 =
+ {0x1025, 0x1007, pci_subsys_10c8_0004_1025_1007, 0};
+#undef pci_ss_info_1025_1007
+#define pci_ss_info_1025_1007 pci_ss_info_10c8_0004_1025_1007
+static const pciSubsystemInfo pci_ss_info_10c8_0004_1028_0074 =
+ {0x1028, 0x0074, pci_subsys_10c8_0004_1028_0074, 0};
+#undef pci_ss_info_1028_0074
+#define pci_ss_info_1028_0074 pci_ss_info_10c8_0004_1028_0074
+static const pciSubsystemInfo pci_ss_info_10c8_0004_1028_0075 =
+ {0x1028, 0x0075, pci_subsys_10c8_0004_1028_0075, 0};
+#undef pci_ss_info_1028_0075
+#define pci_ss_info_1028_0075 pci_ss_info_10c8_0004_1028_0075
+static const pciSubsystemInfo pci_ss_info_10c8_0004_1028_007d =
+ {0x1028, 0x007d, pci_subsys_10c8_0004_1028_007d, 0};
+#undef pci_ss_info_1028_007d
+#define pci_ss_info_1028_007d pci_ss_info_10c8_0004_1028_007d
+static const pciSubsystemInfo pci_ss_info_10c8_0004_1028_007e =
+ {0x1028, 0x007e, pci_subsys_10c8_0004_1028_007e, 0};
+#undef pci_ss_info_1028_007e
+#define pci_ss_info_1028_007e pci_ss_info_10c8_0004_1028_007e
+static const pciSubsystemInfo pci_ss_info_10c8_0004_1033_802f =
+ {0x1033, 0x802f, pci_subsys_10c8_0004_1033_802f, 0};
+#undef pci_ss_info_1033_802f
+#define pci_ss_info_1033_802f pci_ss_info_10c8_0004_1033_802f
+static const pciSubsystemInfo pci_ss_info_10c8_0004_104d_801b =
+ {0x104d, 0x801b, pci_subsys_10c8_0004_104d_801b, 0};
+#undef pci_ss_info_104d_801b
+#define pci_ss_info_104d_801b pci_ss_info_10c8_0004_104d_801b
+static const pciSubsystemInfo pci_ss_info_10c8_0004_104d_802f =
+ {0x104d, 0x802f, pci_subsys_10c8_0004_104d_802f, 0};
+#undef pci_ss_info_104d_802f
+#define pci_ss_info_104d_802f pci_ss_info_10c8_0004_104d_802f
+static const pciSubsystemInfo pci_ss_info_10c8_0004_104d_830b =
+ {0x104d, 0x830b, pci_subsys_10c8_0004_104d_830b, 0};
+#undef pci_ss_info_104d_830b
+#define pci_ss_info_104d_830b pci_ss_info_10c8_0004_104d_830b
+static const pciSubsystemInfo pci_ss_info_10c8_0004_10ba_0e00 =
+ {0x10ba, 0x0e00, pci_subsys_10c8_0004_10ba_0e00, 0};
+#undef pci_ss_info_10ba_0e00
+#define pci_ss_info_10ba_0e00 pci_ss_info_10c8_0004_10ba_0e00
+static const pciSubsystemInfo pci_ss_info_10c8_0004_10c8_0004 =
+ {0x10c8, 0x0004, pci_subsys_10c8_0004_10c8_0004, 0};
+#undef pci_ss_info_10c8_0004
+#define pci_ss_info_10c8_0004 pci_ss_info_10c8_0004_10c8_0004
+static const pciSubsystemInfo pci_ss_info_10c8_0004_10cf_1029 =
+ {0x10cf, 0x1029, pci_subsys_10c8_0004_10cf_1029, 0};
+#undef pci_ss_info_10cf_1029
+#define pci_ss_info_10cf_1029 pci_ss_info_10c8_0004_10cf_1029
+static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_8308 =
+ {0x10f7, 0x8308, pci_subsys_10c8_0004_10f7_8308, 0};
+#undef pci_ss_info_10f7_8308
+#define pci_ss_info_10f7_8308 pci_ss_info_10c8_0004_10f7_8308
+static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_8309 =
+ {0x10f7, 0x8309, pci_subsys_10c8_0004_10f7_8309, 0};
+#undef pci_ss_info_10f7_8309
+#define pci_ss_info_10f7_8309 pci_ss_info_10c8_0004_10f7_8309
+static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_830b =
+ {0x10f7, 0x830b, pci_subsys_10c8_0004_10f7_830b, 0};
+#undef pci_ss_info_10f7_830b
+#define pci_ss_info_10f7_830b pci_ss_info_10c8_0004_10f7_830b
+static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_830d =
+ {0x10f7, 0x830d, pci_subsys_10c8_0004_10f7_830d, 0};
+#undef pci_ss_info_10f7_830d
+#define pci_ss_info_10f7_830d pci_ss_info_10c8_0004_10f7_830d
+static const pciSubsystemInfo pci_ss_info_10c8_0004_10f7_8312 =
+ {0x10f7, 0x8312, pci_subsys_10c8_0004_10f7_8312, 0};
+#undef pci_ss_info_10f7_8312
+#define pci_ss_info_10f7_8312 pci_ss_info_10c8_0004_10f7_8312
+static const pciSubsystemInfo pci_ss_info_10c8_0005_1014_00dd =
+ {0x1014, 0x00dd, pci_subsys_10c8_0005_1014_00dd, 0};
+#undef pci_ss_info_1014_00dd
+#define pci_ss_info_1014_00dd pci_ss_info_10c8_0005_1014_00dd
+static const pciSubsystemInfo pci_ss_info_10c8_0016_10c8_0016 =
+ {0x10c8, 0x0016, pci_subsys_10c8_0016_10c8_0016, 0};
+#undef pci_ss_info_10c8_0016
+#define pci_ss_info_10c8_0016 pci_ss_info_10c8_0016_10c8_0016
+static const pciSubsystemInfo pci_ss_info_10c8_8005_0e11_b0d1 =
+ {0x0e11, 0xb0d1, pci_subsys_10c8_8005_0e11_b0d1, 0};
+#undef pci_ss_info_0e11_b0d1
+#define pci_ss_info_0e11_b0d1 pci_ss_info_10c8_8005_0e11_b0d1
+static const pciSubsystemInfo pci_ss_info_10c8_8005_0e11_b126 =
+ {0x0e11, 0xb126, pci_subsys_10c8_8005_0e11_b126, 0};
+#undef pci_ss_info_0e11_b126
+#define pci_ss_info_0e11_b126 pci_ss_info_10c8_8005_0e11_b126
+static const pciSubsystemInfo pci_ss_info_10c8_8005_1014_00dd =
+ {0x1014, 0x00dd, pci_subsys_10c8_8005_1014_00dd, 0};
+#undef pci_ss_info_1014_00dd
+#define pci_ss_info_1014_00dd pci_ss_info_10c8_8005_1014_00dd
+static const pciSubsystemInfo pci_ss_info_10c8_8005_1025_1003 =
+ {0x1025, 0x1003, pci_subsys_10c8_8005_1025_1003, 0};
+#undef pci_ss_info_1025_1003
+#define pci_ss_info_1025_1003 pci_ss_info_10c8_8005_1025_1003
+static const pciSubsystemInfo pci_ss_info_10c8_8005_1028_008f =
+ {0x1028, 0x008f, pci_subsys_10c8_8005_1028_008f, 0};
+#undef pci_ss_info_1028_008f
+#define pci_ss_info_1028_008f pci_ss_info_10c8_8005_1028_008f
+static const pciSubsystemInfo pci_ss_info_10c8_8005_103c_0007 =
+ {0x103c, 0x0007, pci_subsys_10c8_8005_103c_0007, 0};
+#undef pci_ss_info_103c_0007
+#define pci_ss_info_103c_0007 pci_ss_info_10c8_8005_103c_0007
+static const pciSubsystemInfo pci_ss_info_10c8_8005_103c_0008 =
+ {0x103c, 0x0008, pci_subsys_10c8_8005_103c_0008, 0};
+#undef pci_ss_info_103c_0008
+#define pci_ss_info_103c_0008 pci_ss_info_10c8_8005_103c_0008
+static const pciSubsystemInfo pci_ss_info_10c8_8005_103c_000d =
+ {0x103c, 0x000d, pci_subsys_10c8_8005_103c_000d, 0};
+#undef pci_ss_info_103c_000d
+#define pci_ss_info_103c_000d pci_ss_info_10c8_8005_103c_000d
+static const pciSubsystemInfo pci_ss_info_10c8_8005_10c8_8005 =
+ {0x10c8, 0x8005, pci_subsys_10c8_8005_10c8_8005, 0};
+#undef pci_ss_info_10c8_8005
+#define pci_ss_info_10c8_8005 pci_ss_info_10c8_8005_10c8_8005
+static const pciSubsystemInfo pci_ss_info_10c8_8005_110a_8005 =
+ {0x110a, 0x8005, pci_subsys_10c8_8005_110a_8005, 0};
+#undef pci_ss_info_110a_8005
+#define pci_ss_info_110a_8005 pci_ss_info_10c8_8005_110a_8005
+static const pciSubsystemInfo pci_ss_info_10c8_8005_14c0_0004 =
+ {0x14c0, 0x0004, pci_subsys_10c8_8005_14c0_0004, 0};
+#undef pci_ss_info_14c0_0004
+#define pci_ss_info_14c0_0004 pci_ss_info_10c8_8005_14c0_0004
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10cd_1300_10cd_1310 =
+ {0x10cd, 0x1310, pci_subsys_10cd_1300_10cd_1310, 0};
+#undef pci_ss_info_10cd_1310
+#define pci_ss_info_10cd_1310 pci_ss_info_10cd_1300_10cd_1310
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10d9_0531_1186_1200 =
+ {0x1186, 0x1200, pci_subsys_10d9_0531_1186_1200, 0};
+#undef pci_ss_info_1186_1200
+#define pci_ss_info_1186_1200 pci_ss_info_10d9_0531_1186_1200
+#endif
+static const pciSubsystemInfo pci_ss_info_10de_0020_1043_0200 =
+ {0x1043, 0x0200, pci_subsys_10de_0020_1043_0200, 0};
+#undef pci_ss_info_1043_0200
+#define pci_ss_info_1043_0200 pci_ss_info_10de_0020_1043_0200
+static const pciSubsystemInfo pci_ss_info_10de_0020_1048_0c18 =
+ {0x1048, 0x0c18, pci_subsys_10de_0020_1048_0c18, 0};
+#undef pci_ss_info_1048_0c18
+#define pci_ss_info_1048_0c18 pci_ss_info_10de_0020_1048_0c18
+static const pciSubsystemInfo pci_ss_info_10de_0020_1048_0c1b =
+ {0x1048, 0x0c1b, pci_subsys_10de_0020_1048_0c1b, 0};
+#undef pci_ss_info_1048_0c1b
+#define pci_ss_info_1048_0c1b pci_ss_info_10de_0020_1048_0c1b
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_0550 =
+ {0x1092, 0x0550, pci_subsys_10de_0020_1092_0550, 0};
+#undef pci_ss_info_1092_0550
+#define pci_ss_info_1092_0550 pci_ss_info_10de_0020_1092_0550
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_0552 =
+ {0x1092, 0x0552, pci_subsys_10de_0020_1092_0552, 0};
+#undef pci_ss_info_1092_0552
+#define pci_ss_info_1092_0552 pci_ss_info_10de_0020_1092_0552
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4804 =
+ {0x1092, 0x4804, pci_subsys_10de_0020_1092_4804, 0};
+#undef pci_ss_info_1092_4804
+#define pci_ss_info_1092_4804 pci_ss_info_10de_0020_1092_4804
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4808 =
+ {0x1092, 0x4808, pci_subsys_10de_0020_1092_4808, 0};
+#undef pci_ss_info_1092_4808
+#define pci_ss_info_1092_4808 pci_ss_info_10de_0020_1092_4808
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4810 =
+ {0x1092, 0x4810, pci_subsys_10de_0020_1092_4810, 0};
+#undef pci_ss_info_1092_4810
+#define pci_ss_info_1092_4810 pci_ss_info_10de_0020_1092_4810
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4812 =
+ {0x1092, 0x4812, pci_subsys_10de_0020_1092_4812, 0};
+#undef pci_ss_info_1092_4812
+#define pci_ss_info_1092_4812 pci_ss_info_10de_0020_1092_4812
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4815 =
+ {0x1092, 0x4815, pci_subsys_10de_0020_1092_4815, 0};
+#undef pci_ss_info_1092_4815
+#define pci_ss_info_1092_4815 pci_ss_info_10de_0020_1092_4815
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4820 =
+ {0x1092, 0x4820, pci_subsys_10de_0020_1092_4820, 0};
+#undef pci_ss_info_1092_4820
+#define pci_ss_info_1092_4820 pci_ss_info_10de_0020_1092_4820
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4822 =
+ {0x1092, 0x4822, pci_subsys_10de_0020_1092_4822, 0};
+#undef pci_ss_info_1092_4822
+#define pci_ss_info_1092_4822 pci_ss_info_10de_0020_1092_4822
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4904 =
+ {0x1092, 0x4904, pci_subsys_10de_0020_1092_4904, 0};
+#undef pci_ss_info_1092_4904
+#define pci_ss_info_1092_4904 pci_ss_info_10de_0020_1092_4904
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_4914 =
+ {0x1092, 0x4914, pci_subsys_10de_0020_1092_4914, 0};
+#undef pci_ss_info_1092_4914
+#define pci_ss_info_1092_4914 pci_ss_info_10de_0020_1092_4914
+static const pciSubsystemInfo pci_ss_info_10de_0020_1092_8225 =
+ {0x1092, 0x8225, pci_subsys_10de_0020_1092_8225, 0};
+#undef pci_ss_info_1092_8225
+#define pci_ss_info_1092_8225 pci_ss_info_10de_0020_1092_8225
+static const pciSubsystemInfo pci_ss_info_10de_0020_10b4_273d =
+ {0x10b4, 0x273d, pci_subsys_10de_0020_10b4_273d, 0};
+#undef pci_ss_info_10b4_273d
+#define pci_ss_info_10b4_273d pci_ss_info_10de_0020_10b4_273d
+static const pciSubsystemInfo pci_ss_info_10de_0020_10b4_273e =
+ {0x10b4, 0x273e, pci_subsys_10de_0020_10b4_273e, 0};
+#undef pci_ss_info_10b4_273e
+#define pci_ss_info_10b4_273e pci_ss_info_10de_0020_10b4_273e
+static const pciSubsystemInfo pci_ss_info_10de_0020_10b4_2740 =
+ {0x10b4, 0x2740, pci_subsys_10de_0020_10b4_2740, 0};
+#undef pci_ss_info_10b4_2740
+#define pci_ss_info_10b4_2740 pci_ss_info_10de_0020_10b4_2740
+static const pciSubsystemInfo pci_ss_info_10de_0020_10de_0020 =
+ {0x10de, 0x0020, pci_subsys_10de_0020_10de_0020, 0};
+#undef pci_ss_info_10de_0020
+#define pci_ss_info_10de_0020 pci_ss_info_10de_0020_10de_0020
+static const pciSubsystemInfo pci_ss_info_10de_0020_1102_1015 =
+ {0x1102, 0x1015, pci_subsys_10de_0020_1102_1015, 0};
+#undef pci_ss_info_1102_1015
+#define pci_ss_info_1102_1015 pci_ss_info_10de_0020_1102_1015
+static const pciSubsystemInfo pci_ss_info_10de_0020_1102_1016 =
+ {0x1102, 0x1016, pci_subsys_10de_0020_1102_1016, 0};
+#undef pci_ss_info_1102_1016
+#define pci_ss_info_1102_1016 pci_ss_info_10de_0020_1102_1016
+static const pciSubsystemInfo pci_ss_info_10de_0028_1043_0200 =
+ {0x1043, 0x0200, pci_subsys_10de_0028_1043_0200, 0};
+#undef pci_ss_info_1043_0200
+#define pci_ss_info_1043_0200 pci_ss_info_10de_0028_1043_0200
+static const pciSubsystemInfo pci_ss_info_10de_0028_1043_0201 =
+ {0x1043, 0x0201, pci_subsys_10de_0028_1043_0201, 0};
+#undef pci_ss_info_1043_0201
+#define pci_ss_info_1043_0201 pci_ss_info_10de_0028_1043_0201
+static const pciSubsystemInfo pci_ss_info_10de_0028_1043_0205 =
+ {0x1043, 0x0205, pci_subsys_10de_0028_1043_0205, 0};
+#undef pci_ss_info_1043_0205
+#define pci_ss_info_1043_0205 pci_ss_info_10de_0028_1043_0205
+static const pciSubsystemInfo pci_ss_info_10de_0028_1043_4000 =
+ {0x1043, 0x4000, pci_subsys_10de_0028_1043_4000, 0};
+#undef pci_ss_info_1043_4000
+#define pci_ss_info_1043_4000 pci_ss_info_10de_0028_1043_4000
+static const pciSubsystemInfo pci_ss_info_10de_0028_1092_4804 =
+ {0x1092, 0x4804, pci_subsys_10de_0028_1092_4804, 0};
+#undef pci_ss_info_1092_4804
+#define pci_ss_info_1092_4804 pci_ss_info_10de_0028_1092_4804
+static const pciSubsystemInfo pci_ss_info_10de_0028_1092_4a00 =
+ {0x1092, 0x4a00, pci_subsys_10de_0028_1092_4a00, 0};
+#undef pci_ss_info_1092_4a00
+#define pci_ss_info_1092_4a00 pci_ss_info_10de_0028_1092_4a00
+static const pciSubsystemInfo pci_ss_info_10de_0028_1092_4a02 =
+ {0x1092, 0x4a02, pci_subsys_10de_0028_1092_4a02, 0};
+#undef pci_ss_info_1092_4a02
+#define pci_ss_info_1092_4a02 pci_ss_info_10de_0028_1092_4a02
+static const pciSubsystemInfo pci_ss_info_10de_0028_1092_5a00 =
+ {0x1092, 0x5a00, pci_subsys_10de_0028_1092_5a00, 0};
+#undef pci_ss_info_1092_5a00
+#define pci_ss_info_1092_5a00 pci_ss_info_10de_0028_1092_5a00
+static const pciSubsystemInfo pci_ss_info_10de_0028_1092_6a02 =
+ {0x1092, 0x6a02, pci_subsys_10de_0028_1092_6a02, 0};
+#undef pci_ss_info_1092_6a02
+#define pci_ss_info_1092_6a02 pci_ss_info_10de_0028_1092_6a02
+static const pciSubsystemInfo pci_ss_info_10de_0028_1092_7a02 =
+ {0x1092, 0x7a02, pci_subsys_10de_0028_1092_7a02, 0};
+#undef pci_ss_info_1092_7a02
+#define pci_ss_info_1092_7a02 pci_ss_info_10de_0028_1092_7a02
+static const pciSubsystemInfo pci_ss_info_10de_0028_10de_0005 =
+ {0x10de, 0x0005, pci_subsys_10de_0028_10de_0005, 0};
+#undef pci_ss_info_10de_0005
+#define pci_ss_info_10de_0005 pci_ss_info_10de_0028_10de_0005
+static const pciSubsystemInfo pci_ss_info_10de_0028_10de_000f =
+ {0x10de, 0x000f, pci_subsys_10de_0028_10de_000f, 0};
+#undef pci_ss_info_10de_000f
+#define pci_ss_info_10de_000f pci_ss_info_10de_0028_10de_000f
+static const pciSubsystemInfo pci_ss_info_10de_0028_1102_1020 =
+ {0x1102, 0x1020, pci_subsys_10de_0028_1102_1020, 0};
+#undef pci_ss_info_1102_1020
+#define pci_ss_info_1102_1020 pci_ss_info_10de_0028_1102_1020
+static const pciSubsystemInfo pci_ss_info_10de_0028_1102_1026 =
+ {0x1102, 0x1026, pci_subsys_10de_0028_1102_1026, 0};
+#undef pci_ss_info_1102_1026
+#define pci_ss_info_1102_1026 pci_ss_info_10de_0028_1102_1026
+static const pciSubsystemInfo pci_ss_info_10de_0028_14af_5810 =
+ {0x14af, 0x5810, pci_subsys_10de_0028_14af_5810, 0};
+#undef pci_ss_info_14af_5810
+#define pci_ss_info_14af_5810 pci_ss_info_10de_0028_14af_5810
+static const pciSubsystemInfo pci_ss_info_10de_0029_1043_0200 =
+ {0x1043, 0x0200, pci_subsys_10de_0029_1043_0200, 0};
+#undef pci_ss_info_1043_0200
+#define pci_ss_info_1043_0200 pci_ss_info_10de_0029_1043_0200
+static const pciSubsystemInfo pci_ss_info_10de_0029_1043_0201 =
+ {0x1043, 0x0201, pci_subsys_10de_0029_1043_0201, 0};
+#undef pci_ss_info_1043_0201
+#define pci_ss_info_1043_0201 pci_ss_info_10de_0029_1043_0201
+static const pciSubsystemInfo pci_ss_info_10de_0029_1043_0205 =
+ {0x1043, 0x0205, pci_subsys_10de_0029_1043_0205, 0};
+#undef pci_ss_info_1043_0205
+#define pci_ss_info_1043_0205 pci_ss_info_10de_0029_1043_0205
+static const pciSubsystemInfo pci_ss_info_10de_0029_1102_1021 =
+ {0x1102, 0x1021, pci_subsys_10de_0029_1102_1021, 0};
+#undef pci_ss_info_1102_1021
+#define pci_ss_info_1102_1021 pci_ss_info_10de_0029_1102_1021
+static const pciSubsystemInfo pci_ss_info_10de_0029_1102_1029 =
+ {0x1102, 0x1029, pci_subsys_10de_0029_1102_1029, 0};
+#undef pci_ss_info_1102_1029
+#define pci_ss_info_1102_1029 pci_ss_info_10de_0029_1102_1029
+static const pciSubsystemInfo pci_ss_info_10de_0029_1102_102f =
+ {0x1102, 0x102f, pci_subsys_10de_0029_1102_102f, 0};
+#undef pci_ss_info_1102_102f
+#define pci_ss_info_1102_102f pci_ss_info_10de_0029_1102_102f
+static const pciSubsystemInfo pci_ss_info_10de_0029_14af_5820 =
+ {0x14af, 0x5820, pci_subsys_10de_0029_14af_5820, 0};
+#undef pci_ss_info_14af_5820
+#define pci_ss_info_14af_5820 pci_ss_info_10de_0029_14af_5820
+static const pciSubsystemInfo pci_ss_info_10de_002c_1043_0200 =
+ {0x1043, 0x0200, pci_subsys_10de_002c_1043_0200, 0};
+#undef pci_ss_info_1043_0200
+#define pci_ss_info_1043_0200 pci_ss_info_10de_002c_1043_0200
+static const pciSubsystemInfo pci_ss_info_10de_002c_1043_0201 =
+ {0x1043, 0x0201, pci_subsys_10de_002c_1043_0201, 0};
+#undef pci_ss_info_1043_0201
+#define pci_ss_info_1043_0201 pci_ss_info_10de_002c_1043_0201
+static const pciSubsystemInfo pci_ss_info_10de_002c_1092_6820 =
+ {0x1092, 0x6820, pci_subsys_10de_002c_1092_6820, 0};
+#undef pci_ss_info_1092_6820
+#define pci_ss_info_1092_6820 pci_ss_info_10de_002c_1092_6820
+static const pciSubsystemInfo pci_ss_info_10de_002c_1102_1031 =
+ {0x1102, 0x1031, pci_subsys_10de_002c_1102_1031, 0};
+#undef pci_ss_info_1102_1031
+#define pci_ss_info_1102_1031 pci_ss_info_10de_002c_1102_1031
+static const pciSubsystemInfo pci_ss_info_10de_002c_1102_1034 =
+ {0x1102, 0x1034, pci_subsys_10de_002c_1102_1034, 0};
+#undef pci_ss_info_1102_1034
+#define pci_ss_info_1102_1034 pci_ss_info_10de_002c_1102_1034
+static const pciSubsystemInfo pci_ss_info_10de_002c_14af_5008 =
+ {0x14af, 0x5008, pci_subsys_10de_002c_14af_5008, 0};
+#undef pci_ss_info_14af_5008
+#define pci_ss_info_14af_5008 pci_ss_info_10de_002c_14af_5008
+static const pciSubsystemInfo pci_ss_info_10de_002d_1043_0200 =
+ {0x1043, 0x0200, pci_subsys_10de_002d_1043_0200, 0};
+#undef pci_ss_info_1043_0200
+#define pci_ss_info_1043_0200 pci_ss_info_10de_002d_1043_0200
+static const pciSubsystemInfo pci_ss_info_10de_002d_1043_0201 =
+ {0x1043, 0x0201, pci_subsys_10de_002d_1043_0201, 0};
+#undef pci_ss_info_1043_0201
+#define pci_ss_info_1043_0201 pci_ss_info_10de_002d_1043_0201
+static const pciSubsystemInfo pci_ss_info_10de_002d_1048_0c3a =
+ {0x1048, 0x0c3a, pci_subsys_10de_002d_1048_0c3a, 0};
+#undef pci_ss_info_1048_0c3a
+#define pci_ss_info_1048_0c3a pci_ss_info_10de_002d_1048_0c3a
+static const pciSubsystemInfo pci_ss_info_10de_002d_10de_001e =
+ {0x10de, 0x001e, pci_subsys_10de_002d_10de_001e, 0};
+#undef pci_ss_info_10de_001e
+#define pci_ss_info_10de_001e pci_ss_info_10de_002d_10de_001e
+static const pciSubsystemInfo pci_ss_info_10de_002d_1102_1023 =
+ {0x1102, 0x1023, pci_subsys_10de_002d_1102_1023, 0};
+#undef pci_ss_info_1102_1023
+#define pci_ss_info_1102_1023 pci_ss_info_10de_002d_1102_1023
+static const pciSubsystemInfo pci_ss_info_10de_002d_1102_1024 =
+ {0x1102, 0x1024, pci_subsys_10de_002d_1102_1024, 0};
+#undef pci_ss_info_1102_1024
+#define pci_ss_info_1102_1024 pci_ss_info_10de_002d_1102_1024
+static const pciSubsystemInfo pci_ss_info_10de_002d_1102_102c =
+ {0x1102, 0x102c, pci_subsys_10de_002d_1102_102c, 0};
+#undef pci_ss_info_1102_102c
+#define pci_ss_info_1102_102c pci_ss_info_10de_002d_1102_102c
+static const pciSubsystemInfo pci_ss_info_10de_002d_1462_8808 =
+ {0x1462, 0x8808, pci_subsys_10de_002d_1462_8808, 0};
+#undef pci_ss_info_1462_8808
+#define pci_ss_info_1462_8808 pci_ss_info_10de_002d_1462_8808
+static const pciSubsystemInfo pci_ss_info_10de_002d_1554_1041 =
+ {0x1554, 0x1041, pci_subsys_10de_002d_1554_1041, 0};
+#undef pci_ss_info_1554_1041
+#define pci_ss_info_1554_1041 pci_ss_info_10de_002d_1554_1041
+static const pciSubsystemInfo pci_ss_info_10de_0060_1043_80ad =
+ {0x1043, 0x80ad, pci_subsys_10de_0060_1043_80ad, 0};
+#undef pci_ss_info_1043_80ad
+#define pci_ss_info_1043_80ad pci_ss_info_10de_0060_1043_80ad
+static const pciSubsystemInfo pci_ss_info_10de_0067_1043_0c11 =
+ {0x1043, 0x0c11, pci_subsys_10de_0067_1043_0c11, 0};
+#undef pci_ss_info_1043_0c11
+#define pci_ss_info_1043_0c11 pci_ss_info_10de_0067_1043_0c11
+static const pciSubsystemInfo pci_ss_info_10de_0068_1043_0c11 =
+ {0x1043, 0x0c11, pci_subsys_10de_0068_1043_0c11, 0};
+#undef pci_ss_info_1043_0c11
+#define pci_ss_info_1043_0c11 pci_ss_info_10de_0068_1043_0c11
+static const pciSubsystemInfo pci_ss_info_10de_00a0_14af_5810 =
+ {0x14af, 0x5810, pci_subsys_10de_00a0_14af_5810, 0};
+#undef pci_ss_info_14af_5810
+#define pci_ss_info_14af_5810 pci_ss_info_10de_00a0_14af_5810
+static const pciSubsystemInfo pci_ss_info_10de_0100_1043_0200 =
+ {0x1043, 0x0200, pci_subsys_10de_0100_1043_0200, 0};
+#undef pci_ss_info_1043_0200
+#define pci_ss_info_1043_0200 pci_ss_info_10de_0100_1043_0200
+static const pciSubsystemInfo pci_ss_info_10de_0100_1043_0201 =
+ {0x1043, 0x0201, pci_subsys_10de_0100_1043_0201, 0};
+#undef pci_ss_info_1043_0201
+#define pci_ss_info_1043_0201 pci_ss_info_10de_0100_1043_0201
+static const pciSubsystemInfo pci_ss_info_10de_0100_1043_4008 =
+ {0x1043, 0x4008, pci_subsys_10de_0100_1043_4008, 0};
+#undef pci_ss_info_1043_4008
+#define pci_ss_info_1043_4008 pci_ss_info_10de_0100_1043_4008
+static const pciSubsystemInfo pci_ss_info_10de_0100_1043_4009 =
+ {0x1043, 0x4009, pci_subsys_10de_0100_1043_4009, 0};
+#undef pci_ss_info_1043_4009
+#define pci_ss_info_1043_4009 pci_ss_info_10de_0100_1043_4009
+static const pciSubsystemInfo pci_ss_info_10de_0100_1102_102d =
+ {0x1102, 0x102d, pci_subsys_10de_0100_1102_102d, 0};
+#undef pci_ss_info_1102_102d
+#define pci_ss_info_1102_102d pci_ss_info_10de_0100_1102_102d
+static const pciSubsystemInfo pci_ss_info_10de_0100_14af_5022 =
+ {0x14af, 0x5022, pci_subsys_10de_0100_14af_5022, 0};
+#undef pci_ss_info_14af_5022
+#define pci_ss_info_14af_5022 pci_ss_info_10de_0100_14af_5022
+static const pciSubsystemInfo pci_ss_info_10de_0101_1043_0202 =
+ {0x1043, 0x0202, pci_subsys_10de_0101_1043_0202, 0};
+#undef pci_ss_info_1043_0202
+#define pci_ss_info_1043_0202 pci_ss_info_10de_0101_1043_0202
+static const pciSubsystemInfo pci_ss_info_10de_0101_1043_400a =
+ {0x1043, 0x400a, pci_subsys_10de_0101_1043_400a, 0};
+#undef pci_ss_info_1043_400a
+#define pci_ss_info_1043_400a pci_ss_info_10de_0101_1043_400a
+static const pciSubsystemInfo pci_ss_info_10de_0101_1043_400b =
+ {0x1043, 0x400b, pci_subsys_10de_0101_1043_400b, 0};
+#undef pci_ss_info_1043_400b
+#define pci_ss_info_1043_400b pci_ss_info_10de_0101_1043_400b
+static const pciSubsystemInfo pci_ss_info_10de_0101_1102_102e =
+ {0x1102, 0x102e, pci_subsys_10de_0101_1102_102e, 0};
+#undef pci_ss_info_1102_102e
+#define pci_ss_info_1102_102e pci_ss_info_10de_0101_1102_102e
+static const pciSubsystemInfo pci_ss_info_10de_0101_14af_5021 =
+ {0x14af, 0x5021, pci_subsys_10de_0101_14af_5021, 0};
+#undef pci_ss_info_14af_5021
+#define pci_ss_info_14af_5021 pci_ss_info_10de_0101_14af_5021
+static const pciSubsystemInfo pci_ss_info_10de_0110_1043_4015 =
+ {0x1043, 0x4015, pci_subsys_10de_0110_1043_4015, 0};
+#undef pci_ss_info_1043_4015
+#define pci_ss_info_1043_4015 pci_ss_info_10de_0110_1043_4015
+static const pciSubsystemInfo pci_ss_info_10de_0110_1043_4031 =
+ {0x1043, 0x4031, pci_subsys_10de_0110_1043_4031, 0};
+#undef pci_ss_info_1043_4031
+#define pci_ss_info_1043_4031 pci_ss_info_10de_0110_1043_4031
+static const pciSubsystemInfo pci_ss_info_10de_0110_1462_8817 =
+ {0x1462, 0x8817, pci_subsys_10de_0110_1462_8817, 0};
+#undef pci_ss_info_1462_8817
+#define pci_ss_info_1462_8817 pci_ss_info_10de_0110_1462_8817
+static const pciSubsystemInfo pci_ss_info_10de_0110_14af_7102 =
+ {0x14af, 0x7102, pci_subsys_10de_0110_14af_7102, 0};
+#undef pci_ss_info_14af_7102
+#define pci_ss_info_14af_7102 pci_ss_info_10de_0110_14af_7102
+static const pciSubsystemInfo pci_ss_info_10de_0110_14af_7103 =
+ {0x14af, 0x7103, pci_subsys_10de_0110_14af_7103, 0};
+#undef pci_ss_info_14af_7103
+#define pci_ss_info_14af_7103 pci_ss_info_10de_0110_14af_7103
+static const pciSubsystemInfo pci_ss_info_10de_0150_1043_4016 =
+ {0x1043, 0x4016, pci_subsys_10de_0150_1043_4016, 0};
+#undef pci_ss_info_1043_4016
+#define pci_ss_info_1043_4016 pci_ss_info_10de_0150_1043_4016
+static const pciSubsystemInfo pci_ss_info_10de_0150_107d_2840 =
+ {0x107d, 0x2840, pci_subsys_10de_0150_107d_2840, 0};
+#undef pci_ss_info_107d_2840
+#define pci_ss_info_107d_2840 pci_ss_info_10de_0150_107d_2840
+static const pciSubsystemInfo pci_ss_info_10de_0150_1462_8831 =
+ {0x1462, 0x8831, pci_subsys_10de_0150_1462_8831, 0};
+#undef pci_ss_info_1462_8831
+#define pci_ss_info_1462_8831 pci_ss_info_10de_0150_1462_8831
+static const pciSubsystemInfo pci_ss_info_10de_0151_1043_405f =
+ {0x1043, 0x405f, pci_subsys_10de_0151_1043_405f, 0};
+#undef pci_ss_info_1043_405f
+#define pci_ss_info_1043_405f pci_ss_info_10de_0151_1043_405f
+static const pciSubsystemInfo pci_ss_info_10de_0152_1048_0c56 =
+ {0x1048, 0x0c56, pci_subsys_10de_0152_1048_0c56, 0};
+#undef pci_ss_info_1048_0c56
+#define pci_ss_info_1048_0c56 pci_ss_info_10de_0152_1048_0c56
+static const pciSubsystemInfo pci_ss_info_10de_0171_1462_8661 =
+ {0x1462, 0x8661, pci_subsys_10de_0171_1462_8661, 0};
+#undef pci_ss_info_1462_8661
+#define pci_ss_info_1462_8661 pci_ss_info_10de_0171_1462_8661
+static const pciSubsystemInfo pci_ss_info_10de_0171_1462_8730 =
+ {0x1462, 0x8730, pci_subsys_10de_0171_1462_8730, 0};
+#undef pci_ss_info_1462_8730
+#define pci_ss_info_1462_8730 pci_ss_info_10de_0171_1462_8730
+static const pciSubsystemInfo pci_ss_info_10de_0171_147b_8f00 =
+ {0x147b, 0x8f00, pci_subsys_10de_0171_147b_8f00, 0};
+#undef pci_ss_info_147b_8f00
+#define pci_ss_info_147b_8f00 pci_ss_info_10de_0171_147b_8f00
+static const pciSubsystemInfo pci_ss_info_10de_0200_1043_402f =
+ {0x1043, 0x402f, pci_subsys_10de_0200_1043_402f, 0};
+#undef pci_ss_info_1043_402f
+#define pci_ss_info_1043_402f pci_ss_info_10de_0200_1043_402f
+static const pciSubsystemInfo pci_ss_info_10de_0202_1043_405b =
+ {0x1043, 0x405b, pci_subsys_10de_0202_1043_405b, 0};
+#undef pci_ss_info_1043_405b
+#define pci_ss_info_1043_405b pci_ss_info_10de_0202_1043_405b
+static const pciSubsystemInfo pci_ss_info_10de_0202_1545_002f =
+ {0x1545, 0x002f, pci_subsys_10de_0202_1545_002f, 0};
+#undef pci_ss_info_1545_002f
+#define pci_ss_info_1545_002f pci_ss_info_10de_0202_1545_002f
+static const pciSubsystemInfo pci_ss_info_10de_0253_107d_2896 =
+ {0x107d, 0x2896, pci_subsys_10de_0253_107d_2896, 0};
+#undef pci_ss_info_107d_2896
+#define pci_ss_info_107d_2896 pci_ss_info_10de_0253_107d_2896
+static const pciSubsystemInfo pci_ss_info_10de_0253_147b_8f09 =
+ {0x147b, 0x8f09, pci_subsys_10de_0253_147b_8f09, 0};
+#undef pci_ss_info_147b_8f09
+#define pci_ss_info_147b_8f09 pci_ss_info_10de_0253_147b_8f09
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10e1_0391_10e1_0391 =
+ {0x10e1, 0x0391, pci_subsys_10e1_0391_10e1_0391, 0};
+#undef pci_ss_info_10e1_0391
+#define pci_ss_info_10e1_0391 pci_ss_info_10e1_0391_10e1_0391
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10ec_8029_10b8_2011 =
+ {0x10b8, 0x2011, pci_subsys_10ec_8029_10b8_2011, 0};
+#undef pci_ss_info_10b8_2011
+#define pci_ss_info_10b8_2011 pci_ss_info_10ec_8029_10b8_2011
+static const pciSubsystemInfo pci_ss_info_10ec_8029_10ec_8029 =
+ {0x10ec, 0x8029, pci_subsys_10ec_8029_10ec_8029, 0};
+#undef pci_ss_info_10ec_8029
+#define pci_ss_info_10ec_8029 pci_ss_info_10ec_8029_10ec_8029
+static const pciSubsystemInfo pci_ss_info_10ec_8029_1113_1208 =
+ {0x1113, 0x1208, pci_subsys_10ec_8029_1113_1208, 0};
+#undef pci_ss_info_1113_1208
+#define pci_ss_info_1113_1208 pci_ss_info_10ec_8029_1113_1208
+static const pciSubsystemInfo pci_ss_info_10ec_8029_1186_0300 =
+ {0x1186, 0x0300, pci_subsys_10ec_8029_1186_0300, 0};
+#undef pci_ss_info_1186_0300
+#define pci_ss_info_1186_0300 pci_ss_info_10ec_8029_1186_0300
+static const pciSubsystemInfo pci_ss_info_10ec_8029_1259_2400 =
+ {0x1259, 0x2400, pci_subsys_10ec_8029_1259_2400, 0};
+#undef pci_ss_info_1259_2400
+#define pci_ss_info_1259_2400 pci_ss_info_10ec_8029_1259_2400
+static const pciSubsystemInfo pci_ss_info_10ec_8129_10ec_8129 =
+ {0x10ec, 0x8129, pci_subsys_10ec_8129_10ec_8129, 0};
+#undef pci_ss_info_10ec_8129
+#define pci_ss_info_10ec_8129 pci_ss_info_10ec_8129_10ec_8129
+static const pciSubsystemInfo pci_ss_info_10ec_8138_10ec_8138 =
+ {0x10ec, 0x8138, pci_subsys_10ec_8138_10ec_8138, 0};
+#undef pci_ss_info_10ec_8138
+#define pci_ss_info_10ec_8138 pci_ss_info_10ec_8138_10ec_8138
+#endif
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1025_8920 =
+ {0x1025, 0x8920, pci_subsys_10ec_8139_1025_8920, 0};
+#undef pci_ss_info_1025_8920
+#define pci_ss_info_1025_8920 pci_ss_info_10ec_8139_1025_8920
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1025_8921 =
+ {0x1025, 0x8921, pci_subsys_10ec_8139_1025_8921, 0};
+#undef pci_ss_info_1025_8921
+#define pci_ss_info_1025_8921 pci_ss_info_10ec_8139_1025_8921
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_10ec_8139_10bd_0320 =
+ {0x10bd, 0x0320, pci_subsys_10ec_8139_10bd_0320, 0};
+#undef pci_ss_info_10bd_0320
+#define pci_ss_info_10bd_0320 pci_ss_info_10ec_8139_10bd_0320
+static const pciSubsystemInfo pci_ss_info_10ec_8139_10ec_8139 =
+ {0x10ec, 0x8139, pci_subsys_10ec_8139_10ec_8139, 0};
+#undef pci_ss_info_10ec_8139
+#define pci_ss_info_10ec_8139 pci_ss_info_10ec_8139_10ec_8139
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1186_1300 =
+ {0x1186, 0x1300, pci_subsys_10ec_8139_1186_1300, 0};
+#undef pci_ss_info_1186_1300
+#define pci_ss_info_1186_1300 pci_ss_info_10ec_8139_1186_1300
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1186_1320 =
+ {0x1186, 0x1320, pci_subsys_10ec_8139_1186_1320, 0};
+#undef pci_ss_info_1186_1320
+#define pci_ss_info_1186_1320 pci_ss_info_10ec_8139_1186_1320
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1186_8139 =
+ {0x1186, 0x8139, pci_subsys_10ec_8139_1186_8139, 0};
+#undef pci_ss_info_1186_8139
+#define pci_ss_info_1186_8139 pci_ss_info_10ec_8139_1186_8139
+static const pciSubsystemInfo pci_ss_info_10ec_8139_11f6_8139 =
+ {0x11f6, 0x8139, pci_subsys_10ec_8139_11f6_8139, 0};
+#undef pci_ss_info_11f6_8139
+#define pci_ss_info_11f6_8139 pci_ss_info_10ec_8139_11f6_8139
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1259_2500 =
+ {0x1259, 0x2500, pci_subsys_10ec_8139_1259_2500, 0};
+#undef pci_ss_info_1259_2500
+#define pci_ss_info_1259_2500 pci_ss_info_10ec_8139_1259_2500
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1259_2503 =
+ {0x1259, 0x2503, pci_subsys_10ec_8139_1259_2503, 0};
+#undef pci_ss_info_1259_2503
+#define pci_ss_info_1259_2503 pci_ss_info_10ec_8139_1259_2503
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1429_d010 =
+ {0x1429, 0xd010, pci_subsys_10ec_8139_1429_d010, 0};
+#undef pci_ss_info_1429_d010
+#define pci_ss_info_1429_d010 pci_ss_info_10ec_8139_1429_d010
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1432_9130 =
+ {0x1432, 0x9130, pci_subsys_10ec_8139_1432_9130, 0};
+#undef pci_ss_info_1432_9130
+#define pci_ss_info_1432_9130 pci_ss_info_10ec_8139_1432_9130
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1436_8139 =
+ {0x1436, 0x8139, pci_subsys_10ec_8139_1436_8139, 0};
+#undef pci_ss_info_1436_8139
+#define pci_ss_info_1436_8139 pci_ss_info_10ec_8139_1436_8139
+static const pciSubsystemInfo pci_ss_info_10ec_8139_146c_1439 =
+ {0x146c, 0x1439, pci_subsys_10ec_8139_146c_1439, 0};
+#undef pci_ss_info_146c_1439
+#define pci_ss_info_146c_1439 pci_ss_info_10ec_8139_146c_1439
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1489_6001 =
+ {0x1489, 0x6001, pci_subsys_10ec_8139_1489_6001, 0};
+#undef pci_ss_info_1489_6001
+#define pci_ss_info_1489_6001 pci_ss_info_10ec_8139_1489_6001
+static const pciSubsystemInfo pci_ss_info_10ec_8139_1489_6002 =
+ {0x1489, 0x6002, pci_subsys_10ec_8139_1489_6002, 0};
+#undef pci_ss_info_1489_6002
+#define pci_ss_info_1489_6002 pci_ss_info_10ec_8139_1489_6002
+static const pciSubsystemInfo pci_ss_info_10ec_8139_149c_139a =
+ {0x149c, 0x139a, pci_subsys_10ec_8139_149c_139a, 0};
+#undef pci_ss_info_149c_139a
+#define pci_ss_info_149c_139a pci_ss_info_10ec_8139_149c_139a
+static const pciSubsystemInfo pci_ss_info_10ec_8139_149c_8139 =
+ {0x149c, 0x8139, pci_subsys_10ec_8139_149c_8139, 0};
+#undef pci_ss_info_149c_8139
+#define pci_ss_info_149c_8139 pci_ss_info_10ec_8139_149c_8139
+static const pciSubsystemInfo pci_ss_info_10ec_8139_2646_0001 =
+ {0x2646, 0x0001, pci_subsys_10ec_8139_2646_0001, 0};
+#undef pci_ss_info_2646_0001
+#define pci_ss_info_2646_0001 pci_ss_info_10ec_8139_2646_0001
+static const pciSubsystemInfo pci_ss_info_10ec_8139_8e2e_7000 =
+ {0x8e2e, 0x7000, pci_subsys_10ec_8139_8e2e_7000, 0};
+#undef pci_ss_info_8e2e_7000
+#define pci_ss_info_8e2e_7000 pci_ss_info_10ec_8139_8e2e_7000
+static const pciSubsystemInfo pci_ss_info_10ec_8139_8e2e_7100 =
+ {0x8e2e, 0x7100, pci_subsys_10ec_8139_8e2e_7100, 0};
+#undef pci_ss_info_8e2e_7100
+#define pci_ss_info_8e2e_7100 pci_ss_info_10ec_8139_8e2e_7100
+static const pciSubsystemInfo pci_ss_info_10ec_8139_a0a0_0007 =
+ {0xa0a0, 0x0007, pci_subsys_10ec_8139_a0a0_0007, 0};
+#undef pci_ss_info_a0a0_0007
+#define pci_ss_info_a0a0_0007 pci_ss_info_10ec_8139_a0a0_0007
+static const pciSubsystemInfo pci_ss_info_10ec_8169_1371_434e =
+ {0x1371, 0x434e, pci_subsys_10ec_8169_1371_434e, 0};
+#undef pci_ss_info_1371_434e
+#define pci_ss_info_1371_434e pci_ss_info_10ec_8169_1371_434e
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_0020 =
+ {0x1102, 0x0020, pci_subsys_1102_0002_1102_0020, 0};
+#undef pci_ss_info_1102_0020
+#define pci_ss_info_1102_0020 pci_ss_info_1102_0002_1102_0020
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_0021 =
+ {0x1102, 0x0021, pci_subsys_1102_0002_1102_0021, 0};
+#undef pci_ss_info_1102_0021
+#define pci_ss_info_1102_0021 pci_ss_info_1102_0002_1102_0021
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_002f =
+ {0x1102, 0x002f, pci_subsys_1102_0002_1102_002f, 0};
+#undef pci_ss_info_1102_002f
+#define pci_ss_info_1102_002f pci_ss_info_1102_0002_1102_002f
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_4001 =
+ {0x1102, 0x4001, pci_subsys_1102_0002_1102_4001, 0};
+#undef pci_ss_info_1102_4001
+#define pci_ss_info_1102_4001 pci_ss_info_1102_0002_1102_4001
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8022 =
+ {0x1102, 0x8022, pci_subsys_1102_0002_1102_8022, 0};
+#undef pci_ss_info_1102_8022
+#define pci_ss_info_1102_8022 pci_ss_info_1102_0002_1102_8022
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8023 =
+ {0x1102, 0x8023, pci_subsys_1102_0002_1102_8023, 0};
+#undef pci_ss_info_1102_8023
+#define pci_ss_info_1102_8023 pci_ss_info_1102_0002_1102_8023
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8024 =
+ {0x1102, 0x8024, pci_subsys_1102_0002_1102_8024, 0};
+#undef pci_ss_info_1102_8024
+#define pci_ss_info_1102_8024 pci_ss_info_1102_0002_1102_8024
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8025 =
+ {0x1102, 0x8025, pci_subsys_1102_0002_1102_8025, 0};
+#undef pci_ss_info_1102_8025
+#define pci_ss_info_1102_8025 pci_ss_info_1102_0002_1102_8025
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8026 =
+ {0x1102, 0x8026, pci_subsys_1102_0002_1102_8026, 0};
+#undef pci_ss_info_1102_8026
+#define pci_ss_info_1102_8026 pci_ss_info_1102_0002_1102_8026
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8027 =
+ {0x1102, 0x8027, pci_subsys_1102_0002_1102_8027, 0};
+#undef pci_ss_info_1102_8027
+#define pci_ss_info_1102_8027 pci_ss_info_1102_0002_1102_8027
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8028 =
+ {0x1102, 0x8028, pci_subsys_1102_0002_1102_8028, 0};
+#undef pci_ss_info_1102_8028
+#define pci_ss_info_1102_8028 pci_ss_info_1102_0002_1102_8028
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8031 =
+ {0x1102, 0x8031, pci_subsys_1102_0002_1102_8031, 0};
+#undef pci_ss_info_1102_8031
+#define pci_ss_info_1102_8031 pci_ss_info_1102_0002_1102_8031
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8040 =
+ {0x1102, 0x8040, pci_subsys_1102_0002_1102_8040, 0};
+#undef pci_ss_info_1102_8040
+#define pci_ss_info_1102_8040 pci_ss_info_1102_0002_1102_8040
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8051 =
+ {0x1102, 0x8051, pci_subsys_1102_0002_1102_8051, 0};
+#undef pci_ss_info_1102_8051
+#define pci_ss_info_1102_8051 pci_ss_info_1102_0002_1102_8051
+static const pciSubsystemInfo pci_ss_info_1102_0002_1102_8061 =
+ {0x1102, 0x8061, pci_subsys_1102_0002_1102_8061, 0};
+#undef pci_ss_info_1102_8061
+#define pci_ss_info_1102_8061 pci_ss_info_1102_0002_1102_8061
+static const pciSubsystemInfo pci_ss_info_1102_0004_1102_0051 =
+ {0x1102, 0x0051, pci_subsys_1102_0004_1102_0051, 0};
+#undef pci_ss_info_1102_0051
+#define pci_ss_info_1102_0051 pci_ss_info_1102_0004_1102_0051
+static const pciSubsystemInfo pci_ss_info_1102_0004_1102_0053 =
+ {0x1102, 0x0053, pci_subsys_1102_0004_1102_0053, 0};
+#undef pci_ss_info_1102_0053
+#define pci_ss_info_1102_0053 pci_ss_info_1102_0004_1102_0053
+static const pciSubsystemInfo pci_ss_info_1102_4001_1102_0010 =
+ {0x1102, 0x0010, pci_subsys_1102_4001_1102_0010, 0};
+#undef pci_ss_info_1102_0010
+#define pci_ss_info_1102_0010 pci_ss_info_1102_4001_1102_0010
+static const pciSubsystemInfo pci_ss_info_1102_7002_1102_0020 =
+ {0x1102, 0x0020, pci_subsys_1102_7002_1102_0020, 0};
+#undef pci_ss_info_1102_0020
+#define pci_ss_info_1102_0020 pci_ss_info_1102_7002_1102_0020
+static const pciSubsystemInfo pci_ss_info_1102_7003_1102_0040 =
+ {0x1102, 0x0040, pci_subsys_1102_7003_1102_0040, 0};
+#undef pci_ss_info_1102_0040
+#define pci_ss_info_1102_0040 pci_ss_info_1102_7003_1102_0040
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1103_0004_1103_0001 =
+ {0x1103, 0x0001, pci_subsys_1103_0004_1103_0001, 0};
+#undef pci_ss_info_1103_0001
+#define pci_ss_info_1103_0001 pci_ss_info_1103_0004_1103_0001
+static const pciSubsystemInfo pci_ss_info_1103_0004_1103_0005 =
+ {0x1103, 0x0005, pci_subsys_1103_0004_1103_0005, 0};
+#undef pci_ss_info_1103_0005
+#define pci_ss_info_1103_0005 pci_ss_info_1103_0004_1103_0005
+#endif
+static const pciSubsystemInfo pci_ss_info_1106_0305_1043_8033 =
+ {0x1043, 0x8033, pci_subsys_1106_0305_1043_8033, 0};
+#undef pci_ss_info_1043_8033
+#define pci_ss_info_1043_8033 pci_ss_info_1106_0305_1043_8033
+static const pciSubsystemInfo pci_ss_info_1106_0305_1043_803e =
+ {0x1043, 0x803e, pci_subsys_1106_0305_1043_803e, 0};
+#undef pci_ss_info_1043_803e
+#define pci_ss_info_1043_803e pci_ss_info_1106_0305_1043_803e
+static const pciSubsystemInfo pci_ss_info_1106_0305_1043_8042 =
+ {0x1043, 0x8042, pci_subsys_1106_0305_1043_8042, 0};
+#undef pci_ss_info_1043_8042
+#define pci_ss_info_1043_8042 pci_ss_info_1106_0305_1043_8042
+static const pciSubsystemInfo pci_ss_info_1106_0305_147b_a401 =
+ {0x147b, 0xa401, pci_subsys_1106_0305_147b_a401, 0};
+#undef pci_ss_info_147b_a401
+#define pci_ss_info_147b_a401 pci_ss_info_1106_0305_147b_a401
+static const pciSubsystemInfo pci_ss_info_1106_0571_1043_8052 =
+ {0x1043, 0x8052, pci_subsys_1106_0571_1043_8052, 0};
+#undef pci_ss_info_1043_8052
+#define pci_ss_info_1043_8052 pci_ss_info_1106_0571_1043_8052
+static const pciSubsystemInfo pci_ss_info_1106_0571_1106_0571 =
+ {0x1106, 0x0571, pci_subsys_1106_0571_1106_0571, 0};
+#undef pci_ss_info_1106_0571
+#define pci_ss_info_1106_0571 pci_ss_info_1106_0571_1106_0571
+static const pciSubsystemInfo pci_ss_info_1106_0571_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1106_0571_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1106_0571_1179_0001
+static const pciSubsystemInfo pci_ss_info_1106_0571_1458_5002 =
+ {0x1458, 0x5002, pci_subsys_1106_0571_1458_5002, 0};
+#undef pci_ss_info_1458_5002
+#define pci_ss_info_1458_5002 pci_ss_info_1106_0571_1458_5002
+static const pciSubsystemInfo pci_ss_info_1106_0586_1106_0000 =
+ {0x1106, 0x0000, pci_subsys_1106_0586_1106_0000, 0};
+#undef pci_ss_info_1106_0000
+#define pci_ss_info_1106_0000 pci_ss_info_1106_0586_1106_0000
+static const pciSubsystemInfo pci_ss_info_1106_0596_1106_0000 =
+ {0x1106, 0x0000, pci_subsys_1106_0596_1106_0000, 0};
+#undef pci_ss_info_1106_0000
+#define pci_ss_info_1106_0000 pci_ss_info_1106_0596_1106_0000
+static const pciSubsystemInfo pci_ss_info_1106_0596_1458_0596 =
+ {0x1458, 0x0596, pci_subsys_1106_0596_1458_0596, 0};
+#undef pci_ss_info_1458_0596
+#define pci_ss_info_1458_0596 pci_ss_info_1106_0596_1458_0596
+static const pciSubsystemInfo pci_ss_info_1106_0686_1043_8033 =
+ {0x1043, 0x8033, pci_subsys_1106_0686_1043_8033, 0};
+#undef pci_ss_info_1043_8033
+#define pci_ss_info_1043_8033 pci_ss_info_1106_0686_1043_8033
+static const pciSubsystemInfo pci_ss_info_1106_0686_1043_803e =
+ {0x1043, 0x803e, pci_subsys_1106_0686_1043_803e, 0};
+#undef pci_ss_info_1043_803e
+#define pci_ss_info_1043_803e pci_ss_info_1106_0686_1043_803e
+static const pciSubsystemInfo pci_ss_info_1106_0686_1043_8040 =
+ {0x1043, 0x8040, pci_subsys_1106_0686_1043_8040, 0};
+#undef pci_ss_info_1043_8040
+#define pci_ss_info_1043_8040 pci_ss_info_1106_0686_1043_8040
+static const pciSubsystemInfo pci_ss_info_1106_0686_1043_8042 =
+ {0x1043, 0x8042, pci_subsys_1106_0686_1043_8042, 0};
+#undef pci_ss_info_1043_8042
+#define pci_ss_info_1043_8042 pci_ss_info_1106_0686_1043_8042
+static const pciSubsystemInfo pci_ss_info_1106_0686_1106_0000 =
+ {0x1106, 0x0000, pci_subsys_1106_0686_1106_0000, 0};
+#undef pci_ss_info_1106_0000
+#define pci_ss_info_1106_0000 pci_ss_info_1106_0686_1106_0000
+static const pciSubsystemInfo pci_ss_info_1106_0686_1106_0686 =
+ {0x1106, 0x0686, pci_subsys_1106_0686_1106_0686, 0};
+#undef pci_ss_info_1106_0686
+#define pci_ss_info_1106_0686 pci_ss_info_1106_0686_1106_0686
+static const pciSubsystemInfo pci_ss_info_1106_0686_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1106_0686_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1106_0686_1179_0001
+static const pciSubsystemInfo pci_ss_info_1106_0686_147b_a702 =
+ {0x147b, 0xa702, pci_subsys_1106_0686_147b_a702, 0};
+#undef pci_ss_info_147b_a702
+#define pci_ss_info_147b_a702 pci_ss_info_1106_0686_147b_a702
+static const pciSubsystemInfo pci_ss_info_1106_0691_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1106_0691_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1106_0691_1179_0001
+static const pciSubsystemInfo pci_ss_info_1106_0691_1458_0691 =
+ {0x1458, 0x0691, pci_subsys_1106_0691_1458_0691, 0};
+#undef pci_ss_info_1458_0691
+#define pci_ss_info_1458_0691 pci_ss_info_1106_0691_1458_0691
+static const pciSubsystemInfo pci_ss_info_1106_3038_0925_1234 =
+ {0x0925, 0x1234, pci_subsys_1106_3038_0925_1234, 0};
+#undef pci_ss_info_0925_1234
+#define pci_ss_info_0925_1234 pci_ss_info_1106_3038_0925_1234
+static const pciSubsystemInfo pci_ss_info_1106_3038_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1106_3038_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1106_3038_1179_0001
+static const pciSubsystemInfo pci_ss_info_1106_3043_10bd_0000 =
+ {0x10bd, 0x0000, pci_subsys_1106_3043_10bd_0000, 0};
+#undef pci_ss_info_10bd_0000
+#define pci_ss_info_10bd_0000 pci_ss_info_1106_3043_10bd_0000
+static const pciSubsystemInfo pci_ss_info_1106_3043_1106_0100 =
+ {0x1106, 0x0100, pci_subsys_1106_3043_1106_0100, 0};
+#undef pci_ss_info_1106_0100
+#define pci_ss_info_1106_0100 pci_ss_info_1106_3043_1106_0100
+static const pciSubsystemInfo pci_ss_info_1106_3043_1186_1400 =
+ {0x1186, 0x1400, pci_subsys_1106_3043_1186_1400, 0};
+#undef pci_ss_info_1186_1400
+#define pci_ss_info_1186_1400 pci_ss_info_1106_3043_1186_1400
+static const pciSubsystemInfo pci_ss_info_1106_3057_1043_8033 =
+ {0x1043, 0x8033, pci_subsys_1106_3057_1043_8033, 0};
+#undef pci_ss_info_1043_8033
+#define pci_ss_info_1043_8033 pci_ss_info_1106_3057_1043_8033
+static const pciSubsystemInfo pci_ss_info_1106_3057_1043_803e =
+ {0x1043, 0x803e, pci_subsys_1106_3057_1043_803e, 0};
+#undef pci_ss_info_1043_803e
+#define pci_ss_info_1043_803e pci_ss_info_1106_3057_1043_803e
+static const pciSubsystemInfo pci_ss_info_1106_3057_1043_8040 =
+ {0x1043, 0x8040, pci_subsys_1106_3057_1043_8040, 0};
+#undef pci_ss_info_1043_8040
+#define pci_ss_info_1043_8040 pci_ss_info_1106_3057_1043_8040
+static const pciSubsystemInfo pci_ss_info_1106_3057_1043_8042 =
+ {0x1043, 0x8042, pci_subsys_1106_3057_1043_8042, 0};
+#undef pci_ss_info_1043_8042
+#define pci_ss_info_1043_8042 pci_ss_info_1106_3057_1043_8042
+static const pciSubsystemInfo pci_ss_info_1106_3057_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1106_3057_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1106_3057_1179_0001
+static const pciSubsystemInfo pci_ss_info_1106_3058_0e11_b194 =
+ {0x0e11, 0xb194, pci_subsys_1106_3058_0e11_b194, 0};
+#undef pci_ss_info_0e11_b194
+#define pci_ss_info_0e11_b194 pci_ss_info_1106_3058_0e11_b194
+static const pciSubsystemInfo pci_ss_info_1106_3058_1106_4511 =
+ {0x1106, 0x4511, pci_subsys_1106_3058_1106_4511, 0};
+#undef pci_ss_info_1106_4511
+#define pci_ss_info_1106_4511 pci_ss_info_1106_3058_1106_4511
+static const pciSubsystemInfo pci_ss_info_1106_3058_1458_7600 =
+ {0x1458, 0x7600, pci_subsys_1106_3058_1458_7600, 0};
+#undef pci_ss_info_1458_7600
+#define pci_ss_info_1458_7600 pci_ss_info_1106_3058_1458_7600
+static const pciSubsystemInfo pci_ss_info_1106_3058_1462_3091 =
+ {0x1462, 0x3091, pci_subsys_1106_3058_1462_3091, 0};
+#undef pci_ss_info_1462_3091
+#define pci_ss_info_1462_3091 pci_ss_info_1106_3058_1462_3091
+static const pciSubsystemInfo pci_ss_info_1106_3058_15dd_7609 =
+ {0x15dd, 0x7609, pci_subsys_1106_3058_15dd_7609, 0};
+#undef pci_ss_info_15dd_7609
+#define pci_ss_info_15dd_7609 pci_ss_info_1106_3058_15dd_7609
+static const pciSubsystemInfo pci_ss_info_1106_3059_1458_a002 =
+ {0x1458, 0xa002, pci_subsys_1106_3059_1458_a002, 0};
+#undef pci_ss_info_1458_a002
+#define pci_ss_info_1458_a002 pci_ss_info_1106_3059_1458_a002
+static const pciSubsystemInfo pci_ss_info_1106_3065_1106_0102 =
+ {0x1106, 0x0102, pci_subsys_1106_3065_1106_0102, 0};
+#undef pci_ss_info_1106_0102
+#define pci_ss_info_1106_0102 pci_ss_info_1106_3065_1106_0102
+static const pciSubsystemInfo pci_ss_info_1106_3065_1186_1400 =
+ {0x1186, 0x1400, pci_subsys_1106_3065_1186_1400, 0};
+#undef pci_ss_info_1186_1400
+#define pci_ss_info_1186_1400 pci_ss_info_1106_3065_1186_1400
+static const pciSubsystemInfo pci_ss_info_1106_3065_1186_1401 =
+ {0x1186, 0x1401, pci_subsys_1106_3065_1186_1401, 0};
+#undef pci_ss_info_1186_1401
+#define pci_ss_info_1186_1401 pci_ss_info_1106_3065_1186_1401
+static const pciSubsystemInfo pci_ss_info_1106_3074_1043_8052 =
+ {0x1043, 0x8052, pci_subsys_1106_3074_1043_8052, 0};
+#undef pci_ss_info_1043_8052
+#define pci_ss_info_1043_8052 pci_ss_info_1106_3074_1043_8052
+static const pciSubsystemInfo pci_ss_info_1106_3099_1043_8064 =
+ {0x1043, 0x8064, pci_subsys_1106_3099_1043_8064, 0};
+#undef pci_ss_info_1043_8064
+#define pci_ss_info_1043_8064 pci_ss_info_1106_3099_1043_8064
+static const pciSubsystemInfo pci_ss_info_1106_3099_1043_807f =
+ {0x1043, 0x807f, pci_subsys_1106_3099_1043_807f, 0};
+#undef pci_ss_info_1043_807f
+#define pci_ss_info_1043_807f pci_ss_info_1106_3099_1043_807f
+static const pciSubsystemInfo pci_ss_info_1106_3104_1458_5004 =
+ {0x1458, 0x5004, pci_subsys_1106_3104_1458_5004, 0};
+#undef pci_ss_info_1458_5004
+#define pci_ss_info_1458_5004 pci_ss_info_1106_3104_1458_5004
+static const pciSubsystemInfo pci_ss_info_1106_3177_1458_5001 =
+ {0x1458, 0x5001, pci_subsys_1106_3177_1458_5001, 0};
+#undef pci_ss_info_1458_5001
+#define pci_ss_info_1458_5001 pci_ss_info_1106_3177_1458_5001
+static const pciSubsystemInfo pci_ss_info_1106_3189_1458_5000 =
+ {0x1458, 0x5000, pci_subsys_1106_3189_1458_5000, 0};
+#undef pci_ss_info_1458_5000
+#define pci_ss_info_1458_5000 pci_ss_info_1106_3189_1458_5000
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1113_1211_103c_1207 =
+ {0x103c, 0x1207, pci_subsys_1113_1211_103c_1207, 0};
+#undef pci_ss_info_103c_1207
+#define pci_ss_info_103c_1207 pci_ss_info_1113_1211_103c_1207
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1113_1211_1113_1211 =
+ {0x1113, 0x1211, pci_subsys_1113_1211_1113_1211, 0};
+#undef pci_ss_info_1113_1211
+#define pci_ss_info_1113_1211 pci_ss_info_1113_1211_1113_1211
+static const pciSubsystemInfo pci_ss_info_1113_1216_111a_1020 =
+ {0x111a, 0x1020, pci_subsys_1113_1216_111a_1020, 0};
+#undef pci_ss_info_111a_1020
+#define pci_ss_info_111a_1020 pci_ss_info_1113_1216_111a_1020
+static const pciSubsystemInfo pci_ss_info_1113_9211_1113_9211 =
+ {0x1113, 0x9211, pci_subsys_1113_9211_1113_9211, 0};
+#undef pci_ss_info_1113_9211
+#define pci_ss_info_1113_9211 pci_ss_info_1113_9211_1113_9211
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_111a_0003_111a_0000 =
+ {0x111a, 0x0000, pci_subsys_111a_0003_111a_0000, 0};
+#undef pci_ss_info_111a_0000
+#define pci_ss_info_111a_0000 pci_ss_info_111a_0003_111a_0000
+static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0001 =
+ {0x111a, 0x0001, pci_subsys_111a_0005_111a_0001, 0};
+#undef pci_ss_info_111a_0001
+#define pci_ss_info_111a_0001 pci_ss_info_111a_0005_111a_0001
+static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0009 =
+ {0x111a, 0x0009, pci_subsys_111a_0005_111a_0009, 0};
+#undef pci_ss_info_111a_0009
+#define pci_ss_info_111a_0009 pci_ss_info_111a_0005_111a_0009
+static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0101 =
+ {0x111a, 0x0101, pci_subsys_111a_0005_111a_0101, 0};
+#undef pci_ss_info_111a_0101
+#define pci_ss_info_111a_0101 pci_ss_info_111a_0005_111a_0101
+static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0109 =
+ {0x111a, 0x0109, pci_subsys_111a_0005_111a_0109, 0};
+#undef pci_ss_info_111a_0109
+#define pci_ss_info_111a_0109 pci_ss_info_111a_0005_111a_0109
+static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0809 =
+ {0x111a, 0x0809, pci_subsys_111a_0005_111a_0809, 0};
+#undef pci_ss_info_111a_0809
+#define pci_ss_info_111a_0809 pci_ss_info_111a_0005_111a_0809
+static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0909 =
+ {0x111a, 0x0909, pci_subsys_111a_0005_111a_0909, 0};
+#undef pci_ss_info_111a_0909
+#define pci_ss_info_111a_0909 pci_ss_info_111a_0005_111a_0909
+static const pciSubsystemInfo pci_ss_info_111a_0005_111a_0a09 =
+ {0x111a, 0x0a09, pci_subsys_111a_0005_111a_0a09, 0};
+#undef pci_ss_info_111a_0a09
+#define pci_ss_info_111a_0a09 pci_ss_info_111a_0005_111a_0a09
+static const pciSubsystemInfo pci_ss_info_111a_0007_111a_1001 =
+ {0x111a, 0x1001, pci_subsys_111a_0007_111a_1001, 0};
+#undef pci_ss_info_111a_1001
+#define pci_ss_info_111a_1001 pci_ss_info_111a_0007_111a_1001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1127_0400_1127_0400 =
+ {0x1127, 0x0400, pci_subsys_1127_0400_1127_0400, 0};
+#undef pci_ss_info_1127_0400
+#define pci_ss_info_1127_0400 pci_ss_info_1127_0400_1127_0400
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1131_7146_114b_2003 =
+ {0x114b, 0x2003, pci_subsys_1131_7146_114b_2003, 0};
+#undef pci_ss_info_114b_2003
+#define pci_ss_info_114b_2003 pci_ss_info_1131_7146_114b_2003
+static const pciSubsystemInfo pci_ss_info_1131_7146_11bd_0006 =
+ {0x11bd, 0x0006, pci_subsys_1131_7146_11bd_0006, 0};
+#undef pci_ss_info_11bd_0006
+#define pci_ss_info_11bd_0006 pci_ss_info_1131_7146_11bd_0006
+static const pciSubsystemInfo pci_ss_info_1131_7146_11bd_000a =
+ {0x11bd, 0x000a, pci_subsys_1131_7146_11bd_000a, 0};
+#undef pci_ss_info_11bd_000a
+#define pci_ss_info_11bd_000a pci_ss_info_1131_7146_11bd_000a
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1133_e001_1133_e001 =
+ {0x1133, 0xe001, pci_subsys_1133_e001_1133_e001, 0};
+#undef pci_ss_info_1133_e001
+#define pci_ss_info_1133_e001 pci_ss_info_1133_e001_1133_e001
+static const pciSubsystemInfo pci_ss_info_1133_e002_1133_e002 =
+ {0x1133, 0xe002, pci_subsys_1133_e002_1133_e002, 0};
+#undef pci_ss_info_1133_e002
+#define pci_ss_info_1133_e002 pci_ss_info_1133_e002_1133_e002
+static const pciSubsystemInfo pci_ss_info_1133_e003_1133_e003 =
+ {0x1133, 0xe003, pci_subsys_1133_e003_1133_e003, 0};
+#undef pci_ss_info_1133_e003
+#define pci_ss_info_1133_e003 pci_ss_info_1133_e003_1133_e003
+static const pciSubsystemInfo pci_ss_info_1133_e004_1133_e004 =
+ {0x1133, 0xe004, pci_subsys_1133_e004_1133_e004, 0};
+#undef pci_ss_info_1133_e004
+#define pci_ss_info_1133_e004 pci_ss_info_1133_e004_1133_e004
+static const pciSubsystemInfo pci_ss_info_1133_e005_1133_e005 =
+ {0x1133, 0xe005, pci_subsys_1133_e005_1133_e005, 0};
+#undef pci_ss_info_1133_e005
+#define pci_ss_info_1133_e005 pci_ss_info_1133_e005_1133_e005
+static const pciSubsystemInfo pci_ss_info_1133_e010_1133_e010 =
+ {0x1133, 0xe010, pci_subsys_1133_e010_1133_e010, 0};
+#undef pci_ss_info_1133_e010
+#define pci_ss_info_1133_e010 pci_ss_info_1133_e010_1133_e010
+static const pciSubsystemInfo pci_ss_info_1133_e012_1133_e012 =
+ {0x1133, 0xe012, pci_subsys_1133_e012_1133_e012, 0};
+#undef pci_ss_info_1133_e012
+#define pci_ss_info_1133_e012 pci_ss_info_1133_e012_1133_e012
+static const pciSubsystemInfo pci_ss_info_1133_e014_1133_e014 =
+ {0x1133, 0xe014, pci_subsys_1133_e014_1133_e014, 0};
+#undef pci_ss_info_1133_e014
+#define pci_ss_info_1133_e014 pci_ss_info_1133_e014_1133_e014
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03b =
+ {0x0e11, 0xb03b, pci_subsys_1148_4000_0e11_b03b, 0};
+#undef pci_ss_info_0e11_b03b
+#define pci_ss_info_0e11_b03b pci_ss_info_1148_4000_0e11_b03b
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03c =
+ {0x0e11, 0xb03c, pci_subsys_1148_4000_0e11_b03c, 0};
+#undef pci_ss_info_0e11_b03c
+#define pci_ss_info_0e11_b03c pci_ss_info_1148_4000_0e11_b03c
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03d =
+ {0x0e11, 0xb03d, pci_subsys_1148_4000_0e11_b03d, 0};
+#undef pci_ss_info_0e11_b03d
+#define pci_ss_info_0e11_b03d pci_ss_info_1148_4000_0e11_b03d
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03e =
+ {0x0e11, 0xb03e, pci_subsys_1148_4000_0e11_b03e, 0};
+#undef pci_ss_info_0e11_b03e
+#define pci_ss_info_0e11_b03e pci_ss_info_1148_4000_0e11_b03e
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1148_4000_0e11_b03f =
+ {0x0e11, 0xb03f, pci_subsys_1148_4000_0e11_b03f, 0};
+#undef pci_ss_info_0e11_b03f
+#define pci_ss_info_0e11_b03f pci_ss_info_1148_4000_0e11_b03f
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5521 =
+ {0x1148, 0x5521, pci_subsys_1148_4000_1148_5521, 0};
+#undef pci_ss_info_1148_5521
+#define pci_ss_info_1148_5521 pci_ss_info_1148_4000_1148_5521
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5522 =
+ {0x1148, 0x5522, pci_subsys_1148_4000_1148_5522, 0};
+#undef pci_ss_info_1148_5522
+#define pci_ss_info_1148_5522 pci_ss_info_1148_4000_1148_5522
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5541 =
+ {0x1148, 0x5541, pci_subsys_1148_4000_1148_5541, 0};
+#undef pci_ss_info_1148_5541
+#define pci_ss_info_1148_5541 pci_ss_info_1148_4000_1148_5541
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5543 =
+ {0x1148, 0x5543, pci_subsys_1148_4000_1148_5543, 0};
+#undef pci_ss_info_1148_5543
+#define pci_ss_info_1148_5543 pci_ss_info_1148_4000_1148_5543
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5544 =
+ {0x1148, 0x5544, pci_subsys_1148_4000_1148_5544, 0};
+#undef pci_ss_info_1148_5544
+#define pci_ss_info_1148_5544 pci_ss_info_1148_4000_1148_5544
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5821 =
+ {0x1148, 0x5821, pci_subsys_1148_4000_1148_5821, 0};
+#undef pci_ss_info_1148_5821
+#define pci_ss_info_1148_5821 pci_ss_info_1148_4000_1148_5821
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5822 =
+ {0x1148, 0x5822, pci_subsys_1148_4000_1148_5822, 0};
+#undef pci_ss_info_1148_5822
+#define pci_ss_info_1148_5822 pci_ss_info_1148_4000_1148_5822
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5841 =
+ {0x1148, 0x5841, pci_subsys_1148_4000_1148_5841, 0};
+#undef pci_ss_info_1148_5841
+#define pci_ss_info_1148_5841 pci_ss_info_1148_4000_1148_5841
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5843 =
+ {0x1148, 0x5843, pci_subsys_1148_4000_1148_5843, 0};
+#undef pci_ss_info_1148_5843
+#define pci_ss_info_1148_5843 pci_ss_info_1148_4000_1148_5843
+static const pciSubsystemInfo pci_ss_info_1148_4000_1148_5844 =
+ {0x1148, 0x5844, pci_subsys_1148_4000_1148_5844, 0};
+#undef pci_ss_info_1148_5844
+#define pci_ss_info_1148_5844 pci_ss_info_1148_4000_1148_5844
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9821 =
+ {0x1148, 0x9821, pci_subsys_1148_4300_1148_9821, 0};
+#undef pci_ss_info_1148_9821
+#define pci_ss_info_1148_9821 pci_ss_info_1148_4300_1148_9821
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9822 =
+ {0x1148, 0x9822, pci_subsys_1148_4300_1148_9822, 0};
+#undef pci_ss_info_1148_9822
+#define pci_ss_info_1148_9822 pci_ss_info_1148_4300_1148_9822
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9841 =
+ {0x1148, 0x9841, pci_subsys_1148_4300_1148_9841, 0};
+#undef pci_ss_info_1148_9841
+#define pci_ss_info_1148_9841 pci_ss_info_1148_4300_1148_9841
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9842 =
+ {0x1148, 0x9842, pci_subsys_1148_4300_1148_9842, 0};
+#undef pci_ss_info_1148_9842
+#define pci_ss_info_1148_9842 pci_ss_info_1148_4300_1148_9842
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9843 =
+ {0x1148, 0x9843, pci_subsys_1148_4300_1148_9843, 0};
+#undef pci_ss_info_1148_9843
+#define pci_ss_info_1148_9843 pci_ss_info_1148_4300_1148_9843
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9844 =
+ {0x1148, 0x9844, pci_subsys_1148_4300_1148_9844, 0};
+#undef pci_ss_info_1148_9844
+#define pci_ss_info_1148_9844 pci_ss_info_1148_4300_1148_9844
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9861 =
+ {0x1148, 0x9861, pci_subsys_1148_4300_1148_9861, 0};
+#undef pci_ss_info_1148_9861
+#define pci_ss_info_1148_9861 pci_ss_info_1148_4300_1148_9861
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9862 =
+ {0x1148, 0x9862, pci_subsys_1148_4300_1148_9862, 0};
+#undef pci_ss_info_1148_9862
+#define pci_ss_info_1148_9862 pci_ss_info_1148_4300_1148_9862
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9871 =
+ {0x1148, 0x9871, pci_subsys_1148_4300_1148_9871, 0};
+#undef pci_ss_info_1148_9871
+#define pci_ss_info_1148_9871 pci_ss_info_1148_4300_1148_9871
+static const pciSubsystemInfo pci_ss_info_1148_4300_1148_9872 =
+ {0x1148, 0x9872, pci_subsys_1148_4300_1148_9872, 0};
+#undef pci_ss_info_1148_9872
+#define pci_ss_info_1148_9872 pci_ss_info_1148_4300_1148_9872
+static const pciSubsystemInfo pci_ss_info_1148_4300_1259_2970 =
+ {0x1259, 0x2970, pci_subsys_1148_4300_1259_2970, 0};
+#undef pci_ss_info_1259_2970
+#define pci_ss_info_1259_2970 pci_ss_info_1148_4300_1259_2970
+static const pciSubsystemInfo pci_ss_info_1148_4300_1259_2972 =
+ {0x1259, 0x2972, pci_subsys_1148_4300_1259_2972, 0};
+#undef pci_ss_info_1259_2972
+#define pci_ss_info_1259_2972 pci_ss_info_1148_4300_1259_2972
+static const pciSubsystemInfo pci_ss_info_1148_4300_1259_2975 =
+ {0x1259, 0x2975, pci_subsys_1148_4300_1259_2975, 0};
+#undef pci_ss_info_1259_2975
+#define pci_ss_info_1259_2975 pci_ss_info_1148_4300_1259_2975
+static const pciSubsystemInfo pci_ss_info_1148_4300_1259_2977 =
+ {0x1259, 0x2977, pci_subsys_1148_4300_1259_2977, 0};
+#undef pci_ss_info_1259_2977
+#define pci_ss_info_1259_2977 pci_ss_info_1148_4300_1259_2977
+static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5021 =
+ {0x1148, 0x5021, pci_subsys_1148_4320_1148_5021, 0};
+#undef pci_ss_info_1148_5021
+#define pci_ss_info_1148_5021 pci_ss_info_1148_4320_1148_5021
+static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5041 =
+ {0x1148, 0x5041, pci_subsys_1148_4320_1148_5041, 0};
+#undef pci_ss_info_1148_5041
+#define pci_ss_info_1148_5041 pci_ss_info_1148_4320_1148_5041
+static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5043 =
+ {0x1148, 0x5043, pci_subsys_1148_4320_1148_5043, 0};
+#undef pci_ss_info_1148_5043
+#define pci_ss_info_1148_5043 pci_ss_info_1148_4320_1148_5043
+static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5051 =
+ {0x1148, 0x5051, pci_subsys_1148_4320_1148_5051, 0};
+#undef pci_ss_info_1148_5051
+#define pci_ss_info_1148_5051 pci_ss_info_1148_4320_1148_5051
+static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5061 =
+ {0x1148, 0x5061, pci_subsys_1148_4320_1148_5061, 0};
+#undef pci_ss_info_1148_5061
+#define pci_ss_info_1148_5061 pci_ss_info_1148_4320_1148_5061
+static const pciSubsystemInfo pci_ss_info_1148_4320_1148_5071 =
+ {0x1148, 0x5071, pci_subsys_1148_4320_1148_5071, 0};
+#undef pci_ss_info_1148_5071
+#define pci_ss_info_1148_5071 pci_ss_info_1148_4320_1148_5071
+static const pciSubsystemInfo pci_ss_info_1148_4320_1148_9521 =
+ {0x1148, 0x9521, pci_subsys_1148_4320_1148_9521, 0};
+#undef pci_ss_info_1148_9521
+#define pci_ss_info_1148_9521 pci_ss_info_1148_4320_1148_9521
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_114f_001d_114f_0050 =
+ {0x114f, 0x0050, pci_subsys_114f_001d_114f_0050, 0};
+#undef pci_ss_info_114f_0050
+#define pci_ss_info_114f_0050 pci_ss_info_114f_001d_114f_0050
+static const pciSubsystemInfo pci_ss_info_114f_001d_114f_0051 =
+ {0x114f, 0x0051, pci_subsys_114f_001d_114f_0051, 0};
+#undef pci_ss_info_114f_0051
+#define pci_ss_info_114f_0051 pci_ss_info_114f_001d_114f_0051
+static const pciSubsystemInfo pci_ss_info_114f_001d_114f_0052 =
+ {0x114f, 0x0052, pci_subsys_114f_001d_114f_0052, 0};
+#undef pci_ss_info_114f_0052
+#define pci_ss_info_114f_0052 pci_ss_info_114f_001d_114f_0052
+static const pciSubsystemInfo pci_ss_info_114f_001d_114f_0053 =
+ {0x114f, 0x0053, pci_subsys_114f_001d_114f_0053, 0};
+#undef pci_ss_info_114f_0053
+#define pci_ss_info_114f_0053 pci_ss_info_114f_001d_114f_0053
+static const pciSubsystemInfo pci_ss_info_114f_0024_114f_0030 =
+ {0x114f, 0x0030, pci_subsys_114f_0024_114f_0030, 0};
+#undef pci_ss_info_114f_0030
+#define pci_ss_info_114f_0030 pci_ss_info_114f_0024_114f_0030
+static const pciSubsystemInfo pci_ss_info_114f_0024_114f_0031 =
+ {0x114f, 0x0031, pci_subsys_114f_0024_114f_0031, 0};
+#undef pci_ss_info_114f_0031
+#define pci_ss_info_114f_0031 pci_ss_info_114f_0024_114f_0031
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_115d_0003_1014_0181 =
+ {0x1014, 0x0181, pci_subsys_115d_0003_1014_0181, 0};
+#undef pci_ss_info_1014_0181
+#define pci_ss_info_1014_0181 pci_ss_info_115d_0003_1014_0181
+static const pciSubsystemInfo pci_ss_info_115d_0003_1014_1181 =
+ {0x1014, 0x1181, pci_subsys_115d_0003_1014_1181, 0};
+#undef pci_ss_info_1014_1181
+#define pci_ss_info_1014_1181 pci_ss_info_115d_0003_1014_1181
+static const pciSubsystemInfo pci_ss_info_115d_0003_1014_8181 =
+ {0x1014, 0x8181, pci_subsys_115d_0003_1014_8181, 0};
+#undef pci_ss_info_1014_8181
+#define pci_ss_info_1014_8181 pci_ss_info_115d_0003_1014_8181
+static const pciSubsystemInfo pci_ss_info_115d_0003_1014_9181 =
+ {0x1014, 0x9181, pci_subsys_115d_0003_1014_9181, 0};
+#undef pci_ss_info_1014_9181
+#define pci_ss_info_1014_9181 pci_ss_info_115d_0003_1014_9181
+static const pciSubsystemInfo pci_ss_info_115d_0003_115d_0181 =
+ {0x115d, 0x0181, pci_subsys_115d_0003_115d_0181, 0};
+#undef pci_ss_info_115d_0181
+#define pci_ss_info_115d_0181 pci_ss_info_115d_0003_115d_0181
+static const pciSubsystemInfo pci_ss_info_115d_0003_115d_1181 =
+ {0x115d, 0x1181, pci_subsys_115d_0003_115d_1181, 0};
+#undef pci_ss_info_115d_1181
+#define pci_ss_info_115d_1181 pci_ss_info_115d_0003_115d_1181
+static const pciSubsystemInfo pci_ss_info_115d_0003_1179_0181 =
+ {0x1179, 0x0181, pci_subsys_115d_0003_1179_0181, 0};
+#undef pci_ss_info_1179_0181
+#define pci_ss_info_1179_0181 pci_ss_info_115d_0003_1179_0181
+#endif
+static const pciSubsystemInfo pci_ss_info_115d_0003_8086_8181 =
+ {0x8086, 0x8181, pci_subsys_115d_0003_8086_8181, 0};
+#undef pci_ss_info_8086_8181
+#define pci_ss_info_8086_8181 pci_ss_info_115d_0003_8086_8181
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_115d_0003_8086_9181 =
+ {0x8086, 0x9181, pci_subsys_115d_0003_8086_9181, 0};
+#undef pci_ss_info_8086_9181
+#define pci_ss_info_8086_9181 pci_ss_info_115d_0003_8086_9181
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_115d_0005_1014_0182 =
+ {0x1014, 0x0182, pci_subsys_115d_0005_1014_0182, 0};
+#undef pci_ss_info_1014_0182
+#define pci_ss_info_1014_0182 pci_ss_info_115d_0005_1014_0182
+static const pciSubsystemInfo pci_ss_info_115d_0005_1014_1182 =
+ {0x1014, 0x1182, pci_subsys_115d_0005_1014_1182, 0};
+#undef pci_ss_info_1014_1182
+#define pci_ss_info_1014_1182 pci_ss_info_115d_0005_1014_1182
+static const pciSubsystemInfo pci_ss_info_115d_0005_115d_0182 =
+ {0x115d, 0x0182, pci_subsys_115d_0005_115d_0182, 0};
+#undef pci_ss_info_115d_0182
+#define pci_ss_info_115d_0182 pci_ss_info_115d_0005_115d_0182
+static const pciSubsystemInfo pci_ss_info_115d_0005_115d_1182 =
+ {0x115d, 0x1182, pci_subsys_115d_0005_115d_1182, 0};
+#undef pci_ss_info_115d_1182
+#define pci_ss_info_115d_1182 pci_ss_info_115d_0005_115d_1182
+static const pciSubsystemInfo pci_ss_info_115d_0007_1014_0182 =
+ {0x1014, 0x0182, pci_subsys_115d_0007_1014_0182, 0};
+#undef pci_ss_info_1014_0182
+#define pci_ss_info_1014_0182 pci_ss_info_115d_0007_1014_0182
+static const pciSubsystemInfo pci_ss_info_115d_0007_1014_1182 =
+ {0x1014, 0x1182, pci_subsys_115d_0007_1014_1182, 0};
+#undef pci_ss_info_1014_1182
+#define pci_ss_info_1014_1182 pci_ss_info_115d_0007_1014_1182
+static const pciSubsystemInfo pci_ss_info_115d_0007_115d_0182 =
+ {0x115d, 0x0182, pci_subsys_115d_0007_115d_0182, 0};
+#undef pci_ss_info_115d_0182
+#define pci_ss_info_115d_0182 pci_ss_info_115d_0007_115d_0182
+static const pciSubsystemInfo pci_ss_info_115d_0007_115d_1182 =
+ {0x115d, 0x1182, pci_subsys_115d_0007_115d_1182, 0};
+#undef pci_ss_info_115d_1182
+#define pci_ss_info_115d_1182 pci_ss_info_115d_0007_115d_1182
+static const pciSubsystemInfo pci_ss_info_115d_000b_1014_0183 =
+ {0x1014, 0x0183, pci_subsys_115d_000b_1014_0183, 0};
+#undef pci_ss_info_1014_0183
+#define pci_ss_info_1014_0183 pci_ss_info_115d_000b_1014_0183
+static const pciSubsystemInfo pci_ss_info_115d_000b_115d_0183 =
+ {0x115d, 0x0183, pci_subsys_115d_000b_115d_0183, 0};
+#undef pci_ss_info_115d_0183
+#define pci_ss_info_115d_0183 pci_ss_info_115d_000b_115d_0183
+static const pciSubsystemInfo pci_ss_info_115d_000f_1014_0183 =
+ {0x1014, 0x0183, pci_subsys_115d_000f_1014_0183, 0};
+#undef pci_ss_info_1014_0183
+#define pci_ss_info_1014_0183 pci_ss_info_115d_000f_1014_0183
+static const pciSubsystemInfo pci_ss_info_115d_000f_115d_0183 =
+ {0x115d, 0x0183, pci_subsys_115d_000f_115d_0183, 0};
+#undef pci_ss_info_115d_0183
+#define pci_ss_info_115d_0183 pci_ss_info_115d_000f_115d_0183
+static const pciSubsystemInfo pci_ss_info_115d_0101_115d_1081 =
+ {0x115d, 0x1081, pci_subsys_115d_0101_115d_1081, 0};
+#undef pci_ss_info_115d_1081
+#define pci_ss_info_115d_1081 pci_ss_info_115d_0101_115d_1081
+static const pciSubsystemInfo pci_ss_info_115d_0103_1014_9181 =
+ {0x1014, 0x9181, pci_subsys_115d_0103_1014_9181, 0};
+#undef pci_ss_info_1014_9181
+#define pci_ss_info_1014_9181 pci_ss_info_115d_0103_1014_9181
+static const pciSubsystemInfo pci_ss_info_115d_0103_1115_1181 =
+ {0x1115, 0x1181, pci_subsys_115d_0103_1115_1181, 0};
+#undef pci_ss_info_1115_1181
+#define pci_ss_info_1115_1181 pci_ss_info_115d_0103_1115_1181
+static const pciSubsystemInfo pci_ss_info_115d_0103_115d_1181 =
+ {0x115d, 0x1181, pci_subsys_115d_0103_115d_1181, 0};
+#undef pci_ss_info_115d_1181
+#define pci_ss_info_115d_1181 pci_ss_info_115d_0103_115d_1181
+#endif
+static const pciSubsystemInfo pci_ss_info_115d_0103_8086_9181 =
+ {0x8086, 0x9181, pci_subsys_115d_0103_8086_9181, 0};
+#undef pci_ss_info_8086_9181
+#define pci_ss_info_8086_9181 pci_ss_info_115d_0103_8086_9181
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1163_2000_1092_2000 =
+ {0x1092, 0x2000, pci_subsys_1163_2000_1092_2000, 0};
+#undef pci_ss_info_1092_2000
+#define pci_ss_info_1092_2000 pci_ss_info_1163_2000_1092_2000
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1179_0d01_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1179_0d01_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1179_0d01_1179_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1180_0475_144d_c006 =
+ {0x144d, 0xc006, pci_subsys_1180_0475_144d_c006, 0};
+#undef pci_ss_info_144d_c006
+#define pci_ss_info_144d_c006 pci_ss_info_1180_0475_144d_c006
+static const pciSubsystemInfo pci_ss_info_1180_0476_1014_0185 =
+ {0x1014, 0x0185, pci_subsys_1180_0476_1014_0185, 0};
+#undef pci_ss_info_1014_0185
+#define pci_ss_info_1014_0185 pci_ss_info_1180_0476_1014_0185
+#endif
+static const pciSubsystemInfo pci_ss_info_1180_0476_104d_80df =
+ {0x104d, 0x80df, pci_subsys_1180_0476_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_1180_0476_104d_80df
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1180_0476_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_1180_0476_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_1180_0476_104d_80e7
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1180_0478_1014_0184 =
+ {0x1014, 0x0184, pci_subsys_1180_0478_1014_0184, 0};
+#undef pci_ss_info_1014_0184
+#define pci_ss_info_1014_0184 pci_ss_info_1180_0478_1014_0184
+static const pciSubsystemInfo pci_ss_info_1180_0522_1014_01cf =
+ {0x1014, 0x01cf, pci_subsys_1180_0522_1014_01cf, 0};
+#undef pci_ss_info_1014_01cf
+#define pci_ss_info_1014_01cf pci_ss_info_1180_0522_1014_01cf
+static const pciSubsystemInfo pci_ss_info_1180_0551_144d_c006 =
+ {0x144d, 0xc006, pci_subsys_1180_0551_144d_c006, 0};
+#undef pci_ss_info_144d_c006
+#define pci_ss_info_144d_c006 pci_ss_info_1180_0551_144d_c006
+static const pciSubsystemInfo pci_ss_info_1180_0552_1014_0511 =
+ {0x1014, 0x0511, pci_subsys_1180_0552_1014_0511, 0};
+#undef pci_ss_info_1014_0511
+#define pci_ss_info_1014_0511 pci_ss_info_1180_0552_1014_0511
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1186_1002_1186_1002 =
+ {0x1186, 0x1002, pci_subsys_1186_1002_1186_1002, 0};
+#undef pci_ss_info_1186_1002
+#define pci_ss_info_1186_1002 pci_ss_info_1186_1002_1186_1002
+static const pciSubsystemInfo pci_ss_info_1186_1002_1186_1012 =
+ {0x1186, 0x1012, pci_subsys_1186_1002_1186_1012, 0};
+#undef pci_ss_info_1186_1012
+#define pci_ss_info_1186_1012 pci_ss_info_1186_1002_1186_1012
+static const pciSubsystemInfo pci_ss_info_1186_1300_1186_1300 =
+ {0x1186, 0x1300, pci_subsys_1186_1300_1186_1300, 0};
+#undef pci_ss_info_1186_1300
+#define pci_ss_info_1186_1300 pci_ss_info_1186_1300_1186_1300
+static const pciSubsystemInfo pci_ss_info_1186_1300_1186_1301 =
+ {0x1186, 0x1301, pci_subsys_1186_1300_1186_1301, 0};
+#undef pci_ss_info_1186_1301
+#define pci_ss_info_1186_1301 pci_ss_info_1186_1300_1186_1301
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_11ad_0002_11ad_0002 =
+ {0x11ad, 0x0002, pci_subsys_11ad_0002_11ad_0002, 0};
+#undef pci_ss_info_11ad_0002
+#define pci_ss_info_11ad_0002 pci_ss_info_11ad_0002_11ad_0002
+static const pciSubsystemInfo pci_ss_info_11ad_0002_11ad_0003 =
+ {0x11ad, 0x0003, pci_subsys_11ad_0002_11ad_0003, 0};
+#undef pci_ss_info_11ad_0003
+#define pci_ss_info_11ad_0003 pci_ss_info_11ad_0002_11ad_0003
+static const pciSubsystemInfo pci_ss_info_11ad_0002_11ad_f003 =
+ {0x11ad, 0xf003, pci_subsys_11ad_0002_11ad_f003, 0};
+#undef pci_ss_info_11ad_f003
+#define pci_ss_info_11ad_f003 pci_ss_info_11ad_0002_11ad_f003
+static const pciSubsystemInfo pci_ss_info_11ad_0002_11ad_ffff =
+ {0x11ad, 0xffff, pci_subsys_11ad_0002_11ad_ffff, 0};
+#undef pci_ss_info_11ad_ffff
+#define pci_ss_info_11ad_ffff pci_ss_info_11ad_0002_11ad_ffff
+static const pciSubsystemInfo pci_ss_info_11ad_0002_1385_f004 =
+ {0x1385, 0xf004, pci_subsys_11ad_0002_1385_f004, 0};
+#undef pci_ss_info_1385_f004
+#define pci_ss_info_1385_f004 pci_ss_info_11ad_0002_1385_f004
+static const pciSubsystemInfo pci_ss_info_11ad_c115_11ad_c001 =
+ {0x11ad, 0xc001, pci_subsys_11ad_c115_11ad_c001, 0};
+#undef pci_ss_info_11ad_c001
+#define pci_ss_info_11ad_c001 pci_ss_info_11ad_c115_11ad_c001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0440_1033_8015 =
+ {0x1033, 0x8015, pci_subsys_11c1_0440_1033_8015, 0};
+#undef pci_ss_info_1033_8015
+#define pci_ss_info_1033_8015 pci_ss_info_11c1_0440_1033_8015
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0440_1033_8047 =
+ {0x1033, 0x8047, pci_subsys_11c1_0440_1033_8047, 0};
+#undef pci_ss_info_1033_8047
+#define pci_ss_info_1033_8047 pci_ss_info_11c1_0440_1033_8047
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0440_1033_804f =
+ {0x1033, 0x804f, pci_subsys_11c1_0440_1033_804f, 0};
+#undef pci_ss_info_1033_804f
+#define pci_ss_info_1033_804f pci_ss_info_11c1_0440_1033_804f
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_11c1_0440_10cf_102c =
+ {0x10cf, 0x102c, pci_subsys_11c1_0440_10cf_102c, 0};
+#undef pci_ss_info_10cf_102c
+#define pci_ss_info_10cf_102c pci_ss_info_11c1_0440_10cf_102c
+static const pciSubsystemInfo pci_ss_info_11c1_0440_10cf_104a =
+ {0x10cf, 0x104a, pci_subsys_11c1_0440_10cf_104a, 0};
+#undef pci_ss_info_10cf_104a
+#define pci_ss_info_10cf_104a pci_ss_info_11c1_0440_10cf_104a
+static const pciSubsystemInfo pci_ss_info_11c1_0440_10cf_105f =
+ {0x10cf, 0x105f, pci_subsys_11c1_0440_10cf_105f, 0};
+#undef pci_ss_info_10cf_105f
+#define pci_ss_info_10cf_105f pci_ss_info_11c1_0440_10cf_105f
+static const pciSubsystemInfo pci_ss_info_11c1_0440_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_11c1_0440_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_11c1_0440_1179_0001
+static const pciSubsystemInfo pci_ss_info_11c1_0440_11c1_0440 =
+ {0x11c1, 0x0440, pci_subsys_11c1_0440_11c1_0440, 0};
+#undef pci_ss_info_11c1_0440
+#define pci_ss_info_11c1_0440 pci_ss_info_11c1_0440_11c1_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0440_122d_4101 =
+ {0x122d, 0x4101, pci_subsys_11c1_0440_122d_4101, 0};
+#undef pci_ss_info_122d_4101
+#define pci_ss_info_122d_4101 pci_ss_info_11c1_0440_122d_4101
+static const pciSubsystemInfo pci_ss_info_11c1_0440_122d_4102 =
+ {0x122d, 0x4102, pci_subsys_11c1_0440_122d_4102, 0};
+#undef pci_ss_info_122d_4102
+#define pci_ss_info_122d_4102 pci_ss_info_11c1_0440_122d_4102
+static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_0040 =
+ {0x13e0, 0x0040, pci_subsys_11c1_0440_13e0_0040, 0};
+#undef pci_ss_info_13e0_0040
+#define pci_ss_info_13e0_0040 pci_ss_info_11c1_0440_13e0_0040
+static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_0440 =
+ {0x13e0, 0x0440, pci_subsys_11c1_0440_13e0_0440, 0};
+#undef pci_ss_info_13e0_0440
+#define pci_ss_info_13e0_0440 pci_ss_info_11c1_0440_13e0_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_0441 =
+ {0x13e0, 0x0441, pci_subsys_11c1_0440_13e0_0441, 0};
+#undef pci_ss_info_13e0_0441
+#define pci_ss_info_13e0_0441 pci_ss_info_11c1_0440_13e0_0441
+static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_0450 =
+ {0x13e0, 0x0450, pci_subsys_11c1_0440_13e0_0450, 0};
+#undef pci_ss_info_13e0_0450
+#define pci_ss_info_13e0_0450 pci_ss_info_11c1_0440_13e0_0450
+static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_f100 =
+ {0x13e0, 0xf100, pci_subsys_11c1_0440_13e0_f100, 0};
+#undef pci_ss_info_13e0_f100
+#define pci_ss_info_13e0_f100 pci_ss_info_11c1_0440_13e0_f100
+static const pciSubsystemInfo pci_ss_info_11c1_0440_13e0_f101 =
+ {0x13e0, 0xf101, pci_subsys_11c1_0440_13e0_f101, 0};
+#undef pci_ss_info_13e0_f101
+#define pci_ss_info_13e0_f101 pci_ss_info_11c1_0440_13e0_f101
+static const pciSubsystemInfo pci_ss_info_11c1_0440_144d_2101 =
+ {0x144d, 0x2101, pci_subsys_11c1_0440_144d_2101, 0};
+#undef pci_ss_info_144d_2101
+#define pci_ss_info_144d_2101 pci_ss_info_11c1_0440_144d_2101
+static const pciSubsystemInfo pci_ss_info_11c1_0440_149f_0440 =
+ {0x149f, 0x0440, pci_subsys_11c1_0440_149f_0440, 0};
+#undef pci_ss_info_149f_0440
+#define pci_ss_info_149f_0440 pci_ss_info_11c1_0440_149f_0440
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0441_1033_804d =
+ {0x1033, 0x804d, pci_subsys_11c1_0441_1033_804d, 0};
+#undef pci_ss_info_1033_804d
+#define pci_ss_info_1033_804d pci_ss_info_11c1_0441_1033_804d
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0441_1033_8065 =
+ {0x1033, 0x8065, pci_subsys_11c1_0441_1033_8065, 0};
+#undef pci_ss_info_1033_8065
+#define pci_ss_info_1033_8065 pci_ss_info_11c1_0441_1033_8065
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0441_1092_0440 =
+ {0x1092, 0x0440, pci_subsys_11c1_0441_1092_0440, 0};
+#undef pci_ss_info_1092_0440
+#define pci_ss_info_1092_0440 pci_ss_info_11c1_0441_1092_0440
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_11c1_0441_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_11c1_0441_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_11c1_0441_1179_0001
+static const pciSubsystemInfo pci_ss_info_11c1_0441_11c1_0440 =
+ {0x11c1, 0x0440, pci_subsys_11c1_0441_11c1_0440, 0};
+#undef pci_ss_info_11c1_0440
+#define pci_ss_info_11c1_0440 pci_ss_info_11c1_0441_11c1_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0441_11c1_0441 =
+ {0x11c1, 0x0441, pci_subsys_11c1_0441_11c1_0441, 0};
+#undef pci_ss_info_11c1_0441
+#define pci_ss_info_11c1_0441 pci_ss_info_11c1_0441_11c1_0441
+static const pciSubsystemInfo pci_ss_info_11c1_0441_122d_4100 =
+ {0x122d, 0x4100, pci_subsys_11c1_0441_122d_4100, 0};
+#undef pci_ss_info_122d_4100
+#define pci_ss_info_122d_4100 pci_ss_info_11c1_0441_122d_4100
+static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0040 =
+ {0x13e0, 0x0040, pci_subsys_11c1_0441_13e0_0040, 0};
+#undef pci_ss_info_13e0_0040
+#define pci_ss_info_13e0_0040 pci_ss_info_11c1_0441_13e0_0040
+static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0100 =
+ {0x13e0, 0x0100, pci_subsys_11c1_0441_13e0_0100, 0};
+#undef pci_ss_info_13e0_0100
+#define pci_ss_info_13e0_0100 pci_ss_info_11c1_0441_13e0_0100
+static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0410 =
+ {0x13e0, 0x0410, pci_subsys_11c1_0441_13e0_0410, 0};
+#undef pci_ss_info_13e0_0410
+#define pci_ss_info_13e0_0410 pci_ss_info_11c1_0441_13e0_0410
+static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0420 =
+ {0x13e0, 0x0420, pci_subsys_11c1_0441_13e0_0420, 0};
+#undef pci_ss_info_13e0_0420
+#define pci_ss_info_13e0_0420 pci_ss_info_11c1_0441_13e0_0420
+static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0440 =
+ {0x13e0, 0x0440, pci_subsys_11c1_0441_13e0_0440, 0};
+#undef pci_ss_info_13e0_0440
+#define pci_ss_info_13e0_0440 pci_ss_info_11c1_0441_13e0_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_0443 =
+ {0x13e0, 0x0443, pci_subsys_11c1_0441_13e0_0443, 0};
+#undef pci_ss_info_13e0_0443
+#define pci_ss_info_13e0_0443 pci_ss_info_11c1_0441_13e0_0443
+static const pciSubsystemInfo pci_ss_info_11c1_0441_13e0_f102 =
+ {0x13e0, 0xf102, pci_subsys_11c1_0441_13e0_f102, 0};
+#undef pci_ss_info_13e0_f102
+#define pci_ss_info_13e0_f102 pci_ss_info_11c1_0441_13e0_f102
+static const pciSubsystemInfo pci_ss_info_11c1_0441_1416_9804 =
+ {0x1416, 0x9804, pci_subsys_11c1_0441_1416_9804, 0};
+#undef pci_ss_info_1416_9804
+#define pci_ss_info_1416_9804 pci_ss_info_11c1_0441_1416_9804
+static const pciSubsystemInfo pci_ss_info_11c1_0441_141d_0440 =
+ {0x141d, 0x0440, pci_subsys_11c1_0441_141d_0440, 0};
+#undef pci_ss_info_141d_0440
+#define pci_ss_info_141d_0440 pci_ss_info_11c1_0441_141d_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0441_144f_0441 =
+ {0x144f, 0x0441, pci_subsys_11c1_0441_144f_0441, 0};
+#undef pci_ss_info_144f_0441
+#define pci_ss_info_144f_0441 pci_ss_info_11c1_0441_144f_0441
+static const pciSubsystemInfo pci_ss_info_11c1_0441_144f_0449 =
+ {0x144f, 0x0449, pci_subsys_11c1_0441_144f_0449, 0};
+#undef pci_ss_info_144f_0449
+#define pci_ss_info_144f_0449 pci_ss_info_11c1_0441_144f_0449
+static const pciSubsystemInfo pci_ss_info_11c1_0441_144f_110d =
+ {0x144f, 0x110d, pci_subsys_11c1_0441_144f_110d, 0};
+#undef pci_ss_info_144f_110d
+#define pci_ss_info_144f_110d pci_ss_info_11c1_0441_144f_110d
+static const pciSubsystemInfo pci_ss_info_11c1_0441_1468_0441 =
+ {0x1468, 0x0441, pci_subsys_11c1_0441_1468_0441, 0};
+#undef pci_ss_info_1468_0441
+#define pci_ss_info_1468_0441 pci_ss_info_11c1_0441_1468_0441
+static const pciSubsystemInfo pci_ss_info_11c1_0441_1668_0440 =
+ {0x1668, 0x0440, pci_subsys_11c1_0441_1668_0440, 0};
+#undef pci_ss_info_1668_0440
+#define pci_ss_info_1668_0440 pci_ss_info_11c1_0441_1668_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0442_11c1_0440 =
+ {0x11c1, 0x0440, pci_subsys_11c1_0442_11c1_0440, 0};
+#undef pci_ss_info_11c1_0440
+#define pci_ss_info_11c1_0440 pci_ss_info_11c1_0442_11c1_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0442_11c1_0442 =
+ {0x11c1, 0x0442, pci_subsys_11c1_0442_11c1_0442, 0};
+#undef pci_ss_info_11c1_0442
+#define pci_ss_info_11c1_0442 pci_ss_info_11c1_0442_11c1_0442
+static const pciSubsystemInfo pci_ss_info_11c1_0442_13e0_0412 =
+ {0x13e0, 0x0412, pci_subsys_11c1_0442_13e0_0412, 0};
+#undef pci_ss_info_13e0_0412
+#define pci_ss_info_13e0_0412 pci_ss_info_11c1_0442_13e0_0412
+static const pciSubsystemInfo pci_ss_info_11c1_0442_13e0_0442 =
+ {0x13e0, 0x0442, pci_subsys_11c1_0442_13e0_0442, 0};
+#undef pci_ss_info_13e0_0442
+#define pci_ss_info_13e0_0442 pci_ss_info_11c1_0442_13e0_0442
+static const pciSubsystemInfo pci_ss_info_11c1_0442_13fc_2471 =
+ {0x13fc, 0x2471, pci_subsys_11c1_0442_13fc_2471, 0};
+#undef pci_ss_info_13fc_2471
+#define pci_ss_info_13fc_2471 pci_ss_info_11c1_0442_13fc_2471
+static const pciSubsystemInfo pci_ss_info_11c1_0442_144d_2104 =
+ {0x144d, 0x2104, pci_subsys_11c1_0442_144d_2104, 0};
+#undef pci_ss_info_144d_2104
+#define pci_ss_info_144d_2104 pci_ss_info_11c1_0442_144d_2104
+static const pciSubsystemInfo pci_ss_info_11c1_0442_144f_1104 =
+ {0x144f, 0x1104, pci_subsys_11c1_0442_144f_1104, 0};
+#undef pci_ss_info_144f_1104
+#define pci_ss_info_144f_1104 pci_ss_info_11c1_0442_144f_1104
+static const pciSubsystemInfo pci_ss_info_11c1_0442_149f_0440 =
+ {0x149f, 0x0440, pci_subsys_11c1_0442_149f_0440, 0};
+#undef pci_ss_info_149f_0440
+#define pci_ss_info_149f_0440 pci_ss_info_11c1_0442_149f_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0442_1668_0440 =
+ {0x1668, 0x0440, pci_subsys_11c1_0442_1668_0440, 0};
+#undef pci_ss_info_1668_0440
+#define pci_ss_info_1668_0440 pci_ss_info_11c1_0442_1668_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0448_1014_0131 =
+ {0x1014, 0x0131, pci_subsys_11c1_0448_1014_0131, 0};
+#undef pci_ss_info_1014_0131
+#define pci_ss_info_1014_0131 pci_ss_info_11c1_0448_1014_0131
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0448_1033_8066 =
+ {0x1033, 0x8066, pci_subsys_11c1_0448_1033_8066, 0};
+#undef pci_ss_info_1033_8066
+#define pci_ss_info_1033_8066 pci_ss_info_11c1_0448_1033_8066
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_11c1_0448_13e0_0030 =
+ {0x13e0, 0x0030, pci_subsys_11c1_0448_13e0_0030, 0};
+#undef pci_ss_info_13e0_0030
+#define pci_ss_info_13e0_0030 pci_ss_info_11c1_0448_13e0_0030
+static const pciSubsystemInfo pci_ss_info_11c1_0448_13e0_0040 =
+ {0x13e0, 0x0040, pci_subsys_11c1_0448_13e0_0040, 0};
+#undef pci_ss_info_13e0_0040
+#define pci_ss_info_13e0_0040 pci_ss_info_11c1_0448_13e0_0040
+static const pciSubsystemInfo pci_ss_info_11c1_0448_1668_2400 =
+ {0x1668, 0x2400, pci_subsys_11c1_0448_1668_2400, 0};
+#undef pci_ss_info_1668_2400
+#define pci_ss_info_1668_2400 pci_ss_info_11c1_0448_1668_2400
+#endif
+static const pciSubsystemInfo pci_ss_info_11c1_0449_0e11_b14d =
+ {0x0e11, 0xb14d, pci_subsys_11c1_0449_0e11_b14d, 0};
+#undef pci_ss_info_0e11_b14d
+#define pci_ss_info_0e11_b14d pci_ss_info_11c1_0449_0e11_b14d
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_11c1_0449_13e0_0020 =
+ {0x13e0, 0x0020, pci_subsys_11c1_0449_13e0_0020, 0};
+#undef pci_ss_info_13e0_0020
+#define pci_ss_info_13e0_0020 pci_ss_info_11c1_0449_13e0_0020
+static const pciSubsystemInfo pci_ss_info_11c1_0449_13e0_0041 =
+ {0x13e0, 0x0041, pci_subsys_11c1_0449_13e0_0041, 0};
+#undef pci_ss_info_13e0_0041
+#define pci_ss_info_13e0_0041 pci_ss_info_11c1_0449_13e0_0041
+static const pciSubsystemInfo pci_ss_info_11c1_0449_1436_0440 =
+ {0x1436, 0x0440, pci_subsys_11c1_0449_1436_0440, 0};
+#undef pci_ss_info_1436_0440
+#define pci_ss_info_1436_0440 pci_ss_info_11c1_0449_1436_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0449_144f_0449 =
+ {0x144f, 0x0449, pci_subsys_11c1_0449_144f_0449, 0};
+#undef pci_ss_info_144f_0449
+#define pci_ss_info_144f_0449 pci_ss_info_11c1_0449_144f_0449
+static const pciSubsystemInfo pci_ss_info_11c1_0449_1468_0410 =
+ {0x1468, 0x0410, pci_subsys_11c1_0449_1468_0410, 0};
+#undef pci_ss_info_1468_0410
+#define pci_ss_info_1468_0410 pci_ss_info_11c1_0449_1468_0410
+static const pciSubsystemInfo pci_ss_info_11c1_0449_1468_0440 =
+ {0x1468, 0x0440, pci_subsys_11c1_0449_1468_0440, 0};
+#undef pci_ss_info_1468_0440
+#define pci_ss_info_1468_0440 pci_ss_info_11c1_0449_1468_0440
+static const pciSubsystemInfo pci_ss_info_11c1_0449_1468_0449 =
+ {0x1468, 0x0449, pci_subsys_11c1_0449_1468_0449, 0};
+#undef pci_ss_info_1468_0449
+#define pci_ss_info_1468_0449 pci_ss_info_11c1_0449_1468_0449
+static const pciSubsystemInfo pci_ss_info_11c1_044a_10cf_1072 =
+ {0x10cf, 0x1072, pci_subsys_11c1_044a_10cf_1072, 0};
+#undef pci_ss_info_10cf_1072
+#define pci_ss_info_10cf_1072 pci_ss_info_11c1_044a_10cf_1072
+static const pciSubsystemInfo pci_ss_info_11c1_044a_13e0_0012 =
+ {0x13e0, 0x0012, pci_subsys_11c1_044a_13e0_0012, 0};
+#undef pci_ss_info_13e0_0012
+#define pci_ss_info_13e0_0012 pci_ss_info_11c1_044a_13e0_0012
+static const pciSubsystemInfo pci_ss_info_11c1_044a_13e0_0042 =
+ {0x13e0, 0x0042, pci_subsys_11c1_044a_13e0_0042, 0};
+#undef pci_ss_info_13e0_0042
+#define pci_ss_info_13e0_0042 pci_ss_info_11c1_044a_13e0_0042
+static const pciSubsystemInfo pci_ss_info_11c1_044a_144f_1005 =
+ {0x144f, 0x1005, pci_subsys_11c1_044a_144f_1005, 0};
+#undef pci_ss_info_144f_1005
+#define pci_ss_info_144f_1005 pci_ss_info_11c1_044a_144f_1005
+static const pciSubsystemInfo pci_ss_info_11c1_0450_144f_4005 =
+ {0x144f, 0x4005, pci_subsys_11c1_0450_144f_4005, 0};
+#undef pci_ss_info_144f_4005
+#define pci_ss_info_144f_4005 pci_ss_info_11c1_0450_144f_4005
+static const pciSubsystemInfo pci_ss_info_11c1_5811_dead_0800 =
+ {0xdead, 0x0800, pci_subsys_11c1_5811_dead_0800, 0};
+#undef pci_ss_info_dead_0800
+#define pci_ss_info_dead_0800 pci_ss_info_11c1_5811_dead_0800
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_11cb_2000_11cb_0200 =
+ {0x11cb, 0x0200, pci_subsys_11cb_2000_11cb_0200, 0};
+#undef pci_ss_info_11cb_0200
+#define pci_ss_info_11cb_0200 pci_ss_info_11cb_2000_11cb_0200
+static const pciSubsystemInfo pci_ss_info_11cb_2000_11cb_b008 =
+ {0x11cb, 0xb008, pci_subsys_11cb_2000_11cb_b008, 0};
+#undef pci_ss_info_11cb_b008
+#define pci_ss_info_11cb_b008 pci_ss_info_11cb_2000_11cb_b008
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_11de_6057_1031_7efe =
+ {0x1031, 0x7efe, pci_subsys_11de_6057_1031_7efe, 0};
+#undef pci_ss_info_1031_7efe
+#define pci_ss_info_1031_7efe pci_ss_info_11de_6057_1031_7efe
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_11de_6057_1031_fc00 =
+ {0x1031, 0xfc00, pci_subsys_11de_6057_1031_fc00, 0};
+#undef pci_ss_info_1031_fc00
+#define pci_ss_info_1031_fc00 pci_ss_info_11de_6057_1031_fc00
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_11de_6057_13ca_4231 =
+ {0x13ca, 0x4231, pci_subsys_11de_6057_13ca_4231, 0};
+#undef pci_ss_info_13ca_4231
+#define pci_ss_info_13ca_4231 pci_ss_info_11de_6057_13ca_4231
+static const pciSubsystemInfo pci_ss_info_11de_6120_1328_f001 =
+ {0x1328, 0xf001, pci_subsys_11de_6120_1328_f001, 0};
+#undef pci_ss_info_1328_f001
+#define pci_ss_info_1328_f001 pci_ss_info_11de_6120_1328_f001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_11f6_2011_11f6_2011 =
+ {0x11f6, 0x2011, pci_subsys_11f6_2011_11f6_2011, 0};
+#undef pci_ss_info_11f6_2011
+#define pci_ss_info_11f6_2011 pci_ss_info_11f6_2011_11f6_2011
+static const pciSubsystemInfo pci_ss_info_11f6_2201_11f6_2011 =
+ {0x11f6, 0x2011, pci_subsys_11f6_2201_11f6_2011, 0};
+#undef pci_ss_info_11f6_2011
+#define pci_ss_info_11f6_2011 pci_ss_info_11f6_2201_11f6_2011
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1202_4300_1202_9841 =
+ {0x1202, 0x9841, pci_subsys_1202_4300_1202_9841, 0};
+#undef pci_ss_info_1202_9841
+#define pci_ss_info_1202_9841 pci_ss_info_1202_4300_1202_9841
+static const pciSubsystemInfo pci_ss_info_1202_4300_1202_9842 =
+ {0x1202, 0x9842, pci_subsys_1202_4300_1202_9842, 0};
+#undef pci_ss_info_1202_9842
+#define pci_ss_info_1202_9842 pci_ss_info_1202_4300_1202_9842
+static const pciSubsystemInfo pci_ss_info_1202_4300_1202_9843 =
+ {0x1202, 0x9843, pci_subsys_1202_4300_1202_9843, 0};
+#undef pci_ss_info_1202_9843
+#define pci_ss_info_1202_9843 pci_ss_info_1202_4300_1202_9843
+static const pciSubsystemInfo pci_ss_info_1202_4300_1202_9844 =
+ {0x1202, 0x9844, pci_subsys_1202_4300_1202_9844, 0};
+#undef pci_ss_info_1202_9844
+#define pci_ss_info_1202_9844 pci_ss_info_1202_4300_1202_9844
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1217_6933_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_1217_6933_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_1217_6933_1025_1016
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1217_6972_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_1217_6972_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_1217_6972_1179_0001
+#endif
+static const pciSubsystemInfo pci_ss_info_121a_0003_1092_0003 =
+ {0x1092, 0x0003, pci_subsys_121a_0003_1092_0003, 0};
+#undef pci_ss_info_1092_0003
+#define pci_ss_info_1092_0003 pci_ss_info_121a_0003_1092_0003
+static const pciSubsystemInfo pci_ss_info_121a_0003_1092_4000 =
+ {0x1092, 0x4000, pci_subsys_121a_0003_1092_4000, 0};
+#undef pci_ss_info_1092_4000
+#define pci_ss_info_1092_4000 pci_ss_info_121a_0003_1092_4000
+static const pciSubsystemInfo pci_ss_info_121a_0003_1092_4002 =
+ {0x1092, 0x4002, pci_subsys_121a_0003_1092_4002, 0};
+#undef pci_ss_info_1092_4002
+#define pci_ss_info_1092_4002 pci_ss_info_121a_0003_1092_4002
+static const pciSubsystemInfo pci_ss_info_121a_0003_1092_4801 =
+ {0x1092, 0x4801, pci_subsys_121a_0003_1092_4801, 0};
+#undef pci_ss_info_1092_4801
+#define pci_ss_info_1092_4801 pci_ss_info_121a_0003_1092_4801
+static const pciSubsystemInfo pci_ss_info_121a_0003_1092_4803 =
+ {0x1092, 0x4803, pci_subsys_121a_0003_1092_4803, 0};
+#undef pci_ss_info_1092_4803
+#define pci_ss_info_1092_4803 pci_ss_info_121a_0003_1092_4803
+static const pciSubsystemInfo pci_ss_info_121a_0003_1092_8030 =
+ {0x1092, 0x8030, pci_subsys_121a_0003_1092_8030, 0};
+#undef pci_ss_info_1092_8030
+#define pci_ss_info_1092_8030 pci_ss_info_121a_0003_1092_8030
+static const pciSubsystemInfo pci_ss_info_121a_0003_1092_8035 =
+ {0x1092, 0x8035, pci_subsys_121a_0003_1092_8035, 0};
+#undef pci_ss_info_1092_8035
+#define pci_ss_info_1092_8035 pci_ss_info_121a_0003_1092_8035
+static const pciSubsystemInfo pci_ss_info_121a_0003_10b0_0001 =
+ {0x10b0, 0x0001, pci_subsys_121a_0003_10b0_0001, 0};
+#undef pci_ss_info_10b0_0001
+#define pci_ss_info_10b0_0001 pci_ss_info_121a_0003_10b0_0001
+static const pciSubsystemInfo pci_ss_info_121a_0003_1102_1018 =
+ {0x1102, 0x1018, pci_subsys_121a_0003_1102_1018, 0};
+#undef pci_ss_info_1102_1018
+#define pci_ss_info_1102_1018 pci_ss_info_121a_0003_1102_1018
+static const pciSubsystemInfo pci_ss_info_121a_0003_121a_0001 =
+ {0x121a, 0x0001, pci_subsys_121a_0003_121a_0001, 0};
+#undef pci_ss_info_121a_0001
+#define pci_ss_info_121a_0001 pci_ss_info_121a_0003_121a_0001
+static const pciSubsystemInfo pci_ss_info_121a_0003_121a_0003 =
+ {0x121a, 0x0003, pci_subsys_121a_0003_121a_0003, 0};
+#undef pci_ss_info_121a_0003
+#define pci_ss_info_121a_0003 pci_ss_info_121a_0003_121a_0003
+static const pciSubsystemInfo pci_ss_info_121a_0003_121a_0004 =
+ {0x121a, 0x0004, pci_subsys_121a_0003_121a_0004, 0};
+#undef pci_ss_info_121a_0004
+#define pci_ss_info_121a_0004 pci_ss_info_121a_0003_121a_0004
+static const pciSubsystemInfo pci_ss_info_121a_0003_139c_0016 =
+ {0x139c, 0x0016, pci_subsys_121a_0003_139c_0016, 0};
+#undef pci_ss_info_139c_0016
+#define pci_ss_info_139c_0016 pci_ss_info_121a_0003_139c_0016
+static const pciSubsystemInfo pci_ss_info_121a_0003_139c_0017 =
+ {0x139c, 0x0017, pci_subsys_121a_0003_139c_0017, 0};
+#undef pci_ss_info_139c_0017
+#define pci_ss_info_139c_0017 pci_ss_info_121a_0003_139c_0017
+static const pciSubsystemInfo pci_ss_info_121a_0003_14af_0002 =
+ {0x14af, 0x0002, pci_subsys_121a_0003_14af_0002, 0};
+#undef pci_ss_info_14af_0002
+#define pci_ss_info_14af_0002 pci_ss_info_121a_0003_14af_0002
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0004 =
+ {0x121a, 0x0004, pci_subsys_121a_0005_121a_0004, 0};
+#undef pci_ss_info_121a_0004
+#define pci_ss_info_121a_0004 pci_ss_info_121a_0005_121a_0004
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0030 =
+ {0x121a, 0x0030, pci_subsys_121a_0005_121a_0030, 0};
+#undef pci_ss_info_121a_0030
+#define pci_ss_info_121a_0030 pci_ss_info_121a_0005_121a_0030
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0031 =
+ {0x121a, 0x0031, pci_subsys_121a_0005_121a_0031, 0};
+#undef pci_ss_info_121a_0031
+#define pci_ss_info_121a_0031 pci_ss_info_121a_0005_121a_0031
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0034 =
+ {0x121a, 0x0034, pci_subsys_121a_0005_121a_0034, 0};
+#undef pci_ss_info_121a_0034
+#define pci_ss_info_121a_0034 pci_ss_info_121a_0005_121a_0034
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0036 =
+ {0x121a, 0x0036, pci_subsys_121a_0005_121a_0036, 0};
+#undef pci_ss_info_121a_0036
+#define pci_ss_info_121a_0036 pci_ss_info_121a_0005_121a_0036
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0037 =
+ {0x121a, 0x0037, pci_subsys_121a_0005_121a_0037, 0};
+#undef pci_ss_info_121a_0037
+#define pci_ss_info_121a_0037 pci_ss_info_121a_0005_121a_0037
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0038 =
+ {0x121a, 0x0038, pci_subsys_121a_0005_121a_0038, 0};
+#undef pci_ss_info_121a_0038
+#define pci_ss_info_121a_0038 pci_ss_info_121a_0005_121a_0038
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_003a =
+ {0x121a, 0x003a, pci_subsys_121a_0005_121a_003a, 0};
+#undef pci_ss_info_121a_003a
+#define pci_ss_info_121a_003a pci_ss_info_121a_0005_121a_003a
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0044 =
+ {0x121a, 0x0044, pci_subsys_121a_0005_121a_0044, 0};
+#undef pci_ss_info_121a_0044
+#define pci_ss_info_121a_0044 pci_ss_info_121a_0005_121a_0044
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_004b =
+ {0x121a, 0x004b, pci_subsys_121a_0005_121a_004b, 0};
+#undef pci_ss_info_121a_004b
+#define pci_ss_info_121a_004b pci_ss_info_121a_0005_121a_004b
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_004c =
+ {0x121a, 0x004c, pci_subsys_121a_0005_121a_004c, 0};
+#undef pci_ss_info_121a_004c
+#define pci_ss_info_121a_004c pci_ss_info_121a_0005_121a_004c
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_004d =
+ {0x121a, 0x004d, pci_subsys_121a_0005_121a_004d, 0};
+#undef pci_ss_info_121a_004d
+#define pci_ss_info_121a_004d pci_ss_info_121a_0005_121a_004d
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_004e =
+ {0x121a, 0x004e, pci_subsys_121a_0005_121a_004e, 0};
+#undef pci_ss_info_121a_004e
+#define pci_ss_info_121a_004e pci_ss_info_121a_0005_121a_004e
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0051 =
+ {0x121a, 0x0051, pci_subsys_121a_0005_121a_0051, 0};
+#undef pci_ss_info_121a_0051
+#define pci_ss_info_121a_0051 pci_ss_info_121a_0005_121a_0051
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0052 =
+ {0x121a, 0x0052, pci_subsys_121a_0005_121a_0052, 0};
+#undef pci_ss_info_121a_0052
+#define pci_ss_info_121a_0052 pci_ss_info_121a_0005_121a_0052
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0060 =
+ {0x121a, 0x0060, pci_subsys_121a_0005_121a_0060, 0};
+#undef pci_ss_info_121a_0060
+#define pci_ss_info_121a_0060 pci_ss_info_121a_0005_121a_0060
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0061 =
+ {0x121a, 0x0061, pci_subsys_121a_0005_121a_0061, 0};
+#undef pci_ss_info_121a_0061
+#define pci_ss_info_121a_0061 pci_ss_info_121a_0005_121a_0061
+static const pciSubsystemInfo pci_ss_info_121a_0005_121a_0062 =
+ {0x121a, 0x0062, pci_subsys_121a_0005_121a_0062, 0};
+#undef pci_ss_info_121a_0062
+#define pci_ss_info_121a_0062 pci_ss_info_121a_0005_121a_0062
+static const pciSubsystemInfo pci_ss_info_121a_0009_121a_0009 =
+ {0x121a, 0x0009, pci_subsys_121a_0009_121a_0009, 0};
+#undef pci_ss_info_121a_0009
+#define pci_ss_info_121a_0009 pci_ss_info_121a_0009_121a_0009
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_122d_50dc_122d_0001 =
+ {0x122d, 0x0001, pci_subsys_122d_50dc_122d_0001, 0};
+#undef pci_ss_info_122d_0001
+#define pci_ss_info_122d_0001 pci_ss_info_122d_50dc_122d_0001
+static const pciSubsystemInfo pci_ss_info_122d_80da_122d_0001 =
+ {0x122d, 0x0001, pci_subsys_122d_80da_122d_0001, 0};
+#undef pci_ss_info_122d_0001
+#define pci_ss_info_122d_0001 pci_ss_info_122d_80da_122d_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_123f_8120_11bd_0006 =
+ {0x11bd, 0x0006, pci_subsys_123f_8120_11bd_0006, 0};
+#undef pci_ss_info_11bd_0006
+#define pci_ss_info_11bd_0006 pci_ss_info_123f_8120_11bd_0006
+static const pciSubsystemInfo pci_ss_info_123f_8120_11bd_000a =
+ {0x11bd, 0x000a, pci_subsys_123f_8120_11bd_000a, 0};
+#undef pci_ss_info_11bd_000a
+#define pci_ss_info_11bd_000a pci_ss_info_123f_8120_11bd_000a
+#endif
+static const pciSubsystemInfo pci_ss_info_123f_8888_1002_0001 =
+ {0x1002, 0x0001, pci_subsys_123f_8888_1002_0001, 0};
+#undef pci_ss_info_1002_0001
+#define pci_ss_info_1002_0001 pci_ss_info_123f_8888_1002_0001
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_123f_8888_1002_0002 =
+ {0x1002, 0x0002, pci_subsys_123f_8888_1002_0002, 0};
+#undef pci_ss_info_1002_0002
+#define pci_ss_info_1002_0002 pci_ss_info_123f_8888_1002_0002
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_123f_8888_1328_0001 =
+ {0x1328, 0x0001, pci_subsys_123f_8888_1328_0001, 0};
+#undef pci_ss_info_1328_0001
+#define pci_ss_info_1328_0001 pci_ss_info_123f_8888_1328_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1242_1560_1242_6562 =
+ {0x1242, 0x6562, pci_subsys_1242_1560_1242_6562, 0};
+#undef pci_ss_info_1242_6562
+#define pci_ss_info_1242_6562 pci_ss_info_1242_1560_1242_6562
+static const pciSubsystemInfo pci_ss_info_1242_1560_1242_656a =
+ {0x1242, 0x656a, pci_subsys_1242_1560_1242_656a, 0};
+#undef pci_ss_info_1242_656a
+#define pci_ss_info_1242_656a pci_ss_info_1242_1560_1242_656a
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1244_0a00_1244_0a00 =
+ {0x1244, 0x0a00, pci_subsys_1244_0a00_1244_0a00, 0};
+#undef pci_ss_info_1244_0a00
+#define pci_ss_info_1244_0a00 pci_ss_info_1244_0a00_1244_0a00
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_124b_0040_124b_9080 =
+ {0x124b, 0x9080, pci_subsys_124b_0040_124b_9080, 0};
+#undef pci_ss_info_124b_9080
+#define pci_ss_info_124b_9080 pci_ss_info_124b_0040_124b_9080
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_125d_1968_1028_0085 =
+ {0x1028, 0x0085, pci_subsys_125d_1968_1028_0085, 0};
+#undef pci_ss_info_1028_0085
+#define pci_ss_info_1028_0085 pci_ss_info_125d_1968_1028_0085
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_125d_1968_1033_8051 =
+ {0x1033, 0x8051, pci_subsys_125d_1968_1033_8051, 0};
+#undef pci_ss_info_1033_8051
+#define pci_ss_info_1033_8051 pci_ss_info_125d_1968_1033_8051
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_125d_1969_1014_0166 =
+ {0x1014, 0x0166, pci_subsys_125d_1969_1014_0166, 0};
+#undef pci_ss_info_1014_0166
+#define pci_ss_info_1014_0166 pci_ss_info_125d_1969_1014_0166
+static const pciSubsystemInfo pci_ss_info_125d_1969_125d_8888 =
+ {0x125d, 0x8888, pci_subsys_125d_1969_125d_8888, 0};
+#undef pci_ss_info_125d_8888
+#define pci_ss_info_125d_8888 pci_ss_info_125d_1969_125d_8888
+#endif
+static const pciSubsystemInfo pci_ss_info_125d_1978_0e11_b112 =
+ {0x0e11, 0xb112, pci_subsys_125d_1978_0e11_b112, 0};
+#undef pci_ss_info_0e11_b112
+#define pci_ss_info_0e11_b112 pci_ss_info_125d_1978_0e11_b112
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_125d_1978_1033_803c =
+ {0x1033, 0x803c, pci_subsys_125d_1978_1033_803c, 0};
+#undef pci_ss_info_1033_803c
+#define pci_ss_info_1033_803c pci_ss_info_125d_1978_1033_803c
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_125d_1978_1033_8058 =
+ {0x1033, 0x8058, pci_subsys_125d_1978_1033_8058, 0};
+#undef pci_ss_info_1033_8058
+#define pci_ss_info_1033_8058 pci_ss_info_125d_1978_1033_8058
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_125d_1978_1092_4000 =
+ {0x1092, 0x4000, pci_subsys_125d_1978_1092_4000, 0};
+#undef pci_ss_info_1092_4000
+#define pci_ss_info_1092_4000 pci_ss_info_125d_1978_1092_4000
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_125d_1978_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_125d_1978_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_125d_1978_1179_0001
+#endif
+static const pciSubsystemInfo pci_ss_info_125d_1988_1092_4100 =
+ {0x1092, 0x4100, pci_subsys_125d_1988_1092_4100, 0};
+#undef pci_ss_info_1092_4100
+#define pci_ss_info_1092_4100 pci_ss_info_125d_1988_1092_4100
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_125d_1988_125d_1988 =
+ {0x125d, 0x1988, pci_subsys_125d_1988_125d_1988, 0};
+#undef pci_ss_info_125d_1988
+#define pci_ss_info_125d_1988 pci_ss_info_125d_1988_125d_1988
+static const pciSubsystemInfo pci_ss_info_125d_1989_125d_1989 =
+ {0x125d, 0x1989, pci_subsys_125d_1989_125d_1989, 0};
+#undef pci_ss_info_125d_1989
+#define pci_ss_info_125d_1989 pci_ss_info_125d_1989_125d_1989
+#endif
+static const pciSubsystemInfo pci_ss_info_125d_1998_1028_00e6 =
+ {0x1028, 0x00e6, pci_subsys_125d_1998_1028_00e6, 0};
+#undef pci_ss_info_1028_00e6
+#define pci_ss_info_1028_00e6 pci_ss_info_125d_1998_1028_00e6
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0424 =
+ {0x125d, 0x0424, pci_subsys_125d_2898_125d_0424, 0};
+#undef pci_ss_info_125d_0424
+#define pci_ss_info_125d_0424 pci_ss_info_125d_2898_125d_0424
+static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0425 =
+ {0x125d, 0x0425, pci_subsys_125d_2898_125d_0425, 0};
+#undef pci_ss_info_125d_0425
+#define pci_ss_info_125d_0425 pci_ss_info_125d_2898_125d_0425
+static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0426 =
+ {0x125d, 0x0426, pci_subsys_125d_2898_125d_0426, 0};
+#undef pci_ss_info_125d_0426
+#define pci_ss_info_125d_0426 pci_ss_info_125d_2898_125d_0426
+static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0427 =
+ {0x125d, 0x0427, pci_subsys_125d_2898_125d_0427, 0};
+#undef pci_ss_info_125d_0427
+#define pci_ss_info_125d_0427 pci_ss_info_125d_2898_125d_0427
+static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0428 =
+ {0x125d, 0x0428, pci_subsys_125d_2898_125d_0428, 0};
+#undef pci_ss_info_125d_0428
+#define pci_ss_info_125d_0428 pci_ss_info_125d_2898_125d_0428
+static const pciSubsystemInfo pci_ss_info_125d_2898_125d_0429 =
+ {0x125d, 0x0429, pci_subsys_125d_2898_125d_0429, 0};
+#undef pci_ss_info_125d_0429
+#define pci_ss_info_125d_0429 pci_ss_info_125d_2898_125d_0429
+static const pciSubsystemInfo pci_ss_info_125d_2898_147a_c001 =
+ {0x147a, 0xc001, pci_subsys_125d_2898_147a_c001, 0};
+#undef pci_ss_info_147a_c001
+#define pci_ss_info_147a_c001 pci_ss_info_125d_2898_147a_c001
+static const pciSubsystemInfo pci_ss_info_125d_2898_14fe_0428 =
+ {0x14fe, 0x0428, pci_subsys_125d_2898_14fe_0428, 0};
+#undef pci_ss_info_14fe_0428
+#define pci_ss_info_14fe_0428 pci_ss_info_125d_2898_14fe_0428
+static const pciSubsystemInfo pci_ss_info_125d_2898_14fe_0429 =
+ {0x14fe, 0x0429, pci_subsys_125d_2898_14fe_0429, 0};
+#undef pci_ss_info_14fe_0429
+#define pci_ss_info_14fe_0429 pci_ss_info_125d_2898_14fe_0429
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1260_3873_1186_3501 =
+ {0x1186, 0x3501, pci_subsys_1260_3873_1186_3501, 0};
+#undef pci_ss_info_1186_3501
+#define pci_ss_info_1186_3501 pci_ss_info_1260_3873_1186_3501
+static const pciSubsystemInfo pci_ss_info_1260_3873_1668_0414 =
+ {0x1668, 0x0414, pci_subsys_1260_3873_1668_0414, 0};
+#undef pci_ss_info_1668_0414
+#define pci_ss_info_1668_0414 pci_ss_info_1260_3873_1668_0414
+static const pciSubsystemInfo pci_ss_info_1260_3873_1737_3874 =
+ {0x1737, 0x3874, pci_subsys_1260_3873_1737_3874, 0};
+#undef pci_ss_info_1737_3874
+#define pci_ss_info_1737_3874 pci_ss_info_1260_3873_1737_3874
+#endif
+static const pciSubsystemInfo pci_ss_info_1260_3873_8086_2513 =
+ {0x8086, 0x2513, pci_subsys_1260_3873_8086_2513, 0};
+#undef pci_ss_info_8086_2513
+#define pci_ss_info_8086_2513 pci_ss_info_1260_3873_8086_2513
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1266_1910_1266_1910 =
+ {0x1266, 0x1910, pci_subsys_1266_1910_1266_1910, 0};
+#undef pci_ss_info_1266_1910
+#define pci_ss_info_1266_1910 pci_ss_info_1266_1910_1266_1910
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_0e11_0024 =
+ {0x0e11, 0x0024, pci_subsys_1274_1371_0e11_0024, 0};
+#undef pci_ss_info_0e11_0024
+#define pci_ss_info_0e11_0024 pci_ss_info_1274_1371_0e11_0024
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_0e11_b1a7 =
+ {0x0e11, 0xb1a7, pci_subsys_1274_1371_0e11_b1a7, 0};
+#undef pci_ss_info_0e11_b1a7
+#define pci_ss_info_0e11_b1a7 pci_ss_info_1274_1371_0e11_b1a7
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_1033_80ac =
+ {0x1033, 0x80ac, pci_subsys_1274_1371_1033_80ac, 0};
+#undef pci_ss_info_1033_80ac
+#define pci_ss_info_1033_80ac pci_ss_info_1274_1371_1033_80ac
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1274_1371_1042_1854 =
+ {0x1042, 0x1854, pci_subsys_1274_1371_1042_1854, 0};
+#undef pci_ss_info_1042_1854
+#define pci_ss_info_1042_1854 pci_ss_info_1274_1371_1042_1854
+static const pciSubsystemInfo pci_ss_info_1274_1371_107b_8054 =
+ {0x107b, 0x8054, pci_subsys_1274_1371_107b_8054, 0};
+#undef pci_ss_info_107b_8054
+#define pci_ss_info_107b_8054 pci_ss_info_1274_1371_107b_8054
+static const pciSubsystemInfo pci_ss_info_1274_1371_1274_1371 =
+ {0x1274, 0x1371, pci_subsys_1274_1371_1274_1371, 0};
+#undef pci_ss_info_1274_1371
+#define pci_ss_info_1274_1371 pci_ss_info_1274_1371_1274_1371
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6470 =
+ {0x1462, 0x6470, pci_subsys_1274_1371_1462_6470, 0};
+#undef pci_ss_info_1462_6470
+#define pci_ss_info_1462_6470 pci_ss_info_1274_1371_1462_6470
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6560 =
+ {0x1462, 0x6560, pci_subsys_1274_1371_1462_6560, 0};
+#undef pci_ss_info_1462_6560
+#define pci_ss_info_1462_6560 pci_ss_info_1274_1371_1462_6560
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6630 =
+ {0x1462, 0x6630, pci_subsys_1274_1371_1462_6630, 0};
+#undef pci_ss_info_1462_6630
+#define pci_ss_info_1462_6630 pci_ss_info_1274_1371_1462_6630
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6631 =
+ {0x1462, 0x6631, pci_subsys_1274_1371_1462_6631, 0};
+#undef pci_ss_info_1462_6631
+#define pci_ss_info_1462_6631 pci_ss_info_1274_1371_1462_6631
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6632 =
+ {0x1462, 0x6632, pci_subsys_1274_1371_1462_6632, 0};
+#undef pci_ss_info_1462_6632
+#define pci_ss_info_1462_6632 pci_ss_info_1274_1371_1462_6632
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6633 =
+ {0x1462, 0x6633, pci_subsys_1274_1371_1462_6633, 0};
+#undef pci_ss_info_1462_6633
+#define pci_ss_info_1462_6633 pci_ss_info_1274_1371_1462_6633
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6820 =
+ {0x1462, 0x6820, pci_subsys_1274_1371_1462_6820, 0};
+#undef pci_ss_info_1462_6820
+#define pci_ss_info_1462_6820 pci_ss_info_1274_1371_1462_6820
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6822 =
+ {0x1462, 0x6822, pci_subsys_1274_1371_1462_6822, 0};
+#undef pci_ss_info_1462_6822
+#define pci_ss_info_1462_6822 pci_ss_info_1274_1371_1462_6822
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6830 =
+ {0x1462, 0x6830, pci_subsys_1274_1371_1462_6830, 0};
+#undef pci_ss_info_1462_6830
+#define pci_ss_info_1462_6830 pci_ss_info_1274_1371_1462_6830
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6880 =
+ {0x1462, 0x6880, pci_subsys_1274_1371_1462_6880, 0};
+#undef pci_ss_info_1462_6880
+#define pci_ss_info_1462_6880 pci_ss_info_1274_1371_1462_6880
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6900 =
+ {0x1462, 0x6900, pci_subsys_1274_1371_1462_6900, 0};
+#undef pci_ss_info_1462_6900
+#define pci_ss_info_1462_6900 pci_ss_info_1274_1371_1462_6900
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6910 =
+ {0x1462, 0x6910, pci_subsys_1274_1371_1462_6910, 0};
+#undef pci_ss_info_1462_6910
+#define pci_ss_info_1462_6910 pci_ss_info_1274_1371_1462_6910
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6930 =
+ {0x1462, 0x6930, pci_subsys_1274_1371_1462_6930, 0};
+#undef pci_ss_info_1462_6930
+#define pci_ss_info_1462_6930 pci_ss_info_1274_1371_1462_6930
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6990 =
+ {0x1462, 0x6990, pci_subsys_1274_1371_1462_6990, 0};
+#undef pci_ss_info_1462_6990
+#define pci_ss_info_1462_6990 pci_ss_info_1274_1371_1462_6990
+static const pciSubsystemInfo pci_ss_info_1274_1371_1462_6991 =
+ {0x1462, 0x6991, pci_subsys_1274_1371_1462_6991, 0};
+#undef pci_ss_info_1462_6991
+#define pci_ss_info_1462_6991 pci_ss_info_1274_1371_1462_6991
+static const pciSubsystemInfo pci_ss_info_1274_1371_14a4_2077 =
+ {0x14a4, 0x2077, pci_subsys_1274_1371_14a4_2077, 0};
+#undef pci_ss_info_14a4_2077
+#define pci_ss_info_14a4_2077 pci_ss_info_1274_1371_14a4_2077
+static const pciSubsystemInfo pci_ss_info_1274_1371_14a4_2105 =
+ {0x14a4, 0x2105, pci_subsys_1274_1371_14a4_2105, 0};
+#undef pci_ss_info_14a4_2105
+#define pci_ss_info_14a4_2105 pci_ss_info_1274_1371_14a4_2105
+static const pciSubsystemInfo pci_ss_info_1274_1371_14a4_2107 =
+ {0x14a4, 0x2107, pci_subsys_1274_1371_14a4_2107, 0};
+#undef pci_ss_info_14a4_2107
+#define pci_ss_info_14a4_2107 pci_ss_info_1274_1371_14a4_2107
+static const pciSubsystemInfo pci_ss_info_1274_1371_14a4_2172 =
+ {0x14a4, 0x2172, pci_subsys_1274_1371_14a4_2172, 0};
+#undef pci_ss_info_14a4_2172
+#define pci_ss_info_14a4_2172 pci_ss_info_1274_1371_14a4_2172
+static const pciSubsystemInfo pci_ss_info_1274_1371_1509_9902 =
+ {0x1509, 0x9902, pci_subsys_1274_1371_1509_9902, 0};
+#undef pci_ss_info_1509_9902
+#define pci_ss_info_1509_9902 pci_ss_info_1274_1371_1509_9902
+static const pciSubsystemInfo pci_ss_info_1274_1371_1509_9903 =
+ {0x1509, 0x9903, pci_subsys_1274_1371_1509_9903, 0};
+#undef pci_ss_info_1509_9903
+#define pci_ss_info_1509_9903 pci_ss_info_1274_1371_1509_9903
+static const pciSubsystemInfo pci_ss_info_1274_1371_1509_9904 =
+ {0x1509, 0x9904, pci_subsys_1274_1371_1509_9904, 0};
+#undef pci_ss_info_1509_9904
+#define pci_ss_info_1509_9904 pci_ss_info_1274_1371_1509_9904
+static const pciSubsystemInfo pci_ss_info_1274_1371_1509_9905 =
+ {0x1509, 0x9905, pci_subsys_1274_1371_1509_9905, 0};
+#undef pci_ss_info_1509_9905
+#define pci_ss_info_1509_9905 pci_ss_info_1274_1371_1509_9905
+static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8801 =
+ {0x152d, 0x8801, pci_subsys_1274_1371_152d_8801, 0};
+#undef pci_ss_info_152d_8801
+#define pci_ss_info_152d_8801 pci_ss_info_1274_1371_152d_8801
+static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8802 =
+ {0x152d, 0x8802, pci_subsys_1274_1371_152d_8802, 0};
+#undef pci_ss_info_152d_8802
+#define pci_ss_info_152d_8802 pci_ss_info_1274_1371_152d_8802
+static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8803 =
+ {0x152d, 0x8803, pci_subsys_1274_1371_152d_8803, 0};
+#undef pci_ss_info_152d_8803
+#define pci_ss_info_152d_8803 pci_ss_info_1274_1371_152d_8803
+static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8804 =
+ {0x152d, 0x8804, pci_subsys_1274_1371_152d_8804, 0};
+#undef pci_ss_info_152d_8804
+#define pci_ss_info_152d_8804 pci_ss_info_1274_1371_152d_8804
+static const pciSubsystemInfo pci_ss_info_1274_1371_152d_8805 =
+ {0x152d, 0x8805, pci_subsys_1274_1371_152d_8805, 0};
+#undef pci_ss_info_152d_8805
+#define pci_ss_info_152d_8805 pci_ss_info_1274_1371_152d_8805
+static const pciSubsystemInfo pci_ss_info_1274_1371_270f_2001 =
+ {0x270f, 0x2001, pci_subsys_1274_1371_270f_2001, 0};
+#undef pci_ss_info_270f_2001
+#define pci_ss_info_270f_2001 pci_ss_info_1274_1371_270f_2001
+static const pciSubsystemInfo pci_ss_info_1274_1371_270f_2200 =
+ {0x270f, 0x2200, pci_subsys_1274_1371_270f_2200, 0};
+#undef pci_ss_info_270f_2200
+#define pci_ss_info_270f_2200 pci_ss_info_1274_1371_270f_2200
+static const pciSubsystemInfo pci_ss_info_1274_1371_270f_3000 =
+ {0x270f, 0x3000, pci_subsys_1274_1371_270f_3000, 0};
+#undef pci_ss_info_270f_3000
+#define pci_ss_info_270f_3000 pci_ss_info_1274_1371_270f_3000
+static const pciSubsystemInfo pci_ss_info_1274_1371_270f_3100 =
+ {0x270f, 0x3100, pci_subsys_1274_1371_270f_3100, 0};
+#undef pci_ss_info_270f_3100
+#define pci_ss_info_270f_3100 pci_ss_info_1274_1371_270f_3100
+static const pciSubsystemInfo pci_ss_info_1274_1371_270f_3102 =
+ {0x270f, 0x3102, pci_subsys_1274_1371_270f_3102, 0};
+#undef pci_ss_info_270f_3102
+#define pci_ss_info_270f_3102 pci_ss_info_1274_1371_270f_3102
+static const pciSubsystemInfo pci_ss_info_1274_1371_270f_7060 =
+ {0x270f, 0x7060, pci_subsys_1274_1371_270f_7060, 0};
+#undef pci_ss_info_270f_7060
+#define pci_ss_info_270f_7060 pci_ss_info_1274_1371_270f_7060
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4249 =
+ {0x8086, 0x4249, pci_subsys_1274_1371_8086_4249, 0};
+#undef pci_ss_info_8086_4249
+#define pci_ss_info_8086_4249 pci_ss_info_1274_1371_8086_4249
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_424c =
+ {0x8086, 0x424c, pci_subsys_1274_1371_8086_424c, 0};
+#undef pci_ss_info_8086_424c
+#define pci_ss_info_8086_424c pci_ss_info_1274_1371_8086_424c
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_425a =
+ {0x8086, 0x425a, pci_subsys_1274_1371_8086_425a, 0};
+#undef pci_ss_info_8086_425a
+#define pci_ss_info_8086_425a pci_ss_info_1274_1371_8086_425a
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4341 =
+ {0x8086, 0x4341, pci_subsys_1274_1371_8086_4341, 0};
+#undef pci_ss_info_8086_4341
+#define pci_ss_info_8086_4341 pci_ss_info_1274_1371_8086_4341
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4343 =
+ {0x8086, 0x4343, pci_subsys_1274_1371_8086_4343, 0};
+#undef pci_ss_info_8086_4343
+#define pci_ss_info_8086_4343 pci_ss_info_1274_1371_8086_4343
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4649 =
+ {0x8086, 0x4649, pci_subsys_1274_1371_8086_4649, 0};
+#undef pci_ss_info_8086_4649
+#define pci_ss_info_8086_4649 pci_ss_info_1274_1371_8086_4649
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_464a =
+ {0x8086, 0x464a, pci_subsys_1274_1371_8086_464a, 0};
+#undef pci_ss_info_8086_464a
+#define pci_ss_info_8086_464a pci_ss_info_1274_1371_8086_464a
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4d4f =
+ {0x8086, 0x4d4f, pci_subsys_1274_1371_8086_4d4f, 0};
+#undef pci_ss_info_8086_4d4f
+#define pci_ss_info_8086_4d4f pci_ss_info_1274_1371_8086_4d4f
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_4f43 =
+ {0x8086, 0x4f43, pci_subsys_1274_1371_8086_4f43, 0};
+#undef pci_ss_info_8086_4f43
+#define pci_ss_info_8086_4f43 pci_ss_info_1274_1371_8086_4f43
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_5243 =
+ {0x8086, 0x5243, pci_subsys_1274_1371_8086_5243, 0};
+#undef pci_ss_info_8086_5243
+#define pci_ss_info_8086_5243 pci_ss_info_1274_1371_8086_5243
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_5352 =
+ {0x8086, 0x5352, pci_subsys_1274_1371_8086_5352, 0};
+#undef pci_ss_info_8086_5352
+#define pci_ss_info_8086_5352 pci_ss_info_1274_1371_8086_5352
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_5643 =
+ {0x8086, 0x5643, pci_subsys_1274_1371_8086_5643, 0};
+#undef pci_ss_info_8086_5643
+#define pci_ss_info_8086_5643 pci_ss_info_1274_1371_8086_5643
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_1274_1371_8086_5753 =
+ {0x8086, 0x5753, pci_subsys_1274_1371_8086_5753, 0};
+#undef pci_ss_info_8086_5753
+#define pci_ss_info_8086_5753 pci_ss_info_1274_1371_8086_5753
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1274_5880_1274_2000 =
+ {0x1274, 0x2000, pci_subsys_1274_5880_1274_2000, 0};
+#undef pci_ss_info_1274_2000
+#define pci_ss_info_1274_2000 pci_ss_info_1274_5880_1274_2000
+static const pciSubsystemInfo pci_ss_info_1274_5880_1274_2003 =
+ {0x1274, 0x2003, pci_subsys_1274_5880_1274_2003, 0};
+#undef pci_ss_info_1274_2003
+#define pci_ss_info_1274_2003 pci_ss_info_1274_5880_1274_2003
+static const pciSubsystemInfo pci_ss_info_1274_5880_1274_5880 =
+ {0x1274, 0x5880, pci_subsys_1274_5880_1274_5880, 0};
+#undef pci_ss_info_1274_5880
+#define pci_ss_info_1274_5880 pci_ss_info_1274_5880_1274_5880
+static const pciSubsystemInfo pci_ss_info_1274_5880_1458_a000 =
+ {0x1458, 0xa000, pci_subsys_1274_5880_1458_a000, 0};
+#undef pci_ss_info_1458_a000
+#define pci_ss_info_1458_a000 pci_ss_info_1274_5880_1458_a000
+static const pciSubsystemInfo pci_ss_info_1274_5880_1462_6880 =
+ {0x1462, 0x6880, pci_subsys_1274_5880_1462_6880, 0};
+#undef pci_ss_info_1462_6880
+#define pci_ss_info_1462_6880 pci_ss_info_1274_5880_1462_6880
+static const pciSubsystemInfo pci_ss_info_1274_5880_270f_2001 =
+ {0x270f, 0x2001, pci_subsys_1274_5880_270f_2001, 0};
+#undef pci_ss_info_270f_2001
+#define pci_ss_info_270f_2001 pci_ss_info_1274_5880_270f_2001
+static const pciSubsystemInfo pci_ss_info_1274_5880_270f_2200 =
+ {0x270f, 0x2200, pci_subsys_1274_5880_270f_2200, 0};
+#undef pci_ss_info_270f_2200
+#define pci_ss_info_270f_2200 pci_ss_info_1274_5880_270f_2200
+static const pciSubsystemInfo pci_ss_info_1274_5880_270f_7040 =
+ {0x270f, 0x7040, pci_subsys_1274_5880_270f_7040, 0};
+#undef pci_ss_info_270f_7040
+#define pci_ss_info_270f_7040 pci_ss_info_1274_5880_270f_7040
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_1002_1092_094c =
+ {0x1092, 0x094c, pci_subsys_127a_1002_1092_094c, 0};
+#undef pci_ss_info_1092_094c
+#define pci_ss_info_1092_094c pci_ss_info_127a_1002_1092_094c
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4002 =
+ {0x122d, 0x4002, pci_subsys_127a_1002_122d_4002, 0};
+#undef pci_ss_info_122d_4002
+#define pci_ss_info_122d_4002 pci_ss_info_127a_1002_122d_4002
+static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4005 =
+ {0x122d, 0x4005, pci_subsys_127a_1002_122d_4005, 0};
+#undef pci_ss_info_122d_4005
+#define pci_ss_info_122d_4005 pci_ss_info_127a_1002_122d_4005
+static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4007 =
+ {0x122d, 0x4007, pci_subsys_127a_1002_122d_4007, 0};
+#undef pci_ss_info_122d_4007
+#define pci_ss_info_122d_4007 pci_ss_info_127a_1002_122d_4007
+static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4012 =
+ {0x122d, 0x4012, pci_subsys_127a_1002_122d_4012, 0};
+#undef pci_ss_info_122d_4012
+#define pci_ss_info_122d_4012 pci_ss_info_127a_1002_122d_4012
+static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4017 =
+ {0x122d, 0x4017, pci_subsys_127a_1002_122d_4017, 0};
+#undef pci_ss_info_122d_4017
+#define pci_ss_info_122d_4017 pci_ss_info_127a_1002_122d_4017
+static const pciSubsystemInfo pci_ss_info_127a_1002_122d_4018 =
+ {0x122d, 0x4018, pci_subsys_127a_1002_122d_4018, 0};
+#undef pci_ss_info_122d_4018
+#define pci_ss_info_122d_4018 pci_ss_info_127a_1002_122d_4018
+static const pciSubsystemInfo pci_ss_info_127a_1002_127a_1002 =
+ {0x127a, 0x1002, pci_subsys_127a_1002_127a_1002, 0};
+#undef pci_ss_info_127a_1002
+#define pci_ss_info_127a_1002 pci_ss_info_127a_1002_127a_1002
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_1003_0e11_b0bc =
+ {0x0e11, 0xb0bc, pci_subsys_127a_1003_0e11_b0bc, 0};
+#undef pci_ss_info_0e11_b0bc
+#define pci_ss_info_0e11_b0bc pci_ss_info_127a_1003_0e11_b0bc
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_1003_0e11_b114 =
+ {0x0e11, 0xb114, pci_subsys_127a_1003_0e11_b114, 0};
+#undef pci_ss_info_0e11_b114
+#define pci_ss_info_0e11_b114 pci_ss_info_127a_1003_0e11_b114
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_1003_1033_802b =
+ {0x1033, 0x802b, pci_subsys_127a_1003_1033_802b, 0};
+#undef pci_ss_info_1033_802b
+#define pci_ss_info_1033_802b pci_ss_info_127a_1003_1033_802b
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_127a_1003_13df_1003 =
+ {0x13df, 0x1003, pci_subsys_127a_1003_13df_1003, 0};
+#undef pci_ss_info_13df_1003
+#define pci_ss_info_13df_1003 pci_ss_info_127a_1003_13df_1003
+static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_0117 =
+ {0x13e0, 0x0117, pci_subsys_127a_1003_13e0_0117, 0};
+#undef pci_ss_info_13e0_0117
+#define pci_ss_info_13e0_0117 pci_ss_info_127a_1003_13e0_0117
+static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_0147 =
+ {0x13e0, 0x0147, pci_subsys_127a_1003_13e0_0147, 0};
+#undef pci_ss_info_13e0_0147
+#define pci_ss_info_13e0_0147 pci_ss_info_127a_1003_13e0_0147
+static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_0197 =
+ {0x13e0, 0x0197, pci_subsys_127a_1003_13e0_0197, 0};
+#undef pci_ss_info_13e0_0197
+#define pci_ss_info_13e0_0197 pci_ss_info_127a_1003_13e0_0197
+static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_01c7 =
+ {0x13e0, 0x01c7, pci_subsys_127a_1003_13e0_01c7, 0};
+#undef pci_ss_info_13e0_01c7
+#define pci_ss_info_13e0_01c7 pci_ss_info_127a_1003_13e0_01c7
+static const pciSubsystemInfo pci_ss_info_127a_1003_13e0_01f7 =
+ {0x13e0, 0x01f7, pci_subsys_127a_1003_13e0_01f7, 0};
+#undef pci_ss_info_13e0_01f7
+#define pci_ss_info_13e0_01f7 pci_ss_info_127a_1003_13e0_01f7
+static const pciSubsystemInfo pci_ss_info_127a_1003_1436_1003 =
+ {0x1436, 0x1003, pci_subsys_127a_1003_1436_1003, 0};
+#undef pci_ss_info_1436_1003
+#define pci_ss_info_1436_1003 pci_ss_info_127a_1003_1436_1003
+static const pciSubsystemInfo pci_ss_info_127a_1003_1436_1103 =
+ {0x1436, 0x1103, pci_subsys_127a_1003_1436_1103, 0};
+#undef pci_ss_info_1436_1103
+#define pci_ss_info_1436_1103 pci_ss_info_127a_1003_1436_1103
+static const pciSubsystemInfo pci_ss_info_127a_1003_1436_1602 =
+ {0x1436, 0x1602, pci_subsys_127a_1003_1436_1602, 0};
+#undef pci_ss_info_1436_1602
+#define pci_ss_info_1436_1602 pci_ss_info_127a_1003_1436_1602
+static const pciSubsystemInfo pci_ss_info_127a_1004_1048_1500 =
+ {0x1048, 0x1500, pci_subsys_127a_1004_1048_1500, 0};
+#undef pci_ss_info_1048_1500
+#define pci_ss_info_1048_1500 pci_ss_info_127a_1004_1048_1500
+static const pciSubsystemInfo pci_ss_info_127a_1004_10cf_1059 =
+ {0x10cf, 0x1059, pci_subsys_127a_1004_10cf_1059, 0};
+#undef pci_ss_info_10cf_1059
+#define pci_ss_info_10cf_1059 pci_ss_info_127a_1004_10cf_1059
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_1005_1033_8029 =
+ {0x1033, 0x8029, pci_subsys_127a_1005_1033_8029, 0};
+#undef pci_ss_info_1033_8029
+#define pci_ss_info_1033_8029 pci_ss_info_127a_1005_1033_8029
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_1005_1033_8054 =
+ {0x1033, 0x8054, pci_subsys_127a_1005_1033_8054, 0};
+#undef pci_ss_info_1033_8054
+#define pci_ss_info_1033_8054 pci_ss_info_127a_1005_1033_8054
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_127a_1005_10cf_103c =
+ {0x10cf, 0x103c, pci_subsys_127a_1005_10cf_103c, 0};
+#undef pci_ss_info_10cf_103c
+#define pci_ss_info_10cf_103c pci_ss_info_127a_1005_10cf_103c
+static const pciSubsystemInfo pci_ss_info_127a_1005_10cf_1055 =
+ {0x10cf, 0x1055, pci_subsys_127a_1005_10cf_1055, 0};
+#undef pci_ss_info_10cf_1055
+#define pci_ss_info_10cf_1055 pci_ss_info_127a_1005_10cf_1055
+static const pciSubsystemInfo pci_ss_info_127a_1005_10cf_1056 =
+ {0x10cf, 0x1056, pci_subsys_127a_1005_10cf_1056, 0};
+#undef pci_ss_info_10cf_1056
+#define pci_ss_info_10cf_1056 pci_ss_info_127a_1005_10cf_1056
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4003 =
+ {0x122d, 0x4003, pci_subsys_127a_1005_122d_4003, 0};
+#undef pci_ss_info_122d_4003
+#define pci_ss_info_122d_4003 pci_ss_info_127a_1005_122d_4003
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4006 =
+ {0x122d, 0x4006, pci_subsys_127a_1005_122d_4006, 0};
+#undef pci_ss_info_122d_4006
+#define pci_ss_info_122d_4006 pci_ss_info_127a_1005_122d_4006
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4008 =
+ {0x122d, 0x4008, pci_subsys_127a_1005_122d_4008, 0};
+#undef pci_ss_info_122d_4008
+#define pci_ss_info_122d_4008 pci_ss_info_127a_1005_122d_4008
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4009 =
+ {0x122d, 0x4009, pci_subsys_127a_1005_122d_4009, 0};
+#undef pci_ss_info_122d_4009
+#define pci_ss_info_122d_4009 pci_ss_info_127a_1005_122d_4009
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4010 =
+ {0x122d, 0x4010, pci_subsys_127a_1005_122d_4010, 0};
+#undef pci_ss_info_122d_4010
+#define pci_ss_info_122d_4010 pci_ss_info_127a_1005_122d_4010
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4011 =
+ {0x122d, 0x4011, pci_subsys_127a_1005_122d_4011, 0};
+#undef pci_ss_info_122d_4011
+#define pci_ss_info_122d_4011 pci_ss_info_127a_1005_122d_4011
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4013 =
+ {0x122d, 0x4013, pci_subsys_127a_1005_122d_4013, 0};
+#undef pci_ss_info_122d_4013
+#define pci_ss_info_122d_4013 pci_ss_info_127a_1005_122d_4013
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4015 =
+ {0x122d, 0x4015, pci_subsys_127a_1005_122d_4015, 0};
+#undef pci_ss_info_122d_4015
+#define pci_ss_info_122d_4015 pci_ss_info_127a_1005_122d_4015
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4016 =
+ {0x122d, 0x4016, pci_subsys_127a_1005_122d_4016, 0};
+#undef pci_ss_info_122d_4016
+#define pci_ss_info_122d_4016 pci_ss_info_127a_1005_122d_4016
+static const pciSubsystemInfo pci_ss_info_127a_1005_122d_4019 =
+ {0x122d, 0x4019, pci_subsys_127a_1005_122d_4019, 0};
+#undef pci_ss_info_122d_4019
+#define pci_ss_info_122d_4019 pci_ss_info_127a_1005_122d_4019
+static const pciSubsystemInfo pci_ss_info_127a_1005_13df_1005 =
+ {0x13df, 0x1005, pci_subsys_127a_1005_13df_1005, 0};
+#undef pci_ss_info_13df_1005
+#define pci_ss_info_13df_1005 pci_ss_info_127a_1005_13df_1005
+static const pciSubsystemInfo pci_ss_info_127a_1005_13e0_0187 =
+ {0x13e0, 0x0187, pci_subsys_127a_1005_13e0_0187, 0};
+#undef pci_ss_info_13e0_0187
+#define pci_ss_info_13e0_0187 pci_ss_info_127a_1005_13e0_0187
+static const pciSubsystemInfo pci_ss_info_127a_1005_13e0_01a7 =
+ {0x13e0, 0x01a7, pci_subsys_127a_1005_13e0_01a7, 0};
+#undef pci_ss_info_13e0_01a7
+#define pci_ss_info_13e0_01a7 pci_ss_info_127a_1005_13e0_01a7
+static const pciSubsystemInfo pci_ss_info_127a_1005_13e0_01b7 =
+ {0x13e0, 0x01b7, pci_subsys_127a_1005_13e0_01b7, 0};
+#undef pci_ss_info_13e0_01b7
+#define pci_ss_info_13e0_01b7 pci_ss_info_127a_1005_13e0_01b7
+static const pciSubsystemInfo pci_ss_info_127a_1005_13e0_01d7 =
+ {0x13e0, 0x01d7, pci_subsys_127a_1005_13e0_01d7, 0};
+#undef pci_ss_info_13e0_01d7
+#define pci_ss_info_13e0_01d7 pci_ss_info_127a_1005_13e0_01d7
+static const pciSubsystemInfo pci_ss_info_127a_1005_1436_1005 =
+ {0x1436, 0x1005, pci_subsys_127a_1005_1436_1005, 0};
+#undef pci_ss_info_1436_1005
+#define pci_ss_info_1436_1005 pci_ss_info_127a_1005_1436_1005
+static const pciSubsystemInfo pci_ss_info_127a_1005_1436_1105 =
+ {0x1436, 0x1105, pci_subsys_127a_1005_1436_1105, 0};
+#undef pci_ss_info_1436_1105
+#define pci_ss_info_1436_1105 pci_ss_info_127a_1005_1436_1105
+static const pciSubsystemInfo pci_ss_info_127a_1005_1437_1105 =
+ {0x1437, 0x1105, pci_subsys_127a_1005_1437_1105, 0};
+#undef pci_ss_info_1437_1105
+#define pci_ss_info_1437_1105 pci_ss_info_127a_1005_1437_1105
+static const pciSubsystemInfo pci_ss_info_127a_1022_1436_1303 =
+ {0x1436, 0x1303, pci_subsys_127a_1022_1436_1303, 0};
+#undef pci_ss_info_1436_1303
+#define pci_ss_info_1436_1303 pci_ss_info_127a_1022_1436_1303
+static const pciSubsystemInfo pci_ss_info_127a_1023_122d_4020 =
+ {0x122d, 0x4020, pci_subsys_127a_1023_122d_4020, 0};
+#undef pci_ss_info_122d_4020
+#define pci_ss_info_122d_4020 pci_ss_info_127a_1023_122d_4020
+static const pciSubsystemInfo pci_ss_info_127a_1023_122d_4023 =
+ {0x122d, 0x4023, pci_subsys_127a_1023_122d_4023, 0};
+#undef pci_ss_info_122d_4023
+#define pci_ss_info_122d_4023 pci_ss_info_127a_1023_122d_4023
+static const pciSubsystemInfo pci_ss_info_127a_1023_13e0_0247 =
+ {0x13e0, 0x0247, pci_subsys_127a_1023_13e0_0247, 0};
+#undef pci_ss_info_13e0_0247
+#define pci_ss_info_13e0_0247 pci_ss_info_127a_1023_13e0_0247
+static const pciSubsystemInfo pci_ss_info_127a_1023_13e0_0297 =
+ {0x13e0, 0x0297, pci_subsys_127a_1023_13e0_0297, 0};
+#undef pci_ss_info_13e0_0297
+#define pci_ss_info_13e0_0297 pci_ss_info_127a_1023_13e0_0297
+static const pciSubsystemInfo pci_ss_info_127a_1023_13e0_02c7 =
+ {0x13e0, 0x02c7, pci_subsys_127a_1023_13e0_02c7, 0};
+#undef pci_ss_info_13e0_02c7
+#define pci_ss_info_13e0_02c7 pci_ss_info_127a_1023_13e0_02c7
+static const pciSubsystemInfo pci_ss_info_127a_1023_1436_1203 =
+ {0x1436, 0x1203, pci_subsys_127a_1023_1436_1203, 0};
+#undef pci_ss_info_1436_1203
+#define pci_ss_info_1436_1203 pci_ss_info_127a_1023_1436_1203
+static const pciSubsystemInfo pci_ss_info_127a_1023_1436_1303 =
+ {0x1436, 0x1303, pci_subsys_127a_1023_1436_1303, 0};
+#undef pci_ss_info_1436_1303
+#define pci_ss_info_1436_1303 pci_ss_info_127a_1023_1436_1303
+static const pciSubsystemInfo pci_ss_info_127a_1025_10cf_106a =
+ {0x10cf, 0x106a, pci_subsys_127a_1025_10cf_106a, 0};
+#undef pci_ss_info_10cf_106a
+#define pci_ss_info_10cf_106a pci_ss_info_127a_1025_10cf_106a
+static const pciSubsystemInfo pci_ss_info_127a_1025_122d_4021 =
+ {0x122d, 0x4021, pci_subsys_127a_1025_122d_4021, 0};
+#undef pci_ss_info_122d_4021
+#define pci_ss_info_122d_4021 pci_ss_info_127a_1025_122d_4021
+static const pciSubsystemInfo pci_ss_info_127a_1025_122d_4022 =
+ {0x122d, 0x4022, pci_subsys_127a_1025_122d_4022, 0};
+#undef pci_ss_info_122d_4022
+#define pci_ss_info_122d_4022 pci_ss_info_127a_1025_122d_4022
+static const pciSubsystemInfo pci_ss_info_127a_1025_122d_4024 =
+ {0x122d, 0x4024, pci_subsys_127a_1025_122d_4024, 0};
+#undef pci_ss_info_122d_4024
+#define pci_ss_info_122d_4024 pci_ss_info_127a_1025_122d_4024
+static const pciSubsystemInfo pci_ss_info_127a_1025_122d_4025 =
+ {0x122d, 0x4025, pci_subsys_127a_1025_122d_4025, 0};
+#undef pci_ss_info_122d_4025
+#define pci_ss_info_122d_4025 pci_ss_info_127a_1025_122d_4025
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8044 =
+ {0x104d, 0x8044, pci_subsys_127a_2005_104d_8044, 0};
+#undef pci_ss_info_104d_8044
+#define pci_ss_info_104d_8044 pci_ss_info_127a_2005_104d_8044
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8045 =
+ {0x104d, 0x8045, pci_subsys_127a_2005_104d_8045, 0};
+#undef pci_ss_info_104d_8045
+#define pci_ss_info_104d_8045 pci_ss_info_127a_2005_104d_8045
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8055 =
+ {0x104d, 0x8055, pci_subsys_127a_2005_104d_8055, 0};
+#undef pci_ss_info_104d_8055
+#define pci_ss_info_104d_8055 pci_ss_info_127a_2005_104d_8055
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8056 =
+ {0x104d, 0x8056, pci_subsys_127a_2005_104d_8056, 0};
+#undef pci_ss_info_104d_8056
+#define pci_ss_info_104d_8056 pci_ss_info_127a_2005_104d_8056
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_2005_104d_805a =
+ {0x104d, 0x805a, pci_subsys_127a_2005_104d_805a, 0};
+#undef pci_ss_info_104d_805a
+#define pci_ss_info_104d_805a pci_ss_info_127a_2005_104d_805a
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_2005_104d_805f =
+ {0x104d, 0x805f, pci_subsys_127a_2005_104d_805f, 0};
+#undef pci_ss_info_104d_805f
+#define pci_ss_info_104d_805f pci_ss_info_127a_2005_104d_805f
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_127a_2005_104d_8074 =
+ {0x104d, 0x8074, pci_subsys_127a_2005_104d_8074, 0};
+#undef pci_ss_info_104d_8074
+#define pci_ss_info_104d_8074 pci_ss_info_127a_2005_104d_8074
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_127a_2013_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_127a_2013_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_127a_2013_1179_0001
+static const pciSubsystemInfo pci_ss_info_127a_2013_1179_ff00 =
+ {0x1179, 0xff00, pci_subsys_127a_2013_1179_ff00, 0};
+#undef pci_ss_info_1179_ff00
+#define pci_ss_info_1179_ff00 pci_ss_info_127a_2013_1179_ff00
+static const pciSubsystemInfo pci_ss_info_127a_2014_10cf_1057 =
+ {0x10cf, 0x1057, pci_subsys_127a_2014_10cf_1057, 0};
+#undef pci_ss_info_10cf_1057
+#define pci_ss_info_10cf_1057 pci_ss_info_127a_2014_10cf_1057
+static const pciSubsystemInfo pci_ss_info_127a_2014_122d_4050 =
+ {0x122d, 0x4050, pci_subsys_127a_2014_122d_4050, 0};
+#undef pci_ss_info_122d_4050
+#define pci_ss_info_122d_4050 pci_ss_info_127a_2014_122d_4050
+static const pciSubsystemInfo pci_ss_info_127a_2014_122d_4055 =
+ {0x122d, 0x4055, pci_subsys_127a_2014_122d_4055, 0};
+#undef pci_ss_info_122d_4055
+#define pci_ss_info_122d_4055 pci_ss_info_127a_2014_122d_4055
+static const pciSubsystemInfo pci_ss_info_127a_2015_10cf_1063 =
+ {0x10cf, 0x1063, pci_subsys_127a_2015_10cf_1063, 0};
+#undef pci_ss_info_10cf_1063
+#define pci_ss_info_10cf_1063 pci_ss_info_127a_2015_10cf_1063
+static const pciSubsystemInfo pci_ss_info_127a_2015_10cf_1064 =
+ {0x10cf, 0x1064, pci_subsys_127a_2015_10cf_1064, 0};
+#undef pci_ss_info_10cf_1064
+#define pci_ss_info_10cf_1064 pci_ss_info_127a_2015_10cf_1064
+static const pciSubsystemInfo pci_ss_info_127a_2015_1468_2015 =
+ {0x1468, 0x2015, pci_subsys_127a_2015_1468_2015, 0};
+#undef pci_ss_info_1468_2015
+#define pci_ss_info_1468_2015 pci_ss_info_127a_2015_1468_2015
+static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4051 =
+ {0x122d, 0x4051, pci_subsys_127a_2016_122d_4051, 0};
+#undef pci_ss_info_122d_4051
+#define pci_ss_info_122d_4051 pci_ss_info_127a_2016_122d_4051
+static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4052 =
+ {0x122d, 0x4052, pci_subsys_127a_2016_122d_4052, 0};
+#undef pci_ss_info_122d_4052
+#define pci_ss_info_122d_4052 pci_ss_info_127a_2016_122d_4052
+static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4054 =
+ {0x122d, 0x4054, pci_subsys_127a_2016_122d_4054, 0};
+#undef pci_ss_info_122d_4054
+#define pci_ss_info_122d_4054 pci_ss_info_127a_2016_122d_4054
+static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4056 =
+ {0x122d, 0x4056, pci_subsys_127a_2016_122d_4056, 0};
+#undef pci_ss_info_122d_4056
+#define pci_ss_info_122d_4056 pci_ss_info_127a_2016_122d_4056
+static const pciSubsystemInfo pci_ss_info_127a_2016_122d_4057 =
+ {0x122d, 0x4057, pci_subsys_127a_2016_122d_4057, 0};
+#undef pci_ss_info_122d_4057
+#define pci_ss_info_122d_4057 pci_ss_info_127a_2016_122d_4057
+static const pciSubsystemInfo pci_ss_info_127a_4311_127a_4311 =
+ {0x127a, 0x4311, pci_subsys_127a_4311_127a_4311, 0};
+#undef pci_ss_info_127a_4311
+#define pci_ss_info_127a_4311 pci_ss_info_127a_4311_127a_4311
+static const pciSubsystemInfo pci_ss_info_127a_4311_13e0_0210 =
+ {0x13e0, 0x0210, pci_subsys_127a_4311_13e0_0210, 0};
+#undef pci_ss_info_13e0_0210
+#define pci_ss_info_13e0_0210 pci_ss_info_127a_4311_13e0_0210
+static const pciSubsystemInfo pci_ss_info_127a_4320_1235_4320 =
+ {0x1235, 0x4320, pci_subsys_127a_4320_1235_4320, 0};
+#undef pci_ss_info_1235_4320
+#define pci_ss_info_1235_4320 pci_ss_info_127a_4320_1235_4320
+static const pciSubsystemInfo pci_ss_info_127a_4321_1235_4321 =
+ {0x1235, 0x4321, pci_subsys_127a_4321_1235_4321, 0};
+#undef pci_ss_info_1235_4321
+#define pci_ss_info_1235_4321 pci_ss_info_127a_4321_1235_4321
+static const pciSubsystemInfo pci_ss_info_127a_4321_1235_4324 =
+ {0x1235, 0x4324, pci_subsys_127a_4321_1235_4324, 0};
+#undef pci_ss_info_1235_4324
+#define pci_ss_info_1235_4324 pci_ss_info_127a_4321_1235_4324
+static const pciSubsystemInfo pci_ss_info_127a_4321_13e0_0210 =
+ {0x13e0, 0x0210, pci_subsys_127a_4321_13e0_0210, 0};
+#undef pci_ss_info_13e0_0210
+#define pci_ss_info_13e0_0210 pci_ss_info_127a_4321_13e0_0210
+static const pciSubsystemInfo pci_ss_info_127a_4321_144d_2321 =
+ {0x144d, 0x2321, pci_subsys_127a_4321_144d_2321, 0};
+#undef pci_ss_info_144d_2321
+#define pci_ss_info_144d_2321 pci_ss_info_127a_4321_144d_2321
+static const pciSubsystemInfo pci_ss_info_127a_4322_1235_4322 =
+ {0x1235, 0x4322, pci_subsys_127a_4322_1235_4322, 0};
+#undef pci_ss_info_1235_4322
+#define pci_ss_info_1235_4322 pci_ss_info_127a_4322_1235_4322
+static const pciSubsystemInfo pci_ss_info_127a_8234_108d_0022 =
+ {0x108d, 0x0022, pci_subsys_127a_8234_108d_0022, 0};
+#undef pci_ss_info_108d_0022
+#define pci_ss_info_108d_0022 pci_ss_info_127a_8234_108d_0022
+static const pciSubsystemInfo pci_ss_info_127a_8234_108d_0027 =
+ {0x108d, 0x0027, pci_subsys_127a_8234_108d_0027, 0};
+#undef pci_ss_info_108d_0027
+#define pci_ss_info_108d_0027 pci_ss_info_127a_8234_108d_0027
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_12ae_0001_12ae_0001 =
+ {0x12ae, 0x0001, pci_subsys_12ae_0001_12ae_0001, 0};
+#undef pci_ss_info_12ae_0001
+#define pci_ss_info_12ae_0001 pci_ss_info_12ae_0001_12ae_0001
+static const pciSubsystemInfo pci_ss_info_12ae_0001_1410_0104 =
+ {0x1410, 0x0104, pci_subsys_12ae_0001_1410_0104, 0};
+#undef pci_ss_info_1410_0104
+#define pci_ss_info_1410_0104 pci_ss_info_12ae_0001_1410_0104
+static const pciSubsystemInfo pci_ss_info_12ae_0002_12ae_0002 =
+ {0x12ae, 0x0002, pci_subsys_12ae_0002_12ae_0002, 0};
+#undef pci_ss_info_12ae_0002
+#define pci_ss_info_12ae_0002 pci_ss_info_12ae_0002_12ae_0002
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_005c =
+ {0x12b9, 0x005c, pci_subsys_12b9_1006_12b9_005c, 0};
+#undef pci_ss_info_12b9_005c
+#define pci_ss_info_12b9_005c pci_ss_info_12b9_1006_12b9_005c
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_005e =
+ {0x12b9, 0x005e, pci_subsys_12b9_1006_12b9_005e, 0};
+#undef pci_ss_info_12b9_005e
+#define pci_ss_info_12b9_005e pci_ss_info_12b9_1006_12b9_005e
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0062 =
+ {0x12b9, 0x0062, pci_subsys_12b9_1006_12b9_0062, 0};
+#undef pci_ss_info_12b9_0062
+#define pci_ss_info_12b9_0062 pci_ss_info_12b9_1006_12b9_0062
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0068 =
+ {0x12b9, 0x0068, pci_subsys_12b9_1006_12b9_0068, 0};
+#undef pci_ss_info_12b9_0068
+#define pci_ss_info_12b9_0068 pci_ss_info_12b9_1006_12b9_0068
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_007a =
+ {0x12b9, 0x007a, pci_subsys_12b9_1006_12b9_007a, 0};
+#undef pci_ss_info_12b9_007a
+#define pci_ss_info_12b9_007a pci_ss_info_12b9_1006_12b9_007a
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_007f =
+ {0x12b9, 0x007f, pci_subsys_12b9_1006_12b9_007f, 0};
+#undef pci_ss_info_12b9_007f
+#define pci_ss_info_12b9_007f pci_ss_info_12b9_1006_12b9_007f
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0080 =
+ {0x12b9, 0x0080, pci_subsys_12b9_1006_12b9_0080, 0};
+#undef pci_ss_info_12b9_0080
+#define pci_ss_info_12b9_0080 pci_ss_info_12b9_1006_12b9_0080
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0081 =
+ {0x12b9, 0x0081, pci_subsys_12b9_1006_12b9_0081, 0};
+#undef pci_ss_info_12b9_0081
+#define pci_ss_info_12b9_0081 pci_ss_info_12b9_1006_12b9_0081
+static const pciSubsystemInfo pci_ss_info_12b9_1006_12b9_0091 =
+ {0x12b9, 0x0091, pci_subsys_12b9_1006_12b9_0091, 0};
+#undef pci_ss_info_12b9_0091
+#define pci_ss_info_12b9_0091 pci_ss_info_12b9_1006_12b9_0091
+static const pciSubsystemInfo pci_ss_info_12b9_1007_12b9_00a3 =
+ {0x12b9, 0x00a3, pci_subsys_12b9_1007_12b9_00a3, 0};
+#undef pci_ss_info_12b9_00a3
+#define pci_ss_info_12b9_00a3 pci_ss_info_12b9_1007_12b9_00a3
+static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00a2 =
+ {0x12b9, 0x00a2, pci_subsys_12b9_1008_12b9_00a2, 0};
+#undef pci_ss_info_12b9_00a2
+#define pci_ss_info_12b9_00a2 pci_ss_info_12b9_1008_12b9_00a2
+static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00aa =
+ {0x12b9, 0x00aa, pci_subsys_12b9_1008_12b9_00aa, 0};
+#undef pci_ss_info_12b9_00aa
+#define pci_ss_info_12b9_00aa pci_ss_info_12b9_1008_12b9_00aa
+static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00ab =
+ {0x12b9, 0x00ab, pci_subsys_12b9_1008_12b9_00ab, 0};
+#undef pci_ss_info_12b9_00ab
+#define pci_ss_info_12b9_00ab pci_ss_info_12b9_1008_12b9_00ab
+static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00ac =
+ {0x12b9, 0x00ac, pci_subsys_12b9_1008_12b9_00ac, 0};
+#undef pci_ss_info_12b9_00ac
+#define pci_ss_info_12b9_00ac pci_ss_info_12b9_1008_12b9_00ac
+static const pciSubsystemInfo pci_ss_info_12b9_1008_12b9_00ad =
+ {0x12b9, 0x00ad, pci_subsys_12b9_1008_12b9_00ad, 0};
+#undef pci_ss_info_12b9_00ad
+#define pci_ss_info_12b9_00ad pci_ss_info_12b9_1008_12b9_00ad
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_12be_3042_12be_3042 =
+ {0x12be, 0x3042, pci_subsys_12be_3042_12be_3042, 0};
+#undef pci_ss_info_12be_3042
+#define pci_ss_info_12be_3042 pci_ss_info_12be_3042_12be_3042
+#endif
+static const pciSubsystemInfo pci_ss_info_12d2_0018_1048_0c10 =
+ {0x1048, 0x0c10, pci_subsys_12d2_0018_1048_0c10, 0};
+#undef pci_ss_info_1048_0c10
+#define pci_ss_info_1048_0c10 pci_ss_info_12d2_0018_1048_0c10
+static const pciSubsystemInfo pci_ss_info_12d2_0018_107b_8030 =
+ {0x107b, 0x8030, pci_subsys_12d2_0018_107b_8030, 0};
+#undef pci_ss_info_107b_8030
+#define pci_ss_info_107b_8030 pci_ss_info_12d2_0018_107b_8030
+static const pciSubsystemInfo pci_ss_info_12d2_0018_1092_0350 =
+ {0x1092, 0x0350, pci_subsys_12d2_0018_1092_0350, 0};
+#undef pci_ss_info_1092_0350
+#define pci_ss_info_1092_0350 pci_ss_info_12d2_0018_1092_0350
+static const pciSubsystemInfo pci_ss_info_12d2_0018_1092_1092 =
+ {0x1092, 0x1092, pci_subsys_12d2_0018_1092_1092, 0};
+#undef pci_ss_info_1092_1092
+#define pci_ss_info_1092_1092 pci_ss_info_12d2_0018_1092_1092
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b1b =
+ {0x10b4, 0x1b1b, pci_subsys_12d2_0018_10b4_1b1b, 0};
+#undef pci_ss_info_10b4_1b1b
+#define pci_ss_info_10b4_1b1b pci_ss_info_12d2_0018_10b4_1b1b
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b1d =
+ {0x10b4, 0x1b1d, pci_subsys_12d2_0018_10b4_1b1d, 0};
+#undef pci_ss_info_10b4_1b1d
+#define pci_ss_info_10b4_1b1d pci_ss_info_12d2_0018_10b4_1b1d
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b1e =
+ {0x10b4, 0x1b1e, pci_subsys_12d2_0018_10b4_1b1e, 0};
+#undef pci_ss_info_10b4_1b1e
+#define pci_ss_info_10b4_1b1e pci_ss_info_12d2_0018_10b4_1b1e
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b20 =
+ {0x10b4, 0x1b20, pci_subsys_12d2_0018_10b4_1b20, 0};
+#undef pci_ss_info_10b4_1b20
+#define pci_ss_info_10b4_1b20 pci_ss_info_12d2_0018_10b4_1b20
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b21 =
+ {0x10b4, 0x1b21, pci_subsys_12d2_0018_10b4_1b21, 0};
+#undef pci_ss_info_10b4_1b21
+#define pci_ss_info_10b4_1b21 pci_ss_info_12d2_0018_10b4_1b21
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b22 =
+ {0x10b4, 0x1b22, pci_subsys_12d2_0018_10b4_1b22, 0};
+#undef pci_ss_info_10b4_1b22
+#define pci_ss_info_10b4_1b22 pci_ss_info_12d2_0018_10b4_1b22
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b23 =
+ {0x10b4, 0x1b23, pci_subsys_12d2_0018_10b4_1b23, 0};
+#undef pci_ss_info_10b4_1b23
+#define pci_ss_info_10b4_1b23 pci_ss_info_12d2_0018_10b4_1b23
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b27 =
+ {0x10b4, 0x1b27, pci_subsys_12d2_0018_10b4_1b27, 0};
+#undef pci_ss_info_10b4_1b27
+#define pci_ss_info_10b4_1b27 pci_ss_info_12d2_0018_10b4_1b27
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_1b88 =
+ {0x10b4, 0x1b88, pci_subsys_12d2_0018_10b4_1b88, 0};
+#undef pci_ss_info_10b4_1b88
+#define pci_ss_info_10b4_1b88 pci_ss_info_12d2_0018_10b4_1b88
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_222a =
+ {0x10b4, 0x222a, pci_subsys_12d2_0018_10b4_222a, 0};
+#undef pci_ss_info_10b4_222a
+#define pci_ss_info_10b4_222a pci_ss_info_12d2_0018_10b4_222a
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_2230 =
+ {0x10b4, 0x2230, pci_subsys_12d2_0018_10b4_2230, 0};
+#undef pci_ss_info_10b4_2230
+#define pci_ss_info_10b4_2230 pci_ss_info_12d2_0018_10b4_2230
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_2232 =
+ {0x10b4, 0x2232, pci_subsys_12d2_0018_10b4_2232, 0};
+#undef pci_ss_info_10b4_2232
+#define pci_ss_info_10b4_2232 pci_ss_info_12d2_0018_10b4_2232
+static const pciSubsystemInfo pci_ss_info_12d2_0018_10b4_2235 =
+ {0x10b4, 0x2235, pci_subsys_12d2_0018_10b4_2235, 0};
+#undef pci_ss_info_10b4_2235
+#define pci_ss_info_10b4_2235 pci_ss_info_12d2_0018_10b4_2235
+static const pciSubsystemInfo pci_ss_info_12d2_0018_2a15_54a3 =
+ {0x2a15, 0x54a3, pci_subsys_12d2_0018_2a15_54a3, 0};
+#undef pci_ss_info_2a15_54a3
+#define pci_ss_info_2a15_54a3 pci_ss_info_12d2_0018_2a15_54a3
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0001_104d_8036 =
+ {0x104d, 0x8036, pci_subsys_12eb_0001_104d_8036, 0};
+#undef pci_ss_info_104d_8036
+#define pci_ss_info_104d_8036 pci_ss_info_12eb_0001_104d_8036
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0001_1092_2000 =
+ {0x1092, 0x2000, pci_subsys_12eb_0001_1092_2000, 0};
+#undef pci_ss_info_1092_2000
+#define pci_ss_info_1092_2000 pci_ss_info_12eb_0001_1092_2000
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0001_1092_2100 =
+ {0x1092, 0x2100, pci_subsys_12eb_0001_1092_2100, 0};
+#undef pci_ss_info_1092_2100
+#define pci_ss_info_1092_2100 pci_ss_info_12eb_0001_1092_2100
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0001_1092_2110 =
+ {0x1092, 0x2110, pci_subsys_12eb_0001_1092_2110, 0};
+#undef pci_ss_info_1092_2110
+#define pci_ss_info_1092_2110 pci_ss_info_12eb_0001_1092_2110
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0001_1092_2200 =
+ {0x1092, 0x2200, pci_subsys_12eb_0001_1092_2200, 0};
+#undef pci_ss_info_1092_2200
+#define pci_ss_info_1092_2200 pci_ss_info_12eb_0001_1092_2200
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_12eb_0001_122d_1002 =
+ {0x122d, 0x1002, pci_subsys_12eb_0001_122d_1002, 0};
+#undef pci_ss_info_122d_1002
+#define pci_ss_info_122d_1002 pci_ss_info_12eb_0001_122d_1002
+static const pciSubsystemInfo pci_ss_info_12eb_0001_12eb_0001 =
+ {0x12eb, 0x0001, pci_subsys_12eb_0001_12eb_0001, 0};
+#undef pci_ss_info_12eb_0001
+#define pci_ss_info_12eb_0001 pci_ss_info_12eb_0001_12eb_0001
+static const pciSubsystemInfo pci_ss_info_12eb_0001_5053_3355 =
+ {0x5053, 0x3355, pci_subsys_12eb_0001_5053_3355, 0};
+#undef pci_ss_info_5053_3355
+#define pci_ss_info_5053_3355 pci_ss_info_12eb_0001_5053_3355
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0002_104d_8049 =
+ {0x104d, 0x8049, pci_subsys_12eb_0002_104d_8049, 0};
+#undef pci_ss_info_104d_8049
+#define pci_ss_info_104d_8049 pci_ss_info_12eb_0002_104d_8049
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0002_104d_807b =
+ {0x104d, 0x807b, pci_subsys_12eb_0002_104d_807b, 0};
+#undef pci_ss_info_104d_807b
+#define pci_ss_info_104d_807b pci_ss_info_12eb_0002_104d_807b
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3000 =
+ {0x1092, 0x3000, pci_subsys_12eb_0002_1092_3000, 0};
+#undef pci_ss_info_1092_3000
+#define pci_ss_info_1092_3000 pci_ss_info_12eb_0002_1092_3000
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3001 =
+ {0x1092, 0x3001, pci_subsys_12eb_0002_1092_3001, 0};
+#undef pci_ss_info_1092_3001
+#define pci_ss_info_1092_3001 pci_ss_info_12eb_0002_1092_3001
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3002 =
+ {0x1092, 0x3002, pci_subsys_12eb_0002_1092_3002, 0};
+#undef pci_ss_info_1092_3002
+#define pci_ss_info_1092_3002 pci_ss_info_12eb_0002_1092_3002
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3003 =
+ {0x1092, 0x3003, pci_subsys_12eb_0002_1092_3003, 0};
+#undef pci_ss_info_1092_3003
+#define pci_ss_info_1092_3003 pci_ss_info_12eb_0002_1092_3003
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0002_1092_3004 =
+ {0x1092, 0x3004, pci_subsys_12eb_0002_1092_3004, 0};
+#undef pci_ss_info_1092_3004
+#define pci_ss_info_1092_3004 pci_ss_info_12eb_0002_1092_3004
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_12eb_0002_12eb_0001 =
+ {0x12eb, 0x0001, pci_subsys_12eb_0002_12eb_0001, 0};
+#undef pci_ss_info_12eb_0001
+#define pci_ss_info_12eb_0001 pci_ss_info_12eb_0002_12eb_0001
+static const pciSubsystemInfo pci_ss_info_12eb_0002_12eb_0002 =
+ {0x12eb, 0x0002, pci_subsys_12eb_0002_12eb_0002, 0};
+#undef pci_ss_info_12eb_0002
+#define pci_ss_info_12eb_0002 pci_ss_info_12eb_0002_12eb_0002
+static const pciSubsystemInfo pci_ss_info_12eb_0002_12eb_0088 =
+ {0x12eb, 0x0088, pci_subsys_12eb_0002_12eb_0088, 0};
+#undef pci_ss_info_12eb_0088
+#define pci_ss_info_12eb_0088 pci_ss_info_12eb_0002_12eb_0088
+static const pciSubsystemInfo pci_ss_info_12eb_0002_144d_3510 =
+ {0x144d, 0x3510, pci_subsys_12eb_0002_144d_3510, 0};
+#undef pci_ss_info_144d_3510
+#define pci_ss_info_144d_3510 pci_ss_info_12eb_0002_144d_3510
+static const pciSubsystemInfo pci_ss_info_12eb_0002_5053_3356 =
+ {0x5053, 0x3356, pci_subsys_12eb_0002_5053_3356, 0};
+#undef pci_ss_info_5053_3356
+#define pci_ss_info_5053_3356 pci_ss_info_12eb_0002_5053_3356
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0003_104d_8049 =
+ {0x104d, 0x8049, pci_subsys_12eb_0003_104d_8049, 0};
+#undef pci_ss_info_104d_8049
+#define pci_ss_info_104d_8049 pci_ss_info_12eb_0003_104d_8049
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_12eb_0003_104d_8077 =
+ {0x104d, 0x8077, pci_subsys_12eb_0003_104d_8077, 0};
+#undef pci_ss_info_104d_8077
+#define pci_ss_info_104d_8077 pci_ss_info_12eb_0003_104d_8077
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_12eb_0003_109f_1000 =
+ {0x109f, 0x1000, pci_subsys_12eb_0003_109f_1000, 0};
+#undef pci_ss_info_109f_1000
+#define pci_ss_info_109f_1000 pci_ss_info_12eb_0003_109f_1000
+static const pciSubsystemInfo pci_ss_info_12eb_0003_12eb_0003 =
+ {0x12eb, 0x0003, pci_subsys_12eb_0003_12eb_0003, 0};
+#undef pci_ss_info_12eb_0003
+#define pci_ss_info_12eb_0003 pci_ss_info_12eb_0003_12eb_0003
+static const pciSubsystemInfo pci_ss_info_12eb_0003_1462_6780 =
+ {0x1462, 0x6780, pci_subsys_12eb_0003_1462_6780, 0};
+#undef pci_ss_info_1462_6780
+#define pci_ss_info_1462_6780 pci_ss_info_12eb_0003_1462_6780
+static const pciSubsystemInfo pci_ss_info_12eb_0003_14a4_2073 =
+ {0x14a4, 0x2073, pci_subsys_12eb_0003_14a4_2073, 0};
+#undef pci_ss_info_14a4_2073
+#define pci_ss_info_14a4_2073 pci_ss_info_12eb_0003_14a4_2073
+static const pciSubsystemInfo pci_ss_info_12eb_0003_14a4_2091 =
+ {0x14a4, 0x2091, pci_subsys_12eb_0003_14a4_2091, 0};
+#undef pci_ss_info_14a4_2091
+#define pci_ss_info_14a4_2091 pci_ss_info_12eb_0003_14a4_2091
+static const pciSubsystemInfo pci_ss_info_12eb_0003_14a4_2104 =
+ {0x14a4, 0x2104, pci_subsys_12eb_0003_14a4_2104, 0};
+#undef pci_ss_info_14a4_2104
+#define pci_ss_info_14a4_2104 pci_ss_info_12eb_0003_14a4_2104
+static const pciSubsystemInfo pci_ss_info_12eb_0003_14a4_2106 =
+ {0x14a4, 0x2106, pci_subsys_12eb_0003_14a4_2106, 0};
+#undef pci_ss_info_14a4_2106
+#define pci_ss_info_14a4_2106 pci_ss_info_12eb_0003_14a4_2106
+static const pciSubsystemInfo pci_ss_info_12eb_8803_12eb_8803 =
+ {0x12eb, 0x8803, pci_subsys_12eb_8803_12eb_8803, 0};
+#undef pci_ss_info_12eb_8803
+#define pci_ss_info_12eb_8803 pci_ss_info_12eb_8803_12eb_8803
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1308_0001_1308_0001 =
+ {0x1308, 0x0001, pci_subsys_1308_0001_1308_0001, 0};
+#undef pci_ss_info_1308_0001
+#define pci_ss_info_1308_0001 pci_ss_info_1308_0001_1308_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_131f_2030_131f_2030 =
+ {0x131f, 0x2030, pci_subsys_131f_2030_131f_2030, 0};
+#undef pci_ss_info_131f_2030
+#define pci_ss_info_131f_2030 pci_ss_info_131f_2030_131f_2030
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_134d_7891_134d_0001 =
+ {0x134d, 0x0001, pci_subsys_134d_7891_134d_0001, 0};
+#undef pci_ss_info_134d_0001
+#define pci_ss_info_134d_0001 pci_ss_info_134d_7891_134d_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1394_0001_1394_0001 =
+ {0x1394, 0x0001, pci_subsys_1394_0001_1394_0001, 0};
+#undef pci_ss_info_1394_0001
+#define pci_ss_info_1394_0001 pci_ss_info_1394_0001_1394_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1397_2bd0_1397_2bd0 =
+ {0x1397, 0x2bd0, pci_subsys_1397_2bd0_1397_2bd0, 0};
+#undef pci_ss_info_1397_2bd0
+#define pci_ss_info_1397_2bd0 pci_ss_info_1397_2bd0_1397_2bd0
+static const pciSubsystemInfo pci_ss_info_1397_2bd0_e4bf_1000 =
+ {0xe4bf, 0x1000, pci_subsys_1397_2bd0_e4bf_1000, 0};
+#undef pci_ss_info_e4bf_1000
+#define pci_ss_info_e4bf_1000 pci_ss_info_1397_2bd0_e4bf_1000
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_13df_0001_13df_0001 =
+ {0x13df, 0x0001, pci_subsys_13df_0001_13df_0001, 0};
+#undef pci_ss_info_13df_0001
+#define pci_ss_info_13df_0001 pci_ss_info_13df_0001_13df_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_13f6_0100_13f6_ffff =
+ {0x13f6, 0xffff, pci_subsys_13f6_0100_13f6_ffff, 0};
+#undef pci_ss_info_13f6_ffff
+#define pci_ss_info_13f6_ffff pci_ss_info_13f6_0100_13f6_ffff
+static const pciSubsystemInfo pci_ss_info_13f6_0101_13f6_0101 =
+ {0x13f6, 0x0101, pci_subsys_13f6_0101_13f6_0101, 0};
+#undef pci_ss_info_13f6_0101
+#define pci_ss_info_13f6_0101 pci_ss_info_13f6_0101_13f6_0101
+static const pciSubsystemInfo pci_ss_info_13f6_0111_1019_0970 =
+ {0x1019, 0x0970, pci_subsys_13f6_0111_1019_0970, 0};
+#undef pci_ss_info_1019_0970
+#define pci_ss_info_1019_0970 pci_ss_info_13f6_0111_1019_0970
+static const pciSubsystemInfo pci_ss_info_13f6_0111_1043_8077 =
+ {0x1043, 0x8077, pci_subsys_13f6_0111_1043_8077, 0};
+#undef pci_ss_info_1043_8077
+#define pci_ss_info_1043_8077 pci_ss_info_13f6_0111_1043_8077
+static const pciSubsystemInfo pci_ss_info_13f6_0111_1043_80e2 =
+ {0x1043, 0x80e2, pci_subsys_13f6_0111_1043_80e2, 0};
+#undef pci_ss_info_1043_80e2
+#define pci_ss_info_1043_80e2 pci_ss_info_13f6_0111_1043_80e2
+static const pciSubsystemInfo pci_ss_info_13f6_0111_13f6_0111 =
+ {0x13f6, 0x0111, pci_subsys_13f6_0111_13f6_0111, 0};
+#undef pci_ss_info_13f6_0111
+#define pci_ss_info_13f6_0111 pci_ss_info_13f6_0111_13f6_0111
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1415_9501_15ed_2000 =
+ {0x15ed, 0x2000, pci_subsys_1415_9501_15ed_2000, 0};
+#undef pci_ss_info_15ed_2000
+#define pci_ss_info_15ed_2000 pci_ss_info_1415_9501_15ed_2000
+static const pciSubsystemInfo pci_ss_info_1415_9501_15ed_2001 =
+ {0x15ed, 0x2001, pci_subsys_1415_9501_15ed_2001, 0};
+#undef pci_ss_info_15ed_2001
+#define pci_ss_info_15ed_2001 pci_ss_info_1415_9501_15ed_2001
+static const pciSubsystemInfo pci_ss_info_1415_9511_15ed_2000 =
+ {0x15ed, 0x2000, pci_subsys_1415_9511_15ed_2000, 0};
+#undef pci_ss_info_15ed_2000
+#define pci_ss_info_15ed_2000 pci_ss_info_1415_9511_15ed_2000
+static const pciSubsystemInfo pci_ss_info_1415_9511_15ed_2001 =
+ {0x15ed, 0x2001, pci_subsys_1415_9511_15ed_2001, 0};
+#undef pci_ss_info_15ed_2001
+#define pci_ss_info_15ed_2001 pci_ss_info_1415_9511_15ed_2001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14e4_1644_1014_0277 =
+ {0x1014, 0x0277, pci_subsys_14e4_1644_1014_0277, 0};
+#undef pci_ss_info_1014_0277
+#define pci_ss_info_1014_0277 pci_ss_info_14e4_1644_1014_0277
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1644_1028_00d1 =
+ {0x1028, 0x00d1, pci_subsys_14e4_1644_1028_00d1, 0};
+#undef pci_ss_info_1028_00d1
+#define pci_ss_info_1028_00d1 pci_ss_info_14e4_1644_1028_00d1
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1644_1028_0106 =
+ {0x1028, 0x0106, pci_subsys_14e4_1644_1028_0106, 0};
+#undef pci_ss_info_1028_0106
+#define pci_ss_info_1028_0106 pci_ss_info_14e4_1644_1028_0106
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1644_1028_0109 =
+ {0x1028, 0x0109, pci_subsys_14e4_1644_1028_0109, 0};
+#undef pci_ss_info_1028_0109
+#define pci_ss_info_1028_0109 pci_ss_info_14e4_1644_1028_0109
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1644_1028_010a =
+ {0x1028, 0x010a, pci_subsys_14e4_1644_1028_010a, 0};
+#undef pci_ss_info_1028_010a
+#define pci_ss_info_1028_010a pci_ss_info_14e4_1644_1028_010a
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1000 =
+ {0x10b7, 0x1000, pci_subsys_14e4_1644_10b7_1000, 0};
+#undef pci_ss_info_10b7_1000
+#define pci_ss_info_10b7_1000 pci_ss_info_14e4_1644_10b7_1000
+static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1001 =
+ {0x10b7, 0x1001, pci_subsys_14e4_1644_10b7_1001, 0};
+#undef pci_ss_info_10b7_1001
+#define pci_ss_info_10b7_1001 pci_ss_info_14e4_1644_10b7_1001
+static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1002 =
+ {0x10b7, 0x1002, pci_subsys_14e4_1644_10b7_1002, 0};
+#undef pci_ss_info_10b7_1002
+#define pci_ss_info_10b7_1002 pci_ss_info_14e4_1644_10b7_1002
+static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1003 =
+ {0x10b7, 0x1003, pci_subsys_14e4_1644_10b7_1003, 0};
+#undef pci_ss_info_10b7_1003
+#define pci_ss_info_10b7_1003 pci_ss_info_14e4_1644_10b7_1003
+static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1004 =
+ {0x10b7, 0x1004, pci_subsys_14e4_1644_10b7_1004, 0};
+#undef pci_ss_info_10b7_1004
+#define pci_ss_info_10b7_1004 pci_ss_info_14e4_1644_10b7_1004
+static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1005 =
+ {0x10b7, 0x1005, pci_subsys_14e4_1644_10b7_1005, 0};
+#undef pci_ss_info_10b7_1005
+#define pci_ss_info_10b7_1005 pci_ss_info_14e4_1644_10b7_1005
+static const pciSubsystemInfo pci_ss_info_14e4_1644_10b7_1008 =
+ {0x10b7, 0x1008, pci_subsys_14e4_1644_10b7_1008, 0};
+#undef pci_ss_info_10b7_1008
+#define pci_ss_info_10b7_1008 pci_ss_info_14e4_1644_10b7_1008
+static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_0002 =
+ {0x14e4, 0x0002, pci_subsys_14e4_1644_14e4_0002, 0};
+#undef pci_ss_info_14e4_0002
+#define pci_ss_info_14e4_0002 pci_ss_info_14e4_1644_14e4_0002
+static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_0003 =
+ {0x14e4, 0x0003, pci_subsys_14e4_1644_14e4_0003, 0};
+#undef pci_ss_info_14e4_0003
+#define pci_ss_info_14e4_0003 pci_ss_info_14e4_1644_14e4_0003
+static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_0004 =
+ {0x14e4, 0x0004, pci_subsys_14e4_1644_14e4_0004, 0};
+#undef pci_ss_info_14e4_0004
+#define pci_ss_info_14e4_0004 pci_ss_info_14e4_1644_14e4_0004
+static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_1028 =
+ {0x14e4, 0x1028, pci_subsys_14e4_1644_14e4_1028, 0};
+#undef pci_ss_info_14e4_1028
+#define pci_ss_info_14e4_1028 pci_ss_info_14e4_1644_14e4_1028
+static const pciSubsystemInfo pci_ss_info_14e4_1644_14e4_1644 =
+ {0x14e4, 0x1644, pci_subsys_14e4_1644_14e4_1644, 0};
+#undef pci_ss_info_14e4_1644
+#define pci_ss_info_14e4_1644 pci_ss_info_14e4_1644_14e4_1644
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_007c =
+ {0x0e11, 0x007c, pci_subsys_14e4_1645_0e11_007c, 0};
+#undef pci_ss_info_0e11_007c
+#define pci_ss_info_0e11_007c pci_ss_info_14e4_1645_0e11_007c
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_007d =
+ {0x0e11, 0x007d, pci_subsys_14e4_1645_0e11_007d, 0};
+#undef pci_ss_info_0e11_007d
+#define pci_ss_info_0e11_007d pci_ss_info_14e4_1645_0e11_007d
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_0085 =
+ {0x0e11, 0x0085, pci_subsys_14e4_1645_0e11_0085, 0};
+#undef pci_ss_info_0e11_0085
+#define pci_ss_info_0e11_0085 pci_ss_info_14e4_1645_0e11_0085
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_0099 =
+ {0x0e11, 0x0099, pci_subsys_14e4_1645_0e11_0099, 0};
+#undef pci_ss_info_0e11_0099
+#define pci_ss_info_0e11_0099 pci_ss_info_14e4_1645_0e11_0099
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_009a =
+ {0x0e11, 0x009a, pci_subsys_14e4_1645_0e11_009a, 0};
+#undef pci_ss_info_0e11_009a
+#define pci_ss_info_0e11_009a pci_ss_info_14e4_1645_0e11_009a
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1645_0e11_00c1 =
+ {0x0e11, 0x00c1, pci_subsys_14e4_1645_0e11_00c1, 0};
+#undef pci_ss_info_0e11_00c1
+#define pci_ss_info_0e11_00c1 pci_ss_info_14e4_1645_0e11_00c1
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1645_1028_0121 =
+ {0x1028, 0x0121, pci_subsys_14e4_1645_1028_0121, 0};
+#undef pci_ss_info_1028_0121
+#define pci_ss_info_1028_0121 pci_ss_info_14e4_1645_1028_0121
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1004 =
+ {0x10b7, 0x1004, pci_subsys_14e4_1645_10b7_1004, 0};
+#undef pci_ss_info_10b7_1004
+#define pci_ss_info_10b7_1004 pci_ss_info_14e4_1645_10b7_1004
+static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1006 =
+ {0x10b7, 0x1006, pci_subsys_14e4_1645_10b7_1006, 0};
+#undef pci_ss_info_10b7_1006
+#define pci_ss_info_10b7_1006 pci_ss_info_14e4_1645_10b7_1006
+static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1007 =
+ {0x10b7, 0x1007, pci_subsys_14e4_1645_10b7_1007, 0};
+#undef pci_ss_info_10b7_1007
+#define pci_ss_info_10b7_1007 pci_ss_info_14e4_1645_10b7_1007
+static const pciSubsystemInfo pci_ss_info_14e4_1645_10b7_1008 =
+ {0x10b7, 0x1008, pci_subsys_14e4_1645_10b7_1008, 0};
+#undef pci_ss_info_10b7_1008
+#define pci_ss_info_10b7_1008 pci_ss_info_14e4_1645_10b7_1008
+static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0001 =
+ {0x14e4, 0x0001, pci_subsys_14e4_1645_14e4_0001, 0};
+#undef pci_ss_info_14e4_0001
+#define pci_ss_info_14e4_0001 pci_ss_info_14e4_1645_14e4_0001
+static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0005 =
+ {0x14e4, 0x0005, pci_subsys_14e4_1645_14e4_0005, 0};
+#undef pci_ss_info_14e4_0005
+#define pci_ss_info_14e4_0005 pci_ss_info_14e4_1645_14e4_0005
+static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0006 =
+ {0x14e4, 0x0006, pci_subsys_14e4_1645_14e4_0006, 0};
+#undef pci_ss_info_14e4_0006
+#define pci_ss_info_14e4_0006 pci_ss_info_14e4_1645_14e4_0006
+static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0007 =
+ {0x14e4, 0x0007, pci_subsys_14e4_1645_14e4_0007, 0};
+#undef pci_ss_info_14e4_0007
+#define pci_ss_info_14e4_0007 pci_ss_info_14e4_1645_14e4_0007
+static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_0008 =
+ {0x14e4, 0x0008, pci_subsys_14e4_1645_14e4_0008, 0};
+#undef pci_ss_info_14e4_0008
+#define pci_ss_info_14e4_0008 pci_ss_info_14e4_1645_14e4_0008
+static const pciSubsystemInfo pci_ss_info_14e4_1645_14e4_8008 =
+ {0x14e4, 0x8008, pci_subsys_14e4_1645_14e4_8008, 0};
+#undef pci_ss_info_14e4_8008
+#define pci_ss_info_14e4_8008 pci_ss_info_14e4_1645_14e4_8008
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1646_0e11_00bb =
+ {0x0e11, 0x00bb, pci_subsys_14e4_1646_0e11_00bb, 0};
+#undef pci_ss_info_0e11_00bb
+#define pci_ss_info_0e11_00bb pci_ss_info_14e4_1646_0e11_00bb
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1646_1028_0126 =
+ {0x1028, 0x0126, pci_subsys_14e4_1646_1028_0126, 0};
+#undef pci_ss_info_1028_0126
+#define pci_ss_info_1028_0126 pci_ss_info_14e4_1646_1028_0126
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14e4_1646_14e4_8009 =
+ {0x14e4, 0x8009, pci_subsys_14e4_1646_14e4_8009, 0};
+#undef pci_ss_info_14e4_8009
+#define pci_ss_info_14e4_8009 pci_ss_info_14e4_1646_14e4_8009
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1647_0e11_0099 =
+ {0x0e11, 0x0099, pci_subsys_14e4_1647_0e11_0099, 0};
+#undef pci_ss_info_0e11_0099
+#define pci_ss_info_0e11_0099 pci_ss_info_14e4_1647_0e11_0099
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1647_0e11_009a =
+ {0x0e11, 0x009a, pci_subsys_14e4_1647_0e11_009a, 0};
+#undef pci_ss_info_0e11_009a
+#define pci_ss_info_0e11_009a pci_ss_info_14e4_1647_0e11_009a
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_0009 =
+ {0x14e4, 0x0009, pci_subsys_14e4_1647_14e4_0009, 0};
+#undef pci_ss_info_14e4_0009
+#define pci_ss_info_14e4_0009 pci_ss_info_14e4_1647_14e4_0009
+static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_000a =
+ {0x14e4, 0x000a, pci_subsys_14e4_1647_14e4_000a, 0};
+#undef pci_ss_info_14e4_000a
+#define pci_ss_info_14e4_000a pci_ss_info_14e4_1647_14e4_000a
+static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_000b =
+ {0x14e4, 0x000b, pci_subsys_14e4_1647_14e4_000b, 0};
+#undef pci_ss_info_14e4_000b
+#define pci_ss_info_14e4_000b pci_ss_info_14e4_1647_14e4_000b
+static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_8009 =
+ {0x14e4, 0x8009, pci_subsys_14e4_1647_14e4_8009, 0};
+#undef pci_ss_info_14e4_8009
+#define pci_ss_info_14e4_8009 pci_ss_info_14e4_1647_14e4_8009
+static const pciSubsystemInfo pci_ss_info_14e4_1647_14e4_800a =
+ {0x14e4, 0x800a, pci_subsys_14e4_1647_14e4_800a, 0};
+#undef pci_ss_info_14e4_800a
+#define pci_ss_info_14e4_800a pci_ss_info_14e4_1647_14e4_800a
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1648_0e11_00cf =
+ {0x0e11, 0x00cf, pci_subsys_14e4_1648_0e11_00cf, 0};
+#undef pci_ss_info_0e11_00cf
+#define pci_ss_info_0e11_00cf pci_ss_info_14e4_1648_0e11_00cf
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1648_0e11_00d0 =
+ {0x0e11, 0x00d0, pci_subsys_14e4_1648_0e11_00d0, 0};
+#undef pci_ss_info_0e11_00d0
+#define pci_ss_info_0e11_00d0 pci_ss_info_14e4_1648_0e11_00d0
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_1648_0e11_00d1 =
+ {0x0e11, 0x00d1, pci_subsys_14e4_1648_0e11_00d1, 0};
+#undef pci_ss_info_0e11_00d1
+#define pci_ss_info_0e11_00d1 pci_ss_info_14e4_1648_0e11_00d1
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14e4_1648_10b7_2000 =
+ {0x10b7, 0x2000, pci_subsys_14e4_1648_10b7_2000, 0};
+#undef pci_ss_info_10b7_2000
+#define pci_ss_info_10b7_2000 pci_ss_info_14e4_1648_10b7_2000
+static const pciSubsystemInfo pci_ss_info_14e4_1648_10b7_3000 =
+ {0x10b7, 0x3000, pci_subsys_14e4_1648_10b7_3000, 0};
+#undef pci_ss_info_10b7_3000
+#define pci_ss_info_10b7_3000 pci_ss_info_14e4_1648_10b7_3000
+static const pciSubsystemInfo pci_ss_info_14e4_1648_1166_1648 =
+ {0x1166, 0x1648, pci_subsys_14e4_1648_1166_1648, 0};
+#undef pci_ss_info_1166_1648
+#define pci_ss_info_1166_1648 pci_ss_info_14e4_1648_1166_1648
+static const pciSubsystemInfo pci_ss_info_14e4_1696_14e4_000d =
+ {0x14e4, 0x000d, pci_subsys_14e4_1696_14e4_000d, 0};
+#undef pci_ss_info_14e4_000d
+#define pci_ss_info_14e4_000d pci_ss_info_14e4_1696_14e4_000d
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_16a6_0e11_00bb =
+ {0x0e11, 0x00bb, pci_subsys_14e4_16a6_0e11_00bb, 0};
+#undef pci_ss_info_0e11_00bb
+#define pci_ss_info_0e11_00bb pci_ss_info_14e4_16a6_0e11_00bb
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_16a6_1028_0126 =
+ {0x1028, 0x0126, pci_subsys_14e4_16a6_1028_0126, 0};
+#undef pci_ss_info_1028_0126
+#define pci_ss_info_1028_0126 pci_ss_info_14e4_16a6_1028_0126
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14e4_16a6_14e4_000c =
+ {0x14e4, 0x000c, pci_subsys_14e4_16a6_14e4_000c, 0};
+#undef pci_ss_info_14e4_000c
+#define pci_ss_info_14e4_000c pci_ss_info_14e4_16a6_14e4_000c
+static const pciSubsystemInfo pci_ss_info_14e4_16a6_14e4_8009 =
+ {0x14e4, 0x8009, pci_subsys_14e4_16a6_14e4_8009, 0};
+#undef pci_ss_info_14e4_8009
+#define pci_ss_info_14e4_8009 pci_ss_info_14e4_16a6_14e4_8009
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_16a7_0e11_00ca =
+ {0x0e11, 0x00ca, pci_subsys_14e4_16a7_0e11_00ca, 0};
+#undef pci_ss_info_0e11_00ca
+#define pci_ss_info_0e11_00ca pci_ss_info_14e4_16a7_0e11_00ca
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14e4_16a7_0e11_00cb =
+ {0x0e11, 0x00cb, pci_subsys_14e4_16a7_0e11_00cb, 0};
+#undef pci_ss_info_0e11_00cb
+#define pci_ss_info_0e11_00cb pci_ss_info_14e4_16a7_0e11_00cb
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14e4_16a7_14e4_0009 =
+ {0x14e4, 0x0009, pci_subsys_14e4_16a7_14e4_0009, 0};
+#undef pci_ss_info_14e4_0009
+#define pci_ss_info_14e4_0009 pci_ss_info_14e4_16a7_14e4_0009
+static const pciSubsystemInfo pci_ss_info_14e4_16a7_14e4_000a =
+ {0x14e4, 0x000a, pci_subsys_14e4_16a7_14e4_000a, 0};
+#undef pci_ss_info_14e4_000a
+#define pci_ss_info_14e4_000a pci_ss_info_14e4_16a7_14e4_000a
+static const pciSubsystemInfo pci_ss_info_14e4_16a7_14e4_000b =
+ {0x14e4, 0x000b, pci_subsys_14e4_16a7_14e4_000b, 0};
+#undef pci_ss_info_14e4_000b
+#define pci_ss_info_14e4_000b pci_ss_info_14e4_16a7_14e4_000b
+static const pciSubsystemInfo pci_ss_info_14e4_16a7_14e4_800a =
+ {0x14e4, 0x800a, pci_subsys_14e4_16a7_14e4_800a, 0};
+#undef pci_ss_info_14e4_800a
+#define pci_ss_info_14e4_800a pci_ss_info_14e4_16a7_14e4_800a
+static const pciSubsystemInfo pci_ss_info_14e4_16a8_10b7_2001 =
+ {0x10b7, 0x2001, pci_subsys_14e4_16a8_10b7_2001, 0};
+#undef pci_ss_info_10b7_2001
+#define pci_ss_info_10b7_2001 pci_ss_info_14e4_16a8_10b7_2001
+static const pciSubsystemInfo pci_ss_info_14e4_16c6_10b7_1100 =
+ {0x10b7, 0x1100, pci_subsys_14e4_16c6_10b7_1100, 0};
+#undef pci_ss_info_10b7_1100
+#define pci_ss_info_10b7_1100 pci_ss_info_14e4_16c6_10b7_1100
+static const pciSubsystemInfo pci_ss_info_14e4_16c6_14e4_000c =
+ {0x14e4, 0x000c, pci_subsys_14e4_16c6_14e4_000c, 0};
+#undef pci_ss_info_14e4_000c
+#define pci_ss_info_14e4_000c pci_ss_info_14e4_16c6_14e4_000c
+static const pciSubsystemInfo pci_ss_info_14e4_16c6_14e4_8009 =
+ {0x14e4, 0x8009, pci_subsys_14e4_16c6_14e4_8009, 0};
+#undef pci_ss_info_14e4_8009
+#define pci_ss_info_14e4_8009 pci_ss_info_14e4_16c6_14e4_8009
+static const pciSubsystemInfo pci_ss_info_14e4_16c7_14e4_0009 =
+ {0x14e4, 0x0009, pci_subsys_14e4_16c7_14e4_0009, 0};
+#undef pci_ss_info_14e4_0009
+#define pci_ss_info_14e4_0009 pci_ss_info_14e4_16c7_14e4_0009
+static const pciSubsystemInfo pci_ss_info_14e4_16c7_14e4_000a =
+ {0x14e4, 0x000a, pci_subsys_14e4_16c7_14e4_000a, 0};
+#undef pci_ss_info_14e4_000a
+#define pci_ss_info_14e4_000a pci_ss_info_14e4_16c7_14e4_000a
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_1033_1033_8077 =
+ {0x1033, 0x8077, pci_subsys_14f1_1033_1033_8077, 0};
+#undef pci_ss_info_1033_8077
+#define pci_ss_info_1033_8077 pci_ss_info_14f1_1033_1033_8077
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14f1_1033_122d_4027 =
+ {0x122d, 0x4027, pci_subsys_14f1_1033_122d_4027, 0};
+#undef pci_ss_info_122d_4027
+#define pci_ss_info_122d_4027 pci_ss_info_14f1_1033_122d_4027
+static const pciSubsystemInfo pci_ss_info_14f1_1033_122d_4030 =
+ {0x122d, 0x4030, pci_subsys_14f1_1033_122d_4030, 0};
+#undef pci_ss_info_122d_4030
+#define pci_ss_info_122d_4030 pci_ss_info_14f1_1033_122d_4030
+static const pciSubsystemInfo pci_ss_info_14f1_1033_122d_4034 =
+ {0x122d, 0x4034, pci_subsys_14f1_1033_122d_4034, 0};
+#undef pci_ss_info_122d_4034
+#define pci_ss_info_122d_4034 pci_ss_info_14f1_1033_122d_4034
+static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_020d =
+ {0x13e0, 0x020d, pci_subsys_14f1_1033_13e0_020d, 0};
+#undef pci_ss_info_13e0_020d
+#define pci_ss_info_13e0_020d pci_ss_info_14f1_1033_13e0_020d
+static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_020e =
+ {0x13e0, 0x020e, pci_subsys_14f1_1033_13e0_020e, 0};
+#undef pci_ss_info_13e0_020e
+#define pci_ss_info_13e0_020e pci_ss_info_14f1_1033_13e0_020e
+static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_0261 =
+ {0x13e0, 0x0261, pci_subsys_14f1_1033_13e0_0261, 0};
+#undef pci_ss_info_13e0_0261
+#define pci_ss_info_13e0_0261 pci_ss_info_14f1_1033_13e0_0261
+static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_0290 =
+ {0x13e0, 0x0290, pci_subsys_14f1_1033_13e0_0290, 0};
+#undef pci_ss_info_13e0_0290
+#define pci_ss_info_13e0_0290 pci_ss_info_14f1_1033_13e0_0290
+static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_02a0 =
+ {0x13e0, 0x02a0, pci_subsys_14f1_1033_13e0_02a0, 0};
+#undef pci_ss_info_13e0_02a0
+#define pci_ss_info_13e0_02a0 pci_ss_info_14f1_1033_13e0_02a0
+static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_02b0 =
+ {0x13e0, 0x02b0, pci_subsys_14f1_1033_13e0_02b0, 0};
+#undef pci_ss_info_13e0_02b0
+#define pci_ss_info_13e0_02b0 pci_ss_info_14f1_1033_13e0_02b0
+static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_02c0 =
+ {0x13e0, 0x02c0, pci_subsys_14f1_1033_13e0_02c0, 0};
+#undef pci_ss_info_13e0_02c0
+#define pci_ss_info_13e0_02c0 pci_ss_info_14f1_1033_13e0_02c0
+static const pciSubsystemInfo pci_ss_info_14f1_1033_13e0_02d0 =
+ {0x13e0, 0x02d0, pci_subsys_14f1_1033_13e0_02d0, 0};
+#undef pci_ss_info_13e0_02d0
+#define pci_ss_info_13e0_02d0 pci_ss_info_14f1_1033_13e0_02d0
+static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_1500 =
+ {0x144f, 0x1500, pci_subsys_14f1_1033_144f_1500, 0};
+#undef pci_ss_info_144f_1500
+#define pci_ss_info_144f_1500 pci_ss_info_14f1_1033_144f_1500
+static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_1501 =
+ {0x144f, 0x1501, pci_subsys_14f1_1033_144f_1501, 0};
+#undef pci_ss_info_144f_1501
+#define pci_ss_info_144f_1501 pci_ss_info_14f1_1033_144f_1501
+static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_150a =
+ {0x144f, 0x150a, pci_subsys_14f1_1033_144f_150a, 0};
+#undef pci_ss_info_144f_150a
+#define pci_ss_info_144f_150a pci_ss_info_14f1_1033_144f_150a
+static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_150b =
+ {0x144f, 0x150b, pci_subsys_14f1_1033_144f_150b, 0};
+#undef pci_ss_info_144f_150b
+#define pci_ss_info_144f_150b pci_ss_info_14f1_1033_144f_150b
+static const pciSubsystemInfo pci_ss_info_14f1_1033_144f_1510 =
+ {0x144f, 0x1510, pci_subsys_14f1_1033_144f_1510, 0};
+#undef pci_ss_info_144f_1510
+#define pci_ss_info_144f_1510 pci_ss_info_14f1_1033_144f_1510
+static const pciSubsystemInfo pci_ss_info_14f1_1035_10cf_1098 =
+ {0x10cf, 0x1098, pci_subsys_14f1_1035_10cf_1098, 0};
+#undef pci_ss_info_10cf_1098
+#define pci_ss_info_10cf_1098 pci_ss_info_14f1_1035_10cf_1098
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_1036_104d_8067 =
+ {0x104d, 0x8067, pci_subsys_14f1_1036_104d_8067, 0};
+#undef pci_ss_info_104d_8067
+#define pci_ss_info_104d_8067 pci_ss_info_14f1_1036_104d_8067
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14f1_1036_122d_4029 =
+ {0x122d, 0x4029, pci_subsys_14f1_1036_122d_4029, 0};
+#undef pci_ss_info_122d_4029
+#define pci_ss_info_122d_4029 pci_ss_info_14f1_1036_122d_4029
+static const pciSubsystemInfo pci_ss_info_14f1_1036_122d_4031 =
+ {0x122d, 0x4031, pci_subsys_14f1_1036_122d_4031, 0};
+#undef pci_ss_info_122d_4031
+#define pci_ss_info_122d_4031 pci_ss_info_14f1_1036_122d_4031
+static const pciSubsystemInfo pci_ss_info_14f1_1036_13e0_0209 =
+ {0x13e0, 0x0209, pci_subsys_14f1_1036_13e0_0209, 0};
+#undef pci_ss_info_13e0_0209
+#define pci_ss_info_13e0_0209 pci_ss_info_14f1_1036_13e0_0209
+static const pciSubsystemInfo pci_ss_info_14f1_1036_13e0_020a =
+ {0x13e0, 0x020a, pci_subsys_14f1_1036_13e0_020a, 0};
+#undef pci_ss_info_13e0_020a
+#define pci_ss_info_13e0_020a pci_ss_info_14f1_1036_13e0_020a
+static const pciSubsystemInfo pci_ss_info_14f1_1036_13e0_0260 =
+ {0x13e0, 0x0260, pci_subsys_14f1_1036_13e0_0260, 0};
+#undef pci_ss_info_13e0_0260
+#define pci_ss_info_13e0_0260 pci_ss_info_14f1_1036_13e0_0260
+static const pciSubsystemInfo pci_ss_info_14f1_1036_13e0_0270 =
+ {0x13e0, 0x0270, pci_subsys_14f1_1036_13e0_0270, 0};
+#undef pci_ss_info_13e0_0270
+#define pci_ss_info_13e0_0270 pci_ss_info_14f1_1036_13e0_0270
+static const pciSubsystemInfo pci_ss_info_14f1_1066_122d_4033 =
+ {0x122d, 0x4033, pci_subsys_14f1_1066_122d_4033, 0};
+#undef pci_ss_info_122d_4033
+#define pci_ss_info_122d_4033 pci_ss_info_14f1_1066_122d_4033
+static const pciSubsystemInfo pci_ss_info_14f1_1453_13e0_0240 =
+ {0x13e0, 0x0240, pci_subsys_14f1_1453_13e0_0240, 0};
+#undef pci_ss_info_13e0_0240
+#define pci_ss_info_13e0_0240 pci_ss_info_14f1_1453_13e0_0240
+static const pciSubsystemInfo pci_ss_info_14f1_1453_13e0_0250 =
+ {0x13e0, 0x0250, pci_subsys_14f1_1453_13e0_0250, 0};
+#undef pci_ss_info_13e0_0250
+#define pci_ss_info_13e0_0250 pci_ss_info_14f1_1453_13e0_0250
+static const pciSubsystemInfo pci_ss_info_14f1_1453_144f_1502 =
+ {0x144f, 0x1502, pci_subsys_14f1_1453_144f_1502, 0};
+#undef pci_ss_info_144f_1502
+#define pci_ss_info_144f_1502 pci_ss_info_14f1_1453_144f_1502
+static const pciSubsystemInfo pci_ss_info_14f1_1453_144f_1503 =
+ {0x144f, 0x1503, pci_subsys_14f1_1453_144f_1503, 0};
+#undef pci_ss_info_144f_1503
+#define pci_ss_info_144f_1503 pci_ss_info_14f1_1453_144f_1503
+static const pciSubsystemInfo pci_ss_info_14f1_1456_122d_4035 =
+ {0x122d, 0x4035, pci_subsys_14f1_1456_122d_4035, 0};
+#undef pci_ss_info_122d_4035
+#define pci_ss_info_122d_4035 pci_ss_info_14f1_1456_122d_4035
+static const pciSubsystemInfo pci_ss_info_14f1_1456_122d_4302 =
+ {0x122d, 0x4302, pci_subsys_14f1_1456_122d_4302, 0};
+#undef pci_ss_info_122d_4302
+#define pci_ss_info_122d_4302 pci_ss_info_14f1_1456_122d_4302
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_1803_0e11_0023 =
+ {0x0e11, 0x0023, pci_subsys_14f1_1803_0e11_0023, 0};
+#undef pci_ss_info_0e11_0023
+#define pci_ss_info_0e11_0023 pci_ss_info_14f1_1803_0e11_0023
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_1803_0e11_0043 =
+ {0x0e11, 0x0043, pci_subsys_14f1_1803_0e11_0043, 0};
+#undef pci_ss_info_0e11_0043
+#define pci_ss_info_0e11_0043 pci_ss_info_14f1_1803_0e11_0043
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_1815_0e11_0022 =
+ {0x0e11, 0x0022, pci_subsys_14f1_1815_0e11_0022, 0};
+#undef pci_ss_info_0e11_0022
+#define pci_ss_info_0e11_0022 pci_ss_info_14f1_1815_0e11_0022
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_1815_0e11_0042 =
+ {0x0e11, 0x0042, pci_subsys_14f1_1815_0e11_0042, 0};
+#undef pci_ss_info_0e11_0042
+#define pci_ss_info_0e11_0042 pci_ss_info_14f1_1815_0e11_0042
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2013_0e11_b195 =
+ {0x0e11, 0xb195, pci_subsys_14f1_2013_0e11_b195, 0};
+#undef pci_ss_info_0e11_b195
+#define pci_ss_info_0e11_b195 pci_ss_info_14f1_2013_0e11_b195
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2013_0e11_b196 =
+ {0x0e11, 0xb196, pci_subsys_14f1_2013_0e11_b196, 0};
+#undef pci_ss_info_0e11_b196
+#define pci_ss_info_0e11_b196 pci_ss_info_14f1_2013_0e11_b196
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2013_0e11_b1be =
+ {0x0e11, 0xb1be, pci_subsys_14f1_2013_0e11_b1be, 0};
+#undef pci_ss_info_0e11_b1be
+#define pci_ss_info_0e11_b1be pci_ss_info_14f1_2013_0e11_b1be
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2013_1025_8013 =
+ {0x1025, 0x8013, pci_subsys_14f1_2013_1025_8013, 0};
+#undef pci_ss_info_1025_8013
+#define pci_ss_info_1025_8013 pci_ss_info_14f1_2013_1025_8013
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2013_1033_809d =
+ {0x1033, 0x809d, pci_subsys_14f1_2013_1033_809d, 0};
+#undef pci_ss_info_1033_809d
+#define pci_ss_info_1033_809d pci_ss_info_14f1_2013_1033_809d
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2013_1033_80bc =
+ {0x1033, 0x80bc, pci_subsys_14f1_2013_1033_80bc, 0};
+#undef pci_ss_info_1033_80bc
+#define pci_ss_info_1033_80bc pci_ss_info_14f1_2013_1033_80bc
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14f1_2013_155d_6793 =
+ {0x155d, 0x6793, pci_subsys_14f1_2013_155d_6793, 0};
+#undef pci_ss_info_155d_6793
+#define pci_ss_info_155d_6793 pci_ss_info_14f1_2013_155d_6793
+static const pciSubsystemInfo pci_ss_info_14f1_2013_155d_8850 =
+ {0x155d, 0x8850, pci_subsys_14f1_2013_155d_8850, 0};
+#undef pci_ss_info_155d_8850
+#define pci_ss_info_155d_8850 pci_ss_info_14f1_2013_155d_8850
+static const pciSubsystemInfo pci_ss_info_14f1_2093_155d_2f07 =
+ {0x155d, 0x2f07, pci_subsys_14f1_2093_155d_2f07, 0};
+#undef pci_ss_info_155d_2f07
+#define pci_ss_info_155d_2f07 pci_ss_info_14f1_2093_155d_2f07
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2443_104d_8075 =
+ {0x104d, 0x8075, pci_subsys_14f1_2443_104d_8075, 0};
+#undef pci_ss_info_104d_8075
+#define pci_ss_info_104d_8075 pci_ss_info_14f1_2443_104d_8075
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2443_104d_8083 =
+ {0x104d, 0x8083, pci_subsys_14f1_2443_104d_8083, 0};
+#undef pci_ss_info_104d_8083
+#define pci_ss_info_104d_8083 pci_ss_info_14f1_2443_104d_8083
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_14f1_2443_104d_8097 =
+ {0x104d, 0x8097, pci_subsys_14f1_2443_104d_8097, 0};
+#undef pci_ss_info_104d_8097
+#define pci_ss_info_104d_8097 pci_ss_info_14f1_2443_104d_8097
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_14f1_2f00_13e0_8d84 =
+ {0x13e0, 0x8d84, pci_subsys_14f1_2f00_13e0_8d84, 0};
+#undef pci_ss_info_13e0_8d84
+#define pci_ss_info_13e0_8d84 pci_ss_info_14f1_2f00_13e0_8d84
+static const pciSubsystemInfo pci_ss_info_14f1_2f00_13e0_8d85 =
+ {0x13e0, 0x8d85, pci_subsys_14f1_2f00_13e0_8d85, 0};
+#undef pci_ss_info_13e0_8d85
+#define pci_ss_info_13e0_8d85 pci_ss_info_14f1_2f00_13e0_8d85
+static const pciSubsystemInfo pci_ss_info_14f1_2f00_14f1_2004 =
+ {0x14f1, 0x2004, pci_subsys_14f1_2f00_14f1_2004, 0};
+#undef pci_ss_info_14f1_2004
+#define pci_ss_info_14f1_2004 pci_ss_info_14f1_2f00_14f1_2004
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1516_0803_1320_10bd =
+ {0x1320, 0x10bd, pci_subsys_1516_0803_1320_10bd, 0};
+#undef pci_ss_info_1320_10bd
+#define pci_ss_info_1320_10bd pci_ss_info_1516_0803_1320_10bd
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0200 =
+ {0x1522, 0x0200, pci_subsys_1522_0100_1522_0200, 0};
+#undef pci_ss_info_1522_0200
+#define pci_ss_info_1522_0200 pci_ss_info_1522_0100_1522_0200
+static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0300 =
+ {0x1522, 0x0300, pci_subsys_1522_0100_1522_0300, 0};
+#undef pci_ss_info_1522_0300
+#define pci_ss_info_1522_0300 pci_ss_info_1522_0100_1522_0300
+static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0400 =
+ {0x1522, 0x0400, pci_subsys_1522_0100_1522_0400, 0};
+#undef pci_ss_info_1522_0400
+#define pci_ss_info_1522_0400 pci_ss_info_1522_0100_1522_0400
+static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0500 =
+ {0x1522, 0x0500, pci_subsys_1522_0100_1522_0500, 0};
+#undef pci_ss_info_1522_0500
+#define pci_ss_info_1522_0500 pci_ss_info_1522_0100_1522_0500
+static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0600 =
+ {0x1522, 0x0600, pci_subsys_1522_0100_1522_0600, 0};
+#undef pci_ss_info_1522_0600
+#define pci_ss_info_1522_0600 pci_ss_info_1522_0100_1522_0600
+static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0700 =
+ {0x1522, 0x0700, pci_subsys_1522_0100_1522_0700, 0};
+#undef pci_ss_info_1522_0700
+#define pci_ss_info_1522_0700 pci_ss_info_1522_0100_1522_0700
+static const pciSubsystemInfo pci_ss_info_1522_0100_1522_0800 =
+ {0x1522, 0x0800, pci_subsys_1522_0100_1522_0800, 0};
+#undef pci_ss_info_1522_0800
+#define pci_ss_info_1522_0800 pci_ss_info_1522_0100_1522_0800
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_173b_03ea_173b_0001 =
+ {0x173b, 0x0001, pci_subsys_173b_03ea_173b_0001, 0};
+#undef pci_ss_info_173b_0001
+#define pci_ss_info_173b_0001 pci_ss_info_173b_03ea_173b_0001
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_1813_4000_16be_0001 =
+ {0x16be, 0x0001, pci_subsys_1813_4000_16be_0001, 0};
+#undef pci_ss_info_16be_0001
+#define pci_ss_info_16be_0001 pci_ss_info_1813_4000_16be_0001
+static const pciSubsystemInfo pci_ss_info_1813_4100_16be_0002 =
+ {0x16be, 0x0002, pci_subsys_1813_4100_16be_0002, 0};
+#undef pci_ss_info_16be_0002
+#define pci_ss_info_16be_0002 pci_ss_info_1813_4100_16be_0002
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_3388_8011_3388_8011 =
+ {0x3388, 0x8011, pci_subsys_3388_8011_3388_8011, 0};
+#undef pci_ss_info_3388_8011
+#define pci_ss_info_3388_8011 pci_ss_info_3388_8011_3388_8011
+static const pciSubsystemInfo pci_ss_info_3388_8012_3388_8012 =
+ {0x3388, 0x8012, pci_subsys_3388_8012_3388_8012, 0};
+#undef pci_ss_info_3388_8012
+#define pci_ss_info_3388_8012 pci_ss_info_3388_8012_3388_8012
+static const pciSubsystemInfo pci_ss_info_3388_8013_3388_8013 =
+ {0x3388, 0x8013, pci_subsys_3388_8013_3388_8013, 0};
+#undef pci_ss_info_3388_8013
+#define pci_ss_info_3388_8013 pci_ss_info_3388_8013_3388_8013
+#endif
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_1040_0011 =
+ {0x1040, 0x0011, pci_subsys_3d3d_0009_1040_0011, 0};
+#undef pci_ss_info_1040_0011
+#define pci_ss_info_1040_0011 pci_ss_info_3d3d_0009_1040_0011
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0100 =
+ {0x3d3d, 0x0100, pci_subsys_3d3d_0009_3d3d_0100, 0};
+#undef pci_ss_info_3d3d_0100
+#define pci_ss_info_3d3d_0100 pci_ss_info_3d3d_0009_3d3d_0100
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0111 =
+ {0x3d3d, 0x0111, pci_subsys_3d3d_0009_3d3d_0111, 0};
+#undef pci_ss_info_3d3d_0111
+#define pci_ss_info_3d3d_0111 pci_ss_info_3d3d_0009_3d3d_0111
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0114 =
+ {0x3d3d, 0x0114, pci_subsys_3d3d_0009_3d3d_0114, 0};
+#undef pci_ss_info_3d3d_0114
+#define pci_ss_info_3d3d_0114 pci_ss_info_3d3d_0009_3d3d_0114
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0116 =
+ {0x3d3d, 0x0116, pci_subsys_3d3d_0009_3d3d_0116, 0};
+#undef pci_ss_info_3d3d_0116
+#define pci_ss_info_3d3d_0116 pci_ss_info_3d3d_0009_3d3d_0116
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0119 =
+ {0x3d3d, 0x0119, pci_subsys_3d3d_0009_3d3d_0119, 0};
+#undef pci_ss_info_3d3d_0119
+#define pci_ss_info_3d3d_0119 pci_ss_info_3d3d_0009_3d3d_0119
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0120 =
+ {0x3d3d, 0x0120, pci_subsys_3d3d_0009_3d3d_0120, 0};
+#undef pci_ss_info_3d3d_0120
+#define pci_ss_info_3d3d_0120 pci_ss_info_3d3d_0009_3d3d_0120
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0125 =
+ {0x3d3d, 0x0125, pci_subsys_3d3d_0009_3d3d_0125, 0};
+#undef pci_ss_info_3d3d_0125
+#define pci_ss_info_3d3d_0125 pci_ss_info_3d3d_0009_3d3d_0125
+static const pciSubsystemInfo pci_ss_info_3d3d_0009_3d3d_0127 =
+ {0x3d3d, 0x0127, pci_subsys_3d3d_0009_3d3d_0127, 0};
+#undef pci_ss_info_3d3d_0127
+#define pci_ss_info_3d3d_0127 pci_ss_info_3d3d_0009_3d3d_0127
+static const pciSubsystemInfo pci_ss_info_3d3d_000a_3d3d_0121 =
+ {0x3d3d, 0x0121, pci_subsys_3d3d_000a_3d3d_0121, 0};
+#undef pci_ss_info_3d3d_0121
+#define pci_ss_info_3d3d_0121 pci_ss_info_3d3d_000a_3d3d_0121
+static const pciSubsystemInfo pci_ss_info_3d3d_000c_3d3d_0144 =
+ {0x3d3d, 0x0144, pci_subsys_3d3d_000c_3d3d_0144, 0};
+#undef pci_ss_info_3d3d_0144
+#define pci_ss_info_3d3d_0144 pci_ss_info_3d3d_000c_3d3d_0144
+static const pciSubsystemInfo pci_ss_info_4005_4000_4005_4000 =
+ {0x4005, 0x4000, pci_subsys_4005_4000_4005_4000, 0};
+#undef pci_ss_info_4005_4000
+#define pci_ss_info_4005_4000 pci_ss_info_4005_4000_4005_4000
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_4a14_5000_4a14_5000 =
+ {0x4a14, 0x5000, pci_subsys_4a14_5000_4a14_5000, 0};
+#undef pci_ss_info_4a14_5000
+#define pci_ss_info_4a14_5000 pci_ss_info_4a14_5000_4a14_5000
+#endif
+static const pciSubsystemInfo pci_ss_info_5333_8900_5333_8900 =
+ {0x5333, 0x8900, pci_subsys_5333_8900_5333_8900, 0};
+#undef pci_ss_info_5333_8900
+#define pci_ss_info_5333_8900 pci_ss_info_5333_8900_5333_8900
+static const pciSubsystemInfo pci_ss_info_5333_8901_5333_8901 =
+ {0x5333, 0x8901, pci_subsys_5333_8901_5333_8901, 0};
+#undef pci_ss_info_5333_8901
+#define pci_ss_info_5333_8901 pci_ss_info_5333_8901_5333_8901
+static const pciSubsystemInfo pci_ss_info_5333_8904_1014_00db =
+ {0x1014, 0x00db, pci_subsys_5333_8904_1014_00db, 0};
+#undef pci_ss_info_1014_00db
+#define pci_ss_info_1014_00db pci_ss_info_5333_8904_1014_00db
+static const pciSubsystemInfo pci_ss_info_5333_8904_5333_8904 =
+ {0x5333, 0x8904, pci_subsys_5333_8904_5333_8904, 0};
+#undef pci_ss_info_5333_8904
+#define pci_ss_info_5333_8904 pci_ss_info_5333_8904_5333_8904
+static const pciSubsystemInfo pci_ss_info_5333_8a01_0e11_b032 =
+ {0x0e11, 0xb032, pci_subsys_5333_8a01_0e11_b032, 0};
+#undef pci_ss_info_0e11_b032
+#define pci_ss_info_0e11_b032 pci_ss_info_5333_8a01_0e11_b032
+static const pciSubsystemInfo pci_ss_info_5333_8a01_10b4_1617 =
+ {0x10b4, 0x1617, pci_subsys_5333_8a01_10b4_1617, 0};
+#undef pci_ss_info_10b4_1617
+#define pci_ss_info_10b4_1617 pci_ss_info_5333_8a01_10b4_1617
+static const pciSubsystemInfo pci_ss_info_5333_8a01_10b4_1717 =
+ {0x10b4, 0x1717, pci_subsys_5333_8a01_10b4_1717, 0};
+#undef pci_ss_info_10b4_1717
+#define pci_ss_info_10b4_1717 pci_ss_info_5333_8a01_10b4_1717
+static const pciSubsystemInfo pci_ss_info_5333_8a01_5333_8a01 =
+ {0x5333, 0x8a01, pci_subsys_5333_8a01_5333_8a01, 0};
+#undef pci_ss_info_5333_8a01
+#define pci_ss_info_5333_8a01 pci_ss_info_5333_8a01_5333_8a01
+static const pciSubsystemInfo pci_ss_info_5333_8a10_1092_8a10 =
+ {0x1092, 0x8a10, pci_subsys_5333_8a10_1092_8a10, 0};
+#undef pci_ss_info_1092_8a10
+#define pci_ss_info_1092_8a10 pci_ss_info_5333_8a10_1092_8a10
+static const pciSubsystemInfo pci_ss_info_5333_8a13_5333_8a13 =
+ {0x5333, 0x8a13, pci_subsys_5333_8a13_5333_8a13, 0};
+#undef pci_ss_info_5333_8a13
+#define pci_ss_info_5333_8a13 pci_ss_info_5333_8a13_5333_8a13
+static const pciSubsystemInfo pci_ss_info_5333_8a20_5333_8a20 =
+ {0x5333, 0x8a20, pci_subsys_5333_8a20_5333_8a20, 0};
+#undef pci_ss_info_5333_8a20
+#define pci_ss_info_5333_8a20 pci_ss_info_5333_8a20_5333_8a20
+static const pciSubsystemInfo pci_ss_info_5333_8a21_5333_8a21 =
+ {0x5333, 0x8a21, pci_subsys_5333_8a21_5333_8a21, 0};
+#undef pci_ss_info_5333_8a21
+#define pci_ss_info_5333_8a21 pci_ss_info_5333_8a21_5333_8a21
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1033_8068 =
+ {0x1033, 0x8068, pci_subsys_5333_8a22_1033_8068, 0};
+#undef pci_ss_info_1033_8068
+#define pci_ss_info_1033_8068 pci_ss_info_5333_8a22_1033_8068
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1033_8069 =
+ {0x1033, 0x8069, pci_subsys_5333_8a22_1033_8069, 0};
+#undef pci_ss_info_1033_8069
+#define pci_ss_info_1033_8069 pci_ss_info_5333_8a22_1033_8069
+static const pciSubsystemInfo pci_ss_info_5333_8a22_105d_0018 =
+ {0x105d, 0x0018, pci_subsys_5333_8a22_105d_0018, 0};
+#undef pci_ss_info_105d_0018
+#define pci_ss_info_105d_0018 pci_ss_info_5333_8a22_105d_0018
+static const pciSubsystemInfo pci_ss_info_5333_8a22_105d_002a =
+ {0x105d, 0x002a, pci_subsys_5333_8a22_105d_002a, 0};
+#undef pci_ss_info_105d_002a
+#define pci_ss_info_105d_002a pci_ss_info_5333_8a22_105d_002a
+static const pciSubsystemInfo pci_ss_info_5333_8a22_105d_003a =
+ {0x105d, 0x003a, pci_subsys_5333_8a22_105d_003a, 0};
+#undef pci_ss_info_105d_003a
+#define pci_ss_info_105d_003a pci_ss_info_5333_8a22_105d_003a
+static const pciSubsystemInfo pci_ss_info_5333_8a22_105d_092f =
+ {0x105d, 0x092f, pci_subsys_5333_8a22_105d_092f, 0};
+#undef pci_ss_info_105d_092f
+#define pci_ss_info_105d_092f pci_ss_info_5333_8a22_105d_092f
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4207 =
+ {0x1092, 0x4207, pci_subsys_5333_8a22_1092_4207, 0};
+#undef pci_ss_info_1092_4207
+#define pci_ss_info_1092_4207 pci_ss_info_5333_8a22_1092_4207
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4800 =
+ {0x1092, 0x4800, pci_subsys_5333_8a22_1092_4800, 0};
+#undef pci_ss_info_1092_4800
+#define pci_ss_info_1092_4800 pci_ss_info_5333_8a22_1092_4800
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4807 =
+ {0x1092, 0x4807, pci_subsys_5333_8a22_1092_4807, 0};
+#undef pci_ss_info_1092_4807
+#define pci_ss_info_1092_4807 pci_ss_info_5333_8a22_1092_4807
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4808 =
+ {0x1092, 0x4808, pci_subsys_5333_8a22_1092_4808, 0};
+#undef pci_ss_info_1092_4808
+#define pci_ss_info_1092_4808 pci_ss_info_5333_8a22_1092_4808
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4809 =
+ {0x1092, 0x4809, pci_subsys_5333_8a22_1092_4809, 0};
+#undef pci_ss_info_1092_4809
+#define pci_ss_info_1092_4809 pci_ss_info_5333_8a22_1092_4809
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_480e =
+ {0x1092, 0x480e, pci_subsys_5333_8a22_1092_480e, 0};
+#undef pci_ss_info_1092_480e
+#define pci_ss_info_1092_480e pci_ss_info_5333_8a22_1092_480e
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4904 =
+ {0x1092, 0x4904, pci_subsys_5333_8a22_1092_4904, 0};
+#undef pci_ss_info_1092_4904
+#define pci_ss_info_1092_4904 pci_ss_info_5333_8a22_1092_4904
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4905 =
+ {0x1092, 0x4905, pci_subsys_5333_8a22_1092_4905, 0};
+#undef pci_ss_info_1092_4905
+#define pci_ss_info_1092_4905 pci_ss_info_5333_8a22_1092_4905
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4a09 =
+ {0x1092, 0x4a09, pci_subsys_5333_8a22_1092_4a09, 0};
+#undef pci_ss_info_1092_4a09
+#define pci_ss_info_1092_4a09 pci_ss_info_5333_8a22_1092_4a09
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4a0b =
+ {0x1092, 0x4a0b, pci_subsys_5333_8a22_1092_4a0b, 0};
+#undef pci_ss_info_1092_4a0b
+#define pci_ss_info_1092_4a0b pci_ss_info_5333_8a22_1092_4a0b
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4a0f =
+ {0x1092, 0x4a0f, pci_subsys_5333_8a22_1092_4a0f, 0};
+#undef pci_ss_info_1092_4a0f
+#define pci_ss_info_1092_4a0f pci_ss_info_5333_8a22_1092_4a0f
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1092_4e01 =
+ {0x1092, 0x4e01, pci_subsys_5333_8a22_1092_4e01, 0};
+#undef pci_ss_info_1092_4e01
+#define pci_ss_info_1092_4e01 pci_ss_info_5333_8a22_1092_4e01
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1102_101d =
+ {0x1102, 0x101d, pci_subsys_5333_8a22_1102_101d, 0};
+#undef pci_ss_info_1102_101d
+#define pci_ss_info_1102_101d pci_ss_info_5333_8a22_1102_101d
+static const pciSubsystemInfo pci_ss_info_5333_8a22_1102_101e =
+ {0x1102, 0x101e, pci_subsys_5333_8a22_1102_101e, 0};
+#undef pci_ss_info_1102_101e
+#define pci_ss_info_1102_101e pci_ss_info_5333_8a22_1102_101e
+static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8100 =
+ {0x5333, 0x8100, pci_subsys_5333_8a22_5333_8100, 0};
+#undef pci_ss_info_5333_8100
+#define pci_ss_info_5333_8100 pci_ss_info_5333_8a22_5333_8100
+static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8110 =
+ {0x5333, 0x8110, pci_subsys_5333_8a22_5333_8110, 0};
+#undef pci_ss_info_5333_8110
+#define pci_ss_info_5333_8110 pci_ss_info_5333_8a22_5333_8110
+static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8125 =
+ {0x5333, 0x8125, pci_subsys_5333_8a22_5333_8125, 0};
+#undef pci_ss_info_5333_8125
+#define pci_ss_info_5333_8125 pci_ss_info_5333_8a22_5333_8125
+static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8143 =
+ {0x5333, 0x8143, pci_subsys_5333_8a22_5333_8143, 0};
+#undef pci_ss_info_5333_8143
+#define pci_ss_info_5333_8143 pci_ss_info_5333_8a22_5333_8143
+static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8a22 =
+ {0x5333, 0x8a22, pci_subsys_5333_8a22_5333_8a22, 0};
+#undef pci_ss_info_5333_8a22
+#define pci_ss_info_5333_8a22 pci_ss_info_5333_8a22_5333_8a22
+static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_8a2e =
+ {0x5333, 0x8a2e, pci_subsys_5333_8a22_5333_8a2e, 0};
+#undef pci_ss_info_5333_8a2e
+#define pci_ss_info_5333_8a2e pci_ss_info_5333_8a22_5333_8a2e
+static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_9125 =
+ {0x5333, 0x9125, pci_subsys_5333_8a22_5333_9125, 0};
+#undef pci_ss_info_5333_9125
+#define pci_ss_info_5333_9125 pci_ss_info_5333_8a22_5333_9125
+static const pciSubsystemInfo pci_ss_info_5333_8a22_5333_9143 =
+ {0x5333, 0x9143, pci_subsys_5333_8a22_5333_9143, 0};
+#undef pci_ss_info_5333_9143
+#define pci_ss_info_5333_9143 pci_ss_info_5333_8a22_5333_9143
+static const pciSubsystemInfo pci_ss_info_5333_8c01_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_5333_8c01_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_5333_8c01_1179_0001
+static const pciSubsystemInfo pci_ss_info_5333_8c12_1014_017f =
+ {0x1014, 0x017f, pci_subsys_5333_8c12_1014_017f, 0};
+#undef pci_ss_info_1014_017f
+#define pci_ss_info_1014_017f pci_ss_info_5333_8c12_1014_017f
+static const pciSubsystemInfo pci_ss_info_5333_8c13_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_5333_8c13_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_5333_8c13_1179_0001
+static const pciSubsystemInfo pci_ss_info_5333_8c2e_1014_01fc =
+ {0x1014, 0x01fc, pci_subsys_5333_8c2e_1014_01fc, 0};
+#undef pci_ss_info_1014_01fc
+#define pci_ss_info_1014_01fc pci_ss_info_5333_8c2e_1014_01fc
+static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5932 =
+ {0x1092, 0x5932, pci_subsys_5333_9102_1092_5932, 0};
+#undef pci_ss_info_1092_5932
+#define pci_ss_info_1092_5932 pci_ss_info_5333_9102_1092_5932
+static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5934 =
+ {0x1092, 0x5934, pci_subsys_5333_9102_1092_5934, 0};
+#undef pci_ss_info_1092_5934
+#define pci_ss_info_1092_5934 pci_ss_info_5333_9102_1092_5934
+static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5952 =
+ {0x1092, 0x5952, pci_subsys_5333_9102_1092_5952, 0};
+#undef pci_ss_info_1092_5952
+#define pci_ss_info_1092_5952 pci_ss_info_5333_9102_1092_5952
+static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5954 =
+ {0x1092, 0x5954, pci_subsys_5333_9102_1092_5954, 0};
+#undef pci_ss_info_1092_5954
+#define pci_ss_info_1092_5954 pci_ss_info_5333_9102_1092_5954
+static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5a35 =
+ {0x1092, 0x5a35, pci_subsys_5333_9102_1092_5a35, 0};
+#undef pci_ss_info_1092_5a35
+#define pci_ss_info_1092_5a35 pci_ss_info_5333_9102_1092_5a35
+static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5a37 =
+ {0x1092, 0x5a37, pci_subsys_5333_9102_1092_5a37, 0};
+#undef pci_ss_info_1092_5a37
+#define pci_ss_info_1092_5a37 pci_ss_info_5333_9102_1092_5a37
+static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5a55 =
+ {0x1092, 0x5a55, pci_subsys_5333_9102_1092_5a55, 0};
+#undef pci_ss_info_1092_5a55
+#define pci_ss_info_1092_5a55 pci_ss_info_5333_9102_1092_5a55
+static const pciSubsystemInfo pci_ss_info_5333_9102_1092_5a57 =
+ {0x1092, 0x5a57, pci_subsys_5333_9102_1092_5a57, 0};
+#undef pci_ss_info_1092_5a57
+#define pci_ss_info_1092_5a57 pci_ss_info_5333_9102_1092_5a57
+static const pciSubsystemInfo pci_ss_info_8086_1000_0e11_b0df =
+ {0x0e11, 0xb0df, pci_subsys_8086_1000_0e11_b0df, 0};
+#undef pci_ss_info_0e11_b0df
+#define pci_ss_info_0e11_b0df pci_ss_info_8086_1000_0e11_b0df
+static const pciSubsystemInfo pci_ss_info_8086_1000_0e11_b0e0 =
+ {0x0e11, 0xb0e0, pci_subsys_8086_1000_0e11_b0e0, 0};
+#undef pci_ss_info_0e11_b0e0
+#define pci_ss_info_0e11_b0e0 pci_ss_info_8086_1000_0e11_b0e0
+static const pciSubsystemInfo pci_ss_info_8086_1000_0e11_b123 =
+ {0x0e11, 0xb123, pci_subsys_8086_1000_0e11_b123, 0};
+#undef pci_ss_info_0e11_b123
+#define pci_ss_info_0e11_b123 pci_ss_info_8086_1000_0e11_b123
+static const pciSubsystemInfo pci_ss_info_8086_1000_1014_0119 =
+ {0x1014, 0x0119, pci_subsys_8086_1000_1014_0119, 0};
+#undef pci_ss_info_1014_0119
+#define pci_ss_info_1014_0119 pci_ss_info_8086_1000_1014_0119
+static const pciSubsystemInfo pci_ss_info_8086_1000_8086_1000 =
+ {0x8086, 0x1000, pci_subsys_8086_1000_8086_1000, 0};
+#undef pci_ss_info_8086_1000
+#define pci_ss_info_8086_1000 pci_ss_info_8086_1000_8086_1000
+static const pciSubsystemInfo pci_ss_info_8086_1001_0e11_004a =
+ {0x0e11, 0x004a, pci_subsys_8086_1001_0e11_004a, 0};
+#undef pci_ss_info_0e11_004a
+#define pci_ss_info_0e11_004a pci_ss_info_8086_1001_0e11_004a
+static const pciSubsystemInfo pci_ss_info_8086_1001_1014_01ea =
+ {0x1014, 0x01ea, pci_subsys_8086_1001_1014_01ea, 0};
+#undef pci_ss_info_1014_01ea
+#define pci_ss_info_1014_01ea pci_ss_info_8086_1001_1014_01ea
+static const pciSubsystemInfo pci_ss_info_8086_1001_8086_1003 =
+ {0x8086, 0x1003, pci_subsys_8086_1001_8086_1003, 0};
+#undef pci_ss_info_8086_1003
+#define pci_ss_info_8086_1003 pci_ss_info_8086_1001_8086_1003
+static const pciSubsystemInfo pci_ss_info_8086_1002_8086_200e =
+ {0x8086, 0x200e, pci_subsys_8086_1002_8086_200e, 0};
+#undef pci_ss_info_8086_200e
+#define pci_ss_info_8086_200e pci_ss_info_8086_1002_8086_200e
+static const pciSubsystemInfo pci_ss_info_8086_1002_8086_2013 =
+ {0x8086, 0x2013, pci_subsys_8086_1002_8086_2013, 0};
+#undef pci_ss_info_8086_2013
+#define pci_ss_info_8086_2013 pci_ss_info_8086_1002_8086_2013
+static const pciSubsystemInfo pci_ss_info_8086_1002_8086_2017 =
+ {0x8086, 0x2017, pci_subsys_8086_1002_8086_2017, 0};
+#undef pci_ss_info_8086_2017
+#define pci_ss_info_8086_2017 pci_ss_info_8086_1002_8086_2017
+static const pciSubsystemInfo pci_ss_info_8086_1004_0e11_0049 =
+ {0x0e11, 0x0049, pci_subsys_8086_1004_0e11_0049, 0};
+#undef pci_ss_info_0e11_0049
+#define pci_ss_info_0e11_0049 pci_ss_info_8086_1004_0e11_0049
+static const pciSubsystemInfo pci_ss_info_8086_1004_0e11_b1a4 =
+ {0x0e11, 0xb1a4, pci_subsys_8086_1004_0e11_b1a4, 0};
+#undef pci_ss_info_0e11_b1a4
+#define pci_ss_info_0e11_b1a4 pci_ss_info_8086_1004_0e11_b1a4
+static const pciSubsystemInfo pci_ss_info_8086_1004_1014_10f2 =
+ {0x1014, 0x10f2, pci_subsys_8086_1004_1014_10f2, 0};
+#undef pci_ss_info_1014_10f2
+#define pci_ss_info_1014_10f2 pci_ss_info_8086_1004_1014_10f2
+static const pciSubsystemInfo pci_ss_info_8086_1004_8086_1004 =
+ {0x8086, 0x1004, pci_subsys_8086_1004_8086_1004, 0};
+#undef pci_ss_info_8086_1004
+#define pci_ss_info_8086_1004 pci_ss_info_8086_1004_8086_1004
+static const pciSubsystemInfo pci_ss_info_8086_1004_8086_2004 =
+ {0x8086, 0x2004, pci_subsys_8086_1004_8086_2004, 0};
+#undef pci_ss_info_8086_2004
+#define pci_ss_info_8086_2004 pci_ss_info_8086_1004_8086_2004
+static const pciSubsystemInfo pci_ss_info_8086_1008_8086_1107 =
+ {0x8086, 0x1107, pci_subsys_8086_1008_8086_1107, 0};
+#undef pci_ss_info_8086_1107
+#define pci_ss_info_8086_1107 pci_ss_info_8086_1008_8086_1107
+static const pciSubsystemInfo pci_ss_info_8086_1008_8086_2107 =
+ {0x8086, 0x2107, pci_subsys_8086_1008_8086_2107, 0};
+#undef pci_ss_info_8086_2107
+#define pci_ss_info_8086_2107 pci_ss_info_8086_1008_8086_2107
+static const pciSubsystemInfo pci_ss_info_8086_1008_8086_2110 =
+ {0x8086, 0x2110, pci_subsys_8086_1008_8086_2110, 0};
+#undef pci_ss_info_8086_2110
+#define pci_ss_info_8086_2110 pci_ss_info_8086_1008_8086_2110
+static const pciSubsystemInfo pci_ss_info_8086_1009_8086_1109 =
+ {0x8086, 0x1109, pci_subsys_8086_1009_8086_1109, 0};
+#undef pci_ss_info_8086_1109
+#define pci_ss_info_8086_1109 pci_ss_info_8086_1009_8086_1109
+static const pciSubsystemInfo pci_ss_info_8086_1009_8086_2109 =
+ {0x8086, 0x2109, pci_subsys_8086_1009_8086_2109, 0};
+#undef pci_ss_info_8086_2109
+#define pci_ss_info_8086_2109 pci_ss_info_8086_1009_8086_2109
+static const pciSubsystemInfo pci_ss_info_8086_100c_8086_1112 =
+ {0x8086, 0x1112, pci_subsys_8086_100c_8086_1112, 0};
+#undef pci_ss_info_8086_1112
+#define pci_ss_info_8086_1112 pci_ss_info_8086_100c_8086_1112
+static const pciSubsystemInfo pci_ss_info_8086_100c_8086_2112 =
+ {0x8086, 0x2112, pci_subsys_8086_100c_8086_2112, 0};
+#undef pci_ss_info_8086_2112
+#define pci_ss_info_8086_2112 pci_ss_info_8086_100c_8086_2112
+static const pciSubsystemInfo pci_ss_info_8086_100e_8086_001e =
+ {0x8086, 0x001e, pci_subsys_8086_100e_8086_001e, 0};
+#undef pci_ss_info_8086_001e
+#define pci_ss_info_8086_001e pci_ss_info_8086_100e_8086_001e
+static const pciSubsystemInfo pci_ss_info_8086_100e_8086_002e =
+ {0x8086, 0x002e, pci_subsys_8086_100e_8086_002e, 0};
+#undef pci_ss_info_8086_002e
+#define pci_ss_info_8086_002e pci_ss_info_8086_100e_8086_002e
+static const pciSubsystemInfo pci_ss_info_8086_100f_8086_1001 =
+ {0x8086, 0x1001, pci_subsys_8086_100f_8086_1001, 0};
+#undef pci_ss_info_8086_1001
+#define pci_ss_info_8086_1001 pci_ss_info_8086_100f_8086_1001
+static const pciSubsystemInfo pci_ss_info_8086_1010_8086_1011 =
+ {0x8086, 0x1011, pci_subsys_8086_1010_8086_1011, 0};
+#undef pci_ss_info_8086_1011
+#define pci_ss_info_8086_1011 pci_ss_info_8086_1010_8086_1011
+static const pciSubsystemInfo pci_ss_info_8086_1011_8086_1002 =
+ {0x8086, 0x1002, pci_subsys_8086_1011_8086_1002, 0};
+#undef pci_ss_info_8086_1002
+#define pci_ss_info_8086_1002 pci_ss_info_8086_1011_8086_1002
+static const pciSubsystemInfo pci_ss_info_8086_1012_8086_1012 =
+ {0x8086, 0x1012, pci_subsys_8086_1012_8086_1012, 0};
+#undef pci_ss_info_8086_1012
+#define pci_ss_info_8086_1012 pci_ss_info_8086_1012_8086_1012
+static const pciSubsystemInfo pci_ss_info_8086_1031_1014_0209 =
+ {0x1014, 0x0209, pci_subsys_8086_1031_1014_0209, 0};
+#undef pci_ss_info_1014_0209
+#define pci_ss_info_1014_0209 pci_ss_info_8086_1031_1014_0209
+static const pciSubsystemInfo pci_ss_info_8086_1031_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_1031_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_1031_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_1031_107b_5350 =
+ {0x107b, 0x5350, pci_subsys_8086_1031_107b_5350, 0};
+#undef pci_ss_info_107b_5350
+#define pci_ss_info_107b_5350 pci_ss_info_8086_1031_107b_5350
+static const pciSubsystemInfo pci_ss_info_8086_1031_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_8086_1031_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_8086_1031_1179_0001
+static const pciSubsystemInfo pci_ss_info_8086_1031_144d_c000 =
+ {0x144d, 0xc000, pci_subsys_8086_1031_144d_c000, 0};
+#undef pci_ss_info_144d_c000
+#define pci_ss_info_144d_c000 pci_ss_info_8086_1031_144d_c000
+static const pciSubsystemInfo pci_ss_info_8086_1031_144d_c001 =
+ {0x144d, 0xc001, pci_subsys_8086_1031_144d_c001, 0};
+#undef pci_ss_info_144d_c001
+#define pci_ss_info_144d_c001 pci_ss_info_8086_1031_144d_c001
+static const pciSubsystemInfo pci_ss_info_8086_1031_144d_c003 =
+ {0x144d, 0xc003, pci_subsys_8086_1031_144d_c003, 0};
+#undef pci_ss_info_144d_c003
+#define pci_ss_info_144d_c003 pci_ss_info_8086_1031_144d_c003
+static const pciSubsystemInfo pci_ss_info_8086_1031_144d_c006 =
+ {0x144d, 0xc006, pci_subsys_8086_1031_144d_c006, 0};
+#undef pci_ss_info_144d_c006
+#define pci_ss_info_144d_c006 pci_ss_info_8086_1031_144d_c006
+static const pciSubsystemInfo pci_ss_info_8086_1040_16be_1040 =
+ {0x16be, 0x1040, pci_subsys_8086_1040_16be_1040, 0};
+#undef pci_ss_info_16be_1040
+#define pci_ss_info_16be_1040 pci_ss_info_8086_1040_16be_1040
+static const pciSubsystemInfo pci_ss_info_8086_1130_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_8086_1130_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_8086_1130_1025_1016
+static const pciSubsystemInfo pci_ss_info_8086_1130_1043_8027 =
+ {0x1043, 0x8027, pci_subsys_8086_1130_1043_8027, 0};
+#undef pci_ss_info_1043_8027
+#define pci_ss_info_1043_8027 pci_ss_info_8086_1130_1043_8027
+static const pciSubsystemInfo pci_ss_info_8086_1130_104d_80df =
+ {0x104d, 0x80df, pci_subsys_8086_1130_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_8086_1130_104d_80df
+static const pciSubsystemInfo pci_ss_info_8086_1132_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_8086_1132_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_8086_1132_1025_1016
+static const pciSubsystemInfo pci_ss_info_8086_1132_104d_80df =
+ {0x104d, 0x80df, pci_subsys_8086_1132_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_8086_1132_104d_80df
+static const pciSubsystemInfo pci_ss_info_8086_1161_8086_1161 =
+ {0x8086, 0x1161, pci_subsys_8086_1161_8086_1161, 0};
+#undef pci_ss_info_8086_1161
+#define pci_ss_info_8086_1161 pci_ss_info_8086_1161_8086_1161
+static const pciSubsystemInfo pci_ss_info_8086_1200_172a_0000 =
+ {0x172a, 0x0000, pci_subsys_8086_1200_172a_0000, 0};
+#undef pci_ss_info_172a_0000
+#define pci_ss_info_172a_0000 pci_ss_info_8086_1200_172a_0000
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3001 =
+ {0x0e11, 0x3001, pci_subsys_8086_1229_0e11_3001, 0};
+#undef pci_ss_info_0e11_3001
+#define pci_ss_info_0e11_3001 pci_ss_info_8086_1229_0e11_3001
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3002 =
+ {0x0e11, 0x3002, pci_subsys_8086_1229_0e11_3002, 0};
+#undef pci_ss_info_0e11_3002
+#define pci_ss_info_0e11_3002 pci_ss_info_8086_1229_0e11_3002
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3003 =
+ {0x0e11, 0x3003, pci_subsys_8086_1229_0e11_3003, 0};
+#undef pci_ss_info_0e11_3003
+#define pci_ss_info_0e11_3003 pci_ss_info_8086_1229_0e11_3003
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3004 =
+ {0x0e11, 0x3004, pci_subsys_8086_1229_0e11_3004, 0};
+#undef pci_ss_info_0e11_3004
+#define pci_ss_info_0e11_3004 pci_ss_info_8086_1229_0e11_3004
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3005 =
+ {0x0e11, 0x3005, pci_subsys_8086_1229_0e11_3005, 0};
+#undef pci_ss_info_0e11_3005
+#define pci_ss_info_0e11_3005 pci_ss_info_8086_1229_0e11_3005
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3006 =
+ {0x0e11, 0x3006, pci_subsys_8086_1229_0e11_3006, 0};
+#undef pci_ss_info_0e11_3006
+#define pci_ss_info_0e11_3006 pci_ss_info_8086_1229_0e11_3006
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_3007 =
+ {0x0e11, 0x3007, pci_subsys_8086_1229_0e11_3007, 0};
+#undef pci_ss_info_0e11_3007
+#define pci_ss_info_0e11_3007 pci_ss_info_8086_1229_0e11_3007
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b01e =
+ {0x0e11, 0xb01e, pci_subsys_8086_1229_0e11_b01e, 0};
+#undef pci_ss_info_0e11_b01e
+#define pci_ss_info_0e11_b01e pci_ss_info_8086_1229_0e11_b01e
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b01f =
+ {0x0e11, 0xb01f, pci_subsys_8086_1229_0e11_b01f, 0};
+#undef pci_ss_info_0e11_b01f
+#define pci_ss_info_0e11_b01f pci_ss_info_8086_1229_0e11_b01f
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b02f =
+ {0x0e11, 0xb02f, pci_subsys_8086_1229_0e11_b02f, 0};
+#undef pci_ss_info_0e11_b02f
+#define pci_ss_info_0e11_b02f pci_ss_info_8086_1229_0e11_b02f
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b04a =
+ {0x0e11, 0xb04a, pci_subsys_8086_1229_0e11_b04a, 0};
+#undef pci_ss_info_0e11_b04a
+#define pci_ss_info_0e11_b04a pci_ss_info_8086_1229_0e11_b04a
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0c6 =
+ {0x0e11, 0xb0c6, pci_subsys_8086_1229_0e11_b0c6, 0};
+#undef pci_ss_info_0e11_b0c6
+#define pci_ss_info_0e11_b0c6 pci_ss_info_8086_1229_0e11_b0c6
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0c7 =
+ {0x0e11, 0xb0c7, pci_subsys_8086_1229_0e11_b0c7, 0};
+#undef pci_ss_info_0e11_b0c7
+#define pci_ss_info_0e11_b0c7 pci_ss_info_8086_1229_0e11_b0c7
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0d7 =
+ {0x0e11, 0xb0d7, pci_subsys_8086_1229_0e11_b0d7, 0};
+#undef pci_ss_info_0e11_b0d7
+#define pci_ss_info_0e11_b0d7 pci_ss_info_8086_1229_0e11_b0d7
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0dd =
+ {0x0e11, 0xb0dd, pci_subsys_8086_1229_0e11_b0dd, 0};
+#undef pci_ss_info_0e11_b0dd
+#define pci_ss_info_0e11_b0dd pci_ss_info_8086_1229_0e11_b0dd
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0de =
+ {0x0e11, 0xb0de, pci_subsys_8086_1229_0e11_b0de, 0};
+#undef pci_ss_info_0e11_b0de
+#define pci_ss_info_0e11_b0de pci_ss_info_8086_1229_0e11_b0de
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b0e1 =
+ {0x0e11, 0xb0e1, pci_subsys_8086_1229_0e11_b0e1, 0};
+#undef pci_ss_info_0e11_b0e1
+#define pci_ss_info_0e11_b0e1 pci_ss_info_8086_1229_0e11_b0e1
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b134 =
+ {0x0e11, 0xb134, pci_subsys_8086_1229_0e11_b134, 0};
+#undef pci_ss_info_0e11_b134
+#define pci_ss_info_0e11_b134 pci_ss_info_8086_1229_0e11_b134
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b13c =
+ {0x0e11, 0xb13c, pci_subsys_8086_1229_0e11_b13c, 0};
+#undef pci_ss_info_0e11_b13c
+#define pci_ss_info_0e11_b13c pci_ss_info_8086_1229_0e11_b13c
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b144 =
+ {0x0e11, 0xb144, pci_subsys_8086_1229_0e11_b144, 0};
+#undef pci_ss_info_0e11_b144
+#define pci_ss_info_0e11_b144 pci_ss_info_8086_1229_0e11_b144
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b163 =
+ {0x0e11, 0xb163, pci_subsys_8086_1229_0e11_b163, 0};
+#undef pci_ss_info_0e11_b163
+#define pci_ss_info_0e11_b163 pci_ss_info_8086_1229_0e11_b163
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b164 =
+ {0x0e11, 0xb164, pci_subsys_8086_1229_0e11_b164, 0};
+#undef pci_ss_info_0e11_b164
+#define pci_ss_info_0e11_b164 pci_ss_info_8086_1229_0e11_b164
+static const pciSubsystemInfo pci_ss_info_8086_1229_0e11_b1a4 =
+ {0x0e11, 0xb1a4, pci_subsys_8086_1229_0e11_b1a4, 0};
+#undef pci_ss_info_0e11_b1a4
+#define pci_ss_info_0e11_b1a4 pci_ss_info_8086_1229_0e11_b1a4
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_005c =
+ {0x1014, 0x005c, pci_subsys_8086_1229_1014_005c, 0};
+#undef pci_ss_info_1014_005c
+#define pci_ss_info_1014_005c pci_ss_info_8086_1229_1014_005c
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_01bc =
+ {0x1014, 0x01bc, pci_subsys_8086_1229_1014_01bc, 0};
+#undef pci_ss_info_1014_01bc
+#define pci_ss_info_1014_01bc pci_ss_info_8086_1229_1014_01bc
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_01f1 =
+ {0x1014, 0x01f1, pci_subsys_8086_1229_1014_01f1, 0};
+#undef pci_ss_info_1014_01f1
+#define pci_ss_info_1014_01f1 pci_ss_info_8086_1229_1014_01f1
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_01f2 =
+ {0x1014, 0x01f2, pci_subsys_8086_1229_1014_01f2, 0};
+#undef pci_ss_info_1014_01f2
+#define pci_ss_info_1014_01f2 pci_ss_info_8086_1229_1014_01f2
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_0207 =
+ {0x1014, 0x0207, pci_subsys_8086_1229_1014_0207, 0};
+#undef pci_ss_info_1014_0207
+#define pci_ss_info_1014_0207 pci_ss_info_8086_1229_1014_0207
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_0232 =
+ {0x1014, 0x0232, pci_subsys_8086_1229_1014_0232, 0};
+#undef pci_ss_info_1014_0232
+#define pci_ss_info_1014_0232 pci_ss_info_8086_1229_1014_0232
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_023a =
+ {0x1014, 0x023a, pci_subsys_8086_1229_1014_023a, 0};
+#undef pci_ss_info_1014_023a
+#define pci_ss_info_1014_023a pci_ss_info_8086_1229_1014_023a
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_105c =
+ {0x1014, 0x105c, pci_subsys_8086_1229_1014_105c, 0};
+#undef pci_ss_info_1014_105c
+#define pci_ss_info_1014_105c pci_ss_info_8086_1229_1014_105c
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_2205 =
+ {0x1014, 0x2205, pci_subsys_8086_1229_1014_2205, 0};
+#undef pci_ss_info_1014_2205
+#define pci_ss_info_1014_2205 pci_ss_info_8086_1229_1014_2205
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_305c =
+ {0x1014, 0x305c, pci_subsys_8086_1229_1014_305c, 0};
+#undef pci_ss_info_1014_305c
+#define pci_ss_info_1014_305c pci_ss_info_8086_1229_1014_305c
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_405c =
+ {0x1014, 0x405c, pci_subsys_8086_1229_1014_405c, 0};
+#undef pci_ss_info_1014_405c
+#define pci_ss_info_1014_405c pci_ss_info_8086_1229_1014_405c
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_505c =
+ {0x1014, 0x505c, pci_subsys_8086_1229_1014_505c, 0};
+#undef pci_ss_info_1014_505c
+#define pci_ss_info_1014_505c pci_ss_info_8086_1229_1014_505c
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_605c =
+ {0x1014, 0x605c, pci_subsys_8086_1229_1014_605c, 0};
+#undef pci_ss_info_1014_605c
+#define pci_ss_info_1014_605c pci_ss_info_8086_1229_1014_605c
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_705c =
+ {0x1014, 0x705c, pci_subsys_8086_1229_1014_705c, 0};
+#undef pci_ss_info_1014_705c
+#define pci_ss_info_1014_705c pci_ss_info_8086_1229_1014_705c
+static const pciSubsystemInfo pci_ss_info_8086_1229_1014_805c =
+ {0x1014, 0x805c, pci_subsys_8086_1229_1014_805c, 0};
+#undef pci_ss_info_1014_805c
+#define pci_ss_info_1014_805c pci_ss_info_8086_1229_1014_805c
+static const pciSubsystemInfo pci_ss_info_8086_1229_1028_009b =
+ {0x1028, 0x009b, pci_subsys_8086_1229_1028_009b, 0};
+#undef pci_ss_info_1028_009b
+#define pci_ss_info_1028_009b pci_ss_info_8086_1229_1028_009b
+static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8000 =
+ {0x1033, 0x8000, pci_subsys_8086_1229_1033_8000, 0};
+#undef pci_ss_info_1033_8000
+#define pci_ss_info_1033_8000 pci_ss_info_8086_1229_1033_8000
+static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8016 =
+ {0x1033, 0x8016, pci_subsys_8086_1229_1033_8016, 0};
+#undef pci_ss_info_1033_8016
+#define pci_ss_info_1033_8016 pci_ss_info_8086_1229_1033_8016
+static const pciSubsystemInfo pci_ss_info_8086_1229_1033_801f =
+ {0x1033, 0x801f, pci_subsys_8086_1229_1033_801f, 0};
+#undef pci_ss_info_1033_801f
+#define pci_ss_info_1033_801f pci_ss_info_8086_1229_1033_801f
+static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8026 =
+ {0x1033, 0x8026, pci_subsys_8086_1229_1033_8026, 0};
+#undef pci_ss_info_1033_8026
+#define pci_ss_info_1033_8026 pci_ss_info_8086_1229_1033_8026
+static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8063 =
+ {0x1033, 0x8063, pci_subsys_8086_1229_1033_8063, 0};
+#undef pci_ss_info_1033_8063
+#define pci_ss_info_1033_8063 pci_ss_info_8086_1229_1033_8063
+static const pciSubsystemInfo pci_ss_info_8086_1229_1033_8064 =
+ {0x1033, 0x8064, pci_subsys_8086_1229_1033_8064, 0};
+#undef pci_ss_info_1033_8064
+#define pci_ss_info_1033_8064 pci_ss_info_8086_1229_1033_8064
+static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10c0 =
+ {0x103c, 0x10c0, pci_subsys_8086_1229_103c_10c0, 0};
+#undef pci_ss_info_103c_10c0
+#define pci_ss_info_103c_10c0 pci_ss_info_8086_1229_103c_10c0
+static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10c3 =
+ {0x103c, 0x10c3, pci_subsys_8086_1229_103c_10c3, 0};
+#undef pci_ss_info_103c_10c3
+#define pci_ss_info_103c_10c3 pci_ss_info_8086_1229_103c_10c3
+static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10ca =
+ {0x103c, 0x10ca, pci_subsys_8086_1229_103c_10ca, 0};
+#undef pci_ss_info_103c_10ca
+#define pci_ss_info_103c_10ca pci_ss_info_8086_1229_103c_10ca
+static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10cb =
+ {0x103c, 0x10cb, pci_subsys_8086_1229_103c_10cb, 0};
+#undef pci_ss_info_103c_10cb
+#define pci_ss_info_103c_10cb pci_ss_info_8086_1229_103c_10cb
+static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10e3 =
+ {0x103c, 0x10e3, pci_subsys_8086_1229_103c_10e3, 0};
+#undef pci_ss_info_103c_10e3
+#define pci_ss_info_103c_10e3 pci_ss_info_8086_1229_103c_10e3
+static const pciSubsystemInfo pci_ss_info_8086_1229_103c_10e4 =
+ {0x103c, 0x10e4, pci_subsys_8086_1229_103c_10e4, 0};
+#undef pci_ss_info_103c_10e4
+#define pci_ss_info_103c_10e4 pci_ss_info_8086_1229_103c_10e4
+static const pciSubsystemInfo pci_ss_info_8086_1229_103c_1200 =
+ {0x103c, 0x1200, pci_subsys_8086_1229_103c_1200, 0};
+#undef pci_ss_info_103c_1200
+#define pci_ss_info_103c_1200 pci_ss_info_8086_1229_103c_1200
+static const pciSubsystemInfo pci_ss_info_8086_1229_10c3_1100 =
+ {0x10c3, 0x1100, pci_subsys_8086_1229_10c3_1100, 0};
+#undef pci_ss_info_10c3_1100
+#define pci_ss_info_10c3_1100 pci_ss_info_8086_1229_10c3_1100
+static const pciSubsystemInfo pci_ss_info_8086_1229_10cf_1115 =
+ {0x10cf, 0x1115, pci_subsys_8086_1229_10cf_1115, 0};
+#undef pci_ss_info_10cf_1115
+#define pci_ss_info_10cf_1115 pci_ss_info_8086_1229_10cf_1115
+static const pciSubsystemInfo pci_ss_info_8086_1229_10cf_1143 =
+ {0x10cf, 0x1143, pci_subsys_8086_1229_10cf_1143, 0};
+#undef pci_ss_info_10cf_1143
+#define pci_ss_info_10cf_1143 pci_ss_info_8086_1229_10cf_1143
+static const pciSubsystemInfo pci_ss_info_8086_1229_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_8086_1229_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_8086_1229_1179_0001
+static const pciSubsystemInfo pci_ss_info_8086_1229_1179_0002 =
+ {0x1179, 0x0002, pci_subsys_8086_1229_1179_0002, 0};
+#undef pci_ss_info_1179_0002
+#define pci_ss_info_1179_0002 pci_ss_info_8086_1229_1179_0002
+static const pciSubsystemInfo pci_ss_info_8086_1229_1179_0003 =
+ {0x1179, 0x0003, pci_subsys_8086_1229_1179_0003, 0};
+#undef pci_ss_info_1179_0003
+#define pci_ss_info_1179_0003 pci_ss_info_8086_1229_1179_0003
+static const pciSubsystemInfo pci_ss_info_8086_1229_1259_2560 =
+ {0x1259, 0x2560, pci_subsys_8086_1229_1259_2560, 0};
+#undef pci_ss_info_1259_2560
+#define pci_ss_info_1259_2560 pci_ss_info_8086_1229_1259_2560
+static const pciSubsystemInfo pci_ss_info_8086_1229_1259_2561 =
+ {0x1259, 0x2561, pci_subsys_8086_1229_1259_2561, 0};
+#undef pci_ss_info_1259_2561
+#define pci_ss_info_1259_2561 pci_ss_info_8086_1229_1259_2561
+static const pciSubsystemInfo pci_ss_info_8086_1229_1266_0001 =
+ {0x1266, 0x0001, pci_subsys_8086_1229_1266_0001, 0};
+#undef pci_ss_info_1266_0001
+#define pci_ss_info_1266_0001 pci_ss_info_8086_1229_1266_0001
+static const pciSubsystemInfo pci_ss_info_8086_1229_144d_2501 =
+ {0x144d, 0x2501, pci_subsys_8086_1229_144d_2501, 0};
+#undef pci_ss_info_144d_2501
+#define pci_ss_info_144d_2501 pci_ss_info_8086_1229_144d_2501
+static const pciSubsystemInfo pci_ss_info_8086_1229_144d_2502 =
+ {0x144d, 0x2502, pci_subsys_8086_1229_144d_2502, 0};
+#undef pci_ss_info_144d_2502
+#define pci_ss_info_144d_2502 pci_ss_info_8086_1229_144d_2502
+static const pciSubsystemInfo pci_ss_info_8086_1229_1668_1100 =
+ {0x1668, 0x1100, pci_subsys_8086_1229_1668_1100, 0};
+#undef pci_ss_info_1668_1100
+#define pci_ss_info_1668_1100 pci_ss_info_8086_1229_1668_1100
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0001 =
+ {0x8086, 0x0001, pci_subsys_8086_1229_8086_0001, 0};
+#undef pci_ss_info_8086_0001
+#define pci_ss_info_8086_0001 pci_ss_info_8086_1229_8086_0001
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0002 =
+ {0x8086, 0x0002, pci_subsys_8086_1229_8086_0002, 0};
+#undef pci_ss_info_8086_0002
+#define pci_ss_info_8086_0002 pci_ss_info_8086_1229_8086_0002
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0003 =
+ {0x8086, 0x0003, pci_subsys_8086_1229_8086_0003, 0};
+#undef pci_ss_info_8086_0003
+#define pci_ss_info_8086_0003 pci_ss_info_8086_1229_8086_0003
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0004 =
+ {0x8086, 0x0004, pci_subsys_8086_1229_8086_0004, 0};
+#undef pci_ss_info_8086_0004
+#define pci_ss_info_8086_0004 pci_ss_info_8086_1229_8086_0004
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0005 =
+ {0x8086, 0x0005, pci_subsys_8086_1229_8086_0005, 0};
+#undef pci_ss_info_8086_0005
+#define pci_ss_info_8086_0005 pci_ss_info_8086_1229_8086_0005
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0006 =
+ {0x8086, 0x0006, pci_subsys_8086_1229_8086_0006, 0};
+#undef pci_ss_info_8086_0006
+#define pci_ss_info_8086_0006 pci_ss_info_8086_1229_8086_0006
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0007 =
+ {0x8086, 0x0007, pci_subsys_8086_1229_8086_0007, 0};
+#undef pci_ss_info_8086_0007
+#define pci_ss_info_8086_0007 pci_ss_info_8086_1229_8086_0007
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0008 =
+ {0x8086, 0x0008, pci_subsys_8086_1229_8086_0008, 0};
+#undef pci_ss_info_8086_0008
+#define pci_ss_info_8086_0008 pci_ss_info_8086_1229_8086_0008
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0009 =
+ {0x8086, 0x0009, pci_subsys_8086_1229_8086_0009, 0};
+#undef pci_ss_info_8086_0009
+#define pci_ss_info_8086_0009 pci_ss_info_8086_1229_8086_0009
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000a =
+ {0x8086, 0x000a, pci_subsys_8086_1229_8086_000a, 0};
+#undef pci_ss_info_8086_000a
+#define pci_ss_info_8086_000a pci_ss_info_8086_1229_8086_000a
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000b =
+ {0x8086, 0x000b, pci_subsys_8086_1229_8086_000b, 0};
+#undef pci_ss_info_8086_000b
+#define pci_ss_info_8086_000b pci_ss_info_8086_1229_8086_000b
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000c =
+ {0x8086, 0x000c, pci_subsys_8086_1229_8086_000c, 0};
+#undef pci_ss_info_8086_000c
+#define pci_ss_info_8086_000c pci_ss_info_8086_1229_8086_000c
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000d =
+ {0x8086, 0x000d, pci_subsys_8086_1229_8086_000d, 0};
+#undef pci_ss_info_8086_000d
+#define pci_ss_info_8086_000d pci_ss_info_8086_1229_8086_000d
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000e =
+ {0x8086, 0x000e, pci_subsys_8086_1229_8086_000e, 0};
+#undef pci_ss_info_8086_000e
+#define pci_ss_info_8086_000e pci_ss_info_8086_1229_8086_000e
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_000f =
+ {0x8086, 0x000f, pci_subsys_8086_1229_8086_000f, 0};
+#undef pci_ss_info_8086_000f
+#define pci_ss_info_8086_000f pci_ss_info_8086_1229_8086_000f
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0010 =
+ {0x8086, 0x0010, pci_subsys_8086_1229_8086_0010, 0};
+#undef pci_ss_info_8086_0010
+#define pci_ss_info_8086_0010 pci_ss_info_8086_1229_8086_0010
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0011 =
+ {0x8086, 0x0011, pci_subsys_8086_1229_8086_0011, 0};
+#undef pci_ss_info_8086_0011
+#define pci_ss_info_8086_0011 pci_ss_info_8086_1229_8086_0011
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0012 =
+ {0x8086, 0x0012, pci_subsys_8086_1229_8086_0012, 0};
+#undef pci_ss_info_8086_0012
+#define pci_ss_info_8086_0012 pci_ss_info_8086_1229_8086_0012
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0013 =
+ {0x8086, 0x0013, pci_subsys_8086_1229_8086_0013, 0};
+#undef pci_ss_info_8086_0013
+#define pci_ss_info_8086_0013 pci_ss_info_8086_1229_8086_0013
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0030 =
+ {0x8086, 0x0030, pci_subsys_8086_1229_8086_0030, 0};
+#undef pci_ss_info_8086_0030
+#define pci_ss_info_8086_0030 pci_ss_info_8086_1229_8086_0030
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0031 =
+ {0x8086, 0x0031, pci_subsys_8086_1229_8086_0031, 0};
+#undef pci_ss_info_8086_0031
+#define pci_ss_info_8086_0031 pci_ss_info_8086_1229_8086_0031
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0040 =
+ {0x8086, 0x0040, pci_subsys_8086_1229_8086_0040, 0};
+#undef pci_ss_info_8086_0040
+#define pci_ss_info_8086_0040 pci_ss_info_8086_1229_8086_0040
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0041 =
+ {0x8086, 0x0041, pci_subsys_8086_1229_8086_0041, 0};
+#undef pci_ss_info_8086_0041
+#define pci_ss_info_8086_0041 pci_ss_info_8086_1229_8086_0041
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0042 =
+ {0x8086, 0x0042, pci_subsys_8086_1229_8086_0042, 0};
+#undef pci_ss_info_8086_0042
+#define pci_ss_info_8086_0042 pci_ss_info_8086_1229_8086_0042
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_0050 =
+ {0x8086, 0x0050, pci_subsys_8086_1229_8086_0050, 0};
+#undef pci_ss_info_8086_0050
+#define pci_ss_info_8086_0050 pci_ss_info_8086_1229_8086_0050
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1009 =
+ {0x8086, 0x1009, pci_subsys_8086_1229_8086_1009, 0};
+#undef pci_ss_info_8086_1009
+#define pci_ss_info_8086_1009 pci_ss_info_8086_1229_8086_1009
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_100c =
+ {0x8086, 0x100c, pci_subsys_8086_1229_8086_100c, 0};
+#undef pci_ss_info_8086_100c
+#define pci_ss_info_8086_100c pci_ss_info_8086_1229_8086_100c
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1012 =
+ {0x8086, 0x1012, pci_subsys_8086_1229_8086_1012, 0};
+#undef pci_ss_info_8086_1012
+#define pci_ss_info_8086_1012 pci_ss_info_8086_1229_8086_1012
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1013 =
+ {0x8086, 0x1013, pci_subsys_8086_1229_8086_1013, 0};
+#undef pci_ss_info_8086_1013
+#define pci_ss_info_8086_1013 pci_ss_info_8086_1229_8086_1013
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1015 =
+ {0x8086, 0x1015, pci_subsys_8086_1229_8086_1015, 0};
+#undef pci_ss_info_8086_1015
+#define pci_ss_info_8086_1015 pci_ss_info_8086_1229_8086_1015
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1017 =
+ {0x8086, 0x1017, pci_subsys_8086_1229_8086_1017, 0};
+#undef pci_ss_info_8086_1017
+#define pci_ss_info_8086_1017 pci_ss_info_8086_1229_8086_1017
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1030 =
+ {0x8086, 0x1030, pci_subsys_8086_1229_8086_1030, 0};
+#undef pci_ss_info_8086_1030
+#define pci_ss_info_8086_1030 pci_ss_info_8086_1229_8086_1030
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1040 =
+ {0x8086, 0x1040, pci_subsys_8086_1229_8086_1040, 0};
+#undef pci_ss_info_8086_1040
+#define pci_ss_info_8086_1040 pci_ss_info_8086_1229_8086_1040
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1041 =
+ {0x8086, 0x1041, pci_subsys_8086_1229_8086_1041, 0};
+#undef pci_ss_info_8086_1041
+#define pci_ss_info_8086_1041 pci_ss_info_8086_1229_8086_1041
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1042 =
+ {0x8086, 0x1042, pci_subsys_8086_1229_8086_1042, 0};
+#undef pci_ss_info_8086_1042
+#define pci_ss_info_8086_1042 pci_ss_info_8086_1229_8086_1042
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1050 =
+ {0x8086, 0x1050, pci_subsys_8086_1229_8086_1050, 0};
+#undef pci_ss_info_8086_1050
+#define pci_ss_info_8086_1050 pci_ss_info_8086_1229_8086_1050
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1051 =
+ {0x8086, 0x1051, pci_subsys_8086_1229_8086_1051, 0};
+#undef pci_ss_info_8086_1051
+#define pci_ss_info_8086_1051 pci_ss_info_8086_1229_8086_1051
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_1052 =
+ {0x8086, 0x1052, pci_subsys_8086_1229_8086_1052, 0};
+#undef pci_ss_info_8086_1052
+#define pci_ss_info_8086_1052 pci_ss_info_8086_1229_8086_1052
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_10f0 =
+ {0x8086, 0x10f0, pci_subsys_8086_1229_8086_10f0, 0};
+#undef pci_ss_info_8086_10f0
+#define pci_ss_info_8086_10f0 pci_ss_info_8086_1229_8086_10f0
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2009 =
+ {0x8086, 0x2009, pci_subsys_8086_1229_8086_2009, 0};
+#undef pci_ss_info_8086_2009
+#define pci_ss_info_8086_2009 pci_ss_info_8086_1229_8086_2009
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_200d =
+ {0x8086, 0x200d, pci_subsys_8086_1229_8086_200d, 0};
+#undef pci_ss_info_8086_200d
+#define pci_ss_info_8086_200d pci_ss_info_8086_1229_8086_200d
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_200e =
+ {0x8086, 0x200e, pci_subsys_8086_1229_8086_200e, 0};
+#undef pci_ss_info_8086_200e
+#define pci_ss_info_8086_200e pci_ss_info_8086_1229_8086_200e
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_200f =
+ {0x8086, 0x200f, pci_subsys_8086_1229_8086_200f, 0};
+#undef pci_ss_info_8086_200f
+#define pci_ss_info_8086_200f pci_ss_info_8086_1229_8086_200f
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2010 =
+ {0x8086, 0x2010, pci_subsys_8086_1229_8086_2010, 0};
+#undef pci_ss_info_8086_2010
+#define pci_ss_info_8086_2010 pci_ss_info_8086_1229_8086_2010
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2013 =
+ {0x8086, 0x2013, pci_subsys_8086_1229_8086_2013, 0};
+#undef pci_ss_info_8086_2013
+#define pci_ss_info_8086_2013 pci_ss_info_8086_1229_8086_2013
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2016 =
+ {0x8086, 0x2016, pci_subsys_8086_1229_8086_2016, 0};
+#undef pci_ss_info_8086_2016
+#define pci_ss_info_8086_2016 pci_ss_info_8086_1229_8086_2016
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2017 =
+ {0x8086, 0x2017, pci_subsys_8086_1229_8086_2017, 0};
+#undef pci_ss_info_8086_2017
+#define pci_ss_info_8086_2017 pci_ss_info_8086_1229_8086_2017
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2018 =
+ {0x8086, 0x2018, pci_subsys_8086_1229_8086_2018, 0};
+#undef pci_ss_info_8086_2018
+#define pci_ss_info_8086_2018 pci_ss_info_8086_1229_8086_2018
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2019 =
+ {0x8086, 0x2019, pci_subsys_8086_1229_8086_2019, 0};
+#undef pci_ss_info_8086_2019
+#define pci_ss_info_8086_2019 pci_ss_info_8086_1229_8086_2019
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2101 =
+ {0x8086, 0x2101, pci_subsys_8086_1229_8086_2101, 0};
+#undef pci_ss_info_8086_2101
+#define pci_ss_info_8086_2101 pci_ss_info_8086_1229_8086_2101
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2102 =
+ {0x8086, 0x2102, pci_subsys_8086_1229_8086_2102, 0};
+#undef pci_ss_info_8086_2102
+#define pci_ss_info_8086_2102 pci_ss_info_8086_1229_8086_2102
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2103 =
+ {0x8086, 0x2103, pci_subsys_8086_1229_8086_2103, 0};
+#undef pci_ss_info_8086_2103
+#define pci_ss_info_8086_2103 pci_ss_info_8086_1229_8086_2103
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2104 =
+ {0x8086, 0x2104, pci_subsys_8086_1229_8086_2104, 0};
+#undef pci_ss_info_8086_2104
+#define pci_ss_info_8086_2104 pci_ss_info_8086_1229_8086_2104
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2105 =
+ {0x8086, 0x2105, pci_subsys_8086_1229_8086_2105, 0};
+#undef pci_ss_info_8086_2105
+#define pci_ss_info_8086_2105 pci_ss_info_8086_1229_8086_2105
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2106 =
+ {0x8086, 0x2106, pci_subsys_8086_1229_8086_2106, 0};
+#undef pci_ss_info_8086_2106
+#define pci_ss_info_8086_2106 pci_ss_info_8086_1229_8086_2106
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2107 =
+ {0x8086, 0x2107, pci_subsys_8086_1229_8086_2107, 0};
+#undef pci_ss_info_8086_2107
+#define pci_ss_info_8086_2107 pci_ss_info_8086_1229_8086_2107
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2108 =
+ {0x8086, 0x2108, pci_subsys_8086_1229_8086_2108, 0};
+#undef pci_ss_info_8086_2108
+#define pci_ss_info_8086_2108 pci_ss_info_8086_1229_8086_2108
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2200 =
+ {0x8086, 0x2200, pci_subsys_8086_1229_8086_2200, 0};
+#undef pci_ss_info_8086_2200
+#define pci_ss_info_8086_2200 pci_ss_info_8086_1229_8086_2200
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2201 =
+ {0x8086, 0x2201, pci_subsys_8086_1229_8086_2201, 0};
+#undef pci_ss_info_8086_2201
+#define pci_ss_info_8086_2201 pci_ss_info_8086_1229_8086_2201
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2202 =
+ {0x8086, 0x2202, pci_subsys_8086_1229_8086_2202, 0};
+#undef pci_ss_info_8086_2202
+#define pci_ss_info_8086_2202 pci_ss_info_8086_1229_8086_2202
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2203 =
+ {0x8086, 0x2203, pci_subsys_8086_1229_8086_2203, 0};
+#undef pci_ss_info_8086_2203
+#define pci_ss_info_8086_2203 pci_ss_info_8086_1229_8086_2203
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2204 =
+ {0x8086, 0x2204, pci_subsys_8086_1229_8086_2204, 0};
+#undef pci_ss_info_8086_2204
+#define pci_ss_info_8086_2204 pci_ss_info_8086_1229_8086_2204
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2205 =
+ {0x8086, 0x2205, pci_subsys_8086_1229_8086_2205, 0};
+#undef pci_ss_info_8086_2205
+#define pci_ss_info_8086_2205 pci_ss_info_8086_1229_8086_2205
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2206 =
+ {0x8086, 0x2206, pci_subsys_8086_1229_8086_2206, 0};
+#undef pci_ss_info_8086_2206
+#define pci_ss_info_8086_2206 pci_ss_info_8086_1229_8086_2206
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2207 =
+ {0x8086, 0x2207, pci_subsys_8086_1229_8086_2207, 0};
+#undef pci_ss_info_8086_2207
+#define pci_ss_info_8086_2207 pci_ss_info_8086_1229_8086_2207
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2208 =
+ {0x8086, 0x2208, pci_subsys_8086_1229_8086_2208, 0};
+#undef pci_ss_info_8086_2208
+#define pci_ss_info_8086_2208 pci_ss_info_8086_1229_8086_2208
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2402 =
+ {0x8086, 0x2402, pci_subsys_8086_1229_8086_2402, 0};
+#undef pci_ss_info_8086_2402
+#define pci_ss_info_8086_2402 pci_ss_info_8086_1229_8086_2402
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2407 =
+ {0x8086, 0x2407, pci_subsys_8086_1229_8086_2407, 0};
+#undef pci_ss_info_8086_2407
+#define pci_ss_info_8086_2407 pci_ss_info_8086_1229_8086_2407
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2408 =
+ {0x8086, 0x2408, pci_subsys_8086_1229_8086_2408, 0};
+#undef pci_ss_info_8086_2408
+#define pci_ss_info_8086_2408 pci_ss_info_8086_1229_8086_2408
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2409 =
+ {0x8086, 0x2409, pci_subsys_8086_1229_8086_2409, 0};
+#undef pci_ss_info_8086_2409
+#define pci_ss_info_8086_2409 pci_ss_info_8086_1229_8086_2409
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_240f =
+ {0x8086, 0x240f, pci_subsys_8086_1229_8086_240f, 0};
+#undef pci_ss_info_8086_240f
+#define pci_ss_info_8086_240f pci_ss_info_8086_1229_8086_240f
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2410 =
+ {0x8086, 0x2410, pci_subsys_8086_1229_8086_2410, 0};
+#undef pci_ss_info_8086_2410
+#define pci_ss_info_8086_2410 pci_ss_info_8086_1229_8086_2410
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2411 =
+ {0x8086, 0x2411, pci_subsys_8086_1229_8086_2411, 0};
+#undef pci_ss_info_8086_2411
+#define pci_ss_info_8086_2411 pci_ss_info_8086_1229_8086_2411
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2412 =
+ {0x8086, 0x2412, pci_subsys_8086_1229_8086_2412, 0};
+#undef pci_ss_info_8086_2412
+#define pci_ss_info_8086_2412 pci_ss_info_8086_1229_8086_2412
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_2413 =
+ {0x8086, 0x2413, pci_subsys_8086_1229_8086_2413, 0};
+#undef pci_ss_info_8086_2413
+#define pci_ss_info_8086_2413 pci_ss_info_8086_1229_8086_2413
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3000 =
+ {0x8086, 0x3000, pci_subsys_8086_1229_8086_3000, 0};
+#undef pci_ss_info_8086_3000
+#define pci_ss_info_8086_3000 pci_ss_info_8086_1229_8086_3000
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3001 =
+ {0x8086, 0x3001, pci_subsys_8086_1229_8086_3001, 0};
+#undef pci_ss_info_8086_3001
+#define pci_ss_info_8086_3001 pci_ss_info_8086_1229_8086_3001
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3002 =
+ {0x8086, 0x3002, pci_subsys_8086_1229_8086_3002, 0};
+#undef pci_ss_info_8086_3002
+#define pci_ss_info_8086_3002 pci_ss_info_8086_1229_8086_3002
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3006 =
+ {0x8086, 0x3006, pci_subsys_8086_1229_8086_3006, 0};
+#undef pci_ss_info_8086_3006
+#define pci_ss_info_8086_3006 pci_ss_info_8086_1229_8086_3006
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3007 =
+ {0x8086, 0x3007, pci_subsys_8086_1229_8086_3007, 0};
+#undef pci_ss_info_8086_3007
+#define pci_ss_info_8086_3007 pci_ss_info_8086_1229_8086_3007
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3008 =
+ {0x8086, 0x3008, pci_subsys_8086_1229_8086_3008, 0};
+#undef pci_ss_info_8086_3008
+#define pci_ss_info_8086_3008 pci_ss_info_8086_1229_8086_3008
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3010 =
+ {0x8086, 0x3010, pci_subsys_8086_1229_8086_3010, 0};
+#undef pci_ss_info_8086_3010
+#define pci_ss_info_8086_3010 pci_ss_info_8086_1229_8086_3010
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3011 =
+ {0x8086, 0x3011, pci_subsys_8086_1229_8086_3011, 0};
+#undef pci_ss_info_8086_3011
+#define pci_ss_info_8086_3011 pci_ss_info_8086_1229_8086_3011
+static const pciSubsystemInfo pci_ss_info_8086_1229_8086_3012 =
+ {0x8086, 0x3012, pci_subsys_8086_1229_8086_3012, 0};
+#undef pci_ss_info_8086_3012
+#define pci_ss_info_8086_3012 pci_ss_info_8086_1229_8086_3012
+static const pciSubsystemInfo pci_ss_info_8086_1361_8086_1361 =
+ {0x8086, 0x1361, pci_subsys_8086_1361_8086_1361, 0};
+#undef pci_ss_info_8086_1361
+#define pci_ss_info_8086_1361 pci_ss_info_8086_1361_8086_1361
+static const pciSubsystemInfo pci_ss_info_8086_1361_8086_8000 =
+ {0x8086, 0x8000, pci_subsys_8086_1361_8086_8000, 0};
+#undef pci_ss_info_8086_8000
+#define pci_ss_info_8086_8000 pci_ss_info_8086_1361_8086_8000
+static const pciSubsystemInfo pci_ss_info_8086_1461_15d9_3480 =
+ {0x15d9, 0x3480, pci_subsys_8086_1461_15d9_3480, 0};
+#undef pci_ss_info_15d9_3480
+#define pci_ss_info_15d9_3480 pci_ss_info_8086_1461_15d9_3480
+static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0431 =
+ {0x101e, 0x0431, pci_subsys_8086_1960_101e_0431, 0};
+#undef pci_ss_info_101e_0431
+#define pci_ss_info_101e_0431 pci_ss_info_8086_1960_101e_0431
+static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0438 =
+ {0x101e, 0x0438, pci_subsys_8086_1960_101e_0438, 0};
+#undef pci_ss_info_101e_0438
+#define pci_ss_info_101e_0438 pci_ss_info_8086_1960_101e_0438
+static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0466 =
+ {0x101e, 0x0466, pci_subsys_8086_1960_101e_0466, 0};
+#undef pci_ss_info_101e_0466
+#define pci_ss_info_101e_0466 pci_ss_info_8086_1960_101e_0466
+static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0467 =
+ {0x101e, 0x0467, pci_subsys_8086_1960_101e_0467, 0};
+#undef pci_ss_info_101e_0467
+#define pci_ss_info_101e_0467 pci_ss_info_8086_1960_101e_0467
+static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0490 =
+ {0x101e, 0x0490, pci_subsys_8086_1960_101e_0490, 0};
+#undef pci_ss_info_101e_0490
+#define pci_ss_info_101e_0490 pci_ss_info_8086_1960_101e_0490
+static const pciSubsystemInfo pci_ss_info_8086_1960_101e_0762 =
+ {0x101e, 0x0762, pci_subsys_8086_1960_101e_0762, 0};
+#undef pci_ss_info_101e_0762
+#define pci_ss_info_101e_0762 pci_ss_info_8086_1960_101e_0762
+static const pciSubsystemInfo pci_ss_info_8086_1960_101e_09a0 =
+ {0x101e, 0x09a0, pci_subsys_8086_1960_101e_09a0, 0};
+#undef pci_ss_info_101e_09a0
+#define pci_ss_info_101e_09a0 pci_ss_info_8086_1960_101e_09a0
+static const pciSubsystemInfo pci_ss_info_8086_1960_1028_0467 =
+ {0x1028, 0x0467, pci_subsys_8086_1960_1028_0467, 0};
+#undef pci_ss_info_1028_0467
+#define pci_ss_info_1028_0467 pci_ss_info_8086_1960_1028_0467
+static const pciSubsystemInfo pci_ss_info_8086_1960_1028_1111 =
+ {0x1028, 0x1111, pci_subsys_8086_1960_1028_1111, 0};
+#undef pci_ss_info_1028_1111
+#define pci_ss_info_1028_1111 pci_ss_info_8086_1960_1028_1111
+static const pciSubsystemInfo pci_ss_info_8086_1960_103c_03a2 =
+ {0x103c, 0x03a2, pci_subsys_8086_1960_103c_03a2, 0};
+#undef pci_ss_info_103c_03a2
+#define pci_ss_info_103c_03a2 pci_ss_info_8086_1960_103c_03a2
+static const pciSubsystemInfo pci_ss_info_8086_1960_103c_10c6 =
+ {0x103c, 0x10c6, pci_subsys_8086_1960_103c_10c6, 0};
+#undef pci_ss_info_103c_10c6
+#define pci_ss_info_103c_10c6 pci_ss_info_8086_1960_103c_10c6
+static const pciSubsystemInfo pci_ss_info_8086_1960_103c_10c7 =
+ {0x103c, 0x10c7, pci_subsys_8086_1960_103c_10c7, 0};
+#undef pci_ss_info_103c_10c7
+#define pci_ss_info_103c_10c7 pci_ss_info_8086_1960_103c_10c7
+static const pciSubsystemInfo pci_ss_info_8086_1960_103c_10cc =
+ {0x103c, 0x10cc, pci_subsys_8086_1960_103c_10cc, 0};
+#undef pci_ss_info_103c_10cc
+#define pci_ss_info_103c_10cc pci_ss_info_8086_1960_103c_10cc
+static const pciSubsystemInfo pci_ss_info_8086_1960_103c_10cd =
+ {0x103c, 0x10cd, pci_subsys_8086_1960_103c_10cd, 0};
+#undef pci_ss_info_103c_10cd
+#define pci_ss_info_103c_10cd pci_ss_info_8086_1960_103c_10cd
+static const pciSubsystemInfo pci_ss_info_8086_1960_105a_0000 =
+ {0x105a, 0x0000, pci_subsys_8086_1960_105a_0000, 0};
+#undef pci_ss_info_105a_0000
+#define pci_ss_info_105a_0000 pci_ss_info_8086_1960_105a_0000
+static const pciSubsystemInfo pci_ss_info_8086_1960_105a_2168 =
+ {0x105a, 0x2168, pci_subsys_8086_1960_105a_2168, 0};
+#undef pci_ss_info_105a_2168
+#define pci_ss_info_105a_2168 pci_ss_info_8086_1960_105a_2168
+static const pciSubsystemInfo pci_ss_info_8086_1960_105a_5168 =
+ {0x105a, 0x5168, pci_subsys_8086_1960_105a_5168, 0};
+#undef pci_ss_info_105a_5168
+#define pci_ss_info_105a_5168 pci_ss_info_8086_1960_105a_5168
+static const pciSubsystemInfo pci_ss_info_8086_1960_1111_1111 =
+ {0x1111, 0x1111, pci_subsys_8086_1960_1111_1111, 0};
+#undef pci_ss_info_1111_1111
+#define pci_ss_info_1111_1111 pci_ss_info_8086_1960_1111_1111
+static const pciSubsystemInfo pci_ss_info_8086_1960_1111_1112 =
+ {0x1111, 0x1112, pci_subsys_8086_1960_1111_1112, 0};
+#undef pci_ss_info_1111_1112
+#define pci_ss_info_1111_1112 pci_ss_info_8086_1960_1111_1112
+static const pciSubsystemInfo pci_ss_info_8086_1960_113c_03a2 =
+ {0x113c, 0x03a2, pci_subsys_8086_1960_113c_03a2, 0};
+#undef pci_ss_info_113c_03a2
+#define pci_ss_info_113c_03a2 pci_ss_info_8086_1960_113c_03a2
+static const pciSubsystemInfo pci_ss_info_8086_1962_105a_0000 =
+ {0x105a, 0x0000, pci_subsys_8086_1962_105a_0000, 0};
+#undef pci_ss_info_105a_0000
+#define pci_ss_info_105a_0000 pci_ss_info_8086_1962_105a_0000
+static const pciSubsystemInfo pci_ss_info_8086_2415_1028_0095 =
+ {0x1028, 0x0095, pci_subsys_8086_2415_1028_0095, 0};
+#undef pci_ss_info_1028_0095
+#define pci_ss_info_1028_0095 pci_ss_info_8086_2415_1028_0095
+static const pciSubsystemInfo pci_ss_info_8086_2415_11d4_0040 =
+ {0x11d4, 0x0040, pci_subsys_8086_2415_11d4_0040, 0};
+#undef pci_ss_info_11d4_0040
+#define pci_ss_info_11d4_0040 pci_ss_info_8086_2415_11d4_0040
+static const pciSubsystemInfo pci_ss_info_8086_2415_11d4_0048 =
+ {0x11d4, 0x0048, pci_subsys_8086_2415_11d4_0048, 0};
+#undef pci_ss_info_11d4_0048
+#define pci_ss_info_11d4_0048 pci_ss_info_8086_2415_11d4_0048
+static const pciSubsystemInfo pci_ss_info_8086_2415_11d4_5340 =
+ {0x11d4, 0x5340, pci_subsys_8086_2415_11d4_5340, 0};
+#undef pci_ss_info_11d4_5340
+#define pci_ss_info_11d4_5340 pci_ss_info_8086_2415_11d4_5340
+static const pciSubsystemInfo pci_ss_info_8086_2425_11d4_0040 =
+ {0x11d4, 0x0040, pci_subsys_8086_2425_11d4_0040, 0};
+#undef pci_ss_info_11d4_0040
+#define pci_ss_info_11d4_0040 pci_ss_info_8086_2425_11d4_0040
+static const pciSubsystemInfo pci_ss_info_8086_2425_11d4_0048 =
+ {0x11d4, 0x0048, pci_subsys_8086_2425_11d4_0048, 0};
+#undef pci_ss_info_11d4_0048
+#define pci_ss_info_11d4_0048 pci_ss_info_8086_2425_11d4_0048
+static const pciSubsystemInfo pci_ss_info_8086_2442_1014_01c6 =
+ {0x1014, 0x01c6, pci_subsys_8086_2442_1014_01c6, 0};
+#undef pci_ss_info_1014_01c6
+#define pci_ss_info_1014_01c6 pci_ss_info_8086_2442_1014_01c6
+static const pciSubsystemInfo pci_ss_info_8086_2442_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_8086_2442_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_8086_2442_1025_1016
+static const pciSubsystemInfo pci_ss_info_8086_2442_104d_80df =
+ {0x104d, 0x80df, pci_subsys_8086_2442_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_8086_2442_104d_80df
+static const pciSubsystemInfo pci_ss_info_8086_2442_147b_0507 =
+ {0x147b, 0x0507, pci_subsys_8086_2442_147b_0507, 0};
+#undef pci_ss_info_147b_0507
+#define pci_ss_info_147b_0507 pci_ss_info_8086_2442_147b_0507
+static const pciSubsystemInfo pci_ss_info_8086_2443_1014_01c6 =
+ {0x1014, 0x01c6, pci_subsys_8086_2443_1014_01c6, 0};
+#undef pci_ss_info_1014_01c6
+#define pci_ss_info_1014_01c6 pci_ss_info_8086_2443_1014_01c6
+static const pciSubsystemInfo pci_ss_info_8086_2443_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_8086_2443_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_8086_2443_1025_1016
+static const pciSubsystemInfo pci_ss_info_8086_2443_1043_8027 =
+ {0x1043, 0x8027, pci_subsys_8086_2443_1043_8027, 0};
+#undef pci_ss_info_1043_8027
+#define pci_ss_info_1043_8027 pci_ss_info_8086_2443_1043_8027
+static const pciSubsystemInfo pci_ss_info_8086_2443_104d_80df =
+ {0x104d, 0x80df, pci_subsys_8086_2443_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_8086_2443_104d_80df
+static const pciSubsystemInfo pci_ss_info_8086_2443_147b_0507 =
+ {0x147b, 0x0507, pci_subsys_8086_2443_147b_0507, 0};
+#undef pci_ss_info_147b_0507
+#define pci_ss_info_147b_0507 pci_ss_info_8086_2443_147b_0507
+static const pciSubsystemInfo pci_ss_info_8086_2444_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_8086_2444_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_8086_2444_1025_1016
+static const pciSubsystemInfo pci_ss_info_8086_2444_104d_80df =
+ {0x104d, 0x80df, pci_subsys_8086_2444_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_8086_2444_104d_80df
+static const pciSubsystemInfo pci_ss_info_8086_2444_147b_0507 =
+ {0x147b, 0x0507, pci_subsys_8086_2444_147b_0507, 0};
+#undef pci_ss_info_147b_0507
+#define pci_ss_info_147b_0507 pci_ss_info_8086_2444_147b_0507
+static const pciSubsystemInfo pci_ss_info_8086_2445_1014_01c6 =
+ {0x1014, 0x01c6, pci_subsys_8086_2445_1014_01c6, 0};
+#undef pci_ss_info_1014_01c6
+#define pci_ss_info_1014_01c6 pci_ss_info_8086_2445_1014_01c6
+static const pciSubsystemInfo pci_ss_info_8086_2445_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_8086_2445_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_8086_2445_1025_1016
+static const pciSubsystemInfo pci_ss_info_8086_2445_104d_80df =
+ {0x104d, 0x80df, pci_subsys_8086_2445_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_8086_2445_104d_80df
+static const pciSubsystemInfo pci_ss_info_8086_2445_1462_3370 =
+ {0x1462, 0x3370, pci_subsys_8086_2445_1462_3370, 0};
+#undef pci_ss_info_1462_3370
+#define pci_ss_info_1462_3370 pci_ss_info_8086_2445_1462_3370
+static const pciSubsystemInfo pci_ss_info_8086_2445_147b_0507 =
+ {0x147b, 0x0507, pci_subsys_8086_2445_147b_0507, 0};
+#undef pci_ss_info_147b_0507
+#define pci_ss_info_147b_0507 pci_ss_info_8086_2445_147b_0507
+static const pciSubsystemInfo pci_ss_info_8086_2446_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_8086_2446_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_8086_2446_1025_1016
+static const pciSubsystemInfo pci_ss_info_8086_2446_104d_80df =
+ {0x104d, 0x80df, pci_subsys_8086_2446_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_8086_2446_104d_80df
+static const pciSubsystemInfo pci_ss_info_8086_2449_0e11_0012 =
+ {0x0e11, 0x0012, pci_subsys_8086_2449_0e11_0012, 0};
+#undef pci_ss_info_0e11_0012
+#define pci_ss_info_0e11_0012 pci_ss_info_8086_2449_0e11_0012
+static const pciSubsystemInfo pci_ss_info_8086_2449_0e11_0091 =
+ {0x0e11, 0x0091, pci_subsys_8086_2449_0e11_0091, 0};
+#undef pci_ss_info_0e11_0091
+#define pci_ss_info_0e11_0091 pci_ss_info_8086_2449_0e11_0091
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_01ce =
+ {0x1014, 0x01ce, pci_subsys_8086_2449_1014_01ce, 0};
+#undef pci_ss_info_1014_01ce
+#define pci_ss_info_1014_01ce pci_ss_info_8086_2449_1014_01ce
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_01dc =
+ {0x1014, 0x01dc, pci_subsys_8086_2449_1014_01dc, 0};
+#undef pci_ss_info_1014_01dc
+#define pci_ss_info_1014_01dc pci_ss_info_8086_2449_1014_01dc
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_01eb =
+ {0x1014, 0x01eb, pci_subsys_8086_2449_1014_01eb, 0};
+#undef pci_ss_info_1014_01eb
+#define pci_ss_info_1014_01eb pci_ss_info_8086_2449_1014_01eb
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_01ec =
+ {0x1014, 0x01ec, pci_subsys_8086_2449_1014_01ec, 0};
+#undef pci_ss_info_1014_01ec
+#define pci_ss_info_1014_01ec pci_ss_info_8086_2449_1014_01ec
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0202 =
+ {0x1014, 0x0202, pci_subsys_8086_2449_1014_0202, 0};
+#undef pci_ss_info_1014_0202
+#define pci_ss_info_1014_0202 pci_ss_info_8086_2449_1014_0202
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0205 =
+ {0x1014, 0x0205, pci_subsys_8086_2449_1014_0205, 0};
+#undef pci_ss_info_1014_0205
+#define pci_ss_info_1014_0205 pci_ss_info_8086_2449_1014_0205
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0217 =
+ {0x1014, 0x0217, pci_subsys_8086_2449_1014_0217, 0};
+#undef pci_ss_info_1014_0217
+#define pci_ss_info_1014_0217 pci_ss_info_8086_2449_1014_0217
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0234 =
+ {0x1014, 0x0234, pci_subsys_8086_2449_1014_0234, 0};
+#undef pci_ss_info_1014_0234
+#define pci_ss_info_1014_0234 pci_ss_info_8086_2449_1014_0234
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_023d =
+ {0x1014, 0x023d, pci_subsys_8086_2449_1014_023d, 0};
+#undef pci_ss_info_1014_023d
+#define pci_ss_info_1014_023d pci_ss_info_8086_2449_1014_023d
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0244 =
+ {0x1014, 0x0244, pci_subsys_8086_2449_1014_0244, 0};
+#undef pci_ss_info_1014_0244
+#define pci_ss_info_1014_0244 pci_ss_info_8086_2449_1014_0244
+static const pciSubsystemInfo pci_ss_info_8086_2449_1014_0245 =
+ {0x1014, 0x0245, pci_subsys_8086_2449_1014_0245, 0};
+#undef pci_ss_info_1014_0245
+#define pci_ss_info_1014_0245 pci_ss_info_8086_2449_1014_0245
+static const pciSubsystemInfo pci_ss_info_8086_2449_109f_315d =
+ {0x109f, 0x315d, pci_subsys_8086_2449_109f_315d, 0};
+#undef pci_ss_info_109f_315d
+#define pci_ss_info_109f_315d pci_ss_info_8086_2449_109f_315d
+static const pciSubsystemInfo pci_ss_info_8086_2449_109f_3181 =
+ {0x109f, 0x3181, pci_subsys_8086_2449_109f_3181, 0};
+#undef pci_ss_info_109f_3181
+#define pci_ss_info_109f_3181 pci_ss_info_8086_2449_109f_3181
+static const pciSubsystemInfo pci_ss_info_8086_2449_1186_7801 =
+ {0x1186, 0x7801, pci_subsys_8086_2449_1186_7801, 0};
+#undef pci_ss_info_1186_7801
+#define pci_ss_info_1186_7801 pci_ss_info_8086_2449_1186_7801
+static const pciSubsystemInfo pci_ss_info_8086_2449_144d_2602 =
+ {0x144d, 0x2602, pci_subsys_8086_2449_144d_2602, 0};
+#undef pci_ss_info_144d_2602
+#define pci_ss_info_144d_2602 pci_ss_info_8086_2449_144d_2602
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3010 =
+ {0x8086, 0x3010, pci_subsys_8086_2449_8086_3010, 0};
+#undef pci_ss_info_8086_3010
+#define pci_ss_info_8086_3010 pci_ss_info_8086_2449_8086_3010
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3011 =
+ {0x8086, 0x3011, pci_subsys_8086_2449_8086_3011, 0};
+#undef pci_ss_info_8086_3011
+#define pci_ss_info_8086_3011 pci_ss_info_8086_2449_8086_3011
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3012 =
+ {0x8086, 0x3012, pci_subsys_8086_2449_8086_3012, 0};
+#undef pci_ss_info_8086_3012
+#define pci_ss_info_8086_3012 pci_ss_info_8086_2449_8086_3012
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3013 =
+ {0x8086, 0x3013, pci_subsys_8086_2449_8086_3013, 0};
+#undef pci_ss_info_8086_3013
+#define pci_ss_info_8086_3013 pci_ss_info_8086_2449_8086_3013
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3014 =
+ {0x8086, 0x3014, pci_subsys_8086_2449_8086_3014, 0};
+#undef pci_ss_info_8086_3014
+#define pci_ss_info_8086_3014 pci_ss_info_8086_2449_8086_3014
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3015 =
+ {0x8086, 0x3015, pci_subsys_8086_2449_8086_3015, 0};
+#undef pci_ss_info_8086_3015
+#define pci_ss_info_8086_3015 pci_ss_info_8086_2449_8086_3015
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3016 =
+ {0x8086, 0x3016, pci_subsys_8086_2449_8086_3016, 0};
+#undef pci_ss_info_8086_3016
+#define pci_ss_info_8086_3016 pci_ss_info_8086_2449_8086_3016
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3017 =
+ {0x8086, 0x3017, pci_subsys_8086_2449_8086_3017, 0};
+#undef pci_ss_info_8086_3017
+#define pci_ss_info_8086_3017 pci_ss_info_8086_2449_8086_3017
+static const pciSubsystemInfo pci_ss_info_8086_2449_8086_3018 =
+ {0x8086, 0x3018, pci_subsys_8086_2449_8086_3018, 0};
+#undef pci_ss_info_8086_3018
+#define pci_ss_info_8086_3018 pci_ss_info_8086_2449_8086_3018
+static const pciSubsystemInfo pci_ss_info_8086_244a_1025_1016 =
+ {0x1025, 0x1016, pci_subsys_8086_244a_1025_1016, 0};
+#undef pci_ss_info_1025_1016
+#define pci_ss_info_1025_1016 pci_ss_info_8086_244a_1025_1016
+static const pciSubsystemInfo pci_ss_info_8086_244a_104d_80df =
+ {0x104d, 0x80df, pci_subsys_8086_244a_104d_80df, 0};
+#undef pci_ss_info_104d_80df
+#define pci_ss_info_104d_80df pci_ss_info_8086_244a_104d_80df
+static const pciSubsystemInfo pci_ss_info_8086_244b_1014_01c6 =
+ {0x1014, 0x01c6, pci_subsys_8086_244b_1014_01c6, 0};
+#undef pci_ss_info_1014_01c6
+#define pci_ss_info_1014_01c6 pci_ss_info_8086_244b_1014_01c6
+static const pciSubsystemInfo pci_ss_info_8086_244b_1043_8027 =
+ {0x1043, 0x8027, pci_subsys_8086_244b_1043_8027, 0};
+#undef pci_ss_info_1043_8027
+#define pci_ss_info_1043_8027 pci_ss_info_8086_244b_1043_8027
+static const pciSubsystemInfo pci_ss_info_8086_244b_147b_0507 =
+ {0x147b, 0x0507, pci_subsys_8086_244b_147b_0507, 0};
+#undef pci_ss_info_147b_0507
+#define pci_ss_info_147b_0507 pci_ss_info_8086_244b_147b_0507
+static const pciSubsystemInfo pci_ss_info_8086_2482_1014_0220 =
+ {0x1014, 0x0220, pci_subsys_8086_2482_1014_0220, 0};
+#undef pci_ss_info_1014_0220
+#define pci_ss_info_1014_0220 pci_ss_info_8086_2482_1014_0220
+static const pciSubsystemInfo pci_ss_info_8086_2482_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_2482_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_2482_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_2482_15d9_3480 =
+ {0x15d9, 0x3480, pci_subsys_8086_2482_15d9_3480, 0};
+#undef pci_ss_info_15d9_3480
+#define pci_ss_info_15d9_3480 pci_ss_info_8086_2482_15d9_3480
+static const pciSubsystemInfo pci_ss_info_8086_2482_8086_1958 =
+ {0x8086, 0x1958, pci_subsys_8086_2482_8086_1958, 0};
+#undef pci_ss_info_8086_1958
+#define pci_ss_info_8086_1958 pci_ss_info_8086_2482_8086_1958
+static const pciSubsystemInfo pci_ss_info_8086_2483_1014_0220 =
+ {0x1014, 0x0220, pci_subsys_8086_2483_1014_0220, 0};
+#undef pci_ss_info_1014_0220
+#define pci_ss_info_1014_0220 pci_ss_info_8086_2483_1014_0220
+static const pciSubsystemInfo pci_ss_info_8086_2483_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_2483_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_2483_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_2483_15d9_3480 =
+ {0x15d9, 0x3480, pci_subsys_8086_2483_15d9_3480, 0};
+#undef pci_ss_info_15d9_3480
+#define pci_ss_info_15d9_3480 pci_ss_info_8086_2483_15d9_3480
+static const pciSubsystemInfo pci_ss_info_8086_2483_8086_1958 =
+ {0x8086, 0x1958, pci_subsys_8086_2483_8086_1958, 0};
+#undef pci_ss_info_8086_1958
+#define pci_ss_info_8086_1958 pci_ss_info_8086_2483_8086_1958
+static const pciSubsystemInfo pci_ss_info_8086_2484_1014_0220 =
+ {0x1014, 0x0220, pci_subsys_8086_2484_1014_0220, 0};
+#undef pci_ss_info_1014_0220
+#define pci_ss_info_1014_0220 pci_ss_info_8086_2484_1014_0220
+static const pciSubsystemInfo pci_ss_info_8086_2484_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_2484_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_2484_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_2484_15d9_3480 =
+ {0x15d9, 0x3480, pci_subsys_8086_2484_15d9_3480, 0};
+#undef pci_ss_info_15d9_3480
+#define pci_ss_info_15d9_3480 pci_ss_info_8086_2484_15d9_3480
+static const pciSubsystemInfo pci_ss_info_8086_2484_8086_1958 =
+ {0x8086, 0x1958, pci_subsys_8086_2484_8086_1958, 0};
+#undef pci_ss_info_8086_1958
+#define pci_ss_info_8086_1958 pci_ss_info_8086_2484_8086_1958
+static const pciSubsystemInfo pci_ss_info_8086_2485_1014_0222 =
+ {0x1014, 0x0222, pci_subsys_8086_2485_1014_0222, 0};
+#undef pci_ss_info_1014_0222
+#define pci_ss_info_1014_0222 pci_ss_info_8086_2485_1014_0222
+static const pciSubsystemInfo pci_ss_info_8086_2485_1014_0508 =
+ {0x1014, 0x0508, pci_subsys_8086_2485_1014_0508, 0};
+#undef pci_ss_info_1014_0508
+#define pci_ss_info_1014_0508 pci_ss_info_8086_2485_1014_0508
+static const pciSubsystemInfo pci_ss_info_8086_2485_1014_051c =
+ {0x1014, 0x051c, pci_subsys_8086_2485_1014_051c, 0};
+#undef pci_ss_info_1014_051c
+#define pci_ss_info_1014_051c pci_ss_info_8086_2485_1014_051c
+static const pciSubsystemInfo pci_ss_info_8086_2485_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_2485_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_2485_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_2485_144d_c006 =
+ {0x144d, 0xc006, pci_subsys_8086_2485_144d_c006, 0};
+#undef pci_ss_info_144d_c006
+#define pci_ss_info_144d_c006 pci_ss_info_8086_2485_144d_c006
+static const pciSubsystemInfo pci_ss_info_8086_2486_1014_0223 =
+ {0x1014, 0x0223, pci_subsys_8086_2486_1014_0223, 0};
+#undef pci_ss_info_1014_0223
+#define pci_ss_info_1014_0223 pci_ss_info_8086_2486_1014_0223
+static const pciSubsystemInfo pci_ss_info_8086_2486_1014_0503 =
+ {0x1014, 0x0503, pci_subsys_8086_2486_1014_0503, 0};
+#undef pci_ss_info_1014_0503
+#define pci_ss_info_1014_0503 pci_ss_info_8086_2486_1014_0503
+static const pciSubsystemInfo pci_ss_info_8086_2486_1014_051a =
+ {0x1014, 0x051a, pci_subsys_8086_2486_1014_051a, 0};
+#undef pci_ss_info_1014_051a
+#define pci_ss_info_1014_051a pci_ss_info_8086_2486_1014_051a
+static const pciSubsystemInfo pci_ss_info_8086_2486_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_2486_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_2486_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_2486_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_8086_2486_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_8086_2486_1179_0001
+static const pciSubsystemInfo pci_ss_info_8086_2486_134d_4c21 =
+ {0x134d, 0x4c21, pci_subsys_8086_2486_134d_4c21, 0};
+#undef pci_ss_info_134d_4c21
+#define pci_ss_info_134d_4c21 pci_ss_info_8086_2486_134d_4c21
+static const pciSubsystemInfo pci_ss_info_8086_2486_144d_2115 =
+ {0x144d, 0x2115, pci_subsys_8086_2486_144d_2115, 0};
+#undef pci_ss_info_144d_2115
+#define pci_ss_info_144d_2115 pci_ss_info_8086_2486_144d_2115
+static const pciSubsystemInfo pci_ss_info_8086_2486_14f1_5421 =
+ {0x14f1, 0x5421, pci_subsys_8086_2486_14f1_5421, 0};
+#undef pci_ss_info_14f1_5421
+#define pci_ss_info_14f1_5421 pci_ss_info_8086_2486_14f1_5421
+static const pciSubsystemInfo pci_ss_info_8086_2487_1014_0220 =
+ {0x1014, 0x0220, pci_subsys_8086_2487_1014_0220, 0};
+#undef pci_ss_info_1014_0220
+#define pci_ss_info_1014_0220 pci_ss_info_8086_2487_1014_0220
+static const pciSubsystemInfo pci_ss_info_8086_2487_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_2487_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_2487_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_2487_15d9_3480 =
+ {0x15d9, 0x3480, pci_subsys_8086_2487_15d9_3480, 0};
+#undef pci_ss_info_15d9_3480
+#define pci_ss_info_15d9_3480 pci_ss_info_8086_2487_15d9_3480
+static const pciSubsystemInfo pci_ss_info_8086_2487_8086_1958 =
+ {0x8086, 0x1958, pci_subsys_8086_2487_8086_1958, 0};
+#undef pci_ss_info_8086_1958
+#define pci_ss_info_8086_1958 pci_ss_info_8086_2487_8086_1958
+static const pciSubsystemInfo pci_ss_info_8086_248a_1014_0220 =
+ {0x1014, 0x0220, pci_subsys_8086_248a_1014_0220, 0};
+#undef pci_ss_info_1014_0220
+#define pci_ss_info_1014_0220 pci_ss_info_8086_248a_1014_0220
+static const pciSubsystemInfo pci_ss_info_8086_248a_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_248a_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_248a_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_248a_8086_1958 =
+ {0x8086, 0x1958, pci_subsys_8086_248a_8086_1958, 0};
+#undef pci_ss_info_8086_1958
+#define pci_ss_info_8086_1958 pci_ss_info_8086_248a_8086_1958
+static const pciSubsystemInfo pci_ss_info_8086_248b_15d9_3480 =
+ {0x15d9, 0x3480, pci_subsys_8086_248b_15d9_3480, 0};
+#undef pci_ss_info_15d9_3480
+#define pci_ss_info_15d9_3480 pci_ss_info_8086_248b_15d9_3480
+static const pciSubsystemInfo pci_ss_info_8086_24c0_1462_5800 =
+ {0x1462, 0x5800, pci_subsys_8086_24c0_1462_5800, 0};
+#undef pci_ss_info_1462_5800
+#define pci_ss_info_1462_5800 pci_ss_info_8086_24c0_1462_5800
+static const pciSubsystemInfo pci_ss_info_8086_24c2_1462_5800 =
+ {0x1462, 0x5800, pci_subsys_8086_24c2_1462_5800, 0};
+#undef pci_ss_info_1462_5800
+#define pci_ss_info_1462_5800 pci_ss_info_8086_24c2_1462_5800
+static const pciSubsystemInfo pci_ss_info_8086_24c3_1462_5800 =
+ {0x1462, 0x5800, pci_subsys_8086_24c3_1462_5800, 0};
+#undef pci_ss_info_1462_5800
+#define pci_ss_info_1462_5800 pci_ss_info_8086_24c3_1462_5800
+static const pciSubsystemInfo pci_ss_info_8086_24c4_1462_5800 =
+ {0x1462, 0x5800, pci_subsys_8086_24c4_1462_5800, 0};
+#undef pci_ss_info_1462_5800
+#define pci_ss_info_1462_5800 pci_ss_info_8086_24c4_1462_5800
+static const pciSubsystemInfo pci_ss_info_8086_24c5_1462_5800 =
+ {0x1462, 0x5800, pci_subsys_8086_24c5_1462_5800, 0};
+#undef pci_ss_info_1462_5800
+#define pci_ss_info_1462_5800 pci_ss_info_8086_24c5_1462_5800
+static const pciSubsystemInfo pci_ss_info_8086_24c7_1462_5800 =
+ {0x1462, 0x5800, pci_subsys_8086_24c7_1462_5800, 0};
+#undef pci_ss_info_1462_5800
+#define pci_ss_info_1462_5800 pci_ss_info_8086_24c7_1462_5800
+static const pciSubsystemInfo pci_ss_info_8086_24cb_1462_5800 =
+ {0x1462, 0x5800, pci_subsys_8086_24cb_1462_5800, 0};
+#undef pci_ss_info_1462_5800
+#define pci_ss_info_1462_5800 pci_ss_info_8086_24cb_1462_5800
+static const pciSubsystemInfo pci_ss_info_8086_24cd_1462_3981 =
+ {0x1462, 0x3981, pci_subsys_8086_24cd_1462_3981, 0};
+#undef pci_ss_info_1462_3981
+#define pci_ss_info_1462_3981 pci_ss_info_8086_24cd_1462_3981
+static const pciSubsystemInfo pci_ss_info_8086_2500_1028_0095 =
+ {0x1028, 0x0095, pci_subsys_8086_2500_1028_0095, 0};
+#undef pci_ss_info_1028_0095
+#define pci_ss_info_1028_0095 pci_ss_info_8086_2500_1028_0095
+static const pciSubsystemInfo pci_ss_info_8086_2500_1043_801c =
+ {0x1043, 0x801c, pci_subsys_8086_2500_1043_801c, 0};
+#undef pci_ss_info_1043_801c
+#define pci_ss_info_1043_801c pci_ss_info_8086_2500_1043_801c
+static const pciSubsystemInfo pci_ss_info_8086_2501_1043_801c =
+ {0x1043, 0x801c, pci_subsys_8086_2501_1043_801c, 0};
+#undef pci_ss_info_1043_801c
+#define pci_ss_info_1043_801c pci_ss_info_8086_2501_1043_801c
+static const pciSubsystemInfo pci_ss_info_8086_2530_147b_0507 =
+ {0x147b, 0x0507, pci_subsys_8086_2530_147b_0507, 0};
+#undef pci_ss_info_147b_0507
+#define pci_ss_info_147b_0507 pci_ss_info_8086_2530_147b_0507
+static const pciSubsystemInfo pci_ss_info_8086_2540_15d9_3480 =
+ {0x15d9, 0x3480, pci_subsys_8086_2540_15d9_3480, 0};
+#undef pci_ss_info_15d9_3480
+#define pci_ss_info_15d9_3480 pci_ss_info_8086_2540_15d9_3480
+static const pciSubsystemInfo pci_ss_info_8086_2541_15d9_3480 =
+ {0x15d9, 0x3480, pci_subsys_8086_2541_15d9_3480, 0};
+#undef pci_ss_info_15d9_3480
+#define pci_ss_info_15d9_3480 pci_ss_info_8086_2541_15d9_3480
+static const pciSubsystemInfo pci_ss_info_8086_2560_1462_5800 =
+ {0x1462, 0x5800, pci_subsys_8086_2560_1462_5800, 0};
+#undef pci_ss_info_1462_5800
+#define pci_ss_info_1462_5800 pci_ss_info_8086_2560_1462_5800
+static const pciSubsystemInfo pci_ss_info_8086_3575_1014_021d =
+ {0x1014, 0x021d, pci_subsys_8086_3575_1014_021d, 0};
+#undef pci_ss_info_1014_021d
+#define pci_ss_info_1014_021d pci_ss_info_8086_3575_1014_021d
+static const pciSubsystemInfo pci_ss_info_8086_3575_104d_80e7 =
+ {0x104d, 0x80e7, pci_subsys_8086_3575_104d_80e7, 0};
+#undef pci_ss_info_104d_80e7
+#define pci_ss_info_104d_80e7 pci_ss_info_8086_3575_104d_80e7
+static const pciSubsystemInfo pci_ss_info_8086_3577_1014_0513 =
+ {0x1014, 0x0513, pci_subsys_8086_3577_1014_0513, 0};
+#undef pci_ss_info_1014_0513
+#define pci_ss_info_1014_0513 pci_ss_info_8086_3577_1014_0513
+static const pciSubsystemInfo pci_ss_info_8086_5201_8086_0001 =
+ {0x8086, 0x0001, pci_subsys_8086_5201_8086_0001, 0};
+#undef pci_ss_info_8086_0001
+#define pci_ss_info_8086_0001 pci_ss_info_8086_5201_8086_0001
+static const pciSubsystemInfo pci_ss_info_8086_7190_0e11_0500 =
+ {0x0e11, 0x0500, pci_subsys_8086_7190_0e11_0500, 0};
+#undef pci_ss_info_0e11_0500
+#define pci_ss_info_0e11_0500 pci_ss_info_8086_7190_0e11_0500
+static const pciSubsystemInfo pci_ss_info_8086_7190_0e11_b110 =
+ {0x0e11, 0xb110, pci_subsys_8086_7190_0e11_b110, 0};
+#undef pci_ss_info_0e11_b110
+#define pci_ss_info_0e11_b110 pci_ss_info_8086_7190_0e11_b110
+static const pciSubsystemInfo pci_ss_info_8086_7190_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_8086_7190_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_8086_7190_1179_0001
+static const pciSubsystemInfo pci_ss_info_8086_7192_0e11_0460 =
+ {0x0e11, 0x0460, pci_subsys_8086_7192_0e11_0460, 0};
+#undef pci_ss_info_0e11_0460
+#define pci_ss_info_0e11_0460 pci_ss_info_8086_7192_0e11_0460
+static const pciSubsystemInfo pci_ss_info_8086_7195_10cf_1099 =
+ {0x10cf, 0x1099, pci_subsys_8086_7195_10cf_1099, 0};
+#undef pci_ss_info_10cf_1099
+#define pci_ss_info_10cf_1099 pci_ss_info_8086_7195_10cf_1099
+static const pciSubsystemInfo pci_ss_info_8086_7195_11d4_0040 =
+ {0x11d4, 0x0040, pci_subsys_8086_7195_11d4_0040, 0};
+#undef pci_ss_info_11d4_0040
+#define pci_ss_info_11d4_0040 pci_ss_info_8086_7195_11d4_0040
+static const pciSubsystemInfo pci_ss_info_8086_7195_11d4_0048 =
+ {0x11d4, 0x0048, pci_subsys_8086_7195_11d4_0048, 0};
+#undef pci_ss_info_11d4_0048
+#define pci_ss_info_11d4_0048 pci_ss_info_8086_7195_11d4_0048
+static const pciSubsystemInfo pci_ss_info_8086_7800_003d_0008 =
+ {0x003d, 0x0008, pci_subsys_8086_7800_003d_0008, 0};
+#undef pci_ss_info_003d_0008
+#define pci_ss_info_003d_0008 pci_ss_info_8086_7800_003d_0008
+static const pciSubsystemInfo pci_ss_info_8086_7800_003d_000b =
+ {0x003d, 0x000b, pci_subsys_8086_7800_003d_000b, 0};
+#undef pci_ss_info_003d_000b
+#define pci_ss_info_003d_000b pci_ss_info_8086_7800_003d_000b
+static const pciSubsystemInfo pci_ss_info_8086_7800_1092_0100 =
+ {0x1092, 0x0100, pci_subsys_8086_7800_1092_0100, 0};
+#undef pci_ss_info_1092_0100
+#define pci_ss_info_1092_0100 pci_ss_info_8086_7800_1092_0100
+static const pciSubsystemInfo pci_ss_info_8086_7800_10b4_201a =
+ {0x10b4, 0x201a, pci_subsys_8086_7800_10b4_201a, 0};
+#undef pci_ss_info_10b4_201a
+#define pci_ss_info_10b4_201a pci_ss_info_8086_7800_10b4_201a
+static const pciSubsystemInfo pci_ss_info_8086_7800_10b4_202f =
+ {0x10b4, 0x202f, pci_subsys_8086_7800_10b4_202f, 0};
+#undef pci_ss_info_10b4_202f
+#define pci_ss_info_10b4_202f pci_ss_info_8086_7800_10b4_202f
+static const pciSubsystemInfo pci_ss_info_8086_7800_8086_0000 =
+ {0x8086, 0x0000, pci_subsys_8086_7800_8086_0000, 0};
+#undef pci_ss_info_8086_0000
+#define pci_ss_info_8086_0000 pci_ss_info_8086_7800_8086_0000
+static const pciSubsystemInfo pci_ss_info_8086_7800_8086_0100 =
+ {0x8086, 0x0100, pci_subsys_8086_7800_8086_0100, 0};
+#undef pci_ss_info_8086_0100
+#define pci_ss_info_8086_0100 pci_ss_info_8086_7800_8086_0100
+static const pciSubsystemInfo pci_ss_info_8086_b555_e4bf_1000 =
+ {0xe4bf, 0x1000, pci_subsys_8086_b555_e4bf_1000, 0};
+#undef pci_ss_info_e4bf_1000
+#define pci_ss_info_e4bf_1000 pci_ss_info_8086_b555_e4bf_1000
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_9004_5078_9004_7850 =
+ {0x9004, 0x7850, pci_subsys_9004_5078_9004_7850, 0};
+#undef pci_ss_info_9004_7850
+#define pci_ss_info_9004_7850 pci_ss_info_9004_5078_9004_7850
+static const pciSubsystemInfo pci_ss_info_9004_5647_9004_7710 =
+ {0x9004, 0x7710, pci_subsys_9004_5647_9004_7710, 0};
+#undef pci_ss_info_9004_7710
+#define pci_ss_info_9004_7710 pci_ss_info_9004_5647_9004_7710
+static const pciSubsystemInfo pci_ss_info_9004_5647_9004_7711 =
+ {0x9004, 0x7711, pci_subsys_9004_5647_9004_7711, 0};
+#undef pci_ss_info_9004_7711
+#define pci_ss_info_9004_7711 pci_ss_info_9004_5647_9004_7711
+static const pciSubsystemInfo pci_ss_info_9004_6075_9004_7560 =
+ {0x9004, 0x7560, pci_subsys_9004_6075_9004_7560, 0};
+#undef pci_ss_info_9004_7560
+#define pci_ss_info_9004_7560 pci_ss_info_9004_6075_9004_7560
+static const pciSubsystemInfo pci_ss_info_9004_6178_9004_7861 =
+ {0x9004, 0x7861, pci_subsys_9004_6178_9004_7861, 0};
+#undef pci_ss_info_9004_7861
+#define pci_ss_info_9004_7861 pci_ss_info_9004_6178_9004_7861
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0008 =
+ {0x9004, 0x0008, pci_subsys_9004_6915_9004_0008, 0};
+#undef pci_ss_info_9004_0008
+#define pci_ss_info_9004_0008 pci_ss_info_9004_6915_9004_0008
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0009 =
+ {0x9004, 0x0009, pci_subsys_9004_6915_9004_0009, 0};
+#undef pci_ss_info_9004_0009
+#define pci_ss_info_9004_0009 pci_ss_info_9004_6915_9004_0009
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0010 =
+ {0x9004, 0x0010, pci_subsys_9004_6915_9004_0010, 0};
+#undef pci_ss_info_9004_0010
+#define pci_ss_info_9004_0010 pci_ss_info_9004_6915_9004_0010
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0018 =
+ {0x9004, 0x0018, pci_subsys_9004_6915_9004_0018, 0};
+#undef pci_ss_info_9004_0018
+#define pci_ss_info_9004_0018 pci_ss_info_9004_6915_9004_0018
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0019 =
+ {0x9004, 0x0019, pci_subsys_9004_6915_9004_0019, 0};
+#undef pci_ss_info_9004_0019
+#define pci_ss_info_9004_0019 pci_ss_info_9004_6915_9004_0019
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0020 =
+ {0x9004, 0x0020, pci_subsys_9004_6915_9004_0020, 0};
+#undef pci_ss_info_9004_0020
+#define pci_ss_info_9004_0020 pci_ss_info_9004_6915_9004_0020
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_0028 =
+ {0x9004, 0x0028, pci_subsys_9004_6915_9004_0028, 0};
+#undef pci_ss_info_9004_0028
+#define pci_ss_info_9004_0028 pci_ss_info_9004_6915_9004_0028
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8008 =
+ {0x9004, 0x8008, pci_subsys_9004_6915_9004_8008, 0};
+#undef pci_ss_info_9004_8008
+#define pci_ss_info_9004_8008 pci_ss_info_9004_6915_9004_8008
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8009 =
+ {0x9004, 0x8009, pci_subsys_9004_6915_9004_8009, 0};
+#undef pci_ss_info_9004_8009
+#define pci_ss_info_9004_8009 pci_ss_info_9004_6915_9004_8009
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8010 =
+ {0x9004, 0x8010, pci_subsys_9004_6915_9004_8010, 0};
+#undef pci_ss_info_9004_8010
+#define pci_ss_info_9004_8010 pci_ss_info_9004_6915_9004_8010
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8018 =
+ {0x9004, 0x8018, pci_subsys_9004_6915_9004_8018, 0};
+#undef pci_ss_info_9004_8018
+#define pci_ss_info_9004_8018 pci_ss_info_9004_6915_9004_8018
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8019 =
+ {0x9004, 0x8019, pci_subsys_9004_6915_9004_8019, 0};
+#undef pci_ss_info_9004_8019
+#define pci_ss_info_9004_8019 pci_ss_info_9004_6915_9004_8019
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8020 =
+ {0x9004, 0x8020, pci_subsys_9004_6915_9004_8020, 0};
+#undef pci_ss_info_9004_8020
+#define pci_ss_info_9004_8020 pci_ss_info_9004_6915_9004_8020
+static const pciSubsystemInfo pci_ss_info_9004_6915_9004_8028 =
+ {0x9004, 0x8028, pci_subsys_9004_6915_9004_8028, 0};
+#undef pci_ss_info_9004_8028
+#define pci_ss_info_9004_8028 pci_ss_info_9004_6915_9004_8028
+static const pciSubsystemInfo pci_ss_info_9004_7815_9004_7815 =
+ {0x9004, 0x7815, pci_subsys_9004_7815_9004_7815, 0};
+#undef pci_ss_info_9004_7815
+#define pci_ss_info_9004_7815 pci_ss_info_9004_7815_9004_7815
+static const pciSubsystemInfo pci_ss_info_9004_7815_9004_7840 =
+ {0x9004, 0x7840, pci_subsys_9004_7815_9004_7840, 0};
+#undef pci_ss_info_9004_7840
+#define pci_ss_info_9004_7840 pci_ss_info_9004_7815_9004_7840
+static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7890 =
+ {0x9004, 0x7890, pci_subsys_9004_7895_9004_7890, 0};
+#undef pci_ss_info_9004_7890
+#define pci_ss_info_9004_7890 pci_ss_info_9004_7895_9004_7890
+static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7891 =
+ {0x9004, 0x7891, pci_subsys_9004_7895_9004_7891, 0};
+#undef pci_ss_info_9004_7891
+#define pci_ss_info_9004_7891 pci_ss_info_9004_7895_9004_7891
+static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7892 =
+ {0x9004, 0x7892, pci_subsys_9004_7895_9004_7892, 0};
+#undef pci_ss_info_9004_7892
+#define pci_ss_info_9004_7892 pci_ss_info_9004_7895_9004_7892
+static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7894 =
+ {0x9004, 0x7894, pci_subsys_9004_7895_9004_7894, 0};
+#undef pci_ss_info_9004_7894
+#define pci_ss_info_9004_7894 pci_ss_info_9004_7895_9004_7894
+static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7895 =
+ {0x9004, 0x7895, pci_subsys_9004_7895_9004_7895, 0};
+#undef pci_ss_info_9004_7895
+#define pci_ss_info_9004_7895 pci_ss_info_9004_7895_9004_7895
+static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7896 =
+ {0x9004, 0x7896, pci_subsys_9004_7895_9004_7896, 0};
+#undef pci_ss_info_9004_7896
+#define pci_ss_info_9004_7896 pci_ss_info_9004_7895_9004_7896
+static const pciSubsystemInfo pci_ss_info_9004_7895_9004_7897 =
+ {0x9004, 0x7897, pci_subsys_9004_7895_9004_7897, 0};
+#undef pci_ss_info_9004_7897
+#define pci_ss_info_9004_7897 pci_ss_info_9004_7895_9004_7897
+static const pciSubsystemInfo pci_ss_info_9004_8078_9004_7880 =
+ {0x9004, 0x7880, pci_subsys_9004_8078_9004_7880, 0};
+#undef pci_ss_info_9004_7880
+#define pci_ss_info_9004_7880 pci_ss_info_9004_8078_9004_7880
+static const pciSubsystemInfo pci_ss_info_9004_8178_9004_7881 =
+ {0x9004, 0x7881, pci_subsys_9004_8178_9004_7881, 0};
+#undef pci_ss_info_9004_7881
+#define pci_ss_info_9004_7881 pci_ss_info_9004_8178_9004_7881
+static const pciSubsystemInfo pci_ss_info_9004_8778_9004_7887 =
+ {0x9004, 0x7887, pci_subsys_9004_8778_9004_7887, 0};
+#undef pci_ss_info_9004_7887
+#define pci_ss_info_9004_7887 pci_ss_info_9004_8778_9004_7887
+static const pciSubsystemInfo pci_ss_info_9004_8878_9004_7888 =
+ {0x9004, 0x7888, pci_subsys_9004_8878_9004_7888, 0};
+#undef pci_ss_info_9004_7888
+#define pci_ss_info_9004_7888 pci_ss_info_9004_8878_9004_7888
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_9005_0010_9005_2180 =
+ {0x9005, 0x2180, pci_subsys_9005_0010_9005_2180, 0};
+#undef pci_ss_info_9005_2180
+#define pci_ss_info_9005_2180 pci_ss_info_9005_0010_9005_2180
+static const pciSubsystemInfo pci_ss_info_9005_0010_9005_8100 =
+ {0x9005, 0x8100, pci_subsys_9005_0010_9005_8100, 0};
+#undef pci_ss_info_9005_8100
+#define pci_ss_info_9005_8100 pci_ss_info_9005_0010_9005_8100
+static const pciSubsystemInfo pci_ss_info_9005_0010_9005_a180 =
+ {0x9005, 0xa180, pci_subsys_9005_0010_9005_a180, 0};
+#undef pci_ss_info_9005_a180
+#define pci_ss_info_9005_a180 pci_ss_info_9005_0010_9005_a180
+static const pciSubsystemInfo pci_ss_info_9005_0010_9005_e100 =
+ {0x9005, 0xe100, pci_subsys_9005_0010_9005_e100, 0};
+#undef pci_ss_info_9005_e100
+#define pci_ss_info_9005_e100 pci_ss_info_9005_0010_9005_e100
+static const pciSubsystemInfo pci_ss_info_9005_0013_9005_0003 =
+ {0x9005, 0x0003, pci_subsys_9005_0013_9005_0003, 0};
+#undef pci_ss_info_9005_0003
+#define pci_ss_info_9005_0003 pci_ss_info_9005_0013_9005_0003
+static const pciSubsystemInfo pci_ss_info_9005_001f_9005_000f =
+ {0x9005, 0x000f, pci_subsys_9005_001f_9005_000f, 0};
+#undef pci_ss_info_9005_000f
+#define pci_ss_info_9005_000f pci_ss_info_9005_001f_9005_000f
+static const pciSubsystemInfo pci_ss_info_9005_001f_9005_a180 =
+ {0x9005, 0xa180, pci_subsys_9005_001f_9005_a180, 0};
+#undef pci_ss_info_9005_a180
+#define pci_ss_info_9005_a180 pci_ss_info_9005_001f_9005_a180
+static const pciSubsystemInfo pci_ss_info_9005_0050_9005_f500 =
+ {0x9005, 0xf500, pci_subsys_9005_0050_9005_f500, 0};
+#undef pci_ss_info_9005_f500
+#define pci_ss_info_9005_f500 pci_ss_info_9005_0050_9005_f500
+static const pciSubsystemInfo pci_ss_info_9005_0051_9005_b500 =
+ {0x9005, 0xb500, pci_subsys_9005_0051_9005_b500, 0};
+#undef pci_ss_info_9005_b500
+#define pci_ss_info_9005_b500 pci_ss_info_9005_0051_9005_b500
+static const pciSubsystemInfo pci_ss_info_9005_0053_9005_ffff =
+ {0x9005, 0xffff, pci_subsys_9005_0053_9005_ffff, 0};
+#undef pci_ss_info_9005_ffff
+#define pci_ss_info_9005_ffff pci_ss_info_9005_0053_9005_ffff
+#endif
+static const pciSubsystemInfo pci_ss_info_9005_0080_0e11_e2a0 =
+ {0x0e11, 0xe2a0, pci_subsys_9005_0080_0e11_e2a0, 0};
+#undef pci_ss_info_0e11_e2a0
+#define pci_ss_info_0e11_e2a0 pci_ss_info_9005_0080_0e11_e2a0
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_9005_0080_9005_62a0 =
+ {0x9005, 0x62a0, pci_subsys_9005_0080_9005_62a0, 0};
+#undef pci_ss_info_9005_62a0
+#define pci_ss_info_9005_62a0 pci_ss_info_9005_0080_9005_62a0
+static const pciSubsystemInfo pci_ss_info_9005_0080_9005_e220 =
+ {0x9005, 0xe220, pci_subsys_9005_0080_9005_e220, 0};
+#undef pci_ss_info_9005_e220
+#define pci_ss_info_9005_e220 pci_ss_info_9005_0080_9005_e220
+static const pciSubsystemInfo pci_ss_info_9005_0080_9005_e2a0 =
+ {0x9005, 0xe2a0, pci_subsys_9005_0080_9005_e2a0, 0};
+#undef pci_ss_info_9005_e2a0
+#define pci_ss_info_9005_e2a0 pci_ss_info_9005_0080_9005_e2a0
+static const pciSubsystemInfo pci_ss_info_9005_0081_9005_62a1 =
+ {0x9005, 0x62a1, pci_subsys_9005_0081_9005_62a1, 0};
+#undef pci_ss_info_9005_62a1
+#define pci_ss_info_9005_62a1 pci_ss_info_9005_0081_9005_62a1
+static const pciSubsystemInfo pci_ss_info_9005_008f_1179_0001 =
+ {0x1179, 0x0001, pci_subsys_9005_008f_1179_0001, 0};
+#undef pci_ss_info_1179_0001
+#define pci_ss_info_1179_0001 pci_ss_info_9005_008f_1179_0001
+static const pciSubsystemInfo pci_ss_info_9005_008f_15d9_9005 =
+ {0x15d9, 0x9005, pci_subsys_9005_008f_15d9_9005, 0};
+#undef pci_ss_info_15d9_9005
+#define pci_ss_info_15d9_9005 pci_ss_info_9005_008f_15d9_9005
+#endif
+static const pciSubsystemInfo pci_ss_info_9005_00c0_0e11_f620 =
+ {0x0e11, 0xf620, pci_subsys_9005_00c0_0e11_f620, 0};
+#undef pci_ss_info_0e11_f620
+#define pci_ss_info_0e11_f620 pci_ss_info_9005_00c0_0e11_f620
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_9005_00c0_9005_f620 =
+ {0x9005, 0xf620, pci_subsys_9005_00c0_9005_f620, 0};
+#undef pci_ss_info_9005_f620
+#define pci_ss_info_9005_f620 pci_ss_info_9005_00c0_9005_f620
+#endif
+static const pciSubsystemInfo pci_ss_info_9005_00c5_1028_00c5 =
+ {0x1028, 0x00c5, pci_subsys_9005_00c5_1028_00c5, 0};
+#undef pci_ss_info_1028_00c5
+#define pci_ss_info_1028_00c5 pci_ss_info_9005_00c5_1028_00c5
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_9005_00cf_1028_00d1 =
+ {0x1028, 0x00d1, pci_subsys_9005_00cf_1028_00d1, 0};
+#undef pci_ss_info_1028_00d1
+#define pci_ss_info_1028_00d1 pci_ss_info_9005_00cf_1028_00d1
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_9005_00cf_10f1_2462 =
+ {0x10f1, 0x2462, pci_subsys_9005_00cf_10f1_2462, 0};
+#undef pci_ss_info_10f1_2462
+#define pci_ss_info_10f1_2462 pci_ss_info_9005_00cf_10f1_2462
+static const pciSubsystemInfo pci_ss_info_9005_00cf_15d9_9005 =
+ {0x15d9, 0x9005, pci_subsys_9005_00cf_15d9_9005, 0};
+#undef pci_ss_info_15d9_9005
+#define pci_ss_info_15d9_9005 pci_ss_info_9005_00cf_15d9_9005
+static const pciSubsystemInfo pci_ss_info_9005_0250_1014_0279 =
+ {0x1014, 0x0279, pci_subsys_9005_0250_1014_0279, 0};
+#undef pci_ss_info_1014_0279
+#define pci_ss_info_1014_0279 pci_ss_info_9005_0250_1014_0279
+static const pciSubsystemInfo pci_ss_info_9005_0250_1014_028c =
+ {0x1014, 0x028c, pci_subsys_9005_0250_1014_028c, 0};
+#undef pci_ss_info_1014_028c
+#define pci_ss_info_1014_028c pci_ss_info_9005_0250_1014_028c
+#endif
+static const pciSubsystemInfo pci_ss_info_9005_0285_1028_0287 =
+ {0x1028, 0x0287, pci_subsys_9005_0285_1028_0287, 0};
+#undef pci_ss_info_1028_0287
+#define pci_ss_info_1028_0287 pci_ss_info_9005_0285_1028_0287
+#ifdef VENDOR_INCLUDE_NONVIDEO
+#endif
+static const pciSubsystemInfo pci_ss_info_9005_8011_0e11_00ac =
+ {0x0e11, 0x00ac, pci_subsys_9005_8011_0e11_00ac, 0};
+#undef pci_ss_info_0e11_00ac
+#define pci_ss_info_0e11_00ac pci_ss_info_9005_8011_0e11_00ac
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_9005_8011_9005_0041 =
+ {0x9005, 0x0041, pci_subsys_9005_8011_9005_0041, 0};
+#undef pci_ss_info_9005_0041
+#define pci_ss_info_9005_0041 pci_ss_info_9005_8011_9005_0041
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo pci_ss_info_e159_0001_0059_0001 =
+ {0x0059, 0x0001, pci_subsys_e159_0001_0059_0001, 0};
+#undef pci_ss_info_0059_0001
+#define pci_ss_info_0059_0001 pci_ss_info_e159_0001_0059_0001
+static const pciSubsystemInfo pci_ss_info_e159_0001_0059_0003 =
+ {0x0059, 0x0003, pci_subsys_e159_0001_0059_0003, 0};
+#undef pci_ss_info_0059_0003
+#define pci_ss_info_0059_0003 pci_ss_info_e159_0001_0059_0003
+#endif
+#define pci_ss_list_0675_1700 NULL
+#define pci_ss_list_0675_1702 NULL
+#define pci_ss_list_09c1_0704 NULL
+#define pci_ss_list_0e11_0001 NULL
+#define pci_ss_list_0e11_0002 NULL
+#define pci_ss_list_0e11_0049 NULL
+#define pci_ss_list_0e11_004a NULL
+#define pci_ss_list_0e11_0508 NULL
+#define pci_ss_list_0e11_1000 NULL
+#define pci_ss_list_0e11_2000 NULL
+#define pci_ss_list_0e11_3032 NULL
+#define pci_ss_list_0e11_3033 NULL
+#define pci_ss_list_0e11_3034 NULL
+#define pci_ss_list_0e11_4000 NULL
+#define pci_ss_list_0e11_6010 NULL
+#define pci_ss_list_0e11_7020 NULL
+#define pci_ss_list_0e11_a0ec NULL
+#define pci_ss_list_0e11_a0f0 NULL
+#define pci_ss_list_0e11_a0f3 NULL
+static const pciSubsystemInfo *pci_ss_list_0e11_a0f7[] = {
+ &pci_ss_info_0e11_a0f7_8086_002a,
+ &pci_ss_info_0e11_a0f7_8086_002b,
+ NULL
+};
+#define pci_ss_list_0e11_a0f8 NULL
+#define pci_ss_list_0e11_a0fc NULL
+static const pciSubsystemInfo *pci_ss_list_0e11_ae10[] = {
+ &pci_ss_info_0e11_ae10_0e11_4030,
+ &pci_ss_info_0e11_ae10_0e11_4031,
+ &pci_ss_info_0e11_ae10_0e11_4032,
+ &pci_ss_info_0e11_ae10_0e11_4033,
+ NULL
+};
+#define pci_ss_list_0e11_ae29 NULL
+#define pci_ss_list_0e11_ae2a NULL
+#define pci_ss_list_0e11_ae2b NULL
+#define pci_ss_list_0e11_ae31 NULL
+#define pci_ss_list_0e11_ae32 NULL
+#define pci_ss_list_0e11_ae33 NULL
+#define pci_ss_list_0e11_ae34 NULL
+#define pci_ss_list_0e11_ae35 NULL
+#define pci_ss_list_0e11_ae40 NULL
+#define pci_ss_list_0e11_ae43 NULL
+#define pci_ss_list_0e11_ae69 NULL
+#define pci_ss_list_0e11_ae6c NULL
+#define pci_ss_list_0e11_ae6d NULL
+#define pci_ss_list_0e11_b011 NULL
+#define pci_ss_list_0e11_b012 NULL
+#define pci_ss_list_0e11_b01e NULL
+#define pci_ss_list_0e11_b01f NULL
+#define pci_ss_list_0e11_b02f NULL
+#define pci_ss_list_0e11_b030 NULL
+#define pci_ss_list_0e11_b04a NULL
+#define pci_ss_list_0e11_b060 NULL
+#define pci_ss_list_0e11_b0c6 NULL
+#define pci_ss_list_0e11_b0c7 NULL
+#define pci_ss_list_0e11_b0d7 NULL
+#define pci_ss_list_0e11_b0dd NULL
+#define pci_ss_list_0e11_b0de NULL
+#define pci_ss_list_0e11_b0df NULL
+#define pci_ss_list_0e11_b0e0 NULL
+#define pci_ss_list_0e11_b0e1 NULL
+#define pci_ss_list_0e11_b123 NULL
+#define pci_ss_list_0e11_b134 NULL
+#define pci_ss_list_0e11_b13c NULL
+#define pci_ss_list_0e11_b144 NULL
+#define pci_ss_list_0e11_b163 NULL
+#define pci_ss_list_0e11_b164 NULL
+#define pci_ss_list_0e11_b178 NULL
+#define pci_ss_list_0e11_b1a4 NULL
+#define pci_ss_list_0e11_f130 NULL
+#define pci_ss_list_0e11_f150 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1000_0001[] = {
+ &pci_ss_info_1000_0001_1000_1000,
+ NULL
+};
+#define pci_ss_list_1000_0002 NULL
+#define pci_ss_list_1000_0003 NULL
+#define pci_ss_list_1000_0004 NULL
+#define pci_ss_list_1000_0005 NULL
+#define pci_ss_list_1000_0006 NULL
+#define pci_ss_list_1000_000a NULL
+#define pci_ss_list_1000_000b NULL
+static const pciSubsystemInfo *pci_ss_list_1000_000c[] = {
+ &pci_ss_info_1000_000c_1de1_3907,
+ NULL
+};
+#define pci_ss_list_1000_000d NULL
+static const pciSubsystemInfo *pci_ss_list_1000_000f[] = {
+ &pci_ss_info_1000_000f_0e11_7004,
+ &pci_ss_info_1000_000f_1092_8760,
+ &pci_ss_info_1000_000f_1de1_3904,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1000_0010[] = {
+ &pci_ss_info_1000_0010_0e11_4040,
+ &pci_ss_info_1000_0010_0e11_4048,
+ NULL
+};
+#define pci_ss_list_1000_0012 NULL
+#define pci_ss_list_1000_0013 NULL
+static const pciSubsystemInfo *pci_ss_list_1000_0020[] = {
+ &pci_ss_info_1000_0020_1de1_1020,
+ NULL
+};
+#define pci_ss_list_1000_0021 NULL
+static const pciSubsystemInfo *pci_ss_list_1000_0030[] = {
+ &pci_ss_info_1000_0030_1028_1010,
+ NULL
+};
+#define pci_ss_list_1000_0040 NULL
+static const pciSubsystemInfo *pci_ss_list_1000_008f[] = {
+ &pci_ss_info_1000_008f_1092_8000,
+ &pci_ss_info_1000_008f_1092_8760,
+ NULL
+};
+#define pci_ss_list_1000_0621 NULL
+#define pci_ss_list_1000_0622 NULL
+#define pci_ss_list_1000_0623 NULL
+#define pci_ss_list_1000_0624 NULL
+#define pci_ss_list_1000_0625 NULL
+#define pci_ss_list_1000_0626 NULL
+#define pci_ss_list_1000_0627 NULL
+#define pci_ss_list_1000_0628 NULL
+#define pci_ss_list_1000_0629 NULL
+#define pci_ss_list_1000_0701 NULL
+static const pciSubsystemInfo *pci_ss_list_1000_0702[] = {
+ &pci_ss_info_1000_0702_1318_0000,
+ NULL
+};
+#define pci_ss_list_1000_0901 NULL
+#define pci_ss_list_1000_1000 NULL
+static const pciSubsystemInfo *pci_ss_list_1000_1960[] = {
+ &pci_ss_info_1000_1960_1028_0518,
+ &pci_ss_info_1000_1960_1028_0520,
+ &pci_ss_info_1000_1960_1028_0531,
+ NULL
+};
+#endif
+#define pci_ss_list_1001_0010 NULL
+#define pci_ss_list_1001_0011 NULL
+#define pci_ss_list_1001_0012 NULL
+#define pci_ss_list_1001_0013 NULL
+#define pci_ss_list_1001_0014 NULL
+#define pci_ss_list_1001_0015 NULL
+#define pci_ss_list_1001_0016 NULL
+#define pci_ss_list_1001_0017 NULL
+#define pci_ss_list_1001_9100 NULL
+#define pci_ss_list_1002_4144 NULL
+#define pci_ss_list_1002_4145 NULL
+#define pci_ss_list_1002_4146 NULL
+#define pci_ss_list_1002_4147 NULL
+#define pci_ss_list_1002_4158 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4242[] = {
+ &pci_ss_info_1002_4242_1002_02aa,
+ NULL
+};
+#define pci_ss_list_1002_4336 NULL
+#define pci_ss_list_1002_4337 NULL
+#define pci_ss_list_1002_4354 NULL
+#define pci_ss_list_1002_4358 NULL
+#define pci_ss_list_1002_4554 NULL
+#define pci_ss_list_1002_4654 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4742[] = {
+ &pci_ss_info_1002_4742_1002_0040,
+ &pci_ss_info_1002_4742_1002_0044,
+ &pci_ss_info_1002_4742_1002_0061,
+ &pci_ss_info_1002_4742_1002_0062,
+ &pci_ss_info_1002_4742_1002_0063,
+ &pci_ss_info_1002_4742_1002_0080,
+ &pci_ss_info_1002_4742_1002_0084,
+ &pci_ss_info_1002_4742_1002_4742,
+ &pci_ss_info_1002_4742_1002_8001,
+ &pci_ss_info_1002_4742_1028_0082,
+ &pci_ss_info_1002_4742_1028_4082,
+ &pci_ss_info_1002_4742_1028_8082,
+ &pci_ss_info_1002_4742_1028_c082,
+ &pci_ss_info_1002_4742_8086_4152,
+ &pci_ss_info_1002_4742_8086_464a,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_4744[] = {
+ &pci_ss_info_1002_4744_1002_4744,
+ NULL
+};
+#define pci_ss_list_1002_4747 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4749[] = {
+ &pci_ss_info_1002_4749_1002_0061,
+ &pci_ss_info_1002_4749_1002_0062,
+ NULL
+};
+#define pci_ss_list_1002_474c NULL
+static const pciSubsystemInfo *pci_ss_list_1002_474d[] = {
+ &pci_ss_info_1002_474d_1002_0004,
+ &pci_ss_info_1002_474d_1002_0008,
+ &pci_ss_info_1002_474d_1002_0080,
+ &pci_ss_info_1002_474d_1002_0084,
+ &pci_ss_info_1002_474d_1002_474d,
+ &pci_ss_info_1002_474d_1033_806a,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_474e[] = {
+ &pci_ss_info_1002_474e_1002_474e,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_474f[] = {
+ &pci_ss_info_1002_474f_1002_0008,
+ &pci_ss_info_1002_474f_1002_474f,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_4750[] = {
+ &pci_ss_info_1002_4750_1002_0040,
+ &pci_ss_info_1002_4750_1002_0044,
+ &pci_ss_info_1002_4750_1002_0080,
+ &pci_ss_info_1002_4750_1002_0084,
+ &pci_ss_info_1002_4750_1002_4750,
+ NULL
+};
+#define pci_ss_list_1002_4751 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4752[] = {
+ &pci_ss_info_1002_4752_1002_0008,
+ &pci_ss_info_1002_4752_1002_4752,
+ &pci_ss_info_1002_4752_1002_8008,
+ &pci_ss_info_1002_4752_1028_00d1,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_4753[] = {
+ &pci_ss_info_1002_4753_1002_4753,
+ NULL
+};
+#define pci_ss_list_1002_4754 NULL
+#define pci_ss_list_1002_4755 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4756[] = {
+ &pci_ss_info_1002_4756_1002_4756,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_4757[] = {
+ &pci_ss_info_1002_4757_1002_4757,
+ &pci_ss_info_1002_4757_1028_0089,
+ &pci_ss_info_1002_4757_1028_4082,
+ &pci_ss_info_1002_4757_1028_8082,
+ &pci_ss_info_1002_4757_1028_c082,
+ NULL
+};
+#define pci_ss_list_1002_4758 NULL
+#define pci_ss_list_1002_4759 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_475a[] = {
+ &pci_ss_info_1002_475a_1002_0087,
+ &pci_ss_info_1002_475a_1002_475a,
+ NULL
+};
+#define pci_ss_list_1002_4964 NULL
+#define pci_ss_list_1002_4965 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4966[] = {
+ &pci_ss_info_1002_4966_10f1_0002,
+ &pci_ss_info_1002_4966_148c_2039,
+ &pci_ss_info_1002_4966_1509_9a00,
+ &pci_ss_info_1002_4966_1681_0040,
+ &pci_ss_info_1002_4966_174b_7176,
+ &pci_ss_info_1002_4966_174b_7192,
+ &pci_ss_info_1002_4966_17af_2005,
+ &pci_ss_info_1002_4966_17af_2006,
+ NULL
+};
+#define pci_ss_list_1002_4967 NULL
+#define pci_ss_list_1002_496e NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4c42[] = {
+ &pci_ss_info_1002_4c42_0e11_b0e8,
+ &pci_ss_info_1002_4c42_0e11_b10e,
+ &pci_ss_info_1002_4c42_1002_0040,
+ &pci_ss_info_1002_4c42_1002_0044,
+ &pci_ss_info_1002_4c42_1002_4c42,
+ &pci_ss_info_1002_4c42_1002_8001,
+ &pci_ss_info_1002_4c42_1028_0085,
+ NULL
+};
+#define pci_ss_list_1002_4c44 NULL
+#define pci_ss_list_1002_4c45 NULL
+#define pci_ss_list_1002_4c46 NULL
+#define pci_ss_list_1002_4c47 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4c49[] = {
+ &pci_ss_info_1002_4c49_1002_0004,
+ &pci_ss_info_1002_4c49_1002_0040,
+ &pci_ss_info_1002_4c49_1002_0044,
+ &pci_ss_info_1002_4c49_1002_4c49,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_4c4d[] = {
+ &pci_ss_info_1002_4c4d_0e11_b111,
+ &pci_ss_info_1002_4c4d_1002_0084,
+ &pci_ss_info_1002_4c4d_1014_0154,
+ NULL
+};
+#define pci_ss_list_1002_4c4e NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4c50[] = {
+ &pci_ss_info_1002_4c50_1002_4c50,
+ NULL
+};
+#define pci_ss_list_1002_4c51 NULL
+#define pci_ss_list_1002_4c52 NULL
+#define pci_ss_list_1002_4c53 NULL
+#define pci_ss_list_1002_4c54 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4c57[] = {
+ &pci_ss_info_1002_4c57_1014_0517,
+ &pci_ss_info_1002_4c57_1028_00e6,
+ &pci_ss_info_1002_4c57_144d_c006,
+ NULL
+};
+#define pci_ss_list_1002_4c58 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_4c59[] = {
+ &pci_ss_info_1002_4c59_1014_0235,
+ &pci_ss_info_1002_4c59_1014_0239,
+ &pci_ss_info_1002_4c59_104d_80e7,
+ NULL
+};
+#define pci_ss_list_1002_4c5a NULL
+#define pci_ss_list_1002_4c64 NULL
+#define pci_ss_list_1002_4c65 NULL
+#define pci_ss_list_1002_4c66 NULL
+#define pci_ss_list_1002_4c67 NULL
+#define pci_ss_list_1002_4d46 NULL
+#define pci_ss_list_1002_4d4c NULL
+#define pci_ss_list_1002_4e44 NULL
+#define pci_ss_list_1002_4e45 NULL
+#define pci_ss_list_1002_4e46 NULL
+#define pci_ss_list_1002_4e47 NULL
+#define pci_ss_list_1002_4e64 NULL
+#define pci_ss_list_1002_4e65 NULL
+#define pci_ss_list_1002_4e66 NULL
+#define pci_ss_list_1002_4e67 NULL
+#define pci_ss_list_1002_5041 NULL
+#define pci_ss_list_1002_5042 NULL
+#define pci_ss_list_1002_5043 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5044[] = {
+ &pci_ss_info_1002_5044_1002_0028,
+ &pci_ss_info_1002_5044_1002_0029,
+ NULL
+};
+#define pci_ss_list_1002_5045 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5046[] = {
+ &pci_ss_info_1002_5046_1002_0004,
+ &pci_ss_info_1002_5046_1002_0008,
+ &pci_ss_info_1002_5046_1002_0014,
+ &pci_ss_info_1002_5046_1002_0018,
+ &pci_ss_info_1002_5046_1002_0028,
+ &pci_ss_info_1002_5046_1002_002a,
+ &pci_ss_info_1002_5046_1002_0048,
+ &pci_ss_info_1002_5046_1002_2000,
+ &pci_ss_info_1002_5046_1002_2001,
+ NULL
+};
+#define pci_ss_list_1002_5047 NULL
+#define pci_ss_list_1002_5048 NULL
+#define pci_ss_list_1002_5049 NULL
+#define pci_ss_list_1002_504a NULL
+#define pci_ss_list_1002_504b NULL
+#define pci_ss_list_1002_504c NULL
+#define pci_ss_list_1002_504d NULL
+#define pci_ss_list_1002_504e NULL
+#define pci_ss_list_1002_504f NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5050[] = {
+ &pci_ss_info_1002_5050_1002_0008,
+ NULL
+};
+#define pci_ss_list_1002_5051 NULL
+#define pci_ss_list_1002_5052 NULL
+#define pci_ss_list_1002_5053 NULL
+#define pci_ss_list_1002_5054 NULL
+#define pci_ss_list_1002_5055 NULL
+#define pci_ss_list_1002_5056 NULL
+#define pci_ss_list_1002_5057 NULL
+#define pci_ss_list_1002_5058 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5144[] = {
+ &pci_ss_info_1002_5144_1002_0008,
+ &pci_ss_info_1002_5144_1002_0009,
+ &pci_ss_info_1002_5144_1002_000a,
+ &pci_ss_info_1002_5144_1002_001a,
+ &pci_ss_info_1002_5144_1002_0029,
+ &pci_ss_info_1002_5144_1002_0038,
+ &pci_ss_info_1002_5144_1002_0039,
+ &pci_ss_info_1002_5144_1002_008a,
+ &pci_ss_info_1002_5144_1002_00ba,
+ &pci_ss_info_1002_5144_1002_0139,
+ &pci_ss_info_1002_5144_1002_028a,
+ &pci_ss_info_1002_5144_1002_02aa,
+ &pci_ss_info_1002_5144_1002_053a,
+ NULL
+};
+#define pci_ss_list_1002_5145 NULL
+#define pci_ss_list_1002_5146 NULL
+#define pci_ss_list_1002_5147 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5148[] = {
+ &pci_ss_info_1002_5148_1002_010a,
+ &pci_ss_info_1002_5148_1002_0152,
+ &pci_ss_info_1002_5148_1002_0162,
+ &pci_ss_info_1002_5148_1002_0172,
+ NULL
+};
+#define pci_ss_list_1002_5149 NULL
+#define pci_ss_list_1002_514a NULL
+#define pci_ss_list_1002_514b NULL
+static const pciSubsystemInfo *pci_ss_list_1002_514c[] = {
+ &pci_ss_info_1002_514c_1002_003a,
+ &pci_ss_info_1002_514c_1002_013a,
+ &pci_ss_info_1002_514c_148c_2026,
+ &pci_ss_info_1002_514c_174b_7149,
+ NULL
+};
+#define pci_ss_list_1002_514d NULL
+#define pci_ss_list_1002_514e NULL
+#define pci_ss_list_1002_514f NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5157[] = {
+ &pci_ss_info_1002_5157_1002_013a,
+ &pci_ss_info_1002_5157_1458_4000,
+ &pci_ss_info_1002_5157_148c_2024,
+ &pci_ss_info_1002_5157_148c_2025,
+ &pci_ss_info_1002_5157_148c_2036,
+ &pci_ss_info_1002_5157_174b_7147,
+ &pci_ss_info_1002_5157_174b_7161,
+ &pci_ss_info_1002_5157_17af_0202,
+ NULL
+};
+#define pci_ss_list_1002_5158 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5159[] = {
+ &pci_ss_info_1002_5159_1002_000a,
+ &pci_ss_info_1002_5159_1002_000b,
+ &pci_ss_info_1002_5159_1002_0038,
+ &pci_ss_info_1002_5159_1002_003a,
+ &pci_ss_info_1002_5159_1002_00ba,
+ &pci_ss_info_1002_5159_1002_013a,
+ &pci_ss_info_1002_5159_1458_4002,
+ &pci_ss_info_1002_5159_148c_2003,
+ &pci_ss_info_1002_5159_148c_2023,
+ &pci_ss_info_1002_5159_174b_7112,
+ &pci_ss_info_1002_5159_1787_0202,
+ NULL
+};
+#define pci_ss_list_1002_515a NULL
+#define pci_ss_list_1002_5168 NULL
+#define pci_ss_list_1002_5169 NULL
+#define pci_ss_list_1002_516a NULL
+#define pci_ss_list_1002_516b NULL
+#define pci_ss_list_1002_516c NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5245[] = {
+ &pci_ss_info_1002_5245_1002_0008,
+ &pci_ss_info_1002_5245_1002_0028,
+ &pci_ss_info_1002_5245_1002_0029,
+ &pci_ss_info_1002_5245_1002_0068,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_5246[] = {
+ &pci_ss_info_1002_5246_1002_0004,
+ &pci_ss_info_1002_5246_1002_0008,
+ &pci_ss_info_1002_5246_1002_0028,
+ &pci_ss_info_1002_5246_1002_0044,
+ &pci_ss_info_1002_5246_1002_0068,
+ &pci_ss_info_1002_5246_1002_0448,
+ NULL
+};
+#define pci_ss_list_1002_5247 NULL
+#define pci_ss_list_1002_524b NULL
+static const pciSubsystemInfo *pci_ss_list_1002_524c[] = {
+ &pci_ss_info_1002_524c_1002_0008,
+ &pci_ss_info_1002_524c_1002_0088,
+ NULL
+};
+#define pci_ss_list_1002_5345 NULL
+#define pci_ss_list_1002_5346 NULL
+#define pci_ss_list_1002_5347 NULL
+#define pci_ss_list_1002_5348 NULL
+#define pci_ss_list_1002_534b NULL
+#define pci_ss_list_1002_534c NULL
+static const pciSubsystemInfo *pci_ss_list_1002_534d[] = {
+ &pci_ss_info_1002_534d_1002_0008,
+ &pci_ss_info_1002_534d_1002_0018,
+ NULL
+};
+#define pci_ss_list_1002_534e NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5354[] = {
+ &pci_ss_info_1002_5354_1002_5654,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1002_5446[] = {
+ &pci_ss_info_1002_5446_1002_0004,
+ &pci_ss_info_1002_5446_1002_0008,
+ &pci_ss_info_1002_5446_1002_0018,
+ &pci_ss_info_1002_5446_1002_0028,
+ &pci_ss_info_1002_5446_1002_0029,
+ &pci_ss_info_1002_5446_1002_002a,
+ &pci_ss_info_1002_5446_1002_002b,
+ &pci_ss_info_1002_5446_1002_0048,
+ NULL
+};
+#define pci_ss_list_1002_544c NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5452[] = {
+ &pci_ss_info_1002_5452_1002_001c,
+ &pci_ss_info_1002_5452_103c_1279,
+ NULL
+};
+#define pci_ss_list_1002_5453 NULL
+#define pci_ss_list_1002_5454 NULL
+#define pci_ss_list_1002_5455 NULL
+static const pciSubsystemInfo *pci_ss_list_1002_5654[] = {
+ &pci_ss_info_1002_5654_1002_5654,
+ NULL
+};
+#define pci_ss_list_1002_5655 NULL
+#define pci_ss_list_1002_5656 NULL
+#define pci_ss_list_1002_700f NULL
+#define pci_ss_list_1003_0201 NULL
+#define pci_ss_list_1004_0005 NULL
+#define pci_ss_list_1004_0006 NULL
+#define pci_ss_list_1004_0007 NULL
+#define pci_ss_list_1004_0008 NULL
+#define pci_ss_list_1004_0009 NULL
+#define pci_ss_list_1004_000c NULL
+#define pci_ss_list_1004_000d NULL
+#define pci_ss_list_1004_0101 NULL
+#define pci_ss_list_1004_0102 NULL
+#define pci_ss_list_1004_0103 NULL
+#define pci_ss_list_1004_0104 NULL
+#define pci_ss_list_1004_0105 NULL
+#define pci_ss_list_1004_0200 NULL
+#define pci_ss_list_1004_0280 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1004_0304[] = {
+ &pci_ss_info_1004_0304_1004_0304,
+ &pci_ss_info_1004_0304_122d_1206,
+ &pci_ss_info_1004_0304_1483_5020,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1004_0305[] = {
+ &pci_ss_info_1004_0305_1004_0305,
+ &pci_ss_info_1004_0305_122d_1207,
+ &pci_ss_info_1004_0305_1483_5021,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1004_0306[] = {
+ &pci_ss_info_1004_0306_1004_0306,
+ &pci_ss_info_1004_0306_122d_1208,
+ &pci_ss_info_1004_0306_1483_5022,
+ NULL
+};
+#define pci_ss_list_1004_0307 NULL
+#define pci_ss_list_1004_0308 NULL
+#define pci_ss_list_1004_0702 NULL
+#define pci_ss_list_1004_0703 NULL
+#endif
+#define pci_ss_list_1005_2064 NULL
+#define pci_ss_list_1005_2128 NULL
+#define pci_ss_list_1005_2301 NULL
+#define pci_ss_list_1005_2302 NULL
+#define pci_ss_list_1005_2364 NULL
+#define pci_ss_list_1005_2464 NULL
+#define pci_ss_list_1005_2501 NULL
+#define pci_ss_list_100b_0001 NULL
+#define pci_ss_list_100b_0002 NULL
+#define pci_ss_list_100b_000e NULL
+#define pci_ss_list_100b_000f NULL
+#define pci_ss_list_100b_0011 NULL
+#define pci_ss_list_100b_0012 NULL
+#define pci_ss_list_100b_0020 NULL
+#define pci_ss_list_100b_0022 NULL
+#define pci_ss_list_100b_0500 NULL
+#define pci_ss_list_100b_0501 NULL
+#define pci_ss_list_100b_0502 NULL
+#define pci_ss_list_100b_0503 NULL
+#define pci_ss_list_100b_0504 NULL
+#define pci_ss_list_100b_0505 NULL
+#define pci_ss_list_100b_d001 NULL
+#define pci_ss_list_100c_3202 NULL
+#define pci_ss_list_100c_3205 NULL
+#define pci_ss_list_100c_3206 NULL
+#define pci_ss_list_100c_3207 NULL
+#define pci_ss_list_100c_3208 NULL
+#define pci_ss_list_100c_4702 NULL
+#define pci_ss_list_100e_9000 NULL
+#define pci_ss_list_100e_9001 NULL
+#define pci_ss_list_100e_9002 NULL
+#define pci_ss_list_100e_9100 NULL
+#define pci_ss_list_1011_0001 NULL
+#define pci_ss_list_1011_0002 NULL
+#define pci_ss_list_1011_0004 NULL
+#define pci_ss_list_1011_0007 NULL
+#define pci_ss_list_1011_0008 NULL
+static const pciSubsystemInfo *pci_ss_list_1011_0009[] = {
+ &pci_ss_info_1011_0009_1025_0310,
+ &pci_ss_info_1011_0009_10b8_2001,
+ &pci_ss_info_1011_0009_10b8_2002,
+ &pci_ss_info_1011_0009_10b8_2003,
+ &pci_ss_info_1011_0009_1109_2400,
+ &pci_ss_info_1011_0009_1112_2300,
+ &pci_ss_info_1011_0009_1112_2320,
+ &pci_ss_info_1011_0009_1112_2340,
+ &pci_ss_info_1011_0009_1113_1207,
+ &pci_ss_info_1011_0009_1186_1100,
+ &pci_ss_info_1011_0009_1186_1112,
+ &pci_ss_info_1011_0009_1186_1140,
+ &pci_ss_info_1011_0009_1186_1142,
+ &pci_ss_info_1011_0009_11f6_0503,
+ &pci_ss_info_1011_0009_1282_9100,
+ &pci_ss_info_1011_0009_1385_1100,
+ &pci_ss_info_1011_0009_2646_0001,
+ NULL
+};
+#define pci_ss_list_1011_000a NULL
+#define pci_ss_list_1011_000d NULL
+#define pci_ss_list_1011_000f NULL
+static const pciSubsystemInfo *pci_ss_list_1011_0014[] = {
+ &pci_ss_info_1011_0014_1186_0100,
+ NULL
+};
+#define pci_ss_list_1011_0016 NULL
+static const pciSubsystemInfo *pci_ss_list_1011_0019[] = {
+ &pci_ss_info_1011_0019_1011_500a,
+ &pci_ss_info_1011_0019_1011_500b,
+ &pci_ss_info_1011_0019_1014_0001,
+ &pci_ss_info_1011_0019_1025_0315,
+ &pci_ss_info_1011_0019_1033_800c,
+ &pci_ss_info_1011_0019_1033_800d,
+ &pci_ss_info_1011_0019_108d_0016,
+ &pci_ss_info_1011_0019_108d_0017,
+ &pci_ss_info_1011_0019_10b8_2005,
+ &pci_ss_info_1011_0019_10b8_8034,
+ &pci_ss_info_1011_0019_10ef_8169,
+ &pci_ss_info_1011_0019_1109_2a00,
+ &pci_ss_info_1011_0019_1109_2b00,
+ &pci_ss_info_1011_0019_1109_3000,
+ &pci_ss_info_1011_0019_1113_1207,
+ &pci_ss_info_1011_0019_1113_2220,
+ &pci_ss_info_1011_0019_115d_0002,
+ &pci_ss_info_1011_0019_1179_0203,
+ &pci_ss_info_1011_0019_1179_0204,
+ &pci_ss_info_1011_0019_1186_1100,
+ &pci_ss_info_1011_0019_1186_1101,
+ &pci_ss_info_1011_0019_1186_1102,
+ &pci_ss_info_1011_0019_1259_2800,
+ &pci_ss_info_1011_0019_1266_0004,
+ &pci_ss_info_1011_0019_12af_0019,
+ &pci_ss_info_1011_0019_1374_0001,
+ &pci_ss_info_1011_0019_1374_0002,
+ &pci_ss_info_1011_0019_1374_0007,
+ &pci_ss_info_1011_0019_1374_0008,
+ &pci_ss_info_1011_0019_1385_2100,
+ &pci_ss_info_1011_0019_1395_0001,
+ &pci_ss_info_1011_0019_13d1_ab01,
+ &pci_ss_info_1011_0019_8086_0001,
+ NULL
+};
+#define pci_ss_list_1011_001a NULL
+#define pci_ss_list_1011_0021 NULL
+#define pci_ss_list_1011_0022 NULL
+#define pci_ss_list_1011_0023 NULL
+#define pci_ss_list_1011_0024 NULL
+#define pci_ss_list_1011_0025 NULL
+#define pci_ss_list_1011_0026 NULL
+static const pciSubsystemInfo *pci_ss_list_1011_0034[] = {
+ &pci_ss_info_1011_0034_1374_0003,
+ NULL
+};
+#define pci_ss_list_1011_0045 NULL
+static const pciSubsystemInfo *pci_ss_list_1011_0046[] = {
+ &pci_ss_info_1011_0046_0e11_4050,
+ &pci_ss_info_1011_0046_0e11_4051,
+ &pci_ss_info_1011_0046_0e11_4058,
+ &pci_ss_info_1011_0046_103c_10c2,
+ &pci_ss_info_1011_0046_12d9_000a,
+ &pci_ss_info_1011_0046_9005_0365,
+ &pci_ss_info_1011_0046_9005_1364,
+ &pci_ss_info_1011_0046_9005_1365,
+ &pci_ss_info_1011_0046_e4bf_1000,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1011_1065[] = {
+ &pci_ss_info_1011_1065_1069_0020,
+ NULL
+};
+#define pci_ss_list_1013_0038 NULL
+#define pci_ss_list_1013_0040 NULL
+#define pci_ss_list_1013_004c NULL
+#define pci_ss_list_1013_00a0 NULL
+#define pci_ss_list_1013_00a2 NULL
+#define pci_ss_list_1013_00a4 NULL
+#define pci_ss_list_1013_00a8 NULL
+#define pci_ss_list_1013_00ac NULL
+#define pci_ss_list_1013_00b0 NULL
+#define pci_ss_list_1013_00b8 NULL
+static const pciSubsystemInfo *pci_ss_list_1013_00bc[] = {
+ &pci_ss_info_1013_00bc_1013_00bc,
+ NULL
+};
+#define pci_ss_list_1013_00d0 NULL
+#define pci_ss_list_1013_00d2 NULL
+#define pci_ss_list_1013_00d4 NULL
+#define pci_ss_list_1013_00d5 NULL
+static const pciSubsystemInfo *pci_ss_list_1013_00d6[] = {
+ &pci_ss_info_1013_00d6_13ce_8031,
+ &pci_ss_info_1013_00d6_13cf_8031,
+ NULL
+};
+#define pci_ss_list_1013_00e8 NULL
+#define pci_ss_list_1013_1100 NULL
+#define pci_ss_list_1013_1110 NULL
+#define pci_ss_list_1013_1112 NULL
+#define pci_ss_list_1013_1113 NULL
+#define pci_ss_list_1013_1200 NULL
+#define pci_ss_list_1013_1202 NULL
+#define pci_ss_list_1013_1204 NULL
+#define pci_ss_list_1013_4400 NULL
+static const pciSubsystemInfo *pci_ss_list_1013_6001[] = {
+ &pci_ss_info_1013_6001_1014_1010,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1013_6003[] = {
+ &pci_ss_info_1013_6003_1013_4280,
+ &pci_ss_info_1013_6003_1681_0050,
+ &pci_ss_info_1013_6003_1681_a011,
+ NULL
+};
+#define pci_ss_list_1013_6004 NULL
+static const pciSubsystemInfo *pci_ss_list_1013_6005[] = {
+ &pci_ss_info_1013_6005_1013_4281,
+ &pci_ss_info_1013_6005_10cf_10a8,
+ &pci_ss_info_1013_6005_10cf_10a9,
+ &pci_ss_info_1013_6005_10cf_10aa,
+ &pci_ss_info_1013_6005_10cf_10ab,
+ &pci_ss_info_1013_6005_10cf_10ac,
+ &pci_ss_info_1013_6005_10cf_10ad,
+ &pci_ss_info_1013_6005_10cf_10b4,
+ &pci_ss_info_1013_6005_1179_0001,
+ &pci_ss_info_1013_6005_14c0_000c,
+ NULL
+};
+#define pci_ss_list_1014_0002 NULL
+#define pci_ss_list_1014_0005 NULL
+#define pci_ss_list_1014_0007 NULL
+#define pci_ss_list_1014_000a NULL
+#define pci_ss_list_1014_0017 NULL
+#define pci_ss_list_1014_0018 NULL
+#define pci_ss_list_1014_001b NULL
+#define pci_ss_list_1014_001c NULL
+#define pci_ss_list_1014_001d NULL
+#define pci_ss_list_1014_0020 NULL
+#define pci_ss_list_1014_0022 NULL
+#define pci_ss_list_1014_002d NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1014_002e[] = {
+ &pci_ss_info_1014_002e_1014_002e,
+ &pci_ss_info_1014_002e_1014_022e,
+ NULL
+};
+#define pci_ss_list_1014_0036 NULL
+#define pci_ss_list_1014_003a NULL
+static const pciSubsystemInfo *pci_ss_list_1014_003e[] = {
+ &pci_ss_info_1014_003e_1014_003e,
+ &pci_ss_info_1014_003e_1014_00cd,
+ &pci_ss_info_1014_003e_1014_00ce,
+ &pci_ss_info_1014_003e_1014_00cf,
+ &pci_ss_info_1014_003e_1014_00e4,
+ &pci_ss_info_1014_003e_1014_00e5,
+ &pci_ss_info_1014_003e_1014_016d,
+ NULL
+};
+#define pci_ss_list_1014_0045 NULL
+#define pci_ss_list_1014_0046 NULL
+#define pci_ss_list_1014_0047 NULL
+#define pci_ss_list_1014_0048 NULL
+#define pci_ss_list_1014_0049 NULL
+#define pci_ss_list_1014_004e NULL
+#define pci_ss_list_1014_004f NULL
+#define pci_ss_list_1014_0050 NULL
+#define pci_ss_list_1014_0053 NULL
+#define pci_ss_list_1014_0057 NULL
+#define pci_ss_list_1014_005c NULL
+#define pci_ss_list_1014_007c NULL
+#define pci_ss_list_1014_007d NULL
+static const pciSubsystemInfo *pci_ss_list_1014_0090[] = {
+ &pci_ss_info_1014_0090_1014_008e,
+ NULL
+};
+#define pci_ss_list_1014_0095 NULL
+static const pciSubsystemInfo *pci_ss_list_1014_0096[] = {
+ &pci_ss_info_1014_0096_1014_0097,
+ &pci_ss_info_1014_0096_1014_0098,
+ &pci_ss_info_1014_0096_1014_0099,
+ NULL
+};
+#define pci_ss_list_1014_00a5 NULL
+#define pci_ss_list_1014_00a6 NULL
+#define pci_ss_list_1014_00b7 NULL
+#define pci_ss_list_1014_00be NULL
+#define pci_ss_list_1014_00dc NULL
+#define pci_ss_list_1014_00fc NULL
+#define pci_ss_list_1014_0105 NULL
+#define pci_ss_list_1014_010f NULL
+static const pciSubsystemInfo *pci_ss_list_1014_0142[] = {
+ &pci_ss_info_1014_0142_1014_0143,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1014_0144[] = {
+ &pci_ss_info_1014_0144_1014_0145,
+ NULL
+};
+#define pci_ss_list_1014_0156 NULL
+#define pci_ss_list_1014_01a7 NULL
+static const pciSubsystemInfo *pci_ss_list_1014_01bd[] = {
+ &pci_ss_info_1014_01bd_1014_01be,
+ &pci_ss_info_1014_01bd_1014_01bf,
+ &pci_ss_info_1014_01bd_1014_0208,
+ &pci_ss_info_1014_01bd_1014_020e,
+ &pci_ss_info_1014_01bd_1014_022e,
+ &pci_ss_info_1014_01bd_1014_0258,
+ &pci_ss_info_1014_01bd_1014_0259,
+ NULL
+};
+#define pci_ss_list_1014_0302 NULL
+#define pci_ss_list_1014_ffff NULL
+#endif
+#define pci_ss_list_1017_5343 NULL
+#define pci_ss_list_101a_0005 NULL
+#define pci_ss_list_101c_0193 NULL
+#define pci_ss_list_101c_0196 NULL
+#define pci_ss_list_101c_0197 NULL
+#define pci_ss_list_101c_0296 NULL
+#define pci_ss_list_101c_3193 NULL
+#define pci_ss_list_101c_3197 NULL
+#define pci_ss_list_101c_3296 NULL
+#define pci_ss_list_101c_4296 NULL
+#define pci_ss_list_101c_9710 NULL
+#define pci_ss_list_101c_9712 NULL
+#define pci_ss_list_101c_c24a NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_101e_1960[] = {
+ &pci_ss_info_101e_1960_101e_0471,
+ &pci_ss_info_101e_1960_101e_0475,
+ &pci_ss_info_101e_1960_101e_0493,
+ &pci_ss_info_101e_1960_1028_0471,
+ &pci_ss_info_101e_1960_1028_0475,
+ &pci_ss_info_101e_1960_1028_0493,
+ &pci_ss_info_101e_1960_1028_0511,
+ NULL
+};
+#define pci_ss_list_101e_9010 NULL
+#define pci_ss_list_101e_9030 NULL
+#define pci_ss_list_101e_9031 NULL
+#define pci_ss_list_101e_9032 NULL
+#define pci_ss_list_101e_9033 NULL
+#define pci_ss_list_101e_9040 NULL
+#define pci_ss_list_101e_9060 NULL
+static const pciSubsystemInfo *pci_ss_list_101e_9063[] = {
+ &pci_ss_info_101e_9063_101e_0767,
+ NULL
+};
+#endif
+#define pci_ss_list_1022_1100 NULL
+#define pci_ss_list_1022_1101 NULL
+#define pci_ss_list_1022_1102 NULL
+#define pci_ss_list_1022_1103 NULL
+static const pciSubsystemInfo *pci_ss_list_1022_2000[] = {
+ &pci_ss_info_1022_2000_1014_2000,
+ &pci_ss_info_1022_2000_103c_104c,
+ &pci_ss_info_1022_2000_103c_1064,
+ &pci_ss_info_1022_2000_103c_1065,
+ &pci_ss_info_1022_2000_103c_106c,
+ &pci_ss_info_1022_2000_103c_106e,
+ &pci_ss_info_1022_2000_103c_10ea,
+ &pci_ss_info_1022_2000_1113_1220,
+ &pci_ss_info_1022_2000_1259_2450,
+ &pci_ss_info_1022_2000_1259_2454,
+ &pci_ss_info_1022_2000_1259_2700,
+ &pci_ss_info_1022_2000_1259_2701,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1022_2001[] = {
+ &pci_ss_info_1022_2001_1092_0a78,
+ &pci_ss_info_1022_2001_1668_0299,
+ NULL
+};
+#define pci_ss_list_1022_2020 NULL
+#define pci_ss_list_1022_2040 NULL
+#define pci_ss_list_1022_3000 NULL
+#define pci_ss_list_1022_7006 NULL
+#define pci_ss_list_1022_7007 NULL
+#define pci_ss_list_1022_700c NULL
+#define pci_ss_list_1022_700d NULL
+#define pci_ss_list_1022_700e NULL
+#define pci_ss_list_1022_700f NULL
+#define pci_ss_list_1022_7400 NULL
+#define pci_ss_list_1022_7401 NULL
+#define pci_ss_list_1022_7403 NULL
+#define pci_ss_list_1022_7404 NULL
+#define pci_ss_list_1022_7408 NULL
+#define pci_ss_list_1022_7409 NULL
+#define pci_ss_list_1022_740b NULL
+#define pci_ss_list_1022_740c NULL
+#define pci_ss_list_1022_7410 NULL
+#define pci_ss_list_1022_7411 NULL
+#define pci_ss_list_1022_7413 NULL
+#define pci_ss_list_1022_7414 NULL
+static const pciSubsystemInfo *pci_ss_list_1022_7440[] = {
+ &pci_ss_info_1022_7440_1043_8044,
+ NULL
+};
+#define pci_ss_list_1022_7441 NULL
+static const pciSubsystemInfo *pci_ss_list_1022_7443[] = {
+ &pci_ss_info_1022_7443_1043_8044,
+ NULL
+};
+#define pci_ss_list_1022_7445 NULL
+#define pci_ss_list_1022_7446 NULL
+#define pci_ss_list_1022_7448 NULL
+#define pci_ss_list_1022_7449 NULL
+#define pci_ss_list_1022_7450 NULL
+#define pci_ss_list_1022_7451 NULL
+#define pci_ss_list_1022_7454 NULL
+#define pci_ss_list_1022_7455 NULL
+#define pci_ss_list_1022_7460 NULL
+#define pci_ss_list_1022_7461 NULL
+#define pci_ss_list_1022_7462 NULL
+#define pci_ss_list_1022_7464 NULL
+#define pci_ss_list_1022_7468 NULL
+#define pci_ss_list_1022_7469 NULL
+#define pci_ss_list_1022_746a NULL
+#define pci_ss_list_1022_746b NULL
+#define pci_ss_list_1022_746d NULL
+#define pci_ss_list_1022_746e NULL
+#define pci_ss_list_1023_0194 NULL
+#define pci_ss_list_1023_2000 NULL
+#define pci_ss_list_1023_2001 NULL
+static const pciSubsystemInfo *pci_ss_list_1023_8400[] = {
+ &pci_ss_info_1023_8400_1023_8400,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1023_8420[] = {
+ &pci_ss_info_1023_8420_0e11_b15a,
+ NULL
+};
+#define pci_ss_list_1023_8500 NULL
+static const pciSubsystemInfo *pci_ss_list_1023_8520[] = {
+ &pci_ss_info_1023_8520_0e11_b16e,
+ &pci_ss_info_1023_8520_1023_8520,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1023_8620[] = {
+ &pci_ss_info_1023_8620_1014_0502,
+ NULL
+};
+#define pci_ss_list_1023_8820 NULL
+#define pci_ss_list_1023_9320 NULL
+#define pci_ss_list_1023_9350 NULL
+#define pci_ss_list_1023_9360 NULL
+#define pci_ss_list_1023_9382 NULL
+#define pci_ss_list_1023_9383 NULL
+#define pci_ss_list_1023_9385 NULL
+#define pci_ss_list_1023_9386 NULL
+#define pci_ss_list_1023_9388 NULL
+#define pci_ss_list_1023_9397 NULL
+#define pci_ss_list_1023_939a NULL
+#define pci_ss_list_1023_9420 NULL
+#define pci_ss_list_1023_9430 NULL
+#define pci_ss_list_1023_9440 NULL
+#define pci_ss_list_1023_9460 NULL
+#define pci_ss_list_1023_9470 NULL
+#define pci_ss_list_1023_9520 NULL
+static const pciSubsystemInfo *pci_ss_list_1023_9525[] = {
+ &pci_ss_info_1023_9525_10cf_1094,
+ NULL
+};
+#define pci_ss_list_1023_9540 NULL
+#define pci_ss_list_1023_9660 NULL
+#define pci_ss_list_1023_9680 NULL
+#define pci_ss_list_1023_9682 NULL
+#define pci_ss_list_1023_9683 NULL
+#define pci_ss_list_1023_9685 NULL
+static const pciSubsystemInfo *pci_ss_list_1023_9750[] = {
+ &pci_ss_info_1023_9750_1014_9750,
+ &pci_ss_info_1023_9750_1023_9750,
+ NULL
+};
+#define pci_ss_list_1023_9753 NULL
+#define pci_ss_list_1023_9754 NULL
+#define pci_ss_list_1023_9759 NULL
+#define pci_ss_list_1023_9783 NULL
+#define pci_ss_list_1023_9785 NULL
+#define pci_ss_list_1023_9850 NULL
+static const pciSubsystemInfo *pci_ss_list_1023_9880[] = {
+ &pci_ss_info_1023_9880_1023_9880,
+ NULL
+};
+#define pci_ss_list_1023_9910 NULL
+#define pci_ss_list_1023_9930 NULL
+#define pci_ss_list_1025_1435 NULL
+#define pci_ss_list_1025_1445 NULL
+#define pci_ss_list_1025_1449 NULL
+#define pci_ss_list_1025_1451 NULL
+#define pci_ss_list_1025_1461 NULL
+#define pci_ss_list_1025_1489 NULL
+#define pci_ss_list_1025_1511 NULL
+#define pci_ss_list_1025_1512 NULL
+#define pci_ss_list_1025_1513 NULL
+static const pciSubsystemInfo *pci_ss_list_1025_1521[] = {
+ &pci_ss_info_1025_1521_10b9_1521,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1025_1523[] = {
+ &pci_ss_info_1025_1523_10b9_1523,
+ NULL
+};
+#define pci_ss_list_1025_1531 NULL
+static const pciSubsystemInfo *pci_ss_list_1025_1533[] = {
+ &pci_ss_info_1025_1533_10b9_1533,
+ NULL
+};
+#define pci_ss_list_1025_1535 NULL
+static const pciSubsystemInfo *pci_ss_list_1025_1541[] = {
+ &pci_ss_info_1025_1541_10b9_1541,
+ NULL
+};
+#define pci_ss_list_1025_1542 NULL
+#define pci_ss_list_1025_1543 NULL
+#define pci_ss_list_1025_1561 NULL
+#define pci_ss_list_1025_1621 NULL
+#define pci_ss_list_1025_1631 NULL
+#define pci_ss_list_1025_1641 NULL
+#define pci_ss_list_1025_1647 NULL
+#define pci_ss_list_1025_3141 NULL
+#define pci_ss_list_1025_3143 NULL
+#define pci_ss_list_1025_3145 NULL
+#define pci_ss_list_1025_3147 NULL
+#define pci_ss_list_1025_3149 NULL
+#define pci_ss_list_1025_3151 NULL
+#define pci_ss_list_1025_3307 NULL
+#define pci_ss_list_1025_3309 NULL
+#define pci_ss_list_1025_3321 NULL
+#define pci_ss_list_1025_5212 NULL
+#define pci_ss_list_1025_5215 NULL
+#define pci_ss_list_1025_5217 NULL
+#define pci_ss_list_1025_5219 NULL
+#define pci_ss_list_1025_5225 NULL
+#define pci_ss_list_1025_5229 NULL
+#define pci_ss_list_1025_5235 NULL
+#define pci_ss_list_1025_5237 NULL
+#define pci_ss_list_1025_5240 NULL
+#define pci_ss_list_1025_5241 NULL
+#define pci_ss_list_1025_5242 NULL
+#define pci_ss_list_1025_5243 NULL
+#define pci_ss_list_1025_5244 NULL
+#define pci_ss_list_1025_5247 NULL
+#define pci_ss_list_1025_5251 NULL
+#define pci_ss_list_1025_5427 NULL
+#define pci_ss_list_1025_5451 NULL
+#define pci_ss_list_1025_5453 NULL
+static const pciSubsystemInfo *pci_ss_list_1025_7101[] = {
+ &pci_ss_info_1025_7101_10b9_7101,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1028_0001[] = {
+ &pci_ss_info_1028_0001_1028_0001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1028_0002[] = {
+ &pci_ss_info_1028_0002_1028_0002,
+ &pci_ss_info_1028_0002_1028_00d1,
+ &pci_ss_info_1028_0002_1028_00d9,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1028_0003[] = {
+ &pci_ss_info_1028_0003_1028_0003,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1028_0004[] = {
+ &pci_ss_info_1028_0004_1028_00d0,
+ NULL
+};
+#define pci_ss_list_1028_0005 NULL
+#define pci_ss_list_1028_0006 NULL
+#define pci_ss_list_1028_0007 NULL
+#define pci_ss_list_1028_0008 NULL
+static const pciSubsystemInfo *pci_ss_list_1028_000a[] = {
+ &pci_ss_info_1028_000a_1028_0106,
+ &pci_ss_info_1028_000a_1028_011b,
+ &pci_ss_info_1028_000a_1028_0121,
+ NULL
+};
+#define pci_ss_list_1028_000c NULL
+#define pci_ss_list_1028_000e NULL
+#define pci_ss_list_1028_000f NULL
+#define pci_ss_list_102a_0000 NULL
+#define pci_ss_list_102a_0010 NULL
+#define pci_ss_list_102b_0010 NULL
+#define pci_ss_list_102b_0518 NULL
+#define pci_ss_list_102b_0519 NULL
+static const pciSubsystemInfo *pci_ss_list_102b_051a[] = {
+ &pci_ss_info_102b_051a_102b_0100,
+ &pci_ss_info_102b_051a_102b_1100,
+ &pci_ss_info_102b_051a_102b_1200,
+ &pci_ss_info_102b_051a_1100_102b,
+ &pci_ss_info_102b_051a_110a_0018,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_102b_051b[] = {
+ &pci_ss_info_102b_051b_102b_051b,
+ &pci_ss_info_102b_051b_102b_1100,
+ &pci_ss_info_102b_051b_102b_1200,
+ NULL
+};
+#define pci_ss_list_102b_051e NULL
+#define pci_ss_list_102b_051f NULL
+static const pciSubsystemInfo *pci_ss_list_102b_0520[] = {
+ &pci_ss_info_102b_0520_102b_dbc2,
+ &pci_ss_info_102b_0520_102b_dbc8,
+ &pci_ss_info_102b_0520_102b_dbe2,
+ &pci_ss_info_102b_0520_102b_dbe8,
+ &pci_ss_info_102b_0520_102b_ff03,
+ &pci_ss_info_102b_0520_102b_ff04,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_102b_0521[] = {
+ &pci_ss_info_102b_0521_1014_ff03,
+ &pci_ss_info_102b_0521_102b_48e9,
+ &pci_ss_info_102b_0521_102b_48f8,
+ &pci_ss_info_102b_0521_102b_4a60,
+ &pci_ss_info_102b_0521_102b_4a64,
+ &pci_ss_info_102b_0521_102b_c93c,
+ &pci_ss_info_102b_0521_102b_c9b0,
+ &pci_ss_info_102b_0521_102b_c9bc,
+ &pci_ss_info_102b_0521_102b_ca60,
+ &pci_ss_info_102b_0521_102b_ca6c,
+ &pci_ss_info_102b_0521_102b_dbbc,
+ &pci_ss_info_102b_0521_102b_dbc2,
+ &pci_ss_info_102b_0521_102b_dbc3,
+ &pci_ss_info_102b_0521_102b_dbc8,
+ &pci_ss_info_102b_0521_102b_dbd2,
+ &pci_ss_info_102b_0521_102b_dbd3,
+ &pci_ss_info_102b_0521_102b_dbd4,
+ &pci_ss_info_102b_0521_102b_dbd5,
+ &pci_ss_info_102b_0521_102b_dbd8,
+ &pci_ss_info_102b_0521_102b_dbd9,
+ &pci_ss_info_102b_0521_102b_dbe2,
+ &pci_ss_info_102b_0521_102b_dbe3,
+ &pci_ss_info_102b_0521_102b_dbe8,
+ &pci_ss_info_102b_0521_102b_dbf2,
+ &pci_ss_info_102b_0521_102b_dbf3,
+ &pci_ss_info_102b_0521_102b_dbf4,
+ &pci_ss_info_102b_0521_102b_dbf5,
+ &pci_ss_info_102b_0521_102b_dbf8,
+ &pci_ss_info_102b_0521_102b_dbf9,
+ &pci_ss_info_102b_0521_102b_f806,
+ &pci_ss_info_102b_0521_102b_ff00,
+ &pci_ss_info_102b_0521_102b_ff02,
+ &pci_ss_info_102b_0521_102b_ff03,
+ &pci_ss_info_102b_0521_102b_ff04,
+ &pci_ss_info_102b_0521_110a_0032,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_102b_0525[] = {
+ &pci_ss_info_102b_0525_0e11_b16f,
+ &pci_ss_info_102b_0525_102b_0328,
+ &pci_ss_info_102b_0525_102b_0338,
+ &pci_ss_info_102b_0525_102b_0378,
+ &pci_ss_info_102b_0525_102b_0541,
+ &pci_ss_info_102b_0525_102b_0542,
+ &pci_ss_info_102b_0525_102b_0543,
+ &pci_ss_info_102b_0525_102b_0641,
+ &pci_ss_info_102b_0525_102b_0642,
+ &pci_ss_info_102b_0525_102b_0643,
+ &pci_ss_info_102b_0525_102b_07c0,
+ &pci_ss_info_102b_0525_102b_07c1,
+ &pci_ss_info_102b_0525_102b_0d41,
+ &pci_ss_info_102b_0525_102b_0d42,
+ &pci_ss_info_102b_0525_102b_0e00,
+ &pci_ss_info_102b_0525_102b_0e01,
+ &pci_ss_info_102b_0525_102b_0e02,
+ &pci_ss_info_102b_0525_102b_0e03,
+ &pci_ss_info_102b_0525_102b_0f80,
+ &pci_ss_info_102b_0525_102b_0f81,
+ &pci_ss_info_102b_0525_102b_0f82,
+ &pci_ss_info_102b_0525_102b_0f83,
+ &pci_ss_info_102b_0525_102b_19d8,
+ &pci_ss_info_102b_0525_102b_19f8,
+ &pci_ss_info_102b_0525_102b_2159,
+ &pci_ss_info_102b_0525_102b_2179,
+ &pci_ss_info_102b_0525_102b_217d,
+ &pci_ss_info_102b_0525_102b_23c0,
+ &pci_ss_info_102b_0525_102b_23c1,
+ &pci_ss_info_102b_0525_102b_23c2,
+ &pci_ss_info_102b_0525_102b_23c3,
+ &pci_ss_info_102b_0525_102b_2f58,
+ &pci_ss_info_102b_0525_102b_2f78,
+ &pci_ss_info_102b_0525_102b_3693,
+ &pci_ss_info_102b_0525_102b_5dd0,
+ &pci_ss_info_102b_0525_102b_5f50,
+ &pci_ss_info_102b_0525_102b_5f51,
+ &pci_ss_info_102b_0525_102b_5f52,
+ &pci_ss_info_102b_0525_102b_9010,
+ &pci_ss_info_102b_0525_1458_0400,
+ &pci_ss_info_102b_0525_1705_0001,
+ &pci_ss_info_102b_0525_1705_0002,
+ &pci_ss_info_102b_0525_1705_0003,
+ &pci_ss_info_102b_0525_1705_0004,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_102b_0527[] = {
+ &pci_ss_info_102b_0527_102b_0840,
+ NULL
+};
+#define pci_ss_list_102b_0d10 NULL
+static const pciSubsystemInfo *pci_ss_list_102b_1000[] = {
+ &pci_ss_info_102b_1000_102b_ff01,
+ &pci_ss_info_102b_1000_102b_ff05,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_102b_1001[] = {
+ &pci_ss_info_102b_1001_102b_1001,
+ &pci_ss_info_102b_1001_102b_ff00,
+ &pci_ss_info_102b_1001_102b_ff01,
+ &pci_ss_info_102b_1001_102b_ff03,
+ &pci_ss_info_102b_1001_102b_ff04,
+ &pci_ss_info_102b_1001_102b_ff05,
+ &pci_ss_info_102b_1001_110a_001e,
+ NULL
+};
+#define pci_ss_list_102b_2007 NULL
+static const pciSubsystemInfo *pci_ss_list_102b_2527[] = {
+ &pci_ss_info_102b_2527_102b_0f83,
+ &pci_ss_info_102b_2527_102b_0f84,
+ &pci_ss_info_102b_2527_102b_1e41,
+ NULL
+};
+#define pci_ss_list_102b_4536 NULL
+#define pci_ss_list_102b_6573 NULL
+#define pci_ss_list_102c_00b8 NULL
+static const pciSubsystemInfo *pci_ss_list_102c_00c0[] = {
+ &pci_ss_info_102c_00c0_102c_00c0,
+ NULL
+};
+#define pci_ss_list_102c_00d0 NULL
+#define pci_ss_list_102c_00d8 NULL
+#define pci_ss_list_102c_00dc NULL
+#define pci_ss_list_102c_00e0 NULL
+#define pci_ss_list_102c_00e4 NULL
+static const pciSubsystemInfo *pci_ss_list_102c_00e5[] = {
+ &pci_ss_info_102c_00e5_0e11_b049,
+ NULL
+};
+#define pci_ss_list_102c_00f0 NULL
+#define pci_ss_list_102c_00f4 NULL
+#define pci_ss_list_102c_00f5 NULL
+#define pci_ss_list_102c_0c30 NULL
+#define pci_ss_list_102d_50dc NULL
+#define pci_ss_list_102f_0009 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_102f_0020[] = {
+ &pci_ss_info_102f_0020_102f_00f8,
+ NULL
+};
+#endif
+#define pci_ss_list_1031_5601 NULL
+#define pci_ss_list_1031_5607 NULL
+#define pci_ss_list_1031_5631 NULL
+#define pci_ss_list_1031_6057 NULL
+#define pci_ss_list_1033_0001 NULL
+#define pci_ss_list_1033_0002 NULL
+#define pci_ss_list_1033_0003 NULL
+#define pci_ss_list_1033_0004 NULL
+#define pci_ss_list_1033_0005 NULL
+#define pci_ss_list_1033_0006 NULL
+#define pci_ss_list_1033_0007 NULL
+#define pci_ss_list_1033_0008 NULL
+#define pci_ss_list_1033_0009 NULL
+#define pci_ss_list_1033_0016 NULL
+#define pci_ss_list_1033_001a NULL
+#define pci_ss_list_1033_0021 NULL
+#define pci_ss_list_1033_0029 NULL
+#define pci_ss_list_1033_002a NULL
+#define pci_ss_list_1033_002c NULL
+#define pci_ss_list_1033_002d NULL
+static const pciSubsystemInfo *pci_ss_list_1033_0035[] = {
+ &pci_ss_info_1033_0035_1179_0001,
+ &pci_ss_info_1033_0035_12ee_7000,
+ &pci_ss_info_1033_0035_1799_0001,
+ NULL
+};
+#define pci_ss_list_1033_003b NULL
+#define pci_ss_list_1033_003e NULL
+#define pci_ss_list_1033_0046 NULL
+#define pci_ss_list_1033_005a NULL
+#define pci_ss_list_1033_0063 NULL
+static const pciSubsystemInfo *pci_ss_list_1033_0067[] = {
+ &pci_ss_info_1033_0067_1010_0020,
+ &pci_ss_info_1033_0067_1010_0080,
+ &pci_ss_info_1033_0067_1010_0088,
+ &pci_ss_info_1033_0067_1010_0090,
+ &pci_ss_info_1033_0067_1010_0098,
+ &pci_ss_info_1033_0067_1010_00a0,
+ &pci_ss_info_1033_0067_1010_00a8,
+ &pci_ss_info_1033_0067_1010_0120,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1033_0074[] = {
+ &pci_ss_info_1033_0074_1033_8014,
+ NULL
+};
+#define pci_ss_list_1033_009b NULL
+#define pci_ss_list_1033_00a6 NULL
+static const pciSubsystemInfo *pci_ss_list_1033_00cd[] = {
+ &pci_ss_info_1033_00cd_12ee_8011,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1033_00e0[] = {
+ &pci_ss_info_1033_00e0_12ee_7001,
+ &pci_ss_info_1033_00e0_1799_0002,
+ NULL
+};
+#define pci_ss_list_1036_0000 NULL
+#define pci_ss_list_1039_0001 NULL
+#define pci_ss_list_1039_0002 NULL
+#define pci_ss_list_1039_0006 NULL
+#define pci_ss_list_1039_0008 NULL
+#define pci_ss_list_1039_0009 NULL
+#define pci_ss_list_1039_0018 NULL
+static const pciSubsystemInfo *pci_ss_list_1039_0200[] = {
+ &pci_ss_info_1039_0200_1039_0000,
+ NULL
+};
+#define pci_ss_list_1039_0204 NULL
+#define pci_ss_list_1039_0205 NULL
+static const pciSubsystemInfo *pci_ss_list_1039_0300[] = {
+ &pci_ss_info_1039_0300_107d_2720,
+ NULL
+};
+#define pci_ss_list_1039_0310 NULL
+#define pci_ss_list_1039_0315 NULL
+#define pci_ss_list_1039_0325 NULL
+#define pci_ss_list_1039_0330 NULL
+#define pci_ss_list_1039_0406 NULL
+#define pci_ss_list_1039_0496 NULL
+#define pci_ss_list_1039_0530 NULL
+#define pci_ss_list_1039_0540 NULL
+#define pci_ss_list_1039_0597 NULL
+#define pci_ss_list_1039_0601 NULL
+#define pci_ss_list_1039_0620 NULL
+#define pci_ss_list_1039_0630 NULL
+#define pci_ss_list_1039_0633 NULL
+#define pci_ss_list_1039_0635 NULL
+#define pci_ss_list_1039_0645 NULL
+#define pci_ss_list_1039_0646 NULL
+#define pci_ss_list_1039_0650 NULL
+#define pci_ss_list_1039_0651 NULL
+#define pci_ss_list_1039_0730 NULL
+#define pci_ss_list_1039_0733 NULL
+#define pci_ss_list_1039_0735 NULL
+#define pci_ss_list_1039_0740 NULL
+#define pci_ss_list_1039_0745 NULL
+static const pciSubsystemInfo *pci_ss_list_1039_0900[] = {
+ &pci_ss_info_1039_0900_1039_0900,
+ NULL
+};
+#define pci_ss_list_1039_0961 NULL
+#define pci_ss_list_1039_0962 NULL
+#define pci_ss_list_1039_3602 NULL
+#define pci_ss_list_1039_5107 NULL
+#define pci_ss_list_1039_5300 NULL
+#define pci_ss_list_1039_5315 NULL
+#define pci_ss_list_1039_5401 NULL
+#define pci_ss_list_1039_5511 NULL
+static const pciSubsystemInfo *pci_ss_list_1039_5513[] = {
+ &pci_ss_info_1039_5513_1019_0970,
+ &pci_ss_info_1039_5513_1039_5513,
+ NULL
+};
+#define pci_ss_list_1039_5517 NULL
+#define pci_ss_list_1039_5571 NULL
+#define pci_ss_list_1039_5581 NULL
+#define pci_ss_list_1039_5582 NULL
+#define pci_ss_list_1039_5591 NULL
+#define pci_ss_list_1039_5596 NULL
+#define pci_ss_list_1039_5597 NULL
+#define pci_ss_list_1039_5600 NULL
+#define pci_ss_list_1039_6204 NULL
+#define pci_ss_list_1039_6205 NULL
+#define pci_ss_list_1039_6236 NULL
+static const pciSubsystemInfo *pci_ss_list_1039_6300[] = {
+ &pci_ss_info_1039_6300_1019_0970,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1039_6306[] = {
+ &pci_ss_info_1039_6306_1039_6306,
+ NULL
+};
+#define pci_ss_list_1039_6325 NULL
+static const pciSubsystemInfo *pci_ss_list_1039_6326[] = {
+ &pci_ss_info_1039_6326_1039_6326,
+ &pci_ss_info_1039_6326_1092_0a50,
+ &pci_ss_info_1039_6326_1092_0a70,
+ &pci_ss_info_1039_6326_1092_4910,
+ &pci_ss_info_1039_6326_1092_4920,
+ &pci_ss_info_1039_6326_1569_6326,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1039_7001[] = {
+ &pci_ss_info_1039_7001_1039_7000,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1039_7002[] = {
+ &pci_ss_info_1039_7002_1509_7002,
+ NULL
+};
+#define pci_ss_list_1039_7007 NULL
+#define pci_ss_list_1039_7012 NULL
+#define pci_ss_list_1039_7013 NULL
+static const pciSubsystemInfo *pci_ss_list_1039_7016[] = {
+ &pci_ss_info_1039_7016_1039_7016,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1039_7018[] = {
+ &pci_ss_info_1039_7018_1014_01b6,
+ &pci_ss_info_1039_7018_1014_01b7,
+ &pci_ss_info_1039_7018_1019_7018,
+ &pci_ss_info_1039_7018_1025_000e,
+ &pci_ss_info_1039_7018_1025_0018,
+ &pci_ss_info_1039_7018_1039_7018,
+ &pci_ss_info_1039_7018_1043_800b,
+ &pci_ss_info_1039_7018_1054_7018,
+ &pci_ss_info_1039_7018_107d_5330,
+ &pci_ss_info_1039_7018_107d_5350,
+ &pci_ss_info_1039_7018_1170_3209,
+ &pci_ss_info_1039_7018_1462_400a,
+ &pci_ss_info_1039_7018_14a4_2089,
+ &pci_ss_info_1039_7018_14cd_2194,
+ &pci_ss_info_1039_7018_14ff_1100,
+ &pci_ss_info_1039_7018_152d_8808,
+ &pci_ss_info_1039_7018_1558_1103,
+ &pci_ss_info_1039_7018_1558_2200,
+ &pci_ss_info_1039_7018_1563_7018,
+ &pci_ss_info_1039_7018_15c5_0111,
+ &pci_ss_info_1039_7018_270f_a171,
+ &pci_ss_info_1039_7018_a0a0_0022,
+ NULL
+};
+#define pci_ss_list_103c_1005 NULL
+#define pci_ss_list_103c_1006 NULL
+#define pci_ss_list_103c_1008 NULL
+#define pci_ss_list_103c_100a NULL
+#define pci_ss_list_103c_1028 NULL
+static const pciSubsystemInfo *pci_ss_list_103c_1029[] = {
+ &pci_ss_info_103c_1029_107e_000f,
+ &pci_ss_info_103c_1029_9004_9210,
+ &pci_ss_info_103c_1029_9004_9211,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_103c_102a[] = {
+ &pci_ss_info_103c_102a_107e_000e,
+ &pci_ss_info_103c_102a_9004_9110,
+ &pci_ss_info_103c_102a_9004_9111,
+ NULL
+};
+#define pci_ss_list_103c_1030 NULL
+static const pciSubsystemInfo *pci_ss_list_103c_1031[] = {
+ &pci_ss_info_103c_1031_103c_1040,
+ &pci_ss_info_103c_1031_103c_1041,
+ &pci_ss_info_103c_1031_103c_1042,
+ NULL
+};
+#define pci_ss_list_103c_1040 NULL
+#define pci_ss_list_103c_1041 NULL
+#define pci_ss_list_103c_1042 NULL
+static const pciSubsystemInfo *pci_ss_list_103c_1048[] = {
+ &pci_ss_info_103c_1048_103c_1049,
+ &pci_ss_info_103c_1048_103c_104a,
+ &pci_ss_info_103c_1048_103c_104b,
+ &pci_ss_info_103c_1048_103c_1223,
+ &pci_ss_info_103c_1048_103c_1226,
+ &pci_ss_info_103c_1048_103c_1227,
+ &pci_ss_info_103c_1048_103c_1282,
+ NULL
+};
+#define pci_ss_list_103c_1064 NULL
+#define pci_ss_list_103c_108b NULL
+#define pci_ss_list_103c_10c1 NULL
+#define pci_ss_list_103c_10ed NULL
+#define pci_ss_list_103c_1200 NULL
+#define pci_ss_list_103c_1219 NULL
+#define pci_ss_list_103c_121a NULL
+#define pci_ss_list_103c_121b NULL
+#define pci_ss_list_103c_121c NULL
+#define pci_ss_list_103c_1229 NULL
+#define pci_ss_list_103c_122a NULL
+#define pci_ss_list_103c_122e NULL
+#define pci_ss_list_103c_1290 NULL
+#define pci_ss_list_103c_2910 NULL
+#define pci_ss_list_103c_2925 NULL
+#define pci_ss_list_1042_1000 NULL
+#define pci_ss_list_1042_1001 NULL
+#define pci_ss_list_1042_3000 NULL
+#define pci_ss_list_1042_3010 NULL
+#define pci_ss_list_1042_3020 NULL
+#define pci_ss_list_1043_0675 NULL
+#define pci_ss_list_1043_4021 NULL
+#define pci_ss_list_1044_1012 NULL
+#define pci_ss_list_1044_a400 NULL
+#define pci_ss_list_1044_a500 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1044_a501[] = {
+ &pci_ss_info_1044_a501_1044_c001,
+ &pci_ss_info_1044_a501_1044_c002,
+ &pci_ss_info_1044_a501_1044_c003,
+ &pci_ss_info_1044_a501_1044_c004,
+ &pci_ss_info_1044_a501_1044_c005,
+ &pci_ss_info_1044_a501_1044_c00a,
+ &pci_ss_info_1044_a501_1044_c00b,
+ &pci_ss_info_1044_a501_1044_c00c,
+ &pci_ss_info_1044_a501_1044_c00d,
+ &pci_ss_info_1044_a501_1044_c00e,
+ &pci_ss_info_1044_a501_1044_c00f,
+ &pci_ss_info_1044_a501_1044_c014,
+ &pci_ss_info_1044_a501_1044_c015,
+ &pci_ss_info_1044_a501_1044_c016,
+ &pci_ss_info_1044_a501_1044_c01e,
+ &pci_ss_info_1044_a501_1044_c01f,
+ &pci_ss_info_1044_a501_1044_c020,
+ &pci_ss_info_1044_a501_1044_c021,
+ &pci_ss_info_1044_a501_1044_c028,
+ &pci_ss_info_1044_a501_1044_c029,
+ &pci_ss_info_1044_a501_1044_c02a,
+ &pci_ss_info_1044_a501_1044_c03c,
+ &pci_ss_info_1044_a501_1044_c03d,
+ &pci_ss_info_1044_a501_1044_c03e,
+ &pci_ss_info_1044_a501_1044_c046,
+ &pci_ss_info_1044_a501_1044_c047,
+ &pci_ss_info_1044_a501_1044_c048,
+ &pci_ss_info_1044_a501_1044_c050,
+ &pci_ss_info_1044_a501_1044_c051,
+ &pci_ss_info_1044_a501_1044_c052,
+ &pci_ss_info_1044_a501_1044_c05a,
+ &pci_ss_info_1044_a501_1044_c05b,
+ &pci_ss_info_1044_a501_1044_c064,
+ &pci_ss_info_1044_a501_1044_c065,
+ &pci_ss_info_1044_a501_1044_c066,
+ NULL
+};
+#define pci_ss_list_1044_a511 NULL
+#endif
+#define pci_ss_list_1045_a0f8 NULL
+#define pci_ss_list_1045_c101 NULL
+#define pci_ss_list_1045_c178 NULL
+#define pci_ss_list_1045_c556 NULL
+#define pci_ss_list_1045_c557 NULL
+#define pci_ss_list_1045_c558 NULL
+#define pci_ss_list_1045_c567 NULL
+#define pci_ss_list_1045_c568 NULL
+#define pci_ss_list_1045_c569 NULL
+#define pci_ss_list_1045_c621 NULL
+#define pci_ss_list_1045_c700 NULL
+#define pci_ss_list_1045_c701 NULL
+#define pci_ss_list_1045_c814 NULL
+#define pci_ss_list_1045_c822 NULL
+#define pci_ss_list_1045_c824 NULL
+#define pci_ss_list_1045_c825 NULL
+#define pci_ss_list_1045_c832 NULL
+#define pci_ss_list_1045_c861 NULL
+#define pci_ss_list_1045_c895 NULL
+#define pci_ss_list_1045_c935 NULL
+#define pci_ss_list_1045_d568 NULL
+#define pci_ss_list_1045_d721 NULL
+#define pci_ss_list_1048_0d22 NULL
+#define pci_ss_list_1048_1000 NULL
+#define pci_ss_list_1048_3000 NULL
+#define pci_ss_list_104a_0008 NULL
+#define pci_ss_list_104a_0009 NULL
+#define pci_ss_list_104a_0010 NULL
+#define pci_ss_list_104a_0210 NULL
+#define pci_ss_list_104a_0981 NULL
+#define pci_ss_list_104a_1746 NULL
+#define pci_ss_list_104a_2774 NULL
+#define pci_ss_list_104a_3520 NULL
+#define pci_ss_list_104b_0140 NULL
+#define pci_ss_list_104b_1040 NULL
+#define pci_ss_list_104b_8130 NULL
+#define pci_ss_list_104c_0500 NULL
+#define pci_ss_list_104c_0508 NULL
+#define pci_ss_list_104c_1000 NULL
+#define pci_ss_list_104c_104c NULL
+#define pci_ss_list_104c_3d04 NULL
+static const pciSubsystemInfo *pci_ss_list_104c_3d07[] = {
+ &pci_ss_info_104c_3d07_1011_4d10,
+ &pci_ss_info_104c_3d07_1040_000f,
+ &pci_ss_info_104c_3d07_1040_0011,
+ &pci_ss_info_104c_3d07_1048_0a31,
+ &pci_ss_info_104c_3d07_1048_0a32,
+ &pci_ss_info_104c_3d07_1048_0a35,
+ &pci_ss_info_104c_3d07_107d_2633,
+ &pci_ss_info_104c_3d07_1092_0127,
+ &pci_ss_info_104c_3d07_1092_0136,
+ &pci_ss_info_104c_3d07_1092_0141,
+ &pci_ss_info_104c_3d07_1092_0146,
+ &pci_ss_info_104c_3d07_1092_0148,
+ &pci_ss_info_104c_3d07_1092_0149,
+ &pci_ss_info_104c_3d07_1092_0152,
+ &pci_ss_info_104c_3d07_1092_0154,
+ &pci_ss_info_104c_3d07_1092_0155,
+ &pci_ss_info_104c_3d07_1092_0156,
+ &pci_ss_info_104c_3d07_1092_0157,
+ &pci_ss_info_104c_3d07_1097_3d01,
+ &pci_ss_info_104c_3d07_1102_100f,
+ &pci_ss_info_104c_3d07_3d3d_0100,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_104c_8000[] = {
+ &pci_ss_info_104c_8000_e4bf_1010,
+ &pci_ss_info_104c_8000_e4bf_1020,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_104c_8009[] = {
+ &pci_ss_info_104c_8009_104d_8032,
+ NULL
+};
+#define pci_ss_list_104c_8017 NULL
+static const pciSubsystemInfo *pci_ss_list_104c_8019[] = {
+ &pci_ss_info_104c_8019_11bd_000a,
+ &pci_ss_info_104c_8019_11bd_000e,
+ &pci_ss_info_104c_8019_e4bf_1010,
+ NULL
+};
+#define pci_ss_list_104c_8020 NULL
+static const pciSubsystemInfo *pci_ss_list_104c_8021[] = {
+ &pci_ss_info_104c_8021_104d_80df,
+ &pci_ss_info_104c_8021_104d_80e7,
+ NULL
+};
+#define pci_ss_list_104c_8022 NULL
+#define pci_ss_list_104c_8023 NULL
+#define pci_ss_list_104c_8024 NULL
+#define pci_ss_list_104c_8026 NULL
+static const pciSubsystemInfo *pci_ss_list_104c_8027[] = {
+ &pci_ss_info_104c_8027_1028_00e6,
+ NULL
+};
+#define pci_ss_list_104c_8400 NULL
+#define pci_ss_list_104c_a001 NULL
+#define pci_ss_list_104c_a100 NULL
+#define pci_ss_list_104c_a102 NULL
+#define pci_ss_list_104c_a106 NULL
+#define pci_ss_list_104c_ac10 NULL
+#define pci_ss_list_104c_ac11 NULL
+#define pci_ss_list_104c_ac12 NULL
+#define pci_ss_list_104c_ac13 NULL
+#define pci_ss_list_104c_ac15 NULL
+#define pci_ss_list_104c_ac16 NULL
+#define pci_ss_list_104c_ac17 NULL
+#define pci_ss_list_104c_ac18 NULL
+#define pci_ss_list_104c_ac19 NULL
+#define pci_ss_list_104c_ac1a NULL
+static const pciSubsystemInfo *pci_ss_list_104c_ac1b[] = {
+ &pci_ss_info_104c_ac1b_0e11_b113,
+ NULL
+};
+#define pci_ss_list_104c_ac1c NULL
+#define pci_ss_list_104c_ac1d NULL
+#define pci_ss_list_104c_ac1e NULL
+#define pci_ss_list_104c_ac1f NULL
+#define pci_ss_list_104c_ac20 NULL
+#define pci_ss_list_104c_ac21 NULL
+#define pci_ss_list_104c_ac22 NULL
+#define pci_ss_list_104c_ac23 NULL
+#define pci_ss_list_104c_ac28 NULL
+#define pci_ss_list_104c_ac30 NULL
+#define pci_ss_list_104c_ac40 NULL
+#define pci_ss_list_104c_ac41 NULL
+static const pciSubsystemInfo *pci_ss_list_104c_ac42[] = {
+ &pci_ss_info_104c_ac42_1028_00e6,
+ NULL
+};
+#define pci_ss_list_104c_ac50 NULL
+static const pciSubsystemInfo *pci_ss_list_104c_ac51[] = {
+ &pci_ss_info_104c_ac51_1014_023b,
+ &pci_ss_info_104c_ac51_10cf_1095,
+ &pci_ss_info_104c_ac51_e4bf_1000,
+ NULL
+};
+#define pci_ss_list_104c_ac52 NULL
+#define pci_ss_list_104c_ac53 NULL
+static const pciSubsystemInfo *pci_ss_list_104c_ac55[] = {
+ &pci_ss_info_104c_ac55_1014_0512,
+ NULL
+};
+#define pci_ss_list_104c_ac56 NULL
+#define pci_ss_list_104c_ac60 NULL
+#define pci_ss_list_104c_fe00 NULL
+#define pci_ss_list_104c_fe03 NULL
+#define pci_ss_list_104d_8009 NULL
+#define pci_ss_list_104d_8039 NULL
+#define pci_ss_list_104d_8056 NULL
+#define pci_ss_list_104d_808a NULL
+#define pci_ss_list_104e_0017 NULL
+#define pci_ss_list_104e_0107 NULL
+#define pci_ss_list_104e_0109 NULL
+#define pci_ss_list_104e_0111 NULL
+#define pci_ss_list_104e_0217 NULL
+#define pci_ss_list_104e_0317 NULL
+#define pci_ss_list_1050_0000 NULL
+#define pci_ss_list_1050_0001 NULL
+#define pci_ss_list_1050_0105 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1050_0840[] = {
+ &pci_ss_info_1050_0840_1050_0001,
+ &pci_ss_info_1050_0840_1050_0840,
+ NULL
+};
+#define pci_ss_list_1050_0940 NULL
+#define pci_ss_list_1050_5a5a NULL
+#define pci_ss_list_1050_6692 NULL
+#define pci_ss_list_1050_9970 NULL
+#endif
+#define pci_ss_list_1055_9130 NULL
+#define pci_ss_list_1055_9460 NULL
+#define pci_ss_list_1055_9462 NULL
+#define pci_ss_list_1055_9463 NULL
+#define pci_ss_list_1057_0001 NULL
+#define pci_ss_list_1057_0002 NULL
+#define pci_ss_list_1057_0003 NULL
+#define pci_ss_list_1057_0004 NULL
+#define pci_ss_list_1057_0006 NULL
+#define pci_ss_list_1057_0100 NULL
+#define pci_ss_list_1057_0431 NULL
+static const pciSubsystemInfo *pci_ss_list_1057_1801[] = {
+ &pci_ss_info_1057_1801_ecc0_0030,
+ NULL
+};
+#define pci_ss_list_1057_18c0 NULL
+#define pci_ss_list_1057_4801 NULL
+#define pci_ss_list_1057_4802 NULL
+#define pci_ss_list_1057_4803 NULL
+#define pci_ss_list_1057_4806 NULL
+#define pci_ss_list_1057_4d68 NULL
+static const pciSubsystemInfo *pci_ss_list_1057_5600[] = {
+ &pci_ss_info_1057_5600_1057_0300,
+ &pci_ss_info_1057_5600_1057_0301,
+ &pci_ss_info_1057_5600_1057_0302,
+ &pci_ss_info_1057_5600_1057_5600,
+ &pci_ss_info_1057_5600_13d2_0300,
+ &pci_ss_info_1057_5600_13d2_0301,
+ &pci_ss_info_1057_5600_13d2_0302,
+ &pci_ss_info_1057_5600_1436_0300,
+ &pci_ss_info_1057_5600_1436_0301,
+ &pci_ss_info_1057_5600_1436_0302,
+ &pci_ss_info_1057_5600_144f_100c,
+ &pci_ss_info_1057_5600_1494_0300,
+ &pci_ss_info_1057_5600_1494_0301,
+ &pci_ss_info_1057_5600_14c8_0300,
+ &pci_ss_info_1057_5600_14c8_0302,
+ &pci_ss_info_1057_5600_1668_0300,
+ &pci_ss_info_1057_5600_1668_0302,
+ NULL
+};
+#define pci_ss_list_1057_6400 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_105a_0d30[] = {
+ &pci_ss_info_105a_0d30_105a_4d33,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_105a_0d38[] = {
+ &pci_ss_info_105a_0d38_105a_4d39,
+ NULL
+};
+#define pci_ss_list_105a_1275 NULL
+#define pci_ss_list_105a_3376 NULL
+static const pciSubsystemInfo *pci_ss_list_105a_4d30[] = {
+ &pci_ss_info_105a_4d30_105a_4d33,
+ &pci_ss_info_105a_4d30_105a_4d39,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_105a_4d33[] = {
+ &pci_ss_info_105a_4d33_105a_4d33,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_105a_4d38[] = {
+ &pci_ss_info_105a_4d38_105a_4d30,
+ &pci_ss_info_105a_4d38_105a_4d33,
+ &pci_ss_info_105a_4d38_105a_4d39,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_105a_4d68[] = {
+ &pci_ss_info_105a_4d68_105a_4d68,
+ NULL
+};
+#define pci_ss_list_105a_4d69 NULL
+static const pciSubsystemInfo *pci_ss_list_105a_5275[] = {
+ &pci_ss_info_105a_5275_105a_0275,
+ NULL
+};
+#define pci_ss_list_105a_5300 NULL
+#define pci_ss_list_105a_6268 NULL
+static const pciSubsystemInfo *pci_ss_list_105a_6269[] = {
+ &pci_ss_info_105a_6269_105a_6269,
+ NULL
+};
+#define pci_ss_list_105a_6621 NULL
+#define pci_ss_list_105a_7275 NULL
+#endif
+#define pci_ss_list_105d_2309 NULL
+static const pciSubsystemInfo *pci_ss_list_105d_2339[] = {
+ &pci_ss_info_105d_2339_105d_0000,
+ &pci_ss_info_105d_2339_105d_0001,
+ &pci_ss_info_105d_2339_105d_0002,
+ &pci_ss_info_105d_2339_105d_0003,
+ &pci_ss_info_105d_2339_105d_0004,
+ &pci_ss_info_105d_2339_105d_0005,
+ &pci_ss_info_105d_2339_105d_0006,
+ &pci_ss_info_105d_2339_105d_0007,
+ &pci_ss_info_105d_2339_105d_0008,
+ &pci_ss_info_105d_2339_105d_0009,
+ &pci_ss_info_105d_2339_105d_000a,
+ &pci_ss_info_105d_2339_105d_000b,
+ &pci_ss_info_105d_2339_11a4_000a,
+ &pci_ss_info_105d_2339_13cc_0000,
+ &pci_ss_info_105d_2339_13cc_0004,
+ &pci_ss_info_105d_2339_13cc_0005,
+ &pci_ss_info_105d_2339_13cc_0006,
+ &pci_ss_info_105d_2339_13cc_0008,
+ &pci_ss_info_105d_2339_13cc_0009,
+ &pci_ss_info_105d_2339_13cc_000a,
+ &pci_ss_info_105d_2339_13cc_000c,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_105d_493d[] = {
+ &pci_ss_info_105d_493d_11a4_000a,
+ &pci_ss_info_105d_493d_11a4_000b,
+ &pci_ss_info_105d_493d_13cc_0002,
+ &pci_ss_info_105d_493d_13cc_0003,
+ &pci_ss_info_105d_493d_13cc_0007,
+ &pci_ss_info_105d_493d_13cc_0008,
+ &pci_ss_info_105d_493d_13cc_0009,
+ &pci_ss_info_105d_493d_13cc_000a,
+ NULL
+};
+#define pci_ss_list_105d_5348 NULL
+#define pci_ss_list_1060_0001 NULL
+#define pci_ss_list_1060_0002 NULL
+#define pci_ss_list_1060_0101 NULL
+#define pci_ss_list_1060_0881 NULL
+#define pci_ss_list_1060_0886 NULL
+#define pci_ss_list_1060_0891 NULL
+#define pci_ss_list_1060_1001 NULL
+#define pci_ss_list_1060_673a NULL
+#define pci_ss_list_1060_673b NULL
+#define pci_ss_list_1060_8710 NULL
+#define pci_ss_list_1060_886a NULL
+#define pci_ss_list_1060_8881 NULL
+#define pci_ss_list_1060_8886 NULL
+#define pci_ss_list_1060_888a NULL
+#define pci_ss_list_1060_8891 NULL
+#define pci_ss_list_1060_9017 NULL
+#define pci_ss_list_1060_9018 NULL
+#define pci_ss_list_1060_9026 NULL
+#define pci_ss_list_1060_e881 NULL
+#define pci_ss_list_1060_e886 NULL
+#define pci_ss_list_1060_e88a NULL
+#define pci_ss_list_1060_e891 NULL
+#define pci_ss_list_1061_0001 NULL
+#define pci_ss_list_1061_0002 NULL
+#define pci_ss_list_1066_0000 NULL
+#define pci_ss_list_1066_0001 NULL
+#define pci_ss_list_1066_0002 NULL
+#define pci_ss_list_1066_0003 NULL
+#define pci_ss_list_1066_0004 NULL
+#define pci_ss_list_1066_0005 NULL
+#define pci_ss_list_1066_8002 NULL
+#define pci_ss_list_1067_1002 NULL
+#define pci_ss_list_1069_0001 NULL
+#define pci_ss_list_1069_0002 NULL
+#define pci_ss_list_1069_0010 NULL
+#define pci_ss_list_1069_0050 NULL
+#define pci_ss_list_1069_ba55 NULL
+#define pci_ss_list_1069_ba56 NULL
+#define pci_ss_list_106b_0001 NULL
+#define pci_ss_list_106b_0002 NULL
+#define pci_ss_list_106b_0003 NULL
+#define pci_ss_list_106b_0004 NULL
+#define pci_ss_list_106b_0007 NULL
+#define pci_ss_list_106b_000e NULL
+#define pci_ss_list_106b_0010 NULL
+#define pci_ss_list_106b_0017 NULL
+#define pci_ss_list_106b_0018 NULL
+#define pci_ss_list_106b_0019 NULL
+#define pci_ss_list_106b_001e NULL
+#define pci_ss_list_106b_001f NULL
+#define pci_ss_list_106b_0020 NULL
+#define pci_ss_list_106b_0021 NULL
+#define pci_ss_list_106b_0022 NULL
+#define pci_ss_list_106b_0024 NULL
+#define pci_ss_list_106b_0025 NULL
+#define pci_ss_list_106b_0026 NULL
+#define pci_ss_list_106b_0027 NULL
+#define pci_ss_list_106b_0028 NULL
+#define pci_ss_list_106b_0029 NULL
+#define pci_ss_list_106b_002d NULL
+#define pci_ss_list_106b_002e NULL
+#define pci_ss_list_106b_002f NULL
+#define pci_ss_list_106b_0030 NULL
+#define pci_ss_list_106b_0031 NULL
+#define pci_ss_list_106b_0032 NULL
+#define pci_ss_list_106b_0033 NULL
+#define pci_ss_list_106b_0034 NULL
+#define pci_ss_list_106b_1645 NULL
+#define pci_ss_list_106c_8801 NULL
+#define pci_ss_list_106c_8802 NULL
+#define pci_ss_list_106c_8803 NULL
+#define pci_ss_list_106c_8804 NULL
+#define pci_ss_list_106c_8805 NULL
+#define pci_ss_list_1073_0001 NULL
+#define pci_ss_list_1073_0002 NULL
+#define pci_ss_list_1073_0003 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1073_0004[] = {
+ &pci_ss_info_1073_0004_1073_0004,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1073_0005[] = {
+ &pci_ss_info_1073_0005_1073_0005,
+ NULL
+};
+#define pci_ss_list_1073_0006 NULL
+static const pciSubsystemInfo *pci_ss_list_1073_0008[] = {
+ &pci_ss_info_1073_0008_1073_0008,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1073_000a[] = {
+ &pci_ss_info_1073_000a_1073_0004,
+ &pci_ss_info_1073_000a_1073_000a,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1073_000c[] = {
+ &pci_ss_info_1073_000c_107a_000c,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1073_000d[] = {
+ &pci_ss_info_1073_000d_1073_000d,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1073_0010[] = {
+ &pci_ss_info_1073_0010_1073_0006,
+ &pci_ss_info_1073_0010_1073_0010,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1073_0012[] = {
+ &pci_ss_info_1073_0012_1073_0012,
+ NULL
+};
+#define pci_ss_list_1073_0020 NULL
+static const pciSubsystemInfo *pci_ss_list_1073_2000[] = {
+ &pci_ss_info_1073_2000_1073_2000,
+ NULL
+};
+#endif
+#define pci_ss_list_1074_4e78 NULL
+#define pci_ss_list_1077_1016 NULL
+#define pci_ss_list_1077_1020 NULL
+#define pci_ss_list_1077_1022 NULL
+#define pci_ss_list_1077_1080 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1077_1216[] = {
+ &pci_ss_info_1077_1216_101e_8471,
+ &pci_ss_info_1077_1216_101e_8493,
+ NULL
+};
+#define pci_ss_list_1077_1240 NULL
+#define pci_ss_list_1077_1280 NULL
+#define pci_ss_list_1077_2020 NULL
+static const pciSubsystemInfo *pci_ss_list_1077_2100[] = {
+ &pci_ss_info_1077_2100_1077_0001,
+ NULL
+};
+#define pci_ss_list_1077_2200 NULL
+#define pci_ss_list_1077_2300 NULL
+#define pci_ss_list_1077_2312 NULL
+#endif
+#define pci_ss_list_1078_0000 NULL
+#define pci_ss_list_1078_0001 NULL
+#define pci_ss_list_1078_0002 NULL
+#define pci_ss_list_1078_0100 NULL
+#define pci_ss_list_1078_0101 NULL
+#define pci_ss_list_1078_0102 NULL
+#define pci_ss_list_1078_0103 NULL
+#define pci_ss_list_1078_0104 NULL
+#define pci_ss_list_1078_0400 NULL
+#define pci_ss_list_1078_0401 NULL
+#define pci_ss_list_1078_0402 NULL
+#define pci_ss_list_1078_0403 NULL
+#define pci_ss_list_107d_0000 NULL
+#define pci_ss_list_107e_0001 NULL
+#define pci_ss_list_107e_0002 NULL
+#define pci_ss_list_107e_0004 NULL
+#define pci_ss_list_107e_0005 NULL
+#define pci_ss_list_107e_0008 NULL
+#define pci_ss_list_107e_9003 NULL
+#define pci_ss_list_107e_9007 NULL
+#define pci_ss_list_107e_9008 NULL
+#define pci_ss_list_107e_900c NULL
+#define pci_ss_list_107e_900e NULL
+#define pci_ss_list_107e_9011 NULL
+#define pci_ss_list_107e_9013 NULL
+#define pci_ss_list_107e_9023 NULL
+#define pci_ss_list_107e_9027 NULL
+#define pci_ss_list_107e_9031 NULL
+#define pci_ss_list_107e_9033 NULL
+#define pci_ss_list_107f_0802 NULL
+#define pci_ss_list_1080_0600 NULL
+#define pci_ss_list_1080_c691 NULL
+#define pci_ss_list_1080_c693 NULL
+#define pci_ss_list_1081_0d47 NULL
+#define pci_ss_list_1083_0001 NULL
+#define pci_ss_list_108a_0001 NULL
+#define pci_ss_list_108a_0010 NULL
+#define pci_ss_list_108a_0040 NULL
+#define pci_ss_list_108a_3000 NULL
+#define pci_ss_list_108d_0001 NULL
+#define pci_ss_list_108d_0002 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_108d_0004[] = {
+ &pci_ss_info_108d_0004_108d_0004,
+ NULL
+};
+#define pci_ss_list_108d_0005 NULL
+#define pci_ss_list_108d_0006 NULL
+static const pciSubsystemInfo *pci_ss_list_108d_0007[] = {
+ &pci_ss_info_108d_0007_108d_0007,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_108d_0008[] = {
+ &pci_ss_info_108d_0008_108d_0008,
+ NULL
+};
+#define pci_ss_list_108d_0011 NULL
+#define pci_ss_list_108d_0012 NULL
+#define pci_ss_list_108d_0013 NULL
+#define pci_ss_list_108d_0014 NULL
+static const pciSubsystemInfo *pci_ss_list_108d_0019[] = {
+ &pci_ss_info_108d_0019_108d_0016,
+ &pci_ss_info_108d_0019_108d_0017,
+ NULL
+};
+#define pci_ss_list_108d_0021 NULL
+#define pci_ss_list_108d_0022 NULL
+#endif
+#define pci_ss_list_108e_0001 NULL
+#define pci_ss_list_108e_1000 NULL
+#define pci_ss_list_108e_1001 NULL
+#define pci_ss_list_108e_1100 NULL
+#define pci_ss_list_108e_1101 NULL
+#define pci_ss_list_108e_1102 NULL
+#define pci_ss_list_108e_1103 NULL
+#define pci_ss_list_108e_2bad NULL
+#define pci_ss_list_108e_5000 NULL
+#define pci_ss_list_108e_5043 NULL
+#define pci_ss_list_108e_8000 NULL
+#define pci_ss_list_108e_8001 NULL
+#define pci_ss_list_108e_a000 NULL
+#define pci_ss_list_108e_a001 NULL
+#define pci_ss_list_1091_0020 NULL
+#define pci_ss_list_1091_0021 NULL
+#define pci_ss_list_1091_0040 NULL
+#define pci_ss_list_1091_0041 NULL
+#define pci_ss_list_1091_0060 NULL
+#define pci_ss_list_1091_00e4 NULL
+#define pci_ss_list_1091_0720 NULL
+#define pci_ss_list_1092_00a0 NULL
+#define pci_ss_list_1092_00a8 NULL
+#define pci_ss_list_1092_0550 NULL
+#define pci_ss_list_1092_08d4 NULL
+#define pci_ss_list_1092_094c NULL
+#define pci_ss_list_1092_1092 NULL
+#define pci_ss_list_1092_6120 NULL
+#define pci_ss_list_1092_8810 NULL
+#define pci_ss_list_1092_8811 NULL
+#define pci_ss_list_1092_8880 NULL
+#define pci_ss_list_1092_8881 NULL
+#define pci_ss_list_1092_88b0 NULL
+#define pci_ss_list_1092_88b1 NULL
+#define pci_ss_list_1092_88c0 NULL
+#define pci_ss_list_1092_88c1 NULL
+#define pci_ss_list_1092_88d0 NULL
+#define pci_ss_list_1092_88d1 NULL
+#define pci_ss_list_1092_88f0 NULL
+#define pci_ss_list_1092_88f1 NULL
+#define pci_ss_list_1092_9999 NULL
+#define pci_ss_list_1093_0160 NULL
+#define pci_ss_list_1093_0162 NULL
+#define pci_ss_list_1093_1170 NULL
+#define pci_ss_list_1093_1180 NULL
+#define pci_ss_list_1093_1190 NULL
+#define pci_ss_list_1093_1330 NULL
+#define pci_ss_list_1093_1350 NULL
+#define pci_ss_list_1093_2a60 NULL
+#define pci_ss_list_1093_b001 NULL
+#define pci_ss_list_1093_b011 NULL
+#define pci_ss_list_1093_b021 NULL
+#define pci_ss_list_1093_b031 NULL
+#define pci_ss_list_1093_b041 NULL
+#define pci_ss_list_1093_b051 NULL
+#define pci_ss_list_1093_b061 NULL
+#define pci_ss_list_1093_b071 NULL
+#define pci_ss_list_1093_b081 NULL
+#define pci_ss_list_1093_b091 NULL
+#define pci_ss_list_1093_c801 NULL
+#define pci_ss_list_1093_c831 NULL
+#define pci_ss_list_1095_0640 NULL
+#define pci_ss_list_1095_0643 NULL
+#define pci_ss_list_1095_0646 NULL
+#define pci_ss_list_1095_0647 NULL
+#define pci_ss_list_1095_0648 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1095_0649[] = {
+ &pci_ss_info_1095_0649_0e11_005d,
+ &pci_ss_info_1095_0649_0e11_007e,
+ &pci_ss_info_1095_0649_101e_0649,
+ NULL
+};
+#define pci_ss_list_1095_0650 NULL
+static const pciSubsystemInfo *pci_ss_list_1095_0670[] = {
+ &pci_ss_info_1095_0670_1095_0670,
+ NULL
+};
+#define pci_ss_list_1095_0673 NULL
+#define pci_ss_list_1095_0680 NULL
+#define pci_ss_list_1095_3112 NULL
+#endif
+#define pci_ss_list_1098_0001 NULL
+#define pci_ss_list_1098_0002 NULL
+#define pci_ss_list_109e_0350 NULL
+#define pci_ss_list_109e_0351 NULL
+static const pciSubsystemInfo *pci_ss_list_109e_0369[] = {
+ &pci_ss_info_109e_0369_1002_0001,
+ &pci_ss_info_109e_0369_1002_0003,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_109e_036c[] = {
+ &pci_ss_info_109e_036c_13e9_0070,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_109e_036e[] = {
+ &pci_ss_info_109e_036e_0070_13eb,
+ &pci_ss_info_109e_036e_0070_ff01,
+ &pci_ss_info_109e_036e_107d_6606,
+ &pci_ss_info_109e_036e_11bd_0012,
+ &pci_ss_info_109e_036e_11bd_001c,
+ &pci_ss_info_109e_036e_127a_0001,
+ &pci_ss_info_109e_036e_127a_0002,
+ &pci_ss_info_109e_036e_127a_0003,
+ &pci_ss_info_109e_036e_127a_0048,
+ &pci_ss_info_109e_036e_144f_3000,
+ &pci_ss_info_109e_036e_1461_0004,
+ &pci_ss_info_109e_036e_14f1_0001,
+ &pci_ss_info_109e_036e_14f1_0002,
+ &pci_ss_info_109e_036e_14f1_0003,
+ &pci_ss_info_109e_036e_14f1_0048,
+ &pci_ss_info_109e_036e_1851_1850,
+ &pci_ss_info_109e_036e_1851_1851,
+ &pci_ss_info_109e_036e_1852_1852,
+ &pci_ss_info_109e_036e_bd11_1200,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_109e_036f[] = {
+ &pci_ss_info_109e_036f_127a_0044,
+ &pci_ss_info_109e_036f_127a_0122,
+ &pci_ss_info_109e_036f_127a_0144,
+ &pci_ss_info_109e_036f_127a_0222,
+ &pci_ss_info_109e_036f_127a_0244,
+ &pci_ss_info_109e_036f_127a_0322,
+ &pci_ss_info_109e_036f_127a_0422,
+ &pci_ss_info_109e_036f_127a_1122,
+ &pci_ss_info_109e_036f_127a_1222,
+ &pci_ss_info_109e_036f_127a_1322,
+ &pci_ss_info_109e_036f_127a_1522,
+ &pci_ss_info_109e_036f_127a_1622,
+ &pci_ss_info_109e_036f_127a_1722,
+ &pci_ss_info_109e_036f_14f1_0044,
+ &pci_ss_info_109e_036f_14f1_0122,
+ &pci_ss_info_109e_036f_14f1_0144,
+ &pci_ss_info_109e_036f_14f1_0222,
+ &pci_ss_info_109e_036f_14f1_0244,
+ &pci_ss_info_109e_036f_14f1_0322,
+ &pci_ss_info_109e_036f_14f1_0422,
+ &pci_ss_info_109e_036f_14f1_1122,
+ &pci_ss_info_109e_036f_14f1_1222,
+ &pci_ss_info_109e_036f_14f1_1322,
+ &pci_ss_info_109e_036f_14f1_1522,
+ &pci_ss_info_109e_036f_14f1_1622,
+ &pci_ss_info_109e_036f_14f1_1722,
+ &pci_ss_info_109e_036f_1851_1850,
+ &pci_ss_info_109e_036f_1851_1851,
+ &pci_ss_info_109e_036f_1852_1852,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_109e_0370[] = {
+ &pci_ss_info_109e_0370_1851_1850,
+ &pci_ss_info_109e_0370_1851_1851,
+ &pci_ss_info_109e_0370_1852_1852,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_109e_0878[] = {
+ &pci_ss_info_109e_0878_0070_13eb,
+ &pci_ss_info_109e_0878_0070_ff01,
+ &pci_ss_info_109e_0878_1002_0001,
+ &pci_ss_info_109e_0878_1002_0003,
+ &pci_ss_info_109e_0878_11bd_0012,
+ &pci_ss_info_109e_0878_11bd_001c,
+ &pci_ss_info_109e_0878_127a_0001,
+ &pci_ss_info_109e_0878_127a_0002,
+ &pci_ss_info_109e_0878_127a_0003,
+ &pci_ss_info_109e_0878_127a_0048,
+ &pci_ss_info_109e_0878_13e9_0070,
+ &pci_ss_info_109e_0878_144f_3000,
+ &pci_ss_info_109e_0878_1461_0004,
+ &pci_ss_info_109e_0878_14f1_0001,
+ &pci_ss_info_109e_0878_14f1_0002,
+ &pci_ss_info_109e_0878_14f1_0003,
+ &pci_ss_info_109e_0878_14f1_0048,
+ &pci_ss_info_109e_0878_bd11_1200,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_109e_0879[] = {
+ &pci_ss_info_109e_0879_127a_0044,
+ &pci_ss_info_109e_0879_127a_0122,
+ &pci_ss_info_109e_0879_127a_0144,
+ &pci_ss_info_109e_0879_127a_0222,
+ &pci_ss_info_109e_0879_127a_0244,
+ &pci_ss_info_109e_0879_127a_0322,
+ &pci_ss_info_109e_0879_127a_0422,
+ &pci_ss_info_109e_0879_127a_1122,
+ &pci_ss_info_109e_0879_127a_1222,
+ &pci_ss_info_109e_0879_127a_1322,
+ &pci_ss_info_109e_0879_127a_1522,
+ &pci_ss_info_109e_0879_127a_1622,
+ &pci_ss_info_109e_0879_127a_1722,
+ &pci_ss_info_109e_0879_14f1_0044,
+ &pci_ss_info_109e_0879_14f1_0122,
+ &pci_ss_info_109e_0879_14f1_0144,
+ &pci_ss_info_109e_0879_14f1_0222,
+ &pci_ss_info_109e_0879_14f1_0244,
+ &pci_ss_info_109e_0879_14f1_0322,
+ &pci_ss_info_109e_0879_14f1_0422,
+ &pci_ss_info_109e_0879_14f1_1122,
+ &pci_ss_info_109e_0879_14f1_1222,
+ &pci_ss_info_109e_0879_14f1_1322,
+ &pci_ss_info_109e_0879_14f1_1522,
+ &pci_ss_info_109e_0879_14f1_1622,
+ &pci_ss_info_109e_0879_14f1_1722,
+ NULL
+};
+#define pci_ss_list_109e_0880 NULL
+#define pci_ss_list_109e_2115 NULL
+#define pci_ss_list_109e_2125 NULL
+#define pci_ss_list_109e_2164 NULL
+#define pci_ss_list_109e_2165 NULL
+#define pci_ss_list_109e_8230 NULL
+#define pci_ss_list_109e_8472 NULL
+#define pci_ss_list_109e_8474 NULL
+#define pci_ss_list_10a5_5449 NULL
+#define pci_ss_list_10a8_0000 NULL
+#define pci_ss_list_10a9_0001 NULL
+#define pci_ss_list_10a9_0002 NULL
+#define pci_ss_list_10a9_0003 NULL
+#define pci_ss_list_10a9_0004 NULL
+#define pci_ss_list_10a9_0005 NULL
+#define pci_ss_list_10a9_0006 NULL
+#define pci_ss_list_10a9_0007 NULL
+#define pci_ss_list_10a9_0008 NULL
+#define pci_ss_list_10a9_0009 NULL
+#define pci_ss_list_10a9_0010 NULL
+#define pci_ss_list_10a9_0011 NULL
+#define pci_ss_list_10a9_0012 NULL
+#define pci_ss_list_10a9_1001 NULL
+#define pci_ss_list_10a9_1002 NULL
+#define pci_ss_list_10a9_1003 NULL
+#define pci_ss_list_10a9_1004 NULL
+#define pci_ss_list_10a9_1005 NULL
+#define pci_ss_list_10a9_1006 NULL
+#define pci_ss_list_10a9_1007 NULL
+#define pci_ss_list_10a9_1008 NULL
+#define pci_ss_list_10a9_2001 NULL
+#define pci_ss_list_10a9_2002 NULL
+#define pci_ss_list_10a9_8001 NULL
+#define pci_ss_list_10a9_8002 NULL
+#define pci_ss_list_10aa_0000 NULL
+#define pci_ss_list_10ad_0001 NULL
+#define pci_ss_list_10ad_0003 NULL
+#define pci_ss_list_10ad_0005 NULL
+#define pci_ss_list_10ad_0103 NULL
+#define pci_ss_list_10ad_0105 NULL
+#define pci_ss_list_10ad_0565 NULL
+#define pci_ss_list_10b3_3106 NULL
+#define pci_ss_list_10b3_b106 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b4_1b1d[] = {
+ &pci_ss_info_10b4_1b1d_10b4_237e,
+ NULL
+};
+#endif
+#define pci_ss_list_10b5_0001 NULL
+#define pci_ss_list_10b5_1076 NULL
+#define pci_ss_list_10b5_1077 NULL
+#define pci_ss_list_10b5_1078 NULL
+#define pci_ss_list_10b5_1103 NULL
+#define pci_ss_list_10b5_1146 NULL
+#define pci_ss_list_10b5_1147 NULL
+#define pci_ss_list_10b5_2724 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b5_9030[] = {
+ &pci_ss_info_10b5_9030_15ed_1002,
+ &pci_ss_info_10b5_9030_15ed_1003,
+ NULL
+};
+#define pci_ss_list_10b5_9036 NULL
+static const pciSubsystemInfo *pci_ss_list_10b5_9050[] = {
+ &pci_ss_info_10b5_9050_10b5_2036,
+ &pci_ss_info_10b5_9050_10b5_2273,
+ &pci_ss_info_10b5_9050_10b5_9050,
+ &pci_ss_info_10b5_9050_1522_0001,
+ &pci_ss_info_10b5_9050_1522_0002,
+ &pci_ss_info_10b5_9050_1522_0003,
+ &pci_ss_info_10b5_9050_1522_0004,
+ &pci_ss_info_10b5_9050_1522_0010,
+ &pci_ss_info_10b5_9050_1522_0020,
+ &pci_ss_info_10b5_9050_15ed_1000,
+ &pci_ss_info_10b5_9050_15ed_1001,
+ &pci_ss_info_10b5_9050_15ed_1002,
+ &pci_ss_info_10b5_9050_15ed_1003,
+ &pci_ss_info_10b5_9050_5654_5634,
+ &pci_ss_info_10b5_9050_d531_c002,
+ &pci_ss_info_10b5_9050_d84d_4006,
+ &pci_ss_info_10b5_9050_d84d_4008,
+ &pci_ss_info_10b5_9050_d84d_4014,
+ &pci_ss_info_10b5_9050_d84d_4018,
+ &pci_ss_info_10b5_9050_d84d_4025,
+ &pci_ss_info_10b5_9050_d84d_4027,
+ &pci_ss_info_10b5_9050_d84d_4028,
+ &pci_ss_info_10b5_9050_d84d_4036,
+ &pci_ss_info_10b5_9050_d84d_4037,
+ &pci_ss_info_10b5_9050_d84d_4038,
+ &pci_ss_info_10b5_9050_d84d_4052,
+ &pci_ss_info_10b5_9050_d84d_4053,
+ &pci_ss_info_10b5_9050_d84d_4055,
+ &pci_ss_info_10b5_9050_d84d_4058,
+ &pci_ss_info_10b5_9050_d84d_4065,
+ &pci_ss_info_10b5_9050_d84d_4068,
+ &pci_ss_info_10b5_9050_d84d_4078,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b5_9054[] = {
+ &pci_ss_info_10b5_9054_10b5_2455,
+ NULL
+};
+#define pci_ss_list_10b5_9060 NULL
+static const pciSubsystemInfo *pci_ss_list_10b5_906d[] = {
+ &pci_ss_info_10b5_906d_125c_0640,
+ NULL
+};
+#define pci_ss_list_10b5_906e NULL
+static const pciSubsystemInfo *pci_ss_list_10b5_9080[] = {
+ &pci_ss_info_10b5_9080_10b5_9080,
+ &pci_ss_info_10b5_9080_129d_0002,
+ NULL
+};
+#endif
+#define pci_ss_list_10b6_0001 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b6_0002[] = {
+ &pci_ss_info_10b6_0002_10b6_0002,
+ &pci_ss_info_10b6_0002_10b6_0006,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b6_0003[] = {
+ &pci_ss_info_10b6_0003_0e11_b0fd,
+ &pci_ss_info_10b6_0003_10b6_0003,
+ &pci_ss_info_10b6_0003_10b6_0007,
+ NULL
+};
+#define pci_ss_list_10b6_0004 NULL
+static const pciSubsystemInfo *pci_ss_list_10b6_0006[] = {
+ &pci_ss_info_10b6_0006_10b6_0006,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b6_0007[] = {
+ &pci_ss_info_10b6_0007_10b6_0007,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b6_0009[] = {
+ &pci_ss_info_10b6_0009_10b6_0009,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b6_000a[] = {
+ &pci_ss_info_10b6_000a_10b6_000a,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b6_000b[] = {
+ &pci_ss_info_10b6_000b_10b6_0008,
+ &pci_ss_info_10b6_000b_10b6_000b,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b6_000c[] = {
+ &pci_ss_info_10b6_000c_10b6_000c,
+ NULL
+};
+#define pci_ss_list_10b6_1000 NULL
+#define pci_ss_list_10b6_1001 NULL
+#endif
+#define pci_ss_list_10b7_0001 NULL
+#define pci_ss_list_10b7_1006 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b7_1007[] = {
+ &pci_ss_info_10b7_1007_10b7_615c,
+ NULL
+};
+#define pci_ss_list_10b7_3390 NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_3590[] = {
+ &pci_ss_info_10b7_3590_10b7_3590,
+ NULL
+};
+#define pci_ss_list_10b7_4500 NULL
+#define pci_ss_list_10b7_5055 NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_5057[] = {
+ &pci_ss_info_10b7_5057_10b7_5a57,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_5157[] = {
+ &pci_ss_info_10b7_5157_10b7_5b57,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_5257[] = {
+ &pci_ss_info_10b7_5257_10b7_5c57,
+ NULL
+};
+#define pci_ss_list_10b7_5900 NULL
+#define pci_ss_list_10b7_5920 NULL
+#define pci_ss_list_10b7_5950 NULL
+#define pci_ss_list_10b7_5951 NULL
+#define pci_ss_list_10b7_5952 NULL
+#define pci_ss_list_10b7_5970 NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_5b57[] = {
+ &pci_ss_info_10b7_5b57_10b7_5b57,
+ NULL
+};
+#define pci_ss_list_10b7_6055 NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_6056[] = {
+ &pci_ss_info_10b7_6056_10b7_6556,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_6560[] = {
+ &pci_ss_info_10b7_6560_10b7_656a,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_6561[] = {
+ &pci_ss_info_10b7_6561_10b7_656b,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_6562[] = {
+ &pci_ss_info_10b7_6562_10b7_656b,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_6563[] = {
+ &pci_ss_info_10b7_6563_10b7_656b,
+ NULL
+};
+#define pci_ss_list_10b7_6564 NULL
+#define pci_ss_list_10b7_7646 NULL
+#define pci_ss_list_10b7_7940 NULL
+#define pci_ss_list_10b7_7980 NULL
+#define pci_ss_list_10b7_7990 NULL
+#define pci_ss_list_10b7_8811 NULL
+#define pci_ss_list_10b7_9000 NULL
+#define pci_ss_list_10b7_9001 NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_9004[] = {
+ &pci_ss_info_10b7_9004_10b7_9004,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_9005[] = {
+ &pci_ss_info_10b7_9005_10b7_9005,
+ NULL
+};
+#define pci_ss_list_10b7_9006 NULL
+#define pci_ss_list_10b7_900a NULL
+#define pci_ss_list_10b7_9050 NULL
+#define pci_ss_list_10b7_9051 NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_9055[] = {
+ &pci_ss_info_10b7_9055_1028_0080,
+ &pci_ss_info_10b7_9055_1028_0081,
+ &pci_ss_info_10b7_9055_1028_0082,
+ &pci_ss_info_10b7_9055_1028_0083,
+ &pci_ss_info_10b7_9055_1028_0084,
+ &pci_ss_info_10b7_9055_1028_0085,
+ &pci_ss_info_10b7_9055_1028_0086,
+ &pci_ss_info_10b7_9055_1028_0087,
+ &pci_ss_info_10b7_9055_1028_0088,
+ &pci_ss_info_10b7_9055_1028_0089,
+ &pci_ss_info_10b7_9055_1028_0090,
+ &pci_ss_info_10b7_9055_1028_0091,
+ &pci_ss_info_10b7_9055_1028_0092,
+ &pci_ss_info_10b7_9055_1028_0093,
+ &pci_ss_info_10b7_9055_1028_0094,
+ &pci_ss_info_10b7_9055_1028_0095,
+ &pci_ss_info_10b7_9055_1028_0096,
+ &pci_ss_info_10b7_9055_1028_0097,
+ &pci_ss_info_10b7_9055_1028_0098,
+ &pci_ss_info_10b7_9055_1028_0099,
+ &pci_ss_info_10b7_9055_10b7_9055,
+ NULL
+};
+#define pci_ss_list_10b7_9056 NULL
+#define pci_ss_list_10b7_9058 NULL
+#define pci_ss_list_10b7_905a NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_9200[] = {
+ &pci_ss_info_10b7_9200_1028_0095,
+ &pci_ss_info_10b7_9200_10b7_1000,
+ &pci_ss_info_10b7_9200_10b7_7000,
+ NULL
+};
+#define pci_ss_list_10b7_9201 NULL
+#define pci_ss_list_10b7_9300 NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_9800[] = {
+ &pci_ss_info_10b7_9800_10b7_9800,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_9805[] = {
+ &pci_ss_info_10b7_9805_10b7_1201,
+ &pci_ss_info_10b7_9805_10b7_1202,
+ &pci_ss_info_10b7_9805_10b7_9805,
+ &pci_ss_info_10b7_9805_10f1_2462,
+ NULL
+};
+#define pci_ss_list_10b7_9900 NULL
+#define pci_ss_list_10b7_9902 NULL
+#define pci_ss_list_10b7_9903 NULL
+static const pciSubsystemInfo *pci_ss_list_10b7_9904[] = {
+ &pci_ss_info_10b7_9904_10b7_1000,
+ &pci_ss_info_10b7_9904_10b7_2000,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b7_9905[] = {
+ &pci_ss_info_10b7_9905_10b7_1101,
+ &pci_ss_info_10b7_9905_10b7_1102,
+ &pci_ss_info_10b7_9905_10b7_2101,
+ &pci_ss_info_10b7_9905_10b7_2102,
+ NULL
+};
+#define pci_ss_list_10b7_9908 NULL
+#define pci_ss_list_10b7_9909 NULL
+#define pci_ss_list_10b7_990b NULL
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b8_0005[] = {
+ &pci_ss_info_10b8_0005_1055_e000,
+ &pci_ss_info_10b8_0005_1055_e002,
+ &pci_ss_info_10b8_0005_10b8_a011,
+ &pci_ss_info_10b8_0005_10b8_a014,
+ &pci_ss_info_10b8_0005_10b8_a015,
+ &pci_ss_info_10b8_0005_10b8_a016,
+ &pci_ss_info_10b8_0005_10b8_a017,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b8_0006[] = {
+ &pci_ss_info_10b8_0006_1055_e100,
+ &pci_ss_info_10b8_0006_1055_e102,
+ &pci_ss_info_10b8_0006_1055_e300,
+ &pci_ss_info_10b8_0006_1055_e302,
+ &pci_ss_info_10b8_0006_10b8_a012,
+ &pci_ss_info_10b8_0006_13a2_8002,
+ &pci_ss_info_10b8_0006_13a2_8006,
+ NULL
+};
+#define pci_ss_list_10b8_1000 NULL
+#define pci_ss_list_10b8_1001 NULL
+#define pci_ss_list_10b8_a011 NULL
+#define pci_ss_list_10b8_b106 NULL
+#endif
+static const pciSubsystemInfo *pci_ss_list_10b9_0111[] = {
+ &pci_ss_info_10b9_0111_10b9_0111,
+ NULL
+};
+#define pci_ss_list_10b9_1435 NULL
+#define pci_ss_list_10b9_1445 NULL
+#define pci_ss_list_10b9_1449 NULL
+#define pci_ss_list_10b9_1451 NULL
+#define pci_ss_list_10b9_1461 NULL
+#define pci_ss_list_10b9_1489 NULL
+#define pci_ss_list_10b9_1511 NULL
+#define pci_ss_list_10b9_1512 NULL
+#define pci_ss_list_10b9_1513 NULL
+static const pciSubsystemInfo *pci_ss_list_10b9_1521[] = {
+ &pci_ss_info_10b9_1521_10b9_1521,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b9_1523[] = {
+ &pci_ss_info_10b9_1523_10b9_1523,
+ NULL
+};
+#define pci_ss_list_10b9_1531 NULL
+static const pciSubsystemInfo *pci_ss_list_10b9_1533[] = {
+ &pci_ss_info_10b9_1533_10b9_1533,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10b9_1541[] = {
+ &pci_ss_info_10b9_1541_10b9_1541,
+ NULL
+};
+#define pci_ss_list_10b9_1543 NULL
+#define pci_ss_list_10b9_1563 NULL
+#define pci_ss_list_10b9_1621 NULL
+#define pci_ss_list_10b9_1631 NULL
+#define pci_ss_list_10b9_1632 NULL
+#define pci_ss_list_10b9_1641 NULL
+#define pci_ss_list_10b9_1644 NULL
+#define pci_ss_list_10b9_1646 NULL
+#define pci_ss_list_10b9_1647 NULL
+#define pci_ss_list_10b9_1651 NULL
+#define pci_ss_list_10b9_1671 NULL
+#define pci_ss_list_10b9_1681 NULL
+#define pci_ss_list_10b9_1687 NULL
+#define pci_ss_list_10b9_3141 NULL
+#define pci_ss_list_10b9_3143 NULL
+#define pci_ss_list_10b9_3145 NULL
+#define pci_ss_list_10b9_3147 NULL
+#define pci_ss_list_10b9_3149 NULL
+#define pci_ss_list_10b9_3151 NULL
+#define pci_ss_list_10b9_3307 NULL
+#define pci_ss_list_10b9_3309 NULL
+#define pci_ss_list_10b9_5212 NULL
+#define pci_ss_list_10b9_5215 NULL
+#define pci_ss_list_10b9_5217 NULL
+#define pci_ss_list_10b9_5219 NULL
+#define pci_ss_list_10b9_5225 NULL
+static const pciSubsystemInfo *pci_ss_list_10b9_5229[] = {
+ &pci_ss_info_10b9_5229_1043_8053,
+ NULL
+};
+#define pci_ss_list_10b9_5235 NULL
+#define pci_ss_list_10b9_5237 NULL
+#define pci_ss_list_10b9_5239 NULL
+#define pci_ss_list_10b9_5243 NULL
+#define pci_ss_list_10b9_5247 NULL
+#define pci_ss_list_10b9_5249 NULL
+#define pci_ss_list_10b9_5251 NULL
+#define pci_ss_list_10b9_5253 NULL
+#define pci_ss_list_10b9_5261 NULL
+static const pciSubsystemInfo *pci_ss_list_10b9_5451[] = {
+ &pci_ss_info_10b9_5451_1014_0506,
+ NULL
+};
+#define pci_ss_list_10b9_5453 NULL
+#define pci_ss_list_10b9_5455 NULL
+#define pci_ss_list_10b9_5457 NULL
+#define pci_ss_list_10b9_5459 NULL
+#define pci_ss_list_10b9_545a NULL
+#define pci_ss_list_10b9_5471 NULL
+#define pci_ss_list_10b9_5473 NULL
+static const pciSubsystemInfo *pci_ss_list_10b9_7101[] = {
+ &pci_ss_info_10b9_7101_10b9_7101,
+ NULL
+};
+#define pci_ss_list_10ba_0301 NULL
+#define pci_ss_list_10bd_0e34 NULL
+#define pci_ss_list_10c3_1100 NULL
+#define pci_ss_list_10c8_0001 NULL
+#define pci_ss_list_10c8_0002 NULL
+#define pci_ss_list_10c8_0003 NULL
+static const pciSubsystemInfo *pci_ss_list_10c8_0004[] = {
+ &pci_ss_info_10c8_0004_1014_00ba,
+ &pci_ss_info_10c8_0004_1025_1007,
+ &pci_ss_info_10c8_0004_1028_0074,
+ &pci_ss_info_10c8_0004_1028_0075,
+ &pci_ss_info_10c8_0004_1028_007d,
+ &pci_ss_info_10c8_0004_1028_007e,
+ &pci_ss_info_10c8_0004_1033_802f,
+ &pci_ss_info_10c8_0004_104d_801b,
+ &pci_ss_info_10c8_0004_104d_802f,
+ &pci_ss_info_10c8_0004_104d_830b,
+ &pci_ss_info_10c8_0004_10ba_0e00,
+ &pci_ss_info_10c8_0004_10c8_0004,
+ &pci_ss_info_10c8_0004_10cf_1029,
+ &pci_ss_info_10c8_0004_10f7_8308,
+ &pci_ss_info_10c8_0004_10f7_8309,
+ &pci_ss_info_10c8_0004_10f7_830b,
+ &pci_ss_info_10c8_0004_10f7_830d,
+ &pci_ss_info_10c8_0004_10f7_8312,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10c8_0005[] = {
+ &pci_ss_info_10c8_0005_1014_00dd,
+ NULL
+};
+#define pci_ss_list_10c8_0006 NULL
+static const pciSubsystemInfo *pci_ss_list_10c8_0016[] = {
+ &pci_ss_info_10c8_0016_10c8_0016,
+ NULL
+};
+#define pci_ss_list_10c8_0025 NULL
+#define pci_ss_list_10c8_0083 NULL
+static const pciSubsystemInfo *pci_ss_list_10c8_8005[] = {
+ &pci_ss_info_10c8_8005_0e11_b0d1,
+ &pci_ss_info_10c8_8005_0e11_b126,
+ &pci_ss_info_10c8_8005_1014_00dd,
+ &pci_ss_info_10c8_8005_1025_1003,
+ &pci_ss_info_10c8_8005_1028_008f,
+ &pci_ss_info_10c8_8005_103c_0007,
+ &pci_ss_info_10c8_8005_103c_0008,
+ &pci_ss_info_10c8_8005_103c_000d,
+ &pci_ss_info_10c8_8005_10c8_8005,
+ &pci_ss_info_10c8_8005_110a_8005,
+ &pci_ss_info_10c8_8005_14c0_0004,
+ NULL
+};
+#define pci_ss_list_10c8_8006 NULL
+#define pci_ss_list_10c8_8016 NULL
+#define pci_ss_list_10cd_1100 NULL
+#define pci_ss_list_10cd_1200 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10cd_1300[] = {
+ &pci_ss_info_10cd_1300_10cd_1310,
+ NULL
+};
+#define pci_ss_list_10cd_2300 NULL
+#define pci_ss_list_10cd_2500 NULL
+#endif
+#define pci_ss_list_10cf_2001 NULL
+#define pci_ss_list_10d9_0512 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10d9_0531[] = {
+ &pci_ss_info_10d9_0531_1186_1200,
+ NULL
+};
+#define pci_ss_list_10d9_8625 NULL
+#define pci_ss_list_10d9_8888 NULL
+#endif
+#define pci_ss_list_10da_0508 NULL
+#define pci_ss_list_10da_3390 NULL
+#define pci_ss_list_10dc_0001 NULL
+#define pci_ss_list_10dc_0002 NULL
+#define pci_ss_list_10dc_0021 NULL
+#define pci_ss_list_10dc_0022 NULL
+#define pci_ss_list_10dc_10dc NULL
+#define pci_ss_list_10de_0008 NULL
+#define pci_ss_list_10de_0009 NULL
+#define pci_ss_list_10de_0010 NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0020[] = {
+ &pci_ss_info_10de_0020_1043_0200,
+ &pci_ss_info_10de_0020_1048_0c18,
+ &pci_ss_info_10de_0020_1048_0c1b,
+ &pci_ss_info_10de_0020_1092_0550,
+ &pci_ss_info_10de_0020_1092_0552,
+ &pci_ss_info_10de_0020_1092_4804,
+ &pci_ss_info_10de_0020_1092_4808,
+ &pci_ss_info_10de_0020_1092_4810,
+ &pci_ss_info_10de_0020_1092_4812,
+ &pci_ss_info_10de_0020_1092_4815,
+ &pci_ss_info_10de_0020_1092_4820,
+ &pci_ss_info_10de_0020_1092_4822,
+ &pci_ss_info_10de_0020_1092_4904,
+ &pci_ss_info_10de_0020_1092_4914,
+ &pci_ss_info_10de_0020_1092_8225,
+ &pci_ss_info_10de_0020_10b4_273d,
+ &pci_ss_info_10de_0020_10b4_273e,
+ &pci_ss_info_10de_0020_10b4_2740,
+ &pci_ss_info_10de_0020_10de_0020,
+ &pci_ss_info_10de_0020_1102_1015,
+ &pci_ss_info_10de_0020_1102_1016,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10de_0028[] = {
+ &pci_ss_info_10de_0028_1043_0200,
+ &pci_ss_info_10de_0028_1043_0201,
+ &pci_ss_info_10de_0028_1043_0205,
+ &pci_ss_info_10de_0028_1043_4000,
+ &pci_ss_info_10de_0028_1092_4804,
+ &pci_ss_info_10de_0028_1092_4a00,
+ &pci_ss_info_10de_0028_1092_4a02,
+ &pci_ss_info_10de_0028_1092_5a00,
+ &pci_ss_info_10de_0028_1092_6a02,
+ &pci_ss_info_10de_0028_1092_7a02,
+ &pci_ss_info_10de_0028_10de_0005,
+ &pci_ss_info_10de_0028_10de_000f,
+ &pci_ss_info_10de_0028_1102_1020,
+ &pci_ss_info_10de_0028_1102_1026,
+ &pci_ss_info_10de_0028_14af_5810,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10de_0029[] = {
+ &pci_ss_info_10de_0029_1043_0200,
+ &pci_ss_info_10de_0029_1043_0201,
+ &pci_ss_info_10de_0029_1043_0205,
+ &pci_ss_info_10de_0029_1102_1021,
+ &pci_ss_info_10de_0029_1102_1029,
+ &pci_ss_info_10de_0029_1102_102f,
+ &pci_ss_info_10de_0029_14af_5820,
+ NULL
+};
+#define pci_ss_list_10de_002a NULL
+#define pci_ss_list_10de_002b NULL
+static const pciSubsystemInfo *pci_ss_list_10de_002c[] = {
+ &pci_ss_info_10de_002c_1043_0200,
+ &pci_ss_info_10de_002c_1043_0201,
+ &pci_ss_info_10de_002c_1092_6820,
+ &pci_ss_info_10de_002c_1102_1031,
+ &pci_ss_info_10de_002c_1102_1034,
+ &pci_ss_info_10de_002c_14af_5008,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10de_002d[] = {
+ &pci_ss_info_10de_002d_1043_0200,
+ &pci_ss_info_10de_002d_1043_0201,
+ &pci_ss_info_10de_002d_1048_0c3a,
+ &pci_ss_info_10de_002d_10de_001e,
+ &pci_ss_info_10de_002d_1102_1023,
+ &pci_ss_info_10de_002d_1102_1024,
+ &pci_ss_info_10de_002d_1102_102c,
+ &pci_ss_info_10de_002d_1462_8808,
+ &pci_ss_info_10de_002d_1554_1041,
+ NULL
+};
+#define pci_ss_list_10de_002e NULL
+#define pci_ss_list_10de_002f NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0060[] = {
+ &pci_ss_info_10de_0060_1043_80ad,
+ NULL
+};
+#define pci_ss_list_10de_0064 NULL
+#define pci_ss_list_10de_0065 NULL
+#define pci_ss_list_10de_0066 NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0067[] = {
+ &pci_ss_info_10de_0067_1043_0c11,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10de_0068[] = {
+ &pci_ss_info_10de_0068_1043_0c11,
+ NULL
+};
+#define pci_ss_list_10de_006a NULL
+#define pci_ss_list_10de_006b NULL
+#define pci_ss_list_10de_006e NULL
+static const pciSubsystemInfo *pci_ss_list_10de_00a0[] = {
+ &pci_ss_info_10de_00a0_14af_5810,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10de_0100[] = {
+ &pci_ss_info_10de_0100_1043_0200,
+ &pci_ss_info_10de_0100_1043_0201,
+ &pci_ss_info_10de_0100_1043_4008,
+ &pci_ss_info_10de_0100_1043_4009,
+ &pci_ss_info_10de_0100_1102_102d,
+ &pci_ss_info_10de_0100_14af_5022,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10de_0101[] = {
+ &pci_ss_info_10de_0101_1043_0202,
+ &pci_ss_info_10de_0101_1043_400a,
+ &pci_ss_info_10de_0101_1043_400b,
+ &pci_ss_info_10de_0101_1102_102e,
+ &pci_ss_info_10de_0101_14af_5021,
+ NULL
+};
+#define pci_ss_list_10de_0103 NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0110[] = {
+ &pci_ss_info_10de_0110_1043_4015,
+ &pci_ss_info_10de_0110_1043_4031,
+ &pci_ss_info_10de_0110_1462_8817,
+ &pci_ss_info_10de_0110_14af_7102,
+ &pci_ss_info_10de_0110_14af_7103,
+ NULL
+};
+#define pci_ss_list_10de_0111 NULL
+#define pci_ss_list_10de_0112 NULL
+#define pci_ss_list_10de_0113 NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0150[] = {
+ &pci_ss_info_10de_0150_1043_4016,
+ &pci_ss_info_10de_0150_107d_2840,
+ &pci_ss_info_10de_0150_1462_8831,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10de_0151[] = {
+ &pci_ss_info_10de_0151_1043_405f,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10de_0152[] = {
+ &pci_ss_info_10de_0152_1048_0c56,
+ NULL
+};
+#define pci_ss_list_10de_0153 NULL
+#define pci_ss_list_10de_0170 NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0171[] = {
+ &pci_ss_info_10de_0171_1462_8661,
+ &pci_ss_info_10de_0171_1462_8730,
+ &pci_ss_info_10de_0171_147b_8f00,
+ NULL
+};
+#define pci_ss_list_10de_0172 NULL
+#define pci_ss_list_10de_0173 NULL
+#define pci_ss_list_10de_0174 NULL
+#define pci_ss_list_10de_0175 NULL
+#define pci_ss_list_10de_0176 NULL
+#define pci_ss_list_10de_0178 NULL
+#define pci_ss_list_10de_0179 NULL
+#define pci_ss_list_10de_017a NULL
+#define pci_ss_list_10de_017b NULL
+#define pci_ss_list_10de_017c NULL
+#define pci_ss_list_10de_0181 NULL
+#define pci_ss_list_10de_0182 NULL
+#define pci_ss_list_10de_0183 NULL
+#define pci_ss_list_10de_0188 NULL
+#define pci_ss_list_10de_018a NULL
+#define pci_ss_list_10de_018b NULL
+#define pci_ss_list_10de_01a0 NULL
+#define pci_ss_list_10de_01a4 NULL
+#define pci_ss_list_10de_01ab NULL
+#define pci_ss_list_10de_01ac NULL
+#define pci_ss_list_10de_01ad NULL
+#define pci_ss_list_10de_01b1 NULL
+#define pci_ss_list_10de_01b2 NULL
+#define pci_ss_list_10de_01b4 NULL
+#define pci_ss_list_10de_01b7 NULL
+#define pci_ss_list_10de_01b8 NULL
+#define pci_ss_list_10de_01bc NULL
+#define pci_ss_list_10de_01c1 NULL
+#define pci_ss_list_10de_01c2 NULL
+#define pci_ss_list_10de_01c3 NULL
+#define pci_ss_list_10de_01e8 NULL
+#define pci_ss_list_10de_01f0 NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0200[] = {
+ &pci_ss_info_10de_0200_1043_402f,
+ NULL
+};
+#define pci_ss_list_10de_0201 NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0202[] = {
+ &pci_ss_info_10de_0202_1043_405b,
+ &pci_ss_info_10de_0202_1545_002f,
+ NULL
+};
+#define pci_ss_list_10de_0203 NULL
+#define pci_ss_list_10de_0250 NULL
+#define pci_ss_list_10de_0251 NULL
+#define pci_ss_list_10de_0252 NULL
+static const pciSubsystemInfo *pci_ss_list_10de_0253[] = {
+ &pci_ss_info_10de_0253_107d_2896,
+ &pci_ss_info_10de_0253_147b_8f09,
+ NULL
+};
+#define pci_ss_list_10de_0258 NULL
+#define pci_ss_list_10de_0259 NULL
+#define pci_ss_list_10de_025b NULL
+#define pci_ss_list_10de_0280 NULL
+#define pci_ss_list_10de_0281 NULL
+#define pci_ss_list_10de_0282 NULL
+#define pci_ss_list_10de_0288 NULL
+#define pci_ss_list_10de_0289 NULL
+#define pci_ss_list_10de_0300 NULL
+#define pci_ss_list_10de_0301 NULL
+#define pci_ss_list_10de_0302 NULL
+#define pci_ss_list_10de_0308 NULL
+#define pci_ss_list_10de_0309 NULL
+#define pci_ss_list_10df_1ae5 NULL
+#define pci_ss_list_10df_f085 NULL
+#define pci_ss_list_10df_f095 NULL
+#define pci_ss_list_10df_f098 NULL
+#define pci_ss_list_10df_f700 NULL
+#define pci_ss_list_10df_f800 NULL
+#define pci_ss_list_10df_f900 NULL
+#define pci_ss_list_10df_f980 NULL
+#define pci_ss_list_10e0_5026 NULL
+#define pci_ss_list_10e0_5027 NULL
+#define pci_ss_list_10e0_5028 NULL
+#define pci_ss_list_10e0_8849 NULL
+#define pci_ss_list_10e0_8853 NULL
+#define pci_ss_list_10e0_9128 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10e1_0391[] = {
+ &pci_ss_info_10e1_0391_10e1_0391,
+ NULL
+};
+#define pci_ss_list_10e1_690c NULL
+#define pci_ss_list_10e1_dc29 NULL
+#endif
+#define pci_ss_list_10e3_0000 NULL
+#define pci_ss_list_10e3_0860 NULL
+#define pci_ss_list_10e3_0862 NULL
+#define pci_ss_list_10e8_2011 NULL
+#define pci_ss_list_10e8_4750 NULL
+#define pci_ss_list_10e8_5920 NULL
+#define pci_ss_list_10e8_8043 NULL
+#define pci_ss_list_10e8_8062 NULL
+#define pci_ss_list_10e8_807d NULL
+#define pci_ss_list_10e8_8088 NULL
+#define pci_ss_list_10e8_8089 NULL
+#define pci_ss_list_10e8_809c NULL
+#define pci_ss_list_10e8_80d7 NULL
+#define pci_ss_list_10e8_80d9 NULL
+#define pci_ss_list_10e8_80da NULL
+#define pci_ss_list_10e8_811a NULL
+#define pci_ss_list_10e8_8170 NULL
+#define pci_ss_list_10e8_82db NULL
+#define pci_ss_list_10ea_1680 NULL
+#define pci_ss_list_10ea_1682 NULL
+#define pci_ss_list_10ea_1683 NULL
+#define pci_ss_list_10ea_2000 NULL
+#define pci_ss_list_10ea_2010 NULL
+#define pci_ss_list_10ea_5000 NULL
+#define pci_ss_list_10ea_5050 NULL
+#define pci_ss_list_10ea_5202 NULL
+#define pci_ss_list_10eb_0101 NULL
+#define pci_ss_list_10eb_8111 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10ec_8029[] = {
+ &pci_ss_info_10ec_8029_10b8_2011,
+ &pci_ss_info_10ec_8029_10ec_8029,
+ &pci_ss_info_10ec_8029_1113_1208,
+ &pci_ss_info_10ec_8029_1186_0300,
+ &pci_ss_info_10ec_8029_1259_2400,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10ec_8129[] = {
+ &pci_ss_info_10ec_8129_10ec_8129,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10ec_8138[] = {
+ &pci_ss_info_10ec_8138_10ec_8138,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10ec_8139[] = {
+ &pci_ss_info_10ec_8139_1025_8920,
+ &pci_ss_info_10ec_8139_1025_8921,
+ &pci_ss_info_10ec_8139_10bd_0320,
+ &pci_ss_info_10ec_8139_10ec_8139,
+ &pci_ss_info_10ec_8139_1186_1300,
+ &pci_ss_info_10ec_8139_1186_1320,
+ &pci_ss_info_10ec_8139_1186_8139,
+ &pci_ss_info_10ec_8139_11f6_8139,
+ &pci_ss_info_10ec_8139_1259_2500,
+ &pci_ss_info_10ec_8139_1259_2503,
+ &pci_ss_info_10ec_8139_1429_d010,
+ &pci_ss_info_10ec_8139_1432_9130,
+ &pci_ss_info_10ec_8139_1436_8139,
+ &pci_ss_info_10ec_8139_146c_1439,
+ &pci_ss_info_10ec_8139_1489_6001,
+ &pci_ss_info_10ec_8139_1489_6002,
+ &pci_ss_info_10ec_8139_149c_139a,
+ &pci_ss_info_10ec_8139_149c_8139,
+ &pci_ss_info_10ec_8139_2646_0001,
+ &pci_ss_info_10ec_8139_8e2e_7000,
+ &pci_ss_info_10ec_8139_8e2e_7100,
+ &pci_ss_info_10ec_8139_a0a0_0007,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_10ec_8169[] = {
+ &pci_ss_info_10ec_8169_1371_434e,
+ NULL
+};
+#define pci_ss_list_10ec_8197 NULL
+#endif
+#define pci_ss_list_10ed_7310 NULL
+#define pci_ss_list_10ee_3fc0 NULL
+#define pci_ss_list_10ee_3fc1 NULL
+#define pci_ss_list_10ee_3fc2 NULL
+#define pci_ss_list_10ee_3fc3 NULL
+#define pci_ss_list_10ee_3fc4 NULL
+#define pci_ss_list_10ee_3fc5 NULL
+#define pci_ss_list_10ef_8154 NULL
+#define pci_ss_list_10f5_a001 NULL
+#define pci_ss_list_10fa_000c NULL
+#define pci_ss_list_10fb_186f NULL
+#define pci_ss_list_10fc_0003 NULL
+#define pci_ss_list_10fc_0005 NULL
+#define pci_ss_list_1101_1060 NULL
+#define pci_ss_list_1101_9100 NULL
+#define pci_ss_list_1101_9400 NULL
+#define pci_ss_list_1101_9401 NULL
+#define pci_ss_list_1101_9500 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1102_0002[] = {
+ &pci_ss_info_1102_0002_1102_0020,
+ &pci_ss_info_1102_0002_1102_0021,
+ &pci_ss_info_1102_0002_1102_002f,
+ &pci_ss_info_1102_0002_1102_4001,
+ &pci_ss_info_1102_0002_1102_8022,
+ &pci_ss_info_1102_0002_1102_8023,
+ &pci_ss_info_1102_0002_1102_8024,
+ &pci_ss_info_1102_0002_1102_8025,
+ &pci_ss_info_1102_0002_1102_8026,
+ &pci_ss_info_1102_0002_1102_8027,
+ &pci_ss_info_1102_0002_1102_8028,
+ &pci_ss_info_1102_0002_1102_8031,
+ &pci_ss_info_1102_0002_1102_8040,
+ &pci_ss_info_1102_0002_1102_8051,
+ &pci_ss_info_1102_0002_1102_8061,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1102_0004[] = {
+ &pci_ss_info_1102_0004_1102_0051,
+ &pci_ss_info_1102_0004_1102_0053,
+ NULL
+};
+#define pci_ss_list_1102_0006 NULL
+static const pciSubsystemInfo *pci_ss_list_1102_4001[] = {
+ &pci_ss_info_1102_4001_1102_0010,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1102_7002[] = {
+ &pci_ss_info_1102_7002_1102_0020,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1102_7003[] = {
+ &pci_ss_info_1102_7003_1102_0040,
+ NULL
+};
+#define pci_ss_list_1102_7004 NULL
+#define pci_ss_list_1102_8064 NULL
+#define pci_ss_list_1102_8938 NULL
+#endif
+#define pci_ss_list_1103_0003 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1103_0004[] = {
+ &pci_ss_info_1103_0004_1103_0001,
+ &pci_ss_info_1103_0004_1103_0005,
+ NULL
+};
+#define pci_ss_list_1103_0005 NULL
+#define pci_ss_list_1103_0006 NULL
+#define pci_ss_list_1103_0007 NULL
+#define pci_ss_list_1103_0008 NULL
+#endif
+#define pci_ss_list_1105_1105 NULL
+#define pci_ss_list_1105_8300 NULL
+#define pci_ss_list_1105_8400 NULL
+#define pci_ss_list_1106_0102 NULL
+#define pci_ss_list_1106_0130 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_0305[] = {
+ &pci_ss_info_1106_0305_1043_8033,
+ &pci_ss_info_1106_0305_1043_803e,
+ &pci_ss_info_1106_0305_1043_8042,
+ &pci_ss_info_1106_0305_147b_a401,
+ NULL
+};
+#define pci_ss_list_1106_0391 NULL
+#define pci_ss_list_1106_0501 NULL
+#define pci_ss_list_1106_0505 NULL
+#define pci_ss_list_1106_0561 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_0571[] = {
+ &pci_ss_info_1106_0571_1043_8052,
+ &pci_ss_info_1106_0571_1106_0571,
+ &pci_ss_info_1106_0571_1179_0001,
+ &pci_ss_info_1106_0571_1458_5002,
+ NULL
+};
+#define pci_ss_list_1106_0576 NULL
+#define pci_ss_list_1106_0585 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_0586[] = {
+ &pci_ss_info_1106_0586_1106_0000,
+ NULL
+};
+#define pci_ss_list_1106_0595 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_0596[] = {
+ &pci_ss_info_1106_0596_1106_0000,
+ &pci_ss_info_1106_0596_1458_0596,
+ NULL
+};
+#define pci_ss_list_1106_0597 NULL
+#define pci_ss_list_1106_0598 NULL
+#define pci_ss_list_1106_0601 NULL
+#define pci_ss_list_1106_0605 NULL
+#define pci_ss_list_1106_0680 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_0686[] = {
+ &pci_ss_info_1106_0686_1043_8033,
+ &pci_ss_info_1106_0686_1043_803e,
+ &pci_ss_info_1106_0686_1043_8040,
+ &pci_ss_info_1106_0686_1043_8042,
+ &pci_ss_info_1106_0686_1106_0000,
+ &pci_ss_info_1106_0686_1106_0686,
+ &pci_ss_info_1106_0686_1179_0001,
+ &pci_ss_info_1106_0686_147b_a702,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1106_0691[] = {
+ &pci_ss_info_1106_0691_1179_0001,
+ &pci_ss_info_1106_0691_1458_0691,
+ NULL
+};
+#define pci_ss_list_1106_0693 NULL
+#define pci_ss_list_1106_0698 NULL
+#define pci_ss_list_1106_0926 NULL
+#define pci_ss_list_1106_1000 NULL
+#define pci_ss_list_1106_1106 NULL
+#define pci_ss_list_1106_1571 NULL
+#define pci_ss_list_1106_1595 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_3038[] = {
+ &pci_ss_info_1106_3038_0925_1234,
+ &pci_ss_info_1106_3038_1179_0001,
+ NULL
+};
+#define pci_ss_list_1106_3040 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_3043[] = {
+ &pci_ss_info_1106_3043_10bd_0000,
+ &pci_ss_info_1106_3043_1106_0100,
+ &pci_ss_info_1106_3043_1186_1400,
+ NULL
+};
+#define pci_ss_list_1106_3044 NULL
+#define pci_ss_list_1106_3050 NULL
+#define pci_ss_list_1106_3051 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_3057[] = {
+ &pci_ss_info_1106_3057_1043_8033,
+ &pci_ss_info_1106_3057_1043_803e,
+ &pci_ss_info_1106_3057_1043_8040,
+ &pci_ss_info_1106_3057_1043_8042,
+ &pci_ss_info_1106_3057_1179_0001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1106_3058[] = {
+ &pci_ss_info_1106_3058_0e11_b194,
+ &pci_ss_info_1106_3058_1106_4511,
+ &pci_ss_info_1106_3058_1458_7600,
+ &pci_ss_info_1106_3058_1462_3091,
+ &pci_ss_info_1106_3058_15dd_7609,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1106_3059[] = {
+ &pci_ss_info_1106_3059_1458_a002,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1106_3065[] = {
+ &pci_ss_info_1106_3065_1106_0102,
+ &pci_ss_info_1106_3065_1186_1400,
+ &pci_ss_info_1106_3065_1186_1401,
+ NULL
+};
+#define pci_ss_list_1106_3068 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_3074[] = {
+ &pci_ss_info_1106_3074_1043_8052,
+ NULL
+};
+#define pci_ss_list_1106_3091 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_3099[] = {
+ &pci_ss_info_1106_3099_1043_8064,
+ &pci_ss_info_1106_3099_1043_807f,
+ NULL
+};
+#define pci_ss_list_1106_3101 NULL
+#define pci_ss_list_1106_3102 NULL
+#define pci_ss_list_1106_3103 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_3104[] = {
+ &pci_ss_info_1106_3104_1458_5004,
+ NULL
+};
+#define pci_ss_list_1106_3106 NULL
+#define pci_ss_list_1106_3109 NULL
+#define pci_ss_list_1106_3112 NULL
+#define pci_ss_list_1106_3116 NULL
+#define pci_ss_list_1106_3122 NULL
+#define pci_ss_list_1106_3123 NULL
+#define pci_ss_list_1106_3128 NULL
+#define pci_ss_list_1106_3133 NULL
+#define pci_ss_list_1106_3147 NULL
+#define pci_ss_list_1106_3148 NULL
+#define pci_ss_list_1106_3156 NULL
+#define pci_ss_list_1106_3168 NULL
+static const pciSubsystemInfo *pci_ss_list_1106_3177[] = {
+ &pci_ss_info_1106_3177_1458_5001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1106_3189[] = {
+ &pci_ss_info_1106_3189_1458_5000,
+ NULL
+};
+#define pci_ss_list_1106_5030 NULL
+#define pci_ss_list_1106_6100 NULL
+#define pci_ss_list_1106_8231 NULL
+#define pci_ss_list_1106_8235 NULL
+#define pci_ss_list_1106_8305 NULL
+#define pci_ss_list_1106_8391 NULL
+#define pci_ss_list_1106_8501 NULL
+#define pci_ss_list_1106_8596 NULL
+#define pci_ss_list_1106_8597 NULL
+#define pci_ss_list_1106_8598 NULL
+#define pci_ss_list_1106_8601 NULL
+#define pci_ss_list_1106_8605 NULL
+#define pci_ss_list_1106_8691 NULL
+#define pci_ss_list_1106_8693 NULL
+#define pci_ss_list_1106_b091 NULL
+#define pci_ss_list_1106_b099 NULL
+#define pci_ss_list_1106_b101 NULL
+#define pci_ss_list_1106_b102 NULL
+#define pci_ss_list_1106_b103 NULL
+#define pci_ss_list_1106_b112 NULL
+#define pci_ss_list_1106_b168 NULL
+#define pci_ss_list_1107_0576 NULL
+#define pci_ss_list_1108_0100 NULL
+#define pci_ss_list_1108_0101 NULL
+#define pci_ss_list_1108_0105 NULL
+#define pci_ss_list_1108_0108 NULL
+#define pci_ss_list_1108_0138 NULL
+#define pci_ss_list_1108_0139 NULL
+#define pci_ss_list_1108_013c NULL
+#define pci_ss_list_1108_013d NULL
+#define pci_ss_list_1109_1400 NULL
+#define pci_ss_list_110a_0002 NULL
+#define pci_ss_list_110a_0005 NULL
+#define pci_ss_list_110a_2102 NULL
+#define pci_ss_list_110a_4942 NULL
+#define pci_ss_list_110a_6120 NULL
+#define pci_ss_list_110b_0001 NULL
+#define pci_ss_list_110b_0004 NULL
+#define pci_ss_list_1110_6037 NULL
+#define pci_ss_list_1110_6073 NULL
+#define pci_ss_list_1112_2200 NULL
+#define pci_ss_list_1112_2300 NULL
+#define pci_ss_list_1112_2340 NULL
+#define pci_ss_list_1112_2400 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1113_1211[] = {
+ &pci_ss_info_1113_1211_103c_1207,
+ &pci_ss_info_1113_1211_1113_1211,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1113_1216[] = {
+ &pci_ss_info_1113_1216_111a_1020,
+ NULL
+};
+#define pci_ss_list_1113_1217 NULL
+#define pci_ss_list_1113_5105 NULL
+static const pciSubsystemInfo *pci_ss_list_1113_9211[] = {
+ &pci_ss_info_1113_9211_1113_9211,
+ NULL
+};
+#define pci_ss_list_1113_9511 NULL
+#endif
+#define pci_ss_list_1116_0022 NULL
+#define pci_ss_list_1116_0023 NULL
+#define pci_ss_list_1116_0024 NULL
+#define pci_ss_list_1116_0025 NULL
+#define pci_ss_list_1116_0026 NULL
+#define pci_ss_list_1116_0027 NULL
+#define pci_ss_list_1116_0028 NULL
+#define pci_ss_list_1117_9500 NULL
+#define pci_ss_list_1117_9501 NULL
+#define pci_ss_list_1119_0000 NULL
+#define pci_ss_list_1119_0001 NULL
+#define pci_ss_list_1119_0002 NULL
+#define pci_ss_list_1119_0003 NULL
+#define pci_ss_list_1119_0004 NULL
+#define pci_ss_list_1119_0005 NULL
+#define pci_ss_list_1119_0006 NULL
+#define pci_ss_list_1119_0007 NULL
+#define pci_ss_list_1119_0008 NULL
+#define pci_ss_list_1119_0009 NULL
+#define pci_ss_list_1119_000a NULL
+#define pci_ss_list_1119_000b NULL
+#define pci_ss_list_1119_000c NULL
+#define pci_ss_list_1119_000d NULL
+#define pci_ss_list_1119_0100 NULL
+#define pci_ss_list_1119_0101 NULL
+#define pci_ss_list_1119_0102 NULL
+#define pci_ss_list_1119_0103 NULL
+#define pci_ss_list_1119_0104 NULL
+#define pci_ss_list_1119_0105 NULL
+#define pci_ss_list_1119_0110 NULL
+#define pci_ss_list_1119_0111 NULL
+#define pci_ss_list_1119_0112 NULL
+#define pci_ss_list_1119_0113 NULL
+#define pci_ss_list_1119_0114 NULL
+#define pci_ss_list_1119_0115 NULL
+#define pci_ss_list_1119_0118 NULL
+#define pci_ss_list_1119_0119 NULL
+#define pci_ss_list_1119_011a NULL
+#define pci_ss_list_1119_011b NULL
+#define pci_ss_list_1119_0120 NULL
+#define pci_ss_list_1119_0121 NULL
+#define pci_ss_list_1119_0122 NULL
+#define pci_ss_list_1119_0123 NULL
+#define pci_ss_list_1119_0124 NULL
+#define pci_ss_list_1119_0125 NULL
+#define pci_ss_list_1119_0136 NULL
+#define pci_ss_list_1119_0137 NULL
+#define pci_ss_list_1119_0138 NULL
+#define pci_ss_list_1119_0139 NULL
+#define pci_ss_list_1119_013a NULL
+#define pci_ss_list_1119_013b NULL
+#define pci_ss_list_1119_013c NULL
+#define pci_ss_list_1119_013d NULL
+#define pci_ss_list_1119_013e NULL
+#define pci_ss_list_1119_013f NULL
+#define pci_ss_list_1119_0166 NULL
+#define pci_ss_list_1119_0167 NULL
+#define pci_ss_list_1119_0168 NULL
+#define pci_ss_list_1119_0169 NULL
+#define pci_ss_list_1119_016a NULL
+#define pci_ss_list_1119_016b NULL
+#define pci_ss_list_1119_016c NULL
+#define pci_ss_list_1119_016d NULL
+#define pci_ss_list_1119_016e NULL
+#define pci_ss_list_1119_016f NULL
+#define pci_ss_list_1119_01d6 NULL
+#define pci_ss_list_1119_01d7 NULL
+#define pci_ss_list_1119_01f6 NULL
+#define pci_ss_list_1119_01f7 NULL
+#define pci_ss_list_1119_01fc NULL
+#define pci_ss_list_1119_01fd NULL
+#define pci_ss_list_1119_01fe NULL
+#define pci_ss_list_1119_01ff NULL
+#define pci_ss_list_1119_0210 NULL
+#define pci_ss_list_1119_0211 NULL
+#define pci_ss_list_1119_0260 NULL
+#define pci_ss_list_1119_0261 NULL
+#define pci_ss_list_1119_0300 NULL
+#define pci_ss_list_111a_0000 NULL
+#define pci_ss_list_111a_0002 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_111a_0003[] = {
+ &pci_ss_info_111a_0003_111a_0000,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_111a_0005[] = {
+ &pci_ss_info_111a_0005_111a_0001,
+ &pci_ss_info_111a_0005_111a_0009,
+ &pci_ss_info_111a_0005_111a_0101,
+ &pci_ss_info_111a_0005_111a_0109,
+ &pci_ss_info_111a_0005_111a_0809,
+ &pci_ss_info_111a_0005_111a_0909,
+ &pci_ss_info_111a_0005_111a_0a09,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_111a_0007[] = {
+ &pci_ss_info_111a_0007_111a_1001,
+ NULL
+};
+#endif
+#define pci_ss_list_111c_0001 NULL
+#define pci_ss_list_111d_0001 NULL
+#define pci_ss_list_111d_0003 NULL
+#define pci_ss_list_111f_4a47 NULL
+#define pci_ss_list_111f_5243 NULL
+#define pci_ss_list_1127_0200 NULL
+#define pci_ss_list_1127_0210 NULL
+#define pci_ss_list_1127_0250 NULL
+#define pci_ss_list_1127_0300 NULL
+#define pci_ss_list_1127_0310 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1127_0400[] = {
+ &pci_ss_info_1127_0400_1127_0400,
+ NULL
+};
+#endif
+#define pci_ss_list_112f_0000 NULL
+#define pci_ss_list_112f_0001 NULL
+#define pci_ss_list_1131_1561 NULL
+#define pci_ss_list_1131_1562 NULL
+#define pci_ss_list_1131_3400 NULL
+#define pci_ss_list_1131_7130 NULL
+#define pci_ss_list_1131_7133 NULL
+#define pci_ss_list_1131_7134 NULL
+#define pci_ss_list_1131_7135 NULL
+#define pci_ss_list_1131_7145 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1131_7146[] = {
+ &pci_ss_info_1131_7146_114b_2003,
+ &pci_ss_info_1131_7146_11bd_0006,
+ &pci_ss_info_1131_7146_11bd_000a,
+ NULL
+};
+#endif
+#define pci_ss_list_1133_7901 NULL
+#define pci_ss_list_1133_7902 NULL
+#define pci_ss_list_1133_7911 NULL
+#define pci_ss_list_1133_7912 NULL
+#define pci_ss_list_1133_7941 NULL
+#define pci_ss_list_1133_7942 NULL
+#define pci_ss_list_1133_7943 NULL
+#define pci_ss_list_1133_7944 NULL
+#define pci_ss_list_1133_b921 NULL
+#define pci_ss_list_1133_b922 NULL
+#define pci_ss_list_1133_b923 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1133_e001[] = {
+ &pci_ss_info_1133_e001_1133_e001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1133_e002[] = {
+ &pci_ss_info_1133_e002_1133_e002,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1133_e003[] = {
+ &pci_ss_info_1133_e003_1133_e003,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1133_e004[] = {
+ &pci_ss_info_1133_e004_1133_e004,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1133_e005[] = {
+ &pci_ss_info_1133_e005_1133_e005,
+ NULL
+};
+#define pci_ss_list_1133_e00b NULL
+static const pciSubsystemInfo *pci_ss_list_1133_e010[] = {
+ &pci_ss_info_1133_e010_1133_e010,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1133_e012[] = {
+ &pci_ss_info_1133_e012_1133_e012,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1133_e014[] = {
+ &pci_ss_info_1133_e014_1133_e014,
+ NULL
+};
+#define pci_ss_list_1133_e018 NULL
+#endif
+#define pci_ss_list_1134_0001 NULL
+#define pci_ss_list_1135_0001 NULL
+#define pci_ss_list_1138_8905 NULL
+#define pci_ss_list_1139_0001 NULL
+#define pci_ss_list_113c_0000 NULL
+#define pci_ss_list_113c_0001 NULL
+#define pci_ss_list_113c_0911 NULL
+#define pci_ss_list_113c_0912 NULL
+#define pci_ss_list_113c_0913 NULL
+#define pci_ss_list_113c_0914 NULL
+#define pci_ss_list_113f_0808 NULL
+#define pci_ss_list_113f_1010 NULL
+#define pci_ss_list_113f_80c0 NULL
+#define pci_ss_list_113f_80c4 NULL
+#define pci_ss_list_113f_80c8 NULL
+#define pci_ss_list_113f_8888 NULL
+#define pci_ss_list_113f_9090 NULL
+#define pci_ss_list_1142_3210 NULL
+#define pci_ss_list_1142_6422 NULL
+#define pci_ss_list_1142_6424 NULL
+#define pci_ss_list_1142_6425 NULL
+#define pci_ss_list_1142_643d NULL
+#define pci_ss_list_1144_0001 NULL
+#define pci_ss_list_1145_8007 NULL
+#define pci_ss_list_1145_f007 NULL
+#define pci_ss_list_1145_f010 NULL
+#define pci_ss_list_1145_f012 NULL
+#define pci_ss_list_1145_f013 NULL
+#define pci_ss_list_1145_f015 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1148_4000[] = {
+ &pci_ss_info_1148_4000_0e11_b03b,
+ &pci_ss_info_1148_4000_0e11_b03c,
+ &pci_ss_info_1148_4000_0e11_b03d,
+ &pci_ss_info_1148_4000_0e11_b03e,
+ &pci_ss_info_1148_4000_0e11_b03f,
+ &pci_ss_info_1148_4000_1148_5521,
+ &pci_ss_info_1148_4000_1148_5522,
+ &pci_ss_info_1148_4000_1148_5541,
+ &pci_ss_info_1148_4000_1148_5543,
+ &pci_ss_info_1148_4000_1148_5544,
+ &pci_ss_info_1148_4000_1148_5821,
+ &pci_ss_info_1148_4000_1148_5822,
+ &pci_ss_info_1148_4000_1148_5841,
+ &pci_ss_info_1148_4000_1148_5843,
+ &pci_ss_info_1148_4000_1148_5844,
+ NULL
+};
+#define pci_ss_list_1148_4200 NULL
+static const pciSubsystemInfo *pci_ss_list_1148_4300[] = {
+ &pci_ss_info_1148_4300_1148_9821,
+ &pci_ss_info_1148_4300_1148_9822,
+ &pci_ss_info_1148_4300_1148_9841,
+ &pci_ss_info_1148_4300_1148_9842,
+ &pci_ss_info_1148_4300_1148_9843,
+ &pci_ss_info_1148_4300_1148_9844,
+ &pci_ss_info_1148_4300_1148_9861,
+ &pci_ss_info_1148_4300_1148_9862,
+ &pci_ss_info_1148_4300_1148_9871,
+ &pci_ss_info_1148_4300_1148_9872,
+ &pci_ss_info_1148_4300_1259_2970,
+ &pci_ss_info_1148_4300_1259_2972,
+ &pci_ss_info_1148_4300_1259_2975,
+ &pci_ss_info_1148_4300_1259_2977,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1148_4320[] = {
+ &pci_ss_info_1148_4320_1148_5021,
+ &pci_ss_info_1148_4320_1148_5041,
+ &pci_ss_info_1148_4320_1148_5043,
+ &pci_ss_info_1148_4320_1148_5051,
+ &pci_ss_info_1148_4320_1148_5061,
+ &pci_ss_info_1148_4320_1148_5071,
+ &pci_ss_info_1148_4320_1148_9521,
+ NULL
+};
+#define pci_ss_list_1148_4400 NULL
+#endif
+#define pci_ss_list_114a_5579 NULL
+#define pci_ss_list_114a_5587 NULL
+#define pci_ss_list_114a_6504 NULL
+#define pci_ss_list_114a_7587 NULL
+#define pci_ss_list_114f_0002 NULL
+#define pci_ss_list_114f_0003 NULL
+#define pci_ss_list_114f_0004 NULL
+#define pci_ss_list_114f_0005 NULL
+#define pci_ss_list_114f_0006 NULL
+#define pci_ss_list_114f_0009 NULL
+#define pci_ss_list_114f_000a NULL
+#define pci_ss_list_114f_000c NULL
+#define pci_ss_list_114f_000d NULL
+#define pci_ss_list_114f_0011 NULL
+#define pci_ss_list_114f_0012 NULL
+#define pci_ss_list_114f_0013 NULL
+#define pci_ss_list_114f_0014 NULL
+#define pci_ss_list_114f_0015 NULL
+#define pci_ss_list_114f_0016 NULL
+#define pci_ss_list_114f_0017 NULL
+#define pci_ss_list_114f_001a NULL
+#define pci_ss_list_114f_001b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_114f_001d[] = {
+ &pci_ss_info_114f_001d_114f_0050,
+ &pci_ss_info_114f_001d_114f_0051,
+ &pci_ss_info_114f_001d_114f_0052,
+ &pci_ss_info_114f_001d_114f_0053,
+ NULL
+};
+#define pci_ss_list_114f_0023 NULL
+static const pciSubsystemInfo *pci_ss_list_114f_0024[] = {
+ &pci_ss_info_114f_0024_114f_0030,
+ &pci_ss_info_114f_0024_114f_0031,
+ NULL
+};
+#define pci_ss_list_114f_0026 NULL
+#define pci_ss_list_114f_0027 NULL
+#define pci_ss_list_114f_0034 NULL
+#define pci_ss_list_114f_0035 NULL
+#define pci_ss_list_114f_0040 NULL
+#define pci_ss_list_114f_0042 NULL
+#define pci_ss_list_114f_0070 NULL
+#define pci_ss_list_114f_0071 NULL
+#define pci_ss_list_114f_0072 NULL
+#define pci_ss_list_114f_0073 NULL
+#define pci_ss_list_114f_6001 NULL
+#endif
+#define pci_ss_list_1158_3011 NULL
+#define pci_ss_list_1158_9050 NULL
+#define pci_ss_list_1158_9051 NULL
+#define pci_ss_list_1159_0001 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_115d_0003[] = {
+ &pci_ss_info_115d_0003_1014_0181,
+ &pci_ss_info_115d_0003_1014_1181,
+ &pci_ss_info_115d_0003_1014_8181,
+ &pci_ss_info_115d_0003_1014_9181,
+ &pci_ss_info_115d_0003_115d_0181,
+ &pci_ss_info_115d_0003_115d_1181,
+ &pci_ss_info_115d_0003_1179_0181,
+ &pci_ss_info_115d_0003_8086_8181,
+ &pci_ss_info_115d_0003_8086_9181,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_115d_0005[] = {
+ &pci_ss_info_115d_0005_1014_0182,
+ &pci_ss_info_115d_0005_1014_1182,
+ &pci_ss_info_115d_0005_115d_0182,
+ &pci_ss_info_115d_0005_115d_1182,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_115d_0007[] = {
+ &pci_ss_info_115d_0007_1014_0182,
+ &pci_ss_info_115d_0007_1014_1182,
+ &pci_ss_info_115d_0007_115d_0182,
+ &pci_ss_info_115d_0007_115d_1182,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_115d_000b[] = {
+ &pci_ss_info_115d_000b_1014_0183,
+ &pci_ss_info_115d_000b_115d_0183,
+ NULL
+};
+#define pci_ss_list_115d_000c NULL
+static const pciSubsystemInfo *pci_ss_list_115d_000f[] = {
+ &pci_ss_info_115d_000f_1014_0183,
+ &pci_ss_info_115d_000f_115d_0183,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_115d_0101[] = {
+ &pci_ss_info_115d_0101_115d_1081,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_115d_0103[] = {
+ &pci_ss_info_115d_0103_1014_9181,
+ &pci_ss_info_115d_0103_1115_1181,
+ &pci_ss_info_115d_0103_115d_1181,
+ &pci_ss_info_115d_0103_8086_9181,
+ NULL
+};
+#endif
+#define pci_ss_list_1163_0001 NULL
+static const pciSubsystemInfo *pci_ss_list_1163_2000[] = {
+ &pci_ss_info_1163_2000_1092_2000,
+ NULL
+};
+#define pci_ss_list_1165_0001 NULL
+#define pci_ss_list_1166_0005 NULL
+#define pci_ss_list_1166_0007 NULL
+#define pci_ss_list_1166_0008 NULL
+#define pci_ss_list_1166_0009 NULL
+#define pci_ss_list_1166_0010 NULL
+#define pci_ss_list_1166_0011 NULL
+#define pci_ss_list_1166_0012 NULL
+#define pci_ss_list_1166_0013 NULL
+#define pci_ss_list_1166_0014 NULL
+#define pci_ss_list_1166_0015 NULL
+#define pci_ss_list_1166_0016 NULL
+#define pci_ss_list_1166_0017 NULL
+#define pci_ss_list_1166_0200 NULL
+#define pci_ss_list_1166_0201 NULL
+#define pci_ss_list_1166_0203 NULL
+#define pci_ss_list_1166_0211 NULL
+#define pci_ss_list_1166_0212 NULL
+#define pci_ss_list_1166_0213 NULL
+#define pci_ss_list_1166_0220 NULL
+#define pci_ss_list_1166_0221 NULL
+#define pci_ss_list_1166_0225 NULL
+#define pci_ss_list_1166_0227 NULL
+#define pci_ss_list_116a_6100 NULL
+#define pci_ss_list_116a_6800 NULL
+#define pci_ss_list_116a_7100 NULL
+#define pci_ss_list_116a_7800 NULL
+#define pci_ss_list_1178_afa1 NULL
+#define pci_ss_list_1179_0103 NULL
+#define pci_ss_list_1179_0404 NULL
+#define pci_ss_list_1179_0406 NULL
+#define pci_ss_list_1179_0407 NULL
+#define pci_ss_list_1179_0601 NULL
+#define pci_ss_list_1179_0603 NULL
+#define pci_ss_list_1179_060a NULL
+#define pci_ss_list_1179_060f NULL
+#define pci_ss_list_1179_0617 NULL
+#define pci_ss_list_1179_0618 NULL
+#define pci_ss_list_1179_0701 NULL
+#define pci_ss_list_1179_0804 NULL
+#define pci_ss_list_1179_0805 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1179_0d01[] = {
+ &pci_ss_info_1179_0d01_1179_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_1180_0465 NULL
+#define pci_ss_list_1180_0466 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1180_0475[] = {
+ &pci_ss_info_1180_0475_144d_c006,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1180_0476[] = {
+ &pci_ss_info_1180_0476_1014_0185,
+ &pci_ss_info_1180_0476_104d_80df,
+ &pci_ss_info_1180_0476_104d_80e7,
+ NULL
+};
+#define pci_ss_list_1180_0477 NULL
+static const pciSubsystemInfo *pci_ss_list_1180_0478[] = {
+ &pci_ss_info_1180_0478_1014_0184,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1180_0522[] = {
+ &pci_ss_info_1180_0522_1014_01cf,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1180_0551[] = {
+ &pci_ss_info_1180_0551_144d_c006,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1180_0552[] = {
+ &pci_ss_info_1180_0552_1014_0511,
+ NULL
+};
+#endif
+#define pci_ss_list_1186_0100 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1186_1002[] = {
+ &pci_ss_info_1186_1002_1186_1002,
+ &pci_ss_info_1186_1002_1186_1012,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1186_1300[] = {
+ &pci_ss_info_1186_1300_1186_1300,
+ &pci_ss_info_1186_1300_1186_1301,
+ NULL
+};
+#define pci_ss_list_1186_1340 NULL
+#define pci_ss_list_1186_1561 NULL
+#define pci_ss_list_1186_4000 NULL
+#endif
+#define pci_ss_list_118c_0014 NULL
+#define pci_ss_list_118c_1117 NULL
+#define pci_ss_list_118d_0001 NULL
+#define pci_ss_list_118d_0012 NULL
+#define pci_ss_list_118d_0014 NULL
+#define pci_ss_list_118d_0024 NULL
+#define pci_ss_list_118d_0044 NULL
+#define pci_ss_list_118d_0112 NULL
+#define pci_ss_list_118d_0114 NULL
+#define pci_ss_list_118d_0124 NULL
+#define pci_ss_list_118d_0144 NULL
+#define pci_ss_list_118d_0212 NULL
+#define pci_ss_list_118d_0214 NULL
+#define pci_ss_list_118d_0224 NULL
+#define pci_ss_list_118d_0244 NULL
+#define pci_ss_list_118d_0312 NULL
+#define pci_ss_list_118d_0314 NULL
+#define pci_ss_list_118d_0324 NULL
+#define pci_ss_list_118d_0344 NULL
+#define pci_ss_list_1190_c731 NULL
+#define pci_ss_list_1191_0003 NULL
+#define pci_ss_list_1191_0004 NULL
+#define pci_ss_list_1191_0005 NULL
+#define pci_ss_list_1191_0006 NULL
+#define pci_ss_list_1191_0007 NULL
+#define pci_ss_list_1191_0008 NULL
+#define pci_ss_list_1191_0009 NULL
+#define pci_ss_list_1191_8002 NULL
+#define pci_ss_list_1191_8010 NULL
+#define pci_ss_list_1191_8020 NULL
+#define pci_ss_list_1191_8030 NULL
+#define pci_ss_list_1191_8040 NULL
+#define pci_ss_list_1191_8050 NULL
+#define pci_ss_list_1193_0001 NULL
+#define pci_ss_list_1193_0002 NULL
+#define pci_ss_list_119b_1221 NULL
+#define pci_ss_list_119e_0001 NULL
+#define pci_ss_list_119e_0003 NULL
+#define pci_ss_list_11a9_4240 NULL
+#define pci_ss_list_11ab_0146 NULL
+#define pci_ss_list_11ab_4611 NULL
+#define pci_ss_list_11ab_4620 NULL
+#define pci_ss_list_11ab_4801 NULL
+#define pci_ss_list_11ab_f003 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11ad_0002[] = {
+ &pci_ss_info_11ad_0002_11ad_0002,
+ &pci_ss_info_11ad_0002_11ad_0003,
+ &pci_ss_info_11ad_0002_11ad_f003,
+ &pci_ss_info_11ad_0002_11ad_ffff,
+ &pci_ss_info_11ad_0002_1385_f004,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_11ad_c115[] = {
+ &pci_ss_info_11ad_c115_11ad_c001,
+ NULL
+};
+#endif
+#define pci_ss_list_11b0_0002 NULL
+#define pci_ss_list_11b0_0292 NULL
+#define pci_ss_list_11b0_0960 NULL
+#define pci_ss_list_11b0_c960 NULL
+#define pci_ss_list_11b8_0001 NULL
+#define pci_ss_list_11b9_c0ed NULL
+#define pci_ss_list_11bc_0001 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11c1_0440[] = {
+ &pci_ss_info_11c1_0440_1033_8015,
+ &pci_ss_info_11c1_0440_1033_8047,
+ &pci_ss_info_11c1_0440_1033_804f,
+ &pci_ss_info_11c1_0440_10cf_102c,
+ &pci_ss_info_11c1_0440_10cf_104a,
+ &pci_ss_info_11c1_0440_10cf_105f,
+ &pci_ss_info_11c1_0440_1179_0001,
+ &pci_ss_info_11c1_0440_11c1_0440,
+ &pci_ss_info_11c1_0440_122d_4101,
+ &pci_ss_info_11c1_0440_122d_4102,
+ &pci_ss_info_11c1_0440_13e0_0040,
+ &pci_ss_info_11c1_0440_13e0_0440,
+ &pci_ss_info_11c1_0440_13e0_0441,
+ &pci_ss_info_11c1_0440_13e0_0450,
+ &pci_ss_info_11c1_0440_13e0_f100,
+ &pci_ss_info_11c1_0440_13e0_f101,
+ &pci_ss_info_11c1_0440_144d_2101,
+ &pci_ss_info_11c1_0440_149f_0440,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_11c1_0441[] = {
+ &pci_ss_info_11c1_0441_1033_804d,
+ &pci_ss_info_11c1_0441_1033_8065,
+ &pci_ss_info_11c1_0441_1092_0440,
+ &pci_ss_info_11c1_0441_1179_0001,
+ &pci_ss_info_11c1_0441_11c1_0440,
+ &pci_ss_info_11c1_0441_11c1_0441,
+ &pci_ss_info_11c1_0441_122d_4100,
+ &pci_ss_info_11c1_0441_13e0_0040,
+ &pci_ss_info_11c1_0441_13e0_0100,
+ &pci_ss_info_11c1_0441_13e0_0410,
+ &pci_ss_info_11c1_0441_13e0_0420,
+ &pci_ss_info_11c1_0441_13e0_0440,
+ &pci_ss_info_11c1_0441_13e0_0443,
+ &pci_ss_info_11c1_0441_13e0_f102,
+ &pci_ss_info_11c1_0441_1416_9804,
+ &pci_ss_info_11c1_0441_141d_0440,
+ &pci_ss_info_11c1_0441_144f_0441,
+ &pci_ss_info_11c1_0441_144f_0449,
+ &pci_ss_info_11c1_0441_144f_110d,
+ &pci_ss_info_11c1_0441_1468_0441,
+ &pci_ss_info_11c1_0441_1668_0440,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_11c1_0442[] = {
+ &pci_ss_info_11c1_0442_11c1_0440,
+ &pci_ss_info_11c1_0442_11c1_0442,
+ &pci_ss_info_11c1_0442_13e0_0412,
+ &pci_ss_info_11c1_0442_13e0_0442,
+ &pci_ss_info_11c1_0442_13fc_2471,
+ &pci_ss_info_11c1_0442_144d_2104,
+ &pci_ss_info_11c1_0442_144f_1104,
+ &pci_ss_info_11c1_0442_149f_0440,
+ &pci_ss_info_11c1_0442_1668_0440,
+ NULL
+};
+#define pci_ss_list_11c1_0443 NULL
+#define pci_ss_list_11c1_0444 NULL
+#define pci_ss_list_11c1_0445 NULL
+#define pci_ss_list_11c1_0446 NULL
+#define pci_ss_list_11c1_0447 NULL
+static const pciSubsystemInfo *pci_ss_list_11c1_0448[] = {
+ &pci_ss_info_11c1_0448_1014_0131,
+ &pci_ss_info_11c1_0448_1033_8066,
+ &pci_ss_info_11c1_0448_13e0_0030,
+ &pci_ss_info_11c1_0448_13e0_0040,
+ &pci_ss_info_11c1_0448_1668_2400,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_11c1_0449[] = {
+ &pci_ss_info_11c1_0449_0e11_b14d,
+ &pci_ss_info_11c1_0449_13e0_0020,
+ &pci_ss_info_11c1_0449_13e0_0041,
+ &pci_ss_info_11c1_0449_1436_0440,
+ &pci_ss_info_11c1_0449_144f_0449,
+ &pci_ss_info_11c1_0449_1468_0410,
+ &pci_ss_info_11c1_0449_1468_0440,
+ &pci_ss_info_11c1_0449_1468_0449,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_11c1_044a[] = {
+ &pci_ss_info_11c1_044a_10cf_1072,
+ &pci_ss_info_11c1_044a_13e0_0012,
+ &pci_ss_info_11c1_044a_13e0_0042,
+ &pci_ss_info_11c1_044a_144f_1005,
+ NULL
+};
+#define pci_ss_list_11c1_044b NULL
+#define pci_ss_list_11c1_044c NULL
+#define pci_ss_list_11c1_044d NULL
+#define pci_ss_list_11c1_044e NULL
+#define pci_ss_list_11c1_044f NULL
+static const pciSubsystemInfo *pci_ss_list_11c1_0450[] = {
+ &pci_ss_info_11c1_0450_144f_4005,
+ NULL
+};
+#define pci_ss_list_11c1_0451 NULL
+#define pci_ss_list_11c1_0452 NULL
+#define pci_ss_list_11c1_0453 NULL
+#define pci_ss_list_11c1_0454 NULL
+#define pci_ss_list_11c1_0455 NULL
+#define pci_ss_list_11c1_0456 NULL
+#define pci_ss_list_11c1_0457 NULL
+#define pci_ss_list_11c1_0458 NULL
+#define pci_ss_list_11c1_0459 NULL
+#define pci_ss_list_11c1_045a NULL
+#define pci_ss_list_11c1_045c NULL
+#define pci_ss_list_11c1_0461 NULL
+#define pci_ss_list_11c1_0462 NULL
+#define pci_ss_list_11c1_0480 NULL
+#define pci_ss_list_11c1_5801 NULL
+#define pci_ss_list_11c1_5802 NULL
+#define pci_ss_list_11c1_5803 NULL
+static const pciSubsystemInfo *pci_ss_list_11c1_5811[] = {
+ &pci_ss_info_11c1_5811_dead_0800,
+ NULL
+};
+#endif
+#define pci_ss_list_11c8_0658 NULL
+#define pci_ss_list_11c8_d665 NULL
+#define pci_ss_list_11c8_d667 NULL
+#define pci_ss_list_11c9_0010 NULL
+#define pci_ss_list_11c9_0011 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11cb_2000[] = {
+ &pci_ss_info_11cb_2000_11cb_0200,
+ &pci_ss_info_11cb_2000_11cb_b008,
+ NULL
+};
+#define pci_ss_list_11cb_4000 NULL
+#define pci_ss_list_11cb_8000 NULL
+#endif
+#define pci_ss_list_11d1_01f7 NULL
+#define pci_ss_list_11d4_1805 NULL
+#define pci_ss_list_11d4_1889 NULL
+#define pci_ss_list_11d5_0115 NULL
+#define pci_ss_list_11d5_0117 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11de_6057[] = {
+ &pci_ss_info_11de_6057_1031_7efe,
+ &pci_ss_info_11de_6057_1031_fc00,
+ &pci_ss_info_11de_6057_13ca_4231,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_11de_6120[] = {
+ &pci_ss_info_11de_6120_1328_f001,
+ NULL
+};
+#endif
+#define pci_ss_list_11e3_5030 NULL
+#define pci_ss_list_11f0_4231 NULL
+#define pci_ss_list_11f0_4232 NULL
+#define pci_ss_list_11f0_4233 NULL
+#define pci_ss_list_11f0_4234 NULL
+#define pci_ss_list_11f0_4235 NULL
+#define pci_ss_list_11f0_4236 NULL
+#define pci_ss_list_11f0_4731 NULL
+#define pci_ss_list_11f4_2915 NULL
+#define pci_ss_list_11f6_0112 NULL
+#define pci_ss_list_11f6_0113 NULL
+#define pci_ss_list_11f6_1401 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11f6_2011[] = {
+ &pci_ss_info_11f6_2011_11f6_2011,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_11f6_2201[] = {
+ &pci_ss_info_11f6_2201_11f6_2011,
+ NULL
+};
+#define pci_ss_list_11f6_9881 NULL
+#endif
+#define pci_ss_list_11f8_7375 NULL
+#define pci_ss_list_11fe_0001 NULL
+#define pci_ss_list_11fe_0002 NULL
+#define pci_ss_list_11fe_0003 NULL
+#define pci_ss_list_11fe_0004 NULL
+#define pci_ss_list_11fe_0005 NULL
+#define pci_ss_list_11fe_0006 NULL
+#define pci_ss_list_11fe_0007 NULL
+#define pci_ss_list_11fe_0008 NULL
+#define pci_ss_list_11fe_0009 NULL
+#define pci_ss_list_11fe_000a NULL
+#define pci_ss_list_11fe_000b NULL
+#define pci_ss_list_11fe_000c NULL
+#define pci_ss_list_11fe_8015 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1202_4300[] = {
+ &pci_ss_info_1202_4300_1202_9841,
+ &pci_ss_info_1202_4300_1202_9842,
+ &pci_ss_info_1202_4300_1202_9843,
+ &pci_ss_info_1202_4300_1202_9844,
+ NULL
+};
+#endif
+#define pci_ss_list_1208_4853 NULL
+#define pci_ss_list_120e_0100 NULL
+#define pci_ss_list_120e_0101 NULL
+#define pci_ss_list_120e_0102 NULL
+#define pci_ss_list_120e_0103 NULL
+#define pci_ss_list_120e_0104 NULL
+#define pci_ss_list_120e_0105 NULL
+#define pci_ss_list_120e_0200 NULL
+#define pci_ss_list_120e_0201 NULL
+#define pci_ss_list_120e_0300 NULL
+#define pci_ss_list_120e_0301 NULL
+#define pci_ss_list_120e_0310 NULL
+#define pci_ss_list_120e_0311 NULL
+#define pci_ss_list_120e_0320 NULL
+#define pci_ss_list_120e_0321 NULL
+#define pci_ss_list_120e_0400 NULL
+#define pci_ss_list_120f_0001 NULL
+#define pci_ss_list_1217_6729 NULL
+#define pci_ss_list_1217_673a NULL
+#define pci_ss_list_1217_6832 NULL
+#define pci_ss_list_1217_6836 NULL
+#define pci_ss_list_1217_6872 NULL
+#define pci_ss_list_1217_6925 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1217_6933[] = {
+ &pci_ss_info_1217_6933_1025_1016,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1217_6972[] = {
+ &pci_ss_info_1217_6972_1179_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_121a_0001 NULL
+#define pci_ss_list_121a_0002 NULL
+static const pciSubsystemInfo *pci_ss_list_121a_0003[] = {
+ &pci_ss_info_121a_0003_1092_0003,
+ &pci_ss_info_121a_0003_1092_4000,
+ &pci_ss_info_121a_0003_1092_4002,
+ &pci_ss_info_121a_0003_1092_4801,
+ &pci_ss_info_121a_0003_1092_4803,
+ &pci_ss_info_121a_0003_1092_8030,
+ &pci_ss_info_121a_0003_1092_8035,
+ &pci_ss_info_121a_0003_10b0_0001,
+ &pci_ss_info_121a_0003_1102_1018,
+ &pci_ss_info_121a_0003_121a_0001,
+ &pci_ss_info_121a_0003_121a_0003,
+ &pci_ss_info_121a_0003_121a_0004,
+ &pci_ss_info_121a_0003_139c_0016,
+ &pci_ss_info_121a_0003_139c_0017,
+ &pci_ss_info_121a_0003_14af_0002,
+ NULL
+};
+#define pci_ss_list_121a_0004 NULL
+static const pciSubsystemInfo *pci_ss_list_121a_0005[] = {
+ &pci_ss_info_121a_0005_121a_0004,
+ &pci_ss_info_121a_0005_121a_0030,
+ &pci_ss_info_121a_0005_121a_0031,
+ &pci_ss_info_121a_0005_121a_0034,
+ &pci_ss_info_121a_0005_121a_0036,
+ &pci_ss_info_121a_0005_121a_0037,
+ &pci_ss_info_121a_0005_121a_0038,
+ &pci_ss_info_121a_0005_121a_003a,
+ &pci_ss_info_121a_0005_121a_0044,
+ &pci_ss_info_121a_0005_121a_004b,
+ &pci_ss_info_121a_0005_121a_004c,
+ &pci_ss_info_121a_0005_121a_004d,
+ &pci_ss_info_121a_0005_121a_004e,
+ &pci_ss_info_121a_0005_121a_0051,
+ &pci_ss_info_121a_0005_121a_0052,
+ &pci_ss_info_121a_0005_121a_0060,
+ &pci_ss_info_121a_0005_121a_0061,
+ &pci_ss_info_121a_0005_121a_0062,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_121a_0009[] = {
+ &pci_ss_info_121a_0009_121a_0009,
+ NULL
+};
+#define pci_ss_list_121a_0057 NULL
+#define pci_ss_list_1220_1220 NULL
+#define pci_ss_list_1223_0003 NULL
+#define pci_ss_list_1223_0004 NULL
+#define pci_ss_list_1223_0005 NULL
+#define pci_ss_list_1223_0008 NULL
+#define pci_ss_list_1223_0009 NULL
+#define pci_ss_list_1223_000a NULL
+#define pci_ss_list_1223_000b NULL
+#define pci_ss_list_1223_000c NULL
+#define pci_ss_list_1223_000d NULL
+#define pci_ss_list_1223_000e NULL
+#define pci_ss_list_122d_1206 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_122d_50dc[] = {
+ &pci_ss_info_122d_50dc_122d_0001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_122d_80da[] = {
+ &pci_ss_info_122d_80da_122d_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_1236_0000 NULL
+#define pci_ss_list_1236_6401 NULL
+#define pci_ss_list_123d_0000 NULL
+#define pci_ss_list_123d_0002 NULL
+#define pci_ss_list_123d_0003 NULL
+#define pci_ss_list_123f_00e4 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_123f_8120[] = {
+ &pci_ss_info_123f_8120_11bd_0006,
+ &pci_ss_info_123f_8120_11bd_000a,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_123f_8888[] = {
+ &pci_ss_info_123f_8888_1002_0001,
+ &pci_ss_info_123f_8888_1002_0002,
+ &pci_ss_info_123f_8888_1328_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1242_1560[] = {
+ &pci_ss_info_1242_1560_1242_6562,
+ &pci_ss_info_1242_1560_1242_656a,
+ NULL
+};
+#define pci_ss_list_1242_4643 NULL
+#endif
+#define pci_ss_list_1244_0700 NULL
+#define pci_ss_list_1244_0800 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1244_0a00[] = {
+ &pci_ss_info_1244_0a00_1244_0a00,
+ NULL
+};
+#define pci_ss_list_1244_0e00 NULL
+#define pci_ss_list_1244_1100 NULL
+#define pci_ss_list_1244_1200 NULL
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_124b_0040[] = {
+ &pci_ss_info_124b_0040_124b_9080,
+ NULL
+};
+#endif
+#define pci_ss_list_124d_0000 NULL
+#define pci_ss_list_124d_0002 NULL
+#define pci_ss_list_124d_0003 NULL
+#define pci_ss_list_124d_0004 NULL
+#define pci_ss_list_124f_0041 NULL
+#define pci_ss_list_1255_1110 NULL
+#define pci_ss_list_1255_1210 NULL
+#define pci_ss_list_1255_2110 NULL
+#define pci_ss_list_1255_2120 NULL
+#define pci_ss_list_1255_2130 NULL
+#define pci_ss_list_1256_4201 NULL
+#define pci_ss_list_1256_4401 NULL
+#define pci_ss_list_1256_5201 NULL
+#define pci_ss_list_1259_2560 NULL
+#define pci_ss_list_125b_1400 NULL
+#define pci_ss_list_125c_0640 NULL
+#define pci_ss_list_125d_0000 NULL
+#define pci_ss_list_125d_1948 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_125d_1968[] = {
+ &pci_ss_info_125d_1968_1028_0085,
+ &pci_ss_info_125d_1968_1033_8051,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_125d_1969[] = {
+ &pci_ss_info_125d_1969_1014_0166,
+ &pci_ss_info_125d_1969_125d_8888,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_125d_1978[] = {
+ &pci_ss_info_125d_1978_0e11_b112,
+ &pci_ss_info_125d_1978_1033_803c,
+ &pci_ss_info_125d_1978_1033_8058,
+ &pci_ss_info_125d_1978_1092_4000,
+ &pci_ss_info_125d_1978_1179_0001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_125d_1988[] = {
+ &pci_ss_info_125d_1988_1092_4100,
+ &pci_ss_info_125d_1988_125d_1988,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_125d_1989[] = {
+ &pci_ss_info_125d_1989_125d_1989,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_125d_1998[] = {
+ &pci_ss_info_125d_1998_1028_00e6,
+ NULL
+};
+#define pci_ss_list_125d_1999 NULL
+#define pci_ss_list_125d_199a NULL
+#define pci_ss_list_125d_199b NULL
+#define pci_ss_list_125d_2808 NULL
+#define pci_ss_list_125d_2838 NULL
+static const pciSubsystemInfo *pci_ss_list_125d_2898[] = {
+ &pci_ss_info_125d_2898_125d_0424,
+ &pci_ss_info_125d_2898_125d_0425,
+ &pci_ss_info_125d_2898_125d_0426,
+ &pci_ss_info_125d_2898_125d_0427,
+ &pci_ss_info_125d_2898_125d_0428,
+ &pci_ss_info_125d_2898_125d_0429,
+ &pci_ss_info_125d_2898_147a_c001,
+ &pci_ss_info_125d_2898_14fe_0428,
+ &pci_ss_info_125d_2898_14fe_0429,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1260_3873[] = {
+ &pci_ss_info_1260_3873_1186_3501,
+ &pci_ss_info_1260_3873_1668_0414,
+ &pci_ss_info_1260_3873_1737_3874,
+ &pci_ss_info_1260_3873_8086_2513,
+ NULL
+};
+#define pci_ss_list_1260_8130 NULL
+#define pci_ss_list_1260_8131 NULL
+#endif
+#define pci_ss_list_1266_0001 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1266_1910[] = {
+ &pci_ss_info_1266_1910_1266_1910,
+ NULL
+};
+#endif
+#define pci_ss_list_1267_5352 NULL
+#define pci_ss_list_1267_5a4b NULL
+#define pci_ss_list_126f_0710 NULL
+#define pci_ss_list_126f_0712 NULL
+#define pci_ss_list_126f_0720 NULL
+#define pci_ss_list_126f_0810 NULL
+#define pci_ss_list_126f_0811 NULL
+#define pci_ss_list_126f_0820 NULL
+#define pci_ss_list_126f_0910 NULL
+#define pci_ss_list_1273_0002 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1274_1371[] = {
+ &pci_ss_info_1274_1371_0e11_0024,
+ &pci_ss_info_1274_1371_0e11_b1a7,
+ &pci_ss_info_1274_1371_1033_80ac,
+ &pci_ss_info_1274_1371_1042_1854,
+ &pci_ss_info_1274_1371_107b_8054,
+ &pci_ss_info_1274_1371_1274_1371,
+ &pci_ss_info_1274_1371_1462_6470,
+ &pci_ss_info_1274_1371_1462_6560,
+ &pci_ss_info_1274_1371_1462_6630,
+ &pci_ss_info_1274_1371_1462_6631,
+ &pci_ss_info_1274_1371_1462_6632,
+ &pci_ss_info_1274_1371_1462_6633,
+ &pci_ss_info_1274_1371_1462_6820,
+ &pci_ss_info_1274_1371_1462_6822,
+ &pci_ss_info_1274_1371_1462_6830,
+ &pci_ss_info_1274_1371_1462_6880,
+ &pci_ss_info_1274_1371_1462_6900,
+ &pci_ss_info_1274_1371_1462_6910,
+ &pci_ss_info_1274_1371_1462_6930,
+ &pci_ss_info_1274_1371_1462_6990,
+ &pci_ss_info_1274_1371_1462_6991,
+ &pci_ss_info_1274_1371_14a4_2077,
+ &pci_ss_info_1274_1371_14a4_2105,
+ &pci_ss_info_1274_1371_14a4_2107,
+ &pci_ss_info_1274_1371_14a4_2172,
+ &pci_ss_info_1274_1371_1509_9902,
+ &pci_ss_info_1274_1371_1509_9903,
+ &pci_ss_info_1274_1371_1509_9904,
+ &pci_ss_info_1274_1371_1509_9905,
+ &pci_ss_info_1274_1371_152d_8801,
+ &pci_ss_info_1274_1371_152d_8802,
+ &pci_ss_info_1274_1371_152d_8803,
+ &pci_ss_info_1274_1371_152d_8804,
+ &pci_ss_info_1274_1371_152d_8805,
+ &pci_ss_info_1274_1371_270f_2001,
+ &pci_ss_info_1274_1371_270f_2200,
+ &pci_ss_info_1274_1371_270f_3000,
+ &pci_ss_info_1274_1371_270f_3100,
+ &pci_ss_info_1274_1371_270f_3102,
+ &pci_ss_info_1274_1371_270f_7060,
+ &pci_ss_info_1274_1371_8086_4249,
+ &pci_ss_info_1274_1371_8086_424c,
+ &pci_ss_info_1274_1371_8086_425a,
+ &pci_ss_info_1274_1371_8086_4341,
+ &pci_ss_info_1274_1371_8086_4343,
+ &pci_ss_info_1274_1371_8086_4649,
+ &pci_ss_info_1274_1371_8086_464a,
+ &pci_ss_info_1274_1371_8086_4d4f,
+ &pci_ss_info_1274_1371_8086_4f43,
+ &pci_ss_info_1274_1371_8086_5243,
+ &pci_ss_info_1274_1371_8086_5352,
+ &pci_ss_info_1274_1371_8086_5643,
+ &pci_ss_info_1274_1371_8086_5753,
+ NULL
+};
+#define pci_ss_list_1274_5000 NULL
+static const pciSubsystemInfo *pci_ss_list_1274_5880[] = {
+ &pci_ss_info_1274_5880_1274_2000,
+ &pci_ss_info_1274_5880_1274_2003,
+ &pci_ss_info_1274_5880_1274_5880,
+ &pci_ss_info_1274_5880_1458_a000,
+ &pci_ss_info_1274_5880_1462_6880,
+ &pci_ss_info_1274_5880_270f_2001,
+ &pci_ss_info_1274_5880_270f_2200,
+ &pci_ss_info_1274_5880_270f_7040,
+ NULL
+};
+#endif
+#define pci_ss_list_1278_0701 NULL
+#define pci_ss_list_1279_0295 NULL
+#define pci_ss_list_1279_0395 NULL
+#define pci_ss_list_1279_0396 NULL
+#define pci_ss_list_1279_0397 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_127a_1002[] = {
+ &pci_ss_info_127a_1002_1092_094c,
+ &pci_ss_info_127a_1002_122d_4002,
+ &pci_ss_info_127a_1002_122d_4005,
+ &pci_ss_info_127a_1002_122d_4007,
+ &pci_ss_info_127a_1002_122d_4012,
+ &pci_ss_info_127a_1002_122d_4017,
+ &pci_ss_info_127a_1002_122d_4018,
+ &pci_ss_info_127a_1002_127a_1002,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_1003[] = {
+ &pci_ss_info_127a_1003_0e11_b0bc,
+ &pci_ss_info_127a_1003_0e11_b114,
+ &pci_ss_info_127a_1003_1033_802b,
+ &pci_ss_info_127a_1003_13df_1003,
+ &pci_ss_info_127a_1003_13e0_0117,
+ &pci_ss_info_127a_1003_13e0_0147,
+ &pci_ss_info_127a_1003_13e0_0197,
+ &pci_ss_info_127a_1003_13e0_01c7,
+ &pci_ss_info_127a_1003_13e0_01f7,
+ &pci_ss_info_127a_1003_1436_1003,
+ &pci_ss_info_127a_1003_1436_1103,
+ &pci_ss_info_127a_1003_1436_1602,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_1004[] = {
+ &pci_ss_info_127a_1004_1048_1500,
+ &pci_ss_info_127a_1004_10cf_1059,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_1005[] = {
+ &pci_ss_info_127a_1005_1033_8029,
+ &pci_ss_info_127a_1005_1033_8054,
+ &pci_ss_info_127a_1005_10cf_103c,
+ &pci_ss_info_127a_1005_10cf_1055,
+ &pci_ss_info_127a_1005_10cf_1056,
+ &pci_ss_info_127a_1005_122d_4003,
+ &pci_ss_info_127a_1005_122d_4006,
+ &pci_ss_info_127a_1005_122d_4008,
+ &pci_ss_info_127a_1005_122d_4009,
+ &pci_ss_info_127a_1005_122d_4010,
+ &pci_ss_info_127a_1005_122d_4011,
+ &pci_ss_info_127a_1005_122d_4013,
+ &pci_ss_info_127a_1005_122d_4015,
+ &pci_ss_info_127a_1005_122d_4016,
+ &pci_ss_info_127a_1005_122d_4019,
+ &pci_ss_info_127a_1005_13df_1005,
+ &pci_ss_info_127a_1005_13e0_0187,
+ &pci_ss_info_127a_1005_13e0_01a7,
+ &pci_ss_info_127a_1005_13e0_01b7,
+ &pci_ss_info_127a_1005_13e0_01d7,
+ &pci_ss_info_127a_1005_1436_1005,
+ &pci_ss_info_127a_1005_1436_1105,
+ &pci_ss_info_127a_1005_1437_1105,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_1022[] = {
+ &pci_ss_info_127a_1022_1436_1303,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_1023[] = {
+ &pci_ss_info_127a_1023_122d_4020,
+ &pci_ss_info_127a_1023_122d_4023,
+ &pci_ss_info_127a_1023_13e0_0247,
+ &pci_ss_info_127a_1023_13e0_0297,
+ &pci_ss_info_127a_1023_13e0_02c7,
+ &pci_ss_info_127a_1023_1436_1203,
+ &pci_ss_info_127a_1023_1436_1303,
+ NULL
+};
+#define pci_ss_list_127a_1024 NULL
+static const pciSubsystemInfo *pci_ss_list_127a_1025[] = {
+ &pci_ss_info_127a_1025_10cf_106a,
+ &pci_ss_info_127a_1025_122d_4021,
+ &pci_ss_info_127a_1025_122d_4022,
+ &pci_ss_info_127a_1025_122d_4024,
+ &pci_ss_info_127a_1025_122d_4025,
+ NULL
+};
+#define pci_ss_list_127a_1026 NULL
+#define pci_ss_list_127a_1032 NULL
+#define pci_ss_list_127a_1033 NULL
+#define pci_ss_list_127a_1034 NULL
+#define pci_ss_list_127a_1035 NULL
+#define pci_ss_list_127a_1036 NULL
+#define pci_ss_list_127a_1085 NULL
+static const pciSubsystemInfo *pci_ss_list_127a_2005[] = {
+ &pci_ss_info_127a_2005_104d_8044,
+ &pci_ss_info_127a_2005_104d_8045,
+ &pci_ss_info_127a_2005_104d_8055,
+ &pci_ss_info_127a_2005_104d_8056,
+ &pci_ss_info_127a_2005_104d_805a,
+ &pci_ss_info_127a_2005_104d_805f,
+ &pci_ss_info_127a_2005_104d_8074,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_2013[] = {
+ &pci_ss_info_127a_2013_1179_0001,
+ &pci_ss_info_127a_2013_1179_ff00,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_2014[] = {
+ &pci_ss_info_127a_2014_10cf_1057,
+ &pci_ss_info_127a_2014_122d_4050,
+ &pci_ss_info_127a_2014_122d_4055,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_2015[] = {
+ &pci_ss_info_127a_2015_10cf_1063,
+ &pci_ss_info_127a_2015_10cf_1064,
+ &pci_ss_info_127a_2015_1468_2015,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_2016[] = {
+ &pci_ss_info_127a_2016_122d_4051,
+ &pci_ss_info_127a_2016_122d_4052,
+ &pci_ss_info_127a_2016_122d_4054,
+ &pci_ss_info_127a_2016_122d_4056,
+ &pci_ss_info_127a_2016_122d_4057,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_4311[] = {
+ &pci_ss_info_127a_4311_127a_4311,
+ &pci_ss_info_127a_4311_13e0_0210,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_4320[] = {
+ &pci_ss_info_127a_4320_1235_4320,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_4321[] = {
+ &pci_ss_info_127a_4321_1235_4321,
+ &pci_ss_info_127a_4321_1235_4324,
+ &pci_ss_info_127a_4321_13e0_0210,
+ &pci_ss_info_127a_4321_144d_2321,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_4322[] = {
+ &pci_ss_info_127a_4322_1235_4322,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_127a_8234[] = {
+ &pci_ss_info_127a_8234_108d_0022,
+ &pci_ss_info_127a_8234_108d_0027,
+ NULL
+};
+#endif
+#define pci_ss_list_1282_9009 NULL
+#define pci_ss_list_1282_9100 NULL
+#define pci_ss_list_1282_9102 NULL
+#define pci_ss_list_1282_9132 NULL
+#define pci_ss_list_1283_673a NULL
+#define pci_ss_list_1283_8330 NULL
+#define pci_ss_list_1283_8888 NULL
+#define pci_ss_list_1283_8889 NULL
+#define pci_ss_list_1283_e886 NULL
+#define pci_ss_list_1285_0100 NULL
+#define pci_ss_list_1287_001e NULL
+#define pci_ss_list_1287_001f NULL
+#define pci_ss_list_128d_0021 NULL
+#define pci_ss_list_128e_0008 NULL
+#define pci_ss_list_128e_0009 NULL
+#define pci_ss_list_128e_000a NULL
+#define pci_ss_list_128e_000b NULL
+#define pci_ss_list_128e_000c NULL
+#define pci_ss_list_129a_0615 NULL
+#define pci_ss_list_12ab_3000 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12ae_0001[] = {
+ &pci_ss_info_12ae_0001_12ae_0001,
+ &pci_ss_info_12ae_0001_1410_0104,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_12ae_0002[] = {
+ &pci_ss_info_12ae_0002_12ae_0002,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12b9_1006[] = {
+ &pci_ss_info_12b9_1006_12b9_005c,
+ &pci_ss_info_12b9_1006_12b9_005e,
+ &pci_ss_info_12b9_1006_12b9_0062,
+ &pci_ss_info_12b9_1006_12b9_0068,
+ &pci_ss_info_12b9_1006_12b9_007a,
+ &pci_ss_info_12b9_1006_12b9_007f,
+ &pci_ss_info_12b9_1006_12b9_0080,
+ &pci_ss_info_12b9_1006_12b9_0081,
+ &pci_ss_info_12b9_1006_12b9_0091,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_12b9_1007[] = {
+ &pci_ss_info_12b9_1007_12b9_00a3,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_12b9_1008[] = {
+ &pci_ss_info_12b9_1008_12b9_00a2,
+ &pci_ss_info_12b9_1008_12b9_00aa,
+ &pci_ss_info_12b9_1008_12b9_00ab,
+ &pci_ss_info_12b9_1008_12b9_00ac,
+ &pci_ss_info_12b9_1008_12b9_00ad,
+ NULL
+};
+#endif
+#define pci_ss_list_12be_3041 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12be_3042[] = {
+ &pci_ss_info_12be_3042_12be_3042,
+ NULL
+};
+#endif
+#define pci_ss_list_12c3_0058 NULL
+#define pci_ss_list_12c3_5598 NULL
+#define pci_ss_list_12c5_007e NULL
+#define pci_ss_list_12c5_007f NULL
+#define pci_ss_list_12c5_0081 NULL
+#define pci_ss_list_12c5_0085 NULL
+#define pci_ss_list_12c5_0086 NULL
+#define pci_ss_list_12d2_0008 NULL
+#define pci_ss_list_12d2_0009 NULL
+static const pciSubsystemInfo *pci_ss_list_12d2_0018[] = {
+ &pci_ss_info_12d2_0018_1048_0c10,
+ &pci_ss_info_12d2_0018_107b_8030,
+ &pci_ss_info_12d2_0018_1092_0350,
+ &pci_ss_info_12d2_0018_1092_1092,
+ &pci_ss_info_12d2_0018_10b4_1b1b,
+ &pci_ss_info_12d2_0018_10b4_1b1d,
+ &pci_ss_info_12d2_0018_10b4_1b1e,
+ &pci_ss_info_12d2_0018_10b4_1b20,
+ &pci_ss_info_12d2_0018_10b4_1b21,
+ &pci_ss_info_12d2_0018_10b4_1b22,
+ &pci_ss_info_12d2_0018_10b4_1b23,
+ &pci_ss_info_12d2_0018_10b4_1b27,
+ &pci_ss_info_12d2_0018_10b4_1b88,
+ &pci_ss_info_12d2_0018_10b4_222a,
+ &pci_ss_info_12d2_0018_10b4_2230,
+ &pci_ss_info_12d2_0018_10b4_2232,
+ &pci_ss_info_12d2_0018_10b4_2235,
+ &pci_ss_info_12d2_0018_2a15_54a3,
+ NULL
+};
+#define pci_ss_list_12d2_0019 NULL
+#define pci_ss_list_12d2_0020 NULL
+#define pci_ss_list_12d2_0028 NULL
+#define pci_ss_list_12d2_0029 NULL
+#define pci_ss_list_12d2_002c NULL
+#define pci_ss_list_12d2_00a0 NULL
+#define pci_ss_list_12e0_0010 NULL
+#define pci_ss_list_12e0_0020 NULL
+#define pci_ss_list_12e0_0030 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12eb_0001[] = {
+ &pci_ss_info_12eb_0001_104d_8036,
+ &pci_ss_info_12eb_0001_1092_2000,
+ &pci_ss_info_12eb_0001_1092_2100,
+ &pci_ss_info_12eb_0001_1092_2110,
+ &pci_ss_info_12eb_0001_1092_2200,
+ &pci_ss_info_12eb_0001_122d_1002,
+ &pci_ss_info_12eb_0001_12eb_0001,
+ &pci_ss_info_12eb_0001_5053_3355,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_12eb_0002[] = {
+ &pci_ss_info_12eb_0002_104d_8049,
+ &pci_ss_info_12eb_0002_104d_807b,
+ &pci_ss_info_12eb_0002_1092_3000,
+ &pci_ss_info_12eb_0002_1092_3001,
+ &pci_ss_info_12eb_0002_1092_3002,
+ &pci_ss_info_12eb_0002_1092_3003,
+ &pci_ss_info_12eb_0002_1092_3004,
+ &pci_ss_info_12eb_0002_12eb_0001,
+ &pci_ss_info_12eb_0002_12eb_0002,
+ &pci_ss_info_12eb_0002_12eb_0088,
+ &pci_ss_info_12eb_0002_144d_3510,
+ &pci_ss_info_12eb_0002_5053_3356,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_12eb_0003[] = {
+ &pci_ss_info_12eb_0003_104d_8049,
+ &pci_ss_info_12eb_0003_104d_8077,
+ &pci_ss_info_12eb_0003_109f_1000,
+ &pci_ss_info_12eb_0003_12eb_0003,
+ &pci_ss_info_12eb_0003_1462_6780,
+ &pci_ss_info_12eb_0003_14a4_2073,
+ &pci_ss_info_12eb_0003_14a4_2091,
+ &pci_ss_info_12eb_0003_14a4_2104,
+ &pci_ss_info_12eb_0003_14a4_2106,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_12eb_8803[] = {
+ &pci_ss_info_12eb_8803_12eb_8803,
+ NULL
+};
+#endif
+#define pci_ss_list_12f8_0002 NULL
+#define pci_ss_list_1307_0001 NULL
+#define pci_ss_list_1307_000b NULL
+#define pci_ss_list_1307_000c NULL
+#define pci_ss_list_1307_000d NULL
+#define pci_ss_list_1307_000f NULL
+#define pci_ss_list_1307_0010 NULL
+#define pci_ss_list_1307_0014 NULL
+#define pci_ss_list_1307_0015 NULL
+#define pci_ss_list_1307_0016 NULL
+#define pci_ss_list_1307_0017 NULL
+#define pci_ss_list_1307_0018 NULL
+#define pci_ss_list_1307_0019 NULL
+#define pci_ss_list_1307_001a NULL
+#define pci_ss_list_1307_001b NULL
+#define pci_ss_list_1307_001c NULL
+#define pci_ss_list_1307_001d NULL
+#define pci_ss_list_1307_001e NULL
+#define pci_ss_list_1307_001f NULL
+#define pci_ss_list_1307_0020 NULL
+#define pci_ss_list_1307_0021 NULL
+#define pci_ss_list_1307_0022 NULL
+#define pci_ss_list_1307_0023 NULL
+#define pci_ss_list_1307_0024 NULL
+#define pci_ss_list_1307_0025 NULL
+#define pci_ss_list_1307_0026 NULL
+#define pci_ss_list_1307_0027 NULL
+#define pci_ss_list_1307_0028 NULL
+#define pci_ss_list_1307_0029 NULL
+#define pci_ss_list_1307_002c NULL
+#define pci_ss_list_1307_0033 NULL
+#define pci_ss_list_1307_0034 NULL
+#define pci_ss_list_1307_0035 NULL
+#define pci_ss_list_1307_0036 NULL
+#define pci_ss_list_1307_0037 NULL
+#define pci_ss_list_1307_004c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1308_0001[] = {
+ &pci_ss_info_1308_0001_1308_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_1317_0981 NULL
+#define pci_ss_list_1317_0985 NULL
+#define pci_ss_list_1317_1985 NULL
+#define pci_ss_list_1318_0911 NULL
+#define pci_ss_list_1319_0801 NULL
+#define pci_ss_list_1319_0802 NULL
+#define pci_ss_list_1319_1000 NULL
+#define pci_ss_list_1319_1001 NULL
+#define pci_ss_list_131f_1000 NULL
+#define pci_ss_list_131f_1001 NULL
+#define pci_ss_list_131f_1002 NULL
+#define pci_ss_list_131f_1010 NULL
+#define pci_ss_list_131f_1011 NULL
+#define pci_ss_list_131f_1012 NULL
+#define pci_ss_list_131f_1020 NULL
+#define pci_ss_list_131f_1021 NULL
+#define pci_ss_list_131f_1030 NULL
+#define pci_ss_list_131f_1031 NULL
+#define pci_ss_list_131f_1032 NULL
+#define pci_ss_list_131f_1034 NULL
+#define pci_ss_list_131f_1035 NULL
+#define pci_ss_list_131f_1036 NULL
+#define pci_ss_list_131f_1050 NULL
+#define pci_ss_list_131f_1051 NULL
+#define pci_ss_list_131f_1052 NULL
+#define pci_ss_list_131f_2000 NULL
+#define pci_ss_list_131f_2001 NULL
+#define pci_ss_list_131f_2002 NULL
+#define pci_ss_list_131f_2010 NULL
+#define pci_ss_list_131f_2011 NULL
+#define pci_ss_list_131f_2012 NULL
+#define pci_ss_list_131f_2020 NULL
+#define pci_ss_list_131f_2021 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_131f_2030[] = {
+ &pci_ss_info_131f_2030_131f_2030,
+ NULL
+};
+#define pci_ss_list_131f_2031 NULL
+#define pci_ss_list_131f_2032 NULL
+#define pci_ss_list_131f_2040 NULL
+#define pci_ss_list_131f_2041 NULL
+#define pci_ss_list_131f_2042 NULL
+#define pci_ss_list_131f_2050 NULL
+#define pci_ss_list_131f_2051 NULL
+#define pci_ss_list_131f_2052 NULL
+#define pci_ss_list_131f_2060 NULL
+#define pci_ss_list_131f_2061 NULL
+#define pci_ss_list_131f_2062 NULL
+#endif
+#define pci_ss_list_1332_5415 NULL
+#define pci_ss_list_134a_0001 NULL
+#define pci_ss_list_134a_0002 NULL
+#define pci_ss_list_134d_7890 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_134d_7891[] = {
+ &pci_ss_info_134d_7891_134d_0001,
+ NULL
+};
+#define pci_ss_list_134d_7892 NULL
+#define pci_ss_list_134d_7893 NULL
+#define pci_ss_list_134d_7894 NULL
+#define pci_ss_list_134d_7895 NULL
+#define pci_ss_list_134d_7896 NULL
+#define pci_ss_list_134d_7897 NULL
+#endif
+#define pci_ss_list_1353_0002 NULL
+#define pci_ss_list_1353_0003 NULL
+#define pci_ss_list_1353_0004 NULL
+#define pci_ss_list_1353_0005 NULL
+#define pci_ss_list_135c_0010 NULL
+#define pci_ss_list_135c_0020 NULL
+#define pci_ss_list_135c_0030 NULL
+#define pci_ss_list_135c_0040 NULL
+#define pci_ss_list_135c_0050 NULL
+#define pci_ss_list_135c_0060 NULL
+#define pci_ss_list_135c_00f0 NULL
+#define pci_ss_list_135c_0170 NULL
+#define pci_ss_list_135c_0180 NULL
+#define pci_ss_list_135c_0190 NULL
+#define pci_ss_list_135c_01a0 NULL
+#define pci_ss_list_135c_01b0 NULL
+#define pci_ss_list_135c_01c0 NULL
+#define pci_ss_list_135e_7101 NULL
+#define pci_ss_list_135e_7201 NULL
+#define pci_ss_list_135e_7202 NULL
+#define pci_ss_list_135e_7401 NULL
+#define pci_ss_list_135e_7402 NULL
+#define pci_ss_list_135e_7801 NULL
+#define pci_ss_list_135e_8001 NULL
+#define pci_ss_list_1385_4100 NULL
+#define pci_ss_list_1385_620a NULL
+#define pci_ss_list_1385_622a NULL
+#define pci_ss_list_1385_630a NULL
+#define pci_ss_list_1385_f311 NULL
+#define pci_ss_list_1389_0001 NULL
+#define pci_ss_list_1393_1040 NULL
+#define pci_ss_list_1393_1680 NULL
+#define pci_ss_list_1393_2040 NULL
+#define pci_ss_list_1393_2180 NULL
+#define pci_ss_list_1393_3200 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1394_0001[] = {
+ &pci_ss_info_1394_0001_1394_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1397_2bd0[] = {
+ &pci_ss_info_1397_2bd0_1397_2bd0,
+ &pci_ss_info_1397_2bd0_e4bf_1000,
+ NULL
+};
+#endif
+#define pci_ss_list_139a_0001 NULL
+#define pci_ss_list_139a_0003 NULL
+#define pci_ss_list_139a_0005 NULL
+#define pci_ss_list_13a3_0005 NULL
+#define pci_ss_list_13a3_0006 NULL
+#define pci_ss_list_13a3_0007 NULL
+#define pci_ss_list_13a3_0012 NULL
+#define pci_ss_list_13a3_0014 NULL
+#define pci_ss_list_13a3_0016 NULL
+#define pci_ss_list_13a3_0017 NULL
+#define pci_ss_list_13a3_0018 NULL
+#define pci_ss_list_13a8_0158 NULL
+#define pci_ss_list_13c0_0010 NULL
+#define pci_ss_list_13c1_1000 NULL
+#define pci_ss_list_13c1_1001 NULL
+#define pci_ss_list_13c1_1002 NULL
+#define pci_ss_list_13d0_2103 NULL
+#define pci_ss_list_13d1_ab02 NULL
+#define pci_ss_list_13d1_ab06 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13df_0001[] = {
+ &pci_ss_info_13df_0001_13df_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_13f0_0201 NULL
+#define pci_ss_list_13f4_1401 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13f6_0100[] = {
+ &pci_ss_info_13f6_0100_13f6_ffff,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_13f6_0101[] = {
+ &pci_ss_info_13f6_0101_13f6_0101,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_13f6_0111[] = {
+ &pci_ss_info_13f6_0111_1019_0970,
+ &pci_ss_info_13f6_0111_1043_8077,
+ &pci_ss_info_13f6_0111_1043_80e2,
+ &pci_ss_info_13f6_0111_13f6_0111,
+ NULL
+};
+#define pci_ss_list_13f6_0211 NULL
+#endif
+#define pci_ss_list_13fe_1756 NULL
+#define pci_ss_list_1400_1401 NULL
+#define pci_ss_list_1407_0100 NULL
+#define pci_ss_list_1407_0101 NULL
+#define pci_ss_list_1407_0102 NULL
+#define pci_ss_list_1407_0200 NULL
+#define pci_ss_list_1407_0201 NULL
+#define pci_ss_list_1407_0202 NULL
+#define pci_ss_list_1407_0500 NULL
+#define pci_ss_list_1407_0600 NULL
+#define pci_ss_list_1407_8000 NULL
+#define pci_ss_list_1407_8001 NULL
+#define pci_ss_list_1407_8002 NULL
+#define pci_ss_list_1407_8003 NULL
+#define pci_ss_list_1407_8800 NULL
+#define pci_ss_list_1409_7168 NULL
+#define pci_ss_list_1412_1712 NULL
+#define pci_ss_list_1412_1724 NULL
+#define pci_ss_list_1415_8403 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1415_9501[] = {
+ &pci_ss_info_1415_9501_15ed_2000,
+ &pci_ss_info_1415_9501_15ed_2001,
+ NULL
+};
+#define pci_ss_list_1415_950a NULL
+#define pci_ss_list_1415_950b NULL
+static const pciSubsystemInfo *pci_ss_list_1415_9511[] = {
+ &pci_ss_info_1415_9511_15ed_2000,
+ &pci_ss_info_1415_9511_15ed_2001,
+ NULL
+};
+#define pci_ss_list_1415_9521 NULL
+#endif
+#define pci_ss_list_144a_7296 NULL
+#define pci_ss_list_144a_7432 NULL
+#define pci_ss_list_144a_7433 NULL
+#define pci_ss_list_144a_7434 NULL
+#define pci_ss_list_144a_7841 NULL
+#define pci_ss_list_144a_8133 NULL
+#define pci_ss_list_144a_8554 NULL
+#define pci_ss_list_144a_9111 NULL
+#define pci_ss_list_144a_9113 NULL
+#define pci_ss_list_144a_9114 NULL
+#define pci_ss_list_145f_0001 NULL
+#define pci_ss_list_148d_1003 NULL
+#define pci_ss_list_14af_7102 NULL
+#define pci_ss_list_14b3_0000 NULL
+#define pci_ss_list_14b5_0200 NULL
+#define pci_ss_list_14b5_0300 NULL
+#define pci_ss_list_14b5_0400 NULL
+#define pci_ss_list_14b5_0600 NULL
+#define pci_ss_list_14b5_0800 NULL
+#define pci_ss_list_14b5_0900 NULL
+#define pci_ss_list_14b5_0a00 NULL
+#define pci_ss_list_14b5_0b00 NULL
+#define pci_ss_list_14b7_0001 NULL
+#define pci_ss_list_14b9_0001 NULL
+#define pci_ss_list_14b9_0340 NULL
+#define pci_ss_list_14b9_0350 NULL
+#define pci_ss_list_14b9_4500 NULL
+#define pci_ss_list_14b9_4800 NULL
+#define pci_ss_list_14b9_a504 NULL
+#define pci_ss_list_14d2_8001 NULL
+#define pci_ss_list_14d2_8002 NULL
+#define pci_ss_list_14d2_8010 NULL
+#define pci_ss_list_14d2_8011 NULL
+#define pci_ss_list_14d2_8020 NULL
+#define pci_ss_list_14d2_8021 NULL
+#define pci_ss_list_14d2_8040 NULL
+#define pci_ss_list_14d2_8080 NULL
+#define pci_ss_list_14d2_a000 NULL
+#define pci_ss_list_14d2_a001 NULL
+#define pci_ss_list_14d2_a003 NULL
+#define pci_ss_list_14d2_a004 NULL
+#define pci_ss_list_14d2_a005 NULL
+#define pci_ss_list_14d2_e001 NULL
+#define pci_ss_list_14d2_e010 NULL
+#define pci_ss_list_14d2_e020 NULL
+#define pci_ss_list_14db_2120 NULL
+#define pci_ss_list_14dc_0000 NULL
+#define pci_ss_list_14dc_0001 NULL
+#define pci_ss_list_14dc_0002 NULL
+#define pci_ss_list_14dc_0003 NULL
+#define pci_ss_list_14dc_0004 NULL
+#define pci_ss_list_14dc_0005 NULL
+#define pci_ss_list_14dc_0006 NULL
+#define pci_ss_list_14dc_0007 NULL
+#define pci_ss_list_14dc_0008 NULL
+#define pci_ss_list_14dc_0009 NULL
+#define pci_ss_list_14dc_000a NULL
+#define pci_ss_list_14dc_000b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14e4_1644[] = {
+ &pci_ss_info_14e4_1644_1014_0277,
+ &pci_ss_info_14e4_1644_1028_00d1,
+ &pci_ss_info_14e4_1644_1028_0106,
+ &pci_ss_info_14e4_1644_1028_0109,
+ &pci_ss_info_14e4_1644_1028_010a,
+ &pci_ss_info_14e4_1644_10b7_1000,
+ &pci_ss_info_14e4_1644_10b7_1001,
+ &pci_ss_info_14e4_1644_10b7_1002,
+ &pci_ss_info_14e4_1644_10b7_1003,
+ &pci_ss_info_14e4_1644_10b7_1004,
+ &pci_ss_info_14e4_1644_10b7_1005,
+ &pci_ss_info_14e4_1644_10b7_1008,
+ &pci_ss_info_14e4_1644_14e4_0002,
+ &pci_ss_info_14e4_1644_14e4_0003,
+ &pci_ss_info_14e4_1644_14e4_0004,
+ &pci_ss_info_14e4_1644_14e4_1028,
+ &pci_ss_info_14e4_1644_14e4_1644,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_1645[] = {
+ &pci_ss_info_14e4_1645_0e11_007c,
+ &pci_ss_info_14e4_1645_0e11_007d,
+ &pci_ss_info_14e4_1645_0e11_0085,
+ &pci_ss_info_14e4_1645_0e11_0099,
+ &pci_ss_info_14e4_1645_0e11_009a,
+ &pci_ss_info_14e4_1645_0e11_00c1,
+ &pci_ss_info_14e4_1645_1028_0121,
+ &pci_ss_info_14e4_1645_10b7_1004,
+ &pci_ss_info_14e4_1645_10b7_1006,
+ &pci_ss_info_14e4_1645_10b7_1007,
+ &pci_ss_info_14e4_1645_10b7_1008,
+ &pci_ss_info_14e4_1645_14e4_0001,
+ &pci_ss_info_14e4_1645_14e4_0005,
+ &pci_ss_info_14e4_1645_14e4_0006,
+ &pci_ss_info_14e4_1645_14e4_0007,
+ &pci_ss_info_14e4_1645_14e4_0008,
+ &pci_ss_info_14e4_1645_14e4_8008,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_1646[] = {
+ &pci_ss_info_14e4_1646_0e11_00bb,
+ &pci_ss_info_14e4_1646_1028_0126,
+ &pci_ss_info_14e4_1646_14e4_8009,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_1647[] = {
+ &pci_ss_info_14e4_1647_0e11_0099,
+ &pci_ss_info_14e4_1647_0e11_009a,
+ &pci_ss_info_14e4_1647_14e4_0009,
+ &pci_ss_info_14e4_1647_14e4_000a,
+ &pci_ss_info_14e4_1647_14e4_000b,
+ &pci_ss_info_14e4_1647_14e4_8009,
+ &pci_ss_info_14e4_1647_14e4_800a,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_1648[] = {
+ &pci_ss_info_14e4_1648_0e11_00cf,
+ &pci_ss_info_14e4_1648_0e11_00d0,
+ &pci_ss_info_14e4_1648_0e11_00d1,
+ &pci_ss_info_14e4_1648_10b7_2000,
+ &pci_ss_info_14e4_1648_10b7_3000,
+ &pci_ss_info_14e4_1648_1166_1648,
+ NULL
+};
+#define pci_ss_list_14e4_164d NULL
+#define pci_ss_list_14e4_1653 NULL
+#define pci_ss_list_14e4_165d NULL
+static const pciSubsystemInfo *pci_ss_list_14e4_1696[] = {
+ &pci_ss_info_14e4_1696_14e4_000d,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_16a6[] = {
+ &pci_ss_info_14e4_16a6_0e11_00bb,
+ &pci_ss_info_14e4_16a6_1028_0126,
+ &pci_ss_info_14e4_16a6_14e4_000c,
+ &pci_ss_info_14e4_16a6_14e4_8009,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_16a7[] = {
+ &pci_ss_info_14e4_16a7_0e11_00ca,
+ &pci_ss_info_14e4_16a7_0e11_00cb,
+ &pci_ss_info_14e4_16a7_14e4_0009,
+ &pci_ss_info_14e4_16a7_14e4_000a,
+ &pci_ss_info_14e4_16a7_14e4_000b,
+ &pci_ss_info_14e4_16a7_14e4_800a,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_16a8[] = {
+ &pci_ss_info_14e4_16a8_10b7_2001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_16c6[] = {
+ &pci_ss_info_14e4_16c6_10b7_1100,
+ &pci_ss_info_14e4_16c6_14e4_000c,
+ &pci_ss_info_14e4_16c6_14e4_8009,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14e4_16c7[] = {
+ &pci_ss_info_14e4_16c7_14e4_0009,
+ &pci_ss_info_14e4_16c7_14e4_000a,
+ NULL
+};
+#define pci_ss_list_14e4_4210 NULL
+#define pci_ss_list_14e4_4211 NULL
+#define pci_ss_list_14e4_4212 NULL
+#define pci_ss_list_14e4_4301 NULL
+#define pci_ss_list_14e4_4401 NULL
+#define pci_ss_list_14e4_4402 NULL
+#define pci_ss_list_14e4_4410 NULL
+#define pci_ss_list_14e4_4411 NULL
+#define pci_ss_list_14e4_4412 NULL
+#define pci_ss_list_14e4_5820 NULL
+#define pci_ss_list_14e4_5821 NULL
+#endif
+#define pci_ss_list_14ea_ab06 NULL
+#define pci_ss_list_14f1_1002 NULL
+#define pci_ss_list_14f1_1003 NULL
+#define pci_ss_list_14f1_1004 NULL
+#define pci_ss_list_14f1_1005 NULL
+#define pci_ss_list_14f1_1006 NULL
+#define pci_ss_list_14f1_1022 NULL
+#define pci_ss_list_14f1_1023 NULL
+#define pci_ss_list_14f1_1024 NULL
+#define pci_ss_list_14f1_1025 NULL
+#define pci_ss_list_14f1_1026 NULL
+#define pci_ss_list_14f1_1032 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14f1_1033[] = {
+ &pci_ss_info_14f1_1033_1033_8077,
+ &pci_ss_info_14f1_1033_122d_4027,
+ &pci_ss_info_14f1_1033_122d_4030,
+ &pci_ss_info_14f1_1033_122d_4034,
+ &pci_ss_info_14f1_1033_13e0_020d,
+ &pci_ss_info_14f1_1033_13e0_020e,
+ &pci_ss_info_14f1_1033_13e0_0261,
+ &pci_ss_info_14f1_1033_13e0_0290,
+ &pci_ss_info_14f1_1033_13e0_02a0,
+ &pci_ss_info_14f1_1033_13e0_02b0,
+ &pci_ss_info_14f1_1033_13e0_02c0,
+ &pci_ss_info_14f1_1033_13e0_02d0,
+ &pci_ss_info_14f1_1033_144f_1500,
+ &pci_ss_info_14f1_1033_144f_1501,
+ &pci_ss_info_14f1_1033_144f_150a,
+ &pci_ss_info_14f1_1033_144f_150b,
+ &pci_ss_info_14f1_1033_144f_1510,
+ NULL
+};
+#define pci_ss_list_14f1_1034 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_1035[] = {
+ &pci_ss_info_14f1_1035_10cf_1098,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14f1_1036[] = {
+ &pci_ss_info_14f1_1036_104d_8067,
+ &pci_ss_info_14f1_1036_122d_4029,
+ &pci_ss_info_14f1_1036_122d_4031,
+ &pci_ss_info_14f1_1036_13e0_0209,
+ &pci_ss_info_14f1_1036_13e0_020a,
+ &pci_ss_info_14f1_1036_13e0_0260,
+ &pci_ss_info_14f1_1036_13e0_0270,
+ NULL
+};
+#define pci_ss_list_14f1_1052 NULL
+#define pci_ss_list_14f1_1053 NULL
+#define pci_ss_list_14f1_1054 NULL
+#define pci_ss_list_14f1_1055 NULL
+#define pci_ss_list_14f1_1056 NULL
+#define pci_ss_list_14f1_1057 NULL
+#define pci_ss_list_14f1_1059 NULL
+#define pci_ss_list_14f1_1063 NULL
+#define pci_ss_list_14f1_1064 NULL
+#define pci_ss_list_14f1_1065 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_1066[] = {
+ &pci_ss_info_14f1_1066_122d_4033,
+ NULL
+};
+#define pci_ss_list_14f1_1433 NULL
+#define pci_ss_list_14f1_1434 NULL
+#define pci_ss_list_14f1_1435 NULL
+#define pci_ss_list_14f1_1436 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_1453[] = {
+ &pci_ss_info_14f1_1453_13e0_0240,
+ &pci_ss_info_14f1_1453_13e0_0250,
+ &pci_ss_info_14f1_1453_144f_1502,
+ &pci_ss_info_14f1_1453_144f_1503,
+ NULL
+};
+#define pci_ss_list_14f1_1454 NULL
+#define pci_ss_list_14f1_1455 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_1456[] = {
+ &pci_ss_info_14f1_1456_122d_4035,
+ &pci_ss_info_14f1_1456_122d_4302,
+ NULL
+};
+#define pci_ss_list_14f1_1610 NULL
+#define pci_ss_list_14f1_1611 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_1803[] = {
+ &pci_ss_info_14f1_1803_0e11_0023,
+ &pci_ss_info_14f1_1803_0e11_0043,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_14f1_1815[] = {
+ &pci_ss_info_14f1_1815_0e11_0022,
+ &pci_ss_info_14f1_1815_0e11_0042,
+ NULL
+};
+#define pci_ss_list_14f1_2003 NULL
+#define pci_ss_list_14f1_2004 NULL
+#define pci_ss_list_14f1_2005 NULL
+#define pci_ss_list_14f1_2006 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_2013[] = {
+ &pci_ss_info_14f1_2013_0e11_b195,
+ &pci_ss_info_14f1_2013_0e11_b196,
+ &pci_ss_info_14f1_2013_0e11_b1be,
+ &pci_ss_info_14f1_2013_1025_8013,
+ &pci_ss_info_14f1_2013_1033_809d,
+ &pci_ss_info_14f1_2013_1033_80bc,
+ &pci_ss_info_14f1_2013_155d_6793,
+ &pci_ss_info_14f1_2013_155d_8850,
+ NULL
+};
+#define pci_ss_list_14f1_2014 NULL
+#define pci_ss_list_14f1_2015 NULL
+#define pci_ss_list_14f1_2016 NULL
+#define pci_ss_list_14f1_2043 NULL
+#define pci_ss_list_14f1_2044 NULL
+#define pci_ss_list_14f1_2045 NULL
+#define pci_ss_list_14f1_2046 NULL
+#define pci_ss_list_14f1_2063 NULL
+#define pci_ss_list_14f1_2064 NULL
+#define pci_ss_list_14f1_2065 NULL
+#define pci_ss_list_14f1_2066 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_2093[] = {
+ &pci_ss_info_14f1_2093_155d_2f07,
+ NULL
+};
+#define pci_ss_list_14f1_2143 NULL
+#define pci_ss_list_14f1_2144 NULL
+#define pci_ss_list_14f1_2145 NULL
+#define pci_ss_list_14f1_2146 NULL
+#define pci_ss_list_14f1_2163 NULL
+#define pci_ss_list_14f1_2164 NULL
+#define pci_ss_list_14f1_2165 NULL
+#define pci_ss_list_14f1_2166 NULL
+#define pci_ss_list_14f1_2343 NULL
+#define pci_ss_list_14f1_2344 NULL
+#define pci_ss_list_14f1_2345 NULL
+#define pci_ss_list_14f1_2346 NULL
+#define pci_ss_list_14f1_2363 NULL
+#define pci_ss_list_14f1_2364 NULL
+#define pci_ss_list_14f1_2365 NULL
+#define pci_ss_list_14f1_2366 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_2443[] = {
+ &pci_ss_info_14f1_2443_104d_8075,
+ &pci_ss_info_14f1_2443_104d_8083,
+ &pci_ss_info_14f1_2443_104d_8097,
+ NULL
+};
+#define pci_ss_list_14f1_2444 NULL
+#define pci_ss_list_14f1_2445 NULL
+#define pci_ss_list_14f1_2446 NULL
+#define pci_ss_list_14f1_2463 NULL
+#define pci_ss_list_14f1_2464 NULL
+#define pci_ss_list_14f1_2465 NULL
+#define pci_ss_list_14f1_2466 NULL
+static const pciSubsystemInfo *pci_ss_list_14f1_2f00[] = {
+ &pci_ss_info_14f1_2f00_13e0_8d84,
+ &pci_ss_info_14f1_2f00_13e0_8d85,
+ &pci_ss_info_14f1_2f00_14f1_2004,
+ NULL
+};
+#define pci_ss_list_14f1_8234 NULL
+#endif
+#define pci_ss_list_1507_0001 NULL
+#define pci_ss_list_1507_0002 NULL
+#define pci_ss_list_1507_0003 NULL
+#define pci_ss_list_1507_0100 NULL
+#define pci_ss_list_1507_0431 NULL
+#define pci_ss_list_1507_4801 NULL
+#define pci_ss_list_1507_4802 NULL
+#define pci_ss_list_1507_4803 NULL
+#define pci_ss_list_1507_4806 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1516_0803[] = {
+ &pci_ss_info_1516_0803_1320_10bd,
+ NULL
+};
+#endif
+#define pci_ss_list_151a_1002 NULL
+#define pci_ss_list_151a_1004 NULL
+#define pci_ss_list_151a_1008 NULL
+#define pci_ss_list_151f_0000 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1522_0100[] = {
+ &pci_ss_info_1522_0100_1522_0200,
+ &pci_ss_info_1522_0100_1522_0300,
+ &pci_ss_info_1522_0100_1522_0400,
+ &pci_ss_info_1522_0100_1522_0500,
+ &pci_ss_info_1522_0100_1522_0600,
+ &pci_ss_info_1522_0100_1522_0700,
+ &pci_ss_info_1522_0100_1522_0800,
+ NULL
+};
+#endif
+#define pci_ss_list_1524_1211 NULL
+#define pci_ss_list_1524_1225 NULL
+#define pci_ss_list_1524_1410 NULL
+#define pci_ss_list_1524_1420 NULL
+#define pci_ss_list_1543_3052 NULL
+#define pci_ss_list_1543_4c22 NULL
+#define pci_ss_list_1571_a001 NULL
+#define pci_ss_list_1571_a002 NULL
+#define pci_ss_list_1571_a003 NULL
+#define pci_ss_list_1571_a004 NULL
+#define pci_ss_list_1571_a005 NULL
+#define pci_ss_list_1571_a006 NULL
+#define pci_ss_list_1571_a007 NULL
+#define pci_ss_list_1571_a008 NULL
+#define pci_ss_list_1571_a009 NULL
+#define pci_ss_list_1571_a00a NULL
+#define pci_ss_list_1571_a00b NULL
+#define pci_ss_list_1571_a00c NULL
+#define pci_ss_list_1571_a00d NULL
+#define pci_ss_list_1571_a201 NULL
+#define pci_ss_list_1571_a202 NULL
+#define pci_ss_list_1571_a203 NULL
+#define pci_ss_list_1571_a204 NULL
+#define pci_ss_list_1571_a205 NULL
+#define pci_ss_list_1571_a206 NULL
+#define pci_ss_list_157c_8001 NULL
+#define pci_ss_list_1592_0781 NULL
+#define pci_ss_list_1592_0782 NULL
+#define pci_ss_list_1592_0783 NULL
+#define pci_ss_list_1592_0785 NULL
+#define pci_ss_list_1592_0786 NULL
+#define pci_ss_list_1592_0787 NULL
+#define pci_ss_list_1592_0788 NULL
+#define pci_ss_list_1592_078a NULL
+#define pci_ss_list_15a2_0001 NULL
+#define pci_ss_list_15ad_0710 NULL
+#define pci_ss_list_15b3_5274 NULL
+#define pci_ss_list_15bc_2929 NULL
+#define pci_ss_list_15c7_0349 NULL
+#define pci_ss_list_15dc_0001 NULL
+#define pci_ss_list_15e8_0130 NULL
+#define pci_ss_list_1619_0400 NULL
+#define pci_ss_list_1619_0440 NULL
+#define pci_ss_list_1629_1003 NULL
+#define pci_ss_list_1629_2002 NULL
+#define pci_ss_list_1638_1100 NULL
+#define pci_ss_list_163c_5449 NULL
+#define pci_ss_list_165a_c100 NULL
+#define pci_ss_list_165a_d200 NULL
+#define pci_ss_list_165a_d300 NULL
+#define pci_ss_list_16ab_1102 NULL
+#define pci_ss_list_16ec_3685 NULL
+#define pci_ss_list_173b_03e8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_173b_03ea[] = {
+ &pci_ss_info_173b_03ea_173b_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_1743_8139 NULL
+#define pci_ss_list_1796_0001 NULL
+#define pci_ss_list_1796_0002 NULL
+#define pci_ss_list_1796_0003 NULL
+#define pci_ss_list_1796_0004 NULL
+#define pci_ss_list_1796_0005 NULL
+#define pci_ss_list_1796_0006 NULL
+#define pci_ss_list_17cc_2280 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1813_4000[] = {
+ &pci_ss_info_1813_4000_16be_0001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1813_4100[] = {
+ &pci_ss_info_1813_4100_16be_0002,
+ NULL
+};
+#endif
+#define pci_ss_list_1888_0301 NULL
+#define pci_ss_list_1888_0601 NULL
+#define pci_ss_list_1888_0710 NULL
+#define pci_ss_list_1888_0720 NULL
+#define pci_ss_list_1a08_0000 NULL
+#define pci_ss_list_1c1c_0001 NULL
+#define pci_ss_list_1d44_a400 NULL
+#define pci_ss_list_1de1_0391 NULL
+#define pci_ss_list_1de1_2020 NULL
+#define pci_ss_list_1de1_690c NULL
+#define pci_ss_list_1de1_dc29 NULL
+#define pci_ss_list_2348_2010 NULL
+#define pci_ss_list_3388_0013 NULL
+#define pci_ss_list_3388_0014 NULL
+#define pci_ss_list_3388_0021 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_3388_8011[] = {
+ &pci_ss_info_3388_8011_3388_8011,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_3388_8012[] = {
+ &pci_ss_info_3388_8012_3388_8012,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_3388_8013[] = {
+ &pci_ss_info_3388_8013_3388_8013,
+ NULL
+};
+#endif
+#define pci_ss_list_3d3d_0001 NULL
+#define pci_ss_list_3d3d_0002 NULL
+#define pci_ss_list_3d3d_0003 NULL
+#define pci_ss_list_3d3d_0004 NULL
+#define pci_ss_list_3d3d_0005 NULL
+#define pci_ss_list_3d3d_0006 NULL
+#define pci_ss_list_3d3d_0007 NULL
+#define pci_ss_list_3d3d_0008 NULL
+static const pciSubsystemInfo *pci_ss_list_3d3d_0009[] = {
+ &pci_ss_info_3d3d_0009_1040_0011,
+ &pci_ss_info_3d3d_0009_3d3d_0100,
+ &pci_ss_info_3d3d_0009_3d3d_0111,
+ &pci_ss_info_3d3d_0009_3d3d_0114,
+ &pci_ss_info_3d3d_0009_3d3d_0116,
+ &pci_ss_info_3d3d_0009_3d3d_0119,
+ &pci_ss_info_3d3d_0009_3d3d_0120,
+ &pci_ss_info_3d3d_0009_3d3d_0125,
+ &pci_ss_info_3d3d_0009_3d3d_0127,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_3d3d_000a[] = {
+ &pci_ss_info_3d3d_000a_3d3d_0121,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_3d3d_000c[] = {
+ &pci_ss_info_3d3d_000c_3d3d_0144,
+ NULL
+};
+#define pci_ss_list_3d3d_0100 NULL
+#define pci_ss_list_3d3d_1004 NULL
+#define pci_ss_list_3d3d_3d04 NULL
+#define pci_ss_list_3d3d_ffff NULL
+#define pci_ss_list_4005_0300 NULL
+#define pci_ss_list_4005_0308 NULL
+#define pci_ss_list_4005_0309 NULL
+#define pci_ss_list_4005_1064 NULL
+#define pci_ss_list_4005_2064 NULL
+#define pci_ss_list_4005_2128 NULL
+#define pci_ss_list_4005_2301 NULL
+#define pci_ss_list_4005_2302 NULL
+#define pci_ss_list_4005_2303 NULL
+#define pci_ss_list_4005_2364 NULL
+#define pci_ss_list_4005_2464 NULL
+#define pci_ss_list_4005_2501 NULL
+static const pciSubsystemInfo *pci_ss_list_4005_4000[] = {
+ &pci_ss_info_4005_4000_4005_4000,
+ NULL
+};
+#define pci_ss_list_4005_4710 NULL
+#define pci_ss_list_4033_1360 NULL
+#define pci_ss_list_416c_0100 NULL
+#define pci_ss_list_416c_0200 NULL
+#define pci_ss_list_4444_0803 NULL
+#define pci_ss_list_4916_1960 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_4a14_5000[] = {
+ &pci_ss_info_4a14_5000_4a14_5000,
+ NULL
+};
+#endif
+#define pci_ss_list_4d51_0200 NULL
+#define pci_ss_list_4ddc_0100 NULL
+#define pci_ss_list_4ddc_0801 NULL
+#define pci_ss_list_4ddc_0802 NULL
+#define pci_ss_list_4ddc_0811 NULL
+#define pci_ss_list_4ddc_0812 NULL
+#define pci_ss_list_4ddc_0881 NULL
+#define pci_ss_list_4ddc_0882 NULL
+#define pci_ss_list_4ddc_0891 NULL
+#define pci_ss_list_4ddc_0892 NULL
+#define pci_ss_list_4ddc_0901 NULL
+#define pci_ss_list_4ddc_0902 NULL
+#define pci_ss_list_4ddc_0903 NULL
+#define pci_ss_list_4ddc_0904 NULL
+#define pci_ss_list_4ddc_0b01 NULL
+#define pci_ss_list_4ddc_0b02 NULL
+#define pci_ss_list_4ddc_0b03 NULL
+#define pci_ss_list_4ddc_0b04 NULL
+#define pci_ss_list_5046_1001 NULL
+#define pci_ss_list_5053_2010 NULL
+#define pci_ss_list_5145_3031 NULL
+#define pci_ss_list_5301_0001 NULL
+#define pci_ss_list_5333_0551 NULL
+#define pci_ss_list_5333_5631 NULL
+#define pci_ss_list_5333_8800 NULL
+#define pci_ss_list_5333_8801 NULL
+#define pci_ss_list_5333_8810 NULL
+#define pci_ss_list_5333_8811 NULL
+#define pci_ss_list_5333_8812 NULL
+#define pci_ss_list_5333_8813 NULL
+#define pci_ss_list_5333_8814 NULL
+#define pci_ss_list_5333_8815 NULL
+#define pci_ss_list_5333_883d NULL
+#define pci_ss_list_5333_8870 NULL
+#define pci_ss_list_5333_8880 NULL
+#define pci_ss_list_5333_8881 NULL
+#define pci_ss_list_5333_8882 NULL
+#define pci_ss_list_5333_8883 NULL
+#define pci_ss_list_5333_88b0 NULL
+#define pci_ss_list_5333_88b1 NULL
+#define pci_ss_list_5333_88b2 NULL
+#define pci_ss_list_5333_88b3 NULL
+#define pci_ss_list_5333_88c0 NULL
+#define pci_ss_list_5333_88c1 NULL
+#define pci_ss_list_5333_88c2 NULL
+#define pci_ss_list_5333_88c3 NULL
+#define pci_ss_list_5333_88d0 NULL
+#define pci_ss_list_5333_88d1 NULL
+#define pci_ss_list_5333_88d2 NULL
+#define pci_ss_list_5333_88d3 NULL
+#define pci_ss_list_5333_88f0 NULL
+#define pci_ss_list_5333_88f1 NULL
+#define pci_ss_list_5333_88f2 NULL
+#define pci_ss_list_5333_88f3 NULL
+static const pciSubsystemInfo *pci_ss_list_5333_8900[] = {
+ &pci_ss_info_5333_8900_5333_8900,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_5333_8901[] = {
+ &pci_ss_info_5333_8901_5333_8901,
+ NULL
+};
+#define pci_ss_list_5333_8902 NULL
+#define pci_ss_list_5333_8903 NULL
+static const pciSubsystemInfo *pci_ss_list_5333_8904[] = {
+ &pci_ss_info_5333_8904_1014_00db,
+ &pci_ss_info_5333_8904_5333_8904,
+ NULL
+};
+#define pci_ss_list_5333_8905 NULL
+#define pci_ss_list_5333_8906 NULL
+#define pci_ss_list_5333_8907 NULL
+#define pci_ss_list_5333_8908 NULL
+#define pci_ss_list_5333_8909 NULL
+#define pci_ss_list_5333_890a NULL
+#define pci_ss_list_5333_890b NULL
+#define pci_ss_list_5333_890c NULL
+#define pci_ss_list_5333_890d NULL
+#define pci_ss_list_5333_890e NULL
+#define pci_ss_list_5333_890f NULL
+static const pciSubsystemInfo *pci_ss_list_5333_8a01[] = {
+ &pci_ss_info_5333_8a01_0e11_b032,
+ &pci_ss_info_5333_8a01_10b4_1617,
+ &pci_ss_info_5333_8a01_10b4_1717,
+ &pci_ss_info_5333_8a01_5333_8a01,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_5333_8a10[] = {
+ &pci_ss_info_5333_8a10_1092_8a10,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_5333_8a13[] = {
+ &pci_ss_info_5333_8a13_5333_8a13,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_5333_8a20[] = {
+ &pci_ss_info_5333_8a20_5333_8a20,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_5333_8a21[] = {
+ &pci_ss_info_5333_8a21_5333_8a21,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_5333_8a22[] = {
+ &pci_ss_info_5333_8a22_1033_8068,
+ &pci_ss_info_5333_8a22_1033_8069,
+ &pci_ss_info_5333_8a22_105d_0018,
+ &pci_ss_info_5333_8a22_105d_002a,
+ &pci_ss_info_5333_8a22_105d_003a,
+ &pci_ss_info_5333_8a22_105d_092f,
+ &pci_ss_info_5333_8a22_1092_4207,
+ &pci_ss_info_5333_8a22_1092_4800,
+ &pci_ss_info_5333_8a22_1092_4807,
+ &pci_ss_info_5333_8a22_1092_4808,
+ &pci_ss_info_5333_8a22_1092_4809,
+ &pci_ss_info_5333_8a22_1092_480e,
+ &pci_ss_info_5333_8a22_1092_4904,
+ &pci_ss_info_5333_8a22_1092_4905,
+ &pci_ss_info_5333_8a22_1092_4a09,
+ &pci_ss_info_5333_8a22_1092_4a0b,
+ &pci_ss_info_5333_8a22_1092_4a0f,
+ &pci_ss_info_5333_8a22_1092_4e01,
+ &pci_ss_info_5333_8a22_1102_101d,
+ &pci_ss_info_5333_8a22_1102_101e,
+ &pci_ss_info_5333_8a22_5333_8100,
+ &pci_ss_info_5333_8a22_5333_8110,
+ &pci_ss_info_5333_8a22_5333_8125,
+ &pci_ss_info_5333_8a22_5333_8143,
+ &pci_ss_info_5333_8a22_5333_8a22,
+ &pci_ss_info_5333_8a22_5333_8a2e,
+ &pci_ss_info_5333_8a22_5333_9125,
+ &pci_ss_info_5333_8a22_5333_9143,
+ NULL
+};
+#define pci_ss_list_5333_8a23 NULL
+#define pci_ss_list_5333_8a25 NULL
+#define pci_ss_list_5333_8a26 NULL
+#define pci_ss_list_5333_8c00 NULL
+static const pciSubsystemInfo *pci_ss_list_5333_8c01[] = {
+ &pci_ss_info_5333_8c01_1179_0001,
+ NULL
+};
+#define pci_ss_list_5333_8c02 NULL
+#define pci_ss_list_5333_8c03 NULL
+#define pci_ss_list_5333_8c10 NULL
+#define pci_ss_list_5333_8c11 NULL
+static const pciSubsystemInfo *pci_ss_list_5333_8c12[] = {
+ &pci_ss_info_5333_8c12_1014_017f,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_5333_8c13[] = {
+ &pci_ss_info_5333_8c13_1179_0001,
+ NULL
+};
+#define pci_ss_list_5333_8c22 NULL
+#define pci_ss_list_5333_8c24 NULL
+#define pci_ss_list_5333_8c26 NULL
+#define pci_ss_list_5333_8c2a NULL
+#define pci_ss_list_5333_8c2b NULL
+#define pci_ss_list_5333_8c2c NULL
+#define pci_ss_list_5333_8c2d NULL
+static const pciSubsystemInfo *pci_ss_list_5333_8c2e[] = {
+ &pci_ss_info_5333_8c2e_1014_01fc,
+ NULL
+};
+#define pci_ss_list_5333_8c2f NULL
+#define pci_ss_list_5333_8d01 NULL
+#define pci_ss_list_5333_8d02 NULL
+#define pci_ss_list_5333_8d03 NULL
+#define pci_ss_list_5333_8d04 NULL
+static const pciSubsystemInfo *pci_ss_list_5333_9102[] = {
+ &pci_ss_info_5333_9102_1092_5932,
+ &pci_ss_info_5333_9102_1092_5934,
+ &pci_ss_info_5333_9102_1092_5952,
+ &pci_ss_info_5333_9102_1092_5954,
+ &pci_ss_info_5333_9102_1092_5a35,
+ &pci_ss_info_5333_9102_1092_5a37,
+ &pci_ss_info_5333_9102_1092_5a55,
+ &pci_ss_info_5333_9102_1092_5a57,
+ NULL
+};
+#define pci_ss_list_5333_ca00 NULL
+#define pci_ss_list_5455_4458 NULL
+#define pci_ss_list_5544_0001 NULL
+#define pci_ss_list_5555_0003 NULL
+#define pci_ss_list_6374_6773 NULL
+#define pci_ss_list_6666_0001 NULL
+#define pci_ss_list_6666_0002 NULL
+#define pci_ss_list_8008_0010 NULL
+#define pci_ss_list_8008_0011 NULL
+#define pci_ss_list_8086_0007 NULL
+#define pci_ss_list_8086_0008 NULL
+#define pci_ss_list_8086_0039 NULL
+#define pci_ss_list_8086_0122 NULL
+#define pci_ss_list_8086_0482 NULL
+#define pci_ss_list_8086_0483 NULL
+#define pci_ss_list_8086_0484 NULL
+#define pci_ss_list_8086_0486 NULL
+#define pci_ss_list_8086_04a3 NULL
+#define pci_ss_list_8086_04d0 NULL
+#define pci_ss_list_8086_0600 NULL
+#define pci_ss_list_8086_0960 NULL
+#define pci_ss_list_8086_0962 NULL
+#define pci_ss_list_8086_0964 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1000[] = {
+ &pci_ss_info_8086_1000_0e11_b0df,
+ &pci_ss_info_8086_1000_0e11_b0e0,
+ &pci_ss_info_8086_1000_0e11_b123,
+ &pci_ss_info_8086_1000_1014_0119,
+ &pci_ss_info_8086_1000_8086_1000,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1001[] = {
+ &pci_ss_info_8086_1001_0e11_004a,
+ &pci_ss_info_8086_1001_1014_01ea,
+ &pci_ss_info_8086_1001_8086_1003,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1002[] = {
+ &pci_ss_info_8086_1002_8086_200e,
+ &pci_ss_info_8086_1002_8086_2013,
+ &pci_ss_info_8086_1002_8086_2017,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1004[] = {
+ &pci_ss_info_8086_1004_0e11_0049,
+ &pci_ss_info_8086_1004_0e11_b1a4,
+ &pci_ss_info_8086_1004_1014_10f2,
+ &pci_ss_info_8086_1004_8086_1004,
+ &pci_ss_info_8086_1004_8086_2004,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1008[] = {
+ &pci_ss_info_8086_1008_8086_1107,
+ &pci_ss_info_8086_1008_8086_2107,
+ &pci_ss_info_8086_1008_8086_2110,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1009[] = {
+ &pci_ss_info_8086_1009_8086_1109,
+ &pci_ss_info_8086_1009_8086_2109,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_100c[] = {
+ &pci_ss_info_8086_100c_8086_1112,
+ &pci_ss_info_8086_100c_8086_2112,
+ NULL
+};
+#define pci_ss_list_8086_100d NULL
+static const pciSubsystemInfo *pci_ss_list_8086_100e[] = {
+ &pci_ss_info_8086_100e_8086_001e,
+ &pci_ss_info_8086_100e_8086_002e,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_100f[] = {
+ &pci_ss_info_8086_100f_8086_1001,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1010[] = {
+ &pci_ss_info_8086_1010_8086_1011,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1011[] = {
+ &pci_ss_info_8086_1011_8086_1002,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1012[] = {
+ &pci_ss_info_8086_1012_8086_1012,
+ NULL
+};
+#define pci_ss_list_8086_1015 NULL
+#define pci_ss_list_8086_1029 NULL
+#define pci_ss_list_8086_1030 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1031[] = {
+ &pci_ss_info_8086_1031_1014_0209,
+ &pci_ss_info_8086_1031_104d_80e7,
+ &pci_ss_info_8086_1031_107b_5350,
+ &pci_ss_info_8086_1031_1179_0001,
+ &pci_ss_info_8086_1031_144d_c000,
+ &pci_ss_info_8086_1031_144d_c001,
+ &pci_ss_info_8086_1031_144d_c003,
+ &pci_ss_info_8086_1031_144d_c006,
+ NULL
+};
+#define pci_ss_list_8086_1032 NULL
+#define pci_ss_list_8086_1033 NULL
+#define pci_ss_list_8086_1034 NULL
+#define pci_ss_list_8086_1035 NULL
+#define pci_ss_list_8086_1036 NULL
+#define pci_ss_list_8086_1037 NULL
+#define pci_ss_list_8086_1038 NULL
+#define pci_ss_list_8086_1039 NULL
+#define pci_ss_list_8086_103a NULL
+#define pci_ss_list_8086_103b NULL
+#define pci_ss_list_8086_103c NULL
+#define pci_ss_list_8086_103d NULL
+#define pci_ss_list_8086_103e NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1040[] = {
+ &pci_ss_info_8086_1040_16be_1040,
+ NULL
+};
+#define pci_ss_list_8086_1059 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1130[] = {
+ &pci_ss_info_8086_1130_1025_1016,
+ &pci_ss_info_8086_1130_1043_8027,
+ &pci_ss_info_8086_1130_104d_80df,
+ NULL
+};
+#define pci_ss_list_8086_1131 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1132[] = {
+ &pci_ss_info_8086_1132_1025_1016,
+ &pci_ss_info_8086_1132_104d_80df,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1161[] = {
+ &pci_ss_info_8086_1161_8086_1161,
+ NULL
+};
+#define pci_ss_list_8086_1162 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1200[] = {
+ &pci_ss_info_8086_1200_172a_0000,
+ NULL
+};
+#define pci_ss_list_8086_1209 NULL
+#define pci_ss_list_8086_1221 NULL
+#define pci_ss_list_8086_1222 NULL
+#define pci_ss_list_8086_1223 NULL
+#define pci_ss_list_8086_1225 NULL
+#define pci_ss_list_8086_1226 NULL
+#define pci_ss_list_8086_1227 NULL
+#define pci_ss_list_8086_1228 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1229[] = {
+ &pci_ss_info_8086_1229_0e11_3001,
+ &pci_ss_info_8086_1229_0e11_3002,
+ &pci_ss_info_8086_1229_0e11_3003,
+ &pci_ss_info_8086_1229_0e11_3004,
+ &pci_ss_info_8086_1229_0e11_3005,
+ &pci_ss_info_8086_1229_0e11_3006,
+ &pci_ss_info_8086_1229_0e11_3007,
+ &pci_ss_info_8086_1229_0e11_b01e,
+ &pci_ss_info_8086_1229_0e11_b01f,
+ &pci_ss_info_8086_1229_0e11_b02f,
+ &pci_ss_info_8086_1229_0e11_b04a,
+ &pci_ss_info_8086_1229_0e11_b0c6,
+ &pci_ss_info_8086_1229_0e11_b0c7,
+ &pci_ss_info_8086_1229_0e11_b0d7,
+ &pci_ss_info_8086_1229_0e11_b0dd,
+ &pci_ss_info_8086_1229_0e11_b0de,
+ &pci_ss_info_8086_1229_0e11_b0e1,
+ &pci_ss_info_8086_1229_0e11_b134,
+ &pci_ss_info_8086_1229_0e11_b13c,
+ &pci_ss_info_8086_1229_0e11_b144,
+ &pci_ss_info_8086_1229_0e11_b163,
+ &pci_ss_info_8086_1229_0e11_b164,
+ &pci_ss_info_8086_1229_0e11_b1a4,
+ &pci_ss_info_8086_1229_1014_005c,
+ &pci_ss_info_8086_1229_1014_01bc,
+ &pci_ss_info_8086_1229_1014_01f1,
+ &pci_ss_info_8086_1229_1014_01f2,
+ &pci_ss_info_8086_1229_1014_0207,
+ &pci_ss_info_8086_1229_1014_0232,
+ &pci_ss_info_8086_1229_1014_023a,
+ &pci_ss_info_8086_1229_1014_105c,
+ &pci_ss_info_8086_1229_1014_2205,
+ &pci_ss_info_8086_1229_1014_305c,
+ &pci_ss_info_8086_1229_1014_405c,
+ &pci_ss_info_8086_1229_1014_505c,
+ &pci_ss_info_8086_1229_1014_605c,
+ &pci_ss_info_8086_1229_1014_705c,
+ &pci_ss_info_8086_1229_1014_805c,
+ &pci_ss_info_8086_1229_1028_009b,
+ &pci_ss_info_8086_1229_1033_8000,
+ &pci_ss_info_8086_1229_1033_8016,
+ &pci_ss_info_8086_1229_1033_801f,
+ &pci_ss_info_8086_1229_1033_8026,
+ &pci_ss_info_8086_1229_1033_8063,
+ &pci_ss_info_8086_1229_1033_8064,
+ &pci_ss_info_8086_1229_103c_10c0,
+ &pci_ss_info_8086_1229_103c_10c3,
+ &pci_ss_info_8086_1229_103c_10ca,
+ &pci_ss_info_8086_1229_103c_10cb,
+ &pci_ss_info_8086_1229_103c_10e3,
+ &pci_ss_info_8086_1229_103c_10e4,
+ &pci_ss_info_8086_1229_103c_1200,
+ &pci_ss_info_8086_1229_10c3_1100,
+ &pci_ss_info_8086_1229_10cf_1115,
+ &pci_ss_info_8086_1229_10cf_1143,
+ &pci_ss_info_8086_1229_1179_0001,
+ &pci_ss_info_8086_1229_1179_0002,
+ &pci_ss_info_8086_1229_1179_0003,
+ &pci_ss_info_8086_1229_1259_2560,
+ &pci_ss_info_8086_1229_1259_2561,
+ &pci_ss_info_8086_1229_1266_0001,
+ &pci_ss_info_8086_1229_144d_2501,
+ &pci_ss_info_8086_1229_144d_2502,
+ &pci_ss_info_8086_1229_1668_1100,
+ &pci_ss_info_8086_1229_8086_0001,
+ &pci_ss_info_8086_1229_8086_0002,
+ &pci_ss_info_8086_1229_8086_0003,
+ &pci_ss_info_8086_1229_8086_0004,
+ &pci_ss_info_8086_1229_8086_0005,
+ &pci_ss_info_8086_1229_8086_0006,
+ &pci_ss_info_8086_1229_8086_0007,
+ &pci_ss_info_8086_1229_8086_0008,
+ &pci_ss_info_8086_1229_8086_0009,
+ &pci_ss_info_8086_1229_8086_000a,
+ &pci_ss_info_8086_1229_8086_000b,
+ &pci_ss_info_8086_1229_8086_000c,
+ &pci_ss_info_8086_1229_8086_000d,
+ &pci_ss_info_8086_1229_8086_000e,
+ &pci_ss_info_8086_1229_8086_000f,
+ &pci_ss_info_8086_1229_8086_0010,
+ &pci_ss_info_8086_1229_8086_0011,
+ &pci_ss_info_8086_1229_8086_0012,
+ &pci_ss_info_8086_1229_8086_0013,
+ &pci_ss_info_8086_1229_8086_0030,
+ &pci_ss_info_8086_1229_8086_0031,
+ &pci_ss_info_8086_1229_8086_0040,
+ &pci_ss_info_8086_1229_8086_0041,
+ &pci_ss_info_8086_1229_8086_0042,
+ &pci_ss_info_8086_1229_8086_0050,
+ &pci_ss_info_8086_1229_8086_1009,
+ &pci_ss_info_8086_1229_8086_100c,
+ &pci_ss_info_8086_1229_8086_1012,
+ &pci_ss_info_8086_1229_8086_1013,
+ &pci_ss_info_8086_1229_8086_1015,
+ &pci_ss_info_8086_1229_8086_1017,
+ &pci_ss_info_8086_1229_8086_1030,
+ &pci_ss_info_8086_1229_8086_1040,
+ &pci_ss_info_8086_1229_8086_1041,
+ &pci_ss_info_8086_1229_8086_1042,
+ &pci_ss_info_8086_1229_8086_1050,
+ &pci_ss_info_8086_1229_8086_1051,
+ &pci_ss_info_8086_1229_8086_1052,
+ &pci_ss_info_8086_1229_8086_10f0,
+ &pci_ss_info_8086_1229_8086_2009,
+ &pci_ss_info_8086_1229_8086_200d,
+ &pci_ss_info_8086_1229_8086_200e,
+ &pci_ss_info_8086_1229_8086_200f,
+ &pci_ss_info_8086_1229_8086_2010,
+ &pci_ss_info_8086_1229_8086_2013,
+ &pci_ss_info_8086_1229_8086_2016,
+ &pci_ss_info_8086_1229_8086_2017,
+ &pci_ss_info_8086_1229_8086_2018,
+ &pci_ss_info_8086_1229_8086_2019,
+ &pci_ss_info_8086_1229_8086_2101,
+ &pci_ss_info_8086_1229_8086_2102,
+ &pci_ss_info_8086_1229_8086_2103,
+ &pci_ss_info_8086_1229_8086_2104,
+ &pci_ss_info_8086_1229_8086_2105,
+ &pci_ss_info_8086_1229_8086_2106,
+ &pci_ss_info_8086_1229_8086_2107,
+ &pci_ss_info_8086_1229_8086_2108,
+ &pci_ss_info_8086_1229_8086_2200,
+ &pci_ss_info_8086_1229_8086_2201,
+ &pci_ss_info_8086_1229_8086_2202,
+ &pci_ss_info_8086_1229_8086_2203,
+ &pci_ss_info_8086_1229_8086_2204,
+ &pci_ss_info_8086_1229_8086_2205,
+ &pci_ss_info_8086_1229_8086_2206,
+ &pci_ss_info_8086_1229_8086_2207,
+ &pci_ss_info_8086_1229_8086_2208,
+ &pci_ss_info_8086_1229_8086_2402,
+ &pci_ss_info_8086_1229_8086_2407,
+ &pci_ss_info_8086_1229_8086_2408,
+ &pci_ss_info_8086_1229_8086_2409,
+ &pci_ss_info_8086_1229_8086_240f,
+ &pci_ss_info_8086_1229_8086_2410,
+ &pci_ss_info_8086_1229_8086_2411,
+ &pci_ss_info_8086_1229_8086_2412,
+ &pci_ss_info_8086_1229_8086_2413,
+ &pci_ss_info_8086_1229_8086_3000,
+ &pci_ss_info_8086_1229_8086_3001,
+ &pci_ss_info_8086_1229_8086_3002,
+ &pci_ss_info_8086_1229_8086_3006,
+ &pci_ss_info_8086_1229_8086_3007,
+ &pci_ss_info_8086_1229_8086_3008,
+ &pci_ss_info_8086_1229_8086_3010,
+ &pci_ss_info_8086_1229_8086_3011,
+ &pci_ss_info_8086_1229_8086_3012,
+ NULL
+};
+#define pci_ss_list_8086_122d NULL
+#define pci_ss_list_8086_122e NULL
+#define pci_ss_list_8086_1230 NULL
+#define pci_ss_list_8086_1231 NULL
+#define pci_ss_list_8086_1234 NULL
+#define pci_ss_list_8086_1235 NULL
+#define pci_ss_list_8086_1237 NULL
+#define pci_ss_list_8086_1239 NULL
+#define pci_ss_list_8086_123b NULL
+#define pci_ss_list_8086_123c NULL
+#define pci_ss_list_8086_123d NULL
+#define pci_ss_list_8086_123f NULL
+#define pci_ss_list_8086_1240 NULL
+#define pci_ss_list_8086_124b NULL
+#define pci_ss_list_8086_1250 NULL
+#define pci_ss_list_8086_1360 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1361[] = {
+ &pci_ss_info_8086_1361_8086_1361,
+ &pci_ss_info_8086_1361_8086_8000,
+ NULL
+};
+#define pci_ss_list_8086_1460 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1461[] = {
+ &pci_ss_info_8086_1461_15d9_3480,
+ NULL
+};
+#define pci_ss_list_8086_1462 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_1960[] = {
+ &pci_ss_info_8086_1960_101e_0431,
+ &pci_ss_info_8086_1960_101e_0438,
+ &pci_ss_info_8086_1960_101e_0466,
+ &pci_ss_info_8086_1960_101e_0467,
+ &pci_ss_info_8086_1960_101e_0490,
+ &pci_ss_info_8086_1960_101e_0762,
+ &pci_ss_info_8086_1960_101e_09a0,
+ &pci_ss_info_8086_1960_1028_0467,
+ &pci_ss_info_8086_1960_1028_1111,
+ &pci_ss_info_8086_1960_103c_03a2,
+ &pci_ss_info_8086_1960_103c_10c6,
+ &pci_ss_info_8086_1960_103c_10c7,
+ &pci_ss_info_8086_1960_103c_10cc,
+ &pci_ss_info_8086_1960_103c_10cd,
+ &pci_ss_info_8086_1960_105a_0000,
+ &pci_ss_info_8086_1960_105a_2168,
+ &pci_ss_info_8086_1960_105a_5168,
+ &pci_ss_info_8086_1960_1111_1111,
+ &pci_ss_info_8086_1960_1111_1112,
+ &pci_ss_info_8086_1960_113c_03a2,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_1962[] = {
+ &pci_ss_info_8086_1962_105a_0000,
+ NULL
+};
+#define pci_ss_list_8086_1a21 NULL
+#define pci_ss_list_8086_1a23 NULL
+#define pci_ss_list_8086_1a24 NULL
+#define pci_ss_list_8086_1a30 NULL
+#define pci_ss_list_8086_1a31 NULL
+#define pci_ss_list_8086_2410 NULL
+#define pci_ss_list_8086_2411 NULL
+#define pci_ss_list_8086_2412 NULL
+#define pci_ss_list_8086_2413 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_2415[] = {
+ &pci_ss_info_8086_2415_1028_0095,
+ &pci_ss_info_8086_2415_11d4_0040,
+ &pci_ss_info_8086_2415_11d4_0048,
+ &pci_ss_info_8086_2415_11d4_5340,
+ NULL
+};
+#define pci_ss_list_8086_2416 NULL
+#define pci_ss_list_8086_2418 NULL
+#define pci_ss_list_8086_2420 NULL
+#define pci_ss_list_8086_2421 NULL
+#define pci_ss_list_8086_2422 NULL
+#define pci_ss_list_8086_2423 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_2425[] = {
+ &pci_ss_info_8086_2425_11d4_0040,
+ &pci_ss_info_8086_2425_11d4_0048,
+ NULL
+};
+#define pci_ss_list_8086_2426 NULL
+#define pci_ss_list_8086_2428 NULL
+#define pci_ss_list_8086_2440 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_2442[] = {
+ &pci_ss_info_8086_2442_1014_01c6,
+ &pci_ss_info_8086_2442_1025_1016,
+ &pci_ss_info_8086_2442_104d_80df,
+ &pci_ss_info_8086_2442_147b_0507,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2443[] = {
+ &pci_ss_info_8086_2443_1014_01c6,
+ &pci_ss_info_8086_2443_1025_1016,
+ &pci_ss_info_8086_2443_1043_8027,
+ &pci_ss_info_8086_2443_104d_80df,
+ &pci_ss_info_8086_2443_147b_0507,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2444[] = {
+ &pci_ss_info_8086_2444_1025_1016,
+ &pci_ss_info_8086_2444_104d_80df,
+ &pci_ss_info_8086_2444_147b_0507,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2445[] = {
+ &pci_ss_info_8086_2445_1014_01c6,
+ &pci_ss_info_8086_2445_1025_1016,
+ &pci_ss_info_8086_2445_104d_80df,
+ &pci_ss_info_8086_2445_1462_3370,
+ &pci_ss_info_8086_2445_147b_0507,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2446[] = {
+ &pci_ss_info_8086_2446_1025_1016,
+ &pci_ss_info_8086_2446_104d_80df,
+ NULL
+};
+#define pci_ss_list_8086_2448 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_2449[] = {
+ &pci_ss_info_8086_2449_0e11_0012,
+ &pci_ss_info_8086_2449_0e11_0091,
+ &pci_ss_info_8086_2449_1014_01ce,
+ &pci_ss_info_8086_2449_1014_01dc,
+ &pci_ss_info_8086_2449_1014_01eb,
+ &pci_ss_info_8086_2449_1014_01ec,
+ &pci_ss_info_8086_2449_1014_0202,
+ &pci_ss_info_8086_2449_1014_0205,
+ &pci_ss_info_8086_2449_1014_0217,
+ &pci_ss_info_8086_2449_1014_0234,
+ &pci_ss_info_8086_2449_1014_023d,
+ &pci_ss_info_8086_2449_1014_0244,
+ &pci_ss_info_8086_2449_1014_0245,
+ &pci_ss_info_8086_2449_109f_315d,
+ &pci_ss_info_8086_2449_109f_3181,
+ &pci_ss_info_8086_2449_1186_7801,
+ &pci_ss_info_8086_2449_144d_2602,
+ &pci_ss_info_8086_2449_8086_3010,
+ &pci_ss_info_8086_2449_8086_3011,
+ &pci_ss_info_8086_2449_8086_3012,
+ &pci_ss_info_8086_2449_8086_3013,
+ &pci_ss_info_8086_2449_8086_3014,
+ &pci_ss_info_8086_2449_8086_3015,
+ &pci_ss_info_8086_2449_8086_3016,
+ &pci_ss_info_8086_2449_8086_3017,
+ &pci_ss_info_8086_2449_8086_3018,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_244a[] = {
+ &pci_ss_info_8086_244a_1025_1016,
+ &pci_ss_info_8086_244a_104d_80df,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_244b[] = {
+ &pci_ss_info_8086_244b_1014_01c6,
+ &pci_ss_info_8086_244b_1043_8027,
+ &pci_ss_info_8086_244b_147b_0507,
+ NULL
+};
+#define pci_ss_list_8086_244c NULL
+#define pci_ss_list_8086_244e NULL
+#define pci_ss_list_8086_2450 NULL
+#define pci_ss_list_8086_2452 NULL
+#define pci_ss_list_8086_2453 NULL
+#define pci_ss_list_8086_2459 NULL
+#define pci_ss_list_8086_245b NULL
+#define pci_ss_list_8086_245d NULL
+#define pci_ss_list_8086_245e NULL
+#define pci_ss_list_8086_2480 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_2482[] = {
+ &pci_ss_info_8086_2482_1014_0220,
+ &pci_ss_info_8086_2482_104d_80e7,
+ &pci_ss_info_8086_2482_15d9_3480,
+ &pci_ss_info_8086_2482_8086_1958,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2483[] = {
+ &pci_ss_info_8086_2483_1014_0220,
+ &pci_ss_info_8086_2483_104d_80e7,
+ &pci_ss_info_8086_2483_15d9_3480,
+ &pci_ss_info_8086_2483_8086_1958,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2484[] = {
+ &pci_ss_info_8086_2484_1014_0220,
+ &pci_ss_info_8086_2484_104d_80e7,
+ &pci_ss_info_8086_2484_15d9_3480,
+ &pci_ss_info_8086_2484_8086_1958,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2485[] = {
+ &pci_ss_info_8086_2485_1014_0222,
+ &pci_ss_info_8086_2485_1014_0508,
+ &pci_ss_info_8086_2485_1014_051c,
+ &pci_ss_info_8086_2485_104d_80e7,
+ &pci_ss_info_8086_2485_144d_c006,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2486[] = {
+ &pci_ss_info_8086_2486_1014_0223,
+ &pci_ss_info_8086_2486_1014_0503,
+ &pci_ss_info_8086_2486_1014_051a,
+ &pci_ss_info_8086_2486_104d_80e7,
+ &pci_ss_info_8086_2486_1179_0001,
+ &pci_ss_info_8086_2486_134d_4c21,
+ &pci_ss_info_8086_2486_144d_2115,
+ &pci_ss_info_8086_2486_14f1_5421,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2487[] = {
+ &pci_ss_info_8086_2487_1014_0220,
+ &pci_ss_info_8086_2487_104d_80e7,
+ &pci_ss_info_8086_2487_15d9_3480,
+ &pci_ss_info_8086_2487_8086_1958,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_248a[] = {
+ &pci_ss_info_8086_248a_1014_0220,
+ &pci_ss_info_8086_248a_104d_80e7,
+ &pci_ss_info_8086_248a_8086_1958,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_248b[] = {
+ &pci_ss_info_8086_248b_15d9_3480,
+ NULL
+};
+#define pci_ss_list_8086_248c NULL
+static const pciSubsystemInfo *pci_ss_list_8086_24c0[] = {
+ &pci_ss_info_8086_24c0_1462_5800,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_24c2[] = {
+ &pci_ss_info_8086_24c2_1462_5800,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_24c3[] = {
+ &pci_ss_info_8086_24c3_1462_5800,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_24c4[] = {
+ &pci_ss_info_8086_24c4_1462_5800,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_24c5[] = {
+ &pci_ss_info_8086_24c5_1462_5800,
+ NULL
+};
+#define pci_ss_list_8086_24c6 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_24c7[] = {
+ &pci_ss_info_8086_24c7_1462_5800,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_24cb[] = {
+ &pci_ss_info_8086_24cb_1462_5800,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_24cd[] = {
+ &pci_ss_info_8086_24cd_1462_3981,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2500[] = {
+ &pci_ss_info_8086_2500_1028_0095,
+ &pci_ss_info_8086_2500_1043_801c,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2501[] = {
+ &pci_ss_info_8086_2501_1043_801c,
+ NULL
+};
+#define pci_ss_list_8086_250b NULL
+#define pci_ss_list_8086_250f NULL
+#define pci_ss_list_8086_2520 NULL
+#define pci_ss_list_8086_2521 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_2530[] = {
+ &pci_ss_info_8086_2530_147b_0507,
+ NULL
+};
+#define pci_ss_list_8086_2531 NULL
+#define pci_ss_list_8086_2532 NULL
+#define pci_ss_list_8086_2533 NULL
+#define pci_ss_list_8086_2534 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_2540[] = {
+ &pci_ss_info_8086_2540_15d9_3480,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_8086_2541[] = {
+ &pci_ss_info_8086_2541_15d9_3480,
+ NULL
+};
+#define pci_ss_list_8086_2543 NULL
+#define pci_ss_list_8086_2544 NULL
+#define pci_ss_list_8086_2545 NULL
+#define pci_ss_list_8086_2546 NULL
+#define pci_ss_list_8086_2547 NULL
+#define pci_ss_list_8086_2548 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_2560[] = {
+ &pci_ss_info_8086_2560_1462_5800,
+ NULL
+};
+#define pci_ss_list_8086_2561 NULL
+#define pci_ss_list_8086_2562 NULL
+#define pci_ss_list_8086_2570 NULL
+#define pci_ss_list_8086_2572 NULL
+#define pci_ss_list_8086_3092 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_3575[] = {
+ &pci_ss_info_8086_3575_1014_021d,
+ &pci_ss_info_8086_3575_104d_80e7,
+ NULL
+};
+#define pci_ss_list_8086_3576 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_3577[] = {
+ &pci_ss_info_8086_3577_1014_0513,
+ NULL
+};
+#define pci_ss_list_8086_3578 NULL
+#define pci_ss_list_8086_3580 NULL
+#define pci_ss_list_8086_3582 NULL
+#define pci_ss_list_8086_5200 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_5201[] = {
+ &pci_ss_info_8086_5201_8086_0001,
+ NULL
+};
+#define pci_ss_list_8086_530d NULL
+#define pci_ss_list_8086_7000 NULL
+#define pci_ss_list_8086_7010 NULL
+#define pci_ss_list_8086_7020 NULL
+#define pci_ss_list_8086_7030 NULL
+#define pci_ss_list_8086_7100 NULL
+#define pci_ss_list_8086_7110 NULL
+#define pci_ss_list_8086_7111 NULL
+#define pci_ss_list_8086_7112 NULL
+#define pci_ss_list_8086_7113 NULL
+#define pci_ss_list_8086_7120 NULL
+#define pci_ss_list_8086_7121 NULL
+#define pci_ss_list_8086_7122 NULL
+#define pci_ss_list_8086_7123 NULL
+#define pci_ss_list_8086_7124 NULL
+#define pci_ss_list_8086_7125 NULL
+#define pci_ss_list_8086_7126 NULL
+#define pci_ss_list_8086_7128 NULL
+#define pci_ss_list_8086_712a NULL
+#define pci_ss_list_8086_7180 NULL
+#define pci_ss_list_8086_7181 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_7190[] = {
+ &pci_ss_info_8086_7190_0e11_0500,
+ &pci_ss_info_8086_7190_0e11_b110,
+ &pci_ss_info_8086_7190_1179_0001,
+ NULL
+};
+#define pci_ss_list_8086_7191 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_7192[] = {
+ &pci_ss_info_8086_7192_0e11_0460,
+ NULL
+};
+#define pci_ss_list_8086_7194 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_7195[] = {
+ &pci_ss_info_8086_7195_10cf_1099,
+ &pci_ss_info_8086_7195_11d4_0040,
+ &pci_ss_info_8086_7195_11d4_0048,
+ NULL
+};
+#define pci_ss_list_8086_7196 NULL
+#define pci_ss_list_8086_7198 NULL
+#define pci_ss_list_8086_7199 NULL
+#define pci_ss_list_8086_719a NULL
+#define pci_ss_list_8086_719b NULL
+#define pci_ss_list_8086_71a0 NULL
+#define pci_ss_list_8086_71a1 NULL
+#define pci_ss_list_8086_71a2 NULL
+#define pci_ss_list_8086_7600 NULL
+#define pci_ss_list_8086_7601 NULL
+#define pci_ss_list_8086_7602 NULL
+#define pci_ss_list_8086_7603 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_7800[] = {
+ &pci_ss_info_8086_7800_003d_0008,
+ &pci_ss_info_8086_7800_003d_000b,
+ &pci_ss_info_8086_7800_1092_0100,
+ &pci_ss_info_8086_7800_10b4_201a,
+ &pci_ss_info_8086_7800_10b4_202f,
+ &pci_ss_info_8086_7800_8086_0000,
+ &pci_ss_info_8086_7800_8086_0100,
+ NULL
+};
+#define pci_ss_list_8086_84c4 NULL
+#define pci_ss_list_8086_84c5 NULL
+#define pci_ss_list_8086_84ca NULL
+#define pci_ss_list_8086_84cb NULL
+#define pci_ss_list_8086_84e0 NULL
+#define pci_ss_list_8086_84e1 NULL
+#define pci_ss_list_8086_84e2 NULL
+#define pci_ss_list_8086_84e3 NULL
+#define pci_ss_list_8086_84e4 NULL
+#define pci_ss_list_8086_84e6 NULL
+#define pci_ss_list_8086_84ea NULL
+#define pci_ss_list_8086_9621 NULL
+#define pci_ss_list_8086_9622 NULL
+#define pci_ss_list_8086_9641 NULL
+#define pci_ss_list_8086_96a1 NULL
+#define pci_ss_list_8086_b152 NULL
+#define pci_ss_list_8086_b154 NULL
+static const pciSubsystemInfo *pci_ss_list_8086_b555[] = {
+ &pci_ss_info_8086_b555_e4bf_1000,
+ NULL
+};
+#define pci_ss_list_8086_ffff NULL
+#define pci_ss_list_8800_2008 NULL
+#define pci_ss_list_8e2e_3000 NULL
+#define pci_ss_list_9004_1078 NULL
+#define pci_ss_list_9004_1160 NULL
+#define pci_ss_list_9004_2178 NULL
+#define pci_ss_list_9004_3860 NULL
+#define pci_ss_list_9004_3b78 NULL
+#define pci_ss_list_9004_5075 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_9004_5078[] = {
+ &pci_ss_info_9004_5078_9004_7850,
+ NULL
+};
+#define pci_ss_list_9004_5175 NULL
+#define pci_ss_list_9004_5178 NULL
+#define pci_ss_list_9004_5275 NULL
+#define pci_ss_list_9004_5278 NULL
+#define pci_ss_list_9004_5375 NULL
+#define pci_ss_list_9004_5378 NULL
+#define pci_ss_list_9004_5475 NULL
+#define pci_ss_list_9004_5478 NULL
+#define pci_ss_list_9004_5575 NULL
+#define pci_ss_list_9004_5578 NULL
+static const pciSubsystemInfo *pci_ss_list_9004_5647[] = {
+ &pci_ss_info_9004_5647_9004_7710,
+ &pci_ss_info_9004_5647_9004_7711,
+ NULL
+};
+#define pci_ss_list_9004_5675 NULL
+#define pci_ss_list_9004_5678 NULL
+#define pci_ss_list_9004_5775 NULL
+#define pci_ss_list_9004_5778 NULL
+#define pci_ss_list_9004_5800 NULL
+#define pci_ss_list_9004_5900 NULL
+#define pci_ss_list_9004_5905 NULL
+#define pci_ss_list_9004_6038 NULL
+static const pciSubsystemInfo *pci_ss_list_9004_6075[] = {
+ &pci_ss_info_9004_6075_9004_7560,
+ NULL
+};
+#define pci_ss_list_9004_6078 NULL
+static const pciSubsystemInfo *pci_ss_list_9004_6178[] = {
+ &pci_ss_info_9004_6178_9004_7861,
+ NULL
+};
+#define pci_ss_list_9004_6278 NULL
+#define pci_ss_list_9004_6378 NULL
+#define pci_ss_list_9004_6478 NULL
+#define pci_ss_list_9004_6578 NULL
+#define pci_ss_list_9004_6678 NULL
+#define pci_ss_list_9004_6778 NULL
+static const pciSubsystemInfo *pci_ss_list_9004_6915[] = {
+ &pci_ss_info_9004_6915_9004_0008,
+ &pci_ss_info_9004_6915_9004_0009,
+ &pci_ss_info_9004_6915_9004_0010,
+ &pci_ss_info_9004_6915_9004_0018,
+ &pci_ss_info_9004_6915_9004_0019,
+ &pci_ss_info_9004_6915_9004_0020,
+ &pci_ss_info_9004_6915_9004_0028,
+ &pci_ss_info_9004_6915_9004_8008,
+ &pci_ss_info_9004_6915_9004_8009,
+ &pci_ss_info_9004_6915_9004_8010,
+ &pci_ss_info_9004_6915_9004_8018,
+ &pci_ss_info_9004_6915_9004_8019,
+ &pci_ss_info_9004_6915_9004_8020,
+ &pci_ss_info_9004_6915_9004_8028,
+ NULL
+};
+#define pci_ss_list_9004_7078 NULL
+#define pci_ss_list_9004_7178 NULL
+#define pci_ss_list_9004_7278 NULL
+#define pci_ss_list_9004_7378 NULL
+#define pci_ss_list_9004_7478 NULL
+#define pci_ss_list_9004_7578 NULL
+#define pci_ss_list_9004_7678 NULL
+#define pci_ss_list_9004_7778 NULL
+#define pci_ss_list_9004_7810 NULL
+static const pciSubsystemInfo *pci_ss_list_9004_7815[] = {
+ &pci_ss_info_9004_7815_9004_7815,
+ &pci_ss_info_9004_7815_9004_7840,
+ NULL
+};
+#define pci_ss_list_9004_7850 NULL
+#define pci_ss_list_9004_7855 NULL
+#define pci_ss_list_9004_7860 NULL
+#define pci_ss_list_9004_7870 NULL
+#define pci_ss_list_9004_7871 NULL
+#define pci_ss_list_9004_7872 NULL
+#define pci_ss_list_9004_7873 NULL
+#define pci_ss_list_9004_7874 NULL
+#define pci_ss_list_9004_7880 NULL
+#define pci_ss_list_9004_7890 NULL
+#define pci_ss_list_9004_7891 NULL
+#define pci_ss_list_9004_7892 NULL
+#define pci_ss_list_9004_7893 NULL
+#define pci_ss_list_9004_7894 NULL
+static const pciSubsystemInfo *pci_ss_list_9004_7895[] = {
+ &pci_ss_info_9004_7895_9004_7890,
+ &pci_ss_info_9004_7895_9004_7891,
+ &pci_ss_info_9004_7895_9004_7892,
+ &pci_ss_info_9004_7895_9004_7894,
+ &pci_ss_info_9004_7895_9004_7895,
+ &pci_ss_info_9004_7895_9004_7896,
+ &pci_ss_info_9004_7895_9004_7897,
+ NULL
+};
+#define pci_ss_list_9004_7896 NULL
+#define pci_ss_list_9004_7897 NULL
+static const pciSubsystemInfo *pci_ss_list_9004_8078[] = {
+ &pci_ss_info_9004_8078_9004_7880,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9004_8178[] = {
+ &pci_ss_info_9004_8178_9004_7881,
+ NULL
+};
+#define pci_ss_list_9004_8278 NULL
+#define pci_ss_list_9004_8378 NULL
+#define pci_ss_list_9004_8478 NULL
+#define pci_ss_list_9004_8578 NULL
+#define pci_ss_list_9004_8678 NULL
+static const pciSubsystemInfo *pci_ss_list_9004_8778[] = {
+ &pci_ss_info_9004_8778_9004_7887,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9004_8878[] = {
+ &pci_ss_info_9004_8878_9004_7888,
+ NULL
+};
+#define pci_ss_list_9004_8b78 NULL
+#define pci_ss_list_9004_ec78 NULL
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_9005_0010[] = {
+ &pci_ss_info_9005_0010_9005_2180,
+ &pci_ss_info_9005_0010_9005_8100,
+ &pci_ss_info_9005_0010_9005_a180,
+ &pci_ss_info_9005_0010_9005_e100,
+ NULL
+};
+#define pci_ss_list_9005_0011 NULL
+static const pciSubsystemInfo *pci_ss_list_9005_0013[] = {
+ &pci_ss_info_9005_0013_9005_0003,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9005_001f[] = {
+ &pci_ss_info_9005_001f_9005_000f,
+ &pci_ss_info_9005_001f_9005_a180,
+ NULL
+};
+#define pci_ss_list_9005_0020 NULL
+#define pci_ss_list_9005_002f NULL
+#define pci_ss_list_9005_0030 NULL
+#define pci_ss_list_9005_003f NULL
+static const pciSubsystemInfo *pci_ss_list_9005_0050[] = {
+ &pci_ss_info_9005_0050_9005_f500,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9005_0051[] = {
+ &pci_ss_info_9005_0051_9005_b500,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9005_0053[] = {
+ &pci_ss_info_9005_0053_9005_ffff,
+ NULL
+};
+#define pci_ss_list_9005_005f NULL
+static const pciSubsystemInfo *pci_ss_list_9005_0080[] = {
+ &pci_ss_info_9005_0080_0e11_e2a0,
+ &pci_ss_info_9005_0080_9005_62a0,
+ &pci_ss_info_9005_0080_9005_e220,
+ &pci_ss_info_9005_0080_9005_e2a0,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9005_0081[] = {
+ &pci_ss_info_9005_0081_9005_62a1,
+ NULL
+};
+#define pci_ss_list_9005_0083 NULL
+static const pciSubsystemInfo *pci_ss_list_9005_008f[] = {
+ &pci_ss_info_9005_008f_1179_0001,
+ &pci_ss_info_9005_008f_15d9_9005,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9005_00c0[] = {
+ &pci_ss_info_9005_00c0_0e11_f620,
+ &pci_ss_info_9005_00c0_9005_f620,
+ NULL
+};
+#define pci_ss_list_9005_00c1 NULL
+#define pci_ss_list_9005_00c3 NULL
+static const pciSubsystemInfo *pci_ss_list_9005_00c5[] = {
+ &pci_ss_info_9005_00c5_1028_00c5,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9005_00cf[] = {
+ &pci_ss_info_9005_00cf_1028_00d1,
+ &pci_ss_info_9005_00cf_10f1_2462,
+ &pci_ss_info_9005_00cf_15d9_9005,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9005_0250[] = {
+ &pci_ss_info_9005_0250_1014_0279,
+ &pci_ss_info_9005_0250_1014_028c,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_9005_0285[] = {
+ &pci_ss_info_9005_0285_1028_0287,
+ NULL
+};
+#define pci_ss_list_9005_8000 NULL
+#define pci_ss_list_9005_800f NULL
+#define pci_ss_list_9005_8010 NULL
+static const pciSubsystemInfo *pci_ss_list_9005_8011[] = {
+ &pci_ss_info_9005_8011_0e11_00ac,
+ &pci_ss_info_9005_8011_9005_0041,
+ NULL
+};
+#define pci_ss_list_9005_8012 NULL
+#define pci_ss_list_9005_8013 NULL
+#define pci_ss_list_9005_8014 NULL
+#define pci_ss_list_9005_801e NULL
+#define pci_ss_list_9005_801f NULL
+#define pci_ss_list_9005_8090 NULL
+#define pci_ss_list_9005_8091 NULL
+#define pci_ss_list_9005_8092 NULL
+#define pci_ss_list_9005_8093 NULL
+#define pci_ss_list_9005_8094 NULL
+#define pci_ss_list_9005_809e NULL
+#define pci_ss_list_9005_809f NULL
+#endif
+#define pci_ss_list_907f_2015 NULL
+#define pci_ss_list_9412_6565 NULL
+#define pci_ss_list_9699_6565 NULL
+#define pci_ss_list_9710_9815 NULL
+#define pci_ss_list_9710_9835 NULL
+#define pci_ss_list_cddd_0101 NULL
+#define pci_ss_list_cddd_0200 NULL
+#define pci_ss_list_d4d4_0601 NULL
+#define pci_ss_list_e000_e000 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_e159_0001[] = {
+ &pci_ss_info_e159_0001_0059_0001,
+ &pci_ss_info_e159_0001_0059_0003,
+ NULL
+};
+#define pci_ss_list_e159_0002 NULL
+#endif
+#define pci_ss_list_ea60_9896 NULL
+#define pci_ss_list_ea60_9897 NULL
+#define pci_ss_list_ea60_9898 NULL
+#define pci_ss_list_eace_3100 NULL
+#define pci_ss_list_eace_3200 NULL
+#define pci_ss_list_eace_320e NULL
+#define pci_ss_list_eace_340e NULL
+#define pci_ss_list_eace_341e NULL
+#define pci_ss_list_eace_3500 NULL
+#define pci_ss_list_eace_351c NULL
+#define pci_ss_list_eace_4100 NULL
+#define pci_ss_list_eace_4110 NULL
+#define pci_ss_list_eace_4220 NULL
+#define pci_ss_list_eace_422e NULL
+#define pci_ss_list_ec80_ec00 NULL
+#define pci_ss_list_ecc0_0050 NULL
+#define pci_ss_list_ecc0_0051 NULL
+#define pci_ss_list_ecc0_0060 NULL
+#define pci_ss_list_ecc0_0070 NULL
+#define pci_ss_list_ecc0_0071 NULL
+#define pci_ss_list_ecc0_0072 NULL
+#define pci_ss_list_ecc0_0080 NULL
+#define pci_ss_list_edd8_a091 NULL
+#define pci_ss_list_edd8_a099 NULL
+#define pci_ss_list_edd8_a0a1 NULL
+#define pci_ss_list_edd8_a0a9 NULL
+#define pci_ss_list_f1d0_cafe NULL
+#define pci_ss_list_f1d0_efac NULL
+#define pci_ss_list_f1d0_facd NULL
+#define pci_ss_list_feda_a0fa NULL
+#define pci_ss_list_feda_a10e NULL
+#define pci_ss_list_fffe_0710 NULL
+#ifdef INIT_VENDOR_SUBSYS_INFO
+#define pci_ss_list_0000 NULL
+#define pci_ss_list_001a NULL
+#define pci_ss_list_0033 NULL
+static const pciSubsystemInfo *pci_ss_list_003d[] = {
+ &pci_ss_info_003d_0008,
+ &pci_ss_info_003d_000b,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_0059[] = {
+ &pci_ss_info_0059_0001,
+ &pci_ss_info_0059_0003,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_0070[] = {
+ &pci_ss_info_0070_13eb,
+ &pci_ss_info_0070_ff01,
+ NULL
+};
+#endif
+#define pci_ss_list_0100 NULL
+#define pci_ss_list_0675 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_0925[] = {
+ &pci_ss_info_0925_1234,
+ NULL
+};
+#endif
+#define pci_ss_list_09c1 NULL
+#define pci_ss_list_0a89 NULL
+static const pciSubsystemInfo *pci_ss_list_0e11[] = {
+ &pci_ss_info_0e11_0012,
+ &pci_ss_info_0e11_0022,
+ &pci_ss_info_0e11_0023,
+ &pci_ss_info_0e11_0024,
+ &pci_ss_info_0e11_0042,
+ &pci_ss_info_0e11_0043,
+ &pci_ss_info_0e11_0049,
+ &pci_ss_info_0e11_004a,
+ &pci_ss_info_0e11_005d,
+ &pci_ss_info_0e11_007c,
+ &pci_ss_info_0e11_007d,
+ &pci_ss_info_0e11_007e,
+ &pci_ss_info_0e11_0085,
+ &pci_ss_info_0e11_0091,
+ &pci_ss_info_0e11_0099,
+ &pci_ss_info_0e11_009a,
+ &pci_ss_info_0e11_00ac,
+ &pci_ss_info_0e11_00bb,
+ &pci_ss_info_0e11_00c1,
+ &pci_ss_info_0e11_00ca,
+ &pci_ss_info_0e11_00cb,
+ &pci_ss_info_0e11_00cf,
+ &pci_ss_info_0e11_00d0,
+ &pci_ss_info_0e11_00d1,
+ &pci_ss_info_0e11_0460,
+ &pci_ss_info_0e11_0500,
+ &pci_ss_info_0e11_3001,
+ &pci_ss_info_0e11_3002,
+ &pci_ss_info_0e11_3003,
+ &pci_ss_info_0e11_3004,
+ &pci_ss_info_0e11_3005,
+ &pci_ss_info_0e11_3006,
+ &pci_ss_info_0e11_3007,
+ &pci_ss_info_0e11_4030,
+ &pci_ss_info_0e11_4031,
+ &pci_ss_info_0e11_4032,
+ &pci_ss_info_0e11_4033,
+ &pci_ss_info_0e11_4040,
+ &pci_ss_info_0e11_4048,
+ &pci_ss_info_0e11_4050,
+ &pci_ss_info_0e11_4051,
+ &pci_ss_info_0e11_4058,
+ &pci_ss_info_0e11_7004,
+ &pci_ss_info_0e11_b01e,
+ &pci_ss_info_0e11_b01f,
+ &pci_ss_info_0e11_b02f,
+ &pci_ss_info_0e11_b032,
+ &pci_ss_info_0e11_b03b,
+ &pci_ss_info_0e11_b03c,
+ &pci_ss_info_0e11_b03d,
+ &pci_ss_info_0e11_b03e,
+ &pci_ss_info_0e11_b03f,
+ &pci_ss_info_0e11_b049,
+ &pci_ss_info_0e11_b04a,
+ &pci_ss_info_0e11_b0bc,
+ &pci_ss_info_0e11_b0c6,
+ &pci_ss_info_0e11_b0c7,
+ &pci_ss_info_0e11_b0d1,
+ &pci_ss_info_0e11_b0d7,
+ &pci_ss_info_0e11_b0dd,
+ &pci_ss_info_0e11_b0de,
+ &pci_ss_info_0e11_b0df,
+ &pci_ss_info_0e11_b0e0,
+ &pci_ss_info_0e11_b0e1,
+ &pci_ss_info_0e11_b0e8,
+ &pci_ss_info_0e11_b0fd,
+ &pci_ss_info_0e11_b10e,
+ &pci_ss_info_0e11_b110,
+ &pci_ss_info_0e11_b111,
+ &pci_ss_info_0e11_b112,
+ &pci_ss_info_0e11_b113,
+ &pci_ss_info_0e11_b114,
+ &pci_ss_info_0e11_b123,
+ &pci_ss_info_0e11_b126,
+ &pci_ss_info_0e11_b134,
+ &pci_ss_info_0e11_b13c,
+ &pci_ss_info_0e11_b144,
+ &pci_ss_info_0e11_b14d,
+ &pci_ss_info_0e11_b15a,
+ &pci_ss_info_0e11_b163,
+ &pci_ss_info_0e11_b164,
+ &pci_ss_info_0e11_b16e,
+ &pci_ss_info_0e11_b16f,
+ &pci_ss_info_0e11_b194,
+ &pci_ss_info_0e11_b195,
+ &pci_ss_info_0e11_b196,
+ &pci_ss_info_0e11_b1a4,
+ &pci_ss_info_0e11_b1a7,
+ &pci_ss_info_0e11_b1be,
+ &pci_ss_info_0e11_e2a0,
+ &pci_ss_info_0e11_f620,
+ NULL
+};
+#define pci_ss_list_0e55 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1000[] = {
+ &pci_ss_info_1000_1000,
+ NULL
+};
+#endif
+#define pci_ss_list_1001 NULL
+static const pciSubsystemInfo *pci_ss_list_1002[] = {
+ &pci_ss_info_1002_0001,
+ &pci_ss_info_1002_0002,
+ &pci_ss_info_1002_0003,
+ &pci_ss_info_1002_0004,
+ &pci_ss_info_1002_0008,
+ &pci_ss_info_1002_0009,
+ &pci_ss_info_1002_000a,
+ &pci_ss_info_1002_000b,
+ &pci_ss_info_1002_0014,
+ &pci_ss_info_1002_0018,
+ &pci_ss_info_1002_001a,
+ &pci_ss_info_1002_001c,
+ &pci_ss_info_1002_0028,
+ &pci_ss_info_1002_0029,
+ &pci_ss_info_1002_002a,
+ &pci_ss_info_1002_002b,
+ &pci_ss_info_1002_0038,
+ &pci_ss_info_1002_0039,
+ &pci_ss_info_1002_003a,
+ &pci_ss_info_1002_0040,
+ &pci_ss_info_1002_0044,
+ &pci_ss_info_1002_0048,
+ &pci_ss_info_1002_0061,
+ &pci_ss_info_1002_0062,
+ &pci_ss_info_1002_0063,
+ &pci_ss_info_1002_0068,
+ &pci_ss_info_1002_0080,
+ &pci_ss_info_1002_0084,
+ &pci_ss_info_1002_0087,
+ &pci_ss_info_1002_0088,
+ &pci_ss_info_1002_008a,
+ &pci_ss_info_1002_00ba,
+ &pci_ss_info_1002_010a,
+ &pci_ss_info_1002_0139,
+ &pci_ss_info_1002_013a,
+ &pci_ss_info_1002_0152,
+ &pci_ss_info_1002_0162,
+ &pci_ss_info_1002_0172,
+ &pci_ss_info_1002_028a,
+ &pci_ss_info_1002_02aa,
+ &pci_ss_info_1002_0448,
+ &pci_ss_info_1002_053a,
+ &pci_ss_info_1002_2000,
+ &pci_ss_info_1002_2001,
+ &pci_ss_info_1002_4742,
+ &pci_ss_info_1002_4744,
+ &pci_ss_info_1002_474d,
+ &pci_ss_info_1002_474e,
+ &pci_ss_info_1002_474f,
+ &pci_ss_info_1002_4750,
+ &pci_ss_info_1002_4752,
+ &pci_ss_info_1002_4753,
+ &pci_ss_info_1002_4756,
+ &pci_ss_info_1002_4757,
+ &pci_ss_info_1002_475a,
+ &pci_ss_info_1002_4c42,
+ &pci_ss_info_1002_4c49,
+ &pci_ss_info_1002_4c50,
+ &pci_ss_info_1002_5654,
+ &pci_ss_info_1002_8001,
+ &pci_ss_info_1002_8008,
+ NULL
+};
+#define pci_ss_list_1003 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1004[] = {
+ &pci_ss_info_1004_0304,
+ &pci_ss_info_1004_0305,
+ &pci_ss_info_1004_0306,
+ NULL
+};
+#endif
+#define pci_ss_list_1005 NULL
+#define pci_ss_list_1006 NULL
+#define pci_ss_list_1007 NULL
+#define pci_ss_list_1008 NULL
+#define pci_ss_list_100a NULL
+#define pci_ss_list_100b NULL
+#define pci_ss_list_100c NULL
+#define pci_ss_list_100d NULL
+#define pci_ss_list_100e NULL
+static const pciSubsystemInfo *pci_ss_list_1010[] = {
+ &pci_ss_info_1010_0020,
+ &pci_ss_info_1010_0080,
+ &pci_ss_info_1010_0088,
+ &pci_ss_info_1010_0090,
+ &pci_ss_info_1010_0098,
+ &pci_ss_info_1010_00a0,
+ &pci_ss_info_1010_00a8,
+ &pci_ss_info_1010_0120,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1011[] = {
+ &pci_ss_info_1011_4d10,
+ &pci_ss_info_1011_500a,
+ &pci_ss_info_1011_500b,
+ NULL
+};
+#define pci_ss_list_1012 NULL
+static const pciSubsystemInfo *pci_ss_list_1013[] = {
+ &pci_ss_info_1013_00bc,
+ &pci_ss_info_1013_4280,
+ &pci_ss_info_1013_4281,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1014[] = {
+ &pci_ss_info_1014_0001,
+ &pci_ss_info_1014_002e,
+ &pci_ss_info_1014_003e,
+ &pci_ss_info_1014_005c,
+ &pci_ss_info_1014_008e,
+ &pci_ss_info_1014_0097,
+ &pci_ss_info_1014_0098,
+ &pci_ss_info_1014_0099,
+ &pci_ss_info_1014_00ba,
+ &pci_ss_info_1014_00cd,
+ &pci_ss_info_1014_00ce,
+ &pci_ss_info_1014_00cf,
+ &pci_ss_info_1014_00db,
+ &pci_ss_info_1014_00dd,
+ &pci_ss_info_1014_00e4,
+ &pci_ss_info_1014_00e5,
+ &pci_ss_info_1014_0119,
+ &pci_ss_info_1014_0131,
+ &pci_ss_info_1014_0143,
+ &pci_ss_info_1014_0145,
+ &pci_ss_info_1014_0154,
+ &pci_ss_info_1014_0166,
+ &pci_ss_info_1014_016d,
+ &pci_ss_info_1014_017f,
+ &pci_ss_info_1014_0181,
+ &pci_ss_info_1014_0182,
+ &pci_ss_info_1014_0183,
+ &pci_ss_info_1014_0184,
+ &pci_ss_info_1014_0185,
+ &pci_ss_info_1014_01b6,
+ &pci_ss_info_1014_01b7,
+ &pci_ss_info_1014_01bc,
+ &pci_ss_info_1014_01be,
+ &pci_ss_info_1014_01bf,
+ &pci_ss_info_1014_01c6,
+ &pci_ss_info_1014_01ce,
+ &pci_ss_info_1014_01cf,
+ &pci_ss_info_1014_01dc,
+ &pci_ss_info_1014_01ea,
+ &pci_ss_info_1014_01eb,
+ &pci_ss_info_1014_01ec,
+ &pci_ss_info_1014_01f1,
+ &pci_ss_info_1014_01f2,
+ &pci_ss_info_1014_01fc,
+ &pci_ss_info_1014_0202,
+ &pci_ss_info_1014_0205,
+ &pci_ss_info_1014_0207,
+ &pci_ss_info_1014_0208,
+ &pci_ss_info_1014_0209,
+ &pci_ss_info_1014_020e,
+ &pci_ss_info_1014_0217,
+ &pci_ss_info_1014_021d,
+ &pci_ss_info_1014_0220,
+ &pci_ss_info_1014_0222,
+ &pci_ss_info_1014_0223,
+ &pci_ss_info_1014_022e,
+ &pci_ss_info_1014_0232,
+ &pci_ss_info_1014_0234,
+ &pci_ss_info_1014_0235,
+ &pci_ss_info_1014_0239,
+ &pci_ss_info_1014_023a,
+ &pci_ss_info_1014_023b,
+ &pci_ss_info_1014_023d,
+ &pci_ss_info_1014_0244,
+ &pci_ss_info_1014_0245,
+ &pci_ss_info_1014_0258,
+ &pci_ss_info_1014_0259,
+ &pci_ss_info_1014_0277,
+ &pci_ss_info_1014_0279,
+ &pci_ss_info_1014_028c,
+ &pci_ss_info_1014_0502,
+ &pci_ss_info_1014_0503,
+ &pci_ss_info_1014_0506,
+ &pci_ss_info_1014_0508,
+ &pci_ss_info_1014_0511,
+ &pci_ss_info_1014_0512,
+ &pci_ss_info_1014_0513,
+ &pci_ss_info_1014_0517,
+ &pci_ss_info_1014_051a,
+ &pci_ss_info_1014_051c,
+ &pci_ss_info_1014_1010,
+ &pci_ss_info_1014_105c,
+ &pci_ss_info_1014_10f2,
+ &pci_ss_info_1014_1181,
+ &pci_ss_info_1014_1182,
+ &pci_ss_info_1014_2000,
+ &pci_ss_info_1014_2205,
+ &pci_ss_info_1014_305c,
+ &pci_ss_info_1014_405c,
+ &pci_ss_info_1014_505c,
+ &pci_ss_info_1014_605c,
+ &pci_ss_info_1014_705c,
+ &pci_ss_info_1014_805c,
+ &pci_ss_info_1014_8181,
+ &pci_ss_info_1014_9181,
+ &pci_ss_info_1014_9750,
+ &pci_ss_info_1014_ff03,
+ NULL
+};
+#endif
+#define pci_ss_list_1015 NULL
+#define pci_ss_list_1016 NULL
+#define pci_ss_list_1017 NULL
+#define pci_ss_list_1018 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1019[] = {
+ &pci_ss_info_1019_0970,
+ &pci_ss_info_1019_7018,
+ NULL
+};
+#endif
+#define pci_ss_list_101a NULL
+#define pci_ss_list_101b NULL
+#define pci_ss_list_101c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_101e[] = {
+ &pci_ss_info_101e_0431,
+ &pci_ss_info_101e_0438,
+ &pci_ss_info_101e_0466,
+ &pci_ss_info_101e_0467,
+ &pci_ss_info_101e_0471,
+ &pci_ss_info_101e_0475,
+ &pci_ss_info_101e_0490,
+ &pci_ss_info_101e_0493,
+ &pci_ss_info_101e_0649,
+ &pci_ss_info_101e_0762,
+ &pci_ss_info_101e_0767,
+ &pci_ss_info_101e_09a0,
+ &pci_ss_info_101e_8471,
+ &pci_ss_info_101e_8493,
+ NULL
+};
+#endif
+#define pci_ss_list_101f NULL
+#define pci_ss_list_1020 NULL
+#define pci_ss_list_1021 NULL
+#define pci_ss_list_1022 NULL
+static const pciSubsystemInfo *pci_ss_list_1023[] = {
+ &pci_ss_info_1023_8400,
+ &pci_ss_info_1023_8520,
+ &pci_ss_info_1023_9750,
+ &pci_ss_info_1023_9880,
+ NULL
+};
+#define pci_ss_list_1024 NULL
+static const pciSubsystemInfo *pci_ss_list_1025[] = {
+ &pci_ss_info_1025_000e,
+ &pci_ss_info_1025_0018,
+ &pci_ss_info_1025_0310,
+ &pci_ss_info_1025_0315,
+ &pci_ss_info_1025_1003,
+ &pci_ss_info_1025_1007,
+ &pci_ss_info_1025_1016,
+ &pci_ss_info_1025_8013,
+ &pci_ss_info_1025_8920,
+ &pci_ss_info_1025_8921,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_1028[] = {
+ &pci_ss_info_1028_0001,
+ &pci_ss_info_1028_0002,
+ &pci_ss_info_1028_0003,
+ &pci_ss_info_1028_0074,
+ &pci_ss_info_1028_0075,
+ &pci_ss_info_1028_007d,
+ &pci_ss_info_1028_007e,
+ &pci_ss_info_1028_0080,
+ &pci_ss_info_1028_0081,
+ &pci_ss_info_1028_0082,
+ &pci_ss_info_1028_0083,
+ &pci_ss_info_1028_0084,
+ &pci_ss_info_1028_0085,
+ &pci_ss_info_1028_0086,
+ &pci_ss_info_1028_0087,
+ &pci_ss_info_1028_0088,
+ &pci_ss_info_1028_0089,
+ &pci_ss_info_1028_008f,
+ &pci_ss_info_1028_0090,
+ &pci_ss_info_1028_0091,
+ &pci_ss_info_1028_0092,
+ &pci_ss_info_1028_0093,
+ &pci_ss_info_1028_0094,
+ &pci_ss_info_1028_0095,
+ &pci_ss_info_1028_0096,
+ &pci_ss_info_1028_0097,
+ &pci_ss_info_1028_0098,
+ &pci_ss_info_1028_0099,
+ &pci_ss_info_1028_009b,
+ &pci_ss_info_1028_00c5,
+ &pci_ss_info_1028_00d0,
+ &pci_ss_info_1028_00d1,
+ &pci_ss_info_1028_00d9,
+ &pci_ss_info_1028_00e6,
+ &pci_ss_info_1028_0106,
+ &pci_ss_info_1028_0109,
+ &pci_ss_info_1028_010a,
+ &pci_ss_info_1028_011b,
+ &pci_ss_info_1028_0121,
+ &pci_ss_info_1028_0126,
+ &pci_ss_info_1028_0287,
+ &pci_ss_info_1028_0467,
+ &pci_ss_info_1028_0471,
+ &pci_ss_info_1028_0475,
+ &pci_ss_info_1028_0493,
+ &pci_ss_info_1028_0511,
+ &pci_ss_info_1028_0518,
+ &pci_ss_info_1028_0520,
+ &pci_ss_info_1028_0531,
+ &pci_ss_info_1028_1010,
+ &pci_ss_info_1028_1111,
+ &pci_ss_info_1028_4082,
+ &pci_ss_info_1028_8082,
+ &pci_ss_info_1028_c082,
+ NULL
+};
+#define pci_ss_list_1029 NULL
+#define pci_ss_list_102a NULL
+static const pciSubsystemInfo *pci_ss_list_102b[] = {
+ &pci_ss_info_102b_0100,
+ &pci_ss_info_102b_0328,
+ &pci_ss_info_102b_0338,
+ &pci_ss_info_102b_0378,
+ &pci_ss_info_102b_051b,
+ &pci_ss_info_102b_0541,
+ &pci_ss_info_102b_0542,
+ &pci_ss_info_102b_0543,
+ &pci_ss_info_102b_0641,
+ &pci_ss_info_102b_0642,
+ &pci_ss_info_102b_0643,
+ &pci_ss_info_102b_07c0,
+ &pci_ss_info_102b_07c1,
+ &pci_ss_info_102b_0840,
+ &pci_ss_info_102b_0d41,
+ &pci_ss_info_102b_0d42,
+ &pci_ss_info_102b_0e00,
+ &pci_ss_info_102b_0e01,
+ &pci_ss_info_102b_0e02,
+ &pci_ss_info_102b_0e03,
+ &pci_ss_info_102b_0f80,
+ &pci_ss_info_102b_0f81,
+ &pci_ss_info_102b_0f82,
+ &pci_ss_info_102b_0f83,
+ &pci_ss_info_102b_0f84,
+ &pci_ss_info_102b_1001,
+ &pci_ss_info_102b_1100,
+ &pci_ss_info_102b_1200,
+ &pci_ss_info_102b_19d8,
+ &pci_ss_info_102b_19f8,
+ &pci_ss_info_102b_1e41,
+ &pci_ss_info_102b_2159,
+ &pci_ss_info_102b_2179,
+ &pci_ss_info_102b_217d,
+ &pci_ss_info_102b_23c0,
+ &pci_ss_info_102b_23c1,
+ &pci_ss_info_102b_23c2,
+ &pci_ss_info_102b_23c3,
+ &pci_ss_info_102b_2f58,
+ &pci_ss_info_102b_2f78,
+ &pci_ss_info_102b_3693,
+ &pci_ss_info_102b_48e9,
+ &pci_ss_info_102b_48f8,
+ &pci_ss_info_102b_4a60,
+ &pci_ss_info_102b_4a64,
+ &pci_ss_info_102b_5dd0,
+ &pci_ss_info_102b_5f50,
+ &pci_ss_info_102b_5f51,
+ &pci_ss_info_102b_5f52,
+ &pci_ss_info_102b_9010,
+ &pci_ss_info_102b_c93c,
+ &pci_ss_info_102b_c9b0,
+ &pci_ss_info_102b_c9bc,
+ &pci_ss_info_102b_ca60,
+ &pci_ss_info_102b_ca6c,
+ &pci_ss_info_102b_dbbc,
+ &pci_ss_info_102b_dbc2,
+ &pci_ss_info_102b_dbc3,
+ &pci_ss_info_102b_dbc8,
+ &pci_ss_info_102b_dbd2,
+ &pci_ss_info_102b_dbd3,
+ &pci_ss_info_102b_dbd4,
+ &pci_ss_info_102b_dbd5,
+ &pci_ss_info_102b_dbd8,
+ &pci_ss_info_102b_dbd9,
+ &pci_ss_info_102b_dbe2,
+ &pci_ss_info_102b_dbe3,
+ &pci_ss_info_102b_dbe8,
+ &pci_ss_info_102b_dbf2,
+ &pci_ss_info_102b_dbf3,
+ &pci_ss_info_102b_dbf4,
+ &pci_ss_info_102b_dbf5,
+ &pci_ss_info_102b_dbf8,
+ &pci_ss_info_102b_dbf9,
+ &pci_ss_info_102b_f806,
+ &pci_ss_info_102b_ff00,
+ &pci_ss_info_102b_ff01,
+ &pci_ss_info_102b_ff02,
+ &pci_ss_info_102b_ff03,
+ &pci_ss_info_102b_ff04,
+ &pci_ss_info_102b_ff05,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_102c[] = {
+ &pci_ss_info_102c_00c0,
+ NULL
+};
+#define pci_ss_list_102d NULL
+#define pci_ss_list_102e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_102f[] = {
+ &pci_ss_info_102f_00f8,
+ NULL
+};
+#endif
+#define pci_ss_list_1030 NULL
+static const pciSubsystemInfo *pci_ss_list_1031[] = {
+ &pci_ss_info_1031_7efe,
+ &pci_ss_info_1031_fc00,
+ NULL
+};
+#define pci_ss_list_1032 NULL
+static const pciSubsystemInfo *pci_ss_list_1033[] = {
+ &pci_ss_info_1033_8000,
+ &pci_ss_info_1033_800c,
+ &pci_ss_info_1033_800d,
+ &pci_ss_info_1033_8014,
+ &pci_ss_info_1033_8015,
+ &pci_ss_info_1033_8016,
+ &pci_ss_info_1033_801f,
+ &pci_ss_info_1033_8026,
+ &pci_ss_info_1033_8029,
+ &pci_ss_info_1033_802b,
+ &pci_ss_info_1033_802f,
+ &pci_ss_info_1033_803c,
+ &pci_ss_info_1033_8047,
+ &pci_ss_info_1033_804d,
+ &pci_ss_info_1033_804f,
+ &pci_ss_info_1033_8051,
+ &pci_ss_info_1033_8054,
+ &pci_ss_info_1033_8058,
+ &pci_ss_info_1033_8063,
+ &pci_ss_info_1033_8064,
+ &pci_ss_info_1033_8065,
+ &pci_ss_info_1033_8066,
+ &pci_ss_info_1033_8068,
+ &pci_ss_info_1033_8069,
+ &pci_ss_info_1033_806a,
+ &pci_ss_info_1033_8077,
+ &pci_ss_info_1033_809d,
+ &pci_ss_info_1033_80ac,
+ &pci_ss_info_1033_80bc,
+ NULL
+};
+#define pci_ss_list_1034 NULL
+#define pci_ss_list_1035 NULL
+#define pci_ss_list_1036 NULL
+#define pci_ss_list_1037 NULL
+#define pci_ss_list_1038 NULL
+static const pciSubsystemInfo *pci_ss_list_1039[] = {
+ &pci_ss_info_1039_0000,
+ &pci_ss_info_1039_0900,
+ &pci_ss_info_1039_5513,
+ &pci_ss_info_1039_6306,
+ &pci_ss_info_1039_6326,
+ &pci_ss_info_1039_7000,
+ &pci_ss_info_1039_7016,
+ &pci_ss_info_1039_7018,
+ NULL
+};
+#define pci_ss_list_103a NULL
+#define pci_ss_list_103b NULL
+static const pciSubsystemInfo *pci_ss_list_103c[] = {
+ &pci_ss_info_103c_0007,
+ &pci_ss_info_103c_0008,
+ &pci_ss_info_103c_000d,
+ &pci_ss_info_103c_03a2,
+ &pci_ss_info_103c_1040,
+ &pci_ss_info_103c_1041,
+ &pci_ss_info_103c_1042,
+ &pci_ss_info_103c_1049,
+ &pci_ss_info_103c_104a,
+ &pci_ss_info_103c_104b,
+ &pci_ss_info_103c_104c,
+ &pci_ss_info_103c_1064,
+ &pci_ss_info_103c_1065,
+ &pci_ss_info_103c_106c,
+ &pci_ss_info_103c_106e,
+ &pci_ss_info_103c_10c0,
+ &pci_ss_info_103c_10c2,
+ &pci_ss_info_103c_10c3,
+ &pci_ss_info_103c_10c6,
+ &pci_ss_info_103c_10c7,
+ &pci_ss_info_103c_10ca,
+ &pci_ss_info_103c_10cb,
+ &pci_ss_info_103c_10cc,
+ &pci_ss_info_103c_10cd,
+ &pci_ss_info_103c_10e3,
+ &pci_ss_info_103c_10e4,
+ &pci_ss_info_103c_10ea,
+ &pci_ss_info_103c_1200,
+ &pci_ss_info_103c_1207,
+ &pci_ss_info_103c_1223,
+ &pci_ss_info_103c_1226,
+ &pci_ss_info_103c_1227,
+ &pci_ss_info_103c_1279,
+ &pci_ss_info_103c_1282,
+ NULL
+};
+#define pci_ss_list_103e NULL
+#define pci_ss_list_103f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1040[] = {
+ &pci_ss_info_1040_000f,
+ &pci_ss_info_1040_0011,
+ NULL
+};
+#endif
+#define pci_ss_list_1041 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1042[] = {
+ &pci_ss_info_1042_1854,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1043[] = {
+ &pci_ss_info_1043_0200,
+ &pci_ss_info_1043_0201,
+ &pci_ss_info_1043_0202,
+ &pci_ss_info_1043_0205,
+ &pci_ss_info_1043_0c11,
+ &pci_ss_info_1043_4000,
+ &pci_ss_info_1043_4008,
+ &pci_ss_info_1043_4009,
+ &pci_ss_info_1043_400a,
+ &pci_ss_info_1043_400b,
+ &pci_ss_info_1043_4015,
+ &pci_ss_info_1043_4016,
+ &pci_ss_info_1043_402f,
+ &pci_ss_info_1043_4031,
+ &pci_ss_info_1043_405b,
+ &pci_ss_info_1043_405f,
+ &pci_ss_info_1043_800b,
+ &pci_ss_info_1043_801c,
+ &pci_ss_info_1043_8027,
+ &pci_ss_info_1043_8033,
+ &pci_ss_info_1043_803e,
+ &pci_ss_info_1043_8040,
+ &pci_ss_info_1043_8042,
+ &pci_ss_info_1043_8044,
+ &pci_ss_info_1043_8052,
+ &pci_ss_info_1043_8053,
+ &pci_ss_info_1043_8064,
+ &pci_ss_info_1043_8077,
+ &pci_ss_info_1043_807f,
+ &pci_ss_info_1043_80ad,
+ &pci_ss_info_1043_80e2,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1044[] = {
+ &pci_ss_info_1044_c001,
+ &pci_ss_info_1044_c002,
+ &pci_ss_info_1044_c003,
+ &pci_ss_info_1044_c004,
+ &pci_ss_info_1044_c005,
+ &pci_ss_info_1044_c00a,
+ &pci_ss_info_1044_c00b,
+ &pci_ss_info_1044_c00c,
+ &pci_ss_info_1044_c00d,
+ &pci_ss_info_1044_c00e,
+ &pci_ss_info_1044_c00f,
+ &pci_ss_info_1044_c014,
+ &pci_ss_info_1044_c015,
+ &pci_ss_info_1044_c016,
+ &pci_ss_info_1044_c01e,
+ &pci_ss_info_1044_c01f,
+ &pci_ss_info_1044_c020,
+ &pci_ss_info_1044_c021,
+ &pci_ss_info_1044_c028,
+ &pci_ss_info_1044_c029,
+ &pci_ss_info_1044_c02a,
+ &pci_ss_info_1044_c03c,
+ &pci_ss_info_1044_c03d,
+ &pci_ss_info_1044_c03e,
+ &pci_ss_info_1044_c046,
+ &pci_ss_info_1044_c047,
+ &pci_ss_info_1044_c048,
+ &pci_ss_info_1044_c050,
+ &pci_ss_info_1044_c051,
+ &pci_ss_info_1044_c052,
+ &pci_ss_info_1044_c05a,
+ &pci_ss_info_1044_c05b,
+ &pci_ss_info_1044_c064,
+ &pci_ss_info_1044_c065,
+ &pci_ss_info_1044_c066,
+ NULL
+};
+#endif
+#define pci_ss_list_1045 NULL
+#define pci_ss_list_1046 NULL
+#define pci_ss_list_1047 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1048[] = {
+ &pci_ss_info_1048_0a31,
+ &pci_ss_info_1048_0a32,
+ &pci_ss_info_1048_0a35,
+ &pci_ss_info_1048_0c10,
+ &pci_ss_info_1048_0c18,
+ &pci_ss_info_1048_0c1b,
+ &pci_ss_info_1048_0c3a,
+ &pci_ss_info_1048_0c56,
+ &pci_ss_info_1048_1500,
+ NULL
+};
+#endif
+#define pci_ss_list_1049 NULL
+#define pci_ss_list_104a NULL
+#define pci_ss_list_104b NULL
+#define pci_ss_list_104c NULL
+static const pciSubsystemInfo *pci_ss_list_104d[] = {
+ &pci_ss_info_104d_801b,
+ &pci_ss_info_104d_802f,
+ &pci_ss_info_104d_8032,
+ &pci_ss_info_104d_8036,
+ &pci_ss_info_104d_8044,
+ &pci_ss_info_104d_8045,
+ &pci_ss_info_104d_8049,
+ &pci_ss_info_104d_8055,
+ &pci_ss_info_104d_8056,
+ &pci_ss_info_104d_805a,
+ &pci_ss_info_104d_805f,
+ &pci_ss_info_104d_8067,
+ &pci_ss_info_104d_8074,
+ &pci_ss_info_104d_8075,
+ &pci_ss_info_104d_8077,
+ &pci_ss_info_104d_807b,
+ &pci_ss_info_104d_8083,
+ &pci_ss_info_104d_8097,
+ &pci_ss_info_104d_80df,
+ &pci_ss_info_104d_80e7,
+ &pci_ss_info_104d_830b,
+ NULL
+};
+#define pci_ss_list_104e NULL
+#define pci_ss_list_104f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1050[] = {
+ &pci_ss_info_1050_0001,
+ &pci_ss_info_1050_0840,
+ NULL
+};
+#endif
+#define pci_ss_list_1051 NULL
+#define pci_ss_list_1052 NULL
+#define pci_ss_list_1053 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1054[] = {
+ &pci_ss_info_1054_7018,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1055[] = {
+ &pci_ss_info_1055_e000,
+ &pci_ss_info_1055_e002,
+ &pci_ss_info_1055_e100,
+ &pci_ss_info_1055_e102,
+ &pci_ss_info_1055_e300,
+ &pci_ss_info_1055_e302,
+ NULL
+};
+#endif
+#define pci_ss_list_1056 NULL
+static const pciSubsystemInfo *pci_ss_list_1057[] = {
+ &pci_ss_info_1057_0300,
+ &pci_ss_info_1057_0301,
+ &pci_ss_info_1057_0302,
+ &pci_ss_info_1057_5600,
+ NULL
+};
+#define pci_ss_list_1058 NULL
+#define pci_ss_list_1059 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_105a[] = {
+ &pci_ss_info_105a_0000,
+ &pci_ss_info_105a_0275,
+ &pci_ss_info_105a_2168,
+ &pci_ss_info_105a_4d30,
+ &pci_ss_info_105a_4d33,
+ &pci_ss_info_105a_4d39,
+ &pci_ss_info_105a_4d68,
+ &pci_ss_info_105a_5168,
+ &pci_ss_info_105a_6269,
+ NULL
+};
+#endif
+#define pci_ss_list_105b NULL
+#define pci_ss_list_105c NULL
+static const pciSubsystemInfo *pci_ss_list_105d[] = {
+ &pci_ss_info_105d_0000,
+ &pci_ss_info_105d_0001,
+ &pci_ss_info_105d_0002,
+ &pci_ss_info_105d_0003,
+ &pci_ss_info_105d_0004,
+ &pci_ss_info_105d_0005,
+ &pci_ss_info_105d_0006,
+ &pci_ss_info_105d_0007,
+ &pci_ss_info_105d_0008,
+ &pci_ss_info_105d_0009,
+ &pci_ss_info_105d_000a,
+ &pci_ss_info_105d_000b,
+ &pci_ss_info_105d_0018,
+ &pci_ss_info_105d_002a,
+ &pci_ss_info_105d_003a,
+ &pci_ss_info_105d_092f,
+ NULL
+};
+#define pci_ss_list_105e NULL
+#define pci_ss_list_105f NULL
+#define pci_ss_list_1060 NULL
+#define pci_ss_list_1061 NULL
+#define pci_ss_list_1062 NULL
+#define pci_ss_list_1063 NULL
+#define pci_ss_list_1064 NULL
+#define pci_ss_list_1065 NULL
+#define pci_ss_list_1066 NULL
+#define pci_ss_list_1067 NULL
+#define pci_ss_list_1068 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1069[] = {
+ &pci_ss_info_1069_0020,
+ NULL
+};
+#endif
+#define pci_ss_list_106a NULL
+#define pci_ss_list_106b NULL
+#define pci_ss_list_106c NULL
+#define pci_ss_list_106d NULL
+#define pci_ss_list_106e NULL
+#define pci_ss_list_106f NULL
+#define pci_ss_list_1070 NULL
+#define pci_ss_list_1071 NULL
+#define pci_ss_list_1072 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1073[] = {
+ &pci_ss_info_1073_0004,
+ &pci_ss_info_1073_0005,
+ &pci_ss_info_1073_0006,
+ &pci_ss_info_1073_0008,
+ &pci_ss_info_1073_000a,
+ &pci_ss_info_1073_000d,
+ &pci_ss_info_1073_0010,
+ &pci_ss_info_1073_0012,
+ &pci_ss_info_1073_2000,
+ NULL
+};
+#endif
+#define pci_ss_list_1074 NULL
+#define pci_ss_list_1075 NULL
+#define pci_ss_list_1076 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1077[] = {
+ &pci_ss_info_1077_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_1078 NULL
+#define pci_ss_list_1079 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_107a[] = {
+ &pci_ss_info_107a_000c,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_107b[] = {
+ &pci_ss_info_107b_5350,
+ &pci_ss_info_107b_8030,
+ &pci_ss_info_107b_8054,
+ NULL
+};
+#endif
+#define pci_ss_list_107c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_107d[] = {
+ &pci_ss_info_107d_2633,
+ &pci_ss_info_107d_2720,
+ &pci_ss_info_107d_2840,
+ &pci_ss_info_107d_2896,
+ &pci_ss_info_107d_5330,
+ &pci_ss_info_107d_5350,
+ &pci_ss_info_107d_6606,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_107e[] = {
+ &pci_ss_info_107e_000e,
+ &pci_ss_info_107e_000f,
+ NULL
+};
+#endif
+#define pci_ss_list_107f NULL
+#define pci_ss_list_1080 NULL
+#define pci_ss_list_1081 NULL
+#define pci_ss_list_1082 NULL
+#define pci_ss_list_1083 NULL
+#define pci_ss_list_1084 NULL
+#define pci_ss_list_1085 NULL
+#define pci_ss_list_1086 NULL
+#define pci_ss_list_1087 NULL
+#define pci_ss_list_1088 NULL
+#define pci_ss_list_1089 NULL
+#define pci_ss_list_108a NULL
+#define pci_ss_list_108c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_108d[] = {
+ &pci_ss_info_108d_0004,
+ &pci_ss_info_108d_0007,
+ &pci_ss_info_108d_0008,
+ &pci_ss_info_108d_0016,
+ &pci_ss_info_108d_0017,
+ &pci_ss_info_108d_0022,
+ &pci_ss_info_108d_0027,
+ NULL
+};
+#endif
+#define pci_ss_list_108e NULL
+#define pci_ss_list_108f NULL
+#define pci_ss_list_1090 NULL
+#define pci_ss_list_1091 NULL
+static const pciSubsystemInfo *pci_ss_list_1092[] = {
+ &pci_ss_info_1092_0003,
+ &pci_ss_info_1092_0100,
+ &pci_ss_info_1092_0127,
+ &pci_ss_info_1092_0136,
+ &pci_ss_info_1092_0141,
+ &pci_ss_info_1092_0146,
+ &pci_ss_info_1092_0148,
+ &pci_ss_info_1092_0149,
+ &pci_ss_info_1092_0152,
+ &pci_ss_info_1092_0154,
+ &pci_ss_info_1092_0155,
+ &pci_ss_info_1092_0156,
+ &pci_ss_info_1092_0157,
+ &pci_ss_info_1092_0350,
+ &pci_ss_info_1092_0440,
+ &pci_ss_info_1092_0550,
+ &pci_ss_info_1092_0552,
+ &pci_ss_info_1092_094c,
+ &pci_ss_info_1092_0a50,
+ &pci_ss_info_1092_0a70,
+ &pci_ss_info_1092_0a78,
+ &pci_ss_info_1092_1092,
+ &pci_ss_info_1092_2000,
+ &pci_ss_info_1092_2100,
+ &pci_ss_info_1092_2110,
+ &pci_ss_info_1092_2200,
+ &pci_ss_info_1092_3000,
+ &pci_ss_info_1092_3001,
+ &pci_ss_info_1092_3002,
+ &pci_ss_info_1092_3003,
+ &pci_ss_info_1092_3004,
+ &pci_ss_info_1092_4000,
+ &pci_ss_info_1092_4002,
+ &pci_ss_info_1092_4100,
+ &pci_ss_info_1092_4207,
+ &pci_ss_info_1092_4800,
+ &pci_ss_info_1092_4801,
+ &pci_ss_info_1092_4803,
+ &pci_ss_info_1092_4804,
+ &pci_ss_info_1092_4807,
+ &pci_ss_info_1092_4808,
+ &pci_ss_info_1092_4809,
+ &pci_ss_info_1092_480e,
+ &pci_ss_info_1092_4810,
+ &pci_ss_info_1092_4812,
+ &pci_ss_info_1092_4815,
+ &pci_ss_info_1092_4820,
+ &pci_ss_info_1092_4822,
+ &pci_ss_info_1092_4904,
+ &pci_ss_info_1092_4905,
+ &pci_ss_info_1092_4910,
+ &pci_ss_info_1092_4914,
+ &pci_ss_info_1092_4920,
+ &pci_ss_info_1092_4a00,
+ &pci_ss_info_1092_4a02,
+ &pci_ss_info_1092_4a09,
+ &pci_ss_info_1092_4a0b,
+ &pci_ss_info_1092_4a0f,
+ &pci_ss_info_1092_4e01,
+ &pci_ss_info_1092_5932,
+ &pci_ss_info_1092_5934,
+ &pci_ss_info_1092_5952,
+ &pci_ss_info_1092_5954,
+ &pci_ss_info_1092_5a00,
+ &pci_ss_info_1092_5a35,
+ &pci_ss_info_1092_5a37,
+ &pci_ss_info_1092_5a55,
+ &pci_ss_info_1092_5a57,
+ &pci_ss_info_1092_6820,
+ &pci_ss_info_1092_6a02,
+ &pci_ss_info_1092_7a02,
+ &pci_ss_info_1092_8000,
+ &pci_ss_info_1092_8030,
+ &pci_ss_info_1092_8035,
+ &pci_ss_info_1092_8225,
+ &pci_ss_info_1092_8760,
+ &pci_ss_info_1092_8a10,
+ NULL
+};
+#define pci_ss_list_1093 NULL
+#define pci_ss_list_1094 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1095[] = {
+ &pci_ss_info_1095_0670,
+ NULL
+};
+#endif
+#define pci_ss_list_1096 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1097[] = {
+ &pci_ss_info_1097_3d01,
+ NULL
+};
+#endif
+#define pci_ss_list_1098 NULL
+#define pci_ss_list_1099 NULL
+#define pci_ss_list_109a NULL
+#define pci_ss_list_109b NULL
+#define pci_ss_list_109c NULL
+#define pci_ss_list_109d NULL
+#define pci_ss_list_109e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_109f[] = {
+ &pci_ss_info_109f_1000,
+ &pci_ss_info_109f_315d,
+ &pci_ss_info_109f_3181,
+ NULL
+};
+#endif
+#define pci_ss_list_10a0 NULL
+#define pci_ss_list_10a1 NULL
+#define pci_ss_list_10a2 NULL
+#define pci_ss_list_10a3 NULL
+#define pci_ss_list_10a4 NULL
+#define pci_ss_list_10a5 NULL
+#define pci_ss_list_10a6 NULL
+#define pci_ss_list_10a7 NULL
+#define pci_ss_list_10a8 NULL
+#define pci_ss_list_10a9 NULL
+#define pci_ss_list_10aa NULL
+#define pci_ss_list_10ab NULL
+#define pci_ss_list_10ac NULL
+#define pci_ss_list_10ad NULL
+#define pci_ss_list_10ae NULL
+#define pci_ss_list_10af NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b0[] = {
+ &pci_ss_info_10b0_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_10b1 NULL
+#define pci_ss_list_10b2 NULL
+#define pci_ss_list_10b3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b4[] = {
+ &pci_ss_info_10b4_1617,
+ &pci_ss_info_10b4_1717,
+ &pci_ss_info_10b4_1b1b,
+ &pci_ss_info_10b4_1b1d,
+ &pci_ss_info_10b4_1b1e,
+ &pci_ss_info_10b4_1b20,
+ &pci_ss_info_10b4_1b21,
+ &pci_ss_info_10b4_1b22,
+ &pci_ss_info_10b4_1b23,
+ &pci_ss_info_10b4_1b27,
+ &pci_ss_info_10b4_1b88,
+ &pci_ss_info_10b4_201a,
+ &pci_ss_info_10b4_202f,
+ &pci_ss_info_10b4_222a,
+ &pci_ss_info_10b4_2230,
+ &pci_ss_info_10b4_2232,
+ &pci_ss_info_10b4_2235,
+ &pci_ss_info_10b4_237e,
+ &pci_ss_info_10b4_273d,
+ &pci_ss_info_10b4_273e,
+ &pci_ss_info_10b4_2740,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b5[] = {
+ &pci_ss_info_10b5_2036,
+ &pci_ss_info_10b5_2273,
+ &pci_ss_info_10b5_2455,
+ &pci_ss_info_10b5_9050,
+ &pci_ss_info_10b5_9080,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b6[] = {
+ &pci_ss_info_10b6_0002,
+ &pci_ss_info_10b6_0003,
+ &pci_ss_info_10b6_0006,
+ &pci_ss_info_10b6_0007,
+ &pci_ss_info_10b6_0008,
+ &pci_ss_info_10b6_0009,
+ &pci_ss_info_10b6_000a,
+ &pci_ss_info_10b6_000b,
+ &pci_ss_info_10b6_000c,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b7[] = {
+ &pci_ss_info_10b7_1000,
+ &pci_ss_info_10b7_1001,
+ &pci_ss_info_10b7_1002,
+ &pci_ss_info_10b7_1003,
+ &pci_ss_info_10b7_1004,
+ &pci_ss_info_10b7_1005,
+ &pci_ss_info_10b7_1006,
+ &pci_ss_info_10b7_1007,
+ &pci_ss_info_10b7_1008,
+ &pci_ss_info_10b7_1100,
+ &pci_ss_info_10b7_1101,
+ &pci_ss_info_10b7_1102,
+ &pci_ss_info_10b7_1201,
+ &pci_ss_info_10b7_1202,
+ &pci_ss_info_10b7_2000,
+ &pci_ss_info_10b7_2001,
+ &pci_ss_info_10b7_2101,
+ &pci_ss_info_10b7_2102,
+ &pci_ss_info_10b7_3000,
+ &pci_ss_info_10b7_3590,
+ &pci_ss_info_10b7_5a57,
+ &pci_ss_info_10b7_5b57,
+ &pci_ss_info_10b7_5c57,
+ &pci_ss_info_10b7_615c,
+ &pci_ss_info_10b7_6556,
+ &pci_ss_info_10b7_656a,
+ &pci_ss_info_10b7_656b,
+ &pci_ss_info_10b7_7000,
+ &pci_ss_info_10b7_9004,
+ &pci_ss_info_10b7_9005,
+ &pci_ss_info_10b7_9055,
+ &pci_ss_info_10b7_9800,
+ &pci_ss_info_10b7_9805,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10b8[] = {
+ &pci_ss_info_10b8_2001,
+ &pci_ss_info_10b8_2002,
+ &pci_ss_info_10b8_2003,
+ &pci_ss_info_10b8_2005,
+ &pci_ss_info_10b8_2011,
+ &pci_ss_info_10b8_8034,
+ &pci_ss_info_10b8_a011,
+ &pci_ss_info_10b8_a012,
+ &pci_ss_info_10b8_a014,
+ &pci_ss_info_10b8_a015,
+ &pci_ss_info_10b8_a016,
+ &pci_ss_info_10b8_a017,
+ NULL
+};
+#endif
+static const pciSubsystemInfo *pci_ss_list_10b9[] = {
+ &pci_ss_info_10b9_0111,
+ &pci_ss_info_10b9_1521,
+ &pci_ss_info_10b9_1523,
+ &pci_ss_info_10b9_1533,
+ &pci_ss_info_10b9_1541,
+ &pci_ss_info_10b9_7101,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10ba[] = {
+ &pci_ss_info_10ba_0e00,
+ NULL
+};
+#endif
+#define pci_ss_list_10bb NULL
+#define pci_ss_list_10bc NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10bd[] = {
+ &pci_ss_info_10bd_0000,
+ &pci_ss_info_10bd_0320,
+ NULL
+};
+#endif
+#define pci_ss_list_10be NULL
+#define pci_ss_list_10bf NULL
+#define pci_ss_list_10c0 NULL
+#define pci_ss_list_10c1 NULL
+#define pci_ss_list_10c2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10c3[] = {
+ &pci_ss_info_10c3_1100,
+ NULL
+};
+#endif
+#define pci_ss_list_10c4 NULL
+#define pci_ss_list_10c5 NULL
+#define pci_ss_list_10c6 NULL
+#define pci_ss_list_10c7 NULL
+static const pciSubsystemInfo *pci_ss_list_10c8[] = {
+ &pci_ss_info_10c8_0004,
+ &pci_ss_info_10c8_0016,
+ &pci_ss_info_10c8_8005,
+ NULL
+};
+#define pci_ss_list_10c9 NULL
+#define pci_ss_list_10ca NULL
+#define pci_ss_list_10cb NULL
+#define pci_ss_list_10cc NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10cd[] = {
+ &pci_ss_info_10cd_1310,
+ NULL
+};
+#endif
+#define pci_ss_list_10ce NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10cf[] = {
+ &pci_ss_info_10cf_1029,
+ &pci_ss_info_10cf_102c,
+ &pci_ss_info_10cf_103c,
+ &pci_ss_info_10cf_104a,
+ &pci_ss_info_10cf_1055,
+ &pci_ss_info_10cf_1056,
+ &pci_ss_info_10cf_1057,
+ &pci_ss_info_10cf_1059,
+ &pci_ss_info_10cf_105f,
+ &pci_ss_info_10cf_1063,
+ &pci_ss_info_10cf_1064,
+ &pci_ss_info_10cf_106a,
+ &pci_ss_info_10cf_1072,
+ &pci_ss_info_10cf_1094,
+ &pci_ss_info_10cf_1095,
+ &pci_ss_info_10cf_1098,
+ &pci_ss_info_10cf_1099,
+ &pci_ss_info_10cf_10a8,
+ &pci_ss_info_10cf_10a9,
+ &pci_ss_info_10cf_10aa,
+ &pci_ss_info_10cf_10ab,
+ &pci_ss_info_10cf_10ac,
+ &pci_ss_info_10cf_10ad,
+ &pci_ss_info_10cf_10b4,
+ &pci_ss_info_10cf_1115,
+ &pci_ss_info_10cf_1143,
+ NULL
+};
+#endif
+#define pci_ss_list_10d0 NULL
+#define pci_ss_list_10d1 NULL
+#define pci_ss_list_10d2 NULL
+#define pci_ss_list_10d3 NULL
+#define pci_ss_list_10d4 NULL
+#define pci_ss_list_10d5 NULL
+#define pci_ss_list_10d6 NULL
+#define pci_ss_list_10d7 NULL
+#define pci_ss_list_10d8 NULL
+#define pci_ss_list_10d9 NULL
+#define pci_ss_list_10da NULL
+#define pci_ss_list_10db NULL
+#define pci_ss_list_10dc NULL
+#define pci_ss_list_10dd NULL
+static const pciSubsystemInfo *pci_ss_list_10de[] = {
+ &pci_ss_info_10de_0005,
+ &pci_ss_info_10de_000f,
+ &pci_ss_info_10de_001e,
+ &pci_ss_info_10de_0020,
+ NULL
+};
+#define pci_ss_list_10df NULL
+#define pci_ss_list_10e0 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10e1[] = {
+ &pci_ss_info_10e1_0391,
+ NULL
+};
+#endif
+#define pci_ss_list_10e2 NULL
+#define pci_ss_list_10e3 NULL
+#define pci_ss_list_10e4 NULL
+#define pci_ss_list_10e5 NULL
+#define pci_ss_list_10e6 NULL
+#define pci_ss_list_10e7 NULL
+#define pci_ss_list_10e8 NULL
+#define pci_ss_list_10e9 NULL
+#define pci_ss_list_10ea NULL
+#define pci_ss_list_10eb NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10ec[] = {
+ &pci_ss_info_10ec_8029,
+ &pci_ss_info_10ec_8129,
+ &pci_ss_info_10ec_8138,
+ &pci_ss_info_10ec_8139,
+ NULL
+};
+#endif
+#define pci_ss_list_10ed NULL
+#define pci_ss_list_10ee NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10ef[] = {
+ &pci_ss_info_10ef_8169,
+ NULL
+};
+#endif
+#define pci_ss_list_10f0 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10f1[] = {
+ &pci_ss_info_10f1_0002,
+ &pci_ss_info_10f1_2462,
+ NULL
+};
+#endif
+#define pci_ss_list_10f2 NULL
+#define pci_ss_list_10f3 NULL
+#define pci_ss_list_10f4 NULL
+#define pci_ss_list_10f5 NULL
+#define pci_ss_list_10f6 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_10f7[] = {
+ &pci_ss_info_10f7_8308,
+ &pci_ss_info_10f7_8309,
+ &pci_ss_info_10f7_830b,
+ &pci_ss_info_10f7_830d,
+ &pci_ss_info_10f7_8312,
+ NULL
+};
+#endif
+#define pci_ss_list_10f8 NULL
+#define pci_ss_list_10f9 NULL
+#define pci_ss_list_10fa NULL
+#define pci_ss_list_10fb NULL
+#define pci_ss_list_10fc NULL
+#define pci_ss_list_10fd NULL
+#define pci_ss_list_10fe NULL
+#define pci_ss_list_10ff NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1100[] = {
+ &pci_ss_info_1100_102b,
+ NULL
+};
+#endif
+#define pci_ss_list_1101 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1102[] = {
+ &pci_ss_info_1102_0010,
+ &pci_ss_info_1102_0020,
+ &pci_ss_info_1102_0021,
+ &pci_ss_info_1102_002f,
+ &pci_ss_info_1102_0040,
+ &pci_ss_info_1102_0051,
+ &pci_ss_info_1102_0053,
+ &pci_ss_info_1102_100f,
+ &pci_ss_info_1102_1015,
+ &pci_ss_info_1102_1016,
+ &pci_ss_info_1102_1018,
+ &pci_ss_info_1102_101d,
+ &pci_ss_info_1102_101e,
+ &pci_ss_info_1102_1020,
+ &pci_ss_info_1102_1021,
+ &pci_ss_info_1102_1023,
+ &pci_ss_info_1102_1024,
+ &pci_ss_info_1102_1026,
+ &pci_ss_info_1102_1029,
+ &pci_ss_info_1102_102c,
+ &pci_ss_info_1102_102d,
+ &pci_ss_info_1102_102e,
+ &pci_ss_info_1102_102f,
+ &pci_ss_info_1102_1031,
+ &pci_ss_info_1102_1034,
+ &pci_ss_info_1102_4001,
+ &pci_ss_info_1102_8022,
+ &pci_ss_info_1102_8023,
+ &pci_ss_info_1102_8024,
+ &pci_ss_info_1102_8025,
+ &pci_ss_info_1102_8026,
+ &pci_ss_info_1102_8027,
+ &pci_ss_info_1102_8028,
+ &pci_ss_info_1102_8031,
+ &pci_ss_info_1102_8040,
+ &pci_ss_info_1102_8051,
+ &pci_ss_info_1102_8061,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1103[] = {
+ &pci_ss_info_1103_0001,
+ &pci_ss_info_1103_0005,
+ NULL
+};
+#endif
+#define pci_ss_list_1104 NULL
+#define pci_ss_list_1105 NULL
+static const pciSubsystemInfo *pci_ss_list_1106[] = {
+ &pci_ss_info_1106_0000,
+ &pci_ss_info_1106_0100,
+ &pci_ss_info_1106_0102,
+ &pci_ss_info_1106_0571,
+ &pci_ss_info_1106_0686,
+ &pci_ss_info_1106_4511,
+ NULL
+};
+#define pci_ss_list_1107 NULL
+#define pci_ss_list_1108 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1109[] = {
+ &pci_ss_info_1109_2400,
+ &pci_ss_info_1109_2a00,
+ &pci_ss_info_1109_2b00,
+ &pci_ss_info_1109_3000,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_110a[] = {
+ &pci_ss_info_110a_0018,
+ &pci_ss_info_110a_001e,
+ &pci_ss_info_110a_0032,
+ &pci_ss_info_110a_8005,
+ NULL
+};
+#endif
+#define pci_ss_list_110b NULL
+#define pci_ss_list_110c NULL
+#define pci_ss_list_110d NULL
+#define pci_ss_list_110e NULL
+#define pci_ss_list_110f NULL
+#define pci_ss_list_1110 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1111[] = {
+ &pci_ss_info_1111_1111,
+ &pci_ss_info_1111_1112,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1112[] = {
+ &pci_ss_info_1112_2300,
+ &pci_ss_info_1112_2320,
+ &pci_ss_info_1112_2340,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1113[] = {
+ &pci_ss_info_1113_1207,
+ &pci_ss_info_1113_1208,
+ &pci_ss_info_1113_1211,
+ &pci_ss_info_1113_1220,
+ &pci_ss_info_1113_2220,
+ &pci_ss_info_1113_9211,
+ NULL
+};
+#endif
+#define pci_ss_list_1114 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1115[] = {
+ &pci_ss_info_1115_1181,
+ NULL
+};
+#endif
+#define pci_ss_list_1116 NULL
+#define pci_ss_list_1117 NULL
+#define pci_ss_list_1118 NULL
+#define pci_ss_list_1119 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_111a[] = {
+ &pci_ss_info_111a_0000,
+ &pci_ss_info_111a_0001,
+ &pci_ss_info_111a_0009,
+ &pci_ss_info_111a_0101,
+ &pci_ss_info_111a_0109,
+ &pci_ss_info_111a_0809,
+ &pci_ss_info_111a_0909,
+ &pci_ss_info_111a_0a09,
+ &pci_ss_info_111a_1001,
+ &pci_ss_info_111a_1020,
+ NULL
+};
+#endif
+#define pci_ss_list_111b NULL
+#define pci_ss_list_111c NULL
+#define pci_ss_list_111d NULL
+#define pci_ss_list_111e NULL
+#define pci_ss_list_111f NULL
+#define pci_ss_list_1120 NULL
+#define pci_ss_list_1121 NULL
+#define pci_ss_list_1122 NULL
+#define pci_ss_list_1123 NULL
+#define pci_ss_list_1124 NULL
+#define pci_ss_list_1125 NULL
+#define pci_ss_list_1126 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1127[] = {
+ &pci_ss_info_1127_0400,
+ NULL
+};
+#endif
+#define pci_ss_list_1129 NULL
+#define pci_ss_list_112a NULL
+#define pci_ss_list_112b NULL
+#define pci_ss_list_112c NULL
+#define pci_ss_list_112d NULL
+#define pci_ss_list_112e NULL
+#define pci_ss_list_112f NULL
+#define pci_ss_list_1130 NULL
+#define pci_ss_list_1131 NULL
+#define pci_ss_list_1132 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1133[] = {
+ &pci_ss_info_1133_e001,
+ &pci_ss_info_1133_e002,
+ &pci_ss_info_1133_e003,
+ &pci_ss_info_1133_e004,
+ &pci_ss_info_1133_e005,
+ &pci_ss_info_1133_e010,
+ &pci_ss_info_1133_e012,
+ &pci_ss_info_1133_e014,
+ NULL
+};
+#endif
+#define pci_ss_list_1134 NULL
+#define pci_ss_list_1135 NULL
+#define pci_ss_list_1136 NULL
+#define pci_ss_list_1137 NULL
+#define pci_ss_list_1138 NULL
+#define pci_ss_list_1139 NULL
+#define pci_ss_list_113a NULL
+#define pci_ss_list_113b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_113c[] = {
+ &pci_ss_info_113c_03a2,
+ NULL
+};
+#endif
+#define pci_ss_list_113d NULL
+#define pci_ss_list_113e NULL
+#define pci_ss_list_113f NULL
+#define pci_ss_list_1140 NULL
+#define pci_ss_list_1141 NULL
+#define pci_ss_list_1142 NULL
+#define pci_ss_list_1143 NULL
+#define pci_ss_list_1144 NULL
+#define pci_ss_list_1145 NULL
+#define pci_ss_list_1146 NULL
+#define pci_ss_list_1147 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1148[] = {
+ &pci_ss_info_1148_5021,
+ &pci_ss_info_1148_5041,
+ &pci_ss_info_1148_5043,
+ &pci_ss_info_1148_5051,
+ &pci_ss_info_1148_5061,
+ &pci_ss_info_1148_5071,
+ &pci_ss_info_1148_5521,
+ &pci_ss_info_1148_5522,
+ &pci_ss_info_1148_5541,
+ &pci_ss_info_1148_5543,
+ &pci_ss_info_1148_5544,
+ &pci_ss_info_1148_5821,
+ &pci_ss_info_1148_5822,
+ &pci_ss_info_1148_5841,
+ &pci_ss_info_1148_5843,
+ &pci_ss_info_1148_5844,
+ &pci_ss_info_1148_9521,
+ &pci_ss_info_1148_9821,
+ &pci_ss_info_1148_9822,
+ &pci_ss_info_1148_9841,
+ &pci_ss_info_1148_9842,
+ &pci_ss_info_1148_9843,
+ &pci_ss_info_1148_9844,
+ &pci_ss_info_1148_9861,
+ &pci_ss_info_1148_9862,
+ &pci_ss_info_1148_9871,
+ &pci_ss_info_1148_9872,
+ NULL
+};
+#endif
+#define pci_ss_list_1149 NULL
+#define pci_ss_list_114a NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_114b[] = {
+ &pci_ss_info_114b_2003,
+ NULL
+};
+#endif
+#define pci_ss_list_114c NULL
+#define pci_ss_list_114d NULL
+#define pci_ss_list_114e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_114f[] = {
+ &pci_ss_info_114f_0030,
+ &pci_ss_info_114f_0031,
+ &pci_ss_info_114f_0050,
+ &pci_ss_info_114f_0051,
+ &pci_ss_info_114f_0052,
+ &pci_ss_info_114f_0053,
+ NULL
+};
+#endif
+#define pci_ss_list_1150 NULL
+#define pci_ss_list_1151 NULL
+#define pci_ss_list_1152 NULL
+#define pci_ss_list_1153 NULL
+#define pci_ss_list_1154 NULL
+#define pci_ss_list_1155 NULL
+#define pci_ss_list_1156 NULL
+#define pci_ss_list_1157 NULL
+#define pci_ss_list_1158 NULL
+#define pci_ss_list_1159 NULL
+#define pci_ss_list_115a NULL
+#define pci_ss_list_115b NULL
+#define pci_ss_list_115c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_115d[] = {
+ &pci_ss_info_115d_0002,
+ &pci_ss_info_115d_0181,
+ &pci_ss_info_115d_0182,
+ &pci_ss_info_115d_0183,
+ &pci_ss_info_115d_1081,
+ &pci_ss_info_115d_1181,
+ &pci_ss_info_115d_1182,
+ NULL
+};
+#endif
+#define pci_ss_list_115e NULL
+#define pci_ss_list_115f NULL
+#define pci_ss_list_1160 NULL
+#define pci_ss_list_1161 NULL
+#define pci_ss_list_1162 NULL
+#define pci_ss_list_1163 NULL
+#define pci_ss_list_1164 NULL
+#define pci_ss_list_1165 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1166[] = {
+ &pci_ss_info_1166_1648,
+ NULL
+};
+#endif
+#define pci_ss_list_1167 NULL
+#define pci_ss_list_1168 NULL
+#define pci_ss_list_1169 NULL
+#define pci_ss_list_116a NULL
+#define pci_ss_list_116b NULL
+#define pci_ss_list_116c NULL
+#define pci_ss_list_116d NULL
+#define pci_ss_list_116e NULL
+#define pci_ss_list_116f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1170[] = {
+ &pci_ss_info_1170_3209,
+ NULL
+};
+#endif
+#define pci_ss_list_1171 NULL
+#define pci_ss_list_1172 NULL
+#define pci_ss_list_1173 NULL
+#define pci_ss_list_1174 NULL
+#define pci_ss_list_1175 NULL
+#define pci_ss_list_1176 NULL
+#define pci_ss_list_1177 NULL
+#define pci_ss_list_1178 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1179[] = {
+ &pci_ss_info_1179_0001,
+ &pci_ss_info_1179_0002,
+ &pci_ss_info_1179_0003,
+ &pci_ss_info_1179_0181,
+ &pci_ss_info_1179_0203,
+ &pci_ss_info_1179_0204,
+ &pci_ss_info_1179_ff00,
+ NULL
+};
+#endif
+#define pci_ss_list_117a NULL
+#define pci_ss_list_117b NULL
+#define pci_ss_list_117c NULL
+#define pci_ss_list_117d NULL
+#define pci_ss_list_117e NULL
+#define pci_ss_list_117f NULL
+#define pci_ss_list_1180 NULL
+#define pci_ss_list_1181 NULL
+#define pci_ss_list_1183 NULL
+#define pci_ss_list_1184 NULL
+#define pci_ss_list_1185 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1186[] = {
+ &pci_ss_info_1186_0100,
+ &pci_ss_info_1186_0300,
+ &pci_ss_info_1186_1002,
+ &pci_ss_info_1186_1012,
+ &pci_ss_info_1186_1100,
+ &pci_ss_info_1186_1101,
+ &pci_ss_info_1186_1102,
+ &pci_ss_info_1186_1112,
+ &pci_ss_info_1186_1140,
+ &pci_ss_info_1186_1142,
+ &pci_ss_info_1186_1200,
+ &pci_ss_info_1186_1300,
+ &pci_ss_info_1186_1301,
+ &pci_ss_info_1186_1320,
+ &pci_ss_info_1186_1400,
+ &pci_ss_info_1186_1401,
+ &pci_ss_info_1186_3501,
+ &pci_ss_info_1186_7801,
+ &pci_ss_info_1186_8139,
+ NULL
+};
+#endif
+#define pci_ss_list_1187 NULL
+#define pci_ss_list_1188 NULL
+#define pci_ss_list_1189 NULL
+#define pci_ss_list_118a NULL
+#define pci_ss_list_118b NULL
+#define pci_ss_list_118c NULL
+#define pci_ss_list_118d NULL
+#define pci_ss_list_118e NULL
+#define pci_ss_list_118f NULL
+#define pci_ss_list_1190 NULL
+#define pci_ss_list_1191 NULL
+#define pci_ss_list_1192 NULL
+#define pci_ss_list_1193 NULL
+#define pci_ss_list_1194 NULL
+#define pci_ss_list_1195 NULL
+#define pci_ss_list_1196 NULL
+#define pci_ss_list_1197 NULL
+#define pci_ss_list_1198 NULL
+#define pci_ss_list_1199 NULL
+#define pci_ss_list_119a NULL
+#define pci_ss_list_119b NULL
+#define pci_ss_list_119c NULL
+#define pci_ss_list_119d NULL
+#define pci_ss_list_119e NULL
+#define pci_ss_list_119f NULL
+#define pci_ss_list_11a0 NULL
+#define pci_ss_list_11a1 NULL
+#define pci_ss_list_11a2 NULL
+#define pci_ss_list_11a3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11a4[] = {
+ &pci_ss_info_11a4_000a,
+ &pci_ss_info_11a4_000b,
+ NULL
+};
+#endif
+#define pci_ss_list_11a5 NULL
+#define pci_ss_list_11a6 NULL
+#define pci_ss_list_11a7 NULL
+#define pci_ss_list_11a8 NULL
+#define pci_ss_list_11a9 NULL
+#define pci_ss_list_11aa NULL
+#define pci_ss_list_11ab NULL
+#define pci_ss_list_11ac NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11ad[] = {
+ &pci_ss_info_11ad_0002,
+ &pci_ss_info_11ad_0003,
+ &pci_ss_info_11ad_c001,
+ &pci_ss_info_11ad_f003,
+ &pci_ss_info_11ad_ffff,
+ NULL
+};
+#endif
+#define pci_ss_list_11ae NULL
+#define pci_ss_list_11af NULL
+#define pci_ss_list_11b0 NULL
+#define pci_ss_list_11b1 NULL
+#define pci_ss_list_11b2 NULL
+#define pci_ss_list_11b3 NULL
+#define pci_ss_list_11b4 NULL
+#define pci_ss_list_11b5 NULL
+#define pci_ss_list_11b6 NULL
+#define pci_ss_list_11b7 NULL
+#define pci_ss_list_11b8 NULL
+#define pci_ss_list_11b9 NULL
+#define pci_ss_list_11ba NULL
+#define pci_ss_list_11bb NULL
+#define pci_ss_list_11bc NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11bd[] = {
+ &pci_ss_info_11bd_0006,
+ &pci_ss_info_11bd_000a,
+ &pci_ss_info_11bd_000e,
+ &pci_ss_info_11bd_0012,
+ &pci_ss_info_11bd_001c,
+ NULL
+};
+#endif
+#define pci_ss_list_11be NULL
+#define pci_ss_list_11bf NULL
+#define pci_ss_list_11c0 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11c1[] = {
+ &pci_ss_info_11c1_0440,
+ &pci_ss_info_11c1_0441,
+ &pci_ss_info_11c1_0442,
+ NULL
+};
+#endif
+#define pci_ss_list_11c2 NULL
+#define pci_ss_list_11c3 NULL
+#define pci_ss_list_11c4 NULL
+#define pci_ss_list_11c5 NULL
+#define pci_ss_list_11c6 NULL
+#define pci_ss_list_11c7 NULL
+#define pci_ss_list_11c8 NULL
+#define pci_ss_list_11c9 NULL
+#define pci_ss_list_11ca NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11cb[] = {
+ &pci_ss_info_11cb_0200,
+ &pci_ss_info_11cb_b008,
+ NULL
+};
+#endif
+#define pci_ss_list_11cc NULL
+#define pci_ss_list_11cd NULL
+#define pci_ss_list_11ce NULL
+#define pci_ss_list_11cf NULL
+#define pci_ss_list_11d0 NULL
+#define pci_ss_list_11d1 NULL
+#define pci_ss_list_11d2 NULL
+#define pci_ss_list_11d3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11d4[] = {
+ &pci_ss_info_11d4_0040,
+ &pci_ss_info_11d4_0048,
+ &pci_ss_info_11d4_5340,
+ NULL
+};
+#endif
+#define pci_ss_list_11d5 NULL
+#define pci_ss_list_11d6 NULL
+#define pci_ss_list_11d7 NULL
+#define pci_ss_list_11d8 NULL
+#define pci_ss_list_11d9 NULL
+#define pci_ss_list_11da NULL
+#define pci_ss_list_11db NULL
+#define pci_ss_list_11dc NULL
+#define pci_ss_list_11dd NULL
+#define pci_ss_list_11de NULL
+#define pci_ss_list_11df NULL
+#define pci_ss_list_11e0 NULL
+#define pci_ss_list_11e1 NULL
+#define pci_ss_list_11e2 NULL
+#define pci_ss_list_11e3 NULL
+#define pci_ss_list_11e4 NULL
+#define pci_ss_list_11e5 NULL
+#define pci_ss_list_11e6 NULL
+#define pci_ss_list_11e7 NULL
+#define pci_ss_list_11e8 NULL
+#define pci_ss_list_11e9 NULL
+#define pci_ss_list_11ea NULL
+#define pci_ss_list_11eb NULL
+#define pci_ss_list_11ec NULL
+#define pci_ss_list_11ed NULL
+#define pci_ss_list_11ee NULL
+#define pci_ss_list_11ef NULL
+#define pci_ss_list_11f0 NULL
+#define pci_ss_list_11f1 NULL
+#define pci_ss_list_11f2 NULL
+#define pci_ss_list_11f3 NULL
+#define pci_ss_list_11f4 NULL
+#define pci_ss_list_11f5 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_11f6[] = {
+ &pci_ss_info_11f6_0503,
+ &pci_ss_info_11f6_2011,
+ &pci_ss_info_11f6_8139,
+ NULL
+};
+#endif
+#define pci_ss_list_11f7 NULL
+#define pci_ss_list_11f8 NULL
+#define pci_ss_list_11f9 NULL
+#define pci_ss_list_11fa NULL
+#define pci_ss_list_11fb NULL
+#define pci_ss_list_11fc NULL
+#define pci_ss_list_11fd NULL
+#define pci_ss_list_11fe NULL
+#define pci_ss_list_11ff NULL
+#define pci_ss_list_1200 NULL
+#define pci_ss_list_1201 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1202[] = {
+ &pci_ss_info_1202_9841,
+ &pci_ss_info_1202_9842,
+ &pci_ss_info_1202_9843,
+ &pci_ss_info_1202_9844,
+ NULL
+};
+#endif
+#define pci_ss_list_1203 NULL
+#define pci_ss_list_1204 NULL
+#define pci_ss_list_1205 NULL
+#define pci_ss_list_1206 NULL
+#define pci_ss_list_1208 NULL
+#define pci_ss_list_1209 NULL
+#define pci_ss_list_120a NULL
+#define pci_ss_list_120b NULL
+#define pci_ss_list_120c NULL
+#define pci_ss_list_120d NULL
+#define pci_ss_list_120e NULL
+#define pci_ss_list_120f NULL
+#define pci_ss_list_1210 NULL
+#define pci_ss_list_1211 NULL
+#define pci_ss_list_1212 NULL
+#define pci_ss_list_1213 NULL
+#define pci_ss_list_1214 NULL
+#define pci_ss_list_1215 NULL
+#define pci_ss_list_1216 NULL
+#define pci_ss_list_1217 NULL
+#define pci_ss_list_1218 NULL
+#define pci_ss_list_1219 NULL
+static const pciSubsystemInfo *pci_ss_list_121a[] = {
+ &pci_ss_info_121a_0001,
+ &pci_ss_info_121a_0003,
+ &pci_ss_info_121a_0004,
+ &pci_ss_info_121a_0009,
+ &pci_ss_info_121a_0030,
+ &pci_ss_info_121a_0031,
+ &pci_ss_info_121a_0034,
+ &pci_ss_info_121a_0036,
+ &pci_ss_info_121a_0037,
+ &pci_ss_info_121a_0038,
+ &pci_ss_info_121a_003a,
+ &pci_ss_info_121a_0044,
+ &pci_ss_info_121a_004b,
+ &pci_ss_info_121a_004c,
+ &pci_ss_info_121a_004d,
+ &pci_ss_info_121a_004e,
+ &pci_ss_info_121a_0051,
+ &pci_ss_info_121a_0052,
+ &pci_ss_info_121a_0060,
+ &pci_ss_info_121a_0061,
+ &pci_ss_info_121a_0062,
+ NULL
+};
+#define pci_ss_list_121b NULL
+#define pci_ss_list_121c NULL
+#define pci_ss_list_121d NULL
+#define pci_ss_list_121e NULL
+#define pci_ss_list_121f NULL
+#define pci_ss_list_1220 NULL
+#define pci_ss_list_1221 NULL
+#define pci_ss_list_1222 NULL
+#define pci_ss_list_1223 NULL
+#define pci_ss_list_1224 NULL
+#define pci_ss_list_1225 NULL
+#define pci_ss_list_1227 NULL
+#define pci_ss_list_1228 NULL
+#define pci_ss_list_1229 NULL
+#define pci_ss_list_122a NULL
+#define pci_ss_list_122b NULL
+#define pci_ss_list_122c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_122d[] = {
+ &pci_ss_info_122d_0001,
+ &pci_ss_info_122d_1002,
+ &pci_ss_info_122d_1206,
+ &pci_ss_info_122d_1207,
+ &pci_ss_info_122d_1208,
+ &pci_ss_info_122d_4002,
+ &pci_ss_info_122d_4003,
+ &pci_ss_info_122d_4005,
+ &pci_ss_info_122d_4006,
+ &pci_ss_info_122d_4007,
+ &pci_ss_info_122d_4008,
+ &pci_ss_info_122d_4009,
+ &pci_ss_info_122d_4010,
+ &pci_ss_info_122d_4011,
+ &pci_ss_info_122d_4012,
+ &pci_ss_info_122d_4013,
+ &pci_ss_info_122d_4015,
+ &pci_ss_info_122d_4016,
+ &pci_ss_info_122d_4017,
+ &pci_ss_info_122d_4018,
+ &pci_ss_info_122d_4019,
+ &pci_ss_info_122d_4020,
+ &pci_ss_info_122d_4021,
+ &pci_ss_info_122d_4022,
+ &pci_ss_info_122d_4023,
+ &pci_ss_info_122d_4024,
+ &pci_ss_info_122d_4025,
+ &pci_ss_info_122d_4027,
+ &pci_ss_info_122d_4029,
+ &pci_ss_info_122d_4030,
+ &pci_ss_info_122d_4031,
+ &pci_ss_info_122d_4033,
+ &pci_ss_info_122d_4034,
+ &pci_ss_info_122d_4035,
+ &pci_ss_info_122d_4050,
+ &pci_ss_info_122d_4051,
+ &pci_ss_info_122d_4052,
+ &pci_ss_info_122d_4054,
+ &pci_ss_info_122d_4055,
+ &pci_ss_info_122d_4056,
+ &pci_ss_info_122d_4057,
+ &pci_ss_info_122d_4100,
+ &pci_ss_info_122d_4101,
+ &pci_ss_info_122d_4102,
+ &pci_ss_info_122d_4302,
+ NULL
+};
+#endif
+#define pci_ss_list_122e NULL
+#define pci_ss_list_122f NULL
+#define pci_ss_list_1230 NULL
+#define pci_ss_list_1231 NULL
+#define pci_ss_list_1232 NULL
+#define pci_ss_list_1233 NULL
+#define pci_ss_list_1234 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1235[] = {
+ &pci_ss_info_1235_4320,
+ &pci_ss_info_1235_4321,
+ &pci_ss_info_1235_4322,
+ &pci_ss_info_1235_4324,
+ NULL
+};
+#endif
+#define pci_ss_list_1236 NULL
+#define pci_ss_list_1237 NULL
+#define pci_ss_list_1238 NULL
+#define pci_ss_list_1239 NULL
+#define pci_ss_list_123a NULL
+#define pci_ss_list_123b NULL
+#define pci_ss_list_123c NULL
+#define pci_ss_list_123d NULL
+#define pci_ss_list_123e NULL
+#define pci_ss_list_123f NULL
+#define pci_ss_list_1240 NULL
+#define pci_ss_list_1241 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1242[] = {
+ &pci_ss_info_1242_6562,
+ &pci_ss_info_1242_656a,
+ NULL
+};
+#endif
+#define pci_ss_list_1243 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1244[] = {
+ &pci_ss_info_1244_0a00,
+ NULL
+};
+#endif
+#define pci_ss_list_1245 NULL
+#define pci_ss_list_1246 NULL
+#define pci_ss_list_1247 NULL
+#define pci_ss_list_1248 NULL
+#define pci_ss_list_1249 NULL
+#define pci_ss_list_124a NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_124b[] = {
+ &pci_ss_info_124b_9080,
+ NULL
+};
+#endif
+#define pci_ss_list_124c NULL
+#define pci_ss_list_124d NULL
+#define pci_ss_list_124e NULL
+#define pci_ss_list_124f NULL
+#define pci_ss_list_1250 NULL
+#define pci_ss_list_1251 NULL
+#define pci_ss_list_1253 NULL
+#define pci_ss_list_1254 NULL
+#define pci_ss_list_1255 NULL
+#define pci_ss_list_1256 NULL
+#define pci_ss_list_1257 NULL
+#define pci_ss_list_1258 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1259[] = {
+ &pci_ss_info_1259_2400,
+ &pci_ss_info_1259_2450,
+ &pci_ss_info_1259_2454,
+ &pci_ss_info_1259_2500,
+ &pci_ss_info_1259_2503,
+ &pci_ss_info_1259_2560,
+ &pci_ss_info_1259_2561,
+ &pci_ss_info_1259_2700,
+ &pci_ss_info_1259_2701,
+ &pci_ss_info_1259_2800,
+ &pci_ss_info_1259_2970,
+ &pci_ss_info_1259_2972,
+ &pci_ss_info_1259_2975,
+ &pci_ss_info_1259_2977,
+ NULL
+};
+#endif
+#define pci_ss_list_125a NULL
+#define pci_ss_list_125b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_125c[] = {
+ &pci_ss_info_125c_0640,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_125d[] = {
+ &pci_ss_info_125d_0424,
+ &pci_ss_info_125d_0425,
+ &pci_ss_info_125d_0426,
+ &pci_ss_info_125d_0427,
+ &pci_ss_info_125d_0428,
+ &pci_ss_info_125d_0429,
+ &pci_ss_info_125d_1988,
+ &pci_ss_info_125d_1989,
+ &pci_ss_info_125d_8888,
+ NULL
+};
+#endif
+#define pci_ss_list_125e NULL
+#define pci_ss_list_125f NULL
+#define pci_ss_list_1260 NULL
+#define pci_ss_list_1261 NULL
+#define pci_ss_list_1262 NULL
+#define pci_ss_list_1263 NULL
+#define pci_ss_list_1264 NULL
+#define pci_ss_list_1265 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1266[] = {
+ &pci_ss_info_1266_0001,
+ &pci_ss_info_1266_0004,
+ &pci_ss_info_1266_1910,
+ NULL
+};
+#endif
+#define pci_ss_list_1267 NULL
+#define pci_ss_list_1268 NULL
+#define pci_ss_list_1269 NULL
+#define pci_ss_list_126a NULL
+#define pci_ss_list_126b NULL
+#define pci_ss_list_126c NULL
+#define pci_ss_list_126d NULL
+#define pci_ss_list_126e NULL
+#define pci_ss_list_126f NULL
+#define pci_ss_list_1270 NULL
+#define pci_ss_list_1271 NULL
+#define pci_ss_list_1272 NULL
+#define pci_ss_list_1273 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1274[] = {
+ &pci_ss_info_1274_1371,
+ &pci_ss_info_1274_2000,
+ &pci_ss_info_1274_2003,
+ &pci_ss_info_1274_5880,
+ NULL
+};
+#endif
+#define pci_ss_list_1275 NULL
+#define pci_ss_list_1276 NULL
+#define pci_ss_list_1277 NULL
+#define pci_ss_list_1278 NULL
+#define pci_ss_list_1279 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_127a[] = {
+ &pci_ss_info_127a_0001,
+ &pci_ss_info_127a_0002,
+ &pci_ss_info_127a_0003,
+ &pci_ss_info_127a_0044,
+ &pci_ss_info_127a_0048,
+ &pci_ss_info_127a_0122,
+ &pci_ss_info_127a_0144,
+ &pci_ss_info_127a_0222,
+ &pci_ss_info_127a_0244,
+ &pci_ss_info_127a_0322,
+ &pci_ss_info_127a_0422,
+ &pci_ss_info_127a_1002,
+ &pci_ss_info_127a_1122,
+ &pci_ss_info_127a_1222,
+ &pci_ss_info_127a_1322,
+ &pci_ss_info_127a_1522,
+ &pci_ss_info_127a_1622,
+ &pci_ss_info_127a_1722,
+ &pci_ss_info_127a_4311,
+ NULL
+};
+#endif
+#define pci_ss_list_127b NULL
+#define pci_ss_list_127c NULL
+#define pci_ss_list_127d NULL
+#define pci_ss_list_127e NULL
+#define pci_ss_list_127f NULL
+#define pci_ss_list_1280 NULL
+#define pci_ss_list_1281 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1282[] = {
+ &pci_ss_info_1282_9100,
+ NULL
+};
+#endif
+#define pci_ss_list_1283 NULL
+#define pci_ss_list_1284 NULL
+#define pci_ss_list_1285 NULL
+#define pci_ss_list_1286 NULL
+#define pci_ss_list_1287 NULL
+#define pci_ss_list_1288 NULL
+#define pci_ss_list_1289 NULL
+#define pci_ss_list_128a NULL
+#define pci_ss_list_128b NULL
+#define pci_ss_list_128c NULL
+#define pci_ss_list_128d NULL
+#define pci_ss_list_128e NULL
+#define pci_ss_list_128f NULL
+#define pci_ss_list_1290 NULL
+#define pci_ss_list_1291 NULL
+#define pci_ss_list_1292 NULL
+#define pci_ss_list_1293 NULL
+#define pci_ss_list_1294 NULL
+#define pci_ss_list_1295 NULL
+#define pci_ss_list_1296 NULL
+#define pci_ss_list_1297 NULL
+#define pci_ss_list_1298 NULL
+#define pci_ss_list_1299 NULL
+#define pci_ss_list_129a NULL
+#define pci_ss_list_129b NULL
+#define pci_ss_list_129c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_129d[] = {
+ &pci_ss_info_129d_0002,
+ NULL
+};
+#endif
+#define pci_ss_list_129e NULL
+#define pci_ss_list_129f NULL
+#define pci_ss_list_12a0 NULL
+#define pci_ss_list_12a1 NULL
+#define pci_ss_list_12a2 NULL
+#define pci_ss_list_12a3 NULL
+#define pci_ss_list_12a4 NULL
+#define pci_ss_list_12a5 NULL
+#define pci_ss_list_12a6 NULL
+#define pci_ss_list_12a7 NULL
+#define pci_ss_list_12a8 NULL
+#define pci_ss_list_12a9 NULL
+#define pci_ss_list_12aa NULL
+#define pci_ss_list_12ab NULL
+#define pci_ss_list_12ac NULL
+#define pci_ss_list_12ad NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12ae[] = {
+ &pci_ss_info_12ae_0001,
+ &pci_ss_info_12ae_0002,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12af[] = {
+ &pci_ss_info_12af_0019,
+ NULL
+};
+#endif
+#define pci_ss_list_12b0 NULL
+#define pci_ss_list_12b1 NULL
+#define pci_ss_list_12b2 NULL
+#define pci_ss_list_12b3 NULL
+#define pci_ss_list_12b4 NULL
+#define pci_ss_list_12b5 NULL
+#define pci_ss_list_12b6 NULL
+#define pci_ss_list_12b7 NULL
+#define pci_ss_list_12b8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12b9[] = {
+ &pci_ss_info_12b9_005c,
+ &pci_ss_info_12b9_005e,
+ &pci_ss_info_12b9_0062,
+ &pci_ss_info_12b9_0068,
+ &pci_ss_info_12b9_007a,
+ &pci_ss_info_12b9_007f,
+ &pci_ss_info_12b9_0080,
+ &pci_ss_info_12b9_0081,
+ &pci_ss_info_12b9_0091,
+ &pci_ss_info_12b9_00a2,
+ &pci_ss_info_12b9_00a3,
+ &pci_ss_info_12b9_00aa,
+ &pci_ss_info_12b9_00ab,
+ &pci_ss_info_12b9_00ac,
+ &pci_ss_info_12b9_00ad,
+ NULL
+};
+#endif
+#define pci_ss_list_12ba NULL
+#define pci_ss_list_12bb NULL
+#define pci_ss_list_12bc NULL
+#define pci_ss_list_12bd NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12be[] = {
+ &pci_ss_info_12be_3042,
+ NULL
+};
+#endif
+#define pci_ss_list_12bf NULL
+#define pci_ss_list_12c0 NULL
+#define pci_ss_list_12c1 NULL
+#define pci_ss_list_12c2 NULL
+#define pci_ss_list_12c3 NULL
+#define pci_ss_list_12c4 NULL
+#define pci_ss_list_12c5 NULL
+#define pci_ss_list_12c6 NULL
+#define pci_ss_list_12c7 NULL
+#define pci_ss_list_12c8 NULL
+#define pci_ss_list_12c9 NULL
+#define pci_ss_list_12ca NULL
+#define pci_ss_list_12cb NULL
+#define pci_ss_list_12cc NULL
+#define pci_ss_list_12cd NULL
+#define pci_ss_list_12ce NULL
+#define pci_ss_list_12cf NULL
+#define pci_ss_list_12d0 NULL
+#define pci_ss_list_12d1 NULL
+#define pci_ss_list_12d2 NULL
+#define pci_ss_list_12d3 NULL
+#define pci_ss_list_12d4 NULL
+#define pci_ss_list_12d5 NULL
+#define pci_ss_list_12d6 NULL
+#define pci_ss_list_12d7 NULL
+#define pci_ss_list_12d8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12d9[] = {
+ &pci_ss_info_12d9_000a,
+ NULL
+};
+#endif
+#define pci_ss_list_12da NULL
+#define pci_ss_list_12db NULL
+#define pci_ss_list_12dc NULL
+#define pci_ss_list_12dd NULL
+#define pci_ss_list_12de NULL
+#define pci_ss_list_12df NULL
+#define pci_ss_list_12e0 NULL
+#define pci_ss_list_12e1 NULL
+#define pci_ss_list_12e2 NULL
+#define pci_ss_list_12e3 NULL
+#define pci_ss_list_12e4 NULL
+#define pci_ss_list_12e5 NULL
+#define pci_ss_list_12e6 NULL
+#define pci_ss_list_12e7 NULL
+#define pci_ss_list_12e8 NULL
+#define pci_ss_list_12e9 NULL
+#define pci_ss_list_12ea NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12eb[] = {
+ &pci_ss_info_12eb_0001,
+ &pci_ss_info_12eb_0002,
+ &pci_ss_info_12eb_0003,
+ &pci_ss_info_12eb_0088,
+ &pci_ss_info_12eb_8803,
+ NULL
+};
+#endif
+#define pci_ss_list_12ec NULL
+#define pci_ss_list_12ed NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_12ee[] = {
+ &pci_ss_info_12ee_7000,
+ &pci_ss_info_12ee_7001,
+ &pci_ss_info_12ee_8011,
+ NULL
+};
+#endif
+#define pci_ss_list_12ef NULL
+#define pci_ss_list_12f0 NULL
+#define pci_ss_list_12f1 NULL
+#define pci_ss_list_12f2 NULL
+#define pci_ss_list_12f3 NULL
+#define pci_ss_list_12f4 NULL
+#define pci_ss_list_12f5 NULL
+#define pci_ss_list_12f6 NULL
+#define pci_ss_list_12f7 NULL
+#define pci_ss_list_12f8 NULL
+#define pci_ss_list_12f9 NULL
+#define pci_ss_list_12fb NULL
+#define pci_ss_list_12fc NULL
+#define pci_ss_list_12fd NULL
+#define pci_ss_list_12fe NULL
+#define pci_ss_list_12ff NULL
+#define pci_ss_list_1300 NULL
+#define pci_ss_list_1302 NULL
+#define pci_ss_list_1303 NULL
+#define pci_ss_list_1304 NULL
+#define pci_ss_list_1305 NULL
+#define pci_ss_list_1306 NULL
+#define pci_ss_list_1307 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1308[] = {
+ &pci_ss_info_1308_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_1309 NULL
+#define pci_ss_list_130a NULL
+#define pci_ss_list_130b NULL
+#define pci_ss_list_130c NULL
+#define pci_ss_list_130d NULL
+#define pci_ss_list_130e NULL
+#define pci_ss_list_130f NULL
+#define pci_ss_list_1310 NULL
+#define pci_ss_list_1311 NULL
+#define pci_ss_list_1312 NULL
+#define pci_ss_list_1313 NULL
+#define pci_ss_list_1316 NULL
+#define pci_ss_list_1317 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1318[] = {
+ &pci_ss_info_1318_0000,
+ NULL
+};
+#endif
+#define pci_ss_list_1319 NULL
+#define pci_ss_list_131a NULL
+#define pci_ss_list_131c NULL
+#define pci_ss_list_131d NULL
+#define pci_ss_list_131e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_131f[] = {
+ &pci_ss_info_131f_2030,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1320[] = {
+ &pci_ss_info_1320_10bd,
+ NULL
+};
+#endif
+#define pci_ss_list_1321 NULL
+#define pci_ss_list_1322 NULL
+#define pci_ss_list_1323 NULL
+#define pci_ss_list_1324 NULL
+#define pci_ss_list_1325 NULL
+#define pci_ss_list_1326 NULL
+#define pci_ss_list_1327 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1328[] = {
+ &pci_ss_info_1328_0001,
+ &pci_ss_info_1328_f001,
+ NULL
+};
+#endif
+#define pci_ss_list_1329 NULL
+#define pci_ss_list_132a NULL
+#define pci_ss_list_132b NULL
+#define pci_ss_list_132c NULL
+#define pci_ss_list_132d NULL
+#define pci_ss_list_1330 NULL
+#define pci_ss_list_1331 NULL
+#define pci_ss_list_1332 NULL
+#define pci_ss_list_1334 NULL
+#define pci_ss_list_1335 NULL
+#define pci_ss_list_1337 NULL
+#define pci_ss_list_1338 NULL
+#define pci_ss_list_133a NULL
+#define pci_ss_list_133b NULL
+#define pci_ss_list_133c NULL
+#define pci_ss_list_133d NULL
+#define pci_ss_list_133e NULL
+#define pci_ss_list_133f NULL
+#define pci_ss_list_1340 NULL
+#define pci_ss_list_1341 NULL
+#define pci_ss_list_1342 NULL
+#define pci_ss_list_1343 NULL
+#define pci_ss_list_1344 NULL
+#define pci_ss_list_1345 NULL
+#define pci_ss_list_1347 NULL
+#define pci_ss_list_1349 NULL
+#define pci_ss_list_134a NULL
+#define pci_ss_list_134b NULL
+#define pci_ss_list_134c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_134d[] = {
+ &pci_ss_info_134d_0001,
+ &pci_ss_info_134d_4c21,
+ NULL
+};
+#endif
+#define pci_ss_list_134e NULL
+#define pci_ss_list_134f NULL
+#define pci_ss_list_1350 NULL
+#define pci_ss_list_1351 NULL
+#define pci_ss_list_1353 NULL
+#define pci_ss_list_1354 NULL
+#define pci_ss_list_1355 NULL
+#define pci_ss_list_1356 NULL
+#define pci_ss_list_1359 NULL
+#define pci_ss_list_135a NULL
+#define pci_ss_list_135b NULL
+#define pci_ss_list_135c NULL
+#define pci_ss_list_135d NULL
+#define pci_ss_list_135e NULL
+#define pci_ss_list_135f NULL
+#define pci_ss_list_1360 NULL
+#define pci_ss_list_1361 NULL
+#define pci_ss_list_1362 NULL
+#define pci_ss_list_1363 NULL
+#define pci_ss_list_1364 NULL
+#define pci_ss_list_1365 NULL
+#define pci_ss_list_1366 NULL
+#define pci_ss_list_1367 NULL
+#define pci_ss_list_1368 NULL
+#define pci_ss_list_1369 NULL
+#define pci_ss_list_136a NULL
+#define pci_ss_list_136b NULL
+#define pci_ss_list_136c NULL
+#define pci_ss_list_136d NULL
+#define pci_ss_list_136f NULL
+#define pci_ss_list_1370 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1371[] = {
+ &pci_ss_info_1371_434e,
+ NULL
+};
+#endif
+#define pci_ss_list_1373 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1374[] = {
+ &pci_ss_info_1374_0001,
+ &pci_ss_info_1374_0002,
+ &pci_ss_info_1374_0003,
+ &pci_ss_info_1374_0007,
+ &pci_ss_info_1374_0008,
+ NULL
+};
+#endif
+#define pci_ss_list_1375 NULL
+#define pci_ss_list_1376 NULL
+#define pci_ss_list_1377 NULL
+#define pci_ss_list_1378 NULL
+#define pci_ss_list_1379 NULL
+#define pci_ss_list_137a NULL
+#define pci_ss_list_137b NULL
+#define pci_ss_list_137c NULL
+#define pci_ss_list_137d NULL
+#define pci_ss_list_137e NULL
+#define pci_ss_list_137f NULL
+#define pci_ss_list_1380 NULL
+#define pci_ss_list_1381 NULL
+#define pci_ss_list_1382 NULL
+#define pci_ss_list_1383 NULL
+#define pci_ss_list_1384 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1385[] = {
+ &pci_ss_info_1385_1100,
+ &pci_ss_info_1385_2100,
+ &pci_ss_info_1385_f004,
+ NULL
+};
+#endif
+#define pci_ss_list_1386 NULL
+#define pci_ss_list_1387 NULL
+#define pci_ss_list_1388 NULL
+#define pci_ss_list_1389 NULL
+#define pci_ss_list_138a NULL
+#define pci_ss_list_138b NULL
+#define pci_ss_list_138c NULL
+#define pci_ss_list_138d NULL
+#define pci_ss_list_138e NULL
+#define pci_ss_list_138f NULL
+#define pci_ss_list_1390 NULL
+#define pci_ss_list_1391 NULL
+#define pci_ss_list_1392 NULL
+#define pci_ss_list_1393 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1394[] = {
+ &pci_ss_info_1394_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1395[] = {
+ &pci_ss_info_1395_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_1396 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1397[] = {
+ &pci_ss_info_1397_2bd0,
+ NULL
+};
+#endif
+#define pci_ss_list_1398 NULL
+#define pci_ss_list_1399 NULL
+#define pci_ss_list_139a NULL
+#define pci_ss_list_139b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_139c[] = {
+ &pci_ss_info_139c_0016,
+ &pci_ss_info_139c_0017,
+ NULL
+};
+#endif
+#define pci_ss_list_139d NULL
+#define pci_ss_list_139e NULL
+#define pci_ss_list_139f NULL
+#define pci_ss_list_13a0 NULL
+#define pci_ss_list_13a1 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13a2[] = {
+ &pci_ss_info_13a2_8002,
+ &pci_ss_info_13a2_8006,
+ NULL
+};
+#endif
+#define pci_ss_list_13a3 NULL
+#define pci_ss_list_13a4 NULL
+#define pci_ss_list_13a5 NULL
+#define pci_ss_list_13a6 NULL
+#define pci_ss_list_13a7 NULL
+#define pci_ss_list_13a8 NULL
+#define pci_ss_list_13a9 NULL
+#define pci_ss_list_13aa NULL
+#define pci_ss_list_13ab NULL
+#define pci_ss_list_13ac NULL
+#define pci_ss_list_13ad NULL
+#define pci_ss_list_13ae NULL
+#define pci_ss_list_13af NULL
+#define pci_ss_list_13b0 NULL
+#define pci_ss_list_13b1 NULL
+#define pci_ss_list_13b2 NULL
+#define pci_ss_list_13b3 NULL
+#define pci_ss_list_13b4 NULL
+#define pci_ss_list_13b5 NULL
+#define pci_ss_list_13b6 NULL
+#define pci_ss_list_13b7 NULL
+#define pci_ss_list_13b8 NULL
+#define pci_ss_list_13b9 NULL
+#define pci_ss_list_13ba NULL
+#define pci_ss_list_13bb NULL
+#define pci_ss_list_13bc NULL
+#define pci_ss_list_13bd NULL
+#define pci_ss_list_13be NULL
+#define pci_ss_list_13bf NULL
+#define pci_ss_list_13c0 NULL
+#define pci_ss_list_13c1 NULL
+#define pci_ss_list_13c2 NULL
+#define pci_ss_list_13c3 NULL
+#define pci_ss_list_13c4 NULL
+#define pci_ss_list_13c5 NULL
+#define pci_ss_list_13c6 NULL
+#define pci_ss_list_13c7 NULL
+#define pci_ss_list_13c8 NULL
+#define pci_ss_list_13c9 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13ca[] = {
+ &pci_ss_info_13ca_4231,
+ NULL
+};
+#endif
+#define pci_ss_list_13cb NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13cc[] = {
+ &pci_ss_info_13cc_0000,
+ &pci_ss_info_13cc_0002,
+ &pci_ss_info_13cc_0003,
+ &pci_ss_info_13cc_0004,
+ &pci_ss_info_13cc_0005,
+ &pci_ss_info_13cc_0006,
+ &pci_ss_info_13cc_0007,
+ &pci_ss_info_13cc_0008,
+ &pci_ss_info_13cc_0009,
+ &pci_ss_info_13cc_000a,
+ &pci_ss_info_13cc_000c,
+ NULL
+};
+#endif
+#define pci_ss_list_13cd NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13ce[] = {
+ &pci_ss_info_13ce_8031,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13cf[] = {
+ &pci_ss_info_13cf_8031,
+ NULL
+};
+#endif
+#define pci_ss_list_13d0 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13d1[] = {
+ &pci_ss_info_13d1_ab01,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13d2[] = {
+ &pci_ss_info_13d2_0300,
+ &pci_ss_info_13d2_0301,
+ &pci_ss_info_13d2_0302,
+ NULL
+};
+#endif
+#define pci_ss_list_13d3 NULL
+#define pci_ss_list_13d4 NULL
+#define pci_ss_list_13d5 NULL
+#define pci_ss_list_13d6 NULL
+#define pci_ss_list_13d7 NULL
+#define pci_ss_list_13d8 NULL
+#define pci_ss_list_13d9 NULL
+#define pci_ss_list_13da NULL
+#define pci_ss_list_13db NULL
+#define pci_ss_list_13dc NULL
+#define pci_ss_list_13dd NULL
+#define pci_ss_list_13de NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13df[] = {
+ &pci_ss_info_13df_0001,
+ &pci_ss_info_13df_1003,
+ &pci_ss_info_13df_1005,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13e0[] = {
+ &pci_ss_info_13e0_0012,
+ &pci_ss_info_13e0_0020,
+ &pci_ss_info_13e0_0030,
+ &pci_ss_info_13e0_0040,
+ &pci_ss_info_13e0_0041,
+ &pci_ss_info_13e0_0042,
+ &pci_ss_info_13e0_0100,
+ &pci_ss_info_13e0_0117,
+ &pci_ss_info_13e0_0147,
+ &pci_ss_info_13e0_0187,
+ &pci_ss_info_13e0_0197,
+ &pci_ss_info_13e0_01a7,
+ &pci_ss_info_13e0_01b7,
+ &pci_ss_info_13e0_01c7,
+ &pci_ss_info_13e0_01d7,
+ &pci_ss_info_13e0_01f7,
+ &pci_ss_info_13e0_0209,
+ &pci_ss_info_13e0_020a,
+ &pci_ss_info_13e0_020d,
+ &pci_ss_info_13e0_020e,
+ &pci_ss_info_13e0_0210,
+ &pci_ss_info_13e0_0240,
+ &pci_ss_info_13e0_0247,
+ &pci_ss_info_13e0_0250,
+ &pci_ss_info_13e0_0260,
+ &pci_ss_info_13e0_0261,
+ &pci_ss_info_13e0_0270,
+ &pci_ss_info_13e0_0290,
+ &pci_ss_info_13e0_0297,
+ &pci_ss_info_13e0_02a0,
+ &pci_ss_info_13e0_02b0,
+ &pci_ss_info_13e0_02c0,
+ &pci_ss_info_13e0_02c7,
+ &pci_ss_info_13e0_02d0,
+ &pci_ss_info_13e0_0410,
+ &pci_ss_info_13e0_0412,
+ &pci_ss_info_13e0_0420,
+ &pci_ss_info_13e0_0440,
+ &pci_ss_info_13e0_0441,
+ &pci_ss_info_13e0_0442,
+ &pci_ss_info_13e0_0443,
+ &pci_ss_info_13e0_0450,
+ &pci_ss_info_13e0_8d84,
+ &pci_ss_info_13e0_8d85,
+ &pci_ss_info_13e0_f100,
+ &pci_ss_info_13e0_f101,
+ &pci_ss_info_13e0_f102,
+ NULL
+};
+#endif
+#define pci_ss_list_13e1 NULL
+#define pci_ss_list_13e2 NULL
+#define pci_ss_list_13e3 NULL
+#define pci_ss_list_13e4 NULL
+#define pci_ss_list_13e5 NULL
+#define pci_ss_list_13e6 NULL
+#define pci_ss_list_13e7 NULL
+#define pci_ss_list_13e8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13e9[] = {
+ &pci_ss_info_13e9_0070,
+ NULL
+};
+#endif
+#define pci_ss_list_13ea NULL
+#define pci_ss_list_13eb NULL
+#define pci_ss_list_13ec NULL
+#define pci_ss_list_13ed NULL
+#define pci_ss_list_13ee NULL
+#define pci_ss_list_13ef NULL
+#define pci_ss_list_13f0 NULL
+#define pci_ss_list_13f1 NULL
+#define pci_ss_list_13f2 NULL
+#define pci_ss_list_13f3 NULL
+#define pci_ss_list_13f4 NULL
+#define pci_ss_list_13f5 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13f6[] = {
+ &pci_ss_info_13f6_0101,
+ &pci_ss_info_13f6_0111,
+ &pci_ss_info_13f6_ffff,
+ NULL
+};
+#endif
+#define pci_ss_list_13f7 NULL
+#define pci_ss_list_13f8 NULL
+#define pci_ss_list_13f9 NULL
+#define pci_ss_list_13fa NULL
+#define pci_ss_list_13fb NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_13fc[] = {
+ &pci_ss_info_13fc_2471,
+ NULL
+};
+#endif
+#define pci_ss_list_13fd NULL
+#define pci_ss_list_13fe NULL
+#define pci_ss_list_13ff NULL
+#define pci_ss_list_1400 NULL
+#define pci_ss_list_1401 NULL
+#define pci_ss_list_1402 NULL
+#define pci_ss_list_1403 NULL
+#define pci_ss_list_1404 NULL
+#define pci_ss_list_1405 NULL
+#define pci_ss_list_1406 NULL
+#define pci_ss_list_1407 NULL
+#define pci_ss_list_1408 NULL
+#define pci_ss_list_1409 NULL
+#define pci_ss_list_140a NULL
+#define pci_ss_list_140b NULL
+#define pci_ss_list_140c NULL
+#define pci_ss_list_140d NULL
+#define pci_ss_list_140e NULL
+#define pci_ss_list_140f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1410[] = {
+ &pci_ss_info_1410_0104,
+ NULL
+};
+#endif
+#define pci_ss_list_1411 NULL
+#define pci_ss_list_1412 NULL
+#define pci_ss_list_1413 NULL
+#define pci_ss_list_1414 NULL
+#define pci_ss_list_1415 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1416[] = {
+ &pci_ss_info_1416_9804,
+ NULL
+};
+#endif
+#define pci_ss_list_1417 NULL
+#define pci_ss_list_1418 NULL
+#define pci_ss_list_1419 NULL
+#define pci_ss_list_141a NULL
+#define pci_ss_list_141b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_141d[] = {
+ &pci_ss_info_141d_0440,
+ NULL
+};
+#endif
+#define pci_ss_list_141e NULL
+#define pci_ss_list_141f NULL
+#define pci_ss_list_1420 NULL
+#define pci_ss_list_1421 NULL
+#define pci_ss_list_1422 NULL
+#define pci_ss_list_1423 NULL
+#define pci_ss_list_1424 NULL
+#define pci_ss_list_1425 NULL
+#define pci_ss_list_1426 NULL
+#define pci_ss_list_1427 NULL
+#define pci_ss_list_1428 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1429[] = {
+ &pci_ss_info_1429_d010,
+ NULL
+};
+#endif
+#define pci_ss_list_142a NULL
+#define pci_ss_list_142b NULL
+#define pci_ss_list_142c NULL
+#define pci_ss_list_142d NULL
+#define pci_ss_list_142e NULL
+#define pci_ss_list_142f NULL
+#define pci_ss_list_1430 NULL
+#define pci_ss_list_1431 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1432[] = {
+ &pci_ss_info_1432_9130,
+ NULL
+};
+#endif
+#define pci_ss_list_1433 NULL
+#define pci_ss_list_1435 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1436[] = {
+ &pci_ss_info_1436_0300,
+ &pci_ss_info_1436_0301,
+ &pci_ss_info_1436_0302,
+ &pci_ss_info_1436_0440,
+ &pci_ss_info_1436_1003,
+ &pci_ss_info_1436_1005,
+ &pci_ss_info_1436_1103,
+ &pci_ss_info_1436_1105,
+ &pci_ss_info_1436_1203,
+ &pci_ss_info_1436_1303,
+ &pci_ss_info_1436_1602,
+ &pci_ss_info_1436_8139,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1437[] = {
+ &pci_ss_info_1437_1105,
+ NULL
+};
+#endif
+#define pci_ss_list_1438 NULL
+#define pci_ss_list_1439 NULL
+#define pci_ss_list_143a NULL
+#define pci_ss_list_143b NULL
+#define pci_ss_list_143c NULL
+#define pci_ss_list_143d NULL
+#define pci_ss_list_143e NULL
+#define pci_ss_list_143f NULL
+#define pci_ss_list_1440 NULL
+#define pci_ss_list_1441 NULL
+#define pci_ss_list_1442 NULL
+#define pci_ss_list_1443 NULL
+#define pci_ss_list_1444 NULL
+#define pci_ss_list_1445 NULL
+#define pci_ss_list_1446 NULL
+#define pci_ss_list_1447 NULL
+#define pci_ss_list_1448 NULL
+#define pci_ss_list_1449 NULL
+#define pci_ss_list_144a NULL
+#define pci_ss_list_144b NULL
+#define pci_ss_list_144c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_144d[] = {
+ &pci_ss_info_144d_2101,
+ &pci_ss_info_144d_2104,
+ &pci_ss_info_144d_2115,
+ &pci_ss_info_144d_2321,
+ &pci_ss_info_144d_2501,
+ &pci_ss_info_144d_2502,
+ &pci_ss_info_144d_2602,
+ &pci_ss_info_144d_3510,
+ &pci_ss_info_144d_c000,
+ &pci_ss_info_144d_c001,
+ &pci_ss_info_144d_c003,
+ &pci_ss_info_144d_c006,
+ NULL
+};
+#endif
+#define pci_ss_list_144e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_144f[] = {
+ &pci_ss_info_144f_0441,
+ &pci_ss_info_144f_0449,
+ &pci_ss_info_144f_1005,
+ &pci_ss_info_144f_100c,
+ &pci_ss_info_144f_1104,
+ &pci_ss_info_144f_110d,
+ &pci_ss_info_144f_1500,
+ &pci_ss_info_144f_1501,
+ &pci_ss_info_144f_1502,
+ &pci_ss_info_144f_1503,
+ &pci_ss_info_144f_150a,
+ &pci_ss_info_144f_150b,
+ &pci_ss_info_144f_1510,
+ &pci_ss_info_144f_3000,
+ &pci_ss_info_144f_4005,
+ NULL
+};
+#endif
+#define pci_ss_list_1450 NULL
+#define pci_ss_list_1451 NULL
+#define pci_ss_list_1453 NULL
+#define pci_ss_list_1454 NULL
+#define pci_ss_list_1455 NULL
+#define pci_ss_list_1456 NULL
+#define pci_ss_list_1457 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1458[] = {
+ &pci_ss_info_1458_0400,
+ &pci_ss_info_1458_0596,
+ &pci_ss_info_1458_0691,
+ &pci_ss_info_1458_4000,
+ &pci_ss_info_1458_4002,
+ &pci_ss_info_1458_5000,
+ &pci_ss_info_1458_5001,
+ &pci_ss_info_1458_5002,
+ &pci_ss_info_1458_5004,
+ &pci_ss_info_1458_7600,
+ &pci_ss_info_1458_a000,
+ &pci_ss_info_1458_a002,
+ NULL
+};
+#endif
+#define pci_ss_list_1459 NULL
+#define pci_ss_list_145a NULL
+#define pci_ss_list_145b NULL
+#define pci_ss_list_145c NULL
+#define pci_ss_list_145d NULL
+#define pci_ss_list_145e NULL
+#define pci_ss_list_145f NULL
+#define pci_ss_list_1460 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1461[] = {
+ &pci_ss_info_1461_0004,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1462[] = {
+ &pci_ss_info_1462_3091,
+ &pci_ss_info_1462_3370,
+ &pci_ss_info_1462_3981,
+ &pci_ss_info_1462_400a,
+ &pci_ss_info_1462_5800,
+ &pci_ss_info_1462_6470,
+ &pci_ss_info_1462_6560,
+ &pci_ss_info_1462_6630,
+ &pci_ss_info_1462_6631,
+ &pci_ss_info_1462_6632,
+ &pci_ss_info_1462_6633,
+ &pci_ss_info_1462_6780,
+ &pci_ss_info_1462_6820,
+ &pci_ss_info_1462_6822,
+ &pci_ss_info_1462_6830,
+ &pci_ss_info_1462_6880,
+ &pci_ss_info_1462_6900,
+ &pci_ss_info_1462_6910,
+ &pci_ss_info_1462_6930,
+ &pci_ss_info_1462_6990,
+ &pci_ss_info_1462_6991,
+ &pci_ss_info_1462_8661,
+ &pci_ss_info_1462_8730,
+ &pci_ss_info_1462_8808,
+ &pci_ss_info_1462_8817,
+ &pci_ss_info_1462_8831,
+ NULL
+};
+#endif
+#define pci_ss_list_1463 NULL
+#define pci_ss_list_1464 NULL
+#define pci_ss_list_1465 NULL
+#define pci_ss_list_1466 NULL
+#define pci_ss_list_1467 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1468[] = {
+ &pci_ss_info_1468_0410,
+ &pci_ss_info_1468_0440,
+ &pci_ss_info_1468_0441,
+ &pci_ss_info_1468_0449,
+ &pci_ss_info_1468_2015,
+ NULL
+};
+#endif
+#define pci_ss_list_1469 NULL
+#define pci_ss_list_146a NULL
+#define pci_ss_list_146b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_146c[] = {
+ &pci_ss_info_146c_1439,
+ NULL
+};
+#endif
+#define pci_ss_list_146d NULL
+#define pci_ss_list_146e NULL
+#define pci_ss_list_146f NULL
+#define pci_ss_list_1470 NULL
+#define pci_ss_list_1471 NULL
+#define pci_ss_list_1472 NULL
+#define pci_ss_list_1473 NULL
+#define pci_ss_list_1474 NULL
+#define pci_ss_list_1475 NULL
+#define pci_ss_list_1476 NULL
+#define pci_ss_list_1477 NULL
+#define pci_ss_list_1478 NULL
+#define pci_ss_list_1479 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_147a[] = {
+ &pci_ss_info_147a_c001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_147b[] = {
+ &pci_ss_info_147b_0507,
+ &pci_ss_info_147b_8f00,
+ &pci_ss_info_147b_8f09,
+ &pci_ss_info_147b_a401,
+ &pci_ss_info_147b_a702,
+ NULL
+};
+#endif
+#define pci_ss_list_147c NULL
+#define pci_ss_list_147d NULL
+#define pci_ss_list_147e NULL
+#define pci_ss_list_147f NULL
+#define pci_ss_list_1480 NULL
+#define pci_ss_list_1481 NULL
+#define pci_ss_list_1482 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1483[] = {
+ &pci_ss_info_1483_5020,
+ &pci_ss_info_1483_5021,
+ &pci_ss_info_1483_5022,
+ NULL
+};
+#endif
+#define pci_ss_list_1484 NULL
+#define pci_ss_list_1485 NULL
+#define pci_ss_list_1486 NULL
+#define pci_ss_list_1487 NULL
+#define pci_ss_list_1488 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1489[] = {
+ &pci_ss_info_1489_6001,
+ &pci_ss_info_1489_6002,
+ NULL
+};
+#endif
+#define pci_ss_list_148a NULL
+#define pci_ss_list_148b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_148c[] = {
+ &pci_ss_info_148c_2003,
+ &pci_ss_info_148c_2023,
+ &pci_ss_info_148c_2024,
+ &pci_ss_info_148c_2025,
+ &pci_ss_info_148c_2026,
+ &pci_ss_info_148c_2036,
+ &pci_ss_info_148c_2039,
+ NULL
+};
+#endif
+#define pci_ss_list_148d NULL
+#define pci_ss_list_148e NULL
+#define pci_ss_list_148f NULL
+#define pci_ss_list_1490 NULL
+#define pci_ss_list_1491 NULL
+#define pci_ss_list_1492 NULL
+#define pci_ss_list_1493 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1494[] = {
+ &pci_ss_info_1494_0300,
+ &pci_ss_info_1494_0301,
+ NULL
+};
+#endif
+#define pci_ss_list_1495 NULL
+#define pci_ss_list_1496 NULL
+#define pci_ss_list_1497 NULL
+#define pci_ss_list_1498 NULL
+#define pci_ss_list_1499 NULL
+#define pci_ss_list_149a NULL
+#define pci_ss_list_149b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_149c[] = {
+ &pci_ss_info_149c_139a,
+ &pci_ss_info_149c_8139,
+ NULL
+};
+#endif
+#define pci_ss_list_149d NULL
+#define pci_ss_list_149e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_149f[] = {
+ &pci_ss_info_149f_0440,
+ NULL
+};
+#endif
+#define pci_ss_list_14a0 NULL
+#define pci_ss_list_14a1 NULL
+#define pci_ss_list_14a2 NULL
+#define pci_ss_list_14a3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14a4[] = {
+ &pci_ss_info_14a4_2073,
+ &pci_ss_info_14a4_2077,
+ &pci_ss_info_14a4_2089,
+ &pci_ss_info_14a4_2091,
+ &pci_ss_info_14a4_2104,
+ &pci_ss_info_14a4_2105,
+ &pci_ss_info_14a4_2106,
+ &pci_ss_info_14a4_2107,
+ &pci_ss_info_14a4_2172,
+ NULL
+};
+#endif
+#define pci_ss_list_14a5 NULL
+#define pci_ss_list_14a6 NULL
+#define pci_ss_list_14a7 NULL
+#define pci_ss_list_14a8 NULL
+#define pci_ss_list_14a9 NULL
+#define pci_ss_list_14aa NULL
+#define pci_ss_list_14ab NULL
+#define pci_ss_list_14ac NULL
+#define pci_ss_list_14ad NULL
+#define pci_ss_list_14ae NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14af[] = {
+ &pci_ss_info_14af_0002,
+ &pci_ss_info_14af_5008,
+ &pci_ss_info_14af_5021,
+ &pci_ss_info_14af_5022,
+ &pci_ss_info_14af_5810,
+ &pci_ss_info_14af_5820,
+ &pci_ss_info_14af_7102,
+ &pci_ss_info_14af_7103,
+ NULL
+};
+#endif
+#define pci_ss_list_14b0 NULL
+#define pci_ss_list_14b1 NULL
+#define pci_ss_list_14b2 NULL
+#define pci_ss_list_14b3 NULL
+#define pci_ss_list_14b4 NULL
+#define pci_ss_list_14b5 NULL
+#define pci_ss_list_14b6 NULL
+#define pci_ss_list_14b7 NULL
+#define pci_ss_list_14b8 NULL
+#define pci_ss_list_14b9 NULL
+#define pci_ss_list_14ba NULL
+#define pci_ss_list_14bb NULL
+#define pci_ss_list_14bc NULL
+#define pci_ss_list_14bd NULL
+#define pci_ss_list_14be NULL
+#define pci_ss_list_14bf NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14c0[] = {
+ &pci_ss_info_14c0_0004,
+ &pci_ss_info_14c0_000c,
+ NULL
+};
+#endif
+#define pci_ss_list_14c1 NULL
+#define pci_ss_list_14c2 NULL
+#define pci_ss_list_14c3 NULL
+#define pci_ss_list_14c4 NULL
+#define pci_ss_list_14c5 NULL
+#define pci_ss_list_14c6 NULL
+#define pci_ss_list_14c7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14c8[] = {
+ &pci_ss_info_14c8_0300,
+ &pci_ss_info_14c8_0302,
+ NULL
+};
+#endif
+#define pci_ss_list_14c9 NULL
+#define pci_ss_list_14ca NULL
+#define pci_ss_list_14cb NULL
+#define pci_ss_list_14cc NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14cd[] = {
+ &pci_ss_info_14cd_2194,
+ NULL
+};
+#endif
+#define pci_ss_list_14ce NULL
+#define pci_ss_list_14cf NULL
+#define pci_ss_list_14d0 NULL
+#define pci_ss_list_14d1 NULL
+#define pci_ss_list_14d2 NULL
+#define pci_ss_list_14d3 NULL
+#define pci_ss_list_14d4 NULL
+#define pci_ss_list_14d5 NULL
+#define pci_ss_list_14d6 NULL
+#define pci_ss_list_14d7 NULL
+#define pci_ss_list_14d8 NULL
+#define pci_ss_list_14d9 NULL
+#define pci_ss_list_14da NULL
+#define pci_ss_list_14db NULL
+#define pci_ss_list_14dc NULL
+#define pci_ss_list_14dd NULL
+#define pci_ss_list_14de NULL
+#define pci_ss_list_14df NULL
+#define pci_ss_list_14e1 NULL
+#define pci_ss_list_14e2 NULL
+#define pci_ss_list_14e3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14e4[] = {
+ &pci_ss_info_14e4_0001,
+ &pci_ss_info_14e4_0002,
+ &pci_ss_info_14e4_0003,
+ &pci_ss_info_14e4_0004,
+ &pci_ss_info_14e4_0005,
+ &pci_ss_info_14e4_0006,
+ &pci_ss_info_14e4_0007,
+ &pci_ss_info_14e4_0008,
+ &pci_ss_info_14e4_0009,
+ &pci_ss_info_14e4_000a,
+ &pci_ss_info_14e4_000b,
+ &pci_ss_info_14e4_000c,
+ &pci_ss_info_14e4_000d,
+ &pci_ss_info_14e4_1028,
+ &pci_ss_info_14e4_1644,
+ &pci_ss_info_14e4_8008,
+ &pci_ss_info_14e4_8009,
+ &pci_ss_info_14e4_800a,
+ NULL
+};
+#endif
+#define pci_ss_list_14e5 NULL
+#define pci_ss_list_14e6 NULL
+#define pci_ss_list_14e7 NULL
+#define pci_ss_list_14e8 NULL
+#define pci_ss_list_14e9 NULL
+#define pci_ss_list_14ea NULL
+#define pci_ss_list_14eb NULL
+#define pci_ss_list_14ec NULL
+#define pci_ss_list_14ed NULL
+#define pci_ss_list_14ee NULL
+#define pci_ss_list_14ef NULL
+#define pci_ss_list_14f0 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14f1[] = {
+ &pci_ss_info_14f1_0001,
+ &pci_ss_info_14f1_0002,
+ &pci_ss_info_14f1_0003,
+ &pci_ss_info_14f1_0044,
+ &pci_ss_info_14f1_0048,
+ &pci_ss_info_14f1_0122,
+ &pci_ss_info_14f1_0144,
+ &pci_ss_info_14f1_0222,
+ &pci_ss_info_14f1_0244,
+ &pci_ss_info_14f1_0322,
+ &pci_ss_info_14f1_0422,
+ &pci_ss_info_14f1_1122,
+ &pci_ss_info_14f1_1222,
+ &pci_ss_info_14f1_1322,
+ &pci_ss_info_14f1_1522,
+ &pci_ss_info_14f1_1622,
+ &pci_ss_info_14f1_1722,
+ &pci_ss_info_14f1_2004,
+ &pci_ss_info_14f1_5421,
+ NULL
+};
+#endif
+#define pci_ss_list_14f2 NULL
+#define pci_ss_list_14f3 NULL
+#define pci_ss_list_14f4 NULL
+#define pci_ss_list_14f5 NULL
+#define pci_ss_list_14f6 NULL
+#define pci_ss_list_14f7 NULL
+#define pci_ss_list_14f8 NULL
+#define pci_ss_list_14f9 NULL
+#define pci_ss_list_14fa NULL
+#define pci_ss_list_14fb NULL
+#define pci_ss_list_14fc NULL
+#define pci_ss_list_14fd NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14fe[] = {
+ &pci_ss_info_14fe_0428,
+ &pci_ss_info_14fe_0429,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_14ff[] = {
+ &pci_ss_info_14ff_1100,
+ NULL
+};
+#endif
+#define pci_ss_list_1500 NULL
+#define pci_ss_list_1501 NULL
+#define pci_ss_list_1502 NULL
+#define pci_ss_list_1503 NULL
+#define pci_ss_list_1504 NULL
+#define pci_ss_list_1505 NULL
+#define pci_ss_list_1506 NULL
+#define pci_ss_list_1507 NULL
+#define pci_ss_list_1508 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1509[] = {
+ &pci_ss_info_1509_7002,
+ &pci_ss_info_1509_9902,
+ &pci_ss_info_1509_9903,
+ &pci_ss_info_1509_9904,
+ &pci_ss_info_1509_9905,
+ &pci_ss_info_1509_9a00,
+ NULL
+};
+#endif
+#define pci_ss_list_150a NULL
+#define pci_ss_list_150b NULL
+#define pci_ss_list_150c NULL
+#define pci_ss_list_150d NULL
+#define pci_ss_list_150e NULL
+#define pci_ss_list_150f NULL
+#define pci_ss_list_1510 NULL
+#define pci_ss_list_1511 NULL
+#define pci_ss_list_1512 NULL
+#define pci_ss_list_1513 NULL
+#define pci_ss_list_1514 NULL
+#define pci_ss_list_1515 NULL
+#define pci_ss_list_1516 NULL
+#define pci_ss_list_1517 NULL
+#define pci_ss_list_1518 NULL
+#define pci_ss_list_1519 NULL
+#define pci_ss_list_151a NULL
+#define pci_ss_list_151b NULL
+#define pci_ss_list_151c NULL
+#define pci_ss_list_151d NULL
+#define pci_ss_list_151e NULL
+#define pci_ss_list_151f NULL
+#define pci_ss_list_1520 NULL
+#define pci_ss_list_1521 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1522[] = {
+ &pci_ss_info_1522_0001,
+ &pci_ss_info_1522_0002,
+ &pci_ss_info_1522_0003,
+ &pci_ss_info_1522_0004,
+ &pci_ss_info_1522_0010,
+ &pci_ss_info_1522_0020,
+ &pci_ss_info_1522_0200,
+ &pci_ss_info_1522_0300,
+ &pci_ss_info_1522_0400,
+ &pci_ss_info_1522_0500,
+ &pci_ss_info_1522_0600,
+ &pci_ss_info_1522_0700,
+ &pci_ss_info_1522_0800,
+ NULL
+};
+#endif
+#define pci_ss_list_1523 NULL
+#define pci_ss_list_1524 NULL
+#define pci_ss_list_1525 NULL
+#define pci_ss_list_1526 NULL
+#define pci_ss_list_1527 NULL
+#define pci_ss_list_1528 NULL
+#define pci_ss_list_1529 NULL
+#define pci_ss_list_152a NULL
+#define pci_ss_list_152b NULL
+#define pci_ss_list_152c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_152d[] = {
+ &pci_ss_info_152d_8801,
+ &pci_ss_info_152d_8802,
+ &pci_ss_info_152d_8803,
+ &pci_ss_info_152d_8804,
+ &pci_ss_info_152d_8805,
+ &pci_ss_info_152d_8808,
+ NULL
+};
+#endif
+#define pci_ss_list_152e NULL
+#define pci_ss_list_152f NULL
+#define pci_ss_list_1530 NULL
+#define pci_ss_list_1531 NULL
+#define pci_ss_list_1532 NULL
+#define pci_ss_list_1533 NULL
+#define pci_ss_list_1534 NULL
+#define pci_ss_list_1535 NULL
+#define pci_ss_list_1537 NULL
+#define pci_ss_list_1538 NULL
+#define pci_ss_list_1539 NULL
+#define pci_ss_list_153a NULL
+#define pci_ss_list_153b NULL
+#define pci_ss_list_153c NULL
+#define pci_ss_list_153d NULL
+#define pci_ss_list_153e NULL
+#define pci_ss_list_153f NULL
+#define pci_ss_list_1540 NULL
+#define pci_ss_list_1541 NULL
+#define pci_ss_list_1542 NULL
+#define pci_ss_list_1543 NULL
+#define pci_ss_list_1544 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1545[] = {
+ &pci_ss_info_1545_002f,
+ NULL
+};
+#endif
+#define pci_ss_list_1546 NULL
+#define pci_ss_list_1547 NULL
+#define pci_ss_list_1548 NULL
+#define pci_ss_list_1549 NULL
+#define pci_ss_list_154a NULL
+#define pci_ss_list_154b NULL
+#define pci_ss_list_154c NULL
+#define pci_ss_list_154d NULL
+#define pci_ss_list_154e NULL
+#define pci_ss_list_154f NULL
+#define pci_ss_list_1550 NULL
+#define pci_ss_list_1551 NULL
+#define pci_ss_list_1552 NULL
+#define pci_ss_list_1553 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1554[] = {
+ &pci_ss_info_1554_1041,
+ NULL
+};
+#endif
+#define pci_ss_list_1555 NULL
+#define pci_ss_list_1556 NULL
+#define pci_ss_list_1557 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1558[] = {
+ &pci_ss_info_1558_1103,
+ &pci_ss_info_1558_2200,
+ NULL
+};
+#endif
+#define pci_ss_list_1559 NULL
+#define pci_ss_list_155a NULL
+#define pci_ss_list_155b NULL
+#define pci_ss_list_155c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_155d[] = {
+ &pci_ss_info_155d_2f07,
+ &pci_ss_info_155d_6793,
+ &pci_ss_info_155d_8850,
+ NULL
+};
+#endif
+#define pci_ss_list_155e NULL
+#define pci_ss_list_155f NULL
+#define pci_ss_list_1560 NULL
+#define pci_ss_list_1561 NULL
+#define pci_ss_list_1562 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1563[] = {
+ &pci_ss_info_1563_7018,
+ NULL
+};
+#endif
+#define pci_ss_list_1564 NULL
+#define pci_ss_list_1565 NULL
+#define pci_ss_list_1566 NULL
+#define pci_ss_list_1567 NULL
+#define pci_ss_list_1568 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1569[] = {
+ &pci_ss_info_1569_6326,
+ NULL
+};
+#endif
+#define pci_ss_list_156a NULL
+#define pci_ss_list_156b NULL
+#define pci_ss_list_156c NULL
+#define pci_ss_list_156d NULL
+#define pci_ss_list_156e NULL
+#define pci_ss_list_156f NULL
+#define pci_ss_list_1570 NULL
+#define pci_ss_list_1571 NULL
+#define pci_ss_list_1572 NULL
+#define pci_ss_list_1573 NULL
+#define pci_ss_list_1574 NULL
+#define pci_ss_list_1575 NULL
+#define pci_ss_list_1576 NULL
+#define pci_ss_list_1578 NULL
+#define pci_ss_list_1579 NULL
+#define pci_ss_list_157a NULL
+#define pci_ss_list_157b NULL
+#define pci_ss_list_157c NULL
+#define pci_ss_list_157d NULL
+#define pci_ss_list_157e NULL
+#define pci_ss_list_157f NULL
+#define pci_ss_list_1580 NULL
+#define pci_ss_list_1581 NULL
+#define pci_ss_list_1582 NULL
+#define pci_ss_list_1583 NULL
+#define pci_ss_list_1584 NULL
+#define pci_ss_list_1585 NULL
+#define pci_ss_list_1586 NULL
+#define pci_ss_list_1587 NULL
+#define pci_ss_list_1588 NULL
+#define pci_ss_list_1589 NULL
+#define pci_ss_list_158a NULL
+#define pci_ss_list_158b NULL
+#define pci_ss_list_158c NULL
+#define pci_ss_list_158d NULL
+#define pci_ss_list_158e NULL
+#define pci_ss_list_158f NULL
+#define pci_ss_list_1590 NULL
+#define pci_ss_list_1591 NULL
+#define pci_ss_list_1592 NULL
+#define pci_ss_list_1593 NULL
+#define pci_ss_list_1594 NULL
+#define pci_ss_list_1595 NULL
+#define pci_ss_list_1596 NULL
+#define pci_ss_list_1597 NULL
+#define pci_ss_list_1598 NULL
+#define pci_ss_list_1599 NULL
+#define pci_ss_list_159a NULL
+#define pci_ss_list_159b NULL
+#define pci_ss_list_159c NULL
+#define pci_ss_list_159d NULL
+#define pci_ss_list_159e NULL
+#define pci_ss_list_159f NULL
+#define pci_ss_list_15a0 NULL
+#define pci_ss_list_15a1 NULL
+#define pci_ss_list_15a2 NULL
+#define pci_ss_list_15a3 NULL
+#define pci_ss_list_15a4 NULL
+#define pci_ss_list_15a5 NULL
+#define pci_ss_list_15a6 NULL
+#define pci_ss_list_15a7 NULL
+#define pci_ss_list_15a8 NULL
+#define pci_ss_list_15aa NULL
+#define pci_ss_list_15ab NULL
+#define pci_ss_list_15ac NULL
+#define pci_ss_list_15ad NULL
+#define pci_ss_list_15ae NULL
+#define pci_ss_list_15b0 NULL
+#define pci_ss_list_15b1 NULL
+#define pci_ss_list_15b2 NULL
+#define pci_ss_list_15b3 NULL
+#define pci_ss_list_15b4 NULL
+#define pci_ss_list_15b5 NULL
+#define pci_ss_list_15b6 NULL
+#define pci_ss_list_15b7 NULL
+#define pci_ss_list_15b8 NULL
+#define pci_ss_list_15b9 NULL
+#define pci_ss_list_15ba NULL
+#define pci_ss_list_15bb NULL
+#define pci_ss_list_15bc NULL
+#define pci_ss_list_15bd NULL
+#define pci_ss_list_15be NULL
+#define pci_ss_list_15bf NULL
+#define pci_ss_list_15c0 NULL
+#define pci_ss_list_15c1 NULL
+#define pci_ss_list_15c2 NULL
+#define pci_ss_list_15c3 NULL
+#define pci_ss_list_15c4 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_15c5[] = {
+ &pci_ss_info_15c5_0111,
+ NULL
+};
+#endif
+#define pci_ss_list_15c6 NULL
+#define pci_ss_list_15c7 NULL
+#define pci_ss_list_15c8 NULL
+#define pci_ss_list_15c9 NULL
+#define pci_ss_list_15ca NULL
+#define pci_ss_list_15cb NULL
+#define pci_ss_list_15cc NULL
+#define pci_ss_list_15cd NULL
+#define pci_ss_list_15ce NULL
+#define pci_ss_list_15cf NULL
+#define pci_ss_list_15d1 NULL
+#define pci_ss_list_15d2 NULL
+#define pci_ss_list_15d3 NULL
+#define pci_ss_list_15d4 NULL
+#define pci_ss_list_15d5 NULL
+#define pci_ss_list_15d6 NULL
+#define pci_ss_list_15d7 NULL
+#define pci_ss_list_15d8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_15d9[] = {
+ &pci_ss_info_15d9_3480,
+ &pci_ss_info_15d9_9005,
+ NULL
+};
+#endif
+#define pci_ss_list_15da NULL
+#define pci_ss_list_15db NULL
+#define pci_ss_list_15dc NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_15dd[] = {
+ &pci_ss_info_15dd_7609,
+ NULL
+};
+#endif
+#define pci_ss_list_15de NULL
+#define pci_ss_list_15df NULL
+#define pci_ss_list_15e0 NULL
+#define pci_ss_list_15e1 NULL
+#define pci_ss_list_15e2 NULL
+#define pci_ss_list_15e3 NULL
+#define pci_ss_list_15e4 NULL
+#define pci_ss_list_15e5 NULL
+#define pci_ss_list_15e6 NULL
+#define pci_ss_list_15e7 NULL
+#define pci_ss_list_15e8 NULL
+#define pci_ss_list_15e9 NULL
+#define pci_ss_list_15ea NULL
+#define pci_ss_list_15eb NULL
+#define pci_ss_list_15ec NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_15ed[] = {
+ &pci_ss_info_15ed_1000,
+ &pci_ss_info_15ed_1001,
+ &pci_ss_info_15ed_1002,
+ &pci_ss_info_15ed_1003,
+ &pci_ss_info_15ed_2000,
+ &pci_ss_info_15ed_2001,
+ NULL
+};
+#endif
+#define pci_ss_list_15ee NULL
+#define pci_ss_list_15ef NULL
+#define pci_ss_list_15f0 NULL
+#define pci_ss_list_15f1 NULL
+#define pci_ss_list_15f2 NULL
+#define pci_ss_list_15f3 NULL
+#define pci_ss_list_15f4 NULL
+#define pci_ss_list_15f5 NULL
+#define pci_ss_list_15f6 NULL
+#define pci_ss_list_15f7 NULL
+#define pci_ss_list_15f8 NULL
+#define pci_ss_list_15f9 NULL
+#define pci_ss_list_15fa NULL
+#define pci_ss_list_15fb NULL
+#define pci_ss_list_15fc NULL
+#define pci_ss_list_15fd NULL
+#define pci_ss_list_15fe NULL
+#define pci_ss_list_15ff NULL
+#define pci_ss_list_1600 NULL
+#define pci_ss_list_1601 NULL
+#define pci_ss_list_1602 NULL
+#define pci_ss_list_1603 NULL
+#define pci_ss_list_1604 NULL
+#define pci_ss_list_1605 NULL
+#define pci_ss_list_1606 NULL
+#define pci_ss_list_1607 NULL
+#define pci_ss_list_1608 NULL
+#define pci_ss_list_1609 NULL
+#define pci_ss_list_1612 NULL
+#define pci_ss_list_1619 NULL
+#define pci_ss_list_1629 NULL
+#define pci_ss_list_1638 NULL
+#define pci_ss_list_163c NULL
+#define pci_ss_list_1657 NULL
+#define pci_ss_list_165a NULL
+#define pci_ss_list_165d NULL
+#define pci_ss_list_1661 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1668[] = {
+ &pci_ss_info_1668_0299,
+ &pci_ss_info_1668_0300,
+ &pci_ss_info_1668_0302,
+ &pci_ss_info_1668_0414,
+ &pci_ss_info_1668_0440,
+ &pci_ss_info_1668_1100,
+ &pci_ss_info_1668_2400,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1681[] = {
+ &pci_ss_info_1681_0040,
+ &pci_ss_info_1681_0050,
+ &pci_ss_info_1681_a011,
+ NULL
+};
+#endif
+#define pci_ss_list_16ab NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_16be[] = {
+ &pci_ss_info_16be_0001,
+ &pci_ss_info_16be_0002,
+ &pci_ss_info_16be_1040,
+ NULL
+};
+#endif
+#define pci_ss_list_16ec NULL
+#define pci_ss_list_16f6 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1705[] = {
+ &pci_ss_info_1705_0001,
+ &pci_ss_info_1705_0002,
+ &pci_ss_info_1705_0003,
+ &pci_ss_info_1705_0004,
+ NULL
+};
+#endif
+#define pci_ss_list_170b NULL
+#define pci_ss_list_170c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_172a[] = {
+ &pci_ss_info_172a_0000,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1737[] = {
+ &pci_ss_info_1737_3874,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_173b[] = {
+ &pci_ss_info_173b_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_1743 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_174b[] = {
+ &pci_ss_info_174b_7112,
+ &pci_ss_info_174b_7147,
+ &pci_ss_info_174b_7149,
+ &pci_ss_info_174b_7161,
+ &pci_ss_info_174b_7176,
+ &pci_ss_info_174b_7192,
+ NULL
+};
+#endif
+#define pci_ss_list_175e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1787[] = {
+ &pci_ss_info_1787_0202,
+ NULL
+};
+#endif
+#define pci_ss_list_1796 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1799[] = {
+ &pci_ss_info_1799_0001,
+ &pci_ss_info_1799_0002,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_17af[] = {
+ &pci_ss_info_17af_0202,
+ &pci_ss_info_17af_2005,
+ &pci_ss_info_17af_2006,
+ NULL
+};
+#endif
+#define pci_ss_list_17cc NULL
+#define pci_ss_list_1813 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1851[] = {
+ &pci_ss_info_1851_1850,
+ &pci_ss_info_1851_1851,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1852[] = {
+ &pci_ss_info_1852_1852,
+ NULL
+};
+#endif
+#define pci_ss_list_1888 NULL
+#define pci_ss_list_1a08 NULL
+#define pci_ss_list_1b13 NULL
+#define pci_ss_list_1c1c NULL
+#define pci_ss_list_1d44 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_1de1[] = {
+ &pci_ss_info_1de1_1020,
+ &pci_ss_info_1de1_3904,
+ &pci_ss_info_1de1_3907,
+ NULL
+};
+#endif
+#define pci_ss_list_2000 NULL
+#define pci_ss_list_2001 NULL
+#define pci_ss_list_2003 NULL
+#define pci_ss_list_2004 NULL
+#define pci_ss_list_21c3 NULL
+#define pci_ss_list_2348 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_2646[] = {
+ &pci_ss_info_2646_0001,
+ NULL
+};
+#endif
+#define pci_ss_list_270b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_270f[] = {
+ &pci_ss_info_270f_2001,
+ &pci_ss_info_270f_2200,
+ &pci_ss_info_270f_3000,
+ &pci_ss_info_270f_3100,
+ &pci_ss_info_270f_3102,
+ &pci_ss_info_270f_7040,
+ &pci_ss_info_270f_7060,
+ &pci_ss_info_270f_a171,
+ NULL
+};
+#endif
+#define pci_ss_list_2711 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_2a15[] = {
+ &pci_ss_info_2a15_54a3,
+ NULL
+};
+#endif
+#define pci_ss_list_3000 NULL
+#define pci_ss_list_3142 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_3388[] = {
+ &pci_ss_info_3388_8011,
+ &pci_ss_info_3388_8012,
+ &pci_ss_info_3388_8013,
+ NULL
+};
+#endif
+#define pci_ss_list_3411 NULL
+#define pci_ss_list_3513 NULL
+#define pci_ss_list_38ef NULL
+static const pciSubsystemInfo *pci_ss_list_3d3d[] = {
+ &pci_ss_info_3d3d_0100,
+ &pci_ss_info_3d3d_0111,
+ &pci_ss_info_3d3d_0114,
+ &pci_ss_info_3d3d_0116,
+ &pci_ss_info_3d3d_0119,
+ &pci_ss_info_3d3d_0120,
+ &pci_ss_info_3d3d_0121,
+ &pci_ss_info_3d3d_0125,
+ &pci_ss_info_3d3d_0127,
+ &pci_ss_info_3d3d_0144,
+ NULL
+};
+static const pciSubsystemInfo *pci_ss_list_4005[] = {
+ &pci_ss_info_4005_4000,
+ NULL
+};
+#define pci_ss_list_4033 NULL
+#define pci_ss_list_4143 NULL
+#define pci_ss_list_416c NULL
+#define pci_ss_list_4444 NULL
+#define pci_ss_list_4468 NULL
+#define pci_ss_list_4594 NULL
+#define pci_ss_list_45fb NULL
+#define pci_ss_list_4680 NULL
+#define pci_ss_list_4843 NULL
+#define pci_ss_list_4916 NULL
+#define pci_ss_list_4943 NULL
+#define pci_ss_list_4978 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_4a14[] = {
+ &pci_ss_info_4a14_5000,
+ NULL
+};
+#endif
+#define pci_ss_list_4b10 NULL
+#define pci_ss_list_4c48 NULL
+#define pci_ss_list_4c53 NULL
+#define pci_ss_list_4ca1 NULL
+#define pci_ss_list_4d51 NULL
+#define pci_ss_list_4d54 NULL
+#define pci_ss_list_4ddc NULL
+#define pci_ss_list_5046 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_5053[] = {
+ &pci_ss_info_5053_3355,
+ &pci_ss_info_5053_3356,
+ NULL
+};
+#endif
+#define pci_ss_list_5136 NULL
+#define pci_ss_list_5143 NULL
+#define pci_ss_list_5145 NULL
+#define pci_ss_list_5168 NULL
+#define pci_ss_list_5301 NULL
+static const pciSubsystemInfo *pci_ss_list_5333[] = {
+ &pci_ss_info_5333_8100,
+ &pci_ss_info_5333_8110,
+ &pci_ss_info_5333_8125,
+ &pci_ss_info_5333_8143,
+ &pci_ss_info_5333_8900,
+ &pci_ss_info_5333_8901,
+ &pci_ss_info_5333_8904,
+ &pci_ss_info_5333_8a01,
+ &pci_ss_info_5333_8a13,
+ &pci_ss_info_5333_8a20,
+ &pci_ss_info_5333_8a21,
+ &pci_ss_info_5333_8a22,
+ &pci_ss_info_5333_8a2e,
+ &pci_ss_info_5333_9125,
+ &pci_ss_info_5333_9143,
+ NULL
+};
+#define pci_ss_list_544c NULL
+#define pci_ss_list_5455 NULL
+#define pci_ss_list_5519 NULL
+#define pci_ss_list_5544 NULL
+#define pci_ss_list_5555 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_5654[] = {
+ &pci_ss_info_5654_5634,
+ NULL
+};
+#endif
+#define pci_ss_list_5700 NULL
+#define pci_ss_list_6356 NULL
+#define pci_ss_list_6374 NULL
+#define pci_ss_list_6409 NULL
+#define pci_ss_list_6666 NULL
+#define pci_ss_list_7604 NULL
+#define pci_ss_list_7bde NULL
+#define pci_ss_list_7fed NULL
+#define pci_ss_list_8008 NULL
+static const pciSubsystemInfo *pci_ss_list_8086[] = {
+ &pci_ss_info_8086_0000,
+ &pci_ss_info_8086_0001,
+ &pci_ss_info_8086_0002,
+ &pci_ss_info_8086_0003,
+ &pci_ss_info_8086_0004,
+ &pci_ss_info_8086_0005,
+ &pci_ss_info_8086_0006,
+ &pci_ss_info_8086_0007,
+ &pci_ss_info_8086_0008,
+ &pci_ss_info_8086_0009,
+ &pci_ss_info_8086_000a,
+ &pci_ss_info_8086_000b,
+ &pci_ss_info_8086_000c,
+ &pci_ss_info_8086_000d,
+ &pci_ss_info_8086_000e,
+ &pci_ss_info_8086_000f,
+ &pci_ss_info_8086_0010,
+ &pci_ss_info_8086_0011,
+ &pci_ss_info_8086_0012,
+ &pci_ss_info_8086_0013,
+ &pci_ss_info_8086_001e,
+ &pci_ss_info_8086_002a,
+ &pci_ss_info_8086_002b,
+ &pci_ss_info_8086_002e,
+ &pci_ss_info_8086_0030,
+ &pci_ss_info_8086_0031,
+ &pci_ss_info_8086_0040,
+ &pci_ss_info_8086_0041,
+ &pci_ss_info_8086_0042,
+ &pci_ss_info_8086_0050,
+ &pci_ss_info_8086_0100,
+ &pci_ss_info_8086_1000,
+ &pci_ss_info_8086_1001,
+ &pci_ss_info_8086_1002,
+ &pci_ss_info_8086_1003,
+ &pci_ss_info_8086_1004,
+ &pci_ss_info_8086_1009,
+ &pci_ss_info_8086_100c,
+ &pci_ss_info_8086_1011,
+ &pci_ss_info_8086_1012,
+ &pci_ss_info_8086_1013,
+ &pci_ss_info_8086_1015,
+ &pci_ss_info_8086_1017,
+ &pci_ss_info_8086_1030,
+ &pci_ss_info_8086_1040,
+ &pci_ss_info_8086_1041,
+ &pci_ss_info_8086_1042,
+ &pci_ss_info_8086_1050,
+ &pci_ss_info_8086_1051,
+ &pci_ss_info_8086_1052,
+ &pci_ss_info_8086_10f0,
+ &pci_ss_info_8086_1107,
+ &pci_ss_info_8086_1109,
+ &pci_ss_info_8086_1112,
+ &pci_ss_info_8086_1161,
+ &pci_ss_info_8086_1361,
+ &pci_ss_info_8086_1958,
+ &pci_ss_info_8086_2004,
+ &pci_ss_info_8086_2009,
+ &pci_ss_info_8086_200d,
+ &pci_ss_info_8086_200e,
+ &pci_ss_info_8086_200f,
+ &pci_ss_info_8086_2010,
+ &pci_ss_info_8086_2013,
+ &pci_ss_info_8086_2016,
+ &pci_ss_info_8086_2017,
+ &pci_ss_info_8086_2018,
+ &pci_ss_info_8086_2019,
+ &pci_ss_info_8086_2101,
+ &pci_ss_info_8086_2102,
+ &pci_ss_info_8086_2103,
+ &pci_ss_info_8086_2104,
+ &pci_ss_info_8086_2105,
+ &pci_ss_info_8086_2106,
+ &pci_ss_info_8086_2107,
+ &pci_ss_info_8086_2108,
+ &pci_ss_info_8086_2109,
+ &pci_ss_info_8086_2110,
+ &pci_ss_info_8086_2112,
+ &pci_ss_info_8086_2200,
+ &pci_ss_info_8086_2201,
+ &pci_ss_info_8086_2202,
+ &pci_ss_info_8086_2203,
+ &pci_ss_info_8086_2204,
+ &pci_ss_info_8086_2205,
+ &pci_ss_info_8086_2206,
+ &pci_ss_info_8086_2207,
+ &pci_ss_info_8086_2208,
+ &pci_ss_info_8086_2402,
+ &pci_ss_info_8086_2407,
+ &pci_ss_info_8086_2408,
+ &pci_ss_info_8086_2409,
+ &pci_ss_info_8086_240f,
+ &pci_ss_info_8086_2410,
+ &pci_ss_info_8086_2411,
+ &pci_ss_info_8086_2412,
+ &pci_ss_info_8086_2413,
+ &pci_ss_info_8086_2513,
+ &pci_ss_info_8086_3000,
+ &pci_ss_info_8086_3001,
+ &pci_ss_info_8086_3002,
+ &pci_ss_info_8086_3006,
+ &pci_ss_info_8086_3007,
+ &pci_ss_info_8086_3008,
+ &pci_ss_info_8086_3010,
+ &pci_ss_info_8086_3011,
+ &pci_ss_info_8086_3012,
+ &pci_ss_info_8086_3013,
+ &pci_ss_info_8086_3014,
+ &pci_ss_info_8086_3015,
+ &pci_ss_info_8086_3016,
+ &pci_ss_info_8086_3017,
+ &pci_ss_info_8086_3018,
+ &pci_ss_info_8086_4152,
+ &pci_ss_info_8086_4249,
+ &pci_ss_info_8086_424c,
+ &pci_ss_info_8086_425a,
+ &pci_ss_info_8086_4341,
+ &pci_ss_info_8086_4343,
+ &pci_ss_info_8086_4649,
+ &pci_ss_info_8086_464a,
+ &pci_ss_info_8086_4d4f,
+ &pci_ss_info_8086_4f43,
+ &pci_ss_info_8086_5243,
+ &pci_ss_info_8086_5352,
+ &pci_ss_info_8086_5643,
+ &pci_ss_info_8086_5753,
+ &pci_ss_info_8086_8000,
+ &pci_ss_info_8086_8181,
+ &pci_ss_info_8086_9181,
+ NULL
+};
+#define pci_ss_list_8800 NULL
+#define pci_ss_list_8866 NULL
+#define pci_ss_list_8888 NULL
+#define pci_ss_list_8e0e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_8e2e[] = {
+ &pci_ss_info_8e2e_7000,
+ &pci_ss_info_8e2e_7100,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_9004[] = {
+ &pci_ss_info_9004_0008,
+ &pci_ss_info_9004_0009,
+ &pci_ss_info_9004_0010,
+ &pci_ss_info_9004_0018,
+ &pci_ss_info_9004_0019,
+ &pci_ss_info_9004_0020,
+ &pci_ss_info_9004_0028,
+ &pci_ss_info_9004_7560,
+ &pci_ss_info_9004_7710,
+ &pci_ss_info_9004_7711,
+ &pci_ss_info_9004_7815,
+ &pci_ss_info_9004_7840,
+ &pci_ss_info_9004_7850,
+ &pci_ss_info_9004_7861,
+ &pci_ss_info_9004_7880,
+ &pci_ss_info_9004_7881,
+ &pci_ss_info_9004_7887,
+ &pci_ss_info_9004_7888,
+ &pci_ss_info_9004_7890,
+ &pci_ss_info_9004_7891,
+ &pci_ss_info_9004_7892,
+ &pci_ss_info_9004_7894,
+ &pci_ss_info_9004_7895,
+ &pci_ss_info_9004_7896,
+ &pci_ss_info_9004_7897,
+ &pci_ss_info_9004_8008,
+ &pci_ss_info_9004_8009,
+ &pci_ss_info_9004_8010,
+ &pci_ss_info_9004_8018,
+ &pci_ss_info_9004_8019,
+ &pci_ss_info_9004_8020,
+ &pci_ss_info_9004_8028,
+ &pci_ss_info_9004_9110,
+ &pci_ss_info_9004_9111,
+ &pci_ss_info_9004_9210,
+ &pci_ss_info_9004_9211,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_9005[] = {
+ &pci_ss_info_9005_0003,
+ &pci_ss_info_9005_000f,
+ &pci_ss_info_9005_0041,
+ &pci_ss_info_9005_0365,
+ &pci_ss_info_9005_1364,
+ &pci_ss_info_9005_1365,
+ &pci_ss_info_9005_2180,
+ &pci_ss_info_9005_62a0,
+ &pci_ss_info_9005_62a1,
+ &pci_ss_info_9005_8100,
+ &pci_ss_info_9005_a180,
+ &pci_ss_info_9005_b500,
+ &pci_ss_info_9005_e100,
+ &pci_ss_info_9005_e220,
+ &pci_ss_info_9005_e2a0,
+ &pci_ss_info_9005_f500,
+ &pci_ss_info_9005_f620,
+ &pci_ss_info_9005_ffff,
+ NULL
+};
+#endif
+#define pci_ss_list_907f NULL
+#define pci_ss_list_919a NULL
+#define pci_ss_list_9412 NULL
+#define pci_ss_list_9699 NULL
+#define pci_ss_list_9710 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_a0a0[] = {
+ &pci_ss_info_a0a0_0007,
+ &pci_ss_info_a0a0_0022,
+ NULL
+};
+#endif
+#define pci_ss_list_a0f1 NULL
+#define pci_ss_list_a200 NULL
+#define pci_ss_list_a259 NULL
+#define pci_ss_list_a25b NULL
+#define pci_ss_list_a304 NULL
+#define pci_ss_list_a727 NULL
+#define pci_ss_list_aa42 NULL
+#define pci_ss_list_ac1e NULL
+#define pci_ss_list_b1b3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_bd11[] = {
+ &pci_ss_info_bd11_1200,
+ NULL
+};
+#endif
+#define pci_ss_list_c001 NULL
+#define pci_ss_list_c0a9 NULL
+#define pci_ss_list_c0de NULL
+#define pci_ss_list_c0fe NULL
+#define pci_ss_list_ca50 NULL
+#define pci_ss_list_cafe NULL
+#define pci_ss_list_cccc NULL
+#define pci_ss_list_cddd NULL
+#define pci_ss_list_d4d4 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_d531[] = {
+ &pci_ss_info_d531_c002,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_d84d[] = {
+ &pci_ss_info_d84d_4006,
+ &pci_ss_info_d84d_4008,
+ &pci_ss_info_d84d_4014,
+ &pci_ss_info_d84d_4018,
+ &pci_ss_info_d84d_4025,
+ &pci_ss_info_d84d_4027,
+ &pci_ss_info_d84d_4028,
+ &pci_ss_info_d84d_4036,
+ &pci_ss_info_d84d_4037,
+ &pci_ss_info_d84d_4038,
+ &pci_ss_info_d84d_4052,
+ &pci_ss_info_d84d_4053,
+ &pci_ss_info_d84d_4055,
+ &pci_ss_info_d84d_4058,
+ &pci_ss_info_d84d_4065,
+ &pci_ss_info_d84d_4068,
+ &pci_ss_info_d84d_4078,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_dead[] = {
+ &pci_ss_info_dead_0800,
+ NULL
+};
+#endif
+#define pci_ss_list_e000 NULL
+#define pci_ss_list_e159 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_e4bf[] = {
+ &pci_ss_info_e4bf_1000,
+ &pci_ss_info_e4bf_1010,
+ &pci_ss_info_e4bf_1020,
+ NULL
+};
+#endif
+#define pci_ss_list_ea01 NULL
+#define pci_ss_list_ea60 NULL
+#define pci_ss_list_eabb NULL
+#define pci_ss_list_eace NULL
+#define pci_ss_list_ec80 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciSubsystemInfo *pci_ss_list_ecc0[] = {
+ &pci_ss_info_ecc0_0030,
+ NULL
+};
+#endif
+#define pci_ss_list_edd8 NULL
+#define pci_ss_list_f1d0 NULL
+#define pci_ss_list_fa57 NULL
+#define pci_ss_list_febd NULL
+#define pci_ss_list_feda NULL
+#define pci_ss_list_fffe NULL
+#define pci_ss_list_ffff NULL
+#endif /* INIT_VENDOR_SUBSYS_INFO */
+#endif /* INIT_SUBSYS_INFO */
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_0675_1700 = {
+ 0x1700, pci_device_0675_1700,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0675_1700,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0675_1702 = {
+ 0x1702, pci_device_0675_1702,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0675_1702,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_09c1_0704 = {
+ 0x0704, pci_device_09c1_0704,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_09c1_0704,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_0e11_0001 = {
+ 0x0001, pci_device_0e11_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_0002 = {
+ 0x0002, pci_device_0e11_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_0049 = {
+ 0x0049, pci_device_0e11_0049,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_0049,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_004a = {
+ 0x004a, pci_device_0e11_004a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_004a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_0508 = {
+ 0x0508, pci_device_0e11_0508,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_0508,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_1000 = {
+ 0x1000, pci_device_0e11_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_2000 = {
+ 0x2000, pci_device_0e11_2000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_2000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_3032 = {
+ 0x3032, pci_device_0e11_3032,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_3032,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_3033 = {
+ 0x3033, pci_device_0e11_3033,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_3033,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_3034 = {
+ 0x3034, pci_device_0e11_3034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_3034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_4000 = {
+ 0x4000, pci_device_0e11_4000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_4000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_6010 = {
+ 0x6010, pci_device_0e11_6010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_6010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_7020 = {
+ 0x7020, pci_device_0e11_7020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_7020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_a0ec = {
+ 0xa0ec, pci_device_0e11_a0ec,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_a0ec,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_a0f0 = {
+ 0xa0f0, pci_device_0e11_a0f0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_a0f0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_a0f3 = {
+ 0xa0f3, pci_device_0e11_a0f3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_a0f3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_a0f7 = {
+ 0xa0f7, pci_device_0e11_a0f7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_a0f7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_a0f8 = {
+ 0xa0f8, pci_device_0e11_a0f8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_a0f8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_a0fc = {
+ 0xa0fc, pci_device_0e11_a0fc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_a0fc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae10 = {
+ 0xae10, pci_device_0e11_ae10,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae10,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae29 = {
+ 0xae29, pci_device_0e11_ae29,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae29,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae2a = {
+ 0xae2a, pci_device_0e11_ae2a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae2a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae2b = {
+ 0xae2b, pci_device_0e11_ae2b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae2b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae31 = {
+ 0xae31, pci_device_0e11_ae31,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae31,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae32 = {
+ 0xae32, pci_device_0e11_ae32,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae32,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae33 = {
+ 0xae33, pci_device_0e11_ae33,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae33,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae34 = {
+ 0xae34, pci_device_0e11_ae34,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae34,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae35 = {
+ 0xae35, pci_device_0e11_ae35,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae35,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae40 = {
+ 0xae40, pci_device_0e11_ae40,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae40,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae43 = {
+ 0xae43, pci_device_0e11_ae43,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae43,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae69 = {
+ 0xae69, pci_device_0e11_ae69,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae69,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae6c = {
+ 0xae6c, pci_device_0e11_ae6c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae6c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_ae6d = {
+ 0xae6d, pci_device_0e11_ae6d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_ae6d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b011 = {
+ 0xb011, pci_device_0e11_b011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b012 = {
+ 0xb012, pci_device_0e11_b012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b01e = {
+ 0xb01e, pci_device_0e11_b01e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b01e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b01f = {
+ 0xb01f, pci_device_0e11_b01f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b01f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b02f = {
+ 0xb02f, pci_device_0e11_b02f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b02f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b030 = {
+ 0xb030, pci_device_0e11_b030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b04a = {
+ 0xb04a, pci_device_0e11_b04a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b04a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b060 = {
+ 0xb060, pci_device_0e11_b060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b0c6 = {
+ 0xb0c6, pci_device_0e11_b0c6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b0c6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b0c7 = {
+ 0xb0c7, pci_device_0e11_b0c7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b0c7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b0d7 = {
+ 0xb0d7, pci_device_0e11_b0d7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b0d7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b0dd = {
+ 0xb0dd, pci_device_0e11_b0dd,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b0dd,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b0de = {
+ 0xb0de, pci_device_0e11_b0de,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b0de,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b0df = {
+ 0xb0df, pci_device_0e11_b0df,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b0df,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b0e0 = {
+ 0xb0e0, pci_device_0e11_b0e0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b0e0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b0e1 = {
+ 0xb0e1, pci_device_0e11_b0e1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b0e1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b123 = {
+ 0xb123, pci_device_0e11_b123,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b123,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b134 = {
+ 0xb134, pci_device_0e11_b134,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b134,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b13c = {
+ 0xb13c, pci_device_0e11_b13c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b13c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b144 = {
+ 0xb144, pci_device_0e11_b144,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b144,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b163 = {
+ 0xb163, pci_device_0e11_b163,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b163,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b164 = {
+ 0xb164, pci_device_0e11_b164,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b164,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b178 = {
+ 0xb178, pci_device_0e11_b178,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b178,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_b1a4 = {
+ 0xb1a4, pci_device_0e11_b1a4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_b1a4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_f130 = {
+ 0xf130, pci_device_0e11_f130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_f130,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_0e11_f150 = {
+ 0xf150, pci_device_0e11_f150,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_0e11_f150,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1000_0001 = {
+ 0x0001, pci_device_1000_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0002 = {
+ 0x0002, pci_device_1000_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0003 = {
+ 0x0003, pci_device_1000_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0004 = {
+ 0x0004, pci_device_1000_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0005 = {
+ 0x0005, pci_device_1000_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0006 = {
+ 0x0006, pci_device_1000_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_000a = {
+ 0x000a, pci_device_1000_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_000b = {
+ 0x000b, pci_device_1000_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_000c = {
+ 0x000c, pci_device_1000_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_000d = {
+ 0x000d, pci_device_1000_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_000d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_000f = {
+ 0x000f, pci_device_1000_000f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_000f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0010 = {
+ 0x0010, pci_device_1000_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0012 = {
+ 0x0012, pci_device_1000_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0013 = {
+ 0x0013, pci_device_1000_0013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0020 = {
+ 0x0020, pci_device_1000_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0021 = {
+ 0x0021, pci_device_1000_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0030 = {
+ 0x0030, pci_device_1000_0030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0040 = {
+ 0x0040, pci_device_1000_0040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_008f = {
+ 0x008f, pci_device_1000_008f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_008f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0621 = {
+ 0x0621, pci_device_1000_0621,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0621,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0622 = {
+ 0x0622, pci_device_1000_0622,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0622,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0623 = {
+ 0x0623, pci_device_1000_0623,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0623,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0624 = {
+ 0x0624, pci_device_1000_0624,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0624,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0625 = {
+ 0x0625, pci_device_1000_0625,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0625,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0626 = {
+ 0x0626, pci_device_1000_0626,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0626,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0627 = {
+ 0x0627, pci_device_1000_0627,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0627,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0628 = {
+ 0x0628, pci_device_1000_0628,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0628,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0629 = {
+ 0x0629, pci_device_1000_0629,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0629,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0701 = {
+ 0x0701, pci_device_1000_0701,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0701,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0702 = {
+ 0x0702, pci_device_1000_0702,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0702,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_0901 = {
+ 0x0901, pci_device_1000_0901,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_0901,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_1000 = {
+ 0x1000, pci_device_1000_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1000_1960 = {
+ 0x1960, pci_device_1000_1960,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1000_1960,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1001_0010 = {
+ 0x0010, pci_device_1001_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1001_0011 = {
+ 0x0011, pci_device_1001_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1001_0012 = {
+ 0x0012, pci_device_1001_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1001_0013 = {
+ 0x0013, pci_device_1001_0013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_0013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1001_0014 = {
+ 0x0014, pci_device_1001_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1001_0015 = {
+ 0x0015, pci_device_1001_0015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_0015,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1001_0016 = {
+ 0x0016, pci_device_1001_0016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_0016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1001_0017 = {
+ 0x0017, pci_device_1001_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_0017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1001_9100 = {
+ 0x9100, pci_device_1001_9100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1001_9100,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1002_4144 = {
+ 0x4144, pci_device_1002_4144,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4144,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4145 = {
+ 0x4145, pci_device_1002_4145,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4145,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4146 = {
+ 0x4146, pci_device_1002_4146,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4146,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4147 = {
+ 0x4147, pci_device_1002_4147,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4147,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4158 = {
+ 0x4158, pci_device_1002_4158,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4158,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4242 = {
+ 0x4242, pci_device_1002_4242,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4242,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4336 = {
+ 0x4336, pci_device_1002_4336,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4336,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4337 = {
+ 0x4337, pci_device_1002_4337,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4337,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4354 = {
+ 0x4354, pci_device_1002_4354,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4354,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4358 = {
+ 0x4358, pci_device_1002_4358,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4358,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4554 = {
+ 0x4554, pci_device_1002_4554,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4554,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4654 = {
+ 0x4654, pci_device_1002_4654,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4654,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4742 = {
+ 0x4742, pci_device_1002_4742,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4742,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4744 = {
+ 0x4744, pci_device_1002_4744,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4744,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4747 = {
+ 0x4747, pci_device_1002_4747,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4747,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4749 = {
+ 0x4749, pci_device_1002_4749,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4749,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_474c = {
+ 0x474c, pci_device_1002_474c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_474c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_474d = {
+ 0x474d, pci_device_1002_474d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_474d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_474e = {
+ 0x474e, pci_device_1002_474e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_474e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_474f = {
+ 0x474f, pci_device_1002_474f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_474f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4750 = {
+ 0x4750, pci_device_1002_4750,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4750,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4751 = {
+ 0x4751, pci_device_1002_4751,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4751,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4752 = {
+ 0x4752, pci_device_1002_4752,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4752,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4753 = {
+ 0x4753, pci_device_1002_4753,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4753,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4754 = {
+ 0x4754, pci_device_1002_4754,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4754,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4755 = {
+ 0x4755, pci_device_1002_4755,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4755,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4756 = {
+ 0x4756, pci_device_1002_4756,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4756,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4757 = {
+ 0x4757, pci_device_1002_4757,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4757,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4758 = {
+ 0x4758, pci_device_1002_4758,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4758,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4759 = {
+ 0x4759, pci_device_1002_4759,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4759,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_475a = {
+ 0x475a, pci_device_1002_475a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_475a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4964 = {
+ 0x4964, pci_device_1002_4964,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4964,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4965 = {
+ 0x4965, pci_device_1002_4965,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4965,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4966 = {
+ 0x4966, pci_device_1002_4966,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4966,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4967 = {
+ 0x4967, pci_device_1002_4967,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4967,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_496e = {
+ 0x496e, pci_device_1002_496e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_496e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c42 = {
+ 0x4c42, pci_device_1002_4c42,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c42,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c44 = {
+ 0x4c44, pci_device_1002_4c44,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c44,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c45 = {
+ 0x4c45, pci_device_1002_4c45,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c45,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c46 = {
+ 0x4c46, pci_device_1002_4c46,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c46,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c47 = {
+ 0x4c47, pci_device_1002_4c47,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c47,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c49 = {
+ 0x4c49, pci_device_1002_4c49,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c49,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c4d = {
+ 0x4c4d, pci_device_1002_4c4d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c4d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c4e = {
+ 0x4c4e, pci_device_1002_4c4e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c4e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c50 = {
+ 0x4c50, pci_device_1002_4c50,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c50,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c51 = {
+ 0x4c51, pci_device_1002_4c51,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c51,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c52 = {
+ 0x4c52, pci_device_1002_4c52,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c52,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c53 = {
+ 0x4c53, pci_device_1002_4c53,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c53,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c54 = {
+ 0x4c54, pci_device_1002_4c54,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c54,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c57 = {
+ 0x4c57, pci_device_1002_4c57,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c57,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c58 = {
+ 0x4c58, pci_device_1002_4c58,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c58,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c59 = {
+ 0x4c59, pci_device_1002_4c59,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c59,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c5a = {
+ 0x4c5a, pci_device_1002_4c5a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c5a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c64 = {
+ 0x4c64, pci_device_1002_4c64,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c64,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c65 = {
+ 0x4c65, pci_device_1002_4c65,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c65,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c66 = {
+ 0x4c66, pci_device_1002_4c66,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c66,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4c67 = {
+ 0x4c67, pci_device_1002_4c67,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4c67,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4d46 = {
+ 0x4d46, pci_device_1002_4d46,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4d46,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4d4c = {
+ 0x4d4c, pci_device_1002_4d4c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4d4c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4e44 = {
+ 0x4e44, pci_device_1002_4e44,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e44,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4e45 = {
+ 0x4e45, pci_device_1002_4e45,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e45,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4e46 = {
+ 0x4e46, pci_device_1002_4e46,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e46,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4e47 = {
+ 0x4e47, pci_device_1002_4e47,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e47,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4e64 = {
+ 0x4e64, pci_device_1002_4e64,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e64,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4e65 = {
+ 0x4e65, pci_device_1002_4e65,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e65,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4e66 = {
+ 0x4e66, pci_device_1002_4e66,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e66,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_4e67 = {
+ 0x4e67, pci_device_1002_4e67,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_4e67,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5041 = {
+ 0x5041, pci_device_1002_5041,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5041,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5042 = {
+ 0x5042, pci_device_1002_5042,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5042,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5043 = {
+ 0x5043, pci_device_1002_5043,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5043,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5044 = {
+ 0x5044, pci_device_1002_5044,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5044,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5045 = {
+ 0x5045, pci_device_1002_5045,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5045,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5046 = {
+ 0x5046, pci_device_1002_5046,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5046,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5047 = {
+ 0x5047, pci_device_1002_5047,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5047,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5048 = {
+ 0x5048, pci_device_1002_5048,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5048,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5049 = {
+ 0x5049, pci_device_1002_5049,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5049,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_504a = {
+ 0x504a, pci_device_1002_504a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_504a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_504b = {
+ 0x504b, pci_device_1002_504b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_504b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_504c = {
+ 0x504c, pci_device_1002_504c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_504c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_504d = {
+ 0x504d, pci_device_1002_504d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_504d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_504e = {
+ 0x504e, pci_device_1002_504e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_504e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_504f = {
+ 0x504f, pci_device_1002_504f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_504f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5050 = {
+ 0x5050, pci_device_1002_5050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5051 = {
+ 0x5051, pci_device_1002_5051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5051,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5052 = {
+ 0x5052, pci_device_1002_5052,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5052,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5053 = {
+ 0x5053, pci_device_1002_5053,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5053,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5054 = {
+ 0x5054, pci_device_1002_5054,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5054,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5055 = {
+ 0x5055, pci_device_1002_5055,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5055,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5056 = {
+ 0x5056, pci_device_1002_5056,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5056,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5057 = {
+ 0x5057, pci_device_1002_5057,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5057,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5058 = {
+ 0x5058, pci_device_1002_5058,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5058,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5144 = {
+ 0x5144, pci_device_1002_5144,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5144,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5145 = {
+ 0x5145, pci_device_1002_5145,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5145,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5146 = {
+ 0x5146, pci_device_1002_5146,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5146,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5147 = {
+ 0x5147, pci_device_1002_5147,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5147,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5148 = {
+ 0x5148, pci_device_1002_5148,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5148,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5149 = {
+ 0x5149, pci_device_1002_5149,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5149,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_514a = {
+ 0x514a, pci_device_1002_514a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_514a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_514b = {
+ 0x514b, pci_device_1002_514b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_514b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_514c = {
+ 0x514c, pci_device_1002_514c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_514c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_514d = {
+ 0x514d, pci_device_1002_514d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_514d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_514e = {
+ 0x514e, pci_device_1002_514e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_514e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_514f = {
+ 0x514f, pci_device_1002_514f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_514f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5157 = {
+ 0x5157, pci_device_1002_5157,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5157,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5158 = {
+ 0x5158, pci_device_1002_5158,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5158,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5159 = {
+ 0x5159, pci_device_1002_5159,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5159,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_515a = {
+ 0x515a, pci_device_1002_515a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_515a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5168 = {
+ 0x5168, pci_device_1002_5168,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5168,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5169 = {
+ 0x5169, pci_device_1002_5169,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5169,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_516a = {
+ 0x516a, pci_device_1002_516a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_516a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_516b = {
+ 0x516b, pci_device_1002_516b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_516b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_516c = {
+ 0x516c, pci_device_1002_516c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_516c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5245 = {
+ 0x5245, pci_device_1002_5245,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5245,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5246 = {
+ 0x5246, pci_device_1002_5246,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5246,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5247 = {
+ 0x5247, pci_device_1002_5247,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5247,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_524b = {
+ 0x524b, pci_device_1002_524b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_524b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_524c = {
+ 0x524c, pci_device_1002_524c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_524c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5345 = {
+ 0x5345, pci_device_1002_5345,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5345,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5346 = {
+ 0x5346, pci_device_1002_5346,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5346,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5347 = {
+ 0x5347, pci_device_1002_5347,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5347,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5348 = {
+ 0x5348, pci_device_1002_5348,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5348,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_534b = {
+ 0x534b, pci_device_1002_534b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_534b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_534c = {
+ 0x534c, pci_device_1002_534c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_534c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_534d = {
+ 0x534d, pci_device_1002_534d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_534d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_534e = {
+ 0x534e, pci_device_1002_534e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_534e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5354 = {
+ 0x5354, pci_device_1002_5354,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5354,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5446 = {
+ 0x5446, pci_device_1002_5446,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5446,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_544c = {
+ 0x544c, pci_device_1002_544c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_544c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5452 = {
+ 0x5452, pci_device_1002_5452,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5452,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5453 = {
+ 0x5453, pci_device_1002_5453,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5453,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5454 = {
+ 0x5454, pci_device_1002_5454,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5454,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5455 = {
+ 0x5455, pci_device_1002_5455,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5455,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5654 = {
+ 0x5654, pci_device_1002_5654,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5654,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5655 = {
+ 0x5655, pci_device_1002_5655,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5655,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_5656 = {
+ 0x5656, pci_device_1002_5656,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_5656,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1002_700f = {
+ 0x700f, pci_device_1002_700f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1002_700f,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1003_0201 = {
+ 0x0201, pci_device_1003_0201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1003_0201,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1004_0005 = {
+ 0x0005, pci_device_1004_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0006 = {
+ 0x0006, pci_device_1004_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0007 = {
+ 0x0007, pci_device_1004_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0008 = {
+ 0x0008, pci_device_1004_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0009 = {
+ 0x0009, pci_device_1004_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_000c = {
+ 0x000c, pci_device_1004_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_000d = {
+ 0x000d, pci_device_1004_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_000d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0101 = {
+ 0x0101, pci_device_1004_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0102 = {
+ 0x0102, pci_device_1004_0102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0103 = {
+ 0x0103, pci_device_1004_0103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0104 = {
+ 0x0104, pci_device_1004_0104,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0104,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0105 = {
+ 0x0105, pci_device_1004_0105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0200 = {
+ 0x0200, pci_device_1004_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0280 = {
+ 0x0280, pci_device_1004_0280,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0280,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0304 = {
+ 0x0304, pci_device_1004_0304,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0304,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0305 = {
+ 0x0305, pci_device_1004_0305,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0305,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0306 = {
+ 0x0306, pci_device_1004_0306,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0306,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0307 = {
+ 0x0307, pci_device_1004_0307,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0307,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0308 = {
+ 0x0308, pci_device_1004_0308,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0308,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0702 = {
+ 0x0702, pci_device_1004_0702,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0702,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1004_0703 = {
+ 0x0703, pci_device_1004_0703,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1004_0703,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1005_2064 = {
+ 0x2064, pci_device_1005_2064,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1005_2064,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1005_2128 = {
+ 0x2128, pci_device_1005_2128,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1005_2128,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1005_2301 = {
+ 0x2301, pci_device_1005_2301,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1005_2301,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1005_2302 = {
+ 0x2302, pci_device_1005_2302,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1005_2302,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1005_2364 = {
+ 0x2364, pci_device_1005_2364,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1005_2364,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1005_2464 = {
+ 0x2464, pci_device_1005_2464,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1005_2464,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1005_2501 = {
+ 0x2501, pci_device_1005_2501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1005_2501,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0001 = {
+ 0x0001, pci_device_100b_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0002 = {
+ 0x0002, pci_device_100b_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_000e = {
+ 0x000e, pci_device_100b_000e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_000e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_000f = {
+ 0x000f, pci_device_100b_000f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_000f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0011 = {
+ 0x0011, pci_device_100b_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0012 = {
+ 0x0012, pci_device_100b_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0020 = {
+ 0x0020, pci_device_100b_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0022 = {
+ 0x0022, pci_device_100b_0022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0500 = {
+ 0x0500, pci_device_100b_0500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0501 = {
+ 0x0501, pci_device_100b_0501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0501,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0502 = {
+ 0x0502, pci_device_100b_0502,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0502,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0503 = {
+ 0x0503, pci_device_100b_0503,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0503,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0504 = {
+ 0x0504, pci_device_100b_0504,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0504,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_0505 = {
+ 0x0505, pci_device_100b_0505,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_0505,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100b_d001 = {
+ 0xd001, pci_device_100b_d001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100b_d001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100c_3202 = {
+ 0x3202, pci_device_100c_3202,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100c_3202,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100c_3205 = {
+ 0x3205, pci_device_100c_3205,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100c_3205,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100c_3206 = {
+ 0x3206, pci_device_100c_3206,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100c_3206,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100c_3207 = {
+ 0x3207, pci_device_100c_3207,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100c_3207,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100c_3208 = {
+ 0x3208, pci_device_100c_3208,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100c_3208,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100c_4702 = {
+ 0x4702, pci_device_100c_4702,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100c_4702,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100e_9000 = {
+ 0x9000, pci_device_100e_9000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100e_9000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100e_9001 = {
+ 0x9001, pci_device_100e_9001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100e_9001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100e_9002 = {
+ 0x9002, pci_device_100e_9002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100e_9002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_100e_9100 = {
+ 0x9100, pci_device_100e_9100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_100e_9100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0001 = {
+ 0x0001, pci_device_1011_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0002 = {
+ 0x0002, pci_device_1011_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0004 = {
+ 0x0004, pci_device_1011_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0007 = {
+ 0x0007, pci_device_1011_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0008 = {
+ 0x0008, pci_device_1011_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0009 = {
+ 0x0009, pci_device_1011_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_000a = {
+ 0x000a, pci_device_1011_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_000d = {
+ 0x000d, pci_device_1011_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_000d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_000f = {
+ 0x000f, pci_device_1011_000f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_000f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0014 = {
+ 0x0014, pci_device_1011_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0016 = {
+ 0x0016, pci_device_1011_0016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0019 = {
+ 0x0019, pci_device_1011_0019,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0019,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_001a = {
+ 0x001a, pci_device_1011_001a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_001a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0021 = {
+ 0x0021, pci_device_1011_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0022 = {
+ 0x0022, pci_device_1011_0022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0023 = {
+ 0x0023, pci_device_1011_0023,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0023,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0024 = {
+ 0x0024, pci_device_1011_0024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0025 = {
+ 0x0025, pci_device_1011_0025,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0025,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0026 = {
+ 0x0026, pci_device_1011_0026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0034 = {
+ 0x0034, pci_device_1011_0034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0045 = {
+ 0x0045, pci_device_1011_0045,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0045,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_0046 = {
+ 0x0046, pci_device_1011_0046,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_0046,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1011_1065 = {
+ 0x1065, pci_device_1011_1065,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1011_1065,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_0038 = {
+ 0x0038, pci_device_1013_0038,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_0038,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_0040 = {
+ 0x0040, pci_device_1013_0040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_0040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_004c = {
+ 0x004c, pci_device_1013_004c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_004c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00a0 = {
+ 0x00a0, pci_device_1013_00a0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00a0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00a2 = {
+ 0x00a2, pci_device_1013_00a2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00a2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00a4 = {
+ 0x00a4, pci_device_1013_00a4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00a4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00a8 = {
+ 0x00a8, pci_device_1013_00a8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00a8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00ac = {
+ 0x00ac, pci_device_1013_00ac,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00ac,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00b0 = {
+ 0x00b0, pci_device_1013_00b0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00b0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00b8 = {
+ 0x00b8, pci_device_1013_00b8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00b8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00bc = {
+ 0x00bc, pci_device_1013_00bc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00bc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00d0 = {
+ 0x00d0, pci_device_1013_00d0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00d0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00d2 = {
+ 0x00d2, pci_device_1013_00d2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00d2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00d4 = {
+ 0x00d4, pci_device_1013_00d4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00d4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00d5 = {
+ 0x00d5, pci_device_1013_00d5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00d5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00d6 = {
+ 0x00d6, pci_device_1013_00d6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00d6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_00e8 = {
+ 0x00e8, pci_device_1013_00e8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_00e8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_1100 = {
+ 0x1100, pci_device_1013_1100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_1100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_1110 = {
+ 0x1110, pci_device_1013_1110,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_1110,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_1112 = {
+ 0x1112, pci_device_1013_1112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_1112,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_1113 = {
+ 0x1113, pci_device_1013_1113,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_1113,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_1200 = {
+ 0x1200, pci_device_1013_1200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_1200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_1202 = {
+ 0x1202, pci_device_1013_1202,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_1202,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_1204 = {
+ 0x1204, pci_device_1013_1204,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_1204,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_4400 = {
+ 0x4400, pci_device_1013_4400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_4400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_6001 = {
+ 0x6001, pci_device_1013_6001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_6001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_6003 = {
+ 0x6003, pci_device_1013_6003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_6003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_6004 = {
+ 0x6004, pci_device_1013_6004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_6004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1013_6005 = {
+ 0x6005, pci_device_1013_6005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1013_6005,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1014_0002 = {
+ 0x0002, pci_device_1014_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0005 = {
+ 0x0005, pci_device_1014_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0007 = {
+ 0x0007, pci_device_1014_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_000a = {
+ 0x000a, pci_device_1014_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0017 = {
+ 0x0017, pci_device_1014_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0018 = {
+ 0x0018, pci_device_1014_0018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0018,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_001b = {
+ 0x001b, pci_device_1014_001b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_001b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_001c = {
+ 0x001c, pci_device_1014_001c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_001c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_001d = {
+ 0x001d, pci_device_1014_001d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_001d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0020 = {
+ 0x0020, pci_device_1014_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0022 = {
+ 0x0022, pci_device_1014_0022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_002d = {
+ 0x002d, pci_device_1014_002d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_002d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_002e = {
+ 0x002e, pci_device_1014_002e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_002e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0036 = {
+ 0x0036, pci_device_1014_0036,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0036,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_003a = {
+ 0x003a, pci_device_1014_003a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_003a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_003e = {
+ 0x003e, pci_device_1014_003e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_003e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0045 = {
+ 0x0045, pci_device_1014_0045,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0045,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0046 = {
+ 0x0046, pci_device_1014_0046,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0046,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0047 = {
+ 0x0047, pci_device_1014_0047,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0047,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0048 = {
+ 0x0048, pci_device_1014_0048,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0048,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0049 = {
+ 0x0049, pci_device_1014_0049,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0049,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_004e = {
+ 0x004e, pci_device_1014_004e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_004e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_004f = {
+ 0x004f, pci_device_1014_004f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_004f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0050 = {
+ 0x0050, pci_device_1014_0050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0053 = {
+ 0x0053, pci_device_1014_0053,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0053,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0057 = {
+ 0x0057, pci_device_1014_0057,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0057,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_005c = {
+ 0x005c, pci_device_1014_005c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_005c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_007c = {
+ 0x007c, pci_device_1014_007c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_007c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_007d = {
+ 0x007d, pci_device_1014_007d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_007d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0090 = {
+ 0x0090, pci_device_1014_0090,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0090,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0095 = {
+ 0x0095, pci_device_1014_0095,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0095,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0096 = {
+ 0x0096, pci_device_1014_0096,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0096,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_00a5 = {
+ 0x00a5, pci_device_1014_00a5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_00a5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_00a6 = {
+ 0x00a6, pci_device_1014_00a6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_00a6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_00b7 = {
+ 0x00b7, pci_device_1014_00b7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_00b7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_00be = {
+ 0x00be, pci_device_1014_00be,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_00be,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_00dc = {
+ 0x00dc, pci_device_1014_00dc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_00dc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_00fc = {
+ 0x00fc, pci_device_1014_00fc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_00fc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0105 = {
+ 0x0105, pci_device_1014_0105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_010f = {
+ 0x010f, pci_device_1014_010f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_010f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0142 = {
+ 0x0142, pci_device_1014_0142,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0142,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0144 = {
+ 0x0144, pci_device_1014_0144,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0144,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0156 = {
+ 0x0156, pci_device_1014_0156,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0156,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_01a7 = {
+ 0x01a7, pci_device_1014_01a7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_01a7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_01bd = {
+ 0x01bd, pci_device_1014_01bd,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_01bd,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_0302 = {
+ 0x0302, pci_device_1014_0302,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_0302,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1014_ffff = {
+ 0xffff, pci_device_1014_ffff,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1014_ffff,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1017_5343 = {
+ 0x5343, pci_device_1017_5343,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1017_5343,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_101a_0005 = {
+ 0x0005, pci_device_101a_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101a_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_101c_0193 = {
+ 0x0193, pci_device_101c_0193,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_0193,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_0196 = {
+ 0x0196, pci_device_101c_0196,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_0196,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_0197 = {
+ 0x0197, pci_device_101c_0197,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_0197,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_0296 = {
+ 0x0296, pci_device_101c_0296,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_0296,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_3193 = {
+ 0x3193, pci_device_101c_3193,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_3193,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_3197 = {
+ 0x3197, pci_device_101c_3197,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_3197,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_3296 = {
+ 0x3296, pci_device_101c_3296,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_3296,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_4296 = {
+ 0x4296, pci_device_101c_4296,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_4296,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_9710 = {
+ 0x9710, pci_device_101c_9710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_9710,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_9712 = {
+ 0x9712, pci_device_101c_9712,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_9712,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101c_c24a = {
+ 0xc24a, pci_device_101c_c24a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101c_c24a,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_101e_1960 = {
+ 0x1960, pci_device_101e_1960,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_1960,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101e_9010 = {
+ 0x9010, pci_device_101e_9010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_9010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101e_9030 = {
+ 0x9030, pci_device_101e_9030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_9030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101e_9031 = {
+ 0x9031, pci_device_101e_9031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_9031,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101e_9032 = {
+ 0x9032, pci_device_101e_9032,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_9032,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101e_9033 = {
+ 0x9033, pci_device_101e_9033,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_9033,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101e_9040 = {
+ 0x9040, pci_device_101e_9040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_9040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101e_9060 = {
+ 0x9060, pci_device_101e_9060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_9060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_101e_9063 = {
+ 0x9063, pci_device_101e_9063,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_101e_9063,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1022_1100 = {
+ 0x1100, pci_device_1022_1100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_1100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_1101 = {
+ 0x1101, pci_device_1022_1101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_1101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_1102 = {
+ 0x1102, pci_device_1022_1102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_1102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_1103 = {
+ 0x1103, pci_device_1022_1103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_1103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_2000 = {
+ 0x2000, pci_device_1022_2000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_2000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_2001 = {
+ 0x2001, pci_device_1022_2001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_2001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_2020 = {
+ 0x2020, pci_device_1022_2020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_2020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_2040 = {
+ 0x2040, pci_device_1022_2040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_2040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_3000 = {
+ 0x3000, pci_device_1022_3000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_3000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7006 = {
+ 0x7006, pci_device_1022_7006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7007 = {
+ 0x7007, pci_device_1022_7007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_700c = {
+ 0x700c, pci_device_1022_700c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_700c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_700d = {
+ 0x700d, pci_device_1022_700d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_700d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_700e = {
+ 0x700e, pci_device_1022_700e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_700e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_700f = {
+ 0x700f, pci_device_1022_700f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_700f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7400 = {
+ 0x7400, pci_device_1022_7400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7401 = {
+ 0x7401, pci_device_1022_7401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7401,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7403 = {
+ 0x7403, pci_device_1022_7403,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7403,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7404 = {
+ 0x7404, pci_device_1022_7404,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7404,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7408 = {
+ 0x7408, pci_device_1022_7408,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7408,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7409 = {
+ 0x7409, pci_device_1022_7409,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7409,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_740b = {
+ 0x740b, pci_device_1022_740b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_740b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_740c = {
+ 0x740c, pci_device_1022_740c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_740c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7410 = {
+ 0x7410, pci_device_1022_7410,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7410,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7411 = {
+ 0x7411, pci_device_1022_7411,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7411,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7413 = {
+ 0x7413, pci_device_1022_7413,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7413,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7414 = {
+ 0x7414, pci_device_1022_7414,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7414,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7440 = {
+ 0x7440, pci_device_1022_7440,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7440,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7441 = {
+ 0x7441, pci_device_1022_7441,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7441,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7443 = {
+ 0x7443, pci_device_1022_7443,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7443,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7445 = {
+ 0x7445, pci_device_1022_7445,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7445,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7446 = {
+ 0x7446, pci_device_1022_7446,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7446,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7448 = {
+ 0x7448, pci_device_1022_7448,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7448,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7449 = {
+ 0x7449, pci_device_1022_7449,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7449,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7450 = {
+ 0x7450, pci_device_1022_7450,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7450,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7451 = {
+ 0x7451, pci_device_1022_7451,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7451,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7454 = {
+ 0x7454, pci_device_1022_7454,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7454,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7455 = {
+ 0x7455, pci_device_1022_7455,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7455,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7460 = {
+ 0x7460, pci_device_1022_7460,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7460,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7461 = {
+ 0x7461, pci_device_1022_7461,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7461,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7462 = {
+ 0x7462, pci_device_1022_7462,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7462,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7464 = {
+ 0x7464, pci_device_1022_7464,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7464,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7468 = {
+ 0x7468, pci_device_1022_7468,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7468,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_7469 = {
+ 0x7469, pci_device_1022_7469,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_7469,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_746a = {
+ 0x746a, pci_device_1022_746a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_746a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_746b = {
+ 0x746b, pci_device_1022_746b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_746b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_746d = {
+ 0x746d, pci_device_1022_746d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_746d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1022_746e = {
+ 0x746e, pci_device_1022_746e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1022_746e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_0194 = {
+ 0x0194, pci_device_1023_0194,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_0194,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_2000 = {
+ 0x2000, pci_device_1023_2000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_2000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_2001 = {
+ 0x2001, pci_device_1023_2001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_2001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_8400 = {
+ 0x8400, pci_device_1023_8400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_8400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_8420 = {
+ 0x8420, pci_device_1023_8420,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_8420,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_8500 = {
+ 0x8500, pci_device_1023_8500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_8500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_8520 = {
+ 0x8520, pci_device_1023_8520,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_8520,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_8620 = {
+ 0x8620, pci_device_1023_8620,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_8620,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_8820 = {
+ 0x8820, pci_device_1023_8820,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_8820,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9320 = {
+ 0x9320, pci_device_1023_9320,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9320,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9350 = {
+ 0x9350, pci_device_1023_9350,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9350,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9360 = {
+ 0x9360, pci_device_1023_9360,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9360,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9382 = {
+ 0x9382, pci_device_1023_9382,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9382,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9383 = {
+ 0x9383, pci_device_1023_9383,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9383,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9385 = {
+ 0x9385, pci_device_1023_9385,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9385,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9386 = {
+ 0x9386, pci_device_1023_9386,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9386,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9388 = {
+ 0x9388, pci_device_1023_9388,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9388,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9397 = {
+ 0x9397, pci_device_1023_9397,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9397,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_939a = {
+ 0x939a, pci_device_1023_939a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_939a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9420 = {
+ 0x9420, pci_device_1023_9420,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9420,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9430 = {
+ 0x9430, pci_device_1023_9430,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9430,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9440 = {
+ 0x9440, pci_device_1023_9440,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9440,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9460 = {
+ 0x9460, pci_device_1023_9460,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9460,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9470 = {
+ 0x9470, pci_device_1023_9470,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9470,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9520 = {
+ 0x9520, pci_device_1023_9520,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9520,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9525 = {
+ 0x9525, pci_device_1023_9525,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9525,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9540 = {
+ 0x9540, pci_device_1023_9540,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9540,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9660 = {
+ 0x9660, pci_device_1023_9660,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9660,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9680 = {
+ 0x9680, pci_device_1023_9680,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9680,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9682 = {
+ 0x9682, pci_device_1023_9682,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9682,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9683 = {
+ 0x9683, pci_device_1023_9683,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9683,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9685 = {
+ 0x9685, pci_device_1023_9685,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9685,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9750 = {
+ 0x9750, pci_device_1023_9750,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9750,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9753 = {
+ 0x9753, pci_device_1023_9753,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9753,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9754 = {
+ 0x9754, pci_device_1023_9754,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9754,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9759 = {
+ 0x9759, pci_device_1023_9759,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9759,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9783 = {
+ 0x9783, pci_device_1023_9783,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9783,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9785 = {
+ 0x9785, pci_device_1023_9785,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9785,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9850 = {
+ 0x9850, pci_device_1023_9850,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9850,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9880 = {
+ 0x9880, pci_device_1023_9880,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9880,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9910 = {
+ 0x9910, pci_device_1023_9910,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9910,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1023_9930 = {
+ 0x9930, pci_device_1023_9930,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1023_9930,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1435 = {
+ 0x1435, pci_device_1025_1435,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1435,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1445 = {
+ 0x1445, pci_device_1025_1445,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1445,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1449 = {
+ 0x1449, pci_device_1025_1449,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1449,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1451 = {
+ 0x1451, pci_device_1025_1451,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1451,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1461 = {
+ 0x1461, pci_device_1025_1461,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1461,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1489 = {
+ 0x1489, pci_device_1025_1489,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1489,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1511 = {
+ 0x1511, pci_device_1025_1511,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1511,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1512 = {
+ 0x1512, pci_device_1025_1512,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1512,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1513 = {
+ 0x1513, pci_device_1025_1513,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1513,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1521 = {
+ 0x1521, pci_device_1025_1521,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1521,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1523 = {
+ 0x1523, pci_device_1025_1523,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1523,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1531 = {
+ 0x1531, pci_device_1025_1531,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1531,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1533 = {
+ 0x1533, pci_device_1025_1533,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1533,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1535 = {
+ 0x1535, pci_device_1025_1535,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1535,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1541 = {
+ 0x1541, pci_device_1025_1541,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1541,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1542 = {
+ 0x1542, pci_device_1025_1542,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1542,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1543 = {
+ 0x1543, pci_device_1025_1543,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1543,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1561 = {
+ 0x1561, pci_device_1025_1561,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1561,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1621 = {
+ 0x1621, pci_device_1025_1621,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1621,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1631 = {
+ 0x1631, pci_device_1025_1631,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1631,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1641 = {
+ 0x1641, pci_device_1025_1641,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1641,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_1647 = {
+ 0x1647, pci_device_1025_1647,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_1647,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3141 = {
+ 0x3141, pci_device_1025_3141,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3141,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3143 = {
+ 0x3143, pci_device_1025_3143,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3143,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3145 = {
+ 0x3145, pci_device_1025_3145,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3145,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3147 = {
+ 0x3147, pci_device_1025_3147,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3147,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3149 = {
+ 0x3149, pci_device_1025_3149,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3149,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3151 = {
+ 0x3151, pci_device_1025_3151,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3151,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3307 = {
+ 0x3307, pci_device_1025_3307,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3307,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3309 = {
+ 0x3309, pci_device_1025_3309,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3309,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_3321 = {
+ 0x3321, pci_device_1025_3321,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_3321,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5212 = {
+ 0x5212, pci_device_1025_5212,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5212,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5215 = {
+ 0x5215, pci_device_1025_5215,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5215,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5217 = {
+ 0x5217, pci_device_1025_5217,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5217,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5219 = {
+ 0x5219, pci_device_1025_5219,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5219,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5225 = {
+ 0x5225, pci_device_1025_5225,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5225,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5229 = {
+ 0x5229, pci_device_1025_5229,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5229,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5235 = {
+ 0x5235, pci_device_1025_5235,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5235,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5237 = {
+ 0x5237, pci_device_1025_5237,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5237,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5240 = {
+ 0x5240, pci_device_1025_5240,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5240,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5241 = {
+ 0x5241, pci_device_1025_5241,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5241,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5242 = {
+ 0x5242, pci_device_1025_5242,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5242,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5243 = {
+ 0x5243, pci_device_1025_5243,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5243,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5244 = {
+ 0x5244, pci_device_1025_5244,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5244,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5247 = {
+ 0x5247, pci_device_1025_5247,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5247,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5251 = {
+ 0x5251, pci_device_1025_5251,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5251,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5427 = {
+ 0x5427, pci_device_1025_5427,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5427,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5451 = {
+ 0x5451, pci_device_1025_5451,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5451,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_5453 = {
+ 0x5453, pci_device_1025_5453,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_5453,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1025_7101 = {
+ 0x7101, pci_device_1025_7101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1025_7101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_0001 = {
+ 0x0001, pci_device_1028_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_0002 = {
+ 0x0002, pci_device_1028_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_0003 = {
+ 0x0003, pci_device_1028_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_0004 = {
+ 0x0004, pci_device_1028_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_0005 = {
+ 0x0005, pci_device_1028_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_0006 = {
+ 0x0006, pci_device_1028_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_0007 = {
+ 0x0007, pci_device_1028_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_0008 = {
+ 0x0008, pci_device_1028_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_000a = {
+ 0x000a, pci_device_1028_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_000c = {
+ 0x000c, pci_device_1028_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_000e = {
+ 0x000e, pci_device_1028_000e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_000e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1028_000f = {
+ 0x000f, pci_device_1028_000f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1028_000f,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_102a_0000 = {
+ 0x0000, pci_device_102a_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102a_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102a_0010 = {
+ 0x0010, pci_device_102a_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102a_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_102b_0010 = {
+ 0x0010, pci_device_102b_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_0518 = {
+ 0x0518, pci_device_102b_0518,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0518,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_0519 = {
+ 0x0519, pci_device_102b_0519,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0519,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_051a = {
+ 0x051a, pci_device_102b_051a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_051a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_051b = {
+ 0x051b, pci_device_102b_051b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_051b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_051e = {
+ 0x051e, pci_device_102b_051e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_051e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_051f = {
+ 0x051f, pci_device_102b_051f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_051f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_0520 = {
+ 0x0520, pci_device_102b_0520,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0520,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_0521 = {
+ 0x0521, pci_device_102b_0521,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0521,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_0525 = {
+ 0x0525, pci_device_102b_0525,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0525,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_0527 = {
+ 0x0527, pci_device_102b_0527,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0527,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_0d10 = {
+ 0x0d10, pci_device_102b_0d10,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_0d10,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_1000 = {
+ 0x1000, pci_device_102b_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_1001 = {
+ 0x1001, pci_device_102b_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_2007 = {
+ 0x2007, pci_device_102b_2007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_2007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_2527 = {
+ 0x2527, pci_device_102b_2527,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_2527,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_4536 = {
+ 0x4536, pci_device_102b_4536,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_4536,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102b_6573 = {
+ 0x6573, pci_device_102b_6573,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102b_6573,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00b8 = {
+ 0x00b8, pci_device_102c_00b8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00b8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00c0 = {
+ 0x00c0, pci_device_102c_00c0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00c0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00d0 = {
+ 0x00d0, pci_device_102c_00d0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00d0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00d8 = {
+ 0x00d8, pci_device_102c_00d8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00d8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00dc = {
+ 0x00dc, pci_device_102c_00dc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00dc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00e0 = {
+ 0x00e0, pci_device_102c_00e0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00e0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00e4 = {
+ 0x00e4, pci_device_102c_00e4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00e4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00e5 = {
+ 0x00e5, pci_device_102c_00e5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00e5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00f0 = {
+ 0x00f0, pci_device_102c_00f0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00f0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00f4 = {
+ 0x00f4, pci_device_102c_00f4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00f4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_00f5 = {
+ 0x00f5, pci_device_102c_00f5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_00f5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102c_0c30 = {
+ 0x0c30, pci_device_102c_0c30,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102c_0c30,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_102d_50dc = {
+ 0x50dc, pci_device_102d_50dc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102d_50dc,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_102f_0009 = {
+ 0x0009, pci_device_102f_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102f_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_102f_0020 = {
+ 0x0020, pci_device_102f_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_102f_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1031_5601 = {
+ 0x5601, pci_device_1031_5601,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1031_5601,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1031_5607 = {
+ 0x5607, pci_device_1031_5607,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1031_5607,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1031_5631 = {
+ 0x5631, pci_device_1031_5631,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1031_5631,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1031_6057 = {
+ 0x6057, pci_device_1031_6057,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1031_6057,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0001 = {
+ 0x0001, pci_device_1033_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0002 = {
+ 0x0002, pci_device_1033_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0003 = {
+ 0x0003, pci_device_1033_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0004 = {
+ 0x0004, pci_device_1033_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0005 = {
+ 0x0005, pci_device_1033_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0006 = {
+ 0x0006, pci_device_1033_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0007 = {
+ 0x0007, pci_device_1033_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0008 = {
+ 0x0008, pci_device_1033_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0009 = {
+ 0x0009, pci_device_1033_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0016 = {
+ 0x0016, pci_device_1033_0016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_001a = {
+ 0x001a, pci_device_1033_001a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_001a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0021 = {
+ 0x0021, pci_device_1033_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0029 = {
+ 0x0029, pci_device_1033_0029,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0029,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_002a = {
+ 0x002a, pci_device_1033_002a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_002a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_002c = {
+ 0x002c, pci_device_1033_002c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_002c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_002d = {
+ 0x002d, pci_device_1033_002d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_002d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0035 = {
+ 0x0035, pci_device_1033_0035,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0035,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_003b = {
+ 0x003b, pci_device_1033_003b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_003b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_003e = {
+ 0x003e, pci_device_1033_003e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_003e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0046 = {
+ 0x0046, pci_device_1033_0046,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0046,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_005a = {
+ 0x005a, pci_device_1033_005a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_005a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0063 = {
+ 0x0063, pci_device_1033_0063,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0063,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0067 = {
+ 0x0067, pci_device_1033_0067,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0067,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_0074 = {
+ 0x0074, pci_device_1033_0074,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_0074,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_009b = {
+ 0x009b, pci_device_1033_009b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_009b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_00a6 = {
+ 0x00a6, pci_device_1033_00a6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_00a6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_00cd = {
+ 0x00cd, pci_device_1033_00cd,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_00cd,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1033_00e0 = {
+ 0x00e0, pci_device_1033_00e0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1033_00e0,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1036_0000 = {
+ 0x0000, pci_device_1036_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1036_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1039_0001 = {
+ 0x0001, pci_device_1039_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0002 = {
+ 0x0002, pci_device_1039_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0006 = {
+ 0x0006, pci_device_1039_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0008 = {
+ 0x0008, pci_device_1039_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0009 = {
+ 0x0009, pci_device_1039_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0018 = {
+ 0x0018, pci_device_1039_0018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0018,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0200 = {
+ 0x0200, pci_device_1039_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0204 = {
+ 0x0204, pci_device_1039_0204,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0204,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0205 = {
+ 0x0205, pci_device_1039_0205,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0205,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0300 = {
+ 0x0300, pci_device_1039_0300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0310 = {
+ 0x0310, pci_device_1039_0310,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0310,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0315 = {
+ 0x0315, pci_device_1039_0315,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0315,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0325 = {
+ 0x0325, pci_device_1039_0325,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0325,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0330 = {
+ 0x0330, pci_device_1039_0330,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0330,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0406 = {
+ 0x0406, pci_device_1039_0406,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0406,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0496 = {
+ 0x0496, pci_device_1039_0496,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0496,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0530 = {
+ 0x0530, pci_device_1039_0530,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0530,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0540 = {
+ 0x0540, pci_device_1039_0540,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0540,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0597 = {
+ 0x0597, pci_device_1039_0597,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0597,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0601 = {
+ 0x0601, pci_device_1039_0601,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0601,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0620 = {
+ 0x0620, pci_device_1039_0620,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0620,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0630 = {
+ 0x0630, pci_device_1039_0630,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0630,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0633 = {
+ 0x0633, pci_device_1039_0633,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0633,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0635 = {
+ 0x0635, pci_device_1039_0635,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0635,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0645 = {
+ 0x0645, pci_device_1039_0645,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0645,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0646 = {
+ 0x0646, pci_device_1039_0646,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0646,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0650 = {
+ 0x0650, pci_device_1039_0650,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0650,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0651 = {
+ 0x0651, pci_device_1039_0651,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0651,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0730 = {
+ 0x0730, pci_device_1039_0730,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0730,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0733 = {
+ 0x0733, pci_device_1039_0733,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0733,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0735 = {
+ 0x0735, pci_device_1039_0735,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0735,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0740 = {
+ 0x0740, pci_device_1039_0740,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0740,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0745 = {
+ 0x0745, pci_device_1039_0745,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0745,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0900 = {
+ 0x0900, pci_device_1039_0900,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0900,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0961 = {
+ 0x0961, pci_device_1039_0961,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0961,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_0962 = {
+ 0x0962, pci_device_1039_0962,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_0962,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_3602 = {
+ 0x3602, pci_device_1039_3602,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_3602,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5107 = {
+ 0x5107, pci_device_1039_5107,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5107,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5300 = {
+ 0x5300, pci_device_1039_5300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5315 = {
+ 0x5315, pci_device_1039_5315,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5315,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5401 = {
+ 0x5401, pci_device_1039_5401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5401,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5511 = {
+ 0x5511, pci_device_1039_5511,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5511,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5513 = {
+ 0x5513, pci_device_1039_5513,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5513,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5517 = {
+ 0x5517, pci_device_1039_5517,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5517,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5571 = {
+ 0x5571, pci_device_1039_5571,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5571,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5581 = {
+ 0x5581, pci_device_1039_5581,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5581,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5582 = {
+ 0x5582, pci_device_1039_5582,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5582,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5591 = {
+ 0x5591, pci_device_1039_5591,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5591,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5596 = {
+ 0x5596, pci_device_1039_5596,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5596,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5597 = {
+ 0x5597, pci_device_1039_5597,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5597,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_5600 = {
+ 0x5600, pci_device_1039_5600,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_5600,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_6204 = {
+ 0x6204, pci_device_1039_6204,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_6204,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_6205 = {
+ 0x6205, pci_device_1039_6205,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_6205,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_6236 = {
+ 0x6236, pci_device_1039_6236,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_6236,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_6300 = {
+ 0x6300, pci_device_1039_6300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_6300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_6306 = {
+ 0x6306, pci_device_1039_6306,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_6306,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_6325 = {
+ 0x6325, pci_device_1039_6325,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_6325,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_6326 = {
+ 0x6326, pci_device_1039_6326,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_6326,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_7001 = {
+ 0x7001, pci_device_1039_7001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_7001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_7002 = {
+ 0x7002, pci_device_1039_7002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_7002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_7007 = {
+ 0x7007, pci_device_1039_7007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_7007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_7012 = {
+ 0x7012, pci_device_1039_7012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_7012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_7013 = {
+ 0x7013, pci_device_1039_7013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_7013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_7016 = {
+ 0x7016, pci_device_1039_7016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_7016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1039_7018 = {
+ 0x7018, pci_device_1039_7018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1039_7018,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1005 = {
+ 0x1005, pci_device_103c_1005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1006 = {
+ 0x1006, pci_device_103c_1006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1008 = {
+ 0x1008, pci_device_103c_1008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_100a = {
+ 0x100a, pci_device_103c_100a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_100a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1028 = {
+ 0x1028, pci_device_103c_1028,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1028,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1029 = {
+ 0x1029, pci_device_103c_1029,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1029,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_102a = {
+ 0x102a, pci_device_103c_102a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_102a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1030 = {
+ 0x1030, pci_device_103c_1030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1031 = {
+ 0x1031, pci_device_103c_1031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1031,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1040 = {
+ 0x1040, pci_device_103c_1040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1041 = {
+ 0x1041, pci_device_103c_1041,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1041,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1042 = {
+ 0x1042, pci_device_103c_1042,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1042,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1048 = {
+ 0x1048, pci_device_103c_1048,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1048,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1064 = {
+ 0x1064, pci_device_103c_1064,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1064,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_108b = {
+ 0x108b, pci_device_103c_108b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_108b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_10c1 = {
+ 0x10c1, pci_device_103c_10c1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_10c1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_10ed = {
+ 0x10ed, pci_device_103c_10ed,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_10ed,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1200 = {
+ 0x1200, pci_device_103c_1200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1219 = {
+ 0x1219, pci_device_103c_1219,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1219,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_121a = {
+ 0x121a, pci_device_103c_121a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_121a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_121b = {
+ 0x121b, pci_device_103c_121b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_121b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_121c = {
+ 0x121c, pci_device_103c_121c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_121c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1229 = {
+ 0x1229, pci_device_103c_1229,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1229,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_122a = {
+ 0x122a, pci_device_103c_122a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_122a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_122e = {
+ 0x122e, pci_device_103c_122e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_122e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_1290 = {
+ 0x1290, pci_device_103c_1290,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_1290,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_2910 = {
+ 0x2910, pci_device_103c_2910,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_2910,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_103c_2925 = {
+ 0x2925, pci_device_103c_2925,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_103c_2925,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1042_1000 = {
+ 0x1000, pci_device_1042_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1042_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1042_1001 = {
+ 0x1001, pci_device_1042_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1042_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1042_3000 = {
+ 0x3000, pci_device_1042_3000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1042_3000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1042_3010 = {
+ 0x3010, pci_device_1042_3010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1042_3010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1042_3020 = {
+ 0x3020, pci_device_1042_3020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1042_3020,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1043_0675 = {
+ 0x0675, pci_device_1043_0675,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1043_0675,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1043_4021 = {
+ 0x4021, pci_device_1043_4021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1043_4021,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1044_1012 = {
+ 0x1012, pci_device_1044_1012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1044_1012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1044_a400 = {
+ 0xa400, pci_device_1044_a400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1044_a400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1044_a500 = {
+ 0xa500, pci_device_1044_a500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1044_a500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1044_a501 = {
+ 0xa501, pci_device_1044_a501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1044_a501,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1044_a511 = {
+ 0xa511, pci_device_1044_a511,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1044_a511,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1045_a0f8 = {
+ 0xa0f8, pci_device_1045_a0f8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_a0f8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c101 = {
+ 0xc101, pci_device_1045_c101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c178 = {
+ 0xc178, pci_device_1045_c178,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c178,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c556 = {
+ 0xc556, pci_device_1045_c556,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c556,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c557 = {
+ 0xc557, pci_device_1045_c557,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c557,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c558 = {
+ 0xc558, pci_device_1045_c558,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c558,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c567 = {
+ 0xc567, pci_device_1045_c567,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c567,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c568 = {
+ 0xc568, pci_device_1045_c568,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c568,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c569 = {
+ 0xc569, pci_device_1045_c569,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c569,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c621 = {
+ 0xc621, pci_device_1045_c621,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c621,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c700 = {
+ 0xc700, pci_device_1045_c700,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c700,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c701 = {
+ 0xc701, pci_device_1045_c701,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c701,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c814 = {
+ 0xc814, pci_device_1045_c814,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c814,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c822 = {
+ 0xc822, pci_device_1045_c822,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c822,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c824 = {
+ 0xc824, pci_device_1045_c824,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c824,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c825 = {
+ 0xc825, pci_device_1045_c825,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c825,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c832 = {
+ 0xc832, pci_device_1045_c832,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c832,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c861 = {
+ 0xc861, pci_device_1045_c861,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c861,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c895 = {
+ 0xc895, pci_device_1045_c895,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c895,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_c935 = {
+ 0xc935, pci_device_1045_c935,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_c935,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_d568 = {
+ 0xd568, pci_device_1045_d568,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_d568,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1045_d721 = {
+ 0xd721, pci_device_1045_d721,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1045_d721,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1048_0d22 = {
+ 0x0d22, pci_device_1048_0d22,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1048_0d22,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1048_1000 = {
+ 0x1000, pci_device_1048_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1048_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1048_3000 = {
+ 0x3000, pci_device_1048_3000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1048_3000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_104a_0008 = {
+ 0x0008, pci_device_104a_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104a_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104a_0009 = {
+ 0x0009, pci_device_104a_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104a_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104a_0010 = {
+ 0x0010, pci_device_104a_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104a_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104a_0210 = {
+ 0x0210, pci_device_104a_0210,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104a_0210,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104a_0981 = {
+ 0x0981, pci_device_104a_0981,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104a_0981,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104a_1746 = {
+ 0x1746, pci_device_104a_1746,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104a_1746,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104a_2774 = {
+ 0x2774, pci_device_104a_2774,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104a_2774,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104a_3520 = {
+ 0x3520, pci_device_104a_3520,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104a_3520,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_104b_0140 = {
+ 0x0140, pci_device_104b_0140,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104b_0140,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104b_1040 = {
+ 0x1040, pci_device_104b_1040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104b_1040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104b_8130 = {
+ 0x8130, pci_device_104b_8130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104b_8130,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_104c_0500 = {
+ 0x0500, pci_device_104c_0500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_0500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_0508 = {
+ 0x0508, pci_device_104c_0508,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_0508,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_1000 = {
+ 0x1000, pci_device_104c_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_104c = {
+ 0x104c, pci_device_104c_104c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_104c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_3d04 = {
+ 0x3d04, pci_device_104c_3d04,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_3d04,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_3d07 = {
+ 0x3d07, pci_device_104c_3d07,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_3d07,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8000 = {
+ 0x8000, pci_device_104c_8000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8009 = {
+ 0x8009, pci_device_104c_8009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8017 = {
+ 0x8017, pci_device_104c_8017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8019 = {
+ 0x8019, pci_device_104c_8019,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8019,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8020 = {
+ 0x8020, pci_device_104c_8020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8021 = {
+ 0x8021, pci_device_104c_8021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8022 = {
+ 0x8022, pci_device_104c_8022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8023 = {
+ 0x8023, pci_device_104c_8023,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8023,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8024 = {
+ 0x8024, pci_device_104c_8024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8026 = {
+ 0x8026, pci_device_104c_8026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8027 = {
+ 0x8027, pci_device_104c_8027,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8027,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_8400 = {
+ 0x8400, pci_device_104c_8400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_8400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_a001 = {
+ 0xa001, pci_device_104c_a001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_a001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_a100 = {
+ 0xa100, pci_device_104c_a100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_a100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_a102 = {
+ 0xa102, pci_device_104c_a102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_a102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_a106 = {
+ 0xa106, pci_device_104c_a106,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_a106,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac10 = {
+ 0xac10, pci_device_104c_ac10,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac10,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac11 = {
+ 0xac11, pci_device_104c_ac11,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac11,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac12 = {
+ 0xac12, pci_device_104c_ac12,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac12,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac13 = {
+ 0xac13, pci_device_104c_ac13,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac13,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac15 = {
+ 0xac15, pci_device_104c_ac15,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac15,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac16 = {
+ 0xac16, pci_device_104c_ac16,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac16,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac17 = {
+ 0xac17, pci_device_104c_ac17,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac17,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac18 = {
+ 0xac18, pci_device_104c_ac18,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac18,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac19 = {
+ 0xac19, pci_device_104c_ac19,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac19,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac1a = {
+ 0xac1a, pci_device_104c_ac1a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac1a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac1b = {
+ 0xac1b, pci_device_104c_ac1b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac1b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac1c = {
+ 0xac1c, pci_device_104c_ac1c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac1c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac1d = {
+ 0xac1d, pci_device_104c_ac1d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac1d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac1e = {
+ 0xac1e, pci_device_104c_ac1e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac1e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac1f = {
+ 0xac1f, pci_device_104c_ac1f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac1f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac20 = {
+ 0xac20, pci_device_104c_ac20,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac20,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac21 = {
+ 0xac21, pci_device_104c_ac21,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac21,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac22 = {
+ 0xac22, pci_device_104c_ac22,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac22,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac23 = {
+ 0xac23, pci_device_104c_ac23,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac23,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac28 = {
+ 0xac28, pci_device_104c_ac28,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac28,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac30 = {
+ 0xac30, pci_device_104c_ac30,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac30,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac40 = {
+ 0xac40, pci_device_104c_ac40,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac40,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac41 = {
+ 0xac41, pci_device_104c_ac41,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac41,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac42 = {
+ 0xac42, pci_device_104c_ac42,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac42,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac50 = {
+ 0xac50, pci_device_104c_ac50,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac50,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac51 = {
+ 0xac51, pci_device_104c_ac51,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac51,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac52 = {
+ 0xac52, pci_device_104c_ac52,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac52,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac53 = {
+ 0xac53, pci_device_104c_ac53,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac53,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac55 = {
+ 0xac55, pci_device_104c_ac55,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac55,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac56 = {
+ 0xac56, pci_device_104c_ac56,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac56,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_ac60 = {
+ 0xac60, pci_device_104c_ac60,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_ac60,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_fe00 = {
+ 0xfe00, pci_device_104c_fe00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_fe00,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104c_fe03 = {
+ 0xfe03, pci_device_104c_fe03,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104c_fe03,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104d_8009 = {
+ 0x8009, pci_device_104d_8009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104d_8009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104d_8039 = {
+ 0x8039, pci_device_104d_8039,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104d_8039,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104d_8056 = {
+ 0x8056, pci_device_104d_8056,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104d_8056,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104d_808a = {
+ 0x808a, pci_device_104d_808a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104d_808a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104e_0017 = {
+ 0x0017, pci_device_104e_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104e_0017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104e_0107 = {
+ 0x0107, pci_device_104e_0107,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104e_0107,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104e_0109 = {
+ 0x0109, pci_device_104e_0109,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104e_0109,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104e_0111 = {
+ 0x0111, pci_device_104e_0111,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104e_0111,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104e_0217 = {
+ 0x0217, pci_device_104e_0217,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104e_0217,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_104e_0317 = {
+ 0x0317, pci_device_104e_0317,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_104e_0317,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1050_0000 = {
+ 0x0000, pci_device_1050_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1050_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1050_0001 = {
+ 0x0001, pci_device_1050_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1050_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1050_0105 = {
+ 0x0105, pci_device_1050_0105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1050_0105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1050_0840 = {
+ 0x0840, pci_device_1050_0840,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1050_0840,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1050_0940 = {
+ 0x0940, pci_device_1050_0940,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1050_0940,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1050_5a5a = {
+ 0x5a5a, pci_device_1050_5a5a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1050_5a5a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1050_6692 = {
+ 0x6692, pci_device_1050_6692,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1050_6692,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1050_9970 = {
+ 0x9970, pci_device_1050_9970,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1050_9970,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1055_9130 = {
+ 0x9130, pci_device_1055_9130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1055_9130,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1055_9460 = {
+ 0x9460, pci_device_1055_9460,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1055_9460,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1055_9462 = {
+ 0x9462, pci_device_1055_9462,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1055_9462,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1055_9463 = {
+ 0x9463, pci_device_1055_9463,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1055_9463,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1057_0001 = {
+ 0x0001, pci_device_1057_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_0002 = {
+ 0x0002, pci_device_1057_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_0003 = {
+ 0x0003, pci_device_1057_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_0004 = {
+ 0x0004, pci_device_1057_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_0006 = {
+ 0x0006, pci_device_1057_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_0100 = {
+ 0x0100, pci_device_1057_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_0431 = {
+ 0x0431, pci_device_1057_0431,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_0431,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_1801 = {
+ 0x1801, pci_device_1057_1801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_1801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_18c0 = {
+ 0x18c0, pci_device_1057_18c0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_18c0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_4801 = {
+ 0x4801, pci_device_1057_4801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_4801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_4802 = {
+ 0x4802, pci_device_1057_4802,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_4802,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_4803 = {
+ 0x4803, pci_device_1057_4803,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_4803,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_4806 = {
+ 0x4806, pci_device_1057_4806,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_4806,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_4d68 = {
+ 0x4d68, pci_device_1057_4d68,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_4d68,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_5600 = {
+ 0x5600, pci_device_1057_5600,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_5600,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1057_6400 = {
+ 0x6400, pci_device_1057_6400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1057_6400,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_105a_0d30 = {
+ 0x0d30, pci_device_105a_0d30,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_0d30,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_0d38 = {
+ 0x0d38, pci_device_105a_0d38,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_0d38,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_1275 = {
+ 0x1275, pci_device_105a_1275,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_1275,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_3376 = {
+ 0x3376, pci_device_105a_3376,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_3376,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_4d30 = {
+ 0x4d30, pci_device_105a_4d30,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_4d30,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_4d33 = {
+ 0x4d33, pci_device_105a_4d33,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_4d33,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_4d38 = {
+ 0x4d38, pci_device_105a_4d38,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_4d38,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_4d68 = {
+ 0x4d68, pci_device_105a_4d68,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_4d68,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_4d69 = {
+ 0x4d69, pci_device_105a_4d69,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_4d69,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_5275 = {
+ 0x5275, pci_device_105a_5275,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_5275,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_5300 = {
+ 0x5300, pci_device_105a_5300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_5300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_6268 = {
+ 0x6268, pci_device_105a_6268,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_6268,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_6269 = {
+ 0x6269, pci_device_105a_6269,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_6269,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_6621 = {
+ 0x6621, pci_device_105a_6621,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_6621,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105a_7275 = {
+ 0x7275, pci_device_105a_7275,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105a_7275,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_105d_2309 = {
+ 0x2309, pci_device_105d_2309,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105d_2309,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105d_2339 = {
+ 0x2339, pci_device_105d_2339,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105d_2339,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105d_493d = {
+ 0x493d, pci_device_105d_493d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105d_493d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_105d_5348 = {
+ 0x5348, pci_device_105d_5348,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_105d_5348,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1060_0001 = {
+ 0x0001, pci_device_1060_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_0002 = {
+ 0x0002, pci_device_1060_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_0101 = {
+ 0x0101, pci_device_1060_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_0881 = {
+ 0x0881, pci_device_1060_0881,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_0881,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_0886 = {
+ 0x0886, pci_device_1060_0886,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_0886,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_0891 = {
+ 0x0891, pci_device_1060_0891,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_0891,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_1001 = {
+ 0x1001, pci_device_1060_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_673a = {
+ 0x673a, pci_device_1060_673a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_673a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_673b = {
+ 0x673b, pci_device_1060_673b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_673b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_8710 = {
+ 0x8710, pci_device_1060_8710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_8710,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_886a = {
+ 0x886a, pci_device_1060_886a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_886a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_8881 = {
+ 0x8881, pci_device_1060_8881,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_8881,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_8886 = {
+ 0x8886, pci_device_1060_8886,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_8886,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_888a = {
+ 0x888a, pci_device_1060_888a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_888a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_8891 = {
+ 0x8891, pci_device_1060_8891,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_8891,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_9017 = {
+ 0x9017, pci_device_1060_9017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_9017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_9018 = {
+ 0x9018, pci_device_1060_9018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_9018,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_9026 = {
+ 0x9026, pci_device_1060_9026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_9026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_e881 = {
+ 0xe881, pci_device_1060_e881,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_e881,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_e886 = {
+ 0xe886, pci_device_1060_e886,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_e886,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_e88a = {
+ 0xe88a, pci_device_1060_e88a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_e88a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1060_e891 = {
+ 0xe891, pci_device_1060_e891,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1060_e891,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1061_0001 = {
+ 0x0001, pci_device_1061_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1061_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1061_0002 = {
+ 0x0002, pci_device_1061_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1061_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1066_0000 = {
+ 0x0000, pci_device_1066_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1066_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1066_0001 = {
+ 0x0001, pci_device_1066_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1066_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1066_0002 = {
+ 0x0002, pci_device_1066_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1066_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1066_0003 = {
+ 0x0003, pci_device_1066_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1066_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1066_0004 = {
+ 0x0004, pci_device_1066_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1066_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1066_0005 = {
+ 0x0005, pci_device_1066_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1066_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1066_8002 = {
+ 0x8002, pci_device_1066_8002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1066_8002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1067_1002 = {
+ 0x1002, pci_device_1067_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1067_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1069_0001 = {
+ 0x0001, pci_device_1069_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1069_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1069_0002 = {
+ 0x0002, pci_device_1069_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1069_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1069_0010 = {
+ 0x0010, pci_device_1069_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1069_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1069_0050 = {
+ 0x0050, pci_device_1069_0050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1069_0050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1069_ba55 = {
+ 0xba55, pci_device_1069_ba55,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1069_ba55,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1069_ba56 = {
+ 0xba56, pci_device_1069_ba56,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1069_ba56,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_106b_0001 = {
+ 0x0001, pci_device_106b_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0002 = {
+ 0x0002, pci_device_106b_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0003 = {
+ 0x0003, pci_device_106b_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0004 = {
+ 0x0004, pci_device_106b_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0007 = {
+ 0x0007, pci_device_106b_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_000e = {
+ 0x000e, pci_device_106b_000e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_000e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0010 = {
+ 0x0010, pci_device_106b_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0017 = {
+ 0x0017, pci_device_106b_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0018 = {
+ 0x0018, pci_device_106b_0018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0018,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0019 = {
+ 0x0019, pci_device_106b_0019,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0019,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_001e = {
+ 0x001e, pci_device_106b_001e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_001e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_001f = {
+ 0x001f, pci_device_106b_001f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_001f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0020 = {
+ 0x0020, pci_device_106b_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0021 = {
+ 0x0021, pci_device_106b_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0022 = {
+ 0x0022, pci_device_106b_0022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0024 = {
+ 0x0024, pci_device_106b_0024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0025 = {
+ 0x0025, pci_device_106b_0025,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0025,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0026 = {
+ 0x0026, pci_device_106b_0026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0027 = {
+ 0x0027, pci_device_106b_0027,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0027,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0028 = {
+ 0x0028, pci_device_106b_0028,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0028,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0029 = {
+ 0x0029, pci_device_106b_0029,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0029,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_002d = {
+ 0x002d, pci_device_106b_002d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_002d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_002e = {
+ 0x002e, pci_device_106b_002e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_002e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_002f = {
+ 0x002f, pci_device_106b_002f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_002f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0030 = {
+ 0x0030, pci_device_106b_0030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0031 = {
+ 0x0031, pci_device_106b_0031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0031,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0032 = {
+ 0x0032, pci_device_106b_0032,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0032,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0033 = {
+ 0x0033, pci_device_106b_0033,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0033,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_0034 = {
+ 0x0034, pci_device_106b_0034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_0034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106b_1645 = {
+ 0x1645, pci_device_106b_1645,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106b_1645,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_106c_8801 = {
+ 0x8801, pci_device_106c_8801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106c_8801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106c_8802 = {
+ 0x8802, pci_device_106c_8802,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106c_8802,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106c_8803 = {
+ 0x8803, pci_device_106c_8803,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106c_8803,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106c_8804 = {
+ 0x8804, pci_device_106c_8804,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106c_8804,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_106c_8805 = {
+ 0x8805, pci_device_106c_8805,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_106c_8805,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1073_0001 = {
+ 0x0001, pci_device_1073_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0002 = {
+ 0x0002, pci_device_1073_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0003 = {
+ 0x0003, pci_device_1073_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0004 = {
+ 0x0004, pci_device_1073_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0005 = {
+ 0x0005, pci_device_1073_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0006 = {
+ 0x0006, pci_device_1073_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0008 = {
+ 0x0008, pci_device_1073_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_000a = {
+ 0x000a, pci_device_1073_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_000c = {
+ 0x000c, pci_device_1073_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_000d = {
+ 0x000d, pci_device_1073_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_000d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0010 = {
+ 0x0010, pci_device_1073_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0012 = {
+ 0x0012, pci_device_1073_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_0020 = {
+ 0x0020, pci_device_1073_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1073_2000 = {
+ 0x2000, pci_device_1073_2000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1073_2000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1074_4e78 = {
+ 0x4e78, pci_device_1074_4e78,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1074_4e78,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1077_1016 = {
+ 0x1016, pci_device_1077_1016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_1016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_1020 = {
+ 0x1020, pci_device_1077_1020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_1020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_1022 = {
+ 0x1022, pci_device_1077_1022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_1022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_1080 = {
+ 0x1080, pci_device_1077_1080,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_1080,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_1216 = {
+ 0x1216, pci_device_1077_1216,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_1216,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_1240 = {
+ 0x1240, pci_device_1077_1240,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_1240,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_1280 = {
+ 0x1280, pci_device_1077_1280,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_1280,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_2020 = {
+ 0x2020, pci_device_1077_2020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_2020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_2100 = {
+ 0x2100, pci_device_1077_2100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_2100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_2200 = {
+ 0x2200, pci_device_1077_2200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_2200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_2300 = {
+ 0x2300, pci_device_1077_2300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_2300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1077_2312 = {
+ 0x2312, pci_device_1077_2312,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1077_2312,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1078_0000 = {
+ 0x0000, pci_device_1078_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0001 = {
+ 0x0001, pci_device_1078_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0002 = {
+ 0x0002, pci_device_1078_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0100 = {
+ 0x0100, pci_device_1078_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0101 = {
+ 0x0101, pci_device_1078_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0102 = {
+ 0x0102, pci_device_1078_0102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0103 = {
+ 0x0103, pci_device_1078_0103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0104 = {
+ 0x0104, pci_device_1078_0104,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0104,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0400 = {
+ 0x0400, pci_device_1078_0400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0401 = {
+ 0x0401, pci_device_1078_0401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0401,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0402 = {
+ 0x0402, pci_device_1078_0402,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0402,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1078_0403 = {
+ 0x0403, pci_device_1078_0403,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1078_0403,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_107d_0000 = {
+ 0x0000, pci_device_107d_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107d_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_107e_0001 = {
+ 0x0001, pci_device_107e_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_0002 = {
+ 0x0002, pci_device_107e_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_0004 = {
+ 0x0004, pci_device_107e_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_0005 = {
+ 0x0005, pci_device_107e_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_0008 = {
+ 0x0008, pci_device_107e_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9003 = {
+ 0x9003, pci_device_107e_9003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9007 = {
+ 0x9007, pci_device_107e_9007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9008 = {
+ 0x9008, pci_device_107e_9008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_900c = {
+ 0x900c, pci_device_107e_900c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_900c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_900e = {
+ 0x900e, pci_device_107e_900e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_900e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9011 = {
+ 0x9011, pci_device_107e_9011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9013 = {
+ 0x9013, pci_device_107e_9013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9023 = {
+ 0x9023, pci_device_107e_9023,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9023,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9027 = {
+ 0x9027, pci_device_107e_9027,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9027,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9031 = {
+ 0x9031, pci_device_107e_9031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9031,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_107e_9033 = {
+ 0x9033, pci_device_107e_9033,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107e_9033,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_107f_0802 = {
+ 0x0802, pci_device_107f_0802,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_107f_0802,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1080_0600 = {
+ 0x0600, pci_device_1080_0600,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1080_0600,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1080_c691 = {
+ 0xc691, pci_device_1080_c691,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1080_c691,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1080_c693 = {
+ 0xc693, pci_device_1080_c693,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1080_c693,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1081_0d47 = {
+ 0x0d47, pci_device_1081_0d47,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1081_0d47,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1083_0001 = {
+ 0x0001, pci_device_1083_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1083_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_108a_0001 = {
+ 0x0001, pci_device_108a_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108a_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108a_0010 = {
+ 0x0010, pci_device_108a_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108a_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108a_0040 = {
+ 0x0040, pci_device_108a_0040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108a_0040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108a_3000 = {
+ 0x3000, pci_device_108a_3000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108a_3000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_108d_0001 = {
+ 0x0001, pci_device_108d_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0002 = {
+ 0x0002, pci_device_108d_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0004 = {
+ 0x0004, pci_device_108d_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0005 = {
+ 0x0005, pci_device_108d_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0006 = {
+ 0x0006, pci_device_108d_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0007 = {
+ 0x0007, pci_device_108d_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0008 = {
+ 0x0008, pci_device_108d_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0011 = {
+ 0x0011, pci_device_108d_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0012 = {
+ 0x0012, pci_device_108d_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0013 = {
+ 0x0013, pci_device_108d_0013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0014 = {
+ 0x0014, pci_device_108d_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0019 = {
+ 0x0019, pci_device_108d_0019,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0019,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0021 = {
+ 0x0021, pci_device_108d_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108d_0022 = {
+ 0x0022, pci_device_108d_0022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108d_0022,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_108e_0001 = {
+ 0x0001, pci_device_108e_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_1000 = {
+ 0x1000, pci_device_108e_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_1001 = {
+ 0x1001, pci_device_108e_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_1100 = {
+ 0x1100, pci_device_108e_1100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_1100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_1101 = {
+ 0x1101, pci_device_108e_1101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_1101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_1102 = {
+ 0x1102, pci_device_108e_1102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_1102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_1103 = {
+ 0x1103, pci_device_108e_1103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_1103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_2bad = {
+ 0x2bad, pci_device_108e_2bad,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_2bad,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_5000 = {
+ 0x5000, pci_device_108e_5000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_5000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_5043 = {
+ 0x5043, pci_device_108e_5043,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_5043,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_8000 = {
+ 0x8000, pci_device_108e_8000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_8000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_8001 = {
+ 0x8001, pci_device_108e_8001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_8001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_a000 = {
+ 0xa000, pci_device_108e_a000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_a000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_108e_a001 = {
+ 0xa001, pci_device_108e_a001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_108e_a001,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1091_0020 = {
+ 0x0020, pci_device_1091_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1091_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1091_0021 = {
+ 0x0021, pci_device_1091_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1091_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1091_0040 = {
+ 0x0040, pci_device_1091_0040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1091_0040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1091_0041 = {
+ 0x0041, pci_device_1091_0041,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1091_0041,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1091_0060 = {
+ 0x0060, pci_device_1091_0060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1091_0060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1091_00e4 = {
+ 0x00e4, pci_device_1091_00e4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1091_00e4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1091_0720 = {
+ 0x0720, pci_device_1091_0720,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1091_0720,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1092_00a0 = {
+ 0x00a0, pci_device_1092_00a0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_00a0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_00a8 = {
+ 0x00a8, pci_device_1092_00a8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_00a8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_0550 = {
+ 0x0550, pci_device_1092_0550,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_0550,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_08d4 = {
+ 0x08d4, pci_device_1092_08d4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_08d4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_094c = {
+ 0x094c, pci_device_1092_094c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_094c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_1092 = {
+ 0x1092, pci_device_1092_1092,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_1092,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_6120 = {
+ 0x6120, pci_device_1092_6120,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_6120,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_8810 = {
+ 0x8810, pci_device_1092_8810,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_8810,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_8811 = {
+ 0x8811, pci_device_1092_8811,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_8811,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_8880 = {
+ 0x8880, pci_device_1092_8880,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_8880,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_8881 = {
+ 0x8881, pci_device_1092_8881,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_8881,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_88b0 = {
+ 0x88b0, pci_device_1092_88b0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_88b0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_88b1 = {
+ 0x88b1, pci_device_1092_88b1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_88b1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_88c0 = {
+ 0x88c0, pci_device_1092_88c0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_88c0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_88c1 = {
+ 0x88c1, pci_device_1092_88c1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_88c1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_88d0 = {
+ 0x88d0, pci_device_1092_88d0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_88d0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_88d1 = {
+ 0x88d1, pci_device_1092_88d1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_88d1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_88f0 = {
+ 0x88f0, pci_device_1092_88f0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_88f0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_88f1 = {
+ 0x88f1, pci_device_1092_88f1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_88f1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1092_9999 = {
+ 0x9999, pci_device_1092_9999,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1092_9999,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1093_0160 = {
+ 0x0160, pci_device_1093_0160,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_0160,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_0162 = {
+ 0x0162, pci_device_1093_0162,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_0162,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_1170 = {
+ 0x1170, pci_device_1093_1170,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_1170,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_1180 = {
+ 0x1180, pci_device_1093_1180,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_1180,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_1190 = {
+ 0x1190, pci_device_1093_1190,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_1190,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_1330 = {
+ 0x1330, pci_device_1093_1330,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_1330,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_1350 = {
+ 0x1350, pci_device_1093_1350,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_1350,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_2a60 = {
+ 0x2a60, pci_device_1093_2a60,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_2a60,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b001 = {
+ 0xb001, pci_device_1093_b001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b011 = {
+ 0xb011, pci_device_1093_b011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b021 = {
+ 0xb021, pci_device_1093_b021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b031 = {
+ 0xb031, pci_device_1093_b031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b031,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b041 = {
+ 0xb041, pci_device_1093_b041,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b041,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b051 = {
+ 0xb051, pci_device_1093_b051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b051,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b061 = {
+ 0xb061, pci_device_1093_b061,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b061,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b071 = {
+ 0xb071, pci_device_1093_b071,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b071,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b081 = {
+ 0xb081, pci_device_1093_b081,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b081,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_b091 = {
+ 0xb091, pci_device_1093_b091,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_b091,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_c801 = {
+ 0xc801, pci_device_1093_c801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_c801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1093_c831 = {
+ 0xc831, pci_device_1093_c831,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1093_c831,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1095_0640 = {
+ 0x0640, pci_device_1095_0640,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0640,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0643 = {
+ 0x0643, pci_device_1095_0643,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0643,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0646 = {
+ 0x0646, pci_device_1095_0646,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0646,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0647 = {
+ 0x0647, pci_device_1095_0647,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0647,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0648 = {
+ 0x0648, pci_device_1095_0648,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0648,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0649 = {
+ 0x0649, pci_device_1095_0649,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0649,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0650 = {
+ 0x0650, pci_device_1095_0650,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0650,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0670 = {
+ 0x0670, pci_device_1095_0670,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0670,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0673 = {
+ 0x0673, pci_device_1095_0673,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0673,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_0680 = {
+ 0x0680, pci_device_1095_0680,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_0680,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1095_3112 = {
+ 0x3112, pci_device_1095_3112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1095_3112,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1098_0001 = {
+ 0x0001, pci_device_1098_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1098_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1098_0002 = {
+ 0x0002, pci_device_1098_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1098_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_109e_0350 = {
+ 0x0350, pci_device_109e_0350,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_0350,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_0351 = {
+ 0x0351, pci_device_109e_0351,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_0351,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_0369 = {
+ 0x0369, pci_device_109e_0369,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_0369,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_036c = {
+ 0x036c, pci_device_109e_036c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_036c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_036e = {
+ 0x036e, pci_device_109e_036e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_036e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_036f = {
+ 0x036f, pci_device_109e_036f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_036f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_0370 = {
+ 0x0370, pci_device_109e_0370,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_0370,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_0878 = {
+ 0x0878, pci_device_109e_0878,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_0878,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_0879 = {
+ 0x0879, pci_device_109e_0879,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_0879,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_0880 = {
+ 0x0880, pci_device_109e_0880,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_0880,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_2115 = {
+ 0x2115, pci_device_109e_2115,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_2115,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_2125 = {
+ 0x2125, pci_device_109e_2125,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_2125,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_2164 = {
+ 0x2164, pci_device_109e_2164,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_2164,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_2165 = {
+ 0x2165, pci_device_109e_2165,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_2165,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_8230 = {
+ 0x8230, pci_device_109e_8230,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_8230,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_8472 = {
+ 0x8472, pci_device_109e_8472,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_8472,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_109e_8474 = {
+ 0x8474, pci_device_109e_8474,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_109e_8474,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10a5_5449 = {
+ 0x5449, pci_device_10a5_5449,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a5_5449,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10a8_0000 = {
+ 0x0000, pci_device_10a8_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a8_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10a9_0001 = {
+ 0x0001, pci_device_10a9_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0002 = {
+ 0x0002, pci_device_10a9_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0003 = {
+ 0x0003, pci_device_10a9_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0004 = {
+ 0x0004, pci_device_10a9_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0005 = {
+ 0x0005, pci_device_10a9_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0006 = {
+ 0x0006, pci_device_10a9_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0007 = {
+ 0x0007, pci_device_10a9_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0008 = {
+ 0x0008, pci_device_10a9_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0009 = {
+ 0x0009, pci_device_10a9_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0010 = {
+ 0x0010, pci_device_10a9_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0011 = {
+ 0x0011, pci_device_10a9_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_0012 = {
+ 0x0012, pci_device_10a9_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_1001 = {
+ 0x1001, pci_device_10a9_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_1002 = {
+ 0x1002, pci_device_10a9_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_1003 = {
+ 0x1003, pci_device_10a9_1003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_1003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_1004 = {
+ 0x1004, pci_device_10a9_1004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_1004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_1005 = {
+ 0x1005, pci_device_10a9_1005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_1005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_1006 = {
+ 0x1006, pci_device_10a9_1006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_1006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_1007 = {
+ 0x1007, pci_device_10a9_1007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_1007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_1008 = {
+ 0x1008, pci_device_10a9_1008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_1008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_2001 = {
+ 0x2001, pci_device_10a9_2001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_2001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_2002 = {
+ 0x2002, pci_device_10a9_2002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_2002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_8001 = {
+ 0x8001, pci_device_10a9_8001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_8001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10a9_8002 = {
+ 0x8002, pci_device_10a9_8002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10a9_8002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10aa_0000 = {
+ 0x0000, pci_device_10aa_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10aa_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10ad_0001 = {
+ 0x0001, pci_device_10ad_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ad_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ad_0003 = {
+ 0x0003, pci_device_10ad_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ad_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ad_0005 = {
+ 0x0005, pci_device_10ad_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ad_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ad_0103 = {
+ 0x0103, pci_device_10ad_0103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ad_0103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ad_0105 = {
+ 0x0105, pci_device_10ad_0105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ad_0105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ad_0565 = {
+ 0x0565, pci_device_10ad_0565,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ad_0565,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10b3_3106 = {
+ 0x3106, pci_device_10b3_3106,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b3_3106,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b3_b106 = {
+ 0xb106, pci_device_10b3_b106,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b3_b106,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10b4_1b1d = {
+ 0x1b1d, pci_device_10b4_1b1d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b4_1b1d,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10b5_0001 = {
+ 0x0001, pci_device_10b5_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_1076 = {
+ 0x1076, pci_device_10b5_1076,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_1076,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_1077 = {
+ 0x1077, pci_device_10b5_1077,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_1077,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_1078 = {
+ 0x1078, pci_device_10b5_1078,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_1078,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_1103 = {
+ 0x1103, pci_device_10b5_1103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_1103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_1146 = {
+ 0x1146, pci_device_10b5_1146,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_1146,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_1147 = {
+ 0x1147, pci_device_10b5_1147,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_1147,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_2724 = {
+ 0x2724, pci_device_10b5_2724,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_2724,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_9030 = {
+ 0x9030, pci_device_10b5_9030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_9030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_9036 = {
+ 0x9036, pci_device_10b5_9036,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_9036,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_9050 = {
+ 0x9050, pci_device_10b5_9050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_9050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_9054 = {
+ 0x9054, pci_device_10b5_9054,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_9054,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_9060 = {
+ 0x9060, pci_device_10b5_9060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_9060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_906d = {
+ 0x906d, pci_device_10b5_906d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_906d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_906e = {
+ 0x906e, pci_device_10b5_906e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_906e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b5_9080 = {
+ 0x9080, pci_device_10b5_9080,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b5_9080,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10b6_0001 = {
+ 0x0001, pci_device_10b6_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_0002 = {
+ 0x0002, pci_device_10b6_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_0003 = {
+ 0x0003, pci_device_10b6_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_0004 = {
+ 0x0004, pci_device_10b6_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_0006 = {
+ 0x0006, pci_device_10b6_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_0007 = {
+ 0x0007, pci_device_10b6_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_0009 = {
+ 0x0009, pci_device_10b6_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_000a = {
+ 0x000a, pci_device_10b6_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_000b = {
+ 0x000b, pci_device_10b6_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_000c = {
+ 0x000c, pci_device_10b6_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_1000 = {
+ 0x1000, pci_device_10b6_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b6_1001 = {
+ 0x1001, pci_device_10b6_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b6_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10b7_0001 = {
+ 0x0001, pci_device_10b7_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_1006 = {
+ 0x1006, pci_device_10b7_1006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_1006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_1007 = {
+ 0x1007, pci_device_10b7_1007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_1007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_3390 = {
+ 0x3390, pci_device_10b7_3390,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_3390,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_3590 = {
+ 0x3590, pci_device_10b7_3590,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_3590,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_4500 = {
+ 0x4500, pci_device_10b7_4500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_4500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5055 = {
+ 0x5055, pci_device_10b7_5055,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5055,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5057 = {
+ 0x5057, pci_device_10b7_5057,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5057,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5157 = {
+ 0x5157, pci_device_10b7_5157,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5157,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5257 = {
+ 0x5257, pci_device_10b7_5257,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5257,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5900 = {
+ 0x5900, pci_device_10b7_5900,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5900,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5920 = {
+ 0x5920, pci_device_10b7_5920,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5920,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5950 = {
+ 0x5950, pci_device_10b7_5950,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5950,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5951 = {
+ 0x5951, pci_device_10b7_5951,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5951,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5952 = {
+ 0x5952, pci_device_10b7_5952,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5952,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5970 = {
+ 0x5970, pci_device_10b7_5970,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5970,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_5b57 = {
+ 0x5b57, pci_device_10b7_5b57,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_5b57,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_6055 = {
+ 0x6055, pci_device_10b7_6055,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_6055,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_6056 = {
+ 0x6056, pci_device_10b7_6056,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_6056,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_6560 = {
+ 0x6560, pci_device_10b7_6560,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_6560,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_6561 = {
+ 0x6561, pci_device_10b7_6561,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_6561,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_6562 = {
+ 0x6562, pci_device_10b7_6562,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_6562,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_6563 = {
+ 0x6563, pci_device_10b7_6563,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_6563,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_6564 = {
+ 0x6564, pci_device_10b7_6564,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_6564,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_7646 = {
+ 0x7646, pci_device_10b7_7646,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_7646,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_7940 = {
+ 0x7940, pci_device_10b7_7940,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_7940,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_7980 = {
+ 0x7980, pci_device_10b7_7980,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_7980,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_7990 = {
+ 0x7990, pci_device_10b7_7990,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_7990,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_8811 = {
+ 0x8811, pci_device_10b7_8811,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_8811,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9000 = {
+ 0x9000, pci_device_10b7_9000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9001 = {
+ 0x9001, pci_device_10b7_9001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9004 = {
+ 0x9004, pci_device_10b7_9004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9005 = {
+ 0x9005, pci_device_10b7_9005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9006 = {
+ 0x9006, pci_device_10b7_9006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_900a = {
+ 0x900a, pci_device_10b7_900a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_900a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9050 = {
+ 0x9050, pci_device_10b7_9050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9051 = {
+ 0x9051, pci_device_10b7_9051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9051,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9055 = {
+ 0x9055, pci_device_10b7_9055,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9055,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9056 = {
+ 0x9056, pci_device_10b7_9056,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9056,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9058 = {
+ 0x9058, pci_device_10b7_9058,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9058,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_905a = {
+ 0x905a, pci_device_10b7_905a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_905a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9200 = {
+ 0x9200, pci_device_10b7_9200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9201 = {
+ 0x9201, pci_device_10b7_9201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9300 = {
+ 0x9300, pci_device_10b7_9300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9800 = {
+ 0x9800, pci_device_10b7_9800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9805 = {
+ 0x9805, pci_device_10b7_9805,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9805,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9900 = {
+ 0x9900, pci_device_10b7_9900,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9900,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9902 = {
+ 0x9902, pci_device_10b7_9902,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9902,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9903 = {
+ 0x9903, pci_device_10b7_9903,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9903,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9904 = {
+ 0x9904, pci_device_10b7_9904,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9904,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9905 = {
+ 0x9905, pci_device_10b7_9905,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9905,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9908 = {
+ 0x9908, pci_device_10b7_9908,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9908,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_9909 = {
+ 0x9909, pci_device_10b7_9909,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_9909,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b7_990b = {
+ 0x990b, pci_device_10b7_990b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b7_990b,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10b8_0005 = {
+ 0x0005, pci_device_10b8_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b8_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b8_0006 = {
+ 0x0006, pci_device_10b8_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b8_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b8_1000 = {
+ 0x1000, pci_device_10b8_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b8_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b8_1001 = {
+ 0x1001, pci_device_10b8_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b8_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b8_a011 = {
+ 0xa011, pci_device_10b8_a011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b8_a011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b8_b106 = {
+ 0xb106, pci_device_10b8_b106,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b8_b106,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_10b9_0111 = {
+ 0x0111, pci_device_10b9_0111,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_0111,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1435 = {
+ 0x1435, pci_device_10b9_1435,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1435,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1445 = {
+ 0x1445, pci_device_10b9_1445,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1445,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1449 = {
+ 0x1449, pci_device_10b9_1449,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1449,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1451 = {
+ 0x1451, pci_device_10b9_1451,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1451,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1461 = {
+ 0x1461, pci_device_10b9_1461,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1461,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1489 = {
+ 0x1489, pci_device_10b9_1489,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1489,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1511 = {
+ 0x1511, pci_device_10b9_1511,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1511,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1512 = {
+ 0x1512, pci_device_10b9_1512,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1512,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1513 = {
+ 0x1513, pci_device_10b9_1513,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1513,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1521 = {
+ 0x1521, pci_device_10b9_1521,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1521,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1523 = {
+ 0x1523, pci_device_10b9_1523,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1523,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1531 = {
+ 0x1531, pci_device_10b9_1531,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1531,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1533 = {
+ 0x1533, pci_device_10b9_1533,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1533,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1541 = {
+ 0x1541, pci_device_10b9_1541,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1541,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1543 = {
+ 0x1543, pci_device_10b9_1543,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1543,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1563 = {
+ 0x1563, pci_device_10b9_1563,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1563,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1621 = {
+ 0x1621, pci_device_10b9_1621,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1621,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1631 = {
+ 0x1631, pci_device_10b9_1631,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1631,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1632 = {
+ 0x1632, pci_device_10b9_1632,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1632,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1641 = {
+ 0x1641, pci_device_10b9_1641,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1641,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1644 = {
+ 0x1644, pci_device_10b9_1644,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1644,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1646 = {
+ 0x1646, pci_device_10b9_1646,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1646,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1647 = {
+ 0x1647, pci_device_10b9_1647,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1647,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1651 = {
+ 0x1651, pci_device_10b9_1651,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1651,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1671 = {
+ 0x1671, pci_device_10b9_1671,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1671,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1681 = {
+ 0x1681, pci_device_10b9_1681,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1681,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_1687 = {
+ 0x1687, pci_device_10b9_1687,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_1687,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_3141 = {
+ 0x3141, pci_device_10b9_3141,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_3141,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_3143 = {
+ 0x3143, pci_device_10b9_3143,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_3143,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_3145 = {
+ 0x3145, pci_device_10b9_3145,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_3145,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_3147 = {
+ 0x3147, pci_device_10b9_3147,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_3147,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_3149 = {
+ 0x3149, pci_device_10b9_3149,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_3149,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_3151 = {
+ 0x3151, pci_device_10b9_3151,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_3151,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_3307 = {
+ 0x3307, pci_device_10b9_3307,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_3307,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_3309 = {
+ 0x3309, pci_device_10b9_3309,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_3309,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5212 = {
+ 0x5212, pci_device_10b9_5212,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5212,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5215 = {
+ 0x5215, pci_device_10b9_5215,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5215,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5217 = {
+ 0x5217, pci_device_10b9_5217,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5217,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5219 = {
+ 0x5219, pci_device_10b9_5219,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5219,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5225 = {
+ 0x5225, pci_device_10b9_5225,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5225,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5229 = {
+ 0x5229, pci_device_10b9_5229,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5229,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5235 = {
+ 0x5235, pci_device_10b9_5235,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5235,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5237 = {
+ 0x5237, pci_device_10b9_5237,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5237,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5239 = {
+ 0x5239, pci_device_10b9_5239,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5239,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5243 = {
+ 0x5243, pci_device_10b9_5243,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5243,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5247 = {
+ 0x5247, pci_device_10b9_5247,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5247,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5249 = {
+ 0x5249, pci_device_10b9_5249,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5249,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5251 = {
+ 0x5251, pci_device_10b9_5251,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5251,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5253 = {
+ 0x5253, pci_device_10b9_5253,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5253,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5261 = {
+ 0x5261, pci_device_10b9_5261,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5261,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5451 = {
+ 0x5451, pci_device_10b9_5451,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5451,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5453 = {
+ 0x5453, pci_device_10b9_5453,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5453,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5455 = {
+ 0x5455, pci_device_10b9_5455,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5455,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5457 = {
+ 0x5457, pci_device_10b9_5457,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5457,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5459 = {
+ 0x5459, pci_device_10b9_5459,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5459,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_545a = {
+ 0x545a, pci_device_10b9_545a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_545a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5471 = {
+ 0x5471, pci_device_10b9_5471,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5471,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_5473 = {
+ 0x5473, pci_device_10b9_5473,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_5473,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10b9_7101 = {
+ 0x7101, pci_device_10b9_7101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10b9_7101,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10ba_0301 = {
+ 0x0301, pci_device_10ba_0301,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ba_0301,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10bd_0e34 = {
+ 0x0e34, pci_device_10bd_0e34,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10bd_0e34,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10c3_1100 = {
+ 0x1100, pci_device_10c3_1100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c3_1100,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_10c8_0001 = {
+ 0x0001, pci_device_10c8_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_0002 = {
+ 0x0002, pci_device_10c8_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_0003 = {
+ 0x0003, pci_device_10c8_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_0004 = {
+ 0x0004, pci_device_10c8_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_0005 = {
+ 0x0005, pci_device_10c8_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_0006 = {
+ 0x0006, pci_device_10c8_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_0016 = {
+ 0x0016, pci_device_10c8_0016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_0025 = {
+ 0x0025, pci_device_10c8_0025,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0025,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_0083 = {
+ 0x0083, pci_device_10c8_0083,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_0083,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_8005 = {
+ 0x8005, pci_device_10c8_8005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_8005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_8006 = {
+ 0x8006, pci_device_10c8_8006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_8006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10c8_8016 = {
+ 0x8016, pci_device_10c8_8016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10c8_8016,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10cd_1100 = {
+ 0x1100, pci_device_10cd_1100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10cd_1100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10cd_1200 = {
+ 0x1200, pci_device_10cd_1200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10cd_1200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10cd_1300 = {
+ 0x1300, pci_device_10cd_1300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10cd_1300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10cd_2300 = {
+ 0x2300, pci_device_10cd_2300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10cd_2300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10cd_2500 = {
+ 0x2500, pci_device_10cd_2500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10cd_2500,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10cf_2001 = {
+ 0x2001, pci_device_10cf_2001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10cf_2001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10d9_0512 = {
+ 0x0512, pci_device_10d9_0512,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10d9_0512,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10d9_0531 = {
+ 0x0531, pci_device_10d9_0531,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10d9_0531,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10d9_8625 = {
+ 0x8625, pci_device_10d9_8625,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10d9_8625,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10d9_8888 = {
+ 0x8888, pci_device_10d9_8888,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10d9_8888,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10da_0508 = {
+ 0x0508, pci_device_10da_0508,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10da_0508,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10da_3390 = {
+ 0x3390, pci_device_10da_3390,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10da_3390,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10dc_0001 = {
+ 0x0001, pci_device_10dc_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10dc_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10dc_0002 = {
+ 0x0002, pci_device_10dc_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10dc_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10dc_0021 = {
+ 0x0021, pci_device_10dc_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10dc_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10dc_0022 = {
+ 0x0022, pci_device_10dc_0022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10dc_0022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10dc_10dc = {
+ 0x10dc, pci_device_10dc_10dc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10dc_10dc,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_10de_0008 = {
+ 0x0008, pci_device_10de_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0009 = {
+ 0x0009, pci_device_10de_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0010 = {
+ 0x0010, pci_device_10de_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0020 = {
+ 0x0020, pci_device_10de_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0028 = {
+ 0x0028, pci_device_10de_0028,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0028,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0029 = {
+ 0x0029, pci_device_10de_0029,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0029,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_002a = {
+ 0x002a, pci_device_10de_002a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_002a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_002b = {
+ 0x002b, pci_device_10de_002b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_002b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_002c = {
+ 0x002c, pci_device_10de_002c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_002c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_002d = {
+ 0x002d, pci_device_10de_002d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_002d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_002e = {
+ 0x002e, pci_device_10de_002e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_002e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_002f = {
+ 0x002f, pci_device_10de_002f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_002f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0060 = {
+ 0x0060, pci_device_10de_0060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0064 = {
+ 0x0064, pci_device_10de_0064,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0064,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0065 = {
+ 0x0065, pci_device_10de_0065,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0065,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0066 = {
+ 0x0066, pci_device_10de_0066,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0066,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0067 = {
+ 0x0067, pci_device_10de_0067,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0067,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0068 = {
+ 0x0068, pci_device_10de_0068,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0068,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_006a = {
+ 0x006a, pci_device_10de_006a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_006a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_006b = {
+ 0x006b, pci_device_10de_006b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_006b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_006e = {
+ 0x006e, pci_device_10de_006e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_006e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_00a0 = {
+ 0x00a0, pci_device_10de_00a0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_00a0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0100 = {
+ 0x0100, pci_device_10de_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0101 = {
+ 0x0101, pci_device_10de_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0103 = {
+ 0x0103, pci_device_10de_0103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0110 = {
+ 0x0110, pci_device_10de_0110,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0110,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0111 = {
+ 0x0111, pci_device_10de_0111,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0111,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0112 = {
+ 0x0112, pci_device_10de_0112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0112,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0113 = {
+ 0x0113, pci_device_10de_0113,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0113,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0150 = {
+ 0x0150, pci_device_10de_0150,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0150,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0151 = {
+ 0x0151, pci_device_10de_0151,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0151,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0152 = {
+ 0x0152, pci_device_10de_0152,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0152,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0153 = {
+ 0x0153, pci_device_10de_0153,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0153,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0170 = {
+ 0x0170, pci_device_10de_0170,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0170,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0171 = {
+ 0x0171, pci_device_10de_0171,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0171,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0172 = {
+ 0x0172, pci_device_10de_0172,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0172,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0173 = {
+ 0x0173, pci_device_10de_0173,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0173,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0174 = {
+ 0x0174, pci_device_10de_0174,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0174,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0175 = {
+ 0x0175, pci_device_10de_0175,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0175,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0176 = {
+ 0x0176, pci_device_10de_0176,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0176,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0178 = {
+ 0x0178, pci_device_10de_0178,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0178,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0179 = {
+ 0x0179, pci_device_10de_0179,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0179,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_017a = {
+ 0x017a, pci_device_10de_017a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_017a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_017b = {
+ 0x017b, pci_device_10de_017b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_017b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_017c = {
+ 0x017c, pci_device_10de_017c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_017c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0181 = {
+ 0x0181, pci_device_10de_0181,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0181,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0182 = {
+ 0x0182, pci_device_10de_0182,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0182,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0183 = {
+ 0x0183, pci_device_10de_0183,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0183,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0188 = {
+ 0x0188, pci_device_10de_0188,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0188,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_018a = {
+ 0x018a, pci_device_10de_018a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_018a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_018b = {
+ 0x018b, pci_device_10de_018b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_018b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01a0 = {
+ 0x01a0, pci_device_10de_01a0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01a0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01a4 = {
+ 0x01a4, pci_device_10de_01a4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01a4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01ab = {
+ 0x01ab, pci_device_10de_01ab,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01ab,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01ac = {
+ 0x01ac, pci_device_10de_01ac,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01ac,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01ad = {
+ 0x01ad, pci_device_10de_01ad,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01ad,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01b1 = {
+ 0x01b1, pci_device_10de_01b1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01b1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01b2 = {
+ 0x01b2, pci_device_10de_01b2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01b2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01b4 = {
+ 0x01b4, pci_device_10de_01b4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01b4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01b7 = {
+ 0x01b7, pci_device_10de_01b7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01b7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01b8 = {
+ 0x01b8, pci_device_10de_01b8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01b8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01bc = {
+ 0x01bc, pci_device_10de_01bc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01bc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01c1 = {
+ 0x01c1, pci_device_10de_01c1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01c1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01c2 = {
+ 0x01c2, pci_device_10de_01c2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01c2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01c3 = {
+ 0x01c3, pci_device_10de_01c3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01c3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01e8 = {
+ 0x01e8, pci_device_10de_01e8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01e8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_01f0 = {
+ 0x01f0, pci_device_10de_01f0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_01f0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0200 = {
+ 0x0200, pci_device_10de_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0201 = {
+ 0x0201, pci_device_10de_0201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0202 = {
+ 0x0202, pci_device_10de_0202,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0202,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0203 = {
+ 0x0203, pci_device_10de_0203,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0203,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0250 = {
+ 0x0250, pci_device_10de_0250,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0250,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0251 = {
+ 0x0251, pci_device_10de_0251,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0251,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0252 = {
+ 0x0252, pci_device_10de_0252,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0252,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0253 = {
+ 0x0253, pci_device_10de_0253,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0253,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0258 = {
+ 0x0258, pci_device_10de_0258,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0258,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0259 = {
+ 0x0259, pci_device_10de_0259,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0259,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_025b = {
+ 0x025b, pci_device_10de_025b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_025b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0280 = {
+ 0x0280, pci_device_10de_0280,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0280,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0281 = {
+ 0x0281, pci_device_10de_0281,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0281,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0282 = {
+ 0x0282, pci_device_10de_0282,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0282,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0288 = {
+ 0x0288, pci_device_10de_0288,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0288,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0289 = {
+ 0x0289, pci_device_10de_0289,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0289,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0300 = {
+ 0x0300, pci_device_10de_0300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0301 = {
+ 0x0301, pci_device_10de_0301,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0301,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0302 = {
+ 0x0302, pci_device_10de_0302,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0302,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0308 = {
+ 0x0308, pci_device_10de_0308,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0308,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10de_0309 = {
+ 0x0309, pci_device_10de_0309,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10de_0309,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10df_1ae5 = {
+ 0x1ae5, pci_device_10df_1ae5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10df_1ae5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10df_f085 = {
+ 0xf085, pci_device_10df_f085,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10df_f085,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10df_f095 = {
+ 0xf095, pci_device_10df_f095,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10df_f095,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10df_f098 = {
+ 0xf098, pci_device_10df_f098,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10df_f098,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10df_f700 = {
+ 0xf700, pci_device_10df_f700,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10df_f700,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10df_f800 = {
+ 0xf800, pci_device_10df_f800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10df_f800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10df_f900 = {
+ 0xf900, pci_device_10df_f900,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10df_f900,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10df_f980 = {
+ 0xf980, pci_device_10df_f980,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10df_f980,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_10e0_5026 = {
+ 0x5026, pci_device_10e0_5026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e0_5026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e0_5027 = {
+ 0x5027, pci_device_10e0_5027,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e0_5027,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e0_5028 = {
+ 0x5028, pci_device_10e0_5028,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e0_5028,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e0_8849 = {
+ 0x8849, pci_device_10e0_8849,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e0_8849,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e0_8853 = {
+ 0x8853, pci_device_10e0_8853,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e0_8853,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e0_9128 = {
+ 0x9128, pci_device_10e0_9128,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e0_9128,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10e1_0391 = {
+ 0x0391, pci_device_10e1_0391,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e1_0391,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e1_690c = {
+ 0x690c, pci_device_10e1_690c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e1_690c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e1_dc29 = {
+ 0xdc29, pci_device_10e1_dc29,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e1_dc29,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10e3_0000 = {
+ 0x0000, pci_device_10e3_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e3_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e3_0860 = {
+ 0x0860, pci_device_10e3_0860,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e3_0860,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e3_0862 = {
+ 0x0862, pci_device_10e3_0862,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e3_0862,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10e8_2011 = {
+ 0x2011, pci_device_10e8_2011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_2011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_4750 = {
+ 0x4750, pci_device_10e8_4750,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_4750,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_5920 = {
+ 0x5920, pci_device_10e8_5920,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_5920,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_8043 = {
+ 0x8043, pci_device_10e8_8043,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_8043,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_8062 = {
+ 0x8062, pci_device_10e8_8062,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_8062,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_807d = {
+ 0x807d, pci_device_10e8_807d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_807d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_8088 = {
+ 0x8088, pci_device_10e8_8088,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_8088,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_8089 = {
+ 0x8089, pci_device_10e8_8089,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_8089,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_809c = {
+ 0x809c, pci_device_10e8_809c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_809c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_80d7 = {
+ 0x80d7, pci_device_10e8_80d7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_80d7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_80d9 = {
+ 0x80d9, pci_device_10e8_80d9,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_80d9,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_80da = {
+ 0x80da, pci_device_10e8_80da,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_80da,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_811a = {
+ 0x811a, pci_device_10e8_811a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_811a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_8170 = {
+ 0x8170, pci_device_10e8_8170,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_8170,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10e8_82db = {
+ 0x82db, pci_device_10e8_82db,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10e8_82db,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_10ea_1680 = {
+ 0x1680, pci_device_10ea_1680,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ea_1680,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ea_1682 = {
+ 0x1682, pci_device_10ea_1682,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ea_1682,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ea_1683 = {
+ 0x1683, pci_device_10ea_1683,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ea_1683,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ea_2000 = {
+ 0x2000, pci_device_10ea_2000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ea_2000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ea_2010 = {
+ 0x2010, pci_device_10ea_2010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ea_2010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ea_5000 = {
+ 0x5000, pci_device_10ea_5000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ea_5000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ea_5050 = {
+ 0x5050, pci_device_10ea_5050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ea_5050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ea_5202 = {
+ 0x5202, pci_device_10ea_5202,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ea_5202,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10eb_0101 = {
+ 0x0101, pci_device_10eb_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10eb_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10eb_8111 = {
+ 0x8111, pci_device_10eb_8111,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10eb_8111,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10ec_8029 = {
+ 0x8029, pci_device_10ec_8029,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ec_8029,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ec_8129 = {
+ 0x8129, pci_device_10ec_8129,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ec_8129,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ec_8138 = {
+ 0x8138, pci_device_10ec_8138,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ec_8138,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ec_8139 = {
+ 0x8139, pci_device_10ec_8139,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ec_8139,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ec_8169 = {
+ 0x8169, pci_device_10ec_8169,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ec_8169,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ec_8197 = {
+ 0x8197, pci_device_10ec_8197,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ec_8197,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10ed_7310 = {
+ 0x7310, pci_device_10ed_7310,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ed_7310,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10ee_3fc0 = {
+ 0x3fc0, pci_device_10ee_3fc0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ee_3fc0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ee_3fc1 = {
+ 0x3fc1, pci_device_10ee_3fc1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ee_3fc1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ee_3fc2 = {
+ 0x3fc2, pci_device_10ee_3fc2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ee_3fc2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ee_3fc3 = {
+ 0x3fc3, pci_device_10ee_3fc3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ee_3fc3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ee_3fc4 = {
+ 0x3fc4, pci_device_10ee_3fc4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ee_3fc4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10ee_3fc5 = {
+ 0x3fc5, pci_device_10ee_3fc5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ee_3fc5,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10ef_8154 = {
+ 0x8154, pci_device_10ef_8154,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10ef_8154,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10f5_a001 = {
+ 0xa001, pci_device_10f5_a001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10f5_a001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10fa_000c = {
+ 0x000c, pci_device_10fa_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10fa_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10fb_186f = {
+ 0x186f, pci_device_10fb_186f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10fb_186f,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_10fc_0003 = {
+ 0x0003, pci_device_10fc_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10fc_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_10fc_0005 = {
+ 0x0005, pci_device_10fc_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_10fc_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1101_1060 = {
+ 0x1060, pci_device_1101_1060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1101_1060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1101_9100 = {
+ 0x9100, pci_device_1101_9100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1101_9100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1101_9400 = {
+ 0x9400, pci_device_1101_9400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1101_9400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1101_9401 = {
+ 0x9401, pci_device_1101_9401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1101_9401,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1101_9500 = {
+ 0x9500, pci_device_1101_9500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1101_9500,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1102_0002 = {
+ 0x0002, pci_device_1102_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_0002,
+#else
+ NULL,
+#endif
+ 0x0401
+};
+static const pciDeviceInfo pci_dev_info_1102_0004 = {
+ 0x0004, pci_device_1102_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1102_0006 = {
+ 0x0006, pci_device_1102_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1102_4001 = {
+ 0x4001, pci_device_1102_4001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_4001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1102_7002 = {
+ 0x7002, pci_device_1102_7002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_7002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1102_7003 = {
+ 0x7003, pci_device_1102_7003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_7003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1102_7004 = {
+ 0x7004, pci_device_1102_7004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_7004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1102_8064 = {
+ 0x8064, pci_device_1102_8064,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_8064,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1102_8938 = {
+ 0x8938, pci_device_1102_8938,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1102_8938,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1103_0003 = {
+ 0x0003, pci_device_1103_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1103_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1103_0004 = {
+ 0x0004, pci_device_1103_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1103_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1103_0005 = {
+ 0x0005, pci_device_1103_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1103_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1103_0006 = {
+ 0x0006, pci_device_1103_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1103_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1103_0007 = {
+ 0x0007, pci_device_1103_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1103_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1103_0008 = {
+ 0x0008, pci_device_1103_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1103_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1105_1105 = {
+ 0x1105, pci_device_1105_1105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1105_1105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1105_8300 = {
+ 0x8300, pci_device_1105_8300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1105_8300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1105_8400 = {
+ 0x8400, pci_device_1105_8400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1105_8400,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1106_0102 = {
+ 0x0102, pci_device_1106_0102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0130 = {
+ 0x0130, pci_device_1106_0130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0130,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0305 = {
+ 0x0305, pci_device_1106_0305,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0305,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0391 = {
+ 0x0391, pci_device_1106_0391,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0391,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0501 = {
+ 0x0501, pci_device_1106_0501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0501,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0505 = {
+ 0x0505, pci_device_1106_0505,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0505,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0561 = {
+ 0x0561, pci_device_1106_0561,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0561,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0571 = {
+ 0x0571, pci_device_1106_0571,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0571,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0576 = {
+ 0x0576, pci_device_1106_0576,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0576,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0585 = {
+ 0x0585, pci_device_1106_0585,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0585,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0586 = {
+ 0x0586, pci_device_1106_0586,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0586,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0595 = {
+ 0x0595, pci_device_1106_0595,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0595,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0596 = {
+ 0x0596, pci_device_1106_0596,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0596,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0597 = {
+ 0x0597, pci_device_1106_0597,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0597,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0598 = {
+ 0x0598, pci_device_1106_0598,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0598,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0601 = {
+ 0x0601, pci_device_1106_0601,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0601,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0605 = {
+ 0x0605, pci_device_1106_0605,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0605,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0680 = {
+ 0x0680, pci_device_1106_0680,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0680,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0686 = {
+ 0x0686, pci_device_1106_0686,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0686,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0691 = {
+ 0x0691, pci_device_1106_0691,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0691,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0693 = {
+ 0x0693, pci_device_1106_0693,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0693,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0698 = {
+ 0x0698, pci_device_1106_0698,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0698,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_0926 = {
+ 0x0926, pci_device_1106_0926,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_0926,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_1000 = {
+ 0x1000, pci_device_1106_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_1106 = {
+ 0x1106, pci_device_1106_1106,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_1106,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_1571 = {
+ 0x1571, pci_device_1106_1571,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_1571,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_1595 = {
+ 0x1595, pci_device_1106_1595,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_1595,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3038 = {
+ 0x3038, pci_device_1106_3038,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3038,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3040 = {
+ 0x3040, pci_device_1106_3040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3043 = {
+ 0x3043, pci_device_1106_3043,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3043,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3044 = {
+ 0x3044, pci_device_1106_3044,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3044,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3050 = {
+ 0x3050, pci_device_1106_3050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3051 = {
+ 0x3051, pci_device_1106_3051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3051,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3057 = {
+ 0x3057, pci_device_1106_3057,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3057,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3058 = {
+ 0x3058, pci_device_1106_3058,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3058,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3059 = {
+ 0x3059, pci_device_1106_3059,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3059,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3065 = {
+ 0x3065, pci_device_1106_3065,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3065,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3068 = {
+ 0x3068, pci_device_1106_3068,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3068,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3074 = {
+ 0x3074, pci_device_1106_3074,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3074,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3091 = {
+ 0x3091, pci_device_1106_3091,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3091,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3099 = {
+ 0x3099, pci_device_1106_3099,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3099,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3101 = {
+ 0x3101, pci_device_1106_3101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3102 = {
+ 0x3102, pci_device_1106_3102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3103 = {
+ 0x3103, pci_device_1106_3103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3104 = {
+ 0x3104, pci_device_1106_3104,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3104,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3106 = {
+ 0x3106, pci_device_1106_3106,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3106,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3109 = {
+ 0x3109, pci_device_1106_3109,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3109,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3112 = {
+ 0x3112, pci_device_1106_3112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3112,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3116 = {
+ 0x3116, pci_device_1106_3116,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3116,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3122 = {
+ 0x3122, pci_device_1106_3122,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3122,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3123 = {
+ 0x3123, pci_device_1106_3123,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3123,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3128 = {
+ 0x3128, pci_device_1106_3128,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3128,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3133 = {
+ 0x3133, pci_device_1106_3133,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3133,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3147 = {
+ 0x3147, pci_device_1106_3147,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3147,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3148 = {
+ 0x3148, pci_device_1106_3148,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3148,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3156 = {
+ 0x3156, pci_device_1106_3156,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3156,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3168 = {
+ 0x3168, pci_device_1106_3168,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3168,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3177 = {
+ 0x3177, pci_device_1106_3177,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3177,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_3189 = {
+ 0x3189, pci_device_1106_3189,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_3189,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_5030 = {
+ 0x5030, pci_device_1106_5030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_5030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_6100 = {
+ 0x6100, pci_device_1106_6100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_6100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8231 = {
+ 0x8231, pci_device_1106_8231,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8231,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8235 = {
+ 0x8235, pci_device_1106_8235,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8235,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8305 = {
+ 0x8305, pci_device_1106_8305,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8305,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8391 = {
+ 0x8391, pci_device_1106_8391,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8391,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8501 = {
+ 0x8501, pci_device_1106_8501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8501,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8596 = {
+ 0x8596, pci_device_1106_8596,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8596,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8597 = {
+ 0x8597, pci_device_1106_8597,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8597,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8598 = {
+ 0x8598, pci_device_1106_8598,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8598,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8601 = {
+ 0x8601, pci_device_1106_8601,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8601,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8605 = {
+ 0x8605, pci_device_1106_8605,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8605,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8691 = {
+ 0x8691, pci_device_1106_8691,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8691,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_8693 = {
+ 0x8693, pci_device_1106_8693,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_8693,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_b091 = {
+ 0xb091, pci_device_1106_b091,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_b091,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_b099 = {
+ 0xb099, pci_device_1106_b099,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_b099,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_b101 = {
+ 0xb101, pci_device_1106_b101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_b101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_b102 = {
+ 0xb102, pci_device_1106_b102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_b102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_b103 = {
+ 0xb103, pci_device_1106_b103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_b103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_b112 = {
+ 0xb112, pci_device_1106_b112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_b112,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1106_b168 = {
+ 0xb168, pci_device_1106_b168,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1106_b168,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1107_0576 = {
+ 0x0576, pci_device_1107_0576,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1107_0576,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1108_0100 = {
+ 0x0100, pci_device_1108_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1108_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1108_0101 = {
+ 0x0101, pci_device_1108_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1108_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1108_0105 = {
+ 0x0105, pci_device_1108_0105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1108_0105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1108_0108 = {
+ 0x0108, pci_device_1108_0108,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1108_0108,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1108_0138 = {
+ 0x0138, pci_device_1108_0138,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1108_0138,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1108_0139 = {
+ 0x0139, pci_device_1108_0139,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1108_0139,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1108_013c = {
+ 0x013c, pci_device_1108_013c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1108_013c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1108_013d = {
+ 0x013d, pci_device_1108_013d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1108_013d,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1109_1400 = {
+ 0x1400, pci_device_1109_1400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1109_1400,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_110a_0002 = {
+ 0x0002, pci_device_110a_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_0005 = {
+ 0x0005, pci_device_110a_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_2102 = {
+ 0x2102, pci_device_110a_2102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_2102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_4942 = {
+ 0x4942, pci_device_110a_4942,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_4942,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110a_6120 = {
+ 0x6120, pci_device_110a_6120,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110a_6120,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_110b_0001 = {
+ 0x0001, pci_device_110b_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110b_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_110b_0004 = {
+ 0x0004, pci_device_110b_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_110b_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1110_6037 = {
+ 0x6037, pci_device_1110_6037,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1110_6037,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1110_6073 = {
+ 0x6073, pci_device_1110_6073,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1110_6073,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1112_2200 = {
+ 0x2200, pci_device_1112_2200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1112_2200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1112_2300 = {
+ 0x2300, pci_device_1112_2300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1112_2300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1112_2340 = {
+ 0x2340, pci_device_1112_2340,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1112_2340,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1112_2400 = {
+ 0x2400, pci_device_1112_2400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1112_2400,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1113_1211 = {
+ 0x1211, pci_device_1113_1211,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1113_1211,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1113_1216 = {
+ 0x1216, pci_device_1113_1216,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1113_1216,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1113_1217 = {
+ 0x1217, pci_device_1113_1217,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1113_1217,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1113_5105 = {
+ 0x5105, pci_device_1113_5105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1113_5105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1113_9211 = {
+ 0x9211, pci_device_1113_9211,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1113_9211,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1113_9511 = {
+ 0x9511, pci_device_1113_9511,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1113_9511,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1116_0022 = {
+ 0x0022, pci_device_1116_0022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1116_0022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1116_0023 = {
+ 0x0023, pci_device_1116_0023,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1116_0023,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1116_0024 = {
+ 0x0024, pci_device_1116_0024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1116_0024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1116_0025 = {
+ 0x0025, pci_device_1116_0025,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1116_0025,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1116_0026 = {
+ 0x0026, pci_device_1116_0026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1116_0026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1116_0027 = {
+ 0x0027, pci_device_1116_0027,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1116_0027,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1116_0028 = {
+ 0x0028, pci_device_1116_0028,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1116_0028,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1117_9500 = {
+ 0x9500, pci_device_1117_9500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1117_9500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1117_9501 = {
+ 0x9501, pci_device_1117_9501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1117_9501,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1119_0000 = {
+ 0x0000, pci_device_1119_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0001 = {
+ 0x0001, pci_device_1119_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0002 = {
+ 0x0002, pci_device_1119_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0003 = {
+ 0x0003, pci_device_1119_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0004 = {
+ 0x0004, pci_device_1119_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0005 = {
+ 0x0005, pci_device_1119_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0006 = {
+ 0x0006, pci_device_1119_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0007 = {
+ 0x0007, pci_device_1119_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0008 = {
+ 0x0008, pci_device_1119_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0009 = {
+ 0x0009, pci_device_1119_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_000a = {
+ 0x000a, pci_device_1119_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_000b = {
+ 0x000b, pci_device_1119_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_000c = {
+ 0x000c, pci_device_1119_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_000d = {
+ 0x000d, pci_device_1119_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_000d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0100 = {
+ 0x0100, pci_device_1119_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0101 = {
+ 0x0101, pci_device_1119_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0102 = {
+ 0x0102, pci_device_1119_0102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0103 = {
+ 0x0103, pci_device_1119_0103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0104 = {
+ 0x0104, pci_device_1119_0104,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0104,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0105 = {
+ 0x0105, pci_device_1119_0105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0110 = {
+ 0x0110, pci_device_1119_0110,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0110,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0111 = {
+ 0x0111, pci_device_1119_0111,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0111,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0112 = {
+ 0x0112, pci_device_1119_0112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0112,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0113 = {
+ 0x0113, pci_device_1119_0113,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0113,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0114 = {
+ 0x0114, pci_device_1119_0114,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0114,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0115 = {
+ 0x0115, pci_device_1119_0115,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0115,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0118 = {
+ 0x0118, pci_device_1119_0118,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0118,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0119 = {
+ 0x0119, pci_device_1119_0119,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0119,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_011a = {
+ 0x011a, pci_device_1119_011a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_011a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_011b = {
+ 0x011b, pci_device_1119_011b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_011b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0120 = {
+ 0x0120, pci_device_1119_0120,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0120,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0121 = {
+ 0x0121, pci_device_1119_0121,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0121,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0122 = {
+ 0x0122, pci_device_1119_0122,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0122,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0123 = {
+ 0x0123, pci_device_1119_0123,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0123,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0124 = {
+ 0x0124, pci_device_1119_0124,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0124,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0125 = {
+ 0x0125, pci_device_1119_0125,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0125,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0136 = {
+ 0x0136, pci_device_1119_0136,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0136,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0137 = {
+ 0x0137, pci_device_1119_0137,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0137,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0138 = {
+ 0x0138, pci_device_1119_0138,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0138,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0139 = {
+ 0x0139, pci_device_1119_0139,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0139,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_013a = {
+ 0x013a, pci_device_1119_013a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_013a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_013b = {
+ 0x013b, pci_device_1119_013b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_013b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_013c = {
+ 0x013c, pci_device_1119_013c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_013c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_013d = {
+ 0x013d, pci_device_1119_013d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_013d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_013e = {
+ 0x013e, pci_device_1119_013e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_013e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_013f = {
+ 0x013f, pci_device_1119_013f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_013f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0166 = {
+ 0x0166, pci_device_1119_0166,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0166,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0167 = {
+ 0x0167, pci_device_1119_0167,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0167,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0168 = {
+ 0x0168, pci_device_1119_0168,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0168,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0169 = {
+ 0x0169, pci_device_1119_0169,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0169,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_016a = {
+ 0x016a, pci_device_1119_016a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_016a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_016b = {
+ 0x016b, pci_device_1119_016b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_016b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_016c = {
+ 0x016c, pci_device_1119_016c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_016c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_016d = {
+ 0x016d, pci_device_1119_016d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_016d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_016e = {
+ 0x016e, pci_device_1119_016e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_016e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_016f = {
+ 0x016f, pci_device_1119_016f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_016f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_01d6 = {
+ 0x01d6, pci_device_1119_01d6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_01d6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_01d7 = {
+ 0x01d7, pci_device_1119_01d7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_01d7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_01f6 = {
+ 0x01f6, pci_device_1119_01f6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_01f6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_01f7 = {
+ 0x01f7, pci_device_1119_01f7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_01f7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_01fc = {
+ 0x01fc, pci_device_1119_01fc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_01fc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_01fd = {
+ 0x01fd, pci_device_1119_01fd,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_01fd,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_01fe = {
+ 0x01fe, pci_device_1119_01fe,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_01fe,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_01ff = {
+ 0x01ff, pci_device_1119_01ff,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_01ff,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0210 = {
+ 0x0210, pci_device_1119_0210,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0210,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0211 = {
+ 0x0211, pci_device_1119_0211,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0211,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0260 = {
+ 0x0260, pci_device_1119_0260,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0260,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0261 = {
+ 0x0261, pci_device_1119_0261,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0261,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1119_0300 = {
+ 0x0300, pci_device_1119_0300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1119_0300,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_111a_0000 = {
+ 0x0000, pci_device_111a_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111a_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_111a_0002 = {
+ 0x0002, pci_device_111a_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111a_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_111a_0003 = {
+ 0x0003, pci_device_111a_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111a_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_111a_0005 = {
+ 0x0005, pci_device_111a_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111a_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_111a_0007 = {
+ 0x0007, pci_device_111a_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111a_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_111c_0001 = {
+ 0x0001, pci_device_111c_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111c_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_111d_0001 = {
+ 0x0001, pci_device_111d_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111d_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_111d_0003 = {
+ 0x0003, pci_device_111d_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111d_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_111f_4a47 = {
+ 0x4a47, pci_device_111f_4a47,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111f_4a47,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_111f_5243 = {
+ 0x5243, pci_device_111f_5243,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_111f_5243,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1127_0200 = {
+ 0x0200, pci_device_1127_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1127_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1127_0210 = {
+ 0x0210, pci_device_1127_0210,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1127_0210,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1127_0250 = {
+ 0x0250, pci_device_1127_0250,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1127_0250,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1127_0300 = {
+ 0x0300, pci_device_1127_0300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1127_0300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1127_0310 = {
+ 0x0310, pci_device_1127_0310,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1127_0310,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1127_0400 = {
+ 0x0400, pci_device_1127_0400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1127_0400,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_112f_0000 = {
+ 0x0000, pci_device_112f_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_112f_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_112f_0001 = {
+ 0x0001, pci_device_112f_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_112f_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1131_1561 = {
+ 0x1561, pci_device_1131_1561,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_1561,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1131_1562 = {
+ 0x1562, pci_device_1131_1562,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_1562,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1131_3400 = {
+ 0x3400, pci_device_1131_3400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_3400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1131_7130 = {
+ 0x7130, pci_device_1131_7130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_7130,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1131_7133 = {
+ 0x7133, pci_device_1131_7133,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_7133,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1131_7134 = {
+ 0x7134, pci_device_1131_7134,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_7134,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1131_7135 = {
+ 0x7135, pci_device_1131_7135,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_7135,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1131_7145 = {
+ 0x7145, pci_device_1131_7145,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_7145,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1131_7146 = {
+ 0x7146, pci_device_1131_7146,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1131_7146,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1133_7901 = {
+ 0x7901, pci_device_1133_7901,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_7901,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_7902 = {
+ 0x7902, pci_device_1133_7902,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_7902,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_7911 = {
+ 0x7911, pci_device_1133_7911,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_7911,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_7912 = {
+ 0x7912, pci_device_1133_7912,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_7912,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_7941 = {
+ 0x7941, pci_device_1133_7941,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_7941,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_7942 = {
+ 0x7942, pci_device_1133_7942,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_7942,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_7943 = {
+ 0x7943, pci_device_1133_7943,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_7943,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_7944 = {
+ 0x7944, pci_device_1133_7944,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_7944,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_b921 = {
+ 0xb921, pci_device_1133_b921,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_b921,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_b922 = {
+ 0xb922, pci_device_1133_b922,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_b922,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_b923 = {
+ 0xb923, pci_device_1133_b923,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_b923,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e001 = {
+ 0xe001, pci_device_1133_e001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e002 = {
+ 0xe002, pci_device_1133_e002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e003 = {
+ 0xe003, pci_device_1133_e003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e004 = {
+ 0xe004, pci_device_1133_e004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e005 = {
+ 0xe005, pci_device_1133_e005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e00b = {
+ 0xe00b, pci_device_1133_e00b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e00b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e010 = {
+ 0xe010, pci_device_1133_e010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e012 = {
+ 0xe012, pci_device_1133_e012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e014 = {
+ 0xe014, pci_device_1133_e014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1133_e018 = {
+ 0xe018, pci_device_1133_e018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1133_e018,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1134_0001 = {
+ 0x0001, pci_device_1134_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1134_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1135_0001 = {
+ 0x0001, pci_device_1135_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1135_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1138_8905 = {
+ 0x8905, pci_device_1138_8905,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1138_8905,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1139_0001 = {
+ 0x0001, pci_device_1139_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1139_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_113c_0000 = {
+ 0x0000, pci_device_113c_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113c_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113c_0001 = {
+ 0x0001, pci_device_113c_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113c_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113c_0911 = {
+ 0x0911, pci_device_113c_0911,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113c_0911,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113c_0912 = {
+ 0x0912, pci_device_113c_0912,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113c_0912,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113c_0913 = {
+ 0x0913, pci_device_113c_0913,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113c_0913,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113c_0914 = {
+ 0x0914, pci_device_113c_0914,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113c_0914,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_113f_0808 = {
+ 0x0808, pci_device_113f_0808,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113f_0808,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113f_1010 = {
+ 0x1010, pci_device_113f_1010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113f_1010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113f_80c0 = {
+ 0x80c0, pci_device_113f_80c0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113f_80c0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113f_80c4 = {
+ 0x80c4, pci_device_113f_80c4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113f_80c4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113f_80c8 = {
+ 0x80c8, pci_device_113f_80c8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113f_80c8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113f_8888 = {
+ 0x8888, pci_device_113f_8888,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113f_8888,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_113f_9090 = {
+ 0x9090, pci_device_113f_9090,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_113f_9090,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1142_3210 = {
+ 0x3210, pci_device_1142_3210,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1142_3210,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1142_6422 = {
+ 0x6422, pci_device_1142_6422,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1142_6422,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1142_6424 = {
+ 0x6424, pci_device_1142_6424,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1142_6424,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1142_6425 = {
+ 0x6425, pci_device_1142_6425,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1142_6425,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1142_643d = {
+ 0x643d, pci_device_1142_643d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1142_643d,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1144_0001 = {
+ 0x0001, pci_device_1144_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1144_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1145_8007 = {
+ 0x8007, pci_device_1145_8007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1145_8007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1145_f007 = {
+ 0xf007, pci_device_1145_f007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1145_f007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1145_f010 = {
+ 0xf010, pci_device_1145_f010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1145_f010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1145_f012 = {
+ 0xf012, pci_device_1145_f012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1145_f012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1145_f013 = {
+ 0xf013, pci_device_1145_f013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1145_f013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1145_f015 = {
+ 0xf015, pci_device_1145_f015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1145_f015,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1148_4000 = {
+ 0x4000, pci_device_1148_4000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1148_4000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1148_4200 = {
+ 0x4200, pci_device_1148_4200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1148_4200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1148_4300 = {
+ 0x4300, pci_device_1148_4300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1148_4300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1148_4320 = {
+ 0x4320, pci_device_1148_4320,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1148_4320,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1148_4400 = {
+ 0x4400, pci_device_1148_4400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1148_4400,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_114a_5579 = {
+ 0x5579, pci_device_114a_5579,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114a_5579,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114a_5587 = {
+ 0x5587, pci_device_114a_5587,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114a_5587,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114a_6504 = {
+ 0x6504, pci_device_114a_6504,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114a_6504,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114a_7587 = {
+ 0x7587, pci_device_114a_7587,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114a_7587,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_114f_0002 = {
+ 0x0002, pci_device_114f_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0003 = {
+ 0x0003, pci_device_114f_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0004 = {
+ 0x0004, pci_device_114f_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0005 = {
+ 0x0005, pci_device_114f_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0006 = {
+ 0x0006, pci_device_114f_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0009 = {
+ 0x0009, pci_device_114f_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_000a = {
+ 0x000a, pci_device_114f_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_000c = {
+ 0x000c, pci_device_114f_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_000d = {
+ 0x000d, pci_device_114f_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_000d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0011 = {
+ 0x0011, pci_device_114f_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0012 = {
+ 0x0012, pci_device_114f_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0013 = {
+ 0x0013, pci_device_114f_0013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0014 = {
+ 0x0014, pci_device_114f_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0015 = {
+ 0x0015, pci_device_114f_0015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0015,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0016 = {
+ 0x0016, pci_device_114f_0016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0017 = {
+ 0x0017, pci_device_114f_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_001a = {
+ 0x001a, pci_device_114f_001a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_001a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_001b = {
+ 0x001b, pci_device_114f_001b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_001b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_001d = {
+ 0x001d, pci_device_114f_001d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_001d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0023 = {
+ 0x0023, pci_device_114f_0023,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0023,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0024 = {
+ 0x0024, pci_device_114f_0024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0026 = {
+ 0x0026, pci_device_114f_0026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0027 = {
+ 0x0027, pci_device_114f_0027,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0027,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0034 = {
+ 0x0034, pci_device_114f_0034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0035 = {
+ 0x0035, pci_device_114f_0035,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0035,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0040 = {
+ 0x0040, pci_device_114f_0040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0042 = {
+ 0x0042, pci_device_114f_0042,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0042,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0070 = {
+ 0x0070, pci_device_114f_0070,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0070,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0071 = {
+ 0x0071, pci_device_114f_0071,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0071,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0072 = {
+ 0x0072, pci_device_114f_0072,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0072,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_0073 = {
+ 0x0073, pci_device_114f_0073,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_0073,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_114f_6001 = {
+ 0x6001, pci_device_114f_6001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_114f_6001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1158_3011 = {
+ 0x3011, pci_device_1158_3011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1158_3011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1158_9050 = {
+ 0x9050, pci_device_1158_9050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1158_9050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1158_9051 = {
+ 0x9051, pci_device_1158_9051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1158_9051,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1159_0001 = {
+ 0x0001, pci_device_1159_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1159_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_115d_0003 = {
+ 0x0003, pci_device_115d_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_115d_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_115d_0005 = {
+ 0x0005, pci_device_115d_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_115d_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_115d_0007 = {
+ 0x0007, pci_device_115d_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_115d_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_115d_000b = {
+ 0x000b, pci_device_115d_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_115d_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_115d_000c = {
+ 0x000c, pci_device_115d_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_115d_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_115d_000f = {
+ 0x000f, pci_device_115d_000f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_115d_000f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_115d_0101 = {
+ 0x0101, pci_device_115d_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_115d_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_115d_0103 = {
+ 0x0103, pci_device_115d_0103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_115d_0103,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_1163_0001 = {
+ 0x0001, pci_device_1163_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1163_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1163_2000 = {
+ 0x2000, pci_device_1163_2000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1163_2000,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1165_0001 = {
+ 0x0001, pci_device_1165_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1165_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1166_0005 = {
+ 0x0005, pci_device_1166_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0007 = {
+ 0x0007, pci_device_1166_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0008 = {
+ 0x0008, pci_device_1166_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0009 = {
+ 0x0009, pci_device_1166_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0010 = {
+ 0x0010, pci_device_1166_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0011 = {
+ 0x0011, pci_device_1166_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0012 = {
+ 0x0012, pci_device_1166_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0013 = {
+ 0x0013, pci_device_1166_0013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0014 = {
+ 0x0014, pci_device_1166_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0015 = {
+ 0x0015, pci_device_1166_0015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0015,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0016 = {
+ 0x0016, pci_device_1166_0016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0017 = {
+ 0x0017, pci_device_1166_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0200 = {
+ 0x0200, pci_device_1166_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0201 = {
+ 0x0201, pci_device_1166_0201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0203 = {
+ 0x0203, pci_device_1166_0203,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0203,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0211 = {
+ 0x0211, pci_device_1166_0211,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0211,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0212 = {
+ 0x0212, pci_device_1166_0212,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0212,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0213 = {
+ 0x0213, pci_device_1166_0213,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0213,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0220 = {
+ 0x0220, pci_device_1166_0220,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0220,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0221 = {
+ 0x0221, pci_device_1166_0221,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0221,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0225 = {
+ 0x0225, pci_device_1166_0225,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0225,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1166_0227 = {
+ 0x0227, pci_device_1166_0227,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1166_0227,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_116a_6100 = {
+ 0x6100, pci_device_116a_6100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_116a_6100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_116a_6800 = {
+ 0x6800, pci_device_116a_6800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_116a_6800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_116a_7100 = {
+ 0x7100, pci_device_116a_7100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_116a_7100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_116a_7800 = {
+ 0x7800, pci_device_116a_7800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_116a_7800,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1178_afa1 = {
+ 0xafa1, pci_device_1178_afa1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1178_afa1,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1179_0103 = {
+ 0x0103, pci_device_1179_0103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0404 = {
+ 0x0404, pci_device_1179_0404,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0404,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0406 = {
+ 0x0406, pci_device_1179_0406,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0406,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0407 = {
+ 0x0407, pci_device_1179_0407,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0407,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0601 = {
+ 0x0601, pci_device_1179_0601,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0601,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0603 = {
+ 0x0603, pci_device_1179_0603,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0603,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_060a = {
+ 0x060a, pci_device_1179_060a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_060a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_060f = {
+ 0x060f, pci_device_1179_060f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_060f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0617 = {
+ 0x0617, pci_device_1179_0617,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0617,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0618 = {
+ 0x0618, pci_device_1179_0618,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0618,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0701 = {
+ 0x0701, pci_device_1179_0701,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0701,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0804 = {
+ 0x0804, pci_device_1179_0804,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0804,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0805 = {
+ 0x0805, pci_device_1179_0805,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0805,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1179_0d01 = {
+ 0x0d01, pci_device_1179_0d01,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1179_0d01,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1180_0465 = {
+ 0x0465, pci_device_1180_0465,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0465,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1180_0466 = {
+ 0x0466, pci_device_1180_0466,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0466,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1180_0475 = {
+ 0x0475, pci_device_1180_0475,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0475,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1180_0476 = {
+ 0x0476, pci_device_1180_0476,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0476,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1180_0477 = {
+ 0x0477, pci_device_1180_0477,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0477,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1180_0478 = {
+ 0x0478, pci_device_1180_0478,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0478,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1180_0522 = {
+ 0x0522, pci_device_1180_0522,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0522,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1180_0551 = {
+ 0x0551, pci_device_1180_0551,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0551,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1180_0552 = {
+ 0x0552, pci_device_1180_0552,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1180_0552,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1186_0100 = {
+ 0x0100, pci_device_1186_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1186_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1186_1002 = {
+ 0x1002, pci_device_1186_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1186_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1186_1300 = {
+ 0x1300, pci_device_1186_1300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1186_1300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1186_1340 = {
+ 0x1340, pci_device_1186_1340,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1186_1340,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1186_1561 = {
+ 0x1561, pci_device_1186_1561,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1186_1561,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1186_4000 = {
+ 0x4000, pci_device_1186_4000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1186_4000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_118c_0014 = {
+ 0x0014, pci_device_118c_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118c_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118c_1117 = {
+ 0x1117, pci_device_118c_1117,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118c_1117,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_118d_0001 = {
+ 0x0001, pci_device_118d_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0012 = {
+ 0x0012, pci_device_118d_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0014 = {
+ 0x0014, pci_device_118d_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0024 = {
+ 0x0024, pci_device_118d_0024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0044 = {
+ 0x0044, pci_device_118d_0044,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0044,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0112 = {
+ 0x0112, pci_device_118d_0112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0112,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0114 = {
+ 0x0114, pci_device_118d_0114,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0114,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0124 = {
+ 0x0124, pci_device_118d_0124,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0124,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0144 = {
+ 0x0144, pci_device_118d_0144,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0144,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0212 = {
+ 0x0212, pci_device_118d_0212,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0212,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0214 = {
+ 0x0214, pci_device_118d_0214,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0214,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0224 = {
+ 0x0224, pci_device_118d_0224,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0224,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0244 = {
+ 0x0244, pci_device_118d_0244,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0244,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0312 = {
+ 0x0312, pci_device_118d_0312,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0312,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0314 = {
+ 0x0314, pci_device_118d_0314,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0314,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0324 = {
+ 0x0324, pci_device_118d_0324,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0324,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_118d_0344 = {
+ 0x0344, pci_device_118d_0344,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_118d_0344,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1190_c731 = {
+ 0xc731, pci_device_1190_c731,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1190_c731,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1191_0003 = {
+ 0x0003, pci_device_1191_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_0004 = {
+ 0x0004, pci_device_1191_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_0005 = {
+ 0x0005, pci_device_1191_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_0006 = {
+ 0x0006, pci_device_1191_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_0007 = {
+ 0x0007, pci_device_1191_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_0008 = {
+ 0x0008, pci_device_1191_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_0009 = {
+ 0x0009, pci_device_1191_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_8002 = {
+ 0x8002, pci_device_1191_8002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_8002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_8010 = {
+ 0x8010, pci_device_1191_8010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_8010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_8020 = {
+ 0x8020, pci_device_1191_8020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_8020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_8030 = {
+ 0x8030, pci_device_1191_8030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_8030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_8040 = {
+ 0x8040, pci_device_1191_8040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_8040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1191_8050 = {
+ 0x8050, pci_device_1191_8050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1191_8050,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1193_0001 = {
+ 0x0001, pci_device_1193_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1193_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1193_0002 = {
+ 0x0002, pci_device_1193_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1193_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_119b_1221 = {
+ 0x1221, pci_device_119b_1221,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_119b_1221,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_119e_0001 = {
+ 0x0001, pci_device_119e_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_119e_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_119e_0003 = {
+ 0x0003, pci_device_119e_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_119e_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11a9_4240 = {
+ 0x4240, pci_device_11a9_4240,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11a9_4240,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11ab_0146 = {
+ 0x0146, pci_device_11ab_0146,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11ab_0146,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11ab_4611 = {
+ 0x4611, pci_device_11ab_4611,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11ab_4611,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11ab_4620 = {
+ 0x4620, pci_device_11ab_4620,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11ab_4620,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11ab_4801 = {
+ 0x4801, pci_device_11ab_4801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11ab_4801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11ab_f003 = {
+ 0xf003, pci_device_11ab_f003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11ab_f003,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11ad_0002 = {
+ 0x0002, pci_device_11ad_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11ad_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11ad_c115 = {
+ 0xc115, pci_device_11ad_c115,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11ad_c115,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11b0_0002 = {
+ 0x0002, pci_device_11b0_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11b0_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11b0_0292 = {
+ 0x0292, pci_device_11b0_0292,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11b0_0292,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11b0_0960 = {
+ 0x0960, pci_device_11b0_0960,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11b0_0960,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11b0_c960 = {
+ 0xc960, pci_device_11b0_c960,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11b0_c960,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11b8_0001 = {
+ 0x0001, pci_device_11b8_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11b8_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11b9_c0ed = {
+ 0xc0ed, pci_device_11b9_c0ed,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11b9_c0ed,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11bc_0001 = {
+ 0x0001, pci_device_11bc_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11bc_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11c1_0440 = {
+ 0x0440, pci_device_11c1_0440,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0440,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0441 = {
+ 0x0441, pci_device_11c1_0441,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0441,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0442 = {
+ 0x0442, pci_device_11c1_0442,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0442,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0443 = {
+ 0x0443, pci_device_11c1_0443,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0443,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0444 = {
+ 0x0444, pci_device_11c1_0444,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0444,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0445 = {
+ 0x0445, pci_device_11c1_0445,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0445,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0446 = {
+ 0x0446, pci_device_11c1_0446,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0446,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0447 = {
+ 0x0447, pci_device_11c1_0447,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0447,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0448 = {
+ 0x0448, pci_device_11c1_0448,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0448,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0449 = {
+ 0x0449, pci_device_11c1_0449,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0449,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_044a = {
+ 0x044a, pci_device_11c1_044a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_044a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_044b = {
+ 0x044b, pci_device_11c1_044b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_044b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_044c = {
+ 0x044c, pci_device_11c1_044c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_044c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_044d = {
+ 0x044d, pci_device_11c1_044d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_044d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_044e = {
+ 0x044e, pci_device_11c1_044e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_044e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_044f = {
+ 0x044f, pci_device_11c1_044f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_044f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0450 = {
+ 0x0450, pci_device_11c1_0450,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0450,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0451 = {
+ 0x0451, pci_device_11c1_0451,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0451,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0452 = {
+ 0x0452, pci_device_11c1_0452,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0452,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0453 = {
+ 0x0453, pci_device_11c1_0453,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0453,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0454 = {
+ 0x0454, pci_device_11c1_0454,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0454,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0455 = {
+ 0x0455, pci_device_11c1_0455,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0455,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0456 = {
+ 0x0456, pci_device_11c1_0456,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0456,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0457 = {
+ 0x0457, pci_device_11c1_0457,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0457,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0458 = {
+ 0x0458, pci_device_11c1_0458,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0458,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0459 = {
+ 0x0459, pci_device_11c1_0459,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0459,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_045a = {
+ 0x045a, pci_device_11c1_045a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_045a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_045c = {
+ 0x045c, pci_device_11c1_045c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_045c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0461 = {
+ 0x0461, pci_device_11c1_0461,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0461,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0462 = {
+ 0x0462, pci_device_11c1_0462,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0462,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_0480 = {
+ 0x0480, pci_device_11c1_0480,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_0480,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_5801 = {
+ 0x5801, pci_device_11c1_5801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_5801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_5802 = {
+ 0x5802, pci_device_11c1_5802,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_5802,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_5803 = {
+ 0x5803, pci_device_11c1_5803,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_5803,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c1_5811 = {
+ 0x5811, pci_device_11c1_5811,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c1_5811,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11c8_0658 = {
+ 0x0658, pci_device_11c8_0658,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c8_0658,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c8_d665 = {
+ 0xd665, pci_device_11c8_d665,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c8_d665,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c8_d667 = {
+ 0xd667, pci_device_11c8_d667,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c8_d667,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11c9_0010 = {
+ 0x0010, pci_device_11c9_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c9_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11c9_0011 = {
+ 0x0011, pci_device_11c9_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11c9_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11cb_2000 = {
+ 0x2000, pci_device_11cb_2000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11cb_2000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11cb_4000 = {
+ 0x4000, pci_device_11cb_4000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11cb_4000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11cb_8000 = {
+ 0x8000, pci_device_11cb_8000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11cb_8000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11d1_01f7 = {
+ 0x01f7, pci_device_11d1_01f7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11d1_01f7,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11d4_1805 = {
+ 0x1805, pci_device_11d4_1805,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11d4_1805,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11d4_1889 = {
+ 0x1889, pci_device_11d4_1889,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11d4_1889,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11d5_0115 = {
+ 0x0115, pci_device_11d5_0115,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11d5_0115,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11d5_0117 = {
+ 0x0117, pci_device_11d5_0117,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11d5_0117,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11de_6057 = {
+ 0x6057, pci_device_11de_6057,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11de_6057,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11de_6120 = {
+ 0x6120, pci_device_11de_6120,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11de_6120,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11e3_5030 = {
+ 0x5030, pci_device_11e3_5030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11e3_5030,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11f0_4231 = {
+ 0x4231, pci_device_11f0_4231,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f0_4231,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f0_4232 = {
+ 0x4232, pci_device_11f0_4232,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f0_4232,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f0_4233 = {
+ 0x4233, pci_device_11f0_4233,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f0_4233,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f0_4234 = {
+ 0x4234, pci_device_11f0_4234,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f0_4234,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f0_4235 = {
+ 0x4235, pci_device_11f0_4235,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f0_4235,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f0_4236 = {
+ 0x4236, pci_device_11f0_4236,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f0_4236,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f0_4731 = {
+ 0x4731, pci_device_11f0_4731,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f0_4731,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11f4_2915 = {
+ 0x2915, pci_device_11f4_2915,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f4_2915,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11f6_0112 = {
+ 0x0112, pci_device_11f6_0112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f6_0112,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f6_0113 = {
+ 0x0113, pci_device_11f6_0113,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f6_0113,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f6_1401 = {
+ 0x1401, pci_device_11f6_1401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f6_1401,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f6_2011 = {
+ 0x2011, pci_device_11f6_2011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f6_2011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f6_2201 = {
+ 0x2201, pci_device_11f6_2201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f6_2201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11f6_9881 = {
+ 0x9881, pci_device_11f6_9881,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f6_9881,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11f8_7375 = {
+ 0x7375, pci_device_11f8_7375,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11f8_7375,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_11fe_0001 = {
+ 0x0001, pci_device_11fe_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_0002 = {
+ 0x0002, pci_device_11fe_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_0003 = {
+ 0x0003, pci_device_11fe_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_0004 = {
+ 0x0004, pci_device_11fe_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_0005 = {
+ 0x0005, pci_device_11fe_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_0006 = {
+ 0x0006, pci_device_11fe_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_0007 = {
+ 0x0007, pci_device_11fe_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_0008 = {
+ 0x0008, pci_device_11fe_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_0009 = {
+ 0x0009, pci_device_11fe_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_000a = {
+ 0x000a, pci_device_11fe_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_000b = {
+ 0x000b, pci_device_11fe_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_000c = {
+ 0x000c, pci_device_11fe_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_11fe_8015 = {
+ 0x8015, pci_device_11fe_8015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_11fe_8015,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1202_4300 = {
+ 0x4300, pci_device_1202_4300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1202_4300,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1208_4853 = {
+ 0x4853, pci_device_1208_4853,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1208_4853,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_120e_0100 = {
+ 0x0100, pci_device_120e_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0101 = {
+ 0x0101, pci_device_120e_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0102 = {
+ 0x0102, pci_device_120e_0102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0103 = {
+ 0x0103, pci_device_120e_0103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0103,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0104 = {
+ 0x0104, pci_device_120e_0104,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0104,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0105 = {
+ 0x0105, pci_device_120e_0105,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0105,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0200 = {
+ 0x0200, pci_device_120e_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0201 = {
+ 0x0201, pci_device_120e_0201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0300 = {
+ 0x0300, pci_device_120e_0300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0301 = {
+ 0x0301, pci_device_120e_0301,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0301,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0310 = {
+ 0x0310, pci_device_120e_0310,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0310,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0311 = {
+ 0x0311, pci_device_120e_0311,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0311,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0320 = {
+ 0x0320, pci_device_120e_0320,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0320,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0321 = {
+ 0x0321, pci_device_120e_0321,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0321,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_120e_0400 = {
+ 0x0400, pci_device_120e_0400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120e_0400,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_120f_0001 = {
+ 0x0001, pci_device_120f_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_120f_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1217_6729 = {
+ 0x6729, pci_device_1217_6729,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1217_6729,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1217_673a = {
+ 0x673a, pci_device_1217_673a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1217_673a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1217_6832 = {
+ 0x6832, pci_device_1217_6832,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1217_6832,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1217_6836 = {
+ 0x6836, pci_device_1217_6836,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1217_6836,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1217_6872 = {
+ 0x6872, pci_device_1217_6872,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1217_6872,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1217_6925 = {
+ 0x6925, pci_device_1217_6925,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1217_6925,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1217_6933 = {
+ 0x6933, pci_device_1217_6933,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1217_6933,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1217_6972 = {
+ 0x6972, pci_device_1217_6972,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1217_6972,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_121a_0001 = {
+ 0x0001, pci_device_121a_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_121a_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_121a_0002 = {
+ 0x0002, pci_device_121a_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_121a_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_121a_0003 = {
+ 0x0003, pci_device_121a_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_121a_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_121a_0004 = {
+ 0x0004, pci_device_121a_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_121a_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_121a_0005 = {
+ 0x0005, pci_device_121a_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_121a_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_121a_0009 = {
+ 0x0009, pci_device_121a_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_121a_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_121a_0057 = {
+ 0x0057, pci_device_121a_0057,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_121a_0057,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1220_1220 = {
+ 0x1220, pci_device_1220_1220,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1220_1220,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1223_0003 = {
+ 0x0003, pci_device_1223_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_0004 = {
+ 0x0004, pci_device_1223_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_0005 = {
+ 0x0005, pci_device_1223_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_0008 = {
+ 0x0008, pci_device_1223_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_0009 = {
+ 0x0009, pci_device_1223_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_000a = {
+ 0x000a, pci_device_1223_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_000b = {
+ 0x000b, pci_device_1223_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_000c = {
+ 0x000c, pci_device_1223_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_000d = {
+ 0x000d, pci_device_1223_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_000d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1223_000e = {
+ 0x000e, pci_device_1223_000e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1223_000e,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_122d_1206 = {
+ 0x1206, pci_device_122d_1206,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_122d_1206,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_122d_50dc = {
+ 0x50dc, pci_device_122d_50dc,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_122d_50dc,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_122d_80da = {
+ 0x80da, pci_device_122d_80da,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_122d_80da,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1236_0000 = {
+ 0x0000, pci_device_1236_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1236_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1236_6401 = {
+ 0x6401, pci_device_1236_6401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1236_6401,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_123d_0000 = {
+ 0x0000, pci_device_123d_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_123d_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_123d_0002 = {
+ 0x0002, pci_device_123d_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_123d_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_123d_0003 = {
+ 0x0003, pci_device_123d_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_123d_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_123f_00e4 = {
+ 0x00e4, pci_device_123f_00e4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_123f_00e4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_123f_8120 = {
+ 0x8120, pci_device_123f_8120,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_123f_8120,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_123f_8888 = {
+ 0x8888, pci_device_123f_8888,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_123f_8888,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1242_1560 = {
+ 0x1560, pci_device_1242_1560,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1242_1560,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1242_4643 = {
+ 0x4643, pci_device_1242_4643,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1242_4643,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1244_0700 = {
+ 0x0700, pci_device_1244_0700,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1244_0700,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1244_0800 = {
+ 0x0800, pci_device_1244_0800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1244_0800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1244_0a00 = {
+ 0x0a00, pci_device_1244_0a00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1244_0a00,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1244_0e00 = {
+ 0x0e00, pci_device_1244_0e00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1244_0e00,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1244_1100 = {
+ 0x1100, pci_device_1244_1100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1244_1100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1244_1200 = {
+ 0x1200, pci_device_1244_1200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1244_1200,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_124b_0040 = {
+ 0x0040, pci_device_124b_0040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_124b_0040,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_124d_0000 = {
+ 0x0000, pci_device_124d_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_124d_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_124d_0002 = {
+ 0x0002, pci_device_124d_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_124d_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_124d_0003 = {
+ 0x0003, pci_device_124d_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_124d_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_124d_0004 = {
+ 0x0004, pci_device_124d_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_124d_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_124f_0041 = {
+ 0x0041, pci_device_124f_0041,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_124f_0041,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1255_1110 = {
+ 0x1110, pci_device_1255_1110,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1255_1110,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1255_1210 = {
+ 0x1210, pci_device_1255_1210,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1255_1210,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1255_2110 = {
+ 0x2110, pci_device_1255_2110,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1255_2110,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1255_2120 = {
+ 0x2120, pci_device_1255_2120,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1255_2120,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1255_2130 = {
+ 0x2130, pci_device_1255_2130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1255_2130,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1256_4201 = {
+ 0x4201, pci_device_1256_4201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1256_4201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1256_4401 = {
+ 0x4401, pci_device_1256_4401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1256_4401,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1256_5201 = {
+ 0x5201, pci_device_1256_5201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1256_5201,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1259_2560 = {
+ 0x2560, pci_device_1259_2560,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1259_2560,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_125b_1400 = {
+ 0x1400, pci_device_125b_1400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125b_1400,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_125c_0640 = {
+ 0x0640, pci_device_125c_0640,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125c_0640,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_125d_0000 = {
+ 0x0000, pci_device_125d_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_1948 = {
+ 0x1948, pci_device_125d_1948,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_1948,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_1968 = {
+ 0x1968, pci_device_125d_1968,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_1968,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_1969 = {
+ 0x1969, pci_device_125d_1969,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_1969,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_1978 = {
+ 0x1978, pci_device_125d_1978,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_1978,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_1988 = {
+ 0x1988, pci_device_125d_1988,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_1988,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_1989 = {
+ 0x1989, pci_device_125d_1989,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_1989,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_1998 = {
+ 0x1998, pci_device_125d_1998,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_1998,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_1999 = {
+ 0x1999, pci_device_125d_1999,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_1999,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_199a = {
+ 0x199a, pci_device_125d_199a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_199a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_199b = {
+ 0x199b, pci_device_125d_199b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_199b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_2808 = {
+ 0x2808, pci_device_125d_2808,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_2808,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_2838 = {
+ 0x2838, pci_device_125d_2838,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_2838,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_125d_2898 = {
+ 0x2898, pci_device_125d_2898,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_125d_2898,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1260_3873 = {
+ 0x3873, pci_device_1260_3873,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1260_3873,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1260_8130 = {
+ 0x8130, pci_device_1260_8130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1260_8130,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1260_8131 = {
+ 0x8131, pci_device_1260_8131,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1260_8131,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1266_0001 = {
+ 0x0001, pci_device_1266_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1266_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1266_1910 = {
+ 0x1910, pci_device_1266_1910,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1266_1910,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1267_5352 = {
+ 0x5352, pci_device_1267_5352,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1267_5352,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1267_5a4b = {
+ 0x5a4b, pci_device_1267_5a4b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1267_5a4b,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_126f_0710 = {
+ 0x0710, pci_device_126f_0710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_126f_0710,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_126f_0712 = {
+ 0x0712, pci_device_126f_0712,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_126f_0712,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_126f_0720 = {
+ 0x0720, pci_device_126f_0720,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_126f_0720,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_126f_0810 = {
+ 0x0810, pci_device_126f_0810,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_126f_0810,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_126f_0811 = {
+ 0x0811, pci_device_126f_0811,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_126f_0811,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_126f_0820 = {
+ 0x0820, pci_device_126f_0820,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_126f_0820,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_126f_0910 = {
+ 0x0910, pci_device_126f_0910,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_126f_0910,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1273_0002 = {
+ 0x0002, pci_device_1273_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1273_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1274_1371 = {
+ 0x1371, pci_device_1274_1371,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1274_1371,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1274_5000 = {
+ 0x5000, pci_device_1274_5000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1274_5000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1274_5880 = {
+ 0x5880, pci_device_1274_5880,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1274_5880,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1278_0701 = {
+ 0x0701, pci_device_1278_0701,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1278_0701,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1279_0295 = {
+ 0x0295, pci_device_1279_0295,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1279_0295,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1279_0395 = {
+ 0x0395, pci_device_1279_0395,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1279_0395,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1279_0396 = {
+ 0x0396, pci_device_1279_0396,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1279_0396,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1279_0397 = {
+ 0x0397, pci_device_1279_0397,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1279_0397,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_127a_1002 = {
+ 0x1002, pci_device_127a_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1003 = {
+ 0x1003, pci_device_127a_1003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1004 = {
+ 0x1004, pci_device_127a_1004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1005 = {
+ 0x1005, pci_device_127a_1005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1022 = {
+ 0x1022, pci_device_127a_1022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1023 = {
+ 0x1023, pci_device_127a_1023,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1023,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1024 = {
+ 0x1024, pci_device_127a_1024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1025 = {
+ 0x1025, pci_device_127a_1025,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1025,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1026 = {
+ 0x1026, pci_device_127a_1026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1032 = {
+ 0x1032, pci_device_127a_1032,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1032,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1033 = {
+ 0x1033, pci_device_127a_1033,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1033,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1034 = {
+ 0x1034, pci_device_127a_1034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1035 = {
+ 0x1035, pci_device_127a_1035,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1035,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1036 = {
+ 0x1036, pci_device_127a_1036,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1036,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_1085 = {
+ 0x1085, pci_device_127a_1085,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_1085,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_2005 = {
+ 0x2005, pci_device_127a_2005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_2005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_2013 = {
+ 0x2013, pci_device_127a_2013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_2013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_2014 = {
+ 0x2014, pci_device_127a_2014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_2014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_2015 = {
+ 0x2015, pci_device_127a_2015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_2015,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_2016 = {
+ 0x2016, pci_device_127a_2016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_2016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_4311 = {
+ 0x4311, pci_device_127a_4311,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_4311,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_4320 = {
+ 0x4320, pci_device_127a_4320,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_4320,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_4321 = {
+ 0x4321, pci_device_127a_4321,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_4321,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_4322 = {
+ 0x4322, pci_device_127a_4322,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_4322,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_127a_8234 = {
+ 0x8234, pci_device_127a_8234,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_127a_8234,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1282_9009 = {
+ 0x9009, pci_device_1282_9009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1282_9009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1282_9100 = {
+ 0x9100, pci_device_1282_9100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1282_9100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1282_9102 = {
+ 0x9102, pci_device_1282_9102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1282_9102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1282_9132 = {
+ 0x9132, pci_device_1282_9132,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1282_9132,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1283_673a = {
+ 0x673a, pci_device_1283_673a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1283_673a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1283_8330 = {
+ 0x8330, pci_device_1283_8330,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1283_8330,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1283_8888 = {
+ 0x8888, pci_device_1283_8888,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1283_8888,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1283_8889 = {
+ 0x8889, pci_device_1283_8889,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1283_8889,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1283_e886 = {
+ 0xe886, pci_device_1283_e886,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1283_e886,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1285_0100 = {
+ 0x0100, pci_device_1285_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1285_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1287_001e = {
+ 0x001e, pci_device_1287_001e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1287_001e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1287_001f = {
+ 0x001f, pci_device_1287_001f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1287_001f,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_128d_0021 = {
+ 0x0021, pci_device_128d_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_128d_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_128e_0008 = {
+ 0x0008, pci_device_128e_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_128e_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_128e_0009 = {
+ 0x0009, pci_device_128e_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_128e_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_128e_000a = {
+ 0x000a, pci_device_128e_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_128e_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_128e_000b = {
+ 0x000b, pci_device_128e_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_128e_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_128e_000c = {
+ 0x000c, pci_device_128e_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_128e_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_129a_0615 = {
+ 0x0615, pci_device_129a_0615,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_129a_0615,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12ab_3000 = {
+ 0x3000, pci_device_12ab_3000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12ab_3000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12ae_0001 = {
+ 0x0001, pci_device_12ae_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12ae_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12ae_0002 = {
+ 0x0002, pci_device_12ae_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12ae_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12b9_1006 = {
+ 0x1006, pci_device_12b9_1006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12b9_1006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12b9_1007 = {
+ 0x1007, pci_device_12b9_1007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12b9_1007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12b9_1008 = {
+ 0x1008, pci_device_12b9_1008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12b9_1008,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12be_3041 = {
+ 0x3041, pci_device_12be_3041,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12be_3041,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12be_3042 = {
+ 0x3042, pci_device_12be_3042,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12be_3042,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12c3_0058 = {
+ 0x0058, pci_device_12c3_0058,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12c3_0058,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12c3_5598 = {
+ 0x5598, pci_device_12c3_5598,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12c3_5598,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12c5_007e = {
+ 0x007e, pci_device_12c5_007e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12c5_007e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12c5_007f = {
+ 0x007f, pci_device_12c5_007f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12c5_007f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12c5_0081 = {
+ 0x0081, pci_device_12c5_0081,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12c5_0081,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12c5_0085 = {
+ 0x0085, pci_device_12c5_0085,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12c5_0085,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12c5_0086 = {
+ 0x0086, pci_device_12c5_0086,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12c5_0086,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_12d2_0008 = {
+ 0x0008, pci_device_12d2_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d2_0009 = {
+ 0x0009, pci_device_12d2_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d2_0018 = {
+ 0x0018, pci_device_12d2_0018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_0018,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d2_0019 = {
+ 0x0019, pci_device_12d2_0019,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_0019,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d2_0020 = {
+ 0x0020, pci_device_12d2_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d2_0028 = {
+ 0x0028, pci_device_12d2_0028,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_0028,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d2_0029 = {
+ 0x0029, pci_device_12d2_0029,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_0029,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d2_002c = {
+ 0x002c, pci_device_12d2_002c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_002c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12d2_00a0 = {
+ 0x00a0, pci_device_12d2_00a0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12d2_00a0,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12e0_0010 = {
+ 0x0010, pci_device_12e0_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12e0_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12e0_0020 = {
+ 0x0020, pci_device_12e0_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12e0_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12e0_0030 = {
+ 0x0030, pci_device_12e0_0030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12e0_0030,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12eb_0001 = {
+ 0x0001, pci_device_12eb_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12eb_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12eb_0002 = {
+ 0x0002, pci_device_12eb_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12eb_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12eb_0003 = {
+ 0x0003, pci_device_12eb_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12eb_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_12eb_8803 = {
+ 0x8803, pci_device_12eb_8803,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12eb_8803,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_12f8_0002 = {
+ 0x0002, pci_device_12f8_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_12f8_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1307_0001 = {
+ 0x0001, pci_device_1307_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_000b = {
+ 0x000b, pci_device_1307_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_000c = {
+ 0x000c, pci_device_1307_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_000d = {
+ 0x000d, pci_device_1307_000d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_000d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_000f = {
+ 0x000f, pci_device_1307_000f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_000f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0010 = {
+ 0x0010, pci_device_1307_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0014 = {
+ 0x0014, pci_device_1307_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0015 = {
+ 0x0015, pci_device_1307_0015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0015,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0016 = {
+ 0x0016, pci_device_1307_0016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0017 = {
+ 0x0017, pci_device_1307_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0018 = {
+ 0x0018, pci_device_1307_0018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0018,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0019 = {
+ 0x0019, pci_device_1307_0019,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0019,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_001a = {
+ 0x001a, pci_device_1307_001a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_001a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_001b = {
+ 0x001b, pci_device_1307_001b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_001b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_001c = {
+ 0x001c, pci_device_1307_001c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_001c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_001d = {
+ 0x001d, pci_device_1307_001d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_001d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_001e = {
+ 0x001e, pci_device_1307_001e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_001e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_001f = {
+ 0x001f, pci_device_1307_001f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_001f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0020 = {
+ 0x0020, pci_device_1307_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0021 = {
+ 0x0021, pci_device_1307_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0022 = {
+ 0x0022, pci_device_1307_0022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0023 = {
+ 0x0023, pci_device_1307_0023,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0023,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0024 = {
+ 0x0024, pci_device_1307_0024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0025 = {
+ 0x0025, pci_device_1307_0025,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0025,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0026 = {
+ 0x0026, pci_device_1307_0026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0027 = {
+ 0x0027, pci_device_1307_0027,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0027,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0028 = {
+ 0x0028, pci_device_1307_0028,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0028,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0029 = {
+ 0x0029, pci_device_1307_0029,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0029,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_002c = {
+ 0x002c, pci_device_1307_002c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_002c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0033 = {
+ 0x0033, pci_device_1307_0033,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0033,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0034 = {
+ 0x0034, pci_device_1307_0034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0035 = {
+ 0x0035, pci_device_1307_0035,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0035,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0036 = {
+ 0x0036, pci_device_1307_0036,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0036,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_0037 = {
+ 0x0037, pci_device_1307_0037,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_0037,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1307_004c = {
+ 0x004c, pci_device_1307_004c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1307_004c,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1308_0001 = {
+ 0x0001, pci_device_1308_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1308_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1317_0981 = {
+ 0x0981, pci_device_1317_0981,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1317_0981,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1317_0985 = {
+ 0x0985, pci_device_1317_0985,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1317_0985,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1317_1985 = {
+ 0x1985, pci_device_1317_1985,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1317_1985,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1318_0911 = {
+ 0x0911, pci_device_1318_0911,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1318_0911,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1319_0801 = {
+ 0x0801, pci_device_1319_0801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1319_0801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1319_0802 = {
+ 0x0802, pci_device_1319_0802,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1319_0802,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1319_1000 = {
+ 0x1000, pci_device_1319_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1319_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1319_1001 = {
+ 0x1001, pci_device_1319_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1319_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_131f_1000 = {
+ 0x1000, pci_device_131f_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1001 = {
+ 0x1001, pci_device_131f_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1002 = {
+ 0x1002, pci_device_131f_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1010 = {
+ 0x1010, pci_device_131f_1010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1011 = {
+ 0x1011, pci_device_131f_1011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1012 = {
+ 0x1012, pci_device_131f_1012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1020 = {
+ 0x1020, pci_device_131f_1020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1021 = {
+ 0x1021, pci_device_131f_1021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1030 = {
+ 0x1030, pci_device_131f_1030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1031 = {
+ 0x1031, pci_device_131f_1031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1031,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1032 = {
+ 0x1032, pci_device_131f_1032,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1032,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1034 = {
+ 0x1034, pci_device_131f_1034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1035 = {
+ 0x1035, pci_device_131f_1035,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1035,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1036 = {
+ 0x1036, pci_device_131f_1036,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1036,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1050 = {
+ 0x1050, pci_device_131f_1050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1051 = {
+ 0x1051, pci_device_131f_1051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1051,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_1052 = {
+ 0x1052, pci_device_131f_1052,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_1052,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2000 = {
+ 0x2000, pci_device_131f_2000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2001 = {
+ 0x2001, pci_device_131f_2001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2002 = {
+ 0x2002, pci_device_131f_2002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2010 = {
+ 0x2010, pci_device_131f_2010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2011 = {
+ 0x2011, pci_device_131f_2011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2012 = {
+ 0x2012, pci_device_131f_2012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2020 = {
+ 0x2020, pci_device_131f_2020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2021 = {
+ 0x2021, pci_device_131f_2021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2030 = {
+ 0x2030, pci_device_131f_2030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2031 = {
+ 0x2031, pci_device_131f_2031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2031,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2032 = {
+ 0x2032, pci_device_131f_2032,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2032,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2040 = {
+ 0x2040, pci_device_131f_2040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2041 = {
+ 0x2041, pci_device_131f_2041,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2041,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2042 = {
+ 0x2042, pci_device_131f_2042,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2042,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2050 = {
+ 0x2050, pci_device_131f_2050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2051 = {
+ 0x2051, pci_device_131f_2051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2051,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2052 = {
+ 0x2052, pci_device_131f_2052,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2052,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2060 = {
+ 0x2060, pci_device_131f_2060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2061 = {
+ 0x2061, pci_device_131f_2061,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2061,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_131f_2062 = {
+ 0x2062, pci_device_131f_2062,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_131f_2062,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1332_5415 = {
+ 0x5415, pci_device_1332_5415,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1332_5415,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_134a_0001 = {
+ 0x0001, pci_device_134a_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134a_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_134a_0002 = {
+ 0x0002, pci_device_134a_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134a_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_134d_7890 = {
+ 0x7890, pci_device_134d_7890,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134d_7890,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_134d_7891 = {
+ 0x7891, pci_device_134d_7891,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134d_7891,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_134d_7892 = {
+ 0x7892, pci_device_134d_7892,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134d_7892,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_134d_7893 = {
+ 0x7893, pci_device_134d_7893,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134d_7893,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_134d_7894 = {
+ 0x7894, pci_device_134d_7894,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134d_7894,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_134d_7895 = {
+ 0x7895, pci_device_134d_7895,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134d_7895,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_134d_7896 = {
+ 0x7896, pci_device_134d_7896,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134d_7896,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_134d_7897 = {
+ 0x7897, pci_device_134d_7897,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_134d_7897,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1353_0002 = {
+ 0x0002, pci_device_1353_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1353_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1353_0003 = {
+ 0x0003, pci_device_1353_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1353_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1353_0004 = {
+ 0x0004, pci_device_1353_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1353_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1353_0005 = {
+ 0x0005, pci_device_1353_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1353_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_135c_0010 = {
+ 0x0010, pci_device_135c_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_0020 = {
+ 0x0020, pci_device_135c_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_0030 = {
+ 0x0030, pci_device_135c_0030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_0040 = {
+ 0x0040, pci_device_135c_0040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_0050 = {
+ 0x0050, pci_device_135c_0050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_0060 = {
+ 0x0060, pci_device_135c_0060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_00f0 = {
+ 0x00f0, pci_device_135c_00f0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_00f0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_0170 = {
+ 0x0170, pci_device_135c_0170,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0170,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_0180 = {
+ 0x0180, pci_device_135c_0180,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0180,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_0190 = {
+ 0x0190, pci_device_135c_0190,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_0190,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_01a0 = {
+ 0x01a0, pci_device_135c_01a0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_01a0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_01b0 = {
+ 0x01b0, pci_device_135c_01b0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_01b0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135c_01c0 = {
+ 0x01c0, pci_device_135c_01c0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135c_01c0,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_135e_7101 = {
+ 0x7101, pci_device_135e_7101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135e_7101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135e_7201 = {
+ 0x7201, pci_device_135e_7201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135e_7201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135e_7202 = {
+ 0x7202, pci_device_135e_7202,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135e_7202,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135e_7401 = {
+ 0x7401, pci_device_135e_7401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135e_7401,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135e_7402 = {
+ 0x7402, pci_device_135e_7402,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135e_7402,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135e_7801 = {
+ 0x7801, pci_device_135e_7801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135e_7801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_135e_8001 = {
+ 0x8001, pci_device_135e_8001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_135e_8001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1385_4100 = {
+ 0x4100, pci_device_1385_4100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1385_4100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1385_620a = {
+ 0x620a, pci_device_1385_620a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1385_620a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1385_622a = {
+ 0x622a, pci_device_1385_622a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1385_622a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1385_630a = {
+ 0x630a, pci_device_1385_630a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1385_630a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1385_f311 = {
+ 0xf311, pci_device_1385_f311,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1385_f311,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1389_0001 = {
+ 0x0001, pci_device_1389_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1389_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1393_1040 = {
+ 0x1040, pci_device_1393_1040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1393_1040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1393_1680 = {
+ 0x1680, pci_device_1393_1680,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1393_1680,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1393_2040 = {
+ 0x2040, pci_device_1393_2040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1393_2040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1393_2180 = {
+ 0x2180, pci_device_1393_2180,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1393_2180,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1393_3200 = {
+ 0x3200, pci_device_1393_3200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1393_3200,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1394_0001 = {
+ 0x0001, pci_device_1394_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1394_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1397_2bd0 = {
+ 0x2bd0, pci_device_1397_2bd0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1397_2bd0,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_139a_0001 = {
+ 0x0001, pci_device_139a_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_139a_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_139a_0003 = {
+ 0x0003, pci_device_139a_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_139a_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_139a_0005 = {
+ 0x0005, pci_device_139a_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_139a_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13a3_0005 = {
+ 0x0005, pci_device_13a3_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a3_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13a3_0006 = {
+ 0x0006, pci_device_13a3_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a3_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13a3_0007 = {
+ 0x0007, pci_device_13a3_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a3_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13a3_0012 = {
+ 0x0012, pci_device_13a3_0012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a3_0012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13a3_0014 = {
+ 0x0014, pci_device_13a3_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a3_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13a3_0016 = {
+ 0x0016, pci_device_13a3_0016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a3_0016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13a3_0017 = {
+ 0x0017, pci_device_13a3_0017,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a3_0017,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13a3_0018 = {
+ 0x0018, pci_device_13a3_0018,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a3_0018,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13a8_0158 = {
+ 0x0158, pci_device_13a8_0158,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13a8_0158,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13c0_0010 = {
+ 0x0010, pci_device_13c0_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13c0_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13c1_1000 = {
+ 0x1000, pci_device_13c1_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13c1_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13c1_1001 = {
+ 0x1001, pci_device_13c1_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13c1_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13c1_1002 = {
+ 0x1002, pci_device_13c1_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13c1_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13d0_2103 = {
+ 0x2103, pci_device_13d0_2103,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13d0_2103,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13d1_ab02 = {
+ 0xab02, pci_device_13d1_ab02,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13d1_ab02,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13d1_ab06 = {
+ 0xab06, pci_device_13d1_ab06,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13d1_ab06,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13df_0001 = {
+ 0x0001, pci_device_13df_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13df_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13f0_0201 = {
+ 0x0201, pci_device_13f0_0201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13f0_0201,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13f4_1401 = {
+ 0x1401, pci_device_13f4_1401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13f4_1401,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13f6_0100 = {
+ 0x0100, pci_device_13f6_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13f6_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13f6_0101 = {
+ 0x0101, pci_device_13f6_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13f6_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13f6_0111 = {
+ 0x0111, pci_device_13f6_0111,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13f6_0111,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_13f6_0211 = {
+ 0x0211, pci_device_13f6_0211,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13f6_0211,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_13fe_1756 = {
+ 0x1756, pci_device_13fe_1756,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_13fe_1756,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1400_1401 = {
+ 0x1401, pci_device_1400_1401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1400_1401,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1407_0100 = {
+ 0x0100, pci_device_1407_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_0101 = {
+ 0x0101, pci_device_1407_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_0102 = {
+ 0x0102, pci_device_1407_0102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_0102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_0200 = {
+ 0x0200, pci_device_1407_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_0201 = {
+ 0x0201, pci_device_1407_0201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_0201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_0202 = {
+ 0x0202, pci_device_1407_0202,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_0202,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_0500 = {
+ 0x0500, pci_device_1407_0500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_0500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_0600 = {
+ 0x0600, pci_device_1407_0600,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_0600,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_8000 = {
+ 0x8000, pci_device_1407_8000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_8000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_8001 = {
+ 0x8001, pci_device_1407_8001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_8001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_8002 = {
+ 0x8002, pci_device_1407_8002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_8002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_8003 = {
+ 0x8003, pci_device_1407_8003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_8003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1407_8800 = {
+ 0x8800, pci_device_1407_8800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1407_8800,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1409_7168 = {
+ 0x7168, pci_device_1409_7168,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1409_7168,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1412_1712 = {
+ 0x1712, pci_device_1412_1712,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1412_1712,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1412_1724 = {
+ 0x1724, pci_device_1412_1724,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1412_1724,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1415_8403 = {
+ 0x8403, pci_device_1415_8403,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1415_8403,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1415_9501 = {
+ 0x9501, pci_device_1415_9501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1415_9501,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1415_950a = {
+ 0x950a, pci_device_1415_950a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1415_950a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1415_950b = {
+ 0x950b, pci_device_1415_950b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1415_950b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1415_9511 = {
+ 0x9511, pci_device_1415_9511,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1415_9511,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1415_9521 = {
+ 0x9521, pci_device_1415_9521,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1415_9521,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_144a_7296 = {
+ 0x7296, pci_device_144a_7296,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_7296,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_7432 = {
+ 0x7432, pci_device_144a_7432,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_7432,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_7433 = {
+ 0x7433, pci_device_144a_7433,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_7433,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_7434 = {
+ 0x7434, pci_device_144a_7434,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_7434,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_7841 = {
+ 0x7841, pci_device_144a_7841,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_7841,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_8133 = {
+ 0x8133, pci_device_144a_8133,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_8133,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_8554 = {
+ 0x8554, pci_device_144a_8554,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_8554,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_9111 = {
+ 0x9111, pci_device_144a_9111,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_9111,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_9113 = {
+ 0x9113, pci_device_144a_9113,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_9113,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_144a_9114 = {
+ 0x9114, pci_device_144a_9114,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_144a_9114,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_145f_0001 = {
+ 0x0001, pci_device_145f_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_145f_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_148d_1003 = {
+ 0x1003, pci_device_148d_1003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_148d_1003,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14af_7102 = {
+ 0x7102, pci_device_14af_7102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14af_7102,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14b3_0000 = {
+ 0x0000, pci_device_14b3_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b3_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14b5_0200 = {
+ 0x0200, pci_device_14b5_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b5_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b5_0300 = {
+ 0x0300, pci_device_14b5_0300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b5_0300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b5_0400 = {
+ 0x0400, pci_device_14b5_0400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b5_0400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b5_0600 = {
+ 0x0600, pci_device_14b5_0600,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b5_0600,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b5_0800 = {
+ 0x0800, pci_device_14b5_0800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b5_0800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b5_0900 = {
+ 0x0900, pci_device_14b5_0900,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b5_0900,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b5_0a00 = {
+ 0x0a00, pci_device_14b5_0a00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b5_0a00,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b5_0b00 = {
+ 0x0b00, pci_device_14b5_0b00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b5_0b00,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14b7_0001 = {
+ 0x0001, pci_device_14b7_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b7_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14b9_0001 = {
+ 0x0001, pci_device_14b9_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b9_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b9_0340 = {
+ 0x0340, pci_device_14b9_0340,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b9_0340,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b9_0350 = {
+ 0x0350, pci_device_14b9_0350,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b9_0350,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b9_4500 = {
+ 0x4500, pci_device_14b9_4500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b9_4500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b9_4800 = {
+ 0x4800, pci_device_14b9_4800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b9_4800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14b9_a504 = {
+ 0xa504, pci_device_14b9_a504,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14b9_a504,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14d2_8001 = {
+ 0x8001, pci_device_14d2_8001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_8001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_8002 = {
+ 0x8002, pci_device_14d2_8002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_8002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_8010 = {
+ 0x8010, pci_device_14d2_8010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_8010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_8011 = {
+ 0x8011, pci_device_14d2_8011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_8011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_8020 = {
+ 0x8020, pci_device_14d2_8020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_8020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_8021 = {
+ 0x8021, pci_device_14d2_8021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_8021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_8040 = {
+ 0x8040, pci_device_14d2_8040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_8040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_8080 = {
+ 0x8080, pci_device_14d2_8080,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_8080,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_a000 = {
+ 0xa000, pci_device_14d2_a000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_a000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_a001 = {
+ 0xa001, pci_device_14d2_a001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_a001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_a003 = {
+ 0xa003, pci_device_14d2_a003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_a003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_a004 = {
+ 0xa004, pci_device_14d2_a004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_a004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_a005 = {
+ 0xa005, pci_device_14d2_a005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_a005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_e001 = {
+ 0xe001, pci_device_14d2_e001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_e001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_e010 = {
+ 0xe010, pci_device_14d2_e010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_e010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14d2_e020 = {
+ 0xe020, pci_device_14d2_e020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14d2_e020,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14db_2120 = {
+ 0x2120, pci_device_14db_2120,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14db_2120,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14dc_0000 = {
+ 0x0000, pci_device_14dc_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0001 = {
+ 0x0001, pci_device_14dc_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0002 = {
+ 0x0002, pci_device_14dc_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0003 = {
+ 0x0003, pci_device_14dc_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0004 = {
+ 0x0004, pci_device_14dc_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0005 = {
+ 0x0005, pci_device_14dc_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0006 = {
+ 0x0006, pci_device_14dc_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0007 = {
+ 0x0007, pci_device_14dc_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0008 = {
+ 0x0008, pci_device_14dc_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_0009 = {
+ 0x0009, pci_device_14dc_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_000a = {
+ 0x000a, pci_device_14dc_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14dc_000b = {
+ 0x000b, pci_device_14dc_000b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14dc_000b,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14e4_1644 = {
+ 0x1644, pci_device_14e4_1644,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_1644,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_1645 = {
+ 0x1645, pci_device_14e4_1645,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_1645,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_1646 = {
+ 0x1646, pci_device_14e4_1646,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_1646,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_1647 = {
+ 0x1647, pci_device_14e4_1647,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_1647,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_1648 = {
+ 0x1648, pci_device_14e4_1648,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_1648,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_164d = {
+ 0x164d, pci_device_14e4_164d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_164d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_1653 = {
+ 0x1653, pci_device_14e4_1653,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_1653,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_165d = {
+ 0x165d, pci_device_14e4_165d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_165d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_1696 = {
+ 0x1696, pci_device_14e4_1696,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_1696,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_16a6 = {
+ 0x16a6, pci_device_14e4_16a6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_16a6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_16a7 = {
+ 0x16a7, pci_device_14e4_16a7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_16a7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_16a8 = {
+ 0x16a8, pci_device_14e4_16a8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_16a8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_16c6 = {
+ 0x16c6, pci_device_14e4_16c6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_16c6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_16c7 = {
+ 0x16c7, pci_device_14e4_16c7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_16c7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4210 = {
+ 0x4210, pci_device_14e4_4210,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4210,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4211 = {
+ 0x4211, pci_device_14e4_4211,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4211,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4212 = {
+ 0x4212, pci_device_14e4_4212,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4212,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4301 = {
+ 0x4301, pci_device_14e4_4301,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4301,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4401 = {
+ 0x4401, pci_device_14e4_4401,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4401,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4402 = {
+ 0x4402, pci_device_14e4_4402,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4402,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4410 = {
+ 0x4410, pci_device_14e4_4410,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4410,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4411 = {
+ 0x4411, pci_device_14e4_4411,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4411,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_4412 = {
+ 0x4412, pci_device_14e4_4412,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_4412,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_5820 = {
+ 0x5820, pci_device_14e4_5820,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_5820,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14e4_5821 = {
+ 0x5821, pci_device_14e4_5821,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14e4_5821,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14ea_ab06 = {
+ 0xab06, pci_device_14ea_ab06,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14ea_ab06,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_14f1_1002 = {
+ 0x1002, pci_device_14f1_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1003 = {
+ 0x1003, pci_device_14f1_1003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1004 = {
+ 0x1004, pci_device_14f1_1004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1005 = {
+ 0x1005, pci_device_14f1_1005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1006 = {
+ 0x1006, pci_device_14f1_1006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1022 = {
+ 0x1022, pci_device_14f1_1022,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1022,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1023 = {
+ 0x1023, pci_device_14f1_1023,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1023,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1024 = {
+ 0x1024, pci_device_14f1_1024,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1024,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1025 = {
+ 0x1025, pci_device_14f1_1025,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1025,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1026 = {
+ 0x1026, pci_device_14f1_1026,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1026,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1032 = {
+ 0x1032, pci_device_14f1_1032,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1032,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1033 = {
+ 0x1033, pci_device_14f1_1033,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1033,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1034 = {
+ 0x1034, pci_device_14f1_1034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1035 = {
+ 0x1035, pci_device_14f1_1035,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1035,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1036 = {
+ 0x1036, pci_device_14f1_1036,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1036,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1052 = {
+ 0x1052, pci_device_14f1_1052,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1052,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1053 = {
+ 0x1053, pci_device_14f1_1053,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1053,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1054 = {
+ 0x1054, pci_device_14f1_1054,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1054,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1055 = {
+ 0x1055, pci_device_14f1_1055,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1055,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1056 = {
+ 0x1056, pci_device_14f1_1056,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1056,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1057 = {
+ 0x1057, pci_device_14f1_1057,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1057,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1059 = {
+ 0x1059, pci_device_14f1_1059,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1059,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1063 = {
+ 0x1063, pci_device_14f1_1063,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1063,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1064 = {
+ 0x1064, pci_device_14f1_1064,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1064,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1065 = {
+ 0x1065, pci_device_14f1_1065,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1065,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1066 = {
+ 0x1066, pci_device_14f1_1066,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1066,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1433 = {
+ 0x1433, pci_device_14f1_1433,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1433,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1434 = {
+ 0x1434, pci_device_14f1_1434,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1434,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1435 = {
+ 0x1435, pci_device_14f1_1435,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1435,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1436 = {
+ 0x1436, pci_device_14f1_1436,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1436,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1453 = {
+ 0x1453, pci_device_14f1_1453,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1453,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1454 = {
+ 0x1454, pci_device_14f1_1454,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1454,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1455 = {
+ 0x1455, pci_device_14f1_1455,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1455,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1456 = {
+ 0x1456, pci_device_14f1_1456,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1456,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1610 = {
+ 0x1610, pci_device_14f1_1610,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1610,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1611 = {
+ 0x1611, pci_device_14f1_1611,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1611,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1803 = {
+ 0x1803, pci_device_14f1_1803,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1803,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_1815 = {
+ 0x1815, pci_device_14f1_1815,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_1815,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2003 = {
+ 0x2003, pci_device_14f1_2003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2004 = {
+ 0x2004, pci_device_14f1_2004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2005 = {
+ 0x2005, pci_device_14f1_2005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2006 = {
+ 0x2006, pci_device_14f1_2006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2013 = {
+ 0x2013, pci_device_14f1_2013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2014 = {
+ 0x2014, pci_device_14f1_2014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2015 = {
+ 0x2015, pci_device_14f1_2015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2015,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2016 = {
+ 0x2016, pci_device_14f1_2016,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2016,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2043 = {
+ 0x2043, pci_device_14f1_2043,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2043,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2044 = {
+ 0x2044, pci_device_14f1_2044,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2044,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2045 = {
+ 0x2045, pci_device_14f1_2045,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2045,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2046 = {
+ 0x2046, pci_device_14f1_2046,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2046,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2063 = {
+ 0x2063, pci_device_14f1_2063,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2063,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2064 = {
+ 0x2064, pci_device_14f1_2064,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2064,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2065 = {
+ 0x2065, pci_device_14f1_2065,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2065,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2066 = {
+ 0x2066, pci_device_14f1_2066,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2066,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2093 = {
+ 0x2093, pci_device_14f1_2093,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2093,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2143 = {
+ 0x2143, pci_device_14f1_2143,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2143,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2144 = {
+ 0x2144, pci_device_14f1_2144,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2144,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2145 = {
+ 0x2145, pci_device_14f1_2145,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2145,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2146 = {
+ 0x2146, pci_device_14f1_2146,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2146,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2163 = {
+ 0x2163, pci_device_14f1_2163,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2163,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2164 = {
+ 0x2164, pci_device_14f1_2164,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2164,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2165 = {
+ 0x2165, pci_device_14f1_2165,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2165,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2166 = {
+ 0x2166, pci_device_14f1_2166,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2166,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2343 = {
+ 0x2343, pci_device_14f1_2343,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2343,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2344 = {
+ 0x2344, pci_device_14f1_2344,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2344,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2345 = {
+ 0x2345, pci_device_14f1_2345,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2345,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2346 = {
+ 0x2346, pci_device_14f1_2346,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2346,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2363 = {
+ 0x2363, pci_device_14f1_2363,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2363,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2364 = {
+ 0x2364, pci_device_14f1_2364,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2364,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2365 = {
+ 0x2365, pci_device_14f1_2365,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2365,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2366 = {
+ 0x2366, pci_device_14f1_2366,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2366,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2443 = {
+ 0x2443, pci_device_14f1_2443,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2443,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2444 = {
+ 0x2444, pci_device_14f1_2444,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2444,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2445 = {
+ 0x2445, pci_device_14f1_2445,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2445,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2446 = {
+ 0x2446, pci_device_14f1_2446,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2446,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2463 = {
+ 0x2463, pci_device_14f1_2463,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2463,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2464 = {
+ 0x2464, pci_device_14f1_2464,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2464,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2465 = {
+ 0x2465, pci_device_14f1_2465,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2465,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2466 = {
+ 0x2466, pci_device_14f1_2466,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2466,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_2f00 = {
+ 0x2f00, pci_device_14f1_2f00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_2f00,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_14f1_8234 = {
+ 0x8234, pci_device_14f1_8234,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_14f1_8234,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1507_0001 = {
+ 0x0001, pci_device_1507_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1507_0002 = {
+ 0x0002, pci_device_1507_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1507_0003 = {
+ 0x0003, pci_device_1507_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1507_0100 = {
+ 0x0100, pci_device_1507_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1507_0431 = {
+ 0x0431, pci_device_1507_0431,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_0431,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1507_4801 = {
+ 0x4801, pci_device_1507_4801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_4801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1507_4802 = {
+ 0x4802, pci_device_1507_4802,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_4802,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1507_4803 = {
+ 0x4803, pci_device_1507_4803,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_4803,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1507_4806 = {
+ 0x4806, pci_device_1507_4806,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1507_4806,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1516_0803 = {
+ 0x0803, pci_device_1516_0803,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1516_0803,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_151a_1002 = {
+ 0x1002, pci_device_151a_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_151a_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_151a_1004 = {
+ 0x1004, pci_device_151a_1004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_151a_1004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_151a_1008 = {
+ 0x1008, pci_device_151a_1008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_151a_1008,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_151f_0000 = {
+ 0x0000, pci_device_151f_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_151f_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1522_0100 = {
+ 0x0100, pci_device_1522_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1522_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1524_1211 = {
+ 0x1211, pci_device_1524_1211,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1524_1211,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1524_1225 = {
+ 0x1225, pci_device_1524_1225,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1524_1225,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1524_1410 = {
+ 0x1410, pci_device_1524_1410,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1524_1410,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1524_1420 = {
+ 0x1420, pci_device_1524_1420,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1524_1420,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1543_3052 = {
+ 0x3052, pci_device_1543_3052,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1543_3052,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1543_4c22 = {
+ 0x4c22, pci_device_1543_4c22,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1543_4c22,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1571_a001 = {
+ 0xa001, pci_device_1571_a001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a002 = {
+ 0xa002, pci_device_1571_a002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a003 = {
+ 0xa003, pci_device_1571_a003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a004 = {
+ 0xa004, pci_device_1571_a004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a005 = {
+ 0xa005, pci_device_1571_a005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a006 = {
+ 0xa006, pci_device_1571_a006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a007 = {
+ 0xa007, pci_device_1571_a007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a008 = {
+ 0xa008, pci_device_1571_a008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a009 = {
+ 0xa009, pci_device_1571_a009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a00a = {
+ 0xa00a, pci_device_1571_a00a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a00a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a00b = {
+ 0xa00b, pci_device_1571_a00b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a00b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a00c = {
+ 0xa00c, pci_device_1571_a00c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a00c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a00d = {
+ 0xa00d, pci_device_1571_a00d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a00d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a201 = {
+ 0xa201, pci_device_1571_a201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a202 = {
+ 0xa202, pci_device_1571_a202,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a202,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a203 = {
+ 0xa203, pci_device_1571_a203,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a203,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a204 = {
+ 0xa204, pci_device_1571_a204,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a204,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a205 = {
+ 0xa205, pci_device_1571_a205,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a205,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1571_a206 = {
+ 0xa206, pci_device_1571_a206,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1571_a206,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_157c_8001 = {
+ 0x8001, pci_device_157c_8001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_157c_8001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1592_0781 = {
+ 0x0781, pci_device_1592_0781,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1592_0781,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1592_0782 = {
+ 0x0782, pci_device_1592_0782,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1592_0782,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1592_0783 = {
+ 0x0783, pci_device_1592_0783,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1592_0783,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1592_0785 = {
+ 0x0785, pci_device_1592_0785,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1592_0785,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1592_0786 = {
+ 0x0786, pci_device_1592_0786,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1592_0786,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1592_0787 = {
+ 0x0787, pci_device_1592_0787,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1592_0787,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1592_0788 = {
+ 0x0788, pci_device_1592_0788,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1592_0788,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1592_078a = {
+ 0x078a, pci_device_1592_078a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1592_078a,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_15a2_0001 = {
+ 0x0001, pci_device_15a2_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_15a2_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_15ad_0710 = {
+ 0x0710, pci_device_15ad_0710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_15ad_0710,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_15b3_5274 = {
+ 0x5274, pci_device_15b3_5274,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_15b3_5274,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_15bc_2929 = {
+ 0x2929, pci_device_15bc_2929,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_15bc_2929,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_15c7_0349 = {
+ 0x0349, pci_device_15c7_0349,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_15c7_0349,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_15dc_0001 = {
+ 0x0001, pci_device_15dc_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_15dc_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_15e8_0130 = {
+ 0x0130, pci_device_15e8_0130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_15e8_0130,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1619_0400 = {
+ 0x0400, pci_device_1619_0400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1619_0400,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1619_0440 = {
+ 0x0440, pci_device_1619_0440,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1619_0440,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1629_1003 = {
+ 0x1003, pci_device_1629_1003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1629_1003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1629_2002 = {
+ 0x2002, pci_device_1629_2002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1629_2002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1638_1100 = {
+ 0x1100, pci_device_1638_1100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1638_1100,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_163c_5449 = {
+ 0x5449, pci_device_163c_5449,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_163c_5449,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_165a_c100 = {
+ 0xc100, pci_device_165a_c100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_165a_c100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_165a_d200 = {
+ 0xd200, pci_device_165a_d200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_165a_d200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_165a_d300 = {
+ 0xd300, pci_device_165a_d300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_165a_d300,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_16ab_1102 = {
+ 0x1102, pci_device_16ab_1102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_16ab_1102,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_16ec_3685 = {
+ 0x3685, pci_device_16ec_3685,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_16ec_3685,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_173b_03e8 = {
+ 0x03e8, pci_device_173b_03e8,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_173b_03e8,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_173b_03ea = {
+ 0x03ea, pci_device_173b_03ea,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_173b_03ea,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1743_8139 = {
+ 0x8139, pci_device_1743_8139,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1743_8139,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1796_0001 = {
+ 0x0001, pci_device_1796_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1796_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1796_0002 = {
+ 0x0002, pci_device_1796_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1796_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1796_0003 = {
+ 0x0003, pci_device_1796_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1796_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1796_0004 = {
+ 0x0004, pci_device_1796_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1796_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1796_0005 = {
+ 0x0005, pci_device_1796_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1796_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1796_0006 = {
+ 0x0006, pci_device_1796_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1796_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_17cc_2280 = {
+ 0x2280, pci_device_17cc_2280,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_17cc_2280,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1813_4000 = {
+ 0x4000, pci_device_1813_4000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1813_4000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1813_4100 = {
+ 0x4100, pci_device_1813_4100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1813_4100,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1888_0301 = {
+ 0x0301, pci_device_1888_0301,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1888_0301,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1888_0601 = {
+ 0x0601, pci_device_1888_0601,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1888_0601,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1888_0710 = {
+ 0x0710, pci_device_1888_0710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1888_0710,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1888_0720 = {
+ 0x0720, pci_device_1888_0720,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1888_0720,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1a08_0000 = {
+ 0x0000, pci_device_1a08_0000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1a08_0000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1c1c_0001 = {
+ 0x0001, pci_device_1c1c_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1c1c_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1d44_a400 = {
+ 0xa400, pci_device_1d44_a400,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1d44_a400,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_1de1_0391 = {
+ 0x0391, pci_device_1de1_0391,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1de1_0391,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1de1_2020 = {
+ 0x2020, pci_device_1de1_2020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1de1_2020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1de1_690c = {
+ 0x690c, pci_device_1de1_690c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1de1_690c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_1de1_dc29 = {
+ 0xdc29, pci_device_1de1_dc29,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_1de1_dc29,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_2348_2010 = {
+ 0x2010, pci_device_2348_2010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_2348_2010,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_3388_0013 = {
+ 0x0013, pci_device_3388_0013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3388_0013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3388_0014 = {
+ 0x0014, pci_device_3388_0014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3388_0014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3388_0021 = {
+ 0x0021, pci_device_3388_0021,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3388_0021,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3388_8011 = {
+ 0x8011, pci_device_3388_8011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3388_8011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3388_8012 = {
+ 0x8012, pci_device_3388_8012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3388_8012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3388_8013 = {
+ 0x8013, pci_device_3388_8013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3388_8013,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_3d3d_0001 = {
+ 0x0001, pci_device_3d3d_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0002 = {
+ 0x0002, pci_device_3d3d_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0003 = {
+ 0x0003, pci_device_3d3d_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0004 = {
+ 0x0004, pci_device_3d3d_0004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0005 = {
+ 0x0005, pci_device_3d3d_0005,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0005,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0006 = {
+ 0x0006, pci_device_3d3d_0006,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0006,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0007 = {
+ 0x0007, pci_device_3d3d_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0008 = {
+ 0x0008, pci_device_3d3d_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0009 = {
+ 0x0009, pci_device_3d3d_0009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_000a = {
+ 0x000a, pci_device_3d3d_000a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_000a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_000c = {
+ 0x000c, pci_device_3d3d_000c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_000c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_0100 = {
+ 0x0100, pci_device_3d3d_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_1004 = {
+ 0x1004, pci_device_3d3d_1004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_1004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_3d04 = {
+ 0x3d04, pci_device_3d3d_3d04,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_3d04,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_3d3d_ffff = {
+ 0xffff, pci_device_3d3d_ffff,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_3d3d_ffff,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_0300 = {
+ 0x0300, pci_device_4005_0300,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_0300,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_0308 = {
+ 0x0308, pci_device_4005_0308,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_0308,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_0309 = {
+ 0x0309, pci_device_4005_0309,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_0309,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_1064 = {
+ 0x1064, pci_device_4005_1064,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_1064,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_2064 = {
+ 0x2064, pci_device_4005_2064,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_2064,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_2128 = {
+ 0x2128, pci_device_4005_2128,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_2128,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_2301 = {
+ 0x2301, pci_device_4005_2301,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_2301,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_2302 = {
+ 0x2302, pci_device_4005_2302,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_2302,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_2303 = {
+ 0x2303, pci_device_4005_2303,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_2303,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_2364 = {
+ 0x2364, pci_device_4005_2364,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_2364,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_2464 = {
+ 0x2464, pci_device_4005_2464,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_2464,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_2501 = {
+ 0x2501, pci_device_4005_2501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_2501,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_4000 = {
+ 0x4000, pci_device_4005_4000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_4000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4005_4710 = {
+ 0x4710, pci_device_4005_4710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4005_4710,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_4033_1360 = {
+ 0x1360, pci_device_4033_1360,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4033_1360,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_416c_0100 = {
+ 0x0100, pci_device_416c_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_416c_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_416c_0200 = {
+ 0x0200, pci_device_416c_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_416c_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_4444_0803 = {
+ 0x0803, pci_device_4444_0803,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4444_0803,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_4916_1960 = {
+ 0x1960, pci_device_4916_1960,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4916_1960,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_4a14_5000 = {
+ 0x5000, pci_device_4a14_5000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4a14_5000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_4d51_0200 = {
+ 0x0200, pci_device_4d51_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4d51_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_4ddc_0100 = {
+ 0x0100, pci_device_4ddc_0100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0801 = {
+ 0x0801, pci_device_4ddc_0801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0802 = {
+ 0x0802, pci_device_4ddc_0802,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0802,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0811 = {
+ 0x0811, pci_device_4ddc_0811,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0811,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0812 = {
+ 0x0812, pci_device_4ddc_0812,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0812,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0881 = {
+ 0x0881, pci_device_4ddc_0881,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0881,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0882 = {
+ 0x0882, pci_device_4ddc_0882,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0882,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0891 = {
+ 0x0891, pci_device_4ddc_0891,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0891,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0892 = {
+ 0x0892, pci_device_4ddc_0892,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0892,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0901 = {
+ 0x0901, pci_device_4ddc_0901,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0901,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0902 = {
+ 0x0902, pci_device_4ddc_0902,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0902,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0903 = {
+ 0x0903, pci_device_4ddc_0903,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0903,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0904 = {
+ 0x0904, pci_device_4ddc_0904,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0904,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0b01 = {
+ 0x0b01, pci_device_4ddc_0b01,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0b01,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0b02 = {
+ 0x0b02, pci_device_4ddc_0b02,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0b02,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0b03 = {
+ 0x0b03, pci_device_4ddc_0b03,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0b03,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_4ddc_0b04 = {
+ 0x0b04, pci_device_4ddc_0b04,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_4ddc_0b04,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_5046_1001 = {
+ 0x1001, pci_device_5046_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5046_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_5053_2010 = {
+ 0x2010, pci_device_5053_2010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5053_2010,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_5145_3031 = {
+ 0x3031, pci_device_5145_3031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5145_3031,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_5301_0001 = {
+ 0x0001, pci_device_5301_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5301_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_5333_0551 = {
+ 0x0551, pci_device_5333_0551,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_0551,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_5631 = {
+ 0x5631, pci_device_5333_5631,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_5631,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8800 = {
+ 0x8800, pci_device_5333_8800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8801 = {
+ 0x8801, pci_device_5333_8801,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8801,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8810 = {
+ 0x8810, pci_device_5333_8810,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8810,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8811 = {
+ 0x8811, pci_device_5333_8811,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8811,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8812 = {
+ 0x8812, pci_device_5333_8812,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8812,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8813 = {
+ 0x8813, pci_device_5333_8813,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8813,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8814 = {
+ 0x8814, pci_device_5333_8814,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8814,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8815 = {
+ 0x8815, pci_device_5333_8815,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8815,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_883d = {
+ 0x883d, pci_device_5333_883d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_883d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8870 = {
+ 0x8870, pci_device_5333_8870,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8870,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8880 = {
+ 0x8880, pci_device_5333_8880,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8880,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8881 = {
+ 0x8881, pci_device_5333_8881,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8881,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8882 = {
+ 0x8882, pci_device_5333_8882,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8882,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8883 = {
+ 0x8883, pci_device_5333_8883,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8883,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88b0 = {
+ 0x88b0, pci_device_5333_88b0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88b0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88b1 = {
+ 0x88b1, pci_device_5333_88b1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88b1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88b2 = {
+ 0x88b2, pci_device_5333_88b2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88b2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88b3 = {
+ 0x88b3, pci_device_5333_88b3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88b3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88c0 = {
+ 0x88c0, pci_device_5333_88c0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88c0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88c1 = {
+ 0x88c1, pci_device_5333_88c1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88c1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88c2 = {
+ 0x88c2, pci_device_5333_88c2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88c2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88c3 = {
+ 0x88c3, pci_device_5333_88c3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88c3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88d0 = {
+ 0x88d0, pci_device_5333_88d0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88d0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88d1 = {
+ 0x88d1, pci_device_5333_88d1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88d1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88d2 = {
+ 0x88d2, pci_device_5333_88d2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88d2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88d3 = {
+ 0x88d3, pci_device_5333_88d3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88d3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88f0 = {
+ 0x88f0, pci_device_5333_88f0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88f0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88f1 = {
+ 0x88f1, pci_device_5333_88f1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88f1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88f2 = {
+ 0x88f2, pci_device_5333_88f2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88f2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_88f3 = {
+ 0x88f3, pci_device_5333_88f3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_88f3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8900 = {
+ 0x8900, pci_device_5333_8900,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8900,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8901 = {
+ 0x8901, pci_device_5333_8901,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8901,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8902 = {
+ 0x8902, pci_device_5333_8902,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8902,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8903 = {
+ 0x8903, pci_device_5333_8903,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8903,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8904 = {
+ 0x8904, pci_device_5333_8904,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8904,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8905 = {
+ 0x8905, pci_device_5333_8905,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8905,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8906 = {
+ 0x8906, pci_device_5333_8906,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8906,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8907 = {
+ 0x8907, pci_device_5333_8907,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8907,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8908 = {
+ 0x8908, pci_device_5333_8908,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8908,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8909 = {
+ 0x8909, pci_device_5333_8909,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8909,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_890a = {
+ 0x890a, pci_device_5333_890a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_890a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_890b = {
+ 0x890b, pci_device_5333_890b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_890b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_890c = {
+ 0x890c, pci_device_5333_890c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_890c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_890d = {
+ 0x890d, pci_device_5333_890d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_890d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_890e = {
+ 0x890e, pci_device_5333_890e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_890e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_890f = {
+ 0x890f, pci_device_5333_890f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_890f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a01 = {
+ 0x8a01, pci_device_5333_8a01,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a01,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a10 = {
+ 0x8a10, pci_device_5333_8a10,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a10,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a13 = {
+ 0x8a13, pci_device_5333_8a13,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a13,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a20 = {
+ 0x8a20, pci_device_5333_8a20,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a20,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a21 = {
+ 0x8a21, pci_device_5333_8a21,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a21,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a22 = {
+ 0x8a22, pci_device_5333_8a22,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a22,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a23 = {
+ 0x8a23, pci_device_5333_8a23,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a23,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a25 = {
+ 0x8a25, pci_device_5333_8a25,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a25,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8a26 = {
+ 0x8a26, pci_device_5333_8a26,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8a26,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c00 = {
+ 0x8c00, pci_device_5333_8c00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c00,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c01 = {
+ 0x8c01, pci_device_5333_8c01,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c01,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c02 = {
+ 0x8c02, pci_device_5333_8c02,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c02,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c03 = {
+ 0x8c03, pci_device_5333_8c03,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c03,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c10 = {
+ 0x8c10, pci_device_5333_8c10,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c10,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c11 = {
+ 0x8c11, pci_device_5333_8c11,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c11,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c12 = {
+ 0x8c12, pci_device_5333_8c12,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c12,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c13 = {
+ 0x8c13, pci_device_5333_8c13,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c13,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c22 = {
+ 0x8c22, pci_device_5333_8c22,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c22,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c24 = {
+ 0x8c24, pci_device_5333_8c24,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c24,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c26 = {
+ 0x8c26, pci_device_5333_8c26,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c26,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c2a = {
+ 0x8c2a, pci_device_5333_8c2a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c2a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c2b = {
+ 0x8c2b, pci_device_5333_8c2b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c2b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c2c = {
+ 0x8c2c, pci_device_5333_8c2c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c2c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c2d = {
+ 0x8c2d, pci_device_5333_8c2d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c2d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c2e = {
+ 0x8c2e, pci_device_5333_8c2e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c2e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8c2f = {
+ 0x8c2f, pci_device_5333_8c2f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8c2f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8d01 = {
+ 0x8d01, pci_device_5333_8d01,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8d01,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8d02 = {
+ 0x8d02, pci_device_5333_8d02,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8d02,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8d03 = {
+ 0x8d03, pci_device_5333_8d03,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8d03,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_8d04 = {
+ 0x8d04, pci_device_5333_8d04,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_8d04,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_9102 = {
+ 0x9102, pci_device_5333_9102,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_9102,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_5333_ca00 = {
+ 0xca00, pci_device_5333_ca00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5333_ca00,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_5455_4458 = {
+ 0x4458, pci_device_5455_4458,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5455_4458,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_5544_0001 = {
+ 0x0001, pci_device_5544_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5544_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_5555_0003 = {
+ 0x0003, pci_device_5555_0003,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_5555_0003,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_6374_6773 = {
+ 0x6773, pci_device_6374_6773,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_6374_6773,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_6666_0001 = {
+ 0x0001, pci_device_6666_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_6666_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_6666_0002 = {
+ 0x0002, pci_device_6666_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_6666_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_8008_0010 = {
+ 0x0010, pci_device_8008_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8008_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8008_0011 = {
+ 0x0011, pci_device_8008_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8008_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_8086_0007 = {
+ 0x0007, pci_device_8086_0007,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0007,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0008 = {
+ 0x0008, pci_device_8086_0008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0039 = {
+ 0x0039, pci_device_8086_0039,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0039,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0122 = {
+ 0x0122, pci_device_8086_0122,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0122,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0482 = {
+ 0x0482, pci_device_8086_0482,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0482,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0483 = {
+ 0x0483, pci_device_8086_0483,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0483,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0484 = {
+ 0x0484, pci_device_8086_0484,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0484,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0486 = {
+ 0x0486, pci_device_8086_0486,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0486,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_04a3 = {
+ 0x04a3, pci_device_8086_04a3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_04a3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_04d0 = {
+ 0x04d0, pci_device_8086_04d0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_04d0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0600 = {
+ 0x0600, pci_device_8086_0600,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0600,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0960 = {
+ 0x0960, pci_device_8086_0960,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0960,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0962 = {
+ 0x0962, pci_device_8086_0962,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0962,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_0964 = {
+ 0x0964, pci_device_8086_0964,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_0964,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1000 = {
+ 0x1000, pci_device_8086_1000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1001 = {
+ 0x1001, pci_device_8086_1001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1002 = {
+ 0x1002, pci_device_8086_1002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1002,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1004 = {
+ 0x1004, pci_device_8086_1004,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1004,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1008 = {
+ 0x1008, pci_device_8086_1008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1008,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1009 = {
+ 0x1009, pci_device_8086_1009,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1009,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_100c = {
+ 0x100c, pci_device_8086_100c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_100c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_100d = {
+ 0x100d, pci_device_8086_100d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_100d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_100e = {
+ 0x100e, pci_device_8086_100e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_100e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_100f = {
+ 0x100f, pci_device_8086_100f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_100f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1010 = {
+ 0x1010, pci_device_8086_1010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1011 = {
+ 0x1011, pci_device_8086_1011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1012 = {
+ 0x1012, pci_device_8086_1012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1015 = {
+ 0x1015, pci_device_8086_1015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1015,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1029 = {
+ 0x1029, pci_device_8086_1029,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1029,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1030 = {
+ 0x1030, pci_device_8086_1030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1031 = {
+ 0x1031, pci_device_8086_1031,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1031,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1032 = {
+ 0x1032, pci_device_8086_1032,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1032,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1033 = {
+ 0x1033, pci_device_8086_1033,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1033,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1034 = {
+ 0x1034, pci_device_8086_1034,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1034,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1035 = {
+ 0x1035, pci_device_8086_1035,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1035,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1036 = {
+ 0x1036, pci_device_8086_1036,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1036,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1037 = {
+ 0x1037, pci_device_8086_1037,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1037,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1038 = {
+ 0x1038, pci_device_8086_1038,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1038,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1039 = {
+ 0x1039, pci_device_8086_1039,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1039,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_103a = {
+ 0x103a, pci_device_8086_103a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_103a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_103b = {
+ 0x103b, pci_device_8086_103b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_103b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_103c = {
+ 0x103c, pci_device_8086_103c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_103c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_103d = {
+ 0x103d, pci_device_8086_103d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_103d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_103e = {
+ 0x103e, pci_device_8086_103e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_103e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1040 = {
+ 0x1040, pci_device_8086_1040,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1040,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1059 = {
+ 0x1059, pci_device_8086_1059,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1059,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1130 = {
+ 0x1130, pci_device_8086_1130,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1130,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1131 = {
+ 0x1131, pci_device_8086_1131,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1131,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1132 = {
+ 0x1132, pci_device_8086_1132,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1132,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1161 = {
+ 0x1161, pci_device_8086_1161,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1161,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1162 = {
+ 0x1162, pci_device_8086_1162,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1162,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1200 = {
+ 0x1200, pci_device_8086_1200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1209 = {
+ 0x1209, pci_device_8086_1209,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1209,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1221 = {
+ 0x1221, pci_device_8086_1221,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1221,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1222 = {
+ 0x1222, pci_device_8086_1222,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1222,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1223 = {
+ 0x1223, pci_device_8086_1223,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1223,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1225 = {
+ 0x1225, pci_device_8086_1225,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1225,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1226 = {
+ 0x1226, pci_device_8086_1226,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1226,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1227 = {
+ 0x1227, pci_device_8086_1227,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1227,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1228 = {
+ 0x1228, pci_device_8086_1228,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1228,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1229 = {
+ 0x1229, pci_device_8086_1229,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1229,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_122d = {
+ 0x122d, pci_device_8086_122d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_122d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_122e = {
+ 0x122e, pci_device_8086_122e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_122e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1230 = {
+ 0x1230, pci_device_8086_1230,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1230,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1231 = {
+ 0x1231, pci_device_8086_1231,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1231,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1234 = {
+ 0x1234, pci_device_8086_1234,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1234,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1235 = {
+ 0x1235, pci_device_8086_1235,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1235,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1237 = {
+ 0x1237, pci_device_8086_1237,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1237,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1239 = {
+ 0x1239, pci_device_8086_1239,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1239,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_123b = {
+ 0x123b, pci_device_8086_123b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_123b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_123c = {
+ 0x123c, pci_device_8086_123c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_123c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_123d = {
+ 0x123d, pci_device_8086_123d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_123d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_123f = {
+ 0x123f, pci_device_8086_123f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_123f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1240 = {
+ 0x1240, pci_device_8086_1240,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1240,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_124b = {
+ 0x124b, pci_device_8086_124b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_124b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1250 = {
+ 0x1250, pci_device_8086_1250,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1250,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1360 = {
+ 0x1360, pci_device_8086_1360,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1360,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1361 = {
+ 0x1361, pci_device_8086_1361,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1361,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1460 = {
+ 0x1460, pci_device_8086_1460,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1460,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1461 = {
+ 0x1461, pci_device_8086_1461,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1461,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1462 = {
+ 0x1462, pci_device_8086_1462,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1462,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1960 = {
+ 0x1960, pci_device_8086_1960,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1960,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1962 = {
+ 0x1962, pci_device_8086_1962,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1962,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1a21 = {
+ 0x1a21, pci_device_8086_1a21,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1a21,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1a23 = {
+ 0x1a23, pci_device_8086_1a23,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1a23,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1a24 = {
+ 0x1a24, pci_device_8086_1a24,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1a24,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1a30 = {
+ 0x1a30, pci_device_8086_1a30,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1a30,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_1a31 = {
+ 0x1a31, pci_device_8086_1a31,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_1a31,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2410 = {
+ 0x2410, pci_device_8086_2410,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2410,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2411 = {
+ 0x2411, pci_device_8086_2411,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2411,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2412 = {
+ 0x2412, pci_device_8086_2412,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2412,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2413 = {
+ 0x2413, pci_device_8086_2413,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2413,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2415 = {
+ 0x2415, pci_device_8086_2415,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2415,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2416 = {
+ 0x2416, pci_device_8086_2416,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2416,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2418 = {
+ 0x2418, pci_device_8086_2418,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2418,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2420 = {
+ 0x2420, pci_device_8086_2420,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2420,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2421 = {
+ 0x2421, pci_device_8086_2421,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2421,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2422 = {
+ 0x2422, pci_device_8086_2422,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2422,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2423 = {
+ 0x2423, pci_device_8086_2423,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2423,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2425 = {
+ 0x2425, pci_device_8086_2425,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2425,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2426 = {
+ 0x2426, pci_device_8086_2426,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2426,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2428 = {
+ 0x2428, pci_device_8086_2428,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2428,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2440 = {
+ 0x2440, pci_device_8086_2440,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2440,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2442 = {
+ 0x2442, pci_device_8086_2442,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2442,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2443 = {
+ 0x2443, pci_device_8086_2443,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2443,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2444 = {
+ 0x2444, pci_device_8086_2444,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2444,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2445 = {
+ 0x2445, pci_device_8086_2445,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2445,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2446 = {
+ 0x2446, pci_device_8086_2446,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2446,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2448 = {
+ 0x2448, pci_device_8086_2448,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2448,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2449 = {
+ 0x2449, pci_device_8086_2449,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2449,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_244a = {
+ 0x244a, pci_device_8086_244a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_244a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_244b = {
+ 0x244b, pci_device_8086_244b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_244b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_244c = {
+ 0x244c, pci_device_8086_244c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_244c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_244e = {
+ 0x244e, pci_device_8086_244e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_244e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2450 = {
+ 0x2450, pci_device_8086_2450,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2450,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2452 = {
+ 0x2452, pci_device_8086_2452,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2452,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2453 = {
+ 0x2453, pci_device_8086_2453,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2453,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2459 = {
+ 0x2459, pci_device_8086_2459,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2459,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_245b = {
+ 0x245b, pci_device_8086_245b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_245b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_245d = {
+ 0x245d, pci_device_8086_245d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_245d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_245e = {
+ 0x245e, pci_device_8086_245e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_245e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2480 = {
+ 0x2480, pci_device_8086_2480,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2480,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2482 = {
+ 0x2482, pci_device_8086_2482,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2482,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2483 = {
+ 0x2483, pci_device_8086_2483,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2483,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2484 = {
+ 0x2484, pci_device_8086_2484,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2484,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2485 = {
+ 0x2485, pci_device_8086_2485,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2485,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2486 = {
+ 0x2486, pci_device_8086_2486,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2486,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2487 = {
+ 0x2487, pci_device_8086_2487,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2487,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_248a = {
+ 0x248a, pci_device_8086_248a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_248a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_248b = {
+ 0x248b, pci_device_8086_248b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_248b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_248c = {
+ 0x248c, pci_device_8086_248c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_248c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24c0 = {
+ 0x24c0, pci_device_8086_24c0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24c0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24c2 = {
+ 0x24c2, pci_device_8086_24c2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24c2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24c3 = {
+ 0x24c3, pci_device_8086_24c3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24c3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24c4 = {
+ 0x24c4, pci_device_8086_24c4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24c4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24c5 = {
+ 0x24c5, pci_device_8086_24c5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24c5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24c6 = {
+ 0x24c6, pci_device_8086_24c6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24c6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24c7 = {
+ 0x24c7, pci_device_8086_24c7,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24c7,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24cb = {
+ 0x24cb, pci_device_8086_24cb,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24cb,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_24cd = {
+ 0x24cd, pci_device_8086_24cd,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_24cd,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2500 = {
+ 0x2500, pci_device_8086_2500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2501 = {
+ 0x2501, pci_device_8086_2501,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2501,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_250b = {
+ 0x250b, pci_device_8086_250b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_250b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_250f = {
+ 0x250f, pci_device_8086_250f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_250f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2520 = {
+ 0x2520, pci_device_8086_2520,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2520,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2521 = {
+ 0x2521, pci_device_8086_2521,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2521,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2530 = {
+ 0x2530, pci_device_8086_2530,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2530,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2531 = {
+ 0x2531, pci_device_8086_2531,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2531,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2532 = {
+ 0x2532, pci_device_8086_2532,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2532,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2533 = {
+ 0x2533, pci_device_8086_2533,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2533,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2534 = {
+ 0x2534, pci_device_8086_2534,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2534,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2540 = {
+ 0x2540, pci_device_8086_2540,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2540,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2541 = {
+ 0x2541, pci_device_8086_2541,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2541,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2543 = {
+ 0x2543, pci_device_8086_2543,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2543,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2544 = {
+ 0x2544, pci_device_8086_2544,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2544,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2545 = {
+ 0x2545, pci_device_8086_2545,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2545,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2546 = {
+ 0x2546, pci_device_8086_2546,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2546,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2547 = {
+ 0x2547, pci_device_8086_2547,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2547,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2548 = {
+ 0x2548, pci_device_8086_2548,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2548,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2560 = {
+ 0x2560, pci_device_8086_2560,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2560,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2561 = {
+ 0x2561, pci_device_8086_2561,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2561,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2562 = {
+ 0x2562, pci_device_8086_2562,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2562,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2570 = {
+ 0x2570, pci_device_8086_2570,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2570,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_2572 = {
+ 0x2572, pci_device_8086_2572,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_2572,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_3092 = {
+ 0x3092, pci_device_8086_3092,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3092,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_3575 = {
+ 0x3575, pci_device_8086_3575,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3575,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_3576 = {
+ 0x3576, pci_device_8086_3576,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3576,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_3577 = {
+ 0x3577, pci_device_8086_3577,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3577,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_3578 = {
+ 0x3578, pci_device_8086_3578,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3578,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_3580 = {
+ 0x3580, pci_device_8086_3580,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3580,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_3582 = {
+ 0x3582, pci_device_8086_3582,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_3582,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_5200 = {
+ 0x5200, pci_device_8086_5200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_5200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_5201 = {
+ 0x5201, pci_device_8086_5201,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_5201,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_530d = {
+ 0x530d, pci_device_8086_530d,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_530d,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7000 = {
+ 0x7000, pci_device_8086_7000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7010 = {
+ 0x7010, pci_device_8086_7010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7020 = {
+ 0x7020, pci_device_8086_7020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7030 = {
+ 0x7030, pci_device_8086_7030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7100 = {
+ 0x7100, pci_device_8086_7100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7110 = {
+ 0x7110, pci_device_8086_7110,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7110,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7111 = {
+ 0x7111, pci_device_8086_7111,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7111,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7112 = {
+ 0x7112, pci_device_8086_7112,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7112,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7113 = {
+ 0x7113, pci_device_8086_7113,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7113,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7120 = {
+ 0x7120, pci_device_8086_7120,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7120,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7121 = {
+ 0x7121, pci_device_8086_7121,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7121,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7122 = {
+ 0x7122, pci_device_8086_7122,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7122,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7123 = {
+ 0x7123, pci_device_8086_7123,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7123,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7124 = {
+ 0x7124, pci_device_8086_7124,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7124,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7125 = {
+ 0x7125, pci_device_8086_7125,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7125,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7126 = {
+ 0x7126, pci_device_8086_7126,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7126,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7128 = {
+ 0x7128, pci_device_8086_7128,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7128,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_712a = {
+ 0x712a, pci_device_8086_712a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_712a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7180 = {
+ 0x7180, pci_device_8086_7180,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7180,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7181 = {
+ 0x7181, pci_device_8086_7181,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7181,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7190 = {
+ 0x7190, pci_device_8086_7190,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7190,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7191 = {
+ 0x7191, pci_device_8086_7191,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7191,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7192 = {
+ 0x7192, pci_device_8086_7192,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7192,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7194 = {
+ 0x7194, pci_device_8086_7194,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7194,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7195 = {
+ 0x7195, pci_device_8086_7195,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7195,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7196 = {
+ 0x7196, pci_device_8086_7196,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7196,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7198 = {
+ 0x7198, pci_device_8086_7198,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7198,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7199 = {
+ 0x7199, pci_device_8086_7199,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7199,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_719a = {
+ 0x719a, pci_device_8086_719a,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_719a,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_719b = {
+ 0x719b, pci_device_8086_719b,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_719b,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_71a0 = {
+ 0x71a0, pci_device_8086_71a0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_71a0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_71a1 = {
+ 0x71a1, pci_device_8086_71a1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_71a1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_71a2 = {
+ 0x71a2, pci_device_8086_71a2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_71a2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7600 = {
+ 0x7600, pci_device_8086_7600,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7600,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7601 = {
+ 0x7601, pci_device_8086_7601,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7601,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7602 = {
+ 0x7602, pci_device_8086_7602,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7602,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7603 = {
+ 0x7603, pci_device_8086_7603,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7603,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_7800 = {
+ 0x7800, pci_device_8086_7800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_7800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84c4 = {
+ 0x84c4, pci_device_8086_84c4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84c4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84c5 = {
+ 0x84c5, pci_device_8086_84c5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84c5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84ca = {
+ 0x84ca, pci_device_8086_84ca,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84ca,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84cb = {
+ 0x84cb, pci_device_8086_84cb,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84cb,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84e0 = {
+ 0x84e0, pci_device_8086_84e0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84e0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84e1 = {
+ 0x84e1, pci_device_8086_84e1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84e1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84e2 = {
+ 0x84e2, pci_device_8086_84e2,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84e2,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84e3 = {
+ 0x84e3, pci_device_8086_84e3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84e3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84e4 = {
+ 0x84e4, pci_device_8086_84e4,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84e4,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84e6 = {
+ 0x84e6, pci_device_8086_84e6,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84e6,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_84ea = {
+ 0x84ea, pci_device_8086_84ea,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_84ea,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_9621 = {
+ 0x9621, pci_device_8086_9621,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_9621,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_9622 = {
+ 0x9622, pci_device_8086_9622,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_9622,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_9641 = {
+ 0x9641, pci_device_8086_9641,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_9641,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_96a1 = {
+ 0x96a1, pci_device_8086_96a1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_96a1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_b152 = {
+ 0xb152, pci_device_8086_b152,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_b152,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_b154 = {
+ 0xb154, pci_device_8086_b154,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_b154,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_b555 = {
+ 0xb555, pci_device_8086_b555,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_b555,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_8086_ffff = {
+ 0xffff, pci_device_8086_ffff,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8086_ffff,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_8800_2008 = {
+ 0x2008, pci_device_8800_2008,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8800_2008,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_8e2e_3000 = {
+ 0x3000, pci_device_8e2e_3000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_8e2e_3000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_9004_1078 = {
+ 0x1078, pci_device_9004_1078,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_1078,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_1160 = {
+ 0x1160, pci_device_9004_1160,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_1160,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_2178 = {
+ 0x2178, pci_device_9004_2178,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_2178,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_3860 = {
+ 0x3860, pci_device_9004_3860,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_3860,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_3b78 = {
+ 0x3b78, pci_device_9004_3b78,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_3b78,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5075 = {
+ 0x5075, pci_device_9004_5075,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5075,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5078 = {
+ 0x5078, pci_device_9004_5078,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5078,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5175 = {
+ 0x5175, pci_device_9004_5175,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5175,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5178 = {
+ 0x5178, pci_device_9004_5178,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5178,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5275 = {
+ 0x5275, pci_device_9004_5275,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5275,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5278 = {
+ 0x5278, pci_device_9004_5278,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5278,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5375 = {
+ 0x5375, pci_device_9004_5375,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5375,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5378 = {
+ 0x5378, pci_device_9004_5378,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5378,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5475 = {
+ 0x5475, pci_device_9004_5475,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5475,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5478 = {
+ 0x5478, pci_device_9004_5478,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5478,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5575 = {
+ 0x5575, pci_device_9004_5575,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5575,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5578 = {
+ 0x5578, pci_device_9004_5578,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5578,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5647 = {
+ 0x5647, pci_device_9004_5647,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5647,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5675 = {
+ 0x5675, pci_device_9004_5675,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5675,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5678 = {
+ 0x5678, pci_device_9004_5678,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5678,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5775 = {
+ 0x5775, pci_device_9004_5775,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5775,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5778 = {
+ 0x5778, pci_device_9004_5778,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5778,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5800 = {
+ 0x5800, pci_device_9004_5800,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5800,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5900 = {
+ 0x5900, pci_device_9004_5900,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5900,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_5905 = {
+ 0x5905, pci_device_9004_5905,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_5905,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6038 = {
+ 0x6038, pci_device_9004_6038,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6038,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6075 = {
+ 0x6075, pci_device_9004_6075,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6075,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6078 = {
+ 0x6078, pci_device_9004_6078,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6078,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6178 = {
+ 0x6178, pci_device_9004_6178,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6178,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6278 = {
+ 0x6278, pci_device_9004_6278,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6278,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6378 = {
+ 0x6378, pci_device_9004_6378,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6378,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6478 = {
+ 0x6478, pci_device_9004_6478,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6478,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6578 = {
+ 0x6578, pci_device_9004_6578,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6578,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6678 = {
+ 0x6678, pci_device_9004_6678,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6678,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6778 = {
+ 0x6778, pci_device_9004_6778,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6778,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_6915 = {
+ 0x6915, pci_device_9004_6915,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_6915,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7078 = {
+ 0x7078, pci_device_9004_7078,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7078,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7178 = {
+ 0x7178, pci_device_9004_7178,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7178,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7278 = {
+ 0x7278, pci_device_9004_7278,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7278,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7378 = {
+ 0x7378, pci_device_9004_7378,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7378,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7478 = {
+ 0x7478, pci_device_9004_7478,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7478,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7578 = {
+ 0x7578, pci_device_9004_7578,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7578,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7678 = {
+ 0x7678, pci_device_9004_7678,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7678,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7778 = {
+ 0x7778, pci_device_9004_7778,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7778,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7810 = {
+ 0x7810, pci_device_9004_7810,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7810,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7815 = {
+ 0x7815, pci_device_9004_7815,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7815,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7850 = {
+ 0x7850, pci_device_9004_7850,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7850,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7855 = {
+ 0x7855, pci_device_9004_7855,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7855,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7860 = {
+ 0x7860, pci_device_9004_7860,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7860,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7870 = {
+ 0x7870, pci_device_9004_7870,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7870,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7871 = {
+ 0x7871, pci_device_9004_7871,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7871,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7872 = {
+ 0x7872, pci_device_9004_7872,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7872,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7873 = {
+ 0x7873, pci_device_9004_7873,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7873,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7874 = {
+ 0x7874, pci_device_9004_7874,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7874,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7880 = {
+ 0x7880, pci_device_9004_7880,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7880,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7890 = {
+ 0x7890, pci_device_9004_7890,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7890,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7891 = {
+ 0x7891, pci_device_9004_7891,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7891,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7892 = {
+ 0x7892, pci_device_9004_7892,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7892,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7893 = {
+ 0x7893, pci_device_9004_7893,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7893,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7894 = {
+ 0x7894, pci_device_9004_7894,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7894,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7895 = {
+ 0x7895, pci_device_9004_7895,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7895,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7896 = {
+ 0x7896, pci_device_9004_7896,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7896,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_7897 = {
+ 0x7897, pci_device_9004_7897,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_7897,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8078 = {
+ 0x8078, pci_device_9004_8078,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8078,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8178 = {
+ 0x8178, pci_device_9004_8178,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8178,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8278 = {
+ 0x8278, pci_device_9004_8278,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8278,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8378 = {
+ 0x8378, pci_device_9004_8378,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8378,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8478 = {
+ 0x8478, pci_device_9004_8478,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8478,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8578 = {
+ 0x8578, pci_device_9004_8578,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8578,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8678 = {
+ 0x8678, pci_device_9004_8678,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8678,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8778 = {
+ 0x8778, pci_device_9004_8778,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8778,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8878 = {
+ 0x8878, pci_device_9004_8878,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8878,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_8b78 = {
+ 0x8b78, pci_device_9004_8b78,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_8b78,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9004_ec78 = {
+ 0xec78, pci_device_9004_ec78,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9004_ec78,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_9005_0010 = {
+ 0x0010, pci_device_9005_0010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0011 = {
+ 0x0011, pci_device_9005_0011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0013 = {
+ 0x0013, pci_device_9005_0013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_001f = {
+ 0x001f, pci_device_9005_001f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_001f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0020 = {
+ 0x0020, pci_device_9005_0020,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0020,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_002f = {
+ 0x002f, pci_device_9005_002f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_002f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0030 = {
+ 0x0030, pci_device_9005_0030,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0030,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_003f = {
+ 0x003f, pci_device_9005_003f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_003f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0050 = {
+ 0x0050, pci_device_9005_0050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0051 = {
+ 0x0051, pci_device_9005_0051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0051,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0053 = {
+ 0x0053, pci_device_9005_0053,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0053,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_005f = {
+ 0x005f, pci_device_9005_005f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_005f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0080 = {
+ 0x0080, pci_device_9005_0080,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0080,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0081 = {
+ 0x0081, pci_device_9005_0081,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0081,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0083 = {
+ 0x0083, pci_device_9005_0083,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0083,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_008f = {
+ 0x008f, pci_device_9005_008f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_008f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_00c0 = {
+ 0x00c0, pci_device_9005_00c0,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_00c0,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_00c1 = {
+ 0x00c1, pci_device_9005_00c1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_00c1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_00c3 = {
+ 0x00c3, pci_device_9005_00c3,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_00c3,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_00c5 = {
+ 0x00c5, pci_device_9005_00c5,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_00c5,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_00cf = {
+ 0x00cf, pci_device_9005_00cf,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_00cf,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0250 = {
+ 0x0250, pci_device_9005_0250,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0250,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_0285 = {
+ 0x0285, pci_device_9005_0285,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_0285,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8000 = {
+ 0x8000, pci_device_9005_8000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8000,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_800f = {
+ 0x800f, pci_device_9005_800f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_800f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8010 = {
+ 0x8010, pci_device_9005_8010,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8010,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8011 = {
+ 0x8011, pci_device_9005_8011,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8011,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8012 = {
+ 0x8012, pci_device_9005_8012,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8012,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8013 = {
+ 0x8013, pci_device_9005_8013,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8013,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8014 = {
+ 0x8014, pci_device_9005_8014,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8014,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_801e = {
+ 0x801e, pci_device_9005_801e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_801e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_801f = {
+ 0x801f, pci_device_9005_801f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_801f,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8090 = {
+ 0x8090, pci_device_9005_8090,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8090,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8091 = {
+ 0x8091, pci_device_9005_8091,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8091,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8092 = {
+ 0x8092, pci_device_9005_8092,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8092,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8093 = {
+ 0x8093, pci_device_9005_8093,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8093,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_8094 = {
+ 0x8094, pci_device_9005_8094,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_8094,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_809e = {
+ 0x809e, pci_device_9005_809e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_809e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9005_809f = {
+ 0x809f, pci_device_9005_809f,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9005_809f,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_907f_2015 = {
+ 0x2015, pci_device_907f_2015,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_907f_2015,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_9412_6565 = {
+ 0x6565, pci_device_9412_6565,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9412_6565,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_9699_6565 = {
+ 0x6565, pci_device_9699_6565,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9699_6565,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_9710_9815 = {
+ 0x9815, pci_device_9710_9815,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9710_9815,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_9710_9835 = {
+ 0x9835, pci_device_9710_9835,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_9710_9835,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_cddd_0101 = {
+ 0x0101, pci_device_cddd_0101,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_cddd_0101,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_cddd_0200 = {
+ 0x0200, pci_device_cddd_0200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_cddd_0200,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_d4d4_0601 = {
+ 0x0601, pci_device_d4d4_0601,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_d4d4_0601,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_e000_e000 = {
+ 0xe000, pci_device_e000_e000,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_e000_e000,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_e159_0001 = {
+ 0x0001, pci_device_e159_0001,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_e159_0001,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_e159_0002 = {
+ 0x0002, pci_device_e159_0002,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_e159_0002,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_ea60_9896 = {
+ 0x9896, pci_device_ea60_9896,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ea60_9896,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_ea60_9897 = {
+ 0x9897, pci_device_ea60_9897,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ea60_9897,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_ea60_9898 = {
+ 0x9898, pci_device_ea60_9898,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ea60_9898,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_eace_3100 = {
+ 0x3100, pci_device_eace_3100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_3100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_3200 = {
+ 0x3200, pci_device_eace_3200,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_3200,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_320e = {
+ 0x320e, pci_device_eace_320e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_320e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_340e = {
+ 0x340e, pci_device_eace_340e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_340e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_341e = {
+ 0x341e, pci_device_eace_341e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_341e,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_3500 = {
+ 0x3500, pci_device_eace_3500,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_3500,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_351c = {
+ 0x351c, pci_device_eace_351c,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_351c,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_4100 = {
+ 0x4100, pci_device_eace_4100,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_4100,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_4110 = {
+ 0x4110, pci_device_eace_4110,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_4110,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_4220 = {
+ 0x4220, pci_device_eace_4220,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_4220,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_eace_422e = {
+ 0x422e, pci_device_eace_422e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_eace_422e,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_ec80_ec00 = {
+ 0xec00, pci_device_ec80_ec00,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ec80_ec00,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_ecc0_0050 = {
+ 0x0050, pci_device_ecc0_0050,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ecc0_0050,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_ecc0_0051 = {
+ 0x0051, pci_device_ecc0_0051,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ecc0_0051,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_ecc0_0060 = {
+ 0x0060, pci_device_ecc0_0060,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ecc0_0060,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_ecc0_0070 = {
+ 0x0070, pci_device_ecc0_0070,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ecc0_0070,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_ecc0_0071 = {
+ 0x0071, pci_device_ecc0_0071,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ecc0_0071,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_ecc0_0072 = {
+ 0x0072, pci_device_ecc0_0072,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ecc0_0072,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_ecc0_0080 = {
+ 0x0080, pci_device_ecc0_0080,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_ecc0_0080,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+static const pciDeviceInfo pci_dev_info_edd8_a091 = {
+ 0xa091, pci_device_edd8_a091,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_edd8_a091,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_edd8_a099 = {
+ 0xa099, pci_device_edd8_a099,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_edd8_a099,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_edd8_a0a1 = {
+ 0xa0a1, pci_device_edd8_a0a1,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_edd8_a0a1,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_edd8_a0a9 = {
+ 0xa0a9, pci_device_edd8_a0a9,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_edd8_a0a9,
+#else
+ NULL,
+#endif
+ 0
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_f1d0_cafe = {
+ 0xcafe, pci_device_f1d0_cafe,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_f1d0_cafe,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_f1d0_efac = {
+ 0xefac, pci_device_f1d0_efac,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_f1d0_efac,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_f1d0_facd = {
+ 0xfacd, pci_device_f1d0_facd,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_f1d0_facd,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_feda_a0fa = {
+ 0xa0fa, pci_device_feda_a0fa,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_feda_a0fa,
+#else
+ NULL,
+#endif
+ 0
+};
+static const pciDeviceInfo pci_dev_info_feda_a10e = {
+ 0xa10e, pci_device_feda_a10e,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_feda_a10e,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo pci_dev_info_fffe_0710 = {
+ 0x0710, pci_device_fffe_0710,
+#ifdef INIT_SUBSYS_INFO
+ pci_ss_list_fffe_0710,
+#else
+ NULL,
+#endif
+ 0
+};
+#endif
+#define pci_dev_list_0000 NULL
+#define pci_dev_list_001a NULL
+#define pci_dev_list_0033 NULL
+#define pci_dev_list_003d NULL
+#define pci_dev_list_0059 NULL
+#define pci_dev_list_0070 NULL
+#define pci_dev_list_0100 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_0675[] = {
+ &pci_dev_info_0675_1700,
+ &pci_dev_info_0675_1702,
+ NULL
+};
+#endif
+#define pci_dev_list_0925 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_09c1[] = {
+ &pci_dev_info_09c1_0704,
+ NULL
+};
+#endif
+#define pci_dev_list_0a89 NULL
+static const pciDeviceInfo *pci_dev_list_0e11[] = {
+ &pci_dev_info_0e11_0001,
+ &pci_dev_info_0e11_0002,
+ &pci_dev_info_0e11_0049,
+ &pci_dev_info_0e11_004a,
+ &pci_dev_info_0e11_0508,
+ &pci_dev_info_0e11_1000,
+ &pci_dev_info_0e11_2000,
+ &pci_dev_info_0e11_3032,
+ &pci_dev_info_0e11_3033,
+ &pci_dev_info_0e11_3034,
+ &pci_dev_info_0e11_4000,
+ &pci_dev_info_0e11_6010,
+ &pci_dev_info_0e11_7020,
+ &pci_dev_info_0e11_a0ec,
+ &pci_dev_info_0e11_a0f0,
+ &pci_dev_info_0e11_a0f3,
+ &pci_dev_info_0e11_a0f7,
+ &pci_dev_info_0e11_a0f8,
+ &pci_dev_info_0e11_a0fc,
+ &pci_dev_info_0e11_ae10,
+ &pci_dev_info_0e11_ae29,
+ &pci_dev_info_0e11_ae2a,
+ &pci_dev_info_0e11_ae2b,
+ &pci_dev_info_0e11_ae31,
+ &pci_dev_info_0e11_ae32,
+ &pci_dev_info_0e11_ae33,
+ &pci_dev_info_0e11_ae34,
+ &pci_dev_info_0e11_ae35,
+ &pci_dev_info_0e11_ae40,
+ &pci_dev_info_0e11_ae43,
+ &pci_dev_info_0e11_ae69,
+ &pci_dev_info_0e11_ae6c,
+ &pci_dev_info_0e11_ae6d,
+ &pci_dev_info_0e11_b011,
+ &pci_dev_info_0e11_b012,
+ &pci_dev_info_0e11_b01e,
+ &pci_dev_info_0e11_b01f,
+ &pci_dev_info_0e11_b02f,
+ &pci_dev_info_0e11_b030,
+ &pci_dev_info_0e11_b04a,
+ &pci_dev_info_0e11_b060,
+ &pci_dev_info_0e11_b0c6,
+ &pci_dev_info_0e11_b0c7,
+ &pci_dev_info_0e11_b0d7,
+ &pci_dev_info_0e11_b0dd,
+ &pci_dev_info_0e11_b0de,
+ &pci_dev_info_0e11_b0df,
+ &pci_dev_info_0e11_b0e0,
+ &pci_dev_info_0e11_b0e1,
+ &pci_dev_info_0e11_b123,
+ &pci_dev_info_0e11_b134,
+ &pci_dev_info_0e11_b13c,
+ &pci_dev_info_0e11_b144,
+ &pci_dev_info_0e11_b163,
+ &pci_dev_info_0e11_b164,
+ &pci_dev_info_0e11_b178,
+ &pci_dev_info_0e11_b1a4,
+ &pci_dev_info_0e11_f130,
+ &pci_dev_info_0e11_f150,
+ NULL
+};
+#define pci_dev_list_0e55 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1000[] = {
+ &pci_dev_info_1000_0001,
+ &pci_dev_info_1000_0002,
+ &pci_dev_info_1000_0003,
+ &pci_dev_info_1000_0004,
+ &pci_dev_info_1000_0005,
+ &pci_dev_info_1000_0006,
+ &pci_dev_info_1000_000a,
+ &pci_dev_info_1000_000b,
+ &pci_dev_info_1000_000c,
+ &pci_dev_info_1000_000d,
+ &pci_dev_info_1000_000f,
+ &pci_dev_info_1000_0010,
+ &pci_dev_info_1000_0012,
+ &pci_dev_info_1000_0013,
+ &pci_dev_info_1000_0020,
+ &pci_dev_info_1000_0021,
+ &pci_dev_info_1000_0030,
+ &pci_dev_info_1000_0040,
+ &pci_dev_info_1000_008f,
+ &pci_dev_info_1000_0621,
+ &pci_dev_info_1000_0622,
+ &pci_dev_info_1000_0623,
+ &pci_dev_info_1000_0624,
+ &pci_dev_info_1000_0625,
+ &pci_dev_info_1000_0626,
+ &pci_dev_info_1000_0627,
+ &pci_dev_info_1000_0628,
+ &pci_dev_info_1000_0629,
+ &pci_dev_info_1000_0701,
+ &pci_dev_info_1000_0702,
+ &pci_dev_info_1000_0901,
+ &pci_dev_info_1000_1000,
+ &pci_dev_info_1000_1960,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1001[] = {
+ &pci_dev_info_1001_0010,
+ &pci_dev_info_1001_0011,
+ &pci_dev_info_1001_0012,
+ &pci_dev_info_1001_0013,
+ &pci_dev_info_1001_0014,
+ &pci_dev_info_1001_0015,
+ &pci_dev_info_1001_0016,
+ &pci_dev_info_1001_0017,
+ &pci_dev_info_1001_9100,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_1002[] = {
+ &pci_dev_info_1002_4144,
+ &pci_dev_info_1002_4145,
+ &pci_dev_info_1002_4146,
+ &pci_dev_info_1002_4147,
+ &pci_dev_info_1002_4158,
+ &pci_dev_info_1002_4242,
+ &pci_dev_info_1002_4336,
+ &pci_dev_info_1002_4337,
+ &pci_dev_info_1002_4354,
+ &pci_dev_info_1002_4358,
+ &pci_dev_info_1002_4554,
+ &pci_dev_info_1002_4654,
+ &pci_dev_info_1002_4742,
+ &pci_dev_info_1002_4744,
+ &pci_dev_info_1002_4747,
+ &pci_dev_info_1002_4749,
+ &pci_dev_info_1002_474c,
+ &pci_dev_info_1002_474d,
+ &pci_dev_info_1002_474e,
+ &pci_dev_info_1002_474f,
+ &pci_dev_info_1002_4750,
+ &pci_dev_info_1002_4751,
+ &pci_dev_info_1002_4752,
+ &pci_dev_info_1002_4753,
+ &pci_dev_info_1002_4754,
+ &pci_dev_info_1002_4755,
+ &pci_dev_info_1002_4756,
+ &pci_dev_info_1002_4757,
+ &pci_dev_info_1002_4758,
+ &pci_dev_info_1002_4759,
+ &pci_dev_info_1002_475a,
+ &pci_dev_info_1002_4964,
+ &pci_dev_info_1002_4965,
+ &pci_dev_info_1002_4966,
+ &pci_dev_info_1002_4967,
+ &pci_dev_info_1002_496e,
+ &pci_dev_info_1002_4c42,
+ &pci_dev_info_1002_4c44,
+ &pci_dev_info_1002_4c45,
+ &pci_dev_info_1002_4c46,
+ &pci_dev_info_1002_4c47,
+ &pci_dev_info_1002_4c49,
+ &pci_dev_info_1002_4c4d,
+ &pci_dev_info_1002_4c4e,
+ &pci_dev_info_1002_4c50,
+ &pci_dev_info_1002_4c51,
+ &pci_dev_info_1002_4c52,
+ &pci_dev_info_1002_4c53,
+ &pci_dev_info_1002_4c54,
+ &pci_dev_info_1002_4c57,
+ &pci_dev_info_1002_4c58,
+ &pci_dev_info_1002_4c59,
+ &pci_dev_info_1002_4c5a,
+ &pci_dev_info_1002_4c64,
+ &pci_dev_info_1002_4c65,
+ &pci_dev_info_1002_4c66,
+ &pci_dev_info_1002_4c67,
+ &pci_dev_info_1002_4d46,
+ &pci_dev_info_1002_4d4c,
+ &pci_dev_info_1002_4e44,
+ &pci_dev_info_1002_4e45,
+ &pci_dev_info_1002_4e46,
+ &pci_dev_info_1002_4e47,
+ &pci_dev_info_1002_4e64,
+ &pci_dev_info_1002_4e65,
+ &pci_dev_info_1002_4e66,
+ &pci_dev_info_1002_4e67,
+ &pci_dev_info_1002_5041,
+ &pci_dev_info_1002_5042,
+ &pci_dev_info_1002_5043,
+ &pci_dev_info_1002_5044,
+ &pci_dev_info_1002_5045,
+ &pci_dev_info_1002_5046,
+ &pci_dev_info_1002_5047,
+ &pci_dev_info_1002_5048,
+ &pci_dev_info_1002_5049,
+ &pci_dev_info_1002_504a,
+ &pci_dev_info_1002_504b,
+ &pci_dev_info_1002_504c,
+ &pci_dev_info_1002_504d,
+ &pci_dev_info_1002_504e,
+ &pci_dev_info_1002_504f,
+ &pci_dev_info_1002_5050,
+ &pci_dev_info_1002_5051,
+ &pci_dev_info_1002_5052,
+ &pci_dev_info_1002_5053,
+ &pci_dev_info_1002_5054,
+ &pci_dev_info_1002_5055,
+ &pci_dev_info_1002_5056,
+ &pci_dev_info_1002_5057,
+ &pci_dev_info_1002_5058,
+ &pci_dev_info_1002_5144,
+ &pci_dev_info_1002_5145,
+ &pci_dev_info_1002_5146,
+ &pci_dev_info_1002_5147,
+ &pci_dev_info_1002_5148,
+ &pci_dev_info_1002_5149,
+ &pci_dev_info_1002_514a,
+ &pci_dev_info_1002_514b,
+ &pci_dev_info_1002_514c,
+ &pci_dev_info_1002_514d,
+ &pci_dev_info_1002_514e,
+ &pci_dev_info_1002_514f,
+ &pci_dev_info_1002_5157,
+ &pci_dev_info_1002_5158,
+ &pci_dev_info_1002_5159,
+ &pci_dev_info_1002_515a,
+ &pci_dev_info_1002_5168,
+ &pci_dev_info_1002_5169,
+ &pci_dev_info_1002_516a,
+ &pci_dev_info_1002_516b,
+ &pci_dev_info_1002_516c,
+ &pci_dev_info_1002_5245,
+ &pci_dev_info_1002_5246,
+ &pci_dev_info_1002_5247,
+ &pci_dev_info_1002_524b,
+ &pci_dev_info_1002_524c,
+ &pci_dev_info_1002_5345,
+ &pci_dev_info_1002_5346,
+ &pci_dev_info_1002_5347,
+ &pci_dev_info_1002_5348,
+ &pci_dev_info_1002_534b,
+ &pci_dev_info_1002_534c,
+ &pci_dev_info_1002_534d,
+ &pci_dev_info_1002_534e,
+ &pci_dev_info_1002_5354,
+ &pci_dev_info_1002_5446,
+ &pci_dev_info_1002_544c,
+ &pci_dev_info_1002_5452,
+ &pci_dev_info_1002_5453,
+ &pci_dev_info_1002_5454,
+ &pci_dev_info_1002_5455,
+ &pci_dev_info_1002_5654,
+ &pci_dev_info_1002_5655,
+ &pci_dev_info_1002_5656,
+ &pci_dev_info_1002_700f,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1003[] = {
+ &pci_dev_info_1003_0201,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1004[] = {
+ &pci_dev_info_1004_0005,
+ &pci_dev_info_1004_0006,
+ &pci_dev_info_1004_0007,
+ &pci_dev_info_1004_0008,
+ &pci_dev_info_1004_0009,
+ &pci_dev_info_1004_000c,
+ &pci_dev_info_1004_000d,
+ &pci_dev_info_1004_0101,
+ &pci_dev_info_1004_0102,
+ &pci_dev_info_1004_0103,
+ &pci_dev_info_1004_0104,
+ &pci_dev_info_1004_0105,
+ &pci_dev_info_1004_0200,
+ &pci_dev_info_1004_0280,
+ &pci_dev_info_1004_0304,
+ &pci_dev_info_1004_0305,
+ &pci_dev_info_1004_0306,
+ &pci_dev_info_1004_0307,
+ &pci_dev_info_1004_0308,
+ &pci_dev_info_1004_0702,
+ &pci_dev_info_1004_0703,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_1005[] = {
+ &pci_dev_info_1005_2064,
+ &pci_dev_info_1005_2128,
+ &pci_dev_info_1005_2301,
+ &pci_dev_info_1005_2302,
+ &pci_dev_info_1005_2364,
+ &pci_dev_info_1005_2464,
+ &pci_dev_info_1005_2501,
+ NULL
+};
+#define pci_dev_list_1006 NULL
+#define pci_dev_list_1007 NULL
+#define pci_dev_list_1008 NULL
+#define pci_dev_list_100a NULL
+static const pciDeviceInfo *pci_dev_list_100b[] = {
+ &pci_dev_info_100b_0001,
+ &pci_dev_info_100b_0002,
+ &pci_dev_info_100b_000e,
+ &pci_dev_info_100b_000f,
+ &pci_dev_info_100b_0011,
+ &pci_dev_info_100b_0012,
+ &pci_dev_info_100b_0020,
+ &pci_dev_info_100b_0022,
+ &pci_dev_info_100b_0500,
+ &pci_dev_info_100b_0501,
+ &pci_dev_info_100b_0502,
+ &pci_dev_info_100b_0503,
+ &pci_dev_info_100b_0504,
+ &pci_dev_info_100b_0505,
+ &pci_dev_info_100b_d001,
+ NULL
+};
+static const pciDeviceInfo *pci_dev_list_100c[] = {
+ &pci_dev_info_100c_3202,
+ &pci_dev_info_100c_3205,
+ &pci_dev_info_100c_3206,
+ &pci_dev_info_100c_3207,
+ &pci_dev_info_100c_3208,
+ &pci_dev_info_100c_4702,
+ NULL
+};
+#define pci_dev_list_100d NULL
+static const pciDeviceInfo *pci_dev_list_100e[] = {
+ &pci_dev_info_100e_9000,
+ &pci_dev_info_100e_9001,
+ &pci_dev_info_100e_9002,
+ &pci_dev_info_100e_9100,
+ NULL
+};
+#define pci_dev_list_1010 NULL
+static const pciDeviceInfo *pci_dev_list_1011[] = {
+ &pci_dev_info_1011_0001,
+ &pci_dev_info_1011_0002,
+ &pci_dev_info_1011_0004,
+ &pci_dev_info_1011_0007,
+ &pci_dev_info_1011_0008,
+ &pci_dev_info_1011_0009,
+ &pci_dev_info_1011_000a,
+ &pci_dev_info_1011_000d,
+ &pci_dev_info_1011_000f,
+ &pci_dev_info_1011_0014,
+ &pci_dev_info_1011_0016,
+ &pci_dev_info_1011_0019,
+ &pci_dev_info_1011_001a,
+ &pci_dev_info_1011_0021,
+ &pci_dev_info_1011_0022,
+ &pci_dev_info_1011_0023,
+ &pci_dev_info_1011_0024,
+ &pci_dev_info_1011_0025,
+ &pci_dev_info_1011_0026,
+ &pci_dev_info_1011_0034,
+ &pci_dev_info_1011_0045,
+ &pci_dev_info_1011_0046,
+ &pci_dev_info_1011_1065,
+ NULL
+};
+#define pci_dev_list_1012 NULL
+static const pciDeviceInfo *pci_dev_list_1013[] = {
+ &pci_dev_info_1013_0038,
+ &pci_dev_info_1013_0040,
+ &pci_dev_info_1013_004c,
+ &pci_dev_info_1013_00a0,
+ &pci_dev_info_1013_00a2,
+ &pci_dev_info_1013_00a4,
+ &pci_dev_info_1013_00a8,
+ &pci_dev_info_1013_00ac,
+ &pci_dev_info_1013_00b0,
+ &pci_dev_info_1013_00b8,
+ &pci_dev_info_1013_00bc,
+ &pci_dev_info_1013_00d0,
+ &pci_dev_info_1013_00d2,
+ &pci_dev_info_1013_00d4,
+ &pci_dev_info_1013_00d5,
+ &pci_dev_info_1013_00d6,
+ &pci_dev_info_1013_00e8,
+ &pci_dev_info_1013_1100,
+ &pci_dev_info_1013_1110,
+ &pci_dev_info_1013_1112,
+ &pci_dev_info_1013_1113,
+ &pci_dev_info_1013_1200,
+ &pci_dev_info_1013_1202,
+ &pci_dev_info_1013_1204,
+ &pci_dev_info_1013_4400,
+ &pci_dev_info_1013_6001,
+ &pci_dev_info_1013_6003,
+ &pci_dev_info_1013_6004,
+ &pci_dev_info_1013_6005,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1014[] = {
+ &pci_dev_info_1014_0002,
+ &pci_dev_info_1014_0005,
+ &pci_dev_info_1014_0007,
+ &pci_dev_info_1014_000a,
+ &pci_dev_info_1014_0017,
+ &pci_dev_info_1014_0018,
+ &pci_dev_info_1014_001b,
+ &pci_dev_info_1014_001c,
+ &pci_dev_info_1014_001d,
+ &pci_dev_info_1014_0020,
+ &pci_dev_info_1014_0022,
+ &pci_dev_info_1014_002d,
+ &pci_dev_info_1014_002e,
+ &pci_dev_info_1014_0036,
+ &pci_dev_info_1014_003a,
+ &pci_dev_info_1014_003e,
+ &pci_dev_info_1014_0045,
+ &pci_dev_info_1014_0046,
+ &pci_dev_info_1014_0047,
+ &pci_dev_info_1014_0048,
+ &pci_dev_info_1014_0049,
+ &pci_dev_info_1014_004e,
+ &pci_dev_info_1014_004f,
+ &pci_dev_info_1014_0050,
+ &pci_dev_info_1014_0053,
+ &pci_dev_info_1014_0057,
+ &pci_dev_info_1014_005c,
+ &pci_dev_info_1014_007c,
+ &pci_dev_info_1014_007d,
+ &pci_dev_info_1014_0090,
+ &pci_dev_info_1014_0095,
+ &pci_dev_info_1014_0096,
+ &pci_dev_info_1014_00a5,
+ &pci_dev_info_1014_00a6,
+ &pci_dev_info_1014_00b7,
+ &pci_dev_info_1014_00be,
+ &pci_dev_info_1014_00dc,
+ &pci_dev_info_1014_00fc,
+ &pci_dev_info_1014_0105,
+ &pci_dev_info_1014_010f,
+ &pci_dev_info_1014_0142,
+ &pci_dev_info_1014_0144,
+ &pci_dev_info_1014_0156,
+ &pci_dev_info_1014_01a7,
+ &pci_dev_info_1014_01bd,
+ &pci_dev_info_1014_0302,
+ &pci_dev_info_1014_ffff,
+ NULL
+};
+#endif
+#define pci_dev_list_1015 NULL
+#define pci_dev_list_1016 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1017[] = {
+ &pci_dev_info_1017_5343,
+ NULL
+};
+#endif
+#define pci_dev_list_1018 NULL
+#define pci_dev_list_1019 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_101a[] = {
+ &pci_dev_info_101a_0005,
+ NULL
+};
+#endif
+#define pci_dev_list_101b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_101c[] = {
+ &pci_dev_info_101c_0193,
+ &pci_dev_info_101c_0196,
+ &pci_dev_info_101c_0197,
+ &pci_dev_info_101c_0296,
+ &pci_dev_info_101c_3193,
+ &pci_dev_info_101c_3197,
+ &pci_dev_info_101c_3296,
+ &pci_dev_info_101c_4296,
+ &pci_dev_info_101c_9710,
+ &pci_dev_info_101c_9712,
+ &pci_dev_info_101c_c24a,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_101e[] = {
+ &pci_dev_info_101e_1960,
+ &pci_dev_info_101e_9010,
+ &pci_dev_info_101e_9030,
+ &pci_dev_info_101e_9031,
+ &pci_dev_info_101e_9032,
+ &pci_dev_info_101e_9033,
+ &pci_dev_info_101e_9040,
+ &pci_dev_info_101e_9060,
+ &pci_dev_info_101e_9063,
+ NULL
+};
+#endif
+#define pci_dev_list_101f NULL
+#define pci_dev_list_1020 NULL
+#define pci_dev_list_1021 NULL
+static const pciDeviceInfo *pci_dev_list_1022[] = {
+ &pci_dev_info_1022_1100,
+ &pci_dev_info_1022_1101,
+ &pci_dev_info_1022_1102,
+ &pci_dev_info_1022_1103,
+ &pci_dev_info_1022_2000,
+ &pci_dev_info_1022_2001,
+ &pci_dev_info_1022_2020,
+ &pci_dev_info_1022_2040,
+ &pci_dev_info_1022_3000,
+ &pci_dev_info_1022_7006,
+ &pci_dev_info_1022_7007,
+ &pci_dev_info_1022_700c,
+ &pci_dev_info_1022_700d,
+ &pci_dev_info_1022_700e,
+ &pci_dev_info_1022_700f,
+ &pci_dev_info_1022_7400,
+ &pci_dev_info_1022_7401,
+ &pci_dev_info_1022_7403,
+ &pci_dev_info_1022_7404,
+ &pci_dev_info_1022_7408,
+ &pci_dev_info_1022_7409,
+ &pci_dev_info_1022_740b,
+ &pci_dev_info_1022_740c,
+ &pci_dev_info_1022_7410,
+ &pci_dev_info_1022_7411,
+ &pci_dev_info_1022_7413,
+ &pci_dev_info_1022_7414,
+ &pci_dev_info_1022_7440,
+ &pci_dev_info_1022_7441,
+ &pci_dev_info_1022_7443,
+ &pci_dev_info_1022_7445,
+ &pci_dev_info_1022_7446,
+ &pci_dev_info_1022_7448,
+ &pci_dev_info_1022_7449,
+ &pci_dev_info_1022_7450,
+ &pci_dev_info_1022_7451,
+ &pci_dev_info_1022_7454,
+ &pci_dev_info_1022_7455,
+ &pci_dev_info_1022_7460,
+ &pci_dev_info_1022_7461,
+ &pci_dev_info_1022_7462,
+ &pci_dev_info_1022_7464,
+ &pci_dev_info_1022_7468,
+ &pci_dev_info_1022_7469,
+ &pci_dev_info_1022_746a,
+ &pci_dev_info_1022_746b,
+ &pci_dev_info_1022_746d,
+ &pci_dev_info_1022_746e,
+ NULL
+};
+static const pciDeviceInfo *pci_dev_list_1023[] = {
+ &pci_dev_info_1023_0194,
+ &pci_dev_info_1023_2000,
+ &pci_dev_info_1023_2001,
+ &pci_dev_info_1023_8400,
+ &pci_dev_info_1023_8420,
+ &pci_dev_info_1023_8500,
+ &pci_dev_info_1023_8520,
+ &pci_dev_info_1023_8620,
+ &pci_dev_info_1023_8820,
+ &pci_dev_info_1023_9320,
+ &pci_dev_info_1023_9350,
+ &pci_dev_info_1023_9360,
+ &pci_dev_info_1023_9382,
+ &pci_dev_info_1023_9383,
+ &pci_dev_info_1023_9385,
+ &pci_dev_info_1023_9386,
+ &pci_dev_info_1023_9388,
+ &pci_dev_info_1023_9397,
+ &pci_dev_info_1023_939a,
+ &pci_dev_info_1023_9420,
+ &pci_dev_info_1023_9430,
+ &pci_dev_info_1023_9440,
+ &pci_dev_info_1023_9460,
+ &pci_dev_info_1023_9470,
+ &pci_dev_info_1023_9520,
+ &pci_dev_info_1023_9525,
+ &pci_dev_info_1023_9540,
+ &pci_dev_info_1023_9660,
+ &pci_dev_info_1023_9680,
+ &pci_dev_info_1023_9682,
+ &pci_dev_info_1023_9683,
+ &pci_dev_info_1023_9685,
+ &pci_dev_info_1023_9750,
+ &pci_dev_info_1023_9753,
+ &pci_dev_info_1023_9754,
+ &pci_dev_info_1023_9759,
+ &pci_dev_info_1023_9783,
+ &pci_dev_info_1023_9785,
+ &pci_dev_info_1023_9850,
+ &pci_dev_info_1023_9880,
+ &pci_dev_info_1023_9910,
+ &pci_dev_info_1023_9930,
+ NULL
+};
+#define pci_dev_list_1024 NULL
+static const pciDeviceInfo *pci_dev_list_1025[] = {
+ &pci_dev_info_1025_1435,
+ &pci_dev_info_1025_1445,
+ &pci_dev_info_1025_1449,
+ &pci_dev_info_1025_1451,
+ &pci_dev_info_1025_1461,
+ &pci_dev_info_1025_1489,
+ &pci_dev_info_1025_1511,
+ &pci_dev_info_1025_1512,
+ &pci_dev_info_1025_1513,
+ &pci_dev_info_1025_1521,
+ &pci_dev_info_1025_1523,
+ &pci_dev_info_1025_1531,
+ &pci_dev_info_1025_1533,
+ &pci_dev_info_1025_1535,
+ &pci_dev_info_1025_1541,
+ &pci_dev_info_1025_1542,
+ &pci_dev_info_1025_1543,
+ &pci_dev_info_1025_1561,
+ &pci_dev_info_1025_1621,
+ &pci_dev_info_1025_1631,
+ &pci_dev_info_1025_1641,
+ &pci_dev_info_1025_1647,
+ &pci_dev_info_1025_3141,
+ &pci_dev_info_1025_3143,
+ &pci_dev_info_1025_3145,
+ &pci_dev_info_1025_3147,
+ &pci_dev_info_1025_3149,
+ &pci_dev_info_1025_3151,
+ &pci_dev_info_1025_3307,
+ &pci_dev_info_1025_3309,
+ &pci_dev_info_1025_3321,
+ &pci_dev_info_1025_5212,
+ &pci_dev_info_1025_5215,
+ &pci_dev_info_1025_5217,
+ &pci_dev_info_1025_5219,
+ &pci_dev_info_1025_5225,
+ &pci_dev_info_1025_5229,
+ &pci_dev_info_1025_5235,
+ &pci_dev_info_1025_5237,
+ &pci_dev_info_1025_5240,
+ &pci_dev_info_1025_5241,
+ &pci_dev_info_1025_5242,
+ &pci_dev_info_1025_5243,
+ &pci_dev_info_1025_5244,
+ &pci_dev_info_1025_5247,
+ &pci_dev_info_1025_5251,
+ &pci_dev_info_1025_5427,
+ &pci_dev_info_1025_5451,
+ &pci_dev_info_1025_5453,
+ &pci_dev_info_1025_7101,
+ NULL
+};
+static const pciDeviceInfo *pci_dev_list_1028[] = {
+ &pci_dev_info_1028_0001,
+ &pci_dev_info_1028_0002,
+ &pci_dev_info_1028_0003,
+ &pci_dev_info_1028_0004,
+ &pci_dev_info_1028_0005,
+ &pci_dev_info_1028_0006,
+ &pci_dev_info_1028_0007,
+ &pci_dev_info_1028_0008,
+ &pci_dev_info_1028_000a,
+ &pci_dev_info_1028_000c,
+ &pci_dev_info_1028_000e,
+ &pci_dev_info_1028_000f,
+ NULL
+};
+#define pci_dev_list_1029 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_102a[] = {
+ &pci_dev_info_102a_0000,
+ &pci_dev_info_102a_0010,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_102b[] = {
+ &pci_dev_info_102b_0010,
+ &pci_dev_info_102b_0518,
+ &pci_dev_info_102b_0519,
+ &pci_dev_info_102b_051a,
+ &pci_dev_info_102b_051b,
+ &pci_dev_info_102b_051e,
+ &pci_dev_info_102b_051f,
+ &pci_dev_info_102b_0520,
+ &pci_dev_info_102b_0521,
+ &pci_dev_info_102b_0525,
+ &pci_dev_info_102b_0527,
+ &pci_dev_info_102b_0d10,
+ &pci_dev_info_102b_1000,
+ &pci_dev_info_102b_1001,
+ &pci_dev_info_102b_2007,
+ &pci_dev_info_102b_2527,
+ &pci_dev_info_102b_4536,
+ &pci_dev_info_102b_6573,
+ NULL
+};
+static const pciDeviceInfo *pci_dev_list_102c[] = {
+ &pci_dev_info_102c_00b8,
+ &pci_dev_info_102c_00c0,
+ &pci_dev_info_102c_00d0,
+ &pci_dev_info_102c_00d8,
+ &pci_dev_info_102c_00dc,
+ &pci_dev_info_102c_00e0,
+ &pci_dev_info_102c_00e4,
+ &pci_dev_info_102c_00e5,
+ &pci_dev_info_102c_00f0,
+ &pci_dev_info_102c_00f4,
+ &pci_dev_info_102c_00f5,
+ &pci_dev_info_102c_0c30,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_102d[] = {
+ &pci_dev_info_102d_50dc,
+ NULL
+};
+#endif
+#define pci_dev_list_102e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_102f[] = {
+ &pci_dev_info_102f_0009,
+ &pci_dev_info_102f_0020,
+ NULL
+};
+#endif
+#define pci_dev_list_1030 NULL
+static const pciDeviceInfo *pci_dev_list_1031[] = {
+ &pci_dev_info_1031_5601,
+ &pci_dev_info_1031_5607,
+ &pci_dev_info_1031_5631,
+ &pci_dev_info_1031_6057,
+ NULL
+};
+#define pci_dev_list_1032 NULL
+static const pciDeviceInfo *pci_dev_list_1033[] = {
+ &pci_dev_info_1033_0001,
+ &pci_dev_info_1033_0002,
+ &pci_dev_info_1033_0003,
+ &pci_dev_info_1033_0004,
+ &pci_dev_info_1033_0005,
+ &pci_dev_info_1033_0006,
+ &pci_dev_info_1033_0007,
+ &pci_dev_info_1033_0008,
+ &pci_dev_info_1033_0009,
+ &pci_dev_info_1033_0016,
+ &pci_dev_info_1033_001a,
+ &pci_dev_info_1033_0021,
+ &pci_dev_info_1033_0029,
+ &pci_dev_info_1033_002a,
+ &pci_dev_info_1033_002c,
+ &pci_dev_info_1033_002d,
+ &pci_dev_info_1033_0035,
+ &pci_dev_info_1033_003b,
+ &pci_dev_info_1033_003e,
+ &pci_dev_info_1033_0046,
+ &pci_dev_info_1033_005a,
+ &pci_dev_info_1033_0063,
+ &pci_dev_info_1033_0067,
+ &pci_dev_info_1033_0074,
+ &pci_dev_info_1033_009b,
+ &pci_dev_info_1033_00a6,
+ &pci_dev_info_1033_00cd,
+ &pci_dev_info_1033_00e0,
+ NULL
+};
+#define pci_dev_list_1034 NULL
+#define pci_dev_list_1035 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1036[] = {
+ &pci_dev_info_1036_0000,
+ NULL
+};
+#endif
+#define pci_dev_list_1037 NULL
+#define pci_dev_list_1038 NULL
+static const pciDeviceInfo *pci_dev_list_1039[] = {
+ &pci_dev_info_1039_0001,
+ &pci_dev_info_1039_0002,
+ &pci_dev_info_1039_0006,
+ &pci_dev_info_1039_0008,
+ &pci_dev_info_1039_0009,
+ &pci_dev_info_1039_0018,
+ &pci_dev_info_1039_0200,
+ &pci_dev_info_1039_0204,
+ &pci_dev_info_1039_0205,
+ &pci_dev_info_1039_0300,
+ &pci_dev_info_1039_0310,
+ &pci_dev_info_1039_0315,
+ &pci_dev_info_1039_0325,
+ &pci_dev_info_1039_0330,
+ &pci_dev_info_1039_0406,
+ &pci_dev_info_1039_0496,
+ &pci_dev_info_1039_0530,
+ &pci_dev_info_1039_0540,
+ &pci_dev_info_1039_0597,
+ &pci_dev_info_1039_0601,
+ &pci_dev_info_1039_0620,
+ &pci_dev_info_1039_0630,
+ &pci_dev_info_1039_0633,
+ &pci_dev_info_1039_0635,
+ &pci_dev_info_1039_0645,
+ &pci_dev_info_1039_0646,
+ &pci_dev_info_1039_0650,
+ &pci_dev_info_1039_0651,
+ &pci_dev_info_1039_0730,
+ &pci_dev_info_1039_0733,
+ &pci_dev_info_1039_0735,
+ &pci_dev_info_1039_0740,
+ &pci_dev_info_1039_0745,
+ &pci_dev_info_1039_0900,
+ &pci_dev_info_1039_0961,
+ &pci_dev_info_1039_0962,
+ &pci_dev_info_1039_3602,
+ &pci_dev_info_1039_5107,
+ &pci_dev_info_1039_5300,
+ &pci_dev_info_1039_5315,
+ &pci_dev_info_1039_5401,
+ &pci_dev_info_1039_5511,
+ &pci_dev_info_1039_5513,
+ &pci_dev_info_1039_5517,
+ &pci_dev_info_1039_5571,
+ &pci_dev_info_1039_5581,
+ &pci_dev_info_1039_5582,
+ &pci_dev_info_1039_5591,
+ &pci_dev_info_1039_5596,
+ &pci_dev_info_1039_5597,
+ &pci_dev_info_1039_5600,
+ &pci_dev_info_1039_6204,
+ &pci_dev_info_1039_6205,
+ &pci_dev_info_1039_6236,
+ &pci_dev_info_1039_6300,
+ &pci_dev_info_1039_6306,
+ &pci_dev_info_1039_6325,
+ &pci_dev_info_1039_6326,
+ &pci_dev_info_1039_7001,
+ &pci_dev_info_1039_7002,
+ &pci_dev_info_1039_7007,
+ &pci_dev_info_1039_7012,
+ &pci_dev_info_1039_7013,
+ &pci_dev_info_1039_7016,
+ &pci_dev_info_1039_7018,
+ NULL
+};
+#define pci_dev_list_103a NULL
+#define pci_dev_list_103b NULL
+static const pciDeviceInfo *pci_dev_list_103c[] = {
+ &pci_dev_info_103c_1005,
+ &pci_dev_info_103c_1006,
+ &pci_dev_info_103c_1008,
+ &pci_dev_info_103c_100a,
+ &pci_dev_info_103c_1028,
+ &pci_dev_info_103c_1029,
+ &pci_dev_info_103c_102a,
+ &pci_dev_info_103c_1030,
+ &pci_dev_info_103c_1031,
+ &pci_dev_info_103c_1040,
+ &pci_dev_info_103c_1041,
+ &pci_dev_info_103c_1042,
+ &pci_dev_info_103c_1048,
+ &pci_dev_info_103c_1064,
+ &pci_dev_info_103c_108b,
+ &pci_dev_info_103c_10c1,
+ &pci_dev_info_103c_10ed,
+ &pci_dev_info_103c_1200,
+ &pci_dev_info_103c_1219,
+ &pci_dev_info_103c_121a,
+ &pci_dev_info_103c_121b,
+ &pci_dev_info_103c_121c,
+ &pci_dev_info_103c_1229,
+ &pci_dev_info_103c_122a,
+ &pci_dev_info_103c_122e,
+ &pci_dev_info_103c_1290,
+ &pci_dev_info_103c_2910,
+ &pci_dev_info_103c_2925,
+ NULL
+};
+#define pci_dev_list_103e NULL
+#define pci_dev_list_103f NULL
+#define pci_dev_list_1040 NULL
+#define pci_dev_list_1041 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1042[] = {
+ &pci_dev_info_1042_1000,
+ &pci_dev_info_1042_1001,
+ &pci_dev_info_1042_3000,
+ &pci_dev_info_1042_3010,
+ &pci_dev_info_1042_3020,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1043[] = {
+ &pci_dev_info_1043_0675,
+ &pci_dev_info_1043_4021,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1044[] = {
+ &pci_dev_info_1044_1012,
+ &pci_dev_info_1044_a400,
+ &pci_dev_info_1044_a500,
+ &pci_dev_info_1044_a501,
+ &pci_dev_info_1044_a511,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1045[] = {
+ &pci_dev_info_1045_a0f8,
+ &pci_dev_info_1045_c101,
+ &pci_dev_info_1045_c178,
+ &pci_dev_info_1045_c556,
+ &pci_dev_info_1045_c557,
+ &pci_dev_info_1045_c558,
+ &pci_dev_info_1045_c567,
+ &pci_dev_info_1045_c568,
+ &pci_dev_info_1045_c569,
+ &pci_dev_info_1045_c621,
+ &pci_dev_info_1045_c700,
+ &pci_dev_info_1045_c701,
+ &pci_dev_info_1045_c814,
+ &pci_dev_info_1045_c822,
+ &pci_dev_info_1045_c824,
+ &pci_dev_info_1045_c825,
+ &pci_dev_info_1045_c832,
+ &pci_dev_info_1045_c861,
+ &pci_dev_info_1045_c895,
+ &pci_dev_info_1045_c935,
+ &pci_dev_info_1045_d568,
+ &pci_dev_info_1045_d721,
+ NULL
+};
+#endif
+#define pci_dev_list_1046 NULL
+#define pci_dev_list_1047 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1048[] = {
+ &pci_dev_info_1048_0d22,
+ &pci_dev_info_1048_1000,
+ &pci_dev_info_1048_3000,
+ NULL
+};
+#endif
+#define pci_dev_list_1049 NULL
+static const pciDeviceInfo *pci_dev_list_104a[] = {
+ &pci_dev_info_104a_0008,
+ &pci_dev_info_104a_0009,
+ &pci_dev_info_104a_0010,
+ &pci_dev_info_104a_0210,
+ &pci_dev_info_104a_0981,
+ &pci_dev_info_104a_1746,
+ &pci_dev_info_104a_2774,
+ &pci_dev_info_104a_3520,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_104b[] = {
+ &pci_dev_info_104b_0140,
+ &pci_dev_info_104b_1040,
+ &pci_dev_info_104b_8130,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_104c[] = {
+ &pci_dev_info_104c_0500,
+ &pci_dev_info_104c_0508,
+ &pci_dev_info_104c_1000,
+ &pci_dev_info_104c_104c,
+ &pci_dev_info_104c_3d04,
+ &pci_dev_info_104c_3d07,
+ &pci_dev_info_104c_8000,
+ &pci_dev_info_104c_8009,
+ &pci_dev_info_104c_8017,
+ &pci_dev_info_104c_8019,
+ &pci_dev_info_104c_8020,
+ &pci_dev_info_104c_8021,
+ &pci_dev_info_104c_8022,
+ &pci_dev_info_104c_8023,
+ &pci_dev_info_104c_8024,
+ &pci_dev_info_104c_8026,
+ &pci_dev_info_104c_8027,
+ &pci_dev_info_104c_8400,
+ &pci_dev_info_104c_a001,
+ &pci_dev_info_104c_a100,
+ &pci_dev_info_104c_a102,
+ &pci_dev_info_104c_a106,
+ &pci_dev_info_104c_ac10,
+ &pci_dev_info_104c_ac11,
+ &pci_dev_info_104c_ac12,
+ &pci_dev_info_104c_ac13,
+ &pci_dev_info_104c_ac15,
+ &pci_dev_info_104c_ac16,
+ &pci_dev_info_104c_ac17,
+ &pci_dev_info_104c_ac18,
+ &pci_dev_info_104c_ac19,
+ &pci_dev_info_104c_ac1a,
+ &pci_dev_info_104c_ac1b,
+ &pci_dev_info_104c_ac1c,
+ &pci_dev_info_104c_ac1d,
+ &pci_dev_info_104c_ac1e,
+ &pci_dev_info_104c_ac1f,
+ &pci_dev_info_104c_ac20,
+ &pci_dev_info_104c_ac21,
+ &pci_dev_info_104c_ac22,
+ &pci_dev_info_104c_ac23,
+ &pci_dev_info_104c_ac28,
+ &pci_dev_info_104c_ac30,
+ &pci_dev_info_104c_ac40,
+ &pci_dev_info_104c_ac41,
+ &pci_dev_info_104c_ac42,
+ &pci_dev_info_104c_ac50,
+ &pci_dev_info_104c_ac51,
+ &pci_dev_info_104c_ac52,
+ &pci_dev_info_104c_ac53,
+ &pci_dev_info_104c_ac55,
+ &pci_dev_info_104c_ac56,
+ &pci_dev_info_104c_ac60,
+ &pci_dev_info_104c_fe00,
+ &pci_dev_info_104c_fe03,
+ NULL
+};
+static const pciDeviceInfo *pci_dev_list_104d[] = {
+ &pci_dev_info_104d_8009,
+ &pci_dev_info_104d_8039,
+ &pci_dev_info_104d_8056,
+ &pci_dev_info_104d_808a,
+ NULL
+};
+static const pciDeviceInfo *pci_dev_list_104e[] = {
+ &pci_dev_info_104e_0017,
+ &pci_dev_info_104e_0107,
+ &pci_dev_info_104e_0109,
+ &pci_dev_info_104e_0111,
+ &pci_dev_info_104e_0217,
+ &pci_dev_info_104e_0317,
+ NULL
+};
+#define pci_dev_list_104f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1050[] = {
+ &pci_dev_info_1050_0000,
+ &pci_dev_info_1050_0001,
+ &pci_dev_info_1050_0105,
+ &pci_dev_info_1050_0840,
+ &pci_dev_info_1050_0940,
+ &pci_dev_info_1050_5a5a,
+ &pci_dev_info_1050_6692,
+ &pci_dev_info_1050_9970,
+ NULL
+};
+#endif
+#define pci_dev_list_1051 NULL
+#define pci_dev_list_1052 NULL
+#define pci_dev_list_1053 NULL
+#define pci_dev_list_1054 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1055[] = {
+ &pci_dev_info_1055_9130,
+ &pci_dev_info_1055_9460,
+ &pci_dev_info_1055_9462,
+ &pci_dev_info_1055_9463,
+ NULL
+};
+#endif
+#define pci_dev_list_1056 NULL
+static const pciDeviceInfo *pci_dev_list_1057[] = {
+ &pci_dev_info_1057_0001,
+ &pci_dev_info_1057_0002,
+ &pci_dev_info_1057_0003,
+ &pci_dev_info_1057_0004,
+ &pci_dev_info_1057_0006,
+ &pci_dev_info_1057_0100,
+ &pci_dev_info_1057_0431,
+ &pci_dev_info_1057_1801,
+ &pci_dev_info_1057_18c0,
+ &pci_dev_info_1057_4801,
+ &pci_dev_info_1057_4802,
+ &pci_dev_info_1057_4803,
+ &pci_dev_info_1057_4806,
+ &pci_dev_info_1057_4d68,
+ &pci_dev_info_1057_5600,
+ &pci_dev_info_1057_6400,
+ NULL
+};
+#define pci_dev_list_1058 NULL
+#define pci_dev_list_1059 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_105a[] = {
+ &pci_dev_info_105a_0d30,
+ &pci_dev_info_105a_0d38,
+ &pci_dev_info_105a_1275,
+ &pci_dev_info_105a_3376,
+ &pci_dev_info_105a_4d30,
+ &pci_dev_info_105a_4d33,
+ &pci_dev_info_105a_4d38,
+ &pci_dev_info_105a_4d68,
+ &pci_dev_info_105a_4d69,
+ &pci_dev_info_105a_5275,
+ &pci_dev_info_105a_5300,
+ &pci_dev_info_105a_6268,
+ &pci_dev_info_105a_6269,
+ &pci_dev_info_105a_6621,
+ &pci_dev_info_105a_7275,
+ NULL
+};
+#endif
+#define pci_dev_list_105b NULL
+#define pci_dev_list_105c NULL
+static const pciDeviceInfo *pci_dev_list_105d[] = {
+ &pci_dev_info_105d_2309,
+ &pci_dev_info_105d_2339,
+ &pci_dev_info_105d_493d,
+ &pci_dev_info_105d_5348,
+ NULL
+};
+#define pci_dev_list_105e NULL
+#define pci_dev_list_105f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1060[] = {
+ &pci_dev_info_1060_0001,
+ &pci_dev_info_1060_0002,
+ &pci_dev_info_1060_0101,
+ &pci_dev_info_1060_0881,
+ &pci_dev_info_1060_0886,
+ &pci_dev_info_1060_0891,
+ &pci_dev_info_1060_1001,
+ &pci_dev_info_1060_673a,
+ &pci_dev_info_1060_673b,
+ &pci_dev_info_1060_8710,
+ &pci_dev_info_1060_886a,
+ &pci_dev_info_1060_8881,
+ &pci_dev_info_1060_8886,
+ &pci_dev_info_1060_888a,
+ &pci_dev_info_1060_8891,
+ &pci_dev_info_1060_9017,
+ &pci_dev_info_1060_9018,
+ &pci_dev_info_1060_9026,
+ &pci_dev_info_1060_e881,
+ &pci_dev_info_1060_e886,
+ &pci_dev_info_1060_e88a,
+ &pci_dev_info_1060_e891,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1061[] = {
+ &pci_dev_info_1061_0001,
+ &pci_dev_info_1061_0002,
+ NULL
+};
+#endif
+#define pci_dev_list_1062 NULL
+#define pci_dev_list_1063 NULL
+#define pci_dev_list_1064 NULL
+#define pci_dev_list_1065 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1066[] = {
+ &pci_dev_info_1066_0000,
+ &pci_dev_info_1066_0001,
+ &pci_dev_info_1066_0002,
+ &pci_dev_info_1066_0003,
+ &pci_dev_info_1066_0004,
+ &pci_dev_info_1066_0005,
+ &pci_dev_info_1066_8002,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1067[] = {
+ &pci_dev_info_1067_1002,
+ NULL
+};
+#endif
+#define pci_dev_list_1068 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1069[] = {
+ &pci_dev_info_1069_0001,
+ &pci_dev_info_1069_0002,
+ &pci_dev_info_1069_0010,
+ &pci_dev_info_1069_0050,
+ &pci_dev_info_1069_ba55,
+ &pci_dev_info_1069_ba56,
+ NULL
+};
+#endif
+#define pci_dev_list_106a NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_106b[] = {
+ &pci_dev_info_106b_0001,
+ &pci_dev_info_106b_0002,
+ &pci_dev_info_106b_0003,
+ &pci_dev_info_106b_0004,
+ &pci_dev_info_106b_0007,
+ &pci_dev_info_106b_000e,
+ &pci_dev_info_106b_0010,
+ &pci_dev_info_106b_0017,
+ &pci_dev_info_106b_0018,
+ &pci_dev_info_106b_0019,
+ &pci_dev_info_106b_001e,
+ &pci_dev_info_106b_001f,
+ &pci_dev_info_106b_0020,
+ &pci_dev_info_106b_0021,
+ &pci_dev_info_106b_0022,
+ &pci_dev_info_106b_0024,
+ &pci_dev_info_106b_0025,
+ &pci_dev_info_106b_0026,
+ &pci_dev_info_106b_0027,
+ &pci_dev_info_106b_0028,
+ &pci_dev_info_106b_0029,
+ &pci_dev_info_106b_002d,
+ &pci_dev_info_106b_002e,
+ &pci_dev_info_106b_002f,
+ &pci_dev_info_106b_0030,
+ &pci_dev_info_106b_0031,
+ &pci_dev_info_106b_0032,
+ &pci_dev_info_106b_0033,
+ &pci_dev_info_106b_0034,
+ &pci_dev_info_106b_1645,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_106c[] = {
+ &pci_dev_info_106c_8801,
+ &pci_dev_info_106c_8802,
+ &pci_dev_info_106c_8803,
+ &pci_dev_info_106c_8804,
+ &pci_dev_info_106c_8805,
+ NULL
+};
+#endif
+#define pci_dev_list_106d NULL
+#define pci_dev_list_106e NULL
+#define pci_dev_list_106f NULL
+#define pci_dev_list_1070 NULL
+#define pci_dev_list_1071 NULL
+#define pci_dev_list_1072 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1073[] = {
+ &pci_dev_info_1073_0001,
+ &pci_dev_info_1073_0002,
+ &pci_dev_info_1073_0003,
+ &pci_dev_info_1073_0004,
+ &pci_dev_info_1073_0005,
+ &pci_dev_info_1073_0006,
+ &pci_dev_info_1073_0008,
+ &pci_dev_info_1073_000a,
+ &pci_dev_info_1073_000c,
+ &pci_dev_info_1073_000d,
+ &pci_dev_info_1073_0010,
+ &pci_dev_info_1073_0012,
+ &pci_dev_info_1073_0020,
+ &pci_dev_info_1073_2000,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1074[] = {
+ &pci_dev_info_1074_4e78,
+ NULL
+};
+#endif
+#define pci_dev_list_1075 NULL
+#define pci_dev_list_1076 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1077[] = {
+ &pci_dev_info_1077_1016,
+ &pci_dev_info_1077_1020,
+ &pci_dev_info_1077_1022,
+ &pci_dev_info_1077_1080,
+ &pci_dev_info_1077_1216,
+ &pci_dev_info_1077_1240,
+ &pci_dev_info_1077_1280,
+ &pci_dev_info_1077_2020,
+ &pci_dev_info_1077_2100,
+ &pci_dev_info_1077_2200,
+ &pci_dev_info_1077_2300,
+ &pci_dev_info_1077_2312,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_1078[] = {
+ &pci_dev_info_1078_0000,
+ &pci_dev_info_1078_0001,
+ &pci_dev_info_1078_0002,
+ &pci_dev_info_1078_0100,
+ &pci_dev_info_1078_0101,
+ &pci_dev_info_1078_0102,
+ &pci_dev_info_1078_0103,
+ &pci_dev_info_1078_0104,
+ &pci_dev_info_1078_0400,
+ &pci_dev_info_1078_0401,
+ &pci_dev_info_1078_0402,
+ &pci_dev_info_1078_0403,
+ NULL
+};
+#define pci_dev_list_1079 NULL
+#define pci_dev_list_107a NULL
+#define pci_dev_list_107b NULL
+#define pci_dev_list_107c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_107d[] = {
+ &pci_dev_info_107d_0000,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_107e[] = {
+ &pci_dev_info_107e_0001,
+ &pci_dev_info_107e_0002,
+ &pci_dev_info_107e_0004,
+ &pci_dev_info_107e_0005,
+ &pci_dev_info_107e_0008,
+ &pci_dev_info_107e_9003,
+ &pci_dev_info_107e_9007,
+ &pci_dev_info_107e_9008,
+ &pci_dev_info_107e_900c,
+ &pci_dev_info_107e_900e,
+ &pci_dev_info_107e_9011,
+ &pci_dev_info_107e_9013,
+ &pci_dev_info_107e_9023,
+ &pci_dev_info_107e_9027,
+ &pci_dev_info_107e_9031,
+ &pci_dev_info_107e_9033,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_107f[] = {
+ &pci_dev_info_107f_0802,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1080[] = {
+ &pci_dev_info_1080_0600,
+ &pci_dev_info_1080_c691,
+ &pci_dev_info_1080_c693,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1081[] = {
+ &pci_dev_info_1081_0d47,
+ NULL
+};
+#endif
+#define pci_dev_list_1082 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1083[] = {
+ &pci_dev_info_1083_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_1084 NULL
+#define pci_dev_list_1085 NULL
+#define pci_dev_list_1086 NULL
+#define pci_dev_list_1087 NULL
+#define pci_dev_list_1088 NULL
+#define pci_dev_list_1089 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_108a[] = {
+ &pci_dev_info_108a_0001,
+ &pci_dev_info_108a_0010,
+ &pci_dev_info_108a_0040,
+ &pci_dev_info_108a_3000,
+ NULL
+};
+#endif
+#define pci_dev_list_108c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_108d[] = {
+ &pci_dev_info_108d_0001,
+ &pci_dev_info_108d_0002,
+ &pci_dev_info_108d_0004,
+ &pci_dev_info_108d_0005,
+ &pci_dev_info_108d_0006,
+ &pci_dev_info_108d_0007,
+ &pci_dev_info_108d_0008,
+ &pci_dev_info_108d_0011,
+ &pci_dev_info_108d_0012,
+ &pci_dev_info_108d_0013,
+ &pci_dev_info_108d_0014,
+ &pci_dev_info_108d_0019,
+ &pci_dev_info_108d_0021,
+ &pci_dev_info_108d_0022,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_108e[] = {
+ &pci_dev_info_108e_0001,
+ &pci_dev_info_108e_1000,
+ &pci_dev_info_108e_1001,
+ &pci_dev_info_108e_1100,
+ &pci_dev_info_108e_1101,
+ &pci_dev_info_108e_1102,
+ &pci_dev_info_108e_1103,
+ &pci_dev_info_108e_2bad,
+ &pci_dev_info_108e_5000,
+ &pci_dev_info_108e_5043,
+ &pci_dev_info_108e_8000,
+ &pci_dev_info_108e_8001,
+ &pci_dev_info_108e_a000,
+ &pci_dev_info_108e_a001,
+ NULL
+};
+#define pci_dev_list_108f NULL
+#define pci_dev_list_1090 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1091[] = {
+ &pci_dev_info_1091_0020,
+ &pci_dev_info_1091_0021,
+ &pci_dev_info_1091_0040,
+ &pci_dev_info_1091_0041,
+ &pci_dev_info_1091_0060,
+ &pci_dev_info_1091_00e4,
+ &pci_dev_info_1091_0720,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_1092[] = {
+ &pci_dev_info_1092_00a0,
+ &pci_dev_info_1092_00a8,
+ &pci_dev_info_1092_0550,
+ &pci_dev_info_1092_08d4,
+ &pci_dev_info_1092_094c,
+ &pci_dev_info_1092_1092,
+ &pci_dev_info_1092_6120,
+ &pci_dev_info_1092_8810,
+ &pci_dev_info_1092_8811,
+ &pci_dev_info_1092_8880,
+ &pci_dev_info_1092_8881,
+ &pci_dev_info_1092_88b0,
+ &pci_dev_info_1092_88b1,
+ &pci_dev_info_1092_88c0,
+ &pci_dev_info_1092_88c1,
+ &pci_dev_info_1092_88d0,
+ &pci_dev_info_1092_88d1,
+ &pci_dev_info_1092_88f0,
+ &pci_dev_info_1092_88f1,
+ &pci_dev_info_1092_9999,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1093[] = {
+ &pci_dev_info_1093_0160,
+ &pci_dev_info_1093_0162,
+ &pci_dev_info_1093_1170,
+ &pci_dev_info_1093_1180,
+ &pci_dev_info_1093_1190,
+ &pci_dev_info_1093_1330,
+ &pci_dev_info_1093_1350,
+ &pci_dev_info_1093_2a60,
+ &pci_dev_info_1093_b001,
+ &pci_dev_info_1093_b011,
+ &pci_dev_info_1093_b021,
+ &pci_dev_info_1093_b031,
+ &pci_dev_info_1093_b041,
+ &pci_dev_info_1093_b051,
+ &pci_dev_info_1093_b061,
+ &pci_dev_info_1093_b071,
+ &pci_dev_info_1093_b081,
+ &pci_dev_info_1093_b091,
+ &pci_dev_info_1093_c801,
+ &pci_dev_info_1093_c831,
+ NULL
+};
+#endif
+#define pci_dev_list_1094 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1095[] = {
+ &pci_dev_info_1095_0640,
+ &pci_dev_info_1095_0643,
+ &pci_dev_info_1095_0646,
+ &pci_dev_info_1095_0647,
+ &pci_dev_info_1095_0648,
+ &pci_dev_info_1095_0649,
+ &pci_dev_info_1095_0650,
+ &pci_dev_info_1095_0670,
+ &pci_dev_info_1095_0673,
+ &pci_dev_info_1095_0680,
+ &pci_dev_info_1095_3112,
+ NULL
+};
+#endif
+#define pci_dev_list_1096 NULL
+#define pci_dev_list_1097 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1098[] = {
+ &pci_dev_info_1098_0001,
+ &pci_dev_info_1098_0002,
+ NULL
+};
+#endif
+#define pci_dev_list_1099 NULL
+#define pci_dev_list_109a NULL
+#define pci_dev_list_109b NULL
+#define pci_dev_list_109c NULL
+#define pci_dev_list_109d NULL
+static const pciDeviceInfo *pci_dev_list_109e[] = {
+ &pci_dev_info_109e_0350,
+ &pci_dev_info_109e_0351,
+ &pci_dev_info_109e_0369,
+ &pci_dev_info_109e_036c,
+ &pci_dev_info_109e_036e,
+ &pci_dev_info_109e_036f,
+ &pci_dev_info_109e_0370,
+ &pci_dev_info_109e_0878,
+ &pci_dev_info_109e_0879,
+ &pci_dev_info_109e_0880,
+ &pci_dev_info_109e_2115,
+ &pci_dev_info_109e_2125,
+ &pci_dev_info_109e_2164,
+ &pci_dev_info_109e_2165,
+ &pci_dev_info_109e_8230,
+ &pci_dev_info_109e_8472,
+ &pci_dev_info_109e_8474,
+ NULL
+};
+#define pci_dev_list_109f NULL
+#define pci_dev_list_10a0 NULL
+#define pci_dev_list_10a1 NULL
+#define pci_dev_list_10a2 NULL
+#define pci_dev_list_10a3 NULL
+#define pci_dev_list_10a4 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10a5[] = {
+ &pci_dev_info_10a5_5449,
+ NULL
+};
+#endif
+#define pci_dev_list_10a6 NULL
+#define pci_dev_list_10a7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10a8[] = {
+ &pci_dev_info_10a8_0000,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10a9[] = {
+ &pci_dev_info_10a9_0001,
+ &pci_dev_info_10a9_0002,
+ &pci_dev_info_10a9_0003,
+ &pci_dev_info_10a9_0004,
+ &pci_dev_info_10a9_0005,
+ &pci_dev_info_10a9_0006,
+ &pci_dev_info_10a9_0007,
+ &pci_dev_info_10a9_0008,
+ &pci_dev_info_10a9_0009,
+ &pci_dev_info_10a9_0010,
+ &pci_dev_info_10a9_0011,
+ &pci_dev_info_10a9_0012,
+ &pci_dev_info_10a9_1001,
+ &pci_dev_info_10a9_1002,
+ &pci_dev_info_10a9_1003,
+ &pci_dev_info_10a9_1004,
+ &pci_dev_info_10a9_1005,
+ &pci_dev_info_10a9_1006,
+ &pci_dev_info_10a9_1007,
+ &pci_dev_info_10a9_1008,
+ &pci_dev_info_10a9_2001,
+ &pci_dev_info_10a9_2002,
+ &pci_dev_info_10a9_8001,
+ &pci_dev_info_10a9_8002,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10aa[] = {
+ &pci_dev_info_10aa_0000,
+ NULL
+};
+#endif
+#define pci_dev_list_10ab NULL
+#define pci_dev_list_10ac NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10ad[] = {
+ &pci_dev_info_10ad_0001,
+ &pci_dev_info_10ad_0003,
+ &pci_dev_info_10ad_0005,
+ &pci_dev_info_10ad_0103,
+ &pci_dev_info_10ad_0105,
+ &pci_dev_info_10ad_0565,
+ NULL
+};
+#endif
+#define pci_dev_list_10ae NULL
+#define pci_dev_list_10af NULL
+#define pci_dev_list_10b0 NULL
+#define pci_dev_list_10b1 NULL
+#define pci_dev_list_10b2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10b3[] = {
+ &pci_dev_info_10b3_3106,
+ &pci_dev_info_10b3_b106,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10b4[] = {
+ &pci_dev_info_10b4_1b1d,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10b5[] = {
+ &pci_dev_info_10b5_0001,
+ &pci_dev_info_10b5_1076,
+ &pci_dev_info_10b5_1077,
+ &pci_dev_info_10b5_1078,
+ &pci_dev_info_10b5_1103,
+ &pci_dev_info_10b5_1146,
+ &pci_dev_info_10b5_1147,
+ &pci_dev_info_10b5_2724,
+ &pci_dev_info_10b5_9030,
+ &pci_dev_info_10b5_9036,
+ &pci_dev_info_10b5_9050,
+ &pci_dev_info_10b5_9054,
+ &pci_dev_info_10b5_9060,
+ &pci_dev_info_10b5_906d,
+ &pci_dev_info_10b5_906e,
+ &pci_dev_info_10b5_9080,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10b6[] = {
+ &pci_dev_info_10b6_0001,
+ &pci_dev_info_10b6_0002,
+ &pci_dev_info_10b6_0003,
+ &pci_dev_info_10b6_0004,
+ &pci_dev_info_10b6_0006,
+ &pci_dev_info_10b6_0007,
+ &pci_dev_info_10b6_0009,
+ &pci_dev_info_10b6_000a,
+ &pci_dev_info_10b6_000b,
+ &pci_dev_info_10b6_000c,
+ &pci_dev_info_10b6_1000,
+ &pci_dev_info_10b6_1001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10b7[] = {
+ &pci_dev_info_10b7_0001,
+ &pci_dev_info_10b7_1006,
+ &pci_dev_info_10b7_1007,
+ &pci_dev_info_10b7_3390,
+ &pci_dev_info_10b7_3590,
+ &pci_dev_info_10b7_4500,
+ &pci_dev_info_10b7_5055,
+ &pci_dev_info_10b7_5057,
+ &pci_dev_info_10b7_5157,
+ &pci_dev_info_10b7_5257,
+ &pci_dev_info_10b7_5900,
+ &pci_dev_info_10b7_5920,
+ &pci_dev_info_10b7_5950,
+ &pci_dev_info_10b7_5951,
+ &pci_dev_info_10b7_5952,
+ &pci_dev_info_10b7_5970,
+ &pci_dev_info_10b7_5b57,
+ &pci_dev_info_10b7_6055,
+ &pci_dev_info_10b7_6056,
+ &pci_dev_info_10b7_6560,
+ &pci_dev_info_10b7_6561,
+ &pci_dev_info_10b7_6562,
+ &pci_dev_info_10b7_6563,
+ &pci_dev_info_10b7_6564,
+ &pci_dev_info_10b7_7646,
+ &pci_dev_info_10b7_7940,
+ &pci_dev_info_10b7_7980,
+ &pci_dev_info_10b7_7990,
+ &pci_dev_info_10b7_8811,
+ &pci_dev_info_10b7_9000,
+ &pci_dev_info_10b7_9001,
+ &pci_dev_info_10b7_9004,
+ &pci_dev_info_10b7_9005,
+ &pci_dev_info_10b7_9006,
+ &pci_dev_info_10b7_900a,
+ &pci_dev_info_10b7_9050,
+ &pci_dev_info_10b7_9051,
+ &pci_dev_info_10b7_9055,
+ &pci_dev_info_10b7_9056,
+ &pci_dev_info_10b7_9058,
+ &pci_dev_info_10b7_905a,
+ &pci_dev_info_10b7_9200,
+ &pci_dev_info_10b7_9201,
+ &pci_dev_info_10b7_9300,
+ &pci_dev_info_10b7_9800,
+ &pci_dev_info_10b7_9805,
+ &pci_dev_info_10b7_9900,
+ &pci_dev_info_10b7_9902,
+ &pci_dev_info_10b7_9903,
+ &pci_dev_info_10b7_9904,
+ &pci_dev_info_10b7_9905,
+ &pci_dev_info_10b7_9908,
+ &pci_dev_info_10b7_9909,
+ &pci_dev_info_10b7_990b,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10b8[] = {
+ &pci_dev_info_10b8_0005,
+ &pci_dev_info_10b8_0006,
+ &pci_dev_info_10b8_1000,
+ &pci_dev_info_10b8_1001,
+ &pci_dev_info_10b8_a011,
+ &pci_dev_info_10b8_b106,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_10b9[] = {
+ &pci_dev_info_10b9_0111,
+ &pci_dev_info_10b9_1435,
+ &pci_dev_info_10b9_1445,
+ &pci_dev_info_10b9_1449,
+ &pci_dev_info_10b9_1451,
+ &pci_dev_info_10b9_1461,
+ &pci_dev_info_10b9_1489,
+ &pci_dev_info_10b9_1511,
+ &pci_dev_info_10b9_1512,
+ &pci_dev_info_10b9_1513,
+ &pci_dev_info_10b9_1521,
+ &pci_dev_info_10b9_1523,
+ &pci_dev_info_10b9_1531,
+ &pci_dev_info_10b9_1533,
+ &pci_dev_info_10b9_1541,
+ &pci_dev_info_10b9_1543,
+ &pci_dev_info_10b9_1563,
+ &pci_dev_info_10b9_1621,
+ &pci_dev_info_10b9_1631,
+ &pci_dev_info_10b9_1632,
+ &pci_dev_info_10b9_1641,
+ &pci_dev_info_10b9_1644,
+ &pci_dev_info_10b9_1646,
+ &pci_dev_info_10b9_1647,
+ &pci_dev_info_10b9_1651,
+ &pci_dev_info_10b9_1671,
+ &pci_dev_info_10b9_1681,
+ &pci_dev_info_10b9_1687,
+ &pci_dev_info_10b9_3141,
+ &pci_dev_info_10b9_3143,
+ &pci_dev_info_10b9_3145,
+ &pci_dev_info_10b9_3147,
+ &pci_dev_info_10b9_3149,
+ &pci_dev_info_10b9_3151,
+ &pci_dev_info_10b9_3307,
+ &pci_dev_info_10b9_3309,
+ &pci_dev_info_10b9_5212,
+ &pci_dev_info_10b9_5215,
+ &pci_dev_info_10b9_5217,
+ &pci_dev_info_10b9_5219,
+ &pci_dev_info_10b9_5225,
+ &pci_dev_info_10b9_5229,
+ &pci_dev_info_10b9_5235,
+ &pci_dev_info_10b9_5237,
+ &pci_dev_info_10b9_5239,
+ &pci_dev_info_10b9_5243,
+ &pci_dev_info_10b9_5247,
+ &pci_dev_info_10b9_5249,
+ &pci_dev_info_10b9_5251,
+ &pci_dev_info_10b9_5253,
+ &pci_dev_info_10b9_5261,
+ &pci_dev_info_10b9_5451,
+ &pci_dev_info_10b9_5453,
+ &pci_dev_info_10b9_5455,
+ &pci_dev_info_10b9_5457,
+ &pci_dev_info_10b9_5459,
+ &pci_dev_info_10b9_545a,
+ &pci_dev_info_10b9_5471,
+ &pci_dev_info_10b9_5473,
+ &pci_dev_info_10b9_7101,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10ba[] = {
+ &pci_dev_info_10ba_0301,
+ NULL
+};
+#endif
+#define pci_dev_list_10bb NULL
+#define pci_dev_list_10bc NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10bd[] = {
+ &pci_dev_info_10bd_0e34,
+ NULL
+};
+#endif
+#define pci_dev_list_10be NULL
+#define pci_dev_list_10bf NULL
+#define pci_dev_list_10c0 NULL
+#define pci_dev_list_10c1 NULL
+#define pci_dev_list_10c2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10c3[] = {
+ &pci_dev_info_10c3_1100,
+ NULL
+};
+#endif
+#define pci_dev_list_10c4 NULL
+#define pci_dev_list_10c5 NULL
+#define pci_dev_list_10c6 NULL
+#define pci_dev_list_10c7 NULL
+static const pciDeviceInfo *pci_dev_list_10c8[] = {
+ &pci_dev_info_10c8_0001,
+ &pci_dev_info_10c8_0002,
+ &pci_dev_info_10c8_0003,
+ &pci_dev_info_10c8_0004,
+ &pci_dev_info_10c8_0005,
+ &pci_dev_info_10c8_0006,
+ &pci_dev_info_10c8_0016,
+ &pci_dev_info_10c8_0025,
+ &pci_dev_info_10c8_0083,
+ &pci_dev_info_10c8_8005,
+ &pci_dev_info_10c8_8006,
+ &pci_dev_info_10c8_8016,
+ NULL
+};
+#define pci_dev_list_10c9 NULL
+#define pci_dev_list_10ca NULL
+#define pci_dev_list_10cb NULL
+#define pci_dev_list_10cc NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10cd[] = {
+ &pci_dev_info_10cd_1100,
+ &pci_dev_info_10cd_1200,
+ &pci_dev_info_10cd_1300,
+ &pci_dev_info_10cd_2300,
+ &pci_dev_info_10cd_2500,
+ NULL
+};
+#endif
+#define pci_dev_list_10ce NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10cf[] = {
+ &pci_dev_info_10cf_2001,
+ NULL
+};
+#endif
+#define pci_dev_list_10d0 NULL
+#define pci_dev_list_10d1 NULL
+#define pci_dev_list_10d2 NULL
+#define pci_dev_list_10d3 NULL
+#define pci_dev_list_10d4 NULL
+#define pci_dev_list_10d5 NULL
+#define pci_dev_list_10d6 NULL
+#define pci_dev_list_10d7 NULL
+#define pci_dev_list_10d8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10d9[] = {
+ &pci_dev_info_10d9_0512,
+ &pci_dev_info_10d9_0531,
+ &pci_dev_info_10d9_8625,
+ &pci_dev_info_10d9_8888,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10da[] = {
+ &pci_dev_info_10da_0508,
+ &pci_dev_info_10da_3390,
+ NULL
+};
+#endif
+#define pci_dev_list_10db NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10dc[] = {
+ &pci_dev_info_10dc_0001,
+ &pci_dev_info_10dc_0002,
+ &pci_dev_info_10dc_0021,
+ &pci_dev_info_10dc_0022,
+ &pci_dev_info_10dc_10dc,
+ NULL
+};
+#endif
+#define pci_dev_list_10dd NULL
+static const pciDeviceInfo *pci_dev_list_10de[] = {
+ &pci_dev_info_10de_0008,
+ &pci_dev_info_10de_0009,
+ &pci_dev_info_10de_0010,
+ &pci_dev_info_10de_0020,
+ &pci_dev_info_10de_0028,
+ &pci_dev_info_10de_0029,
+ &pci_dev_info_10de_002a,
+ &pci_dev_info_10de_002b,
+ &pci_dev_info_10de_002c,
+ &pci_dev_info_10de_002d,
+ &pci_dev_info_10de_002e,
+ &pci_dev_info_10de_002f,
+ &pci_dev_info_10de_0060,
+ &pci_dev_info_10de_0064,
+ &pci_dev_info_10de_0065,
+ &pci_dev_info_10de_0066,
+ &pci_dev_info_10de_0067,
+ &pci_dev_info_10de_0068,
+ &pci_dev_info_10de_006a,
+ &pci_dev_info_10de_006b,
+ &pci_dev_info_10de_006e,
+ &pci_dev_info_10de_00a0,
+ &pci_dev_info_10de_0100,
+ &pci_dev_info_10de_0101,
+ &pci_dev_info_10de_0103,
+ &pci_dev_info_10de_0110,
+ &pci_dev_info_10de_0111,
+ &pci_dev_info_10de_0112,
+ &pci_dev_info_10de_0113,
+ &pci_dev_info_10de_0150,
+ &pci_dev_info_10de_0151,
+ &pci_dev_info_10de_0152,
+ &pci_dev_info_10de_0153,
+ &pci_dev_info_10de_0170,
+ &pci_dev_info_10de_0171,
+ &pci_dev_info_10de_0172,
+ &pci_dev_info_10de_0173,
+ &pci_dev_info_10de_0174,
+ &pci_dev_info_10de_0175,
+ &pci_dev_info_10de_0176,
+ &pci_dev_info_10de_0178,
+ &pci_dev_info_10de_0179,
+ &pci_dev_info_10de_017a,
+ &pci_dev_info_10de_017b,
+ &pci_dev_info_10de_017c,
+ &pci_dev_info_10de_0181,
+ &pci_dev_info_10de_0182,
+ &pci_dev_info_10de_0183,
+ &pci_dev_info_10de_0188,
+ &pci_dev_info_10de_018a,
+ &pci_dev_info_10de_018b,
+ &pci_dev_info_10de_01a0,
+ &pci_dev_info_10de_01a4,
+ &pci_dev_info_10de_01ab,
+ &pci_dev_info_10de_01ac,
+ &pci_dev_info_10de_01ad,
+ &pci_dev_info_10de_01b1,
+ &pci_dev_info_10de_01b2,
+ &pci_dev_info_10de_01b4,
+ &pci_dev_info_10de_01b7,
+ &pci_dev_info_10de_01b8,
+ &pci_dev_info_10de_01bc,
+ &pci_dev_info_10de_01c1,
+ &pci_dev_info_10de_01c2,
+ &pci_dev_info_10de_01c3,
+ &pci_dev_info_10de_01e8,
+ &pci_dev_info_10de_01f0,
+ &pci_dev_info_10de_0200,
+ &pci_dev_info_10de_0201,
+ &pci_dev_info_10de_0202,
+ &pci_dev_info_10de_0203,
+ &pci_dev_info_10de_0250,
+ &pci_dev_info_10de_0251,
+ &pci_dev_info_10de_0252,
+ &pci_dev_info_10de_0253,
+ &pci_dev_info_10de_0258,
+ &pci_dev_info_10de_0259,
+ &pci_dev_info_10de_025b,
+ &pci_dev_info_10de_0280,
+ &pci_dev_info_10de_0281,
+ &pci_dev_info_10de_0282,
+ &pci_dev_info_10de_0288,
+ &pci_dev_info_10de_0289,
+ &pci_dev_info_10de_0300,
+ &pci_dev_info_10de_0301,
+ &pci_dev_info_10de_0302,
+ &pci_dev_info_10de_0308,
+ &pci_dev_info_10de_0309,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10df[] = {
+ &pci_dev_info_10df_1ae5,
+ &pci_dev_info_10df_f085,
+ &pci_dev_info_10df_f095,
+ &pci_dev_info_10df_f098,
+ &pci_dev_info_10df_f700,
+ &pci_dev_info_10df_f800,
+ &pci_dev_info_10df_f900,
+ &pci_dev_info_10df_f980,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_10e0[] = {
+ &pci_dev_info_10e0_5026,
+ &pci_dev_info_10e0_5027,
+ &pci_dev_info_10e0_5028,
+ &pci_dev_info_10e0_8849,
+ &pci_dev_info_10e0_8853,
+ &pci_dev_info_10e0_9128,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10e1[] = {
+ &pci_dev_info_10e1_0391,
+ &pci_dev_info_10e1_690c,
+ &pci_dev_info_10e1_dc29,
+ NULL
+};
+#endif
+#define pci_dev_list_10e2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10e3[] = {
+ &pci_dev_info_10e3_0000,
+ &pci_dev_info_10e3_0860,
+ &pci_dev_info_10e3_0862,
+ NULL
+};
+#endif
+#define pci_dev_list_10e4 NULL
+#define pci_dev_list_10e5 NULL
+#define pci_dev_list_10e6 NULL
+#define pci_dev_list_10e7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10e8[] = {
+ &pci_dev_info_10e8_2011,
+ &pci_dev_info_10e8_4750,
+ &pci_dev_info_10e8_5920,
+ &pci_dev_info_10e8_8043,
+ &pci_dev_info_10e8_8062,
+ &pci_dev_info_10e8_807d,
+ &pci_dev_info_10e8_8088,
+ &pci_dev_info_10e8_8089,
+ &pci_dev_info_10e8_809c,
+ &pci_dev_info_10e8_80d7,
+ &pci_dev_info_10e8_80d9,
+ &pci_dev_info_10e8_80da,
+ &pci_dev_info_10e8_811a,
+ &pci_dev_info_10e8_8170,
+ &pci_dev_info_10e8_82db,
+ NULL
+};
+#endif
+#define pci_dev_list_10e9 NULL
+static const pciDeviceInfo *pci_dev_list_10ea[] = {
+ &pci_dev_info_10ea_1680,
+ &pci_dev_info_10ea_1682,
+ &pci_dev_info_10ea_1683,
+ &pci_dev_info_10ea_2000,
+ &pci_dev_info_10ea_2010,
+ &pci_dev_info_10ea_5000,
+ &pci_dev_info_10ea_5050,
+ &pci_dev_info_10ea_5202,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10eb[] = {
+ &pci_dev_info_10eb_0101,
+ &pci_dev_info_10eb_8111,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10ec[] = {
+ &pci_dev_info_10ec_8029,
+ &pci_dev_info_10ec_8129,
+ &pci_dev_info_10ec_8138,
+ &pci_dev_info_10ec_8139,
+ &pci_dev_info_10ec_8169,
+ &pci_dev_info_10ec_8197,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10ed[] = {
+ &pci_dev_info_10ed_7310,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10ee[] = {
+ &pci_dev_info_10ee_3fc0,
+ &pci_dev_info_10ee_3fc1,
+ &pci_dev_info_10ee_3fc2,
+ &pci_dev_info_10ee_3fc3,
+ &pci_dev_info_10ee_3fc4,
+ &pci_dev_info_10ee_3fc5,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10ef[] = {
+ &pci_dev_info_10ef_8154,
+ NULL
+};
+#endif
+#define pci_dev_list_10f0 NULL
+#define pci_dev_list_10f1 NULL
+#define pci_dev_list_10f2 NULL
+#define pci_dev_list_10f3 NULL
+#define pci_dev_list_10f4 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10f5[] = {
+ &pci_dev_info_10f5_a001,
+ NULL
+};
+#endif
+#define pci_dev_list_10f6 NULL
+#define pci_dev_list_10f7 NULL
+#define pci_dev_list_10f8 NULL
+#define pci_dev_list_10f9 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10fa[] = {
+ &pci_dev_info_10fa_000c,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10fb[] = {
+ &pci_dev_info_10fb_186f,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_10fc[] = {
+ &pci_dev_info_10fc_0003,
+ &pci_dev_info_10fc_0005,
+ NULL
+};
+#endif
+#define pci_dev_list_10fd NULL
+#define pci_dev_list_10fe NULL
+#define pci_dev_list_10ff NULL
+#define pci_dev_list_1100 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1101[] = {
+ &pci_dev_info_1101_1060,
+ &pci_dev_info_1101_9100,
+ &pci_dev_info_1101_9400,
+ &pci_dev_info_1101_9401,
+ &pci_dev_info_1101_9500,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1102[] = {
+ &pci_dev_info_1102_0002,
+ &pci_dev_info_1102_0004,
+ &pci_dev_info_1102_0006,
+ &pci_dev_info_1102_4001,
+ &pci_dev_info_1102_7002,
+ &pci_dev_info_1102_7003,
+ &pci_dev_info_1102_7004,
+ &pci_dev_info_1102_8064,
+ &pci_dev_info_1102_8938,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1103[] = {
+ &pci_dev_info_1103_0003,
+ &pci_dev_info_1103_0004,
+ &pci_dev_info_1103_0005,
+ &pci_dev_info_1103_0006,
+ &pci_dev_info_1103_0007,
+ &pci_dev_info_1103_0008,
+ NULL
+};
+#endif
+#define pci_dev_list_1104 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1105[] = {
+ &pci_dev_info_1105_1105,
+ &pci_dev_info_1105_8300,
+ &pci_dev_info_1105_8400,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_1106[] = {
+ &pci_dev_info_1106_0102,
+ &pci_dev_info_1106_0130,
+ &pci_dev_info_1106_0305,
+ &pci_dev_info_1106_0391,
+ &pci_dev_info_1106_0501,
+ &pci_dev_info_1106_0505,
+ &pci_dev_info_1106_0561,
+ &pci_dev_info_1106_0571,
+ &pci_dev_info_1106_0576,
+ &pci_dev_info_1106_0585,
+ &pci_dev_info_1106_0586,
+ &pci_dev_info_1106_0595,
+ &pci_dev_info_1106_0596,
+ &pci_dev_info_1106_0597,
+ &pci_dev_info_1106_0598,
+ &pci_dev_info_1106_0601,
+ &pci_dev_info_1106_0605,
+ &pci_dev_info_1106_0680,
+ &pci_dev_info_1106_0686,
+ &pci_dev_info_1106_0691,
+ &pci_dev_info_1106_0693,
+ &pci_dev_info_1106_0698,
+ &pci_dev_info_1106_0926,
+ &pci_dev_info_1106_1000,
+ &pci_dev_info_1106_1106,
+ &pci_dev_info_1106_1571,
+ &pci_dev_info_1106_1595,
+ &pci_dev_info_1106_3038,
+ &pci_dev_info_1106_3040,
+ &pci_dev_info_1106_3043,
+ &pci_dev_info_1106_3044,
+ &pci_dev_info_1106_3050,
+ &pci_dev_info_1106_3051,
+ &pci_dev_info_1106_3057,
+ &pci_dev_info_1106_3058,
+ &pci_dev_info_1106_3059,
+ &pci_dev_info_1106_3065,
+ &pci_dev_info_1106_3068,
+ &pci_dev_info_1106_3074,
+ &pci_dev_info_1106_3091,
+ &pci_dev_info_1106_3099,
+ &pci_dev_info_1106_3101,
+ &pci_dev_info_1106_3102,
+ &pci_dev_info_1106_3103,
+ &pci_dev_info_1106_3104,
+ &pci_dev_info_1106_3106,
+ &pci_dev_info_1106_3109,
+ &pci_dev_info_1106_3112,
+ &pci_dev_info_1106_3116,
+ &pci_dev_info_1106_3122,
+ &pci_dev_info_1106_3123,
+ &pci_dev_info_1106_3128,
+ &pci_dev_info_1106_3133,
+ &pci_dev_info_1106_3147,
+ &pci_dev_info_1106_3148,
+ &pci_dev_info_1106_3156,
+ &pci_dev_info_1106_3168,
+ &pci_dev_info_1106_3177,
+ &pci_dev_info_1106_3189,
+ &pci_dev_info_1106_5030,
+ &pci_dev_info_1106_6100,
+ &pci_dev_info_1106_8231,
+ &pci_dev_info_1106_8235,
+ &pci_dev_info_1106_8305,
+ &pci_dev_info_1106_8391,
+ &pci_dev_info_1106_8501,
+ &pci_dev_info_1106_8596,
+ &pci_dev_info_1106_8597,
+ &pci_dev_info_1106_8598,
+ &pci_dev_info_1106_8601,
+ &pci_dev_info_1106_8605,
+ &pci_dev_info_1106_8691,
+ &pci_dev_info_1106_8693,
+ &pci_dev_info_1106_b091,
+ &pci_dev_info_1106_b099,
+ &pci_dev_info_1106_b101,
+ &pci_dev_info_1106_b102,
+ &pci_dev_info_1106_b103,
+ &pci_dev_info_1106_b112,
+ &pci_dev_info_1106_b168,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1107[] = {
+ &pci_dev_info_1107_0576,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1108[] = {
+ &pci_dev_info_1108_0100,
+ &pci_dev_info_1108_0101,
+ &pci_dev_info_1108_0105,
+ &pci_dev_info_1108_0108,
+ &pci_dev_info_1108_0138,
+ &pci_dev_info_1108_0139,
+ &pci_dev_info_1108_013c,
+ &pci_dev_info_1108_013d,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1109[] = {
+ &pci_dev_info_1109_1400,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_110a[] = {
+ &pci_dev_info_110a_0002,
+ &pci_dev_info_110a_0005,
+ &pci_dev_info_110a_2102,
+ &pci_dev_info_110a_4942,
+ &pci_dev_info_110a_6120,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_110b[] = {
+ &pci_dev_info_110b_0001,
+ &pci_dev_info_110b_0004,
+ NULL
+};
+#endif
+#define pci_dev_list_110c NULL
+#define pci_dev_list_110d NULL
+#define pci_dev_list_110e NULL
+#define pci_dev_list_110f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1110[] = {
+ &pci_dev_info_1110_6037,
+ &pci_dev_info_1110_6073,
+ NULL
+};
+#endif
+#define pci_dev_list_1111 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1112[] = {
+ &pci_dev_info_1112_2200,
+ &pci_dev_info_1112_2300,
+ &pci_dev_info_1112_2340,
+ &pci_dev_info_1112_2400,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1113[] = {
+ &pci_dev_info_1113_1211,
+ &pci_dev_info_1113_1216,
+ &pci_dev_info_1113_1217,
+ &pci_dev_info_1113_5105,
+ &pci_dev_info_1113_9211,
+ &pci_dev_info_1113_9511,
+ NULL
+};
+#endif
+#define pci_dev_list_1114 NULL
+#define pci_dev_list_1115 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1116[] = {
+ &pci_dev_info_1116_0022,
+ &pci_dev_info_1116_0023,
+ &pci_dev_info_1116_0024,
+ &pci_dev_info_1116_0025,
+ &pci_dev_info_1116_0026,
+ &pci_dev_info_1116_0027,
+ &pci_dev_info_1116_0028,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1117[] = {
+ &pci_dev_info_1117_9500,
+ &pci_dev_info_1117_9501,
+ NULL
+};
+#endif
+#define pci_dev_list_1118 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1119[] = {
+ &pci_dev_info_1119_0000,
+ &pci_dev_info_1119_0001,
+ &pci_dev_info_1119_0002,
+ &pci_dev_info_1119_0003,
+ &pci_dev_info_1119_0004,
+ &pci_dev_info_1119_0005,
+ &pci_dev_info_1119_0006,
+ &pci_dev_info_1119_0007,
+ &pci_dev_info_1119_0008,
+ &pci_dev_info_1119_0009,
+ &pci_dev_info_1119_000a,
+ &pci_dev_info_1119_000b,
+ &pci_dev_info_1119_000c,
+ &pci_dev_info_1119_000d,
+ &pci_dev_info_1119_0100,
+ &pci_dev_info_1119_0101,
+ &pci_dev_info_1119_0102,
+ &pci_dev_info_1119_0103,
+ &pci_dev_info_1119_0104,
+ &pci_dev_info_1119_0105,
+ &pci_dev_info_1119_0110,
+ &pci_dev_info_1119_0111,
+ &pci_dev_info_1119_0112,
+ &pci_dev_info_1119_0113,
+ &pci_dev_info_1119_0114,
+ &pci_dev_info_1119_0115,
+ &pci_dev_info_1119_0118,
+ &pci_dev_info_1119_0119,
+ &pci_dev_info_1119_011a,
+ &pci_dev_info_1119_011b,
+ &pci_dev_info_1119_0120,
+ &pci_dev_info_1119_0121,
+ &pci_dev_info_1119_0122,
+ &pci_dev_info_1119_0123,
+ &pci_dev_info_1119_0124,
+ &pci_dev_info_1119_0125,
+ &pci_dev_info_1119_0136,
+ &pci_dev_info_1119_0137,
+ &pci_dev_info_1119_0138,
+ &pci_dev_info_1119_0139,
+ &pci_dev_info_1119_013a,
+ &pci_dev_info_1119_013b,
+ &pci_dev_info_1119_013c,
+ &pci_dev_info_1119_013d,
+ &pci_dev_info_1119_013e,
+ &pci_dev_info_1119_013f,
+ &pci_dev_info_1119_0166,
+ &pci_dev_info_1119_0167,
+ &pci_dev_info_1119_0168,
+ &pci_dev_info_1119_0169,
+ &pci_dev_info_1119_016a,
+ &pci_dev_info_1119_016b,
+ &pci_dev_info_1119_016c,
+ &pci_dev_info_1119_016d,
+ &pci_dev_info_1119_016e,
+ &pci_dev_info_1119_016f,
+ &pci_dev_info_1119_01d6,
+ &pci_dev_info_1119_01d7,
+ &pci_dev_info_1119_01f6,
+ &pci_dev_info_1119_01f7,
+ &pci_dev_info_1119_01fc,
+ &pci_dev_info_1119_01fd,
+ &pci_dev_info_1119_01fe,
+ &pci_dev_info_1119_01ff,
+ &pci_dev_info_1119_0210,
+ &pci_dev_info_1119_0211,
+ &pci_dev_info_1119_0260,
+ &pci_dev_info_1119_0261,
+ &pci_dev_info_1119_0300,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_111a[] = {
+ &pci_dev_info_111a_0000,
+ &pci_dev_info_111a_0002,
+ &pci_dev_info_111a_0003,
+ &pci_dev_info_111a_0005,
+ &pci_dev_info_111a_0007,
+ NULL
+};
+#endif
+#define pci_dev_list_111b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_111c[] = {
+ &pci_dev_info_111c_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_111d[] = {
+ &pci_dev_info_111d_0001,
+ &pci_dev_info_111d_0003,
+ NULL
+};
+#endif
+#define pci_dev_list_111e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_111f[] = {
+ &pci_dev_info_111f_4a47,
+ &pci_dev_info_111f_5243,
+ NULL
+};
+#endif
+#define pci_dev_list_1120 NULL
+#define pci_dev_list_1121 NULL
+#define pci_dev_list_1122 NULL
+#define pci_dev_list_1123 NULL
+#define pci_dev_list_1124 NULL
+#define pci_dev_list_1125 NULL
+#define pci_dev_list_1126 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1127[] = {
+ &pci_dev_info_1127_0200,
+ &pci_dev_info_1127_0210,
+ &pci_dev_info_1127_0250,
+ &pci_dev_info_1127_0300,
+ &pci_dev_info_1127_0310,
+ &pci_dev_info_1127_0400,
+ NULL
+};
+#endif
+#define pci_dev_list_1129 NULL
+#define pci_dev_list_112a NULL
+#define pci_dev_list_112b NULL
+#define pci_dev_list_112c NULL
+#define pci_dev_list_112d NULL
+#define pci_dev_list_112e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_112f[] = {
+ &pci_dev_info_112f_0000,
+ &pci_dev_info_112f_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_1130 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1131[] = {
+ &pci_dev_info_1131_1561,
+ &pci_dev_info_1131_1562,
+ &pci_dev_info_1131_3400,
+ &pci_dev_info_1131_7130,
+ &pci_dev_info_1131_7133,
+ &pci_dev_info_1131_7134,
+ &pci_dev_info_1131_7135,
+ &pci_dev_info_1131_7145,
+ &pci_dev_info_1131_7146,
+ NULL
+};
+#endif
+#define pci_dev_list_1132 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1133[] = {
+ &pci_dev_info_1133_7901,
+ &pci_dev_info_1133_7902,
+ &pci_dev_info_1133_7911,
+ &pci_dev_info_1133_7912,
+ &pci_dev_info_1133_7941,
+ &pci_dev_info_1133_7942,
+ &pci_dev_info_1133_7943,
+ &pci_dev_info_1133_7944,
+ &pci_dev_info_1133_b921,
+ &pci_dev_info_1133_b922,
+ &pci_dev_info_1133_b923,
+ &pci_dev_info_1133_e001,
+ &pci_dev_info_1133_e002,
+ &pci_dev_info_1133_e003,
+ &pci_dev_info_1133_e004,
+ &pci_dev_info_1133_e005,
+ &pci_dev_info_1133_e00b,
+ &pci_dev_info_1133_e010,
+ &pci_dev_info_1133_e012,
+ &pci_dev_info_1133_e014,
+ &pci_dev_info_1133_e018,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1134[] = {
+ &pci_dev_info_1134_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1135[] = {
+ &pci_dev_info_1135_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_1136 NULL
+#define pci_dev_list_1137 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1138[] = {
+ &pci_dev_info_1138_8905,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1139[] = {
+ &pci_dev_info_1139_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_113a NULL
+#define pci_dev_list_113b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_113c[] = {
+ &pci_dev_info_113c_0000,
+ &pci_dev_info_113c_0001,
+ &pci_dev_info_113c_0911,
+ &pci_dev_info_113c_0912,
+ &pci_dev_info_113c_0913,
+ &pci_dev_info_113c_0914,
+ NULL
+};
+#endif
+#define pci_dev_list_113d NULL
+#define pci_dev_list_113e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_113f[] = {
+ &pci_dev_info_113f_0808,
+ &pci_dev_info_113f_1010,
+ &pci_dev_info_113f_80c0,
+ &pci_dev_info_113f_80c4,
+ &pci_dev_info_113f_80c8,
+ &pci_dev_info_113f_8888,
+ &pci_dev_info_113f_9090,
+ NULL
+};
+#endif
+#define pci_dev_list_1140 NULL
+#define pci_dev_list_1141 NULL
+static const pciDeviceInfo *pci_dev_list_1142[] = {
+ &pci_dev_info_1142_3210,
+ &pci_dev_info_1142_6422,
+ &pci_dev_info_1142_6424,
+ &pci_dev_info_1142_6425,
+ &pci_dev_info_1142_643d,
+ NULL
+};
+#define pci_dev_list_1143 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1144[] = {
+ &pci_dev_info_1144_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1145[] = {
+ &pci_dev_info_1145_8007,
+ &pci_dev_info_1145_f007,
+ &pci_dev_info_1145_f010,
+ &pci_dev_info_1145_f012,
+ &pci_dev_info_1145_f013,
+ &pci_dev_info_1145_f015,
+ NULL
+};
+#endif
+#define pci_dev_list_1146 NULL
+#define pci_dev_list_1147 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1148[] = {
+ &pci_dev_info_1148_4000,
+ &pci_dev_info_1148_4200,
+ &pci_dev_info_1148_4300,
+ &pci_dev_info_1148_4320,
+ &pci_dev_info_1148_4400,
+ NULL
+};
+#endif
+#define pci_dev_list_1149 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_114a[] = {
+ &pci_dev_info_114a_5579,
+ &pci_dev_info_114a_5587,
+ &pci_dev_info_114a_6504,
+ &pci_dev_info_114a_7587,
+ NULL
+};
+#endif
+#define pci_dev_list_114b NULL
+#define pci_dev_list_114c NULL
+#define pci_dev_list_114d NULL
+#define pci_dev_list_114e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_114f[] = {
+ &pci_dev_info_114f_0002,
+ &pci_dev_info_114f_0003,
+ &pci_dev_info_114f_0004,
+ &pci_dev_info_114f_0005,
+ &pci_dev_info_114f_0006,
+ &pci_dev_info_114f_0009,
+ &pci_dev_info_114f_000a,
+ &pci_dev_info_114f_000c,
+ &pci_dev_info_114f_000d,
+ &pci_dev_info_114f_0011,
+ &pci_dev_info_114f_0012,
+ &pci_dev_info_114f_0013,
+ &pci_dev_info_114f_0014,
+ &pci_dev_info_114f_0015,
+ &pci_dev_info_114f_0016,
+ &pci_dev_info_114f_0017,
+ &pci_dev_info_114f_001a,
+ &pci_dev_info_114f_001b,
+ &pci_dev_info_114f_001d,
+ &pci_dev_info_114f_0023,
+ &pci_dev_info_114f_0024,
+ &pci_dev_info_114f_0026,
+ &pci_dev_info_114f_0027,
+ &pci_dev_info_114f_0034,
+ &pci_dev_info_114f_0035,
+ &pci_dev_info_114f_0040,
+ &pci_dev_info_114f_0042,
+ &pci_dev_info_114f_0070,
+ &pci_dev_info_114f_0071,
+ &pci_dev_info_114f_0072,
+ &pci_dev_info_114f_0073,
+ &pci_dev_info_114f_6001,
+ NULL
+};
+#endif
+#define pci_dev_list_1150 NULL
+#define pci_dev_list_1151 NULL
+#define pci_dev_list_1152 NULL
+#define pci_dev_list_1153 NULL
+#define pci_dev_list_1154 NULL
+#define pci_dev_list_1155 NULL
+#define pci_dev_list_1156 NULL
+#define pci_dev_list_1157 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1158[] = {
+ &pci_dev_info_1158_3011,
+ &pci_dev_info_1158_9050,
+ &pci_dev_info_1158_9051,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1159[] = {
+ &pci_dev_info_1159_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_115a NULL
+#define pci_dev_list_115b NULL
+#define pci_dev_list_115c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_115d[] = {
+ &pci_dev_info_115d_0003,
+ &pci_dev_info_115d_0005,
+ &pci_dev_info_115d_0007,
+ &pci_dev_info_115d_000b,
+ &pci_dev_info_115d_000c,
+ &pci_dev_info_115d_000f,
+ &pci_dev_info_115d_0101,
+ &pci_dev_info_115d_0103,
+ NULL
+};
+#endif
+#define pci_dev_list_115e NULL
+#define pci_dev_list_115f NULL
+#define pci_dev_list_1160 NULL
+#define pci_dev_list_1161 NULL
+#define pci_dev_list_1162 NULL
+static const pciDeviceInfo *pci_dev_list_1163[] = {
+ &pci_dev_info_1163_0001,
+ &pci_dev_info_1163_2000,
+ NULL
+};
+#define pci_dev_list_1164 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1165[] = {
+ &pci_dev_info_1165_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1166[] = {
+ &pci_dev_info_1166_0005,
+ &pci_dev_info_1166_0007,
+ &pci_dev_info_1166_0008,
+ &pci_dev_info_1166_0009,
+ &pci_dev_info_1166_0010,
+ &pci_dev_info_1166_0011,
+ &pci_dev_info_1166_0012,
+ &pci_dev_info_1166_0013,
+ &pci_dev_info_1166_0014,
+ &pci_dev_info_1166_0015,
+ &pci_dev_info_1166_0016,
+ &pci_dev_info_1166_0017,
+ &pci_dev_info_1166_0200,
+ &pci_dev_info_1166_0201,
+ &pci_dev_info_1166_0203,
+ &pci_dev_info_1166_0211,
+ &pci_dev_info_1166_0212,
+ &pci_dev_info_1166_0213,
+ &pci_dev_info_1166_0220,
+ &pci_dev_info_1166_0221,
+ &pci_dev_info_1166_0225,
+ &pci_dev_info_1166_0227,
+ NULL
+};
+#endif
+#define pci_dev_list_1167 NULL
+#define pci_dev_list_1168 NULL
+#define pci_dev_list_1169 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_116a[] = {
+ &pci_dev_info_116a_6100,
+ &pci_dev_info_116a_6800,
+ &pci_dev_info_116a_7100,
+ &pci_dev_info_116a_7800,
+ NULL
+};
+#endif
+#define pci_dev_list_116b NULL
+#define pci_dev_list_116c NULL
+#define pci_dev_list_116d NULL
+#define pci_dev_list_116e NULL
+#define pci_dev_list_116f NULL
+#define pci_dev_list_1170 NULL
+#define pci_dev_list_1171 NULL
+#define pci_dev_list_1172 NULL
+#define pci_dev_list_1173 NULL
+#define pci_dev_list_1174 NULL
+#define pci_dev_list_1175 NULL
+#define pci_dev_list_1176 NULL
+#define pci_dev_list_1177 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1178[] = {
+ &pci_dev_info_1178_afa1,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1179[] = {
+ &pci_dev_info_1179_0103,
+ &pci_dev_info_1179_0404,
+ &pci_dev_info_1179_0406,
+ &pci_dev_info_1179_0407,
+ &pci_dev_info_1179_0601,
+ &pci_dev_info_1179_0603,
+ &pci_dev_info_1179_060a,
+ &pci_dev_info_1179_060f,
+ &pci_dev_info_1179_0617,
+ &pci_dev_info_1179_0618,
+ &pci_dev_info_1179_0701,
+ &pci_dev_info_1179_0804,
+ &pci_dev_info_1179_0805,
+ &pci_dev_info_1179_0d01,
+ NULL
+};
+#endif
+#define pci_dev_list_117a NULL
+#define pci_dev_list_117b NULL
+#define pci_dev_list_117c NULL
+#define pci_dev_list_117d NULL
+#define pci_dev_list_117e NULL
+#define pci_dev_list_117f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1180[] = {
+ &pci_dev_info_1180_0465,
+ &pci_dev_info_1180_0466,
+ &pci_dev_info_1180_0475,
+ &pci_dev_info_1180_0476,
+ &pci_dev_info_1180_0477,
+ &pci_dev_info_1180_0478,
+ &pci_dev_info_1180_0522,
+ &pci_dev_info_1180_0551,
+ &pci_dev_info_1180_0552,
+ NULL
+};
+#endif
+#define pci_dev_list_1181 NULL
+#define pci_dev_list_1183 NULL
+#define pci_dev_list_1184 NULL
+#define pci_dev_list_1185 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1186[] = {
+ &pci_dev_info_1186_0100,
+ &pci_dev_info_1186_1002,
+ &pci_dev_info_1186_1300,
+ &pci_dev_info_1186_1340,
+ &pci_dev_info_1186_1561,
+ &pci_dev_info_1186_4000,
+ NULL
+};
+#endif
+#define pci_dev_list_1187 NULL
+#define pci_dev_list_1188 NULL
+#define pci_dev_list_1189 NULL
+#define pci_dev_list_118a NULL
+#define pci_dev_list_118b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_118c[] = {
+ &pci_dev_info_118c_0014,
+ &pci_dev_info_118c_1117,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_118d[] = {
+ &pci_dev_info_118d_0001,
+ &pci_dev_info_118d_0012,
+ &pci_dev_info_118d_0014,
+ &pci_dev_info_118d_0024,
+ &pci_dev_info_118d_0044,
+ &pci_dev_info_118d_0112,
+ &pci_dev_info_118d_0114,
+ &pci_dev_info_118d_0124,
+ &pci_dev_info_118d_0144,
+ &pci_dev_info_118d_0212,
+ &pci_dev_info_118d_0214,
+ &pci_dev_info_118d_0224,
+ &pci_dev_info_118d_0244,
+ &pci_dev_info_118d_0312,
+ &pci_dev_info_118d_0314,
+ &pci_dev_info_118d_0324,
+ &pci_dev_info_118d_0344,
+ NULL
+};
+#endif
+#define pci_dev_list_118e NULL
+#define pci_dev_list_118f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1190[] = {
+ &pci_dev_info_1190_c731,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1191[] = {
+ &pci_dev_info_1191_0003,
+ &pci_dev_info_1191_0004,
+ &pci_dev_info_1191_0005,
+ &pci_dev_info_1191_0006,
+ &pci_dev_info_1191_0007,
+ &pci_dev_info_1191_0008,
+ &pci_dev_info_1191_0009,
+ &pci_dev_info_1191_8002,
+ &pci_dev_info_1191_8010,
+ &pci_dev_info_1191_8020,
+ &pci_dev_info_1191_8030,
+ &pci_dev_info_1191_8040,
+ &pci_dev_info_1191_8050,
+ NULL
+};
+#endif
+#define pci_dev_list_1192 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1193[] = {
+ &pci_dev_info_1193_0001,
+ &pci_dev_info_1193_0002,
+ NULL
+};
+#endif
+#define pci_dev_list_1194 NULL
+#define pci_dev_list_1195 NULL
+#define pci_dev_list_1196 NULL
+#define pci_dev_list_1197 NULL
+#define pci_dev_list_1198 NULL
+#define pci_dev_list_1199 NULL
+#define pci_dev_list_119a NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_119b[] = {
+ &pci_dev_info_119b_1221,
+ NULL
+};
+#endif
+#define pci_dev_list_119c NULL
+#define pci_dev_list_119d NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_119e[] = {
+ &pci_dev_info_119e_0001,
+ &pci_dev_info_119e_0003,
+ NULL
+};
+#endif
+#define pci_dev_list_119f NULL
+#define pci_dev_list_11a0 NULL
+#define pci_dev_list_11a1 NULL
+#define pci_dev_list_11a2 NULL
+#define pci_dev_list_11a3 NULL
+#define pci_dev_list_11a4 NULL
+#define pci_dev_list_11a5 NULL
+#define pci_dev_list_11a6 NULL
+#define pci_dev_list_11a7 NULL
+#define pci_dev_list_11a8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11a9[] = {
+ &pci_dev_info_11a9_4240,
+ NULL
+};
+#endif
+#define pci_dev_list_11aa NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11ab[] = {
+ &pci_dev_info_11ab_0146,
+ &pci_dev_info_11ab_4611,
+ &pci_dev_info_11ab_4620,
+ &pci_dev_info_11ab_4801,
+ &pci_dev_info_11ab_f003,
+ NULL
+};
+#endif
+#define pci_dev_list_11ac NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11ad[] = {
+ &pci_dev_info_11ad_0002,
+ &pci_dev_info_11ad_c115,
+ NULL
+};
+#endif
+#define pci_dev_list_11ae NULL
+#define pci_dev_list_11af NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11b0[] = {
+ &pci_dev_info_11b0_0002,
+ &pci_dev_info_11b0_0292,
+ &pci_dev_info_11b0_0960,
+ &pci_dev_info_11b0_c960,
+ NULL
+};
+#endif
+#define pci_dev_list_11b1 NULL
+#define pci_dev_list_11b2 NULL
+#define pci_dev_list_11b3 NULL
+#define pci_dev_list_11b4 NULL
+#define pci_dev_list_11b5 NULL
+#define pci_dev_list_11b6 NULL
+#define pci_dev_list_11b7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11b8[] = {
+ &pci_dev_info_11b8_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11b9[] = {
+ &pci_dev_info_11b9_c0ed,
+ NULL
+};
+#endif
+#define pci_dev_list_11ba NULL
+#define pci_dev_list_11bb NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11bc[] = {
+ &pci_dev_info_11bc_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_11bd NULL
+#define pci_dev_list_11be NULL
+#define pci_dev_list_11bf NULL
+#define pci_dev_list_11c0 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11c1[] = {
+ &pci_dev_info_11c1_0440,
+ &pci_dev_info_11c1_0441,
+ &pci_dev_info_11c1_0442,
+ &pci_dev_info_11c1_0443,
+ &pci_dev_info_11c1_0444,
+ &pci_dev_info_11c1_0445,
+ &pci_dev_info_11c1_0446,
+ &pci_dev_info_11c1_0447,
+ &pci_dev_info_11c1_0448,
+ &pci_dev_info_11c1_0449,
+ &pci_dev_info_11c1_044a,
+ &pci_dev_info_11c1_044b,
+ &pci_dev_info_11c1_044c,
+ &pci_dev_info_11c1_044d,
+ &pci_dev_info_11c1_044e,
+ &pci_dev_info_11c1_044f,
+ &pci_dev_info_11c1_0450,
+ &pci_dev_info_11c1_0451,
+ &pci_dev_info_11c1_0452,
+ &pci_dev_info_11c1_0453,
+ &pci_dev_info_11c1_0454,
+ &pci_dev_info_11c1_0455,
+ &pci_dev_info_11c1_0456,
+ &pci_dev_info_11c1_0457,
+ &pci_dev_info_11c1_0458,
+ &pci_dev_info_11c1_0459,
+ &pci_dev_info_11c1_045a,
+ &pci_dev_info_11c1_045c,
+ &pci_dev_info_11c1_0461,
+ &pci_dev_info_11c1_0462,
+ &pci_dev_info_11c1_0480,
+ &pci_dev_info_11c1_5801,
+ &pci_dev_info_11c1_5802,
+ &pci_dev_info_11c1_5803,
+ &pci_dev_info_11c1_5811,
+ NULL
+};
+#endif
+#define pci_dev_list_11c2 NULL
+#define pci_dev_list_11c3 NULL
+#define pci_dev_list_11c4 NULL
+#define pci_dev_list_11c5 NULL
+#define pci_dev_list_11c6 NULL
+#define pci_dev_list_11c7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11c8[] = {
+ &pci_dev_info_11c8_0658,
+ &pci_dev_info_11c8_d665,
+ &pci_dev_info_11c8_d667,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11c9[] = {
+ &pci_dev_info_11c9_0010,
+ &pci_dev_info_11c9_0011,
+ NULL
+};
+#endif
+#define pci_dev_list_11ca NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11cb[] = {
+ &pci_dev_info_11cb_2000,
+ &pci_dev_info_11cb_4000,
+ &pci_dev_info_11cb_8000,
+ NULL
+};
+#endif
+#define pci_dev_list_11cc NULL
+#define pci_dev_list_11cd NULL
+#define pci_dev_list_11ce NULL
+#define pci_dev_list_11cf NULL
+#define pci_dev_list_11d0 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11d1[] = {
+ &pci_dev_info_11d1_01f7,
+ NULL
+};
+#endif
+#define pci_dev_list_11d2 NULL
+#define pci_dev_list_11d3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11d4[] = {
+ &pci_dev_info_11d4_1805,
+ &pci_dev_info_11d4_1889,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11d5[] = {
+ &pci_dev_info_11d5_0115,
+ &pci_dev_info_11d5_0117,
+ NULL
+};
+#endif
+#define pci_dev_list_11d6 NULL
+#define pci_dev_list_11d7 NULL
+#define pci_dev_list_11d8 NULL
+#define pci_dev_list_11d9 NULL
+#define pci_dev_list_11da NULL
+#define pci_dev_list_11db NULL
+#define pci_dev_list_11dc NULL
+#define pci_dev_list_11dd NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11de[] = {
+ &pci_dev_info_11de_6057,
+ &pci_dev_info_11de_6120,
+ NULL
+};
+#endif
+#define pci_dev_list_11df NULL
+#define pci_dev_list_11e0 NULL
+#define pci_dev_list_11e1 NULL
+#define pci_dev_list_11e2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11e3[] = {
+ &pci_dev_info_11e3_5030,
+ NULL
+};
+#endif
+#define pci_dev_list_11e4 NULL
+#define pci_dev_list_11e5 NULL
+#define pci_dev_list_11e6 NULL
+#define pci_dev_list_11e7 NULL
+#define pci_dev_list_11e8 NULL
+#define pci_dev_list_11e9 NULL
+#define pci_dev_list_11ea NULL
+#define pci_dev_list_11eb NULL
+#define pci_dev_list_11ec NULL
+#define pci_dev_list_11ed NULL
+#define pci_dev_list_11ee NULL
+#define pci_dev_list_11ef NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11f0[] = {
+ &pci_dev_info_11f0_4231,
+ &pci_dev_info_11f0_4232,
+ &pci_dev_info_11f0_4233,
+ &pci_dev_info_11f0_4234,
+ &pci_dev_info_11f0_4235,
+ &pci_dev_info_11f0_4236,
+ &pci_dev_info_11f0_4731,
+ NULL
+};
+#endif
+#define pci_dev_list_11f1 NULL
+#define pci_dev_list_11f2 NULL
+#define pci_dev_list_11f3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11f4[] = {
+ &pci_dev_info_11f4_2915,
+ NULL
+};
+#endif
+#define pci_dev_list_11f5 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11f6[] = {
+ &pci_dev_info_11f6_0112,
+ &pci_dev_info_11f6_0113,
+ &pci_dev_info_11f6_1401,
+ &pci_dev_info_11f6_2011,
+ &pci_dev_info_11f6_2201,
+ &pci_dev_info_11f6_9881,
+ NULL
+};
+#endif
+#define pci_dev_list_11f7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11f8[] = {
+ &pci_dev_info_11f8_7375,
+ NULL
+};
+#endif
+#define pci_dev_list_11f9 NULL
+#define pci_dev_list_11fa NULL
+#define pci_dev_list_11fb NULL
+#define pci_dev_list_11fc NULL
+#define pci_dev_list_11fd NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_11fe[] = {
+ &pci_dev_info_11fe_0001,
+ &pci_dev_info_11fe_0002,
+ &pci_dev_info_11fe_0003,
+ &pci_dev_info_11fe_0004,
+ &pci_dev_info_11fe_0005,
+ &pci_dev_info_11fe_0006,
+ &pci_dev_info_11fe_0007,
+ &pci_dev_info_11fe_0008,
+ &pci_dev_info_11fe_0009,
+ &pci_dev_info_11fe_000a,
+ &pci_dev_info_11fe_000b,
+ &pci_dev_info_11fe_000c,
+ &pci_dev_info_11fe_8015,
+ NULL
+};
+#endif
+#define pci_dev_list_11ff NULL
+#define pci_dev_list_1200 NULL
+#define pci_dev_list_1201 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1202[] = {
+ &pci_dev_info_1202_4300,
+ NULL
+};
+#endif
+#define pci_dev_list_1203 NULL
+#define pci_dev_list_1204 NULL
+#define pci_dev_list_1205 NULL
+#define pci_dev_list_1206 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1208[] = {
+ &pci_dev_info_1208_4853,
+ NULL
+};
+#endif
+#define pci_dev_list_1209 NULL
+#define pci_dev_list_120a NULL
+#define pci_dev_list_120b NULL
+#define pci_dev_list_120c NULL
+#define pci_dev_list_120d NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_120e[] = {
+ &pci_dev_info_120e_0100,
+ &pci_dev_info_120e_0101,
+ &pci_dev_info_120e_0102,
+ &pci_dev_info_120e_0103,
+ &pci_dev_info_120e_0104,
+ &pci_dev_info_120e_0105,
+ &pci_dev_info_120e_0200,
+ &pci_dev_info_120e_0201,
+ &pci_dev_info_120e_0300,
+ &pci_dev_info_120e_0301,
+ &pci_dev_info_120e_0310,
+ &pci_dev_info_120e_0311,
+ &pci_dev_info_120e_0320,
+ &pci_dev_info_120e_0321,
+ &pci_dev_info_120e_0400,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_120f[] = {
+ &pci_dev_info_120f_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_1210 NULL
+#define pci_dev_list_1211 NULL
+#define pci_dev_list_1212 NULL
+#define pci_dev_list_1213 NULL
+#define pci_dev_list_1214 NULL
+#define pci_dev_list_1215 NULL
+#define pci_dev_list_1216 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1217[] = {
+ &pci_dev_info_1217_6729,
+ &pci_dev_info_1217_673a,
+ &pci_dev_info_1217_6832,
+ &pci_dev_info_1217_6836,
+ &pci_dev_info_1217_6872,
+ &pci_dev_info_1217_6925,
+ &pci_dev_info_1217_6933,
+ &pci_dev_info_1217_6972,
+ NULL
+};
+#endif
+#define pci_dev_list_1218 NULL
+#define pci_dev_list_1219 NULL
+static const pciDeviceInfo *pci_dev_list_121a[] = {
+ &pci_dev_info_121a_0001,
+ &pci_dev_info_121a_0002,
+ &pci_dev_info_121a_0003,
+ &pci_dev_info_121a_0004,
+ &pci_dev_info_121a_0005,
+ &pci_dev_info_121a_0009,
+ &pci_dev_info_121a_0057,
+ NULL
+};
+#define pci_dev_list_121b NULL
+#define pci_dev_list_121c NULL
+#define pci_dev_list_121d NULL
+#define pci_dev_list_121e NULL
+#define pci_dev_list_121f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1220[] = {
+ &pci_dev_info_1220_1220,
+ NULL
+};
+#endif
+#define pci_dev_list_1221 NULL
+#define pci_dev_list_1222 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1223[] = {
+ &pci_dev_info_1223_0003,
+ &pci_dev_info_1223_0004,
+ &pci_dev_info_1223_0005,
+ &pci_dev_info_1223_0008,
+ &pci_dev_info_1223_0009,
+ &pci_dev_info_1223_000a,
+ &pci_dev_info_1223_000b,
+ &pci_dev_info_1223_000c,
+ &pci_dev_info_1223_000d,
+ &pci_dev_info_1223_000e,
+ NULL
+};
+#endif
+#define pci_dev_list_1224 NULL
+#define pci_dev_list_1225 NULL
+#define pci_dev_list_1227 NULL
+#define pci_dev_list_1228 NULL
+#define pci_dev_list_1229 NULL
+#define pci_dev_list_122a NULL
+#define pci_dev_list_122b NULL
+#define pci_dev_list_122c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_122d[] = {
+ &pci_dev_info_122d_1206,
+ &pci_dev_info_122d_50dc,
+ &pci_dev_info_122d_80da,
+ NULL
+};
+#endif
+#define pci_dev_list_122e NULL
+#define pci_dev_list_122f NULL
+#define pci_dev_list_1230 NULL
+#define pci_dev_list_1231 NULL
+#define pci_dev_list_1232 NULL
+#define pci_dev_list_1233 NULL
+#define pci_dev_list_1234 NULL
+#define pci_dev_list_1235 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1236[] = {
+ &pci_dev_info_1236_0000,
+ &pci_dev_info_1236_6401,
+ NULL
+};
+#endif
+#define pci_dev_list_1237 NULL
+#define pci_dev_list_1238 NULL
+#define pci_dev_list_1239 NULL
+#define pci_dev_list_123a NULL
+#define pci_dev_list_123b NULL
+#define pci_dev_list_123c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_123d[] = {
+ &pci_dev_info_123d_0000,
+ &pci_dev_info_123d_0002,
+ &pci_dev_info_123d_0003,
+ NULL
+};
+#endif
+#define pci_dev_list_123e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_123f[] = {
+ &pci_dev_info_123f_00e4,
+ &pci_dev_info_123f_8120,
+ &pci_dev_info_123f_8888,
+ NULL
+};
+#endif
+#define pci_dev_list_1240 NULL
+#define pci_dev_list_1241 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1242[] = {
+ &pci_dev_info_1242_1560,
+ &pci_dev_info_1242_4643,
+ NULL
+};
+#endif
+#define pci_dev_list_1243 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1244[] = {
+ &pci_dev_info_1244_0700,
+ &pci_dev_info_1244_0800,
+ &pci_dev_info_1244_0a00,
+ &pci_dev_info_1244_0e00,
+ &pci_dev_info_1244_1100,
+ &pci_dev_info_1244_1200,
+ NULL
+};
+#endif
+#define pci_dev_list_1245 NULL
+#define pci_dev_list_1246 NULL
+#define pci_dev_list_1247 NULL
+#define pci_dev_list_1248 NULL
+#define pci_dev_list_1249 NULL
+#define pci_dev_list_124a NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_124b[] = {
+ &pci_dev_info_124b_0040,
+ NULL
+};
+#endif
+#define pci_dev_list_124c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_124d[] = {
+ &pci_dev_info_124d_0000,
+ &pci_dev_info_124d_0002,
+ &pci_dev_info_124d_0003,
+ &pci_dev_info_124d_0004,
+ NULL
+};
+#endif
+#define pci_dev_list_124e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_124f[] = {
+ &pci_dev_info_124f_0041,
+ NULL
+};
+#endif
+#define pci_dev_list_1250 NULL
+#define pci_dev_list_1251 NULL
+#define pci_dev_list_1253 NULL
+#define pci_dev_list_1254 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1255[] = {
+ &pci_dev_info_1255_1110,
+ &pci_dev_info_1255_1210,
+ &pci_dev_info_1255_2110,
+ &pci_dev_info_1255_2120,
+ &pci_dev_info_1255_2130,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1256[] = {
+ &pci_dev_info_1256_4201,
+ &pci_dev_info_1256_4401,
+ &pci_dev_info_1256_5201,
+ NULL
+};
+#endif
+#define pci_dev_list_1257 NULL
+#define pci_dev_list_1258 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1259[] = {
+ &pci_dev_info_1259_2560,
+ NULL
+};
+#endif
+#define pci_dev_list_125a NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_125b[] = {
+ &pci_dev_info_125b_1400,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_125c[] = {
+ &pci_dev_info_125c_0640,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_125d[] = {
+ &pci_dev_info_125d_0000,
+ &pci_dev_info_125d_1948,
+ &pci_dev_info_125d_1968,
+ &pci_dev_info_125d_1969,
+ &pci_dev_info_125d_1978,
+ &pci_dev_info_125d_1988,
+ &pci_dev_info_125d_1989,
+ &pci_dev_info_125d_1998,
+ &pci_dev_info_125d_1999,
+ &pci_dev_info_125d_199a,
+ &pci_dev_info_125d_199b,
+ &pci_dev_info_125d_2808,
+ &pci_dev_info_125d_2838,
+ &pci_dev_info_125d_2898,
+ NULL
+};
+#endif
+#define pci_dev_list_125e NULL
+#define pci_dev_list_125f NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1260[] = {
+ &pci_dev_info_1260_3873,
+ &pci_dev_info_1260_8130,
+ &pci_dev_info_1260_8131,
+ NULL
+};
+#endif
+#define pci_dev_list_1261 NULL
+#define pci_dev_list_1262 NULL
+#define pci_dev_list_1263 NULL
+#define pci_dev_list_1264 NULL
+#define pci_dev_list_1265 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1266[] = {
+ &pci_dev_info_1266_0001,
+ &pci_dev_info_1266_1910,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1267[] = {
+ &pci_dev_info_1267_5352,
+ &pci_dev_info_1267_5a4b,
+ NULL
+};
+#endif
+#define pci_dev_list_1268 NULL
+#define pci_dev_list_1269 NULL
+#define pci_dev_list_126a NULL
+#define pci_dev_list_126b NULL
+#define pci_dev_list_126c NULL
+#define pci_dev_list_126d NULL
+#define pci_dev_list_126e NULL
+static const pciDeviceInfo *pci_dev_list_126f[] = {
+ &pci_dev_info_126f_0710,
+ &pci_dev_info_126f_0712,
+ &pci_dev_info_126f_0720,
+ &pci_dev_info_126f_0810,
+ &pci_dev_info_126f_0811,
+ &pci_dev_info_126f_0820,
+ &pci_dev_info_126f_0910,
+ NULL
+};
+#define pci_dev_list_1270 NULL
+#define pci_dev_list_1271 NULL
+#define pci_dev_list_1272 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1273[] = {
+ &pci_dev_info_1273_0002,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1274[] = {
+ &pci_dev_info_1274_1371,
+ &pci_dev_info_1274_5000,
+ &pci_dev_info_1274_5880,
+ NULL
+};
+#endif
+#define pci_dev_list_1275 NULL
+#define pci_dev_list_1276 NULL
+#define pci_dev_list_1277 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1278[] = {
+ &pci_dev_info_1278_0701,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1279[] = {
+ &pci_dev_info_1279_0295,
+ &pci_dev_info_1279_0395,
+ &pci_dev_info_1279_0396,
+ &pci_dev_info_1279_0397,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_127a[] = {
+ &pci_dev_info_127a_1002,
+ &pci_dev_info_127a_1003,
+ &pci_dev_info_127a_1004,
+ &pci_dev_info_127a_1005,
+ &pci_dev_info_127a_1022,
+ &pci_dev_info_127a_1023,
+ &pci_dev_info_127a_1024,
+ &pci_dev_info_127a_1025,
+ &pci_dev_info_127a_1026,
+ &pci_dev_info_127a_1032,
+ &pci_dev_info_127a_1033,
+ &pci_dev_info_127a_1034,
+ &pci_dev_info_127a_1035,
+ &pci_dev_info_127a_1036,
+ &pci_dev_info_127a_1085,
+ &pci_dev_info_127a_2005,
+ &pci_dev_info_127a_2013,
+ &pci_dev_info_127a_2014,
+ &pci_dev_info_127a_2015,
+ &pci_dev_info_127a_2016,
+ &pci_dev_info_127a_4311,
+ &pci_dev_info_127a_4320,
+ &pci_dev_info_127a_4321,
+ &pci_dev_info_127a_4322,
+ &pci_dev_info_127a_8234,
+ NULL
+};
+#endif
+#define pci_dev_list_127b NULL
+#define pci_dev_list_127c NULL
+#define pci_dev_list_127d NULL
+#define pci_dev_list_127e NULL
+#define pci_dev_list_127f NULL
+#define pci_dev_list_1280 NULL
+#define pci_dev_list_1281 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1282[] = {
+ &pci_dev_info_1282_9009,
+ &pci_dev_info_1282_9100,
+ &pci_dev_info_1282_9102,
+ &pci_dev_info_1282_9132,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1283[] = {
+ &pci_dev_info_1283_673a,
+ &pci_dev_info_1283_8330,
+ &pci_dev_info_1283_8888,
+ &pci_dev_info_1283_8889,
+ &pci_dev_info_1283_e886,
+ NULL
+};
+#endif
+#define pci_dev_list_1284 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1285[] = {
+ &pci_dev_info_1285_0100,
+ NULL
+};
+#endif
+#define pci_dev_list_1286 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1287[] = {
+ &pci_dev_info_1287_001e,
+ &pci_dev_info_1287_001f,
+ NULL
+};
+#endif
+#define pci_dev_list_1288 NULL
+#define pci_dev_list_1289 NULL
+#define pci_dev_list_128a NULL
+#define pci_dev_list_128b NULL
+#define pci_dev_list_128c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_128d[] = {
+ &pci_dev_info_128d_0021,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_128e[] = {
+ &pci_dev_info_128e_0008,
+ &pci_dev_info_128e_0009,
+ &pci_dev_info_128e_000a,
+ &pci_dev_info_128e_000b,
+ &pci_dev_info_128e_000c,
+ NULL
+};
+#endif
+#define pci_dev_list_128f NULL
+#define pci_dev_list_1290 NULL
+#define pci_dev_list_1291 NULL
+#define pci_dev_list_1292 NULL
+#define pci_dev_list_1293 NULL
+#define pci_dev_list_1294 NULL
+#define pci_dev_list_1295 NULL
+#define pci_dev_list_1296 NULL
+#define pci_dev_list_1297 NULL
+#define pci_dev_list_1298 NULL
+#define pci_dev_list_1299 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_129a[] = {
+ &pci_dev_info_129a_0615,
+ NULL
+};
+#endif
+#define pci_dev_list_129b NULL
+#define pci_dev_list_129c NULL
+#define pci_dev_list_129d NULL
+#define pci_dev_list_129e NULL
+#define pci_dev_list_129f NULL
+#define pci_dev_list_12a0 NULL
+#define pci_dev_list_12a1 NULL
+#define pci_dev_list_12a2 NULL
+#define pci_dev_list_12a3 NULL
+#define pci_dev_list_12a4 NULL
+#define pci_dev_list_12a5 NULL
+#define pci_dev_list_12a6 NULL
+#define pci_dev_list_12a7 NULL
+#define pci_dev_list_12a8 NULL
+#define pci_dev_list_12a9 NULL
+#define pci_dev_list_12aa NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12ab[] = {
+ &pci_dev_info_12ab_3000,
+ NULL
+};
+#endif
+#define pci_dev_list_12ac NULL
+#define pci_dev_list_12ad NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12ae[] = {
+ &pci_dev_info_12ae_0001,
+ &pci_dev_info_12ae_0002,
+ NULL
+};
+#endif
+#define pci_dev_list_12af NULL
+#define pci_dev_list_12b0 NULL
+#define pci_dev_list_12b1 NULL
+#define pci_dev_list_12b2 NULL
+#define pci_dev_list_12b3 NULL
+#define pci_dev_list_12b4 NULL
+#define pci_dev_list_12b5 NULL
+#define pci_dev_list_12b6 NULL
+#define pci_dev_list_12b7 NULL
+#define pci_dev_list_12b8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12b9[] = {
+ &pci_dev_info_12b9_1006,
+ &pci_dev_info_12b9_1007,
+ &pci_dev_info_12b9_1008,
+ NULL
+};
+#endif
+#define pci_dev_list_12ba NULL
+#define pci_dev_list_12bb NULL
+#define pci_dev_list_12bc NULL
+#define pci_dev_list_12bd NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12be[] = {
+ &pci_dev_info_12be_3041,
+ &pci_dev_info_12be_3042,
+ NULL
+};
+#endif
+#define pci_dev_list_12bf NULL
+#define pci_dev_list_12c0 NULL
+#define pci_dev_list_12c1 NULL
+#define pci_dev_list_12c2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12c3[] = {
+ &pci_dev_info_12c3_0058,
+ &pci_dev_info_12c3_5598,
+ NULL
+};
+#endif
+#define pci_dev_list_12c4 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12c5[] = {
+ &pci_dev_info_12c5_007e,
+ &pci_dev_info_12c5_007f,
+ &pci_dev_info_12c5_0081,
+ &pci_dev_info_12c5_0085,
+ &pci_dev_info_12c5_0086,
+ NULL
+};
+#endif
+#define pci_dev_list_12c6 NULL
+#define pci_dev_list_12c7 NULL
+#define pci_dev_list_12c8 NULL
+#define pci_dev_list_12c9 NULL
+#define pci_dev_list_12ca NULL
+#define pci_dev_list_12cb NULL
+#define pci_dev_list_12cc NULL
+#define pci_dev_list_12cd NULL
+#define pci_dev_list_12ce NULL
+#define pci_dev_list_12cf NULL
+#define pci_dev_list_12d0 NULL
+#define pci_dev_list_12d1 NULL
+static const pciDeviceInfo *pci_dev_list_12d2[] = {
+ &pci_dev_info_12d2_0008,
+ &pci_dev_info_12d2_0009,
+ &pci_dev_info_12d2_0018,
+ &pci_dev_info_12d2_0019,
+ &pci_dev_info_12d2_0020,
+ &pci_dev_info_12d2_0028,
+ &pci_dev_info_12d2_0029,
+ &pci_dev_info_12d2_002c,
+ &pci_dev_info_12d2_00a0,
+ NULL
+};
+#define pci_dev_list_12d3 NULL
+#define pci_dev_list_12d4 NULL
+#define pci_dev_list_12d5 NULL
+#define pci_dev_list_12d6 NULL
+#define pci_dev_list_12d7 NULL
+#define pci_dev_list_12d8 NULL
+#define pci_dev_list_12d9 NULL
+#define pci_dev_list_12da NULL
+#define pci_dev_list_12db NULL
+#define pci_dev_list_12dc NULL
+#define pci_dev_list_12dd NULL
+#define pci_dev_list_12de NULL
+#define pci_dev_list_12df NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12e0[] = {
+ &pci_dev_info_12e0_0010,
+ &pci_dev_info_12e0_0020,
+ &pci_dev_info_12e0_0030,
+ NULL
+};
+#endif
+#define pci_dev_list_12e1 NULL
+#define pci_dev_list_12e2 NULL
+#define pci_dev_list_12e3 NULL
+#define pci_dev_list_12e4 NULL
+#define pci_dev_list_12e5 NULL
+#define pci_dev_list_12e6 NULL
+#define pci_dev_list_12e7 NULL
+#define pci_dev_list_12e8 NULL
+#define pci_dev_list_12e9 NULL
+#define pci_dev_list_12ea NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12eb[] = {
+ &pci_dev_info_12eb_0001,
+ &pci_dev_info_12eb_0002,
+ &pci_dev_info_12eb_0003,
+ &pci_dev_info_12eb_8803,
+ NULL
+};
+#endif
+#define pci_dev_list_12ec NULL
+#define pci_dev_list_12ed NULL
+#define pci_dev_list_12ee NULL
+#define pci_dev_list_12ef NULL
+#define pci_dev_list_12f0 NULL
+#define pci_dev_list_12f1 NULL
+#define pci_dev_list_12f2 NULL
+#define pci_dev_list_12f3 NULL
+#define pci_dev_list_12f4 NULL
+#define pci_dev_list_12f5 NULL
+#define pci_dev_list_12f6 NULL
+#define pci_dev_list_12f7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_12f8[] = {
+ &pci_dev_info_12f8_0002,
+ NULL
+};
+#endif
+#define pci_dev_list_12f9 NULL
+#define pci_dev_list_12fb NULL
+#define pci_dev_list_12fc NULL
+#define pci_dev_list_12fd NULL
+#define pci_dev_list_12fe NULL
+#define pci_dev_list_12ff NULL
+#define pci_dev_list_1300 NULL
+#define pci_dev_list_1302 NULL
+#define pci_dev_list_1303 NULL
+#define pci_dev_list_1304 NULL
+#define pci_dev_list_1305 NULL
+#define pci_dev_list_1306 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1307[] = {
+ &pci_dev_info_1307_0001,
+ &pci_dev_info_1307_000b,
+ &pci_dev_info_1307_000c,
+ &pci_dev_info_1307_000d,
+ &pci_dev_info_1307_000f,
+ &pci_dev_info_1307_0010,
+ &pci_dev_info_1307_0014,
+ &pci_dev_info_1307_0015,
+ &pci_dev_info_1307_0016,
+ &pci_dev_info_1307_0017,
+ &pci_dev_info_1307_0018,
+ &pci_dev_info_1307_0019,
+ &pci_dev_info_1307_001a,
+ &pci_dev_info_1307_001b,
+ &pci_dev_info_1307_001c,
+ &pci_dev_info_1307_001d,
+ &pci_dev_info_1307_001e,
+ &pci_dev_info_1307_001f,
+ &pci_dev_info_1307_0020,
+ &pci_dev_info_1307_0021,
+ &pci_dev_info_1307_0022,
+ &pci_dev_info_1307_0023,
+ &pci_dev_info_1307_0024,
+ &pci_dev_info_1307_0025,
+ &pci_dev_info_1307_0026,
+ &pci_dev_info_1307_0027,
+ &pci_dev_info_1307_0028,
+ &pci_dev_info_1307_0029,
+ &pci_dev_info_1307_002c,
+ &pci_dev_info_1307_0033,
+ &pci_dev_info_1307_0034,
+ &pci_dev_info_1307_0035,
+ &pci_dev_info_1307_0036,
+ &pci_dev_info_1307_0037,
+ &pci_dev_info_1307_004c,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1308[] = {
+ &pci_dev_info_1308_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_1309 NULL
+#define pci_dev_list_130a NULL
+#define pci_dev_list_130b NULL
+#define pci_dev_list_130c NULL
+#define pci_dev_list_130d NULL
+#define pci_dev_list_130e NULL
+#define pci_dev_list_130f NULL
+#define pci_dev_list_1310 NULL
+#define pci_dev_list_1311 NULL
+#define pci_dev_list_1312 NULL
+#define pci_dev_list_1313 NULL
+#define pci_dev_list_1316 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1317[] = {
+ &pci_dev_info_1317_0981,
+ &pci_dev_info_1317_0985,
+ &pci_dev_info_1317_1985,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1318[] = {
+ &pci_dev_info_1318_0911,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1319[] = {
+ &pci_dev_info_1319_0801,
+ &pci_dev_info_1319_0802,
+ &pci_dev_info_1319_1000,
+ &pci_dev_info_1319_1001,
+ NULL
+};
+#endif
+#define pci_dev_list_131a NULL
+#define pci_dev_list_131c NULL
+#define pci_dev_list_131d NULL
+#define pci_dev_list_131e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_131f[] = {
+ &pci_dev_info_131f_1000,
+ &pci_dev_info_131f_1001,
+ &pci_dev_info_131f_1002,
+ &pci_dev_info_131f_1010,
+ &pci_dev_info_131f_1011,
+ &pci_dev_info_131f_1012,
+ &pci_dev_info_131f_1020,
+ &pci_dev_info_131f_1021,
+ &pci_dev_info_131f_1030,
+ &pci_dev_info_131f_1031,
+ &pci_dev_info_131f_1032,
+ &pci_dev_info_131f_1034,
+ &pci_dev_info_131f_1035,
+ &pci_dev_info_131f_1036,
+ &pci_dev_info_131f_1050,
+ &pci_dev_info_131f_1051,
+ &pci_dev_info_131f_1052,
+ &pci_dev_info_131f_2000,
+ &pci_dev_info_131f_2001,
+ &pci_dev_info_131f_2002,
+ &pci_dev_info_131f_2010,
+ &pci_dev_info_131f_2011,
+ &pci_dev_info_131f_2012,
+ &pci_dev_info_131f_2020,
+ &pci_dev_info_131f_2021,
+ &pci_dev_info_131f_2030,
+ &pci_dev_info_131f_2031,
+ &pci_dev_info_131f_2032,
+ &pci_dev_info_131f_2040,
+ &pci_dev_info_131f_2041,
+ &pci_dev_info_131f_2042,
+ &pci_dev_info_131f_2050,
+ &pci_dev_info_131f_2051,
+ &pci_dev_info_131f_2052,
+ &pci_dev_info_131f_2060,
+ &pci_dev_info_131f_2061,
+ &pci_dev_info_131f_2062,
+ NULL
+};
+#endif
+#define pci_dev_list_1320 NULL
+#define pci_dev_list_1321 NULL
+#define pci_dev_list_1322 NULL
+#define pci_dev_list_1323 NULL
+#define pci_dev_list_1324 NULL
+#define pci_dev_list_1325 NULL
+#define pci_dev_list_1326 NULL
+#define pci_dev_list_1327 NULL
+#define pci_dev_list_1328 NULL
+#define pci_dev_list_1329 NULL
+#define pci_dev_list_132a NULL
+#define pci_dev_list_132b NULL
+#define pci_dev_list_132c NULL
+#define pci_dev_list_132d NULL
+#define pci_dev_list_1330 NULL
+#define pci_dev_list_1331 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1332[] = {
+ &pci_dev_info_1332_5415,
+ NULL
+};
+#endif
+#define pci_dev_list_1334 NULL
+#define pci_dev_list_1335 NULL
+#define pci_dev_list_1337 NULL
+#define pci_dev_list_1338 NULL
+#define pci_dev_list_133a NULL
+#define pci_dev_list_133b NULL
+#define pci_dev_list_133c NULL
+#define pci_dev_list_133d NULL
+#define pci_dev_list_133e NULL
+#define pci_dev_list_133f NULL
+#define pci_dev_list_1340 NULL
+#define pci_dev_list_1341 NULL
+#define pci_dev_list_1342 NULL
+#define pci_dev_list_1343 NULL
+#define pci_dev_list_1344 NULL
+#define pci_dev_list_1345 NULL
+#define pci_dev_list_1347 NULL
+#define pci_dev_list_1349 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_134a[] = {
+ &pci_dev_info_134a_0001,
+ &pci_dev_info_134a_0002,
+ NULL
+};
+#endif
+#define pci_dev_list_134b NULL
+#define pci_dev_list_134c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_134d[] = {
+ &pci_dev_info_134d_7890,
+ &pci_dev_info_134d_7891,
+ &pci_dev_info_134d_7892,
+ &pci_dev_info_134d_7893,
+ &pci_dev_info_134d_7894,
+ &pci_dev_info_134d_7895,
+ &pci_dev_info_134d_7896,
+ &pci_dev_info_134d_7897,
+ NULL
+};
+#endif
+#define pci_dev_list_134e NULL
+#define pci_dev_list_134f NULL
+#define pci_dev_list_1350 NULL
+#define pci_dev_list_1351 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1353[] = {
+ &pci_dev_info_1353_0002,
+ &pci_dev_info_1353_0003,
+ &pci_dev_info_1353_0004,
+ &pci_dev_info_1353_0005,
+ NULL
+};
+#endif
+#define pci_dev_list_1354 NULL
+#define pci_dev_list_1355 NULL
+#define pci_dev_list_1356 NULL
+#define pci_dev_list_1359 NULL
+#define pci_dev_list_135a NULL
+#define pci_dev_list_135b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_135c[] = {
+ &pci_dev_info_135c_0010,
+ &pci_dev_info_135c_0020,
+ &pci_dev_info_135c_0030,
+ &pci_dev_info_135c_0040,
+ &pci_dev_info_135c_0050,
+ &pci_dev_info_135c_0060,
+ &pci_dev_info_135c_00f0,
+ &pci_dev_info_135c_0170,
+ &pci_dev_info_135c_0180,
+ &pci_dev_info_135c_0190,
+ &pci_dev_info_135c_01a0,
+ &pci_dev_info_135c_01b0,
+ &pci_dev_info_135c_01c0,
+ NULL
+};
+#endif
+#define pci_dev_list_135d NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_135e[] = {
+ &pci_dev_info_135e_7101,
+ &pci_dev_info_135e_7201,
+ &pci_dev_info_135e_7202,
+ &pci_dev_info_135e_7401,
+ &pci_dev_info_135e_7402,
+ &pci_dev_info_135e_7801,
+ &pci_dev_info_135e_8001,
+ NULL
+};
+#endif
+#define pci_dev_list_135f NULL
+#define pci_dev_list_1360 NULL
+#define pci_dev_list_1361 NULL
+#define pci_dev_list_1362 NULL
+#define pci_dev_list_1363 NULL
+#define pci_dev_list_1364 NULL
+#define pci_dev_list_1365 NULL
+#define pci_dev_list_1366 NULL
+#define pci_dev_list_1367 NULL
+#define pci_dev_list_1368 NULL
+#define pci_dev_list_1369 NULL
+#define pci_dev_list_136a NULL
+#define pci_dev_list_136b NULL
+#define pci_dev_list_136c NULL
+#define pci_dev_list_136d NULL
+#define pci_dev_list_136f NULL
+#define pci_dev_list_1370 NULL
+#define pci_dev_list_1371 NULL
+#define pci_dev_list_1373 NULL
+#define pci_dev_list_1374 NULL
+#define pci_dev_list_1375 NULL
+#define pci_dev_list_1376 NULL
+#define pci_dev_list_1377 NULL
+#define pci_dev_list_1378 NULL
+#define pci_dev_list_1379 NULL
+#define pci_dev_list_137a NULL
+#define pci_dev_list_137b NULL
+#define pci_dev_list_137c NULL
+#define pci_dev_list_137d NULL
+#define pci_dev_list_137e NULL
+#define pci_dev_list_137f NULL
+#define pci_dev_list_1380 NULL
+#define pci_dev_list_1381 NULL
+#define pci_dev_list_1382 NULL
+#define pci_dev_list_1383 NULL
+#define pci_dev_list_1384 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1385[] = {
+ &pci_dev_info_1385_4100,
+ &pci_dev_info_1385_620a,
+ &pci_dev_info_1385_622a,
+ &pci_dev_info_1385_630a,
+ &pci_dev_info_1385_f311,
+ NULL
+};
+#endif
+#define pci_dev_list_1386 NULL
+#define pci_dev_list_1387 NULL
+#define pci_dev_list_1388 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1389[] = {
+ &pci_dev_info_1389_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_138a NULL
+#define pci_dev_list_138b NULL
+#define pci_dev_list_138c NULL
+#define pci_dev_list_138d NULL
+#define pci_dev_list_138e NULL
+#define pci_dev_list_138f NULL
+#define pci_dev_list_1390 NULL
+#define pci_dev_list_1391 NULL
+#define pci_dev_list_1392 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1393[] = {
+ &pci_dev_info_1393_1040,
+ &pci_dev_info_1393_1680,
+ &pci_dev_info_1393_2040,
+ &pci_dev_info_1393_2180,
+ &pci_dev_info_1393_3200,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1394[] = {
+ &pci_dev_info_1394_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_1395 NULL
+#define pci_dev_list_1396 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1397[] = {
+ &pci_dev_info_1397_2bd0,
+ NULL
+};
+#endif
+#define pci_dev_list_1398 NULL
+#define pci_dev_list_1399 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_139a[] = {
+ &pci_dev_info_139a_0001,
+ &pci_dev_info_139a_0003,
+ &pci_dev_info_139a_0005,
+ NULL
+};
+#endif
+#define pci_dev_list_139b NULL
+#define pci_dev_list_139c NULL
+#define pci_dev_list_139d NULL
+#define pci_dev_list_139e NULL
+#define pci_dev_list_139f NULL
+#define pci_dev_list_13a0 NULL
+#define pci_dev_list_13a1 NULL
+#define pci_dev_list_13a2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13a3[] = {
+ &pci_dev_info_13a3_0005,
+ &pci_dev_info_13a3_0006,
+ &pci_dev_info_13a3_0007,
+ &pci_dev_info_13a3_0012,
+ &pci_dev_info_13a3_0014,
+ &pci_dev_info_13a3_0016,
+ &pci_dev_info_13a3_0017,
+ &pci_dev_info_13a3_0018,
+ NULL
+};
+#endif
+#define pci_dev_list_13a4 NULL
+#define pci_dev_list_13a5 NULL
+#define pci_dev_list_13a6 NULL
+#define pci_dev_list_13a7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13a8[] = {
+ &pci_dev_info_13a8_0158,
+ NULL
+};
+#endif
+#define pci_dev_list_13a9 NULL
+#define pci_dev_list_13aa NULL
+#define pci_dev_list_13ab NULL
+#define pci_dev_list_13ac NULL
+#define pci_dev_list_13ad NULL
+#define pci_dev_list_13ae NULL
+#define pci_dev_list_13af NULL
+#define pci_dev_list_13b0 NULL
+#define pci_dev_list_13b1 NULL
+#define pci_dev_list_13b2 NULL
+#define pci_dev_list_13b3 NULL
+#define pci_dev_list_13b4 NULL
+#define pci_dev_list_13b5 NULL
+#define pci_dev_list_13b6 NULL
+#define pci_dev_list_13b7 NULL
+#define pci_dev_list_13b8 NULL
+#define pci_dev_list_13b9 NULL
+#define pci_dev_list_13ba NULL
+#define pci_dev_list_13bb NULL
+#define pci_dev_list_13bc NULL
+#define pci_dev_list_13bd NULL
+#define pci_dev_list_13be NULL
+#define pci_dev_list_13bf NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13c0[] = {
+ &pci_dev_info_13c0_0010,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13c1[] = {
+ &pci_dev_info_13c1_1000,
+ &pci_dev_info_13c1_1001,
+ &pci_dev_info_13c1_1002,
+ NULL
+};
+#endif
+#define pci_dev_list_13c2 NULL
+#define pci_dev_list_13c3 NULL
+#define pci_dev_list_13c4 NULL
+#define pci_dev_list_13c5 NULL
+#define pci_dev_list_13c6 NULL
+#define pci_dev_list_13c7 NULL
+#define pci_dev_list_13c8 NULL
+#define pci_dev_list_13c9 NULL
+#define pci_dev_list_13ca NULL
+#define pci_dev_list_13cb NULL
+#define pci_dev_list_13cc NULL
+#define pci_dev_list_13cd NULL
+#define pci_dev_list_13ce NULL
+#define pci_dev_list_13cf NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13d0[] = {
+ &pci_dev_info_13d0_2103,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13d1[] = {
+ &pci_dev_info_13d1_ab02,
+ &pci_dev_info_13d1_ab06,
+ NULL
+};
+#endif
+#define pci_dev_list_13d2 NULL
+#define pci_dev_list_13d3 NULL
+#define pci_dev_list_13d4 NULL
+#define pci_dev_list_13d5 NULL
+#define pci_dev_list_13d6 NULL
+#define pci_dev_list_13d7 NULL
+#define pci_dev_list_13d8 NULL
+#define pci_dev_list_13d9 NULL
+#define pci_dev_list_13da NULL
+#define pci_dev_list_13db NULL
+#define pci_dev_list_13dc NULL
+#define pci_dev_list_13dd NULL
+#define pci_dev_list_13de NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13df[] = {
+ &pci_dev_info_13df_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_13e0 NULL
+#define pci_dev_list_13e1 NULL
+#define pci_dev_list_13e2 NULL
+#define pci_dev_list_13e3 NULL
+#define pci_dev_list_13e4 NULL
+#define pci_dev_list_13e5 NULL
+#define pci_dev_list_13e6 NULL
+#define pci_dev_list_13e7 NULL
+#define pci_dev_list_13e8 NULL
+#define pci_dev_list_13e9 NULL
+#define pci_dev_list_13ea NULL
+#define pci_dev_list_13eb NULL
+#define pci_dev_list_13ec NULL
+#define pci_dev_list_13ed NULL
+#define pci_dev_list_13ee NULL
+#define pci_dev_list_13ef NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13f0[] = {
+ &pci_dev_info_13f0_0201,
+ NULL
+};
+#endif
+#define pci_dev_list_13f1 NULL
+#define pci_dev_list_13f2 NULL
+#define pci_dev_list_13f3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13f4[] = {
+ &pci_dev_info_13f4_1401,
+ NULL
+};
+#endif
+#define pci_dev_list_13f5 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13f6[] = {
+ &pci_dev_info_13f6_0100,
+ &pci_dev_info_13f6_0101,
+ &pci_dev_info_13f6_0111,
+ &pci_dev_info_13f6_0211,
+ NULL
+};
+#endif
+#define pci_dev_list_13f7 NULL
+#define pci_dev_list_13f8 NULL
+#define pci_dev_list_13f9 NULL
+#define pci_dev_list_13fa NULL
+#define pci_dev_list_13fb NULL
+#define pci_dev_list_13fc NULL
+#define pci_dev_list_13fd NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_13fe[] = {
+ &pci_dev_info_13fe_1756,
+ NULL
+};
+#endif
+#define pci_dev_list_13ff NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1400[] = {
+ &pci_dev_info_1400_1401,
+ NULL
+};
+#endif
+#define pci_dev_list_1401 NULL
+#define pci_dev_list_1402 NULL
+#define pci_dev_list_1403 NULL
+#define pci_dev_list_1404 NULL
+#define pci_dev_list_1405 NULL
+#define pci_dev_list_1406 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1407[] = {
+ &pci_dev_info_1407_0100,
+ &pci_dev_info_1407_0101,
+ &pci_dev_info_1407_0102,
+ &pci_dev_info_1407_0200,
+ &pci_dev_info_1407_0201,
+ &pci_dev_info_1407_0202,
+ &pci_dev_info_1407_0500,
+ &pci_dev_info_1407_0600,
+ &pci_dev_info_1407_8000,
+ &pci_dev_info_1407_8001,
+ &pci_dev_info_1407_8002,
+ &pci_dev_info_1407_8003,
+ &pci_dev_info_1407_8800,
+ NULL
+};
+#endif
+#define pci_dev_list_1408 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1409[] = {
+ &pci_dev_info_1409_7168,
+ NULL
+};
+#endif
+#define pci_dev_list_140a NULL
+#define pci_dev_list_140b NULL
+#define pci_dev_list_140c NULL
+#define pci_dev_list_140d NULL
+#define pci_dev_list_140e NULL
+#define pci_dev_list_140f NULL
+#define pci_dev_list_1410 NULL
+#define pci_dev_list_1411 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1412[] = {
+ &pci_dev_info_1412_1712,
+ &pci_dev_info_1412_1724,
+ NULL
+};
+#endif
+#define pci_dev_list_1413 NULL
+#define pci_dev_list_1414 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1415[] = {
+ &pci_dev_info_1415_8403,
+ &pci_dev_info_1415_9501,
+ &pci_dev_info_1415_950a,
+ &pci_dev_info_1415_950b,
+ &pci_dev_info_1415_9511,
+ &pci_dev_info_1415_9521,
+ NULL
+};
+#endif
+#define pci_dev_list_1416 NULL
+#define pci_dev_list_1417 NULL
+#define pci_dev_list_1418 NULL
+#define pci_dev_list_1419 NULL
+#define pci_dev_list_141a NULL
+#define pci_dev_list_141b NULL
+#define pci_dev_list_141d NULL
+#define pci_dev_list_141e NULL
+#define pci_dev_list_141f NULL
+#define pci_dev_list_1420 NULL
+#define pci_dev_list_1421 NULL
+#define pci_dev_list_1422 NULL
+#define pci_dev_list_1423 NULL
+#define pci_dev_list_1424 NULL
+#define pci_dev_list_1425 NULL
+#define pci_dev_list_1426 NULL
+#define pci_dev_list_1427 NULL
+#define pci_dev_list_1428 NULL
+#define pci_dev_list_1429 NULL
+#define pci_dev_list_142a NULL
+#define pci_dev_list_142b NULL
+#define pci_dev_list_142c NULL
+#define pci_dev_list_142d NULL
+#define pci_dev_list_142e NULL
+#define pci_dev_list_142f NULL
+#define pci_dev_list_1430 NULL
+#define pci_dev_list_1431 NULL
+#define pci_dev_list_1432 NULL
+#define pci_dev_list_1433 NULL
+#define pci_dev_list_1435 NULL
+#define pci_dev_list_1436 NULL
+#define pci_dev_list_1437 NULL
+#define pci_dev_list_1438 NULL
+#define pci_dev_list_1439 NULL
+#define pci_dev_list_143a NULL
+#define pci_dev_list_143b NULL
+#define pci_dev_list_143c NULL
+#define pci_dev_list_143d NULL
+#define pci_dev_list_143e NULL
+#define pci_dev_list_143f NULL
+#define pci_dev_list_1440 NULL
+#define pci_dev_list_1441 NULL
+#define pci_dev_list_1442 NULL
+#define pci_dev_list_1443 NULL
+#define pci_dev_list_1444 NULL
+#define pci_dev_list_1445 NULL
+#define pci_dev_list_1446 NULL
+#define pci_dev_list_1447 NULL
+#define pci_dev_list_1448 NULL
+#define pci_dev_list_1449 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_144a[] = {
+ &pci_dev_info_144a_7296,
+ &pci_dev_info_144a_7432,
+ &pci_dev_info_144a_7433,
+ &pci_dev_info_144a_7434,
+ &pci_dev_info_144a_7841,
+ &pci_dev_info_144a_8133,
+ &pci_dev_info_144a_8554,
+ &pci_dev_info_144a_9111,
+ &pci_dev_info_144a_9113,
+ &pci_dev_info_144a_9114,
+ NULL
+};
+#endif
+#define pci_dev_list_144b NULL
+#define pci_dev_list_144c NULL
+#define pci_dev_list_144d NULL
+#define pci_dev_list_144e NULL
+#define pci_dev_list_144f NULL
+#define pci_dev_list_1450 NULL
+#define pci_dev_list_1451 NULL
+#define pci_dev_list_1453 NULL
+#define pci_dev_list_1454 NULL
+#define pci_dev_list_1455 NULL
+#define pci_dev_list_1456 NULL
+#define pci_dev_list_1457 NULL
+#define pci_dev_list_1458 NULL
+#define pci_dev_list_1459 NULL
+#define pci_dev_list_145a NULL
+#define pci_dev_list_145b NULL
+#define pci_dev_list_145c NULL
+#define pci_dev_list_145d NULL
+#define pci_dev_list_145e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_145f[] = {
+ &pci_dev_info_145f_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_1460 NULL
+#define pci_dev_list_1461 NULL
+#define pci_dev_list_1462 NULL
+#define pci_dev_list_1463 NULL
+#define pci_dev_list_1464 NULL
+#define pci_dev_list_1465 NULL
+#define pci_dev_list_1466 NULL
+#define pci_dev_list_1467 NULL
+#define pci_dev_list_1468 NULL
+#define pci_dev_list_1469 NULL
+#define pci_dev_list_146a NULL
+#define pci_dev_list_146b NULL
+#define pci_dev_list_146c NULL
+#define pci_dev_list_146d NULL
+#define pci_dev_list_146e NULL
+#define pci_dev_list_146f NULL
+#define pci_dev_list_1470 NULL
+#define pci_dev_list_1471 NULL
+#define pci_dev_list_1472 NULL
+#define pci_dev_list_1473 NULL
+#define pci_dev_list_1474 NULL
+#define pci_dev_list_1475 NULL
+#define pci_dev_list_1476 NULL
+#define pci_dev_list_1477 NULL
+#define pci_dev_list_1478 NULL
+#define pci_dev_list_1479 NULL
+#define pci_dev_list_147a NULL
+#define pci_dev_list_147b NULL
+#define pci_dev_list_147c NULL
+#define pci_dev_list_147d NULL
+#define pci_dev_list_147e NULL
+#define pci_dev_list_147f NULL
+#define pci_dev_list_1480 NULL
+#define pci_dev_list_1481 NULL
+#define pci_dev_list_1482 NULL
+#define pci_dev_list_1483 NULL
+#define pci_dev_list_1484 NULL
+#define pci_dev_list_1485 NULL
+#define pci_dev_list_1486 NULL
+#define pci_dev_list_1487 NULL
+#define pci_dev_list_1488 NULL
+#define pci_dev_list_1489 NULL
+#define pci_dev_list_148a NULL
+#define pci_dev_list_148b NULL
+#define pci_dev_list_148c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_148d[] = {
+ &pci_dev_info_148d_1003,
+ NULL
+};
+#endif
+#define pci_dev_list_148e NULL
+#define pci_dev_list_148f NULL
+#define pci_dev_list_1490 NULL
+#define pci_dev_list_1491 NULL
+#define pci_dev_list_1492 NULL
+#define pci_dev_list_1493 NULL
+#define pci_dev_list_1494 NULL
+#define pci_dev_list_1495 NULL
+#define pci_dev_list_1496 NULL
+#define pci_dev_list_1497 NULL
+#define pci_dev_list_1498 NULL
+#define pci_dev_list_1499 NULL
+#define pci_dev_list_149a NULL
+#define pci_dev_list_149b NULL
+#define pci_dev_list_149c NULL
+#define pci_dev_list_149d NULL
+#define pci_dev_list_149e NULL
+#define pci_dev_list_149f NULL
+#define pci_dev_list_14a0 NULL
+#define pci_dev_list_14a1 NULL
+#define pci_dev_list_14a2 NULL
+#define pci_dev_list_14a3 NULL
+#define pci_dev_list_14a4 NULL
+#define pci_dev_list_14a5 NULL
+#define pci_dev_list_14a6 NULL
+#define pci_dev_list_14a7 NULL
+#define pci_dev_list_14a8 NULL
+#define pci_dev_list_14a9 NULL
+#define pci_dev_list_14aa NULL
+#define pci_dev_list_14ab NULL
+#define pci_dev_list_14ac NULL
+#define pci_dev_list_14ad NULL
+#define pci_dev_list_14ae NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14af[] = {
+ &pci_dev_info_14af_7102,
+ NULL
+};
+#endif
+#define pci_dev_list_14b0 NULL
+#define pci_dev_list_14b1 NULL
+#define pci_dev_list_14b2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14b3[] = {
+ &pci_dev_info_14b3_0000,
+ NULL
+};
+#endif
+#define pci_dev_list_14b4 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14b5[] = {
+ &pci_dev_info_14b5_0200,
+ &pci_dev_info_14b5_0300,
+ &pci_dev_info_14b5_0400,
+ &pci_dev_info_14b5_0600,
+ &pci_dev_info_14b5_0800,
+ &pci_dev_info_14b5_0900,
+ &pci_dev_info_14b5_0a00,
+ &pci_dev_info_14b5_0b00,
+ NULL
+};
+#endif
+#define pci_dev_list_14b6 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14b7[] = {
+ &pci_dev_info_14b7_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_14b8 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14b9[] = {
+ &pci_dev_info_14b9_0001,
+ &pci_dev_info_14b9_0340,
+ &pci_dev_info_14b9_0350,
+ &pci_dev_info_14b9_4500,
+ &pci_dev_info_14b9_4800,
+ &pci_dev_info_14b9_a504,
+ NULL
+};
+#endif
+#define pci_dev_list_14ba NULL
+#define pci_dev_list_14bb NULL
+#define pci_dev_list_14bc NULL
+#define pci_dev_list_14bd NULL
+#define pci_dev_list_14be NULL
+#define pci_dev_list_14bf NULL
+#define pci_dev_list_14c0 NULL
+#define pci_dev_list_14c1 NULL
+#define pci_dev_list_14c2 NULL
+#define pci_dev_list_14c3 NULL
+#define pci_dev_list_14c4 NULL
+#define pci_dev_list_14c5 NULL
+#define pci_dev_list_14c6 NULL
+#define pci_dev_list_14c7 NULL
+#define pci_dev_list_14c8 NULL
+#define pci_dev_list_14c9 NULL
+#define pci_dev_list_14ca NULL
+#define pci_dev_list_14cb NULL
+#define pci_dev_list_14cc NULL
+#define pci_dev_list_14cd NULL
+#define pci_dev_list_14ce NULL
+#define pci_dev_list_14cf NULL
+#define pci_dev_list_14d0 NULL
+#define pci_dev_list_14d1 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14d2[] = {
+ &pci_dev_info_14d2_8001,
+ &pci_dev_info_14d2_8002,
+ &pci_dev_info_14d2_8010,
+ &pci_dev_info_14d2_8011,
+ &pci_dev_info_14d2_8020,
+ &pci_dev_info_14d2_8021,
+ &pci_dev_info_14d2_8040,
+ &pci_dev_info_14d2_8080,
+ &pci_dev_info_14d2_a000,
+ &pci_dev_info_14d2_a001,
+ &pci_dev_info_14d2_a003,
+ &pci_dev_info_14d2_a004,
+ &pci_dev_info_14d2_a005,
+ &pci_dev_info_14d2_e001,
+ &pci_dev_info_14d2_e010,
+ &pci_dev_info_14d2_e020,
+ NULL
+};
+#endif
+#define pci_dev_list_14d3 NULL
+#define pci_dev_list_14d4 NULL
+#define pci_dev_list_14d5 NULL
+#define pci_dev_list_14d6 NULL
+#define pci_dev_list_14d7 NULL
+#define pci_dev_list_14d8 NULL
+#define pci_dev_list_14d9 NULL
+#define pci_dev_list_14da NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14db[] = {
+ &pci_dev_info_14db_2120,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14dc[] = {
+ &pci_dev_info_14dc_0000,
+ &pci_dev_info_14dc_0001,
+ &pci_dev_info_14dc_0002,
+ &pci_dev_info_14dc_0003,
+ &pci_dev_info_14dc_0004,
+ &pci_dev_info_14dc_0005,
+ &pci_dev_info_14dc_0006,
+ &pci_dev_info_14dc_0007,
+ &pci_dev_info_14dc_0008,
+ &pci_dev_info_14dc_0009,
+ &pci_dev_info_14dc_000a,
+ &pci_dev_info_14dc_000b,
+ NULL
+};
+#endif
+#define pci_dev_list_14dd NULL
+#define pci_dev_list_14de NULL
+#define pci_dev_list_14df NULL
+#define pci_dev_list_14e1 NULL
+#define pci_dev_list_14e2 NULL
+#define pci_dev_list_14e3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14e4[] = {
+ &pci_dev_info_14e4_1644,
+ &pci_dev_info_14e4_1645,
+ &pci_dev_info_14e4_1646,
+ &pci_dev_info_14e4_1647,
+ &pci_dev_info_14e4_1648,
+ &pci_dev_info_14e4_164d,
+ &pci_dev_info_14e4_1653,
+ &pci_dev_info_14e4_165d,
+ &pci_dev_info_14e4_1696,
+ &pci_dev_info_14e4_16a6,
+ &pci_dev_info_14e4_16a7,
+ &pci_dev_info_14e4_16a8,
+ &pci_dev_info_14e4_16c6,
+ &pci_dev_info_14e4_16c7,
+ &pci_dev_info_14e4_4210,
+ &pci_dev_info_14e4_4211,
+ &pci_dev_info_14e4_4212,
+ &pci_dev_info_14e4_4301,
+ &pci_dev_info_14e4_4401,
+ &pci_dev_info_14e4_4402,
+ &pci_dev_info_14e4_4410,
+ &pci_dev_info_14e4_4411,
+ &pci_dev_info_14e4_4412,
+ &pci_dev_info_14e4_5820,
+ &pci_dev_info_14e4_5821,
+ NULL
+};
+#endif
+#define pci_dev_list_14e5 NULL
+#define pci_dev_list_14e6 NULL
+#define pci_dev_list_14e7 NULL
+#define pci_dev_list_14e8 NULL
+#define pci_dev_list_14e9 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14ea[] = {
+ &pci_dev_info_14ea_ab06,
+ NULL
+};
+#endif
+#define pci_dev_list_14eb NULL
+#define pci_dev_list_14ec NULL
+#define pci_dev_list_14ed NULL
+#define pci_dev_list_14ee NULL
+#define pci_dev_list_14ef NULL
+#define pci_dev_list_14f0 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_14f1[] = {
+ &pci_dev_info_14f1_1002,
+ &pci_dev_info_14f1_1003,
+ &pci_dev_info_14f1_1004,
+ &pci_dev_info_14f1_1005,
+ &pci_dev_info_14f1_1006,
+ &pci_dev_info_14f1_1022,
+ &pci_dev_info_14f1_1023,
+ &pci_dev_info_14f1_1024,
+ &pci_dev_info_14f1_1025,
+ &pci_dev_info_14f1_1026,
+ &pci_dev_info_14f1_1032,
+ &pci_dev_info_14f1_1033,
+ &pci_dev_info_14f1_1034,
+ &pci_dev_info_14f1_1035,
+ &pci_dev_info_14f1_1036,
+ &pci_dev_info_14f1_1052,
+ &pci_dev_info_14f1_1053,
+ &pci_dev_info_14f1_1054,
+ &pci_dev_info_14f1_1055,
+ &pci_dev_info_14f1_1056,
+ &pci_dev_info_14f1_1057,
+ &pci_dev_info_14f1_1059,
+ &pci_dev_info_14f1_1063,
+ &pci_dev_info_14f1_1064,
+ &pci_dev_info_14f1_1065,
+ &pci_dev_info_14f1_1066,
+ &pci_dev_info_14f1_1433,
+ &pci_dev_info_14f1_1434,
+ &pci_dev_info_14f1_1435,
+ &pci_dev_info_14f1_1436,
+ &pci_dev_info_14f1_1453,
+ &pci_dev_info_14f1_1454,
+ &pci_dev_info_14f1_1455,
+ &pci_dev_info_14f1_1456,
+ &pci_dev_info_14f1_1610,
+ &pci_dev_info_14f1_1611,
+ &pci_dev_info_14f1_1803,
+ &pci_dev_info_14f1_1815,
+ &pci_dev_info_14f1_2003,
+ &pci_dev_info_14f1_2004,
+ &pci_dev_info_14f1_2005,
+ &pci_dev_info_14f1_2006,
+ &pci_dev_info_14f1_2013,
+ &pci_dev_info_14f1_2014,
+ &pci_dev_info_14f1_2015,
+ &pci_dev_info_14f1_2016,
+ &pci_dev_info_14f1_2043,
+ &pci_dev_info_14f1_2044,
+ &pci_dev_info_14f1_2045,
+ &pci_dev_info_14f1_2046,
+ &pci_dev_info_14f1_2063,
+ &pci_dev_info_14f1_2064,
+ &pci_dev_info_14f1_2065,
+ &pci_dev_info_14f1_2066,
+ &pci_dev_info_14f1_2093,
+ &pci_dev_info_14f1_2143,
+ &pci_dev_info_14f1_2144,
+ &pci_dev_info_14f1_2145,
+ &pci_dev_info_14f1_2146,
+ &pci_dev_info_14f1_2163,
+ &pci_dev_info_14f1_2164,
+ &pci_dev_info_14f1_2165,
+ &pci_dev_info_14f1_2166,
+ &pci_dev_info_14f1_2343,
+ &pci_dev_info_14f1_2344,
+ &pci_dev_info_14f1_2345,
+ &pci_dev_info_14f1_2346,
+ &pci_dev_info_14f1_2363,
+ &pci_dev_info_14f1_2364,
+ &pci_dev_info_14f1_2365,
+ &pci_dev_info_14f1_2366,
+ &pci_dev_info_14f1_2443,
+ &pci_dev_info_14f1_2444,
+ &pci_dev_info_14f1_2445,
+ &pci_dev_info_14f1_2446,
+ &pci_dev_info_14f1_2463,
+ &pci_dev_info_14f1_2464,
+ &pci_dev_info_14f1_2465,
+ &pci_dev_info_14f1_2466,
+ &pci_dev_info_14f1_2f00,
+ &pci_dev_info_14f1_8234,
+ NULL
+};
+#endif
+#define pci_dev_list_14f2 NULL
+#define pci_dev_list_14f3 NULL
+#define pci_dev_list_14f4 NULL
+#define pci_dev_list_14f5 NULL
+#define pci_dev_list_14f6 NULL
+#define pci_dev_list_14f7 NULL
+#define pci_dev_list_14f8 NULL
+#define pci_dev_list_14f9 NULL
+#define pci_dev_list_14fa NULL
+#define pci_dev_list_14fb NULL
+#define pci_dev_list_14fc NULL
+#define pci_dev_list_14fd NULL
+#define pci_dev_list_14fe NULL
+#define pci_dev_list_14ff NULL
+#define pci_dev_list_1500 NULL
+#define pci_dev_list_1501 NULL
+#define pci_dev_list_1502 NULL
+#define pci_dev_list_1503 NULL
+#define pci_dev_list_1504 NULL
+#define pci_dev_list_1505 NULL
+#define pci_dev_list_1506 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1507[] = {
+ &pci_dev_info_1507_0001,
+ &pci_dev_info_1507_0002,
+ &pci_dev_info_1507_0003,
+ &pci_dev_info_1507_0100,
+ &pci_dev_info_1507_0431,
+ &pci_dev_info_1507_4801,
+ &pci_dev_info_1507_4802,
+ &pci_dev_info_1507_4803,
+ &pci_dev_info_1507_4806,
+ NULL
+};
+#endif
+#define pci_dev_list_1508 NULL
+#define pci_dev_list_1509 NULL
+#define pci_dev_list_150a NULL
+#define pci_dev_list_150b NULL
+#define pci_dev_list_150c NULL
+#define pci_dev_list_150d NULL
+#define pci_dev_list_150e NULL
+#define pci_dev_list_150f NULL
+#define pci_dev_list_1510 NULL
+#define pci_dev_list_1511 NULL
+#define pci_dev_list_1512 NULL
+#define pci_dev_list_1513 NULL
+#define pci_dev_list_1514 NULL
+#define pci_dev_list_1515 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1516[] = {
+ &pci_dev_info_1516_0803,
+ NULL
+};
+#endif
+#define pci_dev_list_1517 NULL
+#define pci_dev_list_1518 NULL
+#define pci_dev_list_1519 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_151a[] = {
+ &pci_dev_info_151a_1002,
+ &pci_dev_info_151a_1004,
+ &pci_dev_info_151a_1008,
+ NULL
+};
+#endif
+#define pci_dev_list_151b NULL
+#define pci_dev_list_151c NULL
+#define pci_dev_list_151d NULL
+#define pci_dev_list_151e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_151f[] = {
+ &pci_dev_info_151f_0000,
+ NULL
+};
+#endif
+#define pci_dev_list_1520 NULL
+#define pci_dev_list_1521 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1522[] = {
+ &pci_dev_info_1522_0100,
+ NULL
+};
+#endif
+#define pci_dev_list_1523 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1524[] = {
+ &pci_dev_info_1524_1211,
+ &pci_dev_info_1524_1225,
+ &pci_dev_info_1524_1410,
+ &pci_dev_info_1524_1420,
+ NULL
+};
+#endif
+#define pci_dev_list_1525 NULL
+#define pci_dev_list_1526 NULL
+#define pci_dev_list_1527 NULL
+#define pci_dev_list_1528 NULL
+#define pci_dev_list_1529 NULL
+#define pci_dev_list_152a NULL
+#define pci_dev_list_152b NULL
+#define pci_dev_list_152c NULL
+#define pci_dev_list_152d NULL
+#define pci_dev_list_152e NULL
+#define pci_dev_list_152f NULL
+#define pci_dev_list_1530 NULL
+#define pci_dev_list_1531 NULL
+#define pci_dev_list_1532 NULL
+#define pci_dev_list_1533 NULL
+#define pci_dev_list_1534 NULL
+#define pci_dev_list_1535 NULL
+#define pci_dev_list_1537 NULL
+#define pci_dev_list_1538 NULL
+#define pci_dev_list_1539 NULL
+#define pci_dev_list_153a NULL
+#define pci_dev_list_153b NULL
+#define pci_dev_list_153c NULL
+#define pci_dev_list_153d NULL
+#define pci_dev_list_153e NULL
+#define pci_dev_list_153f NULL
+#define pci_dev_list_1540 NULL
+#define pci_dev_list_1541 NULL
+#define pci_dev_list_1542 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1543[] = {
+ &pci_dev_info_1543_3052,
+ &pci_dev_info_1543_4c22,
+ NULL
+};
+#endif
+#define pci_dev_list_1544 NULL
+#define pci_dev_list_1545 NULL
+#define pci_dev_list_1546 NULL
+#define pci_dev_list_1547 NULL
+#define pci_dev_list_1548 NULL
+#define pci_dev_list_1549 NULL
+#define pci_dev_list_154a NULL
+#define pci_dev_list_154b NULL
+#define pci_dev_list_154c NULL
+#define pci_dev_list_154d NULL
+#define pci_dev_list_154e NULL
+#define pci_dev_list_154f NULL
+#define pci_dev_list_1550 NULL
+#define pci_dev_list_1551 NULL
+#define pci_dev_list_1552 NULL
+#define pci_dev_list_1553 NULL
+#define pci_dev_list_1554 NULL
+#define pci_dev_list_1555 NULL
+#define pci_dev_list_1556 NULL
+#define pci_dev_list_1557 NULL
+#define pci_dev_list_1558 NULL
+#define pci_dev_list_1559 NULL
+#define pci_dev_list_155a NULL
+#define pci_dev_list_155b NULL
+#define pci_dev_list_155c NULL
+#define pci_dev_list_155d NULL
+#define pci_dev_list_155e NULL
+#define pci_dev_list_155f NULL
+#define pci_dev_list_1560 NULL
+#define pci_dev_list_1561 NULL
+#define pci_dev_list_1562 NULL
+#define pci_dev_list_1563 NULL
+#define pci_dev_list_1564 NULL
+#define pci_dev_list_1565 NULL
+#define pci_dev_list_1566 NULL
+#define pci_dev_list_1567 NULL
+#define pci_dev_list_1568 NULL
+#define pci_dev_list_1569 NULL
+#define pci_dev_list_156a NULL
+#define pci_dev_list_156b NULL
+#define pci_dev_list_156c NULL
+#define pci_dev_list_156d NULL
+#define pci_dev_list_156e NULL
+#define pci_dev_list_156f NULL
+#define pci_dev_list_1570 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1571[] = {
+ &pci_dev_info_1571_a001,
+ &pci_dev_info_1571_a002,
+ &pci_dev_info_1571_a003,
+ &pci_dev_info_1571_a004,
+ &pci_dev_info_1571_a005,
+ &pci_dev_info_1571_a006,
+ &pci_dev_info_1571_a007,
+ &pci_dev_info_1571_a008,
+ &pci_dev_info_1571_a009,
+ &pci_dev_info_1571_a00a,
+ &pci_dev_info_1571_a00b,
+ &pci_dev_info_1571_a00c,
+ &pci_dev_info_1571_a00d,
+ &pci_dev_info_1571_a201,
+ &pci_dev_info_1571_a202,
+ &pci_dev_info_1571_a203,
+ &pci_dev_info_1571_a204,
+ &pci_dev_info_1571_a205,
+ &pci_dev_info_1571_a206,
+ NULL
+};
+#endif
+#define pci_dev_list_1572 NULL
+#define pci_dev_list_1573 NULL
+#define pci_dev_list_1574 NULL
+#define pci_dev_list_1575 NULL
+#define pci_dev_list_1576 NULL
+#define pci_dev_list_1578 NULL
+#define pci_dev_list_1579 NULL
+#define pci_dev_list_157a NULL
+#define pci_dev_list_157b NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_157c[] = {
+ &pci_dev_info_157c_8001,
+ NULL
+};
+#endif
+#define pci_dev_list_157d NULL
+#define pci_dev_list_157e NULL
+#define pci_dev_list_157f NULL
+#define pci_dev_list_1580 NULL
+#define pci_dev_list_1581 NULL
+#define pci_dev_list_1582 NULL
+#define pci_dev_list_1583 NULL
+#define pci_dev_list_1584 NULL
+#define pci_dev_list_1585 NULL
+#define pci_dev_list_1586 NULL
+#define pci_dev_list_1587 NULL
+#define pci_dev_list_1588 NULL
+#define pci_dev_list_1589 NULL
+#define pci_dev_list_158a NULL
+#define pci_dev_list_158b NULL
+#define pci_dev_list_158c NULL
+#define pci_dev_list_158d NULL
+#define pci_dev_list_158e NULL
+#define pci_dev_list_158f NULL
+#define pci_dev_list_1590 NULL
+#define pci_dev_list_1591 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1592[] = {
+ &pci_dev_info_1592_0781,
+ &pci_dev_info_1592_0782,
+ &pci_dev_info_1592_0783,
+ &pci_dev_info_1592_0785,
+ &pci_dev_info_1592_0786,
+ &pci_dev_info_1592_0787,
+ &pci_dev_info_1592_0788,
+ &pci_dev_info_1592_078a,
+ NULL
+};
+#endif
+#define pci_dev_list_1593 NULL
+#define pci_dev_list_1594 NULL
+#define pci_dev_list_1595 NULL
+#define pci_dev_list_1596 NULL
+#define pci_dev_list_1597 NULL
+#define pci_dev_list_1598 NULL
+#define pci_dev_list_1599 NULL
+#define pci_dev_list_159a NULL
+#define pci_dev_list_159b NULL
+#define pci_dev_list_159c NULL
+#define pci_dev_list_159d NULL
+#define pci_dev_list_159e NULL
+#define pci_dev_list_159f NULL
+#define pci_dev_list_15a0 NULL
+#define pci_dev_list_15a1 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_15a2[] = {
+ &pci_dev_info_15a2_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_15a3 NULL
+#define pci_dev_list_15a4 NULL
+#define pci_dev_list_15a5 NULL
+#define pci_dev_list_15a6 NULL
+#define pci_dev_list_15a7 NULL
+#define pci_dev_list_15a8 NULL
+#define pci_dev_list_15aa NULL
+#define pci_dev_list_15ab NULL
+#define pci_dev_list_15ac NULL
+static const pciDeviceInfo *pci_dev_list_15ad[] = {
+ &pci_dev_info_15ad_0710,
+ NULL
+};
+#define pci_dev_list_15ae NULL
+#define pci_dev_list_15b0 NULL
+#define pci_dev_list_15b1 NULL
+#define pci_dev_list_15b2 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_15b3[] = {
+ &pci_dev_info_15b3_5274,
+ NULL
+};
+#endif
+#define pci_dev_list_15b4 NULL
+#define pci_dev_list_15b5 NULL
+#define pci_dev_list_15b6 NULL
+#define pci_dev_list_15b7 NULL
+#define pci_dev_list_15b8 NULL
+#define pci_dev_list_15b9 NULL
+#define pci_dev_list_15ba NULL
+#define pci_dev_list_15bb NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_15bc[] = {
+ &pci_dev_info_15bc_2929,
+ NULL
+};
+#endif
+#define pci_dev_list_15bd NULL
+#define pci_dev_list_15be NULL
+#define pci_dev_list_15bf NULL
+#define pci_dev_list_15c0 NULL
+#define pci_dev_list_15c1 NULL
+#define pci_dev_list_15c2 NULL
+#define pci_dev_list_15c3 NULL
+#define pci_dev_list_15c4 NULL
+#define pci_dev_list_15c5 NULL
+#define pci_dev_list_15c6 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_15c7[] = {
+ &pci_dev_info_15c7_0349,
+ NULL
+};
+#endif
+#define pci_dev_list_15c8 NULL
+#define pci_dev_list_15c9 NULL
+#define pci_dev_list_15ca NULL
+#define pci_dev_list_15cb NULL
+#define pci_dev_list_15cc NULL
+#define pci_dev_list_15cd NULL
+#define pci_dev_list_15ce NULL
+#define pci_dev_list_15cf NULL
+#define pci_dev_list_15d1 NULL
+#define pci_dev_list_15d2 NULL
+#define pci_dev_list_15d3 NULL
+#define pci_dev_list_15d4 NULL
+#define pci_dev_list_15d5 NULL
+#define pci_dev_list_15d6 NULL
+#define pci_dev_list_15d7 NULL
+#define pci_dev_list_15d8 NULL
+#define pci_dev_list_15d9 NULL
+#define pci_dev_list_15da NULL
+#define pci_dev_list_15db NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_15dc[] = {
+ &pci_dev_info_15dc_0001,
+ NULL
+};
+#endif
+#define pci_dev_list_15dd NULL
+#define pci_dev_list_15de NULL
+#define pci_dev_list_15df NULL
+#define pci_dev_list_15e0 NULL
+#define pci_dev_list_15e1 NULL
+#define pci_dev_list_15e2 NULL
+#define pci_dev_list_15e3 NULL
+#define pci_dev_list_15e4 NULL
+#define pci_dev_list_15e5 NULL
+#define pci_dev_list_15e6 NULL
+#define pci_dev_list_15e7 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_15e8[] = {
+ &pci_dev_info_15e8_0130,
+ NULL
+};
+#endif
+#define pci_dev_list_15e9 NULL
+#define pci_dev_list_15ea NULL
+#define pci_dev_list_15eb NULL
+#define pci_dev_list_15ec NULL
+#define pci_dev_list_15ed NULL
+#define pci_dev_list_15ee NULL
+#define pci_dev_list_15ef NULL
+#define pci_dev_list_15f0 NULL
+#define pci_dev_list_15f1 NULL
+#define pci_dev_list_15f2 NULL
+#define pci_dev_list_15f3 NULL
+#define pci_dev_list_15f4 NULL
+#define pci_dev_list_15f5 NULL
+#define pci_dev_list_15f6 NULL
+#define pci_dev_list_15f7 NULL
+#define pci_dev_list_15f8 NULL
+#define pci_dev_list_15f9 NULL
+#define pci_dev_list_15fa NULL
+#define pci_dev_list_15fb NULL
+#define pci_dev_list_15fc NULL
+#define pci_dev_list_15fd NULL
+#define pci_dev_list_15fe NULL
+#define pci_dev_list_15ff NULL
+#define pci_dev_list_1600 NULL
+#define pci_dev_list_1601 NULL
+#define pci_dev_list_1602 NULL
+#define pci_dev_list_1603 NULL
+#define pci_dev_list_1604 NULL
+#define pci_dev_list_1605 NULL
+#define pci_dev_list_1606 NULL
+#define pci_dev_list_1607 NULL
+#define pci_dev_list_1608 NULL
+#define pci_dev_list_1609 NULL
+#define pci_dev_list_1612 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1619[] = {
+ &pci_dev_info_1619_0400,
+ &pci_dev_info_1619_0440,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1629[] = {
+ &pci_dev_info_1629_1003,
+ &pci_dev_info_1629_2002,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1638[] = {
+ &pci_dev_info_1638_1100,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_163c[] = {
+ &pci_dev_info_163c_5449,
+ NULL
+};
+#endif
+#define pci_dev_list_1657 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_165a[] = {
+ &pci_dev_info_165a_c100,
+ &pci_dev_info_165a_d200,
+ &pci_dev_info_165a_d300,
+ NULL
+};
+#endif
+#define pci_dev_list_165d NULL
+#define pci_dev_list_1661 NULL
+#define pci_dev_list_1668 NULL
+#define pci_dev_list_1681 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_16ab[] = {
+ &pci_dev_info_16ab_1102,
+ NULL
+};
+#endif
+#define pci_dev_list_16be NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_16ec[] = {
+ &pci_dev_info_16ec_3685,
+ NULL
+};
+#endif
+#define pci_dev_list_16f6 NULL
+#define pci_dev_list_1705 NULL
+#define pci_dev_list_170b NULL
+#define pci_dev_list_170c NULL
+#define pci_dev_list_172a NULL
+#define pci_dev_list_1737 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_173b[] = {
+ &pci_dev_info_173b_03e8,
+ &pci_dev_info_173b_03ea,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1743[] = {
+ &pci_dev_info_1743_8139,
+ NULL
+};
+#endif
+#define pci_dev_list_174b NULL
+#define pci_dev_list_175e NULL
+#define pci_dev_list_1787 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1796[] = {
+ &pci_dev_info_1796_0001,
+ &pci_dev_info_1796_0002,
+ &pci_dev_info_1796_0003,
+ &pci_dev_info_1796_0004,
+ &pci_dev_info_1796_0005,
+ &pci_dev_info_1796_0006,
+ NULL
+};
+#endif
+#define pci_dev_list_1799 NULL
+#define pci_dev_list_17af NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_17cc[] = {
+ &pci_dev_info_17cc_2280,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1813[] = {
+ &pci_dev_info_1813_4000,
+ &pci_dev_info_1813_4100,
+ NULL
+};
+#endif
+#define pci_dev_list_1851 NULL
+#define pci_dev_list_1852 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1888[] = {
+ &pci_dev_info_1888_0301,
+ &pci_dev_info_1888_0601,
+ &pci_dev_info_1888_0710,
+ &pci_dev_info_1888_0720,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1a08[] = {
+ &pci_dev_info_1a08_0000,
+ NULL
+};
+#endif
+#define pci_dev_list_1b13 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1c1c[] = {
+ &pci_dev_info_1c1c_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1d44[] = {
+ &pci_dev_info_1d44_a400,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_1de1[] = {
+ &pci_dev_info_1de1_0391,
+ &pci_dev_info_1de1_2020,
+ &pci_dev_info_1de1_690c,
+ &pci_dev_info_1de1_dc29,
+ NULL
+};
+#endif
+#define pci_dev_list_2000 NULL
+#define pci_dev_list_2001 NULL
+#define pci_dev_list_2003 NULL
+#define pci_dev_list_2004 NULL
+#define pci_dev_list_21c3 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_2348[] = {
+ &pci_dev_info_2348_2010,
+ NULL
+};
+#endif
+#define pci_dev_list_2646 NULL
+#define pci_dev_list_270b NULL
+#define pci_dev_list_270f NULL
+#define pci_dev_list_2711 NULL
+#define pci_dev_list_2a15 NULL
+#define pci_dev_list_3000 NULL
+#define pci_dev_list_3142 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_3388[] = {
+ &pci_dev_info_3388_0013,
+ &pci_dev_info_3388_0014,
+ &pci_dev_info_3388_0021,
+ &pci_dev_info_3388_8011,
+ &pci_dev_info_3388_8012,
+ &pci_dev_info_3388_8013,
+ NULL
+};
+#endif
+#define pci_dev_list_3411 NULL
+#define pci_dev_list_3513 NULL
+#define pci_dev_list_38ef NULL
+static const pciDeviceInfo *pci_dev_list_3d3d[] = {
+ &pci_dev_info_3d3d_0001,
+ &pci_dev_info_3d3d_0002,
+ &pci_dev_info_3d3d_0003,
+ &pci_dev_info_3d3d_0004,
+ &pci_dev_info_3d3d_0005,
+ &pci_dev_info_3d3d_0006,
+ &pci_dev_info_3d3d_0007,
+ &pci_dev_info_3d3d_0008,
+ &pci_dev_info_3d3d_0009,
+ &pci_dev_info_3d3d_000a,
+ &pci_dev_info_3d3d_000c,
+ &pci_dev_info_3d3d_0100,
+ &pci_dev_info_3d3d_1004,
+ &pci_dev_info_3d3d_3d04,
+ &pci_dev_info_3d3d_ffff,
+ NULL
+};
+static const pciDeviceInfo *pci_dev_list_4005[] = {
+ &pci_dev_info_4005_0300,
+ &pci_dev_info_4005_0308,
+ &pci_dev_info_4005_0309,
+ &pci_dev_info_4005_1064,
+ &pci_dev_info_4005_2064,
+ &pci_dev_info_4005_2128,
+ &pci_dev_info_4005_2301,
+ &pci_dev_info_4005_2302,
+ &pci_dev_info_4005_2303,
+ &pci_dev_info_4005_2364,
+ &pci_dev_info_4005_2464,
+ &pci_dev_info_4005_2501,
+ &pci_dev_info_4005_4000,
+ &pci_dev_info_4005_4710,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_4033[] = {
+ &pci_dev_info_4033_1360,
+ NULL
+};
+#endif
+#define pci_dev_list_4143 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_416c[] = {
+ &pci_dev_info_416c_0100,
+ &pci_dev_info_416c_0200,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_4444[] = {
+ &pci_dev_info_4444_0803,
+ NULL
+};
+#endif
+#define pci_dev_list_4468 NULL
+#define pci_dev_list_4594 NULL
+#define pci_dev_list_45fb NULL
+#define pci_dev_list_4680 NULL
+#define pci_dev_list_4843 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_4916[] = {
+ &pci_dev_info_4916_1960,
+ NULL
+};
+#endif
+#define pci_dev_list_4943 NULL
+#define pci_dev_list_4978 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_4a14[] = {
+ &pci_dev_info_4a14_5000,
+ NULL
+};
+#endif
+#define pci_dev_list_4b10 NULL
+#define pci_dev_list_4c48 NULL
+#define pci_dev_list_4c53 NULL
+#define pci_dev_list_4ca1 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_4d51[] = {
+ &pci_dev_info_4d51_0200,
+ NULL
+};
+#endif
+#define pci_dev_list_4d54 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_4ddc[] = {
+ &pci_dev_info_4ddc_0100,
+ &pci_dev_info_4ddc_0801,
+ &pci_dev_info_4ddc_0802,
+ &pci_dev_info_4ddc_0811,
+ &pci_dev_info_4ddc_0812,
+ &pci_dev_info_4ddc_0881,
+ &pci_dev_info_4ddc_0882,
+ &pci_dev_info_4ddc_0891,
+ &pci_dev_info_4ddc_0892,
+ &pci_dev_info_4ddc_0901,
+ &pci_dev_info_4ddc_0902,
+ &pci_dev_info_4ddc_0903,
+ &pci_dev_info_4ddc_0904,
+ &pci_dev_info_4ddc_0b01,
+ &pci_dev_info_4ddc_0b02,
+ &pci_dev_info_4ddc_0b03,
+ &pci_dev_info_4ddc_0b04,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_5046[] = {
+ &pci_dev_info_5046_1001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_5053[] = {
+ &pci_dev_info_5053_2010,
+ NULL
+};
+#endif
+#define pci_dev_list_5136 NULL
+#define pci_dev_list_5143 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_5145[] = {
+ &pci_dev_info_5145_3031,
+ NULL
+};
+#endif
+#define pci_dev_list_5168 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_5301[] = {
+ &pci_dev_info_5301_0001,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_5333[] = {
+ &pci_dev_info_5333_0551,
+ &pci_dev_info_5333_5631,
+ &pci_dev_info_5333_8800,
+ &pci_dev_info_5333_8801,
+ &pci_dev_info_5333_8810,
+ &pci_dev_info_5333_8811,
+ &pci_dev_info_5333_8812,
+ &pci_dev_info_5333_8813,
+ &pci_dev_info_5333_8814,
+ &pci_dev_info_5333_8815,
+ &pci_dev_info_5333_883d,
+ &pci_dev_info_5333_8870,
+ &pci_dev_info_5333_8880,
+ &pci_dev_info_5333_8881,
+ &pci_dev_info_5333_8882,
+ &pci_dev_info_5333_8883,
+ &pci_dev_info_5333_88b0,
+ &pci_dev_info_5333_88b1,
+ &pci_dev_info_5333_88b2,
+ &pci_dev_info_5333_88b3,
+ &pci_dev_info_5333_88c0,
+ &pci_dev_info_5333_88c1,
+ &pci_dev_info_5333_88c2,
+ &pci_dev_info_5333_88c3,
+ &pci_dev_info_5333_88d0,
+ &pci_dev_info_5333_88d1,
+ &pci_dev_info_5333_88d2,
+ &pci_dev_info_5333_88d3,
+ &pci_dev_info_5333_88f0,
+ &pci_dev_info_5333_88f1,
+ &pci_dev_info_5333_88f2,
+ &pci_dev_info_5333_88f3,
+ &pci_dev_info_5333_8900,
+ &pci_dev_info_5333_8901,
+ &pci_dev_info_5333_8902,
+ &pci_dev_info_5333_8903,
+ &pci_dev_info_5333_8904,
+ &pci_dev_info_5333_8905,
+ &pci_dev_info_5333_8906,
+ &pci_dev_info_5333_8907,
+ &pci_dev_info_5333_8908,
+ &pci_dev_info_5333_8909,
+ &pci_dev_info_5333_890a,
+ &pci_dev_info_5333_890b,
+ &pci_dev_info_5333_890c,
+ &pci_dev_info_5333_890d,
+ &pci_dev_info_5333_890e,
+ &pci_dev_info_5333_890f,
+ &pci_dev_info_5333_8a01,
+ &pci_dev_info_5333_8a10,
+ &pci_dev_info_5333_8a13,
+ &pci_dev_info_5333_8a20,
+ &pci_dev_info_5333_8a21,
+ &pci_dev_info_5333_8a22,
+ &pci_dev_info_5333_8a23,
+ &pci_dev_info_5333_8a25,
+ &pci_dev_info_5333_8a26,
+ &pci_dev_info_5333_8c00,
+ &pci_dev_info_5333_8c01,
+ &pci_dev_info_5333_8c02,
+ &pci_dev_info_5333_8c03,
+ &pci_dev_info_5333_8c10,
+ &pci_dev_info_5333_8c11,
+ &pci_dev_info_5333_8c12,
+ &pci_dev_info_5333_8c13,
+ &pci_dev_info_5333_8c22,
+ &pci_dev_info_5333_8c24,
+ &pci_dev_info_5333_8c26,
+ &pci_dev_info_5333_8c2a,
+ &pci_dev_info_5333_8c2b,
+ &pci_dev_info_5333_8c2c,
+ &pci_dev_info_5333_8c2d,
+ &pci_dev_info_5333_8c2e,
+ &pci_dev_info_5333_8c2f,
+ &pci_dev_info_5333_8d01,
+ &pci_dev_info_5333_8d02,
+ &pci_dev_info_5333_8d03,
+ &pci_dev_info_5333_8d04,
+ &pci_dev_info_5333_9102,
+ &pci_dev_info_5333_ca00,
+ NULL
+};
+#define pci_dev_list_544c NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_5455[] = {
+ &pci_dev_info_5455_4458,
+ NULL
+};
+#endif
+#define pci_dev_list_5519 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_5544[] = {
+ &pci_dev_info_5544_0001,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_5555[] = {
+ &pci_dev_info_5555_0003,
+ NULL
+};
+#endif
+#define pci_dev_list_5654 NULL
+#define pci_dev_list_5700 NULL
+#define pci_dev_list_6356 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_6374[] = {
+ &pci_dev_info_6374_6773,
+ NULL
+};
+#endif
+#define pci_dev_list_6409 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_6666[] = {
+ &pci_dev_info_6666_0001,
+ &pci_dev_info_6666_0002,
+ NULL
+};
+#endif
+#define pci_dev_list_7604 NULL
+#define pci_dev_list_7bde NULL
+#define pci_dev_list_7fed NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_8008[] = {
+ &pci_dev_info_8008_0010,
+ &pci_dev_info_8008_0011,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_8086[] = {
+ &pci_dev_info_8086_0007,
+ &pci_dev_info_8086_0008,
+ &pci_dev_info_8086_0039,
+ &pci_dev_info_8086_0122,
+ &pci_dev_info_8086_0482,
+ &pci_dev_info_8086_0483,
+ &pci_dev_info_8086_0484,
+ &pci_dev_info_8086_0486,
+ &pci_dev_info_8086_04a3,
+ &pci_dev_info_8086_04d0,
+ &pci_dev_info_8086_0600,
+ &pci_dev_info_8086_0960,
+ &pci_dev_info_8086_0962,
+ &pci_dev_info_8086_0964,
+ &pci_dev_info_8086_1000,
+ &pci_dev_info_8086_1001,
+ &pci_dev_info_8086_1002,
+ &pci_dev_info_8086_1004,
+ &pci_dev_info_8086_1008,
+ &pci_dev_info_8086_1009,
+ &pci_dev_info_8086_100c,
+ &pci_dev_info_8086_100d,
+ &pci_dev_info_8086_100e,
+ &pci_dev_info_8086_100f,
+ &pci_dev_info_8086_1010,
+ &pci_dev_info_8086_1011,
+ &pci_dev_info_8086_1012,
+ &pci_dev_info_8086_1015,
+ &pci_dev_info_8086_1029,
+ &pci_dev_info_8086_1030,
+ &pci_dev_info_8086_1031,
+ &pci_dev_info_8086_1032,
+ &pci_dev_info_8086_1033,
+ &pci_dev_info_8086_1034,
+ &pci_dev_info_8086_1035,
+ &pci_dev_info_8086_1036,
+ &pci_dev_info_8086_1037,
+ &pci_dev_info_8086_1038,
+ &pci_dev_info_8086_1039,
+ &pci_dev_info_8086_103a,
+ &pci_dev_info_8086_103b,
+ &pci_dev_info_8086_103c,
+ &pci_dev_info_8086_103d,
+ &pci_dev_info_8086_103e,
+ &pci_dev_info_8086_1040,
+ &pci_dev_info_8086_1059,
+ &pci_dev_info_8086_1130,
+ &pci_dev_info_8086_1131,
+ &pci_dev_info_8086_1132,
+ &pci_dev_info_8086_1161,
+ &pci_dev_info_8086_1162,
+ &pci_dev_info_8086_1200,
+ &pci_dev_info_8086_1209,
+ &pci_dev_info_8086_1221,
+ &pci_dev_info_8086_1222,
+ &pci_dev_info_8086_1223,
+ &pci_dev_info_8086_1225,
+ &pci_dev_info_8086_1226,
+ &pci_dev_info_8086_1227,
+ &pci_dev_info_8086_1228,
+ &pci_dev_info_8086_1229,
+ &pci_dev_info_8086_122d,
+ &pci_dev_info_8086_122e,
+ &pci_dev_info_8086_1230,
+ &pci_dev_info_8086_1231,
+ &pci_dev_info_8086_1234,
+ &pci_dev_info_8086_1235,
+ &pci_dev_info_8086_1237,
+ &pci_dev_info_8086_1239,
+ &pci_dev_info_8086_123b,
+ &pci_dev_info_8086_123c,
+ &pci_dev_info_8086_123d,
+ &pci_dev_info_8086_123f,
+ &pci_dev_info_8086_1240,
+ &pci_dev_info_8086_124b,
+ &pci_dev_info_8086_1250,
+ &pci_dev_info_8086_1360,
+ &pci_dev_info_8086_1361,
+ &pci_dev_info_8086_1460,
+ &pci_dev_info_8086_1461,
+ &pci_dev_info_8086_1462,
+ &pci_dev_info_8086_1960,
+ &pci_dev_info_8086_1962,
+ &pci_dev_info_8086_1a21,
+ &pci_dev_info_8086_1a23,
+ &pci_dev_info_8086_1a24,
+ &pci_dev_info_8086_1a30,
+ &pci_dev_info_8086_1a31,
+ &pci_dev_info_8086_2410,
+ &pci_dev_info_8086_2411,
+ &pci_dev_info_8086_2412,
+ &pci_dev_info_8086_2413,
+ &pci_dev_info_8086_2415,
+ &pci_dev_info_8086_2416,
+ &pci_dev_info_8086_2418,
+ &pci_dev_info_8086_2420,
+ &pci_dev_info_8086_2421,
+ &pci_dev_info_8086_2422,
+ &pci_dev_info_8086_2423,
+ &pci_dev_info_8086_2425,
+ &pci_dev_info_8086_2426,
+ &pci_dev_info_8086_2428,
+ &pci_dev_info_8086_2440,
+ &pci_dev_info_8086_2442,
+ &pci_dev_info_8086_2443,
+ &pci_dev_info_8086_2444,
+ &pci_dev_info_8086_2445,
+ &pci_dev_info_8086_2446,
+ &pci_dev_info_8086_2448,
+ &pci_dev_info_8086_2449,
+ &pci_dev_info_8086_244a,
+ &pci_dev_info_8086_244b,
+ &pci_dev_info_8086_244c,
+ &pci_dev_info_8086_244e,
+ &pci_dev_info_8086_2450,
+ &pci_dev_info_8086_2452,
+ &pci_dev_info_8086_2453,
+ &pci_dev_info_8086_2459,
+ &pci_dev_info_8086_245b,
+ &pci_dev_info_8086_245d,
+ &pci_dev_info_8086_245e,
+ &pci_dev_info_8086_2480,
+ &pci_dev_info_8086_2482,
+ &pci_dev_info_8086_2483,
+ &pci_dev_info_8086_2484,
+ &pci_dev_info_8086_2485,
+ &pci_dev_info_8086_2486,
+ &pci_dev_info_8086_2487,
+ &pci_dev_info_8086_248a,
+ &pci_dev_info_8086_248b,
+ &pci_dev_info_8086_248c,
+ &pci_dev_info_8086_24c0,
+ &pci_dev_info_8086_24c2,
+ &pci_dev_info_8086_24c3,
+ &pci_dev_info_8086_24c4,
+ &pci_dev_info_8086_24c5,
+ &pci_dev_info_8086_24c6,
+ &pci_dev_info_8086_24c7,
+ &pci_dev_info_8086_24cb,
+ &pci_dev_info_8086_24cd,
+ &pci_dev_info_8086_2500,
+ &pci_dev_info_8086_2501,
+ &pci_dev_info_8086_250b,
+ &pci_dev_info_8086_250f,
+ &pci_dev_info_8086_2520,
+ &pci_dev_info_8086_2521,
+ &pci_dev_info_8086_2530,
+ &pci_dev_info_8086_2531,
+ &pci_dev_info_8086_2532,
+ &pci_dev_info_8086_2533,
+ &pci_dev_info_8086_2534,
+ &pci_dev_info_8086_2540,
+ &pci_dev_info_8086_2541,
+ &pci_dev_info_8086_2543,
+ &pci_dev_info_8086_2544,
+ &pci_dev_info_8086_2545,
+ &pci_dev_info_8086_2546,
+ &pci_dev_info_8086_2547,
+ &pci_dev_info_8086_2548,
+ &pci_dev_info_8086_2560,
+ &pci_dev_info_8086_2561,
+ &pci_dev_info_8086_2562,
+ &pci_dev_info_8086_2570,
+ &pci_dev_info_8086_2572,
+ &pci_dev_info_8086_3092,
+ &pci_dev_info_8086_3575,
+ &pci_dev_info_8086_3576,
+ &pci_dev_info_8086_3577,
+ &pci_dev_info_8086_3578,
+ &pci_dev_info_8086_3580,
+ &pci_dev_info_8086_3582,
+ &pci_dev_info_8086_5200,
+ &pci_dev_info_8086_5201,
+ &pci_dev_info_8086_530d,
+ &pci_dev_info_8086_7000,
+ &pci_dev_info_8086_7010,
+ &pci_dev_info_8086_7020,
+ &pci_dev_info_8086_7030,
+ &pci_dev_info_8086_7100,
+ &pci_dev_info_8086_7110,
+ &pci_dev_info_8086_7111,
+ &pci_dev_info_8086_7112,
+ &pci_dev_info_8086_7113,
+ &pci_dev_info_8086_7120,
+ &pci_dev_info_8086_7121,
+ &pci_dev_info_8086_7122,
+ &pci_dev_info_8086_7123,
+ &pci_dev_info_8086_7124,
+ &pci_dev_info_8086_7125,
+ &pci_dev_info_8086_7126,
+ &pci_dev_info_8086_7128,
+ &pci_dev_info_8086_712a,
+ &pci_dev_info_8086_7180,
+ &pci_dev_info_8086_7181,
+ &pci_dev_info_8086_7190,
+ &pci_dev_info_8086_7191,
+ &pci_dev_info_8086_7192,
+ &pci_dev_info_8086_7194,
+ &pci_dev_info_8086_7195,
+ &pci_dev_info_8086_7196,
+ &pci_dev_info_8086_7198,
+ &pci_dev_info_8086_7199,
+ &pci_dev_info_8086_719a,
+ &pci_dev_info_8086_719b,
+ &pci_dev_info_8086_71a0,
+ &pci_dev_info_8086_71a1,
+ &pci_dev_info_8086_71a2,
+ &pci_dev_info_8086_7600,
+ &pci_dev_info_8086_7601,
+ &pci_dev_info_8086_7602,
+ &pci_dev_info_8086_7603,
+ &pci_dev_info_8086_7800,
+ &pci_dev_info_8086_84c4,
+ &pci_dev_info_8086_84c5,
+ &pci_dev_info_8086_84ca,
+ &pci_dev_info_8086_84cb,
+ &pci_dev_info_8086_84e0,
+ &pci_dev_info_8086_84e1,
+ &pci_dev_info_8086_84e2,
+ &pci_dev_info_8086_84e3,
+ &pci_dev_info_8086_84e4,
+ &pci_dev_info_8086_84e6,
+ &pci_dev_info_8086_84ea,
+ &pci_dev_info_8086_9621,
+ &pci_dev_info_8086_9622,
+ &pci_dev_info_8086_9641,
+ &pci_dev_info_8086_96a1,
+ &pci_dev_info_8086_b152,
+ &pci_dev_info_8086_b154,
+ &pci_dev_info_8086_b555,
+ &pci_dev_info_8086_ffff,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_8800[] = {
+ &pci_dev_info_8800_2008,
+ NULL
+};
+#endif
+#define pci_dev_list_8866 NULL
+#define pci_dev_list_8888 NULL
+#define pci_dev_list_8e0e NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_8e2e[] = {
+ &pci_dev_info_8e2e_3000,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_9004[] = {
+ &pci_dev_info_9004_1078,
+ &pci_dev_info_9004_1160,
+ &pci_dev_info_9004_2178,
+ &pci_dev_info_9004_3860,
+ &pci_dev_info_9004_3b78,
+ &pci_dev_info_9004_5075,
+ &pci_dev_info_9004_5078,
+ &pci_dev_info_9004_5175,
+ &pci_dev_info_9004_5178,
+ &pci_dev_info_9004_5275,
+ &pci_dev_info_9004_5278,
+ &pci_dev_info_9004_5375,
+ &pci_dev_info_9004_5378,
+ &pci_dev_info_9004_5475,
+ &pci_dev_info_9004_5478,
+ &pci_dev_info_9004_5575,
+ &pci_dev_info_9004_5578,
+ &pci_dev_info_9004_5647,
+ &pci_dev_info_9004_5675,
+ &pci_dev_info_9004_5678,
+ &pci_dev_info_9004_5775,
+ &pci_dev_info_9004_5778,
+ &pci_dev_info_9004_5800,
+ &pci_dev_info_9004_5900,
+ &pci_dev_info_9004_5905,
+ &pci_dev_info_9004_6038,
+ &pci_dev_info_9004_6075,
+ &pci_dev_info_9004_6078,
+ &pci_dev_info_9004_6178,
+ &pci_dev_info_9004_6278,
+ &pci_dev_info_9004_6378,
+ &pci_dev_info_9004_6478,
+ &pci_dev_info_9004_6578,
+ &pci_dev_info_9004_6678,
+ &pci_dev_info_9004_6778,
+ &pci_dev_info_9004_6915,
+ &pci_dev_info_9004_7078,
+ &pci_dev_info_9004_7178,
+ &pci_dev_info_9004_7278,
+ &pci_dev_info_9004_7378,
+ &pci_dev_info_9004_7478,
+ &pci_dev_info_9004_7578,
+ &pci_dev_info_9004_7678,
+ &pci_dev_info_9004_7778,
+ &pci_dev_info_9004_7810,
+ &pci_dev_info_9004_7815,
+ &pci_dev_info_9004_7850,
+ &pci_dev_info_9004_7855,
+ &pci_dev_info_9004_7860,
+ &pci_dev_info_9004_7870,
+ &pci_dev_info_9004_7871,
+ &pci_dev_info_9004_7872,
+ &pci_dev_info_9004_7873,
+ &pci_dev_info_9004_7874,
+ &pci_dev_info_9004_7880,
+ &pci_dev_info_9004_7890,
+ &pci_dev_info_9004_7891,
+ &pci_dev_info_9004_7892,
+ &pci_dev_info_9004_7893,
+ &pci_dev_info_9004_7894,
+ &pci_dev_info_9004_7895,
+ &pci_dev_info_9004_7896,
+ &pci_dev_info_9004_7897,
+ &pci_dev_info_9004_8078,
+ &pci_dev_info_9004_8178,
+ &pci_dev_info_9004_8278,
+ &pci_dev_info_9004_8378,
+ &pci_dev_info_9004_8478,
+ &pci_dev_info_9004_8578,
+ &pci_dev_info_9004_8678,
+ &pci_dev_info_9004_8778,
+ &pci_dev_info_9004_8878,
+ &pci_dev_info_9004_8b78,
+ &pci_dev_info_9004_ec78,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_9005[] = {
+ &pci_dev_info_9005_0010,
+ &pci_dev_info_9005_0011,
+ &pci_dev_info_9005_0013,
+ &pci_dev_info_9005_001f,
+ &pci_dev_info_9005_0020,
+ &pci_dev_info_9005_002f,
+ &pci_dev_info_9005_0030,
+ &pci_dev_info_9005_003f,
+ &pci_dev_info_9005_0050,
+ &pci_dev_info_9005_0051,
+ &pci_dev_info_9005_0053,
+ &pci_dev_info_9005_005f,
+ &pci_dev_info_9005_0080,
+ &pci_dev_info_9005_0081,
+ &pci_dev_info_9005_0083,
+ &pci_dev_info_9005_008f,
+ &pci_dev_info_9005_00c0,
+ &pci_dev_info_9005_00c1,
+ &pci_dev_info_9005_00c3,
+ &pci_dev_info_9005_00c5,
+ &pci_dev_info_9005_00cf,
+ &pci_dev_info_9005_0250,
+ &pci_dev_info_9005_0285,
+ &pci_dev_info_9005_8000,
+ &pci_dev_info_9005_800f,
+ &pci_dev_info_9005_8010,
+ &pci_dev_info_9005_8011,
+ &pci_dev_info_9005_8012,
+ &pci_dev_info_9005_8013,
+ &pci_dev_info_9005_8014,
+ &pci_dev_info_9005_801e,
+ &pci_dev_info_9005_801f,
+ &pci_dev_info_9005_8090,
+ &pci_dev_info_9005_8091,
+ &pci_dev_info_9005_8092,
+ &pci_dev_info_9005_8093,
+ &pci_dev_info_9005_8094,
+ &pci_dev_info_9005_809e,
+ &pci_dev_info_9005_809f,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_907f[] = {
+ &pci_dev_info_907f_2015,
+ NULL
+};
+#endif
+#define pci_dev_list_919a NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_9412[] = {
+ &pci_dev_info_9412_6565,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_9699[] = {
+ &pci_dev_info_9699_6565,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_9710[] = {
+ &pci_dev_info_9710_9815,
+ &pci_dev_info_9710_9835,
+ NULL
+};
+#endif
+#define pci_dev_list_a0a0 NULL
+#define pci_dev_list_a0f1 NULL
+#define pci_dev_list_a200 NULL
+#define pci_dev_list_a259 NULL
+#define pci_dev_list_a25b NULL
+#define pci_dev_list_a304 NULL
+#define pci_dev_list_a727 NULL
+#define pci_dev_list_aa42 NULL
+#define pci_dev_list_ac1e NULL
+#define pci_dev_list_b1b3 NULL
+#define pci_dev_list_bd11 NULL
+#define pci_dev_list_c001 NULL
+#define pci_dev_list_c0a9 NULL
+#define pci_dev_list_c0de NULL
+#define pci_dev_list_c0fe NULL
+#define pci_dev_list_ca50 NULL
+#define pci_dev_list_cafe NULL
+#define pci_dev_list_cccc NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_cddd[] = {
+ &pci_dev_info_cddd_0101,
+ &pci_dev_info_cddd_0200,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_d4d4[] = {
+ &pci_dev_info_d4d4_0601,
+ NULL
+};
+#endif
+#define pci_dev_list_d531 NULL
+#define pci_dev_list_d84d NULL
+#define pci_dev_list_dead NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_e000[] = {
+ &pci_dev_info_e000_e000,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_e159[] = {
+ &pci_dev_info_e159_0001,
+ &pci_dev_info_e159_0002,
+ NULL
+};
+#endif
+#define pci_dev_list_e4bf NULL
+#define pci_dev_list_ea01 NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_ea60[] = {
+ &pci_dev_info_ea60_9896,
+ &pci_dev_info_ea60_9897,
+ &pci_dev_info_ea60_9898,
+ NULL
+};
+#endif
+#define pci_dev_list_eabb NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_eace[] = {
+ &pci_dev_info_eace_3100,
+ &pci_dev_info_eace_3200,
+ &pci_dev_info_eace_320e,
+ &pci_dev_info_eace_340e,
+ &pci_dev_info_eace_341e,
+ &pci_dev_info_eace_3500,
+ &pci_dev_info_eace_351c,
+ &pci_dev_info_eace_4100,
+ &pci_dev_info_eace_4110,
+ &pci_dev_info_eace_4220,
+ &pci_dev_info_eace_422e,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_ec80[] = {
+ &pci_dev_info_ec80_ec00,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_ecc0[] = {
+ &pci_dev_info_ecc0_0050,
+ &pci_dev_info_ecc0_0051,
+ &pci_dev_info_ecc0_0060,
+ &pci_dev_info_ecc0_0070,
+ &pci_dev_info_ecc0_0071,
+ &pci_dev_info_ecc0_0072,
+ &pci_dev_info_ecc0_0080,
+ NULL
+};
+#endif
+static const pciDeviceInfo *pci_dev_list_edd8[] = {
+ &pci_dev_info_edd8_a091,
+ &pci_dev_info_edd8_a099,
+ &pci_dev_info_edd8_a0a1,
+ &pci_dev_info_edd8_a0a9,
+ NULL
+};
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_f1d0[] = {
+ &pci_dev_info_f1d0_cafe,
+ &pci_dev_info_f1d0_efac,
+ &pci_dev_info_f1d0_facd,
+ NULL
+};
+#endif
+#define pci_dev_list_fa57 NULL
+#define pci_dev_list_febd NULL
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_feda[] = {
+ &pci_dev_info_feda_a0fa,
+ &pci_dev_info_feda_a10e,
+ NULL
+};
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+static const pciDeviceInfo *pci_dev_list_fffe[] = {
+ &pci_dev_info_fffe_0710,
+ NULL
+};
+#endif
+#define pci_dev_list_ffff NULL
+
+static const pciVendorInfo pciVendorInfoList[] = {
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0000, pci_vendor_0000, pci_dev_list_0000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x001a, pci_vendor_001a, pci_dev_list_001a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0033, pci_vendor_0033, pci_dev_list_0033},
+#endif
+ {0x003d, pci_vendor_003d, pci_dev_list_003d},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0059, pci_vendor_0059, pci_dev_list_0059},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0070, pci_vendor_0070, pci_dev_list_0070},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0100, pci_vendor_0100, pci_dev_list_0100},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0675, pci_vendor_0675, pci_dev_list_0675},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0925, pci_vendor_0925, pci_dev_list_0925},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x09c1, pci_vendor_09c1, pci_dev_list_09c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0a89, pci_vendor_0a89, pci_dev_list_0a89},
+#endif
+ {0x0e11, pci_vendor_0e11, pci_dev_list_0e11},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0e55, pci_vendor_0e55, pci_dev_list_0e55},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1000, pci_vendor_1000, pci_dev_list_1000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1001, pci_vendor_1001, pci_dev_list_1001},
+#endif
+ {0x1002, pci_vendor_1002, pci_dev_list_1002},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1003, pci_vendor_1003, pci_dev_list_1003},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1004, pci_vendor_1004, pci_dev_list_1004},
+#endif
+ {0x1005, pci_vendor_1005, pci_dev_list_1005},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1006, pci_vendor_1006, pci_dev_list_1006},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1007, pci_vendor_1007, pci_dev_list_1007},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1008, pci_vendor_1008, pci_dev_list_1008},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x100a, pci_vendor_100a, pci_dev_list_100a},
+#endif
+ {0x100b, pci_vendor_100b, pci_dev_list_100b},
+ {0x100c, pci_vendor_100c, pci_dev_list_100c},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x100d, pci_vendor_100d, pci_dev_list_100d},
+#endif
+ {0x100e, pci_vendor_100e, pci_dev_list_100e},
+ {0x1010, pci_vendor_1010, pci_dev_list_1010},
+ {0x1011, pci_vendor_1011, pci_dev_list_1011},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1012, pci_vendor_1012, pci_dev_list_1012},
+#endif
+ {0x1013, pci_vendor_1013, pci_dev_list_1013},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1014, pci_vendor_1014, pci_dev_list_1014},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1015, pci_vendor_1015, pci_dev_list_1015},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1016, pci_vendor_1016, pci_dev_list_1016},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1017, pci_vendor_1017, pci_dev_list_1017},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1018, pci_vendor_1018, pci_dev_list_1018},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1019, pci_vendor_1019, pci_dev_list_1019},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101a, pci_vendor_101a, pci_dev_list_101a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101b, pci_vendor_101b, pci_dev_list_101b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101c, pci_vendor_101c, pci_dev_list_101c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101e, pci_vendor_101e, pci_dev_list_101e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101f, pci_vendor_101f, pci_dev_list_101f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1020, pci_vendor_1020, pci_dev_list_1020},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1021, pci_vendor_1021, pci_dev_list_1021},
+#endif
+ {0x1022, pci_vendor_1022, pci_dev_list_1022},
+ {0x1023, pci_vendor_1023, pci_dev_list_1023},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1024, pci_vendor_1024, pci_dev_list_1024},
+#endif
+ {0x1025, pci_vendor_1025, pci_dev_list_1025},
+ {0x1028, pci_vendor_1028, pci_dev_list_1028},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1029, pci_vendor_1029, pci_dev_list_1029},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x102a, pci_vendor_102a, pci_dev_list_102a},
+#endif
+ {0x102b, pci_vendor_102b, pci_dev_list_102b},
+ {0x102c, pci_vendor_102c, pci_dev_list_102c},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x102d, pci_vendor_102d, pci_dev_list_102d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x102e, pci_vendor_102e, pci_dev_list_102e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x102f, pci_vendor_102f, pci_dev_list_102f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1030, pci_vendor_1030, pci_dev_list_1030},
+#endif
+ {0x1031, pci_vendor_1031, pci_dev_list_1031},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1032, pci_vendor_1032, pci_dev_list_1032},
+#endif
+ {0x1033, pci_vendor_1033, pci_dev_list_1033},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1034, pci_vendor_1034, pci_dev_list_1034},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1035, pci_vendor_1035, pci_dev_list_1035},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1036, pci_vendor_1036, pci_dev_list_1036},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1037, pci_vendor_1037, pci_dev_list_1037},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1038, pci_vendor_1038, pci_dev_list_1038},
+#endif
+ {0x1039, pci_vendor_1039, pci_dev_list_1039},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x103a, pci_vendor_103a, pci_dev_list_103a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x103b, pci_vendor_103b, pci_dev_list_103b},
+#endif
+ {0x103c, pci_vendor_103c, pci_dev_list_103c},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x103e, pci_vendor_103e, pci_dev_list_103e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x103f, pci_vendor_103f, pci_dev_list_103f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1040, pci_vendor_1040, pci_dev_list_1040},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1041, pci_vendor_1041, pci_dev_list_1041},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1042, pci_vendor_1042, pci_dev_list_1042},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1043, pci_vendor_1043, pci_dev_list_1043},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1044, pci_vendor_1044, pci_dev_list_1044},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1045, pci_vendor_1045, pci_dev_list_1045},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1046, pci_vendor_1046, pci_dev_list_1046},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1047, pci_vendor_1047, pci_dev_list_1047},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1048, pci_vendor_1048, pci_dev_list_1048},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1049, pci_vendor_1049, pci_dev_list_1049},
+#endif
+ {0x104a, pci_vendor_104a, pci_dev_list_104a},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x104b, pci_vendor_104b, pci_dev_list_104b},
+#endif
+ {0x104c, pci_vendor_104c, pci_dev_list_104c},
+ {0x104d, pci_vendor_104d, pci_dev_list_104d},
+ {0x104e, pci_vendor_104e, pci_dev_list_104e},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x104f, pci_vendor_104f, pci_dev_list_104f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1050, pci_vendor_1050, pci_dev_list_1050},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1051, pci_vendor_1051, pci_dev_list_1051},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1052, pci_vendor_1052, pci_dev_list_1052},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1053, pci_vendor_1053, pci_dev_list_1053},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1054, pci_vendor_1054, pci_dev_list_1054},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1055, pci_vendor_1055, pci_dev_list_1055},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1056, pci_vendor_1056, pci_dev_list_1056},
+#endif
+ {0x1057, pci_vendor_1057, pci_dev_list_1057},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1058, pci_vendor_1058, pci_dev_list_1058},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1059, pci_vendor_1059, pci_dev_list_1059},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105a, pci_vendor_105a, pci_dev_list_105a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105b, pci_vendor_105b, pci_dev_list_105b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105c, pci_vendor_105c, pci_dev_list_105c},
+#endif
+ {0x105d, pci_vendor_105d, pci_dev_list_105d},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105e, pci_vendor_105e, pci_dev_list_105e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105f, pci_vendor_105f, pci_dev_list_105f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1060, pci_vendor_1060, pci_dev_list_1060},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1061, pci_vendor_1061, pci_dev_list_1061},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1062, pci_vendor_1062, pci_dev_list_1062},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1063, pci_vendor_1063, pci_dev_list_1063},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1064, pci_vendor_1064, pci_dev_list_1064},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1065, pci_vendor_1065, pci_dev_list_1065},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1066, pci_vendor_1066, pci_dev_list_1066},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1067, pci_vendor_1067, pci_dev_list_1067},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1068, pci_vendor_1068, pci_dev_list_1068},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1069, pci_vendor_1069, pci_dev_list_1069},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106a, pci_vendor_106a, pci_dev_list_106a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106b, pci_vendor_106b, pci_dev_list_106b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106c, pci_vendor_106c, pci_dev_list_106c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106d, pci_vendor_106d, pci_dev_list_106d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106e, pci_vendor_106e, pci_dev_list_106e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106f, pci_vendor_106f, pci_dev_list_106f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1070, pci_vendor_1070, pci_dev_list_1070},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1071, pci_vendor_1071, pci_dev_list_1071},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1072, pci_vendor_1072, pci_dev_list_1072},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1073, pci_vendor_1073, pci_dev_list_1073},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1074, pci_vendor_1074, pci_dev_list_1074},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1075, pci_vendor_1075, pci_dev_list_1075},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1076, pci_vendor_1076, pci_dev_list_1076},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1077, pci_vendor_1077, pci_dev_list_1077},
+#endif
+ {0x1078, pci_vendor_1078, pci_dev_list_1078},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1079, pci_vendor_1079, pci_dev_list_1079},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107a, pci_vendor_107a, pci_dev_list_107a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107b, pci_vendor_107b, pci_dev_list_107b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107c, pci_vendor_107c, pci_dev_list_107c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107d, pci_vendor_107d, pci_dev_list_107d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107e, pci_vendor_107e, pci_dev_list_107e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107f, pci_vendor_107f, pci_dev_list_107f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1080, pci_vendor_1080, pci_dev_list_1080},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1081, pci_vendor_1081, pci_dev_list_1081},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1082, pci_vendor_1082, pci_dev_list_1082},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1083, pci_vendor_1083, pci_dev_list_1083},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1084, pci_vendor_1084, pci_dev_list_1084},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1085, pci_vendor_1085, pci_dev_list_1085},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1086, pci_vendor_1086, pci_dev_list_1086},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1087, pci_vendor_1087, pci_dev_list_1087},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1088, pci_vendor_1088, pci_dev_list_1088},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1089, pci_vendor_1089, pci_dev_list_1089},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x108a, pci_vendor_108a, pci_dev_list_108a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x108c, pci_vendor_108c, pci_dev_list_108c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x108d, pci_vendor_108d, pci_dev_list_108d},
+#endif
+ {0x108e, pci_vendor_108e, pci_dev_list_108e},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x108f, pci_vendor_108f, pci_dev_list_108f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1090, pci_vendor_1090, pci_dev_list_1090},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1091, pci_vendor_1091, pci_dev_list_1091},
+#endif
+ {0x1092, pci_vendor_1092, pci_dev_list_1092},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1093, pci_vendor_1093, pci_dev_list_1093},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1094, pci_vendor_1094, pci_dev_list_1094},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1095, pci_vendor_1095, pci_dev_list_1095},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1096, pci_vendor_1096, pci_dev_list_1096},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1097, pci_vendor_1097, pci_dev_list_1097},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1098, pci_vendor_1098, pci_dev_list_1098},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1099, pci_vendor_1099, pci_dev_list_1099},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109a, pci_vendor_109a, pci_dev_list_109a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109b, pci_vendor_109b, pci_dev_list_109b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109c, pci_vendor_109c, pci_dev_list_109c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109d, pci_vendor_109d, pci_dev_list_109d},
+#endif
+ {0x109e, pci_vendor_109e, pci_dev_list_109e},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109f, pci_vendor_109f, pci_dev_list_109f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a0, pci_vendor_10a0, pci_dev_list_10a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a1, pci_vendor_10a1, pci_dev_list_10a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a2, pci_vendor_10a2, pci_dev_list_10a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a3, pci_vendor_10a3, pci_dev_list_10a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a4, pci_vendor_10a4, pci_dev_list_10a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a5, pci_vendor_10a5, pci_dev_list_10a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a6, pci_vendor_10a6, pci_dev_list_10a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a7, pci_vendor_10a7, pci_dev_list_10a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a8, pci_vendor_10a8, pci_dev_list_10a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a9, pci_vendor_10a9, pci_dev_list_10a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10aa, pci_vendor_10aa, pci_dev_list_10aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ab, pci_vendor_10ab, pci_dev_list_10ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ac, pci_vendor_10ac, pci_dev_list_10ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ad, pci_vendor_10ad, pci_dev_list_10ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ae, pci_vendor_10ae, pci_dev_list_10ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10af, pci_vendor_10af, pci_dev_list_10af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b0, pci_vendor_10b0, pci_dev_list_10b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b1, pci_vendor_10b1, pci_dev_list_10b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b2, pci_vendor_10b2, pci_dev_list_10b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b3, pci_vendor_10b3, pci_dev_list_10b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b4, pci_vendor_10b4, pci_dev_list_10b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b5, pci_vendor_10b5, pci_dev_list_10b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b6, pci_vendor_10b6, pci_dev_list_10b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b7, pci_vendor_10b7, pci_dev_list_10b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b8, pci_vendor_10b8, pci_dev_list_10b8},
+#endif
+ {0x10b9, pci_vendor_10b9, pci_dev_list_10b9},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ba, pci_vendor_10ba, pci_dev_list_10ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10bb, pci_vendor_10bb, pci_dev_list_10bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10bc, pci_vendor_10bc, pci_dev_list_10bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10bd, pci_vendor_10bd, pci_dev_list_10bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10be, pci_vendor_10be, pci_dev_list_10be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10bf, pci_vendor_10bf, pci_dev_list_10bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c0, pci_vendor_10c0, pci_dev_list_10c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c1, pci_vendor_10c1, pci_dev_list_10c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c2, pci_vendor_10c2, pci_dev_list_10c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c3, pci_vendor_10c3, pci_dev_list_10c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c4, pci_vendor_10c4, pci_dev_list_10c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c5, pci_vendor_10c5, pci_dev_list_10c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c6, pci_vendor_10c6, pci_dev_list_10c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c7, pci_vendor_10c7, pci_dev_list_10c7},
+#endif
+ {0x10c8, pci_vendor_10c8, pci_dev_list_10c8},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c9, pci_vendor_10c9, pci_dev_list_10c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ca, pci_vendor_10ca, pci_dev_list_10ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10cb, pci_vendor_10cb, pci_dev_list_10cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10cc, pci_vendor_10cc, pci_dev_list_10cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10cd, pci_vendor_10cd, pci_dev_list_10cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ce, pci_vendor_10ce, pci_dev_list_10ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10cf, pci_vendor_10cf, pci_dev_list_10cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d0, pci_vendor_10d0, pci_dev_list_10d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d1, pci_vendor_10d1, pci_dev_list_10d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d2, pci_vendor_10d2, pci_dev_list_10d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d3, pci_vendor_10d3, pci_dev_list_10d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d4, pci_vendor_10d4, pci_dev_list_10d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d5, pci_vendor_10d5, pci_dev_list_10d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d6, pci_vendor_10d6, pci_dev_list_10d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d7, pci_vendor_10d7, pci_dev_list_10d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d8, pci_vendor_10d8, pci_dev_list_10d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d9, pci_vendor_10d9, pci_dev_list_10d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10da, pci_vendor_10da, pci_dev_list_10da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10db, pci_vendor_10db, pci_dev_list_10db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10dc, pci_vendor_10dc, pci_dev_list_10dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10dd, pci_vendor_10dd, pci_dev_list_10dd},
+#endif
+ {0x10de, pci_vendor_10de, pci_dev_list_10de},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10df, pci_vendor_10df, pci_dev_list_10df},
+#endif
+ {0x10e0, pci_vendor_10e0, pci_dev_list_10e0},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e1, pci_vendor_10e1, pci_dev_list_10e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e2, pci_vendor_10e2, pci_dev_list_10e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e3, pci_vendor_10e3, pci_dev_list_10e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e4, pci_vendor_10e4, pci_dev_list_10e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e5, pci_vendor_10e5, pci_dev_list_10e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e6, pci_vendor_10e6, pci_dev_list_10e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e7, pci_vendor_10e7, pci_dev_list_10e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e8, pci_vendor_10e8, pci_dev_list_10e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e9, pci_vendor_10e9, pci_dev_list_10e9},
+#endif
+ {0x10ea, pci_vendor_10ea, pci_dev_list_10ea},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10eb, pci_vendor_10eb, pci_dev_list_10eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ec, pci_vendor_10ec, pci_dev_list_10ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ed, pci_vendor_10ed, pci_dev_list_10ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ee, pci_vendor_10ee, pci_dev_list_10ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ef, pci_vendor_10ef, pci_dev_list_10ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f0, pci_vendor_10f0, pci_dev_list_10f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f1, pci_vendor_10f1, pci_dev_list_10f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f2, pci_vendor_10f2, pci_dev_list_10f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f3, pci_vendor_10f3, pci_dev_list_10f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f4, pci_vendor_10f4, pci_dev_list_10f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f5, pci_vendor_10f5, pci_dev_list_10f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f6, pci_vendor_10f6, pci_dev_list_10f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f7, pci_vendor_10f7, pci_dev_list_10f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f8, pci_vendor_10f8, pci_dev_list_10f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f9, pci_vendor_10f9, pci_dev_list_10f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fa, pci_vendor_10fa, pci_dev_list_10fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fb, pci_vendor_10fb, pci_dev_list_10fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fc, pci_vendor_10fc, pci_dev_list_10fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fd, pci_vendor_10fd, pci_dev_list_10fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fe, pci_vendor_10fe, pci_dev_list_10fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ff, pci_vendor_10ff, pci_dev_list_10ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1100, pci_vendor_1100, pci_dev_list_1100},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1101, pci_vendor_1101, pci_dev_list_1101},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1102, pci_vendor_1102, pci_dev_list_1102},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1103, pci_vendor_1103, pci_dev_list_1103},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1104, pci_vendor_1104, pci_dev_list_1104},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1105, pci_vendor_1105, pci_dev_list_1105},
+#endif
+ {0x1106, pci_vendor_1106, pci_dev_list_1106},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1107, pci_vendor_1107, pci_dev_list_1107},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1108, pci_vendor_1108, pci_dev_list_1108},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1109, pci_vendor_1109, pci_dev_list_1109},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110a, pci_vendor_110a, pci_dev_list_110a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110b, pci_vendor_110b, pci_dev_list_110b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110c, pci_vendor_110c, pci_dev_list_110c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110d, pci_vendor_110d, pci_dev_list_110d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110e, pci_vendor_110e, pci_dev_list_110e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110f, pci_vendor_110f, pci_dev_list_110f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1110, pci_vendor_1110, pci_dev_list_1110},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1111, pci_vendor_1111, pci_dev_list_1111},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1112, pci_vendor_1112, pci_dev_list_1112},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1113, pci_vendor_1113, pci_dev_list_1113},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1114, pci_vendor_1114, pci_dev_list_1114},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1115, pci_vendor_1115, pci_dev_list_1115},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1116, pci_vendor_1116, pci_dev_list_1116},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1117, pci_vendor_1117, pci_dev_list_1117},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1118, pci_vendor_1118, pci_dev_list_1118},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1119, pci_vendor_1119, pci_dev_list_1119},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111a, pci_vendor_111a, pci_dev_list_111a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111b, pci_vendor_111b, pci_dev_list_111b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111c, pci_vendor_111c, pci_dev_list_111c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111d, pci_vendor_111d, pci_dev_list_111d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111e, pci_vendor_111e, pci_dev_list_111e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111f, pci_vendor_111f, pci_dev_list_111f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1120, pci_vendor_1120, pci_dev_list_1120},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1121, pci_vendor_1121, pci_dev_list_1121},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1122, pci_vendor_1122, pci_dev_list_1122},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1123, pci_vendor_1123, pci_dev_list_1123},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1124, pci_vendor_1124, pci_dev_list_1124},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1125, pci_vendor_1125, pci_dev_list_1125},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1126, pci_vendor_1126, pci_dev_list_1126},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1127, pci_vendor_1127, pci_dev_list_1127},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1129, pci_vendor_1129, pci_dev_list_1129},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112a, pci_vendor_112a, pci_dev_list_112a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112b, pci_vendor_112b, pci_dev_list_112b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112c, pci_vendor_112c, pci_dev_list_112c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112d, pci_vendor_112d, pci_dev_list_112d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112e, pci_vendor_112e, pci_dev_list_112e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112f, pci_vendor_112f, pci_dev_list_112f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1130, pci_vendor_1130, pci_dev_list_1130},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1131, pci_vendor_1131, pci_dev_list_1131},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1132, pci_vendor_1132, pci_dev_list_1132},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1133, pci_vendor_1133, pci_dev_list_1133},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1134, pci_vendor_1134, pci_dev_list_1134},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1135, pci_vendor_1135, pci_dev_list_1135},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1136, pci_vendor_1136, pci_dev_list_1136},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1137, pci_vendor_1137, pci_dev_list_1137},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1138, pci_vendor_1138, pci_dev_list_1138},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1139, pci_vendor_1139, pci_dev_list_1139},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113a, pci_vendor_113a, pci_dev_list_113a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113b, pci_vendor_113b, pci_dev_list_113b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113c, pci_vendor_113c, pci_dev_list_113c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113d, pci_vendor_113d, pci_dev_list_113d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113e, pci_vendor_113e, pci_dev_list_113e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113f, pci_vendor_113f, pci_dev_list_113f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1140, pci_vendor_1140, pci_dev_list_1140},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1141, pci_vendor_1141, pci_dev_list_1141},
+#endif
+ {0x1142, pci_vendor_1142, pci_dev_list_1142},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1143, pci_vendor_1143, pci_dev_list_1143},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1144, pci_vendor_1144, pci_dev_list_1144},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1145, pci_vendor_1145, pci_dev_list_1145},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1146, pci_vendor_1146, pci_dev_list_1146},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1147, pci_vendor_1147, pci_dev_list_1147},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1148, pci_vendor_1148, pci_dev_list_1148},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1149, pci_vendor_1149, pci_dev_list_1149},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114a, pci_vendor_114a, pci_dev_list_114a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114b, pci_vendor_114b, pci_dev_list_114b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114c, pci_vendor_114c, pci_dev_list_114c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114d, pci_vendor_114d, pci_dev_list_114d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114e, pci_vendor_114e, pci_dev_list_114e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114f, pci_vendor_114f, pci_dev_list_114f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1150, pci_vendor_1150, pci_dev_list_1150},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1151, pci_vendor_1151, pci_dev_list_1151},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1152, pci_vendor_1152, pci_dev_list_1152},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1153, pci_vendor_1153, pci_dev_list_1153},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1154, pci_vendor_1154, pci_dev_list_1154},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1155, pci_vendor_1155, pci_dev_list_1155},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1156, pci_vendor_1156, pci_dev_list_1156},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1157, pci_vendor_1157, pci_dev_list_1157},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1158, pci_vendor_1158, pci_dev_list_1158},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1159, pci_vendor_1159, pci_dev_list_1159},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115a, pci_vendor_115a, pci_dev_list_115a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115b, pci_vendor_115b, pci_dev_list_115b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115c, pci_vendor_115c, pci_dev_list_115c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115d, pci_vendor_115d, pci_dev_list_115d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115e, pci_vendor_115e, pci_dev_list_115e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115f, pci_vendor_115f, pci_dev_list_115f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1160, pci_vendor_1160, pci_dev_list_1160},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1161, pci_vendor_1161, pci_dev_list_1161},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1162, pci_vendor_1162, pci_dev_list_1162},
+#endif
+ {0x1163, pci_vendor_1163, pci_dev_list_1163},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1164, pci_vendor_1164, pci_dev_list_1164},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1165, pci_vendor_1165, pci_dev_list_1165},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1166, pci_vendor_1166, pci_dev_list_1166},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1167, pci_vendor_1167, pci_dev_list_1167},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1168, pci_vendor_1168, pci_dev_list_1168},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1169, pci_vendor_1169, pci_dev_list_1169},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116a, pci_vendor_116a, pci_dev_list_116a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116b, pci_vendor_116b, pci_dev_list_116b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116c, pci_vendor_116c, pci_dev_list_116c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116d, pci_vendor_116d, pci_dev_list_116d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116e, pci_vendor_116e, pci_dev_list_116e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116f, pci_vendor_116f, pci_dev_list_116f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1170, pci_vendor_1170, pci_dev_list_1170},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1171, pci_vendor_1171, pci_dev_list_1171},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1172, pci_vendor_1172, pci_dev_list_1172},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1173, pci_vendor_1173, pci_dev_list_1173},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1174, pci_vendor_1174, pci_dev_list_1174},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1175, pci_vendor_1175, pci_dev_list_1175},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1176, pci_vendor_1176, pci_dev_list_1176},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1177, pci_vendor_1177, pci_dev_list_1177},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1178, pci_vendor_1178, pci_dev_list_1178},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1179, pci_vendor_1179, pci_dev_list_1179},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117a, pci_vendor_117a, pci_dev_list_117a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117b, pci_vendor_117b, pci_dev_list_117b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117c, pci_vendor_117c, pci_dev_list_117c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117d, pci_vendor_117d, pci_dev_list_117d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117e, pci_vendor_117e, pci_dev_list_117e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117f, pci_vendor_117f, pci_dev_list_117f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1180, pci_vendor_1180, pci_dev_list_1180},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1181, pci_vendor_1181, pci_dev_list_1181},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1183, pci_vendor_1183, pci_dev_list_1183},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1184, pci_vendor_1184, pci_dev_list_1184},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1185, pci_vendor_1185, pci_dev_list_1185},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1186, pci_vendor_1186, pci_dev_list_1186},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1187, pci_vendor_1187, pci_dev_list_1187},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1188, pci_vendor_1188, pci_dev_list_1188},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1189, pci_vendor_1189, pci_dev_list_1189},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118a, pci_vendor_118a, pci_dev_list_118a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118b, pci_vendor_118b, pci_dev_list_118b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118c, pci_vendor_118c, pci_dev_list_118c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118d, pci_vendor_118d, pci_dev_list_118d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118e, pci_vendor_118e, pci_dev_list_118e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118f, pci_vendor_118f, pci_dev_list_118f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1190, pci_vendor_1190, pci_dev_list_1190},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1191, pci_vendor_1191, pci_dev_list_1191},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1192, pci_vendor_1192, pci_dev_list_1192},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1193, pci_vendor_1193, pci_dev_list_1193},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1194, pci_vendor_1194, pci_dev_list_1194},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1195, pci_vendor_1195, pci_dev_list_1195},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1196, pci_vendor_1196, pci_dev_list_1196},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1197, pci_vendor_1197, pci_dev_list_1197},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1198, pci_vendor_1198, pci_dev_list_1198},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1199, pci_vendor_1199, pci_dev_list_1199},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119a, pci_vendor_119a, pci_dev_list_119a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119b, pci_vendor_119b, pci_dev_list_119b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119c, pci_vendor_119c, pci_dev_list_119c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119d, pci_vendor_119d, pci_dev_list_119d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119e, pci_vendor_119e, pci_dev_list_119e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119f, pci_vendor_119f, pci_dev_list_119f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a0, pci_vendor_11a0, pci_dev_list_11a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a1, pci_vendor_11a1, pci_dev_list_11a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a2, pci_vendor_11a2, pci_dev_list_11a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a3, pci_vendor_11a3, pci_dev_list_11a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a4, pci_vendor_11a4, pci_dev_list_11a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a5, pci_vendor_11a5, pci_dev_list_11a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a6, pci_vendor_11a6, pci_dev_list_11a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a7, pci_vendor_11a7, pci_dev_list_11a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a8, pci_vendor_11a8, pci_dev_list_11a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a9, pci_vendor_11a9, pci_dev_list_11a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11aa, pci_vendor_11aa, pci_dev_list_11aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ab, pci_vendor_11ab, pci_dev_list_11ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ac, pci_vendor_11ac, pci_dev_list_11ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ad, pci_vendor_11ad, pci_dev_list_11ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ae, pci_vendor_11ae, pci_dev_list_11ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11af, pci_vendor_11af, pci_dev_list_11af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b0, pci_vendor_11b0, pci_dev_list_11b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b1, pci_vendor_11b1, pci_dev_list_11b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b2, pci_vendor_11b2, pci_dev_list_11b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b3, pci_vendor_11b3, pci_dev_list_11b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b4, pci_vendor_11b4, pci_dev_list_11b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b5, pci_vendor_11b5, pci_dev_list_11b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b6, pci_vendor_11b6, pci_dev_list_11b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b7, pci_vendor_11b7, pci_dev_list_11b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b8, pci_vendor_11b8, pci_dev_list_11b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b9, pci_vendor_11b9, pci_dev_list_11b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ba, pci_vendor_11ba, pci_dev_list_11ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11bb, pci_vendor_11bb, pci_dev_list_11bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11bc, pci_vendor_11bc, pci_dev_list_11bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11bd, pci_vendor_11bd, pci_dev_list_11bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11be, pci_vendor_11be, pci_dev_list_11be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11bf, pci_vendor_11bf, pci_dev_list_11bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c0, pci_vendor_11c0, pci_dev_list_11c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c1, pci_vendor_11c1, pci_dev_list_11c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c2, pci_vendor_11c2, pci_dev_list_11c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c3, pci_vendor_11c3, pci_dev_list_11c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c4, pci_vendor_11c4, pci_dev_list_11c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c5, pci_vendor_11c5, pci_dev_list_11c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c6, pci_vendor_11c6, pci_dev_list_11c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c7, pci_vendor_11c7, pci_dev_list_11c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c8, pci_vendor_11c8, pci_dev_list_11c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c9, pci_vendor_11c9, pci_dev_list_11c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ca, pci_vendor_11ca, pci_dev_list_11ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11cb, pci_vendor_11cb, pci_dev_list_11cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11cc, pci_vendor_11cc, pci_dev_list_11cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11cd, pci_vendor_11cd, pci_dev_list_11cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ce, pci_vendor_11ce, pci_dev_list_11ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11cf, pci_vendor_11cf, pci_dev_list_11cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d0, pci_vendor_11d0, pci_dev_list_11d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d1, pci_vendor_11d1, pci_dev_list_11d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d2, pci_vendor_11d2, pci_dev_list_11d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d3, pci_vendor_11d3, pci_dev_list_11d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d4, pci_vendor_11d4, pci_dev_list_11d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d5, pci_vendor_11d5, pci_dev_list_11d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d6, pci_vendor_11d6, pci_dev_list_11d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d7, pci_vendor_11d7, pci_dev_list_11d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d8, pci_vendor_11d8, pci_dev_list_11d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d9, pci_vendor_11d9, pci_dev_list_11d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11da, pci_vendor_11da, pci_dev_list_11da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11db, pci_vendor_11db, pci_dev_list_11db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11dc, pci_vendor_11dc, pci_dev_list_11dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11dd, pci_vendor_11dd, pci_dev_list_11dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11de, pci_vendor_11de, pci_dev_list_11de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11df, pci_vendor_11df, pci_dev_list_11df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e0, pci_vendor_11e0, pci_dev_list_11e0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e1, pci_vendor_11e1, pci_dev_list_11e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e2, pci_vendor_11e2, pci_dev_list_11e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e3, pci_vendor_11e3, pci_dev_list_11e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e4, pci_vendor_11e4, pci_dev_list_11e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e5, pci_vendor_11e5, pci_dev_list_11e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e6, pci_vendor_11e6, pci_dev_list_11e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e7, pci_vendor_11e7, pci_dev_list_11e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e8, pci_vendor_11e8, pci_dev_list_11e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e9, pci_vendor_11e9, pci_dev_list_11e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ea, pci_vendor_11ea, pci_dev_list_11ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11eb, pci_vendor_11eb, pci_dev_list_11eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ec, pci_vendor_11ec, pci_dev_list_11ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ed, pci_vendor_11ed, pci_dev_list_11ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ee, pci_vendor_11ee, pci_dev_list_11ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ef, pci_vendor_11ef, pci_dev_list_11ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f0, pci_vendor_11f0, pci_dev_list_11f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f1, pci_vendor_11f1, pci_dev_list_11f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f2, pci_vendor_11f2, pci_dev_list_11f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f3, pci_vendor_11f3, pci_dev_list_11f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f4, pci_vendor_11f4, pci_dev_list_11f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f5, pci_vendor_11f5, pci_dev_list_11f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f6, pci_vendor_11f6, pci_dev_list_11f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f7, pci_vendor_11f7, pci_dev_list_11f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f8, pci_vendor_11f8, pci_dev_list_11f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f9, pci_vendor_11f9, pci_dev_list_11f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fa, pci_vendor_11fa, pci_dev_list_11fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fb, pci_vendor_11fb, pci_dev_list_11fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fc, pci_vendor_11fc, pci_dev_list_11fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fd, pci_vendor_11fd, pci_dev_list_11fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fe, pci_vendor_11fe, pci_dev_list_11fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ff, pci_vendor_11ff, pci_dev_list_11ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1200, pci_vendor_1200, pci_dev_list_1200},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1201, pci_vendor_1201, pci_dev_list_1201},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1202, pci_vendor_1202, pci_dev_list_1202},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1203, pci_vendor_1203, pci_dev_list_1203},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1204, pci_vendor_1204, pci_dev_list_1204},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1205, pci_vendor_1205, pci_dev_list_1205},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1206, pci_vendor_1206, pci_dev_list_1206},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1208, pci_vendor_1208, pci_dev_list_1208},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1209, pci_vendor_1209, pci_dev_list_1209},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120a, pci_vendor_120a, pci_dev_list_120a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120b, pci_vendor_120b, pci_dev_list_120b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120c, pci_vendor_120c, pci_dev_list_120c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120d, pci_vendor_120d, pci_dev_list_120d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120e, pci_vendor_120e, pci_dev_list_120e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120f, pci_vendor_120f, pci_dev_list_120f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1210, pci_vendor_1210, pci_dev_list_1210},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1211, pci_vendor_1211, pci_dev_list_1211},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1212, pci_vendor_1212, pci_dev_list_1212},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1213, pci_vendor_1213, pci_dev_list_1213},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1214, pci_vendor_1214, pci_dev_list_1214},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1215, pci_vendor_1215, pci_dev_list_1215},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1216, pci_vendor_1216, pci_dev_list_1216},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1217, pci_vendor_1217, pci_dev_list_1217},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1218, pci_vendor_1218, pci_dev_list_1218},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1219, pci_vendor_1219, pci_dev_list_1219},
+#endif
+ {0x121a, pci_vendor_121a, pci_dev_list_121a},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121b, pci_vendor_121b, pci_dev_list_121b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121c, pci_vendor_121c, pci_dev_list_121c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121d, pci_vendor_121d, pci_dev_list_121d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121e, pci_vendor_121e, pci_dev_list_121e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121f, pci_vendor_121f, pci_dev_list_121f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1220, pci_vendor_1220, pci_dev_list_1220},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1221, pci_vendor_1221, pci_dev_list_1221},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1222, pci_vendor_1222, pci_dev_list_1222},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1223, pci_vendor_1223, pci_dev_list_1223},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1224, pci_vendor_1224, pci_dev_list_1224},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1225, pci_vendor_1225, pci_dev_list_1225},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1227, pci_vendor_1227, pci_dev_list_1227},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1228, pci_vendor_1228, pci_dev_list_1228},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1229, pci_vendor_1229, pci_dev_list_1229},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122a, pci_vendor_122a, pci_dev_list_122a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122b, pci_vendor_122b, pci_dev_list_122b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122c, pci_vendor_122c, pci_dev_list_122c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122d, pci_vendor_122d, pci_dev_list_122d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122e, pci_vendor_122e, pci_dev_list_122e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122f, pci_vendor_122f, pci_dev_list_122f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1230, pci_vendor_1230, pci_dev_list_1230},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1231, pci_vendor_1231, pci_dev_list_1231},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1232, pci_vendor_1232, pci_dev_list_1232},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1233, pci_vendor_1233, pci_dev_list_1233},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1234, pci_vendor_1234, pci_dev_list_1234},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1235, pci_vendor_1235, pci_dev_list_1235},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1236, pci_vendor_1236, pci_dev_list_1236},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1237, pci_vendor_1237, pci_dev_list_1237},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1238, pci_vendor_1238, pci_dev_list_1238},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1239, pci_vendor_1239, pci_dev_list_1239},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123a, pci_vendor_123a, pci_dev_list_123a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123b, pci_vendor_123b, pci_dev_list_123b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123c, pci_vendor_123c, pci_dev_list_123c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123d, pci_vendor_123d, pci_dev_list_123d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123e, pci_vendor_123e, pci_dev_list_123e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123f, pci_vendor_123f, pci_dev_list_123f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1240, pci_vendor_1240, pci_dev_list_1240},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1241, pci_vendor_1241, pci_dev_list_1241},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1242, pci_vendor_1242, pci_dev_list_1242},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1243, pci_vendor_1243, pci_dev_list_1243},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1244, pci_vendor_1244, pci_dev_list_1244},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1245, pci_vendor_1245, pci_dev_list_1245},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1246, pci_vendor_1246, pci_dev_list_1246},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1247, pci_vendor_1247, pci_dev_list_1247},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1248, pci_vendor_1248, pci_dev_list_1248},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1249, pci_vendor_1249, pci_dev_list_1249},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124a, pci_vendor_124a, pci_dev_list_124a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124b, pci_vendor_124b, pci_dev_list_124b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124c, pci_vendor_124c, pci_dev_list_124c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124d, pci_vendor_124d, pci_dev_list_124d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124e, pci_vendor_124e, pci_dev_list_124e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124f, pci_vendor_124f, pci_dev_list_124f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1250, pci_vendor_1250, pci_dev_list_1250},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1251, pci_vendor_1251, pci_dev_list_1251},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1253, pci_vendor_1253, pci_dev_list_1253},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1254, pci_vendor_1254, pci_dev_list_1254},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1255, pci_vendor_1255, pci_dev_list_1255},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1256, pci_vendor_1256, pci_dev_list_1256},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1257, pci_vendor_1257, pci_dev_list_1257},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1258, pci_vendor_1258, pci_dev_list_1258},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1259, pci_vendor_1259, pci_dev_list_1259},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125a, pci_vendor_125a, pci_dev_list_125a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125b, pci_vendor_125b, pci_dev_list_125b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125c, pci_vendor_125c, pci_dev_list_125c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125d, pci_vendor_125d, pci_dev_list_125d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125e, pci_vendor_125e, pci_dev_list_125e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125f, pci_vendor_125f, pci_dev_list_125f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1260, pci_vendor_1260, pci_dev_list_1260},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1261, pci_vendor_1261, pci_dev_list_1261},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1262, pci_vendor_1262, pci_dev_list_1262},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1263, pci_vendor_1263, pci_dev_list_1263},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1264, pci_vendor_1264, pci_dev_list_1264},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1265, pci_vendor_1265, pci_dev_list_1265},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1266, pci_vendor_1266, pci_dev_list_1266},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1267, pci_vendor_1267, pci_dev_list_1267},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1268, pci_vendor_1268, pci_dev_list_1268},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1269, pci_vendor_1269, pci_dev_list_1269},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126a, pci_vendor_126a, pci_dev_list_126a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126b, pci_vendor_126b, pci_dev_list_126b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126c, pci_vendor_126c, pci_dev_list_126c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126d, pci_vendor_126d, pci_dev_list_126d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126e, pci_vendor_126e, pci_dev_list_126e},
+#endif
+ {0x126f, pci_vendor_126f, pci_dev_list_126f},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1270, pci_vendor_1270, pci_dev_list_1270},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1271, pci_vendor_1271, pci_dev_list_1271},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1272, pci_vendor_1272, pci_dev_list_1272},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1273, pci_vendor_1273, pci_dev_list_1273},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1274, pci_vendor_1274, pci_dev_list_1274},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1275, pci_vendor_1275, pci_dev_list_1275},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1276, pci_vendor_1276, pci_dev_list_1276},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1277, pci_vendor_1277, pci_dev_list_1277},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1278, pci_vendor_1278, pci_dev_list_1278},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1279, pci_vendor_1279, pci_dev_list_1279},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127a, pci_vendor_127a, pci_dev_list_127a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127b, pci_vendor_127b, pci_dev_list_127b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127c, pci_vendor_127c, pci_dev_list_127c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127d, pci_vendor_127d, pci_dev_list_127d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127e, pci_vendor_127e, pci_dev_list_127e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127f, pci_vendor_127f, pci_dev_list_127f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1280, pci_vendor_1280, pci_dev_list_1280},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1281, pci_vendor_1281, pci_dev_list_1281},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1282, pci_vendor_1282, pci_dev_list_1282},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1283, pci_vendor_1283, pci_dev_list_1283},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1284, pci_vendor_1284, pci_dev_list_1284},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1285, pci_vendor_1285, pci_dev_list_1285},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1286, pci_vendor_1286, pci_dev_list_1286},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1287, pci_vendor_1287, pci_dev_list_1287},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1288, pci_vendor_1288, pci_dev_list_1288},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1289, pci_vendor_1289, pci_dev_list_1289},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128a, pci_vendor_128a, pci_dev_list_128a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128b, pci_vendor_128b, pci_dev_list_128b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128c, pci_vendor_128c, pci_dev_list_128c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128d, pci_vendor_128d, pci_dev_list_128d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128e, pci_vendor_128e, pci_dev_list_128e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128f, pci_vendor_128f, pci_dev_list_128f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1290, pci_vendor_1290, pci_dev_list_1290},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1291, pci_vendor_1291, pci_dev_list_1291},
+#endif
+ {0x1292, pci_vendor_1292, pci_dev_list_1292},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1293, pci_vendor_1293, pci_dev_list_1293},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1294, pci_vendor_1294, pci_dev_list_1294},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1295, pci_vendor_1295, pci_dev_list_1295},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1296, pci_vendor_1296, pci_dev_list_1296},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1297, pci_vendor_1297, pci_dev_list_1297},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1298, pci_vendor_1298, pci_dev_list_1298},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1299, pci_vendor_1299, pci_dev_list_1299},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129a, pci_vendor_129a, pci_dev_list_129a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129b, pci_vendor_129b, pci_dev_list_129b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129c, pci_vendor_129c, pci_dev_list_129c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129d, pci_vendor_129d, pci_dev_list_129d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129e, pci_vendor_129e, pci_dev_list_129e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129f, pci_vendor_129f, pci_dev_list_129f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a0, pci_vendor_12a0, pci_dev_list_12a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a1, pci_vendor_12a1, pci_dev_list_12a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a2, pci_vendor_12a2, pci_dev_list_12a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a3, pci_vendor_12a3, pci_dev_list_12a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a4, pci_vendor_12a4, pci_dev_list_12a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a5, pci_vendor_12a5, pci_dev_list_12a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a6, pci_vendor_12a6, pci_dev_list_12a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a7, pci_vendor_12a7, pci_dev_list_12a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a8, pci_vendor_12a8, pci_dev_list_12a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a9, pci_vendor_12a9, pci_dev_list_12a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12aa, pci_vendor_12aa, pci_dev_list_12aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ab, pci_vendor_12ab, pci_dev_list_12ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ac, pci_vendor_12ac, pci_dev_list_12ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ad, pci_vendor_12ad, pci_dev_list_12ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ae, pci_vendor_12ae, pci_dev_list_12ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12af, pci_vendor_12af, pci_dev_list_12af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b0, pci_vendor_12b0, pci_dev_list_12b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b1, pci_vendor_12b1, pci_dev_list_12b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b2, pci_vendor_12b2, pci_dev_list_12b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b3, pci_vendor_12b3, pci_dev_list_12b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b4, pci_vendor_12b4, pci_dev_list_12b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b5, pci_vendor_12b5, pci_dev_list_12b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b6, pci_vendor_12b6, pci_dev_list_12b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b7, pci_vendor_12b7, pci_dev_list_12b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b8, pci_vendor_12b8, pci_dev_list_12b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b9, pci_vendor_12b9, pci_dev_list_12b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ba, pci_vendor_12ba, pci_dev_list_12ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12bb, pci_vendor_12bb, pci_dev_list_12bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12bc, pci_vendor_12bc, pci_dev_list_12bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12bd, pci_vendor_12bd, pci_dev_list_12bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12be, pci_vendor_12be, pci_dev_list_12be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12bf, pci_vendor_12bf, pci_dev_list_12bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c0, pci_vendor_12c0, pci_dev_list_12c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c1, pci_vendor_12c1, pci_dev_list_12c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c2, pci_vendor_12c2, pci_dev_list_12c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c3, pci_vendor_12c3, pci_dev_list_12c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c4, pci_vendor_12c4, pci_dev_list_12c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c5, pci_vendor_12c5, pci_dev_list_12c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c6, pci_vendor_12c6, pci_dev_list_12c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c7, pci_vendor_12c7, pci_dev_list_12c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c8, pci_vendor_12c8, pci_dev_list_12c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c9, pci_vendor_12c9, pci_dev_list_12c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ca, pci_vendor_12ca, pci_dev_list_12ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12cb, pci_vendor_12cb, pci_dev_list_12cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12cc, pci_vendor_12cc, pci_dev_list_12cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12cd, pci_vendor_12cd, pci_dev_list_12cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ce, pci_vendor_12ce, pci_dev_list_12ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12cf, pci_vendor_12cf, pci_dev_list_12cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d0, pci_vendor_12d0, pci_dev_list_12d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d1, pci_vendor_12d1, pci_dev_list_12d1},
+#endif
+ {0x12d2, pci_vendor_12d2, pci_dev_list_12d2},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d3, pci_vendor_12d3, pci_dev_list_12d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d4, pci_vendor_12d4, pci_dev_list_12d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d5, pci_vendor_12d5, pci_dev_list_12d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d6, pci_vendor_12d6, pci_dev_list_12d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d7, pci_vendor_12d7, pci_dev_list_12d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d8, pci_vendor_12d8, pci_dev_list_12d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d9, pci_vendor_12d9, pci_dev_list_12d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12da, pci_vendor_12da, pci_dev_list_12da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12db, pci_vendor_12db, pci_dev_list_12db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12dc, pci_vendor_12dc, pci_dev_list_12dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12dd, pci_vendor_12dd, pci_dev_list_12dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12de, pci_vendor_12de, pci_dev_list_12de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12df, pci_vendor_12df, pci_dev_list_12df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e0, pci_vendor_12e0, pci_dev_list_12e0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e1, pci_vendor_12e1, pci_dev_list_12e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e2, pci_vendor_12e2, pci_dev_list_12e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e3, pci_vendor_12e3, pci_dev_list_12e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e4, pci_vendor_12e4, pci_dev_list_12e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e5, pci_vendor_12e5, pci_dev_list_12e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e6, pci_vendor_12e6, pci_dev_list_12e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e7, pci_vendor_12e7, pci_dev_list_12e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e8, pci_vendor_12e8, pci_dev_list_12e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e9, pci_vendor_12e9, pci_dev_list_12e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ea, pci_vendor_12ea, pci_dev_list_12ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12eb, pci_vendor_12eb, pci_dev_list_12eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ec, pci_vendor_12ec, pci_dev_list_12ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ed, pci_vendor_12ed, pci_dev_list_12ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ee, pci_vendor_12ee, pci_dev_list_12ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ef, pci_vendor_12ef, pci_dev_list_12ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f0, pci_vendor_12f0, pci_dev_list_12f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f1, pci_vendor_12f1, pci_dev_list_12f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f2, pci_vendor_12f2, pci_dev_list_12f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f3, pci_vendor_12f3, pci_dev_list_12f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f4, pci_vendor_12f4, pci_dev_list_12f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f5, pci_vendor_12f5, pci_dev_list_12f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f6, pci_vendor_12f6, pci_dev_list_12f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f7, pci_vendor_12f7, pci_dev_list_12f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f8, pci_vendor_12f8, pci_dev_list_12f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f9, pci_vendor_12f9, pci_dev_list_12f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12fb, pci_vendor_12fb, pci_dev_list_12fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12fc, pci_vendor_12fc, pci_dev_list_12fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12fd, pci_vendor_12fd, pci_dev_list_12fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12fe, pci_vendor_12fe, pci_dev_list_12fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ff, pci_vendor_12ff, pci_dev_list_12ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1300, pci_vendor_1300, pci_dev_list_1300},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1302, pci_vendor_1302, pci_dev_list_1302},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1303, pci_vendor_1303, pci_dev_list_1303},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1304, pci_vendor_1304, pci_dev_list_1304},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1305, pci_vendor_1305, pci_dev_list_1305},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1306, pci_vendor_1306, pci_dev_list_1306},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1307, pci_vendor_1307, pci_dev_list_1307},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1308, pci_vendor_1308, pci_dev_list_1308},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1309, pci_vendor_1309, pci_dev_list_1309},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130a, pci_vendor_130a, pci_dev_list_130a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130b, pci_vendor_130b, pci_dev_list_130b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130c, pci_vendor_130c, pci_dev_list_130c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130d, pci_vendor_130d, pci_dev_list_130d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130e, pci_vendor_130e, pci_dev_list_130e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130f, pci_vendor_130f, pci_dev_list_130f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1310, pci_vendor_1310, pci_dev_list_1310},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1311, pci_vendor_1311, pci_dev_list_1311},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1312, pci_vendor_1312, pci_dev_list_1312},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1313, pci_vendor_1313, pci_dev_list_1313},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1316, pci_vendor_1316, pci_dev_list_1316},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1317, pci_vendor_1317, pci_dev_list_1317},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1318, pci_vendor_1318, pci_dev_list_1318},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1319, pci_vendor_1319, pci_dev_list_1319},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131a, pci_vendor_131a, pci_dev_list_131a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131c, pci_vendor_131c, pci_dev_list_131c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131d, pci_vendor_131d, pci_dev_list_131d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131e, pci_vendor_131e, pci_dev_list_131e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131f, pci_vendor_131f, pci_dev_list_131f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1320, pci_vendor_1320, pci_dev_list_1320},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1321, pci_vendor_1321, pci_dev_list_1321},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1322, pci_vendor_1322, pci_dev_list_1322},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1323, pci_vendor_1323, pci_dev_list_1323},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1324, pci_vendor_1324, pci_dev_list_1324},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1325, pci_vendor_1325, pci_dev_list_1325},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1326, pci_vendor_1326, pci_dev_list_1326},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1327, pci_vendor_1327, pci_dev_list_1327},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1328, pci_vendor_1328, pci_dev_list_1328},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1329, pci_vendor_1329, pci_dev_list_1329},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x132a, pci_vendor_132a, pci_dev_list_132a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x132b, pci_vendor_132b, pci_dev_list_132b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x132c, pci_vendor_132c, pci_dev_list_132c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x132d, pci_vendor_132d, pci_dev_list_132d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1330, pci_vendor_1330, pci_dev_list_1330},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1331, pci_vendor_1331, pci_dev_list_1331},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1332, pci_vendor_1332, pci_dev_list_1332},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1334, pci_vendor_1334, pci_dev_list_1334},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1335, pci_vendor_1335, pci_dev_list_1335},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1337, pci_vendor_1337, pci_dev_list_1337},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1338, pci_vendor_1338, pci_dev_list_1338},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133a, pci_vendor_133a, pci_dev_list_133a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133b, pci_vendor_133b, pci_dev_list_133b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133c, pci_vendor_133c, pci_dev_list_133c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133d, pci_vendor_133d, pci_dev_list_133d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133e, pci_vendor_133e, pci_dev_list_133e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133f, pci_vendor_133f, pci_dev_list_133f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1340, pci_vendor_1340, pci_dev_list_1340},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1341, pci_vendor_1341, pci_dev_list_1341},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1342, pci_vendor_1342, pci_dev_list_1342},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1343, pci_vendor_1343, pci_dev_list_1343},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1344, pci_vendor_1344, pci_dev_list_1344},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1345, pci_vendor_1345, pci_dev_list_1345},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1347, pci_vendor_1347, pci_dev_list_1347},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1349, pci_vendor_1349, pci_dev_list_1349},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134a, pci_vendor_134a, pci_dev_list_134a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134b, pci_vendor_134b, pci_dev_list_134b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134c, pci_vendor_134c, pci_dev_list_134c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134d, pci_vendor_134d, pci_dev_list_134d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134e, pci_vendor_134e, pci_dev_list_134e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134f, pci_vendor_134f, pci_dev_list_134f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1350, pci_vendor_1350, pci_dev_list_1350},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1351, pci_vendor_1351, pci_dev_list_1351},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1353, pci_vendor_1353, pci_dev_list_1353},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1354, pci_vendor_1354, pci_dev_list_1354},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1355, pci_vendor_1355, pci_dev_list_1355},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1356, pci_vendor_1356, pci_dev_list_1356},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1359, pci_vendor_1359, pci_dev_list_1359},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135a, pci_vendor_135a, pci_dev_list_135a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135b, pci_vendor_135b, pci_dev_list_135b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135c, pci_vendor_135c, pci_dev_list_135c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135d, pci_vendor_135d, pci_dev_list_135d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135e, pci_vendor_135e, pci_dev_list_135e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135f, pci_vendor_135f, pci_dev_list_135f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1360, pci_vendor_1360, pci_dev_list_1360},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1361, pci_vendor_1361, pci_dev_list_1361},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1362, pci_vendor_1362, pci_dev_list_1362},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1363, pci_vendor_1363, pci_dev_list_1363},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1364, pci_vendor_1364, pci_dev_list_1364},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1365, pci_vendor_1365, pci_dev_list_1365},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1366, pci_vendor_1366, pci_dev_list_1366},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1367, pci_vendor_1367, pci_dev_list_1367},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1368, pci_vendor_1368, pci_dev_list_1368},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1369, pci_vendor_1369, pci_dev_list_1369},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136a, pci_vendor_136a, pci_dev_list_136a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136b, pci_vendor_136b, pci_dev_list_136b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136c, pci_vendor_136c, pci_dev_list_136c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136d, pci_vendor_136d, pci_dev_list_136d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136f, pci_vendor_136f, pci_dev_list_136f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1370, pci_vendor_1370, pci_dev_list_1370},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1371, pci_vendor_1371, pci_dev_list_1371},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1373, pci_vendor_1373, pci_dev_list_1373},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1374, pci_vendor_1374, pci_dev_list_1374},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1375, pci_vendor_1375, pci_dev_list_1375},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1376, pci_vendor_1376, pci_dev_list_1376},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1377, pci_vendor_1377, pci_dev_list_1377},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1378, pci_vendor_1378, pci_dev_list_1378},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1379, pci_vendor_1379, pci_dev_list_1379},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137a, pci_vendor_137a, pci_dev_list_137a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137b, pci_vendor_137b, pci_dev_list_137b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137c, pci_vendor_137c, pci_dev_list_137c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137d, pci_vendor_137d, pci_dev_list_137d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137e, pci_vendor_137e, pci_dev_list_137e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137f, pci_vendor_137f, pci_dev_list_137f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1380, pci_vendor_1380, pci_dev_list_1380},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1381, pci_vendor_1381, pci_dev_list_1381},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1382, pci_vendor_1382, pci_dev_list_1382},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1383, pci_vendor_1383, pci_dev_list_1383},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1384, pci_vendor_1384, pci_dev_list_1384},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1385, pci_vendor_1385, pci_dev_list_1385},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1386, pci_vendor_1386, pci_dev_list_1386},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1387, pci_vendor_1387, pci_dev_list_1387},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1388, pci_vendor_1388, pci_dev_list_1388},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1389, pci_vendor_1389, pci_dev_list_1389},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138a, pci_vendor_138a, pci_dev_list_138a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138b, pci_vendor_138b, pci_dev_list_138b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138c, pci_vendor_138c, pci_dev_list_138c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138d, pci_vendor_138d, pci_dev_list_138d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138e, pci_vendor_138e, pci_dev_list_138e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138f, pci_vendor_138f, pci_dev_list_138f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1390, pci_vendor_1390, pci_dev_list_1390},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1391, pci_vendor_1391, pci_dev_list_1391},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1392, pci_vendor_1392, pci_dev_list_1392},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1393, pci_vendor_1393, pci_dev_list_1393},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1394, pci_vendor_1394, pci_dev_list_1394},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1395, pci_vendor_1395, pci_dev_list_1395},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1396, pci_vendor_1396, pci_dev_list_1396},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1397, pci_vendor_1397, pci_dev_list_1397},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1398, pci_vendor_1398, pci_dev_list_1398},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1399, pci_vendor_1399, pci_dev_list_1399},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139a, pci_vendor_139a, pci_dev_list_139a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139b, pci_vendor_139b, pci_dev_list_139b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139c, pci_vendor_139c, pci_dev_list_139c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139d, pci_vendor_139d, pci_dev_list_139d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139e, pci_vendor_139e, pci_dev_list_139e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139f, pci_vendor_139f, pci_dev_list_139f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a0, pci_vendor_13a0, pci_dev_list_13a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a1, pci_vendor_13a1, pci_dev_list_13a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a2, pci_vendor_13a2, pci_dev_list_13a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a3, pci_vendor_13a3, pci_dev_list_13a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a4, pci_vendor_13a4, pci_dev_list_13a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a5, pci_vendor_13a5, pci_dev_list_13a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a6, pci_vendor_13a6, pci_dev_list_13a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a7, pci_vendor_13a7, pci_dev_list_13a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a8, pci_vendor_13a8, pci_dev_list_13a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a9, pci_vendor_13a9, pci_dev_list_13a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13aa, pci_vendor_13aa, pci_dev_list_13aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ab, pci_vendor_13ab, pci_dev_list_13ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ac, pci_vendor_13ac, pci_dev_list_13ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ad, pci_vendor_13ad, pci_dev_list_13ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ae, pci_vendor_13ae, pci_dev_list_13ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13af, pci_vendor_13af, pci_dev_list_13af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b0, pci_vendor_13b0, pci_dev_list_13b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b1, pci_vendor_13b1, pci_dev_list_13b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b2, pci_vendor_13b2, pci_dev_list_13b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b3, pci_vendor_13b3, pci_dev_list_13b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b4, pci_vendor_13b4, pci_dev_list_13b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b5, pci_vendor_13b5, pci_dev_list_13b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b6, pci_vendor_13b6, pci_dev_list_13b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b7, pci_vendor_13b7, pci_dev_list_13b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b8, pci_vendor_13b8, pci_dev_list_13b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b9, pci_vendor_13b9, pci_dev_list_13b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ba, pci_vendor_13ba, pci_dev_list_13ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13bb, pci_vendor_13bb, pci_dev_list_13bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13bc, pci_vendor_13bc, pci_dev_list_13bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13bd, pci_vendor_13bd, pci_dev_list_13bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13be, pci_vendor_13be, pci_dev_list_13be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13bf, pci_vendor_13bf, pci_dev_list_13bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c0, pci_vendor_13c0, pci_dev_list_13c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c1, pci_vendor_13c1, pci_dev_list_13c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c2, pci_vendor_13c2, pci_dev_list_13c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c3, pci_vendor_13c3, pci_dev_list_13c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c4, pci_vendor_13c4, pci_dev_list_13c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c5, pci_vendor_13c5, pci_dev_list_13c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c6, pci_vendor_13c6, pci_dev_list_13c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c7, pci_vendor_13c7, pci_dev_list_13c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c8, pci_vendor_13c8, pci_dev_list_13c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c9, pci_vendor_13c9, pci_dev_list_13c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ca, pci_vendor_13ca, pci_dev_list_13ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13cb, pci_vendor_13cb, pci_dev_list_13cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13cc, pci_vendor_13cc, pci_dev_list_13cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13cd, pci_vendor_13cd, pci_dev_list_13cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ce, pci_vendor_13ce, pci_dev_list_13ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13cf, pci_vendor_13cf, pci_dev_list_13cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d0, pci_vendor_13d0, pci_dev_list_13d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d1, pci_vendor_13d1, pci_dev_list_13d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d2, pci_vendor_13d2, pci_dev_list_13d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d3, pci_vendor_13d3, pci_dev_list_13d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d4, pci_vendor_13d4, pci_dev_list_13d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d5, pci_vendor_13d5, pci_dev_list_13d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d6, pci_vendor_13d6, pci_dev_list_13d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d7, pci_vendor_13d7, pci_dev_list_13d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d8, pci_vendor_13d8, pci_dev_list_13d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d9, pci_vendor_13d9, pci_dev_list_13d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13da, pci_vendor_13da, pci_dev_list_13da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13db, pci_vendor_13db, pci_dev_list_13db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13dc, pci_vendor_13dc, pci_dev_list_13dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13dd, pci_vendor_13dd, pci_dev_list_13dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13de, pci_vendor_13de, pci_dev_list_13de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13df, pci_vendor_13df, pci_dev_list_13df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e0, pci_vendor_13e0, pci_dev_list_13e0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e1, pci_vendor_13e1, pci_dev_list_13e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e2, pci_vendor_13e2, pci_dev_list_13e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e3, pci_vendor_13e3, pci_dev_list_13e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e4, pci_vendor_13e4, pci_dev_list_13e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e5, pci_vendor_13e5, pci_dev_list_13e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e6, pci_vendor_13e6, pci_dev_list_13e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e7, pci_vendor_13e7, pci_dev_list_13e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e8, pci_vendor_13e8, pci_dev_list_13e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e9, pci_vendor_13e9, pci_dev_list_13e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ea, pci_vendor_13ea, pci_dev_list_13ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13eb, pci_vendor_13eb, pci_dev_list_13eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ec, pci_vendor_13ec, pci_dev_list_13ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ed, pci_vendor_13ed, pci_dev_list_13ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ee, pci_vendor_13ee, pci_dev_list_13ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ef, pci_vendor_13ef, pci_dev_list_13ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f0, pci_vendor_13f0, pci_dev_list_13f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f1, pci_vendor_13f1, pci_dev_list_13f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f2, pci_vendor_13f2, pci_dev_list_13f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f3, pci_vendor_13f3, pci_dev_list_13f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f4, pci_vendor_13f4, pci_dev_list_13f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f5, pci_vendor_13f5, pci_dev_list_13f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f6, pci_vendor_13f6, pci_dev_list_13f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f7, pci_vendor_13f7, pci_dev_list_13f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f8, pci_vendor_13f8, pci_dev_list_13f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f9, pci_vendor_13f9, pci_dev_list_13f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fa, pci_vendor_13fa, pci_dev_list_13fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fb, pci_vendor_13fb, pci_dev_list_13fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fc, pci_vendor_13fc, pci_dev_list_13fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fd, pci_vendor_13fd, pci_dev_list_13fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fe, pci_vendor_13fe, pci_dev_list_13fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ff, pci_vendor_13ff, pci_dev_list_13ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1400, pci_vendor_1400, pci_dev_list_1400},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1401, pci_vendor_1401, pci_dev_list_1401},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1402, pci_vendor_1402, pci_dev_list_1402},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1403, pci_vendor_1403, pci_dev_list_1403},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1404, pci_vendor_1404, pci_dev_list_1404},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1405, pci_vendor_1405, pci_dev_list_1405},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1406, pci_vendor_1406, pci_dev_list_1406},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1407, pci_vendor_1407, pci_dev_list_1407},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1408, pci_vendor_1408, pci_dev_list_1408},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1409, pci_vendor_1409, pci_dev_list_1409},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140a, pci_vendor_140a, pci_dev_list_140a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140b, pci_vendor_140b, pci_dev_list_140b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140c, pci_vendor_140c, pci_dev_list_140c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140d, pci_vendor_140d, pci_dev_list_140d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140e, pci_vendor_140e, pci_dev_list_140e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140f, pci_vendor_140f, pci_dev_list_140f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1410, pci_vendor_1410, pci_dev_list_1410},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1411, pci_vendor_1411, pci_dev_list_1411},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1412, pci_vendor_1412, pci_dev_list_1412},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1413, pci_vendor_1413, pci_dev_list_1413},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1414, pci_vendor_1414, pci_dev_list_1414},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1415, pci_vendor_1415, pci_dev_list_1415},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1416, pci_vendor_1416, pci_dev_list_1416},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1417, pci_vendor_1417, pci_dev_list_1417},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1418, pci_vendor_1418, pci_dev_list_1418},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1419, pci_vendor_1419, pci_dev_list_1419},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141a, pci_vendor_141a, pci_dev_list_141a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141b, pci_vendor_141b, pci_dev_list_141b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141d, pci_vendor_141d, pci_dev_list_141d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141e, pci_vendor_141e, pci_dev_list_141e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141f, pci_vendor_141f, pci_dev_list_141f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1420, pci_vendor_1420, pci_dev_list_1420},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1421, pci_vendor_1421, pci_dev_list_1421},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1422, pci_vendor_1422, pci_dev_list_1422},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1423, pci_vendor_1423, pci_dev_list_1423},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1424, pci_vendor_1424, pci_dev_list_1424},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1425, pci_vendor_1425, pci_dev_list_1425},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1426, pci_vendor_1426, pci_dev_list_1426},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1427, pci_vendor_1427, pci_dev_list_1427},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1428, pci_vendor_1428, pci_dev_list_1428},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1429, pci_vendor_1429, pci_dev_list_1429},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142a, pci_vendor_142a, pci_dev_list_142a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142b, pci_vendor_142b, pci_dev_list_142b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142c, pci_vendor_142c, pci_dev_list_142c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142d, pci_vendor_142d, pci_dev_list_142d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142e, pci_vendor_142e, pci_dev_list_142e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142f, pci_vendor_142f, pci_dev_list_142f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1430, pci_vendor_1430, pci_dev_list_1430},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1431, pci_vendor_1431, pci_dev_list_1431},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1432, pci_vendor_1432, pci_dev_list_1432},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1433, pci_vendor_1433, pci_dev_list_1433},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1435, pci_vendor_1435, pci_dev_list_1435},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1436, pci_vendor_1436, pci_dev_list_1436},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1437, pci_vendor_1437, pci_dev_list_1437},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1438, pci_vendor_1438, pci_dev_list_1438},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1439, pci_vendor_1439, pci_dev_list_1439},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143a, pci_vendor_143a, pci_dev_list_143a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143b, pci_vendor_143b, pci_dev_list_143b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143c, pci_vendor_143c, pci_dev_list_143c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143d, pci_vendor_143d, pci_dev_list_143d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143e, pci_vendor_143e, pci_dev_list_143e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143f, pci_vendor_143f, pci_dev_list_143f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1440, pci_vendor_1440, pci_dev_list_1440},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1441, pci_vendor_1441, pci_dev_list_1441},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1442, pci_vendor_1442, pci_dev_list_1442},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1443, pci_vendor_1443, pci_dev_list_1443},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1444, pci_vendor_1444, pci_dev_list_1444},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1445, pci_vendor_1445, pci_dev_list_1445},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1446, pci_vendor_1446, pci_dev_list_1446},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1447, pci_vendor_1447, pci_dev_list_1447},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1448, pci_vendor_1448, pci_dev_list_1448},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1449, pci_vendor_1449, pci_dev_list_1449},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144a, pci_vendor_144a, pci_dev_list_144a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144b, pci_vendor_144b, pci_dev_list_144b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144c, pci_vendor_144c, pci_dev_list_144c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144d, pci_vendor_144d, pci_dev_list_144d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144e, pci_vendor_144e, pci_dev_list_144e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144f, pci_vendor_144f, pci_dev_list_144f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1450, pci_vendor_1450, pci_dev_list_1450},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1451, pci_vendor_1451, pci_dev_list_1451},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1453, pci_vendor_1453, pci_dev_list_1453},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1454, pci_vendor_1454, pci_dev_list_1454},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1455, pci_vendor_1455, pci_dev_list_1455},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1456, pci_vendor_1456, pci_dev_list_1456},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1457, pci_vendor_1457, pci_dev_list_1457},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1458, pci_vendor_1458, pci_dev_list_1458},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1459, pci_vendor_1459, pci_dev_list_1459},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145a, pci_vendor_145a, pci_dev_list_145a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145b, pci_vendor_145b, pci_dev_list_145b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145c, pci_vendor_145c, pci_dev_list_145c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145d, pci_vendor_145d, pci_dev_list_145d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145e, pci_vendor_145e, pci_dev_list_145e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145f, pci_vendor_145f, pci_dev_list_145f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1460, pci_vendor_1460, pci_dev_list_1460},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1461, pci_vendor_1461, pci_dev_list_1461},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1462, pci_vendor_1462, pci_dev_list_1462},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1463, pci_vendor_1463, pci_dev_list_1463},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1464, pci_vendor_1464, pci_dev_list_1464},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1465, pci_vendor_1465, pci_dev_list_1465},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1466, pci_vendor_1466, pci_dev_list_1466},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1467, pci_vendor_1467, pci_dev_list_1467},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1468, pci_vendor_1468, pci_dev_list_1468},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1469, pci_vendor_1469, pci_dev_list_1469},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146a, pci_vendor_146a, pci_dev_list_146a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146b, pci_vendor_146b, pci_dev_list_146b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146c, pci_vendor_146c, pci_dev_list_146c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146d, pci_vendor_146d, pci_dev_list_146d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146e, pci_vendor_146e, pci_dev_list_146e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146f, pci_vendor_146f, pci_dev_list_146f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1470, pci_vendor_1470, pci_dev_list_1470},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1471, pci_vendor_1471, pci_dev_list_1471},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1472, pci_vendor_1472, pci_dev_list_1472},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1473, pci_vendor_1473, pci_dev_list_1473},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1474, pci_vendor_1474, pci_dev_list_1474},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1475, pci_vendor_1475, pci_dev_list_1475},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1476, pci_vendor_1476, pci_dev_list_1476},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1477, pci_vendor_1477, pci_dev_list_1477},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1478, pci_vendor_1478, pci_dev_list_1478},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1479, pci_vendor_1479, pci_dev_list_1479},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147a, pci_vendor_147a, pci_dev_list_147a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147b, pci_vendor_147b, pci_dev_list_147b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147c, pci_vendor_147c, pci_dev_list_147c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147d, pci_vendor_147d, pci_dev_list_147d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147e, pci_vendor_147e, pci_dev_list_147e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147f, pci_vendor_147f, pci_dev_list_147f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1480, pci_vendor_1480, pci_dev_list_1480},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1481, pci_vendor_1481, pci_dev_list_1481},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1482, pci_vendor_1482, pci_dev_list_1482},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1483, pci_vendor_1483, pci_dev_list_1483},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1484, pci_vendor_1484, pci_dev_list_1484},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1485, pci_vendor_1485, pci_dev_list_1485},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1486, pci_vendor_1486, pci_dev_list_1486},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1487, pci_vendor_1487, pci_dev_list_1487},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1488, pci_vendor_1488, pci_dev_list_1488},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1489, pci_vendor_1489, pci_dev_list_1489},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148a, pci_vendor_148a, pci_dev_list_148a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148b, pci_vendor_148b, pci_dev_list_148b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148c, pci_vendor_148c, pci_dev_list_148c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148d, pci_vendor_148d, pci_dev_list_148d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148e, pci_vendor_148e, pci_dev_list_148e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148f, pci_vendor_148f, pci_dev_list_148f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1490, pci_vendor_1490, pci_dev_list_1490},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1491, pci_vendor_1491, pci_dev_list_1491},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1492, pci_vendor_1492, pci_dev_list_1492},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1493, pci_vendor_1493, pci_dev_list_1493},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1494, pci_vendor_1494, pci_dev_list_1494},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1495, pci_vendor_1495, pci_dev_list_1495},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1496, pci_vendor_1496, pci_dev_list_1496},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1497, pci_vendor_1497, pci_dev_list_1497},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1498, pci_vendor_1498, pci_dev_list_1498},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1499, pci_vendor_1499, pci_dev_list_1499},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149a, pci_vendor_149a, pci_dev_list_149a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149b, pci_vendor_149b, pci_dev_list_149b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149c, pci_vendor_149c, pci_dev_list_149c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149d, pci_vendor_149d, pci_dev_list_149d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149e, pci_vendor_149e, pci_dev_list_149e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149f, pci_vendor_149f, pci_dev_list_149f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a0, pci_vendor_14a0, pci_dev_list_14a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a1, pci_vendor_14a1, pci_dev_list_14a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a2, pci_vendor_14a2, pci_dev_list_14a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a3, pci_vendor_14a3, pci_dev_list_14a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a4, pci_vendor_14a4, pci_dev_list_14a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a5, pci_vendor_14a5, pci_dev_list_14a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a6, pci_vendor_14a6, pci_dev_list_14a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a7, pci_vendor_14a7, pci_dev_list_14a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a8, pci_vendor_14a8, pci_dev_list_14a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a9, pci_vendor_14a9, pci_dev_list_14a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14aa, pci_vendor_14aa, pci_dev_list_14aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ab, pci_vendor_14ab, pci_dev_list_14ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ac, pci_vendor_14ac, pci_dev_list_14ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ad, pci_vendor_14ad, pci_dev_list_14ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ae, pci_vendor_14ae, pci_dev_list_14ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14af, pci_vendor_14af, pci_dev_list_14af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b0, pci_vendor_14b0, pci_dev_list_14b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b1, pci_vendor_14b1, pci_dev_list_14b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b2, pci_vendor_14b2, pci_dev_list_14b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b3, pci_vendor_14b3, pci_dev_list_14b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b4, pci_vendor_14b4, pci_dev_list_14b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b5, pci_vendor_14b5, pci_dev_list_14b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b6, pci_vendor_14b6, pci_dev_list_14b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b7, pci_vendor_14b7, pci_dev_list_14b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b8, pci_vendor_14b8, pci_dev_list_14b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b9, pci_vendor_14b9, pci_dev_list_14b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ba, pci_vendor_14ba, pci_dev_list_14ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14bb, pci_vendor_14bb, pci_dev_list_14bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14bc, pci_vendor_14bc, pci_dev_list_14bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14bd, pci_vendor_14bd, pci_dev_list_14bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14be, pci_vendor_14be, pci_dev_list_14be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14bf, pci_vendor_14bf, pci_dev_list_14bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c0, pci_vendor_14c0, pci_dev_list_14c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c1, pci_vendor_14c1, pci_dev_list_14c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c2, pci_vendor_14c2, pci_dev_list_14c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c3, pci_vendor_14c3, pci_dev_list_14c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c4, pci_vendor_14c4, pci_dev_list_14c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c5, pci_vendor_14c5, pci_dev_list_14c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c6, pci_vendor_14c6, pci_dev_list_14c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c7, pci_vendor_14c7, pci_dev_list_14c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c8, pci_vendor_14c8, pci_dev_list_14c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c9, pci_vendor_14c9, pci_dev_list_14c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ca, pci_vendor_14ca, pci_dev_list_14ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14cb, pci_vendor_14cb, pci_dev_list_14cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14cc, pci_vendor_14cc, pci_dev_list_14cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14cd, pci_vendor_14cd, pci_dev_list_14cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ce, pci_vendor_14ce, pci_dev_list_14ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14cf, pci_vendor_14cf, pci_dev_list_14cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d0, pci_vendor_14d0, pci_dev_list_14d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d1, pci_vendor_14d1, pci_dev_list_14d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d2, pci_vendor_14d2, pci_dev_list_14d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d3, pci_vendor_14d3, pci_dev_list_14d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d4, pci_vendor_14d4, pci_dev_list_14d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d5, pci_vendor_14d5, pci_dev_list_14d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d6, pci_vendor_14d6, pci_dev_list_14d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d7, pci_vendor_14d7, pci_dev_list_14d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d8, pci_vendor_14d8, pci_dev_list_14d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d9, pci_vendor_14d9, pci_dev_list_14d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14da, pci_vendor_14da, pci_dev_list_14da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14db, pci_vendor_14db, pci_dev_list_14db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14dc, pci_vendor_14dc, pci_dev_list_14dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14dd, pci_vendor_14dd, pci_dev_list_14dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14de, pci_vendor_14de, pci_dev_list_14de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14df, pci_vendor_14df, pci_dev_list_14df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e1, pci_vendor_14e1, pci_dev_list_14e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e2, pci_vendor_14e2, pci_dev_list_14e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e3, pci_vendor_14e3, pci_dev_list_14e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e4, pci_vendor_14e4, pci_dev_list_14e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e5, pci_vendor_14e5, pci_dev_list_14e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e6, pci_vendor_14e6, pci_dev_list_14e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e7, pci_vendor_14e7, pci_dev_list_14e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e8, pci_vendor_14e8, pci_dev_list_14e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e9, pci_vendor_14e9, pci_dev_list_14e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ea, pci_vendor_14ea, pci_dev_list_14ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14eb, pci_vendor_14eb, pci_dev_list_14eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ec, pci_vendor_14ec, pci_dev_list_14ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ed, pci_vendor_14ed, pci_dev_list_14ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ee, pci_vendor_14ee, pci_dev_list_14ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ef, pci_vendor_14ef, pci_dev_list_14ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f0, pci_vendor_14f0, pci_dev_list_14f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f1, pci_vendor_14f1, pci_dev_list_14f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f2, pci_vendor_14f2, pci_dev_list_14f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f3, pci_vendor_14f3, pci_dev_list_14f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f4, pci_vendor_14f4, pci_dev_list_14f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f5, pci_vendor_14f5, pci_dev_list_14f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f6, pci_vendor_14f6, pci_dev_list_14f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f7, pci_vendor_14f7, pci_dev_list_14f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f8, pci_vendor_14f8, pci_dev_list_14f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f9, pci_vendor_14f9, pci_dev_list_14f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fa, pci_vendor_14fa, pci_dev_list_14fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fb, pci_vendor_14fb, pci_dev_list_14fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fc, pci_vendor_14fc, pci_dev_list_14fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fd, pci_vendor_14fd, pci_dev_list_14fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fe, pci_vendor_14fe, pci_dev_list_14fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ff, pci_vendor_14ff, pci_dev_list_14ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1500, pci_vendor_1500, pci_dev_list_1500},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1501, pci_vendor_1501, pci_dev_list_1501},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1502, pci_vendor_1502, pci_dev_list_1502},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1503, pci_vendor_1503, pci_dev_list_1503},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1504, pci_vendor_1504, pci_dev_list_1504},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1505, pci_vendor_1505, pci_dev_list_1505},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1506, pci_vendor_1506, pci_dev_list_1506},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1507, pci_vendor_1507, pci_dev_list_1507},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1508, pci_vendor_1508, pci_dev_list_1508},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1509, pci_vendor_1509, pci_dev_list_1509},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150a, pci_vendor_150a, pci_dev_list_150a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150b, pci_vendor_150b, pci_dev_list_150b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150c, pci_vendor_150c, pci_dev_list_150c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150d, pci_vendor_150d, pci_dev_list_150d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150e, pci_vendor_150e, pci_dev_list_150e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150f, pci_vendor_150f, pci_dev_list_150f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1510, pci_vendor_1510, pci_dev_list_1510},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1511, pci_vendor_1511, pci_dev_list_1511},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1512, pci_vendor_1512, pci_dev_list_1512},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1513, pci_vendor_1513, pci_dev_list_1513},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1514, pci_vendor_1514, pci_dev_list_1514},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1515, pci_vendor_1515, pci_dev_list_1515},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1516, pci_vendor_1516, pci_dev_list_1516},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1517, pci_vendor_1517, pci_dev_list_1517},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1518, pci_vendor_1518, pci_dev_list_1518},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1519, pci_vendor_1519, pci_dev_list_1519},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151a, pci_vendor_151a, pci_dev_list_151a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151b, pci_vendor_151b, pci_dev_list_151b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151c, pci_vendor_151c, pci_dev_list_151c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151d, pci_vendor_151d, pci_dev_list_151d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151e, pci_vendor_151e, pci_dev_list_151e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151f, pci_vendor_151f, pci_dev_list_151f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1520, pci_vendor_1520, pci_dev_list_1520},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1521, pci_vendor_1521, pci_dev_list_1521},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1522, pci_vendor_1522, pci_dev_list_1522},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1523, pci_vendor_1523, pci_dev_list_1523},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1524, pci_vendor_1524, pci_dev_list_1524},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1525, pci_vendor_1525, pci_dev_list_1525},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1526, pci_vendor_1526, pci_dev_list_1526},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1527, pci_vendor_1527, pci_dev_list_1527},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1528, pci_vendor_1528, pci_dev_list_1528},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1529, pci_vendor_1529, pci_dev_list_1529},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152a, pci_vendor_152a, pci_dev_list_152a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152b, pci_vendor_152b, pci_dev_list_152b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152c, pci_vendor_152c, pci_dev_list_152c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152d, pci_vendor_152d, pci_dev_list_152d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152e, pci_vendor_152e, pci_dev_list_152e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152f, pci_vendor_152f, pci_dev_list_152f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1530, pci_vendor_1530, pci_dev_list_1530},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1531, pci_vendor_1531, pci_dev_list_1531},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1532, pci_vendor_1532, pci_dev_list_1532},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1533, pci_vendor_1533, pci_dev_list_1533},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1534, pci_vendor_1534, pci_dev_list_1534},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1535, pci_vendor_1535, pci_dev_list_1535},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1537, pci_vendor_1537, pci_dev_list_1537},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1538, pci_vendor_1538, pci_dev_list_1538},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1539, pci_vendor_1539, pci_dev_list_1539},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153a, pci_vendor_153a, pci_dev_list_153a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153b, pci_vendor_153b, pci_dev_list_153b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153c, pci_vendor_153c, pci_dev_list_153c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153d, pci_vendor_153d, pci_dev_list_153d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153e, pci_vendor_153e, pci_dev_list_153e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153f, pci_vendor_153f, pci_dev_list_153f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1540, pci_vendor_1540, pci_dev_list_1540},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1541, pci_vendor_1541, pci_dev_list_1541},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1542, pci_vendor_1542, pci_dev_list_1542},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1543, pci_vendor_1543, pci_dev_list_1543},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1544, pci_vendor_1544, pci_dev_list_1544},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1545, pci_vendor_1545, pci_dev_list_1545},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1546, pci_vendor_1546, pci_dev_list_1546},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1547, pci_vendor_1547, pci_dev_list_1547},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1548, pci_vendor_1548, pci_dev_list_1548},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1549, pci_vendor_1549, pci_dev_list_1549},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154a, pci_vendor_154a, pci_dev_list_154a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154b, pci_vendor_154b, pci_dev_list_154b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154c, pci_vendor_154c, pci_dev_list_154c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154d, pci_vendor_154d, pci_dev_list_154d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154e, pci_vendor_154e, pci_dev_list_154e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154f, pci_vendor_154f, pci_dev_list_154f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1550, pci_vendor_1550, pci_dev_list_1550},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1551, pci_vendor_1551, pci_dev_list_1551},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1552, pci_vendor_1552, pci_dev_list_1552},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1553, pci_vendor_1553, pci_dev_list_1553},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1554, pci_vendor_1554, pci_dev_list_1554},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1555, pci_vendor_1555, pci_dev_list_1555},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1556, pci_vendor_1556, pci_dev_list_1556},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1557, pci_vendor_1557, pci_dev_list_1557},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1558, pci_vendor_1558, pci_dev_list_1558},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1559, pci_vendor_1559, pci_dev_list_1559},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155a, pci_vendor_155a, pci_dev_list_155a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155b, pci_vendor_155b, pci_dev_list_155b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155c, pci_vendor_155c, pci_dev_list_155c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155d, pci_vendor_155d, pci_dev_list_155d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155e, pci_vendor_155e, pci_dev_list_155e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155f, pci_vendor_155f, pci_dev_list_155f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1560, pci_vendor_1560, pci_dev_list_1560},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1561, pci_vendor_1561, pci_dev_list_1561},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1562, pci_vendor_1562, pci_dev_list_1562},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1563, pci_vendor_1563, pci_dev_list_1563},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1564, pci_vendor_1564, pci_dev_list_1564},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1565, pci_vendor_1565, pci_dev_list_1565},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1566, pci_vendor_1566, pci_dev_list_1566},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1567, pci_vendor_1567, pci_dev_list_1567},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1568, pci_vendor_1568, pci_dev_list_1568},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1569, pci_vendor_1569, pci_dev_list_1569},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156a, pci_vendor_156a, pci_dev_list_156a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156b, pci_vendor_156b, pci_dev_list_156b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156c, pci_vendor_156c, pci_dev_list_156c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156d, pci_vendor_156d, pci_dev_list_156d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156e, pci_vendor_156e, pci_dev_list_156e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156f, pci_vendor_156f, pci_dev_list_156f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1570, pci_vendor_1570, pci_dev_list_1570},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1571, pci_vendor_1571, pci_dev_list_1571},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1572, pci_vendor_1572, pci_dev_list_1572},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1573, pci_vendor_1573, pci_dev_list_1573},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1574, pci_vendor_1574, pci_dev_list_1574},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1575, pci_vendor_1575, pci_dev_list_1575},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1576, pci_vendor_1576, pci_dev_list_1576},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1578, pci_vendor_1578, pci_dev_list_1578},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1579, pci_vendor_1579, pci_dev_list_1579},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157a, pci_vendor_157a, pci_dev_list_157a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157b, pci_vendor_157b, pci_dev_list_157b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157c, pci_vendor_157c, pci_dev_list_157c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157d, pci_vendor_157d, pci_dev_list_157d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157e, pci_vendor_157e, pci_dev_list_157e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157f, pci_vendor_157f, pci_dev_list_157f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1580, pci_vendor_1580, pci_dev_list_1580},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1581, pci_vendor_1581, pci_dev_list_1581},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1582, pci_vendor_1582, pci_dev_list_1582},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1583, pci_vendor_1583, pci_dev_list_1583},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1584, pci_vendor_1584, pci_dev_list_1584},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1585, pci_vendor_1585, pci_dev_list_1585},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1586, pci_vendor_1586, pci_dev_list_1586},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1587, pci_vendor_1587, pci_dev_list_1587},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1588, pci_vendor_1588, pci_dev_list_1588},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1589, pci_vendor_1589, pci_dev_list_1589},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158a, pci_vendor_158a, pci_dev_list_158a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158b, pci_vendor_158b, pci_dev_list_158b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158c, pci_vendor_158c, pci_dev_list_158c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158d, pci_vendor_158d, pci_dev_list_158d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158e, pci_vendor_158e, pci_dev_list_158e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158f, pci_vendor_158f, pci_dev_list_158f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1590, pci_vendor_1590, pci_dev_list_1590},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1591, pci_vendor_1591, pci_dev_list_1591},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1592, pci_vendor_1592, pci_dev_list_1592},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1593, pci_vendor_1593, pci_dev_list_1593},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1594, pci_vendor_1594, pci_dev_list_1594},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1595, pci_vendor_1595, pci_dev_list_1595},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1596, pci_vendor_1596, pci_dev_list_1596},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1597, pci_vendor_1597, pci_dev_list_1597},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1598, pci_vendor_1598, pci_dev_list_1598},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1599, pci_vendor_1599, pci_dev_list_1599},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159a, pci_vendor_159a, pci_dev_list_159a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159b, pci_vendor_159b, pci_dev_list_159b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159c, pci_vendor_159c, pci_dev_list_159c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159d, pci_vendor_159d, pci_dev_list_159d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159e, pci_vendor_159e, pci_dev_list_159e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159f, pci_vendor_159f, pci_dev_list_159f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a0, pci_vendor_15a0, pci_dev_list_15a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a1, pci_vendor_15a1, pci_dev_list_15a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a2, pci_vendor_15a2, pci_dev_list_15a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a3, pci_vendor_15a3, pci_dev_list_15a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a4, pci_vendor_15a4, pci_dev_list_15a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a5, pci_vendor_15a5, pci_dev_list_15a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a6, pci_vendor_15a6, pci_dev_list_15a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a7, pci_vendor_15a7, pci_dev_list_15a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a8, pci_vendor_15a8, pci_dev_list_15a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15aa, pci_vendor_15aa, pci_dev_list_15aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ab, pci_vendor_15ab, pci_dev_list_15ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ac, pci_vendor_15ac, pci_dev_list_15ac},
+#endif
+ {0x15ad, pci_vendor_15ad, pci_dev_list_15ad},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ae, pci_vendor_15ae, pci_dev_list_15ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b0, pci_vendor_15b0, pci_dev_list_15b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b1, pci_vendor_15b1, pci_dev_list_15b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b2, pci_vendor_15b2, pci_dev_list_15b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b3, pci_vendor_15b3, pci_dev_list_15b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b4, pci_vendor_15b4, pci_dev_list_15b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b5, pci_vendor_15b5, pci_dev_list_15b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b6, pci_vendor_15b6, pci_dev_list_15b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b7, pci_vendor_15b7, pci_dev_list_15b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b8, pci_vendor_15b8, pci_dev_list_15b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b9, pci_vendor_15b9, pci_dev_list_15b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ba, pci_vendor_15ba, pci_dev_list_15ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15bb, pci_vendor_15bb, pci_dev_list_15bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15bc, pci_vendor_15bc, pci_dev_list_15bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15bd, pci_vendor_15bd, pci_dev_list_15bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15be, pci_vendor_15be, pci_dev_list_15be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15bf, pci_vendor_15bf, pci_dev_list_15bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c0, pci_vendor_15c0, pci_dev_list_15c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c1, pci_vendor_15c1, pci_dev_list_15c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c2, pci_vendor_15c2, pci_dev_list_15c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c3, pci_vendor_15c3, pci_dev_list_15c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c4, pci_vendor_15c4, pci_dev_list_15c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c5, pci_vendor_15c5, pci_dev_list_15c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c6, pci_vendor_15c6, pci_dev_list_15c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c7, pci_vendor_15c7, pci_dev_list_15c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c8, pci_vendor_15c8, pci_dev_list_15c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c9, pci_vendor_15c9, pci_dev_list_15c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ca, pci_vendor_15ca, pci_dev_list_15ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15cb, pci_vendor_15cb, pci_dev_list_15cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15cc, pci_vendor_15cc, pci_dev_list_15cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15cd, pci_vendor_15cd, pci_dev_list_15cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ce, pci_vendor_15ce, pci_dev_list_15ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15cf, pci_vendor_15cf, pci_dev_list_15cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d1, pci_vendor_15d1, pci_dev_list_15d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d2, pci_vendor_15d2, pci_dev_list_15d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d3, pci_vendor_15d3, pci_dev_list_15d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d4, pci_vendor_15d4, pci_dev_list_15d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d5, pci_vendor_15d5, pci_dev_list_15d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d6, pci_vendor_15d6, pci_dev_list_15d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d7, pci_vendor_15d7, pci_dev_list_15d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d8, pci_vendor_15d8, pci_dev_list_15d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d9, pci_vendor_15d9, pci_dev_list_15d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15da, pci_vendor_15da, pci_dev_list_15da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15db, pci_vendor_15db, pci_dev_list_15db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15dc, pci_vendor_15dc, pci_dev_list_15dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15dd, pci_vendor_15dd, pci_dev_list_15dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15de, pci_vendor_15de, pci_dev_list_15de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15df, pci_vendor_15df, pci_dev_list_15df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e0, pci_vendor_15e0, pci_dev_list_15e0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e1, pci_vendor_15e1, pci_dev_list_15e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e2, pci_vendor_15e2, pci_dev_list_15e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e3, pci_vendor_15e3, pci_dev_list_15e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e4, pci_vendor_15e4, pci_dev_list_15e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e5, pci_vendor_15e5, pci_dev_list_15e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e6, pci_vendor_15e6, pci_dev_list_15e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e7, pci_vendor_15e7, pci_dev_list_15e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e8, pci_vendor_15e8, pci_dev_list_15e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e9, pci_vendor_15e9, pci_dev_list_15e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ea, pci_vendor_15ea, pci_dev_list_15ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15eb, pci_vendor_15eb, pci_dev_list_15eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ec, pci_vendor_15ec, pci_dev_list_15ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ed, pci_vendor_15ed, pci_dev_list_15ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ee, pci_vendor_15ee, pci_dev_list_15ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ef, pci_vendor_15ef, pci_dev_list_15ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f0, pci_vendor_15f0, pci_dev_list_15f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f1, pci_vendor_15f1, pci_dev_list_15f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f2, pci_vendor_15f2, pci_dev_list_15f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f3, pci_vendor_15f3, pci_dev_list_15f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f4, pci_vendor_15f4, pci_dev_list_15f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f5, pci_vendor_15f5, pci_dev_list_15f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f6, pci_vendor_15f6, pci_dev_list_15f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f7, pci_vendor_15f7, pci_dev_list_15f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f8, pci_vendor_15f8, pci_dev_list_15f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f9, pci_vendor_15f9, pci_dev_list_15f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fa, pci_vendor_15fa, pci_dev_list_15fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fb, pci_vendor_15fb, pci_dev_list_15fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fc, pci_vendor_15fc, pci_dev_list_15fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fd, pci_vendor_15fd, pci_dev_list_15fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fe, pci_vendor_15fe, pci_dev_list_15fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ff, pci_vendor_15ff, pci_dev_list_15ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1600, pci_vendor_1600, pci_dev_list_1600},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1601, pci_vendor_1601, pci_dev_list_1601},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1602, pci_vendor_1602, pci_dev_list_1602},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1603, pci_vendor_1603, pci_dev_list_1603},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1604, pci_vendor_1604, pci_dev_list_1604},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1605, pci_vendor_1605, pci_dev_list_1605},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1606, pci_vendor_1606, pci_dev_list_1606},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1607, pci_vendor_1607, pci_dev_list_1607},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1608, pci_vendor_1608, pci_dev_list_1608},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1609, pci_vendor_1609, pci_dev_list_1609},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1612, pci_vendor_1612, pci_dev_list_1612},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1619, pci_vendor_1619, pci_dev_list_1619},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1629, pci_vendor_1629, pci_dev_list_1629},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1638, pci_vendor_1638, pci_dev_list_1638},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x163c, pci_vendor_163c, pci_dev_list_163c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1657, pci_vendor_1657, pci_dev_list_1657},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x165a, pci_vendor_165a, pci_dev_list_165a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x165d, pci_vendor_165d, pci_dev_list_165d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1661, pci_vendor_1661, pci_dev_list_1661},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1668, pci_vendor_1668, pci_dev_list_1668},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1681, pci_vendor_1681, pci_dev_list_1681},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16ab, pci_vendor_16ab, pci_dev_list_16ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16be, pci_vendor_16be, pci_dev_list_16be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16ec, pci_vendor_16ec, pci_dev_list_16ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16f6, pci_vendor_16f6, pci_dev_list_16f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1705, pci_vendor_1705, pci_dev_list_1705},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x170b, pci_vendor_170b, pci_dev_list_170b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x170c, pci_vendor_170c, pci_dev_list_170c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x172a, pci_vendor_172a, pci_dev_list_172a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1737, pci_vendor_1737, pci_dev_list_1737},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x173b, pci_vendor_173b, pci_dev_list_173b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1743, pci_vendor_1743, pci_dev_list_1743},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x174b, pci_vendor_174b, pci_dev_list_174b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x175e, pci_vendor_175e, pci_dev_list_175e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1787, pci_vendor_1787, pci_dev_list_1787},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1796, pci_vendor_1796, pci_dev_list_1796},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1799, pci_vendor_1799, pci_dev_list_1799},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x17af, pci_vendor_17af, pci_dev_list_17af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x17cc, pci_vendor_17cc, pci_dev_list_17cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1813, pci_vendor_1813, pci_dev_list_1813},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1851, pci_vendor_1851, pci_dev_list_1851},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1852, pci_vendor_1852, pci_dev_list_1852},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1888, pci_vendor_1888, pci_dev_list_1888},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1a08, pci_vendor_1a08, pci_dev_list_1a08},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1b13, pci_vendor_1b13, pci_dev_list_1b13},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1c1c, pci_vendor_1c1c, pci_dev_list_1c1c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1d44, pci_vendor_1d44, pci_dev_list_1d44},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1de1, pci_vendor_1de1, pci_dev_list_1de1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2000, pci_vendor_2000, pci_dev_list_2000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2001, pci_vendor_2001, pci_dev_list_2001},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2003, pci_vendor_2003, pci_dev_list_2003},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2004, pci_vendor_2004, pci_dev_list_2004},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x21c3, pci_vendor_21c3, pci_dev_list_21c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2348, pci_vendor_2348, pci_dev_list_2348},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2646, pci_vendor_2646, pci_dev_list_2646},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x270b, pci_vendor_270b, pci_dev_list_270b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x270f, pci_vendor_270f, pci_dev_list_270f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2711, pci_vendor_2711, pci_dev_list_2711},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2a15, pci_vendor_2a15, pci_dev_list_2a15},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3000, pci_vendor_3000, pci_dev_list_3000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3142, pci_vendor_3142, pci_dev_list_3142},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3388, pci_vendor_3388, pci_dev_list_3388},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3411, pci_vendor_3411, pci_dev_list_3411},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3513, pci_vendor_3513, pci_dev_list_3513},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x38ef, pci_vendor_38ef, pci_dev_list_38ef},
+#endif
+ {0x3d3d, pci_vendor_3d3d, pci_dev_list_3d3d},
+ {0x4005, pci_vendor_4005, pci_dev_list_4005},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4033, pci_vendor_4033, pci_dev_list_4033},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4143, pci_vendor_4143, pci_dev_list_4143},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x416c, pci_vendor_416c, pci_dev_list_416c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4444, pci_vendor_4444, pci_dev_list_4444},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4468, pci_vendor_4468, pci_dev_list_4468},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4594, pci_vendor_4594, pci_dev_list_4594},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x45fb, pci_vendor_45fb, pci_dev_list_45fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4680, pci_vendor_4680, pci_dev_list_4680},
+#endif
+ {0x4843, pci_vendor_4843, pci_dev_list_4843},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4916, pci_vendor_4916, pci_dev_list_4916},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4943, pci_vendor_4943, pci_dev_list_4943},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4978, pci_vendor_4978, pci_dev_list_4978},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4a14, pci_vendor_4a14, pci_dev_list_4a14},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4b10, pci_vendor_4b10, pci_dev_list_4b10},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4c48, pci_vendor_4c48, pci_dev_list_4c48},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4c53, pci_vendor_4c53, pci_dev_list_4c53},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4ca1, pci_vendor_4ca1, pci_dev_list_4ca1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4d51, pci_vendor_4d51, pci_dev_list_4d51},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4d54, pci_vendor_4d54, pci_dev_list_4d54},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4ddc, pci_vendor_4ddc, pci_dev_list_4ddc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5046, pci_vendor_5046, pci_dev_list_5046},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5053, pci_vendor_5053, pci_dev_list_5053},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5136, pci_vendor_5136, pci_dev_list_5136},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5143, pci_vendor_5143, pci_dev_list_5143},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5145, pci_vendor_5145, pci_dev_list_5145},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5168, pci_vendor_5168, pci_dev_list_5168},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5301, pci_vendor_5301, pci_dev_list_5301},
+#endif
+ {0x5333, pci_vendor_5333, pci_dev_list_5333},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x544c, pci_vendor_544c, pci_dev_list_544c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5455, pci_vendor_5455, pci_dev_list_5455},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5519, pci_vendor_5519, pci_dev_list_5519},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5544, pci_vendor_5544, pci_dev_list_5544},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5555, pci_vendor_5555, pci_dev_list_5555},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5654, pci_vendor_5654, pci_dev_list_5654},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5700, pci_vendor_5700, pci_dev_list_5700},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x6356, pci_vendor_6356, pci_dev_list_6356},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x6374, pci_vendor_6374, pci_dev_list_6374},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x6409, pci_vendor_6409, pci_dev_list_6409},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x6666, pci_vendor_6666, pci_dev_list_6666},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x7604, pci_vendor_7604, pci_dev_list_7604},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x7bde, pci_vendor_7bde, pci_dev_list_7bde},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x7fed, pci_vendor_7fed, pci_dev_list_7fed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8008, pci_vendor_8008, pci_dev_list_8008},
+#endif
+ {0x8086, pci_vendor_8086, pci_dev_list_8086},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8800, pci_vendor_8800, pci_dev_list_8800},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8866, pci_vendor_8866, pci_dev_list_8866},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8888, pci_vendor_8888, pci_dev_list_8888},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8e0e, pci_vendor_8e0e, pci_dev_list_8e0e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8e2e, pci_vendor_8e2e, pci_dev_list_8e2e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9004, pci_vendor_9004, pci_dev_list_9004},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9005, pci_vendor_9005, pci_dev_list_9005},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x907f, pci_vendor_907f, pci_dev_list_907f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x919a, pci_vendor_919a, pci_dev_list_919a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9412, pci_vendor_9412, pci_dev_list_9412},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9699, pci_vendor_9699, pci_dev_list_9699},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9710, pci_vendor_9710, pci_dev_list_9710},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa0a0, pci_vendor_a0a0, pci_dev_list_a0a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa0f1, pci_vendor_a0f1, pci_dev_list_a0f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa200, pci_vendor_a200, pci_dev_list_a200},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa259, pci_vendor_a259, pci_dev_list_a259},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa25b, pci_vendor_a25b, pci_dev_list_a25b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa304, pci_vendor_a304, pci_dev_list_a304},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa727, pci_vendor_a727, pci_dev_list_a727},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xaa42, pci_vendor_aa42, pci_dev_list_aa42},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xac1e, pci_vendor_ac1e, pci_dev_list_ac1e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xb1b3, pci_vendor_b1b3, pci_dev_list_b1b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xbd11, pci_vendor_bd11, pci_dev_list_bd11},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xc001, pci_vendor_c001, pci_dev_list_c001},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xc0a9, pci_vendor_c0a9, pci_dev_list_c0a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xc0de, pci_vendor_c0de, pci_dev_list_c0de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xc0fe, pci_vendor_c0fe, pci_dev_list_c0fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xca50, pci_vendor_ca50, pci_dev_list_ca50},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xcafe, pci_vendor_cafe, pci_dev_list_cafe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xcccc, pci_vendor_cccc, pci_dev_list_cccc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xcddd, pci_vendor_cddd, pci_dev_list_cddd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xd4d4, pci_vendor_d4d4, pci_dev_list_d4d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xd531, pci_vendor_d531, pci_dev_list_d531},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xd84d, pci_vendor_d84d, pci_dev_list_d84d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xdead, pci_vendor_dead, pci_dev_list_dead},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xe000, pci_vendor_e000, pci_dev_list_e000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xe159, pci_vendor_e159, pci_dev_list_e159},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xe4bf, pci_vendor_e4bf, pci_dev_list_e4bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xea01, pci_vendor_ea01, pci_dev_list_ea01},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xea60, pci_vendor_ea60, pci_dev_list_ea60},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xeabb, pci_vendor_eabb, pci_dev_list_eabb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xeace, pci_vendor_eace, pci_dev_list_eace},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xec80, pci_vendor_ec80, pci_dev_list_ec80},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xecc0, pci_vendor_ecc0, pci_dev_list_ecc0},
+#endif
+ {0xedd8, pci_vendor_edd8, pci_dev_list_edd8},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xf1d0, pci_vendor_f1d0, pci_dev_list_f1d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xfa57, pci_vendor_fa57, pci_dev_list_fa57},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xfebd, pci_vendor_febd, pci_dev_list_febd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xfeda, pci_vendor_feda, pci_dev_list_feda},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xfffe, pci_vendor_fffe, pci_dev_list_fffe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xffff, pci_vendor_ffff, pci_dev_list_ffff},
+#endif
+ {0x0000, NULL, NULL}
+};
+
+#if defined(INIT_VENDOR_SUBSYS_INFO) && defined(INIT_SUBSYS_INFO)
+static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = {
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0000, pci_vendor_0000, pci_ss_list_0000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x001a, pci_vendor_001a, pci_ss_list_001a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0033, pci_vendor_0033, pci_ss_list_0033},
+#endif
+ {0x003d, pci_vendor_003d, pci_ss_list_003d},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0059, pci_vendor_0059, pci_ss_list_0059},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0070, pci_vendor_0070, pci_ss_list_0070},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0100, pci_vendor_0100, pci_ss_list_0100},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0675, pci_vendor_0675, pci_ss_list_0675},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0925, pci_vendor_0925, pci_ss_list_0925},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x09c1, pci_vendor_09c1, pci_ss_list_09c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0a89, pci_vendor_0a89, pci_ss_list_0a89},
+#endif
+ {0x0e11, pci_vendor_0e11, pci_ss_list_0e11},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x0e55, pci_vendor_0e55, pci_ss_list_0e55},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1000, pci_vendor_1000, pci_ss_list_1000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1001, pci_vendor_1001, pci_ss_list_1001},
+#endif
+ {0x1002, pci_vendor_1002, pci_ss_list_1002},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1003, pci_vendor_1003, pci_ss_list_1003},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1004, pci_vendor_1004, pci_ss_list_1004},
+#endif
+ {0x1005, pci_vendor_1005, pci_ss_list_1005},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1006, pci_vendor_1006, pci_ss_list_1006},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1007, pci_vendor_1007, pci_ss_list_1007},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1008, pci_vendor_1008, pci_ss_list_1008},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x100a, pci_vendor_100a, pci_ss_list_100a},
+#endif
+ {0x100b, pci_vendor_100b, pci_ss_list_100b},
+ {0x100c, pci_vendor_100c, pci_ss_list_100c},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x100d, pci_vendor_100d, pci_ss_list_100d},
+#endif
+ {0x100e, pci_vendor_100e, pci_ss_list_100e},
+ {0x1010, pci_vendor_1010, pci_ss_list_1010},
+ {0x1011, pci_vendor_1011, pci_ss_list_1011},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1012, pci_vendor_1012, pci_ss_list_1012},
+#endif
+ {0x1013, pci_vendor_1013, pci_ss_list_1013},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1014, pci_vendor_1014, pci_ss_list_1014},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1015, pci_vendor_1015, pci_ss_list_1015},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1016, pci_vendor_1016, pci_ss_list_1016},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1017, pci_vendor_1017, pci_ss_list_1017},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1018, pci_vendor_1018, pci_ss_list_1018},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1019, pci_vendor_1019, pci_ss_list_1019},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101a, pci_vendor_101a, pci_ss_list_101a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101b, pci_vendor_101b, pci_ss_list_101b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101c, pci_vendor_101c, pci_ss_list_101c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101e, pci_vendor_101e, pci_ss_list_101e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x101f, pci_vendor_101f, pci_ss_list_101f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1020, pci_vendor_1020, pci_ss_list_1020},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1021, pci_vendor_1021, pci_ss_list_1021},
+#endif
+ {0x1022, pci_vendor_1022, pci_ss_list_1022},
+ {0x1023, pci_vendor_1023, pci_ss_list_1023},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1024, pci_vendor_1024, pci_ss_list_1024},
+#endif
+ {0x1025, pci_vendor_1025, pci_ss_list_1025},
+ {0x1028, pci_vendor_1028, pci_ss_list_1028},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1029, pci_vendor_1029, pci_ss_list_1029},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x102a, pci_vendor_102a, pci_ss_list_102a},
+#endif
+ {0x102b, pci_vendor_102b, pci_ss_list_102b},
+ {0x102c, pci_vendor_102c, pci_ss_list_102c},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x102d, pci_vendor_102d, pci_ss_list_102d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x102e, pci_vendor_102e, pci_ss_list_102e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x102f, pci_vendor_102f, pci_ss_list_102f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1030, pci_vendor_1030, pci_ss_list_1030},
+#endif
+ {0x1031, pci_vendor_1031, pci_ss_list_1031},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1032, pci_vendor_1032, pci_ss_list_1032},
+#endif
+ {0x1033, pci_vendor_1033, pci_ss_list_1033},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1034, pci_vendor_1034, pci_ss_list_1034},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1035, pci_vendor_1035, pci_ss_list_1035},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1036, pci_vendor_1036, pci_ss_list_1036},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1037, pci_vendor_1037, pci_ss_list_1037},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1038, pci_vendor_1038, pci_ss_list_1038},
+#endif
+ {0x1039, pci_vendor_1039, pci_ss_list_1039},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x103a, pci_vendor_103a, pci_ss_list_103a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x103b, pci_vendor_103b, pci_ss_list_103b},
+#endif
+ {0x103c, pci_vendor_103c, pci_ss_list_103c},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x103e, pci_vendor_103e, pci_ss_list_103e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x103f, pci_vendor_103f, pci_ss_list_103f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1040, pci_vendor_1040, pci_ss_list_1040},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1041, pci_vendor_1041, pci_ss_list_1041},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1042, pci_vendor_1042, pci_ss_list_1042},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1043, pci_vendor_1043, pci_ss_list_1043},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1044, pci_vendor_1044, pci_ss_list_1044},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1045, pci_vendor_1045, pci_ss_list_1045},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1046, pci_vendor_1046, pci_ss_list_1046},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1047, pci_vendor_1047, pci_ss_list_1047},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1048, pci_vendor_1048, pci_ss_list_1048},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1049, pci_vendor_1049, pci_ss_list_1049},
+#endif
+ {0x104a, pci_vendor_104a, pci_ss_list_104a},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x104b, pci_vendor_104b, pci_ss_list_104b},
+#endif
+ {0x104c, pci_vendor_104c, pci_ss_list_104c},
+ {0x104d, pci_vendor_104d, pci_ss_list_104d},
+ {0x104e, pci_vendor_104e, pci_ss_list_104e},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x104f, pci_vendor_104f, pci_ss_list_104f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1050, pci_vendor_1050, pci_ss_list_1050},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1051, pci_vendor_1051, pci_ss_list_1051},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1052, pci_vendor_1052, pci_ss_list_1052},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1053, pci_vendor_1053, pci_ss_list_1053},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1054, pci_vendor_1054, pci_ss_list_1054},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1055, pci_vendor_1055, pci_ss_list_1055},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1056, pci_vendor_1056, pci_ss_list_1056},
+#endif
+ {0x1057, pci_vendor_1057, pci_ss_list_1057},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1058, pci_vendor_1058, pci_ss_list_1058},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1059, pci_vendor_1059, pci_ss_list_1059},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105a, pci_vendor_105a, pci_ss_list_105a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105b, pci_vendor_105b, pci_ss_list_105b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105c, pci_vendor_105c, pci_ss_list_105c},
+#endif
+ {0x105d, pci_vendor_105d, pci_ss_list_105d},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105e, pci_vendor_105e, pci_ss_list_105e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x105f, pci_vendor_105f, pci_ss_list_105f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1060, pci_vendor_1060, pci_ss_list_1060},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1061, pci_vendor_1061, pci_ss_list_1061},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1062, pci_vendor_1062, pci_ss_list_1062},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1063, pci_vendor_1063, pci_ss_list_1063},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1064, pci_vendor_1064, pci_ss_list_1064},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1065, pci_vendor_1065, pci_ss_list_1065},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1066, pci_vendor_1066, pci_ss_list_1066},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1067, pci_vendor_1067, pci_ss_list_1067},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1068, pci_vendor_1068, pci_ss_list_1068},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1069, pci_vendor_1069, pci_ss_list_1069},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106a, pci_vendor_106a, pci_ss_list_106a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106b, pci_vendor_106b, pci_ss_list_106b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106c, pci_vendor_106c, pci_ss_list_106c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106d, pci_vendor_106d, pci_ss_list_106d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106e, pci_vendor_106e, pci_ss_list_106e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x106f, pci_vendor_106f, pci_ss_list_106f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1070, pci_vendor_1070, pci_ss_list_1070},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1071, pci_vendor_1071, pci_ss_list_1071},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1072, pci_vendor_1072, pci_ss_list_1072},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1073, pci_vendor_1073, pci_ss_list_1073},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1074, pci_vendor_1074, pci_ss_list_1074},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1075, pci_vendor_1075, pci_ss_list_1075},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1076, pci_vendor_1076, pci_ss_list_1076},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1077, pci_vendor_1077, pci_ss_list_1077},
+#endif
+ {0x1078, pci_vendor_1078, pci_ss_list_1078},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1079, pci_vendor_1079, pci_ss_list_1079},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107a, pci_vendor_107a, pci_ss_list_107a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107b, pci_vendor_107b, pci_ss_list_107b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107c, pci_vendor_107c, pci_ss_list_107c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107d, pci_vendor_107d, pci_ss_list_107d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107e, pci_vendor_107e, pci_ss_list_107e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x107f, pci_vendor_107f, pci_ss_list_107f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1080, pci_vendor_1080, pci_ss_list_1080},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1081, pci_vendor_1081, pci_ss_list_1081},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1082, pci_vendor_1082, pci_ss_list_1082},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1083, pci_vendor_1083, pci_ss_list_1083},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1084, pci_vendor_1084, pci_ss_list_1084},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1085, pci_vendor_1085, pci_ss_list_1085},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1086, pci_vendor_1086, pci_ss_list_1086},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1087, pci_vendor_1087, pci_ss_list_1087},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1088, pci_vendor_1088, pci_ss_list_1088},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1089, pci_vendor_1089, pci_ss_list_1089},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x108a, pci_vendor_108a, pci_ss_list_108a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x108c, pci_vendor_108c, pci_ss_list_108c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x108d, pci_vendor_108d, pci_ss_list_108d},
+#endif
+ {0x108e, pci_vendor_108e, pci_ss_list_108e},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x108f, pci_vendor_108f, pci_ss_list_108f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1090, pci_vendor_1090, pci_ss_list_1090},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1091, pci_vendor_1091, pci_ss_list_1091},
+#endif
+ {0x1092, pci_vendor_1092, pci_ss_list_1092},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1093, pci_vendor_1093, pci_ss_list_1093},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1094, pci_vendor_1094, pci_ss_list_1094},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1095, pci_vendor_1095, pci_ss_list_1095},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1096, pci_vendor_1096, pci_ss_list_1096},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1097, pci_vendor_1097, pci_ss_list_1097},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1098, pci_vendor_1098, pci_ss_list_1098},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1099, pci_vendor_1099, pci_ss_list_1099},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109a, pci_vendor_109a, pci_ss_list_109a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109b, pci_vendor_109b, pci_ss_list_109b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109c, pci_vendor_109c, pci_ss_list_109c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109d, pci_vendor_109d, pci_ss_list_109d},
+#endif
+ {0x109e, pci_vendor_109e, pci_ss_list_109e},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x109f, pci_vendor_109f, pci_ss_list_109f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a0, pci_vendor_10a0, pci_ss_list_10a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a1, pci_vendor_10a1, pci_ss_list_10a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a2, pci_vendor_10a2, pci_ss_list_10a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a3, pci_vendor_10a3, pci_ss_list_10a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a4, pci_vendor_10a4, pci_ss_list_10a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a5, pci_vendor_10a5, pci_ss_list_10a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a6, pci_vendor_10a6, pci_ss_list_10a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a7, pci_vendor_10a7, pci_ss_list_10a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a8, pci_vendor_10a8, pci_ss_list_10a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10a9, pci_vendor_10a9, pci_ss_list_10a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10aa, pci_vendor_10aa, pci_ss_list_10aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ab, pci_vendor_10ab, pci_ss_list_10ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ac, pci_vendor_10ac, pci_ss_list_10ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ad, pci_vendor_10ad, pci_ss_list_10ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ae, pci_vendor_10ae, pci_ss_list_10ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10af, pci_vendor_10af, pci_ss_list_10af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b0, pci_vendor_10b0, pci_ss_list_10b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b1, pci_vendor_10b1, pci_ss_list_10b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b2, pci_vendor_10b2, pci_ss_list_10b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b3, pci_vendor_10b3, pci_ss_list_10b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b4, pci_vendor_10b4, pci_ss_list_10b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b5, pci_vendor_10b5, pci_ss_list_10b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b6, pci_vendor_10b6, pci_ss_list_10b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b7, pci_vendor_10b7, pci_ss_list_10b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10b8, pci_vendor_10b8, pci_ss_list_10b8},
+#endif
+ {0x10b9, pci_vendor_10b9, pci_ss_list_10b9},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ba, pci_vendor_10ba, pci_ss_list_10ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10bb, pci_vendor_10bb, pci_ss_list_10bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10bc, pci_vendor_10bc, pci_ss_list_10bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10bd, pci_vendor_10bd, pci_ss_list_10bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10be, pci_vendor_10be, pci_ss_list_10be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10bf, pci_vendor_10bf, pci_ss_list_10bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c0, pci_vendor_10c0, pci_ss_list_10c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c1, pci_vendor_10c1, pci_ss_list_10c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c2, pci_vendor_10c2, pci_ss_list_10c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c3, pci_vendor_10c3, pci_ss_list_10c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c4, pci_vendor_10c4, pci_ss_list_10c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c5, pci_vendor_10c5, pci_ss_list_10c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c6, pci_vendor_10c6, pci_ss_list_10c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c7, pci_vendor_10c7, pci_ss_list_10c7},
+#endif
+ {0x10c8, pci_vendor_10c8, pci_ss_list_10c8},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10c9, pci_vendor_10c9, pci_ss_list_10c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ca, pci_vendor_10ca, pci_ss_list_10ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10cb, pci_vendor_10cb, pci_ss_list_10cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10cc, pci_vendor_10cc, pci_ss_list_10cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10cd, pci_vendor_10cd, pci_ss_list_10cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ce, pci_vendor_10ce, pci_ss_list_10ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10cf, pci_vendor_10cf, pci_ss_list_10cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d0, pci_vendor_10d0, pci_ss_list_10d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d1, pci_vendor_10d1, pci_ss_list_10d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d2, pci_vendor_10d2, pci_ss_list_10d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d3, pci_vendor_10d3, pci_ss_list_10d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d4, pci_vendor_10d4, pci_ss_list_10d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d5, pci_vendor_10d5, pci_ss_list_10d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d6, pci_vendor_10d6, pci_ss_list_10d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d7, pci_vendor_10d7, pci_ss_list_10d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d8, pci_vendor_10d8, pci_ss_list_10d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10d9, pci_vendor_10d9, pci_ss_list_10d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10da, pci_vendor_10da, pci_ss_list_10da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10db, pci_vendor_10db, pci_ss_list_10db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10dc, pci_vendor_10dc, pci_ss_list_10dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10dd, pci_vendor_10dd, pci_ss_list_10dd},
+#endif
+ {0x10de, pci_vendor_10de, pci_ss_list_10de},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10df, pci_vendor_10df, pci_ss_list_10df},
+#endif
+ {0x10e0, pci_vendor_10e0, pci_ss_list_10e0},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e1, pci_vendor_10e1, pci_ss_list_10e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e2, pci_vendor_10e2, pci_ss_list_10e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e3, pci_vendor_10e3, pci_ss_list_10e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e4, pci_vendor_10e4, pci_ss_list_10e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e5, pci_vendor_10e5, pci_ss_list_10e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e6, pci_vendor_10e6, pci_ss_list_10e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e7, pci_vendor_10e7, pci_ss_list_10e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e8, pci_vendor_10e8, pci_ss_list_10e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10e9, pci_vendor_10e9, pci_ss_list_10e9},
+#endif
+ {0x10ea, pci_vendor_10ea, pci_ss_list_10ea},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10eb, pci_vendor_10eb, pci_ss_list_10eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ec, pci_vendor_10ec, pci_ss_list_10ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ed, pci_vendor_10ed, pci_ss_list_10ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ee, pci_vendor_10ee, pci_ss_list_10ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ef, pci_vendor_10ef, pci_ss_list_10ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f0, pci_vendor_10f0, pci_ss_list_10f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f1, pci_vendor_10f1, pci_ss_list_10f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f2, pci_vendor_10f2, pci_ss_list_10f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f3, pci_vendor_10f3, pci_ss_list_10f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f4, pci_vendor_10f4, pci_ss_list_10f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f5, pci_vendor_10f5, pci_ss_list_10f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f6, pci_vendor_10f6, pci_ss_list_10f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f7, pci_vendor_10f7, pci_ss_list_10f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f8, pci_vendor_10f8, pci_ss_list_10f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10f9, pci_vendor_10f9, pci_ss_list_10f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fa, pci_vendor_10fa, pci_ss_list_10fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fb, pci_vendor_10fb, pci_ss_list_10fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fc, pci_vendor_10fc, pci_ss_list_10fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fd, pci_vendor_10fd, pci_ss_list_10fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10fe, pci_vendor_10fe, pci_ss_list_10fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x10ff, pci_vendor_10ff, pci_ss_list_10ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1100, pci_vendor_1100, pci_ss_list_1100},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1101, pci_vendor_1101, pci_ss_list_1101},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1102, pci_vendor_1102, pci_ss_list_1102},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1103, pci_vendor_1103, pci_ss_list_1103},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1104, pci_vendor_1104, pci_ss_list_1104},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1105, pci_vendor_1105, pci_ss_list_1105},
+#endif
+ {0x1106, pci_vendor_1106, pci_ss_list_1106},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1107, pci_vendor_1107, pci_ss_list_1107},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1108, pci_vendor_1108, pci_ss_list_1108},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1109, pci_vendor_1109, pci_ss_list_1109},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110a, pci_vendor_110a, pci_ss_list_110a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110b, pci_vendor_110b, pci_ss_list_110b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110c, pci_vendor_110c, pci_ss_list_110c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110d, pci_vendor_110d, pci_ss_list_110d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110e, pci_vendor_110e, pci_ss_list_110e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x110f, pci_vendor_110f, pci_ss_list_110f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1110, pci_vendor_1110, pci_ss_list_1110},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1111, pci_vendor_1111, pci_ss_list_1111},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1112, pci_vendor_1112, pci_ss_list_1112},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1113, pci_vendor_1113, pci_ss_list_1113},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1114, pci_vendor_1114, pci_ss_list_1114},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1115, pci_vendor_1115, pci_ss_list_1115},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1116, pci_vendor_1116, pci_ss_list_1116},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1117, pci_vendor_1117, pci_ss_list_1117},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1118, pci_vendor_1118, pci_ss_list_1118},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1119, pci_vendor_1119, pci_ss_list_1119},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111a, pci_vendor_111a, pci_ss_list_111a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111b, pci_vendor_111b, pci_ss_list_111b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111c, pci_vendor_111c, pci_ss_list_111c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111d, pci_vendor_111d, pci_ss_list_111d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111e, pci_vendor_111e, pci_ss_list_111e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x111f, pci_vendor_111f, pci_ss_list_111f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1120, pci_vendor_1120, pci_ss_list_1120},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1121, pci_vendor_1121, pci_ss_list_1121},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1122, pci_vendor_1122, pci_ss_list_1122},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1123, pci_vendor_1123, pci_ss_list_1123},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1124, pci_vendor_1124, pci_ss_list_1124},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1125, pci_vendor_1125, pci_ss_list_1125},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1126, pci_vendor_1126, pci_ss_list_1126},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1127, pci_vendor_1127, pci_ss_list_1127},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1129, pci_vendor_1129, pci_ss_list_1129},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112a, pci_vendor_112a, pci_ss_list_112a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112b, pci_vendor_112b, pci_ss_list_112b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112c, pci_vendor_112c, pci_ss_list_112c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112d, pci_vendor_112d, pci_ss_list_112d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112e, pci_vendor_112e, pci_ss_list_112e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x112f, pci_vendor_112f, pci_ss_list_112f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1130, pci_vendor_1130, pci_ss_list_1130},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1131, pci_vendor_1131, pci_ss_list_1131},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1132, pci_vendor_1132, pci_ss_list_1132},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1133, pci_vendor_1133, pci_ss_list_1133},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1134, pci_vendor_1134, pci_ss_list_1134},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1135, pci_vendor_1135, pci_ss_list_1135},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1136, pci_vendor_1136, pci_ss_list_1136},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1137, pci_vendor_1137, pci_ss_list_1137},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1138, pci_vendor_1138, pci_ss_list_1138},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1139, pci_vendor_1139, pci_ss_list_1139},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113a, pci_vendor_113a, pci_ss_list_113a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113b, pci_vendor_113b, pci_ss_list_113b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113c, pci_vendor_113c, pci_ss_list_113c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113d, pci_vendor_113d, pci_ss_list_113d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113e, pci_vendor_113e, pci_ss_list_113e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x113f, pci_vendor_113f, pci_ss_list_113f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1140, pci_vendor_1140, pci_ss_list_1140},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1141, pci_vendor_1141, pci_ss_list_1141},
+#endif
+ {0x1142, pci_vendor_1142, pci_ss_list_1142},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1143, pci_vendor_1143, pci_ss_list_1143},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1144, pci_vendor_1144, pci_ss_list_1144},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1145, pci_vendor_1145, pci_ss_list_1145},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1146, pci_vendor_1146, pci_ss_list_1146},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1147, pci_vendor_1147, pci_ss_list_1147},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1148, pci_vendor_1148, pci_ss_list_1148},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1149, pci_vendor_1149, pci_ss_list_1149},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114a, pci_vendor_114a, pci_ss_list_114a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114b, pci_vendor_114b, pci_ss_list_114b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114c, pci_vendor_114c, pci_ss_list_114c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114d, pci_vendor_114d, pci_ss_list_114d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114e, pci_vendor_114e, pci_ss_list_114e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x114f, pci_vendor_114f, pci_ss_list_114f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1150, pci_vendor_1150, pci_ss_list_1150},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1151, pci_vendor_1151, pci_ss_list_1151},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1152, pci_vendor_1152, pci_ss_list_1152},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1153, pci_vendor_1153, pci_ss_list_1153},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1154, pci_vendor_1154, pci_ss_list_1154},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1155, pci_vendor_1155, pci_ss_list_1155},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1156, pci_vendor_1156, pci_ss_list_1156},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1157, pci_vendor_1157, pci_ss_list_1157},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1158, pci_vendor_1158, pci_ss_list_1158},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1159, pci_vendor_1159, pci_ss_list_1159},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115a, pci_vendor_115a, pci_ss_list_115a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115b, pci_vendor_115b, pci_ss_list_115b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115c, pci_vendor_115c, pci_ss_list_115c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115d, pci_vendor_115d, pci_ss_list_115d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115e, pci_vendor_115e, pci_ss_list_115e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x115f, pci_vendor_115f, pci_ss_list_115f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1160, pci_vendor_1160, pci_ss_list_1160},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1161, pci_vendor_1161, pci_ss_list_1161},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1162, pci_vendor_1162, pci_ss_list_1162},
+#endif
+ {0x1163, pci_vendor_1163, pci_ss_list_1163},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1164, pci_vendor_1164, pci_ss_list_1164},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1165, pci_vendor_1165, pci_ss_list_1165},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1166, pci_vendor_1166, pci_ss_list_1166},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1167, pci_vendor_1167, pci_ss_list_1167},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1168, pci_vendor_1168, pci_ss_list_1168},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1169, pci_vendor_1169, pci_ss_list_1169},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116a, pci_vendor_116a, pci_ss_list_116a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116b, pci_vendor_116b, pci_ss_list_116b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116c, pci_vendor_116c, pci_ss_list_116c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116d, pci_vendor_116d, pci_ss_list_116d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116e, pci_vendor_116e, pci_ss_list_116e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x116f, pci_vendor_116f, pci_ss_list_116f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1170, pci_vendor_1170, pci_ss_list_1170},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1171, pci_vendor_1171, pci_ss_list_1171},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1172, pci_vendor_1172, pci_ss_list_1172},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1173, pci_vendor_1173, pci_ss_list_1173},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1174, pci_vendor_1174, pci_ss_list_1174},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1175, pci_vendor_1175, pci_ss_list_1175},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1176, pci_vendor_1176, pci_ss_list_1176},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1177, pci_vendor_1177, pci_ss_list_1177},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1178, pci_vendor_1178, pci_ss_list_1178},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1179, pci_vendor_1179, pci_ss_list_1179},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117a, pci_vendor_117a, pci_ss_list_117a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117b, pci_vendor_117b, pci_ss_list_117b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117c, pci_vendor_117c, pci_ss_list_117c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117d, pci_vendor_117d, pci_ss_list_117d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117e, pci_vendor_117e, pci_ss_list_117e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x117f, pci_vendor_117f, pci_ss_list_117f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1180, pci_vendor_1180, pci_ss_list_1180},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1181, pci_vendor_1181, pci_ss_list_1181},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1183, pci_vendor_1183, pci_ss_list_1183},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1184, pci_vendor_1184, pci_ss_list_1184},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1185, pci_vendor_1185, pci_ss_list_1185},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1186, pci_vendor_1186, pci_ss_list_1186},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1187, pci_vendor_1187, pci_ss_list_1187},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1188, pci_vendor_1188, pci_ss_list_1188},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1189, pci_vendor_1189, pci_ss_list_1189},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118a, pci_vendor_118a, pci_ss_list_118a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118b, pci_vendor_118b, pci_ss_list_118b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118c, pci_vendor_118c, pci_ss_list_118c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118d, pci_vendor_118d, pci_ss_list_118d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118e, pci_vendor_118e, pci_ss_list_118e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x118f, pci_vendor_118f, pci_ss_list_118f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1190, pci_vendor_1190, pci_ss_list_1190},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1191, pci_vendor_1191, pci_ss_list_1191},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1192, pci_vendor_1192, pci_ss_list_1192},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1193, pci_vendor_1193, pci_ss_list_1193},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1194, pci_vendor_1194, pci_ss_list_1194},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1195, pci_vendor_1195, pci_ss_list_1195},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1196, pci_vendor_1196, pci_ss_list_1196},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1197, pci_vendor_1197, pci_ss_list_1197},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1198, pci_vendor_1198, pci_ss_list_1198},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1199, pci_vendor_1199, pci_ss_list_1199},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119a, pci_vendor_119a, pci_ss_list_119a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119b, pci_vendor_119b, pci_ss_list_119b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119c, pci_vendor_119c, pci_ss_list_119c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119d, pci_vendor_119d, pci_ss_list_119d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119e, pci_vendor_119e, pci_ss_list_119e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x119f, pci_vendor_119f, pci_ss_list_119f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a0, pci_vendor_11a0, pci_ss_list_11a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a1, pci_vendor_11a1, pci_ss_list_11a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a2, pci_vendor_11a2, pci_ss_list_11a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a3, pci_vendor_11a3, pci_ss_list_11a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a4, pci_vendor_11a4, pci_ss_list_11a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a5, pci_vendor_11a5, pci_ss_list_11a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a6, pci_vendor_11a6, pci_ss_list_11a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a7, pci_vendor_11a7, pci_ss_list_11a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a8, pci_vendor_11a8, pci_ss_list_11a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11a9, pci_vendor_11a9, pci_ss_list_11a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11aa, pci_vendor_11aa, pci_ss_list_11aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ab, pci_vendor_11ab, pci_ss_list_11ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ac, pci_vendor_11ac, pci_ss_list_11ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ad, pci_vendor_11ad, pci_ss_list_11ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ae, pci_vendor_11ae, pci_ss_list_11ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11af, pci_vendor_11af, pci_ss_list_11af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b0, pci_vendor_11b0, pci_ss_list_11b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b1, pci_vendor_11b1, pci_ss_list_11b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b2, pci_vendor_11b2, pci_ss_list_11b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b3, pci_vendor_11b3, pci_ss_list_11b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b4, pci_vendor_11b4, pci_ss_list_11b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b5, pci_vendor_11b5, pci_ss_list_11b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b6, pci_vendor_11b6, pci_ss_list_11b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b7, pci_vendor_11b7, pci_ss_list_11b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b8, pci_vendor_11b8, pci_ss_list_11b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11b9, pci_vendor_11b9, pci_ss_list_11b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ba, pci_vendor_11ba, pci_ss_list_11ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11bb, pci_vendor_11bb, pci_ss_list_11bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11bc, pci_vendor_11bc, pci_ss_list_11bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11bd, pci_vendor_11bd, pci_ss_list_11bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11be, pci_vendor_11be, pci_ss_list_11be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11bf, pci_vendor_11bf, pci_ss_list_11bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c0, pci_vendor_11c0, pci_ss_list_11c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c1, pci_vendor_11c1, pci_ss_list_11c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c2, pci_vendor_11c2, pci_ss_list_11c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c3, pci_vendor_11c3, pci_ss_list_11c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c4, pci_vendor_11c4, pci_ss_list_11c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c5, pci_vendor_11c5, pci_ss_list_11c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c6, pci_vendor_11c6, pci_ss_list_11c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c7, pci_vendor_11c7, pci_ss_list_11c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c8, pci_vendor_11c8, pci_ss_list_11c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11c9, pci_vendor_11c9, pci_ss_list_11c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ca, pci_vendor_11ca, pci_ss_list_11ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11cb, pci_vendor_11cb, pci_ss_list_11cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11cc, pci_vendor_11cc, pci_ss_list_11cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11cd, pci_vendor_11cd, pci_ss_list_11cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ce, pci_vendor_11ce, pci_ss_list_11ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11cf, pci_vendor_11cf, pci_ss_list_11cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d0, pci_vendor_11d0, pci_ss_list_11d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d1, pci_vendor_11d1, pci_ss_list_11d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d2, pci_vendor_11d2, pci_ss_list_11d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d3, pci_vendor_11d3, pci_ss_list_11d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d4, pci_vendor_11d4, pci_ss_list_11d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d5, pci_vendor_11d5, pci_ss_list_11d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d6, pci_vendor_11d6, pci_ss_list_11d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d7, pci_vendor_11d7, pci_ss_list_11d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d8, pci_vendor_11d8, pci_ss_list_11d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11d9, pci_vendor_11d9, pci_ss_list_11d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11da, pci_vendor_11da, pci_ss_list_11da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11db, pci_vendor_11db, pci_ss_list_11db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11dc, pci_vendor_11dc, pci_ss_list_11dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11dd, pci_vendor_11dd, pci_ss_list_11dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11de, pci_vendor_11de, pci_ss_list_11de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11df, pci_vendor_11df, pci_ss_list_11df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e0, pci_vendor_11e0, pci_ss_list_11e0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e1, pci_vendor_11e1, pci_ss_list_11e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e2, pci_vendor_11e2, pci_ss_list_11e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e3, pci_vendor_11e3, pci_ss_list_11e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e4, pci_vendor_11e4, pci_ss_list_11e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e5, pci_vendor_11e5, pci_ss_list_11e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e6, pci_vendor_11e6, pci_ss_list_11e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e7, pci_vendor_11e7, pci_ss_list_11e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e8, pci_vendor_11e8, pci_ss_list_11e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11e9, pci_vendor_11e9, pci_ss_list_11e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ea, pci_vendor_11ea, pci_ss_list_11ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11eb, pci_vendor_11eb, pci_ss_list_11eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ec, pci_vendor_11ec, pci_ss_list_11ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ed, pci_vendor_11ed, pci_ss_list_11ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ee, pci_vendor_11ee, pci_ss_list_11ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ef, pci_vendor_11ef, pci_ss_list_11ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f0, pci_vendor_11f0, pci_ss_list_11f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f1, pci_vendor_11f1, pci_ss_list_11f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f2, pci_vendor_11f2, pci_ss_list_11f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f3, pci_vendor_11f3, pci_ss_list_11f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f4, pci_vendor_11f4, pci_ss_list_11f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f5, pci_vendor_11f5, pci_ss_list_11f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f6, pci_vendor_11f6, pci_ss_list_11f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f7, pci_vendor_11f7, pci_ss_list_11f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f8, pci_vendor_11f8, pci_ss_list_11f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11f9, pci_vendor_11f9, pci_ss_list_11f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fa, pci_vendor_11fa, pci_ss_list_11fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fb, pci_vendor_11fb, pci_ss_list_11fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fc, pci_vendor_11fc, pci_ss_list_11fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fd, pci_vendor_11fd, pci_ss_list_11fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11fe, pci_vendor_11fe, pci_ss_list_11fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x11ff, pci_vendor_11ff, pci_ss_list_11ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1200, pci_vendor_1200, pci_ss_list_1200},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1201, pci_vendor_1201, pci_ss_list_1201},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1202, pci_vendor_1202, pci_ss_list_1202},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1203, pci_vendor_1203, pci_ss_list_1203},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1204, pci_vendor_1204, pci_ss_list_1204},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1205, pci_vendor_1205, pci_ss_list_1205},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1206, pci_vendor_1206, pci_ss_list_1206},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1208, pci_vendor_1208, pci_ss_list_1208},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1209, pci_vendor_1209, pci_ss_list_1209},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120a, pci_vendor_120a, pci_ss_list_120a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120b, pci_vendor_120b, pci_ss_list_120b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120c, pci_vendor_120c, pci_ss_list_120c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120d, pci_vendor_120d, pci_ss_list_120d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120e, pci_vendor_120e, pci_ss_list_120e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x120f, pci_vendor_120f, pci_ss_list_120f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1210, pci_vendor_1210, pci_ss_list_1210},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1211, pci_vendor_1211, pci_ss_list_1211},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1212, pci_vendor_1212, pci_ss_list_1212},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1213, pci_vendor_1213, pci_ss_list_1213},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1214, pci_vendor_1214, pci_ss_list_1214},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1215, pci_vendor_1215, pci_ss_list_1215},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1216, pci_vendor_1216, pci_ss_list_1216},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1217, pci_vendor_1217, pci_ss_list_1217},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1218, pci_vendor_1218, pci_ss_list_1218},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1219, pci_vendor_1219, pci_ss_list_1219},
+#endif
+ {0x121a, pci_vendor_121a, pci_ss_list_121a},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121b, pci_vendor_121b, pci_ss_list_121b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121c, pci_vendor_121c, pci_ss_list_121c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121d, pci_vendor_121d, pci_ss_list_121d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121e, pci_vendor_121e, pci_ss_list_121e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x121f, pci_vendor_121f, pci_ss_list_121f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1220, pci_vendor_1220, pci_ss_list_1220},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1221, pci_vendor_1221, pci_ss_list_1221},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1222, pci_vendor_1222, pci_ss_list_1222},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1223, pci_vendor_1223, pci_ss_list_1223},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1224, pci_vendor_1224, pci_ss_list_1224},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1225, pci_vendor_1225, pci_ss_list_1225},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1227, pci_vendor_1227, pci_ss_list_1227},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1228, pci_vendor_1228, pci_ss_list_1228},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1229, pci_vendor_1229, pci_ss_list_1229},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122a, pci_vendor_122a, pci_ss_list_122a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122b, pci_vendor_122b, pci_ss_list_122b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122c, pci_vendor_122c, pci_ss_list_122c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122d, pci_vendor_122d, pci_ss_list_122d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122e, pci_vendor_122e, pci_ss_list_122e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x122f, pci_vendor_122f, pci_ss_list_122f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1230, pci_vendor_1230, pci_ss_list_1230},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1231, pci_vendor_1231, pci_ss_list_1231},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1232, pci_vendor_1232, pci_ss_list_1232},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1233, pci_vendor_1233, pci_ss_list_1233},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1234, pci_vendor_1234, pci_ss_list_1234},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1235, pci_vendor_1235, pci_ss_list_1235},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1236, pci_vendor_1236, pci_ss_list_1236},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1237, pci_vendor_1237, pci_ss_list_1237},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1238, pci_vendor_1238, pci_ss_list_1238},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1239, pci_vendor_1239, pci_ss_list_1239},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123a, pci_vendor_123a, pci_ss_list_123a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123b, pci_vendor_123b, pci_ss_list_123b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123c, pci_vendor_123c, pci_ss_list_123c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123d, pci_vendor_123d, pci_ss_list_123d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123e, pci_vendor_123e, pci_ss_list_123e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x123f, pci_vendor_123f, pci_ss_list_123f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1240, pci_vendor_1240, pci_ss_list_1240},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1241, pci_vendor_1241, pci_ss_list_1241},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1242, pci_vendor_1242, pci_ss_list_1242},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1243, pci_vendor_1243, pci_ss_list_1243},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1244, pci_vendor_1244, pci_ss_list_1244},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1245, pci_vendor_1245, pci_ss_list_1245},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1246, pci_vendor_1246, pci_ss_list_1246},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1247, pci_vendor_1247, pci_ss_list_1247},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1248, pci_vendor_1248, pci_ss_list_1248},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1249, pci_vendor_1249, pci_ss_list_1249},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124a, pci_vendor_124a, pci_ss_list_124a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124b, pci_vendor_124b, pci_ss_list_124b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124c, pci_vendor_124c, pci_ss_list_124c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124d, pci_vendor_124d, pci_ss_list_124d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124e, pci_vendor_124e, pci_ss_list_124e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x124f, pci_vendor_124f, pci_ss_list_124f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1250, pci_vendor_1250, pci_ss_list_1250},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1251, pci_vendor_1251, pci_ss_list_1251},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1253, pci_vendor_1253, pci_ss_list_1253},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1254, pci_vendor_1254, pci_ss_list_1254},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1255, pci_vendor_1255, pci_ss_list_1255},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1256, pci_vendor_1256, pci_ss_list_1256},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1257, pci_vendor_1257, pci_ss_list_1257},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1258, pci_vendor_1258, pci_ss_list_1258},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1259, pci_vendor_1259, pci_ss_list_1259},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125a, pci_vendor_125a, pci_ss_list_125a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125b, pci_vendor_125b, pci_ss_list_125b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125c, pci_vendor_125c, pci_ss_list_125c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125d, pci_vendor_125d, pci_ss_list_125d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125e, pci_vendor_125e, pci_ss_list_125e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x125f, pci_vendor_125f, pci_ss_list_125f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1260, pci_vendor_1260, pci_ss_list_1260},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1261, pci_vendor_1261, pci_ss_list_1261},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1262, pci_vendor_1262, pci_ss_list_1262},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1263, pci_vendor_1263, pci_ss_list_1263},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1264, pci_vendor_1264, pci_ss_list_1264},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1265, pci_vendor_1265, pci_ss_list_1265},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1266, pci_vendor_1266, pci_ss_list_1266},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1267, pci_vendor_1267, pci_ss_list_1267},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1268, pci_vendor_1268, pci_ss_list_1268},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1269, pci_vendor_1269, pci_ss_list_1269},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126a, pci_vendor_126a, pci_ss_list_126a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126b, pci_vendor_126b, pci_ss_list_126b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126c, pci_vendor_126c, pci_ss_list_126c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126d, pci_vendor_126d, pci_ss_list_126d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x126e, pci_vendor_126e, pci_ss_list_126e},
+#endif
+ {0x126f, pci_vendor_126f, pci_ss_list_126f},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1270, pci_vendor_1270, pci_ss_list_1270},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1271, pci_vendor_1271, pci_ss_list_1271},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1272, pci_vendor_1272, pci_ss_list_1272},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1273, pci_vendor_1273, pci_ss_list_1273},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1274, pci_vendor_1274, pci_ss_list_1274},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1275, pci_vendor_1275, pci_ss_list_1275},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1276, pci_vendor_1276, pci_ss_list_1276},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1277, pci_vendor_1277, pci_ss_list_1277},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1278, pci_vendor_1278, pci_ss_list_1278},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1279, pci_vendor_1279, pci_ss_list_1279},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127a, pci_vendor_127a, pci_ss_list_127a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127b, pci_vendor_127b, pci_ss_list_127b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127c, pci_vendor_127c, pci_ss_list_127c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127d, pci_vendor_127d, pci_ss_list_127d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127e, pci_vendor_127e, pci_ss_list_127e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x127f, pci_vendor_127f, pci_ss_list_127f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1280, pci_vendor_1280, pci_ss_list_1280},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1281, pci_vendor_1281, pci_ss_list_1281},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1282, pci_vendor_1282, pci_ss_list_1282},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1283, pci_vendor_1283, pci_ss_list_1283},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1284, pci_vendor_1284, pci_ss_list_1284},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1285, pci_vendor_1285, pci_ss_list_1285},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1286, pci_vendor_1286, pci_ss_list_1286},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1287, pci_vendor_1287, pci_ss_list_1287},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1288, pci_vendor_1288, pci_ss_list_1288},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1289, pci_vendor_1289, pci_ss_list_1289},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128a, pci_vendor_128a, pci_ss_list_128a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128b, pci_vendor_128b, pci_ss_list_128b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128c, pci_vendor_128c, pci_ss_list_128c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128d, pci_vendor_128d, pci_ss_list_128d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128e, pci_vendor_128e, pci_ss_list_128e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x128f, pci_vendor_128f, pci_ss_list_128f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1290, pci_vendor_1290, pci_ss_list_1290},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1291, pci_vendor_1291, pci_ss_list_1291},
+#endif
+ {0x1292, pci_vendor_1292, pci_ss_list_1292},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1293, pci_vendor_1293, pci_ss_list_1293},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1294, pci_vendor_1294, pci_ss_list_1294},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1295, pci_vendor_1295, pci_ss_list_1295},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1296, pci_vendor_1296, pci_ss_list_1296},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1297, pci_vendor_1297, pci_ss_list_1297},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1298, pci_vendor_1298, pci_ss_list_1298},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1299, pci_vendor_1299, pci_ss_list_1299},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129a, pci_vendor_129a, pci_ss_list_129a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129b, pci_vendor_129b, pci_ss_list_129b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129c, pci_vendor_129c, pci_ss_list_129c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129d, pci_vendor_129d, pci_ss_list_129d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129e, pci_vendor_129e, pci_ss_list_129e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x129f, pci_vendor_129f, pci_ss_list_129f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a0, pci_vendor_12a0, pci_ss_list_12a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a1, pci_vendor_12a1, pci_ss_list_12a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a2, pci_vendor_12a2, pci_ss_list_12a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a3, pci_vendor_12a3, pci_ss_list_12a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a4, pci_vendor_12a4, pci_ss_list_12a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a5, pci_vendor_12a5, pci_ss_list_12a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a6, pci_vendor_12a6, pci_ss_list_12a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a7, pci_vendor_12a7, pci_ss_list_12a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a8, pci_vendor_12a8, pci_ss_list_12a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12a9, pci_vendor_12a9, pci_ss_list_12a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12aa, pci_vendor_12aa, pci_ss_list_12aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ab, pci_vendor_12ab, pci_ss_list_12ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ac, pci_vendor_12ac, pci_ss_list_12ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ad, pci_vendor_12ad, pci_ss_list_12ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ae, pci_vendor_12ae, pci_ss_list_12ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12af, pci_vendor_12af, pci_ss_list_12af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b0, pci_vendor_12b0, pci_ss_list_12b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b1, pci_vendor_12b1, pci_ss_list_12b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b2, pci_vendor_12b2, pci_ss_list_12b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b3, pci_vendor_12b3, pci_ss_list_12b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b4, pci_vendor_12b4, pci_ss_list_12b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b5, pci_vendor_12b5, pci_ss_list_12b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b6, pci_vendor_12b6, pci_ss_list_12b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b7, pci_vendor_12b7, pci_ss_list_12b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b8, pci_vendor_12b8, pci_ss_list_12b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12b9, pci_vendor_12b9, pci_ss_list_12b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ba, pci_vendor_12ba, pci_ss_list_12ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12bb, pci_vendor_12bb, pci_ss_list_12bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12bc, pci_vendor_12bc, pci_ss_list_12bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12bd, pci_vendor_12bd, pci_ss_list_12bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12be, pci_vendor_12be, pci_ss_list_12be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12bf, pci_vendor_12bf, pci_ss_list_12bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c0, pci_vendor_12c0, pci_ss_list_12c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c1, pci_vendor_12c1, pci_ss_list_12c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c2, pci_vendor_12c2, pci_ss_list_12c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c3, pci_vendor_12c3, pci_ss_list_12c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c4, pci_vendor_12c4, pci_ss_list_12c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c5, pci_vendor_12c5, pci_ss_list_12c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c6, pci_vendor_12c6, pci_ss_list_12c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c7, pci_vendor_12c7, pci_ss_list_12c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c8, pci_vendor_12c8, pci_ss_list_12c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12c9, pci_vendor_12c9, pci_ss_list_12c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ca, pci_vendor_12ca, pci_ss_list_12ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12cb, pci_vendor_12cb, pci_ss_list_12cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12cc, pci_vendor_12cc, pci_ss_list_12cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12cd, pci_vendor_12cd, pci_ss_list_12cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ce, pci_vendor_12ce, pci_ss_list_12ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12cf, pci_vendor_12cf, pci_ss_list_12cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d0, pci_vendor_12d0, pci_ss_list_12d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d1, pci_vendor_12d1, pci_ss_list_12d1},
+#endif
+ {0x12d2, pci_vendor_12d2, pci_ss_list_12d2},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d3, pci_vendor_12d3, pci_ss_list_12d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d4, pci_vendor_12d4, pci_ss_list_12d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d5, pci_vendor_12d5, pci_ss_list_12d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d6, pci_vendor_12d6, pci_ss_list_12d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d7, pci_vendor_12d7, pci_ss_list_12d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d8, pci_vendor_12d8, pci_ss_list_12d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12d9, pci_vendor_12d9, pci_ss_list_12d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12da, pci_vendor_12da, pci_ss_list_12da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12db, pci_vendor_12db, pci_ss_list_12db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12dc, pci_vendor_12dc, pci_ss_list_12dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12dd, pci_vendor_12dd, pci_ss_list_12dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12de, pci_vendor_12de, pci_ss_list_12de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12df, pci_vendor_12df, pci_ss_list_12df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e0, pci_vendor_12e0, pci_ss_list_12e0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e1, pci_vendor_12e1, pci_ss_list_12e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e2, pci_vendor_12e2, pci_ss_list_12e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e3, pci_vendor_12e3, pci_ss_list_12e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e4, pci_vendor_12e4, pci_ss_list_12e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e5, pci_vendor_12e5, pci_ss_list_12e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e6, pci_vendor_12e6, pci_ss_list_12e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e7, pci_vendor_12e7, pci_ss_list_12e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e8, pci_vendor_12e8, pci_ss_list_12e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12e9, pci_vendor_12e9, pci_ss_list_12e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ea, pci_vendor_12ea, pci_ss_list_12ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12eb, pci_vendor_12eb, pci_ss_list_12eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ec, pci_vendor_12ec, pci_ss_list_12ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ed, pci_vendor_12ed, pci_ss_list_12ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ee, pci_vendor_12ee, pci_ss_list_12ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ef, pci_vendor_12ef, pci_ss_list_12ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f0, pci_vendor_12f0, pci_ss_list_12f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f1, pci_vendor_12f1, pci_ss_list_12f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f2, pci_vendor_12f2, pci_ss_list_12f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f3, pci_vendor_12f3, pci_ss_list_12f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f4, pci_vendor_12f4, pci_ss_list_12f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f5, pci_vendor_12f5, pci_ss_list_12f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f6, pci_vendor_12f6, pci_ss_list_12f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f7, pci_vendor_12f7, pci_ss_list_12f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f8, pci_vendor_12f8, pci_ss_list_12f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12f9, pci_vendor_12f9, pci_ss_list_12f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12fb, pci_vendor_12fb, pci_ss_list_12fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12fc, pci_vendor_12fc, pci_ss_list_12fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12fd, pci_vendor_12fd, pci_ss_list_12fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12fe, pci_vendor_12fe, pci_ss_list_12fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x12ff, pci_vendor_12ff, pci_ss_list_12ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1300, pci_vendor_1300, pci_ss_list_1300},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1302, pci_vendor_1302, pci_ss_list_1302},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1303, pci_vendor_1303, pci_ss_list_1303},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1304, pci_vendor_1304, pci_ss_list_1304},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1305, pci_vendor_1305, pci_ss_list_1305},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1306, pci_vendor_1306, pci_ss_list_1306},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1307, pci_vendor_1307, pci_ss_list_1307},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1308, pci_vendor_1308, pci_ss_list_1308},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1309, pci_vendor_1309, pci_ss_list_1309},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130a, pci_vendor_130a, pci_ss_list_130a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130b, pci_vendor_130b, pci_ss_list_130b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130c, pci_vendor_130c, pci_ss_list_130c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130d, pci_vendor_130d, pci_ss_list_130d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130e, pci_vendor_130e, pci_ss_list_130e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x130f, pci_vendor_130f, pci_ss_list_130f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1310, pci_vendor_1310, pci_ss_list_1310},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1311, pci_vendor_1311, pci_ss_list_1311},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1312, pci_vendor_1312, pci_ss_list_1312},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1313, pci_vendor_1313, pci_ss_list_1313},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1316, pci_vendor_1316, pci_ss_list_1316},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1317, pci_vendor_1317, pci_ss_list_1317},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1318, pci_vendor_1318, pci_ss_list_1318},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1319, pci_vendor_1319, pci_ss_list_1319},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131a, pci_vendor_131a, pci_ss_list_131a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131c, pci_vendor_131c, pci_ss_list_131c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131d, pci_vendor_131d, pci_ss_list_131d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131e, pci_vendor_131e, pci_ss_list_131e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x131f, pci_vendor_131f, pci_ss_list_131f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1320, pci_vendor_1320, pci_ss_list_1320},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1321, pci_vendor_1321, pci_ss_list_1321},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1322, pci_vendor_1322, pci_ss_list_1322},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1323, pci_vendor_1323, pci_ss_list_1323},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1324, pci_vendor_1324, pci_ss_list_1324},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1325, pci_vendor_1325, pci_ss_list_1325},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1326, pci_vendor_1326, pci_ss_list_1326},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1327, pci_vendor_1327, pci_ss_list_1327},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1328, pci_vendor_1328, pci_ss_list_1328},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1329, pci_vendor_1329, pci_ss_list_1329},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x132a, pci_vendor_132a, pci_ss_list_132a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x132b, pci_vendor_132b, pci_ss_list_132b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x132c, pci_vendor_132c, pci_ss_list_132c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x132d, pci_vendor_132d, pci_ss_list_132d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1330, pci_vendor_1330, pci_ss_list_1330},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1331, pci_vendor_1331, pci_ss_list_1331},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1332, pci_vendor_1332, pci_ss_list_1332},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1334, pci_vendor_1334, pci_ss_list_1334},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1335, pci_vendor_1335, pci_ss_list_1335},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1337, pci_vendor_1337, pci_ss_list_1337},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1338, pci_vendor_1338, pci_ss_list_1338},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133a, pci_vendor_133a, pci_ss_list_133a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133b, pci_vendor_133b, pci_ss_list_133b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133c, pci_vendor_133c, pci_ss_list_133c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133d, pci_vendor_133d, pci_ss_list_133d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133e, pci_vendor_133e, pci_ss_list_133e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x133f, pci_vendor_133f, pci_ss_list_133f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1340, pci_vendor_1340, pci_ss_list_1340},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1341, pci_vendor_1341, pci_ss_list_1341},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1342, pci_vendor_1342, pci_ss_list_1342},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1343, pci_vendor_1343, pci_ss_list_1343},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1344, pci_vendor_1344, pci_ss_list_1344},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1345, pci_vendor_1345, pci_ss_list_1345},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1347, pci_vendor_1347, pci_ss_list_1347},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1349, pci_vendor_1349, pci_ss_list_1349},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134a, pci_vendor_134a, pci_ss_list_134a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134b, pci_vendor_134b, pci_ss_list_134b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134c, pci_vendor_134c, pci_ss_list_134c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134d, pci_vendor_134d, pci_ss_list_134d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134e, pci_vendor_134e, pci_ss_list_134e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x134f, pci_vendor_134f, pci_ss_list_134f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1350, pci_vendor_1350, pci_ss_list_1350},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1351, pci_vendor_1351, pci_ss_list_1351},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1353, pci_vendor_1353, pci_ss_list_1353},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1354, pci_vendor_1354, pci_ss_list_1354},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1355, pci_vendor_1355, pci_ss_list_1355},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1356, pci_vendor_1356, pci_ss_list_1356},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1359, pci_vendor_1359, pci_ss_list_1359},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135a, pci_vendor_135a, pci_ss_list_135a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135b, pci_vendor_135b, pci_ss_list_135b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135c, pci_vendor_135c, pci_ss_list_135c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135d, pci_vendor_135d, pci_ss_list_135d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135e, pci_vendor_135e, pci_ss_list_135e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x135f, pci_vendor_135f, pci_ss_list_135f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1360, pci_vendor_1360, pci_ss_list_1360},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1361, pci_vendor_1361, pci_ss_list_1361},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1362, pci_vendor_1362, pci_ss_list_1362},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1363, pci_vendor_1363, pci_ss_list_1363},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1364, pci_vendor_1364, pci_ss_list_1364},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1365, pci_vendor_1365, pci_ss_list_1365},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1366, pci_vendor_1366, pci_ss_list_1366},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1367, pci_vendor_1367, pci_ss_list_1367},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1368, pci_vendor_1368, pci_ss_list_1368},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1369, pci_vendor_1369, pci_ss_list_1369},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136a, pci_vendor_136a, pci_ss_list_136a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136b, pci_vendor_136b, pci_ss_list_136b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136c, pci_vendor_136c, pci_ss_list_136c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136d, pci_vendor_136d, pci_ss_list_136d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x136f, pci_vendor_136f, pci_ss_list_136f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1370, pci_vendor_1370, pci_ss_list_1370},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1371, pci_vendor_1371, pci_ss_list_1371},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1373, pci_vendor_1373, pci_ss_list_1373},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1374, pci_vendor_1374, pci_ss_list_1374},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1375, pci_vendor_1375, pci_ss_list_1375},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1376, pci_vendor_1376, pci_ss_list_1376},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1377, pci_vendor_1377, pci_ss_list_1377},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1378, pci_vendor_1378, pci_ss_list_1378},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1379, pci_vendor_1379, pci_ss_list_1379},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137a, pci_vendor_137a, pci_ss_list_137a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137b, pci_vendor_137b, pci_ss_list_137b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137c, pci_vendor_137c, pci_ss_list_137c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137d, pci_vendor_137d, pci_ss_list_137d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137e, pci_vendor_137e, pci_ss_list_137e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x137f, pci_vendor_137f, pci_ss_list_137f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1380, pci_vendor_1380, pci_ss_list_1380},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1381, pci_vendor_1381, pci_ss_list_1381},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1382, pci_vendor_1382, pci_ss_list_1382},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1383, pci_vendor_1383, pci_ss_list_1383},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1384, pci_vendor_1384, pci_ss_list_1384},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1385, pci_vendor_1385, pci_ss_list_1385},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1386, pci_vendor_1386, pci_ss_list_1386},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1387, pci_vendor_1387, pci_ss_list_1387},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1388, pci_vendor_1388, pci_ss_list_1388},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1389, pci_vendor_1389, pci_ss_list_1389},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138a, pci_vendor_138a, pci_ss_list_138a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138b, pci_vendor_138b, pci_ss_list_138b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138c, pci_vendor_138c, pci_ss_list_138c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138d, pci_vendor_138d, pci_ss_list_138d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138e, pci_vendor_138e, pci_ss_list_138e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x138f, pci_vendor_138f, pci_ss_list_138f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1390, pci_vendor_1390, pci_ss_list_1390},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1391, pci_vendor_1391, pci_ss_list_1391},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1392, pci_vendor_1392, pci_ss_list_1392},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1393, pci_vendor_1393, pci_ss_list_1393},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1394, pci_vendor_1394, pci_ss_list_1394},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1395, pci_vendor_1395, pci_ss_list_1395},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1396, pci_vendor_1396, pci_ss_list_1396},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1397, pci_vendor_1397, pci_ss_list_1397},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1398, pci_vendor_1398, pci_ss_list_1398},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1399, pci_vendor_1399, pci_ss_list_1399},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139a, pci_vendor_139a, pci_ss_list_139a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139b, pci_vendor_139b, pci_ss_list_139b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139c, pci_vendor_139c, pci_ss_list_139c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139d, pci_vendor_139d, pci_ss_list_139d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139e, pci_vendor_139e, pci_ss_list_139e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x139f, pci_vendor_139f, pci_ss_list_139f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a0, pci_vendor_13a0, pci_ss_list_13a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a1, pci_vendor_13a1, pci_ss_list_13a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a2, pci_vendor_13a2, pci_ss_list_13a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a3, pci_vendor_13a3, pci_ss_list_13a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a4, pci_vendor_13a4, pci_ss_list_13a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a5, pci_vendor_13a5, pci_ss_list_13a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a6, pci_vendor_13a6, pci_ss_list_13a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a7, pci_vendor_13a7, pci_ss_list_13a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a8, pci_vendor_13a8, pci_ss_list_13a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13a9, pci_vendor_13a9, pci_ss_list_13a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13aa, pci_vendor_13aa, pci_ss_list_13aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ab, pci_vendor_13ab, pci_ss_list_13ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ac, pci_vendor_13ac, pci_ss_list_13ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ad, pci_vendor_13ad, pci_ss_list_13ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ae, pci_vendor_13ae, pci_ss_list_13ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13af, pci_vendor_13af, pci_ss_list_13af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b0, pci_vendor_13b0, pci_ss_list_13b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b1, pci_vendor_13b1, pci_ss_list_13b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b2, pci_vendor_13b2, pci_ss_list_13b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b3, pci_vendor_13b3, pci_ss_list_13b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b4, pci_vendor_13b4, pci_ss_list_13b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b5, pci_vendor_13b5, pci_ss_list_13b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b6, pci_vendor_13b6, pci_ss_list_13b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b7, pci_vendor_13b7, pci_ss_list_13b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b8, pci_vendor_13b8, pci_ss_list_13b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13b9, pci_vendor_13b9, pci_ss_list_13b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ba, pci_vendor_13ba, pci_ss_list_13ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13bb, pci_vendor_13bb, pci_ss_list_13bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13bc, pci_vendor_13bc, pci_ss_list_13bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13bd, pci_vendor_13bd, pci_ss_list_13bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13be, pci_vendor_13be, pci_ss_list_13be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13bf, pci_vendor_13bf, pci_ss_list_13bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c0, pci_vendor_13c0, pci_ss_list_13c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c1, pci_vendor_13c1, pci_ss_list_13c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c2, pci_vendor_13c2, pci_ss_list_13c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c3, pci_vendor_13c3, pci_ss_list_13c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c4, pci_vendor_13c4, pci_ss_list_13c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c5, pci_vendor_13c5, pci_ss_list_13c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c6, pci_vendor_13c6, pci_ss_list_13c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c7, pci_vendor_13c7, pci_ss_list_13c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c8, pci_vendor_13c8, pci_ss_list_13c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13c9, pci_vendor_13c9, pci_ss_list_13c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ca, pci_vendor_13ca, pci_ss_list_13ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13cb, pci_vendor_13cb, pci_ss_list_13cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13cc, pci_vendor_13cc, pci_ss_list_13cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13cd, pci_vendor_13cd, pci_ss_list_13cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ce, pci_vendor_13ce, pci_ss_list_13ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13cf, pci_vendor_13cf, pci_ss_list_13cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d0, pci_vendor_13d0, pci_ss_list_13d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d1, pci_vendor_13d1, pci_ss_list_13d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d2, pci_vendor_13d2, pci_ss_list_13d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d3, pci_vendor_13d3, pci_ss_list_13d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d4, pci_vendor_13d4, pci_ss_list_13d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d5, pci_vendor_13d5, pci_ss_list_13d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d6, pci_vendor_13d6, pci_ss_list_13d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d7, pci_vendor_13d7, pci_ss_list_13d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d8, pci_vendor_13d8, pci_ss_list_13d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13d9, pci_vendor_13d9, pci_ss_list_13d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13da, pci_vendor_13da, pci_ss_list_13da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13db, pci_vendor_13db, pci_ss_list_13db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13dc, pci_vendor_13dc, pci_ss_list_13dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13dd, pci_vendor_13dd, pci_ss_list_13dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13de, pci_vendor_13de, pci_ss_list_13de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13df, pci_vendor_13df, pci_ss_list_13df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e0, pci_vendor_13e0, pci_ss_list_13e0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e1, pci_vendor_13e1, pci_ss_list_13e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e2, pci_vendor_13e2, pci_ss_list_13e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e3, pci_vendor_13e3, pci_ss_list_13e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e4, pci_vendor_13e4, pci_ss_list_13e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e5, pci_vendor_13e5, pci_ss_list_13e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e6, pci_vendor_13e6, pci_ss_list_13e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e7, pci_vendor_13e7, pci_ss_list_13e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e8, pci_vendor_13e8, pci_ss_list_13e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13e9, pci_vendor_13e9, pci_ss_list_13e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ea, pci_vendor_13ea, pci_ss_list_13ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13eb, pci_vendor_13eb, pci_ss_list_13eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ec, pci_vendor_13ec, pci_ss_list_13ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ed, pci_vendor_13ed, pci_ss_list_13ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ee, pci_vendor_13ee, pci_ss_list_13ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ef, pci_vendor_13ef, pci_ss_list_13ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f0, pci_vendor_13f0, pci_ss_list_13f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f1, pci_vendor_13f1, pci_ss_list_13f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f2, pci_vendor_13f2, pci_ss_list_13f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f3, pci_vendor_13f3, pci_ss_list_13f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f4, pci_vendor_13f4, pci_ss_list_13f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f5, pci_vendor_13f5, pci_ss_list_13f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f6, pci_vendor_13f6, pci_ss_list_13f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f7, pci_vendor_13f7, pci_ss_list_13f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f8, pci_vendor_13f8, pci_ss_list_13f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13f9, pci_vendor_13f9, pci_ss_list_13f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fa, pci_vendor_13fa, pci_ss_list_13fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fb, pci_vendor_13fb, pci_ss_list_13fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fc, pci_vendor_13fc, pci_ss_list_13fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fd, pci_vendor_13fd, pci_ss_list_13fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13fe, pci_vendor_13fe, pci_ss_list_13fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x13ff, pci_vendor_13ff, pci_ss_list_13ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1400, pci_vendor_1400, pci_ss_list_1400},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1401, pci_vendor_1401, pci_ss_list_1401},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1402, pci_vendor_1402, pci_ss_list_1402},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1403, pci_vendor_1403, pci_ss_list_1403},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1404, pci_vendor_1404, pci_ss_list_1404},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1405, pci_vendor_1405, pci_ss_list_1405},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1406, pci_vendor_1406, pci_ss_list_1406},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1407, pci_vendor_1407, pci_ss_list_1407},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1408, pci_vendor_1408, pci_ss_list_1408},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1409, pci_vendor_1409, pci_ss_list_1409},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140a, pci_vendor_140a, pci_ss_list_140a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140b, pci_vendor_140b, pci_ss_list_140b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140c, pci_vendor_140c, pci_ss_list_140c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140d, pci_vendor_140d, pci_ss_list_140d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140e, pci_vendor_140e, pci_ss_list_140e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x140f, pci_vendor_140f, pci_ss_list_140f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1410, pci_vendor_1410, pci_ss_list_1410},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1411, pci_vendor_1411, pci_ss_list_1411},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1412, pci_vendor_1412, pci_ss_list_1412},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1413, pci_vendor_1413, pci_ss_list_1413},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1414, pci_vendor_1414, pci_ss_list_1414},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1415, pci_vendor_1415, pci_ss_list_1415},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1416, pci_vendor_1416, pci_ss_list_1416},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1417, pci_vendor_1417, pci_ss_list_1417},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1418, pci_vendor_1418, pci_ss_list_1418},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1419, pci_vendor_1419, pci_ss_list_1419},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141a, pci_vendor_141a, pci_ss_list_141a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141b, pci_vendor_141b, pci_ss_list_141b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141d, pci_vendor_141d, pci_ss_list_141d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141e, pci_vendor_141e, pci_ss_list_141e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x141f, pci_vendor_141f, pci_ss_list_141f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1420, pci_vendor_1420, pci_ss_list_1420},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1421, pci_vendor_1421, pci_ss_list_1421},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1422, pci_vendor_1422, pci_ss_list_1422},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1423, pci_vendor_1423, pci_ss_list_1423},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1424, pci_vendor_1424, pci_ss_list_1424},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1425, pci_vendor_1425, pci_ss_list_1425},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1426, pci_vendor_1426, pci_ss_list_1426},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1427, pci_vendor_1427, pci_ss_list_1427},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1428, pci_vendor_1428, pci_ss_list_1428},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1429, pci_vendor_1429, pci_ss_list_1429},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142a, pci_vendor_142a, pci_ss_list_142a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142b, pci_vendor_142b, pci_ss_list_142b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142c, pci_vendor_142c, pci_ss_list_142c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142d, pci_vendor_142d, pci_ss_list_142d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142e, pci_vendor_142e, pci_ss_list_142e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x142f, pci_vendor_142f, pci_ss_list_142f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1430, pci_vendor_1430, pci_ss_list_1430},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1431, pci_vendor_1431, pci_ss_list_1431},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1432, pci_vendor_1432, pci_ss_list_1432},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1433, pci_vendor_1433, pci_ss_list_1433},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1435, pci_vendor_1435, pci_ss_list_1435},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1436, pci_vendor_1436, pci_ss_list_1436},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1437, pci_vendor_1437, pci_ss_list_1437},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1438, pci_vendor_1438, pci_ss_list_1438},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1439, pci_vendor_1439, pci_ss_list_1439},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143a, pci_vendor_143a, pci_ss_list_143a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143b, pci_vendor_143b, pci_ss_list_143b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143c, pci_vendor_143c, pci_ss_list_143c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143d, pci_vendor_143d, pci_ss_list_143d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143e, pci_vendor_143e, pci_ss_list_143e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x143f, pci_vendor_143f, pci_ss_list_143f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1440, pci_vendor_1440, pci_ss_list_1440},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1441, pci_vendor_1441, pci_ss_list_1441},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1442, pci_vendor_1442, pci_ss_list_1442},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1443, pci_vendor_1443, pci_ss_list_1443},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1444, pci_vendor_1444, pci_ss_list_1444},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1445, pci_vendor_1445, pci_ss_list_1445},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1446, pci_vendor_1446, pci_ss_list_1446},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1447, pci_vendor_1447, pci_ss_list_1447},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1448, pci_vendor_1448, pci_ss_list_1448},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1449, pci_vendor_1449, pci_ss_list_1449},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144a, pci_vendor_144a, pci_ss_list_144a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144b, pci_vendor_144b, pci_ss_list_144b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144c, pci_vendor_144c, pci_ss_list_144c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144d, pci_vendor_144d, pci_ss_list_144d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144e, pci_vendor_144e, pci_ss_list_144e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x144f, pci_vendor_144f, pci_ss_list_144f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1450, pci_vendor_1450, pci_ss_list_1450},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1451, pci_vendor_1451, pci_ss_list_1451},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1453, pci_vendor_1453, pci_ss_list_1453},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1454, pci_vendor_1454, pci_ss_list_1454},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1455, pci_vendor_1455, pci_ss_list_1455},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1456, pci_vendor_1456, pci_ss_list_1456},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1457, pci_vendor_1457, pci_ss_list_1457},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1458, pci_vendor_1458, pci_ss_list_1458},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1459, pci_vendor_1459, pci_ss_list_1459},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145a, pci_vendor_145a, pci_ss_list_145a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145b, pci_vendor_145b, pci_ss_list_145b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145c, pci_vendor_145c, pci_ss_list_145c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145d, pci_vendor_145d, pci_ss_list_145d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145e, pci_vendor_145e, pci_ss_list_145e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x145f, pci_vendor_145f, pci_ss_list_145f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1460, pci_vendor_1460, pci_ss_list_1460},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1461, pci_vendor_1461, pci_ss_list_1461},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1462, pci_vendor_1462, pci_ss_list_1462},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1463, pci_vendor_1463, pci_ss_list_1463},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1464, pci_vendor_1464, pci_ss_list_1464},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1465, pci_vendor_1465, pci_ss_list_1465},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1466, pci_vendor_1466, pci_ss_list_1466},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1467, pci_vendor_1467, pci_ss_list_1467},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1468, pci_vendor_1468, pci_ss_list_1468},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1469, pci_vendor_1469, pci_ss_list_1469},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146a, pci_vendor_146a, pci_ss_list_146a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146b, pci_vendor_146b, pci_ss_list_146b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146c, pci_vendor_146c, pci_ss_list_146c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146d, pci_vendor_146d, pci_ss_list_146d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146e, pci_vendor_146e, pci_ss_list_146e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x146f, pci_vendor_146f, pci_ss_list_146f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1470, pci_vendor_1470, pci_ss_list_1470},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1471, pci_vendor_1471, pci_ss_list_1471},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1472, pci_vendor_1472, pci_ss_list_1472},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1473, pci_vendor_1473, pci_ss_list_1473},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1474, pci_vendor_1474, pci_ss_list_1474},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1475, pci_vendor_1475, pci_ss_list_1475},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1476, pci_vendor_1476, pci_ss_list_1476},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1477, pci_vendor_1477, pci_ss_list_1477},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1478, pci_vendor_1478, pci_ss_list_1478},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1479, pci_vendor_1479, pci_ss_list_1479},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147a, pci_vendor_147a, pci_ss_list_147a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147b, pci_vendor_147b, pci_ss_list_147b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147c, pci_vendor_147c, pci_ss_list_147c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147d, pci_vendor_147d, pci_ss_list_147d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147e, pci_vendor_147e, pci_ss_list_147e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x147f, pci_vendor_147f, pci_ss_list_147f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1480, pci_vendor_1480, pci_ss_list_1480},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1481, pci_vendor_1481, pci_ss_list_1481},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1482, pci_vendor_1482, pci_ss_list_1482},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1483, pci_vendor_1483, pci_ss_list_1483},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1484, pci_vendor_1484, pci_ss_list_1484},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1485, pci_vendor_1485, pci_ss_list_1485},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1486, pci_vendor_1486, pci_ss_list_1486},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1487, pci_vendor_1487, pci_ss_list_1487},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1488, pci_vendor_1488, pci_ss_list_1488},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1489, pci_vendor_1489, pci_ss_list_1489},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148a, pci_vendor_148a, pci_ss_list_148a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148b, pci_vendor_148b, pci_ss_list_148b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148c, pci_vendor_148c, pci_ss_list_148c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148d, pci_vendor_148d, pci_ss_list_148d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148e, pci_vendor_148e, pci_ss_list_148e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x148f, pci_vendor_148f, pci_ss_list_148f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1490, pci_vendor_1490, pci_ss_list_1490},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1491, pci_vendor_1491, pci_ss_list_1491},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1492, pci_vendor_1492, pci_ss_list_1492},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1493, pci_vendor_1493, pci_ss_list_1493},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1494, pci_vendor_1494, pci_ss_list_1494},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1495, pci_vendor_1495, pci_ss_list_1495},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1496, pci_vendor_1496, pci_ss_list_1496},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1497, pci_vendor_1497, pci_ss_list_1497},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1498, pci_vendor_1498, pci_ss_list_1498},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1499, pci_vendor_1499, pci_ss_list_1499},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149a, pci_vendor_149a, pci_ss_list_149a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149b, pci_vendor_149b, pci_ss_list_149b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149c, pci_vendor_149c, pci_ss_list_149c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149d, pci_vendor_149d, pci_ss_list_149d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149e, pci_vendor_149e, pci_ss_list_149e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x149f, pci_vendor_149f, pci_ss_list_149f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a0, pci_vendor_14a0, pci_ss_list_14a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a1, pci_vendor_14a1, pci_ss_list_14a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a2, pci_vendor_14a2, pci_ss_list_14a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a3, pci_vendor_14a3, pci_ss_list_14a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a4, pci_vendor_14a4, pci_ss_list_14a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a5, pci_vendor_14a5, pci_ss_list_14a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a6, pci_vendor_14a6, pci_ss_list_14a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a7, pci_vendor_14a7, pci_ss_list_14a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a8, pci_vendor_14a8, pci_ss_list_14a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14a9, pci_vendor_14a9, pci_ss_list_14a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14aa, pci_vendor_14aa, pci_ss_list_14aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ab, pci_vendor_14ab, pci_ss_list_14ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ac, pci_vendor_14ac, pci_ss_list_14ac},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ad, pci_vendor_14ad, pci_ss_list_14ad},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ae, pci_vendor_14ae, pci_ss_list_14ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14af, pci_vendor_14af, pci_ss_list_14af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b0, pci_vendor_14b0, pci_ss_list_14b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b1, pci_vendor_14b1, pci_ss_list_14b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b2, pci_vendor_14b2, pci_ss_list_14b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b3, pci_vendor_14b3, pci_ss_list_14b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b4, pci_vendor_14b4, pci_ss_list_14b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b5, pci_vendor_14b5, pci_ss_list_14b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b6, pci_vendor_14b6, pci_ss_list_14b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b7, pci_vendor_14b7, pci_ss_list_14b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b8, pci_vendor_14b8, pci_ss_list_14b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14b9, pci_vendor_14b9, pci_ss_list_14b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ba, pci_vendor_14ba, pci_ss_list_14ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14bb, pci_vendor_14bb, pci_ss_list_14bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14bc, pci_vendor_14bc, pci_ss_list_14bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14bd, pci_vendor_14bd, pci_ss_list_14bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14be, pci_vendor_14be, pci_ss_list_14be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14bf, pci_vendor_14bf, pci_ss_list_14bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c0, pci_vendor_14c0, pci_ss_list_14c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c1, pci_vendor_14c1, pci_ss_list_14c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c2, pci_vendor_14c2, pci_ss_list_14c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c3, pci_vendor_14c3, pci_ss_list_14c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c4, pci_vendor_14c4, pci_ss_list_14c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c5, pci_vendor_14c5, pci_ss_list_14c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c6, pci_vendor_14c6, pci_ss_list_14c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c7, pci_vendor_14c7, pci_ss_list_14c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c8, pci_vendor_14c8, pci_ss_list_14c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14c9, pci_vendor_14c9, pci_ss_list_14c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ca, pci_vendor_14ca, pci_ss_list_14ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14cb, pci_vendor_14cb, pci_ss_list_14cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14cc, pci_vendor_14cc, pci_ss_list_14cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14cd, pci_vendor_14cd, pci_ss_list_14cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ce, pci_vendor_14ce, pci_ss_list_14ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14cf, pci_vendor_14cf, pci_ss_list_14cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d0, pci_vendor_14d0, pci_ss_list_14d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d1, pci_vendor_14d1, pci_ss_list_14d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d2, pci_vendor_14d2, pci_ss_list_14d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d3, pci_vendor_14d3, pci_ss_list_14d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d4, pci_vendor_14d4, pci_ss_list_14d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d5, pci_vendor_14d5, pci_ss_list_14d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d6, pci_vendor_14d6, pci_ss_list_14d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d7, pci_vendor_14d7, pci_ss_list_14d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d8, pci_vendor_14d8, pci_ss_list_14d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14d9, pci_vendor_14d9, pci_ss_list_14d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14da, pci_vendor_14da, pci_ss_list_14da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14db, pci_vendor_14db, pci_ss_list_14db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14dc, pci_vendor_14dc, pci_ss_list_14dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14dd, pci_vendor_14dd, pci_ss_list_14dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14de, pci_vendor_14de, pci_ss_list_14de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14df, pci_vendor_14df, pci_ss_list_14df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e1, pci_vendor_14e1, pci_ss_list_14e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e2, pci_vendor_14e2, pci_ss_list_14e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e3, pci_vendor_14e3, pci_ss_list_14e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e4, pci_vendor_14e4, pci_ss_list_14e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e5, pci_vendor_14e5, pci_ss_list_14e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e6, pci_vendor_14e6, pci_ss_list_14e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e7, pci_vendor_14e7, pci_ss_list_14e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e8, pci_vendor_14e8, pci_ss_list_14e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14e9, pci_vendor_14e9, pci_ss_list_14e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ea, pci_vendor_14ea, pci_ss_list_14ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14eb, pci_vendor_14eb, pci_ss_list_14eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ec, pci_vendor_14ec, pci_ss_list_14ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ed, pci_vendor_14ed, pci_ss_list_14ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ee, pci_vendor_14ee, pci_ss_list_14ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ef, pci_vendor_14ef, pci_ss_list_14ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f0, pci_vendor_14f0, pci_ss_list_14f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f1, pci_vendor_14f1, pci_ss_list_14f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f2, pci_vendor_14f2, pci_ss_list_14f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f3, pci_vendor_14f3, pci_ss_list_14f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f4, pci_vendor_14f4, pci_ss_list_14f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f5, pci_vendor_14f5, pci_ss_list_14f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f6, pci_vendor_14f6, pci_ss_list_14f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f7, pci_vendor_14f7, pci_ss_list_14f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f8, pci_vendor_14f8, pci_ss_list_14f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14f9, pci_vendor_14f9, pci_ss_list_14f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fa, pci_vendor_14fa, pci_ss_list_14fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fb, pci_vendor_14fb, pci_ss_list_14fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fc, pci_vendor_14fc, pci_ss_list_14fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fd, pci_vendor_14fd, pci_ss_list_14fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14fe, pci_vendor_14fe, pci_ss_list_14fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x14ff, pci_vendor_14ff, pci_ss_list_14ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1500, pci_vendor_1500, pci_ss_list_1500},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1501, pci_vendor_1501, pci_ss_list_1501},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1502, pci_vendor_1502, pci_ss_list_1502},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1503, pci_vendor_1503, pci_ss_list_1503},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1504, pci_vendor_1504, pci_ss_list_1504},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1505, pci_vendor_1505, pci_ss_list_1505},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1506, pci_vendor_1506, pci_ss_list_1506},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1507, pci_vendor_1507, pci_ss_list_1507},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1508, pci_vendor_1508, pci_ss_list_1508},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1509, pci_vendor_1509, pci_ss_list_1509},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150a, pci_vendor_150a, pci_ss_list_150a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150b, pci_vendor_150b, pci_ss_list_150b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150c, pci_vendor_150c, pci_ss_list_150c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150d, pci_vendor_150d, pci_ss_list_150d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150e, pci_vendor_150e, pci_ss_list_150e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x150f, pci_vendor_150f, pci_ss_list_150f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1510, pci_vendor_1510, pci_ss_list_1510},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1511, pci_vendor_1511, pci_ss_list_1511},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1512, pci_vendor_1512, pci_ss_list_1512},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1513, pci_vendor_1513, pci_ss_list_1513},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1514, pci_vendor_1514, pci_ss_list_1514},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1515, pci_vendor_1515, pci_ss_list_1515},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1516, pci_vendor_1516, pci_ss_list_1516},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1517, pci_vendor_1517, pci_ss_list_1517},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1518, pci_vendor_1518, pci_ss_list_1518},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1519, pci_vendor_1519, pci_ss_list_1519},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151a, pci_vendor_151a, pci_ss_list_151a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151b, pci_vendor_151b, pci_ss_list_151b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151c, pci_vendor_151c, pci_ss_list_151c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151d, pci_vendor_151d, pci_ss_list_151d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151e, pci_vendor_151e, pci_ss_list_151e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x151f, pci_vendor_151f, pci_ss_list_151f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1520, pci_vendor_1520, pci_ss_list_1520},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1521, pci_vendor_1521, pci_ss_list_1521},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1522, pci_vendor_1522, pci_ss_list_1522},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1523, pci_vendor_1523, pci_ss_list_1523},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1524, pci_vendor_1524, pci_ss_list_1524},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1525, pci_vendor_1525, pci_ss_list_1525},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1526, pci_vendor_1526, pci_ss_list_1526},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1527, pci_vendor_1527, pci_ss_list_1527},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1528, pci_vendor_1528, pci_ss_list_1528},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1529, pci_vendor_1529, pci_ss_list_1529},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152a, pci_vendor_152a, pci_ss_list_152a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152b, pci_vendor_152b, pci_ss_list_152b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152c, pci_vendor_152c, pci_ss_list_152c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152d, pci_vendor_152d, pci_ss_list_152d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152e, pci_vendor_152e, pci_ss_list_152e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x152f, pci_vendor_152f, pci_ss_list_152f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1530, pci_vendor_1530, pci_ss_list_1530},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1531, pci_vendor_1531, pci_ss_list_1531},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1532, pci_vendor_1532, pci_ss_list_1532},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1533, pci_vendor_1533, pci_ss_list_1533},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1534, pci_vendor_1534, pci_ss_list_1534},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1535, pci_vendor_1535, pci_ss_list_1535},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1537, pci_vendor_1537, pci_ss_list_1537},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1538, pci_vendor_1538, pci_ss_list_1538},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1539, pci_vendor_1539, pci_ss_list_1539},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153a, pci_vendor_153a, pci_ss_list_153a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153b, pci_vendor_153b, pci_ss_list_153b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153c, pci_vendor_153c, pci_ss_list_153c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153d, pci_vendor_153d, pci_ss_list_153d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153e, pci_vendor_153e, pci_ss_list_153e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x153f, pci_vendor_153f, pci_ss_list_153f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1540, pci_vendor_1540, pci_ss_list_1540},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1541, pci_vendor_1541, pci_ss_list_1541},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1542, pci_vendor_1542, pci_ss_list_1542},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1543, pci_vendor_1543, pci_ss_list_1543},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1544, pci_vendor_1544, pci_ss_list_1544},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1545, pci_vendor_1545, pci_ss_list_1545},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1546, pci_vendor_1546, pci_ss_list_1546},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1547, pci_vendor_1547, pci_ss_list_1547},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1548, pci_vendor_1548, pci_ss_list_1548},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1549, pci_vendor_1549, pci_ss_list_1549},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154a, pci_vendor_154a, pci_ss_list_154a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154b, pci_vendor_154b, pci_ss_list_154b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154c, pci_vendor_154c, pci_ss_list_154c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154d, pci_vendor_154d, pci_ss_list_154d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154e, pci_vendor_154e, pci_ss_list_154e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x154f, pci_vendor_154f, pci_ss_list_154f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1550, pci_vendor_1550, pci_ss_list_1550},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1551, pci_vendor_1551, pci_ss_list_1551},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1552, pci_vendor_1552, pci_ss_list_1552},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1553, pci_vendor_1553, pci_ss_list_1553},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1554, pci_vendor_1554, pci_ss_list_1554},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1555, pci_vendor_1555, pci_ss_list_1555},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1556, pci_vendor_1556, pci_ss_list_1556},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1557, pci_vendor_1557, pci_ss_list_1557},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1558, pci_vendor_1558, pci_ss_list_1558},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1559, pci_vendor_1559, pci_ss_list_1559},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155a, pci_vendor_155a, pci_ss_list_155a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155b, pci_vendor_155b, pci_ss_list_155b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155c, pci_vendor_155c, pci_ss_list_155c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155d, pci_vendor_155d, pci_ss_list_155d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155e, pci_vendor_155e, pci_ss_list_155e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x155f, pci_vendor_155f, pci_ss_list_155f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1560, pci_vendor_1560, pci_ss_list_1560},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1561, pci_vendor_1561, pci_ss_list_1561},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1562, pci_vendor_1562, pci_ss_list_1562},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1563, pci_vendor_1563, pci_ss_list_1563},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1564, pci_vendor_1564, pci_ss_list_1564},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1565, pci_vendor_1565, pci_ss_list_1565},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1566, pci_vendor_1566, pci_ss_list_1566},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1567, pci_vendor_1567, pci_ss_list_1567},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1568, pci_vendor_1568, pci_ss_list_1568},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1569, pci_vendor_1569, pci_ss_list_1569},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156a, pci_vendor_156a, pci_ss_list_156a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156b, pci_vendor_156b, pci_ss_list_156b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156c, pci_vendor_156c, pci_ss_list_156c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156d, pci_vendor_156d, pci_ss_list_156d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156e, pci_vendor_156e, pci_ss_list_156e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x156f, pci_vendor_156f, pci_ss_list_156f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1570, pci_vendor_1570, pci_ss_list_1570},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1571, pci_vendor_1571, pci_ss_list_1571},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1572, pci_vendor_1572, pci_ss_list_1572},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1573, pci_vendor_1573, pci_ss_list_1573},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1574, pci_vendor_1574, pci_ss_list_1574},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1575, pci_vendor_1575, pci_ss_list_1575},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1576, pci_vendor_1576, pci_ss_list_1576},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1578, pci_vendor_1578, pci_ss_list_1578},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1579, pci_vendor_1579, pci_ss_list_1579},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157a, pci_vendor_157a, pci_ss_list_157a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157b, pci_vendor_157b, pci_ss_list_157b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157c, pci_vendor_157c, pci_ss_list_157c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157d, pci_vendor_157d, pci_ss_list_157d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157e, pci_vendor_157e, pci_ss_list_157e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x157f, pci_vendor_157f, pci_ss_list_157f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1580, pci_vendor_1580, pci_ss_list_1580},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1581, pci_vendor_1581, pci_ss_list_1581},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1582, pci_vendor_1582, pci_ss_list_1582},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1583, pci_vendor_1583, pci_ss_list_1583},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1584, pci_vendor_1584, pci_ss_list_1584},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1585, pci_vendor_1585, pci_ss_list_1585},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1586, pci_vendor_1586, pci_ss_list_1586},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1587, pci_vendor_1587, pci_ss_list_1587},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1588, pci_vendor_1588, pci_ss_list_1588},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1589, pci_vendor_1589, pci_ss_list_1589},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158a, pci_vendor_158a, pci_ss_list_158a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158b, pci_vendor_158b, pci_ss_list_158b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158c, pci_vendor_158c, pci_ss_list_158c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158d, pci_vendor_158d, pci_ss_list_158d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158e, pci_vendor_158e, pci_ss_list_158e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x158f, pci_vendor_158f, pci_ss_list_158f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1590, pci_vendor_1590, pci_ss_list_1590},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1591, pci_vendor_1591, pci_ss_list_1591},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1592, pci_vendor_1592, pci_ss_list_1592},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1593, pci_vendor_1593, pci_ss_list_1593},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1594, pci_vendor_1594, pci_ss_list_1594},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1595, pci_vendor_1595, pci_ss_list_1595},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1596, pci_vendor_1596, pci_ss_list_1596},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1597, pci_vendor_1597, pci_ss_list_1597},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1598, pci_vendor_1598, pci_ss_list_1598},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1599, pci_vendor_1599, pci_ss_list_1599},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159a, pci_vendor_159a, pci_ss_list_159a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159b, pci_vendor_159b, pci_ss_list_159b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159c, pci_vendor_159c, pci_ss_list_159c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159d, pci_vendor_159d, pci_ss_list_159d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159e, pci_vendor_159e, pci_ss_list_159e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x159f, pci_vendor_159f, pci_ss_list_159f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a0, pci_vendor_15a0, pci_ss_list_15a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a1, pci_vendor_15a1, pci_ss_list_15a1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a2, pci_vendor_15a2, pci_ss_list_15a2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a3, pci_vendor_15a3, pci_ss_list_15a3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a4, pci_vendor_15a4, pci_ss_list_15a4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a5, pci_vendor_15a5, pci_ss_list_15a5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a6, pci_vendor_15a6, pci_ss_list_15a6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a7, pci_vendor_15a7, pci_ss_list_15a7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15a8, pci_vendor_15a8, pci_ss_list_15a8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15aa, pci_vendor_15aa, pci_ss_list_15aa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ab, pci_vendor_15ab, pci_ss_list_15ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ac, pci_vendor_15ac, pci_ss_list_15ac},
+#endif
+ {0x15ad, pci_vendor_15ad, pci_ss_list_15ad},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ae, pci_vendor_15ae, pci_ss_list_15ae},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b0, pci_vendor_15b0, pci_ss_list_15b0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b1, pci_vendor_15b1, pci_ss_list_15b1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b2, pci_vendor_15b2, pci_ss_list_15b2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b3, pci_vendor_15b3, pci_ss_list_15b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b4, pci_vendor_15b4, pci_ss_list_15b4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b5, pci_vendor_15b5, pci_ss_list_15b5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b6, pci_vendor_15b6, pci_ss_list_15b6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b7, pci_vendor_15b7, pci_ss_list_15b7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b8, pci_vendor_15b8, pci_ss_list_15b8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15b9, pci_vendor_15b9, pci_ss_list_15b9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ba, pci_vendor_15ba, pci_ss_list_15ba},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15bb, pci_vendor_15bb, pci_ss_list_15bb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15bc, pci_vendor_15bc, pci_ss_list_15bc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15bd, pci_vendor_15bd, pci_ss_list_15bd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15be, pci_vendor_15be, pci_ss_list_15be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15bf, pci_vendor_15bf, pci_ss_list_15bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c0, pci_vendor_15c0, pci_ss_list_15c0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c1, pci_vendor_15c1, pci_ss_list_15c1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c2, pci_vendor_15c2, pci_ss_list_15c2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c3, pci_vendor_15c3, pci_ss_list_15c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c4, pci_vendor_15c4, pci_ss_list_15c4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c5, pci_vendor_15c5, pci_ss_list_15c5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c6, pci_vendor_15c6, pci_ss_list_15c6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c7, pci_vendor_15c7, pci_ss_list_15c7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c8, pci_vendor_15c8, pci_ss_list_15c8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15c9, pci_vendor_15c9, pci_ss_list_15c9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ca, pci_vendor_15ca, pci_ss_list_15ca},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15cb, pci_vendor_15cb, pci_ss_list_15cb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15cc, pci_vendor_15cc, pci_ss_list_15cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15cd, pci_vendor_15cd, pci_ss_list_15cd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ce, pci_vendor_15ce, pci_ss_list_15ce},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15cf, pci_vendor_15cf, pci_ss_list_15cf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d1, pci_vendor_15d1, pci_ss_list_15d1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d2, pci_vendor_15d2, pci_ss_list_15d2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d3, pci_vendor_15d3, pci_ss_list_15d3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d4, pci_vendor_15d4, pci_ss_list_15d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d5, pci_vendor_15d5, pci_ss_list_15d5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d6, pci_vendor_15d6, pci_ss_list_15d6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d7, pci_vendor_15d7, pci_ss_list_15d7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d8, pci_vendor_15d8, pci_ss_list_15d8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15d9, pci_vendor_15d9, pci_ss_list_15d9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15da, pci_vendor_15da, pci_ss_list_15da},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15db, pci_vendor_15db, pci_ss_list_15db},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15dc, pci_vendor_15dc, pci_ss_list_15dc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15dd, pci_vendor_15dd, pci_ss_list_15dd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15de, pci_vendor_15de, pci_ss_list_15de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15df, pci_vendor_15df, pci_ss_list_15df},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e0, pci_vendor_15e0, pci_ss_list_15e0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e1, pci_vendor_15e1, pci_ss_list_15e1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e2, pci_vendor_15e2, pci_ss_list_15e2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e3, pci_vendor_15e3, pci_ss_list_15e3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e4, pci_vendor_15e4, pci_ss_list_15e4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e5, pci_vendor_15e5, pci_ss_list_15e5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e6, pci_vendor_15e6, pci_ss_list_15e6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e7, pci_vendor_15e7, pci_ss_list_15e7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e8, pci_vendor_15e8, pci_ss_list_15e8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15e9, pci_vendor_15e9, pci_ss_list_15e9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ea, pci_vendor_15ea, pci_ss_list_15ea},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15eb, pci_vendor_15eb, pci_ss_list_15eb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ec, pci_vendor_15ec, pci_ss_list_15ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ed, pci_vendor_15ed, pci_ss_list_15ed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ee, pci_vendor_15ee, pci_ss_list_15ee},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ef, pci_vendor_15ef, pci_ss_list_15ef},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f0, pci_vendor_15f0, pci_ss_list_15f0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f1, pci_vendor_15f1, pci_ss_list_15f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f2, pci_vendor_15f2, pci_ss_list_15f2},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f3, pci_vendor_15f3, pci_ss_list_15f3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f4, pci_vendor_15f4, pci_ss_list_15f4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f5, pci_vendor_15f5, pci_ss_list_15f5},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f6, pci_vendor_15f6, pci_ss_list_15f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f7, pci_vendor_15f7, pci_ss_list_15f7},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f8, pci_vendor_15f8, pci_ss_list_15f8},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15f9, pci_vendor_15f9, pci_ss_list_15f9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fa, pci_vendor_15fa, pci_ss_list_15fa},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fb, pci_vendor_15fb, pci_ss_list_15fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fc, pci_vendor_15fc, pci_ss_list_15fc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fd, pci_vendor_15fd, pci_ss_list_15fd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15fe, pci_vendor_15fe, pci_ss_list_15fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x15ff, pci_vendor_15ff, pci_ss_list_15ff},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1600, pci_vendor_1600, pci_ss_list_1600},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1601, pci_vendor_1601, pci_ss_list_1601},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1602, pci_vendor_1602, pci_ss_list_1602},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1603, pci_vendor_1603, pci_ss_list_1603},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1604, pci_vendor_1604, pci_ss_list_1604},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1605, pci_vendor_1605, pci_ss_list_1605},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1606, pci_vendor_1606, pci_ss_list_1606},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1607, pci_vendor_1607, pci_ss_list_1607},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1608, pci_vendor_1608, pci_ss_list_1608},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1609, pci_vendor_1609, pci_ss_list_1609},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1612, pci_vendor_1612, pci_ss_list_1612},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1619, pci_vendor_1619, pci_ss_list_1619},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1629, pci_vendor_1629, pci_ss_list_1629},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1638, pci_vendor_1638, pci_ss_list_1638},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x163c, pci_vendor_163c, pci_ss_list_163c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1657, pci_vendor_1657, pci_ss_list_1657},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x165a, pci_vendor_165a, pci_ss_list_165a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x165d, pci_vendor_165d, pci_ss_list_165d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1661, pci_vendor_1661, pci_ss_list_1661},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1668, pci_vendor_1668, pci_ss_list_1668},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1681, pci_vendor_1681, pci_ss_list_1681},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16ab, pci_vendor_16ab, pci_ss_list_16ab},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16be, pci_vendor_16be, pci_ss_list_16be},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16ec, pci_vendor_16ec, pci_ss_list_16ec},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x16f6, pci_vendor_16f6, pci_ss_list_16f6},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1705, pci_vendor_1705, pci_ss_list_1705},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x170b, pci_vendor_170b, pci_ss_list_170b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x170c, pci_vendor_170c, pci_ss_list_170c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x172a, pci_vendor_172a, pci_ss_list_172a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1737, pci_vendor_1737, pci_ss_list_1737},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x173b, pci_vendor_173b, pci_ss_list_173b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1743, pci_vendor_1743, pci_ss_list_1743},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x174b, pci_vendor_174b, pci_ss_list_174b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x175e, pci_vendor_175e, pci_ss_list_175e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1787, pci_vendor_1787, pci_ss_list_1787},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1796, pci_vendor_1796, pci_ss_list_1796},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1799, pci_vendor_1799, pci_ss_list_1799},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x17af, pci_vendor_17af, pci_ss_list_17af},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x17cc, pci_vendor_17cc, pci_ss_list_17cc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1813, pci_vendor_1813, pci_ss_list_1813},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1851, pci_vendor_1851, pci_ss_list_1851},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1852, pci_vendor_1852, pci_ss_list_1852},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1888, pci_vendor_1888, pci_ss_list_1888},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1a08, pci_vendor_1a08, pci_ss_list_1a08},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1b13, pci_vendor_1b13, pci_ss_list_1b13},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1c1c, pci_vendor_1c1c, pci_ss_list_1c1c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1d44, pci_vendor_1d44, pci_ss_list_1d44},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x1de1, pci_vendor_1de1, pci_ss_list_1de1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2000, pci_vendor_2000, pci_ss_list_2000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2001, pci_vendor_2001, pci_ss_list_2001},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2003, pci_vendor_2003, pci_ss_list_2003},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2004, pci_vendor_2004, pci_ss_list_2004},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x21c3, pci_vendor_21c3, pci_ss_list_21c3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2348, pci_vendor_2348, pci_ss_list_2348},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2646, pci_vendor_2646, pci_ss_list_2646},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x270b, pci_vendor_270b, pci_ss_list_270b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x270f, pci_vendor_270f, pci_ss_list_270f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2711, pci_vendor_2711, pci_ss_list_2711},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x2a15, pci_vendor_2a15, pci_ss_list_2a15},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3000, pci_vendor_3000, pci_ss_list_3000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3142, pci_vendor_3142, pci_ss_list_3142},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3388, pci_vendor_3388, pci_ss_list_3388},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3411, pci_vendor_3411, pci_ss_list_3411},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x3513, pci_vendor_3513, pci_ss_list_3513},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x38ef, pci_vendor_38ef, pci_ss_list_38ef},
+#endif
+ {0x3d3d, pci_vendor_3d3d, pci_ss_list_3d3d},
+ {0x4005, pci_vendor_4005, pci_ss_list_4005},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4033, pci_vendor_4033, pci_ss_list_4033},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4143, pci_vendor_4143, pci_ss_list_4143},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x416c, pci_vendor_416c, pci_ss_list_416c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4444, pci_vendor_4444, pci_ss_list_4444},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4468, pci_vendor_4468, pci_ss_list_4468},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4594, pci_vendor_4594, pci_ss_list_4594},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x45fb, pci_vendor_45fb, pci_ss_list_45fb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4680, pci_vendor_4680, pci_ss_list_4680},
+#endif
+ {0x4843, pci_vendor_4843, pci_ss_list_4843},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4916, pci_vendor_4916, pci_ss_list_4916},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4943, pci_vendor_4943, pci_ss_list_4943},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4978, pci_vendor_4978, pci_ss_list_4978},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4a14, pci_vendor_4a14, pci_ss_list_4a14},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4b10, pci_vendor_4b10, pci_ss_list_4b10},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4c48, pci_vendor_4c48, pci_ss_list_4c48},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4c53, pci_vendor_4c53, pci_ss_list_4c53},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4ca1, pci_vendor_4ca1, pci_ss_list_4ca1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4d51, pci_vendor_4d51, pci_ss_list_4d51},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4d54, pci_vendor_4d54, pci_ss_list_4d54},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x4ddc, pci_vendor_4ddc, pci_ss_list_4ddc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5046, pci_vendor_5046, pci_ss_list_5046},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5053, pci_vendor_5053, pci_ss_list_5053},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5136, pci_vendor_5136, pci_ss_list_5136},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5143, pci_vendor_5143, pci_ss_list_5143},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5145, pci_vendor_5145, pci_ss_list_5145},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5168, pci_vendor_5168, pci_ss_list_5168},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5301, pci_vendor_5301, pci_ss_list_5301},
+#endif
+ {0x5333, pci_vendor_5333, pci_ss_list_5333},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x544c, pci_vendor_544c, pci_ss_list_544c},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5455, pci_vendor_5455, pci_ss_list_5455},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5519, pci_vendor_5519, pci_ss_list_5519},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5544, pci_vendor_5544, pci_ss_list_5544},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5555, pci_vendor_5555, pci_ss_list_5555},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5654, pci_vendor_5654, pci_ss_list_5654},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x5700, pci_vendor_5700, pci_ss_list_5700},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x6356, pci_vendor_6356, pci_ss_list_6356},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x6374, pci_vendor_6374, pci_ss_list_6374},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x6409, pci_vendor_6409, pci_ss_list_6409},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x6666, pci_vendor_6666, pci_ss_list_6666},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x7604, pci_vendor_7604, pci_ss_list_7604},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x7bde, pci_vendor_7bde, pci_ss_list_7bde},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x7fed, pci_vendor_7fed, pci_ss_list_7fed},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8008, pci_vendor_8008, pci_ss_list_8008},
+#endif
+ {0x8086, pci_vendor_8086, pci_ss_list_8086},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8800, pci_vendor_8800, pci_ss_list_8800},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8866, pci_vendor_8866, pci_ss_list_8866},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8888, pci_vendor_8888, pci_ss_list_8888},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8e0e, pci_vendor_8e0e, pci_ss_list_8e0e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x8e2e, pci_vendor_8e2e, pci_ss_list_8e2e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9004, pci_vendor_9004, pci_ss_list_9004},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9005, pci_vendor_9005, pci_ss_list_9005},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x907f, pci_vendor_907f, pci_ss_list_907f},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x919a, pci_vendor_919a, pci_ss_list_919a},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9412, pci_vendor_9412, pci_ss_list_9412},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9699, pci_vendor_9699, pci_ss_list_9699},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0x9710, pci_vendor_9710, pci_ss_list_9710},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa0a0, pci_vendor_a0a0, pci_ss_list_a0a0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa0f1, pci_vendor_a0f1, pci_ss_list_a0f1},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa200, pci_vendor_a200, pci_ss_list_a200},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa259, pci_vendor_a259, pci_ss_list_a259},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa25b, pci_vendor_a25b, pci_ss_list_a25b},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa304, pci_vendor_a304, pci_ss_list_a304},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xa727, pci_vendor_a727, pci_ss_list_a727},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xaa42, pci_vendor_aa42, pci_ss_list_aa42},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xac1e, pci_vendor_ac1e, pci_ss_list_ac1e},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xb1b3, pci_vendor_b1b3, pci_ss_list_b1b3},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xbd11, pci_vendor_bd11, pci_ss_list_bd11},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xc001, pci_vendor_c001, pci_ss_list_c001},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xc0a9, pci_vendor_c0a9, pci_ss_list_c0a9},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xc0de, pci_vendor_c0de, pci_ss_list_c0de},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xc0fe, pci_vendor_c0fe, pci_ss_list_c0fe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xca50, pci_vendor_ca50, pci_ss_list_ca50},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xcafe, pci_vendor_cafe, pci_ss_list_cafe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xcccc, pci_vendor_cccc, pci_ss_list_cccc},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xcddd, pci_vendor_cddd, pci_ss_list_cddd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xd4d4, pci_vendor_d4d4, pci_ss_list_d4d4},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xd531, pci_vendor_d531, pci_ss_list_d531},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xd84d, pci_vendor_d84d, pci_ss_list_d84d},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xdead, pci_vendor_dead, pci_ss_list_dead},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xe000, pci_vendor_e000, pci_ss_list_e000},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xe159, pci_vendor_e159, pci_ss_list_e159},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xe4bf, pci_vendor_e4bf, pci_ss_list_e4bf},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xea01, pci_vendor_ea01, pci_ss_list_ea01},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xea60, pci_vendor_ea60, pci_ss_list_ea60},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xeabb, pci_vendor_eabb, pci_ss_list_eabb},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xeace, pci_vendor_eace, pci_ss_list_eace},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xec80, pci_vendor_ec80, pci_ss_list_ec80},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xecc0, pci_vendor_ecc0, pci_ss_list_ecc0},
+#endif
+ {0xedd8, pci_vendor_edd8, pci_ss_list_edd8},
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xf1d0, pci_vendor_f1d0, pci_ss_list_f1d0},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xfa57, pci_vendor_fa57, pci_ss_list_fa57},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xfebd, pci_vendor_febd, pci_ss_list_febd},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xfeda, pci_vendor_feda, pci_ss_list_feda},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xfffe, pci_vendor_fffe, pci_ss_list_fffe},
+#endif
+#ifdef VENDOR_INCLUDE_NONVIDEO
+ {0xffff, pci_vendor_ffff, pci_ss_list_ffff},
+#endif
+ {0x0000, NULL, NULL}
+};
+#endif
diff --git a/hw/xfree86/scanpci/xf86PciStr.h b/hw/xfree86/scanpci/xf86PciStr.h
new file mode 100644
index 000000000..4704a0c31
--- /dev/null
+++ b/hw/xfree86/scanpci/xf86PciStr.h
@@ -0,0 +1,41 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86PciStr.h,v 1.1 2002/07/15 20:46:04 dawes Exp $ */
+
+/*
+ * Copyright © 2002 by The XFree86 Project, Inc
+ */
+
+/*
+ * Structs used to hold the pre-parsed pci.ids data. These are private
+ * to the scanpci and pcidata modules.
+ */
+
+#ifndef _XF86_PCISTR_H
+#define _XF86_PCISTR_H
+
+typedef struct {
+ unsigned short VendorID;
+ unsigned short SubsystemID;
+ const char *SubsystemName;
+ unsigned short class;
+} pciSubsystemInfo;
+
+typedef struct {
+ unsigned short DeviceID;
+ const char *DeviceName;
+ const pciSubsystemInfo **Subsystem;
+ unsigned short class;
+} pciDeviceInfo;
+
+typedef struct {
+ unsigned short VendorID;
+ const char *VendorName;
+ const pciDeviceInfo **Device;
+} pciVendorInfo;
+
+typedef struct {
+ unsigned short VendorID;
+ const char *VendorName;
+ const pciSubsystemInfo **Subsystem;
+} pciVendorSubsysInfo;
+
+#endif /* _XF86_PCISTR_H */
diff --git a/hw/xfree86/scanpci/xf86ScanPci.c b/hw/xfree86/scanpci/xf86ScanPci.c
new file mode 100644
index 000000000..0370a6e5f
--- /dev/null
+++ b/hw/xfree86/scanpci/xf86ScanPci.c
@@ -0,0 +1,389 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.c,v 1.12 2002/07/15 20:46:04 dawes Exp $ */
+/*
+ * Display the Subsystem Vendor Id and Subsystem Id in order to identify
+ * the cards installed in this computer
+ *
+ * Copyright 1995-2002 by The XFree86 Project, Inc.
+ *
+ * A lot of this comes from Robin Cutshaw's scanpci
+ *
+ */
+
+
+/*
+ * This file is used to build both the scanpci and pcidata modules.
+ * The interfaces have changed compared with XFree86 4.2.0 and earlier.
+ * The data is no longer exported directly. Lookup functions are provided.
+ * This means that the data format can change in the future without affecting
+ * the exported interfaces.
+ *
+ * The namespaces for pcidata and scanpci clash, so both modules can't be
+ * loaded at the same time. The X server should only load the scanpci module
+ * when run with the '-scanpci' flag. The main difference between the
+ * two modules is size. pcidata only holds the subset of data that is
+ * "interesting" to the X server. "Interesting" is determined by the
+ * PCI_VENDOR_* defines in ../common/xf86PciInfo.h.
+ */
+
+
+/* XXX This is including a lot of stuff that modules should not include! */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86Pci.h"
+#include "xf86_OSproc.h"
+
+#ifndef IN_MODULE
+#include <ctype.h>
+#include <stdlib.h>
+#else
+#include <xf86_ansic.h>
+#endif
+
+#ifndef PCIDATA
+#define VENDOR_INCLUDE_NONVIDEO
+#endif
+#define INIT_SUBSYS_INFO
+#define INIT_VENDOR_SUBSYS_INFO
+
+#include "xf86PciStr.h"
+#include "xf86PciIds.h"
+#include "xf86ScanPci.h"
+
+/*
+ * PCI classes that have messages printed always. The others are only
+ * have a message printed when the vendor/dev IDs are recognised.
+ */
+#define PCIALWAYSPRINTCLASSES(b,s) \
+ (((b) == PCI_CLASS_PREHISTORIC && (s) == PCI_SUBCLASS_PREHISTORIC_VGA) || \
+ ((b) == PCI_CLASS_DISPLAY) || \
+ ((b) == PCI_CLASS_MULTIMEDIA && (s) == PCI_SUBCLASS_MULTIMEDIA_VIDEO))
+
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+
+#ifdef PCIDATA
+
+static XF86ModuleVersionInfo pciDataVersRec = {
+ "pcidata",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ NULL,
+ {0, 0, 0, 0}
+};
+
+XF86ModuleData pcidataModuleData = { &pciDataVersRec, NULL, NULL };
+
+#else
+
+static XF86ModuleVersionInfo scanPciVersRec = {
+ "scanpci",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ NULL,
+ {0, 0, 0, 0}
+};
+
+XF86ModuleData scanpciModuleData = { &scanPciVersRec, NULL, NULL };
+
+#endif /* PCIDATA */
+
+#endif /* XFree86LOADER */
+
+/* Initialisation/Close hooks, in case they're ever needed. */
+Bool
+ScanPciSetupPciIds(void)
+{
+ return TRUE;
+}
+
+void
+ScanPciClosePciIds(void)
+{
+ return;
+}
+
+/*
+ * The return value is the number of strings found, or -1 for an error.
+ * Requested strings that aren't found are set to NULL.
+ */
+
+int
+ScanPciFindPciNamesByDevice(unsigned short vendor, unsigned short device,
+ unsigned short svendor, unsigned short subsys,
+ const char **vname, const char **dname,
+ const char **svname, const char **sname)
+{
+ int i, j, k;
+ const pciDeviceInfo **pDev;
+ const pciSubsystemInfo **pSub;
+
+ /* It's an error to not provide the Vendor */
+ if (vendor == NOVENDOR)
+ return -1;
+
+ /* Initialise returns requested/provided to NULL */
+ if (vname)
+ *vname = NULL;
+ if (device != NODEVICE && dname)
+ *dname = NULL;
+ if (svendor != NOVENDOR && svname)
+ *svname = NULL;
+ if (subsys != NOSUBSYS && sname)
+ *sname = NULL;
+
+ for (i = 0; pciVendorInfoList[i].VendorName; i++) {
+ if (vendor == pciVendorInfoList[i].VendorID) {
+ if (vname) {
+ *vname = pciVendorInfoList[i].VendorName;
+ }
+ if (device == NODEVICE) {
+ return 1;
+ }
+ pDev = pciVendorInfoList[i].Device;
+ if (!pDev) {
+ return 1;
+ }
+ for (j = 0; pDev[j]; j++) {
+ if (device == pDev[j]->DeviceID) {
+ if (dname) {
+ *dname = pDev[j]->DeviceName;
+ }
+ if (svendor == NOVENDOR) {
+ return 2;
+ }
+ for (k = 0; pciVendorInfoList[k].VendorName; k++) {
+ if (svendor == pciVendorInfoList[k].VendorID) {
+ if (svname) {
+ *svname = pciVendorInfoList[k].VendorName;
+ }
+ if (subsys == NOSUBSYS) {
+ return 3;
+ }
+ break;
+ }
+ }
+ if (!pciVendorInfoList[k].VendorName) {
+ return 2;
+ }
+ pSub = pDev[j]->Subsystem;
+ if (!pSub) {
+ return 3;
+ }
+ for (k = 0; pSub[k]; k++) {
+ if (svendor == pSub[k]->VendorID &&
+ subsys == pSub[k]->SubsystemID) {
+ if (sname)
+ *sname = pSub[k]->SubsystemName;
+ return 4;
+ }
+ }
+ /* No vendor/subsys match */
+ return 3;
+ }
+ }
+ /* No device match */
+ return 1;
+ }
+ }
+ /* No vendor match */
+ return 0;
+}
+
+Bool
+ScanPciFindPciNamesBySubsys(unsigned short svendor, unsigned short subsys,
+ const char **svname, const char **sname)
+{
+ int i, j;
+ const pciSubsystemInfo **pSub;
+
+ /* It's an error to not provide the Vendor */
+ if (svendor == NOVENDOR)
+ return -1;
+
+ /* Initialise returns requested/provided to NULL */
+ if (svname)
+ *svname = NULL;
+ if (subsys != NOSUBSYS && sname)
+ *sname = NULL;
+
+ for (i = 0; pciVendorSubsysInfoList[i].VendorName; i++) {
+ if (svendor == pciVendorSubsysInfoList[i].VendorID) {
+ if (svname) {
+ *svname = pciVendorSubsysInfoList[i].VendorName;
+ }
+ if (subsys == NOSUBSYS) {
+ return 1;
+ }
+ pSub = pciVendorSubsysInfoList[i].Subsystem;
+ if (!pSub) {
+ return 1;
+ }
+ for (j = 0; pSub[j]; j++) {
+ if (subsys == pSub[j]->SubsystemID) {
+ if (sname) {
+ *sname = pSub[j]->SubsystemName;
+ }
+ }
+ }
+ /* No subsys match */
+ return 1;
+ }
+ }
+ /* No vendor match */
+ return 0;
+}
+
+CARD32
+ScanPciFindPciClassBySubsys(unsigned short vendor, unsigned short subsys)
+{
+ int i, j;
+ const pciSubsystemInfo **pSub;
+
+ if (vendor == NOVENDOR || subsys == NOSUBSYS)
+ return 0;
+
+ for (i = 0; pciVendorSubsysInfoList[i].VendorName; i++) {
+ if (vendor == pciVendorSubsysInfoList[i].VendorID) {
+ pSub = pciVendorSubsysInfoList[i].Subsystem;
+ if (!pSub) {
+ return 0;
+ }
+ for (j = 0; pSub[j]; j++) {
+ if (subsys == pSub[j]->SubsystemID) {
+ return pSub[j]->class;
+ }
+ }
+ break;
+ }
+ }
+ return 0;
+}
+
+CARD32
+ScanPciFindPciClassByDevice(unsigned short vendor, unsigned short device)
+{
+ int i, j;
+ const pciDeviceInfo **pDev;
+
+ if (vendor == NOVENDOR || device == NODEVICE)
+ return 0;
+
+ for (i = 0; pciVendorInfoList[i].VendorName; i++) {
+ if (vendor == pciVendorInfoList[i].VendorID) {
+ pDev = pciVendorInfoList[i].Device;
+ if (!pDev) {
+ return 0;
+ }
+ for (j = 0; pDev[j]; j++) {
+ if (device == pDev[j]->DeviceID) {
+ return pDev[j]->class;
+ }
+ }
+ break;
+ }
+ }
+ return 0;
+}
+
+#ifndef PCIDATA
+void
+ScanPciDisplayPCICardInfo(int verbosity)
+{
+ pciConfigPtr pcrp, *pcrpp;
+ int i;
+
+ xf86EnableIO();
+ pcrpp = xf86scanpci(0);
+
+ if (pcrpp == NULL) {
+ xf86MsgVerb(X_NONE,0,"No PCI info available\n");
+ return;
+ }
+ xf86MsgVerb(X_NONE,0,"Probing for PCI devices (Bus:Device:Function)\n\n");
+ for (i = 0; (pcrp = pcrpp[i]); i++) {
+ const char *svendorname = NULL, *subsysname = NULL;
+ const char *vendorname = NULL, *devicename = NULL;
+ Bool noCard = FALSE;
+ const char *prefix1 = "", *prefix2 = "";
+
+ xf86MsgVerb(X_NONE, -verbosity, "(%d:%d:%d) ",
+ pcrp->busnum, pcrp->devnum, pcrp->funcnum);
+
+ /*
+ * Lookup as much as we can about the device.
+ */
+ if (pcrp->pci_subsys_vendor || pcrp->pci_subsys_card) {
+ ScanPciFindPciNamesByDevice(pcrp->pci_vendor, pcrp->pci_device,
+ NOVENDOR, NOSUBSYS,
+ &vendorname, &devicename, NULL, NULL);
+ } else {
+ ScanPciFindPciNamesByDevice(pcrp->pci_vendor, pcrp->pci_device,
+ pcrp->pci_subsys_vendor,
+ pcrp->pci_subsys_card,
+ &vendorname, &devicename,
+ &svendorname, &subsysname);
+ }
+
+ if (svendorname)
+ xf86MsgVerb(X_NONE, -verbosity, "%s ", svendorname);
+ if (subsysname)
+ xf86MsgVerb(X_NONE, -verbosity, "%s ", subsysname);
+ if (svendorname && !subsysname) {
+ if (pcrp->pci_subsys_card && pcrp->pci_subsys_card != NOSUBSYS) {
+ xf86MsgVerb(X_NONE, -verbosity, "unknown card (0x%04x) ",
+ pcrp->pci_subsys_card);
+ } else {
+ xf86MsgVerb(X_NONE, -verbosity, "card ");
+ }
+ }
+ if (!svendorname && !subsysname) {
+ /*
+ * We didn't find a text representation of the information
+ * about the card.
+ */
+ if (pcrp->pci_subsys_vendor || pcrp->pci_subsys_card) {
+ /*
+ * If there was information and we just couldn't interpret
+ * it, print it out as unknown, anyway.
+ */
+ xf86MsgVerb(X_NONE, -verbosity,
+ "unknown card (0x%04x/0x%04x) ",
+ pcrp->pci_subsys_vendor, pcrp->pci_subsys_card);
+ } else
+ noCard = TRUE;
+ }
+ if (!noCard) {
+ prefix1 = "using a ";
+ prefix2 = "using an ";
+ }
+ if (vendorname && devicename) {
+ xf86MsgVerb(X_NONE, -verbosity,"%s%s %s\n", prefix1, vendorname,
+ devicename);
+ } else if (vendorname) {
+ xf86MsgVerb(X_NONE, -verbosity,
+ "%sunknown chip (DeviceId 0x%04x) from %s\n",
+ prefix2, pcrp->pci_device, vendorname);
+ } else {
+ xf86MsgVerb(X_NONE, -verbosity,
+ "%sunknown chipset(0x%04x/0x%04x)\n",
+ prefix2, pcrp->pci_vendor, pcrp->pci_device);
+ }
+ }
+}
+#endif
+
diff --git a/hw/xfree86/scanpci/xf86ScanPci.h b/hw/xfree86/scanpci/xf86ScanPci.h
new file mode 100644
index 000000000..8dba8937d
--- /dev/null
+++ b/hw/xfree86/scanpci/xf86ScanPci.h
@@ -0,0 +1,21 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/scanpci/xf86ScanPci.h,v 1.2 2002/07/15 20:46:04 dawes Exp $ */
+
+
+
+#ifndef SCANPCI_H_
+#define SCANPCI_H_
+
+#include "xf86PciData.h"
+
+typedef void (*ScanPciDisplayCardInfoProcPtr)(int verbosity);
+
+/*
+ * Whoever loads this module needs to define these and initialise them
+ * after loading.
+ */
+
+extern ScanPciDisplayCardInfoProcPtr xf86DisplayPCICardInfo;
+
+void ScanPciDisplayPCICardInfo(int verbosity);
+
+#endif
diff --git a/hw/xfree86/shadowfb/sfbmodule.c b/hw/xfree86/shadowfb/sfbmodule.c
new file mode 100644
index 000000000..3bb14b0a9
--- /dev/null
+++ b/hw/xfree86/shadowfb/sfbmodule.c
@@ -0,0 +1,24 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/sfbmodule.c,v 1.2 1999/02/01 12:08:45 dawes Exp $ */
+
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "shadowfb",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData shadowfbModuleData = { &VersRec, NULL, NULL };
+
+#endif
diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c
new file mode 100644
index 000000000..065885abc
--- /dev/null
+++ b/hw/xfree86/shadowfb/shadow.c
@@ -0,0 +1,1820 @@
+/*
+ Copyright (C) 1999. The XFree86 Project Inc.
+
+ Written by Mark Vojkovich (mvojkovi@ucsd.edu)
+
+ Pre-fb-write callbacks and RENDER support - Nolan Leake (nolan@vmware.com)
+*/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/shadow.c,v 1.18.2.1 2003/04/15 20:32:29 sven Exp $ */
+
+#include "X.h"
+#include "Xproto.h"
+#include "misc.h"
+#include "pixmapstr.h"
+#include "input.h"
+#include "font.h"
+#include "mi.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "gcstruct.h"
+#include "dixfontstr.h"
+#include "fontstruct.h"
+#include "xf86.h"
+#include "xf86str.h"
+#include "shadowfb.h"
+
+#ifdef RENDER
+# include "picturestr.h"
+#endif
+
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define MAX(a,b) (((a)>(b))?(a):(b))
+
+static Bool ShadowCloseScreen (int i, ScreenPtr pScreen);
+static void ShadowRestoreAreas (
+ PixmapPtr pPixmap,
+ RegionPtr prgn,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+static void ShadowPaintWindow (
+ WindowPtr pWin,
+ RegionPtr prgn,
+ int what
+);
+static void ShadowCopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgn
+);
+static Bool ShadowCreateGC(GCPtr pGC);
+static Bool ShadowModifyPixmapHeader(
+ PixmapPtr pPixmap,
+ int width,
+ int height,
+ int depth,
+ int bitsPerPixel,
+ int devKind,
+ pointer pPixData
+);
+
+static Bool ShadowEnterVT(int index, int flags);
+static void ShadowLeaveVT(int index, int flags);
+
+#ifdef RENDER
+static void ShadowComposite(
+ CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height
+);
+#endif /* RENDER */
+
+
+typedef struct {
+ ScrnInfoPtr pScrn;
+ RefreshAreaFuncPtr preRefresh;
+ RefreshAreaFuncPtr postRefresh;
+ CloseScreenProcPtr CloseScreen;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ CopyWindowProcPtr CopyWindow;
+ CreateGCProcPtr CreateGC;
+ BackingStoreRestoreAreasProcPtr RestoreAreas;
+ ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
+#ifdef RENDER
+ CompositeProcPtr Composite;
+#endif /* RENDER */
+ Bool (*EnterVT)(int, int);
+ void (*LeaveVT)(int, int);
+ Bool vtSema;
+} ShadowScreenRec, *ShadowScreenPtr;
+
+typedef struct {
+ GCOps *ops;
+ GCFuncs *funcs;
+} ShadowGCRec, *ShadowGCPtr;
+
+
+static int ShadowScreenIndex = -1;
+static int ShadowGCIndex = -1;
+static unsigned long ShadowGeneration = 0;
+
+#define GET_SCREEN_PRIVATE(pScreen) \
+ (ShadowScreenPtr)((pScreen)->devPrivates[ShadowScreenIndex].ptr)
+#define GET_GC_PRIVATE(pGC) \
+ (ShadowGCPtr)((pGC)->devPrivates[ShadowGCIndex].ptr)
+
+#define SHADOW_GC_FUNC_PROLOGUE(pGC)\
+ ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);\
+ (pGC)->funcs = pGCPriv->funcs;\
+ if(pGCPriv->ops)\
+ (pGC)->ops = pGCPriv->ops
+
+#define SHADOW_GC_FUNC_EPILOGUE(pGC)\
+ pGCPriv->funcs = (pGC)->funcs;\
+ (pGC)->funcs = &ShadowGCFuncs;\
+ if(pGCPriv->ops) {\
+ pGCPriv->ops = (pGC)->ops;\
+ (pGC)->ops = &ShadowGCOps;\
+ }
+
+#define SHADOW_GC_OP_PROLOGUE(pGC)\
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pGC->pScreen); \
+ ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);\
+ GCFuncs *oldFuncs = pGC->funcs;\
+ pGC->funcs = pGCPriv->funcs;\
+ pGC->ops = pGCPriv->ops
+
+
+#define SHADOW_GC_OP_EPILOGUE(pGC)\
+ pGCPriv->ops = pGC->ops;\
+ pGC->funcs = oldFuncs;\
+ pGC->ops = &ShadowGCOps
+
+#define IS_VISIBLE(pWin) (pPriv->vtSema && \
+ (((WindowPtr)pWin)->visibility != VisibilityFullyObscured))
+
+#define TRIM_BOX(box, pGC) { \
+ BoxPtr extents = &pGC->pCompositeClip->extents;\
+ if(box.x1 < extents->x1) box.x1 = extents->x1; \
+ if(box.x2 > extents->x2) box.x2 = extents->x2; \
+ if(box.y1 < extents->y1) box.y1 = extents->y1; \
+ if(box.y2 > extents->y2) box.y2 = extents->y2; \
+ }
+
+#define TRANSLATE_BOX(box, pDraw) { \
+ box.x1 += pDraw->x; \
+ box.x2 += pDraw->x; \
+ box.y1 += pDraw->y; \
+ box.y2 += pDraw->y; \
+ }
+
+#define TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC) { \
+ TRANSLATE_BOX(box, pDraw); \
+ TRIM_BOX(box, pGC); \
+ }
+
+#define BOX_NOT_EMPTY(box) \
+ (((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
+
+
+
+Bool
+ShadowFBInit2 (
+ ScreenPtr pScreen,
+ RefreshAreaFuncPtr preRefreshArea,
+ RefreshAreaFuncPtr postRefreshArea
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ShadowScreenPtr pPriv;
+#ifdef RENDER
+ PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+#endif /* RENDER */
+
+ if(!preRefreshArea && !postRefreshArea) return FALSE;
+
+ if (ShadowGeneration != serverGeneration) {
+ if(((ShadowScreenIndex = AllocateScreenPrivateIndex ()) < 0) ||
+ ((ShadowGCIndex = AllocateGCPrivateIndex()) < 0))
+ return FALSE;
+ ShadowGeneration = serverGeneration;
+ }
+
+ if(!AllocateGCPrivate(pScreen, ShadowGCIndex, sizeof(ShadowGCRec)))
+ return FALSE;
+
+ if(!(pPriv = (ShadowScreenPtr)xalloc(sizeof(ShadowScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[ShadowScreenIndex].ptr = (pointer)pPriv;
+
+ pPriv->pScrn = pScrn;
+ pPriv->preRefresh = preRefreshArea;
+ pPriv->postRefresh = postRefreshArea;
+ pPriv->vtSema = TRUE;
+
+ pPriv->CloseScreen = pScreen->CloseScreen;
+ pPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
+ pPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
+ pPriv->CopyWindow = pScreen->CopyWindow;
+ pPriv->CreateGC = pScreen->CreateGC;
+ pPriv->RestoreAreas = pScreen->BackingStoreFuncs.RestoreAreas;
+ pPriv->ModifyPixmapHeader = pScreen->ModifyPixmapHeader;
+
+ pPriv->EnterVT = pScrn->EnterVT;
+ pPriv->LeaveVT = pScrn->LeaveVT;
+
+ pScreen->CloseScreen = ShadowCloseScreen;
+ pScreen->PaintWindowBackground = ShadowPaintWindow;
+ pScreen->PaintWindowBorder = ShadowPaintWindow;
+ pScreen->CopyWindow = ShadowCopyWindow;
+ pScreen->CreateGC = ShadowCreateGC;
+ pScreen->BackingStoreFuncs.RestoreAreas = ShadowRestoreAreas;
+ pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader;
+
+ pScrn->EnterVT = ShadowEnterVT;
+ pScrn->LeaveVT = ShadowLeaveVT;
+
+#ifdef RENDER
+ if(ps) {
+ pPriv->Composite = ps->Composite;
+ ps->Composite = ShadowComposite;
+ }
+#endif /* RENDER */
+
+ return TRUE;
+}
+
+Bool
+ShadowFBInit (
+ ScreenPtr pScreen,
+ RefreshAreaFuncPtr refreshArea
+){
+ return ShadowFBInit2(pScreen, NULL, refreshArea);
+}
+
+/**********************************************************/
+
+static Bool
+ShadowEnterVT(int index, int flags)
+{
+ ScrnInfoPtr pScrn = xf86Screens[index];
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen);
+
+ if((*pPriv->EnterVT)(index, flags)) {
+ pPriv->vtSema = TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static void
+ShadowLeaveVT(int index, int flags)
+{
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(xf86Screens[index]->pScreen);
+
+ pPriv->vtSema = FALSE;
+
+ (*pPriv->LeaveVT)(index, flags);
+}
+
+/**********************************************************/
+
+
+static Bool
+ShadowCloseScreen (int i, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
+#ifdef RENDER
+ PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+#endif /* RENDER */
+
+ pScreen->CloseScreen = pPriv->CloseScreen;
+ pScreen->PaintWindowBackground = pPriv->PaintWindowBackground;
+ pScreen->PaintWindowBorder = pPriv->PaintWindowBorder;
+ pScreen->CopyWindow = pPriv->CopyWindow;
+ pScreen->CreateGC = pPriv->CreateGC;
+ pScreen->BackingStoreFuncs.RestoreAreas = pPriv->RestoreAreas;
+ pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader;
+
+ pScrn->EnterVT = pPriv->EnterVT;
+ pScrn->LeaveVT = pPriv->LeaveVT;
+
+#ifdef RENDER
+ if(ps) {
+ ps->Composite = pPriv->Composite;
+ }
+#endif /* RENDER */
+
+ xfree((pointer)pPriv);
+
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+
+static void
+ShadowRestoreAreas (
+ PixmapPtr pPixmap,
+ RegionPtr prgn,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
+ int num = 0;
+
+ if(pPriv->vtSema && (num = REGION_NUM_RECTS(prgn)))
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn));
+
+ pScreen->BackingStoreFuncs.RestoreAreas = pPriv->RestoreAreas;
+ (*pScreen->BackingStoreFuncs.RestoreAreas) (
+ pPixmap, prgn, xorg, yorg, pWin);
+ pScreen->BackingStoreFuncs.RestoreAreas = ShadowRestoreAreas;
+
+ if(num && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn));
+}
+
+
+static void
+ShadowPaintWindow(
+ WindowPtr pWin,
+ RegionPtr prgn,
+ int what
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
+ int num = 0;
+
+ if(pPriv->vtSema && (num = REGION_NUM_RECTS(prgn)))
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn));
+
+ if(what == PW_BACKGROUND) {
+ pScreen->PaintWindowBackground = pPriv->PaintWindowBackground;
+ (*pScreen->PaintWindowBackground) (pWin, prgn, what);
+ pScreen->PaintWindowBackground = ShadowPaintWindow;
+ } else {
+ pScreen->PaintWindowBorder = pPriv->PaintWindowBorder;
+ (*pScreen->PaintWindowBorder) (pWin, prgn, what);
+ pScreen->PaintWindowBorder = ShadowPaintWindow;
+ }
+
+ if(num && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(prgn));
+}
+
+
+static void
+ShadowCopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgn
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
+ int num = 0;
+ RegionRec rgnDst;
+
+ if (pPriv->vtSema) {
+ REGION_INIT(pWin->drawable.pScreen, &rgnDst, NullBox, 0);
+ REGION_COPY(pWin->drawable.pScreen, &rgnDst, prgn);
+
+ REGION_TRANSLATE(pWin->drawable.pScreen, &rgnDst,
+ pWin->drawable.x - ptOldOrg.x,
+ pWin->drawable.y - ptOldOrg.y);
+ REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, &rgnDst);
+ if ((num = REGION_NUM_RECTS(&rgnDst))) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(&rgnDst));
+ } else {
+ REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
+ }
+ }
+
+ pScreen->CopyWindow = pPriv->CopyWindow;
+ (*pScreen->CopyWindow) (pWin, ptOldOrg, prgn);
+ pScreen->CopyWindow = ShadowCopyWindow;
+
+ if (num) {
+ if (pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(&rgnDst));
+ REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
+ }
+}
+
+static Bool
+ShadowModifyPixmapHeader(
+ PixmapPtr pPixmap,
+ int width,
+ int height,
+ int depth,
+ int bitsPerPixel,
+ int devKind,
+ pointer pPixData
+)
+{
+ ScreenPtr pScreen;
+ ScrnInfoPtr pScrn;
+ ShadowScreenPtr pPriv;
+ Bool retval;
+ PixmapPtr pScreenPix;
+
+ if (!pPixmap)
+ return FALSE;
+
+ pScreen = pPixmap->drawable.pScreen;
+ pScrn = xf86Screens[pScreen->myNum];
+
+ pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
+
+ if (pPixmap == pScreenPix && !pScrn->vtSema)
+ pScreenPix->devPrivate = pScrn->pixmapPrivate;
+
+ pPriv = GET_SCREEN_PRIVATE(pScreen);
+
+ pScreen->ModifyPixmapHeader = pPriv->ModifyPixmapHeader;
+ retval = (*pScreen->ModifyPixmapHeader)(pPixmap,
+ width, height, depth, bitsPerPixel, devKind, pPixData);
+ pScreen->ModifyPixmapHeader = ShadowModifyPixmapHeader;
+
+ if (pPixmap == pScreenPix && !pScrn->vtSema)
+ {
+ pScrn->pixmapPrivate = pScreenPix->devPrivate;
+ pScreenPix->devPrivate.ptr = 0;
+ }
+ return retval;
+}
+
+#ifdef RENDER
+static void
+ShadowComposite(
+ CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height
+){
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ BoxRec box;
+ BoxPtr extents;
+ Bool boxNotEmpty = FALSE;
+
+ if (pPriv->vtSema
+ && pDst->pDrawable->type == DRAWABLE_WINDOW) {
+
+ box.x1 = pDst->pDrawable->x + xDst;
+ box.y1 = pDst->pDrawable->y + yDst;
+ box.x2 = box.x1 + width;
+ box.y2 = box.y1 + height;
+
+ extents = &pDst->pCompositeClip->extents;
+ if(box.x1 < extents->x1) box.x1 = extents->x1;
+ if(box.x2 > extents->x2) box.x2 = extents->x2;
+ if(box.y1 < extents->y1) box.y1 = extents->y1;
+ if(box.y2 > extents->y2) box.y2 = extents->y2;
+
+ if (BOX_NOT_EMPTY(box)) {
+ if (pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ ps->Composite = pPriv->Composite;
+ (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc,
+ xMask, yMask, xDst, yDst, width, height);
+ ps->Composite = ShadowComposite;
+
+ if (pPriv->postRefresh && boxNotEmpty) {
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+ }
+}
+#endif /* RENDER */
+
+/**********************************************************/
+
+static void ShadowValidateGC(GCPtr, unsigned long, DrawablePtr);
+static void ShadowChangeGC(GCPtr, unsigned long);
+static void ShadowCopyGC(GCPtr, unsigned long, GCPtr);
+static void ShadowDestroyGC(GCPtr);
+static void ShadowChangeClip(GCPtr, int, pointer, int);
+static void ShadowDestroyClip(GCPtr);
+static void ShadowCopyClip(GCPtr, GCPtr);
+
+GCFuncs ShadowGCFuncs = {
+ ShadowValidateGC, ShadowChangeGC, ShadowCopyGC, ShadowDestroyGC,
+ ShadowChangeClip, ShadowDestroyClip, ShadowCopyClip
+};
+
+
+extern GCOps ShadowGCOps;
+
+static Bool
+ShadowCreateGC(GCPtr pGC)
+{
+ ScreenPtr pScreen = pGC->pScreen;
+ ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
+ ShadowGCPtr pGCPriv = GET_GC_PRIVATE(pGC);
+ Bool ret;
+
+ pScreen->CreateGC = pPriv->CreateGC;
+ if((ret = (*pScreen->CreateGC) (pGC))) {
+ pGCPriv->ops = NULL;
+ pGCPriv->funcs = pGC->funcs;
+ pGC->funcs = &ShadowGCFuncs;
+ }
+ pScreen->CreateGC = ShadowCreateGC;
+
+ return ret;
+}
+
+
+static void
+ShadowValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+){
+ SHADOW_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
+ if(pDraw->type == DRAWABLE_WINDOW)
+ pGCPriv->ops = pGC->ops; /* just so it's not NULL */
+ else
+ pGCPriv->ops = NULL;
+ SHADOW_GC_FUNC_EPILOGUE (pGC);
+}
+
+
+static void
+ShadowDestroyGC(GCPtr pGC)
+{
+ SHADOW_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->DestroyGC)(pGC);
+ SHADOW_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+ShadowChangeGC (
+ GCPtr pGC,
+ unsigned long mask
+){
+ SHADOW_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeGC) (pGC, mask);
+ SHADOW_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+ShadowCopyGC (
+ GCPtr pGCSrc,
+ unsigned long mask,
+ GCPtr pGCDst
+){
+ SHADOW_GC_FUNC_PROLOGUE (pGCDst);
+ (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
+ SHADOW_GC_FUNC_EPILOGUE (pGCDst);
+}
+
+static void
+ShadowChangeClip (
+ GCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects
+){
+ SHADOW_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
+ SHADOW_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+ShadowCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
+{
+ SHADOW_GC_FUNC_PROLOGUE (pgcDst);
+ (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
+ SHADOW_GC_FUNC_EPILOGUE (pgcDst);
+}
+
+static void
+ShadowDestroyClip(GCPtr pGC)
+{
+ SHADOW_GC_FUNC_PROLOGUE (pGC);
+ (* pGC->funcs->DestroyClip)(pGC);
+ SHADOW_GC_FUNC_EPILOGUE (pGC);
+}
+
+
+
+
+/**********************************************************/
+
+
+static void
+ShadowFillSpans(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted
+){
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nInit) {
+ DDXPointPtr ppt = pptInit;
+ int *pwidth = pwidthInit;
+ int i = nInit;
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ box.x1 = ppt->x;
+ box.x2 = box.x1 + *pwidth;
+ box.y2 = box.y1 = ppt->y;
+
+ while(--i) {
+ ppt++;
+ pwidth++;
+ if(box.x1 > ppt->x) box.x1 = ppt->x;
+ if(box.x2 < (ppt->x + *pwidth))
+ box.x2 = ppt->x + *pwidth;
+ if(box.y1 > ppt->y) box.y1 = ppt->y;
+ else if(box.y2 < ppt->y) box.y2 = ppt->y;
+ }
+
+ box.y2++;
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+ } else
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+ShadowSetSpans(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int nspans,
+ int fSorted
+){
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nspans) {
+ DDXPointPtr ppt = pptInit;
+ int *pwidth = pwidthInit;
+ int i = nspans;
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ box.x1 = ppt->x;
+ box.x2 = box.x1 + *pwidth;
+ box.y2 = box.y1 = ppt->y;
+
+ while(--i) {
+ ppt++;
+ pwidth++;
+ if(box.x1 > ppt->x) box.x1 = ppt->x;
+ if(box.x2 < (ppt->x + *pwidth))
+ box.x2 = ppt->x + *pwidth;
+ if(box.y1 > ppt->y) box.y1 = ppt->y;
+ else if(box.y2 < ppt->y) box.y2 = ppt->y;
+ }
+
+ box.y2++;
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, pptInit,
+ pwidthInit, nspans, fSorted);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+ } else
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, pptInit,
+ pwidthInit, nspans, fSorted);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+ShadowPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw)) {
+ box.x1 = x + pDraw->x;
+ box.x2 = box.x1 + w;
+ box.y1 = y + pDraw->y;
+ box.y2 = box.y1 + h;
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+
+}
+
+static RegionPtr
+ShadowCopyArea(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+ RegionPtr ret;
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDst)) {
+ box.x1 = dstx + pDst->x;
+ box.x2 = box.x1 + width;
+ box.y1 = dsty + pDst->y;
+ box.y2 = box.y1 + height;
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ ret = (*pGC->ops->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+
+ return ret;
+}
+
+static RegionPtr
+ShadowCopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ RegionPtr ret;
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDst)) {
+ box.x1 = dstx + pDst->x;
+ box.x2 = box.x1 + width;
+ box.y1 = dsty + pDst->y;
+ box.y2 = box.y1 + height;
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+
+ return ret;
+}
+
+static void
+ShadowPolyPoint(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int nptInit,
+ xPoint *pptInit
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nptInit) {
+ xPoint *ppt = pptInit;
+ int npt = nptInit;
+
+ box.x2 = box.x1 = pptInit->x;
+ box.y2 = box.y1 = pptInit->y;
+
+ /* this could be slow if the points were spread out */
+
+ while(--npt) {
+ ppt++;
+ if(box.x1 > ppt->x) box.x1 = ppt->x;
+ else if(box.x2 < ppt->x) box.x2 = ppt->x;
+ if(box.y1 > ppt->y) box.y1 = ppt->y;
+ else if(box.y2 < ppt->y) box.y2 = ppt->y;
+ }
+
+ box.x2++;
+ box.y2++;
+
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, nptInit, pptInit);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+ShadowPolylines(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int nptInit,
+ DDXPointPtr pptInit
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nptInit) {
+ DDXPointPtr ppt = pptInit;
+ int npt = nptInit;
+ int extra = pGC->lineWidth >> 1;
+
+ box.x2 = box.x1 = pptInit->x;
+ box.y2 = box.y1 = pptInit->y;
+
+ if(npt > 1) {
+ if(pGC->joinStyle == JoinMiter)
+ extra = 6 * pGC->lineWidth;
+ else if(pGC->capStyle == CapProjecting)
+ extra = pGC->lineWidth;
+ }
+
+ if(mode == CoordModePrevious) {
+ int x = box.x1;
+ int y = box.y1;
+ while(--npt) {
+ ppt++;
+ x += ppt->x;
+ y += ppt->y;
+ if(box.x1 > x) box.x1 = x;
+ else if(box.x2 < x) box.x2 = x;
+ if(box.y1 > y) box.y1 = y;
+ else if(box.y2 < y) box.y2 = y;
+ }
+ } else {
+ while(--npt) {
+ ppt++;
+ if(box.x1 > ppt->x) box.x1 = ppt->x;
+ else if(box.x2 < ppt->x) box.x2 = ppt->x;
+ if(box.y1 > ppt->y) box.y1 = ppt->y;
+ else if(box.y2 < ppt->y) box.y2 = ppt->y;
+ }
+ }
+
+ box.x2++;
+ box.y2++;
+
+ if(extra) {
+ box.x1 -= extra;
+ box.x2 += extra;
+ box.y1 -= extra;
+ box.y2 += extra;
+ }
+
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, nptInit, pptInit);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+ShadowPolySegment(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nsegInit,
+ xSegment *pSegInit
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nsegInit) {
+ int extra = pGC->lineWidth;
+ xSegment *pSeg = pSegInit;
+ int nseg = nsegInit;
+
+ if(pGC->capStyle != CapProjecting)
+ extra >>= 1;
+
+ if(pSeg->x2 > pSeg->x1) {
+ box.x1 = pSeg->x1;
+ box.x2 = pSeg->x2;
+ } else {
+ box.x2 = pSeg->x1;
+ box.x1 = pSeg->x2;
+ }
+
+ if(pSeg->y2 > pSeg->y1) {
+ box.y1 = pSeg->y1;
+ box.y2 = pSeg->y2;
+ } else {
+ box.y2 = pSeg->y1;
+ box.y1 = pSeg->y2;
+ }
+
+ while(--nseg) {
+ pSeg++;
+ if(pSeg->x2 > pSeg->x1) {
+ if(pSeg->x1 < box.x1) box.x1 = pSeg->x1;
+ if(pSeg->x2 > box.x2) box.x2 = pSeg->x2;
+ } else {
+ if(pSeg->x2 < box.x1) box.x1 = pSeg->x2;
+ if(pSeg->x1 > box.x2) box.x2 = pSeg->x1;
+ }
+ if(pSeg->y2 > pSeg->y1) {
+ if(pSeg->y1 < box.y1) box.y1 = pSeg->y1;
+ if(pSeg->y2 > box.y2) box.y2 = pSeg->y2;
+ } else {
+ if(pSeg->y2 < box.y1) box.y1 = pSeg->y2;
+ if(pSeg->y1 > box.y2) box.y2 = pSeg->y1;
+ }
+ }
+
+ box.x2++;
+ box.y2++;
+
+ if(extra) {
+ box.x1 -= extra;
+ box.x2 += extra;
+ box.y1 -= extra;
+ box.y2 += extra;
+ }
+
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->PolySegment)(pDraw, pGC, nsegInit, pSegInit);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+ShadowPolyRectangle(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ BoxRec box;
+ BoxPtr pBoxInit = NULL;
+ Bool boxNotEmpty = FALSE;
+ int num = 0;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nRectsInit) {
+ xRectangle *pRects = pRectsInit;
+ int nRects = nRectsInit;
+
+ if(nRects >= 32) {
+ int extra = pGC->lineWidth >> 1;
+
+ box.x1 = pRects->x;
+ box.x2 = box.x1 + pRects->width;
+ box.y1 = pRects->y;
+ box.y2 = box.y1 + pRects->height;
+
+ while(--nRects) {
+ pRects++;
+ if(box.x1 > pRects->x) box.x1 = pRects->x;
+ if(box.x2 < (pRects->x + pRects->width))
+ box.x2 = pRects->x + pRects->width;
+ if(box.y1 > pRects->y) box.y1 = pRects->y;
+ if(box.y2 < (pRects->y + pRects->height))
+ box.y2 = pRects->y + pRects->height;
+ }
+
+ if(extra) {
+ box.x1 -= extra;
+ box.x2 += extra;
+ box.y1 -= extra;
+ box.y2 += extra;
+ }
+
+ box.x2++;
+ box.y2++;
+
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ } else {
+ BoxPtr pbox;
+ int offset1, offset2, offset3;
+
+ offset2 = pGC->lineWidth;
+ if(!offset2) offset2 = 1;
+ offset1 = offset2 >> 1;
+ offset3 = offset2 - offset1;
+
+ pBoxInit = (BoxPtr)ALLOCATE_LOCAL(nRects * 4 * sizeof(BoxRec));
+ pbox = pBoxInit;
+
+ while(nRects--) {
+ pbox->x1 = pRects->x - offset1;
+ pbox->y1 = pRects->y - offset1;
+ pbox->x2 = pbox->x1 + pRects->width + offset2;
+ pbox->y2 = pbox->y1 + offset2;
+ TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC);
+ if(BOX_NOT_EMPTY((*pbox))) {
+ num++;
+ pbox++;
+ }
+
+ pbox->x1 = pRects->x - offset1;
+ pbox->y1 = pRects->y + offset3;
+ pbox->x2 = pbox->x1 + offset2;
+ pbox->y2 = pbox->y1 + pRects->height - offset2;
+ TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC);
+ if(BOX_NOT_EMPTY((*pbox))) {
+ num++;
+ pbox++;
+ }
+
+ pbox->x1 = pRects->x + pRects->width - offset1;
+ pbox->y1 = pRects->y + offset3;
+ pbox->x2 = pbox->x1 + offset2;
+ pbox->y2 = pbox->y1 + pRects->height - offset2;
+ TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC);
+ if(BOX_NOT_EMPTY((*pbox))) {
+ num++;
+ pbox++;
+ }
+
+ pbox->x1 = pRects->x - offset1;
+ pbox->y1 = pRects->y + pRects->height - offset1;
+ pbox->x2 = pbox->x1 + pRects->width + offset2;
+ pbox->y2 = pbox->y1 + offset2;
+ TRIM_AND_TRANSLATE_BOX((*pbox), pDraw, pGC);
+ if(BOX_NOT_EMPTY((*pbox))) {
+ num++;
+ pbox++;
+ }
+
+ pRects++;
+ }
+
+ if(num) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, num, pBoxInit);
+ } else {
+ DEALLOCATE_LOCAL(pBoxInit);
+ }
+ }
+ }
+
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+
+ if(boxNotEmpty && pPriv->postRefresh) {
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+ } else if(num) {
+ if(pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, num, pBoxInit);
+ DEALLOCATE_LOCAL(pBoxInit);
+ }
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+
+}
+
+static void
+ShadowPolyArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcsInit,
+ xArc *parcsInit
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && narcsInit) {
+ int narcs = narcsInit;
+ xArc *parcs = parcsInit;
+ int extra = pGC->lineWidth >> 1;
+
+ box.x1 = parcs->x;
+ box.x2 = box.x1 + parcs->width;
+ box.y1 = parcs->y;
+ box.y2 = box.y1 + parcs->height;
+
+ /* should I break these up instead ? */
+
+ while(--narcs) {
+ parcs++;
+ if(box.x1 > parcs->x) box.x1 = parcs->x;
+ if(box.x2 < (parcs->x + parcs->width))
+ box.x2 = parcs->x + parcs->width;
+ if(box.y1 > parcs->y) box.y1 = parcs->y;
+ if(box.y2 < (parcs->y + parcs->height))
+ box.y2 = parcs->y + parcs->height;
+ }
+
+ if(extra) {
+ box.x1 -= extra;
+ box.x2 += extra;
+ box.y1 -= extra;
+ box.y2 += extra;
+ }
+
+ box.x2++;
+ box.y2++;
+
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcsInit, parcsInit);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+
+}
+
+static void
+ShadowFillPolygon(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr pptInit
+){
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && (count > 2)) {
+ DDXPointPtr ppt = pptInit;
+ int i = count;
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ box.x2 = box.x1 = ppt->x;
+ box.y2 = box.y1 = ppt->y;
+
+ if(mode != CoordModeOrigin) {
+ int x = box.x1;
+ int y = box.y1;
+ while(--i) {
+ ppt++;
+ x += ppt->x;
+ y += ppt->y;
+ if(box.x1 > x) box.x1 = x;
+ else if(box.x2 < x) box.x2 = x;
+ if(box.y1 > y) box.y1 = y;
+ else if(box.y2 < y) box.y2 = y;
+ }
+ } else {
+ while(--i) {
+ ppt++;
+ if(box.x1 > ppt->x) box.x1 = ppt->x;
+ else if(box.x2 < ppt->x) box.x2 = ppt->x;
+ if(box.y1 > ppt->y) box.y1 = ppt->y;
+ else if(box.y2 < ppt->y) box.y2 = ppt->y;
+ }
+ }
+
+ box.x2++;
+ box.y2++;
+
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, pptInit);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+ } else
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, pptInit);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+
+static void
+ShadowPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nRectsInit) {
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+ xRectangle *pRects = pRectsInit;
+ int nRects = nRectsInit;
+
+ box.x1 = pRects->x;
+ box.x2 = box.x1 + pRects->width;
+ box.y1 = pRects->y;
+ box.y2 = box.y1 + pRects->height;
+
+ while(--nRects) {
+ pRects++;
+ if(box.x1 > pRects->x) box.x1 = pRects->x;
+ if(box.x2 < (pRects->x + pRects->width))
+ box.x2 = pRects->x + pRects->width;
+ if(box.y1 > pRects->y) box.y1 = pRects->y;
+ if(box.y2 < (pRects->y + pRects->height))
+ box.y2 = pRects->y + pRects->height;
+ }
+
+ /* cfb messes with the pRectsInit so we have to do our
+ calculations first */
+
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nRectsInit, pRectsInit);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+ } else
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nRectsInit, pRectsInit);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+
+static void
+ShadowPolyFillArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcsInit,
+ xArc *parcsInit
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && narcsInit) {
+ xArc *parcs = parcsInit;
+ int narcs = narcsInit;
+
+ box.x1 = parcs->x;
+ box.x2 = box.x1 + parcs->width;
+ box.y1 = parcs->y;
+ box.y2 = box.y1 + parcs->height;
+
+ /* should I break these up instead ? */
+
+ while(--narcs) {
+ parcs++;
+ if(box.x1 > parcs->x) box.x1 = parcs->x;
+ if(box.x2 < (parcs->x + parcs->width))
+ box.x2 = parcs->x + parcs->width;
+ if(box.y1 > parcs->y) box.y1 = parcs->y;
+ if(box.y2 < (parcs->y + parcs->height))
+ box.y2 = parcs->y + parcs->height;
+ }
+
+ TRIM_AND_TRANSLATE_BOX(box, pDraw, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcsInit, parcsInit);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+ShadowTextExtent(FontPtr pFont, int count, char* chars,
+ FontEncoding fontEncoding, BoxPtr box)
+{
+ unsigned long n, i;
+ int w;
+ CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
+
+ GetGlyphs(pFont, (unsigned long)count, (unsigned char *)chars,
+ fontEncoding, &n, charinfo);
+ w = 0;
+ for (i=0; i < n; i++) {
+ w += charinfo[i]->metrics.characterWidth;
+ }
+ if (i) {
+ w += charinfo[i - 1]->metrics.rightSideBearing;
+ }
+
+ box->x1 = 0;
+ if (n) {
+ if (charinfo[0]->metrics.leftSideBearing < 0) {
+ box->x1 = charinfo[0]->metrics.leftSideBearing;
+ }
+ }
+ box->x2 = w;
+ box->y1 = -FONTMAXBOUNDS(pFont,ascent);
+ box->y2 = FONTMAXBOUNDS(pFont,descent);
+}
+
+
+
+static void
+ShadowFontToBox(BoxPtr BB, DrawablePtr pDrawable, GCPtr pGC, int x, int y,
+ int count, char *chars, int wide)
+{
+ FontPtr pFont;
+
+ pFont = pGC->font;
+ if (pFont->info.constantWidth) {
+ int ascent, descent, left, right = 0;
+
+ ascent = MAX(pFont->info.fontAscent, pFont->info.maxbounds.ascent);
+ descent = MAX(pFont->info.fontDescent, pFont->info.maxbounds.descent);
+ left = pFont->info.maxbounds.leftSideBearing;
+ if (count > 0) {
+ right = (count - 1) * pFont->info.maxbounds.characterWidth;
+ }
+ right += pFont->info.maxbounds.rightSideBearing;
+ BB->x1 =
+ MAX(pDrawable->x + x - left, (REGION_EXTENTS(pGC->pScreen,
+ &((WindowPtr) pDrawable)->winSize))->x1);
+ BB->y1 =
+ MAX(pDrawable->y + y - ascent,
+ (REGION_EXTENTS(pGC->pScreen,
+ &((WindowPtr) pDrawable)->winSize))->y1);
+ BB->x2 =
+ MIN(pDrawable->x + x + right,
+ (REGION_EXTENTS(pGC->pScreen,
+ &((WindowPtr) pDrawable)->winSize))->x2);
+ BB->y2 =
+ MIN(pDrawable->y + y + descent,
+ (REGION_EXTENTS(pGC->pScreen,
+ &((WindowPtr) pDrawable)->winSize))->y2);
+ } else {
+ ShadowTextExtent(pFont, count, chars, wide ? (FONTLASTROW(pFont) == 0)
+ ? Linear16Bit : TwoD16Bit : Linear8Bit, BB);
+ BB->x1 =
+ MAX(pDrawable->x + x + BB->x1, (REGION_EXTENTS(pGC->pScreen,
+ &((WindowPtr) pDrawable)->winSize))->x1);
+ BB->y1 =
+ MAX(pDrawable->y + y + BB->y1,
+ (REGION_EXTENTS(pGC->pScreen,
+ &((WindowPtr) pDrawable)->winSize))->y1);
+ BB->x2 =
+ MIN(pDrawable->x + x + BB->x2,
+ (REGION_EXTENTS(pGC->pScreen,
+ &((WindowPtr) pDrawable)->winSize))->x2);
+ BB->y2 =
+ MIN(pDrawable->y + y + BB->y2,
+ (REGION_EXTENTS(pGC->pScreen,
+ &((WindowPtr) pDrawable)->winSize))->y2);
+ }
+}
+
+static int
+ShadowPolyText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ int width;
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw)) {
+ ShadowFontToBox(&box, pDraw, pGC, x, y, count, chars, 0);
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ width = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+
+ return width;
+}
+
+static int
+ShadowPolyText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ int width;
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw)) {
+ ShadowFontToBox(&box, pDraw, pGC, x, y, count, (char*)chars, 1);
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ width = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+
+ return width;
+}
+
+static void
+ShadowImageText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && count) {
+ int top, bot, Min, Max;
+
+ top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
+ bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
+
+ Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
+ if(Min > 0) Min = 0;
+ Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
+ if(Max < 0) Max = 0;
+
+ /* ugh */
+ box.x1 = pDraw->x + x + Min +
+ FONTMINBOUNDS(pGC->font, leftSideBearing);
+ box.x2 = pDraw->x + x + Max +
+ FONTMAXBOUNDS(pGC->font, rightSideBearing);
+
+ box.y1 = pDraw->y + y - top;
+ box.y2 = pDraw->y + y + bot;
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+static void
+ShadowImageText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && count) {
+ int top, bot, Min, Max;
+
+ top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
+ bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
+
+ Min = count * FONTMINBOUNDS(pGC->font, characterWidth);
+ if(Min > 0) Min = 0;
+ Max = count * FONTMAXBOUNDS(pGC->font, characterWidth);
+ if(Max < 0) Max = 0;
+
+ /* ugh */
+ box.x1 = pDraw->x + x + Min +
+ FONTMINBOUNDS(pGC->font, leftSideBearing);
+ box.x2 = pDraw->x + x + Max +
+ FONTMAXBOUNDS(pGC->font, rightSideBearing);
+
+ box.y1 = pDraw->y + y - top;
+ box.y2 = pDraw->y + y + bot;
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+
+static void
+ShadowImageGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ unsigned int nglyphInit,
+ CharInfoPtr *ppciInit,
+ pointer pglyphBase
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nglyphInit) {
+ CharInfoPtr *ppci = ppciInit;
+ unsigned int nglyph = nglyphInit;
+ int top, bot, width = 0;
+
+ top = max(FONTMAXBOUNDS(pGC->font, ascent), FONTASCENT(pGC->font));
+ bot = max(FONTMAXBOUNDS(pGC->font, descent), FONTDESCENT(pGC->font));
+
+ box.x1 = ppci[0]->metrics.leftSideBearing;
+ if(box.x1 > 0) box.x1 = 0;
+ box.x2 = ppci[nglyph - 1]->metrics.rightSideBearing -
+ ppci[nglyph - 1]->metrics.characterWidth;
+ if(box.x2 < 0) box.x2 = 0;
+
+ box.x2 += pDraw->x + x;
+ box.x1 += pDraw->x + x;
+
+ while(nglyph--) {
+ width += (*ppci)->metrics.characterWidth;
+ ppci++;
+ }
+
+ if(width > 0)
+ box.x2 += width;
+ else
+ box.x1 += width;
+
+ box.y1 = pDraw->y + y - top;
+ box.y2 = pDraw->y + y + bot;
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, nglyphInit,
+ ppciInit, pglyphBase);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+ShadowPolyGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ unsigned int nglyphInit,
+ CharInfoPtr *ppciInit,
+ pointer pglyphBase
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw) && nglyphInit) {
+ CharInfoPtr *ppci = ppciInit;
+ unsigned int nglyph = nglyphInit;
+
+ /* ugh */
+ box.x1 = pDraw->x + x + ppci[0]->metrics.leftSideBearing;
+ box.x2 = pDraw->x + x + ppci[nglyph - 1]->metrics.rightSideBearing;
+
+ if(nglyph > 1) {
+ int width = 0;
+
+ while(--nglyph) {
+ width += (*ppci)->metrics.characterWidth;
+ ppci++;
+ }
+
+ if(width > 0) box.x2 += width;
+ else box.x1 += width;
+ }
+
+ box.y1 = pDraw->y + y - FONTMAXBOUNDS(pGC->font, ascent);
+ box.y2 = pDraw->y + y + FONTMAXBOUNDS(pGC->font, descent);
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, x, y, nglyphInit,
+ ppciInit, pglyphBase);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+ShadowPushPixels(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg
+){
+ BoxRec box;
+ Bool boxNotEmpty = FALSE;
+
+ SHADOW_GC_OP_PROLOGUE(pGC);
+
+ if(IS_VISIBLE(pDraw)) {
+ box.x1 = xOrg + pDraw->x;
+ box.x2 = box.x1 + dx;
+ box.y1 = yOrg + pDraw->y;
+ box.y2 = box.y1 + dy;
+
+ TRIM_BOX(box, pGC);
+ if(BOX_NOT_EMPTY(box)) {
+ if(pPriv->preRefresh)
+ (*pPriv->preRefresh)(pPriv->pScrn, 1, &box);
+ boxNotEmpty = TRUE;
+ }
+ }
+
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+
+ if(boxNotEmpty && pPriv->postRefresh)
+ (*pPriv->postRefresh)(pPriv->pScrn, 1, &box);
+
+ SHADOW_GC_OP_EPILOGUE(pGC);
+}
+
+
+GCOps ShadowGCOps = {
+ ShadowFillSpans, ShadowSetSpans,
+ ShadowPutImage, ShadowCopyArea,
+ ShadowCopyPlane, ShadowPolyPoint,
+ ShadowPolylines, ShadowPolySegment,
+ ShadowPolyRectangle, ShadowPolyArc,
+ ShadowFillPolygon, ShadowPolyFillRect,
+ ShadowPolyFillArc, ShadowPolyText8,
+ ShadowPolyText16, ShadowImageText8,
+ ShadowImageText16, ShadowImageGlyphBlt,
+ ShadowPolyGlyphBlt, ShadowPushPixels,
+#ifdef NEED_LINEHELPER
+ NULL,
+#endif
+ {NULL} /* devPrivate */
+};
+
diff --git a/hw/xfree86/shadowfb/shadowfb.h b/hw/xfree86/shadowfb/shadowfb.h
new file mode 100644
index 000000000..d028980bd
--- /dev/null
+++ b/hw/xfree86/shadowfb/shadowfb.h
@@ -0,0 +1,44 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/shadowfb/shadowfb.h,v 1.4 2003/02/18 19:10:35 alanh Exp $ */
+
+#ifndef _SHADOWFB_H
+#define _SHADOWFB_H
+
+#include "xf86str.h"
+
+/*
+ * User defined callback function. Passed a pointer to the ScrnInfo struct,
+ * the number of dirty rectangles, and a pointer to the first dirty rectangle
+ * in the array.
+ */
+typedef void (*RefreshAreaFuncPtr)(ScrnInfoPtr, int, BoxPtr);
+
+/*
+ * ShadowFBInit initializes the shadowfb subsystem. refreshArea is a pointer
+ * to a user supplied callback function. This function will be called after
+ * any operation that modifies the framebuffer. The newly dirtied rectangles
+ * are passed to the callback.
+ *
+ * Returns FALSE in the event of an error.
+ */
+Bool
+ShadowFBInit (
+ ScreenPtr pScreen,
+ RefreshAreaFuncPtr refreshArea
+);
+
+/*
+ * ShadowFBInit2 is a more featureful refinement of the original shadowfb.
+ * ShadowFBInit2 allows you to specify two callbacks, one to be called
+ * immediately before an operation that modifies the framebuffer, and another
+ * to be called immediately after.
+ *
+ * Returns FALSE in the event of an error
+ */
+Bool
+ShadowFBInit2 (
+ ScreenPtr pScreen,
+ RefreshAreaFuncPtr preRefreshArea,
+ RefreshAreaFuncPtr postRefreshArea
+);
+
+#endif /* _SHADOWFB_H */
diff --git a/hw/xfree86/utils/gtf/gtf.c b/hw/xfree86/utils/gtf/gtf.c
new file mode 100644
index 000000000..b0d9de058
--- /dev/null
+++ b/hw/xfree86/utils/gtf/gtf.c
@@ -0,0 +1,743 @@
+/* gtf.c Generate mode timings using the GTF Timing Standard
+ *
+ * gcc gtf.c -o gtf -lm -Wall
+ *
+ * Copyright (c) 2001, Andy Ritger aritger@nvidia.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:
+ *
+ * o Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * o 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.
+ * o Neither the name of NVIDIA 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 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.
+ *
+ *
+ *
+ * This program is based on the Generalized Timing Formula(GTF TM)
+ * Standard Version: 1.0, Revision: 1.0
+ *
+ * The GTF Document contains the following Copyright information:
+ *
+ * Copyright (c) 1994, 1995, 1996 - Video Electronics Standards
+ * Association. Duplication of this document within VESA member
+ * companies for review purposes is permitted. All other rights
+ * reserved.
+ *
+ * While every precaution has been taken in the preparation
+ * of this standard, the Video Electronics Standards Association and
+ * its contributors assume no responsibility for errors or omissions,
+ * and make no warranties, expressed or implied, of functionality
+ * of suitability for any purpose. The sample code contained within
+ * this standard may be used without restriction.
+ *
+ *
+ *
+ * The GTF EXCEL(TM) SPREADSHEET, a sample (and the definitive)
+ * implementation of the GTF Timing Standard, is available at:
+ *
+ * ftp://ftp.vesa.org/pub/GTF/GTF_V1R1.xls
+ *
+ *
+ *
+ * This program takes a desired resolution and vertical refresh rate,
+ * and computes mode timings according to the GTF Timing Standard.
+ * These mode timings can then be formatted as an XFree86 modeline
+ * or a mode description for use by fbset(8).
+ *
+ *
+ *
+ * NOTES:
+ *
+ * The GTF allows for computation of "margins" (the visible border
+ * surrounding the addressable video); on most non-overscan type
+ * systems, the margin period is zero. I've implemented the margin
+ * computations but not enabled it because 1) I don't really have
+ * any experience with this, and 2) neither XFree86 modelines nor
+ * fbset fb.modes provide an obvious way for margin timings to be
+ * included in their mode descriptions (needs more investigation).
+ *
+ * The GTF provides for computation of interlaced mode timings;
+ * I've implemented the computations but not enabled them, yet.
+ * I should probably enable and test this at some point.
+ *
+ *
+ *
+ * TODO:
+ *
+ * o Add support for interlaced modes.
+ *
+ * o Implement the other portions of the GTF: compute mode timings
+ * given either the desired pixel clock or the desired horizontal
+ * frequency.
+ *
+ * o It would be nice if this were more general purpose to do things
+ * outside the scope of the GTF: like generate double scan mode
+ * timings, for example.
+ *
+ * o Printing digits to the right of the decimal point when the
+ * digits are 0 annoys me.
+ *
+ * o Error checking.
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/gtf.c,v 1.3 2002/12/21 02:35:20 dawes Exp $ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+
+#if defined(__Lynx__)
+#define rint(x) floor(x)
+#endif
+
+#define MARGIN_PERCENT 1.8 /* % of active vertical image */
+#define CELL_GRAN 8.0 /* assumed character cell granularity */
+#define MIN_PORCH 1 /* minimum front porch */
+#define V_SYNC_RQD 3 /* width of vsync in lines */
+#define H_SYNC_PERCENT 8.0 /* width of hsync as % of total line */
+#define MIN_VSYNC_PLUS_BP 550.0 /* min time of vsync + back porch (microsec) */
+#define M 600.0 /* blanking formula gradient */
+#define C 40.0 /* blanking formula offset */
+#define K 128.0 /* blanking formula scaling factor */
+#define J 20.0 /* blanking formula scaling factor */
+
+/* C' and M' are part of the Blanking Duty Cycle computation */
+
+#define C_PRIME (((C - J) * K/256.0) + J)
+#define M_PRIME (K/256.0 * M)
+
+
+/* struct definitions */
+
+typedef struct __mode
+{
+ int hr, hss, hse, hfl;
+ int vr, vss, vse, vfl;
+ float pclk, h_freq, v_freq;
+} mode;
+
+
+typedef struct __options
+{
+ int x, y;
+ int xf86mode, fbmode;
+ float v_freq;
+} options;
+
+
+
+
+/* prototypes */
+
+void print_value(int n, char *name, float val);
+void print_xf86_mode (mode *m);
+void print_fb_mode (mode *m);
+mode *vert_refresh (int h_pixels, int v_lines, float freq,
+ int interlaced, int margins);
+options *parse_command_line (int argc, char *argv[]);
+
+
+
+
+/*
+ * print_value() - print the result of the named computation; this is
+ * useful when comparing against the GTF EXCEL spreadsheet.
+ */
+
+int global_verbose = 0;
+
+void print_value(int n, char *name, float val)
+{
+ if (global_verbose) {
+ printf("%2d: %-27s: %15f\n", n, name, val);
+ }
+}
+
+
+
+/* print_xf86_mode() - print the XFree86 modeline, given mode timings. */
+
+void print_xf86_mode (mode *m)
+{
+ printf ("\n");
+ printf (" # %dx%d @ %.2f Hz (GTF) hsync: %.2f kHz; pclk: %.2f MHz\n",
+ m->hr, m->vr, m->v_freq, m->h_freq, m->pclk);
+
+ printf (" Modeline \"%dx%d_%.2f\" %.2f"
+ " %d %d %d %d"
+ " %d %d %d %d"
+ " -HSync +Vsync\n\n",
+ m->hr, m->vr, m->v_freq, m->pclk,
+ m->hr, m->hss, m->hse, m->hfl,
+ m->vr, m->vss, m->vse, m->vfl);
+
+}
+
+
+
+/*
+ * print_fb_mode() - print a mode description in fbset(8) format;
+ * see the fb.modes(8) manpage. The timing description used in
+ * this is rather odd; they use "left and right margin" to refer
+ * to the portion of the hblank before and after the sync pulse
+ * by conceptually wrapping the portion of the blank after the pulse
+ * to infront of the visible region; ie:
+ *
+ *
+ * Timing description I'm accustomed to:
+ *
+ *
+ *
+ * <--------1--------> <--2--> <--3--> <--4-->
+ * _________
+ * |-------------------|_______| |_______
+ *
+ * R SS SE FL
+ *
+ * 1: visible image
+ * 2: blank before sync (aka front porch)
+ * 3: sync pulse
+ * 4: blank after sync (aka back porch)
+ * R: Resolution
+ * SS: Sync Start
+ * SE: Sync End
+ * FL: Frame Length
+ *
+ *
+ * But the fb.modes format is:
+ *
+ *
+ * <--4--> <--------1--------> <--2--> <--3-->
+ * _________
+ * _______|-------------------|_______| |
+ *
+ * The fb.modes(8) manpage refers to <4> and <2> as the left and
+ * right "margin" (as well as upper and lower margin in the vertical
+ * direction) -- note that this has nothing to do with the term
+ * "margin" used in the GTF Timing Standard.
+ *
+ * XXX always prints the 32 bit mode -- should I provide a command
+ * line option to specify the bpp? It's simple enough for a user
+ * to edit the mode description after it's generated.
+ */
+
+void print_fb_mode (mode *m)
+{
+ printf ("\n");
+ printf ("mode \"%dx%d %.2fHz 32bit (GTF)\"\n",
+ m->hr, m->vr, m->v_freq);
+ printf (" # PCLK: %.2f MHz, H: %.2f kHz, V: %.2f Hz\n",
+ m->pclk, m->h_freq, m->v_freq);
+ printf (" geometry %d %d %d %d 32\n",
+ m->hr, m->vr, m->hr, m->vr);
+ printf (" timings %d %d %d %d %d %d %d\n",
+ (int) rint(1000000.0/m->pclk),/* pixclock in picoseconds */
+ m->hfl - m->hse, /* left margin (in pixels) */
+ m->hss - m->hr, /* right margin (in pixels) */
+ m->vfl - m->vse, /* upper margin (in pixel lines) */
+ m->vss - m->vr, /* lower margin (in pixel lines) */
+ m->hse - m->hss, /* horizontal sync length (pixels) */
+ m->vse - m->vss); /* vert sync length (pixel lines) */
+ printf (" hsync low\n");
+ printf (" vsync high\n");
+ printf ("endmode\n\n");
+
+}
+
+
+
+
+/*
+ * vert_refresh() - as defined by the GTF Timing Standard, compute the
+ * Stage 1 Parameters using the vertical refresh frequency. In other
+ * words: input a desired resolution and desired refresh rate, and
+ * output the GTF mode timings.
+ *
+ * XXX All the code is in place to compute interlaced modes, but I don't
+ * feel like testing it right now.
+ *
+ * XXX margin computations are implemented but not tested (nor used by
+ * XFree86 of fbset mode descriptions, from what I can tell).
+ */
+
+mode *vert_refresh (int h_pixels, int v_lines, float freq,
+ int interlaced, int margins)
+{
+ float h_pixels_rnd;
+ float v_lines_rnd;
+ float v_field_rate_rqd;
+ float top_margin;
+ float bottom_margin;
+ float interlace;
+ float h_period_est;
+ float vsync_plus_bp;
+ float v_back_porch;
+ float total_v_lines;
+ float v_field_rate_est;
+ float h_period;
+ float v_field_rate;
+ float v_frame_rate;
+ float left_margin;
+ float right_margin;
+ float total_active_pixels;
+ float ideal_duty_cycle;
+ float h_blank;
+ float total_pixels;
+ float pixel_freq;
+ float h_freq;
+
+ float h_sync;
+ float h_front_porch;
+ float v_odd_front_porch_lines;
+
+ mode *m = (mode*) malloc (sizeof (mode));
+
+
+ /* 1. In order to give correct results, the number of horizontal
+ * pixels requested is first processed to ensure that it is divisible
+ * by the character size, by rounding it to the nearest character
+ * cell boundary:
+ *
+ * [H PIXELS RND] = ((ROUND([H PIXELS]/[CELL GRAN RND],0))*[CELLGRAN RND])
+ */
+
+ h_pixels_rnd = rint((float) h_pixels / CELL_GRAN) * CELL_GRAN;
+
+ print_value(1, "[H PIXELS RND]", h_pixels_rnd);
+
+
+ /* 2. If interlace is requested, the number of vertical lines assumed
+ * by the calculation must be halved, as the computation calculates
+ * the number of vertical lines per field. In either case, the
+ * number of lines is rounded to the nearest integer.
+ *
+ * [V LINES RND] = IF([INT RQD?]="y", ROUND([V LINES]/2,0),
+ * ROUND([V LINES],0))
+ */
+
+ v_lines_rnd = interlaced ?
+ rint((float) v_lines) / 2.0 :
+ rint((float) v_lines);
+
+ print_value(2, "[V LINES RND]", v_lines_rnd);
+
+
+ /* 3. Find the frame rate required:
+ *
+ * [V FIELD RATE RQD] = IF([INT RQD?]="y", [I/P FREQ RQD]*2,
+ * [I/P FREQ RQD])
+ */
+
+ v_field_rate_rqd = interlaced ? (freq * 2.0) : (freq);
+
+ print_value(3, "[V FIELD RATE RQD]", v_field_rate_rqd);
+
+
+ /* 4. Find number of lines in Top margin:
+ *
+ * [TOP MARGIN (LINES)] = IF([MARGINS RQD?]="Y",
+ * ROUND(([MARGIN%]/100*[V LINES RND]),0),
+ * 0)
+ */
+
+ top_margin = margins ? rint(MARGIN_PERCENT / 100.0 * v_lines_rnd) : (0.0);
+
+ print_value(4, "[TOP MARGIN (LINES)]", top_margin);
+
+
+ /* 5. Find number of lines in Bottom margin:
+ *
+ * [BOT MARGIN (LINES)] = IF([MARGINS RQD?]="Y",
+ * ROUND(([MARGIN%]/100*[V LINES RND]),0),
+ * 0)
+ */
+
+ bottom_margin = margins ? rint(MARGIN_PERCENT/100.0 * v_lines_rnd) : (0.0);
+
+ print_value(5, "[BOT MARGIN (LINES)]", bottom_margin);
+
+
+ /* 6. If interlace is required, then set variable [INTERLACE]=0.5:
+ *
+ * [INTERLACE]=(IF([INT RQD?]="y",0.5,0))
+ */
+
+ interlace = interlaced ? 0.5 : 0.0;
+
+ print_value(6, "[INTERLACE]", interlace);
+
+
+ /* 7. Estimate the Horizontal period
+ *
+ * [H PERIOD EST] = ((1/[V FIELD RATE RQD]) - [MIN VSYNC+BP]/1000000) /
+ * ([V LINES RND] + (2*[TOP MARGIN (LINES)]) +
+ * [MIN PORCH RND]+[INTERLACE]) * 1000000
+ */
+
+ h_period_est = (((1.0/v_field_rate_rqd) - (MIN_VSYNC_PLUS_BP/1000000.0))
+ / (v_lines_rnd + (2*top_margin) + MIN_PORCH + interlace)
+ * 1000000.0);
+
+ print_value(7, "[H PERIOD EST]", h_period_est);
+
+
+ /* 8. Find the number of lines in V sync + back porch:
+ *
+ * [V SYNC+BP] = ROUND(([MIN VSYNC+BP]/[H PERIOD EST]),0)
+ */
+
+ vsync_plus_bp = rint(MIN_VSYNC_PLUS_BP/h_period_est);
+
+ print_value(8, "[V SYNC+BP]", vsync_plus_bp);
+
+
+ /* 9. Find the number of lines in V back porch alone:
+ *
+ * [V BACK PORCH] = [V SYNC+BP] - [V SYNC RND]
+ *
+ * XXX is "[V SYNC RND]" a typo? should be [V SYNC RQD]?
+ */
+
+ v_back_porch = vsync_plus_bp - V_SYNC_RQD;
+
+ print_value(9, "[V BACK PORCH]", v_back_porch);
+
+
+ /* 10. Find the total number of lines in Vertical field period:
+ *
+ * [TOTAL V LINES] = [V LINES RND] + [TOP MARGIN (LINES)] +
+ * [BOT MARGIN (LINES)] + [V SYNC+BP] + [INTERLACE] +
+ * [MIN PORCH RND]
+ */
+
+ total_v_lines = v_lines_rnd + top_margin + bottom_margin + vsync_plus_bp +
+ interlace + MIN_PORCH;
+
+ print_value(10, "[TOTAL V LINES]", total_v_lines);
+
+
+ /* 11. Estimate the Vertical field frequency:
+ *
+ * [V FIELD RATE EST] = 1 / [H PERIOD EST] / [TOTAL V LINES] * 1000000
+ */
+
+ v_field_rate_est = 1.0 / h_period_est / total_v_lines * 1000000.0;
+
+ print_value(11, "[V FIELD RATE EST]", v_field_rate_est);
+
+
+ /* 12. Find the actual horizontal period:
+ *
+ * [H PERIOD] = [H PERIOD EST] / ([V FIELD RATE RQD] / [V FIELD RATE EST])
+ */
+
+ h_period = h_period_est / (v_field_rate_rqd / v_field_rate_est);
+
+ print_value(12, "[H PERIOD]", h_period);
+
+
+ /* 13. Find the actual Vertical field frequency:
+ *
+ * [V FIELD RATE] = 1 / [H PERIOD] / [TOTAL V LINES] * 1000000
+ */
+
+ v_field_rate = 1.0 / h_period / total_v_lines * 1000000.0;
+
+ print_value(13, "[V FIELD RATE]", v_field_rate);
+
+
+ /* 14. Find the Vertical frame frequency:
+ *
+ * [V FRAME RATE] = (IF([INT RQD?]="y", [V FIELD RATE]/2, [V FIELD RATE]))
+ */
+
+ v_frame_rate = interlaced ? v_field_rate / 2.0 : v_field_rate;
+
+ print_value(14, "[V FRAME RATE]", v_frame_rate);
+
+
+ /* 15. Find number of pixels in left margin:
+ *
+ * [LEFT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y",
+ * (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 /
+ * [CELL GRAN RND]),0)) * [CELL GRAN RND],
+ * 0))
+ */
+
+ left_margin = margins ?
+ rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN :
+ 0.0;
+
+ print_value(15, "[LEFT MARGIN (PIXELS)]", left_margin);
+
+
+ /* 16. Find number of pixels in right margin:
+ *
+ * [RIGHT MARGIN (PIXELS)] = (IF( [MARGINS RQD?]="Y",
+ * (ROUND( ([H PIXELS RND] * [MARGIN%] / 100 /
+ * [CELL GRAN RND]),0)) * [CELL GRAN RND],
+ * 0))
+ */
+
+ right_margin = margins ?
+ rint(h_pixels_rnd * MARGIN_PERCENT / 100.0 / CELL_GRAN) * CELL_GRAN :
+ 0.0;
+
+ print_value(16, "[RIGHT MARGIN (PIXELS)]", right_margin);
+
+
+ /* 17. Find total number of active pixels in image and left and right
+ * margins:
+ *
+ * [TOTAL ACTIVE PIXELS] = [H PIXELS RND] + [LEFT MARGIN (PIXELS)] +
+ * [RIGHT MARGIN (PIXELS)]
+ */
+
+ total_active_pixels = h_pixels_rnd + left_margin + right_margin;
+
+ print_value(17, "[TOTAL ACTIVE PIXELS]", total_active_pixels);
+
+
+ /* 18. Find the ideal blanking duty cycle from the blanking duty cycle
+ * equation:
+ *
+ * [IDEAL DUTY CYCLE] = [C'] - ([M']*[H PERIOD]/1000)
+ */
+
+ ideal_duty_cycle = C_PRIME - (M_PRIME * h_period / 1000.0);
+
+ print_value(18, "[IDEAL DUTY CYCLE]", ideal_duty_cycle);
+
+
+ /* 19. Find the number of pixels in the blanking time to the nearest
+ * double character cell:
+ *
+ * [H BLANK (PIXELS)] = (ROUND(([TOTAL ACTIVE PIXELS] *
+ * [IDEAL DUTY CYCLE] /
+ * (100-[IDEAL DUTY CYCLE]) /
+ * (2*[CELL GRAN RND])), 0))
+ * * (2*[CELL GRAN RND])
+ */
+
+ h_blank = rint(total_active_pixels *
+ ideal_duty_cycle /
+ (100.0 - ideal_duty_cycle) /
+ (2.0 * CELL_GRAN)) * (2.0 * CELL_GRAN);
+
+ print_value(19, "[H BLANK (PIXELS)]", h_blank);
+
+
+ /* 20. Find total number of pixels:
+ *
+ * [TOTAL PIXELS] = [TOTAL ACTIVE PIXELS] + [H BLANK (PIXELS)]
+ */
+
+ total_pixels = total_active_pixels + h_blank;
+
+ print_value(20, "[TOTAL PIXELS]", total_pixels);
+
+
+ /* 21. Find pixel clock frequency:
+ *
+ * [PIXEL FREQ] = [TOTAL PIXELS] / [H PERIOD]
+ */
+
+ pixel_freq = total_pixels / h_period;
+
+ print_value(21, "[PIXEL FREQ]", pixel_freq);
+
+
+ /* 22. Find horizontal frequency:
+ *
+ * [H FREQ] = 1000 / [H PERIOD]
+ */
+
+ h_freq = 1000.0 / h_period;
+
+ print_value(22, "[H FREQ]", h_freq);
+
+
+
+ /* Stage 1 computations are now complete; I should really pass
+ the results to another function and do the Stage 2
+ computations, but I only need a few more values so I'll just
+ append the computations here for now */
+
+
+
+ /* 17. Find the number of pixels in the horizontal sync period:
+ *
+ * [H SYNC (PIXELS)] =(ROUND(([H SYNC%] / 100 * [TOTAL PIXELS] /
+ * [CELL GRAN RND]),0))*[CELL GRAN RND]
+ */
+
+ h_sync = rint(H_SYNC_PERCENT/100.0 * total_pixels / CELL_GRAN) * CELL_GRAN;
+
+ print_value(17, "[H SYNC (PIXELS)]", h_sync);
+
+
+ /* 18. Find the number of pixels in the horizontal front porch period:
+ *
+ * [H FRONT PORCH (PIXELS)] = ([H BLANK (PIXELS)]/2)-[H SYNC (PIXELS)]
+ */
+
+ h_front_porch = (h_blank / 2.0) - h_sync;
+
+ print_value(18, "[H FRONT PORCH (PIXELS)]", h_front_porch);
+
+
+ /* 36. Find the number of lines in the odd front porch period:
+ *
+ * [V ODD FRONT PORCH(LINES)]=([MIN PORCH RND]+[INTERLACE])
+ */
+
+ v_odd_front_porch_lines = MIN_PORCH + interlace;
+
+ print_value(36, "[V ODD FRONT PORCH(LINES)]", v_odd_front_porch_lines);
+
+
+ /* finally, pack the results in the mode struct */
+
+ m->hr = (int) (h_pixels_rnd);
+ m->hss = (int) (h_pixels_rnd + h_front_porch);
+ m->hse = (int) (h_pixels_rnd + h_front_porch + h_sync);
+ m->hfl = (int) (total_pixels);
+
+ m->vr = (int) (v_lines_rnd);
+ m->vss = (int) (v_lines_rnd + v_odd_front_porch_lines);
+ m->vse = (int) (int) (v_lines_rnd + v_odd_front_porch_lines + V_SYNC_RQD);
+ m->vfl = (int) (total_v_lines);
+
+ m->pclk = pixel_freq;
+ m->h_freq = h_freq;
+ m->v_freq = freq;
+
+ return (m);
+
+}
+
+
+
+
+/*
+ * parse_command_line() - parse the command line and return an
+ * alloced structure containing the results. On error print usage
+ * and return NULL.
+ */
+
+options *parse_command_line (int argc, char *argv[])
+{
+ int n;
+
+ options *o = (options *) calloc (1, sizeof (options));
+
+ if (argc < 4) goto bad_option;
+
+ o->x = atoi (argv[1]);
+ o->y = atoi (argv[2]);
+ o->v_freq = atof (argv[3]);
+
+ /* XXX should check for errors in the above */
+
+ n = 4;
+
+ while (n < argc) {
+ if ((strcmp (argv[n], "-v") == 0) ||
+ (strcmp (argv[n], "--verbose") == 0)) {
+ global_verbose = 1;
+ } else if ((strcmp (argv[n], "-f") == 0) ||
+ (strcmp (argv[n], "--fbmode") == 0)) {
+ o->fbmode = 1;
+ } else if ((strcmp (argv[n], "-x") == 0) ||
+ (strcmp (argv[n], "--xf86mode") == 0)) {
+ o->xf86mode = 1;
+ } else {
+ goto bad_option;
+ }
+
+ n++;
+ }
+
+ /* if neither xf86mode nor fbmode were requested, default to
+ xf86mode */
+
+ if (!o->fbmode && !o->xf86mode) o->xf86mode = 1;
+
+ return (o);
+
+ bad_option:
+
+ fprintf (stderr, "\n");
+ fprintf (stderr, "usage: %s x y refresh [-v|--verbose] "
+ "[-f|--fbmode] [-x|-xf86mode]\n", argv[0]);
+
+ fprintf (stderr, "\n");
+
+ fprintf (stderr, " x : the desired horizontal "
+ "resolution (required)\n");
+ fprintf (stderr, " y : the desired vertical "
+ "resolution (required)\n");
+ fprintf (stderr, " refresh : the desired refresh "
+ "rate (required)\n");
+ fprintf (stderr, " -v|--verbose : enable verbose printouts "
+ "(traces each step of the computation)\n");
+ fprintf (stderr, " -f|--fbmode : output an fbset(8)-style mode "
+ "description\n");
+ fprintf (stderr, " -x|-xf86mode : output an XFree86-style mode "
+ "description (this is the default\n"
+ " if no mode description is requested)\n");
+
+ fprintf (stderr, "\n");
+
+ free (o);
+ return (NULL);
+
+}
+
+
+
+int main (int argc, char *argv[])
+{
+ mode *m;
+ options *o;
+
+ o = parse_command_line (argc, argv);
+ if (!o) exit (1);
+
+ m = vert_refresh (o->x, o->y, o->v_freq, 0, 0);
+ if (!m) exit (1);
+
+ if (o->xf86mode)
+ print_xf86_mode(m);
+
+ if (o->fbmode)
+ print_fb_mode(m);
+
+ return 0;
+
+}
diff --git a/hw/xfree86/utils/gtf/gtf.man.pre b/hw/xfree86/utils/gtf/gtf.man.pre
new file mode 100644
index 000000000..f2d2ae9ec
--- /dev/null
+++ b/hw/xfree86/utils/gtf/gtf.man.pre
@@ -0,0 +1,45 @@
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/gtf.man,v 1.1 2002/11/12 01:31:23 dawes Exp $
+.TH GTF 1 __vendorversion__
+.SH NAME
+gtf - calculate VESA GTF mode lines
+.SH SYNOPSIS
+.B gtf
+.I h-resolution
+.I v-resolution
+.I refresh
+.RB [ \-v | \-\-verbose ]
+.RB [ \-f | \-\-fbmode ]
+.RB [ \-x | \-\-xf86mode ]
+.SH DESCRIPTION
+.I Gtf
+is a utility for calculating VESA GTF modes. Given the desired
+horizontal and vertical resolutions and refresh rate (in Hz), the parameters
+for a matching VESA GTF mode are printed out. Two output formats are
+supported: mode lines suitable for the XFree86
+.B XF86Config(__filemansuffix__)
+file, and mode parameters suitable for the Linux
+.B fbset(8)
+utility.
+
+.SH OPTIONS
+.TP 8
+.BR \-v | \-\-verbose
+Enable verbose printouts This shows a trace for each step of the
+computation.
+.TP 8
+.BR \-x | \-\-xf86mode
+Print the mode parameters as XFree86-style mode lines. This is the
+default format.
+.TP 8
+.BR \-f | \-\-fbset
+Print the mode parameters in a format suitable for
+.BR fbset(8) .
+.SH "SEE ALSO"
+XF86Config(__filemansuffix__)
+.SH AUTHOR
+Andy Ritger.
+.PP
+This program is based on the Generalized Timing Formula (GTF(TM)) Standard
+Version: 1.0, Revsion: 1.0. The GTF Excel(TM) spreadsheet, a sample
+(and the definitive) implementation of the GTF Timing Standard is
+available at <ftp://ftp.vesa.org/pub/GTF/VTF_V1R1.xls>.
diff --git a/hw/xfree86/utils/ioport/ioport.c b/hw/xfree86/utils/ioport/ioport.c
new file mode 100644
index 000000000..4bb20ef1b
--- /dev/null
+++ b/hw/xfree86/utils/ioport/ioport.c
@@ -0,0 +1,493 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/ioport.c,v 1.4 2003/01/01 19:16:41 tsi Exp $ */
+/*
+ * Copyright 2002 through 2003 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
+ *
+ * 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 Marc Aurele La France not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Marc Aurele La France makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as-is" without express or implied warranty.
+ *
+ * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
+ * EVENT SHALL MARC AURELE LA FRANCE 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.
+ */
+
+#include "compiler.h"
+#include "xf86_OSproc.h"
+
+#include <errno.h>
+
+static char *MyName;
+static int Port = -1, Index = -1;
+static unsigned int Value;
+
+static void
+inb_usage
+(
+#ifdef __STDC__
+ void
+#endif
+)
+{
+ fprintf(stderr, "inb [-i <index>] <port>\n");
+}
+
+static void
+inw_usage
+(
+#ifdef __STDC__
+ void
+#endif
+)
+{
+ fprintf(stderr, "inw [-i <index>] <port>\n");
+}
+
+static void
+inl_usage
+(
+#ifdef __STDC__
+ void
+#endif
+)
+{
+ fprintf(stderr, "inl [-i <index>] <port>\n");
+}
+
+
+static void
+outb_usage
+(
+#ifdef __STDC__
+ void
+#endif
+)
+{
+ fprintf(stderr, "outb [-i <index>] <port> <value>\n");
+}
+
+static void
+outw_usage
+(
+#ifdef __STDC__
+ void
+#endif
+)
+{
+ fprintf(stderr, "outw [-i <index>] <port> <value>\n");
+}
+
+static void
+outl_usage
+(
+#ifdef __STDC__
+ void
+#endif
+)
+{
+ fprintf(stderr, "outl [-i <index>] <port> <value>\n");
+}
+
+static int
+#ifdef __STDC__
+parse_number
+(
+ const char *String,
+ void (* Usage)(void),
+ unsigned int Maximum)
+#else
+parse_number(String, Usage, Maximum)
+ const char *String;
+ void (* Usage)();
+ unsigned int Maximum;
+#endif
+{
+ char *BadString = (char *)0;
+ unsigned int Number = strtoul(String, &BadString, 0);
+ if ((Number > Maximum) || errno ||
+ (BadString && *BadString))
+ {
+ (*Usage)();
+ exit(1);
+ }
+
+ return (Number);
+}
+
+static void
+#ifdef __STDC__
+input_parse
+(
+ int argc,
+ char **argv,
+ void (* Usage)(void))
+#else
+input_parse(argc, argv, Usage)
+ int argc;
+ char **argv;
+ void (* Usage)();
+#endif
+{
+ if ((argc < 2) || (argc > 4))
+ {
+ (*Usage)();
+ exit(1);
+ }
+
+ for(; (++argv, --argc); )
+ {
+ if ((Index < 0) &&
+ (argv[0][0] == '-') &&
+ (argv[0][1] == 'i'))
+ {
+ if ((++argv[0], *(++argv[0])) || (++argv, --argc))
+ Index = parse_number(argv[0], Usage, 0xFFU);
+ else
+ {
+ (*Usage)();
+ exit(1);
+ }
+ }
+ else if (Port < 0)
+ {
+ Port = parse_number(argv[0], Usage, 0xFFFFU);
+ }
+ else
+ {
+ (*Usage)();
+ exit(1);
+ }
+ }
+}
+
+static void
+#ifdef __STDC__
+output_parse
+(
+ int argc,
+ char **argv,
+ void (* Usage)(void),
+ unsigned int Maximum
+)
+#else
+output_parse(argc, argv, Usage, Maximum)
+ int argc;
+ char **argv;
+ void (* Usage)();
+ unsigned int Maximum;
+#endif
+{
+ char ValueSpecified = 0;
+
+ if ((argc < 3) || (argc > 5))
+ {
+ (*Usage)();
+ exit(1);
+ }
+
+ for (; (++argv, --argc); )
+ {
+ if ((Index < 0) &&
+ (argv[0][0] == '-') &&
+ (argv[0][1] == 'i'))
+ {
+ if ((++argv[0], *(++argv[0])) || (++argv, --argc))
+ Index = parse_number(argv[0], Usage, 0xFFU);
+ else
+ {
+ (*Usage)();
+ exit(1);
+ }
+ }
+ else if (Port < 0)
+ {
+ Port = parse_number(argv[0], Usage, 0xFFFFU);
+ }
+ else if (!ValueSpecified)
+ {
+ Value = parse_number(argv[0], Usage, Maximum);
+ ValueSpecified = 1;
+ }
+ else
+ {
+ (*Usage)();
+ exit(1);
+ }
+ }
+
+ if (!ValueSpecified)
+ {
+ (*Usage)();
+ exit(1);
+ }
+}
+
+static void
+#ifdef __STDC__
+do_inb
+(
+ int argc,
+ char **argv
+)
+#else
+do_inb(argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+ input_parse(argc, argv, inb_usage);
+
+ xf86EnableIO();
+
+ if (Index >= 0)
+ {
+ if (Port == 0x03C0U)
+ { /* Attribute Controller is different */
+ unsigned short gens1;
+
+ gens1 = ((inb(0x03CCU) & 0x01U) << 5) + 0x03BA;
+ (void) inb(gens1);
+ Index = (Index & 0x1FU) | 0x20U;
+ }
+ outb(Port, Index);
+ Port++;
+ }
+ Value = inb(Port);
+
+ xf86DisableIO();
+
+ printf("0x%02X\n", Value);
+}
+
+static void
+#ifdef __STDC__
+do_inw
+(
+ int argc,
+ char **argv
+)
+#else
+do_inw(argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+ input_parse(argc, argv, inw_usage);
+
+ xf86EnableIO();
+
+ if (Index >= 0)
+ {
+ outb(Port, Index);
+ Port++;
+ }
+ Value = inw(Port);
+
+ xf86DisableIO();
+
+ printf("0x%04X\n", Value);
+}
+
+static void
+#ifdef __STDC__
+do_inl
+(
+ int argc,
+ char **argv
+)
+#else
+do_inl(argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+ input_parse(argc, argv, inl_usage);
+
+ xf86EnableIO();
+
+ if (Index >= 0)
+ {
+ outb(Port, Index);
+ Port++;
+ }
+ Value = inl(Port);
+
+ xf86DisableIO();
+
+ printf("0x%08X\n", Value);
+}
+
+static void
+#ifdef __STDC__
+do_outb
+(
+ int argc,
+ char **argv
+)
+#else
+do_outb(argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+ output_parse(argc, argv, outb_usage, 0xFFU);
+
+ xf86EnableIO();
+
+ if (Index >= 0)
+ {
+ if (Port == 0x03C0U)
+ { /* Attribute controller is different */
+ unsigned short gens1;
+
+ gens1 = ((inb(0x03CCU) & 0x01U) << 5) + 0x03BA;
+ (void) inb(gens1);
+ outb(0x03C0U, (Index & 0x1FU) | 0x20U);
+ }
+ else
+ {
+ outb(Port, Index);
+ Port++;
+ }
+ }
+ outb(Port, Value);
+
+ xf86DisableIO();
+
+}
+
+static void
+#ifdef __STDC__
+do_outw
+(
+ int argc,
+ char **argv
+)
+#else
+do_outw(argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+ output_parse(argc, argv, outw_usage, 0xFFFFU);
+
+ xf86EnableIO();
+
+ if (Index >= 0)
+ {
+ outb(Port, Index);
+ Port++;
+ }
+ outw(Port, Value);
+
+ xf86DisableIO();
+
+}
+
+static void
+#ifdef __STDC__
+do_outl
+(
+ int argc,
+ char **argv
+)
+#else
+do_outl(argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+ output_parse(argc, argv, outl_usage, 0xFFFFFFFFU);
+
+ xf86EnableIO();
+
+ if (Index >= 0)
+ {
+ outb(Port, Index);
+ Port++;
+ }
+ outl(Port, Value);
+
+ xf86DisableIO();
+
+}
+
+static void
+usage
+(
+#ifdef __STDC__
+ void
+#endif
+)
+{
+ inb_usage();
+ inw_usage();
+ inl_usage();
+ outb_usage();
+ outw_usage();
+ outl_usage();
+ exit(1);
+}
+
+int
+#ifdef __STDC__
+main
+(
+ int argc,
+ char **argv
+)
+#else
+main(argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+ struct
+ {
+ char *Name;
+#ifdef __STDC__
+ void (* Function)(int, char **);
+#else
+ void (* Function)();
+#endif
+ }
+ *Function_Entry, Function_Table[] =
+ {
+ {"inb", do_inb},
+ {"inw", do_inw},
+ {"inl", do_inl},
+ {"outb", do_outb},
+ {"outw", do_outw},
+ {"outl", do_outl},
+#ifdef __STDC__
+ {(char *)0, (void (*)(int, char **))usage}
+#else
+ {(char *)0, usage}
+#endif
+ };
+
+ /* Get name by which we were invoked */
+ for (MyName = argv[0]; argv[0][0]; )
+ if (*(argv[0]++) == '/')
+ MyName = argv[0];
+
+ /* Look up name in table and call corresponding function */
+ for (Function_Entry = Function_Table;
+ Function_Entry->Name &&
+ strcmp(MyName, Function_Entry->Name);
+ Function_Entry++);
+ (*Function_Entry->Function)(argc, argv);
+
+ return (0);
+}
+
+#include "xf86getpagesize.c"
diff --git a/hw/xfree86/utils/pcitweak/pcitweak.c b/hw/xfree86/utils/pcitweak/pcitweak.c
new file mode 100644
index 000000000..42a9f9712
--- /dev/null
+++ b/hw/xfree86/utils/pcitweak/pcitweak.c
@@ -0,0 +1,217 @@
+/*
+ * pcitweak.c
+ *
+ * Copyright 1999 by The XFree86 Project, Inc.
+ *
+ * Author: David Dawes <dawes@xfree86.org>
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.c,v 1.16 2002/12/14 04:41:13 dawes Exp $ */
+
+#include "X.h"
+#include "os.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSproc.h"
+#include "xf86Pci.h"
+
+#ifdef __CYGWIN__
+#include <getopt.h>
+#endif
+
+#include <stdarg.h>
+#include <stdlib.h>
+#ifdef __linux__
+/* to get getopt on Linux */
+#ifndef __USE_POSIX2
+#define __USE_POSIX2
+#endif
+#endif
+#include <unistd.h>
+#if defined(ISC) || defined(Lynx)
+extern char *optarg;
+extern int optind, opterr;
+#endif
+
+pciVideoPtr *xf86PciVideoInfo = NULL;
+
+static void usage(void);
+static Bool parsePciBusString(const char *id, int *bus, int *device, int *func);
+static char *myname = NULL;
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ PCITAG tag;
+ int bus, device, func;
+ Bool list = FALSE, rd = FALSE, wr = FALSE;
+ Bool byte = FALSE, halfword = FALSE;
+ int offset = 0;
+ CARD32 value = 0;
+ char *id = NULL, *end;
+
+ myname = argv[0];
+ while ((c = getopt(argc, argv, "bhlr:w:")) != -1) {
+ switch (c) {
+ case 'b':
+ byte = TRUE;
+ break;
+ case 'h':
+ halfword = TRUE;
+ break;
+ case 'l':
+ list = TRUE;
+ break;
+ case 'r':
+ rd = TRUE;
+ id = optarg;
+ break;
+ case 'w':
+ wr = TRUE;
+ id = optarg;
+ break;
+ case '?':
+ default:
+ usage();
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (list) {
+ xf86Verbose = 2;
+ xf86EnableIO();
+ xf86scanpci(0);
+ xf86DisableIO();
+ exit(0);
+ }
+
+ if (rd && wr)
+ usage();
+ if (wr && argc != 2)
+ usage();
+ if (rd && argc != 1)
+ usage();
+ if (byte && halfword)
+ usage();
+
+ if (rd || wr) {
+ if (!parsePciBusString(id, &bus, &device, &func)) {
+ fprintf(stderr, "%s: Bad PCI ID string\n", myname);
+ usage();
+ }
+ offset = strtoul(argv[0], &end, 0);
+ if (*end != '\0') {
+ fprintf(stderr, "%s: Bad offset\n", myname);
+ usage();
+ }
+ if (halfword) {
+ if (offset % 2) {
+ fprintf(stderr, "%s: offset must be a multiple of two\n",
+ myname);
+ exit(1);
+ }
+ } else if (!byte) {
+ if (offset % 4) {
+ fprintf(stderr, "%s: offset must be a multiple of four\n",
+ myname);
+ exit(1);
+ }
+ }
+ } else {
+ usage();
+ }
+
+ if (wr) {
+ value = strtoul(argv[1], &end, 0);
+ if (*end != '\0') {
+ fprintf(stderr, "%s: Bad value\n", myname);
+ usage();
+ }
+ }
+
+ xf86EnableIO();
+
+ /*
+ * This is needed to setup all the buses. Otherwise secondary buses
+ * can't be accessed.
+ */
+ xf86scanpci(0);
+
+ tag = pciTag(bus, device, func);
+ if (rd) {
+ if (byte) {
+ printf("0x%02x\n", (unsigned int)pciReadByte(tag, offset) & 0xFF);
+ } else if (halfword) {
+ printf("0x%04x\n", (unsigned int)pciReadWord(tag, offset) & 0xFFFF);
+ } else {
+ printf("0x%08lx\n", (unsigned long)pciReadLong(tag, offset));
+ }
+ } else if (wr) {
+ if (byte) {
+ pciWriteByte(tag, offset, value & 0xFF);
+ } else if (halfword) {
+ pciWriteWord(tag, offset, value & 0xFFFF);
+ } else {
+ pciWriteLong(tag, offset, value);
+ }
+ }
+
+ xf86DisableIO();
+ exit(0);
+}
+
+static void
+usage()
+{
+ fprintf(stderr, "usage:\tpcitweak -l\n"
+ "\tpcitweak -r ID [-b | -h] offset\n"
+ "\tpcitweak -w ID [-b | -h] offset value\n"
+ "\n"
+ "\t\t-l -- list\n"
+ "\t\t-r -- read\n"
+ "\t\t-w -- write\n"
+ "\t\t-b -- read/write a single byte\n"
+ "\t\t-h -- read/write a single halfword (16 bit)\n"
+ "\t\tID -- PCI ID string in form bus:dev:func "
+ "(all in hex)\n");
+
+ exit(1);
+}
+
+Bool
+parsePciBusString(const char *busID, int *bus, int *device, int *func)
+{
+ /*
+ * The format is assumed to be "bus:device:func", where bus, device
+ * and func are hexadecimal integers. func may be omitted and assumed to
+ * be zero, although it doing this isn't encouraged.
+ */
+
+ char *p, *s, *end;
+
+ s = strdup(busID);
+ p = strtok(s, ":");
+ if (p == NULL || *p == 0)
+ return FALSE;
+ *bus = strtoul(p, &end, 16);
+ if (*end != '\0')
+ return FALSE;
+ p = strtok(NULL, ":");
+ if (p == NULL || *p == 0)
+ return FALSE;
+ *device = strtoul(p, &end, 16);
+ if (*end != '\0')
+ return FALSE;
+ *func = 0;
+ p = strtok(NULL, ":");
+ if (p == NULL || *p == 0)
+ return TRUE;
+ *func = strtoul(p, &end, 16);
+ if (*end != '\0')
+ return FALSE;
+ return TRUE;
+}
+
+#include "xf86getpagesize.c"
+
diff --git a/hw/xfree86/utils/pcitweak/pcitweak.man.pre b/hw/xfree86/utils/pcitweak/pcitweak.man.pre
new file mode 100644
index 000000000..f4bd8d405
--- /dev/null
+++ b/hw/xfree86/utils/pcitweak/pcitweak.man.pre
@@ -0,0 +1,64 @@
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.3 2001/01/27 18:20:56 dawes Exp $
+.TH PCITWEAK 1 __vendorversion__
+.SH NAME
+pcitweak - read/write PCI config space
+.SH SYNOPSIS
+.B pcitweak
+.B \-l
+.br
+.B pcitweak
+.B \-r
+.I PCI-ID
+.RB [ \-b | \-h ]
+.I offset
+.br
+.B pcitweak
+.B \-w
+.I PCI-ID
+.RB [ \-b | \-h ]
+.I offset
+.I value
+.SH DESCRIPTION
+.I Pcitweak
+is a utility that can be used to examine or change registers in the PCI
+configuration space. On most platfoms
+.I pcitweak
+can only be run by the root user.
+.SH OPTIONS
+.TP 8
+.B \-l
+Probe the PCI buses and print a line for each detected device. Each line
+contains the bus location (bus:device:function), chip vendor/device, card
+(subsystem) vendor/card, revision, class and header type. All values
+printed are in hexadecimal.
+.TP 8
+.BI "\-r " PCI-ID
+Read the PCI configuration space register at
+.I offset
+for the PCI device at bus location
+.IR PCI-ID .
+.I PCI-ID
+should be given in the form bus:device:function, with each value in
+hexadecimal. By default, a 32-bit register is read.
+.TP 8
+.BI "\-w " PCI-ID
+Write
+.I value
+to the PCI configuration space register at
+.I offset
+for the PCI device at bus location
+.IR PCI-ID .
+.I PCI-ID
+should be given in the form bus:device:function, with each value in
+hexadecimal. By default, a 32-bit register is written.
+.TP 8
+.B \-b
+Read or write an 8-bit value (byte).
+.TP 8
+.B \-h
+Read or write a 16-bit value (halfword).
+.SH "SEE ALSO"
+scanpci(1)
+.SH AUTHORS
+David Dawes
+.RI ( dawes@xfree86.org ).
diff --git a/hw/xfree86/utils/scanpci/scanpci.man.pre b/hw/xfree86/utils/scanpci/scanpci.man.pre
new file mode 100644
index 000000000..baf231603
--- /dev/null
+++ b/hw/xfree86/utils/scanpci/scanpci.man.pre
@@ -0,0 +1,42 @@
+.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.man,v 3.3 2001/01/27 18:20:56 dawes Exp $
+.TH SCANPCI 1 __vendorversion__
+.SH NAME
+scanpci - scan/probe PCI buses
+.SH SYNOPSIS
+.B scanpci
+.RB [ \-v12OfV ]
+.SH DESCRIPTION
+.I Scanpci
+is a utility that can be used to scan PCI buses and report information
+about the configuration space settings for each PCI device.
+On most platforms,
+.I scanpci
+can only be run by the root user.
+.SH OPTIONS
+.TP 8
+.B \-v
+Print the configuration space information for each device in a verbose
+format. Without this option, only a brief description is printed for
+each device.
+.TP 8
+.B \-1
+Use PCI config type 1.
+.TP 8
+.B \-2
+Use PCI config type 2.
+.TP 8
+.B \-f
+Used in conjunction with the above two options, this forces the specified
+configuration type to be used for config space access.
+.TP 8
+.B \-O
+Use the OS's PCI config space access mechanism to access the PCI config
+space (when available).
+.TP 8
+.BI "\-V " n
+Set the verbosity level to
+.I n
+for the internal PCI scanner. This is primarily for debugging use.
+.SH "SEE ALSO"
+pcitweak(1)
+.SH AUTHORS
diff --git a/hw/xfree86/utils/xorgcfg/TODO b/hw/xfree86/utils/xorgcfg/TODO
new file mode 100644
index 000000000..75fe91b95
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/TODO
@@ -0,0 +1,33 @@
+$XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/TODO,v 1.1 2001/07/04 16:09:14 paulo Exp $
+
+o Have code to fetch the SymTabRec chipset list from a video driver.
+ This is mostly useful for the testing tool/interface, so that the
+ Cards file "uptodate" state can also be verified.
+ Probably it is better to forgot about the Cards file, and
+ either parse the output of scanpci, or link libscanpci.a
+ (and whatever else be required) in xf86cfg.
+
+o Check if a module is "certified", there was some talk about a
+ certification process in the past.
+
+o Rewrite mouse driver to use the same code as video drivers, so that
+ it is possible to store all available options in a single place.
+ This would also require rewriting all existing input device modules.
+ (Probably most of this can be made with cpp macros).
+
+o Create a protocol to allow 3rd part xf86cfg modules.
+
+o Write an interface for testing extensions/accel, maybe a frontend to
+ xdpyinfo, x11perf, glxinfo, etc.
+
+o Write a "wizard" mode, as several users find the graphical interface
+ too complicated, but find the text one easier to user.
+
+o Write code to use a Monitors database, either update the old Monitors
+ file or use RedHat MonitorsDB.
+ Chris Morgan is writting code to use MonitorsDB.
+ If xf86cfg could be changed to ddcprobe (in all supported platforms),
+ it would be even be a better solution than using a database.
+
+o Add interface to allow changing comments without the need of editing
+ XF86Config with a text editor.
diff --git a/hw/xfree86/utils/xorgcfg/accessx.c b/hw/xfree86/utils/xorgcfg/accessx.c
new file mode 100644
index 000000000..40727ff62
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/accessx.c
@@ -0,0 +1,682 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/accessx.c,v 1.10 2002/12/05 19:31:18 paulo Exp $
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <X11/XKBlib.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Scrollbar.h>
+#include <X11/Xaw/Toggle.h>
+#include "keyboard-cfg.h"
+
+#define MAX_TIMEOUT 20
+#define MAX_MOUSE_SPEED 500
+#define MAX_MOUSE_TIME 4
+#define MAX_MOUSE_DELAY 2.09
+#define MAX_REPEAT_RATE 8.04
+#define MAX_REPEAT_DELAY 6.04
+#define MAX_SLOW_TIME 4
+#define MAX_BOUNCE_TIME 4
+
+/*
+ * Types
+ */
+typedef struct {
+ Widget label, number, scroller;
+ double min, max, value, resolution;
+ Bool integer;
+} Scale;
+
+/*
+ * Initialization
+ */
+static Widget shell, accessx, enable, timeoutToggle, form, apply;
+static Widget sticky, stickyAuto, stickyBeep;
+static Widget mouse;
+static Widget repeat;
+static Widget slowToggle, slowPressed, slowAccepted;
+static Widget bounceToggle;
+static Scale *timeout, *mouseSpeed, *mouseTime, *mouseDelay, *slow,
+ *repeatRate, *repeatDelay, *bounce;
+extern Widget work;
+
+/*
+ * Prototypes
+ */
+static void CreateAccessXHelpDialog(void);
+static void EnableCallback(Widget, XtPointer, XtPointer);
+static void ScaleEnableCallback(Widget, XtPointer, XtPointer);
+static void ScaleJumpCallback(Widget, XtPointer, XtPointer);
+
+static void ApplyCallback(Widget, XtPointer, XtPointer);
+static void AccessXInitialize(void);
+
+void CloseAccessXAction(Widget, XEvent*, String*, Cardinal*);
+void AccessXConfigureStart(void);
+void AccessXConfigureEnd(void);
+
+/*
+ * Implementation
+ */
+void
+startaccessx(void)
+{
+ InitializeKeyboard();
+
+ if (xkb_info->xkb) {
+ XkbGetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
+ if (xkb_info->xkb->ctrls == NULL)
+ xkb_info->xkb->ctrls = (XkbControlsPtr)
+ XtCalloc(1, sizeof(XkbControlsRec));
+
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbMouseKeysMask |
+ XkbMouseKeysAccelMask;
+ xkb_info->xkb->ctrls->mk_delay = 40;
+ xkb_info->xkb->ctrls->mk_interval = 10;
+ xkb_info->xkb->ctrls->mk_time_to_max = 1000;
+ xkb_info->xkb->ctrls->mk_max_speed = 500;
+ xkb_info->xkb->ctrls->mk_curve = 0;
+ XkbSetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
+ (void)UpdateKeyboard(True);
+ CreateAccessXHelpDialog();
+ }
+}
+
+void
+CreateAccessXHelpDialog()
+{
+ Widget form;
+
+ shell = XtVaCreatePopupShell("accessx", transientShellWidgetClass, toplevel,
+ XtNx, toplevel->core.x + toplevel->core.width,
+ XtNy, toplevel->core.y, NULL, 0);
+ form = XtCreateManagedWidget("form", formWidgetClass, shell, NULL, 0);
+ XtCreateManagedWidget("label", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("lock", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("div", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("mul", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("minus", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("7", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("8", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("9", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("plus", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("4", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("5", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("6", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("1", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("2", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("3", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("enter", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("0", labelWidgetClass, form, NULL, 0);
+ XtCreateManagedWidget("del", labelWidgetClass, form, NULL, 0);
+
+ XtRealizeWidget(shell);
+ XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
+ XtPopup(shell, XtGrabNone);
+}
+
+/*ARGSUSED*/
+void
+CloseAccessXAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ XtPopdown(shell);
+}
+
+static void
+AccessXInitialize(void)
+{
+ static int first = 1;
+ Arg args[1];
+ Boolean state;
+ Widget stickyForm, mouseForm, repeatForm, slowForm, bounceForm;
+ float val, tmp;
+
+ if (!first)
+ return;
+ first = 0;
+
+ InitializeKeyboard();
+
+ XkbGetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
+ if (xkb_info->xkb->ctrls == NULL)
+ xkb_info->xkb->ctrls = (XkbControlsPtr)
+ XtCalloc(1, sizeof(XkbControlsRec));
+
+ timeout = XtNew(Scale);
+ accessx = XtCreateWidget("accessxForm", formWidgetClass, work, NULL, 0);
+ enable = XtVaCreateManagedWidget("enable", toggleWidgetClass, accessx,
+ XtNstate,
+ (xkb_info->xkb->ctrls->enabled_ctrls &
+ (XkbAccessXKeysMask | XkbStickyKeysMask |
+ XkbSlowKeysMask | XkbBounceKeysMask)) != 0, NULL, 0);
+
+ apply = XtCreateManagedWidget("apply", commandWidgetClass, accessx, NULL, 0);
+ XtAddCallback(apply, XtNcallback, ApplyCallback, NULL);
+
+ form = XtCreateManagedWidget("Accessx", formWidgetClass, accessx, NULL, 0);
+ timeoutToggle = XtVaCreateManagedWidget("timeoutToggle", toggleWidgetClass,
+ form, XtNstate,
+ xkb_info->xkb->ctrls->ax_timeout > 60
+ && xkb_info->xkb->ctrls->ax_timeout
+ < 30000, NULL, 0);
+ XtAddCallback(timeoutToggle, XtNcallback, ScaleEnableCallback,
+ (XtPointer)timeout);
+ timeout->label = XtCreateManagedWidget("timeoutLabel", labelWidgetClass,
+ form, NULL, 0);
+ timeout->number = XtCreateManagedWidget("timeoutNumber", labelWidgetClass,
+ form, NULL, 0);
+ timeout->scroller = XtCreateManagedWidget("timeoutScroller",
+ scrollbarWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(timeout->scroller, XtNjumpProc, ScaleJumpCallback,
+ (XtPointer)timeout);
+ timeout->min = 1;
+ timeout->max = MAX_TIMEOUT;
+ timeout->resolution = 1;
+ timeout->integer = True;
+
+ sticky = XtVaCreateManagedWidget("sticky", toggleWidgetClass, form,
+ XtNstate,
+ (xkb_info->xkb->ctrls->enabled_ctrls &
+ XkbStickyKeysMask) != 0, NULL, 0);
+ stickyForm = XtCreateManagedWidget("stickyForm", formWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(sticky, XtNcallback, EnableCallback, (XtPointer)stickyForm);
+ stickyAuto = XtVaCreateManagedWidget("auto", toggleWidgetClass, stickyForm,
+ XtNstate,
+ (xkb_info->xkb->ctrls->ax_options &
+ XkbAX_LatchToLockMask) == 0, NULL, 0);
+ stickyBeep = XtVaCreateManagedWidget("beep", toggleWidgetClass, stickyForm,
+ XtNstate,
+ (xkb_info->xkb->ctrls->ax_options &
+ XkbAX_StickyKeysFBMask) != 0, NULL, 0);
+
+ mouse = XtVaCreateManagedWidget("mouseKeys", toggleWidgetClass, form,
+ XtNstate,
+ (xkb_info->xkb->ctrls->enabled_ctrls &
+ (XkbMouseKeysMask | XkbMouseKeysAccelMask))
+ != 0, NULL, 0);
+ mouseForm = XtCreateManagedWidget("mouseForm", formWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(mouse, XtNcallback, EnableCallback, (XtPointer)mouseForm);
+ mouseSpeed = XtNew(Scale);
+ mouseSpeed->label = XtCreateManagedWidget("speedLabel", labelWidgetClass,
+ mouseForm, NULL, 0);
+ mouseSpeed->number = XtCreateManagedWidget("speedNumber", labelWidgetClass,
+ mouseForm, NULL, 0);
+ mouseSpeed->scroller = XtCreateManagedWidget("speedScroller",
+ scrollbarWidgetClass,
+ mouseForm, NULL, 0);
+ XtAddCallback(mouseSpeed->scroller, XtNjumpProc, ScaleJumpCallback,
+ (XtPointer)mouseSpeed);
+ mouseSpeed->min = 10;
+ mouseSpeed->max = MAX_MOUSE_SPEED;
+ mouseSpeed->resolution = 10;
+ mouseSpeed->integer = True;
+ mouseTime = XtNew(Scale);
+ mouseTime->label = XtCreateManagedWidget("timeLabel", labelWidgetClass,
+ mouseForm, NULL, 0);
+ mouseTime->number = XtCreateManagedWidget("timeNumber", labelWidgetClass,
+ mouseForm, NULL, 0);
+ mouseTime->scroller = XtCreateManagedWidget("timeScroller",
+ scrollbarWidgetClass,
+ mouseForm, NULL, 0);
+ XtAddCallback(mouseTime->scroller, XtNjumpProc, ScaleJumpCallback,
+ (XtPointer)mouseTime);
+ mouseTime->min = .1;
+ mouseTime->max = MAX_MOUSE_TIME;
+ mouseTime->resolution = .1;
+ mouseTime->integer = False;
+ mouseDelay = XtNew(Scale);
+ mouseDelay->label = XtCreateManagedWidget("delayLabel", labelWidgetClass,
+ mouseForm, NULL, 0);
+ mouseDelay->number = XtCreateManagedWidget("delayNumber", labelWidgetClass,
+ mouseForm, NULL, 0);
+ mouseDelay->scroller = XtCreateManagedWidget("delayScroller",
+ scrollbarWidgetClass,
+ mouseForm, NULL, 0);
+ XtAddCallback(mouseDelay->scroller, XtNjumpProc, ScaleJumpCallback,
+ (XtPointer)mouseDelay);
+ mouseDelay->min = .1;
+ mouseDelay->max = MAX_MOUSE_DELAY;
+ mouseDelay->resolution = .1;
+ mouseDelay->integer = False;
+
+ repeat = XtVaCreateManagedWidget("repeatKeys", toggleWidgetClass, form,
+ XtNstate,
+ (xkb_info->xkb->ctrls->enabled_ctrls &
+ XkbRepeatKeysMask) != 0, NULL, 0);
+ repeatForm = XtCreateManagedWidget("repeatForm", formWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(repeat, XtNcallback, EnableCallback, (XtPointer)repeatForm);
+ repeatRate = XtNew(Scale);
+ repeatRate->label = XtCreateManagedWidget("rateLabel", labelWidgetClass,
+ repeatForm, NULL, 0);
+ repeatRate->number = XtCreateManagedWidget("rateNumber", labelWidgetClass,
+ repeatForm, NULL, 0);
+ repeatRate->scroller = XtCreateManagedWidget("rateScroller",
+ scrollbarWidgetClass,
+ repeatForm, NULL, 0);
+ XtAddCallback(repeatRate->scroller, XtNjumpProc, ScaleJumpCallback,
+ (XtPointer)repeatRate);
+ repeatRate->min = .05;
+ repeatRate->max = MAX_REPEAT_RATE;
+ repeatRate->resolution = .05;
+ repeatRate->integer = False;
+ repeatDelay = XtNew(Scale);
+ repeatDelay->label = XtCreateManagedWidget("delayLabel", labelWidgetClass,
+ repeatForm, NULL, 0);
+ repeatDelay->number = XtCreateManagedWidget("delayNumber", labelWidgetClass,
+ repeatForm, NULL, 0);
+ repeatDelay->scroller = XtCreateManagedWidget("delayScroller",
+ scrollbarWidgetClass,
+ repeatForm, NULL, 0);
+ XtAddCallback(repeatDelay->scroller, XtNjumpProc, ScaleJumpCallback,
+ (XtPointer)repeatDelay);
+ repeatDelay->min = .05;
+ repeatDelay->max = MAX_REPEAT_DELAY;
+ repeatDelay->resolution = .05;
+ repeatDelay->integer = False;
+
+ slowToggle = XtVaCreateManagedWidget("slow", toggleWidgetClass,
+ form, XtNstate,
+ (xkb_info->xkb->ctrls->enabled_ctrls &
+ XkbSlowKeysMask) != 0, NULL, 0);
+ slowForm = XtCreateManagedWidget("slowForm", formWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(slowToggle, XtNcallback, EnableCallback, (XtPointer)slowForm);
+ XtCreateManagedWidget("beep", labelWidgetClass, slowForm, NULL, 0);
+ slowPressed = XtVaCreateManagedWidget("pressed", toggleWidgetClass,
+ slowForm, XtNstate,
+ (xkb_info->xkb->ctrls->ax_options &
+ XkbAX_SKPressFBMask) != 0,
+ NULL, 0);
+ slowAccepted = XtVaCreateManagedWidget("accepted", toggleWidgetClass,
+ slowForm, XtNstate,
+ (xkb_info->xkb->ctrls->ax_options &
+ XkbAX_SKAcceptFBMask) != 0,
+ NULL, 0);
+ slow = XtNew(Scale);
+ slow->label = XtCreateManagedWidget("slowLabel", labelWidgetClass,
+ slowForm, NULL, 0);
+ slow->number = XtCreateManagedWidget("slowNumber", labelWidgetClass,
+ slowForm, NULL, 0);
+ slow->scroller = XtCreateManagedWidget("slowScroller",
+ scrollbarWidgetClass,
+ slowForm, NULL, 0);
+ XtAddCallback(slow->scroller, XtNjumpProc, ScaleJumpCallback,
+ (XtPointer)slow);
+ slow->min = 0.1;
+ slow->max = MAX_SLOW_TIME;
+ slow->resolution = 0.1;
+ slow->integer = False;
+
+ bounceToggle = XtVaCreateManagedWidget("bounce", toggleWidgetClass,
+ form, XtNstate,
+ (xkb_info->xkb->ctrls->enabled_ctrls &
+ XkbBounceKeysMask) != 0,
+ NULL, 0);
+ bounceForm = XtCreateManagedWidget("bounceForm", formWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(bounceToggle, XtNcallback, EnableCallback, (XtPointer)bounceForm);
+ bounce = XtNew(Scale);
+ bounce->label = XtCreateManagedWidget("bounceLabel", labelWidgetClass,
+ bounceForm, NULL, 0);
+ bounce->number = XtCreateManagedWidget("bounceNumber", labelWidgetClass,
+ bounceForm, NULL, 0);
+ bounce->scroller = XtCreateManagedWidget("bounceScroller",
+ scrollbarWidgetClass,
+ bounceForm, NULL, 0);
+ XtAddCallback(bounce->scroller, XtNjumpProc, ScaleJumpCallback,
+ (XtPointer)bounce);
+ bounce->min = 0.1;
+ bounce->max = MAX_BOUNCE_TIME;
+ bounce->resolution = 0.1;
+ bounce->integer = False;
+
+ XtRealizeWidget(accessx);
+
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(timeoutToggle, args, 1);
+ ScaleEnableCallback(enable, (XtPointer)timeout, (XtPointer)(long)state);
+ if (xkb_info->xkb->ctrls->ax_timeout > 60)
+ val = (float)(xkb_info->xkb->ctrls->ax_timeout - 60) /
+ (float)(MAX_TIMEOUT * 60);
+ else
+ val = 0;
+ ScaleJumpCallback(timeout->scroller, (XtPointer)timeout, (XtPointer)&val);
+
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(sticky, args, 1);
+ EnableCallback(sticky, (XtPointer)stickyForm, (XtPointer)(long)state);
+
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(mouse, args, 1);
+ EnableCallback(mouse, (XtPointer)mouseForm, (XtPointer)(long)state);
+ if (xkb_info->xkb->ctrls->mk_time_to_max > 10)
+ val = (float)((xkb_info->xkb->ctrls->mk_time_to_max * (40. / 10.))) /
+ (float)(MAX_MOUSE_TIME * 100);
+ else
+ val = 10.0 / (float)(MAX_MOUSE_TIME * 100);
+ ScaleJumpCallback(mouseTime->scroller, (XtPointer)mouseTime,
+ (XtPointer)&val);
+ tmp = mouseTime->value;
+ if (xkb_info->xkb->ctrls->mk_max_speed != 0)
+ val = (float)(xkb_info->xkb->ctrls->mk_max_speed / tmp - 10) /
+ (float)MAX_MOUSE_SPEED;
+ else
+ val = 10.0 / (float)MAX_MOUSE_SPEED;
+ ScaleJumpCallback(mouseSpeed->scroller, (XtPointer)mouseSpeed,
+ (XtPointer)&val);
+ if (xkb_info->xkb->ctrls->mk_delay > 10)
+ val = (float)(xkb_info->xkb->ctrls->mk_delay - 10) /
+ (float)(MAX_MOUSE_DELAY * 100);
+ else
+ val = 10.0 / (float)(MAX_MOUSE_DELAY * 100);
+ ScaleJumpCallback(mouseDelay->scroller, (XtPointer)mouseDelay,
+ (XtPointer)&val);
+
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(repeat, args, 1);
+ EnableCallback(repeat, (XtPointer)repeatForm, (XtPointer)(long)state);
+ if (xkb_info->xkb->ctrls->repeat_interval > 5)
+ val = (float)(xkb_info->xkb->ctrls->repeat_interval - 5) /
+ (float)(MAX_REPEAT_RATE * 1000);
+ else
+ val = 5.0 / (float)(MAX_REPEAT_RATE * 1000);
+ ScaleJumpCallback(repeatRate->scroller, (XtPointer)repeatRate,
+ (XtPointer)&val);
+ if (xkb_info->xkb->ctrls->repeat_delay > 5)
+ val = (float)(xkb_info->xkb->ctrls->repeat_delay - 5) /
+ (float)(MAX_REPEAT_DELAY * 1000);
+ else
+ val = 5.0 / (float)(MAX_REPEAT_DELAY * 1000);
+ ScaleJumpCallback(repeatDelay->scroller, (XtPointer)repeatDelay,
+ (XtPointer)&val);
+
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(slowToggle, args, 1);
+ EnableCallback(slowToggle, (XtPointer)slowForm, (XtPointer)(long)state);
+ if (xkb_info->xkb->ctrls->slow_keys_delay > 10)
+ val = (float)(xkb_info->xkb->ctrls->repeat_delay - 10) /
+ (float)(MAX_SLOW_TIME * 1000);
+ else
+ val = 10.0 / (float)(MAX_SLOW_TIME * 1000);
+ ScaleJumpCallback(slow->scroller, (XtPointer)slow, (XtPointer)&val);
+
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(bounceToggle, args, 1);
+ EnableCallback(bounceToggle, (XtPointer)bounceForm, (XtPointer)(long)state);
+ if (xkb_info->xkb->ctrls->debounce_delay > 10)
+ val = (float)(xkb_info->xkb->ctrls->debounce_delay - 10) /
+ (float)(MAX_BOUNCE_TIME * 1000);
+ else
+ val = 10.0 / (float)(MAX_BOUNCE_TIME * 1000);
+ ScaleJumpCallback(bounce->scroller, (XtPointer)bounce, (XtPointer)&val);
+
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(enable, args, 1);
+}
+
+void
+AccessXConfigureStart(void)
+{
+ AccessXInitialize();
+
+ XtMapWidget(accessx);
+}
+
+void
+AccessXConfigureEnd(void)
+{
+ XtUnmapWidget(accessx);
+}
+
+/*ARGSUSED*/
+static void
+EnableCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XtSetSensitive((Widget)user_data, (long)call_data);
+}
+
+/*ARGSUSED*/
+static void
+ScaleEnableCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Scale *scale = (Scale*)user_data;
+
+ XtSetSensitive(scale->label, (long)call_data);
+ XtSetSensitive(scale->number, (long)call_data);
+ XtSetSensitive(scale->scroller, (long)call_data);
+}
+
+static void
+ScaleJumpCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Scale *scale = (Scale*)user_data;
+ float percent = *(float *)call_data, timeout = percent * scale->max;
+ int x;
+ char str[8];
+ Arg args[1];
+
+ if (timeout >= scale->max - scale->min)
+ timeout = scale->max - scale->min;
+
+ if (scale->integer) {
+ int tm = timeout + scale->min;
+
+ tm -= tm % (int)scale->resolution;
+ XmuSnprintf(str, sizeof(str), "%i", tm);
+ scale->value = tm;
+ }
+ else {
+ long tm = (timeout + scale->min) * 1e+6;
+
+ tm -= tm % (long)(scale->resolution * 1e+6);
+ scale->value = (double)tm / 1e+6;
+ XmuSnprintf(str, sizeof(str), "%f", scale->value);
+ }
+
+ XtSetArg(args[0], XtNlabel, str);
+ XtSetValues(scale->number, args, 1);
+ x = w->core.x + w->core.border_width;
+ x += ((double)(w->core.width - scale->number->core.width) / scale->max) * timeout;
+ XtMoveWidget(scale->number, x, scale->number->core.y);
+ XawScrollbarSetThumb(w, timeout / (scale->max - scale->min),
+ scale->resolution / (scale->max - scale->min));
+}
+
+/*ARGSUSED*/
+static void
+ApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ Boolean state;
+
+ XkbGetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
+
+ /* Enable AccessX */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(enable, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbAccessXKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbAccessXKeysMask;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbAccessXKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbAccessXKeysMask;
+ }
+
+ /* Timeout */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(timeoutToggle, args, 1);
+ if (state)
+ xkb_info->config.ax_timeout =
+ xkb_info->xkb->ctrls->ax_timeout = timeout->value * 60;
+ else
+ xkb_info->config.ax_timeout =
+ xkb_info->xkb->ctrls->ax_timeout = 65535;
+
+ /* Enable StickyKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(sticky, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbStickyKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbStickyKeysMask;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbStickyKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbStickyKeysMask;
+ }
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(stickyAuto, args, 1);
+ if (state) {
+ xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask;
+ xkb_info->config.initial_opts &= ~XkbAX_LatchToLockMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_LatchToLockMask;
+ }
+ else {
+ xkb_info->config.initial_opts &= ~XkbAX_TwoKeysMask;
+ xkb_info->config.initial_opts |= XkbAX_LatchToLockMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_TwoKeysMask;
+ xkb_info->xkb->ctrls->ax_options |= XkbAX_LatchToLockMask;
+ }
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(stickyBeep, args, 1);
+ if (state) {
+ xkb_info->config.initial_opts |= XkbAX_StickyKeysFBMask;
+ xkb_info->xkb->ctrls->ax_options |= XkbAX_StickyKeysFBMask;
+ }
+ else {
+ xkb_info->config.initial_opts &= ~XkbAX_StickyKeysFBMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_StickyKeysFBMask;
+ }
+
+ /* Enable MouseKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(mouse, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbMouseKeysAccelMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbMouseKeysMask |
+ XkbMouseKeysAccelMask;
+ xkb_info->config.mk_delay =
+ xkb_info->xkb->ctrls->mk_delay = mouseDelay->value * 100;
+ xkb_info->config.mk_interval =
+ xkb_info->xkb->ctrls->mk_interval = 40;
+ xkb_info->config.mk_time_to_max =
+ xkb_info->xkb->ctrls->mk_time_to_max =
+ (mouseTime->value * 1000) / xkb_info->xkb->ctrls->mk_interval;
+ xkb_info->config.mk_max_speed =
+ xkb_info->xkb->ctrls->mk_max_speed =
+ mouseSpeed->value * mouseTime->value;
+ xkb_info->config.mk_curve = xkb_info->xkb->ctrls->mk_curve = 0;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~(XkbMouseKeysMask |
+ XkbMouseKeysAccelMask);
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~(XkbMouseKeysMask |
+ XkbMouseKeysAccelMask);
+ }
+
+ /* Enable RepeatKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(repeat, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbRepeatKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbRepeatKeysMask;
+ xkb_info->config.repeat_interval =
+ xkb_info->xkb->ctrls->repeat_interval = repeatRate->value * 1000;
+ xkb_info->config.repeat_delay =
+ xkb_info->xkb->ctrls->repeat_delay = repeatDelay->value * 1000;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbRepeatKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbRepeatKeysMask;
+ }
+
+ /* Enable SlowKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(slowToggle, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbSlowKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbSlowKeysMask;
+ xkb_info->config.slow_keys_delay =
+ xkb_info->xkb->ctrls->slow_keys_delay = slow->value * 1000;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbSlowKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbSlowKeysMask;
+ }
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(slowPressed, args, 1);
+ if (state) {
+ xkb_info->config.initial_opts |= XkbAX_SKPressFBMask;
+ xkb_info->xkb->ctrls->ax_options |= XkbAX_SKPressFBMask;
+ }
+ else {
+ xkb_info->config.initial_opts &= ~XkbAX_SKPressFBMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKPressFBMask;
+ }
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(slowAccepted, args, 1);
+ if (state) {
+ xkb_info->config.initial_opts |= XkbAX_SKAcceptFBMask;
+ xkb_info->xkb->ctrls->ax_options |= XkbAX_SKAcceptFBMask;
+ }
+ else {
+ xkb_info->config.initial_opts &= ~XkbAX_SKAcceptFBMask;
+ xkb_info->xkb->ctrls->ax_options &= ~XkbAX_SKAcceptFBMask;
+ }
+
+ /* Enable BounceKeys */
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(bounceToggle, args, 1);
+ if (state) {
+ xkb_info->config.initial_ctrls |= XkbBounceKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls |= XkbBounceKeysMask;
+ xkb_info->config.debounce_delay =
+ xkb_info->xkb->ctrls->debounce_delay = bounce->value * 1000;
+ }
+ else {
+ xkb_info->config.initial_ctrls &= ~XkbBounceKeysMask;
+ xkb_info->xkb->ctrls->enabled_ctrls &= ~XkbBounceKeysMask;
+ }
+
+ XkbSetControls(DPY, XkbAllControlsMask, xkb_info->xkb);
+ XSync(DPY, False);
+ (void)UpdateKeyboard(True);
+}
diff --git a/hw/xfree86/utils/xorgcfg/card-cfg.c b/hw/xfree86/utils/xorgcfg/card-cfg.c
new file mode 100644
index 000000000..a96797f1c
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/card-cfg.c
@@ -0,0 +1,434 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.11 2001/11/01 19:08:58 paulo Exp $
+ */
+
+#include "xf86config.h"
+#include "mouse-cfg.h"
+#include "cards.h"
+#include "card-cfg.h"
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/Viewport.h>
+#ifdef USE_MODULES
+#include "loader.h"
+#endif
+
+/*
+ * Prototypes
+ */
+static Bool CardConfigCheck(void);
+static void CardModelCallback(Widget, XtPointer, XtPointer);
+#ifdef USE_MODULES
+static void DriverCallback(Widget, XtPointer, XtPointer);
+#endif
+
+/*
+ * Initialization
+ */
+static CardsEntry *card_entry;
+static XF86ConfDevicePtr current_device;
+static Widget filter, list, driver, busid;
+static char **cards = NULL;
+static int ncards;
+#ifdef USE_MODULES
+static char *driver_str;
+#endif
+
+/*
+ * Implementation
+ */
+/*ARGSUSED*/
+XtPointer
+CardConfig(XtPointer config)
+{
+ XF86ConfDevicePtr card = (XF86ConfDevicePtr)config;
+/* XF86OptionPtr option;*/
+ char card_name[32];
+ Arg args[1];
+ char *bus, *drv_nam;
+
+ xf86info.cur_list = CARD;
+ XtSetSensitive(back, xf86info.lists[CARD].cur_function > 0);
+ XtSetSensitive(next, xf86info.lists[CARD].cur_function <
+ xf86info.lists[CARD].num_functions - 1);
+ (xf86info.lists[CARD].functions[xf86info.lists[CARD].cur_function])
+ (&xf86info);
+
+ card_entry = NULL;
+ current_device = card;
+ XawListUnhighlight(list);
+ XtSetArg(args[0], XtNstring, "");
+ XtSetValues(filter, args, 1);
+
+ if (card != NULL) {
+ if (card->dev_card != NULL) {
+ int i;
+
+ for (i = 0; i < ncards; i++) {
+ if (strcasecmp(cards[i], card->dev_card) == 0) {
+ card_entry = LookupCard(cards[i]);
+ XawListHighlight(list, i);
+ XtSetArg(args[0], XtNstring, cards[i]);
+ XtSetValues(filter, args, 1);
+ break;
+ }
+ }
+ }
+ XtSetArg(args[0], XtNstring, card->dev_identifier);
+ XtSetValues(ident_widget, args, 1);
+ XtSetArg(args[0], XtNstring, card->dev_busid);
+ XtSetValues(busid, args, 1);
+#ifdef USE_MODULES
+ if (!nomodules)
+ XtSetArg(args[0], XtNlabel, driver_str = XtNewString(card->dev_driver));
+ else
+#endif
+ XtSetArg(args[0], XtNstring, card->dev_driver);
+ XtSetValues(driver, args, 1);
+ }
+ else {
+ XF86ConfDevicePtr device = XF86Config->conf_device_lst;
+ int ndevices = 0;
+
+ while (device != NULL) {
+ ++ndevices;
+ device = (XF86ConfDevicePtr)(device->list.next);
+ }
+ do {
+ XmuSnprintf(card_name, sizeof(card_name), "Card%d", ndevices);
+ ++ndevices;
+ } while (xf86findDevice(card_name,
+ XF86Config->conf_device_lst));
+
+ XtSetArg(args[0], XtNstring, card_name);
+ XtSetValues(ident_widget, args, 1);
+ XtSetArg(args[0], XtNstring, "");
+ XtSetValues(busid, args, 1);
+#ifdef USE_MODULES
+ if (!nomodules)
+ XtSetArg(args[0], XtNlabel, driver_str = XtNewString("vga"));
+ else
+#endif
+ XtSetArg(args[0], XtNstring, "vga");
+ XtSetValues(driver, args, 1);
+ }
+
+ if (ConfigLoop(CardConfigCheck) == True) {
+ if (card_entry != NULL && card_entry->driver == NULL) {
+ fprintf(stderr, "No driver field in Cards database.\n"
+ "Please make sure you have the correct files installed.\n");
+ exit(1);
+ }
+ if (card == NULL) {
+ card = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec));
+ card->dev_identifier = XtNewString(ident_string);
+ if (card_entry) {
+ card->dev_driver = XtNewString(card_entry->driver);
+ card->dev_card = XtNewString(card_entry->name);
+ if (card_entry->chipset)
+ card->dev_chipset = XtNewString(card_entry->chipset);
+ if (card_entry->ramdac)
+ card->dev_ramdac = XtNewString(card_entry->ramdac);
+ if (card_entry->clockchip)
+ card->dev_clockchip = XtNewString(card_entry->clockchip);
+ }
+ /* else will fallback to "vga" */
+ }
+ else if (card_entry != NULL) {
+ XtFree(card->dev_driver);
+ card->dev_driver = XtNewString(card_entry->driver);
+ if (card_entry->chipset) {
+ XtFree(card->dev_chipset);
+ card->dev_chipset = XtNewString(card_entry->chipset);
+ }
+ if (card_entry->ramdac) {
+ XtFree(card->dev_ramdac);
+ card->dev_ramdac = XtNewString(card_entry->ramdac);
+ }
+ if (card_entry->clockchip) {
+ XtFree(card->dev_clockchip);
+ card->dev_clockchip = XtNewString(card_entry->clockchip);
+ }
+ }
+ if (strcasecmp(card->dev_identifier, ident_string))
+ xf86renameDevice(XF86Config, card, ident_string);
+ XtSetArg(args[0], XtNstring, &bus);
+ XtGetValues(busid, args, 1);
+ XtFree(card->dev_busid);
+ card->dev_busid = XtNewString(bus);
+
+#ifdef USE_MODULES
+ if (!nomodules)
+ drv_nam = driver_str;
+ else
+#endif
+ {
+ XtSetArg(args[0], XtNstring, &drv_nam);
+ XtGetValues(driver, args, 1);
+ }
+
+ XtFree(card->dev_driver);
+ card->dev_driver = XtNewString(drv_nam);
+
+#ifdef USE_MODULES
+ if (!nomodules)
+ XtFree(driver_str);
+#endif
+
+ return ((XtPointer)card);
+ }
+#ifdef USE_MODULES
+ if (!nomodules)
+ XtFree(driver_str);
+#endif
+
+ return (NULL);
+}
+
+static Bool
+CardConfigCheck(void)
+{
+ XF86ConfDevicePtr device = XF86Config->conf_device_lst;
+ char *drv_nam;
+
+#ifdef USE_MODULES
+ if (!nomodules)
+ drv_nam = driver_str;
+ else
+#endif
+ {
+ Arg args[1];
+
+ XtSetArg(args[0], XtNstring, &drv_nam);
+ XtGetValues(driver, args, 1);
+ }
+
+ if (ident_string == NULL || strlen(ident_string) == 0 ||
+#if 0
+ /* not all available cards are in the Cards database */
+ (current_device == NULL && card_entry == NULL) ||
+#endif
+ drv_nam == NULL || *drv_nam == '\0')
+ return (False);
+
+ while (device != NULL) {
+ if (device != current_device &&
+ strcasecmp(ident_string, device->dev_identifier) == 0)
+ return (False);
+ device = (XF86ConfDevicePtr)(device->list.next);
+ }
+
+ return (True);
+}
+
+static void
+CardModelCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+ char tip[4096];
+ int len;
+
+ XtSetArg(args[0], XtNstring, info->string);
+ XtSetValues(filter, args, 1);
+ card_entry = LookupCard(info->string);
+
+ if (card_entry == NULL)
+ return;
+
+ len = XmuSnprintf(tip, sizeof(tip), "Name: %s\n", card_entry->name);
+ if (card_entry->flags & F_UNSUPPORTED)
+ len += XmuSnprintf(tip + len, sizeof(tip) - len,
+ "**THIS CARD IS UNSUPPORTED**\n");
+ if (card_entry->chipset != NULL)
+ len += XmuSnprintf(tip + len, sizeof(tip) - len,
+ "Chipset: %s\n", card_entry->chipset);
+ if (card_entry->driver != NULL) {
+#ifdef USE_MODULES
+ if (!nomodules) {
+ XtFree(driver_str);
+ driver_str = XtNewString(card_entry->driver);
+ XtVaSetValues(driver, XtNlabel, driver_str, NULL, 0);
+ }
+#endif
+ len += XmuSnprintf(tip + len, sizeof(tip) - len,
+ "Driver: %s\n", card_entry->driver);
+ }
+ if (card_entry->ramdac != NULL)
+ len += XmuSnprintf(tip + len, sizeof(tip),
+ "Ramdac: %s\n", card_entry->ramdac);
+ if (card_entry->clockchip != NULL)
+ len += XmuSnprintf(tip + len, sizeof(tip) - len,
+ "Clockchip: %s\n", card_entry->clockchip);
+ if (card_entry->dacspeed != NULL)
+ len += XmuSnprintf(tip + len, sizeof(tip) - len,
+ "Dacspeed: %s\n", card_entry->dacspeed);
+ if (card_entry->lines != NULL)
+ len += XmuSnprintf(tip + len, sizeof(tip) - len,
+ "\n%s\n", card_entry->lines);
+
+#ifndef USE_MODULES
+ XtSetArg(args[0], XtNstring,
+ card_entry->driver ? card_entry->driver : "vga");
+ XtSetValues(driver, args, 1);
+#endif
+
+ XtSetArg(args[0], XtNtip, tip);
+ XtSetValues(filter, args, 1);
+}
+
+/*ARGSUSED*/
+void
+CardFilterAction(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+ char **cards, *pattern, **old_cards;
+ int ncards, old_ncards;
+ Arg args[2];
+
+ XtSetArg(args[0], XtNstring, &pattern);
+ XtGetValues(w, args, 1);
+
+ XtSetArg(args[0], XtNlist, &old_cards);
+ XtSetArg(args[1], XtNnumberStrings, &old_ncards);
+ XtGetValues(list, args, 2);
+
+ cards = FilterCardNames(pattern, &ncards);
+
+ if (ncards == 0) {
+ cards = (char**)XtMalloc(sizeof(char*));
+ cards[0] = XtNewString("");
+ ncards = 1;
+ }
+
+ XtSetArg(args[0], XtNlist, cards);
+ XtSetArg(args[1], XtNnumberStrings, ncards);
+ XtSetValues(list, args, 2);
+
+ if (old_ncards > 1 || (XtName(list) != old_cards[0])) {
+ while (--old_ncards > -1)
+ XtFree(old_cards[old_ncards]);
+ XtFree((char*)old_cards);
+ }
+
+ /* force relayout */
+ XtUnmanageChild(list);
+ XtManageChild(list);
+}
+
+#ifdef USE_MODULES
+/*ARGSUSED*/
+static void
+DriverCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+
+ XtFree(driver_str);
+ driver_str = XtNewString(XtName(w));
+ XtSetArg(args[0], XtNlabel, driver_str);
+ XtSetValues(driver, args, 1);
+}
+#endif
+
+void
+CardModel(XF86SetupInfo *info)
+{
+ static int first = 1;
+ static Widget model;
+
+ if (first) {
+ Widget label, viewport;
+
+ first = 0;
+
+ cards = GetCardNames(&ncards);
+
+ model = XtCreateWidget("cardModel", formWidgetClass,
+ configp, NULL, 0);
+ label = XtCreateManagedWidget("label", labelWidgetClass,
+ model, NULL, 0);
+ filter = XtVaCreateManagedWidget("filter", asciiTextWidgetClass,
+ model,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ viewport = XtCreateManagedWidget("viewport", viewportWidgetClass,
+ model, NULL, 0);
+ list = XtVaCreateManagedWidget("list", listWidgetClass,
+ viewport,
+ XtNlist, cards,
+ XtNnumberStrings, ncards,
+ NULL, 0);
+ XtAddCallback(list, XtNcallback, CardModelCallback,
+ (XtPointer)info);
+ XtCreateManagedWidget("driverL", labelWidgetClass, model, NULL, 0);
+#ifdef USE_MODULES
+ if (!nomodules) {
+ driver = XtVaCreateManagedWidget("driver", menuButtonWidgetClass,
+ model,
+ XtNmenuName, "driverM",
+ NULL, 0);
+ {
+ Widget menu, sme;
+ xf86cfgModuleOptions *opts = module_options;
+
+ menu = XtCreatePopupShell("driverM", simpleMenuWidgetClass,
+ driver, NULL, 0);
+ while (opts) {
+ if (opts->type == VideoModule) {
+ sme = XtCreateManagedWidget(opts->name, smeBSBObjectClass,
+ menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, DriverCallback, NULL);
+ }
+ opts = opts->next;
+ }
+ }
+ }
+ else
+#endif
+ driver = XtVaCreateManagedWidget("driver", asciiTextWidgetClass,
+ model,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+
+ XtCreateManagedWidget("busidL", labelWidgetClass, model, NULL, 0);
+ busid = XtVaCreateManagedWidget("busid", asciiTextWidgetClass,
+ model,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+
+ XtRealizeWidget(model);
+ }
+ XtChangeManagedSet(&current, 1, NULL, NULL, &model, 1);
+ current = model;
+}
diff --git a/hw/xfree86/utils/xorgcfg/card-cfg.h b/hw/xfree86/utils/xorgcfg/card-cfg.h
new file mode 100644
index 000000000..14411440d
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/card-cfg.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.h,v 1.1 2000/04/04 22:36:57 dawes Exp $
+ */
+
+#include "config.h"
+
+#ifndef _xf86cfg_card_h
+#define _xf86cfg_card_h
+
+/*
+ * Prototypes
+ */
+XtPointer CardConfig(XtPointer);
+void CardModel(XF86SetupInfo*);
+void CardFilterAction(Widget, XEvent*, String*, Cardinal*);
+
+#endif /* _xf86cfg_card_h */
diff --git a/hw/xfree86/utils/xorgcfg/card.xbm b/hw/xfree86/utils/xorgcfg/card.xbm
new file mode 100644
index 000000000..b3cbba322
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/card.xbm
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card.xbm,v 1.1 2000/04/04 22:36:57 dawes Exp $
+ */
+#define card_width 50
+#define card_height 44
+static unsigned char card_bits[] = {
+ 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfd, 0xff, 0xff, 0xff, 0x07,
+ 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x80, 0x07, 0x00, 0x00,
+ 0x00, 0x1c, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x80, 0x01,
+ 0x00, 0x00, 0xf8, 0x19, 0x00, 0x80, 0xf9, 0x00, 0x00, 0xf8, 0x19, 0x00,
+ 0x80, 0xf9, 0xf8, 0x7f, 0x98, 0x19, 0x00, 0x80, 0x01, 0xf8, 0x7f, 0x98,
+ 0x19, 0x00, 0x80, 0x01, 0x18, 0x60, 0xf8, 0x19, 0x00, 0x80, 0xf9, 0x18,
+ 0x60, 0xf8, 0x19, 0x00, 0x80, 0xf9, 0x18, 0x60, 0x00, 0x18, 0x00, 0x80,
+ 0x01, 0x18, 0x60, 0xf8, 0x19, 0x00, 0x80, 0x01, 0x18, 0x60, 0xf8, 0x19,
+ 0x00, 0x80, 0xf9, 0x18, 0x60, 0x98, 0x19, 0x00, 0x80, 0xf9, 0x18, 0x60,
+ 0x98, 0x19, 0x00, 0x80, 0x01, 0x18, 0x60, 0xf8, 0x19, 0x00, 0x80, 0x01,
+ 0xf8, 0x7f, 0xf8, 0x19, 0x00, 0x80, 0xf9, 0xf8, 0x7f, 0x00, 0x18, 0x00,
+ 0x80, 0xf9, 0x00, 0x00, 0xf8, 0x19, 0x00, 0x80, 0x01, 0x00, 0x00, 0xf8,
+ 0x19, 0x00, 0x80, 0x01, 0x30, 0x33, 0x98, 0x19, 0x00, 0x80, 0xf9, 0x30,
+ 0x33, 0x98, 0x19, 0x00, 0x80, 0xf9, 0x30, 0x33, 0xf8, 0x19, 0x00, 0x80,
+ 0x01, 0x30, 0x33, 0xf8, 0x19, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18,
+ 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x80, 0xff, 0x07, 0x00,
+ 0x80, 0x0f, 0x00, 0x80, 0xfd, 0x0f, 0x00, 0xc0, 0x07, 0x00, 0x80, 0x01,
+ 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x80, 0x01, 0xcc, 0xcc, 0xcc, 0x00, 0x00,
+ 0x80, 0x01, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x80, 0x01, 0xcc, 0xcc, 0xcc,
+ 0x00, 0x00, 0x80, 0x01, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x80, 0x01, 0xf8,
+ 0xff, 0x7f, 0x00, 0x00, 0x80, 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, };
diff --git a/hw/xfree86/utils/xorgcfg/card.xpm b/hw/xfree86/utils/xorgcfg/card.xpm
new file mode 100644
index 000000000..d68257469
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/card.xpm
@@ -0,0 +1,81 @@
+/* XPM */
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card.xpm,v 1.1 2000/04/04 22:36:57 dawes Exp $
+ */
+static char * card_xpm[] = {
+"41 40 8 1",
+" c none",
+"A c #B6DABAEAB6DA",
+"X c #0000AAAA0000",
+"o c #000071C60000",
+"O c #000041030000",
+"+ c #618561856185",
+"@ c #186118611861",
+"# c #CF3CA2892081",
+"AAA ",
+" A ",
+" A ",
+" A ",
+" A ",
+" A ",
+" A ",
+" AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ",
+" AooooooooooooooooooooooooooooooooooooO",
+" AooooooooooooooooooooooooooooooooooooO",
+" AooooooooooooooooooooooooooooooooooooO",
+" AooooooooooooooooooooooooOOOOOOOOOOOOO",
+" AooooooooooooooooooAoAoAoAooAAAAAAA+oO",
+" AooooooooooooooooooAoAoAoAooA++++++@oO",
+" AooooooooooooooooooAoAoAoAooA+oooo+@oO",
+" AoooooooooooooooooooooooooooA+AAAA+@oO",
+" AoooooooooooooooooooooooooooA+oooo+@oO",
+" AoooooooooooooooooooooooooooA++++++@oO",
+" Aooooooooooooooooooooooooooo+@@@@@@@oO",
+" AooooooooooooooooooooooooooooooooooooO",
+" AoooooooooooooooooooooooooooAAAAAAA+oO",
+" +AoooooooooooooooooAAAAAAAA@oA++++++@oO",
+" AoooooooooooooooooA+++++++@oA+oooo+@oO",
+" AoooooooooooooooooA+++++++@oA+AAAA+@oO",
+" ++AoooooooooooooooooA+++++++@oA+oooo+@oO",
+" ++AoooooooooooooooooA+++++++@oA++++++@oO",
+" ++Aooooooooooooooooo@@@@@@@@@o+@@@@@@@oO",
+" ++AooooooooooooooooooooooooooooooooooooO",
+" AooooooooooooooooooooooooooooooooooooO",
+" AooooooooooooooooooooooooooooooooooooO",
+" +AooooooooooooooooooooooooooooooooooooO",
+" AooooooooooooooooooooooooooooooooooooO",
+" AoooOOOOooooooooooooooooooooOoooooOOO ",
+" AooO X#o#o#o#o#o#o#o#o#oO X#o#O ",
+" AOO X#o#o#o#o#o#o#o#o#oO X#o#O ",
+" A X#o#o#o#o#o#o#o#o#oO X#o#O ",
+" A X#o#o#o#o#o#o#o#o#oO X#o#O ",
+" A OOOOOOOOOOOOOOOOOO OOO ",
+" A ",
+" A "};
diff --git a/hw/xfree86/utils/xorgcfg/cards.c b/hw/xfree86/utils/xorgcfg/cards.c
new file mode 100644
index 000000000..d5805fa98
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/cards.c
@@ -0,0 +1,693 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/cards.c,v 1.15 2003/02/15 05:37:58 paulo Exp $
+ */
+
+#define CARDS_PRIVATE
+#include "cards.h"
+
+#undef SERVER /* defined in config.h, but of no use here */
+
+/* return values from ReadCardsLine. */
+#define ERROR -3
+#define UNKNOWN -2
+#define END -1
+#define NOTUSEFUL 0
+#define NAME 1
+#define CHIPSET 2
+#define SERVER 3
+#define DRIVER 4
+#define RAMDAC 5
+#define CLOCKCHIP 6
+#define DACSPEED 7
+#define NOCLOCKPROBE 8
+#define UNSUPPORTED 9
+#define SEE 10
+#define LINE 11
+
+/*
+ * Prototypes
+ */
+static int ReadCardsLine(FILE*, char*); /* must have 256 bytes */
+static int CompareCards(_Xconst void *left, _Xconst void *right);
+static int BCompareCards(_Xconst void *left, _Xconst void *right);
+static void DoReadCardsDatabase(void);
+static char **DoFilterCardNames(char *pattern, int *result);
+
+#ifdef USE_MODULES
+
+typedef struct {
+ int ivendor;
+ unsigned short vendor;
+ unsigned short valid_vendor;
+ char *chipsets;
+ int num_chipsets;
+} chipset_check;
+#endif
+
+/*
+ * Initialization
+ */
+static int linenum = 0;
+static char *Cards = "lib/X11/Cards";
+CardsEntry **CardsDB;
+int NumCardsEntry;
+
+/*
+ * Implementation
+ */
+#ifdef USE_MODULES
+const pciVendorInfo *xf86PCIVendorInfo;
+#endif
+
+#ifdef USE_MODULES
+void
+InitializePciInfo(void)
+{
+ xf86PCIVendorInfo = pciVendorInfoList;
+}
+
+void
+CheckChipsets(xf86cfgModuleOptions *opts, int *err)
+{
+ int i, j, ichk, ivnd = 0, vendor = -1, device;
+ const pciDeviceInfo **pDev;
+ SymTabPtr chips = opts->chipsets;
+ chipset_check *check = NULL;
+ int num_check = 0;
+
+ if (!chips) {
+ CheckMsg(CHECKER_NO_CHIPSETS, "WARNING No chipsets specified.\n");
+ ++*err;
+ return;
+ }
+
+ while (chips->name) {
+ device = chips->token & 0xffff;
+ vendor = (chips->token & 0xffff0000) >> 16;
+ if (vendor == 0)
+ vendor = opts->vendor;
+
+ for (ichk = 0; ichk < num_check; ichk++)
+ if (check[ichk].vendor == vendor)
+ break;
+ if (ichk >= num_check) {
+ check = (chipset_check*)
+ XtRealloc((XtPointer)check,
+ sizeof(chipset_check) * (num_check + 1));
+ check[num_check].vendor = vendor;
+ memset(&check[num_check], 0, sizeof(chipset_check));
+ ++num_check;
+ }
+
+ /* Search for vendor in xf86PCIVendorInfo */
+ if (xf86PCIVendorInfo) {
+ for (ivnd = 0; xf86PCIVendorInfo[ivnd].VendorID; ivnd++)
+ if (vendor == xf86PCIVendorInfo[ivnd].VendorID)
+ break;
+ }
+ if (xf86PCIVendorInfo && xf86PCIVendorInfo[ivnd].VendorID) {
+ check[ichk].valid_vendor = 1;
+ check[ichk].ivendor = ivnd;
+ }
+ else {
+ CheckMsg(CHECKER_CANNOT_VERIFY_CHIPSET,
+ "WARNING Cannot verify chipset \"%s\" (0x%x)\n",
+ chips->name, device);
+ ++*err;
+ ++chips;
+ continue;
+ }
+
+ if (xf86PCIVendorInfo &&
+ (pDev = xf86PCIVendorInfo[ivnd].Device) != NULL) {
+ if (check[ichk].chipsets == NULL) {
+ for (j = 0; pDev[j]; j++)
+ ;
+ check[ichk].chipsets = (char*)XtCalloc(1, j);
+ }
+ for (j = 0; pDev[j]; j++) {
+ if (device == pDev[j]->DeviceID) {
+ if (strcmp(chips->name, pDev[j]->DeviceName)) {
+ CheckMsg(CHECKER_NOMATCH_CHIPSET_STRINGS,
+ "WARNING chipset strings don't match: \"%s\" \"%s\" (0x%x)\n",
+ chips->name, xf86PCIVendorInfo[ivnd].Device[j]->DeviceName,
+ device);
+ ++*err;
+ }
+ break;
+ }
+ }
+ if (!pDev[j]) {
+ CheckMsg(CHECKER_CHIPSET_NOT_LISTED,
+ "WARNING chipset \"%s\" (0x%x) not in list.\n", chips->name, device);
+ ++*err;
+ }
+ else
+ check[ichk].chipsets[j] = 1;
+ }
+ ++chips;
+ }
+
+ for (i = 0; i < num_check; i++) {
+ if (!check[i].valid_vendor) {
+ CheckMsg(CHECKER_CHIPSET_NO_VENDOR,
+ "WARNING No such vendor 0x%x\n", vendor);
+ ++*err;
+ }
+ for (j = 0; j < check[i].num_chipsets; j++) {
+ if (xf86PCIVendorInfo && !check[i].chipsets[j]) {
+ CheckMsg(CHECKER_CHIPSET_NOT_SUPPORTED,
+ "NOTICE chipset \"%s\" (0x%x) not listed as supported.\n",
+ xf86PCIVendorInfo[check[i].ivendor].Device[j]->DeviceName,
+ xf86PCIVendorInfo[check[i].ivendor].Device[j]->DeviceID);
+ }
+ }
+ XtFree(check[i].chipsets);
+ }
+
+ XtFree((XtPointer)check);
+}
+#endif
+
+void
+ReadCardsDatabase(void)
+{
+#ifdef USE_MODULES
+ if (!nomodules) {
+ int i, j, ivendor, idevice;
+ char name[256];
+ _Xconst char *vendor, *device;
+ CardsEntry *entry = NULL, *tmp;
+ xf86cfgModuleOptions *opts = module_options;
+ const pciDeviceInfo **pDev;
+
+ /* Only list cards that have a driver installed */
+ while (opts) {
+ if (opts->chipsets) {
+ SymTabPtr chips = opts->chipsets;
+
+ while (chips->name) {
+ vendor = opts->name;
+ device = chips->name;
+ ivendor = (chips->token & 0xffff0000) >> 16;
+ idevice = chips->token & 0xffff0;
+ if (ivendor == 0)
+ ivendor = opts->vendor;
+
+ if (xf86PCIVendorInfo) {
+ for (i = 0; xf86PCIVendorInfo[i].VendorName; i++)
+ if (ivendor == xf86PCIVendorInfo[i].VendorID) {
+ vendor = xf86PCIVendorInfo[i].VendorName;
+ break;
+ }
+ if (xf86PCIVendorInfo[i].VendorName) {
+ if ((pDev = xf86PCIVendorInfo[i].Device)) {
+ for (j = 0; pDev[j]; j++)
+ if (idevice == pDev[j]->DeviceID) {
+ device = pDev[j]->DeviceName;
+ break;
+ }
+ }
+ }
+ }
+
+ /* Since frequently there is more than one driver for a
+ * single vendor, it is required to avoid duplicates.
+ */
+ XmuSnprintf(name, sizeof(name), "%s %s", vendor, device);
+ tmp = LookupCard(name);
+
+ if (tmp == NULL || strcmp(tmp->chipset, chips->name) ||
+ strcmp(tmp->driver, opts->name)) {
+ entry = (CardsEntry*)XtCalloc(1, sizeof(CardsEntry));
+ if (NumCardsEntry % 16 == 0) {
+ CardsDB = (CardsEntry**)XtRealloc((XtPointer)CardsDB,
+ sizeof(CardsEntry*) * (NumCardsEntry + 16));
+ }
+ CardsDB[NumCardsEntry++] = entry;
+ entry->name = XtNewString(name);
+
+ /* XXX no private copy of strings */
+ entry->chipset = (char*)chips->name;
+ entry->driver = opts->name;
+
+ /* better than linear searchs to find duplicates */
+ qsort(CardsDB, NumCardsEntry, sizeof(CardsEntry*),
+ CompareCards);
+ }
+ ++chips;
+ }
+ }
+ opts = opts->next;
+ }
+
+ /* fix entries with the same name */
+ for (i = 0; i < NumCardsEntry - 2;) {
+ for (j = i + 1; j < NumCardsEntry - 1 &&
+ strcmp(CardsDB[i]->name, CardsDB[j]->name) == 0; j++)
+ ;
+
+ if (i + 1 != j) {
+ while (i < j) {
+ char *str;
+
+ if (strcmp(CardsDB[i]->chipset, CardsDB[j]->chipset))
+ str = CardsDB[i]->chipset;
+ else
+ str = CardsDB[i]->driver;
+
+ XmuSnprintf(name, sizeof(name), "%s (%s)",
+ CardsDB[i]->name, str);
+ XtFree(CardsDB[i]->name);
+ CardsDB[i]->name = XtNewString(name);
+
+ ++i;
+ }
+ }
+ else
+ ++i;
+ }
+
+ /* make sure data is valid to bsearch in */
+ qsort(CardsDB, NumCardsEntry, sizeof(CardsEntry*), CompareCards);
+ }
+ else
+#endif
+ DoReadCardsDatabase();
+}
+
+static void
+DoReadCardsDatabase(void)
+{
+ char buffer[256];
+ FILE *fp = fopen(Cards, "r");
+ int i, result;
+ CardsEntry *entry = NULL;
+ static char *CardsError = "Error reading Cards database, at line %d (%s).\n";
+
+ if (fp == NULL) {
+ fprintf(stderr, "Cannot open Cards database.\n");
+ exit(1);
+ }
+
+ while ((result = ReadCardsLine(fp, buffer)) != END) {
+ switch (result) {
+ case ERROR:
+ fprintf(stderr, CardsError, linenum, buffer);
+ break;
+ case UNKNOWN:
+ fprintf(stderr,
+ "Unknown field type in Cards database, at line %d (%s).\n",
+ linenum, buffer);
+ break;
+ case NAME:
+ entry = calloc(1, sizeof(CardsEntry));
+ if (NumCardsEntry % 16 == 0) {
+ CardsDB = realloc(CardsDB, sizeof(CardsEntry*) *
+ (NumCardsEntry + 16));
+ if (CardsDB == NULL) {
+ fprintf(stderr, "Out of memory reading Cards database.\n");
+ exit(1);
+ }
+ }
+ CardsDB[NumCardsEntry++] = entry;
+ entry->name = strdup(buffer);
+ break;
+ case CHIPSET:
+ if (entry == NULL || entry->chipset != NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+#if 0
+ else
+ entry->chipset = strdup(buffer);
+#endif
+ break;
+ case SERVER:
+ if (entry == NULL || entry->server != NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else
+ entry->server = strdup(buffer);
+ break;
+ case DRIVER:
+ if (entry == NULL || entry->driver != NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else
+ entry->driver = strdup(buffer);
+ break;
+ case RAMDAC:
+ if (entry == NULL || entry->ramdac != NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else
+ entry->ramdac = strdup(buffer);
+ break;
+ case CLOCKCHIP:
+ if (entry == NULL || entry->clockchip != NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else
+ entry->clockchip = strdup(buffer);
+ break;
+ case DACSPEED:
+ if (entry == NULL || entry->dacspeed != NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else
+ entry->dacspeed = strdup(buffer);
+ break;
+ case NOCLOCKPROBE:
+ if (entry == NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else
+ entry->flags |= F_NOCLOCKPROBE;
+ break;
+ case UNSUPPORTED:
+ if (entry == NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else
+ entry->flags |= F_UNSUPPORTED;
+ break;
+ case SEE:
+ if (entry == NULL || entry->see != NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else
+ entry->see = strdup(buffer);
+ break;
+ case LINE:
+ if (entry == NULL) {
+ fprintf(stderr, CardsError, linenum, buffer);
+ }
+ else if (entry->lines == NULL)
+ entry->lines = strdup(buffer);
+ else {
+ char *str = malloc(strlen(entry->lines) + strlen(buffer) + 2);
+
+ sprintf(str, "%s\n%s", entry->lines, buffer);
+ free(entry->lines);
+ entry->lines = str;
+ }
+ break;
+ }
+ }
+
+ fclose(fp);
+
+ qsort(CardsDB, NumCardsEntry, sizeof(CardsEntry*), CompareCards);
+
+#ifdef DEBUG
+ for (i = 0; i < NumCardsEntry - 1; i++) {
+ if (strcmp(CardsDB[i]->name, CardsDB[i+1]->name) == 0)
+ fprintf(stderr, "Duplicate entry in Cards database: (%s).\n",
+ CardsDB[i]->name);
+ }
+#endif
+
+ for (i = 0; i < NumCardsEntry - 1; i++) {
+ if (CardsDB[i]->see != NULL) {
+ if ((entry = LookupCard(CardsDB[i]->see)) == NULL) {
+ fprintf(stderr, "Cannot find card '%s' for filling defaults.\n",
+ CardsDB[i]->see);
+ continue;
+ }
+ if (CardsDB[i]->chipset == NULL && entry->chipset != NULL)
+ CardsDB[i]->chipset = strdup(entry->chipset);
+ if (CardsDB[i]->server == NULL && entry->server != NULL)
+ CardsDB[i]->server = strdup(entry->server);
+ if (CardsDB[i]->driver == NULL && entry->driver != NULL)
+ CardsDB[i]->driver = strdup(entry->driver);
+ if (CardsDB[i]->ramdac == NULL && entry->ramdac != NULL)
+ CardsDB[i]->ramdac = strdup(entry->ramdac);
+ if (CardsDB[i]->clockchip == NULL && entry->clockchip != NULL)
+ CardsDB[i]->clockchip = strdup(entry->clockchip);
+ if (CardsDB[i]->dacspeed == NULL && entry->dacspeed != NULL)
+ CardsDB[i]->dacspeed = strdup(entry->dacspeed);
+ if (CardsDB[i]->flags & F_NOCLOCKPROBE)
+ CardsDB[i]->flags |= F_NOCLOCKPROBE;
+ if (CardsDB[i]->flags & F_UNSUPPORTED)
+ CardsDB[i]->flags |= F_UNSUPPORTED;
+ if (entry->lines != NULL) {
+ if (CardsDB[i]->lines == NULL)
+ CardsDB[i]->lines = strdup(entry->lines);
+ else {
+ char *str = malloc(strlen(entry->lines) +
+ strlen(CardsDB[i]->lines) + 2);
+
+ sprintf(str, "%s\n%s", CardsDB[i]->lines, entry->lines);
+ free(CardsDB[i]->lines);
+ CardsDB[i]->lines = str;
+ }
+ }
+ if (entry->see != NULL) {
+#ifdef DEBUG
+ fprintf(stderr, "Nested SEE entry: %s -> %s -> %s\n",
+ CardsDB[i]->name, CardsDB[i]->see, entry->see);
+#endif
+ CardsDB[i]->see = strdup(entry->see);
+ --i;
+ continue;
+ }
+ free(CardsDB[i]->see);
+ CardsDB[i]->see = NULL;
+ }
+ }
+}
+
+CardsEntry *
+LookupCard(char *name)
+{
+ CardsEntry **ptr;
+
+ ptr = (CardsEntry**)bsearch(name, CardsDB, NumCardsEntry,
+ sizeof(CardsEntry*), BCompareCards);
+
+ return (ptr != NULL ? *ptr : NULL);
+}
+
+char **
+GetCardNames(int *result)
+{
+ char **cards = NULL;
+ int ncards;
+
+ for (ncards = 0; ncards < NumCardsEntry; ncards++) {
+ if (ncards % 16 == 0) {
+ if ((cards = (char**)realloc(cards, sizeof(char*) *
+ (ncards + 16))) == NULL) {
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+ }
+ }
+ cards[ncards] = strdup(CardsDB[ncards]->name);
+ }
+
+ *result = ncards;
+
+ return (cards);
+}
+
+char **
+FilterCardNames(char *pattern, int *result)
+{
+#ifdef USE_MODULES
+ if (!nomodules) {
+ char **cards = NULL;
+ int i, ncards = 0;
+
+ for (i = 0; i < NumCardsEntry; i++) {
+ if (strstr(CardsDB[i]->name, pattern) == NULL)
+ continue;
+ if (ncards % 16 == 0) {
+ if ((cards = (char**)realloc(cards, sizeof(char*) *
+ (ncards + 16))) == NULL) {
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+ }
+ }
+ cards[ncards] = strdup(CardsDB[i]->name);
+ ++ncards;
+ }
+
+ *result = ncards;
+
+ return (cards);
+ }
+#endif
+ return (DoFilterCardNames(pattern, result));
+}
+
+static char **
+DoFilterCardNames(char *pattern, int *result)
+{
+ FILE *fp;
+ char **cards = NULL;
+ int len, ncards = 0;
+ char *cmd, *ptr, buffer[256];
+
+ cmd = malloc(32 + (strlen(pattern) * 2) + strlen(Cards));
+
+ strcpy(cmd, "egrep -i '^NAME\\ .*");
+ len = strlen(cmd);
+ ptr = pattern;
+ while (*ptr) {
+ if (!isalnum(*ptr)) {
+ cmd[len++] = '\\';
+ }
+ cmd[len++] = *ptr++;
+ }
+ cmd[len] = '\0';
+ strcat(cmd, ".*$' ");
+ strcat(cmd, Cards);
+ strcat(cmd, " | sort");
+ /*sprintf(cmd, "egrep -i '^NAME\\ .*%s.*$' %s | sort", pattern, Cards);*/
+
+ if ((fp = popen(cmd, "r")) == NULL) {
+ fprintf(stderr, "Cannot read Cards database.\n");
+ exit(1);
+ }
+ while (fgets(buffer, sizeof(buffer), fp) != NULL) {
+ ptr = buffer + strlen(buffer) - 1;
+ while (isspace(*ptr) && ptr > buffer)
+ --ptr;
+ if (!isspace(*ptr) && ptr > buffer)
+ ptr[1] = '\0';
+ ptr = buffer;
+ while (!isspace(*ptr) && *ptr) /* skip NAME */
+ ++ptr;
+ while (isspace(*ptr) && *ptr)
+ ++ptr;
+ if (ncards % 16 == 0) {
+ if ((cards = (char**)realloc(cards, sizeof(char*) *
+ (ncards + 16))) == NULL) {
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+ }
+ }
+ cards[ncards++] = strdup(ptr);
+ }
+ free(cmd);
+
+ *result = ncards;
+
+ return (cards);
+}
+
+static int
+ReadCardsLine(FILE *fp, char *value)
+{
+ char name[32], buffer[256], *ptr, *end;
+ int result = NOTUSEFUL;
+
+ ++linenum;
+
+ if (fgets(buffer, sizeof(buffer), fp) == NULL)
+ return (END);
+
+ ptr = buffer;
+ /* skip initial spaces; should'nt bother about this.. */
+ while (isspace(*ptr) && *ptr)
+ ++ptr;
+
+ if (*ptr == '#' || *ptr == '\0')
+ return (NOTUSEFUL);
+
+ end = ptr;
+ while (!isspace(*end) && *end)
+ ++end;
+ if (end - ptr > sizeof(buffer) - 1) {
+ strncpy(value, buffer, 255);
+ value[255] = '\0';
+ return (ERROR);
+ }
+ strncpy(name, ptr, end - ptr);
+ name[end - ptr] = '\0';
+
+ /* read the optional arguments */
+ ptr = end;
+ while (isspace(*ptr) && *ptr)
+ ++ptr;
+
+ end = ptr + strlen(ptr) - 1;
+ while (isspace(*end) && end > ptr)
+ --end;
+ if (!isspace(*end))
+ ++end;
+ *end = '\0';
+
+ if (strcmp(name, "NAME") == 0)
+ result = NAME;
+ else if (strcmp(name, "CHIPSET") == 0)
+ result = CHIPSET;
+ else if (strcmp(name, "SERVER") == 0)
+ result = SERVER;
+ else if (strcmp(name, "DRIVER") == 0)
+ result = DRIVER;
+ else if (strcmp(name, "RAMDAC") == 0)
+ result = RAMDAC;
+ else if (strcmp(name, "CLOCKCHIP") == 0)
+ result = CLOCKCHIP;
+ else if (strcmp(name, "DACSPEED") == 0)
+ result = DACSPEED;
+ else if (strcmp(name, "NOCLOCKPROBE") == 0)
+ result = NOCLOCKPROBE;
+ else if (strcmp(name, "UNSUPPORTED") == 0)
+ result = UNSUPPORTED;
+ else if (strcmp(name, "SEE") == 0)
+ result = SEE;
+ else if (strcmp(name, "LINE") == 0)
+ result = LINE;
+ else if (strcmp(name, "END") == 0)
+ result = END;
+ else {
+ strcpy(value, name);
+ return (UNKNOWN);
+ }
+
+ /* value *must* have at least 256 bytes */
+ strcpy(value, ptr);
+
+ return (result);
+}
+
+static int
+CompareCards(_Xconst void *left, _Xconst void *right)
+{
+ return strcasecmp((*(CardsEntry**)left)->name, (*(CardsEntry**)right)->name);
+}
+
+static int
+BCompareCards(_Xconst void *name, _Xconst void *card)
+{
+ return (strcasecmp((char*)name, (*(CardsEntry**)card)->name));
+}
diff --git a/hw/xfree86/utils/xorgcfg/cards.h b/hw/xfree86/utils/xorgcfg/cards.h
new file mode 100644
index 000000000..0e5ee328f
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/cards.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/cards.h,v 1.3 2002/07/15 20:46:04 dawes Exp $
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <X11/Xfuncproto.h>
+#include <X11/Xmd.h>
+#include <X11/Intrinsic.h>
+#include <X11/Xmu/SysUtil.h>
+
+#ifndef _xf86cfg_cards_h
+#define _xf86cfg_cards_h
+
+#ifdef USE_MODULES
+#ifdef CARDS_PRIVATE
+#include "loader.h"
+
+#include "xf86PciStr.h"
+#include "xf86PciIds.h"
+#endif /* CARDS_PRIVATE */
+#endif /* USE_MODULES */
+
+/* Flags in CardsEntry */
+#define F_NOCLOCKPROBE 0x1 /* Never probe clocks of the card. */
+#define F_UNSUPPORTED 0x2 /* Card is not supported (only VGA). */
+
+/*
+ * Types
+ */
+typedef struct {
+ char *name; /* Name of the card. */
+ char *chipset; /* Chipset (decriptive). */
+ char *server; /* Server identifier. */
+ char *driver; /* Driver identifier. */
+ char *ramdac; /* Ramdac identifier. */
+ char *clockchip; /* Clockchip identifier. */
+ char *dacspeed; /* DAC speed rating. */
+ int flags;
+ char *lines; /* Additional Device section lines. */
+ char *see; /* Must resolve in a last step.
+ * Allow more than one SEE entry? */
+} CardsEntry;
+
+extern CardsEntry **CardsDB;
+extern int NumCardsEntry;
+
+/*
+ * Prototypes
+ */
+void ReadCardsDatabase(void);
+CardsEntry *LookupCard(char*);
+char **GetCardNames(int*);
+char **FilterCardNames(char*, int*);
+#ifdef USE_MODULES
+void InitializePciInfo(void);
+typedef struct _xf86cfgModuleOptions *xf86cfgModuleOptionsPtr;
+void CheckChipsets(xf86cfgModuleOptionsPtr, int*);
+#endif
+
+#endif /* _xf86cfg_cards_h */
diff --git a/hw/xfree86/utils/xorgcfg/computer.xpm b/hw/xfree86/utils/xorgcfg/computer.xpm
new file mode 100644
index 000000000..75fc85b26
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/computer.xpm
@@ -0,0 +1,91 @@
+/* XPM */
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/computer.xpm,v 1.1 2000/04/04 22:36:58 dawes Exp $
+ */
+static char * computer_xpm[] = {
+"30 50 8 1",
+" c none",
+". c #CF3CCF3CCF3C",
+"X c #B6DABAEAB6DA",
+"o c #8E388E388E38",
+"O c #FFFFFFFFFFFF",
+"+ c #FFFF00000000",
+"@ c #514451445144",
+"# c #0000FFFF0000",
+" ............................ ",
+"..XXXXXXXXXXXXXXXXXXXXXXXXXXXo",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXo",
+".XXooooooooooooooooooooooooXXo",
+".XXo.......................XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XX....XXXXXXXXXXXOoXo.XXo",
+".XXo.XXooooXXXXXXXXXXXooXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.......................XXo",
+".XXooooooooooooooooooooooooXXo",
+".XXo.......................XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXooooooooooooooooooooooo.XXo",
+".XXo.......................XXo",
+".XXoooooooooooooo.XXXXXXXo.XXo",
+".XXo..............XXXXXXXo.XXo",
+".XXo.XXXXXXXXXXXX.XX.O.XXo.XXo",
+".XXo.oooooooooooX.XXO+OXXo.XXo",
+".XXo.XXXXXXXXXOOX.XX.O.XXo.XXo",
+".XXo.XXXXXXXXXXXX.XXXXXXXo.XXo",
+".XXo..............XXXXXXXo.XXo",
+".XXooooooooooooooooooooooo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XXX@@@@@@@@@XXX...XXo.XXo",
+".XXo.XX@@+@@@@@#@@X.OXXoXo.XXo",
+".XXo.XXX@@@@@@@@@XXXoooXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XXXXXXXXXXXXXXX..XXXo.XXo",
+".XXo.XXXXXXXXXXXXXX.OXoXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXooXXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXo.XXXXXXXXXXXXXXXXXXXXo.XXo",
+".XXXo.XXXXXXXXXXXXXXXXXXo.XXXo",
+".XXXo.XXXXXXXXXXXXXXXXXXo.XXXo",
+".XXXo.XXXXXXXXXXXXXXXXXXo.XXXo",
+".XXXo.oXXXoXXXoXXXoXXXoXo.XXXo",
+".XXXXo.XXXXXXXXXXXXXXXXo.XXXXo",
+".XXXXo..oXXXoXXXoXXoXXoo.XXXXo",
+".XXXXXoo..XXXXXXXXXXoo..XXXXXo",
+".XXXXXXXoo......oooo..XXXXXXXo",
+".XXXXXXXXXoooooo....XXXXXXXXXo",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXo",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXoo",
+" oooooooooooooooooooooooooooo "};
diff --git a/hw/xfree86/utils/xorgcfg/config.c b/hw/xfree86/utils/xorgcfg/config.c
new file mode 100644
index 000000000..929999f9e
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/config.c
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.c,v 1.8 2002/10/21 04:18:36 paulo Exp $
+ */
+
+#include "config.h"
+#include "mouse-cfg.h"
+#include "keyboard-cfg.h"
+#include "card-cfg.h"
+#include "monitor-cfg.h"
+#include "screen-cfg.h"
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Shell.h>
+
+/*
+ * Prototypes
+ */
+void BackCallback(Widget, XtPointer, XtPointer);
+void NextCallback(Widget, XtPointer, XtPointer);
+void ApplyCallback(Widget, XtPointer, XtPointer);
+void CloseCallback(Widget, XtPointer, XtPointer);
+void ErrorCallback(Widget, XtPointer, XtPointer);
+
+/*
+ * Initialization
+ */
+XF86SetupFunction mouse_functions[] = {
+ MouseDeviceAndProtocol,
+};
+
+XF86SetupFunction keyboard_functions[] = {
+ KeyboardModelAndLayout,
+};
+
+XF86SetupFunction card_functions[] = {
+ CardModel,
+};
+
+XF86SetupFunction monitor_functions[] = {
+ MonitorLayout,
+};
+
+XF86SetupFunction screen_functions[] = {
+ ScreenDialog,
+};
+
+XF86SetupFunctionList function_lists[] = {
+ {mouse_functions, sizeof(mouse_functions) / sizeof(mouse_functions[0]),},
+ {keyboard_functions, sizeof(keyboard_functions) / sizeof(keyboard_functions[0]),},
+ {card_functions, sizeof(card_functions) / sizeof(card_functions[0]),},
+ {monitor_functions, sizeof(monitor_functions) / sizeof(monitor_functions[0]),},
+ {screen_functions, sizeof(screen_functions) / sizeof(screen_functions[0]),},
+};
+
+XF86SetupInfo xf86info = {
+ sizeof(function_lists) / sizeof(function_lists[0]),
+ MOUSE,
+ function_lists,
+};
+
+Widget configp, current, ok, back, next;
+static Widget shell, errcurrent, oldcurrent;
+
+static int config_status, config_popped;
+
+static ConfigCheckFunction config_function;
+
+Widget ident_widget;
+char *ident_string;
+XF86ConfigPtr XF86Config;
+
+/*
+ * Implementation
+ */
+void
+StartConfig(void)
+{
+ static int first = 1;
+ Widget pane, top, label, bottom, cancel;
+ const char *filename;
+
+ if (!first)
+ return;
+ first = 0;
+
+ /* Read initial configuration */
+ if ((filename = xf86openConfigFile(getuid() == 0 ? CONFPATH : USER_CONFPATH,
+ XF86Config_path, NULL)) == NULL) {
+ int length = XF86Config_path ? strlen(XF86Config_path) : -1;
+
+ if (length > 2 &&
+ XF86Config_path[length - 2] == '-' &&
+ XF86Config_path[length - 1] == '4') {
+ XF86Config_path[length - 2] = '\0';
+ filename = xf86openConfigFile(getuid() == 0 ?
+ CONFPATH : USER_CONFPATH,
+ XF86Config_path, NULL);
+ }
+
+ if (filename == NULL) {
+ fprintf(stderr, "Cannot open config file.\n");
+ exit(1);
+ }
+ }
+ XF86Config_path = (char *)filename;
+ if ((XF86Config = xf86readConfigFile()) == NULL) {
+ fprintf(stderr, "Problem when parsing config file\n");
+ exit(1);
+ }
+
+ shell = XtCreatePopupShell("config", transientShellWidgetClass,
+ toplevel, NULL, 0);
+ pane = XtCreateManagedWidget("pane", panedWidgetClass,
+ shell, NULL, 0);
+ top = XtCreateManagedWidget("top", formWidgetClass,
+ pane, NULL, 0);
+ label = XtCreateManagedWidget("label", labelWidgetClass,
+ top, NULL, 0);
+ ident_widget = XtVaCreateManagedWidget("identifier", asciiTextWidgetClass,
+ top,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ configp = XtCreateManagedWidget("work", formWidgetClass,
+ pane, NULL, 0);
+ current = XtCreateManagedWidget("wellcome", labelWidgetClass,
+ configp, NULL, 0);
+ bottom = XtCreateManagedWidget("bottom", formWidgetClass,
+ pane, NULL, 0);
+ back = XtCreateManagedWidget("back", commandWidgetClass,
+ bottom, NULL, 0);
+ XtAddCallback(back, XtNcallback, BackCallback, (XtPointer)&xf86info);
+ next = XtCreateManagedWidget("next", commandWidgetClass,
+ bottom, NULL, 0);
+ XtAddCallback(next, XtNcallback, NextCallback, (XtPointer)&xf86info);
+ ok = XtCreateManagedWidget("ok", commandWidgetClass,
+ bottom, NULL, 0);
+ XtAddCallback(ok, XtNcallback, ApplyCallback, (XtPointer)NULL);
+ cancel = XtCreateManagedWidget("cancel", commandWidgetClass,
+ bottom, NULL, 0);
+ XtAddCallback(cancel, XtNcallback, CloseCallback, (XtPointer)NULL);
+
+ XtRealizeWidget(shell);
+
+ XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
+}
+
+/*ARGSUSED*/
+Bool
+ConfigLoop(ConfigCheckFunction config_fn)
+{
+ Arg args[1];
+ config_popped = True;
+ XtPopup(shell, XtGrabExclusive);
+
+ config_function = config_fn;
+ while (config_popped)
+ XtAppProcessEvent(XtWidgetToApplicationContext(shell), XtIMAll);
+
+ XtSetArg(args[0], XtNstring, &ident_string);
+ XtGetValues(ident_widget, args, 1);
+
+ return (config_status);
+}
+
+/*ARGSUSED*/
+void
+ConfigError(void)
+{
+ static int first = 1;
+
+ if (first) {
+ Widget label, command;
+
+ errcurrent = XtCreateWidget("error", formWidgetClass,
+ configp, NULL, 0);
+ label = XtCreateManagedWidget("label", labelWidgetClass,
+ errcurrent, NULL, 0);
+ command = XtCreateManagedWidget("command", commandWidgetClass,
+ errcurrent, NULL, 0);
+ XtAddCallback(command, XtNcallback, ErrorCallback, NULL);
+
+ XtRealizeWidget(errcurrent);
+ }
+
+ oldcurrent = current;
+ XtChangeManagedSet(&current, 1, NULL, NULL, &errcurrent, 1);
+ current = errcurrent;
+
+ XtSetSensitive(ok, False);
+}
+
+/*ARGSUSED*/
+void
+ErrorCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XtChangeManagedSet(&errcurrent, 1, NULL, NULL, &oldcurrent, 1);
+ current = oldcurrent;
+
+ XtSetSensitive(ok, True);
+}
+
+/*ARGSUSED*/
+void
+BackCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XF86SetupInfo *info = (XF86SetupInfo*)user_data;
+ int idx = info->lists[info->cur_list].cur_function - 1;
+
+ if (idx >= 0 && info->lists[info->cur_list].num_functions > 0) {
+ info->lists[info->cur_list].cur_function = idx;
+ if (idx - 1 == -1)
+ XtSetSensitive(back, False);
+ if (!XtIsSensitive(next))
+ XtSetSensitive(next, True);
+ (info->lists[info->cur_list].functions[idx])(info);
+ }
+}
+
+/*ARGSUSED*/
+void
+NextCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XF86SetupInfo *info = (XF86SetupInfo*)user_data;
+ int idx = info->lists[info->cur_list].cur_function + 1;
+
+ if (idx < info->lists[info->cur_list].num_functions) {
+ info->lists[info->cur_list].cur_function = idx;
+ if (idx + 1 == info->lists[info->cur_list].num_functions)
+ XtSetSensitive(next, False);
+ if (!XtIsSensitive(back))
+ XtSetSensitive(back, True);
+ (info->lists[info->cur_list].functions[idx])(info);
+ }
+}
+
+/*ARGSUSED*/
+void
+CloseCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XtPopdown(shell);
+ config_popped = False;
+ config_status = False;
+ /* make sure it is sensitive */
+ XtSetSensitive(ok, True);
+ xf86info.lists[xf86info.cur_list].cur_function = 0;
+}
+
+/*ARGSUSED*/
+void
+ApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+
+ XtSetArg(args[0], XtNstring, &ident_string);
+ XtGetValues(ident_widget, args, 1);
+
+ if (config_function == NULL || (*config_function)()) {
+ XtPopdown(shell);
+ config_popped = False;
+ config_status = True;
+ xf86info.lists[xf86info.cur_list].cur_function = 0;
+ }
+ else
+ ConfigError();
+}
+
+/*ARGSUSED*/
+void
+ConfigCancelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ CloseCallback(w, NULL, NULL);
+}
diff --git a/hw/xfree86/utils/xorgcfg/config.h b/hw/xfree86/utils/xorgcfg/config.h
new file mode 100644
index 000000000..34b8d7e52
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/config.h
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.16 2002/05/31 18:46:03 dawes Exp $
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Xmu/SysUtil.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <string.h>
+#include <unistd.h>
+#if defined(sun) && defined(SVR4)
+#include <strings.h>
+#endif
+
+#include <stdarg.h>
+
+#ifdef __UNIXOS2__
+#define strcasecmp stricmp
+#define setenv putenv
+#define PATH_MAX 260
+#endif
+
+/* Get PATH_MAX */
+#ifndef PATH_MAX
+# if defined(_POSIX_SOURCE)
+# include <limits.h>
+# else
+# define _POSIX_SOURCE
+# include <limits.h>
+# undef _POSIX_SOURCE
+# endif
+# ifndef PATH_MAX
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# else
+# define PATH_MAX 1024
+# endif
+# endif
+#endif
+
+#include <xf86Parser.h>
+#include <X11/XKBlib.h>
+#include <X11/extensions/XKBgeom.h>
+#include <X11/extensions/XKM.h>
+#include <X11/extensions/XKBfile.h>
+#include <X11/extensions/XKBui.h>
+#include <X11/extensions/XKBrules.h>
+
+#ifndef _xf86cfg_config_h
+#define _xf86cfg_config_h
+
+/* Must match the offset in the xf86info structure at config.c,
+ * and is used also by interface.c
+ */
+#define MOUSE 0
+#define KEYBOARD 1
+#define CARD 2
+#define MONITOR 3
+#define SCREEN 4
+#define SERVER 5
+
+#define UNUSED 0
+#define USED 1
+
+#define CONFIG_LAYOUT 0
+#define CONFIG_SCREEN 1
+#define CONFIG_MODELINE 2
+#define CONFIG_ACCESSX 3
+extern int config_mode;
+
+#define CONFPATH "%A," "%R," \
+ "/etc/X11/%R," "%P/etc/X11/%R," \
+ "%E," "%F," \
+ "/etc/X11/%F," "%P/etc/X11/%F," \
+ "%D/%X," \
+ "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
+ "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
+ "%P/etc/X11/%X," \
+ "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
+ "%P/lib/X11/%X"
+#define USER_CONFPATH "/etc/X11/%S," "%P/etc/X11/%S," \
+ "/etc/X11/%G," "%P/etc/X11/%G," \
+ "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
+ "%P/etc/X11/%X," \
+ "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
+ "%P/lib/X11/%X"
+
+/*
+ * Types
+ */
+typedef struct _XF86SetupInfo XF86SetupInfo;
+typedef void (*XF86SetupFunction)(XF86SetupInfo*);
+
+typedef struct _XF86SetupFunctionList {
+ XF86SetupFunction *functions;
+ int num_functions;
+ int cur_function;
+} XF86SetupFunctionList;
+
+struct _XF86SetupInfo {
+ int num_lists;
+ int cur_list;
+ XF86SetupFunctionList *lists;
+};
+
+typedef Bool (*ConfigCheckFunction)(void);
+
+typedef struct _xf86cfgDevice xf86cfgDevice;
+
+struct _xf86cfgDevice {
+ XtPointer config;
+ Widget widget;
+ int type, state, refcount;
+};
+
+typedef struct {
+ XF86ConfScreenPtr screen;
+ Widget widget;
+ int type, state, refcount;
+ xf86cfgDevice *card;
+ xf86cfgDevice *monitor;
+ short row, column;
+ XRectangle rect;
+ short rotate;
+} xf86cfgScreen;
+
+/* this structure is used just to restore
+ properly the monitors layout in the
+ screen window configuration.
+ */
+typedef struct {
+ XF86ConfLayoutPtr layout;
+ xf86cfgScreen **screen;
+ XPoint *position;
+ int num_layouts;
+} xf86cfgLayout;
+
+/* The vidmode extension usage is controlled by this structure.
+ * The information is read at startup, and added monitors cannot
+ * be configured, since they are not attached to a particular screen.
+ */
+typedef struct _xf86cfgVidMode xf86cfgVidmode;
+
+typedef struct {
+ XF86ConfLayoutPtr layout; /* current layout */
+ Widget cpu;
+ xf86cfgLayout **layouts;
+ Cardinal num_layouts;
+ xf86cfgScreen **screens;
+ Cardinal num_screens;
+ xf86cfgDevice **devices;
+ Cardinal num_devices;
+ xf86cfgVidmode **vidmodes;
+ Cardinal num_vidmodes;
+} xf86cfgComputer;
+
+/*
+ * Prototypes
+ */
+void StartConfig(void);
+Bool ConfigLoop(ConfigCheckFunction);
+void ConfigError(void);
+void ChangeScreen(XF86ConfMonitorPtr, XF86ConfMonitorPtr,
+ XF86ConfDevicePtr, XF86ConfDevicePtr);
+void SetTip(xf86cfgDevice*);
+Bool startx(void);
+void endx(void);
+void startaccessx(void);
+void ConfigCancelAction(Widget, XEvent*, String*, Cardinal*);
+void ExpertConfigureStart(void);
+void ExpertConfigureEnd(void);
+void ExpertCloseAction(Widget, XEvent*, String*, Cardinal*);
+void ExpertCallback(Widget, XtPointer, XtPointer);
+
+/*
+ * Initialization
+ */
+extern Widget toplevel, configp, current, back, next;
+extern XtAppContext appcon;
+extern XF86SetupInfo xf86info;
+extern Widget ident_widget;
+extern char *ident_string;
+extern XF86ConfigPtr XF86Config;
+extern char *XF86Config_path;
+extern char *XF86Module_path;
+extern char *XFree86_path;
+extern char *XF86Font_path;
+extern char *XF86RGB_path;
+extern char *XFree86Dir;
+extern xf86cfgComputer computer;
+extern Atom wm_delete_window;
+extern Display *DPY;
+extern Pixmap menuPixmap;
+#ifdef USE_MODULES
+extern int nomodules;
+#endif
+
+#endif /* _xf86cfg_config_h */
diff --git a/hw/xfree86/utils/xorgcfg/down.xbm b/hw/xfree86/utils/xorgcfg/down.xbm
new file mode 100644
index 000000000..742adf202
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/down.xbm
@@ -0,0 +1,8 @@
+#define down_width 19
+#define down_height 19
+static unsigned char down_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00,
+ 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00,
+ 0x80, 0x0f, 0x00, 0xfc, 0xff, 0x01, 0xf8, 0xff, 0x00, 0xf0, 0x7f, 0x00,
+ 0xe0, 0x3f, 0x00, 0xc0, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x07, 0x00,
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/expert.c b/hw/xfree86/utils/xorgcfg/expert.c
new file mode 100644
index 000000000..b9890b32b
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/expert.c
@@ -0,0 +1,4860 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.14 2003/02/07 05:46:53 paulo Exp $
+ */
+
+#include "config.h"
+#include "xf86config.h"
+#include "options.h"
+#include "screen.h"
+#include "vidmode.h"
+#include "monitor-cfg.h"
+#include <X11/Shell.h>
+#include <X11/CompositeP.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Panner.h>
+#include <X11/Xaw/Porthole.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/Tree.h>
+#include <ctype.h>
+
+/*
+ * Types
+ */
+typedef struct _TreeNode TreeNode;
+typedef union _TreeData TreeData;
+typedef void (*NodeDeleteFunc)(TreeNode*);
+typedef void (*NodeUpdateFunc)(TreeNode*);
+
+union _TreeData {
+ struct {
+ Widget text;
+ } files;
+ struct {
+ Widget text;
+ XF86LoadPtr load;
+ } module;
+ struct {
+ Widget text;
+ XF86ConfModesPtr modes;
+ } modes;
+ struct {
+ Widget text, value;
+ XF86ConfModeLinePtr modeline;
+ } modeline;
+ struct {
+ Widget text, vendor, board, busid, driver;
+ XF86ConfVideoAdaptorPtr video;
+ } video;
+ struct {
+ Widget text;
+ XF86ConfVideoPortPtr port;
+ } port;
+ struct {
+ Widget text, vendor, model, width, height, hsync, vrefresh,
+ gammaRed, gammaGreen, gammaBlue;
+ XF86ConfMonitorPtr monitor;
+ } monitor;
+ struct {
+ Widget menu;
+ XF86ConfModesLinkPtr modeslink;
+ } modeslink;
+ struct {
+ Widget text, vendor, board, chipset, busid, card, driver, ramdac,
+ dacSpeed, videoRam, textClockFreq, biosBase, memBase, ioBase,
+ clockChip, devClock, chipId, chipRev, irq, screen;
+ XF86ConfDevicePtr device;
+ } device;
+ struct {
+ Widget text, defaultDepth, defaultBpp, defaultFbBpp,
+ monitor, device;
+ XF86ConfScreenPtr screen;
+ } screen;
+ struct {
+ Widget menu;
+ XF86ConfAdaptorLinkPtr adaptorlink;
+ } adaptorlink;
+ struct {
+ Widget viewport, c_virtual, depth, bpp, visual, weight, black, white;
+ XF86ConfDisplayPtr display;
+ } display;
+ struct {
+ Widget text;
+ XF86ModePtr mode;
+ } mode;
+ struct {
+ Widget text;
+ XF86ConfInputPtr input;
+ } input;
+ struct {
+ Widget text;
+ XF86ConfLayoutPtr layout;
+ } layout;
+ struct {
+ Widget menu, button, scrnum, adjx, adjy;
+ XF86ConfScreenPtr screen;
+ XF86ConfAdjacencyPtr adjacency;
+ } adjacency;
+ struct {
+ Widget menu;
+ XF86ConfInputrefPtr inputref;
+ } inputref;
+ struct {
+ Widget text;
+ XF86ConfVendorPtr vendor;
+ } vendor;
+ struct {
+ Widget text;
+ XF86ConfVendSubPtr vendsub;
+ } vendsub;
+ struct {
+ Widget name, group, mode;
+ XF86ConfDRIPtr dri;
+ } dri;
+ struct {
+ Widget count, size, flags;
+ XF86ConfBuffersPtr buffers;
+ } buffers;
+};
+
+struct _TreeNode {
+ Widget node, toggle, treeParent;
+ TreeNode *parent, *child, *next;
+ TreeData *data;
+ NodeDeleteFunc destroy;
+ NodeUpdateFunc update;
+};
+
+/*
+ * Prototypes
+ */
+static Bool ExpertInitialize(void);
+static TreeNode *NewNode(TreeNode*, Widget, Widget, Widget, TreeData*);
+static void DeleteNode(TreeNode*);
+static void DestroyCallback(Widget, XtPointer, XtPointer);
+static void PannerCallback(Widget, XtPointer, XtPointer);
+static void PortholeCallback(Widget, XtPointer, XtPointer);
+static void ToggleCallback(Widget, XtPointer, XtPointer);
+static void ToggleNode(TreeNode*, Bool);
+static void ToggleNodeRecursive(TreeNode*);
+static void OptionsCallback(Widget, XtPointer, XtPointer);
+static void RelayoutTree(void);
+static void PopdownCallback(Widget, XtPointer, XtPointer);
+static void UpdateConfig(TreeNode*);
+static void DestroyTree(TreeNode*);
+
+static void CreateFiles(TreeNode*);
+static void CreateFilesField(TreeNode*, char*, char*);
+static void UpdateFiles(TreeNode*);
+
+static void CreateFontPath(TreeNode*, char*);
+static Widget CreateFontPathField(TreeNode*, char*, Bool);
+static void FontPathChanged(TreeNode*);
+static void NewFontPathCallback(Widget, XtPointer, XtPointer);
+static void FontPathCallback(Widget, XtPointer, XtPointer);
+
+static void CreateModulePath(TreeNode*, char*);
+static Widget CreateModulePathField(TreeNode*, char*, Bool);
+static void ModulePathChanged(TreeNode*);
+static void NewModulePathCallback(Widget, XtPointer, XtPointer);
+
+static void CreateModule(TreeNode*, XF86LoadPtr);
+static void CreateModuleField(TreeNode*, Bool);
+static void ModuleDestroy(TreeNode*);
+static void NewModuleCallback(Widget, XtPointer, XtPointer);
+
+static void CreateModes(TreeNode*, XF86ConfModesPtr);
+static void CreateModesField(TreeNode*, Bool);
+static void ModesDestroy(TreeNode*);
+static void NewModesCallback(Widget, XtPointer, XtPointer);
+static void CreateModesModeLine(TreeNode*, XF86ConfModeLinePtr);
+static void ModesModeLineDestroy(TreeNode*);
+static void NewModesModeLineCallback(Widget, XtPointer, XtPointer);
+
+static void CreateModeLineField(TreeNode*, Bool, Bool);
+static XF86ConfModeLinePtr ParseModeLine(char*, char*);
+
+static void CreateVideoAdaptor(TreeNode*, XF86ConfVideoAdaptorPtr);
+static void CreateVideoAdaptorField(TreeNode*, Bool);
+static void VideoAdaptorDestroy(TreeNode*);
+static void NewVideoAdaptorCallback(Widget, XtPointer, XtPointer);
+static void VideoAdaptorUpdate(TreeNode*);
+static void CreateVideoPort(TreeNode*, XF86ConfVideoPortPtr);
+static void CreateVideoPortField(TreeNode*, Bool);
+static void VideoPortDestroy(TreeNode*);
+static void NewVideoPortCallback(Widget, XtPointer, XtPointer);
+
+static void CreateMonitor(TreeNode*, XF86ConfMonitorPtr);
+static void CreateMonitorField(TreeNode*, Bool);
+static void MonitorDestroy(TreeNode*);
+static void NewMonitorCallback(Widget, XtPointer, XtPointer);
+static void MonitorUpdate(TreeNode*);
+static void CreateMonitorModeLine(TreeNode*, XF86ConfModeLinePtr);
+static void MonitorModeLineDestroy(TreeNode*);
+static void NewMonitorModeLineCallback(Widget, XtPointer, XtPointer);
+static void CreateMonitorModes(TreeNode*, XF86ConfModesLinkPtr);
+static void CreateMonitorModesField(TreeNode*, Bool);
+static void MonitorModesLinkDestroy(TreeNode*);
+static void NewMonitorModesCallback(Widget, XtPointer, XtPointer);
+
+static void CreateDevice(TreeNode*, XF86ConfDevicePtr);
+static void CreateDeviceField(TreeNode*, Bool);
+static void NewDeviceCallback(Widget, XtPointer, XtPointer);
+static void DeviceDestroy(TreeNode*);
+static void DeviceUpdate(TreeNode*);
+
+static void CreateScreen(TreeNode*, XF86ConfScreenPtr);
+static void CreateScreenField(TreeNode*, Bool);
+static void NewScreenCallback(Widget, XtPointer, XtPointer);
+static void ScreenDestroy(TreeNode*);
+static void ScreenUpdate(TreeNode*);
+static void CreateScreenAdaptor(TreeNode*, XF86ConfAdaptorLinkPtr);
+static void CreateScreenAdaptorField(TreeNode*, Bool);
+static void NewScreenAdaptorCallback(Widget, XtPointer, XtPointer);
+static void ScreenAdaptorDestroy(TreeNode*);
+static void CreateScreenDisplay(TreeNode*, XF86ConfDisplayPtr);
+static void CreateScreenDisplayField(TreeNode*, Bool);
+static void NewScreenDisplayCallback(Widget, XtPointer, XtPointer);
+static void ScreenDisplayDestroy(TreeNode*);
+static void ScreenDisplayUpdate(TreeNode*);
+static void CreateDisplayMode(TreeNode*, XF86ModePtr);
+static void CreateDisplayModeField(TreeNode*, Bool);
+static void NewDisplayModeCallback(Widget, XtPointer, XtPointer);
+static void DisplayModeDestroy(TreeNode*);
+
+static void CreateInput(TreeNode*, XF86ConfInputPtr);
+static void CreateInputField(TreeNode*, Bool);
+static void InputDestroy(TreeNode*);
+static void NewInputCallback(Widget, XtPointer, XtPointer);
+static void InputUpdate(TreeNode*);
+
+static void CreateLayout(TreeNode*, XF86ConfLayoutPtr);
+static void CreateLayoutField(TreeNode*, Bool);
+static void LayoutDestroy(TreeNode*);
+static void NewLayoutCallback(Widget, XtPointer, XtPointer);
+static void CreateAdjacency(TreeNode*, XF86ConfAdjacencyPtr);
+static void CreateAdjacencyField(TreeNode*, Bool);
+static void AdjacencyDestroy(TreeNode*);
+static void NewAdjacencyCallback(Widget, XtPointer, XtPointer);
+static void AdjacencyMenuCallback(Widget, XtPointer, XtPointer);
+static void AdjacencyToggleCallback(Widget, XtPointer, XtPointer);
+static void CreateInputref(TreeNode*, XF86ConfInputrefPtr);
+static void CreateInputrefField(TreeNode*, Bool);
+static void InputrefDestroy(TreeNode*);
+static void NewInputrefCallback(Widget, XtPointer, XtPointer);
+
+static void CreateVendor(TreeNode*, XF86ConfVendorPtr);
+static void CreateVendorField(TreeNode*, Bool);
+static void VendorDestroy(TreeNode*);
+static void NewVendorCallback(Widget, XtPointer, XtPointer);
+static void CreateVendorSub(TreeNode*, XF86ConfVendSubPtr);
+static void CreateVendorSubField(TreeNode*, Bool);
+static void NewVendorSubCallback(Widget, XtPointer, XtPointer);
+static void VendorSubDestroy(TreeNode*);
+static void VendorSubUpdate(TreeNode*);
+
+static void CreateDRI(TreeNode*, XF86ConfDRIPtr);
+static void CreateDRIField(TreeNode*);
+static void DRIUpdate(TreeNode*);
+
+static void CreateBuffers(TreeNode*, XF86ConfBuffersPtr);
+static void CreateBuffersField(TreeNode*, Bool);
+static void BuffersDestroy(TreeNode*);
+static void NewBuffersCallback(Widget, XtPointer, XtPointer);
+static void BuffersUpdate(TreeNode*);
+
+extern void RemoveDeviceCallback(Widget, XtPointer, XtPointer);
+
+/* interface.c */
+extern void InitializeDevices(void);
+extern void SelectLayoutCallback(Widget, XtPointer, XtPointer);
+extern void UpdateMenuDeviceList(int);
+extern void SetConfigModeCallback(Widget, XtPointer, XtPointer);
+extern void DefaultLayoutCallback(Widget, XtPointer, XtPointer);
+extern void RemoveLayoutCallback(Widget, XtPointer, XtPointer);
+
+/*
+ * Initialization
+ */
+static Widget shell, expert, tree, panner;
+extern Widget work, optionsShell, config, layoutp, topMenu;
+extern xf86cfgDevice cpu_device;
+static TreeNode *mainNode, *monitorTree, *screenTree, *layoutTree;
+
+/*
+ * Implementation
+ */
+void
+ExpertConfigureStart(void)
+{
+ ExpertInitialize();
+
+ XtPopup(shell, XtGrabExclusive);
+ if (optionsShell == NULL)
+ CreateOptionsShell();
+ XtVaSetValues(optionsShell, XtNtransientFor, shell, NULL, 0);
+}
+
+void
+ExpertConfigureEnd(void)
+{
+ int i, save_config_mode = config_mode;
+ Widget sme, layopt, layoutsme = NULL;
+ XF86ConfLayoutPtr lay;
+
+ XtVaSetValues(optionsShell, XtNtransientFor, toplevel, NULL, 0);
+ XtPopdown(shell);
+
+ /* Need to do this to avoid all code elsewhere needing to update the
+ * "expert" widget tree
+ */
+ UpdateConfig(mainNode);
+ DestroyTree(mainNode);
+ XtDestroyWidget(shell);
+ expert = NULL;
+
+ if (save_config_mode != CONFIG_LAYOUT)
+ SetConfigModeCallback(topMenu, (XtPointer)CONFIG_LAYOUT, NULL);
+
+ /* Reset everything as the "expert" interface can do almost anything
+ * to the configuration.
+ */
+ for (i = 0; i < computer.num_screens; i++) {
+ XtDestroyWidget(computer.screens[i]->widget);
+ XtFree((XtPointer)computer.screens[i]);
+ }
+ XtFree((XtPointer)computer.screens);
+ computer.screens = NULL;
+ computer.num_screens = 0;
+
+ for (i = 0; i < computer.num_devices; i++) {
+ XtDestroyWidget(computer.devices[i]->widget);
+ XtFree((XtPointer)computer.devices[i]);
+ }
+ XtFree((XtPointer)computer.devices);
+ computer.devices = NULL;
+ computer.num_devices = 0;
+
+ for (i = 0; i < computer.num_layouts; i++) {
+ XtFree((XtPointer)computer.layouts[i]->position);
+ XtFree((XtPointer)computer.layouts[i]);
+ }
+ XtFree((XtPointer)computer.layouts);
+ computer.layouts = NULL;
+ computer.num_layouts = 0;
+
+ for (i = 0; i < computer.num_vidmodes; i++)
+ XtFree((XtPointer)computer.vidmodes[i]);
+ XtFree((XtPointer)computer.vidmodes);
+ computer.vidmodes = NULL;
+ computer.num_vidmodes = 0;
+
+ /* Reinitialize devices/screens */
+ InitializeDevices();
+ UpdateMenuDeviceList(MOUSE);
+ UpdateMenuDeviceList(KEYBOARD);
+ UpdateMenuDeviceList(CARD);
+ UpdateMenuDeviceList(MONITOR);
+
+ /* Update layout menu */
+ /* first entry is "New server layout" */
+ for (i = 1; i < ((CompositeWidget)layoutp)->composite.num_children; i++)
+ XtDestroyWidget(((CompositeWidget)layoutp)->composite.children[i]);
+ for (i = 0; i < layoutp->core.num_popups; i++)
+ XtDestroyWidget(layoutp->core.popup_list[i]);
+ lay = XF86Config->conf_layout_lst;
+ while (lay != NULL) {
+ sme = XtVaCreateManagedWidget("sme", smeBSBObjectClass,
+ layoutp,
+ XtNlabel, lay->lay_identifier,
+ XtNmenuName, lay->lay_identifier,
+ XtNleftBitmap, menuPixmap,
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, SelectLayoutCallback, (XtPointer)lay);
+ if (layoutsme == NULL)
+ layoutsme = sme;
+ layopt = XtCreatePopupShell(lay->lay_identifier, simpleMenuWidgetClass,
+ layoutp, NULL, 0);
+ sme = XtCreateManagedWidget("default", smeBSBObjectClass,
+ layopt, NULL, 0);
+ XtAddCallback(sme, XtNcallback, DefaultLayoutCallback, NULL);
+ sme = XtCreateManagedWidget("remove", smeBSBObjectClass,
+ layopt, NULL, 0);
+ XtAddCallback(sme, XtNcallback, RemoveLayoutCallback, NULL);
+ XtRealizeWidget(layopt);
+
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+ computer.layout = NULL;
+ SelectLayoutCallback(layoutsme,
+ XF86Config->conf_layout_lst, NULL);
+
+
+ if (XF86Config->conf_flags && XF86Config->conf_flags->flg_option_lst)
+ SetTip(&cpu_device);
+ for (i = 0; i < computer.num_devices; i++)
+ SetTip(computer.devices[i]);
+
+ /* Reinitialize vidmodes */
+ InitializeVidmodes();
+
+ if (save_config_mode != CONFIG_LAYOUT)
+ SetConfigModeCallback(topMenu, (XtPointer)(long)save_config_mode, NULL);
+}
+
+/*ARGSUSED*/
+void
+ExpertCloseAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ ExpertConfigureEnd();
+}
+
+/*ARGSUSED*/
+void
+ExpertCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ ExpertConfigureStart();
+}
+
+/*ARGSUSED*/
+static void
+PopdownCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ ExpertConfigureEnd();
+}
+
+/* Files */
+static void
+CreateFiles(TreeNode *files)
+{
+ XF86ConfFilesPtr file = XF86Config->conf_files;
+ TreeNode *node, *fontpath, *modulepath;
+ Widget w;
+ char *value;
+
+ value = file->file_logfile ? file->file_logfile : "";
+ node = NewNode(files, NULL, NULL, files->node,
+ (TreeData*)XtCalloc(1, sizeof(TreeData)));
+ CreateFilesField(node, "LogFile", value);
+ files->child = node;
+ files->update = UpdateFiles;
+
+ if (XF86RGB_path)
+ value = XF86RGB_path;
+ else
+ value = file->file_rgbpath ? file->file_rgbpath : "";
+ node->next = NewNode(files, NULL, NULL, files->node,
+ (TreeData*)XtCalloc(1, sizeof(TreeData)));
+ node = node->next;
+ CreateFilesField(node, "RgbPath", value);
+
+ w = XtVaCreateManagedWidget("ModulePath", toggleWidgetClass, tree,
+ XtNtreeParent, files->node, NULL, 0);
+ node->next = modulepath = NewNode(files, w, w, files->node, NULL);
+ node = node->next;
+ CreateModulePath(modulepath, NULL);
+
+ w = XtVaCreateManagedWidget("FontPath", toggleWidgetClass, tree,
+ XtNtreeParent, files->node, NULL, 0);
+ node->next = fontpath = NewNode(files, w, w, files->node, NULL);
+ node = node->next;
+ CreateFontPath(fontpath, NULL);
+}
+
+static void
+CreateFilesField(TreeNode *node, char *name, char *value)
+{
+ Widget box, label, text;
+
+ box = XtVaCreateManagedWidget(name, boxWidgetClass, tree,
+ XtNtreeParent, node->node, NULL, 0);
+ node->node = box;
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, name, NULL, 0);
+ text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, XtNstring, value,
+ NULL, 0);
+ node->data->files.text = text;
+}
+
+static void
+UpdateFiles(TreeNode *files)
+{
+ char *str;
+
+ /* LogFile */
+ files = files->child;
+ XtVaGetValues(files->data->files.text, XtNstring, &str, NULL, 0);
+ XtFree(XF86Config->conf_files->file_logfile);
+ if (*str)
+ XF86Config->conf_files->file_logfile = XtNewString(str);
+ else
+ XF86Config->conf_files->file_logfile = NULL;
+
+ /* LogFile */
+ files = files->next;
+ XtVaGetValues(files->data->files.text, XtNstring, &str, NULL, 0);
+ XtFree(XF86Config->conf_files->file_rgbpath);
+ if (*str)
+ XF86Config->conf_files->file_rgbpath = XtNewString(str);
+ else
+ XF86Config->conf_files->file_rgbpath = NULL;
+}
+
+/* FontPath */
+/* Don't need to set the update tree field, as it is already set
+ * as the destroy field */
+static void
+CreateFontPath(TreeNode *fontpath, char *path)
+{
+ TreeNode *prev = NULL, *node;
+ Widget w;
+
+ if (path == NULL) {
+ if (XF86Font_path) {
+ path = XtNewString(XF86Font_path);
+ if (XF86Config->conf_files && XF86Config->conf_files->file_fontpath) {
+ XtFree(XF86Config->conf_files->file_fontpath);
+ XF86Config->conf_files->file_fontpath = XtNewString(path);
+ }
+ }
+ else if (XF86Config->conf_files && XF86Config->conf_files->file_fontpath)
+ path = XtNewString(XF86Config->conf_files->file_fontpath);
+ }
+ else {
+ path = XtNewString(path);
+ if ((prev = fontpath->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+ }
+
+ if (path) {
+ char *s;
+
+ for (s = strtok(path, ","); s != NULL; s = strtok(NULL, ",")) {
+ node = NewNode(fontpath, NULL, NULL, fontpath->node, NULL);
+ node->destroy = FontPathChanged;
+ w = CreateFontPathField(node, s, False);
+ if (fontpath->child == NULL)
+ fontpath->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ }
+ XtFree(path);
+ }
+
+ node = NewNode(fontpath, NULL, NULL, fontpath->node, NULL);
+ w = CreateFontPathField(node, "", True);
+ if (fontpath->child == NULL)
+ fontpath->child = node;
+ else
+ prev->next = node;
+}
+
+static Widget
+CreateFontPathField(TreeNode *fontpath, char *value, Bool addnew)
+{
+ Widget box, command, text;
+ TreeData *data;
+
+ box = XtVaCreateWidget("fontpath", formWidgetClass, tree,
+ XtNtreeParent, fontpath->treeParent, NULL, 0);
+ fontpath->node = box;
+ if (!addnew) {
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback,
+ (XtPointer)fontpath);
+ command = XtCreateManagedWidget("up", commandWidgetClass, box, NULL, 0);
+ XtAddCallback(command, XtNcallback, FontPathCallback,
+ (XtPointer)fontpath);
+ command = XtCreateManagedWidget("down", commandWidgetClass, box, NULL, 0);
+ XtAddCallback(command, XtNcallback, FontPathCallback,
+ (XtPointer)fontpath);
+ text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, value, NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
+ XtAddCallback(command, XtNcallback, NewFontPathCallback,
+ (XtPointer)fontpath);
+ text = XtVaCreateManagedWidget("valueNew", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, value, NULL, 0);
+ }
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->files.text = text;
+ fontpath->data = data;
+
+ if (fontpath->treeParent && XtIsRealized(fontpath->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+
+ return (box);
+}
+
+static void
+FontPathChanged(TreeNode *node)
+{
+ TreeNode *parent = node->parent;
+ char *fontpath = NULL, *str;
+ Arg args[1];
+ int pos = 0, len;
+
+ /* last node is the "new" */
+ for (node = parent->child; node->next != NULL; node = node->next) {
+ if (pos)
+ fontpath[pos++] = ',';
+ XtSetArg(args[0], XtNstring, &str);
+ XtGetValues(node->data->files.text, args, 1);
+ len = strlen(str) + 2;
+ fontpath = XtRealloc(fontpath, pos + len);
+ strcpy(fontpath + pos, str);
+ pos += len - 2;
+ }
+
+ if (XF86Config->conf_files->file_fontpath)
+ XtFree(XF86Config->conf_files->file_fontpath);
+ XF86Config->conf_files->file_fontpath = fontpath;
+}
+
+static void
+NewFontPathCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *fontpath, *node = (TreeNode*)user_data;
+ Arg args[1];
+ char *str;
+
+ XtSetArg(args[0], XtNstring, &str);
+ XtGetValues(node->data->files.text, args, 1);
+ if (*str == '\0')
+ return;
+
+ fontpath = node->parent;
+ DeleteNode(node);
+ CreateFontPath(fontpath, str);
+
+ FontPathChanged(fontpath->child);
+ RelayoutTree();
+}
+
+/*ARGSUSED*/
+static void
+FontPathCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node, *fontpath = (TreeNode*)user_data;
+ char *t1, *t2;
+ Widget w1, w2;
+
+ parent = fontpath->parent;
+ node = parent->child;
+ if (!node->next->next)
+ return;
+ if (strcmp(XtName(w), "up") == 0) {
+ if (node == fontpath)
+ while (node->next->next)
+ node = node->next;
+ else
+ while (node && node->next != fontpath)
+ node = node->next;
+ }
+ else {
+ if (fontpath->next->next)
+ node = fontpath->next;
+ /* else is already correct */
+ }
+
+ w1 = node->data->files.text;
+ w2 = fontpath->data->files.text;
+
+ XtVaGetValues(w1, XtNstring, &t1, NULL);
+ XtVaGetValues(w2, XtNstring, &t2, NULL);
+ t1 = XtNewString(t1);
+ XtVaSetValues(w1, XtNstring, t2, NULL);
+ XtVaSetValues(w2, XtNstring, t1, NULL);
+ XtFree(t1);
+}
+
+
+/* ModulePath */
+/* Don't need to set the update tree field, as it is already set
+ * as the destroy field */
+static void
+CreateModulePath(TreeNode *modulepath, char *path)
+{
+ TreeNode *prev = NULL, *node;
+ Widget w;
+
+ if (path == NULL) {
+ if (XF86Module_path) {
+ path = XtNewString(XF86Module_path);
+ if (XF86Config->conf_files && XF86Config->conf_files->file_modulepath) {
+ XtFree(XF86Config->conf_files->file_modulepath);
+ XF86Config->conf_files->file_modulepath = XtNewString(path);
+ }
+ }
+ else if (XF86Config->conf_files && XF86Config->conf_files->file_modulepath)
+ path = XtNewString(XF86Config->conf_files->file_modulepath);
+ }
+ else {
+ path = XtNewString(path);
+ if ((prev = modulepath->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+ }
+
+ if (path) {
+ char *s;
+
+ for (s = strtok(path, ","); s != NULL; s = strtok(NULL, ",")) {
+ node = NewNode(modulepath, NULL, NULL, modulepath->node, NULL);
+ node->destroy = ModulePathChanged;
+ w = CreateModulePathField(node, s, False);
+ if (modulepath->child == NULL)
+ modulepath->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ }
+ XtFree(path);
+ }
+
+ node = NewNode(modulepath, NULL, NULL, modulepath->node, NULL);
+ w = CreateModulePathField(node, "", True);
+ if (modulepath->child == NULL)
+ modulepath->child = node;
+ else
+ prev->next = node;
+}
+
+static Widget
+CreateModulePathField(TreeNode *modulepath, char *value, Bool addnew)
+{
+ Widget box, command, text;
+ TreeData *data;
+
+ box = XtVaCreateWidget("modulepath", formWidgetClass, tree,
+ XtNtreeParent, modulepath->treeParent, NULL, 0);
+ modulepath->node = box;
+ if (!addnew) {
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback,
+ (XtPointer)modulepath);
+ text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, value, NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
+ XtAddCallback(command, XtNcallback, NewModulePathCallback,
+ (XtPointer)modulepath);
+ text = XtVaCreateManagedWidget("valueNew", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, value, NULL, 0);
+ }
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->files.text = text;
+ modulepath->data = data;
+
+ if (modulepath->treeParent && XtIsRealized(modulepath->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+
+ return (box);
+}
+
+static void
+ModulePathChanged(TreeNode *node)
+{
+ TreeNode *parent = node->parent;
+ char *modulepath = NULL, *str;
+ Arg args[1];
+ int pos = 0, len;
+
+ /* last node is the "new" */
+ for (node = parent->child; node->next != NULL; node = node->next) {
+ if (pos)
+ modulepath[pos++] = ',';
+ XtSetArg(args[0], XtNstring, &str);
+ XtGetValues(node->data->files.text, args, 1);
+ len = strlen(str) + 2;
+ modulepath = XtRealloc(modulepath, pos + len);
+ strcpy(modulepath + pos, str);
+ pos += len - 2;
+ }
+
+ if (XF86Config->conf_files->file_modulepath)
+ XtFree(XF86Config->conf_files->file_modulepath);
+ XF86Config->conf_files->file_modulepath = modulepath;
+}
+
+static void
+NewModulePathCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *modulepath, *node = (TreeNode*)user_data;
+ Arg args[1];
+ char *str;
+
+ XtSetArg(args[0], XtNstring, &str);
+ XtGetValues(node->data->files.text, args, 1);
+ if (*str == '\0')
+ return;
+
+ modulepath = node->parent;
+ DeleteNode(node);
+ CreateModulePath(modulepath, str);
+
+ ModulePathChanged(modulepath->child);
+ RelayoutTree();
+}
+
+/* Module */
+static void
+CreateModule(TreeNode *module, XF86LoadPtr load)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = module->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (load) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->module.load = load;
+ node = NewNode(module, NULL, NULL, module->node, data);
+ node->destroy = ModuleDestroy;
+ CreateModuleField(node, False);
+ if (module->child == NULL)
+ module->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ load = (XF86LoadPtr)(load->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(module, NULL, NULL, module->node, data);
+ CreateModuleField(node, True);
+ if (module->child == NULL)
+ module->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateModuleField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("module", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ XF86OptionPtr *options;
+ XF86LoadPtr load = node->data->module.load;
+
+ options = &(load->load_opt);
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, load->load_name, NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewModuleCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ node->data->module.text = label;
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGUSED*/
+static void
+ModuleDestroy(TreeNode *node)
+{
+ if (node->data->module.load)
+ xf86removeModule(XF86Config, node->data->module.load);
+}
+
+/*ARGSUSED*/
+static void
+NewModuleCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *module, *node = (TreeNode*)user_data;
+ XF86LoadPtr load;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->module.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ module = node->parent;
+ DeleteNode(node);
+ load = (XF86LoadPtr)XtCalloc(1, sizeof(XF86LoadRec));
+ load->load_name = XtNewString(label);
+ XF86Config->conf_modules->mod_load_lst =
+ xf86addModule(XF86Config->conf_modules->mod_load_lst, load);
+
+ CreateModule(module, load);
+ RelayoutTree();
+}
+
+/* Modes */
+static void
+CreateModes(TreeNode *parent, XF86ConfModesPtr modes)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (modes) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->modes.modes = modes;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = ModesDestroy;
+ CreateModesField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+
+ modes = (XF86ConfModesPtr)(modes->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateModesField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateModesField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("modes", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ XF86ConfModesPtr modes = node->data->modes.modes;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("mode", toggleWidgetClass, box,
+ XtNlabel, modes->modes_identifier,
+ XtNstate, True,
+ NULL, 0);
+ node->toggle = label;
+ XtAddCallback(label, XtNcallback, ToggleCallback, (XtPointer)node);
+ CreateModesModeLine(node, node->data->modes.modes->mon_modeline_lst);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewModesCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ node->data->modes.text = label;
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGUSED*/
+static void
+ModesDestroy(TreeNode *node)
+{
+ if (node->data->modes.modes) {
+ int i;
+ TreeNode *mon = monitorTree->child;
+
+ /* last one is the "new" entry */
+ while (mon && mon->next) {
+ /* UseModes is the second entry */
+ TreeNode *mod = mon->child->next->child;
+ CompositeWidget composite;
+
+ while (mod && mod->next) {
+ TreeNode *next = mod->next;
+
+ if (mod && strcmp(mod->data->modeslink.modeslink->ml_modes_str,
+ node->data->modes.modes->modes_identifier) == 0)
+ /* Needs to do string comparison because may be deleting
+ * a "test" Modes section, with no Modelines.
+ */
+ DeleteNode(mod);
+ mod = next;
+ }
+ composite = (CompositeWidget)mod->data->modeslink.menu;
+
+ for (i = 0; i < composite->composite.num_children; ++i)
+ if (strcmp(XtName(composite->composite.children[i]),
+ node->data->modes.modes->modes_identifier) == 0)
+ XtDestroyWidget(composite->composite.children[i]);
+
+ mon = mon->next;
+ }
+
+ xf86removeModes(XF86Config, node->data->modes.modes);
+ }
+}
+
+/*ARGSUSED*/
+static void
+NewModesCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfModesPtr modes;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->modes.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ modes = (XF86ConfModesPtr)XtCalloc(1, sizeof(XF86ConfModesRec));
+ modes->modes_identifier = XtNewString(label);
+ XF86Config->conf_modes_lst =
+ xf86addModes(XF86Config->conf_modes_lst, modes);
+
+ {
+ TreeNode *mon = monitorTree->child;
+ Widget sme;
+
+ /* last one is the "new" entry */
+ while (mon && mon->next) {
+ /* UseModes is the second entry */
+ TreeNode *mod = mon->child->next->child;
+
+ while (mod && mod->next)
+ mod = mod->next;
+
+ sme = XtCreateManagedWidget(modes->modes_identifier,
+ smeBSBObjectClass,
+ mod->data->modeslink.menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, NewMonitorModesCallback,
+ (XtPointer)mod);
+
+ mon = mon->next;
+ }
+ }
+
+ CreateModes(parent, modes);
+ RelayoutTree();
+}
+
+static void
+CreateModesModeLine(TreeNode *parent, XF86ConfModeLinePtr modeline)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (modeline) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->modeline.modeline = modeline;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = ModesModeLineDestroy;
+ CreateModeLineField(node, False, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ modeline = (XF86ConfModeLinePtr)(modeline->list.next);
+ }
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ CreateModeLineField(node, True, False);
+}
+
+/* This function should allow creating modelines for the
+ Mode and Monitor section */
+static void
+CreateModeLineField(TreeNode *node, Bool addnew, Bool monitor)
+{
+ Widget box, command;
+ char buf[512], tmp[32];
+
+ box = XtVaCreateWidget("modeline", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ XF86ConfModeLinePtr mod = node->data->modeline.modeline;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass,
+ box, NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, mod->ml_identifier, NULL, 0);
+
+ XmuSnprintf(buf, sizeof(buf), "%g %d %d %d %d %d %d %d %d",
+ mod->ml_clock / 1000., mod->ml_hdisplay, mod->ml_hsyncstart,
+ mod->ml_hsyncend, mod->ml_htotal, mod->ml_vdisplay,
+ mod->ml_vsyncstart, mod->ml_vsyncend, mod->ml_vtotal);
+ if (mod->ml_flags & XF86CONF_INTERLACE)
+ strcat(buf, " interlace");
+ if (mod->ml_flags & XF86CONF_PHSYNC)
+ strcat(buf, " +hsync");
+ if (mod->ml_flags & XF86CONF_NHSYNC)
+ strcat(buf, " -hsync");
+ if (mod->ml_flags & XF86CONF_PVSYNC)
+ strcat(buf, " +vsync");
+ if (mod->ml_flags & XF86CONF_NVSYNC)
+ strcat(buf, " -vsync");
+ if (mod->ml_flags & XF86CONF_CSYNC)
+ strcat(buf, " composite");
+ if (mod->ml_flags & XF86CONF_PCSYNC)
+ strcat(buf, " +csync");
+ if (mod->ml_flags & XF86CONF_NCSYNC)
+ strcat(buf, " -csync");
+ if (mod->ml_flags & XF86CONF_DBLSCAN)
+ strcat(buf, " doublescan");
+ if (mod->ml_flags & XF86CONF_BCAST)
+ strcat(buf, " bcast");
+ if (mod->ml_flags & XF86CONF_HSKEW) {
+ XmuSnprintf(tmp, sizeof(tmp), " hskew %d", mod->ml_hskew);
+ strcat(buf, tmp);
+ }
+ if (mod->ml_flags & XF86CONF_VSCAN) {
+ XmuSnprintf(tmp, sizeof(tmp), " vscan %d", mod->ml_vscan);
+ strcat(buf, tmp);
+ }
+ if (mod->ml_flags & XF86CONF_CUSTOM)
+ strcat(buf, " custom");
+ node->data->modeline.value =
+ XtVaCreateManagedWidget("modeline", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+ }
+ else {
+ *buf = '\0';
+ command = XtCreateManagedWidget("new", commandWidgetClass,
+ box, NULL, 0);
+ XtAddCallback(command, XtNcallback, monitor ?
+ NewMonitorModeLineCallback : NewModesModeLineCallback,
+ (XtPointer)node);
+ node->data->modeline.text =
+ XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, NULL, 0);
+ node->data->modeline.value =
+ XtVaCreateManagedWidget("modelineNew", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, NULL, 0);
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGUSED*/
+static void
+ModesModeLineDestroy(TreeNode *node)
+{
+ if (node->data->modeline.modeline)
+ xf86removeModesModeLine(node->parent->data->modes.modes,
+ node->data->modeline.modeline);
+}
+
+/*ARGSUSED*/
+static void
+NewModesModeLineCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfModeLinePtr modeline;
+ Arg args[1];
+ char *ident, *value;
+
+ XtSetArg(args[0], XtNstring, &ident);
+ XtGetValues(node->data->modeline.text, args, 1);
+ XtSetArg(args[0], XtNstring, &value);
+ XtGetValues(node->data->modeline.value, args, 1);
+ if (*ident == '\0' || *value == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ modeline = ParseModeLine(ident, value);
+ parent->data->modes.modes->mon_modeline_lst =
+ xf86addModeLine(parent->data->modes.modes->mon_modeline_lst, modeline);
+
+ CreateModesModeLine(parent, modeline);
+ RelayoutTree();
+}
+
+static XF86ConfModeLinePtr
+ParseModeLine(char *identifier, char *modeline)
+{
+ XF86ConfModeLinePtr ml = (XF86ConfModeLinePtr)
+ XtCalloc(1, sizeof(XF86ConfModeLineRec));
+ char *s, *ptr = modeline;
+
+ /* Identifier */
+ ml->ml_identifier = XtNewString(identifier);
+
+ ml->ml_clock = (int)(strtod(ptr, &ptr) * 1000.0 + 0.5);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ ml->ml_hdisplay = strtol(ptr, &ptr, 10);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ ml->ml_hsyncstart = strtol(ptr, &ptr, 10);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ ml->ml_hsyncend = strtol(ptr, &ptr, 10);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ ml->ml_htotal = strtol(ptr, &ptr, 10);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ ml->ml_vdisplay = strtol(ptr, &ptr, 10);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ ml->ml_vsyncstart = strtol(ptr, &ptr, 10);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ ml->ml_vsyncend = strtol(ptr, &ptr, 10);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ ml->ml_vtotal = strtol(ptr, &ptr, 10);
+ while (*ptr && isspace(*ptr)) ++ptr;
+
+ s = ptr;
+ while (*s) {
+ *s = tolower(*s);
+ ++s;
+ }
+ s = ptr;
+
+ while (*ptr) {
+ while (*s && isspace(*s))
+ s++;
+ ptr = s;
+ while (*s && !isspace(*s))
+ s++;
+
+ if (s != ptr) {
+ Bool done = *s == '\0';
+
+ *s = '\0';
+ if (strcmp(ptr, "interlace") == 0)
+ ml->ml_flags |= XF86CONF_INTERLACE;
+ else if (strcmp(ptr, "+hsync") == 0)
+ ml->ml_flags |= XF86CONF_PHSYNC;
+ else if (strcmp(ptr, "-hsync") == 0)
+ ml->ml_flags |= XF86CONF_NHSYNC;
+ else if (strcmp(ptr, "+vsync") == 0)
+ ml->ml_flags |= XF86CONF_PVSYNC;
+ else if (strcmp(ptr, "-vsync") == 0)
+ ml->ml_flags |= XF86CONF_NVSYNC;
+ else if (strcmp(ptr, "composite") == 0)
+ ml->ml_flags |= XF86CONF_CSYNC;
+ else if (strcmp(ptr, "+csync") == 0)
+ ml->ml_flags |= XF86CONF_PCSYNC;
+ else if (strcmp(ptr, "-csync") == 0)
+ ml->ml_flags |= XF86CONF_NCSYNC;
+ else if (strcmp(ptr, "doublescan") == 0)
+ ml->ml_flags |= XF86CONF_DBLSCAN;
+ else if (strcmp(ptr, "bcast") == 0)
+ ml->ml_flags |= XF86CONF_BCAST;
+ else if (strcmp(ptr, "hskew") == 0) {
+ ++s;
+ while (*s && isspace(*s))
+ ++s;
+ ptr = s;
+ while (*s && !isspace(*s))
+ ++s;
+ if (ptr != s) {
+ ml->ml_hskew = strtol(ptr, &s, 10);
+ ml->ml_flags |= XF86CONF_HSKEW;
+ --s;
+ }
+ }
+ else if (strcmp(ptr, "vscan") == 0) {
+ ++s;
+ while (*s && isspace(*s))
+ ++s;
+ ptr = s;
+ while (*s && !isspace(*s))
+ ++s;
+ if (ptr != s) {
+ ml->ml_vscan = strtol(ptr, &s, 10);
+ ml->ml_flags |= XF86CONF_VSCAN;
+ --s;
+ }
+ }
+ else if (strcmp(ptr, "custom") == 0)
+ ml->ml_flags |= XF86CONF_CUSTOM;
+ ++s;
+ if (done)
+ break;
+ ptr = s;
+ }
+ }
+
+ return (ml);
+}
+
+/* VideoAdpator */
+static void
+CreateVideoAdaptor(TreeNode *parent, XF86ConfVideoAdaptorPtr video)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (video) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->video.video = video;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = VideoAdaptorDestroy;
+ node->update = VideoAdaptorUpdate;
+ CreateVideoAdaptorField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+
+ video = (XF86ConfVideoAdaptorPtr)(video->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateVideoAdaptorField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateVideoAdaptorField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("video", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ char *str;
+ TreeNode *port;
+ XF86ConfVideoAdaptorPtr video = node->data->video.video;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback,
+ (XtPointer)&(video->va_option_lst));
+ label = XtVaCreateManagedWidget("adaptor", labelWidgetClass, box,
+ XtNlabel, video->va_identifier,
+ NULL, 0);
+
+ XtCreateManagedWidget("vendorL", labelWidgetClass, box, NULL, 0);
+ str = video->va_vendor ? video->va_vendor : "";
+ node->data->video.vendor =
+ XtVaCreateManagedWidget("vendor", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("boardL", labelWidgetClass, box, NULL, 0);
+ str = video->va_board ? video->va_board : "";
+ node->data->video.board =
+ XtVaCreateManagedWidget("board", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("busidL", labelWidgetClass, box, NULL, 0);
+ str = video->va_busid ? video->va_busid : "";
+ node->data->video.busid =
+ XtVaCreateManagedWidget("busid", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("driverL", labelWidgetClass, box, NULL, 0);
+ str = video->va_driver ? video->va_driver : "";
+ node->data->video.driver =
+ XtVaCreateManagedWidget("driver", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ label = XtVaCreateManagedWidget("VideoPort", toggleWidgetClass, tree,
+ XtNstate, True,
+ XtNtreeParent, box,
+ NULL, 0);
+ port = NewNode(node, label, label, node->node, NULL);
+ node->child = port;
+ CreateVideoPort(port, video->va_port_lst);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewVideoAdaptorCallback,
+ (XtPointer)node);
+ label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ node->data->video.text = label;
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGUSED*/
+static void
+VideoAdaptorDestroy(TreeNode *node)
+{
+ if (node->data->video.video) {
+ int i;
+ TreeNode *scrn = screenTree->child;
+
+ /* last one is the "new" entry */
+ while (scrn && scrn->next) {
+ /* VideoAdator is the first entry */
+ TreeNode *ad = scrn->child->child;
+ CompositeWidget composite;
+
+ while (ad && ad->next) {
+ TreeNode *next = ad->next;
+
+ if (ad && strcmp(ad->data->adaptorlink.adaptorlink->al_adaptor_str,
+ node->data->video.video->va_identifier) == 0)
+ DeleteNode(ad);
+ ad = next;
+ }
+ composite = (CompositeWidget)ad->data->adaptorlink.menu;
+
+ for (i = 0; i < composite->composite.num_children; ++i)
+ if (strcmp(XtName(composite->composite.children[i]),
+ node->data->video.video->va_identifier) == 0)
+ XtDestroyWidget(composite->composite.children[i]);
+
+ scrn = scrn->next;
+ }
+
+ xf86removeVideoAdaptor(XF86Config, node->data->video.video);
+ }
+}
+
+/*ARGSUSED*/
+static void
+NewVideoAdaptorCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfVideoAdaptorPtr video;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->video.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ video = (XF86ConfVideoAdaptorPtr)
+ XtCalloc(1, sizeof(XF86ConfVideoAdaptorRec));
+ video->va_identifier = XtNewString(label);
+ XF86Config->conf_videoadaptor_lst =
+ xf86addVideoAdaptor(XF86Config->conf_videoadaptor_lst, video);
+
+ {
+ TreeNode *scrn = screenTree->child;
+ Widget sme;
+
+ /* last one is the "new" entry */
+ while (scrn && scrn->next) {
+ /* VideoAdaptor is the first entry */
+ TreeNode *ad = scrn->child->child;
+
+ while (ad && ad->next)
+ ad = ad->next;
+
+ sme = XtCreateManagedWidget(video->va_identifier,
+ smeBSBObjectClass,
+ ad->data->adaptorlink.menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, NewScreenAdaptorCallback,
+ (XtPointer)ad);
+
+ scrn = scrn->next;
+ }
+ }
+
+ CreateVideoAdaptor(parent, video);
+ RelayoutTree();
+}
+
+static void
+VideoAdaptorUpdate(TreeNode *node)
+{
+ char *str;
+
+ /* vendor */
+ XtVaGetValues(node->data->video.vendor, XtNstring, &str, NULL, 0);
+ XtFree(node->data->video.video->va_vendor);
+ if (*str)
+ node->data->video.video->va_vendor = XtNewString(str);
+ else
+ node->data->video.video->va_vendor = NULL;
+
+ /* board */
+ XtVaGetValues(node->data->video.board, XtNstring, &str, NULL, 0);
+ XtFree(node->data->video.video->va_board);
+ if (*str)
+ node->data->video.video->va_board = XtNewString(str);
+ else
+ node->data->video.video->va_board = NULL;
+
+ /* busid */
+ XtVaGetValues(node->data->video.busid, XtNstring, &str, NULL, 0);
+ XtFree(node->data->video.video->va_busid);
+ if (*str)
+ node->data->video.video->va_busid = XtNewString(str);
+ else
+ node->data->video.video->va_busid = NULL;
+
+ /* driver */
+ XtVaGetValues(node->data->video.driver, XtNstring, &str, NULL, 0);
+ XtFree(node->data->video.video->va_driver);
+ if (*str)
+ node->data->video.video->va_driver = XtNewString(str);
+ else
+ node->data->video.video->va_driver = NULL;
+}
+
+static void
+CreateVideoPort(TreeNode *parent, XF86ConfVideoPortPtr port)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (port) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->port.port = port;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = VideoPortDestroy;
+ CreateVideoPortField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ port = (XF86ConfVideoPortPtr)(port->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateVideoPortField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateVideoPortField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("port", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ XF86OptionPtr *options;
+ XF86ConfVideoPortPtr port = node->data->port.port;
+
+ options = &(port->vp_option_lst);
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, port->vp_identifier, NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewVideoPortCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ node->data->port.text = label;
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGUSED*/
+static void
+VideoPortDestroy(TreeNode *node)
+{
+ if (node->data->port.port)
+ xf86removeVideoPort(node->parent->parent->data->video.video,
+ node->data->port.port);
+}
+
+/*ARGSUSED*/
+static void
+NewVideoPortCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *video, *node = (TreeNode*)user_data;
+ XF86ConfVideoPortPtr port;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->port.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ video = node->parent->parent;
+ DeleteNode(node);
+ port = (XF86ConfVideoPortPtr)XtCalloc(1, sizeof(XF86ConfVideoPortRec));
+ port->vp_identifier = XtNewString(label);
+ video->data->video.video->va_port_lst =
+ xf86addVideoPort(video->data->video.video->va_port_lst, port);
+
+ CreateVideoPort(video, port);
+ RelayoutTree();
+}
+
+/* Monitor */
+static void
+CreateMonitor(TreeNode *parent, XF86ConfMonitorPtr mon)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (mon) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->monitor.monitor = mon;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = MonitorDestroy;
+ node->update = MonitorUpdate;
+ CreateMonitorField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ mon = (XF86ConfMonitorPtr)(mon->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateMonitorField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateMonitorField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("monitor", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ char *str, buf[256];
+ XF86OptionPtr *options;
+ XF86ConfMonitorPtr mon = node->data->monitor.monitor;
+ Widget useModes;
+ TreeNode *modeline, *modes, *prev;
+
+ options = &(mon->mon_option_lst);
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, mon->mon_identifier, NULL, 0);
+
+ XtCreateManagedWidget("vendorL", labelWidgetClass, box, NULL, 0);
+ str = mon->mon_vendor ? mon->mon_vendor : "";
+ node->data->monitor.vendor =
+ XtVaCreateManagedWidget("vendor", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("modelnameL", labelWidgetClass, box, NULL, 0);
+ str = mon->mon_modelname ? mon->mon_modelname : "";
+ node->data->monitor.model =
+ XtVaCreateManagedWidget("modelname", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("widthL", labelWidgetClass, box, NULL, 0);
+ if (mon->mon_width)
+ XmuSnprintf(buf, sizeof(buf), "%d", mon->mon_width);
+ else
+ *buf = '\0';
+ node->data->monitor.width =
+ XtVaCreateManagedWidget("width", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("heightL", labelWidgetClass, box, NULL, 0);
+ if (mon->mon_height)
+ XmuSnprintf(buf, sizeof(buf), "%d", mon->mon_height);
+ else
+ *buf = '\0';
+ node->data->monitor.height =
+ XtVaCreateManagedWidget("height", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("hsyncL", labelWidgetClass, box, NULL, 0);
+ if (mon->mon_n_hsync > 0)
+ parser_range_to_string(buf, &(mon->mon_hsync[0]),
+ mon->mon_n_hsync);
+ else
+ *buf = '\0';
+ node->data->monitor.hsync =
+ XtVaCreateManagedWidget("hsync", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("vrefreshL", labelWidgetClass, box, NULL, 0);
+ if (mon->mon_n_vrefresh > 0)
+ parser_range_to_string(buf, &(mon->mon_vrefresh[0]),
+ mon->mon_n_vrefresh);
+ else
+ *buf = '\0';
+ node->data->monitor.vrefresh =
+ XtVaCreateManagedWidget("vrefresh", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("gammaRedL", labelWidgetClass, box, NULL, 0);
+ if (mon->mon_gamma_red)
+ XmuSnprintf(buf, sizeof(buf), "%g", mon->mon_gamma_red);
+ else
+ *buf = '\0';
+ node->data->monitor.gammaRed =
+ XtVaCreateManagedWidget("gammaRed", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("gammaGreenL", labelWidgetClass, box, NULL, 0);
+ if (mon->mon_gamma_green)
+ XmuSnprintf(buf, sizeof(buf), "%g", mon->mon_gamma_green);
+ else
+ *buf = '\0';
+ node->data->monitor.gammaGreen =
+ XtVaCreateManagedWidget("gammaGreen", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("gammaBlueL", labelWidgetClass, box, NULL, 0);
+ if (mon->mon_gamma_blue)
+ XmuSnprintf(buf, sizeof(buf), "%g", mon->mon_gamma_blue);
+ else
+ *buf = '\0';
+ node->data->monitor.gammaBlue =
+ XtVaCreateManagedWidget("gammaBlue", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ if ((prev = node->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+ command = XtVaCreateManagedWidget("ModeLine", toggleWidgetClass, tree,
+ XtNstate, True,
+ XtNtreeParent, box, NULL, 0);
+ modeline = NewNode(node, command, command, node->node, NULL);
+ CreateMonitorModeLine(modeline,
+ node->data->monitor.monitor->mon_modeline_lst);
+ if (prev == NULL)
+ prev = node->child = modeline;
+ else {
+ prev->next = modeline;
+ prev = prev->next;
+ }
+
+ useModes = XtVaCreateManagedWidget("UseModes", toggleWidgetClass, tree,
+ XtNstate, True,
+ XtNtreeParent, box, NULL, 0);
+ prev->next = modes = NewNode(node, useModes, useModes, node->node, NULL);
+ CreateMonitorModes(modes,
+ node->data->monitor.monitor->mon_modes_sect_lst);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewMonitorCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ node->data->monitor.text = label;
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+static void
+MonitorDestroy(TreeNode *node)
+{
+ int i;
+ TreeNode *sc = screenTree;
+
+ for (i = 0; i < computer.num_devices; i++)
+ if ((XF86ConfMonitorPtr)(computer.devices[i]->config) ==
+ node->data->monitor.monitor) {
+ config = computer.devices[i]->widget;
+ RemoveDeviceCallback(NULL, NULL, NULL);
+ }
+
+ if (sc) {
+ TreeNode *prev;
+
+ sc = prev = sc->child;
+ while (sc->next) {
+ TreeNode *next = sc->next;
+
+ if (sc->data->screen.screen->scrn_monitor ==
+ node->data->monitor.monitor) {
+ XtDestroyWidget(sc->node);
+
+ if (sc->child)
+ DestroyTree(sc->child);
+ if (sc->data)
+ XtFree((XtPointer)sc->data);
+ XtFree((XtPointer)sc);
+
+ if (sc == screenTree->child)
+ sc = prev = next = screenTree->child = next;
+ else
+ prev->next = sc = next;
+ continue;
+ }
+ prev = sc;
+ sc = next;
+ }
+ }
+}
+
+static void
+NewMonitorCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfMonitorPtr mon;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->monitor.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ mon = (XF86ConfMonitorPtr)XtCalloc(1, sizeof(XF86ConfMonitorRec));
+ mon->mon_identifier = XtNewString(label);
+ XF86Config->conf_monitor_lst =
+ xf86addMonitor(XF86Config->conf_monitor_lst, mon);
+
+ CreateMonitor(parent, mon);
+
+ RelayoutTree();
+}
+
+static void
+MonitorUpdate(TreeNode *node)
+{
+ char *str;
+
+ /* vendor */
+ XtVaGetValues(node->data->monitor.vendor, XtNstring, &str, NULL, 0);
+ XtFree(node->data->monitor.monitor->mon_vendor);
+ if (*str)
+ node->data->monitor.monitor->mon_vendor = XtNewString(str);
+ else
+ node->data->monitor.monitor->mon_vendor = NULL;
+
+ /* model */
+ XtVaGetValues(node->data->monitor.model, XtNstring, &str, NULL, 0);
+ XtFree(node->data->monitor.monitor->mon_modelname);
+ if (*str)
+ node->data->monitor.monitor->mon_modelname = XtNewString(str);
+ else
+ node->data->monitor.monitor->mon_modelname = NULL;
+
+ /* width */
+ XtVaGetValues(node->data->monitor.width, XtNstring, &str, NULL, 0);
+ node->data->monitor.monitor->mon_width = strtoul(str, NULL, 0);
+
+ /* height */
+ XtVaGetValues(node->data->monitor.height, XtNstring, &str, NULL, 0);
+ node->data->monitor.monitor->mon_height = strtoul(str, NULL, 0);
+
+ /* hsync */
+ XtVaGetValues(node->data->monitor.hsync, XtNstring, &str, NULL, 0);
+ node->data->monitor.monitor->mon_n_hsync =
+ string_to_parser_range(str,
+ &(node->data->monitor.monitor->mon_hsync[0]),
+ CONF_MAX_HSYNC);
+
+ /* vrefresh */
+ XtVaGetValues(node->data->monitor.vrefresh, XtNstring, &str, NULL, 0);
+ node->data->monitor.monitor->mon_n_vrefresh =
+ string_to_parser_range(str,
+ &(node->data->monitor.monitor->mon_vrefresh[0]),
+ CONF_MAX_VREFRESH);
+
+ /* gammaRed */
+ XtVaGetValues(node->data->monitor.gammaRed, XtNstring, &str, NULL, 0);
+ node->data->monitor.monitor->mon_gamma_red = strtod(str, NULL);
+
+ /* gammaGreen */
+ XtVaGetValues(node->data->monitor.gammaGreen, XtNstring, &str, NULL, 0);
+ node->data->monitor.monitor->mon_gamma_green = strtod(str, NULL);
+
+ /* gammaBlue */
+ XtVaGetValues(node->data->monitor.gammaBlue, XtNstring, &str, NULL, 0);
+ node->data->monitor.monitor->mon_gamma_blue = strtod(str, NULL);
+}
+
+static void
+CreateMonitorModeLine(TreeNode *parent, XF86ConfModeLinePtr modeline)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (modeline) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->modeline.modeline = modeline;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = MonitorModeLineDestroy;
+ CreateModeLineField(node, False, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ modeline = (XF86ConfModeLinePtr)(modeline->list.next);
+ }
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ CreateModeLineField(node, True, True);
+}
+
+/*ARGUSED*/
+static void
+MonitorModeLineDestroy(TreeNode *node)
+{
+ if (node->data->modeline.modeline)
+ xf86removeMonitorModeLine(node->parent->parent->data->monitor.monitor,
+ node->data->modeline.modeline);
+}
+
+/*ARGSUSED*/
+static void
+NewMonitorModeLineCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfModeLinePtr modeline;
+ Arg args[1];
+ char *ident, *value;
+
+ XtSetArg(args[0], XtNstring, &ident);
+ XtGetValues(node->data->modeline.text, args, 1);
+ XtSetArg(args[0], XtNstring, &value);
+ XtGetValues(node->data->modeline.value, args, 1);
+ if (*ident == '\0' || *value == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ modeline = ParseModeLine(ident, value);
+ parent->parent->data->monitor.monitor->mon_modeline_lst =
+ xf86addModeLine(parent->parent->data->monitor.monitor->mon_modeline_lst,
+ modeline);
+
+ CreateMonitorModeLine(parent, modeline);
+ RelayoutTree();
+}
+
+static void
+CreateMonitorModes(TreeNode *parent, XF86ConfModesLinkPtr lnk)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (lnk) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->modeslink.modeslink = lnk;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = MonitorModesLinkDestroy;
+ CreateMonitorModesField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ lnk = (XF86ConfModesLinkPtr)(lnk->list.next);
+ }
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ CreateMonitorModesField(node, True);
+}
+
+static void
+CreateMonitorModesField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("modes", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ XF86ConfModesLinkPtr lnk = node->data->modeslink.modeslink;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("mode", labelWidgetClass, box,
+ XtNlabel, lnk->ml_modes_str, NULL, 0);
+ }
+ else {
+ Widget sme;
+ XF86ConfModesPtr ptr = XF86Config->conf_modes_lst;
+
+ command = XtVaCreateManagedWidget("new", menuButtonWidgetClass, box,
+ XtNmenuName, "modesMenu", NULL, 0);
+ node->data->modeslink.menu =
+ XtVaCreatePopupShell("modesMenu", simpleMenuWidgetClass, box,
+ XtNleftMargin, 1, XtNrightMargin, 1,
+ XtNtopMargin, 1, XtNbottomMargin, 1,
+ NULL, 0);
+ while (ptr) {
+ sme = XtCreateManagedWidget(ptr->modes_identifier, smeBSBObjectClass,
+ node->data->modeslink.menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, NewMonitorModesCallback,
+ (XtPointer)node);
+ ptr = (XF86ConfModesPtr)(ptr->list.next);
+ }
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGUSED*/
+static void
+MonitorModesLinkDestroy(TreeNode *node)
+{
+ if (node->data->modeslink.modeslink)
+ xf86removeMonitorModesLink(node->parent->parent->data->monitor.monitor,
+ node->data->modeslink.modeslink);
+}
+
+/*ARGSUSED*/
+static void
+NewMonitorModesCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfModesLinkPtr link;
+ char *ident = XtName(w);
+
+ parent = node->parent;
+ DeleteNode(node);
+ link = (XF86ConfModesLinkPtr)XtCalloc(1, sizeof(XF86ConfModesLinkRec));
+ link->ml_modes_str = XtNewString(ident);
+ parent->parent->data->monitor.monitor->mon_modes_sect_lst =
+ xf86addModesLink(parent->parent->data->monitor.monitor->mon_modes_sect_lst,
+ link);
+
+ CreateMonitorModes(parent, link);
+ RelayoutTree();
+}
+
+/* Device */
+static void
+CreateDevice(TreeNode *parent, XF86ConfDevicePtr dev)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (dev) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->device.device = dev;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = DeviceDestroy;
+ node->update = DeviceUpdate;
+ CreateDeviceField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ dev = (XF86ConfDevicePtr)(dev->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateDeviceField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateDeviceField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("device", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ int i, tmp, len;
+ char buf[1024], *str;
+ XF86OptionPtr *options;
+ XF86ConfDevicePtr dev = node->data->device.device;
+
+ options = &(dev->dev_option_lst);
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, dev->dev_identifier, NULL, 0);
+
+ XtCreateManagedWidget("vendorL", labelWidgetClass, box, NULL, 0);
+ str = dev->dev_vendor ? dev->dev_vendor : "";
+ node->data->device.vendor =
+ XtVaCreateManagedWidget("vendor", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("boardL", labelWidgetClass, box, NULL, 0);
+ str = dev->dev_board ? dev->dev_board : "";
+ node->data->device.board =
+ XtVaCreateManagedWidget("board", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("chipsetL", labelWidgetClass, box, NULL, 0);
+ str = dev->dev_chipset ? dev->dev_chipset : "";
+ node->data->device.chipset =
+ XtVaCreateManagedWidget("chipset", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("busidL", labelWidgetClass, box, NULL, 0);
+ str = dev->dev_busid ? dev->dev_busid : "";
+ node->data->device.busid =
+ XtVaCreateManagedWidget("busid", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("cardL", labelWidgetClass, box, NULL, 0);
+ str = dev->dev_card ? dev->dev_card : "";
+ node->data->device.card =
+ XtVaCreateManagedWidget("card", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("driverL", labelWidgetClass, box, NULL, 0);
+ str = dev->dev_driver ? dev->dev_driver : "";
+ node->data->device.driver =
+ XtVaCreateManagedWidget("driver", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("ramdacL", labelWidgetClass, box, NULL, 0);
+ str = dev->dev_ramdac ? dev->dev_ramdac : "";
+ node->data->device.ramdac =
+ XtVaCreateManagedWidget("ramdac", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("dacSpeedL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_dacSpeeds[0] > 0) {
+ for (i = len = 0; i < CONF_MAXDACSPEEDS &&
+ dev->dev_dacSpeeds[i] > 0; i++) {
+ tmp = XmuSnprintf(buf + len, sizeof(buf) - len, "%g ",
+ dev->dev_dacSpeeds[i] / 1000.);
+ len += tmp;
+ }
+ }
+ else
+ *buf = '\0';
+ node->data->device.dacSpeed =
+ XtVaCreateManagedWidget("dacSpeed", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("videoRamL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_videoram)
+ XmuSnprintf(buf, sizeof(buf), "%d", dev->dev_videoram);
+ else
+ *buf = '\0';
+ node->data->device.videoRam =
+ XtVaCreateManagedWidget("videoRam", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("textClockFreqL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_textclockfreq)
+ XmuSnprintf(buf, sizeof(buf), "%.1f",
+ (double)dev->dev_textclockfreq / 1000.0);
+ else
+ *buf = '\0';
+ node->data->device.textClockFreq =
+ XtVaCreateManagedWidget("textClockFreq", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("biosBaseL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_bios_base)
+ XmuSnprintf(buf, sizeof(buf), "0x%lx", dev->dev_bios_base);
+ else
+ *buf = '\0';
+ node->data->device.biosBase =
+ XtVaCreateManagedWidget("biosBase", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("memBaseL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_mem_base)
+ XmuSnprintf(buf, sizeof(buf), "0x%lx", dev->dev_mem_base);
+ else
+ *buf = '\0';
+ node->data->device.memBase =
+ XtVaCreateManagedWidget("memBase", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("ioBaseL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_io_base)
+ XmuSnprintf(buf, sizeof(buf), "0x%lx", dev->dev_io_base);
+ else
+ *buf = '\0';
+ node->data->device.ioBase =
+ XtVaCreateManagedWidget("ioBase", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("clockChipL", labelWidgetClass, box, NULL, 0);
+ str = dev->dev_clockchip ? dev->dev_clockchip : "";
+ node->data->device.clockChip =
+ XtVaCreateManagedWidget("clockChip", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ *buf = '\0';
+ for (i = len = 0; i < dev->dev_clocks; i++) {
+ tmp = XmuSnprintf(buf + len, sizeof(buf) - len, "%.1f ",
+ (double)dev->dev_clock[i] / 1000.0);
+ len += tmp;
+ }
+ XtCreateManagedWidget("devClockL", labelWidgetClass, box, NULL, 0);
+ node->data->device.devClock =
+ XtVaCreateManagedWidget("devClock", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("chipIdL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_chipid != -1)
+ XmuSnprintf(buf, sizeof(buf), "0x%x", dev->dev_chipid);
+ else
+ *buf = '\0';
+ node->data->device.chipId =
+ XtVaCreateManagedWidget("chipId", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("chipRevL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_chiprev != -1)
+ XmuSnprintf(buf, sizeof(buf), "0x%x", dev->dev_chiprev);
+ else
+ *buf = '\0';
+ node->data->device.chipRev =
+ XtVaCreateManagedWidget("chipRev", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("irqL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_irq != -1)
+ XmuSnprintf(buf, sizeof(buf), "%d", dev->dev_irq);
+ else
+ *buf = '\0';
+ node->data->device.irq =
+ XtVaCreateManagedWidget("irq", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("screenL", labelWidgetClass, box, NULL, 0);
+ if (dev->dev_screen > 0)
+ XmuSnprintf(buf, sizeof(buf), "%d", dev->dev_screen);
+ else
+ *buf = '\0';
+ node->data->device.screen =
+ XtVaCreateManagedWidget("screen", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewDeviceCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ node->data->device.text = label;
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+static void
+NewDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfDevicePtr dev;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->device.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ dev = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec));
+ dev->dev_identifier = XtNewString(label);
+ dev->dev_chipid = -1;
+ dev->dev_chiprev = -1;
+ dev->dev_irq = -1;
+
+ XF86Config->conf_device_lst =
+ xf86addDevice(XF86Config->conf_device_lst, dev);
+
+ CreateDevice(parent, dev);
+
+ RelayoutTree();
+}
+
+static void
+DeviceDestroy(TreeNode *node)
+{
+ int i;
+ TreeNode *sc = screenTree;
+
+ for (i = 0; i < computer.num_devices; i++)
+ if ((XF86ConfDevicePtr)(computer.devices[i]->config) ==
+ node->data->device.device) {
+ config = computer.devices[i]->widget;
+ RemoveDeviceCallback(NULL, NULL, NULL);
+ }
+
+ if (sc) {
+ TreeNode *prev;
+
+ sc = prev = sc->child;
+ while (sc->next) {
+ TreeNode *next = sc->next;
+
+ if (sc->data->screen.screen->scrn_monitor ==
+ node->data->monitor.monitor) {
+ XtDestroyWidget(sc->node);
+
+ if (sc->child)
+ DestroyTree(sc->child);
+ if (sc->data)
+ XtFree((XtPointer)sc->data);
+ XtFree((XtPointer)sc);
+
+ if (sc == screenTree->child)
+ sc = prev = next = screenTree->child = next;
+ else
+ prev->next = sc = next;
+ continue;
+ }
+ prev = sc;
+ sc = next;
+ }
+ }
+}
+
+static void
+DeviceUpdate(TreeNode *node)
+{
+ int i;
+ char *str, *tmp;
+
+ /* vendor */
+ XtVaGetValues(node->data->device.vendor, XtNstring, &str, NULL, 0);
+ XtFree(node->data->device.device->dev_vendor);
+ if (*str)
+ node->data->device.device->dev_vendor = XtNewString(str);
+ else
+ node->data->device.device->dev_vendor = NULL;
+
+ /* board */
+ XtVaGetValues(node->data->device.board, XtNstring, &str, NULL, 0);
+ XtFree(node->data->device.device->dev_board);
+ if (*str)
+ node->data->device.device->dev_board = XtNewString(str);
+ else
+ node->data->device.device->dev_board = NULL;
+
+ /* chipset */
+ XtVaGetValues(node->data->device.chipset, XtNstring, &str, NULL, 0);
+ XtFree(node->data->device.device->dev_chipset);
+ if (*str)
+ node->data->device.device->dev_chipset = XtNewString(str);
+ else
+ node->data->device.device->dev_chipset = NULL;
+
+ /* busid */
+ XtVaGetValues(node->data->device.busid, XtNstring, &str, NULL, 0);
+ XtFree(node->data->device.device->dev_busid);
+ if (*str)
+ node->data->device.device->dev_busid = XtNewString(str);
+ else
+ node->data->device.device->dev_busid = NULL;
+
+ /* card */
+ XtVaGetValues(node->data->device.card, XtNstring, &str, NULL, 0);
+ XtFree(node->data->device.device->dev_card);
+ if (*str)
+ node->data->device.device->dev_card = XtNewString(str);
+ else
+ node->data->device.device->dev_card = NULL;
+
+ /* driver */
+ XtVaGetValues(node->data->device.driver, XtNstring, &str, NULL, 0);
+ XtFree(node->data->device.device->dev_driver);
+ if (*str)
+ node->data->device.device->dev_driver = XtNewString(str);
+ else
+ node->data->device.device->dev_driver = NULL;
+
+ /* ramdac */
+ XtVaGetValues(node->data->device.ramdac, XtNstring, &str, NULL, 0);
+ XtFree(node->data->device.device->dev_ramdac);
+ if (*str)
+ node->data->device.device->dev_ramdac = XtNewString(str);
+ else
+ node->data->device.device->dev_ramdac = NULL;
+
+ /* dacSpeed */
+ tmp = NULL;
+ XtVaGetValues(node->data->device.dacSpeed, XtNstring, &str, NULL, 0);
+ for (i = 0; i < CONF_MAXDACSPEEDS && str != tmp; i++) {
+ if ((node->data->device.device->dev_dacSpeeds[i] =
+ (strtod(str, &tmp) * 1000. + .5)) == 0)
+ break;
+ str = tmp;
+ while (isspace(*str))
+ ++str;
+ }
+
+ /* videoRam */
+ XtVaGetValues(node->data->device.videoRam, XtNstring, &str, NULL, 0);
+ node->data->device.device->dev_videoram = strtoul(str, NULL, 0);
+
+ /* textClockFreq */
+ XtVaGetValues(node->data->device.textClockFreq, XtNstring, &str, NULL, 0);
+ node->data->device.device->dev_textclockfreq =
+ strtod(str, NULL) * 1000. + .5;
+
+ /* biosBase */
+ XtVaGetValues(node->data->device.biosBase, XtNstring, &str, NULL, 0);
+ node->data->device.device->dev_bios_base = strtoul(str, NULL, 0);
+
+ /* memBase */
+ XtVaGetValues(node->data->device.memBase, XtNstring, &str, NULL, 0);
+ node->data->device.device->dev_mem_base = strtoul(str, NULL, 0);
+
+ /* ioBase */
+ XtVaGetValues(node->data->device.ioBase, XtNstring, &str, NULL, 0);
+ node->data->device.device->dev_io_base = strtoul(str, NULL, 0);
+
+ /* clockChip */
+ XtVaGetValues(node->data->device.clockChip, XtNstring, &str, NULL, 0);
+ XtFree(node->data->device.device->dev_clockchip);
+ if (*str)
+ node->data->device.device->dev_clockchip = XtNewString(str);
+ else
+ node->data->device.device->dev_clockchip = NULL;
+
+ /* devSpeed */
+ tmp = NULL;
+ XtVaGetValues(node->data->device.devClock, XtNstring, &str, NULL, 0);
+ for (i = 0; i < CONF_MAXCLOCKS && str != tmp; i++) {
+ if ((node->data->device.device->dev_clock[i] =
+ (strtod(str, &tmp) * 1000. + .5)) == 0)
+ break;
+ str = tmp;
+ while (isspace(*str))
+ ++str;
+ }
+ node->data->device.device->dev_clocks = i;
+
+ /* chipId */
+ XtVaGetValues(node->data->device.chipId, XtNstring, &str, NULL, 0);
+ if (*str)
+ node->data->device.device->dev_chipid = strtoul(str, NULL, 0);
+ else
+ node->data->device.device->dev_chipid = -1;
+
+ /* chipRev */
+ XtVaGetValues(node->data->device.chipRev, XtNstring, &str, NULL, 0);
+ if (*str)
+ node->data->device.device->dev_chiprev = strtoul(str, NULL, 0);
+ else
+ node->data->device.device->dev_chiprev = -1;
+
+ /* irq */
+ XtVaGetValues(node->data->device.irq, XtNstring, &str, NULL, 0);
+ if (*str)
+ node->data->device.device->dev_irq = strtoul(str, NULL, 0);
+ else
+ node->data->device.device->dev_irq = -1;
+
+ /* screen */
+ XtVaGetValues(node->data->device.screen, XtNstring, &str, NULL, 0);
+ if (*str)
+ node->data->device.device->dev_screen = strtoul(str, NULL, 0);
+ else
+ node->data->device.device->dev_screen = -1;
+}
+
+/* Screen */
+static void
+CreateScreen(TreeNode *parent, XF86ConfScreenPtr scrn)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (scrn) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->screen.screen = scrn;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = ScreenDestroy;
+ node->update = ScreenUpdate;
+ CreateScreenField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ scrn = (XF86ConfScreenPtr)(scrn->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateScreenField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateScreenField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("screen", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ char buf[256], *str;
+ XF86OptionPtr *options;
+ TreeNode *adaptor, *display;
+ XF86ConfScreenPtr scrn = node->data->screen.screen;
+
+ options = &(scrn->scrn_option_lst);
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, scrn->scrn_identifier, NULL, 0);
+
+ XtCreateManagedWidget("defaultDepthL", labelWidgetClass, box, NULL, 0);
+ if (scrn->scrn_defaultdepth)
+ XmuSnprintf(buf, sizeof(buf), "%d", scrn->scrn_defaultdepth);
+ else
+ *buf = '\0';
+ node->data->screen.defaultDepth =
+ XtVaCreateManagedWidget("defaultDepth", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("defaultBppL", labelWidgetClass, box, NULL, 0);
+ if (scrn->scrn_defaultbpp)
+ XmuSnprintf(buf, sizeof(buf), "%d", scrn->scrn_defaultbpp);
+ else
+ *buf = '\0';
+ node->data->screen.defaultBpp =
+ XtVaCreateManagedWidget("defaultBpp", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("defaultFbBppL", labelWidgetClass, box, NULL, 0);
+ if (scrn->scrn_defaultfbbpp)
+ XmuSnprintf(buf, sizeof(buf), "%d", scrn->scrn_defaultfbbpp);
+ else
+ *buf = '\0';
+ node->data->screen.defaultFbBpp =
+ XtVaCreateManagedWidget("defaultFbBpp", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("monitorL", labelWidgetClass, box, NULL, 0);
+ str = scrn->scrn_monitor_str ? scrn->scrn_monitor_str : "";
+ node->data->screen.monitor =
+ XtVaCreateManagedWidget("monitor", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("deviceL", labelWidgetClass, box, NULL, 0);
+ str = scrn->scrn_device_str ? scrn->scrn_device_str : "";
+ node->data->screen.device =
+ XtVaCreateManagedWidget("device", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str,
+ NULL, 0);
+
+ command = XtVaCreateManagedWidget("videoAdaptor", toggleWidgetClass,
+ tree, XtNstate, True,
+ XtNtreeParent, box, NULL, 0);
+ adaptor = NewNode(node, command, command, node->node, NULL);
+ CreateScreenAdaptor(adaptor, scrn->scrn_adaptor_lst);
+ node->child = adaptor;
+
+ command = XtVaCreateManagedWidget("Display", toggleWidgetClass,
+ tree, XtNstate, True,
+ XtNtreeParent, box, NULL, 0);
+ display = NewNode(node, command, command, node->node, NULL);
+ CreateScreenDisplay(display, scrn->scrn_display_lst);
+ adaptor->next = display;
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewScreenCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ node->data->screen.text = label;
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+static void
+NewScreenCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfScreenPtr scrn;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->screen.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ scrn = (XF86ConfScreenPtr)XtCalloc(1, sizeof(XF86ConfScreenRec));
+ scrn->scrn_identifier = XtNewString(label);
+ XF86Config->conf_screen_lst =
+ xf86addScreen(XF86Config->conf_screen_lst, scrn);
+
+ {
+ TreeNode *lay = layoutTree->child;
+ Widget sme;
+
+ /* last one is the "new" entry */
+ while (lay && lay->next != NULL) {
+ /* Adjacency is the first entry */
+ TreeNode *adj = lay->child->child;
+
+ while (adj != NULL) {
+ sme = XtCreateManagedWidget(label, smeBSBObjectClass,
+ adj->data->adjacency.menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, adj->next != NULL ?
+ AdjacencyMenuCallback : NewAdjacencyCallback,
+ (XtPointer)adj);
+ adj = adj->next;
+ }
+ lay = lay->next;
+ }
+ }
+
+ CreateScreen(parent, scrn);
+
+ RelayoutTree();
+}
+
+static void
+ScreenDestroy(TreeNode *node)
+{
+ if (node->data->screen.screen) {
+ int i;
+ TreeNode *lay = layoutTree->child;
+
+ /* last one is the "new" entry */
+ while (lay && lay->next) {
+ /* Adjacency is the first entry */
+ TreeNode *adj = lay->child->child;
+ CompositeWidget composite;
+
+ while (adj) {
+ TreeNode *next = adj->next;
+
+ composite = (CompositeWidget)adj->data->adjacency.menu;
+
+ for (i = 0; i < composite->composite.num_children; ++i)
+ if (strcmp(XtName(composite->composite.children[i]),
+ node->data->screen.screen->scrn_identifier) == 0) {
+ XtDestroyWidget(composite->composite.children[i]);
+ break;
+ }
+
+ if (adj->data->adjacency.screen == node->data->screen.screen)
+ DeleteNode(adj);
+
+ adj = next;
+ }
+
+ lay = lay->next;
+ }
+
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == node->data->screen.screen) {
+ config = computer.screens[i]->widget;
+ RemoveDeviceCallback(NULL, NULL, NULL);
+ }
+
+ /* for the case of screens added and removed in the expert dialog */
+ xf86removeScreen(XF86Config, node->data->screen.screen);
+ }
+}
+
+static void
+ScreenUpdate(TreeNode *node)
+{
+ char *str;
+
+ /* defautDepth */
+ XtVaGetValues(node->data->screen.defaultDepth, XtNstring, &str, NULL, 0);
+ node->data->screen.screen->scrn_defaultdepth = strtoul(str, NULL, 0);
+
+ /* defautBpp */
+ XtVaGetValues(node->data->screen.defaultBpp, XtNstring, &str, NULL, 0);
+ node->data->screen.screen->scrn_defaultbpp = strtoul(str, NULL, 0);
+
+ /* defautFbBpp */
+ XtVaGetValues(node->data->screen.defaultFbBpp, XtNstring, &str, NULL, 0);
+ node->data->screen.screen->scrn_defaultfbbpp = strtoul(str, NULL, 0);
+
+
+ /* XXX Monitor and Device should be changed to a menu interface */
+ /* monitor */
+ XtVaGetValues(node->data->screen.monitor, XtNstring, &str, NULL, 0);
+ XtFree(node->data->screen.screen->scrn_monitor_str);
+ if (*str)
+ node->data->screen.screen->scrn_monitor_str = XtNewString(str);
+ else
+ node->data->screen.screen->scrn_monitor_str = NULL;
+
+ /* XXX Monitor and Device should be changed to a menu interface */
+ /* device */
+ XtVaGetValues(node->data->screen.device, XtNstring, &str, NULL, 0);
+ XtFree(node->data->screen.screen->scrn_device_str);
+ if (*str)
+ node->data->screen.screen->scrn_device_str = XtNewString(str);
+ else
+ node->data->screen.screen->scrn_device_str = NULL;
+}
+
+static void
+CreateScreenAdaptor(TreeNode *parent, XF86ConfAdaptorLinkPtr lnk)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (lnk) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->adaptorlink.adaptorlink = lnk;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = ScreenAdaptorDestroy;
+ CreateScreenAdaptorField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ lnk = (XF86ConfAdaptorLinkPtr)(lnk->list.next);
+ }
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ CreateScreenAdaptorField(node, True);
+}
+
+static void
+CreateScreenAdaptorField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("adaptor", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ XF86ConfAdaptorLinkPtr lnk = node->data->adaptorlink.adaptorlink;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, lnk->al_adaptor_str, NULL, 0);
+ }
+ else {
+ Widget sme;
+ XF86ConfVideoAdaptorPtr ptr = XF86Config->conf_videoadaptor_lst;
+
+ command = XtVaCreateManagedWidget("new", menuButtonWidgetClass, box,
+ XtNmenuName, "adaptorMenu", NULL, 0);
+ node->data->adaptorlink.menu =
+ XtVaCreatePopupShell("adaptorMenu", simpleMenuWidgetClass, box,
+ XtNleftMargin, 1, XtNrightMargin, 1,
+ XtNtopMargin, 1, XtNbottomMargin, 1,
+ NULL, 0);
+ while (ptr) {
+ sme = XtCreateManagedWidget(ptr->va_identifier, smeBSBObjectClass,
+ node->data->adaptorlink.menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, NewScreenAdaptorCallback,
+ (XtPointer)node);
+ ptr = (XF86ConfVideoAdaptorPtr)(ptr->list.next);
+ }
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGSUSED*/
+static void
+NewScreenAdaptorCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfAdaptorLinkPtr link;
+ char *ident = XtName(w);
+
+ parent = node->parent;
+ DeleteNode(node);
+ link = (XF86ConfAdaptorLinkPtr)XtCalloc(1, sizeof(XF86ConfAdaptorLinkRec));
+ link->al_adaptor_str = XtNewString(ident);
+ parent->parent->data->screen.screen->scrn_adaptor_lst =
+ xf86addScreenAdaptor(parent->parent->data->screen.screen->scrn_adaptor_lst,
+ link);
+
+ CreateScreenAdaptor(parent, link);
+ RelayoutTree();
+}
+
+/*ARGUSED*/
+static void
+ScreenAdaptorDestroy(TreeNode *node)
+{
+ if (node->data->adaptorlink.adaptorlink)
+ xf86removeScreenAdaptorLink(node->parent->parent->data->screen.screen,
+ node->data->adaptorlink.adaptorlink);
+}
+
+static void
+CreateScreenDisplay(TreeNode *parent, XF86ConfDisplayPtr dsp)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (dsp) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->display.display = dsp;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = ScreenDisplayDestroy;
+ node->update = ScreenDisplayUpdate;
+ CreateScreenDisplayField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ dsp = (XF86ConfDisplayPtr)(dsp->list.next);
+ }
+ node = NewNode(parent, NULL, NULL, parent->node, NULL);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ CreateScreenDisplayField(node, True);
+}
+
+static void
+CreateScreenDisplayField(TreeNode *node, Bool addnew)
+{
+ Widget box, command;
+
+ box = XtVaCreateWidget("display", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ char *str, buf[256];
+ XF86OptionPtr *options;
+ XF86ConfDisplayPtr dsp = node->data->display.display;
+ TreeNode *modes;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ options = &(dsp->disp_option_lst);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+
+ XtCreateManagedWidget("viewportL", labelWidgetClass, box, NULL, 0);
+ if (dsp->disp_frameX0 != 0 || dsp->disp_frameY0 != 0)
+ XmuSnprintf(buf, sizeof(buf), "%d %d", dsp->disp_frameX0, dsp->disp_frameY0);
+ else
+ *buf = '\0';
+ node->data->display.viewport =
+ XtVaCreateManagedWidget("viewport", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ XtCreateManagedWidget("virtualL", labelWidgetClass, box, NULL, 0);
+ if (dsp->disp_virtualX != 0 || dsp->disp_virtualY != 0)
+ XmuSnprintf(buf, sizeof(buf), "%d %d", dsp->disp_virtualX, dsp->disp_virtualY);
+ else
+ *buf = '\0';
+ node->data->display.c_virtual =
+ XtVaCreateManagedWidget("virtual", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ XtCreateManagedWidget("depthL", labelWidgetClass, box, NULL, 0);
+ if (dsp->disp_depth != 0)
+ XmuSnprintf(buf, sizeof(buf), "%d", dsp->disp_depth);
+ else
+ *buf = '\0';
+ node->data->display.depth =
+ XtVaCreateManagedWidget("depth", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ XtCreateManagedWidget("bppL", labelWidgetClass, box, NULL, 0);
+ if (dsp->disp_bpp != 0)
+ XmuSnprintf(buf, sizeof(buf), "%d", dsp->disp_bpp);
+ else
+ *buf = '\0';
+ node->data->display.bpp =
+ XtVaCreateManagedWidget("bpp", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ XtCreateManagedWidget("visualL", labelWidgetClass, box, NULL, 0);
+ str = dsp->disp_visual != NULL ? dsp->disp_visual : "";
+ node->data->display.visual =
+ XtVaCreateManagedWidget("visual", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str, NULL, 0);
+
+ XtCreateManagedWidget("weightL", labelWidgetClass, box, NULL, 0);
+ if (dsp->disp_weight.red > 0)
+ XmuSnprintf(buf, sizeof(buf), "%d %d %d",
+ dsp->disp_weight.red, dsp->disp_weight.green, dsp->disp_weight.blue);
+ else
+ *buf = '\0';
+ node->data->display.weight =
+ XtVaCreateManagedWidget("weight", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ XtCreateManagedWidget("blackL", labelWidgetClass, box, NULL, 0);
+ if (dsp->disp_black.red >= 0)
+ XmuSnprintf(buf, sizeof(buf), "0x%04x 0x%04x 0x%04x",
+ dsp->disp_black.red, dsp->disp_black.green, dsp->disp_black.blue);
+ else
+ *buf = '\0';
+ node->data->display.black =
+ XtVaCreateManagedWidget("black", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ XtCreateManagedWidget("whiteL", labelWidgetClass, box, NULL, 0);
+ if (dsp->disp_white.red >= 0)
+ XmuSnprintf(buf, sizeof(buf), "0x%04x 0x%04x 0x%04x",
+ dsp->disp_white.red, dsp->disp_white.green, dsp->disp_white.blue);
+ else
+ *buf = '\0';
+ node->data->display.white =
+ XtVaCreateManagedWidget("white", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ command = XtVaCreateManagedWidget("Modes", toggleWidgetClass, tree,
+ XtNstate, True, XtNtreeParent, box,
+ NULL, 0);
+ modes = NewNode(node, command, command, node->node, NULL);
+ node->child = modes;
+ CreateDisplayMode(modes, dsp->disp_mode_lst);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
+ XtAddCallback(command, XtNcallback, NewScreenDisplayCallback,
+ (XtPointer)node);
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGSUSED*/
+static void
+NewScreenDisplayCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfDisplayPtr dsp;
+
+ parent = node->parent;
+ DeleteNode(node);
+ dsp = (XF86ConfDisplayPtr)XtCalloc(1, sizeof(XF86ConfDisplayRec));
+ dsp->disp_black.red = dsp->disp_black.green = dsp->disp_black.blue =
+ dsp->disp_white.red = dsp->disp_white.green = dsp->disp_white.blue = -1;
+ parent->parent->data->screen.screen->scrn_display_lst =
+ xf86addScreenDisplay(parent->parent->data->screen.screen->scrn_display_lst,
+ dsp);
+
+ CreateScreenDisplay(parent, dsp);
+ RelayoutTree();
+}
+
+static void
+ScreenDisplayDestroy(TreeNode *node)
+{
+ if (node->data->display.display)
+ xf86removeScreenDisplay(node->parent->parent->data->screen.screen,
+ node->data->display.display);
+}
+
+static void
+ScreenDisplayUpdate(TreeNode *node)
+{
+ char *str, *tmp;
+ int x, y;
+
+ /* viewport */
+ XtVaGetValues(node->data->display.viewport, XtNstring, &str, NULL, 0);
+ if (sscanf(str, "%d %d", &x, &y) == 2) {
+ node->data->display.display->disp_frameX0 = x;
+ node->data->display.display->disp_frameY0 = y;
+ }
+
+ /* virtual */
+ XtVaGetValues(node->data->display.c_virtual, XtNstring, &str, NULL, 0);
+ if (sscanf(str, "%d %d", &x, &y) == 2) {
+ node->data->display.display->disp_virtualX = x;
+ node->data->display.display->disp_virtualY = y;
+ }
+
+ /* depth */
+ XtVaGetValues(node->data->display.depth, XtNstring, &str, NULL, 0);
+ node->data->display.display->disp_depth = strtoul(str, NULL, 0);
+
+ /* bpp */
+ XtVaGetValues(node->data->display.bpp, XtNstring, &str, NULL, 0);
+ node->data->display.display->disp_bpp = strtoul(str, NULL, 0);
+
+ /* visual */
+ XtVaGetValues(node->data->display.visual, XtNstring, &str, NULL, 0);
+ XtFree(node->data->display.display->disp_visual);
+ if (*str)
+ node->data->display.display->disp_visual = XtNewString(str);
+ else
+ node->data->display.display->disp_visual = NULL;
+
+ /* weight */
+ XtVaGetValues(node->data->display.weight, XtNstring, &str, NULL, 0);
+ node->data->display.display->disp_weight.red = strtoul(str, &tmp, 0);
+ if (str == tmp)
+ node->data->display.display->disp_weight.red = 0;
+ else {
+ str = tmp;
+ while (isspace(*str))
+ ++str;
+ node->data->display.display->disp_weight.green = strtoul(str, &tmp, 0);
+ if (str != tmp) {
+ str = tmp;
+ while (isspace(*str))
+ ++str;
+ node->data->display.display->disp_weight.blue = strtoul(str, &tmp, 0);
+ }
+ }
+
+ /* black */
+ XtVaGetValues(node->data->display.black, XtNstring, &str, NULL, 0);
+ node->data->display.display->disp_black.red = strtoul(str, &tmp, 0);
+ if (str == tmp)
+ node->data->display.display->disp_black.red = -1;
+ else {
+ str = tmp;
+ while (isspace(*str))
+ ++str;
+ node->data->display.display->disp_black.green = strtoul(str, &tmp, 0);
+ if (str != tmp) {
+ str = tmp;
+ while (isspace(*str))
+ ++str;
+ node->data->display.display->disp_black.blue = strtoul(str, &tmp, 0);
+ }
+ }
+
+ /* white */
+ XtVaGetValues(node->data->display.white, XtNstring, &str, NULL, 0);
+ node->data->display.display->disp_white.red = strtoul(str, &tmp, 0);
+ if (str == tmp)
+ node->data->display.display->disp_white.red = -1;
+ else {
+ str = tmp;
+ while (isspace(*str))
+ ++str;
+ node->data->display.display->disp_white.green = strtoul(str, &tmp, 0);
+ if (str != tmp) {
+ str = tmp;
+ while (isspace(*str))
+ ++str;
+ node->data->display.display->disp_white.blue = strtoul(str, &tmp, 0);
+ }
+ }
+}
+
+static void
+CreateDisplayMode(TreeNode *parent, XF86ModePtr modes)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (modes) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->mode.mode = modes;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = DisplayModeDestroy;
+ CreateDisplayModeField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ modes = (XF86ModePtr)(modes->list.next);
+ }
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ CreateDisplayModeField(node, True);
+}
+
+static void
+CreateDisplayModeField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, text;
+
+ box = XtVaCreateWidget("mode", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+ if (!addnew) {
+ XF86ModePtr mode = node->data->mode.mode;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback,
+ (XtPointer)node);
+ text = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, mode->mode_name, NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
+ XtAddCallback(command, XtNcallback, NewDisplayModeCallback,
+ (XtPointer)node);
+ text = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, NULL, 0);
+ }
+ node->data->mode.text = text;
+ if (node->treeParent && XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGSUSED*/
+static void
+NewDisplayModeCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ModePtr mode;
+ Arg args[1];
+ char *ident;
+
+ XtSetArg(args[0], XtNstring, &ident);
+ XtGetValues(node->data->mode.text, args, 1);
+ if (*ident == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ mode = (XF86ModePtr)XtCalloc(1, sizeof(XF86ModeRec));
+ mode->mode_name = XtNewString(ident);
+ parent->parent->data->display.display->disp_mode_lst =
+ xf86addDisplayMode(parent->parent->data->display.display->disp_mode_lst,
+ mode);
+
+ CreateDisplayMode(parent, mode);
+ RelayoutTree();
+}
+
+/*ARGUSED*/
+static void
+DisplayModeDestroy(TreeNode *node)
+{
+ if (node->data->mode.mode)
+ xf86removeDisplayMode(node->parent->parent->data->display.display,
+ node->data->mode.mode);
+}
+
+/* Input */
+static void
+CreateInput(TreeNode *parent, XF86ConfInputPtr input)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (input) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->input.input = input;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = InputDestroy;
+ node->update = InputUpdate;
+ CreateInputField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateInputField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateInputField(TreeNode *node, Bool addnew)
+{
+ Widget box, command;
+
+ box = XtVaCreateWidget("input", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ char *str;
+ XF86OptionPtr *options;
+ XF86ConfInputPtr inp = node->data->input.input;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ options = &(inp->inp_option_lst);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, inp->inp_identifier, NULL, 0);
+
+ XtCreateManagedWidget("driverL", labelWidgetClass, box, NULL, 0);
+ str = inp->inp_driver != NULL ? inp->inp_driver : "";
+ node->data->input.text =
+ XtVaCreateManagedWidget("driver", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, str, NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box, NULL, 0);
+ XtAddCallback(command, XtNcallback, NewInputCallback,
+ (XtPointer)node);
+ node->data->input.text =
+ XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, NULL, 0);
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGSUSED*/
+static void
+NewInputCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfInputPtr input;
+ Arg args[1];
+ char *ident;
+
+ XtSetArg(args[0], XtNstring, &ident);
+ XtGetValues(node->data->input.text, args, 1);
+ if (*ident == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ input = (XF86ConfInputPtr)XtCalloc(1, sizeof(XF86ConfInputRec));
+ input->inp_identifier = XtNewString(ident);
+ XF86Config->conf_input_lst =
+ xf86addInput(XF86Config->conf_input_lst, input);
+
+ {
+ TreeNode *lay = layoutTree->child;
+ Widget sme;
+
+ /* last one is the "new" entry */
+ while (lay && lay->next != NULL) {
+ /* Inputref is the second entry */
+ TreeNode *iref = lay->child->next->child;
+
+ while (iref && iref->next)
+ iref = iref->next;
+ sme = XtCreateManagedWidget(ident, smeBSBObjectClass,
+ iref->data->inputref.menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, NewInputrefCallback,
+ (XtPointer)iref);
+ lay = lay->next;
+ }
+ }
+
+ CreateInput(parent, input);
+ RelayoutTree();
+}
+
+/*ARGUSED*/
+static void
+InputDestroy(TreeNode *node)
+{
+ if (node->data->input.input) {
+ int i;
+ TreeNode *lay = layoutTree->child;
+
+ /* last one is the "new" entry */
+ while (lay && lay->next) {
+ /* Inputref is the second entry */
+ TreeNode *iref = lay->child->next->child;
+ CompositeWidget composite;
+
+ while (iref && iref->next) {
+ TreeNode *next = iref->next;
+
+ if (iref && strcmp(iref->data->inputref.inputref->iref_inputdev_str,
+ node->data->input.input->inp_identifier) == 0)
+ DeleteNode(iref);
+ iref = next;
+ }
+
+ composite = (CompositeWidget)iref->data->inputref.menu;
+
+ for (i = 0; i < composite->composite.num_children; ++i)
+ if (strcmp(XtName(composite->composite.children[i]),
+ node->data->input.input->inp_identifier) == 0)
+ XtDestroyWidget(composite->composite.children[i]);
+
+ lay = lay->next;
+ }
+
+ for (i = 0; i < computer.num_devices; i++)
+ if ((XF86ConfInputPtr)(computer.devices[i]->config) ==
+ node->data->input.input) {
+ config = computer.devices[i]->widget;
+ RemoveDeviceCallback(NULL, NULL, NULL);
+ }
+ }
+}
+
+static void
+InputUpdate(TreeNode *node)
+{
+ char *str;
+
+ /* vendor */
+ XtVaGetValues(node->data->input.text, XtNstring, &str, NULL, 0);
+ XtFree(node->data->input.input->inp_driver);
+ if (*str)
+ node->data->input.input->inp_driver = XtNewString(str);
+ else
+ node->data->input.input->inp_driver = NULL;
+}
+
+/* Layout */
+static void
+CreateLayout(TreeNode *parent, XF86ConfLayoutPtr lay)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (lay) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->layout.layout = lay;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = LayoutDestroy;
+ CreateLayoutField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateLayoutField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateLayoutField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label;
+
+ box = XtVaCreateWidget("layout", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ TreeNode *adjacency, *inputref;
+ XF86OptionPtr *options;
+ XF86ConfLayoutPtr lay = node->data->layout.layout;
+
+ options = &(lay->lay_option_lst);
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, lay->lay_identifier, NULL, 0);
+
+ command = XtVaCreateManagedWidget("Adjacency", toggleWidgetClass, tree,
+ XtNstate, True, XtNtreeParent, box,
+ NULL, 0);
+ adjacency = NewNode(node, command, command, box, NULL);
+ node->child = adjacency;
+ CreateAdjacency(adjacency, lay->lay_adjacency_lst);
+
+ command = XtVaCreateManagedWidget("Inputref", toggleWidgetClass, tree,
+ XtNstate, True, XtNtreeParent, box,
+ NULL, 0);
+ inputref = NewNode(node, command, command, box, NULL);
+ adjacency->next = inputref;
+ CreateInputref(inputref, lay->lay_input_lst);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewLayoutCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ node->data->layout.text = label;
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGUSED*/
+static void
+LayoutDestroy(TreeNode *node)
+{
+ if (node->data->layout.layout)
+ xf86removeLayout(XF86Config, node->data->layout.layout);
+}
+
+/*ARGSUSED*/
+static void
+NewLayoutCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfLayoutPtr lay;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->layout.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ lay = (XF86ConfLayoutPtr)XtCalloc(1, sizeof(XF86ConfLayoutRec));
+ lay->lay_identifier = XtNewString(label);
+ XF86Config->conf_layout_lst = xf86addLayout(XF86Config->conf_layout_lst, lay);
+
+ CreateLayout(parent, lay);
+ RelayoutTree();
+}
+
+static void
+CreateAdjacency(TreeNode *parent, XF86ConfAdjacencyPtr adj)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (adj) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->adjacency.screen = adj ? adj->adj_screen : NULL;
+ data->adjacency.adjacency = adj;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = AdjacencyDestroy;
+ CreateAdjacencyField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateAdjacencyField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateAdjacencyField(TreeNode *node, Bool addnew)
+{
+ Widget box, command, label, sme;
+ XF86ConfScreenPtr ptr = XF86Config->conf_screen_lst;
+
+ box = XtVaCreateWidget("adjacency", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ node->data->adjacency.menu =
+ XtVaCreatePopupShell("screenMenu", simpleMenuWidgetClass, box,
+ XtNleftMargin, 1, XtNrightMargin, 1,
+ XtNtopMargin, 1, XtNbottomMargin, 1,
+ NULL, 0);
+ while (ptr) {
+ sme = XtCreateManagedWidget(ptr->scrn_identifier, smeBSBObjectClass,
+ node->data->adjacency.menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, !addnew ?
+ AdjacencyMenuCallback : NewAdjacencyCallback,
+ (XtPointer)node);
+ ptr = (XF86ConfScreenPtr)(ptr->list.next);
+ }
+
+ if (!addnew) {
+ char buf[32];
+ Cardinal width, height;
+ Widget left, right, above, below, relative, absolute;
+ XF86ConfAdjacencyPtr adj = node->data->adjacency.adjacency;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ label = XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, adj->adj_screen->scrn_identifier,
+ NULL, 0);
+
+ XtCreateManagedWidget("scrnumL", labelWidgetClass, box, NULL, 0);
+ if (adj->adj_scrnum >= 0)
+ XmuSnprintf(buf, sizeof(buf), "%d", adj->adj_scrnum);
+ else
+ *buf = 0;
+ node->data->adjacency.scrnum =
+ XtVaCreateManagedWidget("scrnum", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+ above = XtVaCreateManagedWidget("above", toggleWidgetClass, box,
+ XtNstate, adj->adj_where == CONF_ADJ_ABOVE ?
+ True : False, NULL, 0);
+ XtAddCallback(above, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
+ left = XtVaCreateManagedWidget("leftOf", toggleWidgetClass, box,
+ XtNradioGroup, above,
+ XtNstate, adj->adj_where == CONF_ADJ_LEFTOF ?
+ True : False, NULL, 0);
+ XtAddCallback(left, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
+
+ node->data->adjacency.button =
+ XtVaCreateManagedWidget("screen", menuButtonWidgetClass, box,
+ XtNmenuName, "screenMenu", NULL, 0);
+
+ right = XtVaCreateManagedWidget("rightOf", toggleWidgetClass, box,
+ XtNradioGroup, left,
+ XtNstate, adj->adj_where == CONF_ADJ_RIGHTOF ?
+ True : False, NULL, 0);
+ XtAddCallback(right, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
+ below = XtVaCreateManagedWidget("below", toggleWidgetClass, box,
+ XtNradioGroup, right,
+ XtNstate, adj->adj_where == CONF_ADJ_BELOW ?
+ True : False, NULL, 0);
+ XtAddCallback(below, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
+ relative = XtVaCreateManagedWidget("relative", toggleWidgetClass, box,
+ XtNradioGroup, below,
+ XtNstate, adj->adj_where == CONF_ADJ_RELATIVE ?
+ True : False, NULL, 0);
+ XtAddCallback(relative, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
+ absolute = XtVaCreateManagedWidget("absolute", toggleWidgetClass, box,
+ XtNradioGroup, relative,
+ XtNstate, adj->adj_where == CONF_ADJ_ABSOLUTE ?
+ True : False, NULL, 0);
+ XtAddCallback(absolute, XtNcallback, AdjacencyToggleCallback, (XtPointer)node);
+
+ XtCreateManagedWidget("adjxL", labelWidgetClass, box, NULL, 0);
+ XmuSnprintf(buf, sizeof(buf), "%d", adj->adj_x);
+ node->data->adjacency.adjx =
+ XtVaCreateManagedWidget("adjx", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ XtCreateManagedWidget("adjyL", labelWidgetClass, box, NULL, 0);
+ XmuSnprintf(buf, sizeof(buf), "%d", adj->adj_y);
+ node->data->adjacency.adjy =
+ XtVaCreateManagedWidget("adjy", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit,
+ XtNstring, buf, NULL, 0);
+
+ XtVaGetValues(node->data->adjacency.button, XtNwidth, &width,
+ XtNheight, &height, NULL, 0);
+ if (adj->adj_where > CONF_ADJ_ABSOLUTE &&
+ adj->adj_where <= CONF_ADJ_RELATIVE)
+ XtVaSetValues(node->data->adjacency.button, XtNlabel,
+ adj->adj_refscreen, XtNwidth, width,
+ XtNheight, height, NULL, 0);
+ else
+ XtVaSetValues(node->data->adjacency.button, XtNlabel, "",
+ XtNwidth, width, XtNheight, height, NULL, 0);
+ }
+ else
+ XtVaCreateManagedWidget("new", menuButtonWidgetClass, box,
+ XtNmenuName, "screenMenu", NULL, 0);
+
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+static void
+AdjacencyDestroy(TreeNode *node)
+{
+ if (node->data->adjacency.adjacency)
+ xf86removeAdjacency(node->parent->parent->data->layout.layout,
+ node->data->adjacency.adjacency);
+}
+
+/*ARGSUSED*/
+static void
+NewAdjacencyCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfAdjacencyPtr adj;
+ char *ident = XtName(w);
+
+ parent = node->parent;
+ DeleteNode(node);
+ adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
+ adj->adj_screen = xf86findScreen(ident, XF86Config->conf_screen_lst);
+ if (adj->adj_screen)
+ adj->adj_screen_str = XtNewString(adj->adj_screen->scrn_identifier);
+ parent->parent->data->layout.layout->lay_adjacency_lst =
+ xf86addAdjacency(parent->parent->data->layout.layout->lay_adjacency_lst,
+ adj);
+
+ CreateAdjacency(parent, adj);
+ RelayoutTree();
+}
+
+/*ARGUSED*/
+static void
+AdjacencyMenuCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *node = (TreeNode*)user_data;
+ XF86ConfAdjacencyPtr adj = node->data->adjacency.adjacency;
+
+ XtFree(adj->adj_refscreen);
+ adj->adj_refscreen = XtNewString(XtName(w));
+ XtVaSetValues(node->data->adjacency.button, XtNlabel, XtName(w), NULL, 0);
+}
+
+static void
+AdjacencyToggleCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *node = (TreeNode*)user_data;
+ XF86ConfAdjacencyPtr adj = node->data->adjacency.adjacency;
+ char *x, *y;
+
+ if ((Bool)(long)call_data == False)
+ return;
+
+ XtVaGetValues(node->data->adjacency.adjx, XtNstring, &x, NULL, 0);
+ XtVaGetValues(node->data->adjacency.adjy, XtNstring, &y, NULL, 0);
+
+ adj->adj_x = strtol(x, NULL, 0);
+ adj->adj_y = strtol(y, NULL, 0);
+
+ if (strcmp(XtName(w), "absolute") == 0) {
+ XtVaSetValues(node->data->adjacency.button, XtNlabel, "", NULL, 0);
+ adj->adj_where = CONF_ADJ_ABSOLUTE;
+ return;
+ }
+ if (strcmp(XtName(w), "relative") == 0)
+ adj->adj_where = CONF_ADJ_RELATIVE;
+ else if (strcmp(XtName(w), "leftOf") == 0)
+ adj->adj_where = CONF_ADJ_LEFTOF;
+ else if (strcmp(XtName(w), "rightOf") == 0)
+ adj->adj_where = CONF_ADJ_RIGHTOF;
+ else if (strcmp(XtName(w), "above") == 0)
+ adj->adj_where = CONF_ADJ_ABOVE;
+ else if (strcmp(XtName(w), "below") == 0)
+ adj->adj_where = CONF_ADJ_BELOW;
+}
+
+/* Inputref */
+static void
+CreateInputref(TreeNode *parent, XF86ConfInputrefPtr input)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (input) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->inputref.inputref = input;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = InputrefDestroy;
+ CreateInputrefField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ input = (XF86ConfInputrefPtr)(input->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateInputrefField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateInputrefField(TreeNode *node, Bool addnew)
+{
+ Widget box, command;
+
+ box = XtVaCreateWidget("inputref", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ XF86OptionPtr *options;
+ XF86ConfInputrefPtr inp = node->data->inputref.inputref;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ options = &(inp->iref_option_lst);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, inp->iref_inputdev_str, NULL, 0);
+ }
+ else {
+ Widget sme;
+ XF86ConfInputPtr ptr = XF86Config->conf_input_lst;
+
+ XtVaCreateManagedWidget("new", menuButtonWidgetClass, box,
+ XtNmenuName, "inputMenu", NULL, 0);
+ node->data->inputref.menu =
+ XtVaCreatePopupShell("inputMenu", simpleMenuWidgetClass, box,
+ XtNleftMargin, 1, XtNrightMargin, 1,
+ XtNtopMargin, 1, XtNbottomMargin, 1,
+ NULL, 0);
+
+ while (ptr) {
+ sme = XtCreateManagedWidget(ptr->inp_identifier, smeBSBObjectClass,
+ node->data->inputref.menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, NewInputrefCallback,
+ (XtPointer)node);
+ ptr = (XF86ConfInputPtr)(ptr->list.next);
+ }
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGSUSED*/
+static void
+NewInputrefCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfInputrefPtr input;
+ char *ident = XtName(w);
+
+ parent = node->parent;
+ DeleteNode(node);
+ input = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec));
+ input->iref_inputdev_str = XtNewString(ident);
+ parent->parent->data->layout.layout->lay_input_lst =
+ xf86addInputref(parent->parent->data->layout.layout->lay_input_lst, input);
+
+ CreateInputref(parent, input);
+ RelayoutTree();
+}
+
+/*ARGUSED*/
+static void
+InputrefDestroy(TreeNode *node)
+{
+ if (node->data->inputref.inputref)
+ xf86removeInputRef(node->parent->parent->data->layout.layout, node->data->inputref.inputref->iref_inputdev);
+}
+
+/* Vendor */
+static void
+CreateVendor(TreeNode *parent, XF86ConfVendorPtr vendor)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (vendor) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->vendor.vendor = vendor;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = VendorDestroy;
+ CreateVendorField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ vendor = (XF86ConfVendorPtr)(vendor->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateVendorField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateVendorField(TreeNode *node, Bool addnew)
+{
+ Widget box, command;
+
+ box = XtVaCreateWidget("vendor", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ TreeNode *sub;
+ XF86OptionPtr *options;
+ XF86ConfVendorPtr vendor = node->data->vendor.vendor;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ options = &(vendor->vnd_option_lst);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, vendor->vnd_identifier, NULL, 0);
+
+ command = XtVaCreateManagedWidget("VendSub", toggleWidgetClass, tree,
+ XtNstate, True,
+ XtNtreeParent, box,
+ NULL, 0);
+ sub = NewNode(node, command, command, box, NULL);
+ node->child = sub;
+ CreateVendorSub(sub, vendor->vnd_sub_lst);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewVendorCallback, (XtPointer)node);
+ node->data->vendor.text =
+ XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, NULL, 0);
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+static void
+VendorDestroy(TreeNode *node)
+{
+ if (node->data->vendor.vendor)
+ xf86removeVendor(XF86Config, node->data->vendor.vendor);
+}
+
+static void
+NewVendorCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfVendorPtr vnd;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->vendor.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ vnd = (XF86ConfVendorPtr)XtCalloc(1, sizeof(XF86ConfVendorRec));
+ vnd->vnd_identifier = XtNewString(label);
+ XF86Config->conf_vendor_lst = xf86addVendor(XF86Config->conf_vendor_lst, vnd);
+
+ CreateVendor(parent, vnd);
+ RelayoutTree();
+}
+
+/* VendorSub */
+static void
+CreateVendorSub(TreeNode *parent, XF86ConfVendSubPtr vendor)
+{
+ TreeNode *prev, *node;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (vendor) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->vendsub.vendsub = vendor;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = VendorSubDestroy;
+ node->update = VendorSubUpdate;
+ CreateVendorSubField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+ vendor = (XF86ConfVendSubPtr)(vendor->list.next);
+ }
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ CreateVendorSubField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateVendorSubField(TreeNode *node, Bool addnew)
+{
+ Widget box, command;
+
+ box = XtVaCreateWidget("vendorSub", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ XF86OptionPtr *options;
+ XF86ConfVendSubPtr vendor = node->data->vendsub.vendsub;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+ options = &(vendor->vs_option_lst);
+ command = XtCreateManagedWidget("options", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, OptionsCallback, (XtPointer)options);
+ XtVaCreateManagedWidget("label", labelWidgetClass, box,
+ XtNlabel, vendor->vs_identifier, NULL, 0);
+
+ XtCreateManagedWidget("nameL", labelWidgetClass, box, NULL, 0);
+ node->data->vendsub.text =
+ XtVaCreateManagedWidget("name", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, XtNstring,
+ vendor->vs_name ? vendor->vs_name : "",
+ NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewVendorSubCallback, (XtPointer)node);
+ node->data->vendsub.text =
+ XtVaCreateManagedWidget("value", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, NULL, 0);
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+static void
+VendorSubDestroy(TreeNode *node)
+{
+ if (node->data->vendsub.vendsub)
+ xf86removeVendorSub(node->parent->parent->data->vendor.vendor,
+ node->data->vendsub.vendsub);
+}
+
+static void
+VendorSubUpdate(TreeNode *node)
+{
+ char *str;
+
+ XtVaGetValues(node->data->vendsub.text, XtNstring, &str, NULL, 0);
+ XtFree(node->data->vendsub.vendsub->vs_name);
+ if (*str)
+ node->data->vendsub.vendsub->vs_name = XtNewString(str);
+ else
+ node->data->vendsub.vendsub->vs_name = NULL;
+}
+
+static void
+NewVendorSubCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfVendSubPtr vnd;
+ Arg args[1];
+ char *label;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(node->data->vendsub.text, args, 1);
+ if (*label == '\0')
+ return;
+
+ parent = node->parent;
+ DeleteNode(node);
+ vnd = (XF86ConfVendSubPtr)XtCalloc(1, sizeof(XF86ConfVendSubRec));
+ vnd->vs_identifier = XtNewString(label);
+ parent->parent->data->vendor.vendor->vnd_sub_lst =
+ xf86addVendorSub(parent->parent->data->vendor.vendor->vnd_sub_lst, vnd);
+
+ CreateVendorSub(parent, vnd);
+ RelayoutTree();
+}
+
+/* DRI */
+static void
+CreateDRI(TreeNode *parent, XF86ConfDRIPtr dri)
+{
+ TreeNode *node;
+ TreeData *data;
+
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->dri.dri = dri;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ parent->child = node;
+ node->update = DRIUpdate;
+ CreateDRIField(node);
+}
+
+static void
+CreateDRIField(TreeNode *node)
+{
+ Widget box, toggle;
+ XF86ConfDRIPtr dri = node->data->dri.dri;
+ TreeNode *buffers;
+ char buf[32];
+
+ box = XtVaCreateWidget("dri", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+ XtCreateManagedWidget("nameL", labelWidgetClass, box, NULL, 0);
+ node->data->dri.name =
+ XtVaCreateManagedWidget("name", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, XtNstring,
+ dri->dri_group_name ? dri->dri_group_name : "",
+ NULL, 0);
+
+ XtCreateManagedWidget("groupL", labelWidgetClass, box, NULL, 0);
+ if (dri->dri_group >= 0)
+ XmuSnprintf(buf, sizeof(buf), "%d", dri->dri_group);
+ else
+ *buf = '\0';
+ node->data->dri.group =
+ XtVaCreateManagedWidget("group", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, XtNstring, buf,
+ NULL, 0);
+
+ XtCreateManagedWidget("modeL", labelWidgetClass, box, NULL, 0);
+ if (dri->dri_mode > 0)
+ XmuSnprintf(buf, sizeof(buf), "0%o", dri->dri_mode);
+ else
+ *buf = '\0';
+ node->data->dri.mode =
+ XtVaCreateManagedWidget("mode", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, XtNstring, buf,
+ NULL, 0);
+
+ toggle = XtVaCreateManagedWidget("Buffers", toggleWidgetClass, tree,
+ XtNstate, True, XtNtreeParent, box,
+ NULL, 0);
+ buffers = NewNode(node, toggle, toggle, box, NULL);
+ node->child = buffers;
+ CreateBuffers(buffers, dri->dri_buffers_lst);
+
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+static void
+DRIUpdate(TreeNode *node)
+{
+ char *str;
+
+ /* name */
+ XtVaGetValues(node->data->dri.name, XtNstring, &str, NULL, 0);
+ XtFree(node->data->dri.dri->dri_group_name);
+ if (*str)
+ node->data->dri.dri->dri_group_name = XtNewString(str);
+ else
+ node->data->dri.dri->dri_group_name = NULL;
+
+ /* group */
+ XtVaGetValues(node->data->dri.group, XtNstring, &str, NULL, 0);
+ if (*str)
+ node->data->dri.dri->dri_group = strtoul(str, NULL, 0);
+ else
+ node->data->dri.dri->dri_group = -1;
+
+ /* mode */
+ XtVaGetValues(node->data->dri.mode, XtNstring, &str, NULL, 0);
+ node->data->dri.dri->dri_mode = strtoul(str, NULL, 0);
+}
+
+/* Buffers */
+static void
+CreateBuffers(TreeNode *parent, XF86ConfBuffersPtr buf)
+{
+ TreeNode *node, *prev;
+ TreeData *data;
+
+ if ((prev = parent->child) != NULL)
+ while (prev->next)
+ prev = prev->next;
+
+ while (buf) {
+ data = (TreeData*)XtCalloc(1, sizeof(TreeData));
+ data->buffers.buffers = buf;
+ node = NewNode(parent, NULL, NULL, parent->node, data);
+ node->destroy = BuffersDestroy;
+ node->update = BuffersUpdate;
+ CreateBuffersField(node, False);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+ prev = node;
+
+ buf = (XF86ConfBuffersPtr)(buf->list.next);
+ }
+ node = NewNode(parent, NULL, NULL, parent->node, NULL);
+ CreateBuffersField(node, True);
+ if (parent->child == NULL)
+ parent->child = node;
+ else
+ prev->next = node;
+}
+
+static void
+CreateBuffersField(TreeNode *node, Bool addnew)
+{
+ Widget box, command;
+
+ box = XtVaCreateWidget("buffers", formWidgetClass, tree,
+ XtNtreeParent, node->treeParent, NULL, 0);
+ node->node = box;
+
+ if (!addnew) {
+ char str[32];
+ XF86ConfBuffersPtr buf = node->data->buffers.buffers;
+
+ command = XtCreateManagedWidget("remove", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, DestroyCallback, (XtPointer)node);
+
+ XtCreateManagedWidget("countL", labelWidgetClass, box, NULL, 0);
+ XmuSnprintf(str, sizeof(str), "%d", buf->buf_count);
+ node->data->buffers.count =
+ XtVaCreateManagedWidget("count", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("sizeL", labelWidgetClass, box, NULL, 0);
+ XmuSnprintf(str, sizeof(str), "%d", buf->buf_size);
+ node->data->buffers.size =
+ XtVaCreateManagedWidget("size", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, XtNstring, str,
+ NULL, 0);
+
+ XtCreateManagedWidget("flagsL", labelWidgetClass, box, NULL, 0);
+ node->data->buffers.flags =
+ XtVaCreateManagedWidget("flags", asciiTextWidgetClass, box,
+ XtNeditType, XawtextEdit, XtNstring,
+ buf->buf_flags ? buf->buf_flags : "",
+ NULL, 0);
+ }
+ else {
+ command = XtCreateManagedWidget("new", commandWidgetClass, box,
+ NULL, 0);
+ XtAddCallback(command, XtNcallback, NewBuffersCallback, (XtPointer)node);
+ }
+ if (XtIsRealized(node->treeParent))
+ XtRealizeWidget(box);
+ XtManageChild(box);
+}
+
+/*ARGUSED*/
+static void
+BuffersDestroy(TreeNode *node)
+{
+ if (node->data->buffers.buffers)
+ xf86removeBuffers(XF86Config->conf_dri, node->data->buffers.buffers);
+}
+
+/*ARGSUSED*/
+static void
+NewBuffersCallback(Widget unused, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *parent, *node = (TreeNode*)user_data;
+ XF86ConfBuffersPtr buf;
+
+ parent = node->parent;
+ DeleteNode(node);
+ buf = (XF86ConfBuffersPtr)XtCalloc(1, sizeof(XF86ConfBuffersRec));
+ XF86Config->conf_dri->dri_buffers_lst =
+ xf86addBuffers(XF86Config->conf_dri->dri_buffers_lst, buf);
+
+ CreateBuffers(parent, buf);
+ RelayoutTree();
+}
+
+static void
+BuffersUpdate(TreeNode *node)
+{
+ char *str;
+
+ /* count */
+ XtVaGetValues(node->data->buffers.count, XtNstring, &str, NULL, 0);
+ node->data->buffers.buffers->buf_count = strtoul(str, NULL, 0);
+
+ /* size */
+ XtVaGetValues(node->data->buffers.size, XtNstring, &str, NULL, 0);
+ node->data->buffers.buffers->buf_size = strtoul(str, NULL, 0);
+
+ /* flags */
+ XtVaGetValues(node->data->buffers.flags, XtNstring, &str, NULL, 0);
+ if (*str)
+ node->data->buffers.buffers->buf_flags = XtNewString(str);
+ else
+ node->data->buffers.buffers->buf_flags = NULL;
+}
+
+static TreeNode *
+NewNode(TreeNode *parent, Widget node, Widget toggle, Widget treeParent,
+ TreeData *data)
+{
+ TreeNode *tree = (TreeNode*)XtCalloc(1, sizeof(TreeNode));
+
+ tree->parent = parent;
+ tree->node = node;
+ if ((tree->toggle = toggle) != NULL)
+ XtAddCallback(toggle, XtNcallback, ToggleCallback, (XtPointer)tree);
+ tree->treeParent = treeParent;
+ tree->data = data;
+
+ return (tree);
+}
+
+static void
+DeleteNode(TreeNode *node)
+{
+ TreeNode *ptr = node->child;
+
+ while (ptr != NULL) {
+ TreeNode *next = ptr->next;
+
+ DeleteNode(ptr);
+ ptr = next;
+ }
+
+ if (node->parent && node->parent->child == node)
+ node->parent->child = node->next;
+ else if (node->parent) {
+ for (ptr = node->parent->child; ptr && ptr->next != node;
+ ptr = ptr->next)
+ ;
+ if (ptr)
+ ptr->next = node->next;
+ }
+
+ if (node->destroy)
+ (node->destroy)(node);
+ if (node->data)
+ XtFree((XtPointer)node->data);
+
+ /* sets treeParent to NULL so that RelayoutTree works correctly,
+ * as the tree will properly calculate it's new size.
+ */
+ XtVaSetValues(node->node, XtNtreeParent, NULL, NULL, 0);
+
+ XtDestroyWidget(node->node);
+ XtFree((XtPointer)node);
+}
+
+/*ARGUSED*/
+static void
+DestroyCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *node = (TreeNode*)user_data;
+
+ DeleteNode(node);
+ RelayoutTree();
+}
+
+static void
+ToggleNodeRecursive(TreeNode *node)
+{
+ while (node) {
+ if (!XtIsRealized(node->node))
+ XtRealizeWidget(node->node);
+ XtVaSetValues(node->node, XtNtreeParent, node->treeParent, NULL, 0);
+ XtManageChild(node->node);
+
+ if (node->child && !node->toggle)
+ ToggleNodeRecursive(node->child);
+
+ node = node->next;
+ }
+}
+
+static void
+ToggleNode(TreeNode *node, Bool toggle)
+{
+ while (node) {
+ if (toggle) {
+ if (!XtIsRealized(node->node))
+ XtRealizeWidget(node->node);
+ XtVaSetValues(node->node, XtNtreeParent, node->treeParent, NULL, 0);
+ XtManageChild(node->node);
+
+ if (node->child && !node->toggle)
+ ToggleNodeRecursive(node->child);
+ }
+ else {
+ if (node->child)
+ ToggleNode(node->child, False);
+ XtVaSetValues(node->node, XtNtreeParent, NULL, NULL, 0);
+ XtUnmanageChild(node->node);
+ if (node->toggle)
+ XtVaSetValues(node->toggle, XtNstate, False, NULL, 0);
+ }
+ node = node->next;
+ }
+}
+
+/*
+ * XXX This callback can show side effects in the way it is called. If
+ * the structure holding the XF86OptionPtr is reallocated, a bogus pointer
+ * will be passed to this callback.
+ */
+static void
+OptionsCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XF86OptionPtr *options = (XF86OptionPtr*)user_data;
+
+#ifdef USE_MODULES
+ OptionsPopup(options, NULL, NULL);
+#else
+ OptionsPopup(options);
+#endif
+}
+
+static void
+RelayoutTree(void)
+{
+ Arg args[4];
+ Dimension sliderWidth, sliderHeight, canvasWidth, canvasHeight;
+
+ XtSetArg(args[0], XtNwidth, &sliderWidth);
+ XtSetArg(args[1], XtNheight, &sliderHeight);
+ XtGetValues(shell, args, 2);
+
+ XtSetArg(args[2], XtNwidth, &canvasWidth);
+ XtSetArg(args[3], XtNheight, &canvasHeight);
+ XtGetValues(tree, args + 2, 2);
+
+ XtSetArg(args[0], XtNsliderWidth, sliderWidth);
+ XtSetArg(args[1], XtNsliderHeight, sliderHeight);
+ XtSetArg(args[2], XtNcanvasWidth, canvasWidth);
+ XtSetArg(args[3], XtNcanvasHeight, canvasHeight);
+ XtSetValues(panner, args, 4);
+}
+
+static void
+ToggleCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ TreeNode *nodeParent = (TreeNode*)user_data;
+
+ if (nodeParent->child) {
+ if (XtIsRealized(tree))
+ XtUnmapWidget(tree);
+ ToggleNode(nodeParent->child, (Bool)(long)call_data);
+ RelayoutTree();
+ if (XtIsRealized(tree))
+ XtMapWidget(tree);
+ }
+}
+
+/*ARGSUSED*/
+static void
+PannerCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[2];
+ XawPannerReport *rep = (XawPannerReport *)call_data;
+
+ XtSetArg (args[0], XtNx, -rep->slider_x);
+ XtSetArg (args[1], XtNy, -rep->slider_y);
+ XtSetValues(tree, args, 2);
+}
+
+/*ARGSUSED*/
+static void
+PortholeCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XawPannerReport *rep = (XawPannerReport*)call_data;
+ Arg args[6];
+ Cardinal n = 2;
+
+ XtSetArg (args[0], XtNsliderX, rep->slider_x);
+ XtSetArg (args[1], XtNsliderY, rep->slider_y);
+ if (rep->changed != (XawPRSliderX | XawPRSliderY)) {
+ XtSetArg (args[2], XtNsliderWidth, rep->slider_width);
+ XtSetArg (args[3], XtNsliderHeight, rep->slider_height);
+ XtSetArg (args[4], XtNcanvasWidth, rep->canvas_width);
+ XtSetArg (args[5], XtNcanvasHeight, rep->canvas_height);
+ n = 6;
+ }
+ XtSetValues(panner, args, n);
+}
+
+static void
+DestroyTree(TreeNode *node)
+{
+ while (node) {
+ TreeNode *next = node->next;
+ if (node->child)
+ DestroyTree(node->child);
+
+ if (node->data)
+ XtFree((XtPointer)node->data);
+ XtFree((XtPointer)node);
+
+ node = next;
+ }
+}
+
+static void
+UpdateConfig(TreeNode *node)
+{
+ while (node) {
+ if (node->child)
+ UpdateConfig(node->child);
+ if (node->update)
+ (node->update)(node);
+ node = node->next;
+ }
+}
+
+static Bool
+ExpertInitialize(void)
+{
+ Widget paned, vpane, close, config, files, modules, flags, video, modes,
+ monitor, device, screen, input, layout, vendor, dri;
+ Arg args[4];
+ Dimension width, height, canvasWidth, canvasHeight;
+ TreeNode *node;
+
+ if (expert != NULL)
+ return (False);
+
+ shell = XtCreatePopupShell("Expert", transientShellWidgetClass,
+ toplevel, NULL, 0);
+ paned = XtVaCreateManagedWidget("paned", panedWidgetClass, shell,
+ XtNorientation, XtorientHorizontal, NULL, 0);
+ vpane = XtCreateManagedWidget("vpane", panedWidgetClass, paned, NULL, 0);
+ panner = XtCreateManagedWidget ("panner", pannerWidgetClass, vpane, NULL, 0);
+ close = XtCreateManagedWidget("close", commandWidgetClass, vpane, NULL, 0);
+ XtAddCallback(close, XtNcallback, PopdownCallback, NULL);
+
+ expert = XtCreateManagedWidget("expert", portholeWidgetClass, paned, NULL, 0);
+ XtAddCallback(expert, XtNreportCallback, PortholeCallback, NULL);
+ XtAddCallback(panner, XtNreportCallback, PannerCallback, NULL);
+ tree = XtCreateManagedWidget("tree", treeWidgetClass, expert, NULL, 0);
+
+ config = XtVaCreateManagedWidget("XF86Config", toggleWidgetClass, tree,
+ XtNstate, True, NULL, 0);
+ mainNode = NewNode(NULL, config, config, NULL, NULL);
+
+ files = XtVaCreateManagedWidget("Files", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node = NewNode(mainNode, files, files, config, NULL);
+ mainNode->child = node;
+ CreateFiles(node);
+
+ modules = XtVaCreateManagedWidget("Module", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, modules, modules, config, NULL);
+ node = node->next;
+ CreateModule(node, XF86Config->conf_modules ?
+ XF86Config->conf_modules->mod_load_lst : NULL);
+
+ flags = XtVaCreateManagedWidget("ServerFlags", commandWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, flags, NULL, config, NULL);
+ node = node->next;
+ if (XF86Config->conf_flags == NULL)
+ XF86Config->conf_flags = (XF86ConfFlagsPtr)
+ XtCalloc(1, sizeof(XF86ConfFlagsRec));
+ XtAddCallback(flags, XtNcallback, OptionsCallback,
+ (XtPointer)&(XF86Config->conf_flags->flg_option_lst));
+
+ video = XtVaCreateManagedWidget("VideoAdaptor", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, video, video, config, NULL);
+ node = node->next;
+ CreateVideoAdaptor(node, XF86Config->conf_videoadaptor_lst);
+
+ modes = XtVaCreateManagedWidget("Mode", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, modes, modes, config, NULL);
+ node = node->next;
+ CreateModes(node, XF86Config->conf_modes_lst);
+
+ monitor = XtVaCreateManagedWidget("Monitor", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, monitor, monitor, config, NULL);
+ node = node->next;
+ CreateMonitor(monitorTree = node, XF86Config->conf_monitor_lst);
+
+ device = XtVaCreateManagedWidget("Device", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, device, device, config, NULL);
+ node = node->next;
+ CreateDevice(node, XF86Config->conf_device_lst);
+
+ screen = XtVaCreateManagedWidget("Screen", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, screen, screen, config, NULL);
+ node = node->next;
+ CreateScreen(screenTree = node, XF86Config->conf_screen_lst);
+
+ input = XtVaCreateManagedWidget("Input", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, input, input, config, NULL);
+ node = node->next;
+ CreateInput(node, XF86Config->conf_input_lst);
+
+ layout = XtVaCreateManagedWidget("Layout", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, layout, layout, config, NULL);
+ node = node->next;
+ CreateLayout(layoutTree = node, XF86Config->conf_layout_lst);
+
+ vendor = XtVaCreateManagedWidget("Vendor", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, vendor, vendor, config, NULL);
+ node = node->next;
+ CreateVendor(node, XF86Config->conf_vendor_lst);
+
+ dri = XtVaCreateManagedWidget("DRI", toggleWidgetClass, tree,
+ XtNtreeParent, config, NULL, 0);
+ node->next = NewNode(mainNode, dri, dri, config, NULL);
+ node = node->next;
+ if (XF86Config->conf_dri == NULL)
+ XF86Config->conf_dri = (XF86ConfDRIPtr)
+ XtCalloc(1, sizeof(XF86ConfDRIRec));
+ CreateDRI(node, XF86Config->conf_dri);
+
+ XtRealizeWidget(shell);
+
+ XtSetArg(args[0], XtNwidth, &width);
+ XtSetArg(args[1], XtNheight, &height);
+ XtGetValues(shell, args, 2);
+ XtSetArg(args[0], XtNwidth, width);
+ XtSetArg(args[1], XtNheight, height);
+ XtSetValues(expert, args, 2);
+
+ XtSetArg(args[0], XtNsliderWidth, width);
+ XtSetArg(args[1], XtNsliderHeight, height);
+ XtSetArg(args[2], XtNwidth, &canvasWidth);
+ XtSetArg(args[3], XtNheight, &canvasHeight);
+ XtGetValues(tree, args + 2, 2);
+ XtSetArg(args[2], XtNcanvasWidth, canvasWidth);
+ XtSetArg(args[3], XtNcanvasHeight, canvasHeight);
+ XtSetValues(panner, args, 4);
+
+ /* needs to do the apparently NOP code bellow to correctly layout the
+ * tree widget */
+
+ /* close all open entries */
+ ToggleCallback(config, mainNode, (XtPointer)0);
+ /* open first level */
+ ToggleCallback(config, mainNode, (XtPointer)1);
+
+ XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
+
+ return (True);
+}
diff --git a/hw/xfree86/utils/xorgcfg/help.c b/hw/xfree86/utils/xorgcfg/help.c
new file mode 100644
index 000000000..2b25e8ede
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/help.c
@@ -0,0 +1,1786 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.7 2002/06/06 21:03:32 paulo Exp $
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Paned.h>
+
+#include <X11/Xaw/Text.h>
+#include <X11/Xaw/TextSinkP.h>
+#include <X11/Xaw/TextSrcP.h>
+#include <X11/Xmu/SysUtil.h>
+#include <X11/Xmu/Xmu.h>
+#include <stdlib.h> /* for bsearch() */
+#include <ctype.h>
+#include "help.h"
+#include "options.h"
+
+/*
+ * Prototypes
+ */
+static void CloseCallback(Widget, XtPointer, XtPointer);
+static void StartHelp(void);
+void Html_ModeStart(Widget);
+
+/*
+ * Initialization
+ */
+static Widget shell, text;
+static Bool popped_up = False;
+
+/*
+ * Implementation
+ */
+void
+Help(char *topic)
+{
+ Widget source;
+ char *str = NULL;
+ Bool error = False;
+ static char *def_text = "<h2>Help Error</h2>"
+ "No help available for the topic <b>%s</b>.";
+ XtResource resource = {
+ NULL, "HelpMessage", XtRString, sizeof(char*),
+ 0, XtRString, NULL
+ };
+
+ StartHelp();
+ source = XawTextGetSource(text);
+ XawTextSourceClearEntities(source, 0,
+ XawTextSourceScan(source, 0, XawstAll,
+ XawsdRight, 1, True));
+ if (topic != NULL) {
+ resource.resource_name = topic;
+ XtGetApplicationResources(shell, (XtPointer)&str,
+ &resource, 1, NULL, 0);
+ }
+ if (str == NULL) {
+ int len;
+
+ error = True;
+ if (topic == NULL)
+ topic = "(null argument)";
+ str = XtMalloc(len = strlen(topic) + strlen(def_text) + 1);
+ XmuSnprintf(str, len, def_text, topic);
+ }
+ XtVaSetValues(text, XtNstring, str, NULL, 0);
+ if (error)
+ XtFree(str);
+
+ Html_ModeStart(source);
+ _XawTextBuildLineTable((TextWidget)text,
+ XawTextTopPosition(text), True);
+ XawTextDisplay(text);
+ if (popped_up == False) {
+ popped_up = True;
+ XtPopup(shell, XtGrabNone);
+ XtSetKeyboardFocus(shell, text);
+ }
+}
+
+static void
+StartHelp(void)
+{
+ static XtResource resource = {
+ "properties", "Properties", XtRString, sizeof(char*),
+ 0, XtRString, NULL
+ };
+
+ if (shell == NULL) {
+ Widget pane, commands, close;
+ char *props;
+ XawTextPropertyList *propl;
+
+ shell = XtCreatePopupShell("help", transientShellWidgetClass,
+ toplevel, NULL, 0);
+ pane = XtCreateManagedWidget("pane", panedWidgetClass,
+ shell, NULL, 0);
+ text = XtVaCreateManagedWidget("text", asciiTextWidgetClass,
+ pane, XtNeditType, XawtextRead, NULL, 0);
+ commands = XtCreateManagedWidget("commands", formWidgetClass, pane,
+ NULL, 0);
+ close = XtCreateManagedWidget("close", commandWidgetClass,
+ commands, NULL, 0);
+ XtAddCallback(close, XtNcallback, CloseCallback, NULL);
+ XtRealizeWidget(shell);
+ XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1);
+ XtGetApplicationResources(text, (XtPointer)&props,
+ &resource, 1, NULL, 0);
+ propl = XawTextSinkConvertPropertyList("html", props,
+ toplevel->core.screen,
+ toplevel->core.colormap,
+ toplevel->core.depth);
+ XtVaSetValues(XawTextGetSink(text), XawNtextProperties, propl, NULL, 0);
+ }
+}
+
+/*ARGSUSED*/
+static void
+CloseCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XtPopdown(shell);
+ popped_up = False;
+}
+
+/*ARGSUSED*/
+void
+HelpCancelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ CloseCallback(w, NULL, NULL);
+}
+
+
+/* bellow is a modified version of the html-mode.c I wrote for xedit
+ * (at least) temporarily dead.
+ */
+
+/*
+ * Copyright (c) 1999 by The XFree86 Project, 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
+ * THE XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ *
+ * Author: Paulo César Pereira de Andrade
+ */
+
+#define Html_Peek(parser) ((parser)->next)
+
+/*
+ * Types
+ */
+typedef struct _Html_Parser Html_Parser;
+typedef struct _Html_Item Html_Item;
+
+typedef struct _Html_TagInfo {
+ char *name;
+ int entity : 1; /* it changes the type of the text */
+ int nest : 1; /* does not close tags automatically */
+ int end : 1; /* need a close markup */
+ int adnl : 1; /* add newline before/after tag contents */
+ int para : 1; /* changes the paragraph formatting */
+ unsigned long mask; /* enforce use of attributes of this tag-info */
+ unsigned long xlfd_mask;
+ void (*parse_args)(Html_Parser*, Html_Item*);
+ XawTextProperty *override;
+ XrmQuark ident;
+} Html_TagInfo;
+
+struct _Html_Item {
+ XrmQuark ident;
+ XawTextPosition start, end;
+ Html_TagInfo *info;
+
+ XawTextProperty *combine;
+ Bool override;
+ int li;
+
+ XtPointer replace;
+
+ Html_Item *parent, *child, *next;
+};
+
+struct _Html_Parser {
+ Widget source;
+ XawTextBlock block, replace;
+ XawTextPosition position, offset, start, end, last;
+ XrmQuark quark;
+ int i, ch, next;
+ Html_Item *item, *head;
+ XmuScanline *mask;
+ int space, pre, adnl, list, desc, column;
+ Bool spc;
+ XawTextBlock *entity;
+
+ Pixel alink;
+};
+
+typedef struct _Html_SourceInfo Html_SourceInfo;
+struct _Html_SourceInfo {
+ Widget source;
+ XawTextBlock block;
+ XawTextPosition last;
+ Html_SourceInfo *next;
+};
+
+/*
+ * Proptotypes
+ */
+void Html_ModeEnd(Widget);
+static void Html_ModeInit(void);
+static void Html_ParseCallback(Widget, XtPointer, XtPointer);
+static Html_TagInfo *Html_GetInfo(char*);
+static int Html_Get(Html_Parser*);
+static int Html_Parse1(Html_Parser*);
+static int Html_Parse2(Html_Parser*);
+static void Html_ParseTag(Html_Parser*);
+static void Html_Commit(Html_Parser*);
+static void Html_AddEntities(Html_Parser*, Html_Item*);
+
+static int Html_Put(Html_Parser*, int);
+static void Html_Puts(Html_Parser*, char*);
+static int Html_Format1(Html_Parser*);
+static int Html_Format2(Html_Parser*);
+static int Html_Format3(Html_Parser*);
+static void Html_FormatTag(Html_Parser*);
+
+static void Html_AArgs(Html_Parser*, Html_Item*);
+static void Html_FontArgs(Html_Parser*, Html_Item*);
+
+/*
+ * Initialization
+ */
+static XrmQuark
+ Qbr,
+ Qdefault,
+ Qdd,
+ Qdl,
+ Qdt,
+ Qentity,
+ Qetag,
+ Qhide,
+ Qli,
+ Qol,
+ Qp,
+ Qpre,
+ Qspace,
+ Qtag,
+ Qul;
+
+static Html_TagInfo tag_info[] = {
+ {"a", 1, 0, 1, 0, 0,
+ 0, 0,
+ Html_AArgs},
+ {"address", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_SLANT,
+ },
+ {"b", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_WEIGHT,
+ },
+ {"blockquote", 0, 1, 1, 1, 1,
+ 0, 0,
+ },
+ {"body", 0, 0, 1, 0, 0,
+ 0, 0,
+ },
+ {"br", 0, 0, 0, 0, 0,
+ },
+ {"code", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
+ },
+ {"dd", 0, 1, 1, 0, 1,
+ 0, 0},
+ {"dl", 0, 1, 1, 0, 0,
+ 0, 0,
+ },
+ {"dt", 0, 0, 1, 0, 0,
+ 0, 0},
+ {"em", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_SLANT,
+ },
+ {"font", 1, 1, 1, 0, 0,
+ 0, 0,
+ Html_FontArgs},
+ {"h1", 1, 0, 1, 1, 0,
+ 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
+ },
+ {"h2", 1, 0, 1, 1, 0,
+ 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
+ },
+ {"h3", 1, 0, 1, 1, 0,
+ 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
+ },
+ {"h4", 1, 0, 1, 1, 0,
+ 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
+ },
+ {"h5", 1, 0, 1, 1, 0,
+ 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
+ },
+ {"h6", 1, 0, 1, 1, 0,
+ 0, XAW_TPROP_WEIGHT | XAW_TPROP_PIXELSIZE,
+ },
+ {"head", 0, 0, 1, 0, 0,
+ 0, 0,
+ },
+ {"html", 0, 0, 1, 0, 0,
+ 0, 0,
+ },
+ {"i", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_SLANT,
+ },
+ {"kbd", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
+ },
+ {"li", 0, 0, 0, 0, 0,
+ 0, 0},
+ {"ol", 0, 1, 1, 0, 1,
+ 0, 0,
+ },
+ {"p", 0, 0, 0, 1, 0,
+ },
+ {"pre", 1, 0, 1, 1, 0,
+ 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
+ },
+ {"samp", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
+ },
+ {"strong", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_WEIGHT,
+ },
+ {"tt", 1, 0, 1, 0, 0,
+ 0, XAW_TPROP_FAMILY | XAW_TPROP_PIXELSIZE,
+ },
+ {"ul", 0, 1, 1, 0, 1,
+ 0, 0,
+ },
+};
+
+static char *pnl = "<p>\n", *nlpnl = "\n<p>\n";
+static Html_SourceInfo *source_info;
+
+/*
+ * Implementation
+ */
+static char *
+Html_GetText(Widget src, XawTextPosition position)
+{
+ char *result, *tempResult;
+ XawTextPosition offset = 0;
+ XawTextBlock text;
+
+ tempResult = result = XtMalloc((unsigned)(position + 1));
+
+ while (offset < position) {
+ offset = XawTextSourceRead(src, offset, &text, position - offset);
+ if (!text.length)
+ break;
+ memcpy(tempResult, text.ptr, (unsigned)text.length);
+ tempResult += text.length;
+ }
+
+ *tempResult = '\0';
+
+ return (result);
+}
+
+void
+Html_ModeStart(Widget src)
+{
+ Html_Parser *parser = XtNew(Html_Parser);
+ Html_Item *next, *item;
+ XColor color, exact;
+ Html_SourceInfo *info = XtNew(Html_SourceInfo);
+
+ if (XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap,
+ "blue", &color, &exact))
+ parser->alink = color.pixel;
+ else
+ parser->alink = 0L;
+
+ XtVaSetValues(src, XtNeditType, XawtextEdit, NULL, 0);
+
+ Html_ModeInit();
+
+ /* initialize parser state */
+ parser->source = src;
+ parser->position = XawTextSourceRead(parser->source, 0,
+ &parser->block, 4096);
+ parser->replace.ptr = NULL;
+ parser->replace.firstPos = 0;
+ parser->replace.length = 0;
+ parser->replace.format = FMT8BIT;
+ parser->offset = -1;
+ parser->quark = NULLQUARK;
+ parser->i = 0;
+ parser->i = parser->ch = parser->next = 0;
+ parser->last = XawTextSourceScan(src, 0, XawstAll, XawsdRight, 1, 1);
+ if (parser->block.length == 0)
+ parser->ch = parser->next = EOF;
+ else
+ (void)Html_Get(parser);
+ parser->pre = 0;
+ parser->adnl = 1;
+ parser->list = parser->desc = parser->column = 0;
+ parser->spc = True;
+
+ info->source = src;
+ info->block.ptr = Html_GetText(src, parser->last);
+ info->block.length = parser->last;
+ info->block.format = FMT8BIT;
+ info->block.firstPos = 0;
+ info->next = NULL;
+ if (source_info == NULL)
+ source_info = info;
+ else {
+ Html_SourceInfo *tmp = source_info;
+
+ while (tmp->next)
+ tmp = tmp->next;
+ tmp->next = info;
+ }
+
+ while (Html_Format1(parser) != EOF)
+ ;
+ XawTextSourceReplace(parser->source, 0, parser->last, &parser->replace);
+ XtFree(parser->replace.ptr);
+
+ /* re-initialize parser state */
+ parser->position = XawTextSourceRead(parser->source, 0,
+ &parser->block, 4096);
+ parser->offset = -1;
+ parser->quark = NULLQUARK;
+ parser->i = parser->ch = parser->next = 0;
+ parser->last = XawTextSourceScan(src, 0, XawstAll, XawsdRight, 1, 1);
+ info->last = parser->last;
+ if (parser->block.length == 0)
+ parser->ch = parser->next = EOF;
+ else
+ (void)Html_Get(parser);
+ parser->adnl = 1;
+ parser->list = parser->desc = parser->column = 0;
+ parser->spc = True;
+ parser->head = parser->item = NULL;
+
+ parser->mask = XmuNewScanline(0, 0, 0);
+
+ /* build html structure information */
+ while (Html_Parse1(parser) != EOF)
+ ;
+
+ /* create top level entity mask */
+ (void)XmuScanlineNot(parser->mask, 0, parser->last);
+
+ item = parser->item;
+ while (item) {
+ next = item->next;
+ Html_AddEntities(parser, item);
+ if (item->combine)
+ XtFree((XtPointer)item->combine);
+ XtFree((XtPointer)item);
+ item = next;
+ }
+ XmuDestroyScanline(parser->mask);
+
+ XtVaSetValues(src, XtNeditType, XawtextRead, NULL, 0);
+
+ XtFree((XtPointer)parser);
+
+ /* add callbacks for interactive changes */
+ XtAddCallback(src, XtNpropertyCallback, Html_ParseCallback, NULL);
+}
+
+void
+Html_ModeEnd(Widget src)
+{
+ Html_SourceInfo *info, *pinfo;
+
+ XtRemoveCallback(src, XtNpropertyCallback, Html_ParseCallback, NULL);
+ for (pinfo = info = source_info; info; pinfo = info, info = info->next)
+ if (info->source == src)
+ break;
+
+ if (info == NULL)
+ return;
+
+ XawTextSourceClearEntities(src, 0, info->last);
+ XtVaSetValues(src, XtNeditType, XawtextEdit, NULL, 0);
+ XawTextSourceReplace(src, 0, info->last, &info->block);
+ XtVaSetValues(src, XtNeditType, XawtextRead, NULL, 0);
+
+ if (info == source_info)
+ source_info = source_info->next;
+ else
+ pinfo->next = info->next;
+ XtFree(info->block.ptr);
+ XtFree((XtPointer)info);
+}
+
+static void
+Html_ParseCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+}
+
+static int
+bcmp_tag_info(_Xconst void *left, _Xconst void *right)
+{
+ return (strcmp((char*)left, ((Html_TagInfo*)right)->name));
+}
+
+static Html_TagInfo *
+Html_GetInfo(char *name)
+{
+ return (bsearch(name, tag_info, sizeof(tag_info) / sizeof(tag_info[0]),
+ sizeof(Html_TagInfo), bcmp_tag_info));
+}
+
+static int
+Html_Get(Html_Parser *parser)
+{
+ if (parser->ch == EOF)
+ return (EOF);
+ if (parser->i >= parser->block.length) {
+ parser->i = 0;
+ parser->position = XawTextSourceRead(parser->source, parser->position,
+ &parser->block, 4096);
+ }
+ parser->ch = parser->next;
+ if (parser->block.length == 0)
+ parser->next = EOF;
+ else
+ parser->next = (unsigned char)parser->block.ptr[parser->i++];
+ parser->offset++;
+
+ return (parser->ch);
+}
+
+static void
+Html_ModeInit(void)
+{
+ static int initialized;
+ int i;
+
+ if (initialized)
+ return;
+
+ Qbr = XrmPermStringToQuark("br");
+ Qdd = XrmPermStringToQuark("dd");
+ Qdefault = XrmPermStringToQuark("default");
+ Qdl = XrmPermStringToQuark("dl");
+ Qdt = XrmPermStringToQuark("dt");
+ Qentity = XrmPermStringToQuark("entity");
+ Qetag = XrmPermStringToQuark("/tag");
+ Qhide = XrmPermStringToQuark("hide");
+ Qli = XrmPermStringToQuark("li");
+ Qol = XrmPermStringToQuark("ol");
+ Qp = XrmPermStringToQuark("p");
+ Qpre = XrmPermStringToQuark("pre");
+ Qspace = XrmPermStringToQuark("space");
+ Qtag = XrmPermStringToQuark("tag");
+ Qul = XrmPermStringToQuark("ul");
+
+ for (i = 0; i < sizeof(tag_info) / sizeof(tag_info[0]); i++)
+ tag_info[i].ident = XrmPermStringToQuark(tag_info[i].name);
+
+ initialized = True;
+}
+
+/************************************************************************/
+/* PARSE */
+/************************************************************************/
+static void
+Html_AddEntities(Html_Parser *parser, Html_Item *item)
+{
+ Html_Item *parent, *next, *child = item->child;
+ XmuSegment segment, *ent;
+ XmuScanline *mask = XmuNewScanline(0, 0, 0);
+ XawTextProperty *tprop, *property = NULL;
+ Widget sink;
+ Bool changed = False;
+
+ /* combine properties */
+ if (item->info &&
+ (item->info->entity ||
+ (item->parent && item->parent->ident != item->parent->info->ident))) {
+ sink = XawTextGetSink(text);
+ parent = item->parent;
+ property = XawTextSinkCopyProperty(sink, item->ident);
+ property->mask = item->info->mask;
+ property->xlfd_mask = item->info->xlfd_mask;
+ if (parent) {
+ (void)XawTextSinkCombineProperty(sink, property,
+ XawTextSinkGetProperty(sink, parent->ident), False);
+ if (item->combine && parent->combine)
+ (void)XawTextSinkCombineProperty(sink, item->combine,
+ parent->combine,
+ item->override);
+ }
+ if (item->combine)
+ XawTextSinkCombineProperty(sink, property, item->combine, True);
+ tprop = property;
+ property = XawTextSinkAddProperty(sink, property);
+ XtFree((XtPointer)tprop);
+ if (property && item->ident != property->identifier) {
+ item->ident = property->identifier;
+ changed = True;
+ }
+ }
+
+ if (item->end < 0) {
+ if (item->next)
+ item->end = item->next->start;
+ else if (item->parent)
+ item->end = item->parent->end;
+ else
+ item->end = parser->last;
+ }
+
+ while (child) {
+ next = child->next;
+ segment.x1 = child->start;
+ segment.x2 = child->end;
+ (void)XmuScanlineOrSegment(mask, &segment);
+ Html_AddEntities(parser, child);
+ if (child->combine)
+ XtFree((XtPointer)child->combine);
+ XtFree((XtPointer)child);
+ child = next;
+ }
+
+ /* build entity mask */
+ (void)XmuScanlineNot(mask, item->start, item->end);
+ (void)XmuScanlineAnd(mask, parser->mask);
+
+ /* add entities */
+ if (item->info && changed) {
+ for (ent = mask->segment; ent; ent = ent->next)
+ (void)XawTextSourceAddEntity(parser->source, 0, 0, NULL, ent->x1,
+ ent->x2 - ent->x1, item->ident);
+ }
+ else if (item->info == NULL)
+ (void)XawTextSourceAddEntity(parser->source, 0,
+ XAW_TENTF_READ | XAW_TENTF_REPLACE,
+ item->replace, item->start,
+ item->end - item->start,
+ item->parent->ident);
+
+ /* set mask for parent entities */
+ (void)XmuScanlineOr(parser->mask, mask);
+ XmuDestroyScanline(mask);
+
+#if 0
+ if (item->info && item->info->para) {
+ XawTextSourceSetParagraph(parser->source, item->start, item->end,
+ 40, /* arbitrary value, for testing */
+ 0, 0);
+ }
+#endif
+}
+
+static void
+Html_Commit(Html_Parser *parser)
+{
+ XawTextPosition position;
+ int length;
+
+ position = parser->start;
+ length = parser->end - parser->start;
+ if (position < 0) {
+ length += position;
+ position = 0;
+ }
+ if (position + length > parser->last + 1)
+ length -= (position + length) - parser->last + 1;
+
+ if (parser->quark != Qdefault && parser->quark != NULLQUARK && length > 0) {
+ XmuSegment segment;
+ Html_Item *head = parser->head;
+ XrmQuark quark = parser->quark;
+
+ parser->quark = Qdefault;
+
+ if (quark == Qli && head &&
+ (head->info->ident == Qol || head->info->ident == Qul)) {
+ if (parser->head == NULL || head->info->ident != Qol)
+ XawTextSourceAddEntity(parser->source, 0, /*XAW_TENT_BULLET,*/
+ XAW_TENTF_HIDE, NULL,
+ position, length, Qli);
+ else
+ XawTextSourceAddEntity(parser->source, 0, /*XAW_TENT_LITEM,*/
+ XAW_TENTF_HIDE,
+ (XtPointer)(long)head->li++,
+ position, length, Qli);
+ }
+ else if (quark == Qhide)
+ XawTextSourceAddEntity(parser->source, 0, XAW_TENTF_HIDE, NULL,
+ position, length, quark);
+ else if (quark == Qentity) {
+ if (head && head->end == -1) {
+ Html_Item *item, *it;
+
+ item = XtNew(Html_Item);
+ item->ident = Qentity;
+ item->start = position;
+ item->end = position + length;
+ item->info = NULL;
+ item->combine = NULL;
+ item->override = False;
+ item->replace = (XtPointer)parser->entity;
+ item->child = item->next = NULL;
+
+ it = head->child;
+
+ item->parent = head;
+ if (it == NULL)
+ head->child = item;
+ else {
+ while (it->next)
+ it = it->next;
+ it->next = item;
+ }
+
+ return;
+ }
+ XawTextSourceAddEntity(parser->source, 0,
+ XAW_TENTF_READ | XAW_TENTF_REPLACE,
+ (XtPointer)parser->entity,
+ position, length, Qentity);
+ }
+
+ segment.x1 = position;
+ segment.x2 = position + length;
+ (void)XmuScanlineOrSegment(parser->mask, &segment);
+ }
+}
+
+static void
+Html_ParseTag(Html_Parser *parser)
+{
+ int ch, sz;
+ char buf[32];
+ Html_TagInfo *info;
+ Html_Item *item = NULL;
+ XawTextPosition offset = parser->offset - 1;
+
+ switch (Html_Peek(parser)) {
+ case '!':
+ (void)Html_Get(parser); /* eat `!' */
+ if (Html_Peek(parser) == '-') {
+ /* comment */
+ (void)Html_Get(parser); /* eat `-' */
+ if (Html_Peek(parser) == '-') {
+ int count = 0;
+
+ (void)Html_Get(parser);
+ while ((ch = Html_Peek(parser)) != EOF) {
+ if (ch == '>' && count >= 2)
+ break;
+ else if (ch == '-')
+ ++count;
+ else
+ count = 0;
+ (void)Html_Get(parser);
+ }
+ }
+ }
+ break;
+ case '?':
+ break;
+ case '/':
+ (void)Html_Get(parser); /* eat `/' */
+ sz = 0;
+ while (isalnum(Html_Peek(parser)) &&
+ sz <= sizeof(buf) + 1)
+ buf[sz++] = tolower(Html_Get(parser));
+ buf[sz] = '\0';
+ if ((info = Html_GetInfo(buf)) != NULL) {
+ if (parser->head) {
+ Html_Item *it = parser->head;
+
+ while (it) {
+ if (it->info == info)
+ break;
+ it = it->parent;
+ }
+
+ if (it) {
+ if (it == parser->head)
+ parser->head->end = offset;
+ else {
+ it->end = offset;
+ do {
+ parser->head->end = offset;
+ parser->head = parser->head->parent;
+ } while (parser->head != it);
+ }
+ if (parser->head->parent)
+ parser->head = parser->head->parent;
+ else
+ parser->head = parser->item;
+ }
+ }
+ }
+ break;
+ default:
+ sz = 0;
+ while (isalnum(Html_Peek(parser)) &&
+ sz <= sizeof(buf) + 1)
+ buf[sz++] = tolower(Html_Get(parser));
+ buf[sz] = '\0';
+ if ((info = Html_GetInfo(buf)) != NULL) {
+ if (info->end == False) {
+ if (info->ident == Qli)
+ parser->quark = Qli;
+ if (!info->para)
+ break; /* no more processing required */
+ }
+ item = XtNew(Html_Item);
+ item->info = info;
+ item->ident = item->info->ident;
+ item->combine = NULL;
+ item->override = False;
+ item->start = item->end = -1;
+ if (info->ident == Qol)
+ item->li = 1;
+ else
+ item->li = 0;
+ item->parent = item->child = item->next = NULL;
+ if (parser->item == NULL)
+ parser->item = parser->head = item;
+ else if (parser->head->end == -1) {
+ if (parser->head->info != item->info || info->nest) {
+ Html_Item *it = parser->head;
+
+ /* first, see if we need to close a long list of tags */
+ if (info->ident == Qdd) {
+ if (parser->head &&
+ parser->head->info->ident == Qdt) {
+ parser->head->end = offset;
+ parser->head = parser->head->parent;
+ }
+ }
+ else if (info->ident == Qdt) {
+ if (parser->head &&
+ parser->head->info->ident == Qdd) {
+ parser->head->end = offset;
+ parser->head = parser->head->parent;
+ }
+ }
+ else if (!info->nest) {
+ while (it) {
+ if (it->info == info || it->info->end)
+ break;
+ it = it->parent;
+ }
+ if (it) {
+ /* close the items */
+ while (parser->head != it) {
+ if (parser->head->info->ident == Qpre)
+ --parser->pre;
+ parser->head->end = offset;
+ parser->head = parser->head->parent;
+ }
+ }
+ }
+
+ /* add child item */
+ it = parser->head->child;
+
+ item->parent = parser->head;
+ if (it == NULL)
+ parser->head->child = item;
+ else {
+ while (it->next)
+ it = it->next;
+ it->next = item;
+ }
+ parser->head = item;
+ }
+ else {
+ /* close the `head' item and start a new one */
+ Html_Item *it;
+
+ parser->head->end = offset;
+ if (parser->head->parent)
+ parser->head = parser->head->parent;
+ else
+ parser->head = parser->item;
+
+ if ((it = parser->head->child) != NULL) {
+ item->parent = parser->head;
+ while (it->next)
+ it = it->next;
+ it->next = item;
+ parser->head = item;
+ }
+ else {
+ parser->head->child = item;
+ parser->head = item;
+ }
+ }
+ }
+ else {
+ /* this is not common, but handle it */
+ Html_Item *it = parser->item;
+
+ while (it->next)
+ it = it->next;
+ it->next = item;
+ parser->head = item;
+ }
+ if (info->parse_args)
+ (info->parse_args)(parser, item);
+ }
+ break;
+ }
+
+ /* skip anything not processed */
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF)
+ (void)Html_Get(parser);
+ if (item && item->start == -1)
+ item->start = parser->offset + 1;
+}
+
+/* tags */
+static int
+Html_Parse2(Html_Parser *parser)
+{
+ int ch;
+
+ for (;;) {
+ if ((ch = Html_Get(parser)) == '<') {
+ parser->end = parser->offset - 1;
+ Html_Commit(parser);
+ parser->quark = Qhide;
+ parser->start = parser->end;
+
+ Html_ParseTag(parser);
+
+ (void)Html_Get(parser); /* eat `>' */
+ parser->end = parser->offset;
+ Html_Commit(parser);
+ }
+ else
+ return (ch);
+ }
+ /*NOTREACHED*/
+}
+
+/* entities */
+static int
+Html_Parse1(Html_Parser *parser)
+{
+ static XawTextBlock *entities[256];
+ static char chars[256];
+ int ch;
+
+ for (;;) {
+ if ((ch = Html_Parse2(parser)) == EOF)
+ return (EOF);
+
+ if (ch == '&') {
+ unsigned char idx = '?';
+ char buf[32];
+ int sz = 0;
+
+ /* the string comparisons need a big optmization! */
+ parser->end = parser->offset - 1;
+ Html_Commit(parser);
+ parser->start = parser->end;
+ while ((ch = Html_Peek(parser)) != ';'
+ && ch != EOF && !isspace(ch)) {
+ ch = Html_Get(parser);
+ if (sz + 1 <= sizeof(buf))
+ buf[sz++] = ch;
+ }
+ buf[sz] = '\0';
+ if (ch == ';')
+ (void)Html_Get(parser);
+ if (sz == 0)
+ idx = '&';
+ else if (strcasecmp(buf, "lt") == 0)
+ idx = '<';
+ else if (strcasecmp(buf, "gt") == 0)
+ idx = '>';
+ else if (strcasecmp(buf, "nbsp") == 0)
+ idx = ' ';
+ else if (strcasecmp(buf, "amp") == 0)
+ idx = '&';
+ else if (strcasecmp(buf, "quot") == 0)
+ idx = '"';
+ else if (*buf == '#') {
+ if (sz == 1)
+ idx = '#';
+ else {
+ char *tmp;
+
+ idx = strtol(buf + 1, &tmp, 10);
+ if (*tmp)
+ idx = '?';
+ }
+ }
+ else if (strcmp(buf + 1, "acute") == 0) {
+ switch (*buf) {
+ case 'a': idx = 'á'; break; case 'e': idx = 'é'; break;
+ case 'i': idx = 'í'; break; case 'o': idx = 'ó'; break;
+ case 'u': idx = 'ú'; break; case 'A': idx = 'Á'; break;
+ case 'E': idx = 'É'; break; case 'I': idx = 'Í'; break;
+ case 'O': idx = 'Ó'; break; case 'U': idx = 'Ú'; break;
+ case 'y': idx = 'ý'; break; case 'Y': idx = 'Ý'; break;
+ }
+ }
+ else if (strcmp(buf + 1, "grave") == 0) {
+ switch (*buf) {
+ case 'a': idx = 'à'; break; case 'e': idx = 'è'; break;
+ case 'i': idx = 'ì'; break; case 'o': idx = 'ò'; break;
+ case 'u': idx = 'ù'; break; case 'A': idx = 'À'; break;
+ case 'E': idx = 'È'; break; case 'I': idx = 'Ì'; break;
+ case 'O': idx = 'Ò'; break; case 'U': idx = 'Ù'; break;
+ }
+ }
+ else if (strcmp(buf + 1, "tilde") == 0) {
+ switch (*buf) {
+ case 'a': idx = 'ã'; break; case 'o': idx = 'õ'; break;
+ case 'n': idx = 'ñ'; break; case 'A': idx = 'Ã'; break;
+ case 'O': idx = 'Õ'; break; case 'N': idx = 'Ñ'; break;
+ }
+ }
+ else if (strcmp(buf + 1, "circ") == 0) {
+ switch (*buf) {
+ case 'a': idx = 'â'; break; case 'e': idx = 'ê'; break;
+ case 'i': idx = 'î'; break; case 'o': idx = 'ô'; break;
+ case 'u': idx = 'û'; break; case 'A': idx = 'Â'; break;
+ case 'E': idx = 'Ê'; break; case 'I': idx = 'Î'; break;
+ case 'O': idx = 'Ô'; break; case 'U': idx = 'Û'; break;
+ }
+ }
+ else if (strcmp(buf + 1, "uml") == 0) {
+ switch (*buf) {
+ case 'a': idx = 0xe4;break; case 'e': idx = 0xeb;break;
+ case 'i': idx = 0xef;break; case 'o': idx = 0xf6;break;
+ case 'u': idx = 'ü'; break; case 'A': idx = 0xc4;break;
+ case 'E': idx = 0xcb;break; case 'I': idx = 0xfc;break;
+ case 'O': idx = 0xd6;break; case 'U': idx = 'Ü'; break;
+ case 'y': idx = 0xff;break;
+ }
+ }
+ else if (strcmp(buf + 1, "cedil") == 0) {
+ switch (*buf) {
+ case 'c': idx = 'ç'; break; case 'C': idx = 'Ç'; break;
+ }
+ }
+ else if (strcmp(buf + 1, "slash") == 0) {
+ switch (*buf) {
+ case 'o': idx = 0xf8; break;case 'O': idx = 0xd8; break;
+ }
+ }
+ else if (strcmp(buf + 1, "ring") == 0) {
+ switch (*buf) {
+ case 'a': idx = 0xe5; break;case 'A': idx = 0xc5; break;
+ }
+ }
+ else if (strcasecmp(buf, "iexcl") == 0)
+ idx = 0xa1;
+ else if (strcasecmp(buf, "cent") == 0)
+ idx = 0xa2;
+ else if (strcasecmp(buf, "pound") == 0)
+ idx = 0xa3;
+ else if (strcasecmp(buf, "curren") == 0)
+ idx = 0xa4;
+ else if (strcasecmp(buf, "yen") == 0)
+ idx = 0xa5;
+ else if (strcasecmp(buf, "brvbar") == 0)
+ idx = 0xa6;
+ else if (strcasecmp(buf, "sect") == 0)
+ idx = 0xa7;
+ else if (strcasecmp(buf, "uml") == 0)
+ idx = 0xa8;
+ else if (strcasecmp(buf, "copy") == 0)
+ idx = 0xa9;
+ else if (strcasecmp(buf, "ordf") == 0)
+ idx = 'ª';
+ else if (strcasecmp(buf, "laquo") == 0)
+ idx = 0xab;
+ else if (strcasecmp(buf, "not") == 0)
+ idx = 0xac;
+ else if (strcasecmp(buf, "shy") == 0)
+ idx = 0xad;
+ else if (strcasecmp(buf, "reg") == 0)
+ idx = 0xae;
+ else if (strcasecmp(buf, "macr") == 0)
+ idx = 0xaf;
+ else if (strcasecmp(buf, "deg") == 0)
+ idx = '°';
+ else if (strcasecmp(buf, "plusmn") == 0)
+ idx = 0xb1;
+ else if (strcasecmp(buf, "sup2") == 0)
+ idx = '²';
+ else if (strcasecmp(buf, "sup3") == 0)
+ idx = '³';
+ else if (strcasecmp(buf, "acute") == 0)
+ idx = 0xb4;
+ else if (strcasecmp(buf, "micro") == 0)
+ idx = 0xb5;
+ else if (strcasecmp(buf, "para") == 0)
+ idx = 0xb6;
+ else if (strcasecmp(buf, "middot") == 0)
+ idx = 0xb7;
+ else if (strcasecmp(buf, "cedil") == 0)
+ idx = 0xb8;
+ else if (strcasecmp(buf, "supl") == 0)
+ idx = '¹';
+ else if (strcasecmp(buf, "ordm") == 0)
+ idx = 'º';
+ else if (strcasecmp(buf, "raquo") == 0)
+ idx = 0xbb;
+ else if (strcasecmp(buf, "frac14") == 0)
+ idx = 0xbc;
+ else if (strcasecmp(buf, "frac12") == 0)
+ idx = 0xbd;
+ else if (strcasecmp(buf, "frac34") == 0)
+ idx = 0xbe;
+ else if (strcasecmp(buf, "iquest") == 0)
+ idx = 0xbf;
+ else if (strcasecmp(buf, "AElig") == 0)
+ idx = 0xc6;
+ else if (strcasecmp(buf, "ETH") == 0)
+ idx = 0xd0;
+ else if (strcasecmp(buf, "THORN") == 0)
+ idx = 0xde;
+ else if (strcasecmp(buf, "szlig") == 0)
+ idx = 0xdf;
+ else if (strcasecmp(buf, "aelig") == 0)
+ idx = 0xe6;
+ else if (strcasecmp(buf, "eth") == 0)
+ idx = 0xf0;
+ else if (strcasecmp(buf, "thorn") == 0)
+ idx = 0xfe;
+
+ parser->quark = Qentity;
+ if (entities[idx] == NULL) {
+ entities[idx] = XtNew(XawTextBlock);
+ entities[idx]->firstPos = 0;
+ entities[idx]->length = 1;
+ entities[idx]->ptr = chars + idx;
+ entities[idx]->format = FMT8BIT;
+ chars[idx] = idx;
+ }
+ parser->entity = entities[idx];
+ parser->end = parser->offset;
+ Html_Commit(parser);
+ parser->start = parser->end;
+ }
+ }
+ /*NOTREACHED*/
+}
+
+/************************************************************************/
+/* FORMAT */
+/************************************************************************/
+static int
+Html_Put(Html_Parser *parser, int ch)
+{
+ if (ch != '\r') {
+ if (parser->replace.length % 4096 == 0)
+ parser->replace.ptr = XtRealloc(parser->replace.ptr,
+ parser->replace.length + 4096);
+ parser->replace.ptr[parser->replace.length++] = ch;
+ }
+
+ return (ch);
+}
+
+static void
+Html_Puts(Html_Parser *parser, char *str)
+{
+ int len = strlen(str);
+
+ if (parser->replace.length % 4096 == 0 ||
+ parser->replace.length + len > parser->replace.length +
+ (4096 - (parser->replace.length % 4096)))
+ parser->replace.ptr = XtRealloc(parser->replace.ptr,
+ parser->replace.length + 4096);
+ memcpy(parser->replace.ptr + parser->replace.length, str, len);
+ parser->replace.length += len;
+}
+
+static void
+Html_FormatTag(Html_Parser *parser)
+{
+ int ch = 0, sz = 0;
+ char buf[32];
+ Html_TagInfo *info = NULL;
+
+ switch (Html_Peek(parser)) {
+ case '!':
+ Html_Put(parser, '<');
+ Html_Put(parser, Html_Get(parser)); /* eat `!' */
+ if (Html_Peek(parser) == '-') {
+ /* comment */
+ Html_Put(parser, Html_Get(parser)); /* eat `-' */
+ if (Html_Peek(parser) == '-') {
+ int count = 0;
+
+ Html_Put(parser, Html_Get(parser));
+ while ((ch = Html_Peek(parser)) != EOF) {
+ if (ch == '>' && count >= 2)
+ break;
+ else if (ch == '-')
+ ++count;
+ else
+ count = 0;
+ Html_Put(parser, Html_Get(parser));
+ }
+ (void)Html_Get(parser); /* eat `>' */
+ Html_Put(parser, '>');
+ return;
+ }
+ }
+ break;
+ case '?':
+ Html_Put(parser, '<');
+ break;
+ case '/':
+ (void)Html_Get(parser); /* eat `/' */
+ while (isalnum(Html_Peek(parser)) &&
+ sz <= sizeof(buf) + 1)
+ buf[sz++] = ch = tolower(Html_Get(parser));
+ buf[sz] = '\0';
+ if ((info = Html_GetInfo(buf)) != NULL && info->adnl) {
+ if (info->ident == Qpre && parser->pre) {
+ if (--parser->pre == 0)
+ parser->column = 0;
+ }
+ parser->quark = Qetag;
+ parser->spc = True;
+ if (info->ident == Qp) {
+ while ((ch = Html_Peek(parser) != '>' && ch != EOF))
+ (void)Html_Get(parser);
+ (void)Html_Get(parser); /* eat '>' */
+ return;
+ }
+ }
+ else if (info) {
+ if (info->ident == Qol || info->ident == Qul) {
+ if (parser->list && --parser->list == 0 &&
+ parser->desc == 0) {
+ parser->quark = Qetag;
+ Html_Put(parser, '\n');
+ ++parser->adnl;
+ parser->column = 0;
+ }
+ }
+ else if (info->ident == Qdl) {
+ if (parser->desc && --parser->desc == 0 &&
+ parser->list == 0) {
+ parser->quark = Qetag;
+ Html_Put(parser, '\n');
+ ++parser->adnl;
+ parser->column = 0;
+ }
+ }
+ }
+ Html_Puts(parser, "</");
+ Html_Puts(parser, buf);
+ break;
+ default:
+ while (isalnum(Html_Peek(parser)) &&
+ sz <= sizeof(buf) + 1)
+ buf[sz++] = tolower(Html_Get(parser));
+ buf[sz] = '\0';
+ if ((info = Html_GetInfo(buf)) != NULL && info->adnl) {
+ if (info->ident == Qpre)
+ ++parser->pre;
+ if (parser->quark != Qtag) {
+ if (parser->adnl < 2) {
+ Html_Puts(parser, parser->adnl ? pnl : nlpnl);
+ parser->adnl = 2;
+ parser->spc = True;
+ parser->column = 0;
+ }
+ }
+ parser->quark = Qtag;
+ if (info->ident == Qp) {
+ while ((ch = Html_Peek(parser) != '>' && ch != EOF))
+ (void)Html_Get(parser);
+ (void)Html_Get(parser); /* eat '>' */
+ return;
+ }
+ }
+ else if (info) {
+ if (info->ident == Qol || info->ident == Qul) {
+ if (++parser->list == 1 && !parser->desc) {
+ if (parser->adnl < 2) {
+ Html_Puts(parser, parser->adnl ? pnl : nlpnl);
+ parser->adnl = 2;
+ parser->column = 0;
+ }
+ }
+ else if (parser->adnl == 0) {
+ Html_Put(parser, '\n');
+ parser->adnl = 1;
+ parser->column = 0;
+ }
+ parser->spc = True;
+ }
+ else if (info->ident == Qli) {
+ if (parser->adnl == 0) {
+ Html_Put(parser, '\n');
+ parser->adnl = 1;
+ parser->column = 0;
+ }
+ }
+
+ else if (info->ident == Qdl) {
+ if (++parser->desc == 1 && !parser->list) {
+ if (parser->adnl < 2) {
+ Html_Puts(parser, parser->adnl ? pnl : nlpnl);
+ parser->adnl = 2;
+ parser->column = 0;
+ }
+ }
+ else if (parser->adnl == 0) {
+ Html_Put(parser, '\n');
+ parser->adnl = 1;
+ parser->column = 0;
+ }
+ parser->spc = True;
+ }
+ else if (info->ident == Qdd) {
+ if (parser->desc == 0) {
+ if (parser->adnl < 2) {
+ Html_Puts(parser, parser->adnl ? pnl : nlpnl);
+ parser->adnl = 2;
+ parser->column = 0;
+ }
+ }
+ else if (parser->adnl == 0) {
+ Html_Put(parser, '\n');
+ parser->adnl = 1;
+ parser->column = 0;
+ }
+ parser->spc = True;
+ }
+ else if (info->ident == Qdt) {
+ if (parser->adnl == 0) {
+ Html_Put(parser, '\n');
+ parser->adnl = 1;
+ parser->spc = True;
+ parser->column = 0;
+ }
+ }
+ }
+ Html_Put(parser, '<');
+ Html_Puts(parser, buf);
+ break;
+ }
+
+ sz = 0;
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
+ if (isspace(ch)) {
+ (void)Html_Get(parser);
+ ++sz;
+ continue;
+ }
+ else if (sz) {
+ Html_Put(parser, ' ');
+ sz = 0;
+ }
+ Html_Put(parser, Html_Get(parser));
+ }
+ Html_Put(parser, Html_Get(parser)); /* eat `>' */
+ if (info && info->ident == Qbr) {
+ ++parser->adnl;
+ parser->spc = True;
+ Html_Put(parser, '\n');
+ parser->quark = info->ident;
+ parser->column = 0;
+ }
+}
+
+/* tags */
+static int
+Html_Format3(Html_Parser *parser)
+{
+ int ch;
+
+ for (;;) {
+ if ((ch = Html_Get(parser)) == '<') {
+ if (parser->quark == Qspace && parser->spc == False) {
+ Html_Put(parser, ' ');
+ parser->spc = True;
+ }
+
+/* parser->quark = Qhide;*/
+ Html_FormatTag(parser);
+ }
+ else
+ return (ch);
+ }
+ /*NOTREACHED*/
+}
+
+/* entities */
+static int
+Html_Format2(Html_Parser *parser)
+{
+ int ch;
+
+ for (ch = Html_Format3(parser); ch == '&'; ch = Html_Format3(parser)) {
+ Html_Put(parser, '&');
+ while ((ch = Html_Peek(parser)) != ';') {
+ if (isspace(ch) || ch == EOF)
+ break;
+ Html_Put(parser, Html_Get(parser));
+ }
+ if (ch != EOF)
+ Html_Put(parser, Html_Get(parser));
+ else
+ break;
+ if (parser->pre)
+ ++parser->column;
+ }
+
+ return (ch);
+}
+
+/* spaces */
+static int
+Html_Format1(Html_Parser *parser)
+{
+ int ch;
+
+ for (;;) {
+ if ((ch = Html_Format2(parser)) == EOF)
+ return (ch);
+
+ if (parser->quark == Qetag) {
+ if (parser->adnl < 2) {
+ Html_Puts(parser, parser->adnl ? pnl : nlpnl);
+ parser->adnl = 2;
+ parser->spc = True;
+ }
+ }
+ else if (parser->quark == Qspace && parser->spc == False) {
+ Html_Put(parser, ' ');
+ parser->spc = True;
+ }
+
+ if (!parser->pre && isspace(ch))
+ parser->quark = Qspace;
+ else {
+ if (parser->pre) {
+ if (parser->spc) {
+ /* did not yet see any non space character */
+ if (isspace(ch)) {
+ if (ch == '\n') {
+ parser->column = 0;
+ parser->spc = False;
+ parser->adnl = 1;
+ }
+ else if (ch == '\t')
+ parser->column += 8 - (parser->column % 8);
+ else
+ ++parser->column;
+ continue;
+ }
+ else {
+ int column = parser->column;
+
+ while (column-- > 0)
+ Html_Put(parser, ' ');
+ parser->spc = False;
+ parser->adnl = 0;
+ }
+ }
+ else if (ch == '\n') {
+ ++parser->adnl;
+ parser->column = 0;
+ }
+ else if (ch == '\t') {
+ int column = parser->column + (8 - (parser->column % 8));
+
+ parser->adnl = 0;
+ while (parser->column < column) {
+ Html_Put(parser, ' ');
+ ++parser->column;
+ }
+ continue;
+ }
+ else {
+ parser->adnl = 0;
+ ++parser->column;
+ }
+ }
+ else
+ parser->adnl = 0;
+ Html_Put(parser, ch);
+ parser->quark = Qdefault;
+ parser->spc = False;
+ }
+ }
+}
+
+/************************************************************************/
+/* ARGUMENTS */
+/************************************************************************/
+static void
+Html_AArgs(Html_Parser *parser, Html_Item *item)
+{
+ int ch, sz;
+ char buf[32];
+
+ /*CONSTCOND*/
+ while (True) {
+ sz = 0;
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
+ if (isalnum(ch))
+ break;
+ else
+ (void)Html_Get(parser);
+ }
+
+ if (ch == '>' || ch == EOF)
+ return;
+ buf[sz++] = tolower(Html_Get(parser));
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF)
+ if (isalnum(ch))
+ buf[sz++] = tolower(Html_Get(parser));
+ else
+ break;
+ buf[sz] = '\0';
+ if (strcmp(buf, "href") == 0) {
+ item->combine = XawTextSinkCopyProperty(XawTextGetSink(text),
+ item->info->ident);
+ item->override = True;
+ item->combine->xlfd_mask = 0L;
+ item->combine->mask = XAW_TPROP_UNDERLINE | XAW_TPROP_FOREGROUND;
+ item->combine->foreground = parser->alink;
+ return;
+ }
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
+ if (isspace(ch))
+ break;
+ else
+ (void)Html_Get(parser);
+ }
+ }
+}
+
+static void
+Html_FontArgs(Html_Parser *parser, Html_Item *item)
+{
+ int ch, sz;
+ char name[32], value[256], xlfd[128];
+
+ item->combine = XawTextSinkCopyProperty(XawTextGetSink(text),
+ Qdefault);
+ item->override = True;
+ item->combine->mask = item->combine->xlfd_mask = 0L;
+
+ /*CONSTCOND*/
+ while (True) {
+ /* skip white spaces */
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
+ if (isalnum(ch))
+ break;
+ else
+ (void)Html_Get(parser);
+ }
+
+ if (ch == '>' || ch == EOF)
+ return;
+
+ /* read option name */
+ sz = 0;
+ name[sz++] = tolower(Html_Get(parser));
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF)
+ if (isalnum(ch) && sz + 1 <= sizeof(name))
+ name[sz++] = tolower(Html_Get(parser));
+ else
+ break;
+ name[sz] = '\0';
+
+ if (ch != '=')
+ continue;
+ (void)Html_Get(parser); /* skip `=' */
+ if (Html_Peek(parser) == '"')
+ (void)Html_Get(parser);
+
+ sz = 0;
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
+ if (!isspace(ch) && sz + 1 <= sizeof(value))
+ value[sz++] = Html_Get(parser);
+ else
+ break;
+ }
+ value[sz] = '\0';
+ if (sz > 0 && value[sz - 1] == '"')
+ value[--sz] = '\0';
+
+ if (strcmp(name, "color") == 0) {
+ XColor color, exact;
+
+ if (XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap,
+ value, &color, &exact)) {
+ item->combine->mask |= XAW_TPROP_FOREGROUND;
+ item->combine->foreground = color.pixel;
+ }
+ }
+ else if (strcmp(name, "face") == 0) {
+ int count = 0;
+ char *ptr, *family, **font_list;
+
+ ptr = value;
+ do {
+ family = ptr;
+ ptr = strchr(ptr, ',');
+ if (ptr)
+ *ptr++ = '\0';
+ XmuSnprintf(xlfd, sizeof(xlfd), "-*-%s-*-*-*-*-*-*-*-*-*-*-*-*",
+ family);
+ font_list = XListFonts(XtDisplay(toplevel), xlfd, 1, &count);
+ if (font_list)
+ XFreeFontNames(font_list);
+ if (count)
+ break;
+ } while (ptr);
+ if (count) {
+ item->combine->xlfd_mask |= XAW_TPROP_FAMILY;
+ item->combine->family = XrmStringToQuark(family);
+ }
+ }
+ else if (strcmp(name, "size") == 0) {
+ int size, sign = 0;
+
+ if (isalnum(*value)) {
+ size = atoi(value);
+ sign = 0;
+ }
+ else {
+ char *str = XrmQuarkToString(item->combine->pixel_size);
+
+ size = str ? atoi(str) : 12;
+ if (*value == '+') {
+ size += atoi(value + 1);
+ sign = 1;
+ }
+ else if (*value == '-') {
+ size -= atoi(value + 1);
+ sign = -1;
+ }
+ }
+
+ if (item->combine->xlfd != NULLQUARK) {
+ int count, ucount, dcount, usize, dsize;
+ char **current, **result, **up, **down;
+
+ current = result = up = down = NULL;
+ /* try to load an appropriate font */
+ XmuSnprintf(value, sizeof(value),
+ "-*-%s-%s-%s-*--%%d-*-*-*-*-*-%s-%s",
+ XrmQuarkToString(item->combine->family),
+ XrmQuarkToString(item->combine->weight),
+ XrmQuarkToString(item->combine->slant),
+ XrmQuarkToString(item->combine->registry),
+ XrmQuarkToString(item->combine->encoding));
+ XmuSnprintf(xlfd, sizeof(xlfd), value,
+ atoi(XrmQuarkToString(item->combine->pixel_size)));
+ current = XListFonts(XtDisplay(toplevel), xlfd, 1, &count);
+ if (count) {
+ ucount = dcount = usize = dsize = 0;
+
+ XmuSnprintf(xlfd, sizeof(xlfd), value, size);
+ result = XListFonts(XtDisplay(toplevel), xlfd, 1, &count);
+ if (count == 0 || strstr(*result, "-0-")) {
+ if (sign <= 0) {
+ sz = dsize = size;
+ while (dcount == 0 && --sz > size - 8 && sz > 1) {
+ XmuSnprintf(xlfd, sizeof(xlfd), value, sz);
+ down = XListFonts(XtDisplay(toplevel), xlfd,
+ 1, &dcount);
+ if (dcount && strstr(*down, "-0-") != NULL) {
+ XFreeFontNames(down);
+ down = NULL;
+ dcount = 0;
+ }
+ }
+ if (dcount)
+ dsize = sz;
+ }
+ if (sign >= 0) {
+ sz = usize = size;
+ while (ucount == 0 && ++sz < size + 8) {
+ XmuSnprintf(xlfd, sizeof(xlfd), value, sz);
+ up = XListFonts(XtDisplay(toplevel), xlfd,
+ 1, &ucount);
+ if (ucount && strstr(*up, "-0-") != NULL) {
+ XFreeFontNames(up);
+ up = NULL;
+ ucount = 0;
+ }
+ }
+ if (ucount)
+ usize = sz;
+ }
+ if (ucount && dcount)
+ size = size - dsize < usize - size ? dsize : usize;
+ else if (ucount)
+ size = usize;
+ else if (dcount)
+ size = dsize;
+ }
+ if (current)
+ XFreeFontNames(current);
+ if (result)
+ XFreeFontNames(result);
+ if (up)
+ XFreeFontNames(up);
+ if (down)
+ XFreeFontNames(down);
+ }
+ }
+
+ XmuSnprintf(value, sizeof(value), "%d", size);
+ item->combine->xlfd_mask |= XAW_TPROP_PIXELSIZE;
+ item->combine->pixel_size = XrmStringToQuark(value);
+ }
+
+ while ((ch = Html_Peek(parser)) != '>' && ch != EOF) {
+ if (isspace(ch))
+ break;
+ else
+ (void)Html_Get(parser);
+ }
+ }
+}
diff --git a/hw/xfree86/utils/xorgcfg/help.h b/hw/xfree86/utils/xorgcfg/help.h
new file mode 100644
index 000000000..f03e01b14
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/help.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.h,v 1.1 2000/06/13 23:15:51 dawes Exp $
+ */
+
+/* help string definitions */
+#define HELP_DEVICES "helpDevices" /* Configure Layout */
+#define HELP_SCREEN "helpScreen" /* Configure Screen */
+#define HELP_MODELINE "helpModeline" /* Configure Modeline */
+#define HELP_ACCESSX "helpAccessX" /* Configure AccessX */
+
+/*
+ * Prototypes
+ */
+void Help(char*);
+void HelpCancelAction(Widget, XEvent*, String*, Cardinal*);
diff --git a/hw/xfree86/utils/xorgcfg/interface.c b/hw/xfree86/utils/xorgcfg/interface.c
new file mode 100644
index 000000000..68a1873ed
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/interface.c
@@ -0,0 +1,2280 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.37 2002/10/21 04:18:36 paulo Exp $
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/StringDefs.h>
+#include <X11/Composite.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Simple.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SmeLine.h>
+#include <X11/Xaw/SimpleMenP.h>
+#include <X11/Xaw/Dialog.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include "xf86config.h"
+#include "mouse-cfg.h"
+#include "keyboard-cfg.h"
+#include "card-cfg.h"
+#include "monitor-cfg.h"
+#include "screen-cfg.h"
+#include "screen.h"
+#include "cards.h"
+#include "options.h"
+#include "vidmode.h"
+#include "help.h"
+#include "stubs.h"
+
+#define randomize() srand((unsigned)time((time_t*)NULL))
+#ifdef PROJECT_ROOT
+#define DefaultXFree86Dir PROJECT_ROOT
+#else
+#define DefaultXFree86Dir "/usr/X11R6"
+#endif
+
+/*
+ * Prototypes
+ */
+void DrawCables(void);
+static void DrawCable(Display*, Window, int, int, int, int);
+static void ComputerEventHandler(Widget, XtPointer, XEvent*, Boolean*);
+void SelectDeviceAction(Widget, XEvent*, String*, Cardinal*);
+void MoveDeviceAction(Widget, XEvent*, String*, Cardinal*);
+void UnselectDeviceAction(Widget, XEvent*, String*, Cardinal*);
+void RenameLayoutAction(Widget, XEvent*, String*, Cardinal*);
+void DevicePopupMenu(Widget, XEvent*, String*, Cardinal*);
+void DevicePopdownMenu(Widget, XEvent*, String*, Cardinal*);
+void AddDeviceCallback(Widget, XtPointer, XtPointer);
+void QuitCallback(Widget, XtPointer, XtPointer);
+void SmeConfigureDeviceCallback(Widget, XtPointer, XtPointer);
+void ConfigureDeviceCallback(Widget, XtPointer, XtPointer);
+void EnableDeviceCallback(Widget, XtPointer, XtPointer);
+void DisableDeviceCallback(Widget, XtPointer, XtPointer);
+void RemoveDeviceCallback(Widget, XtPointer, XtPointer);
+void InitializeDevices(void);
+void SetConfigModeCallback(Widget, XtPointer, XtPointer);
+void SelectLayoutCallback(Widget, XtPointer, XtPointer);
+void DefaultLayoutCallback(Widget, XtPointer, XtPointer);
+void RemoveLayoutCallback(Widget, XtPointer, XtPointer);
+void OptionsCallback(Widget, XtPointer, XtPointer);
+xf86cfgDevice *AddDevice(int, XtPointer, int, int);
+static Bool AskConfig(void);
+void WriteConfigAction(Widget, XEvent*, String*, Cardinal*);
+static void ScreenSetup(Bool);
+void QuitAction(Widget, XEvent*, String*, Cardinal*);
+void PopdownErrorCallback(Widget, XtPointer, XtPointer);
+static void ErrorCancelAction(Widget, XEvent*, String*, Cardinal*);
+static void QuitCancelAction(Widget, XEvent*, String*, Cardinal*);
+static void HelpCallback(Widget, XtPointer, XtPointer);
+void UpdateMenuDeviceList(int);
+
+extern void AccessXConfigureStart(void);
+extern void AccessXConfigureEnd(void);
+extern void CloseAccessXAction(Widget, XEvent*, String*, Cardinal*);
+
+#ifdef HAS_NCURSES
+extern void TextMode(void);
+#endif
+
+static void Usage(void);
+
+/*
+ * Initialization
+ */
+Widget toplevel, work, config, layout, layoutsme, layoutp, topMenu;
+XtAppContext appcon;
+
+Pixmap menuPixmap;
+
+char *XF86Config_path = NULL;
+char *XF86Module_path = NULL;
+char *XFree86_path = NULL;
+char *XF86Font_path = NULL;
+char *XF86RGB_path = NULL;
+char *XkbConfig_path = NULL;
+char *XFree86Dir;
+static char XF86Config_path_static[1024];
+static char XkbConfig_path_static[1024];
+Bool xf86config_set = False;
+
+int textmode = False;
+#ifdef USE_MODULES
+int nomodules = False;
+#endif
+int noverify = False;
+
+xf86cfgComputer computer;
+xf86cfgDevice cpu_device;
+Cursor no_cursor;
+static Widget device, layoutm, popup, commands;
+static int xpos, ypos;
+int sxpos, sypos;
+static char no_cursor_data[] = { 0,0,0,0, 0,0,0,0 };
+static GC cablegc, cablegcshadow;
+Atom wm_delete_window;
+static Bool config_set = False;
+static Widget mouseSme, mouseMenu, keyboardSme, keyboardMenu,
+ cardSme, cardMenu, monitorSme, monitorMenu;
+
+int config_mode = CONFIG_LAYOUT;
+
+static XtActionsRec actions[] = {
+ {"filter-card", CardFilterAction},
+ {"select-device", SelectDeviceAction},
+ {"move-device", MoveDeviceAction},
+ {"unselect-device", UnselectDeviceAction},
+ {"device-popup", DevicePopupMenu},
+ {"device-popdown", DevicePopdownMenu},
+ {"rename-layout", RenameLayoutAction},
+ {"write-config", WriteConfigAction},
+ {"quit", QuitAction},
+ {"vidmode-restore", VidmodeRestoreAction},
+ {"config-cancel", ConfigCancelAction},
+ {"options-cancel", OptionsCancelAction},
+ {"error-cancel", ErrorCancelAction},
+ {"quit-cancel", QuitCancelAction},
+ {"addmode-cancel", CancelAddModeAction},
+ {"accessx-close", CloseAccessXAction},
+ {"testmode-cancel", CancelTestModeAction},
+ {"help-close", HelpCancelAction},
+ {"expert-close", ExpertCloseAction},
+#ifdef USE_MODULES
+ {"module-options-close", ModuleOptionsCancelAction},
+#endif
+};
+
+static char *device_names[] = {
+/* MOUSE */
+ "mouse",
+/* KEYBOARD */
+ "keyboard",
+/* CARD */
+ "card",
+/* MONITOR */
+ "monitor",
+/* SCREEN */
+ "screen",
+};
+
+static XtResource appResources[] = {
+#if 0
+ {"xf86config", "XF86Config", XtRString, sizeof(char*),
+ 0, XtRString, "/etc/X11/XF86Config"},
+#endif
+ {"menuBitmap", "MenuBitmap", XtRString, sizeof(char*),
+ 0, XtRString, "menu10"},
+};
+
+static void
+Usage(void)
+{
+ fprintf(stderr,
+"Usage:\n"
+" xf86cfg [-option ...]\n"
+"\n"
+"Options:\n"
+" -xf86config <XF86Config> Alternate configuration file.\n"
+" -modulepath <module-path> XFree86 modules location.\n"
+" -serverpath <server-path> X server to start (if $DISPLAY is not defined).\n"
+" -fontpath <font-path> Font path for fonts.\n"
+" -rgbpath <rgb-path> Where the rgb.txt file is located.\n"
+#ifdef HAS_NCURSES
+" -textmode Use this option for the text only interface.\n"
+#endif
+#ifdef USE_MODULES
+" -nomodules Use this option if xf86cfg is slow to start.\n"
+" -verbose <number> Verbosity used in the loader (default 1).\n"
+#endif
+" -verify Verify modules/options integrity.\n"
+);
+
+ exit(1);
+}
+
+/*
+ * Implementation
+ */
+int
+main(int argc, char *argv[])
+{
+ Widget pane, hpane, expert, popup, mouse, keyboard, card, monitor;
+ Widget bottom, sme, smemodeline, help, quit, layopt;
+ XColor color, tmp;
+ Pixmap pixmap;
+ XGCValues values;
+ XF86ConfLayoutPtr lay;
+ int i, startedx;
+ char *menuPixmapPath = NULL;
+ XrmValue from, to;
+
+ if ((XFree86Dir = getenv("XWINHOME")) == NULL)
+ XFree86Dir = DefaultXFree86Dir;
+
+ chdir(XFree86Dir);
+
+#ifdef USE_MODULES
+ xf86Verbose = 1;
+#endif
+ noverify = True;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-xf86config") == 0) {
+ if (i + 1 < argc) {
+ XF86Config_path = argv[++i];
+ config_set = True;
+ }
+ } else if (strcmp(argv[i], "-modulepath") == 0) {
+ if (i + 1 < argc)
+ XF86Module_path = argv[++i];
+ } else if (strcmp(argv[i], "-serverpath") == 0) {
+ if (i + 1 < argc)
+ XFree86_path = argv[++i];
+ } else if (strcmp(argv[i], "-fontpath") == 0) {
+ if (i + 1 < argc)
+ XF86Font_path = argv[++i];
+ } else if (strcmp(argv[i], "-rgbpath") == 0) {
+ if (i + 1 < argc)
+ XF86RGB_path = argv[++i];
+ }
+#ifdef HAS_NCURSES
+ else if (strcmp(argv[i], "-textmode") == 0)
+ textmode = True;
+#endif
+#ifdef USE_MODULES
+ else if (strcmp(argv[i], "-nomodules") == 0)
+ nomodules = True;
+ else if (strcmp(argv[i], "-verbose") == 0) {
+ if (i + 1 < argc)
+ xf86Verbose = atoi(argv[++i]);
+ }
+#endif
+ else if (strcmp(argv[i], "-verify") == 0)
+ noverify = False;
+ else
+ Usage();
+ }
+
+#ifdef HAS_NCURSES
+ if (textmode) {
+ TextMode();
+ exit(0);
+ }
+#endif
+
+ startedx = startx();
+ if (XF86Config_path == NULL)
+ XF86Config_path = XtNewString("XF86Config-4");
+ if (XkbConfig_path == NULL) {
+ XmuSnprintf(XkbConfig_path_static, sizeof(XkbConfig_path_static),
+ "%s/%s%s", XFree86Dir, XkbConfigDir, XkbConfigFile);
+ XkbConfig_path = XkbConfig_path_static;
+ }
+ toplevel = XtAppInitialize(&appcon, "XF86Cfg",
+ NULL, 0,
+ &argc, argv,
+ NULL, NULL, 0);
+ if (DPY == NULL)
+ DPY = XtDisplay(toplevel);
+
+ XtGetApplicationResources(toplevel, (XtPointer)&menuPixmapPath,
+ appResources, XtNumber(appResources), NULL, 0);
+ if (menuPixmapPath && strlen(menuPixmapPath)) {
+ from.size = strlen(menuPixmapPath);
+ from.addr = menuPixmapPath;
+ to.size = sizeof(Pixmap);
+ to.addr = (XtPointer)&(menuPixmap);
+ XtConvertAndStore(toplevel, XtRString, &from, XtRBitmap, &to);
+ }
+
+ XtAppAddActions(appcon, actions, XtNumber(actions));
+
+ XawSimpleMenuAddGlobalActions(appcon);
+ XtRegisterGrabAction(DevicePopupMenu, True,
+ ButtonPressMask | ButtonReleaseMask,
+ GrabModeAsync, GrabModeAsync);
+
+ pane = XtCreateManagedWidget("pane", panedWidgetClass,
+ toplevel, NULL, 0);
+ hpane = XtVaCreateManagedWidget("hpane", panedWidgetClass, pane,
+ XtNorientation, XtorientHorizontal, NULL, 0);
+ topMenu = XtCreateManagedWidget("topM", menuButtonWidgetClass,
+ hpane, NULL, 0);
+ expert = XtCreateManagedWidget("expert", commandWidgetClass, hpane, NULL, 0);
+ XtAddCallback(expert, XtNcallback, ExpertCallback, NULL);
+ popup = XtCreatePopupShell("menu", simpleMenuWidgetClass,
+ topMenu, NULL, 0);
+ sme = XtCreateManagedWidget("layout", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(sme, XtNcallback, SetConfigModeCallback,
+ (XtPointer)CONFIG_LAYOUT);
+ sme = XtCreateManagedWidget("screen", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(sme, XtNcallback, SetConfigModeCallback,
+ (XtPointer)CONFIG_SCREEN);
+ smemodeline = XtCreateManagedWidget("modeline", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(smemodeline, XtNcallback, SetConfigModeCallback,
+ (XtPointer)CONFIG_MODELINE);
+ sme = XtCreateManagedWidget("accessx", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(sme, XtNcallback, SetConfigModeCallback,
+ (XtPointer)CONFIG_ACCESSX);
+
+ commands = XtCreateManagedWidget("commands", formWidgetClass,
+ pane, NULL, 0);
+
+ mouse = XtVaCreateManagedWidget("mouse", menuButtonWidgetClass,
+ commands, XtNmenuName, "mouseP", NULL, 0);
+ popup = XtCreatePopupShell("mouseP", simpleMenuWidgetClass,
+ mouse, NULL, 0);
+ sme = XtCreateManagedWidget("new", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(sme, XtNcallback, AddDeviceCallback, (XtPointer)MOUSE);
+ mouseSme = XtCreateManagedWidget("configure", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(mouseSme, XtNcallback, SmeConfigureDeviceCallback,
+ (XtPointer)MOUSE);
+
+ keyboard = XtVaCreateManagedWidget("keyboard", menuButtonWidgetClass,
+ commands, XtNmenuName, "keyboardP", NULL, 0);
+ popup = XtCreatePopupShell("keyboardP", simpleMenuWidgetClass,
+ keyboard, NULL, 0);
+ sme = XtCreateManagedWidget("new", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(sme, XtNcallback, AddDeviceCallback, (XtPointer)KEYBOARD);
+ keyboardSme = XtCreateManagedWidget("configure", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(keyboardSme, XtNcallback, SmeConfigureDeviceCallback,
+ (XtPointer)KEYBOARD);
+
+ card = XtVaCreateManagedWidget("card", menuButtonWidgetClass,
+ commands, XtNmenuName, "cardP", NULL, 0);
+ popup = XtCreatePopupShell("cardP", simpleMenuWidgetClass,
+ card, NULL, 0);
+ sme = XtCreateManagedWidget("new", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(sme, XtNcallback, AddDeviceCallback, (XtPointer)CARD);
+ cardSme = XtCreateManagedWidget("configure", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(cardSme, XtNcallback, SmeConfigureDeviceCallback,
+ (XtPointer)CARD);
+
+ monitor = XtVaCreateManagedWidget("monitor", menuButtonWidgetClass,
+ commands, XtNmenuName, "monitorP", NULL, 0);
+ popup = XtCreatePopupShell("monitorP", simpleMenuWidgetClass,
+ monitor, NULL, 0);
+ sme = XtCreateManagedWidget("new", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(sme, XtNcallback, AddDeviceCallback, (XtPointer)MONITOR);
+ monitorSme = XtCreateManagedWidget("configure", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(monitorSme, XtNcallback, SmeConfigureDeviceCallback,
+ (XtPointer)MONITOR);
+
+ work = XtCreateManagedWidget("work", compositeWidgetClass,
+ pane, NULL, 0);
+
+ bottom = XtCreateManagedWidget("bottom", formWidgetClass,
+ pane, NULL, 0);
+ layoutm = XtCreateManagedWidget("select", menuButtonWidgetClass,
+ bottom, NULL, 0);
+ layout = XtVaCreateManagedWidget("layout", asciiTextWidgetClass,
+ bottom,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ layoutp = XtCreatePopupShell("menu", simpleMenuWidgetClass,
+ bottom, NULL, 0);
+ sme = XtCreateManagedWidget("new", smeBSBObjectClass, layoutp,
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, SelectLayoutCallback, NULL);
+ help = XtCreateManagedWidget("help", commandWidgetClass,
+ bottom, NULL, 0);
+ XtAddCallback(help, XtNcallback, HelpCallback, NULL);
+ quit = XtCreateManagedWidget("quit", commandWidgetClass,
+ bottom, NULL, 0);
+ XtAddCallback(quit, XtNcallback, QuitCallback, NULL);
+
+ XtRealizeWidget(toplevel);
+ XtRealizeWidget(topMenu);
+
+ pixmap = XCreateBitmapFromData(XtDisplay(toplevel), XtWindow(toplevel),
+ no_cursor_data, 8, 8);
+ XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "black",
+ &color, &tmp);
+ no_cursor = XCreatePixmapCursor(XtDisplay(toplevel), pixmap, pixmap,
+ &color, &color, 0, 0);
+
+ XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray55",
+ &color, &tmp);
+ values.line_width = 3;
+ values.foreground = color.pixel;
+ cablegcshadow = XCreateGC(XtDisplay(toplevel), XtWindow(toplevel),
+ GCForeground | GCLineWidth, &values);
+ XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray85",
+ &color, &tmp);
+ values.line_width = 1;
+ values.foreground = color.pixel;
+ cablegc = XCreateGC(XtDisplay(toplevel), XtWindow(toplevel),
+ GCForeground | GCLineWidth, &values);
+
+ computer.cpu = XtCreateManagedWidget("cpu", simpleWidgetClass,
+ work, NULL, 0);
+ cpu_device.widget = computer.cpu;
+ cpu_device.type = SERVER;
+
+ XtAddEventHandler(work, ExposureMask, False,
+ ComputerEventHandler, (XtPointer)NULL);
+
+ wm_delete_window = XInternAtom(DPY, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols(DPY, XtWindow(toplevel), &wm_delete_window, 1);
+
+ StartConfig();
+ InitializeDevices();
+ UpdateMenuDeviceList(MOUSE);
+ UpdateMenuDeviceList(KEYBOARD);
+ UpdateMenuDeviceList(CARD);
+ UpdateMenuDeviceList(MONITOR);
+ XtSetSensitive(smemodeline, VideoModeInitialize());
+
+ lay = XF86Config->conf_layout_lst;
+ while (lay != NULL) {
+ sme = XtVaCreateManagedWidget("sme", smeBSBObjectClass,
+ layoutp,
+ XtNlabel, lay->lay_identifier,
+ XtNmenuName, lay->lay_identifier,
+ XtNleftBitmap, menuPixmap,
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, SelectLayoutCallback, (XtPointer)lay);
+ if (layoutsme == NULL)
+ layoutsme = sme;
+ layopt = XtCreatePopupShell(lay->lay_identifier, simpleMenuWidgetClass,
+ layoutp, NULL, 0);
+ sme = XtCreateManagedWidget("default", smeBSBObjectClass,
+ layopt, NULL, 0);
+ XtAddCallback(sme, XtNcallback, DefaultLayoutCallback, NULL);
+ sme = XtCreateManagedWidget("remove", smeBSBObjectClass,
+ layopt, NULL, 0);
+ XtAddCallback(sme, XtNcallback, RemoveLayoutCallback, NULL);
+ XtRealizeWidget(layopt);
+
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+ SelectLayoutCallback(layoutsme,
+ XF86Config->conf_layout_lst, NULL);
+
+ startaccessx();
+ if (startedx) {
+ switch (fork()) {
+ case 0: {
+ char path[PATH_MAX];
+
+ XmuSnprintf(path, sizeof(path), "%s/bin/twm", XFree86Dir);
+ execl(path, "twm", (void *)NULL);
+ exit(-127);
+ } break;
+ case -1:
+ fprintf(stderr, "Cannot fork.\n");
+ exit(1);
+ break;
+ default:
+ break;
+ }
+ }
+
+#ifdef USE_MODULES
+ if (!nomodules)
+ LoaderInitializeOptions();
+#endif
+
+ /* ReadCardsDatabase() must be called after LoaderInitializeOptions() */
+ ReadCardsDatabase();
+
+ if (!config_set && startedx) {
+ XtFree(XF86Config_path);
+#ifdef XF86CONFIG
+# ifdef XF86CONFIGDIR
+ XF86Config_path = XtNewString(XF86CONFIGDIR "/" XF86CONFIG);
+# else
+ XF86Config_path = XtNewString("/etc/X11/" XF86CONFIG);
+# endif
+#else
+# ifdef XF86CONFIGDIR
+ XF86Config_path = XtNewString(XF86CONFIGDIR "/XF86Config-4");
+# else
+ XF86Config_path = XtNewString("/etc/X11/XF86Config-4");
+# endif
+#endif
+ }
+ XtAppMainLoop(appcon);
+ if (startedx)
+ endx();
+
+ return (0);
+}
+
+static Widget shell_cf;
+static int write_cf, asking_cf;
+static int cf_state = 0;
+#define CF_XF86Config 1
+#define CF_XKBConfig 2
+#define CF_First CF_XF86Config
+#define CF_Last CF_XKBConfig
+
+/*ARGSUSED*/
+static void
+WriteConfig(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ asking_cf = 0;
+ XtPopdown(shell_cf);
+ write_cf = (long)user_data;
+}
+
+/*ARGSUSED*/
+void
+QuitCancelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ WriteConfig(w, (XtPointer)-1, NULL);
+}
+
+/*ARGSUSED*/
+void
+WriteConfigAction(Widget w, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ WriteConfig(w, (XtPointer)True, NULL);
+}
+
+static Bool
+AskConfig(void)
+{
+ static Widget dialog;
+
+ if (shell_cf == NULL) {
+ Arg args[1];
+ char *l, *label;
+ int len;
+
+ shell_cf = XtCreatePopupShell("quit", transientShellWidgetClass,
+ toplevel, NULL, 0);
+ dialog = XtVaCreateManagedWidget("ask", dialogWidgetClass, shell_cf,
+ XtNvalue, XF86Config_path, NULL, 0);
+ XawDialogAddButton(dialog, "yes", WriteConfig, (XtPointer)1);
+ XawDialogAddButton(dialog, "no", WriteConfig, (XtPointer)0);
+ XawDialogAddButton(dialog, "cancel", WriteConfig, (XtPointer)-1);
+ XtRealizeWidget(shell_cf);
+ XSetWMProtocols(DPY, XtWindow(shell_cf), &wm_delete_window, 1);
+ XtSetArg(args[0], XtNlabel, &l);
+ XtGetValues(dialog, args, 1);
+ label = XtMalloc(len = (strlen(l) + strlen(XF86CONFIG) + 2));
+ XmuSnprintf(label, len, "%s\n", XF86CONFIG);
+ strcat(label, l);
+ XtSetArg(args[0], XtNlabel, label);
+ XtSetValues(dialog, args, 1);
+ XtFree(label);
+ }
+ else {
+ Arg args[2];
+ Cardinal num_args = 0;
+ char *l, *label = NULL, *str = "";
+
+ XtSetArg(args[0], XtNlabel, &l);
+ XtGetValues(dialog, args, 1);
+ switch (cf_state) {
+ case CF_XF86Config:
+ str = XF86CONFIG;
+ XtSetArg(args[num_args], XtNvalue, XF86Config_path);
+ ++num_args;
+ break;
+ case CF_XKBConfig:
+ str = "XKB";
+ XtSetArg(args[num_args], XtNvalue, XkbConfig_path);
+ ++num_args;
+ break;
+ }
+ l = strchr(l, '\n');
+ if (l != NULL) {
+ label = XtMalloc(strlen(str) + strlen(l) + 1);
+ strcpy(label, str);
+ strcat(label, l);
+ XtSetArg(args[num_args], XtNlabel, label);
+ ++num_args;
+ }
+ XtSetValues(dialog, args, num_args);
+ if (l != NULL)
+ XtFree(label);
+ }
+
+ asking_cf = 1;
+
+ XtPopup(shell_cf, XtGrabExclusive);
+ while (asking_cf)
+ XtAppProcessEvent(XtWidgetToApplicationContext(shell_cf), XtIMAll);
+
+ if (write_cf > 0) {
+ switch (cf_state) {
+ case CF_XF86Config:
+ XF86Config_path = XawDialogGetValueString(dialog);
+ XmuSnprintf(XF86Config_path_static,
+ sizeof(XF86Config_path_static),
+ "%s", XF86Config_path);
+ XF86Config_path = XF86Config_path_static;
+ break;
+ case CF_XKBConfig:
+ XkbConfig_path = XawDialogGetValueString(dialog);
+ XmuSnprintf(XkbConfig_path_static,
+ sizeof(XkbConfig_path_static),
+ "%s", XkbConfig_path);
+ XkbConfig_path = XkbConfig_path_static;
+ break;
+ }
+ }
+
+ return (write_cf);
+}
+
+/*ARGSUSED*/
+void
+PopdownErrorCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XtPopdown((Widget)user_data);
+}
+
+/*ARGSUSED*/
+void
+ErrorCancelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ XtPopdown((Widget)w);
+}
+
+/*ARGSUSED*/
+void
+QuitAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ QuitCallback(w, NULL, NULL);
+}
+
+/*ARGSUSED*/
+void
+QuitCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ for (cf_state = CF_First; cf_state <= CF_Last; cf_state++) {
+ if (cf_state == CF_XKBConfig && xkb_info == NULL)
+ continue;
+
+ switch (AskConfig()) {
+ case 0:
+ break;
+ case 1:
+ if ((cf_state == CF_XF86Config &&
+ !xf86writeConfigFile(XF86Config_path, XF86Config)) ||
+ (cf_state == CF_XKBConfig &&
+ !WriteXKBConfiguration(XkbConfig_path,
+ &xkb_info->config))) {
+ static Widget shell;
+
+ if (shell == NULL) {
+ Widget dialog;
+
+ shell = XtCreatePopupShell("error",
+ transientShellWidgetClass,
+ toplevel, NULL, 0);
+ dialog = XtVaCreateManagedWidget("notice",
+ dialogWidgetClass,
+ shell, XtNvalue, NULL,
+ NULL, 0);
+ XawDialogAddButton(dialog, "ok", PopdownErrorCallback,
+ (XtPointer)shell);
+ XtRealizeWidget(shell);
+ XSetWMProtocols(DPY, XtWindow(shell),
+ &wm_delete_window, 1);
+ }
+ XtPopup(shell, XtGrabExclusive);
+ return;
+ }
+ break;
+ default:
+ return;
+ }
+ }
+
+ endx();
+ exit(0);
+}
+
+void
+InitializeDevices(void)
+{
+ xf86cfgDevice *device;
+ int mouse_x, mouse_y, keyboard_x, keyboard_y,
+ card_x, card_y, monitor_x, monitor_y, len;
+ XF86ConfInputPtr input = XF86Config->conf_input_lst;
+ XF86ConfDevicePtr card = XF86Config->conf_device_lst;
+ XF86ConfMonitorPtr monitor = XF86Config->conf_monitor_lst;
+ XF86OptionPtr flags = NULL;
+ char buffer[4096], *tip;
+ Arg args[1];
+
+ if (XF86Config->conf_flags != NULL)
+ flags = XF86Config->conf_flags->flg_option_lst;
+
+ len = 0;
+ while (flags && len < sizeof(buffer) - 1) {
+ len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
+ "Option \"%s\"",
+ flags->opt_name);
+ if (flags->opt_val != NULL)
+ len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
+ " \"%s\"\n",
+ flags->opt_val);
+ else
+ len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
+ "%s", "\n");
+ flags = (XF86OptionPtr)(flags->list.next);
+ }
+
+ if (len) {
+ tip = XtNewString(buffer);
+ XtSetArg(args[0], XtNtip, tip);
+ XtSetValues(computer.cpu, args, 1);
+ }
+
+#define DEFAULT_MOUSE_WIDTH 30
+#define DEFAULT_MOUSE_HEIGHT 40
+#define DEFAULT_KEYBOARD_WIDTH 48
+#define DEFAULT_KEYBOARD_HEIGHT 36
+ mouse_x = work->core.width - (work->core.width >> 2);
+ mouse_y = work->core.height - DEFAULT_MOUSE_HEIGHT;
+ keyboard_x = 6;
+ keyboard_y = work->core.height - DEFAULT_KEYBOARD_HEIGHT;
+
+ while (input != NULL) {
+ if (input->inp_driver) {
+ if (strcasecmp(input->inp_driver, "mouse") == 0) {
+ device = AddDevice(MOUSE, (XtPointer)input, mouse_x, mouse_y);
+ SetTip(device);
+ if ((mouse_x += DEFAULT_MOUSE_WIDTH) > work->core.width) {
+ if ((mouse_y -= DEFAULT_MOUSE_HEIGHT) < (work->core.height >> 1))
+ mouse_y = work->core.height >> 1;
+ mouse_x = work->core.width - (work->core.width >> 2);
+ }
+ }
+ else if (strcasecmp(input->inp_driver, "keyboard") == 0) {
+ device = AddDevice(KEYBOARD, (XtPointer)input, keyboard_x, keyboard_y);
+ SetTip(device);
+ if ((keyboard_x += DEFAULT_KEYBOARD_WIDTH) >
+ work->core.width - (work->core.width >> 2)) {
+ if ((keyboard_y -= DEFAULT_KEYBOARD_HEIGHT) < (work->core.height >> 1))
+ keyboard_y = work->core.height >> 1;
+ keyboard_x = 6;
+ }
+ }
+ }
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+
+#define DEFAULT_CARD_WIDTH 45
+#define DEFAULT_CARD_HEIGHT 46
+ card_x = 6;
+ card_y = (work->core.height >> 1) - 20 - DEFAULT_CARD_HEIGHT;
+ while (card != NULL) {
+ device = AddDevice(CARD, (XtPointer)card, card_x, card_y);
+ SetTip(device);
+ if ((card_x += DEFAULT_CARD_WIDTH) > work->core.width) {
+ if ((card_y -= DEFAULT_CARD_HEIGHT) < (work->core.height >> 2))
+ card_y = work->core.height >> 2;
+ card_x = 6;
+ }
+ card = (XF86ConfDevicePtr)(card->list.next);
+ }
+
+#define DEFAULT_MONITOR_WIDTH 48
+#define DEFAULT_MONITOR_HEIGHT 48
+ monitor_x = 6;
+ monitor_y = 6;
+ while (monitor != NULL) {
+ XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
+
+ device = AddDevice(MONITOR, (XtPointer)monitor, monitor_x, monitor_y);
+ SetTip(device);
+ if ((monitor_x += DEFAULT_MONITOR_WIDTH) > work->core.width) {
+ if ((monitor_y += DEFAULT_MONITOR_HEIGHT) >
+ (work->core.height >> 2) - DEFAULT_MONITOR_HEIGHT)
+ monitor_y = (work->core.height >> 2) - DEFAULT_MONITOR_HEIGHT;
+ monitor_x = 6;
+ }
+
+ while (screen != NULL) {
+ if (screen->scrn_monitor == monitor) {
+ card = XF86Config->conf_device_lst;
+ while (card != NULL) {
+ if (screen->scrn_device == card) {
+ xf86cfgScreen *scr = (xf86cfgScreen*)
+ XtCalloc(1, sizeof(xf86cfgScreen));
+ int i;
+
+ for (i = 0; i < computer.num_devices; i++)
+ if ((XF86ConfDevicePtr)(computer.devices[i]->config)
+ == card)
+ break;
+ scr->screen = screen;
+ scr->card = computer.devices[i];
+ scr->monitor = device;
+ scr->refcount = 0;
+ ++scr->card->refcount;
+ ++scr->monitor->refcount;
+ computer.screens = (xf86cfgScreen**)
+ XtRealloc((XtPointer)computer.screens,
+ sizeof(xf86cfgScreen*) *
+ (computer.num_screens + 1));
+ CreateScreenWidget(scr);
+ scr->type = SCREEN;
+ computer.screens[computer.num_screens++] = scr;
+ SetTip((xf86cfgDevice*)scr);
+ break;
+ }
+ card = (XF86ConfDevicePtr)(card->list.next);
+ }
+ device->state = USED;
+ }
+ screen = (XF86ConfScreenPtr)(screen->list.next);
+ }
+
+ monitor = (XF86ConfMonitorPtr)(monitor->list.next);
+ }
+}
+
+xf86cfgDevice *
+AddDevice(int type, XtPointer config, int x, int y)
+{
+ switch (type) {
+ case MOUSE:
+ case KEYBOARD:
+ case CARD:
+ case MONITOR:
+ computer.devices = (xf86cfgDevice**)
+ XtRealloc((XtPointer)computer.devices,
+ sizeof(xf86cfgDevice*) * (computer.num_devices + 1));
+ computer.devices[computer.num_devices] = (xf86cfgDevice*)
+ XtCalloc(1, sizeof(xf86cfgDevice));
+ computer.devices[computer.num_devices]->config = config;
+ computer.devices[computer.num_devices]->widget =
+ XtVaCreateManagedWidget(device_names[type], simpleWidgetClass,
+ work,
+ XtNx, x,
+ XtNy, y,
+ XtNtip, NULL,
+ NULL, 0);
+ computer.devices[computer.num_devices]->type = type;
+ computer.devices[computer.num_devices]->state = UNUSED;
+ computer.devices[computer.num_devices]->refcount = 0;
+ ++computer.num_devices;
+ break;
+ default:
+ fprintf(stderr, "Bad argument to AddDevice.\n");
+ exit(1);
+ return (NULL);
+ }
+
+ UpdateMenuDeviceList(type);
+
+ return (computer.devices[computer.num_devices - 1]);
+}
+
+/*ARGSUSED*/
+static void
+HelpCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ char *topic = NULL;
+
+ switch (config_mode) {
+ case CONFIG_LAYOUT:
+ topic = HELP_DEVICES;
+ break;
+ case CONFIG_SCREEN:
+ topic = HELP_SCREEN;
+ break;
+ case CONFIG_MODELINE:
+ topic = HELP_MODELINE;
+ break;
+ case CONFIG_ACCESSX:
+ topic = HELP_ACCESSX;
+ break;
+ }
+ Help(topic);
+}
+
+void
+SelectLayoutCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i, j;
+ XF86ConfLayoutPtr lay = (XF86ConfLayoutPtr)user_data;
+ XF86ConfInputrefPtr input;
+ XF86ConfAdjacencyPtr adj;
+ Widget sme, layopt;
+ Arg args[1];
+ char *str;
+
+ /* XXX Needs to check computer.layout,
+ * because this function should also create
+ * a new layout...
+ */
+ if (lay == computer.layout && computer.layout)
+ return;
+
+ if (computer.layout != NULL) {
+ for (i = 0; i < computer.num_layouts; i++) {
+ if (computer.layouts[i]->layout == computer.layout)
+ break;
+ }
+ if (i < computer.num_layouts) {
+ XtFree((XtPointer)computer.layouts[i]->screen);
+ XtFree((XtPointer)computer.layouts[i]->position);
+ }
+ else {
+ computer.layouts = (xf86cfgLayout**)
+ XtRealloc((XtPointer)computer.layouts, sizeof(xf86cfgLayout*) *
+ (computer.num_layouts + 1));
+ ++computer.num_layouts;
+ }
+ computer.layouts[i] = (xf86cfgLayout*)XtCalloc(1, sizeof(xf86cfgLayout));
+ computer.layouts[i]->layout = computer.layout;
+ computer.layouts[i]->num_layouts = computer.num_screens;
+ computer.layouts[i]->screen = (xf86cfgScreen**)
+ XtMalloc(sizeof(xf86cfgScreen*) * computer.num_screens);
+ computer.layouts[i]->position = (XPoint*)
+ XtMalloc(sizeof(XPoint) * computer.num_screens);
+ for (j = 0; j < computer.num_screens; j++) {
+ computer.layouts[i]->screen[j] = computer.screens[j];
+ computer.layouts[i]->position[j].x = computer.screens[j]->widget->core.x;
+ computer.layouts[i]->position[j].y = computer.screens[j]->widget->core.y;
+ }
+ }
+
+ if (lay != NULL) {
+ for (i = 0; i < computer.num_layouts; i++)
+ if (computer.layouts[i]->layout == lay) {
+ for (j = 0; j < computer.layouts[i]->num_layouts; j++) {
+ int k;
+
+ for (k = 0; k < computer.num_screens; k++)
+ if (computer.screens[k] == computer.layouts[i]->screen[j]) {
+ XtMoveWidget(computer.screens[k]->widget,
+ computer.layouts[i]->position[j].x,
+ computer.layouts[i]->position[j].y);
+ }
+ }
+ break;
+ }
+
+ layoutsme = w;
+ XtSetArg(args[0], XtNlabel, &str);
+ XtGetValues(w, args, 1);
+ XtSetArg(args[0], XtNstring, str);
+ XtSetValues(layout, args, 1);
+ }
+
+ computer.layout = lay;
+
+ for (i = 0; i < computer.num_devices; i++)
+ computer.devices[i]->state = UNUSED;
+ for (i = 0; i < computer.num_screens; i++)
+ computer.screens[i]->state = UNUSED;
+
+ if (lay == NULL) {
+ char name[64];
+ XF86ConfLayoutPtr l;
+ int num_layouts = 0;
+
+ l = XF86Config->conf_layout_lst;
+ while (l != NULL) {
+ if (l->lay_adjacency_lst == NULL &&
+ l->lay_inactive_lst == NULL &&
+ l->lay_input_lst == NULL &&
+ l->lay_option_lst == NULL &&
+ l->lay_comment == NULL) {
+ for (i = 0;
+ i < ((CompositeWidget)layout)->composite.num_children; i++)
+ if (strcmp(XtName(((CompositeWidget)layout)->composite.
+ children[i]), l->lay_identifier) == 0) {
+ layoutsme = ((CompositeWidget)layout)->composite.children[i];
+ }
+ computer.layout = l;
+ XtSetArg(args[0], XtNstring, l->lay_identifier);
+ XtSetValues(layout, args, 1);
+ if (config_mode == CONFIG_LAYOUT)
+ DrawCables();
+ if (config_mode == CONFIG_SCREEN)
+ ScreenSetup(True);
+ return;
+ }
+ ++num_layouts;
+ l = (XF86ConfLayoutPtr)(l->list.next);
+ }
+ do {
+ XmuSnprintf(name, sizeof(name), "Layout%d", num_layouts);
+ ++num_layouts;
+ } while (xf86findLayout(name,
+ XF86Config->conf_layout_lst) != NULL);
+ l = (XF86ConfLayoutPtr)XtCalloc(1, sizeof(XF86ConfLayoutRec));
+
+ l->lay_identifier = XtNewString(name);
+ XF86Config->conf_layout_lst =
+ xf86addLayout(XF86Config->conf_layout_lst, l);
+ layoutsme = XtVaCreateManagedWidget("sme", smeBSBObjectClass,
+ layoutp,
+ XtNlabel, name,
+ XtNmenuName, l->lay_identifier,
+ XtNleftBitmap, menuPixmap,
+ NULL, 0);
+ XtAddCallback(layoutsme, XtNcallback,
+ SelectLayoutCallback, (XtPointer)l);
+
+ layopt = XtCreatePopupShell(l->lay_identifier, simpleMenuWidgetClass,
+ layoutp, NULL, 0);
+ sme = XtCreateManagedWidget("default", smeBSBObjectClass,
+ layopt, NULL, 0);
+ XtAddCallback(sme, XtNcallback, DefaultLayoutCallback, NULL);
+ sme = XtCreateManagedWidget("remove", smeBSBObjectClass,
+ layopt, NULL, 0);
+ XtAddCallback(sme, XtNcallback, RemoveLayoutCallback, NULL);
+ XtRealizeWidget(layopt);
+
+ computer.layout = l;
+ XtSetArg(args[0], XtNstring, name);
+ XtSetValues(layout, args, 1);
+ if (config_mode == CONFIG_LAYOUT)
+ DrawCables();
+ if (config_mode == CONFIG_SCREEN)
+ ScreenSetup(True);
+ return;
+ }
+
+ input = lay->lay_input_lst;
+ adj = lay->lay_adjacency_lst;
+
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->config != NULL &&
+ (computer.devices[i]->type == MOUSE ||
+ computer.devices[i]->type == KEYBOARD)) {
+ while (input != NULL) {
+ if (strcmp(input->iref_inputdev_str, ((XF86ConfInputPtr)
+ (computer.devices[i]->config))->inp_identifier) == 0) {
+ computer.devices[i]->state = USED;
+ break;
+ }
+ input = (XF86ConfInputrefPtr)(input->list.next);
+ }
+ input = lay->lay_input_lst;
+ }
+
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->type == CARD) {
+ while (adj != NULL) {
+ XF86ConfScreenPtr screen = adj->adj_screen;
+
+ if (computer.devices[i]->config != NULL &&
+ strcmp(screen->scrn_device_str, ((XF86ConfDevicePtr)
+ (computer.devices[i]->config))->dev_identifier) == 0) {
+ int j;
+
+ for (j = 0; j < computer.num_screens; j++)
+ if (computer.screens[j]->card == computer.devices[i])
+ break;
+ computer.screens[j]->card->state = USED;
+ if (computer.screens[j]->monitor != NULL)
+ computer.screens[j]->monitor->state = USED;
+ computer.screens[j]->state = USED;
+ }
+
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+ adj = lay->lay_adjacency_lst;
+ }
+
+ if (config_mode == CONFIG_LAYOUT)
+ DrawCables();
+ else if (config_mode == CONFIG_SCREEN)
+ ScreenSetup(True);
+}
+
+/*ARGSUSED*/
+void
+DefaultLayoutCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Widget layopt, sme;
+ int i;
+ char *str;
+ XF86ConfLayoutPtr prev, tmp, lay;
+
+ str = w && XtParent(w) ? XtName(XtParent(w)) : NULL;
+ if (str == NULL)
+ return;
+
+ prev = XF86Config->conf_layout_lst;
+ lay = xf86findLayout(str, prev);
+ if (prev == lay)
+ return;
+
+ tmp = prev;
+ while (tmp != NULL) {
+ if (tmp == lay)
+ break;
+ prev = tmp;
+ tmp = (XF86ConfLayoutPtr)(tmp->list.next);
+ }
+
+ for (i = 1; i < ((CompositeWidget)layoutp)->composite.num_children; i++)
+ XtDestroyWidget(((CompositeWidget)layoutp)->composite.children[i]);
+ for (i = 0; i < layoutp->core.num_popups; i++)
+ XtDestroyWidget(layoutp->core.popup_list[i]);
+
+ prev->list.next = lay->list.next;
+ lay->list.next = XF86Config->conf_layout_lst;
+ XF86Config->conf_layout_lst = lay;
+
+ layoutsme = NULL;
+ lay = XF86Config->conf_layout_lst;
+ while (lay != NULL) {
+ sme = XtVaCreateManagedWidget("sme", smeBSBObjectClass,
+ layoutp,
+ XtNlabel, lay->lay_identifier,
+ XtNmenuName, lay->lay_identifier,
+ XtNleftBitmap, menuPixmap,
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, SelectLayoutCallback, (XtPointer)lay);
+ if (layoutsme == NULL)
+ layoutsme = sme;
+ layopt = XtCreatePopupShell(lay->lay_identifier, simpleMenuWidgetClass,
+ layoutp, NULL, 0);
+ sme = XtCreateManagedWidget("default", smeBSBObjectClass,
+ layopt, NULL, 0);
+ XtAddCallback(sme, XtNcallback, DefaultLayoutCallback, NULL);
+ sme = XtCreateManagedWidget("remove", smeBSBObjectClass,
+ layopt, NULL, 0);
+ XtAddCallback(sme, XtNcallback, RemoveLayoutCallback, NULL);
+ XtRealizeWidget(layopt);
+
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+ SelectLayoutCallback(layoutsme,
+ XF86Config->conf_layout_lst, NULL);
+}
+
+/*ARGSUSED*/
+void
+RemoveLayoutCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XF86ConfLayoutPtr prev, tmp, lay, rem;
+ Widget sme = NULL;
+ int i;
+ char *str;
+ Arg args[1];
+
+ str = w && XtParent(w) ? XtName(XtParent(w)) : NULL;
+ if (str == NULL)
+ return;
+
+ prev = XF86Config->conf_layout_lst;
+ lay = xf86findLayout(str, prev);
+ tmp = prev;
+ while (tmp != NULL) {
+ if (tmp == lay)
+ break;
+ prev = tmp;
+ tmp = (XF86ConfLayoutPtr)(tmp->list.next);
+ }
+
+ rem = lay;
+ if (tmp != NULL)
+ lay = (XF86ConfLayoutPtr)(tmp->list.next);
+ if (lay == NULL && prev != tmp)
+ lay = prev;
+
+ if (lay != NULL) {
+ int i;
+
+ for (i = 0; i < ((CompositeWidget)layoutp)->composite.num_children;
+ i++) {
+ XtSetArg(args[0], XtNlabel, &str);
+ XtGetValues(((CompositeWidget)layoutp)->composite.children[i],
+ args, 1);
+ if (strcmp(lay->lay_identifier, str) == 0) {
+ layoutsme = ((CompositeWidget)layoutp)->composite.children[i];
+ break;
+ }
+ }
+ SelectLayoutCallback(layoutsme, lay, NULL);
+ }
+ else {
+ computer.layout = NULL;
+ XtSetArg(args[0], XtNstring, "");
+ XtSetValues(layout, args, 1);
+
+ for (i = 0; i < computer.num_devices; i++)
+ computer.devices[i]->state = UNUSED;
+ DrawCables();
+ }
+
+ for (i = 0; i < ((CompositeWidget)layoutp)->composite.num_children; i++) {
+ XtSetArg(args[0], XtNlabel, &str);
+ XtGetValues(((CompositeWidget)layoutp)->composite.children[i], args, 1);
+ if (strcmp(rem->lay_identifier, str) == 0) {
+ sme = ((CompositeWidget)layoutp)->composite.children[i];
+ break;
+ }
+ }
+
+ xf86removeLayout(XF86Config, rem);
+ if (sme)
+ XtDestroyWidget(sme);
+}
+
+void
+SetTip(xf86cfgDevice *device)
+{
+ XF86OptionPtr option = NULL;
+ char *tip, buffer[4096];
+ Arg args[1];
+ int len = 0;
+
+ XtSetArg(args[0], XtNtip, &tip);
+ XtGetValues(device->widget, args, 1);
+
+ switch (device->type) {
+ case MOUSE: {
+ XF86ConfInputPtr mouse = (XF86ConfInputPtr)device->config;
+
+ if (mouse == NULL)
+ return;
+ len = XmuSnprintf(buffer, sizeof(buffer),
+ "Identifier \"%s\"\n"
+ "Driver \"mouse\"\n",
+ mouse->inp_identifier);
+ option = mouse->inp_option_lst;
+ } break;
+ case KEYBOARD: {
+ XF86ConfInputPtr keyboard = (XF86ConfInputPtr)device->config;
+
+ if (keyboard == NULL)
+ return;
+ len = XmuSnprintf(buffer, sizeof(buffer),
+ "Identifier \"%s\"\n"
+ "Driver \"keyboard\"\n",
+ keyboard->inp_identifier);
+ option = keyboard->inp_option_lst;
+ } break;
+ case CARD: {
+ XF86ConfDevicePtr card = (XF86ConfDevicePtr)device->config;
+
+ if (card == NULL)
+ return;
+ len = XmuSnprintf(buffer, sizeof(buffer),
+ "Identifier \"%s\"\n"
+ "Driver \"%s\"\n",
+ card->dev_identifier,
+ card->dev_driver);
+ option = card->dev_option_lst;
+ } break;
+ case MONITOR: {
+ XF86ConfMonitorPtr monitor = (XF86ConfMonitorPtr)device->config;
+
+ if (monitor == NULL)
+ return;
+ len = XmuSnprintf(buffer, sizeof(buffer),
+ "Identifier \"%s\"\n"
+ "Vendor \"%s\"\n",
+ monitor->mon_identifier,
+ monitor->mon_vendor);
+ option = monitor->mon_option_lst;
+ } break;
+ case SCREEN: {
+ XF86ConfScreenPtr screen = (XF86ConfScreenPtr)device->config;
+
+ if (screen == NULL)
+ return;
+ len = XmuSnprintf(buffer, sizeof(buffer),
+ "Identifier \"%s\"\n",
+ screen->scrn_identifier);
+ if (screen->scrn_device_str != NULL)
+ len += XmuSnprintf(buffer + len, sizeof(buffer),
+ "Device \"%s\"\n",
+ screen->scrn_device_str);
+ if (screen->scrn_monitor_str != NULL)
+ len += XmuSnprintf(buffer + len, sizeof(buffer),
+ "Monitor \"%s\"\n",
+ screen->scrn_monitor_str);
+ option = screen->scrn_option_lst;
+ } break;
+ case SERVER: {
+ len = XmuSnprintf(buffer, sizeof(buffer),
+ "%s\n", "Server Flags");
+ option = XF86Config->conf_flags->flg_option_lst;
+ } break;
+ }
+
+ while (option && len < sizeof(buffer) - 1) {
+ len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
+ "Option \"%s\"",
+ option->opt_name);
+ if (option->opt_val != NULL)
+ len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
+ " \"%s\"\n",
+ option->opt_val);
+ else
+ len += XmuSnprintf(buffer + len, sizeof(buffer) - len,
+ "%s", "\n");
+ option = (XF86OptionPtr)(option->list.next);
+ }
+
+ tip = buffer;
+ XtSetArg(args[0], XtNtip, tip);
+ XtSetValues(device->widget, args, 1);
+}
+
+/*ARGSUSED*/
+void
+AddDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ AddDevice((long)user_data, NULL, 6, 6);
+}
+
+void
+SmeConfigureDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i;
+
+ switch ((long)user_data) {
+ case MOUSE:
+ case KEYBOARD:
+ case CARD:
+ case MONITOR:
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->type == (long)user_data) {
+ config = computer.devices[i]->widget;
+ ConfigureDeviceCallback(w, NULL, NULL);
+ }
+ break;
+
+ /* hack for newly added devices */
+ case -(MOUSE + 100):
+ case -(KEYBOARD + 100):
+ case -(CARD + 100):
+ case -(MONITOR + 100):
+ for (i = 0; i < computer.num_devices; i++)
+ if (-(computer.devices[i]->type + 100) == (long)user_data &&
+ computer.devices[i]->config == NULL) {
+ config = computer.devices[i]->widget;
+ ConfigureDeviceCallback(w, NULL, NULL);
+ }
+ break;
+
+ default:
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->config == user_data) {
+ config = computer.devices[i]->widget;
+ ConfigureDeviceCallback(w, NULL, NULL);
+ }
+ break;
+ }
+}
+
+void
+ConfigureDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i, j;
+
+ if (config_mode == CONFIG_LAYOUT) {
+ for (i = 0; i < computer.num_devices; i++) {
+ if (computer.devices[i]->widget == config) {
+ switch (computer.devices[i]->type) {
+ case MOUSE: {
+ XF86ConfInputPtr mouse =
+ MouseConfig(computer.devices[i]->config);
+
+ if (mouse != NULL && computer.devices[i]->config == NULL) {
+ XF86Config->conf_input_lst =
+ xf86addInput(XF86Config->conf_input_lst,
+ mouse);
+ computer.devices[i]->config = (XtPointer)mouse;
+ }
+ SetTip(computer.devices[i]);
+ } break;
+ case KEYBOARD: {
+ XF86ConfInputPtr keyboard =
+ KeyboardConfig(computer.devices[i]->config);
+
+ if (keyboard != NULL && computer.devices[i]->config == NULL) {
+ XF86Config->conf_input_lst =
+ xf86addInput(XF86Config->conf_input_lst,
+ keyboard);
+ computer.devices[i]->config = (XtPointer)keyboard;
+ }
+ SetTip(computer.devices[i]);
+ } break;
+ case CARD: {
+ XF86ConfDevicePtr card =
+ CardConfig(computer.devices[i]->config);
+
+ if (card != NULL && computer.devices[i]->config == NULL) {
+ XF86Config->conf_device_lst =
+ xf86addDevice(XF86Config->conf_device_lst,
+ card);
+ computer.devices[i]->config = (XtPointer)card;
+ }
+ SetTip(computer.devices[i]);
+ for (j = 0; j < computer.num_screens; j++)
+ if (computer.screens[j]->card->widget == config)
+ SetTip((xf86cfgDevice*)computer.screens[j]);
+ } break;
+ case MONITOR: {
+ XF86ConfMonitorPtr monitor =
+ MonitorConfig(computer.devices[i]->config);
+
+ if (monitor != NULL && computer.devices[i]->config == NULL) {
+ XF86Config->conf_monitor_lst =
+ xf86addMonitor(XF86Config->conf_monitor_lst,
+ monitor);
+ computer.devices[i]->config = (XtPointer)monitor;
+ }
+ SetTip(computer.devices[i]);
+ for (j = 0; j < computer.num_screens; j++)
+ if (computer.screens[j]->monitor->widget == config)
+ SetTip((xf86cfgDevice*)computer.screens[j]);
+ } break;
+ }
+ /* Need to update because it may have been renamed */
+ UpdateMenuDeviceList(computer.devices[i]->type);
+ break;
+ }
+ }
+ }
+ else if (config_mode == CONFIG_SCREEN) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->widget == config) {
+ if (ScreenConfig(computer.screens[i]->screen) != NULL)
+ SetTip((xf86cfgDevice*)computer.screens[i]);
+ }
+ }
+}
+
+void
+OptionsCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i;
+ XF86OptionPtr *options = NULL;
+#ifdef USE_MODULES
+ xf86cfgModuleOptions *drv_opts = NULL;
+#endif
+
+ if (config_mode == CONFIG_SCREEN) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->widget == config) {
+ options = &(computer.screens[i]->screen->scrn_option_lst);
+ break;
+ }
+ }
+ else {
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->widget == config)
+ break;
+
+ if (i >= computer.num_devices) {
+ if (XF86Config->conf_flags == NULL)
+ XF86Config->conf_flags = (XF86ConfFlagsPtr)
+ XtCalloc(1, sizeof(XF86ConfFlagsRec));
+ options = &(XF86Config->conf_flags->flg_option_lst);
+ }
+ else {
+ switch (computer.devices[i]->type) {
+ case MOUSE:
+ case KEYBOARD:
+ options = (XF86OptionPtr*)&(((XF86ConfInputPtr)
+ (computer.devices[i]->config))->inp_option_lst);
+#ifdef USE_MODULES
+ if (!nomodules) {
+ char *drv = ((XF86ConfInputPtr)
+ (computer.devices[i]->config))->inp_driver;
+
+ if (drv) {
+ drv_opts = module_options;
+ while (drv_opts) {
+ if (drv_opts->type == InputModule &&
+ strcmp(drv_opts->name, drv) == 0)
+ break;
+ drv_opts = drv_opts->next;
+ }
+ }
+ }
+#endif
+
+ break;
+ case CARD:
+ options = (XF86OptionPtr*)&(((XF86ConfDevicePtr)
+ (computer.devices[i]->config))->dev_option_lst);
+#ifdef USE_MODULES
+ if (!nomodules) {
+ char *drv = ((XF86ConfDevicePtr)
+ (computer.devices[i]->config))->dev_driver;
+
+ if (drv) {
+ drv_opts = module_options;
+ while (drv_opts) {
+ if (drv_opts->type == VideoModule &&
+ strcmp(drv_opts->name, drv) == 0)
+ break;
+ drv_opts = drv_opts->next;
+ }
+ }
+ }
+#endif
+ break;
+ case MONITOR:
+ options = (XF86OptionPtr*)&(((XF86ConfMonitorPtr)
+ (computer.devices[i]->config))->mon_option_lst);
+ break;
+ }
+ }
+ }
+
+#ifdef USE_MODULES
+ OptionsPopup(options, drv_opts ? drv_opts->name : NULL,
+ drv_opts ? drv_opts->option : NULL);
+#else
+ OptionsPopup(options);
+#endif
+ if (config_mode == CONFIG_SCREEN) {
+ XF86OptionPtr option, options;
+ int rotate = 0;
+
+ options = computer.screens[i]->screen->scrn_option_lst;
+ if ((option = xf86findOption(options, "Rotate")) != NULL) {
+ if (option->opt_val != NULL)
+ rotate = strcasecmp(option->opt_val, "CW") == 0 ? 1 :
+ strcasecmp(option->opt_val, "CCW") == 0 ? -1 : 0;
+ XtFree(option->opt_val);
+ option->opt_val = XtNewString(rotate > 0 ? "CW" : "CCW");
+ computer.screens[i]->rotate = rotate;
+ }
+ else
+ computer.screens[i]->rotate = 0;
+ UpdateScreenUI();
+ AdjustScreenUI();
+ SetTip((xf86cfgDevice*)computer.screens[i]);
+ }
+ else {
+ if (i >= computer.num_devices)
+ SetTip(&cpu_device);
+ else
+ SetTip(computer.devices[i]);
+ }
+}
+
+void
+EnableDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i;
+
+ if (config_mode == CONFIG_SCREEN) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->widget == config) {
+ computer.screens[i]->state = USED;
+ computer.screens[i]->card->state = USED;
+ ScreenSetup(False);
+ return;
+ }
+ }
+
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->widget == config) {
+ if (computer.devices[i]->state == USED)
+ return;
+ computer.devices[i]->state = USED;
+ DrawCables();
+ break;
+ }
+ if (i >= computer.num_devices || computer.layout == NULL)
+ return;
+ switch (computer.devices[i]->type) {
+ case MOUSE:
+ case KEYBOARD: {
+ int nmouses = 0, nkeyboards = 0;
+ XF86ConfInputPtr input = (XF86ConfInputPtr)
+ (computer.devices[i]->config);
+ XF86ConfInputrefPtr nex, iref = computer.layout->lay_input_lst;
+ XF86OptionPtr option;
+
+ nex = iref;
+ while (nex != NULL) {
+ if (strcasecmp(nex->iref_inputdev->inp_driver, "mouse") == 0)
+ ++nmouses;
+ else if (strcasecmp(nex->iref_inputdev->inp_driver,
+ "keyboard") == 0)
+ ++nkeyboards;
+ iref = nex;
+ nex = (XF86ConfInputrefPtr)(nex->list.next);
+ }
+ nex = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec));
+ nex->list.next = NULL;
+ nex->iref_inputdev = input;
+ nex->iref_inputdev_str = XtNewString(input->inp_identifier);
+ if (nmouses == 0 && computer.devices[i]->type == MOUSE)
+ option = xf86newOption(XtNewString("CorePointer"), NULL);
+ else if (nkeyboards == 0 && computer.devices[i]->type == KEYBOARD)
+ option = xf86newOption(XtNewString("CoreKeyboard"), NULL);
+ else
+ option = xf86newOption(XtNewString("SendCoreEvents"), NULL);
+ nex->iref_option_lst = option;
+ computer.layout->lay_input_lst =
+ xf86addInputref(computer.layout->lay_input_lst, nex);
+ } break;
+ case CARD:
+ for (i = 0; i < computer.num_screens; i++) {
+ if (computer.screens[i]->card->widget == config &&
+ computer.screens[i]->state != USED) {
+ XF86ConfAdjacencyPtr adj;
+
+ adj = (XF86ConfAdjacencyPtr)
+ XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
+ adj->adj_screen = computer.screens[i]->screen;
+ adj->adj_screen_str = XtNewString(computer.screens[i]->
+ screen->scrn_identifier);
+ computer.layout->lay_adjacency_lst = (XF86ConfAdjacencyPtr)
+ xf86addListItem((GenericListPtr)computer.layout->
+ lay_adjacency_lst, (GenericListPtr)adj);
+ computer.screens[i]->state = USED;
+ }
+ }
+ break;
+ case MONITOR:
+ break;
+ }
+}
+
+void
+DisableDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i;
+
+ if (config_mode == CONFIG_SCREEN) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->widget == config) {
+ computer.screens[i]->state = UNUSED;
+ computer.screens[i]->card->state = UNUSED;
+ ScreenSetup(False);
+ return;
+ }
+ }
+
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->widget == config) {
+ if (computer.devices[i]->state == UNUSED)
+ return;
+ computer.devices[i]->state = UNUSED;
+ DrawCables();
+ break;
+ }
+ if (i >= computer.num_devices || computer.layout == NULL)
+ return;
+ switch (computer.devices[i]->type) {
+ case MOUSE:
+ case KEYBOARD:
+ xf86removeInputRef(computer.layout,
+ (XF86ConfInputPtr)(computer.devices[i]->config));
+ break;
+ case CARD: {
+ XF86ConfAdjacencyPtr adj;
+ int j;
+
+ if (computer.layout == NULL)
+ break;
+ for (j = 0; j < computer.num_screens; j++)
+ if (computer.screens[j]->card->widget == config) {
+ adj = computer.layout->lay_adjacency_lst;
+ while (adj != NULL) {
+ if (adj->adj_screen == computer.screens[j]->screen) {
+ xf86removeAdjacency(computer.layout, adj);
+ break;
+ }
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+ computer.screens[j]->state = UNUSED;
+ break;
+ }
+ } break;
+ case MONITOR:
+ break;
+ }
+}
+
+/* ARGSUSED */
+void
+RemoveDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i, j;
+
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->widget == config) {
+ RemoveScreen(computer.screens[i]->monitor,
+ computer.screens[i]->card);
+ ScreenSetup(False);
+ return;
+ }
+
+ for (i = 0; i < computer.num_devices; i++) {
+ if (computer.devices[i]->widget == config) {
+ switch (computer.devices[i]->type) {
+ case MOUSE:
+ case KEYBOARD:
+ xf86removeInput(XF86Config,
+ (XF86ConfInputPtr)(computer.devices[i]->config));
+ break;
+ case CARD:
+ case MONITOR:
+ break;
+ }
+
+ if (computer.devices[i]->type == CARD) {
+ for (j = 0; j < computer.num_screens; j++)
+ if (computer.screens[j]->card == computer.devices[i]) {
+ RemoveScreen(computer.screens[j]->monitor,
+ computer.devices[i]);
+ --j;
+ }
+ if (computer.devices[i]->refcount <= 0)
+ xf86removeDevice(XF86Config,
+ (XF86ConfDevicePtr)(computer.devices[i]->config));
+ }
+ else if (computer.devices[i]->type == MONITOR) {
+ for (j = 0; j < computer.num_screens; j++)
+ if (computer.screens[j]->monitor == computer.devices[i]) {
+ RemoveScreen(computer.devices[i],
+ computer.screens[j]->card);
+ --j;
+ }
+ if (computer.devices[i]->refcount <= 0)
+ xf86removeMonitor(XF86Config,
+ (XF86ConfMonitorPtr)(computer.devices[i]->config));
+ }
+
+ if (computer.devices[i]->refcount <= 0) {
+ int type = computer.devices[i]->type;
+
+ XtDestroyWidget(computer.devices[i]->widget);
+ XtFree((XtPointer)computer.devices[i]);
+ if (--computer.num_devices > i)
+ memmove(&computer.devices[i], &computer.devices[i + 1],
+ (computer.num_devices - i) * sizeof(xf86cfgDevice*));
+
+ DrawCables();
+ UpdateMenuDeviceList(type);
+ }
+
+ break;
+ }
+ }
+}
+
+void
+UpdateMenuDeviceList(int type)
+{
+ Widget sme = NULL, menu = NULL;
+ int i, count;
+ static char *mouseM = "mouseM", *keyboardM = "keyboardM",
+ *cardM = "cardM", *monitorM = "monitorM";
+
+ for (i = count = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->type == type)
+ ++count;
+
+ switch (type) {
+ case MOUSE:
+ sme = mouseSme;
+ menu = mouseMenu;
+ break;
+ case KEYBOARD:
+ sme = keyboardSme;
+ menu = keyboardMenu;
+ break;
+ case CARD:
+ sme = cardSme;
+ menu = cardMenu;
+ break;
+ case MONITOR:
+ sme = monitorSme;
+ menu = monitorMenu;
+ break;
+ }
+
+ if (menu)
+ for (i = ((CompositeWidget)menu)->composite.num_children - 1; i >= 0; i--)
+ XtDestroyWidget(((CompositeWidget)menu)->composite.children[i]);
+
+ if (count < 2) {
+ XtVaSetValues(sme, XtNmenuName, NULL, XtNleftBitmap, None, NULL);
+ return;
+ }
+
+ switch (type) {
+ case MOUSE:
+ if (mouseMenu == NULL)
+ menu = mouseMenu =
+ XtCreatePopupShell(mouseM, simpleMenuWidgetClass,
+ XtParent(mouseSme), NULL, 0);
+ XtVaSetValues(mouseSme, XtNmenuName, mouseM,
+ XtNleftBitmap, menuPixmap, NULL);
+ break;
+ case KEYBOARD:
+ if (keyboardMenu == NULL)
+ menu = keyboardMenu =
+ XtCreatePopupShell(keyboardM, simpleMenuWidgetClass,
+ XtParent(keyboardSme), NULL, 0);
+ XtVaSetValues(keyboardSme, XtNmenuName, keyboardM,
+ XtNleftBitmap, menuPixmap, NULL);
+ break;
+ case CARD:
+ if (cardMenu == NULL)
+ menu = cardMenu =
+ XtCreatePopupShell(cardM, simpleMenuWidgetClass,
+ XtParent(cardSme), NULL, 0);
+ XtVaSetValues(cardSme, XtNmenuName, cardM,
+ XtNleftBitmap, menuPixmap, NULL);
+ break;
+ case MONITOR:
+ if (monitorMenu == NULL)
+ menu = monitorMenu =
+ XtCreatePopupShell(monitorM, simpleMenuWidgetClass,
+ XtParent(monitorSme), NULL, 0);
+ XtVaSetValues(monitorSme, XtNmenuName, monitorM,
+ XtNleftBitmap, menuPixmap, NULL);
+ break;
+ }
+
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->type == type) {
+ char *label = NULL;
+
+ if (computer.devices[i]->config) {
+ switch (type) {
+ case MOUSE:
+ case KEYBOARD:
+ label = ((XF86ConfInputPtr)computer.devices[i]->config)
+ ->inp_identifier;
+ break;
+ case CARD:
+ label = ((XF86ConfDevicePtr)computer.devices[i]->config)
+ ->dev_identifier;
+ break;
+ case MONITOR:
+ label = ((XF86ConfMonitorPtr)computer.devices[i]->config)
+ ->mon_identifier;
+ break;
+ }
+ }
+ else {
+ switch (type) {
+ case MOUSE:
+ label = "newMouse";
+ break;
+ case KEYBOARD:
+ label = "newKeyboard";
+ break;
+ case CARD:
+ label = "newCard";
+ break;
+ case MONITOR:
+ label = "newMonitor";
+ break;
+ }
+ }
+
+ sme = XtCreateManagedWidget(label, smeBSBObjectClass, menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, SmeConfigureDeviceCallback,
+ computer.devices[i]->config ?
+ computer.devices[i]->config :
+ (XtPointer) (-((long)type + 100)));
+ }
+}
+
+/*ARGSUSED*/
+void
+SelectDeviceAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ device = w;
+ xpos = event->xbutton.x_root;
+ ypos = event->xbutton.y_root;
+ XDefineCursor(XtDisplay(device), XtWindow(device), no_cursor);
+
+ if (config_mode == CONFIG_SCREEN) {
+ sxpos = device->core.x;
+ sypos = device->core.y;
+ }
+}
+
+/*ARGSUSED*/
+void
+MoveDeviceAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ int dx, dy, x, y, oldx, oldy;
+
+ if (device == NULL || device != w)
+ return;
+
+ dx = event->xbutton.x_root - xpos;
+ dy = event->xbutton.y_root - ypos;
+
+ oldx = device->core.x;
+ oldy = device->core.y;
+ x = device->core.x + dx;
+ y = device->core.y + dy;
+
+ if (x < 0)
+ x = 0;
+ else if (x + device->core.width > XtParent(device)->core.width)
+ x = XtParent(device)->core.width - device->core.width;
+ if (y < 0)
+ y = 0;
+ else if (y + device->core.height > XtParent(device)->core.height)
+ y = XtParent(device)->core.height - device->core.height;
+
+ dx = x - oldx;
+ dy = y - oldy;
+
+ XRaiseWindow(XtDisplay(device), XtWindow(device));
+ XtMoveWidget(device, x, y);
+
+ xpos += dx;
+ ypos += dy;
+}
+
+/*ARGSUSED*/
+void
+UnselectDeviceAction(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
+ if (device != NULL) {
+ XUndefineCursor(XtDisplay(device), XtWindow(device));
+
+ if (config_mode == CONFIG_SCREEN)
+ ScreenSetup(False);
+ device = NULL;
+ }
+}
+
+/*ARGSUSED*/
+void
+DevicePopupMenu(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ static Widget configure, options, enable, disable, remove;
+ static int first = 1;
+ int i;
+ xf86cfgDevice *dev;
+
+ if (first) {
+ first = 0;
+
+ popup = XtCreatePopupShell("popup", simpleMenuWidgetClass,
+ toplevel, NULL, 0);
+ configure = XtCreateManagedWidget("configure", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(configure, XtNcallback, ConfigureDeviceCallback, NULL);
+ options = XtCreateManagedWidget("options", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(options, XtNcallback, OptionsCallback, NULL);
+ XtCreateManagedWidget("line", smeLineObjectClass,
+ popup, NULL, 0);
+ enable = XtCreateManagedWidget("enable", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(enable, XtNcallback, EnableDeviceCallback, NULL);
+ disable = XtCreateManagedWidget("disable", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(disable, XtNcallback, DisableDeviceCallback, NULL);
+ XtCreateManagedWidget("line", smeLineObjectClass,
+ popup, NULL, 0);
+ remove = XtCreateManagedWidget("remove", smeBSBObjectClass,
+ popup, NULL, 0);
+ XtAddCallback(remove, XtNcallback, RemoveDeviceCallback, NULL);
+
+ XtRealizeWidget(popup);
+ }
+
+ dev = NULL;
+ if (config_mode == CONFIG_LAYOUT) {
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->widget == w) {
+ dev = computer.devices[i];
+ break;
+ }
+ if (i >= computer.num_devices && strcmp(XtName(w), "cpu"))
+ return;
+ if (dev == NULL)
+ dev = &cpu_device;
+ }
+ else if (config_mode == CONFIG_SCREEN) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->widget == w) {
+ dev = (xf86cfgDevice*)computer.screens[i];
+ break;
+ }
+ }
+ if (dev == NULL)
+ return;
+
+ config = w;
+
+ if (dev->type != SERVER) {
+ XtSetSensitive(configure, True);
+ XtSetSensitive(remove, True);
+ XtSetSensitive(options, dev->config != NULL);
+ if (computer.layout == NULL || dev->config == NULL ||
+ dev->type == MONITOR) {
+ XtSetSensitive(enable, False);
+ XtSetSensitive(disable, False);
+ }
+ else if (dev->state == USED) {
+ XtSetSensitive(enable, False);
+ XtSetSensitive(disable, True);
+ }
+ else {
+ XtSetSensitive(enable, True);
+ XtSetSensitive(disable, False);
+ }
+ }
+ else {
+ XtSetSensitive(configure, False);
+ XtSetSensitive(options, True);
+ XtSetSensitive(enable, False);
+ XtSetSensitive(disable, False);
+ XtSetSensitive(remove, False);
+ }
+
+ XtMoveWidget(popup, event->xbutton.x_root, event->xbutton.y_root);
+ XtPopup(popup, XtGrabNone);
+}
+
+/*ARGSUSED*/
+void
+DevicePopdownMenu(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
+ if (popup && XtIsRealized(popup))
+ XtPopdown(popup);
+}
+
+void RenameLayoutAction(Widget w, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ XF86ConfLayoutPtr lay = XF86Config->conf_layout_lst;
+ Arg args[1];
+ char *name;
+
+ XtSetArg(args[0], XtNstring, &name);
+ XtGetValues(layout, args, 1);
+
+ if (computer.layout == NULL || (computer.layout &&
+ strcasecmp(name, computer.layout->lay_identifier)) == 0)
+ return;
+
+ if (name == NULL && *name == '\0') {
+ /* tell user about error */
+ return;
+ }
+
+ while (lay) {
+ if (strcasecmp(name, lay->lay_identifier) == 0)
+ /* tell user about error */
+ return;
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+
+ XtSetArg(args[0], XtNlabel, name);
+ XtSetValues(layoutsme, args, 1);
+ xf86renameLayout(XF86Config, computer.layout, name);
+}
+
+/*ARGSUSED*/
+static void
+ComputerEventHandler(Widget w, XtPointer closure,
+ XEvent *event, Boolean *continue_to_dispatch)
+{
+ if (event->xexpose.count > 1)
+ return;
+
+ if (config_mode == CONFIG_LAYOUT)
+ DrawCables();
+}
+
+void
+DrawCables(void)
+{
+ Display *display;
+ Window window;
+ int ox, oy, i;
+ xf86cfgScreen **scr = computer.screens;
+
+ if (config_mode != CONFIG_LAYOUT)
+ return;
+
+ ox = computer.cpu->core.x + (computer.cpu->core.width >> 1);
+ oy = computer.cpu->core.y + (computer.cpu->core.height >> 1);
+
+ display = XtDisplay(work);
+ window = XtWindow(work);
+ XClearWindow(display, window);
+
+ for (i = 0; i < computer.num_devices; i++) {
+ if (computer.devices[i]->state == USED &&
+ computer.devices[i]->type != MONITOR)
+ DrawCable(display, window, ox, oy,
+ computer.devices[i]->widget->core.x +
+ (computer.devices[i]->widget->core.width>>1),
+ computer.devices[i]->widget->core.y +
+ (computer.devices[i]->widget->core.height>>1));
+
+ }
+ for (i = 0; i < computer.num_screens; i++) {
+ if (scr[i]->monitor != NULL)
+ DrawCable(display, window,
+ scr[i]->card->widget->core.x +
+ (scr[i]->card->widget->core.width>>1),
+ scr[i]->card->widget->core.y +
+ (scr[i]->card->widget->core.height>>1),
+ scr[i]->monitor->widget->core.x +
+ (scr[i]->monitor->widget->core.width>>1),
+ scr[i]->monitor->widget->core.y +
+ (scr[i]->monitor->widget->core.height>>1));
+ }
+}
+
+static void
+DrawCable(Display *display, Window window, int o_x, int o_y, int d_x, int d_y)
+{
+ XDrawLine(display, window, cablegcshadow, o_x, o_y, d_x, d_y);
+ XDrawLine(display, window, cablegc, o_x, o_y, d_x, d_y);
+}
+
+/*ARGSUSED*/
+void
+SetConfigModeCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i, mode = (long)user_data;
+ Arg args[3];
+ char *ptr;
+ static Dimension height;
+
+ if (mode == config_mode)
+ return;
+ XtSetArg(args[0], XtNlabel, &ptr);
+ XtGetValues(w, args, 1);
+ XtSetArg(args[0], XtNlabel, ptr);
+ XtSetValues(topMenu, args, 1);
+
+ if (config_mode == CONFIG_LAYOUT) {
+ XtSetArg(args[0], XtNheight, &height);
+ XtGetValues(commands, args, 1);
+ for (i = 0; i < computer.num_devices; i++)
+ XtUnmapWidget(computer.devices[i]->widget);
+ XtUnmapWidget(commands);
+ XtUnmapWidget(computer.cpu);
+ XtSetSensitive(commands, False);
+ XtSetArg(args[0], XtNheight, 1);
+ XtSetArg(args[1], XtNmin, 1);
+ XtSetArg(args[2], XtNmax, 1);
+ XtSetValues(commands, args, 3);
+ }
+ else if (config_mode == CONFIG_SCREEN) {
+ for (i = 0; i < computer.num_screens; i++)
+ XtUnmapWidget(computer.screens[i]->widget);
+ }
+ else if (config_mode == CONFIG_MODELINE) {
+ VideoModeConfigureEnd();
+ XtSetSensitive(layout, True);
+ XtSetSensitive(layoutm, True);
+ }
+ else if (config_mode == CONFIG_ACCESSX) {
+ AccessXConfigureEnd();
+ XtSetSensitive(layout, True);
+ XtSetSensitive(layoutm, True);
+ }
+
+ config_mode = mode;
+ XClearWindow(XtDisplay(work), XtWindow(work));
+ if (mode == CONFIG_LAYOUT) {
+ for (i = 0; i < computer.num_devices; i++)
+ XtMapWidget(computer.devices[i]->widget);
+ XtSetArg(args[0], XtNheight, height);
+ XtSetArg(args[1], XtNmin, height);
+ XtSetArg(args[2], XtNmax, height);
+ XtSetValues(commands, args, 3);
+ XtMapWidget(commands);
+ XtMapWidget(computer.cpu);
+ XtSetSensitive(commands, True);
+ DrawCables();
+ }
+ else if (mode == CONFIG_SCREEN) {
+ for (i = 0; i < computer.num_screens; i++)
+ XtMapWidget(computer.screens[i]->widget);
+ ScreenSetup(True);
+ }
+ else if (mode == CONFIG_MODELINE) {
+ VideoModeConfigureStart();
+ XtSetSensitive(layout, False);
+ XtSetSensitive(layoutm, False);
+ }
+ else if (mode == CONFIG_ACCESSX) {
+ AccessXConfigureStart();
+ XtSetSensitive(layout, False);
+ XtSetSensitive(layoutm, False);
+ }
+}
+
+static void
+ScreenSetup(Bool check)
+{
+ if (check) {
+ int i;
+
+ for (i = 0; i < computer.num_layouts; i++)
+ if (computer.layouts[i]->layout == computer.layout)
+ break;
+
+ /* Just to put the screens in the correct positions */
+ if (i >= computer.num_layouts)
+ AdjustScreenUI();
+ }
+
+ UpdateScreenUI();
+ AdjustScreenUI();
+}
diff --git a/hw/xfree86/utils/xorgcfg/keyboard-cfg.c b/hw/xfree86/utils/xorgcfg/keyboard-cfg.c
new file mode 100644
index 000000000..87989fdc2
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/keyboard-cfg.c
@@ -0,0 +1,1379 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c,v 1.22 2003/01/01 19:22:24 paulo Exp $
+ */
+
+#include "xf86config.h"
+#include "keyboard-cfg.h"
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+
+/*
+ * Types
+ */
+typedef struct {
+ char *rules;
+ XkbRF_RulesPtr list;
+ XF86XkbDescInfo model;
+ XF86XkbDescInfo layout;
+ XF86XkbDescInfo variant;
+ XF86XkbDescInfo option;
+} XF86XkbRulesDescInfo;
+
+/*
+ * Prototypes
+ */
+static void KeyboardRulesCallback(Widget, XtPointer, XtPointer);
+static void KeyboardModelCallback(Widget, XtPointer, XtPointer);
+static void KeyboardLayoutCallback(Widget, XtPointer, XtPointer);
+static void KeyboardVariantCallback(Widget, XtPointer, XtPointer);
+static void KeyboardOptionsCallback(Widget, XtPointer, XtPointer);
+static void KeyboardApplyCallback(Widget, XtPointer, XtPointer);
+static Bool KeyboardConfigCheck(void);
+static void XkbUIEventHandler(Widget, XtPointer, XEvent*, Boolean*);
+static XF86XkbRulesDescInfo *GetXkbRulesDesc(char*);
+static void UpdateRulesPopups(void);
+
+/*
+ * Initialization
+ */
+static XF86XkbRulesDescInfo **xkb_desc, *xkb_rules;
+static int num_xkb_desc;
+static char *XkbRulesDir = "lib/X11/xkb/rules/";
+#ifdef XFREE98_XKB
+static char *XkbRulesFile = "xfree98";
+#else
+static char *XkbRulesFile = "xfree86";
+#endif
+static XF86ConfInputPtr current_input;
+
+static char *rules, *model, *layout, *variant, *options;
+static Widget kbd, rulesb, modelb, layoutb, variantb, optionsb,
+ modelp, layoutp, variantp, optionsp;
+static XkbInfo **xkb_infos;
+static int num_xkb_infos;
+XkbInfo *xkb_info;
+
+static Widget apply;
+
+/*
+ * Implementation
+ */
+/*ARGSUSED*/
+XtPointer
+KeyboardConfig(XtPointer config)
+{
+ XF86ConfInputPtr keyboard = (XF86ConfInputPtr)config;
+ XF86OptionPtr option;
+ Arg args[1];
+ static char *XkbRules = "XkbRules", *XkbModel = "XkbModel",
+ *XkbLayout = "XkbLayout", *XkbVariant = "XkbVariant",
+ *XkbOptions = "XkbOptions";
+ XF86XkbRulesDescInfo *info;
+ char *omodel, *olayout, *ovariant, *ooptions;
+
+ InitializeKeyboard();
+ rules = xkb_rules->rules;
+ if (xkb_info->config.rules_file == NULL)
+ xkb_info->config.rules_file = rules;
+
+ if (options)
+ XtFree(options);
+ options = NULL;
+
+ if (xkb_info->conf == NULL)
+ xkb_info->conf = keyboard;
+
+ if (xkb_info->conf != keyboard) {
+ int i;
+
+ for (i = 0; i < num_xkb_infos; i++)
+ if (xkb_infos[i]->conf == keyboard) {
+ xkb_info = xkb_infos[i];
+ break;
+ }
+
+ if (i >= num_xkb_infos) {
+ int timeout = 10;
+
+ xkb_info = (XkbInfo*)XtCalloc(1, sizeof(XkbInfo));
+ xkb_info->conf = keyboard;
+ xkb_infos = (XkbInfo**)
+ XtRealloc((XtPointer)xkb_infos, sizeof(XkbInfo*) *
+ (num_xkb_infos + 1));
+ xkb_infos[num_xkb_infos++] = xkb_info;
+
+ xkb_info->conf = keyboard;
+ bzero((char*)&(xkb_info->defs), sizeof(XkbRF_VarDefsRec));
+ while (timeout > 0) {
+ xkb_info->xkb =
+ XkbGetKeyboard(XtDisplay(configp),
+ XkbGBN_AllComponentsMask, XkbUseCoreKbd);
+ if (xkb_info->xkb == NULL) {
+ timeout -= 1;
+ sleep(1);
+ }
+ else
+ break;
+ }
+ if (timeout <= 0) {
+ fprintf(stderr, "Couldn't get keyboard\n");
+ }
+ if (xkb_info->xkb && xkb_info->xkb->names && xkb_info->xkb->geom &&
+ xkb_info->xkb->names->geometry == 0)
+ xkb_info->xkb->names->geometry = xkb_info->xkb->geom->name;
+ }
+
+ /* check for removed devices */
+ for (i = 0; i < num_xkb_infos; i++) {
+ XF86ConfInputPtr key = XF86Config->conf_input_lst;
+
+ while (key != NULL) {
+ if (strcasecmp(key->inp_driver, "keyboard") == 0 &&
+ xkb_infos[i]->conf == key)
+ break;
+ key = (XF86ConfInputPtr)(key->list.next);
+ }
+ if (xkb_infos[i]->conf != NULL && key == NULL) {
+ XkbFreeKeyboard(xkb_infos[i]->xkb, 0, False);
+ XtFree((XtPointer)xkb_infos[i]);
+ if (--num_xkb_infos > i)
+ memmove(&xkb_infos[i], &xkb_infos[i + 1],
+ (num_xkb_infos - i) * sizeof(XkbInfo*));
+ }
+ }
+ }
+
+ current_input = keyboard;
+
+ if (keyboard != NULL) {
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbRules)) != NULL) {
+ if (strcmp(rules, option->opt_val)) {
+ XF86XkbRulesDescInfo *info = GetXkbRulesDesc(option->opt_val);
+
+ if (info) {
+ rules = info->rules;
+ UpdateRulesPopups();
+ }
+ }
+ }
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbModel)) != NULL)
+ xkb_info->defs.model = model = option->opt_val;
+ else
+ xkb_info->defs.model = model = xkb_rules->model.name[0];
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbLayout)) != NULL)
+ xkb_info->defs.layout = layout = option->opt_val;
+ else
+ xkb_info->defs.layout = layout = xkb_rules->layout.name[0];
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbVariant)) != NULL)
+ xkb_info->defs.variant = variant = option->opt_val;
+ else
+ xkb_info->defs.variant = variant = NULL;
+
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbOptions)) != NULL)
+ xkb_info->defs.options = options = XtNewString(option->opt_val);
+ else
+ xkb_info->defs.options = options = NULL;
+
+ XtSetArg(args[0], XtNstring, keyboard->inp_identifier);
+ XtSetValues(ident_widget, args, 1);
+
+ (void)UpdateKeyboard(False);
+ }
+ else {
+ XF86ConfInputPtr input = XF86Config->conf_input_lst;
+ char keyboard_name[48];
+ int nkeyboards = 0;
+
+ while (input != NULL) {
+ if (strcasecmp(input->inp_driver, "keyboard") == 0)
+ ++nkeyboards;
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+ do {
+ XmuSnprintf(keyboard_name, sizeof(keyboard_name),
+ "Keyboard%d", nkeyboards);
+ ++nkeyboards;
+ } while (xf86findInput(keyboard_name,
+ XF86Config->conf_input_lst));
+
+ model = xkb_rules->model.name[0];
+ layout = xkb_rules->layout.name[0];
+ variant = "";
+ options = XtNewString("");
+ XtSetArg(args[0], XtNstring, keyboard_name);
+ XtSetValues(ident_widget, args, 1);
+ }
+
+ info = xkb_rules;
+ omodel = model;
+ olayout = layout;
+ ovariant = variant;
+ ooptions = options ? XtNewString(options) : NULL;
+
+ xf86info.cur_list = KEYBOARD;
+ XtSetSensitive(back, xf86info.lists[KEYBOARD].cur_function > 0);
+ XtSetSensitive(next, xf86info.lists[KEYBOARD].cur_function <
+ xf86info.lists[KEYBOARD].num_functions - 1);
+ (xf86info.lists[KEYBOARD].functions[xf86info.lists[KEYBOARD].cur_function])
+ (&xf86info);
+
+ if (ConfigLoop(KeyboardConfigCheck) == True) {
+ if (keyboard == NULL) {
+ keyboard = XtNew(XF86ConfInputRec);
+ keyboard->list.next = NULL;
+ keyboard->inp_identifier = XtNewString(ident_string);
+ keyboard->inp_driver = XtNewString("keyboard");
+ keyboard->inp_option_lst = xf86newOption(XtNewString(XkbRules),
+ XtNewString(rules));
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbModel), XtNewString(model));
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbLayout), XtNewString(layout));
+ if (variant && *variant)
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbVariant), XtNewString(variant));
+ if (options && *options) {
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbOptions), options);
+ options = NULL;
+ }
+ keyboard->inp_comment = NULL;
+ }
+ else {
+ int i;
+ char *str;
+
+ XtSetArg(args[0], XtNlabel, &str);
+ XtGetValues(modelb, args, 1);
+ for (i = 0; i < xkb_rules->model.nelem; i++)
+ if (strcmp(xkb_rules->model.desc[i], str) == 0) {
+ model = xkb_rules->model.name[i];
+ break;
+ }
+
+ XtSetArg(args[0], XtNlabel, &str);
+ XtGetValues(layoutb, args, 1);
+ for (i = 0; i < xkb_rules->layout.nelem; i++)
+ if (strcmp(xkb_rules->layout.desc[i], str) == 0) {
+ layout = xkb_rules->layout.name[i];
+ break;
+ }
+
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbRules))
+ != NULL) {
+ XtFree(option->opt_val);
+ option->opt_val = XtNewString(rules);
+ XtFree(option->opt_comment);
+ option->opt_comment = NULL;
+ }
+ else
+ keyboard->inp_option_lst =
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbRules), XtNewString(rules));
+
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbModel))
+ != NULL) {
+ XtFree(option->opt_val);
+ option->opt_val = XtNewString(model);
+ XtFree(option->opt_comment);
+ option->opt_comment = NULL;
+ }
+ else
+ keyboard->inp_option_lst =
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbModel), XtNewString(model));
+ XtFree(xkb_info->config.model);
+ xkb_info->config.model = XtNewString(model);
+
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbLayout))
+ != NULL) {
+ XtFree(option->opt_val);
+ option->opt_val = XtNewString(layout);
+ }
+ else
+ keyboard->inp_option_lst =
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbLayout), XtNewString(layout));
+ XtFree(xkb_info->config.layout);
+ xkb_info->config.layout = XtNewString(layout);
+
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbVariant))
+ != NULL) {
+ if (variant && *variant) {
+ XtFree(option->opt_val);
+ option->opt_val = XtNewString(variant);
+ }
+ else
+ xf86removeOption(&keyboard->inp_option_lst, XkbVariant);
+ }
+ else if (variant && *variant)
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbVariant), XtNewString(variant));
+ XtFree(xkb_info->config.variant);
+ xkb_info->config.variant = variant && *variant ?
+ XtNewString(variant) : NULL;
+
+ XtFree(xkb_info->config.options);
+ xkb_info->config.options = options && *options ?
+ XtNewString(options) : NULL;
+ if ((option = xf86findOption(keyboard->inp_option_lst, XkbOptions))
+ != NULL) {
+ if (options && *options) {
+ XtFree(option->opt_val);
+ option->opt_val = options;
+ options = NULL;
+ }
+ else
+ xf86removeOption(&keyboard->inp_option_lst, XkbOptions);
+ }
+ else if (options && *options) {
+ xf86addNewOption(keyboard->inp_option_lst,
+ XtNewString(XkbOptions), options);
+ options = NULL;
+ }
+ }
+ if (strcasecmp(keyboard->inp_identifier, ident_string))
+ xf86renameInput(XF86Config, keyboard, ident_string);
+
+ xkb_info->conf = keyboard;
+ xkb_info->config.rules_file = rules;
+
+ return ((XtPointer)keyboard);
+ }
+
+ xkb_rules = info;
+ rules = info->rules;
+ model = omodel;
+ layout = olayout;
+ variant = ovariant;
+ XtFree(options);
+ options = ooptions;
+
+ return (NULL);
+}
+
+static Bool
+KeyboardConfigCheck(void)
+{
+ XF86ConfInputPtr keyboard = XF86Config->conf_input_lst;
+
+ while (keyboard != NULL) {
+ if (keyboard != current_input &&
+ strcasecmp(ident_string, keyboard->inp_identifier) == 0)
+ return (False);
+ keyboard = (XF86ConfInputPtr)(keyboard->list.next);
+ }
+
+ return (True);
+}
+
+/*ARGSUSED*/
+static void
+XkbUIEventHandler(Widget w, XtPointer closure,
+ XEvent *event, Boolean *continue_to_dispatch)
+{
+ XkbUI_ViewOptsRec opts;
+ XkbUI_ViewPtr view;
+ int width, height, bd;
+
+ if (event->xexpose.count > 1)
+ return;
+
+ bzero((char *)&opts, sizeof(opts));
+ bd = 1;
+ opts.present = XkbUI_SizeMask | XkbUI_ColormapMask |
+ XkbUI_MarginMask | XkbUI_OffsetMask;
+ opts.margin_width = opts.margin_height = 0;
+ opts.viewport.x = opts.viewport.y = bd;
+ width = opts.viewport.width = w->core.width - 2 * bd;
+ height = opts.viewport.height = w->core.height - 2 * bd;
+ opts.cmap = w->core.colormap;
+
+ if ((view = XkbUI_Init(XtDisplay(w), XtWindow(w), width, height,
+ xkb_info->xkb, &opts)) != NULL) {
+ XkbUI_DrawRegion(view, NULL);
+ free(view);
+ }
+}
+
+void
+InitializeKeyboard(void)
+{
+ int major, minor, op, event, error;
+ static int first = 1;
+ int timeout = 5;
+ XF86ConfInputPtr keyboard = XF86Config->conf_input_lst;
+ XF86OptionPtr option;
+ char name[PATH_MAX];
+ FILE *file;
+
+ if (!first)
+ return;
+ first = 0;
+
+ major = XkbMajorVersion;
+ minor = XkbMinorVersion;
+ if (XkbQueryExtension(DPY, &op, &event, &error, &major, &minor) == 0) {
+ fprintf(stderr, "Unable to initialize XKEYBOARD extension");
+ exit(1);
+ }
+
+ xkb_info = (XkbInfo *)XtCalloc(1, sizeof(XkbInfo));
+ xkb_info->conf = NULL;
+ xkb_infos = (XkbInfo**)XtCalloc(1, sizeof(XkbInfo*));
+ num_xkb_infos = 1;
+ xkb_infos[0] = xkb_info;
+ bzero((char*)&(xkb_info->defs), sizeof(XkbRF_VarDefsRec));
+
+ while (timeout > 0) {
+ xkb_info->xkb =
+ XkbGetKeyboard(DPY, XkbGBN_AllComponentsMask, XkbUseCoreKbd);
+ if (xkb_info->xkb == NULL) {
+ timeout -= 1;
+ sleep(1);
+ }
+ else
+ break;
+ }
+ if (timeout <= 0) {
+ fprintf(stderr, "Couldn't get keyboard\n");
+ }
+ if (xkb_info->xkb && xkb_info->xkb->names && xkb_info->xkb->geom &&
+ xkb_info->xkb->names->geometry == 0)
+ xkb_info->xkb->names->geometry = xkb_info->xkb->geom->name;
+
+ /* Load configuration */
+ XmuSnprintf(name, sizeof(name), "%s%s", XkbConfigDir, XkbConfigFile);
+ file = fopen(name, "r");
+ if (file != NULL) {
+ if (XkbCFParse(file, XkbCFDflts, xkb_info->xkb, &xkb_info->config) == 0) {
+ fprintf(stderr, "Error parsing config file: ");
+ XkbCFReportError(stderr, name, xkb_info->config.error,
+ xkb_info->config.line);
+ }
+ fclose(file);
+ }
+
+ xkb_rules = GetXkbRulesDesc(xkb_info->config.rules_file != NULL ?
+ xkb_info->config.rules_file : XkbRulesFile);
+ if (xkb_rules == NULL)
+ /* error message was printed */
+ exit(1);
+
+ /* XXX Assumes the first keyboard is the core keyboard */
+ while (keyboard != NULL) {
+ if (strcasecmp(keyboard->inp_driver, "keyboard") == 0)
+ break;
+ keyboard = (XF86ConfInputPtr)(keyboard->list.next);
+ }
+ if (keyboard == NULL)
+ return;
+
+ if (xkb_info->config.rules_file != NULL)
+ rules = xkb_info->config.rules_file;
+ else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbRules"))
+ != NULL)
+ rules = option->opt_val;
+ else
+ rules = XkbRulesFile;
+
+ if (strcmp(rules, xkb_rules->rules)) {
+ xkb_rules = GetXkbRulesDesc(rules);
+ if (xkb_rules == NULL)
+ /* error message was printed */
+ exit(1);
+ }
+ {
+ FILE *fp;
+ char filename[1024];
+
+ XmuSnprintf(filename, sizeof(filename), "%s%s",
+ XkbRulesDir, xkb_rules->rules);
+ if ((fp = fopen(filename, "r")) == NULL) {
+ fprintf(stderr, "Can't open rules file\n");
+ exit(1);
+ }
+
+ if (!XkbRF_LoadRules(fp, xkb_rules->list)) {
+ fclose(fp);
+ fprintf(stderr, "Can't load rules\n");
+ exit(1);
+ }
+ fclose(fp);
+ }
+
+ if (xkb_info->config.rules_file == NULL)
+ xkb_info->config.rules_file = xkb_rules->rules;
+
+ if (xkb_info->config.model != NULL)
+ xkb_info->defs.model = xkb_info->config.model;
+ else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbModel"))
+ != NULL)
+ xkb_info->defs.model = option->opt_val;
+ else
+ xkb_info->defs.model = xkb_rules->model.name[0];
+
+ if (xkb_info->config.layout != NULL)
+ xkb_info->defs.layout = xkb_info->config.layout;
+ else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbLayout"))
+ != NULL)
+ xkb_info->defs.layout = option->opt_val;
+ else
+ xkb_info->defs.layout = xkb_rules->layout.name[0];
+
+ if (xkb_info->config.variant != NULL)
+ xkb_info->defs.variant = xkb_info->config.variant;
+ else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbVariant"))
+ != NULL)
+ xkb_info->defs.variant = option->opt_val;
+ else
+ xkb_info->defs.variant = NULL;
+
+ if (xkb_info->config.options != NULL)
+ xkb_info->defs.options = xkb_info->config.options;
+ else if ((option = xf86findOption(keyboard->inp_option_lst, "XkbOptions"))
+ != NULL)
+ xkb_info->defs.options = option->opt_val;
+ else
+ xkb_info->defs.options = NULL;
+
+ if (xkb_info->xkb == NULL) {
+ /* Try again */
+ XkbComponentNamesRec comps;
+
+ bzero((char*)&comps, sizeof(XkbComponentNamesRec));
+ XkbRF_GetComponents(xkb_rules->list, &(xkb_info->defs), &comps);
+
+ xkb_info->xkb = XkbGetKeyboardByName(DPY, XkbUseCoreKbd, &comps,
+ XkbGBN_AllComponentsMask, 0, 0);
+ }
+}
+
+static XF86XkbRulesDescInfo *
+GetXkbRulesDesc(char *rules)
+{
+ int i;
+ XkbRF_RulesPtr list;
+ char filename[1024];
+ XF86XkbRulesDescInfo *info;
+
+ if (rules == NULL)
+ return (NULL);
+
+ for (i = 0; i < num_xkb_desc; i++)
+ if (strcmp(rules, xkb_desc[i]->rules) == 0)
+ return (xkb_desc[i]);
+
+ XmuSnprintf(filename, sizeof(filename), "%s%s", XkbRulesDir, rules);
+ if ((list = XkbRF_Create(0, 0)) == NULL ||
+ !XkbRF_LoadDescriptionsByName(filename, NULL, list)) {
+ fprintf(stderr, "Can't create rules structure\n");
+ return (NULL);
+ }
+
+ info = (XF86XkbRulesDescInfo*)XtCalloc(1, sizeof(XF86XkbRulesDescInfo));
+ xkb_desc = (XF86XkbRulesDescInfo**)
+ XtRealloc((XtPointer)xkb_desc,
+ sizeof(XF86XkbRulesDescInfo*) * (num_xkb_desc + 1));
+ xkb_desc[num_xkb_desc++] = info;
+ info->rules = XtNewString(rules);
+ for (i = 0; i < list->models.num_desc; i++) {
+ if (i % 16 == 0) {
+ info->model.name = (char**)XtRealloc((XtPointer)info->model.name,
+ (i + 16) * sizeof(char*));
+ info->model.desc = (char**)XtRealloc((XtPointer)info->model.desc,
+ (i + 16) * sizeof(char*));
+ }
+ info->model.name[i] = XtNewString(list->models.desc[i].name);
+ info->model.desc[i] = XtNewString(list->models.desc[i].desc);
+ }
+ info->model.nelem = i;
+
+ for (i = 0; i < list->layouts.num_desc; i++) {
+ if (i % 16 == 0) {
+ info->layout.name = (char**)XtRealloc((XtPointer)info->layout.name,
+ (i + 16) * sizeof(char*));
+ info->layout.desc = (char**)XtRealloc((XtPointer)info->layout.desc,
+ (i + 16) * sizeof(char*));
+ }
+ info->layout.name[i] = XtNewString(list->layouts.desc[i].name);
+ info->layout.desc[i] = XtNewString(list->layouts.desc[i].desc);
+ }
+ info->layout.nelem = i;
+
+ for (i = 0; i < list->variants.num_desc; i++) {
+ if (i % 16 == 0) {
+ info->variant.name = (char**)XtRealloc((XtPointer)info->variant.name,
+ (i + 16) * sizeof(char*));
+ info->variant.desc = (char**)XtRealloc((XtPointer)info->variant.desc,
+ (i + 16) * sizeof(char*));
+ }
+ info->variant.name[i] = XtNewString(list->variants.desc[i].name);
+ info->variant.desc[i] = XtNewString(list->variants.desc[i].desc);
+ }
+ info->variant.nelem = i;
+
+ for (i = 0; i < list->options.num_desc; i++) {
+ if (i % 16 == 0) {
+ info->option.name = (char**)XtRealloc((XtPointer)info->option.name,
+ (i + 16) * sizeof(char*));
+ info->option.desc = (char**)XtRealloc((XtPointer)info->option.desc,
+ (i + 16) * sizeof(char*));
+ }
+ info->option.name[i] = XtNewString(list->options.desc[i].name);
+ info->option.desc[i] = XtNewString(list->options.desc[i].desc);
+ }
+ info->option.nelem = i;
+ info->list = list;
+
+ return (info);
+}
+
+static xf86ConfigSymTabRec ax_controls[] =
+{
+ {XkbRepeatKeysMask, "RepeatKeys"},
+ {XkbSlowKeysMask, "SlowKeys"},
+ {XkbBounceKeysMask, "BounceKeys"},
+ {XkbStickyKeysMask, "StickyKeys"},
+ {XkbMouseKeysMask, "MouseKeys"},
+ {XkbMouseKeysAccelMask, "MouseKeysAccel"},
+ {XkbAccessXKeysMask, "AccessxKeys"},
+ {XkbAccessXTimeoutMask, "AccessxTimeout"},
+ {XkbAccessXFeedbackMask, "AccessxFeedback"},
+ {XkbAudibleBellMask, "AudibleBell"},
+ {XkbOverlay1Mask, "Overlay1"},
+ {XkbOverlay2Mask, "Overlay2"},
+ {XkbIgnoreGroupLockMask, "IgnoreGroupLock"},
+ {-1, ""},
+};
+
+static xf86ConfigSymTabRec ax_feedback[] =
+{
+ {XkbAX_SKPressFBMask, "SlowKeysPress"},
+ {XkbAX_SKAcceptFBMask, "SlowKeysAccept"},
+ {XkbAX_FeatureFBMask, "Feature"},
+ {XkbAX_SlowWarnFBMask, "SlowWarn"},
+ {XkbAX_IndicatorFBMask, "Indicator"},
+ {XkbAX_StickyKeysFBMask, "StickyKeys"},
+ {XkbAX_TwoKeysMask, "TwoKeys"},
+ {XkbAX_LatchToLockMask, "LatchToLock"},
+ {XkbAX_SKReleaseFBMask, "SlowKeysRelease"},
+ {XkbAX_SKRejectFBMask, "SlowkeysReject"},
+ {XkbAX_BKRejectFBMask, "BounceKeysReject"},
+ {XkbAX_DumbBellFBMask, "DumbBell"},
+ {-1, ""},
+};
+
+Bool
+WriteXKBConfiguration(char *filename, XkbConfigRtrnPtr conf)
+{
+ FILE *fp;
+ int i, count;
+
+ if (filename == NULL || conf == NULL ||
+ (fp = fopen(filename, "w")) == NULL)
+ return (False);
+
+ if (conf->rules_file != NULL)
+ fprintf(fp, "Rules = \"%s\"\n",
+ conf->rules_file);
+ if (conf->model != NULL)
+ fprintf(fp, "Model = \"%s\"\n",
+ conf->model);
+ if (conf->layout != NULL)
+ fprintf(fp, "Layout = \"%s\"\n",
+ conf->layout);
+ if (conf->variant != NULL)
+ fprintf(fp, "Variant = \"%s\"\n",
+ conf->variant);
+ if (conf->options != NULL)
+ fprintf(fp, "Options = \"%s\"\n",
+ conf->options);
+ if (conf->keymap != NULL)
+ fprintf(fp, "Keymap = %s\n",
+ conf->keymap);
+ if (conf->keycodes != NULL)
+ fprintf(fp, "Keycodes = %s\n",
+ conf->keycodes);
+ if (conf->geometry != NULL)
+ fprintf(fp, "Geometry = %s\n",
+ conf->geometry);
+ if (conf->phys_symbols != NULL)
+ fprintf(fp, "RealSymbols = %s\n",
+ conf->phys_symbols);
+ if (conf->symbols != NULL)
+ fprintf(fp, "Symbols = %s\n",
+ conf->symbols);
+ if (conf->types != NULL)
+ fprintf(fp, "Types = %s\n",
+ conf->types);
+ if (conf->compat != NULL)
+ fprintf(fp, "Compat = %s\n",
+ conf->compat);
+
+ if (conf->click_volume > 0)
+ fprintf(fp, "ClickVolume = %d\n",
+ conf->click_volume);
+ if (conf->bell_volume > 0)
+ fprintf(fp, "BellVolume = %d\n",
+ conf->bell_volume);
+ if (conf->bell_pitch > 0)
+ fprintf(fp, "BellPitch = %d\n",
+ conf->bell_pitch);
+ if (conf->bell_duration > 0)
+ fprintf(fp, "BellDuration = %d\n",
+ conf->bell_duration);
+
+ if (conf->repeat_delay > 0)
+ fprintf(fp, "RepeatDelay = %d\n",
+ conf->repeat_delay);
+ if (conf->repeat_interval > 0)
+ fprintf(fp, "RepeatInterval = %d\n",
+ conf->repeat_interval);
+
+ if (conf->slow_keys_delay > 0)
+ fprintf(fp, "SlowKeysDelay = %d\n",
+ conf->slow_keys_delay);
+
+ if (conf->debounce_delay > 0)
+ fprintf(fp, "DebounceDelay = %d\n",
+ conf->debounce_delay);
+
+ if (conf->mk_delay > 0)
+ fprintf(fp, "MouseKeysDelay = %d\n",
+ conf->mk_delay);
+ if (conf->mk_interval > 0)
+ fprintf(fp, "MouseKeysInterval = %d\n",
+ conf->mk_interval);
+ if (conf->mk_time_to_max > 0)
+ fprintf(fp, "MouseKeysTimeToMax = %d\n",
+ conf->mk_time_to_max);
+ if (conf->mk_max_speed > 0)
+ fprintf(fp, "MouseKeysMaxSpeed = %d\n",
+ conf->mk_max_speed);
+ fprintf(fp, "MouseKeysCurve = %d\n", conf->mk_curve);
+
+ if (conf->ax_timeout)
+ fprintf(fp, "AccessXTimeout = %d\n",
+ conf->ax_timeout);
+ if (conf->initial_ctrls != 0) {
+ fprintf(fp, "Controls %c= ",
+ conf->replace_initial_ctrls ? ' ' : '+');
+ for (i = count = 0; *ax_controls[i].name; i++)
+ if ((conf->initial_ctrls & ax_controls[i].token)
+ == ax_controls[i].token)
+ fprintf(fp, "%s%s", count++ ? " + " : "",
+ ax_controls[i].name);
+ fprintf(fp, "\n");
+ }
+ if (conf->axt_ctrls_on != 0) {
+ fprintf(fp, "AcessXTimeoutCtrlsOn %c= ",
+ conf->replace_axt_ctrls_on ? ' ' : '+');
+ for (i = count = 0; *ax_controls[i].name; i++)
+ if ((conf->axt_ctrls_on & ax_controls[i].token)
+ == ax_controls[i].token)
+ fprintf(fp, "%s%s", count++ ? " + " : "",
+ ax_controls[i].name);
+ fprintf(fp, "\n");
+ }
+ if (conf->axt_ctrls_off != 0) {
+ fprintf(fp, "AcessXTimeoutCtrlsOff %c= ",
+ conf->replace_axt_ctrls_off ? ' ' : '-');
+ for (i = count = 0; *ax_controls[i].name; i++)
+ if ((conf->axt_ctrls_off & ax_controls[i].token)
+ == ax_controls[i].token)
+ fprintf(fp, "%s%s", count++ ? " + " : "",
+ ax_controls[i].name);
+ fprintf(fp, "\n");
+ }
+
+ if (conf->initial_opts != 0) {
+ fprintf(fp, "Feedback %c= ",
+ conf->replace_initial_opts ? ' ' : '+');
+ for (i = count = 0; *ax_feedback[i].name; i++)
+ if ((conf->initial_opts & ax_feedback[i].token)
+ == ax_feedback[i].token)
+ fprintf(fp, "%s%s", count++ ? " + " : "",
+ ax_feedback[i].name);
+ fprintf(fp, "\n");
+ }
+ if (conf->axt_opts_on != 0) {
+ fprintf(fp, "AcessXTimeoutFeedbackOn %c= ",
+ conf->replace_axt_opts_on ? ' ' : '+');
+ for (i = count = 0; *ax_controls[i].name; i++)
+ if ((conf->axt_opts_on & ax_feedback[i].token)
+ == ax_feedback[i].token)
+ fprintf(fp, "%s%s", count++ ? " + " : "",
+ ax_feedback[i].name);
+ fprintf(fp, "\n");
+ }
+ if (conf->axt_opts_off != 0) {
+ fprintf(fp, "AcessXTimeoutFeedbackOff%c= ",
+ conf->replace_axt_opts_off ? ' ' : '-');
+ for (i = count = 0; *ax_feedback[i].name; i++)
+ if ((conf->axt_opts_off & ax_feedback[i].token)
+ == ax_feedback[i].token)
+ fprintf(fp, "%s%s", count++ ? " + " : "",
+ ax_feedback[i].name);
+ fprintf(fp, "\n");
+ }
+
+ fclose(fp);
+
+ return (True);
+}
+
+Bool
+UpdateKeyboard(Bool load)
+{
+ XkbComponentNamesRec comps;
+ XkbDescPtr xkb;
+
+ bzero((char*)&comps, sizeof(XkbComponentNamesRec));
+ XkbRF_GetComponents(xkb_rules->list, &(xkb_info->defs), &comps);
+
+ xkb = XkbGetKeyboardByName(DPY, XkbUseCoreKbd, &comps,
+ XkbGBN_AllComponentsMask, 0, load);
+
+ if (xkb == NULL || xkb->geom == NULL) {
+ fprintf(stderr, "Couldn't get keyboard\n");
+ return (False);
+ }
+ if (xkb_info->xkb && xkb_info->xkb->names && xkb_info->xkb->geom &&
+ xkb_info->xkb->names->geometry == 0)
+ xkb_info->xkb->names->geometry = xkb_info->xkb->geom->name;
+
+ XkbFreeKeyboard(xkb_info->xkb, 0, False);
+
+ xkb_info->xkb = xkb;
+
+ XtFree(comps.keymap);
+ XtFree(comps.keycodes);
+ XtFree(comps.compat);
+ XtFree(comps.types);
+ XtFree(comps.symbols);
+ XtFree(comps.geometry);
+
+ if (kbd != NULL)
+ XClearArea(XtDisplay(configp), XtWindow(kbd), 0, 0, 0, 0, True);
+
+ return (True);
+}
+
+static void
+KeyboardRulesCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i;
+ FILE *fp;
+ Arg args[1];
+ char filename[1024], *omodel, *olayout, *ovariant, *ooptions,
+ *dmodel, *dlayout, *dvariant;
+ XF86XkbRulesDescInfo *oxkb_rules, *info = GetXkbRulesDesc(XtName(w));
+
+ if (strcmp(XtName(w), rules) == 0 || info == NULL)
+ /* a error message was printed */
+ return;
+
+ XmuSnprintf(filename, sizeof(filename), "%s%s",
+ XkbRulesDir, info->rules);
+ if ((fp = fopen(filename, "r")) == NULL) {
+ fprintf(stderr, "Can't open rules file\n");
+ return;
+ }
+
+ if (!XkbRF_LoadRules(fp, info->list)) {
+ fclose(fp);
+ fprintf(stderr, "Can't load rules\n");
+ return;
+ }
+ fclose(fp);
+
+ oxkb_rules = xkb_rules;
+ omodel = xkb_info->defs.model;
+ olayout = xkb_info->defs.layout;
+ ovariant = xkb_info->defs.variant;
+ ooptions = xkb_info->defs.options;
+
+ if (omodel) {
+ for (i = 0; i < info->model.nelem; i++) {
+ if (strcmp(omodel, info->model.name[i]) == 0)
+ break;
+ }
+ }
+ else
+ i = 0;
+ model = xkb_info->defs.model = info->model.name
+ [i < info->model.nelem ? i : 0];
+ dmodel = info->model.desc[i < info->model.nelem ? i : 0];
+
+ if (olayout) {
+ for (i = 0; i < info->layout.nelem; i++) {
+ if (strcmp(olayout, info->layout.name[i]) == 0)
+ break;
+ }
+ }
+ else
+ i = 0;
+ layout = xkb_info->defs.layout = info->layout.name
+ [i < info->layout.nelem ? i : 0];
+ dlayout = info->layout.desc[i < info->layout.nelem ? i : 0];
+
+ if (ovariant) {
+ for (i = 0; i < info->variant.nelem; i++) {
+ if (strcmp(ovariant, info->variant.name[i]) == 0)
+ break;
+ }
+ }
+ else
+ i = info->variant.nelem;
+ variant = xkb_info->defs.variant = i < info->variant.nelem ?
+ info->variant.name[i] : NULL;
+ dvariant = i < info->variant.nelem ?
+ info->variant.desc[i] : NULL;
+
+ if (ooptions) {
+ char *ptr, *tmp = XtNewString(options);
+
+ for (ptr = strtok(tmp, ","); ptr != NULL; ptr = strtok(NULL, ",")) {
+ if (strchr(ptr, ':') == NULL)
+ continue;
+
+ for (i = 0; i < xkb_rules->option.nelem; i++)
+ if (strcmp(xkb_rules->option.name[i], ptr) == 0)
+ break;
+
+ if (i == xkb_rules->option.nelem) {
+ XtFree(options);
+ options = NULL;
+ /* no option with the same name */
+ break;
+ }
+ }
+ XtFree(tmp);
+ }
+ else {
+ XtFree(options);
+ options = NULL;
+ }
+
+ oxkb_rules = xkb_rules;
+ xkb_rules = info;
+ rules = info->rules;
+
+ if (!UpdateKeyboard(False)) {
+ model = xkb_info->defs.model = omodel;
+ layout = xkb_info->defs.layout = olayout;
+ variant = xkb_info->defs.variant = ovariant;
+ options = XtNewString(xkb_info->defs.options = ooptions);
+ xkb_rules = oxkb_rules;
+ rules = xkb_rules->rules;
+
+ XmuSnprintf(filename, sizeof(filename), "%s%s",
+ XkbRulesDir, rules);
+ if ((fp = fopen(filename, "r")) == NULL) {
+ fprintf(stderr, "Can't open rules file\n");
+ return;
+ }
+
+ if (!XkbRF_LoadRules(fp, xkb_rules->list)) {
+ fclose(fp);
+ fprintf(stderr, "Can't load rules\n");
+ }
+ fclose(fp);
+
+ return;
+ }
+
+ UpdateRulesPopups();
+
+ XtSetArg(args[0], XtNlabel, rules);
+ XtSetValues(rulesb, args, 1);
+
+ XtSetArg(args[0], XtNlabel, dmodel);
+ XtSetValues(modelb, args, 1);
+
+ XtSetArg(args[0], XtNlabel, dlayout);
+ XtSetValues(layoutb, args, 1);
+
+ XtSetArg(args[0], XtNlabel, dvariant ? dvariant : "");
+ XtSetValues(variantb, args, 1);
+
+ XtSetArg(args[0], XtNlabel, options ? options : "");
+ XtSetValues(variantb, args, 1);
+}
+
+static void
+KeyboardModelCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ int i;
+ char *oldval = xkb_info->defs.model;
+
+ for (i = 0; i < xkb_rules->model.nelem; i++)
+ if (strcmp(XtName(w), xkb_rules->model.name[i]) == 0)
+ break;
+ model = xkb_info->defs.model = xkb_rules->model.name[i];
+ if (!UpdateKeyboard(False))
+ model = xkb_info->defs.model = oldval;
+ else {
+ XtSetArg(args[0], XtNlabel, xkb_rules->model.desc[i]);
+ XtSetValues(modelb, args, 1);
+ }
+}
+
+static void
+KeyboardLayoutCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ int i;
+ char *oldval = xkb_info->defs.layout;
+
+ for (i = 0; i < xkb_rules->layout.nelem; i++)
+ if (strcmp(XtName(w), xkb_rules->layout.name[i]) == 0)
+ break;
+ layout = xkb_info->defs.layout = xkb_rules->layout.name[i];
+ if (!UpdateKeyboard(False))
+ layout = xkb_info->defs.layout = oldval;
+ else {
+ XtSetArg(args[0], XtNlabel, xkb_rules->layout.desc[i]);
+ XtSetValues(layoutb, args, 1);
+ }
+}
+
+static void
+KeyboardVariantCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ int i;
+ char *label, *oldval = xkb_info->defs.variant;
+
+ for (i = 0; i < xkb_rules->variant.nelem; i++)
+ if (strcmp(XtName(w), xkb_rules->variant.name[i]) == 0)
+ break;
+ variant = i < xkb_rules->variant.nelem ? xkb_rules->variant.name[i] : "";
+ xkb_info->defs.variant = variant && *variant ? variant : NULL;
+
+ if (!UpdateKeyboard(False))
+ xkb_info->defs.variant = variant = oldval;
+ else {
+ label = i < xkb_rules->variant.nelem ? xkb_rules->variant.desc[i] : "";
+ XtSetArg(args[0], XtNlabel, label);
+ XtSetValues(variantb, args, 1);
+ }
+}
+
+static void
+KeyboardOptionsCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ int i;
+
+ for (i = 0; i < xkb_rules->option.nelem; i++)
+ if (strcmp(XtName(w), xkb_rules->option.name[i]) == 0)
+ break;
+
+ if (i < xkb_rules->option.nelem) {
+ char *delim, *ptr, str[256];
+
+ /* remove old string, don't check if the same */
+ if ((delim = strchr(XtName(w), ':')) != NULL) {
+ if (delim - XtName(w) >= sizeof(str) - 2)
+ return;
+ strncpy(str, XtName(w), delim - XtName(w) + 1);
+ str[delim - XtName(w) + 1] = '\0';
+ }
+ else
+ XmuSnprintf(str, sizeof(str), "%s:", XtName(w));
+ if (options && (delim = strstr(options, str)) != NULL) {
+ if ((ptr = strchr(delim, ',')) != NULL) {
+ *delim = *ptr = '\0';
+ XmuSnprintf(str, sizeof(str), "%s%s", options, ptr + 1);
+ XtFree(options);
+ options = XtNewString(str);
+ }
+ else {
+ if (delim > options)
+ delim[-1] = '\0';
+ else
+ delim[0] = '\0';
+ }
+ }
+
+ /* update string, if required */
+ if ((delim = strchr(XtName(w), ':')) != NULL) {
+ if (options && *options)
+ XmuSnprintf(str, sizeof(str), "%s,%s", options, XtName(w));
+ else
+ XmuSnprintf(str, sizeof(str), "%s", XtName(w));
+ XtFree(options);
+ options = XtNewString(str);
+ }
+ }
+ else {
+ XtFree(options);
+ options = XtNewString("");
+ }
+
+ if (options == NULL)
+ options = XtNewString("");
+
+ xkb_info->defs.options = options;
+ if (!UpdateKeyboard(False)) {
+ *options = '\0';
+ xkb_info->defs.options = NULL;
+ }
+ XtSetArg(args[0], XtNlabel, options);
+ XtSetValues(optionsb, args, 1);
+ XtSetArg(args[0], XtNtip, options);
+ XtSetValues(optionsb, args, 1);
+}
+
+/*ARGSUSED*/
+static void
+KeyboardApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ (void)UpdateKeyboard(True);
+}
+
+static void
+UpdateRulesPopups(void)
+{
+ int i;
+ char *optname;
+ Widget sme, optpopup = NULL, optparent;
+
+ /* MODEL */
+ if (modelp)
+ XtDestroyWidget(modelp);
+ modelp = XtCreatePopupShell("modelP", simpleMenuWidgetClass,
+ modelb, NULL, 0);
+ for (i = 0; i < xkb_rules->model.nelem; i++) {
+ sme = XtVaCreateManagedWidget(xkb_rules->model.name[i], smeBSBObjectClass,
+ modelp,
+ XtNlabel, xkb_rules->model.desc[i],
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, KeyboardModelCallback, NULL);
+ }
+
+ /* LAYOUT */
+ if (layoutp)
+ XtDestroyWidget(layoutp);
+ layoutp = XtCreatePopupShell("layoutP", simpleMenuWidgetClass,
+ layoutb, NULL, 0);
+ for (i = 0; i < xkb_rules->layout.nelem; i++) {
+ sme = XtVaCreateManagedWidget(xkb_rules->layout.name[i], smeBSBObjectClass,
+ layoutp,
+ XtNlabel, xkb_rules->layout.desc[i],
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, KeyboardLayoutCallback, NULL);
+ }
+
+ /* VARIANT */
+ if (variantp)
+ XtDestroyWidget(variantp);
+ variantp = XtCreatePopupShell("variantP", simpleMenuWidgetClass,
+ variantb, NULL, 0);
+ sme = XtVaCreateManagedWidget("None", smeBSBObjectClass,
+ variantp,
+ XtNlabel, "None",
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, KeyboardVariantCallback, NULL);
+ for (i = 0; i < xkb_rules->variant.nelem; i++) {
+ sme = XtVaCreateManagedWidget(xkb_rules->variant.name[i], smeBSBObjectClass,
+ variantp,
+ XtNlabel, xkb_rules->variant.desc[i],
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, KeyboardVariantCallback, NULL);
+ }
+
+ /* OPTIONS */
+ if (optionsp)
+ XtDestroyWidget(optionsp);
+ optionsp = XtCreatePopupShell("optionsP", simpleMenuWidgetClass,
+ optionsb, NULL, 0);
+ sme = XtVaCreateManagedWidget("None", smeBSBObjectClass,
+ optionsp,
+ XtNlabel, "None",
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, KeyboardOptionsCallback, NULL);
+ optparent = optionsp;
+ optname = NULL;
+ for (i = 0; i < xkb_rules->option.nelem; i++) {
+ if (!strchr(xkb_rules->option.name[i], ':')) {
+ optpopup =
+ XtCreatePopupShell(optname = xkb_rules->option.desc[i],
+ simpleMenuWidgetClass,
+ optparent = optionsp, NULL, 0);
+ sme = XtVaCreateManagedWidget(xkb_rules->option.name[i],
+ smeBSBObjectClass,
+ optpopup,
+ XtNlabel, "None",
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, KeyboardOptionsCallback, NULL);
+ }
+ else {
+ optparent = optpopup;
+ optname = NULL;
+ }
+ sme = XtVaCreateManagedWidget(xkb_rules->option.name[i], smeBSBObjectClass,
+ optparent,
+ XtNlabel, xkb_rules->option.desc[i],
+ XtNmenuName, optname,
+ XtNleftBitmap, optname ? menuPixmap : None,
+ NULL, 0);
+ if (optparent != optionsp)
+ XtAddCallback(sme, XtNcallback, KeyboardOptionsCallback, NULL);
+ }
+}
+
+void
+KeyboardModelAndLayout(XF86SetupInfo *info)
+{
+ static int first = 1;
+ static Widget kbdml;
+ Arg args[1];
+ int i;
+
+ if (first) {
+ Widget popup, sme;
+
+ first = 0;
+
+ kbdml = XtCreateWidget("keyboardML", formWidgetClass,
+ configp, NULL, 0);
+
+ /* RULES */
+ XtCreateManagedWidget("labelR", labelWidgetClass, kbdml, NULL, 0);
+ rulesb = XtVaCreateManagedWidget("rules", menuButtonWidgetClass, kbdml,
+ XtNmenuName, "rulesP",
+ NULL, 0);
+ popup = XtCreatePopupShell("rulesP", simpleMenuWidgetClass,
+ rulesb, NULL, 0);
+ {
+ struct dirent *ent;
+ DIR *dir;
+
+ if ((dir = opendir(XkbRulesDir)) != NULL) {
+ (void)readdir(dir);
+ (void)readdir(dir);
+ while ((ent = readdir(dir)) != NULL) {
+ if (strchr(ent->d_name, '.'))
+ continue;
+
+ sme = XtVaCreateManagedWidget(ent->d_name, smeBSBObjectClass,
+ popup,
+ XtNlabel, ent->d_name,
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, KeyboardRulesCallback, NULL);
+ }
+ closedir(dir);
+ }
+ }
+
+ /* MODEL */
+ XtCreateManagedWidget("labelM", labelWidgetClass, kbdml, NULL, 0);
+ modelb = XtVaCreateManagedWidget("model", menuButtonWidgetClass, kbdml,
+ XtNmenuName, "modelP",
+ NULL, 0);
+
+ /* LAYOUT */
+ XtCreateManagedWidget("labelL", labelWidgetClass, kbdml, NULL, 0);
+ layoutb = XtVaCreateManagedWidget("layout", menuButtonWidgetClass, kbdml,
+ XtNmenuName, "layoutP",
+ XtNlabel, xkb_rules->layout.desc[0],
+ NULL, 0);
+
+ /* VARIANT */
+ XtCreateManagedWidget("labelV", labelWidgetClass, kbdml, NULL, 0);
+ variantb = XtVaCreateManagedWidget("variant", menuButtonWidgetClass, kbdml,
+ XtNmenuName, "variantP",
+ XtNlabel, "",
+ NULL, 0);
+
+ /* OPTIONS */
+ XtCreateManagedWidget("labelO", labelWidgetClass, kbdml, NULL, 0);
+ optionsb = XtVaCreateManagedWidget("options", menuButtonWidgetClass, kbdml,
+ XtNmenuName, "optionsP",
+ XtNlabel, "",
+ NULL, 0);
+
+ UpdateRulesPopups();
+
+ kbd = XtCreateManagedWidget("keyboard", coreWidgetClass,
+ kbdml, NULL, 0);
+
+ apply = XtCreateManagedWidget("apply", commandWidgetClass,
+ kbdml, NULL, 0);
+ XtAddCallback(apply, XtNcallback, KeyboardApplyCallback, NULL);
+
+ XtRealizeWidget(kbdml);
+
+ XtAddEventHandler(kbd, ExposureMask, False, XkbUIEventHandler, NULL);
+ /* Force the first update */
+ XClearArea(XtDisplay(kbd), XtWindow(kbd), 0, 0, 0, 0, True);
+ }
+
+ XtSetArg(args[0], XtNlabel, xkb_rules->rules);
+ XtSetValues(rulesb, args, 1);
+
+ for (i = 0; i < xkb_rules->model.nelem; i++)
+ if (strcmp(model, xkb_rules->model.name[i]) == 0) {
+ XtSetArg(args[0], XtNlabel, xkb_rules->model.desc[i]);
+ XtSetValues(modelb, args, 1);
+ break;
+ }
+
+ for (i = 0; i < xkb_rules->layout.nelem; i++)
+ if (strcmp(layout, xkb_rules->layout.name[i]) == 0) {
+ XtSetArg(args[0], XtNlabel, xkb_rules->layout.desc[i]);
+ XtSetValues(layoutb, args, 1);
+ break;
+ }
+
+ if (variant)
+ for (i = 0; i < xkb_rules->variant.nelem; i++)
+ if (strcmp(variant, xkb_rules->variant.name[i]) == 0) {
+ XtSetArg(args[0], XtNlabel, xkb_rules->variant.desc[i]);
+ XtSetValues(variantb, args, 1);
+ break;
+ }
+
+ if (options) {
+ XtSetArg(args[0], XtNlabel, options);
+ XtSetValues(optionsb, args, 1);
+ }
+
+ XtChangeManagedSet(&current, 1, NULL, NULL, &kbdml, 1);
+ current = kbdml;
+}
diff --git a/hw/xfree86/utils/xorgcfg/keyboard-cfg.h b/hw/xfree86/utils/xorgcfg/keyboard-cfg.h
new file mode 100644
index 000000000..6ff63c002
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/keyboard-cfg.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.h,v 1.3 2001/03/02 22:39:27 paulo Exp $
+ */
+
+#include "config.h"
+#include <X11/extensions/XKBconfig.h>
+
+#ifndef _xf86cfg_keyboard_h
+#define _xf86cfg_keyboard_h
+
+/*
+ * All file names are from XProjectRoot or XWINHOME environment variable.
+ */
+#define XkbConfigDir "lib/X11/xkb/"
+#define XkbConfigFile "X0-config.keyboard"
+
+/*
+ * Types
+ */
+typedef struct {
+ char **name;
+ char **desc;
+ int nelem;
+} XF86XkbDescInfo;
+
+typedef struct {
+ XF86ConfInputPtr conf;
+ XkbDescPtr xkb;
+ XkbRF_VarDefsRec defs;
+ XkbConfigRtrnRec config;
+} XkbInfo;
+
+/*
+ * Prototypes
+ */
+XtPointer KeyboardConfig(XtPointer);
+void KeyboardModelAndLayout(XF86SetupInfo*);
+void InitializeKeyboard(void);
+Bool UpdateKeyboard(Bool);
+Bool WriteXKBConfiguration(char*, XkbConfigRtrnPtr);
+
+/*
+ * Initialization
+ */
+extern XkbInfo *xkb_info;
+
+#endif /* _xf86cfg_keyboard_h */
diff --git a/hw/xfree86/utils/xorgcfg/keyboard.xbm b/hw/xfree86/utils/xorgcfg/keyboard.xbm
new file mode 100644
index 000000000..69d4aac42
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/keyboard.xbm
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard.xbm,v 1.1 2000/04/04 22:36:59 dawes Exp $
+ */
+#define keyboard_width 50
+#define keyboard_height 44
+static unsigned char keyboard_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xe0, 0xff, 0xff, 0xff,
+ 0xff, 0x1f, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x78, 0x9e,
+ 0xe7, 0x3d, 0xef, 0x79, 0x00, 0x18, 0x9a, 0xa6, 0x35, 0xad, 0x61, 0x00,
+ 0x18, 0x9e, 0xe7, 0x3d, 0xef, 0x61, 0x00, 0x18, 0x9e, 0xe7, 0x3d, 0xef,
+ 0x61, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x18, 0x00, 0x00,
+ 0x00, 0x00, 0x60, 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x67, 0x00, 0x98,
+ 0xd6, 0x5a, 0x6b, 0x2d, 0x66, 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x66,
+ 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x66, 0x00, 0x18, 0x00, 0x00, 0x00,
+ 0x80, 0x66, 0x00, 0x98, 0xdf, 0x7b, 0xef, 0xbd, 0x66, 0x00, 0x98, 0x58,
+ 0x6b, 0xad, 0xb5, 0x66, 0x00, 0x98, 0xdf, 0x7b, 0xef, 0xbd, 0x67, 0x00,
+ 0x98, 0xdf, 0x7b, 0xef, 0xbd, 0x67, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
+ 0x60, 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x67, 0x00, 0x98, 0xd6, 0x5a,
+ 0x6b, 0x2d, 0x66, 0x00, 0x98, 0xf7, 0xde, 0x7b, 0xef, 0x67, 0x00, 0x98,
+ 0xf7, 0xde, 0x7b, 0xef, 0x67, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x60,
+ 0x00, 0x98, 0xf7, 0xfd, 0xf7, 0xbd, 0x67, 0x00, 0x98, 0x96, 0x05, 0x96,
+ 0xb5, 0x66, 0x00, 0x98, 0xf7, 0xfd, 0xf7, 0xbd, 0x67, 0x00, 0x98, 0xf7,
+ 0xfd, 0xf7, 0xbd, 0x67, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00,
+ 0x38, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,
+ 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x0f, 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, };
diff --git a/hw/xfree86/utils/xorgcfg/keyboard.xpm b/hw/xfree86/utils/xorgcfg/keyboard.xpm
new file mode 100644
index 000000000..5ef7b605d
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/keyboard.xpm
@@ -0,0 +1,66 @@
+/* XPM */
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard.xpm,v 1.1 2000/04/04 22:36:59 dawes Exp $
+ */
+static char * card_xpm[] = {
+"60 28 5 1",
+" c none",
+". c #AEBAAEBAAEBA",
+"X c #CF3CCF3CCF3C",
+"o c #8E388A288E38",
+"O c #69A671C669A6",
+" ........................ ",
+" .............................XXXXXXXXXXXXXXXXXXXXXXXX..... ",
+".XXXXXXXXXXXXXXXXXXXXXXXXXXXXX........................XXXXoO",
+".X........................................................oO",
+".X........................................................oO",
+".X.Xo..Xo.Xo.Xo..Xo.Xo.Xo.Xo.Xo.Xo..Xo.Xo.Xo..ooooooooooo.oO",
+".X.oo..oo.oo.oo..oo.oo.oo.oo.oo.oo..oo.oo.oo..XXXXXXXXXXX.oO",
+".X........................................................oO",
+".X........................................................oO",
+".X.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.o..Xo.Xo.Xo..Xo.Xo.Xo.Xo.oO",
+".X.oo.oo.oo.oo.oo.oo.oo.oo.oo.oo.o..oo.oo.oo..oo.oo.oo.oo.oO",
+".X........................................................oO",
+".X.XXo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.oXo..Xo.Xo.Xo..Xo.Xo.Xo.Xo.oO",
+".X.ooo.oo.oo.oo.oo.oo.oo.oo.oo..Xo..oo.oo.oo..oo.oo.oo.Xo.oO",
+".X..............................Xo.....................Xo.oO",
+".X.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.XXXo..Xo.Xo.Xo..Xo.Xo.Xo.Xo.oO",
+".X.oo.oo.oo.oo.oo.oo.oo.oo.oo.oooo..oo.oo.oo..oo.oo.oo.oo.oO",
+".X........................................................oO",
+".X.XXo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.Xo.XXo.....Xo.....Xo.Xo.Xo.Xo.oO",
+".X.ooo.oo.oo.oo.oo.oo.oo.oo.oo.ooo.....oo.....oo.oo.oo.Xo.oO",
+".X.....................................................Xo.oO",
+".X.Xo.Xo.Xo.XXXXXXXXXXXXo.Xo.Xo.Xo..Xo.Xo.Xo..XXXXo.Xo.Xo.oO",
+".X.oo.oo.oo.ooooooooooooo.oo.oo.oo..oo.oo.oo..ooooo.oo.oo.oO",
+".X........................................................oO",
+".X........................................................oO",
+".Xooooo.......................oooooooooooooooooooooooooooooO",
+" XOOOOOoooooooooooooooooooooooOOOOOOOOOOOOOOOOOOOOOOOOOOOOO ",
+" OOOOOOOOOOOOOOOOOOOOOOO "};
diff --git a/hw/xfree86/utils/xorgcfg/left.xbm b/hw/xfree86/utils/xorgcfg/left.xbm
new file mode 100644
index 000000000..bfb8f3ba8
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/left.xbm
@@ -0,0 +1,8 @@
+#define left_width 19
+#define left_height 19
+static unsigned char left_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x07, 0x00, 0x80, 0x07, 0x00, 0xc0, 0x07, 0x00, 0xe0, 0xff, 0x01,
+ 0xf0, 0xff, 0x01, 0xf8, 0xff, 0x01, 0xf0, 0xff, 0x01, 0xe0, 0xff, 0x01,
+ 0xc0, 0x07, 0x00, 0x80, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/loader.c b/hw/xfree86/utils/xorgcfg/loader.c
new file mode 100644
index 000000000..ddfa2903f
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/loader.c
@@ -0,0 +1,396 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.19 2002/06/06 21:03:32 paulo Exp $
+ */
+
+#include "config.h"
+#include "cards.h"
+#include "options.h"
+#include "loader.h"
+#include "stubs.h"
+#include <X11/Xresource.h>
+
+#ifdef USE_MODULES
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <ctype.h>
+
+#include <stdarg.h>
+
+#ifndef SIGNALRETURNSINT
+void sig_handler(int);
+#else
+int sig_handler(int);
+#endif /* SIGNALRETURNSINT */
+
+static Bool EnumDatabase(XrmDatabase*, XrmBindingList, XrmQuarkList,
+ XrmRepresentation*, XrmValue*, XPointer);
+
+static sigjmp_buf jmp;
+int signal_caught;
+int error_level;
+char *loaderPath, **loaderList, **ploaderList;
+extern XrmDatabase options_xrm;
+extern int noverify;
+extern ModuleType module_type;
+static OptionInfoPtr option;
+
+extern FontModule *font_module;
+extern int numFontModules;
+
+char **checkerLegend;
+int *checkerErrors;
+
+#ifndef SIGNALRETURNSINT
+void
+#else
+int
+#endif
+sig_handler(int sig)
+{
+ char *str;
+
+ switch (sig) {
+ case SIGTRAP:
+ str = "TRAP";
+ break;
+ case SIGBUS:
+ str = "BUS";
+ break;
+ case SIGSEGV:
+ str = "SEGV";
+ break;
+ case SIGILL:
+ str = "ILL";
+ break;
+ case SIGFPE:
+ str = "FPE";
+ break;
+ default:
+ str = "???";
+ break;
+ }
+
+ if (signal_caught == 1) {
+ ErrorF(" ERROR I am dead.\n");
+ exit(1);
+ }
+ else if (signal_caught == 2)
+ abort();
+ ++signal_caught;
+ ErrorF(" ERROR SIG%s caught!\n", str);
+ if (!noverify)
+ error_level += 50;
+ siglongjmp(jmp, 1);
+ /*NOTREACHED*/
+}
+
+void
+CheckMsg(int code, char *fmt, ...)
+{
+ va_list ap;
+
+ ++checkerErrors[code];
+ ErrorF("%3d ", code);
+
+ va_start(ap, fmt);
+ VErrorF(fmt, ap);
+ va_end(ap);
+}
+
+static Bool
+EnumDatabase(XrmDatabase *db, XrmBindingList bindings, XrmQuarkList quarks,
+ XrmRepresentation *type, XrmValue *value, XPointer closure)
+{
+ char *res = XrmQuarkToString(quarks[1]);
+
+ if (res) {
+ option = module_options->option;
+ while (option->name) {
+ if (strcasecmp(option->name, res) == 0)
+ return (False);
+ ++option;
+ }
+ CheckMsg(CHECKER_OPTION_UNUSED,
+ "WARNING %s.%s is not used\n",
+ XrmQuarkToString(quarks[0]), res);
+ ++error_level;
+ }
+
+ return (False);
+}
+
+Bool
+LoaderInitializeOptions(void)
+{
+ static int first = 1;
+ static char *modules = "lib/modules";
+ volatile Bool options_ok = False;
+ char *ptr, query[256];
+ char *ptr2, query2[256];
+ char *type;
+ XrmValue value;
+ XrmQuark names[2];
+ XrmQuark classes[2];
+ volatile int i;
+ static ModuleType module_types[] = {
+ GenericModule, FontRendererModule, InputModule, VideoModule, NullModule
+ };
+
+ /* The offset in this vector must match loader.h:enum ModuleType values */
+ static char *module_strs[] = {
+ "Null Module", "Video Module", "Input Module", "Generic Module", "Font Module"
+ };
+
+ if (first) {
+ checkerLegend = (char**)
+ XtCalloc(1, sizeof(char*) * (CHECKER_LAST_MESSAGE + 1));
+ checkerErrors = (int*)
+ XtCalloc(1, sizeof(int) * (CHECKER_LAST_MESSAGE + 1));
+ xf86cfgLoaderInit();
+ first = 0;
+
+ checkerLegend[CHECKER_OPTIONS_FILE_MISSING] =
+ "The Options file, normally /usr/X11R6/lib/X11/Options was not found.\n"
+ "In the sources, it is at xc/programs/Xserver/hw/xfree86/Options.";
+ checkerLegend[CHECKER_OPTION_DESCRIPTION_MISSING] =
+ "No description for the module option. The description should be in\n"
+ "in the Options file, and using the sintax:\n"
+ "Module.Option: any text describing the option";
+ checkerLegend[CHECKER_LOAD_FAILED] =
+ "Failed to load the module. Usually the loader will print a complete\n"
+ "description for the reason the module was not loaded. Use the -verbose\n"
+ "command line option if it is not printing any messages.";
+ checkerLegend[CHECKER_RECOGNIZED_AS] =
+ "This message means the module code did not follow what was expected\n"
+ "by the checker. For video drivers, it did not call xf86AddDriver,\n"
+ "a input module did not call xf86AddInputDriver and a font renderer\n"
+ "module did not call LoadFont. This message can also be printed if\n"
+ "the module is in the incorrect directory.";
+ checkerLegend[CHECKER_NO_OPTIONS_AVAILABLE] =
+ "The driver does not have an AvailableOptions function, or that\n"
+ "function is returning NULL. If the driver is returning NULL, and\n"
+ "really does not need any options from XF86Config, than the message\n"
+ "can be ignored.";
+ checkerLegend[CHECKER_NO_VENDOR_CHIPSET] =
+ "The checker could not fetch the PCI chipset/vendor information from\n"
+ "the module. The checker currently wraps xf86PrintChipsets and\n"
+ "xf86MatchPciInstances to read the information from the module.";
+ checkerLegend[CHECKER_CANNOT_VERIFY_CHIPSET] =
+ "The vendor id was not found, so it is not possible to search the list\n"
+ "of chipsets.";
+ checkerLegend[CHECKER_OPTION_UNUSED] =
+ "The option description is defined in the Options file, but the option\n"
+ "was name not retrieved when calling the module AvailableOptions.";
+ checkerLegend[CHECKER_NOMATCH_CHIPSET_STRINGS] =
+ "The string specified in the module does not match the one in\n"
+ "common/xf86PciInfo.h";
+ checkerLegend[CHECKER_CHIPSET_NOT_LISTED] =
+ "This means that common/xf86PciInfo.h does not have an entry for the\n"
+ "given vendor and id.";
+ checkerLegend[CHECKER_CHIPSET_NOT_SUPPORTED] =
+ "The chipset is listed in common/xf86PciInfo.h, but the driver does\n"
+ "not support it, or does not list it in the chipsets fetched by the checker.";
+ checkerLegend[CHECKER_CHIPSET_NO_VENDOR] =
+ "The vendor id specified to xf86MatchPciInstances is not defined in\n"
+ "common/xf86PciInfo.h";
+ checkerLegend[CHECKER_NO_CHIPSETS] =
+ "No chipsets were passed to xf86MatchPciIntances.";
+ checkerLegend[CHECKER_FILE_MODULE_NAME_MISMATCH] =
+ "The module name string does not match the the modname field of the\n"
+ "XF86ModuleVersionInfo structure. This generally is not an error, but\n"
+ "to may be a good idea to use the same string to avoid confusion.";
+ }
+
+ if (XF86Module_path == NULL) {
+ XF86Module_path = malloc(strlen(XFree86Dir) + strlen(modules) + 2);
+ sprintf(XF86Module_path, "%s/%s", XFree86Dir, modules);
+ }
+
+ if (loaderPath == NULL || strcmp(XF86Module_path, loaderPath))
+ loaderPath = strdup(XF86Module_path);
+ else
+ /* nothing new */
+ return (True);
+
+ if (!noverify) {
+ options_ok = InitializeOptionsDatabase();
+ InitializePciInfo();
+ }
+
+ for (i = 0; module_types[i] != NullModule; i++) {
+ xf86cfgLoaderInitList(module_types[i]);
+ if (!noverify)
+ ErrorF("================= Checking modules of type \"%s\" =================\n",
+ module_strs[module_types[i]]);
+
+ if (loaderList) {
+ for (ploaderList = loaderList; *ploaderList; ploaderList++) {
+ signal_caught = 0;
+ signal(SIGTRAP, sig_handler);
+ signal(SIGBUS, sig_handler);
+ signal(SIGSEGV, sig_handler);
+ signal(SIGILL, sig_handler);
+ signal(SIGFPE, sig_handler);
+ if (sigsetjmp(jmp, 1) == 0) {
+ if (!noverify) {
+ int ok, nfont_modules;
+
+ nfont_modules = numFontModules;
+ error_level = 0;
+ ErrorF("CHECK MODULE %s\n", *ploaderList);
+ if ((ok = xf86cfgCheckModule()) == 0) {
+ CheckMsg(CHECKER_LOAD_FAILED,
+ "ERROR Failed to load module.\n");
+ error_level += 50;
+ }
+ else if (module_type != module_types[i]) {
+ CheckMsg(CHECKER_RECOGNIZED_AS,
+ "WARNING %s recognized as a \"%s\"\n", *ploaderList,
+ module_strs[module_type]);
+ ++error_level;
+ }
+ if (ok) {
+ if (options_ok) {
+ if ((module_options == NULL || module_options->option == NULL) &&
+ module_type != GenericModule) {
+ CheckMsg(CHECKER_NO_OPTIONS_AVAILABLE,
+ "WARNING Not a generic module, but no options available.\n");
+ ++error_level;
+ }
+ else if (module_options && strcmp(module_options->name, *ploaderList) == 0) {
+ ErrorF(" CHECK OPTIONS\n");
+ option = module_options->option;
+
+ while (option->name) {
+ XmuSnprintf(query, sizeof(query), "%s.%s", *ploaderList, option->name);
+ for (ptr = query, ptr2 = query2; *ptr; ptr++) {
+ if (*ptr != '_' && *ptr != ' ' && *ptr != '\t')
+ *ptr2 = tolower(*ptr);
+ }
+ *ptr2 = '\0';
+ /* all resources are in lowercase */
+ if (!XrmGetResource(options_xrm, query2, "Module.Option", &type, &value) ||
+ value.addr == NULL) {
+ CheckMsg(CHECKER_OPTION_DESCRIPTION_MISSING,
+ "WARNING no description for %s\n", query);
+ ++error_level;
+ }
+ ++option;
+ }
+
+ /* now do a linear search for Options file entries that are not
+ * in the driver.
+ */
+ names[0] = XrmPermStringToQuark(module_options->name);
+ classes[0] = XrmPermStringToQuark("Option");
+ names[1] = classes[1] = NULLQUARK;
+ (void)XrmEnumerateDatabase(options_xrm, (XrmNameList)&names, (XrmClassList)&classes,
+ XrmEnumOneLevel, EnumDatabase, NULL);
+ }
+ }
+ else {
+ CheckMsg(CHECKER_OPTIONS_FILE_MISSING,
+ "ERROR Options file missing.\n");
+ error_level += 10;
+ }
+
+ if (module_type == VideoModule &&
+ (module_options == NULL || module_options->vendor < 0 ||
+ module_options->chipsets == NULL)) {
+ CheckMsg(CHECKER_NO_VENDOR_CHIPSET,
+ "WARNING No vendor/chipset information available.\n");
+ ++error_level;
+ }
+ else if (module_type == VideoModule) {
+ if (module_options == NULL) {
+ /* No description for this, if this happen,
+ * something really strange happened. */
+ ErrorF(" ERROR No module_options!?!\n");
+ error_level += 50;
+ }
+ else {
+ ErrorF(" CHECK CHIPSETS\n");
+ CheckChipsets(module_options, &error_level);
+ }
+ }
+
+ /* font modules check */
+ if (module_type == FontRendererModule) {
+ if (strcmp(*ploaderList, font_module->name)) {
+ /* not an error */
+ ErrorF(" NOTICE FontModule->name specification mismatch: \"%s\" \"%s\"\n",
+ *ploaderList, font_module->name);
+ }
+ if (nfont_modules + 1 != numFontModules) {
+ /* not an error */
+ ErrorF(" NOTICE font module \"%s\" loaded more than one font renderer.\n",
+ *ploaderList);
+ }
+ }
+ else if (nfont_modules != numFontModules) {
+ ErrorF(" WARNING number of font modules changed from %d to %d.\n",
+ nfont_modules, numFontModules);
+ ++error_level;
+ }
+ }
+ ErrorF(" SUMMARY error_level set to %d.\n\n", error_level);
+ }
+ else
+ (void)xf86cfgCheckModule();
+ }
+ signal(SIGTRAP, SIG_DFL);
+ signal(SIGBUS, SIG_DFL);
+ signal(SIGSEGV, SIG_DFL);
+ signal(SIGILL, SIG_DFL);
+ signal(SIGFPE, SIG_DFL);
+ }
+ xf86cfgLoaderFreeList();
+ }
+ else
+ ErrorF(" ERROR Failed to initialize module list.\n");
+ }
+
+ if (!noverify) {
+ ErrorF("===================================== LEGEND ===============================\n");
+ ErrorF("NOTICE lines are just informative.\n");
+ ErrorF("WARNING lines add 1 to error_level.\n");
+ ErrorF("ERROR lines add 2 or more (based on the severity of the error) to error_level.\n\n");
+ for (i = 0; i <= CHECKER_LAST_MESSAGE; i++)
+ if (checkerErrors[i]) {
+ ErrorF("%3d\n%s\n\n", i, checkerLegend[i]);
+ }
+ }
+
+ return (True);
+}
+#endif
diff --git a/hw/xfree86/utils/xorgcfg/loader.h b/hw/xfree86/utils/xorgcfg/loader.h
new file mode 100644
index 000000000..f3f8490bc
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/loader.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h,v 1.7 2001/07/09 23:45:24 paulo Exp $
+ */
+
+#ifdef USE_MODULES
+#ifndef LOADER_PRIVATE
+#include "config.h"
+#include "stubs.h"
+
+#else
+
+#define XFree86LOADER /* not really */
+#define IN_LOADER
+
+#include "xf86.h"
+#include "xf86str.h"
+#include "xf86Opt.h"
+#include "xf86Module.h"
+
+#define XINPUT
+#include "xf86Xinput.h"
+
+#include "fontmod.h"
+#include "loaderProcs.h"
+
+#include <sym.h>
+#include <xf86_ansic.h>
+
+void LoaderDefaultFunc(void);
+#endif
+
+#ifndef _xf86cfg_loader_h
+#define _xf86cfg_loader_h
+
+void xf86cfgLoaderInit(void);
+void xf86cfgLoaderInitList(int);
+void xf86cfgLoaderFreeList(void);
+int xf86cfgCheckModule(void);
+
+#ifndef LOADER_PRIVATE
+/* common/xf86Opt.h */
+typedef struct {
+ double freq;
+ int units;
+} OptFrequency;
+
+typedef union {
+ unsigned long num;
+ char * str;
+ double realnum;
+ Bool bool;
+ OptFrequency freq;
+} ValueUnion;
+
+typedef enum {
+ OPTV_NONE = 0,
+ OPTV_INTEGER,
+ OPTV_STRING, /* a non-empty string */
+ OPTV_ANYSTR, /* Any string, including an empty one */
+ OPTV_REAL,
+ OPTV_BOOLEAN,
+ OPTV_FREQ
+} OptionValueType;
+
+typedef enum {
+ OPTUNITS_HZ = 1,
+ OPTUNITS_KHZ,
+ OPTUNITS_MHZ
+} OptFreqUnits;
+
+typedef struct {
+ int token;
+ const char* name;
+ OptionValueType type;
+ ValueUnion value;
+ Bool found;
+} OptionInfoRec, *OptionInfoPtr;
+
+/* fontmod.h */
+typedef void (*InitFont)(void);
+
+typedef struct {
+ InitFont initFunc;
+ char * name;
+ void *module;
+} FontModule;
+
+extern FontModule *FontModuleList;
+
+typedef struct {
+ int token; /* id of the token */
+ const char * name; /* token name */
+} SymTabRec, *SymTabPtr;
+#endif /* !LOADER_PRIVATE */
+
+typedef enum {
+ NullModule = 0,
+ VideoModule,
+ InputModule,
+ GenericModule,
+ FontRendererModule
+} ModuleType;
+
+typedef struct _xf86cfgModuleOptions {
+ char *name;
+ ModuleType type;
+ OptionInfoPtr option;
+ int vendor;
+ SymTabPtr chipsets;
+ struct _xf86cfgModuleOptions *next;
+} xf86cfgModuleOptions;
+
+extern xf86cfgModuleOptions *module_options;
+
+/* When adding a new code to the LEGEND, also update checkerLegend
+ * in loader.c
+ */
+extern char **checkerLegend;
+extern int *checkerErrors;
+#define CHECKER_OPTIONS_FILE_MISSING 1
+#define CHECKER_OPTION_DESCRIPTION_MISSING 2
+#define CHECKER_LOAD_FAILED 3
+#define CHECKER_RECOGNIZED_AS 4
+#define CHECKER_NO_OPTIONS_AVAILABLE 5
+#define CHECKER_NO_VENDOR_CHIPSET 6
+#define CHECKER_CANNOT_VERIFY_CHIPSET 7
+#define CHECKER_OPTION_UNUSED 8
+#define CHECKER_NOMATCH_CHIPSET_STRINGS 9
+#define CHECKER_CHIPSET_NOT_LISTED 10
+#define CHECKER_CHIPSET_NOT_SUPPORTED 11
+#define CHECKER_CHIPSET_NO_VENDOR 12
+#define CHECKER_NO_CHIPSETS 13
+#define CHECKER_FILE_MODULE_NAME_MISMATCH 14
+
+#define CHECKER_LAST_MESSAGE 14
+
+extern void CheckMsg(int, char*, ...);
+
+#ifndef LOADER_PRIVATE
+int LoaderInitializeOptions(void);
+#endif
+#endif /* USE_MODULES */
+
+#endif /* _xf86cfg_loader_h */
diff --git a/hw/xfree86/utils/xorgcfg/loadmod.c b/hw/xfree86/utils/xorgcfg/loadmod.c
new file mode 100644
index 000000000..a53bffa01
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/loadmod.c
@@ -0,0 +1,658 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loadmod.c,v 1.14.2.1 2003/03/13 04:10:50 tsi Exp $
+ */
+
+#ifdef USE_MODULES
+#include <setjmp.h>
+
+#ifndef HAS_GLIBC_SIGSETJMP
+#if defined(setjmp) && defined(__GNU_LIBRARY__) && \
+ (!defined(__GLIBC__) || (__GLIBC__ < 2) || \
+ ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3)))
+#define HAS_GLIBC_SIGSETJMP 1
+#endif
+#endif
+
+#define LOADER_PRIVATE
+#include "loader.h"
+
+#define True 1
+#define False 0
+#define XtPointer char*
+#define XtMalloc malloc
+#define XtCalloc calloc
+#define XtRealloc realloc
+#define XtFree free
+#define XtNew(t) malloc(sizeof(t))
+#define XtNewString(s) ((s) ? strdup(s) : NULL)
+
+#define pointer void*
+
+/* XXX beware (or fix it) libc functions called here are the xf86 ones */
+
+static void AddModuleOptions(char*, const OptionInfoRec*);
+#if 0
+void xf86AddDriver(DriverPtr, void*, int);
+Bool xf86ServerIsOnlyDetecting(void);
+void xf86AddInputDriver(InputDriverPtr, pointer, int);
+void xf86AddModuleInfo(ModuleInfoPtr, void*);
+Bool xf86LoaderCheckSymbol(const char*);
+void xf86LoaderRefSymLists(const char **, ...);
+void xf86LoaderReqSymLists(const char **, ...);
+void xf86Msg(int, const char*, ...);
+void xf86PrintChipsets(const char*, const char*, SymTabPtr);
+void xf86ErrorFVerb(int verb, const char *format, ...);
+pciVideoPtr *xf86GetPciVideoInfo(void);
+int xf86MatchDevice(const char*, GDevPtr**);
+int xf86MatchPciInstances(const char*, int, SymTabPtr, PciChipsets*, GDevPtr*, int, DriverPtr,int**);
+int xf86MatchIsaInstances(const char*, SymTabPtr, pointer*, DriverPtr, pointer, GDevPtr*, int, int**);
+void *xf86LoadDrvSubModule(DriverPtr drv, const char*);
+void xf86DrvMsg(int, int, const char*, ...);
+pciConfigPtr *xf86GetPciConfigInfo(void);
+Bool xf86IsPrimaryPci(pcVideoPtr*);
+#endif
+
+extern char *loaderPath, **loaderList, **ploaderList;
+xf86cfgModuleOptions *module_options;
+FontModule *font_module;
+int numFontModules;
+
+extern int noverify, error_level;
+
+int xf86ShowUnresolved = 1;
+
+LOOKUP miLookupTab[] = {{0,0}};
+LOOKUP dixLookupTab[] = {{0,0}};
+LOOKUP fontLookupTab[] = {{0,0}};
+LOOKUP extLookupTab[] = {{0,0}};
+LOOKUP xfree86LookupTab[] = {
+ /* Loader functions */
+ SYMFUNC(LoaderDefaultFunc)
+ SYMFUNC(LoadSubModule)
+ SYMFUNC(DuplicateModule)
+ SYMFUNC(LoaderErrorMsg)
+ SYMFUNC(LoaderCheckUnresolved)
+ SYMFUNC(LoadExtension)
+ SYMFUNC(LoadFont)
+ SYMFUNC(LoaderReqSymbols)
+ SYMFUNC(LoaderReqSymLists)
+ SYMFUNC(LoaderRefSymbols)
+ SYMFUNC(LoaderRefSymLists)
+ SYMFUNC(UnloadSubModule)
+ SYMFUNC(LoaderSymbol)
+ SYMFUNC(LoaderListDirs)
+ SYMFUNC(LoaderFreeDirList)
+ SYMFUNC(LoaderGetOS)
+
+ /*
+ * these here are our own interfaces to libc functions
+ */
+ SYMFUNC(xf86abort)
+ SYMFUNC(xf86abs)
+ SYMFUNC(xf86acos)
+ SYMFUNC(xf86asin)
+ SYMFUNC(xf86atan)
+ SYMFUNC(xf86atan2)
+ SYMFUNC(xf86atof)
+ SYMFUNC(xf86atoi)
+ SYMFUNC(xf86atol)
+ SYMFUNC(xf86bsearch)
+ SYMFUNC(xf86ceil)
+ SYMFUNC(xf86calloc)
+ SYMFUNC(xf86clearerr)
+ SYMFUNC(xf86close)
+ SYMFUNC(xf86cos)
+ SYMFUNC(xf86exit)
+ SYMFUNC(xf86exp)
+ SYMFUNC(xf86fabs)
+ SYMFUNC(xf86fclose)
+ SYMFUNC(xf86feof)
+ SYMFUNC(xf86ferror)
+ SYMFUNC(xf86fflush)
+ SYMFUNC(xf86fgetc)
+ SYMFUNC(xf86fgetpos)
+ SYMFUNC(xf86fgets)
+ SYMFUNC(xf86finite)
+ SYMFUNC(xf86floor)
+ SYMFUNC(xf86fmod)
+ SYMFUNC(xf86fopen)
+ SYMFUNC(xf86fprintf)
+ SYMFUNC(xf86fputc)
+ SYMFUNC(xf86fputs)
+ SYMFUNC(xf86fread)
+ SYMFUNC(xf86free)
+ SYMFUNC(xf86freopen)
+ SYMFUNC(xf86frexp)
+ SYMFUNC(xf86fscanf)
+ SYMFUNC(xf86fseek)
+ SYMFUNC(xf86fsetpos)
+ SYMFUNC(xf86ftell)
+ SYMFUNC(xf86fwrite)
+ SYMFUNC(xf86getc)
+ SYMFUNC(xf86getenv)
+ SYMFUNC(xf86getpagesize)
+ SYMFUNC(xf86hypot)
+ SYMFUNC(xf86ioctl)
+ SYMFUNC(xf86isalnum)
+ SYMFUNC(xf86isalpha)
+ SYMFUNC(xf86iscntrl)
+ SYMFUNC(xf86isdigit)
+ SYMFUNC(xf86isgraph)
+ SYMFUNC(xf86islower)
+ SYMFUNC(xf86isprint)
+ SYMFUNC(xf86ispunct)
+ SYMFUNC(xf86isspace)
+ SYMFUNC(xf86isupper)
+ SYMFUNC(xf86isxdigit)
+ SYMFUNC(xf86labs)
+ SYMFUNC(xf86ldexp)
+ SYMFUNC(xf86log)
+ SYMFUNC(xf86log10)
+ SYMFUNC(xf86lseek)
+ SYMFUNC(xf86malloc)
+ SYMFUNC(xf86memchr)
+ SYMFUNC(xf86memcmp)
+ SYMFUNC(xf86memcpy)
+#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__) || defined (__x86_64__)
+ /*
+ * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle
+ * structure copies. This causes a problem both here and in shared
+ * libraries as there is no way to map the name of the call to the
+ * correct function.
+ */
+ SYMFUNC(memcpy)
+ /*
+ * Some PPC, SPARC, and IA64 compilers generate calls to memset to handle
+ * aggregate initializations.
+ */
+ SYMFUNC(memset)
+#endif
+ SYMFUNC(xf86memmove)
+ SYMFUNC(xf86memset)
+ SYMFUNC(xf86mmap)
+ SYMFUNC(xf86modf)
+ SYMFUNC(xf86munmap)
+ SYMFUNC(xf86open)
+ SYMFUNC(xf86perror)
+ SYMFUNC(xf86pow)
+ SYMFUNC(xf86printf)
+ SYMFUNC(xf86qsort)
+ SYMFUNC(xf86read)
+ SYMFUNC(xf86realloc)
+ SYMFUNC(xf86remove)
+ SYMFUNC(xf86rename)
+ SYMFUNC(xf86rewind)
+ SYMFUNC(xf86setbuf)
+ SYMFUNC(xf86setvbuf)
+ SYMFUNC(xf86sin)
+ SYMFUNC(xf86snprintf)
+ SYMFUNC(xf86sprintf)
+ SYMFUNC(xf86sqrt)
+ SYMFUNC(xf86sscanf)
+ SYMFUNC(xf86strcat)
+ SYMFUNC(xf86strcmp)
+ SYMFUNC(xf86strcasecmp)
+ SYMFUNC(xf86strcpy)
+ SYMFUNC(xf86strcspn)
+ SYMFUNC(xf86strerror)
+ SYMFUNC(xf86strlen)
+ SYMFUNC(xf86strncmp)
+ SYMFUNC(xf86strncasecmp)
+ SYMFUNC(xf86strncpy)
+ SYMFUNC(xf86strpbrk)
+ SYMFUNC(xf86strchr)
+ SYMFUNC(xf86strrchr)
+ SYMFUNC(xf86strspn)
+ SYMFUNC(xf86strstr)
+ SYMFUNC(xf86strtod)
+ SYMFUNC(xf86strtok)
+ SYMFUNC(xf86strtol)
+ SYMFUNC(xf86strtoul)
+ SYMFUNC(xf86tan)
+ SYMFUNC(xf86tmpfile)
+ SYMFUNC(xf86tolower)
+ SYMFUNC(xf86toupper)
+ SYMFUNC(xf86ungetc)
+ SYMFUNC(xf86vfprintf)
+ SYMFUNC(xf86vsnprintf)
+ SYMFUNC(xf86vsprintf)
+ SYMFUNC(xf86write)
+
+/* non-ANSI C functions */
+ SYMFUNC(xf86opendir)
+ SYMFUNC(xf86closedir)
+ SYMFUNC(xf86readdir)
+ SYMFUNC(xf86rewinddir)
+ SYMFUNC(xf86ffs)
+ SYMFUNC(xf86strdup)
+ SYMFUNC(xf86bzero)
+ SYMFUNC(xf86usleep)
+ SYMFUNC(xf86execl)
+
+ SYMFUNC(xf86getsecs)
+ SYMFUNC(xf86fpossize) /* for returning sizeof(fpos_t) */
+
+ SYMFUNC(xf86stat)
+ SYMFUNC(xf86fstat)
+ SYMFUNC(xf86access)
+ SYMFUNC(xf86geteuid)
+ SYMFUNC(xf86getegid)
+ SYMFUNC(xf86getpid)
+ SYMFUNC(xf86mknod)
+ SYMFUNC(xf86chmod)
+ SYMFUNC(xf86chown)
+ SYMFUNC(xf86sleep)
+ SYMFUNC(xf86mkdir)
+ SYMFUNC(xf86shmget)
+ SYMFUNC(xf86shmat)
+ SYMFUNC(xf86shmdt)
+ SYMFUNC(xf86shmctl)
+#ifdef HAS_GLIBC_SIGSETJMP
+ SYMFUNC(xf86setjmp)
+ SYMFUNC(xf86setjmp0)
+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+ SYMFUNCALIAS("xf86setjmp1",__sigsetjmp)
+#else
+ SYMFUNC(xf86setjmp1)
+#endif
+#else
+ SYMFUNCALIAS("xf86setjmp",setjmp)
+ SYMFUNCALIAS("xf86setjmp0",setjmp)
+ SYMFUNC(xf86setjmp1)
+#endif
+ SYMFUNCALIAS("xf86longjmp",longjmp)
+ SYMFUNC(xf86getjmptype)
+ SYMFUNC(xf86setjmp1_arg2)
+ SYMFUNC(xf86setjmperror)
+
+ SYMFUNC(xf86AddDriver)
+ SYMFUNC(xf86ServerIsOnlyDetecting)
+ SYMFUNC(xf86AddInputDriver)
+ SYMFUNC(xf86AddModuleInfo)
+ SYMFUNC(xf86LoaderCheckSymbol)
+
+ SYMFUNC(xf86LoaderRefSymLists)
+ SYMFUNC(xf86LoaderReqSymLists)
+ SYMFUNC(xf86Msg)
+ SYMFUNC(ErrorF)
+ SYMFUNC(xf86PrintChipsets)
+ SYMFUNC(xf86ErrorFVerb)
+ SYMFUNC(xf86GetPciVideoInfo)
+ SYMFUNC(xf86MatchDevice)
+ SYMFUNC(xf86MatchPciInstances)
+ SYMFUNC(xf86MatchIsaInstances)
+ SYMFUNC(Xfree)
+ SYMFUNC(xf86LoadDrvSubModule)
+ SYMFUNC(xf86DrvMsg)
+ SYMFUNC(xf86GetPciConfigInfo)
+ SYMFUNC(xf86IsPrimaryPci)
+ {0,0}
+};
+
+static DriverPtr driver;
+static ModuleInfoPtr info;
+static SymTabPtr chips;
+static int vendor;
+ModuleType module_type = GenericModule;
+
+static void
+AddModuleOptions(char *name, const OptionInfoRec *option)
+{
+ xf86cfgModuleOptions *ptr;
+ const OptionInfoRec *tmp;
+ SymTabPtr ctmp;
+ int count;
+
+ /* XXX If the module is already in the list, then it means that
+ * it is now being properly loaded by xf86cfg and the "fake" entry
+ * added in xf86cfgLoaderInitList() isn't required anymore.
+ * Currently:
+ * ati and vmware are known to fail. */
+ for (ptr = module_options; ptr; ptr = ptr->next)
+ if (strcmp(name, ptr->name) == 0) {
+ fprintf(stderr, "Module %s already in list!\n", name);
+ return;
+ }
+
+ ptr = XtNew(xf86cfgModuleOptions);
+ ptr->name = XtNewString(name);
+ ptr->type = module_type;
+ if (option) {
+ for (count = 0, tmp = option; tmp->name != NULL; tmp++, count++)
+ ;
+ ++count;
+ ptr->option = XtCalloc(1, count * sizeof(OptionInfoRec));
+ for (count = 0, tmp = option; tmp->name != NULL; count++, tmp++) {
+ memcpy(&ptr->option[count], tmp, sizeof(OptionInfoRec));
+ ptr->option[count].name = XtNewString(tmp->name);
+ if (tmp->type == OPTV_STRING || tmp->type == OPTV_ANYSTR)
+ ptr->option[count].value.str = XtNewString(tmp->value.str);
+ }
+ }
+ else
+ ptr->option = NULL;
+ if (vendor != -1 && chips) {
+ ptr->vendor = vendor;
+ for (count = 0, ctmp = chips; ctmp->name; ctmp++, count++)
+ ;
+ ++count;
+ ptr->chipsets = XtCalloc(1, count * sizeof(SymTabRec));
+ for (count = 0, ctmp = chips; ctmp->name != NULL; count++, ctmp++) {
+ memcpy(&ptr->chipsets[count], ctmp, sizeof(SymTabRec));
+ ptr->chipsets[count].name = XtNewString(ctmp->name);
+ }
+ }
+ else
+ ptr->chipsets = NULL;
+
+ ptr->next = module_options;
+ module_options = ptr;
+}
+
+extern void xf86WrapperInit(void);
+
+void
+xf86cfgLoaderInit(void)
+{
+ LoaderInit();
+ xf86WrapperInit();
+}
+
+void
+xf86cfgLoaderInitList(int type)
+{
+ static const char *generic[] = {
+ ".",
+ NULL
+ };
+ static const char *video[] = {
+ "drivers",
+ NULL
+ };
+ static const char *input[] = {
+ "input",
+ NULL
+ };
+ static const char *font[] = {
+ "fonts",
+ NULL
+ };
+ const char **subdirs;
+
+ switch (type) {
+ case GenericModule:
+ subdirs = generic;
+ break;
+ case VideoModule:
+ subdirs = video;
+ break;
+ case InputModule:
+ subdirs = input;
+ break;
+ case FontRendererModule:
+ subdirs = font;
+ break;
+ default:
+ fprintf(stderr, "Invalid value passed to xf86cfgLoaderInitList.\n");
+ subdirs = generic;
+ break;
+ }
+ LoaderSetPath(loaderPath);
+ loaderList = LoaderListDirs(subdirs, NULL);
+
+ /* XXX Xf86cfg isn't able to provide enough wrapper functions
+ * to these drivers. Maybe the drivers could also be changed
+ * to work better when being loaded "just for testing" */
+ if (type == VideoModule) {
+ module_type = VideoModule;
+ AddModuleOptions("vmware", NULL);
+ AddModuleOptions("ati", NULL);
+ module_type = NullModule;
+ }
+}
+
+void
+xf86cfgLoaderFreeList(void)
+{
+ LoaderFreeDirList(loaderList);
+}
+
+int
+xf86cfgCheckModule(void)
+{
+ int errmaj, errmin;
+ ModuleDescPtr module;
+ int nfonts;
+ FontModule *fonts, *pfont_module;
+
+ driver = NULL;
+ chips = NULL;
+ info = NULL;
+ pfont_module = NULL;
+ vendor = -1;
+ module_type = GenericModule;
+
+ if ((module = LoadModule(*ploaderList, NULL, NULL, NULL, NULL,
+ NULL, &errmaj, &errmin)) == NULL) {
+ LoaderErrorMsg(NULL, *ploaderList, errmaj, errmin);
+ return (0);
+ }
+ else if (driver && driver->AvailableOptions) {
+ /* at least fbdev does not call xf86MatchPciInstances in Probe */
+ if (driver->Identify)
+ (*driver->Identify)(-1);
+ if (driver->Probe)
+ (*driver->Probe)(driver, PROBE_DETECT);
+ AddModuleOptions(*ploaderList, (*driver->AvailableOptions)(-1, -1));
+ }
+ else if (info && info->AvailableOptions)
+ AddModuleOptions(*ploaderList, (*info->AvailableOptions)(NULL));
+
+ if (!noverify) {
+ XF86ModuleData *initdata = NULL;
+ char *p;
+
+ p = XtMalloc(strlen(*ploaderList) + strlen("ModuleData") + 1);
+ strcpy(p, *ploaderList);
+ strcat(p, "ModuleData");
+ initdata = LoaderSymbol(p);
+ if (initdata) {
+ XF86ModuleVersionInfo *vers;
+
+ vers = initdata->vers;
+ if (vers && strcmp(*ploaderList, vers->modname)) {
+ /* This was a problem at some time for some video drivers */
+ CheckMsg(CHECKER_FILE_MODULE_NAME_MISMATCH,
+ "WARNING file/module name mismatch: \"%s\" \"%s\"\n",
+ *ploaderList, vers->modname);
+ ++error_level;
+ }
+ }
+ XtFree(p);
+ }
+
+ nfonts = numFontModules;
+ numFontModules = 0;
+ fonts = FontModuleList;
+ if (fonts) {
+ while (fonts->name) {
+ if (strcmp(fonts->name, *ploaderList) == 0)
+ pfont_module = fonts;
+ ++numFontModules;
+ ++fonts;
+ }
+ }
+ if (pfont_module)
+ module_type = FontRendererModule;
+ else if (nfonts + 1 <= numFontModules) {
+ /* loader.c will flag a warning if -noverify is not set */
+ pfont_module = &FontModuleList[nfonts];
+ module_type = FontRendererModule;
+ }
+
+ if (font_module) {
+ XtFree((XtPointer)font_module->name);
+ XtFree((XtPointer)font_module);
+ font_module = NULL;
+ }
+ if (pfont_module) {
+ font_module = XtNew(FontModule);
+ memcpy(font_module, pfont_module, sizeof(FontModule));
+ font_module->name = XtNewString(pfont_module->name);
+ }
+
+ UnloadModule(module);
+
+ return (1);
+}
+
+void
+xf86AddDriver(DriverPtr drv, void *module, int flags)
+{
+ driver = drv;
+ if (driver)
+ driver->module = module;
+ module_type = VideoModule;
+}
+
+Bool
+xf86ServerIsOnlyDetecting(void)
+{
+ return (True);
+}
+
+void
+xf86AddInputDriver(InputDriverPtr inp, void *module, int flags)
+{
+ module_type = InputModule;
+}
+
+void
+xf86AddModuleInfo(ModuleInfoPtr inf, void *module)
+{
+ info = inf;
+}
+
+Bool
+xf86LoaderCheckSymbol(const char *symbol)
+{
+ return LoaderSymbol(symbol) != NULL;
+}
+
+void
+xf86LoaderRefSymLists(const char **list0, ...)
+{
+}
+
+void
+xf86LoaderReqSymLists(const char **list0, ...)
+{
+}
+
+#if 0
+void xf86Msg(int type, const char *format, ...)
+{
+}
+#endif
+
+/*ARGSUSED*/
+void
+xf86PrintChipsets(const char *name, const char *msg, SymTabPtr chipsets)
+{
+ vendor = 0;
+ chips = chipsets;
+}
+
+pciVideoPtr *
+xf86GetPciVideoInfo(void)
+{
+ static pciVideoRec pci_video;
+ static pciVideoPtr pci_video_ptr[2] = { &pci_video };
+
+ memset(&pci_video, 0, sizeof(pciVideoRec));
+
+ return (pci_video_ptr);
+}
+
+int
+xf86MatchDevice(const char *name, GDevPtr **gdev)
+{
+ *gdev = NULL;
+
+ return (1);
+}
+
+int
+xf86MatchPciInstances(const char *name, int VendorID, SymTabPtr chipsets, PciChipsets *PCIchipsets,
+ GDevPtr *devList, int numDevs, DriverPtr drvp, int **foundEntities)
+{
+ vendor = VendorID;
+ if (chips == NULL)
+ chips = chipsets;
+ *foundEntities = NULL;
+
+ return (0);
+}
+
+int
+xf86MatchIsaInstances(const char *name, SymTabPtr chipsets, IsaChipsets *ISAchipsets, DriverPtr drvp,
+ FindIsaDevProc FindIsaDevice, GDevPtr *devList, int numDevs, int **foundEntities)
+{
+ *foundEntities = NULL;
+
+ return (0);
+}
+
+/*ARGSUSED*/
+void *
+xf86LoadDrvSubModule(DriverPtr drv, const char *name)
+{
+ pointer ret;
+ int errmaj = 0, errmin = 0;
+
+ ret = LoadSubModule(drv->module, name, NULL, NULL, NULL, NULL,
+ &errmaj, &errmin);
+ if (!ret)
+ LoaderErrorMsg(NULL, name, errmaj, errmin);
+ return (ret);
+}
+
+pciConfigPtr *
+xf86GetPciConfigInfo(void)
+{
+ return (NULL);
+}
+
+Bool
+xf86IsPrimaryPci(pciVideoPtr pPci)
+{
+ return (True);
+}
+#endif
diff --git a/hw/xfree86/utils/xorgcfg/monitor-cfg.c b/hw/xfree86/utils/xorgcfg/monitor-cfg.c
new file mode 100644
index 000000000..430833381
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/monitor-cfg.c
@@ -0,0 +1,449 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.c,v 1.7 2001/03/24 01:17:20 paulo Exp $
+ */
+
+#include "xf86config.h"
+#include "monitor-cfg.h"
+#include "screen.h"
+#include <X11/extensions/xf86vmode.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Simple.h>
+
+#include <ctype.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/Viewport.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+
+/*
+ * Prototypes
+ */
+static Bool MonitorConfigCheck(void);
+static void MonitorHsyncCallback(Widget, XtPointer, XtPointer);
+static void MonitorVsyncCallback(Widget, XtPointer, XtPointer);
+static void MonitorSelectCardCallback(Widget, XtPointer, XtPointer);
+
+extern void DrawCables(void);
+
+/*
+ * Initialization
+ */
+static char *hmodes[] = {
+ "Standard VGA, 640x480 @ 60 Hz",
+ "Super VGA, 800x600 @ 56 Hz",
+ "1024x768 @ 87 Hz int. (no 800x600)",
+ "1024x768 @ 87 Hz int., 800x600 @ 56 Hz",
+ "800x600 @ 60 Hz, 640x480 @ 72 Hz",
+ "1024x768 @ 60 Hz, 800x600 @ 72 Hz",
+ "High Frequency SVGA, 1024x768 @ 70 Hz",
+ "Monitor that can do 1280x1024 @ 60 Hz",
+ "Monitor that can do 1280x1024 @ 74 Hz",
+ "Monitor that can do 1280x1024 @ 76 Hz",
+};
+
+static char *hmodes_trans[] = {
+ "31.5",
+ "31.5 - 35.1",
+ "31.5, 35.5",
+ "31.5, 35.15, 35.5",
+ "31.5 - 37.9",
+ "31.5 - 48.5",
+ "31.5 - 57.0",
+ "31.5 - 64.3",
+ "31.5 - 79.0",
+ "31.5 - 82.0",
+};
+
+static char *vmodes [] = { "50 - 70", "50 - 90", "50 - 100", "40 - 150", };
+
+extern Widget config;
+static Widget hsync, vsync, hlist, vlist, cmenu;
+
+static parser_range mon_hsync[CONF_MAX_HSYNC];
+static parser_range mon_vrefresh[CONF_MAX_VREFRESH];
+static int mon_n_hsync, mon_n_vrefresh;
+static XF86ConfDevicePtr oldcard, card;
+static XF86ConfMonitorPtr current_monitor;
+
+/*
+ * Implementation
+ */
+XtPointer
+MonitorConfig(XtPointer conf)
+{
+ XF86ConfMonitorPtr monitor = (XF86ConfMonitorPtr)conf;
+ char monitor_name[48];
+ Arg args[1];
+
+ current_monitor = monitor;
+
+ xf86info.cur_list = MONITOR;
+ XtSetSensitive(back, xf86info.lists[MONITOR].cur_function > 0);
+ XtSetSensitive(next, xf86info.lists[MONITOR].cur_function <
+ xf86info.lists[MONITOR].num_functions - 1);
+ (xf86info.lists[MONITOR].functions[xf86info.lists[MONITOR].cur_function])
+ (&xf86info);
+
+ XawListUnhighlight(hlist);
+ XawListUnhighlight(vlist);
+
+ if (monitor != NULL) {
+ XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
+ char str[PARSER_RANGE_SIZE];
+
+ XtSetArg(args[0], XtNstring, monitor->mon_identifier);
+ XtSetValues(ident_widget, args, 1);
+
+ while (screen != NULL) {
+ if (screen->scrn_monitor == monitor)
+ break;
+
+ screen = (XF86ConfScreenPtr)(screen->list.next);
+ }
+ if (screen != NULL) {
+ oldcard = card = screen->scrn_device;
+ XtSetArg(args[0], XtNlabel, card->dev_identifier);
+ }
+ else {
+ oldcard = card = NULL;
+ XtSetArg(args[0], XtNlabel, "");
+ }
+ XtSetValues(cmenu, args, 1);
+
+ mon_n_hsync = monitor->mon_n_hsync;
+ memcpy(mon_hsync, monitor->mon_hsync,
+ sizeof(parser_range) * mon_n_hsync);
+ *str = '\0';
+ parser_range_to_string(str, mon_hsync, mon_n_hsync);
+ XtSetArg(args[0], XtNstring, str);
+ XtSetValues(hsync, args, 1);
+
+ mon_n_vrefresh = monitor->mon_n_vrefresh;
+ memcpy(mon_vrefresh, monitor->mon_vrefresh,
+ sizeof(parser_range) * mon_n_vrefresh);
+ *str = '\0';
+ parser_range_to_string(str, mon_vrefresh, mon_n_vrefresh);
+ XtSetArg(args[0], XtNstring, str);
+ XtSetValues(vsync, args, 1);
+ }
+ else {
+ XF86ConfMonitorPtr monitor = XF86Config->conf_monitor_lst;
+ int nmonitors = 0;
+
+ oldcard = card = NULL;
+ while (monitor != NULL) {
+ ++nmonitors;
+ monitor = (XF86ConfMonitorPtr)(monitor->list.next);
+ }
+ do {
+ XmuSnprintf(monitor_name, sizeof(monitor_name),
+ "Monitor%d", nmonitors);
+ ++nmonitors;
+ } while (xf86findMonitor(monitor_name,
+ XF86Config->conf_monitor_lst));
+
+ XtSetArg(args[0], XtNstring, monitor_name);
+ XtSetValues(ident_widget, args, 1);
+
+ XtSetArg(args[0], XtNstring, "");
+ XtSetValues(hsync, args, 1);
+ XtSetValues(vsync, args, 1);
+
+ XtSetArg(args[0], XtNlabel, "");
+ XtSetValues(cmenu, args, 1);
+ }
+
+ if (ConfigLoop(MonitorConfigCheck) == True) {
+ if (monitor == NULL) {
+ monitor = (XF86ConfMonitorPtr)
+ XtCalloc(1, sizeof(XF86ConfMonitorRec));
+ monitor->mon_identifier = XtNewString(ident_string);
+ }
+
+ memcpy(monitor->mon_hsync, mon_hsync, sizeof(parser_range) *
+ (monitor->mon_n_hsync = mon_n_hsync));
+ memcpy(monitor->mon_vrefresh, mon_vrefresh, sizeof(parser_range) *
+ (monitor->mon_n_vrefresh = mon_n_vrefresh));
+
+ if (strcasecmp(monitor->mon_identifier, ident_string))
+ xf86renameMonitor(XF86Config, monitor, ident_string);
+
+ if (oldcard != card) {
+ int i;
+
+ for (i = 0; i < computer.num_devices; i++)
+ if (computer.devices[i]->widget == config)
+ break;
+ if (computer.devices[i]->config == NULL)
+ XF86Config->conf_monitor_lst =
+ xf86addMonitor(XF86Config->conf_monitor_lst,
+ monitor);
+ computer.devices[i]->config = (XtPointer)monitor;
+ ChangeScreen(monitor, monitor, card, oldcard);
+ DrawCables();
+ }
+
+ return (monitor);
+ }
+
+ return (NULL);
+}
+
+static Bool
+MonitorConfigCheck(void)
+{
+ char *str;
+ Arg args[1];
+ XF86ConfMonitorPtr monitor = XF86Config->conf_monitor_lst;
+
+ if (ident_string == NULL || strlen(ident_string) == 0)
+ return (False);
+
+ bzero(mon_hsync, sizeof(parser_range) * CONF_MAX_HSYNC);
+ bzero(mon_vrefresh, sizeof(parser_range) * CONF_MAX_VREFRESH);
+
+ XtSetArg(args[0], XtNstring, &str);
+ XtGetValues(hsync, args, 1);
+ if ((mon_n_hsync = string_to_parser_range(str, mon_hsync,
+ CONF_MAX_HSYNC)) <= 0)
+ return (False);
+
+ XtSetArg(args[0], XtNstring, &str);
+ XtGetValues(vsync, args, 1);
+ if ((mon_n_vrefresh = string_to_parser_range(str, mon_vrefresh,
+ CONF_MAX_VREFRESH)) <= 0)
+ return (False);
+
+ while (monitor != NULL) {
+ if (monitor != current_monitor &&
+ strcasecmp(ident_string, monitor->mon_identifier) == 0)
+ return (False);
+ monitor = (XF86ConfMonitorPtr)(monitor->list.next);
+ }
+
+ return (True);
+}
+
+int
+string_to_parser_range(char *str, parser_range *range, int nrange)
+{
+ double val;
+ int i = 0;
+
+ if (str == NULL || *str == '\0' || range == NULL || nrange == 0)
+ return (0);
+
+ while (*str) {
+ while (*str && isspace(*str))
+ ++str;
+ if (!isdigit(*str)) {
+ ++str;
+ continue;
+ }
+ val = strtod(str, &str);
+ while (*str && isspace(*str))
+ ++str;
+ if (*str == ',' || *str == '\0') {
+ if (*str)
+ ++str;
+ range[i].lo = range[i].hi = val;
+ if (++i >= nrange || *str == '\0')
+ break;
+ continue;
+ }
+ else if (*str != '-')
+ return (0);
+ ++str;
+ range[i].lo = val;
+ while (*str && isspace(*str))
+ ++str;
+ if ((range[i].hi = strtod(str, &str)) < range[i].lo)
+ return (0);
+ if (++i >= nrange)
+ break;
+ }
+
+ return (i);
+}
+
+int
+parser_range_to_string(char *str, parser_range *range, int nrange)
+{
+ int i, len;
+
+ if (str == NULL || range == NULL || nrange <= 0)
+ return (0);
+
+ for (i = len = 0; i < nrange; i++) {
+ if (i > 0)
+ len += XmuSnprintf(str + len, PARSER_RANGE_SIZE - len, "%s",
+ ", ");
+ if (range[i].lo == range[i].hi)
+ len += XmuSnprintf(str + len, PARSER_RANGE_SIZE - len, "%g",
+ range[i].lo);
+ else if (range[i].lo < range[i].hi)
+ len += XmuSnprintf(str + len, PARSER_RANGE_SIZE - len, "%g - %g",
+ range[i].lo, range[i].hi);
+ else
+ return (0);
+ }
+
+ return (i);
+}
+
+/*ARGSUSED*/
+static void
+MonitorHsyncCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+ Arg args[1];
+
+ XtSetArg(args[0], XtNstring, hmodes_trans[info->list_index]);
+ XtSetValues(hsync, args, 1);
+}
+
+/*ARGSUSED*/
+static void
+MonitorVsyncCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+ Arg args[1];
+
+ XtSetArg(args[0], XtNstring, info->string);
+ XtSetValues(vsync, args, 1);
+}
+
+/*ARGSUSED*/
+static void
+MonitorSelectCardCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+
+ card = (XF86ConfDevicePtr)user_data;
+ XtSetArg(args[0], XtNlabel, card != NULL ? card->dev_identifier : "");
+ XtSetValues(cmenu, args, 1);
+}
+
+void
+MonitorLayout(XF86SetupInfo *info)
+{
+ static int first = 1, men;
+ static Widget layout, menu;
+ XF86ConfDevicePtr device = XF86Config->conf_device_lst;
+ Widget sme;
+ Arg args[1];
+ char *menuname;
+
+ if (first) {
+ Widget viewport;
+
+ first = 0;
+
+ layout = XtCreateWidget("monitorl", formWidgetClass,
+ configp, NULL, 0);
+ XtCreateManagedWidget("hlabel", labelWidgetClass, layout, NULL, 0);
+ hsync = XtVaCreateManagedWidget("hsync", asciiTextWidgetClass, layout,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ viewport = XtCreateManagedWidget("hviewport", viewportWidgetClass,
+ layout, NULL, 0);
+ hlist = XtVaCreateManagedWidget("hlist", listWidgetClass, viewport,
+ XtNlist, hmodes,
+ XtNnumberStrings, sizeof(hmodes) /
+ sizeof(hmodes[0]), NULL, 0);
+ XtAddCallback(hlist, XtNcallback, MonitorHsyncCallback, NULL);
+
+ XtCreateManagedWidget("vlabel", labelWidgetClass, layout, NULL, 0);
+ vsync = XtVaCreateManagedWidget("vsync", asciiTextWidgetClass, layout,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ viewport = XtCreateManagedWidget("vviewport", viewportWidgetClass,
+ layout, NULL, 0);
+ vlist = XtVaCreateManagedWidget("vlist", listWidgetClass, viewport,
+ XtNlist, vmodes,
+ XtNnumberStrings, sizeof(vmodes) /
+ sizeof(vmodes[0]), NULL, 0);
+ XtAddCallback(vlist, XtNcallback, MonitorVsyncCallback, NULL);
+
+ XtCreateManagedWidget("clabel", labelWidgetClass, layout, NULL, 0);
+ cmenu = XtCreateManagedWidget("cmenu", menuButtonWidgetClass,
+ layout, NULL, 0);
+
+ XtRealizeWidget(layout);
+ }
+
+ if (menu != NULL)
+ XtDestroyWidget(menu);
+
+ /*
+ * swaps names because XtDestroyWidget will only really destroy it
+ * when the code returns to XtAppMainLoop
+ */
+ menuname = men & 1 ? "mena" : "menb";
+ menu = XtCreatePopupShell(menuname, simpleMenuWidgetClass,
+ cmenu, NULL, 0);
+ XtSetArg(args[0], XtNmenuName, menuname);
+ XtSetValues(cmenu, args, 1);
+ ++men;
+ sme = XtVaCreateManagedWidget("none", smeBSBObjectClass, menu,
+ NULL, 0);
+ XtAddCallback(sme, XtNcallback, MonitorSelectCardCallback, NULL);
+
+ while (device != NULL) {
+ XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
+ Widget sme;
+ Bool sensitive = True;
+
+ while (screen != NULL) {
+ if (screen->scrn_device == device) {
+ sensitive = screen->scrn_monitor == NULL ||
+ screen->scrn_monitor == current_monitor;
+ break;
+ }
+ screen = (XF86ConfScreenPtr)(screen->list.next);
+ }
+ sme = XtCreateManagedWidget(device->dev_identifier,
+ smeBSBObjectClass, menu,
+ NULL, 0);
+ if (sensitive)
+ XtAddCallback(sme, XtNcallback, MonitorSelectCardCallback, device);
+ XtSetSensitive(sme, sensitive);
+
+ device = (XF86ConfDevicePtr)(device->list.next);
+ }
+
+ XtRealizeWidget(menu);
+
+ XtChangeManagedSet(&current, 1, NULL, NULL, &layout, 1);
+ current = layout;
+}
diff --git a/hw/xfree86/utils/xorgcfg/monitor-cfg.h b/hw/xfree86/utils/xorgcfg/monitor-cfg.h
new file mode 100644
index 000000000..03ca18a41
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/monitor-cfg.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor-cfg.h,v 1.3 2000/11/30 20:55:18 paulo Exp $
+ */
+
+#include "config.h"
+
+#ifndef _xf86cfg_monitor_h
+#define _xf86cfg_monitor_h
+
+/*
+ * Prototypes
+ */
+XtPointer MonitorConfig(XtPointer);
+void MonitorLayout(XF86SetupInfo*);
+void MonitorVidtune(XF86SetupInfo*);
+int string_to_parser_range(char*, parser_range*, int);
+#define PARSER_RANGE_SIZE 256
+/* string must have at least 256 bytes */
+int parser_range_to_string(char*, parser_range*, int);
+
+#endif /* _xf86cfg_monitor_h */
diff --git a/hw/xfree86/utils/xorgcfg/monitor.xbm b/hw/xfree86/utils/xorgcfg/monitor.xbm
new file mode 100644
index 000000000..c4b01eb74
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/monitor.xbm
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor.xbm,v 1.1 2000/04/04 22:37:00 dawes Exp $
+ */
+#define monitor_width 50
+#define monitor_height 44
+static unsigned char monitor_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+ 0x03, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xe0, 0x01, 0x00,
+ 0x00, 0x00, 0x1e, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x70,
+ 0xfc, 0xff, 0xff, 0xff, 0x38, 0x00, 0x30, 0xfe, 0xff, 0xff, 0xff, 0x31,
+ 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00,
+ 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03,
+ 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00,
+ 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00,
+ 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00,
+ 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30,
+ 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33,
+ 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00,
+ 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03,
+ 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00,
+ 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00,
+ 0x33, 0x00, 0x30, 0x03, 0x00, 0x00, 0x00, 0x33, 0x00, 0x30, 0xfe, 0xff,
+ 0xff, 0xff, 0x31, 0x00, 0x70, 0xfc, 0xff, 0xff, 0xff, 0x38, 0x00, 0x60,
+ 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x1e,
+ 0x00, 0xc0, 0x1f, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff,
+ 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0xc0, 0x0f,
+ 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x30, 0x00,
+ 0x00, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
+ 0xf8, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/hw/xfree86/utils/xorgcfg/monitor.xpm b/hw/xfree86/utils/xorgcfg/monitor.xpm
new file mode 100644
index 000000000..c694edf2e
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/monitor.xpm
@@ -0,0 +1,79 @@
+/* XPM */
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/monitor.xpm,v 1.1 2000/04/04 22:37:00 dawes Exp $
+ */
+static char * monitor_xpm[] = {
+"47 40 6 1",
+" c none",
+"Z c #DF7DE38DDF7D",
+". c #BEFBBEFBBEFB",
+"X c #9E799A699E79",
+"o c #30C230C230C2",
+"O c #96589E799658",
+"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ..",
+"Z..............................................",
+"Z.............................................X",
+"Z.............................................X",
+"Z...XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.....X",
+"Z...Xooooooooooooooooooooooooooooooooooooo....X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z...XoooooooooooooooooooooooooooooooooooooZ...X",
+"Z....oooooooooooooooooooooooooooooooooooooZ...X",
+"Z.....ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ...X",
+"Z.............................................X",
+"Z.............................................X",
+"..............................................X",
+"..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
+" OOOOOOOOOOOOOOOOOOOOOOOOOo ",
+" XXXXXXXXXXXXXXXXXXXXXXXXXX ",
+" OOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo. ",
+" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXo ",
+" ooooooooooooooooooooooooooooooooooooooo "};
diff --git a/hw/xfree86/utils/xorgcfg/mouse-cfg.c b/hw/xfree86/utils/xorgcfg/mouse-cfg.c
new file mode 100644
index 000000000..761da248a
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/mouse-cfg.c
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.c,v 1.10 2003/02/15 05:37:58 paulo Exp $
+ */
+
+#include "xf86config.h"
+#include "mouse-cfg.h"
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/Viewport.h>
+#include <X11/extensions/xf86misc.h>
+
+/*
+ * Prototypes
+ */
+static void MouseDeviceCallback(Widget, XtPointer, XtPointer);
+static void MouseProtocolCallback(Widget, XtPointer, XtPointer);
+static void MouseEmulateCallback(Widget, XtPointer, XtPointer);
+static void MouseApplyCallback(Widget, XtPointer, XtPointer);
+static Bool MouseConfigCheck(void);
+
+/*
+ * Initialization
+ */
+static struct MouseProtocol {
+ char *name;
+ int type;
+} protocols[] = {
+#ifdef SCO
+ {"OsMouse", MTYPE_AUTOMOUSE},
+#endif
+#ifdef WSCONS_SUPPORT
+ {"wsmouse", MTYPE_AUTOMOUSE},
+#endif
+ {"Auto", MTYPE_AUTOMOUSE},
+ {"SysMouse", MTYPE_SYSMOUSE},
+ {"MouseSystems", MTYPE_MOUSESYS},
+ {"BusMouse", MTYPE_BUSMOUSE},
+ {"PS/2", MTYPE_PS_2},
+ {"Microsoft", MTYPE_MICROSOFT},
+#ifndef __FreeBSD__
+ {"ImPS/2", MTYPE_IMPS2},
+ {"ExplorerPS/2", MTYPE_EXPPS2},
+ {"GlidePointPS/2", MTYPE_GLIDEPOINTPS2},
+ {"MouseManPlusPS/2", MTYPE_MMANPLUSPS2},
+ {"NetMousePS/2", MTYPE_NETPS2},
+ {"NetScrollPS/2", MTYPE_NETSCROLLPS2},
+ {"ThinkingMousePS/2", MTYPE_THINKINGPS2},
+#endif
+ {"AceCad", MTYPE_ACECAD},
+ {"GlidePoint", MTYPE_GLIDEPOINT},
+ {"IntelliMouse", MTYPE_IMSERIAL},
+ {"Logitech", MTYPE_LOGITECH},
+ {"MMHitTab", MTYPE_MMHIT},
+ {"MMSeries", MTYPE_MMSERIES},
+ {"MouseMan", MTYPE_LOGIMAN},
+ {"ThinkingMouse", MTYPE_THINKING},
+};
+
+static Widget text;
+static char *device, *protocol;
+static Bool emulate;
+static XF86ConfInputPtr current_input;
+
+/*
+ * Implementation
+ */
+/*ARGSUSED*/
+XtPointer
+MouseConfig(XtPointer config)
+{
+ XF86ConfInputPtr mouse = (XF86ConfInputPtr)config;
+ XF86OptionPtr option;
+ char mouse_name[32];
+ Arg args[1];
+
+ static char *Device = "Device", *Protocol = "Protocol",
+ *Emulate3Buttons = "Emulate3Buttons",
+ *Emulate3Timeout = "Emulate3Timeout";
+
+ current_input = mouse;
+
+ if (mouse != NULL) {
+ emulate = xf86findOption(mouse->inp_option_lst,
+ Emulate3Buttons) != NULL;
+ if ((option = xf86findOption(mouse->inp_option_lst, Device)) != NULL)
+ device = option->opt_val;
+ else
+ device = NULL;
+ if ((option = xf86findOption(mouse->inp_option_lst, Protocol)) != NULL)
+ protocol = option->opt_val;
+ else
+ protocol = NULL;
+
+ XtSetArg(args[0], XtNstring, mouse->inp_identifier);
+ XtSetValues(ident_widget, args, 1);
+ }
+ else {
+ XF86ConfInputPtr input = XF86Config->conf_input_lst;
+ int nmouses = 0;
+
+ while (input != NULL) {
+ if (strcasecmp(input->inp_driver, "mouse") == 0)
+ ++nmouses;
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+ do {
+ XmuSnprintf(mouse_name, sizeof(mouse_name), "Mouse%d", nmouses);
+ ++nmouses;
+ } while (xf86findInput(mouse_name,
+ XF86Config->conf_input_lst));
+
+ XtSetArg(args[0], XtNstring, mouse_name);
+ XtSetValues(ident_widget, args, 1);
+
+ emulate = True;
+ device = NULL;
+ protocol = NULL;
+ }
+
+ xf86info.cur_list = MOUSE;
+ XtSetSensitive(back, xf86info.lists[MOUSE].cur_function > 0);
+ XtSetSensitive(next, xf86info.lists[MOUSE].cur_function <
+ xf86info.lists[MOUSE].num_functions - 1);
+ (xf86info.lists[MOUSE].functions[xf86info.lists[MOUSE].cur_function])
+ (&xf86info);
+
+ if (ConfigLoop(MouseConfigCheck) == True) {
+ XtSetArg(args[0], XtNstring, &device);
+ XtGetValues(text, args, 1);
+ if (mouse == NULL) {
+ mouse = XtNew(XF86ConfInputRec);
+ mouse->list.next = NULL;
+ mouse->inp_identifier = XtNewString(ident_string);
+ mouse->inp_driver = XtNewString("mouse");
+ mouse->inp_option_lst = xf86newOption(XtNewString(Device),
+ XtNewString(device));
+ xf86addNewOption(mouse->inp_option_lst,
+ XtNewString(Protocol), XtNewString(protocol));
+ if (emulate) {
+ xf86addNewOption(mouse->inp_option_lst,
+ XtNewString(Emulate3Buttons), NULL);
+ xf86addNewOption(mouse->inp_option_lst,
+ XtNewString(Emulate3Timeout),
+ XtNewString("50"));
+ }
+ mouse->inp_comment = NULL;
+ }
+ else {
+ if ((option = xf86findOption(mouse->inp_option_lst, Device)) != NULL) {
+ XtFree(option->opt_val);
+ option->opt_val = XtNewString(device);
+ XtFree(option->opt_comment);
+ }
+ else {
+ if (mouse->inp_option_lst == NULL)
+ mouse->inp_option_lst = xf86newOption(XtNewString(Device),
+ XtNewString(device));
+ else
+ xf86addNewOption(mouse->inp_option_lst,
+ XtNewString(Device), XtNewString(device));
+ }
+
+ if ((option = xf86findOption(mouse->inp_option_lst, Protocol)) != NULL) {
+ XtFree(option->opt_val);
+ option->opt_val = XtNewString(protocol);
+ XtFree(option->opt_comment);
+ }
+ else
+ xf86addNewOption(mouse->inp_option_lst,
+ XtNewString(Protocol), XtNewString(protocol));
+
+ if (emulate == False) {
+ xf86removeOption(&(mouse->inp_option_lst), Emulate3Buttons);
+ xf86removeOption(&(mouse->inp_option_lst), Emulate3Timeout);
+ }
+ else if (emulate) {
+ xf86addNewOption(mouse->inp_option_lst,
+ XtNewString(Emulate3Buttons), NULL);
+ xf86addNewOption(mouse->inp_option_lst,
+ XtNewString(Emulate3Timeout), XtNewString("50"));
+ }
+ }
+ if (strcasecmp(mouse->inp_identifier, ident_string))
+ xf86renameInput(XF86Config, mouse, ident_string);
+
+ return ((XtPointer)mouse);
+ }
+
+ return (NULL);
+}
+
+static Bool
+MouseConfigCheck(void)
+{
+ Arg args[1];
+ XF86ConfInputPtr mouse = XF86Config->conf_input_lst;
+
+ XtSetArg(args[0], XtNstring, &device);
+ XtGetValues(text, args, 1);
+
+ if (ident_string == NULL || strlen(ident_string) == 0 ||
+ device == NULL || strlen(device) == 0 || protocol == NULL)
+ return (False);
+ while (mouse != NULL) {
+ if (mouse != current_input &&
+ strcasecmp(ident_string, mouse->inp_identifier) == 0)
+ return (False);
+ mouse = (XF86ConfInputPtr)(mouse->list.next);
+ }
+
+ return (True);
+}
+
+static void
+MouseDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+ Arg args[1];
+
+ XtSetArg(args[0], XtNstring, info->string);
+ XtSetValues((Widget)user_data, args, 1);
+ XawTextSetInsertionPoint((Widget)user_data, strlen(info->string));
+}
+
+static void
+MouseProtocolCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+
+ protocol = info->string;
+}
+
+static void
+MouseEmulateCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ emulate = (Bool)(long)call_data;
+}
+
+static void
+MouseApplyCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ int i;
+ XF86MiscMouseSettings mouse;
+
+ XF86MiscGetMouseSettings(XtDisplay(w), &mouse);
+ XtFree(mouse.device);
+
+ if (mouse.baudrate == 0 || mouse.baudrate < 0 || mouse.baudrate > 9600 ||
+ mouse.baudrate % 1200)
+ mouse.baudrate = 1200;
+
+ mouse.type = MTYPE_AUTOMOUSE;
+ for (i = 0; i < sizeof(protocols) / sizeof(protocols[0]); i++)
+ if (strcmp(protocols[i].name, protocol) == 0) {
+ mouse.type = protocols[i].type;
+ break;
+ }
+
+ mouse.emulate3buttons = emulate;
+ mouse.flags |= MF_REOPEN;
+
+ mouse.device = device;
+
+ XFlush(XtDisplay(w));
+ XF86MiscSetMouseSettings(XtDisplay(w), &mouse);
+}
+
+void
+MouseDeviceAndProtocol(XF86SetupInfo *info)
+{
+ static int first = 1, ndevices;
+ static Widget mouse_dp, listD, listP, emul3, apply;
+ static char **devices;
+ static char *dirs[] = {
+ "/dev",
+#ifdef __linux__
+ "/dev/input"
+#endif
+ };
+ static char *patterns[] = {
+#ifdef WSCONS_SUPPORT
+ "wsmouse",
+#endif
+ "cuaa",
+ "mice",
+ "mouse",
+ "ps",
+ "sysmouse",
+ "ttyS",
+ };
+ Arg args[2];
+ int i;
+
+ if (first) {
+ Widget label, viewport;
+ struct dirent *ent;
+ DIR *dir;
+ char **list;
+ int count;
+
+ first = 0;
+
+ mouse_dp = XtCreateWidget("mouseDP", formWidgetClass,
+ configp, NULL, 0);
+
+ /* DEVICE */
+ for (count = 0; count < sizeof(dirs) / sizeof(dirs[0]); count++) {
+ if ((dir = opendir(dirs[count])) != NULL) {
+ int i, len, xlen = strlen(dirs[count]) + 2;
+
+ (void)readdir(dir);
+ (void)readdir(dir);
+ while ((ent = readdir(dir)) != NULL) {
+ for (i = 0; i < sizeof(patterns) / sizeof(patterns[0]); i++) {
+ len = strlen(patterns[i]);
+
+ if (strncmp(patterns[i], ent->d_name, len) == 0) {
+ len = strlen(ent->d_name) + xlen;
+
+ devices = (char**)XtRealloc((XtPointer)devices,
+ sizeof(char*) * ++ndevices);
+ devices[ndevices - 1] = XtMalloc(len);
+ XmuSnprintf(devices[ndevices - 1], len, "%s/%s",
+ dirs[count], ent->d_name);
+ }
+ }
+ }
+ closedir(dir);
+ }
+ }
+
+ label = XtCreateManagedWidget("labelD", labelWidgetClass,
+ mouse_dp, NULL, 0);
+ text = XtVaCreateManagedWidget("device", asciiTextWidgetClass,
+ mouse_dp,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ viewport = XtCreateManagedWidget("viewportD", viewportWidgetClass,
+ mouse_dp, NULL, 0);
+
+ listD = XtVaCreateManagedWidget("listD", listWidgetClass,
+ viewport,
+ XtNlist, devices,
+ XtNnumberStrings, ndevices,
+ NULL, 0);
+ XtAddCallback(listD, XtNcallback, MouseDeviceCallback, (XtPointer)text);
+
+ /* PROTOCOL */
+ label = XtCreateManagedWidget("labelP", labelWidgetClass,
+ mouse_dp, NULL, 0);
+ viewport = XtCreateManagedWidget("viewportP", viewportWidgetClass,
+ mouse_dp, NULL, 0);
+
+ list = (char**)XtMalloc(sizeof(char*) *
+ sizeof(protocols)/sizeof(protocols[0]));
+ for (count = 0; count < sizeof(protocols)/sizeof(protocols[0]); count++)
+ list[count] = XtNewString(protocols[count].name);
+ listP = XtVaCreateManagedWidget("listP", listWidgetClass,
+ viewport,
+ XtNlist, list,
+ XtNnumberStrings, count,
+ NULL, 0);
+ XtAddCallback(listP, XtNcallback, MouseProtocolCallback, NULL);
+
+ emul3 = XtVaCreateManagedWidget("emulate3", toggleWidgetClass,
+ mouse_dp, XtNstate, True, NULL, 0);
+ XtAddCallback(emul3, XtNcallback, MouseEmulateCallback, NULL);
+ apply = XtCreateManagedWidget("apply", commandWidgetClass,
+ mouse_dp, NULL, 0);
+ XtAddCallback(apply, XtNcallback, MouseApplyCallback, NULL);
+
+ XtRealizeWidget(mouse_dp);
+ }
+
+ if (device != NULL) {
+ for (i = 0; i < ndevices; i++)
+ if (strcmp(device, devices[i]) == 0) {
+ XtSetArg(args[0], XtNstring, device);
+ XtSetValues(text, args, 1);
+ XawListHighlight(listD, i);
+ break;
+ }
+
+ if (i >= ndevices) {
+ devices = (char**)XtRealloc((XtPointer)devices,
+ sizeof(char*) * ++ndevices);
+ devices[ndevices - 1] = XtNewString(device);
+ XawListHighlight(listD, ndevices - 1);
+ XtSetArg(args[0], XtNlist, devices);
+ XtSetArg(args[1], XtNnumberStrings, ndevices);
+ XtSetValues(listD, args, 2);
+ }
+ device = devices[i];
+ }
+ else {
+ XtSetArg(args[0], XtNstring, "");
+ XtSetValues(text, args, 1);
+ XawListUnhighlight(listD);
+ }
+
+ if (protocol != NULL) {
+ for (i = 0; i < sizeof(protocols) / sizeof(protocols[0]); i++)
+ if (strcasecmp(protocol, protocols[i].name) == 0) {
+ protocol = protocols[i].name;
+ XawListHighlight(listP, i);
+ break;
+ }
+ }
+ else {
+ /* "Auto" is the default */
+ protocol = protocols[0].name;
+ XawListHighlight(listP, 0);
+ }
+
+ XtSetArg(args[0], XtNstate, emulate);
+ XtSetValues(emul3, args, 1);
+
+ XtChangeManagedSet(&current, 1, NULL, NULL, &mouse_dp, 1);
+ current = mouse_dp;
+}
diff --git a/hw/xfree86/utils/xorgcfg/mouse-cfg.h b/hw/xfree86/utils/xorgcfg/mouse-cfg.h
new file mode 100644
index 000000000..249f50840
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/mouse-cfg.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse-cfg.h,v 1.1 2000/04/04 22:37:00 dawes Exp $
+ */
+
+#include "config.h"
+
+#ifndef _xf86cfg_mouse_h
+#define _xf86cfg_mouse_h
+
+/*
+ * Prototypes
+ */
+XtPointer MouseConfig(XtPointer);
+void MouseDeviceAndProtocol(XF86SetupInfo*);
+
+#endif /* _xf86cfg_mouse_h */
+
diff --git a/hw/xfree86/utils/xorgcfg/mouse.xbm b/hw/xfree86/utils/xorgcfg/mouse.xbm
new file mode 100644
index 000000000..8577137e6
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/mouse.xbm
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse.xbm,v 1.1 2000/04/04 22:37:01 dawes Exp $
+ */
+#define mouse_width 50
+#define mouse_height 44
+static unsigned char mouse_bits[] = {
+ 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcf, 0xcf, 0x03, 0x00,
+ 0x00, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x79, 0x78,
+ 0x1e, 0x00, 0x00, 0x00, 0x60, 0x38, 0x70, 0x18, 0x00, 0x00, 0x00, 0x70,
+ 0x30, 0x30, 0x38, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00,
+ 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30,
+ 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x30, 0x30,
+ 0x30, 0x30, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00,
+ 0xf0, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0x00,
+ 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
+ 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30,
+ 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00,
+ 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30,
+ 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00,
+ 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
+ 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00,
+ 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
+ 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30,
+ 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00,
+ 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x38,
+ 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xe0, 0x01,
+ 0x00, 0x1e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00,
+ 0x00, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
diff --git a/hw/xfree86/utils/xorgcfg/mouse.xpm b/hw/xfree86/utils/xorgcfg/mouse.xpm
new file mode 100644
index 000000000..7ad21fb8f
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/mouse.xpm
@@ -0,0 +1,76 @@
+/* XPM */
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/mouse.xpm,v 1.1 2000/04/04 22:37:01 dawes Exp $
+ */
+static char * mouse_xpm[] = {
+"26 35 8 1",
+" c none",
+". c #E79DE79DE79D",
+"X c #CF3CCF3CCF3C",
+"o c #BEFBBAEABEFB",
+"O c #8E3896588E38",
+"+ c #AEBAAAAAAEBA",
+"@ c #9E79AAAA9E79",
+"# c #A699A289A699",
+" .....XXXX. ",
+" X..o.XXXXXXXo... ",
+" X..XXo.XXXXXXXo.XX.X ",
+" X.XXXXo.XXXXXXXo.XXX.X ",
+" .XXXXXo.XXXXXXXo.XXXXoo ",
+" X.XXXXXo.XXXoXXXo.XXXXoXo",
+"oX.XXXXXo.XXXXXXXo.XXXXXoo",
+"oX.XoXoXo.XXoXoXXo.XXXXXoO",
+"oX.XXXXXo.XXXXXXXo.XXoXX+O",
+"oX.XXXoXo.XXoXoXXo.XXXXX+O",
+"oX.XXXXXo.XXXXXXXo.XX...+O",
+"ooooo...o........oooo@@@OO",
+"oX.XX#@@@@@@@@@@@@@@@XXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXXX+O",
+"oX.XXXXXXXXXXXXXXXXXXXX+oO",
+" #X.XXXXXXXXXXXXXXXXXXooO ",
+" #X.XXXXXXXXXXXXXXXXXXooO ",
+" #X.XXXXXXXXXXXXXXXXXX+oO ",
+" #X.XXXXXXXXXXXXXXXXXX+oO ",
+" #.XXXXXXXXXXXXXXXXX++O ",
+" #X..XXXXXXXXXXXXXXX+oO ",
+" #X.XXXXXXXXXXXXXX+oO ",
+" #.XXXXXXXXXXXXXX+O ",
+" #X..XXXXXXXXXo++oO ",
+" #XX..XXXXXoo+ooO ",
+" ##XXooooo+ooOO ",
+" ooooooooOO ",
+" oOOOOO "};
diff --git a/hw/xfree86/utils/xorgcfg/narrower.xbm b/hw/xfree86/utils/xorgcfg/narrower.xbm
new file mode 100644
index 000000000..0649ef8b4
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/narrower.xbm
@@ -0,0 +1,8 @@
+#define narrower_width 19
+#define narrower_height 19
+static unsigned char narrower_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0x00, 0x18, 0xc0, 0x00,
+ 0x38, 0xe0, 0x00, 0x78, 0xf0, 0x00, 0xf8, 0xf8, 0x00, 0xff, 0xfd, 0x07,
+ 0xff, 0xff, 0x07, 0xff, 0xff, 0x07, 0xff, 0xff, 0x07, 0xff, 0xfd, 0x07,
+ 0xf8, 0xf8, 0x00, 0x78, 0xf0, 0x00, 0x38, 0xe0, 0x00, 0x18, 0xc0, 0x00,
+ 0x08, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/options.c b/hw/xfree86/utils/xorgcfg/options.c
new file mode 100644
index 000000000..10828a94a
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/options.c
@@ -0,0 +1,788 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.c,v 1.12 2001/11/03 20:32:31 paulo Exp $
+ */
+
+#include "options.h"
+#include "xf86config.h"
+#include <X11/Xresource.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/SimpleMenP.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/Viewport.h>
+#include <ctype.h>
+
+/*
+ * Prototypes
+ */
+static void PopdownCallback(Widget, XtPointer, XtPointer);
+static void SelectOptionCallback(Widget, XtPointer, XtPointer);
+static void AddOption(Widget, XtPointer, XtPointer);
+static void RemoveOption(Widget, XtPointer, XtPointer);
+static void UpdateOption(Widget, XtPointer, XtPointer);
+static void UpdateOptionList(void);
+#ifdef USE_MODULES
+static void AddDriverOption(Widget, XtPointer, XtPointer);
+static void SelectModuleCallback(Widget, XtPointer, XtPointer);
+static void SelectModuleOptionCallback(Widget, XtPointer, XtPointer);
+static void ModuleOptionsPopdown(Widget, XtPointer, XtPointer);
+#endif
+static Bool EnumDatabase(XrmDatabase*, XrmBindingList, XrmQuarkList,
+ XrmRepresentation*, XrmValue*, XPointer);
+
+/*
+ * Initialization
+ */
+Widget optionsShell;
+static XF86OptionPtr *options;
+static Widget add, remov, update, list, name, value;
+static char *option_str;
+static int option_index, popped = False;
+static char *Options = "lib/X11/Options";
+XrmDatabase options_xrm;
+struct {
+ char *string;
+ int offset;
+} rebuild_xrm;
+#ifdef USE_MODULES
+static Widget modList, optList, desc, modOptionsShell, labelType;
+static char *module_sel;
+static char *types[] = {
+ "none", "integer", "(non null) string", "string", "real",
+ "boolean", "frequency",
+};
+#endif
+
+/*
+ * Implementation
+ */
+#ifdef USE_MODULES
+static int
+qcmp_str(_Xconst void *a, _Xconst void *b)
+{
+ return (strcmp(*(char**)a, *(char**)b));
+}
+
+void
+ModuleOptionsPopup(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ xf86cfgModuleOptions *info = module_options;
+
+ if (modOptionsShell == NULL) {
+ char **ops;
+ int nops;
+ Widget pane, form, viewport, bottom, popdown;
+
+ modOptionsShell = XtCreatePopupShell("moduleOptions",
+ transientShellWidgetClass,
+ optionsShell, NULL, 0);
+
+ pane = XtCreateManagedWidget("pane", panedWidgetClass,
+ modOptionsShell, NULL, 0);
+
+ form = XtCreateManagedWidget("descriptions", formWidgetClass,
+ pane, NULL, 0);
+ labelType = XtCreateManagedWidget("labelType", labelWidgetClass,
+ form, NULL, 0);
+ XtCreateManagedWidget("module", labelWidgetClass, form, NULL, 0);
+ viewport = XtCreateManagedWidget("viewM", viewportWidgetClass,
+ form, NULL, 0);
+ ops = NULL;
+ nops = 0;
+ while (info) {
+ ++nops;
+ ops = (char**)XtRealloc((XtPointer)ops, sizeof(char*) * nops);
+ ops[nops - 1] = XtNewString(info->name);
+ info = info->next;
+ }
+ if (nops == 0) {
+ ops = (char**)XtMalloc(sizeof(char*));
+ ops[0] = XtNewString("");
+ nops = 1;
+ }
+ else
+ qsort(ops, nops, sizeof(char*), qcmp_str);
+ modList = XtVaCreateManagedWidget("modL", listWidgetClass,
+ viewport, XtNlist, ops,
+ XtNnumberStrings, nops,
+ NULL, 0);
+ XtAddCallback(modList, XtNcallback, SelectModuleCallback, NULL);
+ XtCreateManagedWidget("option", labelWidgetClass, form, NULL, 0);
+ viewport = XtCreateManagedWidget("viewO", viewportWidgetClass,
+ form, NULL, 0);
+ ops = (char**)XtMalloc(sizeof(char*));
+ ops[0] = XtNewString("");
+ optList = XtVaCreateManagedWidget("optL", listWidgetClass,
+ viewport, XtNlist, ops,
+ XtNnumberStrings, 1, NULL, 0);
+ XtAddCallback(optList, XtNcallback, SelectModuleOptionCallback, NULL);
+ desc = XtVaCreateManagedWidget("desc", asciiTextWidgetClass,
+ form, XtNeditType, XawtextRead,
+ NULL, 0);
+
+ bottom = XtCreateManagedWidget("bottom", formWidgetClass,
+ pane, NULL, 0);
+ popdown = XtVaCreateManagedWidget("popdown", commandWidgetClass,
+ bottom, NULL, 0);
+ XtAddCallback(popdown, XtNcallback, ModuleOptionsPopdown, NULL);
+ XtRealizeWidget(modOptionsShell);
+ XSetWMProtocols(DPY, XtWindow(modOptionsShell), &wm_delete_window, 1);
+
+ info = module_options;
+ }
+
+ if (module_sel && *module_sel) {
+ XawListReturnStruct list; /* hack to call ballbacks */
+ char **strs;
+ int nstrs, idx = 0;
+
+ XtVaGetValues(modList, XtNlist, &strs, XtNnumberStrings, &nstrs, NULL);
+ for (idx = nstrs - 1; idx > 0; idx--)
+ if (strcmp(module_sel, strs[idx]) == 0)
+ break;
+ while (info) {
+ if (strcmp(module_sel, info->name) == 0)
+ break;
+ info = info->next;
+ }
+ if (info) {
+ list.string = info->name;
+ list.list_index = idx;
+ XawListHighlight(modList, idx);
+ SelectModuleCallback(modList, NULL, (XtPointer)&list);
+ }
+ if (option_str && *option_str) {
+ OptionInfoPtr opts = info->option;
+
+ idx = 0;
+ while (opts && opts->name) {
+ if (strcmp(opts->name, option_str) == 0)
+ break;
+ ++idx;
+ ++opts;
+ }
+
+ if (opts && opts->name) {
+ list.string = (char *)opts->name;
+ list.list_index = idx;
+ XawListHighlight(optList, idx);
+ SelectModuleOptionCallback(optList, NULL, (XtPointer)&list);
+ }
+ }
+ }
+ XtPopup(modOptionsShell, XtGrabNone);
+}
+
+/*ARGSUSED*/
+static void
+ModuleOptionsPopdown(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XtPopdown(modOptionsShell);
+}
+
+/*ARGSUSED*/
+void
+ModuleOptionsCancelAction(Widget w, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ ModuleOptionsPopdown(w, NULL, NULL);
+}
+#endif
+
+void
+CreateOptionsShell(void)
+{
+ optionsShell = XtCreatePopupShell("options", transientShellWidgetClass,
+ toplevel, NULL, 0);
+}
+
+#ifdef USE_MODULES
+void
+OptionsPopup(XF86OptionPtr *opts, char *driver, OptionInfoPtr drv_opts)
+#else
+void
+OptionsPopup(XF86OptionPtr *opts)
+#endif
+{
+ static int first = 1;
+#ifdef USE_MODULES
+ static Widget button, menu;
+ static char label[256], menuName[16];
+ Widget sme;
+ char buf[256];
+ int i = 0;
+ Arg args[1];
+ static int menuN;
+#endif
+
+ option_str = NULL;
+ options = opts;
+ if (first) {
+ Widget pane, form, viewport, bottom, popdown;
+
+ first = 0;
+
+ if (optionsShell == NULL)
+ CreateOptionsShell();
+ pane = XtCreateManagedWidget("pane", panedWidgetClass,
+ optionsShell, NULL, 0);
+
+ form = XtCreateManagedWidget("commands", formWidgetClass,
+ pane, NULL, 0);
+ add = XtCreateManagedWidget("add", commandWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(add, XtNcallback, AddOption, NULL);
+ remov = XtCreateManagedWidget("remove", commandWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(remov, XtNcallback, RemoveOption, NULL);
+ update = XtCreateManagedWidget("update", commandWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(update, XtNcallback, UpdateOption, NULL);
+#ifdef USE_MODULES
+ if (!nomodules) {
+ Widget command;
+
+ command = XtCreateManagedWidget("help", commandWidgetClass,
+ form, NULL, 0);
+ XtAddCallback(command, XtNcallback, ModuleOptionsPopup, NULL);
+ }
+#endif
+ form = XtCreateManagedWidget("form", formWidgetClass,
+ pane, NULL, 0);
+ XtVaCreateManagedWidget("label1", labelWidgetClass, form,
+ XtNlabel, " Option \"",
+ NULL, 0);
+ name = XtVaCreateManagedWidget("name", asciiTextWidgetClass, form,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ XtVaCreateManagedWidget("label2", labelWidgetClass,
+ form,
+ XtNlabel, "\" \"",
+ NULL, 0);
+ value = XtVaCreateManagedWidget("value", asciiTextWidgetClass, form,
+ XtNeditType, XawtextEdit,
+ NULL, 0);
+ XtVaCreateManagedWidget("label3", labelWidgetClass, form,
+ XtNlabel, "\" ",
+ NULL, 0);
+ viewport = XtCreateManagedWidget("viewport", viewportWidgetClass,
+ form, NULL, 0);
+ list = XtCreateManagedWidget("list", listWidgetClass,
+ viewport, NULL, 0);
+ XtAddCallback(list, XtNcallback, SelectOptionCallback, NULL);
+ bottom = XtCreateManagedWidget("bottom", formWidgetClass,
+ pane, NULL, 0);
+#ifdef USE_MODULES
+ if (!nomodules)
+ button = XtCreateManagedWidget("driverOpts", menuButtonWidgetClass,
+ bottom, NULL, 0);
+#endif
+ popdown = XtVaCreateManagedWidget("popdown", commandWidgetClass,
+ bottom, NULL, 0);
+#ifdef USE_MODULES
+ if (!nomodules)
+ XtVaSetValues(popdown, XtNfromHoriz, button, NULL, 0);
+#endif
+
+ XtAddCallback(popdown, XtNcallback, PopdownCallback, NULL);
+ XtRealizeWidget(optionsShell);
+ XSetWMProtocols(DPY, XtWindow(optionsShell), &wm_delete_window, 1);
+
+#ifdef USE_MODULES
+ if (!nomodules) {
+ char *str;
+
+ XtSetArg(args[0], XtNlabel, &str);
+ XtGetValues(button, args, 1);
+ XmuSnprintf(label, sizeof(label), "%s", str);
+ }
+#endif
+ }
+
+#ifdef USE_MODULES
+ if (!nomodules) {
+ if (menu)
+ XtDestroyWidget(menu);
+ XmuSnprintf(menuName, sizeof(buf), "optionM%d", menuN);
+ menuN = !menuN;
+ menu = XtCreatePopupShell(menuName, simpleMenuWidgetClass, button,
+ NULL, 0);
+ XtVaSetValues(button, XtNmenuName, menuName, NULL, 0);
+ if (drv_opts) {
+ int len, longest = 0;
+ char fmt[32];
+
+ for (i = 0; drv_opts[i].name != NULL; i++) {
+ len = strlen(drv_opts[i].name);
+ if (len > longest)
+ longest = len;
+ }
+ XmuSnprintf(fmt, sizeof(fmt), "%c-%ds %%s", '%', longest);
+ for (; drv_opts->name != NULL; drv_opts++) {
+ char *type;
+
+ if (drv_opts->type >= OPTV_NONE && drv_opts->type <= OPTV_FREQ)
+ type = types[drv_opts->type];
+ else
+ type = "UNKNOWN";
+
+ XmuSnprintf(buf, sizeof(buf), fmt, drv_opts->name, type);
+ sme = XtVaCreateManagedWidget(drv_opts->name, smeBSBObjectClass,
+ menu, XtNlabel, buf, NULL, 0);
+ XtAddCallback(sme, XtNcallback, AddDriverOption, (XtPointer)drv_opts);
+ }
+ }
+ if (i) {
+ xf86cfgModuleOptions *mod = module_options;
+
+ while (mod) {
+ if (strcmp(mod->name, driver) == 0) {
+ /* don't assign to driver, as it may be a temp string */
+ module_sel = mod->name;
+ break;
+ }
+ mod = mod->next;
+ }
+ XmuSnprintf(buf, sizeof(buf), "%s%s", label, driver);
+ XtSetArg(args[0], XtNlabel, buf);
+ XtSetValues(button, args, 1);
+ XtMapWidget(button);
+ }
+ else
+ XtUnmapWidget(button);
+ }
+#endif
+
+ UpdateOptionList();
+ popped = True;
+ XtPopup(optionsShell, XtGrabExclusive);
+
+ while (popped)
+ XtAppProcessEvent(XtWidgetToApplicationContext(optionsShell), XtIMAll);
+}
+
+static void
+UpdateOptionList(void)
+{
+ Arg args[2];
+ char **ops, **oldops;
+ int nops, oldnops;
+ XF86OptionPtr opt;
+
+ ops = NULL;
+ nops = 0;
+ XawListUnhighlight(list);
+ XtSetArg(args[0], XtNlist, &oldops);
+ XtSetArg(args[1], XtNnumberStrings, &oldnops);
+ XtGetValues(list, args, 2);
+ opt = *options;
+ while (opt != NULL) {
+ if (nops % 16 == 0)
+ ops = (char**)XtRealloc((XtPointer)ops, (nops + 16) *
+ sizeof(char*));
+ ops[nops++] = XtNewString(opt->opt_name);
+ opt = (XF86OptionPtr)(opt->list.next);
+ }
+ if (nops == 0) {
+ ops = (char**)XtMalloc(sizeof(char*));
+ ops[0] = XtNewString("");
+ nops = 1;
+ }
+ XtSetArg(args[0], XtNlist, ops);
+ XtSetArg(args[1], XtNnumberStrings, nops);
+ XtSetValues(list, args, 2);
+ if (oldnops > 0 &&
+ (oldnops != 1 || XtName(list) != oldops[0])) {
+ while (--oldnops >= 0)
+ XtFree(oldops[oldnops]);
+ XtFree((XtPointer)oldops);
+ }
+
+ XtSetArg(args[0], XtNstring, "");
+ XtSetValues(name, args, 1);
+ XtSetValues(value, args, 1);
+
+ /* force relayout */
+ XtUnmanageChild(list);
+ XtManageChild(list);
+
+ XtSetSensitive(remov, False);
+ XtSetSensitive(update, False);
+}
+
+/*ARGSUSED*/
+static void
+PopdownCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XtPopdown(optionsShell);
+ popped = False;
+}
+
+/*ARGSUSED*/
+void
+OptionsCancelAction(Widget w, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ PopdownCallback(w, NULL, NULL);
+}
+
+/*ARGSUSED*/
+static void
+SelectOptionCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ XF86OptionPtr option;
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+
+ option_str = info->string;
+ option_index = info->list_index;
+ if ((option = xf86findOption(*options, info->string)) != NULL) {
+ XtSetArg(args[0], XtNstring, option->opt_name);
+ XtSetValues(name, args, 1);
+ XtSetArg(args[0], XtNstring,
+ option->opt_val != NULL ? option->opt_val : "");
+ XtSetValues(value, args, 1);
+ }
+ XtSetSensitive(remov, True);
+ XtSetSensitive(update, True);
+}
+
+/*ARGSUSED*/
+static void
+AddOption(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ char *nam, *val;
+
+ XtSetArg(args[0], XtNstring, &nam);
+ XtGetValues(name, args, 1);
+ XtSetArg(args[0], XtNstring, &val);
+ XtGetValues(value, args, 1);
+ if (xf86findOption(*options, nam) != NULL || strlen(nam) == 0)
+ /* XXX xf86addNewOption will trash the option linked list if
+ * the options being added already exists.
+ */
+ return;
+ *options = xf86addNewOption(*options, XtNewString(nam),
+ val && strlen(val) ? XtNewString(val) : NULL);
+ UpdateOptionList();
+}
+
+#ifdef USE_MODULES
+/*ARGSUSED*/
+static void
+AddDriverOption(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ OptionInfoPtr opt = (OptionInfoPtr)user_data;
+ XF86OptionPtr option;
+
+ option_str = (char *)opt->name;
+ XtSetArg(args[0], XtNstring, opt->name);
+ XtSetValues(name, args, 1);
+ if ((option = xf86findOption(*options, opt->name)) == NULL)
+ XtSetArg(args[0], XtNstring, "");
+ else
+ XtSetArg(args[0], XtNstring, option->opt_val);
+ XtSetValues(value, args, 1);
+}
+
+/*ARGSUSED*/
+static void
+SelectModuleCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ xf86cfgModuleOptions *mod = module_options;
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+
+ while (mod) {
+ if (strcmp(mod->name, info->string) == 0)
+ break;
+ mod = mod->next;
+ }
+
+ if (mod) {
+ Arg args[2];
+ char **list = NULL, **old;
+ OptionInfoPtr opts = mod->option;
+ int num = 0, oldnum;
+
+ module_sel = mod->name;
+ XtSetArg(args[0], XtNlist, &old);
+ XtSetArg(args[1], XtNnumberStrings, &oldnum);
+ XtGetValues(optList, args, 2);
+ while (opts && opts->name) {
+ ++num;
+ list = (char**)XtRealloc((XtPointer)list, sizeof(char*) * num);
+ list[num - 1] = XtNewString(opts->name);
+ ++opts;
+ }
+ if (num == 0) {
+ list = (char**)XtMalloc(sizeof(char*));
+ list[0] = XtNewString("");
+ num = 1;
+ }
+ XtSetArg(args[0], XtNlist, list);
+ XtSetArg(args[1], XtNnumberStrings, num);
+ XtSetValues(optList, args, 2);
+ while (--oldnum >= 0)
+ XtFree(old[oldnum]);
+ XtFree((XtPointer)old);
+
+ XtVaSetValues(desc, XtNstring, "", NULL);
+ XawListUnhighlight(optList);
+
+ /* force relayout */
+ XtUnmanageChild(optList);
+ XtManageChild(optList);
+ }
+}
+
+static void
+SelectModuleOptionCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ xf86cfgModuleOptions *mod = module_options;
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+ char *description = NULL, *type = "undefined";
+ char label[256];
+
+ if (module_sel && info->string)
+ description = GetOptionDescription(module_sel, info->string);
+ if (description == NULL)
+ description = "** NO DESCRIPTION AVAILABLE **";
+
+ XtVaSetValues(desc, XtNstring, description, NULL);
+
+ while (mod) {
+ if (strcmp(module_sel, mod->name) == 0)
+ break;
+ mod = mod->next;
+ }
+ if (mod) {
+ OptionInfoPtr opts = mod->option;
+
+ while (opts && opts->name) {
+ if (strcasecmp(opts->name, info->string) == 0)
+ break;
+ ++opts;
+ }
+ if (opts && opts->name && opts->type >= OPTV_NONE &&
+ opts->type <= OPTV_FREQ)
+ type = types[opts->type];
+ }
+
+ XmuSnprintf(label, sizeof(label), "%s.%s (%s)", module_sel, info->string,
+ type);
+ XtVaSetValues(labelType, XtNlabel, label, NULL);
+}
+#endif
+
+/*ARGSUSED*/
+static void
+RemoveOption(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[1];
+ char *str;
+
+ XtSetArg(args[0], XtNstring, &str);
+ XtGetValues(name, args, 1);
+ xf86removeOption(options, str);
+ UpdateOptionList();
+}
+
+/*ARGSUSED*/
+static void
+UpdateOption(Widget w, XtPointer user_data, XtPointer call_data)
+{
+/* xf86removeOption(options, option_str);
+ AddOption(w, user_data, call_data);
+ UpdateOptionList();*/
+
+ Arg args[1];
+ char *nam, *val;
+ XF86OptionPtr option;
+
+ XtSetArg(args[0], XtNstring, &nam);
+ XtGetValues(name, args, 1);
+ XtSetArg(args[0], XtNstring, &val);
+ XtGetValues(value, args, 1);
+ if ((option = xf86findOption(*options, option_str)) == NULL)
+ return;
+ XtFree(option->opt_name);
+ option->opt_name = option_str = XtNewString(nam);
+ XtFree(option->opt_val);
+ if (val && strlen(val))
+ option->opt_val = XtNewString(val);
+ else
+ option->opt_val = NULL;
+
+ UpdateOptionList();
+ XawListHighlight(list, option_index);
+ XtSetArg(args[0], XtNstring, option->opt_name);
+ XtSetValues(name, args, 1);
+ XtSetArg(args[0], XtNstring, option->opt_val);
+ XtSetValues(value, args, 1);
+
+ XtSetSensitive(remov, True);
+ XtSetSensitive(update, True);
+}
+
+/*ARGUSED*/
+static Bool
+EnumDatabase(XrmDatabase *db, XrmBindingList bindings, XrmQuarkList quarks,
+ XrmRepresentation *type, XrmValue *value, XPointer closure)
+{
+ char *module = XrmQuarkToString(quarks[0]),
+ *option = XrmQuarkToString(quarks[1]);
+
+ /* handle *.Option: value */
+ if (module && option == NULL) {
+ option = module;
+ module = "*";
+ }
+
+ /*
+ * NOTE: If the Options file is changed to support any other format than
+ *
+ * Module.Option: description text
+ *
+ * this code will also need to be updated.
+ */
+
+ if (module) {
+ XrmValue xrm;
+ char *type, *value, query[256];
+
+ XmuSnprintf(query, sizeof(query), "%s.%s", module, option);
+ if (XrmGetResource(options_xrm, query, "Module.Option", &type, &xrm))
+ value = (char*)xrm.addr;
+ else
+ value = NULL;
+
+ if (value) {
+ char *norm;
+ unsigned char *ptr;
+ int position;
+ int length = strlen(module) + strlen(option) + strlen(value) + 4;
+
+ rebuild_xrm.string = XtRealloc(rebuild_xrm.string,
+ rebuild_xrm.offset + length);
+ position = rebuild_xrm.offset +
+ sprintf(rebuild_xrm.string + rebuild_xrm.offset, "%s.%s:",
+ module, option);
+
+ /* removes underlines and spaces */
+ norm = strchr(rebuild_xrm.string + rebuild_xrm.offset, '.') + 1;
+ for (; *norm; norm++) {
+ if (*norm == '_' || *norm == ' ' || *norm == '\t') {
+ memmove(norm, norm + 1, strlen(norm) + 1);
+ --position;
+ --length;
+ }
+ }
+
+ for (ptr = (unsigned char*)rebuild_xrm.string + rebuild_xrm.offset;
+ *ptr; ptr++)
+ *ptr = tolower(*ptr);
+ sprintf(rebuild_xrm.string + position, "%s\n", value);
+ rebuild_xrm.offset += length - 1;
+ }
+ }
+
+ return (False);
+}
+
+Bool
+InitializeOptionsDatabase(void)
+{
+ static int first = 1;
+ static Bool result = True;
+
+ if (first) {
+ XrmQuark names[2];
+ XrmQuark classes[2];
+
+ first = 0;
+ XrmInitialize();
+ if ((options_xrm = XrmGetFileDatabase(Options)) == (XrmDatabase)0) {
+ fprintf(stderr, "Cannot open '%s' database.\n", Options);
+ return (False);
+ }
+
+ /* rebuild database, using only lowercase characters */
+ names[0] = classes[0] = names[1] = classes[1] = NULLQUARK;
+ (void)XrmEnumerateDatabase(options_xrm, (XrmNameList)&names,
+ (XrmClassList)&classes, XrmEnumAllLevels,
+ EnumDatabase, NULL);
+
+ /* free previous database, as it is not guaranteed to be
+ * "case insensitive" */
+ XrmDestroyDatabase(options_xrm);
+
+ /* create case insensitive database by making everything lowercase */
+ if (rebuild_xrm.string == NULL ||
+ (options_xrm = XrmGetStringDatabase(rebuild_xrm.string)) ==
+ (XrmDatabase)0) {
+ fprintf(stderr, "Cannot rebuild '%s' database.\n", Options);
+ XtFree(rebuild_xrm.string);
+ return (False);
+ }
+ XtFree(rebuild_xrm.string);
+ }
+
+ return (result);
+}
+
+char *
+GetOptionDescription(char *module, char *option)
+{
+ char *type;
+ XrmValue value;
+ char query[256];
+ unsigned char *ptr;
+
+ InitializeOptionsDatabase();
+
+ XmuSnprintf(query, sizeof(query), "%s.%s", module, option);
+ ptr = (unsigned char*)strchr(query, '.') + 1;
+ for (; *ptr; ptr++) {
+ if (*ptr == '_' || *ptr == ' ' || *ptr == '\t')
+ memmove(ptr, ptr + 1, strlen((char*)ptr) + 1);
+ }
+ for (ptr = (unsigned char*)query; *ptr; ptr++)
+ *ptr = tolower(*ptr);
+ if (XrmGetResource(options_xrm, query, "Module.Option", &type, &value))
+ return ((char*)value.addr);
+
+ return (NULL);
+}
diff --git a/hw/xfree86/utils/xorgcfg/options.h b/hw/xfree86/utils/xorgcfg/options.h
new file mode 100644
index 000000000..a90072607
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/options.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.h,v 1.7 2001/07/06 02:04:10 paulo Exp $
+ */
+
+#include "config.h"
+#ifdef USE_MODULES
+#include "loader.h"
+#endif
+
+/*
+ * Prototypes
+ */
+#ifdef USE_MODULES
+void OptionsPopup(XF86OptionPtr*, char*, OptionInfoPtr);
+void ModuleOptionsPopup(Widget, XtPointer, XtPointer);
+#else
+void OptionsPopup(XF86OptionPtr*);
+#endif
+void OptionsCancelAction(Widget, XEvent*, String*, Cardinal*);
+void ModuleOptionsCancelAction(Widget, XEvent*, String*, Cardinal*);
+char *GetOptionDescription(char *module, char *option);
+Bool InitializeOptionsDatabase(void);
+
+void CreateOptionsShell(void);
diff --git a/hw/xfree86/utils/xorgcfg/right.xbm b/hw/xfree86/utils/xorgcfg/right.xbm
new file mode 100644
index 000000000..a2f2ce2d1
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/right.xbm
@@ -0,0 +1,8 @@
+#define right_width 19
+#define right_height 19
+static unsigned char right_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x0e, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x3e, 0x00, 0xf8, 0x7f, 0x00,
+ 0xf8, 0xff, 0x00, 0xf8, 0xff, 0x01, 0xf8, 0xff, 0x00, 0xf8, 0x7f, 0x00,
+ 0x00, 0x3e, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/screen-cfg.c b/hw/xfree86/utils/xorgcfg/screen-cfg.c
new file mode 100644
index 000000000..5aa71188a
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/screen-cfg.c
@@ -0,0 +1,552 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.12 2002/11/18 05:24:18 paulo Exp $
+ */
+
+#include "xf86config.h"
+#include "screen-cfg.h"
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/Viewport.h>
+#ifdef USE_MODULES
+#include "loader.h"
+#endif
+
+#define CW 1
+#define CCW -1
+
+/*
+ * Prototypes
+ */
+static void DepthCallback(Widget, XtPointer, XtPointer);
+static void SelectIndexCallback(Widget, XtPointer, XtPointer);
+static void UnselectIndexCallback(Widget, XtPointer, XtPointer);
+static void SelectCallback(Widget, XtPointer, XtPointer);
+static void UnselectCallback(Widget, XtPointer, XtPointer);
+static void MoveCallback(Widget, XtPointer, XtPointer);
+static void RotateCallback(Widget, XtPointer, XtPointer);
+
+/*
+ * Initialization
+ */
+static char *standard_modes[] = {
+ "640x400",
+ "640x480",
+ "800x600",
+ "1024x768",
+ "1280x960",
+ "1280x1024",
+ "320x200",
+ "320x240",
+ "400x300",
+ "1152x864",
+ "1600x1200",
+ "1800x1400",
+ "512x384",
+ "1400x1050",
+};
+
+static char **modes;
+static int nmodes;
+static int default_depth, sel_index, unsel_index;
+static Widget listL, listR;
+static char **defmodes;
+static int ndefmodes;
+static XF86ConfScreenPtr screen;
+static int rotate;
+
+/*
+ * Implementation
+ */
+XtPointer
+ScreenConfig(XtPointer conf)
+{
+ XF86ConfDisplayPtr disp;
+ Arg args[2];
+ int i, oldrotate;
+
+ screen = (XF86ConfScreenPtr)conf;
+ if (screen == NULL)
+ return (NULL);
+
+ XtSetArg(args[0], XtNstring, screen->scrn_identifier);
+ XtSetValues(ident_widget, args, 1);
+ if ((default_depth = screen->scrn_defaultdepth) <= 0)
+ default_depth = 8;
+ sel_index = unsel_index = -1;
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == screen) {
+ SetScreenRotate(computer.screens[i]);
+ rotate = computer.screens[i]->rotate;
+ }
+ oldrotate = rotate;
+
+ ndefmodes = 0;
+ disp = screen->scrn_display_lst;
+ while (disp != NULL) {
+ if (disp->disp_depth == default_depth) {
+ XF86ModePtr mod = disp->disp_mode_lst;
+
+ while (mod != NULL) {
+ if (ndefmodes % 16 == 0)
+ defmodes = (char**)
+ XtRealloc((XtPointer)defmodes,
+ (ndefmodes + 16) * sizeof(char*));
+ defmodes[ndefmodes++] = XtNewString(mod->mode_name);
+ mod = (XF86ModePtr)(mod->list.next);
+ }
+ break;
+ }
+ disp = (XF86ConfDisplayPtr)(disp->list.next);
+ }
+ if (ndefmodes == 0) {
+ defmodes = (char**)XtMalloc(sizeof(char*));
+ defmodes[0] = XtNewString("640x480");
+ ndefmodes = 1;
+ }
+
+ if (listL != NULL) {
+ XawListUnhighlight(listL);
+ XawListUnhighlight(listR);
+ }
+
+ xf86info.cur_list = SCREEN;
+ XtSetSensitive(back, xf86info.lists[SCREEN].cur_function > 0);
+ XtSetSensitive(next, xf86info.lists[SCREEN].cur_function <
+ xf86info.lists[SCREEN].num_functions - 1);
+ (xf86info.lists[SCREEN].functions[xf86info.lists[SCREEN].cur_function])
+ (&xf86info);
+
+ if (ConfigLoop(NULL) == True) {
+ XF86ModePtr prev = NULL, mod;
+
+ /* user may have changed the default depth, read variables again */
+ disp = screen->scrn_display_lst;
+ while (disp != NULL) {
+ if (disp->disp_depth == default_depth)
+ break;
+ disp = (XF86ConfDisplayPtr)(disp->list.next);
+ }
+
+ if (disp == NULL) {
+ disp = (XF86ConfDisplayPtr)XtCalloc(1, sizeof(XF86ConfDisplayRec));
+ screen->scrn_display_lst = (XF86ConfDisplayPtr)
+ xf86addListItem((GenericListPtr)(screen->scrn_display_lst),
+ (GenericListPtr)(disp));
+ disp->disp_depth = default_depth;
+ }
+
+ if (strcasecmp(screen->scrn_identifier, ident_string))
+ xf86renameScreen(XF86Config, screen, ident_string);
+
+ screen->scrn_defaultdepth = default_depth;
+
+ XtSetArg(args[0], XtNlist, NULL);
+ XtSetArg(args[1], XtNnumberStrings, 0);
+ XtSetValues(listL, args, 2);
+
+ XtSetArg(args[0], XtNlist, NULL);
+ XtSetArg(args[1], XtNnumberStrings, 0);
+ XtSetValues(listR, args, 2);
+
+ mod = disp->disp_mode_lst;
+ /* free all modes */
+ while (mod != NULL) {
+ prev = mod;
+ mod = (XF86ModePtr)(mod->list.next);
+ XtFree(prev->mode_name);
+ XtFree((XtPointer)prev);
+ }
+ /* readd modes */
+ for (i = 0; i < ndefmodes; i++) {
+ mod = XtNew(XF86ModeRec);
+ mod->mode_name = XtNewString(defmodes[i]);
+ XtFree(defmodes[i]);
+ if (i == 0)
+ disp->disp_mode_lst = mod;
+ else
+ prev->list.next = mod;
+ prev = mod;
+ }
+ if (i == 0)
+ disp->disp_mode_lst = NULL;
+ else
+ mod->list.next = NULL;
+
+ XtFree((XtPointer)defmodes);
+ defmodes = NULL;
+ ndefmodes = 0;
+
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == screen)
+ computer.screens[i]->rotate = rotate;
+
+ if (oldrotate != rotate) {
+ static char *Rotate = "Rotate";
+
+ if (screen->scrn_option_lst != NULL)
+ xf86removeOption(&screen->scrn_option_lst, Rotate);
+ if (rotate)
+ screen->scrn_option_lst =
+ xf86addNewOption(screen->scrn_option_lst,
+ XtNewString(Rotate),
+ XtNewString(rotate > 0 ? "CW" : "CCW"));
+ UpdateScreenUI();
+ AdjustScreenUI();
+ }
+
+ return ((XtPointer)screen);
+ }
+
+ XtSetArg(args[0], XtNlist, NULL);
+ XtSetArg(args[1], XtNnumberStrings, 0);
+ XtSetValues(listL, args, 2);
+
+ XtSetArg(args[0], XtNlist, NULL);
+ XtSetArg(args[1], XtNnumberStrings, 0);
+ XtSetValues(listR, args, 2);
+
+ for (i = 0; i < ndefmodes; i++)
+ XtFree(defmodes[i]);
+ XtFree((XtPointer)defmodes);
+ defmodes = NULL;
+ ndefmodes = 0;
+
+ return (NULL);
+}
+
+/*ARGSUSED*/
+static void
+DepthCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ if (call_data != NULL)
+ default_depth = (long)user_data;
+}
+
+/*ARGSUSED*/
+static void
+SelectIndexCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+
+ sel_index = info->list_index;
+}
+
+/*ARGSUSED*/
+static void
+UnselectIndexCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ XawListReturnStruct *info = (XawListReturnStruct *)call_data;
+
+ unsel_index = info->list_index;
+}
+
+/*ARGSUSED*/
+static void
+SelectCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[2];
+
+ if (sel_index < 0 || sel_index >= nmodes)
+ return;
+
+ if (ndefmodes == 1 && *defmodes[0] == '\0') {
+ /* make sure tmp and defentries are not the same pointer */
+ char **tmp = defmodes;
+
+ XtFree(defmodes[0]);
+ defmodes = (char**)XtMalloc(sizeof(char*));
+ --ndefmodes;
+ XtFree((char*)tmp);
+ }
+ else
+ defmodes = (char**)XtRealloc((XtPointer)defmodes,
+ sizeof(char*) * (ndefmodes + 1));
+ defmodes[ndefmodes++] = XtNewString(modes[sel_index]);
+
+ XtSetArg(args[0], XtNlist, defmodes);
+ XtSetArg(args[1], XtNnumberStrings, ndefmodes);
+ XtSetValues(listR, args, 2);
+
+ XawListUnhighlight(listR);
+ if (ndefmodes > 1 || (ndefmodes == 1 && *defmodes[0] != '\0')) {
+ if (unsel_index >= ndefmodes)
+ unsel_index = ndefmodes - 1;
+ XawListHighlight(listR, unsel_index = ndefmodes - 1);
+ }
+ else
+ unsel_index = -1;
+
+ /* force realyout */
+ XtUnmanageChild(listR);
+ XtManageChild(listR);
+}
+
+/*ARGSUSED*/
+static void
+UnselectCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ Arg args[2];
+ char **modes;
+ Cardinal num_modes;
+
+ if (unsel_index < 0 || unsel_index >= ndefmodes)
+ return;
+
+ XawListUnhighlight(listL);
+ XtSetArg(args[0], XtNlist, &modes);
+ XtSetArg(args[1], XtNnumberStrings, &num_modes);
+ XtGetValues(listL, args, 2);
+ if (modes) {
+ for (sel_index = 0; sel_index < num_modes; sel_index++)
+ if (strcmp(defmodes[unsel_index], modes[sel_index]) == 0)
+ break;
+ if (sel_index < num_modes)
+ XawListHighlight(listL, sel_index);
+ else
+ sel_index = -1;
+ }
+
+ XtFree(defmodes[unsel_index]);
+ if (--ndefmodes > unsel_index)
+ memmove(&defmodes[unsel_index], &defmodes[unsel_index + 1],
+ (ndefmodes - unsel_index) * sizeof(char*));
+ if (ndefmodes == 0) {
+ char **tmp = defmodes;
+
+ defmodes = (char**)XtMalloc(sizeof(char*));
+ defmodes[0] = XtNewString("");
+ ndefmodes = 1;
+ XtFree((char*)tmp);
+ }
+
+ XtSetArg(args[0], XtNlist, defmodes);
+ XtSetArg(args[1], XtNnumberStrings, ndefmodes);
+ XtSetValues(listR, args, 2);
+
+ XawListUnhighlight(listR);
+ if (ndefmodes > 1 || (ndefmodes == 1 && *defmodes[0] != '\0')) {
+ if (unsel_index >= ndefmodes)
+ unsel_index = ndefmodes - 1;
+ XawListHighlight(listR, unsel_index);
+ }
+ else
+ unsel_index = -1;
+}
+
+/*ARGSUSED*/
+static void
+MoveCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ char *tmp;
+ Bool down = (long)user_data;
+
+ if (unsel_index < 0 || unsel_index >= ndefmodes)
+ return;
+
+ if ((down && unsel_index + 1 >= ndefmodes) ||
+ (!down && unsel_index - 1 < 0))
+ return;
+
+ tmp = defmodes[unsel_index];
+ if (down) {
+ defmodes[unsel_index] = defmodes[unsel_index + 1];
+ unsel_index++;
+ } else {
+ defmodes[unsel_index] = defmodes[unsel_index - 1];
+ unsel_index--;
+ }
+ defmodes[unsel_index] = tmp;
+
+ XawListUnhighlight(listR);
+ XawListHighlight(listR, unsel_index);
+}
+
+/*ARGSUSED*/
+void
+RotateCallback(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ if (call_data != NULL)
+ rotate = (long)user_data;
+ else
+ rotate = 0;
+}
+
+void
+ScreenDialog(XF86SetupInfo *info)
+{
+ static Widget dialog, d1, d4, d8, d16, d24, labelRotate, cw, ccw;
+ Arg args[2];
+ XF86ConfMonitorPtr mon = screen->scrn_monitor;
+ XF86ConfModeLinePtr mline = mon != NULL ? mon->mon_modeline_lst : NULL;
+ int i;
+#ifdef USE_MODULES
+ xf86cfgModuleOptions *drv_opts = module_options;
+ Bool foundRotate = False;
+#endif
+
+ while (nmodes > 0)
+ XtFree(modes[--nmodes]);
+ XtFree((XtPointer)modes);
+ modes = NULL;
+ while (mline) {
+ if (nmodes % 16 == 0)
+ modes = (char**)XtRealloc((XtPointer)modes,
+ sizeof(char*) * (nmodes + 16));
+ modes[nmodes++] = XtNewString(mline->ml_identifier);
+ mline = (XF86ConfModeLinePtr)(mline->list.next);
+ }
+ for (i = 0; i < sizeof(standard_modes) / sizeof(standard_modes[0]); i++) {
+ if (nmodes % 16 == 0)
+ modes = (char**)XtRealloc((XtPointer)modes,
+ sizeof(char*) * (nmodes + 16));
+ modes[nmodes++] = XtNewString(standard_modes[i]);
+ }
+
+ if (dialog == NULL) {
+ Widget command, viewport;
+
+ dialog = XtCreateWidget("screenD", formWidgetClass,
+ configp, NULL, 0);
+ XtCreateManagedWidget("depthL", labelWidgetClass,
+ dialog, NULL, 0);
+ d1 = XtCreateManagedWidget("1", toggleWidgetClass, dialog, NULL, 0);
+ XtAddCallback(d1, XtNcallback, DepthCallback, (XtPointer)1);
+ d4 = XtVaCreateManagedWidget("4", toggleWidgetClass, dialog,
+ XtNradioGroup, d1, NULL, 0);
+ XtAddCallback(d4, XtNcallback, DepthCallback, (XtPointer)4);
+ d8 = XtVaCreateManagedWidget("8", toggleWidgetClass, dialog,
+ XtNradioGroup, d4, NULL, 0);
+ XtAddCallback(d8, XtNcallback, DepthCallback, (XtPointer)8);
+ d16 = XtVaCreateManagedWidget("16", toggleWidgetClass, dialog,
+ XtNradioGroup, d8, NULL, 0);
+ XtAddCallback(d16, XtNcallback, DepthCallback, (XtPointer)16);
+ d24 = XtVaCreateManagedWidget("24", toggleWidgetClass, dialog,
+ XtNradioGroup, d16, NULL, 0);
+ XtAddCallback(d24, XtNcallback, DepthCallback, (XtPointer)24);
+
+ XtCreateManagedWidget("modeL", labelWidgetClass, dialog, NULL, 0);
+ viewport = XtCreateManagedWidget("viewL", viewportWidgetClass, dialog,
+ NULL, 0);
+ listL = XtCreateManagedWidget("listLeft", listWidgetClass, viewport,
+ NULL, 0);
+ XtAddCallback(listL, XtNcallback, SelectIndexCallback, NULL);
+ command = XtCreateManagedWidget("select", commandWidgetClass,
+ dialog, NULL, 0);
+ XtAddCallback(command, XtNcallback, SelectCallback, NULL);
+ command = XtCreateManagedWidget("unselect", commandWidgetClass,
+ dialog, NULL, 0);
+ XtAddCallback(command, XtNcallback, UnselectCallback, NULL);
+ command = XtCreateManagedWidget("up", commandWidgetClass,
+ dialog, NULL, 0);
+ XtAddCallback(command, XtNcallback, MoveCallback, (XtPointer)False);
+ command = XtCreateManagedWidget("down", commandWidgetClass,
+ dialog, NULL, 0);
+ XtAddCallback(command, XtNcallback, MoveCallback, (XtPointer)True);
+ viewport = XtCreateManagedWidget("viewR", viewportWidgetClass, dialog,
+ NULL, 0);
+ listR = XtCreateManagedWidget("listRight", listWidgetClass, viewport,
+ NULL, 0);
+ XtAddCallback(listR, XtNcallback, UnselectIndexCallback, NULL);
+
+ labelRotate = XtCreateManagedWidget("rotate", labelWidgetClass,
+ dialog, NULL, 0);
+ cw = XtCreateManagedWidget("CW", toggleWidgetClass, dialog, NULL, 0);
+ XtAddCallback(cw, XtNcallback, RotateCallback, (XtPointer)CW);
+ ccw = XtVaCreateManagedWidget("CCW", toggleWidgetClass, dialog,
+ XtNradioGroup, cw, NULL, 0);
+ XtAddCallback(ccw, XtNcallback, RotateCallback, (XtPointer)CCW);
+
+ XtRealizeWidget(dialog);
+ }
+
+#ifdef USE_MODULES
+ if (!nomodules) {
+ while (drv_opts) {
+ if (drv_opts->type == VideoModule &&
+ strcmp(drv_opts->name, screen->scrn_device->dev_driver) == 0) {
+ OptionInfoPtr opts = drv_opts->option;
+
+ while (opts->name) {
+ if (xf86nameCompare(opts->name, "Rotate") == 0) {
+ foundRotate = True;
+ break;
+ }
+ opts++;
+ }
+ break;
+ }
+ drv_opts = drv_opts->next;
+ }
+
+ if (!foundRotate) {
+ XtUnmapWidget(labelRotate);
+ XtUnmapWidget(cw);
+ XtUnmapWidget(ccw);
+ }
+ else {
+ XtMapWidget(labelRotate);
+ XtMapWidget(cw);
+ XtMapWidget(ccw);
+ }
+ }
+#endif
+ if (rotate == CW) {
+ XtVaSetValues(cw, XtNstate, True, NULL, 0);
+ XtVaSetValues(ccw, XtNstate, False, NULL, 0);
+ }
+ else if (rotate == CCW) {
+ XtVaSetValues(cw, XtNstate, False, NULL, 0);
+ XtVaSetValues(ccw, XtNstate, True, NULL, 0);
+ }
+ else {
+ XtVaSetValues(cw, XtNstate, False, NULL, 0);
+ XtVaSetValues(ccw, XtNstate, False, NULL, 0);
+ }
+
+ XtSetArg(args[0], XtNlist, modes);
+ XtSetArg(args[1], XtNnumberStrings, nmodes);
+ XtSetValues(listL, args, 2);
+
+ XtSetArg(args[0], XtNlist, defmodes);
+ XtSetArg(args[1], XtNnumberStrings, ndefmodes);
+ XtSetValues(listR, args, 2);
+
+ XtSetArg(args[0], XtNstate, True);
+ XtSetValues(default_depth == 1 ? d1 :
+ default_depth == 4 ? d4 :
+ default_depth == 16 ? d16 :
+ default_depth == 24 ? d24 : d8, args, 1);
+
+ XtChangeManagedSet(&current, 1, NULL, NULL, &dialog, 1);
+ current = dialog;
+}
diff --git a/hw/xfree86/utils/xorgcfg/screen-cfg.h b/hw/xfree86/utils/xorgcfg/screen-cfg.h
new file mode 100644
index 000000000..a152f6188
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/screen-cfg.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.h,v 1.2 2000/05/18 16:29:59 dawes Exp $
+ */
+
+#include "config.h"
+#include "screen.h"
+
+#ifndef _xf86cfg_screencfg_h
+#define _xf86cfg_screencfg_h
+
+/*
+ * Prototypes
+ */
+XtPointer ScreenConfig(XtPointer);
+void ScreenDialog(XF86SetupInfo*);
+
+#endif /* _xf86cfg_screencfg_h */
diff --git a/hw/xfree86/utils/xorgcfg/screen.c b/hw/xfree86/utils/xorgcfg/screen.c
new file mode 100644
index 000000000..25fd5f290
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/screen.c
@@ -0,0 +1,984 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen.c,v 1.9 2002/06/06 21:03:32 paulo Exp $
+ */
+
+#include <X11/IntrinsicP.h>
+#include <X11/extensions/shape.h>
+#include <X11/Xaw/Simple.h>
+#include "screen.h"
+
+#define CW 1
+#define CCW -1
+
+/*
+ * Prototypes
+ */
+void ReshapeScreenWidget(xf86cfgScreen*);
+static int qcmp_screen(_Xconst void*, _Xconst void*);
+
+/*
+ * Initialization
+ */
+extern Widget work;
+
+static int rows, columns; /* number of rows/columns of monitors */
+
+static int mon_width, mon_height;
+static int *mon_widths, *mon_heights;
+
+/*
+ * Implementation
+ */
+void
+SetScreenRotate(xf86cfgScreen *screen)
+{
+ static char *Rotate = "Rotate", *_CW = "CW", *_CCW = "CCW";
+ int rotate = 0;
+ XF86OptionPtr option, options;
+
+ /* This is the only place where xf86cfg is intrusive, and deletes options
+ * added by the user directly in the config file. The "Rotate" option
+ * will be kept in the screen section.
+ */
+ if (screen->monitor != NULL) {
+ options = ((XF86ConfMonitorPtr)(screen->monitor->config))->mon_option_lst;
+ if ((option = xf86findOption(options, Rotate)) != NULL) {
+ if (option->opt_val != NULL)
+ rotate = strcasecmp(option->opt_val, _CW) == 0 ? CW :
+ strcasecmp(option->opt_val, _CCW) == 0 ? CCW : 0;
+ xf86removeOption(&((XF86ConfMonitorPtr)(screen->monitor->config))
+ ->mon_option_lst, Rotate);
+ }
+ }
+ if (screen->card != NULL) {
+ options = ((XF86ConfDevicePtr)(screen->card->config))->dev_option_lst;
+ if ((option = xf86findOption(options, Rotate)) != NULL) {
+ if (option->opt_val != NULL)
+ rotate += strcasecmp(option->opt_val, _CW) == 0 ? CW :
+ strcasecmp(option->opt_val, _CCW) == 0 ? CCW : 0;
+ xf86removeOption(&((XF86ConfDevicePtr)(screen->card->config))
+ ->dev_option_lst, Rotate);
+ }
+ }
+
+ options = screen->screen->scrn_option_lst;
+ if ((option = xf86findOption(options, Rotate)) != NULL) {
+ if (option->opt_val != NULL)
+ rotate += strcasecmp(option->opt_val, _CW) == 0 ? CW :
+ strcasecmp(option->opt_val, _CCW) == 0 ? CCW : 0;
+ xf86removeOption(&screen->screen->scrn_option_lst, Rotate);
+ }
+
+ rotate = rotate > 0 ? CW : rotate < 0 ? CCW : 0;
+ if (rotate)
+ screen->screen->scrn_option_lst =
+ xf86addNewOption(screen->screen->scrn_option_lst,
+ XtNewString(Rotate),
+ XtNewString(rotate > 0 ? _CW : _CCW));
+ screen->rotate = rotate;
+}
+
+void
+CreateScreenWidget(xf86cfgScreen *screen)
+{
+ Widget w = XtCreateWidget("screen", simpleWidgetClass,
+ XtParent(computer.cpu), NULL, 0);
+
+ SetScreenRotate(screen);
+ XtRealizeWidget(w);
+ screen->widget = w;
+ screen->column = screen->row = -1;
+
+ ReshapeScreenWidget(screen);
+}
+
+void
+ReshapeScreenWidget(xf86cfgScreen *screen)
+{
+ Pixmap pixmap;
+ XGCValues values;
+ GC gc;
+ int x = 0, y = 0, width = screen->rect.width, height = screen->rect.height;
+ Widget w = screen->widget;
+
+ if (screen->state == USED && screen->row >= 0) {
+ if (screen->column == 0)
+ x = w->core.width - width;
+ else if (screen->column == columns - 1)
+ x = w->core.width - mon_widths[screen->column];
+ else
+ x = (w->core.width - mon_widths[screen->column]) +
+ ((mon_widths[screen->column] - width) >> 1);
+
+ if (screen->row == 0)
+ y = w->core.height - height;
+ else if (screen->row == rows - 1)
+ y = w->core.height - mon_heights[screen->row];
+ else
+ y = (w->core.height - mon_heights[screen->row]) +
+ ((mon_heights[screen->row] - height) >> 1);
+ }
+ else if (screen->rect.width == 0) {
+ width = w->core.width;
+ height = w->core.height;
+ }
+
+ screen->rect.x = x;
+ screen->rect.y = y;
+ screen->rect.width = width;
+ screen->rect.height = height;
+ pixmap = XCreatePixmap(XtDisplay(w), XtWindow(w),
+ w->core.width, w->core.height, 1);
+ values.foreground = 0;
+ values.background = 1;
+ gc = XCreateGC(XtDisplay(w), pixmap, GCForeground | GCBackground, &values);
+ XFillRectangle(XtDisplay(w), pixmap, gc, 0, 0, w->core.width, w->core.height);
+ XSetForeground(XtDisplay(w), gc, 1);
+
+ DrawScreenMask(XtDisplay(w), pixmap, gc, x, y, x + width, y + height,
+ screen->rotate);
+ XShapeCombineMask(XtDisplay(w), XtWindow(w), ShapeBounding,
+ 0, 0, pixmap, ShapeSet);
+
+ /* Do not call XtSetValues, to avoid all extra code for caching pixmaps */
+ XFreePixmap(XtDisplay(w), pixmap);
+ if (XtIsRealized(w)) {
+ pixmap = XCreatePixmap(XtDisplay(w), XtWindow(w),
+ w->core.width, w->core.height,
+ DefaultDepthOfScreen(XtScreen(w)));
+ DrawScreen(XtDisplay(w), pixmap, x, y, x + width, y + height,
+ screen->state == USED ? True : False, screen->rotate);
+ XSetWindowBackgroundPixmap(XtDisplay(w), XtWindow(w), pixmap);
+ XClearWindow(XtDisplay(w), XtWindow(w));
+ XFreePixmap(XtDisplay(w), pixmap);
+ }
+ XFreeGC(XtDisplay(w), gc);
+}
+
+void
+AddScreen(xf86cfgDevice *mon, xf86cfgDevice *dev)
+{
+ int nscreens = 0;
+ char screen_name[48];
+ XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
+ XF86ConfAdjacencyPtr adj;
+
+ while (screen != NULL) {
+ ++nscreens;
+ screen = (XF86ConfScreenPtr)(screen->list.next);
+ }
+ do {
+ XmuSnprintf(screen_name, sizeof(screen_name), "Screen%d",
+ nscreens);
+ ++nscreens;
+ } while (xf86findScreen(screen_name,
+ XF86Config->conf_screen_lst) != NULL);
+
+ screen = (XF86ConfScreenPtr)XtCalloc(1, sizeof(XF86ConfScreenRec));
+ screen->scrn_identifier = XtNewString(screen_name);
+ screen->scrn_device_str = XtNewString(((XF86ConfDevicePtr)(dev->config))->dev_identifier);
+ screen->scrn_device = (XF86ConfDevicePtr)(dev->config);
+ screen->scrn_monitor_str = XtNewString(((XF86ConfMonitorPtr)(mon->config))->mon_identifier);
+ screen->scrn_monitor = (XF86ConfMonitorPtr)(mon->config);
+ XF86Config->conf_screen_lst =
+ xf86addScreen(XF86Config->conf_screen_lst, screen);
+
+ adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
+ adj->adj_screen = screen;
+ adj->adj_screen_str = XtNewString(screen_name);
+ if (computer.layout == NULL)
+ computer.layout = XF86Config->conf_layout_lst = (XF86ConfLayoutPtr)
+ XtCalloc(1, sizeof(XF86ConfLayoutRec));
+ computer.layout->lay_adjacency_lst = (XF86ConfAdjacencyPtr)
+ xf86addListItem((GenericListPtr)computer.layout->lay_adjacency_lst,
+ (GenericListPtr)adj);
+
+ computer.screens = (xf86cfgScreen**)
+ XtRealloc((XtPointer)computer.screens, sizeof(xf86cfgScreen*) *
+ (computer.num_screens + 1));
+ computer.screens[computer.num_screens] =
+ (xf86cfgScreen*)XtCalloc(1, sizeof(xf86cfgScreen));
+ computer.screens[computer.num_screens]->screen = screen;
+ computer.screens[computer.num_screens]->card = dev;
+ computer.screens[computer.num_screens]->monitor = mon;
+
+ ++dev->refcount;
+ ++mon->refcount;
+
+ CreateScreenWidget(computer.screens[computer.num_screens]);
+ computer.screens[computer.num_screens]->type = SCREEN;
+ SetTip((xf86cfgDevice*)computer.screens[computer.num_screens]);
+
+ ++computer.num_screens;
+}
+
+void
+RemoveScreen(xf86cfgDevice *mon, xf86cfgDevice *dev)
+{
+ XF86ConfScreenPtr screen = XF86Config->conf_screen_lst;
+ int i;
+
+ mon->state = dev->state = UNUSED;
+ while (screen != NULL) {
+ if ((XtPointer)screen->scrn_monitor == mon->config &&
+ (XtPointer)screen->scrn_device == dev->config)
+ break;
+
+ screen = (XF86ConfScreenPtr)(screen->list.next);
+ }
+ --mon->refcount;
+ --dev->refcount;
+
+ for (i = 0; i < computer.num_screens; i++) {
+ if (computer.screens[i]->screen == screen) {
+ XtDestroyWidget(computer.screens[i]->widget);
+ if (i < --computer.num_screens)
+ memmove(&computer.screens[i], &computer.screens[i + 1],
+ (computer.num_screens - i) * sizeof(xf86cfgScreen*));
+ break;
+ }
+ }
+
+ xf86removeScreen(XF86Config, screen);
+}
+
+void
+ChangeScreen(XF86ConfMonitorPtr mon, XF86ConfMonitorPtr oldmon,
+ XF86ConfDevicePtr dev, XF86ConfDevicePtr olddev)
+{
+ int ioldm, im, ioldc, ic;
+
+ if (mon == oldmon && dev == olddev)
+ return;
+
+ if (mon != NULL) {
+ for (im = 0; im < computer.num_devices; im++)
+ if (computer.devices[im]->config == (XtPointer)mon)
+ break;
+ }
+ else
+ im = -1;
+ if (oldmon != NULL) {
+ for (ioldm = 0; ioldm < computer.num_devices; ioldm++)
+ if (computer.devices[ioldm]->config == (XtPointer)oldmon)
+ break;
+ }
+ else
+ ioldm = -1;
+
+ if (dev != NULL) {
+ for (ic = 0; ic < computer.num_devices; ic++)
+ if (computer.devices[ic]->config == (XtPointer)dev)
+ break;
+ }
+ else
+ ic = -1;
+ if (olddev != NULL) {
+ for (ioldc = 0; ioldc < computer.num_devices; ioldc++)
+ if (computer.devices[ioldc]->config == (XtPointer)olddev)
+ break;
+ }
+ else
+ ioldc = -1;
+
+ if (ioldm >= 0 && ioldc >= 0) {
+ RemoveScreen(computer.devices[ioldm], computer.devices[ioldc]);
+ computer.devices[ioldm]->state = UNUSED;
+/* computer.devices[ioldc]->state = UNUSED;*/
+ }
+
+ if (im >= 0 && ic >= 0) {
+ AddScreen(computer.devices[im], computer.devices[ic]);
+ computer.devices[im]->state = USED;
+/* computer.devices[ic]->state = USED;*/
+ }
+}
+
+/*
+
++------------------------------------------------+
+| |
+| +------------------------------------------+ |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| | | |
+| +------------------------------------------+ |
+| |
++------------------------------------------------+
+ | |
+ +-------+ +-------+
+ | |
+ +----------------------------------------+
+
+ */
+static double oxs = 0.0, oys = 0.0, oxe = 100.0, oye = 70.0;
+static double ixs = 7.0, iys = 7.0, ixe = 93.0, iye = 63.0;
+static double lin[] = { 25.0, 70.0, 25.0, 75.0, 5.0, 75.0, 5.0, 80.0,
+ 95.0, 80.0, 95.0, 75.0, 75.0, 75.0, 75.0, 70.0 };
+
+void
+DrawScreen(Display *dpy, Drawable win, int xs, int ys, int xe, int ye,
+ Bool active, int rotate)
+{
+ double xfact, yfact;
+ XPoint points[(sizeof(lin) / sizeof(lin[0])) >> 1];
+ int i;
+ static GC gray0, gray1, gray2, black, red;
+
+ if (black == NULL) {
+ XColor color, exact;
+ XGCValues values;
+
+ XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray95",
+ &color, &exact);
+ values.foreground = color.pixel;
+ gray0 = XCreateGC(XtDisplay(toplevel), win, GCForeground, &values);
+ XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray75",
+ &color, &exact);
+ values.foreground = color.pixel;
+ gray1 = XCreateGC(XtDisplay(toplevel), win, GCForeground, &values);
+
+ XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray60",
+ &color, &exact);
+ values.foreground = color.pixel;
+ gray2 = XCreateGC(XtDisplay(toplevel), win, GCForeground, &values);
+
+ XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "gray20",
+ &color, &exact);
+ values.foreground = color.pixel;
+ black = XCreateGC(XtDisplay(toplevel), win, GCForeground, &values);
+
+ XAllocNamedColor(XtDisplay(toplevel), toplevel->core.colormap, "red",
+ &color, &exact);
+ values.foreground = color.pixel;
+ values.line_width = 4;
+ values.cap_style = CapButt;
+ red = XCreateGC(XtDisplay(toplevel), win,
+ GCForeground | GCLineWidth | GCCapStyle, &values);
+ }
+
+ if (rotate) {
+ xfact = (xe - xs) / 80.0;
+ yfact = (ye - ys) / 100.0;
+ if (rotate == CW) {
+ /* outer rectangle */
+ XFillRectangle(dpy, win, gray1,
+ oxs * xfact + xs + .5,
+ oys * yfact + ys + .5,
+ (oye - oys) * xfact + .5,
+ (oxe - oxs) * yfact + .5);
+ XDrawLine(dpy, win, gray2,
+ xs, ye - 1,
+ 70 * xfact + xs - 1 + .5, ye - 1);
+ XDrawLine(dpy, win, gray2,
+ 70 * xfact + xs - 1 + .5, ye - 1,
+ 70 * xfact + xs - 1 + .5, ys);
+ /* inner rectangle */
+ XFillRectangle(dpy, win, black,
+ ixs * xfact + xs + .5,
+ iys * yfact + ys + .5,
+ (iye - iys) * xfact + .5,
+ (ixe - ixs) * yfact + .5);
+ for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
+ points[i].x = lin[(i<<1) + 1] * xfact + xs + .5;
+ points[i].y = lin[(i<<1)] * yfact + ys + .5;
+ }
+ XFillPolygon(dpy, win, gray2, points, i, Convex, CoordModeOrigin);
+ XDrawLine(dpy, win, gray0,
+ (oxe - 10) * xfact + xs + .5, oys * yfact + ys + .5,
+ xs, oys * yfact + ys + .5);
+ XDrawLine(dpy, win, gray0,
+ xs, ys,
+ xs, xe);
+ XDrawLine(dpy, win, black,
+ lin[7] * xfact + xs - 1 + .5, lin[6] * yfact + ys + .5,
+ lin[9] * xfact + xs - 1 + .5, lin[8] * yfact + ys - 1 + .5);
+ XDrawLine(dpy, win, black,
+ lin[9] * xfact + xs - 1 + .5, lin[8] * yfact + ys - 1 + .5,
+ lin[11] * xfact + xs + .5, lin[10] * yfact + ys - 1 + .5);
+ XDrawLine(dpy, win, black,
+ lin[13] * xfact + xs + .5, lin[12] * yfact + ys - 1 + .5,
+ lin[15] * xfact + xs + .5, lin[14] * yfact + ys - 1 + .5);
+
+ if (!active) {
+ XDrawLine(dpy, win, red,
+ iys * xfact, ixs * yfact, iye * xfact, ixe * yfact);
+ XDrawLine(dpy, win, red,
+ iye * xfact, ixs * yfact, iys * xfact, ixe * yfact);
+ }
+ }
+ else if (rotate == CCW) {
+ /* outer rectangle */
+ XFillRectangle(dpy, win, gray1,
+ 10 * xfact + xs + .5,
+ oys * yfact + ys + .5,
+ (oye - oys) * xfact + .5,
+ (oxe - oxs) * yfact + .5);
+
+ XDrawLine(dpy, win, gray2,
+ 10 * xfact + xs + .5, ye - 1,
+ oxe * xfact + xs - 1 + .5, ye - 1);
+ XDrawLine(dpy, win, gray2,
+ xe - 1, ye - 1,
+ xe - 1, ys);
+ /* inner rectangle */
+ XFillRectangle(dpy, win, black,
+ (ixs + 10) * xfact + xs + .5,
+ iys * yfact + ys + .5,
+ (iye - iys) * xfact + .5,
+ (ixe - ixs) * yfact + .5);
+ for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
+ points[i].x = (-lin[(i<<1) + 1] + 80.0) * xfact + xs + .5;
+ points[i].y = lin[(i<<1)] * yfact + ys + .5;
+ }
+ XFillPolygon(dpy, win, gray2, points, i, Convex, CoordModeOrigin);
+ XDrawLine(dpy, win, gray0,
+ oxe * xfact + xs + .5, oys * yfact + ys + .5,
+ (oxs - 10) * xfact + xs + .5, oys * yfact + ys + .5);
+ XDrawLine(dpy, win, gray0,
+ (oxs + 10) * xfact + xs + .5, ys,
+ (oxs + 10) * xfact + xs + .5, xe);
+
+ XDrawLine(dpy, win, black,
+ xs, lin[8] * yfact - 1 + ys + .5,
+ 4 * xfact + xs + .5, lin[8] * yfact - 1 + ys + .5);
+ XDrawLine(dpy, win, black,
+ 4 * xfact + xs, lin[8] * yfact - 1 + ys + .5,
+ 4 * xfact + xs, lin[3] * yfact - 1 + ys + .5);
+ XDrawLine(dpy, win, black,
+ 4 * xfact + xs + .5, lin[3] * yfact - 1 + ys + .5,
+ 10 * xfact + xs + .5 - 1, lin[3] * yfact - 1 + ys + .5);
+ XDrawLine(dpy, win, black,
+ 4 * xfact + xs, lin[0] * yfact - 1 + ys + .5,
+ 4 * xfact + xs, lin[4] * yfact - 1 + ys + .5);
+
+ if (!active) {
+ XDrawLine(dpy, win, red,
+ (iys + 10) * xfact, ixs * yfact,
+ (iye + 10) * xfact, ixe * yfact);
+ XDrawLine(dpy, win, red,
+ (iye + 10) * xfact, ixs * yfact,
+ (iys + 10) * xfact, ixe * yfact);
+ }
+ }
+ }
+ else {
+ xfact = (xe - xs) / 100.0;
+ yfact = (ye - ys) / 80.0;
+
+ /* outer rectangle */
+ XFillRectangle(dpy, win, gray1,
+ oxs * xfact + xs + .5,
+ oys * yfact + ys + .5,
+ (oxe - oxs) * xfact + .5,
+ (oye - oys) * yfact + .5);
+
+ XDrawLine(dpy, win, gray2,
+ oxs * xfact + xs + .5, oye * yfact + ys - 1 + .5,
+ oxe * xfact + xs - 1 + .5, oye * yfact + ys - 1 + .5);
+ XDrawLine(dpy, win, gray2,
+ oxe * xfact + xs - 1 + .5, oys * yfact + ys + .5,
+ oxe * xfact + xs - 1 + .5, oye * yfact + ys - 1 + .5);
+
+ /* inner rectangle */
+ XFillRectangle(dpy, win, black,
+ ixs * xfact + xs + .5,
+ iys * yfact + ys + .5,
+ (ixe - ixs) * xfact + .5,
+ (iye - iys) * yfact + .5);
+
+ for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
+ points[i].x = lin[i<<1] * xfact + xs + .5;
+ points[i].y = lin[(i<<1) + 1] * yfact + ys + .5;
+ }
+
+ XFillPolygon(dpy, win, gray2, points, i, Convex, CoordModeOrigin);
+
+ XDrawLine(dpy, win, black,
+ lin[6] * xfact + xs + .5, lin[7] * yfact + ys - 1 + .5,
+ lin[8] * xfact + xs - 1 + .5, lin[9] * yfact + ys - 1 + .5);
+ XDrawLine(dpy, win, black,
+ lin[8] * xfact + xs - 1 + .5, lin[9] * yfact + ys - 1 + .5,
+ lin[10] * xfact + xs - 1 + .5, lin[11] * yfact + ys + .5);
+ XDrawLine(dpy, win, black,
+ lin[12] * xfact + xs - 1 + .5, lin[13] * yfact + ys + .5,
+ lin[14] * xfact + xs - 1 + .5, lin[15] * yfact + ys + .5);
+
+ XDrawLine(dpy, win, gray0,
+ oxe * xfact + xs + .5, oys * yfact + ys + .5,
+ oxs * xfact + xs + .5, oys * yfact + ys + .5);
+ XDrawLine(dpy, win, gray0,
+ oxs * xfact + xs + .5, oys * yfact + ys + .5,
+ oxs * xfact + xs + .5, lin[1] * yfact + ys + .5);
+
+ if (!active) {
+ XDrawLine(dpy, win, red,
+ ixs * xfact, iys * yfact, ixe * xfact, iye * yfact);
+ XDrawLine(dpy, win, red,
+ ixe * xfact, iys * yfact, ixs * xfact, iye * yfact);
+ }
+ }
+}
+
+void
+DrawScreenMask(Display *dpy, Drawable win, GC gc, int xs, int ys, int xe, int ye,
+ int rotate)
+{
+ double xfact, yfact;
+ XPoint points[(sizeof(lin) / sizeof(lin[0])) >> 1];
+ int i = 0, x = 0, y = 0, width, height;
+
+ if (rotate) {
+ xfact = (xe - xs) / 80.0;
+ yfact = (ye - ys) / 100.0;
+ width = (oye - oys) * xfact + .5;
+ height = (oxe - oxs) * yfact + .5;
+ if (rotate == CW) {
+ x = oxs * xfact + xs + .5;
+ y = oys * yfact + ys + .5;
+ for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
+ points[i].x = lin[(i<<1) + 1] * xfact + xs + .5;
+ points[i].y = lin[(i<<1)] * yfact + ys + .5;
+ }
+ }
+ else if (rotate == CCW) {
+ x = 10 * xfact + xs + .5;
+ y = oys * yfact + ys + .5;
+ for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
+ points[i].x = (-lin[(i<<1) + 1] + 80.0) * xfact + xs + .5;
+ points[i].y = lin[(i<<1)] * yfact + ys + .5;
+ }
+ }
+ }
+ else {
+ xfact = (xe - xs) / 100.0;
+ yfact = (ye - ys) / 80.0;
+ x = oxs * xfact + xs + .5;
+ y = oys * yfact + ys + .5;
+ width = (oxe - oxs) * xfact + .5;
+ height = (oye - oys) * yfact + .5;
+ for (i = 0; i < sizeof(points) / sizeof(points[0]); i++) {
+ points[i].x = lin[(i<<1)] * xfact + xs + .5;
+ points[i].y = lin[(i<<1) + 1] * yfact + ys + .5;
+ }
+ }
+
+ /* rectangle */
+ XFillRectangle(dpy, win, gc, x, y, width, height);
+
+
+ XFillPolygon(dpy, win, gc, points, i, Convex, CoordModeOrigin);
+}
+
+void
+AdjustScreenUI(void)
+{
+ XF86ConfLayoutPtr lay = computer.layout;
+ XF86ConfAdjacencyPtr adj;
+ int i, dx, dy, x, y, w, h, base = -1;
+ double xf, yf;
+
+ if (lay == NULL)
+ return;
+
+ adj = lay->lay_adjacency_lst;
+
+#define USED1 -USED
+
+ XtFree((XtPointer)mon_widths);
+ XtFree((XtPointer)mon_heights);
+ mon_widths = (int*)XtCalloc(1, sizeof(int) * columns);
+ mon_heights = (int*)XtCalloc(1, sizeof(int) * rows);
+
+ mon_width = mon_height = 0;
+ for (i = 0; i < computer.num_screens; i++) {
+ if (base == -1 && computer.screens[i]->state == USED)
+ base = i;
+ if (computer.screens[i]->screen->scrn_monitor->mon_width > mon_width)
+ mon_width = computer.screens[i]->screen->scrn_monitor->mon_width;
+ if (computer.screens[i]->screen->scrn_monitor->mon_height > mon_height)
+ mon_height = computer.screens[i]->screen->scrn_monitor->mon_height;
+ }
+ if (base < 0) {
+ for (i = 0; i < computer.num_screens; i++)
+ ReshapeScreenWidget(computer.screens[i]);
+ return;
+ }
+
+ if (mon_width == 0) {
+ mon_width = 10;
+ mon_height = 8;
+ }
+
+ XtUnmapWidget(work);
+
+ while (adj) {
+ xf86cfgScreen *scr = NULL,
+ *topscr = NULL, *botscr = NULL, *lefscr = NULL, *rigscr = NULL;
+
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == adj->adj_screen)
+ break;
+ if (i < computer.num_screens)
+ scr = computer.screens[i];
+
+ if (adj->adj_top != NULL) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == adj->adj_top)
+ break;
+ if (i < computer.num_screens)
+ topscr = computer.screens[i];
+ }
+
+ if (adj->adj_bottom != NULL) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == adj->adj_bottom)
+ break;
+ if (i < computer.num_screens)
+ botscr = computer.screens[i];
+ }
+
+ if (adj->adj_left != NULL) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == adj->adj_left)
+ break;
+ if (i < computer.num_screens)
+ lefscr = computer.screens[i];
+ }
+
+ if (adj->adj_right != NULL) {
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == adj->adj_right)
+ break;
+ if (i < computer.num_screens)
+ rigscr = computer.screens[i];
+ }
+
+ if (lefscr == NULL && rigscr == NULL && topscr == NULL && lefscr == NULL) {
+ XF86ConfScreenPtr s;
+
+ if (adj->adj_where >= CONF_ADJ_RIGHTOF < adj->adj_where <= CONF_ADJ_BELOW) {
+ s = xf86findScreen(adj->adj_refscreen, XF86Config->conf_screen_lst);
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->screen == s)
+ break;
+ if (i < computer.num_screens) {
+ switch (adj->adj_where) {
+ case CONF_ADJ_RIGHTOF:
+ lefscr = computer.screens[i];
+ break;
+ case CONF_ADJ_LEFTOF:
+ rigscr = computer.screens[i];
+ break;
+ case CONF_ADJ_ABOVE:
+ botscr = computer.screens[i];
+ break;
+ case CONF_ADJ_BELOW:
+ topscr = computer.screens[i];
+ break;
+ }
+ }
+ }
+ }
+
+ XtMoveWidget(scr->widget, 0, 0);
+ scr->state = USED1;
+ if (lefscr != NULL) {
+ if (lefscr->state == USED1)
+ XtMoveWidget(scr->widget,
+ lefscr->widget->core.x + lefscr->widget->core.width,
+ lefscr->widget->core.y);
+ else
+ XtMoveWidget(lefscr->widget,
+ -(int)(lefscr->widget->core.width),
+ scr->widget->core.y);
+ }
+
+ if (rigscr != NULL) {
+ if (rigscr->state == USED1) {
+ dx = rigscr->widget->core.x - scr->widget->core.width - scr->widget->core.x;
+ dy = rigscr->widget->core.y - scr->widget->core.y;
+
+ XtMoveWidget(scr->widget, scr->widget->core.x + dx,
+ scr->widget->core.y + dy);
+ if (lefscr != NULL && lefscr->state != USED1)
+ XtMoveWidget(lefscr->widget, lefscr->widget->core.x + dx,
+ lefscr->widget->core.y + dy);
+ }
+ else
+ XtMoveWidget(rigscr->widget, scr->widget->core.width,
+ scr->widget->core.y);
+ }
+
+ if (topscr != NULL) {
+ if (topscr->state == USED1) {
+ dx = topscr->widget->core.x - scr->widget->core.x;
+ dy = topscr->widget->core.y + topscr->widget->core.height -
+ scr->widget->core.y;
+
+ XtMoveWidget(scr->widget, scr->widget->core.x + dx,
+ scr->widget->core.y + dy);
+ if (lefscr != NULL && lefscr->state != USED1)
+ XtMoveWidget(lefscr->widget, lefscr->widget->core.x + dx,
+ lefscr->widget->core.y + dy);
+ if (rigscr != NULL && rigscr->state != USED1)
+ XtMoveWidget(rigscr->widget, rigscr->widget->core.x + dx,
+ rigscr->widget->core.y + dy);
+ }
+ else
+ XtMoveWidget(topscr->widget, scr->widget->core.x,
+ scr->widget->core.y - topscr->widget->core.height);
+ }
+
+ if (botscr != NULL) {
+ if (botscr->state == USED1) {
+ dx = botscr->widget->core.x - scr->widget->core.x;
+ dy = botscr->widget->core.y - scr->widget->core.height - scr->widget->core.y;
+
+ XtMoveWidget(scr->widget, scr->widget->core.x + dx,
+ scr->widget->core.y + dy);
+ if (lefscr != NULL && lefscr->state != USED1)
+ XtMoveWidget(lefscr->widget, lefscr->widget->core.x + dx,
+ lefscr->widget->core.y + dy);
+ if (rigscr != NULL && rigscr->state != USED1)
+ XtMoveWidget(rigscr->widget, rigscr->widget->core.x + dx,
+ rigscr->widget->core.y + dy);
+ if (botscr != NULL && botscr->state != USED1)
+ XtMoveWidget(botscr->widget, botscr->widget->core.x + dx,
+ botscr->widget->core.y + dy);
+ }
+ else
+ XtMoveWidget(botscr->widget, scr->widget->core.x,
+ scr->widget->core.y + scr->widget->core.height);
+ }
+
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+
+ for (i = 0; i < computer.num_screens; i++)
+ if (computer.screens[i]->state == USED1)
+ computer.screens[i]->state = USED;
+ else
+ XLowerWindow(XtDisplay(computer.screens[i]->widget),
+ XtWindow(computer.screens[i]->widget));
+
+ w = work->core.width / (columns + 1) - 5;
+ h = work->core.height / (rows + 1) - 5;
+
+ if (w > h)
+ w = h;
+ else
+ h = w;
+
+ dx = (work->core.width - (columns * w)) >> 1;
+ dy = (work->core.height - (rows * h)) >> 1;
+
+ xf = (double)w / (double)computer.screens[0]->widget->core.width;
+ yf = (double)h / (double)computer.screens[0]->widget->core.height;
+
+ for (i = 0; i < computer.num_screens; i++) {
+ Widget z = computer.screens[i]->widget;
+
+ if (computer.screens[i]->state == USED)
+ XtConfigureWidget(z, z->core.x * xf + dx,
+ z->core.y * yf + dy, w, h, 0);
+ else
+ XtConfigureWidget(z, z->core.x, z->core.y, w, h, 0);
+ }
+
+ if (computer.screens[base]->row >= 0) {
+ double xf, yf;
+ int width, height;
+
+ for (i = 0; i < computer.num_screens; i++) {
+ width = computer.screens[i]->screen->scrn_monitor->mon_width;
+ height = computer.screens[i]->screen->scrn_monitor->mon_height;
+ if (width <= 0) {
+ width = mon_width;
+ height = mon_height;
+ }
+
+ if (computer.screens[i]->rotate) {
+ xf = (double)width / (double)mon_width * 8. / 10.;
+ yf = (double)height / (double)mon_height;
+ }
+ else {
+ xf = (double)width / (double)mon_width;
+ yf = (double)height / (double)mon_height * 8. / 10.;
+ }
+ width = computer.screens[i]->widget->core.width * xf;
+ height = computer.screens[i]->widget->core.height * yf;
+ if (computer.screens[i]->state == USED) {
+ if (mon_widths[computer.screens[i]->column] < width)
+ mon_widths[computer.screens[i]->column] = width;
+ if (mon_heights[computer.screens[i]->row] < height)
+ mon_heights[computer.screens[i]->row] = height;
+ }
+
+ /* do it here to avoid recalculation */
+ computer.screens[i]->rect.width = width;
+ computer.screens[i]->rect.height = height;
+ }
+ }
+
+ for (i = 0; i < computer.num_screens; i++)
+ ReshapeScreenWidget(computer.screens[i]);
+
+ /* do a new pass, to avoid gaps if the monitors have different
+ * sizes.
+ */
+ if (computer.screens[base]->row >= 0) {
+ x = computer.screens[base]->widget->core.x;
+ y = computer.screens[base]->widget->core.y;
+
+ /* screens representations are already ordered */
+ for (i = base; i < computer.num_screens; i++) {
+ if (computer.screens[i]->state == UNUSED)
+ continue;
+ if (computer.screens[i]->column != 0)
+ x += mon_widths[computer.screens[i]->column];
+ else {
+ x = computer.screens[base]->widget->core.x;
+ if (i != base)
+ y += mon_heights[computer.screens[i]->row];
+ }
+ XtMoveWidget(computer.screens[i]->widget, x, y);
+ }
+ }
+ XtMapWidget(work);
+}
+
+static int
+qcmp_screen(_Xconst void *a, _Xconst void *b)
+{
+ xf86cfgScreen *s1, *s2;
+
+ s1 = *(xf86cfgScreen**)a;
+ s2 = *(xf86cfgScreen**)b;
+
+ if (s1->widget->core.x > s2->widget->core.x) {
+ if (s2->widget->core.y >=
+ s1->widget->core.y + (s1->widget->core.height >> 1))
+ return (-1);
+ return (1);
+ }
+ else {
+ if (s1->widget->core.y >=
+ s2->widget->core.y + (s2->widget->core.height >> 1))
+ return (1);
+ return (-1);
+ }
+ /*NOTREACHED*/
+}
+
+void
+UpdateScreenUI(void)
+{
+ XF86ConfLayoutPtr lay = computer.layout;
+ XF86ConfAdjacencyPtr adj, prev, left, base;
+ int i, p, cols, scrno;
+
+ if (lay == NULL)
+ return;
+
+ rows = columns = cols = 1;
+
+ qsort(computer.screens, computer.num_screens, sizeof(xf86cfgScreen*),
+ qcmp_screen);
+
+ adj = prev = left = base = NULL;
+ for (i = p = scrno = 0; i < computer.num_screens; i++) {
+ XF86ConfScreenPtr scr = computer.screens[i]->screen;
+
+ if (computer.screens[i]->state == UNUSED)
+ continue;
+
+ adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
+ adj->adj_scrnum = scrno++;
+ adj->adj_screen = scr;
+ adj->adj_screen_str = XtNewString(scr->scrn_identifier);
+ if (base == NULL) {
+ base = left = adj;
+ computer.screens[i]->row = computer.screens[i]->column = 0;
+ }
+ else {
+ int dy = computer.screens[i]->widget->core.y -
+ computer.screens[p]->widget->core.y;
+
+ prev->list.next = adj;
+ if (dy > (computer.screens[i]->widget->core.height >> 1)) {
+ adj->adj_where = CONF_ADJ_BELOW;
+ adj->adj_refscreen = XtNewString(left->adj_screen_str);
+ left = adj;
+ computer.screens[i]->row = rows;
+ computer.screens[i]->column = 0;
+ cols = 1;
+ ++rows;
+ }
+ else {
+ computer.screens[i]->row = rows - 1;
+ computer.screens[i]->column = cols;
+ adj->adj_where = CONF_ADJ_RIGHTOF;
+ if (++cols > columns)
+ columns = cols;
+ adj->adj_refscreen = XtNewString(prev->adj_screen_str);
+ }
+ }
+ prev = adj;
+ p = i;
+ }
+
+ adj = lay->lay_adjacency_lst;
+
+ while (adj != NULL) {
+ prev = adj;
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ XtFree(prev->adj_screen_str);
+ XtFree(prev->adj_right_str);
+ XtFree(prev->adj_left_str);
+ XtFree(prev->adj_top_str);
+ XtFree(prev->adj_bottom_str);
+ XtFree(prev->adj_refscreen);
+ XtFree((char*)prev);
+ }
+
+ lay->lay_adjacency_lst = base;
+}
diff --git a/hw/xfree86/utils/xorgcfg/screen.h b/hw/xfree86/utils/xorgcfg/screen.h
new file mode 100644
index 000000000..7c3e2c75f
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/screen.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen.h,v 1.3 2000/12/01 18:31:07 paulo Exp $
+ */
+
+#include "xf86config.h"
+#include "config.h"
+
+#ifndef _xf86cfg_screen_h
+#define _xf86cfg_screen_h
+
+/*
+ * Prototypes
+ */
+void AddScreen(xf86cfgDevice*, xf86cfgDevice*);
+void RemoveScreen(xf86cfgDevice*, xf86cfgDevice*);
+
+void DrawScreen(Display*, Drawable, int, int, int, int, Bool, int);
+void DrawScreenMask(Display*, Drawable, GC, int, int, int, int, int);
+void CreateScreenWidget(xf86cfgScreen*);
+void SetScreenRotate(xf86cfgScreen*);
+
+void AdjustScreenUI(void);
+void UpdateScreenUI(void);
+
+#endif /* _xf86cfg_screen_h */
diff --git a/hw/xfree86/utils/xorgcfg/shorter.xbm b/hw/xfree86/utils/xorgcfg/shorter.xbm
new file mode 100644
index 000000000..878f219d4
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/shorter.xbm
@@ -0,0 +1,8 @@
+#define shorter_width 19
+#define shorter_height 19
+static unsigned char shorter_bits[] = {
+ 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0xfc, 0xff, 0x01,
+ 0xf8, 0xff, 0x00, 0xf0, 0x7f, 0x00, 0xe0, 0x3f, 0x00, 0xc0, 0x1f, 0x00,
+ 0x80, 0x0f, 0x00, 0x00, 0x07, 0x00, 0x80, 0x0f, 0x00, 0xc0, 0x1f, 0x00,
+ 0xe0, 0x3f, 0x00, 0xf0, 0x7f, 0x00, 0xf8, 0xff, 0x00, 0xfc, 0xff, 0x01,
+ 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/startx.c b/hw/xfree86/utils/xorgcfg/startx.c
new file mode 100644
index 000000000..23b0ecf5a
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/startx.c
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/startx.c,v 1.8 2002/10/19 20:04:21 herrb Exp $
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+
+/*
+ * Initialization
+ */
+static int xpid;
+Display *DPY;
+
+/*
+ * Implementation
+ */
+Bool
+startx(void)
+{
+ int timeout = 8;
+
+ if (getenv("DISPLAY") != NULL)
+ /* already running Xserver */
+ return (False);
+
+ if (XF86Config_path == NULL) {
+ char *home, filename[PATH_MAX];
+ char commandline[PATH_MAX * 4];
+ int c_pos;
+ int len;
+ /*
+ * The name of the 4.0 binary is XFree86. X might also
+ * be the name of the 3.3 binary. Therefore don't change
+ * name to 'X'.
+ */
+ if (XFree86_path)
+ c_pos = XmuSnprintf(commandline, sizeof(commandline),
+ "%s/XFree86 :8 -configure ",XFree86_path);
+ else
+ c_pos = XmuSnprintf(commandline, sizeof(commandline),
+ "%s/bin/XFree86 :8 -configure ", XFree86Dir);
+ if (XF86Module_path && ((len = sizeof(commandline) - c_pos) > 0))
+ c_pos += XmuSnprintf(commandline + c_pos,len,
+ " -modulepath %s",XF86Module_path);
+ if (XF86Font_path && ((len = sizeof(commandline) - c_pos) > 0))
+ c_pos += XmuSnprintf(commandline + c_pos,len,
+ " -fontpath %s",XF86Font_path);
+ if (XF86RGB_path && ((len = sizeof(commandline) - c_pos) > 0))
+ c_pos += XmuSnprintf(commandline + c_pos,len,
+ " -rgbpath %s",XF86RGB_path);
+
+ if (system(commandline) != 0) {
+ fprintf(stderr, "Failed to run \"X -configure\".\n");
+ exit(1);
+ }
+
+ if ((home = getenv("HOME")) == NULL)
+ home = "/";
+
+#ifndef QNX4
+ XmuSnprintf(filename, sizeof(filename), "%s/XF86Config.new", home);
+#else
+ XmuSnprintf(filename, sizeof(filename), "//%d%s/XF86Config.new",
+ getnid(), home);
+#endif
+
+ /* this memory is never released, even if the value of XF86Config_path is
+ * changed.
+ */
+ XF86Config_path = XtNewString(filename);
+ }
+
+ putenv("DISPLAY=:8");
+
+ switch (xpid = fork()) {
+ case 0: {
+ char path[PATH_MAX];
+ /* Don't change to X! see above */
+ if (XFree86_path)
+ XmuSnprintf(path, sizeof(path), "%s/XFree86", XFree86_path);
+ else
+ XmuSnprintf(path, sizeof(path), "%s/bin/XFree86", XFree86Dir);
+ execl(path, "X", ":8", /*"+xinerama",*/ "+accessx","-allowMouseOpenFail",
+ "-xf86config", XF86Config_path, (void *)NULL);
+ exit(-127);
+ } break;
+ case -1:
+ fprintf(stderr, "Cannot fork.\n");
+ exit(1);
+ break;
+ default:
+ break;
+ }
+
+ while (timeout > 0) {
+ int status;
+
+ sleep(timeout -= 2);
+ if (waitpid(xpid, &status, WNOHANG | WUNTRACED) == xpid)
+ break;
+ else {
+ DPY = XOpenDisplay(NULL);
+ if (DPY != NULL)
+ break;
+ }
+ }
+
+ if (DPY == NULL) {
+ fprintf(stderr, "Cannot connect to X server.\n");
+ exit(1);
+ }
+
+ return (True);
+}
+
+void
+endx(void)
+{
+ if (xpid != 0)
+ kill(xpid, SIGTERM);
+}
diff --git a/hw/xfree86/utils/xorgcfg/stubs.c b/hw/xfree86/utils/xorgcfg/stubs.c
new file mode 100644
index 000000000..5962908d1
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/stubs.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/stubs.c,v 1.3 2002/11/09 11:12:53 herrb Exp $
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "stubs.h"
+
+/*
+ * Implementation
+ */
+#if !defined(USE_MODULES)
+/* these are defined in libdummy.a */
+int
+ErrorF(const char *fmt, ...)
+{
+ int retval;
+ va_list ap;
+
+ va_start(ap, fmt);
+ retval = vfprintf(stderr, fmt, ap);
+
+ va_end(ap);
+
+ return (retval);
+}
+
+int
+VErrorF(const char *fmt, va_list ap)
+{
+ int retval;
+
+ retval = vfprintf(stderr, fmt, ap);
+
+ return (retval);
+}
+
+#endif /* !defined(USE_MODULES) */
diff --git a/hw/xfree86/utils/xorgcfg/stubs.h b/hw/xfree86/utils/xorgcfg/stubs.h
new file mode 100644
index 000000000..d554ac17a
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/stubs.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/stubs.h,v 1.3 2001/08/01 00:44:57 tsi Exp $
+ */
+
+#ifndef _xf86cfg_stubs_h
+#define _xf86cfg_stubs_h
+
+#include <stdarg.h>
+
+int ErrorF(const char*, ...);
+int VErrorF(const char*, va_list);
+#if defined(USE_MODULES)
+extern int xf86Verbose;
+#endif
+
+#endif /* _xf86cfg_stubs_h */
diff --git a/hw/xfree86/utils/xorgcfg/taller.xbm b/hw/xfree86/utils/xorgcfg/taller.xbm
new file mode 100644
index 000000000..c779300ea
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/taller.xbm
@@ -0,0 +1,8 @@
+#define taller_width 19
+#define taller_height 19
+static unsigned char taller_bits[] = {
+ 0x00, 0x02, 0x00, 0x00, 0x07, 0x00, 0x80, 0x0f, 0x00, 0xc0, 0x1f, 0x00,
+ 0xe0, 0x3f, 0x00, 0xf0, 0x7f, 0x00, 0xf8, 0xff, 0x00, 0xfc, 0xff, 0x01,
+ 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0xfc, 0xff, 0x01,
+ 0xf8, 0xff, 0x00, 0xf0, 0x7f, 0x00, 0xe0, 0x3f, 0x00, 0xc0, 0x1f, 0x00,
+ 0x80, 0x0f, 0x00, 0x00, 0x07, 0x00, 0x00, 0x02, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/text-mode.c b/hw/xfree86/utils/xorgcfg/text-mode.c
new file mode 100644
index 000000000..ef4da2877
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/text-mode.c
@@ -0,0 +1,3353 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.22 2003/02/16 05:23:45 paulo Exp $
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _SCO_DS
+#include <curses.h>
+#else
+#include <ncurses.h>
+#endif
+#include <ctype.h>
+#include <X11/Xlib.h>
+#include <X11/extensions/XKBstr.h>
+#include <X11/extensions/XKBrules.h>
+#include "cards.h"
+#include "config.h"
+#include "xf86config.h"
+#include "loader.h"
+
+#define XKB_RULES_DIR "/usr/X11R6/lib/X11/xkb/rules"
+
+#define CONTROL_A 1
+#define CONTROL_D 4
+#define CONTROL_E 5
+#define CONTROL_K 11
+#define TAB 9
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+
+void TextMode(void);
+
+static void ClearScreen(void);
+static void PaintWindow(WINDOW*, char*, int, int, int, int);
+static void PaintBox(WINDOW*, int, int, int, int);
+static void PaintButton(WINDOW*, char*, int, int, int);
+static void PrintWrap(WINDOW*, char*, int, int, int);
+static int Dialog(char*, char*, int, int, char*, char*, int);
+static void PaintItem(WINDOW*, char*, int, int);
+static int DialogMenu(char*, char*, int, int, int, int, char**, char*, char*, int);
+static void PaintCheckItem(WINDOW*, char*, int, int, int);
+static int DialogCheckBox(char*, char*, int, int, int, int, char**, char*, char*, char*);
+static char *DialogInput(char*, char*, int, int, char*, char*, char*, int);
+static void PaintScroller(WINDOW*, int, int, int);
+
+static int MouseConfig(void);
+static int KeyboardConfig(void);
+static int MonitorConfig(void);
+static int CardConfig(void);
+static int ScreenConfig(void);
+static int LayoutConfig(void);
+static int WriteXF86Config(void);
+
+static XF86ConfLayoutPtr CopyLayout(XF86ConfLayoutPtr);
+static XF86ConfAdjacencyPtr CopyAdjacency(XF86ConfAdjacencyPtr);
+static XF86ConfInputrefPtr CopyInputref(XF86ConfInputrefPtr);
+static XF86ConfInactivePtr CopyInactive(XF86ConfInactivePtr);
+static void FreeLayout(XF86ConfLayoutPtr);
+
+extern int string_to_parser_range(char*, parser_range*, int);
+#define PARSER_RANGE_SIZE 256
+/* string must have at least 256 bytes */
+extern int parser_range_to_string(char*, parser_range*, int);
+
+static Bool newconfig;
+
+static chtype screen_attr = A_NORMAL;
+static chtype dialog_attr = A_REVERSE;
+static chtype highlight_border_attr = A_REVERSE;
+static chtype shadow_border_attr = A_REVERSE;
+static chtype title_attr = A_NORMAL;
+static chtype button_active_attr = A_NORMAL;
+static chtype button_inactive_attr = A_NORMAL;
+static int menu_width, item_x;
+static char Edit[] = "Edit ";
+
+static char *main_menu[] = {
+#define CONF_MOUSE 0
+ "Configure mouse",
+#define CONF_KEYBOARD 1
+ "Configure keyboard",
+#define CONF_MONITOR 2
+ "Configure monitor",
+#define CONF_CARD 3
+ "Configure card",
+#define CONF_SCREEN 4
+ "Configure screen",
+#define CONF_LAYOUT 5
+ "Configure layout",
+#define CONF_FINISH 6
+ "Write XF86Config and quit",
+#define CONF_QUIT 7
+ "Quit",
+};
+
+void
+TextMode(void)
+{
+ static int first = 1;
+ int i, choice = CONF_MOUSE;
+
+#ifdef USE_MODULES
+ if (!nomodules)
+ LoaderInitializeOptions();
+#endif
+ initscr();
+ noecho();
+ nonl();
+ keypad(stdscr, TRUE);
+
+ if (first) {
+ const char *filename;
+
+ first = 0;
+
+ if (has_colors()) {
+ start_color();
+ init_pair(1, COLOR_BLACK, COLOR_BLACK);
+ screen_attr = A_BOLD | COLOR_PAIR(1);
+
+ init_pair(2, COLOR_BLACK, COLOR_WHITE);
+ dialog_attr = COLOR_PAIR(2);
+
+ init_pair(3, COLOR_BLACK, COLOR_WHITE);
+ shadow_border_attr = A_BOLD | COLOR_PAIR(3);
+
+ init_pair(4, COLOR_WHITE, COLOR_WHITE);
+ highlight_border_attr = A_BOLD | COLOR_PAIR(4);
+
+ init_pair(5, COLOR_WHITE, COLOR_BLUE);
+ title_attr = A_BOLD | COLOR_PAIR(5);
+ button_active_attr = title_attr;
+
+ init_pair(6, COLOR_WHITE, COLOR_BLACK);
+ button_inactive_attr = A_BOLD | COLOR_PAIR(6);
+ }
+
+ if ((filename = xf86openConfigFile(getuid() == 0 ?
+ CONFPATH : USER_CONFPATH,
+ XF86Config_path, NULL)) != NULL) {
+ XF86Config_path = (char *)filename;
+ if ((XF86Config = xf86readConfigFile()) == NULL) {
+ ClearScreen();
+ refresh();
+ Dialog("Configuration error",
+ "Error parsing configuration file.",
+ 7, 50, " Ok ", NULL, 0);
+ }
+ }
+ if (XF86Config == NULL) {
+ XF86Config = (XF86ConfigPtr)XtCalloc(1, sizeof(XF86ConfigRec));
+ newconfig = True;
+ }
+ else
+ newconfig = False;
+ }
+
+ ClearScreen();
+ refresh();
+
+ /*CONSTCOND*/
+ while (1) {
+ int cancel = FALSE;
+
+ ClearScreen();
+ refresh();
+ if (Dialog("XFree86 Configuration",
+ "This program will create the XF86Config file, based on "
+ "menu selections you make.\n"
+ "\n"
+ "The XF86Config file usually resides in /usr/X11R6/etc/X11 "
+ "or /etc/X11. A sample XF86Config file is supplied with "
+ "XFree86; it is configured for a standard VGA card and "
+ "monitor with 640x480 resolution. This program will ask for "
+ "a pathname when it is ready to write the file.\n"
+ "\n"
+ "You can either take the sample XF86Config as a base and "
+ "edit it for your configuration, or let this program "
+ "produce a base XF86Config file for your configuration and "
+ "fine-tune it.",
+ 20, 60, " Ok ", " Cancel ", 0) != 0)
+ break;
+
+ while (!cancel) {
+ ClearScreen();
+ refresh();
+ switch (DialogMenu("Main menu",
+ "Choose one of the options:",
+ 17, 60, 8, sizeof(main_menu) /
+ sizeof(main_menu[0]), main_menu,
+ " Ok ", " Cancel ", choice)) {
+ case CONF_MOUSE:
+ i = MouseConfig();
+ if (i > 0 && choice == CONF_MOUSE)
+ choice = CONF_KEYBOARD;
+ else if (i == 0)
+ choice = CONF_MOUSE;
+ break;
+ case CONF_KEYBOARD:
+ i = KeyboardConfig();
+ if (i > 0 && choice <= CONF_KEYBOARD)
+ choice = CONF_MONITOR;
+ else if (i == 0)
+ choice = CONF_KEYBOARD;
+ break;
+ case CONF_MONITOR:
+ i = MonitorConfig();
+ if (i > 0 && choice <= CONF_MONITOR)
+ choice = CONF_CARD;
+ else if (i == 0)
+ choice = CONF_MONITOR;
+ break;
+ case CONF_CARD:
+ i = CardConfig();
+ if (i > 0 && choice <= CONF_CARD)
+ choice = CONF_SCREEN;
+ else if (i == 0)
+ choice = CONF_CARD;
+ break;
+ case CONF_SCREEN:
+ i = ScreenConfig();
+ if (i > 0 && choice <= CONF_SCREEN)
+ choice = CONF_LAYOUT;
+ else if (i == 0)
+ choice = CONF_SCREEN;
+ break;
+ case CONF_LAYOUT:
+ i = LayoutConfig();
+ if (i > 0 && choice <= CONF_LAYOUT)
+ choice = CONF_FINISH;
+ else if (i == 0)
+ choice = CONF_LAYOUT;
+ break;
+ case CONF_FINISH:
+ if (WriteXF86Config() < 0)
+ break;
+ /*FALLTROUGH*/
+ case CONF_QUIT:
+ endwin();
+ exit(0);
+ default:
+ cancel = TRUE;
+ break;
+ }
+ }
+ }
+
+ endwin();
+}
+
+static int
+WriteXF86Config(void)
+{
+ char *xf86config;
+
+ ClearScreen();
+ refresh();
+ xf86config = DialogInput("Write XF86Config", "Write configuration to file:",
+ 10, 60, XF86Config_path ? XF86Config_path :
+ "/etc/X11/XF86Config", " Ok ", " Cancel ", 0);
+
+ if (xf86config == NULL)
+ return (-1);
+
+ if (newconfig) {
+ if (XF86Config->conf_modules == NULL) {
+ static char *modules[] = {"extmod", "glx", "dri", "dbe",
+ "record", "xtrap", "type1", "speedo"};
+ XF86LoadPtr load;
+ int i;
+
+ XF86Config->conf_modules = (XF86ConfModulePtr)
+ XtCalloc(1, sizeof(XF86ConfModuleRec));
+
+ XF86Config->conf_modules->mod_comment =
+ XtNewString("\t# Load \"freetype\"\n"
+ "\t# Load \"xtt\"\n");
+
+ for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) {
+ load = (XF86LoadPtr)XtCalloc(1, sizeof(XF86LoadRec));
+ load->load_name = XtNewString(modules[i]);
+ XF86Config->conf_modules->mod_load_lst =
+ xf86addModule(XF86Config->conf_modules->mod_load_lst, load);
+ }
+ }
+ }
+
+ if (!xf86writeConfigFile(xf86config, XF86Config)) {
+ char msg[1024];
+
+ XmuSnprintf(msg, sizeof(msg), "Failed to write configuration file %s.",
+ xf86config);
+ ClearScreen();
+ refresh();
+ (void)Dialog("Write failed!", msg, 8, 60, " Ok ", NULL, 0);
+ XtFree(xf86config);
+ return (-1);
+ }
+ XtFree(xf86config);
+
+ return (1);
+}
+
+static char *protocols[] = {
+#ifdef SCO
+ "OsMouse",
+#endif
+#ifdef WSCONS_SUPPORT
+ "wsmouse",
+#endif
+ "Auto",
+ "SysMouse",
+ "MouseSystems",
+ "BusMouse",
+ "PS/2",
+ "Microsoft",
+#ifndef __FreeBSD__
+ "ImPS/2",
+ "ExplorerPS/2",
+ "GlidePointPS/2",
+ "MouseManPlusPS/2",
+ "NetMousePS/2",
+ "NetScrollPS/2",
+ "ThinkingMousePS/2",
+#endif
+ "AceCad",
+ "GlidePoint",
+ "IntelliMouse",
+ "Logitech",
+ "MMHitTab",
+ "MMSeries",
+ "MouseMan",
+ "ThinkingMouse",
+};
+
+static int
+MouseConfig(void)
+{
+ int i, nlist, def, proto, emul;
+ char **list = NULL, *device, *str;
+ XF86ConfInputPtr *inputs = NULL;
+ XF86ConfInputPtr input = XF86Config->conf_input_lst;
+ XF86OptionPtr option;
+
+ nlist = 0;
+ while (input) {
+ if (strcmp(input->inp_driver, "mouse") == 0) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist] = XtMalloc(sizeof(Edit) +
+ strlen(input->inp_identifier) + 1);
+ sprintf(list[nlist], "%s%s", Edit, input->inp_identifier);
+ inputs = (XF86ConfInputPtr*)XtRealloc((XtPointer)inputs, (nlist + 1) *
+ sizeof(XF86ConfInputPtr));
+ inputs[nlist] = input;
+ ++nlist;
+ }
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+
+ input = NULL;
+
+ if (nlist) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
+ list[nlist++] = XtNewString("Add new mouse");
+ if (nlist == 2) {
+ i = strlen("Remove ") + strlen(inputs[0]->inp_identifier) + 1;
+ list[nlist] = XtMalloc(i);
+ XmuSnprintf(list[nlist], i, "Remove %s", inputs[0]->inp_identifier);
+ ++nlist;
+ }
+ else
+ list[nlist++] = XtNewString("Remove mouse");
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Mouse configuration",
+ "You can edit or remove a previously configured mouse, "
+ "or add a new one.", 14, 60, 4, nlist, list,
+ " Ok ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)inputs);
+ return (-1);
+ }
+ if (nlist > 2 && i == nlist - 1) {
+ if (nlist > 3) {
+ for (i = 0; i < nlist - 2; i++) {
+ /* XXX Remove the "Edit " from list entries */
+ memmove(list[i], list[i] + sizeof(Edit) - 1,
+ strlen(list[i]) - sizeof(Edit) + 2);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Remove mouse",
+ "Select which mouse to remove",
+ 13, 60, 4, nlist - 2, list,
+ " Remove ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)inputs);
+ return (-1);
+ }
+ input = inputs[i];
+ }
+ else
+ input = inputs[0];
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)inputs);
+ xf86removeInput(XF86Config, input);
+ return (0);
+ }
+ if (i < nlist - 2)
+ input = inputs[i];
+ }
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)inputs);
+
+ if (input == NULL) {
+ char label[32];
+
+ input = (XF86ConfInputPtr)XtCalloc(1, sizeof(XF86ConfInputRec));
+ XmuSnprintf(label, sizeof(label), "Mouse%d", nlist ? nlist - 2 : 0);
+ ClearScreen();
+ refresh();
+ input->inp_identifier =
+ DialogInput("Mouse identifier",
+ "Enter an identifier for your mouse definition:",
+ 11, 40, label,
+ " Next >>", " Cancel ", 0);
+ if (input->inp_identifier == NULL) {
+ XtFree((XtPointer)input);
+ return (-1);
+ }
+ }
+
+ def = 0;
+ option = xf86findOption(input->inp_option_lst, "Protocol");
+ if (option)
+ for (i = 0; i < sizeof(protocols)/sizeof(protocols[0]); i++)
+ if (strcasecmp(option->opt_val, protocols[i]) == 0) {
+ def = i;
+ break;
+ }
+
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Select mouse protocol",
+ "If you have a serial mouse, it probably will work with "
+ "the \"Auto\" protocol. But, if it is an old serial "
+ "mouse probably it is not PNP; in that case, most serial "
+ "mouses understand the \"Microsoft\" protocol.",
+ 19, 60, 7, sizeof(protocols) /
+ sizeof(protocols[0]), protocols, " Next >>", " Cancel ", def);
+ if (i < 0) {
+ if (input->inp_driver == NULL) {
+ XtFree(input->inp_driver);
+ XtFree((XtPointer)input);
+ }
+ return (i);
+ }
+ proto = i;
+
+ def = 0;
+ if (input->inp_driver) {
+ option = xf86findOption(input->inp_option_lst, "Emulate3Buttons");
+ def = option ? 0 : 1;
+ }
+ ClearScreen();
+ refresh();
+ i = Dialog("Mouse 3 buttons emulation",
+ "If your mouse has only two buttons, it is recommended that "
+ "you enable Emulate3Buttons.\n"
+ "\n"
+ "Do you want to enable Emulate3Buttons?",
+ 10, 60, " Yes ", " No ", def);
+ if (i < 0)
+ return (i);
+ emul = !i;
+
+ str = NULL;
+ option = xf86findOption(input->inp_option_lst, "Device");
+ if (option)
+ str = option->opt_val;
+ if (str == NULL)
+#ifdef WSCONS_SUPPORT
+ str = "/dev/wsmouse";
+#elif defined(__FreeBSD__)
+ str = "/dev/sysmouse";
+#else
+ str = "/dev/mouse";
+#endif
+
+ ClearScreen();
+ refresh();
+ device = DialogInput("Select mouse device",
+ "Enter mouse device:", 10, 40, str,
+ " Finish ", " Cancel ", 0);
+ if (device == NULL) {
+ if (input->inp_driver == NULL) {
+ XtFree(input->inp_driver);
+ XtFree((XtPointer)input);
+ }
+ return (-1);
+ }
+
+ /* Finish mouse configuration */
+ option = xf86findOption(input->inp_option_lst, "Protocol");
+ if (option) {
+ XtFree((XtPointer)option->opt_val);
+ option->opt_val = XtNewString(protocols[proto]);
+ }
+ else
+ input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
+ XtNewString("Protocol"), XtNewString(protocols[proto]));
+
+ option = xf86findOption(input->inp_option_lst, "Emulate3Buttons");
+ if (option && !emul) {
+ xf86removeOption(&input->inp_option_lst, "Emulate3Buttons");
+ }
+ else if (option == NULL && emul)
+ input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
+ XtNewString("Emulate3Buttons"), NULL);
+
+ option = xf86findOption(input->inp_option_lst, "Device");
+ if (option) {
+ XtFree((XtPointer)option->opt_val);
+ option->opt_val = device;
+ }
+ else
+ input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
+ XtNewString("Device"), device);
+
+ if (input->inp_driver == NULL) {
+ input->inp_driver = XtNewString("mouse");
+ XF86Config->conf_input_lst =
+ xf86addInput(XF86Config->conf_input_lst, input);
+ }
+
+ return (1);
+}
+
+static int
+KeyboardConfig(void)
+{
+ int i;
+ char *rulesfile;
+ static int first = 1;
+ static XkbRF_RulesPtr rules;
+ static char **models, **layouts;
+ XF86ConfInputPtr *inputs = NULL, input = XF86Config->conf_input_lst;
+ char **list = NULL, *model, *layout;
+ int nlist, def;
+ XF86OptionPtr option;
+
+ nlist = 0;
+ while (input) {
+ if (strcmp(input->inp_driver, "keyboard") == 0) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist] = XtMalloc(sizeof(Edit) +
+ strlen(input->inp_identifier) + 1);
+ sprintf(list[nlist], "%s%s", Edit, input->inp_identifier);
+ inputs = (XF86ConfInputPtr*)XtRealloc((XtPointer)inputs, (nlist + 1) *
+ sizeof(XF86ConfInputPtr));
+ inputs[nlist] = input;
+ ++nlist;
+ }
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+
+ input = NULL;
+
+ if (nlist) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
+ list[nlist++] = XtNewString("Add new keyboard");
+ if (nlist == 2) {
+ i = strlen("Remove ") + strlen(inputs[0]->inp_identifier) + 1;
+ list[nlist] = XtMalloc(i);
+ XmuSnprintf(list[nlist], i, "Remove %s", inputs[0]->inp_identifier);
+ ++nlist;
+ }
+ else
+ list[nlist++] = XtNewString("Remove keyboard");
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Keyboard configuration",
+ "You can edit or remove a previously configured "
+ "keyboard, or add a new one.", 14, 60, 4, nlist, list,
+ " Ok ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)inputs);
+ return (-1);
+ }
+ if (nlist > 2 && i == nlist - 1) {
+ if (nlist > 3) {
+ for (i = 0; i < nlist - 2; i++) {
+ /* XXX Remove the "Edit " from list entries */
+ memmove(list[i], list[i] + sizeof(Edit) - 1,
+ strlen(list[i]) - sizeof(Edit) + 2);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Remove keyboard",
+ "Select which keyboard to remove",
+ 13, 60, 4, nlist - 2, list,
+ " Remove ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)inputs);
+ return (-1);
+ }
+ input = inputs[i];
+ }
+ else
+ input = inputs[0];
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)inputs);
+ xf86removeInput(XF86Config, input);
+ return (0);
+ }
+ if (i < nlist - 2)
+ input = inputs[i];
+ }
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)inputs);
+
+ if (input == NULL) {
+ char label[32];
+
+ input = (XF86ConfInputPtr)XtCalloc(1, sizeof(XF86ConfInputRec));
+ XmuSnprintf(label, sizeof(label), "Keyboard%d", nlist ? nlist - 2 : 0);
+ ClearScreen();
+ refresh();
+ input->inp_identifier =
+ DialogInput("Keyboard identifier",
+ "Enter an identifier for your keyboard definition:",
+ 11, 40, label,
+ " Next >>", " Cancel ", 0);
+ if (input->inp_identifier == NULL) {
+ XtFree((XtPointer)input);
+ return (-1);
+ }
+ }
+
+ if (first) {
+ first = 0;
+#ifdef XFREE98_XKB
+ rulesfile = XKB_RULES_DIR "/xfree98";
+#else
+ rulesfile = XKB_RULES_DIR "/xfree86";
+#endif
+ rules = XkbRF_Load(rulesfile, "", True, False);
+ if (rules == NULL) {
+ ClearScreen();
+ refresh();
+ Dialog("Configuration error",
+ "XKB rules file not found.\n"
+ "\n"
+ "Keyboard XKB options will be set to default values.",
+ 10, 50, " Ok ", NULL, 0);
+ if (input->inp_driver == NULL) {
+ input->inp_option_lst =
+ xf86addNewOption(input->inp_option_lst,
+ XtNewString("XkbModel"), XtNewString("pc101"));
+ input->inp_option_lst =
+ xf86addNewOption(input->inp_option_lst,
+ XtNewString("XkbLayout"), XtNewString("us"));
+ input->inp_driver = XtNewString("keyboard");
+ XF86Config->conf_input_lst =
+ xf86addInput(XF86Config, input);
+ }
+ return (0);
+ }
+ models = (char**)XtMalloc(sizeof(char*) * rules->models.num_desc);
+ for (i = 0; i < rules->models.num_desc; i++)
+ models[i] = XtNewString(rules->models.desc[i].desc);
+ layouts = (char**)XtMalloc(sizeof(char*) * rules->layouts.num_desc);
+ for (i = 0; i < rules->layouts.num_desc; i++)
+ layouts[i] = XtNewString(rules->layouts.desc[i].desc);
+ }
+ else if (rules == NULL)
+ return (-1);
+
+ def = 0;
+ option = xf86findOption(input->inp_option_lst, "XkbModel");
+ if (option) {
+ for (i = 0; i < rules->models.num_desc; i++)
+ if (strcasecmp(option->opt_val, rules->models.desc[i].name) == 0) {
+ def = i;
+ break;
+ }
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Keyboard model",
+ "Please select one of the following keyboard types that is "
+ "the better description of your keyboard. If nothing really "
+ "matches, choose \"Generic 101-key PC\".\n",
+ 20, 60, 9, rules->models.num_desc,
+ models, " Next >>", " Cancel ", def);
+ if (i < 0)
+ return (i);
+ model = rules->models.desc[i].name;
+
+ def = 0;
+ option = xf86findOption(input->inp_option_lst, "XkbLayout");
+ if (option) {
+ for (i = 0; i < rules->layouts.num_desc; i++)
+ if (strcasecmp(option->opt_val, rules->layouts.desc[i].name) == 0) {
+ def = i;
+ break;
+ }
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Keyboard layout",
+ "Select keyboard layout:",
+ 20, 60, 11, rules->layouts.num_desc,
+ layouts, " Finish ", " Cancel ", def);
+ if (i < 0)
+ return (i);
+ layout = rules->layouts.desc[i].name;
+
+ /* Finish keyboard configuration */
+ option = xf86findOption(input->inp_option_lst, "XkbModel");
+ if (option) {
+ XtFree((XtPointer)option->opt_val);
+ option->opt_val = XtNewString(model);
+ }
+ else
+ input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
+ XtNewString("XkbModel"), XtNewString(model));
+
+ option = xf86findOption(input->inp_option_lst, "XkbLayout");
+ if (option) {
+ XtFree((XtPointer)option->opt_val);
+ option->opt_val = XtNewString(layout);
+ }
+ else
+ input->inp_option_lst = xf86addNewOption(input->inp_option_lst,
+ XtNewString("XkbLayout"), XtNewString(layout));
+
+ if (input->inp_driver == NULL) {
+ input->inp_driver = XtNewString("keyboard");
+ XF86Config->conf_input_lst =
+ xf86addInput(XF86Config->conf_input_lst, input);
+ }
+
+ return (1);
+}
+
+static char *hsync[] = {
+#define CONF_MONITOR_HSYNC 0
+ "Enter your own horizontal sync range",
+ "31.5; Standard VGA, 640x480 @ 60 Hz",
+ "31.5 - 35.1; Super VGA, 800x600 @ 56 Hz",
+ "31.5, 35.5; 8514 Compatible, 1024x768 @ 87 Hz interlaced (no 800x600)",
+ "31.5, 35.15, 35.5; Super VGA, 1024x768 @ 87 Hz int., 800x600 @ 56 Hz",
+ "31.5 - 37.9; Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz",
+ "31.5 - 48.5; Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz",
+ "31.5 - 57.0; High Frequency SVGA, 1024x768 @ 70 Hz",
+ "31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz",
+ "31.5 - 79.0; Monitor that can do 1280x1024 @ 74 Hz",
+ "31.5 - 82.0; Monitor that can do 1280x1024 @ 76 Hz",
+};
+
+static char *vrefresh[] = {
+#define CONF_MONITOR_VREFRESH 0
+ "Enter your own vertical sync range",
+ "50 - 70",
+ "50 - 90",
+ "50 - 100",
+ "40 - 150",
+};
+
+static int
+MonitorConfig(void)
+{
+ int i;
+ XF86ConfMonitorPtr *monitors = NULL, monitor = XF86Config->conf_monitor_lst;
+ char **list = NULL, *identifier = NULL, *tmp;
+ int nlist, def;
+ char hsync_str[256], vrefresh_str[256];
+
+ hsync_str[0] = vrefresh_str[0] = '\0';
+ nlist = 0;
+ while (monitor) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist] = XtMalloc(sizeof(Edit) +
+ strlen(monitor->mon_identifier) + 1);
+ sprintf(list[nlist], "%s%s", Edit, monitor->mon_identifier);
+ monitors = (XF86ConfMonitorPtr*)XtRealloc((XtPointer)monitors, (nlist + 1) *
+ sizeof(XF86ConfMonitorPtr));
+ monitors[nlist] = monitor;
+ ++nlist;
+ monitor = (XF86ConfMonitorPtr)(monitor->list.next);
+ }
+
+ monitor = NULL;
+
+ if (nlist) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
+ list[nlist++] = XtNewString("Add new monitor");
+ if (nlist == 2) {
+ i = strlen("Remove ") + strlen(monitors[0]->mon_identifier) + 1;
+ list[nlist] = XtMalloc(i);
+ XmuSnprintf(list[nlist], i, "Remove %s", monitors[0]->mon_identifier);
+ ++nlist;
+ }
+ else
+ list[nlist++] = XtNewString("Remove monitor");
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Monitor configuration",
+ "You can edit or remove a previously configured "
+ "monitor, or add a new one.", 14, 60, 4, nlist, list,
+ " Ok ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)monitors);
+ return (-1);
+ }
+ if (nlist > 2 && i == nlist - 1) {
+ if (nlist > 3) {
+ for (i = 0; i < nlist - 2; i++) {
+ /* XXX Remove the "Edit " from list entries */
+ memmove(list[i], list[i] + sizeof(Edit) - 1,
+ strlen(list[i]) - sizeof(Edit) + 2);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Remove monitor",
+ "Select which monitor to remove",
+ 13, 60, 4, nlist - 2, list,
+ " Remove ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)monitors);
+ return (-1);
+ }
+ monitor = monitors[i];
+ }
+ else
+ monitor = monitors[0];
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)monitors);
+ xf86removeMonitor(XF86Config, monitor);
+ return (0);
+ }
+ if (i < nlist - 2)
+ monitor = monitors[i];
+ }
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)monitors);
+
+ if (monitor == NULL) {
+ char label[32];
+
+ monitor = (XF86ConfMonitorPtr)XtCalloc(1, sizeof(XF86ConfMonitorRec));
+ XmuSnprintf(label, sizeof(label), "Monitor%d", nlist ? nlist - 2 : 0);
+ ClearScreen();
+ refresh();
+ identifier =
+ DialogInput("Monitor identifier",
+ "Enter an identifier for your monitor definition:",
+ 11, 40, label,
+ " Next >>", " Cancel ", 0);
+ if (identifier == NULL) {
+ XtFree((XtPointer)monitor);
+ return (-1);
+ }
+ }
+
+ if (monitor->mon_identifier == NULL) {
+ ClearScreen();
+ refresh();
+ i = Dialog("Monitor configuration",
+ "Now we want to set the specifications of the monitor. The "
+ "two critical parameters are the vertical refresh rate, which "
+ "is the rate at which the whole screen is refreshed, and most "
+ "importantly the horizontal sync rate, which is the rate at "
+ "which scanlines are displayed.\n"
+ "\n"
+ "The valid range for horizontal sync and vertical sync should "
+ "be documented in the manual of your monitor.",
+ 15, 60, " Next >>", " Cancel ", 0);
+ if (i != 0) {
+ XtFree(identifier);
+ XtFree((XtPointer)monitor);
+ return (-1);
+ }
+ }
+
+ def = 0;
+ if (monitor->mon_identifier) {
+ int len;
+
+ parser_range_to_string(hsync_str, &(monitor->mon_hsync[0]),
+ monitor->mon_n_hsync);
+ len = strlen(hsync_str);
+ for (i = 1; i < sizeof(hsync) / sizeof(hsync[0]); i++) {
+ tmp = strchr(hsync[i], ';');
+ if (strncmp(hsync_str, hsync[i], len) == 0) {
+ def = i;
+ break;
+ }
+ }
+ }
+ if (hsync_str[0] == '\0')
+ strcpy(hsync_str, "31.5");
+
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Monitor HorizSync",
+ "You must indicate the horizontal sync range of your "
+ "monitor. You can either select one of the predefined "
+ "ranges below that correspond to industry-standard monitor "
+ "types, or give a specific range.",
+ 22, 78, 11, sizeof(hsync) /
+ sizeof(hsync[0]), hsync, " Next >>", " Cancel ", def);
+ if (i < 0) {
+ if (monitor->mon_identifier == NULL) {
+ XtFree(identifier);
+ XtFree((XtPointer)monitor);
+ }
+ return (-1);
+ }
+ if (i == CONF_MONITOR_HSYNC) {
+ ClearScreen();
+ refresh();
+ tmp = DialogInput("Monitor HorizSync",
+ "Please enter the horizontal sync range of your "
+ "monitor, in the format used in the table of monitor "
+ "types above. You can either specify one or more "
+ "continuous ranges (e.g. 15-25, 30-50), or one or more "
+ "fixed sync frequencies.\n"
+ "\n"
+ "Horizontal sync range:", 16, 62, hsync_str,
+ " Ok ", " Cancel ", def);
+ if (tmp == NULL) {
+ if (monitor->mon_identifier == NULL) {
+ XtFree(identifier);
+ XtFree((XtPointer)monitor);
+ }
+ return (-1);
+ }
+ XmuSnprintf(hsync_str, sizeof(hsync_str), "%s", tmp);
+ XtFree(tmp);
+ }
+ else {
+ tmp = strchr(hsync[i], ';');
+ strncpy(hsync_str, hsync[i], tmp - hsync[i]);
+ hsync_str[tmp - hsync[i]] = '\0';
+ }
+
+ def = 0;
+ if (monitor->mon_identifier) {
+ parser_range_to_string(vrefresh_str, &(monitor->mon_vrefresh[0]),
+ monitor->mon_n_vrefresh);
+ for (i = 1; i < sizeof(vrefresh) / sizeof(vrefresh[0]); i++) {
+ if (strcmp(vrefresh_str, vrefresh[i]) == 0) {
+ def = i;
+ break;
+ }
+ }
+ }
+ if (vrefresh_str[0] == '\0')
+ strcpy(vrefresh_str, "50 - 70");
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Monitor VertRefresh",
+ "You must indicate the vertical sync range of your monitor. "
+ "You can either select one of the predefined ranges below "
+ "that correspond to industry-standard monitor types, or "
+ "give a specific range. For interlaced modes, the number "
+ "that counts is the high one (e.g. 87 Hz rather than 43 Hz).",
+ 19, 60, 5, sizeof(vrefresh) /
+ sizeof(vrefresh[0]), vrefresh, " Finish ", " Cancel ", def);
+ if (i < 0) {
+ if (monitor->mon_identifier == NULL) {
+ XtFree(identifier);
+ XtFree((XtPointer)monitor);
+ }
+ return (i);
+ }
+ if (i == CONF_MONITOR_VREFRESH) {
+ ClearScreen();
+ refresh();
+ tmp = DialogInput("Monitor VertRefresh",
+ "Vertical sync range:", 10, 50, vrefresh_str,
+ " Done ", " Cancel ", 0);
+ if (tmp == NULL) {
+ if (monitor->mon_identifier == NULL) {
+ XtFree(identifier);
+ XtFree((XtPointer)monitor);
+ }
+ return (-1);
+ }
+ XmuSnprintf(vrefresh_str, sizeof(vrefresh_str), "%s", tmp);
+ XtFree(tmp);
+ }
+ else
+ strcpy(vrefresh_str, vrefresh[i]);
+
+ /* Finish monitor configuration */
+ monitor->mon_n_hsync = string_to_parser_range(hsync_str,
+ &(monitor->mon_hsync[0]), CONF_MAX_HSYNC);
+ monitor->mon_n_vrefresh = string_to_parser_range(vrefresh_str,
+ &(monitor->mon_vrefresh[0]), CONF_MAX_VREFRESH);
+ if (monitor->mon_identifier == NULL) {
+ monitor->mon_identifier = identifier;
+ XF86Config->conf_monitor_lst =
+ xf86addMonitor(XF86Config->conf_monitor_lst, monitor);
+ }
+
+ return (1);
+}
+
+static int
+CardConfig(void)
+{
+ int i;
+ XF86ConfDevicePtr *devices = NULL, device = XF86Config->conf_device_lst;
+ char **list = NULL, *identifier = NULL, *driver, *busid, *tmp;
+ int nlist, def;
+ CardsEntry *entry = NULL;
+ static char **drivers;
+ static int ndrivers;
+ static char *xdrivers[] = {
+ "apm",
+ "ark",
+ "ati",
+ "r128",
+ "radeon",
+ "chips",
+ "cirrus",
+ "cyrix",
+ "fbdev",
+ "glint",
+ "i128",
+ "i740",
+ "i810",
+ "imstt",
+ "mga",
+ "neomagic",
+ "nv",
+ "rendition",
+ "s3",
+ "s3virge",
+ "savage",
+ "siliconmotion",
+ "sis",
+ "tdfx",
+ "tga",
+ "trident",
+ "tseng",
+ "vmware",
+ "vga",
+ "vesa",
+ };
+
+#ifdef USE_MODULES
+ if (!nomodules) {
+ xf86cfgModuleOptions *opts = module_options;
+
+ drivers = NULL;
+ ndrivers = 0;
+ while (opts) {
+ if (opts->type == VideoModule) {
+ ++ndrivers;
+ drivers = (char**)XtRealloc((XtPointer)drivers,
+ ndrivers * sizeof(char*));
+ /* XXX no private copy */
+ drivers[ndrivers - 1] = opts->name;
+ }
+ opts = opts->next;
+ }
+ }
+ else
+#endif
+ {
+ ndrivers = sizeof(xdrivers) / sizeof(xdrivers[0]);
+ drivers = xdrivers;
+ }
+
+ nlist = 0;
+ while (device) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist] = XtMalloc(sizeof(Edit) +
+ strlen(device->dev_identifier) + 1);
+ sprintf(list[nlist], "%s%s", Edit, device->dev_identifier);
+ devices = (XF86ConfDevicePtr*)XtRealloc((XtPointer)devices, (nlist + 1) *
+ sizeof(XF86ConfDevicePtr));
+ devices[nlist] = device;
+ ++nlist;
+ device = (XF86ConfDevicePtr)(device->list.next);
+ }
+
+ device = NULL;
+
+ if (nlist) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
+ list[nlist++] = XtNewString("Add new card");
+ if (nlist == 2) {
+ i = strlen("Remove ") + strlen(devices[0]->dev_identifier) + 1;
+ list[nlist] = XtMalloc(i);
+ XmuSnprintf(list[nlist], i, "Remove %s", devices[0]->dev_identifier);
+ ++nlist;
+ }
+ else
+ list[nlist++] = XtNewString("Remove device");
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Card configuration",
+ "You can edit or remove a previously configured "
+ "card, or add a new one.", 14, 60, 4, nlist, list,
+ " Ok ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)devices);
+ return (-1);
+ }
+ if (nlist > 2 && i == nlist - 1) {
+ if (nlist > 3) {
+ for (i = 0; i < nlist - 2; i++) {
+ /* XXX Remove the "Edit " from list entries */
+ memmove(list[i], list[i] + sizeof(Edit) - 1,
+ strlen(list[i]) - sizeof(Edit) + 2);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Remove card",
+ "Select which card to remove",
+ 13, 60, 4, nlist - 2, list,
+ " Remove ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)devices);
+ return (-1);
+ }
+ device = devices[i];
+ }
+ else
+ device = devices[0];
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)devices);
+ xf86removeDevice(XF86Config, device);
+ return (0);
+ }
+ if (i < nlist - 2)
+ device = devices[i];
+ }
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)devices);
+
+ if (device == NULL) {
+ char label[32];
+
+ device = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec));
+ device->dev_chipid = device->dev_chiprev = device->dev_irq = -1;
+ XmuSnprintf(label, sizeof(label), "Card%d", nlist ? nlist - 2 : 0);
+ ClearScreen();
+ refresh();
+ identifier =
+ DialogInput("Card identifier",
+ "Enter an identifier for your card definition:",
+ 11, 40, label,
+ " Next >>", " Cancel ", 0);
+ if (identifier == NULL) {
+ XtFree((XtPointer)device);
+ return (-1);
+ }
+ }
+
+ ClearScreen();
+ refresh();
+ if (Dialog("Card configuration",
+ "Now we must configure video card specific settings. At this "
+ "point you can choose to make a selection out of a database of "
+ "video card definitions.\n"
+ "\n"
+ "The database entries include information about the chipset, "
+ "what driver to run, the Ramdac and ClockChip, and comments "
+ "that will be included in the Device section. However, a lot "
+ "of definitions only hint about what driver to run (based on "
+ "the chipset the card uses) and are untested.\n"
+ "\n"
+ "Do you want to look at the card database?",
+ 18, 60, " Yes ", " No ", device->dev_identifier != NULL) == 0) {
+ static char **cards;
+ static int ncards;
+
+ if (cards == NULL) {
+ ReadCardsDatabase();
+ cards = GetCardNames(&ncards);
+ cards = (char**)XtRealloc((XtPointer)cards,
+ (ncards + 1) * sizeof(char*));
+ for (i = ncards; i > 0; i--)
+ cards[i] = cards[i - 1];
+ cards[0] = "** Unlisted card **";
+ ++ncards;
+ }
+ if (device->dev_card)
+ entry = LookupCard(device->dev_card);
+ def = 0;
+ if (entry) {
+ for (i = 0; i < NumCardsEntry; i++)
+ if (strcasecmp(CardsDB[i]->name, entry->name) == 0) {
+ def = i + 1;
+ break;
+ }
+ /* make sure entry is set to null again */
+ entry = NULL;
+ }
+
+ i = DialogMenu("Card database",
+ "Select name that better matches your card:",
+ 20, 70, 11, ncards, cards, "Next >>", " Cancel ", def);
+ if (i > 0)
+ entry = LookupCard(cards[i]);
+ }
+
+ def = 0;
+ tmp = device->dev_driver ? device->dev_driver : entry && entry->driver ?
+ entry->driver : "vga";
+ for (i = 0; i < ndrivers; i++)
+ if (strcmp(drivers[i], tmp) == 0) {
+ def = i;
+ break;
+ }
+
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Card driver",
+ "You can select the driver for your card here, or just press "
+ "Enter to use the default/current:", 20, 50, 9,
+ ndrivers, drivers, " Ok ", " Cancel ", def);
+ if (i < 0) {
+ if (device->dev_identifier == NULL) {
+ XtFree(identifier);
+ XtFree((XtPointer)device);
+ }
+ return (-1);
+ }
+ driver = ndrivers ? drivers[i] : "vga";
+
+ ClearScreen();
+ refresh();
+ tmp = device->dev_busid ? device->dev_busid : "";
+ busid = DialogInput("Card BusID",
+ "You normally does not need to fill this field "
+ "if you have only one video card:", 11, 50, tmp,
+ " Finish ", " Cancel ", 0);
+
+ /* Finish card configuration */
+ if (entry) {
+ XtFree(device->dev_card);
+ device->dev_card = XtNewString(entry->name);
+ if (entry->chipset) {
+ XtFree(device->dev_chipset);
+ device->dev_chipset = XtNewString(entry->chipset);
+ }
+ if (entry->ramdac) {
+ XtFree(device->dev_ramdac);
+ device->dev_ramdac = XtNewString(entry->ramdac);
+ }
+ if (entry->clockchip) {
+ XtFree(entry->clockchip);
+ device->dev_clockchip = XtNewString(entry->clockchip);
+ }
+ }
+ if (busid) {
+ XtFree(device->dev_busid);
+ if (*busid)
+ device->dev_busid = busid;
+ else {
+ device->dev_busid = NULL;
+ XtFree(busid);
+ }
+ }
+ XtFree(device->dev_driver);
+ device->dev_driver = XtNewString(driver);
+ if (device->dev_identifier == NULL) {
+ device->dev_identifier = identifier;
+ XF86Config->conf_device_lst =
+ xf86addDevice(XF86Config->conf_device_lst, device);
+ }
+
+ return (1);
+}
+
+static char *depths[] = {
+ "1 bit, monochrome",
+ "4 bit, 16 colors",
+ "8 bit, 256 colors",
+ "15 bits, 32Kb colors",
+ "16 bits, 65Kb colors",
+ "24 bits, 16Mb colors",
+};
+
+static char *modes[] = {
+ "1600x1200",
+ "1400x1050",
+ "1280x1024",
+ "1280x960",
+ "1152x864",
+ "1024x768",
+ "800x600",
+ "640x480",
+ "640x400",
+ "512x384",
+ "400x300",
+ "320x240",
+ "320x200",
+};
+
+static int
+ScreenConfig(void)
+{
+ int i, disp_allocated;
+ XF86ConfScreenPtr *screens = NULL, screen = XF86Config->conf_screen_lst;
+ char **list = NULL, *identifier = NULL;
+ int nlist, def;
+ XF86ConfDevicePtr device = NULL;
+ XF86ConfMonitorPtr monitor = NULL;
+ XF86ConfDisplayPtr display;
+ XF86ModePtr mode, ptr = NULL;
+ char *checks;
+
+ nlist = 0;
+ while (screen) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist] = XtMalloc(sizeof(Edit) +
+ strlen(screen->scrn_identifier) + 1);
+ sprintf(list[nlist], "%s%s", Edit, screen->scrn_identifier);
+ screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens, (nlist + 1) *
+ sizeof(XF86ConfScreenPtr));
+ screens[nlist] = screen;
+ ++nlist;
+ screen = (XF86ConfScreenPtr)(screen->list.next);
+ }
+
+ screen = NULL;
+
+ if (nlist) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
+ list[nlist++] = XtNewString("Add new screen");
+ if (nlist == 2) {
+ i = strlen("Remove ") + strlen(screens[0]->scrn_identifier) + 1;
+ list[nlist] = XtMalloc(i);
+ XmuSnprintf(list[nlist], i, "Remove %s", screens[0]->scrn_identifier);
+ ++nlist;
+ }
+ else
+ list[nlist++] = XtNewString("Remove screen");
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Screen configuration",
+ "You can edit or remove a previously configured "
+ "screen, or add a new one.", 14, 60, 4, nlist, list,
+ " Ok ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)screens);
+ return (-1);
+ }
+ if (nlist > 2 && i == nlist - 1) {
+ if (nlist > 3) {
+ for (i = 0; i < nlist - 2; i++) {
+ /* XXX Remove the "Edit " from list entries */
+ memmove(list[i], list[i] + sizeof(Edit) - 1,
+ strlen(list[i]) - sizeof(Edit) + 2);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Remove screen",
+ "Select which screen to remove",
+ 13, 60, 4, nlist - 2, list,
+ " Remove ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)screens);
+ return (-1);
+ }
+ screen = screens[i];
+ }
+ else
+ screen = screens[0];
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)screens);
+ xf86removeScreen(XF86Config, screen);
+ return (0);
+ }
+ if (i < nlist - 2)
+ screen = screens[i];
+ }
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)screens);
+
+ if (screen == NULL) {
+ char label[256];
+ XF86ConfDevicePtr *devices = NULL;
+ XF86ConfMonitorPtr *monitors = NULL;
+
+ device = XF86Config->conf_device_lst;
+ monitor = XF86Config->conf_monitor_lst;
+
+ if (device == NULL || monitor == NULL) {
+ ClearScreen();
+ refresh();
+ Dialog("Configuration error",
+ "You need to configure (at least) one card and one "
+ "monitor before creating a screen definition.",
+ 9, 50, " Ok ", NULL, 0);
+
+ return (-1);
+ }
+
+ XmuSnprintf(label, sizeof(label), "Screen%d", nlist ? nlist - 2 : 0);
+ ClearScreen();
+ refresh();
+ identifier =
+ DialogInput("Screen identifier",
+ "Enter an identifier for your screen definition:",
+ 11, 40, label,
+ " Next >>", " Cancel ", 0);
+ if (identifier == NULL)
+ return (-1);
+
+ nlist = 0;
+ list = NULL;
+ while (device) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist] = XtNewString(device->dev_identifier);
+ devices = (XF86ConfDevicePtr*)XtRealloc((XtPointer)devices, (nlist + 1) *
+ sizeof(XF86ConfDevicePtr));
+ devices[nlist] = device;
+ ++nlist;
+ device = (XF86ConfDevicePtr)(device->list.next);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Screen card", "Please select a video card:",
+ 13, 60, 4, nlist, list, " Next >>", " Cancel ", 0);
+ for (def = 0; def < nlist; def++)
+ XtFree(list[def]);
+ XtFree((XtPointer)list);
+ if (i < 0) {
+ XtFree(identifier);
+ XtFree((XtPointer)devices);
+ return (-1);
+ }
+ device = devices[i];
+ XtFree((XtPointer)devices);
+
+ nlist = 0;
+ list = NULL;
+ while (monitor) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist] = XtNewString(monitor->mon_identifier);
+ monitors = (XF86ConfMonitorPtr*)XtRealloc((XtPointer)monitors, (nlist + 1) *
+ sizeof(XF86ConfMonitorPtr));
+ monitors[nlist] = monitor;
+ ++nlist;
+ monitor = (XF86ConfMonitorPtr)(monitor->list.next);
+ }
+ XmuSnprintf(label, sizeof(label),
+ "Select the monitor connected to \"%s\":",
+ device->dev_identifier);
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Screen monitor", label,
+ 13, 60, 4, nlist, list, " Next >>", " Cancel ", 0);
+ for (def = 0; def < nlist; def++)
+ XtFree(list[def]);
+ XtFree((XtPointer)list);
+ if (i < 0) {
+ XtFree(identifier);
+ XtFree((XtPointer)monitors);
+ return (-1);
+ }
+ monitor = monitors[i];
+ XtFree((XtPointer)monitors);
+
+ screen = (XF86ConfScreenPtr)XtCalloc(1, sizeof(XF86ConfScreenRec));
+ screen->scrn_device = device;
+ screen->scrn_monitor = monitor;
+ }
+
+ if (screen->scrn_defaultdepth == 1)
+ def = 0;
+ else if (screen->scrn_defaultdepth == 4)
+ def = 1;
+ else if (screen->scrn_defaultdepth == 8)
+ def = 2;
+ else if (screen->scrn_defaultdepth == 15)
+ def = 3;
+ else if (screen->scrn_defaultdepth == 16)
+ def = 4;
+ else if (screen->scrn_defaultdepth == 24)
+ def = 5;
+ else {
+ if (screen->scrn_device && screen->scrn_device->dev_driver &&
+ strcmp(screen->scrn_device->dev_driver, "vga") == 0)
+ def = 1; /* 4bpp */
+ else
+ def = 2; /* 8bpp */
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Screen depth",
+ "Please specify which color depth you want to use by default:",
+ 15, 60, 6, sizeof(depths) / sizeof(depths[0]), depths,
+ " Next >>", " Cancel ", def);
+ if (i < 0) {
+ if (screen->scrn_identifier == NULL) {
+ XtFree(identifier);
+ XtFree((XtPointer)screen);
+ }
+ return (-1);
+ }
+ else
+ /* XXX depths must begin with the depth number */
+ screen->scrn_defaultdepth = atoi(depths[i]);
+
+ def = 0; /* use def to count how many modes are selected*/
+ nlist = 0;
+ list = NULL;
+ checks = XtMalloc(sizeof(modes) / sizeof(modes[0]));
+ /* XXX list fields in the code below are not allocated */
+ disp_allocated = 0;
+ display = screen->scrn_display_lst;
+ while (display && display->disp_depth != screen->scrn_defaultdepth)
+ display = (XF86ConfDisplayPtr)(display->list.next);
+ if (display == NULL) {
+ display = (XF86ConfDisplayPtr)XtCalloc(1, sizeof(XF86ConfDisplayRec));
+ display->disp_white.red = display->disp_black.red = -1;
+ display->disp_depth = screen->scrn_defaultdepth;
+ disp_allocated = 1;
+ }
+ else {
+ mode = display->disp_mode_lst;
+ while (mode) {
+ for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++)
+ if (strcmp(modes[i], mode->mode_name) == 0) {
+ break;
+ }
+
+ if (i == sizeof(modes) / sizeof(modes[0])) {
+ list = (char**)XtRealloc((XtPointer)list,
+ (nlist + 1) * sizeof(char*));
+ list[nlist] = mode->mode_name;
+ checks = XtRealloc(checks, sizeof(modes) / sizeof(modes[0]) +
+ nlist + 1);
+ checks[nlist] = 1;
+ ++def;
+ nlist++;
+ break;
+ }
+ mode = (XF86ModePtr)(mode->list.next);
+ }
+ }
+
+ for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++)
+ checks[i + nlist] = 0;
+
+ mode = display->disp_mode_lst;
+ while (mode) {
+ for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++)
+ if (strcmp(modes[i], mode->mode_name) == 0) {
+ ++def;
+ checks[i + nlist] = 1;
+ break;
+ }
+ mode = (XF86ModePtr)(mode->list.next);
+ }
+
+ if (nlist == 0 && def == 0)
+ checks[7] = 1; /* 640x480 */
+ list = (char**)XtRealloc((XtPointer)list, (nlist + sizeof(modes) /
+ sizeof(modes[0])) * sizeof(char*));
+ for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++)
+ list[i + nlist] = modes[i];
+ nlist += sizeof(modes) / sizeof(modes[0]);
+
+ ClearScreen();
+ refresh();
+ i = DialogCheckBox("Screen modes",
+ "Select the video modes for this screen:",
+ 17, 60, 8, sizeof(modes) / sizeof(modes[0]), modes,
+ " Finish ", " Cancel ", checks);
+ if (i < 0) {
+ if (screen->scrn_identifier == NULL) {
+ XtFree(identifier);
+ XtFree((XtPointer)screen);
+ XtFree((XtPointer)list);
+ if (disp_allocated)
+ XtFree((XtPointer)display);
+ }
+ return (-1);
+ }
+
+ mode = display->disp_mode_lst;
+ while (mode) {
+ ptr = (XF86ModePtr)(mode->list.next);
+ XtFree(mode->mode_name);
+ XtFree((XtPointer)mode);
+ mode = ptr;
+ }
+ display->disp_mode_lst = NULL;
+
+ for (i = 0; i < nlist; i++) {
+ if (checks[i]) {
+ mode = (XF86ModePtr)XtCalloc(1, sizeof(XF86ModeRec));
+ mode->mode_name = XtNewString(list[i]);
+ if (display->disp_mode_lst == NULL)
+ display->disp_mode_lst = ptr = mode;
+ else {
+ ptr->list.next = mode;
+ ptr = mode;
+ }
+ }
+ }
+ XtFree((XtPointer)list);
+
+ if (disp_allocated) {
+ display->list.next = NULL;
+ if (screen->scrn_display_lst == NULL)
+ screen->scrn_display_lst = display;
+ else
+ screen->scrn_display_lst->list.next = display;
+ }
+
+ if (screen->scrn_identifier == NULL) {
+ screen->scrn_identifier = identifier;
+ screen->scrn_monitor_str = XtNewString(monitor->mon_identifier);
+ screen->scrn_device_str = XtNewString(device->dev_identifier);
+ XF86Config->conf_screen_lst =
+ xf86addScreen(XF86Config->conf_screen_lst, screen);
+ }
+
+ return (1);
+}
+
+static XF86ConfAdjacencyPtr
+CopyAdjacency(XF86ConfAdjacencyPtr ptr)
+{
+ XF86ConfAdjacencyPtr adj = (XF86ConfAdjacencyPtr)
+ XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
+
+ adj->adj_scrnum = ptr->adj_scrnum;
+ adj->adj_screen = ptr->adj_screen;
+ adj->adj_screen_str = XtNewString(ptr->adj_screen_str);
+ adj->adj_top = ptr->adj_top;
+ if (ptr->adj_top_str)
+ adj->adj_top_str = XtNewString(ptr->adj_top_str);
+ adj->adj_bottom = ptr->adj_bottom;
+ if (ptr->adj_bottom_str)
+ adj->adj_bottom_str = XtNewString(ptr->adj_bottom_str);
+ adj->adj_left = ptr->adj_left;
+ if (ptr->adj_left_str)
+ adj->adj_left_str = XtNewString(ptr->adj_left_str);
+ adj->adj_right = ptr->adj_right;
+ if (ptr->adj_right_str)
+ adj->adj_right_str = XtNewString(ptr->adj_right_str);
+ adj->adj_where = ptr->adj_where;
+ adj->adj_x = ptr->adj_x;
+ adj->adj_y = ptr->adj_y;
+ if (ptr->adj_refscreen)
+ adj->adj_refscreen = XtNewString(ptr->adj_refscreen);
+
+ return (adj);
+}
+
+static XF86ConfInactivePtr
+CopyInactive(XF86ConfInactivePtr ptr)
+{
+ XF86ConfInactivePtr inac = (XF86ConfInactivePtr)
+ XtCalloc(1, sizeof(XF86ConfInactiveRec));
+
+ inac->inactive_device = ptr->inactive_device;
+ if (ptr->inactive_device_str)
+ inac->inactive_device_str = XtNewString(ptr->inactive_device_str);
+
+ return (inac);
+}
+
+static XF86ConfInputrefPtr
+CopyInputref(XF86ConfInputrefPtr ptr)
+{
+ XF86ConfInputrefPtr iref = (XF86ConfInputrefPtr)
+ XtCalloc(1, sizeof(XF86ConfInputrefRec));
+ XF86OptionPtr opt = ptr->iref_option_lst;
+
+ iref->iref_inputdev = ptr->iref_inputdev;
+ if (ptr->iref_inputdev_str)
+ iref->iref_inputdev_str = XtNewString(ptr->iref_inputdev_str);
+ while (opt) {
+ iref->iref_option_lst = xf86addNewOption(iref->iref_option_lst,
+ XtNewString(opt->opt_name),
+ opt->opt_val ? XtNewString(opt->opt_val) : NULL);
+ opt = (XF86OptionPtr)(opt->list.next);
+ }
+
+ return (iref);
+}
+
+static XF86ConfLayoutPtr
+CopyLayout(XF86ConfLayoutPtr ptr)
+{
+ XF86ConfLayoutPtr lay = (XF86ConfLayoutPtr)
+ XtCalloc(1, sizeof(XF86ConfLayoutRec));
+ XF86ConfAdjacencyPtr adj = ptr->lay_adjacency_lst, padj;
+ XF86ConfInactivePtr inac = ptr->lay_inactive_lst, pinac;
+ XF86ConfInputrefPtr iref = ptr->lay_input_lst, piref;
+ XF86OptionPtr opt = ptr->lay_option_lst;
+
+ if (ptr->lay_identifier)
+ lay->lay_identifier = XtNewString(ptr->lay_identifier);
+ if (adj) {
+ padj = lay->lay_adjacency_lst = CopyAdjacency(adj);
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ while (adj) {
+ padj->list.next = CopyAdjacency(adj);
+ padj = (XF86ConfAdjacencyPtr)(padj->list.next);
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+ }
+ if (inac) {
+ pinac = lay->lay_inactive_lst = CopyInactive(inac);
+ inac = (XF86ConfInactivePtr)(inac->list.next);
+ while (inac) {
+ pinac->list.next = CopyInactive(inac);
+ pinac = (XF86ConfInactivePtr)(pinac->list.next);
+ inac = (XF86ConfInactivePtr)(inac->list.next);
+ }
+ }
+ if (iref) {
+ piref = lay->lay_input_lst = CopyInputref(iref);
+ iref = (XF86ConfInputrefPtr)(iref->list.next);
+ while (iref) {
+ piref->list.next = CopyInputref(iref);
+ piref = (XF86ConfInputrefPtr)(piref->list.next);
+ iref = (XF86ConfInputrefPtr)(iref->list.next);
+ }
+ }
+
+ while (opt) {
+ lay->lay_option_lst = xf86addNewOption(lay->lay_option_lst,
+ XtNewString(opt->opt_name),
+ opt->opt_val ? XtNewString(opt->opt_val) : NULL);
+ opt = (XF86OptionPtr)(opt->list.next);
+ }
+
+ return (lay);
+}
+
+static void
+FreeLayout(XF86ConfLayoutPtr lay)
+{
+ static XF86ConfigRec xf86config;
+
+ xf86config.conf_layout_lst = lay;
+ xf86removeLayout(&xf86config, lay);
+}
+
+static int
+LayoutConfig(void)
+{
+ int i;
+ XF86ConfLayoutPtr *layouts = NULL, rlayout = NULL,
+ layout = XF86Config->conf_layout_lst;
+ XF86ConfInputPtr input = XF86Config->conf_input_lst;
+ char **list = NULL, *identifier = NULL;
+ XF86ConfInputPtr *mouses = NULL, *keyboards = NULL, mouse, keyboard;
+ XF86ConfInputrefPtr iref, piref, mref, kref;
+ XF86ConfAdjacencyPtr adj, padj;
+ int nmouses, nkeyboards;
+ int nlist;
+ XF86OptionPtr option;
+ XF86ConfScreenPtr screen, *screens;
+
+ nmouses = nkeyboards = 0;
+ while (input) {
+ if (strcmp(input->inp_driver, "mouse") == 0) {
+ mouses = (XF86ConfInputPtr*)XtRealloc((XtPointer)mouses,
+ (nmouses + 1) * sizeof(XF86ConfInputPtr));
+ mouses[nmouses] = input;
+ ++nmouses;
+ }
+ else if (strcmp(input->inp_driver, "keyboard") == 0) {
+ keyboards = (XF86ConfInputPtr*)XtRealloc((XtPointer)keyboards,
+ (nkeyboards + 1) * sizeof(XF86ConfInputPtr));
+ keyboards[nkeyboards] = input;
+ ++nkeyboards;
+ }
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+ if (XF86Config->conf_screen_lst == NULL ||
+ nmouses == 0 || nkeyboards == 0) {
+ XtFree((XtPointer)mouses);
+ XtFree((XtPointer)keyboards);
+ ClearScreen();
+ refresh();
+ Dialog("Configuration error",
+ "You need to configure (at least) one screen, mouse "
+ "and keyboard before creating a layout definition.",
+ 9, 50, " Ok ", NULL, 0);
+ return (-1);
+ }
+
+ nlist = 0;
+ while (layout) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist] = XtMalloc(sizeof(Edit) +
+ strlen(layout->lay_identifier) + 1);
+ sprintf(list[nlist], "%s%s", Edit, layout->lay_identifier);
+ layouts = (XF86ConfLayoutPtr*)XtRealloc((XtPointer)layouts, (nlist + 1) *
+ sizeof(XF86ConfLayoutPtr));
+ layouts[nlist] = layout;
+ ++nlist;
+ layout = (XF86ConfLayoutPtr)(layout->list.next);
+ }
+
+ layout = NULL;
+
+ if (nlist) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*));
+ list[nlist++] = XtNewString("Add new layout");
+ if (nlist == 2) {
+ i = strlen("Remove ") + strlen(layouts[0]->lay_identifier) + 1;
+ list[nlist] = XtMalloc(i);
+ XmuSnprintf(list[nlist], i, "Remove %s", layouts[0]->lay_identifier);
+ ++nlist;
+ }
+ else
+ list[nlist++] = XtNewString("Remove layout");
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Layout configuration",
+ "You can edit or remove a previously configured "
+ "layout, or add a new one.", 14, 60, 4, nlist, list,
+ " Ok ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)layouts);
+ XtFree((XtPointer)mouses);
+ XtFree((XtPointer)keyboards);
+ return (-1);
+ }
+ if (nlist > 2 && i == nlist - 1) {
+ if (nlist > 3) {
+ for (i = 0; i < nlist - 2; i++) {
+ /* XXX Remove the "Edit " from list entries */
+ memmove(list[i], list[i] + sizeof(Edit) - 1,
+ strlen(list[i]) - sizeof(Edit) + 2);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Remove layout",
+ "Select which layout to remove",
+ 13, 60, 4, nlist - 2, list,
+ " Remove ", " Cancel ", 0);
+ if (i < 0) {
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)layouts);
+ XtFree((XtPointer)mouses);
+ XtFree((XtPointer)keyboards);
+ return (-1);
+ }
+ layout = layouts[i];
+ }
+ else
+ layout = layouts[0];
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)layouts);
+ XtFree((XtPointer)mouses);
+ XtFree((XtPointer)keyboards);
+ xf86removeLayout(XF86Config, layout);
+ return (0);
+ }
+ if (i < nlist - 2)
+ layout = layouts[i];
+ }
+ for (i = 0; i < nlist; i++)
+ XtFree(list[i]);
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)layouts);
+
+ if (layout == NULL) {
+ char label[32];
+
+ layout = (XF86ConfLayoutPtr)XtCalloc(1, sizeof(XF86ConfLayoutRec));
+ XmuSnprintf(label, sizeof(label), "Layout%d", nlist ? nlist - 2 : 0);
+ ClearScreen();
+ refresh();
+ identifier =
+ DialogInput("Layout identifier",
+ "Enter an identifier for your layout definition:",
+ 11, 40, label,
+ " Next >>", " Cancel ", 0);
+ if (identifier == NULL) {
+ XtFree((XtPointer)layout);
+ XtFree((XtPointer)mouses);
+ XtFree((XtPointer)keyboards);
+ return (-1);
+ }
+ }
+ else {
+ /* So that we can safely change it */
+ rlayout = layout;
+ layout = CopyLayout(rlayout);
+ }
+
+
+ mouse = keyboard = NULL;
+
+ /* Mouse */
+ piref = NULL;
+ iref = layout->lay_input_lst;
+ while (iref) {
+ if (strcmp(iref->iref_inputdev->inp_driver, "mouse") == 0) {
+ if (mouse == NULL)
+ piref = iref;
+ if (xf86findOption(iref->iref_option_lst, "CorePointer")) {
+ mouse = iref->iref_inputdev;
+ piref = iref;
+ break;
+ }
+ }
+ iref = (XF86ConfInputrefPtr)(iref->list.next);
+ }
+ if (mouse == NULL) {
+ if (piref) {
+ mref = piref;
+ mouse = piref->iref_inputdev;
+ piref->iref_option_lst =
+ xf86addNewOption(piref->iref_option_lst,
+ XtNewString("CorePointer"), NULL);
+ }
+ else {
+ mouse = mouses[0];
+ mref = iref = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec));
+ iref->iref_inputdev_str = XtNewString(mouse->inp_identifier);
+ iref->iref_inputdev = mouse;
+ iref->iref_option_lst =
+ xf86addNewOption(iref->iref_option_lst,
+ XtNewString("CorePointer"), NULL);
+ iref->list.next = layout->lay_input_lst;
+ if (layout->lay_input_lst == NULL)
+ layout->lay_input_lst = iref;
+ else {
+ iref->list.next = layout->lay_input_lst;
+ layout->lay_input_lst = iref;
+ }
+ }
+ }
+ else
+ mref = piref;
+
+ /* XXX list fields are not allocated */
+ if (nmouses > 1) {
+ nlist = 0;
+ list = (char**)XtMalloc(sizeof(char*));
+ list[nlist++] = mouse->inp_identifier;
+ input = XF86Config->conf_input_lst;
+ while (input) {
+ if (input != mouse && strcmp(input->inp_driver, "mouse") == 0) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist++] = input->inp_identifier;
+ }
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Select Core Pointer",
+ "Select the mouse connected to you computer",
+ 12, 60, 4, nlist, list, " Ok ", " Cancel ", 0);
+ if (i < 0) {
+ XtFree((XtPointer)mouses);
+ XtFree((XtPointer)keyboards);
+ XtFree((XtPointer)list);
+ if (layout->lay_identifier == NULL)
+ XtFree(identifier);
+ FreeLayout(layout);
+ return (-1);
+ }
+ if (i > 0) {
+ /* Did not select the default one */
+ iref = layout->lay_input_lst;
+ while (iref) {
+ if (strcasecmp(iref->iref_inputdev_str, list[i]) == 0) {
+ if ((option = xf86findOption(iref->iref_option_lst,
+ "SendCoreEvents")) != NULL) {
+ XtFree(option->opt_name);
+ option->opt_name = XtNewString("CorePointer");
+ }
+ else
+ iref->iref_option_lst =
+ xf86addNewOption(iref->iref_option_lst,
+ "CorePointer", NULL);
+ option = xf86findOption(mref->iref_option_lst,
+ "CorePointer");
+ XtFree(option->opt_name);
+ option->opt_name = XtNewString("SendCoreEvents");
+ break;
+ }
+ iref = (XF86ConfInputrefPtr)(iref->list.next);
+ }
+ }
+
+ /* XXX Write code to add/remove more mouses here */
+ }
+
+
+ /* Keyboard */
+ piref = NULL;
+ iref = layout->lay_input_lst;
+ while (iref) {
+ if (strcmp(iref->iref_inputdev->inp_driver, "keyboard") == 0) {
+ if (keyboard == NULL)
+ piref = iref;
+ if (xf86findOption(iref->iref_option_lst, "CoreKeyboard")) {
+ keyboard = iref->iref_inputdev;
+ piref = iref;
+ break;
+ }
+ }
+ iref = (XF86ConfInputrefPtr)(iref->list.next);
+ }
+ if (keyboard == NULL) {
+ if (piref) {
+ kref = piref;
+ keyboard = piref->iref_inputdev;
+ piref->iref_option_lst =
+ xf86addNewOption(piref->iref_option_lst,
+ XtNewString("CoreKeyboard"), NULL);
+ }
+ else {
+ keyboard = keyboards[0];
+ kref = iref = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec));
+ iref->iref_inputdev_str = XtNewString(keyboard->inp_identifier);
+ iref->iref_inputdev = keyboard;
+ iref->iref_option_lst =
+ xf86addNewOption(iref->iref_option_lst,
+ XtNewString("CoreKeyboard"), NULL);
+ iref->list.next = layout->lay_input_lst;
+ if (layout->lay_input_lst == NULL)
+ layout->lay_input_lst = iref;
+ else {
+ iref->list.next = layout->lay_input_lst;
+ layout->lay_input_lst = iref;
+ }
+ }
+ }
+ else
+ kref = piref;
+
+ /* XXX list fields are not allocated */
+ if (nkeyboards > 1) {
+ nlist = 0;
+ list = (char**)XtMalloc(sizeof(char*));
+ list[nlist++] = keyboard->inp_identifier;
+ input = XF86Config->conf_input_lst;
+ while (input) {
+ if (input != keyboard && strcmp(input->inp_driver, "keyboard") == 0) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ list[nlist++] = input->inp_identifier;
+ }
+ input = (XF86ConfInputPtr)(input->list.next);
+ }
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Select Core Keyboard",
+ "Select the keyboard connected to you computer",
+ 12, 60, 4, nlist, list, " Ok ", " Cancel ", 0);
+ if (i < 0) {
+ XtFree((XtPointer)mouses);
+ XtFree((XtPointer)keyboards);
+ XtFree((XtPointer)list);
+ if (layout->lay_identifier == NULL)
+ XtFree(identifier);
+ FreeLayout(layout);
+ return (-1);
+ }
+ if (i > 0) {
+ /* Did not select the default one */
+ iref = layout->lay_input_lst;
+ while (iref) {
+ if (strcasecmp(iref->iref_inputdev_str, list[i]) == 0) {
+ if ((option = xf86findOption(iref->iref_option_lst,
+ "SendCoreEvents")) != NULL) {
+ XtFree(option->opt_name);
+ option->opt_name = XtNewString("CoreKeyboard");
+ }
+ else
+ iref->iref_option_lst =
+ xf86addNewOption(iref->iref_option_lst,
+ "CoreKeyboard", NULL);
+ option = xf86findOption(kref->iref_option_lst,
+ "CoreKeyboard");
+ XtFree(option->opt_name);
+ option->opt_name = XtNewString("SendCoreEvents");
+ break;
+ }
+ iref = (XF86ConfInputrefPtr)(iref->list.next);
+ }
+ }
+
+ /* XXX Write code to add/remove more keyboards here */
+ }
+
+ XtFree((XtPointer)mouses);
+ XtFree((XtPointer)keyboards);
+
+ /* Just one screen */
+ if (XF86Config->conf_screen_lst->list.next == NULL) {
+ ClearScreen();
+ refresh();
+ Dialog("Layout configuration",
+ (nmouses > 1 || nkeyboards > 1) ?
+ "As you have only one screen configured, I can now finish "
+ "creating this Layout configuration."
+ :
+ "As you have only one screen, mouse and keyboard configured, "
+ "I can now finish creating this Layout configuration.",
+ 12, 60, " Finish ", NULL, 0);
+
+ goto LayoutFinish;
+ }
+
+
+ /* The code below just adds a screen to the right of the last
+ * one, or allows removing a screen.
+ * Needs some review, and adding more options.
+ */
+
+ /*CONSTCOND*/
+ while (1) {
+ static char *screen_opts[] = {
+ "Add a new screen to layout",
+ "Remove screen from layout",
+ "Finish layout configuration",
+ };
+
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Layout configuration", "Please choose one option:",
+ 12, 60, 3, sizeof(screen_opts) / sizeof(screen_opts[0]),
+ screen_opts, " Done ", " Cancel all changes ", 2);
+
+ /* cancel */
+ if (i < 0) {
+ XtFree(identifier);
+ FreeLayout(layout);
+ return (-1);
+ }
+
+ /* add new screen */
+ else if (i == 0) {
+ nlist = 0;
+ list = NULL;
+ screens = NULL;
+ screen = XF86Config->conf_screen_lst;
+ while (screen) {
+ adj = layout->lay_adjacency_lst;
+ while (adj) {
+ if (adj->adj_screen == screen)
+ break;
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+ if (adj == NULL) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens,
+ (nlist + 1) * sizeof(XF86ConfScreenPtr));
+ /* NOT duplicated */
+ list[nlist] = screen->scrn_identifier;
+ screens[nlist] = screen;
+ ++nlist;
+ }
+ screen = (XF86ConfScreenPtr)(screen->list.next);
+ }
+
+ if (nlist == 0)
+ continue;
+
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Layout add screen", "Choose screen to add:",
+ 12, 60, 3, nlist, list,
+ " Add ", " Cancel ", 0);
+ if (i >= 0) {
+ padj = layout->lay_adjacency_lst;
+ adj = (XF86ConfAdjacencyPtr)
+ XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
+ adj->adj_screen = screens[i];
+ if (padj == NULL) {
+ adj->adj_where = CONF_ADJ_ABSOLUTE;
+ layout->lay_adjacency_lst = adj;
+ }
+ else {
+ while (padj->list.next)
+ padj = (XF86ConfAdjacencyPtr)(padj->list.next);
+ padj->list.next = adj;
+ adj->adj_where = CONF_ADJ_RIGHTOF;
+ adj->adj_refscreen =
+ XtNewString(padj->adj_screen->scrn_identifier);
+ }
+ }
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)screens);
+ }
+
+ /* remove a screen */
+ else if (i == 1) {
+ nlist = 0;
+ list = NULL;
+ screens = NULL;
+ adj = layout->lay_adjacency_lst;
+
+ while (adj) {
+ list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*));
+ screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens,
+ (nlist + 1) * sizeof(XF86ConfScreenPtr));
+ list[nlist] = adj->adj_screen->scrn_identifier;
+ screens[nlist] = adj->adj_screen;
+ ++nlist;
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+
+ if (nlist == 0)
+ continue;
+
+ ClearScreen();
+ refresh();
+ i = DialogMenu("Layout remove screen", "Choose screen to remove:",
+ 12, 60, 3, nlist, list,
+ " Remove ", " Cancel ", 0);
+
+ adj = padj = layout->lay_adjacency_lst;
+ while (adj) {
+ if (adj->adj_screen == screens[i]) {
+ padj = (XF86ConfAdjacencyPtr)(padj->list.next);
+ if (padj && adj->adj_where == CONF_ADJ_RIGHTOF &&
+ padj->adj_where == CONF_ADJ_RIGHTOF) {
+ XtFree(padj->adj_refscreen);
+ padj->adj_refscreen = XtNewString(adj->adj_refscreen);
+ }
+ xf86removeAdjacency(layout, adj);
+ break;
+ }
+ padj = adj;
+ adj = (XF86ConfAdjacencyPtr)(padj->list.next);
+ }
+ XtFree((XtPointer)list);
+ XtFree((XtPointer)screens);
+ }
+
+ /* finish screen configuration */
+ else
+ break;
+ }
+
+LayoutFinish:
+ if (layout->lay_adjacency_lst == NULL) {
+ adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec));
+ adj->adj_screen = XF86Config->conf_screen_lst;
+ adj->adj_screen_str = XtNewString(XF86Config->conf_screen_lst->scrn_identifier);
+ adj->adj_where = CONF_ADJ_ABSOLUTE;
+ layout->lay_adjacency_lst = adj;
+ }
+ if (rlayout) {
+ /* just edited this layout */
+ if (nmouses > 1 || nkeyboards > 1) {
+ XF86ConfAdjacencyPtr tadj = rlayout->lay_adjacency_lst;
+ XF86ConfInactivePtr tinac = rlayout->lay_inactive_lst;
+ XF86ConfInputrefPtr tinp = rlayout->lay_input_lst;
+
+ rlayout->lay_adjacency_lst = layout->lay_adjacency_lst;
+ rlayout->lay_inactive_lst = layout->lay_inactive_lst;
+ rlayout->lay_input_lst = layout->lay_input_lst;
+
+ layout->lay_adjacency_lst = tadj;
+ layout->lay_inactive_lst = tinac;
+ layout->lay_input_lst = tinp;
+ FreeLayout(layout);
+ }
+ return (0);
+ }
+ else {
+ layout->lay_identifier = identifier;
+ XF86Config->conf_layout_lst =
+ xf86addLayout(XF86Config->conf_layout_lst, layout);
+ }
+
+ return (1);
+}
+
+static void
+ClearScreen(void)
+{
+ int i, j;
+
+ wattrset(stdscr, screen_attr);
+ for (i = 0; i < LINES; i++) {
+ wmove(stdscr, i, 0);
+ for (j = 0; j < COLS; j++)
+ waddch(stdscr, ACS_PLUS);
+ }
+ touchwin(stdscr);
+}
+
+static int
+Dialog(char *title, char * prompt, int height, int width,
+ char *label1, char *label2, int button)
+{
+ int x, x1, x2, y, key, l1len, l2len;
+ WINDOW *dialog;
+
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+ dialog = newwin(height, width, y, x);
+ keypad(dialog, TRUE);
+
+ PaintWindow(dialog, title, 0, 0, height, width);
+ wattrset(dialog, dialog_attr);
+ PrintWrap(dialog, prompt, width - 3, 2, 3);
+
+ l1len = strlen(label1);
+ if (label2)
+ l2len = strlen(label2);
+ else {
+ l2len = button = 0;
+ }
+
+ x1 = (width - (l1len + l2len)) / (label2 ? 3 : 2);
+ x2 = x1 + x1 + l1len;
+ y = height - 3;
+ if (!button) {
+ if (label2)
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ }
+ else {
+ PaintButton(dialog, label1, y, x1, FALSE);
+ if (label2)
+ PaintButton(dialog, label2, y, x2, TRUE);
+ }
+ wrefresh(dialog);
+
+ /*CONSTCOND*/
+ while (1) {
+ key = wgetch(dialog);
+ switch (key) {
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ if (!button) {
+ if (label2) {
+ button = 1;
+ PaintButton(dialog, label1, y, x1, FALSE);
+ PaintButton(dialog, label2, y, x2, TRUE);
+ }
+
+ }
+ else {
+ if (label2) {
+ button = 0;
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ }
+ }
+ wrefresh(dialog);
+ break;
+ case ' ':
+ case '\r':
+ case '\n':
+ delwin(dialog);
+ return button;
+ }
+ }
+ /*NOTREACHED*/
+}
+
+static void
+PaintWindow(WINDOW *win, char *title_str, int y, int x, int height, int width)
+{
+ int i, j;
+
+ if (title_str != NULL) {
+ j = (width - strlen(title_str)) / 2 - 1;
+
+ wattrset(win, title_attr);
+ wmove(win, x, y);
+ for (i = 0; i < j; i++)
+ waddch(win, ' ');
+ waddstr(win, title_str);
+ for (; i < width; i++)
+ waddch(win, ' ');
+ }
+
+ wattrset(win, 0);
+
+ for (i = 1; i < height; i++) {
+ wmove(win, y + i, x);
+ for (j = 0; j < width; j++)
+ if (i == height - 1 && !j)
+ waddch(win, highlight_border_attr | ACS_LLCORNER);
+ else if (i == height - 1 && j == width - 1)
+ waddch(win, shadow_border_attr | ACS_LRCORNER);
+ else if (i == height - 1)
+ waddch(win, shadow_border_attr | ACS_HLINE);
+ else if (!j)
+ waddch(win, highlight_border_attr | ACS_VLINE);
+ else if (j == width - 1)
+ waddch(win, shadow_border_attr | ACS_VLINE);
+ else
+ waddch(win, dialog_attr | ' ');
+ }
+
+}
+
+static void
+PaintBox(WINDOW *win, int y, int x, int height, int width)
+{
+ int i, j;
+
+ wattrset(win, 0);
+
+ for (i = 0; i < height; i++) {
+ wmove(win, y + i, x);
+ for (j = 0; j < width; j++)
+ if (!i && !j)
+ waddch(win, shadow_border_attr | ACS_ULCORNER);
+ else if (i == height - 1 && !j)
+ waddch(win, shadow_border_attr | ACS_LLCORNER);
+ else if (!i && j == width-1)
+ waddch(win, highlight_border_attr | ACS_URCORNER);
+ else if (i == height - 1 && j == width - 1)
+ waddch(win, highlight_border_attr | ACS_LRCORNER);
+ else if (!i)
+ waddch(win, shadow_border_attr | ACS_HLINE);
+ else if (i == height - 1)
+ waddch(win, highlight_border_attr | ACS_HLINE);
+ else if (!j)
+ waddch(win, shadow_border_attr | ACS_VLINE);
+ else if (j == width - 1)
+ waddch(win, highlight_border_attr | ACS_VLINE);
+ else
+ waddch(win, dialog_attr | ' ');
+ }
+
+}
+
+static void
+PaintButton(WINDOW *win, char *label, int y, int x, int selected)
+{
+ int i, temp;
+
+ wmove(win, y, x);
+ wattrset(win, selected ? button_active_attr : button_inactive_attr);
+ waddstr(win, selected ? "[" : " ");
+ temp = strspn(label, " ");
+ label += temp;
+ wattrset(win, selected ? button_active_attr : button_inactive_attr);
+ for (i = 0; i < temp; i++)
+ waddch(win, ' ');
+ wattrset(win, selected ? button_active_attr : button_inactive_attr);
+ waddch(win, label[0]);
+ wattrset(win, selected ? button_active_attr : button_inactive_attr);
+ waddstr(win, label + 1);
+ wattrset(win, selected ? button_active_attr : button_inactive_attr);
+ waddstr(win, selected ? "]" : " ");
+ wmove(win, y, x + temp + 1);
+}
+
+static void
+PrintWrap(WINDOW *win, char *prompt, int width, int y, int x)
+{
+ int cur_x, cur_y, len, yinc;
+ char *word, *tempstr = XtMalloc(strlen(prompt) + 1);
+
+ cur_x = x;
+ cur_y = y;
+
+ while (*prompt == '\n') {
+ ++cur_y;
+ ++prompt;
+ }
+
+ strcpy(tempstr, prompt);
+
+ for (word = strtok(tempstr, " \n"); word != NULL; word = strtok(NULL, " \n")) {
+ yinc = 0;
+ len = strlen(word);
+ while (prompt[word - tempstr + len + yinc] == '\n')
+ ++yinc;
+ if (cur_x + strlen(word) > width) {
+ cur_y++;
+ cur_x = x;
+ }
+ wmove(win, cur_y, cur_x);
+ waddstr(win, word);
+ getyx(win, cur_y, cur_x);
+ if (yinc) {
+ cur_y += yinc;
+ cur_x = x;
+ }
+ else
+ cur_x++;
+ }
+
+ free(tempstr);
+}
+
+static int
+DialogMenu(char *title, char *prompt, int height, int width, int menu_height,
+ int item_no, char **items, char *label1, char *label2, int choice)
+{
+ int i, x, y, cur_x, cur_y, box_x, box_y, key = 0, button = 0,
+ scrlx = 0, max_choice, nscroll, max_scroll, x1, x2, l1len, l2len;
+ WINDOW *dialog, *menu;
+
+ max_choice = MIN(menu_height, item_no);
+ max_scroll = MAX(0, item_no - max_choice);
+
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+ dialog = newwin(height, width, y, x);
+ keypad(dialog, TRUE);
+
+ PaintWindow(dialog, title, 0, 0, height, width);
+
+ wattrset(dialog, dialog_attr);
+ PrintWrap(dialog, prompt, width - 3, 2, 3);
+
+ l1len = strlen(label1);
+ l2len = strlen(label2);
+
+ x1 = (width - (l1len + l2len)) / 3;
+ x2 = x1 + x1 + l1len;
+
+ menu_width = width - 6;
+ getyx(dialog, cur_y, cur_x);
+ box_y = cur_y + 1;
+ box_x = (width - menu_width) / 2 - 1;
+
+ menu = subwin(dialog, menu_height, menu_width, y + box_y + 1, x + box_x + 1);
+ keypad(menu, TRUE);
+
+ /* draw a box around the menu items */
+ PaintBox(dialog, box_y, box_x, menu_height + 2, menu_width + 2);
+
+ item_x = 3;
+
+ if (choice > menu_height) {
+ scrlx = MIN(max_scroll, choice);
+ choice -= scrlx;
+ }
+
+ for (i = 0; i < max_choice; i++)
+ PaintItem(menu, items[i + scrlx], i, i == choice);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+
+ x = width / 2 - 11;
+ y = height - 3;
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ wrefresh(dialog);
+
+ /*CONSTCOND*/
+ while (1) {
+ i = choice;
+ key = wgetch(dialog);
+
+ if (menu_height > 1 && key == KEY_PPAGE) {
+ if (!choice) {
+ if (scrlx) {
+ /* Scroll menu down */
+ getyx(dialog, cur_y, cur_x);
+
+ nscroll = max_choice > scrlx ? -scrlx : -max_choice;
+ scrollok(menu, TRUE);
+ wscrl(menu, nscroll);
+ scrollok(menu, FALSE);
+
+ PaintItem(menu, items[i = scrlx + nscroll], 0, TRUE);
+ for (++i; i <= scrlx; i++)
+ PaintItem(menu, items[i], i - (scrlx + nscroll), FALSE);
+ scrlx += nscroll;
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ continue;
+ }
+ }
+ i = 0;
+ }
+ else if (menu_height > 1 && key == KEY_NPAGE) {
+ if (choice == max_choice - 1) {
+ if (scrlx < max_scroll) {
+ /* Scroll menu up */
+ getyx(dialog, cur_y, cur_x);
+
+ nscroll = (scrlx + max_choice > max_scroll ?
+ max_scroll : scrlx + max_choice) - scrlx;
+ scrollok(menu, TRUE);
+ wscrl(menu, nscroll);
+ scrollok(menu, FALSE);
+
+ scrlx += nscroll;
+ for (i = 0; i < max_choice - 1; i++)
+ PaintItem(menu, items[i + scrlx], i, FALSE);
+ PaintItem(menu, items[i + scrlx], max_choice - 1, TRUE);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ continue;
+ }
+ }
+ i = max_choice - 1;
+ }
+ else if (key == KEY_UP) {
+ if (!choice) {
+ if (scrlx) {
+ /* Scroll menu down */
+ getyx(dialog, cur_y, cur_x);
+ if (menu_height > 1) {
+ PaintItem(menu, items[scrlx], 0, FALSE);
+ scrollok(menu, TRUE);
+ wscrl(menu, - 1);
+ scrollok(menu, FALSE);
+ }
+ scrlx--;
+ PaintItem(menu, items[scrlx], 0, TRUE);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ continue;
+ }
+ }
+ else
+ i = choice - 1;
+ }
+ else if (key == KEY_DOWN) {
+ if (choice == max_choice - 1) {
+ if (scrlx + choice < item_no - 1) {
+ /* Scroll menu up */
+ getyx(dialog, cur_y, cur_x);
+ if (menu_height > 1) {
+ PaintItem(menu, items[scrlx + max_choice - 1], max_choice - 1, FALSE);
+ scrollok(menu, TRUE);
+ scroll(menu);
+ scrollok(menu, FALSE);
+ }
+ scrlx++;
+ PaintItem(menu, items[scrlx + max_choice - 1], max_choice - 1, TRUE);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ continue;
+ }
+ }
+ else
+ i = MIN(choice + 1, item_no - 1);
+ }
+
+ if (i != choice) {
+ getyx(dialog, cur_y, cur_x);
+ PaintItem(menu, items[scrlx + choice], choice, FALSE);
+
+ choice = i;
+ PaintItem(menu, items[scrlx + choice], choice, TRUE);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wmove(dialog, cur_y, cur_x);
+ wrefresh(dialog);
+ continue;
+ }
+
+ switch (key) {
+ case TAB:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ if (!button) {
+ button = 1;
+ PaintButton(dialog, label1, y, x1, FALSE);
+ PaintButton(dialog, label2, y, x2, TRUE);
+ }
+ else {
+ button = 0;
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ }
+ wrefresh(dialog);
+ break;
+ case ' ':
+ case '\r':
+ case '\n':
+ delwin(dialog);
+ return (!button ? scrlx + choice : -1);
+ default:
+ for (i = scrlx + choice + 1; i < item_no; i++)
+ if (toupper(items[i][0]) == toupper(key))
+ break;
+ if (i == item_no) {
+ for (i = 0; i < scrlx + choice; i++)
+ if (toupper(items[i][0]) == toupper(key))
+ break;
+ }
+ getyx(dialog, cur_y, cur_x);
+ if (i < item_no && i != scrlx + choice) {
+ if (i >= scrlx && i < scrlx + max_choice) {
+ /* it is already visible */
+ PaintItem(menu, items[scrlx + choice], choice, FALSE);
+ choice = i - scrlx;
+ }
+ else {
+ scrlx = MIN(i, max_scroll);
+ choice = i - scrlx;
+ for (i = 0; i < max_choice; i++)
+ if (i != choice)
+ PaintItem(menu, items[scrlx + i], i, FALSE);
+ }
+ PaintItem(menu, items[scrlx + choice], choice, TRUE);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wmove(dialog, cur_y, cur_x);
+ wrefresh(dialog);
+ }
+ break;
+ }
+ }
+ /*NOTREACHED*/
+}
+
+static void
+PaintItem(WINDOW *win, char *item, int choice, int selected)
+{
+ int i;
+
+ wattrset(win, selected ? title_attr : dialog_attr);
+ wmove(win, choice, 1);
+ for (i = 1; i < menu_width; i++)
+ waddch(win, ' ');
+ wmove(win, choice, item_x);
+ wattrset(win, selected ? title_attr : dialog_attr);
+ waddstr(win, item);
+}
+
+static void
+PaintScroller(WINDOW *win, int offset, int lenght, int visible)
+{
+ int i, pos;
+
+ if (lenght > visible)
+ pos = (visible / (double)lenght) * offset;
+ else
+ pos = offset;
+ wattrset(win, shadow_border_attr);
+ for (i = 0; i < visible; i++) {
+ wmove(win, i, 0);
+ waddch(win, i == pos ? ACS_BLOCK : ACS_VLINE);
+ }
+}
+
+static int
+DialogCheckBox(char *title, char *prompt, int height, int width, int menu_height,
+ int item_no, char **items, char *label1, char *label2, char *checks)
+{
+ int i, x, y, cur_x, cur_y, box_x, box_y, key = 0, button = 0, choice = 0,
+ scrlx = 0, max_choice, nscroll, max_scroll, x1, x2, l1len, l2len;
+ WINDOW *dialog, *menu;
+
+ max_choice = MIN(menu_height, item_no);
+ max_scroll = MAX(0, item_no - max_choice);
+
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+ dialog = newwin(height, width, y, x);
+ keypad(dialog, TRUE);
+
+ PaintWindow(dialog, title, 0, 0, height, width);
+
+ wattrset(dialog, dialog_attr);
+ PrintWrap(dialog, prompt, width - 3, 2, 3);
+
+ l1len = strlen(label1);
+ l2len = strlen(label2);
+
+ x1 = (width - (l1len + l2len)) / 3;
+ x2 = x1 + x1 + l1len;
+
+ menu_width = width - 6;
+ getyx(dialog, cur_y, cur_x);
+ box_y = cur_y + 1;
+ box_x = (width - menu_width) / 2 - 1;
+
+ menu = subwin(dialog, menu_height, menu_width, y + box_y + 1, x + box_x + 1);
+ keypad(menu, TRUE);
+
+ /* draw a box around the menu items */
+ PaintBox(dialog, box_y, box_x, menu_height + 2, menu_width + 2);
+
+ item_x = 3;
+
+ for (i = 0; i < max_choice; i++)
+ PaintCheckItem(menu, items[i + scrlx], i, i == 0, checks[i + scrlx]);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+
+ x = width / 2 - 11;
+ y = height - 3;
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ wrefresh(dialog);
+
+ /*CONSTCOND*/
+ while (1) {
+ i = choice;
+ key = wgetch(dialog);
+
+ if (menu_height > 1 && key == KEY_PPAGE) {
+ if (!choice) {
+ if (scrlx) {
+ /* Scroll menu down */
+ getyx(dialog, cur_y, cur_x);
+
+ nscroll = max_choice > scrlx ? -scrlx : -max_choice;
+ scrollok(menu, TRUE);
+ wscrl(menu, nscroll);
+ scrollok(menu, FALSE);
+
+ i = scrlx + nscroll;
+ PaintCheckItem(menu, items[i], 0, TRUE, checks[i]);
+ for (++i; i <= scrlx; i++)
+ PaintCheckItem(menu, items[i], i - (scrlx + nscroll), FALSE, checks[i]);
+ scrlx += nscroll;
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ continue;
+ }
+ }
+ i = 0;
+ }
+ else if (menu_height > 1 && key == KEY_NPAGE) {
+ if (choice == max_choice - 1) {
+ if (scrlx < max_scroll) {
+ /* Scroll menu up */
+ getyx(dialog, cur_y, cur_x);
+
+ nscroll = (scrlx + max_choice > max_scroll ?
+ max_scroll : scrlx + max_choice) - scrlx;
+ scrollok(menu, TRUE);
+ wscrl(menu, nscroll);
+ scrollok(menu, FALSE);
+
+ scrlx += nscroll;
+ for (i = 0; i < max_choice - 1; i++)
+ PaintCheckItem(menu, items[i + scrlx], i, FALSE, checks[i + scrlx]);
+ PaintCheckItem(menu, items[i + scrlx], max_choice - 1, TRUE, checks[i + scrlx]);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ continue;
+ }
+ }
+ i = max_choice - 1;
+ }
+ else if (key == KEY_UP) {
+ if (!choice) {
+ if (scrlx) {
+ /* Scroll menu down */
+ getyx(dialog, cur_y, cur_x);
+ if (menu_height > 1) {
+ PaintCheckItem(menu, items[scrlx], 0, FALSE, checks[scrlx]);
+ scrollok(menu, TRUE);
+ wscrl(menu, - 1);
+ scrollok(menu, FALSE);
+ }
+ scrlx--;
+ PaintCheckItem(menu, items[scrlx], 0, TRUE, checks[scrlx]);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ continue;
+ }
+ }
+ else
+ i = choice - 1;
+ }
+ else if (key == KEY_DOWN) {
+ if (choice == max_choice - 1) {
+ if (scrlx + choice < item_no - 1) {
+ /* Scroll menu up */
+ getyx(dialog, cur_y, cur_x);
+ if (menu_height > 1) {
+ PaintCheckItem(menu, items[scrlx + max_choice - 1], max_choice - 1, FALSE, checks[scrlx + max_choice - 1]);
+ scrollok(menu, TRUE);
+ scroll(menu);
+ scrollok(menu, FALSE);
+ }
+ scrlx++;
+ PaintCheckItem(menu, items[scrlx + max_choice - 1], max_choice - 1, TRUE, checks[scrlx + max_choice - 1]);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ continue;
+ }
+ }
+ else
+ i = MIN(choice + 1, item_no - 1);
+ }
+
+ if (i != choice) {
+ getyx(dialog, cur_y, cur_x);
+ PaintCheckItem(menu, items[scrlx + choice], choice, FALSE, checks[scrlx + choice]);
+
+ choice = i;
+ PaintCheckItem(menu, items[scrlx + choice], choice, TRUE, checks[scrlx + choice]);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wmove(dialog, cur_y, cur_x);
+ wrefresh(dialog);
+ continue;
+ }
+
+ switch (key) {
+ case TAB:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ if (!button) {
+ button = 1;
+ PaintButton(dialog, label1, y, x1, FALSE);
+ PaintButton(dialog, label2, y, x2, TRUE);
+ }
+ else {
+ button = 0;
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ }
+ wrefresh(dialog);
+ break;
+ case ' ':
+ getyx(dialog, cur_y, cur_x);
+ checks[scrlx + choice] = !checks[scrlx + choice];
+ PaintCheckItem(menu, items[scrlx + choice], choice, TRUE, checks[scrlx + choice]);
+ wmove(dialog, cur_y, cur_x);
+ wnoutrefresh(menu);
+ wrefresh(dialog);
+ break;
+ case '\r':
+ case '\n':
+ delwin(dialog);
+ return (!button ? 0 : -1);
+ default:
+ for (i = scrlx + choice + 1; i < item_no; i++)
+ if (toupper(items[i][0]) == toupper(key))
+ break;
+ if (i == item_no) {
+ for (i = 0; i < scrlx + choice; i++)
+ if (toupper(items[i][0]) == toupper(key))
+ break;
+ }
+ getyx(dialog, cur_y, cur_x);
+ if (i < item_no && i != scrlx + choice) {
+ if (i >= scrlx && i < scrlx + max_choice) {
+ /* it is already visible */
+ PaintCheckItem(menu, items[scrlx + choice], choice, FALSE, checks[scrlx + choice]);
+ choice = i - scrlx;
+ }
+ else {
+ scrlx = MIN(i, max_scroll);
+ choice = i - scrlx;
+ for (i = 0; i < max_choice; i++)
+ if (i != choice)
+ PaintCheckItem(menu, items[scrlx + i], i, FALSE, checks[scrlx + i]);
+ }
+ PaintCheckItem(menu, items[scrlx + choice], choice, TRUE, checks[scrlx + choice]);
+ PaintScroller(menu, scrlx + choice, item_no, menu_height);
+ wnoutrefresh(menu);
+ wmove(dialog, cur_y, cur_x);
+ wrefresh(dialog);
+ }
+ break;
+ }
+ }
+ /*NOTREACHED*/
+}
+
+static void
+PaintCheckItem(WINDOW *win, char *item, int choice, int selected, int checked)
+{
+ int i;
+
+ wattrset(win, selected ? title_attr : dialog_attr);
+ wmove(win, choice, 1);
+ for (i = 1; i < menu_width; i++)
+ waddch(win, ' ');
+ wmove(win, choice, item_x);
+ wattrset(win, selected ? title_attr : dialog_attr);
+ wprintw(win, "[%c] ", checked ? 'X' : ' ');
+ waddstr(win, item);
+}
+
+static char *
+DialogInput(char *title, char *prompt, int height, int width, char *init,
+ char *label1, char *label2, int def_button)
+{
+ int i, x, y, box_y, box_x, box_width, len,
+ input_x = 0, scrlx = 0, key = 0, button = -1, x1, x2, l1len, l2len;
+ char instr[1024 + 1];
+ WINDOW *dialog;
+
+ x = (COLS - width) / 2;
+ y = (LINES - height) / 2;
+
+ dialog = newwin(height, width, y, x);
+ keypad(dialog, TRUE);
+
+ PaintWindow(dialog, title, 0, 0, height, width);
+
+ wattrset(dialog, dialog_attr);
+ PrintWrap(dialog, prompt, width - 3, 2, 3);
+
+ l1len = strlen(label1);
+ l2len = strlen(label2);
+
+ x1 = (width - (l1len + l2len)) / 3;
+ x2 = x1 + x1 + l1len;
+
+ box_width = width - 6;
+ getyx(dialog, y, x);
+ box_y = y + 2;
+ box_x = (width - box_width) / 2;
+ PaintBox(dialog, y + 1, box_x - 1, 3, box_width + 2);
+
+ x = width / 2 - 11;
+ y = height - 3;
+ PaintButton(dialog, label2, y, x2, def_button == 1);
+ PaintButton(dialog, label1, y, x1, def_button == 0);
+
+ memset(instr, '\0', sizeof(instr));
+ wmove(dialog, box_y, box_x);
+ wattrset(dialog, dialog_attr);
+ if (init)
+ strncpy(instr, init, sizeof(instr) - 2);
+
+ input_x = len = strlen(instr);
+ if (input_x >= box_width) {
+ scrlx = input_x - box_width + 1;
+ input_x = box_width - 1;
+ for (i = 0; i < box_width - 1; i++)
+ waddch(dialog, instr[scrlx + i]);
+ }
+ else
+ waddstr(dialog, instr);
+
+ wmove(dialog, box_y, box_x + input_x);
+
+ wrefresh(dialog);
+
+ while (1) {
+ key = wgetch(dialog);
+ if (button == -1) { /* Input box selected */
+ switch (key) {
+ case TAB:
+ case KEY_UP:
+ case KEY_DOWN:
+ break;
+ case KEY_LEFT:
+ if (scrlx && !input_x) {
+ --scrlx;
+ wmove(dialog, box_y, box_x);
+ for (i = 0; i < box_width; i++)
+ waddch(dialog, instr[scrlx + input_x + i] ? instr[scrlx + input_x + i] : ' ');
+ wmove(dialog, box_y, input_x + box_x);
+ wrefresh(dialog);
+ }
+ else if (input_x) {
+ wmove(dialog, box_y, --input_x + box_x);
+ wrefresh(dialog);
+ }
+ continue;
+ case KEY_RIGHT:
+ if (input_x + scrlx < len) {
+ if (input_x == box_width - 1) {
+ ++scrlx;
+ wmove(dialog, box_y, box_x);
+ for (i = scrlx; i < scrlx + box_width; i++)
+ waddch(dialog, instr[i] ? instr[i] : ' ');
+ wmove(dialog, box_y, input_x + box_x);
+ wrefresh(dialog);
+ }
+ else {
+ wmove(dialog, box_y, ++input_x + box_x);
+ wrefresh(dialog);
+ }
+ }
+ continue;
+ case KEY_BACKSPACE:
+ case 0177:
+ if (input_x || scrlx) {
+ wattrset(dialog, dialog_attr);
+
+ if (scrlx + input_x < len)
+ memmove(instr + scrlx + input_x - 1,
+ instr + scrlx + input_x,
+ len - (scrlx + input_x));
+ instr[--len] = '\0';
+
+ if (!input_x) {
+ scrlx = scrlx < box_width - 1 ? 0 : scrlx - (box_width - 1);
+ wmove(dialog, box_y, box_x);
+ for (i = 0; i < box_width; i++)
+ waddch(dialog, instr[scrlx + input_x + i] ? instr[scrlx + input_x + i] : ' ');
+ input_x = len - scrlx;
+ }
+ else {
+ wmove(dialog, box_y, --input_x + box_x);
+ for (i = scrlx + input_x; i < len &&
+ i < scrlx + box_width; i++)
+ waddch(dialog, instr[i]);
+ if (i < scrlx + box_width)
+ waddch(dialog, ' ');
+ }
+ wmove(dialog, box_y, input_x + box_x);
+ wrefresh(dialog);
+ }
+ continue;
+ case KEY_HOME:
+ case CONTROL_A:
+ wmove(dialog, box_y, box_x);
+ if (scrlx != 0) {
+ scrlx = 0;
+ for (i = 0; i < box_width; i++)
+ waddch(dialog, instr[i] ? instr[i] : ' ');
+ }
+ input_x = 0;
+ wmove(dialog, box_y, box_x);
+ wrefresh(dialog);
+ break;
+ case CONTROL_D:
+ if (input_x + scrlx < len) {
+ memmove(instr + scrlx + input_x,
+ instr + scrlx + input_x + 1,
+ len - (scrlx + input_x));
+ instr[--len] = '\0';
+ for (i = scrlx + input_x; i < len &&
+ i < scrlx + box_width; i++)
+ waddch(dialog, instr[i]);
+ if (i < scrlx + box_width)
+ waddch(dialog, ' ');
+ wmove(dialog, box_y, input_x + box_x);
+ wrefresh(dialog);
+ }
+ break;
+ case CONTROL_E:
+ case KEY_END:
+ if (box_width + scrlx < len) {
+ input_x = box_width - 1;
+ scrlx = len - box_width + 1;
+ wmove(dialog, box_y, box_x);
+ for (i = scrlx; i < scrlx + box_width; i++)
+ waddch(dialog, instr[i] ? instr[i] : ' ');
+ wmove(dialog, box_y, input_x + box_x);
+ wrefresh(dialog);
+ }
+ else {
+ input_x = len - scrlx;
+ wmove(dialog, box_y, input_x + box_x);
+ wrefresh(dialog);
+ }
+ break;
+ case CONTROL_K:
+ if (len) {
+ for (i = input_x; i < box_width; i++)
+ waddch(dialog, ' ');
+ for (i = scrlx + input_x; i < len; i++)
+ instr[i] = '\0';
+ len = scrlx + input_x;
+ wmove(dialog, box_y, box_x + input_x);
+ wrefresh(dialog);
+ }
+ break;
+ default:
+ if (key < 0x100 && isprint(key)) {
+ if (scrlx + input_x < sizeof(instr) - 1) {
+ wattrset(dialog, dialog_attr);
+ if (scrlx + input_x < len) {
+ memmove(instr + scrlx + input_x + 1,
+ instr + scrlx + input_x,
+ len - (scrlx + input_x));
+ }
+ instr[scrlx + input_x] = key;
+ instr[++len] = '\0';
+ if (input_x == box_width - 1) {
+ scrlx++;
+ wmove(dialog, box_y, box_x);
+ for (i = 0; i < box_width - 1; i++)
+ waddch(dialog, instr[scrlx + i]);
+ }
+ else {
+ wmove(dialog, box_y, input_x++ + box_x);
+ for (i = scrlx + input_x - 1; i < len &&
+ i < scrlx + box_width; i++)
+ waddch(dialog, instr[i]);
+ wmove(dialog, box_y, input_x + box_x);
+ }
+ wrefresh(dialog);
+ }
+ else
+ flash(); /* Alarm user about overflow */
+ continue;
+ }
+ }
+ }
+
+ switch (key) {
+ case KEY_UP:
+ case KEY_LEFT:
+ switch (button) {
+ case -1:
+ button = 1; /* Indicates "Cancel" button is selected */
+ PaintButton(dialog, label1, y, x1, FALSE);
+ PaintButton(dialog, label2, y, x2, TRUE);
+ wrefresh(dialog);
+ break;
+ case 0:
+ button = -1; /* Indicates input box is selected */
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ wmove(dialog, box_y, box_x + input_x);
+ wrefresh(dialog);
+ break;
+ case 1:
+ button = 0; /* Indicates "OK" button is selected */
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ wrefresh(dialog);
+ break;
+ }
+ break;
+ case TAB:
+ case KEY_DOWN:
+ case KEY_RIGHT:
+ switch (button) {
+ case -1:
+ button = 0; /* Indicates "OK" button is selected */
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ wrefresh(dialog);
+ break;
+ case 0:
+ button = 1; /* Indicates "Cancel" button is selected */
+ PaintButton(dialog, label1, y, x1, FALSE);
+ PaintButton(dialog, label2, y, x2, TRUE);
+ wrefresh(dialog);
+ break;
+ case 1:
+ button = -1; /* Indicates input box is selected */
+ PaintButton(dialog, label2, y, x2, FALSE);
+ PaintButton(dialog, label1, y, x1, TRUE);
+ wmove(dialog, box_y, box_x + input_x);
+ wrefresh(dialog);
+ break;
+ }
+ break;
+ case ' ':
+ case '\r':
+ case '\n':
+ delwin(dialog);
+ return (button != 1 ? XtNewString(instr) : NULL);
+ }
+ }
+}
diff --git a/hw/xfree86/utils/xorgcfg/up.xbm b/hw/xfree86/utils/xorgcfg/up.xbm
new file mode 100644
index 000000000..64f8f9ec4
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/up.xbm
@@ -0,0 +1,8 @@
+#define up_width 19
+#define up_height 19
+static unsigned char up_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x07, 0x00, 0x80, 0x0f, 0x00, 0xc0, 0x1f, 0x00, 0xe0, 0x3f, 0x00,
+ 0xf0, 0x7f, 0x00, 0xf8, 0xff, 0x00, 0xfc, 0xff, 0x01, 0x80, 0x0f, 0x00,
+ 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00, 0x80, 0x0f, 0x00,
+ 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/vidmode.c b/hw/xfree86/utils/xorgcfg/vidmode.c
new file mode 100644
index 000000000..d28ac0899
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/vidmode.c
@@ -0,0 +1,1357 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/vidmode.c,v 1.7 2001/07/07 23:00:43 paulo Exp $
+ */
+
+/*
+ * Most of the code here is based on the xvidtune code.
+ */
+
+#include "vidmode.h"
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/Repeater.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/SimpleMenP.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/Toggle.h>
+#include "xf86config.h"
+
+#define V_FLAG_MASK 0x1FF
+#define V_PHSYNC 0x001
+#define V_NHSYNC 0x002
+#define V_PVSYNC 0x004
+#define V_NVSYNC 0x008
+#define V_INTERLACE 0x010
+#define V_DBLSCAN 0x020
+#define V_CSYNC 0x040
+#define V_PCSYNC 0x080
+#define V_NCSYNC 0x100
+
+#define LEFT 0
+#define RIGHT 1
+#define UP 2
+#define DOWN 3
+#define WIDER 4
+#define TALLER 5
+#define NARROWER 6
+#define SHORTER 7
+
+#define HDISPLAY 0
+#define VDISPLAY 1
+#define HSYNCSTART 2
+#define HSYNCEND 3
+#define HTOTAL 4
+#define VSYNCSTART 5
+#define VSYNCEND 6
+#define VTOTAL 7
+#define FLAGS 8
+#define CLOCK 9
+#define HSYNC 10
+#define VSYNC 11
+
+#define MINMAJOR 2
+#define MINMINOR 0
+
+/*
+ * Types
+ */
+typedef struct {
+ char *ident;
+ XF86VidModeModeInfo info;
+} xf86cfgVesaModeInfo;
+
+/*
+ * Prototypes
+ */
+static Bool GetModeLine(Bool);
+static void StartAdjustMonitorCallback(Widget, XtPointer, XtPointer);
+static void AdjustMonitorCallback(Widget, XtPointer, XtPointer);
+static void EndAdjustMonitorCallback(Widget, XtPointer, XtPointer);
+static void SetLabel(int, int);
+static void UpdateSyncRates(Bool);
+static int VidmodeError(Display*, XErrorEvent*);
+static void CleanUp(Display*);
+static void ApplyCallback(Widget, XtPointer, XtPointer);
+static void AutoCallback(Widget, XtPointer, XtPointer);
+static void RestoreCallback(Widget, XtPointer, XtPointer);
+static void SelectCallback(Widget, XtPointer, XtPointer);
+static void SelectMonitorCallback(Widget, XtPointer, XtPointer);
+static void SwitchCallback(Widget, XtPointer, XtPointer);
+static void SetLabels(void);
+static void UpdateCallback(Widget, XtPointer, XtPointer);
+static void ChangeScreenCallback(Widget, XtPointer, XtPointer);
+static void SetLabelAndModeline(void);
+static void AddVesaModeCallback(Widget, XtPointer, XtPointer);
+static void GetModes(void);
+static void AddModeCallback(Widget, XtPointer, XtPointer);
+static void TestCallback(Widget, XtPointer, XtPointer);
+static void TestTimeout(XtPointer, XtIntervalId*);
+static void StopTestCallback(Widget, XtPointer, XtPointer);
+static int ForceAddMode(void);
+static int AddMode(void);
+/*
+ * Initialization
+ */
+extern Widget work;
+Widget vtune;
+static Widget apply, automatic, restore, mode, menu, screenb, screenp;
+static Bool autoflag;
+static xf86cfgVidmode *vidtune;
+static XF86VidModeModeLine modeline, orig_modeline;
+static int dot_clock, hsync_rate, vsync_rate, hitError;
+static Bool S3Specials;
+static int invert_vclk, blank1, blank2, early_sc, screenno;
+static int (*XtErrorFunc)(Display*, XErrorEvent*);
+static Widget labels[VSYNC + 1], values[VSYNC + 1], repeater, monitor,
+ monitorb, add, text, vesab, vesap, forceshell, testshell, addshell;
+static int MajorVersion, MinorVersion, EventBase, ErrorBase;
+static XtIntervalId timeout;
+
+/* The information bellow is extracted from
+ * xc/programs/Xserver/hw/xfree86/etc/vesamodes
+ * If that file is changed, please update the table bellow also. Or even
+ * better, write a script to generate the table.
+ */
+static xf86cfgVesaModeInfo vesamodes[] = {
+ {
+ "640x350 @ 85Hz (VESA) hsync: 37.9kHz",
+ {
+ 31500, 640, 672, 736, 832, 0, 350, 382, 385, 445,
+ V_PHSYNC | V_NVSYNC
+ }
+ },
+ {
+ "640x400 @ 85Hz (VESA) hsync: 37.9kHz",
+ {
+ 31500, 640, 672, 736, 832, 0, 400, 401, 404, 445,
+ V_NHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "720x400 @ 85Hz (VESA) hsync: 37.9kHz",
+ {
+ 35500, 720, 756, 828, 936, 0, 400, 401, 404, 446,
+ V_NHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "640x480 @ 60Hz (Industry standard) hsync: 31.5kHz",
+ {
+ 25200, 640, 656, 752, 800, 0, 480, 490, 492, 525,
+ V_NHSYNC | V_NVSYNC
+ }
+ },
+ {
+ "640x480 @ 72Hz (VESA) hsync: 37.9kHz",
+ {
+ 31500, 640, 664, 704, 832, 0, 480, 489, 491, 520,
+ V_NHSYNC | V_NVSYNC
+ }
+ },
+ {
+ "640x480 @ 75Hz (VESA) hsync: 37.5kHz",
+ {
+ 31500, 640, 656, 720, 840, 0, 480, 481, 484, 500,
+ V_NHSYNC | V_NVSYNC
+ }
+ },
+ {
+ "640x480 @ 85Hz (VESA) hsync: 43.3kHz",
+ {
+ 36000, 640, 696, 752, 832, 0, 480, 481, 484, 509,
+ V_NHSYNC | V_NVSYNC
+ }
+ },
+ {
+ "800x600 @ 56Hz (VESA) hsync: 35.2kHz",
+ {
+ 36000, 800, 824, 896, 1024, 0, 600, 601, 603, 625,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "800x600 @ 60Hz (VESA) hsync: 37.9kHz",
+ {
+ 400000, 800, 840, 968, 1056, 0, 600, 601, 605, 628,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "800x600 @ 72Hz (VESA) hsync: 48.1kHz",
+ {
+ 50000, 800, 856, 976, 1040, 0, 600, 637, 643, 666,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "800x600 @ 75Hz (VESA) hsync: 46.9kHz",
+ {
+ 49500, 800, 816, 896, 1056, 0, 600, 601, 604, 625,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "800x600 @ 85Hz (VESA) hsync: 53.7kHz",
+ {
+ 563000, 800, 832, 896, 1048, 0, 600, 601, 604, 631,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1024x768i @ 43Hz (industry standard) hsync: 35.5kHz",
+ {
+ 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 776, 817,
+ V_PHSYNC | V_PVSYNC | V_INTERLACE
+ }
+ },
+ {
+ "1024x768 @ 60Hz (VESA) hsync: 48.4kHz",
+ {
+ 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806,
+ V_NHSYNC | V_NVSYNC
+ }
+ },
+ {
+ "1024x768 @ 70Hz (VESA) hsync: 56.5kHz",
+ {
+ 75000, 1024, 1048, 1184, 1328, 0, 768, 771, 777, 806,
+ V_NHSYNC | V_NVSYNC
+ }
+ },
+ {
+ "1024x768 @ 75Hz (VESA) hsync: 60.0kHz",
+ {
+ 78800, 1024, 1040, 1136, 1312, 0, 768, 769, 772, 800,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1024x768 @ 85Hz (VESA) hsync: 68.7kHz",
+ {
+ 94500, 1024, 1072, 1168, 1376, 0, 768, 769, 772, 808,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1152x864 @ 75Hz (VESA) hsync: 67.5kHz",
+ {
+ 108000, 1152, 1216, 1344, 1600, 0, 864, 865, 868, 900,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1280x960 @ 60Hz (VESA) hsync: 60.0kHz",
+ {
+ 108000, 1280, 1376, 1488, 1800, 0, 960, 961, 964, 1000,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1280x960 @ 85Hz (VESA) hsync: 85.9kHz",
+ {
+ 148500, 1280, 1344, 1504, 1728, 0, 960, 961, 964, 1011,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1280x1024 @ 60Hz (VESA) hsync: 64.0kHz",
+ {
+ 108000, 1280, 1328, 1440, 1688, 0, 1024, 1025, 1028, 1066,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1280x1024 @ 75Hz (VESA) hsync: 80.0kHz",
+ {
+ 135000, 1280, 1296, 1440, 1688, 0, 1024, 1025, 1028, 1066,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1280x1024 @ 85Hz (VESA) hsync: 91.1kHz",
+ {
+ 157500, 1280, 1344, 1504, 1728, 0, 1024, 1025, 1028, 1072,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1600x1200 @ 60Hz (VESA) hsync: 75.0kHz",
+ {
+ 162000, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1600x1200 @ 65Hz (VESA) hsync: 81.3kHz",
+ {
+ 175500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1600x1200 @ 70Hz (VESA) hsync: 87.5kHz",
+ {
+ 189000, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1600x1200 @ 75Hz (VESA) hsync: 93.8kHz",
+ {
+ 202500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1600x1200 @ 85Hz (VESA) hsync: 106.3kHz",
+ {
+ 229500, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250,
+ V_PHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1792x1344 @ 60Hz (VESA) hsync: 83.6kHz",
+ {
+ 204800, 1792, 1920, 2120, 2448, 0, 1344, 1345, 1348, 1394,
+ V_NHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1792x1344 @ 75Hz (VESA) hsync: 106.3kHz",
+ {
+ 261000, 1792, 1888, 2104, 2456, 0, 1344, 1345, 1348, 1417,
+ V_NHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1856x1392 @ 60Hz (VESA) hsync: 86.3kHz",
+ {
+ 218300, 1856, 1952, 2176, 2528, 0, 1392, 1393, 1396, 1439,
+ V_NHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1856x1392 @ 75Hz (VESA) hsync: 112.5kHz",
+ {
+ 288000, 1856, 1984, 2208, 2560, 0, 1392, 1393, 1396, 1500,
+ V_NHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1920x1440 @ 60Hz (VESA) hsync: 90.0kHz",
+ {
+ 234000, 1920, 2048, 2256, 2600, 0, 1440, 1441, 1444, 1500,
+ V_NHSYNC | V_PVSYNC
+ }
+ },
+ {
+ "1920x1440 @ 75Hz (VESA) hsync: 112.5kHz",
+ {
+ 297000, 1920, 2064, 2288, 2640, 0, 1440, 1441, 1444, 1500,
+ V_NHSYNC | V_PVSYNC
+ }
+ },
+};
+
+/*
+ * Implementation
+ */
+Bool
+VideoModeInitialize(void)
+{
+ Widget form;
+ char dispstr[128], *ptr, *tmp;
+
+ static char *names[] = {
+ NULL,
+ NULL,
+ "hsyncstart",
+ "hsyncend",
+ "htotal",
+ "vsyncstart",
+ "vsyncend",
+ "vtotal",
+ "flags",
+ "clock",
+ "hsync",
+ "vsync",
+ };
+ static char *vnames[] = {
+ NULL,
+ NULL,
+ "v-hsyncstart",
+ "v-hsyncend",
+ "v-htotal",
+ "v-vsyncstart",
+ "v-vsyncend",
+ "v-vtotal",
+ "v-flags",
+ "v-clock",
+ "v-hsync",
+ "v-vsync",
+ };
+ Widget rep;
+ int i;
+
+ if (!XF86VidModeQueryVersion(XtDisplay(toplevel),
+ &MajorVersion, &MinorVersion)) {
+ fprintf(stderr, "Unable to query video extension version\n");
+ return (False);
+ }
+ else if (!XF86VidModeQueryExtension(XtDisplay(toplevel),
+ &EventBase, &ErrorBase)) {
+ fprintf(stderr, "Unable to query video extension information\n");
+ return (False);
+ }
+ else if (MajorVersion < MINMAJOR ||
+ (MajorVersion == MINMAJOR && MinorVersion < MINMINOR)) {
+ fprintf(stderr,
+ "Xserver is running an old XFree86-VidModeExtension version"
+ " (%d.%d)\n", MajorVersion, MinorVersion);
+ fprintf(stderr, "Minimum required version is %d.%d\n",
+ MINMAJOR, MINMINOR);
+ return (False);
+ }
+ else
+ InitializeVidmodes();
+
+ vtune = XtCreateWidget("vidtune", formWidgetClass,
+ work, NULL, 0);
+
+ vesab = XtVaCreateManagedWidget("vesaB", menuButtonWidgetClass, vtune,
+ XtNmenuName, "vesaP", NULL, 0);
+ vesap = XtCreatePopupShell("vesaP", simpleMenuWidgetClass, vtune, NULL, 0);
+ for (i = 0; i < sizeof(vesamodes) / sizeof(vesamodes[0]); i++) {
+ rep = XtCreateManagedWidget(vesamodes[i].ident, smeBSBObjectClass,
+ vesap, NULL, 0);
+ XtAddCallback(rep, XtNcallback, AddVesaModeCallback,
+ (XtPointer)&vesamodes[i]);
+ }
+
+ rep = XtCreateManagedWidget("prev", commandWidgetClass, vtune, NULL, 0);
+ XtAddCallback(rep, XtNcallback, SwitchCallback, (XtPointer)-1);
+ mode = XtCreateManagedWidget("mode", menuButtonWidgetClass, vtune, NULL, 0);
+ rep = XtCreateManagedWidget("next", commandWidgetClass, vtune, NULL, 0);
+ XtAddCallback(rep, XtNcallback, SwitchCallback, (XtPointer)1);
+
+ screenp = XtCreatePopupShell("screenP", simpleMenuWidgetClass, vtune,
+ NULL, 0);
+
+ XmuSnprintf(dispstr, sizeof(dispstr), "%s",
+ DisplayString(XtDisplay(toplevel)));
+ ptr = strrchr(dispstr, '.');
+ tmp = strrchr(dispstr, ':');
+ if (tmp != NULL && ptr != NULL && ptr > tmp)
+ *ptr = '\0';
+
+ for (i = 0; i < ScreenCount(XtDisplay(toplevel)); i++) {
+ char name[128];
+
+ XmuSnprintf(name, sizeof(name), "%s.%d", dispstr, i);
+ rep = XtCreateManagedWidget(name, smeBSBObjectClass, screenp,
+ NULL, 0);
+ XtAddCallback(rep, XtNcallback, ChangeScreenCallback,
+ (XtPointer)(long)i);
+ if (i == 0) {
+ screenb = XtVaCreateManagedWidget("screenB", menuButtonWidgetClass,
+ vtune,
+ XtNmenuName, "screenP",
+ XtNlabel, name,
+ NULL, 0);
+ }
+ }
+ XtRealizeWidget(screenp);
+
+ rep = XtCreateManagedWidget("up", repeaterWidgetClass,
+ vtune, NULL, 0);
+ XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
+ XtAddCallback(rep, XtNcallback,
+ AdjustMonitorCallback, (XtPointer)UP);
+ XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
+ rep = XtCreateManagedWidget("left", repeaterWidgetClass,
+ vtune, NULL, 0);
+ XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
+ XtAddCallback(rep, XtNcallback,
+ AdjustMonitorCallback, (XtPointer)LEFT);
+ XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
+ XtCreateManagedWidget("monitor", simpleWidgetClass, vtune, NULL, 0);
+ rep = XtCreateManagedWidget("right", repeaterWidgetClass,
+ vtune, NULL, 0);
+ XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
+ XtAddCallback(rep, XtNcallback,
+ AdjustMonitorCallback, (XtPointer)RIGHT);
+ XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
+ rep = XtCreateManagedWidget("down", repeaterWidgetClass,
+ vtune, NULL, 0);
+ XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
+ XtAddCallback(rep, XtNcallback,
+ AdjustMonitorCallback, (XtPointer)DOWN);
+ XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
+ rep = XtCreateManagedWidget("wider", repeaterWidgetClass,
+ vtune, NULL, 0);
+ XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
+ XtAddCallback(rep, XtNcallback,
+ AdjustMonitorCallback, (XtPointer)WIDER);
+ XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
+ rep = XtCreateManagedWidget("narrower", repeaterWidgetClass,
+ vtune, NULL, 0);
+ XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
+ XtAddCallback(rep, XtNcallback,
+ AdjustMonitorCallback, (XtPointer)NARROWER);
+ XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
+ rep = XtCreateManagedWidget("shorter", repeaterWidgetClass,
+ vtune, NULL, 0);
+ XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
+ XtAddCallback(rep, XtNcallback,
+ AdjustMonitorCallback, (XtPointer)SHORTER);
+ XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
+ rep = XtCreateManagedWidget("taller", repeaterWidgetClass,
+ vtune, NULL, 0);
+ XtAddCallback(rep, XtNstartCallback, StartAdjustMonitorCallback, NULL);
+ XtAddCallback(rep, XtNcallback,
+ AdjustMonitorCallback, (XtPointer)TALLER);
+ XtAddCallback(rep, XtNstopCallback, EndAdjustMonitorCallback, NULL);
+
+ automatic = XtCreateManagedWidget("auto", toggleWidgetClass, vtune, NULL, 0);
+ XtAddCallback(automatic, XtNcallback, AutoCallback, NULL);
+ apply = XtCreateManagedWidget("apply", commandWidgetClass, vtune, NULL, 0);
+ XtAddCallback(apply, XtNcallback, ApplyCallback, NULL);
+ restore = XtCreateManagedWidget("restore", commandWidgetClass, vtune, NULL, 0);
+ XtAddCallback(restore, XtNcallback, RestoreCallback, NULL);
+ rep = XtCreateManagedWidget("update", commandWidgetClass, vtune, NULL, 0);
+ XtAddCallback(rep, XtNcallback, UpdateCallback, NULL);
+ rep = XtCreateManagedWidget("test", commandWidgetClass, vtune, NULL, 0);
+ XtAddCallback(rep, XtNcallback, TestCallback, NULL);
+
+ form = XtCreateManagedWidget("form", formWidgetClass, vtune, NULL, 0);
+ for (i = 2; i < VSYNC + 1; i++) {
+ labels[i] = XtCreateManagedWidget(names[i], labelWidgetClass,
+ form, NULL, 0);
+ values[i] = XtCreateManagedWidget(vnames[i], labelWidgetClass,
+ form, NULL, 0);
+ }
+
+ add = XtCreateManagedWidget("add", commandWidgetClass, vtune, NULL, 0);
+ XtAddCallback(add, XtNcallback, AddModeCallback, NULL);
+ XtCreateManagedWidget("addto", labelWidgetClass, vtune, NULL, 0);
+ monitorb = XtCreateManagedWidget("ident", menuButtonWidgetClass, vtune,
+ NULL, 0);
+ XtCreateManagedWidget("as", labelWidgetClass, vtune, NULL, 0);
+ text = XtVaCreateManagedWidget("text", asciiTextWidgetClass, vtune,
+ XtNeditType, XawtextEdit, NULL, 0);
+
+ XtRealizeWidget(vtune);
+
+ return (True);
+}
+
+void
+InitializeVidmodes(void)
+{
+ int i;
+ Display *display = XtDisplay(toplevel);
+
+ computer.num_vidmodes = ScreenCount(display);
+ computer.vidmodes = (xf86cfgVidmode**)
+ XtMalloc(sizeof(xf86cfgVidmode*) * computer.num_vidmodes);
+ for (i = 0; i < computer.num_vidmodes; i++) {
+
+ computer.vidmodes[i] = (xf86cfgVidmode*)
+ XtCalloc(1, sizeof(xf86cfgVidmode));
+ computer.vidmodes[i]->screen = i;
+ }
+}
+
+void
+VideoModeConfigureStart(void)
+{
+ vidtune = computer.vidmodes[screenno];
+
+ XtSetSensitive(vtune, vidtune != NULL);
+ if (!XtIsManaged(vtune))
+ XtManageChild(vtune);
+ else
+ XtMapWidget(vtune);
+ if (vidtune != NULL) {
+ Arg args[1];
+ Boolean state;
+ XF86ConfMonitorPtr mon;
+ static char menuName[16];
+ static int menuN;
+
+ XtErrorFunc = XSetErrorHandler(VidmodeError);
+ XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
+ GetModeLine(True);
+ GetModes();
+
+ SetLabels();
+ XtSetArg(args[0], XtNstate, &state);
+ XtGetValues(automatic, args, 1);
+ XtSetSensitive(apply, !state);
+ autoflag = state;
+
+ if (monitor)
+ XtDestroyWidget(monitor);
+ XmuSnprintf(menuName, sizeof(menuName), "menuP%d", menuN);
+ menuN = !menuN;
+ monitor = XtCreatePopupShell(menuName, simpleMenuWidgetClass,
+ vtune, NULL, 0);
+ XtVaSetValues(monitorb, XtNmenuName, menuName, NULL, 0);
+
+ mon = XF86Config->conf_monitor_lst;
+ while (mon != NULL) {
+ Widget sme = XtCreateManagedWidget(mon->mon_identifier,
+ smeBSBObjectClass,
+ monitor, NULL, 0);
+ XtAddCallback(sme, XtNcallback,
+ SelectMonitorCallback, (XtPointer)mon);
+
+ /* guess the monitor at a given screen and/or
+ * updates configuration if a monitor was removed from the
+ * configuration.
+ */
+ if (XF86Config->conf_layout_lst) {
+ XF86ConfAdjacencyPtr adj = XF86Config->conf_layout_lst->
+ lay_adjacency_lst;
+
+ while (adj != NULL) {
+ if (adj->adj_screen != NULL) {
+ if (adj->adj_screen->scrn_monitor == mon &&
+ adj->adj_scrnum >= 0 &&
+ adj->adj_scrnum < ScreenCount(XtDisplay(toplevel))) {
+ if (computer.vidmodes[adj->adj_scrnum]->monitor ==
+ NULL || computer.vidmodes[adj->adj_scrnum]->
+ monitor == adj->adj_screen->scrn_monitor) {
+ computer.vidmodes[adj->adj_scrnum]->monitor =
+ adj->adj_screen->scrn_monitor;
+ break;
+ }
+ else
+ computer.vidmodes[adj->adj_scrnum]->monitor =
+ NULL;
+ }
+ }
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+ }
+ mon = (XF86ConfMonitorPtr)(mon->list.next);
+ }
+ SetLabelAndModeline();
+ }
+}
+
+void
+VideoModeConfigureEnd(void)
+{
+ XtUnmapWidget(vtune);
+ if (vidtune != NULL) {
+ XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, False);
+ XSetErrorHandler(XtErrorFunc);
+ }
+ vidtune = NULL;
+}
+
+static void
+SetLabelAndModeline(void)
+{
+ if (vidtune->monitor != NULL) {
+ char string[32];
+
+ XtVaSetValues(monitorb, XtNlabel,
+ vidtune->monitor->mon_identifier, NULL);
+ XtSetSensitive(add, True);
+
+ if (modeline.htotal && modeline.vtotal)
+ XmuSnprintf(string, sizeof(string), "%dx%d@%d",
+ modeline.hdisplay, modeline.vdisplay,
+ (int)((double)dot_clock / (double)modeline.htotal * 1000.0 /
+ (double)modeline.vtotal));
+ else
+ XmuSnprintf(string, sizeof(string), "%dx%d",
+ modeline.hdisplay, modeline.vdisplay);
+ XtVaSetValues(text, XtNstring, string, NULL);
+ }
+ else {
+ XtVaSetValues(monitorb, XtNlabel, "", NULL);
+ XtSetSensitive(add, False);
+ XtVaSetValues(text, XtNstring, "", NULL);
+ }
+}
+
+/*ARGSUSED*/
+void
+VidmodeRestoreAction(Widget w, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ if (vidtune != NULL) {
+ if (timeout != 0)
+ StopTestCallback(w, NULL, NULL);
+ else
+ RestoreCallback(w, NULL, NULL);
+ }
+}
+
+static void
+UpdateSyncRates(Bool update)
+{
+ if (modeline.htotal && modeline.vtotal) {
+ hsync_rate = (dot_clock * 1000) / modeline.htotal;
+ vsync_rate = (hsync_rate * 1000) / modeline.vtotal;
+ if (modeline.flags & V_INTERLACE)
+ vsync_rate *= 2;
+ else if (modeline.flags & V_DBLSCAN)
+ vsync_rate /= 2;
+ if (update) {
+ SetLabel(HSYNC, hsync_rate);
+ SetLabel(VSYNC, vsync_rate);
+ }
+ }
+}
+
+static void
+SetLabel(int ident, int value)
+{
+ Arg args[1];
+ char label[256];
+
+ if (ident == FLAGS) {
+ int len = 0;
+
+ *label = '\0';
+ if (value & V_PHSYNC)
+ len += XmuSnprintf(label, sizeof(label), "%s", "+hsync");
+ if (modeline.flags & V_NHSYNC)
+ len += XmuSnprintf(label + len, sizeof(label), "%s%s",
+ len ? " " : "", "-hsync");
+ if (value & V_PVSYNC)
+ len += XmuSnprintf(label + len, sizeof(label), "%s%s",
+ len ? " " : "", "+vsync");
+ if (value & V_NVSYNC)
+ len += XmuSnprintf(label + len, sizeof(label), "%s%s",
+ len ? " " : "", "-vsync");
+ if (value & V_INTERLACE)
+ len += XmuSnprintf(label + len, sizeof(label), "%s%s",
+ len ? " " : "", "interlace");
+ if (value & V_CSYNC)
+ len += XmuSnprintf(label + len, sizeof(label), "%s%s",
+ len ? " " : "", "composite");
+ if (value & V_PCSYNC)
+ len += XmuSnprintf(label + len, sizeof(label), "%s%s",
+ len ? " " : "", "+csync");
+ if (value & V_NCSYNC)
+ len += XmuSnprintf(label + len, sizeof(label), "%s%s",
+ len ? " " : "", "-csync");
+ if (value & V_DBLSCAN)
+ len += XmuSnprintf(label + len, sizeof(label), "%s%s",
+ len ? " " : "", "doublescan");
+
+ }
+ else if (ident == CLOCK || ident == HSYNC || ident == VSYNC)
+ XmuSnprintf(label, sizeof(label), "%6.2f", (float)value / 1000.0);
+ else
+ XmuSnprintf(label, sizeof(label), "%d", value);
+
+ XtSetArg(args[0], XtNlabel, label);
+ XtSetValues(values[ident], args, 1);
+}
+
+/*ARGSUSED*/
+static void
+StartAdjustMonitorCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+ repeater = w;
+}
+
+static void
+AdjustMonitorCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+ if (repeater != w)
+ return;
+ switch ((long)client_data) {
+ case LEFT:
+ if (modeline.hsyncend + 4 < modeline.htotal) {
+ modeline.hsyncstart += 4;
+ modeline.hsyncend += 4;
+ SetLabel(HSYNCSTART, modeline.hsyncstart);
+ SetLabel(HSYNCEND, modeline.hsyncend);
+ }
+ else
+ XBell(XtDisplay(w), 80);
+ break;
+ case RIGHT:
+ if (modeline.hsyncstart - 4 > modeline.hdisplay) {
+ modeline.hsyncstart -= 4;
+ modeline.hsyncend -= 4;
+ SetLabel(HSYNCSTART, modeline.hsyncstart);
+ SetLabel(HSYNCEND, modeline.hsyncend);
+ }
+ else
+ XBell(XtDisplay(w), 80);
+ break;
+ case NARROWER:
+ modeline.htotal += 4;
+ SetLabel(HTOTAL, modeline.htotal);
+ UpdateSyncRates(True);
+ break;
+ case WIDER:
+ if (modeline.htotal - 4 > modeline.hsyncend) {
+ modeline.htotal -= 4;
+ SetLabel(HTOTAL, modeline.htotal);
+ UpdateSyncRates(True);
+ }
+ else
+ XBell(XtDisplay(w), 80);
+ break;
+ case UP:
+ if (modeline.vsyncend + 4 < modeline.vtotal) {
+ modeline.vsyncstart += 4;
+ modeline.vsyncend += 4;
+ SetLabel(VSYNCSTART, modeline.vsyncstart);
+ SetLabel(VSYNCEND, modeline.vsyncend);
+ }
+ else
+ XBell(XtDisplay(w), 80);
+ break;
+ case DOWN:
+ if (modeline.vsyncstart - 4 > modeline.vdisplay) {
+ modeline.vsyncstart -= 4;
+ modeline.vsyncend -= 4;
+ SetLabel(VSYNCSTART, modeline.vsyncstart);
+ SetLabel(VSYNCEND, modeline.vsyncend);
+ }
+ else
+ XBell(XtDisplay(w), 80);
+ break;
+ case SHORTER:
+ modeline.vtotal += 4;
+ SetLabel(VTOTAL, modeline.vtotal);
+ UpdateSyncRates(True);
+ break;
+ case TALLER:
+ if (modeline.vtotal - 4 > modeline.vsyncend) {
+ modeline.vtotal -= 4;
+ SetLabel(VTOTAL, modeline.vtotal);
+ UpdateSyncRates(True);
+ }
+ else
+ XBell(XtDisplay(w), 80);
+ break;
+ }
+
+ if (autoflag)
+ ApplyCallback(w, call_data, client_data);
+}
+
+/*ARGSUSED*/
+static void
+EndAdjustMonitorCallback(Widget w, XtPointer client_data, XtPointer call_data)
+{
+ repeater = NULL;
+}
+
+static Bool
+GetModeLine(Bool save)
+{
+ if (XF86VidModeGetModeLine(XtDisplay(toplevel), vidtune->screen,
+ &dot_clock, &modeline)) {
+ if (save)
+ memcpy(&orig_modeline, &modeline, sizeof(XF86VidModeModeLine));
+ UpdateSyncRates(False);
+ if (modeline.privsize != 0 && modeline.private != NULL) {
+ S3Specials = True;
+ invert_vclk = modeline.private[1];
+ blank1 = modeline.private[2] & 7;
+ blank2 = (modeline.private[2] >> 4) & 7;
+ early_sc = modeline.private[3];
+ }
+ else
+ S3Specials = False;
+ return (True);
+ }
+
+ return (False);
+}
+
+static void
+CleanUp(Display *display)
+{
+ /* Make sure mode switching is not locked out at exit */
+ XF86VidModeLockModeSwitch(display, vidtune->screen, False);
+ XFlush(display);
+}
+
+static int
+VidmodeError(Display *display, XErrorEvent *error)
+{
+ if ((error->error_code >= ErrorBase &&
+ error->error_code < ErrorBase + XF86VidModeNumberErrors) ||
+ error->error_code == BadValue) {
+ hitError = 1;
+ }
+ else {
+ CleanUp(display);
+ if (XtErrorFunc)
+ (*XtErrorFunc)(display, error);
+ }
+ return (0);
+}
+
+/*ARGSUSED*/
+static void
+ApplyCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ hitError = 0;
+ XF86VidModeModModeLine(XtDisplay(w), vidtune->screen, &modeline);
+ XSync(XtDisplay(w), False);
+ if (hitError) {
+ if (repeater != NULL) {
+ XtCallActionProc(repeater, "unset", NULL, NULL, 0);
+ XtCallActionProc(repeater, "stop", NULL, NULL, 0);
+ repeater = NULL;
+ }
+ XBell(XtDisplay(w), 80);
+ if (timeout)
+ StopTestCallback(w, NULL, NULL);
+ GetModeLine(False);
+ SetLabels();
+ }
+}
+
+/*ARGSUSED*/
+static void
+AutoCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ autoflag = (Bool)(long)client_data;
+ XtSetSensitive(apply, !autoflag);
+}
+
+static void
+RestoreCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ memcpy(&modeline, &orig_modeline, sizeof(XF86VidModeModeLine));
+ if (autoflag)
+ ApplyCallback(w, call_data, client_data);
+ SetLabels();
+}
+
+static void
+SelectCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ XF86VidModeModeInfo *info = (XF86VidModeModeInfo*)call_data;
+ Arg args[1];
+ Bool result;
+
+ XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, False);
+ result = XF86VidModeSwitchToMode(XtDisplay(toplevel), vidtune->screen, info);
+ XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
+ if (!result)
+ return;
+
+ XtSetArg(args[0], XtNlabel, XtName(w));
+ XtSetValues(mode, args, 1);
+ UpdateCallback(w, call_data, client_data);
+}
+
+static void
+SwitchCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ int direction = (long)call_data;
+ Arg args[1];
+ Bool result;
+ char label[32];
+
+ XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, False);
+ result = XF86VidModeSwitchMode(XtDisplay(toplevel), vidtune->screen,
+ direction);
+ XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
+ if (!result)
+ return;
+
+ UpdateCallback(w, call_data, client_data);
+
+ if (modeline.htotal && modeline.vtotal)
+ XmuSnprintf(label, sizeof(label), "%dx%d @ %d Hz",
+ modeline.hdisplay, modeline.vdisplay,
+ (int)((double)dot_clock / (double)modeline.htotal * 1000.0 /
+ (double)modeline.vtotal));
+ else
+ XmuSnprintf(label, sizeof(label), "%dx%d",
+ modeline.hdisplay, modeline.vdisplay);
+ XtSetArg(args[0], XtNlabel, label);
+ XtSetValues(mode, args, 1);
+}
+
+/*ARGSUSED*/
+static void
+UpdateCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ GetModeLine(True);
+ SetLabels();
+ SetLabelAndModeline();
+}
+
+static void
+SetLabels(void)
+{
+ SetLabel(HSYNCSTART, modeline.hsyncstart);
+ SetLabel(VSYNCSTART, modeline.vsyncstart);
+ SetLabel(HSYNCEND, modeline.hsyncend);
+ SetLabel(VSYNCEND, modeline.vsyncend);
+ SetLabel(HTOTAL, modeline.htotal);
+ SetLabel(VTOTAL, modeline.vtotal);
+ SetLabel(FLAGS, modeline.flags);
+ SetLabel(CLOCK, dot_clock);
+ UpdateSyncRates(True);
+}
+
+/*ARGSUSED*/
+static void
+ChangeScreenCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ Arg args[1];
+
+ screenno = (long)call_data;
+ if (screenno > computer.num_vidmodes || screenno < 0 ||
+ vidtune == computer.vidmodes[screenno])
+ return;
+
+ XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, False);
+ vidtune = computer.vidmodes[screenno];
+ XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
+ UpdateCallback(w, call_data, client_data);
+ GetModes();
+
+ XtSetArg(args[0], XtNlabel, XtName(w));
+ XtSetValues(screenb, args, 1);
+
+ SetLabelAndModeline();
+}
+
+/*ARGSUSED*/
+static void
+SelectMonitorCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ vidtune->monitor = (XF86ConfMonitorPtr)(call_data);
+ SetLabelAndModeline();
+}
+
+/*ARGSUSED*/
+static void
+AddVesaModeCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ xf86cfgVesaModeInfo *vesa = (xf86cfgVesaModeInfo*)call_data;
+ XF86VidModeModeInfo mode;
+ int num_infos = vidtune->num_infos;
+
+ memcpy(&mode, &vesa->info, sizeof(XF86VidModeModeInfo));
+ if (XF86VidModeAddModeLine(XtDisplay(toplevel), vidtune->screen,
+ &vesa->info, &mode)) {
+ XSync(XtDisplay(toplevel), False);
+ GetModes();
+ }
+ else {
+ XBell(XtDisplayOfObject(w), 80);
+ return;
+ }
+
+ if (vidtune && num_infos == vidtune->num_infos) {
+ /* XF86VidModeAddModeLine returned True, but no modeline was added */
+ XBell(XtDisplayOfObject(w), 80);
+ if (vidtune->monitor && AddMode()) {
+ XF86ConfModeLinePtr mode;
+ char label[256], *ptr, *str;
+
+ XmuSnprintf(label, sizeof(label), "%s", vesa->ident);
+
+ /* format mode name to not have spaces */
+ ptr = strchr(label, ')');
+ if (ptr)
+ *++ptr = '\0';
+ ptr = str = label;
+ while (*ptr) {
+ if (*ptr != ' ')
+ *str++ = *ptr;
+ ++ptr;
+ }
+ *str = '\0';
+
+ if (xf86findModeLine(label, vidtune->monitor->mon_modeline_lst)
+ != NULL && !ForceAddMode())
+ return;
+
+ mode = (XF86ConfModeLinePtr)XtCalloc(1, sizeof(XF86ConfModeLineRec));
+ mode->ml_identifier = XtNewString(label);
+ mode->ml_clock = vesa->info.dotclock;
+ mode->ml_hdisplay = vesa->info.hdisplay;
+ mode->ml_hsyncstart = vesa->info.hsyncstart;
+ mode->ml_hsyncend = vesa->info.hsyncend;
+ mode->ml_htotal = vesa->info.htotal;
+ mode->ml_vdisplay = vesa->info.vdisplay;
+ mode->ml_vsyncstart = vesa->info.vsyncstart;
+ mode->ml_vsyncend = vesa->info.vsyncend;
+ mode->ml_vtotal = vesa->info.vtotal;
+/* mode->ml_vscan = ???;*/
+ mode->ml_flags = vesa->info.flags;
+ mode->ml_hskew = vesa->info.hskew;
+ vidtune->monitor->mon_modeline_lst =
+ xf86addModeLine(vidtune->monitor->mon_modeline_lst, mode);
+ }
+ }
+}
+
+static void
+GetModes(void)
+{
+ int i;
+ char label[32];
+ Arg args[1];
+ static char menuName[16];
+ static int menuN;
+
+ XFree(vidtune->infos);
+ XF86VidModeGetAllModeLines(XtDisplay(toplevel), vidtune->screen,
+ &vidtune->num_infos, &vidtune->infos);
+
+ XmuSnprintf(menuName, sizeof(menuName), "menu%d", menuN);
+ menuN = !menuN;
+ if (menu)
+ XtDestroyWidget(menu);
+ menu = XtCreatePopupShell(menuName, simpleMenuWidgetClass, vtune, NULL, 0);
+ XtVaSetValues(mode, XtNmenuName, menuName, NULL, 0);
+ for (i = 0; i < vidtune->num_infos; i++) {
+ Widget sme;
+
+ if ((double)vidtune->infos[i]->htotal &&
+ (double)vidtune->infos[i]->vtotal)
+ XmuSnprintf(label, sizeof(label), "%dx%d @ %d Hz",
+ vidtune->infos[i]->hdisplay,
+ vidtune->infos[i]->vdisplay,
+ (int)((double)vidtune->infos[i]->dotclock /
+ (double)vidtune->infos[i]->htotal * 1000.0 /
+ (double)vidtune->infos[i]->vtotal));
+ else
+ XmuSnprintf(label, sizeof(label), "%dx%d",
+ vidtune->infos[i]->hdisplay,
+ vidtune->infos[i]->vdisplay);
+ sme = XtCreateManagedWidget(label, smeBSBObjectClass, menu, NULL, 0);
+ XtAddCallback(sme, XtNcallback, SelectCallback,
+ (XtPointer)vidtune->infos[i]);
+ }
+
+ if (modeline.htotal && modeline.vtotal)
+ XmuSnprintf(label, sizeof(label), "%dx%d @ %d Hz",
+ modeline.hdisplay, modeline.vdisplay,
+ (int)((double)dot_clock / (double)modeline.htotal * 1000.0 /
+ (double)modeline.vtotal));
+ else
+ XmuSnprintf(label, sizeof(label), "%dx%d",
+ modeline.hdisplay, modeline.vdisplay);
+ XtSetArg(args[0], XtNlabel, label);
+ XtSetValues(mode, args, 1);
+}
+
+static int do_force, asking_force;
+
+static void
+PopdownForce(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ asking_force = 0;
+ XtPopdown(forceshell);
+ do_force = (long)user_data;
+}
+
+static int
+ForceAddMode(void)
+{
+ if (forceshell == NULL) {
+ Widget dialog;
+
+ forceshell = XtCreatePopupShell("force", transientShellWidgetClass,
+ toplevel, NULL, 0);
+ dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass,
+ forceshell, XtNvalue, NULL, NULL, 0);
+ XawDialogAddButton(dialog, "yes", PopdownForce, (XtPointer)True);
+ XawDialogAddButton(dialog, "no", PopdownForce, (XtPointer)False);
+ XtRealizeWidget(forceshell);
+ XSetWMProtocols(DPY, XtWindow(forceshell), &wm_delete_window, 1);
+ }
+
+ asking_force = 1;
+
+ XtPopup(forceshell, XtGrabExclusive);
+ while (asking_force)
+ XtAppProcessEvent(XtWidgetToApplicationContext(forceshell), XtIMAll);
+
+ return (do_force);
+}
+
+static int do_add, asking_add;
+
+static void
+PopdownAdd(Widget w, XtPointer user_data, XtPointer call_data)
+{
+ asking_add = 0;
+ XtPopdown(addshell);
+ do_add = (long)user_data;
+}
+
+void
+CancelAddModeAction(Widget w, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ if (asking_force)
+ PopdownForce(w, (XtPointer)False, NULL);
+ else if (asking_add)
+ PopdownAdd(w, (XtPointer)False, NULL);
+}
+
+static int
+AddMode(void)
+{
+ if (addshell == NULL) {
+ Widget dialog;
+
+ addshell = XtCreatePopupShell("addMode", transientShellWidgetClass,
+ toplevel, NULL, 0);
+ dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass,
+ addshell, XtNvalue, NULL, NULL, 0);
+ XawDialogAddButton(dialog, "yes", PopdownAdd, (XtPointer)True);
+ XawDialogAddButton(dialog, "no", PopdownAdd, (XtPointer)False);
+ XtRealizeWidget(addshell);
+ XSetWMProtocols(DPY, XtWindow(addshell), &wm_delete_window, 1);
+ }
+
+ asking_add = 1;
+
+ XtPopup(addshell, XtGrabExclusive);
+ while (asking_add)
+ XtAppProcessEvent(XtWidgetToApplicationContext(addshell), XtIMAll);
+
+ return (do_add);
+}
+
+/*ARGSUSED*/
+static void
+AddModeCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ if (vidtune && vidtune->monitor) {
+ char *label;
+ Arg args[1];
+ XF86ConfModeLinePtr mode;
+
+ XtSetArg(args[0], XtNstring, &label);
+ XtGetValues(text, args, 1);
+ if (*label == '\0') {
+ XBell(XtDisplay(w), 80);
+ return;
+ }
+ if (xf86findModeLine(label, vidtune->monitor->mon_modeline_lst)
+ != NULL && !ForceAddMode())
+ return;
+
+ mode = (XF86ConfModeLinePtr)XtCalloc(1, sizeof(XF86ConfModeLineRec));
+ mode->ml_identifier = XtNewString(label);
+ mode->ml_clock = dot_clock;
+ mode->ml_hdisplay = modeline.hdisplay;
+ mode->ml_hsyncstart = modeline.hsyncstart;
+ mode->ml_hsyncend = modeline.hsyncend;
+ mode->ml_htotal = modeline.htotal;
+ mode->ml_vdisplay = modeline.vdisplay;
+ mode->ml_vsyncstart = modeline.vsyncstart;
+ mode->ml_vsyncend = modeline.vsyncend;
+ mode->ml_vtotal = modeline.vtotal;
+/* mode->ml_vscan = ???;*/
+ mode->ml_flags = modeline.flags;
+ mode->ml_hskew = modeline.hskew;
+ vidtune->monitor->mon_modeline_lst =
+ xf86addModeLine(vidtune->monitor->mon_modeline_lst, mode);
+ }
+ else
+ XBell(XtDisplay(w), 80);
+}
+
+/*ARGSUSED*/
+static void
+StopTestCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ XtRemoveTimeOut(timeout);
+ TestTimeout((XtPointer)w, NULL);
+}
+
+/*ARGSUSED*/
+void
+CancelTestModeAction(Widget w, XEvent *event,
+ String *params, Cardinal *num_params)
+{
+ StopTestCallback(w, NULL, NULL);
+}
+
+static void
+TestTimeout(XtPointer client_data, XtIntervalId* id)
+{
+ XF86VidModeModeLine mode;
+
+ XtPopdown(testshell);
+ timeout = 0;
+ memcpy(&mode, &modeline, sizeof(XF86VidModeModeLine));
+ memcpy(&modeline, &orig_modeline, sizeof(XF86VidModeModeLine));
+ ApplyCallback((Widget)client_data, NULL, NULL);
+/* if (hitError == 0)*/
+ memcpy(&modeline, &mode, sizeof(XF86VidModeModeLine));
+ SetLabels();
+}
+
+static void
+TestCallback(Widget w, XtPointer call_data, XtPointer client_data)
+{
+ if (testshell == NULL) {
+ Widget dialog;
+
+ testshell = XtCreatePopupShell("test", transientShellWidgetClass,
+ toplevel, NULL, 0);
+ dialog = XtVaCreateManagedWidget("dialog", dialogWidgetClass,
+ testshell, XtNvalue, NULL, NULL, 0);
+ XawDialogAddButton(dialog, "stop", StopTestCallback, NULL);
+ XtRealizeWidget(testshell);
+ XSetWMProtocols(DPY, XtWindow(testshell), &wm_delete_window, 1);
+ }
+
+ XtPopup(testshell, XtGrabExclusive);
+
+ XSync(XtDisplay(toplevel), False);
+ timeout = XtAppAddTimeOut(XtWidgetToApplicationContext(w),
+ /* the timeout probably shoud be converted to a resource */
+ 4000, TestTimeout, (XtPointer)w);
+ ApplyCallback(w, call_data, client_data);
+}
diff --git a/hw/xfree86/utils/xorgcfg/vidmode.h b/hw/xfree86/utils/xorgcfg/vidmode.h
new file mode 100644
index 000000000..e445517cd
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/vidmode.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/vidmode.h,v 1.3 2001/07/07 23:00:43 paulo Exp $
+ */
+
+#ifndef _xf86cfg_vidmode_h
+#define _xf86cfg_vidmode_h
+
+#include "xf86config.h"
+#include <X11/extensions/xf86vmode.h>
+
+/*
+ * Types
+ */
+struct _xf86cfgVidMode {
+ XF86ConfMonitorPtr monitor;
+ int screen;
+ int num_infos;
+ XF86VidModeModeInfo **infos;
+};
+
+/*
+ * Prototypes
+ */
+Bool VideoModeInitialize(void);
+void VideoModeConfigureStart(void);
+void VideoModeConfigureEnd(void);
+void VidmodeRestoreAction(Widget, XEvent*, String*, Cardinal*);
+void CancelAddModeAction(Widget, XEvent*, String*, Cardinal*);
+void CancelTestModeAction(Widget, XEvent*, String*, Cardinal*);
+void InitializeVidmodes(void);
+
+/*
+ * Initialization
+ */
+extern Widget vtune;
+
+#endif /* _xf86cfg_vidmode_h */
diff --git a/hw/xfree86/utils/xorgcfg/wider.xbm b/hw/xfree86/utils/xorgcfg/wider.xbm
new file mode 100644
index 000000000..5cf87f25a
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/wider.xbm
@@ -0,0 +1,8 @@
+#define wider_width 19
+#define wider_height 19
+static unsigned char wider_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x08, 0x00, 0xc0, 0x18, 0x00,
+ 0xe0, 0x38, 0x00, 0xf0, 0x78, 0x00, 0xf8, 0xf8, 0x00, 0xfc, 0xff, 0x01,
+ 0xfe, 0xff, 0x03, 0xff, 0xff, 0x07, 0xfe, 0xff, 0x03, 0xfc, 0xff, 0x01,
+ 0xf8, 0xf8, 0x00, 0xf0, 0x78, 0x00, 0xe0, 0x38, 0x00, 0xc0, 0x18, 0x00,
+ 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/hw/xfree86/utils/xorgcfg/xf86config.c b/hw/xfree86/utils/xorgcfg/xf86config.c
new file mode 100644
index 000000000..b2b0b871c
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/xf86config.c
@@ -0,0 +1,980 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86config.c,v 1.5 2001/03/27 20:25:30 paulo Exp $
+ */
+
+#include "xf86config.h"
+
+/*
+ * Implementation
+ */
+int
+xf86removeOption(XF86OptionPtr *options, char *name)
+{
+ XF86OptionPtr opt = *options, prev = opt;
+
+ while (opt) {
+ if (strcasecmp(opt->opt_name, name) == 0) {
+ XtFree(opt->opt_name);
+ XtFree(opt->opt_val);
+ XtFree(opt->opt_comment);
+ if (opt == prev)
+ *options = (XF86OptionPtr)(opt->list.next);
+ else
+ prev->list.next = opt->list.next;
+ XtFree((XtPointer)opt);
+
+ return (True);
+ }
+
+ prev = opt;
+ opt = (XF86OptionPtr)(opt->list.next);
+ }
+
+ return (False);
+}
+
+int
+xf86removeInput(XF86ConfigPtr config, XF86ConfInputPtr input)
+{
+ XF86ConfInputPtr prev, inp = config->conf_input_lst;
+ XF86ConfLayoutPtr lay = config->conf_layout_lst;
+
+ /* remove from main structure */
+ prev = inp;
+ while (inp != NULL) {
+ if (inp == input) {
+ if (inp == prev)
+ config->conf_input_lst = (XF86ConfInputPtr)(inp->list.next);
+ else
+ prev->list.next = inp->list.next;
+ break;
+ }
+ prev = inp;
+ inp = (XF86ConfInputPtr)(inp->list.next);
+ }
+
+ if (inp == NULL)
+ return (False);
+
+ /* remove references */
+ while (lay != NULL) {
+ xf86removeInputRef(lay, inp);
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+
+ XtFree(inp->inp_identifier);
+ XtFree(inp->inp_driver);
+ XtFree(inp->inp_comment);
+ xf86optionListFree(inp->inp_option_lst);
+ XtFree((XtPointer)inp);
+
+ return (True);
+}
+
+int
+xf86removeInputRef(XF86ConfLayoutPtr layout, XF86ConfInputPtr input)
+{
+ XF86ConfInputrefPtr prev, iref = layout->lay_input_lst;
+
+ prev = iref;
+ while (iref != NULL) {
+ if (iref->iref_inputdev == input) {
+ XtFree(iref->iref_inputdev_str);
+ xf86optionListFree(iref->iref_option_lst);
+ if (prev == iref)
+ layout->lay_input_lst =
+ (XF86ConfInputrefPtr)(iref->list.next);
+ else
+ prev->list.next = iref->list.next;
+ XtFree((XtPointer)iref);
+
+ return (True);
+ }
+ prev = iref;
+ iref = (XF86ConfInputrefPtr)(iref->list.next);
+ }
+
+ return (False);
+}
+
+int
+xf86removeDevice(XF86ConfigPtr config, XF86ConfDevicePtr device)
+{
+ XF86ConfDevicePtr prev, dev = config->conf_device_lst;
+ XF86ConfScreenPtr psc, scr = config->conf_screen_lst;
+
+ /* remove from main structure */
+ prev = dev;
+ while (dev != NULL) {
+ if (dev == device) {
+ if (dev == prev)
+ config->conf_device_lst = (XF86ConfDevicePtr)(dev->list.next);
+ else
+ prev->list.next = dev->list.next;
+ break;
+ }
+ prev = dev;
+ dev = (XF86ConfDevicePtr)(dev->list.next);
+ }
+
+ if (dev == NULL)
+ return (False);
+
+ /* remove references */
+ psc = scr;
+ while (scr != NULL) {
+ if (scr->scrn_device == device) {
+ xf86removeScreen(config, scr);
+ if (scr == psc)
+ scr = psc = config->conf_screen_lst;
+ else
+ scr = psc;
+ continue;
+ }
+ psc = scr;
+ scr = (XF86ConfScreenPtr)(scr->list.next);
+ }
+
+ XtFree(dev->dev_identifier);
+ XtFree(dev->dev_vendor);
+ XtFree(dev->dev_board);
+ XtFree(dev->dev_chipset);
+ XtFree(dev->dev_busid);
+ XtFree(dev->dev_card);
+ XtFree(dev->dev_driver);
+ XtFree(dev->dev_ramdac);
+ XtFree(dev->dev_clockchip);
+ XtFree(dev->dev_comment);
+ xf86optionListFree(dev->dev_option_lst);
+ XtFree((XtPointer)dev);
+
+ return (True);
+}
+
+int
+xf86removeMonitor(XF86ConfigPtr config, XF86ConfMonitorPtr monitor)
+{
+ XF86ConfMonitorPtr prev, mon = config->conf_monitor_lst;
+ XF86ConfScreenPtr psc, scr = config->conf_screen_lst;
+
+ /* remove from main structure */
+ prev = mon;
+ while (mon != NULL) {
+ if (mon == monitor) {
+ if (mon == prev)
+ config->conf_monitor_lst = (XF86ConfMonitorPtr)(mon->list.next);
+ else
+ prev->list.next = mon->list.next;
+ break;
+ }
+ prev = mon;
+ mon = (XF86ConfMonitorPtr)(mon->list.next);
+ }
+
+ if (mon == NULL)
+ return (False);
+
+ /* remove references */
+ psc = scr;
+ while (scr != NULL) {
+ if (scr->scrn_monitor == monitor) {
+ xf86removeScreen(config, scr);
+ scr = psc = config->conf_screen_lst;
+ continue;
+ }
+ psc = scr;
+ scr = (XF86ConfScreenPtr)(scr->list.next);
+ }
+
+ XtFree(mon->mon_identifier);
+ XtFree(mon->mon_vendor);
+ XtFree(mon->mon_modelname);
+ XtFree(mon->mon_comment);
+ xf86optionListFree(mon->mon_option_lst);
+ XtFree((XtPointer)mon);
+
+ return (True);
+}
+
+int
+xf86removeScreen(XF86ConfigPtr config, XF86ConfScreenPtr screen)
+{
+ XF86ConfScreenPtr prev, scrn;
+ XF86ConfLayoutPtr lay;
+
+ if (config == NULL || screen == NULL)
+ return (False);
+
+ lay = config->conf_layout_lst;
+ prev = scrn = config->conf_screen_lst;
+
+ while (scrn != NULL) {
+ if (scrn == screen) {
+ if (scrn == prev)
+ config->conf_screen_lst = (XF86ConfScreenPtr)(scrn->list.next);
+ else
+ prev->list.next = scrn->list.next;
+ break;
+ }
+ prev = scrn;
+ scrn = (XF86ConfScreenPtr)(scrn->list.next);
+ }
+
+ if (scrn == NULL)
+ return (False);
+
+ while (lay != NULL) {
+ XF86ConfAdjacencyPtr pad, ad = NULL, adj = lay->lay_adjacency_lst;
+
+ pad = adj;
+ while (adj) {
+ if (adj->adj_screen == screen)
+ ad = adj;
+ else {
+ if (adj->adj_top != NULL && adj->adj_top == screen) {
+ XtFree(adj->adj_top_str);
+ adj->adj_top_str = NULL;
+ adj->adj_top = NULL;
+ }
+ else if (adj->adj_bottom != NULL && adj->adj_bottom == screen) {
+ XtFree(adj->adj_bottom_str);
+ adj->adj_bottom_str = NULL;
+ adj->adj_bottom = NULL;
+ }
+ else if (adj->adj_left != NULL && adj->adj_left == screen) {
+ XtFree(adj->adj_left_str);
+ adj->adj_left_str = NULL;
+ adj->adj_left = NULL;
+ }
+ else if (adj->adj_right != NULL && adj->adj_right == screen) {
+ XtFree(adj->adj_right_str);
+ adj->adj_right_str = NULL;
+ adj->adj_right = NULL;
+ }
+ else if (adj->adj_refscreen != NULL &&
+ strcasecmp(scrn->scrn_identifier,
+ adj->adj_refscreen) == 0) {
+ XtFree(adj->adj_refscreen);
+ adj->adj_refscreen = NULL;
+ adj->adj_where = CONF_ADJ_ABSOLUTE;
+ adj->adj_x = adj->adj_y = 0;
+ }
+ }
+ if (ad == NULL)
+ pad = adj;
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+
+ if (ad != NULL) {
+ if (ad == lay->lay_adjacency_lst)
+ lay->lay_adjacency_lst = (XF86ConfAdjacencyPtr)(ad->list.next);
+ else
+ pad->list.next = (XF86ConfAdjacencyPtr)(ad->list.next);
+ XtFree(ad->adj_screen_str);
+ XtFree(ad->adj_top_str);
+ XtFree(ad->adj_bottom_str);
+ XtFree(ad->adj_left_str);
+ XtFree(ad->adj_right_str);
+ XtFree(ad->adj_refscreen);
+ XtFree((XtPointer)ad);
+ }
+
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+
+ xf86freeAdaptorLinkList(screen->scrn_adaptor_lst);
+ xf86freeDisplayList(screen->scrn_display_lst);
+
+ XtFree(screen->scrn_identifier);
+ XtFree(screen->scrn_monitor_str);
+ XtFree(screen->scrn_device_str);
+ xf86optionListFree(screen->scrn_option_lst);
+ XtFree((XtPointer)screen);
+
+ return (True);
+}
+
+int
+xf86removeAdjacency(XF86ConfLayoutPtr layout, XF86ConfAdjacencyPtr adjacency)
+{
+ XF86ConfAdjacencyPtr prev, adj = layout->lay_adjacency_lst;
+
+ if (layout == NULL || adjacency == NULL)
+ return (False);
+
+ prev = adj;
+ while (adj != NULL) {
+ if (adj == adjacency)
+ break;
+ prev = adj;
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+ if (adj == NULL)
+ return (False);
+
+ XtFree(adj->adj_screen_str);
+ XtFree(adj->adj_top_str);
+ XtFree(adj->adj_bottom_str);
+ XtFree(adj->adj_left_str);
+ XtFree(adj->adj_right_str);
+ XtFree(adj->adj_refscreen);
+ if (prev == adj)
+ layout->lay_adjacency_lst = (XF86ConfAdjacencyPtr)(adj->list.next);
+ else
+ prev->list.next = adj->list.next;
+ XtFree((XtPointer)adj);
+
+ return (True);
+}
+
+int
+xf86removeInactive(XF86ConfLayoutPtr layout, XF86ConfInactivePtr inactive)
+{
+ XF86ConfInactivePtr prev, inac = layout->lay_inactive_lst;
+
+ if (layout == NULL || inactive == NULL)
+ return (False);
+
+ prev = inac;
+ while (inac != NULL) {
+ if (inac == inactive)
+ break;
+ prev = inac;
+ inac = (XF86ConfInactivePtr)(inac->list.next);
+ }
+ if (inac == NULL)
+ return (False);
+
+ XtFree(inac->inactive_device_str);
+ if (prev == inac)
+ layout->lay_inactive_lst = (XF86ConfInactivePtr)(inac->list.next);
+ else
+ prev->list.next = inac->list.next;
+ XtFree((XtPointer)inac);
+
+ return (True);
+}
+
+int
+xf86removeLayout(XF86ConfigPtr config, XF86ConfLayoutPtr layout)
+{
+ XF86ConfLayoutPtr prev, lay = config->conf_layout_lst;
+ XF86ConfAdjacencyPtr adj, nadj;
+ XF86ConfInactivePtr inac, ninac;
+ XF86ConfInputrefPtr iref, niref;
+
+ if (config == NULL || layout == NULL)
+ return (False);
+
+ prev = lay;
+ while (lay != NULL) {
+ if (lay == layout)
+ break;
+ prev = lay;
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+
+ if (lay == NULL)
+ return (False);
+
+ adj = lay->lay_adjacency_lst;
+ while (adj != NULL) {
+ nadj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ xf86removeAdjacency(lay, adj);
+ adj = nadj;
+ }
+
+ inac = lay->lay_inactive_lst;
+ while (inac != NULL) {
+ ninac = (XF86ConfInactivePtr)(inac->list.next);
+ xf86removeInactive(lay, inac);
+ inac = ninac;
+ }
+
+ iref = lay->lay_input_lst;
+ while (iref != NULL) {
+ niref = (XF86ConfInputrefPtr)(iref->list.next);
+ xf86removeInputRef(lay, iref->iref_inputdev);
+ iref = niref;
+ }
+
+ xf86optionListFree(lay->lay_option_lst);
+
+ if (prev == lay)
+ config->conf_layout_lst = (XF86ConfLayoutPtr)(lay->list.next);
+ else
+ prev->list.next = lay->list.next;
+ XtFree(lay->lay_identifier);
+ XtFree((XtPointer)lay);
+
+ return (True);
+}
+
+int
+xf86removeModule(XF86ConfigPtr config, XF86LoadPtr load)
+{
+ XF86LoadPtr prev, mod;
+
+ if (config == NULL || config->conf_modules == NULL ||
+ config->conf_modules->mod_load_lst == NULL)
+ return (False);
+
+ for (mod = prev = config->conf_modules->mod_load_lst;
+ mod != NULL; prev = mod, mod = (XF86LoadPtr)(mod->list.next))
+ if (load == mod) {
+ if (mod == prev)
+ config->conf_modules->mod_load_lst =
+ (XF86LoadPtr)(mod->list.next);
+ else
+ prev->list.next = mod->list.next;
+ XtFree(mod->load_name);
+ xf86optionListFree(mod->load_opt);
+
+ return (True);
+ }
+
+ return (False);
+}
+
+int
+xf86removeModes(XF86ConfigPtr config, XF86ConfModesPtr modes)
+{
+ XF86ConfModesPtr mod;
+ XF86ConfModeLinePtr ml, next;
+ XF86ConfMonitorPtr mon;
+
+ if (config == NULL || modes == NULL)
+ return (False);
+
+ /* check if modes is in config */
+ if ((mod = config->conf_modes_lst) == modes)
+ config->conf_modes_lst = (XF86ConfModesPtr)(mod->list.next);
+ else
+ for (; mod != NULL; mod = (XF86ConfModesPtr)(mod->list.next))
+ if ((XF86ConfModesPtr)(mod->list.next) == modes) {
+ mod->list.next = modes->list.next;
+ break;
+ }
+
+ if (mod == NULL)
+ return (False);
+
+ /* remove references in monitor sections */
+ mon = config->conf_monitor_lst;
+ while (mon) {
+ XF86ConfModesLinkPtr m, p;
+
+ m = p = mon->mon_modes_sect_lst;
+ while (m) {
+ if (m->ml_modes == modes) {
+ XtFree(m->ml_modes_str);
+ if (m == mon->mon_modes_sect_lst)
+ p = mon->mon_modes_sect_lst =
+ (XF86ConfModesLinkPtr)(m->list.next);
+ else {
+ p->list.next = m->list.next;
+ p = p->list.next;
+ }
+ XtFree((XtPointer)m);
+ m = p;
+ continue;
+ }
+ p = m;
+ m = (XF86ConfModesLinkPtr)(m->list.next);
+ }
+ mon = (XF86ConfMonitorPtr)(mon->list.next);
+ }
+
+ /* free modelines */
+ ml = modes->mon_modeline_lst;
+ while (ml) {
+ next = (XF86ConfModeLinePtr)(ml->list.next);
+ XtFree(ml->ml_identifier);
+ XtFree((XtPointer)ml);
+ ml = next;
+ }
+
+ /* free mode */
+ XtFree(modes->modes_identifier);
+ XtFree((XtPointer)modes);
+
+ return (True);
+}
+
+int
+xf86removeModesModeLine(XF86ConfModesPtr modes, XF86ConfModeLinePtr modeline)
+{
+ XF86ConfModeLinePtr ml, prev;
+
+ if (modes == NULL || modeline == NULL || modes->mon_modeline_lst == NULL)
+ return (False);
+
+ for (ml = prev = modes->mon_modeline_lst; ml;
+ prev = ml, ml = (XF86ConfModeLinePtr)(ml->list.next))
+ if (ml == modeline) {
+ if (prev == ml)
+ modes->mon_modeline_lst = (XF86ConfModeLinePtr)(ml->list.next);
+ else
+ prev->list.next = ml->list.next;
+ XtFree(modeline->ml_identifier);
+ XtFree((XtPointer)modeline);
+ return (True);
+ }
+
+ return (False);
+}
+
+int
+xf86removeMonitorModeLine(XF86ConfMonitorPtr monitor, XF86ConfModeLinePtr modeline)
+{
+ XF86ConfModeLinePtr ml, prev;
+
+ if (monitor == NULL || modeline == NULL || monitor->mon_modeline_lst == NULL)
+ return (False);
+
+ for (ml = prev = monitor->mon_modeline_lst; ml;
+ prev = ml, ml = (XF86ConfModeLinePtr)(ml->list.next))
+ if (ml == modeline) {
+ if (prev == ml)
+ monitor->mon_modeline_lst = (XF86ConfModeLinePtr)(ml->list.next);
+ else
+ prev->list.next = ml->list.next;
+ XtFree(modeline->ml_identifier);
+ XtFree((XtPointer)modeline);
+ return (True);
+ }
+
+ return (False);
+}
+
+int
+xf86removeMonitorModesLink(XF86ConfMonitorPtr monitor, XF86ConfModesLinkPtr link)
+{
+ XF86ConfModesLinkPtr lnk, prev;
+
+ if (monitor == NULL || link == NULL || monitor->mon_modes_sect_lst == NULL)
+ return (False);
+
+ for (lnk = prev = monitor->mon_modes_sect_lst; lnk != NULL;
+ prev = lnk, lnk = (XF86ConfModesLinkPtr)(lnk->list.next))
+ if (lnk == link) {
+ if (prev == lnk)
+ monitor->mon_modes_sect_lst = (XF86ConfModesLinkPtr)(lnk->list.next);
+ else
+ prev->list.next = lnk->list.next;
+ XtFree(link->ml_modes_str);
+ XtFree((XtPointer)link);
+
+ return (True);
+ }
+
+ return (False);
+}
+
+int
+xf86removeScreenAdaptorLink(XF86ConfScreenPtr scrn, XF86ConfAdaptorLinkPtr link)
+{
+ XF86ConfAdaptorLinkPtr lnk, prev;
+
+ if (scrn == NULL || link == NULL || scrn->scrn_adaptor_lst == NULL)
+ return (False);
+
+ for (lnk = prev = scrn->scrn_adaptor_lst; lnk != NULL;
+ prev = lnk, lnk = (XF86ConfAdaptorLinkPtr)(lnk->list.next))
+ if (lnk == link) {
+ if (prev == lnk)
+ scrn->scrn_adaptor_lst =
+ (XF86ConfAdaptorLinkPtr)(lnk->list.next);
+ else
+ prev->list.next = lnk->list.next;
+ XtFree(link->al_adaptor_str);
+ XtFree((XtPointer)link);
+
+ return (True);
+ }
+
+ return (False);
+}
+
+int
+xf86removeScreenDisplay(XF86ConfScreenPtr scrn, XF86ConfDisplayPtr display)
+{
+ XF86ConfDisplayPtr dsp, prev;
+
+ if (scrn == NULL || display == NULL || scrn->scrn_display_lst == NULL)
+ return (False);
+
+ for (dsp = prev = scrn->scrn_display_lst; dsp != NULL;
+ prev = dsp, dsp = (XF86ConfDisplayPtr)(dsp->list.next))
+ if (dsp == display) {
+ if (prev == dsp)
+ scrn->scrn_display_lst =
+ (XF86ConfDisplayPtr)(dsp->list.next);
+ else
+ prev->list.next = dsp->list.next;
+ xf86optionListFree(display->disp_option_lst);
+ XtFree((XtPointer)display->disp_visual);
+ xf86freeModeList(display->disp_mode_lst);
+ XtFree((XtPointer)display);
+
+ return (True);
+ }
+
+ return (False);
+}
+
+int
+xf86removeVideoAdaptor(XF86ConfigPtr config, XF86ConfVideoAdaptorPtr video)
+{
+ XF86ConfVideoAdaptorPtr vid;
+ XF86ConfScreenPtr scrn;
+ XF86ConfVideoPortPtr vp, next;
+
+ if (config == NULL || video == NULL)
+ return (False);
+
+ /* check if video is in config and update videoadaptor list */
+ if ((vid = config->conf_videoadaptor_lst) == video)
+ config->conf_videoadaptor_lst = (XF86ConfVideoAdaptorPtr)(vid->list.next);
+ else
+ for (; vid != NULL; vid = (XF86ConfVideoAdaptorPtr)(vid->list.next))
+ if ((XF86ConfVideoAdaptorPtr)(vid->list.next) == video) {
+ vid->list.next = video->list.next;
+ break;
+ }
+
+ if (vid == NULL)
+ return (False);
+
+ /* remove references in screen sections */
+ scrn = config->conf_screen_lst;
+ while (scrn) {
+ XF86ConfAdaptorLinkPtr v, p;
+
+ v = p = scrn->scrn_adaptor_lst;
+ while (v) {
+ if (v->al_adaptor == video) {
+ XtFree(v->al_adaptor_str);
+ if (v == scrn->scrn_adaptor_lst)
+ p = scrn->scrn_adaptor_lst =
+ (XF86ConfAdaptorLinkPtr)(v->list.next);
+ else {
+ p->list.next = v->list.next;
+ p = p->list.next;
+ }
+ XtFree((XtPointer)v);
+ v = p;
+ continue;
+ }
+ p = v;
+ v = (XF86ConfAdaptorLinkPtr)(v->list.next);
+ }
+ scrn = (XF86ConfScreenPtr)(scrn->list.next);
+ }
+
+ /* free videoports */
+ vp = video->va_port_lst;
+ while (vp) {
+ next = (XF86ConfVideoPortPtr)(vp->list.next);
+ XtFree(vp->vp_identifier);
+ xf86optionListFree(vp->vp_option_lst);
+ XtFree((XtPointer)vp);
+ vp = next;
+ }
+
+ /* free videoadaptor */
+ XtFree(video->va_identifier);
+ XtFree(video->va_vendor);
+ XtFree(video->va_board);
+ XtFree(video->va_busid);
+ XtFree(video->va_driver);
+ XtFree(video->va_fwdref);
+ xf86optionListFree(video->va_option_lst);
+ XtFree((XtPointer)video);
+
+ return (True);
+}
+
+int
+xf86removeVideoPort(XF86ConfVideoAdaptorPtr va, XF86ConfVideoPortPtr vp)
+{
+ XF86ConfVideoPortPtr prev;
+
+ if (va == NULL || vp == NULL)
+ return (False);
+
+ if ((prev = va->va_port_lst) == vp)
+ va->va_port_lst = (XF86ConfVideoPortPtr)(va->va_port_lst->list.next);
+ else {
+ while (prev && (XF86ConfVideoPortPtr)(prev->list.next) != vp)
+ prev = (XF86ConfVideoPortPtr)(prev->list.next);
+ if (prev == NULL)
+ return (False);
+ prev->list.next = vp->list.next;
+ }
+
+ xf86optionListFree(vp->vp_option_lst);
+ XtFree((XtPointer)vp);
+
+ return (True);
+}
+
+int
+xf86removeDisplayMode(XF86ConfDisplayPtr display, XF86ModePtr mode)
+{
+ XF86ModePtr prev;
+
+ if (display == NULL || mode == NULL)
+ return (False);
+
+ if ((prev = display->disp_mode_lst) == mode)
+ display->disp_mode_lst = (XF86ModePtr)(display->disp_mode_lst->list.next);
+ else {
+ while (prev && (XF86ModePtr)(prev->list.next) != mode)
+ prev = (XF86ModePtr)(prev->list.next);
+ if (prev == NULL)
+ return (False);
+ prev->list.next = mode->list.next;
+ }
+
+ XtFree((XtPointer)mode);
+
+ return (True);
+}
+
+int
+xf86removeVendor(XF86ConfigPtr config, XF86ConfVendorPtr vendor)
+{
+ XF86ConfVendorPtr prev;
+
+ if (config == NULL || vendor == NULL)
+ return (False);
+
+ if ((prev = config->conf_vendor_lst) == vendor)
+ config->conf_vendor_lst = (XF86ConfVendorPtr)(config->conf_vendor_lst->list.next);
+ else {
+ while (prev && (XF86ConfVendorPtr)(prev->list.next) != vendor)
+ prev = (XF86ConfVendorPtr)(prev->list.next);
+ if (prev == NULL)
+ return (False);
+ prev->list.next = vendor->list.next;
+ }
+
+ xf86optionListFree(vendor->vnd_option_lst);
+ xf86freeVendorSubList(vendor->vnd_sub_lst);
+ XtFree(vendor->vnd_identifier);
+ XtFree((XtPointer)vendor);
+
+ return (True);
+}
+
+int
+xf86removeVendorSub(XF86ConfVendorPtr vendor, XF86ConfVendSubPtr sub)
+{
+ XF86ConfVendSubPtr prev;
+
+ if (vendor == NULL || sub == NULL)
+ return (False);
+
+ if ((prev = vendor->vnd_sub_lst) == sub)
+ vendor->vnd_sub_lst = (XF86ConfVendSubPtr)(vendor->vnd_sub_lst->list.next);
+ else {
+ while (prev && (XF86ConfVendSubPtr)(prev->list.next) != sub)
+ prev = (XF86ConfVendSubPtr)(prev->list.next);
+ if (prev == NULL)
+ return (False);
+ prev->list.next = sub->list.next;
+ }
+
+ xf86optionListFree(sub->vs_option_lst);
+ XtFree(sub->vs_name);
+ XtFree(sub->vs_identifier);
+ XtFree((XtPointer)sub);
+
+ return (True);
+}
+
+int
+xf86removeBuffers(XF86ConfDRIPtr dri, XF86ConfBuffersPtr buf)
+{
+ XF86ConfBuffersPtr prev;
+
+ if (dri == NULL || buf == NULL)
+ return (False);
+
+ if ((prev = dri->dri_buffers_lst) == buf)
+ dri->dri_buffers_lst = (XF86ConfBuffersPtr)(dri->dri_buffers_lst->list.next);
+ else {
+ while (prev && (XF86ConfBuffersPtr)(prev->list.next) != buf)
+ prev = (XF86ConfBuffersPtr)(prev->list.next);
+ if (prev == NULL)
+ return (False);
+ prev->list.next = buf->list.next;
+ }
+
+ XtFree(buf->buf_flags);
+ XtFree((XtPointer)buf);
+
+ return (True);
+}
+
+int
+xf86renameInput(XF86ConfigPtr config, XF86ConfInputPtr input, char *name)
+{
+ XF86ConfLayoutPtr lay = config->conf_layout_lst;
+
+ if (config == NULL || input == NULL || name == NULL || *name == '\0')
+ return (False);
+
+ while (lay != NULL) {
+ XF86ConfInputrefPtr iref = lay->lay_input_lst;
+
+ while (iref != NULL) {
+ if (strcasecmp(input->inp_identifier, iref->iref_inputdev_str) == 0) {
+ XtFree(iref->iref_inputdev_str);
+ iref->iref_inputdev_str = XtNewString(name);
+ }
+ iref = (XF86ConfInputrefPtr)(iref->list.next);
+ }
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+
+ XtFree(input->inp_identifier);
+ input->inp_identifier = XtNewString(name);
+
+ return (True);
+}
+
+int
+xf86renameDevice(XF86ConfigPtr config, XF86ConfDevicePtr dev, char *name)
+{
+ XF86ConfScreenPtr scr = config->conf_screen_lst;
+
+ if (config == NULL || dev == NULL || name == NULL || *name == '\0')
+ return (False);
+
+ while (scr != NULL) {
+ if (scr->scrn_device == dev) {
+ XtFree(scr->scrn_device_str);
+ scr->scrn_device_str = XtNewString(name);
+ }
+
+ scr = (XF86ConfScreenPtr)(scr->list.next);
+ }
+
+ XtFree(dev->dev_identifier);
+ dev->dev_identifier = XtNewString(name);
+
+ return (True);
+}
+
+int
+xf86renameMonitor(XF86ConfigPtr config, XF86ConfMonitorPtr mon, char *name)
+{
+ XF86ConfScreenPtr scr = config->conf_screen_lst;
+
+ if (config == NULL || mon == NULL || name == NULL || *name == '\0')
+ return (False);
+
+ while (scr != NULL) {
+ if (scr->scrn_monitor == mon) {
+ XtFree(scr->scrn_monitor_str);
+ scr->scrn_monitor_str = XtNewString(name);
+ }
+
+ scr = (XF86ConfScreenPtr)(scr->list.next);
+ }
+
+ XtFree(mon->mon_identifier);
+ mon->mon_identifier = XtNewString(name);
+
+ return (True);
+}
+
+int
+xf86renameLayout(XF86ConfigPtr config, XF86ConfLayoutPtr layout, char *name)
+{
+ if (config == NULL || layout == NULL || name == NULL || *name == '\0')
+ return (False);
+
+ XtFree(layout->lay_identifier);
+ layout->lay_identifier = XtNewString(name);
+
+ return (True);
+}
+
+int
+xf86renameScreen(XF86ConfigPtr config, XF86ConfScreenPtr scrn, char *name)
+{
+ XF86ConfLayoutPtr lay = config->conf_layout_lst;
+
+ if (config == NULL || scrn == NULL || name == NULL || *name == '\0')
+ return (False);
+
+ while (lay != NULL) {
+ XF86ConfAdjacencyPtr adj = lay->lay_adjacency_lst;
+
+ while (adj != NULL) {
+ if (adj->adj_screen == scrn) {
+ XtFree(adj->adj_screen_str);
+ adj->adj_screen_str = XtNewString(name);
+ }
+ else if (adj->adj_top == scrn) {
+ XtFree(adj->adj_top_str);
+ adj->adj_top_str = XtNewString(name);
+ }
+ else if (adj->adj_bottom == scrn) {
+ XtFree(adj->adj_bottom_str);
+ adj->adj_bottom_str = XtNewString(name);
+ }
+ else if (adj->adj_left == scrn) {
+ XtFree(adj->adj_left_str);
+ adj->adj_left_str = XtNewString(name);
+ }
+ else if (adj->adj_right == scrn) {
+ XtFree(adj->adj_right_str);
+ adj->adj_right_str = XtNewString(name);
+ }
+ else if (adj->adj_refscreen != NULL &&
+ strcasecmp(adj->adj_refscreen, name) == 0) {
+ XtFree(adj->adj_refscreen);
+ adj->adj_refscreen = XtNewString(name);
+ }
+
+ adj = (XF86ConfAdjacencyPtr)(adj->list.next);
+ }
+ lay = (XF86ConfLayoutPtr)(lay->list.next);
+ }
+
+ XtFree(scrn->scrn_identifier);
+ scrn->scrn_identifier = XtNewString(name);
+
+ return (True);
+}
diff --git a/hw/xfree86/utils/xorgcfg/xf86config.h b/hw/xfree86/utils/xorgcfg/xf86config.h
new file mode 100644
index 000000000..575c3c9d0
--- /dev/null
+++ b/hw/xfree86/utils/xorgcfg/xf86config.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ *
+ * 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
+ * CONECTIVA LINUX 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.
+ *
+ * Except as contained in this notice, the name of Conectiva Linux shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * Conectiva Linux.
+ *
+ * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86config.h,v 1.4 2000/11/30 20:55:18 paulo Exp $
+ */
+
+#include "config.h"
+
+#ifndef _xf86cfg_xf86config_h
+#define _xf86cfg_xf86config_h
+
+#define xf86addInput(head, ptr) \
+ (XF86ConfInputPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addInputref(head, ptr) \
+ (XF86ConfInputrefPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addDevice(head, ptr) \
+ (XF86ConfDevicePtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addDisplayMode(head, ptr) \
+ (XF86ModePtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addMonitor(head, ptr) \
+ (XF86ConfMonitorPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addScreen(head, ptr) \
+ (XF86ConfScreenPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addLayout(head, ptr) \
+ (XF86ConfLayoutPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addModeLine(head, ptr) \
+ (XF86ConfModeLinePtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addModes(head, ptr) \
+ (XF86ConfModesPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addModesLink(head, ptr) \
+ (XF86ConfModesLinkPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addModule(head, ptr) \
+ (XF86LoadPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addScreenAdaptor(head, ptr) \
+ (XF86ConfAdaptorLinkPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addScreenDisplay(head, ptr) \
+ (XF86ConfDisplayPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addVideoAdaptor(head, ptr) \
+ (XF86ConfVideoAdaptorPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addVideoPort(head, ptr) \
+ (XF86ConfVideoPortPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addAdjacency(head, ptr) \
+ (XF86ConfAdjacencyPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addVendor(head, ptr) \
+ (XF86ConfVendorPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addVendorSub(head, ptr) \
+ (XF86ConfVendSubPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+#define xf86addBuffers(head, ptr) \
+ (XF86ConfBuffersPtr)xf86addListItem((GenericListPtr)(head), (GenericListPtr)(ptr))
+
+
+int xf86removeOption(XF86OptionPtr*, char*);
+int xf86removeInput(XF86ConfigPtr, XF86ConfInputPtr);
+int xf86removeInputRef(XF86ConfLayoutPtr, XF86ConfInputPtr);
+int xf86removeDevice(XF86ConfigPtr, XF86ConfDevicePtr);
+int xf86removeDisplayMode(XF86ConfDisplayPtr, XF86ModePtr);
+int xf86removeMonitor(XF86ConfigPtr, XF86ConfMonitorPtr);
+int xf86removeScreen(XF86ConfigPtr, XF86ConfScreenPtr);
+int xf86removeAdjacency(XF86ConfLayoutPtr, XF86ConfAdjacencyPtr);
+int xf86removeInactive(XF86ConfLayoutPtr, XF86ConfInactivePtr);
+int xf86removeLayout(XF86ConfigPtr, XF86ConfLayoutPtr);
+int xf86removeModule(XF86ConfigPtr, XF86LoadPtr);
+int xf86removeModes(XF86ConfigPtr, XF86ConfModesPtr);
+int xf86removeModesModeLine(XF86ConfModesPtr, XF86ConfModeLinePtr);
+int xf86removeMonitorModeLine(XF86ConfMonitorPtr, XF86ConfModeLinePtr);
+int xf86removeMonitorModesLink(XF86ConfMonitorPtr, XF86ConfModesLinkPtr);
+int xf86removeScreenAdaptorLink(XF86ConfScreenPtr, XF86ConfAdaptorLinkPtr);
+int xf86removeScreenDisplay(XF86ConfScreenPtr, XF86ConfDisplayPtr);
+int xf86removeVideoAdaptor(XF86ConfigPtr, XF86ConfVideoAdaptorPtr);
+int xf86removeVideoPort(XF86ConfVideoAdaptorPtr, XF86ConfVideoPortPtr);
+int xf86removeVendor(XF86ConfigPtr, XF86ConfVendorPtr);
+int xf86removeVendorSub(XF86ConfVendorPtr, XF86ConfVendSubPtr);
+int xf86removeBuffers(XF86ConfDRIPtr, XF86ConfBuffersPtr);
+
+int xf86renameInput(XF86ConfigPtr, XF86ConfInputPtr, char*);
+int xf86renameDevice(XF86ConfigPtr, XF86ConfDevicePtr, char*);
+int xf86renameMonitor(XF86ConfigPtr, XF86ConfMonitorPtr, char*);
+int xf86renameLayout(XF86ConfigPtr, XF86ConfLayoutPtr, char*);
+int xf86renameScreen(XF86ConfigPtr, XF86ConfScreenPtr, char*);
+
+extern void xf86freeAdaptorLinkList(XF86ConfAdaptorLinkPtr);
+extern void xf86freeDisplayList(XF86ConfDisplayPtr);
+extern void xf86freeModeList(XF86ModePtr);
+extern void xf86freeVendorSubList(XF86ConfVendSubPtr);
+
+#endif /* _xf86cfg_xf86config_h */
diff --git a/hw/xfree86/utils/xorgconfig/Cards98 b/hw/xfree86/utils/xorgconfig/Cards98
new file mode 100644
index 000000000..cfd96dc16
--- /dev/null
+++ b/hw/xfree86/utils/xorgconfig/Cards98
@@ -0,0 +1,647 @@
+# $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/Cards98,v 1.1 1999/07/11 10:50:41 dawes Exp $
+#
+#
+#
+# $XConsortium: Cards /main/27 1996/10/28 05:43:53 kaleb $
+# This is the database of card definitions used by xf86config.
+# Each definition should have a NAME entry, CHIPSET (descriptive) and
+# SERVER (one of EGC, GANBWAP, PEGC, NKVNEC, WABS, WABEP, WSNA, TGUI,
+# MGA, SVGA, NECS3, PWSKB, PWLB, GA968).
+# A reference to another definition is made with SEE (already defined
+# entries are not overridden).
+# Optional entries are RAMDAC (identifier), CLOCKCHIP (identifier),
+# DACSPEED, NOCLOCKPROBE (advises never to probe clocks), UNSUPPORTED
+# (indicates card that is not yet properly supported by a dedicated
+# server). A LINE entry adds a line of text to be included in the
+# Device section (can include options or comments).
+# There's no CLOCKS option (although a Clocks line can be included
+# with LINE), as it is very undesirable to have a Clocks line that
+# is incorrect. The idea is that the Clocks are probed for to be
+# sure (a commented suggested Clocks line can be included).
+#
+# The majority of entries are just a binding of a model name to a
+# chipset/server and untested.
+#
+
+# EGC
+
+NAME EGC16
+CHIPSET EGC
+SERVER EGC
+LINE Chipset "vga"
+
+# PEGC
+
+NAME PEGC
+CHIPSET PEGC
+SERVER PEGC
+LINE VideoRam 512
+LINE Clocks 31.5
+LINE # Virtual resolution for 640x400
+LINE # Clocks 28.322
+
+# GANBWAP
+
+NAME GA-98NBI
+CHIPSET CL-GD5434
+SERVER GANBWAP
+LINE ClockChip "cirrus"
+LINE Option "ga98nb1"
+LINE Option "no_mmio"
+LINE # Option "sw_cursor"
+
+NAME GA-98NBII
+CHIPSET CL-GD5434
+SERVER GANBWAP
+LINE ClockChip "cirrus"
+LINE Option "ga98nb2"
+LINE Option "no_mmio"
+LINE # Option "sw_cursor"
+
+NAME GA-98NBIV
+CHIPSET CL-GD5434
+SERVER GANBWAP
+LINE ClockChip "cirrus"
+LINE Option "ga98nb4"
+LINE Option "no_mmio"
+LINE # Option "sw_cursor"
+
+NAME WAP-2000/4000
+CHIPSET CL-GD5434
+SERVER GANBWAP
+LINE Option "wap"
+LINE Option "no_mmio"
+LINE # Option "epsonmemwin"
+
+# NKVNEC
+
+NAME PCNKV/PCNKV2/NEC_CIRRUS
+CHIPSET CL-GD5428/5429/5430
+SERVER NKVNEC
+LINE # Option "fast_dram"
+LINE VideoRam 1024
+
+NAME PC9821Bf/U8W
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Bp/U8W/U7W
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Bs/U7W
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Be/U7W
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821BA3/U2/W
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821BX3/U2/W
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821BX4/U2
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Cb
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Ce
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Cf
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Ce2
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Cs
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Cs2
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Cx
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Cx2
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Es
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Nd
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Ne2
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Nf
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Np
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Ns
+LINE Option "nec_cirrus"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821V7/C
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821V10/C,S
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821V12/S
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821V13/S
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821V16/S
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821V16/S5V,P
+LINE Chipset "clgd5446"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821V20/S7
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Xb10
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Xc13/S5
+LINE Chipset "clgd5446"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Xc16/M,S
+LINE Chipset "clgd5446"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Xc200/M,S
+LINE Chipset "clgd5446"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Xa7e
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Xe
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC9821Xe10
+LINE Chipset "clgd5430"
+LINE Option "nec_cirrus"
+LINE Option "no_mmio"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC486MR
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC486MS
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC486MU
+LINE Chipset "clgd5429"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC486MV
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC586MV
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+NAME PC586RV
+LINE Chipset "clgd5429"
+SEE PCNKV/PCNKV2/NEC_CIRRUS
+
+# WABS
+
+NAME WAB-S
+CHIPSET CL-GD5426/5428
+SERVER WABS
+LINE VideoRam 1024
+LINE # VideoRam 2048
+
+NAME WAB-1000/2000
+CHIPSET CL-GD5428
+SERVER WABS
+LINE VideoRam 1024
+LINE # VideoRam 2048
+
+NAME WSR-E/G
+SEE WAB-1000/2000
+
+# WABEP
+
+NAME WAB-EP
+CHIPSET CL-GD5428
+SERVER WABEP
+LINE Option "med_dram"
+
+# WSNA
+
+NAME WSN-A2F
+CHIPSET CL-GD5434
+SERVER WSNA
+LINE Option "no_mmio"
+LINE Option "med_dram"
+
+# TGUI
+
+NAME NEC Trident
+CHIPSET TGUI9680/9682
+SERVER TGUI
+LINE Option "xaa_no_color_exp"
+LINE # Option "noaccel"
+LINE # Option "Linear"
+LINE # Option "med_dram"
+LINE # Option "hw_cursor"
+
+NAME PC9821Ra20/N
+SEE NEC Trident
+
+NAME PC9821RaII23/N,W
+SEE NEC Trident
+
+NAME PC9821Ra266/N,W
+SEE NEC Trident
+
+NAME PC9821Rs20/B20
+SEE NEC Trident
+
+NAME PC9821RsII26/B40
+SEE NEC Trident
+
+NAME PC9821V13/M7
+SEE NEC Trident
+
+NAME PC9821V16/M7
+SEE NEC Trident
+
+NAME PC9821V20/M7
+SEE NEC Trident
+
+NAME PC9821Xa7/C,K
+SEE NEC Trident
+
+NAME PC9821Xa9/C,K
+SEE NEC Trident
+
+NAME PC9821Xa10/C,K
+SEE NEC Trident
+
+NAME PC9821Xa12/C,K
+SEE NEC Trident
+
+NAME PC9821Xa13/C,K,W
+SEE NEC Trident
+
+NAME PC9821Xa16/R,W
+SEE NEC Trident
+
+NAME PC9821Xa20/W
+SEE NEC Trident
+
+NAME PC9821Xc13/M,S
+SEE NEC Trident
+
+NAME PC9821Xv13/R
+SEE NEC Trident
+
+NAME GA-DRV/98
+CHIPSET TGUI9680
+SERVER TGUI
+LINE Option "noaccel"
+LINE # Option "med_dram"
+LINE # Option "hw_cursor"
+
+# MGA
+
+NAME MGA Millennium
+CHIPSET MGA2064W
+SERVER MGA
+
+NAME PC9821Xt13
+SEE MGA Millennium
+
+NAME PC9821Xt16
+SEE MGA Millennium
+
+NAME PC9821Xv13/W
+SEE MGA Millennium
+
+NAME PC9821Xv20/W
+SEE MGA Millennium
+
+NAME PC9821St15
+SEE MGA Millennium
+
+NAME PC9821St20
+SEE MGA Millennium
+
+NAME PC9821RvII26/N20
+SEE MGA Millennium
+
+NAME NEC FC-WAB-X2
+SEE MGA Millennium
+
+NAME MGA Mystique
+CHIPSET MGA1064SG
+SERVER MGA
+
+NAME PC9821V166/S
+LINE VideoRam 2048
+SEE MGA Mystique
+
+NAME PC9821V200/S
+LINE VideoRam 2048
+SEE MGA Mystique
+
+NAME PC9821V200/M
+LINE VideoRam 4096
+SEE MGA Mystique
+
+NAME PC9821V233/M7
+LINE VideoRam 2048
+SEE MGA Mystique
+
+NAME PC9821V233/M7V
+LINE VideoRam 4096
+SEE MGA Mystique
+
+# SVGA
+
+NAME NEC Cirrus 755x
+CHIPSET CL-GD7555
+LINE Chipset "clgd7555"
+LINE # VideoRam 2048
+LINE # Option "no_bitblt"
+LINE # Option "fast_dram"
+LINE Option "linear"
+LINE Option "noaccel"
+SERVER SVGA
+
+NAME PC9821Nr12
+SEE NEC Cirrus 755x
+
+NAME PC9821Nr13
+SEE NEC Cirrus 755x
+
+NAME PC9821La13
+SEE NEC Cirrus 755x
+
+NAME PC9821Ls12
+SEE NEC Cirrus 755x
+
+NAME PC9821Ls13
+SEE NEC Cirrus 755x
+
+NAME PC9821Ls150
+SEE NEC Cirrus 755x
+
+# NECS3
+
+NAME NEC WAB-A/B
+CHIPSET S3 928
+SERVER NECS3
+LINE Chipset "s3_generic"
+LINE Dacspeed 110
+LINE Ramdac "sc15025"
+LINE Option "dac_8_bit"
+LINE # Option "necwab"
+LINE # Option "nomemaccess"
+LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0
+LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0
+
+NAME NEC FC-WAB-A/B
+CHIPSET S3 928
+SERVER NECS3
+LINE Chipset "s3_generic"
+LINE Dacspeed 110
+LINE Ramdac "bt485"
+LINE Option "necwab"
+LINE Option "nomemaccess"
+LINE Option "noinit"
+LINE Option "nolinear"
+LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0
+LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0
+
+NAME PC9821Af/U9W E09?
+SEE NEC WAB-A/B
+
+NAME PC9821An/U8W
+SEE NEC WAB-A/B
+
+NAME PC9821Ap2/U8W/C9W
+SEE NEC WAB-A/B
+
+NAME PC9821As2/U7W/U8W
+SEE NEC WAB-A/B
+
+NAME NEC 864
+CHIPSET S3 864
+SERVER NECS3
+LINE Chipset "s3_generic"
+LINE Option "necwab"
+LINE Ramdac "s3_sdac"
+LINE ClockChip "s3_sdac"
+
+NAME PC9821Ap3
+SEE NEC 864
+
+NAME PC9821As3
+SEE NEC 864
+
+NAME PC9821Xp
+SEE NEC 864
+
+NAME PC9821Xs
+SEE NEC 864
+
+# PWSKB
+
+NAME PowerWindow 928/801
+CHIPSET S3 928
+SERVER PWSKB
+LINE Chipset "s3_generic"
+LINE # Chipset "mmio_928"
+LINE Ramdac "sc15025"
+LINE Dacspeed 110
+LINE Option "dac_8_bit"
+LINE # Option "epsonmemwin"
+LINE # Option "nomemaccess"
+LINE ClockChip "icd2061a"
+
+NAME PowerWindow 928II
+CHIPSET S3 928
+SERVER PWSKB
+LINE Chipset "s3_generic"
+LINE # Chipset "mmio_928"
+LINE Ramdac "att20c505"
+LINE # Ramdac "bt485"
+LINE Dacspeed 110
+LINE Option "dac_8_bit"
+LINE # Option "pw_mux"
+LINE Option "bt485_curs"
+LINE # Option "epsonmemwin"
+LINE # Option "nomemaccess"
+LINE ClockChip "icd2061a"
+
+NAME PowerWindow 805i
+CHIPSET S3 805
+SERVER PWSKB
+LINE Chipset "s3_generic"
+LINE Ramdac "s3gendac"
+LINE Dacspeed 110
+LINE Option "dac_8_bit"
+LINE # Option "pw805i"
+LINE # Option "epsonmemwin"
+LINE # Option "nomemaccess"
+LINE ClockChip "s3_sdac"
+
+NAME PowerWindow 928G
+CHIPSET S3 928
+SERVER PWSKB
+LINE Chipset "s3_generic"
+LINE # Chipset "mmio_928"
+LINE Ramdac "sc15025"
+LINE Dacspeed 110
+LINE Option "dac_8_bit"
+LINE # Option "nomemaccess"
+LINE # Option "nolinear"
+LINE ClockChip "icd2061a"
+
+NAME PCSKB/PCSKB2
+CHIPSET S3 911/924
+SERVER PWSKB
+LINE Chipset "s3_generic"
+LINE Ramdac "sc15025"
+LINE Dacspeed 110
+LINE Option "dac_8_bit"
+LINE # Option "nomemaccess"
+LINE Option "pcskb"
+LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0
+LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0
+
+NAME PCSKB3/PCSKB4/PCPKB4
+CHIPSET S3 928
+SERVER PWSKB
+LINE Chipset "s3_generic"
+LINE Ramdac "sc15025"
+LINE # Ramdac "att20c498"
+LINE Dacspeed 110
+LINE Option "dac_8_bit"
+LINE Option "nomemaccess"
+LINE Option "pcskb4"
+LINE Clocks 25.0 28.0 40.0 0.0 50.0 77.0 36.0 45.0
+LINE Clocks 130.0 120.0 80.0 31.0 110.0 65.0 75.0 94.0
+
+# PWLB
+
+NAME PowerWindow 928GLB
+CHIPSET S3 928
+SERVER PWLB
+LINE Chipset "s3_generic"
+LINE # Chipset "mmio_928"
+LINE Ramdac "sc15025"
+LINE Dacspeed 110
+LINE Option "dac_8_bit"
+LINE # Option "pw_localbus"
+LINE # Option "nomemaccess"
+LINE # Option "nolinear"
+LINE ClockChip "icd2061a"
+
+NAME PowerWindow 928IILB
+CHIPSET S3 928
+SERVER PWLB
+LINE Chipset "s3_generic"
+LINE # Chipset "mmio_928"
+LINE Ramdac "att20c505"
+LINE # Ramdac "bt485"
+LINE Dacspeed 110
+LINE Option "dac_8_bit"
+LINE Option "bt485_curs"
+LINE Option "pw_localbus"
+LINE # Option "pw_mux"
+LINE # Option "nomemaccess"
+LINE # Option "nolinear"
+LINE ClockChip "icd2061a"
+
+NAME PowerWindow 964LB
+CHIPSET S3 964
+SERVER PWLB
+LINE Chipset "s3_generic"
+LINE Option "pw_localbus"
+LINE Option "number_nine"
+LINE Ramdac "ti3025"
+LINE ClockChip "ti3025"
+LINE VideoRam 4096
+
+# GA968
+
+NAME GA-968V4/PCI
+CHIPSET S3 968
+SERVER GA968
+LINE Chipset "s3_generic"
+LINE # Chipset "mmio_928"
+LINE VideoRam 4096
diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c
new file mode 100644
index 000000000..18e8032e1
--- /dev/null
+++ b/hw/xfree86/vbe/vbe.c
@@ -0,0 +1,1072 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.c,v 1.1 2003/02/17 17:06:45 dawes Exp $ */
+
+/*
+ * XFree86 vbe module
+ * Copyright 2000 Egbert Eich
+ *
+ * The mode query/save/set/restore functions from the vesa driver
+ * have been moved here.
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ */
+
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "vbe.h"
+#include "Xarch.h"
+#define DPMS_SERVER
+#include "extensions/dpms.h"
+
+#define VERSION(x) VBE_VERSION_MAJOR(x),VBE_VERSION_MINOR(x)
+
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+#define B_O16(x) (x)
+#define B_O32(x) (x)
+#else
+#define B_O16(x) ((((x) & 0xff) << 8) | (((x) & 0xff) >> 8))
+#define B_O32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) \
+ | (((x) & 0xff0000) >> 8) | (((x) & 0xff000000) >> 24))
+#endif
+#define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00)
+
+#define FARP(p) (((unsigned)(p & 0xffff0000) >> 12) | (p & 0xffff))
+#define R16(v) ((v) & 0xffff)
+
+static unsigned char * vbeReadEDID(vbeInfoPtr pVbe);
+static Bool vbeProbeDDC(vbeInfoPtr pVbe);
+
+const char *vbe_ddcSymbols[] = {
+ "xf86InterpretEDID",
+ NULL
+};
+
+static const char vbeVersionString[] = "VBE2";
+
+vbeInfoPtr
+VBEInit(xf86Int10InfoPtr pInt, int entityIndex)
+{
+ return VBEExtendedInit(pInt, entityIndex, 0);
+}
+
+vbeInfoPtr
+VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags)
+{
+ int RealOff;
+ pointer page = NULL;
+ ScrnInfoPtr pScrn = xf86FindScreenForEntity(entityIndex);
+ vbeControllerInfoPtr vbe = NULL;
+ Bool init_int10 = FALSE;
+ vbeInfoPtr vip = NULL;
+ int screen = pScrn->scrnIndex;
+
+ if (!pInt) {
+ if (!xf86LoadSubModule(pScrn, "int10"))
+ goto error;
+
+ xf86DrvMsg(screen,X_INFO,"initializing int10\n");
+ pInt = xf86InitInt10(entityIndex);
+ if (!pInt)
+ goto error;
+ init_int10 = TRUE;
+ }
+
+ page = xf86Int10AllocPages(pInt,1,&RealOff);
+ if (!page) goto error;
+ vbe = (vbeControllerInfoPtr) page;
+ memcpy(vbe->VbeSignature,vbeVersionString,4);
+
+ pInt->ax = 0x4F00;
+ pInt->es = SEG_ADDR(RealOff);
+ pInt->di = SEG_OFF(RealOff);
+ pInt->num = 0x10;
+
+ xf86ExecX86int10(pInt);
+
+ if ((pInt->ax & 0xff) != 0x4f) {
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA BIOS not detected\n");
+ goto error;
+ }
+
+ switch (pInt->ax & 0xff00) {
+ case 0:
+ xf86DrvMsg(screen,X_INFO,"VESA BIOS detected\n");
+ break;
+ case 0x100:
+ xf86DrvMsg(screen,X_INFO,"VESA BIOS function failed\n");
+ goto error;
+ case 0x200:
+ xf86DrvMsg(screen,X_INFO,"VESA BIOS not supported\n");
+ goto error;
+ case 0x300:
+ xf86DrvMsg(screen,X_INFO,"VESA BIOS not supported in current mode\n");
+ goto error;
+ default:
+ xf86DrvMsg(screen,X_INFO,"Invalid\n");
+ goto error;
+ }
+
+ xf86DrvMsgVerb(screen, X_INFO, 4,
+ "VbeVersion is %d, OemStringPtr is 0x%08x,\n"
+ "\tOemVendorNamePtr is 0x%08x, OemProductNamePtr is 0x%08x,\n"
+ "\tOemProductRevPtr is 0x%08x\n",
+ vbe->VbeVersion, vbe->OemStringPtr, vbe->OemVendorNamePtr,
+ vbe->OemProductNamePtr, vbe->OemProductRevPtr);
+
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE Version %i.%i\n",
+ VERSION(vbe->VbeVersion));
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE Total Mem: %i kB\n",
+ vbe->TotalMem * 64);
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM: %s\n",
+ (CARD8*)xf86int10Addr(pInt,L_ADD(vbe->OemStringPtr)));
+
+ if (B_O16(vbe->VbeVersion) >= 0x200) {
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM Software Rev: %i.%i\n",
+ VERSION(vbe->OemSoftwareRev));
+ if (vbe->OemVendorNamePtr)
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM Vendor: %s\n",
+ (CARD8*)xf86int10Addr(pInt,L_ADD(vbe->OemVendorNamePtr)));
+ if (vbe->OemProductNamePtr)
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM Product: %s\n",
+ (CARD8*)xf86int10Addr(pInt,L_ADD(vbe->OemProductNamePtr)));
+ if (vbe->OemProductRevPtr)
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE OEM Product Rev: %s\n",
+ (CARD8*)xf86int10Addr(pInt,L_ADD(vbe->OemProductRevPtr)));
+ }
+ vip = (vbeInfoPtr)xnfalloc(sizeof(vbeInfoRec));
+ vip->version = B_O16(vbe->VbeVersion);
+ vip->pInt10 = pInt;
+ vip->ddc = DDC_UNCHECKED;
+ vip->memory = page;
+ vip->real_mode_base = RealOff;
+ vip->num_pages = 1;
+ vip->init_int10 = init_int10;
+
+ return vip;
+
+ error:
+ if (page)
+ xf86Int10FreePages(pInt, page, 1);
+ if (init_int10)
+ xf86FreeInt10(pInt);
+ return NULL;
+}
+
+void
+vbeFree(vbeInfoPtr pVbe)
+{
+ if (!pVbe)
+ return;
+
+ xf86Int10FreePages(pVbe->pInt10,pVbe->memory,pVbe->num_pages);
+ /* If we have initalized int10 we ought to free it, too */
+ if (pVbe->init_int10)
+ xf86FreeInt10(pVbe->pInt10);
+ xfree(pVbe);
+ return;
+}
+
+static Bool
+vbeProbeDDC(vbeInfoPtr pVbe)
+{
+ char *ddc_level;
+ int screen = pVbe->pInt10->scrnIndex;
+
+ if (!pVbe || (pVbe->ddc == DDC_NONE))
+ return FALSE;
+ if (pVbe->ddc != DDC_UNCHECKED)
+ return TRUE;
+
+ pVbe->pInt10->ax = 0x4F15;
+ pVbe->pInt10->bx = 0;
+ pVbe->pInt10->cx = 0;
+ pVbe->pInt10->es = 0;
+ pVbe->pInt10->di = 0;
+ pVbe->pInt10->num = 0x10;
+
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if ((pVbe->pInt10->ax & 0xff) != 0x4f) {
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC not supported\n");
+ pVbe->ddc = DDC_NONE;
+ return FALSE;
+ }
+
+ switch ((pVbe->pInt10->ax >> 8) & 0xff) {
+ case 0:
+ xf86DrvMsg(screen,X_INFO,"VESA VBE DDC supported\n");
+ switch (pVbe->pInt10->bx & 0x3) {
+ case 0:
+ ddc_level = " none";
+ pVbe->ddc = DDC_NONE;
+ break;
+ case 1:
+ ddc_level = " 1";
+ pVbe->ddc = DDC_1;
+ break;
+ case 2:
+ ddc_level = " 2";
+ pVbe->ddc = DDC_2;
+ break;
+ case 3:
+ ddc_level = " 1 + 2";
+ pVbe->ddc = DDC_1_2;
+ break;
+ default:
+ ddc_level = "";
+ pVbe->ddc = DDC_NONE;
+ break;
+ }
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC Level%s\n",ddc_level);
+ if (pVbe->pInt10->bx & 0x4) {
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC Screen blanked"
+ "for data transfer\n");
+ pVbe->ddc_blank = TRUE;
+ } else
+ pVbe->ddc_blank = FALSE;
+
+ xf86DrvMsgVerb(screen,X_INFO,3,
+ "VESA VBE DDC transfer in appr. %x sec.\n",
+ (pVbe->pInt10->bx >> 8) & 0xff);
+ }
+
+ return TRUE;
+}
+
+typedef enum {
+ VBEOPT_NOVBE,
+ VBEOPT_NODDC
+} VBEOpts;
+
+static const OptionInfoRec VBEOptions[] = {
+ { VBEOPT_NOVBE, "NoVBE", OPTV_BOOLEAN, {0}, FALSE },
+ { VBEOPT_NODDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE },
+};
+
+static unsigned char *
+vbeReadEDID(vbeInfoPtr pVbe)
+{
+ int RealOff = pVbe->real_mode_base;
+ pointer page = pVbe->memory;
+ unsigned char *tmp = NULL;
+ Bool novbe = FALSE;
+ Bool noddc = FALSE;
+ int screen = pVbe->pInt10->scrnIndex;
+ OptionInfoPtr options;
+
+ if (!page) return NULL;
+
+ options = xnfalloc(sizeof(VBEOptions));
+ (void)memcpy(options, VBEOptions, sizeof(VBEOptions));
+ xf86ProcessOptions(screen, xf86Screens[screen]->options, options);
+ xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe);
+ xf86GetOptValBool(options, VBEOPT_NODDC, &noddc);
+ xfree(options);
+ if (novbe || noddc) return NULL;
+
+ if (!vbeProbeDDC(pVbe)) goto error;
+
+ memset(page,0,sizeof(vbeInfoPtr));
+ strcpy(page,vbeVersionString);
+
+ pVbe->pInt10->ax = 0x4F15;
+ pVbe->pInt10->bx = 0x01;
+ pVbe->pInt10->cx = 0;
+ pVbe->pInt10->dx = 0;
+ pVbe->pInt10->es = SEG_ADDR(RealOff);
+ pVbe->pInt10->di = SEG_OFF(RealOff);
+ pVbe->pInt10->num = 0x10;
+
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if ((pVbe->pInt10->ax & 0xff) != 0x4f) {
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC invalid\n");
+ goto error;
+ }
+ switch (pVbe->pInt10->ax & 0xff00) {
+ case 0x0:
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC read successfully\n");
+ tmp = (unsigned char *)xnfalloc(128);
+ memcpy(tmp,page,128);
+ break;
+ case 0x100:
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC read failed\n");
+ break;
+ default:
+ xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC unkown failure %i\n",
+ pVbe->pInt10->ax & 0xff00);
+ break;
+ }
+
+ error:
+ return tmp;
+}
+
+xf86MonPtr
+vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule)
+{
+ xf86MonPtr pMonitor;
+ pointer pModule;
+ unsigned char *DDC_data = NULL;
+
+ if (!pVbe) return NULL;
+ if (pVbe->version < 0x200)
+ return NULL;
+
+ if (!(pModule = pDDCModule)) {
+ pModule =
+ xf86LoadSubModule(xf86Screens[pVbe->pInt10->scrnIndex], "ddc");
+ if (!pModule)
+ return NULL;
+
+ xf86LoaderReqSymLists(vbe_ddcSymbols, NULL);
+ }
+
+ DDC_data = vbeReadEDID(pVbe);
+
+ if (!DDC_data)
+ return NULL;
+
+ pMonitor = xf86InterpretEDID(pVbe->pInt10->scrnIndex, DDC_data);
+
+ if (!pDDCModule)
+ xf86UnloadSubModule(pModule);
+ return pMonitor;
+}
+
+
+VbeInfoBlock *
+VBEGetVBEInfo(vbeInfoPtr pVbe)
+{
+ VbeInfoBlock *block = NULL;
+ int i, pStr, pModes;
+ char *str;
+ CARD16 major, minor, *modes;
+
+ bzero(pVbe->memory, sizeof(VbeInfoBlock));
+
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 00h Return Super VGA information
+ ES:DI := Pointer to buffer
+
+ Output:
+ AX := status
+ (All other registers are preserved)
+ */
+
+ ((char*)pVbe->memory)[0] = 'V';
+ ((char*)pVbe->memory)[1] = 'B';
+ ((char*)pVbe->memory)[2] = 'E';
+ ((char*)pVbe->memory)[3] = '2';
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f00;
+ pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
+ pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (NULL);
+
+ block = xcalloc(sizeof(VbeInfoBlock), 1);
+ block->VESASignature[0] = ((char*)pVbe->memory)[0];
+ block->VESASignature[1] = ((char*)pVbe->memory)[1];
+ block->VESASignature[2] = ((char*)pVbe->memory)[2];
+ block->VESASignature[3] = ((char*)pVbe->memory)[3];
+
+ block->VESAVersion = *(CARD16*)(((char*)pVbe->memory) + 4);
+ major = (unsigned)block->VESAVersion >> 8;
+ minor = block->VESAVersion & 0xff;
+
+ pStr = *(CARD32*)(((char*)pVbe->memory) + 6);
+ str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
+ block->OEMStringPtr = strdup(str);
+
+ block->Capabilities[0] = ((char*)pVbe->memory)[10];
+ block->Capabilities[1] = ((char*)pVbe->memory)[11];
+ block->Capabilities[2] = ((char*)pVbe->memory)[12];
+ block->Capabilities[3] = ((char*)pVbe->memory)[13];
+
+ pModes = *(CARD32*)(((char*)pVbe->memory) + 14);
+ modes = xf86int10Addr(pVbe->pInt10, FARP(pModes));
+ i = 0;
+ while (modes[i] != 0xffff)
+ i++;
+ block->VideoModePtr = xalloc(sizeof(CARD16) * i + 1);
+ memcpy(block->VideoModePtr, modes, sizeof(CARD16) * i);
+ block->VideoModePtr[i] = 0xffff;
+
+ block->TotalMemory = *(CARD16*)(((char*)pVbe->memory) + 18);
+
+ if (major < 2)
+ memcpy(&block->OemSoftwareRev, ((char*)pVbe->memory) + 20, 236);
+ else {
+ block->OemSoftwareRev = *(CARD16*)(((char*)pVbe->memory) + 20);
+ pStr = *(CARD32*)(((char*)pVbe->memory) + 22);
+ str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
+ block->OemVendorNamePtr = strdup(str);
+ pStr = *(CARD32*)(((char*)pVbe->memory) + 26);
+ str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
+ block->OemProductNamePtr = strdup(str);
+ pStr = *(CARD32*)(((char*)pVbe->memory) + 30);
+ str = xf86int10Addr(pVbe->pInt10, FARP(pStr));
+ block->OemProductRevPtr = strdup(str);
+ memcpy(&block->Reserved, ((char*)pVbe->memory) + 34, 222);
+ memcpy(&block->OemData, ((char*)pVbe->memory) + 256, 256);
+ }
+
+ return (block);
+}
+
+void
+VBEFreeVBEInfo(VbeInfoBlock *block)
+{
+ xfree(block->OEMStringPtr);
+ xfree(block->VideoModePtr);
+ if (((unsigned)block->VESAVersion >> 8) >= 2) {
+ xfree(block->OemVendorNamePtr);
+ xfree(block->OemProductNamePtr);
+ xfree(block->OemProductRevPtr);
+ }
+ xfree(block);
+}
+
+Bool
+VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock *block)
+{
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 02h Set Super VGA video mode
+ BX := Video mode
+ D0-D8 := Mode number
+ D9-D10 := Reserved (must be 0)
+ D11 := 0 Use current default refresh rate
+ := 1 Use user specified CRTC values for refresh rate
+ D12-13 Reserved for VBE/AF (must be 0)
+ D14 := 0 Use windowed frame buffer model
+ := 1 Use linear/flat frame buffer model
+ D15 := 0 Clear video memory
+ := 1 Don't clear video memory
+ ES:DI := Pointer to VbeCRTCInfoBlock structure
+
+ Output: AX = Status
+ (All other registers are preserved)
+ */
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f02;
+ pVbe->pInt10->bx = mode;
+ if (block) {
+ pVbe->pInt10->bx |= 1 << 11;
+ memcpy(pVbe->memory, block, sizeof(VbeCRTCInfoBlock));
+ pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
+ pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
+ }
+
+ xf86ExecX86int10(pVbe->pInt10);
+
+ return (R16(pVbe->pInt10->ax) == 0x4f);
+}
+
+Bool
+VBEGetVBEMode(vbeInfoPtr pVbe, int *mode)
+{
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 03h Return current video mode
+
+ Output:
+ AX := Status
+ BX := Current video mode
+ (All other registers are preserved)
+ */
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f03;
+
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) == 0x4f) {
+ *mode = R16(pVbe->pInt10->bx);
+
+ return (TRUE);
+ }
+
+ return (FALSE);
+}
+
+VbeModeInfoBlock *
+VBEGetModeInfo(vbeInfoPtr pVbe, int mode)
+{
+ VbeModeInfoBlock *block = NULL;
+
+ bzero(pVbe->memory, sizeof(VbeModeInfoBlock));
+
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 01h Return Super VGA mode information
+ CX := Super VGA video mode
+ (mode number must be one of those returned by Function 0)
+ ES:DI := Pointer to buffer
+
+ Output:
+ AX := status
+ (All other registers are preserved)
+ */
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f01;
+ pVbe->pInt10->cx = mode;
+ pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
+ pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
+ xf86ExecX86int10(pVbe->pInt10);
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (NULL);
+
+ block = xcalloc(sizeof(VbeModeInfoBlock), 1);
+
+ block->ModeAttributes = *(CARD16*)pVbe->memory;
+ block->WinAAttributes = ((char*)pVbe->memory)[2];
+ block->WinBAttributes = ((char*)pVbe->memory)[3];
+ block->WinGranularity = *(CARD16*)(((char*)pVbe->memory) + 4);
+ block->WinSize = *(CARD16*)(((char*)pVbe->memory) + 6);
+ block->WinASegment = *(CARD16*)(((char*)pVbe->memory) + 8);
+ block->WinBSegment = *(CARD16*)(((char*)pVbe->memory) + 10);
+ block->WinFuncPtr = *(CARD32*)(((char*)pVbe->memory) + 12);
+ block->BytesPerScanline = *(CARD16*)(((char*)pVbe->memory) + 16);
+
+ /* mandatory information for VBE 1.2 and above */
+ block->XResolution = *(CARD16*)(((char*)pVbe->memory) + 18);
+ block->YResolution = *(CARD16*)(((char*)pVbe->memory) + 20);
+ block->XCharSize = ((char*)pVbe->memory)[22];
+ block->YCharSize = ((char*)pVbe->memory)[23];
+ block->NumberOfPlanes = ((char*)pVbe->memory)[24];
+ block->BitsPerPixel = ((char*)pVbe->memory)[25];
+ block->NumberOfBanks = ((char*)pVbe->memory)[26];
+ block->MemoryModel = ((char*)pVbe->memory)[27];
+ block->BankSize = ((char*)pVbe->memory)[28];
+ block->NumberOfImages = ((char*)pVbe->memory)[29];
+ block->Reserved = ((char*)pVbe->memory)[30];
+
+ /* Direct color fields (required for direct/6 and YUV/7 memory models) */
+ block->RedMaskSize = ((char*)pVbe->memory)[31];
+ block->RedFieldPosition = ((char*)pVbe->memory)[32];
+ block->GreenMaskSize = ((char*)pVbe->memory)[33];
+ block->GreenFieldPosition = ((char*)pVbe->memory)[34];
+ block->BlueMaskSize = ((char*)pVbe->memory)[35];
+ block->BlueFieldPosition = ((char*)pVbe->memory)[36];
+ block->RsvdMaskSize = ((char*)pVbe->memory)[37];
+ block->RsvdFieldPosition = ((char*)pVbe->memory)[38];
+ block->DirectColorModeInfo = ((char*)pVbe->memory)[39];
+
+ /* Mandatory information for VBE 2.0 and above */
+ if (pVbe->version >= 0x200) {
+ block->PhysBasePtr = *(CARD32*)(((char*)pVbe->memory) + 40);
+ block->Reserved32 = *(CARD32*)(((char*)pVbe->memory) + 44);
+ block->Reserved16 = *(CARD16*)(((char*)pVbe->memory) + 48);
+
+ /* Mandatory information for VBE 3.0 and above */
+ if (pVbe->version >= 0x300) {
+ block->LinBytesPerScanLine = *(CARD16*)(((char*)pVbe->memory) + 50);
+ block->BnkNumberOfImagePages = ((char*)pVbe->memory)[52];
+ block->LinNumberOfImagePages = ((char*)pVbe->memory)[53];
+ block->LinRedMaskSize = ((char*)pVbe->memory)[54];
+ block->LinRedFieldPosition = ((char*)pVbe->memory)[55];
+ block->LinGreenMaskSize = ((char*)pVbe->memory)[56];
+ block->LinGreenFieldPosition = ((char*)pVbe->memory)[57];
+ block->LinBlueMaskSize = ((char*)pVbe->memory)[58];
+ block->LinBlueFieldPosition = ((char*)pVbe->memory)[59];
+ block->LinRsvdMaskSize = ((char*)pVbe->memory)[60];
+ block->LinRsvdFieldPosition = ((char*)pVbe->memory)[61];
+ block->MaxPixelClock = *(CARD32*)(((char*)pVbe->memory) + 62);
+ memcpy(&block->Reserved2, ((char*)pVbe->memory) + 66, 188);
+ }
+ else
+ memcpy(&block->LinBytesPerScanLine, ((char*)pVbe->memory) + 50, 206);
+ }
+ else
+ memcpy(&block->PhysBasePtr, ((char*)pVbe->memory) + 40, 216);
+
+ return (block);
+}
+
+void
+VBEFreeModeInfo(VbeModeInfoBlock *block)
+{
+ xfree(block);
+}
+
+Bool
+VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function,
+ pointer *memory, int *size, int *real_mode_pages)
+{
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 04h Save/restore Super VGA video state
+ DL := 00h Return save/restore state buffer size
+ CX := Requested states
+ D0 = Save/restore video hardware state
+ D1 = Save/restore video BIOS data state
+ D2 = Save/restore video DAC state
+ D3 = Save/restore Super VGA state
+
+ Output:
+ AX = Status
+ BX = Number of 64-byte blocks to hold the state buffer
+ (All other registers are preserved)
+
+
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 04h Save/restore Super VGA video state
+ DL := 01h Save Super VGA video state
+ CX := Requested states (see above)
+ ES:BX := Pointer to buffer
+
+ Output:
+ AX := Status
+ (All other registers are preserved)
+
+
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 04h Save/restore Super VGA video state
+ DL := 02h Restore Super VGA video state
+ CX := Requested states (see above)
+ ES:BX := Pointer to buffer
+
+ Output:
+ AX := Status
+ (All other registers are preserved)
+ */
+
+ if ((pVbe->version & 0xff00) > 0x100) {
+ int screen = pVbe->pInt10->scrnIndex;
+ if (function == MODE_QUERY ||
+ (function == MODE_SAVE && !*memory)) {
+ /* Query amount of memory to save state */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f04;
+ pVbe->pInt10->dx = 0;
+ pVbe->pInt10->cx = 0x000f;
+ xf86ExecX86int10(pVbe->pInt10);
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (FALSE);
+
+ if (function == MODE_SAVE) {
+ int npages = (R16(pVbe->pInt10->bx) * 64) / 4096 + 1;
+ if ((*memory = xf86Int10AllocPages(pVbe->pInt10, npages,
+ real_mode_pages)) == NULL) {
+ xf86DrvMsg(screen, X_ERROR,
+ "Cannot allocate memory to save SVGA state.\n");
+ return (FALSE);
+ }
+ }
+ *size = pVbe->pInt10->bx * 64;
+ }
+
+ /* Save/Restore Super VGA state */
+ if (function != MODE_QUERY) {
+
+ if (!*memory) return FALSE;
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f04;
+ switch (function) {
+ case MODE_SAVE:
+ pVbe->pInt10->dx = 1;
+ break;
+ case MODE_RESTORE:
+ pVbe->pInt10->dx = 2;
+ break;
+ case MODE_QUERY:
+ return FALSE;
+ }
+ pVbe->pInt10->cx = 0x000f;
+
+ pVbe->pInt10->es = SEG_ADDR(*real_mode_pages);
+ pVbe->pInt10->bx = SEG_OFF(*real_mode_pages);
+ xf86ExecX86int10(pVbe->pInt10);
+ return (R16(pVbe->pInt10->ax) == 0x4f);
+
+ }
+ }
+ return TRUE;
+}
+
+Bool
+VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window)
+{
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 05h
+
+ Output:
+ */
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f05;
+ pVbe->pInt10->bx = window;
+ pVbe->pInt10->dx = iBank;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (FALSE);
+
+ return (TRUE);
+}
+
+Bool
+VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe, vbeScanwidthCommand command,
+ int width, int *pixels, int *bytes, int *max)
+{
+ if (command < SCANWID_SET || command > SCANWID_GET_MAX)
+ return (FALSE);
+
+ /*
+ Input:
+ AX := 4F06h VBE Set/Get Logical Scan Line Length
+ BL := 00h Set Scan Line Length in Pixels
+ := 01h Get Scan Line Length
+ := 02h Set Scan Line Length in Bytes
+ := 03h Get Maximum Scan Line Length
+ CX := If BL=00h Desired Width in Pixels
+ If BL=02h Desired Width in Bytes
+ (Ignored for Get Functions)
+
+ Output:
+ AX := VBE Return Status
+ BX := Bytes Per Scan Line
+ CX := Actual Pixels Per Scan Line
+ (truncated to nearest complete pixel)
+ DX := Maximum Number of Scan Lines
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f06;
+ pVbe->pInt10->bx = command;
+ if (command == SCANWID_SET || command == SCANWID_SET_BYTES)
+ pVbe->pInt10->cx = width;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (FALSE);
+
+ if (command == SCANWID_GET || command == SCANWID_GET_MAX) {
+ if (pixels)
+ *pixels = R16(pVbe->pInt10->cx);
+ if (bytes)
+ *bytes = R16(pVbe->pInt10->bx);
+ if (max)
+ *max = R16(pVbe->pInt10->dx);
+ }
+
+ return (TRUE);
+}
+
+Bool
+VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace)
+{
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f07;
+ pVbe->pInt10->bx = wait_retrace ? 0x80 : 0x00;
+ pVbe->pInt10->cx = x;
+ pVbe->pInt10->dx = y;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (FALSE);
+
+ return (TRUE);
+}
+
+Bool
+VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y)
+{
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f07;
+ pVbe->pInt10->bx = 0x01;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (FALSE);
+
+ *x = pVbe->pInt10->cx;
+ *y = pVbe->pInt10->dx;
+
+ return (TRUE);
+}
+
+int
+VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits)
+{
+ /*
+ Input:
+ AX := 4F08h VBE Set/Get Palette Format
+ BL := 00h Set DAC Palette Format
+ := 01h Get DAC Palette Format
+ BH := Desired bits of color per primary
+ (Set DAC Palette Format only)
+
+ Output:
+ AX := VBE Return Status
+ BH := Current number of bits of color per primary
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f08;
+ if (!bits)
+ pVbe->pInt10->bx = 0x01;
+ else
+ pVbe->pInt10->bx = (bits & 0x00ff) << 8;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (0);
+
+ return (bits != 0 ? bits : (pVbe->pInt10->bx >> 8) & 0x00ff);
+}
+
+CARD32 *
+VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num,
+ CARD32 *data, Bool secondary, Bool wait_retrace)
+{
+ /*
+ Input:
+ (16-bit)
+ AX := 4F09h VBE Load/Unload Palette Data
+ BL := 00h Set Palette Data
+ := 01h Get Palette Data
+ := 02h Set Secondary Palette Data
+ := 03h Get Secondary Palette Data
+ := 80h Set Palette Data during Vertical Retrace
+ CX := Number of palette registers to update (to a maximum of 256)
+ DX := First of the palette registers to update (start)
+ ES:DI := Table of palette values (see below for format)
+
+ Output:
+ AX := VBE Return Status
+
+
+ Input:
+ (32-bit)
+ BL := 00h Set Palette Data
+ := 80h Set Palette Data during Vertical Retrace
+ CX := Number of palette registers to update (to a maximum of 256)
+ DX := First of the palette registers to update (start)
+ ES:EDI := Table of palette values (see below for format)
+ DS := Selector for memory mapped registers
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f09;
+ if (!secondary)
+ pVbe->pInt10->bx = set && wait_retrace ? 0x80 : set ? 0 : 1;
+ else
+ pVbe->pInt10->bx = set ? 2 : 3;
+ pVbe->pInt10->cx = num;
+ pVbe->pInt10->dx = first;
+ pVbe->pInt10->es = SEG_ADDR(pVbe->real_mode_base);
+ pVbe->pInt10->di = SEG_OFF(pVbe->real_mode_base);
+ if (set)
+ memcpy(pVbe->memory, data, num * sizeof(CARD32));
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (NULL);
+
+ if (set)
+ return (data);
+
+ data = xalloc(num * sizeof(CARD32));
+ memcpy(data, pVbe->memory, num * sizeof(CARD32));
+
+ return (data);
+}
+
+VBEpmi *
+VBEGetVBEpmi(vbeInfoPtr pVbe)
+{
+ VBEpmi *pmi;
+
+ /*
+ Input:
+ AH := 4Fh Super VGA support
+ AL := 0Ah Protected Mode Interface
+ BL := 00h Return Protected Mode Table
+
+ Output:
+ AX := Status
+ ES := Real Mode Segment of Table
+ DI := Offset of Table
+ CX := Lenght of Table including protected mode code in bytes (for copying purposes)
+ (All other registers are preserved)
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f0a;
+ pVbe->pInt10->bx = 0;
+ pVbe->pInt10->di = 0;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (NULL);
+
+ pmi = xalloc(sizeof(VBEpmi));
+ pmi->seg_tbl = R16(pVbe->pInt10->es);
+ pmi->tbl_off = R16(pVbe->pInt10->di);
+ pmi->tbl_len = R16(pVbe->pInt10->cx);
+
+ return (pmi);
+}
+
+#if 0
+vbeModeInfoPtr
+VBEBuildVbeModeList(vbeInfoPtr pVbe, VbeInfoBlock *vbe)
+{
+ vbeModeInfoPtr ModeList = NULL;
+
+ int i = 0;
+ while (vbe->VideoModePtr[i] != 0xffff) {
+ vbeModeInfoPtr m;
+ VbeModeInfoBlock *mode;
+ int id = vbe->VideoModePtr[i++];
+ int bpp;
+
+ if ((mode = VBEGetModeInfo(pVbe, id)) == NULL)
+ continue;
+
+ bpp = mode->BitsPerPixel;
+
+ m = xnfcalloc(sizeof(vbeModeInfoRec),1);
+ m->width = mode->XResolution;
+ m->height = mode->YResolution;
+ m->bpp = bpp;
+ m->n = id;
+ m->next = ModeList;
+
+ xf86DrvMsgVerb(pVbe->pInt10->scrnIndex, X_PROBED, 3,
+ "BIOS reported VESA mode 0x%x: x:%i y:%i bpp:%i\n",
+ m->n, m->width, m->height, m->bpp);
+
+ ModeList = m;
+
+ VBEFreeModeInfo(mode);
+ }
+ return ModeList;
+}
+
+unsigned short
+VBECalcVbeModeIndex(vbeModeInfoPtr m, DisplayModePtr mode, int bpp)
+{
+ while (m) {
+ if (bpp == m->bpp
+ && mode->HDisplay == m->width
+ && mode->VDisplay == m->height)
+ return m->n;
+ m = m->next;
+ }
+ return 0;
+}
+#endif
+
+void
+VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr,
+ vbeSaveRestoreFunction function)
+{
+ Bool SaveSucc = FALSE;
+
+ if (VBE_VERSION_MAJOR(pVbe->version) > 1
+ && (function == MODE_SAVE || vbe_sr->pstate)) {
+ if (function == MODE_RESTORE)
+ memcpy(vbe_sr->state, vbe_sr->pstate, vbe_sr->stateSize);
+ ErrorF("VBESaveRestore\n");
+ if ((VBESaveRestore(pVbe,function,
+ (pointer)&vbe_sr->state,
+ &vbe_sr->stateSize,&vbe_sr->statePage))) {
+ if (function == MODE_SAVE) {
+ SaveSucc = TRUE;
+ vbe_sr->stateMode = -1; /* invalidate */
+ /* don't rely on the memory not being touched */
+ if (vbe_sr->pstate == NULL)
+ vbe_sr->pstate = xalloc(vbe_sr->stateSize);
+ memcpy(vbe_sr->pstate, vbe_sr->state, vbe_sr->stateSize);
+ }
+ ErrorF("VBESaveRestore done with success\n");
+ return;
+ }
+ ErrorF("VBESaveRestore done\n");
+ }
+
+ if (function == MODE_SAVE && !SaveSucc)
+ (void)VBEGetVBEMode(pVbe, &vbe_sr->stateMode);
+
+ if (function == MODE_RESTORE && vbe_sr->stateMode != -1)
+ VBESetVBEMode(pVbe, vbe_sr->stateMode, NULL);
+
+}
+
+int
+VBEGetPixelClock(vbeInfoPtr pVbe, int mode, int clock)
+{
+ /*
+ Input:
+ AX := 4F0Bh VBE Get Pixel Clock
+ BL := 01h Get Pixel Clock
+ ECX := pixel clock in units of Hz
+ DX := mode number
+
+ Output:
+ AX := VBE Return Status
+ ECX := Closest pixel clock
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f0b;
+ pVbe->pInt10->bx = 0x01;
+ pVbe->pInt10->cx = clock;
+ pVbe->pInt10->dx = mode;
+ xf86ExecX86int10(pVbe->pInt10);
+
+ if (R16(pVbe->pInt10->ax) != 0x4f)
+ return (0);
+
+ return (pVbe->pInt10->cx);
+}
+
+Bool
+VBEDPMSSet(vbeInfoPtr pVbe, int mode)
+{
+ /*
+ Input:
+ AX := 4F10h DPMS
+ BL := 01h Set Display Power State
+ BH := requested power state
+
+ Output:
+ AX := VBE Return Status
+ */
+
+ pVbe->pInt10->num = 0x10;
+ pVbe->pInt10->ax = 0x4f10;
+ pVbe->pInt10->bx = 0x01;
+ switch (mode) {
+ case DPMSModeOn:
+ break;
+ case DPMSModeStandby:
+ pVbe->pInt10->bx |= 0x100;
+ break;
+ case DPMSModeSuspend:
+ pVbe->pInt10->bx |= 0x200;
+ break;
+ case DPMSModeOff:
+ pVbe->pInt10->bx |= 0x400;
+ break;
+ }
+ xf86ExecX86int10(pVbe->pInt10);
+ return (R16(pVbe->pInt10->ax) == 0x4f);
+}
+
diff --git a/hw/xfree86/vbe/vbe.h b/hw/xfree86/vbe/vbe.h
new file mode 100644
index 000000000..5bca184f5
--- /dev/null
+++ b/hw/xfree86/vbe/vbe.h
@@ -0,0 +1,328 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe.h,v 1.1 2003/02/17 17:06:45 dawes Exp $ */
+
+/*
+ * XFree86 vbe module
+ * Copyright 2000 Egbert Eich
+ *
+ * The mode query/save/set/restore functions from the vesa driver
+ * have been moved here.
+ * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
+ * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
+ */
+
+#ifndef _VBE_H
+#define _VBE_H
+#include "xf86int10.h"
+#include "xf86DDC.h"
+
+typedef enum {
+ DDC_UNCHECKED,
+ DDC_NONE,
+ DDC_1,
+ DDC_2,
+ DDC_1_2
+}
+ddc_lvl;
+
+typedef struct {
+ xf86Int10InfoPtr pInt10;
+ int version;
+ pointer memory;
+ int real_mode_base;
+ int num_pages;
+ Bool init_int10;
+ ddc_lvl ddc;
+ Bool ddc_blank;
+} vbeInfoRec, *vbeInfoPtr;
+
+#define VBE_VERSION_MAJOR(x) *((CARD8*)(&x) + 1)
+#define VBE_VERSION_MINOR(x) (CARD8)(x)
+
+vbeInfoPtr VBEInit(xf86Int10InfoPtr pInt, int entityIndex);
+vbeInfoPtr VBEExtendedInit(xf86Int10InfoPtr pInt, int entityIndex, int Flags);
+void vbeFree(vbeInfoPtr pVbe);
+xf86MonPtr vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule);
+
+#pragma pack(1)
+
+typedef struct vbeControllerInfoBlock {
+ CARD8 VbeSignature[4];
+ CARD16 VbeVersion;
+ CARD32 OemStringPtr;
+ CARD8 Capabilities[4];
+ CARD32 VideoModePtr;
+ CARD16 TotalMem;
+ CARD16 OemSoftwareRev;
+ CARD32 OemVendorNamePtr;
+ CARD32 OemProductNamePtr;
+ CARD32 OemProductRevPtr;
+ CARD8 Scratch[222];
+ CARD8 OemData[256];
+} vbeControllerInfoRec, *vbeControllerInfoPtr;
+
+#pragma pack()
+
+#ifndef __GNUC__
+#define __attribute__(a)
+#endif
+
+typedef struct _VbeInfoBlock VbeInfoBlock;
+typedef struct _VbeModeInfoBlock VbeModeInfoBlock;
+typedef struct _VbeCRTCInfoBlock VbeCRTCInfoBlock;
+
+/*
+ * INT 0
+ */
+
+struct _VbeInfoBlock {
+ /* VESA 1.2 fields */
+ CARD8 VESASignature[4]; /* VESA */
+ CARD16 VESAVersion; /* Higher byte major, lower byte minor */
+ /*CARD32*/char *OEMStringPtr; /* Pointer to OEM string */
+ CARD8 Capabilities[4]; /* Capabilities of the video environment */
+
+ /*CARD32*/CARD16 *VideoModePtr; /* pointer to supported Super VGA modes */
+
+ CARD16 TotalMemory; /* Number of 64kb memory blocks on board */
+ /* if not VESA 2, 236 scratch bytes follow (256 bytes total size) */
+
+ /* VESA 2 fields */
+ CARD16 OemSoftwareRev; /* VBE implementation Software revision */
+ /*CARD32*/char *OemVendorNamePtr; /* Pointer to Vendor Name String */
+ /*CARD32*/char *OemProductNamePtr; /* Pointer to Product Name String */
+ /*CARD32*/char *OemProductRevPtr; /* Pointer to Product Revision String */
+ CARD8 Reserved[222]; /* Reserved for VBE implementation */
+ CARD8 OemData[256]; /* Data Area for OEM Strings */
+} __attribute__((packed));
+
+/* Return Super VGA Information */
+VbeInfoBlock *VBEGetVBEInfo(vbeInfoPtr pVbe);
+void VBEFreeVBEInfo(VbeInfoBlock *block);
+
+/*
+ * INT 1
+ */
+
+struct _VbeModeInfoBlock {
+ CARD16 ModeAttributes; /* mode attributes */
+ CARD8 WinAAttributes; /* window A attributes */
+ CARD8 WinBAttributes; /* window B attributes */
+ CARD16 WinGranularity; /* window granularity */
+ CARD16 WinSize; /* window size */
+ CARD16 WinASegment; /* window A start segment */
+ CARD16 WinBSegment; /* window B start segment */
+ CARD32 WinFuncPtr; /* real mode pointer to window function */
+ CARD16 BytesPerScanline; /* bytes per scanline */
+
+ /* Mandatory information for VBE 1.2 and above */
+ CARD16 XResolution; /* horizontal resolution in pixels or characters */
+ CARD16 YResolution; /* vertical resolution in pixels or characters */
+ CARD8 XCharSize; /* character cell width in pixels */
+ CARD8 YCharSize; /* character cell height in pixels */
+ CARD8 NumberOfPlanes; /* number of memory planes */
+ CARD8 BitsPerPixel; /* bits per pixel */
+ CARD8 NumberOfBanks; /* number of banks */
+ CARD8 MemoryModel; /* memory model type */
+ CARD8 BankSize; /* bank size in KB */
+ CARD8 NumberOfImages; /* number of images */
+ CARD8 Reserved; /* 1 */ /* reserved for page function */
+
+ /* Direct color fields (required for direct/6 and YUV/7 memory models) */
+ CARD8 RedMaskSize; /* size of direct color red mask in bits */
+ CARD8 RedFieldPosition; /* bit position of lsb of red mask */
+ CARD8 GreenMaskSize; /* size of direct color green mask in bits */
+ CARD8 GreenFieldPosition; /* bit position of lsb of green mask */
+ CARD8 BlueMaskSize; /* size of direct color blue mask in bits */
+ CARD8 BlueFieldPosition; /* bit position of lsb of blue mask */
+ CARD8 RsvdMaskSize; /* size of direct color reserved mask in bits */
+ CARD8 RsvdFieldPosition; /* bit position of lsb of reserved mask */
+ CARD8 DirectColorModeInfo; /* direct color mode attributes */
+
+ /* Mandatory information for VBE 2.0 and above */
+ CARD32 PhysBasePtr; /* physical address for flat memory frame buffer */
+ CARD32 Reserved32; /* 0 */ /* Reserved - always set to 0 */
+ CARD16 Reserved16; /* 0 */ /* Reserved - always set to 0 */
+
+ /* Mandatory information for VBE 3.0 and above */
+ CARD16 LinBytesPerScanLine; /* bytes per scan line for linear modes */
+ CARD8 BnkNumberOfImagePages; /* number of images for banked modes */
+ CARD8 LinNumberOfImagePages; /* number of images for linear modes */
+ CARD8 LinRedMaskSize; /* size of direct color red mask (linear modes) */
+ CARD8 LinRedFieldPosition; /* bit position of lsb of red mask (linear modes) */
+ CARD8 LinGreenMaskSize; /* size of direct color green mask (linear modes) */
+ CARD8 LinGreenFieldPosition; /* bit position of lsb of green mask (linear modes) */
+ CARD8 LinBlueMaskSize; /* size of direct color blue mask (linear modes) */
+ CARD8 LinBlueFieldPosition; /* bit position of lsb of blue mask (linear modes) */
+ CARD8 LinRsvdMaskSize; /* size of direct color reserved mask (linear modes) */
+ CARD8 LinRsvdFieldPosition; /* bit position of lsb of reserved mask (linear modes) */
+ CARD32 MaxPixelClock; /* maximum pixel clock (in Hz) for graphics mode */
+ CARD8 Reserved2[189]; /* remainder of VbeModeInfoBlock */
+} __attribute__((packed));
+
+/* Return VBE Mode Information */
+VbeModeInfoBlock *VBEGetModeInfo(vbeInfoPtr pVbe, int mode);
+void VBEFreeModeInfo(VbeModeInfoBlock *block);
+
+/*
+ * INT2
+ */
+
+#define CRTC_DBLSCAN (1<<0)
+#define CRTC_INTERLACE (1<<1)
+#define CRTC_NHSYNC (1<<2)
+#define CRTC_NVSYNC (1<<3)
+
+struct _VbeCRTCInfoBlock {
+ CARD16 HorizontalTotal; /* Horizontal total in pixels */
+ CARD16 HorizontalSyncStart; /* Horizontal sync start in pixels */
+ CARD16 HorizontalSyncEnd; /* Horizontal sync end in pixels */
+ CARD16 VerticalTotal; /* Vertical total in lines */
+ CARD16 VerticalSyncStart; /* Vertical sync start in lines */
+ CARD16 VerticalSyncEnd; /* Vertical sync end in lines */
+ CARD8 Flags; /* Flags (Interlaced, Double Scan etc) */
+ CARD32 PixelClock; /* Pixel clock in units of Hz */
+ CARD16 RefreshRate; /* Refresh rate in units of 0.01 Hz */
+ CARD8 Reserved[40]; /* remainder of ModeInfoBlock */
+} __attribute__((packed));
+/* VbeCRTCInfoBlock is in the VESA 3.0 specs */
+
+Bool VBESetVBEMode(vbeInfoPtr pVbe, int mode, VbeCRTCInfoBlock *crtc);
+
+/*
+ * INT 3
+ */
+
+Bool VBEGetVBEMode(vbeInfoPtr pVbe, int *mode);
+
+/*
+ * INT 4
+ */
+
+/* Save/Restore Super VGA video state */
+/* function values are (values stored in VESAPtr):
+ * 0 := query & allocate amount of memory to save state
+ * 1 := save state
+ * 2 := restore state
+ *
+ * function 0 called automatically if function 1 called without
+ * a previous call to function 0.
+ */
+
+typedef enum {
+ MODE_QUERY,
+ MODE_SAVE,
+ MODE_RESTORE
+} vbeSaveRestoreFunction;
+
+Bool
+VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction fuction,
+ pointer *memory, int *size, int *real_mode_pages);
+
+/*
+ * INT 5
+ */
+
+Bool
+VBEBankSwitch(vbeInfoPtr pVbe, unsigned int iBank, int window);
+
+/*
+ * INT 6
+ */
+
+typedef enum {
+ SCANWID_SET,
+ SCANWID_GET,
+ SCANWID_SET_BYTES,
+ SCANWID_GET_MAX
+} vbeScanwidthCommand;
+
+#define VBESetLogicalScanline(pVbe, width) \
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET, \
+ width, NULL, NULL, NULL)
+#define VBESetLogicalScanlineBytes(pVbe, width) \
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_SET_BYTES, width, \
+ NULL, NULL, NULL)
+#define VBEGetLogicalScanline(pVbe, pixels, bytes, max) \
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET, 0, \
+ pixels, bytes, max)
+#define VBEGetMaxLogicalScanline(pVbe, pixels, bytes, max) \
+ VBESetGetLogicalScanlineLength(pVbe, SCANWID_GET_MAX, \
+ NULL, pixels, bytes, max)
+Bool VBESetGetLogicalScanlineLength(vbeInfoPtr pVbe,
+ vbeScanwidthCommand command, int width,
+ int *pixels, int *bytes, int *max);
+
+/*
+ * INT 7
+ */
+
+/* 16 bit code */
+Bool VBESetDisplayStart(vbeInfoPtr pVbe, int x, int y, Bool wait_retrace);
+Bool VBEGetDisplayStart(vbeInfoPtr pVbe, int *x, int *y);
+
+/*
+ * INT 8
+ */
+
+/* if bits is 0, then it is a GET */
+int VBESetGetDACPaletteFormat(vbeInfoPtr pVbe, int bits);
+
+/*
+ * INT 9
+ */
+
+/*
+ * If getting a palette, the data argument is not used. It will return
+ * the data.
+ * If setting a palette, it will return the pointer received on success,
+ * NULL on failure.
+ */
+CARD32 *VBESetGetPaletteData(vbeInfoPtr pVbe, Bool set, int first, int num,
+ CARD32 *data, Bool secondary, Bool wait_retrace);
+#define VBEFreePaletteData(data) xfree(data)
+
+/*
+ * INT A
+ */
+
+typedef struct _VBEpmi {
+ int seg_tbl;
+ int tbl_off;
+ int tbl_len;
+} VBEpmi;
+
+VBEpmi *VBEGetVBEpmi(vbeInfoPtr pVbe);
+#define VESAFreeVBEpmi(pmi) xfree(pmi)
+
+/* high level helper functions */
+
+typedef struct _vbeModeInfoRec {
+ int width;
+ int height;
+ int bpp;
+ int n;
+ struct _vbeModeInfoRec *next;
+} vbeModeInfoRec, *vbeModeInfoPtr;
+
+vbeModeInfoPtr VBEBuildVbeModeList(vbeInfoPtr pVbe,
+ VbeInfoBlock *vbe);
+
+unsigned short VBECalcVbeModeIndex(vbeModeInfoPtr m,
+ DisplayModePtr mode, int bpp);
+
+typedef struct {
+ CARD8 *state;
+ CARD8 *pstate;
+ int statePage;
+ int stateSize;
+ int stateMode;
+} vbeSaveRestoreRec, *vbeSaveRestorePtr;
+
+void
+VBEVesaSaveRestore(vbeInfoPtr pVbe, vbeSaveRestorePtr vbe_sr,
+ vbeSaveRestoreFunction function);
+
+int VBEGetPixelClock(vbeInfoPtr pVbe, int mode, int Clock);
+Bool VBEDPMSSet(vbeInfoPtr pVbe, int mode);
+
+#endif
diff --git a/hw/xfree86/vbe/vbeModes.c b/hw/xfree86/vbe/vbeModes.c
new file mode 100644
index 000000000..4d4f1bfac
--- /dev/null
+++ b/hw/xfree86/vbe/vbeModes.c
@@ -0,0 +1,477 @@
+#define DEBUG_VERB 2
+/*
+ * Copyright © 2002 David Dawes
+ *
+ * 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 AUTHOR(S) 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.
+ *
+ * Except as contained in this notice, the name of the author(s) shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * the author(s).
+ *
+ * Authors: David Dawes <dawes@xfree86.org>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbeModes.c,v 1.1 2003/02/17 17:06:45 dawes Exp $
+ */
+
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "vbe.h"
+#include "vbeModes.h"
+
+static int
+GetDepthFlag(vbeInfoPtr pVbe, int id)
+{
+ VbeModeInfoBlock *mode;
+ int bpp;
+
+ if ((mode = VBEGetModeInfo(pVbe, id)) == NULL)
+ return 0;
+
+ if (VBE_MODE_USABLE(mode, 0)) {
+ int depth;
+
+ if (VBE_MODE_COLOR(mode)) {
+ depth = mode->RedMaskSize + mode->GreenMaskSize +
+ mode->BlueMaskSize;
+ } else {
+ depth = 1;
+ }
+ bpp = mode->BitsPerPixel;
+ VBEFreeModeInfo(mode);
+ mode = NULL;
+ switch (depth) {
+ case 1:
+ return V_DEPTH_1;
+ case 4:
+ return V_DEPTH_4;
+ case 8:
+ return V_DEPTH_8;
+ case 15:
+ return V_DEPTH_15;
+ case 16:
+ return V_DEPTH_16;
+ case 24:
+ switch (bpp) {
+ case 24:
+ return V_DEPTH_24_24;
+ case 32:
+ return V_DEPTH_24_32;
+ }
+ }
+ }
+ if (mode)
+ VBEFreeModeInfo(mode);
+ return 0;
+}
+
+/*
+ * Find supported mode depths.
+ */
+int
+VBEFindSupportedDepths(vbeInfoPtr pVbe, VbeInfoBlock *vbe, int *flags24,
+ int modeTypes)
+{
+ int i = 0;
+ int depths = 0;
+
+ if (modeTypes & V_MODETYPE_VBE) {
+ while (vbe->VideoModePtr[i] != 0xffff) {
+ depths |= GetDepthFlag(pVbe, vbe->VideoModePtr[i++]);
+ }
+ }
+
+ /*
+ * XXX This possibly only works with VBE 3.0 and later.
+ */
+ if (modeTypes & V_MODETYPE_VGA) {
+ for (i = 0; i < 0x7F; i++) {
+ depths |= GetDepthFlag(pVbe, i);
+ }
+ }
+
+ if (flags24) {
+ if (depths & V_DEPTH_24_24)
+ *flags24 |= Support24bppFb;
+ if (depths & V_DEPTH_24_32)
+ *flags24 |= Support32bppFb;
+ }
+
+ return depths;
+}
+
+static DisplayModePtr
+CheckMode(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe, int id,
+ int flags)
+{
+ CARD16 major, minor;
+ VbeModeInfoBlock *mode;
+ DisplayModePtr pMode, p;
+ VbeModeInfoData *data;
+ Bool modeOK = FALSE;
+ ModeStatus status = MODE_OK;
+
+ major = (unsigned)(vbe->VESAVersion >> 8);
+ minor = vbe->VESAVersion & 0xff;
+
+ if ((mode = VBEGetModeInfo(pVbe, id)) == NULL)
+ return NULL;
+
+ /* Does the mode match the depth/bpp? */
+ /* Some BIOS's set BitsPerPixel to 15 instead of 16 for 15/16 */
+ if (VBE_MODE_USABLE(mode, flags) &&
+ ((pScrn->bitsPerPixel == 1 && !VBE_MODE_COLOR(mode)) ||
+ (mode->BitsPerPixel > 8 &&
+ (mode->RedMaskSize + mode->GreenMaskSize +
+ mode->BlueMaskSize) == pScrn->depth &&
+ mode->BitsPerPixel == pScrn->bitsPerPixel) ||
+ (mode->BitsPerPixel == 15 && pScrn->depth == 15) ||
+ (mode->BitsPerPixel <= 8 &&
+ mode->BitsPerPixel == pScrn->bitsPerPixel))) {
+ modeOK = TRUE;
+ xf86ErrorFVerb(DEBUG_VERB, "*");
+ }
+
+ /*
+ * Check if there's a valid monitor mode that this one can be matched
+ * up with. The actual matching is done later.
+ */
+ if (modeOK) {
+ Bool sizeMatch = FALSE;
+ modeOK = FALSE;
+ for (p = pScrn->monitor->Modes; p != NULL; p = p->next) {
+ if ((p->HDisplay != mode->XResolution) ||
+ (p->VDisplay != mode->YResolution) ||
+ (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2)))
+ continue;
+ sizeMatch = TRUE;
+ /* XXX could support the various V_ flags */
+ status = xf86CheckModeForMonitor(p, pScrn->monitor);
+ if (status == MODE_OK) {
+ modeOK = TRUE;
+ break;
+ }
+ }
+ if (sizeMatch && !modeOK) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Not using built-in mode \"%dx%d\" (%s)\n",
+ mode->XResolution, mode->YResolution,
+ xf86ModeStatusToString(status));
+ }
+ }
+
+ xf86ErrorFVerb(DEBUG_VERB,
+ "Mode: %x (%dx%d)\n", id, mode->XResolution, mode->YResolution);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " ModeAttributes: 0x%x\n", mode->ModeAttributes);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " WinAAttributes: 0x%x\n", mode->WinAAttributes);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " WinBAttributes: 0x%x\n", mode->WinBAttributes);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " WinGranularity: %d\n", mode->WinGranularity);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " WinSize: %d\n", mode->WinSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " WinASegment: 0x%x\n", mode->WinASegment);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " WinBSegment: 0x%x\n", mode->WinBSegment);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " WinFuncPtr: 0x%x\n", mode->WinFuncPtr);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " BytesPerScanline: %d\n", mode->BytesPerScanline);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " XResolution: %d\n", mode->XResolution);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " YResolution: %d\n", mode->YResolution);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " XCharSize: %d\n", mode->XCharSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " YCharSize: %d\n", mode->YCharSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " NumberOfPlanes: %d\n", mode->NumberOfPlanes);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " BitsPerPixel: %d\n", mode->BitsPerPixel);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " NumberOfBanks: %d\n", mode->NumberOfBanks);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " MemoryModel: %d\n", mode->MemoryModel);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " BankSize: %d\n", mode->BankSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " NumberOfImages: %d\n", mode->NumberOfImages);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " RedMaskSize: %d\n", mode->RedMaskSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " RedFieldPosition: %d\n", mode->RedFieldPosition);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " GreenMaskSize: %d\n", mode->GreenMaskSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " GreenFieldPosition: %d\n", mode->GreenFieldPosition);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " BlueMaskSize: %d\n", mode->BlueMaskSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " BlueFieldPosition: %d\n", mode->BlueFieldPosition);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " RsvdMaskSize: %d\n", mode->RsvdMaskSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " RsvdFieldPosition: %d\n", mode->RsvdFieldPosition);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " DirectColorModeInfo: %d\n", mode->DirectColorModeInfo);
+ if (major >= 2) {
+ xf86ErrorFVerb(DEBUG_VERB,
+ " PhysBasePtr: 0x%x\n", mode->PhysBasePtr);
+ if (major >= 3) {
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinBytesPerScanLine: %d\n", mode->LinBytesPerScanLine);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " BnkNumberOfImagePages: %d\n", mode->BnkNumberOfImagePages);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinNumberOfImagePages: %d\n", mode->LinNumberOfImagePages);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinRedMaskSize: %d\n", mode->LinRedMaskSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinRedFieldPosition: %d\n", mode->LinRedFieldPosition);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinGreenMaskSize: %d\n", mode->LinGreenMaskSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinGreenFieldPosition: %d\n", mode->LinGreenFieldPosition);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinBlueMaskSize: %d\n", mode->LinBlueMaskSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinBlueFieldPosition: %d\n", mode->LinBlueFieldPosition);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinRsvdMaskSize: %d\n", mode->LinRsvdMaskSize);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " LinRsvdFieldPosition: %d\n", mode->LinRsvdFieldPosition);
+ xf86ErrorFVerb(DEBUG_VERB,
+ " MaxPixelClock: %d\n", mode->MaxPixelClock);
+ }
+ }
+
+ if (!modeOK) {
+ VBEFreeModeInfo(mode);
+ return NULL;
+ }
+ pMode = xnfcalloc(sizeof(DisplayModeRec), 1);
+
+ pMode->status = MODE_OK;
+ pMode->type = M_T_BUILTIN;
+
+ /* for adjust frame */
+ pMode->HDisplay = mode->XResolution;
+ pMode->VDisplay = mode->YResolution;
+
+ data = xnfcalloc(sizeof(VbeModeInfoData), 1);
+ data->mode = id;
+ data->data = mode;
+ pMode->PrivSize = sizeof(VbeModeInfoData);
+ pMode->Private = (INT32*)data;
+ pMode->next = NULL;
+ return pMode;
+}
+
+/*
+ * Check the available BIOS modes, and extract those that match the
+ * requirements into the modePool. Note: modePool is a NULL-terminated
+ * list.
+ */
+
+DisplayModePtr
+VBEGetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe, VbeInfoBlock *vbe,
+ int modeTypes)
+{
+ DisplayModePtr pMode, p = NULL, modePool = NULL;
+ int i = 0;
+
+ if (modeTypes & V_MODETYPE_VBE) {
+ while (vbe->VideoModePtr[i] != 0xffff) {
+ int id = vbe->VideoModePtr[i++];
+
+ if ((pMode = CheckMode(pScrn, pVbe, vbe, id, modeTypes)) != NULL) {
+ ModeStatus status = MODE_OK;
+
+ /* Check the mode against a specified virtual size (if any) */
+ if (pScrn->display->virtualX > 0 &&
+ pMode->HDisplay > pScrn->display->virtualX) {
+ status = MODE_VIRTUAL_X;
+ }
+ if (pScrn->display->virtualY > 0 &&
+ pMode->VDisplay > pScrn->display->virtualY) {
+ status = MODE_VIRTUAL_Y;
+ }
+ if (status != MODE_OK) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Not using mode \"%dx%d\" (%s)\n",
+ pMode->HDisplay, pMode->VDisplay,
+ xf86ModeStatusToString(status));
+ } else {
+ if (p == NULL) {
+ modePool = pMode;
+ } else {
+ p->next = pMode;
+ }
+ pMode->prev = NULL;
+ p = pMode;
+ }
+ }
+ }
+ }
+ if (modeTypes & V_MODETYPE_VGA) {
+ for (i = 0; i < 0x7F; i++) {
+ if ((pMode = CheckMode(pScrn, pVbe, vbe, i, modeTypes)) != NULL) {
+ ModeStatus status = MODE_OK;
+
+ /* Check the mode against a specified virtual size (if any) */
+ if (pScrn->display->virtualX > 0 &&
+ pMode->HDisplay > pScrn->display->virtualX) {
+ status = MODE_VIRTUAL_X;
+ }
+ if (pScrn->display->virtualY > 0 &&
+ pMode->VDisplay > pScrn->display->virtualY) {
+ status = MODE_VIRTUAL_Y;
+ }
+ if (status != MODE_OK) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Not using mode \"%dx%d\" (%s)\n",
+ pMode->HDisplay, pMode->VDisplay,
+ xf86ModeStatusToString(status));
+ } else {
+ if (p == NULL) {
+ modePool = pMode;
+ } else {
+ p->next = pMode;
+ }
+ pMode->prev = NULL;
+ p = pMode;
+ }
+ }
+ }
+ }
+ return modePool;
+}
+
+void
+VBESetModeNames(DisplayModePtr pMode)
+{
+ if (!pMode)
+ return;
+
+ do {
+ if (!pMode->name) {
+ /* Catch "bad" modes. */
+ if (pMode->HDisplay > 10000 || pMode->HDisplay < 0 ||
+ pMode->VDisplay > 10000 || pMode->VDisplay < 0) {
+ pMode->name = strdup("BADMODE");
+ } else {
+ pMode->name = xnfalloc(4 + 1 + 4 + 1);
+ sprintf(pMode->name, "%dx%d", pMode->HDisplay, pMode->VDisplay);
+ }
+ }
+ pMode = pMode->next;
+ } while (pMode);
+}
+
+/*
+ * Go through the monitor modes and selecting the best set of
+ * parameters for each BIOS mode. Note: This is only supported in
+ * VBE version 3.0 or later.
+ */
+void
+VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe)
+{
+ DisplayModePtr pMode;
+ VbeModeInfoData *data;
+
+ pMode = pScrn->modes;
+ do {
+ DisplayModePtr p, best = NULL;
+ ModeStatus status;
+
+ for (p = pScrn->monitor->Modes; p != NULL; p = p->next) {
+ if ((p->HDisplay != pMode->HDisplay) ||
+ (p->VDisplay != pMode->VDisplay) ||
+ (p->Flags & (V_INTERLACE | V_DBLSCAN | V_CLKDIV2)))
+ continue;
+ /* XXX could support the various V_ flags */
+ status = xf86CheckModeForMonitor(p, pScrn->monitor);
+ if (status != MODE_OK)
+ continue;
+ if (!best || (p->Clock > best->Clock))
+ best = p;
+ }
+
+ if (best) {
+ int clock;
+
+ data = (VbeModeInfoData*)pMode->Private;
+ pMode->HSync = (float)best->Clock * 1000.0 / best->HTotal + 0.5;
+ pMode->VRefresh = pMode->HSync / best->VTotal + 0.5;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Attempting to use %dHz refresh for mode \"%s\" (%x)\n",
+ (int)pMode->VRefresh, pMode->name, data->mode);
+ data->block = xcalloc(sizeof(VbeCRTCInfoBlock), 1);
+ data->block->HorizontalTotal = best->HTotal;
+ data->block->HorizontalSyncStart = best->HSyncStart;
+ data->block->HorizontalSyncEnd = best->HSyncEnd;
+ data->block->VerticalTotal = best->VTotal;
+ data->block->VerticalSyncStart = best->VSyncStart;
+ data->block->VerticalSyncEnd = best->VSyncEnd;
+ data->block->Flags = ((best->Flags & V_NHSYNC) ? CRTC_NHSYNC : 0) |
+ ((best->Flags & V_NVSYNC) ? CRTC_NVSYNC : 0);
+ data->block->PixelClock = best->Clock * 1000;
+ /* XXX May not have this. */
+ clock = VBEGetPixelClock(pVbe, data->mode, data->block->PixelClock);
+#ifdef DEBUG
+ ErrorF("Setting clock %.2fMHz, closest is %.2fMHz\n",
+ (double)data->block->PixelClock / 1000000.0,
+ (double)clock / 1000000.0);
+#endif
+ if (clock)
+ data->block->PixelClock = clock;
+ data->mode |= (1 << 11);
+ data->block->RefreshRate = ((double)(data->block->PixelClock) /
+ (double)(best->HTotal * best->VTotal)) * 100;
+ }
+ pMode = pMode->next;
+ } while (pMode != pScrn->modes);
+}
+
+/*
+ * These wrappers are to allow (temporary) funtionality divergences.
+ */
+int
+VBEValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
+ char **modeNames, ClockRangePtr clockRanges,
+ int *linePitches, int minPitch, int maxPitch, int pitchInc,
+ int minHeight, int maxHeight, int virtualX, int virtualY,
+ int apertureSize, LookupModeFlags strategy)
+{
+ return xf86ValidateModes(scrp, availModes, modeNames, clockRanges,
+ linePitches, minPitch, maxPitch, pitchInc,
+ minHeight, maxHeight, virtualX, virtualY,
+ apertureSize, strategy);
+}
+
+void
+VBEPrintModes(ScrnInfoPtr scrp)
+{
+ xf86PrintModes(scrp);
+}
+
diff --git a/hw/xfree86/vbe/vbeModes.h b/hw/xfree86/vbe/vbeModes.h
new file mode 100644
index 000000000..b3c57b917
--- /dev/null
+++ b/hw/xfree86/vbe/vbeModes.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright © 2002 David Dawes
+ *
+ * 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 AUTHOR(S) 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.
+ *
+ * Except as contained in this notice, the name of the author(s) shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from
+ * the author(s).
+ *
+ * Authors: David Dawes <dawes@xfree86.org>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbeModes.h,v 1.1 2003/02/17 17:06:46 dawes Exp $
+ */
+
+#ifndef _VBE_MODES_H
+
+/*
+ * This is intended to be stored in the DisplayModeRec's private area.
+ * It includes all the information necessary to VBE information.
+ */
+typedef struct _VbeModeInfoData {
+ int mode;
+ VbeModeInfoBlock *data;
+ VbeCRTCInfoBlock *block;
+} VbeModeInfoData;
+
+#define V_DEPTH_1 0x001
+#define V_DEPTH_4 0x002
+#define V_DEPTH_8 0x004
+#define V_DEPTH_15 0x008
+#define V_DEPTH_16 0x010
+#define V_DEPTH_24_24 0x020
+#define V_DEPTH_24_32 0x040
+#define V_DEPTH_24 (V_DEPTH_24_24 | V_DEPTH_24_32)
+#define V_DEPTH_30 0x080
+#define V_DEPTH_32 0x100
+
+#define VBE_MODE_SUPPORTED(m) (((m)->ModeAttributes & 0x01) != 0)
+#define VBE_MODE_COLOR(m) (((m)->ModeAttributes & 0x08) != 0)
+#define VBE_MODE_GRAPHICS(m) (((m)->ModeAttributes & 0x10) != 0)
+#define VBE_MODE_VGA(m) (((m)->ModeAttributes & 0x40) == 0)
+#define VBE_MODE_LINEAR(m) (((m)->ModeAttributes & 0x80) != 0 && \
+ ((m)->PhysBasePtr != 0))
+
+#define VBE_MODE_USABLE(m, f) (VBE_MODE_SUPPORTED(m) || \
+ (f & V_MODETYPE_BAD)) && \
+ VBE_MODE_GRAPHICS(m) && \
+ (VBE_MODE_VGA(m) || VBE_MODE_LINEAR(m))
+
+#define V_MODETYPE_VBE 0x01
+#define V_MODETYPE_VGA 0x02
+#define V_MODETYPE_BAD 0x04
+
+extern int VBEFindSupportedDepths(vbeInfoPtr pVbe, VbeInfoBlock *vbe,
+ int *flags24, int modeTypes);
+extern DisplayModePtr VBEGetModePool(ScrnInfoPtr pScrn, vbeInfoPtr pVbe,
+ VbeInfoBlock *vbe, int modeTypes);
+extern void VBESetModeNames(DisplayModePtr pMode);
+extern void VBESetModeParameters(ScrnInfoPtr pScrn, vbeInfoPtr pVbe);
+
+
+/*
+ * Note: These are alternatives to the standard helpers. They should
+ * usually just wrap the standard helpers.
+ */
+extern int VBEValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
+ char **modeNames, ClockRangePtr clockRanges,
+ int *linePitches, int minPitch, int maxPitch,
+ int pitchInc, int minHeight, int maxHeight,
+ int virtualX, int virtualY, int apertureSize,
+ LookupModeFlags strategy);
+extern void VBEPrintModes(ScrnInfoPtr scrp);
+
+#endif /* VBE_MODES_H */
diff --git a/hw/xfree86/vbe/vbe_module.c b/hw/xfree86/vbe/vbe_module.c
new file mode 100644
index 000000000..65b161a2c
--- /dev/null
+++ b/hw/xfree86/vbe/vbe_module.c
@@ -0,0 +1,50 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vbe/vbe_module.c,v 1.1 2003/02/17 17:06:46 dawes Exp $ */
+
+#include "xf86.h"
+#include "xf86str.h"
+#include "vbe.h"
+
+extern const char *vbe_ddcSymbols[];
+
+#ifdef XFree86LOADER
+
+static MODULESETUPPROTO(vbeSetup);
+
+static XF86ModuleVersionInfo vbeVersRec =
+{
+ "vbe",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 1, 0,
+ ABI_CLASS_VIDEODRV, /* needs the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData vbeModuleData = { &vbeVersRec, vbeSetup, NULL };
+
+static pointer
+vbeSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ static Bool setupDone = FALSE;
+
+ if (!setupDone) {
+ setupDone = TRUE;
+ LoaderRefSymLists(vbe_ddcSymbols,NULL);
+ /*
+ * Tell the loader about symbols from other modules that this module
+ * might refer to.
+ */
+ }
+ /*
+ * The return value must be non-NULL on success even though there
+ * is no TearDownProc.
+ */
+ return (pointer)1;
+}
+
+#endif
+
diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c
new file mode 100644
index 000000000..a70f572b5
--- /dev/null
+++ b/hw/xfree86/vgahw/vgaCmap.c
@@ -0,0 +1,301 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaCmap.c,v 1.7 2001/02/15 18:31:22 eich Exp $ */
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ * 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 Thomas Roell not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Thomas Roell makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THOMAS ROELL 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.
+ *
+ */
+/* $XConsortium: vgaCmap.c /main/15 1996/10/28 05:13:44 kaleb $ */
+
+
+#include "X.h"
+#include "Xproto.h"
+#include "windowstr.h"
+#include "compiler.h"
+#include "mipointer.h"
+#include "micmap.h"
+
+#include "xf86.h"
+#include "vgaHW.h"
+#include "xf86_ansic.h"
+
+#define _XF86DGA_SERVER_
+#include "extensions/xf86dgastr.h"
+#include "dgaproc.h"
+
+
+#define NOMAPYET (ColormapPtr) 0
+
+int
+vgaListInstalledColormaps(pScreen, pmaps)
+ ScreenPtr pScreen;
+ Colormap *pmaps;
+{
+ /* By the time we are processing requests, we can guarantee that there
+ * is always a colormap installed */
+
+ *pmaps = miInstalledMaps[pScreen->myNum]->mid;
+ return(1);
+}
+
+int
+vgaGetInstalledColormaps(pScreen, pmaps)
+ ScreenPtr pScreen;
+ ColormapPtr *pmaps;
+{
+ /* By the time we are processing requests, we can guarantee that there
+ * is always a colormap installed */
+
+ *pmaps = miInstalledMaps[pScreen->myNum];
+ return(1);
+}
+
+int vgaCheckColorMap(ColormapPtr pmap)
+{
+ return (pmap != miInstalledMaps[pmap->pScreen->myNum]);
+}
+
+
+void
+vgaStoreColors(pmap, ndef, pdefs)
+ ColormapPtr pmap;
+ int ndef;
+ xColorItem *pdefs;
+{
+ int i;
+ unsigned char *cmap, *tmp = NULL;
+ xColorItem directDefs[256];
+ Bool new_overscan = FALSE;
+ Bool writeColormap;
+
+ /* This can get called before the ScrnInfoRec is installed so we
+ can't rely on getting it with XF86SCRNINFO() */
+ int scrnIndex = pmap->pScreen->myNum;
+ ScrnInfoPtr scrninfp = xf86Screens[scrnIndex];
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+
+ unsigned char overscan = hwp->ModeReg.Attribute[OVERSCAN];
+ unsigned char tmp_overscan = 0;
+
+ if (vgaCheckColorMap(pmap))
+ return;
+
+ if ((pmap->pVisual->class | DynamicClass) == DirectColor)
+ {
+ ndef = miExpandDirectColors (pmap, ndef, pdefs, directDefs);
+ pdefs = directDefs;
+ }
+
+ writeColormap = scrninfp->vtSema;
+ if (DGAAvailable(scrnIndex))
+ {
+ writeColormap = writeColormap ||
+ (DGAGetDirectMode(scrnIndex) &&
+ !(DGAGetFlags(scrnIndex) & XF86DGADirectColormap)) ||
+ (DGAGetFlags(scrnIndex) & XF86DGAHasColormap);
+ }
+
+ if (writeColormap)
+ hwp->enablePalette(hwp);
+
+ for(i = 0; i < ndef; i++)
+ {
+ if (pdefs[i].pixel == overscan)
+ {
+ new_overscan = TRUE;
+ }
+ cmap = &(hwp->ModeReg.DAC[pdefs[i].pixel*3]);
+ if (scrninfp->rgbBits == 8) {
+ cmap[0] = pdefs[i].red >> 8;
+ cmap[1] = pdefs[i].green >> 8;
+ cmap[2] = pdefs[i].blue >> 8;
+ }
+ else {
+ cmap[0] = pdefs[i].red >> 10;
+ cmap[1] = pdefs[i].green >> 10;
+ cmap[2] = pdefs[i].blue >> 10;
+ }
+#if 0
+ if (clgd6225Lcd)
+ {
+ /* The LCD doesn't like white */
+ if (cmap[0] == 63) cmap[0]= 62;
+ if (cmap[1] == 63) cmap[1]= 62;
+ if (cmap[2] == 63) cmap[2]= 62;
+ }
+#endif
+
+ if (writeColormap)
+ {
+ if (hwp->ShowOverscan && i == 255)
+ continue;
+ hwp->writeDacWriteAddr(hwp, pdefs[i].pixel);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, cmap[0]);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, cmap[1]);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, cmap[2]);
+ DACDelay(hwp);
+ }
+ }
+ if (new_overscan && !hwp->ShowOverscan)
+ {
+ new_overscan = FALSE;
+ for(i = 0; i < ndef; i++)
+ {
+ if (pdefs[i].pixel == overscan)
+ {
+ if ((pdefs[i].red != 0) ||
+ (pdefs[i].green != 0) ||
+ (pdefs[i].blue != 0))
+ {
+ new_overscan = TRUE;
+ tmp_overscan = overscan;
+ tmp = &(hwp->ModeReg.DAC[pdefs[i].pixel*3]);
+ }
+ break;
+ }
+ }
+ if (new_overscan)
+ {
+ /*
+ * Find a black pixel, or the nearest match.
+ */
+ for (i=255; i >= 0; i--)
+ {
+ cmap = &(hwp->ModeReg.DAC[i*3]);
+ if ((cmap[0] == 0) && (cmap[1] == 0) && (cmap[2] == 0))
+ {
+ overscan = i;
+ break;
+ }
+ else
+ {
+ if ((cmap[0] < tmp[0]) &&
+ (cmap[1] < tmp[1]) && (cmap[2] < tmp[2]))
+ {
+ tmp = cmap;
+ tmp_overscan = i;
+ }
+ }
+ }
+ if (i < 0)
+ {
+ overscan = tmp_overscan;
+ }
+ hwp->ModeReg.Attribute[OVERSCAN] = overscan;
+ if (writeColormap)
+ {
+ hwp->writeAttr(hwp, OVERSCAN, overscan);
+ }
+ }
+ }
+
+ if (writeColormap)
+ hwp->disablePalette(hwp);
+}
+
+
+void
+vgaInstallColormap(pmap)
+ ColormapPtr pmap;
+{
+ ColormapPtr oldmap = miInstalledMaps[pmap->pScreen->myNum];
+ int entries;
+ Pixel * ppix;
+ xrgb * prgb;
+ xColorItem *defs;
+ int i;
+
+
+ if (pmap == oldmap)
+ return;
+
+ if ((pmap->pVisual->class | DynamicClass) == DirectColor)
+ entries = (pmap->pVisual->redMask |
+ pmap->pVisual->greenMask |
+ pmap->pVisual->blueMask) + 1;
+ else
+ entries = pmap->pVisual->ColormapEntries;
+
+ ppix = (Pixel *)ALLOCATE_LOCAL( entries * sizeof(Pixel));
+ prgb = (xrgb *)ALLOCATE_LOCAL( entries * sizeof(xrgb));
+ defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
+
+ if ( oldmap != NOMAPYET)
+ WalkTree( pmap->pScreen, TellLostMap, &oldmap->mid);
+
+ miInstalledMaps[pmap->pScreen->myNum] = pmap;
+
+ for ( i=0; i<entries; i++) ppix[i] = i;
+
+ QueryColors( pmap, entries, ppix, prgb);
+
+ for ( i=0; i<entries; i++) /* convert xrgbs to xColorItems */
+ {
+ defs[i].pixel = ppix[i];
+ defs[i].red = prgb[i].red;
+ defs[i].green = prgb[i].green;
+ defs[i].blue = prgb[i].blue;
+ defs[i].flags = DoRed|DoGreen|DoBlue;
+ }
+ pmap->pScreen->StoreColors(pmap, entries, defs);
+
+ WalkTree(pmap->pScreen, TellGainedMap, &pmap->mid);
+
+ DEALLOCATE_LOCAL(ppix);
+ DEALLOCATE_LOCAL(prgb);
+ DEALLOCATE_LOCAL(defs);
+}
+
+
+void
+vgaUninstallColormap(pmap)
+ ColormapPtr pmap;
+{
+
+ ColormapPtr defColormap;
+
+ if ( pmap != miInstalledMaps[pmap->pScreen->myNum] )
+ return;
+
+ defColormap = (ColormapPtr) LookupIDByType( pmap->pScreen->defColormap,
+ RT_COLORMAP);
+
+ if (defColormap == miInstalledMaps[pmap->pScreen->myNum])
+ return;
+
+ (*pmap->pScreen->InstallColormap) (defColormap);
+}
+
+
+void
+vgaHandleColormaps(ScreenPtr pScreen, ScrnInfoPtr scrnp)
+{
+ if (scrnp->bitsPerPixel > 1) {
+ if (scrnp->bitsPerPixel <= 8) { /* For 8bpp SVGA and VGA16 */
+ pScreen->InstallColormap = vgaInstallColormap;
+ pScreen->UninstallColormap = vgaUninstallColormap;
+ pScreen->ListInstalledColormaps = vgaListInstalledColormaps;
+ pScreen->StoreColors = vgaStoreColors;
+ }
+ }
+}
+
diff --git a/hw/xfree86/vgahw/vgaHW.c b/hw/xfree86/vgahw/vgaHW.c
new file mode 100644
index 000000000..e598d91a2
--- /dev/null
+++ b/hw/xfree86/vgahw/vgaHW.c
@@ -0,0 +1,2021 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.57 2003/02/24 21:29:36 tsi Exp $ */
+
+/*
+ *
+ * Copyright 1991-1999 by The XFree86 Project, Inc.
+ *
+ * Loosely based on code bearing the following copyright:
+ *
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ */
+
+#define _NEED_SYSI86
+
+#include "X.h"
+#include "misc.h"
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "xf86_ansic.h"
+#include "vgaHW.h"
+
+#include "compiler.h"
+
+#include "xf86cmap.h"
+
+#ifndef SAVE_FONT1
+#define SAVE_FONT1
+#endif
+
+/*
+ * These used to be OS-specific, which made this module have an undesirable
+ * OS dependency. Define them by default for all platforms.
+ */
+#ifndef NEED_SAVED_CMAP
+#define NEED_SAVED_CMAP
+#endif
+#ifndef SAVE_TEXT
+#define SAVE_TEXT
+#endif
+#ifndef SAVE_FONT2
+#define SAVE_FONT2
+#endif
+
+/* bytes per plane to save for text */
+#define TEXT_AMOUNT 16384
+
+/* bytes per plane to save for font data */
+#define FONT_AMOUNT (8*8192)
+
+#if 0
+/* Override all of these for now */
+#undef SAVE_FONT1
+#define SAVE_FONT1
+#undef SAVE_FONT2
+#define SAVE_FONT2
+#undef SAVE_TEST
+#define SAVE_TEST
+#undef FONT_AMOUNT
+#define FONT_AMOUNT 65536
+#undef TEXT_AMOUNT
+#define TEXT_AMOUNT 65536
+#endif
+
+/* DAC indices for white and black */
+#define WHITE_VALUE 0x3F
+#define BLACK_VALUE 0x00
+#define OVERSCAN_VALUE 0x01
+
+
+/* Use a private definition of this here */
+#undef VGAHWPTR
+#define VGAHWPTRLVAL(p) (p)->privates[vgaHWPrivateIndex].ptr
+#define VGAHWPTR(p) ((vgaHWPtr)(VGAHWPTRLVAL(p)))
+
+static int vgaHWPrivateIndex = -1;
+
+#define DAC_TEST_MASK 0x3F
+
+#ifdef NEED_SAVED_CMAP
+/* This default colourmap is used only when it can't be read from the VGA */
+
+static CARD8 defaultDAC[768] =
+{
+ 0, 0, 0, 0, 0, 42, 0, 42, 0, 0, 42, 42,
+ 42, 0, 0, 42, 0, 42, 42, 21, 0, 42, 42, 42,
+ 21, 21, 21, 21, 21, 63, 21, 63, 21, 21, 63, 63,
+ 63, 21, 21, 63, 21, 63, 63, 63, 21, 63, 63, 63,
+ 0, 0, 0, 5, 5, 5, 8, 8, 8, 11, 11, 11,
+ 14, 14, 14, 17, 17, 17, 20, 20, 20, 24, 24, 24,
+ 28, 28, 28, 32, 32, 32, 36, 36, 36, 40, 40, 40,
+ 45, 45, 45, 50, 50, 50, 56, 56, 56, 63, 63, 63,
+ 0, 0, 63, 16, 0, 63, 31, 0, 63, 47, 0, 63,
+ 63, 0, 63, 63, 0, 47, 63, 0, 31, 63, 0, 16,
+ 63, 0, 0, 63, 16, 0, 63, 31, 0, 63, 47, 0,
+ 63, 63, 0, 47, 63, 0, 31, 63, 0, 16, 63, 0,
+ 0, 63, 0, 0, 63, 16, 0, 63, 31, 0, 63, 47,
+ 0, 63, 63, 0, 47, 63, 0, 31, 63, 0, 16, 63,
+ 31, 31, 63, 39, 31, 63, 47, 31, 63, 55, 31, 63,
+ 63, 31, 63, 63, 31, 55, 63, 31, 47, 63, 31, 39,
+ 63, 31, 31, 63, 39, 31, 63, 47, 31, 63, 55, 31,
+ 63, 63, 31, 55, 63, 31, 47, 63, 31, 39, 63, 31,
+ 31, 63, 31, 31, 63, 39, 31, 63, 47, 31, 63, 55,
+ 31, 63, 63, 31, 55, 63, 31, 47, 63, 31, 39, 63,
+ 45, 45, 63, 49, 45, 63, 54, 45, 63, 58, 45, 63,
+ 63, 45, 63, 63, 45, 58, 63, 45, 54, 63, 45, 49,
+ 63, 45, 45, 63, 49, 45, 63, 54, 45, 63, 58, 45,
+ 63, 63, 45, 58, 63, 45, 54, 63, 45, 49, 63, 45,
+ 45, 63, 45, 45, 63, 49, 45, 63, 54, 45, 63, 58,
+ 45, 63, 63, 45, 58, 63, 45, 54, 63, 45, 49, 63,
+ 0, 0, 28, 7, 0, 28, 14, 0, 28, 21, 0, 28,
+ 28, 0, 28, 28, 0, 21, 28, 0, 14, 28, 0, 7,
+ 28, 0, 0, 28, 7, 0, 28, 14, 0, 28, 21, 0,
+ 28, 28, 0, 21, 28, 0, 14, 28, 0, 7, 28, 0,
+ 0, 28, 0, 0, 28, 7, 0, 28, 14, 0, 28, 21,
+ 0, 28, 28, 0, 21, 28, 0, 14, 28, 0, 7, 28,
+ 14, 14, 28, 17, 14, 28, 21, 14, 28, 24, 14, 28,
+ 28, 14, 28, 28, 14, 24, 28, 14, 21, 28, 14, 17,
+ 28, 14, 14, 28, 17, 14, 28, 21, 14, 28, 24, 14,
+ 28, 28, 14, 24, 28, 14, 21, 28, 14, 17, 28, 14,
+ 14, 28, 14, 14, 28, 17, 14, 28, 21, 14, 28, 24,
+ 14, 28, 28, 14, 24, 28, 14, 21, 28, 14, 17, 28,
+ 20, 20, 28, 22, 20, 28, 24, 20, 28, 26, 20, 28,
+ 28, 20, 28, 28, 20, 26, 28, 20, 24, 28, 20, 22,
+ 28, 20, 20, 28, 22, 20, 28, 24, 20, 28, 26, 20,
+ 28, 28, 20, 26, 28, 20, 24, 28, 20, 22, 28, 20,
+ 20, 28, 20, 20, 28, 22, 20, 28, 24, 20, 28, 26,
+ 20, 28, 28, 20, 26, 28, 20, 24, 28, 20, 22, 28,
+ 0, 0, 16, 4, 0, 16, 8, 0, 16, 12, 0, 16,
+ 16, 0, 16, 16, 0, 12, 16, 0, 8, 16, 0, 4,
+ 16, 0, 0, 16, 4, 0, 16, 8, 0, 16, 12, 0,
+ 16, 16, 0, 12, 16, 0, 8, 16, 0, 4, 16, 0,
+ 0, 16, 0, 0, 16, 4, 0, 16, 8, 0, 16, 12,
+ 0, 16, 16, 0, 12, 16, 0, 8, 16, 0, 4, 16,
+ 8, 8, 16, 10, 8, 16, 12, 8, 16, 14, 8, 16,
+ 16, 8, 16, 16, 8, 14, 16, 8, 12, 16, 8, 10,
+ 16, 8, 8, 16, 10, 8, 16, 12, 8, 16, 14, 8,
+ 16, 16, 8, 14, 16, 8, 12, 16, 8, 10, 16, 8,
+ 8, 16, 8, 8, 16, 10, 8, 16, 12, 8, 16, 14,
+ 8, 16, 16, 8, 14, 16, 8, 12, 16, 8, 10, 16,
+ 11, 11, 16, 12, 11, 16, 13, 11, 16, 15, 11, 16,
+ 16, 11, 16, 16, 11, 15, 16, 11, 13, 16, 11, 12,
+ 16, 11, 11, 16, 12, 11, 16, 13, 11, 16, 15, 11,
+ 16, 16, 11, 15, 16, 11, 13, 16, 11, 12, 16, 11,
+ 11, 16, 11, 11, 16, 12, 11, 16, 13, 11, 16, 15,
+ 11, 16, 16, 11, 15, 16, 11, 13, 16, 11, 12, 16,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+#endif /* NEED_SAVED_CMAP */
+
+/*
+ * Standard VGA versions of the register access functions.
+ */
+static void
+stdWriteCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value)
+{
+ outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_INDEX_OFFSET, index);
+ outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_DATA_OFFSET, value);
+}
+
+static CARD8
+stdReadCrtc(vgaHWPtr hwp, CARD8 index)
+{
+ outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_INDEX_OFFSET, index);
+ return inb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_DATA_OFFSET);
+}
+
+static void
+stdWriteGr(vgaHWPtr hwp, CARD8 index, CARD8 value)
+{
+ outb(hwp->PIOOffset + VGA_GRAPH_INDEX, index);
+ outb(hwp->PIOOffset + VGA_GRAPH_DATA, value);
+}
+
+static CARD8
+stdReadGr(vgaHWPtr hwp, CARD8 index)
+{
+ outb(hwp->PIOOffset + VGA_GRAPH_INDEX, index);
+ return inb(hwp->PIOOffset + VGA_GRAPH_DATA);
+}
+
+static void
+stdWriteSeq(vgaHWPtr hwp, CARD8 index, CARD8 value)
+{
+ outb(hwp->PIOOffset + VGA_SEQ_INDEX, index);
+ outb(hwp->PIOOffset + VGA_SEQ_DATA, value);
+}
+
+static CARD8
+stdReadSeq(vgaHWPtr hwp, CARD8 index)
+{
+ outb(hwp->PIOOffset + VGA_SEQ_INDEX, index);
+ return inb(hwp->PIOOffset + VGA_SEQ_DATA);
+}
+
+static CARD8
+stdReadST00(vgaHWPtr hwp)
+{
+ return inb(hwp->PIOOffset + VGA_IN_STAT_0);
+}
+
+static CARD8
+stdReadST01(vgaHWPtr hwp)
+{
+ return inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
+}
+
+static CARD8
+stdReadFCR(vgaHWPtr hwp)
+{
+ return inb(hwp->PIOOffset + VGA_FEATURE_R);
+}
+
+static void
+stdWriteFCR(vgaHWPtr hwp, CARD8 value)
+{
+ outb(hwp->IOBase + hwp->PIOOffset + VGA_FEATURE_W_OFFSET,value);
+}
+
+static void
+stdWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value)
+{
+ CARD8 tmp;
+
+ if (hwp->paletteEnabled)
+ index &= ~0x20;
+ else
+ index |= 0x20;
+
+ tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
+ outb(hwp->PIOOffset + VGA_ATTR_INDEX, index);
+ outb(hwp->PIOOffset + VGA_ATTR_DATA_W, value);
+}
+
+static CARD8
+stdReadAttr(vgaHWPtr hwp, CARD8 index)
+{
+ CARD8 tmp;
+
+ if (hwp->paletteEnabled)
+ index &= ~0x20;
+ else
+ index |= 0x20;
+
+ tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
+ outb(hwp->PIOOffset + VGA_ATTR_INDEX, index);
+ return inb(hwp->PIOOffset + VGA_ATTR_DATA_R);
+}
+
+static void
+stdWriteMiscOut(vgaHWPtr hwp, CARD8 value)
+{
+ outb(hwp->PIOOffset + VGA_MISC_OUT_W, value);
+}
+
+static CARD8
+stdReadMiscOut(vgaHWPtr hwp)
+{
+ return inb(hwp->PIOOffset + VGA_MISC_OUT_R);
+}
+
+static void
+stdEnablePalette(vgaHWPtr hwp)
+{
+ CARD8 tmp;
+
+ tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
+ outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x00);
+ hwp->paletteEnabled = TRUE;
+}
+
+static void
+stdDisablePalette(vgaHWPtr hwp)
+{
+ CARD8 tmp;
+
+ tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET);
+ outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x20);
+ hwp->paletteEnabled = FALSE;
+}
+
+static void
+stdWriteDacMask(vgaHWPtr hwp, CARD8 value)
+{
+ outb(hwp->PIOOffset + VGA_DAC_MASK, value);
+}
+
+static CARD8
+stdReadDacMask(vgaHWPtr hwp)
+{
+ return inb(hwp->PIOOffset + VGA_DAC_MASK);
+}
+
+static void
+stdWriteDacReadAddr(vgaHWPtr hwp, CARD8 value)
+{
+ outb(hwp->PIOOffset + VGA_DAC_READ_ADDR, value);
+}
+
+static void
+stdWriteDacWriteAddr(vgaHWPtr hwp, CARD8 value)
+{
+ outb(hwp->PIOOffset + VGA_DAC_WRITE_ADDR, value);
+}
+
+static void
+stdWriteDacData(vgaHWPtr hwp, CARD8 value)
+{
+ outb(hwp->PIOOffset + VGA_DAC_DATA, value);
+}
+
+static CARD8
+stdReadDacData(vgaHWPtr hwp)
+{
+ return inb(hwp->PIOOffset + VGA_DAC_DATA);
+}
+
+static CARD8
+stdReadEnable(vgaHWPtr hwp)
+{
+ return inb(hwp->PIOOffset + VGA_ENABLE);
+}
+
+static void
+stdWriteEnable(vgaHWPtr hwp, CARD8 value)
+{
+ outb(hwp->PIOOffset + VGA_ENABLE, value);
+}
+
+void
+vgaHWSetStdFuncs(vgaHWPtr hwp)
+{
+ hwp->writeCrtc = stdWriteCrtc;
+ hwp->readCrtc = stdReadCrtc;
+ hwp->writeGr = stdWriteGr;
+ hwp->readGr = stdReadGr;
+ hwp->readST00 = stdReadST00;
+ hwp->readST01 = stdReadST01;
+ hwp->readFCR = stdReadFCR;
+ hwp->writeFCR = stdWriteFCR;
+ hwp->writeAttr = stdWriteAttr;
+ hwp->readAttr = stdReadAttr;
+ hwp->writeSeq = stdWriteSeq;
+ hwp->readSeq = stdReadSeq;
+ hwp->writeMiscOut = stdWriteMiscOut;
+ hwp->readMiscOut = stdReadMiscOut;
+ hwp->enablePalette = stdEnablePalette;
+ hwp->disablePalette = stdDisablePalette;
+ hwp->writeDacMask = stdWriteDacMask;
+ hwp->readDacMask = stdReadDacMask;
+ hwp->writeDacWriteAddr = stdWriteDacWriteAddr;
+ hwp->writeDacReadAddr = stdWriteDacReadAddr;
+ hwp->writeDacData = stdWriteDacData;
+ hwp->readDacData = stdReadDacData;
+ hwp->PIOOffset = 0;
+ hwp->readEnable = stdReadEnable;
+ hwp->writeEnable = stdWriteEnable;
+}
+
+/*
+ * MMIO versions of the register access functions. These require
+ * hwp->MemBase to be set in such a way that when the standard VGA port
+ * adderss is added the correct memory address results.
+ */
+
+#define minb(p) MMIO_IN8(hwp->MMIOBase, (hwp->MMIOOffset + (p)))
+#define moutb(p,v) MMIO_OUT8(hwp->MMIOBase, (hwp->MMIOOffset + (p)),(v))
+
+static void
+mmioWriteCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value)
+{
+ moutb(hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index);
+ moutb(hwp->IOBase + VGA_CRTC_DATA_OFFSET, value);
+}
+
+static CARD8
+mmioReadCrtc(vgaHWPtr hwp, CARD8 index)
+{
+ moutb(hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index);
+ return minb(hwp->IOBase + VGA_CRTC_DATA_OFFSET);
+}
+
+static void
+mmioWriteGr(vgaHWPtr hwp, CARD8 index, CARD8 value)
+{
+ moutb(VGA_GRAPH_INDEX, index);
+ moutb(VGA_GRAPH_DATA, value);
+}
+
+static CARD8
+mmioReadGr(vgaHWPtr hwp, CARD8 index)
+{
+ moutb(VGA_GRAPH_INDEX, index);
+ return minb(VGA_GRAPH_DATA);
+}
+
+static void
+mmioWriteSeq(vgaHWPtr hwp, CARD8 index, CARD8 value)
+{
+ moutb(VGA_SEQ_INDEX, index);
+ moutb(VGA_SEQ_DATA, value);
+}
+
+static CARD8
+mmioReadSeq(vgaHWPtr hwp, CARD8 index)
+{
+ moutb(VGA_SEQ_INDEX, index);
+ return minb(VGA_SEQ_DATA);
+}
+
+static CARD8
+mmioReadST00(vgaHWPtr hwp)
+{
+ return minb(VGA_IN_STAT_0);
+}
+
+static CARD8
+mmioReadST01(vgaHWPtr hwp)
+{
+ return minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+}
+
+static CARD8
+mmioReadFCR(vgaHWPtr hwp)
+{
+ return minb(VGA_FEATURE_R);
+}
+
+static void
+mmioWriteFCR(vgaHWPtr hwp, CARD8 value)
+{
+ moutb(hwp->IOBase + VGA_FEATURE_W_OFFSET,value);
+}
+
+static void
+mmioWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value)
+{
+ CARD8 tmp;
+
+ if (hwp->paletteEnabled)
+ index &= ~0x20;
+ else
+ index |= 0x20;
+
+ tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+ moutb(VGA_ATTR_INDEX, index);
+ moutb(VGA_ATTR_DATA_W, value);
+}
+
+static CARD8
+mmioReadAttr(vgaHWPtr hwp, CARD8 index)
+{
+ CARD8 tmp;
+
+ if (hwp->paletteEnabled)
+ index &= ~0x20;
+ else
+ index |= 0x20;
+
+ tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+ moutb(VGA_ATTR_INDEX, index);
+ return minb(VGA_ATTR_DATA_R);
+}
+
+static void
+mmioWriteMiscOut(vgaHWPtr hwp, CARD8 value)
+{
+ moutb(VGA_MISC_OUT_W, value);
+}
+
+static CARD8
+mmioReadMiscOut(vgaHWPtr hwp)
+{
+ return minb(VGA_MISC_OUT_R);
+}
+
+static void
+mmioEnablePalette(vgaHWPtr hwp)
+{
+ CARD8 tmp;
+
+ tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+ moutb(VGA_ATTR_INDEX, 0x00);
+ hwp->paletteEnabled = TRUE;
+}
+
+static void
+mmioDisablePalette(vgaHWPtr hwp)
+{
+ CARD8 tmp;
+
+ tmp = minb(hwp->IOBase + VGA_IN_STAT_1_OFFSET);
+ moutb(VGA_ATTR_INDEX, 0x20);
+ hwp->paletteEnabled = FALSE;
+}
+
+static void
+mmioWriteDacMask(vgaHWPtr hwp, CARD8 value)
+{
+ moutb(VGA_DAC_MASK, value);
+}
+
+static CARD8
+mmioReadDacMask(vgaHWPtr hwp)
+{
+ return minb(VGA_DAC_MASK);
+}
+
+static void
+mmioWriteDacReadAddr(vgaHWPtr hwp, CARD8 value)
+{
+ moutb(VGA_DAC_READ_ADDR, value);
+}
+
+static void
+mmioWriteDacWriteAddr(vgaHWPtr hwp, CARD8 value)
+{
+ moutb(VGA_DAC_WRITE_ADDR, value);
+}
+
+static void
+mmioWriteDacData(vgaHWPtr hwp, CARD8 value)
+{
+ moutb(VGA_DAC_DATA, value);
+}
+
+static CARD8
+mmioReadDacData(vgaHWPtr hwp)
+{
+ return minb(VGA_DAC_DATA);
+}
+
+static CARD8
+mmioReadEnable(vgaHWPtr hwp)
+{
+ return minb(VGA_ENABLE);
+}
+
+static void
+mmioWriteEnable(vgaHWPtr hwp, CARD8 value)
+{
+ moutb(VGA_ENABLE, value);
+}
+
+void
+vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset)
+{
+ hwp->writeCrtc = mmioWriteCrtc;
+ hwp->readCrtc = mmioReadCrtc;
+ hwp->writeGr = mmioWriteGr;
+ hwp->readGr = mmioReadGr;
+ hwp->readST00 = mmioReadST00;
+ hwp->readST01 = mmioReadST01;
+ hwp->readFCR = mmioReadFCR;
+ hwp->writeFCR = mmioWriteFCR;
+ hwp->writeAttr = mmioWriteAttr;
+ hwp->readAttr = mmioReadAttr;
+ hwp->writeSeq = mmioWriteSeq;
+ hwp->readSeq = mmioReadSeq;
+ hwp->writeMiscOut = mmioWriteMiscOut;
+ hwp->readMiscOut = mmioReadMiscOut;
+ hwp->enablePalette = mmioEnablePalette;
+ hwp->disablePalette = mmioDisablePalette;
+ hwp->writeDacMask = mmioWriteDacMask;
+ hwp->readDacMask = mmioReadDacMask;
+ hwp->writeDacWriteAddr = mmioWriteDacWriteAddr;
+ hwp->writeDacReadAddr = mmioWriteDacReadAddr;
+ hwp->writeDacData = mmioWriteDacData;
+ hwp->readDacData = mmioReadDacData;
+ hwp->MMIOBase = base;
+ hwp->MMIOOffset = offset;
+ hwp->readEnable = mmioReadEnable;
+ hwp->writeEnable = mmioWriteEnable;
+}
+
+/*
+ * vgaHWProtect --
+ * Protect VGA registers and memory from corruption during loads.
+ */
+
+void
+vgaHWProtect(ScrnInfoPtr pScrn, Bool on)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+ unsigned char tmp;
+
+ if (pScrn->vtSema) {
+ if (on) {
+ /*
+ * Turn off screen and disable sequencer.
+ */
+ tmp = hwp->readSeq(hwp, 0x01);
+
+ vgaHWSeqReset(hwp, TRUE); /* start synchronous reset */
+ hwp->writeSeq(hwp, 0x01, tmp | 0x20); /* disable the display */
+
+ hwp->enablePalette(hwp);
+ } else {
+ /*
+ * Reenable sequencer, then turn on screen.
+ */
+
+ tmp = hwp->readSeq(hwp, 0x01);
+
+ hwp->writeSeq(hwp, 0x01, tmp & ~0x20); /* reenable display */
+ vgaHWSeqReset(hwp, FALSE); /* clear synchronousreset */
+
+ hwp->disablePalette(hwp);
+ }
+ }
+}
+
+
+/*
+ * vgaHWBlankScreen -- blank the screen.
+ */
+
+void
+vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ unsigned char scrn;
+
+ scrn = hwp->readSeq(hwp, 0x01);
+
+ if (on) {
+ scrn &= ~0x20; /* enable screen */
+ } else {
+ scrn |= 0x20; /* blank screen */
+ }
+
+ vgaHWSeqReset(hwp, TRUE);
+ hwp->writeSeq(hwp, 0x01, scrn); /* change mode */
+ vgaHWSeqReset(hwp, FALSE);
+}
+
+
+/*
+ * vgaHWSaveScreen -- blank the screen.
+ */
+
+Bool
+vgaHWSaveScreen(ScreenPtr pScreen, int mode)
+{
+ ScrnInfoPtr pScrn = NULL;
+ Bool on;
+
+ if (pScreen != NULL)
+ pScrn = xf86Screens[pScreen->myNum];
+
+ on = xf86IsUnblank(mode);
+
+#if 0
+ if (on)
+ SetTimeSinceLastInputEvent();
+#endif
+
+ if ((pScrn != NULL) && pScrn->vtSema) {
+ vgaHWBlankScreen(pScrn, on);
+ }
+ return (TRUE);
+}
+
+
+/*
+ * vgaHWDPMSSet -- Sets VESA Display Power Management Signaling (DPMS) Mode
+ *
+ * This generic VGA function can only set the Off and On modes. If the
+ * Standby and Suspend modes are to be supported, a chip specific replacement
+ * for this function must be written.
+ */
+
+void
+vgaHWDPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags)
+{
+ unsigned char seq1 = 0, crtc17 = 0;
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+ if (!pScrn->vtSema) return;
+
+ switch (PowerManagementMode) {
+ case DPMSModeOn:
+ /* Screen: On; HSync: On, VSync: On */
+ seq1 = 0x00;
+ crtc17 = 0x80;
+ break;
+ case DPMSModeStandby:
+ /* Screen: Off; HSync: Off, VSync: On -- Not Supported */
+ seq1 = 0x20;
+ crtc17 = 0x80;
+ break;
+ case DPMSModeSuspend:
+ /* Screen: Off; HSync: On, VSync: Off -- Not Supported */
+ seq1 = 0x20;
+ crtc17 = 0x80;
+ break;
+ case DPMSModeOff:
+ /* Screen: Off; HSync: Off, VSync: Off */
+ seq1 = 0x20;
+ crtc17 = 0x00;
+ break;
+ }
+ hwp->writeSeq(hwp, 0x00, 0x01); /* Synchronous Reset */
+ seq1 |= hwp->readSeq(hwp, 0x01) & ~0x20;
+ hwp->writeSeq(hwp, 0x01, seq1);
+ crtc17 |= hwp->readCrtc(hwp, 0x17) & ~0x80;
+ usleep(10000);
+ hwp->writeCrtc(hwp, 0x17, crtc17);
+ hwp->writeSeq(hwp, 0x00, 0x03); /* End Reset */
+}
+
+
+/*
+ * vgaHWSeqReset
+ * perform a sequencer reset.
+ */
+
+void
+vgaHWSeqReset(vgaHWPtr hwp, Bool start)
+{
+ if (start)
+ hwp->writeSeq(hwp, 0x00, 0x01); /* Synchronous Reset */
+ else
+ hwp->writeSeq(hwp, 0x00, 0x03); /* End Reset */
+}
+
+
+void
+vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ int savedIOBase;
+ unsigned char miscOut, attr10, gr1, gr3, gr4, gr5, gr6, gr8, seq2, seq4;
+ Bool doMap = FALSE;
+
+#if defined(SAVE_TEXT) || defined(SAVE_FONT1) || defined(SAVE_FONT2)
+
+ /* If nothing to do, return now */
+ if (!hwp->FontInfo1 && !hwp->FontInfo2 && !hwp->TextInfo)
+ return;
+
+ if (hwp->Base == NULL) {
+ doMap = TRUE;
+ if (!vgaHWMapMem(scrninfp)) {
+ xf86DrvMsg(scrninfp->scrnIndex, X_ERROR,
+ "vgaHWRestoreFonts: vgaHWMapMem() failed\n");
+ return;
+ }
+ }
+
+ /* save the registers that are needed here */
+ miscOut = hwp->readMiscOut(hwp);
+ attr10 = hwp->readAttr(hwp, 0x10);
+ gr1 = hwp->readGr(hwp, 0x01);
+ gr3 = hwp->readGr(hwp, 0x03);
+ gr4 = hwp->readGr(hwp, 0x04);
+ gr5 = hwp->readGr(hwp, 0x05);
+ gr6 = hwp->readGr(hwp, 0x06);
+ gr8 = hwp->readGr(hwp, 0x08);
+ seq2 = hwp->readSeq(hwp, 0x02);
+ seq4 = hwp->readSeq(hwp, 0x04);
+
+ /* save hwp->IOBase and temporarily set it for colour mode */
+ savedIOBase = hwp->IOBase;
+ hwp->IOBase = VGA_IOBASE_COLOR;
+
+ /* Force into colour mode */
+ hwp->writeMiscOut(hwp, miscOut | 0x01);
+
+ vgaHWBlankScreen(scrninfp, FALSE);
+
+ /*
+ * here we temporarily switch to 16 colour planar mode, to simply
+ * copy the font-info and saved text.
+ *
+ * BUG ALERT: The (S)VGA's segment-select register MUST be set correctly!
+ */
+#if 0
+ hwp->writeAttr(hwp, 0x10, 0x01); /* graphics mode */
+#endif
+ if (scrninfp->depth == 4) {
+ /* GJA */
+ hwp->writeGr(hwp, 0x03, 0x00); /* don't rotate, write unmodified */
+ hwp->writeGr(hwp, 0x08, 0xFF); /* write all bits in a byte */
+ hwp->writeGr(hwp, 0x01, 0x00); /* all planes come from CPU */
+ }
+
+#ifdef SAVE_FONT1
+ if (hwp->FontInfo1) {
+ hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+ slowbcopy_tobus(hwp->FontInfo1, hwp->Base, FONT_AMOUNT);
+ }
+#endif
+
+#ifdef SAVE_FONT2
+ if (hwp->FontInfo2) {
+ hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+ slowbcopy_tobus(hwp->FontInfo2, hwp->Base, FONT_AMOUNT);
+ }
+#endif
+
+#ifdef SAVE_TEXT
+ if (hwp->TextInfo) {
+ hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+ slowbcopy_tobus(hwp->TextInfo, hwp->Base, TEXT_AMOUNT);
+ hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+ slowbcopy_tobus((unsigned char *)hwp->TextInfo + TEXT_AMOUNT,
+ hwp->Base, TEXT_AMOUNT);
+ }
+#endif
+
+ vgaHWBlankScreen(scrninfp, TRUE);
+
+ /* restore the registers that were changed */
+ hwp->writeMiscOut(hwp, miscOut);
+ hwp->writeAttr(hwp, 0x10, attr10);
+ hwp->writeGr(hwp, 0x01, gr1);
+ hwp->writeGr(hwp, 0x03, gr3);
+ hwp->writeGr(hwp, 0x04, gr4);
+ hwp->writeGr(hwp, 0x05, gr5);
+ hwp->writeGr(hwp, 0x06, gr6);
+ hwp->writeGr(hwp, 0x08, gr8);
+ hwp->writeSeq(hwp, 0x02, seq2);
+ hwp->writeSeq(hwp, 0x04, seq4);
+ hwp->IOBase = savedIOBase;
+
+ if (doMap)
+ vgaHWUnmapMem(scrninfp);
+
+#endif /* defined(SAVE_TEXT) || defined(SAVE_FONT1) || defined(SAVE_FONT2) */
+}
+
+
+void
+vgaHWRestoreMode(ScrnInfoPtr scrninfp, vgaRegPtr restore)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ int i;
+
+ if (restore->MiscOutReg & 0x01)
+ hwp->IOBase = VGA_IOBASE_COLOR;
+ else
+ hwp->IOBase = VGA_IOBASE_MONO;
+
+ hwp->writeMiscOut(hwp, restore->MiscOutReg);
+
+ for (i = 1; i < restore->numSequencer; i++)
+ hwp->writeSeq(hwp, i, restore->Sequencer[i]);
+
+ /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 or CRTC[17] */
+
+ hwp->writeCrtc(hwp, 17, restore->CRTC[17] & ~0x80);
+
+ for (i = 0; i < restore->numCRTC; i++)
+ hwp->writeCrtc(hwp, i, restore->CRTC[i]);
+
+ for (i = 0; i < restore->numGraphics; i++)
+ hwp->writeGr(hwp, i, restore->Graphics[i]);
+
+ hwp->enablePalette(hwp);
+ for (i = 0; i < restore->numAttribute; i++)
+ hwp->writeAttr(hwp, i, restore->Attribute[i]);
+ hwp->disablePalette(hwp);
+}
+
+
+void
+vgaHWRestoreColormap(ScrnInfoPtr scrninfp, vgaRegPtr restore)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ int i;
+
+#if 0
+ hwp->enablePalette(hwp);
+#endif
+
+ hwp->writeDacMask(hwp, 0xFF);
+ hwp->writeDacWriteAddr(hwp, 0x00);
+ for (i = 0; i < 768; i++) {
+ hwp->writeDacData(hwp, restore->DAC[i]);
+ DACDelay(hwp);
+ }
+
+ hwp->disablePalette(hwp);
+}
+
+
+/*
+ * vgaHWRestore --
+ * restore the VGA state
+ */
+
+void
+vgaHWRestore(ScrnInfoPtr scrninfp, vgaRegPtr restore, int flags)
+{
+ if (flags & VGA_SR_MODE)
+ vgaHWRestoreMode(scrninfp, restore);
+
+ if (flags & VGA_SR_FONTS)
+ vgaHWRestoreFonts(scrninfp, restore);
+
+ if (flags & VGA_SR_CMAP)
+ vgaHWRestoreColormap(scrninfp, restore);
+}
+
+void
+vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ int savedIOBase;
+ unsigned char miscOut, attr10, gr4, gr5, gr6, seq2, seq4;
+ Bool doMap = FALSE;
+
+#if defined(SAVE_TEXT) || defined(SAVE_FONT1) || defined(SAVE_FONT2)
+
+ if (hwp->Base == NULL) {
+ doMap = TRUE;
+ if (!vgaHWMapMem(scrninfp)) {
+ xf86DrvMsg(scrninfp->scrnIndex, X_ERROR,
+ "vgaHWSaveFonts: vgaHWMapMem() failed\n");
+ return;
+ }
+ }
+
+ /* If in graphics mode, don't save anything */
+ attr10 = hwp->readAttr(hwp, 0x10);
+ if (attr10 & 0x01)
+ return;
+
+ /* save the registers that are needed here */
+ miscOut = hwp->readMiscOut(hwp);
+ gr4 = hwp->readGr(hwp, 0x04);
+ gr5 = hwp->readGr(hwp, 0x05);
+ gr6 = hwp->readGr(hwp, 0x06);
+ seq2 = hwp->readSeq(hwp, 0x02);
+ seq4 = hwp->readSeq(hwp, 0x04);
+
+ /* save hwp->IOBase and temporarily set it for colour mode */
+ savedIOBase = hwp->IOBase;
+ hwp->IOBase = VGA_IOBASE_COLOR;
+
+ /* Force into colour mode */
+ hwp->writeMiscOut(hwp, miscOut | 0x01);
+
+ vgaHWBlankScreen(scrninfp, FALSE);
+
+ /*
+ * get the character sets, and text screen if required
+ */
+ /*
+ * Here we temporarily switch to 16 colour planar mode, to simply
+ * copy the font-info
+ *
+ * BUG ALERT: The (S)VGA's segment-select register MUST be set correctly!
+ */
+#if 0
+ hwp->writeAttr(hwp, 0x10, 0x01); /* graphics mode */
+#endif
+#ifdef SAVE_FONT1
+ if (hwp->FontInfo1 || (hwp->FontInfo1 = xalloc(FONT_AMOUNT))) {
+ hwp->writeSeq(hwp, 0x02, 0x04); /* write to plane 2 */
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x04, 0x02); /* read plane 2 */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+ slowbcopy_frombus(hwp->Base, hwp->FontInfo1, FONT_AMOUNT);
+ }
+#endif /* SAVE_FONT1 */
+#ifdef SAVE_FONT2
+ if (hwp->FontInfo2 || (hwp->FontInfo2 = xalloc(FONT_AMOUNT))) {
+ hwp->writeSeq(hwp, 0x02, 0x08); /* write to plane 3 */
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x04, 0x03); /* read plane 3 */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+ slowbcopy_frombus(hwp->Base, hwp->FontInfo2, FONT_AMOUNT);
+ }
+#endif /* SAVE_FONT2 */
+#ifdef SAVE_TEXT
+ if (hwp->TextInfo || (hwp->TextInfo = xalloc(2 * TEXT_AMOUNT))) {
+ hwp->writeSeq(hwp, 0x02, 0x01); /* write to plane 0 */
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x04, 0x00); /* read plane 0 */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+ slowbcopy_frombus(hwp->Base, hwp->TextInfo, TEXT_AMOUNT);
+ hwp->writeSeq(hwp, 0x02, 0x02); /* write to plane 1 */
+ hwp->writeSeq(hwp, 0x04, 0x06); /* enable plane graphics */
+ hwp->writeGr(hwp, 0x04, 0x01); /* read plane 1 */
+ hwp->writeGr(hwp, 0x05, 0x00); /* write mode 0, read mode 0 */
+ hwp->writeGr(hwp, 0x06, 0x05); /* set graphics */
+ slowbcopy_frombus(hwp->Base,
+ (unsigned char *)hwp->TextInfo + TEXT_AMOUNT, TEXT_AMOUNT);
+ }
+#endif /* SAVE_TEXT */
+
+ /* Restore clobbered registers */
+ hwp->writeAttr(hwp, 0x10, attr10);
+ hwp->writeSeq(hwp, 0x02, seq2);
+ hwp->writeSeq(hwp, 0x04, seq4);
+ hwp->writeGr(hwp, 0x04, gr4);
+ hwp->writeGr(hwp, 0x05, gr5);
+ hwp->writeGr(hwp, 0x06, gr6);
+ hwp->writeMiscOut(hwp, miscOut);
+ hwp->IOBase = savedIOBase;
+
+ vgaHWBlankScreen(scrninfp, TRUE);
+
+ if (doMap)
+ vgaHWUnmapMem(scrninfp);
+
+#endif /* defined(SAVE_TEXT) || defined(SAVE_FONT1) || defined(SAVE_FONT2) */
+}
+
+void
+vgaHWSaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ int i;
+
+ save->MiscOutReg = hwp->readMiscOut(hwp);
+ if (save->MiscOutReg & 0x01)
+ hwp->IOBase = VGA_IOBASE_COLOR;
+ else
+ hwp->IOBase = VGA_IOBASE_MONO;
+
+ for (i = 0; i < save->numCRTC; i++) {
+ save->CRTC[i] = hwp->readCrtc(hwp, i);
+#ifdef DEBUG
+ ErrorF("CRTC[0x%02x] = 0x%02x\n", i, save->CRTC[i]);
+#endif
+ }
+
+ hwp->enablePalette(hwp);
+ for (i = 0; i < save->numAttribute; i++) {
+ save->Attribute[i] = hwp->readAttr(hwp, i);
+#ifdef DEBUG
+ ErrorF("Attribute[0x%02x] = 0x%02x\n", i, save->Attribute[i]);
+#endif
+ }
+ hwp->disablePalette(hwp);
+
+ for (i = 0; i < save->numGraphics; i++) {
+ save->Graphics[i] = hwp->readGr(hwp, i);
+#ifdef DEBUG
+ ErrorF("Graphics[0x%02x] = 0x%02x\n", i, save->Graphics[i]);
+#endif
+ }
+
+ for (i = 1; i < save->numSequencer; i++) {
+ save->Sequencer[i] = hwp->readSeq(hwp, i);
+#ifdef DEBUG
+ ErrorF("Sequencer[0x%02x] = 0x%02x\n", i, save->Sequencer[i]);
+#endif
+ }
+}
+
+
+void
+vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrninfp);
+ Bool readError = FALSE;
+ int i;
+
+#ifdef NEED_SAVED_CMAP
+ /*
+ * Some ET4000 chips from 1991 have a HW bug that prevents the reading
+ * of the color lookup table. Mask rev 9042EAI is known to have this bug.
+ *
+ * If the colourmap is not readable, we set the saved map to a default
+ * map (taken from Ferraro's "Programmer's Guide to the EGA and VGA
+ * Cards" 2nd ed).
+ */
+
+ /* Only save it once */
+ if (hwp->cmapSaved)
+ return;
+
+#if 0
+ hwp->enablePalette(hwp);
+#endif
+
+ hwp->writeDacMask(hwp, 0xFF);
+
+ /*
+ * check if we can read the lookup table
+ */
+ hwp->writeDacReadAddr(hwp, 0x00);
+ for (i = 0; i < 6; i++) {
+ save->DAC[i] = hwp->readDacData(hwp);
+#ifdef DEBUG
+ switch (i % 3) {
+ case 0:
+ ErrorF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]);
+ break;
+ case 1:
+ ErrorF("0x%02x, ", save->DAC[i]);
+ break;
+ case 2:
+ ErrorF("0x%02x\n", save->DAC[i]);
+ }
+#endif
+ }
+
+ /*
+ * Check if we can read the palette -
+ * use foreground color to prevent flashing.
+ */
+ hwp->writeDacWriteAddr(hwp, 0x01);
+ for (i = 3; i < 6; i++)
+ hwp->writeDacData(hwp, ~save->DAC[i] & DAC_TEST_MASK);
+ hwp->writeDacReadAddr(hwp, 0x01);
+ for (i = 3; i < 6; i++) {
+ if (hwp->readDacData(hwp) != (~save->DAC[i] & DAC_TEST_MASK))
+ readError = TRUE;
+ }
+ hwp->writeDacWriteAddr(hwp, 0x01);
+ for (i = 3; i < 6; i++)
+ hwp->writeDacData(hwp, save->DAC[i]);
+
+ if (readError) {
+ /*
+ * save the default lookup table
+ */
+ memmove(save->DAC, defaultDAC, 768);
+ xf86DrvMsg(scrninfp->scrnIndex, X_WARNING,
+ "Cannot read colourmap from VGA. Will restore with default\n");
+ } else {
+ /* save the colourmap */
+ hwp->writeDacReadAddr(hwp, 0x02);
+ for (i = 6; i < 768; i++) {
+ save->DAC[i] = hwp->readDacData(hwp);
+ DACDelay(hwp);
+#ifdef DEBUG
+ switch (i % 3) {
+ case 0:
+ ErrorF("DAC[0x%02x] = 0x%02x, ", i / 3, save->DAC[i]);
+ break;
+ case 1:
+ ErrorF("0x%02x, ", save->DAC[i]);
+ break;
+ case 2:
+ ErrorF("0x%02x\n", save->DAC[i]);
+ }
+#endif
+ }
+ }
+
+ hwp->disablePalette(hwp);
+ hwp->cmapSaved = TRUE;
+#endif
+}
+
+/*
+ * vgaHWSave --
+ * save the current VGA state
+ */
+
+void
+vgaHWSave(ScrnInfoPtr scrninfp, vgaRegPtr save, int flags)
+{
+ if (save == NULL)
+ return;
+
+ if (flags & VGA_SR_CMAP)
+ vgaHWSaveColormap(scrninfp, save);
+
+ if (flags & VGA_SR_MODE)
+ vgaHWSaveMode(scrninfp, save);
+
+ if (flags & VGA_SR_FONTS)
+ vgaHWSaveFonts(scrninfp, save);
+}
+
+
+/*
+ * vgaHWInit --
+ * Handle the initialization, etc. of a screen.
+ * Return FALSE on failure.
+ */
+
+Bool
+vgaHWInit(ScrnInfoPtr scrninfp, DisplayModePtr mode)
+{
+ unsigned int i;
+ vgaHWPtr hwp;
+ vgaRegPtr regp;
+ int depth = scrninfp->depth;
+
+ /*
+ * make sure the vgaHWRec is allocated
+ */
+ if (!vgaHWGetHWRec(scrninfp))
+ return FALSE;
+ hwp = VGAHWPTR(scrninfp);
+ regp = &hwp->ModeReg;
+
+ /*
+ * compute correct Hsync & Vsync polarity
+ */
+ if ((mode->Flags & (V_PHSYNC | V_NHSYNC))
+ && (mode->Flags & (V_PVSYNC | V_NVSYNC)))
+ {
+ regp->MiscOutReg = 0x23;
+ if (mode->Flags & V_NHSYNC) regp->MiscOutReg |= 0x40;
+ if (mode->Flags & V_NVSYNC) regp->MiscOutReg |= 0x80;
+ }
+ else
+ {
+ int VDisplay = mode->VDisplay;
+ if (mode->Flags & V_DBLSCAN)
+ VDisplay *= 2;
+ if (mode->VScan > 1)
+ VDisplay *= mode->VScan;
+ if (VDisplay < 400)
+ regp->MiscOutReg = 0xA3; /* +hsync -vsync */
+ else if (VDisplay < 480)
+ regp->MiscOutReg = 0x63; /* -hsync +vsync */
+ else if (VDisplay < 768)
+ regp->MiscOutReg = 0xE3; /* -hsync -vsync */
+ else
+ regp->MiscOutReg = 0x23; /* +hsync +vsync */
+ }
+
+ regp->MiscOutReg |= (mode->ClockIndex & 0x03) << 2;
+
+ /*
+ * Time Sequencer
+ */
+ if (depth == 4)
+ regp->Sequencer[0] = 0x02;
+ else
+ regp->Sequencer[0] = 0x00;
+ if (mode->Flags & V_CLKDIV2)
+ regp->Sequencer[1] = 0x09;
+ else
+ regp->Sequencer[1] = 0x01;
+ if (depth == 1)
+ regp->Sequencer[2] = 1 << BIT_PLANE;
+ else
+ regp->Sequencer[2] = 0x0F;
+ regp->Sequencer[3] = 0x00; /* Font select */
+ if (depth < 8)
+ regp->Sequencer[4] = 0x06; /* Misc */
+ else
+ regp->Sequencer[4] = 0x0E; /* Misc */
+
+ /*
+ * CRTC Controller
+ */
+ regp->CRTC[0] = (mode->CrtcHTotal >> 3) - 5;
+ regp->CRTC[1] = (mode->CrtcHDisplay >> 3) - 1;
+ regp->CRTC[2] = (mode->CrtcHBlankStart >> 3) - 1;
+ regp->CRTC[3] = (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F) | 0x80;
+ i = (((mode->CrtcHSkew << 2) + 0x10) & ~0x1F);
+ if (i < 0x80)
+ regp->CRTC[3] |= i;
+ regp->CRTC[4] = (mode->CrtcHSyncStart >> 3);
+ regp->CRTC[5] = ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2)
+ | (((mode->CrtcHSyncEnd >> 3)) & 0x1F);
+ regp->CRTC[6] = (mode->CrtcVTotal - 2) & 0xFF;
+ regp->CRTC[7] = (((mode->CrtcVTotal - 2) & 0x100) >> 8)
+ | (((mode->CrtcVDisplay - 1) & 0x100) >> 7)
+ | ((mode->CrtcVSyncStart & 0x100) >> 6)
+ | (((mode->CrtcVBlankStart - 1) & 0x100) >> 5)
+ | 0x10
+ | (((mode->CrtcVTotal - 2) & 0x200) >> 4)
+ | (((mode->CrtcVDisplay - 1) & 0x200) >> 3)
+ | ((mode->CrtcVSyncStart & 0x200) >> 2);
+ regp->CRTC[8] = 0x00;
+ regp->CRTC[9] = (((mode->CrtcVBlankStart - 1) & 0x200) >> 4) | 0x40;
+ if (mode->Flags & V_DBLSCAN)
+ regp->CRTC[9] |= 0x80;
+ if (mode->VScan >= 32)
+ regp->CRTC[9] |= 0x1F;
+ else if (mode->VScan > 1)
+ regp->CRTC[9] |= mode->VScan - 1;
+ regp->CRTC[10] = 0x00;
+ regp->CRTC[11] = 0x00;
+ regp->CRTC[12] = 0x00;
+ regp->CRTC[13] = 0x00;
+ regp->CRTC[14] = 0x00;
+ regp->CRTC[15] = 0x00;
+ regp->CRTC[16] = mode->CrtcVSyncStart & 0xFF;
+ regp->CRTC[17] = (mode->CrtcVSyncEnd & 0x0F) | 0x20;
+ regp->CRTC[18] = (mode->CrtcVDisplay - 1) & 0xFF;
+ regp->CRTC[19] = scrninfp->displayWidth >> 4; /* just a guess */
+ regp->CRTC[20] = 0x00;
+ regp->CRTC[21] = (mode->CrtcVBlankStart - 1) & 0xFF;
+ regp->CRTC[22] = (mode->CrtcVBlankEnd - 1) & 0xFF;
+ if (depth < 8)
+ regp->CRTC[23] = 0xE3;
+ else
+ regp->CRTC[23] = 0xC3;
+ regp->CRTC[24] = 0xFF;
+
+ vgaHWHBlankKGA(mode, regp, 0, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO);
+ vgaHWVBlankKGA(mode, regp, 0, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO);
+
+ /*
+ * Theory resumes here....
+ */
+
+ /*
+ * Graphics Display Controller
+ */
+ regp->Graphics[0] = 0x00;
+ regp->Graphics[1] = 0x00;
+ regp->Graphics[2] = 0x00;
+ regp->Graphics[3] = 0x00;
+ if (depth == 1) {
+ regp->Graphics[4] = BIT_PLANE;
+ regp->Graphics[5] = 0x00;
+ } else {
+ regp->Graphics[4] = 0x00;
+ if (depth == 4)
+ regp->Graphics[5] = 0x02;
+ else
+ regp->Graphics[5] = 0x40;
+ }
+ regp->Graphics[6] = 0x05; /* only map 64k VGA memory !!!! */
+ regp->Graphics[7] = 0x0F;
+ regp->Graphics[8] = 0xFF;
+
+ if (depth == 1) {
+ /* Initialise the Mono map according to which bit-plane gets used */
+
+ Bool flipPixels = xf86GetFlipPixels();
+
+ for (i=0; i<16; i++)
+ if (((i & (1 << BIT_PLANE)) != 0) != flipPixels)
+ regp->Attribute[i] = WHITE_VALUE;
+ else
+ regp->Attribute[i] = BLACK_VALUE;
+
+ regp->Attribute[16] = 0x01; /* -VGA2- */ /* wrong for the ET4000 */
+ if (!hwp->ShowOverscan)
+ regp->Attribute[OVERSCAN] = OVERSCAN_VALUE; /* -VGA2- */
+ } else {
+ regp->Attribute[0] = 0x00; /* standard colormap translation */
+ regp->Attribute[1] = 0x01;
+ regp->Attribute[2] = 0x02;
+ regp->Attribute[3] = 0x03;
+ regp->Attribute[4] = 0x04;
+ regp->Attribute[5] = 0x05;
+ regp->Attribute[6] = 0x06;
+ regp->Attribute[7] = 0x07;
+ regp->Attribute[8] = 0x08;
+ regp->Attribute[9] = 0x09;
+ regp->Attribute[10] = 0x0A;
+ regp->Attribute[11] = 0x0B;
+ regp->Attribute[12] = 0x0C;
+ regp->Attribute[13] = 0x0D;
+ regp->Attribute[14] = 0x0E;
+ regp->Attribute[15] = 0x0F;
+ if (depth == 4)
+ regp->Attribute[16] = 0x81; /* wrong for the ET4000 */
+ else
+ regp->Attribute[16] = 0x41; /* wrong for the ET4000 */
+ /* Attribute[17] (overscan) initialised in vgaHWGetHWRec() */
+ }
+ regp->Attribute[18] = 0x0F;
+ regp->Attribute[19] = 0x00;
+ regp->Attribute[20] = 0x00;
+
+ return(TRUE);
+}
+
+ /*
+ * OK, so much for theory. Now, let's deal with the >real< world...
+ *
+ * The above CRTC settings are precise in theory, except that many, if not
+ * most, VGA clones fail to reset the blanking signal when the character or
+ * line counter reaches [HV]Total. In this case, the signal is only
+ * unblanked when the counter reaches [HV]BlankEnd (mod 64, 128 or 256 as
+ * the case may be) at the start of the >next< scanline or frame, which
+ * means only part of the screen shows. This affects how null overscans
+ * are to be implemented on such adapters.
+ *
+ * Henceforth, VGA cores that implement this broken, but unfortunately
+ * common, behaviour are to be designated as KGA's, in honour of Koen
+ * Gadeyne, whose zeal to eliminate overscans (read: fury) set in motion
+ * a series of events that led to the discovery of this problem.
+ *
+ * Some VGA's are KGA's only in the horizontal, or only in the vertical,
+ * some in both, others in neither. Don't let anyone tell you there is
+ * such a thing as a VGA "standard"... And, thank the Creator for the fact
+ * that Hilbert spaces are not yet implemented in this industry.
+ *
+ * The following implements a trick suggested by David Dawes. This sets
+ * [HV]BlankEnd to zero if the blanking interval does not already contain a
+ * 0-point, and decrements it by one otherwise. In the latter case, this
+ * will produce a left and/or top overscan which the colourmap code will
+ * (still) need to ensure is as close to black as possible. This will make
+ * the behaviour consistent across all chipsets, while allowing all
+ * chipsets to display the entire screen. Non-KGA drivers can ignore the
+ * following in their own copy of this code.
+ *
+ * -- TSI @ UQV, 1998.08.21
+ */
+
+CARD32
+vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
+ unsigned int Flags)
+{
+ int nExtBits = (nBits < 6) ? 0 : nBits - 6;
+ CARD32 ExtBits;
+ CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 6;
+
+ regp->CRTC[3] = (regp->CRTC[3] & ~0x1F)
+ | (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F);
+ regp->CRTC[5] = (regp->CRTC[5] & ~0x80)
+ | ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2);
+ ExtBits = ((mode->CrtcHBlankEnd >> 3) - 1) & ExtBitMask;
+
+ /* First the horizontal case */
+ if ((Flags & KGA_FIX_OVERSCAN)
+ && ((mode->CrtcHBlankEnd >> 3) == (mode->CrtcHTotal >> 3)))
+ {
+ int i = (regp->CRTC[3] & 0x1F)
+ | ((regp->CRTC[5] & 0x80) >> 2)
+ | ExtBits;
+ if (Flags & KGA_ENABLE_ON_ZERO) {
+ if ((i-- > (((mode->CrtcHBlankStart >> 3) - 1)
+ & (0x3F | ExtBitMask)))
+ && (mode->CrtcHBlankEnd == mode->CrtcHTotal))
+ i = 0;
+ } else if (Flags & KGA_BE_TOT_DEC)
+ i--;
+ regp->CRTC[3] = (regp->CRTC[3] & ~0x1F) | (i & 0x1F);
+ regp->CRTC[5] = (regp->CRTC[5] & ~0x80) | ((i << 2) & 0x80);
+ ExtBits = i & ExtBitMask;
+ }
+ return ExtBits >> 6;
+}
+
+ /*
+ * The vertical case is a little trickier. Some VGA's ignore bit 0x80 of
+ * CRTC[22]. Also, in some cases, a zero CRTC[22] will still blank the
+ * very first scanline in a double- or multi-scanned mode. This last case
+ * needs further investigation.
+ */
+CARD32
+vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
+ unsigned int Flags)
+{
+ CARD32 ExtBits;
+ CARD32 nExtBits = (nBits < 8) ? 0 : (nBits - 8);
+ CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 8;
+ /* If width is not known nBits should be 0. In this
+ * case BitMask is set to 0 so we can check for it. */
+ CARD32 BitMask = (nBits < 7) ? 0 : ((1 << nExtBits) - 1);
+ int VBlankStart = (mode->CrtcVBlankStart - 1) & 0xFF;
+ regp->CRTC[22] = (mode->CrtcVBlankEnd - 1) & 0xFF;
+ ExtBits = (mode->CrtcVBlankEnd - 1) & ExtBitMask;
+
+ if ((Flags & KGA_FIX_OVERSCAN)
+ && (mode->CrtcVBlankEnd == mode->CrtcVTotal))
+ /* Null top overscan */
+ {
+ int i = regp->CRTC[22] | ExtBits;
+ if (Flags & KGA_ENABLE_ON_ZERO) {
+ if (((BitMask && ((i & BitMask) > (VBlankStart & BitMask)))
+ || ((i > VBlankStart) && /* 8-bit case */
+ ((i & 0x7F) > (VBlankStart & 0x7F)))) && /* 7-bit case */
+ !(regp->CRTC[9] & 0x9F)) /* 1 scanline/row */
+ i = 0;
+ else
+ i = (i - 1);
+ } else if (Flags & KGA_BE_TOT_DEC)
+ i = (i - 1);
+
+ regp->CRTC[22] = i & 0xFF;
+ ExtBits = i & 0xFF00;
+ }
+ return ExtBits >> 8;
+}
+
+/*
+ * these are some more hardware specific helpers, formerly in vga.c
+ */
+static void
+vgaHWGetHWRecPrivate(void)
+{
+ if (vgaHWPrivateIndex < 0)
+ vgaHWPrivateIndex = xf86AllocateScrnInfoPrivateIndex();
+ return;
+}
+
+
+static void
+vgaHWFreeRegs(vgaRegPtr regp)
+{
+ if (regp->CRTC)
+ xfree (regp->CRTC);
+
+ regp->CRTC =
+ regp->Sequencer =
+ regp->Graphics =
+ regp->Attribute = NULL;
+
+ regp->numCRTC =
+ regp->numSequencer =
+ regp->numGraphics =
+ regp->numAttribute = 0;
+}
+
+
+
+static Bool
+vgaHWAllocRegs(vgaRegPtr regp)
+{
+ unsigned char *buf;
+
+ if ((regp->numCRTC + regp->numSequencer + regp->numGraphics +
+ regp->numAttribute) == 0)
+ return FALSE;
+
+ buf = xcalloc(regp->numCRTC +
+ regp->numSequencer +
+ regp->numGraphics +
+ regp->numAttribute, 1);
+ if (!buf)
+ return FALSE;
+
+ regp->CRTC = buf;
+ regp->Sequencer = regp->CRTC + regp->numCRTC;
+ regp->Graphics = regp->Sequencer + regp->numSequencer;
+ regp->Attribute = regp->Graphics + regp->numGraphics;
+
+ return TRUE;
+}
+
+
+Bool
+vgaHWAllocDefaultRegs(vgaRegPtr regp)
+{
+ regp->numCRTC = VGA_NUM_CRTC;
+ regp->numSequencer = VGA_NUM_SEQ;
+ regp->numGraphics = VGA_NUM_GFX;
+ regp->numAttribute = VGA_NUM_ATTR;
+
+ return vgaHWAllocRegs(regp);
+}
+
+
+Bool
+vgaHWSetRegCounts(ScrnInfoPtr scrp, int numCRTC, int numSequencer,
+ int numGraphics, int numAttribute)
+{
+#define VGAHWMINNUM(regtype) \
+ ((newMode.num##regtype < regp->num##regtype) ? \
+ (newMode.num##regtype) : (regp->num##regtype))
+#define VGAHWCOPYREGSET(regtype) \
+ memcpy (newMode.regtype, regp->regtype, VGAHWMINNUM(regtype))
+
+ vgaRegRec newMode, newSaved;
+ vgaRegPtr regp;
+
+ regp = &VGAHWPTR(scrp)->ModeReg;
+ memcpy (&newMode, regp, sizeof(vgaRegRec));
+
+ /* allocate space for new registers */
+
+ regp = &newMode;
+ regp->numCRTC = numCRTC;
+ regp->numSequencer = numSequencer;
+ regp->numGraphics = numGraphics;
+ regp->numAttribute = numAttribute;
+ if (!vgaHWAllocRegs(regp))
+ return FALSE;
+
+ regp = &VGAHWPTR(scrp)->SavedReg;
+ memcpy (&newSaved, regp, sizeof(vgaRegRec));
+
+ regp = &newSaved;
+ regp->numCRTC = numCRTC;
+ regp->numSequencer = numSequencer;
+ regp->numGraphics = numGraphics;
+ regp->numAttribute = numAttribute;
+ if (!vgaHWAllocRegs(regp)) {
+ vgaHWFreeRegs(&newMode);
+ return FALSE;
+ }
+
+ /* allocations succeeded, copy register data into new space */
+
+ regp = &VGAHWPTR(scrp)->ModeReg;
+ VGAHWCOPYREGSET(CRTC);
+ VGAHWCOPYREGSET(Sequencer);
+ VGAHWCOPYREGSET(Graphics);
+ VGAHWCOPYREGSET(Attribute);
+
+ regp = &VGAHWPTR(scrp)->SavedReg;
+ VGAHWCOPYREGSET(CRTC);
+ VGAHWCOPYREGSET(Sequencer);
+ VGAHWCOPYREGSET(Graphics);
+ VGAHWCOPYREGSET(Attribute);
+
+ /* free old register arrays */
+
+ regp = &VGAHWPTR(scrp)->ModeReg;
+ vgaHWFreeRegs(regp);
+ memcpy(regp, &newMode, sizeof(vgaRegRec));
+
+ regp = &VGAHWPTR(scrp)->SavedReg;
+ vgaHWFreeRegs(regp);
+ memcpy(regp, &newSaved, sizeof(vgaRegRec));
+
+ return TRUE;
+
+#undef VGAHWMINNUM
+#undef VGAHWCOPYREGSET
+}
+
+
+Bool
+vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src)
+{
+ vgaHWFreeRegs(dst);
+
+ memcpy(dst, src, sizeof(vgaRegRec));
+
+ if (!vgaHWAllocRegs(dst))
+ return FALSE;
+
+ memcpy(dst->CRTC, src->CRTC, src->numCRTC);
+ memcpy(dst->Sequencer, src->Sequencer, src->numSequencer);
+ memcpy(dst->Graphics, src->Graphics, src->numGraphics);
+ memcpy(dst->Attribute, src->Attribute, src->numAttribute);
+
+ return TRUE;
+}
+
+
+Bool
+vgaHWGetHWRec(ScrnInfoPtr scrp)
+{
+ vgaRegPtr regp;
+ vgaHWPtr hwp;
+ pciVideoPtr pvp;
+ int i;
+
+ /*
+ * Let's make sure that the private exists and allocate one.
+ */
+ vgaHWGetHWRecPrivate();
+ /*
+ * New privates are always set to NULL, so we can check if the allocation
+ * has already been done.
+ */
+ if (VGAHWPTR(scrp))
+ return TRUE;
+ hwp = VGAHWPTRLVAL(scrp) = xnfcalloc(sizeof(vgaHWRec), 1);
+ regp = &VGAHWPTR(scrp)->ModeReg;
+
+ if ((!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->SavedReg)) ||
+ (!vgaHWAllocDefaultRegs(&VGAHWPTR(scrp)->ModeReg))) {
+ xfree(hwp);
+ return FALSE;
+ }
+
+ if (scrp->bitsPerPixel == 1) {
+ rgb blackColour = scrp->display->blackColour,
+ whiteColour = scrp->display->whiteColour;
+
+ if (blackColour.red > 0x3F) blackColour.red = 0x3F;
+ if (blackColour.green > 0x3F) blackColour.green = 0x3F;
+ if (blackColour.blue > 0x3F) blackColour.blue = 0x3F;
+
+ if (whiteColour.red > 0x3F) whiteColour.red = 0x3F;
+ if (whiteColour.green > 0x3F) whiteColour.green = 0x3F;
+ if (whiteColour.blue > 0x3F) whiteColour.blue = 0x3F;
+
+ if ((blackColour.red == whiteColour.red ) &&
+ (blackColour.green == whiteColour.green) &&
+ (blackColour.blue == whiteColour.blue )) {
+ blackColour.red ^= 0x3F;
+ blackColour.green ^= 0x3F;
+ blackColour.blue ^= 0x3F;
+ }
+
+ /*
+ * initialize default colormap for monochrome
+ */
+ for (i=0; i<3; i++) regp->DAC[i] = 0x00;
+ for (i=3; i<768; i++) regp->DAC[i] = 0x3F;
+ i = BLACK_VALUE * 3;
+ regp->DAC[i++] = blackColour.red;
+ regp->DAC[i++] = blackColour.green;
+ regp->DAC[i] = blackColour.blue;
+ i = WHITE_VALUE * 3;
+ regp->DAC[i++] = whiteColour.red;
+ regp->DAC[i++] = whiteColour.green;
+ regp->DAC[i] = whiteColour.blue;
+ i = OVERSCAN_VALUE * 3;
+ regp->DAC[i++] = 0x00;
+ regp->DAC[i++] = 0x00;
+ regp->DAC[i] = 0x00;
+ } else {
+ /* Set all colours to black */
+ for (i=0; i<768; i++) regp->DAC[i] = 0x00;
+ /* ... and the overscan */
+ if (scrp->depth >= 4)
+ regp->Attribute[OVERSCAN] = 0xFF;
+ }
+ if (xf86FindOption(scrp->confScreen->options, "ShowOverscan")) {
+ xf86MarkOptionUsedByName(scrp->confScreen->options, "ShowOverscan");
+ xf86DrvMsg(scrp->scrnIndex, X_CONFIG, "Showing overscan area\n");
+ regp->DAC[765] = 0x3F;
+ regp->DAC[766] = 0x00;
+ regp->DAC[767] = 0x3F;
+ regp->Attribute[OVERSCAN] = 0xFF;
+ hwp->ShowOverscan = TRUE;
+ } else
+ hwp->ShowOverscan = FALSE;
+
+ hwp->paletteEnabled = FALSE;
+ hwp->cmapSaved = FALSE;
+ hwp->MapSize = 0;
+ hwp->pScrn = scrp;
+
+ /* Initialise the function pointers with the standard VGA versions */
+ vgaHWSetStdFuncs(hwp);
+
+ hwp->PIOOffset = scrp->domainIOBase;
+ if ((pvp = xf86GetPciInfoForEntity(scrp->entityList[0])))
+ hwp->Tag = pciTag(pvp->bus, pvp->device, pvp->func);
+
+ return TRUE;
+}
+
+
+void
+vgaHWFreeHWRec(ScrnInfoPtr scrp)
+{
+ if (vgaHWPrivateIndex >= 0) {
+ vgaHWPtr hwp = VGAHWPTR(scrp);
+
+ if (!hwp)
+ return;
+
+ xfree(hwp->FontInfo1);
+ xfree(hwp->FontInfo2);
+ xfree(hwp->TextInfo);
+
+ vgaHWFreeRegs (&hwp->ModeReg);
+ vgaHWFreeRegs (&hwp->SavedReg);
+
+ xfree(hwp);
+ VGAHWPTRLVAL(scrp) = NULL;
+ }
+}
+
+
+Bool
+vgaHWMapMem(ScrnInfoPtr scrp)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrp);
+ int scr_index = scrp->scrnIndex;
+
+ if (hwp->Base)
+ return TRUE;
+
+ /* If not set, initialise with the defaults */
+ if (hwp->MapSize == 0)
+ hwp->MapSize = VGA_DEFAULT_MEM_SIZE;
+ if (hwp->MapPhys == 0)
+ hwp->MapPhys = VGA_DEFAULT_PHYS_ADDR;
+
+ /*
+ * Map as VIDMEM_MMIO_32BIT because WC
+ * is bad when there is page flipping.
+ * XXX This is not correct but we do it
+ * for now.
+ */
+#ifdef DEBUG
+ ErrorF("Mapping VGAMem\n");
+#endif
+ hwp->Base = xf86MapDomainMemory(scr_index, VIDMEM_MMIO_32BIT, hwp->Tag,
+ hwp->MapPhys, hwp->MapSize);
+ return hwp->Base != NULL;
+}
+
+
+void
+vgaHWUnmapMem(ScrnInfoPtr scrp)
+{
+ vgaHWPtr hwp = VGAHWPTR(scrp);
+ int scr_index = scrp->scrnIndex;
+
+ if (hwp->Base == NULL)
+ return;
+
+#ifdef DEBUG
+ ErrorF("Unmapping VGAMem\n");
+#endif
+ xf86UnMapVidMem(scr_index, hwp->Base, hwp->MapSize);
+ hwp->Base = NULL;
+}
+
+int
+vgaHWGetIndex()
+{
+ return vgaHWPrivateIndex;
+}
+
+
+void
+vgaHWGetIOBase(vgaHWPtr hwp)
+{
+ hwp->IOBase = (hwp->readMiscOut(hwp) & 0x01) ?
+ VGA_IOBASE_COLOR : VGA_IOBASE_MONO;
+ xf86DrvMsgVerb(hwp->pScrn->scrnIndex, X_INFO, 3,
+ "vgaHWGetIOBase: hwp->IOBase is 0x%04x, hwp->PIOOffset is 0x%04lx\n",
+ hwp->IOBase, hwp->PIOOffset);
+}
+
+
+void
+vgaHWLock(vgaHWPtr hwp)
+{
+ /* Protect CRTC[0-7] */
+ hwp->writeCrtc(hwp, 0x11, hwp->readCrtc(hwp, 0x11) | 0x80);
+}
+
+void
+vgaHWUnlock(vgaHWPtr hwp)
+{
+ /* Unprotect CRTC[0-7] */
+ hwp->writeCrtc(hwp, 0x11, hwp->readCrtc(hwp, 0x11) & ~0x80);
+}
+
+
+void
+vgaHWEnable(vgaHWPtr hwp)
+{
+ hwp->writeEnable(hwp, hwp->readEnable(hwp) | 0x01);
+}
+
+
+void
+vgaHWDisable(vgaHWPtr hwp)
+{
+ hwp->writeEnable(hwp, hwp->readEnable(hwp) & ~0x01);
+}
+
+
+static void
+vgaHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
+ VisualPtr pVisual)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ int i, index;
+
+ for (i = 0; i < numColors; i++) {
+ index = indices[i];
+ hwp->writeDacWriteAddr(hwp, index);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index].red);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index].green);
+ DACDelay(hwp);
+ hwp->writeDacData(hwp, colors[index].blue);
+ DACDelay(hwp);
+ }
+
+ /* This shouldn't be necessary, but we'll play safe. */
+ hwp->disablePalette(hwp);
+}
+
+
+static void
+vgaHWSetOverscan(ScrnInfoPtr pScrn, int overscan)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+ if (overscan < 0 || overscan > 255)
+ return;
+
+ hwp->enablePalette(hwp);
+ hwp->writeAttr(hwp, OVERSCAN, overscan);
+
+#ifdef DEBUGOVERSCAN
+ {
+ int ov = hwp->readAttr(hwp, OVERSCAN);
+ int red, green, blue;
+
+ hwp->writeDacReadAddr(hwp, ov);
+ red = hwp->readDacData(hwp);
+ green = hwp->readDacData(hwp);
+ blue = hwp->readDacData(hwp);
+ ErrorF("Overscan index is 0x%02x, colours are #%02x%02x%02x\n",
+ ov, red, green, blue);
+ }
+#endif
+
+ hwp->disablePalette(hwp);
+}
+
+
+Bool
+vgaHWHandleColormaps(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if (pScrn->depth > 1 && pScrn->depth <= 8) {
+ return xf86HandleColormaps(pScreen, 1 << pScrn->depth,
+ pScrn->rgbBits, vgaHWLoadPalette,
+ pScrn->depth > 4 ? vgaHWSetOverscan : NULL,
+ CMAP_RELOAD_ON_MODE_SWITCH);
+ }
+ return TRUE;
+}
+
+/* ----------------------- DDC support ------------------------*/
+/*
+ * Adjust v_active, v_blank, v_sync, v_sync_end, v_blank_end, v_total
+ * to read out EDID at a faster rate. Allowed maximum is 25kHz with
+ * 20 usec v_sync active. Set positive v_sync polarity, turn off lightpen
+ * readback, enable access to cr00-cr07.
+ */
+
+/* vertical timings */
+#define DISPLAY_END 0x04
+#define BLANK_START DISPLAY_END
+#define SYNC_START BLANK_START
+#define SYNC_END 0x09
+#define BLANK_END SYNC_END
+#define V_TOTAL BLANK_END
+/* this function doesn't have to be reentrant for our purposes */
+struct _vgaDdcSave {
+ unsigned char cr03;
+ unsigned char cr06;
+ unsigned char cr07;
+ unsigned char cr09;
+ unsigned char cr10;
+ unsigned char cr11;
+ unsigned char cr12;
+ unsigned char cr15;
+ unsigned char cr16;
+ unsigned char msr;
+};
+
+void
+vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed)
+{
+ vgaHWPtr hwp = VGAHWPTR(pScrn);
+ unsigned char tmp;
+ struct _vgaDdcSave* save;
+ switch (speed) {
+ case DDC_FAST:
+
+ if (hwp->ddc != NULL) break;
+ hwp->ddc = xnfcalloc(sizeof(struct _vgaDdcSave),1);
+ save = (struct _vgaDdcSave *)hwp->ddc;
+ /* Lightpen register disable - allow access to cr10 & 11; just in case */
+ save->cr03 = hwp->readCrtc(hwp, 0x03);
+ hwp->writeCrtc(hwp,0x03,(save->cr03 |0x80));
+ save->cr12 = hwp->readCrtc(hwp, 0x12);
+ hwp->writeCrtc(hwp,0x12,DISPLAY_END);
+ save->cr15 = hwp->readCrtc(hwp, 0x15);
+ hwp->writeCrtc(hwp,0x15,BLANK_START);
+ save->cr10 = hwp->readCrtc(hwp, 0x10);
+ hwp->writeCrtc(hwp,0x10,SYNC_START);
+ save->cr11 = hwp->readCrtc(hwp, 0x11);
+ /* unprotect group 1 registers; just in case ...*/
+ hwp->writeCrtc(hwp,0x11,((save->cr11 & 0x70) | SYNC_END));
+ save->cr16 = hwp->readCrtc(hwp, 0x16);
+ hwp->writeCrtc(hwp,0x16,BLANK_END);
+ save->cr06 = hwp->readCrtc(hwp, 0x06);
+ hwp->writeCrtc(hwp,0x06,V_TOTAL);
+ /* all values have less than 8 bit - mask out 9th and 10th bits */
+ save->cr09 = hwp->readCrtc(hwp, 0x09);
+ hwp->writeCrtc(hwp,0x09,(save->cr09 &0xDF));
+ save->cr07 = hwp->readCrtc(hwp, 0x07);
+ hwp->writeCrtc(hwp,0x07,(save->cr07 &0x10));
+ /* vsync polarity negativ & ensure a 25MHz clock */
+ save->msr = hwp->readMiscOut(hwp);
+ hwp->writeMiscOut(hwp,((save->msr & 0xF3) | 0x80));
+ break;
+ case DDC_SLOW:
+ if (hwp->ddc == NULL) break;
+ save = (struct _vgaDdcSave *)hwp->ddc;
+ hwp->writeMiscOut(hwp,save->msr);
+ hwp->writeCrtc(hwp,0x07,save->cr07);
+ tmp = hwp->readCrtc(hwp, 0x09);
+ hwp->writeCrtc(hwp,0x09,((save->cr09 & 0x20) | (tmp & 0xDF)));
+ hwp->writeCrtc(hwp,0x06,save->cr06);
+ hwp->writeCrtc(hwp,0x16,save->cr16);
+ hwp->writeCrtc(hwp,0x11,save->cr11);
+ hwp->writeCrtc(hwp,0x10,save->cr10);
+ hwp->writeCrtc(hwp,0x15,save->cr15);
+ hwp->writeCrtc(hwp,0x12,save->cr12);
+ hwp->writeCrtc(hwp,0x03,save->cr03);
+ xfree(save);
+ hwp->ddc = NULL;
+ break;
+ default:
+ break;
+ }
+}
diff --git a/hw/xfree86/vgahw/vgaHW.h b/hw/xfree86/vgahw/vgaHW.h
new file mode 100644
index 000000000..9a51f1046
--- /dev/null
+++ b/hw/xfree86/vgahw/vgaHW.h
@@ -0,0 +1,228 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h,v 1.31 2002/04/04 14:05:56 eich Exp $ */
+
+
+/*
+ * Copyright (c) 1997,1998 The XFree86 Project, Inc.
+ *
+ * Loosely based on code bearing the following copyright:
+ *
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ * Author: Dirk Hohndel
+ */
+
+#ifndef _VGAHW_H
+#define _VGAHW_H
+
+#include "X.h"
+#include "misc.h"
+#include "input.h"
+#include "scrnintstr.h"
+#include "colormapst.h"
+
+#include "xf86str.h"
+#include "xf86Pci.h"
+
+#include "xf86DDC.h"
+
+#include "globals.h"
+#define DPMS_SERVER
+#include "extensions/dpms.h"
+
+extern int vgaHWGetIndex(void);
+
+/*
+ * access macro
+ */
+#define VGAHWPTR(p) ((vgaHWPtr)((p)->privates[vgaHWGetIndex()].ptr))
+
+/* Standard VGA registers */
+#define VGA_ATTR_INDEX 0x3C0
+#define VGA_ATTR_DATA_W 0x3C0
+#define VGA_ATTR_DATA_R 0x3C1
+#define VGA_IN_STAT_0 0x3C2 /* read */
+#define VGA_MISC_OUT_W 0x3C2 /* write */
+#define VGA_ENABLE 0x3C3
+#define VGA_SEQ_INDEX 0x3C4
+#define VGA_SEQ_DATA 0x3C5
+#define VGA_DAC_MASK 0x3C6
+#define VGA_DAC_READ_ADDR 0x3C7
+#define VGA_DAC_WRITE_ADDR 0x3C8
+#define VGA_DAC_DATA 0x3C9
+#define VGA_FEATURE_R 0x3CA /* read */
+#define VGA_MISC_OUT_R 0x3CC /* read */
+#define VGA_GRAPH_INDEX 0x3CE
+#define VGA_GRAPH_DATA 0x3CF
+
+#define VGA_IOBASE_MONO 0x3B0
+#define VGA_IOBASE_COLOR 0x3D0
+
+#define VGA_CRTC_INDEX_OFFSET 0x04
+#define VGA_CRTC_DATA_OFFSET 0x05
+#define VGA_IN_STAT_1_OFFSET 0x0A /* read */
+#define VGA_FEATURE_W_OFFSET 0x0A /* write */
+
+/* default number of VGA registers stored internally */
+#define VGA_NUM_CRTC 25
+#define VGA_NUM_SEQ 5
+#define VGA_NUM_GFX 9
+#define VGA_NUM_ATTR 21
+
+/* Flags for vgaHWSave() and vgaHWRestore() */
+#define VGA_SR_MODE 0x01
+#define VGA_SR_FONTS 0x02
+#define VGA_SR_CMAP 0x04
+#define VGA_SR_ALL (VGA_SR_MODE | VGA_SR_FONTS | VGA_SR_CMAP)
+
+/* Defaults for the VGA memory window */
+#define VGA_DEFAULT_PHYS_ADDR 0xA0000
+#define VGA_DEFAULT_MEM_SIZE (64 * 1024)
+
+/*
+ * vgaRegRec contains settings of standard VGA registers.
+ */
+typedef struct {
+ unsigned char MiscOutReg; /* */
+ unsigned char *CRTC; /* Crtc Controller */
+ unsigned char *Sequencer; /* Video Sequencer */
+ unsigned char *Graphics; /* Video Graphics */
+ unsigned char *Attribute; /* Video Atribute */
+ unsigned char DAC[768]; /* Internal Colorlookuptable */
+ unsigned char numCRTC; /* number of CRTC registers, def=VGA_NUM_CRTC */
+ unsigned char numSequencer; /* number of seq registers, def=VGA_NUM_SEQ */
+ unsigned char numGraphics; /* number of gfx registers, def=VGA_NUM_GFX */
+ unsigned char numAttribute; /* number of attr registers, def=VGA_NUM_ATTR */
+} vgaRegRec, *vgaRegPtr;
+
+typedef struct _vgaHWRec *vgaHWPtr;
+
+typedef void (*vgaHWWriteIndexProcPtr)(vgaHWPtr hwp, CARD8 indx, CARD8 value);
+typedef CARD8 (*vgaHWReadIndexProcPtr)(vgaHWPtr hwp, CARD8 indx);
+typedef void (*vgaHWWriteProcPtr)(vgaHWPtr hwp, CARD8 value);
+typedef CARD8 (*vgaHWReadProcPtr)(vgaHWPtr hwp);
+typedef void (*vgaHWMiscProcPtr)(vgaHWPtr hwp);
+
+
+/*
+ * vgaHWRec contains per-screen information required by the vgahw module.
+ *
+ * Note, the palette referred to by the paletteEnabled, enablePalette and
+ * disablePalette is the 16-entry (+overscan) EGA-compatible palette accessed
+ * via the first 17 attribute registers and not the main 8-bit palette.
+ */
+typedef struct _vgaHWRec {
+ pointer Base; /* Address of "VGA" memory */
+ int MapSize; /* Size of "VGA" memory */
+ unsigned long MapPhys; /* phys location of VGA mem */
+ int IOBase; /* I/O Base address */
+ CARD8 * MMIOBase; /* Pointer to MMIO start */
+ int MMIOOffset; /* base + offset + vgareg
+ = mmioreg */
+ pointer FontInfo1; /* save area for fonts in
+ plane 2 */
+ pointer FontInfo2; /* save area for fonts in
+ plane 3 */
+ pointer TextInfo; /* save area for text */
+ vgaRegRec SavedReg; /* saved registers */
+ vgaRegRec ModeReg; /* register settings for
+ current mode */
+ Bool ShowOverscan;
+ Bool paletteEnabled;
+ Bool cmapSaved;
+ ScrnInfoPtr pScrn;
+ vgaHWWriteIndexProcPtr writeCrtc;
+ vgaHWReadIndexProcPtr readCrtc;
+ vgaHWWriteIndexProcPtr writeGr;
+ vgaHWReadIndexProcPtr readGr;
+ vgaHWReadProcPtr readST00;
+ vgaHWReadProcPtr readST01;
+ vgaHWReadProcPtr readFCR;
+ vgaHWWriteProcPtr writeFCR;
+ vgaHWWriteIndexProcPtr writeAttr;
+ vgaHWReadIndexProcPtr readAttr;
+ vgaHWWriteIndexProcPtr writeSeq;
+ vgaHWReadIndexProcPtr readSeq;
+ vgaHWWriteProcPtr writeMiscOut;
+ vgaHWReadProcPtr readMiscOut;
+ vgaHWMiscProcPtr enablePalette;
+ vgaHWMiscProcPtr disablePalette;
+ vgaHWWriteProcPtr writeDacMask;
+ vgaHWReadProcPtr readDacMask;
+ vgaHWWriteProcPtr writeDacWriteAddr;
+ vgaHWWriteProcPtr writeDacReadAddr;
+ vgaHWWriteProcPtr writeDacData;
+ vgaHWReadProcPtr readDacData;
+ pointer ddc;
+ IOADDRESS PIOOffset; /* offset + vgareg
+ = pioreg */
+ vgaHWReadProcPtr readEnable;
+ vgaHWWriteProcPtr writeEnable;
+ PCITAG Tag;
+} vgaHWRec;
+
+/* Some macros that VGA drivers can use in their ChipProbe() function */
+#define VGAHW_GET_IOBASE() ((inb(VGA_MISC_OUT_R) & 0x01) ? \
+ VGA_IOBASE_COLOR : VGA_IOBASE_MONO)
+
+#define OVERSCAN 0x11 /* Index of OverScan register */
+
+/* Flags that define how overscan correction should take place */
+#define KGA_FIX_OVERSCAN 1 /* overcan correction required */
+#define KGA_ENABLE_ON_ZERO 2 /* if possible enable display at beginning */
+ /* of next scanline/frame */
+#define KGA_BE_TOT_DEC 4 /* always fix problem by setting blank end */
+ /* to total - 1 */
+#define BIT_PLANE 3 /* Which plane we write to in mono mode */
+#define BITS_PER_GUN 6
+#define COLORMAP_SIZE 256
+
+#if defined(__powerpc__)
+#define DACDelay(hw) /* No legacy VGA support */
+#else
+#define DACDelay(hw) \
+ do { \
+ (void)inb((hw)->PIOOffset + (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
+ (void)inb((hw)->PIOOffset + (hw)->IOBase + VGA_IN_STAT_1_OFFSET); \
+ } while (0)
+#endif
+
+/* Function Prototypes */
+
+/* vgaHW.c */
+
+void vgaHWSetStdFuncs(vgaHWPtr hwp);
+void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset);
+void vgaHWProtect(ScrnInfoPtr pScrn, Bool on);
+Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode);
+void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on);
+void vgaHWSeqReset(vgaHWPtr hwp, Bool start);
+void vgaHWRestoreFonts(ScrnInfoPtr scrninfp, vgaRegPtr restore);
+void vgaHWRestoreMode(ScrnInfoPtr scrninfp, vgaRegPtr restore);
+void vgaHWRestoreColormap(ScrnInfoPtr scrninfp, vgaRegPtr restore);
+void vgaHWRestore(ScrnInfoPtr scrninfp, vgaRegPtr restore, int flags);
+void vgaHWSaveFonts(ScrnInfoPtr scrninfp, vgaRegPtr save);
+void vgaHWSaveMode(ScrnInfoPtr scrninfp, vgaRegPtr save);
+void vgaHWSaveColormap(ScrnInfoPtr scrninfp, vgaRegPtr save);
+void vgaHWSave(ScrnInfoPtr scrninfp, vgaRegPtr save, int flags);
+Bool vgaHWInit(ScrnInfoPtr scrnp, DisplayModePtr mode);
+Bool vgaHWSetRegCounts(ScrnInfoPtr scrp, int numCRTC, int numSequencer,
+ int numGraphics, int numAttribute);
+Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src);
+Bool vgaHWGetHWRec(ScrnInfoPtr scrp);
+void vgaHWFreeHWRec(ScrnInfoPtr scrp);
+Bool vgaHWMapMem(ScrnInfoPtr scrp);
+void vgaHWUnmapMem(ScrnInfoPtr scrp);
+void vgaHWGetIOBase(vgaHWPtr hwp);
+void vgaHWLock(vgaHWPtr hwp);
+void vgaHWUnlock(vgaHWPtr hwp);
+void vgaHWEnable(vgaHWPtr hwp);
+void vgaHWDisable(vgaHWPtr hwp);
+void vgaHWDPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags);
+Bool vgaHWHandleColormaps(ScreenPtr pScreen);
+void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed);
+CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
+ unsigned int Flags);
+CARD32 vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits,
+ unsigned int Flags);
+Bool vgaHWAllocDefaultRegs(vgaRegPtr regp);
+#endif /* _VGAHW_H */
diff --git a/hw/xfree86/vgahw/vgaHWmodule.c b/hw/xfree86/vgahw/vgaHWmodule.c
new file mode 100644
index 000000000..409e7b511
--- /dev/null
+++ b/hw/xfree86/vgahw/vgaHWmodule.c
@@ -0,0 +1,27 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHWmodule.c,v 1.6 1999/01/26 05:54:18 dawes Exp $ */
+
+/*
+ * Copyright 1998 by The XFree86 Project, Inc
+ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+
+
+static XF86ModuleVersionInfo VersRec = {
+ "vgahw",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 0, 1, 0,
+ ABI_CLASS_VIDEODRV,
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0, 0, 0, 0}
+};
+
+XF86ModuleData vgahwModuleData = { &VersRec, NULL, NULL };
+
+#endif
diff --git a/hw/xfree86/x86emu/debug.c b/hw/xfree86/x86emu/debug.c
new file mode 100644
index 000000000..7519b35c3
--- /dev/null
+++ b/hw/xfree86/x86emu/debug.c
@@ -0,0 +1,430 @@
+/****************************************************************************
+*
+* 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>
+#include <stdlib.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 void disassemble_forward (u16 seg, u16 off, int n)
+{
+ X86EMU_sysEnv tregs;
+ int i;
+ u8 op1;
+ /*
+ * 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;
+ tregs.x86.R_IP = off;
+ tregs.x86.R_CS = seg;
+
+ /* reset the decoding buffers */
+ tregs.x86.enc_str_pos = 0;
+ tregs.x86.enc_pos = 0;
+
+ /* turn on the "disassemble only, no execute" flag */
+ tregs.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++));
+ (x86emu_optab[op1])(op1);
+ }
+ /* end major hack mode. */
+}
+
+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];
+ 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) {
+ printk("-");
+ p = fgets(s, 1023, stdin);
+ cmd = parse_line(s, ps, &ntok);
+ switch(cmd) {
+ case 'u':
+ 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':
+ exit(1);
+ 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++;
+
+ sscanf(s,"%x",&ps[*n]);
+ *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/hw/xfree86/x86emu/decode.c b/hw/xfree86/x86emu/decode.c
new file mode 100644
index 000000000..110be9848
--- /dev/null
+++ b/hw/xfree86/x86emu/decode.c
@@ -0,0 +1,1073 @@
+/****************************************************************************
+*
+* 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.11 2002/07/23 20:20:43 tsi Exp $ */
+
+#include "x86emu/x86emui.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;
+}
+
+/****************************************************************************
+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();
+ }
+ }
+ 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 */
+}
+
+/*
+ *
+ * return offset from the SIB Byte
+ */
+u32 decode_sib_address(int sib, int mod)
+{
+ u32 base = 0, i = 0, scale = 1;
+
+ switch(sib & 0x07) {
+ case 0:
+ DECODE_PRINTF("[EAX]");
+ base = M.x86.R_EAX;
+ break;
+ case 1:
+ DECODE_PRINTF("[ECX]");
+ base = M.x86.R_ECX;
+ break;
+ case 2:
+ DECODE_PRINTF("[EDX]");
+ base = M.x86.R_EDX;
+ break;
+ case 3:
+ DECODE_PRINTF("[EBX]");
+ base = M.x86.R_EBX;
+ break;
+ case 4:
+ DECODE_PRINTF("[ESP]");
+ base = M.x86.R_ESP;
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ break;
+ case 5:
+ if (mod == 0) {
+ base = fetch_long_imm();
+ DECODE_PRINTF2("%08x", base);
+ } else {
+ DECODE_PRINTF("[EBP]");
+ base = M.x86.R_ESP;
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ }
+ break;
+ case 6:
+ DECODE_PRINTF("[ESI]");
+ base = M.x86.R_ESI;
+ break;
+ case 7:
+ DECODE_PRINTF("[EDI]");
+ base = M.x86.R_EDI;
+ break;
+ }
+ switch ((sib >> 3) & 0x07) {
+ case 0:
+ DECODE_PRINTF("[EAX");
+ i = M.x86.R_EAX;
+ break;
+ case 1:
+ DECODE_PRINTF("[ECX");
+ i = M.x86.R_ECX;
+ break;
+ case 2:
+ DECODE_PRINTF("[EDX");
+ i = M.x86.R_EDX;
+ break;
+ case 3:
+ DECODE_PRINTF("[EBX");
+ i = M.x86.R_EBX;
+ break;
+ case 4:
+ i = 0;
+ break;
+ case 5:
+ DECODE_PRINTF("[EBP");
+ i = M.x86.R_EBP;
+ break;
+ case 6:
+ DECODE_PRINTF("[ESI");
+ i = M.x86.R_ESI;
+ break;
+ case 7:
+ DECODE_PRINTF("[EDI");
+ i = M.x86.R_EDI;
+ break;
+ }
+ scale = 1 << ((sib >> 6) & 0x03);
+ if (((sib >> 3) & 0x07) != 4) {
+ if (scale == 1) {
+ DECODE_PRINTF("]");
+ } else {
+ DECODE_PRINTF2("*%d]", scale);
+ }
+ }
+ return base + (i * scale);
+}
+
+/****************************************************************************
+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).
+****************************************************************************/
+u32 decode_rm00_address(
+ int rm)
+{
+ u32 offset;
+ int sib;
+
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ switch (rm) {
+ 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:
+ sib = fetch_byte_imm();
+ return decode_sib_address(sib, 0);
+ case 5:
+ offset = fetch_long_imm();
+ DECODE_PRINTF2("[%08x]", offset);
+ return offset;
+ case 6:
+ DECODE_PRINTF("[ESI]");
+ return M.x86.R_ESI;
+ case 7:
+ DECODE_PRINTF("[EDI]");
+ return M.x86.R_EDI;
+ }
+ HALT_SYS();
+ } else {
+ 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:
+ 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.
+****************************************************************************/
+u32 decode_rm01_address(
+ int rm)
+{
+ int displacement = 0;
+ int sib;
+
+ /* Fetch disp8 if no SIB byte */
+ if (!((M.x86.mode & SYSMODE_PREFIX_ADDR) && (rm == 4)))
+ displacement = (s8)fetch_byte_imm();
+
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ switch (rm) {
+ case 0:
+ DECODE_PRINTF2("%d[EAX]", displacement);
+ return M.x86.R_EAX + displacement;
+ case 1:
+ DECODE_PRINTF2("%d[ECX]", displacement);
+ return M.x86.R_ECX + displacement;
+ case 2:
+ DECODE_PRINTF2("%d[EDX]", displacement);
+ return M.x86.R_EDX + displacement;
+ case 3:
+ DECODE_PRINTF2("%d[EBX]", displacement);
+ return M.x86.R_EBX + displacement;
+ case 4:
+ sib = fetch_byte_imm();
+ displacement = (s8)fetch_byte_imm();
+ DECODE_PRINTF2("%d", displacement);
+ return decode_sib_address(sib, 1) + displacement;
+ case 5:
+ DECODE_PRINTF2("%d[EBP]", displacement);
+ return M.x86.R_EBP + displacement;
+ case 6:
+ DECODE_PRINTF2("%d[ESI]", displacement);
+ return M.x86.R_ESI + displacement;
+ case 7:
+ DECODE_PRINTF2("%d[EDI]", displacement);
+ return M.x86.R_EDI + displacement;
+ }
+ HALT_SYS();
+ } else {
+ 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.
+****************************************************************************/
+u32 decode_rm10_address(
+ int rm)
+{
+ u32 displacement = 0;
+ int sib;
+
+ /* Fetch disp16 if 16-bit addr mode */
+ if (!(M.x86.mode & SYSMODE_PREFIX_ADDR))
+ displacement = (u16)fetch_word_imm();
+ else {
+ /* Fetch disp32 if no SIB byte */
+ if (rm != 4)
+ displacement = (u32)fetch_long_imm();
+ }
+
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ switch (rm) {
+ case 0:
+ DECODE_PRINTF2("%08x[EAX]", displacement);
+ return M.x86.R_EAX + displacement;
+ case 1:
+ DECODE_PRINTF2("%08x[ECX]", displacement);
+ return M.x86.R_ECX + displacement;
+ case 2:
+ DECODE_PRINTF2("%08x[EDX]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_EDX + displacement;
+ case 3:
+ DECODE_PRINTF2("%08x[EBX]", displacement);
+ return M.x86.R_EBX + displacement;
+ case 4:
+ sib = fetch_byte_imm();
+ displacement = (u32)fetch_long_imm();
+ DECODE_PRINTF2("%08x", displacement);
+ return decode_sib_address(sib, 2) + displacement;
+ break;
+ case 5:
+ DECODE_PRINTF2("%08x[EBP]", displacement);
+ return M.x86.R_EBP + displacement;
+ case 6:
+ DECODE_PRINTF2("%08x[ESI]", displacement);
+ return M.x86.R_ESI + displacement;
+ case 7:
+ DECODE_PRINTF2("%08x[EDI]", displacement);
+ return M.x86.R_EDI + displacement;
+ }
+ HALT_SYS();
+ } else {
+ switch (rm) {
+ case 0:
+ DECODE_PRINTF2("%04x[BX+SI]", displacement);
+ return M.x86.R_BX + M.x86.R_SI + displacement;
+ case 1:
+ DECODE_PRINTF2("%04x[BX+DI]", displacement);
+ return M.x86.R_BX + M.x86.R_DI + displacement;
+ case 2:
+ DECODE_PRINTF2("%04x[BP+SI]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + M.x86.R_SI + displacement;
+ case 3:
+ DECODE_PRINTF2("%04x[BP+DI]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + M.x86.R_DI + displacement;
+ case 4:
+ DECODE_PRINTF2("%04x[SI]", displacement);
+ return M.x86.R_SI + displacement;
+ case 5:
+ DECODE_PRINTF2("%04x[DI]", displacement);
+ return M.x86.R_DI + displacement;
+ case 6:
+ DECODE_PRINTF2("%04x[BP]", displacement);
+ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return M.x86.R_BP + displacement;
+ case 7:
+ DECODE_PRINTF2("%04x[BX]", displacement);
+ return M.x86.R_BX + displacement;
+ }
+ HALT_SYS();
+ }
+ return 0;
+ /*NOTREACHED */
+}
diff --git a/hw/xfree86/x86emu/fpu.c b/hw/xfree86/x86emu/fpu.c
new file mode 100644
index 000000000..08aea4229
--- /dev/null
+++ b/hw/xfree86/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/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c
new file mode 100644
index 000000000..3714070dd
--- /dev/null
+++ b/hw/xfree86/x86emu/ops.c
@@ -0,0 +1,11675 @@
+/****************************************************************************
+*
+* 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.7 2002/07/15 16:49:10 dawes Exp $ */
+
+#include "x86emu/x86emui.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+op1 - Instruction op code
+
+REMARKS:
+Handles illegal opcodes.
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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)
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+{
+ int mod, rl, rh;
+ u32 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("INT 3\n");
+ 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
+****************************************************************************/
+static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+{
+ u8 intnum;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("INT\t");
+ intnum = fetch_byte_imm();
+ DECODE_PRINTF2("%x\n", intnum);
+ 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
+****************************************************************************/
+static void x86emuOp_into(u8 X86EMU_UNUSED(op1))
+{
+ START_OF_INSTR();
+ DECODE_PRINTF("INTO\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_OF)) {
+ 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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", (u16)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
+****************************************************************************/
+static 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", (u16)ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = (u16)ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+}
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0xea
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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/hw/xfree86/x86emu/ops2.c b/hw/xfree86/x86emu/ops2.c
new file mode 100644
index 000000000..ae295f782
--- /dev/null
+++ b/hw/xfree86/x86emu/ops2.c
@@ -0,0 +1,2803 @@
+/****************************************************************************
+*
+* 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.5 2002/07/15 16:49:10 dawes Exp $ */
+
+#include "x86emu/x86emui.h"
+
+/*----------------------------- Implementation ----------------------------*/
+
+/****************************************************************************
+PARAMETERS:
+op1 - Instruction op code
+
+REMARKS:
+Handles illegal opcodes.
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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();
+}
+
+#if 0
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xaa
+****************************************************************************/
+static 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();
+}
+#endif
+
+/****************************************************************************
+REMARKS:
+Handles opcode 0x0f,0xac
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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
+****************************************************************************/
+static 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/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c
new file mode 100644
index 000000000..ba4ffdeda
--- /dev/null
+++ b/hw/xfree86/x86emu/prim_ops.c
@@ -0,0 +1,2914 @@
+/****************************************************************************
+*
+* 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.
+****************************************************************************/
+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/hw/xfree86/x86emu/sys.c b/hw/xfree86/x86emu/sys.c
new file mode 100644
index 000000000..d493ae837
--- /dev/null
+++ b/hw/xfree86/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.7 2002/12/24 17:42:58 tsi Exp $ */
+
+#include "x86emu.h"
+#include "x86emu/x86emui.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>
+#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 defined(__GNUC__) && ((__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 defined(__GNUC__) && ((__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 defined(__GNUC__) && ((__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 defined(__GNUC__) && ((__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 defined(__GNUC__) && ((__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 defined(__GNUC__) && ((__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 defined(__GNUC__) && ((__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/hw/xfree86/x86emu/validate.c b/hw/xfree86/x86emu/validate.c
new file mode 100644
index 000000000..239f6c1f3
--- /dev/null
+++ b/hw/xfree86/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/hw/xfree86/x86emu/x86emu.h b/hw/xfree86/x86emu/x86emu.h
new file mode 100644
index 000000000..de989b83f
--- /dev/null
+++ b/hw/xfree86/x86emu/x86emu.h
@@ -0,0 +1,194 @@
+/****************************************************************************
+*
+* 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.3 2002/09/16 18:05:17 eich 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 ----------------------*/
+
+/* #pragma pack(1) */ /* Don't pack structs with function pointers! */
+
+/****************************************************************************
+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);
+
+/* #pragma pack() */
+
+/*--------------------- 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/hw/xfree86/x86emu/x86emu/debug.h b/hw/xfree86/x86emu/x86emu/debug.h
new file mode 100644
index 000000000..56221cbba
--- /dev/null
+++ b/hw/xfree86/x86emu/x86emu/debug.h
@@ -0,0 +1,211 @@
+/****************************************************************************
+*
+* 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/hw/xfree86/x86emu/x86emu/decode.h b/hw/xfree86/x86emu/x86emu/decode.h
new file mode 100644
index 000000000..d134f4294
--- /dev/null
+++ b/hw/xfree86/x86emu/x86emu/decode.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 instruction decoding logic.
+*
+****************************************************************************/
+/* $XFree86: xc/extras/x86emu/src/x86emu/x86emu/decode.h,v 1.3 2002/07/23 01:51:03 tsi Exp $ */
+
+#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);
+u32 decode_rm00_address(int rm);
+u32 decode_rm01_address(int rm);
+u32 decode_rm10_address(int rm);
+u32 decode_sib_address(int sib, int mod);
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+#endif /* __X86EMU_DECODE_H */
diff --git a/hw/xfree86/x86emu/x86emu/fpu.h b/hw/xfree86/x86emu/x86emu/fpu.h
new file mode 100644
index 000000000..5fb271463
--- /dev/null
+++ b/hw/xfree86/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/hw/xfree86/x86emu/x86emu/fpu_regs.h b/hw/xfree86/x86emu/x86emu/fpu_regs.h
new file mode 100644
index 000000000..56e9a04d7
--- /dev/null
+++ b/hw/xfree86/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/hw/xfree86/x86emu/x86emu/ops.h b/hw/xfree86/x86emu/x86emu/ops.h
new file mode 100644
index 000000000..65ea67654
--- /dev/null
+++ b/hw/xfree86/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/hw/xfree86/x86emu/x86emu/prim_asm.h b/hw/xfree86/x86emu/x86emu/prim_asm.h
new file mode 100644
index 000000000..4fa8d5503
--- /dev/null
+++ b/hw/xfree86/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/hw/xfree86/x86emu/x86emu/prim_ops.h b/hw/xfree86/x86emu/x86emu/prim_ops.h
new file mode 100644
index 000000000..1633fe1fa
--- /dev/null
+++ b/hw/xfree86/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/hw/xfree86/x86emu/x86emu/regs.h b/hw/xfree86/x86emu/x86emu/regs.h
new file mode 100644
index 000000000..12426278d
--- /dev/null
+++ b/hw/xfree86/x86emu/x86emu/regs.h
@@ -0,0 +1,334 @@
+/****************************************************************************
+*
+* 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.
+*
+****************************************************************************/
+/* $XFree86: xc/extras/x86emu/include/x86emu/regs.h,v 1.4 2002/09/16 18:05:18 eich Exp $ */
+
+#ifndef __X86EMU_REGS_H
+#define __X86EMU_REGS_H
+
+/*---------------------- Macros and type definitions ----------------------*/
+
+#pragma pack(1)
+
+/*
+ * 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
+ */
+ u32 mode;
+ 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
+ u8 intno;
+ u8 __pad[3];
+ } X86EMU_regs;
+
+/****************************************************************************
+REMARKS:
+Structure maintaining the emulator machine state.
+
+MEMBERS:
+mem_base - Base real mode memory for the emulator
+mem_size - Size of the real mode memory block for the emulator
+private - private data pointer
+x86 - X86 registers
+****************************************************************************/
+typedef struct {
+ unsigned long mem_base;
+ unsigned long mem_size;
+ void* private;
+ X86EMU_regs x86;
+ } X86EMU_sysEnv;
+
+#pragma pack()
+
+/*----------------------------- 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 */
+
+void printk(const char *fmt, ...);
+
+#ifdef __cplusplus
+} /* End of "C" linkage for C++ */
+#endif
+
+#endif /* __X86EMU_REGS_H */
diff --git a/hw/xfree86/x86emu/x86emu/types.h b/hw/xfree86/x86emu/x86emu/types.h
new file mode 100644
index 000000000..847ce835d
--- /dev/null
+++ b/hw/xfree86/x86emu/x86emu/types.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+*
+* 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.5 2002/07/23 14:22:45 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 */
+#undef __HAS_LONG_LONG__
+#if defined(__GNUC__) && !defined(NO_LONG_LONG)
+#define __HAS_LONG_LONG__
+#endif
+
+/* Taken from Xmd.h */
+#undef NUM32
+#if defined(__alpha) || defined(__alpha__) || \
+ defined(__ia64__) || defined(ia64) || \
+ defined(__sparc64__) || \
+ defined(__s390x__) || \
+ (defined(__hppa__) && defined(__LP64)) || \
+ defined(__x86_64__) || defined(x86_64) || \
+ (defined(__sgi) && (_MIPS_SZLONG == 64))
+#define NUM32 int
+#else
+#define NUM32 long
+#endif
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned NUM32 u32;
+#ifdef __HAS_LONG_LONG__
+typedef unsigned long long u64;
+#endif
+
+typedef char s8;
+typedef short s16;
+typedef NUM32 s32;
+#ifdef __HAS_LONG_LONG__
+typedef long long s64;
+#endif
+
+typedef unsigned int uint;
+typedef int sint;
+
+typedef u16 X86EMU_pioAddr;
+
+#undef NUM32
+
+#endif /* __X86EMU_TYPES_H */
diff --git a/hw/xfree86/x86emu/x86emu/x86emui.h b/hw/xfree86/x86emu/x86emu/x86emui.h
new file mode 100644
index 000000000..9cdb0a1b3
--- /dev/null
+++ b/hw/xfree86/x86emu/x86emu/x86emui.h
@@ -0,0 +1,105 @@
+/****************************************************************************
+*
+* 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.4 2001/04/01 13:59:58 tsi 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
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#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/hw/xfree86/xaa/XAA.HOWTO b/hw/xfree86/xaa/XAA.HOWTO
new file mode 100644
index 000000000..95d9d6100
--- /dev/null
+++ b/hw/xfree86/xaa/XAA.HOWTO
@@ -0,0 +1,1427 @@
+
+
+ XAA.HOWTO
+
+ This file describes how to add basic XAA support to a chipset driver.
+
+0) What is XAA
+1) XAA Initialization and Shutdown
+2) The Primitives
+ 2.0 Generic Flags
+ 2.1 Screen to Screen Copies
+ 2.2 Solid Fills
+ 2.3 Solid Lines
+ 2.4 Dashed Lines
+ 2.5 Color Expand Fills
+ 2.5.1 Screen to Screen Color Expansion
+ 2.5.2 CPU to Screen Color Expansion
+ 2.5.2.1 The Direct Method
+ 2.5.2.2 The Indirect Method
+ 2.6 8x8 Mono Pattern Fills
+ 2.7 8x8 Color Pattern Fills
+ 2.8 Image Writes
+ 2.8.1 The Direct Method
+ 2.8.2 The Indirect Method
+ 2.9 Clipping
+3) The Pixmap Cache
+4) Offscreen Pixmaps
+
+/********************************************************************/
+
+0) WHAT IS XAA
+
+ XAA (the XFree86 Acceleration Architecture) is a device dependent
+layer that encapsulates the unaccelerated framebuffer rendering layer,
+intercepting rendering commands sent to it from higher levels of the
+server. For rendering tasks where hardware acceleration is not
+possible, XAA allows the requests to proceed to the software rendering
+code. Otherwise, XAA breaks the sometimes complicated X primitives
+into simpler primitives more suitable for hardware acceleration and
+will use accelerated functions exported by the chipset driver to
+render these.
+
+ XAA provides a simple, easy to use driver interface that allows
+the driver to communicate its acceleration capabilities and restrictions
+back to XAA. XAA will use the information provided by the driver
+to determine whether or not acceleration will be possible for a
+particular X primitive.
+
+
+
+1) XAA INITIALIZATION AND SHUTDOWN
+
+ All relevant prototypes and defines are in xaa.h.
+
+ To Initialize the XAA layer, the driver should allocate an XAAInfoRec
+via XAACreateInfoRec(), fill it out as described in this document
+and pass it to XAAInit(). XAAInit() must be called _after_ the
+framebuffer initialization (usually cfb?ScreenInit or similar) since
+it is "wrapping" that layer. XAAInit() should be called _before_ the
+cursor initialization (usually miDCInitialize) since the cursor
+layer needs to "wrap" all the rendering code including XAA.
+
+ When shutting down, the driver should free the XAAInfoRec
+structure in its CloseScreen function via XAADestroyInfoRec().
+The prototypes for the functions mentioned above are as follows:
+
+ XAAInfoRecPtr XAACreateInfoRec(void);
+ Bool XAAInit(ScreenPtr, XAAInfoRecPtr);
+ void XAADestroyInfoRec(XAAInfoRec);
+
+ The driver informs XAA of it's acceleration capablities by
+filling out an XAAInfoRec structure and passing it to XAAInit().
+The XAAInfoRec structure contains many fields, most of which are
+function pointers and flags. Each primitive will typically have
+two functions and a set of flags associated with it, but it may
+have more. These two functions are the "SetupFor" and "Subsequent"
+functions. The "SetupFor" function tells the driver that the
+hardware should be initialized for a particular type of graphics
+operation. After the "SetupFor" function, one or more calls to the
+"Subsequent" function will be made to indicate that an instance
+of the particular primitive should be rendered by the hardware.
+The details of each instance (width, height, etc...) are given
+with each "Subsequent" function. The set of flags associated
+with each primitive lets the driver tell XAA what its hardware
+limitations are (eg. It doesn't support a planemask, it can only
+do one of the raster-ops, etc...).
+
+ Of the XAAInfoRec fields, one is required. This is the
+Sync function. XAA initialization will fail if this function
+is not provided.
+
+void Sync(ScrnInfoPtr pScrn) /* Required */
+
+ Sync will be called when XAA needs to be certain that all
+ graphics coprocessor operations are finished, such as when
+ the framebuffer must be written to or read from directly
+ and it must be certain that the accelerator will not be
+ overwriting the area of interest.
+
+ One needs to make certain that the Sync function not only
+ waits for the accelerator fifo to empty, but that it waits for
+ the rendering of that last operation to complete.
+
+ It is guaranteed that no direct framebuffer access will
+ occur after a "SetupFor" or "Subsequent" function without
+ the Sync function being called first.
+
+
+
+2) THE PRIMITIVES
+
+2.0 Generic Flags
+
+ Each primitive type has a set of flags associated with it which
+allow the driver to tell XAA what the hardware limitations are.
+The common ones are as follows:
+
+/* Foreground, Background, rop and planemask restrictions */
+
+ GXCOPY_ONLY
+
+ This indicates that the accelerator only supports GXcopy
+ for the particular primitive.
+
+ ROP_NEEDS_SOURCE
+
+ This indicates that the accelerator doesn't supports a
+ particular primitive with rops that don't involve the source.
+ These rops are GXclear, GXnoop, GXinvert and GXset. If neither
+ this flag nor GXCOPY_ONLY is defined, it is assumed that the
+ accelerator supports all 16 raster operations (rops) for that
+ primitive.
+
+ NO_PLANEMASK
+
+ This indicates that the accelerator does not support a hardware
+ write planemask for the particular primitive.
+
+ RGB_EQUAL
+
+ This indicates that the particular primitive requires the red,
+ green and blue bytes of the foreground color (and background color,
+ if applicable) to be equal. This is useful for 24bpp when a graphics
+ coprocessor is used in 8bpp mode, which is not uncommon in older
+ hardware since some have no support for or only limited support for
+ acceleration at 24bpp. This way, many operations will be accelerated
+ for the common case of "grayscale" colors. This flag should only
+ be used in 24bpp.
+
+ In addition to the common ones listed above which are possible for
+nearly all primitives, each primitive may have its own flags specific
+to that primitive. If such flags exist they are documented in the
+descriptions of those primitives below.
+
+
+
+
+2.1 Screen to Screen Copies
+
+ The SetupFor and Subsequent ScreenToScreenCopy functions provide
+ an interface for copying rectangular areas from video memory to
+ video memory. To accelerate this primitive the driver should
+ provide both the SetupFor and Subsequent functions and indicate
+ the hardware restrictions via the ScreenToScreenCopyFlags. The
+ NO_PLANEMASK, GXCOPY_ONLY and ROP_NEEDS_SOURCE flags as described
+ in Section 2.0 are valid as well as the following:
+
+ NO_TRANSPARENCY
+
+ This indicates that the accelerator does not support skipping
+ of color keyed pixels when copying from the source to the destination.
+
+ TRANSPARENCY_GXCOPY_ONLY
+
+ This indicates that the accelerator supports skipping of color keyed
+ pixels only when the rop is GXcopy.
+
+ ONLY_LEFT_TO_RIGHT_BITBLT
+
+ This indicates that the hardware only accepts blitting when the
+ x direction is positive.
+
+ ONLY_TWO_BITBLT_DIRECTIONS
+
+ This indicates that the hardware can only cope with blitting when
+ the direction of x is the same as the direction in y.
+
+
+void SetupForScreenToScreenCopy( ScrnInfoPtr pScrn,
+ int xdir, int ydir,
+ int rop,
+ unsigned int planemask,
+ int trans_color )
+
+ When this is called, SubsequentScreenToScreenCopy will be called
+ one or more times directly after. If ydir is 1, then the accelerator
+ should copy starting from the top (minimum y) of the source and
+ proceed downward. If ydir is -1, then the accelerator should copy
+ starting from the bottom of the source (maximum y) and proceed
+ upward. If xdir is 1, then the accelerator should copy each
+ y scanline starting from the leftmost pixel of the source. If
+ xdir is -1, it should start from the rightmost pixel.
+ If trans_color is not -1 then trans_color indicates that the
+ accelerator should not copy pixels with the color trans_color
+ from the source to the destination, but should skip them.
+ Trans_color is always -1 if the NO_TRANSPARENCY flag is set.
+
+
+void SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn,
+ int x1, int y1,
+ int x2, int y2,
+ int width, int height)
+
+ Copy a rectangle "width" x "height" from the source (x1,y1) to the
+ destination (x2,y2) using the parameters passed by the last
+ SetupForScreenToScreenCopy call. (x1,y1) and (x2,y2) always denote
+ the upper left hand corners of the source and destination regardless
+ of which xdir and ydir values are given by SetupForScreenToScreenCopy.
+
+
+
+2.2 Solid Fills
+
+ The SetupFor and Subsequent SolidFill(Rect/Trap) functions provide
+ an interface for filling rectangular areas of the screen with a
+ foreground color. To accelerate this primitive the driver should
+ provide both the SetupForSolidFill and SubsequentSolidFillRect
+ functions and indicate the hardware restrictions via the SolidFillFlags.
+ The driver may optionally provide a SubsequentSolidFillTrap if
+ it is capable of rendering the primitive correctly.
+ The GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags
+ as described in Section 2.0 are valid.
+
+
+void SetupForSolidFill(ScrnInfoPtr pScrn,
+ int color, int rop, unsigned int planemask)
+
+ SetupForSolidFill indicates that any combination of the following
+ may follow it.
+
+ SubsequentSolidFillRect
+ SubsequentSolidFillTrap
+
+
+
+void SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
+
+ Fill a rectangle of dimensions "w" by "h" with origin at (x,y)
+ using the color, rop and planemask given by the last
+ SetupForSolidFill call.
+
+void SubsequentSolidFillTrap(ScrnInfoPtr pScrn, int y, int h,
+ int left, int dxL, int dyL, int eL,
+ int right, int dxR, int dyR, int eR)
+
+ These parameters describe a trapezoid via a version of
+ Bresenham's parameters. "y" is the top line. "h" is the
+ number of spans to be filled in the positive Y direction.
+ "left" and "right" indicate the starting X values of the
+ left and right edges. dy/dx describes the edge slope.
+ These are not the deltas between the beginning and ending
+ points on an edge. They merely describe the slope. "e" is
+ the initial error term. It's the relationships between dx,
+ dy and e that define the edge.
+ If your engine does not do bresenham trapezoids or does
+ not allow the programmer to specify the error term then
+ you are not expected to be able to accelerate them.
+
+
+2.3 Solid Lines
+
+ XAA provides an interface for drawing thin lines. In order to
+ draw X lines correctly a high degree of accuracy is required.
+ This usually limits line acceleration to hardware which has a
+ Bresenham line engine, though depending on the algorithm used,
+ other line engines may come close if they accept 16 bit line
+ deltas. XAA has both a Bresenham line interface and a two-point
+ line interface for drawing lines of arbitrary orientation.
+ Additionally there is a SubsequentSolidHorVertLine which will
+ be used for all horizontal and vertical lines. Horizontal and
+ vertical lines are handled separately since hardware that doesn't
+ have a line engine (or has one that is unusable due to precision
+ problems) can usually draw these lines by some other method such
+ as drawing them as thin rectangles. Even for hardware that can
+ draw arbitrary lines via the Bresenham or two-point interfaces,
+ the SubsequentSolidHorVertLine is used for horizontal and vertical
+ lines since most hardware is able to render the horizontal lines
+ and sometimes the vertical lines faster by other methods (Hint:
+ try rendering horizontal lines as flattened rectangles). If you have
+ not provided a SubsequentSolidHorVertLine but you have provided
+ Bresenham or two-point lines, a SubsequentSolidHorVertLine function
+ will be supplied for you.
+
+ The flags field associated with Solid Lines is SolidLineFlags and
+ the GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags as
+ described in Section 2.0 are valid restrictions.
+
+ Some line engines have line biases hardcoded to comply with
+ Microsoft line biasing rules. A tell-tale sign of this is the
+ hardware lines not matching the software lines in the zeroth and
+ fourth octants. The driver can set the flag:
+
+ MICROSOFT_ZERO_LINE_BIAS
+
+ in the AccelInfoRec.Flags field to adjust the software lines to
+ match the hardware lines. This is in the generic flags field
+ rather than the SolidLineFlags since this flag applies to all
+ software zero-width lines on the screen and not just the solid ones.
+
+
+void SetupForSolidLine(ScrnInfoPtr pScrn,
+ int color, int rop, unsigned int planemask)
+
+ SetupForSolidLine indicates that any combination of the following
+ may follow it.
+
+ SubsequentSolidBresenhamLine
+ SubsequentSolidTwoPointLine
+ SubsequentSolidHorVertLine
+
+
+void SubsequentSolidHorVertLine( ScrnInfoPtr pScrn,
+ int x, int y, int len, int dir )
+
+ All vertical and horizontal solid thin lines are rendered with
+ this function. The line starts at coordinate (x,y) and extends
+ "len" pixels inclusive. In the direction indicated by "dir."
+ The direction is either DEGREES_O or DEGREES_270. That is, it
+ always extends to the right or down.
+
+
+
+void SubsequentSolidTwoPointLine(ScrnInfoPtr pScrn,
+ int x1, int y1, int x2, int y2, int flags)
+
+ Draw a line from (x1,y1) to (x2,y2). If the flags field contains
+ the flag OMIT_LAST, the last pixel should not be drawn. Otherwise,
+ the pixel at (x2,y2) should be drawn.
+
+ If you use the TwoPoint line interface there is a good possibility
+ that your line engine has hard-coded line biases that do not match
+ the default X zero-width lines. If so, you may need to set the
+ MICROSOFT_ZERO_LINE_BIAS flag described above. Note that since
+ any vertex in the 16-bit signed coordinate system is valid, your
+ line engine is expected to handle 16-bit values if you have hardware
+ line clipping enabled. If your engine cannot handle 16-bit values,
+ you should not use hardware line clipping.
+
+
+void SubsequentSolidBresenhamLine(ScrnInfoPtr pScrn,
+ int x, int y, int major, int minor, int err, int len, int octant)
+
+ "X" and "y" are the starting point of the line. "Major" and "minor"
+ are the major and minor step constants. "Err" is the initial error
+ term. "Len" is the number of pixels to be drawn (inclusive). "Octant"
+ can be any combination of the following flags OR'd together:
+
+ Y_MAJOR Y is the major axis (X otherwise)
+ X_DECREASING The line is drawn from right to left
+ Y_DECREASING The line is drawn from bottom to top
+
+ The major, minor and err terms are the "raw" Bresenham parameters
+ consistent with a line engine that does:
+
+ e = err;
+ while(len--) {
+ DRAW_POINT(x,y);
+ e += minor;
+ if(e >= 0) {
+ e -= major;
+ TAKE_ONE_STEP_ALONG_MINOR_AXIS;
+ }
+ TAKE_ONE_STEP_ALONG_MAJOR_AXIS;
+ }
+
+ IBM 8514 style Bresenham line interfaces require their parameters
+ modified in the following way:
+
+ Axial = minor;
+ Diagonal = minor - major;
+ Error = minor + err;
+
+SolidBresenhamLineErrorTermBits
+
+ This field allows the driver to tell XAA how many bits large its
+ Bresenham parameter registers are. Many engines have registers that
+ only accept 12 or 13 bit Bresenham parameters, and the parameters
+ for clipped lines may overflow these if they are not scaled down.
+ If this field is not set, XAA will assume the engine can accomodate
+ 16 bit parameters, otherwise, it will scale the parameters to the
+ size specified.
+
+
+2.4 Dashed Lines
+
+ The same degree of accuracy required by the solid lines is required
+ for drawing dashed lines as well. The dash pattern itself is a
+ buffer of binary data where ones are expanded into the foreground
+ color and zeros either correspond to the background color or
+ indicate transparency depending on whether or not DoubleDash or
+ OnOffDashes are being drawn.
+
+ The flags field associated with dashed Lines is DashedLineFlags and
+ the GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags as
+ described in Section 2.0 are valid restrictions. Additionally, the
+ following flags are valid:
+
+ NO_TRANSPARENCY
+
+ This indicates that the driver cannot support dashed lines
+ with transparent backgrounds (OnOffDashes).
+
+ TRANSPARENCY_ONLY
+
+ This indicates that the driver cannot support dashes with
+ both a foreground and background color (DoubleDashes).
+
+ LINE_PATTERN_POWER_OF_2_ONLY
+
+ This indicates that only patterns with a power of 2 length
+ can be accelerated.
+
+ LINE_PATTERN_LSBFIRST_MSBJUSTIFIED
+ LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
+ LINE_PATTERN_MSBFIRST_MSBJUSTIFIED
+ LINE_PATTERN_MSBFIRST_LSBJUSTIFIED
+
+ These describe how the line pattern should be packed.
+ The pattern buffer is DWORD padded. LSBFIRST indicates
+ that the pattern runs from the LSB end to the MSB end.
+ MSBFIRST indicates that the pattern runs from the MSB end
+ to the LSB end. When the pattern does not completely fill
+ the DWORD padded buffer, the pattern will be justified
+ towards the MSB or LSB end based on the flags above.
+
+
+ The following field indicates the maximum length dash pattern that
+ should be accelerated.
+
+ int DashPatternMaxLength
+
+
+void SetupForDashedLine(ScrnInfoPtr pScrn,
+ int fg, int bg, int rop, unsigned int planemask,
+ int length, unsigned char *pattern)
+
+
+ SetupForDashedLine indicates that any combination of the following
+ may follow it.
+
+ SubsequentDashedBresenhamLine
+ SubsequentDashedTwoPointLine
+
+ If "bg" is -1, then the background (pixels corresponding to clear
+ bits in the pattern) should remain unmodified. "Bg" indicates the
+ background color otherwise. "Length" indicates the length of
+ the pattern in bits and "pattern" points to the DWORD padded buffer
+ holding the pattern which has been packed according to the flags
+ set above.
+
+
+void SubsequentDashedTwoPointLine( ScrnInfoPtr pScrn,
+ int x1, int y1, int x2, int y2, int flags, int phase)
+
+void SubsequentDashedBresenhamLine(ScrnInfoPtr pScrn,
+ int x1, int y1, int major, int minor, int err, int len, int octant,
+ int phase)
+
+ These are the same as the SubsequentSolidTwoPointLine and
+ SubsequentBresenhamLine functions except for the addition
+ of the "phase" field which indicates the offset into the dash
+ pattern that the pixel at (x1,y1) corresponds to.
+
+ As with the SubsequentBresenhamLine, there is an
+
+ int DashedBresenhamLineErrorTermBits
+
+ field which indicates the size of the error term registers
+ used with dashed lines. This is usually the same value as
+ the field for the solid lines (because it's usually the same
+ register).
+
+
+
+2.5 Color Expansion Fills
+
+ When filling a color expansion rectangle, the accelerator
+ paints each pixel depending on whether or not a bit in a
+ corresponding bitmap is set or clear. Opaque expansions are
+ when a set bit corresponds to the foreground color and a clear
+ bit corresponds to the background color. A transparent expansion
+ is when a set bit corresponds to the foreground color and a
+ clear bit indicates that the pixel should remain unmodified.
+
+ The graphics accelerator usually has access to the source
+ bitmap in one of two ways: 1) the bitmap data is sent serially
+ to the accelerator by the CPU through some memory mapped aperture
+ or 2) the accelerator reads the source bitmap out of offscreen
+ video memory. Some types of primitives are better suited towards
+ one method or the other. Type 2 is useful for reusable patterns
+ such as stipples which can be cached in offscreen memory. The
+ aperature method can be used for stippling but the CPU must pass
+ the data across the bus each time a stippled fill is to be performed.
+ For expanding 1bpp client pixmaps or text strings to the screen,
+ the aperature method is usually superior because the intermediate
+ copy in offscreen memory needed by the second method would only be
+ used once. Unfortunately, many accelerators can only do one of these
+ methods and not both.
+
+ XAA provides both ScreenToScreen and CPUToScreen color expansion
+ interfaces for doing color expansion fills. The ScreenToScreen
+ functions can only be used with hardware that supports reading
+ of source bitmaps from offscreen video memory, and these are only
+ used for cacheable patterns such as stipples. There are two
+ variants of the CPUToScreen routines - a direct method intended
+ for hardware that has a transfer aperature, and an indirect method
+ intended for hardware without transfer aperatures or hardware
+ with unusual transfer requirements. Hardware that can only expand
+ bitmaps from video memory should supply ScreenToScreen routines
+ but also ScanlineCPUToScreen (indirect) routines to optimize transfers
+ of non-cacheable data. Hardware that can only accept source bitmaps
+ through an aperature should supply CPUToScreen (or ScanlineCPUToScreen)
+ routines. Hardware that can do both should provide both ScreenToScreen
+ and CPUToScreen routines.
+
+ For both ScreenToScreen and CPUToScreen interfaces, the GXCOPY_ONLY,
+ ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags described in
+ Section 2.0 are valid as well as the following:
+
+ /* bit order requirements (one of these must be set) */
+
+ BIT_ORDER_IN_BYTE_LSBFIRST
+
+ This indicates that least significant bit in each byte of the source
+ data corresponds to the leftmost of that block of 8 pixels. This
+ is the prefered format.
+
+ BIT_ORDER_IN_BYTE_MSBFIRST
+
+ This indicates that most significant bit in each byte of the source
+ data corresponds to the leftmost of that block of 8 pixels.
+
+ /* transparency restrictions */
+
+ NO_TRANSPARENCY
+
+ This indicates that the accelerator cannot do a transparent expansion.
+
+ TRANSPARENCY_ONLY
+
+ This indicates that the accelerator cannot do an opaque expansion.
+ In cases where where the background needs to be filled, XAA will
+ render the primitive in two passes when using the CPUToScreen
+ interface, but will not do so with the ScreenToScreen interface
+ since that would require caching of two patterns. Some
+ ScreenToScreen hardware may be able to render two passes at the
+ driver level and remove the TRANSPARENCY_ONLY restriction if
+ it can render pixels corresponding to the zero bits.
+
+
+
+2.5.1 Screen To Screen Color Expansion
+
+ The ScreenToScreenColorExpandFill routines provide an interface
+ for doing expansion blits from source patterns stored in offscreen
+ video memory.
+
+ void SetupForScreenToScreenColorExpandFill (ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop, unsigned int planemask)
+
+
+ Ones in the source bitmap will correspond to the fg color.
+ Zeros in the source bitmap will correspond to the bg color
+ unless bg = -1. In that case the pixels corresponding to the
+ zeros in the bitmap shall be left unmodified by the accelerator.
+
+ For hardware that doesn't allow an easy implementation of skipleft, the
+ driver can replace CacheMonoStipple function with one that stores multiple
+ rotated copies of the stipple and select between them. In this case the
+ driver should set CacheColorExpandDensity to tell XAA how many copies of
+ the pattern are stored in the width of a cache slot. For instance if the
+ hardware can specify the starting address in bytes, then 8 rotated copies
+ of the stipple are needed and CacheColorExpandDensity should be set to 8.
+
+ void SubsequentScreenToScreenColorExpandFill( ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int srcx, int srcy, int offset )
+
+
+ Fill a rectangle "w" x "h" at location (x,y). The source pitch
+ between scanlines is the framebuffer pitch (pScrn->displayWidth
+ pixels) and srcx and srcy indicate the start of the source pattern
+ in units of framebuffer pixels. "Offset" indicates the bit offset
+ into the pattern that corresponds to the pixel being painted at
+ "x" on the screen. Some hardware accepts source coordinates in
+ units of bits which makes implementation of the offset trivial.
+ In that case, the bit address of the source bit corresponding to
+ the pixel painted at (x,y) would be:
+
+ (srcy * pScrn->displayWidth + srcx) * pScrn->bitsPerPixel + offset
+
+ It should be noted that the offset assumes LSBFIRST hardware.
+ For MSBFIRST hardware, the driver may need to implement the
+ offset by bliting only from byte boundaries and hardware clipping.
+
+
+
+2.5.2 CPU To Screen Color Expansion
+
+
+ The CPUToScreenColorExpandFill routines provide an interface for
+ doing expansion blits from source patterns stored in system memory.
+ There are two varieties of this primitive, a CPUToScreenColorExpandFill
+ and a ScanlineCPUToScreenColorExpandFill. With the
+ CPUToScreenColorExpandFill method, the source data is sent serially
+ through a memory mapped aperature. With the Scanline version, the
+ data is rendered scanline at a time into intermediate buffers with
+ a call to SubsequentColorExpandScanline following each scanline.
+
+ These two methods have separate flags fields, the
+ CPUToScreenColorExpandFillFlags and ScanlineCPUToScreenColorExpandFillFlags
+ respectively. Flags specific to one method or the other are described
+ in sections 2.5.2.1 and 2.5.2.2 but for both cases the bit order and
+ transparency restrictions listed at the beginning of section 2.5 are
+ valid as well as the following:
+
+ /* clipping (optional) */
+
+ LEFT_EDGE_CLIPPING
+
+ This indicates that the accelerator supports omission of up to
+ 31 pixels on the left edge of the rectangle to be filled. This
+ is beneficial since it allows transfer of the source bitmap to
+ always occur from DWORD boundaries.
+
+ LEFT_EDGE_CLIPPING_NEGATIVE_X
+
+ This flag indicates that the accelerator can render color expansion
+ rectangles even if the value of x origin is negative (off of
+ the screen on the left edge).
+
+ /* misc */
+
+ TRIPLE_BITS_24BPP
+
+ When enabled (must be in 24bpp mode), color expansion functions
+ are expected to require three times the amount of bits to be
+ transferred so that 24bpp grayscale colors can be used with color
+ expansion in 8bpp coprocessor mode. Each bit is expanded to 3
+ bits when writing the monochrome data.
+
+
+ 2.5.1 The Direct Method
+
+
+ Using the direct method of color expansion XAA will send all
+ bitmap data to the accelerator serially through an memory mapped
+ transfer window defined by the following two fields:
+
+ unsigned char *ColorExpandBase
+
+ This indicates the memory address of the beginning of the aperture.
+
+ int ColorExpandRange
+
+ This indicates the size in bytes of the aperture.
+
+ The driver should specify how the transfered data should be padded.
+ There are options for both the padding of each Y scanline and for the
+ total transfer to the aperature.
+ One of the following two flags must be set:
+
+ CPU_TRANSFER_PAD_DWORD
+
+ This indicates that the total transfer (sum of all scanlines) sent
+ to the aperature must be DWORD padded. This is the default behavior.
+
+ CPU_TRANSFER_PAD_QWORD
+
+ This indicates that the total transfer (sum of all scanlines) sent
+ to the aperature must be QWORD padded. With this set, XAA will send
+ an extra DWORD to the aperature when needed to ensure that only
+ an even number of DWORDs are sent.
+
+ And then there are the flags for padding of each scanline:
+
+ SCANLINE_PAD_DWORD
+
+ This indicates that each Y scanline should be DWORD padded.
+ This is the only option available and is the default.
+
+ Finally, there is the CPU_TRANSFER_BASE_FIXED flag which indicates
+ that the aperture is a single register rather than a range of
+ registers, and XAA should write all of the data to the first DWORD.
+ If the ColorExpandRange is not large enough to accomodate scanlines
+ the width of the screen, this option will be forced. That is, the
+ ColorExpandRange must be:
+
+ ((virtualX + 31)/32) * 4 bytes or more.
+
+ ((virtualX + 62)/32 * 4) if LEFT_EDGE_CLIPPING_NEGATIVE_X is set.
+
+ If the TRIPLE_BITS_24BPP flag is set, the required area should be
+ multiplied by three.
+
+
+void SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask)
+
+
+
+ Ones in the source bitmap will correspond to the fg color.
+ Zeros in the source bitmap will correspond to the bg color
+ unless bg = -1. In that case the pixels corresponding to the
+ zeros in the bitmap shall be left unmodified by the accelerator.
+
+
+void SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft )
+
+ When this function is called, the accelerator should be setup
+ to fill a rectangle of dimension "w" by "h" with origin at (x,y)
+ in the fill style prescribed by the last call to
+ SetupForCPUToScreenColorExpandFill. XAA will pass the data to
+ the aperture immediately after this function is called. If the
+ skipleft is non-zero (and LEFT_EDGE_CLIPPING has been enabled), then
+ the accelerator _should_not_ render skipleft pixels on the leftmost
+ edge of the rectangle. Some engines have an alignment feature
+ like this built in, some others can do this using a clipping
+ window.
+
+ It can be arranged for XAA to call Sync() after it is through
+ calling the Subsequent function by setting SYNC_AFTER_COLOR_EXPAND
+ in the CPUToScreenColorExpandFillFlags. This can provide the driver
+ with an oportunity to reset a clipping window if needed.
+
+
+2.5.2 The Indirect Method
+
+ Using the indirect method, XAA will render the bitmap data scanline
+ at a time to one or more buffers. These buffers may be memory
+ mapped apertures or just intermediate storage.
+
+ int NumScanlineColorExpandBuffers
+
+ This indicates the number of buffers available.
+
+ unsigned char **ScanlineColorExpandBuffers
+
+ This is an array of pointers to the memory locations of each buffer.
+ Each buffer is expected to be large enough to accommodate scanlines
+ the width of the screen. That is:
+
+ ((virtualX + 31)/32) * 4 bytes or more.
+
+ ((virtualX + 62)/32 * 4) if LEFT_EDGE_CLIPPING_NEGATIVE_X is set.
+
+ Scanlines are always DWORD padded.
+ If the TRIPLE_BITS_24BPP flag is set, the required area should be
+ multiplied by three.
+
+
+void SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask)
+
+ Ones in the source bitmap will correspond to the fg color.
+ Zeros in the source bitmap will correspond to the bg color
+ unless bg = -1. In that case the pixels corresponding to the
+ zeros in the bitmap shall be left unmodified by the accelerator.
+
+
+void SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft )
+
+void SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
+
+
+ When SubsequentScanlineCPUToScreenColorExpandFill is called, XAA
+ will begin transfering the source data scanline at a time, calling
+ SubsequentColorExpandScanline after each scanline. If more than
+ one buffer is available, XAA will cycle through the buffers.
+ Subsequent scanlines will use the next buffer and go back to the
+ buffer 0 again when the last buffer is reached. The index into
+ the ScanlineColorExpandBuffers array is presented as "bufno"
+ with each SubsequentColorExpandScanline call.
+
+ The skipleft field is the same as for the direct method.
+
+ The indirect method can be use to send the source data directly
+ to a memory mapped aperture represented by a single color expand
+ buffer, scanline at a time, but more commonly it is used to place
+ the data into offscreen video memory so that the accelerator can
+ blit it to the visible screen from there. In the case where the
+ accelerator permits rendering into offscreen video memory while
+ the accelerator is active, several buffers can be used so that
+ XAA can be placing source data into the next buffer while the
+ accelerator is blitting the current buffer. For cases where
+ the accelerator requires some special manipulation of the source
+ data first, the buffers can be in system memory. The CPU can
+ manipulate these buffers and then send the data to the accelerator.
+
+
+
+2.6 8x8 Mono Pattern Fills
+
+ XAA provides support for two types of 8x8 hardware patterns -
+ "Mono" patterns and "Color" patterns. Mono pattern data is
+ 64 bits of color expansion data with ones indicating the
+ foreground color and zeros indicating the background color.
+ The source bitmaps for the 8x8 mono patterns can be presented
+ to the graphics accelerator in one of two ways. They can be
+ passed as two DWORDS to the 8x8 mono pattern functions or
+ they can be cached in offscreen memory and their locations
+ passed to the 8x8 mono pattern functions. In addition to the
+ GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags
+ defined in Section 2.0, the following are defined for the
+ Mono8x8PatternFillFlags:
+
+ HARDWARE_PATTERN_PROGRAMMED_BITS
+
+ This indicates that the 8x8 patterns should be packed into two
+ DWORDS and passed to the 8x8 mono pattern functions. The default
+ behavior is to cache the patterns in offscreen video memory and
+ pass the locations of these patterns to the functions instead.
+ The pixmap cache must be enabled for the default behavior (8x8
+ pattern caching) to work. See Section 3 for how to enable the
+ pixmap cache. The pixmap cache is not necessary for
+ HARDWARE_PATTERN_PROGRAMMED_BITS.
+
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN
+
+ If the hardware supports programmable pattern offsets then
+ this option should be set. See the table below for further
+ infomation.
+
+ HARDWARE_PATTERN_SCREEN_ORIGIN
+
+ Some hardware wants the pattern offset specified with respect to the
+ upper left-hand corner of the primitive being drawn. Other hardware
+ needs the option HARDWARE_PATTERN_SCREEN_ORIGIN set to indicate that
+ all pattern offsets should be referenced to the upper left-hand
+ corner of the screen. HARDWARE_PATTERN_SCREEN_ORIGIN is preferable
+ since this is more natural for the X-Window system and offsets will
+ have to be recalculated for each Subsequent function otherwise.
+
+ BIT_ORDER_IN_BYTE_MSBFIRST
+ BIT_ORDER_IN_BYTE_LSBFIRST
+
+ As with other color expansion routines this indicates whether the
+ most or the least significant bit in each byte from the pattern is
+ the leftmost on the screen.
+
+ TRANSPARENCY_ONLY
+ NO_TRANSPARENCY
+
+ This means the same thing as for the color expansion rect routines
+ except that for TRANSPARENCY_ONLY XAA will not render the primitive
+ in two passes since this is more easily handled by the driver.
+ It is recommended that TRANSPARENCY_ONLY hardware handle rendering
+ of opaque patterns in two passes (the background can be filled as
+ a rectangle in GXcopy) in the Subsequent function so that the
+ TRANSPARENCY_ONLY restriction can be removed.
+
+
+
+ Additional information about cached patterns...
+ For the case where HARDWARE_PATTERN_PROGRAMMED_BITS is not set and
+ the pattern must be cached in offscreen memory, the first pattern
+ starts at the cache slot boundary which is set by the
+ CachePixelGranularity field used to configure the pixmap cache.
+ One should ensure that the CachePixelGranularity reflects any
+ alignment restrictions that the accelerator may put on 8x8 pattern
+ storage locations. When HARDWARE_PATTERN_PROGRAMMED_ORIGIN is set
+ there is only one pattern stored. When this flag is not set,
+ all 64 pre-rotated copies of the pattern are cached in offscreen memory.
+ The MonoPatternPitch field can be used to specify the X position pixel
+ granularity that each of these patterns must align on. If the
+ MonoPatternPitch is not supplied, the patterns will be densely packed
+ within the cache slot. The behavior of the default XAA 8x8 pattern
+ caching mechanism to store all 8x8 patterns linearly in video memory.
+ If the accelerator needs the patterns stored in a more unusual fashion,
+ the driver will need to provide its own 8x8 mono pattern caching
+ routines for XAA to use.
+
+ The following table describes the meanings of the "patx" and "paty"
+ fields in both the SetupFor and Subsequent functions.
+
+ With HARDWARE_PATTERN_SCREEN_ORIGIN
+ -----------------------------------
+
+ HARDWARE_PATTERN_PROGRAMMED_BITS and HARDWARE_PATTERN_PROGRAMMED_ORIGIN
+
+ SetupFor: patx and paty are the first and second DWORDS of the
+ 8x8 mono pattern.
+
+ Subsequent: patx and paty are the x,y offset into that pattern.
+ All Subsequent calls will have the same offset in
+ the case of HARDWARE_PATTERN_SCREEN_ORIGIN so only
+ the offset specified by the first Subsequent call
+ after a SetupFor call will need to be observed.
+
+ HARDWARE_PATTERN_PROGRAMMED_BITS only
+
+ SetupFor: patx and paty hold the first and second DWORDS of
+ the 8x8 mono pattern pre-rotated to match the desired
+ offset.
+
+ Subsequent: These just hold the same patterns and can be ignored.
+
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
+
+ SetupFor: patx and paty hold the x,y coordinates of the offscreen
+ memory location where the 8x8 pattern is stored. The
+ bits are stored linearly in memory at that location.
+
+ Subsequent: patx and paty hold the offset into the pattern.
+ All Subsequent calls will have the same offset in
+ the case of HARDWARE_PATTERN_SCREEN_ORIGIN so only
+ the offset specified by the first Subsequent call
+ after a SetupFor call will need to be observed.
+
+ Neither programmed bits or origin
+
+ SetupFor: patx and paty hold the x,y coordinates of the offscreen
+ memory location where the pre-rotated 8x8 pattern is
+ stored.
+
+ Subsequent: patx and paty are the same as in the SetupFor function
+ and can be ignored.
+
+
+ Without HARDWARE_PATTERN_SCREEN_ORIGIN
+ --------------------------------------
+
+ HARDWARE_PATTERN_PROGRAMMED_BITS and HARDWARE_PATTERN_PROGRAMMED_ORIGIN
+
+ SetupFor: patx and paty are the first and second DWORDS of the
+ 8x8 mono pattern.
+
+ Subsequent: patx and paty are the x,y offset into that pattern.
+
+ HARDWARE_PATTERN_PROGRAMMED_BITS only
+
+ SetupFor: patx and paty holds the first and second DWORDS of
+ the unrotated 8x8 mono pattern. This can be ignored.
+
+ Subsequent: patx and paty hold the rotated 8x8 pattern to be
+ rendered.
+
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
+
+ SetupFor: patx and paty hold the x,y coordinates of the offscreen
+ memory location where the 8x8 pattern is stored. The
+ bits are stored linearly in memory at that location.
+
+ Subsequent: patx and paty hold the offset into the pattern.
+
+ Neither programmed bits or origin
+
+ SetupFor: patx and paty hold the x,y coordinates of the offscreen
+ memory location where the unrotated 8x8 pattern is
+ stored. This can be ignored.
+
+ Subsequent: patx and paty hold the x,y coordinates of the
+ rotated 8x8 pattern to be rendered.
+
+
+
+void SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
+ int fg, int bg, int rop, unsigned int planemask)
+
+ SetupForMono8x8PatternFill indicates that any combination of the
+ following may follow it.
+
+ SubsequentMono8x8PatternFillRect
+ SubsequentMono8x8PatternFillTrap
+
+ The fg, bg, rop and planemask fields have the same meaning as the
+ ones used for the other color expansion routines. Patx's and paty's
+ meaning can be determined from the table above.
+
+
+void SubsequentMono8x8PatternFillRect( ScrnInfoPtr pScrn,
+ int patx, int paty, int x, int y, int w, int h)
+
+ Fill a rectangle of dimensions "w" by "h" with origin at (x,y)
+ using the parameters give by the last SetupForMono8x8PatternFill
+ call. The meanings of patx and paty can be determined by the
+ table above.
+
+void SubsequentMono8x8PatternFillTrap( ScrnInfoPtr pScrn,
+ int patx, int paty, int y, int h,
+ int left, int dxL, int dyL, int eL,
+ int right, int dxR, int dyR, int eR )
+
+ The meanings of patx and paty can be determined by the table above.
+ The rest of the fields have the same meanings as those in the
+ SubsequentSolidFillTrap function.
+
+
+
+2.7 8x8 Color Pattern Fills
+
+ 8x8 color pattern data is 64 pixels of full color data that
+ is stored linearly in offscreen video memory. 8x8 color patterns
+ are useful as a substitute for 8x8 mono patterns when tiling,
+ doing opaque stipples, or in the case where transperency is
+ supported, regular stipples. 8x8 color pattern fills also have
+ the additional benefit of being able to tile full color 8x8
+ patterns instead of just 2 color ones like the mono patterns.
+ However, full color 8x8 patterns aren't used very often in the
+ X Window system so you might consider passing this primitive
+ by if you already can do mono patterns, especially if they
+ require alot of cache area. Color8x8PatternFillFlags is
+ the flags field for this primitive and the GXCOPY_ONLY,
+ ROP_NEEDS_SOURCE and NO_PLANEMASK flags as described in
+ Section 2.0 are valid as well as the following:
+
+
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN
+
+ If the hardware supports programmable pattern offsets then
+ this option should be set.
+
+ HARDWARE_PATTERN_SCREEN_ORIGIN
+
+ Some hardware wants the pattern offset specified with respect to the
+ upper left-hand corner of the primitive being drawn. Other hardware
+ needs the option HARDWARE_PATTERN_SCREEN_ORIGIN set to indicate that
+ all pattern offsets should be referenced to the upper left-hand
+ corner of the screen. HARDWARE_PATTERN_SCREEN_ORIGIN is preferable
+ since this is more natural for the X-Window system and offsets will
+ have to be recalculated for each Subsequent function otherwise.
+
+ NO_TRANSPARENCY
+ TRANSPARENCY_GXCOPY_ONLY
+
+ These mean the same as for the ScreenToScreenCopy functions.
+
+
+ The following table describes the meanings of patx and paty passed
+ to the SetupFor and Subsequent fields:
+
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN && HARDWARE_PATTERN_SCREEN_ORIGIN
+
+ SetupFor: patx and paty hold the x,y location of the unrotated
+ pattern.
+
+ Subsequent: patx and paty hold the pattern offset. For the case
+ of HARDWARE_PATTERN_SCREEN_ORIGIN all Subsequent calls
+ have the same offset so only the first call will need
+ to be observed.
+
+
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN only
+
+ SetupFor: patx and paty hold the x,y location of the unrotated
+ pattern.
+
+ Subsequent: patx and paty hold the pattern offset.
+
+ HARDWARE_PATTERN_SCREEN_ORIGIN
+
+ SetupFor: patx and paty hold the x,y location of the rotated pattern.
+
+ Subsequent: patx and paty hold the same location as the SetupFor
+ function so these can be ignored.
+
+ neither flag
+
+ SetupFor: patx and paty hold the x,y location of the unrotated
+ pattern. This can be ignored.
+
+ Subsequent: patx and paty hold the x,y location of the rotated
+ pattern.
+
+ Additional information about cached patterns...
+ All 8x8 color patterns are cached in offscreen video memory so
+ the pixmap cache must be enabled to use them. The first pattern
+ starts at the cache slot boundary which is set by the
+ CachePixelGranularity field used to configure the pixmap cache.
+ One should ensure that the CachePixelGranularity reflects any
+ alignment restrictions that the accelerator may put on 8x8 pattern
+ storage locations. When HARDWARE_PATTERN_PROGRAMMED_ORIGIN is set
+ there is only one pattern stored. When this flag is not set,
+ all 64 rotations off the pattern are accessible but it is assumed
+ that the accelerator is capable of accessing data stored on 8
+ pixel boundaries. If the accelerator has stricter alignment
+ requirements than this the dirver will need to provide its own
+ 8x8 color pattern caching routines.
+
+
+void SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
+ int rop, unsigned int planemask, int trans_color)
+
+ SetupForColor8x8PatternFill indicates that any combination of the
+ following may follow it.
+
+ SubsequentColor8x8PatternFillRect
+ SubsequentColor8x8PatternFillTrap (not implemented yet)
+
+ For the meanings of patx and paty, see the table above. Trans_color
+ means the same as for the ScreenToScreenCopy functions.
+
+
+
+void SubsequentColor8x8PatternFillRect( ScrnInfoPtr pScrn,
+ int patx, int paty, int x, int y, int w, int h)
+
+ Fill a rectangle of dimensions "w" by "h" with origin at (x,y)
+ using the parameters give by the last SetupForColor8x8PatternFill
+ call. The meanings of patx and paty can be determined by the
+ table above.
+
+void SubsequentColor8x8PatternFillTrap( ScrnInfoPtr pScrn,
+ int patx, int paty, int y, int h,
+ int left, int dxL, int dyL, int eL,
+ int right, int dxR, int dyR, int eR )
+
+ For the meanings of patx and paty, see the table above.
+ The rest of the fields have the same meanings as those in the
+ SubsequentSolidFillTrap function.
+
+
+
+2.8 Image Writes
+
+ XAA provides a mechanism for transfering full color pixel data from
+ system memory to video memory through the accelerator. This is
+ useful for dealing with alignment issues and performing raster ops
+ on the data when writing it to the framebuffer. As with color
+ expansion rectangles, there is a direct and indirect method. The
+ direct method sends all data through a memory mapped aperature.
+ The indirect method sends the data to an intermediated buffer scanline
+ at a time.
+
+ The direct and indirect methods have separate flags fields, the
+ ImageWriteFlags and ScanlineImageWriteFlags respectively.
+ Flags specific to one method or the other are described in sections
+ 2.8.1 and 2.8.2 but for both cases the GXCOPY_ONLY, ROP_NEEDS_SOURCE
+ and NO_PLANEMASK flags described in Section 2.0 are valid as well as
+ the following:
+
+ NO_GXCOPY
+
+ In order to have accelerated image transfers faster than the
+ software versions for GXcopy, the engine needs to support clipping,
+ be using the direct method and have a large enough image transfer
+ range so that CPU_TRANSFER_BASE_FIXED doesn't need to be set.
+ If these are not supported, then it is unlikely that transfering
+ the data through the accelerator will be of any advantage for the
+ simple case of GXcopy. In fact, it may be much slower. For such
+ cases it's probably best to set the NO_GXCOPY flag so that
+ Image writes will only be used for the more complicated rops.
+
+ /* transparency restrictions */
+
+ NO_TRANSPARENCY
+
+ This indicates that the accelerator does not support skipping
+ of color keyed pixels when copying from the source to the destination.
+
+ TRANSPARENCY_GXCOPY_ONLY
+
+ This indicates that the accelerator supports skipping of color keyed
+ pixels only when the rop is GXcopy.
+
+ /* clipping (optional) */
+
+ LEFT_EDGE_CLIPPING
+
+ This indicates that the accelerator supports omission of up to
+ 3 pixels on the left edge of the rectangle to be filled. This
+ is beneficial since it allows transfer from the source pixmap to
+ always occur from DWORD boundaries.
+
+ LEFT_EDGE_CLIPPING_NEGATIVE_X
+
+ This flag indicates that the accelerator can fill areas with
+ image write data even if the value of x origin is negative (off of
+ the screen on the left edge).
+
+
+2.8.1 The Direct Method
+
+ Using the direct method of ImageWrite XAA will send all
+ bitmap data to the accelerator serially through an memory mapped
+ transfer window defined by the following two fields:
+
+ unsigned char *ImageWriteBase
+
+ This indicates the memory address of the beginning of the aperture.
+
+ int ImageWriteRange
+
+ This indicates the size in bytes of the aperture.
+
+ The driver should specify how the transfered data should be padded.
+ There are options for both the padding of each Y scanline and for the
+ total transfer to the aperature.
+ One of the following two flags must be set:
+
+ CPU_TRANSFER_PAD_DWORD
+
+ This indicates that the total transfer (sum of all scanlines) sent
+ to the aperature must be DWORD padded. This is the default behavior.
+
+ CPU_TRANSFER_PAD_QWORD
+
+ This indicates that the total transfer (sum of all scanlines) sent
+ to the aperature must be QWORD padded. With this set, XAA will send
+ an extra DWORD to the aperature when needed to ensure that only
+ an even number of DWORDs are sent.
+
+ And then there are the flags for padding of each scanline:
+
+ SCANLINE_PAD_DWORD
+
+ This indicates that each Y scanline should be DWORD padded.
+ This is the only option available and is the default.
+
+ Finally, there is the CPU_TRANSFER_BASE_FIXED flag which indicates
+ that the aperture is a single register rather than a range of
+ registers, and XAA should write all of the data to the first DWORD.
+ XAA will automatically select CPU_TRANSFER_BASE_FIXED if the
+ ImageWriteRange is not large enough to accomodate an entire scanline.
+
+
+void SetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned int planemask,
+ int trans_color, int bpp, int depth)
+
+ If trans_color is not -1 then trans_color indicates the transparency
+ color key and pixels with color trans_color passed through the
+ aperature should not be transfered to the screen but should be
+ skipped. Bpp and depth indicate the bits per pixel and depth of
+ the source pixmap. Trans_color is always -1 if the NO_TRANSPARENCY
+ flag is set.
+
+
+void SubsequentImageWriteRect(ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft)
+
+
+ Data passed through the aperature should be copied to a rectangle
+ of width "w" and height "h" with origin (x,y). If LEFT_EDGE_CLIPPING
+ has been enabled, skipleft will correspond to the number of pixels
+ on the left edge that should not be drawn. Skipleft is zero
+ otherwise.
+
+ It can be arranged for XAA to call Sync() after it is through
+ calling the Subsequent functions by setting SYNC_AFTER_IMAGE_WRITE
+ in the ImageWriteFlags. This can provide the driver with an
+ oportunity to reset a clipping window if needed.
+
+2.8.2 The Indirect Method
+
+ Using the indirect method, XAA will render the pixel data scanline
+ at a time to one or more buffers. These buffers may be memory
+ mapped apertures or just intermediate storage.
+
+ int NumScanlineImageWriteBuffers
+
+ This indicates the number of buffers available.
+
+ unsigned char **ScanlineImageWriteBuffers
+
+ This is an array of pointers to the memory locations of each buffer.
+ Each buffer is expected to be large enough to accommodate scanlines
+ the width of the screen. That is:
+
+ pScrn->VirtualX * pScreen->bitsPerPixel/8 bytes or more.
+
+ If LEFT_EDGE_CLIPPING_NEGATIVE_X is set, add an additional 4
+ bytes to that requirement in 8 and 16bpp, 12 bytes in 24bpp.
+
+ Scanlines are always DWORD padded.
+
+void SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int trans_color,
+ int bpp, int depth)
+
+ If trans_color is not -1 then trans_color indicates the transparency
+ color key and pixels with color trans_color in the buffer should not
+ be transfered to the screen but should be skipped. Bpp and depth
+ indicate the bits per pixel and depth of the source bitmap.
+ Trans_color is always -1 if the NO_TRANSPARENCY flag is set.
+
+
+void SubsequentImageWriteRect(ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft)
+
+
+void SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno)
+
+
+ When SubsequentImageWriteRect is called, XAA will begin
+ transfering the source data scanline at a time, calling
+ SubsequentImageWriteScanline after each scanline. If more than
+ one buffer is available, XAA will cycle through the buffers.
+ Subsequent scanlines will use the next buffer and go back to the
+ buffer 0 again when the last buffer is reached. The index into
+ the ScanlineImageWriteBuffers array is presented as "bufno"
+ with each SubsequentImageWriteScanline call.
+
+ The skipleft field is the same as for the direct method.
+
+ The indirect method can be use to send the source data directly
+ to a memory mapped aperture represented by a single image write
+ buffer, scanline at a time, but more commonly it is used to place
+ the data into offscreen video memory so that the accelerator can
+ blit it to the visible screen from there. In the case where the
+ accelerator permits rendering into offscreen video memory while
+ the accelerator is active, several buffers can be used so that
+ XAA can be placing source data into the next buffer while the
+ accelerator is blitting the current buffer. For cases where
+ the accelerator requires some special manipulation of the source
+ data first, the buffers can be in system memory. The CPU can
+ manipulate these buffers and then send the data to the accelerator.
+
+
+2.9 Clipping
+
+ XAA supports hardware clipping rectangles. To use clipping
+ in this way it is expected that the graphics accelerator can
+ clip primitives with verticies anywhere in the 16 bit signed
+ coordinate system.
+
+void SetClippingRectangle ( ScrnInfoPtr pScrn,
+ int left, int top, int right, int bottom)
+
+void DisableClipping (ScrnInfoPtr pScrn)
+
+ When SetClippingRectangle is called, all hardware rendering
+ following it should be clipped to the rectangle specified
+ until DisableClipping is called.
+
+ The ClippingFlags field indicates which operations this sort
+ of Set/Disable pairing can be used with. Any of the following
+ flags may be OR'd together.
+
+ HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND
+ HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
+ HARDWARE_CLIP_MONO_8x8_FILL
+ HARDWARE_CLIP_COLOR_8x8_FILL
+ HARDWARE_CLIP_SOLID_FILL
+ HARDWARE_CLIP_DASHED_LINE
+ HARDWARE_CLIP_SOLID_LINE
+
+
+
+3) XAA PIXMAP CACHE
+
+ /* NOTE: XAA has no knowledge of framebuffer particulars so until
+ the framebuffer is able to render into offscreen memory, usage
+ of the pixmap cache requires that the driver provide ImageWrite
+ routines or a WritePixmap or WritePixmapToCache replacement so
+ that patterns can even be placed in the cache.
+
+ ADDENDUM: XAA can now load the pixmap cache without requiring
+ that the driver supply an ImageWrite function, but this can
+ only be done on linear framebuffers. If you have a linear
+ framebuffer, set LINEAR_FRAMEBUFFER in the XAAInfoRec.Flags
+ field and XAA will then be able to upload pixmaps into the
+ cache without the driver providing functions to do so.
+ */
+
+
+ The XAA pixmap cache provides a mechanism for caching of patterns
+ in offscreen video memory so that tiled fills and in some cases
+ stippling can be done by blitting the source patterns from offscreen
+ video memory. The pixmap cache also provides the mechanism for caching
+ of 8x8 color and mono hardware patterns. Any unused offscreen video
+ memory gets used for the pixmap cache and that information is
+ provided by the XFree86 Offscreen Memory Manager. XAA registers a
+ callback with the manager so that it can be informed of any changes
+ in the offscreen memory configuration. The driver writer does not
+ need to deal with any of this since it is all automatic. The driver
+ merely needs to initialize the Offscreen Memory Manager as described
+ in the DESIGN document and set the PIXMAP_CACHE flag in the
+ XAAInfoRec.Flags field. The Offscreen Memory Manager initialization
+ must occur before XAA is initialized or else pixmap cache
+ initialization will fail.
+
+ PixmapCacheFlags is an XAAInfoRec field which allows the driver to
+ control pixmap cache behavior to some extent. Currently only one
+ flag is defined:
+
+ DO_NOT_BLIT_STIPPLES
+
+ This indicates that the stippling should not be done by blitting
+ from the pixmap cache. This does not apply to 8x8 pattern fills.
+
+
+ CachePixelGranularity is an optional field. If the hardware requires
+ that a 8x8 patterns have some particular pixel alignment it should
+ be reflected in this field. Ignoring this field or setting it to
+ zero or one means there are no alignment issues.
+
+
+4) OFFSCREEN PIXMAPS
+
+ XAA has the ability to store pixmap drawables in offscreen video
+ memory and render into them with full hardware acceleration. Placement
+ of pixmaps in the cache is done automatically on a first-come basis and
+ only if there is room. To enable this feature, set the OFFSCREEN_PIXMAPS
+ flag in the XAAInfoRec.Flags field. This is only available when a
+ ScreenToScreenCopy function is provided, when the Offscreen memory
+ manager has been initialized and when the LINEAR_FRAMEBUFFER flag is
+ also set.
+
+ int maxOffPixWidth
+ int maxOffPixHeight
+
+ These two fields allow the driver to limit the maximum dimensions
+ of an offscreen pixmap. If one of these is not set, it is assumed
+ that there is no limit on that dimension. Note that if an offscreen
+ pixmap with a particular dimension is allowed, then your driver will be
+ expected to render primitives as large as that pixmap.
+
+$XFree86: xc/programs/Xserver/hw/xfree86/xaa/XAA.HOWTO,v 1.13 2001/05/22 18:51:09 mvojkovi Exp $
diff --git a/hw/xfree86/xaa/xaa.h b/hw/xfree86/xaa/xaa.h
new file mode 100644
index 000000000..f183f8f02
--- /dev/null
+++ b/hw/xfree86/xaa/xaa.h
@@ -0,0 +1,1362 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaa.h,v 1.39 2002/10/30 12:52:43 alanh Exp $ */
+
+#ifndef _XAA_H
+#define _XAA_H
+
+/*
+
+ ******** OPERATION SPECIFIC FLAGS *********
+
+ **** solid/dashed line flags ****
+
+--------- --------
+23 LINE_PATTERN_LSBFIRST_MSBJUSTIFIED
+22 LINE_PATTERN_LSBFIRST_LSBJUSTIFIED
+21 LINE_PATTERN_MSBFIRST_MSBJUSTIFIED
+20 LINE_PATTERN_MSBFIRST_LSBJUSTIFIED
+19 LINE_PATTERN_POWER_OF_2_ONLY
+18 LINE_LIMIT_COORDS
+17 .
+16 .
+--------- -------
+
+ **** screen to screen copy flags ****
+
+--------- --------
+23 ONLY_LEFT_TO_RIGHT_BITBLT
+22 ONLY_TWO_BITBLT_DIRECTIONS
+21 .
+20 .
+19 .
+18 .
+17 .
+16 .
+--------- -------
+
+ **** clipping flags ****
+
+--------- --------
+23 .
+22 HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND
+21 HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY
+20 HARDWARE_CLIP_MONO_8x8_FILL
+19 HARDWARE_CLIP_COLOR_8x8_FILL
+18 HARDWARE_CLIP_SOLID_FILL
+17 HARDWARE_CLIP_DASHED_LINE
+16 HARDWARE_CLIP_SOLID_LINE
+--------- -------
+
+
+ **** hardware pattern flags ****
+
+--------- --------
+23 .
+22 .
+21 HARDWARE_PATTERN_SCREEN_ORIGIN
+20 .
+19 .
+18 .
+17 HARDWARE_PATTERN_PROGRAMMED_ORIGIN
+16 HARDWARE_PATTERN_PROGRAMMED_BITS
+--------- -------
+
+ **** write pixmap flags ****
+
+--------- --------
+23 .
+22 .
+21 .
+20 .
+19 .
+18 .
+17 .
+16 CONVERT_32BPP_TO_24BPP
+--------- -------
+
+
+ ******** GENERIC FLAGS *********
+
+--------- -------
+15 SYNC_AFTER_COLOR_EXPAND
+14 CPU_TRANSFER_PAD_QWORD
+13 .
+12 LEFT_EDGE_CLIPPING_NEGATIVE_X
+11 LEFT_EDGE_CLIPPING
+10 CPU_TRANSFER_BASE_FIXED
+ 9 BIT_ORDER_IN_BYTE_MSBFIRST
+ 8 TRANSPARENCY_GXCOPY_ONLY
+--------- -------
+ 7 NO_TRANSPARENCY
+ 6 TRANSPARENCY_ONLY
+ 5 ROP_NEEDS_SOURCE
+ 4 TRIPLE_BITS_24BPP
+ 3 RGB_EQUAL
+ 2 NO_PLANEMASK
+ 1 NO_GXCOPY
+ 0 GXCOPY_ONLY
+--------- -------
+
+
+*/
+
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "xf86str.h"
+#include "regionstr.h"
+#include "xf86fbman.h"
+
+#ifdef RENDER
+#include "picturestr.h"
+#endif
+
+/* Flags */
+#define PIXMAP_CACHE 0x00000001
+#define MICROSOFT_ZERO_LINE_BIAS 0x00000002
+#define OFFSCREEN_PIXMAPS 0x00000004
+#define LINEAR_FRAMEBUFFER 0x00000008
+
+
+/* GC fg, bg, and planemask restrictions */
+#define GXCOPY_ONLY 0x00000001
+#define NO_GXCOPY 0x00000002
+#define NO_PLANEMASK 0x00000004
+#define RGB_EQUAL 0x00000008
+#define TRIPLE_BITS_24BPP 0x00000010
+#define ROP_NEEDS_SOURCE 0x00000020
+
+/* transparency restrictions */
+#define TRANSPARENCY_ONLY 0x00000040
+#define NO_TRANSPARENCY 0x00000080
+#define TRANSPARENCY_GXCOPY_ONLY 0x00000100
+
+/* bit order restrictions */
+#define BIT_ORDER_IN_BYTE_MSBFIRST 0x00000200
+#define BIT_ORDER_IN_BYTE_LSBFIRST 0x00000000
+
+/* transfer base restriction */
+#define CPU_TRANSFER_BASE_FIXED 0x00000400
+
+/* skipleft restrictions */
+#define LEFT_EDGE_CLIPPING 0x00000800
+#define LEFT_EDGE_CLIPPING_NEGATIVE_X 0x00001000
+
+/* data padding */
+#define CPU_TRANSFER_PAD_DWORD 0x00000000
+#define CPU_TRANSFER_PAD_QWORD 0x00004000
+#define SCANLINE_PAD_DWORD 0x00000000
+
+#define SYNC_AFTER_COLOR_EXPAND 0x00008000
+#define SYNC_AFTER_IMAGE_WRITE SYNC_AFTER_COLOR_EXPAND
+
+/* hardware pattern */
+#define HARDWARE_PATTERN_PROGRAMMED_BITS 0x00010000
+#define HARDWARE_PATTERN_PROGRAMMED_ORIGIN 0x00020000
+#define HARDWARE_PATTERN_SCREEN_ORIGIN 0x00200000
+
+/* copyarea flags */
+#define ONLY_TWO_BITBLT_DIRECTIONS 0x00400000
+#define ONLY_LEFT_TO_RIGHT_BITBLT 0x00800000
+
+/* line flags */
+#define LINE_PATTERN_LSBFIRST_MSBJUSTIFIED 0x00800000
+#define LINE_PATTERN_LSBFIRST_LSBJUSTIFIED 0x00400000
+#define LINE_PATTERN_MSBFIRST_MSBJUSTIFIED 0x00200000
+#define LINE_PATTERN_MSBFIRST_LSBJUSTIFIED 0x00100000
+#define LINE_PATTERN_POWER_OF_2_ONLY 0x00080000
+#define LINE_LIMIT_COORDS 0x00040000
+
+/* clipping flags */
+#define HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND 0x00400000
+#define HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY 0x00200000
+#define HARDWARE_CLIP_MONO_8x8_FILL 0x00100000
+#define HARDWARE_CLIP_COLOR_8x8_FILL 0x00080000
+#define HARDWARE_CLIP_SOLID_FILL 0x00040000
+#define HARDWARE_CLIP_DASHED_LINE 0x00020000
+#define HARDWARE_CLIP_SOLID_LINE 0x00010000
+
+#define HARDWARE_CLIP_LINE 0x00000000
+
+
+/* image write flags */
+#define CONVERT_32BPP_TO_24BPP 0x00010000
+
+/* pixmap cache flags */
+#define CACHE_MONO_8x8 0x00000001
+#define CACHE_COLOR_8x8 0x00000002
+#define DO_NOT_BLIT_STIPPLES 0x00000004
+#define DO_NOT_TILE_MONO_DATA 0x00000008
+#define DO_NOT_TILE_COLOR_DATA 0x00000010
+
+
+#define DEGREES_0 0
+#define DEGREES_90 1
+#define DEGREES_180 2
+#define DEGREES_270 3
+
+#define OMIT_LAST 1
+
+/* render flags */
+
+#define XAA_RENDER_POWER_OF_2_TILE_ONLY 0x00000008
+#define XAA_RENDER_NO_SRC_ALPHA 0x00000004
+#define XAA_RENDER_IMPRECISE_ONLY 0x00000002
+#define XAA_RENDER_NO_TILE 0x00000001
+
+#define XAA_RENDER_REPEAT 0x00000001
+
+typedef void (* ValidateGCProcPtr)(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+typedef struct {
+ unsigned char *bits;
+ int width;
+ int height;
+ int yoff;
+ int srcwidth;
+ int start;
+ int end;
+} NonTEGlyphInfo, *NonTEGlyphPtr;
+
+
+typedef struct {
+ int x;
+ int y;
+ int w;
+ int h;
+ int orig_w;
+ int orig_h;
+ unsigned long serialNumber;
+ int pat0;
+ int pat1;
+ int fg;
+ int bg;
+ int trans_color;
+ DDXPointPtr offsets;
+ DevUnion devPrivate;
+} XAACacheInfoRec, *XAACacheInfoPtr;
+
+
+typedef struct _PixmapLink {
+ PixmapPtr pPix;
+ struct _PixmapLink *next;
+ FBAreaPtr area;
+} PixmapLink, *PixmapLinkPtr;
+
+typedef struct _XAAInfoRec {
+ ScrnInfoPtr pScrn;
+ int Flags;
+
+ void (*Sync)(
+ ScrnInfoPtr pScrn
+ );
+
+ /* Restore Accel State is a driver callback that is used
+ * when another screen on the same device has been active.
+ * This allows multihead on a single device to work.
+ * If The entityProp has IS_SHARED_ACCEL defined then this
+ * function is required.
+ */
+
+ void (*RestoreAccelState)(
+ ScrnInfoPtr pScrn
+ );
+
+ /***************** Low Level *****************/
+
+/* Blits */
+ void (*SetupForScreenToScreenCopy)(
+ ScrnInfoPtr pScrn,
+ int xdir, int ydir,
+ int rop,
+ unsigned int planemask,
+ int trans_color
+ );
+ int ScreenToScreenCopyFlags;
+
+ void (*SubsequentScreenToScreenCopy)(
+ ScrnInfoPtr pScrn,
+ int xsrc, int ysrc,
+ int xdst, int ydst,
+ int w, int h
+ );
+
+
+/* Solid fills */
+ void (*SetupForSolidFill)(
+ ScrnInfoPtr pScrn,
+ int color,
+ int rop,
+ unsigned int planemask
+ );
+ int SolidFillFlags;
+
+ void (*SubsequentSolidFillRect)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h
+ );
+
+ void (*SubsequentSolidFillTrap)(
+ ScrnInfoPtr pScrn,
+ int y, int h,
+ int left, int dxL, int dyL, int eL,
+ int right, int dxR, int dyR, int eR
+ );
+
+
+/* Solid lines */
+
+ void (*SetupForSolidLine)(
+ ScrnInfoPtr pScrn,
+ int color,
+ int rop,
+ unsigned int planemask
+ );
+ int SolidLineFlags;
+
+ void (*SubsequentSolidTwoPointLine)(
+ ScrnInfoPtr pScrn,
+ int xa, int ya, int xb, int yb, int flags
+ );
+
+ void (*SubsequentSolidBresenhamLine)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int absmaj, int absmin, int err, int len, int octant
+ );
+ int SolidBresenhamLineErrorTermBits;
+
+ void (*SubsequentSolidHorVertLine)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int len, int dir
+ );
+
+/* Dashed lines */
+
+ void (*SetupForDashedLine)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask,
+ int length,
+ unsigned char *pattern
+ );
+ int DashedLineFlags;
+ int DashPatternMaxLength;
+
+ void (*SubsequentDashedTwoPointLine)(
+ ScrnInfoPtr pScrn,
+ int xa, int ya, int xb, int yb, int flags, int phase
+ );
+
+ void (*SubsequentDashedBresenhamLine)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int absmaj, int absmin, int err, int len, int flags,
+ int phase
+ );
+ int DashedBresenhamLineErrorTermBits;
+
+/* Clipper */
+
+ void (*SetClippingRectangle) (
+ ScrnInfoPtr pScrn,
+ int left, int top, int right, int bottom
+ );
+ int ClippingFlags;
+
+ void (*DisableClipping)(ScrnInfoPtr pScrn);
+
+/* 8x8 mono pattern fills */
+ void (*SetupForMono8x8PatternFill)(
+ ScrnInfoPtr pScrn,
+ int patx, int paty,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+ );
+ int Mono8x8PatternFillFlags;
+
+ void (*SubsequentMono8x8PatternFillRect)(
+ ScrnInfoPtr pScrn,
+ int patx, int paty,
+ int x, int y, int w, int h
+ );
+
+ void (*SubsequentMono8x8PatternFillTrap)(
+ ScrnInfoPtr pScrn,
+ int patx, int paty,
+ int y, int h,
+ int left, int dxL, int dyL, int eL,
+ int right, int dxR, int dyR, int eR
+ );
+
+/* 8x8 color pattern fills */
+
+ void (*SetupForColor8x8PatternFill)(
+ ScrnInfoPtr pScrn,
+ int patx, int paty,
+ int rop,
+ unsigned int planemask,
+ int transparency_color
+ );
+ int Color8x8PatternFillFlags;
+
+ void (*SubsequentColor8x8PatternFillRect)(
+ ScrnInfoPtr pScrn,
+ int patx, int paty,
+ int x, int y, int w, int h
+ );
+
+ void (*SubsequentColor8x8PatternFillTrap)(
+ ScrnInfoPtr pScrn,
+ int patx, int paty,
+ int y, int h,
+ int left, int dxL, int dyL, int eL,
+ int right, int dxR, int dyR, int eR
+ );
+
+
+/* Color expansion */
+
+ void (*SetupForCPUToScreenColorExpandFill)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+ );
+ int CPUToScreenColorExpandFillFlags;
+
+ void (*SubsequentCPUToScreenColorExpandFill)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft
+ );
+
+ unsigned char *ColorExpandBase;
+ int ColorExpandRange;
+
+
+/* Scanline color expansion */
+
+ void (*SetupForScanlineCPUToScreenColorExpandFill)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+ );
+ int ScanlineCPUToScreenColorExpandFillFlags;
+
+ void (*SubsequentScanlineCPUToScreenColorExpandFill)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft
+ );
+
+ void (*SubsequentColorExpandScanline)(
+ ScrnInfoPtr pScrn,
+ int bufno
+ );
+
+ int NumScanlineColorExpandBuffers;
+ unsigned char **ScanlineColorExpandBuffers;
+
+/* Screen to screen color expansion */
+
+ void (*SetupForScreenToScreenColorExpandFill) (
+ ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+ );
+ int ScreenToScreenColorExpandFillFlags;
+
+ void (*SubsequentScreenToScreenColorExpandFill)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int srcx, int srcy, int skipleft
+ );
+
+
+/* Image transfers */
+
+ void (*SetupForImageWrite)(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int transparency_color,
+ int bpp, int depth
+ );
+ int ImageWriteFlags;
+
+ void (*SubsequentImageWriteRect)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft
+ );
+ unsigned char *ImageWriteBase;
+ int ImageWriteRange;
+
+/* Scanline Image transfers */
+
+ void (*SetupForScanlineImageWrite)(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int transparency_color,
+ int bpp, int depth
+ );
+ int ScanlineImageWriteFlags;
+
+ void (*SubsequentScanlineImageWriteRect)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int skipleft
+ );
+
+ void (*SubsequentImageWriteScanline) (
+ ScrnInfoPtr pScrn,
+ int bufno
+ );
+
+ int NumScanlineImageWriteBuffers;
+ unsigned char **ScanlineImageWriteBuffers;
+
+ /* Image Reads - OBSOLETE AND NOT USED */
+
+ void (*SetupForImageRead) (
+ ScrnInfoPtr pScrn,
+ int bpp, int depth
+ );
+ int ImageReadFlags;
+
+ unsigned char *ImageReadBase;
+ int ImageReadRange;
+
+ void (*SubsequentImageReadRect)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h
+ );
+
+
+ /***************** Mid Level *****************/
+ void (*ScreenToScreenBitBlt)(
+ ScrnInfoPtr pScrn,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir, int ydir,
+ int alu,
+ unsigned int planmask
+ );
+ int ScreenToScreenBitBltFlags;
+
+ void (*WriteBitmap) (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+ );
+ int WriteBitmapFlags;
+
+ void (*FillSolidRects)(
+ ScrnInfoPtr pScrn,
+ int fg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox
+ );
+ int FillSolidRectsFlags;
+
+ void (*FillMono8x8PatternRects)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int pat0, int pat1,
+ int xorg, int yorg
+ );
+ int FillMono8x8PatternRectsFlags;
+
+ void (*FillColor8x8PatternRects)(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+ );
+ int FillColor8x8PatternRectsFlags;
+
+ void (*FillCacheBltRects)(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+ );
+ int FillCacheBltRectsFlags;
+
+ void (*FillColorExpandRects)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+ );
+ int FillColorExpandRectsFlags;
+
+ void (*FillCacheExpandRects)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+ );
+ int FillCacheExpandRectsFlags;
+
+ void (*FillImageWriteRects)(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+ );
+ int FillImageWriteRectsFlags;
+
+
+ void (*FillSolidSpans)(
+ ScrnInfoPtr pScrn,
+ int fg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr points,
+ int *widths,
+ int fSorted
+ );
+ int FillSolidSpansFlags;
+
+ void (*FillMono8x8PatternSpans)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr points,
+ int *widths,
+ int fSorted,
+ int pat0, int pat1,
+ int xorg, int yorg
+ );
+ int FillMono8x8PatternSpansFlags;
+
+ void (*FillColor8x8PatternSpans)(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr points,
+ int *widths,
+ int fSorted,
+ XAACacheInfoPtr pCache,
+ int xorg, int yorg
+ );
+ int FillColor8x8PatternSpansFlags;
+
+ void (*FillCacheBltSpans)(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr points,
+ int *widths,
+ int fSorted,
+ XAACacheInfoPtr pCache,
+ int xorg, int yorg
+ );
+ int FillCacheBltSpansFlags;
+
+ void (*FillColorExpandSpans)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr points,
+ int *widths,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+ );
+ int FillColorExpandSpansFlags;
+
+ void (*FillCacheExpandSpans)(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+ );
+ int FillCacheExpandSpansFlags;
+
+ void (*TEGlyphRenderer)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+ );
+ int TEGlyphRendererFlags;
+
+ void (*NonTEGlyphRenderer)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int n,
+ NonTEGlyphPtr glyphs,
+ BoxPtr pbox,
+ int fg, int rop,
+ unsigned int planemask
+ );
+ int NonTEGlyphRendererFlags;
+
+ void (*WritePixmap) (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int rop,
+ unsigned int planemask,
+ int transparency_color,
+ int bpp, int depth
+ );
+ int WritePixmapFlags;
+
+ void (*ReadPixmap) (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *dst,
+ int dstwidth,
+ int bpp, int depth
+ );
+ int ReadPixmapFlags;
+
+ /***************** GC Level *****************/
+ RegionPtr (*CopyArea)(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+ );
+ int CopyAreaFlags;
+
+ RegionPtr (*CopyPlane)(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+ );
+ int CopyPlaneFlags;
+
+ void (*PushPixelsSolid) (
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDrawable,
+ int dx, int dy,
+ int xOrg, int yOrg
+ );
+ int PushPixelsFlags;
+
+ /** PolyFillRect **/
+
+ void (*PolyFillRectSolid)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+ );
+ int PolyFillRectSolidFlags;
+
+ void (*PolyFillRectStippled)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+ );
+ int PolyFillRectStippledFlags;
+
+ void (*PolyFillRectOpaqueStippled)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+ );
+ int PolyFillRectOpaqueStippledFlags;
+
+ void (*PolyFillRectTiled)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+ );
+ int PolyFillRectTiledFlags;
+
+ /** FillSpans **/
+
+ void (*FillSpansSolid)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nInit,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted
+ );
+ int FillSpansSolidFlags;
+
+ void (*FillSpansStippled)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nInit,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted
+ );
+ int FillSpansStippledFlags;
+
+ void (*FillSpansOpaqueStippled)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nInit,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted
+ );
+ int FillSpansOpaqueStippledFlags;
+
+ void (*FillSpansTiled)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nInit,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted
+ );
+ int FillSpansTiledFlags;
+
+ int (*PolyText8TE) (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+ );
+ int PolyText8TEFlags;
+
+ int (*PolyText16TE) (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+ );
+ int PolyText16TEFlags;
+
+ void (*ImageText8TE) (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+ );
+ int ImageText8TEFlags;
+
+ void (*ImageText16TE) (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+ );
+ int ImageText16TEFlags;
+
+ void (*ImageGlyphBltTE) (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+ );
+ int ImageGlyphBltTEFlags;
+
+ void (*PolyGlyphBltTE) (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+ );
+ int PolyGlyphBltTEFlags;
+
+ int (*PolyText8NonTE) (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+ );
+ int PolyText8NonTEFlags;
+
+ int (*PolyText16NonTE) (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+ );
+ int PolyText16NonTEFlags;
+
+ void (*ImageText8NonTE) (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+ );
+ int ImageText8NonTEFlags;
+
+ void (*ImageText16NonTE) (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+ );
+ int ImageText16NonTEFlags;
+
+ void (*ImageGlyphBltNonTE) (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+ );
+ int ImageGlyphBltNonTEFlags;
+
+ void (*PolyGlyphBltNonTE) (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+ );
+ int PolyGlyphBltNonTEFlags;
+
+ void (*PolyRectangleThinSolid)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+ );
+ int PolyRectangleThinSolidFlags;
+
+ void (*PolylinesWideSolid)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts
+ );
+ int PolylinesWideSolidFlags;
+
+ void (*PolylinesThinSolid)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts
+ );
+ int PolylinesThinSolidFlags;
+
+ void (*PolySegmentThinSolid)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+ );
+ int PolySegmentThinSolidFlags;
+
+ void (*PolylinesThinDashed)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts
+ );
+ int PolylinesThinDashedFlags;
+
+ void (*PolySegmentThinDashed)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+ );
+ int PolySegmentThinDashedFlags;
+
+ void (*FillPolygonSolid)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+ );
+ int FillPolygonSolidFlags;
+
+ void (*FillPolygonStippled)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+ );
+ int FillPolygonStippledFlags;
+
+ void (*FillPolygonOpaqueStippled)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+ );
+ int FillPolygonOpaqueStippledFlags;
+
+ void (*FillPolygonTiled)(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+ );
+ int FillPolygonTiledFlags;
+
+ void (*PolyFillArcSolid)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+ );
+ int PolyFillArcSolidFlags;
+
+ void (*PutImage)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x,
+ int y,
+ int w,
+ int h,
+ int leftPad,
+ int format,
+ char *pImage
+ );
+ int PutImageFlags;
+
+ /* Validation masks */
+
+ unsigned long FillSpansMask;
+ ValidateGCProcPtr ValidateFillSpans;
+ unsigned long SetSpansMask;
+ ValidateGCProcPtr ValidateSetSpans;
+ unsigned long PutImageMask;
+ ValidateGCProcPtr ValidatePutImage;
+ unsigned long CopyAreaMask;
+ ValidateGCProcPtr ValidateCopyArea;
+ unsigned long CopyPlaneMask;
+ ValidateGCProcPtr ValidateCopyPlane;
+ unsigned long PolyPointMask;
+ ValidateGCProcPtr ValidatePolyPoint;
+ unsigned long PolylinesMask;
+ ValidateGCProcPtr ValidatePolylines;
+ unsigned long PolySegmentMask;
+ ValidateGCProcPtr ValidatePolySegment;
+ unsigned long PolyRectangleMask;
+ ValidateGCProcPtr ValidatePolyRectangle;
+ unsigned long PolyArcMask;
+ ValidateGCProcPtr ValidatePolyArc;
+ unsigned long FillPolygonMask;
+ ValidateGCProcPtr ValidateFillPolygon;
+ unsigned long PolyFillRectMask;
+ ValidateGCProcPtr ValidatePolyFillRect;
+ unsigned long PolyFillArcMask;
+ ValidateGCProcPtr ValidatePolyFillArc;
+ unsigned long PolyText8Mask;
+ ValidateGCProcPtr ValidatePolyText8;
+ unsigned long PolyText16Mask;
+ ValidateGCProcPtr ValidatePolyText16;
+ unsigned long ImageText8Mask;
+ ValidateGCProcPtr ValidateImageText8;
+ unsigned long ImageText16Mask;
+ ValidateGCProcPtr ValidateImageText16;
+ unsigned long PolyGlyphBltMask;
+ ValidateGCProcPtr ValidatePolyGlyphBlt;
+ unsigned long ImageGlyphBltMask;
+ ValidateGCProcPtr ValidateImageGlyphBlt;
+ unsigned long PushPixelsMask;
+ ValidateGCProcPtr ValidatePushPixels;
+
+ void (*ComputeDash)(GCPtr pGC);
+
+ /* Pixmap Cache */
+
+ int PixmapCacheFlags;
+ Bool UsingPixmapCache;
+ Bool CanDoMono8x8;
+ Bool CanDoColor8x8;
+
+ void (*InitPixmapCache)(
+ ScreenPtr pScreen,
+ RegionPtr areas,
+ pointer data
+ );
+ void (*ClosePixmapCache)(
+ ScreenPtr pScreen
+ );
+
+ int (*StippledFillChooser)(GCPtr pGC);
+ int (*OpaqueStippledFillChooser)(GCPtr pGC);
+ int (*TiledFillChooser)(GCPtr pGC);
+
+ int CachePixelGranularity;
+ int MaxCacheableTileWidth;
+ int MaxCacheableTileHeight;
+ int MaxCacheableStippleWidth;
+ int MaxCacheableStippleHeight;
+
+ XAACacheInfoPtr (*CacheTile)(
+ ScrnInfoPtr Scrn, PixmapPtr pPix
+ );
+ XAACacheInfoPtr (*CacheStipple)(
+ ScrnInfoPtr Scrn, PixmapPtr pPix,
+ int fg, int bg
+ );
+ XAACacheInfoPtr (*CacheMonoStipple)(
+ ScrnInfoPtr Scrn, PixmapPtr pPix
+ );
+ XAACacheInfoPtr (*CacheMono8x8Pattern)(
+ ScrnInfoPtr Scrn, int pat0, int pat1
+ );
+ XAACacheInfoPtr (*CacheColor8x8Pattern)(
+ ScrnInfoPtr Scrn, PixmapPtr pPix,
+ int fg, int bg
+ );
+
+
+ int MonoPatternPitch;
+ int CacheWidthMono8x8Pattern;
+ int CacheHeightMono8x8Pattern;
+
+ int ColorPatternPitch;
+ int CacheWidthColor8x8Pattern;
+ int CacheHeightColor8x8Pattern;
+
+ int CacheColorExpandDensity;
+
+ void (*WriteBitmapToCache) (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int fg, int bg
+ );
+ void (*WritePixmapToCache) (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int bpp, int depth
+ );
+ void (*WriteMono8x8PatternToCache)(
+ ScrnInfoPtr pScrn,
+ XAACacheInfoPtr pCache
+ );
+ void (*WriteColor8x8PatternToCache)(
+ ScrnInfoPtr pScrn,
+ PixmapPtr pPix,
+ XAACacheInfoPtr pCache
+ );
+
+ char* PixmapCachePrivate;
+
+ /* Miscellaneous */
+
+ GC ScratchGC;
+ int PreAllocSize;
+ unsigned char *PreAllocMem;
+
+ CharInfoPtr CharInfo[255];
+ NonTEGlyphInfo GlyphInfo[255];
+
+ unsigned int FullPlanemask; /* deprecated */
+
+ PixmapLinkPtr OffscreenPixmaps;
+ int maxOffPixWidth;
+ int maxOffPixHeight;
+
+ XAACacheInfoRec ScratchCacheInfoRec;
+
+ BoxPtr ClipBox;
+
+ Bool NeedToSync;
+
+ char *dgaSaves;
+
+ /* These can be supplied to override the defaults */
+
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ CopyWindowProcPtr CopyWindow;
+ BackingStoreSaveAreasProcPtr SaveAreas;
+ BackingStoreRestoreAreasProcPtr RestoreAreas;
+
+ unsigned int offscreenDepths;
+ Bool offscreenDepthsInitialized;
+
+ CARD32 FullPlanemasks[32];
+
+#ifdef RENDER
+ Bool (*Composite) (
+ CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height
+ );
+
+ Bool (*Glyphs) (
+ CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs
+ );
+
+ Bool (*SetupForCPUToScreenAlphaTexture) (
+ ScrnInfoPtr pScrn,
+ int op,
+ CARD16 red,
+ CARD16 green,
+ CARD16 blue,
+ CARD16 alpha,
+ int alphaType,
+ CARD8 *alphaPtr,
+ int alphaPitch,
+ int width,
+ int height,
+ int flags
+ );
+ void (*SubsequentCPUToScreenAlphaTexture) (
+ ScrnInfoPtr pScrn,
+ int dstx,
+ int dsty,
+ int srcx,
+ int srcy,
+ int width,
+ int height
+ );
+ int CPUToScreenAlphaTextureFlags;
+ CARD32 * CPUToScreenAlphaTextureFormats;
+
+ Bool (*SetupForCPUToScreenTexture) (
+ ScrnInfoPtr pScrn,
+ int op,
+ int texType,
+ CARD8 *texPtr,
+ int texPitch,
+ int width,
+ int height,
+ int flags
+ );
+ void (*SubsequentCPUToScreenTexture) (
+ ScrnInfoPtr pScrn,
+ int dstx,
+ int dsty,
+ int srcx,
+ int srcy,
+ int width,
+ int height
+ );
+ int CPUToScreenTextureFlags;
+ CARD32 * CPUToScreenTextureFormats;
+
+
+#endif
+
+ /* these were added for 4.3.0 */
+ BoxRec SolidLineLimits;
+ BoxRec DashedLineLimits;
+
+} XAAInfoRec, *XAAInfoRecPtr;
+
+#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE
+
+
+Bool
+XAAInit(
+ ScreenPtr pScreen,
+ XAAInfoRecPtr infoRec
+);
+
+XAAInfoRecPtr XAACreateInfoRec(void);
+
+void
+XAADestroyInfoRec(
+ XAAInfoRecPtr infoRec
+);
+
+typedef void (*DepthChangeFuncPtr) (ScrnInfoPtr pScrn, int depth);
+
+Bool
+XAAInitDualFramebufferOverlay(
+ ScreenPtr pScreen,
+ DepthChangeFuncPtr callback
+);
+
+#endif /* _XAA_H */
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c
new file mode 100644
index 000000000..015b539e5
--- /dev/null
+++ b/hw/xfree86/xaa/xaaBitBlt.c
@@ -0,0 +1,219 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitBlt.c,v 1.3 1998/12/06 06:08:39 dawes Exp $ */
+
+/*
+ This is a lighter version of cfbBitBlt. We calculate the boxes
+ when accelerating pixmap->screen and screen->screen copies.
+ We also pass the GC to the doBitBlt function so that it has access
+ to the fg and bg so CopyPlane can use this.
+*/
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "mi.h"
+#include "pixmapstr.h"
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "xaalocal.h"
+
+
+RegionPtr
+XAABitBlt(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ void (*doBitBlt)(DrawablePtr, DrawablePtr, GCPtr, RegionPtr, DDXPointPtr),
+ unsigned long bitPlane )
+{
+
+ RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
+ RegionPtr prgnExposed;
+ Bool freeSrcClip = FALSE;
+ RegionRec rgnDst;
+ DDXPointPtr pptSrc, ppt;
+ DDXPointRec origDest;
+ BoxPtr pbox;
+ BoxRec fastBox;
+ int i, dx, dy, numRects;
+ xRectangle origSource;
+ int fastClip = 0; /* for fast clipping with pixmap source */
+ int fastExpose = 0; /* for fast exposures with pixmap source */
+
+ origSource.x = srcx;
+ origSource.y = srcy;
+ origSource.width = width;
+ origSource.height = height;
+ origDest.x = dstx;
+ origDest.y = dsty;
+
+ if((pSrcDrawable != pDstDrawable) &&
+ pSrcDrawable->pScreen->SourceValidate) {
+ (*pSrcDrawable->pScreen->SourceValidate) (
+ pSrcDrawable, srcx, srcy, width, height);
+ }
+
+ srcx += pSrcDrawable->x;
+ srcy += pSrcDrawable->y;
+
+ /* clip the source */
+ if (pSrcDrawable->type == DRAWABLE_PIXMAP) {
+ if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE))
+ prgnSrcClip = pGC->pCompositeClip;
+ else
+ fastClip = 1;
+ } else { /* Window */
+ if (pGC->subWindowMode == IncludeInferiors) {
+ if (!((WindowPtr) pSrcDrawable)->parent) {
+ /*
+ * special case bitblt from root window in
+ * IncludeInferiors mode; just like from a pixmap
+ */
+ fastClip = 1;
+ } else if ((pSrcDrawable == pDstDrawable) &&
+ (pGC->clientClipType == CT_NONE)) {
+ prgnSrcClip = pGC->pCompositeClip;
+ } else {
+ prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
+ freeSrcClip = TRUE;
+ }
+ } else {
+ prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
+ }
+ }
+
+ fastBox.x1 = srcx;
+ fastBox.y1 = srcy;
+ fastBox.x2 = srcx + width;
+ fastBox.y2 = srcy + height;
+
+ /* Don't create a source region if we are doing a fast clip */
+ if (fastClip) {
+ fastExpose = 1;
+ /*
+ * clip the source; if regions extend beyond the source size,
+ * make sure exposure events get sent
+ */
+ if (fastBox.x1 < pSrcDrawable->x) {
+ fastBox.x1 = pSrcDrawable->x;
+ fastExpose = 0;
+ }
+ if (fastBox.y1 < pSrcDrawable->y) {
+ fastBox.y1 = pSrcDrawable->y;
+ fastExpose = 0;
+ }
+ if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) {
+ fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
+ fastExpose = 0;
+ }
+ if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) {
+ fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
+ fastExpose = 0;
+ }
+ } else {
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
+ REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
+ }
+
+ dstx += pDstDrawable->x;
+ dsty += pDstDrawable->y;
+
+ if (pDstDrawable->type == DRAWABLE_WINDOW) {
+ if (!((WindowPtr)pDstDrawable)->realized) {
+ if (!fastClip)
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return NULL;
+ }
+ }
+
+ dx = srcx - dstx;
+ dy = srcy - dsty;
+
+ /* Translate and clip the dst to the destination composite clip */
+ if (fastClip) {
+ RegionPtr cclip;
+
+ /* Translate the region directly */
+ fastBox.x1 -= dx;
+ fastBox.x2 -= dx;
+ fastBox.y1 -= dy;
+ fastBox.y2 -= dy;
+
+ /* If the destination composite clip is one rectangle we can
+ do the clip directly. Otherwise we have to create a full
+ blown region and call intersect */
+
+ cclip = pGC->pCompositeClip;
+ if (REGION_NUM_RECTS(cclip) == 1) {
+ BoxPtr pBox = REGION_RECTS(cclip);
+
+ if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
+ if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
+ if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
+ if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
+
+ /* Check to see if the region is empty */
+ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
+ REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0);
+ } else {
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
+ }
+ } else {
+ /* We must turn off fastClip now, since we must create
+ a full blown region. It is intersected with the
+ composite clip below. */
+ fastClip = 0;
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox,1);
+ }
+ } else {
+ REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
+ }
+
+ if (!fastClip) {
+ REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
+ pGC->pCompositeClip);
+ }
+
+ /* Do bit blitting */
+ numRects = REGION_NUM_RECTS(&rgnDst);
+ if (numRects && width && height) {
+ if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
+ sizeof(DDXPointRec)))) {
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return NULL;
+ }
+ pbox = REGION_RECTS(&rgnDst);
+ ppt = pptSrc;
+ for (i = numRects; --i >= 0; pbox++, ppt++) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC, &rgnDst, pptSrc);
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ prgnExposed = NULL;
+ if (pGC->fExpose) {
+ /* Pixmap sources generate a NoExposed (we return NULL to do this) */
+ if (!fastExpose)
+ prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
+ origSource.x, origSource.y,
+ (int)origSource.width,
+ (int)origSource.height,
+ origDest.x, origDest.y, bitPlane);
+ }
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return prgnExposed;
+}
diff --git a/hw/xfree86/xaa/xaaBitOrder.c b/hw/xfree86/xaa/xaaBitOrder.c
new file mode 100644
index 000000000..d7f3ba2a3
--- /dev/null
+++ b/hw/xfree86/xaa/xaaBitOrder.c
@@ -0,0 +1,13 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c,v 1.8 2003/02/17 16:08:29 dawes Exp $ */
+
+#include "Xmd.h"
+CARD32 XAAReverseBitOrder(CARD32 v);
+
+CARD32
+XAAReverseBitOrder(CARD32 v)
+{
+ return (((0x01010101 & v) << 7) | ((0x02020202 & v) << 5) |
+ ((0x04040404 & v) << 3) | ((0x08080808 & v) << 1) |
+ ((0x10101010 & v) >> 1) | ((0x20202020 & v) >> 3) |
+ ((0x40404040 & v) >> 5) | ((0x80808080 & v) >> 7));
+}
diff --git a/hw/xfree86/xaa/xaaBitmap.c b/hw/xfree86/xaa/xaaBitmap.c
new file mode 100644
index 000000000..9a8749dbf
--- /dev/null
+++ b/hw/xfree86/xaa/xaaBitmap.c
@@ -0,0 +1,475 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitmap.c,v 1.10 2000/09/01 05:49:45 mvojkovi Exp $ */
+
+
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaacexp.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+
+
+
+/********** byte swapping ***************/
+
+
+#ifdef FIXEDBASE
+# define DEST(i) *dest
+# define RETURN(i) return(dest)
+#else
+# define DEST(i) dest[i]
+# define RETURN(i) return(dest + i)
+#endif
+
+#ifdef MSBFIRST
+# define SOURCE(i) SWAP_BITS_IN_BYTES(src[i])
+#else
+# define SOURCE(i) src[i]
+#endif
+
+
+typedef CARD32 *(* BitmapScanlineProcPtr)(CARD32 *, CARD32 *, int, int);
+
+#ifdef TRIPLE_BITS
+static CARD32*
+BitmapScanline(
+ CARD32 *src, CARD32 *base,
+ int count, int skipleft )
+{
+ CARD32 bits;
+
+ while(count >= 3) {
+ bits = *src;
+ WRITE_BITS3(bits);
+ src++;
+ count -= 3;
+ }
+ if (count == 2) {
+ bits = *src;
+ WRITE_BITS2(bits);
+ } else if (count == 1) {
+ bits = *src;
+ WRITE_BITS1(bits);
+ }
+
+ return base;
+}
+
+static CARD32*
+BitmapScanline_Inverted(
+ CARD32 *src, CARD32 *base,
+ int count, int skipleft )
+{
+ CARD32 bits;
+
+ while(count >= 3) {
+ bits = ~(*src);
+ WRITE_BITS3(bits);
+ src++;
+ count -= 3;
+ }
+ if (count == 2) {
+ bits = ~(*src);
+ WRITE_BITS2(bits);
+ } else if (count == 1) {
+ bits = ~(*src);
+ WRITE_BITS1(bits);
+ }
+
+ return base;
+}
+
+
+static CARD32*
+BitmapScanline_Shifted(
+ CARD32 *src, CARD32 *base,
+ int count, int skipleft )
+{
+ CARD32 bits;
+
+ while(count >= 3) {
+ bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft));
+ WRITE_BITS3(bits);
+ src++;
+ count -= 3;
+ }
+ if (count == 2) {
+ bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft));
+ WRITE_BITS2(bits);
+ } else if (count == 1) {
+ bits = SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft));
+ WRITE_BITS1(bits);
+ }
+
+ return base;
+}
+
+static CARD32*
+BitmapScanline_Shifted_Inverted(
+ CARD32 *src, CARD32 *base,
+ int count, int skipleft )
+{
+ CARD32 bits;
+
+ while(count >= 3) {
+ bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)));
+ WRITE_BITS3(bits);
+ src++;
+ count -= 3;
+ }
+ if (count == 2) {
+ bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)));
+ WRITE_BITS2(bits);
+ } else if (count == 1) {
+ bits = ~(SHIFT_R(*src,skipleft) | SHIFT_L(*(src + 1),(32 - skipleft)));
+ WRITE_BITS1(bits);
+ }
+
+ return base;
+}
+
+#define BitmapScanline_Shifted_Careful BitmapScanline_Shifted
+#define BitmapScanline_Shifted_Inverted_Careful BitmapScanline_Shifted_Inverted
+
+#else
+static CARD32*
+BitmapScanline(
+ CARD32 *src, CARD32 *dest,
+ int count, int skipleft )
+{
+ while(count >= 4) {
+ DEST(0) = SOURCE(0);
+ DEST(1) = SOURCE(1);
+ DEST(2) = SOURCE(2);
+ DEST(3) = SOURCE(3);
+ count -= 4;
+ src += 4;
+#ifndef FIXEDBASE
+ dest += 4;
+#endif
+ }
+
+ if(!count) return dest;
+ DEST(0) = SOURCE(0);
+ if(count == 1) RETURN(1);
+ DEST(1) = SOURCE(1);
+ if(count == 2) RETURN(2);
+ DEST(2) = SOURCE(2);
+ RETURN(3);
+}
+
+static CARD32*
+BitmapScanline_Inverted(
+ CARD32 *src, CARD32 *dest,
+ int count, int skipleft )
+{
+ while(count >= 4) {
+ DEST(0) = ~SOURCE(0);
+ DEST(1) = ~SOURCE(1);
+ DEST(2) = ~SOURCE(2);
+ DEST(3) = ~SOURCE(3);
+ count -= 4;
+ src += 4;
+#ifndef FIXEDBASE
+ dest += 4;
+#endif
+ }
+
+ if(!count) return dest;
+ DEST(0) = ~SOURCE(0);
+ if(count == 1) RETURN(1);
+ DEST(1) = ~SOURCE(1);
+ if(count == 2) RETURN(2);
+ DEST(2) = ~SOURCE(2);
+ RETURN(3);
+}
+
+
+static CARD32*
+BitmapScanline_Shifted(
+ CARD32 *bits, CARD32 *base,
+ int count, int skipleft )
+{
+ while(count--) {
+ register CARD32 tmp = SHIFT_R(*bits,skipleft) |
+ SHIFT_L(*(bits + 1),(32 - skipleft));
+ WRITE_BITS(tmp);
+ bits++;
+ }
+ return base;
+}
+
+static CARD32*
+BitmapScanline_Shifted_Inverted(
+ CARD32 *bits, CARD32 *base,
+ int count, int skipleft )
+{
+ while(count--) {
+ register CARD32 tmp = ~(SHIFT_R(*bits,skipleft) |
+ SHIFT_L(*(bits + 1),(32 - skipleft)));
+ WRITE_BITS(tmp);
+ bits++;
+ }
+ return base;
+}
+
+static CARD32*
+BitmapScanline_Shifted_Careful(
+ CARD32 *bits, CARD32 *base,
+ int count, int skipleft )
+{
+ register CARD32 tmp;
+ while(--count) {
+ tmp = SHIFT_R(*bits,skipleft) | SHIFT_L(*(bits + 1),(32 - skipleft));
+ WRITE_BITS(tmp);
+ bits++;
+ }
+ tmp = SHIFT_R(*bits,skipleft);
+ WRITE_BITS(tmp);
+
+ return base;
+}
+
+static CARD32*
+BitmapScanline_Shifted_Inverted_Careful(
+ CARD32 *bits, CARD32 *base,
+ int count, int skipleft )
+{
+ register CARD32 tmp;
+ while(--count) {
+ tmp = ~(SHIFT_R(*bits,skipleft) | SHIFT_L(*(bits + 1),(32 - skipleft)));
+ WRITE_BITS(tmp);
+ bits++;
+ }
+ tmp = ~(SHIFT_R(*bits,skipleft));
+ WRITE_BITS(tmp);
+ return base;
+}
+
+#endif
+
+/*
+ When the accelerator is TRANSPARENCY_ONLY, WriteBitmap can do
+ the fill in two passes, inverting the source on the second pass.
+ For GXcopy we can fill the backing rectangle as a solid rect and
+ avoid the invert.
+*/
+
+void
+#ifdef TRIPLE_BITS
+EXPNAME(XAAWriteBitmapColorExpand3)(
+#else
+EXPNAME(XAAWriteBitmapColorExpand)(
+#endif
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int H,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32* base;
+ unsigned char *srcp = src;
+ int SecondPassColor = -1;
+ int shift = 0, dwords;
+ BitmapScanlineProcPtr firstFunc;
+ BitmapScanlineProcPtr secondFunc;
+ int flag;
+ int h = H;
+
+#ifdef TRIPLE_BITS
+ if((bg != -1) &&
+ ((infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) ||
+ ((infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) &&
+ (!CHECK_RGB_EQUAL(bg))))) {
+#else
+ if((bg != -1) &&
+ (infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
+#endif
+ if((rop == GXcopy) && infoRec->SetupForSolidFill) {
+ (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
+ } else SecondPassColor = bg;
+ bg = -1;
+ }
+
+#ifdef TRIPLE_BITS
+ if(skipleft) {
+#else
+ if(skipleft &&
+ (!(infoRec->CPUToScreenColorExpandFillFlags & LEFT_EDGE_CLIPPING) ||
+ (!(infoRec->CPUToScreenColorExpandFillFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
+ (skipleft > x)))) {
+#endif
+ if((skipleft + ((w + 31) & ~31)) > ((skipleft + w + 31) & ~31)) {
+ /* don't read past the end */
+ firstFunc = BitmapScanline_Shifted_Careful;
+ secondFunc = BitmapScanline_Shifted_Inverted_Careful;
+ } else {
+ firstFunc = BitmapScanline_Shifted;
+ secondFunc = BitmapScanline_Shifted_Inverted;
+ }
+ shift = skipleft;
+ skipleft = 0;
+ } else {
+ firstFunc = BitmapScanline;
+ secondFunc = BitmapScanline_Inverted;
+ w += skipleft;
+ x -= skipleft;
+ }
+
+#ifdef TRIPLE_BITS
+ dwords = (3 * w + 31) >> 5;
+#else
+ dwords = (w + 31) >> 5;
+#endif
+
+SECOND_PASS:
+
+ flag = (infoRec->CPUToScreenColorExpandFillFlags
+ & CPU_TRANSFER_PAD_QWORD) && ((dwords * h) & 0x01);
+ (*infoRec->SetupForCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+ (*infoRec->SubsequentCPUToScreenColorExpandFill)(
+ pScrn, x, y, w, h, skipleft);
+
+ base = (CARD32*)infoRec->ColorExpandBase;
+
+#ifndef FIXEDBASE
+ if((dwords * h) <= infoRec->ColorExpandRange)
+ while(h--) {
+ base = (*firstFunc)((CARD32*)srcp, base, dwords, shift);
+ srcp += srcwidth;
+ }
+ else
+#endif
+ while(h--) {
+ (*firstFunc)((CARD32*)srcp, base, dwords, shift);
+ srcp += srcwidth;
+ }
+
+ if(flag){
+ base = (CARD32*)infoRec->ColorExpandBase;
+ base[0] = 0x00000000;
+ }
+
+ if(SecondPassColor != -1) {
+ h = H; /* Reset height */
+ fg = SecondPassColor;
+ SecondPassColor = -1;
+ firstFunc = secondFunc;
+ srcp = src;
+ goto SECOND_PASS;
+ }
+
+ if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+}
+
+#ifndef FIXEDBASE
+
+void
+#ifdef TRIPLE_BITS
+EXPNAME(XAAWriteBitmapScanlineColorExpand3)(
+#else
+EXPNAME(XAAWriteBitmapScanlineColorExpand)(
+#endif
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32* base;
+ unsigned char *srcp = src;
+ int SecondPassColor = -1;
+ int shift = 0, dwords, bufferNo;
+ BitmapScanlineProcPtr firstFunc;
+ BitmapScanlineProcPtr secondFunc;
+
+#ifdef TRIPLE_BITS
+ if((bg != -1) &&
+ ((infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)
+ || ((infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) &&
+ (!CHECK_RGB_EQUAL(bg))))) {
+#else
+ if((bg != -1) &&
+ (infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)){
+#endif
+ if((rop == GXcopy) && infoRec->SetupForSolidFill) {
+ (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
+ } else SecondPassColor = bg;
+ bg = -1;
+ }
+
+#ifdef TRIPLE_BITS
+ if(skipleft) {
+#else
+ if(skipleft &&
+ (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ LEFT_EDGE_CLIPPING) ||
+ (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ LEFT_EDGE_CLIPPING_NEGATIVE_X) && (skipleft > x)))) {
+#endif
+ if((skipleft + ((w + 31) & ~31)) > ((skipleft + w + 31) & ~31)) {
+ /* don't read past the end */
+ firstFunc = BitmapScanline_Shifted_Careful;
+ secondFunc = BitmapScanline_Shifted_Inverted_Careful;
+ } else {
+ firstFunc = BitmapScanline_Shifted;
+ secondFunc = BitmapScanline_Shifted_Inverted;
+ }
+ shift = skipleft;
+ skipleft = 0;
+ } else {
+ firstFunc = BitmapScanline;
+ secondFunc = BitmapScanline_Inverted;
+ w += skipleft;
+ x -= skipleft;
+ }
+
+#ifdef TRIPLE_BITS
+ dwords = (3 * w + 31) >> 5;
+#else
+ dwords = (w + 31) >> 5;
+#endif
+
+SECOND_PASS:
+
+ (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(pScrn, fg, bg, rop, planemask);
+ (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
+ pScrn, x, y, w, h, skipleft);
+
+ bufferNo = 0;
+
+ while(h--) {
+ base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
+ (*firstFunc)((CARD32*)srcp, base, dwords, shift);
+ (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
+ srcp += srcwidth;
+ if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
+ bufferNo = 0;
+ }
+
+ if(SecondPassColor != -1) {
+ fg = SecondPassColor;
+ SecondPassColor = -1;
+ firstFunc = secondFunc;
+ srcp = src;
+ goto SECOND_PASS;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+#endif
diff --git a/hw/xfree86/xaa/xaaCpyArea.c b/hw/xfree86/xaa/xaaCpyArea.c
new file mode 100644
index 000000000..497c3e7a1
--- /dev/null
+++ b/hw/xfree86/xaa/xaaCpyArea.c
@@ -0,0 +1,385 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyArea.c,v 1.13 2001/02/19 22:19:49 mvojkovi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "migc.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+
+/*
+ Written mostly by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
+ */
+
+
+RegionPtr
+XAACopyArea(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(pDstDrawable->type == DRAWABLE_WINDOW) {
+ if((pSrcDrawable->type == DRAWABLE_WINDOW) ||
+ IS_OFFSCREEN_PIXMAP(pSrcDrawable)){
+ if(infoRec->ScreenToScreenBitBlt &&
+ CHECK_ROP(pGC,infoRec->ScreenToScreenBitBltFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->ScreenToScreenBitBltFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->ScreenToScreenBitBltFlags))
+ return (XAABitBlt( pSrcDrawable, pDstDrawable,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ XAADoBitBlt, 0L));
+ } else {
+ if(infoRec->WritePixmap &&
+ ((pDstDrawable->bitsPerPixel == pSrcDrawable->bitsPerPixel) ||
+ ((pDstDrawable->bitsPerPixel == 24) &&
+ (pSrcDrawable->bitsPerPixel == 32) &&
+ (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP))) &&
+ CHECK_ROP(pGC,infoRec->WritePixmapFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->WritePixmapFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->WritePixmapFlags) &&
+ CHECK_NO_GXCOPY(pGC,infoRec->WritePixmapFlags))
+ return (XAABitBlt( pSrcDrawable, pDstDrawable,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ XAADoImageWrite, 0L));
+ }
+ } else if(IS_OFFSCREEN_PIXMAP(pDstDrawable)){
+ if((pSrcDrawable->type == DRAWABLE_WINDOW) ||
+ IS_OFFSCREEN_PIXMAP(pSrcDrawable)){
+ if(infoRec->ScreenToScreenBitBlt &&
+ CHECK_ROP(pGC,infoRec->ScreenToScreenBitBltFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->ScreenToScreenBitBltFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->ScreenToScreenBitBltFlags))
+ return (XAABitBlt( pSrcDrawable, pDstDrawable,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ XAADoBitBlt, 0L));
+ }
+ }
+
+ return (XAAFallbackOps.CopyArea(pSrcDrawable, pDstDrawable, pGC,
+ srcx, srcy, width, height, dstx, dsty));
+}
+
+
+void
+XAADoBitBlt(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc )
+{
+ int nbox, careful;
+ BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
+ DDXPointPtr pptTmp, pptNew1, pptNew2;
+ int xdir, ydir;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ /* XXX we have to err on the side of safety when both are windows,
+ * because we don't know if IncludeInferiors is being used.
+ */
+ careful = ((pSrc == pDst) ||
+ ((pSrc->type == DRAWABLE_WINDOW) &&
+ (pDst->type == DRAWABLE_WINDOW)));
+
+ pbox = REGION_RECTS(prgnDst);
+ nbox = REGION_NUM_RECTS(prgnDst);
+
+ pboxNew1 = NULL;
+ pptNew1 = NULL;
+ pboxNew2 = NULL;
+ pptNew2 = NULL;
+ if (careful && (pptSrc->y < pbox->y1)) {
+ /* walk source botttom to top */
+ ydir = -1;
+
+ if (nbox > 1) {
+ /* keep ordering in each band, reverse order of bands */
+ pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ if(!pboxNew1)
+ return;
+ pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if(!pptNew1) {
+ DEALLOCATE_LOCAL(pboxNew1);
+ return;
+ }
+ pboxBase = pboxNext = pbox+nbox-1;
+ while (pboxBase >= pbox) {
+ while ((pboxNext >= pbox) &&
+ (pboxBase->y1 == pboxNext->y1))
+ pboxNext--;
+ pboxTmp = pboxNext+1;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp <= pboxBase) {
+ *pboxNew1++ = *pboxTmp++;
+ *pptNew1++ = *pptTmp++;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew1 -= nbox;
+ pbox = pboxNew1;
+ pptNew1 -= nbox;
+ pptSrc = pptNew1;
+ }
+ } else {
+ /* walk source top to bottom */
+ ydir = 1;
+ }
+
+ if (careful && (pptSrc->x < pbox->x1)) {
+ /* walk source right to left */
+ xdir = -1;
+
+ if (nbox > 1) {
+ /* reverse order of rects in each band */
+ pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if(!pboxNew2 || !pptNew2) {
+ if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
+ if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
+ if (pboxNew1) {
+ DEALLOCATE_LOCAL(pptNew1);
+ DEALLOCATE_LOCAL(pboxNew1);
+ }
+ return;
+ }
+ pboxBase = pboxNext = pbox;
+ while (pboxBase < pbox+nbox) {
+ while ((pboxNext < pbox+nbox) &&
+ (pboxNext->y1 == pboxBase->y1))
+ pboxNext++;
+ pboxTmp = pboxNext;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp != pboxBase) {
+ *pboxNew2++ = *--pboxTmp;
+ *pptNew2++ = *--pptTmp;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew2 -= nbox;
+ pbox = pboxNew2;
+ pptNew2 -= nbox;
+ pptSrc = pptNew2;
+ }
+ } else {
+ /* walk source left to right */
+ xdir = 1;
+ }
+
+ (*infoRec->ScreenToScreenBitBlt)(infoRec->pScrn, nbox, pptSrc, pbox,
+ xdir, ydir, pGC->alu, pGC->planemask);
+
+ if (pboxNew2) {
+ DEALLOCATE_LOCAL(pptNew2);
+ DEALLOCATE_LOCAL(pboxNew2);
+ }
+ if (pboxNew1) {
+ DEALLOCATE_LOCAL(pptNew1);
+ DEALLOCATE_LOCAL(pboxNew1);
+ }
+
+}
+
+void
+XAADoImageWrite(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc )
+{
+ int srcwidth;
+ unsigned char* psrcBase; /* start of image */
+ unsigned char* srcPntr; /* index into the image */
+ BoxPtr pbox = REGION_RECTS(prgnDst);
+ int nbox = REGION_NUM_RECTS(prgnDst);
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int Bpp = pSrc->bitsPerPixel >> 3;
+
+ psrcBase = (unsigned char *)((PixmapPtr)pSrc)->devPrivate.ptr;
+ srcwidth = (int)((PixmapPtr)pSrc)->devKind;
+
+ for(; nbox; pbox++, pptSrc++, nbox--) {
+ srcPntr = psrcBase + (pptSrc->y * srcwidth) + (pptSrc->x * Bpp);
+
+ (*infoRec->WritePixmap)(infoRec->pScrn, pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, srcPntr, srcwidth,
+ pGC->alu, pGC->planemask, -1, pSrc->bitsPerPixel, pSrc->depth);
+ }
+}
+
+
+void
+XAADoImageRead(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc )
+{
+ int dstwidth;
+ unsigned char* pdstBase; /* start of image */
+ unsigned char* dstPntr; /* index into the image */
+ BoxPtr pbox = REGION_RECTS(prgnDst);
+ int nbox = REGION_NUM_RECTS(prgnDst);
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int Bpp = pSrc->bitsPerPixel >> 3; /* wouldn't get here unless both
+ src and dst have same bpp */
+
+ pdstBase = (unsigned char *)((PixmapPtr)pDst)->devPrivate.ptr;
+ dstwidth = (int)((PixmapPtr)pDst)->devKind;
+
+ for(; nbox; pbox++, pptSrc++, nbox--) {
+ dstPntr = pdstBase + (pbox->y1 * dstwidth) + (pbox->x1 * Bpp);
+
+ (*infoRec->ReadPixmap)(infoRec->pScrn, pptSrc->x, pptSrc->y,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, dstPntr, dstwidth,
+ pSrc->bitsPerPixel, pSrc->depth);
+ }
+}
+
+
+void
+XAAScreenToScreenBitBlt(
+ ScrnInfoPtr pScrn,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir, int ydir,
+ int alu,
+ unsigned int planemask )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int dirsetup;
+
+ if ((!(infoRec->CopyAreaFlags & ONLY_TWO_BITBLT_DIRECTIONS)
+ || (xdir == ydir)) &&
+ (!(infoRec->CopyAreaFlags & ONLY_LEFT_TO_RIGHT_BITBLT)
+ || (xdir == 1))) {
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn,
+ xdir, ydir, alu, planemask, -1);
+ for (; nbox; pbox++, pptSrc++, nbox--)
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,pptSrc->x, pptSrc->y,
+ pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+ SET_SYNC_FLAG(infoRec);
+ return;
+ }
+
+ if (infoRec->CopyAreaFlags & ONLY_LEFT_TO_RIGHT_BITBLT) {
+ /*
+ * This is the case of a chip that only supports xdir = 1,
+ * with ydir = 1 or ydir = -1, but we have xdir = -1.
+ */
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn,
+ 1, ydir, alu, planemask, -1);
+ for (; nbox; pbox++, pptSrc++, nbox--)
+ if (pptSrc->y != pbox->y1 || pptSrc->x >= pbox->x1)
+ /* No problem. Do a xdir = 1 blit instead. */
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pptSrc->x, pptSrc->y, pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+ else
+ {
+ /*
+ * This is the difficult case. Needs striping into
+ * non-overlapping horizontal chunks.
+ */
+ int stripeWidth, w, fullStripes, extra, i;
+ stripeWidth = 16;
+ w = pbox->x2 - pbox->x1;
+ if (pbox->x1 - pptSrc->x < stripeWidth)
+ stripeWidth = pbox->x1 - pptSrc->x;
+ fullStripes = w / stripeWidth;
+ extra = w % stripeWidth;
+
+ /* First, take care of the little bit on the far right */
+ if (extra)
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pptSrc->x + fullStripes * stripeWidth, pptSrc->y,
+ pbox->x1 + fullStripes * stripeWidth, pbox->y1,
+ extra, pbox->y2 - pbox->y1);
+
+ /* Now, take care of the rest of the blit */
+ for (i = fullStripes - 1; i >= 0; i--)
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pptSrc->x + i * stripeWidth, pptSrc->y,
+ pbox->x1 + i * stripeWidth, pbox->y1,
+ stripeWidth, pbox->y2 - pbox->y1);
+ }
+ SET_SYNC_FLAG(infoRec);
+ return;
+ }
+
+ /*
+ * Now the case of a chip that only supports xdir = ydir = 1 or
+ * xdir = ydir = -1, but we have xdir != ydir.
+ */
+ dirsetup = 0; /* No direction set up yet. */
+ for (; nbox; pbox++, pptSrc++, nbox--) {
+ if (xdir == 1 && pptSrc->y != pbox->y1) {
+ /* Do a xdir = ydir = -1 blit instead. */
+ if (dirsetup != -1) {
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn,
+ -1, -1, alu, planemask, -1);
+ dirsetup = -1;
+ }
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,pptSrc->x, pptSrc->y,
+ pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+ }
+ else if (xdir == -1 && pptSrc->y != pbox->y1) {
+ /* Do a xdir = ydir = 1 blit instead. */
+ if (dirsetup != 1) {
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn,
+ 1, 1, alu, planemask, -1);
+ dirsetup = 1;
+ }
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,pptSrc->x, pptSrc->y,
+ pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+ }
+ else
+ if (xdir == 1) {
+ /*
+ * xdir = 1, ydir = -1.
+ * Perform line-by-line xdir = ydir = 1 blits, going up.
+ */
+ int i;
+ if (dirsetup != 1) {
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn,
+ 1, 1, alu, planemask, -1);
+ dirsetup = 1;
+ }
+ for (i = pbox->y2 - pbox->y1 - 1; i >= 0; i--)
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pptSrc->x, pptSrc->y + i, pbox->x1, pbox->y1 + i,
+ pbox->x2 - pbox->x1, 1);
+ }
+ else {
+ /*
+ * xdir = -1, ydir = 1.
+ * Perform line-by-line xdir = ydir = -1 blits, going down.
+ */
+ int i;
+ if (dirsetup != -1) {
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn,
+ -1, -1, alu, planemask, -1);
+ dirsetup = -1;
+ }
+ for (i = 0; i < pbox->y2 - pbox->y1; i++)
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pptSrc->x, pptSrc->y + i, pbox->x1, pbox->y1 + i,
+ pbox->x2 - pbox->x1, 1);
+ }
+ } /* next box */
+ SET_SYNC_FLAG(infoRec);
+}
diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c
new file mode 100644
index 000000000..74dcdfd31
--- /dev/null
+++ b/hw/xfree86/xaa/xaaCpyPlane.c
@@ -0,0 +1,206 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyPlane.c,v 1.13 2001/10/01 13:44:15 eich Exp $ */
+
+/*
+ A CopyPlane function that handles bitmap->screen copies and
+ sends anything else to the Fallback.
+
+ Also, a PushPixels for solid fill styles.
+
+ Written by Mark Vojkovich (markv@valinux.com)
+
+*/
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+#include "servermd.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "mi.h"
+#include "pixmapstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+
+static void XAACopyPlane1toNColorExpand(DrawablePtr pSrc, DrawablePtr pDst,
+ GCPtr pGC, RegionPtr rgnDst,
+ DDXPointPtr pptSrc);
+static void XAACopyPlaneNtoNColorExpand(DrawablePtr pSrc, DrawablePtr pDst,
+ GCPtr pGC, RegionPtr rgnDst,
+ DDXPointPtr pptSrc);
+
+
+static unsigned long TmpBitPlane;
+
+RegionPtr
+XAACopyPlaneColorExpansion(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ if((pSrc->type == DRAWABLE_PIXMAP) && !XAA_DEPTH_BUG(pGC)) {
+ if(pSrc->bitsPerPixel == 1) {
+ return(XAABitBlt(pSrc, pDst, pGC, srcx, srcy,
+ width, height, dstx, dsty,
+ XAACopyPlane1toNColorExpand, bitPlane));
+ } else if(bitPlane < (1 << pDst->depth)){
+ TmpBitPlane = bitPlane;
+ return(XAABitBlt(pSrc, pDst, pGC, srcx, srcy,
+ width, height, dstx, dsty,
+ XAACopyPlaneNtoNColorExpand, bitPlane));
+ }
+ }
+
+ return (XAAFallbackOps.CopyPlane(pSrc, pDst, pGC, srcx, srcy,
+ width, height, dstx, dsty, bitPlane));
+}
+
+
+static void
+XAACopyPlane1toNColorExpand(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ RegionPtr rgnDst,
+ DDXPointPtr pptSrc )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ BoxPtr pbox = REGION_RECTS(rgnDst);
+ int numrects = REGION_NUM_RECTS(rgnDst);
+ unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr;
+ int srcwidth = ((PixmapPtr)pSrc)->devKind;
+
+ while(numrects--) {
+ (*infoRec->WriteBitmap)(infoRec->pScrn, pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ src + (srcwidth * pptSrc->y) + ((pptSrc->x >> 5) << 2),
+ srcwidth, pptSrc->x & 31,
+ pGC->fgPixel, pGC->bgPixel, pGC->alu, pGC->planemask);
+ pbox++; pptSrc++;
+ }
+}
+
+
+static void
+XAACopyPlaneNtoNColorExpand(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ RegionPtr rgnDst,
+ DDXPointPtr pptSrc
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ BoxPtr pbox = REGION_RECTS(rgnDst);
+ int numrects = REGION_NUM_RECTS(rgnDst);
+ unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr;
+ unsigned char *data, *srcPtr, *dataPtr;
+ int srcwidth = ((PixmapPtr)pSrc)->devKind;
+ int pitch, width, height, h, i, index, offset;
+ int Bpp = pSrc->bitsPerPixel >> 3;
+ unsigned long mask = TmpBitPlane;
+
+ if(TmpBitPlane < 8) {
+ offset = 0;
+ } else if(TmpBitPlane < 16) {
+ offset = 1;
+ mask >>= 8;
+ } else if(TmpBitPlane < 24) {
+ offset = 2;
+ mask >>= 16;
+ } else {
+ offset = 3;
+ mask >>= 24;
+ }
+
+ if(IS_OFFSCREEN_PIXMAP(pSrc))
+ SYNC_CHECK(pSrc);
+
+ while(numrects--) {
+ width = pbox->x2 - pbox->x1;
+ h = height = pbox->y2 - pbox->y1;
+ pitch = BitmapBytePad(width);
+
+ if(!(data = xalloc(height * pitch)))
+ goto ALLOC_FAILED;
+
+ bzero(data, height * pitch);
+
+ dataPtr = data;
+ srcPtr = ((pptSrc->y) * srcwidth) + src +
+ ((pptSrc->x) * Bpp) + offset;
+
+ while(h--) {
+ for(i = index = 0; i < width; i++, index += Bpp) {
+ if(mask & srcPtr[index])
+ dataPtr[i >> 3] |= (1 << (i & 7));
+ }
+ dataPtr += pitch;
+ srcPtr += srcwidth;
+ }
+
+ (*infoRec->WriteBitmap)(infoRec->pScrn,
+ pbox->x1, pbox->y1, width, height, data, pitch, 0,
+ pGC->fgPixel, pGC->bgPixel, pGC->alu, pGC->planemask);
+
+ xfree(data);
+
+ALLOC_FAILED:
+
+ pbox++; pptSrc++;
+ }
+}
+
+void
+XAAPushPixelsSolidColorExpansion(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy,
+ int xOrg, int yOrg )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int MaxBoxes = REGION_NUM_RECTS(pGC->pCompositeClip);
+ BoxPtr pbox, pClipBoxes;
+ int nboxes, srcx, srcy;
+ xRectangle TheRect;
+ unsigned char *src = pBitMap->devPrivate.ptr;
+ int srcwidth = pBitMap->devKind;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ TheRect.x = xOrg;
+ TheRect.y = yOrg;
+ TheRect.width = dx;
+ TheRect.height = dy;
+
+ if(MaxBoxes > (infoRec->PreAllocSize/sizeof(BoxRec))) {
+ pClipBoxes = xalloc(MaxBoxes * sizeof(BoxRec));
+ if(!pClipBoxes) return;
+ } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem;
+
+ nboxes = XAAGetRectClipBoxes(pGC->pCompositeClip, pClipBoxes, 1, &TheRect);
+ pbox = pClipBoxes;
+
+ while(nboxes--) {
+ srcx = pbox->x1 - xOrg;
+ srcy = pbox->y1 - yOrg;
+ (*infoRec->WriteBitmap)(infoRec->pScrn, pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ src + (srcwidth * srcy) + ((srcx >> 5) << 2),
+ srcwidth, srcx & 31,
+ pGC->fgPixel, -1, pGC->alu, pGC->planemask);
+ pbox++;
+ }
+
+ if(pClipBoxes != (BoxPtr)infoRec->PreAllocMem)
+ xfree(pClipBoxes);
+}
+
diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c
new file mode 100644
index 000000000..1c5ecf38e
--- /dev/null
+++ b/hw/xfree86/xaa/xaaCpyWin.c
@@ -0,0 +1,80 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaCpyWin.c,v 1.3 2003/02/17 16:08:29 dawes Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "xaawrap.h"
+
+/*
+ Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
+*/
+
+void
+XAACopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc )
+{
+ DDXPointPtr pptSrc, ppt;
+ RegionRec rgnDst;
+ BoxPtr pbox;
+ int dx, dy, nbox;
+ WindowPtr pwinRoot;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XAAInfoRecPtr infoRec =
+ GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
+
+ if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
+ XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
+ if(infoRec->pScrn->vtSema && infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
+ XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow);
+ return;
+ }
+
+ pwinRoot = WindowTable[pScreen->myNum];
+
+ REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
+
+ pbox = REGION_RECTS(&rgnDst);
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(!nbox ||
+ !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
+ REGION_UNINIT(pScreen, &rgnDst);
+ return;
+ }
+ ppt = pptSrc;
+
+ while(nbox--) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ ppt++; pbox++;
+ }
+
+ infoRec->ScratchGC.planemask = ~0L;
+ infoRec->ScratchGC.alu = GXcopy;
+
+ XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
+ &(infoRec->ScratchGC), &rgnDst, pptSrc);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ REGION_UNINIT(pScreen, &rgnDst);
+}
diff --git a/hw/xfree86/xaa/xaaDashLine.c b/hw/xfree86/xaa/xaaDashLine.c
new file mode 100644
index 000000000..212116ae4
--- /dev/null
+++ b/hw/xfree86/xaa/xaaDashLine.c
@@ -0,0 +1,329 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaDashLine.c,v 1.5 2002/09/18 18:14:59 martin Exp $ */
+
+#include "X.h"
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "miline.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+
+void
+#ifdef POLYSEGMENT
+XAAPolySegmentDashed(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+#else
+XAAPolyLinesDashed(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode, /* Origin or Previous */
+ int npt, /* number of points */
+ DDXPointPtr pptInit
+#endif
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+ BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
+ int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
+ unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
+ int xorg = pDrawable->x;
+ int yorg = pDrawable->y;
+ int nbox;
+ BoxPtr pbox;
+#ifndef POLYSEGMENT
+ DDXPointPtr ppt;
+#endif
+ unsigned int oc1, oc2;
+ int dmin, dmaj, e, octant;
+ int x1, x2, y1, y2, tmp, len, offset;
+ int PatternLength, PatternOffset;
+
+ if(!nboxInit)
+ return;
+
+ if (infoRec->DashedLineFlags & LINE_LIMIT_COORDS) {
+ int minValX = infoRec->DashedLineLimits.x1;
+ int maxValX = infoRec->DashedLineLimits.x2;
+ int minValY = infoRec->DashedLineLimits.y1;
+ int maxValY = infoRec->DashedLineLimits.y2;
+#ifdef POLYSEGMENT
+ int n = nseg;
+ xSegment *s = pSeg;
+
+ while (n--)
+#else
+ int n = npt;
+ int xorgtmp = xorg;
+ int yorgtmp = yorg;
+
+ ppt = pptInit;
+ x2 = ppt->x + xorgtmp;
+ y2 = ppt->y + yorgtmp;
+ while (--n)
+#endif
+ {
+#ifdef POLYSEGMENT
+ x1 = s->x1 + xorg;
+ y1 = s->y1 + yorg;
+ x2 = s->x2 + xorg;
+ y2 = s->y2 + yorg;
+ s++;
+#else
+ x1 = x2;
+ y1 = y2;
+ ++ppt;
+ if (mode == CoordModePrevious) {
+ xorgtmp = x1;
+ yorgtmp = y1;
+ }
+ x2 = ppt->x + xorgtmp;
+ y2 = ppt->y + yorgtmp;
+#endif
+ if (x1 > maxValX || x1 < minValX ||
+ x2 > maxValX || x2 < minValX ||
+ y1 > maxValY || y1 < minValY ||
+ y2 > maxValY || y2 < minValY) {
+#ifdef POLYSEGMENT
+ XAAFallbackOps.PolySegment(pDrawable, pGC, nseg, pSeg);
+#else
+ XAAFallbackOps.Polylines(pDrawable, pGC, mode, npt, pptInit);
+#endif
+ return;
+ }
+ }
+ }
+
+ PatternLength = pGCPriv->DashLength;
+ PatternOffset = pGC->dashOffset % PatternLength;
+
+ (*infoRec->SetupForDashedLine)(infoRec->pScrn, pGC->fgPixel,
+ (pGC->lineStyle == LineDoubleDash) ? pGC->bgPixel : -1,
+ pGC->alu, pGC->planemask, PatternLength, pGCPriv->DashPattern);
+
+
+#ifdef POLYSEGMENT
+ while (nseg--)
+#else
+ ppt = pptInit;
+ x2 = ppt->x + xorg;
+ y2 = ppt->y + yorg;
+ while(--npt)
+#endif
+ {
+ nbox = nboxInit;
+ pbox = pboxInit;
+
+#ifdef POLYSEGMENT
+ x1 = pSeg->x1 + xorg;
+ y1 = pSeg->y1 + yorg;
+ x2 = pSeg->x2 + xorg;
+ y2 = pSeg->y2 + yorg;
+ pSeg++;
+#else
+ x1 = x2;
+ y1 = y2;
+ ++ppt;
+ if (mode == CoordModePrevious) {
+ xorg = x1;
+ yorg = y1;
+ }
+ x2 = ppt->x + xorg;
+ y2 = ppt->y + yorg;
+#endif
+
+
+ if (infoRec->SubsequentDashedBresenhamLine) {
+ if((dmaj = x2 - x1) < 0) {
+ dmaj = -dmaj;
+ octant = XDECREASING;
+ } else octant = 0;
+
+ if((dmin = y2 - y1) < 0) {
+ dmin = -dmin;
+ octant |= YDECREASING;
+ }
+
+ if(dmin >= dmaj){
+ tmp = dmin; dmin = dmaj; dmaj = tmp;
+ octant |= YMAJOR;
+ }
+
+ e = -dmaj - ((bias >> octant) & 1);
+ len = dmaj;
+ dmin <<= 1;
+ dmaj <<= 1;
+ } else { /* Muffle compiler */
+ dmin = dmaj = e = octant = len = 0;
+ }
+
+ while(nbox--) {
+ oc1 = oc2 = 0;
+ OUTCODES(oc1, x1, y1, pbox);
+ OUTCODES(oc2, x2, y2, pbox);
+ if (!(oc1 | oc2)) { /* uncliped */
+ if(infoRec->SubsequentDashedTwoPointLine) {
+ (*infoRec->SubsequentDashedTwoPointLine)(
+ infoRec->pScrn, x1, y1, x2, y2,
+#ifdef POLYSEGMENT
+ (pGC->capStyle != CapNotLast) ? 0 :
+#endif
+ OMIT_LAST, PatternOffset);
+ } else {
+ (*infoRec->SubsequentDashedBresenhamLine)(
+ infoRec->pScrn, x1, y1, dmaj, dmin, e,
+#ifdef POLYSEGMENT
+ (pGC->capStyle != CapNotLast) ? (len+1) :
+#endif
+ len, octant, PatternOffset);
+ }
+ break;
+ } else if (oc1 & oc2) { /* completely clipped */
+ pbox++;
+ } else if (infoRec->ClippingFlags & HARDWARE_CLIP_DASHED_LINE) {
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ pbox->x1, pbox->y1, pbox->x2 - 1, pbox->y2 - 1);
+
+ if(infoRec->SubsequentDashedBresenhamLine) {
+ (*infoRec->SubsequentDashedBresenhamLine)(
+ infoRec->pScrn, x1, y1, dmaj, dmin, e,
+#ifdef POLYSEGMENT
+ (pGC->capStyle != CapNotLast) ? (len+1) :
+#endif
+ len, octant, PatternOffset);
+ } else {
+ (*infoRec->SubsequentDashedTwoPointLine)(
+ infoRec->pScrn, x1, y1, x2, y2,
+#ifdef POLYSEGMENT
+ (pGC->capStyle != CapNotLast) ? 0 :
+#endif
+ OMIT_LAST, PatternOffset
+ );
+ }
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+ pbox++;
+ } else {
+ int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
+ int clip1 = 0, clip2 = 0;
+ int err, adx, ady;
+
+ if(octant & YMAJOR) {
+ ady = dmaj >> 1;
+ adx = dmin >> 1;
+ } else {
+ ady = dmin >> 1;
+ adx = dmaj >> 1;
+ }
+
+ if (miZeroClipLine(pbox->x1, pbox->y1,
+ pbox->x2 - 1, pbox->y2 - 1,
+ &new_x1, &new_y1, &new_x2, &new_y2,
+ adx, ady, &clip1, &clip2,
+ octant, bias, oc1, oc2) == -1)
+ {
+ pbox++;
+ continue;
+ }
+
+ if (octant & YMAJOR)
+ len = abs(new_y2 - new_y1);
+ else
+ len = abs(new_x2 - new_x1);
+#ifdef POLYSEGMENT
+ if (clip2 != 0 || pGC->capStyle != CapNotLast)
+ len++;
+#else
+ len += (clip2 != 0);
+#endif
+ if (len) {
+ int abserr, clipdx, clipdy;
+ /* unwind bresenham error term to first point */
+ if (clip1) {
+ clipdx = abs(new_x1 - x1);
+ clipdy = abs(new_y1 - y1);
+
+ if (octant & YMAJOR)
+ err = e + clipdy*dmin - clipdx*dmaj;
+ else
+ err = e + clipdx*dmin - clipdy*dmaj;
+ } else
+ err = e;
+
+#define range infoRec->DashedBresenhamLineErrorTermBits
+ abserr = abs(err);
+ while((abserr & range) ||
+ (dmaj & range) ||
+ (dmin & range)) {
+ dmin >>= 1;
+ dmaj >>= 1;
+ abserr >>= 1;
+ err /= 2;
+ }
+
+ if(octant & YMAJOR)
+ offset = abs(new_y1 - y1);
+ else
+ offset = abs(new_x1 - x1);
+
+ offset += PatternOffset;
+ offset %= PatternLength;
+
+ (*infoRec->SubsequentDashedBresenhamLine)(
+ infoRec->pScrn, new_x1, new_y1,
+ dmaj, dmin, err, len, octant, offset);
+ }
+ pbox++;
+ }
+ } /* while (nbox--) */
+#ifndef POLYSEGMENT
+ len = abs(y2 - y1);
+ tmp = abs(x2 - x1);
+ PatternOffset += (len > tmp) ? len : tmp;
+ PatternOffset %= PatternLength;
+#endif
+ } /* while (nline--) */
+
+#ifndef POLYSEGMENT
+ /* paint the last point if the end style isn't CapNotLast.
+ (Assume that a projecting, butt, or round cap that is one
+ pixel wide is the same as the single pixel of the endpoint.)
+ */
+
+ if ((pGC->capStyle != CapNotLast) &&
+ ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
+ (ppt->y + yorg != pptInit->y + pDrawable->y) ||
+ (ppt == pptInit + 1)))
+ {
+ nbox = nboxInit;
+ pbox = pboxInit;
+ while (nbox--) {
+ if ((x2 >= pbox->x1) && (y2 >= pbox->y1) &&
+ (x2 < pbox->x2) && (y2 < pbox->y2))
+ {
+ if(infoRec->SubsequentDashedTwoPointLine) {
+ (*infoRec->SubsequentDashedTwoPointLine)(
+ infoRec->pScrn, x2, y2, x2, y2, 0,
+ PatternOffset);
+ } else {
+ (*infoRec->SubsequentDashedBresenhamLine)(
+ infoRec->pScrn, x2, y2, 2, 0, -1,
+ 1, 0, PatternOffset);
+ }
+ break;
+ } else
+ pbox++;
+ }
+ }
+#endif
+
+ SET_SYNC_FLAG(infoRec);
+}
+
diff --git a/hw/xfree86/xaa/xaaFallback.c b/hw/xfree86/xaa/xaaFallback.c
new file mode 100644
index 000000000..01b4bb408
--- /dev/null
+++ b/hw/xfree86/xaa/xaaFallback.c
@@ -0,0 +1,352 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFallback.c,v 1.5 1999/05/30 03:03:31 dawes Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "xaawrap.h"
+
+
+
+static void
+XAAFillSpansFallback(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAASetSpansFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPutImageFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static RegionPtr
+XAACopyAreaFallback(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty )
+{
+ RegionPtr ret;
+
+ XAA_GC_OP_PROLOGUE(pGC);
+ if((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) ||
+ IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) {
+ SYNC_CHECK(pGC);
+ }
+ ret = (*pGC->ops->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ XAA_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static RegionPtr
+XAACopyPlaneFallback(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane )
+{
+ RegionPtr ret;
+
+ XAA_GC_OP_PROLOGUE(pGC);
+ if((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) ||
+ IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) {
+ SYNC_CHECK(pGC);
+ }
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+ XAA_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+XAAPolyPointFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolylinesFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolySegmentFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyRectangleFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyArcFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAFillPolygonFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolyFillRectFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolyFillArcFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static int
+XAAPolyText8Fallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars )
+{
+ int ret;
+
+ XAA_GC_OP_PROLOGUE(pGC);
+ SYNC_CHECK(pGC);
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ XAA_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static int
+XAAPolyText16Fallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars )
+{
+ int ret;
+
+ XAA_GC_OP_PROLOGUE(pGC);
+ SYNC_CHECK(pGC);
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ XAA_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+XAAImageText8Fallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAImageText16Fallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAImageGlyphBltFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyGlyphBltFallback(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPushPixelsFallback(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg )
+{
+ XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
+ SYNC_CHECK(pGC);
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ XAA_GC_OP_EPILOGUE(pGC);
+}
+
+GCOps XAAFallbackOps = {
+ XAAFillSpansFallback, XAASetSpansFallback,
+ XAAPutImageFallback, XAACopyAreaFallback,
+ XAACopyPlaneFallback, XAAPolyPointFallback,
+ XAAPolylinesFallback, XAAPolySegmentFallback,
+ XAAPolyRectangleFallback, XAAPolyArcFallback,
+ XAAFillPolygonFallback, XAAPolyFillRectFallback,
+ XAAPolyFillArcFallback, XAAPolyText8Fallback,
+ XAAPolyText16Fallback, XAAImageText8Fallback,
+ XAAImageText16Fallback, XAAImageGlyphBltFallback,
+ XAAPolyGlyphBltFallback, XAAPushPixelsFallback,
+#ifdef NEED_LINEHELPER
+ NULL,
+#endif
+ {NULL} /* devPrivate */
+};
+
+
+
+
diff --git a/hw/xfree86/xaa/xaaFillArc.c b/hw/xfree86/xaa/xaaFillArc.c
new file mode 100644
index 000000000..352d8e084
--- /dev/null
+++ b/hw/xfree86/xaa/xaaFillArc.c
@@ -0,0 +1,213 @@
+/*
+ * Copyright 1996 The XFree86 Project
+ *
+ * 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
+ * HARM HANEMAAYER 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.
+ *
+ * Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillArc.c,v 1.4 1999/05/30 03:03:31 dawes Exp $ */
+
+/*
+ * Filled solid arcs, based on cfbfillarc.c.
+ *
+ * Fill arc using calls to low-level span fill. Because the math for
+ * each span can be done concurrently with the drawing of the span
+ * with a graphics coprocessor operation, this is faster than just
+ * using miPolyFillArc, which first calculates all the spans and then
+ * calls FillSpans.
+ *
+ * Clipped arcs are dispatched to FillSpans.
+ */
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "mifillarc.h"
+#include "mi.h"
+
+/*
+ * This is based on the integer-math versions from mi. Perhaps on a
+ * Pentium, the floating-point (double)-math version is faster.
+ */
+
+static void
+XAAFillEllipseSolid(DrawablePtr pDraw, GCPtr pGC, xArc *arc)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ register int x, y, e;
+ int yk, xk, ym, xm, dx, dy, xorg, yorg;
+ int slw;
+ miFillArcRec info;
+
+ (*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel, pGC->alu,
+ pGC->planemask);
+
+ miFillArcSetup(arc, &info);
+ MIFILLARCSETUP();
+ if (pGC->miTranslate)
+ {
+ xorg += pDraw->x;
+ yorg += pDraw->y;
+ }
+ while (y > 0)
+ {
+ MIFILLARCSTEP(slw);
+ if (slw > 0) {
+ (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn, xorg - x,
+ yorg - y, slw, 1);
+ if (miFillArcLower(slw))
+ (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
+ xorg - x, yorg + y + dy, slw, 1);
+ }
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+#define ADDSPAN(l,r) \
+ if (r >= l) \
+ (*infoRec->SubsequentSolidFillRect)( \
+ infoRec->pScrn, l, ya, r - l + 1, 1);
+
+#define ADDSLICESPANS(flip) \
+ if (!flip) \
+ { \
+ ADDSPAN(xl, xr); \
+ } \
+ else \
+ { \
+ xc = xorg - x; \
+ ADDSPAN(xc, xr); \
+ xc += slw - 1; \
+ ADDSPAN(xl, xc); \
+ }
+
+static void
+XAAFillArcSliceSolid(DrawablePtr pDraw, GCPtr pGC, xArc *arc)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
+ register int x, y, e;
+ miFillArcRec info;
+ miArcSliceRec slice;
+ int ya, xl, xr, xc;
+
+ (*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel, pGC->alu,
+ pGC->planemask);
+
+ miFillArcSetup(arc, &info);
+ miFillArcSliceSetup(arc, &slice, pGC);
+ MIFILLARCSETUP();
+ slw = arc->height;
+ if (slice.flip_top || slice.flip_bot)
+ slw += (arc->height >> 1) + 1;
+ if (pGC->miTranslate)
+ {
+ xorg += pDraw->x;
+ yorg += pDraw->y;
+ slice.edge1.x += pDraw->x;
+ slice.edge2.x += pDraw->x;
+ }
+ while (y > 0)
+ {
+ MIFILLARCSTEP(slw);
+ MIARCSLICESTEP(slice.edge1);
+ MIARCSLICESTEP(slice.edge2);
+ if (miFillSliceUpper(slice))
+ {
+ ya = yorg - y;
+ MIARCSLICEUPPER(xl, xr, slice, slw);
+
+ ADDSLICESPANS(slice.flip_top);
+ }
+ if (miFillSliceLower(slice))
+ {
+ ya = yorg + y + dy;
+ MIARCSLICELOWER(xl, xr, slice, slw);
+ ADDSLICESPANS(slice.flip_bot);
+ }
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+void
+XAAPolyFillArcSolid(pDraw, pGC, narcs, parcs)
+ DrawablePtr pDraw;
+ GCPtr pGC;
+ int narcs;
+ xArc *parcs;
+{
+ register xArc *arc;
+ register int i;
+ int x2, y2;
+ BoxRec box;
+ RegionPtr cclip;
+
+ cclip = pGC->pCompositeClip;
+
+ if(!REGION_NUM_RECTS(cclip))
+ return;
+
+ for (arc = parcs, i = narcs; --i >= 0; arc++)
+ {
+ if (miFillArcEmpty(arc))
+ continue;
+ if (miCanFillArc(arc))
+ {
+ box.x1 = arc->x + pDraw->x;
+ box.y1 = arc->y + pDraw->y;
+ /*
+ * Because box.x2 and box.y2 get truncated to 16 bits, and the
+ * RECT_IN_REGION test treats the resulting number as a signed
+ * integer, the RECT_IN_REGION test alone can go the wrong way.
+ * This can result in a server crash because the rendering
+ * routines in this file deal directly with cpu addresses
+ * of pixels to be stored, and do not clip or otherwise check
+ * that all such addresses are within their respective pixmaps.
+ * So we only allow the RECT_IN_REGION test to be used for
+ * values that can be expressed correctly in a signed short.
+ */
+ x2 = box.x1 + (int)arc->width + 1;
+ box.x2 = x2;
+ y2 = box.y1 + (int)arc->height + 1;
+ box.y2 = y2;
+ if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
+ (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
+ {
+ if ((arc->angle2 >= FULLCIRCLE) ||
+ (arc->angle2 <= -FULLCIRCLE))
+ XAAFillEllipseSolid(pDraw, pGC, arc);
+ else
+ XAAFillArcSliceSolid(pDraw, pGC, arc);
+ continue;
+ }
+ }
+ miPolyFillArc(pDraw, pGC, 1, arc);
+ }
+}
diff --git a/hw/xfree86/xaa/xaaFillPoly.c b/hw/xfree86/xaa/xaaFillPoly.c
new file mode 100644
index 000000000..164887afe
--- /dev/null
+++ b/hw/xfree86/xaa/xaaFillPoly.c
@@ -0,0 +1,956 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillPoly.c,v 1.15 2001/10/28 03:34:04 tsi Exp $ */
+
+/*
+ * Copyright 1996 The XFree86 Project
+ *
+ * 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
+ * HARM HANEMAAYER 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.
+ *
+ */
+
+/*
+ * Written by Mark Vojkovich. Loosly based on an original version
+ * written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net) which
+ * only did solid rectangles and didn't have trapezoid support.
+ *
+ */
+
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "xf86str.h"
+#include "mi.h"
+#include "micoord.h"
+
+#include "xaa.h"
+#include "xaalocal.h"
+
+#define POLY_USE_MI 0
+#define POLY_FULLY_CLIPPED 1
+#define POLY_IS_EASY 2
+
+
+#define Setup(c,x,vertex,dx,dy,e,sign,step,DX) {\
+ x = intToX(vertex); \
+ if ((dy = intToY(c) - y)) { \
+ DX = dx = intToX(c) - x; \
+ step = 0; \
+ if (dx >= 0) \
+ { \
+ e = 0; \
+ sign = 1; \
+ if (dx >= dy) {\
+ step = dx / dy; \
+ dx %= dy; \
+ } \
+ } \
+ else \
+ { \
+ e = 1 - dy; \
+ sign = -1; \
+ dx = -dx; \
+ if (dx >= dy) { \
+ step = - (dx / dy); \
+ dx %= dy; \
+ } \
+ } \
+ } \
+ x += origin; \
+ vertex = c; \
+}
+
+#define Step(x,dx,dy,e,sign,step) {\
+ x += step; \
+ if ((e += dx) > 0) \
+ { \
+ x += sign; \
+ e -= dy; \
+ } \
+}
+
+#define FixError(x, dx, dy, e, sign, step, h) { \
+ e += (h) * dx; \
+ x += (h) * step; \
+ if(e > 0) { \
+ x += e * sign/dy; \
+ e %= dy; \
+ if(e) { \
+ x += sign; \
+ e -= dy; \
+ } \
+ } \
+}
+
+
+/*
+ XAAIsEasyPoly -
+
+ Checks CoordModeOrigin one rect polygons to see if we need
+ to use Mi.
+ Returns: POLY_USE_MI, POLY_FULLY_CLIPPED or POLY_IS_EASY
+ as well as the pointer to the "top" point and the y
+ extents.
+*/
+
+int
+XAAIsEasyPolygon(
+ DDXPointPtr ptsIn,
+ int count,
+ BoxPtr extents,
+ int origin,
+ DDXPointPtr *topPoint, /* return */
+ int *topY, int *bottomY, /* return */
+ int shape
+){
+ int c = 0, vertex1, vertex2;
+
+ *topY = 32767;
+ *bottomY = 0;
+
+ origin -= (origin & 0x8000) << 1;
+ vertex1 = *((int *) &extents->x1) - origin;
+ vertex2 = *((int *) &extents->x2) - origin /* - 0x00010001 */;
+ /* I think this was an error in cfb ^ */
+
+ if (shape == Convex) {
+ while (count--) {
+ c = *((int*)ptsIn);
+ if (((c - vertex1) | (vertex2 - c)) & 0x80008000)
+ return POLY_USE_MI;
+
+ c = intToY(c);
+ if (c < *topY) {
+ *topY = c;
+ *topPoint = ptsIn;
+ }
+ ptsIn++;
+ if (c > *bottomY) *bottomY = c;
+ }
+ } else {
+ int yFlip = 0;
+ int dx2, dx1, x1, x2;
+
+ x2 = x1 = -1;
+ dx2 = dx1 = 1;
+
+ while (count--) {
+ c = *((int*)ptsIn);
+ if (((c - vertex1) | (vertex2 - c)) & 0x80008000)
+ return POLY_USE_MI;
+ c = intToY(c);
+ if (c < *topY) {
+ *topY = c;
+ *topPoint = ptsIn;
+ }
+ ptsIn++;
+ if (c > *bottomY) *bottomY = c;
+ if (c == x1)
+ continue;
+ if (dx1 > 0) {
+ if (x2 < 0) x2 = c;
+ else dx2 = dx1 = (c - x1) >> 31;
+ } else if ((c - x1) >> 31 != dx1) {
+ dx1 = ~dx1;
+ yFlip++;
+ }
+ x1 = c;
+ }
+ x1 = (x2 - c) >> 31;
+ if (x1 != dx1) yFlip++;
+ if (x1 != dx2) yFlip++;
+ if (yFlip != 2) {
+ if(*topY == *bottomY)
+ return POLY_FULLY_CLIPPED;
+ else
+ return POLY_USE_MI;
+ }
+ }
+ if (*topY == *bottomY)
+ return POLY_FULLY_CLIPPED;
+
+ return POLY_IS_EASY;
+}
+
+void
+XAAFillPolygonSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int origin, vertex1, vertex2;
+ int *vertex1p, *vertex2p, *endp;
+ int x1 = 0, x2 = 0;
+ int dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
+ int DX1 = 0, DX2 = 0, e1 = 0, e2 = 0;
+ int step1 = 0, step2 = 0, sign1 = 0, sign2 = 0;
+ int c, y, maxy, h, yoffset;
+ DDXPointPtr topPoint;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ if (mode == CoordModePrevious) {
+ register DDXPointPtr ppt = ptsIn + 1;
+
+ for (origin = 1; origin < count; origin++, ppt++) {
+ ppt->x += (ppt-1)->x;
+ ppt->y += (ppt-1)->y;
+ }
+ mode = CoordModeOrigin;
+ }
+
+ if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
+ miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
+ return;
+ }
+
+ origin = coordToInt(pDraw->x, pDraw->y);
+
+ switch( XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
+ origin, &topPoint, &y, &maxy, shape) ) {
+ case POLY_USE_MI:
+ miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
+ case POLY_FULLY_CLIPPED:
+ return;
+ }
+
+ endp = (int*)ptsIn + count;
+ vertex2p = vertex1p = (int *)topPoint;
+ origin = pDraw->x;
+ yoffset = pDraw->y;
+ vertex2 = vertex1 = *vertex2p++;
+ if (vertex2p == endp)
+ vertex2p = (int *) ptsIn;
+
+ (*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel, pGC->alu,
+ pGC->planemask);
+
+ while(1) {
+ if (y == intToY(vertex1)) {
+ do {
+ if (vertex1p == (int *) ptsIn)
+ vertex1p = endp;
+ c = *--vertex1p;
+ Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1,DX1)
+ } while (y >= intToY(vertex1));
+ h = dy1;
+ } else {
+ Step(x1,dx1,dy1,e1,sign1,step1)
+ h = intToY(vertex1) - y;
+ }
+ if (y == intToY(vertex2)) {
+ do {
+ c = *vertex2p++;
+ if (vertex2p == endp)
+ vertex2p = (int *) ptsIn;
+ Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2,DX2)
+ } while (y >= intToY(vertex2));
+ if (dy2 < h)
+ h = dy2;
+ } else {
+ Step(x2,dx2,dy2,e2,sign2,step2)
+ if ((c = (intToY(vertex2) - y)) < h)
+ h = c;
+ }
+
+ /* fill spans for this segment */
+ if(DX1 | DX2) {
+ if(infoRec->SubsequentSolidFillTrap && (h > 6)) {
+ if(x1 == x2) {
+ while(x1 == x2) {
+ y++;
+ if (!--h) break;
+ Step(x1,dx1,dy1,e1,sign1,step1)
+ Step(x2,dx2,dy2,e2,sign2,step2)
+ }
+ if(y == maxy) break;
+ if(!h) continue;
+ }
+
+ if(x1 < x2)
+ (*infoRec->SubsequentSolidFillTrap)(infoRec->pScrn,
+ y + yoffset, h,
+ x1, DX1, dy1, e1,
+ x2 - 1, DX2, dy2, e2);
+ else
+ (*infoRec->SubsequentSolidFillTrap)(infoRec->pScrn,
+ y + yoffset, h,
+ x2, DX2, dy2, e2,
+ x1 - 1, DX1, dy1, e1);
+ y += h;
+ if(--h) {
+ FixError(x1,dx1,dy1,e1,sign1,step1,h);
+ FixError(x2,dx2,dy2,e2,sign2,step2,h);
+ h = 0;
+ }
+ } else {
+ while(1) {
+ if (x2 > x1)
+ (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
+ x1, y + yoffset, x2 - x1, 1);
+ else if (x1 > x2)
+ (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
+ x2, y + yoffset, x1 - x2, 1);
+ y++;
+ if (!--h) break;
+ Step(x1,dx1,dy1,e1,sign1,step1)
+ Step(x2,dx2,dy2,e2,sign2,step2)
+ }
+ }
+ } else {
+ if (x2 > x1)
+ (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
+ x1, y + yoffset, x2 - x1, h);
+ else if (x1 > x2)
+ (*infoRec->SubsequentSolidFillRect)(infoRec->pScrn,
+ x2, y + yoffset, x1 - x2, h);
+
+ y += h;
+ h = 0;
+ }
+ if (y == maxy) break;
+ }
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+
+
+void
+XAAFillPolygonHelper(
+ ScrnInfoPtr pScrn,
+ DDXPointPtr ptsIn,
+ int count,
+ DDXPointPtr topPoint,
+ int y,
+ int maxy,
+ int origin,
+ RectFuncPtr RectFunc,
+ TrapFuncPtr TrapFunc,
+ int xorg,
+ int yorg,
+ XAACacheInfoPtr pCache
+){
+ int *vertex1p, *vertex2p, *endp;
+ int vertex1, vertex2;
+ int x1 = 0, x2 = 0;
+ int dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0;
+ int DX1 = 0, DX2 = 0, e1 = 0, e2 = 0;
+ int step1 = 0, step2 = 0, sign1 = 0, sign2 = 0;
+ int c, h, yoffset;
+
+
+ endp = (int*)ptsIn + count;
+ vertex2p = vertex1p = (int *)topPoint;
+ yoffset = intToY(origin);
+ origin = intToX(origin);
+ vertex2 = vertex1 = *vertex2p++;
+ if (vertex2p == endp)
+ vertex2p = (int *)ptsIn;
+
+ while(1) {
+ if (y == intToY(vertex1)) {
+ do {
+ if (vertex1p == (int *) ptsIn)
+ vertex1p = endp;
+ c = *--vertex1p;
+ Setup (c,x1,vertex1,dx1,dy1,e1,sign1,step1,DX1)
+ } while (y >= intToY(vertex1));
+ h = dy1;
+ } else {
+ Step(x1,dx1,dy1,e1,sign1,step1)
+ h = intToY(vertex1) - y;
+ }
+ if (y == intToY(vertex2)) {
+ do {
+ c = *vertex2p++;
+ if (vertex2p == endp)
+ vertex2p = (int *) ptsIn;
+ Setup (c,x2,vertex2,dx2,dy2,e2,sign2,step2,DX2)
+ } while (y >= intToY(vertex2));
+ if (dy2 < h)
+ h = dy2;
+ } else {
+ Step(x2,dx2,dy2,e2,sign2,step2)
+ if ((c = (intToY(vertex2) - y)) < h)
+ h = c;
+ }
+
+ /* fill spans for this segment */
+ if(DX1 | DX2) {
+ if(TrapFunc && (h > 6)) {
+ if(x1 == x2) {
+ while(x1 == x2) {
+ y++;
+ if (!--h) break;
+ Step(x1,dx1,dy1,e1,sign1,step1)
+ Step(x2,dx2,dy2,e2,sign2,step2)
+ }
+ if(y == maxy) break;
+ if(!h) continue;
+ }
+
+ if(x1 < x2)
+ (*TrapFunc)(pScrn, y + yoffset, h,
+ x1, DX1, dy1, e1,
+ x2 - 1, DX2, dy2, e2, xorg, yorg, pCache);
+ else
+ (*TrapFunc)(pScrn, y + yoffset, h,
+ x2, DX2, dy2, e2,
+ x1 - 1, DX1, dy1, e1, xorg, yorg, pCache);
+ y += h;
+ if(--h) {
+ FixError(x1,dx1,dy1,e1,sign1,step1,h);
+ FixError(x2,dx2,dy2,e2,sign2,step2,h);
+ h = 0;
+ }
+ } else {
+ while(1) {
+ if (x2 > x1)
+ (*RectFunc)(pScrn,
+ x1, y + yoffset, x2 - x1, 1, xorg, yorg, pCache);
+ else if (x1 > x2)
+ (*RectFunc)(pScrn,
+ x2, y + yoffset, x1 - x2, 1, xorg, yorg, pCache);
+ y++;
+ if (!--h) break;
+ Step(x1,dx1,dy1,e1,sign1,step1)
+ Step(x2,dx2,dy2,e2,sign2,step2)
+ }
+ }
+ } else {
+ if (x2 > x1)
+ (*RectFunc)(pScrn,
+ x1, y + yoffset, x2 - x1, h, xorg, yorg, pCache);
+ else if (x1 > x2)
+ (*RectFunc)(pScrn,
+ x2, y + yoffset, x1 - x2, h, xorg, yorg, pCache);
+
+ y += h;
+ h = 0;
+ }
+ if (y == maxy) break;
+ }
+}
+
+ /*****************\
+ | Solid Helpers |
+ \*****************/
+
+static void
+SolidTrapHelper(
+ ScrnInfoPtr pScrn,
+ int y, int h,
+ int x1, int dx1, int dy1, int e1,
+ int x2, int dx2, int dy2, int e2,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->SubsequentSolidFillTrap) (pScrn,
+ y, h, x1, dx1, dy1, e1, x2, dx2, dy2, e2);
+}
+
+static void
+SolidRectHelper (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h);
+}
+
+
+ /*********************\
+ | Mono 8x8 Patterns |
+ \*********************/
+
+static void
+Mono8x8PatternTrapHelper_ScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int y, int h,
+ int x1, int dx1, int dy1, int e1,
+ int x2, int dx2, int dy2, int e2,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->SubsequentMono8x8PatternFillTrap) (pScrn, xorg, yorg,
+ y, h, x1, dx1, dy1, e1, x2, dx2, dy2, e2);
+}
+
+static void
+Mono8x8PatternRectHelper_ScreenOrigin (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, xorg, yorg,
+ x, y, w, h);
+}
+
+static void
+Mono8x8PatternRectHelper (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ xorg = (x - xorg) & 0x07;
+ yorg = (y - yorg) & 0x07;
+
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_BITS) {
+ int patx = pCache->pat0;
+ int paty = pCache->pat1;
+ XAARotateMonoPattern(&patx, &paty, xorg, yorg,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ xorg = patx; yorg = paty;
+ } else {
+ int slot = (yorg << 3) + xorg;
+ xorg = pCache->x + pCache->offsets[slot].x;
+ yorg = pCache->y + pCache->offsets[slot].y;
+ }
+ }
+
+
+ (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, xorg, yorg,
+ x, y, w, h);
+}
+
+
+
+ /****************\
+ | Cache Expand |
+ \****************/
+
+
+static void
+CacheExpandRectHelper (
+ ScrnInfoPtr pScrn,
+ int X, int Y, int Width, int Height,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int x, phaseY, phaseX, skipleft, w, blit_w, blit_h;
+ int cacheWidth;
+
+ cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
+ infoRec->CacheColorExpandDensity;
+
+ phaseY = (Y - yorg) % pCache->orig_h;
+ if(phaseY < 0) phaseY += pCache->orig_h;
+ phaseX = (X - xorg) % pCache->orig_w;
+ if(phaseX < 0) phaseX += pCache->orig_w;
+
+ while(1) {
+ w = Width; skipleft = phaseX; x = X;
+ blit_h = pCache->h - phaseY;
+ if(blit_h > Height) blit_h = Height;
+
+ while(1) {
+ blit_w = cacheWidth - skipleft;
+ if(blit_w > w) blit_w = w;
+ (*infoRec->SubsequentScreenToScreenColorExpandFill)(
+ pScrn, x, Y, blit_w, blit_h,
+ pCache->x, pCache->y + phaseY, skipleft);
+ w -= blit_w;
+ if(!w) break;
+ x += blit_w;
+ skipleft = (skipleft + blit_w) % pCache->orig_w;
+ }
+ Height -= blit_h;
+ if(!Height) break;
+ Y += blit_h;
+ phaseY = (phaseY + blit_h) % pCache->orig_h;
+ }
+}
+
+
+
+ /**************\
+ | Cache Blit |
+ \**************/
+
+
+static void
+CacheBltRectHelper (
+ ScrnInfoPtr pScrn,
+ int X, int Y, int Width, int Height,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int x, phaseY, phaseX, skipleft, w, blit_w, blit_h;
+
+ phaseY = (Y - yorg) % pCache->orig_h;
+ if(phaseY < 0) phaseY += pCache->orig_h;
+ phaseX = (X - xorg) % pCache->orig_w;
+ if(phaseX < 0) phaseX += pCache->orig_w;
+
+ while(1) {
+ w = Width; skipleft = phaseX; x = X;
+ blit_h = pCache->h - phaseY;
+ if(blit_h > Height) blit_h = Height;
+
+ while(1) {
+ blit_w = pCache->w - skipleft;
+ if(blit_w > w) blit_w = w;
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pCache->x + skipleft, pCache->y + phaseY,
+ x, Y, blit_w, blit_h);
+ w -= blit_w;
+ if(!w) break;
+ x += blit_w;
+ skipleft = (skipleft + blit_w) % pCache->orig_w;
+ }
+ Height -= blit_h;
+ if(!Height) break;
+ Y += blit_h;
+ phaseY = (phaseY + blit_h) % pCache->orig_h;
+ }
+}
+
+
+ /**********************\
+ | Stippled Polygons |
+ \**********************/
+
+
+void
+XAAFillPolygonStippled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+ int origin, type, patx, paty, fg, bg;
+ int y, maxy, xorg, yorg;
+ DDXPointPtr topPoint;
+ XAACacheInfoPtr pCache = NULL;
+ RectFuncPtr RectFunc = NULL;
+ TrapFuncPtr TrapFunc = NULL;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ if (mode == CoordModePrevious) {
+ register DDXPointPtr ppt = ptsIn + 1;
+
+ for (origin = 1; origin < count; origin++, ppt++) {
+ ppt->x += (ppt-1)->x;
+ ppt->y += (ppt-1)->y;
+ }
+ mode = CoordModeOrigin;
+ }
+
+ if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
+ miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
+ return;
+ }
+
+
+ if(pGC->fillStyle == FillStippled) {
+ type = (*infoRec->StippledFillChooser)(pGC);
+ fg = pGC->fgPixel; bg = -1;
+ } else {
+ type = (*infoRec->OpaqueStippledFillChooser)(pGC);
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ }
+
+
+ if(!type) {
+ (*XAAFallbackOps.FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ return;
+ }
+
+ if((type == DO_COLOR_EXPAND) || (type == DO_COLOR_8x8)) {
+ miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
+ return;
+ }
+
+ origin = *((int *)&pDraw->x);
+
+ switch( XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
+ origin, &topPoint, &y, &maxy, shape) ) {
+ case POLY_USE_MI:
+ miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
+ case POLY_FULLY_CLIPPED:
+ return;
+ }
+
+ xorg = (pDraw->x + pGC->patOrg.x);
+ yorg = (pDraw->y + pGC->patOrg.y);
+
+
+ if((fg == bg) && (bg != -1) && infoRec->SetupForSolidFill) {
+
+ (*infoRec->SetupForSolidFill)(infoRec->pScrn, fg,
+ pGC->alu, pGC->planemask);
+
+ RectFunc = SolidRectHelper;
+ TrapFunc = infoRec->SubsequentSolidFillTrap ? SolidTrapHelper : NULL;
+ } else
+ switch(type) {
+ case DO_MONO_8x8:
+ patx = pPriv->pattern0; paty = pPriv->pattern1;
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_SCREEN_ORIGIN) {
+ xorg = (-xorg) & 0x07; yorg = (-yorg) & 0x07;
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_BITS) {
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
+ XAARotateMonoPattern(&patx, &paty, xorg, yorg,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ xorg = patx; yorg = paty;
+ }
+ } else {
+ XAACacheInfoPtr pCache = (*infoRec->CacheMono8x8Pattern)(
+ infoRec->pScrn, patx, paty);
+ patx = pCache->x; paty = pCache->y;
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ int slot = (yorg << 3) + xorg;
+ patx += pCache->offsets[slot].x;
+ paty += pCache->offsets[slot].y;
+ xorg = patx; yorg = paty;
+ }
+ }
+ RectFunc = Mono8x8PatternRectHelper_ScreenOrigin;
+ if(infoRec->SubsequentMono8x8PatternFillTrap)
+ TrapFunc = Mono8x8PatternTrapHelper_ScreenOrigin;
+ } else { /* !HARDWARE_PATTERN_SCREEN_ORIGIN */
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_BITS)){
+ pCache = (*infoRec->CacheMono8x8Pattern)(
+ infoRec->pScrn, patx, paty);
+ patx = pCache->x; paty = pCache->y;
+ }
+ RectFunc = Mono8x8PatternRectHelper;
+ }
+
+ (*infoRec->SetupForMono8x8PatternFill)(infoRec->pScrn,
+ patx, paty, fg, bg, pGC->alu, pGC->planemask);
+ break;
+ case DO_CACHE_EXPAND:
+ pCache = (*infoRec->CacheMonoStipple)(infoRec->pScrn, pGC->stipple);
+
+ (*infoRec->SetupForScreenToScreenColorExpandFill)(
+ infoRec->pScrn, fg, bg, pGC->alu, pGC->planemask);
+
+ RectFunc = CacheExpandRectHelper;
+ break;
+ case DO_CACHE_BLT:
+ pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
+ fg, bg);
+ (*infoRec->SetupForScreenToScreenCopy)(infoRec->pScrn, 1, 1,
+ pGC->alu, pGC->planemask, pCache->trans_color);
+
+ RectFunc = CacheBltRectHelper;
+ break;
+ default:
+ return;
+ }
+
+
+ XAAFillPolygonHelper(infoRec->pScrn, ptsIn, count, topPoint,
+ y, maxy, origin, RectFunc, TrapFunc, xorg, yorg, pCache);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+
+
+ /*******************\
+ | Tiled Polygons |
+ \*******************/
+
+
+void
+XAAFillPolygonTiled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ int origin, type, patx, paty;
+ int y, maxy, xorg, yorg;
+ DDXPointPtr topPoint;
+ XAACacheInfoPtr pCache = NULL;
+ RectFuncPtr RectFunc = NULL;
+ TrapFuncPtr TrapFunc = NULL;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ if (mode == CoordModePrevious) {
+ register DDXPointPtr ppt = ptsIn + 1;
+
+ for (origin = 1; origin < count; origin++, ppt++) {
+ ppt->x += (ppt-1)->x;
+ ppt->y += (ppt-1)->y;
+ }
+ mode = CoordModeOrigin;
+ }
+
+ if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
+ miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
+ return;
+ }
+
+
+ type = (*infoRec->TiledFillChooser)(pGC);
+
+ if(!type || (type == DO_IMAGE_WRITE)) {
+ (*XAAFallbackOps.FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ return;
+ }
+
+ if(type == DO_COLOR_8x8) {
+ miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
+ return;
+ }
+
+ origin = *((int *)&pDraw->x);
+
+ switch( XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents,
+ origin, &topPoint, &y, &maxy, shape) ) {
+ case POLY_USE_MI:
+ miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
+ case POLY_FULLY_CLIPPED:
+ return;
+ }
+
+ xorg = (pDraw->x + pGC->patOrg.x);
+ yorg = (pDraw->y + pGC->patOrg.y);
+
+ switch(type) {
+ case DO_MONO_8x8:
+ patx = pPriv->pattern0; paty = pPriv->pattern1;
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_SCREEN_ORIGIN) {
+ xorg = (-xorg) & 0x07; yorg = (-yorg) & 0x07;
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_BITS) {
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
+ XAARotateMonoPattern(&patx, &paty, xorg, yorg,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ xorg = patx; yorg = paty;
+ }
+ } else {
+ XAACacheInfoPtr pCache = (*infoRec->CacheMono8x8Pattern)(
+ infoRec->pScrn, patx, paty);
+ patx = pCache->x; paty = pCache->y;
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ int slot = (yorg << 3) + xorg;
+ patx += pCache->offsets[slot].x;
+ paty += pCache->offsets[slot].y;
+ xorg = patx; yorg = paty;
+ }
+ }
+ RectFunc = Mono8x8PatternRectHelper_ScreenOrigin;
+ if(infoRec->SubsequentMono8x8PatternFillTrap)
+ TrapFunc = Mono8x8PatternTrapHelper_ScreenOrigin;
+ } else { /* !HARDWARE_PATTERN_SCREEN_ORIGIN */
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_BITS)){
+ pCache = (*infoRec->CacheMono8x8Pattern)(
+ infoRec->pScrn, patx, paty);
+ patx = pCache->x; paty = pCache->y;
+ }
+ else {
+ pCache = &(infoRec->ScratchCacheInfoRec);
+ pCache->pat0 = patx;
+ pCache->pat1 = paty;
+ }
+ RectFunc = Mono8x8PatternRectHelper;
+ }
+
+ (*infoRec->SetupForMono8x8PatternFill)(infoRec->pScrn,
+ patx, paty, pPriv->fg, pPriv->bg, pGC->alu, pGC->planemask);
+ break;
+ case DO_CACHE_BLT:
+ pCache = (*infoRec->CacheTile)(infoRec->pScrn, pGC->tile.pixmap);
+ (*infoRec->SetupForScreenToScreenCopy)(infoRec->pScrn, 1, 1,
+ pGC->alu, pGC->planemask, -1);
+
+ RectFunc = CacheBltRectHelper;
+ break;
+ case DO_PIXMAP_COPY:
+ pCache = &(infoRec->ScratchCacheInfoRec);
+ pCache->x = pPriv->offscreenArea->box.x1;
+ pCache->y = pPriv->offscreenArea->box.y1;
+ pCache->w = pCache->orig_w =
+ pPriv->offscreenArea->box.x2 - pCache->x;
+ pCache->h = pCache->orig_h =
+ pPriv->offscreenArea->box.y2 - pCache->y;
+
+ (*infoRec->SetupForScreenToScreenCopy)(infoRec->pScrn, 1, 1,
+ pGC->alu, pGC->planemask, -1);
+
+ RectFunc = CacheBltRectHelper;
+ break;
+ default:
+ return;
+ }
+
+ XAAFillPolygonHelper(infoRec->pScrn, ptsIn, count, topPoint,
+ y, maxy, origin, RectFunc, TrapFunc, xorg, yorg, pCache);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
diff --git a/hw/xfree86/xaa/xaaFillRect.c b/hw/xfree86/xaa/xaaFillRect.c
new file mode 100644
index 000000000..1d9cd54c1
--- /dev/null
+++ b/hw/xfree86/xaa/xaaFillRect.c
@@ -0,0 +1,1093 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaFillRect.c,v 1.15 2001/12/13 18:01:51 eich Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+
+static void XAARenderSolidRects(GCPtr, int, BoxPtr, int, int);
+static void XAARenderColor8x8Rects(GCPtr, int, BoxPtr, int, int);
+static void XAARenderMono8x8Rects(GCPtr, int, BoxPtr, int, int);
+static void XAARenderColorExpandRects(GCPtr, int, BoxPtr, int, int);
+static void XAARenderCacheExpandRects(GCPtr, int, BoxPtr, int, int);
+static void XAARenderCacheBltRects(GCPtr, int, BoxPtr, int, int);
+static void XAARenderImageWriteRects(GCPtr, int, BoxPtr, int, int);
+static void XAARenderPixmapCopyRects(GCPtr, int, BoxPtr, int, int);
+
+void
+XAAPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill, /* number of rectangles to fill */
+ xRectangle *prectInit /* Pointer to first rectangle to fill */
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int xorg = pDraw->x;
+ int yorg = pDraw->y;
+ int type = 0;
+ ClipAndRenderRectsFunc function;
+
+ if((nrectFill <= 0) || !pGC->planemask)
+ return;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ switch(pGC->fillStyle) {
+ case FillSolid:
+ type = DO_SOLID;
+ break;
+ case FillStippled:
+ type = (*infoRec->StippledFillChooser)(pGC);
+ break;
+ case FillOpaqueStippled:
+ if((pGC->fgPixel == pGC->bgPixel) && infoRec->FillSolidRects &&
+ CHECK_PLANEMASK(pGC,infoRec->FillSolidRectsFlags) &&
+ CHECK_ROP(pGC,infoRec->FillSolidRectsFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillSolidRectsFlags) &&
+ CHECK_FG(pGC,infoRec->FillSolidRectsFlags))
+ type = DO_SOLID;
+ else
+ type = (*infoRec->OpaqueStippledFillChooser)(pGC);
+ break;
+ case FillTiled:
+ type = (*infoRec->TiledFillChooser)(pGC);
+ break;
+ }
+
+ switch(type) {
+ case DO_SOLID:
+ function = XAARenderSolidRects;
+ break;
+ case DO_COLOR_8x8:
+ function = XAARenderColor8x8Rects;
+ break;
+ case DO_MONO_8x8:
+ function = XAARenderMono8x8Rects;
+ break;
+ case DO_CACHE_BLT:
+ function = XAARenderCacheBltRects;
+ break;
+ case DO_COLOR_EXPAND:
+ function = XAARenderColorExpandRects;
+ break;
+ case DO_CACHE_EXPAND:
+ function = XAARenderCacheExpandRects;
+ break;
+ case DO_IMAGE_WRITE:
+ function = XAARenderImageWriteRects;
+ break;
+ case DO_PIXMAP_COPY:
+ function = XAARenderPixmapCopyRects;
+ break;
+ default:
+ (*XAAFallbackOps.PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ return;
+ }
+
+ if(xorg | yorg) {
+ int n = nrectFill;
+ xRectangle *prect = prectInit;
+
+ while(n--) {
+ prect->x += xorg;
+ prect->y += yorg;
+ prect++;
+ }
+ }
+
+
+ XAAClipAndRenderRects(pGC, function, nrectFill, prectInit, xorg, yorg);
+}
+
+
+
+ /*********************\
+ | Solid Rects |
+ \*********************/
+
+static void
+XAARenderSolidRects(
+ GCPtr pGC,
+ int nboxes,
+ BoxPtr pClipBoxes,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ (*infoRec->FillSolidRects) (infoRec->pScrn,
+ pGC->fgPixel, pGC->alu, pGC->planemask, nboxes, pClipBoxes);
+}
+
+
+ /************************\
+ | Mono 8x8 Rects |
+ \************************/
+
+static void
+XAARenderMono8x8Rects(
+ GCPtr pGC,
+ int nboxes,
+ BoxPtr pClipBoxes,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAAPixmapPtr pPriv;
+ int fg, bg;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+ fg = pGC->fgPixel; bg = -1;
+ break;
+ case FillOpaqueStippled:
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ break;
+ case FillTiled:
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ fg = pPriv->fg; bg = pPriv->bg;
+ break;
+ default: /* Muffle compiler */
+ pPriv = NULL; /* Kaboom */
+ fg = -1; bg = -1;
+ break;
+ }
+
+ (*infoRec->FillMono8x8PatternRects) (infoRec->pScrn,
+ fg, bg, pGC->alu, pGC->planemask,
+ nboxes, pClipBoxes, pPriv->pattern0, pPriv->pattern1,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y));
+}
+
+ /*************************\
+ | Color 8x8 Rects |
+ \*************************/
+
+static void
+XAARenderColor8x8Rects(
+ GCPtr pGC,
+ int nboxes,
+ BoxPtr pClipBoxes,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAACacheInfoPtr pCache;
+ PixmapPtr pPix;
+ int fg, bg;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ pPix = pGC->stipple;
+ fg = pGC->fgPixel; bg = -1;
+ break;
+ case FillOpaqueStippled:
+ pPix = pGC->stipple;
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ break;
+ case FillTiled:
+ pPix = pGC->tile.pixmap;
+ fg = -1; bg = -1;
+ break;
+ default: /* Muffle compiler */
+ pPix = NULL;
+ fg = -1; bg = -1;
+ break;
+ }
+
+ pCache = (*infoRec->CacheColor8x8Pattern)(infoRec->pScrn, pPix, fg, bg);
+ (*infoRec->FillColor8x8PatternRects) (infoRec->pScrn,
+ pGC->alu, pGC->planemask, nboxes, pClipBoxes,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y), pCache);
+}
+
+
+ /****************************\
+ | Color Expand Rects |
+ \****************************/
+
+static void
+XAARenderColorExpandRects(
+ GCPtr pGC,
+ int nboxes,
+ BoxPtr pClipBoxes,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int fg, bg;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ fg = pGC->fgPixel; bg = -1;
+ break;
+ case FillOpaqueStippled:
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ break;
+ default: /* Muffle compiler */
+ fg = -1; bg = -1;
+ break;
+ }
+
+ (*infoRec->FillColorExpandRects) (infoRec->pScrn, fg, bg,
+ pGC->alu, pGC->planemask, nboxes, pClipBoxes,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
+ pGC->stipple);
+}
+
+
+ /*************************\
+ | Cache Blt Rects |
+ \*************************/
+
+static void
+XAARenderCacheBltRects(
+ GCPtr pGC,
+ int nboxes,
+ BoxPtr pClipBoxes,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAACacheInfoPtr pCache;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
+ pGC->fgPixel, -1);
+ break;
+ case FillOpaqueStippled:
+ pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
+ pGC->fgPixel, pGC->bgPixel);
+ break;
+ case FillTiled:
+ pCache = (*infoRec->CacheTile)(infoRec->pScrn, pGC->tile.pixmap);
+ break;
+ default: /* Muffle compiler */
+ pCache = NULL;
+ break;
+ }
+
+ (*infoRec->FillCacheBltRects) (infoRec->pScrn, pGC->alu,
+ pGC->planemask, nboxes, pClipBoxes,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y), pCache);
+}
+
+
+ /****************************\
+ | Cache Expand Rects |
+ \****************************/
+
+static void
+XAARenderCacheExpandRects(
+ GCPtr pGC,
+ int nboxes,
+ BoxPtr pClipBoxes,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int fg, bg;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ fg = pGC->fgPixel; bg = -1;
+ break;
+ case FillOpaqueStippled:
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ break;
+ default: /* Muffle compiler */
+ fg = -1; bg = -1;
+ break;
+ }
+
+ (*infoRec->FillCacheExpandRects) (infoRec->pScrn, fg, bg,
+ pGC->alu, pGC->planemask, nboxes, pClipBoxes,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
+ pGC->stipple);
+}
+
+
+
+ /***************************\
+ | Image Write Rects |
+ \***************************/
+
+static void
+XAARenderImageWriteRects(
+ GCPtr pGC,
+ int nboxes,
+ BoxPtr pClipBoxes,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ (*infoRec->FillImageWriteRects) (infoRec->pScrn, pGC->alu,
+ pGC->planemask, nboxes, pClipBoxes,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
+ pGC->tile.pixmap);
+}
+
+
+
+ /***************************\
+ | Pixmap Copy Rects |
+ \***************************/
+
+static void
+XAARenderPixmapCopyRects(
+ GCPtr pGC,
+ int nboxes,
+ BoxPtr pClipBoxes,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+
+ pCache->x = pPriv->offscreenArea->box.x1;
+ pCache->y = pPriv->offscreenArea->box.y1;
+ pCache->w = pCache->orig_w =
+ pPriv->offscreenArea->box.x2 - pCache->x;
+ pCache->h = pCache->orig_h =
+ pPriv->offscreenArea->box.y2 - pCache->y;
+ pCache->trans_color = -1;
+
+ (*infoRec->FillCacheBltRects) (infoRec->pScrn, pGC->alu,
+ pGC->planemask, nboxes, pClipBoxes,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
+ pCache);
+}
+
+
+
+ /************\
+ | Solid |
+ \************/
+
+void
+XAAFillSolidRects(
+ ScrnInfoPtr pScrn,
+ int fg, int rop,
+ unsigned int planemask,
+ int nBox, /* number of rectangles to fill */
+ BoxPtr pBox /* Pointer to first rectangle to fill */
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->SetupForSolidFill)(pScrn, fg, rop, planemask);
+ while(nBox--) {
+ (*infoRec->SubsequentSolidFillRect)(pScrn, pBox->x1, pBox->y1,
+ pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
+ pBox++;
+ }
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+
+
+ /*********************\
+ | 8x8 Mono Patterns |
+ \*********************/
+
+
+void
+XAAFillMono8x8PatternRectsScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int pattern0, int pattern1,
+ int xorigin, int yorigin
+)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int patx = pattern0, paty = pattern1;
+ int xorg = (-xorigin) & 0x07;
+ int yorg = (-yorigin) & 0x07;
+
+
+ if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) {
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ XAARotateMonoPattern(&patx, &paty, xorg, yorg,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ xorg = patx; yorg = paty;
+ }
+ } else {
+ XAACacheInfoPtr pCache =
+ (*infoRec->CacheMono8x8Pattern)(pScrn, pattern0, pattern1);
+ patx = pCache->x; paty = pCache->y;
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ int slot = (yorg << 3) + xorg;
+ patx += pCache->offsets[slot].x;
+ paty += pCache->offsets[slot].y;
+ xorg = patx; yorg = paty;
+ }
+ }
+
+ (*infoRec->SetupForMono8x8PatternFill)(pScrn, patx, paty,
+ fg, bg, rop, planemask);
+
+ while(nBox--) {
+ (*infoRec->SubsequentMono8x8PatternFillRect)(pScrn,
+ xorg, yorg, pBox->x1, pBox->y1,
+ pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
+ pBox++;
+ }
+ SET_SYNC_FLAG(infoRec);
+}
+
+void
+XAAFillMono8x8PatternRects(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int pattern0, int pattern1,
+ int xorigin, int yorigin
+)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int patx = pattern0, paty = pattern1;
+ int xorg, yorg;
+ XAACacheInfoPtr pCache = NULL;
+
+
+ if(!(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS)){
+ pCache = (*infoRec->CacheMono8x8Pattern)(pScrn, pattern0, pattern1);
+ patx = pCache->x; paty = pCache->y;
+ }
+
+
+ (*infoRec->SetupForMono8x8PatternFill)(pScrn, patx, paty,
+ fg, bg, rop, planemask);
+
+
+ while(nBox--) {
+ xorg = (pBox->x1 - xorigin) & 0x07;
+ yorg = (pBox->y1 - yorigin) & 0x07;
+
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_BITS) {
+ patx = pattern0; paty = pattern1;
+ XAARotateMonoPattern(&patx, &paty, xorg, yorg,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ xorg = patx; yorg = paty;
+ } else {
+ int slot = (yorg << 3) + xorg;
+ xorg = patx + pCache->offsets[slot].x;
+ yorg = paty + pCache->offsets[slot].y;
+ }
+ }
+
+ (*infoRec->SubsequentMono8x8PatternFillRect)(pScrn,
+ xorg, yorg, pBox->x1, pBox->y1,
+ pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
+ pBox++;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+ /**********************\
+ | 8x8 Color Patterns |
+ \**********************/
+
+
+void
+XAAFillColor8x8PatternRectsScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorigin, int yorigin,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int patx = pCache->x, paty = pCache->y;
+ int xorg = (-xorigin) & 0x07;
+ int yorg = (-yorigin) & 0x07;
+
+ if(!(infoRec->Color8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ int slot = (yorg << 3) + xorg;
+ paty += pCache->offsets[slot].y;
+ patx += pCache->offsets[slot].x;
+ xorg = patx; yorg = paty;
+ }
+
+ (*infoRec->SetupForColor8x8PatternFill)(pScrn, patx, paty,
+ rop, planemask, pCache->trans_color);
+
+ while(nBox--) {
+ (*infoRec->SubsequentColor8x8PatternFillRect)(pScrn,
+ xorg, yorg, pBox->x1, pBox->y1,
+ pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
+ pBox++;
+ }
+ SET_SYNC_FLAG(infoRec);
+}
+
+void
+XAAFillColor8x8PatternRects(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorigin, int yorigin,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int xorg, yorg;
+
+ (*infoRec->SetupForColor8x8PatternFill)(pScrn, pCache->x, pCache->y,
+ rop, planemask, pCache->trans_color);
+
+ while(nBox--) {
+ xorg = (pBox->x1 - xorigin) & 0x07;
+ yorg = (pBox->y1 - yorigin) & 0x07;
+
+ if(!(infoRec->Color8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ int slot = (yorg << 3) + xorg;
+ yorg = pCache->y + pCache->offsets[slot].y;
+ xorg = pCache->x + pCache->offsets[slot].x;
+ }
+
+ (*infoRec->SubsequentColor8x8PatternFillRect)(pScrn,
+ xorg, yorg, pBox->x1, pBox->y1,
+ pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
+ pBox++;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+ /***************\
+ | Cache Blits |
+ \***************/
+
+void
+XAAFillCacheBltRects(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int x, y, phaseY, phaseX, skipleft, height, width, w, blit_w, blit_h;
+
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, rop, planemask,
+ pCache->trans_color);
+
+ while(nBox--) {
+ y = pBox->y1;
+ phaseY = (y - yorg) % pCache->orig_h;
+ if(phaseY < 0) phaseY += pCache->orig_h;
+ phaseX = (pBox->x1 - xorg) % pCache->orig_w;
+ if(phaseX < 0) phaseX += pCache->orig_w;
+ height = pBox->y2 - y;
+ width = pBox->x2 - pBox->x1;
+
+#if 0
+ if (rop == GXcopy) {
+ while(1) {
+ w = width; skipleft = phaseX; x = pBox->x1;
+ blit_h = pCache->h - phaseY;
+ if(blit_h > height) blit_h = height;
+
+ while(1) {
+ blit_w = pCache->w - skipleft;
+ if(blit_w > w) blit_w = w;
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pCache->x + skipleft, pCache->y + phaseY,
+ x, y, blit_w, blit_h);
+ w -= blit_w;
+ if(!w) break;
+ x += blit_w;
+ skipleft = (skipleft + blit_w) % pCache->orig_w;
+ if(blit_w >= pCache->orig_w) break;
+ }
+
+ /* Expand horizontally */
+ if (w) {
+ skipleft -= phaseX;
+ if (skipleft < 0) skipleft += pCache->orig_w;
+ blit_w = x - pBox->x1 - skipleft;
+ while(w) {
+ if (blit_w > w) blit_w = w;
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pBox->x1 + skipleft, y, x, y, blit_w, blit_h);
+ w -= blit_w;
+ x += blit_w;
+ blit_w <<= 1;
+ }
+ }
+
+ height -= blit_h;
+ if(!height) break;
+ y += blit_h;
+ phaseY = (phaseY + blit_h) % pCache->orig_h;
+ if(blit_h >= pCache->orig_h) break;
+ }
+
+ /* Expand vertically */
+ if (height) {
+ blit_w = pBox->x2 - pBox->x1;
+ phaseY -= (pBox->y1 - yorg) % pCache->orig_h;
+ if (phaseY < 0) phaseY += pCache->orig_h;
+ blit_h = y - pBox->y1 - phaseY;
+ while(height) {
+ if (blit_h > height) blit_h = height;
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pBox->x1,
+ pBox->y1 + phaseY, pBox->x1, y, blit_w, blit_h);
+ height -= blit_h;
+ y += blit_h;
+ blit_h <<= 1;
+ }
+ }
+ } else
+#endif
+ {
+ while(1) {
+ w = width; skipleft = phaseX; x = pBox->x1;
+ blit_h = pCache->h - phaseY;
+ if(blit_h > height) blit_h = height;
+
+ while(1) {
+ blit_w = pCache->w - skipleft;
+ if(blit_w > w) blit_w = w;
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pCache->x + skipleft, pCache->y + phaseY,
+ x, y, blit_w, blit_h);
+ w -= blit_w;
+ if(!w) break;
+ x += blit_w;
+ skipleft = (skipleft + blit_w) % pCache->orig_w;
+ }
+ height -= blit_h;
+ if(!height) break;
+ y += blit_h;
+ phaseY = (phaseY + blit_h) % pCache->orig_h;
+ }
+ }
+ pBox++;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+
+
+ /*******************\
+ | Cache Expansion |
+ \*******************/
+
+
+
+void
+XAAFillCacheExpandRects(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int x, y, phaseY, phaseX, skipleft, height, width, w, blit_w, blit_h;
+ int cacheWidth;
+ XAACacheInfoPtr pCache;
+
+ pCache = (*infoRec->CacheMonoStipple)(pScrn, pPix);
+
+ cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
+ infoRec->CacheColorExpandDensity;
+
+ (*infoRec->SetupForScreenToScreenColorExpandFill)(pScrn, fg, bg, rop,
+ planemask);
+
+ while(nBox--) {
+ y = pBox->y1;
+ phaseY = (y - yorg) % pCache->orig_h;
+ if(phaseY < 0) phaseY += pCache->orig_h;
+ phaseX = (pBox->x1 - xorg) % pCache->orig_w;
+ if(phaseX < 0) phaseX += pCache->orig_w;
+ height = pBox->y2 - y;
+ width = pBox->x2 - pBox->x1;
+
+ while(1) {
+ w = width; skipleft = phaseX; x = pBox->x1;
+ blit_h = pCache->h - phaseY;
+ if(blit_h > height) blit_h = height;
+
+ while(1) {
+ blit_w = cacheWidth - skipleft;
+ if(blit_w > w) blit_w = w;
+ (*infoRec->SubsequentScreenToScreenColorExpandFill)(
+ pScrn, x, y, blit_w, blit_h,
+ pCache->x, pCache->y + phaseY, skipleft);
+ w -= blit_w;
+ if(!w) break;
+ x += blit_w;
+ skipleft = (skipleft + blit_w) % pCache->orig_w;
+ }
+ height -= blit_h;
+ if(!height) break;
+ y += blit_h;
+ phaseY = (phaseY + blit_h) % pCache->orig_h;
+ }
+ pBox++;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+ /******************\
+ | Image Writes |
+ \******************/
+
+
+
+/* This requires all LEFT_EDGE clipping. You get too many problems
+ with reading past the edge of the pattern otherwise */
+
+static void
+WriteColumn(
+ ScrnInfoPtr pScrn,
+ unsigned char *pSrc,
+ int x, int y, int w, int h,
+ int xoff, int yoff,
+ int pHeight,
+ int srcwidth,
+ int Bpp
+) {
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ unsigned char *src;
+ Bool PlusOne = FALSE;
+ int skipleft, dwords;
+
+ pSrc += (Bpp * xoff);
+
+ if((skipleft = (long)pSrc & 0x03L)) {
+ if(Bpp == 3)
+ skipleft = 4 - skipleft;
+ else
+ skipleft /= Bpp;
+
+ x -= skipleft;
+ w += skipleft;
+
+ if(Bpp == 3)
+ pSrc -= 3 * skipleft;
+ else /* is this Alpha friendly ? */
+ pSrc = (unsigned char*)((long)pSrc & ~0x03L);
+ }
+
+ src = pSrc + (yoff * srcwidth);
+
+ dwords = ((w * Bpp) + 3) >> 2;
+
+ if((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
+ ((dwords * h) & 0x01)) {
+ PlusOne = TRUE;
+ }
+
+ (*infoRec->SubsequentImageWriteRect)(pScrn, x, y, w, h, skipleft);
+
+ if(dwords > infoRec->ImageWriteRange) {
+ while(h--) {
+ XAAMoveDWORDS_FixedBase((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords);
+ src += srcwidth;
+ yoff++;
+ if(yoff >= pHeight) {
+ yoff = 0;
+ src = pSrc;
+ }
+ }
+ } else {
+ if(srcwidth == (dwords << 2)) {
+ int maxLines = infoRec->ImageWriteRange/dwords;
+ int step;
+
+ while(h) {
+ step = pHeight - yoff;
+ if(step > maxLines) step = maxLines;
+ if(step > h) step = h;
+
+ XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords * step);
+
+ src += (srcwidth * step);
+ yoff += step;
+ if(yoff >= pHeight) {
+ yoff = 0;
+ src = pSrc;
+ }
+ h -= step;
+ }
+ } else {
+ while(h--) {
+ XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords);
+ src += srcwidth;
+ yoff++;
+ if(yoff >= pHeight) {
+ yoff = 0;
+ src = pSrc;
+ }
+ }
+ }
+ }
+
+ if(PlusOne) {
+ CARD32* base = (CARD32*)infoRec->ImageWriteBase;
+ *base = 0x00000000;
+ }
+}
+
+void
+XAAFillImageWriteRects(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int x, phaseY, phaseX, height, width, blit_w;
+ int pHeight = pPix->drawable.height;
+ int pWidth = pPix->drawable.width;
+ int Bpp = pPix->drawable.bitsPerPixel >> 3;
+ int srcwidth = pPix->devKind;
+
+ (*infoRec->SetupForImageWrite)(pScrn, rop, planemask, -1,
+ pPix->drawable.bitsPerPixel, pPix->drawable.depth);
+
+ while(nBox--) {
+ x = pBox->x1;
+ phaseY = (pBox->y1 - yorg) % pHeight;
+ if(phaseY < 0) phaseY += pHeight;
+ phaseX = (x - xorg) % pWidth;
+ if(phaseX < 0) phaseX += pWidth;
+ height = pBox->y2 - pBox->y1;
+ width = pBox->x2 - x;
+
+ while(1) {
+ blit_w = pWidth - phaseX;
+ if(blit_w > width) blit_w = width;
+
+ WriteColumn(pScrn, pPix->devPrivate.ptr, x, pBox->y1,
+ blit_w, height, phaseX, phaseY, pHeight, srcwidth, Bpp);
+
+ width -= blit_w;
+ if(!width) break;
+ x += blit_w;
+ phaseX = (phaseX + blit_w) % pWidth;
+ }
+ pBox++;
+ }
+
+ if(infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+}
+
+
+ /*************\
+ | Utilities |
+ \*************/
+
+
+void
+XAAClipAndRenderRects(
+ GCPtr pGC,
+ ClipAndRenderRectsFunc BoxFunc,
+ int nrectFill,
+ xRectangle *prect,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int Right, Bottom, MaxBoxes;
+ BoxPtr pextent, pboxClipped, pboxClippedBase;
+
+ MaxBoxes = infoRec->PreAllocSize/sizeof(BoxRec);
+ pboxClippedBase = (BoxPtr)infoRec->PreAllocMem;
+ pboxClipped = pboxClippedBase;
+
+ if (REGION_NUM_RECTS(pGC->pCompositeClip) == 1) {
+ pextent = REGION_RECTS(pGC->pCompositeClip);
+ while (nrectFill--) {
+ pboxClipped->x1 = max(pextent->x1, prect->x);
+ pboxClipped->y1 = max(pextent->y1, prect->y);
+
+ Right = (int)prect->x + (int)prect->width;
+ pboxClipped->x2 = min(pextent->x2, Right);
+
+ Bottom = (int)prect->y + (int)prect->height;
+ pboxClipped->y2 = min(pextent->y2, Bottom);
+
+ prect++;
+ if ((pboxClipped->x1 < pboxClipped->x2) &&
+ (pboxClipped->y1 < pboxClipped->y2)) {
+ pboxClipped++;
+ if(pboxClipped >= (pboxClippedBase + MaxBoxes)) {
+ (*BoxFunc)(pGC, MaxBoxes, pboxClippedBase, xorg, yorg);
+ pboxClipped = pboxClippedBase;
+ }
+ }
+ }
+ } else {
+ pextent = REGION_EXTENTS(pGC->pScreen, pGC->pCompositeClip);
+ while (nrectFill--) {
+ int n;
+ BoxRec box, *pbox;
+
+ box.x1 = max(pextent->x1, prect->x);
+ box.y1 = max(pextent->y1, prect->y);
+
+ Right = (int)prect->x + (int)prect->width;
+ box.x2 = min(pextent->x2, Right);
+
+ Bottom = (int)prect->y + (int)prect->height;
+ box.y2 = min(pextent->y2, Bottom);
+
+ prect++;
+
+ if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
+ continue;
+
+ n = REGION_NUM_RECTS (pGC->pCompositeClip);
+ pbox = REGION_RECTS(pGC->pCompositeClip);
+
+ /* clip the rectangle to each box in the clip region
+ this is logically equivalent to calling Intersect()
+ */
+ while(n--) {
+ pboxClipped->x1 = max(box.x1, pbox->x1);
+ pboxClipped->y1 = max(box.y1, pbox->y1);
+ pboxClipped->x2 = min(box.x2, pbox->x2);
+ pboxClipped->y2 = min(box.y2, pbox->y2);
+ pbox++;
+
+ /* see if clipping left anything */
+ if(pboxClipped->x1 < pboxClipped->x2 &&
+ pboxClipped->y1 < pboxClipped->y2) {
+ pboxClipped++;
+ if(pboxClipped >= (pboxClippedBase + MaxBoxes)) {
+ (*BoxFunc)(pGC, MaxBoxes, pboxClippedBase, xorg, yorg);
+ pboxClipped = pboxClippedBase;
+ }
+ }
+ }
+ }
+ }
+
+ if(pboxClipped != pboxClippedBase)
+ (*BoxFunc)(pGC, pboxClipped - pboxClippedBase, pboxClippedBase,
+ xorg, yorg);
+}
+
+
+int
+XAAGetRectClipBoxes(
+ RegionPtr prgnClip,
+ BoxPtr pboxClippedBase,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ int Right, Bottom;
+ BoxPtr pextent, pboxClipped = pboxClippedBase;
+ xRectangle *prect = prectInit;
+
+
+ if (REGION_NUM_RECTS(prgnClip) == 1) {
+ pextent = REGION_RECTS(prgnClip);
+ while (nrectFill--) {
+ pboxClipped->x1 = max(pextent->x1, prect->x);
+ pboxClipped->y1 = max(pextent->y1, prect->y);
+
+ Right = (int)prect->x + (int)prect->width;
+ pboxClipped->x2 = min(pextent->x2, Right);
+
+ Bottom = (int)prect->y + (int)prect->height;
+ pboxClipped->y2 = min(pextent->y2, Bottom);
+
+ prect++;
+ if ((pboxClipped->x1 < pboxClipped->x2) &&
+ (pboxClipped->y1 < pboxClipped->y2)) {
+ pboxClipped++;
+ }
+ }
+ } else {
+ pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
+ while (nrectFill--) {
+ int n;
+ BoxRec box, *pbox;
+
+ box.x1 = max(pextent->x1, prect->x);
+ box.y1 = max(pextent->y1, prect->y);
+
+ Right = (int)prect->x + (int)prect->width;
+ box.x2 = min(pextent->x2, Right);
+
+ Bottom = (int)prect->y + (int)prect->height;
+ box.y2 = min(pextent->y2, Bottom);
+
+ prect++;
+
+ if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
+ continue;
+
+ n = REGION_NUM_RECTS (prgnClip);
+ pbox = REGION_RECTS(prgnClip);
+
+ /* clip the rectangle to each box in the clip region
+ this is logically equivalent to calling Intersect()
+ */
+ while(n--) {
+ pboxClipped->x1 = max(box.x1, pbox->x1);
+ pboxClipped->y1 = max(box.y1, pbox->y1);
+ pboxClipped->x2 = min(box.x2, pbox->x2);
+ pboxClipped->y2 = min(box.y2, pbox->y2);
+ pbox++;
+
+ /* see if clipping left anything */
+ if(pboxClipped->x1 < pboxClipped->x2 &&
+ pboxClipped->y1 < pboxClipped->y2) {
+ pboxClipped++;
+ }
+ }
+ }
+ }
+
+ return(pboxClipped - pboxClippedBase);
+}
+
diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c
new file mode 100644
index 000000000..c9ef93a1b
--- /dev/null
+++ b/hw/xfree86/xaa/xaaGC.c
@@ -0,0 +1,653 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaGC.c,v 1.19 2001/02/19 22:19:50 mvojkovi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "migc.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "xaawrap.h"
+
+static void XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw);
+static void XAAChangeGC(GCPtr pGC, unsigned long mask);
+static void XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
+static void XAADestroyGC(GCPtr pGC);
+static void XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects);
+static void XAADestroyClip(GCPtr pGC);
+static void XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc);
+
+GCFuncs XAAGCFuncs = {
+ XAAValidateGC, XAAChangeGC, XAACopyGC, XAADestroyGC,
+ XAAChangeClip, XAADestroyClip, XAACopyClip
+};
+
+extern GCOps XAAPixmapOps;
+
+Bool
+XAACreateGC(GCPtr pGC)
+{
+ ScreenPtr pScreen = pGC->pScreen;
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);
+ Bool ret;
+
+ XAA_SCREEN_PROLOGUE(pScreen,CreateGC);
+
+ if((ret = (*pScreen->CreateGC)(pGC))) {
+ pGCPriv->wrapOps = NULL;
+ pGCPriv->wrapFuncs = pGC->funcs;
+ pGCPriv->XAAOps = &XAAFallbackOps;
+ pGCPriv->flags = 0;
+ pGCPriv->DashLength = 0;
+ pGCPriv->DashPattern = NULL;
+ pGCPriv->changes = 0;
+ /* initialize any other private fields here */
+ pGC->funcs = &XAAGCFuncs;
+ }
+
+ XAA_SCREEN_EPILOGUE(pScreen,CreateGC,XAACreateGC);
+
+ return ret;
+}
+
+
+static void
+XAAValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAA_GC_FUNC_PROLOGUE(pGC);
+
+ (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
+
+ if((changes & GCPlaneMask) &&
+ ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) ==
+ infoRec->FullPlanemasks[pGC->depth - 1]))
+ {
+ pGC->planemask = ~0;
+ }
+
+ if(pGC->depth != 32) {
+ if(pGC->bgPixel == -1) /* -1 is reserved for transparency */
+ pGC->bgPixel = 0x7fffffff;
+ if(pGC->fgPixel == -1) /* -1 is reserved for transparency */
+ pGC->fgPixel = 0x7fffffff;
+ }
+
+ if((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)){
+ pGCPriv->flags = OPS_ARE_PIXMAP;
+ pGCPriv->changes |= changes;
+
+ /* make sure we're not using videomemory pixmaps to render
+ onto system memory drawables */
+
+ if((pGC->fillStyle == FillTiled) &&
+ IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
+ !OFFSCREEN_PIXMAP_LOCKED(pGC->tile.pixmap)) {
+
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ FBAreaPtr area = pPriv->offscreenArea;
+
+ XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */
+ xf86FreeOffscreenArea(area);
+ }
+ }
+ else if(!infoRec->pScrn->vtSema && (pDraw->type == DRAWABLE_WINDOW)) {
+ pGCPriv->flags = 0;
+ pGCPriv->changes |= changes;
+ }
+ else {
+ if(!(pGCPriv->flags & OPS_ARE_ACCEL)) {
+ changes |= pGCPriv->changes;
+ pGCPriv->changes = 0;
+ }
+ pGCPriv->flags = OPS_ARE_ACCEL;
+
+#if 1
+ /* Ugh. If we can't use the blitter on offscreen pixmaps used
+ as tiles, then we need to move them out as cfb can't handle
+ tiles with non-zero origins */
+
+ if((pGC->fillStyle == FillTiled) &&
+ IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) &&
+ (DO_PIXMAP_COPY != (*infoRec->TiledFillChooser)(pGC))) {
+
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ FBAreaPtr area = pPriv->offscreenArea;
+
+ XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */
+ xf86FreeOffscreenArea(area);
+ }
+#endif
+ }
+
+ XAA_GC_FUNC_EPILOGUE(pGC);
+
+ if(!(pGCPriv->flags & OPS_ARE_ACCEL)) return;
+
+ if((changes & GCTile) && !pGC->tileIsPixel && pGC->tile.pixmap){
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+
+ if(pixPriv->flags & DIRTY) {
+ pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
+ pGC->tile.pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+ }
+ if((changes & GCStipple) && pGC->stipple){
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+
+ if(pixPriv->flags & DIRTY) {
+ pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
+ pGC->stipple->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+ }
+
+ /* If our Ops are still the default ones we need to allocate new ones */
+ if(pGC->ops == &XAAFallbackOps) {
+ if(!(pGCPriv->XAAOps = xalloc(sizeof(GCOps)))) {
+ pGCPriv->XAAOps = &XAAFallbackOps;
+ return;
+ }
+ /* make a modifiable copy of the default ops */
+ memcpy(pGCPriv->XAAOps, &XAAFallbackOps, sizeof(GCOps));
+ pGC->ops = pGCPriv->XAAOps;
+ changes = ~0;
+ }
+
+ if(!changes) return;
+
+ if((changes & GCDashList) && infoRec->ComputeDash)
+ infoRec->ComputeDash(pGC);
+
+ if(changes & infoRec->FillSpansMask)
+ (*infoRec->ValidateFillSpans)(pGC, changes, pDraw);
+
+ if(changes & infoRec->SetSpansMask)
+ (*infoRec->ValidateSetSpans)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PutImageMask)
+ (*infoRec->ValidatePutImage)(pGC, changes, pDraw);
+
+ if(changes & infoRec->CopyAreaMask)
+ (*infoRec->ValidateCopyArea)(pGC, changes, pDraw);
+
+ if(changes & infoRec->CopyPlaneMask)
+ (*infoRec->ValidateCopyPlane)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyPointMask)
+ (*infoRec->ValidatePolyPoint)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolylinesMask)
+ (*infoRec->ValidatePolylines)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolySegmentMask)
+ (*infoRec->ValidatePolySegment)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyRectangleMask)
+ (*infoRec->ValidatePolyRectangle)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyArcMask)
+ (*infoRec->ValidatePolyArc)(pGC, changes, pDraw);
+
+ if(changes & infoRec->FillPolygonMask)
+ (*infoRec->ValidateFillPolygon)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyFillRectMask)
+ (*infoRec->ValidatePolyFillRect)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyFillArcMask)
+ (*infoRec->ValidatePolyFillArc)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyGlyphBltMask)
+ (*infoRec->ValidatePolyGlyphBlt)(pGC, changes, pDraw);
+
+ if(changes & infoRec->ImageGlyphBltMask)
+ (*infoRec->ValidateImageGlyphBlt)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyText8Mask)
+ (*infoRec->ValidatePolyText8)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PolyText16Mask)
+ (*infoRec->ValidatePolyText16)(pGC, changes, pDraw);
+
+ if(changes & infoRec->ImageText8Mask)
+ (*infoRec->ValidateImageText8)(pGC, changes, pDraw);
+
+ if(changes & infoRec->ImageText16Mask)
+ (*infoRec->ValidateImageText16)(pGC, changes, pDraw);
+
+ if(changes & infoRec->PushPixelsMask)
+ (*infoRec->ValidatePushPixels)(pGC, changes, pDraw);
+}
+
+
+static void
+XAADestroyGC(GCPtr pGC)
+{
+ XAA_GC_FUNC_PROLOGUE (pGC);
+
+ if(pGCPriv->XAAOps != &XAAFallbackOps)
+ xfree(pGCPriv->XAAOps);
+
+ if(pGCPriv->DashPattern)
+ xfree(pGCPriv->DashPattern);
+
+ (*pGC->funcs->DestroyGC)(pGC);
+ XAA_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+XAAChangeGC (
+ GCPtr pGC,
+ unsigned long mask
+)
+{
+ XAA_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeGC) (pGC, mask);
+ XAA_GC_FUNC_EPILOGUE (pGC);
+
+ /* we have to assume that shared memory pixmaps are dirty
+ because we can't wrap all operations on them */
+
+ if((mask & GCTile) && !pGC->tileIsPixel &&
+ PIXMAP_IS_SHARED(pGC->tile.pixmap))
+ {
+ XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ pPixPriv->flags |= DIRTY;
+ }
+
+ if((mask & GCStipple) && PIXMAP_IS_SHARED(pGC->stipple)){
+ XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+ pPixPriv->flags |= DIRTY;
+ }
+}
+
+static void
+XAACopyGC (
+ GCPtr pGCSrc,
+ unsigned long mask,
+ GCPtr pGCDst)
+{
+ XAA_GC_FUNC_PROLOGUE (pGCDst);
+ (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
+ XAA_GC_FUNC_EPILOGUE (pGCDst);
+}
+static void
+XAAChangeClip (
+ GCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects )
+{
+ XAA_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
+ XAA_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc)
+{
+ XAA_GC_FUNC_PROLOGUE (pgcDst);
+ (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
+ XAA_GC_FUNC_EPILOGUE (pgcDst);
+}
+
+static void
+XAADestroyClip(GCPtr pGC)
+{
+ XAA_GC_FUNC_PROLOGUE (pGC);
+ (* pGC->funcs->DestroyClip)(pGC);
+ XAA_GC_FUNC_EPILOGUE (pGC);
+}
+
+/**** Pixmap Wrappers ****/
+
+
+
+static void
+XAAFillSpansPixmap(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAASetSpansPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPutImagePixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static RegionPtr
+XAACopyAreaPixmap(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ RegionPtr ret;
+
+ if(infoRec->pScrn->vtSema &&
+ ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc)))
+ {
+ if(infoRec->ReadPixmap && (pGC->alu == GXcopy) &&
+ (pSrc->bitsPerPixel == pDst->bitsPerPixel) &&
+ ((pGC->planemask & infoRec->FullPlanemasks[pSrc->depth - 1])
+ == infoRec->FullPlanemasks[pSrc->depth - 1]))
+ {
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDst));
+ pixPriv->flags |= DIRTY;
+
+ return (XAABitBlt( pSrc, pDst, pGC,
+ srcx, srcy, width, height, dstx, dsty,
+ XAADoImageRead, 0L));
+ } else
+ if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ }
+
+ {
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
+ ret = (*pGC->ops->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+ }
+ return ret;
+}
+
+static RegionPtr
+XAACopyPlanePixmap(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ RegionPtr ret;
+
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDst);
+
+ if(infoRec->pScrn->vtSema &&
+ ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc))){
+ if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ }
+
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+XAAPolyPointPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolylinesPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolySegmentPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyRectanglePixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyArcPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAFillPolygonPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolyFillRectPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAPolyFillArcPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static int
+XAAPolyText8Pixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ int ret;
+
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static int
+XAAPolyText16Pixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ int ret;
+
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+XAAImageText8Pixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+static void
+XAAImageText16Pixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+
+static void
+XAAImageGlyphBltPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPolyGlyphBltPixmap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+static void
+XAAPushPixelsPixmap(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg
+){
+ XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw);
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ XAA_PIXMAP_OP_EPILOGUE(pGC);
+}
+
+GCOps XAAPixmapOps = {
+ XAAFillSpansPixmap, XAASetSpansPixmap,
+ XAAPutImagePixmap, XAACopyAreaPixmap,
+ XAACopyPlanePixmap, XAAPolyPointPixmap,
+ XAAPolylinesPixmap, XAAPolySegmentPixmap,
+ XAAPolyRectanglePixmap, XAAPolyArcPixmap,
+ XAAFillPolygonPixmap, XAAPolyFillRectPixmap,
+ XAAPolyFillArcPixmap, XAAPolyText8Pixmap,
+ XAAPolyText16Pixmap, XAAImageText8Pixmap,
+ XAAImageText16Pixmap, XAAImageGlyphBltPixmap,
+ XAAPolyGlyphBltPixmap, XAAPushPixelsPixmap,
+#ifdef NEED_LINEHELPER
+ NULL,
+#endif
+ {NULL} /* devPrivate */
+};
diff --git a/hw/xfree86/xaa/xaaGCmisc.c b/hw/xfree86/xaa/xaaGCmisc.c
new file mode 100644
index 000000000..ab6cb9a24
--- /dev/null
+++ b/hw/xfree86/xaa/xaaGCmisc.c
@@ -0,0 +1,426 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaGCmisc.c,v 1.15 2000/09/25 23:56:14 mvojkovi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "fontstruct.h"
+#include "dixfontstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "migc.h"
+#include "mi.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+
+void
+XAAValidateCopyArea(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(infoRec->CopyArea &&
+ CHECK_PLANEMASK(pGC,infoRec->CopyAreaFlags) &&
+ CHECK_ROP(pGC,infoRec->CopyAreaFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->CopyAreaFlags)
+ )
+ pGC->ops->CopyArea = infoRec->CopyArea;
+ else
+ pGC->ops->CopyArea = XAAFallbackOps.CopyArea;
+}
+
+void
+XAAValidatePutImage(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(infoRec->PutImage &&
+ CHECK_PLANEMASK(pGC,infoRec->PutImageFlags) &&
+ CHECK_ROP(pGC,infoRec->PutImageFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PutImageFlags) &&
+ CHECK_COLORS(pGC,infoRec->PutImageFlags)
+ )
+ pGC->ops->PutImage = infoRec->PutImage;
+ else
+ pGC->ops->PutImage = XAAFallbackOps.PutImage;
+}
+
+void
+XAAValidateCopyPlane(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(infoRec->CopyPlane &&
+ CHECK_PLANEMASK(pGC,infoRec->CopyPlaneFlags) &&
+ CHECK_ROP(pGC,infoRec->CopyPlaneFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->CopyPlaneFlags) &&
+ CHECK_COLORS(pGC,infoRec->CopyPlaneFlags)
+ )
+ pGC->ops->CopyPlane = infoRec->CopyPlane;
+ else
+ pGC->ops->CopyPlane = XAAFallbackOps.CopyPlane;
+}
+
+void
+XAAValidatePushPixels(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(infoRec->PushPixelsSolid &&
+ (pGC->fillStyle == FillSolid) &&
+ CHECK_PLANEMASK(pGC,infoRec->PushPixelsFlags) &&
+ CHECK_ROP(pGC,infoRec->PushPixelsFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PushPixelsFlags) &&
+ CHECK_FG(pGC,infoRec->PushPixelsFlags) &&
+ (!(infoRec->PushPixelsFlags & TRANSPARENCY_GXCOPY_ONLY) ||
+ (pGC->alu == GXcopy))
+ )
+ pGC->ops->PushPixels = infoRec->PushPixelsSolid;
+ else
+ pGC->ops->PushPixels = XAAFallbackOps.PushPixels;
+
+}
+
+
+/* We make the assumption that the FillSpans, PolyFillRect, FillPolygon
+ and PolyFillArc functions are linked in a way that they all have
+ the same rop/color/planemask restrictions. If the driver provides
+ a GC level replacement for these, it will need to supply a new
+ Validate functions if it breaks this assumption */
+
+
+void
+XAAValidateFillSpans(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(pGC->fillStyle != FillTiled) changes &= ~GCTile;
+ if((pGC->fillStyle == FillTiled) || (pGC->fillStyle == FillSolid))
+ changes &= ~GCStipple;
+ if(!changes) return;
+
+
+ pGC->ops->FillSpans = XAAFallbackOps.FillSpans;
+ pGC->ops->PolyFillRect = XAAFallbackOps.PolyFillRect;
+ pGC->ops->FillPolygon = XAAFallbackOps.FillPolygon;
+ pGC->ops->PolyFillArc = XAAFallbackOps.PolyFillArc;
+
+ switch(pGC->fillStyle){
+ case FillSolid:
+ if(infoRec->FillSpansSolid &&
+ CHECK_PLANEMASK(pGC,infoRec->FillSpansSolidFlags) &&
+ CHECK_ROP(pGC,infoRec->FillSpansSolidFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillSpansSolidFlags) &&
+ CHECK_FG(pGC,infoRec->FillSpansSolidFlags)
+ ) {
+ pGC->ops->FillSpans = infoRec->FillSpansSolid;
+ pGC->ops->PolyFillRect = infoRec->PolyFillRectSolid;
+ pGC->ops->FillPolygon = infoRec->FillPolygonSolid;
+ pGC->ops->PolyFillArc = infoRec->PolyFillArcSolid;
+ }
+ break;
+ /* The [Stippled/OpaqueStippled/Tiled]FillChooser
+ functions do the validating */
+ case FillStippled:
+ if(infoRec->FillSpansStippled) {
+ pGC->ops->FillSpans = infoRec->FillSpansStippled;
+ pGC->ops->PolyFillRect = infoRec->PolyFillRectStippled;
+ if(infoRec->FillPolygonStippled)
+ pGC->ops->FillPolygon = infoRec->FillPolygonStippled;
+ else pGC->ops->FillPolygon = miFillPolygon;
+ pGC->ops->PolyFillArc = miPolyFillArc;
+ }
+ break;
+ case FillOpaqueStippled:
+ if(infoRec->FillSpansOpaqueStippled) {
+ pGC->ops->FillSpans = infoRec->FillSpansOpaqueStippled;
+ pGC->ops->PolyFillRect = infoRec->PolyFillRectOpaqueStippled;
+ if(infoRec->FillPolygonOpaqueStippled)
+ pGC->ops->FillPolygon = infoRec->FillPolygonOpaqueStippled;
+ else pGC->ops->FillPolygon = miFillPolygon;
+ pGC->ops->PolyFillArc = miPolyFillArc;
+ }
+ break;
+ case FillTiled:
+ if(infoRec->FillSpansTiled) {
+ pGC->ops->FillSpans = infoRec->FillSpansTiled;
+ pGC->ops->PolyFillRect = infoRec->PolyFillRectTiled;
+ if(infoRec->FillPolygonTiled)
+ pGC->ops->FillPolygon = infoRec->FillPolygonTiled;
+ else pGC->ops->FillPolygon = miFillPolygon;
+ pGC->ops->PolyFillArc = miPolyFillArc;
+ }
+ break;
+ default: return;
+ }
+}
+
+
+/* We make the assumption that these Text8/16 and GlyphBlt functions
+ are linked in a way that they all have the same rop/color/planemask
+ restrictions. If the driver provides a GC level replacement for
+ these, it will need to supply a new Validate functions if it breaks
+ this assumption */
+
+void
+XAAValidatePolyGlyphBlt(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ Bool BigFont = FALSE;
+
+ pGC->ops->PolyText8 = XAAFallbackOps.PolyText8;
+ pGC->ops->PolyText16 = XAAFallbackOps.PolyText16;
+ pGC->ops->PolyGlyphBlt = XAAFallbackOps.PolyGlyphBlt;
+
+ if(!pGC->font) return;
+ if(pGC->fillStyle != FillSolid) return;
+
+ if((FONTMAXBOUNDS(pGC->font, rightSideBearing) -
+ FONTMINBOUNDS(pGC->font, leftSideBearing) > 32))
+ BigFont = TRUE;
+
+ /* no funny business */
+ if((FONTMINBOUNDS(pGC->font, characterWidth) <= 0) ||
+ ((FONTASCENT(pGC->font) + FONTDESCENT(pGC->font)) <= 0))
+ return;
+
+ /* Check for TE Fonts */
+ if(!TERMINALFONT(pGC->font) || BigFont) {
+ if(infoRec->PolyGlyphBltNonTE &&
+ CHECK_PLANEMASK(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
+ CHECK_ROP(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
+ CHECK_FG(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
+ (!(infoRec->PolyGlyphBltNonTEFlags & TRANSPARENCY_GXCOPY_ONLY) ||
+ (pGC->alu == GXcopy))
+ ) {
+ pGC->ops->PolyText8 = infoRec->PolyText8NonTE;
+ pGC->ops->PolyText16 = infoRec->PolyText16NonTE;
+ pGC->ops->PolyGlyphBlt = infoRec->PolyGlyphBltNonTE;
+ }
+ } else {
+ if(infoRec->PolyGlyphBltTE &&
+ CHECK_PLANEMASK(pGC,infoRec->PolyGlyphBltTEFlags) &&
+ CHECK_ROP(pGC,infoRec->PolyGlyphBltTEFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolyGlyphBltNonTEFlags) &&
+ CHECK_FG(pGC,infoRec->PolyGlyphBltTEFlags) &&
+ (!(infoRec->PolyGlyphBltTEFlags & TRANSPARENCY_GXCOPY_ONLY) ||
+ (pGC->alu == GXcopy))
+ ) {
+ pGC->ops->PolyText8 = infoRec->PolyText8TE;
+ pGC->ops->PolyText16 = infoRec->PolyText16TE;
+ pGC->ops->PolyGlyphBlt = infoRec->PolyGlyphBltTE;
+ }
+ }
+}
+
+void
+XAAValidateImageGlyphBlt(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ Bool BigFont = FALSE;
+
+ pGC->ops->ImageText8 = XAAFallbackOps.ImageText8;
+ pGC->ops->ImageText16 = XAAFallbackOps.ImageText16;
+ pGC->ops->ImageGlyphBlt = XAAFallbackOps.ImageGlyphBlt;
+
+ if(!pGC->font) return;
+
+ if((FONTMAXBOUNDS(pGC->font, rightSideBearing) -
+ FONTMINBOUNDS(pGC->font, leftSideBearing) > 32))
+ BigFont = TRUE;
+
+ /* no funny business */
+ if((FONTMINBOUNDS(pGC->font, characterWidth) <= 0) ||
+ ((FONTASCENT(pGC->font) + FONTDESCENT(pGC->font)) <= 0))
+ return;
+
+
+ /* Check for TE Fonts */
+ if(!TERMINALFONT(pGC->font) || BigFont || (pGC->depth == 32)) {
+ if(infoRec->ImageGlyphBltNonTE &&
+ CHECK_PLANEMASK(pGC,infoRec->ImageGlyphBltNonTEFlags) &&
+ CHECK_FG(pGC,infoRec->ImageGlyphBltNonTEFlags) &&
+ infoRec->SetupForSolidFill &&
+ CHECK_PLANEMASK(pGC,infoRec->SolidFillFlags) &&
+ CHECK_BG(pGC,infoRec->SolidFillFlags))
+ {
+ pGC->ops->ImageText8 = infoRec->ImageText8NonTE;
+ pGC->ops->ImageText16 = infoRec->ImageText16NonTE;
+ pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltNonTE;
+ }
+ } else if(infoRec->ImageGlyphBltTE &&
+ CHECK_PLANEMASK(pGC,infoRec->ImageGlyphBltTEFlags)){
+ if(!(infoRec->ImageGlyphBltTEFlags & TRANSPARENCY_ONLY) &&
+ CHECK_COLORS(pGC,infoRec->ImageGlyphBltTEFlags))
+ {
+ pGC->ops->ImageText8 = infoRec->ImageText8TE;
+ pGC->ops->ImageText16 = infoRec->ImageText16TE;
+ pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltTE;
+ } else {
+ if(CHECK_FG(pGC,infoRec->ImageGlyphBltTEFlags) &&
+ infoRec->SetupForSolidFill &&
+ CHECK_PLANEMASK(pGC,infoRec->SolidFillFlags) &&
+ CHECK_BG(pGC,infoRec->SolidFillFlags))
+ {
+ pGC->ops->ImageText8 = infoRec->ImageText8TE;
+ pGC->ops->ImageText16 = infoRec->ImageText16TE;
+ pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltTE;
+ }
+ }
+ }
+}
+
+
+void
+XAAValidatePolylines(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+
+ if(pGC->lineStyle == LineSolid) changes &= ~GCDashList;
+ if(!changes) return;
+
+ pGC->ops->PolySegment = XAAFallbackOps.PolySegment;
+ pGC->ops->Polylines = XAAFallbackOps.Polylines;
+ pGC->ops->PolyRectangle = XAAFallbackOps.PolyRectangle;
+ pGC->ops->PolyArc = XAAFallbackOps.PolyArc;
+
+ if((pGC->ops->FillSpans != XAAFallbackOps.FillSpans) &&
+ (pGC->lineWidth > 0)){
+
+ pGC->ops->PolyArc = miPolyArc;
+ pGC->ops->PolySegment = miPolySegment;
+ pGC->ops->PolyRectangle = miPolyRectangle;
+ if(pGC->lineStyle == LineSolid)
+ pGC->ops->Polylines = miWideLine;
+ else
+ pGC->ops->Polylines = miWideDash;
+ }
+
+ if((pGC->lineWidth == 0) && (pGC->fillStyle == FillSolid)) {
+
+ if(pGC->lineStyle == LineSolid) {
+
+ if(infoRec->PolyRectangleThinSolid &&
+ CHECK_PLANEMASK(pGC,infoRec->PolyRectangleThinSolidFlags) &&
+ CHECK_ROP(pGC,infoRec->PolyRectangleThinSolidFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolyRectangleThinSolidFlags) &&
+ CHECK_FG(pGC,infoRec->PolyRectangleThinSolidFlags)) {
+
+ pGC->ops->PolyRectangle = infoRec->PolyRectangleThinSolid;
+ }
+
+ if(infoRec->PolySegmentThinSolid &&
+ CHECK_PLANEMASK(pGC,infoRec->PolySegmentThinSolidFlags) &&
+ CHECK_ROP(pGC,infoRec->PolySegmentThinSolidFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolySegmentThinSolidFlags) &&
+ CHECK_FG(pGC,infoRec->PolySegmentThinSolidFlags)) {
+
+ pGC->ops->PolySegment = infoRec->PolySegmentThinSolid;
+ }
+
+ if(infoRec->PolylinesThinSolid &&
+ CHECK_PLANEMASK(pGC,infoRec->PolylinesThinSolidFlags) &&
+ CHECK_ROP(pGC,infoRec->PolylinesThinSolidFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolylinesThinSolidFlags) &&
+ CHECK_FG(pGC,infoRec->PolylinesThinSolidFlags)) {
+
+ pGC->ops->Polylines = infoRec->PolylinesThinSolid;
+ }
+ } else if((pGC->lineStyle == LineOnOffDash) && pGCPriv->DashPattern){
+
+ if(infoRec->PolySegmentThinDashed &&
+ !(infoRec->PolySegmentThinDashedFlags & NO_TRANSPARENCY) &&
+ ((pGC->alu == GXcopy) || !(infoRec->PolySegmentThinDashedFlags &
+ TRANSPARENCY_GXCOPY_ONLY)) &&
+ CHECK_PLANEMASK(pGC,infoRec->PolySegmentThinDashedFlags) &&
+ CHECK_ROP(pGC,infoRec->PolySegmentThinDashedFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolySegmentThinDashedFlags) &&
+ CHECK_FG(pGC,infoRec->PolySegmentThinDashedFlags)) {
+
+ pGC->ops->PolySegment = infoRec->PolySegmentThinDashed;
+ }
+
+ if(infoRec->PolylinesThinDashed &&
+ !(infoRec->PolylinesThinDashedFlags & NO_TRANSPARENCY) &&
+ ((pGC->alu == GXcopy) || !(infoRec->PolylinesThinDashedFlags &
+ TRANSPARENCY_GXCOPY_ONLY)) &&
+ CHECK_PLANEMASK(pGC,infoRec->PolylinesThinDashedFlags) &&
+ CHECK_ROP(pGC,infoRec->PolylinesThinDashedFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolylinesThinDashedFlags) &&
+ CHECK_FG(pGC,infoRec->PolylinesThinDashedFlags)) {
+
+ pGC->ops->Polylines = infoRec->PolylinesThinDashed;
+ }
+
+ if(pGC->ops->Polylines != XAAFallbackOps.Polylines)
+ pGC->ops->PolyRectangle = miPolyRectangle;
+
+ } else if(pGCPriv->DashPattern && (pGC->depth != 32)) {
+ /* LineDoubleDash */
+ if(infoRec->PolySegmentThinDashed &&
+ !(infoRec->PolySegmentThinDashedFlags & TRANSPARENCY_ONLY) &&
+ CHECK_PLANEMASK(pGC,infoRec->PolySegmentThinDashedFlags) &&
+ CHECK_ROP(pGC,infoRec->PolySegmentThinDashedFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolySegmentThinDashedFlags) &&
+ CHECK_COLORS(pGC,infoRec->PolySegmentThinDashedFlags)) {
+
+ pGC->ops->PolySegment = infoRec->PolySegmentThinDashed;
+ }
+
+ if(infoRec->PolylinesThinDashed &&
+ !(infoRec->PolylinesThinDashedFlags & TRANSPARENCY_ONLY) &&
+ CHECK_PLANEMASK(pGC,infoRec->PolylinesThinDashedFlags) &&
+ CHECK_ROP(pGC,infoRec->PolylinesThinDashedFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolylinesThinDashedFlags) &&
+ CHECK_COLORS(pGC,infoRec->PolylinesThinDashedFlags)) {
+
+ pGC->ops->Polylines = infoRec->PolylinesThinDashed;
+ }
+
+ if(pGC->ops->Polylines != XAAFallbackOps.Polylines)
+ pGC->ops->PolyRectangle = miPolyRectangle;
+
+ }
+ }
+
+ if(infoRec->PolylinesWideSolid &&
+ (pGC->lineWidth > 0) &&
+ (pGC->fillStyle == FillSolid) &&
+ (pGC->lineStyle == LineSolid) &&
+ CHECK_PLANEMASK(pGC,infoRec->PolylinesWideSolidFlags) &&
+ CHECK_ROP(pGC,infoRec->PolylinesWideSolidFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->PolylinesWideSolidFlags) &&
+ CHECK_FG(pGC,infoRec->PolylinesWideSolidFlags)) {
+
+ pGC->ops->Polylines = infoRec->PolylinesWideSolid;
+ }
+}
diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c
new file mode 100644
index 000000000..6da601faf
--- /dev/null
+++ b/hw/xfree86/xaa/xaaImage.c
@@ -0,0 +1,520 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaImage.c,v 1.20 2000/09/25 23:56:14 mvojkovi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+#include "servermd.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "mi.h"
+#include "pixmapstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+void XAAMoveDWORDS_FixedBase(
+ register CARD32* dest,
+ register CARD32* src,
+ register int dwords )
+{
+ while(dwords & ~0x03) {
+ *dest = *src;
+ *dest = *(src + 1);
+ *dest = *(src + 2);
+ *dest = *(src + 3);
+ dwords -= 4;
+ src += 4;
+ }
+
+ if(!dwords) return;
+ *dest = *src;
+ if(dwords == 1) return;
+ *dest = *(src + 1);
+ if(dwords == 2) return;
+ *dest = *(src + 2);
+}
+
+void XAAMoveDWORDS(
+ register CARD32* dest,
+ register CARD32* src,
+ register int dwords )
+{
+ while(dwords & ~0x03) {
+ *dest = *src;
+ *(dest + 1) = *(src + 1);
+ *(dest + 2) = *(src + 2);
+ *(dest + 3) = *(src + 3);
+ src += 4;
+ dest += 4;
+ dwords -= 4;
+ }
+ if(!dwords) return;
+ *dest = *src;
+ if(dwords == 1) return;
+ *(dest + 1) = *(src + 1);
+ if(dwords == 2) return;
+ *(dest + 2) = *(src + 2);
+}
+
+void XAAMoveDWORDS_FixedSrc(
+ register CARD32* dest,
+ register CARD32* src,
+ register int dwords )
+{
+ while(dwords & ~0x03) {
+ *dest = *src;
+ *(dest + 1) = *src;
+ *(dest + 2) = *src;
+ *(dest + 3) = *src;
+ dest += 4;
+ dwords -= 4;
+ }
+ if(!dwords) return;
+ *dest = *src;
+ if(dwords == 1) return;
+ *(dest + 1) = *src;
+ if(dwords == 2) return;
+ *(dest + 2) = *src;
+}
+
+static void
+XAAWritePixmap32To24(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *srcInit,
+ int srcwidth, /* bytes */
+ int rop,
+ unsigned int planemask,
+ int trans
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int count, dwords = ((w * 3) + 3) >> 2;
+ CARD32 *src, *dst;
+ Bool PlusOne = FALSE;
+
+ if((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
+ ((dwords * h) & 0x01)) {
+ PlusOne = TRUE;
+ }
+
+ (*infoRec->SetupForImageWrite)(pScrn, rop, planemask, trans, 24, 24);
+ (*infoRec->SubsequentImageWriteRect)(pScrn, x, y, w, h, 0);
+
+ if(dwords > infoRec->ImageWriteRange) {
+ dst = (CARD32*)infoRec->ImageWriteBase;
+ while(h--) {
+ src = (CARD32*)srcInit;
+ count = w;
+
+ while(count >= 4) {
+ *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
+ *dst = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
+ *dst = ((src[2] >> 16) & 0x000000ff) | (src[3] << 8);
+ src += 4;
+ count -= 4;
+ }
+ switch(count) {
+ case 0: break;
+ case 1: *dst = src[0];
+ break;
+ case 2: *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
+ *dst = src[1] >> 8;
+ break;
+ default: *dst = (src[0] & 0x00ffffff) | (src[1] << 24);
+ *dst = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
+ *dst = src[2] >> 16;
+ break;
+ }
+ srcInit += srcwidth;
+ }
+ } else {
+ while(h--) {
+ dst = (CARD32*)infoRec->ImageWriteBase;
+ src = (CARD32*)srcInit;
+ count = w;
+
+ while(count >= 4) {
+ dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
+ dst[1] = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
+ dst[2] = ((src[2] >> 16) & 0x000000ff) | (src[3] << 8);
+ dst += 3;
+ src += 4;
+ count -= 4;
+ }
+ switch(count) {
+ case 0: break;
+ case 1: dst[0] = src[0];
+ break;
+ case 2: dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
+ dst[1] = src[1] >> 8;
+ break;
+ default: dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24);
+ dst[1] = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16);
+ dst[2] = src[2] >> 16;
+ break;
+ }
+ srcInit += srcwidth;
+ }
+ }
+
+ if(PlusOne) {
+ CARD32* base = (CARD32*)infoRec->ImageWriteBase;
+ *base = 0x00000000;
+ }
+
+ if(infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+
+}
+
+void
+XAAWritePixmap (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth, /* bytes */
+ int rop,
+ unsigned int planemask,
+ int trans,
+ int bpp, int depth
+){
+ XAAInfoRecPtr infoRec;
+ int dwords, skipleft, Bpp;
+ Bool beCareful, PlusOne;
+
+ if((bpp == 32) && (pScrn->bitsPerPixel == 24)) {
+ XAAWritePixmap32To24(pScrn, x, y, w, h, src, srcwidth,
+ rop, planemask, trans);
+ return;
+ }
+
+ infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ beCareful = PlusOne = FALSE;
+ Bpp = bpp >> 3;
+
+ if((skipleft = (long)src & 0x03L)) {
+ if(!(infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING)) {
+ skipleft = 0;
+ beCareful = TRUE;
+ goto BAD_ALIGNMENT;
+ }
+
+ if(Bpp == 3)
+ skipleft = 4 - skipleft;
+ else
+ skipleft /= Bpp;
+
+ if((x < skipleft) && !(infoRec->ImageWriteFlags &
+ LEFT_EDGE_CLIPPING_NEGATIVE_X)) {
+ skipleft = 0;
+ beCareful = TRUE;
+ goto BAD_ALIGNMENT;
+ }
+
+ x -= skipleft;
+ w += skipleft;
+
+ if(Bpp == 3)
+ src -= 3 * skipleft;
+ else /* is this Alpha friendly ? */
+ src = (unsigned char*)((long)src & ~0x03L);
+ }
+
+BAD_ALIGNMENT:
+
+ dwords = ((w * Bpp) + 3) >> 2;
+
+ if((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) &&
+ ((dwords * h) & 0x01)) {
+ PlusOne = TRUE;
+ }
+
+
+ (*infoRec->SetupForImageWrite)(pScrn, rop, planemask, trans, bpp, depth);
+ (*infoRec->SubsequentImageWriteRect)(pScrn, x, y, w, h, skipleft);
+
+ if(beCareful) {
+ /* in cases with bad alignment we have to be careful not
+ to read beyond the end of the source */
+ if(((x * Bpp) + (dwords << 2)) > srcwidth) h--;
+ else beCareful = FALSE;
+ }
+
+ if(dwords > infoRec->ImageWriteRange) {
+ while(h--) {
+ XAAMoveDWORDS_FixedBase((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords);
+ src += srcwidth;
+ }
+ if(beCareful) {
+ int shift = ((long)src & 0x03L) << 3;
+ if(--dwords)
+ XAAMoveDWORDS_FixedBase((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords);
+ src = (unsigned char*)((long)(src + (dwords << 2)) & ~0x03L);
+ *((CARD32*)infoRec->ImageWriteBase) = *((CARD32*)src) >> shift;
+ }
+ } else {
+ if(srcwidth == (dwords << 2)) {
+ int decrement = infoRec->ImageWriteRange/dwords;
+
+ while(h > decrement) {
+ XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords * decrement);
+ src += (srcwidth * decrement);
+ h -= decrement;
+ }
+ if(h) {
+ XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords * h);
+ if(beCareful) src += (srcwidth * h);
+ }
+ } else {
+ while(h--) {
+ XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords);
+ src += srcwidth;
+ }
+ }
+
+ if(beCareful) {
+ int shift = ((long)src & 0x03L) << 3;
+ if(--dwords)
+ XAAMoveDWORDS((CARD32*)infoRec->ImageWriteBase,
+ (CARD32*)src, dwords);
+ src = (unsigned char*)((long)(src + (dwords << 2)) & ~0x03L);
+
+ ((CARD32*)infoRec->ImageWriteBase)[dwords] =
+ *((CARD32*)src) >> shift;
+ }
+ }
+
+ if(PlusOne) {
+ CARD32* base = (CARD32*)infoRec->ImageWriteBase;
+ *base = 0x00000000;
+ }
+
+ if(infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+}
+
+
+void
+XAAWritePixmapScanline (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth, /* bytes */
+ int rop,
+ unsigned int planemask,
+ int trans,
+ int bpp, int depth
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int dwords, skipleft, bufferNo = 0, Bpp = bpp >> 3;
+ Bool beCareful = FALSE;
+ CARD32* base;
+
+ if((skipleft = (long)src & 0x03L)) {
+ if(!(infoRec->ScanlineImageWriteFlags & LEFT_EDGE_CLIPPING)) {
+ skipleft = 0;
+ beCareful = TRUE;
+ goto BAD_ALIGNMENT;
+ }
+
+ if(Bpp == 3)
+ skipleft = 4 - skipleft;
+ else
+ skipleft /= Bpp;
+
+ if((x < skipleft) && !(infoRec->ScanlineImageWriteFlags &
+ LEFT_EDGE_CLIPPING_NEGATIVE_X)) {
+ skipleft = 0;
+ beCareful = TRUE;
+ goto BAD_ALIGNMENT;
+ }
+
+ x -= skipleft;
+ w += skipleft;
+
+ if(Bpp == 3)
+ src -= 3 * skipleft;
+ else
+ src = (unsigned char*)((long)src & ~0x03L);
+ }
+
+BAD_ALIGNMENT:
+
+ dwords = ((w * Bpp) + 3) >> 2;
+
+ (*infoRec->SetupForScanlineImageWrite)(
+ pScrn, rop, planemask, trans, bpp, depth);
+ (*infoRec->SubsequentScanlineImageWriteRect)(pScrn, x, y, w, h, skipleft);
+
+ if(beCareful) {
+ /* in cases with bad alignment we have to be careful not
+ to read beyond the end of the source */
+ if(((x * Bpp) + (dwords << 2)) > srcwidth) h--;
+ else beCareful = FALSE;
+ }
+
+ while(h--) {
+ base = (CARD32*)infoRec->ScanlineImageWriteBuffers[bufferNo];
+ XAAMoveDWORDS(base, (CARD32*)src, dwords);
+ (*infoRec->SubsequentImageWriteScanline)(pScrn, bufferNo++);
+ src += srcwidth;
+ if(bufferNo >= infoRec->NumScanlineImageWriteBuffers)
+ bufferNo = 0;
+ }
+
+ if(beCareful) {
+ int shift = ((long)src & 0x03L) << 3;
+ base = (CARD32*)infoRec->ScanlineImageWriteBuffers[bufferNo];
+ if(--dwords)
+ XAAMoveDWORDS(base,(CARD32*)src, dwords);
+ src = (unsigned char*)((long)(src + (dwords << 2)) & ~0x03L);
+
+ base[dwords] = *((CARD32*)src) >> shift;
+ (*infoRec->SubsequentImageWriteScanline)(pScrn, bufferNo);
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+void
+XAAPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x,
+ int y,
+ int w,
+ int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int bpp = BitsPerPixel(depth);
+ Bool depthBug = FALSE;
+ if(!w || !h) return;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ depthBug = XAA_DEPTH_BUG(pGC);
+
+ if(((format == ZPixmap) && infoRec->WritePixmap &&
+ ((pDraw->bitsPerPixel == bpp) ||
+ ((pDraw->bitsPerPixel == 24) && (bpp == 32) &&
+ (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP))) &&
+ CHECK_ROP(pGC,infoRec->WritePixmapFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->WritePixmapFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->WritePixmapFlags) &&
+ CHECK_NO_GXCOPY(pGC,infoRec->WritePixmapFlags)) ||
+ ((format == XYBitmap) && !depthBug && infoRec->WriteBitmap &&
+ CHECK_ROP(pGC,infoRec->WriteBitmapFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->WriteBitmapFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->WriteBitmapFlags) &&
+ CHECK_COLORS(pGC,infoRec->WriteBitmapFlags) &&
+ !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) ||
+ ((format == XYPixmap) && !depthBug && infoRec->WriteBitmap &&
+ CHECK_ROP(pGC,infoRec->WriteBitmapFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->WriteBitmapFlags) &&
+ !(infoRec->WriteBitmapFlags & NO_PLANEMASK) &&
+ !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))){
+
+ int MaxBoxes = REGION_NUM_RECTS(pGC->pCompositeClip);
+ BoxPtr pbox, pClipBoxes;
+ int nboxes, srcx, srcy, srcwidth;
+ xRectangle TheRect;
+
+ TheRect.x = pDraw->x + x;
+ TheRect.y = pDraw->y + y;
+ TheRect.width = w;
+ TheRect.height = h;
+
+ if(MaxBoxes > (infoRec->PreAllocSize/sizeof(BoxRec))) {
+ pClipBoxes = xalloc(MaxBoxes * sizeof(BoxRec));
+ if(!pClipBoxes) return;
+ } else pClipBoxes = (BoxPtr)infoRec->PreAllocMem;
+
+ nboxes =
+ XAAGetRectClipBoxes(pGC->pCompositeClip, pClipBoxes, 1, &TheRect);
+ pbox = pClipBoxes;
+
+ if(format == XYBitmap) {
+ srcwidth = BitmapBytePad(leftPad + w);
+ while(nboxes--) {
+ srcx = pbox->x1 - TheRect.x + leftPad;
+ srcy = pbox->y1 - TheRect.y;
+ (*infoRec->WriteBitmap)(infoRec->pScrn, pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ (unsigned char*)pImage +
+ (srcwidth * srcy) + ((srcx >> 5) << 2),
+ srcwidth, srcx & 31, pGC->fgPixel, pGC->bgPixel,
+ pGC->alu, pGC->planemask);
+ pbox++;
+ }
+ } else if(format == ZPixmap) {
+ int Bpp = bpp >> 3;
+ srcwidth = PixmapBytePad(leftPad + w, depth);
+ while(nboxes--) {
+ srcx = pbox->x1 - TheRect.x + leftPad;
+ srcy = pbox->y1 - TheRect.y;
+ (*infoRec->WritePixmap)(infoRec->pScrn, pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ (unsigned char*)pImage +
+ (srcwidth * srcy) + (srcx * Bpp),
+ srcwidth, pGC->alu, pGC->planemask, -1,
+ Bpp << 3, depth);
+ pbox++;
+ }
+ } else { /* XYPixmap */
+ int depth = pGC->depth;
+ int numBox, increment;
+ unsigned long i, mask;
+ BoxPtr pntBox;
+
+ srcwidth = BitmapBytePad(w + leftPad);
+ increment = h * srcwidth;
+ i = 1 << (depth - 1);
+ mask = ~0;
+
+ if((infoRec->pScrn->overlayFlags & OVERLAY_8_32_PLANAR) &&
+ (pGC->depth == 8)){
+ i = 0x80000000; mask = 0xff000000;
+ }
+
+ for(; i & mask; i >>= 1, pImage += increment) {
+ if(i & pGC->planemask) {
+ pntBox = pbox;
+ numBox = nboxes;
+ while(numBox--) {
+ srcx = pntBox->x1 - TheRect.x + leftPad;
+ srcy = pntBox->y1 - TheRect.y;
+ (*infoRec->WriteBitmap)(infoRec->pScrn,
+ pntBox->x1, pntBox->y1,
+ pntBox->x2 - pntBox->x1,
+ pntBox->y2 - pntBox->y1,
+ (unsigned char*)pImage +
+ (srcwidth * srcy) + ((srcx >> 5) << 2),
+ srcwidth, srcx & 31, ~0, 0, pGC->alu, i);
+ pntBox++;
+ }
+ }
+ }
+
+ }
+
+ if(pClipBoxes != (BoxPtr)infoRec->PreAllocMem)
+ xfree(pClipBoxes);
+ } else
+ XAAFallbackOps.PutImage(pDraw, pGC, depth, x, y, w, h, leftPad,
+ format, pImage);
+}
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
new file mode 100644
index 000000000..5237e8b2c
--- /dev/null
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -0,0 +1,762 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c,v 1.35 2001/07/19 18:50:16 mvojkovi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "mi.h"
+#include "miline.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+#include "xf86fbman.h"
+#include "servermd.h"
+
+#define MAX_PREALLOC_MEM 65536 /* MUST be >= 1024 */
+
+#define MIN_OFFPIX_SIZE (320*200)
+
+static Bool XAACloseScreen(int i, ScreenPtr pScreen);
+static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
+ unsigned int format, unsigned long planemask,
+ char *pdstLine);
+static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
+ int *pwidth, int nspans, char *pdstStart);
+static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth);
+static Bool XAADestroyPixmap(PixmapPtr pPixmap);
+static void XAARestoreAreas (PixmapPtr pPixmap, RegionPtr prgnRestore,
+ int xorg, int yorg, WindowPtr pWin);
+static void XAASaveAreas (PixmapPtr pPixmap, RegionPtr prgnSave,
+ int xorg, int yorg, WindowPtr pWin);
+static Bool XAAEnterVT (int index, int flags);
+static void XAALeaveVT (int index, int flags);
+static int XAASetDGAMode(int index, int num, DGADevicePtr devRet);
+static void XAAEnableDisableFBAccess (int index, Bool enable);
+static Bool XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask);
+
+int XAAScreenIndex = -1;
+int XAAGCIndex = -1;
+int XAAPixmapIndex = -1;
+static unsigned long XAAGeneration = 0;
+
+/* temp kludge */
+static Bool SwitchedOut = FALSE;
+
+XAAInfoRecPtr
+XAACreateInfoRec()
+{
+ XAAInfoRecPtr infoRec;
+
+ infoRec = xcalloc(1, sizeof(XAAInfoRec));
+ if(infoRec)
+ infoRec->CachePixelGranularity = -1;
+
+ return infoRec;
+}
+
+void
+XAADestroyInfoRec(XAAInfoRecPtr infoRec)
+{
+ if(!infoRec) return;
+
+ if(infoRec->ClosePixmapCache)
+ (*infoRec->ClosePixmapCache)(infoRec->pScrn->pScreen);
+
+ if(infoRec->PreAllocMem)
+ xfree(infoRec->PreAllocMem);
+
+ if(infoRec->PixmapCachePrivate)
+ xfree(infoRec->PixmapCachePrivate);
+
+ xfree(infoRec);
+}
+
+
+Bool
+XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XAAScreenPtr pScreenPriv;
+ int i;
+#ifdef RENDER
+ PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+#endif
+
+ /* Return successfully if no acceleration wanted */
+ if (!infoRec)
+ return TRUE;
+
+ if (XAAGeneration != serverGeneration) {
+ if ( ((XAAScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
+ ((XAAGCIndex = AllocateGCPrivateIndex()) < 0) ||
+ ((XAAPixmapIndex = AllocatePixmapPrivateIndex()) < 0))
+ return FALSE;
+
+ XAAGeneration = serverGeneration;
+ }
+
+ if (!AllocateGCPrivate(pScreen, XAAGCIndex, sizeof(XAAGCRec)))
+ return FALSE;
+
+ if (!AllocatePixmapPrivate(pScreen, XAAPixmapIndex, sizeof(XAAPixmapRec)))
+ return FALSE;
+
+ if (!(pScreenPriv = xalloc(sizeof(XAAScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[XAAScreenIndex].ptr = (pointer)pScreenPriv;
+
+ if(!xf86FBManagerRunning(pScreen))
+ infoRec->Flags &= ~(PIXMAP_CACHE | OFFSCREEN_PIXMAPS);
+ if(!(infoRec->Flags & LINEAR_FRAMEBUFFER))
+ infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
+
+ if(!infoRec->FullPlanemask) { /* for backwards compatibility */
+ infoRec->FullPlanemask = (1 << pScrn->depth) - 1;
+ infoRec->FullPlanemasks[pScrn->depth - 1] = infoRec->FullPlanemask;
+ }
+
+ for(i = 0; i < 32; i++) {
+ if(!infoRec->FullPlanemasks[i]) /* keep any set by caller */
+ infoRec->FullPlanemasks[i] = (1 << (i+1)) - 1;
+ }
+
+ if(!XAAInitAccel(pScreen, infoRec)) return FALSE;
+ pScreenPriv->AccelInfoRec = infoRec;
+ infoRec->ScratchGC.pScreen = pScreen;
+
+
+ if(!infoRec->GetImage)
+ infoRec->GetImage = XAAGetImage;
+ if(!infoRec->GetSpans)
+ infoRec->GetSpans = XAAGetSpans;
+ if(!infoRec->PaintWindowBackground)
+ infoRec->PaintWindowBackground = XAAPaintWindow;
+ if(!infoRec->PaintWindowBorder)
+ infoRec->PaintWindowBorder = XAAPaintWindow;
+ if(!infoRec->CopyWindow)
+ infoRec->CopyWindow = XAACopyWindow;
+ if(!infoRec->SaveAreas)
+ infoRec->SaveAreas = XAASaveAreas;
+ if(!infoRec->RestoreAreas)
+ infoRec->RestoreAreas = XAARestoreAreas;
+
+ pScreenPriv->CreateGC = pScreen->CreateGC;
+ pScreen->CreateGC = XAACreateGC;
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = XAACloseScreen;
+ pScreenPriv->GetImage = pScreen->GetImage;
+ pScreen->GetImage = infoRec->GetImage;
+ pScreenPriv->GetSpans = pScreen->GetSpans;
+ pScreen->GetSpans = infoRec->GetSpans;
+ pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
+ pScreen->PaintWindowBackground = infoRec->PaintWindowBackground;
+ pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
+ pScreen->PaintWindowBorder = infoRec->PaintWindowBorder;
+ pScreenPriv->CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = infoRec->CopyWindow;
+ pScreenPriv->CreatePixmap = pScreen->CreatePixmap;
+ pScreen->CreatePixmap = XAACreatePixmap;
+ pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap;
+ pScreen->DestroyPixmap = XAADestroyPixmap;
+ pScreenPriv->BackingStoreFuncs.RestoreAreas =
+ pScreen->BackingStoreFuncs.RestoreAreas;
+ pScreen->BackingStoreFuncs.RestoreAreas = infoRec->RestoreAreas;
+ pScreenPriv->BackingStoreFuncs.SaveAreas =
+ pScreen->BackingStoreFuncs.SaveAreas;
+ pScreen->BackingStoreFuncs.SaveAreas = infoRec->SaveAreas;
+ pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
+ pScreen->ChangeWindowAttributes = XAAChangeWindowAttributes;
+
+ pScreenPriv->EnterVT = pScrn->EnterVT;
+ pScrn->EnterVT = XAAEnterVT;
+ pScreenPriv->LeaveVT = pScrn->LeaveVT;
+ pScrn->LeaveVT = XAALeaveVT;
+ pScreenPriv->SetDGAMode = pScrn->SetDGAMode;
+ pScrn->SetDGAMode = XAASetDGAMode;
+ pScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess;
+ pScrn->EnableDisableFBAccess = XAAEnableDisableFBAccess;
+
+ pScreenPriv->WindowExposures = pScreen->WindowExposures;
+#ifdef RENDER
+ if (ps)
+ {
+ pScreenPriv->Composite = ps->Composite;
+ ps->Composite = XAAComposite;
+ pScreenPriv->Glyphs = ps->Glyphs;
+ ps->Glyphs = XAAGlyphs;
+ }
+#endif
+ if(pScrn->overlayFlags & OVERLAY_8_32_PLANAR)
+ XAASetupOverlay8_32Planar(pScreen);
+
+ infoRec->PreAllocMem = xalloc(MAX_PREALLOC_MEM);
+ if(infoRec->PreAllocMem)
+ infoRec->PreAllocSize = MAX_PREALLOC_MEM;
+
+ if(infoRec->Flags & PIXMAP_CACHE)
+ xf86RegisterFreeBoxCallback(pScreen, infoRec->InitPixmapCache,
+ (pointer)infoRec);
+
+ if(infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS)
+ miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4);
+
+ return TRUE;
+}
+
+
+
+static Bool
+XAACloseScreen (int i, ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XAAScreenPtr pScreenPriv =
+ (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
+
+ pScrn->EnterVT = pScreenPriv->EnterVT;
+ pScrn->LeaveVT = pScreenPriv->LeaveVT;
+ pScrn->EnableDisableFBAccess = pScreenPriv->EnableDisableFBAccess;
+
+ pScreen->CreateGC = pScreenPriv->CreateGC;
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ pScreen->GetImage = pScreenPriv->GetImage;
+ pScreen->GetSpans = pScreenPriv->GetSpans;
+ pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
+ pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
+ pScreen->CopyWindow = pScreenPriv->CopyWindow;
+ pScreen->WindowExposures = pScreenPriv->WindowExposures;
+ pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
+ pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
+ pScreen->BackingStoreFuncs.RestoreAreas =
+ pScreenPriv->BackingStoreFuncs.RestoreAreas;
+ pScreen->BackingStoreFuncs.SaveAreas =
+ pScreenPriv->BackingStoreFuncs.SaveAreas;
+ pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
+
+ /* We leave it up to the client to free the XAAInfoRec */
+
+ xfree ((pointer) pScreenPriv);
+
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+static void
+XAAGetImage (
+ DrawablePtr pDraw,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planemask,
+ char *pdstLine
+)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ ScrnInfoPtr pScrn = infoRec->pScrn;
+
+ if(pScrn->vtSema &&
+ ((pDraw->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pDraw)))
+ {
+ if(infoRec->ReadPixmap && (format == ZPixmap) &&
+ ((planemask & infoRec->FullPlanemasks[pDraw->depth - 1]) ==
+ infoRec->FullPlanemasks[pDraw->depth - 1]) &&
+ (pDraw->bitsPerPixel == BitsPerPixel(pDraw->depth)))
+ {
+ (*infoRec->ReadPixmap)(pScrn,
+ sx + pDraw->x, sy + pDraw->y, w, h,
+ (unsigned char *)pdstLine,
+ PixmapBytePad(w, pDraw->depth),
+ pDraw->bitsPerPixel, pDraw->depth);
+ return;
+ }
+ SYNC_CHECK(pDraw);
+ }
+
+ XAA_SCREEN_PROLOGUE (pScreen, GetImage);
+ (*pScreen->GetImage) (pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ XAA_SCREEN_EPILOGUE (pScreen, GetImage, XAAGetImage);
+}
+
+static void
+XAAGetSpans (
+ DrawablePtr pDraw,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pdstStart
+)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ XAA_SCREEN_PROLOGUE (pScreen, GetSpans);
+ if(xf86Screens[pScreen->myNum]->vtSema &&
+ ((pDraw->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pDraw))) {
+ SYNC_CHECK(pDraw);
+ }
+ (*pScreen->GetSpans) (pDraw, wMax, ppt, pwidth, nspans, pdstStart);
+ XAA_SCREEN_EPILOGUE (pScreen, GetSpans, XAAGetSpans);
+}
+
+
+static void
+XAASaveAreas (
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+
+ if(IS_OFFSCREEN_PIXMAP(pPixmap)) {
+ BoxPtr pbox = REGION_RECTS(prgnSave);
+ int nboxes = REGION_NUM_RECTS(prgnSave);
+
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, GXcopy, ~0, -1);
+ while(nboxes--) {
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pbox->x1 + xorg, pbox->y1 + yorg,
+ pPixmap->drawable.x + pbox->x1,
+ pPixmap->drawable.y + pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+ pbox++;
+ }
+ SET_SYNC_FLAG(infoRec);
+ return;
+ }
+
+ if(xf86Screens[pScreen->myNum]->vtSema && infoRec->ReadPixmap &&
+ (pWin->drawable.bitsPerPixel == pPixmap->drawable.bitsPerPixel)) {
+ BoxPtr pbox = REGION_RECTS(prgnSave);
+ int nboxes = REGION_NUM_RECTS(prgnSave);
+ int Bpp = pPixmap->drawable.bitsPerPixel >> 3;
+ unsigned char *dstp = (unsigned char*)pPixmap->devPrivate.ptr;
+
+ while(nboxes--) {
+ (*infoRec->ReadPixmap)(infoRec->pScrn,
+ pbox->x1 + xorg, pbox->y1 + yorg,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ dstp + (pPixmap->devKind * pbox->y1) + (pbox->x1 * Bpp),
+ pPixmap->devKind,
+ pPixmap->drawable.bitsPerPixel, pPixmap->drawable.depth);
+ pbox++;
+ }
+ return;
+ }
+
+ XAA_SCREEN_PROLOGUE (pScreen, BackingStoreFuncs.SaveAreas);
+ if(pScrn->vtSema) {
+ SYNC_CHECK(&pWin->drawable);
+ }
+ (*pScreen->BackingStoreFuncs.SaveAreas) (
+ pPixmap, prgnSave, xorg, yorg, pWin);
+
+ XAA_SCREEN_EPILOGUE (pScreen, BackingStoreFuncs.SaveAreas,
+ XAASaveAreas);
+}
+
+static void
+XAARestoreAreas (
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+
+ if(IS_OFFSCREEN_PIXMAP(pPixmap)) {
+ BoxPtr pbox = REGION_RECTS(prgnRestore);
+ int nboxes = REGION_NUM_RECTS(prgnRestore);
+ int pm = ~0;
+
+ if((pScrn->overlayFlags & OVERLAY_8_32_PLANAR) &&
+ (pWin->drawable.depth == 24))
+ pm = 0x00ffffff;
+
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, GXcopy, pm, -1);
+ while(nboxes--) {
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pPixmap->drawable.x + pbox->x1 - xorg,
+ pPixmap->drawable.y + pbox->y1 - yorg,
+ pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+ pbox++;
+ }
+ SET_SYNC_FLAG(infoRec);
+ return;
+ }
+
+ if(pScrn->vtSema && infoRec->WritePixmap &&
+ !(infoRec->WritePixmapFlags & NO_GXCOPY) &&
+ ((pWin->drawable.bitsPerPixel == pPixmap->drawable.bitsPerPixel) ||
+ ((pWin->drawable.bitsPerPixel == 24) &&
+ (pPixmap->drawable.bitsPerPixel == 32) &&
+ (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP)))) {
+ BoxPtr pbox = REGION_RECTS(prgnRestore);
+ int nboxes = REGION_NUM_RECTS(prgnRestore);
+ int Bpp = pPixmap->drawable.bitsPerPixel >> 3;
+ unsigned char *srcp = (unsigned char*)pPixmap->devPrivate.ptr;
+ int pm = ~0;
+
+ if((pScrn->overlayFlags & OVERLAY_8_32_PLANAR) &&
+ (pWin->drawable.depth == 24))
+ pm = 0x00ffffff;
+
+ while(nboxes--) {
+ (*infoRec->WritePixmap)(pScrn, pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ srcp + (pPixmap->devKind * (pbox->y1 - yorg)) +
+ ((pbox->x1 - xorg) * Bpp),
+ pPixmap->devKind, GXcopy, pm, -1,
+ pPixmap->drawable.bitsPerPixel, pPixmap->drawable.depth);
+ pbox++;
+ }
+ return;
+ }
+
+ XAA_SCREEN_PROLOGUE (pScreen, BackingStoreFuncs.RestoreAreas);
+ if(pScrn->vtSema) {
+ SYNC_CHECK(&pWin->drawable);
+ }
+ (*pScreen->BackingStoreFuncs.RestoreAreas) (
+ pPixmap, prgnRestore, xorg, yorg, pWin);
+
+ XAA_SCREEN_EPILOGUE (pScreen, BackingStoreFuncs.RestoreAreas,
+ XAARestoreAreas);
+}
+
+static int
+XAAPixmapBPP (ScreenPtr pScreen, int depth)
+{
+ PixmapPtr pPix;
+ int bpp;
+ DestroyPixmapProcPtr destroyPixmap;
+
+ XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
+ pPix = (*pScreen->CreatePixmap) (pScreen, 1, 1, depth);
+ XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
+ if (!pPix)
+ return 0;
+ bpp = pPix->drawable.bitsPerPixel;
+ destroyPixmap = pScreen->DestroyPixmap;
+ XAA_SCREEN_PROLOGUE (pScreen, DestroyPixmap);
+ (*pScreen->DestroyPixmap) (pPix);
+ XAA_SCREEN_EPILOGUE (pScreen, DestroyPixmap, destroyPixmap);
+ return bpp;
+}
+
+static void
+XAAInitializeOffscreenDepths (ScreenPtr pScreen)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ int d, dep;
+
+ infoRec->offscreenDepthsInitialized = TRUE;
+ infoRec->offscreenDepths = 0;
+ if (infoRec->Flags & OFFSCREEN_PIXMAPS) {
+ for (d = 0; d < pScreen->numDepths; d++) {
+ dep = pScreen->allowedDepths[d].depth;
+ if (XAAPixmapBPP (pScreen, dep) == pScrn->bitsPerPixel)
+ infoRec->offscreenDepths |= (1 << (dep - 1));
+ }
+ }
+}
+
+static PixmapPtr
+XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XAAPixmapPtr pPriv;
+ PixmapPtr pPix = NULL;
+ int size = w * h;
+
+ if (!infoRec->offscreenDepthsInitialized)
+ XAAInitializeOffscreenDepths (pScreen);
+
+ if(pScrn->vtSema && (infoRec->offscreenDepths & (1 << (depth - 1))) &&
+ (size >= MIN_OFFPIX_SIZE) && !SwitchedOut &&
+ (!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) &&
+ (!infoRec->maxOffPixHeight || (h <= infoRec->maxOffPixHeight)) )
+ {
+ PixmapLinkPtr pLink;
+ PixmapPtr pScreenPix;
+ FBAreaPtr area;
+ int gran = 0;
+
+ switch(pScrn->bitsPerPixel) {
+ case 24:
+ case 8: gran = 4; break;
+ case 16: gran = 2; break;
+ case 32: gran = 1; break;
+ default: break;
+ }
+
+ if(BITMAP_SCANLINE_PAD == 64)
+ gran *= 2;
+
+ if(!(area = xf86AllocateOffscreenArea(pScreen, w, h, gran, 0,
+ XAARemoveAreaCallback, NULL))) {
+ goto BAILOUT;
+ }
+
+ if(!(pLink = xalloc(sizeof(PixmapLink)))) {
+ xf86FreeOffscreenArea(area);
+ goto BAILOUT;
+ }
+
+ XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
+ pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth);
+ XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
+
+ if (!pPix) {
+ xfree (pLink);
+ xf86FreeOffscreenArea(area);
+ goto BAILOUT;
+ }
+
+ pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
+
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ pPix->drawable.x = area->box.x1;
+ pPix->drawable.y = area->box.y1;
+ pPix->drawable.width = w;
+ pPix->drawable.height = h;
+ pPix->drawable.bitsPerPixel = pScrn->bitsPerPixel;
+ pPix->devKind = pScreenPix->devKind;
+ pPix->devPrivate.ptr = pScreenPix->devPrivate.ptr;
+ area->devPrivate.ptr = pPix;
+
+ pPriv->flags = OFFSCREEN;
+ pPriv->offscreenArea = area;
+ pPriv->freeData = FALSE;
+
+ pLink->next = infoRec->OffscreenPixmaps;
+ pLink->pPix = pPix;
+ infoRec->OffscreenPixmaps = pLink;
+ return pPix;
+ }
+BAILOUT:
+ XAA_SCREEN_PROLOGUE (pScreen, CreatePixmap);
+ pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
+ XAA_SCREEN_EPILOGUE (pScreen, CreatePixmap, XAACreatePixmap);
+
+ if(pPix) {
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ pPriv->flags = 0;
+ pPriv->offscreenArea = NULL;
+ pPriv->freeData = FALSE;
+ if(!w || !h) /* either scratch or shared memory */
+ pPriv->flags |= SHARED_PIXMAP;
+ }
+
+ return pPix;
+}
+
+static Bool
+XAADestroyPixmap(PixmapPtr pPix)
+{
+ ScreenPtr pScreen = pPix->drawable.pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ Bool ret;
+
+ if(pPix->refcnt == 1) {
+ if(pPriv->flags & OFFSCREEN) {
+ if(pPriv->flags & DGA_PIXMAP)
+ xfree(pPriv->offscreenArea);
+ else {
+ FBAreaPtr area = pPriv->offscreenArea;
+ PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
+ PixmapLinkPtr prev = NULL;
+
+ while(pLink->pPix != pPix) {
+ prev = pLink;
+ pLink = pLink->next;
+ }
+
+ if(prev) prev->next = pLink->next;
+ else infoRec->OffscreenPixmaps = pLink->next;
+
+ if(!area) area = pLink->area;
+
+ xf86FreeOffscreenArea(area);
+ pPriv->offscreenArea = NULL;
+ xfree(pLink);
+ }
+ }
+
+ if(pPriv->freeData) { /* pixmaps that were once in video ram */
+ xfree(pPix->devPrivate.ptr);
+ pPix->devPrivate.ptr = NULL;
+ }
+ }
+
+ XAA_SCREEN_PROLOGUE (pScreen, DestroyPixmap);
+ ret = (*pScreen->DestroyPixmap) (pPix);
+ XAA_SCREEN_EPILOGUE (pScreen, DestroyPixmap, XAADestroyPixmap);
+
+ return ret;
+}
+
+static Bool
+XAAChangeWindowAttributes (WindowPtr pWin, unsigned long mask)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ Bool ret;
+
+ XAA_SCREEN_PROLOGUE (pScreen, ChangeWindowAttributes);
+ ret = (*pScreen->ChangeWindowAttributes) (pWin, mask);
+ XAA_SCREEN_EPILOGUE (pScreen, ChangeWindowAttributes, XAAChangeWindowAttributes);
+
+ /* we have to assume that shared memory pixmaps are dirty
+ because we can't wrap operations on them */
+
+ if((mask & CWBackPixmap) && (pWin->backgroundState == BackgroundPixmap) &&
+ PIXMAP_IS_SHARED(pWin->background.pixmap))
+ {
+ XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pWin->background.pixmap);
+ pPixPriv->flags |= DIRTY;
+ }
+ if((mask & CWBorderPixmap) && !(pWin->borderIsPixel) &&
+ PIXMAP_IS_SHARED(pWin->border.pixmap))
+ {
+ XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pWin->border.pixmap);
+ pPixPriv->flags |= DIRTY;
+ }
+
+ return ret;
+}
+
+
+
+/* These two aren't really needed for anything */
+
+static Bool
+XAAEnterVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ XAAScreenPtr pScreenPriv =
+ (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
+
+ return((*pScreenPriv->EnterVT)(index, flags));
+}
+
+static void
+XAALeaveVT(int index, int flags)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ XAAScreenPtr pScreenPriv =
+ (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
+ XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec;
+
+ if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+
+ (*pScreenPriv->LeaveVT)(index, flags);
+}
+
+typedef struct {
+ Bool UsingPixmapCache;
+ Bool CanDoColor8x8;
+ Bool CanDoMono8x8;
+} SavedCacheState, *SavedCacheStatePtr;
+
+static int
+XAASetDGAMode(int index, int num, DGADevicePtr devRet)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ XAAScreenPtr pScreenPriv =
+ (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
+ int ret;
+
+ if (!num && infoRec->dgaSaves) { /* restore old pixmap cache state */
+ SavedCacheStatePtr state = (SavedCacheStatePtr)infoRec->dgaSaves;
+
+ infoRec->UsingPixmapCache = state->UsingPixmapCache;
+ infoRec->CanDoColor8x8 = state->CanDoColor8x8;
+ infoRec->CanDoMono8x8 = state->CanDoMono8x8;
+ xfree(infoRec->dgaSaves);
+ infoRec->dgaSaves = NULL;
+ }
+
+ ret = (*pScreenPriv->SetDGAMode)(index, num, devRet);
+ if(ret != Success) return ret;
+
+ if(num && devRet->pPix) { /* accelerate this pixmap */
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(devRet->pPix);
+ FBAreaPtr area;
+
+ if((area = xalloc(sizeof(FBArea)))) {
+ area->pScreen = pScreen;
+ area->box.x1 = 0;
+ area->box.x2 = 0;
+ area->box.y1 = devRet->mode->pixmapWidth;
+ area->box.y2 = devRet->mode->pixmapHeight;
+ area->granularity = 0;
+ area->MoveAreaCallback = 0;
+ area->RemoveAreaCallback = 0;
+ area->devPrivate.ptr = 0;
+
+ pixPriv->flags |= OFFSCREEN | DGA_PIXMAP;
+ pixPriv->offscreenArea = area;
+
+ if(!infoRec->dgaSaves) { /* save pixmap cache state */
+ SavedCacheStatePtr state = xalloc(sizeof(SavedCacheState));
+
+ state->UsingPixmapCache = infoRec->UsingPixmapCache;
+ state->CanDoColor8x8 = infoRec->CanDoColor8x8;
+ state->CanDoMono8x8 = infoRec->CanDoMono8x8;
+ infoRec->dgaSaves = (char*)state;
+
+ infoRec->UsingPixmapCache = FALSE;
+ if(infoRec->PixmapCacheFlags & CACHE_MONO_8x8)
+ infoRec->CanDoMono8x8 = FALSE;
+ if(infoRec->PixmapCacheFlags & CACHE_COLOR_8x8)
+ infoRec->CanDoColor8x8 = FALSE;
+ }
+ }
+ }
+
+ return ret;
+}
+
+
+
+static void
+XAAEnableDisableFBAccess (int index, Bool enable)
+{
+ ScreenPtr pScreen = screenInfo.screens[index];
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ XAAScreenPtr pScreenPriv =
+ (XAAScreenPtr) pScreen->devPrivates[XAAScreenIndex].ptr;
+
+ if(!enable) {
+ if((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps))
+ XAAMoveOutOffscreenPixmaps(pScreen);
+ if(infoRec->Flags & PIXMAP_CACHE)
+ XAAInvalidatePixmapCache(pScreen);
+ SwitchedOut = TRUE;
+ }
+
+ (*pScreenPriv->EnableDisableFBAccess)(index, enable);
+
+ if(enable) {
+ if((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps))
+ XAAMoveInOffscreenPixmaps(pScreen);
+ SwitchedOut = FALSE;
+ }
+}
diff --git a/hw/xfree86/xaa/xaaInitAccel.c b/hw/xfree86/xaa/xaaInitAccel.c
new file mode 100644
index 000000000..1b1bc1830
--- /dev/null
+++ b/hw/xfree86/xaa/xaaInitAccel.c
@@ -0,0 +1,1513 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c,v 1.36 2003/01/12 03:55:51 tsi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xf86fbman.h"
+#include "servermd.h"
+
+#ifdef XFree86LOADER
+static const OptionInfoRec *XAAAvailableOptions(void *unused);
+#endif
+
+/*
+ * XAA Config options
+ */
+
+typedef enum {
+ XAAOPT_SCREEN_TO_SCREEN_COPY,
+ XAAOPT_SOLID_FILL_RECT,
+ XAAOPT_SOLID_FILL_TRAP,
+ XAAOPT_SOLID_TWO_POINT_LINE,
+ XAAOPT_SOLID_BRESENHAM_LINE,
+ XAAOPT_SOLID_HORVERT_LINE,
+ XAAOPT_DASHED_TWO_POINT_LINE,
+ XAAOPT_DASHED_BRESENHAM_LINE,
+ XAAOPT_MONO_8x8_PATTERN_FILL_RECT,
+ XAAOPT_MONO_8x8_PATTERN_FILL_TRAP,
+ XAAOPT_COL_8x8_PATTERN_FILL_RECT,
+ XAAOPT_COL_8x8_PATTERN_FILL_TRAP,
+ XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL,
+ XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL,
+ XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL,
+ XAAOPT_IMAGE_WRITE_RECT,
+ XAAOPT_SCANLINE_IMAGE_WRITE_RECT,
+ XAAOPT_WRITE_BITMAP,
+ XAAOPT_WRITE_PIXMAP,
+ XAAOPT_PIXMAP_CACHE,
+ XAAOPT_OFFSCREEN_PIXMAPS
+} XAAOpts;
+
+static const OptionInfoRec XAAOptions[] = {
+ {XAAOPT_SCREEN_TO_SCREEN_COPY, "XaaNoScreenToScreenCopy",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_SOLID_FILL_RECT, "XaaNoSolidFillRect",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_SOLID_FILL_TRAP, "XaaNoSolidFillTrap",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_SOLID_TWO_POINT_LINE, "XaaNoSolidTwoPointLine",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_SOLID_BRESENHAM_LINE, "XaaNoSolidBresenhamLine",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_SOLID_HORVERT_LINE, "XaaNoSolidHorVertLine",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_DASHED_TWO_POINT_LINE, "XaaNoDashedTwoPointLine",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_DASHED_BRESENHAM_LINE, "XaaNoDashedBresenhamLine",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_MONO_8x8_PATTERN_FILL_RECT, "XaaNoMono8x8PatternFillRect",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_MONO_8x8_PATTERN_FILL_TRAP, "XaaNoMono8x8PatternFillTrap",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_COL_8x8_PATTERN_FILL_RECT, "XaaNoColor8x8PatternFillRect",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_COL_8x8_PATTERN_FILL_TRAP, "XaaNoColor8x8PatternFillTrap",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL, "XaaNoCPUToScreenColorExpandFill",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL,"XaaNoScanlineCPUToScreenColorExpandFill",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL, "XaaNoScreenToScreenColorExpandFill",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_IMAGE_WRITE_RECT, "XaaNoImageWriteRect",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_SCANLINE_IMAGE_WRITE_RECT, "XaaNoScanlineImageWriteRect",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_WRITE_BITMAP, "XaaNoWriteBitmap",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_WRITE_PIXMAP, "XaaNoWritePixmap",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_PIXMAP_CACHE, "XaaNoPixmapCache",
+ OPTV_BOOLEAN, {0}, FALSE },
+ {XAAOPT_OFFSCREEN_PIXMAPS, "XaaNoOffscreenPixmaps",
+ OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL,
+ OPTV_NONE, {0}, FALSE }
+};
+
+#ifdef XFree86LOADER
+static MODULESETUPPROTO(xaaSetup);
+
+static XF86ModuleVersionInfo xaaVersRec =
+{
+ "xaa",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 1, 0,
+ ABI_CLASS_VIDEODRV, /* requires the video driver ABI */
+ ABI_VIDEODRV_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0}
+};
+
+XF86ModuleData xaaModuleData = { &xaaVersRec, xaaSetup, NULL };
+
+ModuleInfoRec XAA = {
+ 1,
+ "XAA",
+ NULL,
+ 0,
+ XAAAvailableOptions,
+};
+
+/*ARGSUSED*/
+static pointer
+xaaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
+{
+ static Bool Initialised = FALSE;
+
+ if (!Initialised) {
+ Initialised = TRUE;
+#ifndef REMOVE_LOADER_CHECK_MODULE_INFO
+ if (xf86LoaderCheckSymbol("xf86AddModuleInfo"))
+#endif
+ xf86AddModuleInfo(&XAA, Module);
+ }
+
+ return (pointer)TRUE;
+}
+
+/*ARGSUSED*/
+static const OptionInfoRec *
+XAAAvailableOptions(void *unused)
+{
+ return (XAAOptions);
+}
+#endif
+
+Bool
+XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
+{
+ int index = pScreen->myNum;
+ ScrnInfoPtr pScrn = xf86Screens[index];
+ Bool HaveScreenToScreenCopy = FALSE;
+ Bool HaveColorExpansion = FALSE;
+ Bool HaveScanlineColorExpansion = FALSE;
+ Bool HaveSolidFillRect = FALSE;
+ Bool HaveMono8x8PatternFillRect = FALSE;
+ Bool HaveColor8x8PatternFillRect = FALSE;
+ Bool HaveSolidFillTrap = FALSE;
+ Bool HaveMono8x8PatternFillTrap = FALSE;
+ Bool HaveColor8x8PatternFillTrap = FALSE;
+ Bool HaveSolidTwoPointLine = FALSE;
+ Bool HaveSolidBresenhamLine = FALSE;
+ Bool HaveSolidHorVertLine = FALSE;
+ Bool HaveDashedTwoPointLine = FALSE;
+ Bool HaveDashedBresenhamLine = FALSE;
+ Bool HaveImageWriteRect = FALSE;
+ Bool HaveScanlineImageWriteRect = FALSE;
+ Bool HaveScreenToScreenColorExpandFill = FALSE;
+ OptionInfoPtr options;
+ int is_shared = 0;
+ int i;
+
+ options = xnfalloc(sizeof(XAAOptions));
+ (void)memcpy(options, XAAOptions, sizeof(XAAOptions));
+ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
+
+ infoRec->pScrn = pScrn;
+ infoRec->NeedToSync = FALSE;
+
+ /* must have a Sync function */
+ if(!infoRec->Sync) return FALSE;
+ for(i = 0; i < pScrn->numEntities; i++) {
+ if(xf86IsEntityShared(pScrn->entityList[i])) is_shared = 1;
+ }
+
+ /* If this PCI entity has IS_SHARED_ACCEL set in entityProp
+ * then a RestoreAccelState function is required
+ */
+ if(!infoRec->RestoreAccelState && is_shared) return FALSE;
+
+ if(infoRec->RestoreAccelState) {
+ if(!XAAInitStateWrap(pScreen, infoRec)) return FALSE;
+ }
+
+ if (serverGeneration == 1)
+ xf86DrvMsg(index, X_INFO,
+ "Using XFree86 Acceleration Architecture (XAA)\n");
+
+
+ /************** Low Level *************/
+
+ if(!infoRec->SetClippingRectangle || !infoRec->DisableClipping) {
+ infoRec->ClippingFlags = 0;
+ infoRec->SetClippingRectangle = NULL;
+ infoRec->DisableClipping = NULL;
+ }
+
+ /**** CopyArea ****/
+
+ if(infoRec->SetupForScreenToScreenCopy &&
+ infoRec->SubsequentScreenToScreenCopy &&
+ !xf86IsOptionSet(options, XAAOPT_SCREEN_TO_SCREEN_COPY)) {
+ HaveScreenToScreenCopy = TRUE;
+ } else {
+ infoRec->ScreenToScreenCopyFlags = 0;
+ infoRec->SetupForScreenToScreenCopy = NULL;
+ infoRec->SubsequentScreenToScreenCopy = NULL;
+ }
+
+ /**** Solid Filled Rects ****/
+
+ if(infoRec->SetupForSolidFill && infoRec->SubsequentSolidFillRect &&
+ !xf86IsOptionSet(options, XAAOPT_SOLID_FILL_RECT)) {
+ HaveSolidFillRect = TRUE;
+ if(infoRec->SubsequentSolidFillTrap &&
+ !xf86IsOptionSet(options, XAAOPT_SOLID_FILL_TRAP))
+ HaveSolidFillTrap = TRUE;
+ else
+ infoRec->SubsequentSolidFillTrap = NULL;
+ } else {
+ infoRec->SolidFillFlags = 0;
+ infoRec->SetupForSolidFill = NULL;
+ infoRec->SubsequentSolidFillRect = NULL;
+ infoRec->SubsequentSolidFillTrap = NULL;
+ }
+
+ /**** Solid lines ****/
+
+ if(infoRec->SetupForSolidLine) {
+ if(infoRec->SubsequentSolidTwoPointLine &&
+ !xf86IsOptionSet(options, XAAOPT_SOLID_TWO_POINT_LINE))
+ HaveSolidTwoPointLine = TRUE;
+ if(infoRec->SubsequentSolidBresenhamLine &&
+ !xf86IsOptionSet(options, XAAOPT_SOLID_BRESENHAM_LINE)) {
+ HaveSolidBresenhamLine = TRUE;
+
+ if(infoRec->SolidBresenhamLineErrorTermBits)
+ infoRec->SolidBresenhamLineErrorTermBits =
+ ~((1 << infoRec->SolidBresenhamLineErrorTermBits) - 1);
+ }
+
+ if(infoRec->SubsequentSolidHorVertLine &&
+ !xf86IsOptionSet(options, XAAOPT_SOLID_HORVERT_LINE))
+ HaveSolidHorVertLine = TRUE;
+ else if(HaveSolidTwoPointLine) {
+ infoRec->SubsequentSolidHorVertLine =
+ XAASolidHorVertLineAsTwoPoint;
+ HaveSolidHorVertLine = TRUE;
+ } else if(HaveSolidBresenhamLine) {
+ infoRec->SubsequentSolidHorVertLine =
+ XAASolidHorVertLineAsBresenham;
+ HaveSolidHorVertLine = TRUE;
+ }
+ }
+
+ /* XXX Should this also check for XAAOPT_SOLID_HORVERT_LINE? */
+ if (!HaveSolidTwoPointLine &&
+ !HaveSolidBresenhamLine &&
+ !HaveSolidHorVertLine &&
+ HaveSolidFillRect) {
+ infoRec->SetupForSolidLine = infoRec->SetupForSolidFill;
+ infoRec->SubsequentSolidHorVertLine = XAASolidHorVertLineAsRects;
+ infoRec->SolidLineFlags = infoRec->SolidFillFlags;
+ HaveSolidHorVertLine = TRUE;
+ }
+
+ if (!HaveSolidTwoPointLine)
+ infoRec->SubsequentSolidTwoPointLine = NULL;
+ if (!HaveSolidBresenhamLine)
+ infoRec->SubsequentSolidBresenhamLine = NULL;
+ if (!HaveSolidHorVertLine)
+ infoRec->SubsequentSolidHorVertLine = NULL;
+
+ /* Disable all if nothing left over */
+ if (!HaveSolidTwoPointLine &&
+ !HaveSolidBresenhamLine &&
+ !HaveSolidHorVertLine) {
+ infoRec->SolidLineFlags = 0;
+ infoRec->SetupForSolidLine = NULL;
+ }
+
+ /**** 8x8 Mono Pattern Filled Rects ****/
+
+ if(infoRec->SetupForMono8x8PatternFill &&
+ infoRec->SubsequentMono8x8PatternFillRect &&
+ !xf86IsOptionSet(options, XAAOPT_MONO_8x8_PATTERN_FILL_RECT)) {
+ HaveMono8x8PatternFillRect = TRUE;
+ if(infoRec->SubsequentMono8x8PatternFillTrap &&
+ !xf86IsOptionSet(options, XAAOPT_MONO_8x8_PATTERN_FILL_TRAP))
+ HaveMono8x8PatternFillTrap = TRUE;
+
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_BITS) {
+ infoRec->CanDoMono8x8 = TRUE;
+ } else { /* others require caching */
+ int min_pitch;
+ infoRec->PixmapCacheFlags |= CACHE_MONO_8x8;
+
+ switch(pScrn->bitsPerPixel) {
+ case 32: min_pitch = 2; break;
+ case 24: min_pitch = 3; break;
+ case 16: min_pitch = 4; break;
+ default: min_pitch = 8; break;
+ }
+
+ if(min_pitch > infoRec->MonoPatternPitch)
+ infoRec->MonoPatternPitch = min_pitch;
+
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
+ if(!infoRec->CacheWidthMono8x8Pattern ||
+ !infoRec->CacheHeightMono8x8Pattern) {
+ infoRec->CacheWidthMono8x8Pattern =
+ infoRec->MonoPatternPitch;
+ infoRec->CacheHeightMono8x8Pattern = 1;
+ }
+ } else {
+ int numPerLine = 128/infoRec->MonoPatternPitch;
+
+ if(!infoRec->CacheWidthMono8x8Pattern ||
+ !infoRec->CacheHeightMono8x8Pattern) {
+ infoRec->CacheWidthMono8x8Pattern =
+ numPerLine * infoRec->MonoPatternPitch;
+ infoRec->CacheHeightMono8x8Pattern =
+ (64 + numPerLine - 1)/numPerLine;
+ }
+ }
+ }
+ } else {
+ infoRec->Mono8x8PatternFillFlags = 0;
+ infoRec->SetupForMono8x8PatternFill = NULL;
+ infoRec->SubsequentMono8x8PatternFillRect = NULL;
+ }
+
+ /**** Dashed lines ****/
+
+ if(infoRec->SetupForDashedLine && infoRec->DashPatternMaxLength) {
+ if(infoRec->SubsequentDashedTwoPointLine &&
+ !xf86IsOptionSet(options, XAAOPT_DASHED_TWO_POINT_LINE))
+ HaveDashedTwoPointLine = TRUE;
+ if(infoRec->SubsequentDashedBresenhamLine &&
+ !xf86IsOptionSet(options, XAAOPT_DASHED_BRESENHAM_LINE)) {
+ HaveDashedBresenhamLine = TRUE;
+
+ if(infoRec->DashedBresenhamLineErrorTermBits)
+ infoRec->DashedBresenhamLineErrorTermBits =
+ ~((1 << infoRec->DashedBresenhamLineErrorTermBits) - 1);
+ }
+ }
+
+ if (!HaveDashedTwoPointLine)
+ infoRec->SubsequentDashedTwoPointLine = NULL;
+ if (!HaveDashedBresenhamLine)
+ infoRec->SubsequentDashedBresenhamLine = NULL;
+
+ /* Disable all if nothing left over */
+ if (!HaveDashedTwoPointLine && !HaveDashedBresenhamLine) {
+ infoRec->DashedLineFlags = 0;
+ infoRec->SetupForDashedLine = NULL;
+ }
+
+ /**** 8x8 Color Pattern Filled Rects ****/
+
+ if(infoRec->SetupForColor8x8PatternFill &&
+ infoRec->SubsequentColor8x8PatternFillRect &&
+ !xf86IsOptionSet(options, XAAOPT_COL_8x8_PATTERN_FILL_RECT)) {
+ HaveColor8x8PatternFillRect = TRUE;
+ if(infoRec->SubsequentColor8x8PatternFillTrap &&
+ !xf86IsOptionSet(options, XAAOPT_COL_8x8_PATTERN_FILL_TRAP))
+ HaveColor8x8PatternFillTrap = TRUE;
+ else
+ infoRec->SubsequentColor8x8PatternFillTrap = NULL;
+
+ infoRec->PixmapCacheFlags |= CACHE_COLOR_8x8;
+
+ if(infoRec->Color8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
+ if(!infoRec->CacheWidthColor8x8Pattern ||
+ !infoRec->CacheHeightColor8x8Pattern) {
+ infoRec->CacheWidthColor8x8Pattern = 64;
+ infoRec->CacheHeightColor8x8Pattern = 1;
+ }
+ } else {
+ if(!infoRec->CacheWidthColor8x8Pattern ||
+ !infoRec->CacheHeightColor8x8Pattern) {
+ infoRec->CacheWidthColor8x8Pattern = 128;
+ infoRec->CacheHeightColor8x8Pattern = 8;
+ }
+ }
+ } else {
+ infoRec->Color8x8PatternFillFlags = 0;
+ infoRec->SetupForColor8x8PatternFill = NULL;
+ infoRec->SubsequentColor8x8PatternFillRect = NULL;
+ infoRec->SubsequentColor8x8PatternFillTrap = NULL;
+ }
+
+ /**** Color Expansion ****/
+
+ if(infoRec->SetupForCPUToScreenColorExpandFill &&
+ infoRec->ColorExpandBase &&
+ infoRec->SubsequentCPUToScreenColorExpandFill &&
+ !xf86IsOptionSet(options, XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL)) {
+ int dwordsNeeded = pScrn->virtualX;
+
+ infoRec->ColorExpandRange >>= 2; /* convert to DWORDS */
+ HaveColorExpansion = TRUE;
+
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ LEFT_EDGE_CLIPPING_NEGATIVE_X)
+ dwordsNeeded += 31;
+ dwordsNeeded = (dwordsNeeded + 31) >> 5;
+ if(dwordsNeeded > infoRec->ColorExpandRange)
+ infoRec->CPUToScreenColorExpandFillFlags |= CPU_TRANSFER_BASE_FIXED;
+ } else {
+ infoRec->CPUToScreenColorExpandFillFlags = 0;
+ infoRec->SetupForCPUToScreenColorExpandFill = NULL;
+ infoRec->SubsequentCPUToScreenColorExpandFill = NULL;
+ }
+
+ /**** Scanline Color Expansion ****/
+
+ if(infoRec->SetupForScanlineCPUToScreenColorExpandFill &&
+ infoRec->SubsequentScanlineCPUToScreenColorExpandFill &&
+ infoRec->SubsequentColorExpandScanline &&
+ infoRec->ScanlineColorExpandBuffers &&
+ (infoRec->NumScanlineColorExpandBuffers > 0) &&
+ !xf86IsOptionSet(options, XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL)) {
+ HaveScanlineColorExpansion = TRUE;
+ } else {
+ infoRec->ScanlineCPUToScreenColorExpandFillFlags = 0;
+ infoRec->SetupForScanlineCPUToScreenColorExpandFill = NULL;
+ infoRec->SubsequentScanlineCPUToScreenColorExpandFill = NULL;
+ infoRec->SubsequentColorExpandScanline = NULL;
+ }
+
+ /**** Screen to Screen Color Expansion ****/
+
+ if(infoRec->SetupForScreenToScreenColorExpandFill &&
+ infoRec->SubsequentScreenToScreenColorExpandFill &&
+ !xf86IsOptionSet(options, XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL)) {
+ HaveScreenToScreenColorExpandFill = TRUE;
+ if (!infoRec->CacheColorExpandDensity)
+ infoRec->CacheColorExpandDensity = 1;
+ } else {
+ infoRec->ScreenToScreenColorExpandFillFlags = 0;
+ infoRec->SetupForScreenToScreenColorExpandFill = NULL;
+ infoRec->SubsequentScreenToScreenColorExpandFill = NULL;
+ }
+
+ /**** Image Writes ****/
+
+ if(infoRec->SetupForImageWrite && infoRec->ImageWriteBase &&
+ infoRec->SubsequentImageWriteRect &&
+ !xf86IsOptionSet(options, XAAOPT_IMAGE_WRITE_RECT)) {
+
+ infoRec->ImageWriteRange >>= 2; /* convert to DWORDS */
+ if(infoRec->ImageWriteFlags & CPU_TRANSFER_BASE_FIXED)
+ infoRec->ImageWriteRange = 0;
+ HaveImageWriteRect = TRUE;
+ } else {
+ infoRec->ImageWriteFlags = 0;
+ infoRec->SetupForImageWrite = NULL;
+ infoRec->SubsequentImageWriteRect = NULL;
+ }
+
+ /**** Scanline Image Writes ****/
+
+ if(infoRec->SetupForScanlineImageWrite &&
+ infoRec->SubsequentScanlineImageWriteRect &&
+ infoRec->SubsequentImageWriteScanline &&
+ infoRec->ScanlineImageWriteBuffers &&
+ (infoRec->NumScanlineImageWriteBuffers > 0) &&
+ !xf86IsOptionSet(options, XAAOPT_SCANLINE_IMAGE_WRITE_RECT)) {
+ HaveScanlineImageWriteRect = TRUE;
+ } else {
+ infoRec->ScanlineImageWriteFlags = 0;
+ infoRec->SetupForScanlineImageWrite = NULL;
+ infoRec->SubsequentScanlineImageWriteRect = NULL;
+ infoRec->SubsequentImageWriteScanline = NULL;
+ }
+
+#ifndef __i386__
+ /* XAA makes some unaligned accesses when clipping is not available */
+# define CLIP_FLAGS (LEFT_EDGE_CLIPPING | LEFT_EDGE_CLIPPING_NEGATIVE_X)
+ if(HaveImageWriteRect &&
+ ((infoRec->ImageWriteFlags & CLIP_FLAGS) != CLIP_FLAGS))
+ {
+ HaveImageWriteRect = FALSE;
+ }
+ if(HaveScanlineImageWriteRect &&
+ ((infoRec->ScanlineImageWriteFlags & CLIP_FLAGS) != CLIP_FLAGS))
+ {
+ HaveScanlineImageWriteRect = FALSE;
+ }
+#endif
+
+ if (serverGeneration == 1) {
+ if(HaveScreenToScreenCopy)
+ xf86ErrorF("\tScreen to screen bit blits\n");
+ if(HaveSolidFillRect)
+ xf86ErrorF("\tSolid filled rectangles\n");
+ if(HaveSolidFillTrap)
+ xf86ErrorF("\tSolid filled trapezoids\n");
+ if(HaveMono8x8PatternFillRect)
+ xf86ErrorF("\t8x8 mono pattern filled rectangles\n");
+ if(HaveMono8x8PatternFillTrap)
+ xf86ErrorF("\t8x8 mono pattern filled trapezoids\n");
+ if(HaveColor8x8PatternFillRect)
+ xf86ErrorF("\t8x8 color pattern filled rectangles\n");
+ if(HaveColor8x8PatternFillTrap)
+ xf86ErrorF("\t8x8 color pattern filled trapezoids\n");
+
+ if(HaveColorExpansion)
+ xf86ErrorF("\tCPU to Screen color expansion\n");
+ else if(HaveScanlineColorExpansion)
+ xf86ErrorF("\tIndirect CPU to Screen color expansion\n");
+
+ if(HaveScreenToScreenColorExpandFill)
+ xf86ErrorF("\tScreen to Screen color expansion\n");
+
+ if(HaveSolidTwoPointLine || HaveSolidBresenhamLine)
+ xf86ErrorF("\tSolid Lines\n");
+ else if(HaveSolidHorVertLine)
+ xf86ErrorF("\tSolid Horizontal and Vertical Lines\n");
+
+ if(HaveDashedTwoPointLine || HaveDashedBresenhamLine)
+ xf86ErrorF("\tDashed Lines\n");
+
+ if(HaveImageWriteRect)
+ xf86ErrorF("\tImage Writes\n");
+ else if(HaveScanlineImageWriteRect)
+ xf86ErrorF("\tScanline Image Writes\n");
+
+ }
+
+#define XAAMSG(s) do { if (serverGeneration == 1) xf86ErrorF(s); } while (0)
+
+ if((infoRec->Flags & OFFSCREEN_PIXMAPS) && HaveScreenToScreenCopy &&
+ !xf86IsOptionSet(options, XAAOPT_OFFSCREEN_PIXMAPS)) {
+ XAAMSG("\tOffscreen Pixmaps\n");
+ } else {
+ infoRec->Flags &= ~OFFSCREEN_PIXMAPS;
+ }
+
+
+ /************** Mid Level *************/
+
+ /**** ScreenToScreenBitBlt ****/
+
+ if(infoRec->ScreenToScreenBitBlt) {
+ XAAMSG("\tDriver provided ScreenToScreenBitBlt replacement\n");
+ } else if(HaveScreenToScreenCopy) {
+ infoRec->ScreenToScreenBitBlt = XAAScreenToScreenBitBlt;
+ infoRec->ScreenToScreenBitBltFlags = infoRec->ScreenToScreenCopyFlags;
+ }
+
+ /**** FillSolidRects ****/
+
+ if(infoRec->FillSolidRects) {
+ XAAMSG("\tDriver provided FillSolidRects replacement\n");
+ } else if(HaveSolidFillRect) {
+ infoRec->FillSolidRects = XAAFillSolidRects;
+ infoRec->FillSolidRectsFlags = infoRec->SolidFillFlags;
+ }
+
+ /**** FillSolidSpans ****/
+
+ if(infoRec->FillSolidSpans) {
+ XAAMSG("\tDriver provided FillSolidSpans replacement\n");
+ } else if(HaveSolidFillRect) {
+ infoRec->FillSolidSpans = XAAFillSolidSpans;
+ infoRec->FillSolidSpansFlags = infoRec->SolidFillFlags;
+ }
+
+ /**** FillMono8x8PatternRects ****/
+
+ if(infoRec->FillMono8x8PatternRects) {
+ XAAMSG("\tDriver provided FillMono8x8PatternRects replacement\n");
+ } else if(HaveMono8x8PatternFillRect) {
+ infoRec->FillMono8x8PatternRects =
+ (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
+ XAAFillMono8x8PatternRectsScreenOrigin :
+ XAAFillMono8x8PatternRects;
+
+ infoRec->FillMono8x8PatternRectsFlags =
+ infoRec->Mono8x8PatternFillFlags;
+ }
+
+ /**** FillMono8x8PatternSpans ****/
+
+ if(infoRec->FillMono8x8PatternSpans) {
+ XAAMSG("\tDriver provided FillMono8x8PatternSpans replacement\n");
+ } else if(HaveMono8x8PatternFillRect) {
+ infoRec->FillMono8x8PatternSpans =
+ (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
+ XAAFillMono8x8PatternSpansScreenOrigin:
+ XAAFillMono8x8PatternSpans;
+
+ infoRec->FillMono8x8PatternSpansFlags =
+ infoRec->Mono8x8PatternFillFlags;
+ }
+
+ /**** FillColor8x8Rects ****/
+
+ if(infoRec->FillColor8x8PatternRects) {
+ XAAMSG("\tDriver provided FillColor8x8PatternRects replacement\n");
+ } else if(HaveColor8x8PatternFillRect) {
+ infoRec->FillColor8x8PatternRects =
+ (infoRec->Color8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
+ XAAFillColor8x8PatternRectsScreenOrigin :
+ XAAFillColor8x8PatternRects;
+
+ infoRec->FillColor8x8PatternRectsFlags =
+ infoRec->Color8x8PatternFillFlags;
+ }
+
+ /**** FillColor8x8Spans ****/
+
+ if(infoRec->FillColor8x8PatternSpans) {
+ XAAMSG("\tDriver provided FillColor8x8PatternSpans replacement\n");
+ } else if(HaveColor8x8PatternFillRect) {
+ infoRec->FillColor8x8PatternSpans =
+ (infoRec->Color8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ?
+ XAAFillColor8x8PatternSpansScreenOrigin:
+ XAAFillColor8x8PatternSpans;
+
+ infoRec->FillColor8x8PatternSpansFlags =
+ infoRec->Color8x8PatternFillFlags;
+ }
+
+ /**** FillCacheBltRects ****/
+
+ if(infoRec->FillCacheBltRects) {
+ XAAMSG("\tDriver provided FillCacheBltRects replacement\n");
+ } else if(HaveScreenToScreenCopy) {
+ infoRec->FillCacheBltRects = XAAFillCacheBltRects;
+ infoRec->FillCacheBltRectsFlags = infoRec->ScreenToScreenCopyFlags;
+ }
+
+ /**** FillCacheBltSpans ****/
+
+ if(infoRec->FillCacheBltSpans) {
+ XAAMSG("\tDriver provided FillCacheBltSpans replacement\n");
+ } else if(HaveScreenToScreenCopy) {
+ infoRec->FillCacheBltSpans = XAAFillCacheBltSpans;
+ infoRec->FillCacheBltSpansFlags = infoRec->ScreenToScreenCopyFlags;
+ }
+
+ /**** FillCacheExpandRects ****/
+
+ if(infoRec->FillCacheExpandRects) {
+ XAAMSG("\tDriver provided FillCacheExpandRects replacement\n");
+ } else if(HaveScreenToScreenColorExpandFill) {
+ infoRec->FillCacheExpandRects = XAAFillCacheExpandRects;
+ infoRec->FillCacheExpandRectsFlags =
+ infoRec->ScreenToScreenColorExpandFillFlags;
+ }
+
+ /**** FillCacheExpandSpans ****/
+
+ if(infoRec->FillCacheExpandSpans) {
+ XAAMSG("\tDriver provided FillCacheExpandSpans replacement\n");
+ } else if(HaveScreenToScreenColorExpandFill) {
+ infoRec->FillCacheExpandSpans = XAAFillCacheExpandSpans;
+ infoRec->FillCacheExpandSpansFlags =
+ infoRec->ScreenToScreenColorExpandFillFlags;
+ }
+
+ /**** FillColorExpandRects ****/
+
+ if(infoRec->FillColorExpandRects) {
+ XAAMSG("\tDriver provided FillColorExpandRects replacement\n");
+ } else if(HaveColorExpansion) {
+ if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->FillColorExpandRects =
+ XAAFillColorExpandRects3MSBFirstFixedBase;
+ else
+ infoRec->FillColorExpandRects =
+ XAAFillColorExpandRects3MSBFirst;
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->FillColorExpandRects =
+ XAAFillColorExpandRects3LSBFirstFixedBase;
+ else
+ infoRec->FillColorExpandRects =
+ XAAFillColorExpandRects3LSBFirst;
+ }
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->FillColorExpandRects =
+ XAAFillColorExpandRectsMSBFirstFixedBase;
+ else
+ infoRec->FillColorExpandRects =
+ XAAFillColorExpandRectsMSBFirst;
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->FillColorExpandRects =
+ XAAFillColorExpandRectsLSBFirstFixedBase;
+ else
+ infoRec->FillColorExpandRects =
+ XAAFillColorExpandRectsLSBFirst;
+ }
+ }
+ infoRec->FillColorExpandRectsFlags =
+ infoRec->CPUToScreenColorExpandFillFlags;
+ } else if(HaveScanlineColorExpansion) {
+ if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ TRIPLE_BITS_24BPP) {
+ if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST)
+ infoRec->FillColorExpandRects =
+ XAAFillScanlineColorExpandRects3MSBFirst;
+ else
+ infoRec->FillColorExpandRects =
+ XAAFillScanlineColorExpandRects3LSBFirst;
+ } else {
+ if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST)
+ infoRec->FillColorExpandRects =
+ XAAFillScanlineColorExpandRectsMSBFirst;
+ else
+ infoRec->FillColorExpandRects =
+ XAAFillScanlineColorExpandRectsLSBFirst;
+ }
+ infoRec->FillColorExpandRectsFlags =
+ infoRec->ScanlineCPUToScreenColorExpandFillFlags;
+ }
+
+ /**** FillColorExpandSpans ****/
+
+ if(infoRec->FillColorExpandSpans) {
+ XAAMSG("\tDriver provided FillColorExpandSpans replacement\n");
+ } else if(HaveColorExpansion) {
+ if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->FillColorExpandSpans =
+ XAAFillColorExpandSpans3MSBFirstFixedBase;
+ else
+ infoRec->FillColorExpandSpans =
+ XAAFillColorExpandSpans3MSBFirst;
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->FillColorExpandSpans =
+ XAAFillColorExpandSpans3LSBFirstFixedBase;
+ else
+ infoRec->FillColorExpandSpans =
+ XAAFillColorExpandSpans3LSBFirst;
+ }
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->FillColorExpandSpans =
+ XAAFillColorExpandSpansMSBFirstFixedBase;
+ else
+ infoRec->FillColorExpandSpans =
+ XAAFillColorExpandSpansMSBFirst;
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->FillColorExpandSpans =
+ XAAFillColorExpandSpansLSBFirstFixedBase;
+ else
+ infoRec->FillColorExpandSpans =
+ XAAFillColorExpandSpansLSBFirst;
+ }
+ }
+ infoRec->FillColorExpandSpansFlags =
+ infoRec->CPUToScreenColorExpandFillFlags;
+ } else if(HaveScanlineColorExpansion) {
+ if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ TRIPLE_BITS_24BPP) {
+ if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST)
+ infoRec->FillColorExpandSpans =
+ XAAFillScanlineColorExpandSpans3MSBFirst;
+ else
+ infoRec->FillColorExpandSpans =
+ XAAFillScanlineColorExpandSpans3LSBFirst;
+ } else {
+ if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST)
+ infoRec->FillColorExpandSpans =
+ XAAFillScanlineColorExpandSpansMSBFirst;
+ else
+ infoRec->FillColorExpandSpans =
+ XAAFillScanlineColorExpandSpansLSBFirst;
+ }
+ infoRec->FillColorExpandSpansFlags =
+ infoRec->ScanlineCPUToScreenColorExpandFillFlags;
+ }
+
+ /**** FillImageWriteRects ****/
+
+ if(infoRec->FillImageWriteRects) {
+ XAAMSG("\tDriver provided FillImageWriteRects replacement\n");
+ } else if(HaveImageWriteRect &&
+ (infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
+ (infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING)) {
+ infoRec->FillImageWriteRects = XAAFillImageWriteRects;
+ infoRec->FillImageWriteRectsFlags = infoRec->ImageWriteFlags;
+ }
+
+ /**** WriteBitmap ****/
+
+ if(infoRec->WriteBitmap &&
+ !xf86IsOptionSet(options, XAAOPT_WRITE_BITMAP)) {
+ XAAMSG("\tDriver provided WriteBitmap replacement\n");
+ } else if(HaveColorExpansion) {
+ if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->WriteBitmap =
+ XAAWriteBitmapColorExpand3MSBFirstFixedBase;
+ else
+ infoRec->WriteBitmap = XAAWriteBitmapColorExpand3MSBFirst;
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->WriteBitmap =
+ XAAWriteBitmapColorExpand3LSBFirstFixedBase;
+ else
+ infoRec->WriteBitmap = XAAWriteBitmapColorExpand3LSBFirst;
+ }
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST) {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->WriteBitmap =
+ XAAWriteBitmapColorExpandMSBFirstFixedBase;
+ else
+ infoRec->WriteBitmap = XAAWriteBitmapColorExpandMSBFirst;
+ } else {
+ if(infoRec->CPUToScreenColorExpandFillFlags &
+ CPU_TRANSFER_BASE_FIXED)
+ infoRec->WriteBitmap =
+ XAAWriteBitmapColorExpandLSBFirstFixedBase;
+ else
+ infoRec->WriteBitmap = XAAWriteBitmapColorExpandLSBFirst;
+ }
+ }
+ infoRec->WriteBitmapFlags = infoRec->CPUToScreenColorExpandFillFlags;
+ } else if(HaveScanlineColorExpansion) {
+ if (infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ TRIPLE_BITS_24BPP) {
+ if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST)
+ infoRec->WriteBitmap =
+ XAAWriteBitmapScanlineColorExpand3MSBFirst;
+ else
+ infoRec->WriteBitmap =
+ XAAWriteBitmapScanlineColorExpand3LSBFirst;
+ } else {
+ if(infoRec->ScanlineCPUToScreenColorExpandFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST)
+ infoRec->WriteBitmap =
+ XAAWriteBitmapScanlineColorExpandMSBFirst;
+ else
+ infoRec->WriteBitmap =
+ XAAWriteBitmapScanlineColorExpandLSBFirst;
+ }
+ infoRec->WriteBitmapFlags =
+ infoRec->ScanlineCPUToScreenColorExpandFillFlags;
+ } else
+ infoRec->WriteBitmap = NULL;
+
+ /**** TE Glyphs ****/
+
+ if (infoRec->TEGlyphRenderer) {
+ XAAMSG("\tDriver provided TEGlyphRenderer replacement\n");
+ } else if (HaveColorExpansion) {
+ infoRec->TEGlyphRendererFlags =
+ infoRec->CPUToScreenColorExpandFillFlags;
+
+ if (infoRec->TEGlyphRendererFlags & TRIPLE_BITS_24BPP) {
+ if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
+ if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
+ infoRec->TEGlyphRenderer =
+ XAATEGlyphRenderer3MSBFirstFixedBase;
+ else
+ infoRec->TEGlyphRenderer = XAATEGlyphRenderer3MSBFirst;
+ } else {
+ if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
+ infoRec->TEGlyphRenderer =
+ XAATEGlyphRenderer3LSBFirstFixedBase;
+ else
+ infoRec->TEGlyphRenderer = XAATEGlyphRenderer3LSBFirst;
+ }
+
+ if (!HaveSolidFillRect &&
+ (infoRec->TEGlyphRendererFlags & RGB_EQUAL)) {
+ infoRec->TEGlyphRendererFlags &= ~RGB_EQUAL;
+ XAAMSG("WARNING: TEGlyphRenderer cannot support RGB_EQUAL"
+ " without solid fills\n");
+ }
+ } else {
+ if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
+ if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
+ infoRec->TEGlyphRenderer =
+ XAATEGlyphRendererMSBFirstFixedBase;
+ else
+ infoRec->TEGlyphRenderer = XAATEGlyphRendererMSBFirst;
+ } else {
+ if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED)
+ infoRec->TEGlyphRenderer =
+ XAATEGlyphRendererLSBFirstFixedBase;
+ else
+ infoRec->TEGlyphRenderer = XAATEGlyphRendererLSBFirst;
+ }
+ }
+
+ if (!HaveSolidFillRect &&
+ (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
+ infoRec->TEGlyphRendererFlags &= ~TRANSPARENCY_ONLY;
+ XAAMSG("WARNING: TEGlyphRenderer cannot support TRANPARENCY_ONLY"
+ " without solid fills\n");
+ }
+
+ } else if (HaveScanlineColorExpansion) {
+ infoRec->TEGlyphRendererFlags =
+ infoRec->ScanlineCPUToScreenColorExpandFillFlags;
+
+ if (infoRec->TEGlyphRendererFlags & TRIPLE_BITS_24BPP) {
+ if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
+ infoRec->TEGlyphRenderer = XAATEGlyphRendererScanline3MSBFirst;
+ else
+ infoRec->TEGlyphRenderer = XAATEGlyphRendererScanline3LSBFirst;
+
+ if (!HaveSolidFillRect &&
+ (infoRec->TEGlyphRendererFlags & RGB_EQUAL)) {
+ infoRec->TEGlyphRendererFlags &= ~RGB_EQUAL;
+ XAAMSG("WARNING: TEGlyphRenderer cannot support RGB_EQUAL"
+ " without solid fills\n");
+ }
+ } else {
+ if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
+ infoRec->TEGlyphRenderer = XAATEGlyphRendererScanlineMSBFirst;
+ else
+ infoRec->TEGlyphRenderer = XAATEGlyphRendererScanlineLSBFirst;
+ }
+
+ if (!HaveSolidFillRect &&
+ (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
+ infoRec->TEGlyphRendererFlags &= ~TRANSPARENCY_ONLY;
+ XAAMSG("WARNING: TEGlyphRenderer cannot support TRANPARENCY_ONLY"
+ " without solid fills\n");
+ }
+ }
+
+ /**** NonTE Glyphs ****/
+
+ if(infoRec->NonTEGlyphRenderer) {
+ XAAMSG("\tDriver provided NonTEGlyphRenderer replacement\n");
+ } else if(infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) {
+ infoRec->NonTEGlyphRenderer = XAANonTEGlyphRenderer;
+ infoRec->NonTEGlyphRendererFlags = infoRec->WriteBitmapFlags;
+ }
+
+ /**** WritePixmap ****/
+
+ if(infoRec->WritePixmap &&
+ !xf86IsOptionSet(options, XAAOPT_WRITE_PIXMAP)) {
+ XAAMSG("\tDriver provided WritePixmap replacement\n");
+ } else if(HaveImageWriteRect) {
+ infoRec->WritePixmap = XAAWritePixmap;
+ infoRec->WritePixmapFlags =
+ infoRec->ImageWriteFlags | CONVERT_32BPP_TO_24BPP;
+ } else if(HaveScanlineImageWriteRect) {
+ infoRec->WritePixmap = XAAWritePixmapScanline;
+ infoRec->WritePixmapFlags = infoRec->ScanlineImageWriteFlags;
+ } else
+ infoRec->WritePixmap = NULL;
+
+ /**** ReadPixmap ****/
+
+ if(infoRec->ReadPixmap) {
+ XAAMSG("\tDriver provided ReadPixmap replacement\n");
+ }
+
+
+ /************** GC Level *************/
+
+ /**** CopyArea ****/
+
+ if(infoRec->CopyArea) {
+ XAAMSG("\tDriver provided GC level CopyArea replacement\n");
+ } else if(infoRec->ScreenToScreenBitBlt) {
+ infoRec->CopyArea = XAACopyArea;
+ infoRec->CopyAreaFlags = infoRec->ScreenToScreenBitBltFlags;
+
+ /* most GC level primitives use one mid-level primitive so
+ the GC level primitive gets the mid-level primitive flag
+ and we use that at GC validation time. But CopyArea uses
+ more than one mid-level primitive so we have to essentially
+ do a GC validation every time that primitive is used.
+ The CopyAreaFlags would only be used for filtering out the
+ common denominators. Here we assume that if you don't do
+ ScreenToScreenBitBlt you aren't going to do the others.
+ We also assume that ScreenToScreenBitBlt has the least
+ restrictions. */
+ }
+
+ if(infoRec->CopyPlane) {
+ XAAMSG("\tDriver provided GC level CopyPlane replacement\n");
+ } else if(infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) {
+ infoRec->CopyPlane = XAACopyPlaneColorExpansion;
+ infoRec->CopyPlaneFlags = infoRec->WriteBitmapFlags;
+ }
+
+ if(infoRec->PushPixelsSolid) {
+ XAAMSG("\tDriver provided GC level PushPixelsSolid replacement\n");
+ } else if(infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) {
+ infoRec->PushPixelsSolid = XAAPushPixelsSolidColorExpansion;
+ infoRec->PushPixelsFlags = infoRec->WriteBitmapFlags;
+ }
+
+ if(infoRec->FillSolidRects) {
+ if(!infoRec->PolyFillRectSolid) {
+ infoRec->PolyFillRectSolid = XAAPolyFillRect;
+ infoRec->PolyFillRectSolidFlags = infoRec->FillSolidRectsFlags;
+ }
+ }
+ if(infoRec->FillSolidSpans) {
+ if(!infoRec->FillSpansSolid) {
+ infoRec->FillSpansSolid = XAAFillSpans;
+ infoRec->FillSpansSolidFlags = infoRec->FillSolidSpansFlags;
+ }
+ }
+
+ if(infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
+ infoRec->FillCacheBltRects || infoRec->FillColorExpandRects ||
+ infoRec->FillCacheExpandRects) {
+ if(!infoRec->PolyFillRectStippled) {
+
+ infoRec->PolyFillRectStippled = XAAPolyFillRect;
+ infoRec->PolyFillRectStippledFlags = 0;
+ }
+ }
+
+ if(infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
+ infoRec->FillCacheBltSpans || infoRec->FillColorExpandSpans ||
+ infoRec->FillCacheExpandSpans) {
+ if(!infoRec->FillSpansStippled) {
+
+ infoRec->FillSpansStippled = XAAFillSpans;
+ infoRec->FillSpansStippledFlags = 0;
+ }
+ }
+
+ if(infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
+ infoRec->FillCacheBltRects || infoRec->FillColorExpandRects ||
+ infoRec->FillCacheExpandRects) {
+ if(!infoRec->PolyFillRectOpaqueStippled) {
+
+ infoRec->PolyFillRectOpaqueStippled = XAAPolyFillRect;
+ infoRec->PolyFillRectOpaqueStippledFlags = 0;
+ }
+ }
+
+ if(infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
+ infoRec->FillCacheBltSpans || infoRec->FillColorExpandSpans ||
+ infoRec->FillCacheExpandSpans) {
+ if(!infoRec->FillSpansOpaqueStippled) {
+
+ infoRec->FillSpansOpaqueStippled = XAAFillSpans;
+ infoRec->FillSpansOpaqueStippledFlags = 0;
+ }
+ }
+
+ if(infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects ||
+ infoRec->FillCacheBltRects || infoRec->FillImageWriteRects) {
+ if(!infoRec->PolyFillRectTiled) {
+
+ infoRec->PolyFillRectTiled = XAAPolyFillRect;
+ infoRec->PolyFillRectTiledFlags = 0;
+ }
+ }
+
+ if(infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans ||
+ infoRec->FillCacheBltSpans) {
+ if(!infoRec->FillSpansTiled) {
+
+ infoRec->FillSpansTiled = XAAFillSpans;
+ infoRec->FillSpansTiledFlags = 0;
+ }
+ }
+
+ if(infoRec->TEGlyphRenderer &&
+ !(infoRec->TEGlyphRendererFlags & NO_TRANSPARENCY)) {
+
+ if(!infoRec->PolyText8TE) {
+ infoRec->PolyText8TE = XAAPolyText8TEColorExpansion;
+ infoRec->PolyText8TEFlags = infoRec->TEGlyphRendererFlags;
+ }
+
+ if(!infoRec->PolyText16TE) {
+ infoRec->PolyText16TE = XAAPolyText16TEColorExpansion;
+ infoRec->PolyText16TEFlags = infoRec->TEGlyphRendererFlags;
+ }
+
+ if(!infoRec->PolyGlyphBltTE) {
+ infoRec->PolyGlyphBltTE = XAAPolyGlyphBltTEColorExpansion;
+ infoRec->PolyGlyphBltTEFlags = infoRec->TEGlyphRendererFlags;
+ }
+ }
+
+ if(infoRec->TEGlyphRenderer &&
+ !(infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
+
+ if(!infoRec->ImageText8TE) {
+ infoRec->ImageText8TE = XAAImageText8TEColorExpansion;
+ infoRec->ImageText8TEFlags = infoRec->TEGlyphRendererFlags;
+ }
+
+ if(!infoRec->ImageText16TE) {
+ infoRec->ImageText16TE = XAAImageText16TEColorExpansion;
+ infoRec->ImageText16TEFlags = infoRec->TEGlyphRendererFlags;
+ }
+
+ if(!infoRec->ImageGlyphBltTE) {
+ infoRec->ImageGlyphBltTE = XAAImageGlyphBltTEColorExpansion;
+ infoRec->ImageGlyphBltTEFlags = infoRec->TEGlyphRendererFlags;
+ }
+ }
+
+ if(infoRec->NonTEGlyphRenderer) {
+ if(!infoRec->PolyText8NonTE) {
+ infoRec->PolyText8NonTE = XAAPolyText8NonTEColorExpansion;
+ infoRec->PolyText8NonTEFlags = infoRec->NonTEGlyphRendererFlags;
+ }
+
+ if(!infoRec->PolyText16NonTE) {
+ infoRec->PolyText16NonTE = XAAPolyText16NonTEColorExpansion;
+ infoRec->PolyText16NonTEFlags = infoRec->NonTEGlyphRendererFlags;
+ }
+ if(!infoRec->PolyGlyphBltNonTE) {
+ infoRec->PolyGlyphBltNonTE = XAAPolyGlyphBltNonTEColorExpansion;
+ infoRec->PolyGlyphBltNonTEFlags = infoRec->NonTEGlyphRendererFlags;
+ }
+ }
+
+ if(infoRec->NonTEGlyphRenderer && HaveSolidFillRect) {
+ if(!infoRec->ImageText8NonTE) {
+ infoRec->ImageText8NonTE = XAAImageText8NonTEColorExpansion;
+ infoRec->ImageText8NonTEFlags = infoRec->NonTEGlyphRendererFlags;
+ }
+
+ if(!infoRec->ImageText16NonTE) {
+ infoRec->ImageText16NonTE = XAAImageText16NonTEColorExpansion;
+ infoRec->ImageText16NonTEFlags = infoRec->NonTEGlyphRendererFlags;
+ }
+
+ if(!infoRec->ImageGlyphBltNonTE) {
+ infoRec->ImageGlyphBltNonTE = XAAImageGlyphBltNonTEColorExpansion;
+ infoRec->ImageGlyphBltNonTEFlags = infoRec->NonTEGlyphRendererFlags;
+ }
+ }
+
+ if(!infoRec->PolyRectangleThinSolid && HaveSolidHorVertLine) {
+ infoRec->PolyRectangleThinSolid = XAAPolyRectangleThinSolid;
+ infoRec->PolyRectangleThinSolidFlags = infoRec->SolidLineFlags;
+ }
+
+ if(!infoRec->FillPolygonSolid && HaveSolidFillRect) {
+ infoRec->FillPolygonSolid = XAAFillPolygonSolid;
+ infoRec->FillPolygonSolidFlags = infoRec->SolidFillFlags;
+ }
+
+ if(!infoRec->FillPolygonStippled && (HaveMono8x8PatternFillRect ||
+ HaveScreenToScreenColorExpandFill || HaveScreenToScreenCopy)) {
+ infoRec->FillPolygonStippled = XAAFillPolygonStippled;
+ infoRec->FillPolygonStippledFlags = infoRec->SolidFillFlags;
+ }
+
+ if(!infoRec->FillPolygonOpaqueStippled && (HaveMono8x8PatternFillRect ||
+ HaveScreenToScreenColorExpandFill || HaveScreenToScreenCopy)) {
+ infoRec->FillPolygonOpaqueStippled = XAAFillPolygonStippled;
+ infoRec->FillPolygonOpaqueStippledFlags = infoRec->SolidFillFlags;
+ }
+
+ if(!infoRec->FillPolygonTiled && (HaveMono8x8PatternFillRect ||
+ HaveScreenToScreenColorExpandFill || HaveScreenToScreenCopy)) {
+ infoRec->FillPolygonTiled = XAAFillPolygonTiled;
+ infoRec->FillPolygonTiledFlags = infoRec->SolidFillFlags;
+ }
+
+
+ if(!infoRec->PolyFillArcSolid && HaveSolidFillRect) {
+ infoRec->PolyFillArcSolid = XAAPolyFillArcSolid;
+ infoRec->PolyFillArcSolidFlags = infoRec->SolidFillFlags;
+ }
+
+ if(!infoRec->PolylinesWideSolid && HaveSolidFillRect) {
+ infoRec->PolylinesWideSolid = XAAPolylinesWideSolid;
+ infoRec->PolylinesWideSolidFlags =
+ infoRec->SolidFillFlags | GXCOPY_ONLY;
+ }
+
+ if(!infoRec->PutImage && (infoRec->WritePixmap ||
+ (infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)))) {
+ infoRec->PutImage = XAAPutImage;
+
+ /* See comment for CopyArea above. But here we make fewer
+ assumptions. The driver can provide the PutImageFlags if
+ it wants too */
+ }
+
+ if(HaveSolidHorVertLine &&
+ (HaveSolidBresenhamLine || (HaveSolidTwoPointLine &&
+ (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_LINE)))){
+ if(!infoRec->PolylinesThinSolid) {
+ infoRec->PolylinesThinSolid = XAAPolyLines;
+ infoRec->PolylinesThinSolidFlags = infoRec->SolidLineFlags;
+ }
+ if(!infoRec->PolySegmentThinSolid) {
+ infoRec->PolySegmentThinSolid = XAAPolySegment;
+ infoRec->PolySegmentThinSolidFlags = infoRec->SolidLineFlags;
+ }
+ }
+
+ if(HaveDashedBresenhamLine || (HaveDashedTwoPointLine &&
+ (infoRec->ClippingFlags & HARDWARE_CLIP_DASHED_LINE))){
+ if(!infoRec->PolylinesThinDashed) {
+ infoRec->PolylinesThinDashed = XAAPolyLinesDashed;
+ infoRec->PolylinesThinDashedFlags = infoRec->DashedLineFlags;
+ }
+ if(!infoRec->PolySegmentThinDashed) {
+ infoRec->PolySegmentThinDashed = XAAPolySegmentDashed;
+ infoRec->PolySegmentThinDashedFlags = infoRec->DashedLineFlags;
+ }
+ }
+
+ if(infoRec->PolylinesThinDashed || infoRec->PolySegmentThinDashed) {
+ if(!infoRec->ComputeDash)
+ infoRec->ComputeDash = XAAComputeDash;
+ }
+
+#ifdef RENDER
+ {
+ Bool haveTexture = infoRec->CPUToScreenTextureFormats &&
+ infoRec->SetupForCPUToScreenTexture &&
+ infoRec->SubsequentCPUToScreenTexture;
+ Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats &&
+ infoRec->SetupForCPUToScreenAlphaTexture &&
+ infoRec->SubsequentCPUToScreenAlphaTexture;
+
+ if(!infoRec->Composite && (haveTexture || haveAlphaTexture))
+ infoRec->Composite = XAADoComposite;
+
+ if(!infoRec->Glyphs && infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY))
+ {
+ infoRec->Glyphs = XAADoGlyphs;
+ }
+ }
+#endif
+
+ /************ Validation Functions **************/
+
+ if(!infoRec->ValidateCopyArea && infoRec->CopyArea) {
+ infoRec->CopyAreaMask = GCWhenForced;
+ if((infoRec->CopyAreaFlags & GXCOPY_ONLY) ||
+ (infoRec->CopyAreaFlags & ROP_NEEDS_SOURCE))
+ infoRec->CopyAreaMask |= GCFunction;
+ if(infoRec->CopyAreaFlags & NO_PLANEMASK)
+ infoRec->CopyAreaMask |= GCPlaneMask;
+ infoRec->ValidateCopyArea = XAAValidateCopyArea;
+ }
+
+ if(!infoRec->ValidateCopyPlane && infoRec->CopyPlane) {
+ infoRec->CopyPlaneMask = GCWhenForced;
+ if((infoRec->CopyPlaneFlags & GXCOPY_ONLY) ||
+ (infoRec->CopyPlaneFlags & ROP_NEEDS_SOURCE))
+ infoRec->CopyPlaneMask |= GCFunction;
+ if(infoRec->CopyPlaneFlags & NO_PLANEMASK)
+ infoRec->CopyPlaneMask |= GCPlaneMask;
+ if(infoRec->CopyPlaneFlags & RGB_EQUAL)
+ infoRec->CopyPlaneMask |= GCForeground | GCBackground;
+ infoRec->ValidateCopyPlane = XAAValidateCopyPlane;
+ }
+
+ if(!infoRec->ValidatePutImage && infoRec->PutImage) {
+ infoRec->PutImageMask = GCWhenForced;
+ if((infoRec->PutImageFlags & GXCOPY_ONLY) ||
+ (infoRec->PutImageFlags & ROP_NEEDS_SOURCE))
+ infoRec->PutImageMask |= GCFunction;
+ if(infoRec->PutImageFlags & NO_PLANEMASK)
+ infoRec->PutImageMask |= GCPlaneMask;
+ if(infoRec->PutImageFlags & RGB_EQUAL)
+ infoRec->PutImageMask |= GCForeground | GCBackground;
+ infoRec->ValidatePutImage = XAAValidatePutImage;
+ }
+
+
+ if(!infoRec->ValidatePushPixels && infoRec->PushPixelsSolid) {
+ infoRec->PushPixelsMask = GCFillStyle;
+ if((infoRec->PushPixelsFlags & GXCOPY_ONLY) ||
+ (infoRec->PushPixelsFlags & ROP_NEEDS_SOURCE) ||
+ (infoRec->PushPixelsFlags & TRANSPARENCY_GXCOPY_ONLY))
+ infoRec->PushPixelsMask |= GCFunction;
+ if(infoRec->PushPixelsFlags & NO_PLANEMASK)
+ infoRec->PushPixelsMask |= GCPlaneMask;
+ if(infoRec->PushPixelsFlags & RGB_EQUAL)
+ infoRec->PushPixelsMask |= GCForeground;
+ infoRec->ValidatePushPixels = XAAValidatePushPixels;
+ }
+
+ /* By default XAA assumes the FillSpans, PolyFillRects, FillPolygon
+ and PolyFillArcs have the same restrictions. If you supply GC
+ level replacements for any of these and alter this relationship
+ you may need to supply replacement validation routines */
+
+ if(!infoRec->ValidateFillSpans &&
+ (infoRec->FillSpansSolid || infoRec->FillSpansStippled ||
+ infoRec->FillSpansOpaqueStippled || infoRec->FillSpansTiled)) {
+
+ int compositeFlags = infoRec->FillSpansSolidFlags |
+ infoRec->FillSpansStippledFlags |
+ infoRec->FillSpansOpaqueStippledFlags |
+ infoRec->FillSpansTiledFlags;
+
+ infoRec->FillSpansMask = GCFillStyle | GCTile | GCStipple;
+
+ if((compositeFlags & GXCOPY_ONLY) ||
+ (compositeFlags & ROP_NEEDS_SOURCE))
+ infoRec->FillSpansMask |= GCFunction;
+ if(compositeFlags & NO_PLANEMASK)
+ infoRec->FillSpansMask |= GCPlaneMask;
+ if(compositeFlags & RGB_EQUAL)
+ infoRec->FillSpansMask |= GCForeground;
+ infoRec->ValidateFillSpans = XAAValidateFillSpans;
+ }
+
+ /* By default XAA only provides Validations for the GlyphBlt
+ functions and not the text higher up. This is because the
+ Text8/16 and GlyphBlt are linked. If you break this linkage,
+ you may need to have the driver supply its own Validation
+ routines */
+
+ if(!infoRec->ValidatePolyGlyphBlt &&
+ (infoRec->PolyGlyphBltTE || infoRec->PolyGlyphBltNonTE)) {
+ int compositeFlags = infoRec->PolyGlyphBltTEFlags |
+ infoRec->PolyGlyphBltNonTEFlags;
+
+ infoRec->PolyGlyphBltMask = GCFillStyle | GCFont;
+ if((compositeFlags & GXCOPY_ONLY) ||
+ (compositeFlags & ROP_NEEDS_SOURCE) ||
+ (infoRec->PolyGlyphBltNonTEFlags & TRANSPARENCY_GXCOPY_ONLY))
+ infoRec->PolyGlyphBltMask |= GCFunction;
+ if(compositeFlags & NO_PLANEMASK)
+ infoRec->PolyGlyphBltMask |= GCPlaneMask;
+ if(compositeFlags & RGB_EQUAL)
+ infoRec->PolyGlyphBltMask |= GCForeground;
+ infoRec->ValidatePolyGlyphBlt = XAAValidatePolyGlyphBlt;
+ }
+
+ if(!infoRec->ValidateImageGlyphBlt &&
+ (infoRec->ImageGlyphBltTE || infoRec->ImageGlyphBltNonTE)) {
+ int compositeFlags = infoRec->ImageGlyphBltTEFlags |
+ infoRec->ImageGlyphBltNonTEFlags;
+
+ if(infoRec->ImageGlyphBltNonTE)
+ compositeFlags |= infoRec->SolidFillFlags;
+
+ infoRec->ImageGlyphBltMask = GCFont;
+ if(compositeFlags & NO_PLANEMASK)
+ infoRec->ImageGlyphBltMask |= GCPlaneMask;
+ if(compositeFlags & RGB_EQUAL)
+ infoRec->ImageGlyphBltMask |= GCForeground | GCBackground;
+ infoRec->ValidateImageGlyphBlt = XAAValidateImageGlyphBlt;
+ }
+
+ /* By default XAA only provides a Validation function for the
+ Polylines and does segments and polylines at the same time */
+
+ if(!infoRec->ValidatePolylines && infoRec->ValidateFillSpans) {
+ int compositeFlags = infoRec->PolyRectangleThinSolidFlags |
+ infoRec->PolylinesWideSolidFlags |
+ infoRec->PolylinesThinSolidFlags |
+ infoRec->PolySegmentThinSolidFlags |
+ infoRec->PolySegmentThinDashedFlags |
+ infoRec->PolylinesThinDashedFlags;
+
+ infoRec->ValidatePolylines = XAAValidatePolylines;
+ infoRec->PolylinesMask =
+ infoRec->FillSpansMask | GCLineStyle | GCLineWidth;
+
+ if(infoRec->PolySegmentThinDashed || infoRec->PolylinesThinDashed)
+ infoRec->PolylinesMask |= GCDashList;
+ if(compositeFlags & NO_PLANEMASK)
+ infoRec->PolylinesMask |= GCPlaneMask;
+ if((compositeFlags & GXCOPY_ONLY) ||
+ (compositeFlags & ROP_NEEDS_SOURCE))
+ infoRec->PolylinesMask |= GCFunction;
+ if(compositeFlags & RGB_EQUAL)
+ infoRec->PolylinesMask |= GCForeground;
+ }
+
+
+ /**** Fill choosers ****/
+
+ if(!infoRec->StippledFillChooser)
+ infoRec->StippledFillChooser = XAAStippledFillChooser;
+
+ if(!infoRec->OpaqueStippledFillChooser)
+ infoRec->OpaqueStippledFillChooser = XAAOpaqueStippledFillChooser;
+
+ if(!infoRec->TiledFillChooser)
+ infoRec->TiledFillChooser = XAATiledFillChooser;
+
+
+ /**** Setup the pixmap cache ****/
+
+ if(infoRec->WriteBitmapToCache) {}
+ else if(infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))
+ infoRec->WriteBitmapToCache = XAAWriteBitmapToCache;
+ else if(infoRec->Flags & LINEAR_FRAMEBUFFER)
+ infoRec->WriteBitmapToCache = XAAWriteBitmapToCacheLinear;
+ else
+ infoRec->PixmapCacheFlags |= DO_NOT_BLIT_STIPPLES;
+
+ if(infoRec->WritePixmapToCache) {}
+ else if(infoRec->WritePixmap && !(infoRec->WritePixmapFlags & NO_GXCOPY))
+ infoRec->WritePixmapToCache = XAAWritePixmapToCache;
+ else if(infoRec->Flags & LINEAR_FRAMEBUFFER)
+ infoRec->WritePixmapToCache = XAAWritePixmapToCacheLinear;
+ else
+ infoRec->Flags &= ~PIXMAP_CACHE;
+
+ if (xf86IsOptionSet(options, XAAOPT_PIXMAP_CACHE))
+ infoRec->Flags &= ~PIXMAP_CACHE;
+
+ if(infoRec->WriteMono8x8PatternToCache) {}
+ else if(infoRec->PixmapCacheFlags & CACHE_MONO_8x8) {
+ if(infoRec->WritePixmapToCache)
+ infoRec->WriteMono8x8PatternToCache = XAAWriteMono8x8PatternToCache;
+ else
+ infoRec->PixmapCacheFlags &= ~CACHE_MONO_8x8;
+ }
+
+ if(infoRec->WriteColor8x8PatternToCache) {}
+ else if(infoRec->PixmapCacheFlags & CACHE_COLOR_8x8) {
+ if(infoRec->WritePixmapToCache && infoRec->WriteBitmapToCache)
+ infoRec->WriteColor8x8PatternToCache = XAAWriteColor8x8PatternToCache;
+ else
+ infoRec->PixmapCacheFlags &= ~CACHE_COLOR_8x8;
+ }
+
+ if(infoRec->CachePixelGranularity < 0) {
+ switch(pScrn->bitsPerPixel) {
+ case 24:
+ case 8: infoRec->CachePixelGranularity = 4; break;
+ case 16: infoRec->CachePixelGranularity = 2; break;
+ case 32: infoRec->CachePixelGranularity = 1; break;
+ default: break;
+ }
+
+ if(BITMAP_SCANLINE_PAD == 64)
+ infoRec->CachePixelGranularity *= 2;
+ }
+
+ xfree(options);
+
+ if(!infoRec->CacheTile && infoRec->WritePixmapToCache)
+ infoRec->CacheTile = XAACacheTile;
+ if(!infoRec->CacheMonoStipple && infoRec->WritePixmapToCache)
+ infoRec->CacheMonoStipple = XAACacheMonoStipple;
+ if(!infoRec->CacheStipple && infoRec->WriteBitmapToCache)
+ infoRec->CacheStipple = XAACacheStipple;
+ if(!infoRec->CacheMono8x8Pattern && infoRec->WriteMono8x8PatternToCache)
+ infoRec->CacheMono8x8Pattern = XAACacheMono8x8Pattern;
+ if(!infoRec->CacheColor8x8Pattern && infoRec->WriteColor8x8PatternToCache)
+ infoRec->CacheColor8x8Pattern = XAACacheColor8x8Pattern;
+
+ if((infoRec->Flags & PIXMAP_CACHE) && !infoRec->InitPixmapCache) {
+ infoRec->InitPixmapCache = XAAInitPixmapCache;
+ infoRec->ClosePixmapCache = XAAClosePixmapCache;
+ }
+
+ return TRUE;
+}
diff --git a/hw/xfree86/xaa/xaaLine.c b/hw/xfree86/xaa/xaaLine.c
new file mode 100644
index 000000000..2084e8d61
--- /dev/null
+++ b/hw/xfree86/xaa/xaaLine.c
@@ -0,0 +1,390 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaLine.c,v 1.6 2002/09/18 18:15:00 martin Exp $ */
+
+#include "X.h"
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "miline.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+
+void
+#ifdef POLYSEGMENT
+XAAPolySegment(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+#else
+XAAPolyLines(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode, /* Origin or Previous */
+ int npt, /* number of points */
+ DDXPointPtr pptInit
+#endif
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
+ int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
+ unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
+ int xorg = pDrawable->x;
+ int yorg = pDrawable->y;
+ int nbox;
+ BoxPtr pbox;
+#ifndef POLYSEGMENT
+ DDXPointPtr ppt;
+#endif
+ int x1, x2, y1, y2, tmp, len;
+
+ if(!nboxInit)
+ return;
+
+ if (infoRec->SolidLineFlags & LINE_LIMIT_COORDS) {
+ int minValX = infoRec->SolidLineLimits.x1;
+ int maxValX = infoRec->SolidLineLimits.x2;
+ int minValY = infoRec->SolidLineLimits.y1;
+ int maxValY = infoRec->SolidLineLimits.y2;
+#ifdef POLYSEGMENT
+ int n = nseg;
+ xSegment *s = pSeg;
+
+ while (n--)
+#else
+ int n = npt;
+ int xorgtmp = xorg;
+ int yorgtmp = yorg;
+
+ ppt = pptInit;
+ x2 = ppt->x + xorgtmp;
+ y2 = ppt->y + yorgtmp;
+ while (--n)
+#endif
+ {
+#ifdef POLYSEGMENT
+ x1 = s->x1 + xorg;
+ y1 = s->y1 + yorg;
+ x2 = s->x2 + xorg;
+ y2 = s->y2 + yorg;
+ s++;
+#else
+ x1 = x2;
+ y1 = y2;
+ ++ppt;
+ if (mode == CoordModePrevious) {
+ xorgtmp = x1;
+ yorgtmp = y1;
+ }
+ x2 = ppt->x + xorgtmp;
+ y2 = ppt->y + yorgtmp;
+#endif
+ if (x1 > maxValX || x1 < minValX ||
+ x2 > maxValX || x2 < minValX ||
+ y1 > maxValY || y1 < minValY ||
+ y2 > maxValY || y2 < minValY) {
+#ifdef POLYSEGMENT
+ XAAFallbackOps.PolySegment(pDrawable, pGC, nseg, pSeg);
+#else
+ XAAFallbackOps.Polylines(pDrawable, pGC, mode, npt, pptInit);
+#endif
+ return;
+ }
+ }
+ }
+
+ (*infoRec->SetupForSolidLine)(infoRec->pScrn, pGC->fgPixel,
+ pGC->alu, pGC->planemask);
+
+#ifdef POLYSEGMENT
+ while (nseg--)
+#else
+ ppt = pptInit;
+ x2 = ppt->x + xorg;
+ y2 = ppt->y + yorg;
+ while(--npt)
+#endif
+ {
+ nbox = nboxInit;
+ pbox = pboxInit;
+
+#ifdef POLYSEGMENT
+ x1 = pSeg->x1 + xorg;
+ y1 = pSeg->y1 + yorg;
+ x2 = pSeg->x2 + xorg;
+ y2 = pSeg->y2 + yorg;
+ pSeg++;
+#else
+ x1 = x2;
+ y1 = y2;
+ ++ppt;
+ if (mode == CoordModePrevious) {
+ xorg = x1;
+ yorg = y1;
+ }
+ x2 = ppt->x + xorg;
+ y2 = ppt->y + yorg;
+#endif
+
+ if (x1 == x2) { /* vertical line */
+ /* make the line go top to bottom of screen, keeping
+ endpoint semantics
+ */
+ if (y1 > y2) {
+ tmp = y2;
+ y2 = y1 + 1;
+ y1 = tmp + 1;
+#ifdef POLYSEGMENT
+ if (pGC->capStyle != CapNotLast) y1--;
+#endif
+ }
+#ifdef POLYSEGMENT
+ else if (pGC->capStyle != CapNotLast) y2++;
+#endif
+ /* get to first band that might contain part of line */
+ while(nbox && (pbox->y2 <= y1)) {
+ pbox++;
+ nbox--;
+ }
+
+ /* stop when lower edge of box is beyond end of line */
+ while(nbox && (y2 >= pbox->y1)) {
+ if ((x1 >= pbox->x1) && (x1 < pbox->x2)) {
+ tmp = max(y1, pbox->y1);
+ len = min(y2, pbox->y2) - tmp;
+ if (len) (*infoRec->SubsequentSolidHorVertLine)(
+ infoRec->pScrn, x1, tmp, len, DEGREES_270);
+ }
+ nbox--;
+ pbox++;
+ }
+#ifndef POLYSEGMENT
+ y2 = ppt->y + yorg;
+#endif
+ } else if (y1 == y2) { /* horizontal line */
+ /* force line from left to right, keeping endpoint semantics */
+ if (x1 > x2) {
+ tmp = x2;
+ x2 = x1 + 1;
+ x1 = tmp + 1;
+#ifdef POLYSEGMENT
+ if (pGC->capStyle != CapNotLast) x1--;
+#endif
+ }
+#ifdef POLYSEGMENT
+ else if (pGC->capStyle != CapNotLast) x2++;
+#endif
+
+ /* find the correct band */
+ while(nbox && (pbox->y2 <= y1)) {
+ pbox++;
+ nbox--;
+ }
+
+ /* try to draw the line, if we haven't gone beyond it */
+ if (nbox && (pbox->y1 <= y1)) {
+ int orig_y = pbox->y1;
+ /* when we leave this band, we're done */
+ while(nbox && (orig_y == pbox->y1)) {
+ if (pbox->x2 <= x1) {
+ /* skip boxes until one might contain start point */
+ nbox--;
+ pbox++;
+ continue;
+ }
+
+ /* stop if left of box is beyond right of line */
+ if (pbox->x1 >= x2) {
+ nbox = 0;
+ break;
+ }
+
+ tmp = max(x1, pbox->x1);
+ len = min(x2, pbox->x2) - tmp;
+ if (len) (*infoRec->SubsequentSolidHorVertLine)(
+ infoRec->pScrn, tmp, y1, len, DEGREES_0);
+ nbox--;
+ pbox++;
+ }
+ }
+#ifndef POLYSEGMENT
+ x2 = ppt->x + xorg;
+#endif
+ } else{ /* sloped line */
+ unsigned int oc1, oc2;
+ int dmin, dmaj, e, octant;
+
+ if (infoRec->SubsequentSolidBresenhamLine) {
+ if((dmaj = x2 - x1) < 0) {
+ dmaj = -dmaj;
+ octant = XDECREASING;
+ } else octant = 0;
+
+ if((dmin = y2 - y1) < 0) {
+ dmin = -dmin;
+ octant |= YDECREASING;
+ }
+
+ if(dmin >= dmaj){
+ tmp = dmin; dmin = dmaj; dmaj = tmp;
+ octant |= YMAJOR;
+ }
+
+ e = -dmaj - ((bias >> octant) & 1);
+ len = dmaj;
+ dmin <<= 1;
+ dmaj <<= 1;
+ } else { /* Muffle compiler */
+ dmin = dmaj = e = octant = len = 0;
+ }
+
+ while(nbox--) {
+ oc1 = oc2 = 0;
+ OUTCODES(oc1, x1, y1, pbox);
+ OUTCODES(oc2, x2, y2, pbox);
+ if (!(oc1 | oc2)) { /* unclipped */
+ if(infoRec->SubsequentSolidTwoPointLine) {
+ (*infoRec->SubsequentSolidTwoPointLine)(
+ infoRec->pScrn, x1, y1, x2, y2,
+#ifdef POLYSEGMENT
+ (pGC->capStyle != CapNotLast) ? 0 :
+#endif
+ OMIT_LAST
+ );
+ } else {
+ (*infoRec->SubsequentSolidBresenhamLine)(
+ infoRec->pScrn, x1, y1, dmaj, dmin, e,
+#ifdef POLYSEGMENT
+ (pGC->capStyle != CapNotLast) ? (len+1) :
+#endif
+ len, octant);
+ }
+ break;
+ } else if (oc1 & oc2) { /* completely clipped */
+ pbox++;
+ } else if (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_LINE) {
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ pbox->x1, pbox->y1, pbox->x2 - 1, pbox->y2 - 1);
+
+ if(infoRec->SubsequentSolidBresenhamLine) {
+ (*infoRec->SubsequentSolidBresenhamLine)(
+ infoRec->pScrn, x1, y1, dmaj, dmin, e,
+#ifdef POLYSEGMENT
+ (pGC->capStyle != CapNotLast) ? (len+1) :
+#endif
+ len, octant);
+ } else {
+ (*infoRec->SubsequentSolidTwoPointLine)(
+ infoRec->pScrn, x1, y1, x2, y2,
+#ifdef POLYSEGMENT
+ (pGC->capStyle != CapNotLast) ? 0 :
+#endif
+ OMIT_LAST
+ );
+ }
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+ pbox++;
+ } else {
+ int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
+ int clip1 = 0, clip2 = 0;
+ int err, adx, ady;
+
+ if(octant & YMAJOR) {
+ ady = dmaj >> 1;
+ adx = dmin >> 1;
+ } else {
+ ady = dmin >> 1;
+ adx = dmaj >> 1;
+ }
+
+ if (miZeroClipLine(pbox->x1, pbox->y1,
+ pbox->x2 - 1, pbox->y2 - 1,
+ &new_x1, &new_y1, &new_x2, &new_y2,
+ adx, ady, &clip1, &clip2,
+ octant, bias, oc1, oc2) == -1)
+ {
+ pbox++;
+ continue;
+ }
+
+ if (octant & YMAJOR)
+ len = abs(new_y2 - new_y1);
+ else
+ len = abs(new_x2 - new_x1);
+#ifdef POLYSEGMENT
+ if (clip2 != 0 || pGC->capStyle != CapNotLast)
+ len++;
+#else
+ len += (clip2 != 0);
+#endif
+ if (len) {
+ int abserr, clipdx, clipdy;
+ /* unwind bresenham error term to first point */
+ if (clip1) {
+ clipdx = abs(new_x1 - x1);
+ clipdy = abs(new_y1 - y1);
+
+ if (octant & YMAJOR)
+ err = e + clipdy*dmin - clipdx*dmaj;
+ else
+ err = e + clipdx*dmin - clipdy*dmaj;
+ } else
+ err = e;
+
+#define range infoRec->SolidBresenhamLineErrorTermBits
+ abserr = abs(err);
+ while((abserr & range) ||
+ (dmaj & range) ||
+ (dmin & range)) {
+ dmin >>= 1;
+ dmaj >>= 1;
+ abserr >>= 1;
+ err /= 2;
+ }
+
+ (*infoRec->SubsequentSolidBresenhamLine)(
+ infoRec->pScrn, new_x1, new_y1,
+ dmaj, dmin, err, len, octant);
+ }
+ pbox++;
+ }
+ } /* while (nbox--) */
+ } /* sloped line */
+ } /* while (nline--) */
+
+#ifndef POLYSEGMENT
+ /* paint the last point if the end style isn't CapNotLast.
+ (Assume that a projecting, butt, or round cap that is one
+ pixel wide is the same as the single pixel of the endpoint.)
+ */
+
+ if ((pGC->capStyle != CapNotLast) &&
+ ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
+ (ppt->y + yorg != pptInit->y + pDrawable->y) ||
+ (ppt == pptInit + 1)))
+ {
+ nbox = nboxInit;
+ pbox = pboxInit;
+ while (nbox--)
+ {
+ if ((x2 >= pbox->x1) && (y2 >= pbox->y1) &&
+ (x2 < pbox->x2) && (y2 < pbox->y2))
+ {
+ (*infoRec->SubsequentSolidHorVertLine)(
+ infoRec->pScrn, x2, y2, 1, DEGREES_0);
+ break;
+ }
+ else
+ pbox++;
+ }
+ }
+#endif
+
+ SET_SYNC_FLAG(infoRec);
+}
+
diff --git a/hw/xfree86/xaa/xaaLineMisc.c b/hw/xfree86/xaa/xaaLineMisc.c
new file mode 100644
index 000000000..370921002
--- /dev/null
+++ b/hw/xfree86/xaa/xaaLineMisc.c
@@ -0,0 +1,148 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaLineMisc.c,v 1.5 1999/01/14 13:05:27 dawes Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "miline.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+
+void
+XAASolidHorVertLineAsRects(
+ ScrnInfoPtr pScrn,
+ int x, int y, int len, int dir
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ if(dir == DEGREES_0)
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, len, 1);
+ else
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, len);
+}
+
+
+void
+XAASolidHorVertLineAsTwoPoint(
+ ScrnInfoPtr pScrn,
+ int x, int y, int len, int dir
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ len--;
+
+ if(dir == DEGREES_0)
+ (*infoRec->SubsequentSolidTwoPointLine)(pScrn, x, y, x + len, y, 0);
+ else
+ (*infoRec->SubsequentSolidTwoPointLine)(pScrn, x, y, x, y + len, 0);
+}
+
+void
+XAASolidHorVertLineAsBresenham(
+ ScrnInfoPtr pScrn,
+ int x, int y, int len, int dir
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ if(dir == DEGREES_0)
+ (*infoRec->SubsequentSolidBresenhamLine)(
+ pScrn, x, y, len << 1, 0, -len, len, 0);
+ else
+ (*infoRec->SubsequentSolidBresenhamLine)(
+ pScrn, x, y, len << 1, 0, -len, len, YMAJOR);
+}
+
+
+void
+XAAComputeDash(GCPtr pGC)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;
+ Bool EvenDash = (pGC->numInDashList & 0x01) ? FALSE : TRUE;
+ int PatternLength = 0;
+ unsigned char* DashPtr = (unsigned char*)pGC->dash;
+ CARD32 *ptr;
+ int count = pGC->numInDashList;
+ int shift, value, direction;
+ Bool set;
+
+ if(pGCPriv->DashPattern)
+ xfree(pGCPriv->DashPattern);
+
+ pGCPriv->DashPattern = NULL;
+ pGCPriv->DashLength = 0;
+
+ while(count--)
+ PatternLength += *(DashPtr++);
+
+ if(!EvenDash)
+ PatternLength <<= 1;
+
+ if(PatternLength > infoRec->DashPatternMaxLength)
+ return;
+
+ if((infoRec->DashedLineFlags & LINE_PATTERN_POWER_OF_2_ONLY) &&
+ (PatternLength & (PatternLength - 1)))
+ return;
+
+ pGCPriv->DashPattern = xcalloc((PatternLength + 31) >> 5, 4);
+ if(!pGCPriv->DashPattern) return;
+ pGCPriv->DashLength = PatternLength;
+
+ if(infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
+ LINE_PATTERN_LSBFIRST_LSBJUSTIFIED)) {
+ direction = 1;
+ set = TRUE;
+ DashPtr = (unsigned char*)pGC->dash;
+ } else {
+ direction = -1;
+ set = FALSE;
+ DashPtr = (unsigned char*)pGC->dash + pGC->numInDashList - 1;
+ }
+
+ if(infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
+ LINE_PATTERN_MSBFIRST_MSBJUSTIFIED))
+ shift = 32 - (PatternLength & 31);
+ else
+ shift = 0;
+
+ ptr = (CARD32*)(pGCPriv->DashPattern);
+
+CONCATENATE:
+
+ count = pGC->numInDashList;
+
+ while(count--) {
+ value = *DashPtr;
+ DashPtr += direction;
+ while(value) {
+ if(value < (32 - shift)) {
+ if(set) *ptr |= XAAShiftMasks[value] << shift;
+ shift += value;
+ break;
+ } else {
+ if(set) *ptr |= ~0L << shift;
+ value -= (32 - shift);
+ shift = 0;
+ ptr++;
+ }
+ }
+ if(set) set = FALSE;
+ else set = TRUE;
+ }
+
+ if(!EvenDash) {
+ EvenDash = TRUE;
+ if(infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED |
+ LINE_PATTERN_LSBFIRST_LSBJUSTIFIED))
+ DashPtr = (unsigned char*)pGC->dash;
+ else
+ DashPtr = (unsigned char*)pGC->dash + pGC->numInDashList;
+ goto CONCATENATE;
+ }
+}
diff --git a/hw/xfree86/xaa/xaaNonTEGlyph.c b/hw/xfree86/xaa/xaaNonTEGlyph.c
new file mode 100644
index 000000000..234d242c4
--- /dev/null
+++ b/hw/xfree86/xaa/xaaNonTEGlyph.c
@@ -0,0 +1,198 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEGlyph.c,v 1.6 1999/11/06 23:14:46 mvojkovi Exp $ */
+
+
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaacexp.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+
+/* Not used anymore because the algorithm isn't correct. It doesn't
+ handle overlapping characters properly */
+
+#ifdef TRIPLE_BITS
+#define NonTEGlyphFunc EXPNAME(XAANonTEGlyphScanlineFunc3)
+#else
+#define NonTEGlyphFunc EXPNAME(XAANonTEGlyphScanlineFunc)
+#endif
+
+/********************************************************************
+
+ Here we have NonTEGlyphRenders for a bunch of different color
+ expansion types. The driver may provide its own renderer, but
+ this is the default one which renders using lower-level primitives
+ exported by the chipset driver.
+
+********************************************************************/
+
+/* Since the dimensions of the text string and the backing rectangle
+ do not always coincide, it is possible that wBack or wText
+ may be 0! The NonTEGlyphRender must always check for this. */
+
+/* This gets built for MSBFIRST or LSBFIRST with FIXEDBASE or not,
+ with TRIPLE_BITS or not. A total of 8 versions */
+
+/* if the backing rectangle and text are of the same dimensions
+ then we can draw in one pass */
+
+void
+#ifdef TRIPLE_BITS
+EXPNAME(XAANonTEGlyphRenderer3)(
+#else
+EXPNAME(XAANonTEGlyphRenderer)(
+#endif
+ ScrnInfoPtr pScrn,
+ int xText, int wText,
+ int y, int h, int skipleft, int startline,
+ NonTEGlyphInfo *glyphp,
+ int fg, int rop,
+ unsigned int planemask )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32* base = (CARD32*)infoRec->ColorExpandBase;
+#ifdef TRIPLE_BITS
+ int dwords = ((3 * wText + 31) >> 5) * h;
+#else
+ int dwords = ((wText + 31) >> 5) * h;
+#endif
+
+ (*infoRec->SetupForCPUToScreenColorExpandFill)(
+ pScrn, fg, -1, rop, planemask);
+ (*infoRec->SubsequentCPUToScreenColorExpandFill)(
+ pScrn, xText, y, wText, h, 0);
+
+#ifndef FIXEDBASE
+#ifdef TRIPLE_BITS
+ if((((3 * wText + 31) >> 5) * h) <= infoRec->ColorExpandRange)
+#else
+ if((((wText + 31) >> 5) * h) <= infoRec->ColorExpandRange)
+#endif
+ while(h--)
+ base = NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
+ else
+#endif
+ while(h--)
+ NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
+
+ if((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD) &&
+ (dwords & 1)) {
+ base = (CARD32*)infoRec->ColorExpandBase;
+ base[0] = 0x00000000;
+ }
+
+ if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+}
+
+#ifndef FIXEDBASE
+/* Scanline version of above gets built for LSBFIRST and MSBFIRST */
+
+void
+#ifdef TRIPLE_BITS
+EXPNAME(XAANonTEGlyphRendererScanline3)(
+#else
+EXPNAME(XAANonTEGlyphRendererScanline)(
+#endif
+ ScrnInfoPtr pScrn,
+ int xText, int wText,
+ int y, int h, int skipleft, int startline,
+ NonTEGlyphInfo *glyphp,
+ int fg, int rop,
+ unsigned int planemask )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int bufferNo = 0;
+ CARD32* base;
+
+ (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
+ pScrn, fg, -1, rop, planemask);
+ (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
+ pScrn, xText, y, wText, h, 0);
+
+ while(h--) {
+ base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
+ NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft);
+ (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
+ if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
+ bufferNo = 0;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+#endif
+
+/********************************************************************
+
+ Generic NonTE scanline rendering code.
+
+********************************************************************/
+
+
+CARD32*
+NonTEGlyphFunc(
+ CARD32 *base,
+ NonTEGlyphInfo *glyphp,
+ int line, int TotalWidth, int skipleft )
+{
+ CARD32 bits = 0;
+ int shift = glyphp->width;
+
+ if(skipleft) {
+ if((line >= glyphp->firstline) && (line <= glyphp->lastline))
+ bits = SHIFT_R(glyphp->bitsp[line], skipleft);
+ shift -= skipleft;
+ } else if((line >= glyphp->firstline) && (line <= glyphp->lastline))
+ bits = glyphp->bitsp[line];
+
+
+ while(TotalWidth > 32) {
+ while(shift < 32) {
+ glyphp++;
+ if((line >= glyphp->firstline) && (line <= glyphp->lastline))
+ bits |= SHIFT_L(glyphp->bitsp[line],shift);
+ shift += glyphp->width;
+ }
+#ifdef TRIPLE_BITS
+ WRITE_BITS3(bits);
+#else
+ WRITE_BITS(bits);
+#endif
+ shift &= 31;
+ if(shift &&
+ (line >= glyphp->firstline) && (line <= glyphp->lastline))
+ bits = SHIFT_R(glyphp->bitsp[line], glyphp->width - shift);
+ else bits = 0;
+ TotalWidth -= 32;
+ }
+
+ if(TotalWidth) {
+ TotalWidth -= shift;
+ while(TotalWidth > 0) {
+ glyphp++;
+ if((line >= glyphp->firstline) && (line <= glyphp->lastline))
+ bits |= SHIFT_L(glyphp->bitsp[line], shift);
+ shift += glyphp->width;
+ TotalWidth -= glyphp->width;
+ }
+#ifdef TRIPLE_BITS
+ if (shift >= 22) {
+ WRITE_BITS3(bits);
+ } else if (shift >= 11) {
+ WRITE_BITS2(bits);
+ } else {
+ WRITE_BITS1(bits);
+ }
+#else
+ WRITE_BITS(bits);
+#endif
+ }
+
+
+ return base;
+}
+
+
+
+
diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c
new file mode 100644
index 000000000..914631b58
--- /dev/null
+++ b/hw/xfree86/xaa/xaaNonTEText.c
@@ -0,0 +1,588 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaNonTEText.c,v 1.12 2000/04/07 19:11:10 mvojkovi Exp $ */
+
+/********************************************************************
+
+ In this file we have GC level replacements for PolyText8/16,
+ ImageText8/16, ImageGlyphBlt and PolyGlyphBlt for NonTE (proportional)
+ fonts. The idea is that everything in this file is device independent.
+ The mentioned GCOps are merely wrappers for the
+ PolyGlyphBltNonTEColorExpansion and ImageGlyphBltNonTEColorExpansion
+ functions which calculate the boxes containing arbitrarily clipped
+ text and passes them to the NonTEGlyphRenderer which will usually
+ be a lower level XAA function which renders these clipped glyphs using
+ the basic color expansion functions exported by the chipset driver.
+ The NonTEGlyphRenderer itself may optionally be driver supplied to
+ facilitate work-arounds/optimizations at a higher level than usual.
+
+ Written by Mark Vojkovich (mvojkovi@ucsd.edu)
+
+********************************************************************/
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "font.h"
+#include "scrnintstr.h"
+#include "dixfontstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaacexp.h"
+#include "xaalocal.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+
+
+static void ImageGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn,
+ int xInit, int yInit, FontPtr font,
+ int fg, int bg, unsigned planemask,
+ RegionPtr cclip, int nglyph,
+ unsigned char* gBase, CharInfoPtr *ppci);
+static int PolyGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn,
+ int xInit, int yInit, FontPtr font,
+ int fg, int rop, unsigned planemask,
+ RegionPtr cclip, int nglyph,
+ unsigned char* gBase, CharInfoPtr *ppci);
+
+/********************************************************************
+
+ GC level replacements for PolyText8/16 and ImageText8/16
+ for NonTE fonts when using color expansion.
+
+********************************************************************/
+
+
+int
+XAAPolyText8NonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ unsigned long n;
+ int width = 0;
+
+ (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
+ (unsigned char *)chars, Linear8Bit, &n, infoRec->CharInfo);
+
+ if(n) {
+ width = PolyGlyphBltNonTEColorExpansion( infoRec->pScrn,
+ x + pDraw->x, y + pDraw->y, pGC->font,
+ pGC->fgPixel, pGC->alu, pGC->planemask,
+ pGC->pCompositeClip, n, FONTGLYPHS(pGC->font),
+ infoRec->CharInfo);
+ }
+
+ return (x + width);
+}
+
+
+int
+XAAPolyText16NonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ unsigned long n;
+ int width = 0;
+
+ (*pGC->font->get_glyphs)(
+ pGC->font, (unsigned long)count, (unsigned char *)chars,
+ (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
+ &n, infoRec->CharInfo);
+
+ if(n) {
+ width = PolyGlyphBltNonTEColorExpansion( infoRec->pScrn,
+ x + pDraw->x, y + pDraw->y, pGC->font,
+ pGC->fgPixel, pGC->alu, pGC->planemask,
+ pGC->pCompositeClip, n, FONTGLYPHS(pGC->font),
+ infoRec->CharInfo);
+ }
+
+ return (x + width);
+}
+
+
+void
+XAAImageText8NonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ unsigned long n;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
+ (unsigned char *)chars, Linear8Bit, &n, infoRec->CharInfo);
+
+ if(n) ImageGlyphBltNonTEColorExpansion(
+ infoRec->pScrn, x + pDraw->x, y + pDraw->y,
+ pGC->font, pGC->fgPixel, pGC->bgPixel, pGC->planemask,
+ pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
+}
+
+
+void
+XAAImageText16NonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ unsigned long n;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ (*pGC->font->get_glyphs)(
+ pGC->font, (unsigned long)count, (unsigned char *)chars,
+ (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
+ &n, infoRec->CharInfo);
+
+ if(n) ImageGlyphBltNonTEColorExpansion(
+ infoRec->pScrn, x + pDraw->x, y + pDraw->y,
+ pGC->font, pGC->fgPixel, pGC->bgPixel, pGC->planemask,
+ pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
+}
+
+
+
+/********************************************************************
+
+ GC level replacements for ImageGlyphBlt and PolyGlyphBlt for
+ NonTE fonts when using color expansion.
+
+********************************************************************/
+
+
+void
+XAAImageGlyphBltNonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci, /* array of character info */
+ pointer pglyphBase /* start of array of glyphs */
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ ImageGlyphBltNonTEColorExpansion(
+ infoRec->pScrn, xInit + pDraw->x, yInit + pDraw->y,
+ pGC->font, pGC->fgPixel, pGC->bgPixel, pGC->planemask,
+ pGC->pCompositeClip, nglyph, (unsigned char*)pglyphBase, ppci);
+}
+
+void
+XAAPolyGlyphBltNonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci, /* array of character info */
+ pointer pglyphBase /* start of array of glyphs */
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ PolyGlyphBltNonTEColorExpansion(
+ infoRec->pScrn, xInit + pDraw->x, yInit + pDraw->y,
+ pGC->font, pGC->fgPixel, pGC->alu, pGC->planemask,
+ pGC->pCompositeClip, nglyph, (unsigned char*)pglyphBase, ppci);
+}
+
+
+
+
+/********************************************************************
+
+ ImageGlyphBltNonTEColorExpansion -
+ PolyGlyphBltNonTEColorExpansion -
+
+ These guys compute the clipped pieces of text and send it to
+ the lower-level function which will handle acceleration of
+ arbitrarily clipped text.
+
+********************************************************************/
+
+
+
+static int
+CollectCharacterInfo(
+ NonTEGlyphPtr glyphs,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ FontPtr pfont
+){
+ int i, w = 0;
+
+ for(i = 0; i < nglyph; i++, ppci++, glyphs++) {
+ glyphs->bits = (unsigned char*)((*ppci)->bits);
+ glyphs->start = w + (*ppci)->metrics.leftSideBearing;
+ glyphs->end = w + (*ppci)->metrics.rightSideBearing;
+ glyphs->yoff = (*ppci)->metrics.ascent;
+ glyphs->height = glyphs->yoff + (*ppci)->metrics.descent;
+ glyphs->srcwidth = PADGLYPHWIDTHBYTES(glyphs->end - glyphs->start);
+ w += (*ppci)->metrics.characterWidth;
+ }
+ return w;
+}
+
+
+static void
+PolyGlyphBltAsSingleBitmap (
+ ScrnInfoPtr pScrn,
+ int nglyph,
+ FontPtr font,
+ int xInit,
+ int yInit,
+ int nbox,
+ BoxPtr pbox,
+ int fg,
+ int rop,
+ unsigned planemask
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32 *block, *pntr, *bits;
+ int pitch, topLine, botLine, top, bot, height;
+ int Left, Right, Top, Bottom;
+ int LeftEdge, RightEdge;
+ int bitPitch, shift, size, i, skippix;
+ NonTEGlyphPtr glyphs = infoRec->GlyphInfo;
+ Bool extra;
+
+ Left = xInit + infoRec->GlyphInfo[0].start;
+ Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
+ Top = yInit - FONTMAXBOUNDS(font,ascent);
+ Bottom = yInit + FONTMAXBOUNDS(font,descent);
+
+ /* get into the first band that may contain part of our string */
+ while(nbox && (Top >= pbox->y2)) {
+ pbox++; nbox--;
+ }
+
+ if(!nbox) return;
+
+ pitch = (Right - Left + 31) >> 5;
+ size = (pitch << 2) * (Bottom - Top);
+ block = (CARD32*)ALLOCATE_LOCAL(size);
+ bzero(block, size);
+
+ topLine = 10000; botLine = -10000;
+
+ while(nglyph--) {
+ top = -glyphs->yoff;
+ bot = top + glyphs->height;
+ if(top < topLine) topLine = top;
+ if(bot > botLine) botLine = bot;
+ skippix = glyphs->start - infoRec->GlyphInfo[0].start;
+ bits = (CARD32*)glyphs->bits;
+ bitPitch = glyphs->srcwidth >> 2;
+ pntr = block + ((FONTMAXBOUNDS(font,ascent) + top) * pitch) +
+ (skippix >> 5);
+ shift = skippix & 31;
+ extra = ((shift + glyphs->end - glyphs->start) > 32);
+
+ for(i = top; i < bot; i++) {
+ *pntr |= SHIFT_L(*bits, shift);
+ if(extra)
+ *(pntr + 1) |= SHIFT_R(*bits,32 - shift);
+ pntr += pitch;
+ bits += bitPitch;
+ }
+
+ glyphs++;
+ }
+
+ pntr = block + ((FONTMAXBOUNDS(font,ascent) + topLine) * pitch);
+
+ Top = yInit + topLine;
+ Bottom = yInit + botLine;
+
+ while(nbox && (Top >= pbox->y2)) {
+ pbox++; nbox--;
+ }
+
+ while(nbox && (Bottom > pbox->y1)) {
+ LeftEdge = max(Left, pbox->x1);
+ RightEdge = min(Right, pbox->x2);
+
+ if(RightEdge > LeftEdge) {
+ skippix = LeftEdge - Left;
+ topLine = max(Top, pbox->y1);
+ botLine = min(Bottom, pbox->y2);
+ height = botLine - topLine;
+
+ if(height > 0)
+ (*infoRec->WriteBitmap)(pScrn, LeftEdge, topLine,
+ RightEdge - LeftEdge, height,
+ (unsigned char*)(pntr + ((topLine - Top) * pitch) +
+ (skippix >> 5)),
+ pitch << 2, skippix & 31, fg, -1, rop, planemask);
+ }
+
+ nbox--; pbox++;
+ }
+
+ DEALLOCATE_LOCAL(block);
+}
+
+static void
+ImageGlyphBltNonTEColorExpansion(
+ ScrnInfoPtr pScrn,
+ int xInit, int yInit,
+ FontPtr font,
+ int fg, int bg,
+ unsigned planemask,
+ RegionPtr cclip,
+ int nglyph,
+ unsigned char* gBase,
+ CharInfoPtr *ppci
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int skippix, skipglyph, width, n, i;
+ int Left, Right, Top, Bottom;
+ int LeftEdge, RightEdge, ytop, ybot;
+ int nbox = REGION_NUM_RECTS(cclip);
+ BoxPtr pbox = REGION_RECTS(cclip);
+ Bool AlreadySetup = FALSE;
+
+ width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
+
+ /* find our backing rectangle dimensions */
+ Left = xInit;
+ Right = Left + width;
+ Top = yInit - FONTASCENT(font);
+ Bottom = yInit + FONTDESCENT(font);
+
+ /* get into the first band that may contain part of our box */
+ while(nbox && (Top >= pbox->y2)) {
+ pbox++; nbox--;
+ }
+
+ while(nbox && (Bottom >= pbox->y1)) {
+ /* handle backing rect first */
+ LeftEdge = max(Left, pbox->x1);
+ RightEdge = min(Right, pbox->x2);
+ if(RightEdge > LeftEdge) {
+ ytop = max(Top, pbox->y1);
+ ybot = min(Bottom, pbox->y2);
+
+ if(ybot > ytop) {
+ if(!AlreadySetup) {
+ (*infoRec->SetupForSolidFill)(pScrn, bg, GXcopy, planemask);
+ AlreadySetup = TRUE;
+ }
+ (*infoRec->SubsequentSolidFillRect)(pScrn,
+ LeftEdge, ytop, RightEdge - LeftEdge, ybot - ytop);
+ }
+ }
+ nbox--; pbox++;
+ }
+
+ nbox = REGION_NUM_RECTS(cclip);
+ pbox = REGION_RECTS(cclip);
+
+ if(infoRec->WriteBitmap && (nglyph > 1) &&
+ ((FONTMAXBOUNDS(font, rightSideBearing) -
+ FONTMINBOUNDS(font, leftSideBearing)) <= 32))
+ {
+ PolyGlyphBltAsSingleBitmap(pScrn, nglyph, font,
+ xInit, yInit, nbox, pbox,
+ fg, GXcopy, planemask);
+
+ return;
+ }
+
+ /* compute an approximate but covering bounding box */
+ Left = xInit + infoRec->GlyphInfo[0].start;
+ Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
+ Top = yInit - FONTMAXBOUNDS(font,ascent);
+ Bottom = yInit + FONTMAXBOUNDS(font,descent);
+
+ /* get into the first band that may contain part of our box */
+ while(nbox && (Top >= pbox->y2)) {
+ pbox++; nbox--;
+ }
+
+ /* stop when the lower edge of the box is beyond our string */
+ while(nbox && (Bottom >= pbox->y1)) {
+ LeftEdge = max(Left, pbox->x1);
+ RightEdge = min(Right, pbox->x2);
+
+ if(RightEdge > LeftEdge) { /* we're possibly drawing something */
+ ytop = max(Top, pbox->y1);
+ ybot = min(Bottom, pbox->y2);
+ if(ybot > ytop) {
+ skippix = LeftEdge - xInit;
+ skipglyph = 0;
+ while(skippix >= infoRec->GlyphInfo[skipglyph].end)
+ skipglyph++;
+
+ skippix = RightEdge - xInit;
+ n = 0; i = skipglyph;
+ while((i < nglyph) && (skippix > infoRec->GlyphInfo[i].start)) {
+ i++; n++;
+ }
+
+ if(n) (*infoRec->NonTEGlyphRenderer)(pScrn,
+ xInit, yInit, n, infoRec->GlyphInfo + skipglyph,
+ pbox, fg, GXcopy, planemask);
+ }
+ }
+
+ nbox--; pbox++;
+ }
+}
+
+
+static int
+PolyGlyphBltNonTEColorExpansion(
+ ScrnInfoPtr pScrn,
+ int xInit, int yInit,
+ FontPtr font,
+ int fg, int rop,
+ unsigned planemask,
+ RegionPtr cclip,
+ int nglyph,
+ unsigned char* gBase,
+ CharInfoPtr *ppci
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int skippix, skipglyph, width, n, i;
+ int Left, Right, Top, Bottom;
+ int LeftEdge, RightEdge;
+ int nbox = REGION_NUM_RECTS(cclip);
+ BoxPtr pbox = REGION_RECTS(cclip);
+
+ width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
+
+ if(!nbox)
+ return width;
+
+ if((infoRec->WriteBitmap) && (rop == GXcopy) && (nglyph > 1) &&
+ ((FONTMAXBOUNDS(font, rightSideBearing) -
+ FONTMINBOUNDS(font, leftSideBearing)) <= 32)) {
+
+ PolyGlyphBltAsSingleBitmap(pScrn, nglyph, font,
+ xInit, yInit, nbox, pbox,
+ fg, rop, planemask);
+
+ return width;
+ }
+
+ /* compute an approximate but covering bounding box */
+ Left = xInit + infoRec->GlyphInfo[0].start;
+ Right = xInit + infoRec->GlyphInfo[nglyph - 1].end;
+ Top = yInit - FONTMAXBOUNDS(font,ascent);
+ Bottom = yInit + FONTMAXBOUNDS(font,descent);
+
+ /* get into the first band that may contain part of our string */
+ while(nbox && (Top >= pbox->y2)) {
+ pbox++; nbox--;
+ }
+
+ /* stop when the lower edge of the box is beyond our string */
+ while(nbox && (Bottom >= pbox->y1)) {
+ LeftEdge = max(Left, pbox->x1);
+ RightEdge = min(Right, pbox->x2);
+
+ if(RightEdge > LeftEdge) { /* we're possibly drawing something */
+
+ skippix = LeftEdge - xInit;
+ skipglyph = 0;
+ while(skippix >= infoRec->GlyphInfo[skipglyph].end)
+ skipglyph++;
+
+ skippix = RightEdge - xInit;
+ n = 0; i = skipglyph;
+ while((i < nglyph) && (skippix > infoRec->GlyphInfo[i].start)) {
+ i++; n++;
+ }
+
+ if(n) (*infoRec->NonTEGlyphRenderer)(pScrn,
+ xInit, yInit, n, infoRec->GlyphInfo + skipglyph,
+ pbox, fg, rop, planemask);
+ }
+
+ nbox--; pbox++;
+ }
+ return width;
+}
+
+
+/* It is possible that the none of the glyphs passed to the
+ NonTEGlyphRenderer will be drawn. This function being called
+ indicates that part of the text string's bounding box is visible
+ but not necessarily that any of the characters are visible */
+
+void XAANonTEGlyphRenderer(
+ ScrnInfoPtr pScrn,
+ int x, int y, int n,
+ NonTEGlyphPtr glyphs,
+ BoxPtr pbox,
+ int fg, int rop,
+ unsigned int planemask
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int x1, x2, y1, y2, i, w, h, skipleft, skiptop;
+ unsigned char *src;
+
+ for(i = 0; i < n; i++, glyphs++) {
+ x1 = x + glyphs->start;
+ x2 = x + glyphs->end;
+ y1 = y - glyphs->yoff;
+ y2 = y1 + glyphs->height;
+
+ if(y1 < pbox->y1) {
+ skiptop = pbox->y1 - y1;
+ y1 = pbox->y1;
+ } else skiptop = 0;
+ if(y2 > pbox->y2) y2 = pbox->y2;
+ h = y2 - y1;
+ if(h <= 0) continue;
+
+ if(x1 < pbox->x1) {
+ skipleft = pbox->x1 - x1;
+ x1 = pbox->x1;
+ } else skipleft = 0;
+ if(x2 > pbox->x2) x2 = pbox->x2;
+
+ w = x2 - x1;
+
+ if(w > 0) {
+ src = glyphs->bits + (skiptop * glyphs->srcwidth);
+
+ if(skipleft) {
+ src += (skipleft >> 5) << 2;
+ skipleft &= 31;
+ }
+
+ (*infoRec->WriteBitmap)(pScrn, x1, y1, w, h, src,
+ glyphs->srcwidth, skipleft, fg, -1, rop, planemask);
+ }
+ }
+
+}
diff --git a/hw/xfree86/xaa/xaaOffscreen.c b/hw/xfree86/xaa/xaaOffscreen.c
new file mode 100644
index 000000000..0fb1db365
--- /dev/null
+++ b/hw/xfree86/xaa/xaaOffscreen.c
@@ -0,0 +1,160 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOffscreen.c,v 1.6 2001/07/19 18:50:16 mvojkovi Exp $ */
+
+/*
+ Copyright (c) 1999 - The XFree86 Project Inc.
+
+ Written by Mark Vojkovich
+
+*/
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "mi.h"
+#include "miline.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+#include "xf86fbman.h"
+#include "servermd.h"
+
+void
+XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
+ XAAPixmapPtr pPriv;
+
+ while(pLink) {
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pLink->pPix);
+ pLink->area = pPriv->offscreenArea;
+ XAAMoveOutOffscreenPixmap(pLink->pPix);
+ pLink = pLink->next;
+ }
+}
+
+
+
+void
+XAAMoveInOffscreenPixmaps(ScreenPtr pScreen)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ PixmapLinkPtr pLink = infoRec->OffscreenPixmaps;
+ PixmapPtr pPix, pScreenPix, tmpPix;
+ pointer data;
+ XAAPixmapPtr pPriv;
+ GCPtr pGC;
+ FBAreaPtr area;
+
+ pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
+
+ while(pLink) {
+ pPix = pLink->pPix;
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ area = pLink->area;
+
+ data = pPix->devPrivate.ptr;
+ tmpPix = GetScratchPixmapHeader(pScreen,
+ pPix->drawable.width, pPix->drawable.height,
+ pPix->drawable.depth, pPix->drawable.bitsPerPixel,
+ pPix->devKind, data);
+
+ pPriv->freeData = FALSE;
+
+ pPix->drawable.x = area->box.x1;
+ pPix->drawable.y = area->box.y1;
+ pPix->devKind = pScreenPix->devKind;
+ pPix->devPrivate.ptr = pScreenPix->devPrivate.ptr;
+ pPix->drawable.bitsPerPixel = infoRec->pScrn->bitsPerPixel;
+ pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+
+ if(!tmpPix) {
+ pPriv->offscreenArea = area;
+ xfree(data);
+ pLink = pLink->next;
+ continue;
+ }
+
+ pGC = GetScratchGC(pPix->drawable.depth, pScreen);
+ ValidateGC((DrawablePtr)pPix, pGC);
+
+ (*pGC->ops->CopyArea)((DrawablePtr)tmpPix, (DrawablePtr)pPix, pGC,
+ 0, 0, pPix->drawable.width, pPix->drawable.height, 0, 0);
+
+ xfree(data);
+ tmpPix->devPrivate.ptr = NULL;
+
+ FreeScratchGC(pGC);
+ FreeScratchPixmapHeader(tmpPix);
+
+ pPriv->offscreenArea = area;
+ pLink->area = NULL;
+ pLink = pLink->next;
+ }
+}
+
+
+void
+XAARemoveAreaCallback(FBAreaPtr area)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(area->pScreen);
+ PixmapPtr pPix = (PixmapPtr)area->devPrivate.ptr;
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+
+ XAAMoveOutOffscreenPixmap(pPix);
+
+ pPriv->flags &= ~OFFSCREEN;
+
+ DELIST_OFFSCREEN_PIXMAP(pPix);
+}
+
+void
+XAAMoveOutOffscreenPixmap(PixmapPtr pPix)
+{
+ ScreenPtr pScreen = pPix->drawable.pScreen;
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ int width, height, devKind, bitsPerPixel;
+ PixmapPtr tmpPix;
+ unsigned char *data;
+ GCPtr pGC;
+
+ width = pPix->drawable.width;
+ height = pPix->drawable.height;
+ bitsPerPixel = pPix->drawable.bitsPerPixel;
+
+ devKind = BitmapBytePad(width * bitsPerPixel);
+ if(!(data = xalloc(devKind * height)))
+ FatalError("Out of memory\n");
+
+ tmpPix = GetScratchPixmapHeader(pScreen, width, height,
+ pPix->drawable.depth, bitsPerPixel, devKind, data);
+ if(!tmpPix) {
+ xfree(data);
+ FatalError("Out of memory\n");
+ }
+
+ pGC = GetScratchGC(pPix->drawable.depth, pScreen);
+ ValidateGC((DrawablePtr)tmpPix, pGC);
+
+ (*pGC->ops->CopyArea)((DrawablePtr)pPix, (DrawablePtr)tmpPix,
+ pGC, 0, 0, width, height, 0, 0);
+
+ FreeScratchGC(pGC);
+ FreeScratchPixmapHeader(tmpPix);
+
+ pPix->drawable.x = 0;
+ pPix->drawable.y = 0;
+ pPix->devKind = devKind;
+ pPix->devPrivate.ptr = data;
+ pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+
+ pPriv->offscreenArea = NULL;
+ pPriv->freeData = TRUE;
+}
diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c
new file mode 100644
index 000000000..9651ca6a3
--- /dev/null
+++ b/hw/xfree86/xaa/xaaOverlay.c
@@ -0,0 +1,306 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlay.c,v 1.14 2002/12/10 04:18:20 dawes Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "mioverlay.h"
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
+static void
+XAACopyWindow8_32(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+){
+ DDXPointPtr pptSrc, ppt;
+ RegionRec rgnDst;
+ BoxPtr pbox;
+ int dx, dy, nbox;
+ WindowPtr pwinRoot;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XAAInfoRecPtr infoRec =
+ GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
+ Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
+ RegionPtr borderClip = &pWin->borderClip;
+ Bool freeReg = FALSE;
+
+ if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt ||
+ (infoRec->ScreenToScreenBitBltFlags & NO_PLANEMASK))
+ {
+ XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
+ if(infoRec->pScrn->vtSema && infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
+ XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow8_32);
+ return;
+ }
+
+ pwinRoot = WindowTable[pScreen->myNum];
+
+ if(doUnderlay)
+ freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
+
+ REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc);
+
+ pbox = REGION_RECTS(&rgnDst);
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(!nbox ||
+ !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
+ REGION_UNINIT(pScreen, &rgnDst);
+ return;
+ }
+ ppt = pptSrc;
+
+ while(nbox--) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ ppt++; pbox++;
+ }
+
+ infoRec->ScratchGC.planemask = doUnderlay ? 0x00ffffff : 0xff000000;
+ infoRec->ScratchGC.alu = GXcopy;
+
+ XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
+ &(infoRec->ScratchGC), &rgnDst, pptSrc);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ REGION_UNINIT(pScreen, &rgnDst);
+ if(freeReg)
+ REGION_DESTROY(pScreen, borderClip);
+}
+
+
+
+
+static void
+XAAPaintWindow8_32(
+ WindowPtr pWin,
+ RegionPtr prgn,
+ int what
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
+ int nBox = REGION_NUM_RECTS(prgn);
+ BoxPtr pBox = REGION_RECTS(prgn);
+ PixmapPtr pPix = NULL;
+ int depth = pWin->drawable.depth;
+ int fg = 0, pm;
+
+ if(!infoRec->pScrn->vtSema) goto BAILOUT;
+
+ switch (what) {
+ case PW_BACKGROUND:
+ switch(pWin->backgroundState) {
+ case None: return;
+ case ParentRelative:
+ do { pWin = pWin->parent; }
+ while(pWin->backgroundState == ParentRelative);
+ (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, what);
+ return;
+ case BackgroundPixel:
+ fg = pWin->background.pixel;
+ break;
+ case BackgroundPixmap:
+ pPix = pWin->background.pixmap;
+ break;
+ }
+ break;
+ case PW_BORDER:
+ if (pWin->borderIsPixel)
+ fg = pWin->border.pixel;
+ else /* pixmap */
+ pPix = pWin->border.pixmap;
+ break;
+ default: return;
+ }
+
+ if(depth == 8) {
+ pm = 0xff000000;
+ fg <<= 24;
+ } else
+ pm = 0x00ffffff;
+
+ if(!pPix) {
+ if(infoRec->FillSolidRects &&
+ !(infoRec->FillSolidRectsFlags & NO_PLANEMASK) &&
+ (!(infoRec->FillSolidRectsFlags & RGB_EQUAL) ||
+ (depth == 8) || CHECK_RGB_EQUAL(fg)))
+ {
+ (*infoRec->FillSolidRects)(infoRec->pScrn, fg, GXcopy,
+ pm, nBox, pBox);
+ return;
+ }
+ } else { /* pixmap */
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ WindowPtr pBgWin = pWin;
+ int xorg, yorg;
+
+ if (what == PW_BORDER) {
+ for (pBgWin = pWin;
+ pBgWin->backgroundState == ParentRelative;
+ pBgWin = pBgWin->parent);
+ }
+
+ xorg = pBgWin->drawable.x;
+ yorg = pBgWin->drawable.y;
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ int index = pScreen->myNum;
+ if(WindowTable[index] == pBgWin) {
+ xorg -= panoramiXdataPtr[index].x;
+ yorg -= panoramiXdataPtr[index].y;
+ }
+ }
+#endif
+
+ if(IS_OFFSCREEN_PIXMAP(pPix) && infoRec->FillCacheBltRects) {
+ XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
+
+ pCache->x = pPriv->offscreenArea->box.x1;
+ pCache->y = pPriv->offscreenArea->box.y1;
+ pCache->w = pCache->orig_w =
+ pPriv->offscreenArea->box.x2 - pCache->x;
+ pCache->h = pCache->orig_h =
+ pPriv->offscreenArea->box.y2 - pCache->y;
+ pCache->trans_color = -1;
+
+ (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, pm,
+ nBox, pBox, xorg, yorg, pCache);
+
+ return;
+ }
+
+ if(pPriv->flags & DIRTY) {
+ pPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
+ pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+
+ if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
+ (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
+ XAACheckTileReducibility(pPix, infoRec->CanDoMono8x8);
+ }
+
+ if(pPriv->flags & REDUCIBLE_TO_8x8) {
+ if((pPriv->flags & REDUCIBLE_TO_2_COLOR) &&
+ infoRec->CanDoMono8x8 && infoRec->FillMono8x8PatternRects &&
+ !(infoRec->FillMono8x8PatternRectsFlags & NO_PLANEMASK) &&
+ !(infoRec->FillMono8x8PatternRectsFlags & TRANSPARENCY_ONLY) &&
+ (!(infoRec->FillMono8x8PatternRectsFlags & RGB_EQUAL) ||
+ (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg))))
+ {
+ (*infoRec->FillMono8x8PatternRects)(infoRec->pScrn,
+ pPriv->fg, pPriv->bg, GXcopy, pm, nBox, pBox,
+ pPriv->pattern0, pPriv->pattern1, xorg, yorg);
+ return;
+ }
+ if(infoRec->CanDoColor8x8 && infoRec->FillColor8x8PatternRects &&
+ !(infoRec->FillColor8x8PatternRectsFlags & NO_PLANEMASK))
+ {
+ XAACacheInfoPtr pCache = (*infoRec->CacheColor8x8Pattern)(
+ infoRec->pScrn, pPix, -1, -1);
+
+ (*infoRec->FillColor8x8PatternRects) (infoRec->pScrn,
+ GXcopy, pm, nBox, pBox, xorg, yorg, pCache);
+ return;
+ }
+ }
+
+ if(infoRec->UsingPixmapCache && infoRec->FillCacheBltRects &&
+ !(infoRec->FillCacheBltRectsFlags & NO_PLANEMASK) &&
+ (pPix->drawable.height <= infoRec->MaxCacheableTileHeight) &&
+ (pPix->drawable.width <= infoRec->MaxCacheableTileWidth))
+ {
+ XAACacheInfoPtr pCache =
+ (*infoRec->CacheTile)(infoRec->pScrn, pPix);
+ (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, pm,
+ nBox, pBox, xorg, yorg, pCache);
+ return;
+ }
+
+ if(infoRec->FillImageWriteRects &&
+ !(infoRec->FillImageWriteRectsFlags & NO_PLANEMASK))
+ {
+ (*infoRec->FillImageWriteRects) (infoRec->pScrn, GXcopy,
+ pm, nBox, pBox, xorg, yorg, pPix);
+ return;
+ }
+ }
+
+ if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+
+BAILOUT:
+
+ if(what == PW_BACKGROUND) {
+ XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground);
+ (*pScreen->PaintWindowBackground) (pWin, prgn, what);
+ XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAPaintWindow8_32);
+ } else {
+ XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder);
+ (*pScreen->PaintWindowBorder) (pWin, prgn, what);
+ XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAPaintWindow8_32);
+ }
+}
+
+
+static void
+XAASetColorKey8_32(
+ ScreenPtr pScreen,
+ int nbox,
+ BoxPtr pbox
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ ScrnInfoPtr pScrn = infoRec->pScrn;
+
+ /* I'm counting on writes being clipped away while switched away.
+ If this isn't going to be true then I need to be wrapping instead. */
+ if(!infoRec->pScrn->vtSema) return;
+
+ (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey << 24, GXcopy,
+ 0xff000000, nbox, pbox);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+void
+XAASetupOverlay8_32Planar(ScreenPtr pScreen)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ int i;
+
+ pScreen->PaintWindowBackground = XAAPaintWindow8_32;
+ pScreen->PaintWindowBorder = XAAPaintWindow8_32;
+ pScreen->CopyWindow = XAACopyWindow8_32;
+
+ if(!(infoRec->FillSolidRectsFlags & NO_PLANEMASK))
+ miOverlaySetTransFunction(pScreen, XAASetColorKey8_32);
+
+ infoRec->FullPlanemask = ~0;
+ for(i = 0; i < 32; i++) /* haven't thought about this much */
+ infoRec->FullPlanemasks[i] = ~0;
+}
diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c
new file mode 100644
index 000000000..82a2011a4
--- /dev/null
+++ b/hw/xfree86/xaa/xaaOverlayDF.c
@@ -0,0 +1,1154 @@
+/*
+ Copyright (c) 1999 - The XFree86 Project Inc.
+
+ Written by Mark Vojkovich
+*/
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaOverlayDF.c,v 1.1 1999/03/28 15:33:03 dawes Exp $ */
+
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "mi.h"
+#include "miline.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+#include "servermd.h"
+
+/* Screen funcs */
+
+static void XAAOverCopyWindow(WindowPtr, DDXPointRec, RegionPtr);
+static void XAAOverPaintWindow(WindowPtr, RegionPtr, int);
+static void XAAOverWindowExposures(WindowPtr, RegionPtr, RegionPtr);
+static void XAAOverSaveAreas(PixmapPtr, RegionPtr, int, int, WindowPtr);
+static void XAAOverRestoreAreas(PixmapPtr, RegionPtr, int, int, WindowPtr);
+
+
+static int XAAOverStippledFillChooser(GCPtr);
+static int XAAOverOpaqueStippledFillChooser(GCPtr);
+static int XAAOverTiledFillChooser(GCPtr);
+
+/* GC funcs */
+
+static RegionPtr XAAOverCopyArea(DrawablePtr, DrawablePtr, GC *,
+ int, int, int, int, int, int);
+static RegionPtr XAAOverCopyPlane(DrawablePtr, DrawablePtr, GCPtr,
+ int, int, int, int, int, int, unsigned long);
+static void XAAOverPushPixelsSolid(GCPtr, PixmapPtr, DrawablePtr, int,
+ int, int, int);
+static void XAAOverPolyFillRectSolid(DrawablePtr, GCPtr, int, xRectangle*);
+static void XAAOverPolyFillRectStippled(DrawablePtr, GCPtr, int, xRectangle*);
+static void XAAOverPolyFillRectOpaqueStippled(DrawablePtr, GCPtr,
+ int, xRectangle*);
+static void XAAOverPolyFillRectTiled(DrawablePtr, GCPtr, int, xRectangle*);
+static void XAAOverFillSpansSolid(DrawablePtr, GCPtr, int, DDXPointPtr,
+ int*, int);
+static void XAAOverFillSpansStippled(DrawablePtr, GCPtr, int, DDXPointPtr,
+ int*, int);
+static void XAAOverFillSpansOpaqueStippled(DrawablePtr, GCPtr, int,
+ DDXPointPtr, int*, int);
+static void XAAOverFillSpansTiled(DrawablePtr, GCPtr, int, DDXPointPtr,
+ int*, int);
+static int XAAOverPolyText8TE(DrawablePtr, GCPtr, int, int, int, char *);
+static int XAAOverPolyText16TE(DrawablePtr, GCPtr, int, int, int,
+ unsigned short*);
+static void XAAOverImageText8TE(DrawablePtr, GCPtr, int, int, int, char*);
+static void XAAOverImageText16TE(DrawablePtr, GCPtr, int, int, int,
+ unsigned short*);
+static void XAAOverImageGlyphBltTE(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr*, pointer);
+static void XAAOverPolyGlyphBltTE(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr*, pointer);
+static int XAAOverPolyText8NonTE(DrawablePtr, GCPtr, int, int, int, char*);
+static int XAAOverPolyText16NonTE(DrawablePtr, GCPtr, int, int, int,
+ unsigned short*);
+static void XAAOverImageText8NonTE(DrawablePtr, GCPtr, int, int, int, char*);
+static void XAAOverImageText16NonTE(DrawablePtr, GCPtr, int, int, int,
+ unsigned short*);
+static void XAAOverImageGlyphBltNonTE(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+static void XAAOverPolyGlyphBltNonTE(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+static void XAAOverPolyRectangleThinSolid(DrawablePtr, GCPtr, int, xRectangle*);
+static void XAAOverPolylinesWideSolid(DrawablePtr, GCPtr, int, int,
+ DDXPointPtr);
+static void XAAOverPolylinesThinSolid(DrawablePtr, GCPtr, int, int,
+ DDXPointPtr);
+static void XAAOverPolySegmentThinSolid(DrawablePtr, GCPtr, int, xSegment*);
+static void XAAOverPolylinesThinDashed(DrawablePtr, GCPtr, int, int,
+ DDXPointPtr);
+static void XAAOverPolySegmentThinDashed(DrawablePtr, GCPtr, int, xSegment*);
+static void XAAOverFillPolygonSolid(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+static void XAAOverFillPolygonStippled(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+static void XAAOverFillPolygonOpaqueStippled(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+static void XAAOverFillPolygonTiled(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+static void XAAOverPolyFillArcSolid(DrawablePtr, GCPtr, int, xArc*);
+static void XAAOverPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
+ int, int, char*);
+
+
+typedef struct {
+ ScrnInfoPtr pScrn;
+ DepthChangeFuncPtr callback;
+ int currentDepth;
+/* GC funcs */
+ RegionPtr (*CopyArea)(DrawablePtr, DrawablePtr, GC *,
+ int, int, int, int, int, int);
+ RegionPtr (*CopyPlane)(DrawablePtr, DrawablePtr, GCPtr,
+ int, int, int, int, int, int, unsigned long);
+ void (*PushPixelsSolid)(GCPtr, PixmapPtr, DrawablePtr, int, int, int, int);
+ void (*PolyFillRectSolid)(DrawablePtr, GCPtr, int, xRectangle*);
+ void (*PolyFillRectStippled)(DrawablePtr, GCPtr, int, xRectangle*);
+ void (*PolyFillRectOpaqueStippled)(DrawablePtr, GCPtr, int, xRectangle*);
+ void (*PolyFillRectTiled)(DrawablePtr, GCPtr, int, xRectangle*);
+ void (*FillSpansSolid)(DrawablePtr, GCPtr, int, DDXPointPtr, int*, int);
+ void (*FillSpansStippled)(DrawablePtr, GCPtr, int, DDXPointPtr, int*, int);
+ void (*FillSpansOpaqueStippled)(DrawablePtr,GCPtr,int,DDXPointPtr,int*,int);
+ void (*FillSpansTiled)(DrawablePtr, GCPtr, int, DDXPointPtr, int*, int);
+ int (*PolyText8TE)(DrawablePtr, GCPtr, int, int, int, char *);
+ int (*PolyText16TE)(DrawablePtr, GCPtr, int, int, int, unsigned short*);
+ void (*ImageText8TE)(DrawablePtr, GCPtr, int, int, int, char*);
+ void (*ImageText16TE)(DrawablePtr, GCPtr, int, int, int, unsigned short*);
+ void (*ImageGlyphBltTE)(DrawablePtr, GCPtr, int, int, unsigned int,
+ CharInfoPtr*, pointer);
+ void (*PolyGlyphBltTE)(DrawablePtr, GCPtr, int, int, unsigned int,
+ CharInfoPtr*, pointer);
+ int (*PolyText8NonTE)(DrawablePtr, GCPtr, int, int, int, char*);
+ int (*PolyText16NonTE)(DrawablePtr, GCPtr, int, int, int, unsigned short*);
+ void (*ImageText8NonTE)(DrawablePtr, GCPtr, int, int, int, char*);
+ void (*ImageText16NonTE)(DrawablePtr, GCPtr, int, int, int, unsigned short*);
+ void (*ImageGlyphBltNonTE)(DrawablePtr, GCPtr, int, int, unsigned int,
+ CharInfoPtr *, pointer);
+ void (*PolyGlyphBltNonTE)(DrawablePtr, GCPtr, int, int, unsigned int,
+ CharInfoPtr *, pointer);
+ void (*PolyRectangleThinSolid)(DrawablePtr, GCPtr, int, xRectangle*);
+ void (*PolylinesWideSolid)(DrawablePtr, GCPtr, int, int, DDXPointPtr);
+
+ void (*PolylinesThinSolid)(DrawablePtr, GCPtr, int, int, DDXPointPtr);
+ void (*PolySegmentThinSolid)(DrawablePtr, GCPtr, int, xSegment*);
+ void (*PolylinesThinDashed)(DrawablePtr, GCPtr, int, int, DDXPointPtr);
+ void (*PolySegmentThinDashed)(DrawablePtr, GCPtr, int, xSegment*);
+ void (*FillPolygonSolid)(DrawablePtr, GCPtr, int, int, int, DDXPointPtr);
+ void (*FillPolygonStippled)(DrawablePtr, GCPtr, int, int, int, DDXPointPtr);
+ void (*FillPolygonOpaqueStippled)(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+ void (*FillPolygonTiled)(DrawablePtr, GCPtr, int, int, int, DDXPointPtr);
+ void (*PolyFillArcSolid)(DrawablePtr, GCPtr, int, xArc*);
+ void (*PutImage)(DrawablePtr, GCPtr, int, int, int, int, int, int,
+ int, char*);
+ int (*StippledFillChooser)(GCPtr);
+ int (*OpaqueStippledFillChooser)(GCPtr);
+ int (*TiledFillChooser)(GCPtr);
+} XAAOverlayRec, *XAAOverlayPtr;
+
+static int XAAOverlayIndex = -1;
+static unsigned long XAAOverlayGeneration = 0;
+
+#define GET_OVERLAY_PRIV(pScreen) \
+ ((XAAOverlayPtr)((pScreen)->devPrivates[XAAOverlayIndex].ptr))
+
+#define SWITCH_DEPTH(d) \
+ if(pOverPriv->currentDepth != d) { \
+ (*pOverPriv->callback)(pOverPriv->pScrn, d); \
+ pOverPriv->currentDepth = d; \
+ }
+
+
+Bool
+XAAInitDualFramebufferOverlay(
+ ScreenPtr pScreen,
+ DepthChangeFuncPtr callback
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ XAAOverlayPtr pOverPriv;
+
+ if (XAAOverlayGeneration != serverGeneration) {
+ if((XAAOverlayIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+
+ XAAOverlayGeneration = serverGeneration;
+ }
+
+
+ if(!(pOverPriv = xalloc(sizeof(XAAOverlayRec))))
+ return FALSE;
+
+ pScreen->devPrivates[XAAOverlayIndex].ptr = (pointer)pOverPriv;
+
+ pOverPriv->pScrn = pScrn;
+ pOverPriv->callback = callback;
+ pOverPriv->currentDepth = -1;
+
+ /* Overwrite key screen functions. The XAA core will clean up */
+
+ pScreen->CopyWindow = XAAOverCopyWindow;
+ pScreen->PaintWindowBackground = XAAOverPaintWindow;
+ pScreen->PaintWindowBorder = XAAOverPaintWindow;
+ pScreen->WindowExposures = XAAOverWindowExposures;
+ pScreen->BackingStoreFuncs.SaveAreas = XAAOverSaveAreas;
+ pScreen->BackingStoreFuncs.RestoreAreas = XAAOverRestoreAreas;
+
+ pOverPriv->StippledFillChooser = infoRec->StippledFillChooser;
+ pOverPriv->OpaqueStippledFillChooser = infoRec->OpaqueStippledFillChooser;
+ pOverPriv->TiledFillChooser = infoRec->TiledFillChooser;
+
+ infoRec->StippledFillChooser = XAAOverStippledFillChooser;
+ infoRec->OpaqueStippledFillChooser = XAAOverOpaqueStippledFillChooser;
+ infoRec->TiledFillChooser = XAAOverTiledFillChooser;
+
+ /* wrap all XAA GC rendering */
+
+ pOverPriv->CopyArea = infoRec->CopyArea;
+ pOverPriv->CopyPlane = infoRec->CopyPlane;
+ pOverPriv->PushPixelsSolid = infoRec->PushPixelsSolid;
+ pOverPriv->PolyFillRectSolid = infoRec->PolyFillRectSolid;
+ pOverPriv->PolyFillRectStippled = infoRec->PolyFillRectStippled;
+ pOverPriv->PolyFillRectOpaqueStippled = infoRec->PolyFillRectOpaqueStippled;
+ pOverPriv->PolyFillRectTiled = infoRec->PolyFillRectTiled;
+ pOverPriv->FillSpansSolid = infoRec->FillSpansSolid;
+ pOverPriv->FillSpansStippled = infoRec->FillSpansStippled;
+ pOverPriv->FillSpansOpaqueStippled = infoRec->FillSpansOpaqueStippled;
+ pOverPriv->FillSpansTiled = infoRec->FillSpansTiled;
+ pOverPriv->PolyText8TE = infoRec->PolyText8TE;
+ pOverPriv->PolyText16TE = infoRec->PolyText16TE;
+ pOverPriv->ImageText8TE = infoRec->ImageText8TE;
+ pOverPriv->ImageText16TE = infoRec->ImageText16TE;
+ pOverPriv->ImageGlyphBltTE = infoRec->ImageGlyphBltTE;
+ pOverPriv->PolyGlyphBltTE = infoRec->PolyGlyphBltTE;
+ pOverPriv->PolyText8NonTE = infoRec->PolyText8NonTE;
+ pOverPriv->PolyText16NonTE = infoRec->PolyText16NonTE;
+ pOverPriv->ImageText8NonTE = infoRec->ImageText8NonTE;
+ pOverPriv->ImageText16NonTE = infoRec->ImageText16NonTE;
+ pOverPriv->ImageGlyphBltNonTE = infoRec->ImageGlyphBltNonTE;
+ pOverPriv->PolyGlyphBltNonTE = infoRec->PolyGlyphBltNonTE;
+ pOverPriv->PolyRectangleThinSolid = infoRec->PolyRectangleThinSolid;
+ pOverPriv->PolylinesWideSolid = infoRec->PolylinesWideSolid;
+ pOverPriv->PolylinesThinSolid = infoRec->PolylinesThinSolid;
+ pOverPriv->PolySegmentThinSolid = infoRec->PolySegmentThinSolid;
+ pOverPriv->PolylinesThinDashed = infoRec->PolylinesThinDashed;
+ pOverPriv->PolySegmentThinDashed = infoRec->PolySegmentThinDashed;
+ pOverPriv->FillPolygonSolid = infoRec->FillPolygonSolid;
+ pOverPriv->FillPolygonStippled = infoRec->FillPolygonStippled;
+ pOverPriv->FillPolygonOpaqueStippled = infoRec->FillPolygonOpaqueStippled;
+ pOverPriv->FillPolygonTiled = infoRec->FillPolygonTiled;
+ pOverPriv->PolyFillArcSolid = infoRec->PolyFillArcSolid;
+ pOverPriv->PutImage = infoRec->PutImage;
+
+
+ if(infoRec->CopyArea)
+ infoRec->CopyArea = XAAOverCopyArea;
+ if(infoRec->CopyPlane)
+ infoRec->CopyPlane = XAAOverCopyPlane;
+ if(infoRec->PushPixelsSolid)
+ infoRec->PushPixelsSolid = XAAOverPushPixelsSolid;
+ if(infoRec->PolyFillRectSolid)
+ infoRec->PolyFillRectSolid = XAAOverPolyFillRectSolid;
+ if(infoRec->PolyFillRectStippled)
+ infoRec->PolyFillRectStippled = XAAOverPolyFillRectStippled;
+ if(infoRec->PolyFillRectOpaqueStippled)
+ infoRec->PolyFillRectOpaqueStippled = XAAOverPolyFillRectOpaqueStippled;
+ if(infoRec->PolyFillRectTiled)
+ infoRec->PolyFillRectTiled = XAAOverPolyFillRectTiled;
+ if(infoRec->FillSpansSolid)
+ infoRec->FillSpansSolid = XAAOverFillSpansSolid;
+ if(infoRec->FillSpansStippled)
+ infoRec->FillSpansStippled = XAAOverFillSpansStippled;
+ if(infoRec->FillSpansOpaqueStippled)
+ infoRec->FillSpansOpaqueStippled = XAAOverFillSpansOpaqueStippled;
+ if(infoRec->FillSpansTiled)
+ infoRec->FillSpansTiled = XAAOverFillSpansTiled;
+ if(infoRec->PolyText8TE)
+ infoRec->PolyText8TE = XAAOverPolyText8TE;
+ if(infoRec->PolyText16TE)
+ infoRec->PolyText16TE = XAAOverPolyText16TE;
+ if(infoRec->ImageText8TE)
+ infoRec->ImageText8TE = XAAOverImageText8TE;
+ if(infoRec->ImageText16TE)
+ infoRec->ImageText16TE = XAAOverImageText16TE;
+ if(infoRec->ImageGlyphBltTE)
+ infoRec->ImageGlyphBltTE = XAAOverImageGlyphBltTE;
+ if(infoRec->PolyGlyphBltTE)
+ infoRec->PolyGlyphBltTE = XAAOverPolyGlyphBltTE;
+ if(infoRec->PolyText8NonTE)
+ infoRec->PolyText8NonTE = XAAOverPolyText8NonTE;
+ if(infoRec->PolyText16NonTE)
+ infoRec->PolyText16NonTE = XAAOverPolyText16NonTE;
+ if(infoRec->ImageText8NonTE)
+ infoRec->ImageText8NonTE = XAAOverImageText8NonTE;
+ if(infoRec->ImageText16NonTE)
+ infoRec->ImageText16NonTE = XAAOverImageText16NonTE;
+ if(infoRec->ImageGlyphBltNonTE)
+ infoRec->ImageGlyphBltNonTE = XAAOverImageGlyphBltNonTE;
+ if(infoRec->PolyGlyphBltNonTE)
+ infoRec->PolyGlyphBltNonTE = XAAOverPolyGlyphBltNonTE;
+ if(infoRec->PolyRectangleThinSolid)
+ infoRec->PolyRectangleThinSolid = XAAOverPolyRectangleThinSolid;
+ if(infoRec->PolylinesWideSolid)
+ infoRec->PolylinesWideSolid = XAAOverPolylinesWideSolid;
+ if(infoRec->PolylinesThinSolid)
+ infoRec->PolylinesThinSolid = XAAOverPolylinesThinSolid;
+ if(infoRec->PolySegmentThinSolid)
+ infoRec->PolySegmentThinSolid = XAAOverPolySegmentThinSolid;
+ if(infoRec->PolylinesThinDashed)
+ infoRec->PolylinesThinDashed = XAAOverPolylinesThinDashed;
+ if(infoRec->PolySegmentThinDashed)
+ infoRec->PolySegmentThinDashed = XAAOverPolySegmentThinDashed;
+ if(infoRec->FillPolygonSolid)
+ infoRec->FillPolygonSolid = XAAOverFillPolygonSolid;
+ if(infoRec->FillPolygonStippled)
+ infoRec->FillPolygonStippled = XAAOverFillPolygonStippled;
+ if(infoRec->FillPolygonOpaqueStippled)
+ infoRec->FillPolygonOpaqueStippled = XAAOverFillPolygonOpaqueStippled;
+ if(infoRec->FillPolygonTiled)
+ infoRec->FillPolygonTiled = XAAOverFillPolygonTiled;
+ if(infoRec->PolyFillArcSolid)
+ infoRec->PolyFillArcSolid = XAAOverPolyFillArcSolid;
+ if(infoRec->PutImage)
+ infoRec->PutImage = XAAOverPutImage;
+
+ return TRUE;
+}
+
+/*********************** Screen functions ************************/
+
+void
+XAAOverCopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
+ ScrnInfoPtr pScrn = infoRec->pScrn;
+ DDXPointPtr ppt, pptSrc;
+ RegionRec rgnDst;
+ BoxPtr pbox;
+ int i, nbox, dx, dy;
+ WindowPtr pRoot = WindowTable[pScreen->myNum];
+
+
+ if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
+ XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
+ if(pScrn->vtSema && infoRec->NeedToSync) {
+ (*infoRec->Sync)(pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
+ XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAAOverCopyWindow);
+ return;
+ }
+
+ infoRec->ScratchGC.alu = GXcopy;
+ infoRec->ScratchGC.planemask = ~0;
+
+ REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
+
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(nbox &&
+ (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
+
+ pbox = REGION_RECTS(&rgnDst);
+ for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ SWITCH_DEPTH(8);
+ XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
+ &(infoRec->ScratchGC), &rgnDst, pptSrc);
+
+ if(pWin->drawable.bitsPerPixel != 8) {
+ SWITCH_DEPTH(pScrn->depth);
+ XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
+ &(infoRec->ScratchGC), &rgnDst, pptSrc);
+ }
+
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ REGION_UNINIT(pScreen, &rgnDst);
+
+ if(pWin->drawable.depth == 8) {
+ REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ miSegregateChildren(pWin, &rgnDst, pScrn->depth);
+ if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
+ REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(nbox &&
+ (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))){
+
+ pbox = REGION_RECTS(&rgnDst);
+ for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ SWITCH_DEPTH(pScrn->depth);
+ XAADoBitBlt((DrawablePtr)pRoot, (DrawablePtr)pRoot,
+ &(infoRec->ScratchGC), &rgnDst, pptSrc);
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+ }
+ REGION_UNINIT(pScreen, &rgnDst);
+ }
+}
+
+
+static void
+XAAOverPaintWindow(
+ WindowPtr pWin,
+ RegionPtr pRegion,
+ int what
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ ScrnInfoPtr pScrn = infoRec->pScrn;
+
+ if(pScrn->vtSema) {
+ if(what == PW_BACKGROUND) {
+ SWITCH_DEPTH(pWin->drawable.depth);
+ (*infoRec->PaintWindowBackground)(pWin, pRegion, what);
+ return;
+ } else {
+ if(pWin->drawable.bitsPerPixel == 8) {
+ SWITCH_DEPTH(8);
+ (*infoRec->PaintWindowBorder)(pWin, pRegion, what);
+ return;
+ } else if (infoRec->FillSolidRects) {
+ SWITCH_DEPTH(8);
+ (*infoRec->FillSolidRects)(pScrn, pScrn->colorKey, GXcopy,
+ ~0, REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion));
+
+ SWITCH_DEPTH(pWin->drawable.depth);
+ (*infoRec->PaintWindowBorder)(pWin, pRegion, what);
+ return;
+ }
+ }
+
+ if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ }
+
+ if(what == PW_BACKGROUND) {
+ XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground);
+ (*pScreen->PaintWindowBackground) (pWin, pRegion, what);
+ XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAOverPaintWindow);
+ } else {
+ XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder);
+ (*pScreen->PaintWindowBorder) (pWin, pRegion, what);
+ XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAOverPaintWindow);
+ }
+}
+
+
+void
+XAAOverWindowExposures(
+ WindowPtr pWin,
+ RegionPtr pReg,
+ RegionPtr pOtherReg
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+
+ if((pWin->drawable.bitsPerPixel != 8) && infoRec->pScrn->vtSema) {
+ if(REGION_NUM_RECTS(pReg) && infoRec->FillSolidRects) {
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
+
+ SWITCH_DEPTH(8);
+ (*infoRec->FillSolidRects)(infoRec->pScrn,
+ infoRec->pScrn->colorKey, GXcopy, ~0,
+ REGION_NUM_RECTS(pReg), REGION_RECTS(pReg));
+ miWindowExposures(pWin, pReg, pOtherReg);
+ return;
+ } else if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+ }
+
+ XAA_SCREEN_PROLOGUE (pScreen, WindowExposures);
+ (*pScreen->WindowExposures) (pWin, pReg, pOtherReg);
+ XAA_SCREEN_EPILOGUE(pScreen, WindowExposures, XAAOverWindowExposures);
+}
+
+
+static void
+XAAOverSaveAreas (
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pWin->drawable.pScreen);
+ XAAInfoRecPtr infoRec =
+ GET_XAAINFORECPTR_FROM_DRAWABLE((DrawablePtr)pWin);
+
+ if(pOverPriv->pScrn->vtSema) {
+ SWITCH_DEPTH(pWin->drawable.depth);
+ }
+
+ (*infoRec->SaveAreas)(pPixmap, prgnSave, xorg, yorg, pWin);
+}
+
+
+static void
+XAAOverRestoreAreas (
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pWin->drawable.pScreen);
+ XAAInfoRecPtr infoRec =
+ GET_XAAINFORECPTR_FROM_DRAWABLE((DrawablePtr)pWin);
+
+ if(pOverPriv->pScrn->vtSema) {
+ SWITCH_DEPTH(pWin->drawable.depth);
+ }
+
+ (*infoRec->RestoreAreas)(pPixmap, prgnRestore, xorg, yorg, pWin);
+}
+
+/********************* Choosers *************************/
+
+static int
+XAAOverStippledFillChooser(GCPtr pGC)
+{
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+ int ret;
+
+ ret = (*pOverPriv->StippledFillChooser)(pGC);
+
+ if((pGC->depth == 8) &&
+ ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
+ ret = 0;
+ }
+
+ return ret;
+}
+
+static int
+XAAOverOpaqueStippledFillChooser(GCPtr pGC)
+{
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+ int ret;
+
+ ret = (*pOverPriv->OpaqueStippledFillChooser)(pGC);
+
+ if((pGC->depth == 8) &&
+ ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
+ ret = 0;
+ }
+
+ return ret;
+}
+
+static int
+XAAOverTiledFillChooser(GCPtr pGC)
+{
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+ int ret;
+
+ ret = (*pOverPriv->TiledFillChooser)(pGC);
+
+ if((pGC->depth == 8) &&
+ ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) {
+ ret = 0;
+ }
+
+ return ret;
+}
+
+
+/**************************** GC Functions **************************/
+
+static RegionPtr
+XAAOverCopyArea(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ return (*pOverPriv->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+}
+
+static RegionPtr
+XAAOverCopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ return (*pOverPriv->CopyPlane)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+
+}
+
+static void
+XAAOverPushPixelsSolid(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy,
+ int xOrg, int yOrg
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PushPixelsSolid)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+}
+
+
+
+static void
+XAAOverPolyFillRectSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolyFillRectSolid)(pDraw, pGC, nrectFill, prectInit);
+}
+
+static void
+XAAOverPolyFillRectStippled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolyFillRectStippled)(pDraw, pGC, nrectFill, prectInit);
+}
+
+
+static void
+XAAOverPolyFillRectOpaqueStippled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolyFillRectOpaqueStippled)(pDraw, pGC, nrectFill, prectInit);
+}
+
+static void
+XAAOverPolyFillRectTiled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolyFillRectTiled)(pDraw, pGC, nrectFill, prectInit);
+}
+
+
+static void
+XAAOverFillSpansSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nInit,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->FillSpansSolid)(
+ pDraw, pGC, nInit, ppt, pwidth, fSorted);
+}
+
+
+static void
+XAAOverFillSpansStippled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nInit,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->FillSpansStippled)(pDraw, pGC, nInit, ppt, pwidth, fSorted);
+}
+
+static void
+XAAOverFillSpansOpaqueStippled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nInit,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->FillSpansOpaqueStippled)(
+ pDraw, pGC, nInit, ppt, pwidth, fSorted);
+}
+
+
+static void
+XAAOverFillSpansTiled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nInit,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->FillSpansTiled)(pDraw, pGC, nInit, ppt, pwidth, fSorted);
+}
+
+static int
+XAAOverPolyText8TE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ return (*pOverPriv->PolyText8TE)(pDraw, pGC, x, y, count, chars);
+}
+
+
+static int
+XAAOverPolyText16TE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ return (*pOverPriv->PolyText16TE)(pDraw, pGC, x, y, count, chars);
+}
+
+
+static void
+XAAOverImageText8TE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->ImageText8TE)(pDraw, pGC, x, y, count, chars);
+}
+
+
+static void
+XAAOverImageText16TE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->ImageText16TE)(pDraw, pGC, x, y, count, chars);
+}
+
+static void
+XAAOverImageGlyphBltTE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->ImageGlyphBltTE)(
+ pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
+}
+
+static void
+XAAOverPolyGlyphBltTE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolyGlyphBltTE)(
+ pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
+}
+
+static int
+XAAOverPolyText8NonTE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ return (*pOverPriv->PolyText8NonTE)(pDraw, pGC, x, y, count, chars);
+}
+
+
+static int
+XAAOverPolyText16NonTE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ return (*pOverPriv->PolyText16NonTE)(pDraw, pGC, x, y, count, chars);
+}
+
+static void
+XAAOverImageText8NonTE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->ImageText8NonTE)(pDraw, pGC, x, y, count, chars);
+}
+
+static void
+XAAOverImageText16NonTE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->ImageText16NonTE)(pDraw, pGC, x, y, count, chars);
+}
+
+
+static void
+XAAOverImageGlyphBltNonTE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->ImageGlyphBltNonTE)(
+ pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
+}
+
+static void
+XAAOverPolyGlyphBltNonTE(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolyGlyphBltNonTE)(
+ pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
+}
+
+static void
+XAAOverPolyRectangleThinSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolyRectangleThinSolid)(pDraw, pGC, nRectsInit, pRectsInit);
+}
+
+
+
+static void
+XAAOverPolylinesWideSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolylinesWideSolid)(pDraw, pGC, mode, npt, pPts);
+}
+
+
+static void
+XAAOverPolylinesThinSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolylinesThinSolid)(pDraw, pGC, mode, npt, pPts);
+}
+
+static void
+XAAOverPolySegmentThinSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolySegmentThinSolid)(pDraw, pGC, nseg, pSeg);
+}
+
+static void
+XAAOverPolylinesThinDashed(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolylinesThinDashed)(pDraw, pGC, mode, npt, pPts);
+}
+
+static void
+XAAOverPolySegmentThinDashed(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolySegmentThinDashed)(pDraw, pGC, nseg, pSeg);
+}
+
+
+static void
+XAAOverFillPolygonSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->FillPolygonSolid)(pDraw, pGC, shape, mode, count, ptsIn);
+}
+
+static void
+XAAOverFillPolygonStippled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->FillPolygonStippled)(pDraw, pGC, shape, mode, count, ptsIn);
+}
+
+
+static void
+XAAOverFillPolygonOpaqueStippled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->FillPolygonOpaqueStippled)(
+ pDraw, pGC, shape, mode, count, ptsIn);
+}
+
+static void
+XAAOverFillPolygonTiled(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->FillPolygonTiled)(pDraw, pGC, shape, mode, count, ptsIn);
+}
+
+
+static void
+XAAOverPolyFillArcSolid(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PolyFillArcSolid)(pDraw, pGC, narcs, parcs);
+}
+
+
+static void
+XAAOverPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x,
+ int y,
+ int w,
+ int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen);
+
+ SWITCH_DEPTH(pGC->depth);
+
+ (*pOverPriv->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+}
+
diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c
new file mode 100644
index 000000000..e6163b33a
--- /dev/null
+++ b/hw/xfree86/xaa/xaaPCache.c
@@ -0,0 +1,2366 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPCache.c,v 1.30 2000/09/25 23:56:14 mvojkovi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "gc.h"
+#include "mi.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "regionstr.h"
+#include "servermd.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaacexp.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+
+#define MAX_COLOR 32
+#define MAX_MONO 32
+#define MAX_8 32
+#define MAX_128 32
+#define MAX_256 32
+#define MAX_512 16
+
+static int CacheInitIndex = -1;
+#define CACHEINIT(p) ((p)->privates[CacheInitIndex].val)
+
+
+typedef struct _CacheLink {
+ int x;
+ int y;
+ int w;
+ int h;
+ struct _CacheLink *next;
+} CacheLink, *CacheLinkPtr;
+
+
+static void
+TransferList(CacheLinkPtr list, XAACacheInfoPtr array, int num)
+{
+ while(num--) {
+ array->x = list->x;
+ array->y = list->y;
+ array->w = list->w;
+ array->h = list->h;
+ array->serialNumber = 0;
+ array->fg = array->bg = -1;
+ list = list->next;
+ array++;
+ }
+}
+
+
+
+static CacheLinkPtr
+Enlist(CacheLinkPtr link, int x, int y, int w, int h)
+{
+ CacheLinkPtr newLink;
+
+ newLink = xalloc(sizeof(CacheLink));
+ newLink->next = link;
+ newLink->x = x; newLink->y = y;
+ newLink->w = w; newLink->h = h;
+ return newLink;
+}
+
+
+
+static CacheLinkPtr
+Delist(CacheLinkPtr link) {
+ CacheLinkPtr ret = NULL;
+
+ if(link) {
+ ret = link->next;
+ xfree(link);
+ }
+ return ret;
+}
+
+
+
+static void
+FreeList(CacheLinkPtr link) {
+ CacheLinkPtr tmp;
+
+ while(link) {
+ tmp = link;
+ link = link->next;
+ xfree(tmp);
+ }
+}
+
+
+
+static CacheLinkPtr
+QuadLinks(CacheLinkPtr big, CacheLinkPtr little)
+{
+ /* CAUTION: This doesn't free big */
+ int w1, w2, h1, h2;
+
+ while(big) {
+ w1 = big->w >> 1;
+ w2 = big->w - w1;
+ h1 = big->h >> 1;
+ h2 = big->h - h1;
+
+ little = Enlist(little, big->x, big->y, w1, h1);
+ little = Enlist(little, big->x + w1, big->y, w2, h1);
+ little = Enlist(little, big->x, big->y + h1, w1, h2);
+ little = Enlist(little, big->x + w1, big->y + h1, w2, h2);
+
+ big = big->next;
+ }
+ return little;
+}
+
+
+static void
+SubdivideList(CacheLinkPtr *large, CacheLinkPtr *small)
+{
+ CacheLinkPtr big = *large;
+ CacheLinkPtr little = *small;
+ int size = big->w >> 1;
+
+ little = Enlist(little, big->x, big->y, size, size);
+ little = Enlist(little, big->x + size, big->y, size, size);
+ little = Enlist(little, big->x, big->y + size, size, size);
+ little = Enlist(little, big->x + size, big->y + size, size, size);
+ *small = little;
+ big = Delist(big);
+ *large = big;
+}
+
+static void
+FreePixmapCachePrivate(XAAPixmapCachePrivatePtr pPriv)
+{
+ if(!pPriv) return;
+
+ if(pPriv->Info512)
+ xfree(pPriv->Info512);
+ if(pPriv->Info256)
+ xfree(pPriv->Info256);
+ if(pPriv->Info128)
+ xfree(pPriv->Info128);
+ if(pPriv->InfoColor)
+ xfree(pPriv->InfoColor);
+ if(pPriv->InfoMono)
+ xfree(pPriv->InfoMono);
+ if(pPriv->InfoPartial)
+ xfree(pPriv->InfoPartial);
+
+ xfree(pPriv);
+}
+
+void
+XAAClosePixmapCache(ScreenPtr pScreen)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+
+ if(infoRec->PixmapCachePrivate)
+ FreePixmapCachePrivate(
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate);
+
+ infoRec->PixmapCachePrivate = NULL;
+}
+
+
+
+static CacheLinkPtr
+ThinOutPartials(
+ CacheLinkPtr ListPartial,
+ int *num, int *maxw, int *maxh
+) {
+/* This guy's job is to get at least 4 big slots out of a list of fragments */
+
+ CacheLinkPtr List64, List32, List16, List8, pCur, next, ListKeepers;
+ int Num64, Num32, Num16, Num8, NumKeepers;
+ int w, h;
+
+ List64 = List32 = List16 = List8 = ListKeepers = NULL;
+ Num64 = Num32 = Num16 = Num8 = NumKeepers = 0;
+ w = h = 0;
+
+ /* We sort partials by how large a square tile they can cache.
+ If a partial can't store a 64x64, 32x32, 16x16 or 8x8 tile,
+ we free it. */
+
+ pCur = ListPartial;
+ while(pCur) {
+ next = pCur->next;
+ if((pCur->w >= 64) && (pCur->h >= 64)) {
+ pCur->next = List64; List64 = pCur;
+ Num64++;
+ } else
+ if((pCur->w >= 32) && (pCur->h >= 32)) {
+ pCur->next = List32; List32 = pCur;
+ Num32++;
+ } else
+ if((pCur->w >= 16) && (pCur->h >= 16)) {
+ pCur->next = List16; List16 = pCur;
+ Num16++;
+ } else
+ if((pCur->w >= 8) && (pCur->h >= 8)) {
+ pCur->next = List8; List8 = pCur;
+ Num8++;
+ } else {
+ xfree(pCur);
+ }
+
+ pCur = next;
+ }
+
+ /* We save all the tiles from the largest bin that we can get
+ at least 4 of. If there are too few of a bigger slot, we
+ cut it in fourths to make smaller slots. */
+
+ if(Num64 >= 4) {
+ ListKeepers = List64; List64 = NULL;
+ NumKeepers = Num64;
+ goto GOT_EM;
+ } else if(Num64) {
+ List32 = QuadLinks(List64, List32);
+ Num32 += Num64 * 4;
+ Num64 = 0;
+ }
+
+ if(Num32 >= 4) {
+ ListKeepers = List32; List32 = NULL;
+ NumKeepers = Num32;
+ goto GOT_EM;
+ } else if(Num32) {
+ List16 = QuadLinks(List32, List16);
+ Num16 += Num32 * 4;
+ Num32 = 0;
+ }
+
+ if(Num16 >= 4) {
+ ListKeepers = List16; List16 = NULL;
+ NumKeepers = Num16;
+ goto GOT_EM;
+ } else if(Num16) {
+ List8 = QuadLinks(List16, List8);
+ Num8 += Num16 * 4;
+ Num16 = 0;
+ }
+
+ if(Num8 >= 4) {
+ ListKeepers = List8; List8 = NULL;
+ NumKeepers = Num8;
+ goto GOT_EM;
+ }
+
+GOT_EM:
+
+ /* Free the ones we aren't using */
+
+ if(List64) FreeList(List64);
+ if(List32) FreeList(List32);
+ if(List16) FreeList(List16);
+ if(List8) FreeList(List8);
+
+
+ /* Enlarge the slots if we can */
+
+ if(ListKeepers) {
+ CacheLinkPtr pLink = ListKeepers;
+ w = h = 128;
+
+ while(pLink) {
+ if(pLink->w < w) w = pLink->w;
+ if(pLink->h < h) h = pLink->h;
+ pLink = pLink->next;
+ }
+ }
+
+ *maxw = w;
+ *maxh = h;
+ *num = NumKeepers;
+ return ListKeepers;
+}
+
+static void
+ConvertColorToMono(
+ CacheLinkPtr *ColorList,
+ int ColorW, int ColorH,
+ CacheLinkPtr *MonoList,
+ int MonoW, int MonoH
+){
+ int x, y, w;
+
+ x = (*ColorList)->x; y = (*ColorList)->y;
+ *ColorList = Delist(*ColorList);
+
+ while(ColorH) {
+ ColorH -= MonoH;
+ for(w = 0; w <= (ColorW - MonoW); w += MonoW)
+ *MonoList = Enlist(*MonoList, x + w, y + ColorH, MonoW, MonoH);
+ }
+}
+
+static void
+ConvertAllPartialsTo8x8(
+ int *NumMono, int *NumColor,
+ CacheLinkPtr ListPartial,
+ CacheLinkPtr *ListMono,
+ CacheLinkPtr *ListColor,
+ XAAInfoRecPtr infoRec
+){
+/* This guy extracts as many 8x8 slots as it can out of fragments */
+
+ int ColorH = infoRec->CacheHeightColor8x8Pattern;
+ int ColorW = infoRec->CacheWidthColor8x8Pattern;
+ int MonoH = infoRec->CacheHeightMono8x8Pattern;
+ int MonoW = infoRec->CacheWidthMono8x8Pattern;
+ int x, y, w, Height, Width;
+ Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
+ Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
+ CacheLinkPtr pLink = ListPartial;
+ CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor;
+ int MonosPerColor = 1;
+
+ if(DoColor && DoMono) {
+ /* we assume color patterns take more space than color ones */
+ if(MonoH > ColorH) ColorH = MonoH;
+ if(MonoW > ColorW) ColorW = MonoW;
+ MonosPerColor = (ColorH/MonoH) * (ColorW/MonoW);
+ }
+
+ /* Break up the area into as many Color and Mono slots as we can */
+
+ while(pLink) {
+ Height = pLink->h;
+ Width = pLink->w;
+ x = pLink->x;
+ y = pLink->y;
+
+ if(DoColor) {
+ while(Height >= ColorH) {
+ Height -= ColorH;
+ for(w = 0; w <= (Width - ColorW); w += ColorW) {
+ ColorList = Enlist(
+ ColorList, x + w, y + Height, ColorW, ColorH);
+ (*NumColor)++;
+ }
+ }
+ }
+
+ if(DoMono && (Height >= MonoH)) {
+ while(Height >= MonoH) {
+ Height -= MonoH;
+ for(w = 0; w <= (Width - MonoW); w += MonoW) {
+ MonoList = Enlist(
+ MonoList, x + w, y + Height, MonoW, MonoH);
+ (*NumMono)++;
+ }
+ }
+ }
+
+ pLink = pLink->next;
+ }
+
+
+ *ListMono = MonoList;
+ *ListColor = ColorList;
+ FreeList(ListPartial);
+}
+
+
+static CacheLinkPtr
+ExtractOneThatFits(CacheLinkPtr *initList, int w, int h)
+{
+ CacheLinkPtr list = *initList;
+ CacheLinkPtr prev = NULL;
+
+ while(list) {
+ if((list->w >= w) && (list->h >= h))
+ break;
+ prev = list;
+ list = list->next;
+ }
+
+ if(list) {
+ if(prev)
+ prev->next = list->next;
+ else
+ *initList = list->next;
+
+ list->next = NULL;
+ }
+
+ return list;
+}
+
+
+static CacheLinkPtr
+ConvertSomePartialsTo8x8(
+ int *NumMono, int *NumColor, int *NumPartial,
+ CacheLinkPtr ListPartial,
+ CacheLinkPtr *ListMono,
+ CacheLinkPtr *ListColor,
+ int *maxw, int *maxh,
+ XAAInfoRecPtr infoRec
+){
+/* This guy tries to get 4 of each type of 8x8 slot requested out of
+ a list of fragments all while trying to retain some big fragments
+ for the cache blits */
+
+ int ColorH = infoRec->CacheHeightColor8x8Pattern;
+ int ColorW = infoRec->CacheWidthColor8x8Pattern;
+ int MonoH = infoRec->CacheHeightMono8x8Pattern;
+ int MonoW = infoRec->CacheWidthMono8x8Pattern;
+ Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
+ Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
+ CacheLinkPtr List64, List32, List16, List8, pCur, next, ListKeepers;
+ CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor;
+ int Num64, Num32, Num16, Num8, NumKeepers;
+ int w, h, Width, Height;
+ int MonosPerColor = 1;
+
+ if(DoColor && DoMono) {
+ /* we assume color patterns take more space than color ones */
+ if(MonoH > ColorH) ColorH = MonoH;
+ if(MonoW > ColorW) ColorW = MonoW;
+ MonosPerColor = (ColorH/MonoH) * (ColorW/MonoW);
+ }
+
+ List64 = List32 = List16 = List8 = ListKeepers = MonoList = ColorList = NULL;
+ Num64 = Num32 = Num16 = Num8 = NumKeepers = 0;
+ Width = Height = 0;
+
+ /* We sort partials by how large a square tile they can cache.
+ We make 8x8 patterns from the leftovers if we can. */
+
+ pCur = ListPartial;
+ while(pCur) {
+ next = pCur->next;
+ if((pCur->w >= 64) && (pCur->h >= 64)) {
+ pCur->next = List64; List64 = pCur;
+ Num64++;
+ } else
+ if((pCur->w >= 32) && (pCur->h >= 32)) {
+ pCur->next = List32; List32 = pCur;
+ Num32++;
+ } else
+ if((pCur->w >= 16) && (pCur->h >= 16)) {
+ pCur->next = List16; List16 = pCur;
+ Num16++;
+ } else
+ if((pCur->w >= 8) && (pCur->h >= 8)) {
+ pCur->next = List8; List8 = pCur;
+ Num8++;
+ } else {
+ h = pCur->h;
+ if(DoColor && (pCur->w >= ColorW) && (h >= ColorH)) {
+ while(h >= ColorH) {
+ h -= ColorH;
+ for(w = 0; w <= (pCur->w - ColorW); w += ColorW) {
+ ColorList = Enlist( ColorList,
+ pCur->x + w, pCur->y + h, ColorW, ColorH);
+ (*NumColor)++;
+ }
+ }
+ }
+ if(DoMono && (pCur->w >= MonoW) && (h >= MonoH)) {
+ while(h >= MonoH) {
+ h -= MonoH;
+ for(w = 0; w <= (pCur->w - MonoW); w += MonoW) {
+ MonoList = Enlist( MonoList,
+ pCur->x + w, pCur->y + h, MonoW, MonoH);
+ (*NumMono)++;
+ }
+ }
+ }
+ xfree(pCur);
+ }
+
+ pCur = next;
+ }
+
+ /* Try to extract at least 4 of each type of 8x8 slot that we need */
+
+ if(DoColor) {
+ CacheLinkPtr theOne;
+ while(*NumColor < 4) {
+ theOne = NULL;
+ if(Num8) {
+ if((theOne = ExtractOneThatFits(&List8, ColorW, ColorH)))
+ Num8--;
+ }
+ if(Num16 && !theOne) {
+ if((theOne = ExtractOneThatFits(&List16, ColorW, ColorH)))
+ Num16--;
+ }
+ if(Num32 && !theOne) {
+ if((theOne = ExtractOneThatFits(&List32, ColorW, ColorH)))
+ Num32--;
+ }
+ if(Num64 && !theOne) {
+ if((theOne = ExtractOneThatFits(&List64, ColorW, ColorH)))
+ Num64--;
+ }
+
+ if(!theOne) break;
+
+
+ ConvertAllPartialsTo8x8(NumMono, NumColor, theOne,
+ &MonoList, &ColorList, infoRec);
+
+ if(DoMono) {
+ while(*NumColor && (*NumMono < 4)) {
+ ConvertColorToMono(&ColorList, ColorW, ColorH,
+ &MonoList, MonoW, MonoH);
+ (*NumColor)--; *NumMono += MonosPerColor;
+ }
+ }
+ }
+ }
+
+ if(DoMono) {
+ CacheLinkPtr theOne;
+ while(*NumMono < 4) {
+ theOne = NULL;
+ if(Num8) {
+ if((theOne = ExtractOneThatFits(&List8, MonoW, MonoH)))
+ Num8--;
+ }
+ if(Num16 && !theOne) {
+ if((theOne = ExtractOneThatFits(&List16, MonoW, MonoH)))
+ Num16--;
+ }
+ if(Num32 && !theOne) {
+ if((theOne = ExtractOneThatFits(&List32, MonoW, MonoH)))
+ Num32--;
+ }
+ if(Num64 && !theOne) {
+ if((theOne = ExtractOneThatFits(&List64, MonoW, MonoH)))
+ Num64--;
+ }
+
+ if(!theOne) break;
+
+ ConvertAllPartialsTo8x8(NumMono, NumColor, theOne,
+ &MonoList, &ColorList, infoRec);
+ }
+ }
+
+ /* We save all the tiles from the largest bin that we can get
+ at least 4 of. If there are too few of a bigger slot, we
+ cut it in fourths to make smaller slots. */
+
+ if(Num64 >= 4) {
+ ListKeepers = List64; List64 = NULL;
+ NumKeepers = Num64;
+ goto GOT_EM;
+ } else if(Num64) {
+ List32 = QuadLinks(List64, List32);
+ Num32 += Num64 * 4;
+ Num64 = 0;
+ }
+
+ if(Num32 >= 4) {
+ ListKeepers = List32; List32 = NULL;
+ NumKeepers = Num32;
+ goto GOT_EM;
+ } else if(Num32) {
+ List16 = QuadLinks(List32, List16);
+ Num16 += Num32 * 4;
+ Num32 = 0;
+ }
+
+ if(Num16 >= 4) {
+ ListKeepers = List16; List16 = NULL;
+ NumKeepers = Num16;
+ goto GOT_EM;
+ } else if(Num16) {
+ List8 = QuadLinks(List16, List8);
+ Num8 += Num16 * 4;
+ Num16 = 0;
+ }
+
+ if(Num8 >= 4) {
+ ListKeepers = List8; List8 = NULL;
+ NumKeepers = Num8;
+ goto GOT_EM;
+ }
+
+GOT_EM:
+
+ /* Free the ones we aren't using */
+
+ if(List64)
+ ConvertAllPartialsTo8x8(NumMono, NumColor, List64,
+ &MonoList, &ColorList, infoRec);
+ if(List32)
+ ConvertAllPartialsTo8x8(NumMono, NumColor, List32,
+ &MonoList, &ColorList, infoRec);
+ if(List16)
+ ConvertAllPartialsTo8x8(NumMono, NumColor, List16,
+ &MonoList, &ColorList, infoRec);
+ if(List8)
+ ConvertAllPartialsTo8x8(NumMono, NumColor, List8,
+ &MonoList, &ColorList, infoRec);
+
+
+ /* Enlarge the slots if we can */
+
+ if(ListKeepers) {
+ CacheLinkPtr pLink = ListKeepers;
+ Width = Height = 128;
+
+ while(pLink) {
+ if(pLink->w < Width) Width = pLink->w;
+ if(pLink->h < Height) Height = pLink->h;
+ pLink = pLink->next;
+ }
+ }
+
+ *ListMono = MonoList;
+ *ListColor = ColorList;
+ *maxw = Width;
+ *maxh = Height;
+ *NumPartial = NumKeepers;
+ return ListKeepers;
+}
+
+
+void
+XAAInitPixmapCache(
+ ScreenPtr pScreen,
+ RegionPtr areas,
+ pointer data
+) {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XAAInfoRecPtr infoRec = (XAAInfoRecPtr)data;
+ XAAPixmapCachePrivatePtr pCachePriv;
+ BoxPtr pBox = REGION_RECTS(areas);
+ int nBox = REGION_NUM_RECTS(areas);
+ int Num512, Num256, Num128, NumPartial, NumColor, NumMono;
+ int Target512, Target256;
+ CacheLinkPtr List512, List256, List128, ListPartial, ListColor, ListMono;
+ int x, y, w, h, ntotal, granularity, width, height, i;
+ int MaxPartialWidth, MaxPartialHeight;
+
+ infoRec->MaxCacheableTileWidth = 0;
+ infoRec->MaxCacheableTileHeight = 0;
+ infoRec->MaxCacheableStippleHeight = 0;
+ infoRec->MaxCacheableStippleWidth = 0;
+ infoRec->UsingPixmapCache = FALSE;
+
+
+ if(!nBox || !pBox || !(infoRec->Flags & PIXMAP_CACHE))
+ return;
+
+ /* Allocate a persistent per-screen init flag to control messages */
+ if (CacheInitIndex < 0)
+ CacheInitIndex = xf86AllocateScrnInfoPrivateIndex();
+
+ /* free the old private data if it exists */
+ if(infoRec->PixmapCachePrivate) {
+ FreePixmapCachePrivate(
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate);
+ infoRec->PixmapCachePrivate = NULL;
+ }
+
+ Num512 = Num256 = Num128 = NumPartial = NumMono = NumColor = 0;
+ List512 = List256 = List128 = ListPartial = ListMono = ListColor = NULL;
+ granularity = infoRec->CachePixelGranularity;
+ if(granularity <= 1) granularity = 0;
+
+ /* go through the boxes and break it into as many pieces as we can fit */
+
+ while(nBox--) {
+ x = pBox->x1;
+ if(granularity) {
+ int tmp = x % granularity;
+ if(tmp) x += (granularity - tmp);
+ }
+ width = pBox->x2 - x;
+ if(width <= 0) {pBox++; continue;}
+
+ y = pBox->y1;
+ height = pBox->y2 - y;
+
+ for(h = 0; h <= (height - 512); h += 512) {
+ for(w = 0; w <= (width - 512); w += 512) {
+ List512 = Enlist(List512, x + w, y + h, 512, 512);
+ Num512++;
+ }
+ for(; w <= (width - 256); w += 256) {
+ List256 = Enlist(List256, x + w, y + h, 256, 256);
+ List256 = Enlist(List256, x + w, y + h + 256, 256, 256);
+ Num256 += 2;
+ }
+ for(; w <= (width - 128); w += 128) {
+ List128 = Enlist(List128, x + w, y + h, 128, 128);
+ List128 = Enlist(List128, x + w, y + h + 128, 128, 128);
+ List128 = Enlist(List128, x + w, y + h + 256, 128, 128);
+ List128 = Enlist(List128, x + w, y + h + 384, 128, 128);
+ Num128 += 4;
+ }
+ if(w < width) {
+ int d = width - w;
+ ListPartial = Enlist(ListPartial, x + w, y + h, d, 128);
+ ListPartial = Enlist(ListPartial, x + w, y + h + 128, d, 128);
+ ListPartial = Enlist(ListPartial, x + w, y + h + 256, d, 128);
+ ListPartial = Enlist(ListPartial, x + w, y + h + 384, d, 128);
+ NumPartial += 4;
+ }
+ }
+ for(; h <= (height - 256); h += 256) {
+ for(w = 0; w <= (width - 256); w += 256) {
+ List256 = Enlist(List256, x + w, y + h, 256, 256);
+ Num256++;
+ }
+ for(; w <= (width - 128); w += 128) {
+ List128 = Enlist(List128, x + w, y + h, 128, 128);
+ List128 = Enlist(List128, x + w, y + h + 128, 128, 128);
+ Num128 += 2;
+ }
+ if(w < width) {
+ int d = width - w;
+ ListPartial = Enlist(ListPartial, x + w, y + h, d, 128);
+ ListPartial = Enlist(ListPartial, x + w, y + h + 128, d, 128);
+ NumPartial += 2;
+ }
+ }
+ for(; h <= (height - 128); h += 128) {
+ for(w = 0; w <= (width - 128); w += 128) {
+ List128 = Enlist(List128, x + w, y + h, 128, 128);
+ Num128++;
+ }
+ if(w < width) {
+ ListPartial = Enlist(
+ ListPartial, x + w, y + h, width - w, 128);
+ NumPartial++;
+ }
+ }
+ if(h < height) {
+ int d = height - h;
+ for(w = 0; w <= (width - 128); w += 128) {
+ ListPartial = Enlist(ListPartial, x + w, y + h, 128, d);
+ NumPartial++;
+ }
+ if(w < width) {
+ ListPartial = Enlist(ListPartial, x + w, y + h, width - w, d);
+ NumPartial++;
+ }
+ }
+ pBox++;
+ }
+
+
+/*
+ by this point we've carved the space into as many 512x512, 256x256
+ and 128x128 blocks as we could fit. We will then break larger
+ blocks into smaller ones if we need to. The rules are as follows:
+
+ 512x512 -
+ 1) Don't take up more than half the memory.
+ 2) Don't bother if you can't get at least four.
+ 3) Don't make more than MAX_512.
+
+ 256x256 -
+ 1) Don't take up more than a quarter of the memory enless there
+ aren't any 512x512s. Then we can take up to half.
+ 2) Don't bother if you can't get at least four.
+ 3) Don't make more than MAX_256.
+
+ 128x128 -
+ 1) Don't make more than MAX_128.
+
+ We don't bother with the partial blocks unless we can use them
+ for 8x8 pattern fills or we are short on larger blocks.
+
+*/
+
+ ntotal = Num128 + (Num256<<2) + (Num512<<4);
+
+ Target512 = ntotal >> 5;
+ if(Target512 < 4) Target512 = 0;
+ if(!Target512) Target256 = ntotal >> 3;
+ else Target256 = ntotal >> 4;
+ if(Target256 < 4) Target256 = 0;
+
+ if(!Num512) { /* no room */
+ } else if((Num512 < 4) || (!Target512)) {
+ while(Num512) {
+ SubdivideList(&List512, &List256);
+ Num256 += 4; Num512--;
+ }
+ } else if((Num512 > MAX_512) || (Num512 > Target512)){
+ while(Num512 > MAX_512) {
+ SubdivideList(&List512, &List256);
+ Num256 += 4; Num512--;
+ }
+ while(Num512 > Target512) {
+ if(Num256 < MAX_256) {
+ SubdivideList(&List512, &List256);
+ Num256 += 4; Num512--;
+ } else break;
+ }
+ }
+
+ if(!Num256) { /* no room */
+ } else if((Num256 < 4) || (!Target256)) {
+ while(Num256) {
+ SubdivideList(&List256, &List128);
+ Num128 += 4; Num256--;
+ }
+ } else if((Num256 > MAX_256) || (Num256 > Target256)) {
+ while(Num256 > MAX_256) {
+ SubdivideList(&List256, &List128);
+ Num128 += 4; Num256--;
+ }
+ while(Num256 > Target256) {
+ if(Num128 < MAX_128) {
+ SubdivideList(&List256, &List128);
+ Num128 += 4; Num256--;
+ } else break;
+ }
+ }
+
+ if(Num128 && ((Num128 < 4) || (Num128 > MAX_128))) {
+ CacheLinkPtr next;
+ int max = (Num128 > MAX_128) ? MAX_128 : 0;
+
+ /*
+ * Note: next is set in this way to work around a code generation
+ * bug in gcc 2.7.2.3.
+ */
+ next = List128->next;
+ while(Num128 > max) {
+ List128->next = ListPartial;
+ ListPartial = List128;
+ if((List128 = next))
+ next = List128->next;
+ NumPartial++; Num128--;
+ }
+ }
+
+ MaxPartialHeight = MaxPartialWidth = 0;
+
+ /* at this point we have as many 512x512 and 256x256 slots as we
+ want but may have an excess of 128x128 slots. We still need
+ to find out if we need 8x8 slots. We take these from the
+ partials if we have them. Otherwise, we break some 128x128's */
+
+ if(!(infoRec->PixmapCacheFlags & (CACHE_MONO_8x8 | CACHE_COLOR_8x8))) {
+ if(NumPartial) {
+ if(Num128) { /* don't bother with partials */
+ FreeList(ListPartial);
+ NumPartial = 0; ListPartial = NULL;
+ } else {
+ /* We have no big slots. Weed out the unusable partials */
+ ListPartial = ThinOutPartials(ListPartial, &NumPartial,
+ &MaxPartialWidth, &MaxPartialHeight);
+ }
+ }
+ } else {
+ int MonosPerColor = 1;
+ int ColorH = infoRec->CacheHeightColor8x8Pattern;
+ int ColorW = infoRec->CacheWidthColor8x8Pattern;
+ int MonoH = infoRec->CacheHeightMono8x8Pattern;
+ int MonoW = infoRec->CacheWidthMono8x8Pattern;
+ Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8);
+ Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8);
+
+ if(DoColor) infoRec->CanDoColor8x8 = FALSE;
+ if(DoMono) infoRec->CanDoMono8x8 = FALSE;
+
+ if(DoColor && DoMono) {
+ /* we assume color patterns take more space than color ones */
+ if(MonoH > ColorH) ColorH = MonoH;
+ if(MonoW > ColorW) ColorW = MonoW;
+ MonosPerColor = (ColorH/MonoH) * (ColorW/MonoW);
+ }
+
+ if(Num128) {
+ if(NumPartial) { /* use all for 8x8 slots */
+ ConvertAllPartialsTo8x8(&NumMono, &NumColor,
+ ListPartial, &ListMono, &ListColor, infoRec);
+ NumPartial = 0; ListPartial = NULL;
+ }
+
+ /* Get some 8x8 slots from the 128 slots */
+ while((Num128 > 4) &&
+ ((NumMono < MAX_MONO) && (NumColor < MAX_COLOR))) {
+ CacheLinkPtr tmp = NULL;
+
+ tmp = Enlist(tmp, List128->x, List128->y,
+ List128->w, List128->h);
+ List128 = Delist(List128);
+ Num128--;
+
+ ConvertAllPartialsTo8x8(&NumMono, &NumColor,
+ tmp, &ListMono, &ListColor, infoRec);
+ }
+ } else if(NumPartial) {
+ /* We have share partials between 8x8 slots and tiles. */
+ ListPartial = ConvertSomePartialsTo8x8(&NumMono, &NumColor,
+ &NumPartial, ListPartial, &ListMono, &ListColor,
+ &MaxPartialWidth, &MaxPartialHeight, infoRec);
+ }
+
+
+ if(DoMono && DoColor) {
+ if(NumColor && ((NumColor > MAX_COLOR) || (NumColor < 4))) {
+ int max = (NumColor > MAX_COLOR) ? MAX_COLOR : 0;
+
+ while(NumColor > max) {
+ ConvertColorToMono(&ListColor, ColorW, ColorH,
+ &ListMono, MonoW, MonoH);
+ NumColor--; NumMono += MonosPerColor;
+ }
+ }
+
+ /* favor Mono slots over Color ones */
+ while((NumColor > 4) && (NumMono < MAX_MONO)) {
+ ConvertColorToMono(&ListColor, ColorW, ColorH,
+ &ListMono, MonoW, MonoH);
+ NumColor--; NumMono += MonosPerColor;
+ }
+ }
+
+ if(NumMono && ((NumMono > MAX_MONO) || (NumMono < 4))) {
+ int max = (NumMono > MAX_MONO) ? MAX_MONO : 0;
+
+ while(NumMono > max) {
+ ListMono = Delist(ListMono);
+ NumMono--;
+ }
+ }
+ if(NumColor && ((NumColor > MAX_COLOR) || (NumColor < 4))) {
+ int max = (NumColor > MAX_COLOR) ? MAX_COLOR : 0;
+
+ while(NumColor > max) {
+ ListColor = Delist(ListColor);
+ NumColor--;
+ }
+ }
+ }
+
+
+ pCachePriv = xcalloc(1,sizeof(XAAPixmapCachePrivate));
+ if(!pCachePriv) {
+ if(Num512) FreeList(List512);
+ if(Num256) FreeList(List256);
+ if(Num128) FreeList(List128);
+ if(NumPartial) FreeList(ListPartial);
+ if(NumColor) FreeList(ListColor);
+ if(NumMono) FreeList(ListMono);
+ return;
+ }
+
+ infoRec->PixmapCachePrivate = (char*)pCachePriv;
+
+ if(Num512) {
+ pCachePriv->Info512 = xcalloc(Num512,sizeof(XAACacheInfoRec));
+ if(!pCachePriv->Info512) Num512 = 0;
+ if(Num512) TransferList(List512, pCachePriv->Info512, Num512);
+ FreeList(List512);
+ pCachePriv->Num512x512 = Num512;
+ }
+ if(Num256) {
+ pCachePriv->Info256 = xcalloc(Num256, sizeof(XAACacheInfoRec));
+ if(!pCachePriv->Info256) Num256 = 0;
+ if(Num256) TransferList(List256, pCachePriv->Info256, Num256);
+ FreeList(List256);
+ pCachePriv->Num256x256 = Num256;
+ }
+ if(Num128) {
+ pCachePriv->Info128 = xcalloc(Num128, sizeof(XAACacheInfoRec));
+ if(!pCachePriv->Info128) Num128 = 0;
+ if(Num128) TransferList(List128, pCachePriv->Info128, Num128);
+ FreeList(List128);
+ pCachePriv->Num128x128 = Num128;
+ }
+
+ if(NumPartial) {
+ pCachePriv->InfoPartial = xcalloc(NumPartial, sizeof(XAACacheInfoRec));
+ if(!pCachePriv->InfoPartial) NumPartial = 0;
+ if(NumPartial)
+ TransferList(ListPartial, pCachePriv->InfoPartial, NumPartial);
+ FreeList(ListPartial);
+ pCachePriv->NumPartial = NumPartial;
+ }
+
+ if(NumColor) {
+ pCachePriv->InfoColor = xcalloc(NumColor, sizeof(XAACacheInfoRec));
+ if(!pCachePriv->InfoColor) NumColor = 0;
+ if(NumColor) TransferList(ListColor, pCachePriv->InfoColor, NumColor);
+ FreeList(ListColor);
+ pCachePriv->NumColor = NumColor;
+ }
+
+ if(NumMono) {
+ pCachePriv->InfoMono = xcalloc(NumMono, sizeof(XAACacheInfoRec));
+ if(!pCachePriv->InfoMono) NumMono = 0;
+ if(NumMono) TransferList(ListMono, pCachePriv->InfoMono, NumMono);
+ FreeList(ListMono);
+ pCachePriv->NumMono = NumMono;
+ }
+
+
+ if(NumPartial) {
+ infoRec->MaxCacheableTileWidth = MaxPartialWidth;
+ infoRec->MaxCacheableTileHeight = MaxPartialHeight;
+ }
+ if(Num128)
+ infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 128;
+ if(Num256)
+ infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 256;
+ if(Num512)
+ infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 512;
+
+
+ infoRec->MaxCacheableStippleHeight = infoRec->MaxCacheableTileHeight;
+ infoRec->MaxCacheableStippleWidth =
+ infoRec->MaxCacheableTileWidth * pScrn->bitsPerPixel;
+ if(infoRec->ScreenToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP)
+ infoRec->MaxCacheableStippleWidth /= 3;
+
+ if(NumMono) {
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ (HARDWARE_PATTERN_PROGRAMMED_ORIGIN |
+ HARDWARE_PATTERN_PROGRAMMED_BITS))) {
+ int numPerLine =
+ infoRec->CacheWidthMono8x8Pattern/infoRec->MonoPatternPitch;
+
+ for(i = 0; i < 64; i++) {
+ pCachePriv->MonoOffsets[i].y = i/numPerLine;
+ pCachePriv->MonoOffsets[i].x = (i % numPerLine) *
+ infoRec->MonoPatternPitch;
+ }
+ }
+ infoRec->CanDoMono8x8 = TRUE;
+ }
+ if(NumColor) {
+ if(!(infoRec->Color8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) {
+
+ for(i = 0; i < 64; i++) {
+ pCachePriv->ColorOffsets[i].y = i & 0x07;
+ pCachePriv->ColorOffsets[i].x = i & ~0x07;
+ }
+ }
+ infoRec->CanDoColor8x8 = TRUE;
+ }
+
+ if(!CACHEINIT(pScrn)) {
+ xf86ErrorF("\tSetting up tile and stipple cache:\n");
+ if(NumPartial)
+ xf86ErrorF("\t\t%i %ix%i slots\n",
+ NumPartial, MaxPartialWidth, MaxPartialHeight);
+ if(Num128) xf86ErrorF("\t\t%i 128x128 slots\n", Num128);
+ if(Num256) xf86ErrorF("\t\t%i 256x256 slots\n", Num256);
+ if(Num512) xf86ErrorF("\t\t%i 512x512 slots\n", Num512);
+ if(NumColor) xf86ErrorF("\t\t%i 8x8 color pattern slots\n", NumColor);
+ if(NumMono) xf86ErrorF("\t\t%i 8x8 color expansion slots\n", NumMono);
+ }
+
+ if(!(NumPartial | Num128 | Num256 | Num512 | NumColor | NumMono)) {
+ if(!CACHEINIT(pScrn))
+ xf86ErrorF("\t\tNot enough video memory for pixmap cache\n");
+ } else infoRec->UsingPixmapCache = TRUE;
+
+ CACHEINIT(pScrn) = 1;
+}
+
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+static CARD32 StippleMasks[4] = {
+ 0x80808080,
+ 0xC0C0C0C0,
+ 0x00000000,
+ 0xF0F0F0F0
+};
+#else
+static CARD32 StippleMasks[4] = {
+ 0x01010101,
+ 0x03030303,
+ 0x00000000,
+ 0x0F0F0F0F
+};
+#endif
+
+Bool
+XAACheckStippleReducibility(PixmapPtr pPixmap)
+{
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE(&pPixmap->drawable);
+ CARD32 *IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
+ int w = pPixmap->drawable.width;
+ int h = pPixmap->drawable.height;
+ int i;
+ CARD32 bits[8];
+ CARD32 mask = SHIFT_R(0xFFFFFFFF,24);
+
+ pPriv->flags |= REDUCIBILITY_CHECKED | REDUCIBLE_TO_2_COLOR;
+ pPriv->flags &= ~REDUCIBLE_TO_8x8;
+
+ if((w > 32) || (h > 32) || (w & (w - 1)) || (h & (h - 1)))
+ return FALSE;
+
+ i = (h > 8) ? 8 : h;
+
+ switch(w) {
+ case 32:
+ while(i--) {
+ bits[i] = IntPtr[i] & mask;
+ if( (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask, 8)), 8)) ||
+ (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask,16)),16)) ||
+ (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask,24)),24)))
+ return FALSE;
+ }
+ break;
+ case 16:
+ while(i--) {
+ bits[i] = IntPtr[i] & mask;
+ if(bits[i] != ((IntPtr[i] & SHIFT_R(SHIFT_L(mask,8),8))))
+ return FALSE;
+ }
+ break;
+ default:
+ while(i--)
+ bits[i] = IntPtr[i] & mask;
+ break;
+ }
+
+ switch(h) {
+ case 32:
+ if( (IntPtr[8] != IntPtr[16]) || (IntPtr[9] != IntPtr[17]) ||
+ (IntPtr[10] != IntPtr[18]) || (IntPtr[11] != IntPtr[19]) ||
+ (IntPtr[12] != IntPtr[20]) || (IntPtr[13] != IntPtr[21]) ||
+ (IntPtr[14] != IntPtr[22]) || (IntPtr[15] != IntPtr[23]) ||
+ (IntPtr[16] != IntPtr[24]) || (IntPtr[17] != IntPtr[25]) ||
+ (IntPtr[18] != IntPtr[26]) || (IntPtr[19] != IntPtr[27]) ||
+ (IntPtr[20] != IntPtr[28]) || (IntPtr[21] != IntPtr[29]) ||
+ (IntPtr[22] != IntPtr[30]) || (IntPtr[23] != IntPtr[31]))
+ return FALSE;
+ /* fall through */
+ case 16:
+ if( (IntPtr[0] != IntPtr[8]) || (IntPtr[1] != IntPtr[9]) ||
+ (IntPtr[2] != IntPtr[10]) || (IntPtr[3] != IntPtr[11]) ||
+ (IntPtr[4] != IntPtr[12]) || (IntPtr[5] != IntPtr[13]) ||
+ (IntPtr[6] != IntPtr[14]) || (IntPtr[7] != IntPtr[15]))
+ return FALSE;
+ case 8: break;
+ case 1: bits[1] = bits[0];
+ case 2: bits[2] = bits[0]; bits[3] = bits[1];
+ case 4: bits[4] = bits[0]; bits[5] = bits[1];
+ bits[6] = bits[2]; bits[7] = bits[3];
+ break;
+ }
+
+ pPriv->flags |= REDUCIBLE_TO_8x8;
+
+ pPriv->pattern0 = bits[0] | SHIFT_L(bits[1],8) | SHIFT_L(bits[2],16) | SHIFT_L(bits[3],24);
+ pPriv->pattern1 = bits[4] | SHIFT_L(bits[5],8) | SHIFT_L(bits[6],16) | SHIFT_L(bits[7],24);
+
+ if(w < 8) {
+ pPriv->pattern0 &= StippleMasks[w - 1];
+ pPriv->pattern1 &= StippleMasks[w - 1];
+
+ switch(w) {
+ case 1: pPriv->pattern0 |= SHIFT_L(pPriv->pattern0,1);
+ pPriv->pattern1 |= SHIFT_L(pPriv->pattern1,1);
+ case 2: pPriv->pattern0 |= SHIFT_L(pPriv->pattern0,2);
+ pPriv->pattern1 |= SHIFT_L(pPriv->pattern1,2);
+ case 4: pPriv->pattern0 |= SHIFT_L(pPriv->pattern0,4);
+ pPriv->pattern1 |= SHIFT_L(pPriv->pattern1,4);
+ }
+ }
+
+ if(infoRec->Mono8x8PatternFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
+ pPriv->pattern0 = SWAP_BITS_IN_BYTES(pPriv->pattern0);
+ pPriv->pattern1 = SWAP_BITS_IN_BYTES(pPriv->pattern1);
+ }
+
+
+ return TRUE;
+}
+
+
+Bool
+XAACheckTileReducibility(PixmapPtr pPixmap, Bool checkMono)
+{
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
+ CARD32 *IntPtr;
+ int w = pPixmap->drawable.width;
+ int h = pPixmap->drawable.height;
+ int pitch = pPixmap->devKind >> 2;
+ int dwords, i, j;
+
+ pPriv->flags |= REDUCIBILITY_CHECKED;
+ pPriv->flags &= ~(REDUCIBILITY_CHECKED | REDUCIBLE_TO_2_COLOR);
+
+ if((w > 32) || (h > 32) || (w & (w - 1)) || (h & (h - 1)))
+ return FALSE;
+
+ dwords = ((w * pPixmap->drawable.bitsPerPixel) + 31) >> 5;
+ i = (h > 8) ? 8 : h;
+
+
+ if(w > 8) {
+ IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
+ switch(pPixmap->drawable.bitsPerPixel) {
+ case 8:
+ while(i--) {
+ for(j = 2; j < dwords; j++)
+ if(IntPtr[j] != IntPtr[j & 0x01])
+ return FALSE;
+ IntPtr += pitch;
+ }
+ break;
+ case 16:
+ while(i--) {
+ for(j = 4; j < dwords; j++)
+ if(IntPtr[j] != IntPtr[j & 0x03])
+ return FALSE;
+ IntPtr += pitch;
+ }
+ break;
+ case 24:
+ while(i--) {
+ for(j = 6; j < dwords; j++)
+ if(IntPtr[j] != IntPtr[j % 6])
+ return FALSE;
+ IntPtr += pitch;
+ }
+ break;
+ case 32:
+ while(i--) {
+ for(j = 8; j < dwords; j++)
+ if(IntPtr[j] != IntPtr[j & 0x07])
+ return FALSE;
+ IntPtr += pitch;
+ }
+ break;
+ default: return FALSE;
+ }
+
+ }
+
+
+ if(h == 32) {
+ CARD32 *IntPtr2, *IntPtr3, *IntPtr4;
+ i = 8;
+ IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
+ IntPtr2 = IntPtr + (pitch << 3);
+ IntPtr3 = IntPtr2 + (pitch << 3);
+ IntPtr4 = IntPtr3 + (pitch << 3);
+ while(i--) {
+ for(j = 0; j < dwords; j++)
+ if((IntPtr[j] != IntPtr2[j]) || (IntPtr[j] != IntPtr3[j]) ||
+ (IntPtr[j] != IntPtr4[j]))
+ return FALSE;
+ IntPtr += pitch;
+ IntPtr2 += pitch;
+ IntPtr3 += pitch;
+ IntPtr4 += pitch;
+ }
+ } else if (h == 16) {
+ CARD32 *IntPtr2;
+ i = 8;
+ IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
+ IntPtr2 = IntPtr + (pitch << 3);
+ while(i--) {
+ for(j = 0; j < dwords; j++)
+ if(IntPtr[j] != IntPtr2[j])
+ return FALSE;
+ IntPtr += pitch;
+ IntPtr2 += pitch;
+ }
+ }
+
+ pPriv->flags |= REDUCIBLE_TO_8x8;
+
+ if(checkMono) {
+ XAAInfoRecPtr infoRec =
+ GET_XAAINFORECPTR_FROM_DRAWABLE(&pPixmap->drawable);
+ unsigned char bits[8];
+ int fg, bg = -1, x, y;
+
+ i = (h > 8) ? 8 : h;
+ j = (w > 8) ? 8 : w;
+
+ if(pPixmap->drawable.bitsPerPixel == 8) {
+ unsigned char *srcp = pPixmap->devPrivate.ptr;
+ fg = srcp[0];
+ pitch = pPixmap->devKind;
+ for(y = 0; y < i; y++) {
+ bits[y] = 0;
+ for(x = 0; x < j; x++) {
+ if(srcp[x] != fg) {
+ if(bg == -1) bg = srcp[x];
+ else if(bg != srcp[x]) return TRUE;
+ } else bits[y] |= 1 << x;
+ }
+ srcp += pitch;
+ }
+ } else if(pPixmap->drawable.bitsPerPixel == 16) {
+ unsigned short *srcp = (unsigned short*)pPixmap->devPrivate.ptr;
+ fg = srcp[0];
+ pitch = pPixmap->devKind >> 1;
+ for(y = 0; y < i; y++) {
+ bits[y] = 0;
+ for(x = 0; x < j; x++) {
+ if(srcp[x] != fg) {
+ if(bg == -1) bg = srcp[x];
+ else if(bg != srcp[x]) return TRUE;
+ } else bits[y] |= 1 << x;
+ }
+ srcp += pitch;
+ }
+ } else if(pPixmap->drawable.bitsPerPixel == 24) {
+ CARD32 val;
+ unsigned char *srcp = pPixmap->devPrivate.ptr;
+ fg = *((CARD32*)srcp) & 0x00FFFFFF;
+ pitch = pPixmap->devKind;
+ j *= 3;
+ for(y = 0; y < i; y++) {
+ bits[y] = 0;
+ for(x = 0; x < j; x+=3) {
+ val = *((CARD32*)(srcp+x)) & 0x00FFFFFF;
+ if(val != fg) {
+ if(bg == -1) bg = val;
+ else if(bg != val)
+ return TRUE;
+ } else bits[y] |= 1 << (x/3);
+ }
+ srcp += pitch;
+ }
+ } else if(pPixmap->drawable.bitsPerPixel == 32) {
+ IntPtr = (CARD32*)pPixmap->devPrivate.ptr;
+ fg = IntPtr[0];
+ for(y = 0; y < i; y++) {
+ bits[y] = 0;
+ for(x = 0; x < j; x++) {
+ if(IntPtr[x] != fg) {
+ if(bg == -1) bg = IntPtr[x];
+ else if(bg != IntPtr[x]) return TRUE;
+ } else bits[y] |= 1 << x;
+ }
+ IntPtr += pitch;
+ }
+ } else return TRUE;
+
+ pPriv->fg = fg;
+ if(bg == -1) pPriv->bg = fg;
+ else pPriv->bg = bg;
+
+ if(h < 8) {
+ switch(h) {
+ case 1: bits[1] = bits[0];
+ case 2: bits[2] = bits[0]; bits[3] = bits[1];
+ case 4: bits[4] = bits[0]; bits[5] = bits[1];
+ bits[6] = bits[2]; bits[7] = bits[3];
+ break;
+ }
+ }
+
+ pPriv->pattern0 =
+ bits[0] | (bits[1]<<8) | (bits[2]<<16) | (bits[3]<<24);
+ pPriv->pattern1 =
+ bits[4] | (bits[5]<<8) | (bits[6]<<16) | (bits[7]<<24);
+
+ if(w < 8) {
+ switch(w) {
+ case 1: pPriv->pattern0 |= (pPriv->pattern0 << 1);
+ pPriv->pattern1 |= (pPriv->pattern1 << 1);
+ case 2: pPriv->pattern0 |= (pPriv->pattern0 << 2);
+ pPriv->pattern1 |= (pPriv->pattern1 << 2);
+ case 4: pPriv->pattern0 |= (pPriv->pattern0 << 4);
+ pPriv->pattern1 |= (pPriv->pattern1 << 4);
+ }
+ }
+ pPriv->flags |= REDUCIBLE_TO_2_COLOR;
+
+ if(infoRec->Mono8x8PatternFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) {
+ pPriv->pattern0 = SWAP_BITS_IN_BYTES(pPriv->pattern0);
+ pPriv->pattern1 = SWAP_BITS_IN_BYTES(pPriv->pattern1);
+ }
+
+ }
+
+ return TRUE;
+}
+
+
+void XAATileCache(
+ ScrnInfoPtr pScrn,
+ XAACacheInfoPtr pCache,
+ int w, int h
+) {
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, GXcopy, ~0, -1);
+
+ while((w << 1) <= pCache->w) {
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pCache->x, pCache->y,
+ pCache->x + w, pCache->y, w, h);
+ w <<= 1;
+ }
+ if(w != pCache->w) {
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pCache->x, pCache->y,
+ pCache->x + w, pCache->y, pCache->w - w, h);
+ w = pCache->w;
+ }
+
+ while((h << 1) <= pCache->h) {
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pCache->x, pCache->y,
+ pCache->x, pCache->y + h, w, h);
+ h <<= 1;
+ }
+ if(h != pCache->h) {
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn, pCache->x, pCache->y,
+ pCache->x, pCache->y + h, w, pCache->h - h);
+ }
+ SET_SYNC_FLAG(infoRec);
+}
+
+XAACacheInfoPtr
+XAACacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix)
+{
+ int w = pPix->drawable.width;
+ int h = pPix->drawable.height;
+ int size = max(w, h);
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ XAACacheInfoPtr pCache, cacheRoot = NULL;
+ int i, max = 0;
+ int *current;
+
+ if(size <= 128) {
+ if(pCachePriv->Info128) {
+ cacheRoot = pCachePriv->Info128;
+ max = pCachePriv->Num128x128;
+ current = &pCachePriv->Current128;
+ } else {
+ cacheRoot = pCachePriv->InfoPartial;
+ max = pCachePriv->NumPartial;
+ current = &pCachePriv->CurrentPartial;
+ }
+ } else if(size <= 256) {
+ cacheRoot = pCachePriv->Info256;
+ max = pCachePriv->Num256x256;
+ current = &pCachePriv->Current256;
+ } else if(size <= 512) {
+ cacheRoot = pCachePriv->Info512;
+ max = pCachePriv->Num512x512;
+ current = &pCachePriv->Current512;
+ } else { /* something's wrong */
+ ErrorF("Something's wrong in XAACacheTile()\n");
+ return pCachePriv->Info128;
+ }
+
+ pCache = cacheRoot;
+
+ /* lets look for it */
+ for(i = 0; i < max; i++, pCache++) {
+ if(pCache->serialNumber == pPix->drawable.serialNumber) {
+ pCache->trans_color = -1;
+ return pCache;
+ }
+ }
+
+ pCache = &cacheRoot[(*current)++];
+ if(*current >= max) *current = 0;
+
+ pCache->serialNumber = pPix->drawable.serialNumber;
+ pCache->trans_color = pCache->bg = pCache->fg = -1;
+ pCache->orig_w = w; pCache->orig_h = h;
+ (*infoRec->WritePixmapToCache)(
+ pScrn, pCache->x, pCache->y, w, h, pPix->devPrivate.ptr,
+ pPix->devKind, pPix->drawable.bitsPerPixel, pPix->drawable.depth);
+ if(!(infoRec->PixmapCacheFlags & DO_NOT_TILE_COLOR_DATA) &&
+ ((w != pCache->w) || (h != pCache->h)))
+ XAATileCache(pScrn, pCache, w, h);
+
+ return pCache;
+}
+
+XAACacheInfoPtr
+XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
+{
+ int w = pPix->drawable.width;
+ int h = pPix->drawable.height;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ XAACacheInfoPtr pCache, cacheRoot = NULL;
+ int i, max = 0, funcNo, pad, dwords, bpp = pScrn->bitsPerPixel;
+ int *current;
+ StippleScanlineProcPtr StippleFunc;
+ unsigned char *data, *srcPtr, *dstPtr;
+
+ if((h <= 128) && (w <= 128 * bpp)) {
+ if(pCachePriv->Info128) {
+ cacheRoot = pCachePriv->Info128;
+ max = pCachePriv->Num128x128;
+ current = &pCachePriv->Current128;
+ } else {
+ cacheRoot = pCachePriv->InfoPartial;
+ max = pCachePriv->NumPartial;
+ current = &pCachePriv->CurrentPartial;
+ }
+ } else if((h <= 256) && (w <= 256 * bpp)){
+ cacheRoot = pCachePriv->Info256;
+ max = pCachePriv->Num256x256;
+ current = &pCachePriv->Current256;
+ } else if((h <= 512) && (w <= 526 * bpp)){
+ cacheRoot = pCachePriv->Info512;
+ max = pCachePriv->Num512x512;
+ current = &pCachePriv->Current512;
+ } else { /* something's wrong */
+ ErrorF("Something's wrong in XAACacheMonoStipple()\n");
+ return pCachePriv->Info128;
+ }
+
+ pCache = cacheRoot;
+
+ /* lets look for it */
+ for(i = 0; i < max; i++, pCache++) {
+ if((pCache->serialNumber == pPix->drawable.serialNumber) &&
+ (pCache->fg == -1) && (pCache->bg == -1)) {
+ pCache->trans_color = -1;
+ return pCache;
+ }
+ }
+
+ pCache = &cacheRoot[(*current)++];
+ if(*current >= max) *current = 0;
+
+ pCache->serialNumber = pPix->drawable.serialNumber;
+ pCache->trans_color = pCache->bg = pCache->fg = -1;
+ pCache->orig_w = w; pCache->orig_h = h;
+
+ if(w <= 32) {
+ if(w & (w - 1)) funcNo = 1;
+ else funcNo = 0;
+ } else funcNo = 2;
+
+ pad = BitmapBytePad(pCache->w * bpp);
+ dwords = pad >> 2;
+ dstPtr = data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
+ srcPtr = (unsigned char*)pPix->devPrivate.ptr;
+
+ if(infoRec->ScreenToScreenColorExpandFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST)
+ StippleFunc = XAAStippleScanlineFuncMSBFirst[funcNo];
+ else
+ StippleFunc = XAAStippleScanlineFuncLSBFirst[funcNo];
+
+ /* don't bother generating more than we'll ever use */
+ max = ((pScrn->displayWidth + w - 1) + 31) >> 5;
+ if(dwords > max)
+ dwords = max;
+
+ for(i = 0; i < h; i++) {
+ (*StippleFunc)((CARD32*)dstPtr, (CARD32*)srcPtr, 0, w, dwords);
+ srcPtr += pPix->devKind;
+ dstPtr += pad;
+ }
+
+ while((h<<1) <= pCache->h) {
+ memcpy(data + (pad * h), data, pad * h);
+ h <<= 1;
+ }
+
+ if(h < pCache->h)
+ memcpy(data + (pad * h), data, pad * (pCache->h - h));
+
+ (*infoRec->WritePixmapToCache)(
+ pScrn, pCache->x, pCache->y, pCache->w, pCache->h, data,
+ pad, bpp, pScrn->depth);
+
+ DEALLOCATE_LOCAL(data);
+
+ return pCache;
+}
+
+XAACacheInfoPtr
+XAACachePlanarMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
+{
+ int w = pPix->drawable.width;
+ int h = pPix->drawable.height;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ XAACacheInfoPtr pCache, cacheRoot = NULL;
+ int i, max = 0;
+ int *current;
+
+ if((h <= 128) && (w <= 128)) {
+ if(pCachePriv->Info128) {
+ cacheRoot = pCachePriv->Info128;
+ max = pCachePriv->Num128x128;
+ current = &pCachePriv->Current128;
+ } else {
+ cacheRoot = pCachePriv->InfoPartial;
+ max = pCachePriv->NumPartial;
+ current = &pCachePriv->CurrentPartial;
+ }
+ } else if((h <= 256) && (w <= 256)){
+ cacheRoot = pCachePriv->Info256;
+ max = pCachePriv->Num256x256;
+ current = &pCachePriv->Current256;
+ } else if((h <= 512) && (w <= 526)){
+ cacheRoot = pCachePriv->Info512;
+ max = pCachePriv->Num512x512;
+ current = &pCachePriv->Current512;
+ } else { /* something's wrong */
+ ErrorF("Something's wrong in XAACachePlanarMonoStipple()\n");
+ return pCachePriv->Info128;
+ }
+
+ pCache = cacheRoot;
+
+ /* lets look for it */
+ for(i = 0; i < max; i++, pCache++) {
+ if((pCache->serialNumber == pPix->drawable.serialNumber) &&
+ (pCache->fg == -1) && (pCache->bg == -1)) {
+ pCache->trans_color = -1;
+ return pCache;
+ }
+ }
+
+ pCache = &cacheRoot[(*current)++];
+ if(*current >= max) *current = 0;
+
+ pCache->serialNumber = pPix->drawable.serialNumber;
+ pCache->trans_color = pCache->bg = pCache->fg = -1;
+ pCache->orig_w = w; pCache->orig_h = h;
+
+ /* Plane 0 holds the stipple. Plane 1 holds the inverted stipple */
+ (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y,
+ pPix->drawable.width, pPix->drawable.height, pPix->devPrivate.ptr,
+ pPix->devKind, 1, 2);
+ if(!(infoRec->PixmapCacheFlags & DO_NOT_TILE_MONO_DATA) &&
+ ((w != pCache->w) || (h != pCache->h)))
+ XAATileCache(pScrn, pCache, w, h);
+
+ return pCache;
+}
+
+
+
+XAACacheInfoPtr
+XAACacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg)
+{
+ int w = pPix->drawable.width;
+ int h = pPix->drawable.height;
+ int size = max(w, h);
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ XAACacheInfoPtr pCache, cacheRoot = NULL;
+ int i, max = 0;
+ int *current;
+
+ if(size <= 128) {
+ if(pCachePriv->Info128) {
+ cacheRoot = pCachePriv->Info128;
+ max = pCachePriv->Num128x128;
+ current = &pCachePriv->Current128;
+ } else {
+ cacheRoot = pCachePriv->InfoPartial;
+ max = pCachePriv->NumPartial;
+ current = &pCachePriv->CurrentPartial;
+ }
+ } else if(size <= 256) {
+ cacheRoot = pCachePriv->Info256;
+ max = pCachePriv->Num256x256;
+ current = &pCachePriv->Current256;
+ } else if(size <= 512) {
+ cacheRoot = pCachePriv->Info512;
+ max = pCachePriv->Num512x512;
+ current = &pCachePriv->Current512;
+ } else { /* something's wrong */
+ ErrorF("Something's wrong in XAACacheStipple()\n");
+ return pCachePriv->Info128;
+ }
+
+ pCache = cacheRoot;
+ /* lets look for it */
+ if(bg == -1)
+ for(i = 0; i < max; i++, pCache++) {
+ if((pCache->serialNumber == pPix->drawable.serialNumber) &&
+ (fg == pCache->fg) && (pCache->fg != pCache->bg)) {
+ pCache->trans_color = pCache->bg;
+ return pCache;
+ }
+ }
+ else
+ for(i = 0; i < max; i++, pCache++) {
+ if((pCache->serialNumber == pPix->drawable.serialNumber) &&
+ (fg == pCache->fg) && (bg == pCache->bg)) {
+ pCache->trans_color = -1;
+ return pCache;
+ }
+ }
+
+ pCache = &cacheRoot[(*current)++];
+ if(*current >= max) *current = 0;
+
+ pCache->serialNumber = pPix->drawable.serialNumber;
+ pCache->fg = fg;
+ if(bg == -1)
+ pCache->trans_color = bg = fg ^ 1;
+ else
+ pCache->trans_color = -1;
+ pCache->bg = bg;
+
+ pCache->orig_w = w; pCache->orig_h = h;
+ (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y,
+ pPix->drawable.width, pPix->drawable.height, pPix->devPrivate.ptr,
+ pPix->devKind, fg, bg);
+ if(!(infoRec->PixmapCacheFlags & DO_NOT_TILE_COLOR_DATA) &&
+ ((w != pCache->w) || (h != pCache->h)))
+ XAATileCache(pScrn, pCache, w, h);
+
+ return pCache;
+}
+
+
+
+XAACacheInfoPtr
+XAACacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0, int pat1)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ XAACacheInfoPtr pCache = pCachePriv->InfoMono;
+ int i;
+
+ for(i = 0; i < pCachePriv->NumMono; i++, pCache++) {
+ if(pCache->serialNumber &&
+ (pCache->pat0 == pat0) && (pCache->pat1 == pat1))
+ return pCache;
+ }
+
+ /* OK, let's cache it */
+ pCache = &pCachePriv->InfoMono[pCachePriv->CurrentMono++];
+ if(pCachePriv->CurrentMono >= pCachePriv->NumMono)
+ pCachePriv->CurrentMono = 0;
+
+ pCache->serialNumber = 1; /* we don't care since we do lookups by pattern */
+ pCache->pat0 = pat0;
+ pCache->pat1 = pat1;
+
+ (*infoRec->WriteMono8x8PatternToCache)(pScrn, pCache);
+
+ return pCache;
+}
+
+
+
+XAACacheInfoPtr
+XAACacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ XAACacheInfoPtr pCache = pCachePriv->InfoColor;
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ int i;
+
+ if(!(pixPriv->flags & REDUCIBLE_TO_2_COLOR)) {
+ for(i = 0; i < pCachePriv->NumColor; i++, pCache++) {
+ if(pCache->serialNumber == pPix->drawable.serialNumber) {
+ pCache->trans_color = -1;
+ return pCache;
+ }
+ }
+ pCache = &pCachePriv->InfoColor[pCachePriv->CurrentColor++];
+ if(pCachePriv->CurrentColor >= pCachePriv->NumColor)
+ pCachePriv->CurrentColor = 0;
+
+ pCache->serialNumber = pPix->drawable.serialNumber;
+ pCache->trans_color = pCache->fg = pCache->bg = -1;
+ } else {
+ int pat0 = pixPriv->pattern0;
+ int pat1 = pixPriv->pattern1;
+
+ if(fg == -1) { /* it's a tile */
+ fg = pixPriv->fg; bg = pixPriv->bg;
+ }
+
+ if(bg == -1) { /* stipple */
+ for(i = 0; i < pCachePriv->NumColor; i++, pCache++) {
+ if(pCache->serialNumber &&
+ (pCache->pat0 == pat0) && (pCache->pat1 == pat1) &&
+ (pCache->fg == fg) && (pCache->bg != fg)) {
+ pCache->trans_color = pCache->bg;
+ return pCache;
+ }
+ }
+ } else { /* opaque stipple */
+ for(i = 0; i < pCachePriv->NumColor; i++, pCache++) {
+ if(pCache->serialNumber &&
+ (pCache->pat0 == pat0) && (pCache->pat1 == pat1) &&
+ (pCache->fg == fg) && (pCache->bg == bg)) {
+ pCache->trans_color = -1;
+ return pCache;
+ }
+ }
+ }
+ pCache = &pCachePriv->InfoColor[pCachePriv->CurrentColor++];
+ if(pCachePriv->CurrentColor >= pCachePriv->NumColor)
+ pCachePriv->CurrentColor = 0;
+
+ if(bg == -1)
+ pCache->trans_color = bg = fg ^ 1;
+ else
+ pCache->trans_color = -1;
+
+ pCache->pat0 = pat0; pCache->pat1 = pat1;
+ pCache->fg = fg; pCache->bg = bg;
+ pCache->serialNumber = 1;
+ }
+
+ (*infoRec->WriteColor8x8PatternToCache)(pScrn, pPix, pCache);
+
+ return pCache;
+}
+
+
+void
+XAAWriteBitmapToCache(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int fg, int bg
+) {
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->WriteBitmap)(pScrn, x, y, w, h, src, srcwidth,
+ 0, fg, bg, GXcopy, ~0);
+}
+
+void
+XAAWriteBitmapToCacheLinear(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int fg, int bg
+){
+ ScreenPtr pScreen = pScrn->pScreen;
+ PixmapPtr pScreenPix, pDstPix;
+ XID gcvals[2];
+ GCPtr pGC;
+
+ pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
+
+ pDstPix = GetScratchPixmapHeader(pScreen, pScreenPix->drawable.width,
+ y + h, pScreenPix->drawable.depth,
+ pScreenPix->drawable.bitsPerPixel,
+ pScreenPix->devKind,
+ pScreenPix->devPrivate.ptr);
+
+ pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen);
+ gcvals[0] = fg;
+ gcvals[1] = bg;
+ DoChangeGC(pGC, GCForeground | GCBackground, gcvals, 0);
+ ValidateGC((DrawablePtr)pDstPix, pGC);
+
+ /* We've unwrapped already so these ops miss a sync */
+ SYNC_CHECK(pScrn);
+
+ (*pGC->ops->PutImage)((DrawablePtr)pDstPix, pGC, 1, x, y, w, h, 0,
+ XYBitmap, (pointer)src);
+
+ FreeScratchGC(pGC);
+ FreeScratchPixmapHeader(pDstPix);
+}
+
+
+void
+XAAWritePixmapToCache(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int bpp, int depth
+) {
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->WritePixmap)(pScrn, x, y, w, h, src, srcwidth,
+ GXcopy, ~0, -1, bpp, depth);
+}
+
+
+
+void
+XAAWritePixmapToCacheLinear(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int bpp, int depth
+){
+ ScreenPtr pScreen = pScrn->pScreen;
+ PixmapPtr pScreenPix, pDstPix;
+ GCPtr pGC;
+
+ pScreenPix = (*pScreen->GetScreenPixmap)(pScreen);
+
+ pDstPix = GetScratchPixmapHeader(pScreen, x + w, y + h,
+ depth, bpp, pScreenPix->devKind,
+ pScreenPix->devPrivate.ptr);
+
+ pGC = GetScratchGC(depth, pScreen);
+ ValidateGC((DrawablePtr)pDstPix, pGC);
+
+ /* We've unwrapped already so these ops miss a sync */
+ SYNC_CHECK(pScrn);
+
+ if(bpp == BitsPerPixel(depth))
+ (*pGC->ops->PutImage)((DrawablePtr)pDstPix, pGC, depth, x, y, w,
+ h, 0, ZPixmap, (pointer)src);
+ else {
+ PixmapPtr pSrcPix;
+
+ pSrcPix = GetScratchPixmapHeader(pScreen, w, h, depth, bpp,
+ srcwidth, (pointer)src);
+
+ (*pGC->ops->CopyArea)((DrawablePtr)pSrcPix, (DrawablePtr)pDstPix,
+ pGC, 0, 0, w, h, x, y);
+
+ FreeScratchPixmapHeader(pSrcPix);
+ }
+
+ FreeScratchGC(pGC);
+ FreeScratchPixmapHeader(pDstPix);
+}
+
+
+void
+XAAWriteMono8x8PatternToCache(
+ ScrnInfoPtr pScrn,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ unsigned char *data;
+ int pad, Bpp = (pScrn->bitsPerPixel >> 3);
+
+ pCache->offsets = pCachePriv->MonoOffsets;
+
+ pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel);
+
+ data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
+ if(!data) return;
+
+ if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
+ CARD32* ptr = (CARD32*)data;
+ ptr[0] = pCache->pat0; ptr[1] = pCache->pat1;
+ } else {
+ CARD32 *ptr;
+ DDXPointPtr pPoint = pCache->offsets;
+ int patx, paty, i;
+
+ for(i = 0; i < 64; i++, pPoint++) {
+ patx = pCache->pat0; paty = pCache->pat1;
+ XAARotateMonoPattern(&patx, &paty, i & 0x07, i >> 3,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ ptr = (CARD32*)(data + (pad * pPoint->y) + (Bpp * pPoint->x));
+ ptr[0] = patx; ptr[1] = paty;
+ }
+ }
+
+ (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y,
+ pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth);
+
+ DEALLOCATE_LOCAL(data);
+}
+
+void
+XAAWriteColor8x8PatternToCache(
+ ScrnInfoPtr pScrn,
+ PixmapPtr pPix,
+ XAACacheInfoPtr pCache
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ int pad, i, w, h, nw, nh, Bpp;
+ unsigned char *data, *srcPtr, *dstPtr;
+
+ pCache->offsets = pCachePriv->ColorOffsets;
+
+ if(pixPriv->flags & REDUCIBLE_TO_2_COLOR) {
+ CARD32* ptr;
+ pad = BitmapBytePad(pCache->w);
+ data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
+ if(!data) return;
+
+ if(infoRec->Color8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN) {
+ ptr = (CARD32*)data;
+ ptr[0] = pCache->pat0; ptr[1] = pCache->pat1;
+ } else {
+ int patx, paty;
+
+ ptr = (CARD32*)data;
+ ptr[0] = ptr[2] = pCache->pat0; ptr[1] = ptr[3] = pCache->pat1;
+ for(i = 1; i < 8; i++) {
+ patx = pCache->pat0; paty = pCache->pat1;
+ XAARotateMonoPattern(&patx, &paty, i, 0,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ ptr = (CARD32*)(data + (pad * i));
+ ptr[0] = ptr[2] = patx; ptr[1] = ptr[3] = paty;
+ }
+ }
+
+ (*infoRec->WriteBitmapToCache)(pScrn, pCache->x, pCache->y,
+ pCache->w, pCache->h, data, pad, pCache->fg, pCache->bg);
+
+ DEALLOCATE_LOCAL(data);
+ return;
+ }
+
+ Bpp = pScrn->bitsPerPixel >> 3;
+ h = min(8,pPix->drawable.height);
+ w = min(8,pPix->drawable.width);
+ pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel);
+
+ data = (unsigned char*)ALLOCATE_LOCAL(pad * pCache->h);
+ if(!data) return;
+
+ /* Write and expand horizontally. */
+ for (i = h, dstPtr = data, srcPtr = pPix->devPrivate.ptr; i--;
+ srcPtr += pPix->devKind, dstPtr += pScrn->bitsPerPixel) {
+ nw = w;
+ memcpy(dstPtr, srcPtr, w * Bpp);
+ while (nw != 8) {
+ memcpy(dstPtr + (nw * Bpp), srcPtr, nw * Bpp);
+ nw <<= 1;
+ }
+ }
+ nh = h;
+ /* Expand vertically. */
+ while (nh != 8) {
+ memcpy(data + (nh*pScrn->bitsPerPixel), data, nh*pScrn->bitsPerPixel);
+ nh <<= 1;
+ }
+
+ if(!(infoRec->Color8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ int j;
+ unsigned char *ptr = data + (128 * Bpp);
+
+ memcpy(data + (64 * Bpp), data, 64 * Bpp);
+ for(i = 1; i < 8; i++, ptr += (128 * Bpp)) {
+ for(j = 0; j < 8; j++) {
+ memcpy(ptr + (j * 8) * Bpp, data + (j * 8 + i) * Bpp,
+ (8 - i) * Bpp);
+ memcpy(ptr + (j * 8 + 8 - i) * Bpp, data + j * 8 * Bpp, i*Bpp);
+ }
+ memcpy(ptr + (64 * Bpp), ptr, 64 * Bpp);
+ }
+ }
+
+ (*infoRec->WritePixmapToCache)(pScrn, pCache->x, pCache->y,
+ pCache->w, pCache->h, data, pad, pScrn->bitsPerPixel, pScrn->depth);
+
+ DEALLOCATE_LOCAL(data);
+}
+
+
+
+int
+XAAStippledFillChooser(GCPtr pGC)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ PixmapPtr pPixmap = pGC->stipple;
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
+
+ if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
+ (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
+ XAACheckStippleReducibility(pPixmap);
+ }
+
+
+ if(pPriv->flags & REDUCIBLE_TO_8x8) {
+ if(infoRec->CanDoMono8x8 &&
+ !(infoRec->FillMono8x8PatternSpansFlags & NO_TRANSPARENCY) &&
+ ((pGC->alu == GXcopy) || !(infoRec->FillMono8x8PatternSpansFlags &
+ TRANSPARENCY_GXCOPY_ONLY)) &&
+ CHECK_ROP(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
+ CHECK_FG(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillMono8x8PatternSpansFlags)) {
+
+ return DO_MONO_8x8;
+ }
+
+ if(infoRec->CanDoColor8x8 &&
+ !(infoRec->FillColor8x8PatternSpansFlags & NO_TRANSPARENCY) &&
+ ((pGC->alu == GXcopy) || !(infoRec->FillColor8x8PatternSpansFlags &
+ TRANSPARENCY_GXCOPY_ONLY)) &&
+ CHECK_ROP(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillColor8x8PatternSpansFlags)) {
+
+ return DO_COLOR_8x8;
+ }
+ }
+
+ if(infoRec->UsingPixmapCache && infoRec->FillCacheExpandSpans &&
+ (pPixmap->drawable.height <= infoRec->MaxCacheableStippleHeight) &&
+ (pPixmap->drawable.width <= infoRec->MaxCacheableStippleWidth /
+ infoRec->CacheColorExpandDensity) &&
+ !(infoRec->FillCacheExpandSpansFlags & NO_TRANSPARENCY) &&
+ ((pGC->alu == GXcopy) || !(infoRec->FillCacheExpandSpansFlags &
+ TRANSPARENCY_GXCOPY_ONLY)) &&
+ CHECK_ROP(pGC,infoRec->FillCacheExpandSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillCacheExpandSpansFlags) &&
+ CHECK_FG(pGC,infoRec->FillCacheExpandSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillCacheExpandSpansFlags)) {
+
+ return DO_CACHE_EXPAND;
+ }
+
+
+ if(infoRec->UsingPixmapCache &&
+ !(infoRec->PixmapCacheFlags & DO_NOT_BLIT_STIPPLES) &&
+ infoRec->FillCacheBltSpans &&
+ (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
+ (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
+ !(infoRec->FillCacheBltSpansFlags & NO_TRANSPARENCY) &&
+ ((pGC->alu == GXcopy) || !(infoRec->FillCacheBltSpansFlags &
+ TRANSPARENCY_GXCOPY_ONLY)) &&
+ CHECK_ROP(pGC,infoRec->FillCacheBltSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillCacheBltSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillCacheBltSpansFlags)) {
+
+ return DO_CACHE_BLT;
+ }
+
+ if(infoRec->FillColorExpandSpans &&
+ !(infoRec->FillColorExpandSpansFlags & NO_TRANSPARENCY) &&
+ ((pGC->alu == GXcopy) || !(infoRec->FillColorExpandSpansFlags &
+ TRANSPARENCY_GXCOPY_ONLY)) &&
+ CHECK_ROP(pGC,infoRec->FillColorExpandSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillColorExpandSpansFlags) &&
+ CHECK_FG(pGC,infoRec->FillColorExpandSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillColorExpandSpansFlags)) {
+
+ return DO_COLOR_EXPAND;
+ }
+
+ return 0;
+}
+
+
+int
+XAAOpaqueStippledFillChooser(GCPtr pGC)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ PixmapPtr pPixmap = pGC->stipple;
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
+
+ if(XAA_DEPTH_BUG(pGC))
+ return 0;
+
+ if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
+ (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
+ XAACheckStippleReducibility(pPixmap);
+ }
+
+ if(pPriv->flags & REDUCIBLE_TO_8x8) {
+ if(infoRec->CanDoMono8x8 &&
+ !(infoRec->FillMono8x8PatternSpansFlags & TRANSPARENCY_ONLY) &&
+ CHECK_ROP(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
+ CHECK_COLORS(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillMono8x8PatternSpansFlags)) {
+
+ return DO_MONO_8x8;
+ }
+
+ if(infoRec->CanDoColor8x8 &&
+ CHECK_ROP(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillColor8x8PatternSpansFlags)) {
+
+ return DO_COLOR_8x8;
+ }
+ }
+
+ if(infoRec->UsingPixmapCache && infoRec->FillCacheExpandSpans &&
+ (pPixmap->drawable.height <= infoRec->MaxCacheableStippleHeight) &&
+ (pPixmap->drawable.width <= infoRec->MaxCacheableStippleWidth /
+ infoRec->CacheColorExpandDensity) &&
+ !(infoRec->FillCacheExpandSpansFlags & TRANSPARENCY_ONLY) &&
+ CHECK_ROP(pGC,infoRec->FillCacheExpandSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillCacheExpandSpansFlags) &&
+ CHECK_COLORS(pGC,infoRec->FillCacheExpandSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillCacheExpandSpansFlags)) {
+
+ return DO_CACHE_EXPAND;
+ }
+
+ if(infoRec->UsingPixmapCache &&
+ !(infoRec->PixmapCacheFlags & DO_NOT_BLIT_STIPPLES) &&
+ infoRec->FillCacheBltSpans &&
+ (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
+ (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
+ CHECK_ROP(pGC,infoRec->FillCacheBltSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillCacheBltSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillCacheBltSpansFlags)) {
+
+ return DO_CACHE_BLT;
+ }
+
+ if(infoRec->FillColorExpandSpans &&
+ !(infoRec->FillColorExpandSpansFlags & TRANSPARENCY_ONLY) &&
+ CHECK_ROP(pGC,infoRec->FillColorExpandSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillColorExpandSpansFlags) &&
+ CHECK_COLORS(pGC,infoRec->FillColorExpandSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillColorExpandSpansFlags)) {
+
+ return DO_COLOR_EXPAND;
+ }
+
+ return 0;
+}
+
+
+
+int
+XAATiledFillChooser(GCPtr pGC)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ PixmapPtr pPixmap = pGC->tile.pixmap;
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap);
+
+ if(IS_OFFSCREEN_PIXMAP(pPixmap) && infoRec->FillCacheBltSpans &&
+ CHECK_ROP(pGC,infoRec->FillCacheBltSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillCacheBltSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillCacheBltSpansFlags)) {
+
+ return DO_PIXMAP_COPY;
+ }
+
+ if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
+ (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
+ XAACheckTileReducibility(pPixmap,infoRec->CanDoMono8x8);
+ }
+
+ if(pPriv->flags & REDUCIBLE_TO_8x8) {
+ if((pPriv->flags & REDUCIBLE_TO_2_COLOR) && infoRec->CanDoMono8x8 &&
+ !(infoRec->FillMono8x8PatternSpansFlags & TRANSPARENCY_ONLY) &&
+ CHECK_ROP(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillMono8x8PatternSpansFlags) &&
+ (!(infoRec->FillMono8x8PatternSpansFlags & RGB_EQUAL) ||
+ (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg))) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillMono8x8PatternSpansFlags)) {
+
+ return DO_MONO_8x8;
+ }
+
+ if(infoRec->CanDoColor8x8 &&
+ CHECK_ROP(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillColor8x8PatternSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillColor8x8PatternSpansFlags)) {
+
+ return DO_COLOR_8x8;
+ }
+ }
+
+ if(infoRec->UsingPixmapCache && infoRec->FillCacheBltSpans &&
+ (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) &&
+ (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) &&
+ CHECK_ROP(pGC,infoRec->FillCacheBltSpansFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillCacheBltSpansFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillCacheBltSpansFlags)) {
+
+ return DO_CACHE_BLT;
+ }
+
+ if(infoRec->FillImageWriteRects &&
+ CHECK_NO_GXCOPY(pGC,infoRec->FillImageWriteRectsFlags) &&
+ CHECK_ROP(pGC,infoRec->FillImageWriteRectsFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillImageWriteRectsFlags) &&
+ CHECK_PLANEMASK(pGC,infoRec->FillImageWriteRectsFlags)) {
+
+ return DO_IMAGE_WRITE;
+ }
+
+ return 0;
+}
+
+
+static int RotateMasksX[8] = {
+ 0xFFFFFFFF, 0x7F7F7F7F, 0x3F3F3F3F, 0x1F1F1F1F,
+ 0x0F0F0F0F, 0x07070707, 0x03030303, 0x01010101
+};
+
+static int RotateMasksY[4] = {
+ 0xFFFFFFFF, 0x00FFFFFF, 0x0000FFFF, 0x000000FF
+};
+
+void
+XAARotateMonoPattern(
+ int *pat0, int *pat1,
+ int xorg, int yorg,
+ Bool msbfirst
+){
+ int tmp, mask;
+
+ if(xorg) {
+ if(msbfirst) xorg = 8 - xorg;
+ mask = RotateMasksX[xorg];
+ *pat0 = ((*pat0 >> xorg) & mask) | ((*pat0 << (8 - xorg)) & ~mask);
+ *pat1 = ((*pat1 >> xorg) & mask) | ((*pat1 << (8 - xorg)) & ~mask);
+ }
+ if(yorg >= 4) {
+ tmp = *pat0; *pat0 = *pat1; *pat1 = tmp;
+ yorg -= 4;
+ }
+ if(yorg) {
+ mask = RotateMasksY[yorg];
+ yorg <<= 3;
+ tmp = *pat0;
+ *pat0 = ((*pat0 >> yorg) & mask) | ((*pat1 << (32 - yorg)) & ~mask);
+ *pat1 = ((*pat1 >> yorg) & mask) | ((tmp << (32 - yorg)) & ~mask);
+ }
+}
+
+
+
+void
+XAAInvalidatePixmapCache(ScreenPtr pScreen)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ XAAPixmapCachePrivatePtr pCachePriv =
+ (XAAPixmapCachePrivatePtr)infoRec->PixmapCachePrivate;
+ int i;
+
+ if(!pCachePriv) return;
+
+ for(i = 0; i < pCachePriv->Num512x512; i++)
+ (pCachePriv->Info512)[i].serialNumber = 0;
+ for(i = 0; i < pCachePriv->Num256x256; i++)
+ (pCachePriv->Info256)[i].serialNumber = 0;
+ for(i = 0; i < pCachePriv->Num128x128; i++)
+ (pCachePriv->Info128)[i].serialNumber = 0;
+ for(i = 0; i < pCachePriv->NumPartial; i++)
+ (pCachePriv->InfoPartial)[i].serialNumber = 0;
+ for(i = 0; i < pCachePriv->NumMono; i++)
+ (pCachePriv->InfoMono)[i].serialNumber = 0;
+ for(i = 0; i < pCachePriv->NumColor; i++)
+ (pCachePriv->InfoColor)[i].serialNumber = 0;
+}
diff --git a/hw/xfree86/xaa/xaaPaintWin.c b/hw/xfree86/xaa/xaaPaintWin.c
new file mode 100644
index 000000000..2adf42466
--- /dev/null
+++ b/hw/xfree86/xaa/xaaPaintWin.c
@@ -0,0 +1,198 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPaintWin.c,v 1.11 2003/02/17 16:08:29 dawes Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "xaawrap.h"
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
+void
+XAAPaintWindow(
+ WindowPtr pWin,
+ RegionPtr prgn,
+ int what
+)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
+ int nBox = REGION_NUM_RECTS(prgn);
+ BoxPtr pBox = REGION_RECTS(prgn);
+ int fg = -1;
+ PixmapPtr pPix = NULL;
+
+ if(!infoRec->pScrn->vtSema) goto BAILOUT;
+
+ switch (what) {
+ case PW_BACKGROUND:
+ switch(pWin->backgroundState) {
+ case None: return;
+ case ParentRelative:
+ do { pWin = pWin->parent; }
+ while(pWin->backgroundState == ParentRelative);
+ (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, what);
+ return;
+ case BackgroundPixel:
+ fg = pWin->background.pixel;
+ break;
+ case BackgroundPixmap:
+ pPix = pWin->background.pixmap;
+ break;
+ }
+ break;
+ case PW_BORDER:
+ if (pWin->borderIsPixel)
+ fg = pWin->border.pixel;
+ else /* pixmap */
+ pPix = pWin->border.pixmap;
+ break;
+ default: return;
+ }
+
+
+ if(!pPix) {
+ if(infoRec->FillSolidRects &&
+ (!(infoRec->FillSolidRectsFlags & RGB_EQUAL) ||
+ (CHECK_RGB_EQUAL(fg))) ) {
+ (*infoRec->FillSolidRects)(infoRec->pScrn, fg, GXcopy, ~0,
+ nBox, pBox);
+ return;
+ }
+ } else { /* pixmap */
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix);
+ WindowPtr pBgWin = pWin;
+ Bool NoCache = FALSE;
+ int xorg, yorg;
+
+ /* Hack so we can use this with the dual framebuffer layers
+ which only support the pixmap cache in the primary bpp */
+ if(pPix->drawable.bitsPerPixel != infoRec->pScrn->bitsPerPixel)
+ NoCache = TRUE;
+
+ if (what == PW_BORDER) {
+ for (pBgWin = pWin;
+ pBgWin->backgroundState == ParentRelative;
+ pBgWin = pBgWin->parent);
+ }
+
+ xorg = pBgWin->drawable.x;
+ yorg = pBgWin->drawable.y;
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ int index = pScreen->myNum;
+ if(WindowTable[index] == pBgWin) {
+ xorg -= panoramiXdataPtr[index].x;
+ yorg -= panoramiXdataPtr[index].y;
+ }
+ }
+#endif
+
+ if(IS_OFFSCREEN_PIXMAP(pPix) && infoRec->FillCacheBltRects) {
+ XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
+
+ pCache->x = pPriv->offscreenArea->box.x1;
+ pCache->y = pPriv->offscreenArea->box.y1;
+ pCache->w = pCache->orig_w =
+ pPriv->offscreenArea->box.x2 - pCache->x;
+ pCache->h = pCache->orig_h =
+ pPriv->offscreenArea->box.y2 - pCache->y;
+ pCache->trans_color = -1;
+
+ (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, ~0,
+ nBox, pBox, xorg, yorg, pCache);
+ return;
+ }
+
+ if(pPriv->flags & DIRTY) {
+ pPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK);
+ pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+
+ if(!(pPriv->flags & REDUCIBILITY_CHECKED) &&
+ (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) {
+ XAACheckTileReducibility(pPix, infoRec->CanDoMono8x8);
+ }
+
+ if(pPriv->flags & REDUCIBLE_TO_8x8) {
+ if((pPriv->flags & REDUCIBLE_TO_2_COLOR) &&
+ infoRec->CanDoMono8x8 && infoRec->FillMono8x8PatternRects &&
+ !(infoRec->FillMono8x8PatternRectsFlags & TRANSPARENCY_ONLY) &&
+ (!(infoRec->FillMono8x8PatternRectsFlags & RGB_EQUAL) ||
+ (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg)))) {
+
+ (*infoRec->FillMono8x8PatternRects)(infoRec->pScrn,
+ pPriv->fg, pPriv->bg, GXcopy, ~0, nBox, pBox,
+ pPriv->pattern0, pPriv->pattern1, xorg, yorg);
+ return;
+ }
+ if(infoRec->CanDoColor8x8 && !NoCache &&
+ infoRec->FillColor8x8PatternRects) {
+ XAACacheInfoPtr pCache = (*infoRec->CacheColor8x8Pattern)(
+ infoRec->pScrn, pPix, -1, -1);
+
+ (*infoRec->FillColor8x8PatternRects) ( infoRec->pScrn,
+ GXcopy, ~0, nBox, pBox, xorg, yorg, pCache);
+ return;
+ }
+ }
+
+ /* The window size check is to reduce pixmap cache thrashing
+ when there are lots of little windows with pixmap backgrounds
+ like are sometimes used for buttons, etc... */
+
+ if(infoRec->UsingPixmapCache &&
+ infoRec->FillCacheBltRects && !NoCache &&
+ ((what == PW_BORDER) ||
+ (pPix->drawable.height != pWin->drawable.height) ||
+ (pPix->drawable.width != pWin->drawable.width)) &&
+ (pPix->drawable.height <= infoRec->MaxCacheableTileHeight) &&
+ (pPix->drawable.width <= infoRec->MaxCacheableTileWidth)) {
+
+ XAACacheInfoPtr pCache =
+ (*infoRec->CacheTile)(infoRec->pScrn, pPix);
+ (*infoRec->FillCacheBltRects)(infoRec->pScrn, GXcopy, ~0,
+ nBox, pBox, xorg, yorg, pCache);
+ return;
+ }
+
+ if(infoRec->FillImageWriteRects &&
+ !(infoRec->FillImageWriteRectsFlags & NO_GXCOPY)) {
+ (*infoRec->FillImageWriteRects) (infoRec->pScrn, GXcopy,
+ ~0, nBox, pBox, xorg, yorg, pPix);
+ return;
+ }
+ }
+
+
+ if(infoRec->NeedToSync) {
+ (*infoRec->Sync)(infoRec->pScrn);
+ infoRec->NeedToSync = FALSE;
+ }
+
+BAILOUT:
+
+ if(what == PW_BACKGROUND) {
+ XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBackground);
+ (*pScreen->PaintWindowBackground) (pWin, prgn, what);
+ XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBackground, XAAPaintWindow);
+ } else {
+ XAA_SCREEN_PROLOGUE (pScreen, PaintWindowBorder);
+ (*pScreen->PaintWindowBorder) (pWin, prgn, what);
+ XAA_SCREEN_EPILOGUE(pScreen, PaintWindowBorder, XAAPaintWindow);
+ }
+
+}
diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
new file mode 100644
index 000000000..4b7e3d0f0
--- /dev/null
+++ b/hw/xfree86/xaa/xaaPict.c
@@ -0,0 +1,683 @@
+/*
+ * $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaPict.c,v 1.17 2002/12/10 04:17:21 dawes Exp $
+ *
+ * Copyright © 2000 Keith Packard, member of The XFree86 Project, 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, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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.
+ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "mi.h"
+#include "picturestr.h"
+#include "glyphstr.h"
+#include "picture.h"
+#include "mipict.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+#include "xaacexp.h"
+#include "xf86fbman.h"
+#include "servermd.h"
+
+Bool
+XAAGetPixelFromRGBA (
+ CARD32 *pixel,
+ CARD16 red,
+ CARD16 green,
+ CARD16 blue,
+ CARD16 alpha,
+ CARD32 format
+){
+ int rbits, bbits, gbits, abits;
+ int rshift, bshift, gshift, ashift;
+
+ *pixel = 0;
+
+ if(!PICT_FORMAT_COLOR(format))
+ return FALSE;
+
+ rbits = PICT_FORMAT_R(format);
+ gbits = PICT_FORMAT_G(format);
+ bbits = PICT_FORMAT_B(format);
+ abits = PICT_FORMAT_A(format);
+
+ if(PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) {
+ bshift = 0;
+ gshift = bbits;
+ rshift = gshift + gbits;
+ ashift = rshift + rbits;
+ } else { /* PICT_TYPE_ABGR */
+ rshift = 0;
+ gshift = rbits;
+ bshift = gshift + gbits;
+ ashift = bshift + bbits;
+ }
+
+ *pixel |= ( blue >> (16 - bbits)) << bshift;
+ *pixel |= ( red >> (16 - rbits)) << rshift;
+ *pixel |= (green >> (16 - gbits)) << gshift;
+ *pixel |= (alpha >> (16 - abits)) << ashift;
+
+ return TRUE;
+}
+
+
+Bool
+XAAGetRGBAFromPixel(
+ CARD32 pixel,
+ CARD16 *red,
+ CARD16 *green,
+ CARD16 *blue,
+ CARD16 *alpha,
+ CARD32 format
+){
+ int rbits, bbits, gbits, abits;
+ int rshift, bshift, gshift, ashift;
+
+ if(!PICT_FORMAT_COLOR(format))
+ return FALSE;
+
+ rbits = PICT_FORMAT_R(format);
+ gbits = PICT_FORMAT_G(format);
+ bbits = PICT_FORMAT_B(format);
+ abits = PICT_FORMAT_A(format);
+
+ if(PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) {
+ bshift = 0;
+ gshift = bbits;
+ rshift = gshift + gbits;
+ ashift = rshift + rbits;
+ } else { /* PICT_TYPE_ABGR */
+ rshift = 0;
+ gshift = rbits;
+ bshift = gshift + gbits;
+ ashift = bshift + bbits;
+ }
+
+ *red = ((pixel >> rshift ) & ((1 << rbits) - 1)) << (16 - rbits);
+ while(rbits < 16) {
+ *red |= *red >> rbits;
+ rbits <<= 1;
+ }
+
+ *green = ((pixel >> gshift ) & ((1 << gbits) - 1)) << (16 - gbits);
+ while(gbits < 16) {
+ *green |= *green >> gbits;
+ gbits <<= 1;
+ }
+
+ *blue = ((pixel >> bshift ) & ((1 << bbits) - 1)) << (16 - bbits);
+ while(bbits < 16) {
+ *blue |= *blue >> bbits;
+ bbits <<= 1;
+ }
+
+ if(abits) {
+ *alpha = ((pixel >> ashift ) & ((1 << abits) - 1)) << (16 - abits);
+ while(abits < 16) {
+ *alpha |= *alpha >> abits;
+ abits <<= 1;
+ }
+ } else *alpha = 0xffff;
+
+ return TRUE;
+}
+
+/* 8:8:8 + PICT_a8 -> 8:8:8:8 texture */
+
+void
+XAA_888_plus_PICT_a8_to_8888 (
+ CARD32 color,
+ CARD8 *alphaPtr, /* in bytes */
+ int alphaPitch,
+ CARD32 *dstPtr,
+ int dstPitch, /* in dwords */
+ int width,
+ int height
+){
+ int x;
+
+ color &= 0x00ffffff;
+
+ while(height--) {
+ for(x = 0; x < width; x++)
+ dstPtr[x] = color | (alphaPtr[x] << 24);
+ dstPtr += dstPitch;
+ alphaPtr += alphaPitch;
+ }
+}
+
+Bool
+XAADoComposite (
+ CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height
+){
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ RegionRec region;
+ CARD32 *formats;
+ int flags = 0;
+ BoxPtr pbox;
+ int nbox, w, h;
+
+ if(!REGION_NUM_RECTS(pDst->pCompositeClip))
+ return TRUE;
+
+ if(!infoRec->pScrn->vtSema ||
+ ((pDst->pDrawable->type != DRAWABLE_WINDOW) &&
+ !IS_OFFSCREEN_PIXMAP(pDst->pDrawable)))
+ return FALSE;
+
+ if((pSrc->pDrawable->type != DRAWABLE_PIXMAP) ||
+ IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
+ return FALSE;
+
+ if (pSrc->transform || (pMask && pMask->transform))
+ return FALSE;
+
+ if (pDst->alphaMap || pSrc->alphaMap || (pMask && pMask->alphaMap))
+ return FALSE;
+
+ xDst += pDst->pDrawable->x;
+ yDst += pDst->pDrawable->y;
+ xSrc += pSrc->pDrawable->x;
+ ySrc += pSrc->pDrawable->y;
+
+ if(pMask) {
+ /* for now we only do it if there is a 1x1 (solid) source */
+
+ if((pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1)) {
+ CARD16 red, green, blue, alpha;
+ CARD32 pixel =
+ *((CARD32*)(((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr));
+
+ if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
+ return FALSE;
+
+ xMask += pMask->pDrawable->x;
+ yMask += pMask->pDrawable->y;
+
+ /* pull out color expandable operations here */
+ if((pMask->format == PICT_a1) && (alpha == 0xffff) &&
+ (op == PictOpOver) && infoRec->WriteBitmap && !pMask->repeat &&
+ !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY) &&
+ (!(infoRec->WriteBitmapFlags & RGB_EQUAL) ||
+ ((red == green) && (green == blue))))
+ {
+ PixmapPtr pPix = (PixmapPtr)(pMask->pDrawable);
+ int skipleft;
+
+ if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height))
+ return TRUE;
+
+ nbox = REGION_NUM_RECTS(&region);
+ pbox = REGION_RECTS(&region);
+
+ if(!nbox)
+ return TRUE;
+
+ XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
+
+ xMask -= xDst;
+ yMask -= yDst;
+
+ while(nbox--) {
+ skipleft = pbox->x1 + xMask;
+
+ (*infoRec->WriteBitmap)(infoRec->pScrn,
+ pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ (unsigned char*)(pPix->devPrivate.ptr) +
+ (pPix->devKind * (pbox->y1 + yMask)) +
+ ((skipleft >> 3) & ~3), pPix->devKind,
+ skipleft & 31, pixel, -1, GXcopy, ~0);
+ pbox++;
+ }
+
+ /* WriteBitmap sets the Sync flag */
+ REGION_UNINIT(pScreen, &region);
+ return TRUE;
+ }
+
+ if(!(formats = infoRec->CPUToScreenAlphaTextureFormats))
+ return FALSE;
+
+ w = pMask->pDrawable->width;
+ h = pMask->pDrawable->height;
+
+ if(pMask->repeat) {
+ if((infoRec->CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_TILE) ||
+ ((infoRec->CPUToScreenAlphaTextureFlags &
+ XAA_RENDER_POWER_OF_2_TILE_ONLY) &&
+ ((h & (h - 1)) || (w & (w - 1)))))
+ {
+ return FALSE;
+ }
+ flags |= XAA_RENDER_REPEAT;
+ }
+
+ if((alpha != 0xffff) &&
+ (infoRec->CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_SRC_ALPHA))
+ return FALSE;
+
+ while(*formats != pMask->format) {
+ if(!(*formats)) return FALSE;
+ formats++;
+ }
+
+ if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height))
+ return TRUE;
+
+ nbox = REGION_NUM_RECTS(&region);
+ pbox = REGION_RECTS(&region);
+
+ if(!nbox) {
+ REGION_UNINIT(pScreen, &region);
+ return TRUE;
+ }
+
+ if(!(infoRec->SetupForCPUToScreenAlphaTexture)(infoRec->pScrn,
+ op, red, green, blue, alpha, pMask->format,
+ ((PixmapPtr)(pMask->pDrawable))->devPrivate.ptr,
+ ((PixmapPtr)(pMask->pDrawable))->devKind,
+ w, h, flags))
+ {
+ REGION_UNINIT(pScreen, &region);
+ return FALSE;
+ }
+
+ xMask -= xDst;
+ yMask -= yDst;
+
+ while(nbox--) {
+ (*infoRec->SubsequentCPUToScreenAlphaTexture)(infoRec->pScrn,
+ pbox->x1, pbox->y1,
+ pbox->x1 + xMask, pbox->y1 + yMask,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+ pbox++;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+ REGION_UNINIT(pScreen, &region);
+ return TRUE;
+ }
+ } else {
+ if(!(formats = infoRec->CPUToScreenTextureFormats))
+ return FALSE;
+
+ w = pSrc->pDrawable->width;
+ h = pSrc->pDrawable->height;
+
+ if(pSrc->repeat) {
+ if((infoRec->CPUToScreenTextureFlags & XAA_RENDER_NO_TILE) ||
+ ((infoRec->CPUToScreenTextureFlags &
+ XAA_RENDER_POWER_OF_2_TILE_ONLY) &&
+ ((h & (h - 1)) || (w & (w - 1)))))
+ {
+ return FALSE;
+ }
+ flags |= XAA_RENDER_REPEAT;
+ }
+
+
+ while(*formats != pSrc->format) {
+ if(!(*formats)) return FALSE;
+ formats++;
+ }
+
+ if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height))
+ return TRUE;
+
+ nbox = REGION_NUM_RECTS(&region);
+ pbox = REGION_RECTS(&region);
+
+ if(!nbox) {
+ REGION_UNINIT(pScreen, &region);
+ return TRUE;
+ }
+
+ if(!(infoRec->SetupForCPUToScreenTexture)(infoRec->pScrn,
+ op, pSrc->format,
+ ((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr,
+ ((PixmapPtr)(pSrc->pDrawable))->devKind,
+ w, h, flags))
+ {
+ REGION_UNINIT(pScreen, &region);
+ return FALSE;
+ }
+
+
+ xSrc -= xDst;
+ ySrc -= yDst;
+
+ while(nbox--) {
+ (*infoRec->SubsequentCPUToScreenTexture)(infoRec->pScrn,
+ pbox->x1, pbox->y1,
+ pbox->x1 + xSrc, pbox->y1 + ySrc,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+ pbox++;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+ REGION_UNINIT(pScreen, &region);
+ return TRUE;
+ }
+
+
+ return FALSE;
+}
+
+
+void
+XAAComposite (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ XAA_RENDER_PROLOGUE(pScreen, Composite);
+
+ if(!infoRec->Composite ||
+ !(*infoRec->Composite)(op, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height))
+ {
+ if(pSrc->pDrawable->type == DRAWABLE_WINDOW ||
+ pDst->pDrawable->type == DRAWABLE_WINDOW ||
+ IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) ||
+ IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) {
+ SYNC_CHECK(pDst->pDrawable);
+ }
+ (*GetPictureScreen(pScreen)->Composite) (op,
+ pSrc,
+ pMask,
+ pDst,
+ xSrc,
+ ySrc,
+ xMask,
+ yMask,
+ xDst,
+ yDst,
+ width,
+ height);
+ }
+
+ if(pDst->pDrawable->type == DRAWABLE_PIXMAP)
+ (XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDst->pDrawable)))->flags |= DIRTY;
+
+ XAA_RENDER_EPILOGUE(pScreen, Composite, XAAComposite);
+}
+
+Bool
+XAADoGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+
+ if(!REGION_NUM_RECTS(pDst->pCompositeClip))
+ return TRUE;
+
+ if(!infoRec->pScrn->vtSema ||
+ ((pDst->pDrawable->type != DRAWABLE_WINDOW) &&
+ !IS_OFFSCREEN_PIXMAP(pDst->pDrawable)))
+ return FALSE;
+
+ if((pSrc->pDrawable->type != DRAWABLE_PIXMAP) ||
+ IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))
+ return FALSE;
+
+ if(maskFormat && (maskFormat->depth == 1) &&
+ (pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1) &&
+ (op == PictOpOver) && infoRec->WriteBitmap &&
+ !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY))
+ {
+ CARD16 red, green, blue, alpha;
+ CARD32 pixel =
+ *((CARD32*)(((PixmapPtr)(pSrc->pDrawable))->devPrivate.ptr));
+ CARD32 *bits, *pntr, *pnt;
+ int x, y, i, n, left, top, right, bottom, width, height, pitch;
+ int L, T, R, B, X, Y, h, w, dwords, row, column, nbox;
+ int leftEdge, rightEdge, topLine, botLine;
+ BoxPtr pbox;
+ GlyphPtr glyph;
+
+ if(!XAAGetRGBAFromPixel(pixel,&red,&green,&blue,&alpha,pSrc->format))
+ return FALSE;
+
+ if(alpha != 0xffff) return FALSE;
+
+ XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format);
+
+ if((infoRec->WriteBitmapFlags & RGB_EQUAL) && !((red == green) && (green == blue)))
+ return FALSE;
+
+ x = pDst->pDrawable->x;
+ y = pDst->pDrawable->y;
+
+ while(nlist--) {
+ x += list->xOff;
+ y += list->yOff;
+ left = right = X = x;
+ top = bottom = Y = y;
+ for(i = 0; i < list->len; i++) {
+ glyph = glyphs[i];
+
+ L = X - glyph->info.x;
+ if(L < left) left = L;
+ R = L + glyph->info.width;
+ if(R > right) right = R;
+
+ T = Y - glyph->info.y;
+ if(T < top) top = T;
+ B = T + glyph->info.height;
+ if(B > bottom) bottom = B;
+
+ X += glyph->info.xOff;
+ Y += glyph->info.yOff;
+ }
+
+ width = right - left;
+ height = bottom - top;
+
+ if(width && height) {
+ pitch = (((width + 31) & ~31) >> 5) + 1;
+ pntr = (CARD32*)xalloc(sizeof(CARD32) * pitch * height);
+ if(!pntr)
+ return TRUE;
+ bzero(pntr, sizeof(CARD32) * pitch * height);
+ n = list->len;
+
+ X = x; Y = y;
+ while(n--) {
+ glyph = *glyphs++;
+ h = glyph->info.height;
+ w = glyph->info.width;
+ if(h && w) {
+ row = y - top - glyph->info.y;
+ column = x - left - glyph->info.x;
+ pnt = pntr + (row * pitch) + (column >> 5);
+ column &= 31;
+ dwords = ((w + 31) >> 5) - 1;
+ bits = (CARD32*)(glyph + 1);
+ if(dwords) {
+ while(h--) {
+ for(i = 0; i <= dwords; i++) {
+ if(column) {
+ pnt[i] |= SHIFT_L(*bits, column);
+ pnt[i + 1] |= SHIFT_R(*bits, 32 - column);
+ } else
+ pnt[i] |= *bits;
+
+ if(i != dwords) bits++;
+ }
+ bits++;
+ pnt += pitch;
+ }
+ } else {
+ if(column) {
+ while(h--) {
+ pnt[0] |= SHIFT_L(*bits, column);
+ pnt[0 + 1] |= SHIFT_R(*bits, 32 - column);
+ bits++;
+ pnt += pitch;
+ }
+ } else {
+ while(h--) {
+ *pnt |= *bits++;
+ pnt += pitch;
+ }
+ }
+ }
+ }
+ x += glyph->info.xOff;
+ y += glyph->info.yOff;
+ }
+
+ nbox = REGION_NUM_RECTS(pDst->pCompositeClip);
+ pbox = REGION_RECTS(pDst->pCompositeClip);
+
+ while(nbox && (top >= pbox->y2)) {
+ pbox++; nbox--;
+ }
+
+ while(nbox && (bottom > pbox->y1)) {
+ leftEdge = max(left, pbox->x1);
+ rightEdge = min(right, pbox->x2);
+
+ if(rightEdge > leftEdge) {
+ column = leftEdge - left;
+ topLine = max(top, pbox->y1);
+ botLine = min(bottom, pbox->y2);
+ h = botLine - topLine;
+
+ if(h > 0) {
+ (*infoRec->WriteBitmap)(infoRec->pScrn,
+ leftEdge, topLine, rightEdge - leftEdge, h,
+ (unsigned char*)(pntr +
+ ((topLine - top) * pitch) + (column >> 5)),
+ pitch << 2, column & 31, pixel, -1, GXcopy, ~0);
+ }
+ }
+ nbox--; pbox++;
+ }
+ xfree(pntr);
+ } else {
+ x = X; y = Y;
+ }
+ list++;
+ }
+
+ return TRUE;
+ }
+
+ /*
+ * If it looks like we have a chance of being able to draw these
+ * glyphs with an accelerated Composite, do that now to avoid
+ * unneeded and costly syncs.
+ */
+ if(maskFormat) {
+ if(!infoRec->CPUToScreenAlphaTextureFormats)
+ return FALSE;
+ } else {
+ if(!infoRec->CPUToScreenTextureFormats)
+ return FALSE;
+ }
+
+ miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
+
+ return TRUE;
+}
+
+
+void
+XAAGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs)
+{
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
+ XAA_RENDER_PROLOGUE(pScreen, Glyphs);
+
+ if(!infoRec->Glyphs ||
+ !(*infoRec->Glyphs)(op, pSrc, pDst, maskFormat,
+ xSrc, ySrc, nlist, list, glyphs))
+ {
+ if((pSrc->pDrawable->type == DRAWABLE_WINDOW) ||
+ (pDst->pDrawable->type == DRAWABLE_WINDOW) ||
+ IS_OFFSCREEN_PIXMAP(pSrc->pDrawable) ||
+ IS_OFFSCREEN_PIXMAP(pDst->pDrawable)) {
+ SYNC_CHECK(pDst->pDrawable);
+ }
+ (*GetPictureScreen(pScreen)->Glyphs) (op, pSrc, pDst, maskFormat,
+ xSrc, ySrc, nlist, list, glyphs);
+ }
+
+ if(pDst->pDrawable->type == DRAWABLE_PIXMAP)
+ (XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDst->pDrawable)))->flags |= DIRTY;
+
+ XAA_RENDER_EPILOGUE(pScreen, Glyphs, XAAGlyphs);
+}
diff --git a/hw/xfree86/xaa/xaaROP.c b/hw/xfree86/xaa/xaaROP.c
new file mode 100644
index 000000000..4075bab6a
--- /dev/null
+++ b/hw/xfree86/xaa/xaaROP.c
@@ -0,0 +1,164 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaROP.c,v 1.2 2000/09/28 20:48:01 mvojkovi Exp $ */
+
+#include "X.h"
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "scrnintstr.h"
+#include "xf86str.h"
+#include "xaarop.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+
+int XAACopyROP[16] =
+{
+ ROP_0, /* GXclear */
+ ROP_DSa, /* GXand */
+ ROP_SDna, /* GXandReverse */
+ ROP_S, /* GXcopy */
+ ROP_DSna, /* GXandInverted */
+ ROP_D, /* GXnoop */
+ ROP_DSx, /* GXxor */
+ ROP_DSo, /* GXor */
+ ROP_DSon, /* GXnor */
+ ROP_DSxn, /* GXequiv */
+ ROP_Dn, /* GXinvert*/
+ ROP_SDno, /* GXorReverse */
+ ROP_Sn, /* GXcopyInverted */
+ ROP_DSno, /* GXorInverted */
+ ROP_DSan, /* GXnand */
+ ROP_1 /* GXset */
+};
+
+int XAACopyROP_PM[16] =
+{
+ ROP_0, /* not used */
+ ROP_DSPnoa,
+ ROP_DPSnaon,
+ ROP_DPSDxax,
+ ROP_DPSana,
+ ROP_D, /* not used */
+ ROP_DPSax,
+ ROP_DPSao,
+ ROP_DPSaon,
+ ROP_DPSaxn,
+ ROP_Dn, /* not used */
+ ROP_DPSanan,
+ ROP_PSDPxox, /* is that correct ? */
+ ROP_DPSnao,
+ ROP_DSPnoan,
+ ROP_1 /* not used */
+};
+
+
+int XAAPatternROP[16]=
+{
+ ROP_0,
+ ROP_DPa,
+ ROP_PDna,
+ ROP_P,
+ ROP_DPna,
+ ROP_D,
+ ROP_DPx,
+ ROP_DPo,
+ ROP_DPon,
+ ROP_PDxn,
+ ROP_Dn,
+ ROP_PDno,
+ ROP_Pn,
+ ROP_DPno,
+ ROP_DPan,
+ ROP_1
+};
+
+int XAAPatternROP_PM[16] =
+{
+ ROP_DPna,
+ ROP_DPSnoa,
+ ROP_DSPnaon,
+ ROP_DSPDxax,
+ ROP_DPSana,
+ ROP_D,
+ ROP_DPSax,
+ ROP_DPSao,
+ ROP_DPSaon,
+ ROP_DPSaxn,
+ ROP_DPx,
+ ROP_DPSanan,
+ ROP_SPDSxox, /* is that correct ? */
+ ROP_DSPnao,
+ ROP_DPSnoan,
+ ROP_DPo
+};
+
+
+int
+XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int ret = 0;
+
+ pm &= infoRec->FullPlanemasks[pScrn->depth - 1];
+
+ if(pm == infoRec->FullPlanemasks[pScrn->depth - 1]) {
+ if(!NO_SRC_ROP(*rop))
+ ret |= ROP_PAT;
+ *rop = XAAPatternROP[*rop];
+ } else {
+ switch(*rop) {
+ case GXnoop:
+ break;
+ case GXset:
+ case GXclear:
+ case GXinvert:
+ ret |= ROP_PAT;
+ *fg = pm;
+ if(*bg != -1)
+ *bg = pm;
+ break;
+ default:
+ ret |= ROP_PAT | ROP_SRC;
+ break;
+ }
+ *rop = XAAPatternROP_PM[*rop];
+ }
+
+ return ret;
+}
+
+
+int
+XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int ret = 0;
+
+ pm &= infoRec->FullPlanemasks[pScrn->depth - 1];
+
+ if(pm == infoRec->FullPlanemasks[pScrn->depth - 1]) {
+ if(!NO_SRC_ROP(*rop))
+ ret |= ROP_PAT;
+ *rop = XAAPatternROP[*rop];
+ } else {
+ switch(*rop) {
+ case GXnoop:
+ break;
+ case GXset:
+ case GXclear:
+ case GXinvert:
+ ret |= ROP_PAT;
+ *fg = pm;
+ break;
+ default:
+ ret |= ROP_PAT | ROP_SRC;
+ break;
+ }
+ *rop = XAAPatternROP_PM[*rop];
+ }
+
+ return ret;
+}
+
diff --git a/hw/xfree86/xaa/xaaRect.c b/hw/xfree86/xaa/xaaRect.c
new file mode 100644
index 000000000..fe8d70de2
--- /dev/null
+++ b/hw/xfree86/xaa/xaaRect.c
@@ -0,0 +1,134 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaRect.c,v 1.3 1999/05/30 03:03:33 dawes Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+/*
+ Much of this file based on code by
+ Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
+*/
+
+
+void
+XAAPolyRectangleThinSolid(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int nClipRects; /* number of clip rectangles */
+ BoxPtr pClipRects; /* points to the list of clip rects */
+ int xOrigin; /* Drawables x origin */
+ int yOrigin; /* Drawables x origin */
+ xRectangle *pRect; /* list of rects */
+ int nRects; /* running count of number of rects */
+ int origX1, origY1; /* original rectangle's U/L corner */
+ int origX2, origY2; /* original rectangle's L/R corner */
+ int clippedX1; /* clipped rectangle's left x */
+ int clippedY1; /* clipped rectangle's top y */
+ int clippedX2; /* clipped rectangle's right x */
+ int clippedY2; /* clipped rectangle's bottom y */
+ int clipXMin; /* upper left corner of clip rect */
+ int clipYMin; /* upper left corner of clip rect */
+ int clipXMax; /* lower right corner of clip rect */
+ int clipYMax; /* lower right corner of clip rect */
+ int width, height; /* width and height of rect */
+
+ nClipRects = REGION_NUM_RECTS(pGC->pCompositeClip);
+ pClipRects = REGION_RECTS(pGC->pCompositeClip);
+
+ if(!nClipRects) return;
+
+ xOrigin = pDrawable->x;
+ yOrigin = pDrawable->y;
+
+
+ (*infoRec->SetupForSolidLine)(infoRec->pScrn,
+ pGC->fgPixel, pGC->alu, pGC->planemask);
+
+
+ for ( ; nClipRects > 0;
+ nClipRects--, pClipRects++ )
+ {
+ clipYMin = pClipRects->y1;
+ clipYMax = pClipRects->y2 - 1;
+ clipXMin = pClipRects->x1;
+ clipXMax = pClipRects->x2 - 1;
+
+ for (pRect = pRectsInit, nRects = nRectsInit;
+ nRects > 0;
+ nRects--, pRect++ )
+ {
+ /* translate rectangle data over to the drawable */
+ origX1 = pRect->x + xOrigin;
+ origY1 = pRect->y + yOrigin;
+ origX2 = origX1 + pRect->width;
+ origY2 = origY1 + pRect->height;
+
+ /* reject entire rectangle if completely outside clip rect */
+ if ((origX1 > clipXMax) || (origX2 < clipXMin) ||
+ (origY1 > clipYMax) || (origY2 < clipYMin))
+ continue;
+
+ /* clip the rectangle */
+ clippedX1 = max (origX1, clipXMin);
+ clippedX2 = min (origX2, clipXMax);
+ clippedY1 = max (origY1, clipYMin);
+ clippedY2 = min (origY2, clipYMax);
+
+ width = clippedX2 - clippedX1 + 1;
+
+ if (origY1 >= clipYMin) {
+ (*infoRec->SubsequentSolidHorVertLine)(infoRec->pScrn,
+ clippedX1, clippedY1, width, DEGREES_0);
+
+ /* don't overwrite corner */
+ clippedY1++;
+ }
+
+ if ((origY2 <= clipYMax) && (origY1 != origY2)) {
+ (*infoRec->SubsequentSolidHorVertLine)(infoRec->pScrn,
+ clippedX1, clippedY2, width, DEGREES_0);
+
+ /* don't overwrite corner */
+ clippedY2--;
+ }
+
+ if (clippedY2 < clippedY1) continue;
+
+ height = clippedY2 - clippedY1 + 1;
+
+ /* draw vertical edges using lines if not clipped out */
+ if (origX1 >= clipXMin)
+ (*infoRec->SubsequentSolidHorVertLine)(infoRec->pScrn,
+ clippedX1, clippedY1, height, DEGREES_270);
+
+ if ((origX2 <= clipXMax) && (origX2 != origX1))
+ (*infoRec->SubsequentSolidHorVertLine)(infoRec->pScrn,
+ clippedX2, clippedY1, height, DEGREES_270);
+ }
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hw/xfree86/xaa/xaaSpans.c b/hw/xfree86/xaa/xaaSpans.c
new file mode 100644
index 000000000..522225665
--- /dev/null
+++ b/hw/xfree86/xaa/xaaSpans.c
@@ -0,0 +1,880 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaSpans.c,v 1.15 2001/10/28 03:34:04 tsi Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "xf86str.h"
+#include "mi.h"
+#include "mispans.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+
+static void XAARenderSolidSpans(
+ GCPtr, int, DDXPointPtr, int*, int, int, int);
+static void XAARenderColor8x8Spans(
+ GCPtr, int, DDXPointPtr, int*, int, int, int);
+static void XAARenderMono8x8Spans(
+ GCPtr, int, DDXPointPtr, int*, int, int, int);
+static void XAARenderCacheBltSpans(
+ GCPtr, int, DDXPointPtr, int*, int, int, int);
+static void XAARenderColorExpandSpans(
+ GCPtr, int, DDXPointPtr, int*, int, int, int);
+static void XAARenderCacheExpandSpans(
+ GCPtr, int, DDXPointPtr, int*, int, int, int);
+static void XAARenderPixmapCopySpans(
+ GCPtr, int, DDXPointPtr, int*, int, int, int);
+
+void
+XAAFillSpans(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit, /* number of spans to fill */
+ DDXPointPtr pptInit, /* pointer to list of start points */
+ int *pwidthInit, /* pointer to list of n widths */
+ int fSorted
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int type = 0;
+ ClipAndRenderSpansFunc function;
+ Bool fastClip = FALSE;
+
+ if((nInit <= 0) || !pGC->planemask)
+ return;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ switch(pGC->fillStyle) {
+ case FillSolid:
+ type = DO_SOLID;
+ break;
+ case FillStippled:
+ type = (*infoRec->StippledFillChooser)(pGC);
+ break;
+ case FillOpaqueStippled:
+ if((pGC->fgPixel == pGC->bgPixel) && infoRec->FillSpansSolid &&
+ CHECK_PLANEMASK(pGC,infoRec->FillSpansSolidFlags) &&
+ CHECK_ROP(pGC,infoRec->FillSpansSolidFlags) &&
+ CHECK_ROPSRC(pGC,infoRec->FillSpansSolidFlags) &&
+ CHECK_FG(pGC,infoRec->FillSpansSolidFlags))
+ type = DO_SOLID;
+ else
+ type = (*infoRec->OpaqueStippledFillChooser)(pGC);
+ break;
+ case FillTiled:
+ type = (*infoRec->TiledFillChooser)(pGC);
+ break;
+ }
+
+ switch(type) {
+ case DO_SOLID:
+ function = XAARenderSolidSpans;
+ if(infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL)
+ fastClip = TRUE;
+ break;
+ case DO_COLOR_8x8:
+ function = XAARenderColor8x8Spans;
+ if(infoRec->ClippingFlags & HARDWARE_CLIP_COLOR_8x8_FILL)
+ fastClip = TRUE;
+ break;
+ case DO_MONO_8x8:
+ function = XAARenderMono8x8Spans;
+ if(infoRec->ClippingFlags & HARDWARE_CLIP_MONO_8x8_FILL)
+ fastClip = TRUE;
+ break;
+ case DO_CACHE_BLT:
+ function = XAARenderCacheBltSpans;
+ if(infoRec->ClippingFlags & HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY)
+ fastClip = TRUE;
+ break;
+ case DO_COLOR_EXPAND:
+ function = XAARenderColorExpandSpans;
+ break;
+ case DO_CACHE_EXPAND:
+ function = XAARenderCacheExpandSpans;
+ if(infoRec->ClippingFlags &
+ HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND)
+ fastClip = TRUE;
+ break;
+ case DO_PIXMAP_COPY:
+ function = XAARenderPixmapCopySpans;
+ if(infoRec->ClippingFlags & HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY)
+ fastClip = TRUE;
+ break;
+ case DO_IMAGE_WRITE:
+ default:
+ (*XAAFallbackOps.FillSpans)(pDraw, pGC, nInit, pptInit,
+ pwidthInit, fSorted);
+ return;
+ }
+
+
+ if((nInit < 10) || (REGION_NUM_RECTS(pGC->pCompositeClip) != 1))
+ fastClip = FALSE;
+
+ if(fastClip) {
+ infoRec->ClipBox = &pGC->pCompositeClip->extents;
+ (*function)(pGC, nInit, pptInit, pwidthInit, fSorted,
+ pDraw->x, pDraw->y);
+ infoRec->ClipBox = NULL;
+ } else
+ XAAClipAndRenderSpans(pGC, pptInit, pwidthInit, nInit, fSorted,
+ function, pDraw->x, pDraw->y);
+}
+
+
+ /*********************\
+ | Solid Spans |
+ \*********************/
+
+
+static void
+XAARenderSolidSpans(
+ GCPtr pGC,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ (*infoRec->FillSolidSpans) (infoRec->pScrn, pGC->fgPixel,
+ pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted);
+}
+
+
+ /************************\
+ | Mono 8x8 Spans |
+ \************************/
+
+
+static void
+XAARenderMono8x8Spans(
+ GCPtr pGC,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAAPixmapPtr pPriv;
+ int fg, bg;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+ fg = pGC->fgPixel; bg = -1;
+ break;
+ case FillOpaqueStippled:
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple);
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ break;
+ case FillTiled:
+ pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+ fg = pPriv->fg; bg = pPriv->bg;
+ break;
+ default: /* Muffle compiler */
+ pPriv = NULL; /* Kaboom */
+ fg = -1; bg = -1;
+ break;
+ }
+
+ (*infoRec->FillMono8x8PatternSpans) (infoRec->pScrn,
+ fg, bg, pGC->alu, pGC->planemask,
+ n, ppt, pwidth, fSorted, pPriv->pattern0, pPriv->pattern1,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y));
+}
+
+
+ /*************************\
+ | Color 8x8 Spans |
+ \*************************/
+
+
+static void
+XAARenderColor8x8Spans(
+ GCPtr pGC,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAACacheInfoPtr pCache;
+ PixmapPtr pPix;
+ int fg, bg;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ pPix = pGC->stipple;
+ fg = pGC->fgPixel; bg = -1;
+ break;
+ case FillOpaqueStippled:
+ pPix = pGC->stipple;
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ break;
+ case FillTiled:
+ pPix = pGC->tile.pixmap;
+ fg = -1; bg = -1;
+ break;
+ default: /* Muffle compiler */
+ pPix = NULL;
+ fg = -1; bg = -1;
+ break;
+ }
+
+ pCache = (*infoRec->CacheColor8x8Pattern)(infoRec->pScrn, pPix, fg, bg);
+
+ (*infoRec->FillColor8x8PatternSpans) (infoRec->pScrn,
+ pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted, pCache,
+ (yorg + pGC->patOrg.x), (xorg + pGC->patOrg.y));
+}
+
+
+ /****************************\
+ | Color Expand Spans |
+ \****************************/
+
+
+static void
+XAARenderColorExpandSpans(
+ GCPtr pGC,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int fg, bg;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ fg = pGC->fgPixel; bg = -1;
+ break;
+ case FillOpaqueStippled:
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ break;
+ default: /* Muffle compiler */
+ fg = -1; bg = -1;
+ break;
+ }
+
+ (*infoRec->FillColorExpandSpans) (infoRec->pScrn, fg, bg,
+ pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
+ pGC->stipple);
+
+}
+
+
+ /*************************\
+ | Cache Blt Spans |
+ \*************************/
+
+
+static void
+XAARenderCacheBltSpans(
+ GCPtr pGC,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAACacheInfoPtr pCache;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
+ pGC->fgPixel, -1);
+ break;
+ case FillOpaqueStippled:
+ pCache = (*infoRec->CacheStipple)(infoRec->pScrn, pGC->stipple,
+ pGC->fgPixel, pGC->bgPixel);
+ break;
+ case FillTiled:
+ pCache = (*infoRec->CacheTile)(infoRec->pScrn, pGC->tile.pixmap);
+ break;
+ default: /* Muffle compiler */
+ pCache = NULL;
+ break;
+ }
+
+ (*infoRec->FillCacheBltSpans) (infoRec->pScrn,
+ pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted, pCache,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y));
+
+}
+
+
+ /****************************\
+ | Cache Expand Spans |
+ \****************************/
+
+
+static void
+XAARenderCacheExpandSpans(
+ GCPtr pGC,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int fg, bg;
+
+ switch(pGC->fillStyle) {
+ case FillStippled:
+ fg = pGC->fgPixel; bg = -1;
+ break;
+ case FillOpaqueStippled:
+ fg = pGC->fgPixel; bg = pGC->bgPixel;
+ break;
+ default: /* Muffle compiler */
+ fg = -1; bg = -1;
+ break;
+ }
+
+ (*infoRec->FillCacheExpandSpans) (infoRec->pScrn, fg, bg,
+ pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y),
+ pGC->stipple);
+}
+
+
+ /***************************\
+ | Pixmap Copy Spans |
+ \***************************/
+
+
+static void
+XAARenderPixmapCopySpans(
+ GCPtr pGC,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec);
+ XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap);
+
+ pCache->x = pPriv->offscreenArea->box.x1;
+ pCache->y = pPriv->offscreenArea->box.y1;
+ pCache->w = pCache->orig_w =
+ pPriv->offscreenArea->box.x2 - pCache->x;
+ pCache->h = pCache->orig_h =
+ pPriv->offscreenArea->box.y2 - pCache->y;
+ pCache->trans_color = -1;
+
+ (*infoRec->FillCacheBltSpans) (infoRec->pScrn,
+ pGC->alu, pGC->planemask, n, ppt, pwidth, fSorted, pCache,
+ (xorg + pGC->patOrg.x), (yorg + pGC->patOrg.y));
+}
+
+
+
+
+
+ /****************\
+ | Solid |
+ \****************/
+
+
+void
+XAAFillSolidSpans(
+ ScrnInfoPtr pScrn,
+ int fg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+
+ (*infoRec->SetupForSolidFill)(pScrn, fg, rop, planemask);
+
+ if(infoRec->ClipBox)
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ infoRec->ClipBox->x1, infoRec->ClipBox->y1,
+ infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
+
+ while(n--) {
+ if (*pwidth > 0)
+ (*infoRec->SubsequentSolidFillRect)(pScrn, ppt->x, ppt->y,
+ *pwidth, 1);
+ ppt++; pwidth++;
+ }
+
+ if(infoRec->ClipBox)
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+ /***************\
+ | Mono 8x8 |
+ \***************/
+
+
+void
+XAAFillMono8x8PatternSpansScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted,
+ int pattern0, int pattern1,
+ int xorigin, int yorigin
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int patx = pattern0, paty = pattern1;
+ int xorg = (-xorigin) & 0x07;
+ int yorg = (-yorigin) & 0x07;
+
+
+ if(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) {
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ XAARotateMonoPattern(&patx, &paty, xorg, yorg,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ xorg = patx; yorg = paty;
+ }
+ } else {
+ XAACacheInfoPtr pCache =
+ (*infoRec->CacheMono8x8Pattern)(pScrn, pattern0, pattern1);
+ patx = pCache->x; paty = pCache->y;
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ int slot = (yorg << 3) + xorg;
+ patx += pCache->offsets[slot].x;
+ paty += pCache->offsets[slot].y;
+ xorg = patx; yorg = paty;
+ }
+ }
+
+ (*infoRec->SetupForMono8x8PatternFill)(pScrn, patx, paty,
+ fg, bg, rop, planemask);
+
+ if(infoRec->ClipBox)
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ infoRec->ClipBox->x1, infoRec->ClipBox->y1,
+ infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
+
+ while(n--) {
+ (*infoRec->SubsequentMono8x8PatternFillRect)(pScrn,
+ xorg, yorg, ppt->x, ppt->y, *pwidth, 1);
+ ppt++; pwidth++;
+ }
+
+ if(infoRec->ClipBox)
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+void
+XAAFillMono8x8PatternSpans(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted,
+ int pattern0, int pattern1,
+ int xorigin, int yorigin
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int patx = pattern0, paty = pattern1;
+ int xorg, yorg, slot;
+ XAACacheInfoPtr pCache = NULL;
+
+
+ if(!(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS)){
+ pCache = (*infoRec->CacheMono8x8Pattern)(pScrn, pattern0, pattern1);
+ patx = pCache->x; paty = pCache->y;
+ }
+
+ (*infoRec->SetupForMono8x8PatternFill)(pScrn, patx, paty,
+ fg, bg, rop, planemask);
+
+ if(infoRec->ClipBox)
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ infoRec->ClipBox->x1, infoRec->ClipBox->y1,
+ infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
+
+ while(n--) {
+ xorg = (ppt->x - xorigin) & 0x07;
+ yorg = (ppt->y - yorigin) & 0x07;
+
+ if(!(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ if(infoRec->Mono8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_BITS) {
+ patx = pattern0; paty = pattern1;
+ XAARotateMonoPattern(&patx, &paty, xorg, yorg,
+ (infoRec->Mono8x8PatternFillFlags &
+ BIT_ORDER_IN_BYTE_MSBFIRST));
+ xorg = patx; yorg = paty;
+ } else {
+ slot = (yorg << 3) + xorg;
+ xorg = patx + pCache->offsets[slot].x;
+ yorg = paty + pCache->offsets[slot].y;
+ }
+ }
+
+ (*infoRec->SubsequentMono8x8PatternFillRect)(pScrn,
+ xorg, yorg, ppt->x, ppt->y, *pwidth, 1);
+ ppt++; pwidth++;
+ }
+
+ if(infoRec->ClipBox)
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+
+ /****************\
+ | Color 8x8 |
+ \****************/
+
+
+void
+XAAFillColor8x8PatternSpansScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted,
+ XAACacheInfoPtr pCache,
+ int xorigin, int yorigin
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int patx = pCache->x, paty = pCache->y;
+ int xorg = (-xorigin) & 0x07;
+ int yorg = (-yorigin) & 0x07;
+
+
+ if(!(infoRec->Color8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ int slot = (yorg << 3) + xorg;
+ paty += pCache->offsets[slot].y;
+ patx += pCache->offsets[slot].x;
+ xorg = patx; yorg = paty;
+ }
+
+ (*infoRec->SetupForColor8x8PatternFill)(pScrn, patx, paty,
+ rop, planemask, pCache->trans_color);
+
+ if(infoRec->ClipBox)
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ infoRec->ClipBox->x1, infoRec->ClipBox->y1,
+ infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
+
+ while(n--) {
+ (*infoRec->SubsequentColor8x8PatternFillRect)(pScrn,
+ xorg, yorg, ppt->x, ppt->y, *pwidth, 1);
+ ppt++; pwidth++;
+ }
+
+ if(infoRec->ClipBox)
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+void
+XAAFillColor8x8PatternSpans(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted,
+ XAACacheInfoPtr pCache,
+ int xorigin, int yorigin
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int xorg, yorg, slot;
+
+ (*infoRec->SetupForColor8x8PatternFill)(pScrn, pCache->x, pCache->y,
+ rop, planemask, pCache->trans_color);
+
+ if(infoRec->ClipBox)
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ infoRec->ClipBox->x1, infoRec->ClipBox->y1,
+ infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
+
+ while(n--) {
+ xorg = (ppt->x - xorigin) & 0x07;
+ yorg = (ppt->y - yorigin) & 0x07;
+
+ if(!(infoRec->Color8x8PatternFillFlags &
+ HARDWARE_PATTERN_PROGRAMMED_ORIGIN)){
+ slot = (yorg << 3) + xorg;
+ yorg = pCache->y + pCache->offsets[slot].y;
+ xorg = pCache->x + pCache->offsets[slot].x;
+ }
+
+ (*infoRec->SubsequentColor8x8PatternFillRect)(pScrn,
+ xorg, yorg, ppt->x, ppt->y, *pwidth, 1);
+ ppt++; pwidth++;
+ }
+
+ if(infoRec->ClipBox)
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+ /*****************\
+ | Cache Blit |
+ \*****************/
+
+
+void
+XAAFillCacheBltSpans(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ XAACacheInfoPtr pCache,
+ int xorg, int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int x, w, phaseX, phaseY, blit_w;
+
+ (*infoRec->SetupForScreenToScreenCopy)(pScrn, 1, 1, rop, planemask,
+ pCache->trans_color);
+
+ if(infoRec->ClipBox)
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ infoRec->ClipBox->x1, infoRec->ClipBox->y1,
+ infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
+
+ while(n--) {
+ x = ppt->x;
+ w = *pwidth;
+ phaseX = (x - xorg) % pCache->orig_w;
+ if(phaseX < 0) phaseX += pCache->orig_w;
+ phaseY = (ppt->y - yorg) % pCache->orig_h;
+ if(phaseY < 0) phaseY += pCache->orig_h;
+
+ while(1) {
+ blit_w = pCache->w - phaseX;
+ if(blit_w > w) blit_w = w;
+
+ (*infoRec->SubsequentScreenToScreenCopy)(pScrn,
+ pCache->x + phaseX, pCache->y + phaseY,
+ x, ppt->y, blit_w, 1);
+
+ w -= blit_w;
+ if(!w) break;
+ x += blit_w;
+ phaseX = (phaseX + blit_w) % pCache->orig_w;
+ }
+ ppt++; pwidth++;
+ }
+
+ if(infoRec->ClipBox)
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+ /****************\
+ | Cache Expand |
+ \****************/
+
+
+void
+XAAFillCacheExpandSpans(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int x, w, phaseX, phaseY, blit_w, cacheWidth;
+ XAACacheInfoPtr pCache;
+
+ pCache = (*infoRec->CacheMonoStipple)(pScrn, pPix);
+
+ cacheWidth = (pCache->w * pScrn->bitsPerPixel) /
+ infoRec->CacheColorExpandDensity;
+
+ (*infoRec->SetupForScreenToScreenColorExpandFill)(pScrn, fg, bg, rop,
+ planemask);
+
+ if(infoRec->ClipBox)
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ infoRec->ClipBox->x1, infoRec->ClipBox->y1,
+ infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
+
+ while(n--) {
+ x = ppt->x;
+ w = *pwidth;
+ phaseX = (x - xorg) % pCache->orig_w;
+ if(phaseX < 0) phaseX += pCache->orig_w;
+ phaseY = (ppt->y - yorg) % pCache->orig_h;
+ if(phaseY < 0) phaseY += pCache->orig_h;
+
+ while(1) {
+ blit_w = cacheWidth - phaseX;
+ if(blit_w > w) blit_w = w;
+
+ (*infoRec->SubsequentScreenToScreenColorExpandFill)(
+ pScrn, x, ppt->y, blit_w, 1,
+ pCache->x, pCache->y + phaseY, phaseX);
+
+ w -= blit_w;
+ if(!w) break;
+ x += blit_w;
+ phaseX = (phaseX + blit_w) % pCache->orig_w;
+ }
+ ppt++; pwidth++;
+ }
+
+ if(infoRec->ClipBox)
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+
+
+void
+XAAClipAndRenderSpans(
+ GCPtr pGC,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted,
+ ClipAndRenderSpansFunc func,
+ int xorg,
+ int yorg
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ DDXPointPtr pptNew, pptBase;
+ int *pwidthBase, *pwidthNew;
+ int Right, numRects, MaxBoxes;
+
+ MaxBoxes = infoRec->PreAllocSize/(sizeof(DDXPointRec) + sizeof(int));
+ pptBase = (DDXPointRec*)infoRec->PreAllocMem;
+ pwidthBase = (int*)(&pptBase[MaxBoxes]);
+
+ pptNew = pptBase;
+ pwidthNew = pwidthBase;
+
+ numRects = REGION_NUM_RECTS(pGC->pCompositeClip);
+
+ if(numRects == 1) {
+ BoxPtr pextent = REGION_RECTS(pGC->pCompositeClip);
+
+ while(nspans--) {
+ if ((pextent->y1 <= ppt->y) && (ppt->y < pextent->y2)) {
+ pptNew->x = max(pextent->x1, ppt->x);
+ Right = ppt->x + *pwidth;
+ *pwidthNew = min(pextent->x2, Right) - pptNew->x;
+
+ if (*pwidthNew > 0) {
+ pptNew->y = ppt->y;
+ pptNew++;
+ pwidthNew++;
+
+ if(pptNew >= (pptBase + MaxBoxes)) {
+ (*func)(pGC, MaxBoxes, pptBase, pwidthBase, fSorted,
+ xorg, yorg);
+ pptNew = pptBase;
+ pwidthNew = pwidthBase;
+ }
+ }
+ }
+ ppt++;
+ pwidth++;
+ }
+ } else if (numRects) {
+ BoxPtr pbox;
+ int nbox;
+
+ while(nspans--) {
+ nbox = numRects;
+ pbox = REGION_RECTS(pGC->pCompositeClip);
+
+ /* find the first band */
+ while(nbox && (pbox->y2 <= ppt->y)) {
+ pbox++;
+ nbox--;
+ }
+
+ if(nbox && (pbox->y1 <= ppt->y)) {
+ int orig_y = pbox->y1;
+ Right = ppt->x + *pwidth;
+ while(nbox && (orig_y == pbox->y1)) {
+ if(pbox->x2 <= ppt->x) {
+ nbox--;
+ pbox++;
+ continue;
+ }
+
+ if(pbox->x1 >= Right) {
+ nbox = 0;
+ break;
+ }
+
+ pptNew->x = max(pbox->x1, ppt->x);
+ *pwidthNew = min(pbox->x2, Right) - pptNew->x;
+ if(*pwidthNew > 0) {
+ pptNew->y = ppt->y;
+ pptNew++;
+ pwidthNew++;
+
+ if(pptNew >= (pptBase + MaxBoxes)) {
+ (*func)(pGC, MaxBoxes, pptBase, pwidthBase,
+ fSorted, xorg, yorg);
+ pptNew = pptBase;
+ pwidthNew = pwidthBase;
+ }
+ }
+ pbox++;
+ nbox--;
+ }
+ }
+ ppt++;
+ pwidth++;
+ }
+ }
+
+ if(pptNew != pptBase)
+ (*func)(pGC, pptNew - pptBase, pptBase, pwidthBase, fSorted,
+ xorg, yorg);
+}
diff --git a/hw/xfree86/xaa/xaaStateChange.c b/hw/xfree86/xaa/xaaStateChange.c
new file mode 100644
index 000000000..512c6a260
--- /dev/null
+++ b/hw/xfree86/xaa/xaaStateChange.c
@@ -0,0 +1,1677 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStateChange.c,v 3.2 2003/02/04 01:44:07 dawes Exp $ */
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "mi.h"
+#include "miline.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaawrap.h"
+#include "servermd.h"
+
+#define XAA_STATE_WRAP(func) do {\
+if(infoRec->func) { \
+ pStatePriv->func = infoRec->func;\
+ infoRec->func = XAAStateWrap##func;\
+}} while(0)
+
+/* Wrap all XAA functions and allocate our private structure.
+ */
+
+typedef struct _XAAStateWrapRec {
+ ScrnInfoPtr pScrn;
+ void (*RestoreAccelState)(ScrnInfoPtr pScrn);
+ void (*Sync)(ScrnInfoPtr pScrn);
+ void (*SetupForScreenToScreenCopy)(ScrnInfoPtr pScrn, int xdir, int ydir,
+ int rop, unsigned int planemask,
+ int trans_color);
+ void (*SetupForSolidFill)(ScrnInfoPtr pScrn, int color, int rop,
+ unsigned int planemask);
+ void (*SetupForSolidLine)(ScrnInfoPtr pScrn,int color,int rop,
+ unsigned int planemask);
+ void (*SetupForDashedLine)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int length,
+ unsigned char *pattern);
+ void (*SetClippingRectangle) (ScrnInfoPtr pScrn, int left, int top,
+ int right, int bottom);
+ void (*DisableClipping)(ScrnInfoPtr pScrn);
+ void (*SetupForMono8x8PatternFill)(ScrnInfoPtr pScrn, int patx, int paty,
+ int fg, int bg, int rop,
+ unsigned int planemask);
+ void (*SetupForColor8x8PatternFill)(ScrnInfoPtr pScrn, int patx, int paty,
+ int rop, unsigned int planemask,
+ int transparency_color);
+ void (*SetupForCPUToScreenColorExpandFill)(ScrnInfoPtr pScrn, int fg,
+ int bg, int rop,
+ unsigned int planemask);
+ void (*SetupForScanlineCPUToScreenColorExpandFill)(ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask);
+ void (*SetupForScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask);
+ void (*SetupForImageWrite)(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int transparency_color,
+ int bpp, int depth);
+ void (*SetupForScanlineImageWrite)(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask,
+ int transparency_color,
+ int bpp, int depth);
+ void (*SetupForImageRead) (ScrnInfoPtr pScrn, int bpp, int depth);
+ void (*ScreenToScreenBitBlt)(ScrnInfoPtr pScrn, int nbox,
+ DDXPointPtr pptSrc, BoxPtr pbox, int xdir,
+ int ydir, int alu, unsigned int planmask);
+ void (*WriteBitmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int skipleft,
+ int fg, int bg, int rop, unsigned int planemask);
+ void (*FillSolidRects)(ScrnInfoPtr pScrn, int fg, int rop,
+ unsigned int planemask, int nBox, BoxPtr pBox);
+ void (*FillMono8x8PatternRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int nBox,
+ BoxPtr pBox, int pat0, int pat1,
+ int xorg, int yorg);
+ void (*FillColor8x8PatternRects)(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int nBox,
+ BoxPtr pBox, int xorg, int yorg,
+ XAACacheInfoPtr pCache);
+ void (*FillCacheBltRects)(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int nBox, BoxPtr pBox,
+ int xorg, int yorg, XAACacheInfoPtr pCache);
+ void (*FillColorExpandRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int nBox,
+ BoxPtr pBox, int xorg, int yorg,
+ PixmapPtr pPix);
+ void (*FillCacheExpandRects)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int nBox, BoxPtr pBox,
+ int xorg, int yorg, PixmapPtr pPix);
+ void (*FillImageWriteRects)(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int nBox, BoxPtr pBox,
+ int xorg, int yorg, PixmapPtr pPix);
+ void (*FillSolidSpans)(ScrnInfoPtr pScrn, int fg, int rop,
+ unsigned int planemask, int n, DDXPointPtr points,
+ int *widths, int fSorted);
+ void (*FillMono8x8PatternSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int n,
+ DDXPointPtr points, int *widths,
+ int fSorted, int pat0, int pat1,
+ int xorg, int yorg);
+ void (*FillColor8x8PatternSpans)(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int n,
+ DDXPointPtr points, int *widths,
+ int fSorted, XAACacheInfoPtr pCache,
+ int xorg, int yorg);
+ void (*FillCacheBltSpans)(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int n, DDXPointPtr points,
+ int *widths, int fSorted, XAACacheInfoPtr pCache,
+ int xorg, int yorg);
+ void (*FillColorExpandSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int n,
+ DDXPointPtr points, int *widths, int fSorted,
+ int xorg, int yorg, PixmapPtr pPix);
+ void (*FillCacheExpandSpans)(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int n, DDXPointPtr ppt,
+ int *pwidth, int fSorted, int xorg, int yorg,
+ PixmapPtr pPix);
+ void (*TEGlyphRenderer)(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ int skipleft, int startline, unsigned int **glyphs,
+ int glyphWidth, int fg, int bg, int rop,
+ unsigned planemask);
+ void (*NonTEGlyphRenderer)(ScrnInfoPtr pScrn, int x, int y, int n,
+ NonTEGlyphPtr glyphs, BoxPtr pbox,
+ int fg, int rop, unsigned int planemask);
+ void (*WritePixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int rop,
+ unsigned int planemask, int transparency_color,
+ int bpp, int depth);
+ void (*ReadPixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *dst, int dstwidth, int bpp, int depth);
+ RegionPtr (*CopyArea)(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
+ GC *pGC, int srcx, int srcy, int width, int height,
+ int dstx, int dsty);
+ RegionPtr (*CopyPlane)(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
+ int srcx, int srcy, int width, int height, int dstx,
+ int dsty, unsigned long bitPlane);
+ void (*PushPixelsSolid) (GCPtr pGC, PixmapPtr pBitMap,
+ DrawablePtr pDrawable, int dx, int dy, int xOrg,
+ int yOrg);
+ void (*PolyFillRectSolid)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
+ xRectangle *prectInit);
+ void (*PolyFillRectStippled)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
+ xRectangle *prectInit);
+ void (*PolyFillRectOpaqueStippled)(DrawablePtr pDraw, GCPtr pGC,
+ int nrectFill, xRectangle *prectInit);
+ void (*PolyFillRectTiled)(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
+ xRectangle *prectInit);
+ void (*FillSpansSolid)(DrawablePtr pDraw, GCPtr pGC, int nInit,
+ DDXPointPtr ppt, int *pwidth, int fSorted);
+ void (*FillSpansStippled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
+ DDXPointPtr ppt, int *pwidth, int fSorted);
+ void (*FillSpansOpaqueStippled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
+ DDXPointPtr ppt, int *pwidth, int fSorted);
+ void (*FillSpansTiled)(DrawablePtr pDraw, GCPtr pGC, int nInit,
+ DDXPointPtr ppt, int *pwidth, int fSorted);
+ int (*PolyText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
+ char *chars);
+ int (*PolyText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
+ unsigned short *chars);
+ void (*ImageText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
+ char *chars);
+ void (*ImageText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars);
+ void (*ImageGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph, CharInfoPtr *ppci,
+ pointer pglyphBase);
+ void (*PolyGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph, CharInfoPtr *ppci,
+ pointer pglyphBase);
+ int (*PolyText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars);
+ int (*PolyText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars);
+ void (*ImageText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars);
+ void (*ImageText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars);
+ void (*ImageGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph,
+ CharInfoPtr *ppci, pointer pglyphBase);
+ void (*PolyGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph,
+ CharInfoPtr *ppci, pointer pglyphBase);
+ void (*PolyRectangleThinSolid)(DrawablePtr pDrawable,GCPtr pGC,
+ int nRectsInit, xRectangle *pRectsInit);
+ void (*PolylinesWideSolid)(DrawablePtr pDrawable, GCPtr pGC, int mode,
+ int npt, DDXPointPtr pPts);
+ void (*PolylinesThinSolid)(DrawablePtr pDrawable, GCPtr pGC, int mode,
+ int npt, DDXPointPtr pPts);
+ void (*PolySegmentThinSolid)(DrawablePtr pDrawable, GCPtr pGC, int nseg,
+ xSegment *pSeg);
+ void (*PolylinesThinDashed)(DrawablePtr pDrawable, GCPtr pGC, int mode,
+ int npt, DDXPointPtr pPts);
+ void (*PolySegmentThinDashed)(DrawablePtr pDrawable, GCPtr pGC, int nseg,
+ xSegment *pSeg);
+ void (*FillPolygonSolid)(DrawablePtr pDrawable, GCPtr pGC, int shape,
+ int mode, int count, DDXPointPtr ptsIn);
+ void (*FillPolygonStippled)(DrawablePtr pDrawable, GCPtr pGC, int shape,
+ int mode, int count, DDXPointPtr ptsIn);
+ void (*FillPolygonOpaqueStippled)(DrawablePtr pDrawable, GCPtr pGC,
+ int shape, int mode, int count,
+ DDXPointPtr ptsIn);
+ void (*FillPolygonTiled)(DrawablePtr pDrawable, GCPtr pGC, int shape,
+ int mode, int count, DDXPointPtr ptsIn);
+ void (*PolyFillArcSolid)(DrawablePtr pDraw, GCPtr pGC, int narcs,
+ xArc *parcs);
+ void (*PutImage)(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y,
+ int w, int h, int leftPad, int format, char *pImage);
+ ValidateGCProcPtr ValidateFillSpans;
+ ValidateGCProcPtr ValidateSetSpans;
+ ValidateGCProcPtr ValidatePutImage;
+ ValidateGCProcPtr ValidateCopyArea;
+ ValidateGCProcPtr ValidateCopyPlane;
+ ValidateGCProcPtr ValidatePolyPoint;
+ ValidateGCProcPtr ValidatePolylines;
+ ValidateGCProcPtr ValidatePolySegment;
+ ValidateGCProcPtr ValidatePolyRectangle;
+ ValidateGCProcPtr ValidatePolyArc;
+ ValidateGCProcPtr ValidateFillPolygon;
+ ValidateGCProcPtr ValidatePolyFillRect;
+ ValidateGCProcPtr ValidatePolyFillArc;
+ ValidateGCProcPtr ValidatePolyText8;
+ ValidateGCProcPtr ValidatePolyText16;
+ ValidateGCProcPtr ValidateImageText8;
+ ValidateGCProcPtr ValidateImageText16;
+ ValidateGCProcPtr ValidatePolyGlyphBlt;
+ ValidateGCProcPtr ValidateImageGlyphBlt;
+ ValidateGCProcPtr ValidatePushPixels;
+ void (*ComputeDash)(GCPtr pGC);
+ void (*InitPixmapCache)(ScreenPtr pScreen, RegionPtr areas, pointer data);
+ void (*ClosePixmapCache)(ScreenPtr pScreen);
+ int (*StippledFillChooser)(GCPtr pGC);
+ int (*OpaqueStippledFillChooser)(GCPtr pGC);
+ int (*TiledFillChooser)(GCPtr pGC);
+ XAACacheInfoPtr (*CacheTile)(ScrnInfoPtr Scrn, PixmapPtr pPix);
+ XAACacheInfoPtr (*CacheStipple)(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg,
+ int bg);
+ XAACacheInfoPtr (*CacheMonoStipple)(ScrnInfoPtr Scrn, PixmapPtr pPix);
+ XAACacheInfoPtr (*CacheMono8x8Pattern)(ScrnInfoPtr Scrn, int pat0,
+ int pat1);
+ XAACacheInfoPtr (*CacheColor8x8Pattern)(ScrnInfoPtr Scrn, PixmapPtr pPix,
+ int fg, int bg);
+ void (*WriteBitmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int fg,
+ int bg);
+ void (*WritePixmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int bpp,
+ int depth);
+ void (*WriteMono8x8PatternToCache)(ScrnInfoPtr pScrn,
+ XAACacheInfoPtr pCache);
+ void (*WriteColor8x8PatternToCache)(ScrnInfoPtr pScrn, PixmapPtr pPix,
+ XAACacheInfoPtr pCache);
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ CopyWindowProcPtr CopyWindow;
+ BackingStoreSaveAreasProcPtr SaveAreas;
+ BackingStoreRestoreAreasProcPtr RestoreAreas;
+#ifdef RENDER
+ Bool (*SetupForCPUToScreenAlphaTexture)(ScrnInfoPtr pScrn, int op,
+ CARD16 red, CARD16 green,
+ CARD16 blue, CARD16 alpha,
+ int alphaType, CARD8 *alphaPtr,
+ int alphaPitch, int width,
+ int height, int flags);
+ Bool (*SetupForCPUToScreenTexture)(ScrnInfoPtr pScrn, int op, int texType,
+ CARD8 *texPtr, int texPitch,
+ int width, int height, int flags);
+#endif
+} XAAStateWrapRec, *XAAStateWrapPtr;
+
+static int XAAStateIndex = -1;
+static unsigned long XAAStateGeneration = 0;
+
+/* Wrap functions start here */
+#define GET_STATEPRIV_GC(pGC) XAAStateWrapPtr pStatePriv =\
+(XAAStateWrapPtr)(pGC->pScreen->devPrivates[XAAStateIndex].ptr)
+
+#define GET_STATEPRIV_SCREEN(pScreen) XAAStateWrapPtr pStatePriv =\
+(XAAStateWrapPtr)(pScreen->devPrivates[XAAStateIndex].ptr)
+
+#define GET_STATEPRIV_PSCRN(pScrn) XAAStateWrapPtr pStatePriv =\
+(XAAStateWrapPtr)(pScrn->pScreen->devPrivates[XAAStateIndex].ptr)
+
+#define STATE_CHECK_SP(pStatePriv) {\
+ ScrnInfoPtr pScrn = pStatePriv->pScrn;\
+ int i = 0;\
+ int need_change = 0;\
+ while(i < pScrn->numEntities) {\
+ if(xf86IsEntityShared(pScrn->entityList[i]) &&\
+ xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\
+ need_change = 1;\
+ xf86SetLastScrnFlag(pScrn->entityList[i],\
+ pScrn->scrnIndex);\
+ }\
+ i++;\
+ }\
+ if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\
+}
+
+#define STATE_CHECK_PSCRN(pScrn) {\
+ int i = 0;\
+ int need_change = 0;\
+ while(i < pScrn->numEntities) {\
+ if(xf86IsEntityShared(pScrn->entityList[i]) &&\
+ xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\
+ need_change = 1;\
+ xf86SetLastScrnFlag(pScrn->entityList[i],\
+ pScrn->scrnIndex);\
+ }\
+ i++;\
+ }\
+ if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\
+}
+
+static void XAAStateWrapSync(ScrnInfoPtr pScrn)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->Sync)(pScrn);
+}
+
+static void XAAStateWrapSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir,
+ int rop, unsigned int planemask,
+ int trans_color)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForScreenToScreenCopy)(pScrn, xdir, ydir, rop, planemask,
+ trans_color);
+}
+
+static void XAAStateWrapSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
+ unsigned int planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForSolidFill)(pScrn, color, rop, planemask);
+}
+
+static void XAAStateWrapSetupForSolidLine(ScrnInfoPtr pScrn,int color,int rop,
+ unsigned int planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForSolidLine)(pScrn, color, rop, planemask);
+}
+
+static void XAAStateWrapSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int length,
+ unsigned char *pattern)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForDashedLine)(pScrn, fg, bg, rop, planemask, length, pattern);
+}
+
+static void XAAStateWrapSetClippingRectangle(ScrnInfoPtr pScrn, int left, int top,
+ int right, int bottom)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetClippingRectangle)(pScrn, left, top, right, bottom);
+}
+
+static void XAAStateWrapDisableClipping(ScrnInfoPtr pScrn)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->DisableClipping)(pScrn);
+}
+
+static void XAAStateWrapSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
+ int fg, int bg, int rop,
+ unsigned int planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForMono8x8PatternFill)(pScrn, patx, paty, fg, bg, rop, planemask);
+}
+
+static void XAAStateWrapSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty,
+ int rop, unsigned int planemask,
+ int transparency_color)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForColor8x8PatternFill)(pScrn, patx, paty, rop, planemask,
+ transparency_color);
+}
+
+static void XAAStateWrapSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg,
+ int bg, int rop,
+ unsigned int planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForCPUToScreenColorExpandFill)(pScrn, fg, bg, rop, planemask);
+}
+
+static void XAAStateWrapSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForScanlineCPUToScreenColorExpandFill)(pScrn, fg, bg, rop,
+ planemask);
+}
+
+static void XAAStateWrapSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForScreenToScreenColorExpandFill)(pScrn, fg, bg, rop, planemask);
+}
+
+static void XAAStateWrapSetupForImageWrite(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int transparency_color,
+ int bpp, int depth)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForImageWrite)(pScrn, rop, planemask, transparency_color, bpp,
+ depth);
+}
+
+static void XAAStateWrapSetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask,
+ int transparency_color,
+ int bpp, int depth)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForScanlineImageWrite)(pScrn, rop, planemask, transparency_color,
+ bpp, depth);
+}
+
+static void XAAStateWrapSetupForImageRead(ScrnInfoPtr pScrn, int bpp, int depth)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->SetupForImageRead)(pScrn, bpp, depth);
+}
+
+static void XAAStateWrapScreenToScreenBitBlt(ScrnInfoPtr pScrn, int nbox,
+ DDXPointPtr pptSrc, BoxPtr pbox, int xdir,
+ int ydir, int alu, unsigned int planmask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->ScreenToScreenBitBlt)(pScrn, nbox,
+ pptSrc, pbox, xdir,
+ ydir, alu, planmask);
+}
+
+static void XAAStateWrapWriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int skipleft,
+ int fg, int bg, int rop, unsigned int planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->WriteBitmap)(pScrn, x, y, w, h,
+ src, srcwidth, skipleft,
+ fg, bg, rop, planemask);
+}
+
+static void XAAStateWrapFillSolidRects(ScrnInfoPtr pScrn, int fg, int rop,
+ unsigned int planemask, int nBox, BoxPtr pBox)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillSolidRects)(pScrn, fg, rop,
+ planemask, nBox, pBox);
+}
+
+static void XAAStateWrapFillMono8x8PatternRects(ScrnInfoPtr pScrn, int fg, int bg,
+ int rop, unsigned int planemask, int nBox,
+ BoxPtr pBox, int pat0, int pat1,
+ int xorg, int yorg)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillMono8x8PatternRects)(pScrn, fg, bg,
+ rop, planemask, nBox,
+ pBox, pat0, pat1,
+ xorg, yorg);
+}
+
+static void XAAStateWrapFillColor8x8PatternRects(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int nBox,
+ BoxPtr pBox, int xorg, int yorg,
+ XAACacheInfoPtr pCache)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillColor8x8PatternRects)(pScrn, rop,
+ planemask, nBox,
+ pBox, xorg, yorg,
+ pCache);
+}
+
+static void XAAStateWrapFillCacheBltRects(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int nBox, BoxPtr pBox,
+ int xorg, int yorg, XAACacheInfoPtr pCache)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillCacheBltRects)(pScrn, rop,
+ planemask, nBox, pBox,
+ xorg, yorg, pCache);
+}
+
+static void XAAStateWrapFillColorExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int nBox,
+ BoxPtr pBox, int xorg, int yorg,
+ PixmapPtr pPix)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillColorExpandRects)(pScrn, fg, bg, rop,
+ planemask, nBox,
+ pBox, xorg, yorg,
+ pPix);
+}
+
+static void XAAStateWrapFillCacheExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int nBox,
+ BoxPtr pBox, int xorg, int yorg,
+ PixmapPtr pPix)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillCacheExpandRects)(pScrn, fg, bg, rop,
+ planemask, nBox,
+ pBox, xorg, yorg,
+ pPix);
+}
+
+static void XAAStateWrapFillImageWriteRects(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int nBox, BoxPtr pBox,
+ int xorg, int yorg, PixmapPtr pPix)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillImageWriteRects)(pScrn, rop,
+ planemask, nBox, pBox,
+ xorg, yorg, pPix);
+}
+
+static void XAAStateWrapFillSolidSpans(ScrnInfoPtr pScrn, int fg, int rop,
+ unsigned int planemask, int n, DDXPointPtr points,
+ int *widths, int fSorted)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillSolidSpans)(pScrn, fg, rop,
+ planemask, n, points,
+ widths, fSorted);
+}
+
+static void XAAStateWrapFillMono8x8PatternSpans(ScrnInfoPtr pScrn, int fg, int bg,
+ int rop, unsigned int planemask, int n,
+ DDXPointPtr points, int *widths,
+ int fSorted, int pat0, int pat1,
+ int xorg, int yorg)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillMono8x8PatternSpans)(pScrn, fg, bg,
+ rop, planemask, n,
+ points, widths,
+ fSorted, pat0, pat1,
+ xorg, yorg);
+}
+
+static void XAAStateWrapFillColor8x8PatternSpans(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int n,
+ DDXPointPtr points, int *widths,
+ int fSorted, XAACacheInfoPtr pCache,
+ int xorg, int yorg)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillColor8x8PatternSpans)(pScrn, rop,
+ planemask, n,
+ points, widths,
+ fSorted, pCache,
+ xorg, yorg);
+}
+
+static void XAAStateWrapFillCacheBltSpans(ScrnInfoPtr pScrn, int rop,
+ unsigned int planemask, int n,
+ DDXPointPtr points, int *widths,
+ int fSorted, XAACacheInfoPtr pCache,
+ int xorg, int yorg)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillCacheBltSpans)(pScrn, rop,
+ planemask, n,
+ points, widths,
+ fSorted, pCache,
+ xorg, yorg);
+}
+
+static void XAAStateWrapFillColorExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int n,
+ DDXPointPtr points, int *widths, int fSorted,
+ int xorg, int yorg, PixmapPtr pPix)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillColorExpandSpans)(pScrn, fg, bg, rop,
+ planemask, n,
+ points, widths, fSorted,
+ xorg, yorg, pPix);
+}
+
+static void XAAStateWrapFillCacheExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop,
+ unsigned int planemask, int n,
+ DDXPointPtr ppt, int *pwidth, int fSorted,
+ int xorg, int yorg, PixmapPtr pPix)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->FillCacheExpandSpans)(pScrn, fg, bg, rop,
+ planemask, n,
+ ppt, pwidth, fSorted,
+ xorg, yorg, pPix);
+}
+
+static void XAAStateWrapTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ int skipleft, int startline,
+ unsigned int **glyphs,
+ int glyphWidth, int fg, int bg, int rop,
+ unsigned planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->TEGlyphRenderer)(pScrn, x, y, w, h,
+ skipleft, startline,
+ glyphs,
+ glyphWidth, fg, bg, rop,
+ planemask);
+}
+
+static void XAAStateWrapNonTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int n,
+ NonTEGlyphPtr glyphs, BoxPtr pbox,
+ int fg, int rop, unsigned int planemask)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->NonTEGlyphRenderer)(pScrn, x, y, n,
+ glyphs, pbox,
+ fg, rop, planemask);
+}
+
+static void XAAStateWrapWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int rop,
+ unsigned int planemask, int transparency_color,
+ int bpp, int depth)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->WritePixmap)(pScrn, x, y, w, h,
+ src, srcwidth, rop,
+ planemask, transparency_color,
+ bpp, depth);
+}
+
+static void XAAStateWrapReadPixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *dst, int dstwidth, int bpp, int depth)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->ReadPixmap)(pScrn, x, y, w, h,
+ dst, dstwidth, bpp, depth);
+}
+
+static RegionPtr XAAStateWrapCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
+ GC *pGC, int srcx, int srcy, int width, int height,
+ int dstx, int dsty)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->CopyArea)(pSrcDrawable, pDstDrawable,
+ pGC, srcx, srcy, width, height,
+ dstx, dsty);
+}
+
+static RegionPtr XAAStateWrapCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
+ int srcx, int srcy, int width, int height,
+ int dstx, int dsty, unsigned long bitPlane)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->CopyPlane)(pSrc, pDst, pGC,
+ srcx, srcy, width, height,
+ dstx, dsty, bitPlane);
+}
+
+static void XAAStateWrapPushPixelsSolid(GCPtr pGC, PixmapPtr pBitMap,
+ DrawablePtr pDrawable, int dx, int dy, int xOrg,
+ int yOrg)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PushPixelsSolid)(pGC, pBitMap,
+ pDrawable, dx, dy, xOrg,
+ yOrg);
+}
+
+static void XAAStateWrapPolyFillRectSolid(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
+ xRectangle *prectInit)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolyFillRectSolid)(pDraw, pGC, nrectFill,
+ prectInit);
+}
+
+static void XAAStateWrapPolyFillRectStippled(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
+ xRectangle *prectInit)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolyFillRectStippled)(pDraw, pGC, nrectFill,
+ prectInit);
+}
+
+static void XAAStateWrapPolyFillRectOpaqueStippled(DrawablePtr pDraw, GCPtr pGC,
+ int nrectFill, xRectangle *prectInit)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolyFillRectOpaqueStippled)(pDraw, pGC,
+ nrectFill, prectInit);
+}
+
+static void XAAStateWrapPolyFillRectTiled(DrawablePtr pDraw, GCPtr pGC, int nrectFill,
+ xRectangle *prectInit)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolyFillRectTiled)(pDraw, pGC, nrectFill,
+ prectInit);
+}
+
+static void XAAStateWrapFillSpansSolid(DrawablePtr pDraw, GCPtr pGC, int nInit,
+ DDXPointPtr ppt, int *pwidth, int fSorted)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->FillSpansSolid)(pDraw, pGC, nInit,
+ ppt, pwidth, fSorted);
+}
+
+static void XAAStateWrapFillSpansStippled(DrawablePtr pDraw, GCPtr pGC, int nInit,
+ DDXPointPtr ppt, int *pwidth, int fSorted)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->FillSpansStippled)(pDraw, pGC, nInit,
+ ppt, pwidth, fSorted);
+}
+
+static void XAAStateWrapFillSpansOpaqueStippled(DrawablePtr pDraw, GCPtr pGC, int nInit,
+ DDXPointPtr ppt, int *pwidth, int fSorted)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->FillSpansOpaqueStippled)(pDraw, pGC, nInit,
+ ppt, pwidth, fSorted);
+}
+
+static void XAAStateWrapFillSpansTiled(DrawablePtr pDraw, GCPtr pGC, int nInit,
+ DDXPointPtr ppt, int *pwidth, int fSorted)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->FillSpansTiled)(pDraw, pGC, nInit,
+ ppt, pwidth, fSorted);
+}
+
+static int XAAStateWrapPolyText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
+ char *chars)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->PolyText8TE)(pDraw, pGC, x, y, count,
+ chars);
+}
+
+static int XAAStateWrapPolyText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count,
+ unsigned short *chars)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->PolyText16TE)(pDraw, pGC, x, y, count,
+ chars);
+}
+
+static void XAAStateWrapImageText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ImageText8TE)(pDraw, pGC, x, y,
+ count, chars);
+}
+
+static void XAAStateWrapImageText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ImageText16TE)(pDraw, pGC, x, y,
+ count, chars);
+}
+
+static void XAAStateWrapImageGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph, CharInfoPtr *ppci,
+ pointer pglyphBase)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ImageGlyphBltTE)(pDrawable, pGC, xInit,
+ yInit, nglyph, ppci,
+ pglyphBase);
+}
+
+static void XAAStateWrapPolyGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph, CharInfoPtr *ppci,
+ pointer pglyphBase)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolyGlyphBltTE)(pDrawable, pGC, xInit,
+ yInit, nglyph, ppci,
+ pglyphBase);
+}
+
+static int XAAStateWrapPolyText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->PolyText8NonTE)(pDraw, pGC, x, y,
+ count, chars);
+}
+
+static int XAAStateWrapPolyText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->PolyText16NonTE)(pDraw, pGC, x, y,
+ count, chars);
+}
+
+static void XAAStateWrapImageText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ImageText8NonTE)(pDraw, pGC, x, y,
+ count, chars);
+}
+
+static void XAAStateWrapImageText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ImageText16NonTE)(pDraw, pGC, x, y,
+ count, chars);
+}
+
+static void XAAStateWrapImageGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph,
+ CharInfoPtr *ppci, pointer pglyphBase)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ImageGlyphBltNonTE)(pDrawable, pGC, xInit,
+ yInit, nglyph,
+ ppci, pglyphBase);
+}
+
+static void XAAStateWrapPolyGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph,
+ CharInfoPtr *ppci, pointer pglyphBase)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolyGlyphBltNonTE)(pDrawable, pGC, xInit,
+ yInit, nglyph,
+ ppci, pglyphBase);
+}
+
+static void XAAStateWrapPolyRectangleThinSolid(DrawablePtr pDrawable,GCPtr pGC,
+ int nRectsInit, xRectangle *pRectsInit)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolyRectangleThinSolid)(pDrawable, pGC,
+ nRectsInit, pRectsInit);
+}
+
+static void XAAStateWrapPolylinesWideSolid(DrawablePtr pDrawable, GCPtr pGC, int mode,
+ int npt, DDXPointPtr pPts)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolylinesWideSolid)(pDrawable, pGC, mode,
+ npt, pPts);
+}
+
+static void XAAStateWrapPolylinesThinSolid(DrawablePtr pDrawable, GCPtr pGC, int mode,
+ int npt, DDXPointPtr pPts)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolylinesThinSolid)(pDrawable, pGC, mode,
+ npt, pPts);
+}
+
+static void XAAStateWrapPolySegmentThinSolid(DrawablePtr pDrawable, GCPtr pGC, int nseg,
+ xSegment *pSeg)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolySegmentThinSolid)(pDrawable, pGC, nseg,
+ pSeg);
+}
+
+static void XAAStateWrapPolylinesThinDashed(DrawablePtr pDrawable, GCPtr pGC, int mode,
+ int npt, DDXPointPtr pPts)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolylinesThinDashed)(pDrawable, pGC, mode,
+ npt, pPts);
+}
+
+static void XAAStateWrapPolySegmentThinDashed(DrawablePtr pDrawable, GCPtr pGC, int nseg,
+ xSegment *pSeg)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolySegmentThinDashed)(pDrawable, pGC, nseg,
+ pSeg);
+}
+
+static void XAAStateWrapFillPolygonSolid(DrawablePtr pDrawable, GCPtr pGC, int shape,
+ int mode, int count, DDXPointPtr ptsIn)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->FillPolygonSolid)(pDrawable, pGC, shape,
+ mode, count, ptsIn);
+}
+
+static void XAAStateWrapFillPolygonStippled(DrawablePtr pDrawable, GCPtr pGC, int shape,
+ int mode, int count, DDXPointPtr ptsIn)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->FillPolygonStippled)(pDrawable, pGC, shape,
+ mode, count, ptsIn);
+}
+
+static void XAAStateWrapFillPolygonOpaqueStippled(DrawablePtr pDrawable, GCPtr pGC,
+ int shape, int mode, int count,
+ DDXPointPtr ptsIn)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->FillPolygonOpaqueStippled)(pDrawable, pGC,
+ shape, mode, count,
+ ptsIn);
+}
+
+static void XAAStateWrapFillPolygonTiled(DrawablePtr pDrawable, GCPtr pGC, int shape,
+ int mode, int count, DDXPointPtr ptsIn)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->FillPolygonTiled)(pDrawable, pGC, shape,
+ mode, count, ptsIn);
+}
+
+static void XAAStateWrapPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs,
+ xArc *parcs)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PolyFillArcSolid)(pDraw, pGC, narcs,
+ parcs);
+}
+
+static void XAAStateWrapPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y,
+ int w, int h, int leftPad, int format, char *pImage)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PutImage)(pDraw, pGC, depth, x, y,
+ w, h, leftPad, format, pImage);
+}
+
+static void XAAStateWrapValidateFillSpans(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidateFillSpans)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidateSetSpans(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidateSetSpans)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePutImage(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePutImage)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidateCopyArea(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidateCopyArea)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidateCopyPlane(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidateCopyPlane)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolyPoint(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolyPoint)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolylines(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolylines)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolySegment(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolySegment)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolyRectangle(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolyRectangle)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolyArc(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolyArc)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidateFillPolygon(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidateFillPolygon)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolyFillRect(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolyFillRect)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolyFillArc(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolyFillArc)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolyText8(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolyText8)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolyText16(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolyText16)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidateImageText8(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidateImageText8)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidateImageText16(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidateImageText16)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePolyGlyphBlt)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidateImageGlyphBlt(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+ (*pStatePriv->ValidateImageGlyphBlt)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapValidatePushPixels(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ValidatePushPixels)(pGC, changes,
+ pDraw);
+}
+
+static void XAAStateWrapComputeDash(GCPtr pGC)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ComputeDash)(pGC);
+}
+
+static void XAAStateWrapInitPixmapCache(ScreenPtr pScreen, RegionPtr areas,
+ pointer data)
+{
+ GET_STATEPRIV_SCREEN(pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->InitPixmapCache)(pScreen, areas,
+ data);
+}
+
+static void XAAStateWrapClosePixmapCache(ScreenPtr pScreen)
+{
+ GET_STATEPRIV_SCREEN(pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->ClosePixmapCache)(pScreen);
+}
+
+static int XAAStateWrapStippledFillChooser(GCPtr pGC)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->StippledFillChooser)(pGC);
+}
+
+static int XAAStateWrapOpaqueStippledFillChooser(GCPtr pGC)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->OpaqueStippledFillChooser)(pGC);
+}
+
+static int XAAStateWrapTiledFillChooser(GCPtr pGC)
+{
+ GET_STATEPRIV_GC(pGC);
+ STATE_CHECK_SP(pStatePriv);
+
+ return (*pStatePriv->TiledFillChooser)(pGC);
+}
+
+static XAACacheInfoPtr XAAStateWrapCacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ return (*pStatePriv->CacheTile)(pScrn, pPix);
+}
+
+static XAACacheInfoPtr XAAStateWrapCacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg,
+ int bg)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ return (*pStatePriv->CacheStipple)(pScrn, pPix, fg,
+ bg);
+}
+
+static XAACacheInfoPtr XAAStateWrapCacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ return (*pStatePriv->CacheMonoStipple)(pScrn, pPix);
+}
+
+static XAACacheInfoPtr XAAStateWrapCacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0,
+ int pat1)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ return (*pStatePriv->CacheMono8x8Pattern)(pScrn, pat0,
+ pat1);
+}
+
+static XAACacheInfoPtr XAAStateWrapCacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix,
+ int fg, int bg)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ return (*pStatePriv->CacheColor8x8Pattern)(pScrn, pPix,
+ fg, bg);
+}
+
+static void XAAStateWrapWriteBitmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int fg,
+ int bg)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->WriteBitmapToCache)(pScrn, x, y, w, h,
+ src, srcwidth, fg,
+ bg);
+}
+
+static void XAAStateWrapWritePixmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h,
+ unsigned char *src, int srcwidth, int bpp,
+ int depth)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->WritePixmapToCache)(pScrn, x, y, w, h,
+ src, srcwidth, bpp,
+ depth);
+}
+
+static void XAAStateWrapWriteMono8x8PatternToCache(ScrnInfoPtr pScrn,
+ XAACacheInfoPtr pCache)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->WriteMono8x8PatternToCache)(pScrn,
+ pCache);
+}
+
+static void XAAStateWrapWriteColor8x8PatternToCache(ScrnInfoPtr pScrn, PixmapPtr pPix,
+ XAACacheInfoPtr pCache)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ (*pStatePriv->WriteColor8x8PatternToCache)(pScrn, pPix,
+ pCache);
+}
+
+static void XAAStateWrapGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
+ unsigned int format,unsigned long planeMask,
+ char *pdstLine)
+{
+ GET_STATEPRIV_SCREEN(pDrawable->pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->GetImage)(pDrawable, sx, sy, w, h,
+ format, planeMask,
+ pdstLine);
+}
+
+static void XAAStateWrapGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt,
+ int *pwidth, int nspans, char *pdstStart)
+{
+ GET_STATEPRIV_SCREEN(pDrawable->pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->GetSpans)(pDrawable, wMax, ppt,
+ pwidth, nspans, pdstStart);
+}
+
+static void XAAStateWrapPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion,
+ int what)
+{
+ GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PaintWindowBackground)(pWindow, pRegion,
+ what);
+}
+
+static void XAAStateWrapPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion,
+ int what)
+{
+ GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->PaintWindowBorder)(pWindow, pRegion,
+ what);
+}
+
+static void XAAStateWrapCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc)
+{
+ GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->CopyWindow)(pWindow, ptOldOrg,
+ prgnSrc);
+}
+
+static void XAAStateWrapSaveAreas(PixmapPtr pBackingPixmap, RegionPtr pObscured, int x,
+ int y, WindowPtr pWin)
+{
+ GET_STATEPRIV_SCREEN(pBackingPixmap->drawable.pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->SaveAreas)(pBackingPixmap, pObscured, x,
+ y, pWin);
+}
+
+static void XAAStateWrapRestoreAreas(PixmapPtr pBackingPixmap, RegionPtr pExposed,
+ int x, int y, WindowPtr pWin)
+{
+ GET_STATEPRIV_SCREEN(pBackingPixmap->drawable.pScreen);
+ STATE_CHECK_SP(pStatePriv);
+
+ (*pStatePriv->RestoreAreas)(pBackingPixmap, pExposed,
+ x, y, pWin);
+}
+
+#ifdef RENDER
+static Bool XAAStateWrapSetupForCPUToScreenAlphaTexture(ScrnInfoPtr pScrn,
+ int op, CARD16 red,
+ CARD16 green,
+ CARD16 blue,
+ CARD16 alpha,
+ int alphaType,
+ CARD8 *alphaPtr,
+ int alphaPitch,
+ int width, int height,
+ int flags)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ return (*pStatePriv->SetupForCPUToScreenAlphaTexture)(pScrn, op, red, green,
+ blue, alpha, alphaType,
+ alphaPtr, alphaPitch,
+ width, height, flags);
+}
+
+static Bool XAAStateWrapSetupForCPUToScreenTexture(ScrnInfoPtr pScrn, int op,
+ int texType, CARD8 *texPtr,
+ int texPitch,
+ int width, int height,
+ int flags)
+{
+ GET_STATEPRIV_PSCRN(pScrn);
+ STATE_CHECK_PSCRN(pScrn);
+
+ return (*pStatePriv->SetupForCPUToScreenTexture)(pScrn, op, texType, texPtr,
+ texPitch, width, height,
+ flags);
+}
+#endif
+
+/* Setup Function */
+Bool
+XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ XAAStateWrapPtr pStatePriv;
+ int i = 0;
+
+ if (XAAStateGeneration != serverGeneration) {
+ if((XAAStateIndex = AllocateScreenPrivateIndex()) < 0) return FALSE;
+ XAAStateGeneration = serverGeneration;
+ }
+ if(!(pStatePriv = xalloc(sizeof(XAAStateWrapRec)))) return FALSE;
+ pScreen->devPrivates[XAAStateIndex].ptr = (pointer)pStatePriv;
+ pStatePriv->RestoreAccelState = infoRec->RestoreAccelState;
+ pStatePriv->pScrn = pScrn;
+
+ /* Initialize the last screen to -1 so whenever an accel function
+ * is called the proper state is setup
+ */
+ while(i < pScrn->numEntities) {
+ xf86SetLastScrnFlag(pScrn->entityList[i], -1);
+ i++;
+ }
+/* Do the wrapping */
+ XAA_STATE_WRAP(Sync);
+ XAA_STATE_WRAP(SetupForScreenToScreenCopy);
+ XAA_STATE_WRAP(SetupForSolidFill);
+ XAA_STATE_WRAP(SetupForSolidLine);
+ XAA_STATE_WRAP(SetupForDashedLine);
+ XAA_STATE_WRAP(SetClippingRectangle);
+ XAA_STATE_WRAP(DisableClipping);
+ XAA_STATE_WRAP(SetupForMono8x8PatternFill);
+ XAA_STATE_WRAP(SetupForColor8x8PatternFill);
+ XAA_STATE_WRAP(SetupForCPUToScreenColorExpandFill);
+ XAA_STATE_WRAP(SetupForScanlineCPUToScreenColorExpandFill);
+ XAA_STATE_WRAP(SetupForScreenToScreenColorExpandFill);
+ XAA_STATE_WRAP(SetupForImageWrite);
+ XAA_STATE_WRAP(SetupForScanlineImageWrite);
+ XAA_STATE_WRAP(SetupForImageRead);
+ XAA_STATE_WRAP(ScreenToScreenBitBlt);
+ XAA_STATE_WRAP(WriteBitmap);
+ XAA_STATE_WRAP(FillSolidRects);
+ XAA_STATE_WRAP(FillMono8x8PatternRects);
+ XAA_STATE_WRAP(FillColor8x8PatternRects);
+ XAA_STATE_WRAP(FillCacheBltRects);
+ XAA_STATE_WRAP(FillColorExpandRects);
+ XAA_STATE_WRAP(FillCacheExpandRects);
+ XAA_STATE_WRAP(FillImageWriteRects);
+ XAA_STATE_WRAP(FillSolidSpans);
+ XAA_STATE_WRAP(FillMono8x8PatternSpans);
+ XAA_STATE_WRAP(FillColor8x8PatternSpans);
+ XAA_STATE_WRAP(FillCacheBltSpans);
+ XAA_STATE_WRAP(FillColorExpandSpans);
+ XAA_STATE_WRAP(FillCacheExpandSpans);
+ XAA_STATE_WRAP(TEGlyphRenderer);
+ XAA_STATE_WRAP(NonTEGlyphRenderer);
+ XAA_STATE_WRAP(WritePixmap);
+ XAA_STATE_WRAP(ReadPixmap);
+ XAA_STATE_WRAP(CopyArea);
+ XAA_STATE_WRAP(CopyPlane);
+ XAA_STATE_WRAP(PushPixelsSolid);
+ XAA_STATE_WRAP(PolyFillRectSolid);
+ XAA_STATE_WRAP(PolyFillRectStippled);
+ XAA_STATE_WRAP(PolyFillRectOpaqueStippled);
+ XAA_STATE_WRAP(PolyFillRectTiled);
+ XAA_STATE_WRAP(FillSpansSolid);
+ XAA_STATE_WRAP(FillSpansStippled);
+ XAA_STATE_WRAP(FillSpansOpaqueStippled);
+ XAA_STATE_WRAP(FillSpansTiled);
+ XAA_STATE_WRAP(PolyText8TE);
+ XAA_STATE_WRAP(PolyText16TE);
+ XAA_STATE_WRAP(ImageText8TE);
+ XAA_STATE_WRAP(ImageText16TE);
+ XAA_STATE_WRAP(ImageGlyphBltTE);
+ XAA_STATE_WRAP(PolyGlyphBltTE);
+ XAA_STATE_WRAP(PolyText8NonTE);
+ XAA_STATE_WRAP(PolyText16NonTE);
+ XAA_STATE_WRAP(ImageText8NonTE);
+ XAA_STATE_WRAP(ImageText16NonTE);
+ XAA_STATE_WRAP(ImageGlyphBltNonTE);
+ XAA_STATE_WRAP(PolyGlyphBltNonTE);
+ XAA_STATE_WRAP(PolyRectangleThinSolid);
+ XAA_STATE_WRAP(PolylinesWideSolid);
+ XAA_STATE_WRAP(PolylinesThinSolid);
+ XAA_STATE_WRAP(PolySegmentThinSolid);
+ XAA_STATE_WRAP(PolylinesThinDashed);
+ XAA_STATE_WRAP(PolySegmentThinDashed);
+ XAA_STATE_WRAP(FillPolygonSolid);
+ XAA_STATE_WRAP(FillPolygonStippled);
+ XAA_STATE_WRAP(FillPolygonOpaqueStippled);
+ XAA_STATE_WRAP(FillPolygonTiled);
+ XAA_STATE_WRAP(PolyFillArcSolid);
+ XAA_STATE_WRAP(PutImage);
+ XAA_STATE_WRAP(ValidateFillSpans);
+ XAA_STATE_WRAP(ValidateSetSpans);
+ XAA_STATE_WRAP(ValidatePutImage);
+ XAA_STATE_WRAP(ValidateCopyArea);
+ XAA_STATE_WRAP(ValidateCopyPlane);
+ XAA_STATE_WRAP(ValidatePolyPoint);
+ XAA_STATE_WRAP(ValidatePolylines);
+ XAA_STATE_WRAP(ValidatePolySegment);
+ XAA_STATE_WRAP(ValidatePolyRectangle);
+ XAA_STATE_WRAP(ValidatePolyArc);
+ XAA_STATE_WRAP(ValidateFillPolygon);
+ XAA_STATE_WRAP(ValidatePolyFillRect);
+ XAA_STATE_WRAP(ValidatePolyFillArc);
+ XAA_STATE_WRAP(ValidatePolyText8);
+ XAA_STATE_WRAP(ValidatePolyText16);
+ XAA_STATE_WRAP(ValidateImageText8);
+ XAA_STATE_WRAP(ValidateImageText16);
+ XAA_STATE_WRAP(ValidatePolyGlyphBlt);
+ XAA_STATE_WRAP(ValidateImageGlyphBlt);
+ XAA_STATE_WRAP(ValidatePushPixels);
+ XAA_STATE_WRAP(ComputeDash);
+ XAA_STATE_WRAP(InitPixmapCache);
+ XAA_STATE_WRAP(ClosePixmapCache);
+ XAA_STATE_WRAP(StippledFillChooser);
+ XAA_STATE_WRAP(OpaqueStippledFillChooser);
+ XAA_STATE_WRAP(TiledFillChooser);
+ XAA_STATE_WRAP(CacheTile);
+ XAA_STATE_WRAP(CacheStipple);
+ XAA_STATE_WRAP(CacheMonoStipple);
+ XAA_STATE_WRAP(CacheMono8x8Pattern);
+ XAA_STATE_WRAP(CacheColor8x8Pattern);
+ XAA_STATE_WRAP(WriteBitmapToCache);
+ XAA_STATE_WRAP(WritePixmapToCache);
+ XAA_STATE_WRAP(WriteMono8x8PatternToCache);
+ XAA_STATE_WRAP(WriteColor8x8PatternToCache);
+ XAA_STATE_WRAP(GetImage);
+ XAA_STATE_WRAP(GetSpans);
+ XAA_STATE_WRAP(PaintWindowBackground);
+ XAA_STATE_WRAP(PaintWindowBorder);
+ XAA_STATE_WRAP(CopyWindow);
+ XAA_STATE_WRAP(SaveAreas);
+ XAA_STATE_WRAP(RestoreAreas);
+ XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture);
+ XAA_STATE_WRAP(SetupForCPUToScreenTexture);
+
+ return TRUE;
+}
diff --git a/hw/xfree86/xaa/xaaStipple.c b/hw/xfree86/xaa/xaaStipple.c
new file mode 100644
index 000000000..8037a3eaf
--- /dev/null
+++ b/hw/xfree86/xaa/xaaStipple.c
@@ -0,0 +1,843 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaStipple.c,v 1.11 2001/10/28 03:34:04 tsi Exp $ */
+
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaacexp.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+
+static CARD32* StipplePowerOfTwo(CARD32*, CARD32*, int, int, int);
+static CARD32* StipplePowerOfTwo_Inverted(CARD32*, CARD32*, int, int, int);
+static CARD32* StippleUpTo32(CARD32*, CARD32*, int, int, int);
+static CARD32* StippleUpTo32_Inverted(CARD32*, CARD32*, int, int, int);
+static CARD32* StippleOver32(CARD32*, CARD32*, int, int, int);
+static CARD32* StippleOver32_Inverted(CARD32*, CARD32*, int, int, int);
+
+#ifdef TRIPLE_BITS
+#define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc3)
+#else
+#define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc)
+#endif
+
+StippleScanlineProcPtr stipple_scanline_func[6] = {
+ StipplePowerOfTwo,
+ StippleUpTo32,
+ StippleOver32,
+ StipplePowerOfTwo_Inverted,
+ StippleUpTo32_Inverted,
+ StippleOver32_Inverted
+};
+
+
+#ifdef FIXEDBASE
+# define DEST(i) *dest
+# define RETURN(i) return(dest)
+#else
+# define DEST(i) dest[i]
+# define RETURN(i) return(dest + i)
+#endif
+
+
+/* TRIPLE_BITS pattern expansion */
+#ifdef TRIPLE_BITS
+#define EXPAND_PAT \
+ CARD32 pat1 = byte_expand3[pat & 0xFF], \
+ pat2 = byte_expand3[(pat & 0xFF00) >> 8], \
+ pat3 = byte_expand3[(pat & 0xFF0000) >> 16], \
+ pat4 = byte_expand3[(pat & 0xFF000000) >> 24], \
+ patA = pat1 | (pat2 << 24), \
+ patB = (pat2 >> 8) | (pat3 << 16), \
+ patC = (pat3 >> 16) | (pat4 << 8)
+#ifdef FIXED_BASE
+#define WRITE_PAT1 { \
+ *dest = patA; }
+#define WRITE_PAT2 { \
+ *dest = patA; \
+ *dest = patB; }
+#define WRITE_PAT3 { \
+ *dest = patA; \
+ *dest = patB; \
+ *dest = patC; }
+#else
+#define WRITE_PAT1 { \
+ *(dest++) = patA; }
+#define WRITE_PAT2 { \
+ *(dest) = patA; \
+ *(dest + 1) = patB; \
+ dest += 2; }
+#define WRITE_PAT3 { \
+ *(dest) = patA; \
+ *(dest + 1) = patB; \
+ *(dest + 2) = patC; \
+ dest += 3; }
+#endif
+#endif
+
+
+#if !defined(FIXEDBASE) && !defined(MSBFIRST) && !defined(TRIPLE_BITS)
+
+unsigned int XAAShiftMasks[32] = {
+ /* gcc is rather pedantic about SHIFT_R(0xFFFFFFFF,32) */
+ 0x00000000 , SHIFT_R(0xFFFFFFFF,31),
+ SHIFT_R(0xFFFFFFFF,30), SHIFT_R(0xFFFFFFFF,29),
+ SHIFT_R(0xFFFFFFFF,28), SHIFT_R(0xFFFFFFFF,27),
+ SHIFT_R(0xFFFFFFFF,26), SHIFT_R(0xFFFFFFFF,25),
+ SHIFT_R(0xFFFFFFFF,24), SHIFT_R(0xFFFFFFFF,23),
+ SHIFT_R(0xFFFFFFFF,22), SHIFT_R(0xFFFFFFFF,21),
+ SHIFT_R(0xFFFFFFFF,20), SHIFT_R(0xFFFFFFFF,19),
+ SHIFT_R(0xFFFFFFFF,18), SHIFT_R(0xFFFFFFFF,17),
+ SHIFT_R(0xFFFFFFFF,16), SHIFT_R(0xFFFFFFFF,15),
+ SHIFT_R(0xFFFFFFFF,14), SHIFT_R(0xFFFFFFFF,13),
+ SHIFT_R(0xFFFFFFFF,12), SHIFT_R(0xFFFFFFFF,11),
+ SHIFT_R(0xFFFFFFFF,10), SHIFT_R(0xFFFFFFFF,9),
+ SHIFT_R(0xFFFFFFFF,8), SHIFT_R(0xFFFFFFFF,7),
+ SHIFT_R(0xFFFFFFFF,6), SHIFT_R(0xFFFFFFFF,5),
+ SHIFT_R(0xFFFFFFFF,4), SHIFT_R(0xFFFFFFFF,3),
+ SHIFT_R(0xFFFFFFFF,2), SHIFT_R(0xFFFFFFFF,1)
+};
+
+#endif
+
+void
+#ifdef TRIPLE_BITS
+EXPNAME(XAAFillColorExpandRects3)(
+#else
+EXPNAME(XAAFillColorExpandRects)(
+#endif
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32 *base;
+ Bool TwoPass = FALSE, FirstPass = TRUE;
+ StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
+ int stipplewidth = pPix->drawable.width;
+ int stippleheight = pPix->drawable.height;
+ int srcwidth = pPix->devKind;
+ int dwords, srcy, srcx, funcNo = 2, h;
+ unsigned char *src = (unsigned char*)pPix->devPrivate.ptr;
+ unsigned char *srcp;
+ int flag;
+
+ if(stipplewidth <= 32) {
+ if(stipplewidth & (stipplewidth - 1))
+ funcNo = 1;
+ else
+ funcNo = 0;
+ }
+ StippleFunc = stipple_scanline_func[funcNo];
+ SecondFunc = stipple_scanline_func[funcNo];
+ FirstFunc = stipple_scanline_func[funcNo + 3];
+
+#ifdef TRIPLE_BITS
+ if((bg == -1) ||
+ (!(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
+ (!(infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
+ (CHECK_RGB_EQUAL(bg))))) {
+#else
+ if((bg == -1) ||
+ !(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
+#endif
+ /* one pass */
+ } else if((rop == GXcopy) && infoRec->FillSolidRects) {
+ /* one pass but we fill background rects first */
+ (*infoRec->FillSolidRects)(pScrn, bg, rop, planemask, nBox, pBox);
+ bg = -1;
+ } else {
+ /* gotta do two passes */
+ TwoPass = TRUE;
+ }
+
+ if(!TwoPass)
+ (*infoRec->SetupForCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+
+ while(nBox--) {
+#ifdef TRIPLE_BITS
+ dwords = (3 * (pBox->x2 - pBox->x1) + 31) >> 5;
+#else
+ dwords = (pBox->x2 - pBox->x1 + 31) >> 5;
+#endif
+
+SECOND_PASS:
+ if(TwoPass) {
+ (*infoRec->SetupForCPUToScreenColorExpandFill)(pScrn,
+ (FirstPass) ? bg : fg, -1, rop, planemask);
+ StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
+ }
+
+ h = pBox->y2 - pBox->y1;
+ flag = (infoRec->CPUToScreenColorExpandFillFlags
+ & CPU_TRANSFER_PAD_QWORD) && ((dwords * h) & 0x01);
+
+ (*infoRec->SubsequentCPUToScreenColorExpandFill)(
+ pScrn, pBox->x1, pBox->y1,
+ pBox->x2 - pBox->x1, h, 0);
+
+ base = (CARD32*)infoRec->ColorExpandBase;
+
+ srcy = (pBox->y1 - yorg) % stippleheight;
+ if(srcy < 0) srcy += stippleheight;
+ srcx = (pBox->x1 - xorg) % stipplewidth;
+ if(srcx < 0) srcx += stipplewidth;
+
+ srcp = (srcwidth * srcy) + src;
+
+#ifndef FIXEDBASE
+ if((dwords * h) <= infoRec->ColorExpandRange) {
+ while(h--) {
+ base = (*StippleFunc)(
+ base, (CARD32*)srcp, srcx, stipplewidth, dwords);
+ srcy++;
+ srcp += srcwidth;
+ if (srcy >= stippleheight) {
+ srcy = 0;
+ srcp = src;
+ }
+ }
+ } else
+#endif
+ while(h--) {
+ (*StippleFunc)(base, (CARD32*)srcp, srcx, stipplewidth, dwords);
+ srcy++;
+ srcp += srcwidth;
+ if (srcy >= stippleheight) {
+ srcy = 0;
+ srcp = src;
+ }
+ }
+
+ if (flag) {
+ base = (CARD32*)infoRec->ColorExpandBase;
+ base[0] = 0x00000000;
+ }
+
+ if(TwoPass) {
+ if(FirstPass) {
+ FirstPass = FALSE;
+ goto SECOND_PASS;
+ } else FirstPass = TRUE;
+ }
+
+ pBox++;
+ }
+
+ if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+}
+
+
+
+void
+#ifdef TRIPLE_BITS
+EXPNAME(XAAFillColorExpandSpans3)(
+#else
+EXPNAME(XAAFillColorExpandSpans)(
+#endif
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32 *base;
+ Bool TwoPass = FALSE, FirstPass = TRUE;
+ StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
+ int stipplewidth = pPix->drawable.width;
+ int stippleheight = pPix->drawable.height;
+ int dwords, srcy, srcx, funcNo = 2;
+ unsigned char *srcp;
+
+ if(stipplewidth <= 32) {
+ if(stipplewidth & (stipplewidth - 1))
+ funcNo = 1;
+ else
+ funcNo = 0;
+ }
+ StippleFunc = stipple_scanline_func[funcNo];
+ SecondFunc = stipple_scanline_func[funcNo];
+ FirstFunc = stipple_scanline_func[funcNo + 3];
+
+#ifdef TRIPLE_BITS
+ if((bg == -1) ||
+ (!(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
+ (!(infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
+ (CHECK_RGB_EQUAL(bg))))) {
+#else
+ if((bg == -1) ||
+ !(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
+#endif
+ /* one pass */
+ } else if((rop == GXcopy) && infoRec->FillSolidSpans) {
+ /* one pass but we fill background rects first */
+ (*infoRec->FillSolidSpans)(
+ pScrn, bg, rop, planemask, n, ppt, pwidth, fSorted);
+ bg = -1;
+ } else {
+ /* gotta do two passes */
+ TwoPass = TRUE;
+ }
+
+ if(!TwoPass)
+ (*infoRec->SetupForCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+
+ while(n--) {
+#ifdef TRIPLE_BITS
+ dwords = (3 * *pwidth + 31) >> 5;
+#else
+ dwords = (*pwidth + 31) >> 5;
+#endif
+
+ srcy = (ppt->y - yorg) % stippleheight;
+ if(srcy < 0) srcy += stippleheight;
+ srcx = (ppt->x - xorg) % stipplewidth;
+ if(srcx < 0) srcx += stipplewidth;
+
+ srcp = (pPix->devKind * srcy) + (unsigned char*)pPix->devPrivate.ptr;
+
+SECOND_PASS:
+ if(TwoPass) {
+ (*infoRec->SetupForCPUToScreenColorExpandFill)(pScrn,
+ (FirstPass) ? bg : fg, -1, rop, planemask);
+ StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
+ }
+
+ (*infoRec->SubsequentCPUToScreenColorExpandFill)(pScrn, ppt->x, ppt->y,
+ *pwidth, 1, 0);
+
+ base = (CARD32*)infoRec->ColorExpandBase;
+
+ (*StippleFunc)(base, (CARD32*)srcp, srcx, stipplewidth, dwords);
+
+ if((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD)
+ && (dwords & 0x01)) {
+ base = (CARD32*)infoRec->ColorExpandBase;
+ base[0] = 0x00000000;
+ }
+
+ if(TwoPass) {
+ if(FirstPass) {
+ FirstPass = FALSE;
+ goto SECOND_PASS;
+ } else FirstPass = TRUE;
+ }
+
+ ppt++; pwidth++;
+ }
+
+ if(infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+}
+
+
+#ifndef FIXEDBASE
+
+void
+#ifdef TRIPLE_BITS
+EXPNAME(XAAFillScanlineColorExpandRects3)(
+#else
+EXPNAME(XAAFillScanlineColorExpandRects)(
+#endif
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32 *base;
+ Bool TwoPass = FALSE, FirstPass = TRUE;
+ StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
+ int stipplewidth = pPix->drawable.width;
+ int stippleheight = pPix->drawable.height;
+ int srcwidth = pPix->devKind;
+ int dwords, srcy, srcx, funcNo = 2, bufferNo, h;
+ unsigned char *src = pPix->devPrivate.ptr;
+ unsigned char *srcp;
+
+ if(stipplewidth <= 32) {
+ if(stipplewidth & (stipplewidth - 1))
+ funcNo = 1;
+ else
+ funcNo = 0;
+ }
+ StippleFunc = stipple_scanline_func[funcNo];
+ SecondFunc = stipple_scanline_func[funcNo];
+ FirstFunc = stipple_scanline_func[funcNo + 3];
+
+#ifdef TRIPLE_BITS
+ if((bg == -1) ||
+ (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
+ (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
+ (CHECK_RGB_EQUAL(bg))))) {
+#else
+ if((bg == -1) ||
+ !(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
+#endif
+ /* one pass */
+ } else if((rop == GXcopy) && infoRec->FillSolidRects) {
+ /* one pass but we fill background rects first */
+ (*infoRec->FillSolidRects)(pScrn, bg, rop, planemask, nBox, pBox);
+ bg = -1;
+ } else {
+ /* gotta do two passes */
+ TwoPass = TRUE;
+ }
+
+ if(!TwoPass)
+ (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+
+ while(nBox--) {
+#ifdef TRIPLE_BITS
+ dwords = (3 * (pBox->x2 - pBox->x1) + 31) >> 5;
+#else
+ dwords = (pBox->x2 - pBox->x1 + 31) >> 5;
+#endif
+
+SECOND_PASS:
+ if(TwoPass) {
+ (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(pScrn,
+ (FirstPass) ? bg : fg, -1, rop, planemask);
+ StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
+ }
+
+ h = pBox->y2 - pBox->y1;
+
+ (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
+ pScrn, pBox->x1, pBox->y1, pBox->x2 - pBox->x1, h, 0);
+
+ bufferNo = 0;
+
+ srcy = (pBox->y1 - yorg) % stippleheight;
+ if(srcy < 0) srcy += stippleheight;
+ srcx = (pBox->x1 - xorg) % stipplewidth;
+ if(srcx < 0) srcx += stipplewidth;
+
+ srcp = (srcwidth * srcy) + src;
+
+ while(h--) {
+ base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
+ (*StippleFunc)(base, (CARD32*)srcp, srcx, stipplewidth, dwords);
+ (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
+ if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
+ bufferNo = 0;
+ srcy++;
+ srcp += srcwidth;
+ if (srcy >= stippleheight) {
+ srcy = 0;
+ srcp = src;
+ }
+ }
+
+ if(TwoPass) {
+ if(FirstPass) {
+ FirstPass = FALSE;
+ goto SECOND_PASS;
+ } else FirstPass = TRUE;
+ }
+
+ pBox++;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+void
+#ifdef TRIPLE_BITS
+EXPNAME(XAAFillScanlineColorExpandSpans3)(
+#else
+EXPNAME(XAAFillScanlineColorExpandSpans)(
+#endif
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+){
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32 *base;
+ Bool TwoPass = FALSE, FirstPass = TRUE;
+ StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc;
+ int stipplewidth = pPix->drawable.width;
+ int stippleheight = pPix->drawable.height;
+ int dwords, srcy, srcx, funcNo = 2;
+ unsigned char *srcp;
+
+ if(stipplewidth <= 32) {
+ if(stipplewidth & (stipplewidth - 1))
+ funcNo = 1;
+ else
+ funcNo = 0;
+ }
+ StippleFunc = stipple_scanline_func[funcNo];
+ SecondFunc = stipple_scanline_func[funcNo];
+ FirstFunc = stipple_scanline_func[funcNo + 3];
+
+#ifdef TRIPLE_BITS
+ if((bg == -1) ||
+ (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) &&
+ (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) ||
+ (CHECK_RGB_EQUAL(bg))))) {
+#else
+ if((bg == -1) ||
+ !(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) {
+#endif
+ /* one pass */
+ } else if((rop == GXcopy) && infoRec->FillSolidSpans) {
+ /* one pass but we fill background rects first */
+ (*infoRec->FillSolidSpans)(
+ pScrn, bg, rop, planemask, n, ppt, pwidth, fSorted);
+ bg = -1;
+ } else {
+ /* gotta do two passes */
+ TwoPass = TRUE;
+ }
+
+ if(!TwoPass)
+ (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+
+
+ while(n--) {
+#ifdef TRIPLE_BITS
+ dwords = (3 * *pwidth + 31) >> 5;
+#else
+ dwords = (*pwidth + 31) >> 5;
+#endif
+
+ srcy = (ppt->y - yorg) % stippleheight;
+ if(srcy < 0) srcy += stippleheight;
+ srcx = (ppt->x - xorg) % stipplewidth;
+ if(srcx < 0) srcx += stipplewidth;
+
+ srcp = (pPix->devKind * srcy) + (unsigned char*)pPix->devPrivate.ptr;
+
+SECOND_PASS:
+ if(TwoPass) {
+ (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(pScrn,
+ (FirstPass) ? bg : fg, -1, rop, planemask);
+ StippleFunc = (FirstPass) ? FirstFunc : SecondFunc;
+ }
+
+ (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
+ pScrn, ppt->x, ppt->y, *pwidth, 1, 0);
+
+ base = (CARD32*)infoRec->ScanlineColorExpandBuffers[0];
+
+ (*StippleFunc)(base, (CARD32*)srcp, srcx, stipplewidth, dwords);
+ (*infoRec->SubsequentColorExpandScanline)(pScrn, 0);
+
+ if(TwoPass) {
+ if(FirstPass) {
+ FirstPass = FALSE;
+ goto SECOND_PASS;
+ } else FirstPass = TRUE;
+ }
+
+ ppt++; pwidth++;
+ }
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+#endif
+
+static CARD32 *
+StipplePowerOfTwo(
+ CARD32* dest, CARD32* src,
+ int shift, int width, int dwords
+){
+ CARD32 pat = *src;
+ if(width < 32) {
+ pat &= XAAShiftMasks[width];
+ while(width < 32) {
+ pat |= SHIFT_L(pat,width);
+ width <<= 1;
+ }
+ }
+
+ if(shift)
+ pat = SHIFT_R(pat,shift) | SHIFT_L(pat,32 - shift);
+
+#ifdef MSBFIRST
+ pat = SWAP_BITS_IN_BYTES(pat);
+#endif
+
+#ifdef TRIPLE_BITS
+ {
+ EXPAND_PAT;
+
+ while(dwords >= 3) {
+ WRITE_PAT3;
+ dwords -= 3;
+ }
+ if (dwords == 2) {
+ WRITE_PAT2;
+ } else if (dwords == 1) {
+ WRITE_PAT1;
+ }
+
+ return dest;
+ }
+#else /* TRIPLE_BITS */
+ while(dwords >= 4) {
+ DEST(0) = pat;
+ DEST(1) = pat;
+ DEST(2) = pat;
+ DEST(3) = pat;
+ dwords -= 4;
+#ifndef FIXEDBASE
+ dest += 4;
+#endif
+ }
+
+ if(!dwords) return dest;
+ DEST(0) = pat;
+ if(dwords == 1) RETURN(1);
+ DEST(1) = pat;
+ if(dwords == 2) RETURN(2);
+ DEST(2) = pat;
+ RETURN(3);
+#endif /* TRIPLE_BITS */
+}
+
+static CARD32 *
+StipplePowerOfTwo_Inverted(
+ CARD32* dest, CARD32* src,
+ int shift, int width, int dwords
+){
+ CARD32 pat = *src;
+ if(width < 32) {
+ pat &= XAAShiftMasks[width];
+ while(width < 32) {
+ pat |= SHIFT_L(pat,width);
+ width <<= 1;
+ }
+ }
+
+ if(shift)
+ pat = SHIFT_R(pat,shift) | SHIFT_L(pat,32 - shift);
+
+#ifdef MSBFIRST
+ pat = SWAP_BITS_IN_BYTES(pat);
+#endif
+
+ pat = ~pat;
+
+#ifdef TRIPLE_BITS
+ {
+ EXPAND_PAT;
+
+ while(dwords >= 3) {
+ WRITE_PAT3;
+ dwords -= 3;
+ }
+ if (dwords == 2) {
+ WRITE_PAT2;
+ } else if (dwords == 1) {
+ WRITE_PAT1;
+ }
+
+ return dest;
+ }
+#else /* TRIPLE_BITS */
+ while(dwords >= 4) {
+ DEST(0) = pat;
+ DEST(1) = pat;
+ DEST(2) = pat;
+ DEST(3) = pat;
+ dwords -= 4;
+#ifndef FIXEDBASE
+ dest += 4;
+#endif
+ }
+
+ if(!dwords) return dest;
+ DEST(0) = pat;
+ if(dwords == 1) RETURN(1);
+ DEST(1) = pat;
+ if(dwords == 2) RETURN(2);
+ DEST(2) = pat;
+ RETURN(3);
+#endif /* TRIPLE_BITS */
+}
+
+
+static CARD32 *
+StippleUpTo32(
+ CARD32* base, CARD32* src,
+ int shift, int width, int dwords
+){
+ CARD32 pat = *src & XAAShiftMasks[width];
+
+ while(width <= 15) {
+ pat |= SHIFT_L(pat,width);
+ width <<= 1;
+ }
+ pat |= SHIFT_L(pat,width);
+
+ while(dwords--) {
+ CARD32 bits = SHIFT_R(pat,shift) | SHIFT_L(pat,width-shift);
+#ifdef TRIPLE_BITS
+ if(dwords >= 2) {
+ WRITE_BITS3(bits);
+ dwords -= 2;
+ } else if(dwords > 0) {
+ WRITE_BITS2(bits);
+ dwords--;
+ } else {
+ WRITE_BITS1(bits);
+ }
+#else
+ WRITE_BITS(bits);
+#endif
+
+ shift += 32;
+ shift %= width;
+ }
+ return base;
+}
+
+
+static CARD32 *
+StippleUpTo32_Inverted(
+ CARD32* base, CARD32* src,
+ int shift, int width, int dwords
+){
+ CARD32 pat = *src & XAAShiftMasks[width];
+
+ while(width <= 15) {
+ pat |= SHIFT_L(pat,width);
+ width <<= 1;
+ }
+ pat |= SHIFT_L(pat,width);
+
+ while(dwords--) {
+ CARD32 bits = ~(SHIFT_R(pat,shift) | SHIFT_L(pat,width-shift));
+#ifdef TRIPLE_BITS
+ if(dwords >= 2) {
+ WRITE_BITS3(bits);
+ dwords -= 2;
+ } else if(dwords > 0) {
+ WRITE_BITS2(bits);
+ dwords--;
+ } else {
+ WRITE_BITS1(bits);
+ }
+#else
+ WRITE_BITS(bits);
+#endif
+
+ shift += 32;
+ shift %= width;
+ }
+ return base;
+}
+
+
+static CARD32 *
+StippleOver32(
+ CARD32* base, CARD32* src,
+ int offset, int width, int dwords
+){
+ CARD32* srcp;
+ CARD32 bits;
+ int bitsleft, shift;
+
+ while(dwords--) {
+ bitsleft = width - offset;
+ srcp = src + (offset >> 5);
+ shift = offset & 31;
+
+ if(bitsleft < 32)
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
+ else if(shift)
+ bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],32-shift);
+ else
+ bits = *srcp;
+
+#ifdef TRIPLE_BITS
+ if(dwords >= 2) {
+ WRITE_BITS3(bits);
+ dwords -= 2;
+ } else if(dwords > 0) {
+ WRITE_BITS2(bits);
+ dwords--;
+ } else {
+ WRITE_BITS1(bits);
+ }
+#else
+ WRITE_BITS(bits);
+#endif
+
+ offset += 32;
+ offset %= width;
+ }
+ return base;
+}
+
+
+static CARD32 *
+StippleOver32_Inverted(
+ CARD32* base, CARD32* src,
+ int offset, int width, int dwords
+){
+ CARD32* srcp;
+ CARD32 bits;
+ int bitsleft, shift;
+
+ while(dwords--) {
+ bitsleft = width - offset;
+ srcp = src + (offset >> 5);
+ shift = offset & 31;
+
+ if(bitsleft < 32)
+ bits = SHIFT_L(*src,bitsleft) |
+ (SHIFT_R(*srcp,shift) & XAAShiftMasks[bitsleft]);
+ else if(shift)
+ bits = SHIFT_R(*srcp,shift) | SHIFT_L(srcp[1],32-shift);
+ else
+ bits = *srcp;
+
+ bits = ~bits;
+
+#ifdef TRIPLE_BITS
+ if(dwords >= 2) {
+ WRITE_BITS3(bits);
+ dwords -= 2;
+ } else if(dwords > 0) {
+ WRITE_BITS2(bits);
+ dwords--;
+ } else {
+ WRITE_BITS1(bits);
+ }
+#else
+ WRITE_BITS(bits);
+#endif
+
+ offset += 32;
+ offset %= width;
+ }
+ return base;
+}
diff --git a/hw/xfree86/xaa/xaaTEGlyph.c b/hw/xfree86/xaa/xaaTEGlyph.c
new file mode 100644
index 000000000..845dccd4e
--- /dev/null
+++ b/hw/xfree86/xaa/xaaTEGlyph.c
@@ -0,0 +1,1072 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTEGlyph.c,v 1.9 2000/09/01 05:49:45 mvojkovi Exp $ */
+
+
+#include "xaa.h"
+#include "xaalocal.h"
+#include "xaacexp.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+
+
+/* scanline function for TRIPLE_BITS_24BPP */
+static CARD32 *DrawTextScanline3(CARD32 *base, CARD32 *mem, int width);
+
+/* Loop unrolled functions for common font widths */
+static CARD32 *DrawTETextScanlineGeneric(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth7(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth10(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth12(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth14(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth16(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth18(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth24(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+
+
+#ifdef USEASSEMBLER
+# ifdef FIXEDBASE
+# ifdef MSBFIRST
+CARD32 *DrawTETextScanlineWidth6PMSBFirstFixedBase(CARD32 *base,
+ unsigned int **glyphp, int line, int width, int glyphwidth);
+CARD32 *DrawTETextScanlineWidth8PMSBFirstFixedBase(CARD32 *base,
+ unsigned int **glyphp, int line, int width, int glyphwidth);
+CARD32 *DrawTETextScanlineWidth9PMSBFirstFixedBase(CARD32 *base,
+ unsigned int **glyphp, int line, int width, int glyphwidth);
+# else
+CARD32 *DrawTETextScanlineWidth6PLSBFirstFixedBase(CARD32 *base,
+ unsigned int **glyphp, int line, int width, int glyphwidth);
+CARD32 *DrawTETextScanlineWidth8PLSBFirstFixedBase(CARD32 *base,
+ unsigned int **glyphp, int line, int width, int glyphwidth);
+CARD32 *DrawTETextScanlineWidth9PLSBFirstFixedBase(CARD32 *base,
+ unsigned int **glyphp, int line, int width, int glyphwidth);
+# endif
+# else
+# ifdef MSBFIRST
+CARD32 *DrawTETextScanlineWidth6PMSBFirst(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+CARD32 *DrawTETextScanlineWidth8PMSBFirst(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+CARD32 *DrawTETextScanlineWidth9PMSBFirst(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+# else
+CARD32 *DrawTETextScanlineWidth6PLSBFirst(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+CARD32 *DrawTETextScanlineWidth8PLSBFirst(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+CARD32 *DrawTETextScanlineWidth9PLSBFirst(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+# endif
+# endif
+#else
+static CARD32 *DrawTETextScanlineWidth6(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth8(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+static CARD32 *DrawTETextScanlineWidth9(CARD32 *base, unsigned int **glyphp,
+ int line, int width, int glyphwidth);
+#endif
+
+#define glyph_scanline_func EXPNAME(XAAGlyphScanlineFunc)
+
+
+
+GlyphScanlineFuncPtr glyph_scanline_func[32] = {
+ DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
+ DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
+ DrawTETextScanlineGeneric,
+#ifdef USEASSEMBLER
+# ifdef FIXEDBASE
+# ifdef MSBFIRST
+ DrawTETextScanlineWidth6PMSBFirstFixedBase,
+ DrawTETextScanlineWidth7,
+ DrawTETextScanlineWidth8PMSBFirstFixedBase,
+ DrawTETextScanlineWidth9PMSBFirstFixedBase,
+# else
+ DrawTETextScanlineWidth6PLSBFirstFixedBase,
+ DrawTETextScanlineWidth7,
+ DrawTETextScanlineWidth8PLSBFirstFixedBase,
+ DrawTETextScanlineWidth9PLSBFirstFixedBase,
+# endif
+# else
+# ifdef MSBFIRST
+ DrawTETextScanlineWidth6PMSBFirst,
+ DrawTETextScanlineWidth7,
+ DrawTETextScanlineWidth8PMSBFirst,
+ DrawTETextScanlineWidth9PMSBFirst,
+# else
+ DrawTETextScanlineWidth6PLSBFirst,
+ DrawTETextScanlineWidth7,
+ DrawTETextScanlineWidth8PLSBFirst,
+ DrawTETextScanlineWidth9PLSBFirst,
+# endif
+# endif
+#else
+ DrawTETextScanlineWidth6, DrawTETextScanlineWidth7,
+ DrawTETextScanlineWidth8, DrawTETextScanlineWidth9,
+#endif
+ DrawTETextScanlineWidth10,
+ DrawTETextScanlineGeneric, DrawTETextScanlineWidth12,
+ DrawTETextScanlineGeneric, DrawTETextScanlineWidth14,
+ DrawTETextScanlineGeneric, DrawTETextScanlineWidth16,
+ DrawTETextScanlineGeneric, DrawTETextScanlineWidth18,
+ DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
+ DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
+ DrawTETextScanlineGeneric, DrawTETextScanlineWidth24,
+ DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
+ DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
+ DrawTETextScanlineGeneric, DrawTETextScanlineGeneric,
+ DrawTETextScanlineGeneric, DrawTETextScanlineGeneric
+};
+
+
+/********************************************************************
+
+ Here we have TEGlyphRenders for a bunch of different color
+ expansion types. The driver may provide its own renderer, but
+ this is the default one which renders using lower-level primitives
+ exported by the chipset driver.
+
+********************************************************************/
+
+/* This gets built for MSBFIRST or LSBFIRST with FIXEDBASE or not.
+ A total of 4 versions */
+
+void
+EXPNAME(XAATEGlyphRenderer)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32* base;
+ GlyphScanlineFuncPtr GlyphFunc = glyph_scanline_func[glyphWidth - 1];
+ int dwords = 0;
+
+ if((bg != -1) && (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
+ (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
+ bg = -1;
+ }
+
+ (*infoRec->SetupForCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+
+ if(skipleft &&
+ (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING) ||
+ (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
+ (skipleft > x)))) {
+ /* draw the first character only */
+
+ int count = h, line = startline;
+ int width = glyphWidth - skipleft;
+
+ if(width > w) width = w;
+
+ (*infoRec->SubsequentCPUToScreenColorExpandFill)(
+ pScrn, x, y, width, h, 0);
+
+ base = (CARD32*)infoRec->ColorExpandBase;
+
+ while(count--) {
+ register CARD32 tmp = SHIFT_R(glyphs[0][line++],skipleft);
+ WRITE_BITS(tmp);
+ }
+
+ w -= width;
+ if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
+ ((((width + 31) >> 5) * h) & 1)) {
+ base = (CARD32*)infoRec->ColorExpandBase;
+ base[0] = 0x00000000;
+ }
+ if(!w) goto THE_END;
+ glyphs++;
+ x += width;
+ skipleft = 0; /* nicely aligned again */
+ }
+
+ w += skipleft;
+ x -= skipleft;
+ dwords = ((w + 31) >> 5) * h;
+
+ (*infoRec->SubsequentCPUToScreenColorExpandFill)(
+ pScrn, x, y, w, h, skipleft);
+
+ base = (CARD32*)infoRec->ColorExpandBase;
+
+#ifndef FIXEDBASE
+ if((((w + 31) >> 5) * h) <= infoRec->ColorExpandRange)
+ while(h--) {
+ base = (*GlyphFunc)(base, glyphs, startline++, w, glyphWidth);
+ }
+ else
+#endif
+ while(h--) {
+ (*GlyphFunc)(base, glyphs, startline++, w, glyphWidth);
+ }
+
+ if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
+ (dwords & 1)) {
+ base = (CARD32*)infoRec->ColorExpandBase;
+ base[0] = 0x00000000;
+ }
+
+THE_END:
+
+ if(infoRec->TEGlyphRendererFlags & SYNC_AFTER_COLOR_EXPAND)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+}
+
+/********************************************************************
+
+ This is the GlyphRenderer for TRIPLE_BITS_24BPP. It renders to a buffer
+ with the non FIXEDBASE LSB_FIRST code before tripling, and possibly
+ reversing the bits and sending them to the screen
+
+********************************************************************/
+
+void
+EXPNAME(XAATEGlyphRenderer3)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ CARD32 *base, *mem;
+ GlyphScanlineFuncPtr GlyphFunc = XAAGlyphScanlineFuncLSBFirst[glyphWidth - 1];
+ int dwords = 0;
+
+ if((bg != -1) &&
+ ((infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY) ||
+ ((infoRec->TEGlyphRendererFlags & RGB_EQUAL) &&
+ (!CHECK_RGB_EQUAL(bg))))) {
+ (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
+ bg = -1;
+ }
+
+ (*infoRec->SetupForCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+
+ if(skipleft) {
+ /* draw the first character only */
+
+ int count = h, line = startline;
+ int width = glyphWidth - skipleft;
+ CARD32 bits;
+
+ if(width > w) width = w;
+ (*infoRec->SubsequentCPUToScreenColorExpandFill)(
+ pScrn, x, y, width, h, 0);
+
+ base = (CARD32*)infoRec->ColorExpandBase;
+
+ while(count--) {
+ bits = SHIFT_R(glyphs[0][line++],skipleft);
+ if (width >= 22) {
+ WRITE_BITS3(bits);
+ } else if (width >= 11) {
+ WRITE_BITS2(bits);
+ } else {
+ WRITE_BITS1(bits);
+ }
+ }
+
+ w -= width;
+ if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
+ ((((3 * width + 31) >> 5) * h) & 1)) {
+ base = (CARD32*)infoRec->ColorExpandBase;
+ base[0] = 0x00000000;
+ }
+ if(!w) goto THE_END;
+ glyphs++;
+ x += width;
+ skipleft = 0; /* nicely aligned again */
+ }
+
+ dwords = ((3 * w + 31) >> 5) * h;
+ mem = (CARD32*)ALLOCATE_LOCAL(((w + 31) >> 3) * sizeof(char));
+ if (!mem) return;
+
+ (*infoRec->SubsequentCPUToScreenColorExpandFill)(pScrn, x, y, w, h, 0);
+
+ base = (CARD32*)infoRec->ColorExpandBase;
+
+# ifndef FIXEDBASE
+ if((((3 * w + 31) >> 5) * h) <= infoRec->ColorExpandRange)
+ while(h--) {
+ (*GlyphFunc)(mem, glyphs, startline++, w, glyphWidth);
+ base = DrawTextScanline3(base, mem, w);
+ }
+ else
+# endif
+ while(h--) {
+ (*GlyphFunc)(mem, glyphs, startline++, w, glyphWidth);
+ DrawTextScanline3(base, mem, w);
+ }
+
+ DEALLOCATE_LOCAL(mem);
+
+ if((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) &&
+ (dwords & 1)) {
+ base = (CARD32*)infoRec->ColorExpandBase;
+ base[0] = 0x00000000;
+ }
+
+THE_END:
+
+ if(infoRec->TEGlyphRendererFlags & SYNC_AFTER_COLOR_EXPAND)
+ (*infoRec->Sync)(pScrn);
+ else SET_SYNC_FLAG(infoRec);
+}
+
+
+#ifndef FIXEDBASE
+/* Scanline version of above gets built for LSBFIRST and MSBFIRST */
+
+void
+EXPNAME(XAATEGlyphRendererScanline)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int bufferNo;
+ CARD32* base;
+ GlyphScanlineFuncPtr GlyphFunc = glyph_scanline_func[glyphWidth - 1];
+
+ if((bg != -1) && (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) {
+ (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
+ bg = -1;
+ }
+
+ (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+
+ if(skipleft &&
+ (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING) ||
+ (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) &&
+ (skipleft > x)))) {
+ /* draw the first character only */
+
+ int count = h, line = startline;
+ int width = glyphWidth - skipleft;
+
+ if(width > w) width = w;
+
+ (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
+ pScrn, x, y, width, h, 0);
+
+ bufferNo = 0;
+
+ while(count--) {
+ register CARD32 tmp = SHIFT_R(glyphs[0][line++],skipleft);
+ base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
+ WRITE_BITS(tmp);
+ (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
+ if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
+ bufferNo = 0;
+ }
+
+ w -= width;
+ if(!w) goto THE_END;
+ glyphs++;
+ x += width;
+ skipleft = 0; /* nicely aligned again */
+ }
+
+ w += skipleft;
+ x -= skipleft;
+
+ (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
+ pScrn, x, y, w, h, skipleft);
+
+ bufferNo = 0;
+
+ while(h--) {
+ base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
+ (*GlyphFunc)(base, glyphs, startline++, w, glyphWidth);
+ (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
+ if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
+ bufferNo = 0;
+ }
+
+THE_END:
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+void
+EXPNAME(XAATEGlyphRendererScanline3)(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int bufferNo;
+ CARD32 *base, *mem;
+ GlyphScanlineFuncPtr GlyphFunc = XAAGlyphScanlineFuncLSBFirst[glyphWidth - 1];
+
+ if((bg != -1) &&
+ ((infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY) ||
+ ((infoRec->TEGlyphRendererFlags & RGB_EQUAL) &&
+ (!CHECK_RGB_EQUAL(bg))))) {
+ (*infoRec->SetupForSolidFill)(pScrn, bg, rop, planemask);
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h);
+ bg = -1;
+ }
+
+ (*infoRec->SetupForScanlineCPUToScreenColorExpandFill)(
+ pScrn, fg, bg, rop, planemask);
+
+ if(skipleft) {
+ /* draw the first character only */
+
+ int count = h, line = startline;
+ int width = glyphWidth - skipleft;
+ CARD32 bits;
+
+ if(width > w) width = w;
+
+ (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
+ pScrn, x, y, width, h, 0);
+
+ bufferNo = 0;
+
+ while(count--) {
+ base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
+ bits = SHIFT_R(glyphs[0][line++],skipleft);
+ if (width >= 22) {
+ WRITE_BITS3(bits);
+ } else if (width >= 11) {
+ WRITE_BITS2(bits);
+ } else {
+ WRITE_BITS1(bits);
+ }
+ (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
+ if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
+ bufferNo = 0;
+ }
+
+ w -= width;
+ if(!w) goto THE_END;
+ glyphs++;
+ x += width;
+ skipleft = 0; /* nicely aligned again */
+ }
+
+ w += skipleft;
+ x -= skipleft;
+ mem = (CARD32*)ALLOCATE_LOCAL(((w + 31) >> 3) * sizeof(char));
+ if (!mem) return;
+
+ (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill)(
+ pScrn, x, y, w, h, skipleft);
+
+ bufferNo = 0;
+
+ while(h--) {
+ base = (CARD32*)infoRec->ScanlineColorExpandBuffers[bufferNo];
+ (*GlyphFunc)(mem, glyphs, startline++, w, glyphWidth);
+ DrawTextScanline3(base, mem, w);
+ (*infoRec->SubsequentColorExpandScanline)(pScrn, bufferNo++);
+ if(bufferNo >= infoRec->NumScanlineColorExpandBuffers)
+ bufferNo = 0;
+ }
+
+ DEALLOCATE_LOCAL(mem);
+
+THE_END:
+
+ SET_SYNC_FLAG(infoRec);
+}
+
+#endif
+
+
+
+/********************************************************************
+
+ TRIPLE_BITS_24BPP scanline rendering code.
+
+********************************************************************/
+
+
+
+static CARD32*
+DrawTextScanline3(
+ CARD32 *base,
+ CARD32 *mem,
+ int width )
+{
+
+ while(width > 32) {
+ WRITE_BITS3(*mem);
+ mem++;
+ width -= 32;
+ }
+ if(width) {
+ if (width >= 22) {
+ WRITE_BITS3(*mem);
+ } else if (width >= 11) {
+ WRITE_BITS2(*mem);
+ } else {
+ WRITE_BITS1(*mem);
+ }
+ }
+
+ return base;
+}
+
+
+/********************************************************************
+
+ Generic TE scanline rendering code.
+
+********************************************************************/
+
+
+
+static CARD32*
+DrawTETextScanlineGeneric(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ CARD32 bits = (*glyphp)[line];
+ int shift = glyphwidth;
+
+ while(width > 32) {
+ while(shift < 32) {
+ glyphp++;
+ bits |= SHIFT_L((*glyphp)[line], shift);
+ shift += glyphwidth;
+ }
+ WRITE_BITS(bits);
+ shift &= 31;
+ if(shift)
+ bits = SHIFT_R((*glyphp)[line],(glyphwidth - shift));
+ else bits = 0;
+ width -= 32;
+ }
+
+ if(width) {
+ width -= shift;
+ while(width > 0) {
+ glyphp++;
+ bits |= SHIFT_L((*glyphp)[line],shift);
+ shift += glyphwidth;
+ width -= glyphwidth;
+ }
+ WRITE_BITS(bits);
+ }
+
+ return base;
+}
+
+
+/********************************************************************
+
+ Loop unrolled TE font scanline rendering code
+
+********************************************************************/
+
+
+#ifndef USEASSEMBLER
+static CARD32*
+DrawTETextScanlineWidth6(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],6);
+ bits |= SHIFT_L(glyphp[2][line],12);
+ bits |= SHIFT_L(glyphp[3][line],18);
+ bits |= SHIFT_L(glyphp[4][line],24);
+ bits |= SHIFT_L(glyphp[5][line],30);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = SHIFT_R(glyphp[5][line],2);
+ bits |= SHIFT_L(glyphp[6][line],4);
+ bits |= SHIFT_L(glyphp[7][line],10);
+ bits |= SHIFT_L(glyphp[8][line],16);
+ bits |= SHIFT_L(glyphp[9][line],22);
+ bits |= SHIFT_L(glyphp[10][line],28);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = SHIFT_R(glyphp[10][line],4);
+ bits |= SHIFT_L(glyphp[11][line],2);
+ bits |= SHIFT_L(glyphp[12][line],8);
+ bits |= SHIFT_L(glyphp[13][line],14);
+ bits |= SHIFT_L(glyphp[14][line],20);
+ bits |= SHIFT_L(glyphp[15][line],26);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+#ifndef FIXEDBASE
+ base += 3;
+#endif
+ width -= 96;
+ glyphp += 16;
+ }
+ return base;
+}
+#endif
+
+static CARD32*
+DrawTETextScanlineWidth7(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],7);
+ bits |= SHIFT_L(glyphp[2][line],14);
+ bits |= SHIFT_L(glyphp[3][line],21);
+ bits |= SHIFT_L(glyphp[4][line],28);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = SHIFT_R(glyphp[4][line],4);
+ bits |= SHIFT_L(glyphp[5][line],3);
+ bits |= SHIFT_L(glyphp[6][line],10);
+ bits |= SHIFT_L(glyphp[7][line],17);
+ bits |= SHIFT_L(glyphp[8][line],24);
+ bits |= SHIFT_L(glyphp[9][line],31);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = SHIFT_R(glyphp[9][line],1);
+ bits |= SHIFT_L(glyphp[10][line],6);
+ bits |= SHIFT_L(glyphp[11][line],13);
+ bits |= SHIFT_L(glyphp[12][line],20);
+ bits |= SHIFT_L(glyphp[13][line],27);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+ bits = SHIFT_R(glyphp[13][line],5);
+ bits |= SHIFT_L(glyphp[14][line],2);
+ bits |= SHIFT_L(glyphp[15][line],9);
+ bits |= SHIFT_L(glyphp[16][line],16);
+ bits |= SHIFT_L(glyphp[17][line],23);
+ bits |= SHIFT_L(glyphp[18][line],30);
+ WRITE_IN_BITORDER(base, 3, bits);
+ CHECKRETURN(4);
+ bits = SHIFT_R(glyphp[18][line],2);
+ bits |= SHIFT_L(glyphp[19][line],5);
+ bits |= SHIFT_L(glyphp[20][line],12);
+ bits |= SHIFT_L(glyphp[21][line],19);
+ bits |= SHIFT_L(glyphp[22][line],26);
+ WRITE_IN_BITORDER(base, 4, bits);
+ CHECKRETURN(5);
+ bits = SHIFT_R(glyphp[22][line],6);
+ bits |= SHIFT_L(glyphp[23][line],1);
+ bits |= SHIFT_L(glyphp[24][line],8);
+ bits |= SHIFT_L(glyphp[25][line],15);
+ bits |= SHIFT_L(glyphp[26][line],22);
+ bits |= SHIFT_L(glyphp[27][line],29);
+ WRITE_IN_BITORDER(base, 5, bits);
+ CHECKRETURN(6);
+ bits = SHIFT_R(glyphp[27][line],3);
+ bits |= SHIFT_L(glyphp[28][line],4);
+ bits |= SHIFT_L(glyphp[29][line],11);
+ bits |= SHIFT_L(glyphp[30][line],18);
+ bits |= SHIFT_L(glyphp[31][line],25);
+ WRITE_IN_BITORDER(base, 6, bits);
+ CHECKRETURN(7);
+#ifndef FIXEDBASE
+ base += 7;
+#endif
+ width -= 224;
+ glyphp += 32;
+ }
+ return base;
+}
+
+
+#ifndef USEASSEMBLER
+static CARD32*
+DrawTETextScanlineWidth8(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],8);
+ bits |= SHIFT_L(glyphp[2][line],16);
+ bits |= SHIFT_L(glyphp[3][line],24);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = glyphp[4][line];
+ bits |= SHIFT_L(glyphp[5][line],8);
+ bits |= SHIFT_L(glyphp[6][line],16);
+ bits |= SHIFT_L(glyphp[7][line],24);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+#ifndef FIXEDBASE
+ base += 2;
+#endif
+ width -= 64;
+ glyphp += 8;
+ }
+ return base;
+}
+#endif
+
+#ifndef USEASSEMBLER
+static CARD32*
+DrawTETextScanlineWidth9(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],9);
+ bits |= SHIFT_L(glyphp[2][line],18);
+ bits |= SHIFT_L(glyphp[3][line],27);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = SHIFT_R(glyphp[3][line],5);
+ bits |= SHIFT_L(glyphp[4][line],4);
+ bits |= SHIFT_L(glyphp[5][line],13);
+ bits |= SHIFT_L(glyphp[6][line],22);
+ bits |= SHIFT_L(glyphp[7][line],31);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = SHIFT_R(glyphp[7][line],1);
+ bits |= SHIFT_L(glyphp[8][line],8);
+ bits |= SHIFT_L(glyphp[9][line],17);
+ bits |= SHIFT_L(glyphp[10][line],26);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+ bits = SHIFT_R(glyphp[10][line],6);
+ bits |= SHIFT_L(glyphp[11][line],3);
+ bits |= SHIFT_L(glyphp[12][line],12);
+ bits |= SHIFT_L(glyphp[13][line],21);
+ bits |= SHIFT_L(glyphp[14][line],30);
+ WRITE_IN_BITORDER(base, 3, bits);
+ CHECKRETURN(4);
+ bits = SHIFT_R(glyphp[14][line],2);
+ bits |= SHIFT_L(glyphp[15][line],7);
+ bits |= SHIFT_L(glyphp[16][line],16);
+ bits |= SHIFT_L(glyphp[17][line],25);
+ WRITE_IN_BITORDER(base, 4, bits);
+ CHECKRETURN(5);
+ bits = SHIFT_R(glyphp[17][line],7);
+ bits |= SHIFT_L(glyphp[18][line],2);
+ bits |= SHIFT_L(glyphp[19][line],11);
+ bits |= SHIFT_L(glyphp[20][line],20);
+ bits |= SHIFT_L(glyphp[21][line],29);
+ WRITE_IN_BITORDER(base, 5, bits);
+ CHECKRETURN(6);
+ bits = SHIFT_R(glyphp[21][line],3);
+ bits |= SHIFT_L(glyphp[22][line],6);
+ bits |= SHIFT_L(glyphp[23][line],15);
+ bits |= SHIFT_L(glyphp[24][line],24);
+ WRITE_IN_BITORDER(base, 6, bits);
+ CHECKRETURN(7);
+ bits = SHIFT_R(glyphp[24][line],8);
+ bits |= SHIFT_L(glyphp[25][line],1);
+ bits |= SHIFT_L(glyphp[26][line],10);
+ bits |= SHIFT_L(glyphp[27][line],19);
+ bits |= SHIFT_L(glyphp[28][line],28);
+ WRITE_IN_BITORDER(base, 7, bits);
+ CHECKRETURN(8);
+ bits = SHIFT_R(glyphp[28][line],4);
+ bits |= SHIFT_L(glyphp[29][line],5);
+ bits |= SHIFT_L(glyphp[30][line],14);
+ bits |= SHIFT_L(glyphp[31][line],23);
+ WRITE_IN_BITORDER(base, 8, bits);
+ CHECKRETURN(9);
+#ifndef FIXEDBASE
+ base += 9;
+#endif
+ width -= 288;
+ glyphp += 32;
+ }
+ return base;
+}
+#endif
+
+static CARD32*
+DrawTETextScanlineWidth10(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],10);
+ bits |= SHIFT_L(glyphp[2][line],20);
+ bits |= SHIFT_L(glyphp[3][line],30);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = SHIFT_R(glyphp[3][line],2);
+ bits |= SHIFT_L(glyphp[4][line],8);
+ bits |= SHIFT_L(glyphp[5][line],18);
+ bits |= SHIFT_L(glyphp[6][line],28);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = SHIFT_R(glyphp[6][line],4);
+ bits |= SHIFT_L(glyphp[7][line],6);
+ bits |= SHIFT_L(glyphp[8][line],16);
+ bits |= SHIFT_L(glyphp[9][line],26);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+ bits = SHIFT_R(glyphp[9][line],6);
+ bits |= SHIFT_L(glyphp[10][line],4);
+ bits |= SHIFT_L(glyphp[11][line],14);
+ bits |= SHIFT_L(glyphp[12][line],24);
+ WRITE_IN_BITORDER(base, 3, bits);
+ CHECKRETURN(4);
+ bits = SHIFT_R(glyphp[12][line],8);
+ bits |= SHIFT_L(glyphp[13][line],2);
+ bits |= SHIFT_L(glyphp[14][line],12);
+ bits |= SHIFT_L(glyphp[15][line],22);
+ WRITE_IN_BITORDER(base, 4, bits);
+ CHECKRETURN(5);
+#ifndef FIXEDBASE
+ base += 5;
+#endif
+ width -= 160;
+ glyphp += 16;
+ }
+ return base;
+}
+
+static CARD32*
+DrawTETextScanlineWidth12(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],12);
+ bits |= SHIFT_L(glyphp[2][line],24);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = SHIFT_R(glyphp[2][line],8);
+ bits |= SHIFT_L(glyphp[3][line],4);
+ bits |= SHIFT_L(glyphp[4][line],16);
+ bits |= SHIFT_L(glyphp[5][line],28);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = SHIFT_R(glyphp[5][line],4);
+ bits |= SHIFT_L(glyphp[6][line],8);
+ bits |= SHIFT_L(glyphp[7][line],20);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+#ifndef FIXEDBASE
+ base += 3;
+#endif
+ width -= 96;
+ glyphp += 8;
+ }
+ return base;
+}
+
+
+
+static CARD32*
+DrawTETextScanlineWidth14(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],14);
+ bits |= SHIFT_L(glyphp[2][line],28);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = SHIFT_R(glyphp[2][line],4);
+ bits |= SHIFT_L(glyphp[3][line],10);
+ bits |= SHIFT_L(glyphp[4][line],24);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = SHIFT_R(glyphp[4][line],8);
+ bits |= SHIFT_L(glyphp[5][line],6);
+ bits |= SHIFT_L(glyphp[6][line],20);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+ bits = SHIFT_R(glyphp[6][line],12);
+ bits |= SHIFT_L(glyphp[7][line],2);
+ bits |= SHIFT_L(glyphp[8][line],16);
+ bits |= SHIFT_L(glyphp[9][line],30);
+ WRITE_IN_BITORDER(base, 3, bits);
+ CHECKRETURN(4);
+ bits = SHIFT_R(glyphp[9][line],2);
+ bits |= SHIFT_L(glyphp[10][line],12);
+ bits |= SHIFT_L(glyphp[11][line],26);
+ WRITE_IN_BITORDER(base, 4, bits);
+ CHECKRETURN(5);
+ bits = SHIFT_R(glyphp[11][line],6);
+ bits |= SHIFT_L(glyphp[12][line],8);
+ bits |= SHIFT_L(glyphp[13][line],22);
+ WRITE_IN_BITORDER(base, 5, bits);
+ CHECKRETURN(6);
+ bits = SHIFT_R(glyphp[13][line],10);
+ bits |= SHIFT_L(glyphp[14][line],4);
+ bits |= SHIFT_L(glyphp[15][line],18);
+ WRITE_IN_BITORDER(base, 6, bits);
+ CHECKRETURN(7);
+#ifndef FIXEDBASE
+ base += 7;
+#endif
+ width -= 224;
+ glyphp += 16;
+ }
+ return base;
+}
+
+
+static CARD32*
+DrawTETextScanlineWidth16(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],16);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = glyphp[2][line];
+ bits |= SHIFT_L(glyphp[3][line],16);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = glyphp[4][line];
+ bits |= SHIFT_L(glyphp[5][line],16);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+ bits = glyphp[6][line];
+ bits |= SHIFT_L(glyphp[7][line],16);
+ WRITE_IN_BITORDER(base, 3, bits);
+ CHECKRETURN(4);
+#ifndef FIXEDBASE
+ base += 4;
+#endif
+ width -= 128;
+ glyphp += 8;
+ }
+ return base;
+}
+
+
+
+static CARD32*
+DrawTETextScanlineWidth18(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],18);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = SHIFT_R(glyphp[1][line],14);
+ bits |= SHIFT_L(glyphp[2][line],4);
+ bits |= SHIFT_L(glyphp[3][line],22);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = SHIFT_R(glyphp[3][line],10);
+ bits |= SHIFT_L(glyphp[4][line],8);
+ bits |= SHIFT_L(glyphp[5][line],26);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+ bits = SHIFT_R(glyphp[5][line],6);
+ bits |= SHIFT_L(glyphp[6][line],12);
+ bits |= SHIFT_L(glyphp[7][line],30);
+ WRITE_IN_BITORDER(base, 3, bits);
+ CHECKRETURN(4);
+ bits = SHIFT_R(glyphp[7][line],2);
+ bits |= SHIFT_L(glyphp[8][line],16);
+ WRITE_IN_BITORDER(base, 4, bits);
+ CHECKRETURN(5);
+ bits = SHIFT_R(glyphp[8][line],16);
+ bits |= SHIFT_L(glyphp[9][line],2);
+ bits |= SHIFT_L(glyphp[10][line],20);
+ WRITE_IN_BITORDER(base, 5, bits);
+ CHECKRETURN(6);
+ bits = SHIFT_R(glyphp[10][line],12);
+ bits |= SHIFT_L(glyphp[11][line],6);
+ bits |= SHIFT_L(glyphp[12][line],24);
+ WRITE_IN_BITORDER(base, 6, bits);
+ CHECKRETURN(7);
+ bits = SHIFT_R(glyphp[12][line],8);
+ bits |= SHIFT_L(glyphp[13][line],10);
+ bits |= SHIFT_L(glyphp[14][line],28);
+ WRITE_IN_BITORDER(base, 7, bits);
+ CHECKRETURN(8);
+ bits = SHIFT_R(glyphp[14][line],4);
+ bits |= SHIFT_L(glyphp[15][line],14);
+ WRITE_IN_BITORDER(base, 8, bits);
+ CHECKRETURN(9);
+#ifndef FIXEDBASE
+ base += 9;
+#endif
+ width -= 288;
+ glyphp += 16;
+ }
+ return base;
+}
+
+
+static CARD32*
+DrawTETextScanlineWidth24(
+ CARD32 *base,
+ unsigned int **glyphp,
+ int line, int width, int glyphwidth )
+{
+ while (1) {
+ unsigned int bits;
+ bits = glyphp[0][line];
+ bits |= SHIFT_L(glyphp[1][line],24);
+ WRITE_IN_BITORDER(base, 0, bits);
+ CHECKRETURN(1);
+ bits = SHIFT_R(glyphp[1][line],8);
+ bits |= SHIFT_L(glyphp[2][line],16);
+ WRITE_IN_BITORDER(base, 1, bits);
+ CHECKRETURN(2);
+ bits = SHIFT_R(glyphp[2][line],16);
+ bits |= SHIFT_L(glyphp[3][line],8);
+ WRITE_IN_BITORDER(base, 2, bits);
+ CHECKRETURN(3);
+#ifndef FIXEDBASE
+ base += 3;
+#endif
+ width -= 96;
+ glyphp += 4;
+ }
+ return base;
+}
+
+
diff --git a/hw/xfree86/xaa/xaaTEGlyphBlt.S b/hw/xfree86/xaa/xaaTEGlyphBlt.S
new file mode 100644
index 000000000..f5c580760
--- /dev/null
+++ b/hw/xfree86/xaa/xaaTEGlyphBlt.S
@@ -0,0 +1,964 @@
+/*
+ * Copyright 1996 The XFree86 Project
+ *
+ * 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
+ * HARM HANEMAAYER 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.
+ *
+ * Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net).
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTEGlyphBlt.S,v 1.2 1999/12/27 00:39:52 robin Exp $ */
+
+
+/*
+ * Intel Pentium-optimized versions of "terminal emulator font" text
+ * bitmap transfer routines.
+ *
+ * SCANLINE_PAD_DWORD.
+ *
+ * Only for glyphs with a fixed width of 6 pixels or 8 pixels.
+ */
+
+#include "assyntax.h"
+
+#ifndef QNX4
+ FILE("xaaTEGlyphBlt.s")
+#else
+ FILE( __FILE__ )
+#endif
+
+ AS_BEGIN
+
+/*
+ * Definition of stack frame function arguments.
+ * All functions have the same arguments (some don't have glyphwidth,
+ * but that's OK, since it comes last and doesn't affect the offset
+ * of the other arguments).
+ */
+
+#define base_arg REGOFF(20,ESP)
+#define glyphp_arg REGOFF(24,ESP)
+#define line_arg REGOFF(28,ESP)
+#define width_arg REGOFF(32,ESP)
+#define glyphwidth_arg REGOFF(36,ESP)
+
+#define BYTE_REVERSED GLNAME(byte_reversed)
+
+/* I assume %eax and %edx can be trashed. */
+
+ SEG_TEXT
+
+ ALIGNTEXT4
+
+#ifdef FIXEDBASE
+# ifdef MSBFIRST
+ GLOBL GLNAME(DrawTETextScanlineWidth6PMSBFirstFixedBase)
+GLNAME(DrawTETextScanlineWidth6PMSBFirstFixedBase):
+# else
+ GLOBL GLNAME(DrawTETextScanlineWidth6PLSBFirstFixedBase)
+GLNAME(DrawTETextScanlineWidth6PLSBFirstFixedBase):
+# endif
+#else
+# ifdef MSBFIRST
+ GLOBL GLNAME(DrawTETextScanlineWidth6PMSBFirst)
+GLNAME(DrawTETextScanlineWidth6PMSBFirst):
+# else
+ GLOBL GLNAME(DrawTETextScanlineWidth6PLSBFirst)
+GLNAME(DrawTETextScanlineWidth6PLSBFirst):
+# endif
+#endif
+
+/* Definition of stack frame function arguments. */
+
+#define base_arg REGOFF(20,ESP)
+#define glyphp_arg REGOFF(24,ESP)
+#define line_arg REGOFF(28,ESP)
+#define width_arg REGOFF(32,ESP)
+
+ SUB_L (CONST(16),ESP)
+ MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
+ MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
+ MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
+ MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
+
+ MOV_L (line_arg,EBP)
+ MOV_L (base_arg,EDI)
+ MOV_L (glyphp_arg,ESI)
+
+ ALIGNTEXT4
+
+.L6_1:
+ /* Pentium-optimized instruction pairing. */
+ /* EBX = bits = glyph[0][line] */
+ MOV_L (REGOFF(4,ESI),EDX) /* glyphp[1] */
+ MOV_L (REGIND(ESI),EBX) /* glyphp[0] */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[1][line] */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[0][line] */
+ SAL_L (CONST(6),EDX) /* glyphp[1][line] << 6 */
+ MOV_L (REGOFF(8,ESI),ECX) /* glyphp[2] */
+ MOV_L (REGOFF(12,ESI),EAX) /* glyphp[3] */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[2][line] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[3][line] */
+ SAL_L (CONST(12),ECX) /* glyphp[2][line] << 12 */
+ OR_L (EDX,EBX) /* bits |= ..[1].. << 6 */
+ SAL_L (CONST(18),EAX) /* glyphp[3][line] << 18 */
+ OR_L (ECX,EBX) /* bits |= ..[2].. << 12 */
+
+ MOV_L (REGOFF(16,ESI),EDX) /* glyphp[4] */
+ MOV_L (REGOFF(20,ESI),ECX) /* glyphp[5] */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[4][line] */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[5][line] */
+ SAL_L (CONST(24),EDX) /* glyphp[4][line] << 24 */
+ OR_L (EAX,EBX) /* bits |= ..[3].. << 18 */
+ SAL_L (CONST(30),ECX) /* glyphp[5][line] << 30 */
+ OR_L (EDX,EBX) /* bits |= ..[4].. << 24 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(20,ESI),EAX) /* glyphp[5] */
+ OR_L (ECX,EBX) /* bits |= ..[5].. << 30 */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[5][line] */
+ MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (CONST(0),EAX)
+ OR_L (ECX,EBX) /* bits |= ..[5].. << 30 */
+ MOV_L (CONST(0),EDX)
+ MOV_B (BL,AL)
+ MOV_B (BH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
+ ROL_L (CONST(16),EBX)
+ MOV_B (BL,AL)
+ MOV_B (BH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
+ ROL_L (CONST(16),EBX)
+ MOV_L (REGOFF(20,ESI),EAX) /* glyphp[5] */
+ MOV_L (EBX,REGIND(EDI))
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[5][line] */
+#endif
+
+ CMP_L (CONST(32),width_arg)
+ JG (.L6_2)
+#ifndef FIXEDBASE
+ ADD_L (CONST(4),EDI) /* base++ */
+#endif
+ JMP (.L6_4)
+.L6_2:
+ /* Note that glyphp[5][line] is already read again. */
+ /* EAX = bits = glyphp[5][line] >> 2 */
+ MOV_L (REGOFF(24,ESI),EDX) /* glyphp[6] */
+ MOV_L (REGOFF(28,ESI),EBX) /* glyphp[7] */
+ SHR_L (CONST(2),EAX) /* glyphp[5][line] >> 2 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[6][line] */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[7][line] */
+ MOV_L (REGOFF(32,ESI),ECX) /* glyphp[8] */
+ SAL_L (CONST(4),EDX) /* glyphp[6][line] << 4 */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[8][line] */
+ SAL_L (CONST(10),EBX) /* glyphp[7][line] << 10 */
+ OR_L (EDX,EAX) /* bits |= ..[6].. << 4 */
+ SAL_L (CONST(16),ECX) /* glyphp[8][line] << 16 */
+ MOV_L (REGOFF(36,ESI),EDX) /* glyphp[9] */
+ OR_L (EBX,EAX) /* bits |= ..[7].. << 10 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[9][line] */
+ OR_L (ECX,EAX) /* bits |= ..[8].. << 16 */
+ MOV_L (REGOFF(40,ESI),EBX) /* glyphp[10] */
+ SAL_L (CONST(22),EDX) /* glyphp[9][line] << 22 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[10][line] */
+ OR_L (EDX,EAX) /* bits |= ..[9].. << 22 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(40,ESI),ECX) /* glyphp[10] */
+ SAL_L (CONST(28),EBX) /* glyphp[10][line] << 28 */
+ MOV_L (REGOFF(44,ESI),EDX) /* glyphp[11] */
+ OR_L (EBX,EAX) /* bits |= ..[10].. << 28 */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[10][line] */
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[11][line] */
+#else
+ MOV_L (CONST(0),ECX)
+ SAL_L (CONST(28),EBX) /* glyphp[10][line] << 28 */
+ MOV_L (CONST(0),EDX)
+ OR_L (EBX,EAX) /* bits |= ..[10].. << 28 */
+ MOV_B (AL,CL)
+ MOV_B (AH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
+ ROL_L (CONST(16),EAX)
+ MOV_B (AL,CL)
+ MOV_B (AH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
+ MOV_L (REGOFF(40,ESI),ECX) /* glyphp[10] */
+ ROL_L (CONST(16),EAX)
+ MOV_L (REGOFF(44,ESI),EDX) /* glyphp[11] */
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[10][line] */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[11][line] */
+#endif
+
+ CMP_L (CONST(64),width_arg)
+ JG (.L6_3)
+#ifndef FIXEDBASE
+ ADD_L (CONST(8),EDI) /* base+=2 */
+#endif
+ JMP (.L6_4)
+.L6_3:
+ /* Note that glyphp[10][line] is read again. */
+ /* EAX = bits = glyphp[10][line] >> 4 */
+ SHR_L (CONST(4),ECX) /* glyphp[10][line] >> 4 */
+ MOV_L (REGOFF(48,ESI),EBX) /* glyphp[12] */
+ SAL_L (CONST(2),EDX) /* glyphp[11][line] << 2 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[12][line] */
+ OR_L (EDX,ECX) /* bits |= ..[11].. << 2 */
+ MOV_L (REGOFF(52,ESI),EAX) /* glyphp[13] */
+ SAL_L (CONST(8),EBX) /* glyphp[12][line] << 8 */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[13][line] */
+ OR_L (EBX,ECX) /* bits |= ..[12].. << 8 */
+ MOV_L (REGOFF(56,ESI),EDX) /* glyphp[14] */
+ SAL_L (CONST(14),EAX) /* glyphp[13][line] << 14 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[14][line] */
+ OR_L (EAX,ECX) /* bits |= ..[13].. << 14 */
+ MOV_L (REGOFF(60,ESI),EBX) /* glyphp[15] */
+ SAL_L (CONST(20),EDX) /* glyphp[14][line] << 20 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[15][line] */
+ OR_L (EDX,ECX) /* bits |= ..[14].. << 20 */
+
+#ifndef MSBFIRST
+ SAL_L (CONST(26),EBX) /* glyphp[15][line] << 26 */
+ OR_L (EBX,ECX) /* bits |= ..[15].. << 26 */
+#ifndef FIXEDBASE
+ MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),EAX)
+ SAL_L (CONST(26),EBX) /* glyphp[15][line] << 26 */
+ MOV_L (CONST(0),EDX)
+ OR_L (EBX,ECX) /* bits |= ..[15].. << 26 */
+ MOV_B (CL,AL)
+ MOV_B (CH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
+ ROL_L (CONST(16),ECX)
+ MOV_B (CL,AL)
+ MOV_B (CH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
+ ROL_L (CONST(16),ECX)
+#ifndef FIXEDBASE
+ MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#endif
+
+#ifndef FIXEDBASE
+ ADD_L (CONST(12),EDI) /* base += 3*/
+#endif
+ CMP_L (CONST(96),width_arg)
+ JLE (.L6_4)
+ ADD_L (CONST(64),ESI) /* glyphp += 16 */
+ SUB_L (CONST(96),width_arg)
+ JMP (.L6_1)
+
+.L6_4:
+
+#ifndef FIXEDBASE
+ MOV_L (EDI,EAX) /* return base */
+#else
+ MOV_L (base_arg,EAX) /* return base */
+#endif
+ MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
+ MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
+ MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
+ MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
+ ADD_L (CONST(16),ESP)
+ RET
+
+
+ ALIGNTEXT4
+
+#ifdef FIXEDBASE
+# ifdef MSBFIRST
+ GLOBL GLNAME(DrawTETextScanlineWidth8PMSBFirstFixedBase)
+GLNAME(DrawTETextScanlineWidth8PMSBFirstFixedBase):
+# else
+ GLOBL GLNAME(DrawTETextScanlineWidth8PLSBFirstFixedBase)
+GLNAME(DrawTETextScanlineWidth8PLSBFirstFixedBase):
+# endif
+#else
+# ifdef MSBFIRST
+ GLOBL GLNAME(DrawTETextScanlineWidth8PMSBFirst)
+GLNAME(DrawTETextScanlineWidth8PMSBFirst):
+# else
+ GLOBL GLNAME(DrawTETextScanlineWidth8PLSBFirst)
+GLNAME(DrawTETextScanlineWidth8PLSBFirst):
+# endif
+#endif
+
+ SUB_L (CONST(16),ESP)
+ MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
+ MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
+ MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
+ MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
+
+ MOV_L (line_arg,EBP)
+ MOV_L (base_arg,EDI)
+ MOV_L (glyphp_arg,ESI)
+
+ ALIGNTEXT4
+
+.L8_1:
+ /* Pentium-optimized instruction pairing. */
+ /* EBX = bits */
+ MOV_L (REGIND(ESI),EAX) /* glyphp[0] */
+ MOV_L (REGOFF(4,ESI),EDX) /* glyphp[1] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[0][line] */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[1][line] */
+#ifdef MSBFIRST
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
+#else
+ MOV_L (EAX,EBX) /* bits = glyph[0][line] */
+ MOV_B (DL,BH) /* bits |= ..[1].. << 8 */
+#endif
+
+ ROL_L (CONST(16),EBX)
+ MOV_L (REGOFF(8,ESI),EAX) /* glyphp[2] */
+ MOV_L (REGOFF(12,ESI),ECX) /* glyphp[3] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[2][line] */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[3][line] */
+#ifdef MSBFIRST
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),BH)
+#else
+ MOV_B (AL,BL) /* bits |= ..[2].. << 16 */
+ MOV_B (CL,BH) /* bits |= ..[3].. << 24 */
+#endif
+ ROL_L (CONST(16),EBX)
+ MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+ CMP_L (CONST(32),width_arg)
+#ifndef FIXEDBASE
+ JLE (.L8_2)
+#else
+ JLE (.L8_3)
+#endif
+
+ MOV_L (REGOFF(16,ESI),EAX) /* glyphp[4] */
+ MOV_L (REGOFF(20,ESI),EDX) /* glyphp[5] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[4][line] */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[5][line] */
+#ifdef MSBFIRST
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),BH)
+#else
+ MOV_L (EAX,EBX) /* bits = glyph[4][line] */
+ MOV_B (DL,BH) /* nits |= ..[5].. << 8 */
+#endif
+
+ ROL_L (CONST(16),EBX)
+ MOV_L (REGOFF(24,ESI),EAX) /* glyphp[6] */
+ MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[6][line] */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
+#ifdef MSBFIRST
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),BL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),BH)
+#else
+ MOV_B (AL,BL) /* bits |= ..[6].. << 16 */
+ MOV_B (CL,BH) /* bits |= ..[7].. << 24 */
+#endif
+ ROL_L (CONST(16),EBX)
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base+1, bits) */
+ ADD_L (CONST(8),EDI) /* base += 2 */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+ CMP_L (CONST(64),width_arg)
+ JLE (.L8_3)
+ ADD_L (CONST(32),ESI) /* glyphp += 8 */
+ SUB_L (CONST(64),width_arg)
+ JMP (.L8_1)
+
+#ifndef FIXEDBASE
+.L8_2:
+ ADD_L (CONST(4),EDI) /* base++ */
+.L8_3:
+ MOV_L (EDI,EAX) /* return base */
+#else
+.L8_3:
+ MOV_L (base_arg,EAX) /* return base */
+#endif
+ MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
+ MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
+ MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
+ MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
+ ADD_L (CONST(16),ESP)
+ RET
+
+ ALIGNTEXT4
+
+#ifdef FIXEDBASE
+# ifdef MSBFIRST
+ GLOBL GLNAME(DrawTETextScanlineWidth9PMSBFirstFixedBase)
+GLNAME(DrawTETextScanlineWidth9PMSBFirstFixedBase):
+# else
+ GLOBL GLNAME(DrawTETextScanlineWidth9PLSBFirstFixedBase)
+GLNAME(DrawTETextScanlineWidth9PLSBFirstFixedBase):
+# endif
+#else
+# ifdef MSBFIRST
+ GLOBL GLNAME(DrawTETextScanlineWidth9PMSBFirst)
+GLNAME(DrawTETextScanlineWidth9PMSBFirst):
+# else
+ GLOBL GLNAME(DrawTETextScanlineWidth9PLSBFirst)
+GLNAME(DrawTETextScanlineWidth9PLSBFirst):
+# endif
+#endif
+
+ SUB_L (CONST(16),ESP)
+ MOV_L (EBP,REGOFF(12,ESP)) /* PUSH EBP */
+ MOV_L (EBX,REGOFF(8,ESP)) /* PUSH EBX */
+ MOV_L (ESI,REGOFF(4,ESP)) /* PUSH ESI */
+ MOV_L (EDI,REGOFF(0,ESP)) /* PUSH EDI */
+
+ MOV_L (line_arg,EBP)
+ MOV_L (base_arg,EDI)
+ MOV_L (glyphp_arg,ESI)
+
+ ALIGNTEXT4
+
+.L9_1:
+ /* Pentium-optimized instruction pairing. */
+ /* EAX = bits */
+ MOV_L (REGOFF(4,ESI),EBX) /* glyphp[1] */
+ MOV_L (REGIND(ESI),EAX) /* glyphp[0] */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[1][line] */
+ MOV_L (REGOFF(8,ESI),ECX) /* glyphp[2] */
+ SAL_L (CONST(9),EBX) /* glyphp[1][line] << 9 */
+ MOV_L (REGOFF(12,ESI),EDX) /* glyphp[3] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[0][line] */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[3][line] */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[2][line] */
+ OR_L (EBX,EAX) /* bits |= ..[1].. << 9 */
+ SAL_L (CONST(18),ECX) /* glyphp[2][line] << 18 */
+ OR_L (ECX,EAX) /* bits |= ..[2].. << 18 */
+ SAL_L (CONST(27),EDX) /* glyphp[3][line << 27 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(12,ESI),EBX) /* glyphp[3] */
+ OR_L (EDX,EAX) /* bits |= ..[3].. << 27 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[3][line] */
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (CONST(0),EBX)
+ OR_L (EDX,EAX) /* bits |= ..[3].. << 27 */
+ MOV_L (CONST(0),ECX)
+ MOV_B (AL,BL)
+ MOV_B (AH,CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),AH)
+ ROL_L (CONST(16),EAX)
+ MOV_B (AL,BL)
+ MOV_B (AH,CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),AH)
+ MOV_L (REGOFF(12,ESI),EBX) /* glyphp[3] */
+ ROL_L (CONST(16),EAX)
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[3][line] */
+ MOV_L (EAX,REGIND(EDI))
+#endif
+
+ CMP_L (CONST(32),width_arg)
+ JG (.L9_2)
+#ifndef FIXEDBASE
+ ADD_L (CONST(4),EDI) /* base++ */
+#endif
+ JMP (.L9_11)
+.L9_2:
+ /* Note that glyphp[3][line] is read again. */
+ /* EAX = bits, EBX = glyphp[3][line] >> 5 */
+ SHR_L (CONST(5),EBX) /* glyphp[3][line] >> 5 */
+ MOV_L (REGOFF(16,ESI),EAX) /* glyphp[4] */
+ MOV_L (REGOFF(20,ESI),ECX) /* glyphp[5] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[4][line] */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[5][line] */
+ MOV_L (REGOFF(24,ESI),EDX) /* glyphp[6] */
+ SAL_L (CONST(4),EAX) /* glyphp[4][line] << 4 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[6][line] */
+ SAL_L (CONST(13),ECX) /* glyphp[5][line] << 13 */
+ OR_L (EBX,EAX) /* bits |= ..[4].. << 4 */
+ SAL_L (CONST(22),EDX) /* glyphp[6][line] << 22 */
+ MOV_L (REGOFF(28,ESI),EBX) /* glyphp[7] */
+ OR_L (ECX,EAX) /* bits |= ..[5].. << 13 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[7][line] */
+ OR_L (EDX,EAX) /* bits |= ..[6].. << 22 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
+ SAL_L (CONST(31),EBX) /* glyphp[7][line] << 31 */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
+ OR_L (EBX,EAX) /* bits |= ..[7].. << 31 */
+ MOV_L (REGOFF(32,ESI),EDX) /* glyphp[8] */
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),ECX)
+ SAL_L (CONST(31),EBX) /* glyphp[7][line] << 31 */
+ MOV_L (CONST(0),EDX)
+ OR_L (EBX,EAX) /* bits |= ..[7].. << 31 */
+ MOV_B (AL,CL)
+ MOV_B (AH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
+ ROL_L (CONST(16),EAX)
+ MOV_B (AL,CL)
+ MOV_B (AH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),AH)
+ MOV_L (REGOFF(28,ESI),ECX) /* glyphp[7] */
+ ROL_L (CONST(16),EAX)
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[7][line] */
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(4,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+ MOV_L (REGOFF(32,ESI),EDX) /* glyphp[8] */
+#endif
+
+ CMP_L (CONST(64),width_arg)
+ JG (.L9_3)
+#ifndef FIXEDBASE
+ ADD_L (CONST(8),EDI) /* base+=2 */
+#endif
+ JMP (.L9_11)
+.L9_3:
+
+ /* Note that glyphp[7][line] is read again. */
+ /* ECX = bits = glyphp[7][line] >> 1 */
+ SHR_L (CONST(1),ECX) /* glyphp[7][line] >> 1 */
+ MOV_L (REGOFF(36,ESI),EBX) /* glyphp[9] */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[8][line] */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[9][line] */
+ SAL_L (CONST(8),EDX) /* glyphp[8][line] << 8 */
+ MOV_L (REGOFF(40,ESI),EAX) /* glyphp[10] */
+ SAL_L (CONST(17),EBX) /* glyphp[9][line] << 17 */
+ OR_L (EDX,ECX) /* bits |= ..[8].. << 8 */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[10][line] */
+ OR_L (EBX,ECX) /* bits |= ..[9].. << 17 */
+ SAL_L (CONST(26),EAX) /* glyphp[10][line] << 26 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(40,ESI),EDX) /* glyphp[10] */
+ OR_L (EAX,ECX) /* bits |= ..[10].. << 26 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[10][line] */
+#ifndef FIXEDBASE
+ MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),EDX)
+ OR_L (EAX,ECX) /* bits |= ..[10].. << 26 */
+ MOV_L (CONST(0),EBX)
+ MOV_B (CL,DL)
+ MOV_B (CH,BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),CH)
+ ROL_L (CONST(16),ECX)
+ MOV_B (CL,DL)
+ MOV_B (CH,BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),CH)
+ MOV_L (REGOFF(40,ESI),EDX) /* glyphp[10] */
+ ROL_L (CONST(16),ECX)
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[10][line] */
+#ifndef FIXEDBASE
+ MOV_L (ECX,REGOFF(8,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#endif
+
+ CMP_L (CONST(96),width_arg)
+ JG (.L9_4)
+#ifndef FIXEDBASE
+ ADD_L (CONST(12),EDI) /* base+=3 */
+#endif
+ JMP (.L9_11)
+.L9_4:
+ /* Note that glyphp[10][line] is read again. */
+ /* EDX = bits = glyphp[10][line] >> 6 */
+ SHR_L (CONST(6),EDX) /* glyphp[10][line] >> 6 */
+ MOV_L (REGOFF(44,ESI),EBX) /* glyphp[11] */
+ MOV_L (REGOFF(48,ESI),EAX) /* glyphp[12] */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[11][line] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[12][line] */
+ MOV_L (REGOFF(52,ESI),ECX) /* glyphp[13] */
+ SAL_L (CONST(3),EBX) /* glyphp[11][line] << 3 */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[13][line] */
+ SAL_L (CONST(12),EAX) /* glyphp[12][line] << 12 */
+ OR_L (EBX,EDX) /* bits |= ..[11].. << 3 */
+ SAL_L (CONST(21),ECX) /* glyphp[13][line] << 21 */
+ MOV_L (REGOFF(56,ESI),EBX) /* glyphp[14] */
+ OR_L (EAX,EDX) /* bits |= ..[12].. << 17 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[14][line] */
+ SAL_L (CONST(30),EBX) /* glyphp[14][line] << 30 */
+ OR_L (ECX,EDX) /* bits |= ..[13].. << 21 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(56,ESI),EAX) /* glyphp[14] */
+ OR_L (EBX,EDX) /* bits |= ..[14].. << 30 */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[14][line] */
+#ifndef FIXEDBASE
+ MOV_L (EDX,REGOFF(12,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),EAX)
+ OR_L (EBX,EDX) /* bits |= ..[14].. << 30 */
+ MOV_L (CONST(0),ECX)
+ MOV_B (DL,AL)
+ MOV_B (DH,CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),DL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
+ ROL_L (CONST(16),EDX)
+ MOV_B (DL,AL)
+ MOV_B (DH,CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),DL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
+ MOV_L (REGOFF(56,ESI),EAX) /* glyphp[14] */
+ ROL_L (CONST(16),EDX)
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[14][line] */
+#ifndef FIXEDBASE
+ MOV_L (EDX,REGOFF(12,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#endif
+
+ CMP_L (CONST(128),width_arg)
+ JG (.L9_5)
+#ifndef FIXEDBASE
+ ADD_L (CONST(16),EDI) /* base+=4 */
+#endif
+ JMP (.L9_11)
+.L9_5:
+ /* Note that glyphp[14][line] is read again. */
+ /* EAX = bits = glyphp[14][line] >> 2 */
+ SHR_L (CONST(2),EAX) /* glyphp[14][line] >> 2 */
+ MOV_L (REGOFF(60,ESI),ECX) /* glyphp[15] */
+ MOV_L (REGOFF(64,ESI),EBX) /* glyphp[16] */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[15][line] */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[16][line] */
+ MOV_L (REGOFF(68,ESI),EDX) /* glyphp[17] */
+ SAL_L (CONST(7),ECX) /* glyphp[15][line] << 7 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[17][line] */
+ SAL_L (CONST(16),EBX) /* glyphp[16][line] << 16 */
+ OR_L (ECX,EAX) /* bits |= ..[15].. << 7 */
+ SAL_L (CONST(25),EDX) /* glyphp[17][line] << 25 */
+ OR_L (EBX,EAX) /* bits |= ..[16].. << 16 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(68,ESI),ECX) /* glyphp[17] */
+ OR_L (EDX,EAX) /* bits |= ..[17].. << 25 */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[17][line] */
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(16,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),ECX)
+ OR_L (EDX,EAX) /* bits |= ..[17].. << 25 */
+ MOV_L (CONST(0),EBX)
+ MOV_B (AL,CL)
+ MOV_B (AH,BL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
+ ROL_L (CONST(16),EAX)
+ MOV_B (AL,CL)
+ MOV_B (AH,BL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
+ MOV_L (REGOFF(68,ESI),ECX) /* glyphp[17] */
+ ROL_L (CONST(16),EAX)
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[17][line] */
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(16,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#endif
+
+ CMP_L (CONST(160),width_arg)
+ JG (.L9_6)
+#ifndef FIXEDBASE
+ ADD_L (CONST(20),EDI) /* base+=5 */
+#endif
+ JMP (.L9_11)
+.L9_6:
+ /* Note that glyphp[17][line] is read again. */
+ /* ECX = bits = glyphp[17][line] >> 7 */
+ SHR_L (CONST(7),ECX) /* glyphp[17][line] >> 7 */
+ MOV_L (REGOFF(72,ESI),EBX) /* glyphp[18] */
+ MOV_L (REGOFF(76,ESI),EAX) /* glyphp[19] */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[18][line] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[19][line] */
+ MOV_L (REGOFF(80,ESI),EDX) /* glyphp[20] */
+ SAL_L (CONST(2),EBX) /* glyphp[18][line] << 2 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[20][line] */
+ SAL_L (CONST(11),EAX) /* glyphp[19][line] << 11 */
+ OR_L (EBX,ECX) /* bits |= ..[18].. << 2 */
+ SAL_L (CONST(20),EDX) /* glyphp[20][line] << 20 */
+ MOV_L (REGOFF(84,ESI),EBX) /* glyphp[21] */
+ OR_L (EAX,ECX) /* bits |= ..[19].. << 11 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[21][line] */
+ OR_L (EDX,ECX) /* bits |= ..[20].. << 20 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(84,ESI),EAX) /* glyphp[21] */
+ SAL_L (CONST(29),EBX) /* glyphp[21][line] << 29 */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[21][line] */
+ OR_L (EBX,ECX) /* bits |= ..[14].. << 30 */
+ MOV_L (REGOFF(88,ESI),EDX) /* glyphp[22] */
+#ifndef FIXEDBASE
+ MOV_L (ECX,REGOFF(20,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),EAX)
+ SAL_L (CONST(29),EBX) /* glyphp[21][line] << 29 */
+ MOV_L (CONST(0),EDX)
+ OR_L (EBX,ECX) /* bits |= ..[14].. << 30 */
+ MOV_B (CL,AL)
+ MOV_B (CH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
+ ROL_L (CONST(16),ECX)
+ MOV_B (CL,AL)
+ MOV_B (CH,DL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),CH)
+ MOV_L (REGOFF(84,ESI),EAX) /* glyphp[21] */
+ ROL_L (CONST(16),ECX)
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[21][line] */
+#ifndef FIXEDBASE
+ MOV_L (ECX,REGOFF(20,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (ECX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+ MOV_L (REGOFF(88,ESI),EDX) /* glyphp[22] */
+#endif
+
+ CMP_L (CONST(192),width_arg)
+ JG (.L9_7)
+#ifndef FIXEDBASE
+ ADD_L (CONST(24),EDI) /* base+=6 */
+#endif
+ JMP (.L9_11)
+.L9_7:
+ /* Note that glyphp[21][line] is read again. */
+ /* EAX = bits = glyphp[21][line] >> 3 */
+ SHR_L (CONST(3),EAX) /* glyphp[21][line] >> 3 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[22][line] */
+ MOV_L (REGOFF(92,ESI),EBX) /* glyphp[23] */
+ MOV_L (REGOFF(96,ESI),ECX) /* glyphp[24] */
+ SAL_L (CONST(6),EDX) /* glyphp[22][line] << 6 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[23][line] */
+ OR_L (EDX,EAX) /* bits |= ..[22].. << 6 */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[24][line] */
+ SAL_L (CONST(15),EBX) /* glyphp[23][line] << 15 */
+ OR_L (EBX,EAX) /* bits |= ..[23].. << 15 */
+ SAL_L (CONST(24),ECX) /* glyphp[24][line] << 24 */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(96,ESI),EDX) /* glyphp[24] */
+ OR_L (ECX,EAX) /* bits |= ..[24].. << 24 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[24][line] */
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(24,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),EDX)
+ OR_L (ECX,EAX) /* bits |= ..[24].. << 24 */
+ MOV_L (CONST(0),EBX)
+ MOV_B (AL,DL)
+ MOV_B (AH,BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
+ ROL_L (CONST(16),EAX)
+ MOV_B (AL,DL)
+ MOV_B (AH,BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EDX),AL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),AH)
+ MOV_L (REGOFF(96,ESI),EDX) /* glyphp[24] */
+ ROL_L (CONST(16),EAX)
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[24][line] */
+#ifndef FIXEDBASE
+ MOV_L (EAX,REGOFF(24,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EAX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#endif
+
+ CMP_L (CONST(224),width_arg)
+ JG (.L9_8)
+#ifndef FIXEDBASE
+ ADD_L (CONST(28),EDI) /* base+=7 */
+#endif
+ JMP (.L9_11)
+.L9_8:
+ /* Note that glyphp[24][line] is read again. */
+ /* EDX = bits = glyphp[24][line] >> 8 */
+
+ SHR_L (CONST(8),EDX) /* glyphp[24][line] >> 8 */
+ MOV_L (REGOFF(100,ESI),EAX) /* glyphp[25] */
+ MOV_L (REGOFF(104,ESI),EBX) /* glyphp[26] */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[25][line] */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[26][line] */
+ MOV_L (REGOFF(108,ESI),ECX) /* glyphp[27] */
+ SAL_L (CONST(1),EAX) /* glyphp[25][line] << 1 */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[27][line] */
+ SAL_L (CONST(10),EBX) /* glyphp[26][line] << 10 */
+ OR_L (EAX,EDX) /* bits |= ..[25].. << 1 */
+ SAL_L (CONST(19),ECX) /* glyphp[27][line] << 19 */
+ OR_L (EBX,EDX) /* bits |= ..[26].. << 10 */
+ MOV_L (REGOFF(112,ESI),EAX) /* glyphp[28] */
+ OR_L (ECX,EDX) /* bits |= ..[27].. << 19 */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[28][line] */
+
+#ifndef MSBFIRST
+ MOV_L (REGOFF(112,ESI),EBX) /* glyphp[28] */
+ SAL_L (CONST(28),EAX) /* glyphp[28][line] << 28 */
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[28][line] */
+ OR_L (EAX,EDX) /* bits |= ..[28].. << 28 */
+ MOV_L (REGOFF(116,ESI),ECX) /* glyphp[29] */
+#ifndef FIXEDBASE
+ MOV_L (EDX,REGOFF(28,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),EBX)
+ SAL_L (CONST(28),EAX) /* glyphp[28][line] << 28 */
+ MOV_L (CONST(0),ECX)
+ OR_L (EAX,EDX) /* bits |= ..[28].. << 28 */
+ MOV_B (DL,BL)
+ MOV_B (DH,CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),DL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
+ ROL_L (CONST(16),EDX)
+ MOV_B (DL,BL)
+ MOV_B (DH,CL)
+ MOV_B (REGOFF(BYTE_REVERSED,EBX),DL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),DH)
+ MOV_L (REGOFF(112,ESI),EBX) /* glyphp[28] */
+ ROL_L (CONST(16),EDX)
+ MOV_L (REGOFF(116,ESI),ECX) /* glyphp[29] */
+#ifndef FIXEDBASE
+ MOV_L (EDX,REGOFF(28,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EDX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+ MOV_L (REGBISD(EBX,EBP,4,0),EBX) /* glyphp[28][line] */
+#endif
+
+ CMP_L (CONST(256),width_arg)
+ JG (.L9_9)
+#ifndef FIXEDBASE
+ ADD_L (CONST(32),EDI) /* base+=8 */
+#endif
+ JMP (.L9_11)
+.L9_9:
+ /* Note that glyphp[28][line] is read again. */
+ /* EBX = bits = glyphp[28][line] >> 4 */
+ SHR_L (CONST(4),EBX) /* glyphp[28][line] >> 4 */
+ MOV_L (REGBISD(ECX,EBP,4,0),ECX) /* glyphp[29][line] */
+ MOV_L (REGOFF(120,ESI),EAX) /* glyphp[30] */
+ MOV_L (REGOFF(124,ESI),EDX) /* glyphp[31] */
+ SAL_L (CONST(5),ECX) /* glyphp[29][line] << 5 */
+ MOV_L (REGBISD(EAX,EBP,4,0),EAX) /* glyphp[30][line] */
+ OR_L (ECX,EBX) /* bits |= ..[29].. << 5 */
+ MOV_L (REGBISD(EDX,EBP,4,0),EDX) /* glyphp[31][line] */
+ SAL_L (CONST(14),EAX) /* glyphp[30][line] << 14 */
+ ADD_L (CONST(128),ESI) /* glyphp+=32 */
+ SAL_L (CONST(23),EDX) /* glyphp[31][line] << 23 */
+ OR_L (EAX,EBX) /* bits |= ..[30].. << 14 */
+ SUB_L (CONST(288),width_arg) /* width-=288 */
+ OR_L (EDX,EBX) /* bits |= ..[31].. << 23 */
+
+#ifndef MSBFIRST
+#ifndef FIXEDBASE
+ MOV_L (EBX,REGOFF(32,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#else
+ MOV_L (CONST(0),ECX)
+ MOV_L (CONST(0),EAX)
+ MOV_B (BL,CL)
+ MOV_B (BH,AL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),BH)
+ ROL_L (CONST(16),EBX)
+ MOV_B (BL,CL)
+ MOV_B (BH,AL)
+ MOV_B (REGOFF(BYTE_REVERSED,ECX),BL)
+ MOV_B (REGOFF(BYTE_REVERSED,EAX),BH)
+ ROL_L (CONST(16),EBX)
+#ifndef FIXEDBASE
+ MOV_L (EBX,REGOFF(32,EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#else
+ MOV_L (EBX,REGIND(EDI)) /* WRITE_IN_BIT_ORDER(base, bits) */
+#endif
+#endif
+
+ ADD_L (CONST(36),EDI) /* base+=9 */
+ CMP_L (CONST(0),width_arg)
+ JG (.L9_1)
+
+.L9_11:
+#ifndef FIXEDBASE
+ MOV_L (EDI,EAX) /* return base */
+#else
+ MOV_L (base_arg,EAX) /* return base */
+#endif
+ MOV_L (REGOFF(0,ESP),EDI) /* POPL EDI */
+ MOV_L (REGOFF(4,ESP),ESI) /* POPL ESI */
+ MOV_L (REGOFF(8,ESP),EBX) /* POPL EBX */
+ MOV_L (REGOFF(12,ESP),EBP) /* POPL EBP */
+ ADD_L (CONST(16),ESP)
+ RET
diff --git a/hw/xfree86/xaa/xaaTEText.c b/hw/xfree86/xaa/xaaTEText.c
new file mode 100644
index 000000000..82fa28674
--- /dev/null
+++ b/hw/xfree86/xaa/xaaTEText.c
@@ -0,0 +1,293 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTEText.c,v 1.7 1999/05/30 03:03:33 dawes Exp $ */
+
+/********************************************************************
+
+ In this file we have GC level replacements for PolyText8/16,
+ ImageText8/16, ImageGlyphBlt and PolyGlyphBlt for TE (fixed) fonts.
+ The idea is that everything in this file is device independent.
+ The mentioned GCOps are merely wrappers for XAAGlyphBltTEColorExpansion
+ which calculates the boxes containing arbitrarily clipped text
+ and passes them to the TEGlyphRenderer which will usually be a lower
+ level XAA function which renders these clipped glyphs using
+ the basic color expansion functions exported by the chipset driver.
+ The TEGlyphRenderer itself may optionally be driver supplied to
+ facilitate work-arounds/optimizations at a higher level than usual.
+
+ v1.0 - Mark Vojkovich (mvojkovi@ucsd.edu)
+
+
+********************************************************************/
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "font.h"
+#include "scrnintstr.h"
+#include "dixfontstr.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+
+
+static void XAAGlyphBltTEColorExpansion(ScrnInfoPtr pScrn, int xInit,
+ int yInit, FontPtr font, int fg, int bg, int rop,
+ unsigned int planemask, RegionPtr cclip, int nglyph,
+ unsigned char* gBase, CharInfoPtr *ppci);
+
+
+/********************************************************************
+
+ GC level replacements for PolyText8/16 and ImageText8/16
+ for TE fonts when using color expansion.
+
+********************************************************************/
+
+
+int
+XAAPolyText8TEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ unsigned long n;
+
+ (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
+ (unsigned char *)chars, Linear8Bit, &n, infoRec->CharInfo);
+
+ /* we have divorced XAAGlyphBltTEColorExpansion from the drawable */
+ if(n) XAAGlyphBltTEColorExpansion(
+ infoRec->pScrn, x + pDraw->x, y + pDraw->y,
+ pGC->font, pGC->fgPixel, -1, pGC->alu, pGC->planemask,
+ pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
+
+ return (x + (n * FONTMAXBOUNDS(pGC->font, characterWidth)));
+}
+
+
+int
+XAAPolyText16TEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ unsigned long n;
+
+ (*pGC->font->get_glyphs)(
+ pGC->font, (unsigned long)count, (unsigned char *)chars,
+ (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
+ &n, infoRec->CharInfo);
+
+ if(n) XAAGlyphBltTEColorExpansion(
+ infoRec->pScrn, x + pDraw->x, y + pDraw->y,
+ pGC->font, pGC->fgPixel, -1, pGC->alu, pGC->planemask,
+ pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
+
+ return (x + (n * FONTMAXBOUNDS(pGC->font, characterWidth)));
+}
+
+
+void
+XAAImageText8TEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ unsigned long n;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
+ (unsigned char *)chars, Linear8Bit, &n, infoRec->CharInfo);
+
+ if(n) XAAGlyphBltTEColorExpansion(
+ infoRec->pScrn, x + pDraw->x, y + pDraw->y,
+ pGC->font, pGC->fgPixel, pGC->bgPixel, GXcopy, pGC->planemask,
+ pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
+}
+
+
+void
+XAAImageText16TEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ unsigned long n;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ (*pGC->font->get_glyphs)(
+ pGC->font, (unsigned long)count, (unsigned char *)chars,
+ (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
+ &n, infoRec->CharInfo);
+
+ if(n) XAAGlyphBltTEColorExpansion(
+ infoRec->pScrn, x + pDraw->x, y + pDraw->y,
+ pGC->font, pGC->fgPixel, pGC->bgPixel, GXcopy, pGC->planemask,
+ pGC->pCompositeClip, n, FONTGLYPHS(pGC->font), infoRec->CharInfo);
+}
+
+
+
+/********************************************************************
+
+ GC level replacements for ImageGlyphBlt and PolyGlyphBlt for
+ TE fonts when using color expansion.
+
+********************************************************************/
+
+
+void
+XAAImageGlyphBltTEColorExpansion(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ XAAGlyphBltTEColorExpansion(
+ infoRec->pScrn, xInit + pDrawable->x, yInit + pDrawable->y,
+ pGC->font, pGC->fgPixel, pGC->bgPixel, GXcopy, pGC->planemask,
+ pGC->pCompositeClip, nglyph, (unsigned char*)pglyphBase, ppci);
+}
+
+void
+XAAPolyGlyphBltTEColorExpansion(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ XAAGlyphBltTEColorExpansion(
+ infoRec->pScrn, xInit + pDrawable->x, yInit + pDrawable->y,
+ pGC->font, pGC->fgPixel, -1, pGC->alu, pGC->planemask,
+ pGC->pCompositeClip, nglyph, (unsigned char*)pglyphBase, ppci);
+}
+
+
+
+
+/********************************************************************
+
+ XAAGlyphBltTEColorExpansion -
+
+ This guy computes the clipped pieces of text and sends it to
+ the lower-level function which will handle acceleration of
+ arbitrarily clipped text.
+
+********************************************************************/
+
+
+static void
+XAAGlyphBltTEColorExpansion(
+ ScrnInfoPtr pScrn,
+ int xInit, int yInit,
+ FontPtr font,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask,
+ RegionPtr cclip,
+ int nglyph,
+ unsigned char* gBase,
+ CharInfoPtr *ppci )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ int skippix, skipglyphs;
+ int Left, Right, Top, Bottom;
+ int LeftEdge, RightEdge, ytop, ybot;
+ int nbox = REGION_NUM_RECTS(cclip);
+ BoxPtr pbox = REGION_RECTS(cclip);
+ unsigned int **glyphs = NULL;
+ int glyphWidth = FONTMAXBOUNDS(font, characterWidth);
+
+ /* find the size of the box */
+ Left = xInit;
+ Right = Left + (glyphWidth * nglyph);
+ Top = yInit - FONTASCENT(font);
+ Bottom = yInit + FONTDESCENT(font);
+
+ /* get into the first band that may contain part of our string */
+ while(nbox && (Top >= pbox->y2)) {
+ pbox++; nbox--;
+ }
+
+ /* stop when the lower edge of the box is beyond our string */
+ while(nbox && (Bottom > pbox->y1)) {
+ LeftEdge = max(Left, pbox->x1);
+ RightEdge = min(Right, pbox->x2);
+
+ if(RightEdge > LeftEdge) { /* we have something to draw */
+ ytop = max(Top, pbox->y1);
+ ybot = min(Bottom, pbox->y2);
+
+ if((skippix = LeftEdge - Left)) {
+ skipglyphs = skippix/glyphWidth;
+ skippix %= glyphWidth;
+ } else skipglyphs = 0;
+
+ if(!glyphs) {
+ int count;
+ glyphs = (unsigned int**)(infoRec->PreAllocMem);
+
+ for(count = 0; count < nglyph; count++)
+ glyphs[count] = (unsigned int*)
+ FONTGLYPHBITS(gBase,*ppci++);
+
+ /* our new unrolled TE code only writes DWORDS at a time
+ so it can read up to 6 characters past the last one
+ we're displaying */
+ glyphs[count + 0] = glyphs[0];
+ glyphs[count + 1] = glyphs[0];
+ glyphs[count + 2] = glyphs[0];
+ glyphs[count + 3] = glyphs[0];
+ glyphs[count + 4] = glyphs[0];
+ glyphs[count + 5] = glyphs[0];
+ }
+
+ /* x, y, w, h, skipleft, skiptop, glyphp, glyphWidth, fg, bg, rop, pm */
+
+ (*infoRec->TEGlyphRenderer)( pScrn,
+ LeftEdge, ytop, RightEdge - LeftEdge, ybot - ytop,
+ skippix, ytop - Top, glyphs + skipglyphs, glyphWidth,
+ fg, bg, rop, planemask);
+ }
+
+ nbox--; pbox++;
+ }
+}
+
+
+
+
diff --git a/hw/xfree86/xaa/xaaTables.c b/hw/xfree86/xaa/xaaTables.c
new file mode 100644
index 000000000..0d2ce760a
--- /dev/null
+++ b/hw/xfree86/xaa/xaaTables.c
@@ -0,0 +1,88 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaTables.c,v 1.2 1998/07/25 16:58:53 dawes Exp $ */
+
+/*
+ * This is a table of 24-bit values, indexed with an 8-bit byte value, then
+ * expands each bit to three consecutive bits. This is required for color
+ * expansion in 24bpp mode with the coprocessor in 8bpp mode, with LSB-first
+ * bit order within a byte.
+ */
+
+unsigned int byte_expand3[256] =
+{
+ 0x000000, 0x000007, 0x000038, 0x00003F, 0x0001C0, 0x0001C7, 0x0001F8, 0x0001FF,
+ 0x000E00, 0x000E07, 0x000E38, 0x000E3F, 0x000FC0, 0x000FC7, 0x000FF8, 0x000FFF,
+ 0x007000, 0x007007, 0x007038, 0x00703F, 0x0071C0, 0x0071C7, 0x0071F8, 0x0071FF,
+ 0x007E00, 0x007E07, 0x007E38, 0x007E3F, 0x007FC0, 0x007FC7, 0x007FF8, 0x007FFF,
+ 0x038000, 0x038007, 0x038038, 0x03803F, 0x0381C0, 0x0381C7, 0x0381F8, 0x0381FF,
+ 0x038E00, 0x038E07, 0x038E38, 0x038E3F, 0x038FC0, 0x038FC7, 0x038FF8, 0x038FFF,
+ 0x03F000, 0x03F007, 0x03F038, 0x03F03F, 0x03F1C0, 0x03F1C7, 0x03F1F8, 0x03F1FF,
+ 0x03FE00, 0x03FE07, 0x03FE38, 0x03FE3F, 0x03FFC0, 0x03FFC7, 0x03FFF8, 0x03FFFF,
+ 0x1C0000, 0x1C0007, 0x1C0038, 0x1C003F, 0x1C01C0, 0x1C01C7, 0x1C01F8, 0x1C01FF,
+ 0x1C0E00, 0x1C0E07, 0x1C0E38, 0x1C0E3F, 0x1C0FC0, 0x1C0FC7, 0x1C0FF8, 0x1C0FFF,
+ 0x1C7000, 0x1C7007, 0x1C7038, 0x1C703F, 0x1C71C0, 0x1C71C7, 0x1C71F8, 0x1C71FF,
+ 0x1C7E00, 0x1C7E07, 0x1C7E38, 0x1C7E3F, 0x1C7FC0, 0x1C7FC7, 0x1C7FF8, 0x1C7FFF,
+ 0x1F8000, 0x1F8007, 0x1F8038, 0x1F803F, 0x1F81C0, 0x1F81C7, 0x1F81F8, 0x1F81FF,
+ 0x1F8E00, 0x1F8E07, 0x1F8E38, 0x1F8E3F, 0x1F8FC0, 0x1F8FC7, 0x1F8FF8, 0x1F8FFF,
+ 0x1FF000, 0x1FF007, 0x1FF038, 0x1FF03F, 0x1FF1C0, 0x1FF1C7, 0x1FF1F8, 0x1FF1FF,
+ 0x1FFE00, 0x1FFE07, 0x1FFE38, 0x1FFE3F, 0x1FFFC0, 0x1FFFC7, 0x1FFFF8, 0x1FFFFF,
+ 0xE00000, 0xE00007, 0xE00038, 0xE0003F, 0xE001C0, 0xE001C7, 0xE001F8, 0xE001FF,
+ 0xE00E00, 0xE00E07, 0xE00E38, 0xE00E3F, 0xE00FC0, 0xE00FC7, 0xE00FF8, 0xE00FFF,
+ 0xE07000, 0xE07007, 0xE07038, 0xE0703F, 0xE071C0, 0xE071C7, 0xE071F8, 0xE071FF,
+ 0xE07E00, 0xE07E07, 0xE07E38, 0xE07E3F, 0xE07FC0, 0xE07FC7, 0xE07FF8, 0xE07FFF,
+ 0xE38000, 0xE38007, 0xE38038, 0xE3803F, 0xE381C0, 0xE381C7, 0xE381F8, 0xE381FF,
+ 0xE38E00, 0xE38E07, 0xE38E38, 0xE38E3F, 0xE38FC0, 0xE38FC7, 0xE38FF8, 0xE38FFF,
+ 0xE3F000, 0xE3F007, 0xE3F038, 0xE3F03F, 0xE3F1C0, 0xE3F1C7, 0xE3F1F8, 0xE3F1FF,
+ 0xE3FE00, 0xE3FE07, 0xE3FE38, 0xE3FE3F, 0xE3FFC0, 0xE3FFC7, 0xE3FFF8, 0xE3FFFF,
+ 0xFC0000, 0xFC0007, 0xFC0038, 0xFC003F, 0xFC01C0, 0xFC01C7, 0xFC01F8, 0xFC01FF,
+ 0xFC0E00, 0xFC0E07, 0xFC0E38, 0xFC0E3F, 0xFC0FC0, 0xFC0FC7, 0xFC0FF8, 0xFC0FFF,
+ 0xFC7000, 0xFC7007, 0xFC7038, 0xFC703F, 0xFC71C0, 0xFC71C7, 0xFC71F8, 0xFC71FF,
+ 0xFC7E00, 0xFC7E07, 0xFC7E38, 0xFC7E3F, 0xFC7FC0, 0xFC7FC7, 0xFC7FF8, 0xFC7FFF,
+ 0xFF8000, 0xFF8007, 0xFF8038, 0xFF803F, 0xFF81C0, 0xFF81C7, 0xFF81F8, 0xFF81FF,
+ 0xFF8E00, 0xFF8E07, 0xFF8E38, 0xFF8E3F, 0xFF8FC0, 0xFF8FC7, 0xFF8FF8, 0xFF8FFF,
+ 0xFFF000, 0xFFF007, 0xFFF038, 0xFFF03F, 0xFFF1C0, 0xFFF1C7, 0xFFF1F8, 0xFFF1FF,
+ 0xFFFE00, 0xFFFE07, 0xFFFE38, 0xFFFE3F, 0xFFFFC0, 0xFFFFC7, 0xFFFFF8, 0xFFFFFF
+};
+
+/*
+ * This is a table of 24-bit values, indexed with an 8-bit byte value,
+ * that reverses the bit order of a byte and then expands each bit to three
+ * consecutive bits. This is required for color expansion in 24bpp mode
+ * with the coprocessor in 8bpp mode, with MSB-first bit order within a
+ * byte.
+ */
+
+unsigned int byte_reversed_expand3[256] =
+{
+ 0x000000, 0x0000E0, 0x00001C, 0x0000FC, 0x008003, 0x0080E3, 0x00801F, 0x0080FF,
+ 0x007000, 0x0070E0, 0x00701C, 0x0070FC, 0x00F003, 0x00F0E3, 0x00F01F, 0x00F0FF,
+ 0x000E00, 0x000EE0, 0x000E1C, 0x000EFC, 0x008E03, 0x008EE3, 0x008E1F, 0x008EFF,
+ 0x007E00, 0x007EE0, 0x007E1C, 0x007EFC, 0x00FE03, 0x00FEE3, 0x00FE1F, 0x00FEFF,
+ 0xC00100, 0xC001E0, 0xC0011C, 0xC001FC, 0xC08103, 0xC081E3, 0xC0811F, 0xC081FF,
+ 0xC07100, 0xC071E0, 0xC0711C, 0xC071FC, 0xC0F103, 0xC0F1E3, 0xC0F11F, 0xC0F1FF,
+ 0xC00F00, 0xC00FE0, 0xC00F1C, 0xC00FFC, 0xC08F03, 0xC08FE3, 0xC08F1F, 0xC08FFF,
+ 0xC07F00, 0xC07FE0, 0xC07F1C, 0xC07FFC, 0xC0FF03, 0xC0FFE3, 0xC0FF1F, 0xC0FFFF,
+ 0x380000, 0x3800E0, 0x38001C, 0x3800FC, 0x388003, 0x3880E3, 0x38801F, 0x3880FF,
+ 0x387000, 0x3870E0, 0x38701C, 0x3870FC, 0x38F003, 0x38F0E3, 0x38F01F, 0x38F0FF,
+ 0x380E00, 0x380EE0, 0x380E1C, 0x380EFC, 0x388E03, 0x388EE3, 0x388E1F, 0x388EFF,
+ 0x387E00, 0x387EE0, 0x387E1C, 0x387EFC, 0x38FE03, 0x38FEE3, 0x38FE1F, 0x38FEFF,
+ 0xF80100, 0xF801E0, 0xF8011C, 0xF801FC, 0xF88103, 0xF881E3, 0xF8811F, 0xF881FF,
+ 0xF87100, 0xF871E0, 0xF8711C, 0xF871FC, 0xF8F103, 0xF8F1E3, 0xF8F11F, 0xF8F1FF,
+ 0xF80F00, 0xF80FE0, 0xF80F1C, 0xF80FFC, 0xF88F03, 0xF88FE3, 0xF88F1F, 0xF88FFF,
+ 0xF87F00, 0xF87FE0, 0xF87F1C, 0xF87FFC, 0xF8FF03, 0xF8FFE3, 0xF8FF1F, 0xF8FFFF,
+ 0x070000, 0x0700E0, 0x07001C, 0x0700FC, 0x078003, 0x0780E3, 0x07801F, 0x0780FF,
+ 0x077000, 0x0770E0, 0x07701C, 0x0770FC, 0x07F003, 0x07F0E3, 0x07F01F, 0x07F0FF,
+ 0x070E00, 0x070EE0, 0x070E1C, 0x070EFC, 0x078E03, 0x078EE3, 0x078E1F, 0x078EFF,
+ 0x077E00, 0x077EE0, 0x077E1C, 0x077EFC, 0x07FE03, 0x07FEE3, 0x07FE1F, 0x07FEFF,
+ 0xC70100, 0xC701E0, 0xC7011C, 0xC701FC, 0xC78103, 0xC781E3, 0xC7811F, 0xC781FF,
+ 0xC77100, 0xC771E0, 0xC7711C, 0xC771FC, 0xC7F103, 0xC7F1E3, 0xC7F11F, 0xC7F1FF,
+ 0xC70F00, 0xC70FE0, 0xC70F1C, 0xC70FFC, 0xC78F03, 0xC78FE3, 0xC78F1F, 0xC78FFF,
+ 0xC77F00, 0xC77FE0, 0xC77F1C, 0xC77FFC, 0xC7FF03, 0xC7FFE3, 0xC7FF1F, 0xC7FFFF,
+ 0x3F0000, 0x3F00E0, 0x3F001C, 0x3F00FC, 0x3F8003, 0x3F80E3, 0x3F801F, 0x3F80FF,
+ 0x3F7000, 0x3F70E0, 0x3F701C, 0x3F70FC, 0x3FF003, 0x3FF0E3, 0x3FF01F, 0x3FF0FF,
+ 0x3F0E00, 0x3F0EE0, 0x3F0E1C, 0x3F0EFC, 0x3F8E03, 0x3F8EE3, 0x3F8E1F, 0x3F8EFF,
+ 0x3F7E00, 0x3F7EE0, 0x3F7E1C, 0x3F7EFC, 0x3FFE03, 0x3FFEE3, 0x3FFE1F, 0x3FFEFF,
+ 0xFF0100, 0xFF01E0, 0xFF011C, 0xFF01FC, 0xFF8103, 0xFF81E3, 0xFF811F, 0xFF81FF,
+ 0xFF7100, 0xFF71E0, 0xFF711C, 0xFF71FC, 0xFFF103, 0xFFF1E3, 0xFFF11F, 0xFFF1FF,
+ 0xFF0F00, 0xFF0FE0, 0xFF0F1C, 0xFF0FFC, 0xFF8F03, 0xFF8FE3, 0xFF8F1F, 0xFF8FFF,
+ 0xFF7F00, 0xFF7FE0, 0xFF7F1C, 0xFF7FFC, 0xFFFF03, 0xFFFFE3, 0xFFFF1F, 0xFFFFFF,
+};
diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c
new file mode 100644
index 000000000..7425f9d20
--- /dev/null
+++ b/hw/xfree86/xaa/xaaWideLine.c
@@ -0,0 +1,941 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaWideLine.c,v 1.10 2001/11/16 16:47:56 dawes Exp $ */
+
+/*
+
+XAAPolylinesWideSolid does not maintain a span list and subsequently does
+not follow the "touch-each-pixel-once" rules for wide lines and arcs.
+This means it can only be used in the case where we have
+miSpansEasyRop(pGC->alu). Since we clip spans on the fly, we
+limited usage of this function to one rect situations. This
+function is used only for solid lines.
+
+ Adapted from miWideLine by Mark Vojkovich (mvojkovi@ucsd.edu)
+Original mi code written by Keith Packard.
+
+*/
+
+#ifndef XFree86LOADER
+#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__)
+#include <math.h>
+#else
+#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
+#include <math.h>
+#undef _XOPEN_SOURCE
+#endif
+#endif
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "windowstr.h"
+#include "gcstruct.h"
+#include "miscstruct.h"
+#include "miwideline.h"
+#include "mi.h"
+#include "xf86str.h"
+#include "xaa.h"
+#include "xaalocal.h"
+
+#ifdef ICEILTEMPDECL
+ICEILTEMPDECL
+#endif
+
+#define DRAW_POINT(pScrn, x, y) \
+ if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1); \
+ else XAAPointHelper(pScrn, x, y)
+
+#define FILL_RECT(pScrn, x, y, w, h) \
+ if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h); \
+ else XAAFillRectHelper(pScrn, x, y, w, h)
+
+#define FILL_SPAN(pScrn, x, y, w) \
+ if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, 1); \
+ else XAASpanHelper(pScrn, x, y, w)
+
+
+#define CLIPSTEPEDGE(edgey,edge,edgeleft) \
+ if (ybase == edgey) { \
+ if (edgeleft) { \
+ if (edge->x > xcl) \
+ xcl = edge->x; \
+ } else { \
+ if (edge->x < xcr) \
+ xcr = edge->x; \
+ } \
+ edgey++; \
+ edge->x += edge->stepx; \
+ edge->e += edge->dx; \
+ if (edge->e > 0) { \
+ edge->x += edge->signdx; \
+ edge->e -= edge->dy; \
+ } \
+ }
+
+static void
+XAAPointHelper(ScrnInfoPtr pScrn, int x, int y)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ BoxPtr extents = infoRec->ClipBox;
+
+ if((x >= extents->x1) && (x < extents->x2) &&
+ (y >= extents->y1) && (y < extents->y2))
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1);
+}
+
+static void
+XAAFillRectHelper(ScrnInfoPtr pScrn, int x1, int y1, int dx, int dy)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ BoxPtr extents = infoRec->ClipBox;
+ int x2 = x1 + dx;
+ int y2 = y1 + dy;
+
+ if(x1 < extents->x1) x1 = extents->x1;
+ if(x2 >= extents->x2) x2 = extents->x2;
+ if((dx = x2 - x1)<1) return;
+ if(y1 < extents->y1) y1 = extents->y1;
+ if(y2 >= extents->y2) y2 = extents->y2;
+ if((dy = y2 - y1)<1) return;
+
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x1, y1, dx, dy);
+}
+
+
+static void
+XAASpanHelper(ScrnInfoPtr pScrn, int x1, int y, int width)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
+ BoxPtr extents = infoRec->ClipBox;
+ int x2;
+
+ if((y < extents->y1) || (y >= extents->y2)) return;
+
+ x2 = x1 + width;
+ if(x1 < extents->x1) x1 = extents->x1;
+ if(x2 > extents->x2) x2 = extents->x2;
+ width = x2 - x1;
+
+ if(width > 0)
+ (*infoRec->SubsequentSolidFillRect)(pScrn, x1, y, width, 1);
+
+}
+
+#define FixError(x, dx, dy, e, sign, step, h) { \
+ e += (h) * dx; \
+ x += (h) * step; \
+ if(e > 0) { \
+ x += e * sign/dy; \
+ e %= dy; \
+ if(e) { \
+ x += sign; \
+ e -= dy; \
+ } \
+ } \
+}
+
+
+static void
+XAAFillPolyHelper (
+ GCPtr pGC,
+ int y, /* start y coordinate */
+ int overall_height, /* height of entire segment */
+ PolyEdgePtr left, PolyEdgePtr right,
+ int left_count, int right_count )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ BoxPtr extents = infoRec->ClipBox;
+ int left_x, left_e, left_stepx, left_signdx, left_dy, left_dx;
+ int right_x, right_e, right_stepx, right_signdx, right_dy, right_dx;
+ int height, left_height, right_height;
+ int xorg;
+ Bool hardClip;
+
+ if((y >= extents->y2) || ((y + overall_height) <= extents->y1))
+ return;
+
+ /* Muffle compiler */
+ left_x = left_e = left_stepx = left_signdx = left_dy = left_dx = 0;
+ right_x = right_e = right_stepx = right_signdx = right_dy = right_dx = 0;
+
+ left_height = right_height = 0;
+ xorg = 0;
+
+ hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
+
+ while ((left_count || left_height) && (right_count || right_height)) {
+ if (!left_height && left_count) {
+ left_height = left->height;
+ left_x = left->x + xorg;
+ left_stepx = left->stepx;
+ left_signdx = left->signdx;
+ left_e = left->e;
+ left_dy = left->dy;
+ left_dx = left->dx;
+ left_count--;
+ left++;
+ }
+ if (!right_height && right_count) {
+ right_height = right->height;
+ right_x = right->x + xorg + 1;
+ right_stepx = right->stepx;
+ right_signdx = right->signdx;
+ right_e = right->e;
+ right_dy = right->dy;
+ right_dx = right->dx;
+ right_count--;
+ right++;
+ }
+
+ height = (left_height > right_height) ? right_height : left_height;
+
+ left_height -= height;
+ right_height -= height;
+
+ if(hardClip && infoRec->SubsequentSolidFillTrap && (height > 6)) {
+ int right_DX, left_DX;
+
+ right_DX = (right_dx * right_signdx) + (right_stepx * right_dy);
+ left_DX = (left_dx * left_signdx) + (left_stepx * left_dy);
+
+ (*infoRec->SubsequentSolidFillTrap)(infoRec->pScrn, y, height,
+ left_x, left_DX, left_dy, left_e,
+ right_x - 1, right_DX, right_dy, right_e);
+
+ FixError(left_x, left_dx, left_dy, left_e, left_signdx,
+ left_stepx, height);
+ FixError(right_x, right_dx, right_dy, right_e, right_signdx,
+ right_stepx, height);
+ y += height;
+ continue;
+ }
+
+ while (height--) {
+ if(right_x > left_x) {
+ FILL_SPAN(infoRec->pScrn, left_x, y, right_x - left_x);
+ }
+ y++;
+
+ left_x += left_stepx;
+ left_e += left_dx;
+ if (left_e > 0) {
+ left_x += left_signdx;
+ left_e -= left_dy;
+ }
+ right_x += right_stepx;
+ right_e += right_dx;
+ if (right_e > 0) {
+ right_x += right_signdx;
+ right_e -= right_dy;
+ }
+
+ }
+ }
+}
+
+
+
+static void
+XAAWideSegment (
+ GCPtr pGC,
+ int x1, int y1, int x2, int y2,
+ Bool projectLeft, Bool projectRight,
+ LineFacePtr leftFace, LineFacePtr rightFace )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ double l, L, r;
+ double xa, ya;
+ double projectXoff, projectYoff;
+ double k;
+ double maxy;
+ int x, y;
+ int dx, dy;
+ int finaly;
+ PolyEdgePtr left, right;
+ PolyEdgePtr top, bottom;
+ int lefty, righty, topy, bottomy;
+ int signdx;
+ PolyEdgeRec lefts[2], rights[2];
+ LineFacePtr tface;
+ int lw = pGC->lineWidth;
+ Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
+
+ /* draw top-to-bottom always */
+ if ((y2 < y1) || ((y2 == y1) && (x2 < x1))) {
+ x = x1;
+ x1 = x2;
+ x2 = x;
+
+ y = y1;
+ y1 = y2;
+ y2 = y;
+
+ x = projectLeft;
+ projectLeft = projectRight;
+ projectRight = x;
+
+ tface = leftFace;
+ leftFace = rightFace;
+ rightFace = tface;
+ }
+
+ dy = y2 - y1;
+ signdx = 1;
+ dx = x2 - x1;
+ if (dx < 0)
+ signdx = -1;
+
+ leftFace->x = x1;
+ leftFace->y = y1;
+ leftFace->dx = dx;
+ leftFace->dy = dy;
+
+ rightFace->x = x2;
+ rightFace->y = y2;
+ rightFace->dx = -dx;
+ rightFace->dy = -dy;
+
+ if (!dy) {
+ rightFace->xa = 0;
+ rightFace->ya = (double) lw / 2.0;
+ rightFace->k = -(double) (lw * dx) / 2.0;
+ leftFace->xa = 0;
+ leftFace->ya = -rightFace->ya;
+ leftFace->k = rightFace->k;
+ x = x1;
+ if (projectLeft)
+ x -= (lw >> 1);
+ y = y1 - (lw >> 1);
+ dx = x2 - x;
+ if (projectRight)
+ dx += ((lw + 1) >> 1);
+ dy = lw;
+ FILL_RECT(infoRec->pScrn, x, y, dx, dy);
+ } else if (!dx) {
+ leftFace->xa = (double) lw / 2.0;
+ leftFace->ya = 0;
+ leftFace->k = (double) (lw * dy) / 2.0;
+ rightFace->xa = -leftFace->xa;
+ rightFace->ya = 0;
+ rightFace->k = leftFace->k;
+ y = y1;
+ if (projectLeft)
+ y -= lw >> 1;
+ x = x1 - (lw >> 1);
+ dy = y2 - y;
+ if (projectRight)
+ dy += ((lw + 1) >> 1);
+ dx = lw;
+ FILL_RECT(infoRec->pScrn, x, y, dx, dy);
+ } else {
+ l = ((double) lw) / 2.0;
+ L = sqrt((double)(dx*dx + dy*dy));
+
+ if (dx < 0) {
+ right = &rights[1];
+ left = &lefts[0];
+ top = &rights[0];
+ bottom = &lefts[1];
+ } else {
+ right = &rights[0];
+ left = &lefts[1];
+ top = &lefts[0];
+ bottom = &rights[1];
+ }
+ r = l / L;
+
+ /* coord of upper bound at integral y */
+ ya = -r * dx;
+ xa = r * dy;
+
+ projectXoff = -ya;
+ projectYoff = xa;
+
+ /* xa * dy - ya * dx */
+ k = l * L;
+
+ leftFace->xa = xa;
+ leftFace->ya = ya;
+ leftFace->k = k;
+ rightFace->xa = -xa;
+ rightFace->ya = -ya;
+ rightFace->k = k;
+
+ if (projectLeft)
+ righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
+ k, dx, dy, x1, y1, 0, right);
+ else
+ righty = miPolyBuildEdge (xa, ya,
+ k, dx, dy, x1, y1, 0, right);
+
+ /* coord of lower bound at integral y */
+ ya = -ya;
+ xa = -xa;
+
+ /* xa * dy - ya * dx */
+ k = - k;
+
+ if (projectLeft)
+ lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
+ k, dx, dy, x1, y1, 1, left);
+ else
+ lefty = miPolyBuildEdge (xa, ya,
+ k, dx, dy, x1, y1, 1, left);
+
+ /* coord of top face at integral y */
+
+ if (signdx > 0) {
+ ya = -ya;
+ xa = -xa;
+ }
+
+ if (projectLeft) {
+ double xap = xa - projectXoff;
+ double yap = ya - projectYoff;
+ topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
+ -dy, dx, x1, y1, dx > 0, top);
+ }
+ else
+ topy = miPolyBuildEdge(xa, ya, 0.0,
+ -dy, dx, x1, y1, dx > 0, top);
+
+ /* coord of bottom face at integral y */
+
+ if (projectRight) {
+ double xap = xa + projectXoff;
+ double yap = ya + projectYoff;
+ bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
+ -dy, dx, x2, y2, dx < 0, bottom);
+ maxy = -ya + projectYoff;
+ } else {
+ bottomy = miPolyBuildEdge (xa, ya, 0.0,
+ -dy, dx, x2, y2, dx < 0, bottom);
+ maxy = -ya;
+ }
+
+ finaly = ICEIL (maxy) + y2;
+
+ if (dx < 0) {
+ left->height = bottomy - lefty;
+ right->height = finaly - righty;
+ top->height = righty - topy;
+ } else {
+ right->height = bottomy - righty;
+ left->height = finaly - lefty;
+ top->height = lefty - topy;
+ }
+ bottom->height = finaly - bottomy;
+ XAAFillPolyHelper (pGC, topy,
+ bottom->height + bottomy - topy, lefts, rights, 2, 2);
+ }
+}
+
+
+static void
+XAALineArcI (GCPtr pGC, int xorg, int yorg)
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int x, y, e, ex;
+ int slw = pGC->lineWidth;
+ Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
+
+ y = (slw >> 1) + 1;
+ if (slw & 1)
+ e = - ((y << 2) + 3);
+ else
+ e = - (y << 3);
+ ex = -4;
+ x = 0;
+ while (y) {
+ e += (y << 3) - 4;
+ while (e >= 0) {
+ x++;
+ e += (ex = -((x << 3) + 4));
+ }
+ y--;
+ slw = (x << 1) + 1;
+ if ((e == ex) && (slw > 1))
+ slw--;
+
+ FILL_SPAN(infoRec->pScrn, xorg - x, yorg - y, slw);
+
+ if ((y != 0) && ((slw > 1) || (e != ex))) {
+ FILL_SPAN(infoRec->pScrn, xorg - x, yorg + y, slw);
+ }
+ }
+}
+
+
+static void
+XAALineArcD (
+ GCPtr pGC,
+ double xorg,
+ double yorg,
+ PolyEdgePtr edge1,
+ int edgey1,
+ Bool edgeleft1,
+ PolyEdgePtr edge2,
+ int edgey2,
+ Bool edgeleft2 )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ double radius, x0, y0, el, er, yk, xlk, xrk, k;
+ int xbase, ybase, y, boty, xl, xr, xcl, xcr;
+ int ymin, ymax;
+ Bool edge1IsMin, edge2IsMin;
+ int ymin1, ymin2;
+ Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
+
+
+ xbase = floor(xorg);
+ x0 = xorg - xbase;
+ ybase = ICEIL (yorg);
+ y0 = yorg - ybase;
+
+ xlk = x0 + x0 + 1.0;
+ xrk = x0 + x0 - 1.0;
+ yk = y0 + y0 - 1.0;
+ radius = ((double)pGC->lineWidth) / 2.0;
+ y = floor(radius - y0 + 1.0);
+ ybase -= y;
+ ymin = ybase;
+ ymax = 65536;
+ edge1IsMin = FALSE;
+ ymin1 = edgey1;
+ if (edge1->dy >= 0) {
+ if (!edge1->dy) {
+ if (edgeleft1)
+ edge1IsMin = TRUE;
+ else
+ ymax = edgey1;
+ edgey1 = 65536;
+ } else if ((edge1->signdx < 0) == edgeleft1)
+ edge1IsMin = TRUE;
+ }
+ edge2IsMin = FALSE;
+ ymin2 = edgey2;
+ if (edge2->dy >= 0) {
+ if (!edge2->dy) {
+ if (edgeleft2)
+ edge2IsMin = TRUE;
+ else
+ ymax = edgey2;
+ edgey2 = 65536;
+ } else if ((edge2->signdx < 0) == edgeleft2)
+ edge2IsMin = TRUE;
+ }
+ if (edge1IsMin) {
+ ymin = ymin1;
+ if (edge2IsMin && (ymin1 > ymin2))
+ ymin = ymin2;
+ } else if (edge2IsMin)
+ ymin = ymin2;
+ el = radius * radius - ((y + y0) * (y + y0)) - (x0 * x0);
+ er = el + xrk;
+ xl = 1;
+ xr = 0;
+ if (x0 < 0.5) {
+ xl = 0;
+ el -= xlk;
+ }
+ boty = (y0 < -0.5) ? 1 : 0;
+ if (ybase + y - boty > ymax)
+ boty = ymax - ybase - y;
+ while (y > boty) {
+ k = (y << 1) + yk;
+ er += k;
+ while (er > 0.0) {
+ xr++;
+ er += xrk - (xr << 1);
+ }
+ el += k;
+ while (el >= 0.0) {
+ xl--;
+ el += (xl << 1) - xlk;
+ }
+ y--;
+ ybase++;
+ if (ybase < ymin)
+ continue;
+ xcl = xl + xbase;
+ xcr = xr + xbase;
+ CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
+ CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
+ if(xcr >= xcl) {
+ FILL_SPAN(infoRec->pScrn, xcl, ybase, xcr - xcl + 1);
+ }
+ }
+ er = xrk - (xr << 1) - er;
+ el = (xl << 1) - xlk - el;
+ boty = floor(-y0 - radius + 1.0);
+ if (ybase + y - boty > ymax)
+ boty = ymax - ybase - y;
+ while (y > boty) {
+ k = (y << 1) + yk;
+ er -= k;
+ while ((er >= 0.0) && (xr >= 0)) {
+ xr--;
+ er += xrk - (xr << 1);
+ }
+ el -= k;
+ while ((el > 0.0) && (xl <= 0)) {
+ xl++;
+ el += (xl << 1) - xlk;
+ }
+ y--;
+ ybase++;
+ if (ybase < ymin)
+ continue;
+ xcl = xl + xbase;
+ xcr = xr + xbase;
+ CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
+ CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
+ if(xcr >= xcl) {
+ FILL_SPAN(infoRec->pScrn, xcl, ybase, xcr - xcl + 1);
+ }
+ }
+}
+
+
+static void
+XAALineArc (
+ GCPtr pGC,
+ LineFacePtr leftFace,
+ LineFacePtr rightFace,
+ double xorg,
+ double yorg,
+ Bool isInt )
+{
+ int xorgi, yorgi;
+ PolyEdgeRec edge1, edge2;
+ int edgey1, edgey2;
+ Bool edgeleft1, edgeleft2;
+
+ if (isInt) {
+ xorgi = leftFace ? leftFace->x : rightFace->x;
+ yorgi = leftFace ? leftFace->y : rightFace->y;
+ } else { /* Muffle compiler */
+ xorgi = yorgi = 0;
+ }
+ edgey1 = 65536;
+ edgey2 = 65536;
+ edge1.x = 0; /* not used, keep memory checkers happy */
+ edge1.dy = -1;
+ edge2.x = 0; /* not used, keep memory checkers happy */
+ edge2.dy = -1;
+ edgeleft1 = FALSE;
+ edgeleft2 = FALSE;
+
+ if ((pGC->lineWidth > 2) &&
+ ((pGC->capStyle == CapRound && pGC->joinStyle != JoinRound) ||
+ (pGC->joinStyle == JoinRound && pGC->capStyle == CapButt))) {
+ if (isInt) {
+ xorg = (double) xorgi;
+ yorg = (double) yorgi;
+ }
+
+ if (leftFace && rightFace)
+ miRoundJoinClip (leftFace, rightFace, &edge1, &edge2,
+ &edgey1, &edgey2, &edgeleft1, &edgeleft2);
+ else if (leftFace)
+ edgey1 = miRoundCapClip (leftFace, isInt, &edge1, &edgeleft1);
+ else if (rightFace)
+ edgey2 = miRoundCapClip (rightFace, isInt, &edge2, &edgeleft2);
+
+ isInt = FALSE;
+ }
+
+ if (isInt) {
+ if(pGC->lineWidth == 1) {
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
+ DRAW_POINT(infoRec->pScrn, xorgi, yorgi);
+ } else
+ XAALineArcI(pGC, xorgi, yorgi);
+ } else
+ XAALineArcD(pGC, xorg, yorg, &edge1, edgey1, edgeleft1,
+ &edge2, edgey2, edgeleft2);
+
+}
+
+
+static void
+XAALineJoin (
+ GCPtr pGC,
+ LineFacePtr pLeft,
+ LineFacePtr pRight )
+{
+ double mx = 0, my = 0;
+ double denom = 0;
+ PolyVertexRec vertices[4];
+ PolySlopeRec slopes[4];
+ int edgecount;
+ PolyEdgeRec left[4], right[4];
+ int nleft, nright;
+ int y, height;
+ int swapslopes;
+ int joinStyle = pGC->joinStyle;
+ int lw = pGC->lineWidth;
+
+ if (lw == 1) {
+ /* Lines going in the same direction have no join */
+ if ((pLeft->dx >= 0) == (pRight->dx <= 0))
+ return;
+ if (joinStyle != JoinRound) {
+ denom = - pLeft->dx * (double)pRight->dy + pRight->dx *
+ (double)pLeft->dy;
+ if (denom == 0.0)
+ return; /* no join to draw */
+ }
+ if (joinStyle != JoinMiter) {
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL);
+ DRAW_POINT(infoRec->pScrn, pLeft->x, pLeft->y);
+ return;
+ }
+ } else {
+ if (joinStyle == JoinRound) {
+ XAALineArc(pGC, pLeft, pRight,(double)0.0, (double)0.0, TRUE);
+ return;
+ }
+ denom = - pLeft->dx * (double)pRight->dy + pRight->dx *
+ (double)pLeft->dy;
+ if (denom == 0.0)
+ return; /* no join to draw */
+ }
+
+ swapslopes = 0;
+ if (denom > 0) {
+ pLeft->xa = -pLeft->xa;
+ pLeft->ya = -pLeft->ya;
+ pLeft->dx = -pLeft->dx;
+ pLeft->dy = -pLeft->dy;
+ } else {
+ swapslopes = 1;
+ pRight->xa = -pRight->xa;
+ pRight->ya = -pRight->ya;
+ pRight->dx = -pRight->dx;
+ pRight->dy = -pRight->dy;
+ }
+
+ vertices[0].x = pRight->xa;
+ vertices[0].y = pRight->ya;
+ slopes[0].dx = -pRight->dy;
+ slopes[0].dy = pRight->dx;
+ slopes[0].k = 0;
+
+ vertices[1].x = 0;
+ vertices[1].y = 0;
+ slopes[1].dx = pLeft->dy;
+ slopes[1].dy = -pLeft->dx;
+ slopes[1].k = 0;
+
+ vertices[2].x = pLeft->xa;
+ vertices[2].y = pLeft->ya;
+
+ if (joinStyle == JoinMiter) {
+ my = (pLeft->dy * (pRight->xa * pRight->dy - pRight->ya * pRight->dx) -
+ pRight->dy * (pLeft->xa * pLeft->dy - pLeft->ya * pLeft->dx ))/
+ denom;
+ if (pLeft->dy != 0)
+ mx = pLeft->xa + (my - pLeft->ya) *
+ (double) pLeft->dx / (double) pLeft->dy;
+ else
+ mx = pRight->xa + (my - pRight->ya) *
+ (double) pRight->dx / (double) pRight->dy;
+
+ /* check miter limit */
+ if ((mx * mx + my * my) * 4 > SQSECANT * lw * lw)
+ joinStyle = JoinBevel;
+ }
+
+ if (joinStyle == JoinMiter) {
+ slopes[2].dx = pLeft->dx;
+ slopes[2].dy = pLeft->dy;
+ slopes[2].k = pLeft->k;
+ if (swapslopes) {
+ slopes[2].dx = -slopes[2].dx;
+ slopes[2].dy = -slopes[2].dy;
+ slopes[2].k = -slopes[2].k;
+ }
+ vertices[3].x = mx;
+ vertices[3].y = my;
+ slopes[3].dx = pRight->dx;
+ slopes[3].dy = pRight->dy;
+ slopes[3].k = pRight->k;
+ if (swapslopes) {
+ slopes[3].dx = -slopes[3].dx;
+ slopes[3].dy = -slopes[3].dy;
+ slopes[3].k = -slopes[3].k;
+ }
+ edgecount = 4;
+ } else {
+ double scale, dx, dy, adx, ady;
+
+ adx = dx = pRight->xa - pLeft->xa;
+ ady = dy = pRight->ya - pLeft->ya;
+ if (adx < 0)
+ adx = -adx;
+ if (ady < 0)
+ ady = -ady;
+ scale = ady;
+ if (adx > ady)
+ scale = adx;
+ slopes[2].dx = (dx * 65536) / scale;
+ slopes[2].dy = (dy * 65536) / scale;
+ slopes[2].k = ((pLeft->xa + pRight->xa) * slopes[2].dy -
+ (pLeft->ya + pRight->ya) * slopes[2].dx) / 2.0;
+ edgecount = 3;
+ }
+
+ y = miPolyBuildPoly (vertices, slopes, edgecount, pLeft->x, pLeft->y,
+ left, right, &nleft, &nright, &height);
+ XAAFillPolyHelper(pGC, y, height, left, right, nleft, nright);
+}
+
+
+void
+XAAPolylinesWideSolid (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts )
+{
+ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
+ int x1, y1, x2, y2;
+ Bool projectLeft, projectRight;
+ LineFaceRec leftFace, rightFace, prevRightFace, firstFace;
+ int first = TRUE;
+ Bool somethingDrawn = FALSE;
+ Bool selfJoin = FALSE;
+ int xorg = pDrawable->x;
+ int yorg = pDrawable->y;
+ Bool hardClip = FALSE;
+
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip))
+ return;
+
+ if(REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
+ miWideLine(pDrawable, pGC, mode, npt, pPts);
+ return;
+ }
+
+ if (mode == CoordModePrevious) {
+ pPts->x += xorg;
+ pPts->y += yorg;
+ } else if(xorg | yorg) {
+ register int n = npt;
+ register DDXPointPtr pts = pPts;
+
+ while(n--) {
+ pts->x += xorg;
+ pts->y += yorg;
+ pts++;
+ }
+ }
+
+ x2 = pPts->x;
+ y2 = pPts->y;
+ if (npt > 1) {
+ if (mode == CoordModePrevious) {
+ int nptTmp;
+ register DDXPointPtr pPtsTmp;
+
+ x1 = x2;
+ y1 = y2;
+ nptTmp = npt;
+ pPtsTmp = pPts + 1;
+ while (--nptTmp) {
+ x1 += pPtsTmp->x;
+ y1 += pPtsTmp->y;
+ ++pPtsTmp;
+ }
+ if ((x2 == x1) && (y2 == y1))
+ selfJoin = TRUE;
+ } else if ((x2 == pPts[npt-1].x) && (y2 == pPts[npt-1].y))
+ selfJoin = TRUE;
+ }
+
+ projectLeft = ((pGC->capStyle == CapProjecting) && !selfJoin);
+ projectRight = FALSE;
+
+ (*infoRec->SetupForSolidFill)(infoRec->pScrn, pGC->fgPixel, pGC->alu,
+ pGC->planemask);
+
+ infoRec->ClipBox = &pGC->pCompositeClip->extents;
+
+ if(infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL) {
+ hardClip = TRUE;
+ (*infoRec->SetClippingRectangle)(infoRec->pScrn,
+ infoRec->ClipBox->x1, infoRec->ClipBox->y1,
+ infoRec->ClipBox->x2 - 1, infoRec->ClipBox->y2 - 1);
+ }
+
+ while (--npt) {
+ x1 = x2;
+ y1 = y2;
+ ++pPts;
+ x2 = pPts->x;
+ y2 = pPts->y;
+ if (mode == CoordModePrevious) {
+ x2 += x1;
+ y2 += y1;
+ }
+ if ((x1 != x2) || (y1 != y2)) {
+ somethingDrawn = TRUE;
+ if ((npt == 1) && (pGC->capStyle == CapProjecting) && !selfJoin)
+ projectRight = TRUE;
+ XAAWideSegment(pGC, x1, y1, x2, y2,
+ projectLeft, projectRight, &leftFace, &rightFace);
+ if (first) {
+ if (selfJoin)
+ firstFace = leftFace;
+ else if (pGC->capStyle == CapRound) {
+ if (pGC->lineWidth == 1) {
+ DRAW_POINT(infoRec->pScrn, x1, y1);
+ } else
+ XAALineArc(pGC,&leftFace, (LineFacePtr) NULL,
+ (double)0.0, (double)0.0,TRUE);
+ }
+ } else
+ XAALineJoin (pGC, &leftFace, &prevRightFace);
+
+ prevRightFace = rightFace;
+ first = FALSE;
+ projectLeft = FALSE;
+ }
+ if (npt == 1 && somethingDrawn) {
+ if (selfJoin)
+ XAALineJoin (pGC, &firstFace, &rightFace);
+ else if (pGC->capStyle == CapRound) {
+ if (pGC->lineWidth == 1) {
+ DRAW_POINT(infoRec->pScrn, x2, y2);
+ } else
+ XAALineArc (pGC, (LineFacePtr) NULL, &rightFace,
+ (double)0.0, (double)0.0,TRUE);
+ }
+ }
+ }
+ /* handle crock where all points are coincedent */
+ if (!somethingDrawn) {
+ projectLeft = (pGC->capStyle == CapProjecting);
+ XAAWideSegment (pGC, x2, y2, x2, y2, projectLeft, projectLeft,
+ &leftFace, &rightFace);
+ if (pGC->capStyle == CapRound) {
+ XAALineArc (pGC, &leftFace, (LineFacePtr) NULL,
+ (double)0.0, (double)0.0, TRUE);
+ rightFace.dx = -1; /* sleezy hack to make it work */
+ XAALineArc (pGC, (LineFacePtr) NULL, &rightFace,
+ (double)0.0, (double)0.0, TRUE);
+ }
+ }
+
+ infoRec->ClipBox = NULL;
+ if(hardClip)
+ (*infoRec->DisableClipping)(infoRec->pScrn);
+
+ SET_SYNC_FLAG(infoRec);
+}
diff --git a/hw/xfree86/xaa/xaacexp.h b/hw/xfree86/xaa/xaacexp.h
new file mode 100644
index 000000000..276f01672
--- /dev/null
+++ b/hw/xfree86/xaa/xaacexp.h
@@ -0,0 +1,124 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaacexp.h,v 1.5 2000/06/13 02:51:25 mvojkovi Exp $ */
+
+
+#include "Xarch.h"
+
+#ifndef FIXEDBASE
+#define CHECKRETURN(b) if(width <= ((b) * 32)) return(base + (b))
+#else
+#define CHECKRETURN(b) if(width <= ((b) * 32)) return(base)
+#endif
+
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+# define SHIFT_L(value, shift) ((value) >> (shift))
+# define SHIFT_R(value, shift) ((value) << (shift))
+#else
+# define SHIFT_L(value, shift) ((value) << (shift))
+# define SHIFT_R(value, shift) ((value) >> (shift))
+#endif
+
+#ifndef MSBFIRST
+# ifdef FIXEDBASE
+# define WRITE_IN_BITORDER(dest, offset, data) *(dest) = data;
+# else
+# define WRITE_IN_BITORDER(dest, offset, data) *(dest + offset) = data;
+# endif
+#else
+# ifdef FIXEDBASE
+# define WRITE_IN_BITORDER(dest, offset, data) *(dest) = SWAP_BITS_IN_BYTES(data);
+# else
+# define WRITE_IN_BITORDER(dest, offset, data) *(dest + offset) = SWAP_BITS_IN_BYTES(data)
+# endif
+#endif
+
+#ifdef FIXEDBASE
+# ifdef MSBFIRST
+# define WRITE_BITS(b) *base = SWAP_BITS_IN_BYTES(b)
+# define WRITE_BITS1(b) { \
+ *base = byte_reversed_expand3[(b) & 0xFF] | \
+ byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; }
+# define WRITE_BITS2(b) { \
+ *base = byte_reversed_expand3[(b) & 0xFF] | \
+ byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
+ *base = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
+ byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; }
+# define WRITE_BITS3(b) { \
+ *base = byte_reversed_expand3[(b) & 0xFF] | \
+ byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
+ *base = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
+ byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
+ *base = byte_reversed_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
+ byte_reversed_expand3[((b) & 0xFF000000) >> 24] << 8; }
+# else
+# define WRITE_BITS(b) *base = (b)
+# define WRITE_BITS1(b) { \
+ *base = byte_expand3[(b) & 0xFF] | \
+ byte_expand3[((b) & 0xFF00) >> 8] << 24; }
+# define WRITE_BITS2(b) { \
+ *base = byte_expand3[(b) & 0xFF] | \
+ byte_expand3[((b) & 0xFF00) >> 8] << 24; \
+ *base = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
+ byte_expand3[((b) & 0xFF0000) >> 16] << 16; }
+# define WRITE_BITS3(b) { \
+ *base = byte_expand3[(b) & 0xFF] | \
+ byte_expand3[((b) & 0xFF00) >> 8] << 24; \
+ *base = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
+ byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
+ *base = byte_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
+ byte_expand3[((b) & 0xFF000000) >> 24] << 8; }
+# endif
+#else
+# ifdef MSBFIRST
+# define WRITE_BITS(b) *(base++) = SWAP_BITS_IN_BYTES(b)
+# define WRITE_BITS1(b) { \
+ *(base++) = byte_reversed_expand3[(b) & 0xFF] | \
+ byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; }
+# define WRITE_BITS2(b) { \
+ *(base) = byte_reversed_expand3[(b) & 0xFF] | \
+ byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
+ *(base + 1) = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
+ byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
+ base += 2; }
+# define WRITE_BITS3(b) { \
+ *(base) = byte_reversed_expand3[(b) & 0xFF] | \
+ byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \
+ *(base + 1) = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \
+ byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \
+ *(base + 2) = byte_reversed_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
+ byte_reversed_expand3[((b) & 0xFF000000) >> 24] << 8; \
+ base += 3; }
+# else
+# define WRITE_BITS(b) *(base++) = (b)
+# define WRITE_BITS1(b) { \
+ *(base++) = byte_expand3[(b) & 0xFF] | \
+ byte_expand3[((b) & 0xFF00) >> 8] << 24; }
+# define WRITE_BITS2(b) { \
+ *(base) = byte_expand3[(b) & 0xFF] | \
+ byte_expand3[((b) & 0xFF00) >> 8] << 24; \
+ *(base + 1) = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
+ byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
+ base += 2; }
+# define WRITE_BITS3(b) { \
+ *(base) = byte_expand3[(b) & 0xFF] | \
+ byte_expand3[((b) & 0xFF00) >> 8] << 24; \
+ *(base + 1) = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \
+ byte_expand3[((b) & 0xFF0000) >> 16] << 16; \
+ *(base + 2) = byte_expand3[((b) & 0xFF0000) >> 16] >> 16 | \
+ byte_expand3[((b) & 0xFF000000) >> 24] << 8; \
+ base += 3; }
+# endif
+#endif
+
+#ifdef FIXEDBASE
+# ifdef MSBFIRST
+# define EXPNAME(x) x##MSBFirstFixedBase
+# else
+# define EXPNAME(x) x##LSBFirstFixedBase
+# endif
+#else
+# ifdef MSBFIRST
+# define EXPNAME(x) x##MSBFirst
+# else
+# define EXPNAME(x) x##LSBFirst
+# endif
+#endif
diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h
new file mode 100644
index 000000000..0c239c234
--- /dev/null
+++ b/hw/xfree86/xaa/xaalocal.h
@@ -0,0 +1,1756 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaalocal.h,v 1.36 2003/02/17 16:08:29 dawes Exp $ */
+
+#ifndef _XAALOCAL_H
+#define _XAALOCAL_H
+
+/* This file is very unorganized ! */
+
+
+#include "gcstruct.h"
+#include "regionstr.h"
+#include "xf86fbman.h"
+#include "xaa.h"
+#include "mi.h"
+#ifdef RENDER
+#include "picturestr.h"
+#endif
+
+#define GCWhenForced (GCArcMode << 1)
+
+#define DO_COLOR_8x8 0x00000001
+#define DO_MONO_8x8 0x00000002
+#define DO_CACHE_BLT 0x00000003
+#define DO_COLOR_EXPAND 0x00000004
+#define DO_CACHE_EXPAND 0x00000005
+#define DO_IMAGE_WRITE 0x00000006
+#define DO_PIXMAP_COPY 0x00000007
+#define DO_SOLID 0x00000008
+
+
+typedef CARD32 * (*GlyphScanlineFuncPtr)(
+ CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
+);
+
+typedef CARD32 *(*StippleScanlineProcPtr)(CARD32*, CARD32*, int, int, int);
+
+typedef void (*RectFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int,
+ XAACacheInfoPtr);
+typedef void (*TrapFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int,
+ int, int, int, int, int, int,
+ XAACacheInfoPtr);
+
+
+
+typedef struct _XAAScreen {
+ CreateGCProcPtr CreateGC;
+ CloseScreenProcPtr CloseScreen;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ CopyWindowProcPtr CopyWindow;
+ WindowExposuresProcPtr WindowExposures;
+ BSFuncRec BackingStoreFuncs;
+ CreatePixmapProcPtr CreatePixmap;
+ DestroyPixmapProcPtr DestroyPixmap;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ XAAInfoRecPtr AccelInfoRec;
+ Bool (*EnterVT)(int, int);
+ void (*LeaveVT)(int, int);
+ int (*SetDGAMode)(int, int, DGADevicePtr);
+ void (*EnableDisableFBAccess)(int, Bool);
+#ifdef RENDER
+ CompositeProcPtr Composite;
+ GlyphsProcPtr Glyphs;
+#endif
+} XAAScreenRec, *XAAScreenPtr;
+
+#define OPS_ARE_PIXMAP 0x00000001
+#define OPS_ARE_ACCEL 0x00000002
+
+typedef struct _XAAGC {
+ GCOps *wrapOps;
+ GCFuncs *wrapFuncs;
+ GCOps *XAAOps;
+ int DashLength;
+ unsigned char* DashPattern;
+ unsigned long changes;
+ unsigned long flags;
+} XAAGCRec, *XAAGCPtr;
+
+#define REDUCIBILITY_CHECKED 0x00000001
+#define REDUCIBLE_TO_8x8 0x00000002
+#define REDUCIBLE_TO_2_COLOR 0x00000004
+#define DIRTY 0x00010000
+#define OFFSCREEN 0x00020000
+#define DGA_PIXMAP 0x00040000
+#define SHARED_PIXMAP 0x00080000
+#define LOCKED_PIXMAP 0x00100000
+
+#define REDUCIBILITY_MASK \
+ (REDUCIBILITY_CHECKED | REDUCIBLE_TO_8x8 | REDUCIBLE_TO_2_COLOR)
+
+typedef struct _XAAPixmap {
+ unsigned long flags;
+ CARD32 pattern0;
+ CARD32 pattern1;
+ int fg;
+ int bg;
+ FBAreaPtr offscreenArea;
+ Bool freeData;
+} XAAPixmapRec, *XAAPixmapPtr;
+
+
+Bool
+XAACreateGC(
+ GCPtr pGC
+);
+
+Bool
+XAAInitAccel(
+ ScreenPtr pScreen,
+ XAAInfoRecPtr infoRec
+);
+
+RegionPtr
+XAABitBlt(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GC *pGC,
+ int srcx,
+ int srcy,
+ int width,
+ int height,
+ int dstx,
+ int dsty,
+ void (*doBitBlt)(DrawablePtr, DrawablePtr, GCPtr, RegionPtr, DDXPointPtr),
+ unsigned long bitPlane
+);
+
+void
+XAAScreenToScreenBitBlt(
+ ScrnInfoPtr pScrn,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir,
+ int ydir,
+ int alu,
+ unsigned int planemask
+);
+
+void
+XAADoBitBlt(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc
+);
+
+void
+XAADoImageWrite(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc
+);
+
+void
+XAADoImageRead(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc
+);
+
+void
+XAACopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+);
+
+
+RegionPtr
+XAACopyArea(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GC *pGC,
+ int srcx,
+ int srcy,
+ int width,
+ int height,
+ int dstx,
+ int dsty
+);
+
+void
+XAAValidateCopyArea(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+void
+XAAValidatePutImage(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+void
+XAAValidateCopyPlane(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+void
+XAAValidatePushPixels(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+void
+XAAValidateFillSpans(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+void
+XAAValidatePolyGlyphBlt(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+void
+XAAValidateImageGlyphBlt(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+void
+XAAValidatePolylines(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+);
+
+
+RegionPtr
+XAACopyPlaneColorExpansion(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx,
+ int srcy,
+ int width,
+ int height,
+ int dstx,
+ int dsty,
+ unsigned long bitPlane
+);
+
+
+void
+XAAPushPixelsSolidColorExpansion(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDrawable,
+ int dx,
+ int dy,
+ int xOrg,
+ int yOrg
+);
+
+void
+XAAWriteBitmapColorExpandMSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapColorExpand3MSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapColorExpandMSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapColorExpand3MSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapColorExpandLSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapColorExpand3LSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapColorExpandLSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapColorExpand3LSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+
+void
+XAAWriteBitmapScanlineColorExpandMSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapScanlineColorExpand3MSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapScanlineColorExpandMSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapScanlineColorExpand3MSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapScanlineColorExpandLSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapScanlineColorExpand3LSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapScanlineColorExpandLSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWriteBitmapScanlineColorExpand3LSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int skipleft,
+ int fg, int bg,
+ int rop,
+ unsigned int planemask
+);
+
+void
+XAAWritePixmap (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int rop,
+ unsigned int planemask,
+ int transparency_color,
+ int bpp, int depth
+);
+
+void
+XAAWritePixmapScanline (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int rop,
+ unsigned int planemask,
+ int transparency_color,
+ int bpp, int depth
+);
+
+typedef void (*ClipAndRenderRectsFunc)(GCPtr, int, BoxPtr, int, int);
+
+
+void
+XAAClipAndRenderRects(
+ GCPtr pGC,
+ ClipAndRenderRectsFunc func,
+ int nrectFill,
+ xRectangle *prectInit,
+ int xorg, int yorg
+);
+
+
+typedef void (*ClipAndRenderSpansFunc)(GCPtr, int, DDXPointPtr, int*,
+ int, int, int);
+
+void
+XAAClipAndRenderSpans(
+ GCPtr pGC,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted,
+ ClipAndRenderSpansFunc func,
+ int xorg,
+ int yorg
+);
+
+
+void
+XAAFillSolidRects(
+ ScrnInfoPtr pScrn,
+ int fg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox
+);
+
+void
+XAAFillMono8x8PatternRects(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int pat0, int pat1,
+ int xorg, int yorg
+);
+
+void
+XAAFillMono8x8PatternRectsScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int pat0, int pat1,
+ int xorg, int yorg
+);
+
+
+void
+XAAFillColor8x8PatternRectsScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorigin, int yorigin,
+ XAACacheInfoPtr pCache
+);
+
+void
+XAAFillColor8x8PatternRects(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorigin, int yorigin,
+ XAACacheInfoPtr pCache
+);
+
+void
+XAAFillCacheBltRects(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ XAACacheInfoPtr pCache
+);
+
+void
+XAAFillCacheExpandRects(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillImageWriteRects(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+);
+
+
+void
+XAATEGlyphRendererMSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRenderer3MSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRendererMSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRenderer3MSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRendererLSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+
+void
+XAATEGlyphRenderer3LSBFirstFixedBase (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRendererLSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRenderer3LSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+
+void
+XAATEGlyphRendererScanlineMSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRendererScanline3MSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRendererScanlineLSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+void
+XAATEGlyphRendererScanline3LSBFirst (
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h, int skipleft, int startline,
+ unsigned int **glyphs, int glyphWidth,
+ int fg, int bg, int rop, unsigned planemask
+);
+
+
+extern CARD32 *(*XAAGlyphScanlineFuncMSBFirstFixedBase[32])(
+ CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
+);
+
+extern CARD32 *(*XAAGlyphScanlineFuncMSBFirst[32])(
+ CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
+);
+
+extern CARD32 *(*XAAGlyphScanlineFuncLSBFirstFixedBase[32])(
+ CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
+);
+
+extern CARD32 *(*XAAGlyphScanlineFuncLSBFirst[32])(
+ CARD32 *base, unsigned int **glyphp, int line, int nglyph, int width
+);
+
+void
+XAAFillColorExpandRectsLSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandRects3LSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandRectsLSBFirstFixedBase(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandRects3LSBFirstFixedBase(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandRectsMSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandRects3MSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandRectsMSBFirstFixedBase(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandRects3MSBFirstFixedBase(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillScanlineColorExpandRectsLSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillScanlineColorExpandRects3LSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillScanlineColorExpandRectsMSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillScanlineColorExpandRects3MSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int nBox,
+ BoxPtr pBox,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandSpansLSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandSpans3LSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandSpansLSBFirstFixedBase(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandSpans3LSBFirstFixedBase(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandSpansMSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandSpans3MSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandSpansMSBFirstFixedBase(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillColorExpandSpans3MSBFirstFixedBase(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillScanlineColorExpandSpansLSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillScanlineColorExpandSpans3LSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x,
+ int y,
+ int w,
+ int h,
+ int leftPad,
+ int format,
+ char *pImage
+);
+
+void
+XAAFillScanlineColorExpandSpansMSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillScanlineColorExpandSpans3MSBFirst(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+
+extern CARD32 *(*XAAStippleScanlineFuncMSBFirstFixedBase[6])(
+ CARD32* base, CARD32* src, int offset, int width, int dwords
+);
+
+extern CARD32 *(*XAAStippleScanlineFuncMSBFirst[6])(
+ CARD32* base, CARD32* src, int offset, int width, int dwords
+);
+
+extern CARD32 *(*XAAStippleScanlineFuncLSBFirstFixedBase[6])(
+ CARD32* base, CARD32* src, int offset, int width, int dwords
+);
+
+extern CARD32 *(*XAAStippleScanlineFuncLSBFirst[6])(
+ CARD32* base, CARD32* src, int offset, int width, int dwords
+);
+
+int
+XAAPolyText8TEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+);
+
+int
+XAAPolyText16TEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+);
+
+void
+XAAImageText8TEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+);
+
+void
+XAAImageText16TEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+);
+
+void
+XAAImageGlyphBltTEColorExpansion(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+);
+
+void
+XAAPolyGlyphBltTEColorExpansion(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+);
+
+
+int
+XAAPolyText8NonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+);
+
+int
+XAAPolyText16NonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+);
+
+void
+XAAImageText8NonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ char *chars
+);
+
+void
+XAAImageText16NonTEColorExpansion(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x, int y,
+ int count,
+ unsigned short *chars
+);
+
+void
+XAAImageGlyphBltNonTEColorExpansion(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+);
+
+void
+XAAPolyGlyphBltNonTEColorExpansion(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+);
+
+
+void XAANonTEGlyphRenderer(
+ ScrnInfoPtr pScrn,
+ int x, int y, int n,
+ NonTEGlyphPtr glyphs,
+ BoxPtr pbox,
+ int fg, int rop,
+ unsigned int planemask
+);
+
+void
+XAAFillSolidSpans(
+ ScrnInfoPtr pScrn,
+ int fg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted
+);
+
+void
+XAAFillMono8x8PatternSpans(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted,
+ int patx, int paty,
+ int xorg, int yorg
+);
+
+void
+XAAFillMono8x8PatternSpansScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted,
+ int patx, int paty,
+ int xorg, int yorg
+);
+
+void
+XAAFillColor8x8PatternSpansScreenOrigin(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted,
+ XAACacheInfoPtr,
+ int xorigin, int yorigin
+);
+
+void
+XAAFillColor8x8PatternSpans(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth, int fSorted,
+ XAACacheInfoPtr,
+ int xorigin, int yorigin
+);
+
+void
+XAAFillCacheBltSpans(
+ ScrnInfoPtr pScrn,
+ int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr points,
+ int *widths,
+ int fSorted,
+ XAACacheInfoPtr pCache,
+ int xorg, int yorg
+);
+
+void
+XAAFillCacheExpandSpans(
+ ScrnInfoPtr pScrn,
+ int fg, int bg, int rop,
+ unsigned int planemask,
+ int n,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int fSorted,
+ int xorg, int yorg,
+ PixmapPtr pPix
+);
+
+void
+XAAFillSpans(
+ DrawablePtr pDrawable,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidth,
+ int fSorted
+);
+
+
+void
+XAAInitPixmapCache(
+ ScreenPtr pScreen,
+ RegionPtr areas,
+ pointer data
+);
+
+void
+XAAWriteBitmapToCache(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int fg, int bg
+);
+
+void
+XAAWriteBitmapToCacheLinear(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int fg, int bg
+);
+
+void
+XAAWritePixmapToCache(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int bpp, int depth
+);
+
+void
+XAAWritePixmapToCacheLinear(
+ ScrnInfoPtr pScrn,
+ int x, int y, int w, int h,
+ unsigned char *src,
+ int srcwidth,
+ int bpp, int depth
+);
+
+
+void
+XAAPaintWindow(
+ WindowPtr pWin,
+ RegionPtr prgn,
+ int what
+);
+
+void
+XAASolidHorVertLineAsRects(
+ ScrnInfoPtr pScrn,
+ int x, int y, int len, int dir
+);
+
+void
+XAASolidHorVertLineAsTwoPoint(
+ ScrnInfoPtr pScrn,
+ int x, int y, int len, int dir
+);
+
+void
+XAASolidHorVertLineAsBresenham(
+ ScrnInfoPtr pScrn,
+ int x, int y, int len, int dir
+);
+
+
+void
+XAAPolyRectangleThinSolid(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+);
+
+
+void
+XAAPolylinesWideSolid (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts
+);
+
+void
+XAAFillPolygonSolid(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+);
+
+void
+XAAFillPolygonStippled(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+);
+
+
+void
+XAAFillPolygonTiled(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+);
+
+
+int
+XAAIsEasyPolygon(
+ DDXPointPtr ptsIn,
+ int count,
+ BoxPtr extents,
+ int origin,
+ DDXPointPtr *topPoint,
+ int *topY, int *bottomY,
+ int shape
+);
+
+void
+XAAFillPolygonHelper(
+ ScrnInfoPtr pScrn,
+ DDXPointPtr ptsIn,
+ int count,
+ DDXPointPtr topPoint,
+ int y,
+ int maxy,
+ int origin,
+ RectFuncPtr RectFunc,
+ TrapFuncPtr TrapFunc,
+ int xorg,
+ int yorg,
+ XAACacheInfoPtr pCache
+);
+
+void
+XAAPolySegment(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+);
+
+void
+XAAPolyLines(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit
+);
+
+void
+XAAPolySegmentDashed(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+);
+
+void
+XAAPolyLinesDashed(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit
+);
+
+
+void
+XAAWriteMono8x8PatternToCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache);
+
+void
+XAAWriteColor8x8PatternToCache(
+ ScrnInfoPtr pScrn,
+ PixmapPtr pPix,
+ XAACacheInfoPtr pCache
+);
+
+void
+XAARotateMonoPattern(
+ int *pat0, int *pat1,
+ int xoffset, int yoffset,
+ Bool msbfirst
+);
+
+void XAAComputeDash(GCPtr pGC);
+
+void XAAMoveDWORDS_FixedBase(
+ register CARD32* dest,
+ register CARD32* src,
+ register int dwords
+);
+
+void XAAMoveDWORDS_FixedSrc(
+ register CARD32* dest,
+ register CARD32* src,
+ register int dwords
+);
+
+void XAAMoveDWORDS(
+ register CARD32* dest,
+ register CARD32* src,
+ register int dwords
+);
+
+int
+XAAGetRectClipBoxes(
+ RegionPtr prgnClip,
+ BoxPtr pboxClippedBase,
+ int nrectFill,
+ xRectangle *prectInit
+);
+
+void
+XAASetupOverlay8_32Planar(ScreenPtr);
+
+void
+XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs);
+
+XAACacheInfoPtr
+XAACacheTile(ScrnInfoPtr Scrn, PixmapPtr pPix);
+
+XAACacheInfoPtr
+XAACacheMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
+
+XAACacheInfoPtr
+XAACachePlanarMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix);
+
+XAACacheInfoPtr
+XAACacheStipple(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
+
+XAACacheInfoPtr
+XAACacheMono8x8Pattern(ScrnInfoPtr Scrn, int pat0, int pat1);
+
+XAACacheInfoPtr
+XAACacheColor8x8Pattern(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg);
+
+void
+XAATileCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache, int w, int h);
+
+void XAAClosePixmapCache(ScreenPtr pScreen);
+void XAAInvalidatePixmapCache(ScreenPtr pScreen);
+
+Bool XAACheckStippleReducibility(PixmapPtr pPixmap);
+Bool XAACheckTileReducibility(PixmapPtr pPixmap, Bool checkMono);
+
+int XAAStippledFillChooser(GCPtr pGC);
+int XAAOpaqueStippledFillChooser(GCPtr pGC);
+int XAATiledFillChooser(GCPtr pGC);
+
+void XAAMoveInOffscreenPixmaps(ScreenPtr pScreen);
+void XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen);
+void XAARemoveAreaCallback(FBAreaPtr area);
+void XAAMoveOutOffscreenPixmap(PixmapPtr pPix);
+Bool XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec);
+
+#ifdef RENDER
+void
+XAAComposite (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+
+Bool
+XAADoComposite (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+
+void
+XAAGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs);
+
+Bool
+XAADoGlyphs (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlist,
+ GlyphListPtr list,
+ GlyphPtr *glyphs);
+
+
+
+/* helpers */
+void
+XAA_888_plus_PICT_a8_to_8888 (
+ CARD32 color,
+ CARD8 *alphaPtr, /* in bytes */
+ int alphaPitch,
+ CARD32 *dstPtr,
+ int dstPitch, /* in dwords */
+ int width,
+ int height
+);
+
+Bool
+XAAGetRGBAFromPixel(
+ CARD32 pixel,
+ CARD16 *red,
+ CARD16 *green,
+ CARD16 *blue,
+ CARD16 *alpha,
+ CARD32 format
+);
+
+
+Bool
+XAAGetPixelFromRGBA (
+ CARD32 *pixel,
+ CARD16 red,
+ CARD16 green,
+ CARD16 blue,
+ CARD16 alpha,
+ CARD32 format
+);
+
+#endif
+
+
+extern GCOps XAAFallbackOps;
+extern GCFuncs XAAGCFuncs;
+extern int XAAScreenIndex;
+extern int XAAGCIndex;
+extern int XAAPixmapIndex;
+
+extern unsigned int XAAShiftMasks[32];
+
+extern unsigned int byte_expand3[256], byte_reversed_expand3[256];
+
+CARD32 XAAReverseBitOrder(CARD32 data);
+
+#define GET_XAASCREENPTR_FROM_SCREEN(pScreen)\
+ (pScreen)->devPrivates[XAAScreenIndex].ptr
+
+#define GET_XAASCREENPTR_FROM_GC(pGC)\
+ (pGC)->pScreen->devPrivates[XAAScreenIndex].ptr
+
+#define GET_XAASCREENPTR_FROM_DRAWABLE(pDraw)\
+ (pDraw)->pScreen->devPrivates[XAAScreenIndex].ptr
+
+#define GET_XAAINFORECPTR_FROM_SCREEN(pScreen)\
+ ((XAAScreenPtr)((pScreen)->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
+
+#define GET_XAAINFORECPTR_FROM_GC(pGC)\
+((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
+
+#define GET_XAAINFORECPTR_FROM_DRAWABLE(pDraw)\
+((XAAScreenPtr)((pDraw)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
+
+#define GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn)\
+((XAAScreenPtr)((pScrn)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec
+
+#define XAA_GET_PIXMAP_PRIVATE(pix)\
+ (XAAPixmapPtr)((pix)->devPrivates[XAAPixmapIndex].ptr)
+
+#define CHECK_RGB_EQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff))
+
+#define CHECK_FG(pGC, flags) \
+ (!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->fgPixel))
+
+#define CHECK_BG(pGC, flags) \
+ (!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->bgPixel))
+
+#define CHECK_ROP(pGC, flags) \
+ (!(flags & GXCOPY_ONLY) || (pGC->alu == GXcopy))
+
+#define CHECK_ROPSRC(pGC, flags) \
+ (!(flags & ROP_NEEDS_SOURCE) || ((pGC->alu != GXclear) && \
+ (pGC->alu != GXnoop) && (pGC->alu != GXinvert) && \
+ (pGC->alu != GXset)))
+
+#define CHECK_PLANEMASK(pGC, flags) \
+ (!(flags & NO_PLANEMASK) || \
+ ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) == \
+ infoRec->FullPlanemasks[pGC->depth - 1]))
+
+#define CHECK_COLORS(pGC, flags) \
+ (!(flags & RGB_EQUAL) || \
+ (CHECK_RGB_EQUAL(pGC->fgPixel) && CHECK_RGB_EQUAL(pGC->bgPixel)))
+
+#define CHECK_NO_GXCOPY(pGC, flags) \
+ ((pGC->alu != GXcopy) || !(flags & NO_GXCOPY) || \
+ ((pGC->planemask & infoRec->FullPlanemask) != infoRec->FullPlanemask))
+
+#define IS_OFFSCREEN_PIXMAP(pPix)\
+ ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->offscreenArea)
+
+#define PIXMAP_IS_SHARED(pPix)\
+ ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & SHARED_PIXMAP)
+
+#define OFFSCREEN_PIXMAP_LOCKED(pPix)\
+ ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & LOCKED_PIXMAP)
+
+#define XAA_DEPTH_BUG(pGC) \
+ ((pGC->depth == 32) && (pGC->bgPixel == 0xffffffff))
+
+#define DELIST_OFFSCREEN_PIXMAP(pPix) { \
+ PixmapLinkPtr _pLink, _prev; \
+ _pLink = infoRec->OffscreenPixmaps; \
+ _prev = NULL; \
+ while(_pLink) { \
+ if(_pLink->pPix == pPix) { \
+ if(_prev) _prev->next = _pLink->next; \
+ else infoRec->OffscreenPixmaps = _pLink->next; \
+ xfree(_pLink); \
+ break; \
+ } \
+ _prev = _pLink; \
+ _pLink = _pLink->next; \
+ }}
+
+
+#define SWAP_BITS_IN_BYTES(v) \
+ (((0x01010101 & (v)) << 7) | ((0x02020202 & (v)) << 5) | \
+ ((0x04040404 & (v)) << 3) | ((0x08080808 & (v)) << 1) | \
+ ((0x10101010 & (v)) >> 1) | ((0x20202020 & (v)) >> 3) | \
+ ((0x40404040 & (v)) >> 5) | ((0x80808080 & (v)) >> 7))
+
+/*
+ * Moved XAAPixmapCachePrivate here from xaaPCache.c, since driver
+ * replacements for CacheMonoStipple need access to it
+ */
+
+typedef struct {
+ int Num512x512;
+ int Current512;
+ XAACacheInfoPtr Info512;
+ int Num256x256;
+ int Current256;
+ XAACacheInfoPtr Info256;
+ int Num128x128;
+ int Current128;
+ XAACacheInfoPtr Info128;
+ int NumMono;
+ int CurrentMono;
+ XAACacheInfoPtr InfoMono;
+ int NumColor;
+ int CurrentColor;
+ XAACacheInfoPtr InfoColor;
+ int NumPartial;
+ int CurrentPartial;
+ XAACacheInfoPtr InfoPartial;
+ DDXPointRec MonoOffsets[64];
+ DDXPointRec ColorOffsets[64];
+} XAAPixmapCachePrivate, *XAAPixmapCachePrivatePtr;
+
+
+#endif /* _XAALOCAL_H */
diff --git a/hw/xfree86/xaa/xaarop.h b/hw/xfree86/xaa/xaarop.h
new file mode 100644
index 000000000..8fee07533
--- /dev/null
+++ b/hw/xfree86/xaa/xaarop.h
@@ -0,0 +1,307 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaarop.h,v 1.1 1999/03/21 07:35:31 dawes Exp $ */
+
+/*
+
+ int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
+
+ For use with solid fills emulated by solid 8x8 patterns. You
+ give it the foreground, planemask and X rop and it will replace
+ the foreground with a new one and the rop with the appropriate
+ MS triadic raster op. The function will return which components
+ (S-P) need to be enabled.
+
+
+ int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
+
+ For use with 8x8 opaque pattern fills. You give it the foreground,
+ and background, planemask and X rop and it will replace the
+ foreground and background with new ones and the rop with the
+ appropriate MS triadic raster op. The function will return which
+ components (S-P) need to be enabled.
+
+
+ ROP_PAT - Means to enable 8x8 mono patterns (all bits
+ set for solid patterns). Set the foreground and
+ background as returned by the function.
+
+ ROP_SRC - Means a source of color == planemask should be used.
+
+
+*/
+
+#ifndef _XAAROP_H
+#define _XAAROP_H
+
+#define ROP_DST 0x00000001
+#define ROP_SRC 0x00000002
+#define ROP_PAT 0x00000004
+
+#define ROP_0 0x00
+#define ROP_DPSoon 0x01
+#define ROP_DPSona 0x02
+#define ROP_PSon 0x03
+#define ROP_SDPona 0x04
+#define ROP_DPon 0x05
+#define ROP_PDSxnon 0x06
+#define ROP_PDSaon 0x07
+#define ROP_SDPnaa 0x08
+#define ROP_PDSxon 0x09
+#define ROP_DPna 0x0A
+#define ROP_PSDnaon 0x0B
+#define ROP_SPna 0x0C
+#define ROP_PDSnaon 0x0D
+#define ROP_PDSonon 0x0E
+#define ROP_Pn 0x0F
+#define ROP_PDSona 0x10
+#define ROP_DSon 0x11
+#define ROP_SDPxnon 0x12
+#define ROP_SDPaon 0x13
+#define ROP_DPSxnon 0x14
+#define ROP_DPSaon 0x15
+#define ROP_PSDPSanaxx 0x16
+#define ROP_SSPxDSxaxn 0x17
+#define ROP_SPxPDxa 0x18
+#define ROP_SDPSanaxn 0x19
+#define ROP_PDSPaox 0x1A
+#define ROP_SDPSxaxn 0x1B
+#define ROP_PSDPaox 0x1C
+#define ROP_DSPDxaxn 0x1D
+#define ROP_PDSox 0x1E
+#define ROP_PDSoan 0x1F
+#define ROP_DPSnaa 0x20
+#define ROP_SDPxon 0x21
+#define ROP_DSna 0x22
+#define ROP_SPDnaon 0x23
+#define ROP_SPxDSxa 0x24
+#define ROP_PDSPanaxn 0x25
+#define ROP_SDPSaox 0x26
+#define ROP_SDPSxnox 0x27
+#define ROP_DPSxa 0x28
+#define ROP_PSDPSaoxxn 0x29
+#define ROP_DPSana 0x2A
+#define ROP_SSPxPDxaxn 0x2B
+#define ROP_SPDSoax 0x2C
+#define ROP_PSDnox 0x2D
+#define ROP_PSDPxox 0x2E
+#define ROP_PSDnoan 0x2F
+#define ROP_PSna 0x30
+#define ROP_SDPnaon 0x31
+#define ROP_SDPSoox 0x32
+#define ROP_Sn 0x33
+#define ROP_SPDSaox 0x34
+#define ROP_SPDSxnox 0x35
+#define ROP_SDPox 0x36
+#define ROP_SDPoan 0x37
+#define ROP_PSDPoax 0x38
+#define ROP_SPDnox 0x39
+#define ROP_SPDSxox 0x3A
+#define ROP_SPDnoan 0x3B
+#define ROP_PSx 0x3C
+#define ROP_SPDSonox 0x3D
+#define ROP_SPDSnaox 0x3E
+#define ROP_PSan 0x3F
+#define ROP_PSDnaa 0x40
+#define ROP_DPSxon 0x41
+#define ROP_SDxPDxa 0x42
+#define ROP_SPDSanaxn 0x43
+#define ROP_SDna 0x44
+#define ROP_DPSnaon 0x45
+#define ROP_DSPDaox 0x46
+#define ROP_PSDPxaxn 0x47
+#define ROP_SDPxa 0x48
+#define ROP_PDSPDaoxxn 0x49
+#define ROP_DPSDoax 0x4A
+#define ROP_PDSnox 0x4B
+#define ROP_SDPana 0x4C
+#define ROP_SSPxDSxoxn 0x4D
+#define ROP_PDSPxox 0x4E
+#define ROP_PDSnoan 0x4F
+#define ROP_PDna 0x50
+#define ROP_DSPnaon 0x51
+#define ROP_DPSDaox 0x52
+#define ROP_SPDSxaxn 0x53
+#define ROP_DPSonon 0x54
+#define ROP_Dn 0x55
+#define ROP_DPSox 0x56
+#define ROP_DPSoan 0x57
+#define ROP_PDSPoax 0x58
+#define ROP_DPSnox 0x59
+#define ROP_DPx 0x5A
+#define ROP_DPSDonox 0x5B
+#define ROP_DPSDxox 0x5C
+#define ROP_DPSnoan 0x5D
+#define ROP_DPSDnaox 0x5E
+#define ROP_DPan 0x5F
+#define ROP_PDSxa 0x60
+#define ROP_DSPDSaoxxn 0x61
+#define ROP_DSPDoax 0x62
+#define ROP_SDPnox 0x63
+#define ROP_SDPSoax 0x64
+#define ROP_DSPnox 0x65
+#define ROP_DSx 0x66
+#define ROP_SDPSonox 0x67
+#define ROP_DSPDSonoxxn 0x68
+#define ROP_PDSxxn 0x69
+#define ROP_DPSax 0x6A
+#define ROP_PSDPSoaxxn 0x6B
+#define ROP_SDPax 0x6C
+#define ROP_PDSPDoaxxn 0x6D
+#define ROP_SDPSnoax 0x6E
+#define ROP_PDSxnan 0x6F
+#define ROP_PDSana 0x70
+#define ROP_SSDxPDxaxn 0x71
+#define ROP_SDPSxox 0x72
+#define ROP_SDPnoan 0x73
+#define ROP_DSPDxox 0x74
+#define ROP_DSPnoan 0x75
+#define ROP_SDPSnaox 0x76
+#define ROP_DSan 0x77
+#define ROP_PDSax 0x78
+#define ROP_DSPDSoaxxn 0x79
+#define ROP_DPSDnoax 0x7A
+#define ROP_SDPxnan 0x7B
+#define ROP_SPDSnoax 0x7C
+#define ROP_DPSxnan 0x7D
+#define ROP_SPxDSxo 0x7E
+#define ROP_DPSaan 0x7F
+#define ROP_DPSaa 0x80
+#define ROP_SPxDSxon 0x81
+#define ROP_DPSxna 0x82
+#define ROP_SPDSnoaxn 0x83
+#define ROP_SDPxna 0x84
+#define ROP_PDSPnoaxn 0x85
+#define ROP_DSPDSoaxx 0x86
+#define ROP_PDSaxn 0x87
+#define ROP_DSa 0x88
+#define ROP_SDPSnaoxn 0x89
+#define ROP_DSPnoa 0x8A
+#define ROP_DSPDxoxn 0x8B
+#define ROP_SDPnoa 0x8C
+#define ROP_SDPSxoxn 0x8D
+#define ROP_SSDxPDxax 0x8E
+#define ROP_PDSanan 0x8F
+#define ROP_PDSxna 0x90
+#define ROP_SDPSnoaxn 0x91
+#define ROP_DPSDPoaxx 0x92
+#define ROP_SPDaxn 0x93
+#define ROP_PSDPSoaxx 0x94
+#define ROP_DPSaxn 0x95
+#define ROP_DPSxx 0x96
+#define ROP_PSDPSonoxx 0x97
+#define ROP_SDPSonoxn 0x98
+#define ROP_DSxn 0x99
+#define ROP_DPSnax 0x9A
+#define ROP_SDPSoaxn 0x9B
+#define ROP_SPDnax 0x9C
+#define ROP_DSPDoaxn 0x9D
+#define ROP_DSPDSaoxx 0x9E
+#define ROP_PDSxan 0x9F
+#define ROP_DPa 0xA0
+#define ROP_PDSPnaoxn 0xA1
+#define ROP_DPSnoa 0xA2
+#define ROP_DPSDxoxn 0xA3
+#define ROP_PDSPonoxn 0xA4
+#define ROP_PDxn 0xA5
+#define ROP_DSPnax 0xA6
+#define ROP_PDSPoaxn 0xA7
+#define ROP_DPSoa 0xA8
+#define ROP_DPSoxn 0xA9
+#define ROP_D 0xAA
+#define ROP_DPSono 0xAB
+#define ROP_SPDSxax 0xAC
+#define ROP_DPSDaoxn 0xAD
+#define ROP_DSPnao 0xAE
+#define ROP_DPno 0xAF
+#define ROP_PDSnoa 0xB0
+#define ROP_PDSPxoxn 0xB1
+#define ROP_SSPxDSxox 0xB2
+#define ROP_SDPanan 0xB3
+#define ROP_PSDnax 0xB4
+#define ROP_DPSDoaxn 0xB5
+#define ROP_DPSDPaoxx 0xB6
+#define ROP_SDPxan 0xB7
+#define ROP_PSDPxax 0xB8
+#define ROP_DSPDaoxn 0xB9
+#define ROP_DPSnao 0xBA
+#define ROP_DSno 0xBB
+#define ROP_SPDSanax 0xBC
+#define ROP_SDxPDxan 0xBD
+#define ROP_DPSxo 0xBE
+#define ROP_DPSano 0xBF
+#define ROP_Psa 0xC0
+#define ROP_SPDSnaoxn 0xC1
+#define ROP_SPDSonoxn 0xC2
+#define ROP_PSxn 0xC3
+#define ROP_SPDnoa 0xC4
+#define ROP_SPDSxoxn 0xC5
+#define ROP_SDPnax 0xC6
+#define ROP_PSDPoaxn 0xC7
+#define ROP_SDPoa 0xC8
+#define ROP_SPDoxn 0xC9
+#define ROP_DPSDxax 0xCA
+#define ROP_SPDSaoxn 0xCB
+#define ROP_S 0xCC
+#define ROP_SDPono 0xCD
+#define ROP_SDPnao 0xCE
+#define ROP_SPno 0xCF
+#define ROP_PSDnoa 0xD0
+#define ROP_PSDPxoxn 0xD1
+#define ROP_PDSnax 0xD2
+#define ROP_SPDSoaxn 0xD3
+#define ROP_SSPxPDxax 0xD4
+#define ROP_DPSanan 0xD5
+#define ROP_PSDPSaoxx 0xD6
+#define ROP_DPSxan 0xD7
+#define ROP_PDSPxax 0xD8
+#define ROP_SDPSaoxn 0xD9
+#define ROP_DPSDanax 0xDA
+#define ROP_SPxDSxan 0xDB
+#define ROP_SPDnao 0xDC
+#define ROP_SDno 0xDD
+#define ROP_SDPxo 0xDE
+#define ROP_SDPano 0xDF
+#define ROP_PDSoa 0xE0
+#define ROP_PDSoxn 0xE1
+#define ROP_DSPDxax 0xE2
+#define ROP_PSDPaoxn 0xE3
+#define ROP_SDPSxax 0xE4
+#define ROP_PDSPaoxn 0xE5
+#define ROP_SDPSanax 0xE6
+#define ROP_SPxPDxan 0xE7
+#define ROP_SSPxDSxax 0xE8
+#define ROP_DSPDSanaxxn 0xE9
+#define ROP_DPSao 0xEA
+#define ROP_DPSxno 0xEB
+#define ROP_SDPao 0xEC
+#define ROP_SDPxno 0xED
+#define ROP_DSo 0xEE
+#define ROP_SDPnoo 0xEF
+#define ROP_P 0xF0
+#define ROP_PDSono 0xF1
+#define ROP_PDSnao 0xF2
+#define ROP_PSno 0xF3
+#define ROP_PSDnao 0xF4
+#define ROP_PDno 0xF5
+#define ROP_PDSxo 0xF6
+#define ROP_PDSano 0xF7
+#define ROP_PDSao 0xF8
+#define ROP_PDSxno 0xF9
+#define ROP_DPo 0xFA
+#define ROP_DPSnoo 0xFB
+#define ROP_PSo 0xFC
+#define ROP_PSDnoo 0xFD
+#define ROP_DPSoo 0xFE
+#define ROP_1 0xFF
+
+#define NO_SRC_ROP(rop) \
+ ((rop == GXnoop) || (rop == GXset) || (rop == GXclear) || (rop == GXinvert))
+
+int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop);
+int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop);
+
+extern int XAACopyROP[16];
+extern int XAACopyROP_PM[16];
+extern int XAAPatternROP[16];
+extern int XAAPatternROP_PM[16];
+
+#endif /* _XAAROP_H */
diff --git a/hw/xfree86/xaa/xaawrap.h b/hw/xfree86/xaa/xaawrap.h
new file mode 100644
index 000000000..e6963c325
--- /dev/null
+++ b/hw/xfree86/xaa/xaawrap.h
@@ -0,0 +1,78 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaawrap.h,v 1.5 2000/09/20 02:05:42 keithp Exp $ */
+
+#define XAA_SCREEN_PROLOGUE(pScreen, field)\
+ ((pScreen)->field = \
+ ((XAAScreenPtr) (pScreen)->devPrivates[XAAScreenIndex].ptr)->field)
+
+#define XAA_SCREEN_EPILOGUE(pScreen, field, wrapper)\
+ ((pScreen)->field = wrapper)
+
+
+#define XAA_GC_FUNC_PROLOGUE(pGC)\
+ XAAGCPtr pGCPriv = (XAAGCPtr) (pGC)->devPrivates[XAAGCIndex].ptr;\
+ (pGC)->funcs = pGCPriv->wrapFuncs;\
+ if(pGCPriv->flags)\
+ (pGC)->ops = pGCPriv->wrapOps
+
+#define XAA_GC_FUNC_EPILOGUE(pGC)\
+ pGCPriv->wrapFuncs = (pGC)->funcs;\
+ (pGC)->funcs = &XAAGCFuncs;\
+ if(pGCPriv->flags) {\
+ pGCPriv->wrapOps = (pGC)->ops;\
+ (pGC)->ops = (pGCPriv->flags & OPS_ARE_ACCEL) ? pGCPriv->XAAOps :\
+ &XAAPixmapOps;\
+ }
+
+
+#define XAA_GC_OP_PROLOGUE(pGC)\
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
+ GCFuncs *oldFuncs = pGC->funcs;\
+ pGC->funcs = pGCPriv->wrapFuncs;\
+ pGC->ops = pGCPriv->wrapOps
+
+#define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
+ GCFuncs *oldFuncs = pGC->funcs;\
+ if(!REGION_NUM_RECTS(pGC->pCompositeClip)) return; \
+ pGC->funcs = pGCPriv->wrapFuncs;\
+ pGC->ops = pGCPriv->wrapOps
+
+
+#define XAA_GC_OP_EPILOGUE(pGC)\
+ pGCPriv->wrapOps = pGC->ops;\
+ pGC->funcs = oldFuncs;\
+ pGC->ops = pGCPriv->XAAOps
+
+
+#define XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw)\
+ XAAGCPtr pGCPriv = (XAAGCPtr)(pGC->devPrivates[XAAGCIndex].ptr);\
+ XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDraw));\
+ GCFuncs *oldFuncs = pGC->funcs;\
+ pGC->funcs = pGCPriv->wrapFuncs;\
+ pGC->ops = pGCPriv->wrapOps
+
+
+#define XAA_PIXMAP_OP_EPILOGUE(pGC)\
+ pGCPriv->wrapOps = pGC->ops;\
+ pGC->funcs = oldFuncs;\
+ pGC->ops = &XAAPixmapOps;\
+ pixPriv->flags |= DIRTY
+
+#ifdef RENDER
+#define XAA_RENDER_PROLOGUE(pScreen,field)\
+ (GetPictureScreen(pScreen)->field = \
+ ((XAAScreenPtr) (pScreen)->devPrivates[XAAScreenIndex].ptr)->field)
+
+#define XAA_RENDER_EPILOGUE(pScreen, field, wrapper)\
+ (GetPictureScreen(pScreen)->field = wrapper)
+#endif
+
+/* This also works fine for drawables */
+
+#define SYNC_CHECK(pGC) {\
+ XAAInfoRecPtr infoRec =\
+((XAAScreenPtr)((pGC)->pScreen->devPrivates[XAAScreenIndex].ptr))->AccelInfoRec;\
+ if(infoRec->NeedToSync) {\
+ (*infoRec->Sync)(infoRec->pScrn);\
+ infoRec->NeedToSync = FALSE;\
+ }}
diff --git a/hw/xfree86/xf1bpp/mfbmap.h b/hw/xfree86/xf1bpp/mfbmap.h
new file mode 100644
index 000000000..e72fa4316
--- /dev/null
+++ b/hw/xfree86/xf1bpp/mfbmap.h
@@ -0,0 +1,109 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbmap.h,v 1.2 1998/07/25 16:59:24 dawes Exp $ */
+
+#ifndef _MFBMAP_H
+#define _MFBMAP_H
+
+#define InverseAlu xf1bppInverseAlu
+#define endtab xf1bppendtab
+#define mask xf1bppmask
+#define mergeRopBits xf1bppmergeRopBits
+#define mfbAllocatePrivates xf1bppAllocatePrivates
+#define mfbBSFuncRec xf1bppBSFuncRec
+#define mfbBlackSolidFS xf1bppBlackSolidFS
+#define mfbBlackStippleFS xf1bppBlackStippleFS
+#define mfbBresD xf1bppBresD
+#define mfbBresS xf1bppBresS
+#define mfbChangeWindowAttributes xf1bppChangeWindowAttributes
+#define mfbCloseScreen xf1bppCloseScreen
+#define mfbCopyArea xf1bppCopyArea
+#define mfbCopyPixmap xf1bppCopyPixmap
+#define mfbCopyPlane xf1bppCopyPlane
+#define mfbCopyRotatePixmap xf1bppCopyRotatePixmap
+#define mfbCopyWindow xf1bppCopyWindow
+#define mfbCreateColormap xf1bppCreateColormap
+#define mfbCreateDefColormap xf1bppCreateDefColormap
+#define mfbCreateGC xf1bppCreateGC
+#define mfbCreatePixmap xf1bppCreatePixmap
+#define mfbCreateWindow xf1bppCreateWindow
+#define mfbDestroyColormap xf1bppDestroyColormap
+#define mfbDestroyPixmap xf1bppDestroyPixmap
+#define mfbDestroyWindow xf1bppDestroyWindow
+#define mfbDoBitblt xf1bppDoBitblt
+#define mfbDoBitbltCopy xf1bppDoBitbltCopy
+#define mfbDoBitbltCopyInverted xf1bppDoBitbltCopyInverted
+#define mfbDoBitbltGeneral xf1bppDoBitbltGeneral
+#define mfbDoBitbltOr xf1bppDoBitbltOr
+#define mfbDoBitbltXor xf1bppDoBitbltXor
+#define mfbFillPolyBlack xf1bppFillPolyBlack
+#define mfbFillPolyInvert xf1bppFillPolyInvert
+#define mfbFillPolyWhite xf1bppFillPolyWhite
+#define mfbGCPrivateIndex xf1bppGCPrivateIndex
+#define mfbGetImage xf1bppGetImage
+#define mfbGetSpans xf1bppGetSpans
+#define mfbGetWindowPixmap xf1bppGetWindowPixmap
+#define mfbHorzS xf1bppHorzS
+#define mfbImageGlyphBltBlack xf1bppImageGlyphBltBlack
+#define mfbImageGlyphBltWhite xf1bppImageGlyphBltWhite
+#define mfbInstallColormap xf1bppInstallColormap
+#define mfbInvertSolidFS xf1bppInvertSolidFS
+#define mfbInvertStippleFS xf1bppInvertStippleFS
+#define mfbLineSD xf1bppLineSD
+#define mfbLineSS xf1bppLineSS
+#define mfbListInstalledColormaps xf1bppListInstalledColormaps
+#define mfbMapWindow xf1bppMapWindow
+#define mfbPadPixmap xf1bppPadPixmap
+#define mfbPaintWindow xf1bppPaintWindow
+#define mfbPixmapToRegion xf1bppPixmapToRegion
+#define mfbPolyFillArcSolid xf1bppPolyFillArcSolid
+#define mfbPolyFillRect xf1bppPolyFillRect
+#define mfbPolyGlyphBltBlack xf1bppPolyGlyphBltBlack
+#define mfbPolyGlyphBltInvert xf1bppPolyGlyphBltInvert
+#define mfbPolyGlyphBltWhite xf1bppPolyGlyphBltWhite
+#define mfbPolyPoint xf1bppPolyPoint
+#define mfbPositionWindow xf1bppPositionWindow
+#define mfbPushPixels xf1bppPushPixels
+#define mfbPutImage xf1bppPutImage
+#define mfbQueryBestSize xf1bppQueryBestSize
+#define mfbRealizeFont xf1bppRealizeFont
+#define mfbReduceRop xf1bppReduceRop
+#define mfbRegisterCopyPlaneProc xf1bppRegisterCopyPlaneProc
+#define mfbResolveColor xf1bppResolveColor
+#define mfbRestoreAreas xf1bppRestoreAreas
+#define mfbSaveAreas xf1bppSaveAreas
+#define mfbScreenInit xf1bppScreenInit
+#define mfbSegmentSD xf1bppSegmentSD
+#define mfbSegmentSS xf1bppSegmentSS
+#define mfbSetScanline xf1bppSetScanline
+#define mfbSetSpans xf1bppSetSpans
+#define mfbSetWindowPixmap xf1bppSetWindowPixmap
+#define mfbSolidBlackArea xf1bppSolidBlackArea
+#define mfbSolidInvertArea xf1bppSolidInvertArea
+#define mfbSolidPP xf1bppSolidPP
+#define mfbSolidWhiteArea xf1bppSolidWhiteArea
+#define mfbStippleBlackArea xf1bppStippleBlackArea
+#define mfbStippleInvertArea xf1bppStippleInvertArea
+#define mfbStippleWhiteArea xf1bppStippleWhiteArea
+#define mfbTEGlyphBltBlack xf1bppTEGlyphBltBlack
+#define mfbTEGlyphBltWhite xf1bppTEGlyphBltWhite
+#define mfbTileAreaPPW xf1bppTileAreaPPW
+#define mfbTileAreaPPWCopy xf1bppTileAreaPPWCopy
+#define mfbTileAreaPPWGeneral xf1bppTileAreaPPWGeneral
+#define mfbTileFS xf1bppTileFS
+#define mfbUninstallColormap xf1bppUninstallColormap
+#define mfbUnmapWindow xf1bppUnmapWindow
+#define mfbUnnaturalStippleFS xf1bppUnnaturalStippleFS
+#define mfbUnnaturalTileFS xf1bppUnnaturalTileFS
+#define mfbUnrealizeFont xf1bppUnrealizeFont
+#define mfbValidateGC xf1bppValidateGC
+#define mfbVertS xf1bppVertS
+#define mfbWhiteSolidFS xf1bppWhiteSolidFS
+#define mfbWhiteStippleFS xf1bppWhiteStippleFS
+#define mfbWindowPrivateIndex xf1bppWindowPrivateIndex
+#define mfbXRotatePixmap xf1bppXRotatePixmap
+#define mfbYRotatePixmap xf1bppYRotatePixmap
+#define mfbZeroPolyArcSS xf1bppZeroPolyArcSS
+#define partmasks xf1bpppartmasks
+#define rmask xf1bpprmask
+#define starttab xf1bppstarttab
+
+#endif
diff --git a/hw/xfree86/xf1bpp/mfbmap.sh b/hw/xfree86/xf1bpp/mfbmap.sh
new file mode 100644
index 000000000..a8f43eceb
--- /dev/null
+++ b/hw/xfree86/xf1bpp/mfbmap.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbmap.sh,v 1.2 1998/07/25 16:59:24 dawes Exp $
+#
+# This script recreates the mapping list that maps the mfb external
+# symbols * to xf1bpp* (without "mfb")
+# This should only be rerun if there have been changes in the mfb code
+# that affect the external symbols.
+# It assumes that Xserver/mfb has been compiled.
+# The output goes to stdout.
+echo ""
+echo "#ifndef _MFBMAP_H"
+echo "#define _MFBMAP_H"
+echo ""
+
+nm ../../../mfb/*.o | \
+awk "{ if ((\$2 == \"D\") || (\$2 == \"T\") || (\$2 == \"C\")) print \$3 }" | \
+sed s/^_// | \
+grep -v "ModuleInit$" | \
+sort | \
+awk "{ print \"#define \" \$1 \" xf1bpp\"\$1 }" | \
+sed s/xf1bppmfb/xf1bpp/
+
+echo ""
+echo "#endif"
diff --git a/hw/xfree86/xf1bpp/mfbmodule.c b/hw/xfree86/xf1bpp/mfbmodule.c
new file mode 100644
index 000000000..4fb795152
--- /dev/null
+++ b/hw/xfree86/xf1bpp/mfbmodule.c
@@ -0,0 +1,48 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbmodule.c,v 1.6 1999/01/26 05:54:19 dawes Exp $ */
+/*
+ * Copyright (C) 1997 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifdef XFree86LOADER
+#include "xf86Module.h"
+
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "xf1bpp",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData xf1bppModuleData = { &VersRec, NULL, NULL };
+
+#endif
diff --git a/hw/xfree86/xf1bpp/mfbunmap.h b/hw/xfree86/xf1bpp/mfbunmap.h
new file mode 100644
index 000000000..94c029856
--- /dev/null
+++ b/hw/xfree86/xf1bpp/mfbunmap.h
@@ -0,0 +1,109 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbunmap.h,v 1.2 1998/07/25 16:59:25 dawes Exp $ */
+
+#ifdef _MFBMAP_H
+#undef _MFBMAP_H
+
+#undef InverseAlu
+#undef endtab
+#undef mask
+#undef mergeRopBits
+#undef mfbAllocatePrivates
+#undef mfbBSFuncRec
+#undef mfbBlackSolidFS
+#undef mfbBlackStippleFS
+#undef mfbBresD
+#undef mfbBresS
+#undef mfbChangeWindowAttributes
+#undef mfbCloseScreen
+#undef mfbCopyArea
+#undef mfbCopyPixmap
+#undef mfbCopyPlane
+#undef mfbCopyRotatePixmap
+#undef mfbCopyWindow
+#undef mfbCreateColormap
+#undef mfbCreateDefColormap
+#undef mfbCreateGC
+#undef mfbCreatePixmap
+#undef mfbCreateWindow
+#undef mfbDestroyColormap
+#undef mfbDestroyPixmap
+#undef mfbDestroyWindow
+#undef mfbDoBitblt
+#undef mfbDoBitbltCopy
+#undef mfbDoBitbltCopyInverted
+#undef mfbDoBitbltGeneral
+#undef mfbDoBitbltOr
+#undef mfbDoBitbltXor
+#undef mfbFillPolyBlack
+#undef mfbFillPolyInvert
+#undef mfbFillPolyWhite
+#undef mfbGCPrivateIndex
+#undef mfbGetImage
+#undef mfbGetSpans
+#undef mfbGetWindowPixmap
+#undef mfbHorzS
+#undef mfbImageGlyphBltBlack
+#undef mfbImageGlyphBltWhite
+#undef mfbInstallColormap
+#undef mfbInvertSolidFS
+#undef mfbInvertStippleFS
+#undef mfbLineSD
+#undef mfbLineSS
+#undef mfbListInstalledColormaps
+#undef mfbMapWindow
+#undef mfbPadPixmap
+#undef mfbPaintWindow
+#undef mfbPixmapToRegion
+#undef mfbPolyFillArcSolid
+#undef mfbPolyFillRect
+#undef mfbPolyGlyphBltBlack
+#undef mfbPolyGlyphBltInvert
+#undef mfbPolyGlyphBltWhite
+#undef mfbPolyPoint
+#undef mfbPositionWindow
+#undef mfbPushPixels
+#undef mfbPutImage
+#undef mfbQueryBestSize
+#undef mfbRealizeFont
+#undef mfbReduceRop
+#undef mfbRegisterCopyPlaneProc
+#undef mfbResolveColor
+#undef mfbRestoreAreas
+#undef mfbSaveAreas
+#undef mfbScreenInit
+#undef mfbSegmentSD
+#undef mfbSegmentSS
+#undef mfbSetScanline
+#undef mfbSetSpans
+#undef mfbSetWindowPixmap
+#undef mfbSolidBlackArea
+#undef mfbSolidInvertArea
+#undef mfbSolidPP
+#undef mfbSolidWhiteArea
+#undef mfbStippleBlackArea
+#undef mfbStippleInvertArea
+#undef mfbStippleWhiteArea
+#undef mfbTEGlyphBltBlack
+#undef mfbTEGlyphBltWhite
+#undef mfbTileAreaPPW
+#undef mfbTileAreaPPWCopy
+#undef mfbTileAreaPPWGeneral
+#undef mfbTileFS
+#undef mfbUninstallColormap
+#undef mfbUnmapWindow
+#undef mfbUnnaturalStippleFS
+#undef mfbUnnaturalTileFS
+#undef mfbUnrealizeFont
+#undef mfbValidateGC
+#undef mfbVertS
+#undef mfbWhiteSolidFS
+#undef mfbWhiteStippleFS
+#undef mfbWindowPrivateIndex
+#undef mfbXRotatePixmap
+#undef mfbYRotatePixmap
+#undef mfbZeroPolyArcSS
+#undef partmasks
+#undef rmask
+#undef starttab
+
+#endif
diff --git a/hw/xfree86/xf1bpp/mfbunmap.sh b/hw/xfree86/xf1bpp/mfbunmap.sh
new file mode 100644
index 000000000..6b244e68e
--- /dev/null
+++ b/hw/xfree86/xf1bpp/mfbunmap.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/mfbunmap.sh,v 1.2 1998/07/25 16:59:25 dawes Exp $
+#
+# This script recreates a header that undoes the effect of mfbmap.h
+# This should only be rerun if there have been changes in the mfb code
+# that affect the external symbols.
+# It assumes that Xserver/mfb has been compiled.
+# The output goes to stdout.
+echo ""
+echo "#ifdef _MFBMAP_H"
+echo "#undef _MFBMAP_H"
+echo ""
+
+nm ../../../mfb/*.o | \
+awk "{ if ((\$2 == \"D\") || (\$2 == \"T\") || (\$2 == \"C\")) print \$3 }" | \
+sed s/^_// | \
+grep -v "ModuleInit$" | \
+sort | \
+awk "{ print \"#undef \" \$1 }"
+
+echo ""
+echo "#endif"
diff --git a/hw/xfree86/xf1bpp/xf1bpp.h b/hw/xfree86/xf1bpp/xf1bpp.h
new file mode 100644
index 000000000..18104a77e
--- /dev/null
+++ b/hw/xfree86/xf1bpp/xf1bpp.h
@@ -0,0 +1,37 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf1bpp/xf1bpp.h,v 1.2 1998/07/25 16:59:25 dawes Exp $ */
+/*
+ * Copyright (C) 1994-1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifndef __XF1BPP_H__
+#define __XF1BPP_H__
+
+#define MFB_PROTOTYPES_ONLY
+#include "mfbmap.h"
+#include "mfb.h"
+#include "mfbunmap.h"
+#undef MFB_PROTOTYPES_ONLY
+
+#endif
diff --git a/hw/xfree86/xf4bpp/NOTES b/hw/xfree86/xf4bpp/NOTES
new file mode 100644
index 000000000..f9ccc95c1
--- /dev/null
+++ b/hw/xfree86/xf4bpp/NOTES
@@ -0,0 +1,194 @@
+This code originally hails from IBM. It was ported to an early XFree86 by
+Gertjan Akkerman, whose BUGS file I append here.
+
+In turn, this is a port of Gertjan's work to the new server design. Among the
+changes are:
+
+- The removal of almost all unreferenced code.
+- The removal of this code's own copy of mfb (xf1bpp is used instead).
+- The removal of banking support (mibank is used instead).
+- External symbols were made static where this was sufficient.
+- The remaining external names were renamed to xf4bpp*.
+- Several minor cleanups too many to mention here.
+
+To understate the matter, this code is >UGLY<. This seems inherent in IBM's
+corporate culture. Be that as it may, it *does* survive X11R4's xtest
+(whatever that means these days...). For now, this is sufficient for 4bpp
+support in the new design, but at some point, I'll have to sit down and
+rewrite this from scratch. A more technical justification for a rewrite is
+that the pixmap format is 8bpp, instead of 4bpp, which is causing me to
+pepper the rest of the server with unclean accomodations.
+
+Marc.
+
+===============================================================================
+Section 1: From IBM's X11R4 contribution towards XFree86.
+
+This section describes what I did to obtain a 16 colour vga server.
+
+I started with the SYSV, ppc, vga and common directories from IBM's X11R4
+contribution. Those directories have the following function:
+1. SYSV implements the mouse and keyboard.
+2. ppc is a generic layer implementing ddx in terms of drawing operations
+ through rectangles. (With spans as a boundary case: height = 1.)
+3. vga implements a layer of operations drawing through rectangles.
+4. common implements ddx initialization and quitting, and screen saving.
+
+I eliminated SYSV and common since the functionality provided therein is
+already provided in XFree86. Since XFree86 is actively being ported to
+new operating systems, while X11R4 is out of date, I preferred the XFree86
+code here above the SYSV and common code.
+Whatever functionality was still needed from common (default colormap
+initialization -- not much code) was moved into ppc.
+
+Since XFree86 uses the mi-provided software cursor code, IBM's software
+cursor code was deleted from ppc and vga. This is a pity, since it is
+expected that it is more efficient than mi's code, but the XFree86 mouse and
+keyboard code directly call mi, and I do not want to maintain the XFree86
+mouse and keyboard code.
+
+Since we cannot support a monolithic multi-screen server using all of the
+x11r4 contributed code yet, all multi screen code was deleted. This includes
+one header file containing a nasty copyright statement.
+
+Since glyph handling has changed between X11R4 and X11R5, the code handling
+glyphs was replaced by appropriate calls to mi.
+I hope it can be modified and put back one day.
+
+Provisionally, some code was added (viz. file vga/offscreen.c) to intercept
+calls to the rectangle drawing code when we are switched out of the VT.
+I hope this can be replaced by some window tree invalidation and GC validation
+scheme.
+
+
+Section 2: BUGS
+
+This section describes fixed and still unfixed bugs in this code.
+All bugs not labeled otherwise also occur in IBM's X11R4 code, and may be of
+interest to anybody using that code.
+
+1. (Fixed.)
+I found (and provisionally fixed) a bug in the IBM bitblit code:
+In file ddx/ibm/vga/vgaImages.c a function vgaReadColorImage is defined.
+When this function is used to read less than 8 pixels starting on a byte
+boundary it will always read precisely 8 pixels.
+Thus, when space is allocated for 4 or less pixels, it will write beyond
+the allocated space.
+Since the code is rather convoluted, this may not be apparent at first sight,
+but going through the code with an example shows the error.
+
+2. (Fixed.)
+In ppcPixmapFS.c, function ppcStipplePixmapFS there was a bug
+regarding the stipple origin: The horizontal origin is added while
+the vertical one is subtracted. The horizontal origin should be subtracted
+instead of added here.
+This bug gets visible when backing-store is enabled and one uses twm:
+the submenu icons get truncated on their left hand side.
+(In case you wonder why this bug appears: under those circumstances
+twm prepares its menus by drawing into an unmapped window.
+The miCopyPlane function uses the ppcStipplePixmap (and many others)
+to get the plane copied.)
+I also fixed this bug in the other routines (ppcOpStipplePixmapFS,
+ppcTilePixmapFS) in this file, although I had no visible clues for this.
+I hope this is appropriate.
+
+3. (Fixed.)
+I find it suspect that ppcSetSpans gives different output when one
+claims that an actually sorted list of spans is unsorted.
+The unsorted code is wrong, and should be made to look more like the sorted
+code. I.e., use ( xStart - ppt->x ) instead of ( xStart - pbox->x1 )
+
+4. (Fixed.)
+There used to be another bug that became visible when using twm and backing
+store: popping up a submenu, and moving the cursor upwards til it leaves the
+submenu, the submenu would disappears, as it should.
+But the submenu icon would not get restored, while it should be.
+10b. By replacing the clip-computing code in ppcValidateGC by that in
+cfbValidateGC, I *finally* fixed the disappearing twm menu icon problem.
+
+5. Added mfbRegisterCopyplaneProc call. [Its omission was an error on my
+ part.]
+ Fixing a server core dump in XTest.
+
+6. Fixed not-very-high tile bug in function ppcTileRect, file emulTile.c
+ (I.e., if the tile was higher than the area to be tiled, far too much
+ was drawn, causing server core dumps in XTest.)
+ Actually, "savey" ought to be used to determine the height of the tiles in
+ the top line to be tiled, instead of "pTile->drawable.height".
+7. A use of height where width was intended was fixed in ppcTileRect:
+ "savehcount = w / pTile->drawable.height;" should use "... .width" and
+ "savehcount = ( x + w - htarget ) / pTile->drawable.height;" too.
+
+8. Deleted overly clever code in ppcCReduce.c
+ (All code that tried to pre-compute how alu's could be replaced by
+ other alu's with inverted colors, etc. was deleted. I think it is
+ at least wrong for FillSolid.)
+
+9. Looked at suspicious code in ppcSetSp.c
+ "tmpx = *pdst;" was never updated during the loop. We took it out of the
+ initialization position of the for and moved it into the loop.
+
+10. Add xSrc := GC->patOrg.x + pDrawable.x and ySrc := ... in ppcPixmapFS.c,
+ functions ppcStipplePixmapFS, ppcOpStipplePixmapFS, and ppcTilePixmapFS.
+ This because stipple and tile origins are taken relative to the drawable.
+ Also use a "modulo" function that gets the cases of a negative stipple
+ or tile offset right. (When the stipple origin is to the right of or
+ below the origin of the drawable.)
+
+11. File vgaSolid.c, function vgaFillSolid:
+ Inverting is XORing with all ones. Not with the color we want to AND/OR
+ later. So we'll have to set the color to VGA_ALLPLANES
+ whenever we want to invert existing data, and reset it before the
+ AND/OR is done.
+ Also we replaced an outb( 0x3CF, tmp2 ) by the SetVideoGraphicsData( tmp2 )
+ it is representing. (Just a cosmetic replacement.)
+
+12. File vgaImages, function vgaDrawColorImage.
+ Moved a line "invert_existing_data = TRUE;" two lines down, past a case
+ label. Now it is also part of the code executed for GXorReverse, as it
+ should be.
+
+13. The pixmap FillSpans routines (file ppcPixmapFS.c) got somewhat better
+ after importing some code from ddx/ibm/vga. (A getbits function that does
+ wrapping.)
+ They were wrong for the FillStippled and FillOpaqueStippled modes.
+ I don't understand the old code. How could it handle stipples of a size not
+ an exact multiple of 32? (or 8, for that matter.)
+
+14. In function vgaBitBlt file vgaBitBlt.c, in the shortcuts for
+ GXSet, GXClear and GXInvert, the source (x0,y0) is accidentally operated
+ upon by vgaFillSolid, instead of the destination (x1,y1).
+
+15. Notice that in DoMonoSingle and DoMonoMany in file vgaStipple.c, the left
+ edge of the square to be stippled is treated wrong.
+ Correct would be to get the bits with getbits using offset xshift, and
+ to shift them right (x & 07) places.
+ [One might wish to use the variable tmp1 at this place, since it had been
+ set to (x & 07) at this place; but that is already re-used at this point.]
+ Also note that NeedValX is set wrong: The implicit assumption was that
+ stipples are more than 8 wide.
+ This only fixes the problem when miPushPixel is used instead of ppcPushPixel.
+ I think I should look some more into this.
+
+16. I took out some code of the CopyArea function, in which a no-op function
+ was called while a real one was needed. My fix does not completely work,
+ although it improved the behaviour of GetImage somewhat.
+
+17. After finding three kinds of errors in this single function,
+ -- the new kinds being the right side not being always written due to
+ an incorrect if scope, and the lower end not always being written due
+ to variables being updated at the wrong place --
+ (requiring modifications to be made at at least 10 places,
+ I decided to REWRITE the body of the ppcTileRect function from scratch.
+ This version simply computes all relevant margins in advance, and does
+ not try to reuse temporary variables. I leave that to the compiler.
+ (This was a maintenance and robustness nightmare anyway.)
+
+MORE NOTES:
+ It is funny that there are two files in mi that require compilation
+ with the proper #defines ( -DXF86VGA16 in my case ):
+ Besides the obvious mibitblt.c, there is also mipushpxl.c.
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/NOTES,v 1.2 1998/07/25 16:59:26 dawes Exp $
diff --git a/hw/xfree86/xf4bpp/OScompiler.h b/hw/xfree86/xf4bpp/OScompiler.h
new file mode 100644
index 000000000..3891f1e21
--- /dev/null
+++ b/hw/xfree86/xf4bpp/OScompiler.h
@@ -0,0 +1,57 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/OScompiler.h,v 1.4 2000/07/26 01:52:26 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: OScompiler.h /main/4 1996/02/21 17:56:09 kaleb $ */
+
+#ifndef __COMPILER_DEPENDANCIES__
+#define __COMPILER_DEPENDANCIES__
+
+#define MOVE( src, dst, length ) memcpy( dst, src, length)
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define ABS(x) (((x)>0)?(x):-(x))
+
+#include "misc.h"
+#include "xf86_ansic.h"
+#include "compiler.h"
+
+#ifdef lint
+/* So that lint doesn't complain about constructs it doesn't understand */
+#ifdef volatile
+#undef volatile
+#endif
+#define volatile
+#ifdef const
+#undef const
+#endif
+#define const
+#ifdef signed
+#undef signed
+#endif
+#define signed
+#ifdef _ANSI_DECLS_
+#undef _ANSI_DECLS_
+#endif
+#endif
+
+#endif /* !__COMPILER_DEPENDANCIES__ */
diff --git a/hw/xfree86/xf4bpp/emulOpStip.c b/hw/xfree86/xf4bpp/emulOpStip.c
new file mode 100644
index 000000000..e9ac98dc9
--- /dev/null
+++ b/hw/xfree86/xf4bpp/emulOpStip.c
@@ -0,0 +1,100 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulOpStip.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: emulOpStip.c /main/4 1996/02/21 17:56:12 kaleb $ */
+
+/* ppc OpaqueStipple
+ *
+ * Based on the private stipple; does a foreground, and then an inverted
+ * on the background
+ *
+ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+
+void
+xf4bppOpaqueStipple( pWin, pStipple, fg, bg, alu, planes, x, y, w, h, xSrc, ySrc )
+WindowPtr pWin; /* GJA */
+register PixmapPtr pStipple ;
+unsigned long int fg ;
+unsigned long int bg ;
+int alu ;
+unsigned long int planes ;
+register int x, y, w, h ;
+int xSrc, ySrc ;
+{
+ /* DO BACKGROUND */
+ switch ( alu ) {
+ /* Easy Cases -- i.e. Final Result Doesn't Depend On Initial Dest. */
+ case GXclear: /* 0x0 Zero 0 */
+ case GXset: /* 0xf 1 */
+ /* Foreground And Background Are Both The Same !! */
+ xf4bppFillSolid( pWin, bg, alu, planes, x, y, w, h ) ;
+ case GXnoop: /* 0x5 dst */
+ break ;
+ case GXcopy: /* 0x3 src */
+ case GXcopyInverted: /* 0xc NOT src */
+ { /* Special Case Code */
+ register int vtarget, htarget ;
+
+ /* We Can Draw Just One Copy Then Blit The Rest !! */
+ /* Draw The One Copy */
+ htarget = MIN( w, pStipple->drawable.width ) ;
+ vtarget = MIN( h, pStipple->drawable.height ) ;
+
+ /* First The Background */
+ xf4bppFillSolid( pWin, bg, alu, planes, x, y,
+ htarget, vtarget ) ;
+ /* Then The Foreground */
+ xf4bppFillStipple( pWin, pStipple, fg, alu, planes,
+ x, y, htarget, vtarget,
+ xSrc, ySrc ) ;
+
+ /* Here We Double The Size Of The BLIT Each Iteration */
+ xf4bppReplicateArea(pWin, x, y, planes, w, h, htarget, vtarget);
+ }
+ break ;
+ default:
+ /* Hard Cases -- i.e. Final Result DOES Depend On Initial Dest. */
+ { /* Do The Background */
+ register int i, j;
+ register PixmapPtr pInvPixmap = xf4bppCopyPixmap( pStipple ) ;
+ register unsigned char *data = pInvPixmap->devPrivate.ptr ;
+
+ /* INVERT PIXMAP OK, jeff, this is for you */
+ for ( i = pInvPixmap->drawable.height ; i-- ; )
+ for ( j = pInvPixmap->devKind ; j-- ; data++ )
+ *data = ~ ( *data ) ;
+
+ xf4bppFillStipple( pWin, pInvPixmap, bg, alu, planes, x, y, w, h, xSrc, ySrc );
+ mfbDestroyPixmap( pInvPixmap ) ;
+ /* DO FOREGROUND */
+ xf4bppFillStipple( pWin, pStipple, fg, alu, planes, x, y, w, h, xSrc, ySrc );
+ }
+ break ;
+ }
+ return;
+}
diff --git a/hw/xfree86/xf4bpp/emulRepAre.c b/hw/xfree86/xf4bpp/emulRepAre.c
new file mode 100644
index 000000000..42f118aac
--- /dev/null
+++ b/hw/xfree86/xf4bpp/emulRepAre.c
@@ -0,0 +1,67 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulRepAre.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: emulRepAre.c /main/5 1996/02/21 17:56:16 kaleb $ */
+
+/* ppc Replicate Area -- A Divide & Conquer Algorithm
+ * a "ppc" Helper Function For Stipples And Tiling
+ * P. Shupak 1/88
+ */
+
+#include "xf4bpp.h"
+
+void xf4bppReplicateArea( pWin, x, y, planeMask, goalWidth, goalHeight,
+ currentHoriz, currentVert)
+WindowPtr pWin; /* GJA */
+register int x, y, planeMask ;
+int goalWidth, goalHeight ;
+int currentHoriz, currentVert ;
+{
+ for ( ;
+ currentHoriz <= ( goalWidth >> 1 ) ;
+ currentHoriz <<= 1 ) {
+ xf4bppBitBlt( pWin, GXcopy, planeMask,
+ x, y,
+ x + currentHoriz, y,
+ currentHoriz, currentVert ) ;
+ }
+ if ( goalWidth - currentHoriz )
+ xf4bppBitBlt( pWin, GXcopy, planeMask,
+ x, y,
+ x + currentHoriz, y,
+ goalWidth - currentHoriz, currentVert ) ;
+ for ( ;
+ currentVert <= ( goalHeight >> 1 ) ;
+ currentVert <<= 1 ) {
+ xf4bppBitBlt( pWin, GXcopy, planeMask,
+ x, y,
+ x, y + currentVert,
+ goalWidth, currentVert ) ;
+ }
+ if ( goalHeight - currentVert )
+ xf4bppBitBlt( pWin, GXcopy, planeMask,
+ x, y,
+ x, y + currentVert,
+ goalWidth, goalHeight - currentVert ) ;
+return ;
+}
diff --git a/hw/xfree86/xf4bpp/emulTile.c b/hw/xfree86/xf4bpp/emulTile.c
new file mode 100644
index 000000000..a2d24f4d9
--- /dev/null
+++ b/hw/xfree86/xf4bpp/emulTile.c
@@ -0,0 +1,352 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/emulTile.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: emulTile.c /main/4 1996/02/21 17:56:23 kaleb $ */
+
+/* ppc Tile
+ * P. Shupak 11/87
+ * Modified From original ppc Tile
+ * T. Paquin 9/87
+ * Uses private imageFill a bunch of times
+ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "ibmTrace.h"
+
+static void
+DrawFirstTile
+(
+ WindowPtr pWin, /* GJA */
+ register PixmapPtr pTile,
+ register int x,
+ register int y,
+ int w,
+ int h,
+ int alu,
+ unsigned long int planes,
+ int xOffset,
+ int yOffset
+)
+{
+register int htarget ;
+register int vtarget ;
+
+ if ( xOffset ) { /* Not X-Aligned */
+ if ( yOffset ) { /* Nor Y-Aligned */
+ htarget = MIN( pTile->drawable.width - xOffset, w ),
+ vtarget = MIN( pTile->drawable.height - yOffset, h ),
+ yOffset *= pTile->devKind ;
+ xf4bppDrawColorImage( pWin,x, y,
+ htarget,
+ vtarget,
+ (unsigned char *)pTile->devPrivate.ptr + yOffset + xOffset,
+ pTile->devKind,
+ alu, planes ) ;
+ if ( w > htarget ) {
+ w = MIN( w, pTile->drawable.width ) ;
+ if ( h > vtarget ) {
+ h = MIN( h, pTile->drawable.height ) ;
+ xf4bppDrawColorImage( pWin, x, y + vtarget,
+ htarget,
+ h - vtarget,
+ (unsigned char *)pTile->devPrivate.ptr + xOffset,
+ pTile->devKind,
+ alu, planes ) ;
+ xf4bppDrawColorImage( pWin, x + htarget, y,
+ w - htarget,
+ vtarget,
+ (unsigned char *)pTile->devPrivate.ptr + yOffset,
+ pTile->devKind,
+ alu, planes ) ;
+ xf4bppDrawColorImage( pWin, x + htarget,
+ y + vtarget,
+ w - htarget,
+ h - vtarget,
+ pTile->devPrivate.ptr,
+ pTile->devKind,
+ alu, planes ) ;
+ }
+ else { /* h <= vtarget */
+ xf4bppDrawColorImage( pWin, x + htarget, y,
+ w - htarget,
+ vtarget,
+ (unsigned char *)pTile->devPrivate.ptr + yOffset,
+ pTile->devKind,
+ alu, planes ) ;
+ }
+ }
+ else if ( h > vtarget ) {
+ xf4bppDrawColorImage( pWin, x, y + vtarget,
+ htarget,
+ MIN( h, pTile->drawable.height ) - vtarget,
+ (unsigned char *)pTile->devPrivate.ptr + xOffset,
+ pTile->devKind,
+ alu, planes ) ;
+ vtarget = pTile->drawable.height ;
+ }
+ }
+ else { /* No Y Offset */
+ xf4bppDrawColorImage( pWin, x, y,
+ htarget = MIN( pTile->drawable.width - xOffset, w ),
+ vtarget = MIN( pTile->drawable.height, h ),
+ (unsigned char *)pTile->devPrivate.ptr + xOffset,
+ pTile->devKind,
+ alu, planes ) ;
+ if ( w > htarget ) {
+ xf4bppDrawColorImage( pWin, x + htarget, y,
+ MIN( pTile->drawable.width, w ) - htarget,
+ vtarget,
+ pTile->devPrivate.ptr,
+ pTile->devKind,
+ alu, planes ) ;
+ }
+ }
+ }
+ else if ( yOffset ) {
+ xf4bppDrawColorImage( pWin, x, y,
+ htarget = MIN( pTile->drawable.width, w ),
+ vtarget = MIN( pTile->drawable.height - yOffset, h ),
+ (unsigned char *)pTile->devPrivate.ptr + ( yOffset * pTile->devKind ),
+ pTile->devKind,
+ alu, planes ) ;
+ if ( h > vtarget ) {
+ xf4bppDrawColorImage( pWin, x, y + vtarget,
+ htarget,
+ MIN( pTile->drawable.height, h ) - vtarget,
+ pTile->devPrivate.ptr,
+ pTile->devKind,
+ alu, planes ) ;
+ }
+ }
+ else { /* NO Offset */
+ xf4bppDrawColorImage( pWin, x, y,
+ htarget = MIN( pTile->drawable.width, w ),
+ vtarget = MIN( pTile->drawable.height, h ),
+ pTile->devPrivate.ptr,
+ pTile->devKind,
+ alu, planes ) ;
+ }
+
+ return ;
+}
+
+/* GJA --
+ * After finding three kinds of errors in this single function,
+ * (requiring modifications to be made at at least 10 places,
+ * I decided to REWRITE the body of the xf4bppTileRect function from scratch.
+ * This version simply computes all relevant margins in advance, and does
+ * not try to reuse temporary variables. I leave that to the compiler.
+ * (This was a maintenance and robustness nightmare anyway.)
+ * The code is pretty obvious: all margins, coordinates, and numbers of tiles
+ * are computed before drawing starts.
+ * Notice that the margins consist of incompletely drawn tiles. Therefore
+ * we need offsets in the data for the left and upper margins.
+ * The right and lower margins are also incomplete, but start at offset 0
+ * in the data. They just end at awkward offsets.
+ * The center block, by definition, consists of fully drawn tiles.
+ * Perhaps we could leave out some if's. But why bother? It would decrease
+ * robustness.
+ */
+void
+xf4bppTileRect( pWin, pTile, alu, planes, x0, y0, w, h, xSrc, ySrc )
+WindowPtr pWin; /* GJA */
+register PixmapPtr pTile ;
+const int alu ;
+const unsigned long int planes ;
+register int x0, y0, w, h ;
+int xSrc ;
+int ySrc ;
+{
+ScreenPtr pScreen ;
+int xOffset ;
+int yOffset ;
+int width, height;
+
+TRACE( ( "xf4bppTileRect(pTile=x%x,alu=x%x,planes=x%02x,x0=%d,y0=%d,w=%d,h=%d,xSrc=%d,ySrc=%d\n",
+ pTile, alu, planes, x0, y0, w, h, xSrc, ySrc ) ) ;
+
+ pScreen = pTile->drawable.pScreen ;
+ switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ case GXinvert: /* 0xa NOT dst */
+ case GXset: /* 0xf 1 */
+ xf4bppFillSolid
+ ( pWin, 0xFF, alu, planes, x0, y0, w, h ) ;
+ case GXnoop: /* 0x5 dst */
+ return ;
+ default:
+ break ;
+}
+
+ width = pTile->drawable.width;
+ if ( ( xOffset = ( x0 - xSrc ) ) > 0 )
+ xOffset %= width ;
+ else
+ xOffset = width - (( - xOffset ) % width ) ;
+ if ( xOffset == width ) xOffset = 0; /* For else case */
+
+ height = pTile->drawable.height;
+ if ( ( yOffset = ( y0 - ySrc ) ) > 0 )
+ yOffset %= height ;
+ else
+ yOffset = height - (( - yOffset ) % height ) ;
+ if ( yOffset == height ) yOffset = 0; /* For else case */
+
+ switch ( alu ) {
+ case GXcopyInverted: /* 0xc NOT src */
+ case GXcopy: /* 0x3 src */
+ /* Special Case Code */
+ DrawFirstTile( pWin, pTile, x0, y0, w, h,
+ alu, planes, xOffset, yOffset ) ;
+ /* Here We Double The Size Of The BLIT Each Iteration */
+ xf4bppReplicateArea( pWin, x0, y0, planes, w, h,
+ MIN( w, pTile->drawable.width ),
+ MIN( h, pTile->drawable.height ) ) ;
+ break ;
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ case GXorReverse: /* 0xb src OR NOT dst */
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ case GXand: /* 0x1 src AND dst */
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ case GXxor: /* 0x6 src XOR dst */
+ case GXorInverted: /* 0xd NOT src OR dst */
+ case GXor: /* 0x7 src OR dst */
+ default:
+ {
+ register unsigned char *data ;
+ register int hcount, vcount ; /* Number of tiles in center */
+ int xcount, ycount; /* Temporaries */
+ int x1, y1; /* Left upper corner of center */
+ int x2, y2; /* Left upper corner of lower right margin */
+ int leftmgn, rightmgn, topmgn, botmgn; /* Margins */
+
+ int htarget, vtarget ;
+
+ data = pTile->devPrivate.ptr;
+
+ /* Compute the various sizes and coordinates. */
+ leftmgn = MIN( w, width - xOffset ) ;
+ x1 = x0 + leftmgn;
+ topmgn = MIN( h, height - yOffset ) ;
+ y1 = y0 + topmgn;
+
+ rightmgn = (w - leftmgn) % width;
+ hcount = (w - leftmgn) / width;
+ x2 = x0 + w - rightmgn;
+ botmgn = (h - topmgn) % height;
+ vcount = (h - topmgn) / height;
+ y2 = y0 + h - botmgn;
+
+ /* We'll use yOffset as offset in data.
+ * This requires yOffset != height (ditto xOffset).
+ */
+ yOffset *= pTile->devKind;
+
+ /* Draw top margin, including corners */
+ if ( topmgn ) {
+ if ( leftmgn ) {
+ xf4bppDrawColorImage( pWin, x0, y0, leftmgn, topmgn,
+ data + yOffset + xOffset,
+ pTile->devKind, alu, planes ) ;
+ }
+ for ( xcount = hcount, htarget = x1;
+ xcount ;
+ xcount--, htarget += width )
+ {
+ xf4bppDrawColorImage( pWin, htarget, y0, width, topmgn,
+ data + yOffset,
+ pTile->devKind, alu, planes ) ;
+ }
+ if ( rightmgn ) {
+ xf4bppDrawColorImage( pWin, x2, y0, rightmgn, topmgn,
+ data + yOffset,
+ pTile->devKind, alu, planes ) ;
+ }
+ }
+
+ /* Draw bottom margin, including corners */
+ if ( botmgn ) {
+ if ( leftmgn ) {
+ xf4bppDrawColorImage( pWin, x0, y2, leftmgn, botmgn,
+ data + xOffset,
+ pTile->devKind, alu, planes ) ;
+ }
+ for ( xcount = hcount, htarget = x1;
+ xcount ;
+ xcount--, htarget += width )
+ {
+ xf4bppDrawColorImage( pWin, htarget, y2, width, botmgn,
+ data,
+ pTile->devKind, alu, planes ) ;
+ }
+ if ( rightmgn ) {
+ xf4bppDrawColorImage( pWin, x2, y2, rightmgn, botmgn,
+ data,
+ pTile->devKind, alu, planes ) ;
+ }
+ }
+
+ /* Draw left margin, excluding corners */
+ if ( leftmgn ) {
+ for ( ycount = vcount, vtarget = y1 ;
+ ycount ;
+ ycount--, vtarget += height )
+ {
+ xf4bppDrawColorImage( pWin, x0, vtarget, leftmgn, height,
+ data + xOffset,
+ pTile->devKind, alu, planes ) ;
+ }
+ }
+
+ /* Draw right margin, excluding corners */
+ if ( rightmgn ) {
+ for ( ycount = vcount, vtarget = y1 ;
+ ycount ;
+ ycount--, vtarget += height )
+ {
+ xf4bppDrawColorImage( pWin, x2, vtarget, rightmgn, height,
+ data,
+ pTile->devKind, alu, planes ) ;
+ }
+ }
+
+ /* Draw center consisting of full tiles */
+ for ( ycount = vcount, vtarget = y1 ;
+ ycount ;
+ ycount--, vtarget += height )
+ {
+ for ( xcount = hcount, htarget = x1 ;
+ xcount ;
+ xcount--, htarget += width )
+ {
+ xf4bppDrawColorImage( pWin, htarget, vtarget, width, height,
+ data,
+ pTile->devKind, alu, planes ) ;
+
+ }
+ }
+ } } /* Block + switch */
+}
diff --git a/hw/xfree86/xf4bpp/ibmTrace.h b/hw/xfree86/xf4bpp/ibmTrace.h
new file mode 100644
index 000000000..f99ce33e0
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ibmTrace.h
@@ -0,0 +1,10 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ibmTrace.h,v 1.2 1998/07/25 16:59:28 dawes Exp $ */
+
+
+
+
+
+/* $XConsortium: ibmTrace.h /main/3 1996/02/21 17:56:27 kaleb $ */
+
+#define TRACE(x) /* empty */
+
diff --git a/hw/xfree86/xf4bpp/mfbbres.c b/hw/xfree86/xf4bpp/mfbbres.c
new file mode 100644
index 000000000..300256021
--- /dev/null
+++ b/hw/xfree86/xf4bpp/mfbbres.c
@@ -0,0 +1,162 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbbres.c,v 1.3 1999/06/06 08:48:54 dawes Exp $ */
+/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* GJA -- modified this file for vga16 */
+/* $XConsortium: mfbbres.c /main/5 1996/02/21 17:56:30 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "miline.h"
+#include "wm3.h"
+
+/* Solid bresenham line */
+/* NOTES
+ e2 is used less often than e1, so it's not in a register
+*/
+
+void
+xf4bppBresS(addrlbase, nlwidth, signdx, signdy, axis, x1, y1, e, e1, e2, len)
+PixelType *addrlbase; /* pointer to base of bitmap */
+int nlwidth; /* width in longwords of bitmap */
+int signdx, signdy; /* signs of directions */
+int axis; /* major axis (Y_AXIS or X_AXIS) */
+int x1, y1; /* initial point */
+register int e; /* error accumulator */
+register int e1; /* bresenham increments */
+int e2;
+int len; /* length of line */
+{
+ register int yinc; /* increment to next scanline, in bytes */
+ register PixelType *addrl; /* bitmask long pointer
+ *dont* * cast to char pointer */
+ register PixelType bit; /* current bit being set/cleared/etc. */
+ PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
+ PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
+
+ register int e3 = e2-e1;
+
+ /* point to longword containing first point */
+ addrl = mfbScanline(addrlbase, x1, y1, nlwidth);
+ yinc = signdy * nlwidth;
+ e = e-e1; /* to make looping easier */
+ bit = mask[x1 & PIM];
+
+ if (!len)
+ return;
+
+ if (axis == X_AXIS)
+ {
+ if (signdx > 0)
+ {
+ while(len--)
+ {
+ UPDRW(addrl,bit);
+ e += e1;
+ if (e >= 0)
+ {
+ addrl += yinc;
+ e += e3;
+ }
+ bit = SCRRIGHT(bit,1);
+ if (!bit) { bit = leftbit; addrl++; }
+ }
+ }
+ else
+ {
+ while(len--)
+ {
+ UPDRW(addrl,bit);
+ e += e1;
+ if (e >= 0)
+ {
+ addrl += yinc;
+ e += e3;
+ }
+ bit = SCRLEFT(bit,1);
+ if (!bit) { bit = rightbit; addrl--; }
+ }
+ }
+ } /* if X_AXIS */
+ else
+ {
+ if (signdx > 0)
+ {
+ while(len--)
+ {
+ UPDRW(addrl,bit);
+ e += e1;
+ if (e >= 0)
+ {
+ bit = SCRRIGHT(bit,1);
+ if (!bit) { bit = leftbit; addrl++; }
+ e += e3;
+ }
+ addrl += yinc;
+ }
+ }
+ else
+ {
+ while(len--)
+ {
+ UPDRW(addrl,bit);
+ e += e1;
+ if (e >= 0)
+ {
+ bit = SCRLEFT(bit,1);
+ if (!bit) { bit = rightbit; addrl--; }
+ e += e3;
+ }
+ addrl += yinc;
+ }
+ }
+ } /* else Y_AXIS */
+}
diff --git a/hw/xfree86/xf4bpp/mfbbresd.c b/hw/xfree86/xf4bpp/mfbbresd.c
new file mode 100644
index 000000000..560995957
--- /dev/null
+++ b/hw/xfree86/xf4bpp/mfbbresd.c
@@ -0,0 +1,203 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbbresd.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* GJA -- modified this file for vga16 */
+/* $XConsortium: mfbbresd.c /main/5 1996/02/21 17:56:34 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "miline.h"
+#include "wm3.h"
+#include "xf86.h"
+
+/* Dashed bresenham line */
+
+#define NO_INK (-1) /* GJA -- means: dash is off */
+
+#define StepDash\
+ if (!--dashRemaining) { \
+ if (++ dashIndex == numInDashList) \
+ dashIndex = 0; \
+ dashRemaining = pDash[dashIndex]; \
+ ink = fgink; \
+ if (dashIndex & 1) \
+ ink = bgink; \
+ if (isDoubleDash) \
+ WM3_SET_INK(ink); \
+ }
+
+void
+xf4bppBresD(pDrawable, fgink, bgink,
+ pdashIndex, pDash, numInDashList, pdashOffset, isDoubleDash,
+ addrlbase, nlwidth,
+ signdx, signdy, axis, x1, y1, e, e1, e2, len)
+DrawablePtr pDrawable;
+int fgink, bgink;
+int *pdashIndex; /* current dash */
+unsigned char *pDash; /* dash list */
+int numInDashList; /* total length of dash list */
+int *pdashOffset; /* offset into current dash */
+int isDoubleDash;
+PixelType *addrlbase; /* pointer to base of bitmap */
+int nlwidth; /* width in longwords of bitmap */
+int signdx, signdy; /* signs of directions */
+int axis; /* major axis (Y_AXIS or X_AXIS) */
+int x1, y1; /* initial point */
+register int e; /* error accumulator */
+register int e1; /* bresenham increments */
+int e2;
+int len; /* length of line */
+{
+ IOADDRESS REGBASE =
+ xf86Screens[pDrawable->pScreen->myNum]->domainIOBase + 0x300;
+ register int yinc; /* increment to next scanline, in bytes */
+ register PixelType *addrl;
+ register int e3 = e2-e1;
+ register unsigned long bit;
+ PixelType leftbit = mask[0]; /* leftmost bit to process in new word */
+ PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */
+ int dashIndex;
+ int dashOffset;
+ int dashRemaining;
+ int ink;
+
+ fgink &= 0x0F; bgink &= 0x0F; /* GJA -- so they're != NO_INK */
+
+ dashOffset = *pdashOffset;
+ dashIndex = *pdashIndex;
+ dashRemaining = pDash[dashIndex] - dashOffset;
+ ink = fgink;
+ if (!isDoubleDash)
+ bgink = NO_INK;
+ if (dashIndex & 1)
+ ink = bgink;
+ if ( ink != NO_INK ) WM3_SET_INK(ink);
+
+ /* point to longword containing first point */
+ addrl = mfbScanline(addrlbase, x1, y1, nlwidth);
+ yinc = signdy * nlwidth;
+ e = e-e1; /* to make looping easier */
+ bit = mask[x1 & PIM];
+ if (axis == X_AXIS)
+ {
+ if (signdx > 0)
+ {
+ while(len--)
+ {
+ if ( ink != NO_INK ) UPDRW(addrl,bit);
+ e += e1;
+ if (e >= 0)
+ {
+ addrl += yinc;
+ e += e3;
+ }
+ bit = SCRRIGHT(bit,1);
+ if (!bit) { bit = leftbit; addrl++; }
+ StepDash
+ }
+ }
+ else
+ {
+ while(len--)
+ {
+
+ if ( ink != NO_INK ) UPDRW(addrl,bit);
+ e += e1;
+ if (e >= 0)
+ {
+ addrl += yinc;
+ e += e3;
+ }
+ bit = SCRLEFT(bit,1);
+ if (!bit) { bit = rightbit; addrl--; }
+ StepDash
+ }
+ }
+ } /* if X_AXIS */
+ else
+ {
+ if (signdx > 0)
+ {
+ while(len--)
+ {
+ if ( ink != NO_INK ) UPDRW(addrl,bit);
+ e += e1;
+ if (e >= 0)
+ {
+ bit = SCRRIGHT(bit,1);
+ if (!bit) { bit = leftbit; addrl++; }
+ e += e3;
+ }
+ addrl += yinc;
+ StepDash
+ }
+ }
+ else
+ {
+ while(len--)
+ {
+
+ if ( ink != NO_INK ) UPDRW(addrl,bit);
+ e += e1;
+ if (e >= 0)
+ {
+ bit = SCRLEFT(bit,1);
+ if (!bit) { bit = rightbit; addrl--; }
+ e += e3;
+ }
+ addrl += yinc;
+ StepDash
+ }
+ }
+ } /* else Y_AXIS */
+ *pdashIndex = dashIndex;
+ *pdashOffset = pDash[dashIndex] - dashRemaining;
+}
diff --git a/hw/xfree86/xf4bpp/mfbfillarc.c b/hw/xfree86/xf4bpp/mfbfillarc.c
new file mode 100644
index 000000000..14c2ccb66
--- /dev/null
+++ b/hw/xfree86/xf4bpp/mfbfillarc.c
@@ -0,0 +1,299 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbfillarc.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */
+/************************************************************
+
+Copyright (c) 1989 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+********************************************************/
+
+/* GJA -- Took mfb code and modified it. */
+
+/* $XConsortium: mfbfillarc.c /main/4 1996/02/21 17:56:37 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "mi.h"
+#include "mifillarc.h"
+#include "wm3.h"
+
+#include "xf86str.h" /* for pScrn->vtSema */
+extern ScrnInfoPtr *xf86Screens;
+
+static void
+v16FillEllipseSolid
+(
+ DrawablePtr pDraw,
+ xArc *arc
+)
+{
+ int x, y, e;
+ int yk, xk, ym, xm, dx, dy, xorg, yorg;
+ register int slw;
+ miFillArcRec info;
+ int *addrlt, *addrlb;
+ register int *addrl;
+ register int n;
+ int nlwidth;
+ register int xpos;
+ int startmask, endmask, nlmiddle;
+
+ if (pDraw->type == DRAWABLE_WINDOW)
+ {
+ addrlt = (int *)
+ (((PixmapPtr)(pDraw->pScreen->devPrivate))->devPrivate.ptr);
+ nlwidth = (int)
+ (((PixmapPtr)(pDraw->pScreen->devPrivate))->devKind) >> 2;
+ }
+ else
+ {
+ addrlt = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
+ nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
+ }
+
+ miFillArcSetup(arc, &info);
+ MIFILLARCSETUP();
+ xorg += pDraw->x;
+ yorg += pDraw->y;
+ addrlb = addrlt;
+ addrlt += nlwidth * (yorg - y);
+ addrlb += nlwidth * (yorg + y + dy);
+ while (y)
+ {
+ addrlt += nlwidth;
+ addrlb -= nlwidth;
+ MIFILLARCSTEP(slw);
+ if (!slw)
+ continue;
+ xpos = xorg - x;
+ addrl = addrlt + (xpos >> PWSH);
+ if (((xpos & PIM) + slw) < PPW)
+ {
+ maskpartialbits(xpos, slw, startmask);
+ UPDRW(addrl,startmask);
+ if (miFillArcLower(slw))
+ {
+ addrl = addrlb + (xpos >> PWSH);
+ UPDRW(addrl,startmask);
+ }
+ continue;
+ }
+ maskbits(xpos, slw, startmask, endmask, nlmiddle);
+ if (startmask)
+ {
+ UPDRW(addrl,startmask); addrl++;
+ }
+ n = nlmiddle;
+ while (n--) {
+ UPDRW(addrl,~0); addrl++;
+ }
+ if (endmask)
+ {
+ UPDRW(addrl,endmask);
+ }
+ if (!miFillArcLower(slw))
+ continue;
+ addrl = addrlb + (xpos >> PWSH);
+ if (startmask)
+ {
+ UPDRW(addrl,startmask); addrl++;
+ }
+ n = nlmiddle;
+ while (n--) {
+ UPDRW(addrl,~0); addrl++;
+ }
+ if (endmask)
+ {
+ UPDRW(addrl,endmask);
+ }
+ }
+}
+
+#define FILLSPAN(xl,xr,addr) \
+ if (xr >= xl) \
+ { \
+ width = xr - xl + 1; \
+ addrl = addr + (xl >> PWSH); \
+ if (((xl & PIM) + width) < PPW) \
+ { \
+ maskpartialbits(xl, width, startmask); \
+ UPDRW(addrl,startmask); \
+ } \
+ else \
+ { \
+ maskbits(xl, width, startmask, endmask, nlmiddle); \
+ if (startmask) \
+ { \
+ UPDRW(addrl,startmask); addrl++; \
+ } \
+ n = nlmiddle; \
+ while (n--) { \
+ UPDRW(addrl,~0); addrl++; \
+ } \
+ if (endmask) \
+ { \
+ UPDRW(addrl,endmask); \
+ } \
+ } \
+ }
+
+#define FILLSLICESPANS(flip,addr) \
+ if (!flip) \
+ { \
+ FILLSPAN(xl, xr, addr); \
+ } \
+ else \
+ { \
+ xc = xorg - x; \
+ FILLSPAN(xc, xr, addr); \
+ xc += slw - 1; \
+ FILLSPAN(xl, xc, addr); \
+ }
+
+static void
+v16FillArcSliceSolidCopy
+(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ xArc *arc
+)
+{
+ register int *addrl;
+ register int n;
+ int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
+ register int x, y, e;
+ miFillArcRec info;
+ miArcSliceRec slice;
+ int xl, xr, xc;
+ int *addrlt, *addrlb;
+ int nlwidth;
+ int width;
+ int startmask, endmask, nlmiddle;
+
+ if (pDraw->type == DRAWABLE_WINDOW)
+ {
+ addrlt = (int *)
+ (((PixmapPtr)(pDraw->pScreen->devPrivate))->devPrivate.ptr);
+ nlwidth = (int)
+ (((PixmapPtr)(pDraw->pScreen->devPrivate))->devKind) >> 2;
+ }
+ else
+ {
+ addrlt = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
+ nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
+ }
+
+ miFillArcSetup(arc, &info);
+ miFillArcSliceSetup(arc, &slice, pGC);
+ MIFILLARCSETUP();
+ xorg += pDraw->x;
+ yorg += pDraw->y;
+ addrlb = addrlt;
+ addrlt += nlwidth * (yorg - y);
+ addrlb += nlwidth * (yorg + y + dy);
+ slice.edge1.x += pDraw->x;
+ slice.edge2.x += pDraw->x;
+ while (y > 0)
+ {
+ addrlt += nlwidth;
+ addrlb -= nlwidth;
+ MIFILLARCSTEP(slw);
+ MIARCSLICESTEP(slice.edge1);
+ MIARCSLICESTEP(slice.edge2);
+ if (miFillSliceUpper(slice))
+ {
+ MIARCSLICEUPPER(xl, xr, slice, slw);
+ FILLSLICESPANS(slice.flip_top, addrlt);
+ }
+ if (miFillSliceLower(slice))
+ {
+ MIARCSLICELOWER(xl, xr, slice, slw);
+ FILLSLICESPANS(slice.flip_bot, addrlb);
+ }
+ }
+}
+
+static void
+xf4bppPolyFillArcSolid
+(
+ register DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+)
+{
+ mfbPrivGC *priv;
+ register xArc *arc;
+ register int i;
+ BoxRec box;
+ RegionPtr cclip;
+ int rop;
+
+ priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
+ rop = priv->rop;
+#if 0
+ if ((rop == RROP_NOP) || !(pGC->planemask & 1))
+#else
+ if ( !(pGC->planemask & 0x0F))
+#endif
+ return;
+ cclip = pGC->pCompositeClip;
+ for (arc = parcs, i = narcs; --i >= 0; arc++)
+ {
+ if (miFillArcEmpty(arc))
+ continue;
+ if (miCanFillArc(arc))
+ {
+ box.x1 = arc->x + pDraw->x;
+ box.y1 = arc->y + pDraw->y;
+ box.x2 = box.x1 + (int)arc->width + 1;
+ box.y2 = box.y1 + (int)arc->height + 1;
+ if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN)
+ {
+ if ((arc->angle2 >= FULLCIRCLE) ||
+ (arc->angle2 <= -FULLCIRCLE))
+ DO_WM3(pGC,v16FillEllipseSolid(pDraw, arc))
+ else
+ DO_WM3(pGC,v16FillArcSliceSolidCopy(pDraw, pGC, arc))
+ continue;
+ }
+ }
+ miPolyFillArc(pDraw, pGC, 1, arc);
+ }
+}
+
+void
+xf4bppPolyFillArc(pDraw, pGC, narcs, parcs)
+ register DrawablePtr pDraw;
+ GCPtr pGC;
+ int narcs;
+ xArc *parcs;
+{
+ if ( !xf86Screens[pDraw->pScreen->myNum]->vtSema || (pGC->fillStyle != FillSolid) ) {
+ miPolyFillArc(pDraw, pGC, narcs, parcs);
+ } else {
+ xf4bppPolyFillArcSolid(pDraw, pGC, narcs, parcs);
+ }
+}
diff --git a/hw/xfree86/xf4bpp/mfbhrzvert.c b/hw/xfree86/xf4bpp/mfbhrzvert.c
new file mode 100644
index 000000000..3d6c3df52
--- /dev/null
+++ b/hw/xfree86/xf4bpp/mfbhrzvert.c
@@ -0,0 +1,133 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbhrzvert.c,v 1.3 1999/06/06 08:48:55 dawes Exp $ */
+/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* GJA -- modified this file for vga16 */
+/* $XConsortium: mfbhrzvert.c /main/3 1996/02/21 17:56:41 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "wm3.h"
+
+/* horizontal solid line
+ abs(len) > 1
+*/
+
+void
+xf4bppHorzS(addrl, nlwidth, x1, y1, len)
+register PixelType *addrl; /* pointer to base of bitmap */
+register int nlwidth; /* width in longwords of bitmap */
+int x1; /* initial point */
+int y1;
+int len; /* length of line */
+{
+ register PixelType startmask;
+ register PixelType endmask;
+ register int nlmiddle;
+
+
+ /* force the line to go left to right
+ but don't draw the last point
+ */
+ if (len < 0)
+ {
+ x1 += len;
+ x1 += 1;
+ len = -len;
+ }
+
+ addrl = mfbScanline(addrl, x1, y1, nlwidth);
+
+ /* all bits inside same longword */
+ if ( ((x1 & PIM) + len) < PPW)
+ {
+ maskpartialbits(x1, len, startmask);
+ UPDRW(addrl,startmask);
+ }
+ else
+ {
+ maskbits(x1, len, startmask, endmask, nlmiddle);
+ if (startmask) {
+ UPDRW(addrl,startmask); addrl++;
+ }
+ Duff (nlmiddle, UPDRW(addrl,~0); addrl++);
+ if (endmask) {
+ UPDRW(addrl,endmask);
+ }
+ }
+}
+
+/* vertical solid line
+ this uses do loops because pcc (Ultrix 1.2, bsd 4.2) generates
+ better code. sigh. we know that len will never be 0 or 1, so
+ it's OK to use it.
+*/
+
+void
+xf4bppVertS(addrl, nlwidth, x1, y1, len)
+register PixelType *addrl; /* pointer to base of bitmap */
+register int nlwidth; /* width in longwords of bitmap */
+int x1, y1; /* initial point */
+register int len; /* length of line */
+{
+ register PixelType bitmask;
+
+ addrl = mfbScanline(addrl, x1, y1, nlwidth);
+
+ if (len < 0)
+ {
+ nlwidth = -nlwidth;
+ len = -len;
+ }
+
+ bitmask = mask[x1 & PIM];
+ Duff(len, UPDRW(addrl,bitmask); addrl += nlwidth);
+}
diff --git a/hw/xfree86/xf4bpp/mfbimggblt.c b/hw/xfree86/xf4bpp/mfbimggblt.c
new file mode 100644
index 000000000..cb2e63125
--- /dev/null
+++ b/hw/xfree86/xf4bpp/mfbimggblt.c
@@ -0,0 +1,501 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.7 2003/02/18 21:29:59 tsi Exp $ */
+
+/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* $XConsortium: mfbimggblt.c /main/5 1996/02/21 17:56:44 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "mi.h"
+#include "dixfontstr.h"
+#include "ppcGCstr.h"
+#include "wm3.h"
+
+#include "xf86str.h" /* for pScrn->vtSema */
+extern ScrnInfoPtr *xf86Screens;
+
+/*
+ we should eventually special-case fixed-width fonts for ImageText.
+
+ this works for fonts with glyphs <= 32 bits wide.
+
+ the clipping calculations are done for worst-case fonts.
+we make no assumptions about the heights, widths, or bearings
+of the glyphs. if we knew that the glyphs are all the same height,
+we could clip the tops and bottoms per clipping box, rather
+than per character per clipping box. if we knew that the glyphs'
+left and right bearings were wlle-behaved, we could clip a single
+character at the start, output until the last unclipped
+character, and then clip the last one. this is all straightforward
+to determine based on max-bounds and min-bounds from the font.
+ there is some inefficiency introduced in the per-character
+clipping to make what's going on clearer.
+
+ (it is possible, for example, for a font to be defined in which the
+next-to-last character in a font would be clipped out, but the last
+one wouldn't. the code below deals with this.)
+
+ Image text looks at the bits in the glyph and the fg and bg in the
+GC. it paints a rectangle, as defined in the protocol dcoument,
+and the paints the characters.
+
+ to avoid source proliferation, this file is compiled
+three times:
+ MFBIMAGEGLYPHBLT OPEQ
+ mfbImageGlyphBltWhite |=
+ mfbImageGlyphBltBlack &=~
+
+ the register allocations for startmask and endmask may not
+be the right thing. are there two other deserving candidates?
+xoff, pdst, pglyph, and tmpSrc seem like the right things, though.
+*/
+
+/* Forward declarations -- GJA */
+static void doImageGlyphBlt(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GC *,
+ int,
+ int,
+ unsigned int,
+ CharInfoPtr *,
+ unsigned char *,
+ ExtentInfoRec *
+#endif
+);
+
+void
+xf4bppImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
+ DrawablePtr pDrawable;
+ GC *pGC;
+ int x, y;
+ unsigned int nglyph;
+ CharInfoPtr *ppci; /* array of character info */
+ pointer pglyphBase; /* start of array of glyphs */
+{
+ ExtentInfoRec info; /* used by QueryGlyphExtents() */
+ xRectangle backrect;/* backing rectangle to paint.
+ in the general case, NOT necessarily
+ the same as the string's bounding box
+ */
+ /* GJA -- I agree, this ALL should be moved to GC validation. */
+ if ( (pDrawable->type != DRAWABLE_WINDOW) || (pGC->alu != GXcopy) ||
+ !xf86Screens[pDrawable->pScreen->myNum]->vtSema ||
+ ((pGC->font) &&
+ (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
+ FONTMINBOUNDS(pGC->font,characterWidth) < 0)) ) {
+ miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
+ } else {
+ ppcPrivGC *pPrivGC;
+ int oldfillStyle, oldfg, oldalu;
+
+ if (!(pGC->planemask & 0x0F))
+ return;
+
+ QueryGlyphExtents(pGC->font, ppci, (unsigned long)nglyph, &info);
+
+ backrect.x = x;
+ backrect.y = y - FONTASCENT(pGC->font);
+ backrect.width = info.overallWidth;
+ backrect.height = FONTASCENT(pGC->font) + FONTDESCENT(pGC->font);
+
+
+ pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr;
+ oldfillStyle = pPrivGC->colorRrop.fillStyle; /* GJA */
+ oldfg = pPrivGC->colorRrop.fgPixel; /* GJA */
+ oldalu = pPrivGC->colorRrop.alu; /* GJA */
+
+ pPrivGC->colorRrop.fillStyle = FillSolid; /* GJA */
+ pPrivGC->colorRrop.fgPixel = pGC->bgPixel; /* GJA */
+ pGC->fgPixel = pGC->bgPixel;
+ pPrivGC->colorRrop.alu = GXcopy; /* GJA */
+ pGC->alu = GXcopy;
+
+ /* Required fields:
+ * colorRrop.alu, colorRrop.planemask, colorRrop.fgPixel
+ */
+ xf4bppPolyFillRect(pDrawable, pGC, 1, &backrect);
+
+ pPrivGC->colorRrop.fgPixel = oldfg; /* GJA */
+ pGC->fgPixel = oldfg;
+
+ /* the faint-hearted can open their eyes now */
+
+ DO_WM3(pGC,doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci,
+ pglyphBase,&info))
+
+ pPrivGC->colorRrop.fillStyle = oldfillStyle; /* GJA */
+ pPrivGC->colorRrop.alu = oldalu; /* GJA */
+ pGC->alu = oldalu;
+ }
+
+}
+
+static void
+doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop)
+ DrawablePtr pDrawable;
+ GC *pGC;
+ int x, y;
+ unsigned int nglyph;
+ CharInfoPtr *ppci; /* array of character info */
+ unsigned char *pglyphBase; /* start of array of glyphs */
+ ExtentInfoRec* infop; /* used by QueryGlyphExtents() */
+{
+ BoxRec bbox; /* string's bounding box */
+
+ CharInfoPtr pci;
+ int xorg, yorg; /* origin of drawable in bitmap */
+ int widthDst; /* width of dst in longwords */
+
+ /* these keep track of the character origin */
+ CARD32 *pdstBase;
+ /* points to longword with character origin */
+ int xchar; /* xorigin of char (mod 32) */
+
+ /* these are used for placing the glyph */
+ register int xoff; /* x offset of left edge of glyph (mod 32) */
+ register CARD32 *pdst;
+ /* pointer to current longword in dst */
+
+ int w; /* width of glyph in bits */
+ int h; /* height of glyph */
+ int widthGlyph; /* width of glyph, in bytes */
+ register unsigned char *pglyph;
+ /* pointer to current row of glyph */
+
+ /* used for putting down glyph */
+ register unsigned int tmpSrc;
+ /* for getting bits from glyph */
+ register int startmask;
+ register int endmask;
+
+ register int nFirst;/* bits of glyph in current longword */
+
+ xorg = pDrawable->x;
+ yorg = pDrawable->y;
+ if (pDrawable->type == DRAWABLE_WINDOW)
+ {
+ pdstBase = (CARD32 *)
+ (((PixmapPtr)(pDrawable->pScreen->devPrivate))->devPrivate.ptr);
+ widthDst = (int)
+ (((PixmapPtr)(pDrawable->pScreen->devPrivate))->devKind) >> 2;
+ }
+ else
+ {
+ pdstBase = (CARD32 *)(((PixmapPtr)pDrawable)->devPrivate.ptr);
+ widthDst = (int)(((PixmapPtr)pDrawable)->devKind) >> 2;
+ }
+
+ x += xorg;
+ y += yorg;
+ bbox.x1 = x + infop->overallLeft;
+ bbox.x2 = x + infop->overallRight;
+ bbox.y1 = y - infop->overallAscent;
+ bbox.y2 = y + infop->overallDescent;
+
+ /* UNCLEAN CODE
+ we know the mfbPolyFillRect uses only three fields in
+ devPrivate[mfbGCPrivateIndex].ptr, two of which (the rotated
+ tile/stipple and the ropFillArea) are
+ irrelevant for solid filling, so we just poke the FillArea
+ field. the GC is now in an inconsistent state, but we'll fix
+ it as soon as PolyFillRect returns. fortunately, the server
+ is single threaded.
+
+ NOTE:
+ if you are not using the standard mfbFillRectangle code, you
+ need to poke any fields in the GC the rectangle stuff need
+ (probably alu, fgPixel, and fillStyle) and in devPrivate[mfbGCPrivateIndex].ptr
+ (probably rop or ropFillArea.) You could just call ValidateGC,
+ but that is usually not a cheap thing to do.
+ */
+
+ switch (RECT_IN_REGION(pGC->pScreen, pGC->pCompositeClip, &bbox))
+ {
+ case rgnOUT:
+ break;
+ case rgnIN:
+ pdstBase = pdstBase + (widthDst * y) + (x >> PWSH);
+ xchar = x & PIM;
+
+ while(nglyph--)
+ {
+ pci = *ppci;
+ pglyph = FONTGLYPHBITS(pglyphBase, pci);
+ w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing;
+ h = pci->metrics.ascent + pci->metrics.descent;
+ widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
+
+ /* start at top scanline of glyph */
+ pdst = pdstBase - (pci->metrics.ascent * widthDst);
+
+ /* find correct word in scanline and x offset within it
+ for left edge of glyph
+ */
+ xoff = xchar + pci->metrics.leftSideBearing;
+ if (xoff > PIM)
+ {
+ pdst++;
+ xoff &= PIM;
+ }
+ else if (xoff < 0)
+ {
+ xoff += PPW;
+ pdst--;
+ }
+
+ if ((xoff + w) <= PPW)
+ {
+ /* glyph all in one longword */
+ maskpartialbits(xoff, w, startmask);
+
+ while (h--)
+ {
+ getleftbits(pglyph, w, tmpSrc);
+ UPDRW(pdst,(SCRRIGHT(tmpSrc, xoff) & startmask));
+ pglyph += widthGlyph;
+ pdst += widthDst;
+ }
+ }
+ else
+ {
+ /* glyph crosses longword boundary */
+ maskPPWbits(xoff, w, startmask, endmask);
+ nFirst = PPW - xoff;
+ while (h--)
+ {
+ getleftbits(pglyph, w, tmpSrc);
+ UPDRW(pdst,(SCRRIGHT(tmpSrc, xoff) & startmask));
+ UPDRW(&(pdst[1]),(SCRLEFT(tmpSrc, nFirst) & endmask));
+ pglyph += widthGlyph;
+ pdst += widthDst;
+ }
+ } /* glyph crosses longwords boundary */
+
+ /* update character origin */
+ x += pci->metrics.characterWidth;
+ xchar += pci->metrics.characterWidth;
+ if (xchar > PLST)
+ {
+ xchar -= PPW;
+ pdstBase++;
+ }
+ else if (xchar < 0)
+ {
+ xchar += PPW;
+ pdstBase--;
+ }
+ ppci++;
+ } /* while nglyph-- */
+ break;
+ case rgnPART:
+ {
+ TEXTPOS *ppos;
+ int nbox;
+ BoxPtr pbox;
+ RegionPtr cclip;
+ int xpos; /* x position of char origin */
+ unsigned int i;
+ BoxRec clip;
+ int leftEdge, rightEdge;
+ int topEdge, bottomEdge;
+ int glyphRow; /* first row of glyph not wholly
+ clipped out */
+ int glyphCol; /* leftmost visible column of glyph */
+ int getWidth; /* bits to get from glyph */
+
+ if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS))))
+ return;
+
+ pdstBase = pdstBase + (widthDst * y) + (x >> PWSH);
+ xpos = x;
+ xchar = xpos & PIM;
+
+ for (i=0; i<nglyph; i++)
+ {
+ pci = ppci[i];
+
+ ppos[i].xpos = xpos;
+ ppos[i].xchar = xchar;
+ ppos[i].leftEdge = xpos + pci->metrics.leftSideBearing;
+ ppos[i].rightEdge = xpos + pci->metrics.rightSideBearing;
+ ppos[i].topEdge = y - pci->metrics.ascent;
+ ppos[i].bottomEdge = y + pci->metrics.descent;
+ ppos[i].pdstBase = pdstBase;
+ ppos[i].widthGlyph = GLYPHWIDTHBYTESPADDED(pci);
+
+ xpos += pci->metrics.characterWidth;
+ xchar += pci->metrics.characterWidth;
+ if (xchar > PLST)
+ {
+ xchar &= PIM;
+ pdstBase++;
+ }
+ else if (xchar < 0)
+ {
+ xchar += PPW;
+ pdstBase--;
+ }
+ }
+
+ cclip = pGC->pCompositeClip;
+ pbox = REGION_RECTS(cclip);
+ nbox = REGION_NUM_RECTS(cclip);
+
+ /* HACK ALERT
+ since we continue out of the loop below so often, it
+ is easier to increment pbox at the top than at the end.
+ don't try this at home.
+ */
+ pbox--;
+ while(nbox--)
+ {
+ pbox++;
+ clip.x1 = max(bbox.x1, pbox->x1);
+ clip.y1 = max(bbox.y1, pbox->y1);
+ clip.x2 = min(bbox.x2, pbox->x2);
+ clip.y2 = min(bbox.y2, pbox->y2);
+ if ((clip.x2<=clip.x1) || (clip.y2<=clip.y1))
+ continue;
+
+ for(i=0; i<nglyph; i++)
+ {
+ pci = ppci[i];
+ xchar = ppos[i].xchar;
+
+ /* clip the left and right edges */
+ if (ppos[i].leftEdge < clip.x1)
+ leftEdge = clip.x1;
+ else
+ leftEdge = ppos[i].leftEdge;
+
+ if (ppos[i].rightEdge > clip.x2)
+ rightEdge = clip.x2;
+ else
+ rightEdge = ppos[i].rightEdge;
+
+ w = rightEdge - leftEdge;
+ if (w <= 0)
+ continue;
+
+ /* clip the top and bottom edges */
+ if (ppos[i].topEdge < clip.y1)
+ topEdge = clip.y1;
+ else
+ topEdge = ppos[i].topEdge;
+
+ if (ppos[i].bottomEdge > clip.y2)
+ bottomEdge = clip.y2;
+ else
+ bottomEdge = ppos[i].bottomEdge;
+
+ h = bottomEdge - topEdge;
+ if (h <= 0)
+ continue;
+
+ glyphRow = (topEdge - y) + pci->metrics.ascent;
+ widthGlyph = ppos[i].widthGlyph;
+ pglyph = FONTGLYPHBITS(pglyphBase, pci);
+ pglyph += (glyphRow * widthGlyph);
+
+ pdst = ppos[i].pdstBase - ((y-topEdge) * widthDst);
+
+ glyphCol = (leftEdge - ppos[i].xpos) -
+ (pci->metrics.leftSideBearing);
+ getWidth = w + glyphCol;
+ xoff = xchar + (leftEdge - ppos[i].xpos);
+ if (xoff > PLST)
+ {
+ xoff &= PIM;
+ pdst++;
+ }
+ else if (xoff < 0)
+ {
+ xoff += PPW;
+ pdst--;
+ }
+
+ if ((xoff + w) <= PPW)
+ {
+ maskpartialbits(xoff, w, startmask);
+ while (h--)
+ {
+ getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
+ UPDRW(pdst,(SCRRIGHT(tmpSrc, xoff) & startmask));
+ pglyph += widthGlyph;
+ pdst += widthDst;
+ }
+ }
+ else
+ {
+ maskPPWbits(xoff, w, startmask, endmask);
+ nFirst = PPW - xoff;
+ while (h--)
+ {
+ getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
+ UPDRW(pdst,(SCRRIGHT(tmpSrc, xoff) & startmask));
+ UPDRW(&(pdst[1]),(SCRLEFT(tmpSrc, nFirst) & endmask));
+ pglyph += widthGlyph;
+ pdst += widthDst;
+ }
+ }
+ } /* for each glyph */
+ } /* while nbox-- */
+ DEALLOCATE_LOCAL(ppos);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
diff --git a/hw/xfree86/xf4bpp/mfbline.c b/hw/xfree86/xf4bpp/mfbline.c
new file mode 100644
index 000000000..dc85e3d92
--- /dev/null
+++ b/hw/xfree86/xf4bpp/mfbline.c
@@ -0,0 +1,982 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbline.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* GJA -- modified this file for vga16 */
+/* $XConsortium: mfbline.c /main/4 1996/02/21 17:56:48 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "mi.h"
+#include "miline.h"
+#include "vgaVideo.h"
+#include "wm3.h"
+
+#include "xf86str.h" /* for pScrn->vtSema */
+extern ScrnInfoPtr *xf86Screens;
+
+/* single-pixel lines on a color frame buffer
+
+ NON-SLOPED LINES
+ horizontal lines are always drawn left to right; we have to
+move the endpoints right by one after they're swapped.
+ horizontal lines will be confined to a single band of a
+region. the code finds that band (giving up if the lower
+bound of the band is above the line we're drawing); then it
+finds the first box in that band that contains part of the
+line. we clip the line to subsequent boxes in that band.
+ vertical lines are always drawn top to bottom (y-increasing.)
+this requires adding one to the y-coordinate of each endpoint
+after swapping.
+
+ SLOPED LINES
+ when clipping a sloped line, we bring the second point inside
+the clipping box, rather than one beyond it, and then add 1 to
+the length of the line before drawing it. this lets us use
+the same box for finding the outcodes for both endpoints. since
+the equation for clipping the second endpoint to an edge gives us
+1 beyond the edge, we then have to move the point towards the
+first point by one step on the major axis.
+ eventually, there will be a diagram here to explain what's going
+on. the method uses Cohen-Sutherland outcodes to determine
+outsideness, and a method similar to Pike's layers for doing the
+actual clipping.
+
+*/
+#ifdef POLYSEGMENT
+static void DoV16SegmentSS(
+#if NeedFunctionPrototypes
+ DrawablePtr, GCPtr, int, xSegment*
+#endif
+);
+
+void
+xf4bppSegmentSS (pDrawable, pGC, nseg, pSeg)
+ DrawablePtr pDrawable;
+ GCPtr pGC;
+ int nseg;
+ register xSegment *pSeg;
+{
+ if ( ! xf86Screens[pDrawable->pScreen->myNum]->vtSema ) {
+ miPolySegment(pDrawable, pGC, nseg, pSeg);
+ } else {
+ DO_WM3(pGC,DoV16SegmentSS (pDrawable, pGC, nseg, pSeg));
+ }
+}
+
+#else
+static void DoV16LineSS(
+#if NeedFunctionPrototypes
+ DrawablePtr, GCPtr, int, int, DDXPointPtr
+#endif
+);
+
+void
+xf4bppLineSS (pDrawable, pGC, mode, npt, pptInit)
+ DrawablePtr pDrawable;
+ GCPtr pGC;
+ int mode; /* Origin or Previous */
+ int npt; /* number of points */
+ DDXPointPtr pptInit;
+{
+ if ( ! xf86Screens[pDrawable->pScreen->myNum]->vtSema ) {
+ miZeroLine(pDrawable, pGC, mode, npt, pptInit);
+ } else {
+ DO_WM3(pGC,DoV16LineSS (pDrawable, pGC, mode, npt, pptInit));
+ }
+}
+#endif
+
+static void
+#ifdef POLYSEGMENT
+DoV16SegmentSS (pDrawable, pGC, nseg, pSeg)
+ DrawablePtr pDrawable;
+ GCPtr pGC;
+ int nseg;
+ register xSegment *pSeg;
+#else
+DoV16LineSS (pDrawable, pGC, mode, npt, pptInit)
+ DrawablePtr pDrawable;
+ GCPtr pGC;
+ int mode; /* Origin or Previous */
+ int npt; /* number of points */
+ DDXPointPtr pptInit;
+#endif
+{
+ int nboxInit;
+ register int nbox;
+ BoxPtr pboxInit;
+ register BoxPtr pbox;
+#ifndef POLYSEGMENT
+ register DDXPointPtr ppt; /* pointer to list of translated points */
+#endif
+
+ unsigned int oc1; /* outcode of point 1 */
+ unsigned int oc2; /* outcode of point 2 */
+
+ PixelType *addrlBase; /* pointer to start of drawable */
+#ifndef POLYSEGMENT
+ PixelType *addrl; /* address of destination pixmap */
+#endif
+ int nlwidth; /* width in longwords of destination pixmap */
+ int xorg, yorg; /* origin of window */
+
+ int adx; /* abs values of dx and dy */
+ int ady;
+ int signdx; /* sign of dx and dy */
+ int signdy;
+ int e, e1, e2; /* bresenham error and increments */
+ int len; /* length of segment */
+ int axis; /* major axis */
+ int octant;
+ unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
+
+ /* a bunch of temporaries */
+ register int y1, y2;
+ register int x1, x2;
+ RegionPtr cclip;
+ int alu;
+
+ if (!(pGC->planemask & 0x0F))
+ return;
+
+ cclip = pGC->pCompositeClip;
+ alu = pGC->alu; /* GJA */
+ pboxInit = REGION_RECTS(cclip);
+ nboxInit = REGION_NUM_RECTS(cclip);
+
+ nlwidth = BYTES_PER_LINE(pDrawable) >> 2; /* GJA */
+ addrlBase = (PixelType *)VIDBASE(pDrawable); /* GJA */
+
+ xorg = pDrawable->x;
+ yorg = pDrawable->y;
+#ifdef POLYSEGMENT
+ while (nseg--)
+#else
+ ppt = pptInit;
+ x2 = ppt->x + xorg;
+ y2 = ppt->y + yorg;
+ while(--npt)
+#endif
+ {
+ nbox = nboxInit;
+ pbox = pboxInit;
+
+#ifdef POLYSEGMENT
+ x1 = pSeg->x1 + xorg;
+ y1 = pSeg->y1 + yorg;
+ x2 = pSeg->x2 + xorg;
+ y2 = pSeg->y2 + yorg;
+ pSeg++;
+#else
+ x1 = x2;
+ y1 = y2;
+ ++ppt;
+ if (mode == CoordModePrevious)
+ {
+ xorg = x1;
+ yorg = y1;
+ }
+ x2 = ppt->x + xorg;
+ y2 = ppt->y + yorg;
+#endif
+
+ if (x1 == x2) /* vertical line */
+ {
+ /* make the line go top to bottom of screen, keeping
+ endpoint semantics
+ */
+ if (y1 > y2)
+ {
+ register int tmp;
+
+ tmp = y2;
+ y2 = y1 + 1;
+ y1 = tmp + 1;
+#ifdef POLYSEGMENT
+ if (pGC->capStyle != CapNotLast)
+ y1--;
+#endif
+ }
+#ifdef POLYSEGMENT
+ else if (pGC->capStyle != CapNotLast)
+ y2++;
+#endif
+ /* get to first band that might contain part of line */
+ while ((nbox) && (pbox->y2 <= y1))
+ {
+ pbox++;
+ nbox--;
+ }
+
+ if (nbox)
+ {
+ /* stop when lower edge of box is beyond end of line */
+ while((nbox) && (y2 >= pbox->y1))
+ {
+ if ((x1 >= pbox->x1) && (x1 < pbox->x2))
+ {
+ int y1t, y2t;
+ /* this box has part of the line in it */
+ y1t = max(y1, pbox->y1);
+ y2t = min(y2, pbox->y2);
+ if (y1t != y2t)
+ {
+ xf4bppVertS (addrlBase, nlwidth,
+ x1, y1t, y2t-y1t);
+ }
+ }
+ nbox--;
+ pbox++;
+ }
+ }
+#ifndef POLYSEGMENT
+ y2 = ppt->y + yorg;
+#endif
+ }
+ else if (y1 == y2) /* horizontal line */
+ {
+ /* force line from left to right, keeping
+ endpoint semantics
+ */
+ if (x1 > x2)
+ {
+ register int tmp;
+
+ tmp = x2;
+ x2 = x1 + 1;
+ x1 = tmp + 1;
+#ifdef POLYSEGMENT
+ if (pGC->capStyle != CapNotLast)
+ x1--;
+#endif
+ }
+#ifdef POLYSEGMENT
+ else if (pGC->capStyle != CapNotLast)
+ x2++;
+#endif
+
+ /* find the correct band */
+ while( (nbox) && (pbox->y2 <= y1))
+ {
+ pbox++;
+ nbox--;
+ }
+
+ /* try to draw the line, if we haven't gone beyond it */
+ if ((nbox) && (pbox->y1 <= y1))
+ {
+ int tmp;
+
+ /* when we leave this band, we're done */
+ tmp = pbox->y1;
+ while((nbox) && (pbox->y1 == tmp))
+ {
+ int x1t, x2t;
+
+ if (pbox->x2 <= x1)
+ {
+ /* skip boxes until one might contain start point */
+ nbox--;
+ pbox++;
+ continue;
+ }
+
+ /* stop if left of box is beyond right of line */
+ if (pbox->x1 >= x2)
+ {
+ nbox = 0;
+ break;
+ }
+
+ x1t = max(x1, pbox->x1);
+ x2t = min(x2, pbox->x2);
+ if (x1t != x2t)
+ {
+ xf4bppHorzS (addrlBase, nlwidth,
+ x1t, y1, x2t-x1t);
+ }
+ nbox--;
+ pbox++;
+ }
+ }
+#ifndef POLYSEGMENT
+ x2 = ppt->x + xorg;
+#endif
+ }
+ else /* sloped line */
+ {
+ CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy,
+ 1, 1, octant);
+
+ if (adx > ady)
+ {
+ axis = X_AXIS;
+ e1 = ady << 1;
+ e2 = e1 - (adx << 1);
+ e = e1 - adx;
+ }
+ else
+ {
+ axis = Y_AXIS;
+ e1 = adx << 1;
+ e2 = e1 - (ady << 1);
+ e = e1 - ady;
+ SetYMajorOctant(octant);
+ }
+
+ FIXUP_ERROR(e, octant, bias);
+
+ /* we have bresenham parameters and two points.
+ all we have to do now is clip and draw.
+ */
+
+ while(nbox--)
+ {
+ oc1 = 0;
+ oc2 = 0;
+ OUTCODES(oc1, x1, y1, pbox);
+ OUTCODES(oc2, x2, y2, pbox);
+ if ((oc1 | oc2) == 0)
+ {
+ if (axis == X_AXIS)
+ len = adx;
+ else
+ len = ady;
+#ifdef POLYSEGMENT
+ if (pGC->capStyle != CapNotLast)
+ len++;
+#endif
+ xf4bppBresS (addrlBase, nlwidth,
+ signdx, signdy, axis, x1, y1,
+ e, e1, e2, len);
+ break;
+ }
+ else if (oc1 & oc2)
+ {
+ pbox++;
+ }
+ else
+ {
+ int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
+ int clip1 = 0, clip2 = 0;
+ int clipdx, clipdy;
+ int err;
+
+ if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,
+ pbox->y2-1,
+ &new_x1, &new_y1, &new_x2, &new_y2,
+ adx, ady, &clip1, &clip2,
+ octant, bias, oc1, oc2) == -1)
+ {
+ pbox++;
+ continue;
+ }
+
+ if (axis == X_AXIS)
+ len = abs(new_x2 - new_x1);
+ else
+ len = abs(new_y2 - new_y1);
+#ifdef POLYSEGMENT
+ if (clip2 != 0 || pGC->capStyle != CapNotLast)
+ len++;
+#else
+ len += (clip2 != 0);
+#endif
+ if (len)
+ {
+ /* unwind bresenham error term to first point */
+ if (clip1)
+ {
+ clipdx = abs(new_x1 - x1);
+ clipdy = abs(new_y1 - y1);
+ if (axis == X_AXIS)
+ err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
+ else
+ err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
+ }
+ else
+ err = e;
+ xf4bppBresS (addrlBase, nlwidth,
+ signdx, signdy, axis, new_x1, new_y1,
+ err, e1, e2, len);
+ }
+ pbox++;
+ }
+ } /* while (nbox--) */
+ } /* sloped line */
+ } /* while (nline--) */
+
+#ifndef POLYSEGMENT
+
+ /* paint the last point if the end style isn't CapNotLast.
+ (Assume that a projecting, butt, or round cap that is one
+ pixel wide is the same as the single pixel of the endpoint.)
+ */
+
+ if ((pGC->capStyle != CapNotLast) &&
+ ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
+ (ppt->y + yorg != pptInit->y + pDrawable->y) ||
+ (ppt == pptInit + 1)))
+ {
+ PixelType _mask;
+
+ if (alu == RROP_BLACK)
+ _mask = rmask[x2 & PIM];
+ else
+ _mask = mask[x2 & PIM];
+
+ nbox = nboxInit;
+ pbox = pboxInit;
+ while (nbox--)
+ {
+ if ((x2 >= pbox->x1) &&
+ (y2 >= pbox->y1) &&
+ (x2 < pbox->x2) &&
+ (y2 < pbox->y2))
+ {
+ addrl = mfbScanline(addrlBase, x2, y2, nlwidth);
+ UPDRW(addrl,_mask);
+ break;
+ }
+ else
+ pbox++;
+ }
+ }
+#endif
+}
+
+/*
+ * Draw dashed 1-pixel lines.
+ */
+
+#ifdef POLYSEGMENT
+static void DoV16SegmentSD(
+#if NeedFunctionPrototypes
+ DrawablePtr, GCPtr, int, xSegment*
+#endif
+);
+
+void
+xf4bppSegmentSD (pDrawable, pGC, nseg, pSeg)
+ DrawablePtr pDrawable;
+ GCPtr pGC;
+ int nseg;
+ register xSegment *pSeg;
+{
+ if ( ! xf86Screens[pDrawable->pScreen->myNum]->vtSema ) {
+ miPolySegment(pDrawable, pGC, nseg, pSeg);
+ } else {
+ DO_WM3(pGC,DoV16SegmentSD (pDrawable, pGC, nseg, pSeg));
+ }
+}
+
+#else
+static void DoV16LineSD(
+#if NeedFunctionPrototypes
+ DrawablePtr, GCPtr, int, int, DDXPointPtr
+#endif
+);
+
+void
+xf4bppLineSD (pDrawable, pGC, mode, npt, pptInit)
+ DrawablePtr pDrawable;
+ GCPtr pGC;
+ int mode; /* Origin or Previous */
+ int npt; /* number of points */
+ DDXPointPtr pptInit;
+{
+ if ( ! xf86Screens[pDrawable->pScreen->myNum]->vtSema ) {
+ miZeroDashLine(pDrawable, pGC, mode, npt, pptInit);
+ } else {
+ DO_WM3(pGC,DoV16LineSD (pDrawable, pGC, mode, npt, pptInit));
+ }
+}
+#endif
+
+static void
+#ifdef POLYSEGMENT
+DoV16SegmentSD (pDrawable, pGC, nseg, pSeg)
+ DrawablePtr pDrawable;
+ register GCPtr pGC;
+ int nseg;
+ register xSegment *pSeg;
+#else
+DoV16LineSD( pDrawable, pGC, mode, npt, pptInit)
+ DrawablePtr pDrawable;
+ register GCPtr pGC;
+ int mode; /* Origin or Previous */
+ int npt; /* number of points */
+ DDXPointPtr pptInit;
+#endif
+{
+ int nboxInit;
+ register int nbox;
+ BoxPtr pboxInit;
+ register BoxPtr pbox;
+#ifndef POLYSEGMENT
+ register DDXPointPtr ppt; /* pointer to list of translated points */
+#endif
+
+ register unsigned int oc1; /* outcode of point 1 */
+ register unsigned int oc2; /* outcode of point 2 */
+
+ PixelType *addrl; /* address of destination pixmap */
+ int nlwidth; /* width in longwords of destination pixmap */
+ int xorg, yorg; /* origin of window */
+
+ int adx; /* abs values of dx and dy */
+ int ady;
+ int signdx; /* sign of dx and dy */
+ int signdy;
+ int e, e1, e2; /* bresenham error and increments */
+ int len; /* length of segment */
+ int axis; /* major axis */
+ int octant;
+ unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
+ int x1, x2, y1, y2;
+ RegionPtr cclip;
+ int fgink, bgink; /* GJA */
+ unsigned char *pDash;
+ int dashOffset;
+ int numInDashList;
+ int dashIndex;
+ int isDoubleDash;
+ int dashIndexTmp, dashOffsetTmp;
+ int unclippedlen;
+
+ if (!(pGC->planemask & 0x0F))
+ return;
+
+ cclip = pGC->pCompositeClip;
+ fgink = bgink = pGC->fgPixel; /* GJA */
+ pboxInit = REGION_RECTS(cclip);
+ nboxInit = REGION_NUM_RECTS(cclip);
+
+ nlwidth = BYTES_PER_LINE(pDrawable) >> 2; /* GJA */
+ addrl = (PixelType *)VIDBASE(pDrawable); /* GJA */
+
+ /* compute initial dash values */
+
+ pDash = (unsigned char *) pGC->dash;
+ numInDashList = pGC->numInDashList;
+ isDoubleDash = (pGC->lineStyle == LineDoubleDash);
+ dashIndex = 0;
+ dashOffset = 0;
+ miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,
+ numInDashList, &dashOffset);
+
+ if (isDoubleDash)
+ bgink = pGC->bgPixel; /* GJA */
+
+ xorg = pDrawable->x;
+ yorg = pDrawable->y;
+#ifdef POLYSEGMENT
+ while (nseg--)
+#else
+ ppt = pptInit;
+ x2 = ppt->x + xorg;
+ y2 = ppt->y + yorg;
+ while(--npt)
+#endif
+ {
+ nbox = nboxInit;
+ pbox = pboxInit;
+
+#ifdef POLYSEGMENT
+ x1 = pSeg->x1 + xorg;
+ y1 = pSeg->y1 + yorg;
+ x2 = pSeg->x2 + xorg;
+ y2 = pSeg->y2 + yorg;
+ pSeg++;
+#else
+ x1 = x2;
+ y1 = y2;
+ ++ppt;
+ if (mode == CoordModePrevious)
+ {
+ xorg = x1;
+ yorg = y1;
+ }
+ x2 = ppt->x + xorg;
+ y2 = ppt->y + yorg;
+#endif
+
+ CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant);
+
+ if (adx > ady)
+ {
+ axis = X_AXIS;
+ e1 = ady << 1;
+ e2 = e1 - (adx << 1);
+ e = e1 - adx;
+ unclippedlen = adx;
+ }
+ else
+ {
+ axis = Y_AXIS;
+ e1 = adx << 1;
+ e2 = e1 - (ady << 1);
+ e = e1 - ady;
+ unclippedlen = ady;
+ SetYMajorOctant(octant);
+ }
+
+ FIXUP_ERROR(e, octant, bias);
+
+ /* we have bresenham parameters and two points.
+ all we have to do now is clip and draw.
+ */
+
+ while(nbox--)
+ {
+ oc1 = 0;
+ oc2 = 0;
+ OUTCODES(oc1, x1, y1, pbox);
+ OUTCODES(oc2, x2, y2, pbox);
+ if ((oc1 | oc2) == 0)
+ {
+#ifdef POLYSEGMENT
+ if (pGC->capStyle != CapNotLast)
+ unclippedlen++;
+ dashIndexTmp = dashIndex;
+ dashOffsetTmp = dashOffset;
+ xf4bppBresD (pDrawable, fgink, bgink,
+ &dashIndexTmp, pDash, numInDashList,
+ &dashOffsetTmp, isDoubleDash,
+ addrl, nlwidth,
+ signdx, signdy, axis, x1, y1,
+ e, e1, e2, unclippedlen);
+ break;
+#else
+ xf4bppBresD (pDrawable, fgink, bgink,
+ &dashIndex, pDash, numInDashList,
+ &dashOffset, isDoubleDash,
+ addrl, nlwidth,
+ signdx, signdy, axis, x1, y1,
+ e, e1, e2, unclippedlen);
+ goto dontStep;
+#endif
+ }
+ else if (oc1 & oc2)
+ {
+ pbox++;
+ }
+ else /* have to clip */
+ {
+ int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;
+ int clip1 = 0, clip2 = 0;
+ int clipdx, clipdy;
+ int err;
+
+ if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1, pbox->y2-1,
+ &new_x1, &new_y1, &new_x2, &new_y2,
+ adx, ady, &clip1, &clip2,
+ octant, bias, oc1, oc2) == -1)
+ {
+ pbox++;
+ continue;
+ }
+ dashIndexTmp = dashIndex;
+ dashOffsetTmp = dashOffset;
+ if (clip1)
+ {
+ int dlen;
+
+ if (axis == X_AXIS)
+ dlen = abs(new_x1 - x1);
+ else
+ dlen = abs(new_y1 - y1);
+ miStepDash (dlen, &dashIndexTmp, pDash,
+ numInDashList, &dashOffsetTmp);
+ }
+ if (axis == X_AXIS)
+ len = abs(new_x2 - new_x1);
+ else
+ len = abs(new_y2 - new_y1);
+#ifdef POLYSEGMENT
+ if (clip2 != 0 || pGC->capStyle != CapNotLast)
+ len++;
+#else
+ len += (clip2 != 0);
+#endif
+ if (len)
+ {
+ /* unwind bresenham error term to first point */
+ if (clip1)
+ {
+ clipdx = abs(new_x1 - x1);
+ clipdy = abs(new_y1 - y1);
+ if (axis == X_AXIS)
+ err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));
+ else
+ err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));
+ }
+ else
+ err = e;
+ xf4bppBresD (pDrawable, fgink, bgink,
+ &dashIndexTmp, pDash, numInDashList,
+ &dashOffsetTmp, isDoubleDash,
+ addrl, nlwidth,
+ signdx, signdy, axis, new_x1, new_y1,
+ err, e1, e2, len);
+ }
+ pbox++;
+ }
+ } /* while (nbox--) */
+#ifndef POLYSEGMENT
+ /*
+ * walk the dash list around to the next line
+ */
+ miStepDash (unclippedlen, &dashIndex, pDash,
+ numInDashList, &dashOffset);
+dontStep: ;
+#endif
+ } /* while (nline--) */
+
+#ifndef POLYSEGMENT
+ /* paint the last point if the end style isn't CapNotLast.
+ (Assume that a projecting, butt, or round cap that is one
+ pixel wide is the same as the single pixel of the endpoint.)
+ */
+
+ if ((pGC->capStyle != CapNotLast) &&
+ ((dashIndex & 1) == 0 || isDoubleDash) &&
+ ((ppt->x + xorg != pptInit->x + pDrawable->x) ||
+ (ppt->y + yorg != pptInit->y + pDrawable->y) ||
+ (ppt == pptInit + 1)))
+ {
+ nbox = nboxInit;
+ pbox = pboxInit;
+ while (nbox--)
+ {
+ if ((x2 >= pbox->x1) &&
+ (y2 >= pbox->y1) &&
+ (x2 < pbox->x2) &&
+ (y2 < pbox->y2))
+ {
+ unsigned long _mask;
+ int ink;
+
+ ink = fgink;
+ if (dashIndex & 1) ink = bgink;
+ _mask = mask[x2 & PIM];
+ addrl = mfbScanline(addrl, x2, y2, nlwidth);
+ UPDRW(addrl,_mask);
+ break;
+ }
+ else
+ pbox++;
+ }
+ }
+#endif
+}
+
+
+#if 0
+#ifndef POLYSEGMENT
+/*
+ the clipping code could be cleaned up some; most of its
+mess derives from originally being inline in the line code,
+then pulled out to make clipping dashes easier.
+*/
+
+int
+mfbClipLine(pbox, box,
+ ppt1Orig, ppt1, ppt2,
+ adx, ady, signdx, signdy, axis,
+ pclip1, pclip2)
+BoxPtr pbox; /* box to clip to */
+BoxRec box; /* box to do calculations with */
+DDXPointPtr ppt1Orig, ppt1, ppt2;
+int adx, ady;
+int signdx, signdy;
+register int axis;
+int *pclip1, *pclip2;
+{
+ DDXPointRec pt1Orig, pt1, pt2;
+ register int swapped = 0;
+ int clipDone = 0;
+ register unsigned int utmp;
+ register int oc1, oc2;
+ int clip1, clip2;
+
+ pt1Orig = *ppt1Orig;
+ pt1 = *ppt1;
+ pt2 = *ppt2;
+ clip1 = 0;
+ clip2 = 0;
+
+ do
+ {
+ oc1 = 0;
+ oc2 = 0;
+ OUTCODES(oc1, pt1.x, pt1.y, pbox);
+ OUTCODES(oc2, pt2.x, pt2.y, pbox);
+
+ if (oc1 & oc2)
+ clipDone = -1;
+ else if ((oc1 | oc2) == 0)
+ {
+ clipDone = 1;
+ if (swapped)
+ {
+ SWAPPT(pt1, pt2);
+ SWAPINT(oc1, oc2);
+ SWAPINT(clip1, clip2);
+ }
+ }
+ else /* have to clip */
+ {
+ /* only clip one point at a time */
+ if (!oc1)
+ {
+ SWAPPT(pt1, pt2);
+ SWAPINT(oc1, oc2);
+ SWAPINT(clip1, clip2);
+ swapped = !swapped;
+ }
+
+ clip1 |= oc1;
+ if (oc1 & OUT_LEFT)
+ {
+ pt1.x = box.x1;
+ utmp = abs(box.x1 - pt1Orig.x);
+ utmp *= ady;
+ if(axis==X_AXIS)
+ {
+ pt1.y = pt1Orig.y + SignTimes(signdy, round(utmp, adx));
+ }
+ else
+ {
+ utmp <<= 1;
+ if (swapped)
+ utmp += ady;
+ else
+ utmp -= ady;
+ pt1.y = pt1Orig.y + SignTimes(signdy, ceiling(utmp, 2*adx));
+ if (swapped)
+ pt1.y -= signdy;
+ }
+ }
+ else if (oc1 & OUT_ABOVE)
+ {
+ pt1.y = box.y1;
+ utmp = abs(box.y1 - pt1Orig.y);
+ utmp *= adx;
+ if (axis == Y_AXIS)
+ {
+ pt1.x = pt1Orig.x + SignTimes(signdx, round(utmp, ady));
+ }
+ else
+ {
+ utmp <<= 1;
+ if (swapped)
+ utmp += adx;
+ else
+ utmp -= adx;
+ pt1.x = pt1Orig.x + SignTimes(signdx, ceiling(utmp, 2*ady));
+ if (swapped)
+ pt1.x -= signdx;
+ }
+ }
+ else if (oc1 & OUT_RIGHT)
+ {
+ pt1.x = box.x2;
+ utmp = abs(pt1Orig.x - box.x2);
+ utmp *= ady;
+ if (axis == X_AXIS)
+ {
+ pt1.y = pt1Orig.y + SignTimes(signdy, round(utmp, adx));
+ }
+ else
+ {
+ utmp <<= 1;
+ if (swapped)
+ utmp += ady;
+ else
+ utmp -= ady;
+ pt1.y = pt1Orig.y + SignTimes(signdy, ceiling(utmp, 2*adx));
+ if (swapped)
+ pt1.y -= signdy;
+ }
+ }
+ else if (oc1 & OUT_BELOW)
+ {
+ pt1.y = box.y2;
+ utmp = abs(pt1Orig.y - box.y2);
+ utmp *= adx;
+ if (axis == Y_AXIS)
+ {
+ pt1.x = pt1Orig.x + SignTimes(signdx, round(utmp, ady));
+ }
+ else
+ {
+ utmp <<= 1;
+ if (swapped)
+ utmp += adx;
+ else
+ utmp -= adx;
+ pt1.x = pt1Orig.x + SignTimes(signdx, ceiling(utmp, 2*ady));
+ if (swapped)
+ pt1.x -= signdx;
+ }
+ }
+ } /* else have to clip */
+ } while(!clipDone);
+ *ppt1 = pt1;
+ *ppt2 = pt2;
+ *pclip1 = clip1;
+ *pclip2 = clip2;
+
+ return clipDone;
+}
+#endif
+#endif
diff --git a/hw/xfree86/xf4bpp/mfbzerarc.c b/hw/xfree86/xf4bpp/mfbzerarc.c
new file mode 100644
index 000000000..7ca32d903
--- /dev/null
+++ b/hw/xfree86/xf4bpp/mfbzerarc.c
@@ -0,0 +1,266 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbzerarc.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */
+
+/************************************************************
+
+Copyright (c) 1989 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+********************************************************/
+/* GJA -- Took mfb code and modified it. */
+
+/* $XConsortium: mfbzerarc.c /main/4 1996/02/21 17:56:52 kaleb $ */
+
+/* Derived from:
+ * "Algorithm for drawing ellipses or hyperbolae with a digital plotter"
+ * by M. L. V. Pitteway
+ * The Computer Journal, November 1967, Volume 10, Number 3, pp. 282-289
+ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "mi.h"
+#include "mizerarc.h"
+#include "wm3.h"
+
+#include "xf86str.h" /* for pScrn->vtSema */
+extern ScrnInfoPtr *xf86Screens;
+
+/*
+ * Note, LEFTMOST must be the bit leftmost in the actual screen
+ * representation. This depends on both BITMAP_BIT_ORDER and
+ * IMAGE_BYTE_ORDER
+ * DHD 10/92
+ */
+
+#if (BITMAP_BIT_ORDER == MSBFirst)
+#if (IMAGE_BYTE_ORDER == MSBFirst)
+#define LEFTMOST ((unsigned int) 0x80000000)
+#else
+#define LEFTMOST ((unsigned int) 0x80)
+#endif
+#else
+#if (IMAGE_BYTE_ORDER == LSBFirst)
+#define LEFTMOST ((unsigned int) 1)
+#else
+#define LEFTMOST ((unsigned int) 0x1000000)
+#endif
+#endif
+
+#define PixelateWhite(addr,off) \
+{ \
+ register int *tmpaddr = &((addr)[(off)>>PWSH]); \
+ UPDRW(tmpaddr,SCRRIGHT (LEFTMOST, ((off) & PIM))); \
+}
+#define PixelateBlack(addr,off) \
+{ \
+ register int *tmpaddr = &((addr)[(off)>>PWSH]); \
+ UPDRW(tmpaddr,~(SCRRIGHT (LEFTMOST, ((off) & PIM)))); \
+}
+
+#define Pixelate(base,off) \
+{ \
+ paddr = base + ((off)>>PWSH); \
+ pmask = SCRRIGHT(LEFTMOST, (off) & PIM); \
+ UPDRW(paddr,(pixel & pmask)); \
+}
+
+#define DoPix(bit,base,off) if (msk & bit) Pixelate(base,off);
+
+static void
+v16ZeroArcSS
+(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ xArc *arc
+)
+{
+ miZeroArcRec info;
+ Bool do360;
+ register int x, y, a, b, d, msk;
+ register int k1, k3, dx, dy;
+ int *addrl;
+ int *yorgl, *yorgol;
+ unsigned long pixel;
+ int nlwidth, yoffset, dyoffset;
+ int pmask;
+ register int *paddr;
+
+ if (((mfbPrivGC *)(pGC->devPrivates[mfbGCPrivateIndex].ptr))->rop ==
+ RROP_BLACK)
+ pixel = 0;
+ else
+ pixel = ~0UL;
+
+ if (pDraw->type == DRAWABLE_WINDOW)
+ {
+ addrl = (int *)
+ (((PixmapPtr)(pDraw->pScreen->devPrivate))->devPrivate.ptr);
+ nlwidth = (int)
+ (((PixmapPtr)(pDraw->pScreen->devPrivate))->devKind) >> 2;
+ }
+ else
+ {
+ addrl = (int *)(((PixmapPtr)pDraw)->devPrivate.ptr);
+ nlwidth = (int)(((PixmapPtr)pDraw)->devKind) >> 2;
+ }
+
+ do360 = miZeroArcSetup(arc, &info, TRUE);
+ yorgl = addrl + ((info.yorg + pDraw->y) * nlwidth);
+ yorgol = addrl + ((info.yorgo + pDraw->y) * nlwidth);
+ info.xorg += pDraw->x;
+ info.xorgo += pDraw->x;
+ MIARCSETUP();
+ yoffset = y ? nlwidth : 0;
+ dyoffset = 0;
+ msk = info.initialMask;
+ if (!(arc->width & 1))
+ {
+ DoPix(2, yorgl, info.xorgo);
+ DoPix(8, yorgol, info.xorgo);
+ }
+ if (!info.end.x || !info.end.y)
+ {
+ msk = info.end.mask;
+ info.end = info.altend;
+ }
+ if (do360 && (arc->width == arc->height) && !(arc->width & 1))
+ {
+ int xoffset = nlwidth;
+ int *yorghl = yorgl + (info.h * nlwidth);
+ int xorghp = info.xorg + info.h;
+ int xorghn = info.xorg - info.h;
+
+ while (1)
+ {
+ PixelateWhite(yorgl + yoffset, info.xorg + x);
+ PixelateWhite(yorgl + yoffset, info.xorg - x);
+ PixelateWhite(yorgol- yoffset, info.xorg - x);
+ PixelateWhite(yorgol - yoffset, info.xorg + x);
+ if (a < 0)
+ break;
+ PixelateWhite(yorghl - xoffset, xorghp - y);
+ PixelateWhite(yorghl - xoffset, xorghn + y);
+ PixelateWhite(yorghl + xoffset, xorghn + y);
+ PixelateWhite(yorghl + xoffset, xorghp - y);
+ xoffset += nlwidth;
+ MIARCCIRCLESTEP(yoffset += nlwidth;);
+ }
+ x = info.w;
+ yoffset = info.h * nlwidth;
+ }
+ else if (do360)
+ {
+ while (y < info.h || x < info.w)
+ {
+ MIARCOCTANTSHIFT(dyoffset = nlwidth;);
+ Pixelate(yorgl + yoffset, info.xorg + x);
+ Pixelate(yorgl + yoffset, info.xorgo - x);
+ Pixelate(yorgol - yoffset, info.xorgo - x);
+ Pixelate(yorgol - yoffset, info.xorg + x);
+ MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
+ }
+ }
+ else
+ {
+ while (y < info.h || x < info.w)
+ {
+ MIARCOCTANTSHIFT(dyoffset = nlwidth;);
+ if ((x == info.start.x) || (y == info.start.y))
+ {
+ msk = info.start.mask;
+ info.start = info.altstart;
+ }
+ DoPix(1, yorgl + yoffset, info.xorg + x);
+ DoPix(2, yorgl + yoffset, info.xorgo - x);
+ DoPix(4, yorgol - yoffset, info.xorgo - x);
+ DoPix(8, yorgol - yoffset, info.xorg + x);
+ if ((x == info.end.x) || (y == info.end.y))
+ {
+ msk = info.end.mask;
+ info.end = info.altend;
+ }
+ MIARCSTEP(yoffset += dyoffset;, yoffset += nlwidth;);
+ }
+ }
+ if ((x == info.start.x) || (y == info.start.y))
+ msk = info.start.mask;
+ DoPix(1, yorgl + yoffset, info.xorg + x);
+ DoPix(4, yorgol - yoffset, info.xorgo - x);
+ if (arc->height & 1)
+ {
+ DoPix(2, yorgl + yoffset, info.xorgo - x);
+ DoPix(8, yorgol - yoffset, info.xorg + x);
+ }
+}
+
+static void
+xf4bppZeroPolyArcSS
+(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+)
+{
+ register xArc *arc;
+ register int i;
+ BoxRec box;
+ RegionPtr cclip;
+
+ if (!pGC->planemask & 0x0F)
+ return;
+ cclip = pGC->pCompositeClip;
+ for (arc = parcs, i = narcs; --i >= 0; arc++)
+ {
+ if (miCanZeroArc(arc))
+ {
+ box.x1 = arc->x + pDraw->x;
+ box.y1 = arc->y + pDraw->y;
+ box.x2 = box.x1 + (int)arc->width + 1;
+ box.y2 = box.y1 + (int)arc->height + 1;
+ if (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN)
+ v16ZeroArcSS(pDraw, pGC, arc);
+ else
+ miZeroPolyArc(pDraw, pGC, 1, arc);
+ }
+ else
+ miPolyArc(pDraw, pGC, 1, arc);
+ }
+}
+
+void
+xf4bppZeroPolyArc(pDraw, pGC, narcs, parcs)
+ DrawablePtr pDraw;
+ GCPtr pGC;
+ int narcs;
+ xArc *parcs;
+{
+ if ( !xf86Screens[pDraw->pScreen->myNum]->vtSema ) {
+ miZeroPolyArc(pDraw, pGC, narcs, parcs);
+ } else {
+ DO_WM3(pGC,xf4bppZeroPolyArcSS(pDraw, pGC, narcs, parcs));
+ }
+}
diff --git a/hw/xfree86/xf4bpp/offscreen.c b/hw/xfree86/xf4bpp/offscreen.c
new file mode 100644
index 000000000..1d118863f
--- /dev/null
+++ b/hw/xfree86/xf4bpp/offscreen.c
@@ -0,0 +1,359 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/offscreen.c,v 1.5 2001/08/01 00:44:56 tsi Exp $ */
+/*
+ * Copyright 1993 Gerrit Jan Akkerman
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Gerrit Jan Akkerman not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * GERRIT JAN AKKERMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+ * IN NO EVENT SHALL GERRIT JAN AKKERMAN 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.
+ *
+*/
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: offscreen.c /main/4 1996/02/21 17:56:55 kaleb $ */
+
+#include "xf4bpp.h"
+#include "vgaVideo.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+
+#define saved_screen(pWin) \
+ ((unsigned char *)(((PixmapPtr)((pWin)->drawable.pScreen->devPrivate))->devPrivate.ptr))
+
+#define SAVEDSCREEN(pWin, x, y) \
+ (*(saved_screen(pWin) + (y) * (BYTES_PER_LINE(pWin)) + (x)))
+
+#define DO_ROP(src,dst,alu,planes) \
+ ((dst) = do_rop((src),(dst),(alu),(planes)))
+
+/* NOTE:
+ * The following to functions don't do anything. They're just there to
+ * provide a stable interface to the rest of the system.
+ */
+
+static int
+do_rop
+(
+ int src,
+ int dst,
+ int alu,
+ const unsigned long planes
+)
+{
+ int _dst; /* New dst */
+
+ switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ _dst = 0; break ;
+ case GXinvert: /* 0xa NOT dst */
+ _dst = ~dst; break ;
+ case GXset: /* 0xf 1 */
+ _dst = src; break ;
+ default:
+ case GXnoop: /* 0x5 dst */
+ return dst;
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ _dst = ~src & ~dst; break ;
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ _dst = ~src & dst; break ;
+ case GXand: /* 0x1 src AND dst */
+ _dst = src & dst; break ;
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ _dst = ~src ^ dst; break ;
+ case GXxor: /* 0x6 src XOR dst */
+ _dst = src ^ dst; break ;
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ _dst = src & ~dst; break ;
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ _dst = ~src | ~dst; break ;
+ case GXorReverse: /* 0xb src OR NOT dst */
+ _dst = src | ~dst; break ;
+ case GXorInverted: /* 0xd NOT src OR dst */
+ _dst = ~src | dst; break ;
+ case GXor: /* 0x7 src OR dst */
+ _dst = src | dst; break ;
+ case GXcopyInverted: /* 0xc NOT src */
+ _dst = ~src; break ;
+ case GXcopy: /* 0x3 src */
+ _dst = src; break ;
+ }
+ return (dst & ~planes) | (_dst & planes);
+}
+
+/* File vgaBitBlt.c */
+void
+xf4bppOffBitBlt( pWin, alu, writeplanes, x0, y0, x1, y1, w, h )
+WindowPtr pWin; /* GJA */
+const int alu, writeplanes ;
+register int x0 ;
+int y0 ;
+register int x1 ;
+int y1 ;
+register int w, h ;
+{
+ int x,y;
+
+ switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ case GXinvert: /* 0xa NOT dst */
+ case GXset: /* 0xf 1 */
+ xf4bppOffFillSolid( pWin, VGA_ALLPLANES, alu, writeplanes,
+ x0, y0, w, h ) ;
+ case GXnoop: /* 0x5 dst */
+ return ;
+ default:
+ break ;
+ }
+
+ if ( (w <= 0) || (h <= 0) ) return;
+
+ for ( y = 0 ; y < h ; y++ ) {
+ for ( x = 0 ; x < w ; x++ ) {
+ DO_ROP(SAVEDSCREEN(pWin,x0+x,y0+y),SAVEDSCREEN(pWin,x1+x,y1+y),
+ alu,writeplanes);
+ }
+ }
+}
+
+/* for file vgaImages.c */
+
+void
+xf4bppOffDrawColorImage( pWin, x, y, w, h, data, RowIncrement, alu, planes )
+WindowPtr pWin; /* GJA */
+int x, y ;
+register int w, h ;
+unsigned char *data ;
+register int RowIncrement ;
+const int alu ;
+const unsigned long int planes ;
+{
+ int dx,dy;
+
+ for ( dy = 0 ; dy < h ; dy++ ) {
+ for ( dx = 0 ; dx < w ; dx++ ) {
+ DO_ROP( data[dy * RowIncrement + dx],
+ SAVEDSCREEN(pWin,x+dx,y+dy), alu, planes);
+ }
+ }
+}
+
+void
+xf4bppOffReadColorImage( pWin, x, y, lx, ly, data, RowIncrement )
+WindowPtr pWin; /* GJA */
+int x, y ;
+int lx, ly ;
+unsigned char *data ;
+int RowIncrement ;
+{
+ int dx, dy;
+
+ if ( ( lx <= 0 ) || ( ly <= 0 ) )
+ return ;
+
+ for ( dy = 0 ; dy < ly ; dy++ ) {
+ for ( dx = 0 ; dx < lx ; dx++ ) {
+ data[dy*RowIncrement+dx] = SAVEDSCREEN(pWin,x+dx,y+dy);
+ }
+ }
+}
+
+/* For file vgaSolid.c */
+
+void xf4bppOffFillSolid( pWin, color, alu, planes, x0, y0, lx, ly )
+WindowPtr pWin; /* GJA */
+unsigned long int color ;
+const int alu ;
+unsigned long int planes ;
+register int x0 ;
+register const int y0 ;
+register int lx ;
+register const int ly ; /* MUST BE > 0 !! */
+{
+ int dx, dy;
+
+ if ( ( lx == 0 ) || ( ly == 0 ) )
+ return;
+
+ for ( dy = 0 ; dy < ly ; dy++ ) {
+ for ( dx = 0 ; dx < lx ; dx++ ) {
+ DO_ROP(color,SAVEDSCREEN(pWin, x0+dx,y0+dy),alu,planes);
+ }
+ }
+}
+
+/* For file vgaStipple.c */
+
+/* GJA -- modified this to take both Width and Height, and to
+ * reduce x and y to Width and Height by taking remainders.
+ */
+static unsigned char
+xygetbits
+(
+ register int x,
+ register int y,
+ register const unsigned int Width,
+ register const unsigned int paddedByteWidth,
+ register const unsigned int Height,
+ register const unsigned char * const data
+)
+{
+ register unsigned char bits ;
+ unsigned const char *lineptr, *cptr ;
+ register int shift ;
+ register int wrap ;
+
+ x = x % Width;
+ y = y % Height;
+
+ lineptr = data + (y * paddedByteWidth);
+ cptr = lineptr + (x >> 3) ;
+ bits = *cptr ;
+ if ((shift = x & 7))
+ bits = SCRLEFT8( bits, shift ) |
+ SCRRIGHT8( cptr[1], ( 8 - shift ) ) ;
+ if ( ( wrap = x + 8 - Width ) > 0 ) {
+ bits &= SCRLEFT8( 0xFF, wrap ) ;
+ bits |= SCRRIGHT8( *lineptr, ( 8 - wrap ) ) ;
+ }
+
+ return bits ;
+}
+
+static void
+DoMono
+(
+ WindowPtr pWin, /* GJA */
+ int w,
+ int x,
+ int y,
+ register const unsigned char *mastersrc,
+ int h,
+ unsigned int width,
+ register unsigned int paddedByteWidth,
+ unsigned int height,
+ int xshift,
+ int yshift,
+ int alu,
+ int planes,
+ int fg
+)
+{
+ int dy, dx, i;
+ int byte;
+
+ for ( dy = 0 ; dy < h ; dy++ ) {
+ for ( dx = 0; dx <= w - 8 ; dx += 8 ) {
+ /* get next byte */
+ byte = xygetbits(dx+xshift,dy+yshift,width,
+ paddedByteWidth, height, mastersrc);
+ for ( i = 0 ; i < 8 ; i++ ) {
+ if ( byte & (128 >> i) ) {
+ DO_ROP(fg,SAVEDSCREEN(pWin,x+dx+i,y+dy),
+ alu,planes);
+ }
+ }
+ }
+ /* get last bits */
+ byte = xygetbits(dx+xshift,dy+yshift,width,
+ paddedByteWidth, height, mastersrc);
+ for ( i = 0 ; i < (w - dx) ; i++ ) {
+ if ( byte & (128 >> i) ) {
+ DO_ROP(fg,SAVEDSCREEN(pWin,x+dx+i,y+dy),
+ alu,planes);
+ }
+ }
+ }
+}
+
+void
+xf4bppOffDrawMonoImage( pWin, data, x, y, w, h, fg, alu, planes )
+WindowPtr pWin; /* GJA */
+unsigned char *data;
+int x, y, w, h ;
+unsigned long int fg ;
+int alu ;
+unsigned long int planes;
+{
+
+ if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
+ return ;
+
+ DoMono( pWin, w, x, y, (const unsigned char *) data, h,
+ w, ( ( w + 31 ) & ~31 ) >> 3, h, 0, 0, alu,
+ (int)planes, (int)fg) ;
+
+}
+
+void
+xf4bppOffFillStipple( pWin, pStipple, fg, alu, planes, x, y, w, h, xSrc, ySrc )
+WindowPtr pWin; /* GJA */
+register PixmapPtr const pStipple ;
+unsigned long int fg ;
+const int alu ;
+unsigned long int planes ;
+int x, y, w, h ;
+const int xSrc, ySrc ;
+{
+ unsigned int width ;
+ unsigned int height ;
+ int xshift ;
+ int yshift ;
+
+ if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
+ return ;
+
+ /* Figure Bit Offsets & Source Address */
+ width = pStipple->drawable.width ;
+ if ( ( xshift = ( x - xSrc ) ) < 0 )
+ xshift = width - ( ( - xshift ) % width ) ;
+ else
+ xshift %= width ;
+
+ height = pStipple->drawable.height ;
+ if ( ( yshift = ( y - ySrc ) ) < 0 )
+ yshift = height - ( ( - yshift ) % height ) ;
+ else
+ yshift %= height ;
+
+ DoMono( pWin, w, x, y,
+ (const unsigned char *) pStipple->devPrivate.ptr,
+ h,
+ width,
+ ( ( width + 31 ) & (unsigned)(~31) ) >> 3,
+ height,
+ xshift, yshift,
+ alu, (int)planes, (int)fg ) ;
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcArea.c b/hw/xfree86/xf4bpp/ppcArea.c
new file mode 100644
index 000000000..40e9d5b32
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcArea.c
@@ -0,0 +1,95 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcArea.c,v 1.4 2003/02/18 21:29:59 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: ppcArea.c /main/4 1996/02/21 17:57:02 kaleb $ */
+
+/*
+ * ppc solid area fill
+ *
+ * Tom Paquin 8/87
+ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "ppcGCstr.h"
+#include "ibmTrace.h"
+
+void
+xf4bppFillArea( pWin, nboxes, pBox, pGC )
+ register WindowPtr pWin ;
+ register int nboxes ;
+ register BoxPtr pBox ;
+ GCPtr pGC ;
+{
+register int x, y, w, h ;
+int alu ;
+unsigned long int fg, bg, pm ;
+int xSrc, ySrc ;
+PixmapPtr pPixmap ;
+ppcPrivGC *pPrivGC = pGC->devPrivates[mfbGCPrivateIndex].ptr;
+
+TRACE( ( "xf4bppFillArea(0x%x,%d,0x%x,0x%x)\n", pWin, nboxes, pBox, pGC ) ) ;
+
+if ( ( alu = pPrivGC->colorRrop.alu ) == GXnoop || !nboxes )
+ return ;
+
+xSrc = pGC->patOrg.x + pWin->drawable.x ;
+ySrc = pGC->patOrg.y + pWin->drawable.y ;
+
+pm = pPrivGC->colorRrop.planemask ;
+fg = pPrivGC->colorRrop.fgPixel ;
+bg = pPrivGC->colorRrop.bgPixel ;
+
+nboxes++ ;
+switch ( pPrivGC->colorRrop.fillStyle ) {
+ case FillTiled:
+ for ( pPixmap = pGC->tile.pixmap ; --nboxes ; pBox++ )
+ if ( ( w = pBox->x2 - ( x = pBox->x1 ) )
+ && ( h = pBox->y2 - ( y = pBox->y1 ) ) )
+ xf4bppTileRect( pWin, pPixmap, alu, pm,
+ x, y, w, h, xSrc, ySrc ) ;
+ break ;
+ case FillOpaqueStippled:
+ for ( pPixmap = pGC->stipple ; --nboxes ; pBox++ )
+ if ( ( w = pBox->x2 - ( x = pBox->x1 ) )
+ && ( h = pBox->y2 - ( y = pBox->y1 ) ) )
+ xf4bppOpaqueStipple( pWin, pPixmap, fg, bg, alu, pm,
+ x, y, w, h, xSrc, ySrc ) ;
+ break ;
+ case FillStippled:
+ for ( pPixmap = pGC->stipple ; --nboxes ; pBox++ )
+ if ( ( w = pBox->x2 - ( x = pBox->x1 ) )
+ && ( h = pBox->y2 - ( y = pBox->y1 ) ) )
+ xf4bppFillStipple( pWin, pPixmap, fg, alu, pm,
+ x, y, w, h, xSrc, ySrc ) ;
+ break ;
+ case FillSolid:
+ for ( ; --nboxes ; pBox++ )
+ if ( ( w = pBox->x2 - ( x = pBox->x1 ) )
+ && ( h = pBox->y2 - ( y = pBox->y1 ) ) )
+ xf4bppFillSolid( pWin, fg, alu, pm, x, y, w, h ) ;
+ break ;
+}
+
+}
diff --git a/hw/xfree86/xf4bpp/ppcBStore.c b/hw/xfree86/xf4bpp/ppcBStore.c
new file mode 100644
index 000000000..a1f49a486
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcBStore.c
@@ -0,0 +1,153 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcBStore.c,v 1.3 1999/06/06 08:48:57 dawes Exp $ */
+/*
+
+Copyright (c) 1987 X Consortium
+
+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 X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the X Consortium.
+
+
+Copyright IBM Corporation 1987,1988,1989
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM 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.
+
+
+Copyright 1987 by the Regents of the University of California
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+*/
+/* $XConsortium: ppcBStore.c /main/5 1996/02/21 17:57:06 kaleb $ */
+
+#include "xf4bpp.h"
+#include "vgaVideo.h"
+#include "ibmTrace.h"
+
+/*-----------------------------------------------------------------------
+ * xf4bppSaveAreas --
+ * Function called by miSaveAreas to actually fetch the areas to be
+ * saved into the backing pixmap.
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * Data are copied from the screen into the pixmap.
+ *
+ *-----------------------------------------------------------------------
+ */
+void
+xf4bppSaveAreas( pPixmap, prgnSave, xorg, yorg, pWin )
+ register PixmapPtr pPixmap ; /* Backing pixmap */
+ RegionPtr prgnSave ; /* Region to save (pixmap-relative) */
+ int xorg ; /* X origin of region */
+ int yorg ; /* Y origin of region */
+ WindowPtr pWin;
+{
+ register BoxPtr pBox ;
+ register int nBox ;
+
+ TRACE( ( "xf4bppSaveAreas(0x%x,0x%x,%d,%d)\n",
+ pPixmap, prgnSave, xorg, yorg ) ) ;
+/* WHOOP WHOOP WHOOP XXX -- depth 8 *only* */ /* GJA -- ? */
+
+ if ( !( nBox = REGION_NUM_RECTS(prgnSave) ) )
+ return ;
+
+ for ( pBox = REGION_RECTS(prgnSave) ; nBox-- ; pBox++ )
+ xf4bppReadColorImage( pWin, pBox->x1 + xorg,
+ pBox->y1 + yorg,
+ pBox->x2 - pBox->x1,
+ pBox->y2 - pBox->y1,
+ ( (unsigned char *) pPixmap->devPrivate.ptr )
+ + ( pBox->y1 * pPixmap->devKind ) + pBox->x1,
+ pPixmap->devKind ) ;
+
+ return ;
+}
+
+/*-----------------------------------------------------------------------
+ * xf4bppRestoreAreas --
+ * Function called by miRestoreAreas to actually fetch the areas to be
+ * restored from the backing pixmap.
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * Data are copied from the pixmap into the screen.
+ *
+ *-----------------------------------------------------------------------
+ */
+void
+xf4bppRestoreAreas( pPixmap, prgnRestore, xorg, yorg, pWin )
+ register PixmapPtr pPixmap ; /* Backing pixmap */
+ RegionPtr prgnRestore ; /* Region to restore (screen-relative)*/
+ int xorg ; /* X origin of window */
+ int yorg ; /* Y origin of window */
+ WindowPtr pWin;
+{
+ register BoxPtr pBox ;
+ register int nBox ;
+
+ TRACE( ( "xf4bppRestoreAreas(0x%x,0x%x,%d,%d)\n",
+ pPixmap, prgnRestore, xorg, yorg ) ) ;
+/* WHOOP WHOOP WHOOP XXX -- depth 8 *only* */
+
+ if ( !( nBox = REGION_NUM_RECTS(prgnRestore) ) )
+ return ;
+ for ( pBox = REGION_RECTS(prgnRestore) ; nBox-- ; pBox++ )
+ xf4bppDrawColorImage( pWin, pBox->x1,
+ pBox->y1,
+ pBox->x2 - pBox->x1,
+ pBox->y2 - pBox->y1,
+ ( (unsigned char *)pPixmap->devPrivate.ptr )
+ + ( ( pBox->y1 - yorg ) * pPixmap->devKind )
+ + ( pBox->x1 - xorg ),
+ pPixmap->devKind,
+ GXcopy, VGA_ALLPLANES ) ;
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcCReduce.c b/hw/xfree86/xf4bpp/ppcCReduce.c
new file mode 100644
index 000000000..a68f5faff
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcCReduce.c
@@ -0,0 +1,236 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcCReduce.c,v 1.3 1999/06/06 08:48:58 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/* $XConsortium: ppcCReduce.c /main/3 1996/02/21 17:57:17 kaleb $ */
+
+#include "xf4bpp.h"
+#include "ppcGCstr.h"
+
+/* xf4bppGetReducedColorRrop( pGC, drawableDepth, returnLoc )
+ * An attempt to do "strength reduction" on color raster-ops
+ * P. Shupak 1/88
+ */
+
+static void
+ppcReduceGeneral
+(
+ register int alu,
+ register unsigned long pm,
+ register unsigned long fg,
+ register unsigned long bg,
+ register int fillStyle,
+ int drawableDepth,
+ ppcReducedRrop *returnLoc
+)
+{
+
+if ( ( alu == GXnoop )
+ || !( pm &= ( ( 1 << drawableDepth ) - 1 ) ) ) {
+ returnLoc->alu = GXnoop ;
+ return ;
+}
+
+#ifdef DELETE_THIS
+switch ( fillStyle ) {
+ case FillTiled:
+ switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ case GXinvert: /* 0xa NOT dst */
+ case GXset: /* 0xf 1 */
+ fillStyle = FillSolid ;
+ default: /* We Can't Do Much Here */
+ break ;
+ }
+ break ;
+ case FillOpaqueStippled:
+ if ( ( fg & pm ) != ( bg & pm ) ) { /* else FillSolid */
+ switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ case GXset: /* 0xf 1 */
+ case GXinvert: /* 0xa NOT dst */
+ fillStyle = FillSolid ;
+ break ;
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ case GXcopy: /* 0x3 src */
+ break ;
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ fg = ~fg ;
+ bg = ~bg ;
+ alu = GXnor ;
+ break ;
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ fg = ~fg ;
+ bg = ~bg ;
+ alu = GXand ; /* Fall Through */
+ case GXand: /* 0x1 src AND dst */
+ pm &= ~( fg & bg ) ;
+ if ( ( bg & pm ) == pm ) {
+ fillStyle = FillStippled ;
+ alu = GXclear ;
+ }
+ break ;
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ fg = ~fg ;
+ bg = ~bg ;
+ alu = GXxor ; /* Fall Through */
+ case GXxor: /* 0x6 src XOR dst */
+ pm &= ( fg | bg ) ;
+ if ( !( bg & pm ) ) {
+ fillStyle = FillStippled ;
+ alu = GXinvert ;
+ }
+ break ;
+ case GXorReverse: /* 0xb src OR NOT dst */
+ fg = ~fg ;
+ bg = ~bg ;
+ alu = GXnand ;
+ break ;
+ case GXcopyInverted: /* 0xc NOT src */
+ fg = ~fg ;
+ bg = ~bg ;
+ alu = GXcopy ;
+ break ;
+ case GXorInverted: /* 0xd NOT src OR dst */
+ fg = ~fg ;
+ bg = ~bg ;
+ alu = GXor ; /* Fall Through */
+ case GXor: /* 0x7 src OR dst */
+ pm &= ( fg | bg ) ;
+ if ( !( bg & pm ) ) {
+ fillStyle = FillStippled ;
+ alu = GXset ;
+ }
+ break ;
+ default:
+ ErrorF(
+ "xf4bppGetReducedColorRrop: Unknown Alu Raster-Op" ) ;
+ break ;
+ }
+ break ; /* Don't Fall Through */
+ }
+ else
+ fillStyle = FillSolid ;
+ /* Fall Through */
+ case FillStippled:
+ case FillSolid:
+ switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ case GXset: /* 0xf 1 */
+ case GXinvert: /* 0xa NOT dst */
+ break ;
+ case GXand: /* 0x1 src AND dst */
+ pm &= ~fg ;
+ alu = GXclear ;
+ break ;
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ fg = ~fg ;
+ alu = GXnor ; /* Fall Through */
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ if ( !( fg & pm ) )
+ alu = GXclear ;
+ else if ( ( fg & pm ) == pm )
+ alu = GXinvert ;
+ break ;
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ pm &= fg ;
+ alu = GXclear ;
+ break ;
+ case GXxor: /* 0x6 src XOR dst */
+ pm &= fg ;
+ alu = GXinvert ;
+ break ;
+ case GXor: /* 0x7 src OR dst */
+ pm &= fg ;
+ alu = GXset ;
+ break ;
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ pm &= ~fg ;
+ alu = GXinvert ;
+ break ;
+ case GXorReverse: /* 0xb src OR NOT dst */
+ fg = ~fg ;
+ alu = GXnand ; /* Fall Through */
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ if ( !( fg & pm ) )
+ alu = GXset ;
+ else if ( ( fg & pm ) == pm )
+ alu = GXinvert ;
+ break ;
+ case GXcopyInverted: /* 0xc NOT src */
+ fg = ~fg ;
+ alu = GXcopy ; /* Fall Through */
+ case GXcopy: /* 0x3 src */
+ if ( !( fg & pm ) )
+ alu = GXclear ;
+ else if ( ( fg & pm ) == pm )
+ alu = GXset ;
+ break ;
+ case GXorInverted: /* 0xd NOT src OR dst */
+ pm &= ~fg ;
+ alu = GXset ;
+ break ;
+ default:
+ ErrorF(
+ "xf4bppGetReducedColorRrop: Unknown Alu Raster-Op" ) ;
+ break ;
+ }
+ break;
+ default:
+ ErrorF("xf4bppGetReducedColorRrop: Bad Fillstyle\n");
+ break;
+}
+#endif
+
+/* Final Test On Restricted Plane Mask */
+if ( !pm )
+ alu = GXnoop ;
+
+/* Set Actual Returned Values */
+returnLoc->planemask = pm ;
+returnLoc->fgPixel = fg ;
+returnLoc->bgPixel = bg ;
+returnLoc->alu = alu ;
+returnLoc->fillStyle = fillStyle ;
+
+return ;
+}
+
+void
+xf4bppGetReducedColorRrop( pGC, drawableDepth, returnLoc )
+GC *pGC ;
+int drawableDepth ;
+ppcReducedRrop *returnLoc ;
+{
+
+ppcReduceGeneral( pGC->alu,
+ pGC->planemask,
+ pGC->fgPixel,
+ pGC->bgPixel,
+ pGC->fillStyle,
+ drawableDepth,
+ returnLoc ) ;
+
+return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcClip.c b/hw/xfree86/xf4bpp/ppcClip.c
new file mode 100644
index 000000000..cd307fe94
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcClip.c
@@ -0,0 +1,153 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcClip.c,v 1.5 1999/09/25 14:38:16 dawes Exp $ */
+/*
+
+Copyright (c) 1987 X Consortium
+
+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 X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the X Consortium.
+
+
+Copyright IBM Corporation 1987,1988,1989
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM 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.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+*/
+/* $XConsortium: ppcClip.c /main/4 1996/02/21 17:57:21 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "scrnintstr.h"
+
+void
+xf4bppDestroyClip(pGC)
+ GCPtr pGC;
+{
+ if(pGC->clientClipType == CT_NONE)
+ return;
+ else if (pGC->clientClipType == CT_PIXMAP)
+ {
+ mfbDestroyPixmap((PixmapPtr)(pGC->clientClip));
+ }
+ else
+ {
+ /* we know we'll never have a list of rectangles, since
+ ChangeClip immediately turns them into a region
+ */
+ REGION_DESTROY(pGC->pScreen, pGC->clientClip);
+ }
+ pGC->clientClip = NULL;
+ pGC->clientClipType = CT_NONE;
+}
+
+void
+xf4bppChangeClip(pGC, type, pvalue, nrects)
+ GCPtr pGC;
+ int type;
+ pointer pvalue;
+ int nrects;
+{
+ xf4bppDestroyClip(pGC);
+ if(type == CT_PIXMAP)
+ {
+ /* convert the pixmap to a region */
+ pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr)pvalue);
+ /* you wouldn't do this if you were leaving the pixmap in
+ rather than converting it.
+ */
+ (*pGC->pScreen->DestroyPixmap)(pvalue);
+ }
+ else if (type == CT_REGION)
+ {
+ /* stuff the region in the GC */
+ pGC->clientClip = pvalue;
+ }
+ else if (type != CT_NONE)
+ {
+ pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nrects,
+ (xRectangle *)pvalue,
+ type);
+ xfree(pvalue);
+ }
+ pGC->clientClipType = (type != CT_NONE && pGC->clientClip) ? CT_REGION :
+ CT_NONE;
+ pGC->stateChanges |= GCClipMask;
+}
+
+void
+xf4bppCopyClip (pgcDst, pgcSrc)
+ GCPtr pgcDst, pgcSrc;
+{
+ RegionPtr prgnNew;
+
+ switch(pgcSrc->clientClipType)
+ {
+ case CT_PIXMAP:
+ ((PixmapPtr) pgcSrc->clientClip)->refcnt++;
+ /* Fall through !! */
+ case CT_NONE:
+ xf4bppChangeClip(pgcDst, pgcSrc->clientClipType, pgcSrc->clientClip, 0);
+ break;
+ case CT_REGION:
+ prgnNew = REGION_CREATE(pgcSrc->pScreen, NULL, 1);
+ REGION_COPY(pgcSrc->pScreen, prgnNew, (RegionPtr)(pgcSrc->clientClip));
+ xf4bppChangeClip(pgcDst, CT_REGION, (pointer)prgnNew, 0);
+ break;
+ }
+}
diff --git a/hw/xfree86/xf4bpp/ppcCpArea.c b/hw/xfree86/xf4bpp/ppcCpArea.c
new file mode 100644
index 000000000..e5202c267
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcCpArea.c
@@ -0,0 +1,494 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcCpArea.c,v 1.5 2000/09/26 15:57:21 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/* $XConsortium: ppcCpArea.c /main/6 1996/02/21 17:57:24 kaleb $ */
+
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#define PSZ 8
+#include "cfb.h"
+#include "cfbmskbits.h"
+#include "mergerop.h"
+#include "mi.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+
+/*
+ * Graft in the DoBitblt from cfb. It does everything correctly.
+ */
+static void
+vga16DoBitblt
+(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int alu,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask
+)
+{
+ CARD32 *psrcBase, *pdstBase;
+ /* start of src and dst bitmaps */
+ int widthSrc, widthDst; /* add to get to same position in next line */
+
+ BoxPtr pbox;
+ int nbox;
+
+ BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
+ /* temporaries for shuffling rectangles */
+ DDXPointPtr pptTmp, pptNew1, pptNew2;
+ /* shuffling boxes entails shuffling the
+ source points too */
+ int w, h;
+ int xdir; /* 1 = left right, -1 = right left/ */
+ int ydir; /* 1 = top down, -1 = bottom up */
+
+ MROP_DECLARE_REG()
+
+ int careful;
+
+ MROP_INITIALIZE(alu,planemask);
+
+ cfbGetLongWidthAndPointer (pSrc, widthSrc, psrcBase)
+
+ cfbGetLongWidthAndPointer (pDst, widthDst, pdstBase)
+
+ /* XXX we have to err on the side of safety when both are windows,
+ * because we don't know if IncludeInferiors is being used.
+ */
+ careful = ((pSrc == pDst) ||
+ ((pSrc->type == DRAWABLE_WINDOW) &&
+ (pDst->type == DRAWABLE_WINDOW)));
+
+ pbox = REGION_RECTS(prgnDst);
+ nbox = REGION_NUM_RECTS(prgnDst);
+
+ pboxNew1 = NULL;
+ pptNew1 = NULL;
+ pboxNew2 = NULL;
+ pptNew2 = NULL;
+ if (careful && (pptSrc->y < pbox->y1))
+ {
+ /* walk source botttom to top */
+ ydir = -1;
+ widthSrc = -widthSrc;
+ widthDst = -widthDst;
+
+ if (nbox > 1)
+ {
+ /* keep ordering in each band, reverse order of bands */
+ pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ if(!pboxNew1)
+ return;
+ pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if(!pptNew1)
+ {
+ DEALLOCATE_LOCAL(pboxNew1);
+ return;
+ }
+ pboxBase = pboxNext = pbox+nbox-1;
+ while (pboxBase >= pbox)
+ {
+ while ((pboxNext >= pbox) &&
+ (pboxBase->y1 == pboxNext->y1))
+ pboxNext--;
+ pboxTmp = pboxNext+1;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp <= pboxBase)
+ {
+ *pboxNew1++ = *pboxTmp++;
+ *pptNew1++ = *pptTmp++;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew1 -= nbox;
+ pbox = pboxNew1;
+ pptNew1 -= nbox;
+ pptSrc = pptNew1;
+ }
+ }
+ else
+ {
+ /* walk source top to bottom */
+ ydir = 1;
+ }
+
+ if (careful && (pptSrc->x < pbox->x1))
+ {
+ /* walk source right to left */
+ xdir = -1;
+
+ if (nbox > 1)
+ {
+ /* reverse order of rects in each band */
+ pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if(!pboxNew2 || !pptNew2)
+ {
+ if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
+ if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
+ if (pboxNew1)
+ {
+ DEALLOCATE_LOCAL(pptNew1);
+ DEALLOCATE_LOCAL(pboxNew1);
+ }
+ return;
+ }
+ pboxBase = pboxNext = pbox;
+ while (pboxBase < pbox+nbox)
+ {
+ while ((pboxNext < pbox+nbox) &&
+ (pboxNext->y1 == pboxBase->y1))
+ pboxNext++;
+ pboxTmp = pboxNext;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp != pboxBase)
+ {
+ *pboxNew2++ = *--pboxTmp;
+ *pptNew2++ = *--pptTmp;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew2 -= nbox;
+ pbox = pboxNew2;
+ pptNew2 -= nbox;
+ pptSrc = pptNew2;
+ }
+ }
+ else
+ {
+ /* walk source left to right */
+ xdir = 1;
+ }
+
+ while(nbox--)
+ {
+ w = pbox->x2 - pbox->x1;
+ h = pbox->y2 - pbox->y1;
+
+ if( pSrc->type == DRAWABLE_WINDOW )
+ xf4bppBitBlt( (WindowPtr)pDst, alu, planemask,
+ pptSrc->x, /* x0 */
+ pptSrc->y, /* y0 */
+ pbox->x1, /* x1 */
+ pbox->y1, /* y1 */
+ w, h ); /* w, h */
+ else /* DRAWABLE_PIXMAP */
+ xf4bppDrawColorImage( (WindowPtr)pDst,
+ pbox->x1, pbox->y1,
+ w,
+ h,
+ ((unsigned char *)((PixmapPtr)pSrc)->devPrivate.ptr
+ + pptSrc->x + (pptSrc->y*((PixmapPtr)pSrc)->devKind)),
+ ((PixmapPtr)pSrc)->devKind,
+ alu, planemask ) ;
+ pbox++;
+ pptSrc++;
+ }
+ if (pboxNew2)
+ {
+ DEALLOCATE_LOCAL(pptNew2);
+ DEALLOCATE_LOCAL(pboxNew2);
+ }
+ if (pboxNew1)
+ {
+ DEALLOCATE_LOCAL(pptNew1);
+ DEALLOCATE_LOCAL(pboxNew1);
+ }
+}
+
+
+/*
+ * Graft in the CopyArea from mfb/cfb. It does everything correctly.
+ */
+
+RegionPtr
+xf4bppCopyArea(pSrcDrawable, pDstDrawable,
+ pGC, srcx, srcy, width, height, dstx, dsty)
+register DrawablePtr pSrcDrawable;
+register DrawablePtr pDstDrawable;
+register GC *pGC;
+int srcx, srcy;
+int width, height;
+int dstx, dsty;
+{
+ RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
+ Bool freeSrcClip = FALSE;
+
+ RegionPtr prgnExposed;
+ RegionRec rgnDst;
+ DDXPointPtr pptSrc;
+ register DDXPointPtr ppt;
+ register BoxPtr pbox;
+ int i;
+ register int dx;
+ register int dy;
+ xRectangle origSource;
+ DDXPointRec origDest;
+ int numRects;
+ BoxRec fastBox;
+ int fastClip = 0; /* for fast clipping with pixmap source */
+ int fastExpose = 0; /* for fast exposures with pixmap source */
+
+ if ( pDstDrawable->type != DRAWABLE_WINDOW )
+ return miCopyArea( pSrcDrawable, pDstDrawable, pGC,
+ srcx, srcy, width, height, dstx, dsty ) ;
+
+ /* Begin code from mfb/cfbCopyArea */
+
+ origSource.x = srcx;
+ origSource.y = srcy;
+ origSource.width = width;
+ origSource.height = height;
+ origDest.x = dstx;
+ origDest.y = dsty;
+
+ if ((pSrcDrawable != pDstDrawable) &&
+ pSrcDrawable->pScreen->SourceValidate)
+ {
+ (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height);
+ }
+
+ srcx += pSrcDrawable->x;
+ srcy += pSrcDrawable->y;
+
+ /* clip the source */
+
+ if (pSrcDrawable->type == DRAWABLE_PIXMAP)
+ {
+ if ((pSrcDrawable == pDstDrawable) &&
+ (pGC->clientClipType == CT_NONE))
+ {
+ prgnSrcClip = pGC->pCompositeClip;
+ }
+ else
+ {
+ fastClip = 1;
+ }
+ }
+ else
+ {
+ if (pGC->subWindowMode == IncludeInferiors)
+ {
+ if (!((WindowPtr) pSrcDrawable)->parent)
+ {
+ /*
+ * special case bitblt from root window in
+ * IncludeInferiors mode; just like from a pixmap
+ */
+ fastClip = 1;
+ }
+ else if ((pSrcDrawable == pDstDrawable) &&
+ (pGC->clientClipType == CT_NONE))
+ {
+ prgnSrcClip = pGC->pCompositeClip;
+ }
+ else
+ {
+ prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
+ freeSrcClip = TRUE;
+ }
+ }
+ else
+ {
+ prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
+ }
+ }
+
+ fastBox.x1 = srcx;
+ fastBox.y1 = srcy;
+ fastBox.x2 = srcx + width;
+ fastBox.y2 = srcy + height;
+
+ /* Don't create a source region if we are doing a fast clip */
+ if (fastClip)
+ {
+ fastExpose = 1;
+ /*
+ * clip the source; if regions extend beyond the source size,
+ * make sure exposure events get sent
+ */
+ if (fastBox.x1 < pSrcDrawable->x)
+ {
+ fastBox.x1 = pSrcDrawable->x;
+ fastExpose = 0;
+ }
+ if (fastBox.y1 < pSrcDrawable->y)
+ {
+ fastBox.y1 = pSrcDrawable->y;
+ fastExpose = 0;
+ }
+ if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
+ {
+ fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
+ fastExpose = 0;
+ }
+ if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
+ {
+ fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
+ fastExpose = 0;
+ }
+ }
+ else
+ {
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
+ REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
+ }
+
+ dstx += pDstDrawable->x;
+ dsty += pDstDrawable->y;
+
+ if (pDstDrawable->type == DRAWABLE_WINDOW)
+ {
+ if (!((WindowPtr)pDstDrawable)->realized)
+ {
+ if (!fastClip)
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return NULL;
+ }
+ }
+
+ dx = srcx - dstx;
+ dy = srcy - dsty;
+
+ /* Translate and clip the dst to the destination composite clip */
+ if (fastClip)
+ {
+ RegionPtr cclip;
+
+ /* Translate the region directly */
+ fastBox.x1 -= dx;
+ fastBox.x2 -= dx;
+ fastBox.y1 -= dy;
+ fastBox.y2 -= dy;
+
+ /* If the destination composite clip is one rectangle we can
+ do the clip directly. Otherwise we have to create a full
+ blown region and call intersect */
+ cclip = pGC->pCompositeClip;
+ if (REGION_NUM_RECTS(cclip) == 1)
+ {
+ BoxPtr pBox = REGION_RECTS(cclip);
+
+ if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
+ if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
+ if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
+ if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
+
+ /* Check to see if the region is empty */
+ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
+ {
+ REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0);
+ }
+ else
+ {
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
+ }
+ }
+ else
+ {
+ /* We must turn off fastClip now, since we must create
+ a full blown region. It is intersected with the
+ composite clip below. */
+ fastClip = 0;
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
+ }
+ }
+ else
+ {
+ REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
+ }
+
+ if (!fastClip)
+ {
+ REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, pGC->pCompositeClip);
+ }
+
+ /* Do bit blitting */
+ numRects = REGION_NUM_RECTS(&rgnDst);
+ if (numRects && width && height)
+ {
+ if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
+ sizeof(DDXPointRec))))
+ {
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return NULL;
+ }
+ pbox = REGION_RECTS(&rgnDst);
+ ppt = pptSrc;
+ for (i = numRects; --i >= 0; pbox++, ppt++)
+ {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ vga16DoBitblt(pSrcDrawable, pDstDrawable, pGC->alu,
+ &rgnDst, pptSrc, pGC->planemask );
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ prgnExposed = NULL;
+ if (pGC->fExpose)
+ {
+ /* Pixmap sources generate a NoExposed (we return NULL to do this) */
+ if (!fastExpose)
+ prgnExposed =
+ miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
+ origSource.x, origSource.y,
+ (int)origSource.width,
+ (int)origSource.height,
+ origDest.x, origDest.y, (unsigned long)0);
+ }
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return prgnExposed;
+}
diff --git a/hw/xfree86/xf4bpp/ppcDepth.c b/hw/xfree86/xf4bpp/ppcDepth.c
new file mode 100644
index 000000000..919fa0133
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcDepth.c
@@ -0,0 +1,52 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcDepth.c,v 1.3 1999/06/06 08:48:58 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/* $XConsortium: ppcDepth.c /main/3 1996/02/21 17:57:31 kaleb $ */
+
+/* Check to see if the alleged depth is acceptable for the Screen
+ *
+ * T. Paquin 9/87
+ *
+ */
+
+#include "xf4bpp.h"
+#include "scrnintstr.h"
+
+Bool
+xf4bppDepthOK(pDraw,depth)
+register DrawablePtr pDraw;
+register int depth;
+{
+register ScreenPtr pScreen= pDraw->pScreen;
+register int i = pScreen->numDepths;
+
+ if ( ( pDraw->type == DRAWABLE_PIXMAP ) && ( depth == 1 ) )
+ return TRUE ;
+
+ while ( i-- )
+ if ( depth == pScreen->allowedDepths[i].depth )
+ return TRUE ;
+
+ return FALSE ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcFillRct.c b/hw/xfree86/xf4bpp/ppcFillRct.c
new file mode 100644
index 000000000..7e1c866ef
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcFillRct.c
@@ -0,0 +1,221 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcFillRct.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */
+/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* $XConsortium: ppcFillRct.c /main/5 1996/02/21 17:57:35 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "scrnintstr.h"
+
+#define MODEQ(a, b) ((a) %= (b))
+
+/*
+ filled rectangles.
+ translate the rectangles, clip them, and call the
+helper function in the GC.
+*/
+
+#define NUM_STACK_RECTS 1024
+
+void
+xf4bppPolyFillRect(pDrawable, pGC, nrectFill, prectInit)
+ DrawablePtr pDrawable;
+ GCPtr pGC;
+ int nrectFill; /* number of rectangles to fill */
+ xRectangle *prectInit; /* Pointer to first rectangle to fill */
+{
+ xRectangle *prect;
+ RegionPtr prgnClip;
+ register BoxPtr pbox;
+ register BoxPtr pboxClipped;
+ BoxPtr pboxClippedBase;
+ BoxPtr pextent;
+ BoxRec stackRects[NUM_STACK_RECTS];
+ int numRects;
+ int n;
+ int xorg, yorg;
+ mfbPrivGC *priv;
+/* int alu; */
+/* mfbFillAreaProcPtr pfn; */
+/* PixmapPtr ppix; */
+
+ if (!(pGC->planemask & 0x0F)) /* GJA */
+ return;
+
+ priv = (mfbPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr;
+/* alu = priv->ropFillArea; */
+/* pfn = priv->FillArea; */
+/* ppix = pGC->pRotatedPixmap; */
+ prgnClip = pGC->pCompositeClip;
+
+ prect = prectInit;
+ xorg = pDrawable->x;
+ yorg = pDrawable->y;
+ if (xorg || yorg)
+ {
+ prect = prectInit;
+ n = nrectFill;
+ Duff (n, prect->x += xorg; prect->y += yorg; prect++);
+ }
+
+
+ prect = prectInit;
+
+ numRects = REGION_NUM_RECTS(prgnClip) * nrectFill;
+ if (numRects > NUM_STACK_RECTS)
+ {
+ pboxClippedBase = (BoxPtr)ALLOCATE_LOCAL(numRects * sizeof(BoxRec));
+ if (!pboxClippedBase)
+ return;
+ }
+ else
+ pboxClippedBase = stackRects;
+
+ pboxClipped = pboxClippedBase;
+
+ if (REGION_NUM_RECTS(prgnClip) == 1)
+ {
+ int x1, y1, x2, y2, bx2, by2;
+
+ pextent = REGION_RECTS(prgnClip);
+ x1 = pextent->x1;
+ y1 = pextent->y1;
+ x2 = pextent->x2;
+ y2 = pextent->y2;
+ while (nrectFill--)
+ {
+ if ((pboxClipped->x1 = prect->x) < x1)
+ pboxClipped->x1 = x1;
+
+ if ((pboxClipped->y1 = prect->y) < y1)
+ pboxClipped->y1 = y1;
+
+ bx2 = (int) prect->x + (int) prect->width;
+ if (bx2 > x2)
+ bx2 = x2;
+ pboxClipped->x2 = bx2;
+
+ by2 = (int) prect->y + (int) prect->height;
+ if (by2 > y2)
+ by2 = y2;
+ pboxClipped->y2 = by2;
+
+ prect++;
+ if ((pboxClipped->x1 < pboxClipped->x2) &&
+ (pboxClipped->y1 < pboxClipped->y2))
+ {
+ pboxClipped++;
+ }
+ }
+ }
+ else
+ {
+ int x1, y1, x2, y2, bx2, by2;
+
+ pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
+ x1 = pextent->x1;
+ y1 = pextent->y1;
+ x2 = pextent->x2;
+ y2 = pextent->y2;
+ while (nrectFill--)
+ {
+ BoxRec box;
+
+ if ((box.x1 = prect->x) < x1)
+ box.x1 = x1;
+
+ if ((box.y1 = prect->y) < y1)
+ box.y1 = y1;
+
+ bx2 = (int) prect->x + (int) prect->width;
+ if (bx2 > x2)
+ bx2 = x2;
+ box.x2 = bx2;
+
+ by2 = (int) prect->y + (int) prect->height;
+ if (by2 > y2)
+ by2 = y2;
+ box.y2 = by2;
+
+ prect++;
+
+ if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
+ continue;
+
+ n = REGION_NUM_RECTS (prgnClip);
+ pbox = REGION_RECTS(prgnClip);
+
+ /* clip the rectangle to each box in the clip region
+ this is logically equivalent to calling Intersect()
+ */
+ while(n--)
+ {
+ pboxClipped->x1 = max(box.x1, pbox->x1);
+ pboxClipped->y1 = max(box.y1, pbox->y1);
+ pboxClipped->x2 = min(box.x2, pbox->x2);
+ pboxClipped->y2 = min(box.y2, pbox->y2);
+ pbox++;
+
+ /* see if clipping left anything */
+ if(pboxClipped->x1 < pboxClipped->x2 &&
+ pboxClipped->y1 < pboxClipped->y2)
+ {
+ pboxClipped++;
+ }
+ }
+ }
+ }
+ if (pboxClipped != pboxClippedBase)
+ xf4bppFillArea((WindowPtr)pDrawable, pboxClipped-pboxClippedBase,
+ pboxClippedBase, pGC);
+ if (pboxClippedBase != stackRects)
+ DEALLOCATE_LOCAL(pboxClippedBase);
+}
diff --git a/hw/xfree86/xf4bpp/ppcGC.c b/hw/xfree86/xf4bpp/ppcGC.c
new file mode 100644
index 000000000..df8ae335f
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcGC.c
@@ -0,0 +1,458 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGC.c,v 1.8 2003/02/18 21:29:59 tsi Exp $ */
+/*
+
+Copyright (c) 1987 X Consortium
+
+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 X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the X Consortium.
+
+
+Copyright IBM Corporation 1987,1988,1989
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM 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.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+*/
+
+/* $XConsortium: ppcGC.c /main/6 1996/02/21 17:57:38 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "mi.h"
+#include "scrnintstr.h"
+#include "ppcGCstr.h"
+#include "vgaVideo.h"
+#include "ibmTrace.h"
+
+#define ppcGCInterestValidateMask \
+( GCLineStyle | GCLineWidth | GCJoinStyle | GCBackground | GCForeground \
+| GCFunction | GCPlaneMask | GCFillStyle | GC_CALL_VALIDATE_BIT \
+| GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode )
+
+
+/* GJA -- we modified the following function to get rid of
+ * the records in file vgaData.c
+ */
+static GCFuncs vgaGCFuncs = {
+ xf4bppValidateGC,
+ (void (*)())NoopDDA,
+ (void (*)())NoopDDA,
+ xf4bppDestroyGC,
+ xf4bppChangeClip,
+ xf4bppDestroyClip,
+ xf4bppCopyClip,
+ { NULL }
+};
+
+
+static ppcPrivGC vgaPrototypeGCPriv = {
+ GXcopy, /* unsigned char rop */
+ 0, /* unsigned char ropOpStip */
+ 0, /* unsigned char ropFillArea */
+ {0, }, /* unsigned char unused[sizeof(long) - 3] */
+ NULL, /* mfbFillAreaProcPtr FillArea */
+ {
+ VGA_ALLPLANES, /* unsigned long planemask */
+ 1, /* unsigned long fgPixel */
+ 0, /* unsigned long bgPixel */
+ GXcopy, /* int alu */
+ FillSolid, /* int fillStyle */
+ }, /* ppcReducedRrop colorRrop */
+ -1, /* short lastDrawableType */
+ -1, /* short lastDrawableDepth */
+ 0 /* pointer devPriv */
+} ;
+
+static GCOps vgaGCOps = {
+ xf4bppSolidWindowFS, /* void (* FillSpans)() */
+ xf4bppSetSpans, /* void (* SetSpans)() */
+ miPutImage, /* void (* PutImage)() */
+ xf4bppCopyArea, /* RegionPtr (* CopyArea)() */
+ miCopyPlane, /* void (* CopyPlane)() */
+ xf4bppPolyPoint, /* void (* PolyPoint)() */
+ miZeroLine, /* void (* Polylines)() */
+ miPolySegment, /* void (* PolySegment)() */
+ miPolyRectangle, /* void (* PolyRectangle)() */
+ xf4bppZeroPolyArc, /* void (* PolyArc)() */
+ miFillPolygon, /* void (* FillPolygon)() */
+ miPolyFillRect, /* void (* PolyFillRect)() */
+ xf4bppPolyFillArc, /* void (* PolyFillArc)() */
+ miPolyText8, /* int (* PolyText8)() */
+ miPolyText16, /* int (* PolyText16)() */
+ miImageText8, /* void (* ImageText8)() */
+ miImageText16, /* void (* ImageText16)() */
+ xf4bppImageGlyphBlt, /* GJA -- void (* ImageGlyphBlt)() */
+ miPolyGlyphBlt, /* GJA -- void (* PolyGlyphBlt)() */
+ miPushPixels, /* void (* PushPixels)() */
+#ifdef NEED_LINEHELPER
+ miMiter, /* void (* LineHelper)() */
+#endif
+ {NULL} /* devPrivate */
+};
+
+Bool
+xf4bppCreateGC( pGC )
+register GCPtr pGC ;
+{
+ ppcPrivGC *pPriv ;
+ GCOps *pOps ;
+
+ if ( pGC->depth == 1 )
+ {
+ return (mfbCreateGC(pGC));
+ }
+
+ if ( !( pPriv = xalloc( sizeof( ppcPrivGC ) ) ) )
+ return FALSE ;
+
+ if ( !( pOps = xalloc( sizeof( GCOps ) ) ) ) {
+ xfree(pPriv);
+ return FALSE;
+ }
+
+ /* Now we initialize the GC fields */
+ pGC->miTranslate = 1;
+ pGC->unused = 0;
+ pGC->planemask = VGA_ALLPLANES;
+ pGC->fgPixel = VGA_BLACK_PIXEL;
+ pGC->bgPixel = VGA_WHITE_PIXEL;
+ pGC->funcs = &vgaGCFuncs;
+ /* ops, -- see below */
+
+ pGC->fExpose = TRUE;
+ pGC->freeCompClip = FALSE;
+ pGC->pRotatedPixmap = NullPixmap;
+
+ /* GJA: I don't like this code:
+ * they allocated a mfbPrivGC, ignore the allocated data and place
+ * a pointer to a ppcPrivGC in its slot.
+ */
+ *pPriv = vgaPrototypeGCPriv;
+ (pGC->devPrivates[mfbGCPrivateIndex].ptr) = (pointer) pPriv;
+
+ /* Set the vgaGCOps */
+ *pOps = vgaGCOps;
+ pOps->devPrivate.val = 1;
+ pGC->ops = pOps;
+
+ return TRUE ;
+}
+
+void
+xf4bppDestroyGC( pGC )
+ register GC *pGC ;
+
+{
+ TRACE( ( "xf4bppDestroyGC(pGC=0x%x)\n", pGC ) ) ;
+
+ /* (ef) 11/9/87 -- ppc doesn't use rotated tile or stipple, but */
+ /* *does* call mfbValidateGC under some conditions. */
+ /* mfbValidateGC *does* use rotated tile and stipple */
+ if ( pGC->pRotatedPixmap )
+ mfbDestroyPixmap( pGC->pRotatedPixmap ) ;
+
+ if ( pGC->freeCompClip && pGC->pCompositeClip )
+ REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
+ if(pGC->ops->devPrivate.val) xfree( pGC->ops );
+ xfree( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
+ return ;
+}
+
+static Mask
+ppcChangePixmapGC
+(
+ register GC *pGC,
+ register Mask changes
+)
+{
+register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
+register unsigned long int idx ; /* used for stepping through bitfields */
+
+#define LOWBIT( x ) ( x & - x ) /* Two's complement */
+while ((idx = LOWBIT(changes))) {
+ switch ( idx ) {
+
+ case GCLineStyle:
+ case GCLineWidth:
+ pGC->ops->Polylines = ( ! pGC->lineWidth )
+ ? miZeroLine
+ : ( ( pGC->lineStyle == LineSolid )
+ ? miWideLine : miWideDash ) ;
+ changes &= ~( GCLineStyle | GCLineWidth ) ;
+ break ;
+
+ case GCJoinStyle:
+#ifdef NEED_LINEHELPER
+ pGC->ops->LineHelper = ( pGC->joinStyle == JoinMiter )
+ ? miMiter : miNotMiter ;
+#endif
+ changes &= ~ idx ; /* i.e. changes &= ~ GCJoinStyle */
+ break ;
+
+ case GCBackground:
+ if ( pGC->fillStyle != FillOpaqueStippled ) {
+ changes &= ~ idx ; /* i.e. changes &= ~GCBackground */
+ break ;
+ } /* else Fall Through */
+ case GCForeground:
+ if ( pGC->fillStyle == FillTiled ) {
+ changes &= ~ idx ; /* i.e. changes &= ~GCForeground */
+ break ;
+ } /* else Fall Through */
+ case GCFunction:
+ case GCPlaneMask:
+ case GCFillStyle:
+ { /* new_fill */
+ int fillStyle = devPriv->colorRrop.fillStyle ;
+ /* install a suitable fillspans */
+ if ( fillStyle == FillSolid )
+ pGC->ops->FillSpans = xf4bppSolidPixmapFS ;
+ else if ( fillStyle == FillStippled )
+ pGC->ops->FillSpans = xf4bppStipplePixmapFS ;
+ else if ( fillStyle == FillOpaqueStippled )
+ pGC->ops->FillSpans = xf4bppOpStipplePixmapFS ;
+ else /* fillStyle == FillTiled */
+ pGC->ops->FillSpans = xf4bppTilePixmapFS ;
+ changes &= ~( GCBackground | GCForeground
+ | GCFunction | GCPlaneMask | GCFillStyle ) ;
+ break ;
+ } /* end of new_fill */
+
+ default:
+ ErrorF( "ppcChangePixmapGC: Unexpected GC Change\n" ) ;
+ changes &= ~ idx ; /* Remove it anyway */
+ break ;
+ }
+}
+
+return 0 ;
+}
+
+/* Clipping conventions
+ if the drawable is a window
+ CT_REGION ==> pCompositeClip really is the composite
+ CT_other ==> pCompositeClip is the window clip region
+ if the drawable is a pixmap
+ CT_REGION ==> pCompositeClip is the translated client region
+ clipped to the pixmap boundary
+ CT_other ==> pCompositeClip is the pixmap bounding box
+*/
+
+void
+xf4bppValidateGC( pGC, changes, pDrawable )
+ GCPtr pGC;
+ unsigned long changes;
+ DrawablePtr pDrawable;
+{
+ register ppcPrivGCPtr devPriv ;
+ WindowPtr pWin ;
+
+ devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
+
+ if ( pDrawable->type != devPriv->lastDrawableType ) {
+ devPriv->lastDrawableType = pDrawable->type ;
+ xf4bppChangeGCtype( pGC, devPriv ) ;
+ changes = (unsigned)~0 ;
+ }
+
+ if ( pDrawable->depth == 1 ) {
+/* ibmAbort(); */
+ xf4bppNeverCalled();
+ }
+
+ if ( pDrawable->type == DRAWABLE_WINDOW ) {
+ pWin = (WindowPtr) pDrawable ;
+ pGC->lastWinOrg.x = pWin->drawable.x ;
+ pGC->lastWinOrg.y = pWin->drawable.y ;
+ }
+ else {
+ pWin = (WindowPtr) NULL ;
+ pGC->lastWinOrg.x = 0 ;
+ pGC->lastWinOrg.y = 0 ;
+ }
+
+ changes &= ppcGCInterestValidateMask ;
+ /* If Nothing REALLY Changed, Just Return */
+ if ( pDrawable->serialNumber == (pGC->serialNumber & DRAWABLE_SERIAL_BITS) )
+ if ( !( changes &= ~ GC_CALL_VALIDATE_BIT ) )
+ return ;
+
+ /* GJA -- start of cfb code */
+ /*
+ * if the client clip is different or moved OR the subwindowMode has
+ * changed OR the window's clip has changed since the last validation
+ * we need to recompute the composite clip
+ */
+
+ if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
+ (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
+ )
+ {
+ if (pWin) {
+ RegionPtr pregWin;
+ Bool freeTmpClip, freeCompClip;
+
+ if (pGC->subWindowMode == IncludeInferiors) {
+ pregWin = NotClippedByChildren(pWin);
+ freeTmpClip = TRUE;
+ }
+ else {
+ pregWin = &pWin->clipList;
+ freeTmpClip = FALSE;
+ }
+ freeCompClip = pGC->freeCompClip;
+
+ /*
+ * if there is no client clip, we can get by with just keeping
+ * the pointer we got, and remembering whether or not should
+ * destroy (or maybe re-use) it later. this way, we avoid
+ * unnecessary copying of regions. (this wins especially if
+ * many clients clip by children and have no client clip.)
+ */
+ if (pGC->clientClipType == CT_NONE) {
+ if (freeCompClip)
+ REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
+ pGC->pCompositeClip = pregWin;
+ pGC->freeCompClip = freeTmpClip;
+ }
+ else {
+ /*
+ * we need one 'real' region to put into the composite
+ * clip. if pregWin the current composite clip are real,
+ * we can get rid of one. if pregWin is real and the
+ * current composite clip isn't, use pregWin for the
+ * composite clip. if the current composite clip is real
+ * and pregWin isn't, use the current composite clip. if
+ * neither is real, create a new region.
+ */
+
+ REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
+ pDrawable->x + pGC->clipOrg.x,
+ pDrawable->y + pGC->clipOrg.y);
+
+ if (freeCompClip)
+ {
+ REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
+ pregWin, pGC->clientClip);
+ if (freeTmpClip)
+ REGION_DESTROY(pGC->pScreen, pregWin);
+ }
+ else if (freeTmpClip)
+ {
+ REGION_INTERSECT(pGC->pScreen, pregWin, pregWin,
+ pGC->clientClip);
+ pGC->pCompositeClip = pregWin;
+ }
+ else
+ {
+ pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, NullBox, 0);
+ REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
+ pregWin, pGC->clientClip);
+ }
+ pGC->freeCompClip = TRUE;
+ REGION_TRANSLATE(pGC->pScreen, pGC->clientClip,
+ -(pDrawable->x + pGC->clipOrg.x),
+ -(pDrawable->y + pGC->clipOrg.y));
+
+ }
+ } /* end of composite clip for a window */
+ else {
+ BoxRec pixbounds;
+
+ /* XXX should we translate by drawable.x/y here ? */
+ pixbounds.x1 = 0;
+ pixbounds.y1 = 0;
+ pixbounds.x2 = pDrawable->width;
+ pixbounds.y2 = pDrawable->height;
+
+ if (pGC->freeCompClip) {
+ REGION_RESET(pGC->pScreen, pGC->pCompositeClip, &pixbounds);
+ } else {
+ pGC->freeCompClip = TRUE;
+ pGC->pCompositeClip = REGION_CREATE(pGC->pScreen, &pixbounds, 1);
+ }
+
+ if (pGC->clientClipType == CT_REGION)
+ {
+ REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip,
+ -pGC->clipOrg.x, -pGC->clipOrg.y);
+ REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip,
+ pGC->pCompositeClip, pGC->clientClip);
+ REGION_TRANSLATE(pGC->pScreen, pGC->pCompositeClip,
+ pGC->clipOrg.x, pGC->clipOrg.y);
+ }
+ } /* end of composute clip for pixmap */
+ }
+ /* GJA -- End of cfb code */
+
+ changes &= ~ ( GCClipXOrigin | GCClipYOrigin | GCClipMask | GCSubwindowMode
+ | GC_CALL_VALIDATE_BIT ) ;
+
+ /* If needed, Calculate the Color Reduced Raster-Op */
+ if ( changes & ( GCFillStyle | GCBackground | GCForeground
+ | GCPlaneMask | GCFunction ) )
+ xf4bppGetReducedColorRrop( pGC, pDrawable->depth,
+ &devPriv->colorRrop ) ;
+
+ (* ( ( pDrawable->type == DRAWABLE_WINDOW )
+ ? xf4bppChangeWindowGC
+ : ppcChangePixmapGC ) )( pGC, changes ) ;
+
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcGCstr.h b/hw/xfree86/xf4bpp/ppcGCstr.h
new file mode 100644
index 000000000..5f863fa73
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcGCstr.h
@@ -0,0 +1,95 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGCstr.h,v 1.3 2003/02/18 21:29:59 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/***********************************************************
+ Copyright IBM Corporation 1988
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM 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.
+
+******************************************************************/
+/* $XConsortium: ppcGCstr.h /main/3 1996/02/21 17:57:42 kaleb $ */
+
+#include "gc.h"
+#include "mfb.h"
+
+typedef struct {
+ unsigned long planemask ;
+ unsigned long fgPixel ;
+ unsigned long bgPixel ;
+ int alu ;
+ int fillStyle ;
+ } ppcReducedRrop ;
+
+/* ************************************************************************ */
+
+/* private field of GC */
+typedef struct {
+/* The next five (5) fields MUST CORRESPOND to
+ * the fields of a "mfbPrivGC" struct
+ * ----- BEGINNING OF "DO-NOT-CHANGE" REGION -----
+ */
+ unsigned char rop ; /* reduction of rasterop to 1 of 3 */
+ unsigned char ropOpStip ; /* rop for opaque stipple */
+ unsigned char ropFillArea ; /* == alu, rop, or ropOpStip */
+ unsigned char unused[sizeof(long) - 3];
+ mfbFillAreaProcPtr FillArea; /* fills regions; look at the code */
+/* ----- END OF "DO-NOT-CHANGE" REGION ----- */
+ ppcReducedRrop colorRrop ;
+ short lastDrawableType ; /* was last drawable a window or a pixmap? */
+ short lastDrawableDepth ; /* was last drawable 1 or 8 planes? */
+ pointer devPriv ; /* Private area for device specific stuff */
+ } ppcPrivGC ;
+typedef ppcPrivGC *ppcPrivGCPtr ;
+
+/* ppcCReduce.c */
+void xf4bppGetReducedColorRrop(
+#if NeedFunctionPrototypes
+ GCPtr,
+ int,
+ ppcReducedRrop *
+#endif
+);
+
+/* vgaGC.c */
+void xf4bppChangeGCtype(
+#if NeedFunctionPrototypes
+ GCPtr,
+ ppcPrivGCPtr
+#endif
+);
diff --git a/hw/xfree86/xf4bpp/ppcGetSp.c b/hw/xfree86/xf4bpp/ppcGetSp.c
new file mode 100644
index 000000000..b6c404e80
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcGetSp.c
@@ -0,0 +1,139 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcGetSp.c,v 1.3 1999/06/06 08:48:59 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+
+/* $XConsortium: ppcGetSp.c /main/5 1996/02/21 17:57:45 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "servermd.h"
+#include "ibmTrace.h"
+
+/* GetSpans -- for each span, gets bits from drawable starting at ppt[i]
+ * and continuing for pwidth[i] bits
+ * Each scanline returned will be server scanline padded, i.e., it will come
+ * out to an integral number of words.
+ */
+void
+xf4bppGetSpans( pDrawable, wMax, ppt, pwidth, nspans, pdstStart )
+ DrawablePtr pDrawable ; /* drawable from which to get bits */
+ int wMax ; /* largest value of all *pwidths */
+ DDXPointPtr ppt ; /* points to start copying from */
+ int *pwidth ; /* list of number of bits to copy */
+ int nspans ; /* number of scanlines to copy */
+ char *pdstStart ;
+{
+ register int j ;
+ register unsigned char *pdst ; /* where to put the bits */
+ register unsigned char *psrc ; /* where to get the bits */
+ register int pixmapStride ;
+
+
+ TRACE( ( "xf4bppGetSpans(pDrawable=0x%x,wMax=%d,ppt=0x%x,pwidth=0x%x,nspans=%d)\n",
+ pDrawable, wMax, ppt, pwidth, nspans ) ) ;
+
+ if ( ( pDrawable->depth == 1 ) && ( pDrawable->type == DRAWABLE_PIXMAP ) )
+ {
+ mfbGetSpans( pDrawable, wMax, ppt, pwidth, nspans, pdstStart ) ;
+ return;
+ }
+
+ pixmapStride = PixmapBytePad( wMax, pDrawable->depth ) ;
+ pdst = (unsigned char *) /* GJA */ pdstStart ;
+
+ if ( pDrawable->type == DRAWABLE_WINDOW ) {
+ for ( ; nspans-- ; ppt++, pwidth++ ) {
+ xf4bppReadColorImage( (WindowPtr)pDrawable,
+ ppt->x, ppt->y, j = *pwidth, 1, pdst, pixmapStride ) ;
+ pdst += j ; /* width is in 32 bit words */
+ j = ( -j ) & 3 ;
+ while ( j-- ) /* Pad out to 32-bit boundary */
+ *pdst++ = 0 ;
+ }
+ }
+ else { /* OK, if we are here, we had better be a DRAWABLE PIXMAP */
+ register int widthSrc = /* width of pixmap in bytes */
+ (int) ( (PixmapPtr) pDrawable )->devKind ;
+
+ psrc = (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr ;
+ for ( ; nspans-- ; ppt++, pwidth++ ) {
+ MOVE( psrc + ( ppt->y * widthSrc ) + ppt->x,
+ pdst, j = *pwidth ) ;
+ pdst += j ;
+ j = ( -j ) & 3 ;
+ while ( j-- ) /* Pad out to 32-bit boundary */
+ *pdst++ = 0 ;
+ }
+ }
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcIO.c b/hw/xfree86/xf4bpp/ppcIO.c
new file mode 100644
index 000000000..43cc7bd33
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcIO.c
@@ -0,0 +1,252 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcIO.c,v 1.5 2001/10/28 03:34:06 tsi Exp $ */
+/*
+
+Copyright (c) 1990 X Consortium
+
+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 X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the X Consortium.
+
+
+Copyright IBM Corporation 1987,1988,1989
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM 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.
+
+*/
+/* $XConsortium: ppcIO.c /main/8 1996/02/21 17:57:49 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "mi.h"
+#include "micmap.h"
+#include "scrnintstr.h"
+#include "vgaVideo.h"
+
+#if 0
+/* XXX This remains to remind of the PC98 difference */
+static VisualRec vgaVisuals[] = {
+/* StaticColor needs to be first so is can be used as the default */
+/* vid class bpRGB cmpE nplan rMask gMask bMask oRed oGreen oBlue */
+#ifdef PC98
+{ 0, StaticColor, 4, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
+{ 0, StaticGray, 4, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
+{ 0, GrayScale, 4, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
+{ 0, PseudoColor, 4, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
+#else
+{ 0, StaticColor, 6, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
+{ 0, StaticGray, 6, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
+{ 0, GrayScale, 6, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
+{ 0, PseudoColor, 6, 1 << VGA_MAXPLANES, VGA_MAXPLANES, 0, 0, 0, 0, 0, 0 },
+#endif
+} ;
+#endif
+
+int
+xf4bppNeverCalled()
+{
+ FatalError("xf4bppNeverCalled was nevertheless called\n");
+}
+
+static BSFuncRec ppcBSFuncRec = {
+ xf4bppSaveAreas,
+ xf4bppRestoreAreas,
+ (BackingStoreSetClipmaskRgnProcPtr) 0,
+ (BackingStoreGetImagePixmapProcPtr) 0,
+ (BackingStoreGetSpansPixmapProcPtr) 0,
+};
+
+/*ARGSUSED*/
+static Bool
+vgaScreenClose
+(
+ int idx,
+ ScreenPtr pScreen
+)
+{
+ pScreen->defColormap = 0 ;
+ return TRUE;
+}
+
+
+static GCPtr sampleGCperDepth[MAXFORMATS+1] = { 0 };
+static PixmapPtr samplePixmapPerDepth[1] = { 0 };
+
+/* GJA -- Took this from miscrinit.c.
+ * We want that devKind contains the distance in bytes between two scanlines.
+ * The computation that mi does is not appropriate for planar VGA.
+ * Therefore we provide here our own routine.
+ */
+
+/* GJA -- WARNING: this is an internal structure declaration, taken from
+ * miscrinit.c
+ */
+typedef struct
+{
+ pointer pbits; /* pointer to framebuffer */
+ int width; /* delta to add to a framebuffer addr to move one row down */
+} miScreenInitParmsRec, *miScreenInitParmsPtr;
+
+/* With the introduction of pixmap privates, the "screen pixmap" can no
+ * longer be created in miScreenInit, since all the modules that could
+ * possibly ask for pixmap private space have not been initialized at
+ * that time. pScreen->CreateScreenResources is called after all
+ * possible private-requesting modules have been inited; we create the
+ * screen pixmap here.
+ */
+static Bool
+v16CreateScreenResources
+(
+ ScreenPtr pScreen
+)
+{
+ miScreenInitParmsPtr pScrInitParms;
+ pointer value;
+
+ pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
+
+ /* if width is non-zero, pScreen->devPrivate will be a pixmap
+ * else it will just take the value pbits
+ */
+ if (pScrInitParms->width)
+ {
+ PixmapPtr pPixmap;
+
+ /* create a pixmap with no data, then redirect it to point to
+ * the screen
+ */
+ pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth);
+ if (!pPixmap)
+ return FALSE;
+
+ if (!(*pScreen->ModifyPixmapHeader)(pPixmap, pScreen->width,
+ pScreen->height, pScreen->rootDepth, 8 /* bits per pixel */,
+/* GJA: was PixmapBytePad(pScrInitParms->width, pScreen->rootDepth), */
+#define BITS_PER_BYTE_SHIFT 3
+ pScrInitParms->width >> BITS_PER_BYTE_SHIFT,
+ pScrInitParms->pbits))
+ return FALSE;
+ value = (pointer)pPixmap;
+ }
+ else
+ {
+ value = pScrInitParms->pbits;
+ }
+ xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
+ pScreen->devPrivate = value; /* pPixmap or pbits */
+ return TRUE;
+}
+
+
+Bool
+xf4bppScreenInit( pScreen, pbits, virtx, virty, dpix, dpiy, width )
+ ScreenPtr pScreen;
+ pointer pbits;
+ int virtx, virty;
+ int dpix, dpiy;
+ int width;
+{
+ Bool ret;
+ VisualPtr visuals;
+ DepthPtr depths;
+ int nvisuals;
+ int ndepths;
+ int rootdepth;
+ VisualID defaultVisual;
+
+ rootdepth = 0;
+ ret = miInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
+ &defaultVisual, (unsigned long)1 << 8, 6, -1);
+ if (!ret)
+ return FALSE;
+
+ pScreen-> id = 0;
+ pScreen->defColormap = FakeClientID(0);
+ pScreen-> whitePixel = VGA_WHITE_PIXEL;
+ pScreen-> blackPixel = VGA_BLACK_PIXEL;
+ pScreen-> rgf = 0;
+ *(pScreen-> GCperDepth) = *(sampleGCperDepth);
+ *(pScreen-> PixmapPerDepth) = *(samplePixmapPerDepth);
+ pScreen-> CloseScreen = vgaScreenClose;
+ pScreen-> QueryBestSize = xf4bppQueryBestSize;
+ pScreen-> GetImage = xf4bppGetImage;
+ pScreen-> GetSpans = xf4bppGetSpans;
+ pScreen-> CreateWindow = xf4bppCreateWindowForXYhardware;
+ pScreen-> DestroyWindow = xf4bppDestroyWindow;
+ pScreen-> PositionWindow = xf4bppPositionWindow;
+ pScreen-> ChangeWindowAttributes = mfbChangeWindowAttributes;
+ pScreen-> RealizeWindow = mfbMapWindow;
+ pScreen-> UnrealizeWindow = mfbUnmapWindow;
+ pScreen-> PaintWindowBackground = xf4bppPaintWindow;
+ pScreen-> PaintWindowBorder = xf4bppPaintWindow;
+ pScreen-> CopyWindow = xf4bppCopyWindow;
+ pScreen-> CreatePixmap = xf4bppCreatePixmap;
+ pScreen-> DestroyPixmap = mfbDestroyPixmap;
+ pScreen-> SaveDoomedAreas = (SaveDoomedAreasProcPtr)NoopDDA;
+ pScreen-> RestoreAreas = (RestoreAreasProcPtr)NoopDDA;
+ pScreen-> ExposeCopy = (ExposeCopyProcPtr)NoopDDA;
+ pScreen-> TranslateBackingStore = (TranslateBackingStoreProcPtr)NoopDDA;
+ pScreen-> ClearBackingStore = (ClearBackingStoreProcPtr)NoopDDA;
+ pScreen-> DrawGuarantee = (DrawGuaranteeProcPtr)NoopDDA;
+ pScreen-> RealizeFont = mfbRealizeFont;
+ pScreen-> UnrealizeFont = mfbUnrealizeFont;
+ pScreen-> CreateGC = xf4bppCreateGC;
+ pScreen-> CreateColormap = xf4bppInitializeColormap;
+ pScreen-> DestroyColormap = (DestroyColormapProcPtr)NoopDDA;
+ pScreen-> InstallColormap = miInstallColormap;
+ pScreen-> UninstallColormap = miUninstallColormap;
+ pScreen-> ListInstalledColormaps = miListInstalledColormaps;
+ pScreen-> StoreColors = (StoreColorsProcPtr)NoopDDA;
+ pScreen-> ResolveColor = xf4bppResolveColor;
+ pScreen-> BitmapToRegion = mfbPixmapToRegion;
+
+ if (!mfbAllocatePrivates(pScreen, (int*)NULL, (int*)NULL))
+ return FALSE;
+
+ if (!miScreenInit(pScreen, pbits, virtx, virty, dpix, dpiy, width,
+ rootdepth, ndepths, depths, defaultVisual /* See above */,
+ nvisuals, visuals))
+ return FALSE;
+ pScreen->BackingStoreFuncs = ppcBSFuncRec;
+
+ /* GJA -- Now we override the supplied default: */
+ pScreen -> CreateScreenResources = v16CreateScreenResources;
+
+ mfbRegisterCopyPlaneProc(pScreen,miCopyPlane); /* GJA -- R4->R5 */
+ return TRUE;
+}
diff --git a/hw/xfree86/xf4bpp/ppcImg.c b/hw/xfree86/xf4bpp/ppcImg.c
new file mode 100644
index 000000000..275db433a
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcImg.c
@@ -0,0 +1,118 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcImg.c,v 1.5 2003/02/18 21:29:59 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/* $XConsortium: ppcImg.c /main/4 1996/02/21 17:57:53 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mi.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+
+/* Was MIGETIMAGE -- public entry for the GetImage Request
+ * We're getting the image into a memory buffer. While we have to use GetSpans
+ * to read a line from the device ( since we don't know what that looks like ) ,
+ * we can just write into the destination buffer
+ *
+ * two different strategies are used, depending on whether we're getting the
+ * image in Z format or XY format
+ * Z format:
+ * Line at a time, GetSpans a line and bcopy it to the destination
+ * buffer, except that if the planemask is not all ones, we create a
+ * temporary pixmap and do a SetSpans into it ( to get bits turned off )
+ * and then another GetSpans to get stuff back ( because pixmaps are
+ * opaque, and we are passed in the memory to write into ) . This is
+ * completely ugly and slow but works, but the interfaces just aren't
+ * designed for this case. Life is hard.
+ * XY format:
+ * get the single plane specified in planemask
+ */
+void
+xf4bppGetImage( pDraw, sx, sy, w, h, format, planeMask, pdstLine )
+ DrawablePtr pDraw ;
+ int sx, sy, w, h ;
+ unsigned int format ;
+ unsigned long planeMask ;
+ char * pdstLine ;
+{
+#if 1
+ int depth, i, linelength, width ;
+ DDXPointRec pt ;
+ char *pbits ;
+ XID gcv[2] ;
+ PixmapPtr pPixmap = (PixmapPtr) NULL ;
+ GCPtr pGC ;
+ char *pDst = pdstLine ;
+
+ depth = pDraw->depth ;
+ if ( format == ZPixmap ) {
+ linelength = PixmapBytePad( w, depth ) ;
+/* if ( pDraw->type == DRAWABLE_WINDOW ) { */
+ sx += pDraw->x ;
+ sy += pDraw->y ;
+/* } */
+ if ( ( ( ( 1 << pDraw->depth ) - 1 ) & planeMask )
+ != (unsigned)( 1 << pDraw->depth ) - 1 ) {
+ pGC = GetScratchGC( depth, pDraw->pScreen ) ;
+ pPixmap = (PixmapPtr)
+ (* pDraw->pScreen->CreatePixmap)( pDraw->pScreen, w, h, depth ) ;
+ gcv[0] = GXcopy ;
+ gcv[1] = planeMask ;
+ DoChangeGC( pGC, GCPlaneMask | GCFunction, gcv, 0 ) ;
+ ValidateGC( (DrawablePtr)pPixmap, pGC ) ;
+
+ pbits = (char *)ALLOCATE_LOCAL(w);
+
+ for ( i = 0 ; i < h ; i++ ) {
+ pt.x = sx ;
+ pt.y = sy + i ;
+ width = w ;
+ (* pDraw->pScreen->GetSpans)( pDraw, w, &pt, &width, 1, pbits ) ;
+ pt.x = 0 ;
+ pt.y = i ;
+ width = w ;
+ if ( planeMask & ((1 << depth) - 1) ) /* GJA -- mfb bug */
+ (* pGC->ops->SetSpans)( (DrawablePtr)pPixmap, pGC, pbits, &pt, &width, 1, TRUE ) ;
+ (* pDraw->pScreen->GetSpans)( (DrawablePtr)pPixmap, w, &pt, &width, 1, pDst ) ;
+ pDst += linelength ;
+ }
+
+ DEALLOCATE_LOCAL(pbits) ;
+ (* pGC->pScreen->DestroyPixmap)( pPixmap ) ;
+ FreeScratchGC( pGC ) ;
+ return ;
+ }
+
+ for ( i = 0 ; i < h ; i++ ) {
+ pt.x = sx ;
+ pt.y = sy + i ;
+ width = w ;
+ (* pDraw->pScreen->GetSpans)( pDraw, w, &pt, &width, 1, pDst ) ;
+ pDst += linelength ;
+ }
+ }
+ else
+#endif
+ miGetImage( pDraw, sx, sy, w, h, format, planeMask, pdstLine ) ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcPixFS.c b/hw/xfree86/xf4bpp/ppcPixFS.c
new file mode 100644
index 000000000..261c8e809
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcPixFS.c
@@ -0,0 +1,502 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPixFS.c,v 1.4 2001/08/01 00:44:56 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/******************************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* $XConsortium: ppcPixFS.c /main/3 1996/02/21 17:57:57 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "maskbits.h"
+#include "mi.h"
+#include "mispans.h"
+#include "ppcGCstr.h"
+#include "ppcSpMcro.h"
+#include "vgaVideo.h"
+#include "ibmTrace.h"
+
+#define LeftMostBitInScreenLongWord SCRLEFT( 0xFFFFFFFF, 31 )
+
+/* GJA -- copied this from VGA */
+#define SCRLEFT8(lw, n) ( (unsigned char) (((unsigned char) lw) << (n)) )
+#define SCRRIGHT8(lw, n) ( (unsigned char) (((unsigned char)lw) >> (n)) )
+/*
+********** ********** ********** ********** ********** ********** **********
+ these routines all clip. they assume that anything that has called
+them has already translated the points (i.e. pGC->miTranslate is
+non-zero, which is howit gets set in mfbCreateGC().)
+
+ the number of new scnalines created by clipping ==
+MaxRectsPerBand * nSpans.
+********** ********** ********** ********** ********** ********** **********
+*/
+/* A mod definition that goes smoothly into the negative.
+ */
+static int
+modulo
+(
+ int n1,
+ int n2
+)
+{
+ int tmp;
+ if ( n1 < 0 ) {
+ tmp = (-n1) % n2;
+ if ( tmp == 0 ) {
+ return 0;
+ } else {
+ return n2 - tmp;
+ }
+ } else {
+ return n1 % n2;
+ }
+}
+
+void
+xf4bppSolidPixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
+ DrawablePtr pDrawable ;
+ GCPtr pGC ;
+ int nInit ; /* number of spans to fill */
+ DDXPointPtr pptInit ; /* pointer to list of start points */
+ int *pwidthInit ; /* pointer to list of n widths */
+ int fSorted ;
+{
+ register unsigned long int pm, npm ;
+ register unsigned long int fg ;
+ register int alu ;
+ /* next three parameters are post-clip */
+ int n ; /* number of spans to fill */
+ register DDXPointPtr ppt ; /* pointer to list of start points */
+ register int *pwidth ; /* pointer to list of n widths */
+ register unsigned char *addrl ; /* pointer to current longword in bitmap */
+ int i ;
+ int *pwidthFree ; /* copies of the pointers to free */
+ DDXPointPtr pptFree ;
+
+ TRACE(("xf4bppSolidPixmapFS(pDrawable=0x%x, pGC=0x%x, nInit=%d, pptInit=0x%x, pwidthInit=0x%x, fSorted=%d)\n", pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)) ;
+
+ if ( pDrawable->type != DRAWABLE_PIXMAP ) {
+ ErrorF("xf4bppSolidPixmapFS: drawable is not a pixmap\n") ;
+ return ;
+ }
+
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ return ;
+
+ n = nInit * miFindMaxBand(pGC->pCompositeClip) ;
+ if ( !( pwidth = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) )
+ return ;
+ pwidthFree = pwidth ;
+
+ if ( !( ppt = (DDXPointRec *)
+ ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) {
+ DEALLOCATE_LOCAL( pwidth ) ;
+ return ;
+ }
+ pptFree = ppt ;
+
+ n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit,
+ ppt, pwidth, fSorted ) ;
+
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+ npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
+
+ for ( ; n-- ; ppt++, pwidth++ ) {
+ addrl = ( (unsigned char *) ( ( (PixmapPtr) pDrawable )->devPrivate.ptr ) )
+ + ( ppt->y * ( (int) ( ( (PixmapPtr) pDrawable )->devKind ) ) )
+ + ppt->x ;
+ for ( i = *pwidth ; i-- ; addrl++ )
+ {
+ unsigned _p;
+ DoRop( _p, alu, fg, *addrl );
+ *addrl = ( *addrl & npm ) | ( pm & _p ) ;
+ }
+#ifdef notdef /* PURDUE */
+ *addrl = ( *addrl & npm ) | ( pm & DoRop( alu, fg, *addrl ) ) ;
+#endif /* PURDUE */
+ }
+ DEALLOCATE_LOCAL( pptFree ) ;
+ DEALLOCATE_LOCAL( pwidthFree ) ;
+ return ;
+}
+
+/* GJA -- copied from vgaStipple.c */
+static unsigned char
+vgagetbits
+(
+ register const int x,
+ register const unsigned int patternWidth,
+ register const unsigned char * const lineptr
+)
+{
+register unsigned char bits ;
+register const unsigned char *cptr ;
+register int shift ;
+register int wrap ;
+
+cptr = lineptr + ( x >> 3 ) ;
+bits = *cptr ;
+if ((shift = x & 7))
+ bits = SCRLEFT8( bits, shift ) | SCRRIGHT8( cptr[1], ( 8 - shift ) ) ;
+if ( ( wrap = x + 8 - patternWidth ) > 0 ) {
+ bits &= SCRLEFT8( 0xFF, wrap ) ;
+ bits |= SCRRIGHT8( *lineptr, ( 8 - wrap ) ) ;
+}
+
+/* GJA -- Handle extraction of 8 bits from < 8 bits wide stipple.
+ * I duplicated case 4,5,6,7 to give the compiler a chance to optimize.
+ */
+switch (patternWidth) {
+case 1: /* Not really useful. */
+ bits &= ~SCRRIGHT8(0xFF,1);
+ bits |= SCRRIGHT8(bits,1);
+ bits |= SCRRIGHT8(bits,2);
+ bits |= SCRRIGHT8(bits,4);
+ break;
+case 2:
+ bits &= ~SCRRIGHT8(0xFF,2);
+ bits |= SCRRIGHT8(bits,2); bits |= SCRRIGHT8(bits,4); break;
+case 3:
+ bits &= ~SCRRIGHT8(0xFF,3);
+ bits |= (SCRRIGHT8(bits,3) | SCRRIGHT8(bits,6)); break;
+case 4:
+ bits = (bits & ~SCRRIGHT8(0xFF,4)) | SCRRIGHT8(bits,4); break;
+case 5:
+ bits = (bits & ~SCRRIGHT8(0xFF,5)) | SCRRIGHT8(bits,5); break;
+case 6:
+ bits = (bits & ~SCRRIGHT8(0xFF,6)) | SCRRIGHT8(bits,6); break;
+case 7:
+ bits = (bits & ~SCRRIGHT8(0xFF,7)) | SCRRIGHT8(bits,7); break;
+default:
+ ;
+ /* Do nothing, of course */
+}
+
+return bits ;
+}
+
+void
+xf4bppStipplePixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
+register DrawablePtr pDrawable ;
+GC *pGC ;
+int nInit ; /* number of spans to fill */
+DDXPointPtr pptInit ; /* pointer to list of start points */
+int *pwidthInit ; /* pointer to list of n widths */
+int fSorted ;
+{
+ register unsigned char *pdst ; /* pointer to current word in bitmap */
+ register int *psrc ; /* pointer to current word in tile */
+ register unsigned long int pm, npm ;
+ register unsigned long int fg ;
+ register int alu ;
+ /* next three parameters are post-clip */
+ int n ; /* number of spans to fill */
+ register DDXPointPtr ppt ; /* pointer to list of start points */
+ register int *pwidth ; /* pointer to list of n widths */
+ PixmapPtr pTile ; /* pointer to tile we want to fill with */
+ int width, x, xSrc, ySrc ;
+ int tlwidth, tileWidth ;
+ unsigned char *psrcT ;
+ int *pwidthFree ; /* copies of the pointers to free */
+ DDXPointPtr pptFree ;
+ int xoff, count, stip, i ;
+
+ TRACE(("xf4bppStipplePixmapFS(pDrawable=0x%x, pGC=0x%x, nInit=%d, pptInit=0x%x, pwidthInit=0x%x, fSorted=%d)\n",
+ pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)) ;
+
+ if ( pDrawable->type != DRAWABLE_PIXMAP ) {
+ ErrorF( "xf4bppStippleWindowFS: drawable is not a pixmap\n") ;
+ return ;
+ }
+ if ( pGC->stipple->drawable.depth != 1 ) {
+ ErrorF( "ppcStippleFS: bad depth\ntype = %d, depth = %d\n",
+ pDrawable->type, pGC->stipple->drawable.depth ) ;
+ return ;
+ }
+
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ return ;
+
+ SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
+ ppt, pwidthFree, pptFree, fSorted ) ;
+
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+
+ pTile = pGC->stipple ;
+ tlwidth = pTile->devKind ;
+
+ tileWidth = pTile->drawable.width ;
+
+ npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
+
+ /* this replaces rotating the stipple. Instead, we just adjust the offset
+ * at which we start grabbing bits from the stipple */
+ xSrc = pGC->patOrg.x + pDrawable->x;
+ ySrc = pGC->patOrg.y + pDrawable->y;
+
+ while ( n-- ) {
+ pdst = ( (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr )
+ + ( ppt->y * ( (int) ( ( (PixmapPtr) pDrawable )->devKind ) ) )
+ + ppt->x ;
+ psrcT = (unsigned char *)pTile->devPrivate.ptr
+ + ( modulo( ppt->y - ySrc, pTile->drawable.height ) * tlwidth ) ;
+ x = ppt->x ;
+
+ xoff = modulo( x - xSrc, tileWidth) ;
+ for ( width = *pwidth ; width ; psrc++, width -= count, xoff+=count ) {
+
+ if ( xoff >= tileWidth ) xoff -= tileWidth;
+
+ if ( width < 8 )
+ count = width;
+ else
+ count = 8;
+
+ stip = vgagetbits( xoff, tileWidth, psrcT ) ;
+
+ for ( i = count ; i-- ; ) {
+ if ( stip & 128 )
+ {
+ unsigned _p;
+ DoRop( _p, alu, fg, *pdst ) ;
+ *pdst = ( *pdst & npm ) | ( pm & _p ) ;
+ }
+#ifdef notdef /* PURDUE */
+ *pdst = ( *pdst & npm ) | ( pm & DoRop( alu, fg, *pdst ) ) ;
+#endif /* PURDUE */
+ pdst++ ;
+ stip = SCRLEFT( stip, 1 ) ;
+ }
+ }
+ ppt++ ;
+ pwidth++ ;
+ }
+ DEALLOCATE_LOCAL( pptFree ) ;
+ DEALLOCATE_LOCAL( pwidthFree ) ;
+ return ;
+}
+
+void
+xf4bppOpStipplePixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
+DrawablePtr pDrawable ;
+GC *pGC ;
+int nInit ; /* number of spans to fill */
+DDXPointPtr pptInit ; /* pointer to list of start points */
+int *pwidthInit ; /* pointer to list of n widths */
+int fSorted ;
+{
+ register unsigned char *pdst ; /* pointer to current word in bitmap */
+ register unsigned long int pm, npm ;
+ register unsigned long int fg, bg ;
+ register int alu ;
+ /* next three parameters are post-clip */
+ int n ; /* number of spans to fill */
+ register DDXPointPtr ppt ; /* pointer to list of start points */
+ register int *pwidth ; /* pointer to list of n widths */
+ register int *psrc ; /* pointer to current word in tile */
+ PixmapPtr pTile ; /* pointer to tile we want to fill with */
+ int width ;
+ int xSrc, ySrc ;
+ int tlwidth, tileWidth ;
+ unsigned char *psrcT ;
+ int *pwidthFree ; /* copies of the pointers to free */
+ DDXPointPtr pptFree ;
+ int xoff, count, stip, i ;
+
+ TRACE( ( "xf4bppOpStipplePixmapFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
+ pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
+
+ if ( pGC->stipple->drawable.depth != 1 ) {
+ ErrorF( "xf4bppOpStipplePixmapFS: bad depth\ntype = %d, depth = %d\n",
+ pDrawable->type, pGC->stipple->drawable.depth ) ;
+ return ;
+ }
+
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ return ;
+
+ SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
+ ppt, pwidthFree, pptFree, fSorted ) ;
+
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+ bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
+
+ pTile = pGC->stipple ;
+ tlwidth = pTile->devKind ;
+ tileWidth = pTile->drawable.width ;
+
+ xSrc = pGC->patOrg.x + pDrawable->x;
+ ySrc = pGC->patOrg.y + pDrawable->y;
+
+ /* this replaces rotating the stipple. Instead, we just adjust the offset
+ * at which we start grabbing bits from the stipple */
+ for ( ; n-- ; ppt++, pwidth++ ) {
+ pdst = ( (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr )
+ + ( ppt->y * ( (int) ( (PixmapPtr) pDrawable )->devKind ) )
+ + ppt->x ;
+ psrcT = (unsigned char *)pTile->devPrivate.ptr
+ + ( modulo( ppt->y - ySrc, pTile->drawable.height ) * tlwidth ) ;
+
+ xoff = modulo( ppt->x - xSrc, tileWidth) ;
+
+ for ( width = *pwidth ; width ; psrc++, width -= count, xoff+=count ) {
+
+ if ( xoff >= tileWidth ) xoff -= tileWidth;
+
+ if ( width < 8 )
+ count = width;
+ else
+ count = 8;
+
+ stip = vgagetbits( xoff, tileWidth, psrcT ) ;
+ for ( i = count ; i-- ; pdst++, stip = SCRLEFT( stip, 1 ) )
+ if ( stip & 128 )
+ {
+ unsigned _p;
+ DoRop( _p, alu, fg, *pdst ) ;
+ *pdst = ( *pdst & npm ) | ( pm & _p ) ;
+ }
+#ifdef notdef /* PURDUE */
+ *pdst = ( *pdst & npm ) | ( pm & DoRop( alu, fg, *pdst ) ) ;
+#endif /* PURDUE */
+ else
+ {
+ unsigned _p;
+ DoRop( _p, alu, bg, *pdst ) ;
+ *pdst = ( *pdst & npm ) | ( pm & _p ) ;
+ }
+#ifdef notdef /* PURDUE */
+ *pdst = ( *pdst & npm ) | ( pm & DoRop( alu, bg, *pdst ) ) ;
+#endif /* PURDUE */
+ }
+ }
+ DEALLOCATE_LOCAL( pptFree ) ;
+ DEALLOCATE_LOCAL( pwidthFree ) ;
+ return ;
+}
+
+void
+xf4bppTilePixmapFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
+register DrawablePtr pDrawable ;
+GC *pGC ;
+int nInit ; /* number of spans to fill */
+DDXPointPtr pptInit ; /* pointer to list of start points */
+int *pwidthInit ; /* pointer to list of n widths */
+int fSorted ;
+{
+ register DDXPointPtr ppt ; /* pointer to list of start points */
+ register int *pwidth ; /* pointer to list of n widths */
+ register unsigned char *pdst ; /* pointer to current word in bitmap */
+ register unsigned char *psrc ; /* pointer to current word in tile */
+ register PixmapPtr pTile ; /* pointer to tile we want to fill with */
+ int i ;
+ int alu ;
+ unsigned char pm, npm ;
+ /* next three parameters are post-clip */
+ int n ; /* number of spans to fill */
+ int tileWidth ;
+ int xSrc, ySrc;
+ unsigned char *psrcT ;
+ int *pwidthFree ; /* copies of the pointers to free */
+ DDXPointPtr pptFree ;
+
+ TRACE( ( "ppcTileFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
+ pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
+
+ if ( ( pDrawable->depth == 1 ) && ( pDrawable->type == DRAWABLE_PIXMAP ) ) {
+ mfbTileFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ;
+ return ;
+ }
+ if ( !xf4bppDepthOK( pDrawable, pGC->tile.pixmap->drawable.depth ) ) {
+ ErrorF( "ppcTileFS: bad depth\ntype = %d, depth = %d\n",
+ pDrawable->type, pDrawable->depth) ;
+ return ;
+ }
+
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ return ;
+
+ SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
+ ppt, pwidthFree, pptFree, fSorted ) ;
+
+ /* the following code is for 8 bits per pixel addressable memory only */
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ npm = ( ~ pm ) & ( ( 1 << pDrawable->depth ) - 1 ) ;
+ pTile = pGC->tile.pixmap ;
+ tileWidth = pTile->drawable.width ;
+
+ xSrc = pGC->patOrg.x + pDrawable->x;
+ ySrc = pGC->patOrg.y + pDrawable->y;
+ /* this replaces rotating the tile. Instead we just adjust the offset
+ * at which we start grabbing bits from the tile */
+ for ( ; n-- ; ppt++, pwidth++ ) {
+ pdst = ( (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr )
+ + ( ppt->y * ( (int) ( (PixmapPtr) pDrawable )->devKind ) )
+ + ppt->x ;
+ psrcT = (unsigned char *) pTile->devPrivate.ptr
+ + ( modulo( ppt->y - ySrc, pTile->drawable.height) * pTile->devKind ) ;
+
+ psrc = psrcT + modulo( ppt->x - xSrc, tileWidth ) ;
+ for ( i = *pwidth ; i-- ; pdst++, psrc++ ) {
+ if ( psrc >= ( psrcT + tileWidth ) )
+ psrc = psrcT ;
+ {
+ unsigned _p;
+ DoRop( _p, alu, *psrc, *pdst ) ;
+ *pdst = ( *pdst & npm ) | ( pm & _p ) ;
+ }
+#ifdef notdef /* PURDUE */
+ *pdst = ( *pdst & npm ) | ( pm & DoRop( alu, *psrc, *pdst ) ) ;
+#endif /* PURDUE */
+ }
+ }
+ DEALLOCATE_LOCAL( pptFree ) ;
+ DEALLOCATE_LOCAL( pwidthFree ) ;
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcPixmap.c b/hw/xfree86/xf4bpp/ppcPixmap.c
new file mode 100644
index 000000000..2317fbdfa
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcPixmap.c
@@ -0,0 +1,144 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPixmap.c,v 1.5 2000/04/27 16:26:49 eich Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* $XConsortium: ppcPixmap.c /main/5 1996/02/21 17:58:00 kaleb $ */
+
+#include "xf4bpp.h"
+#include "servermd.h"
+#include "OScompiler.h"
+#include "ibmTrace.h"
+#include "scrnintstr.h"
+
+PixmapPtr
+xf4bppCreatePixmap( pScreen, width, height, depth )
+ ScreenPtr pScreen ;
+ int width ;
+ int height ;
+ int depth ;
+{
+ register PixmapPtr pPixmap = (PixmapPtr)NULL;
+ int size ;
+
+ TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d)\n", pScreen, width, height, depth)) ;
+
+ if ( depth > 8 )
+ return (PixmapPtr) NULL ;
+
+ size = PixmapBytePad(width, depth);
+ pPixmap = AllocatePixmap (pScreen, (height * size));
+
+ if ( !pPixmap )
+ return (PixmapPtr) NULL ;
+ pPixmap->drawable.type = DRAWABLE_PIXMAP ;
+ pPixmap->drawable.class = 0 ;
+ pPixmap->drawable.pScreen = pScreen ;
+ pPixmap->drawable.depth = depth ;
+ pPixmap->drawable.id = 0 ;
+ pPixmap->drawable.bitsPerPixel = ( depth == 1 ) ? 1 : 8 ;
+ pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER ;
+ pPixmap->drawable.x = 0 ;
+ pPixmap->drawable.y = 0 ;
+ pPixmap->drawable.width = width ;
+ pPixmap->drawable.height = height ;
+ pPixmap->devKind = size;
+ pPixmap->refcnt = 1 ;
+ size = height * pPixmap->devKind ;
+#ifdef PIXPRIV
+ pPixmap->devPrivate.ptr = (pointer) (((CARD8*)pPixmap)
+ + pScreen->totalPixmapSize);
+#else
+ pPixmap->devPrivate.ptr = (pointer) (pPixmap + 1);
+#endif
+ bzero( (char *) pPixmap->devPrivate.ptr, size ) ;
+ return pPixmap ;
+}
+
+PixmapPtr
+xf4bppCopyPixmap(pSrc)
+ register PixmapPtr pSrc;
+{
+ register PixmapPtr pDst;
+ int size;
+
+ TRACE(("xf4bppCopyPixmap(pSrc=0x%x)\n", pSrc)) ;
+ size = pSrc->drawable.height * pSrc->devKind;
+ pDst = xalloc(sizeof(PixmapRec) + size);
+ if (!pDst)
+ return NullPixmap;
+ pDst->drawable = pSrc->drawable;
+ pDst->drawable.id = 0;
+ pDst->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ pDst->devKind = pSrc->devKind;
+ pDst->refcnt = 1;
+ pDst->devPrivate.ptr = (pointer)(pDst + 1);
+ MOVE( (char *)pSrc->devPrivate.ptr, (char *)pDst->devPrivate.ptr, size ) ;
+ return pDst;
+}
diff --git a/hw/xfree86/xf4bpp/ppcPntWin.c b/hw/xfree86/xf4bpp/ppcPntWin.c
new file mode 100644
index 000000000..e61fed342
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcPntWin.c
@@ -0,0 +1,218 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPntWin.c,v 1.3 1999/06/06 08:49:01 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* $XConsortium: ppcPntWin.c /main/5 1996/02/21 17:58:04 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "mi.h"
+#include "scrnintstr.h"
+#include "ibmTrace.h"
+
+/* NOTE: These functions only work for visuals up to 31-bits deep */
+static void xf4bppPaintWindowSolid(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ RegionPtr,
+ int
+#endif
+);
+static void xf4bppPaintWindowTile(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ RegionPtr,
+ int
+#endif
+);
+
+void
+xf4bppPaintWindow(pWin, pRegion, what)
+ WindowPtr pWin;
+ RegionPtr pRegion;
+ int what;
+{
+
+ register mfbPrivWin *pPrivWin;
+ pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
+
+ TRACE(("xf4bppPaintWindow( pWin= 0x%x, pRegion= 0x%x, what= %d )\n",
+ pWin,pRegion,what));
+
+ switch (what) {
+ case PW_BACKGROUND:
+ switch (pWin->backgroundState) {
+ case None:
+ return;
+ case ParentRelative:
+ do {
+ pWin = pWin->parent;
+ } while (pWin->backgroundState == ParentRelative);
+ (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
+ what);
+ return;
+ case BackgroundPixmap:
+ if (pPrivWin->fastBackground)
+ {
+ xf4bppPaintWindowTile(pWin, pRegion, what);
+ return;
+ }
+ break;
+ case BackgroundPixel:
+ xf4bppPaintWindowSolid(pWin, pRegion, what);
+ return;
+ }
+ break;
+ case PW_BORDER:
+ if (pWin->borderIsPixel)
+ {
+ xf4bppPaintWindowSolid(pWin, pRegion, what);
+ return;
+ }
+ else if (pPrivWin->fastBorder)
+ {
+ xf4bppPaintWindowTile(pWin, pRegion, what);
+ return;
+ }
+ break;
+ }
+ miPaintWindow(pWin, pRegion, what);
+}
+
+static void
+xf4bppPaintWindowSolid(pWin, pRegion, what)
+ register WindowPtr pWin;
+ register RegionPtr pRegion;
+ int what;
+{
+ register int nbox;
+ register BoxPtr pbox;
+ register unsigned long int pixel;
+ register unsigned long int pm ;
+
+ TRACE(("xf4bppPaintWindowSolid(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin, pRegion, what));
+
+ if ( !( nbox = REGION_NUM_RECTS(pRegion)))
+ return ;
+ pbox = REGION_RECTS(pRegion);
+
+ if (what == PW_BACKGROUND)
+ pixel = pWin->background.pixel;
+ else
+ pixel = pWin->border.pixel;
+
+ pm = ( 1 << pWin->drawable.depth ) - 1 ;
+ for ( ; nbox-- ; pbox++ ) {
+ /*
+ * call fill routine, the parms are:
+ * fill(color, alu, planes, x, y, width, height);
+ */
+ xf4bppFillSolid( pWin, pixel, GXcopy, pm, pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1 ) ;
+ }
+ return ;
+}
+
+static void
+xf4bppPaintWindowTile(pWin, pRegion, what)
+ register WindowPtr pWin;
+ register RegionPtr pRegion;
+ int what;
+{
+ register int nbox;
+ register BoxPtr pbox;
+ register PixmapPtr pTile;
+ register unsigned long int pm ;
+
+ TRACE(("xf4bppPaintWindowTile(pWin= 0x%x, pRegion= 0x%x, what= %d)\n", pWin, pRegion, what));
+
+ if ( !( nbox = REGION_NUM_RECTS(pRegion)))
+ return ;
+ pbox = REGION_RECTS(pRegion);
+
+ if (what == PW_BACKGROUND)
+ pTile = pWin->background.pixmap;
+ else
+ pTile = pWin->border.pixmap;
+
+ pm = ( 1 << pWin->drawable.depth ) - 1 ;
+ for ( ; nbox-- ; pbox++ ) {
+ /*
+ * call tile routine, the parms are:
+ * tile(tile, alu, planes, x, y, width, height,xSrc,ySrc);
+ */
+ xf4bppTileRect(pWin, pTile, GXcopy, pm,
+ pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+ pWin->drawable.x, pWin->drawable.y );
+ }
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcPolyPnt.c b/hw/xfree86/xf4bpp/ppcPolyPnt.c
new file mode 100644
index 000000000..d080a623f
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcPolyPnt.c
@@ -0,0 +1,141 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPolyPnt.c,v 1.4 1999/09/25 14:38:17 dawes Exp $ */
+/*
+
+Copyright (c) 1987 X Consortium
+
+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 X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the X Consortium.
+
+
+Copyright IBM Corporation 1987,1988,1989
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM 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.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+*/
+/* $XConsortium: ppcPolyPnt.c /main/5 1996/02/21 17:58:07 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "mi.h"
+#include "scrnintstr.h"
+#include "ppcGCstr.h"
+#include "ibmTrace.h"
+
+void
+xf4bppPolyPoint( pDrawable, pGC, mode, npt, pptInit )
+DrawablePtr pDrawable ;
+GCPtr pGC ;
+int mode ; /* Origin or Previous */
+int npt ;
+xPoint *pptInit ;
+{
+register xPoint *ppt ;
+ppcPrivGC *devPriv ;
+int alu ;
+int nptTmp ;
+
+TRACE( ("xf4bppPolyPoint(0x%x,0x%x,%d,%d,0x%x)\n",
+ pDrawable, pGC, mode, npt, pptInit ) ) ;
+
+if ( pDrawable->type == DRAWABLE_PIXMAP ) {
+ if ( pGC->alu != GXnoop )
+ miPolyPoint( pDrawable, pGC, mode, npt, pptInit ) ;
+ return ;
+}
+
+devPriv = (ppcPrivGC *) ( pGC->devPrivates[mfbGCPrivateIndex].ptr ) ;
+if ( ( alu = devPriv->colorRrop.alu ) == GXnoop )
+ return ;
+
+/* make pointlist origin relative */
+if ( mode == CoordModePrevious )
+ for ( ppt = pptInit, nptTmp = npt ; --nptTmp ; ) {
+ ppt++ ;
+ ppt->x += (ppt-1)->x ;
+ ppt->y += (ppt-1)->y ;
+ }
+
+if ( pGC->miTranslate ) {
+ register int xorg = pDrawable->x ;
+ register int yorg = pDrawable->y ;
+ for ( ppt = pptInit, nptTmp = npt ; nptTmp-- ; ppt++ ) {
+ ppt->x += xorg ;
+ ppt->y += yorg ;
+ }
+}
+
+{
+ register RegionPtr pRegion = pGC->pCompositeClip ;
+ register unsigned long int fg = devPriv->colorRrop.fgPixel ;
+ register unsigned long int pm = devPriv->colorRrop.planemask ;
+ BoxRec box ; /* Scratch Space */
+
+ if ( ! REGION_NUM_RECTS(pRegion))
+ return ;
+
+ for ( ppt = pptInit ; npt-- ; ppt++ )
+ if (POINT_IN_REGION(pDrawable->pScreen, pRegion,
+ ppt->x, ppt->y, &box))
+ xf4bppFillSolid( (WindowPtr)pDrawable,
+ fg, alu, pm, ppt->x, ppt->y, 1, 1 ) ;
+}
+
+return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcPolyRec.c b/hw/xfree86/xf4bpp/ppcPolyRec.c
new file mode 100644
index 000000000..754eb3732
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcPolyRec.c
@@ -0,0 +1,127 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcPolyRec.c,v 1.3 1999/06/06 08:49:01 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* $XConsortium: ppcPolyRec.c /main/4 1996/02/21 17:58:11 kaleb $ */
+
+#include "xf4bpp.h"
+
+void
+xf4bppPolyRectangle(pDraw, pGC, nrects, pRects)
+ DrawablePtr pDraw;
+ GCPtr pGC;
+ int nrects;
+ xRectangle *pRects;
+{
+ int i;
+ xRectangle *pR = pRects;
+ xRectangle *tmprects, *tmprectsinit;
+ int lw, fs, ss;
+
+ if ( ! ( tmprectsinit = tmprects = (xRectangle *)ALLOCATE_LOCAL( ( sizeof ( xRectangle ) * nrects ) << 2 ) ) )
+ return;
+
+ lw = pGC->lineWidth;
+ ss = lw >> 1; /* skinny side of line */
+ fs = ( lw + 1 ) >> 1; /* fat side of line */
+
+ for (i=0; i<nrects; i++)
+ {
+ tmprects->x = pR->x - ss;
+ tmprects->y = pR->y - ss;
+ tmprects->width = pR->width + lw;
+ tmprects->height = lw;
+ tmprects++;
+
+ tmprects->x = pR->x - ss;
+ tmprects->y = pR->y + fs;
+ tmprects->width = lw;
+ tmprects->height = pR->height - lw;
+ tmprects++;
+
+ tmprects->x = pR->x + pR->width - ss;
+ tmprects->y = pR->y + fs;
+ tmprects->width = lw;
+ tmprects->height = pR->height - lw;
+ tmprects++;
+
+ tmprects->x = pR->x - ss;
+ tmprects->y = pR->y + pR->height - ss;
+ tmprects->width = pR->width + lw;
+ tmprects->height = lw;
+ tmprects++;
+
+ pR++;
+ }
+
+ (* pGC->ops->PolyFillRect)( pDraw, pGC, nrects << 2, tmprectsinit );
+
+ DEALLOCATE_LOCAL( tmprectsinit );
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcQuery.c b/hw/xfree86/xf4bpp/ppcQuery.c
new file mode 100644
index 000000000..57d5fcff8
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcQuery.c
@@ -0,0 +1,44 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcQuery.c,v 1.3 1999/06/06 08:49:01 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: ppcQuery.c /main/3 1996/02/21 17:58:18 kaleb $ */
+
+#include "xf4bpp.h"
+
+void
+xf4bppQueryBestSize
+(
+ register int class,
+ register unsigned short *pwidth,
+ register unsigned short *pheight,
+ ScreenPtr pScreen
+)
+{
+if ( class == CursorShape )
+ *pwidth = *pheight = 32 ; /* ppc's cursor max out at 32 by 32 */
+else /* either TileShape or StippleShape */
+ /* Round Up To Nearest Multiple Of 8 -- We don't care what height they use */
+ *pwidth = ( *pwidth + 0x7 ) & ~ 0x7 ;
+
+return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcRslvC.c b/hw/xfree86/xf4bpp/ppcRslvC.c
new file mode 100644
index 000000000..5d33bc3c9
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcRslvC.c
@@ -0,0 +1,176 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcRslvC.c,v 1.5 2001/12/17 20:00:46 dawes Exp $ */
+/************************************************************
+Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
+
+ 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 no-
+tice appear in all copies and that both that copyright no-
+tice and this permission notice appear in supporting docu-
+mentation, and that the names of Sun or X Consortium
+not be used in advertising or publicity pertaining to
+distribution of the software without specific prior
+written permission. Sun and X Consortium make no
+representations about the suitability of this software for
+any purpose. It is provided "as is" without any express or
+implied warranty.
+
+SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
+NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
+ABLE 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.
+
+********************************************************/
+
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/* $XConsortium: ppcRslvC.c /main/7 1996/02/21 17:58:25 kaleb $ */
+
+/* Generic Color Resolution Scheme
+ * P. Shupak 12/31/87
+ */
+
+#include "xf4bpp.h"
+#include "scrnintstr.h"
+
+/*
+ * New colormap routines that can support multiple Visual types.
+ */
+
+static unsigned short defstaticpalette[16][3] = {
+ /* R G B */
+ { 0x0000, 0x0000, 0x0000 }, /* black */
+ { 0xFFFF, 0xFFFF, 0xFFFF }, /* white */
+ { 0xAAAA, 0xAAAA, 0xAAAA }, /* grey */
+ { 0x0000, 0x0000, 0xAAAA }, /* dark blue */
+ { 0x0000, 0x0000, 0xFFFF }, /* medium blue */
+ { 0x0000, 0xAAAA, 0xFFFF }, /* light blue */
+ { 0x0000, 0xFFFF, 0xFFFF }, /* cyan */
+ { 0x0000, 0xAAAA, 0x0000 }, /* dark green */
+ { 0x0000, 0xFFFF, 0x0000 }, /* green */
+ { 0xAAAA, 0xFFFF, 0x5555 }, /* pale green */
+ { 0xAAAA, 0x5555, 0x0000 }, /* brown */
+ { 0xFFFF, 0xAAAA, 0x0000 }, /* light brown */
+ { 0xFFFF, 0xFFFF, 0x0000 }, /* yellow */
+ { 0xAAAA, 0x0000, 0xAAAA }, /* purple */
+ { 0xFFFF, 0x0000, 0xFFFF }, /* magenta */
+ { 0xFFFF, 0x0000, 0x0000 }, /* red */
+ };
+
+Bool
+xf4bppInitializeColormap(pmap)
+ register ColormapPtr pmap;
+{
+ register unsigned i;
+ register VisualPtr pVisual;
+ unsigned lim, maxent, shift;
+
+ pVisual = pmap->pVisual;
+ lim = (1 << pVisual->bitsPerRGBValue) - 1;
+ shift = 16 - pVisual->bitsPerRGBValue;
+ maxent = pVisual->ColormapEntries - 1;
+
+ switch( pVisual->class )
+ {
+ case StaticGray:
+ for ( i = 0 ; i < maxent ; i++ ) {
+ pmap->red[i].co.local.red =
+ pmap->red[i].co.local.green =
+ pmap->red[i].co.local.blue =
+ ((((i * 65535) / maxent) >> shift) * 65535) / lim;
+ }
+ break;
+ case StaticColor:
+ for ( i = 0 ; i < 16 ; i++ ) {
+ pmap->red[i].co.local.red = (defstaticpalette[i][0]);
+ pmap->red[i].co.local.green = (defstaticpalette[i][1]);
+ pmap->red[i].co.local.blue = (defstaticpalette[i][2]);
+ }
+ break;
+ case GrayScale:
+ case PseudoColor:
+ for(i=0;i<=maxent;i++) {
+ int a,b,c;
+ a = i << 10;
+ b = i << 12;
+ c = i << 14;
+ pmap->red[i].co.local.red = a;
+ pmap->red[i].co.local.green = b;
+ pmap->red[i].co.local.blue = c;
+ }
+ break;
+ case TrueColor:
+ case DirectColor:
+ default:
+ ErrorF( "Unsupported Visual class %d\b", pVisual->class );
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void
+xf4bppResolveColor( pred, pgreen, pblue, pVisual )
+register unsigned short* pred ;
+register unsigned short* pgreen ;
+register unsigned short* pblue ;
+register VisualPtr pVisual ;
+{
+ unsigned lim, maxent, shift;
+
+ lim = (1 << pVisual->bitsPerRGBValue) - 1;
+ shift = 16 - pVisual->bitsPerRGBValue;
+ maxent = pVisual->ColormapEntries - 1;
+
+ switch( pVisual->class )
+ {
+ case StaticGray:
+ *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
+ *pred = (((*pred * (maxent + 1)) >> 16) * 65535) / maxent;
+ *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
+ break;
+ case StaticColor:
+ break;
+ case GrayScale:
+ *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
+ *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
+ break;
+ case PseudoColor:
+ /* rescale to rgb bits */
+ *pred = ((*pred >> shift) * 65535) / lim;
+ *pgreen = ((*pgreen >> shift) * 65535) / lim;
+ *pblue = ((*pblue >> shift) * 65535) / lim;
+ break;
+ case TrueColor:
+ case DirectColor:
+ default:
+ ErrorF( "Unsupported Visual class %d\b", pVisual->class );
+ }
+}
+
diff --git a/hw/xfree86/xf4bpp/ppcSetSp.c b/hw/xfree86/xf4bpp/ppcSetSp.c
new file mode 100644
index 000000000..81294b2cc
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcSetSp.c
@@ -0,0 +1,315 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcSetSp.c,v 1.3 1999/06/06 08:49:02 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/***********************************************************
+
+Copyright (c) 1987 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* $XConsortium: ppcSetSp.c /main/5 1996/02/21 17:58:32 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "servermd.h"
+
+/* SetScanline -- copies the bits from psrc to the drawable starting at
+ * (xStart, y) and continuing to (xEnd, y). xOrigin tells us where psrc
+ * starts on the scanline. (I.e., if this scanline passes through multiple
+ * boxes, we may not want to start grabbing bits at psrc but at some offset
+ * further on.)
+ */
+static void
+ppcSetScanline
+(
+ register int pixCount, /* width of scanline in bits */
+ register char *psrc,
+ register unsigned char *pdst, /* where to put the bits */
+ register int pm, /* plane mask */
+ const int alu /* raster op */
+)
+{
+register int npm = ~pm ; /* inverted plane mask */
+register char tmpx ;
+
+pm &= 0x0F; npm &= 0x0F; /* GJA */
+
+switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ while ( pixCount-- )
+ *pdst++ &= npm ;
+ break ;
+ case GXand: /* 0x1 src AND dst */
+ while ( pixCount-- )
+ *pdst++ &= *psrc++ | npm ;
+ break ;
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ for ( ; pixCount-- ; pdst++, psrc++ ) {
+ tmpx = *pdst;
+ *pdst = ( tmpx & npm ) | ( pm & *psrc & ~tmpx ) ;
+ }
+ break ;
+ case GXcopy: /* 0x3 src */
+ for ( ; pixCount-- ; pdst++, psrc++ )
+ *pdst = ( *pdst & npm ) | ( pm & *psrc ) ;
+ break ;
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ while ( pixCount-- )
+ *pdst++ &= npm | ~*psrc++ ;
+ break ;
+ case GXnoop: /* 0x5 dst */
+ break ;
+ case GXxor: /* 0x6 src XOR dst */
+ while ( pixCount-- )
+ *pdst++ ^= pm & *psrc++ ;
+ break ;
+ case GXor: /* 0x7 src OR dst */
+ while ( pixCount-- )
+ *pdst++ |= *psrc++ & pm ;
+ break ;
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ for ( ; pixCount-- ; pdst++, psrc++ ) {
+ tmpx = *pdst;
+ *pdst = ( tmpx & npm ) | ( pm & ~( tmpx | *psrc ) ) ;
+ }
+ break ;
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ while ( pixCount-- )
+ *pdst++ ^= pm & ~ *psrc++ ;
+ break ;
+ case GXorReverse: /* 0xb src OR NOT dst */
+ for ( ; pixCount-- ; pdst++, psrc++ ) {
+ tmpx = *pdst;
+ *pdst = ( tmpx & npm ) | ( pm & ( *psrc | ~tmpx ) ) ;
+ }
+ break ;
+ case GXinvert: /* 0xa NOT dst */
+ while ( pixCount-- )
+ *pdst++ ^= pm ;
+ break ;
+ case GXcopyInverted: /* 0xc NOT src */
+ for ( ; pixCount-- ; pdst++, psrc++ )
+ *pdst = ( *pdst & npm ) | ( pm & ~ *psrc ) ;
+ break ;
+ case GXorInverted: /* 0xd NOT src OR dst */
+ while ( pixCount-- )
+ *pdst++ |= pm & ~ *psrc++ ;
+ break ;
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ for ( ; pixCount-- ; pdst++, psrc++ ) {
+ tmpx = *pdst;
+ *pdst = ( tmpx & npm ) | ( pm & ~( tmpx & *psrc ) ) ;
+ }
+ break ;
+ case GXset: /* 0xf 1 */
+ while ( pixCount-- )
+ *pdst++ |= pm ;
+ break ;
+ default:
+ ErrorF( "ppcSetScanLine: bad alu value == 0x%02X\n", alu ) ;
+ break ;
+}
+
+return ;
+}
+
+/* SetSpans -- for each span copy pwidth[i] bits from psrc to pDrawable at
+ * ppt[i] using the raster op from the GC. If fSorted is TRUE, the scanlines
+ * are in increasing Y order.
+ * Source bit lines are server scanline padded so that they always begin
+ * on a word boundary.
+ */
+void
+xf4bppSetSpans( pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted )
+ register DrawablePtr pDrawable ;
+ GCPtr pGC ;
+ char *psrc ;
+ register DDXPointPtr ppt ;
+ int *pwidth ;
+ int nspans ;
+ int fSorted ;
+{
+ unsigned char *pdstBase = NULL; /* start of dst bitmap */
+ int widthDst = 0; /* width of bitmap in words */
+ register BoxPtr pbox, pboxLast, pboxTest ;
+ register DDXPointPtr pptLast ;
+ RegionPtr prgnDst ;
+ register int width ;
+ int xStart, xEnd ;
+ int yMax ;
+ int alu ;
+ int pm ;
+
+ /* allow for 1-deep windows on nfb machines (eg apa8, aed) */
+ if ( ( pDrawable->depth == 1 ) && ( pDrawable->type == DRAWABLE_PIXMAP ) ) {
+ mfbSetSpans( pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted ) ;
+ return ;
+ }
+
+ if ( !( pm = pGC->planemask & ~( (~0) << pDrawable->depth ) )
+ || ( ( alu = pGC->alu ) == GXnoop ) )
+ return ;
+
+ prgnDst = pGC->pCompositeClip ;
+
+ if ( ! REGION_NUM_RECTS(prgnDst))
+ return ;
+
+ pboxLast = ( pbox = REGION_RECTS(prgnDst) ) + REGION_NUM_RECTS(prgnDst);
+ pptLast = ppt + nspans ;
+
+ if ( pDrawable->type == DRAWABLE_WINDOW ) {
+ yMax = (int) pDrawable->height + pDrawable->y ;
+ }
+ else {
+ pdstBase = (unsigned char *) ( (PixmapPtr) pDrawable )->devPrivate.ptr ;
+ widthDst = (int) ( (PixmapPtr) pDrawable )->devKind ;
+ yMax = pDrawable->height ;
+ }
+
+ if ( fSorted ) {
+ /* scan lines sorted in ascending order. Because they are sorted, we
+ * don't have to check each scanline against each clip box. We can be
+ * sure that this scanline only has to be clipped to boxes at or after the
+ * beginning of this y-band
+ */
+ for ( pboxTest = pbox ;
+ ( ppt < pptLast ) && ( ppt->y < yMax ) ;
+ ppt++, pwidth++,
+ psrc += PixmapBytePad( width, pDrawable->depth ) ) {
+ width = *pwidth ;
+ for ( pbox = pboxTest ;
+ pbox < pboxLast ;
+ pbox++ ) {
+ if ( pbox->y2 <= ppt->y ) {
+ /* clip box is before scanline */
+ pboxTest = pbox + 1 ;
+ }
+ else if ( ( pbox->y1 > ppt->y )
+ || ( pbox->x1 > ppt->x + width ) )
+ break ; /* scanline before clip box or left of clip box */
+ else if ( pbox->x2 > ppt->x ) {
+ /* some of the scanline is in the current clip box */
+ xStart = MAX( pbox->x1, ppt->x ) ;
+ xEnd = MIN( ppt->x + width, pbox->x2 ) ;
+ if ( pDrawable->type == DRAWABLE_PIXMAP )
+ ppcSetScanline( xEnd - xStart,
+ psrc + ( xStart - ppt->x ),
+ pdstBase + xStart
+ + ( ppt->y * widthDst ),
+ pm, alu ) ;
+ else
+ xf4bppDrawColorImage( (WindowPtr)pDrawable,
+ xStart, ppt->y, xEnd - xStart, 1,
+ (unsigned char *)psrc + ( xStart - ppt->x ),
+ xEnd - xStart, alu, pm ) ;
+ if ( ppt->x + width <= pbox->x2 )
+ break ; /* End of the line, as it were */
+ }
+ }
+ /* We've tried this line against every box ; it must be outside them
+ * all. move on to the next point */
+ }
+ }
+ else {
+ /* scan lines not sorted. We must clip each line against all the boxes */
+ for ( ;
+ ppt < pptLast ;
+ ppt++, pwidth++,
+ psrc += PixmapBytePad( width, pDrawable->depth ) ) {
+ width = *pwidth ;
+ if ( ppt->y >= 0 && ppt->y < yMax ) {
+ for ( pbox = REGION_RECTS(prgnDst) ; pbox < pboxLast ; pbox++ ) {
+ if ( pbox->y1 > ppt->y )
+ break ; /* rest of clip region is above this scanline */
+ else if ( ( pbox->y2 > ppt->y )
+ && ( pbox->x1 <= ppt->x + width )
+ && ( pbox->x2 > ppt->x ) ) {
+ xStart = MAX( pbox->x1, ppt->x ) ;
+ xEnd = MIN( pbox->x2, ppt->x + width ) ;
+ if ( pDrawable->type == DRAWABLE_PIXMAP )
+ ppcSetScanline( xEnd - xStart,
+ psrc + ( xStart - ppt->x ),
+ /* ^ GJA */
+ ( ( pdstBase
+ + ( ppt->y * widthDst ) )
+ + xStart ),
+ pm, alu ) ;
+ else /* pDrawable->type == DRAWABLE_WINDOW */
+ xf4bppDrawColorImage( (WindowPtr)pDrawable,
+ xStart, ppt->y, xEnd - xStart, 1,
+ (unsigned char *)psrc + ( xStart - ppt->x ),
+ /* GJA ^ */
+ xEnd - xStart, alu, pm ) ;
+ }
+
+ }
+ }
+ }
+ }
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcSpMcro.h b/hw/xfree86/xf4bpp/ppcSpMcro.h
new file mode 100644
index 000000000..7ea244f66
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcSpMcro.h
@@ -0,0 +1,45 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcSpMcro.h,v 1.2 1998/07/25 16:59:42 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: ppcSpMcro.h /main/3 1996/02/21 17:58:36 kaleb $ */
+
+/* This screwy macro is used in all the spans routines and you find
+ it all over the place, so it is a macro just to tidy things up.
+*/
+
+#define SETSPANPTRS(IN,N,IPW,PW,IPPT,PPT,FPW,FPPT,FSORT) \
+ { \
+ N = IN * miFindMaxBand(pGC->pCompositeClip); \
+ if(!(PW = (int *)ALLOCATE_LOCAL(N * sizeof(int)))) \
+ return; \
+ if(!(PPT = (DDXPointRec *)ALLOCATE_LOCAL(N * sizeof(DDXPointRec)))) \
+ { \
+ DEALLOCATE_LOCAL(PW); \
+ return; \
+ } \
+ FPW = PW; \
+ FPPT = PPT; \
+ N = miClipSpans(pGC->pCompositeClip, IPPT, IPW, IN, \
+ PPT, PW, FSORT); \
+ }
+
diff --git a/hw/xfree86/xf4bpp/ppcWinFS.c b/hw/xfree86/xf4bpp/ppcWinFS.c
new file mode 100644
index 000000000..29d466f00
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcWinFS.c
@@ -0,0 +1,278 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcWinFS.c,v 1.3 1999/06/06 08:49:02 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/******************************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+/* $XConsortium: ppcWinFS.c /main/3 1996/02/21 17:58:39 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "mi.h"
+#include "mispans.h"
+#include "ppcGCstr.h"
+#include "ppcSpMcro.h"
+#include "ibmTrace.h"
+
+#define LeftMostBitInScreenLongWord SCRLEFT( 0xFFFFFFFF, 31 )
+/*
+********** ********** ********** ********** ********** ********** **********
+ these routines all clip. they assume that anything that has called
+them has already translated the points (i.e. pGC->miTranslate is
+non-zero, which is howit gets set in mfbCreateGC().)
+
+ the number of new scanlines created by clipping ==
+MaxRectsPerBand * nSpans.
+********** ********** ********** ********** ********** ********** **********
+*/
+
+void
+xf4bppSolidWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
+ DrawablePtr pDrawable ;
+ GCPtr pGC ;
+ int nInit ; /* number of spans to fill */
+ DDXPointPtr pptInit ; /* pointer to list of start points */
+ int *pwidthInit ; /* pointer to list of n widths */
+ int fSorted ;
+{
+ register unsigned long int pm ;
+ register unsigned long int fg ;
+ register int alu ;
+ /* next three parameters are post-clip */
+ int n ; /* number of spans to fill */
+ register DDXPointPtr ppt ; /* pointer to list of start points */
+ register int *pwidth ; /* pointer to list of n widths */
+ int *pwidthFree ; /* copies of the pointers to free */
+ DDXPointPtr pptFree ;
+
+ TRACE( ( "xf4bppSolidWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
+ pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
+
+ if ( pDrawable->type != DRAWABLE_WINDOW ) {
+ ErrorF( "xf4bppSolidWindowFS: drawable is not a window\n") ;
+ return ;
+ }
+
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ return ;
+
+ n = nInit * miFindMaxBand( pGC->pCompositeClip ) ;
+ if ( !( pwidth = (int *) ALLOCATE_LOCAL( n * sizeof( int ) ) ) )
+ return ;
+ pwidthFree = pwidth ;
+
+ if ( !( ppt = (DDXPointRec *)
+ ALLOCATE_LOCAL( n * sizeof( DDXPointRec ) ) ) ) {
+ DEALLOCATE_LOCAL( pwidth ) ;
+ return ;
+ }
+ pptFree = ppt ;
+
+ n = miClipSpans( pGC->pCompositeClip, pptInit, pwidthInit, nInit,
+ ppt, pwidth, fSorted ) ;
+
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+
+ for ( ; n-- ; ppt++, pwidth++ )
+ if ( *pwidth )
+ xf4bppFillSolid( (WindowPtr)pDrawable,
+ fg, alu, pm, ppt->x, ppt->y, *pwidth, 1 ) ;
+
+ DEALLOCATE_LOCAL( pptFree ) ;
+ DEALLOCATE_LOCAL( pwidthFree ) ;
+ return ;
+}
+
+void
+xf4bppStippleWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
+DrawablePtr pDrawable ;
+register GC *pGC ;
+int nInit ; /* number of spans to fill */
+DDXPointPtr pptInit ; /* pointer to list of start points */
+int *pwidthInit ; /* pointer to list of n widths */
+int fSorted ;
+{
+ register unsigned long int pm ;
+ register unsigned long int fg ;
+ register int alu ;
+ /* next three parameters are post-clip */
+ int n ; /* number of spans to fill */
+ register DDXPointPtr ppt ; /* pointer to list of start points */
+ register int *pwidth ; /* pointer to list of n widths */
+ PixmapPtr pTile ; /* pointer to tile we want to fill with */
+ int xSrc ;
+ int ySrc ;
+ int *pwidthFree ; /* copies of the pointers to free */
+ DDXPointPtr pptFree ;
+
+ TRACE( ( "xf4bppStippleWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
+ pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
+
+ if ( pDrawable->type != DRAWABLE_WINDOW ) {
+ ErrorF( "xf4bppStippleWindowFS: drawable is not a window\n" ) ;
+ return ;
+ }
+
+ if ( pGC->stipple->drawable.depth != 1 ) {
+ ErrorF("ppcStippleFS: bad depth\ntype = %d, depth = %d\n",
+ pDrawable->type, pGC->stipple->drawable.depth ) ;
+ return ;
+ }
+
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ return ;
+
+ SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
+ ppt, pwidthFree, pptFree, fSorted ) ;
+
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+
+ xSrc = pGC->patOrg.x + pDrawable->x ;
+ ySrc = pGC->patOrg.y + pDrawable->y ;
+ pTile = pGC->stipple ;
+
+ for ( ; n-- ; ppt++, pwidth++ )
+ xf4bppFillStipple( (WindowPtr)pDrawable, pTile, fg, alu, pm,
+ ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ;
+
+ DEALLOCATE_LOCAL( pptFree ) ;
+ DEALLOCATE_LOCAL( pwidthFree ) ;
+
+ return ;
+}
+
+void
+xf4bppOpStippleWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
+DrawablePtr pDrawable ;
+register GC *pGC ;
+int nInit ; /* number of spans to fill */
+DDXPointPtr pptInit ; /* pointer to list of start points */
+int *pwidthInit ; /* pointer to list of n widths */
+int fSorted ;
+{
+ register DDXPointPtr ppt ; /* pointer to list of start points */
+ register int *pwidth ; /* pointer to list of n widths */
+ int n ; /* number of spans to fill */
+ int xSrc ;
+ int ySrc ;
+ unsigned long int pm ;
+ unsigned long int fg, bg ;
+ int alu ;
+ int *pwidthFree ; /* copies of the pointers to free */
+ DDXPointPtr pptFree ;
+
+ TRACE( ( "xf4bppOpStippleWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
+ pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
+
+ if ( pGC->stipple->drawable.depth != 1 ) {
+ ErrorF( "xf4bppOpStippleWindowFS: bad depth\ntype = %d, depth = %d\n",
+ pDrawable->type, pGC->stipple->drawable.depth ) ;
+ return ;
+ }
+
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ return ;
+
+ SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
+ ppt, pwidthFree, pptFree, fSorted ) ;
+
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+ fg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.fgPixel ;
+ bg = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.bgPixel ;
+
+ xSrc = pGC->patOrg.x + pDrawable->x ;
+ ySrc = pGC->patOrg.y + pDrawable->y ;
+
+ for ( ; n-- ; ppt++, pwidth++ )
+ xf4bppOpaqueStipple( (WindowPtr)pDrawable, pGC->stipple, fg, bg, alu, pm,
+ ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ;
+
+ DEALLOCATE_LOCAL( pptFree ) ;
+ DEALLOCATE_LOCAL( pwidthFree ) ;
+ return ;
+}
+
+void
+xf4bppTileWindowFS( pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted )
+DrawablePtr pDrawable ;
+register GC *pGC ;
+int nInit ; /* number of spans to fill */
+DDXPointPtr pptInit ; /* pointer to list of start points */
+int *pwidthInit ; /* pointer to list of n widths */
+int fSorted ;
+{
+ /* next three parameters are post-clip */
+ register DDXPointPtr ppt ; /* pointer to list of start points */
+ register int *pwidth ; /* pointer to list of n widths */
+ int n ; /* number of spans to fill */
+ unsigned char pm ;
+ int alu ;
+ int xSrc ;
+ int ySrc ;
+ int *pwidthFree ; /* copies of the pointers to free */
+ DDXPointPtr pptFree ;
+
+ TRACE( ( "xf4bppTileWindowFS(pDrawable=0x%x,pGC=0x%x,nInit=%d,pptInit=0x%x,pwidthInit=0x%x,fSorted=%d)\n",
+ pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted ) ) ;
+
+ if ( ( alu = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.alu ) == GXnoop )
+ return ;
+
+ SETSPANPTRS( nInit, n, pwidthInit, pwidth, pptInit,
+ ppt, pwidthFree, pptFree, fSorted ) ;
+
+ xSrc = pGC->patOrg.x + pDrawable->x ;
+ ySrc = pGC->patOrg.y + pDrawable->y ;
+ pm = ( (ppcPrivGC *) pGC->devPrivates[mfbGCPrivateIndex].ptr )->colorRrop.planemask ;
+
+ for ( ; n-- ; ppt++, pwidth++ )
+ xf4bppTileRect( (WindowPtr)pDrawable, pGC->tile.pixmap, alu, pm,
+ ppt->x, ppt->y, *pwidth, 1, xSrc, ySrc ) ;
+
+ DEALLOCATE_LOCAL( pptFree ) ;
+ DEALLOCATE_LOCAL( pwidthFree ) ;
+ return ;
+}
diff --git a/hw/xfree86/xf4bpp/ppcWindow.c b/hw/xfree86/xf4bpp/ppcWindow.c
new file mode 100644
index 000000000..1de8d68ee
--- /dev/null
+++ b/hw/xfree86/xf4bpp/ppcWindow.c
@@ -0,0 +1,224 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/ppcWindow.c,v 1.4 1999/09/25 14:38:17 dawes Exp $ */
+/*
+
+Copyright (c) 1987 X Consortium
+
+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 X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the X Consortium.
+
+
+Copyright IBM Corporation 1987,1988,1989
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM 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.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+*/
+/* $XConsortium: ppcWindow.c /main/5 1996/02/21 17:58:43 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "scrnintstr.h"
+#include "ibmTrace.h"
+
+/*
+ xf4bppCopyWindow copies only the parts of the destination that are
+visible in the source.
+*/
+
+void
+xf4bppCopyWindow(pWin, ptOldOrg, prgnSrc)
+ register WindowPtr pWin ;
+ DDXPointRec ptOldOrg ;
+ RegionPtr prgnSrc ;
+{
+ RegionPtr prgnDst ;
+ register BoxPtr pbox ;
+ register int dx, dy ;
+ register int nbox ;
+ register int pm ;
+
+ BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew ;
+ /* temporaries for shuffling rectangles */
+
+ TRACE(("xf4bppCopyWindow(pWin= 0x%x, ptOldOrg= 0x%x, prgnSrc= 0x%x)\n", pWin, ptOldOrg, prgnSrc)) ;
+
+
+ dx = ptOldOrg.x - pWin->drawable.x ;
+ dy = ptOldOrg.y - pWin->drawable.y ;
+ REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
+
+ prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
+ REGION_INTERSECT(pWin->drawable.pScreen, prgnDst,
+ &pWin->borderClip, prgnSrc);
+
+ if ( !( nbox = REGION_NUM_RECTS(prgnDst) ) )
+ return;
+
+ pbox = REGION_RECTS(prgnDst);
+
+ pboxNew = 0 ;
+ if ( nbox > 1 ) {
+ if ( dy < 0 ) {
+ if ( dx > 0 ) {
+ /* walk source bottom to top */
+ /* keep ordering in each band, reverse order of bands */
+ if ( !( pboxNew =
+ (BoxPtr) ALLOCATE_LOCAL( sizeof( BoxRec ) * nbox ) ) )
+ return ;
+ pboxBase = pboxNext = pbox+nbox - 1 ;
+ while ( pboxBase >= pbox ) {
+ while ( ( pboxNext >= pbox )
+ && ( pboxBase->y1 == pboxNext->y1 ) )
+ pboxNext-- ;
+ pboxTmp = pboxNext + 1 ;
+ while ( pboxTmp <= pboxBase )
+ *pboxNew++ = *pboxTmp++ ;
+ pboxBase = pboxNext ;
+ }
+ pboxNew -= nbox ;
+ pbox = pboxNew ;
+ }
+ else { /* dx <= 0 */
+ /* we can just reverse the entire list in place */
+ /* Do three-position swaps */
+ BoxRec tmpBox ;
+
+ pboxBase = pbox ;
+ pboxNext = pbox + nbox - 1 ;
+ while ( pboxBase < pboxNext ) {
+ /* ****** Warning Structure Assignment !! ****** */
+ tmpBox = *pboxBase ;
+ *pboxBase = *pboxNext ;
+ *pboxNext = tmpBox ;
+ pboxBase++ ;
+ pboxNext-- ;
+ }
+ }
+ }
+ else if ( dx < 0 ) {
+ /* walk source right to left */
+ /* reverse order of rects in each band */
+ if ( !( pboxNew = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox) ) )
+ return ;
+ pboxBase = pboxNext = pbox ;
+ while (pboxBase < pbox+nbox)
+ {
+ while ((pboxNext < pbox+nbox) &&
+ (pboxNext->y1 == pboxBase->y1))
+ pboxNext++ ;
+ pboxTmp = pboxNext ;
+ while (pboxTmp != pboxBase)
+ *pboxNew++ = *--pboxTmp ;
+ pboxBase = pboxNext ;
+ }
+ pboxNew -= nbox ;
+ pbox = pboxNew ;
+ }
+ } /* END if nbox > 1 */
+
+ /*
+ * call blit several times, the parms are:
+ * blit( alu,rplanes, wplanes, srcx, srcy, destx, desty, width, height ) ;
+ */
+
+ pm = ( 1 << pWin->drawable.depth ) - 1 ;
+ for ( ; nbox-- ; pbox++ )
+ xf4bppBitBlt( pWin, GXcopy, pm,
+ pbox->x1 + dx, pbox->y1 + dy,
+ pbox->x1, pbox->y1,
+ pbox->x2 - pbox->x1, pbox->y2 - pbox->y1) ;
+
+ /* free up stuff */
+ if ( pboxNew )
+ DEALLOCATE_LOCAL( pboxNew ) ;
+
+ REGION_DESTROY(pWin->drawable.pScreen, prgnDst);
+}
+
+Bool xf4bppPositionWindow(pWin, x, y)
+register WindowPtr pWin ;
+register int x, y ;
+{
+ return TRUE ;
+}
+
+Bool
+xf4bppDestroyWindow(pWin)
+register WindowPtr pWin ;
+{
+return pWin ? TRUE : FALSE ;
+}
+
+/* As The Name Says -- Used For ega, vga and apa8c */
+Bool
+xf4bppCreateWindowForXYhardware(pWin)
+register WindowPtr pWin ;
+{
+ register mfbPrivWin *pPrivWin;
+
+ TRACE(("xf4bppCreateWindowForXYhardware (pWin= 0x%x)\n", pWin));
+
+ pPrivWin = (mfbPrivWin *)(pWin->devPrivates[mfbWindowPrivateIndex].ptr);
+ pPrivWin->pRotatedBorder = NullPixmap;
+ pPrivWin->pRotatedBackground = NullPixmap;
+ pPrivWin->fastBackground = 0;
+ pPrivWin->fastBorder = 0;
+
+ return TRUE;
+}
diff --git a/hw/xfree86/xf4bpp/vgaBitBlt.c b/hw/xfree86/xf4bpp/vgaBitBlt.c
new file mode 100644
index 000000000..53eb3b314
--- /dev/null
+++ b/hw/xfree86/xf4bpp/vgaBitBlt.c
@@ -0,0 +1,763 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaBitBlt.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
+/* GJA -- span move routines */
+
+
+
+/* $XConsortium: vgaBitBlt.c /main/8 1996/10/27 11:06:39 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "vgaReg.h"
+#include "vgaVideo.h"
+
+#include "xf86str.h" /* for pScrn->vtSema */
+extern ScrnInfoPtr *xf86Screens;
+
+#ifndef PC98_EGC /* not PC98_EGC */
+/* NOTE: It seems that there is no way to program the VGA to copy just
+ * a part of a byte in the smarter modes. Therefore we copy the boundaries
+ * plane by plane.
+ */
+#define WORDSZ 8
+ /* The fast blit code requires WORDSZ = 8 for its read-modify write cycle.
+ * Therefore, we do not fully implement the other options.
+ */
+#define HIGHPLANEMASK 0x08
+#define HIGHPLANEINDEX 3
+
+/* Of course, we want the following anyway:
+ * (Yes, they're identical now.)
+ */
+#define SMEM(x,y) ( VIDBASE(pWin) + (y) * BYTES_PER_LINE(pWin) + (x) )
+#define DMEM(x,y) ( VIDBASE(pWin) + (y) * BYTES_PER_LINE(pWin) + (x) )
+
+#define WORD8 unsigned char
+#define LW8 BYTES_PER_LINE(pWin) /* Line width */
+#define WSHIFT8 0x3
+#define WMASK8 0x07
+/* NOTE: lmask[8] matters. It must be different from lmask[0] */
+static unsigned char lmasktab[] = {
+ 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF
+} ;
+static unsigned char rmasktab[] = {
+ 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00
+} ;
+
+#define LMASK8(n) lmasktab[n]
+#define RMASK8(n) rmasktab[n]
+#define SWAPB8(x) (x)
+
+#if (WORDSZ == 8)
+
+#define WORD WORD8
+#define LW LW8
+#define WSHIFT WSHIFT8
+#define WMASK WMASK8
+
+#define LMASK(n) LMASK8(n)
+#define RMASK(n) RMASK8(n)
+#define SWAPB(x) SWAPB8(x)
+
+#endif /* WORDSZ == 8 */
+
+#define DO_ALU(dst,src,mask,alu) {\
+ int _ndst, _odst; _odst = dst; \
+ switch ( alu ) { \
+ case GXclear: \
+ _ndst = 0; break; \
+ case GXand: \
+ _ndst = src & _odst; break; \
+ case GXandReverse: \
+ _ndst = src & ~ _odst; break; \
+ case GXcopy: \
+ _ndst = src; break; \
+ case GXandInverted: \
+ _ndst = ~ src & _odst; break; \
+ default: \
+ case GXnoop: \
+ _ndst = _odst; break; \
+ case GXxor: \
+ _ndst = src ^ _odst; break; \
+ case GXor: \
+ _ndst = src | _odst; break; \
+ case GXnor: \
+ _ndst = ~ src & ~ _odst; break; \
+ case GXequiv: \
+ _ndst = ~ src ^ _odst; break; \
+ case GXinvert: \
+ _ndst = ~ _odst; break; \
+ case GXorReverse: \
+ _ndst = src | ~ _odst; break; \
+ case GXcopyInverted: \
+ _ndst = ~ src; break; \
+ case GXorInverted: \
+ _ndst = ~ src | _odst; break; \
+ case GXnand: \
+ _ndst = ~ src | ~ _odst; break; \
+ case GXset: \
+ _ndst = ~0; break; \
+ } \
+ dst = (_odst & ~(mask)) | (_ndst & (mask)); \
+ }
+
+static void aligned_blit(
+#if NeedFunctionPrototypes
+ WindowPtr, int, int, int, int, int, int, int, int
+#endif
+);
+
+static void aligned_blit_center(
+#if NeedFunctionPrototypes
+ WindowPtr, int, int, int, int, int, int
+#endif
+);
+
+static void shift(
+#if NeedFunctionPrototypes
+ WindowPtr, int, int, int, int, int, int, int
+#endif
+);
+
+static void shift_thin_rect(
+#if NeedFunctionPrototypes
+ WindowPtr, int, int, int, int, int, int, int
+#endif
+);
+
+static void shift_center(
+#if NeedFunctionPrototypes
+ WindowPtr, int, int, int, int, int, int, int
+#endif
+);
+
+void xf4bppBitBlt(pWin,alu,writeplanes,x0,y0,x1,y1,w,h)
+WindowPtr pWin; /* GJA */
+int alu;
+int writeplanes; /* planes */
+int x0, y0, x1, y1, w, h;
+{
+ IOADDRESS REGBASE;
+ int plane, bit;
+
+ if ( !w || !h ) return;
+
+ if ( ! xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
+ xf4bppOffBitBlt(pWin,alu,writeplanes,x0,y0,x1,y1,w,h);
+ return;
+ }
+
+ REGBASE =
+ xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
+
+ /* 0x7, not WMASK: it is hardware dependant */
+ if ( ((x0 - x1) & 0x7) || (alu != GXcopy) ) {
+ /* Use slow copy */
+ SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
+ SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
+ SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
+ SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
+
+ for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX ;
+ plane ; plane >>= 1, bit-- )
+ {
+
+ if ( writeplanes & plane) {
+ SetVideoGraphics(Read_Map_SelectIndex, bit);
+ SetVideoSequencer(Mask_MapIndex, plane);
+
+ shift(pWin,x0,x1,y0,y1,w,h,alu);
+ }
+ }
+ } else {
+ aligned_blit(pWin,x0,x1,y0,y1,w,h,alu,writeplanes);
+ }
+}
+
+/* Copy a span a number of places to the right.
+ */
+static void
+shift(pWin,x0,x1,y0,y1,w,h,alu)
+WindowPtr pWin; /* GJA */
+int x0; /* left edge of source */
+int x1; /* left edge of target */
+int y0;
+int y1;
+int w; /* length of source, and of target */
+int h;
+int alu;
+{
+ if ( ((x1 & WMASK) + w) <= WORDSZ ) {
+ shift_thin_rect(pWin,x0,x1,y0,y1,w,h,alu);
+ } else if ( x1 > x0 ) { /* Shift right: start right */
+ int l1 = x1 & WMASK, r1 = (x1 + w) & WMASK;
+
+ if ( r1 ) /* right edge */
+ shift_thin_rect(pWin,x0+w-r1,x1+w-r1,y0,y1,r1,h,alu);
+ shift_center(pWin,x0,x1,y0,y1,w,h,alu);
+ if ( l1 ) /* left edge */
+ shift_thin_rect(pWin,x0,x1,y0,y1,(WORDSZ-l1),h,alu);
+ } else {
+ int l1 = x1 & WMASK, r1 = (x1 + w) & WMASK;
+
+ if ( l1 ) /* left edge */
+ shift_thin_rect(pWin,x0,x1,y0,y1,(WORDSZ-l1),h,alu);
+ shift_center(pWin,x0,x1,y0,y1,w,h,alu);
+ if ( r1 ) /* right edge */
+ shift_thin_rect(pWin,x0+w-r1,x1+w-r1,y0,y1,r1,h,alu);
+ }
+}
+
+/* The whole rectangle is so thin that it fits in one byte written */
+static void
+shift_thin_rect(pWin,x0,x1,y0,y1,w,h,alu)
+WindowPtr pWin; /* GJA */
+int x0; /* left edge of source */
+int x1; /* left edge of target */
+int y0;
+int y1;
+int w; /* length of source, and of target */
+int h;
+int alu;
+{
+ int l0 = x0 & WMASK; /* Left edge of source, as bit */
+ int l1 = x1 & WMASK; /* Left edge of target, as bit */
+ int L0 = x0 >> WSHIFT; /* Left edge of source, as byte */
+ int L1 = x1 >> WSHIFT; /* Left edge of target, as byte */
+ int pad;
+ int htmp;
+ int mask;
+ int tmp;
+ int bs;
+
+ volatile unsigned char *sp, *dp;
+
+ mask = RMASK(l1) & LMASK(l1+w);
+ bs = (x1 - x0) & WMASK;
+
+ if ( y1 > y0 ) { /* Move down, start at the bottom */
+ pad = - BYTES_PER_LINE(pWin);
+ sp = SMEM(L0,y0+h-1);
+ dp = DMEM(L1,y1+h-1);
+ } else { /* Move up, start at the top */
+ pad = BYTES_PER_LINE(pWin);
+ sp = SMEM(L0,y0);
+ dp = DMEM(L1,y1);
+ }
+
+ if ( l0+w > WORDSZ ) {
+ /* Need two bytes */
+ for ( htmp = h ; htmp ; htmp-- ) {
+ tmp = (sp[0] << (WORDSZ - bs));
+ sp++;
+ tmp |= (sp[0] >> bs);
+ sp--;
+ DO_ALU(dp[0],tmp,mask,alu);
+ dp += pad;
+ sp += pad;
+ }
+ } else if ( l0 <= l1 ) {
+ /* Need one byte, shifted right */
+ for ( htmp = h ; htmp ; htmp-- ) {
+ tmp = (sp[0] >> bs);
+ DO_ALU(dp[0],tmp,mask,alu);
+ dp += pad;
+ sp += pad;
+ }
+ } else {
+ /* Need one byte, shifted left */
+ for ( htmp = h ; htmp ; htmp-- ) {
+ tmp = (sp[0] << (WORDSZ - bs));
+ DO_ALU(dp[0],tmp,mask,alu);
+ dp += pad;
+ sp += pad;
+ }
+ }
+}
+
+static void
+shift_center(pWin,x0,x1,y0,y1,w,h,alu)
+WindowPtr pWin; /* GJA */
+int x0; /* left edge of source */
+int x1; /* left edge of target */
+int y0;
+int y1;
+int w; /* length of source, and of target */
+int h;
+int alu;
+{
+ int l1 = x1 & WMASK; /* Left edge of target, as bit */
+ int r1 = (x1 + w) & WMASK; /* Right edge of target, as bit */
+ int pad;
+ int htmp, wtmp; /* Temporaries for indices over height and width */
+ volatile unsigned char tmp; /* Temporary result of the shifts */
+ int bs;
+ int rem; /* Remaining bits; temporary in loop */
+ int bytecnt;
+
+ volatile unsigned char *sp, *dp;
+
+ bs = (x1 - x0) & WMASK;
+
+ if ( l1 ) {
+ bytecnt = (w - (WORDSZ - l1) - r1) >> WSHIFT;
+ sp = SMEM( ((x0 + (WORDSZ - l1)) >> WSHIFT), y0);
+ dp = DMEM( ((x1 + (WORDSZ - l1)) >> WSHIFT), y1);
+ } else {
+ bytecnt = (w - r1) >> WSHIFT;
+ sp = SMEM( (x0 >> WSHIFT), y0);
+ dp = DMEM( (x1 >> WSHIFT), y1);
+ }
+
+ if ( y1 > y0 ) { /* Move down, start at the bottom */
+ if ( x1 > x0 ) { /* Move right, start right */
+ pad = - BYTES_PER_LINE(pWin) + bytecnt;
+ sp += BYTES_PER_LINE(pWin) * (h - 1) + bytecnt - 1;
+ dp += BYTES_PER_LINE(pWin) * (h - 1) + bytecnt - 1;
+ } else { /* Move left, start left */
+ pad = - BYTES_PER_LINE(pWin) - bytecnt;
+ sp += BYTES_PER_LINE(pWin) * (h - 1);
+ dp += BYTES_PER_LINE(pWin) * (h - 1);
+ }
+ } else { /* Move up, start at the top */
+ if ( x1 > x0 ) { /* Move right, start right */
+ pad = BYTES_PER_LINE(pWin) + bytecnt;
+ sp += bytecnt - 1;
+ dp += bytecnt - 1;
+ } else { /* Move left, start left */
+ pad = BYTES_PER_LINE(pWin) - bytecnt;
+ sp += 0;
+ dp += 0;
+ }
+ }
+
+ if ( x1 > x0 ) { /* Move right, start right */
+ if ( bs == 0 ) { /* No shift. Need one byte only */
+ for ( htmp = h ; htmp ; htmp-- ) {
+ for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
+ tmp = sp[0];
+ DO_ALU(dp[0],tmp,~0,alu);
+ dp--;
+ sp--;
+ }
+ dp += pad;
+ sp += pad;
+ }
+ } else {
+ for ( htmp = h ; htmp ; htmp-- ) {
+ if ( bytecnt ) {
+ sp++;
+ rem = sp[0];
+ sp--;
+ for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
+ tmp = (rem >> bs);
+ rem = sp[0];
+ tmp |= (rem << (WORDSZ - bs)) ;
+ DO_ALU(dp[0],tmp,~0,alu);
+ dp--;
+ sp--;
+ }
+ }
+ dp += pad;
+ sp += pad;
+ }
+ }
+ } else { /* x1 <= x0 */ /* Move left, start left */
+ if ( bs == 0 ) { /* No shift. Need one byte only */
+ for ( htmp = h ; htmp ; htmp-- ) {
+ for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
+ tmp = sp[0];
+ DO_ALU(dp[0],tmp,~0,alu);
+ dp++;
+ sp++;
+ }
+ dp += pad;
+ sp += pad;
+ }
+ } else {
+ for ( htmp = h ; htmp ; htmp-- ) {
+ if ( bytecnt ) {
+ rem = sp[0];
+ for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
+ tmp = (rem << (WORDSZ - bs));
+ sp++;
+ rem = sp[0];
+ sp--;
+ tmp |= (rem >> bs);
+ DO_ALU(dp[0],tmp,~0,alu);
+ dp++;
+ sp++;
+ }
+ }
+ dp += pad;
+ sp += pad;
+ }
+ }
+ }
+}
+
+/* Copy a rectangle.
+ */
+static void
+aligned_blit(pWin,x0,x1,y0,y1,w,h,alu,planes)
+WindowPtr pWin; /* GJA */
+int x0; /* left edge of source */
+int x1; /* left edge of target */
+int y0;
+int y1;
+int w; /* length of source, and of target */
+int h;
+int alu;
+int planes;
+{
+ IOADDRESS REGBASE =
+ xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
+ int plane, bit;
+
+ if ( ((x1 & WMASK) + w) <= WORDSZ ) {
+ SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
+ SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
+ SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
+ SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
+
+ for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX;
+ plane ; plane >>= 1, bit-- )
+ {
+ if ( planes & plane) {
+ SetVideoGraphics(Read_Map_SelectIndex, bit);
+ SetVideoSequencer(Mask_MapIndex, plane);
+
+ shift_thin_rect(pWin,x0,x1,y0,y1,w,h,alu);
+ }
+ }
+ } else if ( x1 > x0 ) { /* Shift right: start right */
+ int l1 = x1 & WMASK, r1 = (x1 + w) & WMASK;
+
+ if ( r1 ) { /* right edge */
+ SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
+ SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
+ SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
+ SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
+
+ for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX;
+ plane ; plane >>= 1, bit-- )
+ {
+ if ( planes & plane) {
+ SetVideoGraphics(Read_Map_SelectIndex, bit);
+ SetVideoSequencer(Mask_MapIndex, plane);
+
+ shift_thin_rect(pWin,x0+w-r1,x1+w-r1,y0,y1,r1,h,alu);
+ }
+ }
+ }
+
+ /* Center */
+ SetVideoGraphics(Graphics_ModeIndex, 1); /* Write mode 1 */
+ SetVideoSequencer(Mask_MapIndex, planes);
+
+ aligned_blit_center(pWin,x0,x1,y0,y1,w,h);
+
+ if ( l1 ) { /* left edge */
+ SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
+ SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
+ SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
+ SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
+
+ for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX;
+ plane ; plane >>= 1, bit-- )
+ {
+ if ( planes & plane) {
+ SetVideoGraphics(Read_Map_SelectIndex, bit);
+ SetVideoSequencer(Mask_MapIndex, plane);
+
+ shift_thin_rect(pWin,x0,x1,y0,y1,(WORDSZ-l1),h,alu);
+ }
+ }
+ }
+ } else {
+ int l1 = x1 & WMASK, r1 = (x1 + w) & WMASK;
+
+ if ( l1 ) { /* left edge */
+ SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
+ SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
+ SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
+ SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
+
+ for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX;
+ plane ; plane >>= 1, bit-- )
+ {
+ if ( planes & plane) {
+ SetVideoGraphics(Read_Map_SelectIndex, bit);
+ SetVideoSequencer(Mask_MapIndex, plane);
+
+ shift_thin_rect(pWin,x0,x1,y0,y1,(WORDSZ-l1),h,alu);
+ }
+ }
+ }
+
+ /* Center */
+ SetVideoGraphics(Graphics_ModeIndex, 1); /* Write mode 1 */
+ SetVideoSequencer(Mask_MapIndex, planes);
+
+ aligned_blit_center(pWin,x0,x1,y0,y1,w,h);
+
+ if ( r1 ) { /* right edge */
+ SetVideoGraphics(Enb_Set_ResetIndex, 0); /* All from CPU */
+ SetVideoGraphics(Bit_MaskIndex, 0xFF); /* All bits */
+ SetVideoGraphics(Graphics_ModeIndex, 0); /* Write mode 0 */
+ SetVideoGraphics(Data_RotateIndex, 0); /* Don't rotate, replace */
+
+ for ( plane = HIGHPLANEMASK, bit = HIGHPLANEINDEX ;
+ plane ; plane >>= 1, bit-- )
+ {
+ if ( planes & plane) {
+ SetVideoGraphics(Read_Map_SelectIndex, bit);
+ SetVideoSequencer(Mask_MapIndex, plane);
+
+ shift_thin_rect(pWin,x0+w-r1,x1+w-r1,y0,y1,r1,h,alu);
+ }
+ }
+ }
+ }
+}
+
+static void
+aligned_blit_center(pWin,x0,x1,y0,y1,w,h)
+WindowPtr pWin; /* GJA */
+int x0; /* left edge of source */
+int x1; /* left edge of target */
+int y0;
+int y1;
+int w; /* length of source, and of target */
+int h;
+{
+ int l1 = x1 & WMASK; /* Left edge of target, as bit */
+ int r1 = (x1 + w) & WMASK; /* Right edge of target, as bit */
+ int pad;
+ int htmp, wtmp; /* Temporaries for indices over height and width */
+ volatile unsigned char tmp; /* Temporary result of the shifts */
+ int bs;
+ int bytecnt;
+
+ volatile unsigned char *sp, *dp;
+
+ bs = (x1 - x0) & WMASK;
+
+ if ( l1 ) {
+ bytecnt = (w - (WORDSZ - l1) - r1) >> WSHIFT;
+ sp = SMEM( ((x0 + (WORDSZ - l1)) >> WSHIFT), y0);
+ dp = DMEM( ((x1 + (WORDSZ - l1)) >> WSHIFT), y1);
+ } else {
+ bytecnt = (w - r1) >> WSHIFT;
+ sp = SMEM( (x0 >> WSHIFT), y0);
+ dp = DMEM( (x1 >> WSHIFT), y1);
+ }
+
+ if ( y1 > y0 ) { /* Move down, start at the bottom */
+ if ( x1 > x0 ) { /* Move right, start right */
+ pad = - BYTES_PER_LINE(pWin) + bytecnt;
+ sp += BYTES_PER_LINE(pWin) * (h - 1) + bytecnt - 1;
+ dp += BYTES_PER_LINE(pWin) * (h - 1) + bytecnt - 1;
+ } else { /* Move left, start left */
+ pad = - BYTES_PER_LINE(pWin) - bytecnt;
+ sp += BYTES_PER_LINE(pWin) * (h - 1);
+ dp += BYTES_PER_LINE(pWin) * (h - 1);
+ }
+ } else { /* Move up, start at the top */
+ if ( x1 > x0 ) { /* Move right, start right */
+ pad = BYTES_PER_LINE(pWin) + bytecnt;
+ sp += bytecnt - 1;
+ dp += bytecnt - 1;
+ } else { /* Move left, start left */
+ pad = BYTES_PER_LINE(pWin) - bytecnt;
+ sp += 0;
+ dp += 0;
+ }
+ }
+
+ if ( x1 > x0 ) { /* Move right, start right */
+ for ( htmp = h ; htmp ; htmp-- ) {
+ for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
+ tmp = sp[0];
+ dp[0] = tmp;
+ dp--;
+ sp--;
+ }
+ dp += pad;
+ sp += pad;
+ }
+ } else { /* x1 <= x0 */ /* Move left, start left */
+ for ( htmp = h ; htmp ; htmp-- ) {
+ for ( wtmp = bytecnt ; wtmp ; wtmp-- ) {
+ tmp = sp[0];
+ dp[0] = tmp;
+ dp++;
+ sp++;
+ }
+ dp += pad;
+ sp += pad;
+ }
+ }
+}
+#else /* PC98_EGC */
+
+static void
+egc_fast_blt (pWin, alu, writeplanes, x0, y0, x1, y1, w, h)
+WindowPtr pWin;
+const int alu, writeplanes ;
+register int x0, x1 ;
+int y0, y1 ;
+register int w, h ;
+{
+register volatile unsigned char *src ;
+register volatile unsigned char *dst ;
+unsigned short *src_x ;
+unsigned short *dst_x ;
+int x_direction, y_interval ;
+int src_off, dst_off ;
+register int k, i ;
+unsigned short ROP_value;
+
+src = (unsigned char *)SCREENADDRESS( pWin, 0, y0);
+dst = (unsigned char *)SCREENADDRESS( pWin, 0, y1);
+
+/* Set Map Mask */
+outw(EGC_PLANE, ~(writeplanes & VGA_ALLPLANES));
+switch(alu) {
+case GXnor: /* ~(S|D) */
+ ROP_value = 0x2903;
+ break;
+case GXandInverted: /* ~S&D */
+ ROP_value = 0x290c;
+ break;
+case GXand: /* S&D */
+ ROP_value = 0x29c0;
+ break;
+case GXequiv: /* ~S ^ D */
+ ROP_value = 0x29c3;
+ break;
+case GXxor: /* S^D */
+ ROP_value = 0x293c;
+ break;
+case GXandReverse: /* S&~D */
+ ROP_value = 0x2930;
+ break;
+case GXorReverse: /* S|~D */
+ ROP_value = 0x29f3;
+ break;
+case GXnand: /* ~(S&D) */
+ ROP_value = 0x293f;
+ break;
+case GXorInverted: /* ~S|D */
+ ROP_value = 0x29cf;
+ break;
+case GXor: /* S|D */
+ ROP_value = 0x29fa;
+ break;
+case GXcopyInverted: /* ~S */
+ ROP_value = 0x290f;
+ break;
+case GXcopy: /* S */
+default:
+ ROP_value = 0x29f0;
+}
+outw(EGC_MODE, ROP_value);
+if ( y1 > y0 ) {
+ y_interval = - BYTES_PER_LINE(pWin) * 8 ;
+ src += BYTES_PER_LINE(pWin) * ( h - 1 ) ;
+ dst += BYTES_PER_LINE(pWin) * ( h - 1 ) ;
+}
+else {
+ y_interval = BYTES_PER_LINE(pWin) * 8 ;
+}
+
+src = (unsigned char *)((int)src << 3) ;
+dst = (unsigned char *)((int)dst << 3) ;
+
+if ( y1 > y0) {
+ x_direction = 0x1000 ;
+ src += x0 + w - 1 ;
+ dst += x1 + w - 1 ;
+} else if ( y1 < y0 ) {
+ x_direction = 0 ;
+ src += x0 ;
+ dst += x1 ;
+} else {
+ if ( x1 < x0 ) {
+ x_direction = 0 ;
+ src += x0 ;
+ dst += x1 ;
+ } else {
+ x_direction = 0x1000 ;
+ src += x0 + w - 1 ;
+ dst += x1 + w - 1 ;
+ }
+}
+ outw ( EGC_LENGTH , w - 1 ) ;
+
+for ( ; h-- ; ) {
+ if ( x_direction ) {
+ src_off = 15 - (int)src & 0xf ;
+ dst_off = 15 - (int)dst & 0xf ;
+ } else {
+ src_off = (int)src & 0xf ;
+ dst_off = (int)dst & 0xf ;
+ }
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+ src_x = (unsigned short *)(((unsigned int)src >> 4 ) << 1) ;
+ dst_x = (unsigned short *)(((unsigned int)dst >> 4 ) << 1) ;
+#else
+ src_x = (unsigned short *)(((int)src >> 4 ) << 1) ;
+ dst_x = (unsigned short *)(((int)dst >> 4 ) << 1) ;
+#endif
+ k = ( src_off + w + 15 ) >> 4 ;
+ if ( src_off < dst_off ) {
+ if ( ((src_off + w - 1 ) >> 4) < ((dst_off + w - 1) >> 4)) k++ ;
+ }
+ if ( src_off > dst_off ) {
+ if ( ((src_off + w - 1) >> 4 ) == ((dst_off + w - 1) >> 4) ) k++ ;
+ if ( x_direction ) dst_x ++ ;
+ else dst_x -- ;
+ }
+ outw ( EGC_ADD , x_direction | src_off | dst_off << 4 );
+ if ( x_direction ) {
+ wcopyl ( src_x, dst_x, k, VIDBASE(pWin) ) ;
+ } else {
+ wcopyr ( src_x, dst_x, k, VIDBASE(pWin) ) ;
+ }
+src += y_interval ;
+dst += y_interval ;
+}
+outw ( EGC_ADD, 0 ) ;
+outw ( EGC_LENGTH , 0xf );
+return;
+}
+
+void
+xf4bppBitBlt( pWin,alu, writeplanes, x0, y0, x1, y1, w, h )
+WindowPtr pWin; /* GJA */
+int alu;
+int writeplanes; /* planes */
+int x0, y0, x1, y1, w, h;
+{
+ if ( ! xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
+ xf4bppOffBitBlt( pWin, alu, writeplanes,
+ x0, y0, x1, y1, w, h );
+ return;
+ }
+
+switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ case GXinvert: /* 0xa NOT dst */
+ case GXset: /* 0xf 1 */
+ xf4bppFillSolid( pWin, VGA_ALLPLANES, alu, writeplanes, x1, y1, w, h ) ;
+ /* x1, y1, GJA */
+ case GXnoop: /* 0x5 dst */
+ return ;
+ default:
+ break ;
+}
+
+egc_fast_blt ( pWin, alu, writeplanes, x0, y0, x1, y1, w, h);
+return;
+}
+#endif
diff --git a/hw/xfree86/xf4bpp/vgaGC.c b/hw/xfree86/xf4bpp/vgaGC.c
new file mode 100644
index 000000000..867e2c50e
--- /dev/null
+++ b/hw/xfree86/xf4bpp/vgaGC.c
@@ -0,0 +1,216 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaGC.c,v 1.4 2003/02/18 21:29:59 tsi Exp $ */
+/*
+
+Copyright (c) 1987 X Consortium
+
+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 X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from the X Consortium.
+
+
+Copyright IBM Corporation 1987,1988,1989
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of IBM not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+IBM 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.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+*/
+
+/* $XConsortium: vgaGC.c /main/6 1996/02/21 17:58:54 kaleb $ */
+
+#include "xf4bpp.h"
+#include "mfbmap.h"
+#include "mfb.h"
+#include "mi.h"
+#include "ppcGCstr.h"
+
+void
+xf4bppChangeGCtype( pGC, devPriv )
+register GC *pGC ;
+register ppcPrivGCPtr devPriv ;
+{
+ if ( devPriv->lastDrawableType == DRAWABLE_PIXMAP ) {
+ pGC->ops->CopyArea = miCopyArea ;
+ pGC->ops->PolyFillRect = miPolyFillRect ;
+ pGC->ops->PushPixels = miPushPixels ;
+ pGC->ops->PolyArc = miPolyArc ;
+ pGC->ops->PolyFillArc = miPolyFillArc ;
+ pGC->ops->PolySegment = miPolySegment ;
+ }
+ else {
+ pGC->ops->CopyArea = xf4bppCopyArea ;
+ pGC->ops->PolyFillRect = xf4bppPolyFillRect ;
+ pGC->ops->PushPixels = miPushPixels ; /* GJA */
+ pGC->ops->PolyArc = xf4bppZeroPolyArc ;
+ pGC->ops->PolyFillArc = xf4bppPolyFillArc ;
+ pGC->ops->PolySegment = xf4bppSegmentSS ;
+ }
+ return;
+}
+
+Mask
+xf4bppChangeWindowGC( pGC, changes )
+register GC *pGC ;
+register Mask changes ;
+{
+register ppcPrivGCPtr devPriv = (ppcPrivGCPtr) (pGC->devPrivates[mfbGCPrivateIndex].ptr) ;
+register unsigned long int idx ; /* used for stepping through bitfields */
+
+#define LOWBIT( x ) ( x & - x ) /* Two's complement */
+ while ((idx = LOWBIT(changes))) {
+ switch ( idx ) {
+
+ case GCLineStyle:
+ case GCLineWidth:
+ pGC->ops->PolyArc = ( ( pGC->lineStyle == LineSolid )
+ ? ( ( pGC->lineWidth == 0 ) ? xf4bppZeroPolyArc
+ : miPolyArc )
+ : miPolyArc ) ;
+ pGC->ops->PolySegment = ( ( pGC->lineStyle == LineSolid )
+ ? ( ( pGC->lineWidth == 0 )
+ ? ( ( pGC->fillStyle == FillSolid ) ?
+ xf4bppSegmentSS : miPolySegment )
+ : miPolySegment )
+ : ( ( pGC->lineWidth == 0 )
+ ? ( ( pGC->fillStyle == FillSolid ) ?
+ xf4bppSegmentSD : miPolySegment )
+ : miPolySegment ) ) ;
+ pGC->ops->Polylines = ( ( pGC->lineStyle == LineSolid )
+ ? ( ( pGC->lineWidth == 0 )
+ ? ( (pGC->fillStyle == FillSolid ) ?
+ xf4bppLineSS : miZeroLine )
+ : miWideLine )
+ : ( ( pGC->lineWidth == 0 )
+ ? ( (pGC->fillStyle == FillSolid ) ?
+ xf4bppLineSD : miWideDash )
+ : miWideDash ) ) ;
+ /*
+ * If these are just square boxes with no funny business
+ * going on we can call the fast routine that draws
+ * rectangles without floating point.
+ */
+/* too buggy */
+#if 0
+ if ( ( pGC->lineStyle == LineSolid )
+ && ( pGC->joinStyle == JoinMiter )
+ && ( pGC->lineWidth != 0 ) )
+ pGC->ops->PolyRectangle = xf4bppPolyRectangle;
+ else
+#endif
+ pGC->ops->PolyRectangle = miPolyRectangle;
+
+ changes &= ~( GCLineStyle | GCLineWidth ) ;
+ break ;
+ case GCJoinStyle:
+#ifdef NEED_LINEHELPER
+ pGC->ops->LineHelper =
+ ( pGC->joinStyle == JoinMiter ) ? miMiter : miNotMiter ;
+#endif
+ /*
+ * If these are just square boxes with no funny business
+ * going on we can call the fast routine that draws
+ * rectangles without floating point.
+ */
+/* too buggy */
+#if 0
+ if ( ( pGC->lineStyle == LineSolid )
+ && ( pGC->joinStyle == JoinMiter )
+ && ( pGC->lineWidth != 0 ) )
+ pGC->ops->PolyRectangle = xf4bppPolyRectangle;
+ else
+#endif
+ pGC->ops->PolyRectangle = miPolyRectangle;
+ changes &= ~ idx ; /* i.e. changes &= ~ GCJoinStyle */
+ break ;
+
+ case GCBackground:
+ if ( pGC->fillStyle != FillOpaqueStippled ) {
+ changes &= ~ idx ; /* i.e. changes &= ~GCBackground */
+ break ;
+ } /* else Fall Through */
+ case GCForeground:
+ if ( pGC->fillStyle == FillTiled ) {
+ changes &= ~ idx ; /* i.e. changes &= ~GCForeground */
+ break ;
+ } /* else Fall Through */
+ case GCFunction:
+ case GCPlaneMask:
+ case GCFillStyle:
+ { /* new_fill */
+ int fillStyle = devPriv->colorRrop.fillStyle ;
+ /* install a suitable fillspans */
+ if ( fillStyle == FillSolid )
+ pGC->ops->FillSpans = xf4bppSolidWindowFS ;
+ else if ( fillStyle == FillStippled )
+ pGC->ops->FillSpans = xf4bppStippleWindowFS ;
+ else if ( fillStyle == FillOpaqueStippled )
+ pGC->ops->FillSpans = xf4bppOpStippleWindowFS ;
+ else /* fillStyle == FillTiled */
+ pGC->ops->FillSpans = xf4bppTileWindowFS ;
+ } /* end of new_fill */
+ changes &= ~( GCBackground | GCForeground
+ | GCFunction
+ | GCPlaneMask | GCFillStyle ) ;
+ break ;
+
+ default:
+ ErrorF("xf4bppChangeWindowGC: Unexpected GC Change\n") ;
+ changes &= ~ idx ; /* Remove it anyway */
+ break ;
+ }
+ }
+ return changes;
+}
diff --git a/hw/xfree86/xf4bpp/vgaImages.c b/hw/xfree86/xf4bpp/vgaImages.c
new file mode 100644
index 000000000..66c2c14e0
--- /dev/null
+++ b/hw/xfree86/xf4bpp/vgaImages.c
@@ -0,0 +1,457 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaImages.c,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: vgaImages.c /main/5 1996/02/21 17:58:58 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "vgaReg.h"
+#include "vgaVideo.h"
+
+#include "xf86str.h" /* for pScrn->vtSema */
+extern ScrnInfoPtr *xf86Screens;
+
+#undef TRUE
+#undef FALSE
+#define TRUE 1
+#define FALSE 0
+
+void
+xf4bppDrawColorImage( pWin, x, y, w, h, data, RowIncrement, alu, planes )
+WindowPtr pWin; /* GJA */
+int x, y ;
+register int w, h ;
+unsigned char *data ;
+register int RowIncrement ;
+const int alu ;
+const unsigned long int planes ;
+{
+IOADDRESS REGBASE;
+register unsigned long int tmp ;
+register const unsigned char *src ;
+register volatile unsigned char *dst ;
+register int Pixel_Count ;
+register unsigned int currMask ;
+register unsigned int InitialMask ;
+register volatile unsigned char *StartByte ;
+unsigned int invert_source_data = FALSE ;
+#ifdef PC98_EGC /* new EGC test */
+register unsigned char tmp1;
+#endif
+
+{ /* Start GJA */
+ if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
+ xf4bppOffDrawColorImage( pWin, x, y, w, h, data, RowIncrement, alu, planes );
+ return;
+ }
+} /* End GJA */
+
+{
+ unsigned int invert_existing_data = FALSE ;
+ unsigned int data_rotate_value = VGA_COPY_MODE ;
+#ifdef PC98_EGC
+ unsigned short ROP_value;
+#endif
+
+ REGBASE = 0x300 +
+ xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase;
+
+ switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ case GXinvert: /* 0xa NOT dst */
+ case GXset: /* 0xf 1 */
+ xf4bppFillSolid( pWin, VGA_ALLPLANES, alu, planes, x, y, w, h ) ;
+ case GXnoop: /* 0x5 dst */
+ return ;
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ invert_existing_data = TRUE ;
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ invert_source_data = TRUE ;
+ case GXand: /* 0x1 src AND dst */
+ data_rotate_value = VGA_AND_MODE ;
+ break ;
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ invert_source_data = TRUE ;
+ case GXxor: /* 0x6 src XOR dst */
+ data_rotate_value = VGA_XOR_MODE ;
+ break ;
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ invert_existing_data = TRUE ;
+ data_rotate_value = VGA_AND_MODE ;
+ break ;
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ invert_source_data = TRUE ;
+ case GXorReverse: /* 0xb src OR NOT dst */
+ invert_existing_data = TRUE ;
+ /* GJA -- moved this here */
+ data_rotate_value = VGA_OR_MODE ;
+ break ;
+ case GXorInverted: /* 0xd NOT src OR dst */
+ invert_source_data = TRUE ;
+ case GXor: /* 0x7 src OR dst */
+ data_rotate_value = VGA_OR_MODE ;
+ break ;
+ case GXcopyInverted: /* 0xc NOT src */
+ invert_source_data = TRUE ;
+ case GXcopy: /* 0x3 src */
+ default:
+ break ;
+ }
+#ifndef PC98_EGC
+ if ( invert_existing_data )
+ xf4bppFillSolid( pWin, VGA_ALLPLANES, GXinvert, planes, x, y, w, h ) ;
+#endif
+#ifdef PC98_EGC
+ /* Setup EGC Registers */
+ switch(data_rotate_value) {
+/* EGC MODE.. Cmp Read: Flase, WriteSource=ROP, ReadSource=CPU */
+ case VGA_AND_MODE:
+ if (invert_existing_data)
+ ROP_value = EGC_AND_INV_MODE;
+ else
+ ROP_value = EGC_AND_MODE;
+ break;
+ case VGA_OR_MODE:
+ if (invert_existing_data)
+ ROP_value = EGC_OR_INV_MODE;
+ else
+ ROP_value = EGC_OR_MODE;
+ break;
+ case VGA_XOR_MODE:
+ if (invert_existing_data)
+ ROP_value = EGC_XOR_INV_MODE;
+ else
+ ROP_value = EGC_XOR_MODE;
+ break;
+ case VGA_COPY_MODE:
+ default:
+ ROP_value = EGC_COPY_MODE;
+ break;
+ }
+ outw(EGC_PLANE, ~(planes & VGA_ALLPLANES));
+ outw(EGC_MODE, ROP_value);
+ outw(EGC_FGC, 0x0000);
+ tmp1 = 0;
+#else
+ /* Setup VGA Registers */
+ SetVideoSequencer( Mask_MapIndex, planes & VGA_ALLPLANES ) ;
+ /* Set Raster Op */
+ SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
+ SetVideoGraphics( Graphics_ModeIndex, VGA_WRITE_MODE_2 ) ;
+#endif
+}
+
+StartByte = SCREENADDRESS(pWin, x, y);
+InitialMask = SCRRIGHT8( LeftmostBit, BIT_OFFSET( x ) ) ;
+if ( invert_source_data )
+#ifdef PC98_EGC
+#if 0 /* New EGC version */
+ egc_image_invert ( StartByte, data, InitialMask, w, h,
+ RowIncrement ) ;
+#else /* new EGC c version */
+ for ( ;
+ h-- ;
+ data += RowIncrement, StartByte += BYTES_PER_LINE(pWin) ) {
+ dst = StartByte;
+ for ( src = data,
+ Pixel_Count = w, currMask = InitialMask ;
+ Pixel_Count-- ;
+ src++ ) {
+ if (tmp1 != (~*src & VGA_ALLPLANES)) {
+ tmp1 = ~*src & VGA_ALLPLANES;
+ /* set FGC */
+ outw(EGC_FGC, ~*src & VGA_ALLPLANES);
+ }
+ *((VgaMemoryPtr) dst) = currMask;
+ if ( currMask & RightmostBit ) {
+ currMask = LeftmostBit ;
+ dst++;
+ }
+ else
+ currMask = SCRRIGHT8( currMask, 1 ) ;
+ }
+ }
+#endif /* new EGC */
+#else /* original */
+ for ( ;
+ h-- ;
+ data += RowIncrement, StartByte += BYTES_PER_LINE(pWin) ) {
+ dst = StartByte;
+ for ( src = data,
+ Pixel_Count = w, currMask = InitialMask ;
+ Pixel_Count-- ;
+ src++ ) {
+ /* Set The Bit Mask Reg */
+ SetVideoGraphics( Bit_MaskIndex, currMask ) ;
+ /* Read To Load vga Data Latches */
+ tmp = *( (VgaMemoryPtr) dst ) ;
+ *( (VgaMemoryPtr) dst ) = ~ *src ;
+ if ( currMask & RightmostBit ) {
+ currMask = LeftmostBit ;
+ dst++;
+ }
+ else
+ currMask = SCRRIGHT8( currMask, 1 ) ;
+ }
+ }
+#endif
+else /* invert_source_data == FALSE */
+#ifdef PC98_EGC
+#if 0 /* new EGC version */
+ egc_image ( StartByte, data, InitialMask, w, h,
+ RowIncrement );
+#else /* new EGC c version */
+ for ( ;
+ h-- ;
+ data += RowIncrement, StartByte += BYTES_PER_LINE(pWin) ) {
+ dst = StartByte;
+ for ( src = data,
+ Pixel_Count = w, currMask = InitialMask ;
+ Pixel_Count-- ;
+ src++ ) {
+ if (tmp1 != *src & VGA_ALLPLANES) {
+ tmp1 = *src & VGA_ALLPLANES;
+ outw(EGC_FGC, tmp1); /* set FGC */
+ }
+ *((VgaMemoryPtr) dst) = currMask; /* write with mask */
+ if ( currMask & RightmostBit ) {
+ currMask = LeftmostBit ;
+ dst++;
+ }
+ else
+ currMask = SCRRIGHT8( currMask, 1 ) ;
+ }
+ }
+#endif /* new EGC version */
+#else /* original */
+ for ( ;
+ h-- ;
+ data += RowIncrement, StartByte += BYTES_PER_LINE(pWin) ) {
+ dst = StartByte;
+ for ( src = data,
+ Pixel_Count = w, currMask = InitialMask ;
+ Pixel_Count-- ;
+ src++ ) {
+ /* Set The Bit Mask Reg */
+ SetVideoGraphics( Bit_MaskIndex, currMask ) ; /* GJA */
+ /* Read To Load vga Data Latches */
+ tmp = *( (VgaMemoryPtr) dst ) ;
+ *( (VgaMemoryPtr) dst ) = *src ;
+ if ( currMask & RightmostBit ) {
+ currMask = LeftmostBit ;
+ dst++;
+ }
+ else
+ currMask = SCRRIGHT8( currMask, 1 ) ;
+ }
+ }
+#endif /* original */
+
+return ;
+}
+
+#ifndef PC98_EGC
+static unsigned long int
+read8Z
+(
+ IOADDRESS REGBASE,
+ register volatile unsigned char *screen_ptr
+)
+{
+register unsigned long int i ;
+register unsigned long int j ;
+
+/* Read One Byte At A Time to get
+ * i == [ Plane 3 ] [ Plane 2 ] [ Plane 1 ] [ Plane 0 ]
+ * into a single register
+ */
+SetVideoGraphicsData( 3 ) ;
+i = *( (VgaMemoryPtr) screen_ptr ) << 8 ;
+SetVideoGraphicsData( 2 ) ;
+i |= *( (VgaMemoryPtr) screen_ptr ) ;
+i <<= 8 ;
+SetVideoGraphicsData( 1 ) ;
+i |= *( (VgaMemoryPtr) screen_ptr ) ;
+i <<= 8 ;
+SetVideoGraphicsData( 0 ) ;
+i |= *( (VgaMemoryPtr) screen_ptr ) ;
+
+/* Push Bits To Get
+ * j == [Pixel 7][Pixel 6][Pixel 5][Pixel 4][Pixel 3][Pixel 2][Pixel 1][Pixel 0]
+ * into one register
+ */
+
+j = ( i & 0x1 ) << 4 ;
+j |= ( i >>= 1 ) & 0x1 ;
+j <<= 4 ;
+j |= ( i >>= 1 ) & 0x1 ;
+j <<= 4 ;
+j |= ( i >>= 1 ) & 0x1 ;
+j <<= 4 ;
+j |= ( i >>= 1 ) & 0x1 ;
+j <<= 4 ;
+j |= ( i >>= 1 ) & 0x1 ;
+j <<= 4 ;
+j |= ( i >>= 1 ) & 0x1 ;
+j <<= 4 ;
+j |= ( i >>= 1 ) & 0x1 ;
+
+j |= ( i & 0x2 ) << 28 ;
+j |= ( ( i >>= 1 ) & 0x2 ) << 24 ;
+j |= ( ( i >>= 1 ) & 0x2 ) << 20 ;
+j |= ( ( i >>= 1 ) & 0x2 ) << 16 ;
+j |= ( ( i >>= 1 ) & 0x2 ) << 12 ;
+j |= ( ( i >>= 1 ) & 0x2 ) << 8 ;
+j |= ( ( i >>= 1 ) & 0x2 ) << 4 ;
+j |= ( i >>= 1 ) & 0x2 ;
+
+j |= ( i & 0x4 ) << 28 ;
+j |= ( ( i >>= 1 ) & 0x4 ) << 24 ;
+j |= ( ( i >>= 1 ) & 0x4 ) << 20 ;
+j |= ( ( i >>= 1 ) & 0x4 ) << 16 ;
+j |= ( ( i >>= 1 ) & 0x4 ) << 12 ;
+j |= ( ( i >>= 1 ) & 0x4 ) << 8 ;
+j |= ( ( i >>= 1 ) & 0x4 ) << 4 ;
+j |= ( i >>= 1 ) & 0x4 ;
+
+j |= ( i & 0x8 ) << 28 ;
+j |= ( ( i >>= 1 ) & 0x8 ) << 24 ;
+j |= ( ( i >>= 1 ) & 0x8 ) << 20 ;
+j |= ( ( i >>= 1 ) & 0x8 ) << 16 ;
+j |= ( ( i >>= 1 ) & 0x8 ) << 12 ;
+j |= ( ( i >>= 1 ) & 0x8 ) << 8 ;
+j |= ( ( i >>= 1 ) & 0x8 ) << 4 ;
+j |= ( i >>= 1 ) & 0x8 ;
+
+return j ;
+}
+#endif /* not PC98_EGC */
+
+void
+xf4bppReadColorImage( pWin, x, y, lx, ly, data, RowIncrement )
+WindowPtr pWin; /* GJA */
+int x, y ;
+int lx, ly ;
+register unsigned char *data ;
+int RowIncrement ;
+{
+IOADDRESS REGBASE;
+register unsigned long int tmp ;
+register volatile unsigned char *src ;
+volatile unsigned char *masterSrc ;
+int savCenterWidth ;
+int dx ;
+int skip ;
+int center_width ;
+int ignore ;
+int pad ;
+unsigned char tmpc;
+
+{ /* Start GJA */
+ if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
+ xf4bppOffReadColorImage( pWin, x, y, lx, ly, data, RowIncrement );
+ return;
+ }
+} /* End GJA */
+
+if ( ( lx <= 0 ) || ( ly <= 0 ) )
+ return ;
+
+ REGBASE = 0x300 +
+ xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase;
+
+/* Setup VGA Registers */
+#ifndef PC98_EGC
+SetVideoGraphicsIndex( Graphics_ModeIndex ) ;
+tmpc = inb( GraphicsDataRegister );
+SetVideoGraphicsData( tmpc & ~0x8 ) ; /* Clear the bit */
+SetVideoGraphicsIndex( Read_Map_SelectIndex ) ;
+#else
+outw(EGC_MODE, 0x0800);
+#endif
+
+skip = BIT_OFFSET( x ) ;
+pad = RowIncrement - lx ;
+ignore = BIT_OFFSET( x + lx ) ;
+masterSrc = SCREENADDRESS( pWin, x, y ) ;
+center_width = ROW_OFFSET( x + lx ) - ROW_OFFSET( ( x + 0x7 ) & ~0x7 ) ;
+
+#define SINGLE_STEP *data++ = tmp & VGA_ALLPLANES ; tmp >>= 4
+
+
+if ( center_width < 0 ) {
+ src = masterSrc;
+ for ( ; ly-- ; ) {
+ tmp = read8Z( REGBASE, src ) >> ( skip << 2 ) ;
+ for ( dx = lx + 1 ; --dx ; ) {
+ SINGLE_STEP ;
+ }
+ data += pad ;
+ src += BYTES_PER_LINE(pWin);
+ }
+} else
+ for ( savCenterWidth = center_width ;
+ ly-- ;
+ center_width = savCenterWidth,
+ masterSrc += BYTES_PER_LINE(pWin) ) {
+ src = masterSrc ;
+ tmp = read8Z( REGBASE, src ) ; src++;
+ if ((dx = skip))
+ tmp >>= ( dx << 2 ) ;
+ else
+ if ( lx < 8 ) { /* kludge -- GJA */
+ --center_width ; /* kludge -- GJA */
+ dx = 8 - lx ; /* kludge -- GJA */
+ } else /* kludge -- GJA */
+ --center_width ;
+ BranchPoint:
+ switch ( dx ) {
+ LoopTop:
+ case 0x0: SINGLE_STEP ;
+ case 0x1: SINGLE_STEP ;
+ case 0x2: SINGLE_STEP ;
+ case 0x3: SINGLE_STEP ;
+ case 0x4: SINGLE_STEP ;
+ case 0x5: SINGLE_STEP ;
+ case 0x6: SINGLE_STEP ;
+ case 0x7: *data++ = tmp & VGA_ALLPLANES ;
+
+ /* Fall Through To End Of Inner Loop */
+ if ( center_width > 0 ) {
+ tmp = read8Z( REGBASE, src ) ; src++;
+ center_width-- ;
+ goto LoopTop ;
+ }
+ else if ( ( center_width == 0 )
+ && ( dx = ( - ignore ) & 07 ) ) {
+ tmp = read8Z( REGBASE, src ) ; src++;
+ center_width-- ;
+ goto BranchPoint ; /* Do Mod 8 edge */
+ }
+ else /* End of this line */
+ data += pad ;
+ }
+ }
+
+return ;
+}
diff --git a/hw/xfree86/xf4bpp/vgaReg.h b/hw/xfree86/xf4bpp/vgaReg.h
new file mode 100644
index 000000000..43f59d938
--- /dev/null
+++ b/hw/xfree86/xf4bpp/vgaReg.h
@@ -0,0 +1,136 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaReg.h,v 1.4 2002/01/25 21:56:22 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/* $XConsortium: vgaReg.h /main/4 1996/02/21 17:59:02 kaleb $ */
+
+#define SET_BYTE_REGISTER( ioport, value ) outb( ioport, value )
+#define SET_INDEX_REGISTER( ioport, value ) SET_BYTE_REGISTER( ioport, value )
+#define SET_DATA_REGISTER( ioport, value ) SET_BYTE_REGISTER( ioport, value )
+/* GJA -- deleted RTIO and ATRIO case here, so that a PCIO #define became
+ * superfluous.
+ */
+#define SET_INDEXED_REGISTER(RegGroup, Index, Value) \
+ (SET_BYTE_REGISTER(RegGroup, Index), \
+ SET_BYTE_REGISTER((RegGroup) + 1, Value))
+
+/* There is a jumper on the ega to change this to 0x200 instead !! */
+#if 0 /* This is now a stack variable, as needed */
+#define REGBASE 0x300
+#endif
+
+#define AttributeIndexRegister REGBASE + 0xC0
+#define AttributeDataWriteRegister REGBASE + 0xC0
+#define AttributeDataReadRegister REGBASE + 0xC1
+#define AttributeRegister AttributeIndexRegister
+#define AttributeModeIndex 0x30
+#define OverScanColorIndex 0x31
+#define ColorPlaneEnableIndex 0x32
+#define HorizPelPanIndex 0x33
+#define ColorSelectIndex 0x34
+#ifndef PC98_EGC
+#define SetVideoAttributeIndex( index ) \
+ SET_INDEX_REGISTER( AttributeIndexRegister, index )
+#define SetVideoAttribute( index, value ) \
+ SetVideoAttributeIndex( index ) ; \
+ SET_BYTE_REGISTER( AttributeDataWriteRegister, value )
+#endif
+
+ /* Graphics Registers 03CE & 03CF */
+#define GraphicsIndexRegister REGBASE + 0xCE
+#define GraphicsDataRegister REGBASE + 0xCF
+#define GraphicsRegister GraphicsIndexRegister
+#define Set_ResetIndex 0x00
+#define Enb_Set_ResetIndex 0x01
+#define Color_CompareIndex 0x02
+#define Data_RotateIndex 0x03
+#define Read_Map_SelectIndex 0x04
+#define Graphics_ModeIndex 0x05
+#define MiscellaneousIndex 0x06
+#define Color_Dont_CareIndex 0x07
+#define Bit_MaskIndex 0x08
+#ifndef PC98_EGC
+#define SetVideoGraphicsIndex( index ) \
+ SET_INDEX_REGISTER( GraphicsIndexRegister, index )
+#define SetVideoGraphicsData( value ) \
+ SET_INDEX_REGISTER( GraphicsDataRegister, value )
+#define SetVideoGraphics( index, value ) \
+ SET_INDEXED_REGISTER( GraphicsRegister, index, value )
+#endif
+
+/* Sequencer Registers 03C4 & 03C5 */
+#define SequencerIndexRegister REGBASE + 0xC4
+#define SequencerDataRegister REGBASE + 0xC5
+#define SequencerRegister SequencerIndexRegister
+#define Seq_ResetIndex 00
+#define Clock_ModeIndex 01
+#define Mask_MapIndex 02
+#define Char_Map_SelectIndex 03
+#define Memory_ModeIndex 04
+#ifndef PC98_EGC
+#define SetVideoSequencerIndex( index ) \
+ SET_INDEX_REGISTER( SequencerIndexRegister, index )
+#define SetVideoSequencer( index, value ) \
+ SET_INDEXED_REGISTER( SequencerRegister, index, value )
+#endif
+
+/* BIT CONSTANTS FOR THE VGA/EGA HARDWARE */
+/* for the Graphics' Data_Rotate Register */
+#define VGA_ROTATE_FUNC_SHIFT 3
+#define VGA_COPY_MODE ( 0 << VGA_ROTATE_FUNC_SHIFT ) /* 0x00 */
+#define VGA_AND_MODE ( 1 << VGA_ROTATE_FUNC_SHIFT ) /* 0x08 */
+#define VGA_OR_MODE ( 2 << VGA_ROTATE_FUNC_SHIFT ) /* 0x10 */
+#define VGA_XOR_MODE ( 3 << VGA_ROTATE_FUNC_SHIFT ) /* 0x18 */
+/* for the Graphics' Graphics_Mode Register */
+#define VGA_READ_MODE_SHIFT 3
+#define VGA_WRITE_MODE_0 0
+#define VGA_WRITE_MODE_1 1
+#define VGA_WRITE_MODE_2 2
+#define VGA_WRITE_MODE_3 3
+#define VGA_READ_MODE_0 ( 0 << VGA_READ_MODE_SHIFT )
+#define VGA_READ_MODE_1 ( 1 << VGA_READ_MODE_SHIFT )
+
+#ifdef PC98_EGC
+/* I/O port address define for extended EGC */
+#define EGC_PLANE 0x4a0 /* EGC active plane select */
+#define EGC_READ 0x4a2 /* EGC FGC,EGC,Read Plane */
+#define EGC_MODE 0x4a4 /* EGC Mode register & ROP */
+#define EGC_FGC 0x4a6 /* EGC Forground color */
+#define EGC_MASK 0x4a8 /* EGC Mask register */
+#define EGC_BGC 0x4aa /* EGC Background color */
+#define EGC_ADD 0x4ac /* EGC Dest/Source address */
+#define EGC_LENGTH 0x4ae /* EGC Bit length */
+
+#define PALETTE_ADD 0xa8 /* Palette address */
+#define PALETTE_GRE 0xaa /* Palette Green */
+#define PALETTE_RED 0xac /* Palette Red */
+#define PALETTE_BLU 0xae /* Palette Blue */
+
+#define EGC_AND_MODE 0x2c8c /* (S&P&D)|(~S&D) */
+#define EGC_AND_INV_MODE 0x2c2c /* (S&P&~D)|(~S&D) */
+#define EGC_OR_MODE 0x2cec /* S&(P|D)|(~S&D) */
+#define EGC_OR_INV_MODE 0x2cbc /* S&(P|~D)|(~S&D) */
+#define EGC_XOR_MODE 0x2c6c /* (S&(P&~D|~P&D))|(~S&D) */
+#define EGC_XOR_INV_MODE 0x2c9c /* (S&(P&D)|(~P&~D))|(~S&D) */
+#define EGC_COPY_MODE 0x2cac /* (S&P)|(~S&D) */
+#endif
diff --git a/hw/xfree86/xf4bpp/vgaSolid.c b/hw/xfree86/xf4bpp/vgaSolid.c
new file mode 100644
index 000000000..ceb39ef77
--- /dev/null
+++ b/hw/xfree86/xf4bpp/vgaSolid.c
@@ -0,0 +1,569 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaSolid.c,v 1.5 2002/01/25 21:56:22 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/* $XConsortium: vgaSolid.c /main/5 1996/02/21 17:59:06 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "vgaReg.h"
+#include "vgaVideo.h"
+
+#include "xf86str.h" /* for pScrn->vtSema */
+extern ScrnInfoPtr *xf86Screens;
+
+#undef TRUE
+#undef FALSE
+#define TRUE 1
+#define FALSE 0
+
+#ifndef PC98_EGC
+#ifdef USE_ASM
+extern void fastFill();
+extern void fastFillRMW();
+#else
+
+static void fastFill
+(
+ register volatile unsigned char *destination,
+ register const unsigned int bytes_per_line,
+ register const unsigned int bytewidth, /* MUST BE > 0 !! */
+ register unsigned int height /* MUST BE > 0 !! */
+)
+{
+int stop_count = bytewidth ;
+register int row_jump = bytes_per_line - bytewidth ;
+#if !defined(OLDHC) && defined(BSDrt) && !defined(i386)
+register const unsigned int notZero = ((unsigned char)(~0x0));
+#else
+#define notZero ((unsigned char)(~0))
+#endif
+
+#define SINGLE_STORE \
+ ( *( (VgaMemoryPtr) destination ) = notZero ); \
+ destination++; stop_count--;
+
+/* TOP OF FIRST LOOP */
+BranchPoint:
+
+switch ( bytewidth & 0xF ) { /* Jump into loop at mod 16 remainder */
+ LoopTop :
+ case 0x0 : SINGLE_STORE ;
+ case 0xF : SINGLE_STORE ;
+ case 0xE : SINGLE_STORE ;
+ case 0xD : SINGLE_STORE ;
+ case 0xC : SINGLE_STORE ;
+ case 0xB : SINGLE_STORE ;
+ case 0xA : SINGLE_STORE ;
+ case 0x9 : SINGLE_STORE ;
+ case 0x8 : SINGLE_STORE ;
+ case 0x7 : SINGLE_STORE ;
+ case 0x6 : SINGLE_STORE ;
+ case 0x5 : SINGLE_STORE ;
+ case 0x4 : SINGLE_STORE ;
+ case 0x3 : SINGLE_STORE ;
+ case 0x2 : SINGLE_STORE ;
+ case 0x1 : SINGLE_STORE ;
+/* FIRST LOOP */
+ if ( stop_count )
+ goto LoopTop ;
+/* SECOND LOOP */
+ if ( --height ) {
+ destination += row_jump ;
+ stop_count = bytewidth ;
+ goto BranchPoint ;
+ }
+ else
+ return ;
+#undef SINGLE_STORE
+}
+/*NOTREACHED*/
+}
+
+/* For Read-Modify-Write Case */
+static void fastFillRMW
+(
+ register volatile unsigned char *destination,
+ register const unsigned int bytes_per_line,
+ register const unsigned int bytewidth, /* MUST BE > 0 !! */
+ register unsigned int height /* MUST BE > 0 !! */
+)
+{
+int stop_count = bytewidth ;
+register int row_jump = bytes_per_line - bytewidth ;
+#if !defined(OLDHC) && defined(BSDrt) && !defined(i386)
+register const unsigned int notZero = ((unsigned char)(~0x0));
+#endif
+register int tmp ;
+
+#define SINGLE_STORE \
+ tmp = *( (VgaMemoryPtr) destination ) ; \
+ ( *( (VgaMemoryPtr) destination ) = notZero ) ; \
+ destination++; stop_count-- ;
+
+/* TOP OF FIRST LOOP */
+BranchPoint:
+
+switch ( bytewidth & 0xF ) { /* Jump into loop at mod 16 remainder */
+ LoopTop :
+ case 0x0 : SINGLE_STORE ;
+ case 0xF : SINGLE_STORE ;
+ case 0xE : SINGLE_STORE ;
+ case 0xD : SINGLE_STORE ;
+ case 0xC : SINGLE_STORE ;
+ case 0xB : SINGLE_STORE ;
+ case 0xA : SINGLE_STORE ;
+ case 0x9 : SINGLE_STORE ;
+ case 0x8 : SINGLE_STORE ;
+ case 0x7 : SINGLE_STORE ;
+ case 0x6 : SINGLE_STORE ;
+ case 0x5 : SINGLE_STORE ;
+ case 0x4 : SINGLE_STORE ;
+ case 0x3 : SINGLE_STORE ;
+ case 0x2 : SINGLE_STORE ;
+ case 0x1 : SINGLE_STORE ;
+/* FIRST LOOP */
+ if ( stop_count )
+ goto LoopTop ;
+/* SECOND LOOP */
+ if ( --height ) {
+ destination += row_jump ;
+ stop_count = bytewidth ;
+ goto BranchPoint ;
+ }
+ else
+ return ;
+}
+#undef SINGLE_STORE
+/*NOTREACHED*/
+}
+#endif
+
+
+void xf4bppFillSolid( pWin, color, alu, planes, x0, y0, lx, ly )
+WindowPtr pWin; /* GJA */
+unsigned long int color ;
+const int alu ;
+unsigned long int planes ;
+register int x0 ;
+register const int y0 ;
+register int lx ;
+register const int ly ; /* MUST BE > 0 !! */
+{
+IOADDRESS REGBASE;
+register volatile unsigned char *dst ;
+register int tmp ;
+register int tmp2 ;
+register int tmp3 ;
+unsigned int data_rotate_value = VGA_COPY_MODE ;
+unsigned int read_write_modify = FALSE ;
+unsigned int invert_existing_data = FALSE ;
+
+{ /* Start GJA */
+ if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
+ xf4bppOffFillSolid( pWin, color, alu, planes, x0, y0, lx, ly );
+ return;
+ }
+} /* End GJA */
+
+if ( ( lx == 0 ) || ( ly == 0 ) )
+ return;
+
+switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ color = 0 ;
+ break ;
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ invert_existing_data = TRUE ;
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ color = ~color ;
+ case GXand: /* 0x1 src AND dst */
+ data_rotate_value = VGA_AND_MODE ;
+ read_write_modify = TRUE ;
+ case GXcopy: /* 0x3 src */
+ break ;
+ case GXnoop: /* 0x5 dst */
+ return ;
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ color = ~color ;
+ case GXxor: /* 0x6 src XOR dst */
+ data_rotate_value = VGA_XOR_MODE ;
+ read_write_modify = TRUE ;
+ planes &= color ;
+ break ;
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ invert_existing_data = TRUE ;
+ data_rotate_value = VGA_AND_MODE ;
+ read_write_modify = TRUE ;
+ break ;
+ case GXorReverse: /* 0xb src OR NOT dst */
+ invert_existing_data = TRUE ;
+ data_rotate_value = VGA_OR_MODE ;
+ read_write_modify = TRUE ;
+ break ;
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ invert_existing_data = TRUE ;
+ case GXorInverted: /* 0xd NOT src OR dst */
+ color = ~color ;
+ case GXor: /* 0x7 src OR dst */
+ data_rotate_value = VGA_OR_MODE ;
+ read_write_modify = TRUE ;
+ break ;
+ case GXcopyInverted: /* 0xc NOT src */
+ color = ~color ;
+ break ;
+ case GXinvert: /* 0xa NOT dst */
+ data_rotate_value = VGA_XOR_MODE ;
+ read_write_modify = TRUE ;
+ case GXset: /* 0xf 1 */
+ color = VGA_ALLPLANES ;
+ default:
+ break ;
+}
+
+if ( !( planes &= VGA_ALLPLANES ) )
+ return ;
+
+REGBASE =
+ xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
+
+/*
+ * Set The Plane-Enable
+ */
+SetVideoSequencer( Mask_MapIndex, planes ) ;
+SetVideoGraphics( Enb_Set_ResetIndex, planes ) ;
+/*
+ * Put Display Into SET/RESET Write Mode
+ */
+SetVideoGraphics( Graphics_ModeIndex, VGA_WRITE_MODE_3 ) ;
+/*
+ * Set The Color in The Set/Reset Register
+ */
+SetVideoGraphics( Set_ResetIndex, color & VGA_ALLPLANES ) ;
+/*
+ * Set The Function-Select In The Data Rotate Register
+ */
+SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
+
+/* Do Left Edge */
+if ((tmp = x0 & 07)) {
+ tmp2 = SCRRIGHT8( ( (unsigned) 0xFF ), tmp ) ;
+ /* Catch The Cases Where The Entire Region Is Within One Byte */
+ if ( ( lx -= 8 - tmp ) < 0 ) {
+ tmp2 &= SCRLEFT8( 0xFF, -lx ) ;
+ lx = 0 ;
+ }
+ /* Set The Bit Mask Reg */
+ SetVideoGraphics(Bit_MaskIndex, tmp2 ) ;
+ if ( invert_existing_data == TRUE ) {
+ SetVideoGraphics( Set_ResetIndex, VGA_ALLPLANES ) ;
+ SetVideoGraphics( Data_RotateIndex, VGA_XOR_MODE ) ;
+ dst = SCREENADDRESS( pWin, x0, y0 );
+ for ( tmp = ly;
+ tmp-- ; ) {
+ tmp3 = *( (VgaMemoryPtr) dst ) ;
+ *( (VgaMemoryPtr) dst ) = tmp2 ;
+ dst += BYTES_PER_LINE(pWin);
+ }
+ SetVideoGraphics( Set_ResetIndex, color & VGA_ALLPLANES ) ;
+ SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
+ /* Un-Set XOR */
+ }
+ dst = SCREENADDRESS( pWin, x0, y0 );
+ for ( tmp = ly;
+ tmp-- ; ) {
+ tmp3 = *( (VgaMemoryPtr) dst ) ;
+ *( (VgaMemoryPtr) dst ) = tmp2 ;
+ dst += BYTES_PER_LINE(pWin);
+ }
+ if ( !lx ) { /* All Handled In This Byte */
+ return ;
+ }
+ x0 = ( x0 + 8 ) & ~07 ;
+}
+
+/* Fill The Center Of The Box */
+if ( ROW_OFFSET( lx ) ) {
+ SetVideoGraphics(Bit_MaskIndex, 0xFF ) ;
+ if ( invert_existing_data == TRUE ) {
+ SetVideoGraphics( Set_ResetIndex, VGA_ALLPLANES ) ;
+ SetVideoGraphics( Data_RotateIndex, VGA_XOR_MODE ) ;
+ fastFillRMW( SCREENADDRESS( pWin, x0, y0 ),
+ BYTES_PER_LINE(pWin),
+ ROW_OFFSET( lx ), ly ) ;
+ SetVideoGraphics( Set_ResetIndex, color & VGA_ALLPLANES ) ;
+ SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
+ /* Un-Set XOR */
+ /* Point At The Bit Mask Reg */
+ }
+ (* ( ( read_write_modify == FALSE ) ? fastFill : fastFillRMW ) )
+ ( SCREENADDRESS( pWin, x0, y0 ), BYTES_PER_LINE(pWin),
+ ROW_OFFSET( lx ), ly ) ;
+}
+
+/* Do Right Edge */
+if ((tmp = BIT_OFFSET(lx))) { /* x0 Now Is Byte Aligned */
+ /* Set The Bit Mask */
+ SetVideoGraphics( Bit_MaskIndex,
+ (tmp2 = SCRLEFT8( 0xFF, ( 8 - tmp ) ) ) ) ;
+ if ( invert_existing_data == TRUE ) {
+ SetVideoGraphics( Set_ResetIndex, VGA_ALLPLANES ) ;
+ SetVideoGraphics( Data_RotateIndex, VGA_XOR_MODE ) ;
+ dst = SCREENADDRESS( pWin, ( x0 + lx ), y0 );
+ for ( tmp = ly;
+ tmp-- ; ) {
+ tmp3 = *( (VgaMemoryPtr) dst ) ;
+ *( (VgaMemoryPtr) dst ) = tmp2 ;
+ dst += BYTES_PER_LINE(pWin);
+ }
+ SetVideoGraphics( Set_ResetIndex, color & VGA_ALLPLANES ) ;
+ SetVideoGraphics( Data_RotateIndex, data_rotate_value ) ;
+ /* Un-Set XOR */
+ }
+ dst = SCREENADDRESS( pWin, ( x0 + lx ), y0 );
+ for ( tmp = ly;
+ tmp-- ; ) {
+ tmp3 = *( (VgaMemoryPtr) dst ) ;
+ *( (VgaMemoryPtr) dst ) = tmp2 ;
+ dst += BYTES_PER_LINE(pWin) ;
+ }
+}
+/* Disable Set/Reset Register */
+SetVideoGraphics( Enb_Set_ResetIndex, 0 ) ;
+
+
+return ;
+}
+
+#else /* for PC98 EGC */
+static void WordfastFill( destination, bytes_per_line, wordwidth, height )
+register volatile unsigned char *destination ;
+register const unsigned int bytes_per_line ;
+register const unsigned int wordwidth ; /* MUST BE > 0 !! */
+register unsigned int height ; /* MUST BE > 0 !! */
+{
+int stop_count = wordwidth ;
+register int row_jump = bytes_per_line - wordwidth*2 ;
+#if !defined(OLDHC) && defined(BSDrt) && !defined(i386) && 0
+register const int notZero = ~0x0 ;
+#else
+#define notZero ( ~0 )
+#endif
+
+#define SINGLE_STORE \
+ ( *( (unsigned short *) destination++ ) = notZero ); \
+ destination++; stop_count--;
+
+/* TOP OF FIRST LOOP */
+BranchPoint:
+
+switch ( wordwidth & 0xF ) { /* Jump into loop at mod 16 remainder */
+ LoopTop :
+ case 0x0 : SINGLE_STORE ;
+ case 0xF : SINGLE_STORE ;
+ case 0xE : SINGLE_STORE ;
+ case 0xD : SINGLE_STORE ;
+ case 0xC : SINGLE_STORE ;
+ case 0xB : SINGLE_STORE ;
+ case 0xA : SINGLE_STORE ;
+ case 0x9 : SINGLE_STORE ;
+ case 0x8 : SINGLE_STORE ;
+ case 0x7 : SINGLE_STORE ;
+ case 0x6 : SINGLE_STORE ;
+ case 0x5 : SINGLE_STORE ;
+ case 0x4 : SINGLE_STORE ;
+ case 0x3 : SINGLE_STORE ;
+ case 0x2 : SINGLE_STORE ;
+ case 0x1 : SINGLE_STORE ;
+/* FIRST LOOP */
+ if ( stop_count )
+ goto LoopTop ;
+/* SECOND LOOP */
+ if ( --height ) {
+ destination += row_jump ;
+ stop_count = wordwidth ;
+ goto BranchPoint ;
+ }
+ else
+ return ;
+#undef SINGLE_STORE
+}
+/*NOTREACHED*/
+}
+
+void xf4bppFillSolid( pWin, color, alu, planes, x0, y0, lx, ly )
+WindowPtr pWin; /* GJA */
+unsigned long int color ;
+const int alu ;
+unsigned long int planes ;
+register int x0 ;
+register const int y0 ;
+register int lx ;
+register const int ly ; /* MUST BE > 0 !! */
+{
+register volatile unsigned char *dst ;
+register tmp ;
+register tmp2 ;
+register unsigned short tmp3 ;
+unsigned short ROP_value;
+unsigned int data_rotate_value = VGA_COPY_MODE ;
+unsigned int read_write_modify = FALSE ;
+unsigned int invert_existing_data = FALSE ;
+
+{ /* Start GJA */
+ if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
+ xf4bppOffFillSolid( pWin, color, alu, planes, x0, y0, lx, ly );
+ return;
+ }
+} /* End GJA */
+
+if ( ( lx == 0 ) || ( ly == 0 ) )
+ return;
+
+switch ( alu ) {
+ case GXclear: /* 0x0 Zero 0 */
+ color = 0 ;
+ break ;
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ invert_existing_data = TRUE ;
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ color = ~color ;
+ case GXand: /* 0x1 src AND dst */
+ data_rotate_value = VGA_AND_MODE ;
+ read_write_modify = TRUE ;
+ case GXcopy: /* 0x3 src */
+ break ;
+ case GXnoop: /* 0x5 dst */
+ return ;
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ color = ~color ;
+ case GXxor: /* 0x6 src XOR dst */
+ data_rotate_value = VGA_XOR_MODE ;
+ read_write_modify = TRUE ;
+ planes &= color ;
+ break ;
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ invert_existing_data = TRUE ;
+ data_rotate_value = VGA_AND_MODE ;
+ read_write_modify = TRUE ;
+ break ;
+ case GXorReverse: /* 0xb src OR NOT dst */
+ invert_existing_data = TRUE ;
+ data_rotate_value = VGA_OR_MODE ;
+ read_write_modify = TRUE ;
+ break ;
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ invert_existing_data = TRUE ;
+ case GXorInverted: /* 0xd NOT src OR dst */
+ color = ~color ;
+ case GXor: /* 0x7 src OR dst */
+ data_rotate_value = VGA_OR_MODE ;
+ read_write_modify = TRUE ;
+ break ;
+ case GXcopyInverted: /* 0xc NOT src */
+ color = ~color ;
+ break ;
+ case GXinvert: /* 0xa NOT dst */
+ data_rotate_value = VGA_XOR_MODE ;
+ read_write_modify = TRUE ;
+ case GXset: /* 0xf 1 */
+ color = VGA_ALLPLANES ;
+ default:
+ break ;
+}
+
+if ( !( planes &= VGA_ALLPLANES ) )
+ return ;
+
+/* Set Access Planes */
+outw(EGC_PLANE, ~planes);
+switch(data_rotate_value) {
+/* EGC MODE.. Cmp Read: Flase, WriteSource=ROP, ReadSource=CPU */
+ case VGA_AND_MODE:
+ if (invert_existing_data)
+ ROP_value = EGC_AND_INV_MODE;
+ else
+ ROP_value = EGC_AND_MODE;
+ break;
+ case VGA_OR_MODE:
+ if (invert_existing_data)
+ ROP_value = EGC_OR_INV_MODE;
+ else
+ ROP_value = EGC_OR_MODE;
+ break;
+ case VGA_XOR_MODE:
+ if (invert_existing_data)
+ ROP_value = EGC_XOR_INV_MODE;
+ else
+ ROP_value = EGC_XOR_MODE;
+ break;
+ case VGA_COPY_MODE:
+ default:
+ ROP_value = EGC_COPY_MODE;
+ break;
+}
+outw(EGC_MODE, ROP_value);
+outw(EGC_FGC, color & VGA_ALLPLANES);
+/* Do Left Edge */
+if ( tmp = x0 & 0x0f ) {
+ dst = (unsigned char *)((int)(SCREENADDRESS(pWin,x0,y0)) & ~0x01);
+ tmp3 = (unsigned)0xffff >>tmp;
+ /* Catch The Cases Where The Entire Region Is Within One Word */
+ if ( ( lx -= 16 - tmp ) < 0 ) {
+ tmp3 &= (unsigned)0xffff << -lx;
+ lx = 0 ;
+ }
+ tmp3 = (unsigned short)(tmp3 >> 8 | tmp3 << 8);
+ for ( tmp = ly;
+ tmp-- ; ) {
+ *((unsigned short *) dst ) = tmp3 ;
+ dst += BYTES_PER_LINE(pWin);
+ }
+ if ( !lx ) { /* All Handled In This Word */
+ return ;
+ }
+ x0 = ( x0 + 0x0f ) & ~0x0f ;
+}
+
+/* Fill The Center Of The Box */
+if (lx >> 4) {
+ WordfastFill( SCREENADDRESS( pWin, x0, y0 ), BYTES_PER_LINE(pWin),
+ (lx >> 4), ly ) ;
+}
+
+/* Do Right Edge */
+if ( tmp = lx & 0x0f ) { /* x0 Now Is Word Aligned */
+ /* Set The Bit Mask */
+ tmp3 = (unsigned)0xffff << ( 16 - tmp );
+ dst = (unsigned char*)((int)SCREENADDRESS(pWin,(x0+lx),y0) & ~0x01);
+ tmp3 = (unsigned short)(tmp3 >> 8 | tmp3 << 8);
+ for ( tmp = ly;
+ tmp-- ; ) {
+ *( (unsigned short *) dst ) = tmp3 ;
+ dst += BYTES_PER_LINE(pWin);
+ }
+}
+
+return ;
+}
+#endif
diff --git a/hw/xfree86/xf4bpp/vgaStipple.c b/hw/xfree86/xf4bpp/vgaStipple.c
new file mode 100644
index 000000000..a4f3cef6b
--- /dev/null
+++ b/hw/xfree86/xf4bpp/vgaStipple.c
@@ -0,0 +1,715 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaStipple.c,v 1.5 2002/01/25 21:56:22 tsi Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+/* $XConsortium: vgaStipple.c /main/5 1996/02/21 17:59:10 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "vgaReg.h"
+#include "vgaVideo.h"
+
+#include "xf86str.h" /* for pScrn->vtSema */
+extern ScrnInfoPtr *xf86Screens;
+
+#ifndef PC98_EGC
+static unsigned char
+getbits
+(
+ register const int x,
+ register const unsigned int patternWidth,
+ register const unsigned char * const lineptr
+)
+{
+register unsigned char bits ;
+register const unsigned char *cptr ;
+register int shift ;
+register int wrap ;
+
+cptr = lineptr + ( x >> 3 ) ;
+bits = *cptr ;
+if ((shift = x & 7))
+ bits = SCRLEFT8( bits, shift ) | SCRRIGHT8( cptr[1], ( 8 - shift ) ) ;
+if ( ( wrap = x + 8 - patternWidth ) > 0 ) {
+ bits &= SCRLEFT8( 0xFF, wrap ) ;
+ bits |= SCRRIGHT8( *lineptr, ( 8 - wrap ) ) ;
+}
+
+/* GJA -- Handle extraction of 8 bits from < 8 bits wide stipple.
+ * I duplicated case 4,5,6,7 to give the compiler a chance to optimize.
+ */
+switch (patternWidth) {
+case 1: /* Not really useful. */
+ bits &= ~SCRRIGHT8(0xFF,1);
+ bits |= SCRRIGHT8(bits,1);
+ bits |= SCRRIGHT8(bits,2);
+ bits |= SCRRIGHT8(bits,4);
+ break;
+case 2:
+ bits &= ~SCRRIGHT8(0xFF,2);
+ bits |= SCRRIGHT8(bits,2); bits |= SCRRIGHT8(bits,4); break;
+case 3:
+ bits &= ~SCRRIGHT8(0xFF,3);
+ bits |= (SCRRIGHT8(bits,3) | SCRRIGHT8(bits,6)); break;
+case 4:
+ bits = (bits & ~SCRRIGHT8(0xFF,4)) | SCRRIGHT8(bits,4); break;
+case 5:
+ bits = (bits & ~SCRRIGHT8(0xFF,5)) | SCRRIGHT8(bits,5); break;
+case 6:
+ bits = (bits & ~SCRRIGHT8(0xFF,6)) | SCRRIGHT8(bits,6); break;
+case 7:
+ bits = (bits & ~SCRRIGHT8(0xFF,7)) | SCRRIGHT8(bits,7); break;
+default:
+ ;
+ /* Do nothing, of course */
+}
+return bits ;
+}
+#endif
+
+/* GJA --
+ * Basically, in the code below, we will draw a stipple in the usual
+ * three parts: left edge, center and right edge.
+ * For efficiency reasons, the center will be drawn byte aligned, so that
+ * we will have to shuffle the bits in the left and right edges.
+ * The hard cases will be stipples with width < 8: In order to get 8
+ * bits from those, we will need a loop. One single 'if' will never do.
+ * This is taken care of above.
+ */
+static void
+DoMonoSingle
+(
+ WindowPtr pWin, /* GJA */
+ int w,
+ int x,
+ int y,
+ register const unsigned char *mastersrc,
+ int h,
+ register unsigned int width,
+ register unsigned int paddedByteWidth,
+ unsigned int height,
+ int xshift,
+ int yshift
+)
+{
+IOADDRESS REGBASE =
+ xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
+register volatile unsigned char *xDst ;
+register VideoAdapterObject tmp2 ;
+register int NeedValX ;
+register int counter ;
+register int tmp1 ;
+unsigned int rowCounter ;
+int byte_cnt ;
+#ifdef PC98_EGC
+unsigned char bitmask;
+#endif
+
+/* Do Left Edge */
+if ((tmp1 = x & 07)) {
+ tmp2 = SCRRIGHT8( ( (unsigned) 0xFF ), tmp1 ) ;
+ /* Catch The Cases Where The Entire Region Is Within One Byte */
+ if ( ( w -= 8 - tmp1 ) < 0 ) {
+ tmp2 &= SCRLEFT8( (unsigned) 0xFF, -w ) ;
+ w = 0 ;
+ }
+#ifndef PC98_EGC
+ SetVideoGraphics( Bit_MaskIndex, tmp2 ) ; /* Set The Bit Mask */
+#else
+ bitmask = tmp2; /* Set The Bit Mask */
+#endif
+ /*
+ * For Each Line In The Source Pixmap
+ */
+ xDst = SCREENADDRESS( pWin, x, y );
+ for ( tmp1 = yshift, rowCounter = h;
+ rowCounter ;
+ rowCounter-- , tmp1++ ) {
+
+ if ( tmp1 >= (int)height )
+ tmp1 -= height ;
+#ifndef PC98_EGC
+ /* Read To Save */
+ tmp2 = *( (VgaMemoryPtr) xDst) ;
+#endif
+ /* Write Pattern */
+ *( (VgaMemoryPtr) xDst ) =
+#ifndef PC98_EGC
+ getbits( xshift /* GJA */, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ) ) >> (x & 07) ;
+#else
+#if 0
+ (getbits( xshift /* GJA */, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ) ) >> (x & 07)
+ & bitmask);
+#else
+ (getbits_x( xshift /* GJA */, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ), (x & 07))
+ & bitmask);
+#endif
+#endif
+ xDst += BYTES_PER_LINE(pWin);
+ }
+ NeedValX = (xshift + 8 - (x & 07)) % width;
+ x = ( x + 7 ) & ~07 ;
+}
+else {
+ NeedValX = xshift ;
+}
+
+if ((byte_cnt = ROW_OFFSET(w))) { /* Fill The Center Of The Box */
+ int SavNeedX = NeedValX ;
+
+#ifndef PC98_EGC
+ SetVideoGraphics( Bit_MaskIndex, 0xFF ) ; /* Set The Bit Mask */
+#endif
+ /*
+ * For Each Line In The Source Pixmap
+ */
+ xDst = SCREENADDRESS( pWin, x, y );
+ for ( tmp1 = yshift, rowCounter = h;
+ rowCounter ;
+ rowCounter-- , tmp1++ ) {
+ register const unsigned char *l_ptr ;
+ if ( tmp1 >= (int)height )
+ tmp1 -= height ;
+ l_ptr = mastersrc + ( tmp1 * paddedByteWidth ) ;
+ /*
+ * For Each Byte Across The Pattern In X
+ */
+ for ( counter = byte_cnt, NeedValX = SavNeedX ;
+ counter-- ; ) {
+#ifndef PC98_EGC
+ /* Read To Save */
+ tmp2 = *( (VgaMemoryPtr) xDst) ;
+#endif
+ /* Write Pattern */
+ *( (VgaMemoryPtr) xDst ) =
+#ifndef PC98_EGC
+ getbits( NeedValX, width, l_ptr ) ;
+#else
+#if 0
+ getbits( NeedValX, width, l_ptr ) ;
+#else
+ getbits_x ( NeedValX, width, l_ptr, 0 ) ;
+#endif
+#endif
+ /* GJA -- The '%' is there since width could be < 8 */
+ NeedValX = (NeedValX + 8) % width;
+ xDst++;
+ }
+ xDst += BYTES_PER_LINE(pWin) - byte_cnt;
+ }
+}
+
+/* Do Right Edge */
+if ((tmp1 = BIT_OFFSET(w))) { /* x Now Is Byte Aligned */
+ /* Set The Bit Mask */
+#ifndef PC98_EGC
+ SetVideoGraphics( Bit_MaskIndex, SCRLEFT8( 0xFF, ( 8 - tmp1 ) ) ) ;
+#else
+ bitmask = SCRLEFT8( 0xFF, ( 8 - tmp1 ));
+#endif
+ /*
+ * For Each Line In The Source Pixmap
+ */
+ xDst = SCREENADDRESS( pWin, ( x + w ), y );
+ for ( tmp1 = yshift, rowCounter = h;
+ rowCounter ;
+ rowCounter-- , tmp1++ ) {
+ if ( tmp1 >= (int)height )
+ tmp1 -= height ;
+#ifndef PC98_EGC
+ /* Read To Save */
+ tmp2 = *( (VgaMemoryPtr) xDst) ;
+#endif
+ /* Write Pattern */
+ *( (VgaMemoryPtr) xDst ) =
+#ifndef PC98_EGC
+ getbits( NeedValX, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ) ) ;
+#else
+#if 0
+ (getbits( NeedValX, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ) ) & bitmask);
+#else
+ (getbits_x( NeedValX, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ), 0 ) & bitmask);
+#endif
+#endif
+ xDst += BYTES_PER_LINE(pWin) ;
+ }
+}
+
+return ;
+}
+
+static void
+DoMonoMany
+(
+ WindowPtr pWin, /* GJA */
+ int w,
+ int x,
+ int y,
+ register const unsigned char *mastersrc,
+ int h,
+ register unsigned int width,
+ register unsigned int paddedByteWidth,
+ unsigned int height,
+ int xshift,
+ int yshift
+)
+{
+IOADDRESS REGBASE =
+ xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->domainIOBase + 0x300;
+register volatile unsigned char *xDst ;
+register VideoAdapterObject tmp2 ;
+register int NeedValX ;
+register int byte_cnt ;
+register int tmp1 ;
+unsigned DestinationRow ;
+unsigned int SourceRow ;
+volatile unsigned char *dst ;
+int scr_incr = ( height * BYTES_PER_LINE(pWin) ) ;
+#ifdef PC98_EGC
+unsigned char bitmask;
+#endif
+
+/* Do Left Edge */
+if ((tmp1 = x & 07)) {
+ tmp2 = SCRRIGHT8( ( (unsigned) 0xFF ), tmp1 ) ;
+ /* Catch The Cases Where The Entire Region Is Within One Byte */
+ if ( ( w -= 8 - tmp1 ) < 0 ) {
+ tmp2 &= SCRLEFT8( (unsigned) 0xFF, -w ) ;
+ w = 0 ;
+ }
+#ifndef PC98_EGC
+ SetVideoGraphics( Bit_MaskIndex, tmp2 ) ; /* Set The Bit Mask */
+#else
+ bitmask = tmp2; /* Set The Bit Mask */
+#endif
+ /*
+ * For Each Line In The Source Pixmap
+ */
+ for ( tmp1 = yshift, SourceRow = 0, dst = SCREENADDRESS( pWin, x, y ) ;
+ SourceRow < height ;
+ tmp1++, SourceRow++, dst += BYTES_PER_LINE(pWin) ) {
+ register unsigned bitPattern ;
+
+ if ( tmp1 >= (int)height )
+ tmp1 -= height ;
+ /*
+ * For Each Time Pattern Repeats In The Y Dimension
+ */
+ xDst = dst;
+ for ( DestinationRow = SourceRow,
+#ifndef PC98_EGC
+ bitPattern = getbits( xshift, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ) ) ;
+#else
+#if 0
+ bitPattern = getbits( xshift, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ) ) ;
+#else
+ bitPattern = getbits_x( xshift, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ), 0 ) ;
+#endif
+#endif
+ (int)DestinationRow < h ;
+ DestinationRow += height ) {
+#ifndef PC98_EGC
+ /* Read To Save */
+ tmp2 = *( (VgaMemoryPtr) xDst ) ;
+#endif
+ /* Write Pattern */
+#ifndef PC98_EGC
+ *( (VgaMemoryPtr) xDst ) = bitPattern >> (x & 07);
+#else
+ *( (VgaMemoryPtr) xDst ) = (bitPattern >> (x & 07)) & bitmask;
+#endif
+ xDst += scr_incr;
+ }
+ }
+ NeedValX = (xshift + 8 - (x & 07)) % width;
+ x = ( x + 7 ) & ~07 ;
+}
+else {
+ NeedValX = xshift ;
+}
+
+if ((byte_cnt = ROW_OFFSET(w))) { /* Fill The Center Of The Box */
+ int SavNeedX = NeedValX ;
+
+#ifndef PC98_EGC
+ SetVideoGraphics( Bit_MaskIndex, 0xFF ) ; /* Set The Bit Mask */
+#endif
+ /*
+ * For Each Line In The Source Pixmap
+ */
+ for ( tmp1 = yshift, SourceRow = 0, dst = SCREENADDRESS( pWin, x, y ) ;
+ SourceRow < height ;
+ tmp1++, SourceRow++, dst += BYTES_PER_LINE(pWin) - byte_cnt ) {
+ register const unsigned char *l_ptr ;
+ if ( tmp1 >= (int)height )
+ tmp1 -= height ;
+ l_ptr = mastersrc + ( tmp1 * paddedByteWidth ) ;
+ /*
+ * For Each Byte Across The Pattern In X
+ */
+ for ( tmp2 = byte_cnt, NeedValX = SavNeedX ;
+ tmp2-- ;
+ dst++ ) {
+ register unsigned bitPattern ;
+ register VideoAdapterObject tmp3 ;
+ /*
+ * For Each Time Pattern Repeats In Y
+ */
+ xDst = dst;
+ for ( DestinationRow = SourceRow,
+#ifndef PC98_EGC
+ bitPattern = getbits( NeedValX, width, l_ptr ) ;
+#else
+#if 0
+ bitPattern = getbits( NeedValX, width, l_ptr ) ;
+#else
+ bitPattern = getbits_x( NeedValX, width, l_ptr, 0 ) ;
+#endif
+#endif
+ (int)DestinationRow < h ;
+ DestinationRow += height ) {
+#ifndef PC98_EGC
+ /* Read To Save */
+ tmp3 = *( (VgaMemoryPtr) xDst) ;
+#endif
+ /* Write Pattern */
+ *( (VgaMemoryPtr) xDst ) = bitPattern ;
+ xDst += scr_incr;
+ }
+ NeedValX = (NeedValX + 8) % width;
+ }
+ }
+}
+
+/* Do Right Edge */
+if ((tmp1 = BIT_OFFSET(w))) { /* x Now Is Byte Aligned */
+ /* Set The Bit Mask */
+#ifndef PC98_EGC
+ SetVideoGraphics( Bit_MaskIndex, SCRLEFT8( 0xFF, ( 8 - tmp1 ) ) ) ;
+#else
+ bitmask = SCRLEFT8( 0xFF, ( 8 - tmp1 ) );
+#endif
+ /*
+ * For Each Line In The Source Pixmap
+ */
+ for ( tmp1 = yshift, SourceRow = 0,
+ dst = SCREENADDRESS( pWin, ( x + w ), y ) ;
+ SourceRow < height ;
+ tmp1++, SourceRow++, dst += BYTES_PER_LINE(pWin) ) {
+ register unsigned bitPattern ;
+ if ( tmp1 >= (int)height )
+ tmp1 -= height ;
+ /*
+ * For Each Time Pattern Repeats In The Y Dimension
+ */
+ xDst = dst;
+ for ( DestinationRow = SourceRow,
+#ifndef PC98_EGC
+ bitPattern = getbits( NeedValX, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ) ) ;
+#else
+#if 0
+ bitPattern = getbits( NeedValX, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ) ) ;
+#else
+ bitPattern = getbits_x( NeedValX, width,
+ mastersrc
+ + ( tmp1 * paddedByteWidth ), 0 ) ;
+#endif
+#endif
+ (int)DestinationRow < h ;
+ DestinationRow += height ) {
+#ifndef PC98_EGC
+ /* Read To Save */
+ tmp2 = *( (VgaMemoryPtr) xDst) ;
+#endif
+ /* Write Pattern */
+#ifndef PC98_EGC
+ *( (VgaMemoryPtr) xDst ) = bitPattern ;
+#else
+ *( (VgaMemoryPtr) xDst ) = bitPattern & bitmask;
+#endif
+ xDst += scr_incr;
+ }
+ }
+}
+
+return ;
+}
+
+#define DO_RECURSE 0x10000
+
+static void
+vgaSetMonoRegisters
+(
+ DrawablePtr pDrawable,
+ register unsigned long int plane_mask,
+ register unsigned long int desiredState
+)
+{
+IOADDRESS REGBASE =
+ xf86Screens[pDrawable->pScreen->myNum]->domainIOBase + 0x300;
+#ifndef PC98_EGC
+/* Setup VGA Registers */
+/*
+ * Set The Plane-Enable
+ */
+SetVideoSequencer( Mask_MapIndex, plane_mask ) ;
+SetVideoGraphics( Enb_Set_ResetIndex, plane_mask ) ;
+/*
+ * Put Display Into SET-AND (i.e. Write Mode 3 )
+ */
+SetVideoGraphics( Graphics_ModeIndex, VGA_WRITE_MODE_3 ) ;
+/*
+ * Set The Color in The Set/Reset Register
+ */
+SetVideoGraphics( Set_ResetIndex, desiredState & VGA_ALLPLANES ) ;
+/*
+ * Set The Vga's Alu Function
+ */
+SetVideoGraphics( Data_RotateIndex, desiredState >> 8 ) ;
+#else /* PC98_EGC */
+unsigned short ROP_value;
+/* Setup VGA Registers */
+/*
+ * Set The Plane-Enable
+ */
+outw(EGC_PLANE, ~plane_mask);
+switch((desiredState >> 8)&0x18) {
+/* EGC MODE.. Cmp Read: Flase, WriteSource=ROP, ReadSource=CPU */
+ case VGA_AND_MODE:
+ if (desiredState & DO_RECURSE)
+ ROP_value = EGC_AND_INV_MODE;
+ else
+ ROP_value = EGC_AND_MODE;
+ break;
+ case VGA_OR_MODE:
+ if (desiredState & DO_RECURSE)
+ ROP_value = EGC_OR_INV_MODE;
+ else
+ ROP_value = EGC_OR_MODE;
+ break;
+ case VGA_XOR_MODE:
+ if (desiredState & DO_RECURSE)
+ ROP_value = EGC_XOR_INV_MODE;
+ else
+ ROP_value = EGC_XOR_MODE;
+ break;
+ case VGA_COPY_MODE:
+ default:
+ ROP_value = EGC_COPY_MODE;
+ break;
+}
+outw(EGC_MODE, ROP_value);
+outw(EGC_FGC, desiredState & VGA_ALLPLANES);
+#endif
+
+return ;
+}
+
+static unsigned long
+vgaCalcMonoMode
+(
+ int rasterOp,
+ register unsigned long int color
+)
+{
+register unsigned int data_rotate_value = VGA_COPY_MODE << 8 ;
+register unsigned int invert_existing_data = 0 ;
+
+/* Test The Raster-Op */
+switch ( rasterOp ) {
+ case GXclear: /* 0x0 Zero 0 */
+ color = 0 ;
+ break ;
+ case GXinvert: /* 0xa NOT dst */
+ data_rotate_value = VGA_XOR_MODE << 8 ;
+ case GXset: /* 0xf 1 */
+ color = VGA_ALLPLANES ;
+ break ;
+ case GXnor: /* 0x8 NOT src AND NOT dst */
+ invert_existing_data = DO_RECURSE ;
+ case GXandInverted: /* 0x4 NOT src AND dst */
+ color = ~color ;
+ case GXand: /* 0x1 src AND dst */
+ data_rotate_value = VGA_AND_MODE << 8 ;
+ case GXcopy: /* 0x3 src */
+ break ;
+ case GXequiv: /* 0x9 NOT src XOR dst */
+ color = ~color ;
+ case GXxor: /* 0x6 src XOR dst */
+ data_rotate_value = VGA_XOR_MODE << 8 ;
+ break ;
+ case GXandReverse: /* 0x2 src AND NOT dst */
+ invert_existing_data = DO_RECURSE ;
+ data_rotate_value = VGA_AND_MODE << 8 ;
+ break ;
+ case GXorReverse: /* 0xb src OR NOT dst */
+ invert_existing_data = DO_RECURSE ;
+ data_rotate_value = VGA_OR_MODE << 8 ;
+ break ;
+ case GXnand: /* 0xe NOT src OR NOT dst */
+ invert_existing_data = DO_RECURSE ;
+ case GXorInverted: /* 0xd NOT src OR dst */
+ color = ~color ;
+ case GXor: /* 0x7 src OR dst */
+ data_rotate_value = VGA_OR_MODE << 8 ;
+ break ;
+ case GXcopyInverted: /* 0xc NOT src */
+ color = ~color ;
+ break ;
+ case GXnoop: /* 0x5 dst */
+ ; /* Shouldn't Get Here !! */
+}
+
+return ( color & VGA_ALLPLANES ) | data_rotate_value | invert_existing_data ;
+}
+
+static void
+vgaDrawMonoImage
+(
+ WindowPtr pWin, /* GJA */
+ unsigned char *data,
+ int x,
+ int y,
+ int w,
+ int h,
+ unsigned long int fg,
+ int alu,
+ unsigned long int planes
+)
+{
+unsigned long regState ;
+
+if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
+ xf4bppOffDrawMonoImage( pWin, data, x, y, w, h, fg, alu, planes );
+ return;
+}
+
+if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
+ return ;
+
+#ifndef PC98_EGC
+if ( ( regState = vgaCalcMonoMode( alu, fg ) ) & DO_RECURSE ) {
+ vgaDrawMonoImage( pWin, data, x, y, w, h,
+ VGA_ALLPLANES, GXinvert, planes ) ;
+ regState &= ~DO_RECURSE ;
+}
+#else
+regState = vgaCalcMonoMode(alu, (char)fg);
+#endif
+
+
+vgaSetMonoRegisters( (DrawablePtr)pWin, planes, regState ) ;
+
+DoMonoSingle( pWin, w, x, y, (const unsigned char *) data, h,
+ w, ( ( w + 31 ) & ~31 ) >> 3, h, 0, 0 ) ;
+
+
+return ;
+}
+
+void
+xf4bppFillStipple( pWin, pStipple, fg, alu, planes, x, y, w, h, xSrc, ySrc )
+WindowPtr pWin; /* GJA */
+register PixmapPtr const pStipple ;
+unsigned long int fg ;
+const int alu ;
+unsigned long int planes ;
+int x, y, w, h ;
+const int xSrc, ySrc ;
+{
+unsigned int width ;
+unsigned int height ;
+int xshift ;
+int yshift ;
+unsigned long regState ;
+
+if ( !xf86Screens[((DrawablePtr)pWin)->pScreen->myNum]->vtSema ) {
+ xf4bppOffFillStipple( pWin, pStipple, fg, alu, planes,
+ x, y, w, h, xSrc, ySrc );
+ return;
+}
+
+if ( ( alu == GXnoop ) || !( planes &= VGA_ALLPLANES ) )
+ return ;
+
+#if 1
+if ( ( regState = vgaCalcMonoMode( alu, fg ) ) & DO_RECURSE ) {
+ xf4bppFillStipple( pWin, pStipple, VGA_ALLPLANES, GXinvert, planes,
+ x, y, w, h, xSrc, ySrc ) ;
+ regState &= ~DO_RECURSE ;
+}
+#else
+regState = vgaCalcMonoMode(alu, (char)fg);
+#endif
+
+
+vgaSetMonoRegisters( (DrawablePtr)pWin, planes, regState ) ;
+
+/* Figure Bit Offsets & Source Address */
+width = pStipple->drawable.width ;
+if ( ( xshift = ( x - xSrc ) ) < 0 )
+ xshift = width - ( ( - xshift ) % width ) ;
+else
+ xshift %= width ;
+if ( xshift == (int)width ) xshift = 0;
+
+height = pStipple->drawable.height ;
+if ( ( yshift = ( y - ySrc ) ) < 0 )
+ yshift = height - ( ( - yshift ) % height ) ;
+else
+ yshift %= height ;
+if ( yshift == (int)height ) yshift = 0;
+
+ (* ( (h > (int)height) ? DoMonoMany : DoMonoSingle ) ) (
+ pWin, w, x, y,
+ (const unsigned char *) pStipple->devPrivate.ptr,
+ h,
+ width,
+ ( ( width + 31 ) & ((unsigned)(~31)) ) >> 3,
+ height,
+ xshift, yshift
+ ) ;
+
+return ;
+}
diff --git a/hw/xfree86/xf4bpp/vgaVideo.h b/hw/xfree86/xf4bpp/vgaVideo.h
new file mode 100644
index 000000000..ecc2fa738
--- /dev/null
+++ b/hw/xfree86/xf4bpp/vgaVideo.h
@@ -0,0 +1,92 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgaVideo.h,v 1.2 1998/07/25 16:59:45 dawes Exp $ */
+/*
+ * Copyright IBM Corporation 1987,1988,1989
+ *
+ * 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 and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of IBM not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * IBM 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.
+ *
+*/
+
+/* $XConsortium: vgaVideo.h /main/4 1996/02/21 17:59:14 kaleb $ */
+
+#include "misc.h" /* GJA -- for pointer data type */
+#ifdef lint
+#if defined(volatile)
+#undef volatile
+#endif
+#define volatile /**/
+#if defined(const)
+#undef const
+#endif
+#define const /**/
+#if defined(signed)
+#undef signed
+#endif
+#define signed /**/
+#endif
+
+/*
+ * References to all pc ( i.e. '286 ) memory in the
+ * regions used by the [ev]ga server ( the 128K windows )
+ * MUST be long-word ( i.e. 32-bit ) reads or writes.
+ * This definition will change for other memory architectures
+ * ( e.g. AIX-Rt )
+ */
+typedef unsigned char VideoAdapterObject ;
+typedef volatile VideoAdapterObject *VideoMemoryPtr ;
+typedef volatile VideoAdapterObject *VgaMemoryPtr ;
+#if !defined(BITMAP_BIT_ORDER)
+#define BITMAP_BIT_ORDER MSBFirst
+#endif
+
+#if !defined(IMAGE_BYTE_ORDER)
+#define IMAGE_BYTE_ORDER LSBFirst
+#endif
+
+/* Bit Ordering Macros */
+#if !defined(SCRLEFT8)
+#define SCRLEFT8(lw, n) ( (unsigned char) (((unsigned char) lw) << (n)) )
+#endif
+#if !defined(SCRRIGHT8)
+#define SCRRIGHT8(lw, n) ( (unsigned char) (((unsigned char)lw) >> (n)) )
+#endif
+/* These work ONLY on 8-bit wide Quantities !! */
+#define LeftmostBit ( SCRLEFT8( 0xFF, 7 ) & 0xFF )
+#define RightmostBit ( SCRRIGHT8( 0xFF, 7 ) & 0xFF )
+
+/*
+ * [ev]ga video screen defines & macros
+ */
+#define VGA_BLACK_PIXEL 0
+#define VGA_WHITE_PIXEL 1
+
+#define VGA_MAXPLANES 4
+#define VGA_ALLPLANES 0xFL
+
+#define VIDBASE(pDraw) ((volatile unsigned char *) \
+ (((PixmapPtr)(((DrawablePtr)(pDraw))->pScreen->devPrivate))-> \
+ devPrivate.ptr))
+#define BYTES_PER_LINE(pDraw) \
+ ((int)((PixmapPtr)(((DrawablePtr)(pDraw))->pScreen->devPrivate))->devKind)
+
+#define ROW_OFFSET( x ) ( ( x ) >> 3 )
+#define BIT_OFFSET( x ) ( ( x ) & 0x7 )
+#define SCREENADDRESS( pWin, x, y ) \
+ ( VIDBASE(pWin) + (y) * BYTES_PER_LINE(pWin) + ROW_OFFSET(x) )
+
+
diff --git a/hw/xfree86/xf4bpp/vgamodule.c b/hw/xfree86/xf4bpp/vgamodule.c
new file mode 100644
index 000000000..c7cf1b7d3
--- /dev/null
+++ b/hw/xfree86/xf4bpp/vgamodule.c
@@ -0,0 +1,57 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/vgamodule.c,v 1.8 1999/01/26 05:54:20 dawes Exp $ */
+/*
+ * Copyright (C) 1998 The XFree86 Project, 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, 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ */
+
+#ifdef XFree86LOADER
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(xf4bppSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "xf4bpp",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData xf4bppModuleData = { &VersRec, xf4bppSetup, NULL };
+
+static pointer
+xf4bppSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ /* This module requires xf1bpp for bitmap support */
+ return LoadSubModule(module, "xf1bpp", NULL, NULL, NULL, NULL,
+ errmaj, errmin);
+}
+
+#endif
diff --git a/hw/xfree86/xf4bpp/wm3.c b/hw/xfree86/xf4bpp/wm3.c
new file mode 100644
index 000000000..3509ce77f
--- /dev/null
+++ b/hw/xfree86/xf4bpp/wm3.c
@@ -0,0 +1,207 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/wm3.c,v 1.4 2002/01/25 21:56:23 tsi Exp $ */
+
+
+
+
+
+/* $XConsortium: wm3.c /main/5 1996/02/21 17:59:21 kaleb $ */
+
+#include "xf4bpp.h"
+#include "OScompiler.h"
+#include "wm3.h"
+#include "vgaVideo.h"
+#include "xf86.h"
+
+/* Ferraro is wrong. GJA */
+#define COPY (0 << 3)
+#define AND (1 << 3)
+#define OR (2 << 3)
+#define XOR (3 << 3)
+
+int
+wm3_set_regs(pGC)
+GC *pGC;
+{
+#ifndef PC98_EGC
+ IOADDRESS REGBASE = xf86Screens[pGC->pScreen->myNum]->domainIOBase + 0x300;
+ int post_invert = 0;
+ int ALU;
+
+ switch(pGC->alu) {
+ case GXclear: /* rop0 = RROP_BLACK; rop1 = RROP_BLACK; */
+ pGC->fgPixel = 0;
+ pGC->bgPixel = 0;
+ ALU = COPY;
+ break;
+ case GXand: /* rop0 = RROP_BLACK; rop1 = RROP_NOP; */
+ ALU = AND;
+ break;
+ case GXandReverse: /* rop0 = RROP_BLACK; rop1 = RROP_INVERT; -- TRICKY */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = OR;
+ post_invert = 1;
+ break;
+ case GXcopy: /* rop0 = RROP_BLACK; rop1 = RROP_WHITE; */
+ ALU = COPY;
+ break;
+ case GXandInverted: /* rop0 = RROP_NOP; rop1 = RROP_BLACK; */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = AND;
+ break;
+ default:
+ case GXnoop: /* rop0 = RROP_NOP; rop1 = RROP_NOP; */
+ return 0;
+ case GXxor: /* rop0 = RROP_NOP; rop1 = RROP_INVERT; */
+ ALU = XOR;
+ break;
+ case GXor: /* rop0 = RROP_NOP; rop1 = RROP_WHITE; */
+ ALU = OR;
+ break;
+ case GXnor: /* rop0 = RROP_INVERT; rop1 = RROP_BLACK; -- TRICKY*/
+ ALU = OR;
+ post_invert = 1;
+ break;
+ case GXequiv: /* rop0 = RROP_INVERT; rop1 = RROP_NOP; */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = XOR;
+ break;
+ case GXinvert: /* rop0 = RROP_INVERT; rop1 = RROP_INVERT; */
+ pGC->fgPixel = 0x0F;
+ pGC->bgPixel = 0x0F;
+ ALU = XOR;
+ break;
+ case GXorReverse: /* rop0 = RROP_INVERT; rop1 = RROP_WHITE; -- TRICKY */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = AND;
+ post_invert = 1;
+ break;
+ case GXcopyInverted: /* rop0 = RROP_WHITE; rop1 = RROP_BLACK; */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = COPY;
+ break;
+ case GXorInverted: /* rop0 = RROP_WHITE; rop1 = RROP_NOP; */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = OR;
+ break;
+ case GXnand: /* rop0 = RROP_WHITE; rop1 = RROP_INVERT; -- TRICKY */
+ ALU = AND;
+ post_invert = 1;
+ break;
+ case GXset: /* rop0 = RROP_WHITE; rop1 = RROP_WHITE; */
+ pGC->fgPixel = 0x0F;
+ pGC->bgPixel = 0x0F;
+ ALU = COPY;
+ break;
+ }
+
+
+ SetVideoSequencer(Mask_MapIndex, (pGC->planemask & VGA_ALLPLANES));
+ SetVideoGraphics(Enb_Set_ResetIndex, VGA_ALLPLANES);
+ SetVideoGraphics(Set_ResetIndex, pGC->fgPixel);
+ SetVideoGraphics(Bit_MaskIndex, 0xFF);
+ SetVideoGraphics(Graphics_ModeIndex, 3); /* Write Mode 3 */
+ SetVideoGraphics(Data_RotateIndex, ALU);
+
+ return post_invert;
+#else
+ int ALU;
+
+ switch(pGC->alu) {
+ case GXclear: /* rop0 = RROP_BLACK; rop1 = RROP_BLACK; */
+ pGC->fgPixel = 0;
+ pGC->bgPixel = 0;
+ ALU = EGC_COPY_MODE;
+ break;
+ case GXand: /* rop0 = RROP_BLACK; rop1 = RROP_NOP; */
+ ALU = EGC_AND_MODE;
+ break;
+ case GXandReverse: /* rop0 = RROP_BLACK; rop1 = RROP_INVERT; -- TRICKY */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = EGC_OR_INV_MODE;
+ break;
+ case GXcopy: /* rop0 = RROP_BLACK; rop1 = RROP_WHITE; */
+ ALU = EGC_COPY_MODE;
+ break;
+ case GXandInverted: /* rop0 = RROP_NOP; rop1 = RROP_BLACK; */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = EGC_AND_MODE;
+ break;
+ case GXnoop: /* rop0 = RROP_NOP; rop1 = RROP_NOP; */
+ return 0;
+ case GXxor: /* rop0 = RROP_NOP; rop1 = RROP_INVERT; */
+ ALU = EGC_XOR_MODE;
+ break;
+ case GXor: /* rop0 = RROP_NOP; rop1 = RROP_WHITE; */
+ ALU = EGC_OR_MODE;
+ break;
+ case GXnor: /* rop0 = RROP_INVERT; rop1 = RROP_BLACK; -- TRICKY*/
+ ALU = EGC_OR_INV_MODE;
+ break;
+ case GXequiv: /* rop0 = RROP_INVERT; rop1 = RROP_NOP; */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = EGC_XOR_MODE;
+ break;
+ case GXinvert: /* rop0 = RROP_INVERT; rop1 = RROP_INVERT; */
+ pGC->fgPixel = 0x0F;
+ pGC->bgPixel = 0x0F;
+ ALU = EGC_XOR_MODE;
+ break;
+ case GXorReverse: /* rop0 = RROP_INVERT; rop1 = RROP_WHITE; -- TRICKY */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = EGC_AND_INV_MODE;
+ break;
+ case GXcopyInverted: /* rop0 = RROP_WHITE; rop1 = RROP_BLACK; */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = EGC_COPY_MODE;
+ break;
+ case GXorInverted: /* rop0 = RROP_WHITE; rop1 = RROP_NOP; */
+ pGC->fgPixel = ~pGC->fgPixel;
+ pGC->bgPixel = ~pGC->bgPixel;
+ ALU = EGC_OR_MODE;
+ break;
+ case GXnand: /* rop0 = RROP_WHITE; rop1 = RROP_INVERT; -- TRICKY */
+ ALU = EGC_OR_INV_MODE;
+ break;
+ case GXset: /* rop0 = RROP_WHITE; rop1 = RROP_WHITE; */
+ pGC->fgPixel = 0x0F;
+ pGC->bgPixel = 0x0F;
+ ALU = EGC_COPY_MODE;
+ break;
+ }
+
+ outw(EGC_PLANE, ~(pGC->planemask & VGA_ALLPLANES));
+ outw(EGC_MODE, ALU);
+ outw(EGC_FGC, pGC->fgPixel & VGA_ALLPLANES); /* set FGC */
+
+ return 0;
+#endif
+}
+
+/*
+ Now we will have to set the alu.
+ Problematic is: How do we handle IsDoubleDash, which draws with both fg
+ and bg colour?
+ The answer is: We take care to store the ink colour in one register only.
+ Then we need set only this register to change the ink.
+ */
+
+/* -- MORE NOTES:
+ We might try to 'wrap' the mfb functions in a 16-colour wrapper that does
+ all operations once. However, this does not work:
+ Some operations (esp) CopyArea may for example cause expositions.
+ Such expositions will cause data to be copied in from backing store,
+ and this copying in may damage the contents of the VGA registers.
+ So we must take care to set the VGA registers at each place where they could
+ be modified.
+ */
diff --git a/hw/xfree86/xf4bpp/wm3.h b/hw/xfree86/xf4bpp/wm3.h
new file mode 100644
index 000000000..5fd303d7d
--- /dev/null
+++ b/hw/xfree86/xf4bpp/wm3.h
@@ -0,0 +1,77 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/wm3.h,v 1.3 2000/09/26 15:57:21 tsi Exp $ */
+
+
+
+
+
+/* $XConsortium: wm3.h /main/4 1996/02/21 17:59:24 kaleb $ */
+
+#include "vgaReg.h"
+
+#ifdef PC98_EGC
+#define VGA_ALLPLANES 0xFL
+#endif
+
+/* Do call in Write Mode 3.
+ * We take care of the possibility that two passes are needed.
+ */
+#ifndef PC98_EGC
+#define DO_WM3(pgc,call) \
+ { int _tp, _fg, _bg, _alu; \
+ _fg = pgc->fgPixel; _bg = pgc->bgPixel; \
+ _tp = wm3_set_regs(pgc); \
+ (call); \
+ if ( _tp ) { \
+ _alu = pgc->alu; \
+ pgc->alu = GXinvert; \
+ _tp = wm3_set_regs(pgc); \
+ (call); \
+ pgc->alu = _alu; \
+ } \
+ pgc->fgPixel = _fg; pgc->bgPixel = _bg; \
+ }
+#else
+#define DO_WM3(pgc,call) \
+ { int _tp, _fg, _bg; \
+ _fg = pgc->fgPixel; _bg = pgc->bgPixel; \
+ _tp = wm3_set_regs(pgc); \
+ (call); \
+ pgc->fgPixel = _fg; pgc->bgPixel = _bg; \
+ }
+#endif
+
+#ifndef PC98_EGC
+#define WM3_SET_INK(ink) \
+ SetVideoGraphics(Set_ResetIndex, ink)
+#else
+#define WM3_SET_INK(ink) \
+ outw(EGC_FGC, ink)
+#endif
+
+/* GJA -- Move a long word to screen memory.
+ * The reads into 'dummy' are here to load the VGA latches.
+ * This is a RMW operation except for trivial cases.
+ * Notice that we ignore the operation.
+ */
+#ifdef PC98_EGC
+#define UPDRW(destp,src) \
+ { volatile unsigned short *_dtmp = \
+ (volatile unsigned short *)(destp); \
+ unsigned int _stmp = (src); \
+ *_dtmp = _stmp; _dtmp++; _stmp >>= 16; \
+ *_dtmp = _stmp; }
+#else
+#define UPDRW(destp,src) \
+ { volatile char *_dtmp = (volatile char *)(destp); \
+ unsigned int _stmp = (src); \
+ volatile int dummy; /* Bit bucket. */ \
+ _stmp = ldl_u(&_stmp); \
+ dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
+ dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
+ dummy = *_dtmp; *_dtmp = _stmp; _dtmp++; _stmp >>= 8; \
+ dummy = *_dtmp; *_dtmp = _stmp; }
+#endif
+
+#define UPDRWB(destp,src) \
+ { volatile int dummy; /* Bit bucket. */ \
+ dummy = *(destp); *(destp) = (src); }
diff --git a/hw/xfree86/xf4bpp/xf4bpp.h b/hw/xfree86/xf4bpp/xf4bpp.h
new file mode 100644
index 000000000..f9141e5e1
--- /dev/null
+++ b/hw/xfree86/xf4bpp/xf4bpp.h
@@ -0,0 +1,804 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/xf4bpp.h,v 1.8 2003/02/18 21:29:59 tsi Exp $ */
+
+
+#ifndef __XF4BPP_H__
+#define __XF4BPP_H__
+
+
+#include "windowstr.h"
+#include "gcstruct.h"
+#include "colormapst.h"
+#include "fontstruct.h"
+#ifndef PixelType
+#define PixelType CARD32
+#endif
+
+/* ppcArea.c */
+void xf4bppFillArea(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ BoxPtr,
+ GCPtr
+#endif
+);
+
+/* ppcBStore.c */
+void xf4bppSaveAreas(
+#if NeedFunctionPrototypes
+ PixmapPtr,
+ RegionPtr,
+ int,
+ int,
+ WindowPtr
+#endif
+);
+void xf4bppRestoreAreas(
+#if NeedFunctionPrototypes
+ PixmapPtr,
+ RegionPtr,
+ int,
+ int,
+ WindowPtr
+#endif
+);
+
+/* ppcClip.c */
+void xf4bppDestroyClip(
+#if NeedFunctionPrototypes
+ GCPtr
+#endif
+);
+void xf4bppChangeClip(
+#if NeedFunctionPrototypes
+ GCPtr,
+ int,
+ pointer,
+ int
+#endif
+);
+void xf4bppCopyClip(
+#if NeedFunctionPrototypes
+ GCPtr,
+ GCPtr
+#endif
+);
+
+/* ppcCpArea.c */
+RegionPtr xf4bppCopyArea(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ DrawablePtr,
+ GCPtr,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+
+/* ppcDepth.c */
+Bool xf4bppDepthOK(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ int
+#endif
+);
+
+/* ppcFillRct.c */
+void xf4bppPolyFillRect(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ xRectangle *
+#endif
+);
+
+/* ppcWindowFS.c */
+void xf4bppSolidWindowFS(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int
+#endif
+);
+void xf4bppStippleWindowFS(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int
+#endif
+);
+void xf4bppOpStippleWindowFS(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int
+#endif
+);
+void xf4bppTileWindowFS(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int
+#endif
+);
+
+/* xf4bppPixmapFS.c */
+void xf4bppSolidPixmapFS(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int
+#endif
+);
+void xf4bppStipplePixmapFS(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int
+#endif
+);
+void xf4bppOpStipplePixmapFS(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int
+#endif
+);
+void xf4bppTilePixmapFS(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int
+#endif
+);
+
+/* ppcGC.c */
+Bool xf4bppCreateGC(
+#if NeedFunctionPrototypes
+ GCPtr
+#endif
+);
+void xf4bppDestroyGC(
+#if NeedFunctionPrototypes
+ GC *
+#endif
+);
+void xf4bppValidateGC(
+#if NeedFunctionPrototypes
+ GCPtr,
+ unsigned long,
+ DrawablePtr
+#endif
+);
+
+/* ppcGetSp.c */
+void xf4bppGetSpans(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ int,
+ DDXPointPtr,
+ int *,
+ int,
+ char *
+#endif
+);
+
+/* ppcImg.c */
+void xf4bppGetImage(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ int,
+ int,
+ int,
+ int,
+ unsigned int,
+ unsigned long,
+ char *
+#endif
+);
+
+/* ppcLine.c */
+void xf4bppScrnZeroLine(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ int,
+ DDXPointPtr
+#endif
+);
+void xf4bppScrnZeroDash(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ int,
+ DDXPointPtr
+#endif
+);
+void xf4bppScrnZeroSegs(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ xSegment *
+#endif
+);
+
+/* ppcPixmap.c */
+PixmapPtr xf4bppCreatePixmap(
+#if NeedFunctionPrototypes
+ ScreenPtr,
+ int,
+ int,
+ int
+#endif
+);
+PixmapPtr xf4bppCopyPixmap(
+#if NeedFunctionPrototypes
+ PixmapPtr
+#endif
+);
+
+/* ppcPntWin.c */
+void xf4bppPaintWindow(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ RegionPtr,
+ int
+#endif
+);
+
+/* ppcPolyPnt.c */
+void xf4bppPolyPoint(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ int,
+ xPoint *
+#endif
+);
+
+/* ppcPolyRec.c */
+void xf4bppPolyRectangle(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ xRectangle *
+#endif
+);
+
+/* ppcQuery.c */
+void xf4bppQueryBestSize(
+#if NeedFunctionPrototypes
+ int,
+ unsigned short *,
+ unsigned short *,
+ ScreenPtr
+#endif
+);
+
+/* ppcRslvC.c */
+void xf4bppResolveColor(
+#if NeedFunctionPrototypes
+ unsigned short *,
+ unsigned short *,
+ unsigned short *,
+ VisualPtr
+#endif
+);
+Bool xf4bppInitializeColormap(
+#if NeedFunctionPrototypes
+ ColormapPtr
+#endif
+);
+
+/* ppcSetSp.c */
+void xf4bppSetSpans(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ char *,
+ DDXPointPtr,
+ int *,
+ int,
+ int
+#endif
+);
+
+/* ppcWindow.c */
+void xf4bppCopyWindow(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ DDXPointRec,
+ RegionPtr
+#endif
+);
+Bool xf4bppPositionWindow(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ int
+#endif
+);
+Bool xf4bppUnrealizeWindow(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ int
+#endif
+);
+Bool xf4bppDestroyWindow(
+#if NeedFunctionPrototypes
+ WindowPtr
+#endif
+);
+Bool xf4bppCreateWindowForXYhardware(
+#if NeedFunctionPrototypes
+ WindowPtr
+#endif
+);
+
+/* emulOpStip.c */
+void xf4bppOpaqueStipple(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ PixmapPtr,
+ unsigned long int,
+ unsigned long int,
+ int,
+ unsigned long int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+
+/* emulRepAre.c */
+void xf4bppReplicateArea(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+
+/* emulTile.c */
+void xf4bppTileRect(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ PixmapPtr,
+ const int,
+ const unsigned long int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+
+/* vgaGC.c */
+Mask xf4bppChangeWindowGC(
+#if NeedFunctionPrototypes
+ GCPtr,
+ Mask
+#endif
+);
+
+/* vgaBitBlt.c */
+void xf4bppBitBlt(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+
+/* vgaImages.c */
+void xf4bppDrawColorImage(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ int,
+ int,
+ int,
+ unsigned char *,
+ int,
+ const int,
+ const unsigned long int
+#endif
+);
+void xf4bppReadColorImage(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ int,
+ int,
+ int,
+ unsigned char *,
+ int
+#endif
+);
+
+/* vgaLine.c */
+void xf4bppHorzLine(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ unsigned long int,
+ int,
+ unsigned long int,
+ int,
+ int,
+ int
+#endif
+);
+void xf4bppVertLine(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ unsigned long int,
+ int,
+ unsigned long int,
+ int,
+ int,
+ int
+#endif
+);
+void xf4bppBresLine(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ unsigned long int,
+ int,
+ unsigned long int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ unsigned long int
+#endif
+);
+
+/* vgaStipple.c */
+void xf4bppFillStipple(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ const PixmapPtr,
+ unsigned long int,
+ const int,
+ unsigned long int,
+ int,
+ int,
+ int,
+ int,
+ const int,
+ const int
+#endif
+);
+
+/* vgaSolid.c */
+void xf4bppFillSolid(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ unsigned long int,
+ const int,
+ unsigned long int,
+ int,
+ const int,
+ int,
+ const int
+#endif
+);
+
+/* offscreen.c */
+void xf4bppOffBitBlt(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ const int,
+ const int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+void xf4bppOffDrawColorImage(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ int,
+ int,
+ int,
+ unsigned char *,
+ int,
+ const int,
+ const unsigned long int
+#endif
+);
+void xf4bppOffReadColorImage(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ int,
+ int,
+ int,
+ int,
+ unsigned char *,
+ int
+#endif
+);
+void xf4bppOffFillSolid(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ unsigned long int,
+ const int,
+ unsigned long int,
+ int,
+ const int,
+ int,
+ const int
+#endif
+);
+void xf4bppOffDrawMonoImage(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ unsigned char *,
+ int,
+ int,
+ int,
+ int,
+ unsigned long int,
+ int,
+ unsigned long int
+#endif
+);
+void xf4bppOffFillStipple(
+#if NeedFunctionPrototypes
+ WindowPtr,
+ const PixmapPtr,
+ unsigned long int,
+ const int,
+ unsigned long int,
+ int,
+ int,
+ int,
+ int,
+ const int,
+ const int
+#endif
+);
+
+/* mfbimggblt.c */
+void xf4bppImageGlyphBlt(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ int,
+ unsigned int,
+ CharInfoPtr *,
+ pointer
+#endif
+);
+
+/* wm3.c */
+int wm3_set_regs(
+#if NeedFunctionPrototypes
+ GC *
+#endif
+);
+
+/* ppcIO.c */
+int xf4bppNeverCalled(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+Bool xf4bppScreenInit(
+#if NeedFunctionPrototypes
+ ScreenPtr,
+ pointer,
+ int,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+
+/* mfbfillarc.c */
+void xf4bppPolyFillArc(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ xArc *
+#endif
+);
+
+/* mfbzerarc.c */
+void xf4bppZeroPolyArc(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ xArc *
+#endif
+);
+
+/* mfbline.c */
+void xf4bppSegmentSS (
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ xSegment *
+#endif
+);
+void xf4bppLineSS (
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ int,
+ DDXPointPtr
+#endif
+);
+void xf4bppSegmentSD (
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ xSegment *
+#endif
+);
+void xf4bppLineSD (
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ GCPtr,
+ int,
+ int,
+ DDXPointPtr
+#endif
+);
+
+/* mfbbres.c */
+void xf4bppBresS(
+#if NeedFunctionPrototypes
+ PixelType *,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+
+/* mfbbresd.c */
+void xf4bppBresD(
+#if NeedFunctionPrototypes
+ DrawablePtr,
+ int, int,
+ int *,
+ unsigned char *,
+ int,
+ int *,
+ int,
+ PixelType *,
+ int, int, int, int, int, int,
+ int, int,
+ int, int
+#endif
+);
+
+/* mfbhrzvert.c */
+void xf4bppHorzS(
+#if NeedFunctionPrototypes
+ PixelType *,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+void xf4bppVertS(
+#if NeedFunctionPrototypes
+ PixelType *,
+ int,
+ int,
+ int,
+ int
+#endif
+);
+
+#ifdef PC98_EGC
+
+/* egc_asm.s */
+unsigned char getbits_x(
+#if NeedFunctionPrototypes
+ int,
+ unsigned int,
+ pointer,
+ unsigned int
+#endif
+);
+void wcopyr(
+#if NeedFunctionPrototypes
+ pointer,
+ pointer,
+ int,
+ pointer
+#endif
+);
+void wcopyl(
+#if NeedFunctionPrototypes
+ pointer,
+ pointer,
+ int,
+ pointer
+#endif
+);
+unsigned long int read8Z(
+#if NeedFunctionPrototypes
+ pointer
+#endif
+);
+
+#endif /* PC98_EGC */
+
+#endif /* __XF4BPP_H__ */
diff --git a/hw/xfree86/xf8_16bpp/cfb8_16.h b/hw/xfree86/xf8_16bpp/cfb8_16.h
new file mode 100644
index 000000000..b7fa9fd00
--- /dev/null
+++ b/hw/xfree86/xf8_16bpp/cfb8_16.h
@@ -0,0 +1,69 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfb8_16.h,v 1.2 1999/03/28 15:33:09 dawes Exp $ */
+
+#ifndef _CFB8_16_H
+#define _CFB8_16_H
+
+#include "regionstr.h"
+#include "windowstr.h"
+
+typedef struct {
+ pointer pix8;
+ int width8;
+ pointer pix16;
+ int width16;
+ unsigned char key;
+} cfb8_16ScreenRec, *cfb8_16ScreenPtr;
+
+extern int cfb8_16ScreenPrivateIndex;
+
+Bool
+cfb8_16ScreenInit (
+ ScreenPtr pScreen,
+ pointer pbits16,
+ pointer pbits8,
+ int xsize, int ysize,
+ int dpix, int dpiy,
+ int width16,
+ int width8
+);
+
+void
+cfb8_16PaintWindow (
+ WindowPtr pWin,
+ RegionPtr pRegion,
+ int what
+);
+
+Bool cfb8_16CreateWindow(WindowPtr pWin);
+Bool cfb8_16DestroyWindow(WindowPtr pWin);
+
+Bool
+cfb8_16PositionWindow(
+ WindowPtr pWin,
+ int x, int y
+);
+
+void
+cfb8_16CopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+);
+
+Bool
+cfb8_16ChangeWindowAttributes(
+ WindowPtr pWin,
+ unsigned long mask
+);
+
+void
+cfb8_16WindowExposures(
+ WindowPtr pWin,
+ RegionPtr pReg,
+ RegionPtr pOtherReg
+);
+
+#define CFB8_16_GET_SCREEN_PRIVATE(pScreen)\
+ (cfb8_16ScreenPtr)((pScreen)->devPrivates[cfb8_16ScreenPrivateIndex].ptr)
+
+#endif /* _CFB8_16_H */
diff --git a/hw/xfree86/xf8_16bpp/cfb8_16module.c b/hw/xfree86/xf8_16bpp/cfb8_16module.c
new file mode 100644
index 000000000..d0d1974e7
--- /dev/null
+++ b/hw/xfree86/xf8_16bpp/cfb8_16module.c
@@ -0,0 +1,37 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfb8_16module.c,v 1.1 1999/01/31 12:22:16 dawes Exp $ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(xf8_16bppSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "xf8_16bpp",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ NULL,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData xf8_16bppModuleData = { &VersRec, xf8_16bppSetup, NULL };
+
+static pointer
+xf8_16bppSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ if (!LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ if (!LoadSubModule(module, "cfb16", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ return (pointer)1; /* non-NULL required to indicate success */
+}
+
+#endif
diff --git a/hw/xfree86/xf8_16bpp/cfbscrinit.c b/hw/xfree86/xf8_16bpp/cfbscrinit.c
new file mode 100644
index 000000000..5e19fb7a2
--- /dev/null
+++ b/hw/xfree86/xf8_16bpp/cfbscrinit.c
@@ -0,0 +1,370 @@
+/*
+ Copyright (C) 1999. The XFree86 Project Inc.
+
+ Written by Mark Vojkovich (mvojkovi@ucsd.edu)
+*/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfbscrinit.c,v 1.8 2003/02/17 16:08:30 dawes Exp $ */
+
+#include "X.h"
+#include "Xmd.h"
+#include "misc.h"
+#include "servermd.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "resource.h"
+#include "colormap.h"
+#include "colormapst.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb16.h"
+#include "cfb8_16.h"
+#include "mi.h"
+#include "micmap.h"
+#include "mistruct.h"
+#include "gcstruct.h"
+#include "dix.h"
+#include "mibstore.h"
+#include "xf86str.h"
+#include "xf86.h"
+
+/* CAUTION: We require that cfb8 and cfb16 were NOT
+ compiled with CFB_NEED_SCREEN_PRIVATE */
+
+int cfb8_16ScreenPrivateIndex;
+
+static unsigned long cfb8_16Generation = 0;
+
+static PixmapPtr cfb8_16GetWindowPixmap(WindowPtr pWin);
+static void
+cfb8_16SaveAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+
+static void
+cfb8_16RestoreAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+
+static BSFuncRec cfb8_16BSFuncRec = {
+ cfb8_16SaveAreas,
+ cfb8_16RestoreAreas,
+ (BackingStoreSetClipmaskRgnProcPtr) 0,
+ (BackingStoreGetImagePixmapProcPtr) 0,
+ (BackingStoreGetSpansPixmapProcPtr) 0,
+};
+
+static void
+cfb8_16GetSpans(
+ DrawablePtr pDraw,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pchardstStart
+);
+
+static void
+cfb8_16GetImage (
+ DrawablePtr pDraw,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planeMask,
+ char *pdstLine
+);
+
+static Bool cfb8_16CreateGC(GCPtr pGC);
+static void cfb8_16EnableDisableFBAccess(int index, Bool enable);
+
+
+static Bool
+cfb8_16AllocatePrivates(ScreenPtr pScreen)
+{
+ cfb8_16ScreenPtr pScreenPriv;
+
+ if(cfb8_16Generation != serverGeneration) {
+ if((cfb8_16ScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ cfb8_16Generation = serverGeneration;
+ }
+
+ if (!(pScreenPriv = xalloc(sizeof(cfb8_16ScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[cfb8_16ScreenPrivateIndex].ptr = (pointer)pScreenPriv;
+
+
+ /* All cfb will have the same GC and Window private indicies */
+ if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex))
+ return FALSE;
+
+ /* The cfb indicies are the mfb indicies. Reallocating them resizes them */
+ if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin)))
+ return FALSE;
+
+ if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
+ return FALSE;
+
+ return TRUE;
+}
+
+static Bool
+cfb8_16SetupScreen(
+ ScreenPtr pScreen,
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy
+){
+ if (!cfb8_16AllocatePrivates(pScreen))
+ return FALSE;
+ pScreen->defColormap = FakeClientID(0);
+ /* let CreateDefColormap do whatever it wants for pixels */
+ pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
+ pScreen->QueryBestSize = mfbQueryBestSize;
+ /* SaveScreen */
+ pScreen->GetImage = cfb8_16GetImage;
+ pScreen->GetSpans = cfb8_16GetSpans;
+ pScreen->CreateWindow = cfb8_16CreateWindow;
+ pScreen->DestroyWindow = cfb8_16DestroyWindow;
+ pScreen->PositionWindow = cfb8_16PositionWindow;
+ pScreen->ChangeWindowAttributes = cfb8_16ChangeWindowAttributes;
+ pScreen->RealizeWindow = cfb16MapWindow; /* OK */
+ pScreen->UnrealizeWindow = cfb16UnmapWindow; /* OK */
+ pScreen->PaintWindowBackground = cfb8_16PaintWindow;
+ pScreen->PaintWindowBorder = cfb8_16PaintWindow;
+ pScreen->CopyWindow = cfb8_16CopyWindow;
+ pScreen->CreatePixmap = cfb16CreatePixmap; /* OK */
+ pScreen->DestroyPixmap = cfb16DestroyPixmap; /* OK */
+ pScreen->RealizeFont = mfbRealizeFont;
+ pScreen->UnrealizeFont = mfbUnrealizeFont;
+ pScreen->CreateGC = cfb8_16CreateGC;
+ pScreen->CreateColormap = miInitializeColormap;
+ pScreen->DestroyColormap = (void (*)())NoopDDA;
+ pScreen->InstallColormap = miInstallColormap;
+ pScreen->UninstallColormap = miUninstallColormap;
+ pScreen->ListInstalledColormaps = miListInstalledColormaps;
+ pScreen->StoreColors = (void (*)())NoopDDA;
+ pScreen->ResolveColor = miResolveColor;
+ pScreen->BitmapToRegion = mfbPixmapToRegion;
+
+ mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane);
+ return TRUE;
+}
+
+static Bool
+cfb8_16CreateScreenResources(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ cfb8_16ScreenPtr pScreenPriv = CFB8_16_GET_SCREEN_PRIVATE(pScreen);
+ PixmapPtr pix8, pix16;
+
+ xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
+
+ pix8 = (*pScreen->CreatePixmap)(pScreen, 0, 0, 8);
+ pix16 = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScrn->depth);
+ if(!pix16 || !pix8)
+ return FALSE;
+
+ pix8->drawable.width = pScreen->width;
+ pix8->drawable.height = pScreen->height;
+ pix8->devKind = pScreenPriv->width8;
+ pix8->devPrivate.ptr = pScreenPriv->pix8;
+
+ pix16->drawable.width = pScreen->width;
+ pix16->drawable.height = pScreen->height;
+ pix16->devKind = pScreenPriv->width16 * 2;
+ pix16->devPrivate.ptr = pScreenPriv->pix16;
+
+ pScreenPriv->pix8 = (pointer)pix8;
+ pScreenPriv->pix16 = (pointer)pix16;
+
+ pScreen->devPrivate = (pointer)pix16;
+
+ return TRUE;
+}
+
+
+static Bool
+cfb8_16CloseScreen (int i, ScreenPtr pScreen)
+{
+ cfb8_16ScreenPtr pScreenPriv = CFB8_16_GET_SCREEN_PRIVATE(pScreen);
+
+ xfree((pointer) pScreenPriv);
+
+ return(cfb16CloseScreen(i, pScreen));
+}
+
+static Bool
+cfb8_16FinishScreenInit(
+ ScreenPtr pScreen,
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy /* dots per inch */
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ VisualPtr visuals;
+ DepthPtr depths;
+ int nvisuals;
+ int ndepths;
+ int rootdepth;
+ VisualID defaultVisual;
+
+ rootdepth = 0;
+ if (!miInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
+ &defaultVisual,((unsigned long)1<<(16-1)), 8, -1))
+ return FALSE;
+ if (! miScreenInit(pScreen, NULL, xsize, ysize, dpix, dpiy, 0,
+ rootdepth, ndepths, depths,
+ defaultVisual, nvisuals, visuals))
+ return FALSE;
+
+ pScreen->BackingStoreFuncs = cfb8_16BSFuncRec;
+ pScreen->CreateScreenResources = cfb8_16CreateScreenResources;
+ pScreen->CloseScreen = cfb8_16CloseScreen;
+ pScreen->GetWindowPixmap = cfb8_16GetWindowPixmap;
+ pScreen->WindowExposures = cfb8_16WindowExposures;
+
+ pScrn->EnableDisableFBAccess = cfb8_16EnableDisableFBAccess;
+
+ return TRUE;
+}
+
+Bool
+cfb8_16ScreenInit(
+ ScreenPtr pScreen,
+ pointer pbits16, /* pointer to screen bitmap */
+ pointer pbits8,
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy, /* dots per inch */
+ int width16, /* pixel width of frame buffer */
+ int width8
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ cfb8_16ScreenPtr pScreenPriv;
+
+ if (!cfb8_16SetupScreen(pScreen, xsize, ysize, dpix, dpiy))
+ return FALSE;
+
+ pScreenPriv = CFB8_16_GET_SCREEN_PRIVATE(pScreen);
+ pScreenPriv->pix8 = pbits8;
+ pScreenPriv->pix16 = pbits16;
+ pScreenPriv->width8 = width8;
+ pScreenPriv->width16 = width16;
+ pScreenPriv->key = pScrn->colorKey;
+
+ return cfb8_16FinishScreenInit(pScreen, xsize, ysize, dpix, dpiy);
+}
+
+
+static PixmapPtr
+cfb8_16GetWindowPixmap(WindowPtr pWin)
+{
+ cfb8_16ScreenPtr pScreenPriv =
+ CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+
+ return((pWin->drawable.bitsPerPixel == 16) ?
+ (PixmapPtr)pScreenPriv->pix16 : (PixmapPtr)pScreenPriv->pix8);
+}
+
+static void
+cfb8_16GetImage (
+ DrawablePtr pDraw,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planemask,
+ char *pdstLine
+){
+ if(!w || !h) return;
+
+ if(pDraw->bitsPerPixel == 16)
+ cfb16GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ else
+ cfbGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+}
+
+static void
+cfb8_16GetSpans(
+ DrawablePtr pDraw,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pDst
+){
+ if(pDraw->bitsPerPixel == 16)
+ cfb16GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+ else
+ cfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+}
+
+static void
+cfb8_16SaveAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ if(pWin->drawable.bitsPerPixel == 16)
+ cfb16SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
+ else
+ cfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
+}
+
+static void
+cfb8_16RestoreAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ if(pWin->drawable.bitsPerPixel == 16)
+ cfb16RestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
+ else
+ cfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
+}
+
+
+static Bool
+cfb8_16CreateGC(GCPtr pGC)
+{
+ if(pGC->depth == 8)
+ return(cfbCreateGC(pGC));
+ else
+ return(cfb16CreateGC(pGC));
+}
+
+static void
+cfb8_16EnableDisableFBAccess(int index, Bool enable)
+{
+ ScreenPtr pScreen = xf86Screens[index]->pScreen;
+ cfb8_16ScreenPtr pScreenPriv = CFB8_16_GET_SCREEN_PRIVATE(pScreen);
+ static DevUnion devPrivates8[MAXSCREENS];
+ static DevUnion devPrivates16[MAXSCREENS];
+ PixmapPtr pix8, pix16;
+
+ pix8 = (PixmapPtr) pScreenPriv->pix8;
+ pix16 = (PixmapPtr) pScreenPriv->pix16;
+
+ if (enable)
+ {
+ pix8->devPrivate = devPrivates8[index];
+ pix16->devPrivate = devPrivates16[index];
+ }
+ xf86EnableDisableFBAccess (index, enable);
+ if (!enable)
+ {
+ devPrivates8[index] = pix8->devPrivate;
+ pix8->devPrivate.ptr = 0;
+ devPrivates16[index] = pix16->devPrivate;
+ pix16->devPrivate.ptr = 0;
+ }
+}
diff --git a/hw/xfree86/xf8_16bpp/cfbwindow.c b/hw/xfree86/xf8_16bpp/cfbwindow.c
new file mode 100644
index 000000000..3ad8a5809
--- /dev/null
+++ b/hw/xfree86/xf8_16bpp/cfbwindow.c
@@ -0,0 +1,177 @@
+/*
+ Copyright (C) 1999. The XFree86 Project Inc.
+
+ Written by Mark Vojkovich (mvojkovi@ucsd.edu)
+*/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_16bpp/cfbwindow.c,v 1.4 2003/02/17 16:08:30 dawes Exp $ */
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb16.h"
+#include "cfb8_16.h"
+#include "mistruct.h"
+#include "regionstr.h"
+#include "cfbmskbits.h"
+#include "xf86.h"
+
+/* We don't bother with cfb's fastBackground/Border so we don't
+ need to use the Window privates */
+
+
+Bool
+cfb8_16CreateWindow(WindowPtr pWin)
+{
+ cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
+
+ pPrivWin->pRotatedBorder = NullPixmap;
+ pPrivWin->pRotatedBackground = NullPixmap;
+ pPrivWin->fastBackground = FALSE;
+ pPrivWin->fastBorder = FALSE;
+ pPrivWin->oldRotate.x = 0;
+ pPrivWin->oldRotate.y = 0;
+
+ return TRUE;
+}
+
+
+Bool
+cfb8_16DestroyWindow(WindowPtr pWin)
+{
+ return TRUE;
+}
+
+Bool
+cfb8_16PositionWindow(
+ WindowPtr pWin,
+ int x, int y
+){
+ return TRUE;
+}
+
+
+void
+cfb8_16CopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ cfb8_16ScreenPtr pScreenPriv =
+ CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ DDXPointPtr ppt, pptSrc;
+ RegionRec rgnDst;
+ BoxPtr pbox;
+ int i, nbox, dx, dy;
+ WindowPtr pRoot = WindowTable[pScreen->myNum];
+
+ REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
+
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(nbox &&
+ (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
+
+ pbox = REGION_RECTS(&rgnDst);
+ for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+ cfbDoBitbltCopy((DrawablePtr)pRoot, (DrawablePtr)pRoot,
+ GXcopy, &rgnDst, pptSrc, ~0L);
+ if(pWin->drawable.bitsPerPixel == 16)
+ cfb16DoBitbltCopy((DrawablePtr)pScreenPriv->pix16,
+ (DrawablePtr)pScreenPriv->pix16,
+ GXcopy, &rgnDst, pptSrc, ~0L);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ REGION_UNINIT(pScreen, &rgnDst);
+
+ if(pWin->drawable.depth == 8) {
+ REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+ miSegregateChildren(pWin, &rgnDst, pScrn->depth);
+ if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
+ REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(nbox &&
+ (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))){
+
+ pbox = REGION_RECTS(&rgnDst);
+ for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ cfb16DoBitbltCopy((DrawablePtr)pScreenPriv->pix16,
+ (DrawablePtr)pScreenPriv->pix16,
+ GXcopy, &rgnDst, pptSrc, ~0L);
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+ }
+ REGION_UNINIT(pScreen, &rgnDst);
+ }
+}
+
+Bool
+cfb8_16ChangeWindowAttributes(
+ WindowPtr pWin,
+ unsigned long mask
+){
+ if (pWin->drawable.bitsPerPixel == 16)
+ return cfb16ChangeWindowAttributes(pWin,mask);
+ else
+ return cfbChangeWindowAttributes(pWin,mask);
+}
+
+void
+cfb8_16WindowExposures(
+ WindowPtr pWin,
+ RegionPtr pReg,
+ RegionPtr pOtherReg
+){
+
+ if(REGION_NUM_RECTS(pReg) && (pWin->drawable.bitsPerPixel == 16)) {
+ cfb8_16ScreenPtr pScreenPriv =
+ CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+
+ cfbFillBoxSolid((DrawablePtr)pScreenPriv->pix8,
+ REGION_NUM_RECTS(pReg), REGION_RECTS(pReg),
+ pScreenPriv->key);
+ }
+
+ miWindowExposures(pWin, pReg, pOtherReg);
+}
+
+
+void
+cfb8_16PaintWindow (
+ WindowPtr pWin,
+ RegionPtr pRegion,
+ int what
+){
+ if(pWin->drawable.bitsPerPixel == 16) {
+ cfb16PaintWindow(pWin, pRegion, what);
+ if(what == PW_BORDER) {
+ cfb8_16ScreenPtr pScreenPriv =
+ CFB8_16_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+
+ cfbFillBoxSolid((DrawablePtr)pScreenPriv->pix8,
+ REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
+ pScreenPriv->key);
+ }
+ } else
+ cfbPaintWindow(pWin, pRegion, what);
+
+}
+
diff --git a/hw/xfree86/xf8_32bpp/cfb8_32.h b/hw/xfree86/xf8_32bpp/cfb8_32.h
new file mode 100644
index 000000000..733051ae0
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfb8_32.h
@@ -0,0 +1,226 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfb8_32.h,v 1.5 2000/03/02 02:32:52 mvojkovi Exp $ */
+
+#ifndef _CFB8_32_H
+#define _CFB8_32_H
+
+#include "gcstruct.h"
+
+typedef struct {
+ GCOps *Ops8bpp;
+ GCOps *Ops32bpp;
+ unsigned long changes;
+ Bool OpsAre8bpp;
+} cfb8_32GCRec, *cfb8_32GCPtr;
+
+typedef struct {
+ unsigned char key;
+ void (*EnableDisableFBAccess)(int scrnIndex, Bool enable);
+ pointer visualData;
+} cfb8_32ScreenRec, *cfb8_32ScreenPtr;
+
+
+extern int cfb8_32GCPrivateIndex;
+extern int cfb8_32ScreenPrivateIndex;
+
+void
+cfb8_32SaveAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+
+void
+cfb8_32RestoreAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+
+RegionPtr
+cfb8_32CopyArea(
+ DrawablePtr pSrcDraw,
+ DrawablePtr pDstDraw,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+);
+
+void
+cfbDoBitblt8To32(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask,
+ unsigned long bitPlane
+);
+
+void
+cfbDoBitblt32To8(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask,
+ unsigned long bitPlane
+);
+
+
+void
+cfb8_32ValidateGC8(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+);
+
+void
+cfb8_32ValidateGC32(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+);
+
+void
+cfb32ValidateGC_Underlay(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+);
+
+Bool cfb8_32CreateGC(GCPtr pGC);
+
+void
+cfb8_32GetSpans(
+ DrawablePtr pDraw,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pchardstStart
+);
+
+void
+cfb8_32PutImage (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+);
+
+void
+cfb8_32GetImage (
+ DrawablePtr pDraw,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planeMask,
+ char *pdstLine
+);
+
+void
+cfb8_32PaintWindow (
+ WindowPtr pWin,
+ RegionPtr pRegion,
+ int what
+);
+
+Bool
+cfb8_32ScreenInit (
+ ScreenPtr pScreen,
+ pointer pbits,
+ int xsize, int ysize,
+ int dpix, int dpiy,
+ int width
+);
+
+void
+cfb8_32FillBoxSolid8 (
+ DrawablePtr pDraw,
+ int nbox,
+ BoxPtr pBox,
+ unsigned long color
+);
+
+
+void
+cfb8_32FillBoxSolid32 (
+ DrawablePtr pDraw,
+ int nbox,
+ BoxPtr pBox,
+ unsigned long color
+);
+
+RegionPtr
+cfb8_32CopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+);
+
+void
+cfbDoBitblt8To8GXcopy(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm,
+ unsigned long bitPlane
+);
+
+void
+cfbDoBitblt24To24GXcopy(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm,
+ unsigned long bitPlane
+);
+
+Bool cfb8_32CreateWindow(WindowPtr pWin);
+Bool cfb8_32DestroyWindow(WindowPtr pWin);
+
+Bool
+cfb8_32PositionWindow(
+ WindowPtr pWin,
+ int x, int y
+);
+
+void
+cfb8_32CopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+);
+
+Bool
+cfb8_32ChangeWindowAttributes(
+ WindowPtr pWin,
+ unsigned long mask
+);
+
+
+#define CFB8_32_GET_GC_PRIVATE(pGC)\
+ (cfb8_32GCPtr)((pGC)->devPrivates[cfb8_32GCPrivateIndex].ptr)
+
+#define CFB8_32_GET_SCREEN_PRIVATE(pScreen)\
+ (cfb8_32ScreenPtr)((pScreen)->devPrivates[cfb8_32ScreenPrivateIndex].ptr)
+
+Bool xf86Overlay8Plus32Init (ScreenPtr pScreen);
+
+#endif /* _CFB8_32_H */
diff --git a/hw/xfree86/xf8_32bpp/cfb8_32module.c b/hw/xfree86/xf8_32bpp/cfb8_32module.c
new file mode 100644
index 000000000..9ed6b2018
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfb8_32module.c
@@ -0,0 +1,38 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfb8_32module.c,v 1.6 1999/01/26 05:54:20 dawes Exp $ */
+
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(xf8_32bppSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "xf8_32bpp",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ MOD_CLASS_NONE,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData xf8_32bppModuleData = { &VersRec, xf8_32bppSetup, NULL };
+
+static pointer
+xf8_32bppSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ if (!LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ if (!LoadSubModule(module, "cfb32", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ return (pointer)1; /* non-NULL required to indicate success */
+}
+
+#endif
diff --git a/hw/xfree86/xf8_32bpp/cfbbstore.c b/hw/xfree86/xf8_32bpp/cfbbstore.c
new file mode 100644
index 000000000..919fabf5f
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbbstore.c
@@ -0,0 +1,102 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbbstore.c,v 1.2 1999/01/31 12:22:17 dawes Exp $ */
+
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "X.h"
+#include "mibstore.h"
+#include "regionstr.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+
+void
+cfb8_32SaveAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ DDXPointPtr pPt;
+ DDXPointPtr pPtsInit;
+ BoxPtr pBox;
+ int i;
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ PixmapPtr pScrPix;
+
+ if(pPixmap->drawable.bitsPerPixel == 32) {
+ cfb32SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
+ return;
+ }
+
+ i = REGION_NUM_RECTS(prgnSave);
+ pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i * sizeof(DDXPointRec));
+ if (!pPtsInit)
+ return;
+
+ pBox = REGION_RECTS(prgnSave);
+ pPt = pPtsInit;
+ while (--i >= 0) {
+ pPt->x = pBox->x1 + xorg;
+ pPt->y = pBox->y1 + yorg;
+ pPt++;
+ pBox++;
+ }
+
+ pScrPix = (PixmapPtr) pScreen->devPrivate;
+
+ cfbDoBitblt32To8((DrawablePtr) pScrPix, (DrawablePtr)pPixmap,
+ GXcopy, prgnSave, pPtsInit, ~0L, 0);
+
+ DEALLOCATE_LOCAL (pPtsInit);
+}
+
+
+void
+cfb8_32RestoreAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+){
+ DDXPointPtr pPt;
+ DDXPointPtr pPtsInit;
+ BoxPtr pBox;
+ int i;
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ PixmapPtr pScrPix;
+
+ i = REGION_NUM_RECTS(prgnRestore);
+ pPtsInit = (DDXPointPtr)ALLOCATE_LOCAL(i*sizeof(DDXPointRec));
+ if (!pPtsInit)
+ return;
+
+ pBox = REGION_RECTS(prgnRestore);
+ pPt = pPtsInit;
+ while (--i >= 0) {
+ pPt->x = pBox->x1 - xorg;
+ pPt->y = pBox->y1 - yorg;
+ pPt++;
+ pBox++;
+ }
+
+ pScrPix = (PixmapPtr) pScreen->devPrivate;
+
+ if(pPixmap->drawable.bitsPerPixel == 32) {
+ if(pWin->drawable.depth == 24)
+ cfb32DoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
+ GXcopy, prgnRestore, pPtsInit, 0x00ffffff);
+ else
+ cfb32DoBitbltCopy((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
+ GXcopy, prgnRestore, pPtsInit, ~0);
+ } else {
+ cfbDoBitblt8To32((DrawablePtr)pPixmap, (DrawablePtr) pScrPix,
+ GXcopy, prgnRestore, pPtsInit, ~0L, 0);
+ }
+
+ DEALLOCATE_LOCAL (pPtsInit);
+}
diff --git a/hw/xfree86/xf8_32bpp/cfbcpyarea.c b/hw/xfree86/xf8_32bpp/cfbcpyarea.c
new file mode 100644
index 000000000..752e56db8
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbcpyarea.c
@@ -0,0 +1,540 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbcpyarea.c,v 1.5 2000/02/29 00:17:16 mvojkovi Exp $ */
+
+#include "X.h"
+#include "Xmd.h"
+#include "servermd.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "resource.h"
+#include "colormap.h"
+#include "colormapst.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mi.h"
+#include "mistruct.h"
+#include "dix.h"
+#include "mibstore.h"
+
+
+RegionPtr
+cfb8_32CopyArea(
+ DrawablePtr pSrcDraw,
+ DrawablePtr pDstDraw,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+
+ if(pSrcDraw->bitsPerPixel == 32) {
+ if(pDstDraw->bitsPerPixel == 32) {
+ if((pGC->alu == GXcopy) && (pGC->planemask == 0xff000000)) {
+ return cfb32BitBlt (pSrcDraw, pDstDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ cfbDoBitblt8To8GXcopy, 0L);
+ }
+ return(cfb32CopyArea(pSrcDraw, pDstDraw, pGC, srcx, srcy,
+ width, height, dstx, dsty));
+ } else {
+ /* have to translate 32 -> 8 copies */
+ return cfb32BitBlt (pSrcDraw, pDstDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ cfbDoBitblt32To8, 0L);
+ }
+ } else {
+ if(pDstDraw->bitsPerPixel == 32) {
+ /* have to translate 8 -> 32 copies */
+ return cfb32BitBlt (pSrcDraw, pDstDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty,
+ cfbDoBitblt8To32, 0L);
+ } else {
+ return(cfbCopyArea(pSrcDraw, pDstDraw, pGC, srcx, srcy,
+ width, height, dstx, dsty));
+ }
+ }
+}
+
+
+
+
+void
+cfbDoBitblt8To32(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm,
+ unsigned long bitPlane
+){
+ BoxPtr pbox = REGION_RECTS(prgnDst);
+ int nbox = REGION_NUM_RECTS(prgnDst);
+ unsigned char *ptr8, *ptr32;
+ unsigned char *data8, *data32;
+ int pitch8, pitch32;
+ int height, width, i;
+
+ cfbGetByteWidthAndPointer(pSrc, pitch8, ptr8);
+ cfbGetByteWidthAndPointer(pDst, pitch32, ptr32);
+ ptr32 += 3; /* point to the top byte */
+
+ pm >>= 24;
+
+ if((pm == 0xff) && (rop == GXcopy)) {
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ data8 = ptr8 + (pptSrc->y * pitch8) + pptSrc->x;
+ data32 = ptr32 + (pbox->y1 * pitch32) + (pbox->x1 << 2);
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ for(i = 0; i < width; i++)
+ data32[i << 2] = data8[i];
+ data8 += pitch8;
+ data32 += pitch32;
+ }
+ }
+ } else { /* it ain't pretty, but hey */
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ data8 = ptr8 + (pptSrc->y * pitch8) + pptSrc->x;
+ data32 = ptr32 + (pbox->y1 * pitch32) + (pbox->x1 << 2);
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ switch(rop) {
+ case GXcopy:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = (data8[i] & pm) | (data32[i<<2] & ~pm);
+ break;
+ case GXor:
+ for(i = 0; i < width; i++)
+ data32[i<<2] |= data8[i] & pm;
+ break;
+ case GXclear:
+ for(i = 0; i < width; i++)
+ data32[i<<2] &= ~pm;
+ break;
+ case GXand:
+ for(i = 0; i < width; i++)
+ data32[i<<2] &= data8[i] | ~pm;
+ break;
+ case GXandReverse:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~data32[i<<2] & (data8[i] | ~pm);
+ break;
+ case GXandInverted:
+ for(i = 0; i < width; i++)
+ data32[i<<2] &= ~data8[i] | ~pm;
+ break;
+ case GXnoop:
+ return;
+ case GXxor:
+ for(i = 0; i < width; i++)
+ data32[i<<2] ^= data8[i] & pm;
+ break;
+ case GXnor:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~(data32[i<<2] | (data8[i] & pm));
+ break;
+ case GXequiv:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~(data32[i<<2] ^ (data8[i] & pm));
+ break;
+ case GXinvert:
+ for(i = 0; i < width; i++)
+ data32[i<<2] ^= pm;
+ break;
+ case GXorReverse:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~data32[i<<2] | (data8[i] & pm);
+ break;
+ case GXcopyInverted:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = (~data8[i] & pm) | (data32[i<<2] & ~pm);
+ break;
+ case GXorInverted:
+ for(i = 0; i < width; i++)
+ data32[i<<2] |= ~data8[i] & pm;
+ break;
+ case GXnand:
+ for(i = 0; i < width; i++)
+ data32[i<<2] = ~(data32[i<<2] & (data8[i] | ~pm));
+ break;
+ case GXset:
+ for(i = 0; i < width; i++)
+ data32[i<<2] |= pm;
+ break;
+ }
+ data8 += pitch8;
+ data32 += pitch32;
+ }
+ }
+ }
+}
+
+
+void
+cfbDoBitblt32To8(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm,
+ unsigned long bitPlane
+){
+ BoxPtr pbox = REGION_RECTS(prgnDst);
+ int nbox = REGION_NUM_RECTS(prgnDst);
+ unsigned char *ptr8, *ptr32;
+ unsigned char *data8, *data32;
+ int pitch8, pitch32;
+ int height, width, i;
+
+ cfbGetByteWidthAndPointer(pDst, pitch8, ptr8);
+ cfbGetByteWidthAndPointer(pSrc, pitch32, ptr32);
+ ptr32 += 3; /* point to the top byte */
+
+ if(((pm & 0xff) == 0xff) && (rop == GXcopy)) {
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ data8 = ptr8 + (pbox->y1 * pitch8) + pbox->x1;
+ data32 = ptr32 + (pptSrc->y * pitch32) + (pptSrc->x << 2);
+
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ for(i = 0; i < width; i++)
+ data8[i] = data32[i << 2];
+ data8 += pitch8;
+ data32 += pitch32;
+ }
+ }
+ } else {
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ data8 = ptr8 + (pbox->y1 * pitch8) + pbox->x1;
+ data32 = ptr32 + (pptSrc->y * pitch32) + (pptSrc->x << 2);
+
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ switch(rop) {
+ case GXcopy:
+ for(i = 0; i < width; i++)
+ data8[i] = (data32[i<<2] & pm) | (data8[i] & ~pm);
+ break;
+ case GXor:
+ for(i = 0; i < width; i++)
+ data8[i] |= data32[i<<2] & pm;
+ break;
+ case GXclear:
+ for(i = 0; i < width; i++)
+ data8[i] &= ~pm;
+ break;
+ case GXand:
+ for(i = 0; i < width; i++)
+ data8[i] &= data32[i<<2] | ~pm;
+ break;
+ case GXandReverse:
+ for(i = 0; i < width; i++)
+ data8[i] = ~data8[i] & (data32[i<<2] | ~pm);
+ break;
+ case GXandInverted:
+ for(i = 0; i < width; i++)
+ data8[i] &= ~data32[i<<2] | ~pm;
+ break;
+ case GXnoop:
+ return;
+ case GXxor:
+ for(i = 0; i < width; i++)
+ data8[i] ^= data32[i<<2] & pm;
+ break;
+ case GXnor:
+ for(i = 0; i < width; i++)
+ data8[i] = ~(data8[i] | (data32[i<<2] & pm));
+ break;
+ case GXequiv:
+ for(i = 0; i < width; i++)
+ data8[i] = ~(data8[i] ^ (data32[i<<2] & pm));
+ break;
+ case GXinvert:
+ for(i = 0; i < width; i++)
+ data8[i] ^= pm;
+ break;
+ case GXorReverse:
+ for(i = 0; i < width; i++)
+ data8[i] = ~data8[i] | (data32[i<<2] & pm);
+ break;
+ case GXcopyInverted:
+ for(i = 0; i < width; i++)
+ data8[i] = (~data32[i<<2] & pm) | (data8[i] & ~pm);
+ break;
+ case GXorInverted:
+ for(i = 0; i < width; i++)
+ data8[i] |= ~data32[i<<2] & pm;
+ break;
+ case GXnand:
+ for(i = 0; i < width; i++)
+ data8[i] = ~(data8[i] & (data32[i<<2] | ~pm));
+ break;
+ case GXset:
+ for(i = 0; i < width; i++)
+ data8[i] |= pm;
+ break;
+ }
+ data8 += pitch8;
+ data32 += pitch32;
+ }
+ }
+ }
+}
+
+
+
+static void
+Do8To8Blt(
+ unsigned char *SrcPtr,
+ int SrcPitch,
+ unsigned char *DstPtr,
+ int DstPitch,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir, int ydir
+){
+ int i, j, width, height, ydir2;
+ CARD8 *src, *dst;
+
+ SrcPtr += 3;
+ DstPtr += 3;
+ xdir *= 4;
+ ydir2 = ydir * DstPitch;
+ ydir *= SrcPitch;
+
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ src = SrcPtr + (pptSrc->y * SrcPitch) + (pptSrc->x << 2);
+ dst = DstPtr + (pbox->y1 * DstPitch) + (pbox->x1 << 2);
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ if(ydir < 0) {
+ src += (height - 1) * SrcPitch;
+ dst += (height - 1) * DstPitch;
+ }
+
+ if(xdir < 0) {
+ register int tmp = (width - 1) << 2;
+ src += tmp;
+ dst += tmp;
+ }
+
+ while(height--) {
+ for(i = width, j = 0; i--; j+=xdir)
+ dst[j] = src[j];
+ src += ydir;
+ dst += ydir2;
+ }
+ }
+}
+
+static void
+Do24To24Blt(
+ unsigned char *SrcPtr,
+ int SrcPitch,
+ unsigned char *DstPtr,
+ int DstPitch,
+ int nbox,
+ DDXPointPtr pptSrc,
+ BoxPtr pbox,
+ int xdir, int ydir
+){
+ int i, j, width, height, ydir2;
+ CARD8 *src, *dst;
+
+ xdir *= 4;
+ ydir2 = ydir * DstPitch;
+ ydir *= SrcPitch;
+
+ for(;nbox; pbox++, pptSrc++, nbox--) {
+ src = SrcPtr + (pptSrc->y * SrcPitch) + (pptSrc->x << 2);
+ dst = DstPtr + (pbox->y1 * DstPitch) + (pbox->x1 << 2);
+ width = pbox->x2 - pbox->x1;
+ height = pbox->y2 - pbox->y1;
+
+ if(ydir < 0) {
+ src += (height - 1) * SrcPitch;
+ dst += (height - 1) * DstPitch;
+ }
+
+ if(xdir < 0) {
+ register int tmp = (width - 1) << 2;
+ src += tmp;
+ dst += tmp;
+ }
+
+ while(height--) {
+ for(i = width, j = 0; i--; j+=xdir) {
+ *((CARD16*)(dst + j)) = *((CARD32*)(src + j));
+ dst[j + 2] = src[j + 2];
+ }
+ src += ydir;
+ dst += ydir2;
+ }
+ }
+}
+
+
+static void
+cfb8_32DoBitBlt(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ void (*DoBlt)()
+){
+ int nbox, careful, SrcPitch, DstPitch;
+ BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
+ DDXPointPtr pptTmp, pptNew1, pptNew2;
+ int xdir, ydir;
+ unsigned char *SrcPtr, *DstPtr;
+
+ /* XXX we have to err on the side of safety when both are windows,
+ * because we don't know if IncludeInferiors is being used.
+ */
+ careful = ((pSrc == pDst) ||
+ ((pSrc->type == DRAWABLE_WINDOW) &&
+ (pDst->type == DRAWABLE_WINDOW)));
+
+ pbox = REGION_RECTS(prgnDst);
+ nbox = REGION_NUM_RECTS(prgnDst);
+
+ pboxNew1 = NULL;
+ pptNew1 = NULL;
+ pboxNew2 = NULL;
+ pptNew2 = NULL;
+ if (careful && (pptSrc->y < pbox->y1)) {
+ /* walk source botttom to top */
+ ydir = -1;
+
+ if (nbox > 1) {
+ /* keep ordering in each band, reverse order of bands */
+ pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ if(!pboxNew1)
+ return;
+ pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if(!pptNew1) {
+ DEALLOCATE_LOCAL(pboxNew1);
+ return;
+ }
+ pboxBase = pboxNext = pbox+nbox-1;
+ while (pboxBase >= pbox) {
+ while ((pboxNext >= pbox) &&
+ (pboxBase->y1 == pboxNext->y1))
+ pboxNext--;
+ pboxTmp = pboxNext+1;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp <= pboxBase) {
+ *pboxNew1++ = *pboxTmp++;
+ *pptNew1++ = *pptTmp++;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew1 -= nbox;
+ pbox = pboxNew1;
+ pptNew1 -= nbox;
+ pptSrc = pptNew1;
+ }
+ } else {
+ /* walk source top to bottom */
+ ydir = 1;
+ }
+
+ if (careful && (pptSrc->x < pbox->x1)) {
+ /* walk source right to left */
+ xdir = -1;
+
+ if (nbox > 1) {
+ /* reverse order of rects in each band */
+ pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
+ pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
+ if(!pboxNew2 || !pptNew2) {
+ if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
+ if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
+ if (pboxNew1) {
+ DEALLOCATE_LOCAL(pptNew1);
+ DEALLOCATE_LOCAL(pboxNew1);
+ }
+ return;
+ }
+ pboxBase = pboxNext = pbox;
+ while (pboxBase < pbox+nbox) {
+ while ((pboxNext < pbox+nbox) &&
+ (pboxNext->y1 == pboxBase->y1))
+ pboxNext++;
+ pboxTmp = pboxNext;
+ pptTmp = pptSrc + (pboxTmp - pbox);
+ while (pboxTmp != pboxBase) {
+ *pboxNew2++ = *--pboxTmp;
+ *pptNew2++ = *--pptTmp;
+ }
+ pboxBase = pboxNext;
+ }
+ pboxNew2 -= nbox;
+ pbox = pboxNew2;
+ pptNew2 -= nbox;
+ pptSrc = pptNew2;
+ }
+ } else {
+ /* walk source left to right */
+ xdir = 1;
+ }
+
+ cfbGetByteWidthAndPointer(pSrc, SrcPitch, SrcPtr);
+ cfbGetByteWidthAndPointer(pDst, DstPitch, DstPtr);
+
+ (*DoBlt)(SrcPtr,SrcPitch,DstPtr,DstPitch,nbox,pptSrc,pbox,xdir,ydir);
+
+ if (pboxNew2) {
+ DEALLOCATE_LOCAL(pptNew2);
+ DEALLOCATE_LOCAL(pboxNew2);
+ }
+ if (pboxNew1) {
+ DEALLOCATE_LOCAL(pptNew1);
+ DEALLOCATE_LOCAL(pboxNew1);
+ }
+
+}
+
+
+/* A couple routines to speed up full planemask copies */
+
+void
+cfbDoBitblt8To8GXcopy(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm,
+ unsigned long bitPlane
+){
+ cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do8To8Blt);
+}
+
+
+void
+cfbDoBitblt24To24GXcopy(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long pm,
+ unsigned long bitPlane
+){
+ cfb8_32DoBitBlt(pSrc, pDst, prgnDst, pptSrc, Do24To24Blt);
+}
diff --git a/hw/xfree86/xf8_32bpp/cfbcpyplane.c b/hw/xfree86/xf8_32bpp/cfbcpyplane.c
new file mode 100644
index 000000000..248ca0869
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbcpyplane.c
@@ -0,0 +1,39 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbcpyplane.c,v 1.1 1999/01/03 03:58:55 dawes Exp $ */
+
+#include "X.h"
+#include "Xmd.h"
+#include "Xproto.h"
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "regionstr.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mi.h"
+
+
+RegionPtr
+cfb8_32CopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ /* There's actually much more to it than this */
+
+ if((pDst->bitsPerPixel == 8) && (pSrc->bitsPerPixel != 32)){
+ return(cfbCopyPlane(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane));
+ }
+
+
+ return(miCopyPlane (pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane));
+}
diff --git a/hw/xfree86/xf8_32bpp/cfbgc.c b/hw/xfree86/xf8_32bpp/cfbgc.c
new file mode 100644
index 000000000..6c13ca721
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbgc.c
@@ -0,0 +1,663 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgc.c,v 1.4 2001/12/14 19:59:52 dawes Exp $ */
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+
+
+/*
+
+PSZ 8 16 24 32
+PIXEL_ADDR True True True True
+NO_ONE_RECT False False False False
+WriteBitGroup True True True True
+FOUR_BIT_CODE True False False False
+LOWMEMFTPT False False False False
+
+*/
+
+
+/* This gets built twice. Once for 8bpp and another for 32bpp */
+
+#include "X.h"
+#include "Xmd.h"
+#include "Xproto.h"
+#include "cfb.h"
+#include "fontstruct.h"
+#include "dixfontstr.h"
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "region.h"
+
+#include "mistruct.h"
+#include "mibstore.h"
+#include "migc.h"
+#include "mioverlay.h"
+
+#include "cfb8_32.h"
+#include "cfbmskbits.h"
+#include "cfb8bit.h"
+
+
+#if PSZ == 8
+# define useTEGlyphBlt cfbTEGlyphBlt8
+#else
+# ifdef WriteBitGroup
+# define useTEGlyphBlt cfbImageGlyphBlt8
+# else
+# define useTEGlyphBlt cfbTEGlyphBlt
+# endif
+#endif
+
+#ifdef WriteBitGroup
+# define useImageGlyphBlt cfbImageGlyphBlt8
+# define usePolyGlyphBlt cfbPolyGlyphBlt8
+#else
+# define useImageGlyphBlt miImageGlyphBlt
+# define usePolyGlyphBlt miPolyGlyphBlt
+#endif
+
+#ifdef FOUR_BIT_CODE
+# define usePushPixels cfbPushPixels8
+#else
+#ifndef LOWMEMFTPT
+# define usePushPixels mfbPushPixels
+#else
+# define usePushPixels miPushPixels
+#endif /* ifndef LOWMEMFTPT */
+#endif
+
+#ifdef PIXEL_ADDR
+# define ZeroPolyArc cfbZeroPolyArcSS8Copy
+#else
+# define ZeroPolyArc miZeroPolyArc
+#endif
+
+
+static GCOps cfb8_32TEOps1Rect = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfb8_32PutImage,
+ cfb8_32CopyArea,
+ cfb8_32CopyPlane,
+ cfbPolyPoint,
+#ifdef PIXEL_ADDR
+ cfb8LineSS1Rect,
+ cfb8SegmentSS1Rect,
+#else
+ cfbLineSS,
+ cfbSegmentSS,
+#endif
+ miPolyRectangle,
+ ZeroPolyArc,
+ cfbFillPoly1RectCopy,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useTEGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+static GCOps cfb8_32NonTEOps1Rect = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfb8_32PutImage,
+ cfb8_32CopyArea,
+ cfb8_32CopyPlane,
+ cfbPolyPoint,
+#ifdef PIXEL_ADDR
+ cfb8LineSS1Rect,
+ cfb8SegmentSS1Rect,
+#else
+ cfbLineSS,
+ cfbSegmentSS,
+#endif
+ miPolyRectangle,
+ ZeroPolyArc,
+ cfbFillPoly1RectCopy,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useImageGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+static GCOps cfb8_32TEOps = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfb8_32PutImage,
+ cfb8_32CopyArea,
+ cfb8_32CopyPlane,
+ cfbPolyPoint,
+ cfbLineSS,
+ cfbSegmentSS,
+ miPolyRectangle,
+ ZeroPolyArc,
+ miFillPolygon,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useTEGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+static GCOps cfb8_32NonTEOps = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfb8_32PutImage,
+ cfb8_32CopyArea,
+ cfb8_32CopyPlane,
+ cfbPolyPoint,
+ cfbLineSS,
+ cfbSegmentSS,
+ miPolyRectangle,
+#ifdef PIXEL_ADDR
+ cfbZeroPolyArcSS8Copy,
+#else
+ miZeroPolyArc,
+#endif
+ miFillPolygon,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useImageGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+static GCOps *
+cfb8_32MatchCommon (GCPtr pGC, cfbPrivGCPtr devPriv)
+{
+ if (pGC->lineWidth != 0)
+ return 0;
+ if (pGC->lineStyle != LineSolid)
+ return 0;
+ if (pGC->fillStyle != FillSolid)
+ return 0;
+ if (devPriv->rop != GXcopy)
+ return 0;
+ if (pGC->font &&
+ FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
+ FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
+ {
+ if (TERMINALFONT(pGC->font)
+#ifdef FOUR_BIT_CODE
+ && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
+#endif
+ )
+#ifdef NO_ONE_RECT
+ return &cfb8_32TEOps1Rect;
+#else
+ if (devPriv->oneRect)
+ return &cfb8_32TEOps1Rect;
+ else
+ return &cfb8_32TEOps;
+#endif
+ else
+#ifdef NO_ONE_RECT
+ return &cfb8_32NonTEOps1Rect;
+#else
+ if (devPriv->oneRect)
+ return &cfb8_32NonTEOps1Rect;
+ else
+ return &cfb8_32NonTEOps;
+#endif
+ }
+ return 0;
+}
+
+
+/* Clipping conventions
+ if the drawable is a window
+ CT_REGION ==> pCompositeClip really is the composite
+ CT_other ==> pCompositeClip is the window clip region
+ if the drawable is a pixmap
+ CT_REGION ==> pCompositeClip is the translated client region
+ clipped to the pixmap boundary
+ CT_other ==> pCompositeClip is the pixmap bounding box
+*/
+
+void
+#if PSZ == 8
+cfb8_32ValidateGC8(
+#else
+cfb8_32ValidateGC32(
+#endif
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+){
+ int mask; /* stateChanges */
+ int index; /* used for stepping through bitfields */
+ int new_rrop;
+ int new_line, new_text, new_fillspans, new_fillarea;
+ /* flags for changing the proc vector */
+ cfbPrivGCPtr devPriv;
+ int oneRect;
+
+ pGC->lastWinOrg.x = pDrawable->x;
+ pGC->lastWinOrg.y = pDrawable->y;
+ devPriv = cfbGetGCPrivate(pGC);
+
+ new_rrop = FALSE;
+ new_line = FALSE;
+ new_text = FALSE;
+ new_fillspans = FALSE;
+ new_fillarea = FALSE;
+
+ /*
+ * if the client clip is different or moved OR the subwindowMode has
+ * changed OR the window's clip has changed since the last validation
+ * we need to recompute the composite clip
+ */
+
+ if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
+ (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS)))
+ {
+ miComputeCompositeClip (pGC, pDrawable);
+#ifdef NO_ONE_RECT
+ devPriv->oneRect = FALSE;
+#else
+ oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
+ if (oneRect != devPriv->oneRect)
+ new_line = TRUE;
+ devPriv->oneRect = oneRect;
+#endif
+ }
+
+ mask = changes;
+ while (mask) {
+ index = lowbit (mask);
+ mask &= ~index;
+
+ switch (index) {
+ case GCFunction:
+ case GCForeground:
+ new_rrop = TRUE;
+ break;
+ case GCPlaneMask:
+ new_rrop = TRUE;
+ new_text = TRUE;
+ break;
+ case GCBackground:
+ break;
+ case GCLineStyle:
+ case GCLineWidth:
+ new_line = TRUE;
+ break;
+ case GCJoinStyle:
+ case GCCapStyle:
+ break;
+ case GCFillStyle:
+ new_text = TRUE;
+ new_fillspans = TRUE;
+ new_line = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCFillRule:
+ break;
+ case GCTile:
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCStipple:
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCTileStipXOrigin:
+ case GCTileStipYOrigin:
+ break;
+ case GCFont:
+ new_text = TRUE;
+ break;
+ case GCSubwindowMode:
+ case GCGraphicsExposures:
+ case GCClipXOrigin:
+ case GCClipYOrigin:
+ case GCClipMask:
+ case GCDashOffset:
+ case GCDashList:
+ case GCArcMode:
+ default:
+ break;
+ }
+ }
+
+ /*
+ * If the drawable has changed, ensure suitable
+ * entries are in the proc vector.
+ */
+ if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS)))
+ new_fillspans = TRUE; /* deal with FillSpans later */
+
+ if (new_rrop)
+ {
+ int old_rrop;
+
+ old_rrop = devPriv->rop;
+ devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel,
+ pGC->planemask,
+ &devPriv->and, &devPriv->xor);
+ if (old_rrop == devPriv->rop)
+ new_rrop = FALSE;
+ else
+ {
+#ifdef PIXEL_ADDR
+ new_line = TRUE;
+#endif
+#ifdef WriteBitGroup
+ new_text = TRUE;
+#endif
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ }
+ }
+
+ if(!pGC->ops)
+ pGC->ops = & cfb8_32NonTEOps;
+
+ if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
+ {
+ GCOps *newops;
+
+ if ((newops = cfb8_32MatchCommon (pGC, devPriv)))
+ {
+ if (pGC->ops->devPrivate.val)
+ miDestroyGCOps (pGC->ops);
+ pGC->ops = newops;
+ new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
+ }
+ else
+ {
+ if (!pGC->ops->devPrivate.val)
+ {
+ pGC->ops = miCreateGCOps (pGC->ops);
+ pGC->ops->devPrivate.val = 1;
+ }
+ }
+ }
+
+ /* deal with the changes we've collected */
+ if (new_line)
+ {
+ pGC->ops->FillPolygon = miFillPolygon;
+#ifdef NO_ONE_RECT
+ if (pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
+ break;
+ default:
+ pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
+ break;
+ }
+ }
+#else
+ if (devPriv->oneRect && pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
+ break;
+ default:
+ pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
+ break;
+ }
+ }
+#endif
+ if (pGC->lineWidth == 0)
+ {
+#ifdef PIXEL_ADDR
+ if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
+ {
+ switch (devPriv->rop)
+ {
+ case GXxor:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor;
+ break;
+ case GXcopy:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy;
+ break;
+ default:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8General;
+ break;
+ }
+ }
+ else
+#endif
+ pGC->ops->PolyArc = miZeroPolyArc;
+ }
+ else
+ pGC->ops->PolyArc = miPolyArc;
+ pGC->ops->PolySegment = miPolySegment;
+ switch (pGC->lineStyle)
+ {
+ case LineSolid:
+ if(pGC->lineWidth == 0)
+ {
+ if (pGC->fillStyle == FillSolid)
+ {
+#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
+ if (devPriv->oneRect &&
+ ((pDrawable->x >= pGC->pScreen->width - 32768) &&
+ (pDrawable->y >= pGC->pScreen->height - 32768)))
+ {
+ pGC->ops->Polylines = cfb8LineSS1Rect;
+ pGC->ops->PolySegment = cfb8SegmentSS1Rect;
+ } else
+#endif
+#ifdef NO_ONE_RECT
+ {
+ pGC->ops->Polylines = cfb8LineSS1Rect;
+ pGC->ops->PolySegment = cfb8SegmentSS1Rect;
+ }
+#else
+ {
+ pGC->ops->Polylines = cfbLineSS;
+ pGC->ops->PolySegment = cfbSegmentSS;
+ }
+#endif
+ }
+ else
+ pGC->ops->Polylines = miZeroLine;
+ }
+ else
+ pGC->ops->Polylines = miWideLine;
+ break;
+ case LineOnOffDash:
+ case LineDoubleDash:
+ if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
+ {
+ pGC->ops->Polylines = cfbLineSD;
+ pGC->ops->PolySegment = cfbSegmentSD;
+ } else
+ pGC->ops->Polylines = miWideDash;
+ break;
+ }
+ }
+
+ if (new_text && (pGC->font))
+ {
+ if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
+ FONTMINBOUNDS(pGC->font,characterWidth) < 0)
+ {
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+ pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
+ }
+ else
+ {
+#ifdef WriteBitGroup
+ if (pGC->fillStyle == FillSolid)
+ {
+ if (devPriv->rop == GXcopy)
+ pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8;
+ else
+#ifdef FOUR_BIT_CODE
+ pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8;
+#else
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+#endif
+ }
+ else
+#endif
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+ /* special case ImageGlyphBlt for terminal emulator fonts */
+#if !defined(WriteBitGroup) || PSZ == 8
+ if (TERMINALFONT(pGC->font) &&
+ (pGC->planemask & PMSK) == PMSK
+#ifdef FOUR_BIT_CODE
+ && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
+#endif
+ )
+ {
+ pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
+ }
+ else
+#endif
+ {
+#ifdef WriteBitGroup
+ if (devPriv->rop == GXcopy &&
+ pGC->fillStyle == FillSolid &&
+ (pGC->planemask & PMSK) == PMSK)
+ pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8;
+ else
+#endif
+ pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
+ }
+ }
+ }
+
+
+ if (new_fillspans) {
+ switch (pGC->fillStyle) {
+ case FillSolid:
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillSpans = cfbSolidSpansCopy;
+ break;
+ case GXxor:
+ pGC->ops->FillSpans = cfbSolidSpansXor;
+ break;
+ default:
+ pGC->ops->FillSpans = cfbSolidSpansGeneral;
+ break;
+ }
+ break;
+ case FillTiled:
+ pGC->ops->FillSpans = cfbUnnaturalTileFS;
+ break;
+ case FillStippled:
+ case FillOpaqueStippled:
+ pGC->ops->FillSpans = cfbUnnaturalStippleFS;
+ break;
+ default:
+ FatalError("cfbValidateGC: illegal fillStyle\n");
+ }
+ } /* end of new_fillspans */
+
+ if (new_fillarea) {
+#ifndef FOUR_BIT_CODE
+ pGC->ops->PolyFillRect = miPolyFillRect;
+ if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
+ {
+ pGC->ops->PolyFillRect = cfbPolyFillRect;
+ }
+#endif
+#ifdef FOUR_BIT_CODE
+#ifndef LOWMEMFTPT
+ pGC->ops->PushPixels = mfbPushPixels;
+#else
+ pGC->ops->PushPixels = miPushPixels;
+#endif /* ifndef LOWMEMFTPT */
+ if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
+ pGC->ops->PushPixels = cfbPushPixels8;
+#endif
+ pGC->ops->PolyFillArc = miPolyFillArc;
+ if (pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop)
+ {
+ case GXcopy:
+ pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
+ break;
+ default:
+ pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral;
+ break;
+ }
+ }
+ }
+}
diff --git a/hw/xfree86/xf8_32bpp/cfbgcmisc.c b/hw/xfree86/xf8_32bpp/cfbgcmisc.c
new file mode 100644
index 000000000..d8a6f4608
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbgcmisc.c
@@ -0,0 +1,146 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcmisc.c,v 1.3 2000/02/29 00:17:16 mvojkovi Exp $ */
+
+#include "X.h"
+#include "Xmd.h"
+#include "Xproto.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "fontstruct.h"
+#include "dixfontstr.h"
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "region.h"
+
+#include "mistruct.h"
+#include "mibstore.h"
+#include "migc.h"
+
+
+static void cfb8_32ValidateGC(GCPtr, unsigned long, DrawablePtr);
+static void cfb8_32DestroyGC(GCPtr pGC);
+static void cfb32DestroyGC_Underlay(GCPtr pGC);
+
+static
+GCFuncs cfb8_32GCFuncs = {
+ cfb8_32ValidateGC,
+ miChangeGC,
+ miCopyGC,
+ cfb8_32DestroyGC,
+ miChangeClip,
+ miDestroyClip,
+ miCopyClip,
+};
+
+
+static
+GCFuncs cfb32GCFuncs_Underlay = {
+ cfb32ValidateGC_Underlay,
+ miChangeGC,
+ miCopyGC,
+ cfb32DestroyGC_Underlay,
+ miChangeClip,
+ miDestroyClip,
+ miCopyClip,
+};
+
+static void
+cfb32DestroyGC_Underlay(GCPtr pGC)
+{
+ if (pGC->freeCompClip)
+ REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
+
+ if(pGC->ops)
+ miDestroyGCOps(pGC->ops);
+}
+
+
+static void
+cfb8_32DestroyGC(GCPtr pGC)
+{
+ cfb8_32GCPtr pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
+
+ if (pGC->freeCompClip)
+ REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip);
+ if(pGCPriv->Ops8bpp)
+ miDestroyGCOps(pGCPriv->Ops8bpp);
+ if(pGCPriv->Ops32bpp)
+ miDestroyGCOps(pGCPriv->Ops32bpp);
+}
+
+Bool
+cfb8_32CreateGC(GCPtr pGC)
+{
+ cfb8_32GCPtr pGCPriv;
+ cfbPrivGC *pPriv;
+
+ if (PixmapWidthPaddingInfo[pGC->depth].padPixelsLog2 == LOG2_BITMAP_PAD)
+ return (mfbCreateGC(pGC));
+
+ pGC->clientClip = NULL;
+ pGC->clientClipType = CT_NONE;
+ pGC->miTranslate = 1;
+ pGC->fExpose = TRUE;
+ pGC->freeCompClip = FALSE;
+ pGC->pRotatedPixmap = (PixmapPtr) NULL;
+
+ pPriv = cfbGetGCPrivate(pGC);
+ pPriv->rop = pGC->alu;
+ pPriv->oneRect = FALSE;
+
+ pGC->ops = NULL;
+
+ if (pGC->depth == 8) {
+ pGC->funcs = &cfb8_32GCFuncs;
+
+ pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
+ pGCPriv->Ops8bpp = NULL;
+ pGCPriv->Ops32bpp = NULL;
+ pGCPriv->OpsAre8bpp = FALSE;
+ pGCPriv->changes = 0;
+ } else
+ pGC->funcs = &cfb32GCFuncs_Underlay;
+
+ return TRUE;
+}
+
+
+static void
+cfb8_32ValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+){
+ cfb8_32GCPtr pGCPriv = CFB8_32_GET_GC_PRIVATE(pGC);
+
+ if(pDraw->bitsPerPixel == 32) {
+ if(pGCPriv->OpsAre8bpp) {
+ int origChanges = changes;
+ pGC->ops = pGCPriv->Ops32bpp;
+ changes |= pGCPriv->changes;
+ pGCPriv->changes = origChanges;
+ pGCPriv->OpsAre8bpp = FALSE;
+ } else
+ pGCPriv->changes |= changes;
+
+ cfb8_32ValidateGC32(pGC, changes, pDraw);
+ pGCPriv->Ops32bpp = pGC->ops;
+ } else { /* bitsPerPixel == 8 */
+ if(!pGCPriv->OpsAre8bpp) {
+ int origChanges = changes;
+ pGC->ops = pGCPriv->Ops8bpp;
+ changes |= pGCPriv->changes;
+ pGCPriv->changes = origChanges;
+ pGCPriv->OpsAre8bpp = TRUE;
+ } else
+ pGCPriv->changes |= changes;
+
+ cfb8_32ValidateGC8(pGC, changes, pDraw);
+ pGCPriv->Ops8bpp = pGC->ops;
+ }
+}
+
diff --git a/hw/xfree86/xf8_32bpp/cfbgcunder.c b/hw/xfree86/xf8_32bpp/cfbgcunder.c
new file mode 100644
index 000000000..d263b8b9e
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbgcunder.c
@@ -0,0 +1,636 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbgcunder.c,v 1.5 2001/12/14 19:59:52 dawes Exp $ */
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ 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 and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+#define PSZ 32
+
+#include "X.h"
+#include "Xmd.h"
+#include "Xproto.h"
+#include "cfb.h"
+#include "fontstruct.h"
+#include "dixfontstr.h"
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "region.h"
+
+#include "mistruct.h"
+#include "mibstore.h"
+#include "migc.h"
+#include "mioverlay.h"
+
+#include "cfbmskbits.h"
+#include "cfb8bit.h"
+
+#ifdef WriteBitGroup
+# define useTEGlyphBlt cfbImageGlyphBlt8
+#else
+# define useTEGlyphBlt cfbTEGlyphBlt
+#endif
+
+#ifdef WriteBitGroup
+# define useImageGlyphBlt cfbImageGlyphBlt8
+# define usePolyGlyphBlt cfbPolyGlyphBlt8
+#else
+# define useImageGlyphBlt miImageGlyphBlt
+# define usePolyGlyphBlt miPolyGlyphBlt
+#endif
+
+#ifdef FOUR_BIT_CODE
+# define usePushPixels cfbPushPixels8
+#else
+#ifndef LOWMEMFTPT
+# define usePushPixels mfbPushPixels
+#else
+# define usePushPixels miPushPixels
+#endif /* ifndef LOWMEMFTPT */
+#endif
+
+#ifdef PIXEL_ADDR
+# define ZeroPolyArc cfbZeroPolyArcSS8Copy
+#else
+# define ZeroPolyArc miZeroPolyArc
+#endif
+
+
+static GCOps cfbTEOps1Rect = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfbPutImage,
+ cfbCopyArea,
+ cfbCopyPlane,
+ cfbPolyPoint,
+#ifdef PIXEL_ADDR
+ cfb8LineSS1Rect,
+ cfb8SegmentSS1Rect,
+#else
+ cfbLineSS,
+ cfbSegmentSS,
+#endif
+ miPolyRectangle,
+ ZeroPolyArc,
+ cfbFillPoly1RectCopy,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useTEGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+static GCOps cfbNonTEOps1Rect = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfbPutImage,
+ cfbCopyArea,
+ cfbCopyPlane,
+ cfbPolyPoint,
+#ifdef PIXEL_ADDR
+ cfb8LineSS1Rect,
+ cfb8SegmentSS1Rect,
+#else
+ cfbLineSS,
+ cfbSegmentSS,
+#endif
+ miPolyRectangle,
+ ZeroPolyArc,
+ cfbFillPoly1RectCopy,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useImageGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+static GCOps cfbTEOps = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfbPutImage,
+ cfbCopyArea,
+ cfbCopyPlane,
+ cfbPolyPoint,
+ cfbLineSS,
+ cfbSegmentSS,
+ miPolyRectangle,
+ ZeroPolyArc,
+ miFillPolygon,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useTEGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+static GCOps cfbNonTEOps = {
+ cfbSolidSpansCopy,
+ cfbSetSpans,
+ cfbPutImage,
+ cfbCopyArea,
+ cfbCopyPlane,
+ cfbPolyPoint,
+ cfbLineSS,
+ cfbSegmentSS,
+ miPolyRectangle,
+#ifdef PIXEL_ADDR
+ cfbZeroPolyArcSS8Copy,
+#else
+ miZeroPolyArc,
+#endif
+ miFillPolygon,
+ cfbPolyFillRect,
+ cfbPolyFillArcSolidCopy,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ useImageGlyphBlt,
+ usePolyGlyphBlt,
+ usePushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+static GCOps *
+cfb32MatchCommon_Underlay (pGC, devPriv)
+ GCPtr pGC;
+ cfbPrivGCPtr devPriv;
+{
+ if (pGC->lineWidth != 0)
+ return 0;
+ if (pGC->lineStyle != LineSolid)
+ return 0;
+ if (pGC->fillStyle != FillSolid)
+ return 0;
+ if (devPriv->rop != GXcopy)
+ return 0;
+ if (pGC->font &&
+ FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) <= 32 &&
+ FONTMINBOUNDS(pGC->font,characterWidth) >= 0)
+ {
+ if (TERMINALFONT(pGC->font)
+#ifdef FOUR_BIT_CODE
+ && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
+#endif
+ )
+#ifdef NO_ONE_RECT
+ return &cfbTEOps1Rect;
+#else
+ if (devPriv->oneRect)
+ return &cfbTEOps1Rect;
+ else
+ return &cfbTEOps;
+#endif
+ else
+#ifdef NO_ONE_RECT
+ return &cfbNonTEOps1Rect;
+#else
+ if (devPriv->oneRect)
+ return &cfbNonTEOps1Rect;
+ else
+ return &cfbNonTEOps;
+#endif
+ }
+ return 0;
+}
+
+
+void
+cfb32ValidateGC_Underlay(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable
+){
+ int mask; /* stateChanges */
+ int index; /* used for stepping through bitfields */
+ int new_rrop;
+ int new_line, new_text, new_fillspans, new_fillarea;
+ /* flags for changing the proc vector */
+ cfbPrivGCPtr devPriv;
+ int oneRect;
+
+ pGC->lastWinOrg.x = pDrawable->x;
+ pGC->lastWinOrg.y = pDrawable->y;
+ devPriv = cfbGetGCPrivate(pGC);
+
+ new_rrop = FALSE;
+ new_line = FALSE;
+ new_text = FALSE;
+ new_fillspans = FALSE;
+ new_fillarea = FALSE;
+
+ /*
+ * if the client clip is different or moved OR the subwindowMode has
+ * changed OR the window's clip has changed since the last validation
+ * we need to recompute the composite clip
+ */
+
+ if ((changes & (GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)) ||
+ (pDrawable->serialNumber != (pGC->serialNumber & DRAWABLE_SERIAL_BITS))
+ )
+ {
+ if(pDrawable->type == DRAWABLE_WINDOW)
+ miOverlayComputeCompositeClip (pGC, (WindowPtr)pDrawable);
+ else
+ miComputeCompositeClip (pGC, pDrawable);
+#ifdef NO_ONE_RECT
+ devPriv->oneRect = FALSE;
+#else
+ oneRect = REGION_NUM_RECTS(pGC->pCompositeClip) == 1;
+ if (oneRect != devPriv->oneRect)
+ new_line = TRUE;
+ devPriv->oneRect = oneRect;
+#endif
+ }
+
+ mask = changes;
+ while (mask) {
+ index = lowbit (mask);
+ mask &= ~index;
+
+ switch (index) {
+ case GCFunction:
+ case GCForeground:
+ new_rrop = TRUE;
+ break;
+ case GCPlaneMask:
+ new_rrop = TRUE;
+ new_text = TRUE;
+ break;
+ case GCBackground:
+ break;
+ case GCLineStyle:
+ case GCLineWidth:
+ new_line = TRUE;
+ break;
+ case GCJoinStyle:
+ case GCCapStyle:
+ break;
+ case GCFillStyle:
+ new_text = TRUE;
+ new_fillspans = TRUE;
+ new_line = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCFillRule:
+ break;
+ case GCTile:
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCStipple:
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ break;
+ case GCTileStipXOrigin:
+ case GCTileStipYOrigin:
+ break;
+ case GCFont:
+ new_text = TRUE;
+ break;
+ case GCSubwindowMode:
+ case GCGraphicsExposures:
+ case GCClipXOrigin:
+ case GCClipYOrigin:
+ case GCClipMask:
+ case GCDashOffset:
+ case GCDashList:
+ case GCArcMode:
+ default:
+ break;
+ }
+ }
+
+ /*
+ * If the drawable has changed, ensure suitable
+ * entries are in the proc vector.
+ */
+ if (pDrawable->serialNumber != (pGC->serialNumber & (DRAWABLE_SERIAL_BITS)))
+ new_fillspans = TRUE; /* deal with FillSpans later */
+
+ if (new_rrop)
+ {
+ int old_rrop;
+
+ old_rrop = devPriv->rop;
+ devPriv->rop = cfbReduceRasterOp (pGC->alu, pGC->fgPixel,
+ pGC->planemask,
+ &devPriv->and, &devPriv->xor);
+ if (old_rrop == devPriv->rop)
+ new_rrop = FALSE;
+ else
+ {
+#ifdef PIXEL_ADDR
+ new_line = TRUE;
+#endif
+#ifdef WriteBitGroup
+ new_text = TRUE;
+#endif
+ new_fillspans = TRUE;
+ new_fillarea = TRUE;
+ }
+ }
+
+ if(!pGC->ops)
+ pGC->ops = & cfbNonTEOps;
+
+
+ if (new_rrop || new_fillspans || new_text || new_fillarea || new_line)
+ {
+ GCOps *newops;
+
+ if ((newops = cfb32MatchCommon_Underlay (pGC, devPriv)))
+ {
+ if (pGC->ops->devPrivate.val)
+ miDestroyGCOps (pGC->ops);
+ pGC->ops = newops;
+ new_rrop = new_line = new_fillspans = new_text = new_fillarea = 0;
+ }
+ else
+ {
+ if (!pGC->ops->devPrivate.val)
+ {
+ pGC->ops = miCreateGCOps (pGC->ops);
+ pGC->ops->devPrivate.val = 1;
+ }
+ }
+ }
+
+ /* deal with the changes we've collected */
+ if (new_line)
+ {
+ pGC->ops->FillPolygon = miFillPolygon;
+#ifdef NO_ONE_RECT
+ if (pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
+ break;
+ default:
+ pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
+ break;
+ }
+ }
+#else
+ if (devPriv->oneRect && pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillPolygon = cfbFillPoly1RectCopy;
+ break;
+ default:
+ pGC->ops->FillPolygon = cfbFillPoly1RectGeneral;
+ break;
+ }
+ }
+#endif
+ if (pGC->lineWidth == 0)
+ {
+#ifdef PIXEL_ADDR
+ if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
+ {
+ switch (devPriv->rop)
+ {
+ case GXxor:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8Xor;
+ break;
+ case GXcopy:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8Copy;
+ break;
+ default:
+ pGC->ops->PolyArc = cfbZeroPolyArcSS8General;
+ break;
+ }
+ }
+ else
+#endif
+ pGC->ops->PolyArc = miZeroPolyArc;
+ }
+ else
+ pGC->ops->PolyArc = miPolyArc;
+ pGC->ops->PolySegment = miPolySegment;
+ switch (pGC->lineStyle)
+ {
+ case LineSolid:
+ if(pGC->lineWidth == 0)
+ {
+ if (pGC->fillStyle == FillSolid)
+ {
+#if defined(PIXEL_ADDR) && !defined(NO_ONE_RECT)
+ if (devPriv->oneRect &&
+ ((pDrawable->x >= pGC->pScreen->width - 32768) &&
+ (pDrawable->y >= pGC->pScreen->height - 32768)))
+ {
+ pGC->ops->Polylines = cfb8LineSS1Rect;
+ pGC->ops->PolySegment = cfb8SegmentSS1Rect;
+ } else
+#endif
+#ifdef NO_ONE_RECT
+ {
+ pGC->ops->Polylines = cfb8LineSS1Rect;
+ pGC->ops->PolySegment = cfb8SegmentSS1Rect;
+ }
+#else
+ {
+ pGC->ops->Polylines = cfbLineSS;
+ pGC->ops->PolySegment = cfbSegmentSS;
+ }
+#endif
+ }
+ else
+ pGC->ops->Polylines = miZeroLine;
+ }
+ else
+ pGC->ops->Polylines = miWideLine;
+ break;
+ case LineOnOffDash:
+ case LineDoubleDash:
+ if (pGC->lineWidth == 0 && pGC->fillStyle == FillSolid)
+ {
+ pGC->ops->Polylines = cfbLineSD;
+ pGC->ops->PolySegment = cfbSegmentSD;
+ } else
+ pGC->ops->Polylines = miWideDash;
+ break;
+ }
+ }
+
+ if (new_text && (pGC->font))
+ {
+ if (FONTMAXBOUNDS(pGC->font,rightSideBearing) -
+ FONTMINBOUNDS(pGC->font,leftSideBearing) > 32 ||
+ FONTMINBOUNDS(pGC->font,characterWidth) < 0)
+ {
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+ pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
+ }
+ else
+ {
+#ifdef WriteBitGroup
+ if (pGC->fillStyle == FillSolid)
+ {
+ if (devPriv->rop == GXcopy)
+ pGC->ops->PolyGlyphBlt = cfbPolyGlyphBlt8;
+ else
+#ifdef FOUR_BIT_CODE
+ pGC->ops->PolyGlyphBlt = cfbPolyGlyphRop8;
+#else
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+#endif
+ }
+ else
+#endif
+ pGC->ops->PolyGlyphBlt = miPolyGlyphBlt;
+ /* special case ImageGlyphBlt for terminal emulator fonts */
+#if !defined(WriteBitGroup) || PSZ == 8
+ if (TERMINALFONT(pGC->font) &&
+ (pGC->planemask & PMSK) == PMSK
+#ifdef FOUR_BIT_CODE
+ && FONTMAXBOUNDS(pGC->font,characterWidth) >= PGSZB
+#endif
+ )
+ {
+ pGC->ops->ImageGlyphBlt = useTEGlyphBlt;
+ }
+ else
+#endif
+ {
+#ifdef WriteBitGroup
+ if (devPriv->rop == GXcopy &&
+ pGC->fillStyle == FillSolid &&
+ (pGC->planemask & PMSK) == PMSK)
+ pGC->ops->ImageGlyphBlt = cfbImageGlyphBlt8;
+ else
+#endif
+ pGC->ops->ImageGlyphBlt = miImageGlyphBlt;
+ }
+ }
+ }
+
+
+ if (new_fillspans) {
+ switch (pGC->fillStyle) {
+ case FillSolid:
+ switch (devPriv->rop) {
+ case GXcopy:
+ pGC->ops->FillSpans = cfbSolidSpansCopy;
+ break;
+ case GXxor:
+ pGC->ops->FillSpans = cfbSolidSpansXor;
+ break;
+ default:
+ pGC->ops->FillSpans = cfbSolidSpansGeneral;
+ break;
+ }
+ break;
+ case FillTiled:
+ pGC->ops->FillSpans = cfbUnnaturalTileFS;
+ break;
+ case FillStippled:
+ case FillOpaqueStippled:
+ pGC->ops->FillSpans = cfbUnnaturalStippleFS;
+ break;
+ default:
+ FatalError("cfbValidateGC: illegal fillStyle\n");
+ }
+ } /* end of new_fillspans */
+
+ if (new_fillarea) {
+#ifndef FOUR_BIT_CODE
+ pGC->ops->PolyFillRect = miPolyFillRect;
+ if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled)
+ {
+ pGC->ops->PolyFillRect = cfbPolyFillRect;
+ }
+#endif
+#ifdef FOUR_BIT_CODE
+#ifndef LOWMEMFTPT
+ pGC->ops->PushPixels = mfbPushPixels;
+#else
+ pGC->ops->PushPixels = miPushPixels;
+#endif /* ifndef LOWMEMFTPT */
+ if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy)
+ pGC->ops->PushPixels = cfbPushPixels8;
+#endif
+ pGC->ops->PolyFillArc = miPolyFillArc;
+ if (pGC->fillStyle == FillSolid)
+ {
+ switch (devPriv->rop)
+ {
+ case GXcopy:
+ pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy;
+ break;
+ default:
+ pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral;
+ break;
+ }
+ }
+ }
+}
diff --git a/hw/xfree86/xf8_32bpp/cfbimage.c b/hw/xfree86/xf8_32bpp/cfbimage.c
new file mode 100644
index 000000000..1e8550851
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbimage.c
@@ -0,0 +1,168 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbimage.c,v 1.2 2000/02/25 00:21:40 mvojkovi Exp $ */
+
+#include "X.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include "gcstruct.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "servermd.h"
+#include "mi.h"
+
+
+void
+cfb8_32GetImage (
+ DrawablePtr pDraw,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planemask,
+ char *pdstLine
+){
+ if(!w || !h) return;
+
+ if (!cfbDrawableEnabled (pDraw))
+ return;
+
+ if(pDraw->depth == 24){
+ cfb32GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ return;
+ }
+
+ if((pDraw->bitsPerPixel == 8) || (pDraw->bitsPerPixel == 1)){
+ cfbGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ return;
+ }
+
+ /* source is depth 8, 32 bpp */
+ if(format != ZPixmap) {
+ miGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ return;
+ } else {
+ BoxRec box;
+ DDXPointRec ptSrc;
+ RegionRec rgnDst;
+ ScreenPtr pScreen;
+ PixmapPtr pPixmap;
+
+ pScreen = pDraw->pScreen;
+ pPixmap = GetScratchPixmapHeader(pScreen, w, h, 8, 8,
+ PixmapBytePad(w,8), (pointer)pdstLine);
+ if (!pPixmap)
+ return;
+ if ((planemask & 0xff) != 0xff)
+ bzero((char *)pdstLine, pPixmap->devKind * h);
+ ptSrc.x = sx + pDraw->x;
+ ptSrc.y = sy + pDraw->y;
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = w;
+ box.y2 = h;
+ REGION_INIT(pScreen, &rgnDst, &box, 1);
+ cfbDoBitblt32To8(pDraw, (DrawablePtr)pPixmap, GXcopy, &rgnDst,
+ &ptSrc, planemask, 0);
+ REGION_UNINIT(pScreen, &rgnDst);
+ FreeScratchPixmapHeader(pPixmap);
+ }
+}
+
+void
+cfb8_32PutImage (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ if(!w || !h) return;
+
+ if((pDraw->bitsPerPixel == 8) || (format != XYPixmap)){
+ cfbPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage);
+ return;
+ } else { /* moving an 8bpp XYPixmap to a 32bpp screen */
+ unsigned long oldFg, oldBg;
+ XID gcv[3];
+ unsigned long oldPlanemask;
+ unsigned long i;
+ long bytesPer;
+
+ oldPlanemask = pGC->planemask;
+ oldFg = pGC->fgPixel;
+ oldBg = pGC->bgPixel;
+ gcv[0] = ~0L;
+ gcv[1] = 0;
+ DoChangeGC(pGC, GCForeground | GCBackground, gcv, 0);
+ bytesPer = (long)h * BitmapBytePad(w + leftPad);
+
+ for (i = 0x80000000; i & 0xff000000; i >>= 1, pImage += bytesPer)
+ {
+ if (i & oldPlanemask)
+ {
+ gcv[0] = i;
+ DoChangeGC(pGC, GCPlaneMask, gcv, 0);
+ ValidateGC(pDraw, pGC);
+ (*pGC->ops->PutImage)(pDraw, pGC, 1, x, y, w, h, leftPad,
+ XYBitmap, pImage);
+ }
+ }
+ gcv[0] = oldPlanemask;
+ gcv[1] = oldFg;
+ gcv[2] = oldBg;
+ DoChangeGC(pGC, GCPlaneMask | GCForeground | GCBackground, gcv, 0);
+ ValidateGC(pDraw, pGC);
+ }
+}
+
+
+
+
+void
+cfb8_32GetSpans(
+ DrawablePtr pDraw,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pDst
+){
+ int pitch, i;
+ CARD8 *ptr, *ptrBase;
+
+ if (!cfbDrawableEnabled (pDraw))
+ return;
+
+ if(pDraw->bitsPerPixel == 1) {
+ mfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+ return;
+ }
+
+ if(pDraw->depth == 24) {
+ cfb32GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+ return;
+ } else if(pDraw->bitsPerPixel == 8) {
+ cfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+ return;
+ }
+
+ /* gotta get spans from a depth 8 window */
+ cfbGetByteWidthAndPointer(pDraw, pitch, ptrBase);
+ ptrBase += 3; /* point to top byte */
+
+ while(nspans--) {
+ ptr = ptrBase + (ppt->y * pitch) + (ppt->x << 2);
+
+ for(i = *pwidth; i--; ptr += 4)
+ *(pDst++) = *ptr;
+
+ pDst = (char*)((long)(pDst + 3) & ~3L);
+
+ ppt++; pwidth++;
+ }
+}
+
+
diff --git a/hw/xfree86/xf8_32bpp/cfbpntwin.c b/hw/xfree86/xf8_32bpp/cfbpntwin.c
new file mode 100644
index 000000000..516decd6c
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbpntwin.c
@@ -0,0 +1,177 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbpntwin.c,v 1.5 2001/10/01 13:44:15 eich Exp $ */
+
+#include "X.h"
+
+#include "windowstr.h"
+#include "regionstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mi.h"
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
+void
+cfb8_32PaintWindow(
+ WindowPtr pWin,
+ RegionPtr pRegion,
+ int what
+){
+ WindowPtr pBgWin;
+ int xorg, yorg;
+
+ switch (what) {
+ case PW_BACKGROUND:
+ switch (pWin->backgroundState) {
+ case None:
+ break;
+ case ParentRelative:
+ do {
+ pWin = pWin->parent;
+ } while (pWin->backgroundState == ParentRelative);
+ (*pWin->drawable.pScreen->PaintWindowBackground)(
+ pWin, pRegion, what);
+ break;
+ case BackgroundPixmap:
+ xorg = pWin->drawable.x;
+ yorg = pWin->drawable.y;
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ int index = pWin->drawable.pScreen->myNum;
+ if(WindowTable[index] == pWin) {
+ xorg -= panoramiXdataPtr[index].x;
+ yorg -= panoramiXdataPtr[index].y;
+ }
+ }
+#endif
+ cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
+ pWin->background.pixmap, xorg, yorg, GXcopy,
+ (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000);
+ break;
+ case BackgroundPixel:
+ if(pWin->drawable.depth == 24)
+ cfb8_32FillBoxSolid32 ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion),
+ pWin->background.pixel);
+ else
+ cfb8_32FillBoxSolid8 ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion),
+ pWin->background.pixel);
+ break;
+ }
+ break;
+ case PW_BORDER:
+ if (pWin->borderIsPixel) {
+ if(pWin->drawable.depth == 24) {
+ cfb8_32FillBoxSolid32 ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion),
+ pWin->border.pixel);
+ } else
+ cfb8_32FillBoxSolid8 ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion),
+ pWin->border.pixel);
+ } else {
+ for (pBgWin = pWin;
+ pBgWin->backgroundState == ParentRelative;
+ pBgWin = pBgWin->parent);
+
+ xorg = pBgWin->drawable.x;
+ yorg = pBgWin->drawable.y;
+
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ int index = pWin->drawable.pScreen->myNum;
+ if(WindowTable[index] == pBgWin) {
+ xorg -= panoramiXdataPtr[index].x;
+ yorg -= panoramiXdataPtr[index].y;
+ }
+ }
+#endif
+ cfb32FillBoxTileOddGeneral ((DrawablePtr)pWin,
+ (int)REGION_NUM_RECTS(pRegion), REGION_RECTS(pRegion),
+ pWin->border.pixmap, xorg, yorg, GXcopy,
+ (pWin->drawable.depth == 24) ? 0x00ffffff : 0xff000000);
+ }
+ break;
+ }
+
+}
+
+void
+cfb8_32FillBoxSolid8(
+ DrawablePtr pDraw,
+ int nbox,
+ BoxPtr pbox,
+ unsigned long color
+){
+ CARD8 *ptr, *data;
+ int pitch, height, width, i;
+ CARD8 c = (CARD8)color;
+
+ cfbGetByteWidthAndPointer(pDraw, pitch, ptr);
+ ptr += 3; /* point to the top byte */
+
+ while(nbox--) {
+ data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2);
+ width = (pbox->x2 - pbox->x1) << 2;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ for(i = 0; i < width; i+=4)
+ data[i] = c;
+ data += pitch;
+ }
+ pbox++;
+ }
+}
+
+
+void
+cfb8_32FillBoxSolid32(
+ DrawablePtr pDraw,
+ int nbox,
+ BoxPtr pbox,
+ unsigned long color
+){
+ CARD8 *ptr, *data;
+ CARD16 *ptr2, *data2;
+ int pitch, pitch2;
+ int height, width, i;
+ CARD8 c = (CARD8)(color >> 16);
+ CARD16 c2 = (CARD16)color;
+
+ cfbGetByteWidthAndPointer(pDraw, pitch, ptr);
+ cfbGetTypedWidthAndPointer(pDraw, pitch2, ptr2, CARD16, CARD16);
+ ptr += 2; /* point to the third byte */
+
+ while(nbox--) {
+ data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2);
+ data2 = ptr2 + (pbox->y1 * pitch2) + (pbox->x1 << 1);
+ width = (pbox->x2 - pbox->x1) << 1;
+ height = pbox->y2 - pbox->y1;
+
+ while(height--) {
+ for(i = 0; i < width; i+=2) {
+ data[i << 1] = c;
+ data2[i] = c2;
+ }
+ data += pitch;
+ data2 += pitch2;
+ }
+ pbox++;
+ }
+}
+
diff --git a/hw/xfree86/xf8_32bpp/cfbscrinit.c b/hw/xfree86/xf8_32bpp/cfbscrinit.c
new file mode 100644
index 000000000..ce2b8ae8f
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbscrinit.c
@@ -0,0 +1,309 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbscrinit.c,v 1.11 2001/04/14 21:17:49 mvojkovi Exp $ */
+
+
+#include "X.h"
+#include "Xmd.h"
+#include "misc.h"
+#include "servermd.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "resource.h"
+#include "colormap.h"
+#include "colormapst.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mi.h"
+#include "micmap.h"
+#include "mistruct.h"
+#include "dix.h"
+#include "mibstore.h"
+#include "mioverlay.h"
+#include "xf86.h"
+#include "xf86str.h"
+#include "globals.h"
+
+/* CAUTION: We require that cfb8 and cfb32 were NOT
+ compiled with CFB_NEED_SCREEN_PRIVATE */
+
+static BSFuncRec cfb8_32BSFuncRec = {
+ cfb8_32SaveAreas,
+ cfb8_32RestoreAreas,
+ (BackingStoreSetClipmaskRgnProcPtr) 0,
+ (BackingStoreGetImagePixmapProcPtr) 0,
+ (BackingStoreGetSpansPixmapProcPtr) 0,
+};
+
+
+int cfb8_32GCPrivateIndex;
+int cfb8_32ScreenPrivateIndex;
+static unsigned long cfb8_32Generation = 0;
+
+static Bool
+cfb8_32AllocatePrivates(ScreenPtr pScreen)
+{
+ cfb8_32ScreenPtr pScreenPriv;
+
+ if(cfb8_32Generation != serverGeneration) {
+ if(((cfb8_32GCPrivateIndex = AllocateGCPrivateIndex()) < 0) ||
+ ((cfb8_32ScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0))
+ return FALSE;
+ cfb8_32Generation = serverGeneration;
+ }
+
+ if (!(pScreenPriv = xalloc(sizeof(cfb8_32ScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[cfb8_32ScreenPrivateIndex].ptr = (pointer)pScreenPriv;
+
+
+ /* All cfb will have the same GC and Window private indicies */
+ if(!mfbAllocatePrivates(pScreen,&cfbWindowPrivateIndex, &cfbGCPrivateIndex))
+ return FALSE;
+
+ /* The cfb indicies are the mfb indicies. Reallocating them resizes them */
+ if(!AllocateWindowPrivate(pScreen,cfbWindowPrivateIndex,sizeof(cfbPrivWin)))
+ return FALSE;
+
+ if(!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
+ return FALSE;
+
+ if(!AllocateGCPrivate(pScreen, cfb8_32GCPrivateIndex, sizeof(cfb8_32GCRec)))
+ return FALSE;
+
+ return TRUE;
+}
+
+static Bool
+cfb8_32SetupScreen(
+ ScreenPtr pScreen,
+ pointer pbits, /* pointer to screen bitmap */
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy, /* dots per inch */
+ int width /* pixel width of frame buffer */
+){
+ if (!cfb8_32AllocatePrivates(pScreen))
+ return FALSE;
+ pScreen->defColormap = FakeClientID(0);
+ /* let CreateDefColormap do whatever it wants for pixels */
+ pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
+ pScreen->QueryBestSize = mfbQueryBestSize;
+ /* SaveScreen */
+ pScreen->GetImage = cfb8_32GetImage;
+ pScreen->GetSpans = cfb8_32GetSpans;
+ pScreen->CreateWindow = cfb8_32CreateWindow;
+ pScreen->DestroyWindow = cfb8_32DestroyWindow;
+ pScreen->PositionWindow = cfb8_32PositionWindow;
+ pScreen->ChangeWindowAttributes = cfb8_32ChangeWindowAttributes;
+ pScreen->RealizeWindow = cfb32MapWindow; /* OK */
+ pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */
+ pScreen->PaintWindowBackground = cfb8_32PaintWindow;
+ pScreen->PaintWindowBorder = cfb8_32PaintWindow;
+ pScreen->CopyWindow = cfb8_32CopyWindow;
+ pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */
+ pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */
+ pScreen->RealizeFont = mfbRealizeFont;
+ pScreen->UnrealizeFont = mfbUnrealizeFont;
+ pScreen->CreateGC = cfb8_32CreateGC;
+ pScreen->CreateColormap = miInitializeColormap;
+ pScreen->DestroyColormap = (void (*)())NoopDDA;
+ pScreen->InstallColormap = miInstallColormap;
+ pScreen->UninstallColormap = miUninstallColormap;
+ pScreen->ListInstalledColormaps = miListInstalledColormaps;
+ pScreen->StoreColors = (void (*)())NoopDDA;
+ pScreen->ResolveColor = miResolveColor;
+ pScreen->BitmapToRegion = mfbPixmapToRegion;
+
+ mfbRegisterCopyPlaneProc (pScreen, cfb8_32CopyPlane);
+ return TRUE;
+}
+
+typedef struct {
+ pointer pbits;
+ int width;
+} miScreenInitParmsRec, *miScreenInitParmsPtr;
+
+static Bool
+cfb8_32CreateScreenResources(ScreenPtr pScreen)
+{
+ miScreenInitParmsPtr pScrInitParms;
+ int pitch;
+ Bool retval;
+
+ /* get the pitch before mi destroys it */
+ pScrInitParms = (miScreenInitParmsPtr)pScreen->devPrivate;
+ pitch = pScrInitParms->width << 2;
+
+ if((retval = miCreateScreenResources(pScreen))) {
+ /* fix the screen pixmap */
+ PixmapPtr pPix = (PixmapPtr)pScreen->devPrivate;
+ pPix->drawable.bitsPerPixel = 32;
+ pPix->drawable.depth = 8;
+ pPix->devKind = pitch;
+ }
+
+ return retval;
+}
+
+
+static Bool
+cfb8_32CloseScreen (int i, ScreenPtr pScreen)
+{
+ cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
+ if(pScreenPriv->visualData)
+ xfree(pScreenPriv->visualData);
+
+ xfree((pointer) pScreenPriv);
+ pScreen->devPrivates[cfb8_32ScreenPrivateIndex].ptr = NULL;
+
+ return(cfb32CloseScreen(i, pScreen));
+}
+
+static void
+cfb8_32TransFunc(
+ ScreenPtr pScreen,
+ int nbox,
+ BoxPtr pbox
+){
+ cfb8_32FillBoxSolid8(&(WindowTable[pScreen->myNum]->drawable),
+ nbox, pbox, xf86Screens[pScreen->myNum]->colorKey);
+}
+
+static Bool
+cfb8_32InOverlayFunc(WindowPtr pWin)
+{
+ return (pWin->drawable.depth == 8);
+}
+
+static Bool
+cfb8_32FinishScreenInit(
+ ScreenPtr pScreen,
+ pointer pbits, /* pointer to screen bitmap */
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy, /* dots per inch */
+ int width /* pixel width of frame buffer */
+){
+ VisualPtr visuals;
+ DepthPtr depths;
+ int nvisuals;
+ int ndepths;
+ int rootdepth;
+ VisualID defaultVisual;
+
+ rootdepth = 0;
+ if (!miInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
+ &defaultVisual,((unsigned long)1<<(32-1)), 8, -1))
+ return FALSE;
+ if (! miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
+ rootdepth, ndepths, depths,
+ defaultVisual, nvisuals, visuals))
+ return FALSE;
+
+ pScreen->BackingStoreFuncs = cfb8_32BSFuncRec;
+ pScreen->CreateScreenResources = cfb8_32CreateScreenResources;
+ pScreen->CloseScreen = cfb8_32CloseScreen;
+ pScreen->GetScreenPixmap = cfb32GetScreenPixmap; /* OK */
+ pScreen->SetScreenPixmap = cfb32SetScreenPixmap; /* OK */
+
+ if (! miInitOverlay(pScreen, cfb8_32InOverlayFunc, cfb8_32TransFunc))
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+cfb8_32EnableDisableFBAccess (
+ int index,
+ Bool enable
+){
+ ScreenPtr pScreen = screenInfo.screens[index];
+ cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
+
+ miOverlaySetRootClip(pScreen, enable);
+
+ (*pScreenPriv->EnableDisableFBAccess) (index, enable);
+}
+
+static Atom overlayVisualsAtom;
+
+typedef struct {
+ CARD32 overlay_visual;
+ CARD32 transparent_type;
+ CARD32 value;
+ CARD32 layer;
+} overlayVisualRec;
+
+static void
+cfb8_32SetupVisuals (ScreenPtr pScreen)
+{
+ cfb8_32ScreenPtr pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
+ char atomString[] = {"SERVER_OVERLAY_VISUALS"};
+ overlayVisualRec *overlayVisuals;
+ VisualID *visuals = NULL;
+ int numVisuals = 0;
+ DepthPtr pDepth = pScreen->allowedDepths;
+ int numDepths = pScreen->numDepths;
+ int i;
+
+ /* find depth 8 visuals */
+ for(i = 0; i < numDepths; i++, pDepth++) {
+ if(pDepth->depth == 8) {
+ numVisuals = pDepth->numVids;
+ visuals = pDepth->vids;
+ break;
+ }
+ }
+
+ if(!numVisuals || !visuals) {
+ ErrorF("No overlay visuals found!\n");
+ return;
+ }
+
+ if(!(overlayVisuals = xalloc(numVisuals * sizeof(overlayVisualRec))))
+ return;
+
+ for(i = 0; i < numVisuals; i++) {
+ overlayVisuals[i].overlay_visual = visuals[i];
+ overlayVisuals[i].transparent_type = 1; /* transparent pixel */
+ overlayVisuals[i].value = pScreenPriv->key;
+ overlayVisuals[i].layer = 1;
+ }
+
+ overlayVisualsAtom = MakeAtom(atomString, sizeof(atomString) - 1, TRUE);
+ xf86RegisterRootWindowProperty(pScreen->myNum, overlayVisualsAtom,
+ overlayVisualsAtom, 32, numVisuals * 4, overlayVisuals);
+ pScreenPriv->visualData = (pointer)overlayVisuals;
+}
+
+Bool
+cfb8_32ScreenInit(
+ ScreenPtr pScreen,
+ pointer pbits, /* pointer to screen bitmap */
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy, /* dots per inch */
+ int w /* pixel width of frame buffer */
+){
+ cfb8_32ScreenPtr pScreenPriv;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+
+ if (!cfb8_32SetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, w))
+ return FALSE;
+
+ pScreenPriv = CFB8_32_GET_SCREEN_PRIVATE(pScreen);
+ pScreenPriv->key = pScrn->colorKey;
+ pScreenPriv->visualData = NULL;
+
+
+ pScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess;
+ pScrn->EnableDisableFBAccess = cfb8_32EnableDisableFBAccess;
+
+
+ if(cfb8_32FinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, w))
+ {
+ cfb8_32SetupVisuals(pScreen);
+ return TRUE;
+ }
+ return FALSE;
+}
diff --git a/hw/xfree86/xf8_32bpp/cfbwindow.c b/hw/xfree86/xf8_32bpp/cfbwindow.c
new file mode 100644
index 000000000..518166f41
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/cfbwindow.c
@@ -0,0 +1,116 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/cfbwindow.c,v 1.7 2003/02/17 16:08:30 dawes Exp $ */
+
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32.h"
+#include "mistruct.h"
+#include "regionstr.h"
+#include "cfbmskbits.h"
+#include "mioverlay.h"
+
+
+/* We don't bother with cfb's fastBackground/Border so we don't
+ need to use the Window privates */
+
+
+Bool
+cfb8_32CreateWindow(WindowPtr pWin)
+{
+ cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
+
+ pPrivWin->fastBackground = FALSE;
+ pPrivWin->fastBorder = FALSE;
+
+ pWin->drawable.bitsPerPixel = 32;
+ return TRUE;
+}
+
+
+Bool
+cfb8_32DestroyWindow(WindowPtr pWin)
+{
+ return TRUE;
+}
+
+Bool
+cfb8_32PositionWindow(
+ WindowPtr pWin,
+ int x, int y
+){
+ return TRUE;
+}
+
+void
+cfb8_32CopyWindow(pWin, ptOldOrg, prgnSrc)
+ WindowPtr pWin;
+ DDXPointRec ptOldOrg;
+ RegionPtr prgnSrc;
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ DDXPointPtr ppt, pptSrc;
+ RegionRec rgnDst;
+ RegionPtr borderClip = &pWin->borderClip;
+ BoxPtr pbox;
+ int dx, dy, i, nbox;
+ WindowPtr pwinRoot;
+ Bool doUnderlay = miOverlayCopyUnderlay(pScreen);
+ Bool freeReg = FALSE;
+
+ pwinRoot = WindowTable[pScreen->myNum];
+
+ if(doUnderlay)
+ freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
+
+ REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc);
+
+ pbox = REGION_RECTS(&rgnDst);
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(!nbox ||
+ !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
+ {
+ REGION_UNINIT(pScreen, &rgnDst);
+ return;
+ }
+ ppt = pptSrc;
+
+ for (i = nbox; --i >= 0; ppt++, pbox++)
+ {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ if(doUnderlay)
+ cfbDoBitblt24To24GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
+ GXcopy, &rgnDst, pptSrc, ~0, 0);
+ else
+ cfbDoBitblt8To8GXcopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
+ GXcopy, &rgnDst, pptSrc, ~0, 0);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ REGION_UNINIT(pScreen, &rgnDst);
+ if(freeReg)
+ REGION_DESTROY(pScreen, borderClip);
+}
+
+Bool
+cfb8_32ChangeWindowAttributes(
+ WindowPtr pWin,
+ unsigned long mask
+){
+ return TRUE;
+}
+
+
+
+
diff --git a/hw/xfree86/xf8_32bpp/xf86overlay.c b/hw/xfree86/xf8_32bpp/xf86overlay.c
new file mode 100644
index 000000000..998503c21
--- /dev/null
+++ b/hw/xfree86/xf8_32bpp/xf86overlay.c
@@ -0,0 +1,1258 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32bpp/xf86overlay.c,v 1.9 2002/02/11 00:07:25 dawes Exp $ */
+
+/*
+ Copyright (C) 1998. The XFree86 Project Inc.
+
+ Written by Mark Vojkovich (mvojkovi@ucsd.edu)
+*/
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_ansic.h"
+#include "xf86_OSproc.h"
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "regionstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "migc.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "colormapst.h"
+#include "cfb8_32.h"
+
+#define IS_DIRTY 1
+#define IS_SHARED 2
+
+/** Screen Functions **/
+
+static Bool OverlayCloseScreen (int, ScreenPtr);
+static Bool OverlayCreateGC(GCPtr pGC);
+static Bool OverlayDestroyPixmap(PixmapPtr);
+static PixmapPtr OverlayCreatePixmap(ScreenPtr, int, int, int);
+static Bool OverlayChangeWindowAttributes(WindowPtr, unsigned long);
+static void OverlayPaintWindow(WindowPtr, RegionPtr, int);
+
+/** Funcs **/
+static void OverlayValidateGC(GCPtr, unsigned long, DrawablePtr);
+static void OverlayChangeGC(GCPtr, unsigned long);
+static void OverlayCopyGC(GCPtr, unsigned long, GCPtr);
+static void OverlayDestroyGC(GCPtr);
+static void OverlayChangeClip(GCPtr, int, pointer, int);
+static void OverlayDestroyClip(GCPtr);
+static void OverlayCopyClip(GCPtr, GCPtr);
+
+
+static PixmapPtr OverlayRefreshPixmap(PixmapPtr);
+
+static GCFuncs OverlayGCFuncs = {
+ OverlayValidateGC, OverlayChangeGC,
+ OverlayCopyGC, OverlayDestroyGC,
+ OverlayChangeClip, OverlayDestroyClip,
+ OverlayCopyClip
+};
+
+
+/** Pixmap Ops */
+static void PixmapFillSpans(DrawablePtr, GCPtr, int, DDXPointPtr, int *,
+ int);
+static void PixmapSetSpans(DrawablePtr, GCPtr, char *, DDXPointPtr,
+ int *, int, int);
+static void PixmapPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
+ int, int, char *);
+static void PixmapPushPixels(GCPtr, PixmapPtr, DrawablePtr, int, int,
+ int, int);
+static RegionPtr PixmapCopyArea(DrawablePtr, DrawablePtr, GCPtr, int, int,
+ int, int, int, int);
+static RegionPtr PixmapCopyPlane(DrawablePtr, DrawablePtr, GCPtr, int, int,
+ int, int, int, int, unsigned long);
+static void PixmapPolyPoint(DrawablePtr, GCPtr, int, int, xPoint *);
+static void PixmapPolylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
+static void PixmapPolySegment(DrawablePtr, GCPtr, int, xSegment *);
+static void PixmapPolyRectangle(DrawablePtr, GCPtr, int, xRectangle *);
+static void PixmapPolyArc(DrawablePtr, GCPtr, int, xArc *);
+static void PixmapFillPolygon(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+static void PixmapPolyFillRect(DrawablePtr, GCPtr, int, xRectangle *);
+static void PixmapPolyFillArc(DrawablePtr, GCPtr, int, xArc *);
+static int PixmapPolyText8(DrawablePtr, GCPtr, int, int, int, char *);
+static int PixmapPolyText16(DrawablePtr, GCPtr, int, int, int,
+ unsigned short *);
+static void PixmapImageText8(DrawablePtr, GCPtr, int, int, int, char *);
+static void PixmapImageText16(DrawablePtr, GCPtr, int, int, int,
+ unsigned short *);
+static void PixmapImageGlyphBlt(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+static void PixmapPolyGlyphBlt(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+
+static GCOps PixmapGCOps = {
+ PixmapFillSpans, PixmapSetSpans,
+ PixmapPutImage, PixmapCopyArea,
+ PixmapCopyPlane, PixmapPolyPoint,
+ PixmapPolylines, PixmapPolySegment,
+ PixmapPolyRectangle, PixmapPolyArc,
+ PixmapFillPolygon, PixmapPolyFillRect,
+ PixmapPolyFillArc, PixmapPolyText8,
+ PixmapPolyText16, PixmapImageText8,
+ PixmapImageText16, PixmapImageGlyphBlt,
+ PixmapPolyGlyphBlt, PixmapPushPixels,
+#ifdef NEED_LINEHELPER
+ NULL,
+#endif
+ {NULL} /* devPrivate */
+};
+
+
+/** Window Ops **/
+static void WindowFillSpans(DrawablePtr, GCPtr, int, DDXPointPtr, int *,
+ int);
+static void WindowSetSpans(DrawablePtr, GCPtr, char *, DDXPointPtr,
+ int *, int, int);
+static void WindowPutImage(DrawablePtr, GCPtr, int, int, int, int, int,
+ int, int, char *);
+static void WindowPushPixels(GCPtr, PixmapPtr, DrawablePtr, int, int,
+ int, int);
+static RegionPtr WindowCopyArea(DrawablePtr, DrawablePtr, GCPtr, int, int,
+ int, int, int, int);
+static RegionPtr WindowCopyPlane(DrawablePtr, DrawablePtr, GCPtr, int, int,
+ int, int, int, int, unsigned long);
+static void WindowPolyPoint(DrawablePtr, GCPtr, int, int, xPoint *);
+static void WindowPolylines(DrawablePtr, GCPtr, int, int, DDXPointPtr);
+static void WindowPolySegment(DrawablePtr, GCPtr, int, xSegment *);
+static void WindowPolyRectangle(DrawablePtr, GCPtr, int, xRectangle *);
+static void WindowPolyArc(DrawablePtr, GCPtr, int, xArc *);
+static void WindowFillPolygon(DrawablePtr, GCPtr, int, int, int,
+ DDXPointPtr);
+static void WindowPolyFillRect(DrawablePtr, GCPtr, int, xRectangle *);
+static void WindowPolyFillArc(DrawablePtr, GCPtr, int, xArc *);
+static int WindowPolyText8(DrawablePtr, GCPtr, int, int, int, char *);
+static int WindowPolyText16(DrawablePtr, GCPtr, int, int, int,
+ unsigned short *);
+static void WindowImageText8(DrawablePtr, GCPtr, int, int, int, char *);
+static void WindowImageText16(DrawablePtr, GCPtr, int, int, int,
+ unsigned short *);
+static void WindowImageGlyphBlt(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+static void WindowPolyGlyphBlt(DrawablePtr, GCPtr, int, int,
+ unsigned int, CharInfoPtr *, pointer);
+
+static GCOps WindowGCOps = {
+ WindowFillSpans, WindowSetSpans,
+ WindowPutImage, WindowCopyArea,
+ WindowCopyPlane, WindowPolyPoint,
+ WindowPolylines, WindowPolySegment,
+ WindowPolyRectangle, WindowPolyArc,
+ WindowFillPolygon, WindowPolyFillRect,
+ WindowPolyFillArc, WindowPolyText8,
+ WindowPolyText16, WindowImageText8,
+ WindowImageText16, WindowImageGlyphBlt,
+ WindowPolyGlyphBlt, WindowPushPixels,
+#ifdef NEED_LINEHELPER
+ NULL,
+#endif
+ {NULL} /* devPrivate */
+};
+
+/** privates **/
+
+typedef struct {
+ CloseScreenProcPtr CloseScreen;
+ CreateGCProcPtr CreateGC;
+ CreatePixmapProcPtr CreatePixmap;
+ DestroyPixmapProcPtr DestroyPixmap;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ int LockPrivate;
+} OverlayScreenRec, *OverlayScreenPtr;
+
+typedef struct {
+ GCFuncs *wrapFuncs;
+ GCOps *wrapOps;
+ GCOps *overlayOps;
+ unsigned long fg;
+ unsigned long bg;
+ unsigned long pm;
+ PixmapPtr tile;
+} OverlayGCRec, *OverlayGCPtr;
+
+typedef struct {
+ PixmapPtr pix32;
+ CARD32 dirty;
+} OverlayPixmapRec, *OverlayPixmapPtr;
+
+
+static int OverlayScreenIndex = -1;
+static int OverlayGCIndex = -1;
+static int OverlayPixmapIndex = -1;
+static unsigned long OverlayGeneration = 0;
+
+/** Macros **/
+
+#define TILE_EXISTS(pGC) (!(pGC)->tileIsPixel && (pGC)->tile.pixmap)
+
+#define OVERLAY_GET_PIXMAP_PRIVATE(pPix) \
+ (OverlayPixmapPtr)((pPix)->devPrivates[OverlayPixmapIndex].ptr)
+
+#define OVERLAY_GET_SCREEN_PRIVATE(pScreen) \
+ (OverlayScreenPtr)((pScreen)->devPrivates[OverlayScreenIndex].ptr)
+
+#define OVERLAY_GET_GC_PRIVATE(pGC) \
+ (OverlayGCPtr)((pGC)->devPrivates[OverlayGCIndex].ptr)
+
+#define OVERLAY_GC_FUNC_PROLOGUE(pGC)\
+ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
+ (pGC)->funcs = pGCPriv->wrapFuncs;\
+ if(pGCPriv->overlayOps) \
+ (pGC)->ops = pGCPriv->wrapOps
+
+#define OVERLAY_GC_FUNC_EPILOGUE(pGC)\
+ pGCPriv->wrapFuncs = (pGC)->funcs;\
+ (pGC)->funcs = &OverlayGCFuncs;\
+ if(pGCPriv->overlayOps) { \
+ pGCPriv->wrapOps = (pGC)->ops;\
+ (pGC)->ops = pGCPriv->overlayOps;\
+ }
+
+#define WINDOW_GC_OP_PROLOGUE(pGC)\
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE((pGC)->pScreen);\
+ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
+ unsigned long oldfg = (pGC)->fgPixel;\
+ unsigned long oldbg = (pGC)->bgPixel;\
+ unsigned long oldpm = (pGC)->planemask;\
+ PixmapPtr oldtile = (pGC)->tile.pixmap;\
+ (pGC)->fgPixel = pGCPriv->fg;\
+ (pGC)->bgPixel = pGCPriv->bg;\
+ (pGC)->planemask = pGCPriv->pm;\
+ if(pGCPriv->tile) (pGC)->tile.pixmap = pGCPriv->tile;\
+ (pGC)->funcs = pGCPriv->wrapFuncs;\
+ (pGC)->ops = pGCPriv->wrapOps;\
+ pScreenPriv->LockPrivate++
+
+
+#define WINDOW_GC_OP_EPILOGUE(pGC)\
+ pGCPriv->wrapOps = (pGC)->ops;\
+ pGCPriv->wrapFuncs = (pGC)->funcs;\
+ (pGC)->fgPixel = oldfg;\
+ (pGC)->bgPixel = oldbg;\
+ (pGC)->planemask = oldpm;\
+ (pGC)->tile.pixmap = oldtile;\
+ (pGC)->funcs = &OverlayGCFuncs;\
+ (pGC)->ops = &WindowGCOps;\
+ pScreenPriv->LockPrivate--
+
+
+#define PIXMAP_GC_OP_PROLOGUE(pGC)\
+ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);\
+ OverlayPixmapPtr pPixPriv = OVERLAY_GET_PIXMAP_PRIVATE((PixmapPtr)pDraw);\
+ pGC->funcs = pGCPriv->wrapFuncs;\
+ pGC->ops = pGCPriv->wrapOps
+
+#define PIXMAP_GC_OP_EPILOGUE(pGC)\
+ pGCPriv->wrapOps = pGC->ops;\
+ pGC->funcs = &OverlayGCFuncs;\
+ pGC->ops = &PixmapGCOps;\
+ pPixPriv->dirty |= IS_DIRTY
+
+
+Bool
+xf86Overlay8Plus32Init (ScreenPtr pScreen)
+{
+ OverlayScreenPtr pScreenPriv;
+
+ if(OverlayGeneration != serverGeneration) {
+ if(((OverlayScreenIndex = AllocateScreenPrivateIndex()) < 0) ||
+ ((OverlayGCIndex = AllocateGCPrivateIndex()) < 0) ||
+ ((OverlayPixmapIndex = AllocatePixmapPrivateIndex()) < 0))
+ return FALSE;
+
+ OverlayGeneration = serverGeneration;
+ }
+
+ if (!AllocateGCPrivate(pScreen, OverlayGCIndex, sizeof(OverlayGCRec)))
+ return FALSE;
+
+ if (!AllocatePixmapPrivate(pScreen, OverlayPixmapIndex,
+ sizeof(OverlayPixmapRec)))
+ return FALSE;
+
+ if (!(pScreenPriv = xalloc(sizeof(OverlayScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[OverlayScreenIndex].ptr = (pointer)pScreenPriv;
+
+ pScreenPriv->CreateGC = pScreen->CreateGC;
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreenPriv->CreatePixmap = pScreen->CreatePixmap;
+ pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap;
+ pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
+ pScreenPriv->PaintWindowBackground = pScreen->PaintWindowBackground;
+ pScreenPriv->PaintWindowBorder = pScreen->PaintWindowBorder;
+
+ pScreen->CreateGC = OverlayCreateGC;
+ pScreen->CloseScreen = OverlayCloseScreen;
+ pScreen->CreatePixmap = OverlayCreatePixmap;
+ pScreen->DestroyPixmap = OverlayDestroyPixmap;
+ pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes;
+ pScreen->PaintWindowBackground = OverlayPaintWindow;
+ pScreen->PaintWindowBorder = OverlayPaintWindow;
+
+ pScreenPriv->LockPrivate = 0;
+
+ /* allocate the key in the default map */
+ if(pScreen->defColormap) {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ ColormapPtr pmap;
+ xColorItem color;
+
+ pmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, RT_COLORMAP);
+
+ pmap->red[pScrn->colorKey].refcnt = AllocPrivate;
+ pmap->red[pScrn->colorKey].fShared = FALSE;
+ pmap->freeRed--;
+
+ color.red = color.blue = color.green = 0;
+ color.pixel = pScrn->colorKey;
+ color.flags = DoRed | DoGreen | DoBlue;
+
+ StoreColors(pmap, 1, &color);
+ }
+
+ return TRUE;
+}
+
+
+/*********************** Screen Funcs ***********************/
+
+Bool
+OverlayCreateGC(GCPtr pGC)
+{
+ ScreenPtr pScreen = pGC->pScreen;
+ OverlayGCPtr pGCPriv = OVERLAY_GET_GC_PRIVATE(pGC);
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ Bool ret;
+
+ pScreen->CreateGC = pScreenPriv->CreateGC;
+
+ if((ret = (*pScreen->CreateGC)(pGC)) && (pGC->depth != 1)) {
+ pGCPriv->wrapFuncs = pGC->funcs;
+ pGC->funcs = &OverlayGCFuncs;
+ pGCPriv->wrapOps = NULL;
+ pGCPriv->overlayOps = NULL;
+ pGCPriv->tile = NULL;
+ }
+
+ pScreen->CreateGC = OverlayCreateGC;
+
+ return ret;
+}
+
+static PixmapPtr
+OverlayCreatePixmap(ScreenPtr pScreen, int w, int h, int depth)
+{
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ PixmapPtr pPix;
+
+ pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
+ pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth);
+ pScreen->CreatePixmap = OverlayCreatePixmap;
+
+ /* We initialize all the privates */
+ if(pPix) {
+ OverlayPixmapPtr pPriv = OVERLAY_GET_PIXMAP_PRIVATE(pPix);
+ pPriv->pix32 = NULL;
+ pPriv->dirty = IS_DIRTY;
+ if(!w || !h)
+ pPriv->dirty |= IS_SHARED;
+ }
+
+ return pPix;
+}
+
+static Bool
+OverlayDestroyPixmap(PixmapPtr pPix)
+{
+ ScreenPtr pScreen = pPix->drawable.pScreen;
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ Bool result;
+
+ pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
+
+ if((pPix->refcnt == 1) && (pPix->drawable.bitsPerPixel == 8)) {
+ OverlayPixmapPtr pPriv = OVERLAY_GET_PIXMAP_PRIVATE(pPix);
+ if(pPriv->pix32) {
+ if(pPriv->pix32->refcnt != 1)
+ ErrorF("Warning! private pix refcnt = %i\n", pPriv->pix32->refcnt);
+ (*pScreen->DestroyPixmap)(pPriv->pix32);
+ }
+ pPriv->pix32 = NULL;
+ }
+
+ result = (*pScreen->DestroyPixmap) (pPix);
+ pScreen->DestroyPixmap = OverlayDestroyPixmap;
+
+ return result;
+}
+
+static Bool
+OverlayCloseScreen (int i, ScreenPtr pScreen)
+{
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+
+ pScreen->CreateGC = pScreenPriv->CreateGC;
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ pScreen->CreatePixmap = pScreenPriv->CreatePixmap;
+ pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap;
+ pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
+ pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
+ pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
+
+ xfree ((pointer) pScreenPriv);
+
+ return (*pScreen->CloseScreen) (i, pScreen);
+}
+
+
+
+static Bool
+OverlayChangeWindowAttributes (WindowPtr pWin, unsigned long mask)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ Bool result;
+
+ if(pWin->drawable.depth == 8) {
+ if((mask & CWBackPixmap) &&
+ (pWin->backgroundState == BackgroundPixmap))
+ OverlayRefreshPixmap(pWin->background.pixmap);
+
+ if((mask & CWBorderPixmap) && !pWin->borderIsPixel)
+ OverlayRefreshPixmap(pWin->border.pixmap);
+ }
+
+ pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes;
+ result = (*pScreen->ChangeWindowAttributes) (pWin, mask);
+ pScreen->ChangeWindowAttributes = OverlayChangeWindowAttributes;
+
+ return result;
+}
+
+static void
+OverlayPaintWindow(
+ WindowPtr pWin,
+ RegionPtr pReg,
+ int what
+){
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ OverlayPixmapPtr pixPriv;
+ PixmapPtr oldPix = NULL;
+
+ if(what == PW_BACKGROUND) {
+ if(pWin->drawable.depth == 8) {
+ if(pWin->backgroundState == ParentRelative) {
+ do {
+ pWin = pWin->parent;
+ } while (pWin->backgroundState == ParentRelative);
+ }
+
+ if(pWin->backgroundState == BackgroundPixmap) {
+ oldPix = pWin->background.pixmap;
+ pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix);
+ /* have to do this here because alot of applications
+ incorrectly assume changes to a pixmap that is
+ a window background go into effect immediatedly */
+ if(pixPriv->dirty & IS_DIRTY)
+ OverlayRefreshPixmap(pWin->background.pixmap);
+ pWin->background.pixmap = pixPriv->pix32;
+ }
+ }
+
+ pScreen->PaintWindowBackground = pScreenPriv->PaintWindowBackground;
+ (*pScreen->PaintWindowBackground) (pWin, pReg, what);
+ pScreen->PaintWindowBackground = OverlayPaintWindow;
+
+ if(oldPix)
+ pWin->background.pixmap = oldPix;
+ } else {
+ if((pWin->drawable.depth == 8) && !pWin->borderIsPixel) {
+ oldPix = pWin->border.pixmap;
+ pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(oldPix);
+ if(pixPriv->dirty & IS_DIRTY)
+ OverlayRefreshPixmap(pWin->border.pixmap);
+ pWin->border.pixmap = pixPriv->pix32;
+ }
+
+ pScreen->PaintWindowBorder = pScreenPriv->PaintWindowBorder;
+ (*pScreen->PaintWindowBorder) (pWin, pReg, what);
+ pScreen->PaintWindowBorder = OverlayPaintWindow;
+
+ if(oldPix)
+ pWin->border.pixmap = oldPix;
+ }
+}
+
+
+/*********************** GC Funcs *****************************/
+
+
+static PixmapPtr
+OverlayRefreshPixmap(PixmapPtr pix8)
+{
+ OverlayPixmapPtr pixPriv = OVERLAY_GET_PIXMAP_PRIVATE(pix8);
+ ScreenPtr pScreen = pix8->drawable.pScreen;
+
+ if(!pixPriv->pix32) {
+ PixmapPtr newPix;
+
+ newPix = (*pScreen->CreatePixmap)(pScreen, pix8->drawable.width,
+ pix8->drawable.height, 24);
+ newPix->drawable.depth = 8; /* Bad Mark! Bad Mark! */
+ pixPriv->pix32 = newPix;
+ }
+
+ if(pixPriv->dirty) {
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pScreen);
+ GCPtr pGC;
+
+ pGC = GetScratchGC(8, pScreen);
+
+ pScreenPriv->LockPrivate++; /* don't modify this one */
+ ValidateGC((DrawablePtr)pixPriv->pix32, pGC);
+
+ (*pGC->ops->CopyArea)((DrawablePtr)pix8, (DrawablePtr)pixPriv->pix32,
+ pGC, 0, 0, pix8->drawable.width, pix8->drawable.height, 0, 0);
+ pScreenPriv->LockPrivate--;
+ FreeScratchGC(pGC);
+
+ pixPriv->dirty &= ~IS_DIRTY;
+ pixPriv->pix32->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ }
+
+ return pixPriv->pix32;
+}
+
+
+static void
+OverlayValidateGC(
+ GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDraw
+){
+ OverlayScreenPtr pScreenPriv = OVERLAY_GET_SCREEN_PRIVATE(pGC->pScreen);
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+
+ if(pScreenPriv->LockPrivate < 0) {
+ ErrorF("Something is wrong in OverlayValidateGC!\n");
+ pScreenPriv->LockPrivate = 0;
+ }
+
+ if(pGC->depth == 24) {
+ unsigned long oldpm = pGC->planemask;
+ pGCPriv->overlayOps = NULL;
+
+ if(pDraw->type == DRAWABLE_WINDOW)
+ pGC->planemask &= 0x00ffffff;
+ else
+ pGC->planemask |= 0xff000000;
+
+ if(oldpm != pGC->planemask) changes |= GCPlaneMask;
+
+ (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
+
+ } else { /* depth == 8 */
+ unsigned long newChanges = 0;
+
+ if(pDraw->bitsPerPixel == 32) {
+
+ if(pGC->fillStyle == FillTiled)
+ pGCPriv->tile = OverlayRefreshPixmap(pGC->tile.pixmap);
+ else pGCPriv->tile = NULL;
+
+ if(pGCPriv->overlayOps != &WindowGCOps) {
+ newChanges = GCForeground | GCBackground | GCPlaneMask;
+ if(pGCPriv->tile)
+ newChanges |= GCTile;
+ }
+ pGCPriv->overlayOps = &WindowGCOps;
+
+ if(!pScreenPriv->LockPrivate) {
+ unsigned long oldfg = pGC->fgPixel;
+ unsigned long oldbg = pGC->bgPixel;
+ unsigned long oldpm = pGC->planemask;
+ PixmapPtr oldtile = pGC->tile.pixmap;
+
+ pGC->fgPixel = pGCPriv->fg = oldfg << 24;
+ pGC->bgPixel = pGCPriv->bg = oldbg << 24;
+ pGC->planemask = pGCPriv->pm = oldpm << 24;
+ if(pGCPriv->tile)
+ pGC->tile.pixmap = pGCPriv->tile;
+
+ (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
+
+ pGC->fgPixel = oldfg;
+ pGC->bgPixel = oldbg;
+ pGC->planemask = oldpm;
+ pGC->tile.pixmap = oldtile;
+ } else {
+ pGCPriv->fg = pGC->fgPixel;
+ pGCPriv->bg = pGC->bgPixel;
+ pGCPriv->pm = pGC->planemask;
+
+ (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
+ }
+
+ } else { /* bitsPerPixel == 8 */
+ if(pGCPriv->overlayOps == &WindowGCOps) {
+ newChanges = GCForeground | GCBackground | GCPlaneMask;
+ if(pGCPriv->tile)
+ newChanges |= GCTile;
+ }
+ pGCPriv->overlayOps = &PixmapGCOps;
+
+ (*pGC->funcs->ValidateGC)(pGC, changes | newChanges, pDraw);
+ }
+ }
+
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+
+static void
+OverlayDestroyGC(GCPtr pGC)
+{
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->DestroyGC)(pGC);
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+OverlayChangeGC (
+ GCPtr pGC,
+ unsigned long mask
+){
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeGC) (pGC, mask);
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+OverlayCopyGC (
+ GCPtr pGCSrc,
+ unsigned long mask,
+ GCPtr pGCDst
+){
+ OVERLAY_GC_FUNC_PROLOGUE (pGCDst);
+ (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
+ OVERLAY_GC_FUNC_EPILOGUE (pGCDst);
+}
+static void
+OverlayChangeClip (
+ GCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects
+){
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+ (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+static void
+OverlayCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
+{
+ OVERLAY_GC_FUNC_PROLOGUE (pgcDst);
+ (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
+ OVERLAY_GC_FUNC_EPILOGUE (pgcDst);
+}
+
+static void
+OverlayDestroyClip(GCPtr pGC)
+{
+ OVERLAY_GC_FUNC_PROLOGUE (pGC);
+ (* pGC->funcs->DestroyClip)(pGC);
+ OVERLAY_GC_FUNC_EPILOGUE (pGC);
+}
+
+
+
+/******************* Window GC ops ***********************/
+
+static void
+WindowFillSpans(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowSetSpans(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static RegionPtr
+WindowCopyArea(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+ RegionPtr ret;
+
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->CopyArea)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static RegionPtr
+WindowCopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ RegionPtr ret;
+
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+WindowPolyPoint(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolylines(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolySegment(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyRectangle(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowFillPolygon(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyFillArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static int
+WindowPolyText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ int ret;
+
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static int
+WindowPolyText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ int ret;
+
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+WindowImageText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowImageText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowImageGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPolyGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+WindowPushPixels(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg
+){
+ WINDOW_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ WINDOW_GC_OP_EPILOGUE(pGC);
+}
+
+
+/******************* Pixmap GC ops ***********************/
+
+static void
+PixmapFillSpans(
+ DrawablePtr pDraw,
+ GC *pGC,
+ int nInit,
+ DDXPointPtr pptInit,
+ int *pwidthInit,
+ int fSorted
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapSetSpans(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ char *pcharsrc,
+ register DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ int fSorted
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPutImage(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h,
+ int leftPad,
+ int format,
+ char *pImage
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
+ leftPad, format, pImage);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static RegionPtr
+PixmapCopyArea(
+ DrawablePtr pSrc,
+ DrawablePtr pDraw,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty
+){
+ RegionPtr ret;
+
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->CopyArea)(pSrc, pDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static RegionPtr
+PixmapCopyPlane(
+ DrawablePtr pSrc,
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ unsigned long bitPlane
+){
+ RegionPtr ret;
+
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->CopyPlane)(pSrc, pDraw,
+ pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+PixmapPolyPoint(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ xPoint *pptInit
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolylines(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pptInit
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolySegment(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nseg,
+ xSegment *pSeg
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyRectangle(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nRectsInit,
+ xRectangle *pRectsInit
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapFillPolygon(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int shape,
+ int mode,
+ int count,
+ DDXPointPtr ptsIn
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyFillRect(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int nrectFill,
+ xRectangle *prectInit
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyFillArc(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int narcs,
+ xArc *parcs
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static int
+PixmapPolyText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ int ret;
+
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static int
+PixmapPolyText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ int ret;
+
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+ return ret;
+}
+
+static void
+PixmapImageText8(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ char *chars
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapImageText16(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int x,
+ int y,
+ int count,
+ unsigned short *chars
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapImageGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPolyGlyphBlt(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xInit, int yInit,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ pointer pglyphBase
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph,
+ ppci, pglyphBase);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+static void
+PixmapPushPixels(
+ GCPtr pGC,
+ PixmapPtr pBitMap,
+ DrawablePtr pDraw,
+ int dx, int dy, int xOrg, int yOrg
+){
+ PIXMAP_GC_OP_PROLOGUE(pGC);
+ (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
+ PIXMAP_GC_OP_EPILOGUE(pGC);
+}
+
+
diff --git a/hw/xfree86/xf8_32wid/cfb8_32wid.h b/hw/xfree86/xf8_32wid/cfb8_32wid.h
new file mode 100644
index 000000000..9913c2a6c
--- /dev/null
+++ b/hw/xfree86/xf8_32wid/cfb8_32wid.h
@@ -0,0 +1,93 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfb8_32wid.h,v 1.1 2000/05/21 01:02:43 mvojkovi Exp $ */
+
+#ifndef _CFB8_32WID_H
+#define _CFB8_32WID_H
+
+#include "regionstr.h"
+#include "windowstr.h"
+
+typedef struct {
+ unsigned int (*WidGet)(WindowPtr);
+ Bool (*WidAlloc)(WindowPtr);
+ void (*WidFree)(WindowPtr);
+ void (*WidFillBox)(DrawablePtr, DrawablePtr, int, BoxPtr);
+ void (*WidCopyArea)(DrawablePtr, RegionPtr, DDXPointPtr);
+} cfb8_32WidOps;
+
+typedef struct {
+ pointer pix8;
+ int width8;
+ pointer pix32;
+ int width32;
+
+ /* WID information */
+ pointer pixWid;
+ int widthWid;
+ int bitsPerWid;
+ cfb8_32WidOps *WIDOps;
+} cfb8_32WidScreenRec, *cfb8_32WidScreenPtr;
+
+extern int cfb8_32WidScreenPrivateIndex;
+
+Bool
+cfb8_32WidScreenInit (
+ ScreenPtr pScreen,
+ pointer pbits32,
+ pointer pbits8,
+ pointer pbitsWid,
+ int xsize, int ysize,
+ int dpix, int dpiy,
+ int width32,
+ int width8,
+ int widthWid,
+ int bitsPerWid,
+ cfb8_32WidOps *WIDOps
+);
+
+/* cfbwindow.c */
+
+void
+cfb8_32WidPaintWindow (
+ WindowPtr pWin,
+ RegionPtr pRegion,
+ int what
+);
+
+Bool cfb8_32WidCreateWindow(WindowPtr pWin);
+Bool cfb8_32WidDestroyWindow(WindowPtr pWin);
+
+Bool
+cfb8_32WidPositionWindow(
+ WindowPtr pWin,
+ int x, int y
+);
+
+void
+cfb8_32WidCopyWindow(
+ WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc
+);
+
+Bool
+cfb8_32WidChangeWindowAttributes(
+ WindowPtr pWin,
+ unsigned long mask
+);
+
+void
+cfb8_32WidWindowExposures(
+ WindowPtr pWin,
+ RegionPtr pReg,
+ RegionPtr pOtherReg
+);
+
+/* cfbwid.c */
+
+Bool
+cfb8_32WidGenericOpsInit(cfb8_32WidScreenPtr pScreenPriv);
+
+#define CFB8_32WID_GET_SCREEN_PRIVATE(pScreen)\
+ (cfb8_32WidScreenPtr)((pScreen)->devPrivates[cfb8_32WidScreenPrivateIndex].ptr)
+
+#endif /* _CFB8_32WID_H */
diff --git a/hw/xfree86/xf8_32wid/cfb8_32widmodule.c b/hw/xfree86/xf8_32wid/cfb8_32widmodule.c
new file mode 100644
index 000000000..5a47b9ff5
--- /dev/null
+++ b/hw/xfree86/xf8_32wid/cfb8_32widmodule.c
@@ -0,0 +1,46 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfb8_32widmodule.c,v 1.1 2000/05/21 01:02:43 mvojkovi Exp $ */
+
+#ifdef XFree86LOADER
+
+#include "xf86Module.h"
+
+static MODULESETUPPROTO(xf8_32widSetup);
+
+static XF86ModuleVersionInfo VersRec =
+{
+ "xf8_32wid",
+ MODULEVENDORSTRING,
+ MODINFOSTRING1,
+ MODINFOSTRING2,
+ XF86_VERSION_CURRENT,
+ 1, 0, 0,
+ ABI_CLASS_ANSIC, /* Only need the ansic layer */
+ ABI_ANSIC_VERSION,
+ NULL,
+ {0,0,0,0} /* signature, to be patched into the file by a tool */
+};
+
+XF86ModuleData xf8_32widModuleData = { &VersRec, xf8_32widSetup, NULL };
+
+static pointer
+xf8_32widSetup(pointer module, pointer opts, int *errmaj, int *errmin)
+{
+ if (!LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ if (!LoadSubModule(module, "cfb", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ if (!LoadSubModule(module, "cfb16", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ if (!LoadSubModule(module, "cfb24", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ if (!LoadSubModule(module, "cfb32", NULL, NULL, NULL, NULL,
+ errmaj, errmin))
+ return NULL;
+ return (pointer)1; /* non-NULL required to indicate success */
+}
+
+#endif
diff --git a/hw/xfree86/xf8_32wid/cfbscrinit.c b/hw/xfree86/xf8_32wid/cfbscrinit.c
new file mode 100644
index 000000000..93c15371d
--- /dev/null
+++ b/hw/xfree86/xf8_32wid/cfbscrinit.c
@@ -0,0 +1,382 @@
+/*
+ Copyright (C) 1999. The XFree86 Project Inc.
+
+ Written by David S. Miller (davem@redhat.com)
+
+ Based largely upon the xf8_16bpp module which is
+ Mark Vojkovich's work.
+*/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbscrinit.c,v 1.1 2000/05/21 01:02:43 mvojkovi Exp $ */
+
+#include "X.h"
+#include "Xmd.h"
+#include "misc.h"
+#include "servermd.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "resource.h"
+#include "colormap.h"
+#include "colormapst.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32wid.h"
+#include "mi.h"
+#include "micmap.h"
+#include "mistruct.h"
+#include "gcstruct.h"
+#include "dix.h"
+#include "mibstore.h"
+#include "xf86str.h"
+#include "xf86.h"
+
+/* CAUTION: We require that cfb8 and cfb32 were NOT
+ compiled with CFB_NEED_SCREEN_PRIVATE */
+
+int cfb8_32WidScreenPrivateIndex;
+
+static unsigned long cfb8_32WidGeneration = 0;
+extern WindowPtr *WindowTable;
+
+static PixmapPtr cfb8_32WidGetWindowPixmap(WindowPtr pWin);
+
+static void
+cfb8_32WidSaveAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnSave,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+
+static void
+cfb8_32WidRestoreAreas(
+ PixmapPtr pPixmap,
+ RegionPtr prgnRestore,
+ int xorg,
+ int yorg,
+ WindowPtr pWin
+);
+
+static BSFuncRec cfb8_32WidBSFuncRec = {
+ cfb8_32WidSaveAreas,
+ cfb8_32WidRestoreAreas,
+ (BackingStoreSetClipmaskRgnProcPtr) 0,
+ (BackingStoreGetImagePixmapProcPtr) 0,
+ (BackingStoreGetSpansPixmapProcPtr) 0,
+};
+
+static void
+cfb8_32WidGetSpans(
+ DrawablePtr pDraw,
+ int wMax,
+ DDXPointPtr ppt,
+ int *pwidth,
+ int nspans,
+ char *pchardstStart
+);
+
+static void
+cfb8_32WidGetImage (
+ DrawablePtr pDraw,
+ int sx, int sy, int w, int h,
+ unsigned int format,
+ unsigned long planeMask,
+ char *pdstLine
+);
+
+static Bool cfb8_32WidCreateGC(GCPtr pGC);
+static void cfb8_32WidEnableDisableFBAccess(int index, Bool enable);
+
+
+static Bool
+cfb8_32WidAllocatePrivates(ScreenPtr pScreen)
+{
+ cfb8_32WidScreenPtr pScreenPriv;
+
+ if (cfb8_32WidGeneration != serverGeneration) {
+ if ((cfb8_32WidScreenPrivateIndex = AllocateScreenPrivateIndex()) < 0)
+ return FALSE;
+ cfb8_32WidGeneration = serverGeneration;
+ }
+
+ if (!(pScreenPriv = xalloc(sizeof(cfb8_32WidScreenRec))))
+ return FALSE;
+
+ pScreen->devPrivates[cfb8_32WidScreenPrivateIndex].ptr = (pointer)pScreenPriv;
+
+ /* All cfb will have the same GC and Window private indicies */
+ if (!mfbAllocatePrivates(pScreen, &cfbWindowPrivateIndex, &cfbGCPrivateIndex))
+ return FALSE;
+
+ /* The cfb indicies are the mfb indicies. Reallocating them resizes them */
+ if (!AllocateWindowPrivate(pScreen, cfbWindowPrivateIndex, sizeof(cfbPrivWin)))
+ return FALSE;
+
+ if (!AllocateGCPrivate(pScreen, cfbGCPrivateIndex, sizeof(cfbPrivGC)))
+ return FALSE;
+
+ return TRUE;
+}
+
+static Bool
+cfb8_32WidSetupScreen(
+ ScreenPtr pScreen,
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy
+){
+ if (!cfb8_32WidAllocatePrivates(pScreen))
+ return FALSE;
+
+ pScreen->defColormap = FakeClientID(0);
+
+ /* let CreateDefColormap do whatever it wants for pixels */
+ pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
+ pScreen->QueryBestSize = mfbQueryBestSize;
+
+ /* SaveScreen */
+ pScreen->GetImage = cfb8_32WidGetImage;
+ pScreen->GetSpans = cfb8_32WidGetSpans;
+ pScreen->CreateWindow = cfb8_32WidCreateWindow;
+ pScreen->DestroyWindow = cfb8_32WidDestroyWindow;
+ pScreen->PositionWindow = cfb8_32WidPositionWindow;
+ pScreen->ChangeWindowAttributes = cfb8_32WidChangeWindowAttributes;
+ pScreen->RealizeWindow = cfb32MapWindow; /* OK */
+ pScreen->UnrealizeWindow = cfb32UnmapWindow; /* OK */
+ pScreen->PaintWindowBackground = cfb8_32WidPaintWindow;
+ pScreen->PaintWindowBorder = cfb8_32WidPaintWindow;
+ pScreen->CopyWindow = cfb8_32WidCopyWindow;
+ pScreen->CreatePixmap = cfb32CreatePixmap; /* OK */
+ pScreen->DestroyPixmap = cfb32DestroyPixmap; /* OK */
+ pScreen->RealizeFont = mfbRealizeFont;
+ pScreen->UnrealizeFont = mfbUnrealizeFont;
+ pScreen->CreateGC = cfb8_32WidCreateGC;
+ pScreen->CreateColormap = miInitializeColormap;
+ pScreen->DestroyColormap = (void (*)())NoopDDA;
+ pScreen->InstallColormap = miInstallColormap;
+ pScreen->UninstallColormap = miUninstallColormap;
+ pScreen->ListInstalledColormaps = miListInstalledColormaps;
+ pScreen->StoreColors = (void (*)())NoopDDA;
+ pScreen->ResolveColor = miResolveColor;
+ pScreen->BitmapToRegion = mfbPixmapToRegion;
+
+ mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane);
+ return TRUE;
+}
+
+static Bool
+cfb8_32WidCreateScreenResources(ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+ PixmapPtr pix8, pix32, pixWid;
+
+ xfree(pScreen->devPrivate); /* freeing miScreenInitParmsRec */
+
+ pix8 = (*pScreen->CreatePixmap)(pScreen, 0, 0, 8);
+ pix32 = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScrn->depth);
+ pixWid = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreenPriv->bitsPerWid);
+ if (!pix32 || !pix8 || !pixWid)
+ return FALSE;
+
+ pix8->drawable.width = pScreen->width;
+ pix8->drawable.height = pScreen->height;
+ pix8->devKind = pScreenPriv->width8;
+ pix8->devPrivate.ptr = pScreenPriv->pix8;
+
+ pix32->drawable.width = pScreen->width;
+ pix32->drawable.height = pScreen->height;
+ pix32->devKind = pScreenPriv->width32 * 4;
+ pix32->devPrivate.ptr = pScreenPriv->pix32;
+
+ pixWid->drawable.width = pScreen->width;
+ pixWid->drawable.height = pScreen->height;
+ pixWid->devKind = (pScreenPriv->widthWid * pScreenPriv->bitsPerWid) / 8;
+ pixWid->devPrivate.ptr = pScreenPriv->pixWid;
+
+ pScreenPriv->pix8 = (pointer) pix8;
+ pScreenPriv->pix32 = (pointer) pix32;
+ pScreenPriv->pixWid = (pointer) pixWid;
+
+ pScreen->devPrivate = (pointer) pix32;
+
+ return TRUE;
+}
+
+
+static Bool
+cfb8_32WidCloseScreen (int i, ScreenPtr pScreen)
+{
+ cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+
+ xfree((pointer) pScreenPriv);
+
+ return cfb32CloseScreen(i, pScreen);
+}
+
+static Bool
+cfb8_32WidFinishScreenInit(
+ ScreenPtr pScreen,
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy /* dots per inch */
+){
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ VisualPtr visuals;
+ DepthPtr depths;
+ int nvisuals;
+ int ndepths;
+ int rootdepth;
+ VisualID defaultVisual;
+
+ rootdepth = 0;
+ if (!miInitVisuals(&visuals, &depths, &nvisuals, &ndepths, &rootdepth,
+ &defaultVisual,((unsigned long)1<<(32-1)), 8, -1))
+ return FALSE;
+
+ if (!miScreenInit(pScreen, NULL, xsize, ysize, dpix, dpiy, 0,
+ rootdepth, ndepths, depths,
+ defaultVisual, nvisuals, visuals))
+ return FALSE;
+
+ pScreen->BackingStoreFuncs = cfb8_32WidBSFuncRec;
+ pScreen->CreateScreenResources = cfb8_32WidCreateScreenResources;
+ pScreen->CloseScreen = cfb8_32WidCloseScreen;
+ pScreen->GetWindowPixmap = cfb8_32WidGetWindowPixmap;
+ pScreen->WindowExposures = cfb8_32WidWindowExposures;
+
+ pScrn->EnableDisableFBAccess = cfb8_32WidEnableDisableFBAccess;
+
+ return TRUE;
+}
+
+Bool
+cfb8_32WidScreenInit(
+ ScreenPtr pScreen,
+ pointer pbits32, /* pointer to screen bitmap */
+ pointer pbits8,
+ pointer pbitsWid, /* pointer to WID bitmap */
+ int xsize, int ysize, /* in pixels */
+ int dpix, int dpiy, /* dots per inch */
+ int width32, /* pixel width of frame buffer */
+ int width8,
+ int widthWid,
+ int bitsPerWid,
+ cfb8_32WidOps *WIDOps
+){
+ cfb8_32WidScreenPtr pScreenPriv;
+
+ if (!WIDOps || !WIDOps->WidGet || !WIDOps->WidAlloc || !WIDOps->WidFree)
+ return FALSE;
+
+ if (!cfb8_32WidSetupScreen(pScreen, xsize, ysize, dpix, dpiy))
+ return FALSE;
+
+ pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+ pScreenPriv->pix8 = pbits8;
+ pScreenPriv->pix32 = pbits32;
+ pScreenPriv->pixWid = pbitsWid;
+ pScreenPriv->width8 = width8;
+ pScreenPriv->width32 = width32;
+ pScreenPriv->widthWid = widthWid;
+ pScreenPriv->bitsPerWid = bitsPerWid;
+
+ pScreenPriv->WIDOps = xalloc(sizeof(cfb8_32WidOps));
+ if (!pScreenPriv->WIDOps)
+ return FALSE;
+
+ *(pScreenPriv->WIDOps) = *WIDOps;
+
+ if (!WIDOps->WidFillBox || !WIDOps->WidCopyArea)
+ cfb8_32WidGenericOpsInit(pScreenPriv);
+
+ return cfb8_32WidFinishScreenInit(pScreen, xsize, ysize, dpix, dpiy);
+}
+
+static PixmapPtr
+cfb8_32WidGetWindowPixmap(WindowPtr pWin)
+{
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+
+ return ((pWin->drawable.bitsPerPixel == 8) ?
+ (PixmapPtr) pScreenPriv->pix8 : (PixmapPtr) pScreenPriv->pix32);
+}
+
+static void
+cfb8_32WidGetImage (DrawablePtr pDraw, int sx, int sy, int w, int h,
+ unsigned int format, unsigned long planemask, char *pdstLine)
+{
+ if (!w || !h)
+ return;
+
+ if (pDraw->bitsPerPixel == 8)
+ cfbGetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+ else
+ cfb32GetImage(pDraw, sx, sy, w, h, format, planemask, pdstLine);
+}
+
+static void
+cfb8_32WidGetSpans(DrawablePtr pDraw, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pDst)
+{
+ if (pDraw->bitsPerPixel == 8)
+ cfbGetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+ else
+ cfb32GetSpans(pDraw, wMax, ppt, pwidth, nspans, pDst);
+}
+
+static void
+cfb8_32WidSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, WindowPtr pWin)
+{
+ if (pWin->drawable.bitsPerPixel == 8)
+ cfbSaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
+ else
+ cfb32SaveAreas(pPixmap, prgnSave, xorg, yorg, pWin);
+}
+
+static void
+cfb8_32WidRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int yorg, WindowPtr pWin)
+{
+ if (pWin->drawable.bitsPerPixel == 8)
+ cfbRestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
+ else
+ cfb32RestoreAreas(pPixmap, prgnRestore, xorg, yorg, pWin);
+}
+
+
+static Bool
+cfb8_32WidCreateGC(GCPtr pGC)
+{
+ if (pGC->depth == 8)
+ return cfbCreateGC(pGC);
+ else
+ return cfb32CreateGC(pGC);
+}
+
+static void
+cfb8_32WidEnableDisableFBAccess(int index, Bool enable)
+{
+ ScreenPtr pScreen = xf86Screens[index]->pScreen;
+ cfb8_32WidScreenPtr pScreenPriv = CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+ static DevUnion devPrivates8[MAXSCREENS];
+ static DevUnion devPrivates32[MAXSCREENS];
+ PixmapPtr pix8, pix32;
+
+ pix8 = (PixmapPtr) pScreenPriv->pix8;
+ pix32 = (PixmapPtr) pScreenPriv->pix32;
+
+ if (enable) {
+ pix8->devPrivate = devPrivates8[index];
+ pix32->devPrivate = devPrivates32[index];
+ }
+
+ xf86EnableDisableFBAccess (index, enable);
+
+ if (!enable) {
+ devPrivates8[index] = pix8->devPrivate;
+ pix8->devPrivate.ptr = 0;
+ devPrivates32[index] = pix32->devPrivate;
+ pix32->devPrivate.ptr = 0;
+ }
+}
diff --git a/hw/xfree86/xf8_32wid/cfbwid.c b/hw/xfree86/xf8_32wid/cfbwid.c
new file mode 100644
index 000000000..0aa894176
--- /dev/null
+++ b/hw/xfree86/xf8_32wid/cfbwid.c
@@ -0,0 +1,147 @@
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbwid.c,v 1.1 2000/05/21 01:02:44 mvojkovi Exp $ */
+
+#include "X.h"
+#include "Xmd.h"
+#include "misc.h"
+#include "servermd.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "resource.h"
+#include "colormap.h"
+#include "colormapst.h"
+
+#include "mfb.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb16.h"
+#include "cfb24.h"
+#include "cfb32.h"
+
+#include "cfb8_32wid.h"
+
+static void
+WidFillBox1(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
+{
+ WindowPtr pWin = (WindowPtr) pWinDraw;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+ unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
+
+ if (wid & 1)
+ mfbSolidWhiteArea((DrawablePtr)pWin, nbox, pBox, GXset, NullPixmap);
+ else
+ mfbSolidBlackArea((DrawablePtr)pWin, nbox, pBox, GXset, NullPixmap);
+}
+
+static void
+WidCopyArea1(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
+{
+ mfbDoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc);
+}
+
+static void
+WidFillBox8(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
+{
+ WindowPtr pWin = (WindowPtr) pWinDraw;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+ unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
+
+ cfbFillBoxSolid(pixWid, nbox, pBox, wid);
+}
+
+static void
+WidCopyArea8(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
+{
+ cfbDoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
+}
+
+static void
+WidFillBox16(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
+{
+ WindowPtr pWin = (WindowPtr) pWinDraw;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+ unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
+
+ cfb16FillBoxSolid(pixWid, nbox, pBox, wid);
+}
+
+static void
+WidCopyArea16(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
+{
+ cfb16DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
+}
+
+static void
+WidFillBox24(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
+{
+ WindowPtr pWin = (WindowPtr) pWinDraw;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+ unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
+
+ cfb24FillBoxSolid(pixWid, nbox, pBox, wid);
+}
+
+static void
+WidCopyArea24(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
+{
+ cfb24DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
+}
+
+static void
+WidFillBox32(DrawablePtr pixWid, DrawablePtr pWinDraw, int nbox, BoxPtr pBox)
+{
+ WindowPtr pWin = (WindowPtr) pWinDraw;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pWin->drawable.pScreen);
+ unsigned int wid = pScreenPriv->WIDOps->WidGet(pWin);
+
+ cfb32FillBoxSolid(pixWid, nbox, pBox, wid);
+}
+
+static void
+WidCopyArea32(DrawablePtr pixWid, RegionPtr pRgn, DDXPointPtr pptSrc)
+{
+ cfb32DoBitbltCopy(pixWid, pixWid, GXcopy, pRgn, pptSrc, ~0L);
+}
+
+Bool
+cfb8_32WidGenericOpsInit(cfb8_32WidScreenPtr pScreenPriv)
+{
+ cfb8_32WidOps *WIDOps = pScreenPriv->WIDOps;
+
+ switch (pScreenPriv->bitsPerWid) {
+ case 1:
+ WIDOps->WidFillBox = WidFillBox1;
+ WIDOps->WidCopyArea = WidCopyArea1;
+ break;
+
+ case 8:
+ WIDOps->WidFillBox = WidFillBox8;
+ WIDOps->WidCopyArea = WidCopyArea8;
+ break;
+
+ case 16:
+ WIDOps->WidFillBox = WidFillBox16;
+ WIDOps->WidCopyArea = WidCopyArea16;
+ break;
+
+ case 24:
+ WIDOps->WidFillBox = WidFillBox24;
+ WIDOps->WidCopyArea = WidCopyArea24;
+ break;
+
+ case 32:
+ WIDOps->WidFillBox = WidFillBox32;
+ WIDOps->WidCopyArea = WidCopyArea32;
+ break;
+
+ default:
+ return FALSE;
+ };
+
+ return TRUE;
+}
diff --git a/hw/xfree86/xf8_32wid/cfbwindow.c b/hw/xfree86/xf8_32wid/cfbwindow.c
new file mode 100644
index 000000000..74db57649
--- /dev/null
+++ b/hw/xfree86/xf8_32wid/cfbwindow.c
@@ -0,0 +1,284 @@
+/*
+ Copyright (C) 1999. The XFree86 Project Inc.
+
+ Written by David S. Miller (davem@redhat.com)
+
+ Based largely upon the xf8_16bpp module which is
+ Mark Vojkovich's work.
+*/
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/xf8_32wid/cfbwindow.c,v 1.2 2001/10/28 03:34:09 tsi Exp $ */
+
+#include "X.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#define PSZ 8
+#include "cfb.h"
+#undef PSZ
+#include "cfb32.h"
+#include "cfb8_32wid.h"
+#include "mistruct.h"
+#include "regionstr.h"
+#include "cfbmskbits.h"
+#include "xf86.h"
+
+/* We don't bother with cfb's fastBackground/Border so we don't
+ need to use the Window privates */
+
+Bool
+cfb8_32WidCreateWindow(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+ cfbPrivWin *pPrivWin = cfbGetWindowPrivate(pWin);
+
+ pPrivWin->fastBackground = FALSE;
+ pPrivWin->fastBorder = FALSE;
+
+ if (!pScreenPriv->WIDOps->WidAlloc(pWin))
+ return FALSE;
+
+ return TRUE;
+}
+
+
+Bool
+cfb8_32WidDestroyWindow(WindowPtr pWin)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+
+ pScreenPriv->WIDOps->WidFree(pWin);
+ return TRUE;
+}
+
+Bool
+cfb8_32WidPositionWindow(WindowPtr pWin, int x, int y)
+{
+ return TRUE;
+}
+
+static void
+SegregateChildrenBpp(WindowPtr pWin, RegionPtr pReg, int subtract, int bpp, int other_bpp)
+{
+ WindowPtr pChild;
+
+ for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) {
+ if (pChild->drawable.bitsPerPixel == bpp) {
+ if (subtract) {
+ REGION_SUBTRACT(pWin->drawable.pScreen, pReg,
+ pReg, &pChild->borderClip);
+ } else {
+ REGION_UNION(pWin->drawable.pScreen, pReg,
+ pReg, &pChild->borderClip);
+ }
+ if (pChild->firstChild)
+ SegregateChildrenBpp(pChild, pReg,
+ !subtract, other_bpp, bpp);
+ } else {
+ if (pChild->firstChild)
+ SegregateChildrenBpp(pChild, pReg,
+ subtract, bpp, other_bpp);
+ }
+ }
+}
+
+void
+cfb8_32WidCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ PixmapPtr pPixChildren;
+ DDXPointPtr ppt, pptSrc;
+ RegionRec rgnDst, rgnOther, rgnPixmap;
+ BoxPtr pbox;
+ int i, nbox, dx, dy, other_bpp;
+
+ REGION_INIT(pScreen, &rgnDst, NullBox, 0);
+
+ dx = ptOldOrg.x - pWin->drawable.x;
+ dy = ptOldOrg.y - pWin->drawable.y;
+ REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
+
+ if ((nbox = REGION_NUM_RECTS(&rgnDst)) == 0) {
+ /* Nothing to render. */
+ REGION_UNINIT(pScreen, &rgnDst);
+ return;
+ }
+
+ /* First, copy the WID plane for the whole area. */
+ pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec));
+ if(pptSrc) {
+ pbox = REGION_RECTS(&rgnDst);
+ for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ pScreenPriv->WIDOps->WidCopyArea((DrawablePtr)pScreenPriv->pixWid,
+ &rgnDst, pptSrc);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ /* Next, we copy children which have a different
+ * bpp than pWin into a temporary pixmap. We will
+ * toss this pixmap back onto the framebuffer before
+ * we return.
+ */
+ if (pWin->drawable.bitsPerPixel == 8)
+ other_bpp = pScrn->bitsPerPixel;
+ else
+ other_bpp = 8;
+
+ REGION_INIT(pScreen, &rgnOther, NullBox, 0);
+ SegregateChildrenBpp(pWin, &rgnOther, 0,
+ other_bpp, pWin->drawable.bitsPerPixel);
+ pPixChildren = NULL;
+ if (REGION_NOTEMPTY(pScreen, &rgnOther)) {
+ REGION_INTERSECT(pScreen, &rgnOther, &rgnOther, prgnSrc);
+ nbox = REGION_NUM_RECTS(&rgnOther);
+ if (nbox) {
+ int width = rgnOther.extents.x2 - rgnOther.extents.x1;
+ int height = rgnOther.extents.y2 - rgnOther.extents.y1;
+ int depth = (other_bpp == 8) ? 8 : pScrn->depth;
+
+ if (other_bpp == 8)
+ pPixChildren = cfbCreatePixmap(pScreen, width, height, depth);
+ else
+ pPixChildren = cfb32CreatePixmap(pScreen, width, height, depth);
+ }
+ if (nbox &&
+ pPixChildren &&
+ (pptSrc = (DDXPointPtr) ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
+ pbox = REGION_RECTS(&rgnOther);
+ for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ REGION_INIT(pScreen, &rgnPixmap, NullBox, 0);
+ REGION_COPY(pScreen, &rgnPixmap, &rgnOther);
+ REGION_TRANSLATE(pScreen, &rgnPixmap, -(rgnOther.extents.x1), -(rgnOther.extents.y1));
+
+ if (other_bpp == 8)
+ cfbDoBitbltCopy((DrawablePtr)pScreenPriv->pix8,
+ (DrawablePtr)pPixChildren,
+ GXcopy, &rgnPixmap, pptSrc, ~0L);
+ else
+ cfb32DoBitbltCopy((DrawablePtr)pScreenPriv->pix32,
+ (DrawablePtr)pPixChildren,
+ GXcopy, &rgnPixmap, pptSrc, ~0L);
+
+ REGION_UNINIT(pScreen, &rgnPixmap);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ REGION_SUBTRACT(pScreen, &rgnDst, &rgnDst, &rgnOther);
+ }
+
+ /* Now copy the parent along with all child windows using the same depth. */
+ nbox = REGION_NUM_RECTS(&rgnDst);
+ if(nbox &&
+ (pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) {
+ pbox = REGION_RECTS(&rgnDst);
+ for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+
+ if (pWin->drawable.bitsPerPixel == 8)
+ cfbDoBitbltCopy((DrawablePtr)pScreenPriv->pix8,
+ (DrawablePtr)pScreenPriv->pix8,
+ GXcopy, &rgnDst, pptSrc, ~0L);
+ else
+ cfb32DoBitbltCopy((DrawablePtr)pScreenPriv->pix32,
+ (DrawablePtr)pScreenPriv->pix32,
+ GXcopy, &rgnDst, pptSrc, ~0L);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ REGION_UNINIT(pScreen, &rgnDst);
+
+ if (pPixChildren) {
+ nbox = REGION_NUM_RECTS(&rgnOther);
+ pptSrc = (DDXPointPtr) ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec));
+ if (pptSrc) {
+ pbox = REGION_RECTS(&rgnOther);
+ for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
+ ppt->x = pbox->x1 - rgnOther.extents.x1;
+ ppt->y = pbox->y1 - rgnOther.extents.y1;
+ }
+
+ if (other_bpp == 8)
+ cfbDoBitbltCopy((DrawablePtr)pPixChildren,
+ (DrawablePtr)pScreenPriv->pix8,
+ GXcopy, &rgnOther, pptSrc, ~0L);
+ else
+ cfb32DoBitbltCopy((DrawablePtr)pPixChildren,
+ (DrawablePtr)pScreenPriv->pix32,
+ GXcopy, &rgnOther, pptSrc, ~0L);
+
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ if (other_bpp == 8)
+ cfbDestroyPixmap(pPixChildren);
+ else
+ cfb32DestroyPixmap(pPixChildren);
+ }
+ REGION_UNINIT(pScreen, &rgnOther);
+}
+
+Bool
+cfb8_32WidChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
+{
+ return TRUE;
+}
+
+void
+cfb8_32WidWindowExposures(WindowPtr pWin, RegionPtr pReg, RegionPtr pOtherReg)
+{
+ /* Fill in the WID channel before rendering of
+ * the exposed window area.
+ */
+ if (REGION_NUM_RECTS(pReg)) {
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+
+ pScreenPriv->WIDOps->WidFillBox((DrawablePtr)pScreenPriv->pixWid,
+ (DrawablePtr)pWin,
+ REGION_NUM_RECTS(pReg), REGION_RECTS(pReg));
+ }
+
+ miWindowExposures(pWin, pReg, pOtherReg);
+}
+
+void
+cfb8_32WidPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
+{
+ if (what == PW_BORDER) {
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ cfb8_32WidScreenPtr pScreenPriv =
+ CFB8_32WID_GET_SCREEN_PRIVATE(pScreen);
+
+ pScreenPriv->WIDOps->WidFillBox((DrawablePtr)pScreenPriv->pixWid,
+ (DrawablePtr)pWin,
+ REGION_NUM_RECTS(pRegion),
+ REGION_RECTS(pRegion));
+ }
+
+ if (pWin->drawable.bitsPerPixel == 8)
+ cfbPaintWindow(pWin, pRegion, what);
+ else
+ cfb32PaintWindow(pWin, pRegion, what);
+}
+
diff --git a/hw/xnest/XNCursor.h b/hw/xnest/XNCursor.h
new file mode 100644
index 000000000..5bf362e77
--- /dev/null
+++ b/hw/xnest/XNCursor.h
@@ -0,0 +1,38 @@
+/* $Xorg: Cursor.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
+/*
+
+Copyright 1993 by Davor Matic
+
+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. Davor Matic makes no representations about
+the suitability of this software for any purpose. It is provided "as
+is" without express or implied warranty.
+
+*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/XNCursor.h,v 1.2 2002/11/23 19:27:50 tsi Exp $ */
+
+#ifndef XNESTCURSOR_H
+#define XNESTCURSOR_H
+
+typedef struct {
+ Cursor cursor;
+} xnestPrivCursor;
+
+#define xnestCursorPriv(pCursor, pScreen) \
+ ((xnestPrivCursor *)((pCursor)->devPriv[pScreen->myNum]))
+
+#define xnestCursor(pCursor, pScreen) \
+ (xnestCursorPriv(pCursor, pScreen)->cursor)
+
+void xnestConstrainCursor();
+void xnestCursorLimits();
+Bool xnestDisplayCursor();
+Bool xnestRealizeCursor();
+Bool xnestUnrealizeCursor();
+void xnestRecolorCursor();
+Bool xnestSetCursorPosition();
+
+#endif /* XNESTCURSOR_H */
diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h
new file mode 100644
index 000000000..1657ae449
--- /dev/null
+++ b/hw/xnest/XNPixmap.h
@@ -0,0 +1,44 @@
+/* $Xorg: Pixmap.h,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
+/*
+
+Copyright 1993 by Davor Matic
+
+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. Davor Matic makes no representations about
+the suitability of this software for any purpose. It is provided "as
+is" without express or implied warranty.
+
+*/
+/* $XFree86: xc/programs/Xserver/hw/xnest/XNPixmap.h,v 1.3 2003/01/10 13:29:40 eich Exp $ */
+
+#ifndef XNESTPIXMAP_H
+#define XNESTPIXMAP_H
+
+#ifdef PIXPRIV
+extern int xnestPixmapPrivateIndex;
+#endif
+
+typedef struct {
+ Pixmap pixmap;
+} xnestPrivPixmap;
+
+#ifdef PIXPRIV
+#define xnestPixmapPriv(pPixmap) \
+ ((xnestPrivPixmap *)((pPixmap)->devPrivates[xnestPixmapPrivateIndex].ptr))
+#else
+#define xnestPixmapPriv(pPixmap) \
+ ((xnestPrivPixmap *)((pPixmap)->devPrivate.ptr))
+#endif
+
+#define xnestPixmap(pPixmap) (xnestPixmapPriv(pPixmap)->pixmap)
+
+#define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++)
+
+PixmapPtr xnestCreatePixmap();
+Bool xnestDestroyPixmap();
+RegionPtr xnestPixmapToRegion();
+
+#endif /* XNESTPIXMAP_H */
diff --git a/hw/xnest/os2Stub.c b/hw/xnest/os2Stub.c
new file mode 100644
index 000000000..b770f546f
--- /dev/null
+++ b/hw/xnest/os2Stub.c
@@ -0,0 +1,387 @@
+/*
+ * (c) Copyright 1996 by Sebastien Marineau
+ * <marineau@genie.uottawa.ca>
+ *
+ * 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
+ * HOLGER VEIT 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.
+ *
+ * Except as contained in this notice, the name of Sebastien Marineau shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Sebastien Marineau.
+ *
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xnest/os2Stub.c,v 3.1 2002/05/31 18:46:04 dawes Exp $ */
+
+/* This below implements select() for calls in xnest. It has been */
+/* somewhat optimized for improved performance, but assumes a few */
+/* things so it cannot be used as a general select. */
+
+#define I_NEED_OS2_H
+#include "Xpoll.h"
+#include <stdio.h>
+#include <sys/select.h>
+#include <sys/errno.h>
+#include <sys/time.h>
+#define INCL_DOSSEMAPHORES
+#define INCL_DOSNPIPES
+#define INCL_DOSMISC
+#define INCL_DOSMODULEMGR
+#undef BOOL
+#undef BYTE
+#include <os2.h>
+
+HEV hPipeSem;
+HMODULE hmod_so32dll;
+static int (*os2_tcp_select)(int*,int,int,int,long);
+ULONG os2_get_sys_millis();
+extern int _files[];
+
+#define MAX_TCP 256
+/* These lifted from sys/emx.h. Change if that changes there! */
+#define F_SOCKET 0x10000000
+#define F_PIPE 0x20000000
+
+struct select_data
+{
+ fd_set read_copy;
+ fd_set write_copy;
+ BOOL have_read;
+ BOOL have_write;
+ int tcp_select_mask[MAX_TCP];
+ int tcp_emx_handles[MAX_TCP];
+ int tcp_select_copy[MAX_TCP];
+ int socket_nread;
+ int socket_nwrite;
+ int socket_ntotal;
+ int pipe_ntotal;
+ int pipe_have_write;
+ int max_fds;
+};
+
+int os2PseudoSelect(int nfds, fd_set *readfds, fd_set *writefds,
+ fd_set *exceptfds, struct timeval *timeout)
+{
+static BOOL FirstTime=TRUE;
+static haveTCPIP=TRUE;
+ULONG timeout_ms;
+ULONG postCount, start_millis,now_millis;
+char faildata[16];
+struct select_data sd;
+BOOL any_ready;
+int np,ns, i,ready_handles,n;
+APIRET rc;
+
+sd.have_read=FALSE; sd.have_write=FALSE;
+sd.socket_nread=0; sd.socket_nwrite=0; sd.socket_ntotal=0;
+sd.max_fds=31; ready_handles=0; any_ready=FALSE;
+sd.pipe_ntotal=0; sd.pipe_have_write=FALSE;
+
+if(FirstTime){
+ /* First load the so32dll.dll module and get a pointer to the SELECT function */
+
+ if((rc=DosLoadModule(faildata,sizeof(faildata),"SO32DLL",&hmod_so32dll))!=0){
+ fprintf(stderr, "Could not load module so32dll.dll, rc = %d. Error note %s\n",rc,faildata);
+ haveTCPIP=FALSE;
+ }
+ if((rc = DosQueryProcAddr(hmod_so32dll, 0, "SELECT", (PPFN)&os2_tcp_select))!=0){
+ fprintf(stderr, "Could not query address of SELECT, rc = %d.\n",rc);
+ haveTCPIP=FALSE;
+ }
+ /* Call these a first time to set the semaphore */
+ /* rc = DosCreateEventSem(NULL, &hPipeSem, DC_SEM_SHARED, FALSE);
+ if(rc) {
+ fprintf(stderr, "Could not create event semaphore, rc=%d\n",rc);
+ return(-1);
+ }
+ rc = DosResetEventSem(hPipeSem, &postCount); */ /* Done in xtrans code for servers*/
+
+fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeSem);
+
+ FirstTime = FALSE;
+}
+
+/* Set up the time delay structs */
+
+ if(timeout!=NULL) {
+ timeout_ms=timeout->tv_sec*1000+timeout->tv_usec/1000;
+ }
+ else { timeout_ms=1000000; } /* This should be large enough... */
+ if(timeout_ms>0) start_millis=os2_get_sys_millis();
+
+/* Copy the masks */
+ {FD_ZERO(&sd.read_copy);}
+ {FD_ZERO(&sd.write_copy);}
+ if(readfds!=NULL){ XFD_COPYSET(readfds,&sd.read_copy); sd.have_read=TRUE;}
+ if(writefds!=NULL) {XFD_COPYSET(writefds,&sd.write_copy);sd.have_write=TRUE;}
+
+/* And zero the original masks */
+ if(sd.have_read){ FD_ZERO(readfds);}
+ if(sd.have_write) {FD_ZERO(writefds);}
+ if(exceptfds != NULL) {FD_ZERO(exceptfds);}
+
+/* Now we parse the fd_sets passed to select and separate pipe/sockets */
+ n = os2_parse_select(&sd,nfds);
+ if(n == -1) {
+ errno = EBADF;
+ return (-1);
+ }
+
+/* Now we have three cases: either we have sockets, pipes, or both */
+/* We handle all three cases differently to optimize things */
+
+/* Case 1: only pipes! */
+ if((sd.pipe_ntotal >0) && (!sd.socket_ntotal)){
+ np = os2_check_pipes(&sd,readfds,writefds);
+ if(np > 0){
+ return (np);
+ }
+ else if (np == -1) { return(-1); }
+ while(!any_ready){
+ rc = DosWaitEventSem(hPipeSem, timeout_ms);
+ /* if(rc) fprintf(stderr,"Sem-wait timeout, rc = %d\n",rc); */
+ if(rc == 640) {
+ return(0);
+ }
+ if((rc != 0) && (rc != 95)) {errno= EBADF; return(-1);}
+ np = os2_check_pipes(&sd,readfds,writefds);
+ if (np > 0){
+ return(np);
+ }
+ else if (np < 0){ return(-1); }
+ }
+ }
+
+/* Case 2: only sockets. Just let the os/2 tcp select do the work */
+ if((sd.socket_ntotal > 0) && (!sd.pipe_ntotal)){
+ ns = os2_check_sockets(&sd, readfds, writefds, timeout_ms);
+ return (ns);
+ }
+
+/* Case 3: combination of both */
+ if((sd.socket_ntotal > 0) && (sd.pipe_ntotal)){
+ np = os2_check_pipes(&sd,readfds,writefds);
+ if(np > 0){
+ any_ready=TRUE;
+ ready_handles += np;
+ }
+ else if (np == -1) { return(-1); }
+
+ ns = os2_check_sockets(&sd,readfds,writefds, 0);
+ if(ns>0){
+ ready_handles+=ns;
+ any_ready = TRUE;
+ }
+ else if (ns == -1) {return(-1);}
+
+ while (!any_ready && timeout_ms){
+
+ rc = DosWaitEventSem(hPipeSem, 10L);
+ if(rc == 0){
+ np = os2_check_pipes(&sd,readfds,writefds);
+ if(np > 0){
+ ready_handles+=np;
+ any_ready = TRUE;
+ }
+ else if (np == -1) {
+ return(-1); }
+ }
+
+ ns = os2_check_sockets(&sd,readfds,writefds,exceptfds, 0);
+ if(ns>0){
+ ready_handles+=ns;
+ any_ready = TRUE;
+ }
+ else if (ns == -1) {return(-1);}
+
+ if (i%8 == 0) {
+ now_millis = os2_get_sys_millis();
+ if((now_millis-start_millis) > timeout_ms) timeout_ms = 0;
+ }
+ i++;
+ }
+ }
+
+return(ready_handles);
+}
+
+
+ULONG os2_get_sys_millis()
+{
+ APIRET rc;
+ ULONG milli;
+
+ rc = DosQuerySysInfo(14, 14, &milli, sizeof(milli));
+ if(rc) {
+ fprintf(stderr,"Bad return code querying the millisecond counter! rc=%d\n",rc);
+ return(0);
+ }
+ return(milli);
+}
+
+int os2_parse_select(sd,nfds)
+struct select_data *sd;
+int nfds;
+{
+ int i;
+ APIRET rc;
+/* First we determine up to which descriptor we need to check. */
+/* No need to check up to 256 if we don't have to (and usually we dont...)*/
+/* Note: stuff here is hardcoded for fd_sets which are int[8] as in EMX! */
+
+ if(nfds > sd->max_fds){
+ for(i=0;i<((FD_SETSIZE+31)/32);i++){
+ if(sd->read_copy.fds_bits[i] ||
+ sd->write_copy.fds_bits[i])
+ sd->max_fds=(i*32) +32;
+ }
+ }
+ else { sd->max_fds = nfds; }
+/* Check if result is greater than specified in select() call */
+ if(sd->max_fds > nfds) sd->max_fds = nfds;
+
+ if (sd->have_read)
+ {
+ for (i = 0; i < sd->max_fds; ++i) {
+ if (FD_ISSET (i, &sd->read_copy)){
+ if(_files[i] & F_SOCKET)
+ {
+ sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i);
+ sd->tcp_emx_handles[sd->socket_ntotal]=i;
+ sd->socket_ntotal++; sd->socket_nread++;
+ }
+ else if (_files[i] & F_PIPE)
+ {
+ sd -> pipe_ntotal++;
+ /* rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i);
+ if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;} */
+ }
+ }
+ }
+ }
+
+ if (sd->have_write)
+ {
+ for (i = 0; i < sd->max_fds; ++i) {
+ if (FD_ISSET (i, &sd->write_copy)){
+ if(_files[i] & F_SOCKET)
+ {
+ sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i);
+ sd->tcp_emx_handles[sd->socket_ntotal]=i;
+ sd->socket_ntotal++; sd->socket_nwrite++;
+ }
+ else if (_files[i] & F_PIPE)
+ {
+ sd -> pipe_ntotal++;
+ /* rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i);
+ if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;} */
+ sd -> pipe_have_write=TRUE;
+ }
+ }
+ }
+ }
+
+
+return(sd->socket_ntotal);
+}
+
+
+int os2_check_sockets(sd,readfds,writefds)
+struct select_data *sd;
+fd_set *readfds,*writefds;
+{
+ int e,i;
+ int j,n;
+ memcpy(sd->tcp_select_copy,sd->tcp_select_mask,
+ sd->socket_ntotal*sizeof(int));
+
+ e = os2_tcp_select(sd->tcp_select_copy,sd->socket_nread,
+ sd->socket_nwrite, 0, 0);
+
+ if(e == 0) return(e);
+/* We have something ready? */
+ if(e>0){
+ j = 0; n = 0;
+ for (i = 0; i < sd->socket_nread; ++i, ++j)
+ if (sd->tcp_select_copy[j] != -1)
+ {
+ FD_SET (sd->tcp_emx_handles[j], readfds);
+ n ++;
+ }
+ for (i = 0; i < sd->socket_nwrite; ++i, ++j)
+ if (sd->tcp_select_copy[j] != -1)
+ {
+ FD_SET (sd->tcp_emx_handles[j], writefds);
+ n ++;
+ }
+ errno = 0;
+
+ return n;
+ }
+ if(e<0){
+ /*Error -- TODO. EBADF is a good choice for now. */
+ fprintf(stderr,"Error in server select! e=%d\n",e);
+ errno = EBADF;
+ return (-1);
+ }
+ }
+
+/* Check to see if anything is ready on pipes */
+
+int os2_check_pipes(sd,readfds,writefds)
+struct select_data *sd;
+fd_set *readfds,*writefds;
+{
+int i,e;
+ULONG ulPostCount;
+PIPESEMSTATE pipeSemState[128];
+APIRET rc;
+ e = 0;
+ rc = DosResetEventSem(hPipeSem,&ulPostCount);
+ rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState,
+ sizeof(pipeSemState));
+ if(rc) fprintf(stderr,"SELECT: rc from QueryNPipeSem: %d\n",rc);
+ i=0;
+ while (pipeSemState[i].fStatus != 0) {
+ /*fprintf(stderr,"SELECT: sem entry, stat=%d, flag=%d, key=%d,avail=%d\n",
+ pipeSemState[i].fStatus,pipeSemState[i].fFlag,pipeSemState[i].usKey,
+ pipeSemState[i].usAvail); */
+ if((pipeSemState[i].fStatus == 1) &&
+ (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy))){
+ FD_SET(pipeSemState[i].usKey,readfds);
+ e++;
+ }
+ else if((pipeSemState[i].fStatus == 2) &&
+ (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy))){
+ FD_SET(pipeSemState[i].usKey,writefds);
+ e++;
+ }
+ else if( (pipeSemState[i].fStatus == 3) &&
+ ( (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy)) ||
+ (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy)) )){
+ errno = EBADF;
+ /* fprintf(stderr,"Pipe has closed down, fd=%d\n",pipeSemState[i].usKey); */
+ return (-1);
+ }
+ i++;
+ } /* endwhile */
+ /*fprintf(stderr,"Done listing pipe sem entries, total %d entries, total ready entries %d\n",i,e);*/
+errno = 0;
+return(e);
+}
+
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
new file mode 100644
index 000000000..a9f69aad5
--- /dev/null
+++ b/hw/xwin/InitInput.c
@@ -0,0 +1,148 @@
+/* $TOG: InitInput.c /main/12 1998/02/10 13:23:52 kaleb $ */
+/*
+
+ Copyright 1993, 1998 The Open Group
+
+ 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.
+
+ 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 OPEN GROUP 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.
+
+ Except as contained in this notice, the name of The Open Group shall
+ not be used in advertising or otherwise to promote the sale, use or
+ other dealings in this Software without prior written authorization
+ from The Open Group.
+
+*/
+/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.12 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+CARD32 g_c32LastInputEventTime = 0;
+
+
+/* Called from dix/devices.c */
+/*
+ * All of our keys generate up and down transition notifications,
+ * so all of our keys can be used as modifiers.
+ *
+ * An example of a modifier is mapping the A key to the Control key.
+ * A has to be a legal modifier. I think.
+ */
+
+Bool
+LegalModifier (unsigned int uiKey, DevicePtr pDevice)
+{
+ return TRUE;
+}
+
+
+/* Called from dix/dispatch.c */
+/*
+ * Run through the Windows message queue(s) one more time.
+ * Tell mi to dequeue the events that we have sent it.
+ */
+void
+ProcessInputEvents (void)
+{
+#if 0
+ ErrorF ("ProcessInputEvents\n");
+#endif
+
+ mieqProcessInputEvents ();
+ miPointerUpdate ();
+
+#if 0
+ ErrorF ("ProcessInputEvents - returning\n");
+#endif
+}
+
+
+int
+TimeSinceLastInputEvent ()
+{
+ if (g_c32LastInputEventTime == 0)
+ g_c32LastInputEventTime = GetTickCount ();
+ return GetTickCount () - g_c32LastInputEventTime;
+}
+
+
+/* See Porting Layer Definition - p. 17 */
+void
+InitInput (int argc, char *argv[])
+{
+ DeviceIntPtr pMouse, pKeyboard;
+
+#if CYGDEBUG
+ ErrorF ("InitInput\n");
+#endif
+
+ pMouse = AddInputDevice (winMouseProc, TRUE);
+ pKeyboard = AddInputDevice (winKeybdProc, TRUE);
+
+ RegisterPointerDevice (pMouse);
+ RegisterKeyboardDevice (pKeyboard);
+
+ miRegisterPointerDevice (screenInfo.screens[0], pMouse);
+ mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse);
+
+ /* Initialize the mode key states */
+ winInitializeModeKeyStates ();
+
+ /* Only open the windows message queue device once */
+ if (g_fdMessageQueue == WIN_FD_INVALID)
+ {
+ /* Open a file descriptor for the Windows message queue */
+ g_fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
+
+ if (g_fdMessageQueue == -1)
+ {
+ FatalError ("InitInput - Failed opening %s\n",
+ WIN_MSG_QUEUE_FNAME);
+ }
+
+ /* Add the message queue as a device to wait for in WaitForSomething */
+ AddEnabledDevice (g_fdMessageQueue);
+ }
+
+#if CYGDEBUG
+ ErrorF ("InitInput - returning\n");
+#endif
+}
+
+
+#ifdef XTESTEXT1
+void
+XTestGenerateEvent (int dev_type, int keycode, int keystate,
+ int mousex, int mousey)
+{
+ ErrorF ("XTestGenerateEvent\n");
+}
+
+
+void
+XTestGetPointerPos (short *fmousex, short *fmousey)
+{
+ ErrorF ("XTestGetPointerPos\n");
+}
+
+
+void
+XTestJumpPointer (int jx, int jy, int dev_type)
+{
+ ErrorF ("XTestJumpPointer\n");
+}
+#endif
+
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
new file mode 100644
index 000000000..c434e58d1
--- /dev/null
+++ b/hw/xwin/InitOutput.c
@@ -0,0 +1,1261 @@
+/* $TOG: InitOutput.c /main/20 1998/02/10 13:23:56 kaleb $ */
+/*
+
+Copyright 1993, 1998 The Open Group
+
+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.
+
+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 OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.32 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+#include "winconfig.h"
+
+
+/*
+ * General global variables
+ */
+
+int g_iNumScreens = 0;
+winScreenInfo g_ScreenInfo[MAXSCREENS];
+int g_iLastScreen = -1;
+int g_fdMessageQueue = WIN_FD_INVALID;
+int g_iScreenPrivateIndex = -1;
+int g_iCmapPrivateIndex = -1;
+int g_iGCPrivateIndex = -1;
+int g_iPixmapPrivateIndex = -1;
+int g_iWindowPrivateIndex = -1;
+unsigned long g_ulServerGeneration = 0;
+Bool g_fInitializedDefaultScreens = FALSE;
+FILE *g_pfLog = NULL;
+DWORD g_dwEnginesSupported = 0;
+HINSTANCE g_hInstance = 0;
+HWND g_hDlgDepthChange = NULL;
+Bool g_fCalledSetLocale = FALSE;
+
+
+/*
+ * Global variables for dynamically loaded libraries and
+ * their function pointers
+ */
+
+HMODULE g_hmodDirectDraw = NULL;
+FARPROC g_fpDirectDrawCreate = NULL;
+FARPROC g_fpDirectDrawCreateClipper = NULL;
+
+HMODULE g_hmodCommonControls = NULL;
+FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
+
+
+/* Function prototypes */
+
+#ifdef DDXOSVERRORF
+void OsVendorVErrorF (const char *pszFormat, va_list va_args);
+#endif
+
+
+/*
+ * For the depth 24 pixmap we default to 32 bits per pixel, but
+ * we change this pixmap format later if we detect that the display
+ * is going to be running at 24 bits per pixel.
+ *
+ * FIXME: On second thought, don't DIBs only support 32 bits per pixel?
+ * DIBs are the underlying bitmap used for DirectDraw surfaces, so it
+ * seems that all pixmap formats with depth 24 would be 32 bits per pixel.
+ * Confirm whether depth 24 DIBs can have 24 bits per pixel, then remove/keep
+ * the bits per pixel adjustment and update this comment to reflect the
+ * situation. Harold Hunt - 2002/07/02
+ */
+
+static PixmapFormatRec g_PixmapFormats[] = {
+ { 1, 1, BITMAP_SCANLINE_PAD },
+ { 4, 8, BITMAP_SCANLINE_PAD },
+ { 8, 8, BITMAP_SCANLINE_PAD },
+ { 15, 16, BITMAP_SCANLINE_PAD },
+ { 16, 16, BITMAP_SCANLINE_PAD },
+ { 24, 32, BITMAP_SCANLINE_PAD },
+#ifdef RENDER
+ { 32, 32, BITMAP_SCANLINE_PAD }
+#endif
+};
+
+const int NUMFORMATS = sizeof (g_PixmapFormats) / sizeof (g_PixmapFormats[0]);
+
+
+void
+winInitializeDefaultScreens (void)
+{
+ int i;
+ DWORD dwWidth, dwHeight;
+
+ /* Bail out early if default screens have already been initialized */
+ if (g_fInitializedDefaultScreens)
+ return;
+
+ /* Zero the memory used for storing the screen info */
+ ZeroMemory (g_ScreenInfo, MAXSCREENS * sizeof (winScreenInfo));
+
+ /* Get default width and height */
+ /*
+ * NOTE: These defaults will cause the window to cover only
+ * the primary monitor in the case that we have multiple monitors.
+ */
+ dwWidth = GetSystemMetrics (SM_CXSCREEN);
+ dwHeight = GetSystemMetrics (SM_CYSCREEN);
+
+ ErrorF ("winInitializeDefaultScreens - w %d h %d\n", dwWidth, dwHeight);
+
+ /* Set a default DPI, if no parameter was passed */
+ if (monitorResolution == 0)
+ monitorResolution = WIN_DEFAULT_DPI;
+
+ for (i = 0; i < MAXSCREENS; ++i)
+ {
+ g_ScreenInfo[i].dwScreen = i;
+ g_ScreenInfo[i].dwWidth = dwWidth;
+ g_ScreenInfo[i].dwHeight = dwHeight;
+ g_ScreenInfo[i].dwUserWidth = dwWidth;
+ g_ScreenInfo[i].dwUserHeight = dwHeight;
+ g_ScreenInfo[i].fUserGaveHeightAndWidth
+ = WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH;
+ g_ScreenInfo[i].dwBPP = WIN_DEFAULT_BPP;
+ g_ScreenInfo[i].dwClipUpdatesNBoxes = WIN_DEFAULT_CLIP_UPDATES_NBOXES;
+ g_ScreenInfo[i].fEmulatePseudo = WIN_DEFAULT_EMULATE_PSEUDO;
+ g_ScreenInfo[i].dwRefreshRate = WIN_DEFAULT_REFRESH;
+ g_ScreenInfo[i].pfb = NULL;
+ g_ScreenInfo[i].fFullScreen = FALSE;
+ g_ScreenInfo[i].fDecoration = TRUE;
+ g_ScreenInfo[i].fRootless = FALSE;
+ g_ScreenInfo[i].fMultiWindow = FALSE;
+ g_ScreenInfo[i].fMultipleMonitors = FALSE;
+ g_ScreenInfo[i].fClipboard = FALSE;
+ g_ScreenInfo[i].fLessPointer = FALSE;
+ g_ScreenInfo[i].fScrollbars = FALSE;
+ g_ScreenInfo[i].iE3BTimeout = WIN_E3B_OFF;
+ g_ScreenInfo[i].dwWidth_mm = (dwWidth / WIN_DEFAULT_DPI)
+ * 25.4;
+ g_ScreenInfo[i].dwHeight_mm = (dwHeight / WIN_DEFAULT_DPI)
+ * 25.4;
+ g_ScreenInfo[i].fUseWinKillKey = WIN_DEFAULT_WIN_KILL;
+ g_ScreenInfo[i].fUseUnixKillKey = WIN_DEFAULT_UNIX_KILL;
+ g_ScreenInfo[i].fIgnoreInput = FALSE;
+ g_ScreenInfo[i].fExplicitScreen = FALSE;
+ }
+
+ /* Signal that the default screens have been initialized */
+ g_fInitializedDefaultScreens = TRUE;
+
+ ErrorF ("winInitializeDefaultScreens - Returning\n");
+}
+
+
+/* See Porting Layer Definition - p. 57 */
+void
+ddxGiveUp()
+{
+#if CYGDEBUG
+ ErrorF ("ddxGiveUp\n");
+#endif
+
+ /* Close our handle to our message queue */
+ if (g_fdMessageQueue != WIN_FD_INVALID)
+ {
+ /* Close /dev/windows */
+ close (g_fdMessageQueue);
+
+ /* Set the file handle to invalid */
+ g_fdMessageQueue = WIN_FD_INVALID;
+ }
+
+ /* Close the log file handle */
+ if (g_pfLog != NULL)
+ {
+ /* Close log file */
+ fclose (g_pfLog);
+
+ /* Set the file handle to invalid */
+ g_pfLog = NULL;
+ }
+
+ /*
+ * At this point we aren't creating any new screens, so
+ * we are guaranteed to not need the DirectDraw functions.
+ */
+ if (g_hmodDirectDraw != NULL)
+ {
+ FreeLibrary (g_hmodDirectDraw);
+ g_hmodDirectDraw = NULL;
+ g_fpDirectDrawCreate = NULL;
+ g_fpDirectDrawCreateClipper = NULL;
+ }
+
+ /* Unload our TrackMouseEvent funtion pointer */
+ if (g_hmodCommonControls != NULL)
+ {
+ FreeLibrary (g_hmodCommonControls);
+ g_hmodCommonControls = NULL;
+ g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
+ }
+
+ /* Tell Windows that we want to end the app */
+ PostQuitMessage (0);
+}
+
+
+/* See Porting Layer Definition - p. 57 */
+void
+AbortDDX (void)
+{
+#if CYGDEBUG
+ ErrorF ("AbortDDX\n");
+#endif
+ ddxGiveUp ();
+}
+
+
+void
+OsVendorInit (void)
+{
+#ifdef DDXOSVERRORF
+ if (!OsVendorVErrorFProc)
+ OsVendorVErrorFProc = OsVendorVErrorF;
+
+ /* Open log file if not yet open */
+ if (g_pfLog == NULL)
+ g_pfLog = fopen (WIN_LOG_FNAME, "w");
+#endif
+
+ /* Add a default screen if no screens were specified */
+ if (g_iNumScreens == 0)
+ {
+ ErrorF ("OsVendorInit - Creating bogus screen 0\n");
+
+ /*
+ * We need to initialize default screens if no arguments
+ * were processed. Otherwise, the default screens would
+ * already have been initialized by ddxProcessArgument ().
+ */
+ winInitializeDefaultScreens ();
+
+ /*
+ * Add a screen 0 using the defaults set by
+ * winInitializeDefaultScreens () and any additional parameters
+ * processed by ddxProcessArgument ().
+ */
+ g_iNumScreens = 1;
+ g_iLastScreen = 0;
+
+ /* We have to flag this as an explicit screen, even though it isn't */
+ g_ScreenInfo[0].fExplicitScreen = TRUE;
+ }
+}
+
+
+/* See Porting Layer Definition - p. 57 */
+void
+ddxUseMsg (void)
+{
+ ErrorF ("-depth bits_per_pixel\n"
+ "\tSpecify an optional bitdepth to use in fullscreen mode\n"
+ "\twith a DirectDraw engine.\n");
+
+ ErrorF ("-emulate3buttons [timeout]\n"
+ "\tEmulate 3 button mouse with an optional timeout in\n"
+ "\tmilliseconds.\n");
+
+ ErrorF ("-engine engine_type_id\n"
+ "\tOverride the server's automatically selected engine type:\n"
+ "\t\t1 - Shadow GDI\n"
+ "\t\t2 - Shadow DirectDraw\n"
+ "\t\t4 - Shadow DirectDraw4 Non-Locking\n"
+ "\t\t16 - Native GDI - experimental\n");
+
+ ErrorF ("-fullscreen\n"
+ "\tRun the server in fullscreen mode.\n");
+
+ ErrorF ("-refresh rate_in_Hz\n"
+ "\tSpecify an optional refresh rate to use in fullscreen mode\n"
+ "\twith a DirectDraw engine.\n");
+
+ ErrorF ("-screen scr_num [width height]\n"
+ "\tEnable screen scr_num and optionally specify a width and\n"
+ "\theight for that screen.\n");
+
+ ErrorF ("-lesspointer\n"
+ "\tHide the windows mouse pointer when it is over an inactive\n"
+ "\tXFree86 window. This prevents ghost cursors appearing where\n"
+ "\tthe Windows cursor is drawn overtop of the X cursor\n");
+
+ ErrorF ("-nodecoration\n"
+ "\tDo not draw a window border, title bar, etc. Windowed\n"
+ "\tmode only.\n");
+
+ ErrorF ("-rootless\n"
+ "\tEXPERIMENTAL: Run the server in pseudo-rootless mode.\n");
+
+ ErrorF ("-multiwindow\n"
+ "\tEXPERIMENTAL: Run the server in multi-window mode.\n");
+
+ ErrorF ("-multiplemonitors\n"
+ "\tEXPERIMENTAL: Use the entire virtual screen if multiple\n"
+ "\tmonitors are present.\n");
+
+ ErrorF ("-clipboard\n"
+ "\tEXPERIMENTAL: Run the clipboard integration module.\n");
+
+ ErrorF ("-scrollbars\n"
+ "\tIn windowed mode, allow screens bigger than the Windows desktop.\n"
+ "\tMoreover, if the window has decorations, one can now resize\n"
+ "\tit.\n");
+
+ ErrorF ("-clipupdates num_boxes\n"
+ "\tUse a clipping region to constrain shadow update blits to\n"
+ "\tthe updated region when num_boxes, or more, are in the\n"
+ "\tupdated region. Currently supported only by `-engine 1'.\n");
+
+ ErrorF ("-emulatepseudo\n"
+ "\tCreate a depth 8 PseudoColor visual when running in\n"
+ "\tdepths 15, 16, 24, or 32, collectively known as TrueColor\n"
+ "\tdepths. The PseudoColor visual does not have correct colors,\n"
+ "\tand it may crash, but it at least allows you to run your\n"
+ "\tapplication in TrueColor modes.\n");
+
+ ErrorF ("-[no]unixkill\n"
+ "\tCtrl+Alt+Backspace exits the X Server.\n");
+
+ ErrorF ("-[no]winkill\n"
+ "\tAlt+F4 exits the X Server.\n");
+
+ ErrorF ("-xf86config\n"
+ "\tSpecify a configuration file.\n");
+
+ ErrorF ("-keyboard\n"
+ "\tSpecify a keyboard device from the configuration file.\n");
+}
+
+
+/* See Porting Layer Definition - p. 57 */
+/*
+ * INPUT
+ * argv: pointer to an array of null-terminated strings, one for
+ * each token in the X Server command line; the first token
+ * is 'XWin.exe', or similar.
+ * argc: a count of the number of tokens stored in argv.
+ * i: a zero-based index into argv indicating the current token being
+ * processed.
+ *
+ * OUTPUT
+ * return: return the number of tokens processed correctly.
+ *
+ * NOTE
+ * When looking for n tokens, check that i + n is less than argc. Or,
+ * you may check if i is greater than or equal to argc, in which case
+ * you should display the UseMsg () and return 0.
+ */
+
+/* Check if enough arguments are given for the option */
+#define CHECK_ARGS(count) if (i + count >= argc) { UseMsg (); return 0; }
+
+/* Compare the current option with the string. */
+#define IS_OPTION(name) (strcmp (argv[i], name) == 0)
+
+int
+ddxProcessArgument (int argc, char *argv[], int i)
+{
+ static Bool s_fBeenHere = FALSE;
+
+ /* Initialize once */
+ if (!s_fBeenHere)
+ {
+#ifdef DDXOSVERRORF
+ /*
+ * This initialises our hook into VErrorF () for catching log messages
+ * that are generated before OsInit () is called.
+ */
+ OsVendorVErrorFProc = OsVendorVErrorF;
+
+ /* Open log file if not yet open */
+ if (g_pfLog == NULL)
+ g_pfLog = fopen (WIN_LOG_FNAME, "w");
+#endif
+
+ s_fBeenHere = TRUE;
+
+ /*
+ * Initialize default screen settings. We have to do this before
+ * OsVendorInit () gets called, otherwise we will overwrite
+ * settings changed by parameters such as -fullscreen, etc.
+ */
+ ErrorF ("ddxProcessArgument - Initializing default screens\n");
+ winInitializeDefaultScreens ();
+ }
+
+#if CYGDEBUG
+ ErrorF ("ddxProcessArgument - arg: %s\n", argv[i]);
+#endif
+
+ /*
+ * Look for the '-screen scr_num [width height]' argument
+ */
+ if (strcmp (argv[i], "-screen") == 0)
+ {
+ int iArgsProcessed = 1;
+ int nScreenNum;
+ int iWidth, iHeight;
+
+#if CYGDEBUG
+ ErrorF ("ddxProcessArgument - screen - argc: %d i: %d\n",
+ argc, i);
+#endif
+
+ /* Display the usage message if the argument is malformed */
+ if (i + 1 >= argc)
+ {
+ return 0;
+ }
+
+ /* Grab screen number */
+ nScreenNum = atoi (argv[i + 1]);
+
+ /* Validate the specified screen number */
+ if (nScreenNum < 0 || nScreenNum >= MAXSCREENS)
+ {
+ ErrorF ("ddxProcessArgument - screen - Invalid screen number %d\n",
+ nScreenNum);
+ UseMsg ();
+ return 0;
+ }
+
+ /* Look for 'WxD' or 'W D' */
+ if (i + 2 < argc
+ && 2 == sscanf (argv[i + 2], "%dx%d",
+ (int *) &iWidth,
+ (int *) &iHeight))
+ {
+ ErrorF ("ddxProcessArgument - screen - Found ``WxD'' arg\n");
+ iArgsProcessed = 3;
+ g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE;
+ g_ScreenInfo[nScreenNum].dwWidth = iWidth;
+ g_ScreenInfo[nScreenNum].dwHeight = iHeight;
+ g_ScreenInfo[nScreenNum].dwUserWidth = iWidth;
+ g_ScreenInfo[nScreenNum].dwUserHeight = iHeight;
+ }
+ else if (i + 3 < argc
+ && 1 == sscanf (argv[i + 2], "%d",
+ (int *) &iWidth)
+ && 1 == sscanf (argv[i + 3], "%d",
+ (int *) &iHeight))
+ {
+ ErrorF ("ddxProcessArgument - screen - Found ``W D'' arg\n");
+ iArgsProcessed = 4;
+ g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE;
+ g_ScreenInfo[nScreenNum].dwWidth = iWidth;
+ g_ScreenInfo[nScreenNum].dwHeight = iHeight;
+ g_ScreenInfo[nScreenNum].dwUserWidth = iWidth;
+ g_ScreenInfo[nScreenNum].dwUserHeight = iHeight;
+ }
+ else
+ {
+ ErrorF ("ddxProcessArgument - screen - Did not find size arg. "
+ "dwWidth: %d dwHeight: %d\n",
+ g_ScreenInfo[nScreenNum].dwWidth,
+ g_ScreenInfo[nScreenNum].dwHeight);
+ iArgsProcessed = 2;
+ g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE;
+ }
+
+ /* Calculate the screen width and height in millimeters */
+ if (g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth)
+ {
+ g_ScreenInfo[nScreenNum].dwWidth_mm
+ = (g_ScreenInfo[nScreenNum].dwWidth
+ / monitorResolution) * 25.4;
+ g_ScreenInfo[nScreenNum].dwHeight_mm
+ = (g_ScreenInfo[nScreenNum].dwHeight
+ / monitorResolution) * 25.4;
+ }
+
+ /* Flag that this screen was explicity specified by the user */
+ g_ScreenInfo[nScreenNum].fExplicitScreen = TRUE;
+
+ /*
+ * Keep track of the last screen number seen, as parameters seen
+ * before a screen number apply to all screens, whereas parameters
+ * seen after a screen number apply to that screen number only.
+ */
+ g_iLastScreen = nScreenNum;
+
+ /* Keep a count of the number of screens */
+ ++g_iNumScreens;
+
+ return iArgsProcessed;
+ }
+
+ /*
+ * Look for the '-engine n' argument
+ */
+ if (strcmp (argv[i], "-engine") == 0)
+ {
+ DWORD dwEngine = 0;
+ CARD8 c8OnBits = 0;
+
+ /* Display the usage message if the argument is malformed */
+ if (++i >= argc)
+ {
+ UseMsg ();
+ return 0;
+ }
+
+ /* Grab the argument */
+ dwEngine = atoi (argv[i]);
+
+ /* Count the one bits in the engine argument */
+ c8OnBits = winCountBits (dwEngine);
+
+ /* Argument should only have a single bit on */
+ if (c8OnBits != 1)
+ {
+ UseMsg ();
+ return 0;
+ }
+
+ /* Is this parameter attached to a screen or global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].dwEnginePreferred = dwEngine;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].dwEnginePreferred = dwEngine;
+ }
+
+ /* Indicate that we have processed the argument */
+ return 2;
+ }
+
+ /*
+ * Look for the '-fullscreen' argument
+ */
+ if (strcmp (argv[i], "-fullscreen") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fFullScreen = TRUE;
+
+ /*
+ * No scrollbars in fullscreen mode. Later, we may want to have
+ * a fullscreen with a bigger virtual screen?
+ */
+ g_ScreenInfo[j].fScrollbars = FALSE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fFullScreen = TRUE;
+
+ /*
+ * No scrollbars in fullscreen mode. Later, we may want to have
+ * a fullscreen with a bigger virtual screen?
+ */
+ g_ScreenInfo[g_iLastScreen].fScrollbars = FALSE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-lesspointer' argument
+ */
+ if (strcmp (argv[i], "-lesspointer") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fLessPointer = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fLessPointer = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-nodecoration' argument
+ */
+ if (strcmp (argv[i], "-nodecoration") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fDecoration = FALSE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fDecoration = FALSE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-rootless' argument
+ */
+ if (strcmp (argv[i], "-rootless") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fRootless = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fRootless = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-multiwindow' argument
+ */
+ if (strcmp (argv[i], "-multiwindow") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fMultiWindow = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fMultiWindow = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-multiplemonitors' argument
+ */
+ if (strcmp (argv[i], "-multiplemonitors") == 0
+ || strcmp (argv[i], "-multimonitors") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fMultipleMonitors = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fMultipleMonitors = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-scrollbars' argument
+ */
+ if (strcmp (argv[i], "-scrollbars") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ /* No scrollbar in fullscreen mode */
+ if (!g_ScreenInfo[j].fFullScreen)
+ g_ScreenInfo[j].fScrollbars = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ if (!g_ScreenInfo[g_iLastScreen].fFullScreen)
+ {
+ /* No scrollbar in fullscreen mode */
+ g_ScreenInfo[g_iLastScreen].fScrollbars = TRUE;
+ }
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-clipboard' argument
+ */
+ if (strcmp (argv[i], "-clipboard") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fClipboard = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fClipboard = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-ignoreinput' argument
+ */
+ if (strcmp (argv[i], "-ignoreinput") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fIgnoreInput = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fIgnoreInput = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-emulate3buttons' argument
+ */
+ if (strcmp (argv[i], "-emulate3buttons") == 0)
+ {
+ int iArgsProcessed = 1;
+ int iE3BTimeout = WIN_DEFAULT_E3B_TIME;
+
+ /* Grab the optional timeout value */
+ if (i + 1 < argc
+ && 1 == sscanf (argv[i + 1], "%d",
+ &iE3BTimeout))
+ {
+ /* Indicate that we have processed the next argument */
+ iArgsProcessed++;
+ }
+ else
+ {
+ /*
+ * sscanf () won't modify iE3BTimeout if it doesn't find
+ * the specified format; however, I want to be explicit
+ * about setting the default timeout in such cases to
+ * prevent some programs (me) from getting confused.
+ */
+ iE3BTimeout = WIN_DEFAULT_E3B_TIME;
+ }
+
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].iE3BTimeout = iE3BTimeout;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].iE3BTimeout = iE3BTimeout;
+ }
+
+ /* Indicate that we have processed this argument */
+ return iArgsProcessed;
+ }
+
+ /*
+ * Look for the '-depth n' argument
+ */
+ if (strcmp (argv[i], "-depth") == 0)
+ {
+ DWORD dwBPP = 0;
+
+ /* Display the usage message if the argument is malformed */
+ if (++i >= argc)
+ {
+ UseMsg ();
+ return 0;
+ }
+
+ /* Grab the argument */
+ dwBPP = atoi (argv[i]);
+
+ /* Is this parameter attached to a screen or global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].dwBPP = dwBPP;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].dwBPP = dwBPP;
+ }
+
+ /* Indicate that we have processed the argument */
+ return 2;
+ }
+
+ /*
+ * Look for the '-refresh n' argument
+ */
+ if (strcmp (argv[i], "-refresh") == 0)
+ {
+ DWORD dwRefreshRate = 0;
+
+ /* Display the usage message if the argument is malformed */
+ if (++i >= argc)
+ {
+ UseMsg ();
+ return 0;
+ }
+
+ /* Grab the argument */
+ dwRefreshRate = atoi (argv[i]);
+
+ /* Is this parameter attached to a screen or global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].dwRefreshRate = dwRefreshRate;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].dwRefreshRate = dwRefreshRate;
+ }
+
+ /* Indicate that we have processed the argument */
+ return 2;
+ }
+
+ /*
+ * Look for the '-clipupdates num_boxes' argument
+ */
+ if (strcmp (argv[i], "-clipupdates") == 0)
+ {
+ DWORD dwNumBoxes = 0;
+
+ /* Display the usage message if the argument is malformed */
+ if (++i >= argc)
+ {
+ UseMsg ();
+ return 0;
+ }
+
+ /* Grab the argument */
+ dwNumBoxes = atoi (argv[i]);
+
+ /* Is this parameter attached to a screen or global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].dwClipUpdatesNBoxes = dwNumBoxes;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].dwClipUpdatesNBoxes = dwNumBoxes;
+ }
+
+ /* Indicate that we have processed the argument */
+ return 2;
+ }
+
+ /*
+ * Look for the '-emulatepseudo' argument
+ */
+ if (strcmp (argv[i], "-emulatepseudo") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fEmulatePseudo = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fEmulatePseudo = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-nowinkill' argument
+ */
+ if (strcmp (argv[i], "-nowinkill") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fUseWinKillKey = FALSE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fUseWinKillKey = FALSE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-winkill' argument
+ */
+ if (strcmp (argv[i], "-winkill") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fUseWinKillKey = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fUseWinKillKey = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-nounixkill' argument
+ */
+ if (strcmp (argv[i], "-nounixkill") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fUseUnixKillKey = FALSE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fUseUnixKillKey = FALSE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-unixkill' argument
+ */
+ if (strcmp (argv[i], "-unixkill") == 0)
+ {
+ /* Is this parameter attached to a screen or is it global? */
+ if (-1 == g_iLastScreen)
+ {
+ int j;
+
+ /* Parameter is for all screens */
+ for (j = 0; j < MAXSCREENS; j++)
+ {
+ g_ScreenInfo[j].fUseUnixKillKey = TRUE;
+ }
+ }
+ else
+ {
+ /* Parameter is for a single screen */
+ g_ScreenInfo[g_iLastScreen].fUseUnixKillKey = TRUE;
+ }
+
+ /* Indicate that we have processed this argument */
+ return 1;
+ }
+
+ /*
+ * Look for the '-fp' argument
+ */
+ if (IS_OPTION ("-fp"))
+ {
+ CHECK_ARGS (1);
+ g_cmdline.fontPath = argv[++i];
+ return 0; /* Let DIX parse this again */
+ }
+
+ /*
+ * Look for the '-co' argument
+ */
+ if (IS_OPTION ("-co"))
+ {
+ CHECK_ARGS (1);
+ g_cmdline.rgbPath = argv[++i];
+ return 0; /* Let DIX parse this again */
+ }
+
+ /*
+ * Look for the '-xf86config' argument
+ */
+ if (IS_OPTION ("-xf86config"))
+ {
+ CHECK_ARGS (1);
+ g_cmdline.configFile = argv[++i];
+ return 2;
+ }
+
+ /*
+ * Look for the '-keyboard' argument
+ */
+ if (IS_OPTION ("-keyboard"))
+ {
+ CHECK_ARGS (1);
+ g_cmdline.keyboard = argv[++i];
+ return 2;
+ }
+
+ return 0;
+}
+
+
+#ifdef DDXTIME /* from ServerOSDefines */
+CARD32
+GetTimeInMillis (void)
+{
+ return GetTickCount ();
+}
+#endif /* DDXTIME */
+
+
+/* See Porting Layer Definition - p. 20 */
+/*
+ * Do any global initialization, then initialize each screen.
+ *
+ * NOTE: We use ddxProcessArgument, so we don't need to touch argc and argv
+ */
+
+void
+InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
+{
+ int i;
+ int iMaxConsecutiveScreen = 0;
+
+#if CYGDEBUG
+ ErrorF ("InitOutput\n");
+#endif
+
+ /* Try to read the XF86Config-style configuration file */
+ if (!winReadConfigfile ())
+ ErrorF ("InitOutput - Error reading config file\n");
+
+ /* Setup global screen info parameters */
+ screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
+ screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
+ screenInfo->numPixmapFormats = NUMFORMATS;
+
+ /* Describe how we want common pixmap formats padded */
+ for (i = 0; i < NUMFORMATS; i++)
+ {
+ screenInfo->formats[i] = g_PixmapFormats[i];
+ }
+
+ /* Load pointers to DirectDraw functions */
+ winGetDDProcAddresses ();
+
+ /* Detect supported engines */
+ winDetectSupportedEngines ();
+
+ /* Load common controls library */
+ g_hmodCommonControls = LoadLibraryEx ("comctl32.dll", NULL, 0);
+
+ /* Load TrackMouseEvent function pointer */
+ g_fpTrackMouseEvent = GetProcAddress (g_hmodCommonControls,
+ "_TrackMouseEvent");
+ if (g_fpTrackMouseEvent == NULL)
+ {
+ ErrorF ("InitOutput - Could not get pointer to function\n"
+ "\t_TrackMouseEvent in comctl32.dll. Try installing\n"
+ "\tInternet Explorer 3.0 or greater if you have not\n"
+ "\talready.\n");
+
+ /* Free the library since we won't need it */
+ FreeLibrary (g_hmodCommonControls);
+ g_hmodCommonControls = NULL;
+
+ /* Set function pointer to point to no operation function */
+ g_fpTrackMouseEvent = (FARPROC) (void (*)())NoopDDA;
+ }
+
+ /*
+ * Check for a malformed set of -screen parameters.
+ * Examples of malformed parameters:
+ * XWin -screen 1
+ * XWin -screen 0 -screen 2
+ * XWin -screen 1 -screen 2
+ */
+ for (i = 0; i < MAXSCREENS; i++)
+ {
+ if (g_ScreenInfo[i].fExplicitScreen)
+ iMaxConsecutiveScreen = i + 1;
+ }
+ ErrorF ("InitOutput - g_iNumScreens: %d iMaxConsecutiveScreen: %d\n",
+ g_iNumScreens, iMaxConsecutiveScreen);
+ if (g_iNumScreens < iMaxConsecutiveScreen)
+ FatalError ("InitOutput - Malformed set of screen parameter(s). "
+ "Screens must be specified consecutively starting with "
+ "screen 0. That is, you cannot have only a screen 1, nor "
+ "could you have screen 0 and screen 2. You instead must have "
+ "screen 0, or screen 0 and screen 1, respectively. Of "
+ "you can specify as many screens as you want from 0 up to "
+ "%d.\n", MAXSCREENS - 1);
+
+ /* Store the instance handle */
+ g_hInstance = GetModuleHandle (NULL);
+
+ /* Initialize each screen */
+ for (i = 0; i < g_iNumScreens; i++)
+ {
+ /* Initialize the screen */
+ if (-1 == AddScreen (winScreenInit, argc, argv))
+ {
+ FatalError ("InitOutput - Couldn't add screen %d", i);
+ }
+ }
+
+#if CYGDEBUG || YES
+ ErrorF ("InitOutput - Returning.\n");
+#endif
+}
diff --git a/hw/xwin/X.ico b/hw/xwin/X.ico
new file mode 100644
index 000000000..26e2cf947
--- /dev/null
+++ b/hw/xwin/X.ico
Binary files differ
diff --git a/hw/xwin/XWin.man b/hw/xwin/XWin.man
new file mode 100644
index 000000000..09bdcd235
--- /dev/null
+++ b/hw/xwin/XWin.man
@@ -0,0 +1,129 @@
+.\" $XFree86: xc/programs/Xserver/hw/xwin/XWin.man,v 1.6 2002/10/17 08:18:21 alanh Exp $
+.TH XWIN 1 __vendorversion__
+.SH NAME
+XWin \- X Server for the Cygwin environment on Microsoft Windows
+.SH SYNOPSIS
+.B XWin
+[ options ] ...
+.SH DESCRIPTION
+.I XWin
+is an X Server for the X Window System on the Cygwin environment
+running on Microsoft Windows.
+.SH OPTIONS
+.PP
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXWin\fP accepts the following command line switches:
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specify the color depth, in bits per pixel, to use when running in
+fullscreen with a DirectDraw engine. This parameter is ignored if
+\fB\-fullscreen\fP is not specified.
+.TP 8
+.B "\-emulate3buttons \fItimeout\fP"
+Emulate a three button mouse; pressing both buttons within
+.I timeout
+milliseconds causes an emulated middle button press. The default
+.I timeout
+is 50 milliseconds.
+.TP 8
+.B "\-engine \fIengine_type_id\fP"
+Override the server's automatically supported engine type. This
+parameter will be ignored if the specified engine type is not
+supported on the current system. The supported engine type ids are 1
+- Shadow GDI, 2 - Shadow DirectDraw, and 4 - Shadow DirectDraw4.
+Additionally, there is a barely functional experimental engine type id
+16 - Native GDI.
+.TP 8
+.B \-fullscreen
+Run the server in fullscreen mode, as opposed to the default windowed
+mode.
+.TP 8
+.B "\-refresh \fIrate_in_Hz\fP"
+Specify an optional refresh rate to use when running in
+fullscreen with a DirectDraw engine. This parameter is ignored if
+\fB\-fullscreen\fP is not specified.
+.TP 8
+.B "\-screen \fIscreen_number\fP \fIwidth\fP \fIheight\fP"
+Sets the display resolution for the X server to use on screen
+.I screen_number.
+.TP 8
+.B \-nodecoration
+Draw the Cygwin/XFree86 window without a border or title bar.
+.TP 8
+.B \-rootless
+EXPERIMENTAL: Run Cygwin/XFree86 in pseduo-rootless mode.
+.TP 8
+.B \-lesspointer
+Hide the Windows mouse pointer when over an inactive XFree86 window
+.TP 8
+.B \-scrollbars
+In windowed mode, allow screens bigger than the Windows desktop.
+Moreover, if the window has decorations, one can now resize it.
+.TP 8
+.B "\-clipupdates \fInum_boxes\fP"
+Specify an optional threshold, above which the boxes in a shadow
+update operation will be collected into a GDI clipping region. The
+clipping region is then used to do a single bit block transfer that is
+constrained to the updated area by the clipping region. There is some
+overhead involved in creating, installing, destroying, and removing
+the clipping region, thus there may not be much benefit for a small
+number of boxes (less than 10). It is even possible that this
+functionality does not provide a benefit at any number of boxes; we
+can only determine the usefullness of this feature through testing.
+This parameter works in conjunction with engines 1, 2, and 4 (Shadow
+GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking,
+respectively).
+.TP 8
+.B \-emulatepseudo
+Create a depth 8 PseudoColor visual when running in depths 15, 16, 24,
+or 32, collectively known as TrueColor depths. The PseudoColor visual
+does not have correct colors, and it may crash, but it at least allows
+you to run your PseudoColor application in TrueColor modes.
+.TP 8
+.B \-[no]unixkill
+Ctrl+Alt+Backspace exits the X Server
+.TP 8
+.B \-[no]winkill
+Alt+F4 exits the X Server
+.SH "SEE ALSO"
+.PP
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
+.SH BUGS
+.I XWin
+and this man page still have many limitations. Some of the more obvious
+ones are:
+.br
+- The display mode can not be changed once the X server has started.
+.PP
+.SH AUTHORS
+XFree86 was originally ported to Cygwin by Dakshinamurthy Karra,
+Dr. Peter Busch, John Fortin, and Suhaib Siddiqi.
+.I XWin
+is maintained by the Cygwin/XFree86 project, with hosting services
+provided by RedHat.
+.PP
+The following members, in alphabetical order by last name, of the
+Cygwin/XFree86 Team contributed to the XFree86 4.1.0 release:
+.PP
+Robert Collins - Cygwin developer, miscellaneous
+.br
+Christopher Faylor - Management of hosting services, general
+programming guru
+.br
+Alexander Gottwald - AltGr handling for non-U.S. keyboards
+.br
+Alan Hourihane - XFree86 developer, patch reviewer, general programming guru
+.br
+Pierre A Humblet - Debugging of socket-related crashes, developer
+.br
+Harold L Hunt II - Project leader, lead developer, documentation,
+and website updates
+.br
+Suhaib Siddiqi - Originator of the project
+
+
+
+
+
+
+
diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc
new file mode 100644
index 000000000..73533ba4e
--- /dev/null
+++ b/hw/xwin/XWin.rc
@@ -0,0 +1,60 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/XWin.rc,v 1.1 2002/10/17 08:18:21 alanh Exp $ */
+
+#include "resource.h"
+
+
+/*
+ * Dialogs
+ */
+
+DEPTH_CHANGE_BOX DIALOG DISCARDABLE 32, 32, 180, 100
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
+FONT 8, "MS Sans Serif"
+CAPTION "Cygwin/XFree86"
+BEGIN
+ DEFPUSHBUTTON "Dismiss", IDOK, 66, 80, 50, 14
+ CTEXT "Cygwin/XFree86", IDC_STATIC, 40, 12, 100, 8
+ CTEXT "Disruptive screen configuration change.", IDC_STATIC, 7, 40, 166, 8
+ CTEXT "Restore previous resolution to use Cygwin/XFree86.", IDC_STATIC, 7, 52, 166, 8
+END
+
+
+/*
+ * Menus
+ */
+
+
+/*
+ * Icons
+ */
+
+IDI_XWIN ICON DISCARDABLE "X.ico"
diff --git a/hw/xwin/ddraw.h b/hw/xwin/ddraw.h
new file mode 100644
index 000000000..b67a556b5
--- /dev/null
+++ b/hw/xwin/ddraw.h
@@ -0,0 +1,2094 @@
+/* $XFree86: xc/programs/Xserver/hw/xwin/ddraw.h,v 1.4 2001/07/29 22:08:15 tsi Exp $ */
+
+#ifndef __WINE_DDRAW_H
+#define __WINE_DDRAW_H
+
+#include <winnt.h>
+#include <wingdi.h>
+#include "obj_base.h"
+
+#ifdef NONAMELESSUNION
+#ifndef DUMMYUNIONNAME1
+#define DUMMYUNIONNAME1 u1
+#endif
+#endif
+
+# ifdef UNICODE
+# define WINELIB_NAME_AW(func) func##W
+# else
+# define WINELIB_NAME_AW(func) func##A
+# endif /* UNICODE */
+#define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* defined(__cplusplus) */
+
+#ifndef DIRECTDRAW_VERSION
+#define DIRECTDRAW_VERSION 0x0700
+#endif /* DIRECTDRAW_VERSION */
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID( CLSID_DirectDraw, 0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
+DEFINE_GUID( CLSID_DirectDraw7, 0x3C305196,0x50DB,0x11D3,0x9C,0xFE,0x00,0xC0,0x4F,0xD9,0x30,0xC5 );
+DEFINE_GUID( CLSID_DirectDrawClipper, 0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
+DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
+DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
+DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
+DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
+DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
+DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
+DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
+DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
+DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
+DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
+DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
+DEFINE_GUID( IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
+DEFINE_GUID( IID_IDirectDrawGammaControl,0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
+
+typedef struct IDirectDraw IDirectDraw,*LPDIRECTDRAW;
+typedef struct IDirectDraw2 IDirectDraw2,*LPDIRECTDRAW2;
+typedef struct IDirectDraw4 IDirectDraw4,*LPDIRECTDRAW4;
+typedef struct IDirectDraw7 IDirectDraw7,*LPDIRECTDRAW7;
+typedef struct IDirectDrawClipper IDirectDrawClipper,*LPDIRECTDRAWCLIPPER;
+typedef struct IDirectDrawPalette IDirectDrawPalette,*LPDIRECTDRAWPALETTE;
+typedef struct IDirectDrawSurface IDirectDrawSurface,*LPDIRECTDRAWSURFACE;
+typedef struct IDirectDrawSurface2 IDirectDrawSurface2,*LPDIRECTDRAWSURFACE2;
+typedef struct IDirectDrawSurface3 IDirectDrawSurface3,*LPDIRECTDRAWSURFACE3;
+typedef struct IDirectDrawSurface4 IDirectDrawSurface4,*LPDIRECTDRAWSURFACE4;
+typedef struct IDirectDrawSurface7 IDirectDrawSurface7,*LPDIRECTDRAWSURFACE7;
+typedef struct IDirectDrawColorControl IDirectDrawColorControl,*LPDIRECTDRAWCOLORCONTROL;
+typedef struct IDirectDrawGammaControl IDirectDrawGammaControl,*LPDIRECTDRAWGAMMACONTROL;
+
+
+#define DDENUMRET_CANCEL 0
+#define DDENUMRET_OK 1
+
+#define DD_OK 0
+
+
+#define _FACDD 0x876
+#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
+
+#define DDERR_ALREADYINITIALIZED MAKE_DDHRESULT( 5 )
+#define DDERR_CANNOTATTACHSURFACE MAKE_DDHRESULT( 10 )
+#define DDERR_CANNOTDETACHSURFACE MAKE_DDHRESULT( 20 )
+#define DDERR_CURRENTLYNOTAVAIL MAKE_DDHRESULT( 40 )
+#define DDERR_EXCEPTION MAKE_DDHRESULT( 55 )
+#define DDERR_GENERIC E_FAIL
+#define DDERR_HEIGHTALIGN MAKE_DDHRESULT( 90 )
+#define DDERR_INCOMPATIBLEPRIMARY MAKE_DDHRESULT( 95 )
+#define DDERR_INVALIDCAPS MAKE_DDHRESULT( 100 )
+#define DDERR_INVALIDCLIPLIST MAKE_DDHRESULT( 110 )
+#define DDERR_INVALIDMODE MAKE_DDHRESULT( 120 )
+#define DDERR_INVALIDOBJECT MAKE_DDHRESULT( 130 )
+#define DDERR_INVALIDPARAMS E_INVALIDARG
+#define DDERR_INVALIDPIXELFORMAT MAKE_DDHRESULT( 145 )
+#define DDERR_INVALIDRECT MAKE_DDHRESULT( 150 )
+#define DDERR_LOCKEDSURFACES MAKE_DDHRESULT( 160 )
+#define DDERR_NO3D MAKE_DDHRESULT( 170 )
+#define DDERR_NOALPHAHW MAKE_DDHRESULT( 180 )
+#define DDERR_NOSTEREOHARDWARE MAKE_DDHRESULT( 181 )
+#define DDERR_NOSURFACELEFT MAKE_DDHRESULT( 182 )
+#define DDERR_NOCLIPLIST MAKE_DDHRESULT( 205 )
+#define DDERR_NOCOLORCONVHW MAKE_DDHRESULT( 210 )
+#define DDERR_NOCOOPERATIVELEVELSET MAKE_DDHRESULT( 212 )
+#define DDERR_NOCOLORKEY MAKE_DDHRESULT( 215 )
+#define DDERR_NOCOLORKEYHW MAKE_DDHRESULT( 220 )
+#define DDERR_NODIRECTDRAWSUPPORT MAKE_DDHRESULT( 222 )
+#define DDERR_NOEXCLUSIVEMODE MAKE_DDHRESULT( 225 )
+#define DDERR_NOFLIPHW MAKE_DDHRESULT( 230 )
+#define DDERR_NOGDI MAKE_DDHRESULT( 240 )
+#define DDERR_NOMIRRORHW MAKE_DDHRESULT( 250 )
+#define DDERR_NOTFOUND MAKE_DDHRESULT( 255 )
+#define DDERR_NOOVERLAYHW MAKE_DDHRESULT( 260 )
+#define DDERR_OVERLAPPINGRECTS MAKE_DDHRESULT( 270 )
+#define DDERR_NORASTEROPHW MAKE_DDHRESULT( 280 )
+#define DDERR_NOROTATIONHW MAKE_DDHRESULT( 290 )
+#define DDERR_NOSTRETCHHW MAKE_DDHRESULT( 310 )
+#define DDERR_NOT4BITCOLOR MAKE_DDHRESULT( 316 )
+#define DDERR_NOT4BITCOLORINDEX MAKE_DDHRESULT( 317 )
+#define DDERR_NOT8BITCOLOR MAKE_DDHRESULT( 320 )
+#define DDERR_NOTEXTUREHW MAKE_DDHRESULT( 330 )
+#define DDERR_NOVSYNCHW MAKE_DDHRESULT( 335 )
+#define DDERR_NOZBUFFERHW MAKE_DDHRESULT( 340 )
+#define DDERR_NOZOVERLAYHW MAKE_DDHRESULT( 350 )
+#define DDERR_OUTOFCAPS MAKE_DDHRESULT( 360 )
+#define DDERR_OUTOFMEMORY E_OUTOFMEMORY
+#define DDERR_OUTOFVIDEOMEMORY MAKE_DDHRESULT( 380 )
+#define DDERR_OVERLAYCANTCLIP MAKE_DDHRESULT( 382 )
+#define DDERR_OVERLAYCOLORKEYONLYONEACTIVE MAKE_DDHRESULT( 384 )
+#define DDERR_PALETTEBUSY MAKE_DDHRESULT( 387 )
+#define DDERR_COLORKEYNOTSET MAKE_DDHRESULT( 400 )
+#define DDERR_SURFACEALREADYATTACHED MAKE_DDHRESULT( 410 )
+#define DDERR_SURFACEALREADYDEPENDENT MAKE_DDHRESULT( 420 )
+#define DDERR_SURFACEBUSY MAKE_DDHRESULT( 430 )
+#define DDERR_CANTLOCKSURFACE MAKE_DDHRESULT( 435 )
+#define DDERR_SURFACEISOBSCURED MAKE_DDHRESULT( 440 )
+#define DDERR_SURFACELOST MAKE_DDHRESULT( 450 )
+#define DDERR_SURFACENOTATTACHED MAKE_DDHRESULT( 460 )
+#define DDERR_TOOBIGHEIGHT MAKE_DDHRESULT( 470 )
+#define DDERR_TOOBIGSIZE MAKE_DDHRESULT( 480 )
+#define DDERR_TOOBIGWIDTH MAKE_DDHRESULT( 490 )
+#define DDERR_UNSUPPORTED E_NOTIMPL
+#define DDERR_UNSUPPORTEDFORMAT MAKE_DDHRESULT( 510 )
+#define DDERR_UNSUPPORTEDMASK MAKE_DDHRESULT( 520 )
+#define DDERR_INVALIDSTREAM MAKE_DDHRESULT( 521 )
+#define DDERR_VERTICALBLANKINPROGRESS MAKE_DDHRESULT( 537 )
+#define DDERR_WASSTILLDRAWING MAKE_DDHRESULT( 540 )
+#define DDERR_DDSCAPSCOMPLEXREQUIRED MAKE_DDHRESULT( 542 )
+#define DDERR_XALIGN MAKE_DDHRESULT( 560 )
+#define DDERR_INVALIDDIRECTDRAWGUID MAKE_DDHRESULT( 561 )
+#define DDERR_DIRECTDRAWALREADYCREATED MAKE_DDHRESULT( 562 )
+#define DDERR_NODIRECTDRAWHW MAKE_DDHRESULT( 563 )
+#define DDERR_PRIMARYSURFACEALREADYEXISTS MAKE_DDHRESULT( 564 )
+#define DDERR_NOEMULATION MAKE_DDHRESULT( 565 )
+#define DDERR_REGIONTOOSMALL MAKE_DDHRESULT( 566 )
+#define DDERR_CLIPPERISUSINGHWND MAKE_DDHRESULT( 567 )
+#define DDERR_NOCLIPPERATTACHED MAKE_DDHRESULT( 568 )
+#define DDERR_NOHWND MAKE_DDHRESULT( 569 )
+#define DDERR_HWNDSUBCLASSED MAKE_DDHRESULT( 570 )
+#define DDERR_HWNDALREADYSET MAKE_DDHRESULT( 571 )
+#define DDERR_NOPALETTEATTACHED MAKE_DDHRESULT( 572 )
+#define DDERR_NOPALETTEHW MAKE_DDHRESULT( 573 )
+#define DDERR_BLTFASTCANTCLIP MAKE_DDHRESULT( 574 )
+#define DDERR_NOBLTHW MAKE_DDHRESULT( 575 )
+#define DDERR_NODDROPSHW MAKE_DDHRESULT( 576 )
+#define DDERR_OVERLAYNOTVISIBLE MAKE_DDHRESULT( 577 )
+#define DDERR_NOOVERLAYDEST MAKE_DDHRESULT( 578 )
+#define DDERR_INVALIDPOSITION MAKE_DDHRESULT( 579 )
+#define DDERR_NOTAOVERLAYSURFACE MAKE_DDHRESULT( 580 )
+#define DDERR_EXCLUSIVEMODEALREADYSET MAKE_DDHRESULT( 581 )
+#define DDERR_NOTFLIPPABLE MAKE_DDHRESULT( 582 )
+#define DDERR_CANTDUPLICATE MAKE_DDHRESULT( 583 )
+#define DDERR_NOTLOCKED MAKE_DDHRESULT( 584 )
+#define DDERR_CANTCREATEDC MAKE_DDHRESULT( 585 )
+#define DDERR_NODC MAKE_DDHRESULT( 586 )
+#define DDERR_WRONGMODE MAKE_DDHRESULT( 587 )
+#define DDERR_IMPLICITLYCREATED MAKE_DDHRESULT( 588 )
+#define DDERR_NOTPALETTIZED MAKE_DDHRESULT( 589 )
+#define DDERR_UNSUPPORTEDMODE MAKE_DDHRESULT( 590 )
+#define DDERR_NOMIPMAPHW MAKE_DDHRESULT( 591 )
+#define DDERR_INVALIDSURFACETYPE MAKE_DDHRESULT( 592 )
+#define DDERR_NOOPTIMIZEHW MAKE_DDHRESULT( 600 )
+#define DDERR_NOTLOADED MAKE_DDHRESULT( 601 )
+#define DDERR_NOFOCUSWINDOW MAKE_DDHRESULT( 602 )
+#define DDERR_NOTONMIPMAPSUBLEVEL MAKE_DDHRESULT( 603 )
+#define DDERR_DCALREADYCREATED MAKE_DDHRESULT( 620 )
+#define DDERR_NONONLOCALVIDMEM MAKE_DDHRESULT( 630 )
+#define DDERR_CANTPAGELOCK MAKE_DDHRESULT( 640 )
+#define DDERR_CANTPAGEUNLOCK MAKE_DDHRESULT( 660 )
+#define DDERR_NOTPAGELOCKED MAKE_DDHRESULT( 680 )
+#define DDERR_MOREDATA MAKE_DDHRESULT( 690 )
+#define DDERR_EXPIRED MAKE_DDHRESULT( 691 )
+#define DDERR_TESTFINISHED MAKE_DDHRESULT( 692 )
+#define DDERR_NEWMODE MAKE_DDHRESULT( 693 )
+#define DDERR_D3DNOTINITIALIZED MAKE_DDHRESULT( 694 )
+#define DDERR_VIDEONOTACTIVE MAKE_DDHRESULT( 695 )
+#define DDERR_NOMONITORINFORMATION MAKE_DDHRESULT( 696 )
+#define DDERR_NODRIVERSUPPORT MAKE_DDHRESULT( 697 )
+#define DDERR_DEVICEDOESNTOWNSURFACE MAKE_DDHRESULT( 699 )
+#define DDERR_NOTINITIALIZED CO_E_NOTINITIALIZED
+
+/* dwFlags for Blt* */
+#define DDBLT_ALPHADEST 0x00000001
+#define DDBLT_ALPHADESTCONSTOVERRIDE 0x00000002
+#define DDBLT_ALPHADESTNEG 0x00000004
+#define DDBLT_ALPHADESTSURFACEOVERRIDE 0x00000008
+#define DDBLT_ALPHAEDGEBLEND 0x00000010
+#define DDBLT_ALPHASRC 0x00000020
+#define DDBLT_ALPHASRCCONSTOVERRIDE 0x00000040
+#define DDBLT_ALPHASRCNEG 0x00000080
+#define DDBLT_ALPHASRCSURFACEOVERRIDE 0x00000100
+#define DDBLT_ASYNC 0x00000200
+#define DDBLT_COLORFILL 0x00000400
+#define DDBLT_DDFX 0x00000800
+#define DDBLT_DDROPS 0x00001000
+#define DDBLT_KEYDEST 0x00002000
+#define DDBLT_KEYDESTOVERRIDE 0x00004000
+#define DDBLT_KEYSRC 0x00008000
+#define DDBLT_KEYSRCOVERRIDE 0x00010000
+#define DDBLT_ROP 0x00020000
+#define DDBLT_ROTATIONANGLE 0x00040000
+#define DDBLT_ZBUFFER 0x00080000
+#define DDBLT_ZBUFFERDESTCONSTOVERRIDE 0x00100000
+#define DDBLT_ZBUFFERDESTOVERRIDE 0x00200000
+#define DDBLT_ZBUFFERSRCCONSTOVERRIDE 0x00400000
+#define DDBLT_ZBUFFERSRCOVERRIDE 0x00800000
+#define DDBLT_WAIT 0x01000000
+#define DDBLT_DEPTHFILL 0x02000000
+#define DDBLT_DONOTWAIT 0x08000000
+
+/* dwTrans for BltFast */
+#define DDBLTFAST_NOCOLORKEY 0x00000000
+#define DDBLTFAST_SRCCOLORKEY 0x00000001
+#define DDBLTFAST_DESTCOLORKEY 0x00000002
+#define DDBLTFAST_WAIT 0x00000010
+#define DDBLTFAST_DONOTWAIT 0x00000020
+
+/* dwFlags for Flip */
+#define DDFLIP_WAIT 0x00000001
+#define DDFLIP_EVEN 0x00000002 /* only valid for overlay */
+#define DDFLIP_ODD 0x00000004 /* only valid for overlay */
+#define DDFLIP_NOVSYNC 0x00000008
+#define DDFLIP_STEREO 0x00000010
+#define DDFLIP_DONOTWAIT 0x00000020
+
+/* dwFlags for GetBltStatus */
+#define DDGBS_CANBLT 0x00000001
+#define DDGBS_ISBLTDONE 0x00000002
+
+/* dwFlags for IDirectDrawSurface7::GetFlipStatus */
+#define DDGFS_CANFLIP 1L
+#define DDGFS_ISFLIPDONE 2L
+
+/* dwFlags for IDirectDrawSurface7::SetPrivateData */
+#define DDSPD_IUNKNOWNPTR 1L
+#define DDSPD_VOLATILE 2L
+
+/* DDSCAPS.dwCaps */
+/* reserved1, was 3d capable */
+#define DDSCAPS_RESERVED1 0x00000001
+/* surface contains alpha information */
+#define DDSCAPS_ALPHA 0x00000002
+/* this surface is a backbuffer */
+#define DDSCAPS_BACKBUFFER 0x00000004
+/* complex surface structure */
+#define DDSCAPS_COMPLEX 0x00000008
+/* part of surface flipping structure */
+#define DDSCAPS_FLIP 0x00000010
+/* this surface is the frontbuffer surface */
+#define DDSCAPS_FRONTBUFFER 0x00000020
+/* this is a plain offscreen surface */
+#define DDSCAPS_OFFSCREENPLAIN 0x00000040
+/* overlay */
+#define DDSCAPS_OVERLAY 0x00000080
+/* palette objects can be created and attached to us */
+#define DDSCAPS_PALETTE 0x00000100
+/* primary surface (the one the user looks at currently)(right eye)*/
+#define DDSCAPS_PRIMARYSURFACE 0x00000200
+/* primary surface for left eye */
+#define DDSCAPS_PRIMARYSURFACELEFT 0x00000400
+/* surface exists in systemmemory */
+#define DDSCAPS_SYSTEMMEMORY 0x00000800
+/* surface can be used as a texture */
+#define DDSCAPS_TEXTURE 0x00001000
+/* surface may be destination for 3d rendering */
+#define DDSCAPS_3DDEVICE 0x00002000
+/* surface exists in videomemory */
+#define DDSCAPS_VIDEOMEMORY 0x00004000
+/* surface changes immediately visible */
+#define DDSCAPS_VISIBLE 0x00008000
+/* write only surface */
+#define DDSCAPS_WRITEONLY 0x00010000
+/* zbuffer surface */
+#define DDSCAPS_ZBUFFER 0x00020000
+/* has its own DC */
+#define DDSCAPS_OWNDC 0x00040000
+/* surface should be able to receive live video */
+#define DDSCAPS_LIVEVIDEO 0x00080000
+/* should be able to have a hw codec decompress stuff into it */
+#define DDSCAPS_HWCODEC 0x00100000
+/* mode X (320x200 or 320x240) surface */
+#define DDSCAPS_MODEX 0x00200000
+/* one mipmap surface (1 level) */
+#define DDSCAPS_MIPMAP 0x00400000
+#define DDSCAPS_RESERVED2 0x00800000
+/* memory allocation delayed until Load() */
+#define DDSCAPS_ALLOCONLOAD 0x04000000
+/* Indicates that the surface will receive data from a video port */
+#define DDSCAPS_VIDEOPORT 0x08000000
+/* surface is in local videomemory */
+#define DDSCAPS_LOCALVIDMEM 0x10000000
+/* surface is in nonlocal videomemory */
+#define DDSCAPS_NONLOCALVIDMEM 0x20000000
+/* surface is a standard VGA mode surface (NOT ModeX) */
+#define DDSCAPS_STANDARDVGAMODE 0x40000000
+/* optimized? surface */
+#define DDSCAPS_OPTIMIZED 0x80000000
+
+typedef struct _DDSCAPS {
+ DWORD dwCaps; /* capabilities of surface wanted */
+} DDSCAPS,*LPDDSCAPS;
+
+/* DDSCAPS2.dwCaps2 */
+/* indicates the surface will receive data from a video port using
+ deinterlacing hardware. */
+#define DDSCAPS2_HARDWAREDEINTERLACE 0x00000002
+/* indicates the surface will be locked very frequently. */
+#define DDSCAPS2_HINTDYNAMIC 0x00000004
+/* indicates surface can be re-ordered or retiled on load() */
+#define DDSCAPS2_HINTSTATIC 0x00000008
+/* indicates surface to be managed by directdraw/direct3D */
+#define DDSCAPS2_TEXTUREMANAGE 0x00000010
+/* reserved bits */
+#define DDSCAPS2_RESERVED1 0x00000020
+#define DDSCAPS2_RESERVED2 0x00000040
+/* indicates surface will never be locked again */
+#define DDSCAPS2_OPAQUE 0x00000080
+/* set at CreateSurface() time to indicate antialising will be used */
+#define DDSCAPS2_HINTANTIALIASING 0x00000100
+/* set at CreateSurface() time to indicate cubic environment map */
+#define DDSCAPS2_CUBEMAP 0x00000200
+/* face flags for cube maps */
+#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
+#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
+#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
+#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
+#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
+#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000
+/* specifies all faces of a cube for CreateSurface() */
+#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |\
+ DDSCAPS2_CUBEMAP_NEGATIVEX |\
+ DDSCAPS2_CUBEMAP_POSITIVEY |\
+ DDSCAPS2_CUBEMAP_NEGATIVEY |\
+ DDSCAPS2_CUBEMAP_POSITIVEZ |\
+ DDSCAPS2_CUBEMAP_NEGATIVEZ )
+/* set for mipmap sublevels on DirectX7 and later. ignored by CreateSurface() */
+#define DDSCAPS2_MIPMAPSUBLEVEL 0x00010000
+/* indicates texture surface to be managed by Direct3D *only* */
+#define DDSCAPS2_D3DTEXTUREMANAGE 0x00020000
+/* indicates managed surface that can safely be lost */
+#define DDSCAPS2_DONOTPERSIST 0x00040000
+/* indicates surface is part of a stereo flipping chain */
+#define DDSCAPS2_STEREOSURFACELEFT 0x00080000
+
+typedef struct _DDSCAPS2 {
+ DWORD dwCaps; /* capabilities of surface wanted */
+ DWORD dwCaps2; /* additional capabilities */
+ DWORD dwCaps3; /* reserved capabilities */
+ DWORD dwCaps4; /* more reserved capabilities */
+} DDSCAPS2,*LPDDSCAPS2;
+
+#define DD_ROP_SPACE (256/32) /* space required to store ROP array */
+
+typedef struct _DDCAPS_DX7 /* DirectX 7 version of caps struct */
+{
+ DWORD dwSize; /* size of the DDDRIVERCAPS structure */
+ DWORD dwCaps; /* driver specific capabilities */
+ DWORD dwCaps2; /* more driver specific capabilites */
+ DWORD dwCKeyCaps; /* color key capabilities of the surface */
+ DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
+ DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
+ DWORD dwPalCaps; /* palette capabilities */
+ DWORD dwSVCaps; /* stereo vision capabilities */
+ DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
+ DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
+ DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
+ DWORD dwVidMemTotal; /* total amount of video memory */
+ DWORD dwVidMemFree; /* amount of free video memory */
+ DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
+ DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
+ DWORD dwNumFourCCCodes; /* number of four cc codes */
+ DWORD dwAlignBoundarySrc; /* source rectangle alignment */
+ DWORD dwAlignSizeSrc; /* source rectangle byte size */
+ DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
+ DWORD dwAlignSizeDest; /* dest rectangle byte size */
+ DWORD dwAlignStrideAlign; /* stride alignment */
+ DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
+ DDSCAPS ddsOldCaps; /* old DDSCAPS - superceded for DirectX6+ */
+ DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+ DWORD dwReserved3;
+ DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
+ DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
+ DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
+ DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
+ DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
+ DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
+ DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
+ DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
+ DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
+ DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
+ DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
+ DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
+ DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
+ DWORD dwCurrVideoPorts; /* current number of video ports used */
+ DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
+ DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
+ DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
+ DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
+ DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
+ DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
+ DDSCAPS2 ddsCaps; /* surface capabilities */
+} DDCAPS_DX7,*LPDDCAPS_DX7;
+
+typedef struct _DDCAPS_DX6 /* DirectX 6 version of caps struct */
+{
+ DWORD dwSize; /* size of the DDDRIVERCAPS structure */
+ DWORD dwCaps; /* driver specific capabilities */
+ DWORD dwCaps2; /* more driver specific capabilites */
+ DWORD dwCKeyCaps; /* color key capabilities of the surface */
+ DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
+ DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
+ DWORD dwPalCaps; /* palette capabilities */
+ DWORD dwSVCaps; /* stereo vision capabilities */
+ DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
+ DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
+ DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
+ DWORD dwVidMemTotal; /* total amount of video memory */
+ DWORD dwVidMemFree; /* amount of free video memory */
+ DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
+ DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
+ DWORD dwNumFourCCCodes; /* number of four cc codes */
+ DWORD dwAlignBoundarySrc; /* source rectangle alignment */
+ DWORD dwAlignSizeSrc; /* source rectangle byte size */
+ DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
+ DWORD dwAlignSizeDest; /* dest rectangle byte size */
+ DWORD dwAlignStrideAlign; /* stride alignment */
+ DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
+ DDSCAPS ddsOldCaps; /* old DDSCAPS - superceded for DirectX6+ */
+ DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+ DWORD dwReserved3;
+ DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
+ DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
+ DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
+ DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
+ DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
+ DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
+ DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
+ DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
+ DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
+ DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
+ DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
+ DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
+ DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
+ DWORD dwCurrVideoPorts; /* current number of video ports used */
+ DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
+ DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
+ DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
+ DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
+ DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
+ DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
+ /* and one new member for DirectX 6 */
+ DDSCAPS2 ddsCaps; /* surface capabilities */
+} DDCAPS_DX6,*LPDDCAPS_DX6;
+
+typedef struct _DDCAPS_DX5 /* DirectX5 version of caps struct */
+{
+ DWORD dwSize; /* size of the DDDRIVERCAPS structure */
+ DWORD dwCaps; /* driver specific capabilities */
+ DWORD dwCaps2; /* more driver specific capabilites */
+ DWORD dwCKeyCaps; /* color key capabilities of the surface */
+ DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
+ DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
+ DWORD dwPalCaps; /* palette capabilities */
+ DWORD dwSVCaps; /* stereo vision capabilities */
+ DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
+ DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
+ DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
+ DWORD dwVidMemTotal; /* total amount of video memory */
+ DWORD dwVidMemFree; /* amount of free video memory */
+ DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
+ DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
+ DWORD dwNumFourCCCodes; /* number of four cc codes */
+ DWORD dwAlignBoundarySrc; /* source rectangle alignment */
+ DWORD dwAlignSizeSrc; /* source rectangle byte size */
+ DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
+ DWORD dwAlignSizeDest; /* dest rectangle byte size */
+ DWORD dwAlignStrideAlign; /* stride alignment */
+ DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
+ DDSCAPS ddsCaps; /* DDSCAPS structure has all the general capabilities */
+ DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+ DWORD dwReserved3;
+ DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
+ DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
+ DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
+ DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
+ DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
+ DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
+ DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
+ DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
+ DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
+ DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
+ DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
+ DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
+ /* the following are the new DirectX 5 members */
+ DWORD dwMaxVideoPorts; /* maximum number of usable video ports */
+ DWORD dwCurrVideoPorts; /* current number of video ports used */
+ DWORD dwSVBCaps2; /* more driver specific capabilities for System->Vmem blts */
+ DWORD dwNLVBCaps; /* driver specific capabilities for non-local->local vidmem blts */
+ DWORD dwNLVBCaps2; /* more driver specific capabilities non-local->local vidmem blts */
+ DWORD dwNLVBCKeyCaps; /* driver color key capabilities for non-local->local vidmem blts */
+ DWORD dwNLVBFXCaps; /* driver FX capabilities for non-local->local blts */
+ DWORD dwNLVBRops[DD_ROP_SPACE]; /* ROPS supported for non-local->local blts */
+} DDCAPS_DX5,*LPDDCAPS_DX5;
+
+typedef struct _DDCAPS_DX3 /* DirectX3 version of caps struct */
+{
+ DWORD dwSize; /* size of the DDDRIVERCAPS structure */
+ DWORD dwCaps; /* driver specific capabilities */
+ DWORD dwCaps2; /* more driver specific capabilites */
+ DWORD dwCKeyCaps; /* color key capabilities of the surface */
+ DWORD dwFXCaps; /* driver specific stretching and effects capabilites */
+ DWORD dwFXAlphaCaps; /* alpha driver specific capabilities */
+ DWORD dwPalCaps; /* palette capabilities */
+ DWORD dwSVCaps; /* stereo vision capabilities */
+ DWORD dwAlphaBltConstBitDepths; /* DDBD_2,4,8 */
+ DWORD dwAlphaBltPixelBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaBltSurfaceBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaOverlayConstBitDepths; /* DDBD_2,4,8 */
+ DWORD dwAlphaOverlayPixelBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
+ DWORD dwZBufferBitDepths; /* DDBD_8,16,24,32 */
+ DWORD dwVidMemTotal; /* total amount of video memory */
+ DWORD dwVidMemFree; /* amount of free video memory */
+ DWORD dwMaxVisibleOverlays; /* maximum number of visible overlays */
+ DWORD dwCurrVisibleOverlays; /* current number of visible overlays */
+ DWORD dwNumFourCCCodes; /* number of four cc codes */
+ DWORD dwAlignBoundarySrc; /* source rectangle alignment */
+ DWORD dwAlignSizeSrc; /* source rectangle byte size */
+ DWORD dwAlignBoundaryDest; /* dest rectangle alignment */
+ DWORD dwAlignSizeDest; /* dest rectangle byte size */
+ DWORD dwAlignStrideAlign; /* stride alignment */
+ DWORD dwRops[DD_ROP_SPACE]; /* ROPS supported */
+ DDSCAPS ddsCaps; /* DDSCAPS structure has all the general capabilities */
+ DWORD dwMinOverlayStretch; /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxOverlayStretch; /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMinLiveVideoStretch; /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxLiveVideoStretch; /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMinHwCodecStretch; /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwMaxHwCodecStretch; /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+ DWORD dwReserved3;
+ DWORD dwSVBCaps; /* driver specific capabilities for System->Vmem blts */
+ DWORD dwSVBCKeyCaps; /* driver color key capabilities for System->Vmem blts */
+ DWORD dwSVBFXCaps; /* driver FX capabilities for System->Vmem blts */
+ DWORD dwSVBRops[DD_ROP_SPACE];/* ROPS supported for System->Vmem blts */
+ DWORD dwVSBCaps; /* driver specific capabilities for Vmem->System blts */
+ DWORD dwVSBCKeyCaps; /* driver color key capabilities for Vmem->System blts */
+ DWORD dwVSBFXCaps; /* driver FX capabilities for Vmem->System blts */
+ DWORD dwVSBRops[DD_ROP_SPACE];/* ROPS supported for Vmem->System blts */
+ DWORD dwSSBCaps; /* driver specific capabilities for System->System blts */
+ DWORD dwSSBCKeyCaps; /* driver color key capabilities for System->System blts */
+ DWORD dwSSBFXCaps; /* driver FX capabilities for System->System blts */
+ DWORD dwSSBRops[DD_ROP_SPACE];/* ROPS supported for System->System blts */
+ DWORD dwReserved4;
+ DWORD dwReserved5;
+ DWORD dwReserved6;
+} DDCAPS_DX3,*LPDDCAPS_DX3;
+
+/* set caps struct according to DIRECTDRAW_VERSION */
+
+#if DIRECTDRAW_VERSION <= 0x300
+typedef DDCAPS_DX3 DDCAPS;
+#elif DIRECTDRAW_VERSION <= 0x500
+typedef DDCAPS_DX5 DDCAPS;
+#elif DIRECTDRAW_VERSION <= 0x600
+typedef DDCAPS_DX6 DDCAPS;
+#else
+typedef DDCAPS_DX7 DDCAPS;
+#endif
+
+typedef DDCAPS *LPDDCAPS;
+
+/* DDCAPS.dwCaps */
+#define DDCAPS_3D 0x00000001
+#define DDCAPS_ALIGNBOUNDARYDEST 0x00000002
+#define DDCAPS_ALIGNSIZEDEST 0x00000004
+#define DDCAPS_ALIGNBOUNDARYSRC 0x00000008
+#define DDCAPS_ALIGNSIZESRC 0x00000010
+#define DDCAPS_ALIGNSTRIDE 0x00000020
+#define DDCAPS_BLT 0x00000040
+#define DDCAPS_BLTQUEUE 0x00000080
+#define DDCAPS_BLTFOURCC 0x00000100
+#define DDCAPS_BLTSTRETCH 0x00000200
+#define DDCAPS_GDI 0x00000400
+#define DDCAPS_OVERLAY 0x00000800
+#define DDCAPS_OVERLAYCANTCLIP 0x00001000
+#define DDCAPS_OVERLAYFOURCC 0x00002000
+#define DDCAPS_OVERLAYSTRETCH 0x00004000
+#define DDCAPS_PALETTE 0x00008000
+#define DDCAPS_PALETTEVSYNC 0x00010000
+#define DDCAPS_READSCANLINE 0x00020000
+#define DDCAPS_STEREOVIEW 0x00040000
+#define DDCAPS_VBI 0x00080000
+#define DDCAPS_ZBLTS 0x00100000
+#define DDCAPS_ZOVERLAYS 0x00200000
+#define DDCAPS_COLORKEY 0x00400000
+#define DDCAPS_ALPHA 0x00800000
+#define DDCAPS_COLORKEYHWASSIST 0x01000000
+#define DDCAPS_NOHARDWARE 0x02000000
+#define DDCAPS_BLTCOLORFILL 0x04000000
+#define DDCAPS_BANKSWITCHED 0x08000000
+#define DDCAPS_BLTDEPTHFILL 0x10000000
+#define DDCAPS_CANCLIP 0x20000000
+#define DDCAPS_CANCLIPSTRETCHED 0x40000000
+#define DDCAPS_CANBLTSYSMEM 0x80000000
+
+/* DDCAPS.dwCaps2 */
+#define DDCAPS2_CERTIFIED 0x00000001
+#define DDCAPS2_NO2DDURING3DSCENE 0x00000002
+#define DDCAPS2_VIDEOPORT 0x00000004
+#define DDCAPS2_AUTOFLIPOVERLAY 0x00000008
+#define DDCAPS2_CANBOBINTERLEAVED 0x00000010
+#define DDCAPS2_CANBOBNONINTERLEAVED 0x00000020
+#define DDCAPS2_COLORCONTROLOVERLAY 0x00000040
+#define DDCAPS2_COLORCONTROLPRIMARY 0x00000080
+#define DDCAPS2_CANDROPZ16BIT 0x00000100
+#define DDCAPS2_NONLOCALVIDMEM 0x00000200
+#define DDCAPS2_NONLOCALVIDMEMCAPS 0x00000400
+#define DDCAPS2_NOPAGELOCKREQUIRED 0x00000800
+#define DDCAPS2_WIDESURFACES 0x00001000
+#define DDCAPS2_CANFLIPODDEVEN 0x00002000
+#define DDCAPS2_CANBOBHARDWARE 0x00004000
+#define DDCAPS2_COPYFOURCC 0x00008000
+#define DDCAPS2_PRIMARYGAMMA 0x00020000
+#define DDCAPS2_CANRENDERWINDOWED 0x00080000
+#define DDCAPS2_CANCALIBRATEGAMMA 0x00100000
+#define DDCAPS2_FLIPINTERVAL 0x00200000
+#define DDCAPS2_FLIPNOVSYNC 0x00400000
+#define DDCAPS2_CANMANAGETEXTURE 0x00800000
+#define DDCAPS2_TEXMANINNONLOCALVIDMEM 0x01000000
+#define DDCAPS2_STEREO 0x02000000
+#define DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL 0x04000000
+
+
+/* Set/Get Colour Key Flags */
+#define DDCKEY_COLORSPACE 0x00000001 /* Struct is single colour space */
+#define DDCKEY_DESTBLT 0x00000002 /* To be used as dest for blt */
+#define DDCKEY_DESTOVERLAY 0x00000004 /* To be used as dest for CK overlays */
+#define DDCKEY_SRCBLT 0x00000008 /* To be used as src for blt */
+#define DDCKEY_SRCOVERLAY 0x00000010 /* To be used as src for CK overlays */
+
+typedef struct _DDCOLORKEY
+{
+ DWORD dwColorSpaceLowValue;/* low boundary of color space that is to
+ * be treated as Color Key, inclusive
+ */
+ DWORD dwColorSpaceHighValue;/* high boundary of color space that is
+ * to be treated as Color Key, inclusive
+ */
+} DDCOLORKEY,*LPDDCOLORKEY;
+
+/* ddCKEYCAPS bits */
+#define DDCKEYCAPS_DESTBLT 0x00000001
+#define DDCKEYCAPS_DESTBLTCLRSPACE 0x00000002
+#define DDCKEYCAPS_DESTBLTCLRSPACEYUV 0x00000004
+#define DDCKEYCAPS_DESTBLTYUV 0x00000008
+#define DDCKEYCAPS_DESTOVERLAY 0x00000010
+#define DDCKEYCAPS_DESTOVERLAYCLRSPACE 0x00000020
+#define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV 0x00000040
+#define DDCKEYCAPS_DESTOVERLAYONEACTIVE 0x00000080
+#define DDCKEYCAPS_DESTOVERLAYYUV 0x00000100
+#define DDCKEYCAPS_SRCBLT 0x00000200
+#define DDCKEYCAPS_SRCBLTCLRSPACE 0x00000400
+#define DDCKEYCAPS_SRCBLTCLRSPACEYUV 0x00000800
+#define DDCKEYCAPS_SRCBLTYUV 0x00001000
+#define DDCKEYCAPS_SRCOVERLAY 0x00002000
+#define DDCKEYCAPS_SRCOVERLAYCLRSPACE 0x00004000
+#define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV 0x00008000
+#define DDCKEYCAPS_SRCOVERLAYONEACTIVE 0x00010000
+#define DDCKEYCAPS_SRCOVERLAYYUV 0x00020000
+#define DDCKEYCAPS_NOCOSTOVERLAY 0x00040000
+
+typedef struct _DDPIXELFORMAT {
+ DWORD dwSize; /* 0: size of structure */
+ DWORD dwFlags; /* 4: pixel format flags */
+ DWORD dwFourCC; /* 8: (FOURCC code) */
+ union {
+ DWORD dwRGBBitCount; /* C: how many bits per pixel */
+ DWORD dwYUVBitCount; /* C: how many bits per pixel */
+ DWORD dwZBufferBitDepth; /* C: how many bits for z buffers */
+ DWORD dwAlphaBitDepth; /* C: how many bits for alpha channels*/
+ DWORD dwLuminanceBitCount;
+ DWORD dwBumpBitCount;
+ } DUMMYUNIONNAME1;
+ union {
+ DWORD dwRBitMask; /* 10: mask for red bit*/
+ DWORD dwYBitMask; /* 10: mask for Y bits*/
+ DWORD dwStencilBitDepth;
+ DWORD dwLuminanceBitMask;
+ DWORD dwBumpDuBitMask;
+ } DUMMYUNIONNAME2;
+ union {
+ DWORD dwGBitMask; /* 14: mask for green bits*/
+ DWORD dwUBitMask; /* 14: mask for U bits*/
+ DWORD dwZBitMask;
+ DWORD dwBumpDvBitMask;
+ } DUMMYUNIONNAME3;
+ union {
+ DWORD dwBBitMask; /* 18: mask for blue bits*/
+ DWORD dwVBitMask; /* 18: mask for V bits*/
+ DWORD dwStencilBitMask;
+ DWORD dwBumpLuminanceBitMask;
+ } DUMMYUNIONNAME4;
+ union {
+ DWORD dwRGBAlphaBitMask; /* 1C: mask for alpha channel */
+ DWORD dwYUVAlphaBitMask; /* 1C: mask for alpha channel */
+ DWORD dwLuminanceAlphaBitMask;
+ DWORD dwRGBZBitMask; /* 1C: mask for Z channel */
+ DWORD dwYUVZBitMask; /* 1C: mask for Z channel */
+ } DUMMYUNIONNAME5;
+ /* 20: next structure */
+} DDPIXELFORMAT,*LPDDPIXELFORMAT;
+
+/* DDCAPS.dwFXCaps */
+#define DDFXCAPS_BLTALPHA 0x00000001
+#define DDFXCAPS_OVERLAYALPHA 0x00000004
+#define DDFXCAPS_BLTARITHSTRETCHYN 0x00000010
+#define DDFXCAPS_BLTARITHSTRETCHY 0x00000020
+#define DDFXCAPS_BLTMIRRORLEFTRIGHT 0x00000040
+#define DDFXCAPS_BLTMIRRORUPDOWN 0x00000080
+#define DDFXCAPS_BLTROTATION 0x00000100
+#define DDFXCAPS_BLTROTATION90 0x00000200
+#define DDFXCAPS_BLTSHRINKX 0x00000400
+#define DDFXCAPS_BLTSHRINKXN 0x00000800
+#define DDFXCAPS_BLTSHRINKY 0x00001000
+#define DDFXCAPS_BLTSHRINKYN 0x00002000
+#define DDFXCAPS_BLTSTRETCHX 0x00004000
+#define DDFXCAPS_BLTSTRETCHXN 0x00008000
+#define DDFXCAPS_BLTSTRETCHY 0x00010000
+#define DDFXCAPS_BLTSTRETCHYN 0x00020000
+#define DDFXCAPS_OVERLAYARITHSTRETCHY 0x00040000
+#define DDFXCAPS_OVERLAYARITHSTRETCHYN 0x00000008
+#define DDFXCAPS_OVERLAYSHRINKX 0x00080000
+#define DDFXCAPS_OVERLAYSHRINKXN 0x00100000
+#define DDFXCAPS_OVERLAYSHRINKY 0x00200000
+#define DDFXCAPS_OVERLAYSHRINKYN 0x00400000
+#define DDFXCAPS_OVERLAYSTRETCHX 0x00800000
+#define DDFXCAPS_OVERLAYSTRETCHXN 0x01000000
+#define DDFXCAPS_OVERLAYSTRETCHY 0x02000000
+#define DDFXCAPS_OVERLAYSTRETCHYN 0x04000000
+#define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT 0x08000000
+#define DDFXCAPS_OVERLAYMIRRORUPDOWN 0x10000000
+
+#define DDFXCAPS_OVERLAYFILTER DDFXCAPS_OVERLAYARITHSTRETCHY
+
+/* DDCAPS.dwFXAlphaCaps */
+#define DDFXALPHACAPS_BLTALPHAEDGEBLEND 0x00000001
+#define DDFXALPHACAPS_BLTALPHAPIXELS 0x00000002
+#define DDFXALPHACAPS_BLTALPHAPIXELSNEG 0x00000004
+#define DDFXALPHACAPS_BLTALPHASURFACES 0x00000008
+#define DDFXALPHACAPS_BLTALPHASURFACESNEG 0x00000010
+#define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND 0x00000020
+#define DDFXALPHACAPS_OVERLAYALPHAPIXELS 0x00000040
+#define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG 0x00000080
+#define DDFXALPHACAPS_OVERLAYALPHASURFACES 0x00000100
+#define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG 0x00000200
+
+/* DDCAPS.dwPalCaps */
+#define DDPCAPS_4BIT 0x00000001
+#define DDPCAPS_8BITENTRIES 0x00000002
+#define DDPCAPS_8BIT 0x00000004
+#define DDPCAPS_INITIALIZE 0x00000008
+#define DDPCAPS_PRIMARYSURFACE 0x00000010
+#define DDPCAPS_PRIMARYSURFACELEFT 0x00000020
+#define DDPCAPS_ALLOW256 0x00000040
+#define DDPCAPS_VSYNC 0x00000080
+#define DDPCAPS_1BIT 0x00000100
+#define DDPCAPS_2BIT 0x00000200
+#define DDPCAPS_ALPHA 0x00000400
+
+/* DDCAPS.dwSVCaps */
+/* the first 4 of these are now obsolete */
+#if DIRECTDRAW_VERSION >= 0x700 /* FIXME: I'm not sure when this switch occured */
+#define DDSVCAPS_RESERVED1 0x00000001
+#define DDSVCAPS_RESERVED2 0x00000002
+#define DDSVCAPS_RESERVED3 0x00000004
+#define DDSVCAPS_RESERVED4 0x00000008
+#else
+#define DDSVCAPS_ENIGMA 0x00000001
+#define DDSVCAPS_FLICKER 0x00000002
+#define DDSVCAPS_REDBLUE 0x00000004
+#define DDSVCAPS_SPLIT 0x00000008
+#endif
+#define DDSVCAPS_STEREOSEQUENTIAL 0x00000010
+
+/* BitDepths */
+#define DDBD_1 0x00004000
+#define DDBD_2 0x00002000
+#define DDBD_4 0x00001000
+#define DDBD_8 0x00000800
+#define DDBD_16 0x00000400
+#define DDBD_24 0x00000200
+#define DDBD_32 0x00000100
+
+/* DDOVERLAYFX.dwDDFX */
+#define DDOVERFX_ARITHSTRETCHY 0x00000001
+#define DDOVERFX_MIRRORLEFTRIGHT 0x00000002
+#define DDOVERFX_MIRRORUPDOWN 0x00000004
+
+/* UpdateOverlay flags */
+#define DDOVER_ALPHADEST 0x00000001
+#define DDOVER_ALPHADESTCONSTOVERRIDE 0x00000002
+#define DDOVER_ALPHADESTNEG 0x00000004
+#define DDOVER_ALPHADESTSURFACEOVERRIDE 0x00000008
+#define DDOVER_ALPHAEDGEBLEND 0x00000010
+#define DDOVER_ALPHASRC 0x00000020
+#define DDOVER_ALPHASRCCONSTOVERRIDE 0x00000040
+#define DDOVER_ALPHASRCNEG 0x00000080
+#define DDOVER_ALPHASRCSURFACEOVERRIDE 0x00000100
+#define DDOVER_HIDE 0x00000200
+#define DDOVER_KEYDEST 0x00000400
+#define DDOVER_KEYDESTOVERRIDE 0x00000800
+#define DDOVER_KEYSRC 0x00001000
+#define DDOVER_KEYSRCOVERRIDE 0x00002000
+#define DDOVER_SHOW 0x00004000
+#define DDOVER_ADDDIRTYRECT 0x00008000
+#define DDOVER_REFRESHDIRTYRECTS 0x00010000
+#define DDOVER_REFRESHALL 0x00020000
+#define DDOVER_DDFX 0x00080000
+#define DDOVER_AUTOFLIP 0x00100000
+#define DDOVER_BOB 0x00200000
+#define DDOVER_OVERRIDEBOBWEAVE 0x00400000
+#define DDOVER_INTERLEAVED 0x00800000
+
+/* DDCOLORKEY.dwFlags */
+#define DDPF_ALPHAPIXELS 0x00000001
+#define DDPF_ALPHA 0x00000002
+#define DDPF_FOURCC 0x00000004
+#define DDPF_PALETTEINDEXED4 0x00000008
+#define DDPF_PALETTEINDEXEDTO8 0x00000010
+#define DDPF_PALETTEINDEXED8 0x00000020
+#define DDPF_RGB 0x00000040
+#define DDPF_COMPRESSED 0x00000080
+#define DDPF_RGBTOYUV 0x00000100
+#define DDPF_YUV 0x00000200
+#define DDPF_ZBUFFER 0x00000400
+#define DDPF_PALETTEINDEXED1 0x00000800
+#define DDPF_PALETTEINDEXED2 0x00001000
+#define DDPF_ZPIXELS 0x00002000
+#define DDPF_STENCILBUFFER 0x00004000
+#define DDPF_ALPHAPREMULT 0x00008000
+#define DDPF_LUMINANCE 0x00020000
+#define DDPF_BUMPLUMINANCE 0x00040000
+#define DDPF_BUMPDUDV 0x00080000
+
+/* SetCooperativeLevel dwFlags */
+#define DDSCL_FULLSCREEN 0x00000001
+#define DDSCL_ALLOWREBOOT 0x00000002
+#define DDSCL_NOWINDOWCHANGES 0x00000004
+#define DDSCL_NORMAL 0x00000008
+#define DDSCL_EXCLUSIVE 0x00000010
+#define DDSCL_ALLOWMODEX 0x00000040
+#define DDSCL_SETFOCUSWINDOW 0x00000080
+#define DDSCL_SETDEVICEWINDOW 0x00000100
+#define DDSCL_CREATEDEVICEWINDOW 0x00000200
+#define DDSCL_MULTITHREADED 0x00000400
+#define DDSCL_FPUSETUP 0x00000800
+#define DDSCL_FPUPRESERVE 0x00001000
+
+
+/* DDSURFACEDESC.dwFlags */
+#define DDSD_CAPS 0x00000001
+#define DDSD_HEIGHT 0x00000002
+#define DDSD_WIDTH 0x00000004
+#define DDSD_PITCH 0x00000008
+#define DDSD_BACKBUFFERCOUNT 0x00000020
+#define DDSD_ZBUFFERBITDEPTH 0x00000040
+#define DDSD_ALPHABITDEPTH 0x00000080
+#define DDSD_LPSURFACE 0x00000800
+#define DDSD_PIXELFORMAT 0x00001000
+#define DDSD_CKDESTOVERLAY 0x00002000
+#define DDSD_CKDESTBLT 0x00004000
+#define DDSD_CKSRCOVERLAY 0x00008000
+#define DDSD_CKSRCBLT 0x00010000
+#define DDSD_MIPMAPCOUNT 0x00020000
+#define DDSD_REFRESHRATE 0x00040000
+#define DDSD_LINEARSIZE 0x00080000
+#define DDSD_TEXTURESTAGE 0x00100000
+#define DDSD_FVF 0x00200000
+#define DDSD_SRCVBHANDLE 0x00400000
+#define DDSD_ALL 0x007ff9ee
+
+/* EnumSurfaces flags */
+#define DDENUMSURFACES_ALL 0x00000001
+#define DDENUMSURFACES_MATCH 0x00000002
+#define DDENUMSURFACES_NOMATCH 0x00000004
+#define DDENUMSURFACES_CANBECREATED 0x00000008
+#define DDENUMSURFACES_DOESEXIST 0x00000010
+
+/* SetDisplayMode flags */
+#define DDSDM_STANDARDVGAMODE 0x00000001
+
+/* EnumDisplayModes flags */
+#define DDEDM_REFRESHRATES 0x00000001
+#define DDEDM_STANDARDVGAMODES 0x00000002
+
+/* WaitForVerticalDisplay flags */
+
+#define DDWAITVB_BLOCKBEGIN 0x00000001
+#define DDWAITVB_BLOCKBEGINEVENT 0x00000002
+#define DDWAITVB_BLOCKEND 0x00000004
+
+typedef struct _DDSURFACEDESC
+{
+ DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/
+ DWORD dwFlags; /* 4: determines what fields are valid*/
+ DWORD dwHeight; /* 8: height of surface to be created*/
+ DWORD dwWidth; /* C: width of input surface*/
+ union {
+ LONG lPitch; /* 10: distance to start of next line (return value only)*/
+ DWORD dwLinearSize;
+ } DUMMYUNIONNAME1;
+ DWORD dwBackBufferCount;/* 14: number of back buffers requested*/
+ union {
+ DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/
+ DWORD dwZBufferBitDepth;/*18: depth of Z buffer requested*/
+ DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
+ } DUMMYUNIONNAME2;
+ DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/
+ DWORD dwReserved; /* 20:reserved*/
+ LPVOID lpSurface; /* 24:pointer to the associated surface memory*/
+ DDCOLORKEY ddckCKDestOverlay;/* 28: CK for dest overlay use*/
+ DDCOLORKEY ddckCKDestBlt; /* 30: CK for destination blt use*/
+ DDCOLORKEY ddckCKSrcOverlay;/* 38: CK for source overlay use*/
+ DDCOLORKEY ddckCKSrcBlt; /* 40: CK for source blt use*/
+ DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/
+ DDSCAPS ddsCaps; /* 68: direct draw surface caps */
+} DDSURFACEDESC,*LPDDSURFACEDESC;
+
+typedef struct _DDSURFACEDESC2
+{
+ DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/
+ DWORD dwFlags; /* 4: determines what fields are valid*/
+ DWORD dwHeight; /* 8: height of surface to be created*/
+ DWORD dwWidth; /* C: width of input surface*/
+ union {
+ LONG lPitch; /*10: distance to start of next line (return value only)*/
+ DWORD dwLinearSize; /*10: formless late-allocated optimized surface size */
+ } DUMMYUNIONNAME1;
+ DWORD dwBackBufferCount;/* 14: number of back buffers requested*/
+ union {
+ DWORD dwMipMapCount;/* 18:number of mip-map levels requested*/
+ DWORD dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
+ DWORD dwSrcVBHandle;/* 18:source used in VB::Optimize */
+ } DUMMYUNIONNAME2;
+ DWORD dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/
+ DWORD dwReserved; /* 20:reserved*/
+ LPVOID lpSurface; /* 24:pointer to the associated surface memory*/
+ union {
+ DDCOLORKEY ddckCKDestOverlay; /* 28: CK for dest overlay use*/
+ DWORD dwEmptyFaceColor; /* 28: color for empty cubemap faces */
+ } DUMMYUNIONNAME3;
+ DDCOLORKEY ddckCKDestBlt; /* 30: CK for destination blt use*/
+ DDCOLORKEY ddckCKSrcOverlay;/* 38: CK for source overlay use*/
+ DDCOLORKEY ddckCKSrcBlt; /* 40: CK for source blt use*/
+
+ union {
+ DDPIXELFORMAT ddpfPixelFormat;/* 48: pixel format description of the surface*/
+ DWORD dwFVF; /* 48: vertex format description of vertex buffers */
+ } DUMMYUNIONNAME4;
+ DDSCAPS2 ddsCaps; /* 68: DDraw surface caps */
+ DWORD dwTextureStage; /* 78: stage in multitexture cascade */
+} DDSURFACEDESC2,*LPDDSURFACEDESC2;
+
+/* DDCOLORCONTROL.dwFlags */
+#define DDCOLOR_BRIGHTNESS 0x00000001
+#define DDCOLOR_CONTRAST 0x00000002
+#define DDCOLOR_HUE 0x00000004
+#define DDCOLOR_SATURATION 0x00000008
+#define DDCOLOR_SHARPNESS 0x00000010
+#define DDCOLOR_GAMMA 0x00000020
+#define DDCOLOR_COLORENABLE 0x00000040
+
+typedef struct {
+ DWORD dwSize;
+ DWORD dwFlags;
+ LONG lBrightness;
+ LONG lContrast;
+ LONG lHue;
+ LONG lSaturation;
+ LONG lSharpness;
+ LONG lGamma;
+ LONG lColorEnable;
+ DWORD dwReserved1;
+} DDCOLORCONTROL,*LPDDCOLORCONTROL;
+
+typedef struct {
+ WORD red[256];
+ WORD green[256];
+ WORD blue[256];
+} DDGAMMARAMP,*LPDDGAMMARAMP;
+
+typedef BOOL CALLBACK (*LPDDENUMCALLBACKA)(GUID *, LPSTR, LPSTR, LPVOID);
+typedef BOOL CALLBACK (*LPDDENUMCALLBACKW)(GUID *, LPWSTR, LPWSTR, LPVOID);
+DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACK)
+
+typedef HRESULT CALLBACK (*LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
+typedef HRESULT CALLBACK (*LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID);
+typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
+typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID);
+typedef HRESULT CALLBACK (*LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID);
+
+typedef BOOL CALLBACK (*LPDDENUMCALLBACKEXA)(GUID *, LPSTR, LPSTR, LPVOID, HMONITOR);
+typedef BOOL CALLBACK (*LPDDENUMCALLBACKEXW)(GUID *, LPWSTR, LPWSTR, LPVOID, HMONITOR);
+DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACKEX)
+
+HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
+HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
+#define DirectDrawEnumerateEx WINELIB_NAME_AW(DirectDrawEnumerateEx)
+
+/* flags for DirectDrawEnumerateEx */
+#define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001
+#define DDENUM_DETACHEDSECONDARYDEVICES 0x00000002
+#define DDENUM_NONDISPLAYDEVICES 0x00000004
+
+/* flags for DirectDrawCreate or IDirectDraw::Initialize */
+#define DDCREATE_HARDWAREONLY 1L
+#define DDCREATE_EMULATIONONLY 2L
+
+typedef struct _DDBLTFX
+{
+ DWORD dwSize; /* size of structure */
+ DWORD dwDDFX; /* FX operations */
+ DWORD dwROP; /* Win32 raster operations */
+ DWORD dwDDROP; /* Raster operations new for DirectDraw */
+ DWORD dwRotationAngle; /* Rotation angle for blt */
+ DWORD dwZBufferOpCode; /* ZBuffer compares */
+ DWORD dwZBufferLow; /* Low limit of Z buffer */
+ DWORD dwZBufferHigh; /* High limit of Z buffer */
+ DWORD dwZBufferBaseDest; /* Destination base value */
+ DWORD dwZDestConstBitDepth; /* Bit depth used to specify Z constant for destination */
+ union
+ {
+ DWORD dwZDestConst; /* Constant to use as Z buffer for dest */
+ LPDIRECTDRAWSURFACE lpDDSZBufferDest; /* Surface to use as Z buffer for dest */
+ } DUMMYUNIONNAME1;
+ DWORD dwZSrcConstBitDepth; /* Bit depth used to specify Z constant for source */
+ union
+ {
+ DWORD dwZSrcConst; /* Constant to use as Z buffer for src */
+ LPDIRECTDRAWSURFACE lpDDSZBufferSrc; /* Surface to use as Z buffer for src */
+ } DUMMYUNIONNAME2;
+ DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */
+ DWORD dwAlphaEdgeBlend; /* Alpha for edge blending */
+ DWORD dwReserved;
+ DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */
+ union
+ {
+ DWORD dwAlphaDestConst; /* Constant to use as Alpha Channel */
+ LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as Alpha Channel */
+ } DUMMYUNIONNAME3;
+ DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */
+ union
+ {
+ DWORD dwAlphaSrcConst; /* Constant to use as Alpha Channel */
+ LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as Alpha Channel */
+ } DUMMYUNIONNAME4;
+ union
+ {
+ DWORD dwFillColor; /* color in RGB or Palettized */
+ DWORD dwFillDepth; /* depth value for z-buffer */
+ DWORD dwFillPixel; /* pixel val for RGBA or RGBZ */
+ LPDIRECTDRAWSURFACE lpDDSPattern; /* Surface to use as pattern */
+ } DUMMYUNIONNAME5;
+ DDCOLORKEY ddckDestColorkey; /* DestColorkey override */
+ DDCOLORKEY ddckSrcColorkey; /* SrcColorkey override */
+} DDBLTFX,*LPDDBLTFX;
+
+/* dwDDFX */
+/* arithmetic stretching along y axis */
+#define DDBLTFX_ARITHSTRETCHY 0x00000001
+/* mirror on y axis */
+#define DDBLTFX_MIRRORLEFTRIGHT 0x00000002
+/* mirror on x axis */
+#define DDBLTFX_MIRRORUPDOWN 0x00000004
+/* do not tear */
+#define DDBLTFX_NOTEARING 0x00000008
+/* 180 degrees clockwise rotation */
+#define DDBLTFX_ROTATE180 0x00000010
+/* 270 degrees clockwise rotation */
+#define DDBLTFX_ROTATE270 0x00000020
+/* 90 degrees clockwise rotation */
+#define DDBLTFX_ROTATE90 0x00000040
+/* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */
+#define DDBLTFX_ZBUFFERRANGE 0x00000080
+/* add dwZBufferBaseDest to every source z value before compare */
+#define DDBLTFX_ZBUFFERBASEDEST 0x00000100
+
+typedef struct _DDOVERLAYFX
+{
+ DWORD dwSize; /* size of structure */
+ DWORD dwAlphaEdgeBlendBitDepth; /* Bit depth used to specify constant for alpha edge blend */
+ DWORD dwAlphaEdgeBlend; /* Constant to use as alpha for edge blend */
+ DWORD dwReserved;
+ DWORD dwAlphaDestConstBitDepth; /* Bit depth used to specify alpha constant for destination */
+ union
+ {
+ DWORD dwAlphaDestConst; /* Constant to use as alpha channel for dest */
+ LPDIRECTDRAWSURFACE lpDDSAlphaDest; /* Surface to use as alpha channel for dest */
+ } DUMMYUNIONNAME1;
+ DWORD dwAlphaSrcConstBitDepth; /* Bit depth used to specify alpha constant for source */
+ union
+ {
+ DWORD dwAlphaSrcConst; /* Constant to use as alpha channel for src */
+ LPDIRECTDRAWSURFACE lpDDSAlphaSrc; /* Surface to use as alpha channel for src */
+ } DUMMYUNIONNAME2;
+ DDCOLORKEY dckDestColorkey; /* DestColorkey override */
+ DDCOLORKEY dckSrcColorkey; /* DestColorkey override */
+ DWORD dwDDFX; /* Overlay FX */
+ DWORD dwFlags; /* flags */
+} DDOVERLAYFX,*LPDDOVERLAYFX;
+
+typedef struct _DDBLTBATCH
+{
+ LPRECT lprDest;
+ LPDIRECTDRAWSURFACE lpDDSSrc;
+ LPRECT lprSrc;
+ DWORD dwFlags;
+ LPDDBLTFX lpDDBltFx;
+} DDBLTBATCH,*LPDDBLTBATCH;
+
+#define MAX_DDDEVICEID_STRING 512
+
+typedef struct tagDDDEVICEIDENTIFIER {
+ char szDriver[MAX_DDDEVICEID_STRING];
+ char szDescription[MAX_DDDEVICEID_STRING];
+ LARGE_INTEGER liDriverVersion;
+ DWORD dwVendorId;
+ DWORD dwDeviceId;
+ DWORD dwSubSysId;
+ DWORD dwRevision;
+ GUID guidDeviceIdentifier;
+} DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER;
+
+typedef struct tagDDDEVICEIDENTIFIER2 {
+ char szDriver[MAX_DDDEVICEID_STRING]; /* user readable driver name */
+ char szDescription[MAX_DDDEVICEID_STRING]; /* user readable description */
+ LARGE_INTEGER liDriverVersion; /* driver version */
+ DWORD dwVendorId; /* vendor ID, zero if unknown */
+ DWORD dwDeviceId; /* chipset ID, zero if unknown */
+ DWORD dwSubSysId; /* board ID, zero if unknown */
+ DWORD dwRevision; /* chipset version, zero if unknown */
+ GUID guidDeviceIdentifier; /* unique ID for this driver/chipset combination */
+ DWORD dwWHQLLevel; /* Windows Hardware Quality Lab certification level */
+} DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2;
+
+/*****************************************************************************
+ * IDirectDrawPalette interface
+ */
+#define ICOM_INTERFACE IDirectDrawPalette
+#define IDirectDrawPalette_METHODS \
+ ICOM_METHOD1(HRESULT,GetCaps, LPDWORD,lpdwCaps) \
+ ICOM_METHOD4(HRESULT,GetEntries, DWORD,dwFlags, DWORD,dwBase, DWORD,dwNumEntries, LPPALETTEENTRY,lpEntries) \
+ ICOM_METHOD3(HRESULT,Initialize, LPDIRECTDRAW,lpDD, DWORD,dwFlags, LPPALETTEENTRY,lpDDColorTable) \
+ ICOM_METHOD4(HRESULT,SetEntries, DWORD,dwFlags, DWORD,dwStartingEntry, DWORD,dwCount, LPPALETTEENTRY,lpEntries)
+#define IDirectDrawPalette_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawPalette_METHODS
+ICOM_DEFINE(IDirectDrawPalette,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawPalette_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawPalette_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawPalette_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDrawPalette methods ***/
+#define IDirectDrawPalette_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
+#define IDirectDrawPalette_GetEntries(p,a,b,c,d) ICOM_CALL4(GetEntries,p,a,b,c,d)
+#define IDirectDrawPalette_Initialize(p,a,b,c) ICOM_CALL3(Initialize,p,a,b,c)
+#define IDirectDrawPalette_SetEntries(p,a,b,c,d) ICOM_CALL4(SetEntries,p,a,b,c,d)
+
+
+/*****************************************************************************
+ * IDirectDrawClipper interface
+ */
+#define ICOM_INTERFACE IDirectDrawClipper
+#define IDirectDrawClipper_METHODS \
+ ICOM_METHOD3(HRESULT,GetClipList, LPRECT,lpRect, LPRGNDATA,lpClipList, LPDWORD,lpdwSize) \
+ ICOM_METHOD1(HRESULT,GetHWnd, HWND*,lphWnd) \
+ ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,IsClipListChanged, BOOL*,lpbChanged) \
+ ICOM_METHOD2(HRESULT,SetClipList, LPRGNDATA,lpClipList, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,SetHWnd, DWORD,dwFlags, HWND,hWnd)
+#define IDirectDrawClipper_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawClipper_METHODS
+ICOM_DEFINE(IDirectDrawClipper,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawClipper_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawClipper_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawClipper_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDrawClipper methods ***/
+#define IDirectDrawClipper_GetClipList(p,a,b,c) ICOM_CALL3(GetClipList,p,a,b,c)
+#define IDirectDrawClipper_GetHWnd(p,a) ICOM_CALL1(GetHWnd,p,a)
+#define IDirectDrawClipper_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
+#define IDirectDrawClipper_IsClipListChanged(p,a) ICOM_CALL1(IsClipListChanged,p,a)
+#define IDirectDrawClipper_SetClipList(p,a,b) ICOM_CALL2(SetClipList,p,a,b)
+#define IDirectDrawClipper_SetHWnd(p,a,b) ICOM_CALL2(SetHWnd,p,a,b)
+
+
+/*****************************************************************************
+ * IDirectDraw interface
+ */
+#define ICOM_INTERFACE IDirectDraw
+#define IDirectDraw_METHODS \
+ ICOM_METHOD (HRESULT,Compact) \
+ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \
+ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \
+ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE*,lplpDDSurface, IUnknown*,pUnkOuter) \
+ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE,lpDDSurface, LPDIRECTDRAWSURFACE*,lplpDupDDSurface) \
+ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK,lpEnumModesCallback) \
+ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
+ ICOM_METHOD (HRESULT,FlipToGDISurface) \
+ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \
+ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \
+ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE*,lplpGDIDDSurface) \
+ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \
+ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \
+ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \
+ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \
+ ICOM_METHOD (HRESULT,RestoreDisplayMode) \
+ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \
+ ICOM_METHOD3(HRESULT,SetDisplayMode, DWORD,, DWORD,, DWORD,) \
+ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent)
+#define IDirectDraw_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDraw_METHODS
+ICOM_DEFINE(IDirectDraw,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDraw_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDraw_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDraw_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDraw methods ***/
+#define IDirectDraw_Compact(p) ICOM_CALL (Compact,p)
+#define IDirectDraw_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c)
+#define IDirectDraw_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d)
+#define IDirectDraw_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c)
+#define IDirectDraw_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b)
+#define IDirectDraw_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d)
+#define IDirectDraw_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d)
+#define IDirectDraw_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p)
+#define IDirectDraw_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b)
+#define IDirectDraw_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a)
+#define IDirectDraw_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b)
+#define IDirectDraw_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a)
+#define IDirectDraw_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a)
+#define IDirectDraw_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a)
+#define IDirectDraw_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a)
+#define IDirectDraw_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
+#define IDirectDraw_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
+#define IDirectDraw_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
+#define IDirectDraw_SetDisplayMode(p,a,b,c) ICOM_CALL3(SetDisplayMode,p,a,b,c)
+#define IDirectDraw_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
+
+
+/* flags for Lock() */
+#define DDLOCK_SURFACEMEMORYPTR 0x00000000
+#define DDLOCK_WAIT 0x00000001
+#define DDLOCK_EVENT 0x00000002
+#define DDLOCK_READONLY 0x00000010
+#define DDLOCK_WRITEONLY 0x00000020
+#define DDLOCK_NOSYSLOCK 0x00000800
+
+
+/*****************************************************************************
+ * IDirectDraw2 interface
+ */
+/* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of
+ * arguments of SetDisplayMode has changed !
+ */
+#define ICOM_INTERFACE IDirectDraw2
+#define IDirectDraw2_METHODS \
+/*0c*/ ICOM_METHOD (HRESULT,Compact) \
+/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \
+/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \
+/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE2*,lplpDDSurface, IUnknown*,pUnkOuter) \
+/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE2,lpDDSurface, LPDIRECTDRAWSURFACE2*,lplpDupDDSurface) \
+/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK,lpEnumModesCallback) \
+/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
+/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \
+/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \
+/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \
+/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE2*,lplpGDIDDSurface) \
+/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \
+/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \
+/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \
+/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \
+/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \
+/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \
+/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \
+/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \
+ /* added in v2 */ \
+/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree)
+#define IDirectDraw2_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDraw2_METHODS
+ICOM_DEFINE(IDirectDraw2,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDraw2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDraw2_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDraw2_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDraw methods ***/
+#define IDirectDraw2_Compact(p) ICOM_CALL (Compact,p)
+#define IDirectDraw2_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c)
+#define IDirectDraw2_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d)
+#define IDirectDraw2_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c)
+#define IDirectDraw2_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b)
+#define IDirectDraw2_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d)
+#define IDirectDraw2_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d)
+#define IDirectDraw2_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p)
+#define IDirectDraw2_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b)
+#define IDirectDraw2_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a)
+#define IDirectDraw2_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b)
+#define IDirectDraw2_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a)
+#define IDirectDraw2_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a)
+#define IDirectDraw2_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a)
+#define IDirectDraw2_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a)
+#define IDirectDraw2_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
+#define IDirectDraw2_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
+#define IDirectDraw2_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
+#define IDirectDraw2_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e)
+#define IDirectDraw2_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
+/*** IDirectDraw2 methods ***/
+#define IDirectDraw2_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c)
+
+
+/*****************************************************************************
+ * IDirectDraw4 interface
+ */
+#define ICOM_INTERFACE IDirectDraw4
+#define IDirectDraw4_METHODS \
+/*0c*/ ICOM_METHOD (HRESULT,Compact) \
+/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \
+/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \
+/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4*,lplpDDSurface, IUnknown*,pUnkOuter) \
+/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE4,lpDDSurface, LPDIRECTDRAWSURFACE4*,lplpDupDDSurface) \
+/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK2,lpEnumModesCallback) \
+/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK2,lpEnumSurfacesCallback) \
+/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \
+/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \
+/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC2,lpDDSurfaceDesc) \
+/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \
+/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE4*,lplpGDIDDSurface) \
+/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \
+/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \
+/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \
+/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \
+/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \
+/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \
+/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \
+/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \
+ /* added in v2 */ \
+/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS2,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree) \
+ /* added in v4 */ \
+ ICOM_METHOD2(HRESULT,GetSurfaceFromDC, HDC,, LPDIRECTDRAWSURFACE4*,) \
+ ICOM_METHOD (HRESULT,RestoreAllSurfaces) \
+ ICOM_METHOD (HRESULT,TestCooperativeLevel) \
+ ICOM_METHOD2(HRESULT,GetDeviceIdentifier, LPDDDEVICEIDENTIFIER,, DWORD,)
+#define IDirectDraw4_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDraw4_METHODS
+ICOM_DEFINE(IDirectDraw4,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDraw4_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDraw4_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDraw4_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDraw methods ***/
+#define IDirectDraw4_Compact(p) ICOM_CALL (Compact,p)
+#define IDirectDraw4_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c)
+#define IDirectDraw4_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d)
+#define IDirectDraw4_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c)
+#define IDirectDraw4_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b)
+#define IDirectDraw4_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d)
+#define IDirectDraw4_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d)
+#define IDirectDraw4_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p)
+#define IDirectDraw4_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b)
+#define IDirectDraw4_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a)
+#define IDirectDraw4_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b)
+#define IDirectDraw4_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a)
+#define IDirectDraw4_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a)
+#define IDirectDraw4_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a)
+#define IDirectDraw4_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a)
+#define IDirectDraw4_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
+#define IDirectDraw4_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
+#define IDirectDraw4_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
+#define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e)
+#define IDirectDraw4_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
+/*** IDirectDraw2 methods ***/
+#define IDirectDraw4_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c)
+/*** IDirectDraw4 methods ***/
+#define IDirectDraw4_GetSurfaceFromDC(p,a,b) ICOM_CALL2(GetSurfaceFromDC,p,a,b)
+#define IDirectDraw4_RestoreAllSurfaces(pc) ICOM_CALL (RestoreAllSurfaces,p)
+#define IDirectDraw4_TestCooperativeLevel(p) ICOM_CALL (TestCooperativeLevel,p)
+#define IDirectDraw4_GetDeviceIdentifier(p,a,b) ICOM_CALL2(GetDeviceIdentifier,p,a,b)
+
+
+/*****************************************************************************
+ * IDirectDraw7 interface
+ */
+/* Note: IDirectDraw7 cannot derive from IDirectDraw4; it is even documented
+ * as not interchangeable with earlier DirectDraw interfaces.
+ */
+#define ICOM_INTERFACE IDirectDraw7
+#define IDirectDraw7_METHODS \
+/*0c*/ ICOM_METHOD (HRESULT,Compact) \
+/*10*/ ICOM_METHOD3(HRESULT,CreateClipper, DWORD,dwFlags, LPDIRECTDRAWCLIPPER*,lplpDDClipper, IUnknown*,pUnkOuter) \
+/*14*/ ICOM_METHOD4(HRESULT,CreatePalette, DWORD,dwFlags, LPPALETTEENTRY,lpColorTable, LPDIRECTDRAWPALETTE*,lplpDDPalette, IUnknown*,pUnkOuter) \
+/*18*/ ICOM_METHOD3(HRESULT,CreateSurface, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPDIRECTDRAWSURFACE7*,lplpDDSurface, IUnknown*,pUnkOuter) \
+/*1c*/ ICOM_METHOD2(HRESULT,DuplicateSurface, LPDIRECTDRAWSURFACE7,lpDDSurface, LPDIRECTDRAWSURFACE7*,lplpDupDDSurface) \
+/*20*/ ICOM_METHOD4(HRESULT,EnumDisplayModes, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSurfaceDesc, LPVOID,lpContext, LPDDENUMMODESCALLBACK2,lpEnumModesCallback) \
+/*24*/ ICOM_METHOD4(HRESULT,EnumSurfaces, DWORD,dwFlags, LPDDSURFACEDESC2,lpDDSD, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpEnumSurfacesCallback) \
+/*28*/ ICOM_METHOD (HRESULT,FlipToGDISurface) \
+/*2c*/ ICOM_METHOD2(HRESULT,GetCaps, LPDDCAPS,lpDDDriverCaps, LPDDCAPS,lpDDHELCaps) \
+/*30*/ ICOM_METHOD1(HRESULT,GetDisplayMode, LPDDSURFACEDESC2,lpDDSurfaceDesc) \
+/*34*/ ICOM_METHOD2(HRESULT,GetFourCCCodes, LPDWORD,lpNumCodes, LPDWORD,lpCodes) \
+/*38*/ ICOM_METHOD1(HRESULT,GetGDISurface, LPDIRECTDRAWSURFACE7*,lplpGDIDDSurface) \
+/*3c*/ ICOM_METHOD1(HRESULT,GetMonitorFrequency, LPDWORD,lpdwFrequency) \
+/*40*/ ICOM_METHOD1(HRESULT,GetScanLine, LPDWORD,lpdwScanLine) \
+/*44*/ ICOM_METHOD1(HRESULT,GetVerticalBlankStatus, BOOL*,lpbIsInVB) \
+/*48*/ ICOM_METHOD1(HRESULT,Initialize, GUID*,lpGUID) \
+/*4c*/ ICOM_METHOD (HRESULT,RestoreDisplayMode) \
+/*50*/ ICOM_METHOD2(HRESULT,SetCooperativeLevel, HWND,hWnd, DWORD,dwFlags) \
+/*54*/ ICOM_METHOD5(HRESULT,SetDisplayMode, DWORD,dwWidth, DWORD,dwHeight, DWORD,dwBPP, DWORD,dwRefreshRate, DWORD,dwFlags) \
+/*58*/ ICOM_METHOD2(HRESULT,WaitForVerticalBlank, DWORD,dwFlags, HANDLE,hEvent) \
+ /* added in v2 */ \
+/*5c*/ ICOM_METHOD3(HRESULT,GetAvailableVidMem, LPDDSCAPS2,lpDDCaps, LPDWORD,lpdwTotal, LPDWORD,lpdwFree) \
+ /* added in v4 */ \
+/*60*/ ICOM_METHOD2(HRESULT,GetSurfaceFromDC, HDC,, LPDIRECTDRAWSURFACE7*,) \
+/*64*/ ICOM_METHOD (HRESULT,RestoreAllSurfaces) \
+/*68*/ ICOM_METHOD (HRESULT,TestCooperativeLevel) \
+/*6c*/ ICOM_METHOD2(HRESULT,GetDeviceIdentifier, LPDDDEVICEIDENTIFIER2,, DWORD,) \
+ /* added in v7 */ \
+/*70*/ ICOM_METHOD3(HRESULT,StartModeTest, LPSIZE,, DWORD,, DWORD,) \
+/*74*/ ICOM_METHOD2(HRESULT,EvaluateMode, DWORD,, DWORD *,)
+#define IDirectDraw7_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDraw7_METHODS
+ICOM_DEFINE(IDirectDraw7,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDraw7_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDraw7_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDraw7_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDraw methods ***/
+#define IDirectDraw7_Compact(p) ICOM_CALL (Compact,p)
+#define IDirectDraw7_CreateClipper(p,a,b,c) ICOM_CALL3(CreateClipper,p,a,b,c)
+#define IDirectDraw7_CreatePalette(p,a,b,c,d) ICOM_CALL4(CreatePalette,p,a,b,c,d)
+#define IDirectDraw7_CreateSurface(p,a,b,c) ICOM_CALL3(CreateSurface,p,a,b,c)
+#define IDirectDraw7_DuplicateSurface(p,a,b) ICOM_CALL2(DuplicateSurface,p,a,b)
+#define IDirectDraw7_EnumDisplayModes(p,a,b,c,d) ICOM_CALL4(EnumDisplayModes,p,a,b,c,d)
+#define IDirectDraw7_EnumSurfaces(p,a,b,c,d) ICOM_CALL4(EnumSurfaces,p,a,b,c,d)
+#define IDirectDraw7_FlipToGDISurface(p) ICOM_CALL (FlipToGDISurface,p)
+#define IDirectDraw7_GetCaps(p,a,b) ICOM_CALL2(GetCaps,p,a,b)
+#define IDirectDraw7_GetDisplayMode(p,a) ICOM_CALL1(GetDisplayMode,p,a)
+#define IDirectDraw7_GetFourCCCodes(p,a,b) ICOM_CALL2(GetFourCCCodes,p,a,b)
+#define IDirectDraw7_GetGDISurface(p,a) ICOM_CALL1(GetGDISurface,p,a)
+#define IDirectDraw7_GetMonitorFrequency(p,a) ICOM_CALL1(GetMonitorFrequency,p,a)
+#define IDirectDraw7_GetScanLine(p,a) ICOM_CALL1(GetScanLine,p,a)
+#define IDirectDraw7_GetVerticalBlankStatus(p,a) ICOM_CALL1(GetVerticalBlankStatus,p,a)
+#define IDirectDraw7_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
+#define IDirectDraw7_RestoreDisplayMode(p) ICOM_CALL (RestoreDisplayMode,p)
+#define IDirectDraw7_SetCooperativeLevel(p,a,b) ICOM_CALL2(SetCooperativeLevel,p,a,b)
+#define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) ICOM_CALL5(SetDisplayMode,p,a,b,c,d,e)
+#define IDirectDraw7_WaitForVerticalBlank(p,a,b) ICOM_CALL2(WaitForVerticalBlank,p,a,b)
+/*** added in IDirectDraw2 ***/
+#define IDirectDraw7_GetAvailableVidMem(p,a,b,c) ICOM_CALL3(GetAvailableVidMem,p,a,b,c)
+/*** added in IDirectDraw4 ***/
+#define IDirectDraw7_GetSurfaceFromDC(p,a,b) ICOM_CALL2(GetSurfaceFromDC,p,a,b)
+#define IDirectDraw7_RestoreAllSurfaces(p) ICOM_CALL (RestoreAllSurfaces,p)
+#define IDirectDraw7_TestCooperativeLevel(p) ICOM_CALL (TestCooperativeLevel,p)
+#define IDirectDraw7_GetDeviceIdentifier(p,a,b) ICOM_CALL2(GetDeviceIdentifier,p,a,b)
+/*** added in IDirectDraw 7 ***/
+#define IDirectDraw7_StartModeTest(p,a,b,c) ICOM_CALL3(StartModeTest,p,a,b,c)
+#define IDirectDraw7_EvaluateMode(p,a,b) ICOM_CALL2(EvaluateMode,p,a,b)
+
+
+/*****************************************************************************
+ * IDirectDrawSurface interface
+ */
+#define ICOM_INTERFACE IDirectDrawSurface
+#define IDirectDrawSurface_METHODS \
+/*0c*/ ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE,lpDDSAttachedSurface) \
+/*10*/ ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
+/*14*/ ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
+/*18*/ ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
+/*1c*/ ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
+/*20*/ ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE,lpDDSAttachedSurface) \
+/*24*/ ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
+/*28*/ ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \
+/*2c*/ ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
+/*30*/ ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE*,lplpDDAttachedSurface) \
+/*34*/ ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
+/*38*/ ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \
+/*3c*/ ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
+/*40*/ ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+/*44*/ ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
+/*48*/ ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
+/*4c*/ ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
+/*50*/ ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
+/*54*/ ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
+/*58*/ ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+/*5c*/ ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+/*60*/ ICOM_METHOD (HRESULT,IsLost) \
+/*64*/ ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
+/*68*/ ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
+/*6c*/ ICOM_METHOD (HRESULT,Restore) \
+/*70*/ ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
+/*74*/ ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+/*78*/ ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
+/*7c*/ ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
+/*80*/ ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \
+/*84*/ ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
+/*88*/ ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
+/*8c*/ ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE,lpDDSReference)
+#define IDirectDrawSurface_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawSurface_METHODS
+ICOM_DEFINE(IDirectDrawSurface,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawSurface_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawSurface_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawSurface_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDrawSurface methods ***/
+#define IDirectDrawSurface_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
+#define IDirectDrawSurface_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
+#define IDirectDrawSurface_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
+#define IDirectDrawSurface_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
+#define IDirectDrawSurface_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
+#define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
+#define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
+#define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
+#define IDirectDrawSurface_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
+#define IDirectDrawSurface_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
+#define IDirectDrawSurface_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
+#define IDirectDrawSurface_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
+#define IDirectDrawSurface_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
+#define IDirectDrawSurface_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
+#define IDirectDrawSurface_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
+#define IDirectDrawSurface_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
+#define IDirectDrawSurface_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
+#define IDirectDrawSurface_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
+#define IDirectDrawSurface_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
+#define IDirectDrawSurface_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
+#define IDirectDrawSurface_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
+#define IDirectDrawSurface_IsLost(p) ICOM_CALL (IsLost,p)
+#define IDirectDrawSurface_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
+#define IDirectDrawSurface_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
+#define IDirectDrawSurface_Restore(p) ICOM_CALL (Restore,p)
+#define IDirectDrawSurface_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
+#define IDirectDrawSurface_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
+#define IDirectDrawSurface_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
+#define IDirectDrawSurface_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
+#define IDirectDrawSurface_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
+#define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
+#define IDirectDrawSurface_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
+#define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
+
+
+/*****************************************************************************
+ * IDirectDrawSurface2 interface
+ */
+/* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters
+ * have been converted to LPDIRECTDRAWSURFACE2.
+ */
+#define ICOM_INTERFACE IDirectDrawSurface2
+#define IDirectDrawSurface2_METHODS \
+ ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE2,lpDDSAttachedSurface) \
+ ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
+ ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE2,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
+ ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
+ ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE2,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
+ ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE2,lpDDSAttachedSurface) \
+ ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
+ ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \
+ ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE2,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE2*,lplpDDAttachedSurface) \
+ ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \
+ ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
+ ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+ ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
+ ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
+ ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
+ ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
+ ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+ ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+ ICOM_METHOD (HRESULT,IsLost) \
+ ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
+ ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
+ ICOM_METHOD (HRESULT,Restore) \
+ ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
+ ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+ ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
+ ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
+ ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \
+ ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE2,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
+ ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE2,lpDDSReference) \
+ /* added in v2 */ \
+ ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \
+ ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags)
+#define IDirectDrawSurface2_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawSurface2_METHODS
+ICOM_DEFINE(IDirectDrawSurface2,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawSurface2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawSurface2_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawSurface2_Release(p) ICOM_CALL (Release,p)
+/*** IDirectDrawSurface methods (almost) ***/
+#define IDirectDrawSurface2_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
+#define IDirectDrawSurface2_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
+#define IDirectDrawSurface2_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
+#define IDirectDrawSurface2_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
+#define IDirectDrawSurface2_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
+#define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
+#define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
+#define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
+#define IDirectDrawSurface2_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
+#define IDirectDrawSurface2_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
+#define IDirectDrawSurface2_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
+#define IDirectDrawSurface2_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
+#define IDirectDrawSurface2_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
+#define IDirectDrawSurface2_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
+#define IDirectDrawSurface2_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
+#define IDirectDrawSurface2_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
+#define IDirectDrawSurface2_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
+#define IDirectDrawSurface2_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
+#define IDirectDrawSurface2_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
+#define IDirectDrawSurface2_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
+#define IDirectDrawSurface2_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
+#define IDirectDrawSurface2_IsLost(p) ICOM_CALL (IsLost,p)
+#define IDirectDrawSurface2_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
+#define IDirectDrawSurface2_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
+#define IDirectDrawSurface2_Restore(p) ICOM_CALL (Restore,p)
+#define IDirectDrawSurface2_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
+#define IDirectDrawSurface2_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
+#define IDirectDrawSurface2_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
+#define IDirectDrawSurface2_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
+#define IDirectDrawSurface2_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
+#define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
+#define IDirectDrawSurface2_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
+#define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
+/*** IDirectDrawSurface2 methods ***/
+#define IDirectDrawSurface2_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a)
+#define IDirectDrawSurface2_PageLock(p,a) ICOM_CALL1(PageLock,p,a)
+#define IDirectDrawSurface2_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a)
+
+
+/*****************************************************************************
+ * IDirectDrawSurface3 interface
+ */
+/* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters
+ * have been converted to LPDIRECTDRAWSURFACE3.
+ */
+#define ICOM_INTERFACE IDirectDrawSurface3
+#define IDirectDrawSurface3_METHODS \
+ ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE3,lpDDSAttachedSurface) \
+ ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
+ ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE3,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
+ ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
+ ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE3,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
+ ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE3,lpDDSAttachedSurface) \
+ ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
+ ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \
+ ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE3,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS,lpDDSCaps, LPDIRECTDRAWSURFACE3*,lplpDDAttachedSurface) \
+ ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS,lpDDSCaps) \
+ ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
+ ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+ ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
+ ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
+ ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
+ ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
+ ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+ ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+ ICOM_METHOD (HRESULT,IsLost) \
+ ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
+ ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
+ ICOM_METHOD (HRESULT,Restore) \
+ ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
+ ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+ ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
+ ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
+ ICOM_METHOD1(HRESULT,Unlock, LPVOID,lpSurfaceData) \
+ ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE3,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
+ ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE3,lpDDSReference) \
+ /* added in v2 */ \
+ ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \
+ ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \
+ /* added in v3 */ \
+ ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC,lpDDSD, DWORD,dwFlags)
+#define IDirectDrawSurface3_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawSurface3_METHODS
+ICOM_DEFINE(IDirectDrawSurface3,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawSurface3_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawSurface3_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawSurface3_Release(p) ICOM_CALL (Release,p)
+/*** IDirectDrawSurface methods (almost) ***/
+#define IDirectDrawSurface3_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
+#define IDirectDrawSurface3_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
+#define IDirectDrawSurface3_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
+#define IDirectDrawSurface3_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
+#define IDirectDrawSurface3_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
+#define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
+#define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
+#define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
+#define IDirectDrawSurface3_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
+#define IDirectDrawSurface3_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
+#define IDirectDrawSurface3_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
+#define IDirectDrawSurface3_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
+#define IDirectDrawSurface3_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
+#define IDirectDrawSurface3_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
+#define IDirectDrawSurface3_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
+#define IDirectDrawSurface3_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
+#define IDirectDrawSurface3_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
+#define IDirectDrawSurface3_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
+#define IDirectDrawSurface3_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
+#define IDirectDrawSurface3_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
+#define IDirectDrawSurface3_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
+#define IDirectDrawSurface3_IsLost(p) ICOM_CALL (IsLost,p)
+#define IDirectDrawSurface3_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
+#define IDirectDrawSurface3_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
+#define IDirectDrawSurface3_Restore(p) ICOM_CALL (Restore,p)
+#define IDirectDrawSurface3_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
+#define IDirectDrawSurface3_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
+#define IDirectDrawSurface3_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
+#define IDirectDrawSurface3_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
+#define IDirectDrawSurface3_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
+#define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
+#define IDirectDrawSurface3_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
+#define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
+/*** IDirectDrawSurface2 methods ***/
+#define IDirectDrawSurface3_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a)
+#define IDirectDrawSurface3_PageLock(p,a) ICOM_CALL1(PageLock,p,a)
+#define IDirectDrawSurface3_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a)
+/*** IDirectDrawSurface3 methods ***/
+#define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b)
+
+
+/*****************************************************************************
+ * IDirectDrawSurface4 interface
+ */
+/* Cannot inherit from IDirectDrawSurface2 because DDSCAPS changed to DDSCAPS2.
+ */
+#define ICOM_INTERFACE IDirectDrawSurface4
+#define IDirectDrawSurface4_METHODS \
+ ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE4,lpDDSAttachedSurface) \
+ ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
+ ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE4,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
+ ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
+ ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE4,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
+ ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE4,lpDDSAttachedSurface) \
+ ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpEnumSurfacesCallback) \
+ ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK,lpfnCallback) \
+ ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE4,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS2,lpDDSCaps, LPDIRECTDRAWSURFACE4*,lplpDDAttachedSurface) \
+ ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS2,lpDDSCaps) \
+ ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
+ ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+ ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
+ ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
+ ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
+ ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
+ ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+ ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC,lpDDSurfaceDesc) \
+ ICOM_METHOD (HRESULT,IsLost) \
+ ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
+ ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
+ ICOM_METHOD (HRESULT,Restore) \
+ ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
+ ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+ ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
+ ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
+ ICOM_METHOD1(HRESULT,Unlock, LPRECT,lpSurfaceData) \
+ ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE4,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
+ ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE4,lpDDSReference) \
+ /* added in v2 */ \
+ ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \
+ ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \
+ /* added in v3 */ \
+ ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC,lpDDSD, DWORD,dwFlags) \
+ /* added in v4 */ \
+ ICOM_METHOD4(HRESULT,SetPrivateData, REFGUID,, LPVOID,, DWORD,, DWORD,) \
+ ICOM_METHOD3(HRESULT,GetPrivateData, REFGUID,, LPVOID,, LPDWORD,) \
+ ICOM_METHOD1(HRESULT,FreePrivateData, REFGUID,) \
+ ICOM_METHOD1(HRESULT,GetUniquenessValue, LPDWORD,) \
+ ICOM_METHOD (HRESULT,ChangeUniquenessValue)
+#define IDirectDrawSurface4_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawSurface4_METHODS
+ICOM_DEFINE(IDirectDrawSurface4,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawSurface4_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawSurface4_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawSurface4_Release(p) ICOM_CALL (Release,p)
+/*** IDirectDrawSurface (almost) methods ***/
+#define IDirectDrawSurface4_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
+#define IDirectDrawSurface4_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
+#define IDirectDrawSurface4_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
+#define IDirectDrawSurface4_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
+#define IDirectDrawSurface4_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
+#define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
+#define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
+#define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
+#define IDirectDrawSurface4_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
+#define IDirectDrawSurface4_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
+#define IDirectDrawSurface4_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
+#define IDirectDrawSurface4_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
+#define IDirectDrawSurface4_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
+#define IDirectDrawSurface4_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
+#define IDirectDrawSurface4_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
+#define IDirectDrawSurface4_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
+#define IDirectDrawSurface4_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
+#define IDirectDrawSurface4_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
+#define IDirectDrawSurface4_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
+#define IDirectDrawSurface4_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
+#define IDirectDrawSurface4_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
+#define IDirectDrawSurface4_IsLost(p) ICOM_CALL (IsLost,p)
+#define IDirectDrawSurface4_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
+#define IDirectDrawSurface4_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
+#define IDirectDrawSurface4_Restore(p) ICOM_CALL (Restore,p)
+#define IDirectDrawSurface4_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
+#define IDirectDrawSurface4_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
+#define IDirectDrawSurface4_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
+#define IDirectDrawSurface4_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
+#define IDirectDrawSurface4_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
+#define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
+#define IDirectDrawSurface4_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
+#define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
+/*** IDirectDrawSurface2 methods ***/
+#define IDirectDrawSurface4_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a)
+#define IDirectDrawSurface4_PageLock(p,a) ICOM_CALL1(PageLock,p,a)
+#define IDirectDrawSurface4_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a)
+/*** IDirectDrawSurface3 methods ***/
+#define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b)
+/*** IDirectDrawSurface4 methods ***/
+#define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) ICOM_CALL4(SetPrivateData,p,a,b,c,d)
+#define IDirectDrawSurface4_GetPrivateData(p,a,b,c) ICOM_CALL3(GetPrivateData,p,a,b,c)
+#define IDirectDrawSurface4_FreePrivateData(p,a) ICOM_CALL1(FreePrivateData,p,a)
+#define IDirectDrawSurface4_GetUniquenessValue(p,a) ICOM_CALL1(GetUniquenessValue,p,a)
+#define IDirectDrawSurface4_ChangeUniquenessValue(p) ICOM_CALL (ChangeUniquenessValue,p)
+
+
+/*****************************************************************************
+ * IDirectDrawSurface7 interface
+ */
+#define ICOM_INTERFACE IDirectDrawSurface7
+#define IDirectDrawSurface7_METHODS \
+ ICOM_METHOD1(HRESULT,AddAttachedSurface, LPDIRECTDRAWSURFACE7,lpDDSAttachedSurface) \
+ ICOM_METHOD1(HRESULT,AddOverlayDirtyRect, LPRECT,lpRect) \
+ ICOM_METHOD5(HRESULT,Blt, LPRECT,lpDestRect, LPDIRECTDRAWSURFACE7,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwFlags, LPDDBLTFX,lpDDBltFx) \
+ ICOM_METHOD3(HRESULT,BltBatch, LPDDBLTBATCH,lpDDBltBatch, DWORD,dwCount, DWORD,dwFlags) \
+ ICOM_METHOD5(HRESULT,BltFast, DWORD,dwX, DWORD,dwY, LPDIRECTDRAWSURFACE7,lpDDSrcSurface, LPRECT,lpSrcRect, DWORD,dwTrans) \
+ ICOM_METHOD2(HRESULT,DeleteAttachedSurface, DWORD,dwFlags, LPDIRECTDRAWSURFACE7,lpDDSAttachedSurface) \
+ ICOM_METHOD2(HRESULT,EnumAttachedSurfaces, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpEnumSurfacesCallback) \
+ ICOM_METHOD3(HRESULT,EnumOverlayZOrders, DWORD,dwFlags, LPVOID,lpContext, LPDDENUMSURFACESCALLBACK7,lpfnCallback) \
+ ICOM_METHOD2(HRESULT,Flip, LPDIRECTDRAWSURFACE7,lpDDSurfaceTargetOverride, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,GetAttachedSurface, LPDDSCAPS2,lpDDSCaps, LPDIRECTDRAWSURFACE7*,lplpDDAttachedSurface) \
+ ICOM_METHOD1(HRESULT,GetBltStatus, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,GetCaps, LPDDSCAPS2,lpDDSCaps) \
+ ICOM_METHOD1(HRESULT,GetClipper, LPDIRECTDRAWCLIPPER*,lplpDDClipper) \
+ ICOM_METHOD2(HRESULT,GetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+ ICOM_METHOD1(HRESULT,GetDC, HDC*,lphDC) \
+ ICOM_METHOD1(HRESULT,GetFlipStatus, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,GetOverlayPosition, LPLONG,lplX, LPLONG,lplY) \
+ ICOM_METHOD1(HRESULT,GetPalette, LPDIRECTDRAWPALETTE*,lplpDDPalette) \
+ ICOM_METHOD1(HRESULT,GetPixelFormat, LPDDPIXELFORMAT,lpDDPixelFormat) \
+ ICOM_METHOD1(HRESULT,GetSurfaceDesc, LPDDSURFACEDESC2,lpDDSurfaceDesc) \
+ ICOM_METHOD2(HRESULT,Initialize, LPDIRECTDRAW,lpDD, LPDDSURFACEDESC2,lpDDSurfaceDesc) \
+ ICOM_METHOD (HRESULT,IsLost) \
+ ICOM_METHOD4(HRESULT,Lock, LPRECT,lpDestRect, LPDDSURFACEDESC2,lpDDSurfaceDesc, DWORD,dwFlags, HANDLE,hEvent) \
+ ICOM_METHOD1(HRESULT,ReleaseDC, HDC,hDC) \
+ ICOM_METHOD (HRESULT,Restore) \
+ ICOM_METHOD1(HRESULT,SetClipper, LPDIRECTDRAWCLIPPER,lpDDClipper) \
+ ICOM_METHOD2(HRESULT,SetColorKey, DWORD,dwFlags, LPDDCOLORKEY,lpDDColorKey) \
+ ICOM_METHOD2(HRESULT,SetOverlayPosition, LONG,lX, LONG,lY) \
+ ICOM_METHOD1(HRESULT,SetPalette, LPDIRECTDRAWPALETTE,lpDDPalette) \
+ ICOM_METHOD1(HRESULT,Unlock, LPRECT,lpSurfaceData) \
+ ICOM_METHOD5(HRESULT,UpdateOverlay, LPRECT,lpSrcRect, LPDIRECTDRAWSURFACE7,lpDDDestSurface, LPRECT,lpDestRect, DWORD,dwFlags, LPDDOVERLAYFX,lpDDOverlayFx) \
+ ICOM_METHOD1(HRESULT,UpdateOverlayDisplay, DWORD,dwFlags) \
+ ICOM_METHOD2(HRESULT,UpdateOverlayZOrder, DWORD,dwFlags, LPDIRECTDRAWSURFACE7,lpDDSReference) \
+ /* added in v2 */ \
+ ICOM_METHOD1(HRESULT,GetDDInterface, LPVOID*,lplpDD) \
+ ICOM_METHOD1(HRESULT,PageLock, DWORD,dwFlags) \
+ ICOM_METHOD1(HRESULT,PageUnlock, DWORD,dwFlags) \
+ /* added in v3 */ \
+ ICOM_METHOD2(HRESULT,SetSurfaceDesc, LPDDSURFACEDESC2,lpDDSD, DWORD,dwFlags) \
+ /* added in v4 */ \
+ ICOM_METHOD4(HRESULT,SetPrivateData, REFGUID,, LPVOID,, DWORD,, DWORD,) \
+ ICOM_METHOD3(HRESULT,GetPrivateData, REFGUID,, LPVOID,, LPDWORD,) \
+ ICOM_METHOD1(HRESULT,FreePrivateData, REFGUID,) \
+ ICOM_METHOD1(HRESULT,GetUniquenessValue, LPDWORD,) \
+ ICOM_METHOD (HRESULT,ChangeUniquenessValue) \
+ /* added in v7 */ \
+ ICOM_METHOD1(HRESULT,SetPriority, DWORD,prio) \
+ ICOM_METHOD1(HRESULT,GetPriority, LPDWORD,prio) \
+ ICOM_METHOD1(HRESULT,SetLOD, DWORD,lod) \
+ ICOM_METHOD1(HRESULT,GetLOD, LPDWORD,lod)
+#define IDirectDrawSurface7_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawSurface7_METHODS
+ICOM_DEFINE(IDirectDrawSurface7,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawSurface7_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawSurface7_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawSurface7_Release(p) ICOM_CALL (Release,p)
+/*** IDirectDrawSurface (almost) methods ***/
+#define IDirectDrawSurface7_AddAttachedSurface(p,a) ICOM_CALL1(AddAttachedSurface,p,a)
+#define IDirectDrawSurface7_AddOverlayDirtyRect(p,a) ICOM_CALL1(AddOverlayDirtyRect,p,a)
+#define IDirectDrawSurface7_Blt(p,a,b,c,d,e) ICOM_CALL5(Blt,p,a,b,c,d,e)
+#define IDirectDrawSurface7_BltBatch(p,a,b,c) ICOM_CALL3(BltBatch,p,a,b,c)
+#define IDirectDrawSurface7_BltFast(p,a,b,c,d,e) ICOM_CALL5(BltFast,p,a,b,c,d,e)
+#define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) ICOM_CALL2(DeleteAttachedSurface,p,a,b)
+#define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b) ICOM_CALL2(EnumAttachedSurfaces,p,a,b)
+#define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c) ICOM_CALL3(EnumOverlayZOrders,p,a,b,c)
+#define IDirectDrawSurface7_Flip(p,a,b) ICOM_CALL2(Flip,p,a,b)
+#define IDirectDrawSurface7_GetAttachedSurface(p,a,b) ICOM_CALL2(GetAttachedSurface,p,a,b)
+#define IDirectDrawSurface7_GetBltStatus(p,a) ICOM_CALL1(GetBltStatus,p,a)
+#define IDirectDrawSurface7_GetCaps(p,a) ICOM_CALL1(GetCaps,p,a)
+#define IDirectDrawSurface7_GetClipper(p,a) ICOM_CALL1(GetClipper,p,a)
+#define IDirectDrawSurface7_GetColorKey(p,a,b) ICOM_CALL2(GetColorKey,p,a,b)
+#define IDirectDrawSurface7_GetDC(p,a) ICOM_CALL1(GetDC,p,a)
+#define IDirectDrawSurface7_GetFlipStatus(p,a) ICOM_CALL1(GetFlipStatus,p,a)
+#define IDirectDrawSurface7_GetOverlayPosition(p,a,b) ICOM_CALL2(GetOverlayPosition,p,a,b)
+#define IDirectDrawSurface7_GetPalette(p,a) ICOM_CALL1(GetPalette,p,a)
+#define IDirectDrawSurface7_GetPixelFormat(p,a) ICOM_CALL1(GetPixelFormat,p,a)
+#define IDirectDrawSurface7_GetSurfaceDesc(p,a) ICOM_CALL1(GetSurfaceDesc,p,a)
+#define IDirectDrawSurface7_Initialize(p,a,b) ICOM_CALL2(Initialize,p,a,b)
+#define IDirectDrawSurface7_IsLost(p) ICOM_CALL (IsLost,p)
+#define IDirectDrawSurface7_Lock(p,a,b,c,d) ICOM_CALL4(Lock,p,a,b,c,d)
+#define IDirectDrawSurface7_ReleaseDC(p,a) ICOM_CALL1(ReleaseDC,p,a)
+#define IDirectDrawSurface7_Restore(p) ICOM_CALL (Restore,p)
+#define IDirectDrawSurface7_SetClipper(p,a) ICOM_CALL1(SetClipper,p,a)
+#define IDirectDrawSurface7_SetColorKey(p,a,b) ICOM_CALL2(SetColorKey,p,a,b)
+#define IDirectDrawSurface7_SetOverlayPosition(p,a,b) ICOM_CALL2(SetOverlayPosition,p,a,b)
+#define IDirectDrawSurface7_SetPalette(p,a) ICOM_CALL1(SetPalette,p,a)
+#define IDirectDrawSurface7_Unlock(p,a) ICOM_CALL1(Unlock,p,a)
+#define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e) ICOM_CALL5(UpdateOverlay,p,a,b,c,d,e)
+#define IDirectDrawSurface7_UpdateOverlayDisplay(p,a) ICOM_CALL1(UpdateOverlayDisplay,p,a)
+#define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b) ICOM_CALL2(UpdateOverlayZOrder,p,a,b)
+/*** IDirectDrawSurface2 methods ***/
+#define IDirectDrawSurface7_GetDDInterface(p,a) ICOM_CALL1(GetDDInterface,p,a)
+#define IDirectDrawSurface7_PageLock(p,a) ICOM_CALL1(PageLock,p,a)
+#define IDirectDrawSurface7_PageUnlock(p,a) ICOM_CALL1(PageUnlock,p,a)
+/*** IDirectDrawSurface3 methods ***/
+#define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) ICOM_CALL2(SetSurfaceDesc,p,a,b)
+/*** IDirectDrawSurface4 methods ***/
+#define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) ICOM_CALL4(SetPrivateData,p,a,b,c,d)
+#define IDirectDrawSurface7_GetPrivateData(p,a,b,c) ICOM_CALL3(GetPrivateData,p,a,b,c)
+#define IDirectDrawSurface7_FreePrivateData(p,a) ICOM_CALL1(FreePrivateData,p,a)
+#define IDirectDrawSurface7_GetUniquenessValue(p,a) ICOM_CALL1(GetUniquenessValue,p,a)
+#define IDirectDrawSurface7_ChangeUniquenessValue(p) ICOM_CALL (ChangeUniquenessValue,p)
+/*** IDirectDrawSurface7 methods ***/
+#define IDirectDrawSurface7_SetPriority(p,a) ICOM_CALL1(SetPriority,p,a)
+#define IDirectDrawSurface7_GetPriority(p,a) ICOM_CALL1(GetPriority,p,a)
+#define IDirectDrawSurface7_SetLOD(p,a) ICOM_CALL1(SetLOD,p,a)
+#define IDirectDrawSurface7_GetLOD(p,a) ICOM_CALL1(GetLOD,p,a)
+
+/*****************************************************************************
+ * IDirectDrawColorControl interface
+ */
+#define ICOM_INTERFACE IDirectDrawColorControl
+#define IDirectDrawColorControl_METHODS \
+ ICOM_METHOD1(HRESULT,GetColorControls, LPDDCOLORCONTROL,lpColorControl) \
+ ICOM_METHOD1(HRESULT,SetColorControls, LPDDCOLORCONTROL,lpColorControl)
+#define IDirectDrawColorControl_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawColorControl_METHODS
+ICOM_DEFINE(IDirectDrawColorControl,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawColorControl_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawColorControl_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawColorControl_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDrawColorControl methods ***/
+#define IDirectDrawColorControl_GetColorControls(p,a) ICOM_CALL(GetColorControls,p,a)
+#define IDirectDrawColorControl_SetColorControls(p,a) ICOM_CALL(SetColorControls,p,a)
+
+/*****************************************************************************
+ * IDirectDrawGammaControl interface
+ */
+#define ICOM_INTERFACE IDirectDrawGammaControl
+#define IDirectDrawGammaControl_METHODS \
+ ICOM_METHOD2(HRESULT,GetGammaRamp, DWORD,dwFlags, LPDDGAMMARAMP,lpGammaRamp) \
+ ICOM_METHOD2(HRESULT,SetGammaRamp, DWORD,dwFlags, LPDDGAMMARAMP,lpGammaRamp)
+#define IDirectDrawGammaControl_IMETHODS \
+ IUnknown_IMETHODS \
+ IDirectDrawGammaControl_METHODS
+ICOM_DEFINE(IDirectDrawGammaControl,IUnknown)
+#undef ICOM_INTERFACE
+
+ /*** IUnknown methods ***/
+#define IDirectDrawGammaControl_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
+#define IDirectDrawGammaControl_AddRef(p) ICOM_CALL (AddRef,p)
+#define IDirectDrawGammaControl_Release(p) ICOM_CALL (Release,p)
+ /*** IDirectDrawGammaControl methods ***/
+#define IDirectDrawGammaControl_GetGammaRamp(p,a,b) ICOM_CALL(GetGammaRamp,p,a,b)
+#define IDirectDrawGammaControl_SetGammaRamp(p,a,b) ICOM_CALL(SetGammaRamp,p,a,b)
+
+
+HRESULT WINAPI DirectDrawCreate(LPGUID,LPDIRECTDRAW*,LPUNKNOWN);
+HRESULT WINAPI DirectDrawCreateEx(LPGUID,LPVOID*,REFIID,LPUNKNOWN);
+HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACKA,LPVOID);
+HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW,LPVOID);
+#define DirectDrawEnumerate WINELIB_NAME_AW(DirectDrawEnumerate)
+HRESULT WINAPI DirectDrawCreateClipper(DWORD,LPDIRECTDRAWCLIPPER*,LPUNKNOWN);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
+
+#endif /* __WINE_DDRAW_H */
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
new file mode 100644
index 000000000..684e98cc1
--- /dev/null
+++ b/hw/xwin/win.h
@@ -0,0 +1,1427 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ * Kensuke Matsuzaki
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.34 2003/02/12 15:01:38 alanh Exp $ */
+
+#ifndef _WIN_H_
+#define _WIN_H_
+
+
+#ifndef NO
+#define NO 0
+#endif
+#ifndef YES
+#define YES 1
+#endif
+
+/*
+ * Build toggles for experimental features
+ */
+#define WIN_NATIVE_GDI_SUPPORT YES
+#define WIN_LAYER_SUPPORT NO
+#define WIN_NEW_KEYBOARD_SUPPORT NO
+#define WIN_EMULATE_PSEUDO_SUPPORT YES
+#define WIN_UPDATE_STATS NO
+
+/* Turn debug messages on or off */
+#define CYGDEBUG NO
+
+#define NEED_EVENTS
+
+#define WIN_DEFAULT_BPP 0
+#define WIN_DEFAULT_WHITEPIXEL 255
+#define WIN_DEFAULT_BLACKPIXEL 0
+#define WIN_DEFAULT_LINEBIAS 0
+#define WIN_DEFAULT_E3B_TIME 50 /* milliseconds */
+#define WIN_DEFAULT_DPI 75
+#define WIN_DEFAULT_REFRESH 0
+#define WIN_DEFAULT_WIN_KILL TRUE
+#define WIN_DEFAULT_UNIX_KILL FALSE
+#define WIN_DEFAULT_CLIP_UPDATES_NBOXES 0
+#define WIN_DEFAULT_EMULATE_PSEUDO FALSE
+#define WIN_DEFAULT_USER_GAVE_HEIGHT_AND_WIDTH FALSE
+
+#define WIN_DIB_MAXIMUM_SIZE 0x08000000 /* 16 MB on Windows 95, 98, Me */
+#define WIN_DIB_MAXIMUM_SIZE_MB (WIN_DIB_MAXIMUM_SIZE / 8 / 1024 / 1024)
+
+/*
+ * Windows only supports 256 color palettes
+ */
+#define WIN_NUM_PALETTE_ENTRIES 256
+
+/*
+ * Number of times to call Restore in an attempt to restore the primary surface
+ */
+#define WIN_REGAIN_SURFACE_RETRIES 1
+
+/*
+ * Build a supported display depths mask by shifting one to the left
+ * by the number of bits in the supported depth.
+ */
+#define WIN_SUPPORTED_BPPS ( (1 << (32 - 1)) | (1 << (24 - 1)) \
+ | (1 << (16 - 1)) | (1 << (15 - 1)) \
+ | (1 << ( 8 - 1)))
+#define WIN_CHECK_DEPTH YES
+
+#define WIN_E3B_OFF -1
+#define WIN_E3B_TIMER_ID 1
+#define WIN_FD_INVALID -1
+
+#define WIN_SERVER_NONE 0x0L /* 0 */
+#define WIN_SERVER_SHADOW_GDI 0x1L /* 1 */
+#define WIN_SERVER_SHADOW_DD 0x2L /* 2 */
+#define WIN_SERVER_SHADOW_DDNL 0x4L /* 4 */
+#define WIN_SERVER_PRIMARY_DD 0x8L /* 8 */
+#define WIN_SERVER_NATIVE_GDI 0x10L /* 16 */
+
+#define AltMapIndex Mod1MapIndex
+#define NumLockMapIndex Mod2MapIndex
+#define AltLangMapIndex Mod3MapIndex
+#define KanaMapIndex Mod4MapIndex
+#define ScrollLockMapIndex Mod5MapIndex
+
+#define WIN_MOD_LALT 0x00000001
+#define WIN_MOD_RALT 0x00000002
+#define WIN_MOD_LCONTROL 0x00000004
+#define WIN_MOD_RCONTROL 0x00000008
+
+#define WIN_24BPP_MASK_RED 0x00FF0000
+#define WIN_24BPP_MASK_GREEN 0x0000FF00
+#define WIN_24BPP_MASK_BLUE 0x000000FF
+
+#define WIN_MAX_KEYS_PER_KEY 4
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <errno.h>
+#include <pthread.h>
+
+#include <X11/XWDFile.h>
+
+#ifdef HAS_MMAP
+#include <sys/mman.h>
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif /* MAP_FILE */
+#endif /* HAS_MMAP */
+
+#include "X.h"
+#include "Xproto.h"
+#include "Xos.h"
+#include "Xprotostr.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "pixmap.h"
+#include "region.h"
+#include "regionstr.h"
+#include "gcstruct.h"
+#include "colormap.h"
+#include "colormapst.h"
+#include "miscstruct.h"
+#include "servermd.h"
+#include "windowstr.h"
+#include "mi.h"
+#include "micmap.h"
+#include "migc.h"
+#include "mifillarc.h"
+#include "mifpoly.h"
+#include "mibstore.h"
+#include "input.h"
+#include "mipointer.h"
+#include "keysym.h"
+#include "mibstore.h"
+#include "micoord.h"
+#include "dix.h"
+#include "miline.h"
+#include "shadow.h"
+#include "fb.h"
+#include "layer.h"
+
+#ifdef RENDER
+#include "mipict.h"
+#include "picturestr.h"
+#endif
+
+#ifdef RANDR
+#include "randrstr.h"
+#endif
+
+/*
+ * Windows headers
+ */
+#include "winms.h"
+
+
+/*
+ * Multi-Window Window Manager header
+ */
+
+#include "winwindow.h"
+
+
+/* Cygwin's winuser.h does not define VK_KANA as of 28Mar2001 */
+/* NOTE: Cygwin's winuser.h was fixed shortly after 28Mar2001. */
+#ifndef VK_KANA
+#define VK_KANA 15
+#endif
+
+
+/*
+ * Debugging macros
+ */
+
+#if CYGDEBUG
+#define DEBUG_MSG(str,...) \
+if (fDebugProcMsg) \
+{ \
+ char *pszTemp; \
+ int iLength; \
+ \
+ iLength = sprintf (NULL, str, ##__VA_ARGS__); \
+ \
+ pszTemp = malloc (iLength + 1); \
+ \
+ sprintf (pszTemp, str, ##__VA_ARGS__); \
+ \
+ MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \
+ \
+ free (pszTemp); \
+}
+#else
+#define DEBUG_MSG(str,...)
+#endif
+
+#if CYGDEBUG || YES
+#define DEBUG_FN_NAME(str) PTSTR szFunctionName = str
+#else
+#define DEBUG_FN_NAME(str)
+#endif
+
+#if CYGDEBUG || YES
+#define DEBUGVARS BOOL fDebugProcMsg = FALSE
+#else
+#define DEBUGVARS
+#endif
+
+#if CYGDEBUG || YES
+#define DEBUGPROC_MSG fDebugProcMsg = TRUE
+#else
+#define DEBUGPROC_MSG
+#endif
+
+/* We use xor this macro for detecting toggle key state changes */
+#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b)))
+
+
+/*
+ * Typedefs for engine dependent function pointers
+ */
+
+typedef Bool (*winAllocateFBProcPtr)(ScreenPtr);
+
+typedef void (*winShadowUpdateProcPtr)(ScreenPtr, shadowBufPtr);
+
+typedef Bool (*winCloseScreenProcPtr)(int, ScreenPtr);
+
+typedef Bool (*winInitVisualsProcPtr)(ScreenPtr);
+
+typedef Bool (*winAdjustVideoModeProcPtr)(ScreenPtr);
+
+typedef Bool (*winCreateBoundingWindowProcPtr)(ScreenPtr);
+
+typedef Bool (*winFinishScreenInitProcPtr)(int, ScreenPtr, int, char **);
+
+typedef Bool (*winBltExposedRegionsProcPtr)(ScreenPtr);
+
+typedef Bool (*winActivateAppProcPtr)(ScreenPtr);
+
+typedef Bool (*winRedrawScreenProcPtr)(ScreenPtr pScreen);
+
+typedef Bool (*winRealizeInstalledPaletteProcPtr)(ScreenPtr pScreen);
+
+typedef Bool (*winInstallColormapProcPtr)(ColormapPtr pColormap);
+
+typedef Bool (*winStoreColorsProcPtr)(ColormapPtr pmap,
+ int ndef, xColorItem *pdefs);
+
+typedef Bool (*winCreateColormapProcPtr)(ColormapPtr pColormap);
+
+typedef Bool (*winDestroyColormapProcPtr)(ColormapPtr pColormap);
+
+typedef Bool (*winHotKeyAltTabProcPtr)(ScreenPtr);
+
+typedef Bool (*winCreatePrimarySurfaceProcPtr)(ScreenPtr);
+
+typedef Bool (*winReleasePrimarySurfaceProcPtr)(ScreenPtr);
+
+
+/*
+ * GC (graphics context) privates
+ */
+
+typedef struct
+{
+ HDC hdc;
+ HDC hdcMem;
+} winPrivGCRec, *winPrivGCPtr;
+
+
+/*
+ * Pixmap privates
+ */
+
+typedef struct
+{
+ HDC hdcSelected;
+ HBITMAP hBitmap;
+ BYTE *pbBits;
+ DWORD dwScanlineBytes;
+ BITMAPINFOHEADER *pbmih;
+} winPrivPixmapRec, *winPrivPixmapPtr;
+
+
+/*
+ * Colormap privates
+ */
+
+typedef struct
+{
+ HPALETTE hPalette;
+ LPDIRECTDRAWPALETTE lpDDPalette;
+ RGBQUAD rgbColors[WIN_NUM_PALETTE_ENTRIES];
+ PALETTEENTRY peColors[WIN_NUM_PALETTE_ENTRIES];
+} winPrivCmapRec, *winPrivCmapPtr;
+
+
+#if WIN_NEW_KEYBOARD_SUPPORT
+/*
+ * Keyboard event structure
+ */
+
+typedef struct
+{
+ DWORD dwXKeycodes[WIN_MAX_KEYS_PER_KEY];
+ DWORD dwReleaseModifiers;
+} winKeyEventsRec, *winKeyEventsPtr;
+
+#endif /* WIN_NEW_KEYBOARD_SUPPORT */
+
+/*
+ * Screen information structure that we need before privates are available
+ * in the server startup sequence.
+ */
+
+typedef struct
+{
+ ScreenPtr pScreen;
+
+ /* Did the user specify a height and width? */
+ Bool fUserGaveHeightAndWidth;
+
+ DWORD dwScreen;
+ DWORD dwUserWidth;
+ DWORD dwUserHeight;
+ DWORD dwWidth;
+ DWORD dwHeight;
+ DWORD dwWidth_mm;
+ DWORD dwHeight_mm;
+ DWORD dwPaddedWidth;
+
+ /*
+ * dwStride is the number of whole pixels that occupy a scanline,
+ * including those pixels that are not displayed. This is basically
+ * a rounding up of the width.
+ */
+ DWORD dwStride;
+
+ /* Offset of the screen in the window when using scrollbars */
+ DWORD dwXOffset;
+ DWORD dwYOffset;
+
+ DWORD dwBPP;
+ DWORD dwDepth;
+ DWORD dwRefreshRate;
+ char *pfb;
+ XWDColor *pXWDCmap;
+ XWDFileHeader *pXWDHeader;
+ DWORD dwEngine;
+ DWORD dwEnginePreferred;
+ DWORD dwClipUpdatesNBoxes;
+ Bool fEmulatePseudo;
+ Bool fFullScreen;
+ Bool fDecoration;
+ Bool fRootless;
+ Bool fMultiWindow;
+ Bool fMultipleMonitors;
+ Bool fClipboard;
+ Bool fLessPointer;
+ Bool fScrollbars;
+ int iE3BTimeout;
+ /* Windows (Alt+F4) and Unix (Ctrl+Alt+Backspace) Killkey */
+ Bool fUseWinKillKey;
+ Bool fUseUnixKillKey;
+ Bool fIgnoreInput;
+
+ /* Did the user explicitly set this screen? */
+ Bool fExplicitScreen;
+} winScreenInfo, *winScreenInfoPtr;
+
+
+/*
+ * Screen privates
+ */
+
+typedef struct _winPrivScreenRec
+{
+ winScreenInfoPtr pScreenInfo;
+
+ Bool fEnabled;
+ Bool fClosed;
+ Bool fActive;
+ Bool fBadDepth;
+
+ int iDeltaZ;
+
+ CloseScreenProcPtr CloseScreen;
+
+ DWORD dwRedMask;
+ DWORD dwGreenMask;
+ DWORD dwBlueMask;
+ DWORD dwBitsPerRGB;
+
+ DWORD dwModeKeyStates;
+
+ /* Clipboard support */
+ pthread_t ptClipboardProc;
+
+#if 0
+ HWND hwndNextViewer;
+ void *display;
+ int window;
+#endif
+
+ /* Last width, height, and depth of the Windows display */
+ DWORD dwLastWindowsWidth;
+ DWORD dwLastWindowsHeight;
+ DWORD dwLastWindowsBitsPixel;
+
+ /* Layer support */
+#if WIN_LAYER_SUPPORT
+ DWORD dwLayerKind;
+ LayerPtr pLayer;
+#endif
+
+ /* Palette management */
+ ColormapPtr pcmapInstalled;
+
+ /* Pointer to the root visual so we only have to look it up once */
+ VisualPtr pRootVisual;
+
+ /* 3 button emulation variables */
+ int iE3BCachedPress;
+ Bool fE3BFakeButton2Sent;
+
+ /* Privates used by shadow fb GDI server */
+ HBITMAP hbmpShadow;
+ HDC hdcScreen;
+ HDC hdcShadow;
+ HWND hwndScreen;
+
+ /* Privates used by shadow fb and primary fb DirectDraw servers */
+ LPDIRECTDRAW pdd;
+ LPDIRECTDRAWSURFACE2 pddsPrimary;
+ LPDIRECTDRAW2 pdd2;
+
+ /* Privates used by shadow fb DirectDraw server */
+ LPDIRECTDRAWSURFACE2 pddsShadow;
+ LPDDSURFACEDESC pddsdShadow;
+
+ /* Privates used by primary fb DirectDraw server */
+ LPDIRECTDRAWSURFACE2 pddsOffscreen;
+ LPDDSURFACEDESC pddsdOffscreen;
+ LPDDSURFACEDESC pddsdPrimary;
+
+ /* Privates used by shadow fb DirectDraw Nonlocking server */
+ LPDIRECTDRAW4 pdd4;
+ LPDIRECTDRAWSURFACE4 pddsShadow4;
+ LPDIRECTDRAWSURFACE4 pddsPrimary4;
+
+ /* Privates used by both shadow fb DirectDraw servers */
+ LPDIRECTDRAWCLIPPER pddcPrimary;
+
+ /* Privates used by multi-window server */
+ pthread_t ptWMProc;
+ void *pWMInfo;
+
+ /* Privates used for any module running in a seperate thread */
+ pthread_mutex_t pmServerStarted;
+ Bool fServerStarted;
+
+ /* Engine specific functions */
+ winAllocateFBProcPtr pwinAllocateFB;
+ winShadowUpdateProcPtr pwinShadowUpdate;
+ winCloseScreenProcPtr pwinCloseScreen;
+ winInitVisualsProcPtr pwinInitVisuals;
+ winAdjustVideoModeProcPtr pwinAdjustVideoMode;
+ winCreateBoundingWindowProcPtr pwinCreateBoundingWindow;
+ winFinishScreenInitProcPtr pwinFinishScreenInit;
+ winBltExposedRegionsProcPtr pwinBltExposedRegions;
+ winActivateAppProcPtr pwinActivateApp;
+ winRedrawScreenProcPtr pwinRedrawScreen;
+ winRealizeInstalledPaletteProcPtr pwinRealizeInstalledPalette;
+ winInstallColormapProcPtr pwinInstallColormap;
+ winStoreColorsProcPtr pwinStoreColors;
+ winCreateColormapProcPtr pwinCreateColormap;
+ winDestroyColormapProcPtr pwinDestroyColormap;
+ winHotKeyAltTabProcPtr pwinHotKeyAltTab;
+ winCreatePrimarySurfaceProcPtr pwinCreatePrimarySurface;
+ winReleasePrimarySurfaceProcPtr pwinReleasePrimarySurface;
+
+ /* Window Procedures for Rootless mode */
+ CreateWindowProcPtr CreateWindow;
+ DestroyWindowProcPtr DestroyWindow;
+ PositionWindowProcPtr PositionWindow;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ WindowExposuresProcPtr WindowExposures;
+ PaintWindowBackgroundProcPtr PaintWindowBackground;
+ PaintWindowBorderProcPtr PaintWindowBorder;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ ClipNotifyProcPtr ClipNotify;
+ RestackWindowProcPtr RestackWindow;
+ ReparentWindowProcPtr ReparentWindow;
+#ifdef SHAPE
+ SetShapeProcPtr SetShape;
+#endif
+} winPrivScreenRec;
+
+
+/*
+ * Extern declares for general global variables
+ */
+
+extern winScreenInfo g_ScreenInfo[];
+extern miPointerScreenFuncRec g_winPointerCursorFuncs;
+extern DWORD g_dwEvents;
+extern int g_fdMessageQueue;
+extern int g_iScreenPrivateIndex;
+extern int g_iCmapPrivateIndex;
+extern int g_iGCPrivateIndex;
+extern int g_iPixmapPrivateIndex;
+extern int g_iWindowPrivateIndex;
+extern unsigned long g_ulServerGeneration;
+extern CARD32 g_c32LastInputEventTime;
+extern DWORD g_dwEnginesSupported;
+extern HINSTANCE g_hInstance;
+extern HWND g_hDlgDepthChange;
+
+
+/*
+ * Extern declares for dynamically loaded libraries and function pointers
+ */
+
+extern HMODULE g_hmodDirectDraw;
+extern FARPROC g_fpDirectDrawCreate;
+extern FARPROC g_fpDirectDrawCreateClipper;
+
+extern HMODULE g_hmodCommonControls;
+extern FARPROC g_fpTrackMouseEvent;
+
+
+/*
+ * Screen privates macros
+ */
+
+#define winGetScreenPriv(pScreen) \
+ ((winPrivScreenPtr) (pScreen)->devPrivates[g_iScreenPrivateIndex].ptr)
+
+#define winSetScreenPriv(pScreen,v) \
+ ((pScreen)->devPrivates[g_iScreenPrivateIndex].ptr = (pointer) v)
+
+#define winScreenPriv(pScreen) \
+ winPrivScreenPtr pScreenPriv = winGetScreenPriv(pScreen)
+
+
+/*
+ * Colormap privates macros
+ */
+
+#define winGetCmapPriv(pCmap) \
+ ((winPrivCmapPtr) (pCmap)->devPrivates[g_iCmapPrivateIndex].ptr)
+
+#define winSetCmapPriv(pCmap,v) \
+ ((pCmap)->devPrivates[g_iCmapPrivateIndex].ptr = (pointer) v)
+
+#define winCmapPriv(pCmap) \
+ winPrivCmapPtr pCmapPriv = winGetCmapPriv(pCmap)
+
+
+/*
+ * GC privates macros
+ */
+
+#define winGetGCPriv(pGC) \
+ ((winPrivGCPtr) (pGC)->devPrivates[g_iGCPrivateIndex].ptr)
+
+#define winSetGCPriv(pGC,v) \
+ ((pGC)->devPrivates[g_iGCPrivateIndex].ptr = (pointer) v)
+
+#define winGCPriv(pGC) \
+ winPrivGCPtr pGCPriv = winGetGCPriv(pGC)
+
+
+/*
+ * Pixmap privates macros
+ */
+
+#define winGetPixmapPriv(pPixmap) \
+ ((winPrivPixmapPtr) (pPixmap)->devPrivates[g_iPixmapPrivateIndex].ptr)
+
+#define winSetPixmapPriv(pPixmap,v) \
+ ((pPixmap)->devPrivates[g_iPixmapPrivateIndex].ptr = (pointer) v)
+
+#define winPixmapPriv(pPixmap) \
+ winPrivPixmapPtr pPixmapPriv = winGetPixmapPriv(pPixmap)
+
+
+/*
+ * Window privates macros
+ */
+
+#define winGetWindowPriv(pWin) \
+ ((winPrivWinPtr) (pWin)->devPrivates[g_iWindowPrivateIndex].ptr)
+
+#define winSetWindowPriv(pWin,v) \
+ ((pWin)->devPrivates[g_iWindowPrivateIndex].ptr = (pointer) v)
+
+#define winWindowPriv(pWin) \
+ winPrivWinPtr pWinPriv = winGetWindowPriv(pWin)
+
+
+/*
+ * FIXME: Windows mouse wheel macro; should be in Cygwin w32api headers.
+ * Has been fixed after May 05, 2001. Remove this section after the
+ * fixed headers are in distribution.
+ */
+
+#ifndef GET_WHEEL_DELTA_WPARAM
+#define GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD (wparam))
+#endif /* GET_WHEEL_DELTA_WPARAM */
+
+
+/*
+ * FIXME: Windows shell API defines. Should be in w32api shellapi.h
+ */
+
+#ifndef ABS_AUTOHIDE
+#define ABS_AUTOHIDE 0x00000001
+#endif
+#ifndef ABS_ALWAYSONTOP
+#define ABS_ALWAYSONTOP 0x00000002
+#endif
+
+
+/*
+ * BEGIN DDX and DIX Function Prototypes
+ */
+
+
+/*
+ * winallpriv.c
+ */
+
+Bool
+winAllocatePrivates (ScreenPtr pScreen);
+
+Bool
+winInitCmapPrivates (ColormapPtr pCmap);
+
+Bool
+winAllocateCmapPrivates (ColormapPtr pCmap);
+
+
+/*
+ * winblock.c
+ */
+
+void
+winBlockHandler (int nScreen,
+ pointer pBlockData,
+ pointer pTimeout,
+ pointer pReadMask);
+
+
+/*
+ * winclip.c
+ */
+
+RegionPtr
+winPixmapToRegionNativeGDI (PixmapPtr pPix);
+
+
+/*
+ * winclipboardinit.c
+ */
+
+Bool
+winInitClipboard (pthread_t *ptClipboardProc,
+ pthread_mutex_t *ppmServerStarted,
+ DWORD dwScreen);
+
+
+/*
+ * wincmap.c
+ */
+
+int
+winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps);
+
+void
+winStoreColors (ColormapPtr pmap, int ndef, xColorItem *pdefs);
+
+void
+winInstallColormap (ColormapPtr pmap);
+
+void
+winUninstallColormap (ColormapPtr pmap);
+
+void
+winResolveColor (unsigned short *pred,
+ unsigned short *pgreen,
+ unsigned short *pblue,
+ VisualPtr pVisual);
+
+Bool
+winCreateColormap (ColormapPtr pmap);
+
+void
+winDestroyColormap (ColormapPtr pmap);
+
+int
+winExpandDirectColors (ColormapPtr pmap, int ndef,
+ xColorItem *indefs, xColorItem *outdefs);
+
+Bool
+winCreateDefColormap (ScreenPtr pScreen);
+
+Bool
+winSetVisualTypesNativeGDI (int nDepth, int nVisuals, int nBitsPerRGB);
+
+void
+winClearVisualTypes (void);
+
+
+/*
+ * wincreatewnd.c
+ */
+
+Bool
+winCreateBoundingWindowFullScreen (ScreenPtr pScreen);
+
+Bool
+winCreateBoundingWindowWindowed (ScreenPtr pScreen);
+
+
+/*
+ * wincursor.c
+ */
+
+void
+winPointerWarpCursor (ScreenPtr pScreen, int x, int y);
+
+Bool
+winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y);
+
+void
+winCrossScreen (ScreenPtr pScreen, Bool fEntering);
+
+
+/*
+ * winengine.c
+ */
+
+void
+winDetectSupportedEngines ();
+
+Bool
+winSetEngine (ScreenPtr pScreen);
+
+Bool
+winGetDDProcAddresses ();
+
+
+/*
+ * winerror.c
+ */
+
+void
+OSVenderVErrorF (const char *pszFormat, va_list va_args);
+
+
+/*
+ * winfillsp.c
+ */
+
+void
+winFillSpansNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nSpans,
+ DDXPointPtr pPoints,
+ int *pWidths,
+ int fSorted);
+
+
+/*
+ * winfont.c
+ */
+
+Bool
+winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont);
+
+Bool
+winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont);
+
+
+/*
+ * wingc.c
+ */
+
+Bool
+winCreateGCNativeGDI (GCPtr pGC);
+
+void
+winChangeGCNativeGDI (GCPtr pGC, unsigned long ulChanges);
+
+void
+winPadPixmapNativdGDI (PixmapPtr pPixmap);
+
+void
+winValidateGCNativeGDI (GCPtr pGC,
+ unsigned long changes,
+ DrawablePtr pDrawable);
+
+void
+winCopyGCNativeGDI (GCPtr pGCsrc, unsigned long ulMask, GCPtr pGCdst);
+
+void
+winDestroyGCNativeGDI (GCPtr pGC);
+
+void
+winChangeClipNativeGDI (GCPtr pGC, int nType, pointer pValue, int nRects);
+
+void
+winDestroyClipNativeGDI (GCPtr pGC);
+
+void
+winCopyClipNativeGDI (GCPtr pGCdst, GCPtr pGCsrc);
+
+
+/*
+ * wingetsp.c
+ */
+
+void
+winGetSpansNativeGDI (DrawablePtr pDrawable,
+ int wMax,
+ DDXPointPtr pPoints,
+ int *pWidths,
+ int nSpans,
+ char *pDst);
+
+
+/*
+ * winkeybd.c
+ */
+
+#if WIN_NEW_KEYBOARD_SUPPORT
+winKeyEventsRec
+winTranslateKey (DWORD dwVirtualKey, DWORD dwKeyData);
+#else
+void
+winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode);
+#endif
+
+void
+winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap);
+
+void
+winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
+ pointer pCtrl, int iClass);
+
+void
+winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl);
+
+int
+winKeybdProc (DeviceIntPtr pDeviceInt, int iState);
+
+void
+winInitializeModeKeyStates (void);
+
+void
+winStoreModeKeyStates (ScreenPtr pScreen);
+
+void
+winRestoreModeKeyStates (ScreenPtr pScreen);
+
+Bool
+winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam);
+
+void
+winKeybdReleaseKeys ();
+
+void
+winSendKeyEvent (DWORD dwKey, Bool fDown);
+
+#if WIN_NEW_KEYBOARD_SUPPORT
+void
+winProcessKeyEvent (DWORD dwVirtKey, DWORD dwKeyData);
+#endif
+
+
+/*
+ * winlayer.c
+ */
+
+#if WIN_LAYER_SUPPORT
+
+LayerPtr
+winLayerCreate (ScreenPtr pScreen);
+
+int
+winLayerAdd (WindowPtr pWindow, pointer value);
+
+int
+winLayerRemove (WindowPtr pWindow, pointer value);
+
+#ifdef RANDR
+Bool
+winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations);
+
+Bool
+winRandRSetConfig (ScreenPtr pScreen,
+ Rotation rotateKind,
+ RRScreenSizePtr pSize);
+
+Bool
+winRandRInit (ScreenPtr pScreen);
+#endif /* RANDR */
+#endif /* WIN_LAYER_SUPPORT */
+
+
+/*
+ * winmisc.c
+ */
+
+void
+winQueryBestSizeNativeGDI (int class, unsigned short *pWidth,
+ unsigned short *pHeight, ScreenPtr pScreen);
+
+CARD8
+winCountBits (DWORD dw);
+
+Bool
+winUpdateFBPointer (ScreenPtr pScreen, void *pbits);
+
+BOOL
+winPaintBackground (HWND hwnd, COLORREF colorref);
+
+
+/*
+ * winmouse.c
+ */
+
+void
+winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl);
+
+int
+winMouseProc (DeviceIntPtr pDeviceInt, int iState);
+
+int
+winMouseWheel (ScreenPtr pScreen, int iDeltaZ);
+
+void
+winMouseButtonsSendEvent (int iEventType, int iButton);
+
+int
+winMouseButtonsHandle (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam);
+
+
+/*
+ * winnativegdi.c
+ */
+
+HBITMAP
+winCreateDIBNativeGDI (int iWidth, int iHeight, int iDepth,
+ BYTE **ppbBits, BITMAPINFO **ppbmi);
+
+Bool
+winAllocateFBNativeGDI (ScreenPtr pScreen);
+
+void
+winShadowUpdateNativeGDI (ScreenPtr pScreen,
+ shadowBufPtr pBuf);
+
+Bool
+winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen);
+
+Bool
+winInitVisualsNativeGDI (ScreenPtr pScreen);
+
+Bool
+winAdjustVideoModeNativeGDI (ScreenPtr pScreen);
+
+Bool
+winBltExposedRegionsNativeGDI (ScreenPtr pScreen);
+
+Bool
+winActivateAppNativeGDI (ScreenPtr pScreen);
+
+Bool
+winSetEngineFunctionsNativeGDI (ScreenPtr pScreen);
+
+Bool
+winRedrawScreenNativeGDI (ScreenPtr pScreen);
+
+Bool
+winRealizeInstalledPaletteNativeGDI (ScreenPtr pScreen);
+
+Bool
+winInstallColormapNativeGDI (ColormapPtr pColormap);
+
+Bool
+winStoreColorsNativeGDI (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs);
+
+Bool
+winCreateColormapNativeGDI (ColormapPtr pColormap);
+
+Bool
+winDestroyColormapNativeGDI (ColormapPtr pColormap);
+
+
+
+/*
+ * winpfbddd.c
+ */
+
+Bool
+winAllocateFBPrimaryDD (ScreenPtr pScreen);
+
+Bool
+winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen);
+
+Bool
+winInitVisualsPrimaryDD (ScreenPtr pScreen);
+
+Bool
+winAdjustVideoModePrimaryDD (ScreenPtr pScreen);
+
+Bool
+winActivateAppPrimaryDD (ScreenPtr pScreen);
+
+Bool
+winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen);
+
+Bool
+winHotKeyAltTabPrimaryDD (ScreenPtr pScreen);
+
+
+/*
+ * winpixmap.c
+ */
+
+PixmapPtr
+winCreatePixmapNativeGDI (ScreenPtr pScreen, int width, int height, int depth);
+
+Bool
+winDestroyPixmapNativeGDI (PixmapPtr pPixmap);
+
+void
+winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw);
+
+void
+winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh);
+
+void
+winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
+ int xrot, int yrot);
+
+Bool
+winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap,
+ int iWidth, int iHeight,
+ int iDepth,
+ int iBitsPerPixel,
+ int devKind,
+ pointer pPixData);
+
+
+/*
+ * winpntwin.c
+ */
+
+void
+winPaintWindowNativeGDI (WindowPtr pWin, RegionPtr pRegion, int what);
+
+
+/*
+ * winpolyline.c
+ */
+
+void
+winPolyLineNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr ppt);
+
+
+/*
+ * winscrinit.c
+ */
+
+Bool
+winScreenInit (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv);
+
+Bool
+winFinishScreenInitFB (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv);
+
+Bool
+winFinishScreenInitNativeGDI (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv);
+
+Bool
+winSaveScreen (ScreenPtr pScreen, int on);
+
+PixmapPtr
+winGetWindowPixmap (WindowPtr pWin);
+
+void
+winSetWindowPixmap (WindowPtr pWin, PixmapPtr pPix);
+
+
+/*
+ * winsetsp.c
+ */
+
+void
+winSetSpansNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ char *pSrc,
+ DDXPointPtr pPoints,
+ int *pWidth,
+ int nSpans,
+ int fSorted);
+
+/*
+ * winshaddd.c
+ */
+
+Bool
+winAllocateFBShadowDD (ScreenPtr pScreen);
+
+void
+winShadowUpdateDD (ScreenPtr pScreen,
+ shadowBufPtr pBuf);
+
+Bool
+winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen);
+
+Bool
+winInitVisualsShadowDD (ScreenPtr pScreen);
+
+Bool
+winAdjustVideoModeShadowDD (ScreenPtr pScreen);
+
+Bool
+winBltExposedRegionsShadowDD (ScreenPtr pScreen);
+
+Bool
+winActivateAppShadowDD (ScreenPtr pScreen);
+
+Bool
+winSetEngineFunctionsShadowDD (ScreenPtr pScreen);
+
+Bool
+winRedrawScreenShadowDD (ScreenPtr pScreen);
+
+Bool
+winRealizeInstalledPaletteShadowDD (ScreenPtr pScreen);
+
+Bool
+winInstallColormapShadowDD (ColormapPtr pColormap);
+
+Bool
+winStoreColorsShadowDD (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs);
+
+Bool
+winCreateColormapShadowDD (ColormapPtr pColormap);
+
+Bool
+winDestroyColormapShadowDD (ColormapPtr pColormap);
+
+Bool
+winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen);
+
+Bool
+winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen);
+
+
+/*
+ * winshadddnl.c
+ */
+
+Bool
+winAllocateFBShadowDDNL (ScreenPtr pScreen);
+
+void
+winShadowUpdateDDNL (ScreenPtr pScreen,
+ shadowBufPtr pBuf);
+
+Bool
+winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen);
+
+Bool
+winInitVisualsShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winAdjustVideoModeShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winBltExposedRegionsShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winActivateAppShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winRedrawScreenShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winRealizeInstalledPaletteShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winInstallColormapShadowDDNL (ColormapPtr pColormap);
+
+Bool
+winStoreColorsShadowDDNL (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs);
+
+Bool
+winCreateColormapShadowDDNL (ColormapPtr pColormap);
+
+Bool
+winDestroyColormapShadowDDNL (ColormapPtr pColormap);
+
+Bool
+winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen);
+
+Bool
+winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen);
+
+
+/*
+ * winshadgdi.c
+ */
+
+Bool
+winAllocateFBShadowGDI (ScreenPtr pScreen);
+
+void
+winShadowUpdateGDI (ScreenPtr pScreen,
+ shadowBufPtr pBuf);
+
+Bool
+winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen);
+
+Bool
+winInitVisualsShadowGDI (ScreenPtr pScreen);
+
+Bool
+winAdjustVideoModeShadowGDI (ScreenPtr pScreen);
+
+Bool
+winActivateAppShadowGDI (ScreenPtr pScreen);
+
+Bool
+winRedrawScreenShadowGDI (ScreenPtr pScreen);
+
+Bool
+winSetEngineFunctionsShadowGDI (ScreenPtr pScreen);
+
+Bool
+winRealizeInstalledPaletteShadowGDI (ScreenPtr pScreen);
+
+Bool
+winInstallColormapShadowGDI (ColormapPtr pColormap);
+
+Bool
+winStoreColorsShadowGDI (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs);
+
+Bool
+winCreateColormapShadowGDI (ColormapPtr pColormap);
+
+Bool
+winDestroyColormapShadowGDI (ColormapPtr pColormap);
+
+
+/*
+ * winwakeup.c
+ */
+
+void
+winWakeupHandler (int nScreen,
+ pointer pWakeupData,
+ unsigned long ulResult,
+ pointer pReadmask);
+
+
+/*
+ * winwindow.c
+ */
+
+Bool
+winCreateWindowNativeGDI (WindowPtr pWin);
+
+Bool
+winDestroyWindowNativeGDI (WindowPtr pWin);
+
+Bool
+winPositionWindowNativeGDI (WindowPtr pWin, int x, int y);
+
+void
+winCopyWindowNativeGDI (WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc);
+
+Bool
+winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask);
+
+Bool
+winUnmapWindowNativeGDI (WindowPtr pWindow);
+
+Bool
+winMapWindowNativeGDI (WindowPtr pWindow);
+
+Bool
+winCreateWindowPRootless (WindowPtr pWindow);
+
+Bool
+winDestroyWindowPRootless (WindowPtr pWindow);
+
+Bool
+winPositionWindowPRootless (WindowPtr pWindow, int x, int y);
+
+Bool
+winChangeWindowAttributesPRootless (WindowPtr pWindow, unsigned long mask);
+
+Bool
+winUnmapWindowPRootless (WindowPtr pWindow);
+
+Bool
+winMapWindowPRootless (WindowPtr pWindow);
+
+#ifdef SHAPE
+void
+winSetShapePRootless (WindowPtr pWindow);
+#endif
+
+
+/*
+ * winmultiwindowwindow.c
+ */
+
+Bool
+winCreateWindowMultiWindow (WindowPtr pWindow);
+
+Bool
+winDestroyWindowMultiWindow (WindowPtr pWindow);
+
+Bool
+winPositionWindowMultiWindow (WindowPtr pWindow, int x, int y);
+
+Bool
+winChangeWindowAttributesMultiWindow (WindowPtr pWindow, unsigned long mask);
+
+Bool
+winUnmapWindowMultiWindow (WindowPtr pWindow);
+
+Bool
+winMapWindowMultiWindow (WindowPtr pWindow);
+
+void
+winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent);
+
+void
+winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib);
+
+#ifdef SHAPE
+void
+winSetShapeMultiWindow (WindowPtr pWindow);
+#endif
+
+
+/*
+ * winwndproc.c
+ */
+
+LRESULT CALLBACK
+winWindowProc (HWND hWnd, UINT message,
+ WPARAM wParam, LPARAM lParam);
+
+
+/*
+ * END DDX and DIX Function Prototypes
+ */
+
+#endif /* _WIN_H_ */
+
diff --git a/hw/xwin/winallpriv.c b/hw/xwin/winallpriv.c
new file mode 100644
index 000000000..a27309598
--- /dev/null
+++ b/hw/xwin/winallpriv.c
@@ -0,0 +1,181 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Keith Packard, MIT X Consortium
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winallpriv.c,v 1.12 2002/10/31 23:04:39 alanh Exp $ */
+
+#include "win.h"
+
+
+
+/* See Porting Layer Definition - p. 58 */
+/*
+ * Allocate indexes for the privates that we use.
+ * Allocate memory directly for the screen privates.
+ * Reserve space in GCs and Pixmaps for our privates.
+ * Colormap privates are handled in winAllocateCmapPrivates ()
+ */
+
+Bool
+winAllocatePrivates (ScreenPtr pScreen)
+{
+ winPrivScreenPtr pScreenPriv;
+
+#if CYGDEBUG
+ ErrorF ("winAllocateScreenPrivates - g_ulServerGeneration: %d "
+ "serverGeneration: %d\n",
+ g_ulServerGeneration, serverGeneration);
+#endif
+
+ /* We need a new slot for our privates if the screen gen has changed */
+ if (g_ulServerGeneration != serverGeneration)
+ {
+ /* Get an index that we can store our privates at */
+ g_iScreenPrivateIndex = AllocateScreenPrivateIndex ();
+ g_iGCPrivateIndex = AllocateGCPrivateIndex ();
+ g_iPixmapPrivateIndex = AllocatePixmapPrivateIndex ();
+ g_iWindowPrivateIndex = AllocateWindowPrivateIndex ();
+
+ g_ulServerGeneration = serverGeneration;
+ }
+
+ /* Allocate memory for the screen private structure */
+ pScreenPriv = (winPrivScreenPtr) malloc (sizeof (winPrivScreenRec));
+ if (!pScreenPriv)
+ {
+ ErrorF ("winAllocateScreenPrivates - malloc () failed\n");
+ return FALSE;
+ }
+
+ /* Initialize the memory of the private structure */
+ ZeroMemory (pScreenPriv, sizeof (winPrivScreenRec));
+
+ /* Intialize private structure members */
+ pScreenPriv->fActive = TRUE;
+
+ /* Save the screen private pointer */
+ winSetScreenPriv (pScreen, pScreenPriv);
+
+ /* Reserve GC memory for our privates */
+ if (!AllocateGCPrivate (pScreen, g_iGCPrivateIndex,
+ sizeof (winPrivGCRec)))
+ {
+ ErrorF ("winAllocatePrivates - AllocateGCPrivate () failed\n");
+ return FALSE;
+ }
+
+ /* Reserve Pixmap memory for our privates */
+ if (!AllocatePixmapPrivate (pScreen, g_iPixmapPrivateIndex,
+ sizeof (winPrivPixmapRec)))
+ {
+ ErrorF ("winAllocatePrivates - AllocatePixmapPrivates () failed\n");
+ return FALSE;
+ }
+
+ /* Reserve Window memory for our privates */
+ if (!AllocateWindowPrivate (pScreen, g_iWindowPrivateIndex,
+ sizeof (winPrivWinRec)))
+ {
+ ErrorF ("winAllocatePrivates () - AllocateWindowPrivates () failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap privates may be allocated after the default colormap has
+ * already been created for some screens. This initialization procedure
+ * is called for each default colormap that is found.
+ */
+
+Bool
+winInitCmapPrivates (ColormapPtr pcmap)
+{
+#if CYGDEBUG
+ ErrorF ("winInitCmapPrivates\n");
+#endif
+
+ /*
+ * I see no way that this function can do anything useful
+ * with only a ColormapPtr. We don't have the index for
+ * our dev privates yet, so we can't really initialize
+ * anything. Perhaps I am misunderstanding the purpose
+ * of this function.
+ */
+
+ return TRUE;
+}
+
+
+/*
+ * Allocate memory for our colormap privates
+ */
+
+Bool
+winAllocateCmapPrivates (ColormapPtr pCmap)
+{
+ winPrivCmapPtr pCmapPriv;
+ static unsigned long s_ulPrivateGeneration = 0;
+
+#if CYGDEBUG
+ ErrorF ("winAllocateCmapPrivates\n");
+#endif
+
+ /* Get a new privates index when the server generation changes */
+ if (s_ulPrivateGeneration != serverGeneration)
+ {
+ /* Get an index that we can store our privates at */
+ g_iCmapPrivateIndex = AllocateColormapPrivateIndex (winInitCmapPrivates);
+
+ /* Save the new server generation */
+ s_ulPrivateGeneration = serverGeneration;
+ }
+
+ /* Allocate memory for our private structure */
+ pCmapPriv = (winPrivCmapPtr) malloc (sizeof (winPrivCmapRec));
+ if (!pCmapPriv)
+ {
+ ErrorF ("winAllocateCmapPrivates - malloc () failed\n");
+ return FALSE;
+ }
+
+ /* Initialize the memory of the private structure */
+ ZeroMemory (pCmapPriv, sizeof (winPrivCmapRec));
+
+ /* Save the cmap private pointer */
+ winSetCmapPriv (pCmap, pCmapPriv);
+
+#if CYGDEBUG
+ ErrorF ("winAllocateCmapPrivates - Returning\n");
+#endif
+
+ return TRUE;
+}
diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c
new file mode 100644
index 000000000..45d509fea
--- /dev/null
+++ b/hw/xwin/winblock.c
@@ -0,0 +1,76 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winblock.c,v 1.6 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 6 */
+void
+winBlockHandler (int nScreen,
+ pointer pBlockData,
+ pointer pTimeout,
+ pointer pReadMask)
+{
+ winScreenPriv((ScreenPtr)pBlockData);
+ MSG msg;
+
+ /* Signal threaded modules to begin */
+ if (pScreenPriv != NULL && !pScreenPriv->fServerStarted)
+ {
+ int iReturn;
+
+ ErrorF ("winBlockHandler - Releasing pmServerStarted\n");
+
+ /* Flag that modules are to be started */
+ pScreenPriv->fServerStarted = TRUE;
+
+ /* Unlock the mutex for threaded modules */
+ iReturn = pthread_mutex_unlock (&pScreenPriv->pmServerStarted);
+ if (iReturn != 0)
+ {
+ ErrorF ("winBlockHandler - pthread_mutex_unlock () failed: %d\n",
+ iReturn);
+ goto winBlockHandler_ProcessMessages;
+ }
+
+ ErrorF ("winBlockHandler - pthread_mutex_unlock () returned\n");
+ }
+
+winBlockHandler_ProcessMessages:
+
+ /* Process all messages on our queue */
+ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ if (g_hDlgDepthChange == 0 || !IsDialogMessage (g_hDlgDepthChange, &msg))
+ {
+ DispatchMessage (&msg);
+ }
+ }
+}
diff --git a/hw/xwin/winclip.c b/hw/xwin/winclip.c
new file mode 100644
index 000000000..a829e8eb9
--- /dev/null
+++ b/hw/xwin/winclip.c
@@ -0,0 +1,40 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclip.c,v 1.2 2001/06/04 13:04:41 alanh Exp $ */
+
+#include "win.h"
+
+/* Look at mfb/mfbclip.c for sample implementation */
+RegionPtr
+winPixmapToRegionNativeGDI (PixmapPtr pPix)
+{
+ ErrorF ("winPixmapToRegion()\n");
+ return NULL;
+}
diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h
new file mode 100644
index 000000000..6e6cf44a9
--- /dev/null
+++ b/hw/xwin/winclipboard.h
@@ -0,0 +1,158 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold Hunt
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboard.h,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+
+#ifndef _WINCLIPBOARD_H_
+#define _WINCLIPBOARD_H_
+
+/* Standard library headers */
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/select.h>
+#include <fcntl.h>
+#include <setjmp.h>
+#include <pthread.h>
+
+/* X headers */
+#include "X.h"
+#include "Xatom.h"
+/* NOTE: For some unknown reason, including Xproto.h solves
+ * tons of problems with including windows.h. Unknowns reasons
+ * are usually bad, so someone should investigate this.
+ */
+#include "Xproto.h"
+#include "Xutil.h"
+#include "Xlocale.h"
+
+/* Fixups to prevent collisions between Windows and X headers */
+#define ATOM DWORD
+
+/* Windows headers */
+#include <windows.h>
+
+
+/* Clipboard module constants */
+#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip"
+#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip"
+#define WIN_MSG_QUEUE_FNAME "/dev/windows"
+#define WIN_CONNECT_RETRIES 3
+#define WIN_CONNECT_DELAY 4
+#define WIN_JMP_OKAY 0
+#define WIN_JMP_ERROR_IO 2
+
+/*
+ * Argument structure for Clipboard module main thread
+ */
+
+typedef struct _ClipboardProcArgRec {
+ DWORD dwScreen;
+ pthread_mutex_t *ppmServerStarted;
+} ClipboardProcArgRec, *ClipboardProcArgPtr;
+
+
+/*
+ * References to external symbols
+ */
+
+extern char *display;
+extern void ErrorF (const char* /*f*/, ...);
+
+
+/*
+ * winclipboardinit.c
+ */
+
+Bool
+winInitClipboard (pthread_t *ptClipboardProc,
+ pthread_mutex_t *ppmServerStarted,
+ DWORD dwScreen);
+
+HWND
+winClipboardCreateMessagingWindow ();
+
+
+/*
+ * winclipboardtextconv.c
+ */
+
+void
+winClipboardDOStoUNIX (char *pszData, int iLength);
+
+void
+winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength);
+
+
+/*
+ * winclipboardthread.c
+ */
+
+void *
+winClipboardProc (void *pArg);
+
+
+/*
+ * winclipboardunicode.c
+ */
+
+Bool
+winClipboardDetectUnicodeSupport ();
+
+
+/*
+ * winclipboardwndproc.c
+ */
+
+BOOL
+winClipboardFlushWindowsMessageQueue (HWND hwnd);
+
+LRESULT CALLBACK
+winClipboardWindowProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam);
+
+
+/*
+ * winclipboardxevents.c
+ */
+
+Bool
+winClipboardFlushXEvents (HWND hwnd,
+ Atom atomClipboard,
+ Atom atomLocalProperty,
+ Atom atomUTF8String,
+ Atom atomCompoundText,
+ Atom atomTargets,
+ Atom atomDeleteWindow,
+ int iWindow,
+ Display *pDisplay,
+ Bool fUnicodeSupport);
+#endif
diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c
new file mode 100644
index 000000000..22c068c48
--- /dev/null
+++ b/hw/xwin/winclipboardinit.c
@@ -0,0 +1,117 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardinit.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "winclipboard.h"
+
+
+/*
+ * Intialize the Clipboard module
+ */
+
+Bool
+winInitClipboard (pthread_t *ptClipboardProc,
+ pthread_mutex_t *ppmServerStarted,
+ DWORD dwScreen)
+{
+ ClipboardProcArgPtr pArg;
+
+ ErrorF ("winInitClipboard ()\n");
+
+ /* Allocate the parameter structure */
+ pArg = (ClipboardProcArgPtr) malloc (sizeof (ClipboardProcArgRec));
+ if (pArg == NULL)
+ {
+ ErrorF ("winInitClipboard - malloc for ClipboardProcArgRec failed.\n");
+ return FALSE;
+ }
+
+ /* Setup the argument structure for the thread function */
+ pArg->dwScreen = dwScreen;
+ pArg->ppmServerStarted = ppmServerStarted;
+
+ /* Spawn a thread for the Clipboard module */
+ if (pthread_create (ptClipboardProc, NULL, winClipboardProc, pArg))
+ {
+ /* Bail if thread creation failed */
+ ErrorF ("winInitClipboard - pthread_create failed.\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Create the Windows window that we use to recieve Windows messages
+ */
+
+HWND
+winClipboardCreateMessagingWindow ()
+{
+ WNDCLASS wc;
+ HWND hwnd;
+
+ /* Setup our window class */
+ wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.lpfnWndProc = winClipboardWindowProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = GetModuleHandle (NULL);
+ wc.hIcon = 0;
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = WIN_CLIPBOARD_WINDOW_CLASS;
+ RegisterClass (&wc);
+
+ /* Create the window */
+ hwnd = CreateWindowExA (0, /* Extended styles */
+ WIN_CLIPBOARD_WINDOW_CLASS,/* Class name */
+ WIN_CLIPBOARD_WINDOW_TITLE,/* Window name */
+ WS_OVERLAPPED, /* Not visible anyway */
+ CW_USEDEFAULT, /* Horizontal position */
+ CW_USEDEFAULT, /* Vertical position */
+ CW_USEDEFAULT, /* Right edge */
+ CW_USEDEFAULT, /* Bottom edge */
+ (HWND) NULL, /* No parent or owner window */
+ (HMENU) NULL, /* No menu */
+ GetModuleHandle (NULL),/* Instance handle */
+ NULL); /* ScreenPrivates */
+ assert (hwnd != NULL);
+
+ /* I'm not sure, but we may need to call this to start message processing */
+ ShowWindow (hwnd, SW_HIDE);
+
+ /* Similarly, we may need a call to this even though we don't paint */
+ UpdateWindow (hwnd);
+
+ return hwnd;
+}
diff --git a/hw/xwin/winclipboardtextconv.c b/hw/xwin/winclipboardtextconv.c
new file mode 100644
index 000000000..f97681c5f
--- /dev/null
+++ b/hw/xwin/winclipboardtextconv.c
@@ -0,0 +1,153 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardtextconv.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+
+/*
+ * Convert \r\n to \n
+ *
+ * NOTE: This was heavily inspired by, if not down right stolen from,
+ * Cygwin's winsup/cygwin/fhandler.cc/fhandler_base::read ()
+ */
+
+void
+winClipboardDOStoUNIX (char *pszSrc, int iLength)
+{
+ char *pszDest = pszSrc;
+ char *pszEnd = pszSrc + iLength;
+
+ /* Loop until the last character */
+ while (pszSrc < pszEnd)
+ {
+ /* Copy the current source character to current destination character */
+ *pszDest = *pszSrc;
+
+ /* Advance to the next source character */
+ pszSrc++;
+
+ /* Don't advance the destination character if we need to drop an \r */
+ if (*pszDest != '\r' || *pszSrc != '\n')
+ pszDest++;
+ }
+
+ /* Move the terminating null */
+ *pszDest = '\0';
+}
+
+
+/*
+ * Convert \n to \r\n
+ */
+
+void
+winClipboardUNIXtoDOS (unsigned char **ppszData, int iLength)
+{
+ int iNewlineCount = 0;
+ unsigned char *pszSrc = *ppszData;
+ unsigned char *pszEnd = pszSrc + iLength;
+ unsigned char *pszDest = NULL, *pszDestBegin = NULL;
+
+#if 0
+ ErrorF ("UNIXtoDOS () - Original data:\n%s\n", *ppszData);
+#endif
+
+ /* Count \n characters without leading \r */
+ while (pszSrc < pszEnd)
+ {
+ /* Skip ahead two character if found set of \r\n */
+ if (*pszSrc == '\r' && pszSrc + 1 < pszEnd && *(pszSrc + 1) == '\n')
+ {
+ pszSrc += 2;
+ continue;
+ }
+
+ /* Increment the count if found naked \n */
+ if (*pszSrc == '\n')
+ {
+ iNewlineCount++;
+ }
+
+ pszSrc++;
+ }
+
+ /* Return if no naked \n's */
+ if (iNewlineCount == 0)
+ return;
+
+ /* Allocate a new string */
+ pszDestBegin = pszDest = malloc (iLength + iNewlineCount + 1);
+
+ /* Set source pointer to beginning of data string */
+ pszSrc = *ppszData;
+
+ /* Loop through all characters in source string */
+ while (pszSrc < pszEnd)
+ {
+ /* Copy line endings that are already valid */
+ if (*pszSrc == '\r' && pszSrc + 1 < pszEnd && *(pszSrc + 1) == '\n')
+ {
+ *pszDest = *pszSrc;
+ *(pszDest + 1) = *(pszSrc + 1);
+ pszDest += 2;
+ pszSrc += 2;
+ continue;
+ }
+
+ /* Add \r to naked \n's */
+ if (*pszSrc == '\n')
+ {
+ *pszDest = '\r';
+ *(pszDest + 1) = *pszSrc;
+ pszDest += 2;
+ pszSrc += 1;
+ continue;
+ }
+
+ /* Copy normal characters */
+ *pszDest = *pszSrc;
+ pszSrc++;
+ pszDest++;
+ }
+
+ /* Put terminating null at end of new string */
+ *pszDest = '\0';
+
+ /* Swap string pointers */
+ free (*ppszData);
+ *ppszData = pszDestBegin;
+
+#if 0
+ ErrorF ("UNIXtoDOS () - Final string:\n%s\n", pszDestBegin);
+#endif
+}
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
new file mode 100644
index 000000000..ce4590b98
--- /dev/null
+++ b/hw/xwin/winclipboardthread.c
@@ -0,0 +1,463 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardthread.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "winclipboard.h"
+
+/*
+ * References to external symbols
+ */
+
+extern Bool g_fCalledSetLocale;
+
+
+/*
+ * Global variables
+ */
+
+static jmp_buf g_jmpEntry;
+
+
+/*
+ * Local function prototypes
+ */
+
+static int
+winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr);
+
+static int
+winClipboardIOErrorHandler (Display *pDisplay);
+
+
+/*
+ * Main thread function
+ */
+
+void *
+winClipboardProc (void *pArg)
+{
+ Atom atomClipboard, atomClipboardManager;
+ Atom atomLocalProperty, atomCompoundText;
+ Atom atomUTF8String, atomTargets;
+ int iReturn;
+ HWND hwnd = NULL;
+ int iConnectionNumber;
+ int fdMessageQueue;
+ fd_set fdsRead;
+ int iMaxDescriptor;
+ Display *pDisplay;
+ Window iWindow;
+ Atom atomDeleteWindow;
+ Bool fReturn;
+ int iRetries;
+ Bool fUnicodeSupport;
+ char szDisplay[512];
+ int i;
+ ClipboardProcArgPtr pProcArg = (ClipboardProcArgPtr) pArg;
+
+ ErrorF ("winClipboardProc - Hello\n");
+
+ /* Check that argument pointer is not invalid */
+ if (pArg == NULL)
+ {
+ ErrorF ("winClipboardProc - pArg is NULL, bailing.\n");
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winClipboardProc - Calling pthread_mutex_lock ()\n");
+
+ /* Grab our garbage mutex to satisfy pthread_cond_wait */
+ iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
+ if (iReturn != 0)
+ {
+ ErrorF ("winClipboardProc - pthread_mutex_lock () failed: %d\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winClipboardProc - pthread_mutex_lock () returned.\n");
+
+ /* Do we have Unicode support? */
+ fUnicodeSupport = winClipboardDetectUnicodeSupport ();
+
+ /* Set the current locale? What does this do? */
+ if (fUnicodeSupport && !g_fCalledSetLocale)
+ {
+ ErrorF ("winClipboardProc - Calling setlocale ()\n");
+ if (!setlocale (LC_ALL, ""))
+ {
+ ErrorF ("winClipboardProc - setlocale () error\n");
+ pthread_exit (NULL);
+ }
+ ErrorF ("winClipboardProc - setlocale () returned\n");
+
+ /* See if X supports the current locale */
+ if (XSupportsLocale () == False)
+ {
+ ErrorF ("winClipboardProc - Locale not supported by X\n");
+ pthread_exit (NULL);
+ }
+ }
+
+ /* Flag that we have called setlocale */
+ g_fCalledSetLocale = TRUE;
+
+ /* Release the garbage mutex */
+ pthread_mutex_unlock (pProcArg->ppmServerStarted);
+
+ ErrorF ("winClipboardProc - pthread_mutex_unlock () returned.\n");
+
+ /* Allow multiple threads to access Xlib */
+ if (XInitThreads () == 0)
+ {
+ ErrorF ("winClipboardProc - XInitThreads failed.\n");
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winClipboardProc - XInitThreads () returned.\n");
+
+ /* Set jump point for Error exits */
+ iReturn = setjmp (g_jmpEntry);
+
+ /* Check if we should continue operations */
+ if (iReturn != WIN_JMP_ERROR_IO
+ && iReturn != WIN_JMP_OKAY)
+ {
+ /* setjmp returned an unknown value, exit */
+ ErrorF ("winClipboardProc - setjmp returned: %d exiting\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+ else if (iReturn == WIN_JMP_ERROR_IO)
+ {
+ ErrorF ("winClipboardProc - setjmp returned and hwnd: %08x\n", hwnd);
+ }
+
+ /* Initialize retry count */
+ iRetries = 0;
+
+#if 0
+ /* Setup the display connection string x */
+ snprintf (szDisplay, 512, "127.0.0.1:%s.%d", display, pProcArg->dwScreen);
+#else
+ /* Setup the display connection string x */
+ snprintf (szDisplay, 512, ":%s.%d", display, pProcArg->dwScreen);
+#endif
+
+ /* Print the display connection string */
+ ErrorF ("winClipboardProc - DISPLAY=%s\n", szDisplay);
+
+ /* Open the X display */
+ do
+ {
+ pDisplay = XOpenDisplay (szDisplay);
+ if (pDisplay == NULL)
+ {
+ ErrorF ("winClipboardProc - Could not open display, "
+ "try: %d, sleeping: %d\n",
+ iRetries + 1, WIN_CONNECT_DELAY);
+ ++iRetries;
+ sleep (WIN_CONNECT_DELAY);
+ continue;
+ }
+ else
+ break;
+ }
+ while (pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
+
+ /* Make sure that the display opened */
+ if (pDisplay == NULL)
+ {
+ ErrorF ("winClipboardProc - Failed opening the display, giving up\n");
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winClipboardProc - XOpenDisplay () returned and "
+ "successfully opened the display.\n");
+
+ /* Create Windows messaging window */
+ hwnd = winClipboardCreateMessagingWindow ();
+
+ /* Get our connection number */
+ iConnectionNumber = ConnectionNumber (pDisplay);
+
+ /* Open a file descriptor for the windows message queue */
+ fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
+ if (fdMessageQueue == -1)
+ {
+ ErrorF ("winClipboardProc - Failed opening %s\n", WIN_MSG_QUEUE_FNAME);
+ pthread_exit (NULL);
+ }
+
+ /* Find max of our file descriptors */
+ iMaxDescriptor = max (fdMessageQueue, iConnectionNumber) + 1;
+
+ /* Select event types to watch */
+ if (XSelectInput (pDisplay,
+ DefaultRootWindow (pDisplay),
+ SubstructureNotifyMask |
+ StructureNotifyMask |
+ PropertyChangeMask) == BadWindow)
+ ErrorF ("winClipboardProc - XSelectInput generated BadWindow "
+ "on RootWindow\n\n");
+
+ /* Create a messaging window */
+ iWindow = XCreateSimpleWindow (pDisplay,
+ DefaultRootWindow (pDisplay),
+ 1, 1,
+ 500, 500,
+ 0,
+ BlackPixel (pDisplay, 0),
+ BlackPixel (pDisplay, 0));
+ if (iWindow == 0)
+ {
+ ErrorF ("winClipboardProc - Could not create a window\n");
+ pthread_exit (NULL);
+ }
+
+ /* This looks like our only hope for getting a message before shutdown */
+ /* Register for WM_DELETE_WINDOW message from window manager */
+ atomDeleteWindow = XInternAtom (pDisplay, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols (pDisplay, iWindow, &atomDeleteWindow, 1);
+
+ /* Set error handler */
+ XSetErrorHandler (winClipboardErrorHandler);
+ XSetIOErrorHandler (winClipboardIOErrorHandler);
+
+ /* Create an atom for CLIPBOARD_MANAGER */
+ atomClipboardManager = XInternAtom (pDisplay, "CLIPBOARD_MANAGER", False);
+ if (atomClipboardManager == None)
+ {
+ ErrorF ("winClipboardProc - Could not create CLIPBOARD_MANAGER atom\n");
+ pthread_exit (NULL);
+ }
+
+ /* Assert ownership of CLIPBOARD_MANAGER */
+ iReturn = XSetSelectionOwner (pDisplay, atomClipboardManager,
+ iWindow, CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ ErrorF ("winClipboardProc - Could not set CLIPBOARD_MANAGER owner\n");
+ pthread_exit (NULL);
+ }
+
+ /* Create an atom for CLIPBOARD */
+ atomClipboard = XInternAtom (pDisplay, "CLIPBOARD", False);
+ if (atomClipboard == None)
+ {
+ ErrorF ("winClipboardProc - Could not create CLIPBOARD atom\n");
+ pthread_exit (NULL);
+ }
+
+ /* Assert ownership of CLIPBOARD */
+ iReturn = XSetSelectionOwner (pDisplay, atomClipboard,
+ iWindow, CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ ErrorF ("winClipboardProc - Could not set CLIPBOARD owner\n");
+ pthread_exit (NULL);
+ }
+
+ /* Assert ownership of PRIMARY */
+ iReturn = XSetSelectionOwner (pDisplay, XA_PRIMARY,
+ iWindow, CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ ErrorF ("winClipboardProc - Could not set PRIMARY owner\n");
+ pthread_exit (NULL);
+ }
+
+ /* Local property to hold pasted data */
+ atomLocalProperty = XInternAtom (pDisplay, "CYGX_CUT_BUFFER", False);
+ if (atomLocalProperty == None)
+ {
+ ErrorF ("winClipboardProc - Could not create CYGX_CUT_BUFFER atom\n");
+ pthread_exit (NULL);
+ }
+
+ /* Create an atom for UTF8_STRING */
+ atomUTF8String = XInternAtom (pDisplay, "UTF8_STRING", False);
+ if (atomUTF8String == None)
+ {
+ ErrorF ("winClipboardProc - Could not create UTF8_STRING atom\n");
+ pthread_exit (NULL);
+ }
+
+ /* Create an atom for COMPOUND_TEXT */
+ atomCompoundText = XInternAtom (pDisplay, "COMPOUND_TEXT", False);
+ if (atomCompoundText == None)
+ {
+ ErrorF ("winClipboardProc - Could not create COMPOUND_TEXT atom\n");
+ pthread_exit (NULL);
+ }
+
+ /* Create an atom for TARGETS */
+ atomTargets = XInternAtom (pDisplay, "TARGETS", False);
+ if (atomTargets == None)
+ {
+ ErrorF ("winClipboardProc - Could not create TARGETS atom\n");
+ pthread_exit (NULL);
+ }
+
+ /* Pre-flush X events */
+ /*
+ * NOTE: Apparently you'll freeze if you don't do this,
+ * because there may be events in local data structures
+ * already.
+ */
+ winClipboardFlushXEvents (hwnd,
+ atomClipboard,
+ atomLocalProperty,
+ atomUTF8String,
+ atomCompoundText,
+ atomTargets,
+ atomDeleteWindow,
+ iWindow,
+ pDisplay,
+ fUnicodeSupport);
+
+ /* Pre-flush Windows messages */
+ if (!winClipboardFlushWindowsMessageQueue (hwnd))
+ return 0;
+
+ /* Loop for X events */
+ while (1)
+ {
+ /* Setup the file descriptor set */
+ /*
+ * NOTE: You have to do this before every call to select
+ * because select modifies the mask to indicate
+ * which descriptors are ready.
+ */
+ FD_ZERO (&fdsRead);
+ FD_SET (fdMessageQueue, &fdsRead);
+ FD_SET (iConnectionNumber, &fdsRead);
+
+ /* Wait for a Windows event or an X event */
+ iReturn = select (iMaxDescriptor, /* Highest fds number */
+ &fdsRead, /* Read mask */
+ NULL, /* No write mask */
+ NULL, /* No exception mask */
+ NULL); /* No timeout */
+ if (iReturn <= 0)
+ {
+ ErrorF ("winClipboardProc - Call to select () failed: %d. "
+ "Bailing.\n", iReturn);
+ break;
+ }
+
+ /* Branch on which descriptor became active */
+ if (FD_ISSET (iConnectionNumber, &fdsRead))
+ {
+ /* X event ready */
+#if 0
+ ErrorF ("winClipboardProc - X event ready\n");
+#endif
+
+ /* Process X events */
+ /* Exit when we see that server is shutting down */
+ fReturn = winClipboardFlushXEvents (hwnd,
+ atomClipboard,
+ atomLocalProperty,
+ atomUTF8String,
+ atomCompoundText,
+ atomTargets,
+ atomDeleteWindow,
+ iWindow,
+ pDisplay,
+ fUnicodeSupport);
+ if (!fReturn)
+ {
+ ErrorF ("winClipboardProc - Caught WM_DELETE_WINDOW - "
+ "shutting down\n");
+ break;
+ }
+ }
+
+ /* Check for Windows event ready */
+ if (FD_ISSET (fdMessageQueue, &fdsRead))
+ {
+ /* Windows event ready */
+#if 0
+ ErrorF ("winClipboardProc - Windows event ready\n");
+#endif
+
+ /* Process Windows messages */
+ if (!winClipboardFlushWindowsMessageQueue (hwnd))
+ break;
+ }
+ }
+
+ return 0;
+}
+
+
+/*
+ * winClipboardErrorHandler - Our application specific error handler
+ */
+
+static int
+winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr)
+{
+ char pszErrorMsg[100];
+
+ XGetErrorText (pDisplay,
+ pErr->error_code,
+ pszErrorMsg,
+ sizeof (pszErrorMsg));
+ ErrorF ("winClipboardErrorHandler - ERROR: \n\t%s\n", pszErrorMsg);
+
+ if (pErr->error_code==BadWindow
+ || pErr->error_code==BadMatch
+ || pErr->error_code==BadDrawable)
+ {
+ pthread_exit (NULL);
+ }
+
+ pthread_exit (NULL);
+
+ return 0;
+}
+
+
+/*
+ * winClipboardIOErrorHandler - Our application specific IO error handler
+ */
+
+static int
+winClipboardIOErrorHandler (Display *pDisplay)
+{
+ printf ("\nwinClipboardIOErrorHandler!\n\n");
+
+ /* Restart at the main entry point */
+ longjmp (g_jmpEntry, WIN_JMP_ERROR_IO);
+
+ return 0;
+}
diff --git a/hw/xwin/winclipboardunicode.c b/hw/xwin/winclipboardunicode.c
new file mode 100644
index 000000000..fdbcb8e69
--- /dev/null
+++ b/hw/xwin/winclipboardunicode.c
@@ -0,0 +1,68 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardunicode.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+
+/*
+ * Determine whether we suport Unicode or not.
+ * NOTE: Currently, just check if we are on an NT-based platform or not.
+ */
+
+Bool
+winClipboardDetectUnicodeSupport ()
+{
+ Bool fReturn = FALSE;
+ OSVERSIONINFO osvi;
+
+ /* Get operating system version information */
+ ZeroMemory (&osvi, sizeof (osvi));
+ osvi.dwOSVersionInfoSize = sizeof (osvi);
+ GetVersionEx (&osvi);
+
+ /* Branch on platform ID */
+ switch (osvi.dwPlatformId)
+ {
+ case VER_PLATFORM_WIN32_NT:
+ /* Engine 4 is supported on NT only */
+ ErrorF ("DetectUnicodeSupport - Windows NT/2000/XP\n");
+ fReturn = TRUE;
+ break;
+
+ case VER_PLATFORM_WIN32_WINDOWS:
+ /* Engine 4 is supported on NT only */
+ ErrorF ("DetectUnicodeSupport - Windows 95/98/Me\n");
+ fReturn = FALSE;
+ break;
+ }
+
+ return fReturn;
+}
diff --git a/hw/xwin/winclipboardwndproc.c b/hw/xwin/winclipboardwndproc.c
new file mode 100644
index 000000000..d27bb4861
--- /dev/null
+++ b/hw/xwin/winclipboardwndproc.c
@@ -0,0 +1,86 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardwndproc.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "winclipboard.h"
+
+
+/*
+ * Process a given Windows message
+ */
+
+LRESULT CALLBACK
+winClipboardWindowProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ /* Branch on message type */
+ switch (message)
+ {
+ case WM_DESTROY:
+ PostQuitMessage (0);
+ return 0;
+
+ case WM_CREATE:
+#if 0
+ ErrorF ("WindowProc - WM_CREATE\n");
+#endif
+ return 0;
+ }
+
+ /* Let Windows perform default processing for unhandled messages */
+ return DefWindowProc (hwnd, message, wParam, lParam);
+}
+
+
+/*
+ * Process any pending Windows messages
+ */
+
+BOOL
+winClipboardFlushWindowsMessageQueue (HWND hwnd)
+{
+ MSG msg;
+
+ /* Flush the messaging window queue */
+ /* NOTE: Do not pass the hwnd of our messaging window to PeekMessage,
+ * as this will filter out many non-window-specific messages that
+ * are sent to our thread, such as WM_QUIT.
+ */
+ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ /* Dispatch the message if not WM_QUIT */
+ if (msg.message == WM_QUIT)
+ return FALSE;
+ else
+ DispatchMessage (&msg);
+ }
+
+ return TRUE;
+}
diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
new file mode 100644
index 000000000..a09c7c185
--- /dev/null
+++ b/hw/xwin/winclipboardxevents.c
@@ -0,0 +1,722 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winclipboardxevents.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "winclipboard.h"
+
+
+/*
+ * Process any pending X events
+ */
+
+Bool
+winClipboardFlushXEvents (HWND hwnd,
+ Atom atomClipboard,
+ Atom atomLocalProperty,
+ Atom atomUTF8String,
+ Atom atomCompoundText,
+ Atom atomTargets,
+ Atom atomDeleteWindow,
+ int iWindow,
+ Display *pDisplay,
+ Bool fUnicodeSupport)
+{
+ Atom atomReturnType;
+ int iReturnFormat;
+ unsigned long ulReturnItems;
+ XTextProperty xtpText;
+ XEvent event;
+ XSelectionEvent eventSelection;
+ unsigned long ulReturnBytesLeft;
+ unsigned char *pszReturnData = NULL;
+ char *pszGlobalData = NULL;
+ int iReturn;
+ HGLOBAL hGlobal;
+ Bool fReturn = TRUE;
+ XICCEncodingStyle xiccesStyle;
+ int iUTF8;
+ char *pszUTF8 = NULL;
+ char *pszTextList[2];
+ int iCount;
+ char **ppszTextList = NULL;
+ wchar_t *pwszUnicodeStr = NULL;
+ int iUnicodeLen = 0;
+
+ /* Process all pending events */
+ while (XPending (pDisplay))
+ {
+ /* Get the next event - will not block because one is ready */
+ XNextEvent (pDisplay, &event);
+
+ /* Branch on the event type */
+ switch (event.type)
+ {
+ case ClientMessage:
+ if (event.xclient.data.l[0] == atomDeleteWindow)
+ {
+ ErrorF ("\nReceived WM_DELETE_WINDOW\n\n");
+ fReturn = FALSE;
+ }
+ else
+ ErrorF ("\nUnknown ClientMessage\n\n");
+ break;
+
+ case SelectionClear:
+ /* Request the lost selection contents */
+ iReturn = XConvertSelection (pDisplay,
+ event.xselectionclear.selection,
+ atomCompoundText,
+ atomLocalProperty,
+ iWindow,
+ CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ ErrorF ("SelectionClear - XConvertSelection () failed\n");
+ pthread_exit (NULL);
+ }
+ break;
+
+
+ /*
+ * SelectionRequest
+ */
+
+ case SelectionRequest:
+#if 0
+ char *pszAtomName = NULL
+
+ ErrorF ("SelectionRequest - target %d\n",
+ event.xselectionrequest.target);
+
+ pszAtomName = XGetAtomName (pDisplay,
+ event.xselectionrequest.target);
+ ErrorF ("SelectionRequest - Target atom name %s\n", pszAtomName);
+ XFree (pszAtomName);
+ pszAtomName = NULL;
+#endif
+
+ /* Abort if invalid target type */
+ if (event.xselectionrequest.target != XA_STRING
+ && event.xselectionrequest.target != atomUTF8String
+ && event.xselectionrequest.target != atomCompoundText
+ && event.xselectionrequest.target != atomTargets)
+ {
+ /* Setup selection notify event */
+ eventSelection.type = SelectionNotify;
+ eventSelection.send_event = True;
+ eventSelection.display = pDisplay;
+ eventSelection.requestor = event.xselectionrequest.requestor;
+ eventSelection.selection = event.xselectionrequest.selection;
+ eventSelection.target = event.xselectionrequest.target;
+ eventSelection.property = None;
+ eventSelection.time = event.xselectionrequest.time;
+
+ /* Notify the requesting window that the operation is complete */
+ iReturn = XSendEvent (pDisplay,
+ eventSelection.requestor,
+ False,
+ 0L,
+ (XEvent *) &eventSelection);
+ if (iReturn == BadValue || iReturn == BadWindow)
+ {
+ ErrorF ("SelectionRequest - XSendEvent () failed\n");
+ pthread_exit (NULL);
+ }
+
+ break;
+ }
+
+ /* Handle targets type of request */
+ if (event.xselectionrequest.target == atomTargets)
+ {
+ Atom atomTargetArr[4] = {atomTargets,
+ atomCompoundText,
+ atomUTF8String,
+ XA_STRING};
+
+ /* Try to change the property */
+ iReturn = XChangeProperty (pDisplay,
+ event.xselectionrequest.requestor,
+ event.xselectionrequest.property,
+ event.xselectionrequest.target,
+ 8,
+ PropModeReplace,
+ (char *) atomTargetArr,
+ sizeof (atomTargetArr));
+ if (iReturn == BadAlloc
+ || iReturn == BadAtom
+ || iReturn == BadMatch
+ || iReturn == BadValue
+ || iReturn == BadWindow)
+ {
+ ErrorF ("SelectionRequest - XChangeProperty failed: %d\n",
+ iReturn);
+ }
+
+ /* Setup selection notify xevent */
+ eventSelection.type = SelectionNotify;
+ eventSelection.send_event = True;
+ eventSelection.display = pDisplay;
+ eventSelection.requestor = event.xselectionrequest.requestor;
+ eventSelection.selection = event.xselectionrequest.selection;
+ eventSelection.target = event.xselectionrequest.target;
+ eventSelection.property = event.xselectionrequest.property;
+ eventSelection.time = event.xselectionrequest.time;
+
+ /*
+ * Notify the requesting window that
+ * the operation has completed
+ */
+ iReturn = XSendEvent (pDisplay,
+ eventSelection.requestor,
+ False,
+ 0L,
+ (XEvent *) &eventSelection);
+ if (iReturn == BadValue || iReturn == BadWindow)
+ {
+ ErrorF ("SelectionRequest - XSendEvent () failed\n");
+ }
+ break;
+ }
+
+ /* Access the clipboard */
+ if (!OpenClipboard (hwnd))
+ {
+ ErrorF ("SelectionRequest - OpenClipboard () failed: %08x\n",
+ GetLastError ());
+ pthread_exit (NULL);
+ }
+
+ /* Setup the string style */
+ if (event.xselectionrequest.target == XA_STRING)
+ xiccesStyle = XStringStyle;
+ else if (event.xselectionrequest.target == atomUTF8String)
+ xiccesStyle = XUTF8StringStyle;
+ else if (event.xselectionrequest.target == atomCompoundText)
+ xiccesStyle = XCompoundTextStyle;
+ else
+ xiccesStyle = XStringStyle;
+
+ /*
+ * FIXME: Can't pass CF_UNICODETEXT on Windows 95/98/Me
+ */
+
+ /* Get a pointer to the clipboard text */
+ if (fUnicodeSupport)
+ hGlobal = GetClipboardData (CF_UNICODETEXT);
+ else
+ hGlobal = GetClipboardData (CF_TEXT);
+ if (!hGlobal)
+ {
+ ErrorF ("SelectionRequest - GetClipboardData () failed: %08x\n",
+ GetLastError ());
+ pthread_exit (NULL);
+ }
+ pszGlobalData = (char *) GlobalLock (hGlobal);
+
+ /* Convert the Unicode string to UTF8 (MBCS) */
+ if (fUnicodeSupport)
+ {
+ iUTF8 = WideCharToMultiByte (CP_UTF8,
+ 0,
+ (LPCWSTR)pszGlobalData,
+ -1,
+ NULL,
+ 0,
+ NULL,
+ NULL);
+ pszUTF8 = (char *) malloc (iUTF8); /* Don't need +1 */
+ WideCharToMultiByte (CP_UTF8,
+ 0,
+ (LPCWSTR)pszGlobalData,
+ -1,
+ pszUTF8,
+ iUTF8,
+ NULL,
+ NULL);
+ }
+
+ /* Convert DOS string to UNIX string */
+ if (fUnicodeSupport)
+ {
+ winClipboardDOStoUNIX (pszUTF8, strlen (pszUTF8));
+
+ /* Setup our text list */
+ pszTextList[0] = pszUTF8;
+ pszTextList[1] = NULL;
+
+ /* Initialize the text property */
+ xtpText.value = NULL;
+
+ /* Create the text property from the text list */
+ iReturn = Xutf8TextListToTextProperty (pDisplay,
+ pszTextList,
+ 1,
+ xiccesStyle,
+ &xtpText);
+ if (iReturn == XNoMemory || iReturn == XLocaleNotSupported)
+ {
+ ErrorF ("SelectionRequest - Xutf8TextListToTextProperty "
+ "failed: %d\n",
+ iReturn);
+ exit(1);
+ }
+
+ /* Free the UTF8 string */
+ free (pszUTF8);
+ }
+ else
+ winClipboardDOStoUNIX (pszGlobalData, strlen (pszGlobalData));
+
+ /*
+ * FIXME: Pass pszGlobalData and strlen (pszGlobalData(
+ * on 1 byte, pass xtpText.value and xtpText.nitems
+ * on 2 byte.
+ */
+
+ /* Copy the clipboard text to the requesting window */
+ if (fUnicodeSupport)
+ iReturn = XChangeProperty (pDisplay,
+ event.xselectionrequest.requestor,
+ event.xselectionrequest.property,
+ event.xselectionrequest.target,
+ 8,
+ PropModeReplace,
+ xtpText.value,
+ xtpText.nitems);
+ else
+ iReturn = XChangeProperty (pDisplay,
+ event.xselectionrequest.requestor,
+ event.xselectionrequest.property,
+ event.xselectionrequest.target,
+ 8,
+ PropModeReplace,
+ pszGlobalData,
+ strlen (pszGlobalData));
+ if (iReturn == BadAlloc || iReturn == BadAtom
+ || iReturn == BadMatch || iReturn == BadValue
+ || iReturn == BadWindow)
+ {
+ ErrorF ("SelectionRequest - XChangeProperty failed: %d\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+
+ /* Release the clipboard data */
+ GlobalUnlock (hGlobal);
+ pszGlobalData = NULL;
+ CloseClipboard ();
+
+ /* FIXME: Don't clean up on 1 byte. */
+ if (fUnicodeSupport)
+ {
+ XFree (xtpText.value);
+ xtpText.value = NULL;
+ }
+
+ /* Setup selection notify event */
+ eventSelection.type = SelectionNotify;
+ eventSelection.send_event = True;
+ eventSelection.display = pDisplay;
+ eventSelection.requestor = event.xselectionrequest.requestor;
+ eventSelection.selection = event.xselectionrequest.selection;
+ eventSelection.target = event.xselectionrequest.target;
+ eventSelection.property = event.xselectionrequest.property;
+ eventSelection.time = event.xselectionrequest.time;
+
+ /* Notify the requesting window that the operation has completed */
+ iReturn = XSendEvent (pDisplay,
+ eventSelection.requestor,
+ False,
+ 0L,
+ (XEvent *) &eventSelection);
+ if (iReturn == BadValue || iReturn == BadWindow)
+ {
+ ErrorF ("SelectionRequest - XSendEvent () failed\n");
+ pthread_exit (NULL);
+ }
+ break;
+
+
+ /*
+ * SelectionNotify
+ */
+
+ case SelectionNotify:
+#if 0
+ ErrorF ("SelectionNotify\n");
+#endif
+ {
+ char *pszAtomName;
+
+ pszAtomName = XGetAtomName (pDisplay,
+ event.xselection.selection);
+
+ ErrorF ("SelectionNotify - ATOM: %s\n",
+ pszAtomName);
+
+ XFree (pszAtomName);
+ }
+
+#if 0
+ /*
+ * TEMP: Bail if selection is anything other than CLIPBOARD
+ */
+
+ if (event.xselection.selection != atomClipboard)
+ break;
+#endif
+
+ /*
+ *
+ * What are we doing here?
+ *
+ */
+ if (fUnicodeSupport)
+ {
+ if (event.xselection.property == None)
+ {
+ if(event.xselection.target == XA_STRING)
+ {
+#if 0
+ ErrorF ("SelectionNotify XA_STRING\n");
+#endif
+ return fReturn;
+ }
+ else if (event.xselection.target == atomUTF8String)
+ {
+ ErrorF ("SelectionNotify UTF8\n");
+ iReturn = XConvertSelection (pDisplay,
+ event.xselection.selection,
+ XA_STRING,
+ atomLocalProperty,
+ iWindow,
+ CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ ErrorF ("SelectionNotify - XConvertSelection () "
+ "failed\n");
+ pthread_exit (NULL);
+ }
+ return fReturn;
+ }
+ else if (event.xselection.target == atomCompoundText)
+ {
+ ErrorF ("SelectionNotify CompoundText\n");
+ iReturn = XConvertSelection (pDisplay,
+ event.xselection.selection,
+ atomUTF8String,
+ atomLocalProperty,
+ iWindow,
+ CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ ErrorF ("SelectionNotify - XConvertSelection () "
+ "failed\n");
+ pthread_exit (NULL);
+ }
+ return fReturn;
+ }
+ else
+ {
+ ErrorF("Unknown format\n");
+ return fReturn;
+ }
+ }
+ }
+
+ /* Retrieve the size of the stored data */
+ if (fUnicodeSupport)
+ iReturn = XGetWindowProperty (pDisplay,
+ iWindow,
+ atomLocalProperty,
+ 0,
+ 0, /* Don't get data, just size */
+ False,
+ AnyPropertyType,
+ &xtpText.encoding,
+ &xtpText.format,
+ &xtpText.nitems,
+ &ulReturnBytesLeft,
+ &xtpText.value);
+ else
+ iReturn = XGetWindowProperty (pDisplay,
+ iWindow,
+ atomLocalProperty,
+ 0,
+ 0, /* Don't get data, just size */
+ False,
+ AnyPropertyType,
+ &atomReturnType,
+ &iReturnFormat,
+ &ulReturnItems,
+ &ulReturnBytesLeft,
+ &pszReturnData);
+ if (iReturn != Success)
+ {
+ ErrorF ("SelectionNotify - XGetWindowProperty () failed\n");
+ pthread_exit (NULL);
+ }
+
+#if 0
+ if (fUnicodeSupport)
+ ErrorF ("SelectionNotify - returned data %d left %d\n",
+ xtpText.nitems, ulReturnBytesLeft);
+ else
+ ErrorF ("SelectionNotify - returned data %d left %d\n",
+ ulReturnItems, ulReturnBytesLeft);
+#endif
+
+ /* Request the selection data */
+ if (fUnicodeSupport)
+ iReturn = XGetWindowProperty (pDisplay,
+ iWindow,
+ atomLocalProperty,
+ 0,
+ ulReturnBytesLeft,
+ False,
+ AnyPropertyType,
+ &xtpText.encoding,
+ &xtpText.format,
+ &xtpText.nitems,
+ &ulReturnBytesLeft,
+ &xtpText.value);
+ else
+ iReturn = XGetWindowProperty (pDisplay,
+ iWindow,
+ atomLocalProperty,
+ 0,
+ ulReturnBytesLeft,
+ False,
+ AnyPropertyType,
+ &atomReturnType,
+ &iReturnFormat,
+ &ulReturnItems,
+ &ulReturnBytesLeft,
+ &pszReturnData);
+ if (iReturn != Success)
+ {
+ ErrorF ("SelectionNotify - XGetWindowProperty () failed\n");
+ pthread_exit (NULL);
+ }
+
+ if (fUnicodeSupport)
+ {
+#if 0
+ char *pszAtomName = NULL;
+
+ ErrorF ("SelectionNotify - returned data %d left %d\n",
+ prop.nitems, ulReturnBytesLeft);
+
+ pszAtomName = XGetAtomName(pDisplay, prop.encoding);
+ ErrorF ("Notify atom name %s\n", pszAtomName);
+ XFree (pszAtomName);
+ pszAtomName = NULL;
+#endif
+
+ /* Convert the text property to a text list */
+ Xutf8TextPropertyToTextList (pDisplay,
+ &xtpText,
+ &ppszTextList,
+ &iCount);
+ if (iCount > 0)
+ {
+ pszReturnData = malloc (strlen (ppszTextList[0]) + 1);
+ strcpy (pszReturnData, ppszTextList[0]);
+ }
+ else
+ {
+ pszReturnData = malloc (1);
+ pszReturnData[0] = 0;
+ }
+
+ /* Free the data returned from XGetWindowProperty */
+ XFreeStringList (ppszTextList);
+ XFree (xtpText.value);
+ }
+
+ /* Convert the X clipboard string to DOS format */
+ winClipboardUNIXtoDOS (&pszReturnData, strlen (pszReturnData));
+
+ if (fUnicodeSupport)
+ {
+ /* Find out how much space needed to convert MBCS to Unicode */
+ iUnicodeLen = MultiByteToWideChar (CP_UTF8,
+ 0,
+ pszReturnData,
+ -1,
+ NULL,
+ 0);
+
+ /* Allocate memory for the Unicode string */
+ pwszUnicodeStr
+ = (wchar_t*) malloc (sizeof (wchar_t) * (iUnicodeLen + 1));
+
+ /* Do the actual conversion */
+ MultiByteToWideChar (CP_UTF8,
+ 0,
+ pszReturnData,
+ -1,
+ pwszUnicodeStr,
+ iUnicodeLen);
+ }
+
+ /* Access the Windows clipboard */
+ if (!OpenClipboard (hwnd))
+ {
+ ErrorF ("OpenClipboard () failed: %08x\n", GetLastError ());
+ pthread_exit (NULL);
+ }
+
+ /* Take ownership of the Window clipboard */
+ if (!EmptyClipboard ())
+ {
+ ErrorF ("EmptyClipboard () failed: %08x\n", GetLastError ());
+ pthread_exit (NULL);
+ }
+
+ /* Allocate global memory for the X clipboard data */
+ if (fUnicodeSupport)
+ hGlobal = GlobalAlloc (GMEM_MOVEABLE,
+ sizeof (wchar_t) * (iUnicodeLen + 1));
+ else
+ hGlobal = GlobalAlloc (GMEM_MOVEABLE, strlen (pszReturnData) + 1);
+
+ /* Obtain a pointer to the global memory */
+ pszGlobalData = GlobalLock (hGlobal);
+ if (pszGlobalData == NULL)
+ {
+ ErrorF ("Could not lock global memory for clipboard transfer\n");
+ pthread_exit (NULL);
+ }
+
+ /* Copy the returned string into the global memory */
+ if (fUnicodeSupport)
+ memcpy (pszGlobalData,
+ pwszUnicodeStr,
+ sizeof (wchar_t) * (iUnicodeLen + 1));
+ else
+ strcpy (pszGlobalData, pszReturnData);
+
+ /* Free the data returned from XGetWindowProperty */
+ if (fUnicodeSupport)
+ {
+ free (pwszUnicodeStr);
+ pwszUnicodeStr = NULL;
+ }
+ else
+ {
+ XFree (pszReturnData);
+ pszReturnData = NULL;
+ }
+
+ /* Release the pointer to the global memory */
+ GlobalUnlock (hGlobal);
+ pszGlobalData = NULL;
+
+ /* Push the selection data to the Windows clipboard */
+ if (fUnicodeSupport)
+ SetClipboardData (CF_UNICODETEXT, hGlobal);
+ else
+ SetClipboardData (CF_TEXT, hGlobal);
+
+ /*
+ * NOTE: Do not try to free pszGlobalData, it is owned by
+ * Windows after the call to SetClipboardData ().
+ */
+
+ /* Release the clipboard */
+ if (!CloseClipboard ())
+ {
+ ErrorF ("CloseClipboard () failed: %08x\n", GetLastError ());
+ pthread_exit (NULL);
+ }
+
+ /* Reassert ownership of the selection */
+ iReturn = XSetSelectionOwner (pDisplay,
+ event.xselection.selection,
+ iWindow, CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ char *pszAtomName = NULL;
+
+ pszAtomName = XGetAtomName (pDisplay,
+ event.xselection.selection);
+ ErrorF ("SelectionNotify - Could not reassert ownership "
+ "of selection ATOM: %s\n", pszAtomName);
+ XFree (pszAtomName);
+ pszAtomName = NULL;
+ pthread_exit (NULL);
+ }
+ else
+ {
+#if 0
+ char *pszAtomName = NULL;
+
+ pszAtomName = XGetAtomName (pDisplay,
+ event.xselection.selection);
+ ErrorF ("SelectionNotify - Reasserted ownership of ATOM: %s\n",
+ pszAtomName);
+ XFree (pszAtomName);
+ pszAtomName = NULL;
+#endif
+ }
+#if 0
+ /* Reassert ownership of the CLIPBOARD */
+ iReturn = XSetSelectionOwner (pDisplay,
+ atomClipboard,
+ iWindow, CurrentTime);
+ if (iReturn == BadAtom || iReturn == BadWindow)
+ {
+ ErrorF ("Could not reassert ownership of selection\n");
+ pthread_exit (NULL);
+ }
+#endif
+ break;
+
+#if 0
+ case CreateNotify:
+ ErrorF ("FlushXEvents - CreateNotify parent: %ld\twindow: %ld\n",
+ event.xcreatewindow.parent, event.xcreatewindow.window);
+ break;
+
+ case DestroyNotify:
+ ErrorF ("FlushXEvents - DestroyNotify window: %ld\tevent: %ld\n",
+ event.xdestroywindow.window, event.xdestroywindow.event);
+ break;
+#endif
+
+ default:
+ break;
+ }
+ }
+
+ return fReturn;
+}
diff --git a/hw/xwin/wincmap.c b/hw/xwin/wincmap.c
new file mode 100644
index 000000000..4fb89a2fd
--- /dev/null
+++ b/hw/xwin/wincmap.c
@@ -0,0 +1,631 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wincmap.c,v 1.10 2002/10/17 08:18:22 alanh Exp $ */
+
+#include "win.h"
+
+
+/* See Porting Layer Definition - p. 30 */
+/*
+ * Walk the list of installed colormaps, filling the pmaps list
+ * with the resource ids of the installed maps, and return
+ * a count of the total number of installed maps.
+ */
+int
+winListInstalledColormaps (ScreenPtr pScreen, Colormap *pmaps)
+{
+ winScreenPriv(pScreen);
+
+ /*
+ * There will only be one installed colormap, so we only need
+ * to return one id, and the count of installed maps will always
+ * be one.
+ */
+ *pmaps = pScreenPriv->pcmapInstalled->mid;
+ return 1;
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+/* See Programming Windows - p. 663 */
+void
+winInstallColormap (ColormapPtr pColormap)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ ColormapPtr oldpmap = pScreenPriv->pcmapInstalled;
+
+#if CYGDEBUG
+ ErrorF ("winInstallColormap\n");
+#endif
+
+ /* Did the colormap actually change? */
+ if (pColormap != oldpmap)
+ {
+#if CYGDEBUG
+ ErrorF ("winInstallColormap - Colormap has changed, attempt "
+ "to install.\n");
+#endif
+
+ /* Was there a previous colormap? */
+ if (oldpmap != (ColormapPtr) None)
+ {
+ /* There was a previous colormap; tell clients it is gone */
+ WalkTree (pColormap->pScreen, TellLostMap, (char *)&oldpmap->mid);
+ }
+
+ /* Install new colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+ WalkTree (pColormap->pScreen, TellGainedMap, (char *)&pColormap->mid);
+
+ /* Call the engine specific colormap install procedure */
+ if (!((*pScreenPriv->pwinInstallColormap) (pColormap)))
+ {
+ ErrorF ("winInstallColormap - Screen specific colormap install "
+ "procedure failed. Continuing, but colors may be "
+ "messed up from now on.\n");
+ }
+ }
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+void
+winUninstallColormap (ColormapPtr pmap)
+{
+ winScreenPriv(pmap->pScreen);
+ ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
+
+#if CYGDEBUG
+ ErrorF ("winUninstallColormap\n");
+#endif
+
+ /* Is the colormap currently installed? */
+ if (pmap != curpmap)
+ {
+ /* Colormap not installed, nothing to do */
+ return;
+ }
+
+ /* Clear the installed colormap flag */
+ pScreenPriv->pcmapInstalled = NULL;
+
+ /*
+ * NOTE: The default colormap does not get "uninstalled" before
+ * it is destroyed.
+ */
+
+ /* Install the default cmap in place of the cmap to be uninstalled */
+ if (pmap->mid != pmap->pScreen->defColormap)
+ {
+ curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
+ RT_COLORMAP);
+ (*pmap->pScreen->InstallColormap) (curpmap);
+ }
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+void
+winStoreColors (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pmap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pmap);
+ int i;
+ unsigned short nRed, nGreen, nBlue;
+
+#if CYGDEBUG
+ if (ndef != 1)
+ ErrorF ("winStoreColors - ndef: %d\n",
+ ndef);
+#endif
+
+ /* Save the new colors in the colormap privates */
+ for (i = 0; i < ndef; ++i)
+ {
+ /* Adjust the colors from the X color spec to the Windows color spec */
+ nRed = pdefs[i].red >> 8;
+ nGreen = pdefs[i].green >> 8;
+ nBlue = pdefs[i].blue >> 8;
+
+ /* Copy the colors to a palette entry table */
+ pCmapPriv->peColors[pdefs[0].pixel + i].peRed = nRed;
+ pCmapPriv->peColors[pdefs[0].pixel + i].peGreen = nGreen;
+ pCmapPriv->peColors[pdefs[0].pixel + i].peBlue = nBlue;
+
+ /* Copy the colors to a RGBQUAD table */
+ pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbRed = nRed;
+ pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbGreen = nGreen;
+ pCmapPriv->rgbColors[pdefs[0].pixel + i].rgbBlue = nBlue;
+
+#if CYGDEBUG
+ ErrorF ("winStoreColors - nRed %d nGreen %d nBlue %d\n",
+ nRed, nGreen, nBlue);
+#endif
+ }
+
+ /* Call the engine specific store colors procedure */
+ if (!((pScreenPriv->pwinStoreColors) (pmap, ndef, pdefs)))
+ {
+ ErrorF ("winStoreColors - Engine cpecific color storage procedure "
+ "failed. Continuing, but colors may be messed up from now "
+ "on.\n");
+ }
+}
+
+
+/* See Porting Layer Definition - p. 30 */
+void
+winResolveColor (unsigned short *pred,
+ unsigned short *pgreen,
+ unsigned short *pblue,
+ VisualPtr pVisual)
+{
+#if CYGDEBUG
+ ErrorF ("winResolveColor ()\n");
+#endif
+
+ miResolveColor (pred, pgreen, pblue, pVisual);
+}
+
+
+/* See Porting Layer Definition - p. 29 */
+Bool
+winCreateColormap (ColormapPtr pmap)
+{
+ winPrivCmapPtr pCmapPriv = NULL;
+ ScreenPtr pScreen = pmap->pScreen;
+ winScreenPriv(pScreen);
+
+#if CYGDEBUG
+ ErrorF ("winCreateColormap\n");
+#endif
+
+ /* Allocate colormap privates */
+ if (!winAllocateCmapPrivates (pmap))
+ {
+ ErrorF ("winCreateColorma - Couldn't allocate cmap privates\n");
+ return FALSE;
+ }
+
+ /* Get a pointer to the newly allocated privates */
+ pCmapPriv = winGetCmapPriv (pmap);
+
+ /*
+ * FIXME: This is some evil hackery to help in handling some X clients
+ * that expect the top pixel to be white. This "help" only lasts until
+ * some client overwrites the top colormap entry.
+ *
+ * We don't want to actually allocate the top entry, as that causes
+ * problems with X clients that need 7 planes (128 colors) in the default
+ * colormap, such as Magic 7.1.
+ */
+ pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbRed = 255;
+ pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbGreen = 255;
+ pCmapPriv->rgbColors[WIN_NUM_PALETTE_ENTRIES - 1].rgbBlue = 255;
+ pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peRed = 255;
+ pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peGreen = 255;
+ pCmapPriv->peColors[WIN_NUM_PALETTE_ENTRIES - 1].peBlue = 255;
+
+ /* Call the engine specific colormap initialization procedure */
+ if (!((*pScreenPriv->pwinCreateColormap) (pmap)))
+ {
+ ErrorF ("winCreateColormap - Engine specific colormap creation "
+ "procedure failed. Aborting.\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 29, 30 */
+void
+winDestroyColormap (ColormapPtr pColormap)
+{
+ winScreenPriv(pColormap->pScreen);
+ winCmapPriv(pColormap);
+
+ /* Call the engine specific colormap destruction procedure */
+ if (!((*pScreenPriv->pwinDestroyColormap) (pColormap)))
+ {
+ ErrorF ("winDestroyColormap - Engine specific colormap destruction "
+ "procedure failed. Continuing, but it is possible that memory "
+ "was leaked, or that colors will be messed up from now on.\n");
+ }
+
+ /* Free the colormap privates */
+ free (pCmapPriv);
+ winSetCmapPriv (pColormap, NULL);
+
+#if CYGDEBUG
+ ErrorF ("winDestroyColormap - Returning\n");
+#endif
+}
+
+
+int
+winExpandDirectColors (ColormapPtr pmap, int ndef,
+ xColorItem *indefs, xColorItem *outdefs)
+{
+ ErrorF ("\nwinExpandDirectColors\n");
+ return miExpandDirectColors (pmap, ndef, indefs, outdefs);
+}
+
+
+/*
+ * Internal function to load the palette used by the Shadow DIB
+ */
+
+static
+Bool
+winGetPaletteDIB (ScreenPtr pScreen, ColormapPtr pcmap)
+{
+ winScreenPriv(pScreen);
+ int i;
+ Pixel pixel; /* Pixel == CARD32 */
+ CARD16 nRed, nGreen, nBlue; /* CARD16 == unsigned short */
+ UINT uiColorsRetrieved = 0;
+ RGBQUAD rgbColors[WIN_NUM_PALETTE_ENTRIES];
+
+ /* Get the color table for the screen */
+ uiColorsRetrieved = GetDIBColorTable (pScreenPriv->hdcScreen,
+ 0,
+ WIN_NUM_PALETTE_ENTRIES,
+ rgbColors);
+ if (uiColorsRetrieved == 0)
+ {
+ ErrorF ("winGetPaletteDIB - Could not retrieve screen color table\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winGetPaletteDIB - Retrieved %d colors from DIB\n",
+ uiColorsRetrieved);
+#endif
+
+ /* Set the DIB color table to the default screen palette */
+ if (SetDIBColorTable (pScreenPriv->hdcShadow,
+ 0,
+ uiColorsRetrieved,
+ rgbColors) == 0)
+ {
+ ErrorF ("winGetPaletteDIB - SetDIBColorTable () failed\n");
+ return FALSE;
+ }
+
+ /* Alloc each color in the DIB color table */
+ for (i = 0; i < uiColorsRetrieved; ++i)
+ {
+ pixel = i;
+
+ /* Extract the color values for current palette entry */
+ nRed = rgbColors[i].rgbRed << 8;
+ nGreen = rgbColors[i].rgbGreen << 8;
+ nBlue = rgbColors[i].rgbBlue << 8;
+
+#if CYGDEBUG
+ ErrorF ("winGetPaletteDIB - Allocating a color: %d; "
+ "%d %d %d\n",
+ pixel, nRed, nGreen, nBlue);
+#endif
+
+ /* Allocate a entry in the X colormap */
+ if (AllocColor (pcmap,
+ &nRed,
+ &nGreen,
+ &nBlue,
+ &pixel,
+ 0) != Success)
+ {
+ ErrorF ("winGetPaletteDIB - AllocColor () failed, pixel %d\n",
+ i);
+ return FALSE;
+ }
+
+ if (i != pixel
+ || nRed != rgbColors[i].rgbRed
+ || nGreen != rgbColors[i].rgbGreen
+ || nBlue != rgbColors[i].rgbBlue)
+ {
+ ErrorF ("winGetPaletteDIB - Got: %d; "
+ "%d %d %d\n",
+ pixel, nRed, nGreen, nBlue);
+ }
+
+ /* FIXME: Not sure that this bit is needed at all */
+ pcmap->red[i].co.local.red = nRed;
+ pcmap->red[i].co.local.green = nGreen;
+ pcmap->red[i].co.local.blue = nBlue;
+ }
+
+ /* System is using a colormap */
+ /* Set the black and white pixel indices */
+ pScreen->whitePixel = uiColorsRetrieved - 1;
+ pScreen->blackPixel = 0;
+
+ return TRUE;
+}
+
+
+/*
+ * Internal function to load the standard system palette being used by GDI
+ */
+
+static
+Bool
+winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap)
+{
+ int i;
+ Pixel pixel; /* Pixel == CARD32 */
+ CARD16 nRed, nGreen, nBlue; /* CARD16 == unsigned short */
+ UINT uiSystemPaletteEntries;
+ LPPALETTEENTRY ppeColors = NULL;
+ HDC hdc = NULL;
+
+ /* Get a DC to obtain the default palette */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winGetPaletteDD - Couldn't get a DC\n");
+ return FALSE;
+ }
+
+ /* Get the number of entries in the system palette */
+ uiSystemPaletteEntries = GetSystemPaletteEntries (hdc,
+ 0, 0, NULL);
+ if (uiSystemPaletteEntries == 0)
+ {
+ ErrorF ("winGetPaletteDD - Unable to determine number of "
+ "system palette entries\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winGetPaletteDD - uiSystemPaletteEntries %d\n",
+ uiSystemPaletteEntries);
+#endif
+
+ /* Allocate palette entries structure */
+ ppeColors = malloc (uiSystemPaletteEntries * sizeof (PALETTEENTRY));
+ if (ppeColors == NULL)
+ {
+ ErrorF ("winGetPaletteDD - malloc () for colormap failed\n");
+ return FALSE;
+ }
+
+ /* Get system palette entries */
+ GetSystemPaletteEntries (hdc,
+ 0, uiSystemPaletteEntries, ppeColors);
+
+ /* Allocate an X colormap entry for every system palette entry */
+ for (i = 0; i < uiSystemPaletteEntries; ++i)
+ {
+ pixel = i;
+
+ /* Extract the color values for current palette entry */
+ nRed = ppeColors[i].peRed << 8;
+ nGreen = ppeColors[i].peGreen << 8;
+ nBlue = ppeColors[i].peBlue << 8;
+#if CYGDEBUG
+ ErrorF ("winGetPaletteDD - Allocating a color: %d; "
+ "%d %d %d\n",
+ pixel, nRed, nGreen, nBlue);
+#endif
+ if (AllocColor (pcmap,
+ &nRed,
+ &nGreen,
+ &nBlue,
+ &pixel,
+ 0) != Success)
+ {
+ ErrorF ("winGetPaletteDD - AllocColor () failed, pixel %d\n",
+ i);
+ free (ppeColors);
+ ppeColors = NULL;
+ return FALSE;
+ }
+
+ pcmap->red[i].co.local.red = nRed;
+ pcmap->red[i].co.local.green = nGreen;
+ pcmap->red[i].co.local.blue = nBlue;
+ }
+
+ /* System is using a colormap */
+ /* Set the black and white pixel indices */
+ pScreen->whitePixel = uiSystemPaletteEntries - 1;
+ pScreen->blackPixel = 0;
+
+ /* Free colormap */
+ if (ppeColors != NULL)
+ {
+ free (ppeColors);
+ ppeColors = NULL;
+ }
+
+ /* Free the DC */
+ if (hdc != NULL)
+ {
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Install the standard fb colormap, or the GDI colormap,
+ * depending on the current screen depth.
+ */
+
+Bool
+winCreateDefColormap (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ unsigned short zero = 0, ones = 0xFFFF;
+ VisualPtr pVisual = pScreenPriv->pRootVisual;
+ ColormapPtr pcmap = NULL;
+ Pixel wp, bp;
+
+#if CYGDEBUG
+ ErrorF ("winCreateDefColormap\n");
+#endif
+
+ /* Use standard fb colormaps for non palettized color modes */
+ if (pScreenInfo->dwBPP > 8)
+ {
+ ErrorF ("winCreateDefColormap - Deferring to " \
+ "fbCreateDefColormap ()\n");
+ return fbCreateDefColormap (pScreen);
+ }
+
+ /*
+ * AllocAll for non-Dynamic visual classes,
+ * AllocNone for Dynamic visual classes.
+ */
+
+ /*
+ * Dynamic visual classes allow the colors of the color map
+ * to be changed by clients.
+ */
+
+#if CYGDEBUG
+ ErrorF ("winCreateDefColormap - defColormap: %d\n",
+ pScreen->defColormap);
+#endif
+
+ /* Allocate an X colormap, owned by client 0 */
+ if (CreateColormap (pScreen->defColormap,
+ pScreen,
+ pVisual,
+ &pcmap,
+ (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
+ 0) != Success)
+ {
+ ErrorF ("winCreateDefColormap - CreateColormap failed\n");
+ return FALSE;
+ }
+ if (pcmap == NULL)
+ {
+ ErrorF ("winCreateDefColormap - Colormap could not be created\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winCreateDefColormap - Created a colormap\n");
+#endif
+
+ /* Branch on the visual class */
+ if (!(pVisual->class & DynamicClass))
+ {
+ /* Branch on engine type */
+ if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI)
+ {
+ /* Load the colors being used by the Shadow DIB */
+ if (!winGetPaletteDIB (pScreen, pcmap))
+ {
+ ErrorF ("winCreateDefColormap - Couldn't get DIB colors\n");
+ return FALSE;
+ }
+ }
+ else
+ {
+ /* Load the colors from the default system palette */
+ if (!winGetPaletteDD (pScreen, pcmap))
+ {
+ ErrorF ("winCreateDefColormap - Couldn't get colors "
+ "for DD\n");
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ wp = pScreen->whitePixel;
+ bp = pScreen->blackPixel;
+
+ /* Allocate a black and white pixel */
+ if ((AllocColor (pcmap, &ones, &ones, &ones, &wp, 0) !=
+ Success)
+ ||
+ (AllocColor (pcmap, &zero, &zero, &zero, &bp, 0) !=
+ Success))
+ {
+ ErrorF ("winCreateDefColormap - Couldn't allocate bp or wp\n");
+ return FALSE;
+ }
+
+ pScreen->whitePixel = wp;
+ pScreen->blackPixel = bp;
+
+#if 0
+ /* Have to reserve first 10 and last ten pixels in DirectDraw windowed */
+ if (pScreenInfo->dwEngine != WIN_SERVER_SHADOW_GDI)
+ {
+ int k;
+ Pixel p;
+
+ for (k = 1; k < 10; ++k)
+ {
+ p = k;
+ if (AllocColor (pcmap, &ones, &ones, &ones, &p, 0) != Success)
+ FatalError ("Foo!\n");
+ }
+
+ for (k = 245; k < 255; ++k)
+ {
+ p = k;
+ if (AllocColor (pcmap, &zero, &zero, &zero, &p, 0) != Success)
+ FatalError ("Baz!\n");
+ }
+ }
+#endif
+ }
+
+ /* Install the created colormap */
+ (*pScreen->InstallColormap)(pcmap);
+
+#if CYGDEBUG
+ ErrorF ("winCreateDefColormap - Returning\n");
+#endif
+
+ return TRUE;
+}
diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c
new file mode 100644
index 000000000..bc336527c
--- /dev/null
+++ b/hw/xwin/winconfig.c
@@ -0,0 +1,949 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Alexander Gottwald
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winconfig.c,v 1.1 2002/10/17 08:18:22 alanh Exp $ */
+
+#include "win.h"
+#include "winconfig.h"
+#include "winmsg.h"
+#include "globals.h"
+
+#ifdef XKB
+#define XKB_IN_SERVER
+#include "XKBsrv.h"
+#endif
+
+#ifndef CONFIGPATH
+#define CONFIGPATH "%A," "%R," \
+ "/etc/X11/%R," "%P/etc/X11/%R," \
+ "%E," "%F," \
+ "/etc/X11/%F," "%P/etc/X11/%F," \
+ "%D/%X," \
+ "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \
+ "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \
+ "%P/etc/X11/%X," \
+ "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \
+ "%P/lib/X11/%X"
+#endif
+
+XF86ConfigPtr g_xf86configptr = NULL;
+WinCmdlineRec g_cmdline = {
+ NULL, /* configFile */
+ NULL, /* fontPath */
+ NULL, /* rgbPath */
+ NULL, /* keyboard */
+#ifdef XKB
+ FALSE, /* noXkbExtension */
+ NULL, /* xkbMap */
+#endif
+ NULL, /* screenname */
+ NULL, /* mousename */
+ FALSE, /* emulate3Buttons */
+ 0 /* emulate3Timeout */
+};
+
+winInfoRec g_winInfo = {
+ { /* keyboard */
+ 0, /* leds */
+ 500, /* delay */
+ 30 /* rate */
+#ifdef XKB
+ }
+ ,
+ { /* xkb */
+ FALSE, /* disable */
+ NULL, /* rules */
+ NULL, /* model */
+ NULL, /* layout */
+ NULL, /* variant */
+ NULL, /* options */
+ NULL, /* initialMap */
+ NULL, /* keymap */
+ NULL, /* types */
+ NULL, /* compat */
+ NULL, /* keycodes */
+ NULL, /* symbols */
+ NULL /* geometry */
+#endif
+ }
+ ,
+ {
+ FALSE,
+ 50}
+};
+
+serverLayoutRec g_winConfigLayout;
+
+static Bool ParseOptionValue (int scrnIndex, pointer options,
+ OptionInfoPtr p);
+static Bool configLayout (serverLayoutPtr, XF86ConfLayoutPtr, char *);
+static Bool configImpliedLayout (serverLayoutPtr, XF86ConfScreenPtr);
+static Bool GetBoolValue (OptionInfoPtr p, const char *s);
+
+#define NULL_IF_EMPTY(x) (winNameCompare(x,"")?x:NULL)
+
+
+Bool
+winReadConfigfile ()
+{
+ Bool retval = TRUE;
+ const char *filename;
+
+ MessageType from = X_DEFAULT;
+ char *xf86ConfigFile = NULL;
+
+ if (g_cmdline.configFile)
+ {
+ from = X_CMDLINE;
+ xf86ConfigFile = g_cmdline.configFile;
+ }
+
+ /* Parse config file into data structure */
+
+ filename = xf86openConfigFile (CONFIGPATH, xf86ConfigFile, PROJECTROOT);
+ if (filename)
+ {
+ winMsg (from, "Using config file: \"%s\"\n", filename);
+ }
+ else
+ {
+ winMsg (X_ERROR, "Unable to locate/open config file");
+ if (xf86ConfigFile)
+ ErrorF (": \"%s\"", xf86ConfigFile);
+ ErrorF ("\n");
+ return FALSE;
+ }
+ if ((g_xf86configptr = xf86readConfigFile ()) == NULL)
+ {
+ winMsg (X_ERROR, "Problem parsing the config file\n");
+ return FALSE;
+ }
+ xf86closeConfigFile ();
+
+ winMsg (X_NONE, "Markers: ");
+ winMsg (X_PROBED, "probed, ");
+ winMsg (X_CONFIG, "from config file, ");
+ winMsg (X_DEFAULT, "default setting,\n ");
+ winMsg (X_CMDLINE, "from command line, ");
+ winMsg (X_NOTICE, "notice, ");
+ winMsg (X_INFO, "informational,\n ");
+ winMsg (X_WARNING, "warning, ");
+ winMsg (X_ERROR, "error, ");
+ winMsg (X_UNKNOWN, "unknown.\n");
+
+ /* set options from data structure */
+
+ if (g_xf86configptr->conf_layout_lst == NULL || g_cmdline.screenname != NULL)
+ {
+ if (g_cmdline.screenname == NULL)
+ {
+ winMsg (X_WARNING,
+ "No Layout section. Using the first Screen section.\n");
+ }
+ if (!configImpliedLayout (&g_winConfigLayout,
+ g_xf86configptr->conf_screen_lst))
+ {
+ winMsg (X_ERROR, "Unable to determine the screen layout\n");
+ return FALSE;
+ }
+ }
+ else
+ {
+ /* Check if layout is given in the config file */
+ if (g_xf86configptr->conf_flags != NULL)
+ {
+ char *dfltlayout = NULL;
+ pointer optlist = g_xf86configptr->conf_flags->flg_option_lst;
+
+ if (optlist && winFindOption (optlist, "defaultserverlayout"))
+ dfltlayout =
+ winSetStrOption (optlist, "defaultserverlayout", NULL);
+
+ if (!configLayout (&g_winConfigLayout,
+ g_xf86configptr->conf_layout_lst,
+ dfltlayout))
+ {
+ winMsg (X_ERROR, "Unable to determine the screen layout\n");
+ return FALSE;
+ }
+ }
+ else
+ {
+ if (!configLayout (&g_winConfigLayout,
+ g_xf86configptr->conf_layout_lst,
+ NULL))
+ {
+ winMsg (X_ERROR, "Unable to determin the screen layout\n");
+ return FALSE;
+ }
+ }
+ }
+
+ /* setup special config files */
+ winConfigFiles ();
+ return retval;
+}
+
+
+/* Set the keyboard configuration */
+
+Bool
+winConfigKeyboard (DeviceIntPtr pDevice)
+{
+ XF86ConfInputPtr kbd = NULL;
+ XF86ConfInputPtr input_list = NULL;
+ MessageType from = X_DEFAULT;
+ MessageType kbdfrom = X_CONFIG;
+
+ /* Setup defaults */
+#ifdef XKB
+ g_winInfo.xkb.disable = FALSE;
+# ifdef PC98 /* japanese */ /* not implemented */
+ g_winInfo.xkb.rules = "xfree98";
+ g_winInfo.xkb.model = "pc98";
+ g_winInfo.xkb.layout = "nex/jp";
+ g_winInfo.xkb.variant = NULL;
+ g_winInfo.xkb.options = NULL;
+# else
+ g_winInfo.xkb.rules = "xfree86";
+ g_winInfo.xkb.model = "pc101";
+ g_winInfo.xkb.layout = "us";
+ g_winInfo.xkb.variant = NULL;
+ g_winInfo.xkb.options = NULL;
+# endif /* PC98 */
+ g_winInfo.xkb.initialMap = NULL;
+ g_winInfo.xkb.keymap = NULL;
+ g_winInfo.xkb.types = NULL;
+ g_winInfo.xkb.compat = NULL;
+ g_winInfo.xkb.keycodes = NULL;
+ g_winInfo.xkb.symbols = NULL;
+ g_winInfo.xkb.geometry = NULL;
+#endif /* XKB */
+
+ /* parse the configuration */
+
+ if (g_cmdline.keyboard)
+ kbdfrom = X_CMDLINE;
+
+ /*
+ * Until the layout code is finished, I search for the keyboard
+ * device and configure the server with it.
+ */
+
+ if (g_xf86configptr != NULL)
+ input_list = g_xf86configptr->conf_input_lst;
+
+ while (input_list != NULL)
+ {
+ if (winNameCompare (input_list->inp_driver, "keyboard") == 0)
+ {
+ /* Check if device name matches requested name */
+ if (g_cmdline.keyboard && winNameCompare (input_list->inp_identifier,
+ g_cmdline.keyboard))
+ continue;
+ kbd = input_list;
+ }
+ input_list = input_list->list.next;
+ }
+
+ if (kbd != NULL)
+ {
+ if (kbd->inp_identifier)
+ winMsg (kbdfrom, "Using keyboard \"%s\" as primary keyboard\n",
+ kbd->inp_identifier);
+
+#ifdef XKB
+ from = X_DEFAULT;
+ if (g_cmdline.noXkbExtension)
+ {
+ from = X_CMDLINE;
+ g_winInfo.xkb.disable = TRUE;
+ }
+ else if (kbd->inp_option_lst)
+ {
+ int b = winSetBoolOption (kbd->inp_option_lst, "XkbDisable", FALSE);
+ if (b)
+ {
+ from = X_CONFIG;
+ g_winInfo.xkb.disable = TRUE;
+ }
+ }
+ if (g_winInfo.xkb.disable)
+ {
+ winMsg (from, "XkbExtension disabled\n");
+ }
+ else
+ {
+ char *s;
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbRules", NULL)))
+ {
+ g_winInfo.xkb.rules = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: rules: \"%s\"\n", s);
+ }
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbModel", NULL)))
+ {
+ g_winInfo.xkb.model = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: model: \"%s\"\n", s);
+ }
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbLayout", NULL)))
+ {
+ g_winInfo.xkb.layout = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: layout: \"%s\"\n", s);
+ }
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbVariant", NULL)))
+ {
+ g_winInfo.xkb.variant = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: variant: \"%s\"\n", s);
+ }
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbOptions", NULL)))
+ {
+ g_winInfo.xkb.options = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: options: \"%s\"\n", s);
+ }
+
+ from = X_CMDLINE;
+ if (!XkbInitialMap)
+ {
+ s =
+ winSetStrOption (kbd->inp_option_lst, "XkbInitialMap", NULL);
+ if (s)
+ {
+ XkbInitialMap = NULL_IF_EMPTY (s);
+ from = X_CONFIG;
+ }
+ }
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbKeymap", NULL)))
+ {
+ g_winInfo.xkb.keymap = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: keymap: \"%s\" "
+ " (overrides other XKB settings)\n", s);
+ }
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbCompat", NULL)))
+ {
+ g_winInfo.xkb.compat = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: compat: \"%s\"\n", s);
+ }
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbTypes", NULL)))
+ {
+ g_winInfo.xkb.types = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: types: \"%s\"\n", s);
+ }
+
+ if (
+ (s =
+ winSetStrOption (kbd->inp_option_lst, "XkbKeycodes", NULL)))
+ {
+ g_winInfo.xkb.keycodes = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: keycodes: \"%s\"\n", s);
+ }
+
+ if (
+ (s =
+ winSetStrOption (kbd->inp_option_lst, "XkbGeometry", NULL)))
+ {
+ g_winInfo.xkb.geometry = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: geometry: \"%s\"\n", s);
+ }
+
+ if ((s = winSetStrOption (kbd->inp_option_lst, "XkbSymbols", NULL)))
+ {
+ g_winInfo.xkb.symbols = NULL_IF_EMPTY (s);
+ winMsg (X_CONFIG, "XKB: symbols: \"%s\"\n", s);
+ }
+ }
+#endif
+ }
+ else
+ {
+ winMsg (X_ERROR, "No primary keyboard configured\n");
+ winMsg (X_DEFAULT, "Using compiletime defaults for keyboard\n");
+ }
+
+ return TRUE;
+}
+
+
+Bool
+winConfigMouse (DeviceIntPtr pDevice)
+{
+ MessageType mousefrom = X_CONFIG;
+ XF86ConfInputPtr mouse = NULL;
+ XF86ConfInputPtr input_list = NULL;
+
+ if (g_cmdline.mouse)
+ mousefrom = X_CMDLINE;
+
+ if (g_xf86configptr != NULL)
+ input_list = g_xf86configptr->conf_input_lst;
+
+ while (input_list != NULL)
+ {
+ if (winNameCompare (input_list->inp_driver, "mouse") == 0)
+ {
+ /* Check if device name matches requested name */
+ if (g_cmdline.mouse && winNameCompare (input_list->inp_identifier,
+ g_cmdline.mouse))
+ continue;
+ mouse = input_list;
+ }
+ input_list = input_list->list.next;
+ }
+
+ if (mouse != NULL)
+ {
+ if (mouse->inp_identifier)
+ winMsg (mousefrom, "Using pointer \"%s\" as primary pointer\n",
+ mouse->inp_identifier);
+
+ g_winInfo.pointer.emulate3Buttons =
+ winSetBoolOption (mouse->inp_option_lst, "Emulate3Buttons", FALSE);
+ if (g_cmdline.emulate3buttons)
+ g_winInfo.pointer.emulate3Buttons = g_cmdline.emulate3buttons;
+
+ g_winInfo.pointer.emulate3Timeout =
+ winSetIntOption (mouse->inp_option_lst, "Emulate3Timeout", 50);
+ if (g_cmdline.emulate3timeout)
+ g_winInfo.pointer.emulate3Timeout = g_cmdline.emulate3timeout;
+ }
+ else
+ {
+ winMsg (X_ERROR, "No primary pointer configured\n");
+ winMsg (X_DEFAULT, "Using compiletime defaults for pointer\n");
+ }
+
+ return TRUE;
+}
+
+
+Bool
+winConfigFiles ()
+{
+ MessageType from;
+ XF86ConfFilesPtr filesptr = NULL;
+
+ /* set some shortcuts */
+ if (g_xf86configptr != NULL)
+ {
+ filesptr = g_xf86configptr->conf_files;
+ }
+
+
+ /* Fontpath */
+ from = X_DEFAULT;
+
+ if (g_cmdline.fontPath)
+ {
+ from = X_CMDLINE;
+ defaultFontPath = g_cmdline.fontPath;
+ }
+ else if (filesptr != NULL && filesptr->file_fontpath)
+ {
+ from = X_CONFIG;
+ defaultFontPath = xstrdup (filesptr->file_fontpath);
+ }
+ winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath);
+
+ /* RGBPath */
+ from = X_DEFAULT;
+ if (g_cmdline.rgbPath)
+ {
+ from = X_CMDLINE;
+ rgbPath = g_cmdline.rgbPath;
+ }
+ else if (filesptr != NULL && filesptr->file_rgbpath)
+ {
+ from = X_CONFIG;
+ rgbPath = xstrdup (filesptr->file_rgbpath);
+ }
+ winMsg (from, "RgbPath set to \"%s\"\n", rgbPath);
+
+ return TRUE;
+}
+
+
+Bool
+winConfigOptions ()
+{
+ return TRUE;
+}
+
+
+Bool
+winConfigScreens ()
+{
+ return TRUE;
+}
+
+
+char *
+winSetStrOption (pointer optlist, const char *name, char *deflt)
+{
+ OptionInfoRec o;
+
+ o.name = name;
+ o.type = OPTV_STRING;
+ if (ParseOptionValue (-1, optlist, &o))
+ deflt = o.value.str;
+ if (deflt)
+ return xstrdup (deflt);
+ else
+ return NULL;
+}
+
+
+int
+winSetBoolOption (pointer optlist, const char *name, int deflt)
+{
+ OptionInfoRec o;
+
+ o.name = name;
+ o.type = OPTV_BOOLEAN;
+ if (ParseOptionValue (-1, optlist, &o))
+ deflt = o.value.bool;
+ return deflt;
+}
+
+
+int
+winSetIntOption (pointer optlist, const char *name, int deflt)
+{
+ OptionInfoRec o;
+
+ o.name = name;
+ o.type = OPTV_INTEGER;
+ if (ParseOptionValue (-1, optlist, &o))
+ deflt = o.value.num;
+ return deflt;
+}
+
+
+double
+winSetRealOption (pointer optlist, const char *name, double deflt)
+{
+ OptionInfoRec o;
+
+ o.name = name;
+ o.type = OPTV_REAL;
+ if (ParseOptionValue (-1, optlist, &o))
+ deflt = o.value.realnum;
+ return deflt;
+}
+
+
+/*
+ * Compare two strings for equality. This is caseinsensitive and
+ * The characters '_', ' ' (space) and '\t' (tab) are treated as
+ * not existing.
+ */
+
+int
+winNameCompare (const char *s1, const char *s2)
+{
+ char c1, c2;
+
+ if (!s1 || *s1 == 0)
+ {
+ if (!s2 || *s2 == 0)
+ return 0;
+ else
+ return 1;
+ }
+
+ while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
+ s1++;
+ while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
+ s2++;
+
+ c1 = (isupper (*s1) ? tolower (*s1) : *s1);
+ c2 = (isupper (*s2) ? tolower (*s2) : *s2);
+
+ while (c1 == c2)
+ {
+ if (c1 == 0)
+ return 0;
+ s1++;
+ s2++;
+
+ while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
+ s1++;
+ while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
+ s2++;
+
+ c1 = (isupper (*s1) ? tolower (*s1) : *s1);
+ c2 = (isupper (*s2) ? tolower (*s2) : *s2);
+ }
+ return (c1 - c2);
+}
+
+
+/*
+ * Find the named option in the list.
+ * @return the pointer to the option record, or NULL if not found.
+ */
+
+XF86OptionPtr
+winFindOption (XF86OptionPtr list, const char *name)
+{
+ while (list)
+ {
+ if (winNameCompare (list->opt_name, name) == 0)
+ return list;
+ list = list->list.next;
+ }
+ return NULL;
+}
+
+
+/*
+ * Find the Value of an named option.
+ * @return The option value or NULL if not found.
+ */
+
+char *
+winFindOptionValue (XF86OptionPtr list, const char *name)
+{
+ list = winFindOption (list, name);
+ if (list)
+ {
+ if (list->opt_val)
+ return (list->opt_val);
+ else
+ return "";
+ }
+ return (NULL);
+}
+
+
+/*
+ * Parse the option.
+ */
+
+static Bool
+ParseOptionValue (int scrnIndex, pointer options, OptionInfoPtr p)
+{
+ char *s, *end;
+
+ if ((s = winFindOptionValue (options, p->name)) != NULL)
+ {
+ switch (p->type)
+ {
+ case OPTV_INTEGER:
+ if (*s == '\0')
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires an integer value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ else
+ {
+ p->value.num = strtoul (s, &end, 0);
+ if (*end == '\0')
+ {
+ p->found = TRUE;
+ }
+ else
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires an integer value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ }
+ break;
+ case OPTV_STRING:
+ if (*s == '\0')
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires an string value\n", p->name);
+ p->found = FALSE;
+ }
+ else
+ {
+ p->value.str = s;
+ p->found = TRUE;
+ }
+ break;
+ case OPTV_ANYSTR:
+ p->value.str = s;
+ p->found = TRUE;
+ break;
+ case OPTV_REAL:
+ if (*s == '\0')
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires a floating point value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ else
+ {
+ p->value.realnum = strtod (s, &end);
+ if (*end == '\0')
+ {
+ p->found = TRUE;
+ }
+ else
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires a floating point value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ }
+ break;
+ case OPTV_BOOLEAN:
+ if (GetBoolValue (p, s))
+ {
+ p->found = TRUE;
+ }
+ else
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires a boolean value\n", p->name);
+ p->found = FALSE;
+ }
+ break;
+ case OPTV_FREQ:
+ if (*s == '\0')
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ else
+ {
+ double freq = strtod (s, &end);
+ int units = 0;
+
+ if (end != s)
+ {
+ p->found = TRUE;
+ if (!winNameCompare (end, "Hz"))
+ units = 1;
+ else if (!winNameCompare (end, "kHz") ||
+ !winNameCompare (end, "k"))
+ units = 1000;
+ else if (!winNameCompare (end, "MHz") ||
+ !winNameCompare (end, "M"))
+ units = 1000000;
+ else
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ if (p->found)
+ freq *= (double) units;
+ }
+ else
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires a frequency value\n",
+ p->name);
+ p->found = FALSE;
+ }
+ if (p->found)
+ {
+ p->value.freq.freq = freq;
+ p->value.freq.units = units;
+ }
+ }
+ break;
+ case OPTV_NONE:
+ /* Should never get here */
+ p->found = FALSE;
+ break;
+ }
+ if (p->found)
+ {
+ winDrvMsgVerb (scrnIndex, X_CONFIG, 2, "Option \"%s\"", p->name);
+ if (!(p->type == OPTV_BOOLEAN && *s == 0))
+ {
+ winErrorFVerb (2, " \"%s\"", s);
+ }
+ winErrorFVerb (2, "\n");
+ }
+ }
+ else if (p->type == OPTV_BOOLEAN)
+ {
+ /* Look for matches with options with or without a "No" prefix. */
+ char *n, *newn;
+ OptionInfoRec opt;
+
+ n = winNormalizeName (p->name);
+ if (!n)
+ {
+ p->found = FALSE;
+ return FALSE;
+ }
+ if (strncmp (n, "no", 2) == 0)
+ {
+ newn = n + 2;
+ }
+ else
+ {
+ free (n);
+ n = malloc (strlen (p->name) + 2 + 1);
+ if (!n)
+ {
+ p->found = FALSE;
+ return FALSE;
+ }
+ strcpy (n, "No");
+ strcat (n, p->name);
+ newn = n;
+ }
+ if ((s = winFindOptionValue (options, newn)) != NULL)
+ {
+ if (GetBoolValue (&opt, s))
+ {
+ p->value.bool = !opt.value.bool;
+ p->found = TRUE;
+ }
+ else
+ {
+ winDrvMsg (scrnIndex, X_WARNING,
+ "Option \"%s\" requires a boolean value\n", newn);
+ p->found = FALSE;
+ }
+ }
+ else
+ {
+ p->found = FALSE;
+ }
+ if (p->found)
+ {
+ winDrvMsgVerb (scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn);
+ if (*s != 0)
+ {
+ winErrorFVerb (2, " \"%s\"", s);
+ }
+ winErrorFVerb (2, "\n");
+ }
+ free (n);
+ }
+ else
+ {
+ p->found = FALSE;
+ }
+ return p->found;
+}
+
+
+static Bool
+configLayout (serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout,
+ char *default_layout)
+{
+#if 0
+#pragma warn UNIMPLEMENTED
+#endif
+ return TRUE;
+}
+
+
+static Bool
+configImpliedLayout (serverLayoutPtr servlayoutp,
+ XF86ConfScreenPtr conf_screen)
+{
+#if 0
+#pragma warn UNIMPLEMENTED
+#endif
+ return TRUE;
+}
+
+
+static Bool
+GetBoolValue (OptionInfoPtr p, const char *s)
+{
+ if (*s == 0)
+ {
+ p->value.bool = TRUE;
+ }
+ else
+ {
+ if (winNameCompare (s, "1") == 0)
+ p->value.bool = TRUE;
+ else if (winNameCompare (s, "on") == 0)
+ p->value.bool = TRUE;
+ else if (winNameCompare (s, "true") == 0)
+ p->value.bool = TRUE;
+ else if (winNameCompare (s, "yes") == 0)
+ p->value.bool = TRUE;
+ else if (winNameCompare (s, "0") == 0)
+ p->value.bool = FALSE;
+ else if (winNameCompare (s, "off") == 0)
+ p->value.bool = FALSE;
+ else if (winNameCompare (s, "false") == 0)
+ p->value.bool = FALSE;
+ else if (winNameCompare (s, "no") == 0)
+ p->value.bool = FALSE;
+ }
+ return TRUE;
+}
+
+
+char *
+winNormalizeName (const char *s)
+{
+ char *ret, *q;
+ const char *p;
+
+ if (s == NULL)
+ return NULL;
+
+ ret = malloc (strlen (s) + 1);
+ for (p = s, q = ret; *p != 0; p++)
+ {
+ switch (*p)
+ {
+ case '_':
+ case ' ':
+ case '\t':
+ continue;
+ default:
+ if (isupper (*p))
+ *q++ = tolower (*p);
+ else
+ *q++ = *p;
+ }
+ }
+ *q = '\0';
+ return ret;
+}
diff --git a/hw/xwin/winconfig.h b/hw/xwin/winconfig.h
new file mode 100644
index 000000000..d3099b373
--- /dev/null
+++ b/hw/xwin/winconfig.h
@@ -0,0 +1,332 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Alexander Gottwald
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winconfig.h,v 1.1 2002/10/17 08:18:22 alanh Exp $ */
+#ifndef __WIN_CONFIG_H__
+#define __WIN_CONFIG_H__
+
+#include "win.h"
+#include "../xfree86/parser/xf86Parser.h"
+
+
+/* These are taken from hw/xfree86/common/xf86str.h */
+
+typedef struct
+{
+ CARD32 red, green, blue;
+}
+rgb;
+
+
+typedef struct
+{
+ float red, green, blue;
+}
+Gamma;
+
+
+typedef struct
+{
+ char *identifier;
+ char *vendor;
+ char *board;
+ char *chipset;
+ char *ramdac;
+ char *driver;
+ struct _confscreenrec *myScreenSection;
+ Bool claimed;
+ Bool active;
+ Bool inUse;
+ int videoRam;
+ int textClockFreq;
+ pointer options;
+ int screen; /* For multi-CRTC cards */
+}
+GDevRec, *GDevPtr;
+
+
+typedef struct
+{
+ char *identifier;
+ char *driver;
+ pointer commonOptions;
+ pointer extraOptions;
+}
+IDevRec, *IDevPtr;
+
+
+typedef struct
+{
+ int frameX0;
+ int frameY0;
+ int virtualX;
+ int virtualY;
+ int depth;
+ int fbbpp;
+ rgb weight;
+ rgb blackColour;
+ rgb whiteColour;
+ int defaultVisual;
+ char **modes;
+ pointer options;
+}
+DispRec, *DispPtr;
+
+
+typedef struct _confxvportrec
+{
+ char *identifier;
+ pointer options;
+}
+confXvPortRec, *confXvPortPtr;
+
+
+typedef struct _confxvadaptrec
+{
+ char *identifier;
+ int numports;
+ confXvPortPtr ports;
+ pointer options;
+}
+confXvAdaptorRec, *confXvAdaptorPtr;
+
+
+typedef struct _confscreenrec
+{
+ char *id;
+ int screennum;
+ int defaultdepth;
+ int defaultbpp;
+ int defaultfbbpp;
+ GDevPtr device;
+ int numdisplays;
+ DispPtr displays;
+ int numxvadaptors;
+ confXvAdaptorPtr xvadaptors;
+ pointer options;
+}
+confScreenRec, *confScreenPtr;
+
+
+typedef enum
+{
+ PosObsolete = -1,
+ PosAbsolute = 0,
+ PosRightOf,
+ PosLeftOf,
+ PosAbove,
+ PosBelow,
+ PosRelative
+}
+PositionType;
+
+
+typedef struct _screenlayoutrec
+{
+ confScreenPtr screen;
+ char *topname;
+ confScreenPtr top;
+ char *bottomname;
+ confScreenPtr bottom;
+ char *leftname;
+ confScreenPtr left;
+ char *rightname;
+ confScreenPtr right;
+ PositionType where;
+ int x;
+ int y;
+ char *refname;
+ confScreenPtr refscreen;
+}
+screenLayoutRec, *screenLayoutPtr;
+
+
+typedef struct _serverlayoutrec
+{
+ char *id;
+ screenLayoutPtr screens;
+ GDevPtr inactives;
+ IDevPtr inputs;
+ pointer options;
+}
+serverLayoutRec, *serverLayoutPtr;
+
+
+/*
+ * winconfig.c
+ */
+
+typedef struct
+{
+ /* Files */
+ char *configFile;
+ char *fontPath;
+ char *rgbPath;
+ /* input devices - keyboard */
+ char *keyboard;
+#ifdef XKB
+ Bool noXkbExtension;
+ char *xkbMap;
+#endif
+ /* layout */
+ char *screenname;
+ /* mouse settings */
+ char *mouse;
+ Bool emulate3buttons;
+ long emulate3timeout;
+}
+WinCmdlineRec, *WinCmdlinePtr;
+
+
+extern WinCmdlineRec g_cmdline;
+
+extern XF86ConfigPtr g_xf86configptr;
+extern serverLayoutRec g_winConfigLayout;
+
+
+/*
+ * Function prototypes
+ */
+
+Bool winReadConfigfile (void);
+Bool winConfigFiles (void);
+Bool winConfigOptions (void);
+Bool winConfigScreens (void);
+Bool winConfigKeyboard (DeviceIntPtr pDevice);
+Bool winConfigMouse (DeviceIntPtr pDevice);
+
+
+typedef struct
+{
+ double freq;
+ int units;
+}
+OptFrequency;
+
+
+typedef union
+{
+ unsigned long num;
+ char *str;
+ double realnum;
+ Bool bool;
+ OptFrequency freq;
+}
+ValueUnion;
+
+
+typedef enum
+{
+ OPTV_NONE = 0,
+ OPTV_INTEGER,
+ OPTV_STRING, /* a non-empty string */
+ OPTV_ANYSTR, /* Any string, including an empty one */
+ OPTV_REAL,
+ OPTV_BOOLEAN,
+ OPTV_FREQ
+}
+OptionValueType;
+
+
+typedef enum
+{
+ OPTUNITS_HZ = 1,
+ OPTUNITS_KHZ,
+ OPTUNITS_MHZ
+}
+OptFreqUnits;
+
+
+typedef struct
+{
+ int token;
+ const char *name;
+ OptionValueType type;
+ ValueUnion value;
+ Bool found;
+}
+OptionInfoRec, *OptionInfoPtr;
+
+
+/*
+ * Function prototypes
+ */
+
+char *winSetStrOption (pointer optlist, const char *name, char *deflt);
+int winSetBoolOption (pointer optlist, const char *name, int deflt);
+int winSetIntOption (pointer optlist, const char *name, int deflt);
+double winSetRealOption (pointer optlist, const char *name, double deflt);
+
+XF86OptionPtr winFindOption (XF86OptionPtr list, const char *name);
+char *winFindOptionValue (XF86OptionPtr list, const char *name);
+int winNameCompare (const char *s1, const char *s2);
+char *winNormalizeName (const char *s);
+
+
+typedef struct
+{
+ struct
+ {
+ long leds;
+ long delay;
+ long rate;
+ }
+ keyboard;
+#ifdef XKB
+ struct
+ {
+ Bool disable;
+ char *rules;
+ char *model;
+ char *layout;
+ char *variant;
+ char *options;
+ char *initialMap;
+ char *keymap;
+ char *types;
+ char *compat;
+ char *keycodes;
+ char *symbols;
+ char *geometry;
+ }
+ xkb;
+#endif
+ struct
+ {
+ Bool emulate3Buttons;
+ long emulate3Timeout;
+ }
+ pointer;
+}
+winInfoRec, *winInfoPtr;
+
+
+extern winInfoRec g_winInfo;
+
+#endif
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
new file mode 100644
index 000000000..3c725f248
--- /dev/null
+++ b/hw/xwin/wincreatewnd.c
@@ -0,0 +1,541 @@
+/*
+ *Copyright (C) 1994-2001 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wincreatewnd.c,v 1.5 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+#include "shellapi.h"
+
+
+/*
+ * Local function prototypes
+ */
+
+static Bool
+winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo);
+
+static Bool
+winAdjustForAutoHide (RECT *prcWorkArea);
+
+
+/*
+ * Create a full screen window
+ */
+
+Bool
+winCreateBoundingWindowFullScreen (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ int iWidth = pScreenInfo->dwWidth;
+ int iHeight = pScreenInfo->dwHeight;
+ HWND *phwnd = &pScreenPriv->hwndScreen;
+ WNDCLASS wc;
+
+#if CYGDEBUG
+ ErrorF ("winCreateBoundingWindowFullScreen\n");
+#endif
+
+ /* Setup our window class */
+ wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.lpfnWndProc = winWindowProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = g_hInstance;
+ wc.hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
+ wc.hCursor = 0;
+ wc.hbrBackground = 0;
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = WINDOW_CLASS;
+ RegisterClass (&wc);
+
+ /* Create the window */
+ *phwnd = CreateWindowExA (WS_EX_TOPMOST, /* Extended styles */
+ WINDOW_CLASS, /* Class name */
+ WINDOW_TITLE, /* Window name */
+ WS_POPUP,
+ 0, /* Horizontal position */
+ 0, /* Vertical position */
+ iWidth, /* Right edge */
+ iHeight, /* Bottom edge */
+ (HWND) NULL, /* No parent or owner window */
+ (HMENU) NULL, /* No menu */
+ GetModuleHandle (NULL),/* Instance handle */
+ pScreenPriv); /* ScreenPrivates */
+
+ /* Branch on the server engine */
+ switch (pScreenInfo->dwEngine)
+ {
+ case WIN_SERVER_SHADOW_GDI:
+ /* Show the window */
+ ShowWindow (*phwnd, SW_SHOWMAXIMIZED);
+ break;
+
+ default:
+ /* Hide the window */
+ ShowWindow (*phwnd, SW_SHOWNORMAL);
+ break;
+ }
+
+ /* Send first paint message */
+ UpdateWindow (*phwnd);
+
+ /* Attempt to bring our window to the top of the display */
+ BringWindowToTop (*phwnd);
+
+ return TRUE;
+}
+
+
+/*
+ * Create our primary Windows display window
+ */
+
+Bool
+winCreateBoundingWindowWindowed (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ int iWidth = pScreenInfo->dwUserWidth;
+ int iHeight = pScreenInfo->dwUserHeight;
+ HWND *phwnd = &pScreenPriv->hwndScreen;
+ WNDCLASS wc;
+ RECT rcClient, rcWorkArea;
+ DWORD dwWindowStyle;
+
+ ErrorF ("winCreateBoundingWindowWindowed - User w: %d h: %d\n",
+ pScreenInfo->dwUserWidth, pScreenInfo->dwUserHeight);
+ ErrorF ("winCreateBoundingWindowWindowed - Current w: %d h: %d\n",
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight);
+
+ /* Set the common window style flags */
+ dwWindowStyle = WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX;
+
+ /* Decorated or undecorated window */
+ if (pScreenInfo->fDecoration
+ && !pScreenInfo->fRootless
+ && !pScreenInfo->fMultiWindow)
+ {
+ dwWindowStyle |= WS_CAPTION;
+ if (pScreenInfo->fScrollbars)
+ dwWindowStyle |= WS_THICKFRAME | WS_MAXIMIZEBOX;
+ }
+ else
+ dwWindowStyle |= WS_POPUP;
+
+ /* Setup our window class */
+ wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.lpfnWndProc = winWindowProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = g_hInstance;
+ wc.hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = WINDOW_CLASS;
+ RegisterClass (&wc);
+
+ /* Get size of work area */
+ winGetWorkArea (&rcWorkArea, pScreenInfo);
+
+ /* Adjust for auto-hide taskbars */
+ winAdjustForAutoHide (&rcWorkArea);
+
+ /* Did the user specify a height and width? */
+ if (pScreenInfo->fUserGaveHeightAndWidth)
+ {
+ /* User gave a desired height and width, try to accomodate */
+#if CYGDEBUG
+ ErrorF ("winCreateBoundingWindowWindowed - User gave height "
+ "and width\n");
+#endif
+
+ /* Adjust the window width and height for borders and title bar */
+ if (pScreenInfo->fDecoration
+ && !pScreenInfo->fRootless
+ && !pScreenInfo->fMultiWindow)
+ {
+#if CYGDEBUG
+ ErrorF ("winCreateBoundingWindowWindowed - Window has decoration\n");
+#endif
+ /* Are we using scrollbars? */
+ if (pScreenInfo->fScrollbars)
+ {
+#if CYGDEBUG
+ ErrorF ("winCreateBoundingWindowWindowed - Window has "
+ "scrollbars\n");
+#endif
+
+ iWidth += 2 * GetSystemMetrics (SM_CXSIZEFRAME);
+ iHeight += 2 * GetSystemMetrics (SM_CYSIZEFRAME)
+ + GetSystemMetrics (SM_CYCAPTION);
+ }
+ else
+ {
+#if CYGDEBUG
+ ErrorF ("winCreateBoundingWindowWindowed - Window does not have "
+ "scrollbars\n");
+#endif
+
+ iWidth += 2 * GetSystemMetrics (SM_CXFIXEDFRAME);
+ iHeight += 2 * GetSystemMetrics (SM_CYFIXEDFRAME)
+ + GetSystemMetrics (SM_CYCAPTION);
+ }
+ }
+ else
+ {
+ /*
+ * User gave a width and height but also said no decoration.
+ * In this case we have to ignore the requested width and height
+ * and instead use the largest possible window that we can.
+ */
+ if (pScreenInfo->fMultipleMonitors)
+ {
+ iWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
+ iHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
+ }
+ else
+ {
+ iWidth = GetSystemMetrics (SM_CXSCREEN);
+ iHeight = GetSystemMetrics (SM_CYSCREEN);
+ }
+ }
+ }
+ else
+ {
+ /* By default, we are creating a window that is as large as possible */
+#if CYGDEBUG
+ ErrorF ("winCreateBoundingWindowWindowed - User did not give "
+ "height and width\n");
+#endif
+ /* Defaults are wrong if we have multiple monitors */
+ if (pScreenInfo->fMultipleMonitors)
+ {
+ iWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
+ iHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
+ }
+ }
+
+ /* Clean up the scrollbars flag, if necessary */
+ if ((!pScreenInfo->fDecoration
+ || pScreenInfo->fRootless
+ || pScreenInfo->fMultiWindow)
+ && pScreenInfo->fScrollbars)
+ {
+ /* We cannot have scrollbars if we do not have a window border */
+ pScreenInfo->fScrollbars = FALSE;
+ }
+
+ /* Trim window width to fit work area */
+ if (iWidth > (rcWorkArea.right - rcWorkArea.left))
+ iWidth = rcWorkArea.right - rcWorkArea.left;
+
+ /* Trim window height to fit work area */
+ if (iHeight >= (rcWorkArea.bottom - rcWorkArea.top))
+ iHeight = rcWorkArea.bottom - rcWorkArea.top;
+
+#if CYGDEBUG
+ ErrorF ("winCreateBoundingWindowWindowed - Adjusted width: %d "\
+ "height: %d\n",
+ iWidth, iHeight);
+#endif
+
+ /* Create the window */
+ *phwnd = CreateWindowExA (0, /* Extended styles */
+ WINDOW_CLASS, /* Class name */
+ WINDOW_TITLE, /* Window name */
+ dwWindowStyle,
+ rcWorkArea.left, /* Horizontal position */
+ rcWorkArea.top, /* Vertical position */
+ iWidth, /* Right edge */
+ iHeight, /* Bottom edge */
+ (HWND) NULL, /* No parent or owner window */
+ (HMENU) NULL, /* No menu */
+ GetModuleHandle (NULL),/* Instance handle */
+ pScreenPriv); /* ScreenPrivates */
+ if (*phwnd == NULL)
+ {
+ ErrorF ("winCreateBoundingWindowWindowed - CreateWindowEx () failed\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winCreateBoundingWindowWindowed - CreateWindowEx () returned\n");
+#endif
+
+ /* Get the client area coordinates */
+ if (!GetClientRect (*phwnd, &rcClient))
+ {
+ ErrorF ("winCreateBoundingWindowWindowed - GetClientRect () "
+ "failed\n");
+ return FALSE;
+ }
+
+ ErrorF ("winCreateBoundingWindowWindowed - WindowClient "
+ "w %ld h %ld r %ld l %ld b %ld t %ld\n",
+ rcClient.right - rcClient.left,
+ rcClient.bottom - rcClient.top,
+ rcClient.right, rcClient.left,
+ rcClient.bottom, rcClient.top);
+
+ /* We adjust the visual size if the user did not specify it */
+ if (!(pScreenInfo->fScrollbars && pScreenInfo->fUserGaveHeightAndWidth))
+ {
+ /*
+ * User did not give a height and width with scrollbars enabled,
+ * so we will resize the underlying visual to be as large as
+ * the initial view port (page size). This way scrollbars will
+ * not appear until the user shrinks the window, if they ever do.
+ *
+ * NOTE: We have to store the viewport size here because
+ * the user may have an autohide taskbar, which would
+ * cause the viewport size to be one less in one dimension
+ * than the viewport size that we calculated by subtracting
+ * the size of the borders and caption.
+ */
+ pScreenInfo->dwWidth = rcClient.right - rcClient.left;
+ pScreenInfo->dwHeight = rcClient.bottom - rcClient.top;
+ }
+
+#if 0
+ /*
+ * NOTE: For the uninitiated, the page size is the number of pixels
+ * that we can display in the x or y direction at a time and the
+ * range is the total number of pixels in the x or y direction that we
+ * have available to display. In other words, the page size is the
+ * size of the window area minus the space the caption, borders, and
+ * scrollbars (if any) occupy, and the range is the size of the
+ * underlying X visual. Notice that, contrary to what some of the
+ * MSDN Library arcticles lead you to believe, the windows
+ * ``client area'' size does not include the scrollbars. In other words,
+ * the whole client area size that is reported to you is drawable by
+ * you; you do not have to subtract the size of the scrollbars from
+ * the client area size, and if you did it would result in the size
+ * of the scrollbars being double counted.
+ */
+
+ /* Setup scrollbar page and range, if scrollbars are enabled */
+ if (pScreenInfo->fScrollbars)
+ {
+ SCROLLINFO si;
+
+ /* Initialize the scrollbar info structure */
+ si.cbSize = sizeof (si);
+ si.fMask = SIF_RANGE | SIF_PAGE;
+ si.nMin = 0;
+
+ /* Setup the width range and page size */
+ si.nMax = pScreenInfo->dwWidth - 1;
+ si.nPage = rcClient.right - rcClient.left;
+ ErrorF ("winCreateBoundingWindowWindowed - HORZ nMax: %d nPage :%d\n",
+ si.nMax, si.nPage);
+ SetScrollInfo (*phwnd, SB_HORZ, &si, TRUE);
+
+ /* Setup the height range and page size */
+ si.nMax = pScreenInfo->dwHeight - 1;
+ si.nPage = rcClient.bottom - rcClient.top;
+ ErrorF ("winCreateBoundingWindowWindowed - VERT nMax: %d nPage :%d\n",
+ si.nMax, si.nPage);
+ SetScrollInfo (*phwnd, SB_VERT, &si, TRUE);
+ }
+#endif
+
+ /* Show the window */
+ if (pScreenInfo->fMultiWindow)
+ ShowWindow (*phwnd, SW_SHOWMINNOACTIVE);
+ else
+ ShowWindow (*phwnd, SW_SHOWNORMAL);
+ if (!UpdateWindow (*phwnd))
+ {
+ ErrorF ("winCreateBoundingWindowWindowed - UpdateWindow () failed\n");
+ return FALSE;
+ }
+
+ /* Attempt to bring our window to the top of the display */
+ if (!BringWindowToTop (*phwnd))
+ {
+ ErrorF ("winCreateBoundingWindowWindowed - BringWindowToTop () "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Paint window background blue */
+ if (pScreenInfo->dwEngine == WIN_SERVER_NATIVE_GDI)
+ winPaintBackground (*phwnd, RGB (0x00, 0x00, 0xFF));
+
+ ErrorF ("winCreateBoundingWindowWindowed - Returning\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Find the work area of all attached monitors
+ */
+
+static Bool
+winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo)
+{
+ int iPrimaryWidth, iPrimaryHeight;
+ int iWidth, iHeight;
+ int iLeft, iTop;
+ int iPrimaryNonWorkAreaWidth, iPrimaryNonWorkAreaHeight;
+
+ /* SPI_GETWORKAREA only gets the work area of the primary screen. */
+ SystemParametersInfo (SPI_GETWORKAREA, 0, prcWorkArea, 0);
+
+ /* Bail out here if we aren't using multiple monitors */
+ if (!pScreenInfo->fMultipleMonitors)
+ return TRUE;
+
+ ErrorF ("winGetWorkArea - Original WorkArea: %d %d %d %d\n",
+ prcWorkArea->top, prcWorkArea->left,
+ prcWorkArea->bottom, prcWorkArea->right);
+
+ /* Get size of full virtual screen */
+ iWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
+ iHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
+
+ ErrorF ("winGetWorkArea - Virtual screen is %d x %d\n", iWidth, iHeight);
+
+ /* Get origin of full virtual screen */
+ iLeft = GetSystemMetrics (SM_XVIRTUALSCREEN);
+ iTop = GetSystemMetrics (SM_YVIRTUALSCREEN);
+
+ ErrorF ("winGetWorkArea - Virtual screen origin is %d, %d\n", iLeft, iTop);
+
+ /* Get size of primary screen */
+ iPrimaryWidth = GetSystemMetrics (SM_CXSCREEN);
+ iPrimaryHeight = GetSystemMetrics (SM_CYSCREEN);
+
+ ErrorF ("winGetWorkArea - Primary screen is %d x %d\n",
+ iPrimaryWidth, iPrimaryHeight);
+
+ /* Work out how much of the primary screen we aren't using */
+ iPrimaryNonWorkAreaWidth = iPrimaryWidth - (prcWorkArea->right -
+ prcWorkArea->left);
+ iPrimaryNonWorkAreaHeight = iPrimaryHeight - (prcWorkArea->bottom
+ - prcWorkArea->top);
+
+ /* Update the rectangle to include all monitors */
+ if (iLeft < 0)
+ {
+ prcWorkArea->left = iLeft;
+ }
+ if (iTop < 0)
+ {
+ prcWorkArea->top = iTop;
+ }
+ prcWorkArea->right = prcWorkArea->left + iWidth -
+ iPrimaryNonWorkAreaWidth;
+ prcWorkArea->bottom = prcWorkArea->top + iHeight -
+ iPrimaryNonWorkAreaHeight;
+
+ ErrorF ("winGetWorkArea - Adjusted WorkArea for multiple "
+ "monitors: %d %d %d %d\n",
+ prcWorkArea->top, prcWorkArea->left,
+ prcWorkArea->bottom, prcWorkArea->right);
+
+ return TRUE;
+}
+
+
+/*
+ * Adjust the client area so that any auto-hide toolbars
+ * will work correctly.
+ */
+
+static Bool
+winAdjustForAutoHide (RECT *prcWorkArea)
+{
+ APPBARDATA abd;
+ HWND hwndAutoHide;
+
+ ErrorF ("winAdjustForAutoHide - Original WorkArea: %d %d %d %d\n",
+ prcWorkArea->top, prcWorkArea->left,
+ prcWorkArea->bottom, prcWorkArea->right);
+
+ /* Find out if the Windows taskbar is set to auto-hide */
+ ZeroMemory (&abd, sizeof (abd));
+ abd.cbSize = sizeof (abd);
+ if (SHAppBarMessage (ABM_GETSTATE, &abd) & ABS_AUTOHIDE)
+ ErrorF ("winAdjustForAutoHide - Taskbar is auto hide\n");
+
+ /* Look for a TOP auto-hide taskbar */
+ abd.uEdge = ABE_TOP;
+ hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
+ if (hwndAutoHide != NULL)
+ {
+ ErrorF ("winAdjustForAutoHide - Found TOP auto-hide taskbar\n");
+ prcWorkArea->top += 1;
+ }
+
+ /* Look for a LEFT auto-hide taskbar */
+ abd.uEdge = ABE_LEFT;
+ hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
+ if (hwndAutoHide != NULL)
+ {
+ ErrorF ("winAdjustForAutoHide - Found LEFT auto-hide taskbar\n");
+ prcWorkArea->left += 1;
+ }
+
+ /* Look for a BOTTOM auto-hide taskbar */
+ abd.uEdge = ABE_BOTTOM;
+ hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
+ if (hwndAutoHide != NULL)
+ {
+ ErrorF ("winAdjustForAutoHide - Found BOTTOM auto-hide taskbar\n");
+ prcWorkArea->bottom -= 1;
+ }
+
+ /* Look for a RIGHT auto-hide taskbar */
+ abd.uEdge = ABE_RIGHT;
+ hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
+ if (hwndAutoHide != NULL)
+ {
+ ErrorF ("winAdjustForAutoHide - Found RIGHT auto-hide taskbar\n");
+ prcWorkArea->right -= 1;
+ }
+
+ ErrorF ("winAdjustForAutoHide - Adjusted WorkArea: %d %d %d %d\n",
+ prcWorkArea->top, prcWorkArea->left,
+ prcWorkArea->bottom, prcWorkArea->right);
+
+#if 0
+ /* Obtain the task bar window dimensions */
+ abd.hWnd = hwndAutoHide;
+ hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETTASKBARPOS, &abd);
+ ErrorF ("hwndAutoHide %08x abd.hWnd %08x %d %d %d %d\n",
+ hwndAutoHide, abd.hWnd,
+ abd.rc.top, abd.rc.left, abd.rc.bottom, abd.rc.right);
+#endif
+
+ return TRUE;
+}
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
new file mode 100644
index 000000000..cd12bb632
--- /dev/null
+++ b/hw/xwin/wincursor.c
@@ -0,0 +1,84 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wincursor.c,v 1.5 2002/07/05 09:19:26 alanh Exp $ */
+
+#include "win.h"
+
+miPointerScreenFuncRec g_winPointerCursorFuncs =
+{
+ winCursorOffScreen,
+ winCrossScreen,
+ winPointerWarpCursor
+};
+
+
+void
+winPointerWarpCursor (ScreenPtr pScreen, int x, int y)
+{
+ winScreenPriv(pScreen);
+ RECT rcClient;
+
+ /* Only update the Windows cursor position if we are active */
+ if (pScreenPriv->hwndScreen == GetForegroundWindow ())
+ {
+ /* Get the client area coordinates */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+
+ /* Translate the client area coords to screen coords */
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient,
+ 2);
+
+ /*
+ * Update the Windows cursor position so that we don't
+ * immediately warp back to the current position.
+ */
+ SetCursorPos (rcClient.left + x, rcClient.top + y);
+ }
+
+ /* Call the mi warp procedure to do the actual warping in X. */
+ miPointerWarpCursor (pScreen, x, y);
+}
+
+Bool
+winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
+{
+ return FALSE;
+}
+
+void
+winCrossScreen (ScreenPtr pScreen, Bool fEntering)
+{
+}
+
diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c
new file mode 100644
index 000000000..aff90bdaf
--- /dev/null
+++ b/hw/xwin/winengine.c
@@ -0,0 +1,309 @@
+/*
+ *Copyright (C) 1994-2001 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winengine.c,v 1.4 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+
+/*
+ * Detect engines supported by current Windows version
+ * DirectDraw version and hardware
+ */
+
+void
+winDetectSupportedEngines ()
+{
+ OSVERSIONINFO osvi;
+
+ /* Initialize the engine support flags */
+ g_dwEnginesSupported = WIN_SERVER_SHADOW_GDI;
+
+#if WIN_NATIVE_GDI_SUPPORT
+ g_dwEnginesSupported |= WIN_SERVER_NATIVE_GDI;
+#endif
+
+ /* Get operating system version information */
+ ZeroMemory (&osvi, sizeof (osvi));
+ osvi.dwOSVersionInfoSize = sizeof (osvi);
+ GetVersionEx (&osvi);
+
+ /* Branch on platform ID */
+ switch (osvi.dwPlatformId)
+ {
+ case VER_PLATFORM_WIN32_NT:
+ /* Engine 4 is supported on NT only */
+ ErrorF ("winDetectSupportedEngines - Windows NT/2000/XP\n");
+ break;
+
+ case VER_PLATFORM_WIN32_WINDOWS:
+ /* Engine 4 is supported on NT only */
+ ErrorF ("winDetectSupportedEngines - Windows 95/98/Me\n");
+ break;
+ }
+
+ /* Do we have DirectDraw? */
+ if (g_hmodDirectDraw != NULL)
+ {
+ LPDIRECTDRAW lpdd = NULL;
+ LPDIRECTDRAW4 lpdd4 = NULL;
+ HRESULT ddrval;
+
+ /* Was the DirectDrawCreate function found? */
+ if (g_fpDirectDrawCreate == NULL)
+ {
+ /* No DirectDraw support */
+ return;
+ }
+
+ /* DirectDrawCreate exists, try to call it */
+ /* Create a DirectDraw object, store the address at lpdd */
+ ddrval = (*g_fpDirectDrawCreate) (NULL,
+ (void**) &lpdd,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ /* No DirectDraw support */
+ ErrorF ("winDetectSupportedEngines - DirectDraw not installed\n");
+ return;
+ }
+ else
+ {
+ /* We have DirectDraw */
+ ErrorF ("winDetectSupportedEngines - DirectDraw installed\n");
+ g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD;
+
+ /* Allow PrimaryDD engine if NT */
+ if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ {
+ g_dwEnginesSupported |= WIN_SERVER_PRIMARY_DD;
+ ErrorF ("winDetectSupportedEngines - Allowing PrimaryDD\n");
+ }
+ }
+
+ /* Try to query for DirectDraw4 interface */
+ ddrval = IDirectDraw_QueryInterface (lpdd,
+ &IID_IDirectDraw4,
+ (LPVOID*) &lpdd4);
+ if (SUCCEEDED (ddrval))
+ {
+ /* We have DirectDraw4 */
+ ErrorF ("winDetectSupportedEngines - DirectDraw4 installed\n");
+ g_dwEnginesSupported |= WIN_SERVER_SHADOW_DDNL;
+ }
+
+ /* Cleanup DirectDraw interfaces */
+ if (lpdd4 != NULL)
+ IDirectDraw_Release (lpdd4);
+ if (lpdd != NULL)
+ IDirectDraw_Release (lpdd);
+ }
+
+ ErrorF ("winDetectSupportedEngines - Returning, supported engines %08x\n",
+ g_dwEnginesSupported);
+}
+
+
+/*
+ * Set the engine type, depending on the engines
+ * supported for this screen, and whether the user
+ * suggested an engine type
+ */
+
+Bool
+winSetEngine (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc;
+ DWORD dwBPP;
+
+ /* Get a DC */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winSetEngine - Couldn't get an HDC\n");
+ return FALSE;
+ }
+
+ /*
+ * pScreenInfo->dwBPP may be 0 to indicate that the current screen
+ * depth is to be used. Thus, we must query for the current display
+ * depth here.
+ */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* Release the DC */
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+
+ /* ShadowGDI is the only engine that supports windowed PseudoColor */
+ if (dwBPP == 8 && !pScreenInfo->fFullScreen)
+ {
+ ErrorF ("winSetEngine - Windowed && PseudoColor => ShadowGDI\n");
+ pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
+
+ /* Set engine function pointers */
+ winSetEngineFunctionsShadowGDI (pScreen);
+ return TRUE;
+ }
+
+ /* ShadowGDI is the only engine that supports Multi Window Mode */
+ if (pScreenInfo->fMultiWindow)
+ {
+ ErrorF ("winSetEngine - Multi Window => ShadowGDI\n");
+ pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
+
+ /* Set engine function pointers */
+ winSetEngineFunctionsShadowGDI (pScreen);
+ return TRUE;
+ }
+
+ /* If the user's choice is supported, we'll use that */
+ if (g_dwEnginesSupported & pScreenInfo->dwEnginePreferred)
+ {
+ ErrorF ("winSetEngine - Using user's preference: %d\n",
+ pScreenInfo->dwEnginePreferred);
+ pScreenInfo->dwEngine = pScreenInfo->dwEnginePreferred;
+
+ /* Setup engine function pointers */
+ switch (pScreenInfo->dwEngine)
+ {
+ case WIN_SERVER_SHADOW_GDI:
+ winSetEngineFunctionsShadowGDI (pScreen);
+ break;
+ case WIN_SERVER_SHADOW_DD:
+ winSetEngineFunctionsShadowDD (pScreen);
+ break;
+ case WIN_SERVER_SHADOW_DDNL:
+ winSetEngineFunctionsShadowDDNL (pScreen);
+ break;
+ case WIN_SERVER_PRIMARY_DD:
+ winSetEngineFunctionsPrimaryDD (pScreen);
+ break;
+ case WIN_SERVER_NATIVE_GDI:
+ winSetEngineFunctionsNativeGDI (pScreen);
+ break;
+ default:
+ FatalError ("winSetEngine - Invalid engine type\n");
+ }
+ return TRUE;
+ }
+
+ /* ShadowDDNL has good performance, so why not */
+ if (g_dwEnginesSupported & WIN_SERVER_SHADOW_DDNL)
+ {
+ ErrorF ("winSetEngine - Using Shadow DirectDraw NonLocking\n");
+ pScreenInfo->dwEngine = WIN_SERVER_SHADOW_DDNL;
+
+ /* Set engine function pointers */
+ winSetEngineFunctionsShadowDDNL (pScreen);
+ return TRUE;
+ }
+
+ /* ShadowDD is next in line */
+ if (g_dwEnginesSupported & WIN_SERVER_SHADOW_DD)
+ {
+ ErrorF ("winSetEngine - Using Shadow DirectDraw\n");
+ pScreenInfo->dwEngine = WIN_SERVER_SHADOW_DD;
+
+ /* Set engine function pointers */
+ winSetEngineFunctionsShadowDD (pScreen);
+ return TRUE;
+ }
+
+ /* ShadowGDI is next in line */
+ if (g_dwEnginesSupported & WIN_SERVER_SHADOW_GDI)
+ {
+ ErrorF ("winSetEngine - Using Shadow GDI DIB\n");
+ pScreenInfo->dwEngine = WIN_SERVER_SHADOW_GDI;
+
+ /* Set engine function pointers */
+ winSetEngineFunctionsShadowGDI (pScreen);
+ return TRUE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Get procedure addresses for DirectDrawCreate and DirectDrawCreateClipper
+ */
+
+Bool
+winGetDDProcAddresses ()
+{
+ Bool fReturn = TRUE;
+
+ /* Load the DirectDraw library */
+ g_hmodDirectDraw = LoadLibraryEx ("ddraw.dll", NULL, 0);
+ if (g_hmodDirectDraw == NULL)
+ {
+ ErrorF ("winGetDDProcAddresses - Could not load ddraw.dll\n");
+ fReturn = TRUE;
+ goto winGetDDProcAddresses_Exit;
+ }
+
+ /* Try to get the DirectDrawCreate address */
+ g_fpDirectDrawCreate = GetProcAddress (g_hmodDirectDraw,
+ "DirectDrawCreate");
+ if (g_fpDirectDrawCreate == NULL)
+ {
+ ErrorF ("winGetDDProcAddresses - Could not get DirectDrawCreate "
+ "address\n");
+ fReturn = TRUE;
+ goto winGetDDProcAddresses_Exit;
+ }
+
+ /* Try to get the DirectDrawCreateClipper address */
+ g_fpDirectDrawCreateClipper = GetProcAddress (g_hmodDirectDraw,
+ "DirectDrawCreateClipper");
+ if (g_fpDirectDrawCreateClipper == NULL)
+ {
+ ErrorF ("winGetDDProcAddresses - Could not get "
+ "DirectDrawCreateClipper address\n");
+ fReturn = FALSE;
+ goto winGetDDProcAddresses_Exit;
+ }
+
+ /*
+ * Note: Do not unload ddraw.dll here. Do it in GiveUp
+ */
+
+ winGetDDProcAddresses_Exit:
+ /* Unload the DirectDraw library if we failed to initialize */
+ if (!fReturn && g_hmodDirectDraw != NULL)
+ {
+ FreeLibrary (g_hmodDirectDraw);
+ g_hmodDirectDraw = NULL;
+ }
+
+ return fReturn;
+}
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
new file mode 100644
index 000000000..c18f10dde
--- /dev/null
+++ b/hw/xwin/winerror.c
@@ -0,0 +1,73 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winerror.c,v 1.4 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+extern FILE *g_pfLog;
+
+#ifdef DDXOSVERRORF
+void
+OsVendorVErrorF (const char *pszFormat, va_list va_args)
+{
+ static pthread_mutex_t s_pmPrinting = PTHREAD_MUTEX_INITIALIZER;
+
+ /* Check we opened the log file first */
+ if (g_pfLog == NULL) return;
+
+ /* Lock the printing mutex */
+ pthread_mutex_lock (&s_pmPrinting);
+
+ /* Print the error message to a log file, could be stderr */
+ vfprintf (g_pfLog, pszFormat, va_args);
+
+ /* Flush after every write, to make updates show up quickly */
+ fflush (g_pfLog);
+
+ /* Unlock the printing mutex */
+ pthread_mutex_unlock (&s_pmPrinting);
+}
+#endif
+
+
+/*
+ * os/util.c/FatalError () calls our vendor ErrorF, so the message
+ * from a FatalError will be logged. Thus, the message for the
+ * fatal error is not passed to this function.
+ *
+ * Attempt to do last-ditch, safe, important cleanup here.
+ */
+#ifdef DDXOSFATALERROR
+void
+OsVendorFatalError (void)
+{
+
+}
+#endif
diff --git a/hw/xwin/winfillsp.c b/hw/xwin/winfillsp.c
new file mode 100644
index 000000000..faf9c67fc
--- /dev/null
+++ b/hw/xwin/winfillsp.c
@@ -0,0 +1,537 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winfillsp.c,v 1.9 2001/11/01 12:19:40 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 54 */
+void
+winFillSpansNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ int iSpans,
+ DDXPointPtr pPoints,
+ int *piWidths,
+ int fSorted)
+{
+ winGCPriv(pGC);
+ int iSpan;
+ DDXPointPtr pPoint = NULL;
+ int *piWidth = 0;
+ HBITMAP hbmpOrig = NULL, hbmpOrigStipple = NULL;
+ PixmapPtr pPixmap = NULL;
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ HBITMAP hbmpFilledStipple = NULL, hbmpMaskedForeground = NULL;
+ PixmapPtr pStipple = NULL;
+ winPrivPixmapPtr pStipplePriv = NULL;
+ PixmapPtr pTile = NULL;
+ winPrivPixmapPtr pTilePriv = NULL;
+ HBRUSH hbrushStipple = NULL;
+ HDC hdcStipple = NULL;
+ BYTE *pbbitsFilledStipple = NULL;
+ int iX;
+ DEBUG_FN_NAME("winFillSpans");
+ DEBUGVARS;
+ DEBUGPROC_MSG;
+
+ /* Branch on the type of drawable we have */
+ switch (pDrawable->type)
+ {
+ case DRAWABLE_PIXMAP:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP\n");
+#if 0
+ /* Branch on the raster operation type */
+ switch (pGC->alu)
+ {
+ case GXclear:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXclear\n");
+ break;
+ case GXand:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXand\n");
+ break;
+ case GXandReverse:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXandReverse\n");
+ break;
+ case GXcopy:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXcopy\n");
+ break;
+ case GXandInverted:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXandInverted\n");
+ break;
+ case GXnoop:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXnoop\n");
+ break;
+ case GXxor:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXxor\n");
+ break;
+ case GXor:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXor\n");
+ break;
+ case GXnor:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXnor\n");
+ break;
+ case GXequiv:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXequiv\n");
+ break;
+ case GXinvert:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXinvert\n");
+ break;
+ case GXorReverse:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXorReverse\n");
+ break;
+ case GXcopyInverted:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXcopyInverted\n");
+ break;
+ case GXorInverted:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXorInverted\n");
+ break;
+ case GXnand:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXnand\n");
+ break;
+ case GXset:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - GXset\n");
+ break;
+ default:
+ FatalError ("winFillSpans - DRAWABLE_PIXMAP - Unknown ROP\n");
+ break;
+ }
+#endif
+
+ /* Get a pixmap pointer from the drawable pointer, and fetch privates */
+ pPixmap = (PixmapPtr) pDrawable;
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ /* Select the drawable pixmap into memory hdc */
+ hbmpOrig = SelectObject (pGCPriv->hdcMem, pPixmapPriv->hBitmap);
+ if (hbmpOrig == NULL)
+ FatalError ("winFillSpans - DRAWABLE_PIXMAP - "
+ "SelectObject () failed on pPixmapPriv->hBitmap\n");
+
+ /* Branch on the fill type */
+ switch (pGC->fillStyle)
+ {
+ case FillSolid:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - FillSolid %08x\n",
+ pDrawable);
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width, pDrawable->height,
+ pDrawable->width, pDrawable->height,
+ pGCPriv->hdcMem,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG ("FillSolid - Original bitmap");
+
+ /* Enumerate spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ /* Get pointers to the current span location and width */
+ pPoint = pPoints + iSpan;
+ piWidth = piWidths + iSpan;
+
+ /* Display some useful information */
+ ErrorF ("(%dx%dx%d) (%d,%d) fg: %d bg: %d w: %d\n",
+ pDrawable->width, pDrawable->height, pDrawable->depth,
+ pPoint->x, pPoint->y,
+ pGC->fgPixel, pGC->bgPixel,
+ *piWidth);
+
+ /* Draw the requested line */
+ MoveToEx (pGCPriv->hdcMem, pPoint->x, pPoint->y, NULL);
+ LineTo (pGCPriv->hdcMem, pPoint->x + *piWidth, pPoint->y);
+ }
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width * 2, pDrawable->height,
+ pDrawable->width, pDrawable->height,
+ pGCPriv->hdcMem,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG ("FillSolid - Filled bitmap");
+
+
+ /* Push the drawable pixmap out of the GC HDC */
+ SelectObject (pGCPriv->hdcMem, hbmpOrig);
+ break;
+
+ case FillStippled:
+ ErrorF ("winFillSpans - DRAWABLE_PIXMAP - FillStippled %08x\n",
+ pDrawable);
+
+ /*
+ * FIXME: Assuming that pGC->patOrg.x = pGC->patOrg.y = 0
+ */
+
+ pStipple = pGC->stipple;
+ pStipplePriv = winGetPixmapPriv (pStipple);
+
+ /* Create a memory DC to hold the stipple */
+ hdcStipple = CreateCompatibleDC (pGCPriv->hdc);
+
+ /* Create a destination sized compatible bitmap */
+ hbmpFilledStipple = winCreateDIBNativeGDI (pDrawable->width,
+ pDrawable->height,
+ pDrawable->depth,
+ &pbbitsFilledStipple,
+ NULL);
+
+ /* Select the stipple bitmap into the stipple DC */
+ hbmpOrigStipple = SelectObject (hdcStipple, hbmpFilledStipple);
+ if (hbmpOrigStipple == NULL)
+ FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
+ "SelectObject () failed on hbmpFilledStipple\n");
+
+ /* Create a pattern brush from the original stipple */
+ hbrushStipple = CreatePatternBrush (pStipplePriv->hBitmap);
+
+ /* Select the original stipple brush into the stipple DC */
+ SelectObject (hdcStipple, hbrushStipple);
+
+ /* PatBlt the original stipple to the filled stipple */
+ PatBlt (hdcStipple,
+ 0, 0,
+ pDrawable->width, pDrawable->height,
+ PATCOPY);
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width, 0,
+ pDrawable->width, pDrawable->height,
+ hdcStipple,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG("Filled a drawable-sized stipple");
+
+ /*
+ * Mask out the bits from the drawable that are being preserved;
+ * hbmpFilledStipple now contains the preserved original bits.
+ */
+ BitBlt (hdcStipple,
+ 0, 0,
+ pDrawable->width, pDrawable->height,
+ pGCPriv->hdcMem,
+ 0, 0,
+ SRCERASE);
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width * 2, 0,
+ pDrawable->width, pDrawable->height,
+ hdcStipple,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG("Preserved original bits");
+
+ /*
+ * Create a destination sized compatible bitmap to hold
+ * the masked foreground color.
+ */
+ hbmpMaskedForeground = winCreateDIBNativeGDI (pDrawable->width,
+ pDrawable->height,
+ pDrawable->depth,
+ NULL,
+ NULL);
+
+ /*
+ * Select the masked foreground bitmap into the default memory DC;
+ * this should pop the drawable bitmap out of the default DC.
+ */
+ if (SelectObject (pGCPriv->hdcMem, hbmpMaskedForeground) == NULL)
+ FatalError ("winFillSpans () - DRAWABLE_PIXMAP - FillStippled - "
+ "SelectObject () failed on hbmpMaskedForeground\n");
+
+ /* Free the original drawable */
+ DeleteObject (pPixmapPriv->hBitmap);
+ pPixmapPriv->hBitmap = NULL;
+ pPixmapPriv->pbBits = NULL;
+
+ /* Select the stipple brush into the default memory DC */
+ SelectObject (pGCPriv->hdcMem, hbrushStipple);
+
+ /* Create the masked foreground bitmap using the original stipple */
+ PatBlt (pGCPriv->hdcMem,
+ 0, 0,
+ pDrawable->width, pDrawable->height,
+ PATCOPY);
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width * 3, 0,
+ pDrawable->width, pDrawable->height,
+ pGCPriv->hdcMem,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG("Masked foreground bitmap");
+
+ /*
+ * Combine the masked foreground with the masked drawable;
+ * hbmpFilledStipple will contain the drawable stipple filled
+ * with the current foreground color
+ */
+ BitBlt (hdcStipple,
+ 0, 0,
+ pDrawable->width, pDrawable->height,
+ pGCPriv->hdcMem,
+ 0, 0,
+ SRCPAINT);
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width * 4, 0,
+ pDrawable->width, pDrawable->height,
+ hdcStipple,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG("Completed stipple");
+
+ /* Release the stipple DC */
+ SelectObject (hdcStipple, hbmpOrig);
+ DeleteDC (hdcStipple);
+
+ /* Pop the stipple pattern brush out of the default mem DC */
+ SelectObject (pGCPriv->hdcMem, GetStockObject (WHITE_BRUSH));
+
+ /* Destroy the original stipple pattern brush */
+ DeleteObject (hbrushStipple);
+
+ /* Clear the memory DC */
+ SelectObject (pGCPriv->hdcMem, hbmpOrig);
+
+ /* Free the masked foreground bitmap */
+ DeleteObject (hbmpMaskedForeground);
+
+ /* Point the drawable to the new bitmap */
+ pPixmapPriv->hBitmap = hbmpFilledStipple;
+ pPixmapPriv->pbBits = pbbitsFilledStipple;
+ break;
+
+ case FillTiled:
+ FatalError ("\nwinFillSpans - DRAWABLE_PIXMAP - FillTiled\n\n");
+ break;
+
+ case FillOpaqueStippled:
+ FatalError ("winFillSpans - DRAWABLE_PIXMAP - OpaqueStippled\n");
+ break;
+
+ default:
+ FatalError ("winFillSpans - DRAWABLE_PIXMAP - Unknown "
+ "fillStyle\n");
+ break;
+ }
+ break;
+
+ case DRAWABLE_WINDOW:
+ /* Branch on fill style */
+ switch (pGC->fillStyle)
+ {
+ case FillSolid:
+ ErrorF ("\nwinFillSpans - DRAWABLE_WINDOW - FillSolid\n\n");
+
+ /* Enumerate spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ /* Get pointers to the current span location and width */
+ pPoint = pPoints + iSpan;
+ piWidth = piWidths + iSpan;
+
+ /* Display some useful information */
+ ErrorF ("(%dx%dx%d) (%d,%d) fg: %d bg: %d w: %d\n",
+ pDrawable->width, pDrawable->height, pDrawable->depth,
+ pPoint->x, pPoint->y,
+ pGC->fgPixel, pGC->bgPixel,
+ *piWidth);
+
+ /* Draw the requested line */
+ MoveToEx (pGCPriv->hdc, pPoint->x, pPoint->y, NULL);
+ LineTo (pGCPriv->hdc, pPoint->x + *piWidth, pPoint->y);
+ }
+ break;
+
+ case FillStippled:
+ FatalError ("winFillSpans - DRAWABLE_WINDOW - FillStippled\n\n");
+ break;
+
+ case FillTiled:
+ ErrorF ("\nwinFillSpans - DRAWABLE_WINDOW - FillTiled\n\n");
+
+ /* Get a pixmap pointer from the tile pointer, and fetch privates */
+ pTile = (PixmapPtr) pGC->tile.pixmap;
+ pTilePriv = winGetPixmapPriv (pTile);
+
+ /* Select the tile into a DC */
+ hbmpOrig = SelectObject (pGCPriv->hdcMem, pTilePriv->hBitmap);
+ if (hbmpOrig == NULL)
+ FatalError ("winFillSpans - DRAWABLE_WINDOW - FillTiled - "
+ "SelectObject () failed on pTilePric->hBitmap\n");
+
+ /* Enumerate spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ /* Get pointers to the current span location and width */
+ pPoint = pPoints + iSpan;
+ piWidth = piWidths + iSpan;
+
+ for (iX = 0; iX < *piWidth; iX += pTile->drawable.width)
+ {
+ /* Blit the tile to the screen, one line at a time */
+ BitBlt (pGCPriv->hdc,
+ pPoint->x + iX, pPoint->y,
+ pTile->drawable.width, 1,
+ pGCPriv->hdcMem,
+ 0, pPoint->y % pTile->drawable.height,
+ SRCCOPY);
+ }
+ }
+
+ /* Push the drawable pixmap out of the GC HDC */
+ SelectObject (pGCPriv->hdcMem, hbmpOrig);
+
+#if 0
+ DEBUG_MSG("Completed tile fill");
+#endif
+ break;
+
+ case FillOpaqueStippled:
+ FatalError ("winFillSpans - DRAWABLE_WINDOW - "
+ "OpaqueStippled\n");
+ break;
+
+ default:
+ FatalError ("winFillSpans - DRAWABLE_WINDOW - Unknown "
+ "fillStyle\n");
+ }
+
+ /* Branch on the raster operation type */
+ switch (pGC->alu)
+ {
+ case GXclear:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXclear\n");
+ break;
+ case GXand:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXand\n");
+ break;
+ case GXandReverse:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXandReverse\n");
+ break;
+ case GXcopy:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXcopy\n");
+ break;
+ case GXandInverted:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXandInverted\n");
+ break;
+ case GXnoop:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXnoop\n");
+ break;
+ case GXxor:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXxor\n");
+ break;
+ case GXor:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXor\n");
+ break;
+ case GXnor:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXnor\n");
+ break;
+ case GXequiv:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXequiv\n");
+ break;
+ case GXinvert:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXinvert\n");
+ break;
+ case GXorReverse:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXorReverse\n");
+ break;
+ case GXcopyInverted:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXcopyInverted\n");
+ break;
+ case GXorInverted:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXorInverted\n");
+ break;
+ case GXnand:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXnand\n");
+ break;
+ case GXset:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - GXset\n");
+ break;
+ default:
+ ErrorF ("winFillSpans - DRAWABLE_WINDOW - Unknown ROP\n");
+ break;
+ }
+ break;
+
+ case UNDRAWABLE_WINDOW:
+ FatalError ("winFillSpans - UNDRAWABLE_WINDOW\n\n");
+
+ switch (pGC->fillStyle)
+ {
+ case FillSolid:
+ ErrorF ("\nwinFillSpans - UNDRAWABLE_WINDOW - FillSolid\n\n");
+ break;
+
+ case FillStippled:
+ ErrorF ("\nwinFillSpans - UNDRAWABLE_WINDOW - FillStippled\n\n");
+ break;
+
+ case FillTiled:
+ ErrorF ("\nwinFillSpans - UNDRAWABLE_WINDOW - FillTiled\n\n");
+ break;
+
+ case FillOpaqueStippled:
+ FatalError ("winFillSpans () - UNDRAWABLE_WINDOW - "
+ "OpaqueStippled\n");
+ break;
+
+ default:
+ FatalError ("winFillSpans () - UNDRAWABLE_WINDOW - Unknown "
+ "fillStyle\n");
+ }
+ break;
+
+ case DRAWABLE_BUFFER:
+ FatalError ("winFillSpansNativeGDI - DRAWABLE_BUFFER\n");
+ break;
+
+ default:
+ FatalError ("winFillSpansNativeGDI - Unknown drawable type\n");
+ break;
+ }
+}
diff --git a/hw/xwin/winfont.c b/hw/xwin/winfont.c
new file mode 100644
index 000000000..b249d8643
--- /dev/null
+++ b/hw/xwin/winfont.c
@@ -0,0 +1,50 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winfont.c,v 1.2 2001/06/04 13:04:41 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 32 */
+/* See mfb/mfbfont.c - mfbRealizeFont() - which is empty :) */
+Bool
+winRealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
+{
+ ErrorF ("winRealizeFont()\n");
+ return TRUE;
+}
+
+/* See Porting Layer Definition - p. 32 */
+/* See mfb/mfbfont.c - mfbUnrealizeFont() - which is empty :) */
+Bool
+winUnrealizeFontNativeGDI (ScreenPtr pScreen, FontPtr pFont)
+{
+ ErrorF ("winUnrealizeFont()\n");
+ return TRUE;
+}
diff --git a/hw/xwin/wingc.c b/hw/xwin/wingc.c
new file mode 100644
index 000000000..6ad58d8ed
--- /dev/null
+++ b/hw/xwin/wingc.c
@@ -0,0 +1,418 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wingc.c,v 1.10 2001/10/30 15:39:09 alanh Exp $ */
+
+#include "win.h"
+
+#if 0
+/* GC Handling Routines */
+const GCFuncs winGCFuncs = {
+ winValidateGCNativeGDI,
+ winChangeGCNativeGDI,
+ winCopyGCNativeGDI,
+ winDestroyGCNativeGDI,
+ winChangeClipNativeGDI,
+ winDestroyClipNativeGDI,
+ winCopyClipNativeGDI,
+};
+#else
+const GCFuncs winGCFuncs = {
+ winValidateGCNativeGDI,
+ winChangeGCNativeGDI,
+ winCopyGCNativeGDI,
+ winDestroyGCNativeGDI,
+ miChangeClip,
+ miDestroyClip,
+ miCopyClip,
+};
+#endif
+
+/* Drawing Primitives */
+const GCOps winGCOps = {
+ winFillSpansNativeGDI,
+ winSetSpansNativeGDI,
+ miPutImage,
+ miCopyArea,
+ miCopyPlane,
+ miPolyPoint,
+ winPolyLineNativeGDI,
+ miPolySegment,
+ miPolyRectangle,
+ miPolyArc,
+ miFillPolygon,
+ miPolyFillRect,
+ miPolyFillArc,
+ miPolyText8,
+ miPolyText16,
+ miImageText8,
+ miImageText16,
+ miImageGlyphBlt,
+ miPolyGlyphBlt,
+ miPushPixels
+#ifdef NEED_LINEHELPER
+ ,NULL
+#endif
+};
+
+
+/* See Porting Layer Definition - p. 45 */
+/* See mfb/mfbgc.c - mfbCreateGC() */
+/* See Strategies for Porting - pp. 15, 16 */
+Bool
+winCreateGCNativeGDI (GCPtr pGC)
+{
+ winPrivGCPtr pGCPriv = NULL;
+ winPrivScreenPtr pScreenPriv = NULL;
+
+ ErrorF ("winCreateGCNativeGDI () depth: %d\n",
+ pGC->depth);
+
+ pGC->clientClip = NULL;
+ pGC->clientClipType = CT_NONE;
+
+ pGC->ops = (GCOps *) &winGCOps;
+ pGC->funcs = (GCFuncs *) &winGCFuncs;
+
+ /*
+ * Setting miTranslate to 1 causes the coordinates passed to
+ * FillSpans, GetSpans, and SetSpans to be screen relative, rather
+ * than drawable relative.
+ *
+ * miTranslate was set to 0 prior to 2001-08-17.
+ */
+ pGC->miTranslate = 1;
+
+ /* Allocate privates for this GC */
+ pGCPriv = winGetGCPriv (pGC);
+ if (pGCPriv == NULL)
+ {
+ ErrorF ("winCreateGCNativeGDI () - Privates pointer was NULL\n");
+ return FALSE;
+ }
+
+ /* Copy the screen DC to the local privates */
+ pScreenPriv = winGetScreenPriv (pGC->pScreen);
+ pGCPriv->hdc = pScreenPriv->hdcScreen;
+
+ /* Allocate a memory DC for the GC */
+ pGCPriv->hdcMem = CreateCompatibleDC (pGCPriv->hdc);
+
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 45 */
+void
+winChangeGCNativeGDI (GCPtr pGC, unsigned long ulChanges)
+{
+#if CYGDEBUG
+ ErrorF ("winChangeGCNativeGDI () - Doing nothing\n");
+#endif
+}
+
+
+void
+winValidateGCNativeGDI (GCPtr pGC,
+ unsigned long ulChanges,
+ DrawablePtr pDrawable)
+{
+ winGCPriv(pGC);
+ HBITMAP hbmpOrig = NULL;
+ PixmapPtr pPixmap = NULL;
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ RGBQUAD rgbColors[2] = {{0, 0, 0, 0}, {0, 0, 0, 0}};
+ PixmapPtr pStipple = NULL;
+ winPrivPixmapPtr pStipplePriv = NULL;
+ int i;
+ DEBUG_FN_NAME("winValidateGC");
+ DEBUGVARS;
+ DEBUGPROC_MSG;
+
+ /* Branch on drawable type */
+ switch (pDrawable->type)
+ {
+ case DRAWABLE_PIXMAP:
+ /* Branch on the fill style */
+ switch (pGC->fillStyle)
+ {
+ case FillSolid:
+ ErrorF ("winValidateGC - DRAWABLE_PIXMAP - FillSolid\n");
+
+ /* Select a stock pen */
+ if (pDrawable->depth == 1 && pGC->fgPixel)
+ {
+ ErrorF ("winValidateGC - Selecting WHITE_PEN\n");
+ SelectObject (pGCPriv->hdcMem, GetStockObject (WHITE_PEN));
+ }
+ else if (pDrawable->depth == 1 && !pGC->fgPixel)
+ {
+ ErrorF ("winValidateGC - Selecting BLACK_PEN\n");
+ SelectObject (pGCPriv->hdcMem, GetStockObject (BLACK_PEN));
+ }
+ else if (pGC->fgPixel)
+ {
+ ErrorF ("winValidateGC - Selecting custom pen: %d\n",
+ pGC->fgPixel);
+ /*
+ * FIXME: So far I've only seen a white pen selected here.
+ */
+#if 1
+ SelectObject (pGCPriv->hdcMem, GetStockObject (WHITE_PEN));
+#else
+ /* FIXME: This leaks a pen */
+ SelectObject (pGCPriv->hdcMem,
+ CreatePen (PS_SOLID, 0, pGC->fgPixel));
+#endif
+ }
+ else
+ {
+ ErrorF ("winValidateGC - Selecting BLACK_PEN\n");
+ SelectObject (pGCPriv->hdcMem, GetStockObject (BLACK_PEN));
+ }
+ break;
+
+ case FillStippled:
+ ErrorF ("winValidateGC - DRAWABLE_PIXMAP - FillStippled\n");
+ /*
+ * NOTE: Setting the brush color has no effect on DIB fills.
+ * You need to set the stipple bitmap's color table instead.
+ */
+#if 1
+ /* Pick the white color index */
+ if (pGC->fgPixel)
+ i = 1;
+ else
+ i = 0;
+
+ /* Set the white color, black is default */
+ rgbColors[i].rgbRed = 255;
+ rgbColors[i].rgbGreen = 255;
+ rgbColors[i].rgbBlue = 255;
+
+ /* Get stipple and privates pointers */
+ pStipple = pGC->stipple;
+ pStipplePriv = winGetPixmapPriv (pStipple);
+
+ /* Select the stipple bitmap */
+ hbmpOrig = SelectObject (pGCPriv->hdcMem, pStipplePriv->hBitmap);
+
+ /* Set the stipple color table */
+ SetDIBColorTable (pGCPriv->hdcMem, 0, 2, rgbColors);
+
+ /* Pop the stipple out of the hdc */
+ SelectObject (pGCPriv->hdcMem, hbmpOrig);
+
+#else
+ /* Set the foreground color for the stipple fill */
+ if (pGC->fgPixel == 0x1)
+ {
+ SetTextColor (pGCPriv->hdcMem, RGB(0x00, 0x00, 0x00));
+ }
+ else if (pGC->fgPixel == 0xFFFF)
+ {
+ SetTextColor (pGCPriv->hdcMem, RGB(0xFF, 0xFF, 0xFF));
+ }
+ else
+ {
+ SetTextColor (pGCPriv->hdcMem, RGB(0x00, 0x00, 0x00));
+ }
+ SetBkColor (pGCPriv->hdcMem, RGB(0x00, 0x00, 0x00));
+#endif
+ break;
+
+ case FillOpaqueStippled:
+ FatalError ("winValidateGC - DRAWABLE_PIXMAP - "
+ "FillOpaqueStippled\n");
+ break;
+
+ case FillTiled:
+ FatalError ("winValidateGC - DRAWABLE_PIXMAP - FillTiled\n");
+ break;
+
+ default:
+ FatalError ("winValidateGC - DRAWABLE_PIXMAP - Unknown fill "
+ "style\n");
+ break;
+ }
+ break;
+
+ case DRAWABLE_WINDOW:
+ /* Branch on the fill style */
+ switch (pGC->fillStyle)
+ {
+ case FillTiled:
+ ErrorF ("winValidateGC - DRAWABLE_WINDOW - FillTiled\n");
+ /*
+ * Do nothing here for now. Select the tile bitmap into the
+ * appropriate DC in the drawing function.
+ */
+
+ /*
+ * BEGIN REMOVE - Visual verification only.
+ */
+ /* Get pixmap and privates pointers for the tile */
+ pPixmap = pGC->tile.pixmap;
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ /* Push the tile into the GC's DC */
+ hbmpOrig = SelectObject (pGCPriv->hdcMem, pPixmapPriv->hBitmap);
+ if (hbmpOrig == NULL)
+ FatalError ("winValidateGC - DRAWABLE_WINDOW - FillTiled - "
+ "SelectObject () failed on pPixmapPriv->hBitmap\n");
+
+ /* Blit the tile to a remote area of the screen */
+ BitBlt (pGCPriv->hdc,
+ 64, 64,
+ pGC->tile.pixmap->drawable.width,
+ pGC->tile.pixmap->drawable.height,
+ pGCPriv->hdcMem,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG ("Blitted the tile to a remote area of the screen");
+
+ /* Pop the tile out of the GC's DC */
+ SelectObject (pGCPriv->hdcMem, hbmpOrig);
+ /*
+ * END REMOVE - Visual verification only.
+ */
+ break;
+
+ case FillStippled:
+ FatalError ("winValidateGC - DRAWABLE_WINDOW - FillStippled\n");
+ break;
+
+ case FillOpaqueStippled:
+ FatalError ("winValidateGC - DRAWABLE_WINDOW - "
+ "FillOpaqueStippled\n");
+ break;
+
+ case FillSolid:
+ ErrorF ("winValidateGC - DRAWABLE_WINDOW - FillSolid\n");
+
+ /* Select a stock pen */
+ if (pDrawable->depth == 1 && pGC->fgPixel)
+ {
+ ErrorF ("winValidateGC - Selecting WHITE_PEN\n");
+ SelectObject (pGCPriv->hdc, GetStockObject (WHITE_PEN));
+ }
+ else if (pDrawable->depth == 1 && !pGC->fgPixel)
+ {
+ ErrorF ("winValidateGC - Selecting BLACK_PEN\n");
+ SelectObject (pGCPriv->hdc, GetStockObject (BLACK_PEN));
+ }
+ else if (pGC->fgPixel)
+ {
+ ErrorF ("winValidateGC - Selecting custom pen: %d\n",
+ pGC->fgPixel);
+ /*
+ * FIXME: So far I've only seen a white pen selected here.
+ */
+ SelectObject (pGCPriv->hdc, GetStockObject (WHITE_PEN));
+ }
+ else
+ {
+ ErrorF ("winValidateGC - Selecting BLACK_PEN\n");
+ SelectObject (pGCPriv->hdc, GetStockObject (BLACK_PEN));
+ }
+ break;
+
+ default:
+ FatalError ("winValidateGC - DRAWABLE_WINDOW - Unknown fill "
+ "style\n");
+ break;
+ }
+ break;
+
+ case UNDRAWABLE_WINDOW:
+ ErrorF ("\nwinValidateGC - UNDRAWABLE_WINDOW\n\n");
+ break;
+
+ case DRAWABLE_BUFFER:
+ FatalError ("winValidateGC - DRAWABLE_BUFFER\n");
+ break;
+
+ default:
+ FatalError ("winValidateGC - Unknown drawable type\n");
+ break;
+ }
+}
+
+
+/* See Porting Layer Definition - p. 46 */
+void
+winCopyGCNativeGDI (GCPtr pGCsrc, unsigned long ulMask, GCPtr pGCdst)
+{
+
+}
+
+
+/* See Porting Layer Definition - p. 46 */
+void
+winDestroyGCNativeGDI (GCPtr pGC)
+{
+ winGCPriv(pGC);
+
+ /* Free the memory DC */
+ if (pGCPriv->hdcMem != NULL)
+ {
+ DeleteDC (pGCPriv->hdcMem);
+ pGCPriv->hdcMem = NULL;
+ }
+
+ /* Invalidate the screen DC pointer */
+ pGCPriv->hdc = NULL;
+
+ /* Invalidate the GC privates pointer */
+ winSetGCPriv (pGC, NULL);
+}
+
+
+/* See Porting Layer Definition - p. 46 */
+void
+winChangeClipNativeGDI (GCPtr pGC, int nType, pointer pValue, int nRects)
+{
+
+}
+
+
+/* See Porting Layer Definition - p. 47 */
+void
+winDestroyClipNativeGDI (GCPtr pGC)
+{
+
+}
+
+
+/* See Porting Layer Definition - p. 47 */
+void
+winCopyClipNativeGDI (GCPtr pGCdst, GCPtr pGCsrc)
+{
+
+}
diff --git a/hw/xwin/wingetsp.c b/hw/xwin/wingetsp.c
new file mode 100644
index 000000000..637debb9e
--- /dev/null
+++ b/hw/xwin/wingetsp.c
@@ -0,0 +1,164 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/wingetsp.c,v 1.7 2001/11/01 12:19:40 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 55 */
+void
+winGetSpansNativeGDI (DrawablePtr pDrawable,
+ int nMax,
+ DDXPointPtr pPoints,
+ int *piWidths,
+ int iSpans,
+ char *pDsts)
+{
+ PixmapPtr pPixmap = NULL;
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ int iSpan;
+ DDXPointPtr pPoint = NULL;
+ int *piWidth = NULL;
+ char *pDst = pDsts;
+ int iBytesToCopy;
+ HBITMAP hbmpWindow, hbmpOrig;
+ BYTE *pbWindow = NULL;
+ HDC hdcMem;
+ ScreenPtr pScreen = pDrawable->pScreen;
+ winScreenPriv(pScreen);
+ int iByteWidth;
+
+ /* Branch on the drawable type */
+ switch (pDrawable->type)
+ {
+ case DRAWABLE_PIXMAP:
+ ErrorF ("winGetSpans - DRAWABLE_PIXMAP %08x\n",
+ pDrawable);
+
+ pPixmap = (PixmapPtr) pDrawable;
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ /* Loop through spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ pPoint = pPoints + iSpan;
+ piWidth = piWidths + iSpan;
+
+ iBytesToCopy = PixmapBytePad (*piWidth, pDrawable->depth);
+
+ memcpy (pDst,
+ pPixmapPriv->pbBits
+ + pPixmapPriv->dwScanlineBytes * pPoint->y,
+ iBytesToCopy);
+
+ ErrorF ("(%dx%dx%d) (%d,%d) w: %d\n",
+ pDrawable->width, pDrawable->height, pDrawable->depth,
+ pPoint->x, pPoint->y, *piWidth);
+
+ /* Calculate offset of next bit destination */
+ pDst += 4 * ((*piWidth + 31) / 32);
+ }
+ break;
+
+ case DRAWABLE_WINDOW:
+ ErrorF ("winGetSpans - DRAWABLE_WINDOW\n");
+
+ /*
+ * FIXME: Making huge assumption here that we are copying the
+ * area behind where the cursor will be displayed. We already
+ * know the size of the cursor, so this works, for now.
+ */
+
+ /* Create a bitmap to blit the window data to */
+ hbmpWindow = winCreateDIBNativeGDI (*piWidths,
+ *piWidths,
+ pDrawable->depth,
+ &pbWindow,
+ NULL);
+
+ /* Open a memory HDC */
+ hdcMem = CreateCompatibleDC (NULL);
+
+ /* Select the window bitmap */
+ hbmpOrig = SelectObject (hdcMem, hbmpWindow);
+
+ /* Transfer the window bits to the window bitmap */
+ BitBlt (hdcMem,
+ 0, 0,
+ *piWidths, *piWidths, /* FIXME: Assuming square region */
+ pScreenPriv->hdcScreen,
+ pPoints->x, pPoints->y,
+ SRCCOPY);
+
+ /* Pop the window bitmap out of the HDC */
+ SelectObject (hdcMem, hbmpOrig);
+
+ /* Delete the memory HDC */
+ DeleteDC (hdcMem);
+ hdcMem = NULL;
+
+ iByteWidth = PixmapBytePad (*piWidths, pDrawable->depth);
+
+ /* Loop through spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ pPoint = pPoints + iSpan;
+ piWidth = piWidths + iSpan;
+
+ iBytesToCopy = PixmapBytePad (*piWidth, pDrawable->depth);
+
+ memcpy (pDst,
+ pbWindow + iByteWidth * (pPoint->y - pPoints->y),
+ iBytesToCopy);
+
+ ErrorF ("(%dx%dx%d) (%d,%d) w: %d\n",
+ pDrawable->width, pDrawable->height, pDrawable->depth,
+ pPoint->x, pPoint->y, *piWidth);
+
+ /* Calculate offset of next bit destination */
+ pDst += 4 * ((*piWidth + 31) / 32);
+ }
+
+ /* Delete the window bitmap */
+ DeleteObject (hbmpWindow);
+ break;
+
+ case UNDRAWABLE_WINDOW:
+ FatalError ("winGetSpans - UNDRAWABLE_WINDOW\n");
+ break;
+
+ case DRAWABLE_BUFFER:
+ FatalError ("winGetSpans - DRAWABLE_BUFFER\n");
+ break;
+
+ default:
+ FatalError ("winGetSpans - Unknown drawable type\n");
+ break;
+ }
+}
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
new file mode 100644
index 000000000..20df053c2
--- /dev/null
+++ b/hw/xwin/winkeybd.c
@@ -0,0 +1,707 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.c,v 1.12 2002/10/17 08:18:22 alanh Exp $ */
+
+
+#include "win.h"
+#include "winkeybd.h"
+#include "winconfig.h"
+
+#ifdef XKB
+#define XKB_IN_SERVER
+#include "XKBsrv.h"
+#endif
+
+static Bool g_winKeyState[NUM_KEYCODES];
+
+
+#if WIN_NEW_KEYBOARD_SUPPORT
+
+const unsigned int MaxKeysPerKey = 4;
+
+void
+winProcessKeyEvent (DWORD dwVirtualKey, DWORD dwKeyData)
+{
+ Bool fDown = ((dwKeyData & 0x80000000) == 0);
+ winKeyEventsRec kerEvent;
+ int i;
+
+ /* Get the key events */
+ kerEvent = winTranslateKey (dwVirtualKey, dwKeyData);
+
+ if (kerEvent.dwReleaseModifiers & WIN_MOD_LCONTROL)
+ winSendKeyEvent (XK_Control_L, FALSE);
+ if (kerEvent.dwReleaseModifiers & WIN_MOD_RCONTROL)
+ winSendKeyEvent (XK_Control_R, FALSE);
+ if (kerEvent.dwReleaseModifiers & WIN_MOD_LALT)
+ winSendKeyEvent (XK_Alt_L, FALSE);
+ if (kerEvent.dwReleaseModifiers & WIN_MOD_RALT)
+ winSendKeyEvent (XK_Alt_R, FALSE);
+
+ for (i = 0; kerEvent.dwXKeycodes[i] != XK_VoidSymbol; ++i)
+ winSendKeyEvent (kerEvent.dwXKeycodes[i], fDown);
+
+ if (kerEvent.dwReleaseModifiers & WIN_MOD_LCONTROL)
+ winSendKeyEvent (XK_Control_L, FALSE);
+ if (kerEvent.dwReleaseModifiers & WIN_MOD_RCONTROL)
+ winSendKeyEvent (XK_Control_R, TRUE);
+ if (kerEvent.dwReleaseModifiers & WIN_MOD_LALT)
+ winSendKeyEvent (XK_Alt_L, FALSE);
+ if (kerEvent.dwReleaseModifiers & WIN_MOD_RALT)
+ winSendKeyEvent (XK_Alt_R, TRUE);
+
+}
+
+
+winKeyEventsRec
+winTranslateKey (DWORD dwVirtualKey, DWORD dwKeyData)
+{
+ winKeyEventsRec kerEvents;
+ Bool fExtended = ((HIWORD (dwKeyData) & KF_EXTENDED) != 0);
+ int i;
+ DWORD dwNumEvents = 0;
+ BYTE bKeyboardState[256];
+ int iReturn;
+ unsigned char cAscii[4];
+
+ /* Remap extended modifiers to the right version of that key. */
+ if (fExtended)
+ {
+ switch (dwVirtualKey)
+ {
+ case VK_MENU:
+ dwVirtualKey = VK_RMENU;
+ break;
+
+ case VK_CONTROL:
+ dwVirtualKey = VK_RCONTROL;
+ break;
+ }
+ }
+
+ /* Initialize the modifiers to release flag */
+ kerEvents.dwReleaseModifiers = 0;
+
+ /* Look up the current virtual key code in the translation table */
+ for (i = 0; i < g_winKeymapEntries; ++i)
+ {
+ /* Did we find a mapping? */
+ if (winKeymap[i].dwVirtualKey == dwVirtualKey)
+ {
+ /* Mapping found, we have at least one event now */
+ kerEvents.dwXKeycodes[dwNumEvents] = winKeymap[i].dwXKey;
+ break;
+ }
+ }
+
+
+ /* Break out early, if we found the key in the translation table */
+ if (dwNumEvents != 0)
+ {
+ /* Terminate the last of the key events with a void symbol */
+ kerEvents.dwXKeycodes[dwNumEvents] = XK_VoidSymbol;
+ return kerEvents;
+ }
+
+ /* Get the state of all keyboard keys */
+ GetKeyboardState (bKeyboardState);
+
+ /* Try to convert the key to ASCII */
+ iReturn = ToAscii (dwVirtualKey, 0, bKeyboardState, (WORD *) cAscii, 0);
+
+ /*
+ * Left Control and Alt pressed, combined with a valid result
+ * from ToAscii means that we have found the Windows version of AltGr.
+ */
+ if ((bKeyboardState[VK_MENU] & 0x80) && (bKeyboardState[VK_CONTROL] & 0x80)
+ && (iReturn >= 1)
+ && (((cAscii[0] >= 32) && (cAscii[0] <= 126))
+ || (cAscii[0] >= 160)))
+ {
+ /* These three calls will return 0 on Windows 95/98/Me */
+ if ((GetKeyState (VK_LCONTROL) & KF_UP))
+ kerEvents.dwReleaseModifiers |= WIN_MOD_LCONTROL;
+ if ((GetKeyState (VK_LMENU) & KF_UP))
+ kerEvents.dwReleaseModifiers |= WIN_MOD_LALT;
+ if ((GetKeyState (VK_RMENU) & KF_UP))
+ kerEvents.dwReleaseModifiers |= WIN_MOD_RALT;
+
+ /* Windows 95/98/Me handling - pop all of them */
+ if (kerEvents.dwReleaseModifiers == 0)
+ kerEvents.dwReleaseModifiers
+ = WIN_MOD_LCONTROL | WIN_MOD_LALT | WIN_MOD_RALT;
+
+ /* Copy the string of character events */
+ for (i = 0; i < iReturn; ++i)
+ kerEvents.dwXKeycodes[dwNumEvents++] = cAscii[i];
+ }
+
+ /* Handle non Ctrl+Alt cases*/
+ if (dwNumEvents == 0)
+ {
+ bKeyboardState[VK_CONTROL] = 0;
+ bKeyboardState[VK_LCONTROL] = 0;
+ bKeyboardState[VK_RCONTROL] = 0;
+
+ iReturn = ToAscii (dwVirtualKey, 0, bKeyboardState, (WORD *)cAscii, 0);
+ if (iReturn < 0)
+ {
+ switch (cAscii[0])
+ {
+ case '`':
+ kerEvents.dwXKeycodes[dwNumEvents++] = XK_dead_grave;
+ break;
+
+ case '\'':
+ kerEvents.dwXKeycodes[dwNumEvents++] = XK_dead_acute;
+ break;
+
+ case '~':
+ kerEvents.dwXKeycodes[dwNumEvents++] = XK_dead_tilde;
+ break;
+
+ case '^':
+ kerEvents.dwXKeycodes[dwNumEvents++] = XK_dead_circumflex;
+ break;
+ }
+ }
+
+ /* Send what we've got if its a printable character */
+ if (iReturn >= 1)
+ for (i = 0; i < iReturn; ++i)
+ kerEvents.dwXKeycodes[dwNumEvents++] = cAscii[i];
+ }
+
+
+ /* Terminate the last of the key events with a void symbol */
+ kerEvents.dwXKeycodes[dwNumEvents] = XK_VoidSymbol;
+ return kerEvents;
+}
+
+
+#else /* WIN_NEW_KEYBOARD_SUPPORT */
+
+
+/*
+ * Translate a Windows WM_[SYS]KEY(UP/DOWN) message
+ * into an ASCII scan code.
+ *
+ * We do this ourselves, rather than letting Windows handle it,
+ * because Windows tends to munge the handling of special keys,
+ * like AltGr on European keyboards.
+ */
+
+void
+winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode)
+{
+ int iKeyFixup = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 1];
+ int iKeyFixupEx = g_iKeyMap[wParam * WIN_KEYMAP_COLS + 2];
+
+ /* Branch on special extended, special non-extended, or normal key */
+ if ((HIWORD (lParam) & KF_EXTENDED) && iKeyFixupEx)
+ *piScanCode = iKeyFixupEx;
+ else if (iKeyFixup)
+ *piScanCode = iKeyFixup;
+ else
+ *piScanCode = LOBYTE (HIWORD (lParam));
+}
+
+#endif /* WIN_NEW_KEYBOARD_SUPPORT */
+
+
+/*
+ * We call this function from winKeybdProc when we are
+ * initializing the keyboard.
+ */
+
+void
+winGetKeyMappings (KeySymsPtr pKeySyms, CARD8 *pModMap)
+{
+ int i;
+ KeySym *pMap = map;
+ KeySym *pKeySym;
+
+ /*
+ * Initialize all key states to up... which may not be true
+ * but it is close enough.
+ */
+ ZeroMemory (g_winKeyState, sizeof (g_winKeyState[0]) * NUM_KEYCODES);
+
+ /* MAP_LENGTH is defined in Xserver/include/input.h to be 256 */
+ for (i = 0; i < MAP_LENGTH; i++)
+ pModMap[i] = NoSymbol; /* make sure it is restored */
+
+ /* Loop through all valid entries in the key symbol table */
+ for (pKeySym = pMap, i = MIN_KEYCODE;
+ i < (MIN_KEYCODE + NUM_KEYCODES);
+ i++, pKeySym += GLYPHS_PER_KEY)
+ {
+ switch (*pKeySym)
+ {
+ case XK_Shift_L:
+ case XK_Shift_R:
+ pModMap[i] = ShiftMask;
+ break;
+
+ case XK_Control_L:
+ case XK_Control_R:
+ pModMap[i] = ControlMask;
+ break;
+
+ case XK_Caps_Lock:
+ pModMap[i] = LockMask;
+ break;
+
+ case XK_Alt_L:
+ case XK_Alt_R:
+ pModMap[i] = AltMask;
+ break;
+
+#if !WIN_NEW_KEYBOARD_SUPPORT
+ case XK_Num_Lock:
+ pModMap[i] = NumLockMask;
+ break;
+
+ case XK_Scroll_Lock:
+ pModMap[i] = ScrollLockMask;
+ break;
+
+ /* Hirigana/Katakana toggle */
+ case XK_Kana_Lock:
+ case XK_Kana_Shift:
+ pModMap[i] = KanaMask;
+ break;
+#endif
+
+ /* alternate toggle for multinational support */
+ case XK_Mode_switch:
+ pModMap[i] = AltLangMask;
+ break;
+ }
+ }
+
+ pKeySyms->map = (KeySym *) pMap;
+ pKeySyms->mapWidth = GLYPHS_PER_KEY;
+ pKeySyms->minKeyCode = MIN_KEYCODE;
+ pKeySyms->maxKeyCode = MAX_KEYCODE;
+}
+
+
+/* Ring the keyboard bell (system speaker on PCs) */
+void
+winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt,
+ pointer pCtrl, int iClass)
+{
+ /*
+ * We can't use Beep () here because it uses the PC speaker
+ * on NT/2000. MessageBeep (MB_OK) will play the default system
+ * sound on systems with a sound card or it will beep the PC speaker
+ * on systems that do not have a sound card.
+ */
+ MessageBeep (MB_OK);
+}
+
+
+/* Change some keyboard configuration parameters */
+void
+winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
+{
+
+}
+
+
+/*
+ * See Porting Layer Definition - p. 18
+ * winKeybdProc is known as a DeviceProc.
+ */
+
+int
+winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
+{
+ KeySymsRec keySyms;
+ CARD8 modMap[MAP_LENGTH];
+ DevicePtr pDevice = (DevicePtr) pDeviceInt;
+#ifdef XKB
+ XkbComponentNamesRec names;
+#endif
+
+ switch (iState)
+ {
+ case DEVICE_INIT:
+ winConfigKeyboard (pDeviceInt);
+
+ winGetKeyMappings (&keySyms, modMap);
+
+#ifdef XKB
+ /* FIXME: Maybe we should use winGetKbdLeds () here? */
+ defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
+#else
+ defaultKeyboardControl.leds = g_winInfo.keyboard.leds;
+#endif
+
+#ifdef XKB
+ if (g_winInfo.xkb.disable)
+ {
+#endif
+ InitKeyboardDeviceStruct (pDevice,
+ &keySyms,
+ modMap,
+ winKeybdBell,
+ winKeybdCtrl);
+#ifdef XKB
+ }
+ else
+ {
+
+ if (XkbInitialMap)
+ {
+ names.keymap = XkbInitialMap;
+ names.keycodes = NULL;
+ names.types = NULL;
+ names.compat = NULL;
+ names.symbols = NULL;
+ names.geometry = NULL;
+ }
+ else
+ {
+ names.keymap = g_winInfo.xkb.keymap;
+ names.keycodes = g_winInfo.xkb.keycodes;
+ names.types = g_winInfo.xkb.types;
+ names.compat = g_winInfo.xkb.compat;
+ names.symbols = g_winInfo.xkb.symbols;
+ names.geometry = g_winInfo.xkb.geometry;
+ }
+
+ ErrorF("Rules = \"%s\" Model = \"%s\" Layout = \"%s\""
+ " Variant = \"%s\" Options = \"%s\"\n",
+ g_winInfo.xkb.rules, g_winInfo.xkb.model,
+ g_winInfo.xkb.layout, g_winInfo.xkb.variant,
+ g_winInfo.xkb.options);
+
+ XkbSetRulesDflts (g_winInfo.xkb.rules, g_winInfo.xkb.model,
+ g_winInfo.xkb.layout, g_winInfo.xkb.variant,
+ g_winInfo.xkb.options);
+ XkbInitKeyboardDeviceStruct (pDeviceInt, &names, &keySyms,
+ modMap, winKeybdBell, winKeybdCtrl);
+ }
+#endif
+ break;
+ case DEVICE_ON:
+ pDevice->on = TRUE;
+ break;
+
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pDevice->on = FALSE;
+ break;
+ }
+
+ return Success;
+}
+
+
+/*
+ * Detect current mode key states upon server startup.
+ *
+ * Simulate a press and release of any key that is currently
+ * toggled.
+ */
+
+void
+winInitializeModeKeyStates (void)
+{
+#if !WIN_NEW_KEYBOARD_SUPPORT
+ /* Restore NumLock */
+ if (GetKeyState (VK_NUMLOCK) & 0x0001)
+ {
+ winSendKeyEvent (KEY_NumLock, TRUE);
+ winSendKeyEvent (KEY_NumLock, FALSE);
+ }
+
+ /* Restore CapsLock */
+ if (GetKeyState (VK_CAPITAL) & 0x0001)
+ {
+ winSendKeyEvent (KEY_CapsLock, TRUE);
+ winSendKeyEvent (KEY_CapsLock, FALSE);
+ }
+
+ /* Restore ScrollLock */
+ if (GetKeyState (VK_SCROLL) & 0x0001)
+ {
+ winSendKeyEvent (KEY_ScrollLock, TRUE);
+ winSendKeyEvent (KEY_ScrollLock, FALSE);
+ }
+
+ /* Restore KanaLock */
+ if (GetKeyState (VK_KANA) & 0x0001)
+ {
+ winSendKeyEvent (KEY_HKTG, TRUE);
+ winSendKeyEvent (KEY_HKTG, FALSE);
+ }
+#endif
+}
+
+
+/*
+ * We have to store the last state of each mode
+ * key before we lose the keyboard focus.
+ */
+
+void
+winStoreModeKeyStates (ScreenPtr pScreen)
+{
+#if !WIN_NEW_KEYBOARD_SUPPORT
+ winScreenPriv(pScreen);
+
+ /* Initialize all mode key states to off */
+ pScreenPriv->dwModeKeyStates = 0x0L;
+
+ pScreenPriv->dwModeKeyStates |=
+ (GetKeyState (VK_NUMLOCK) & 0x0001) << NumLockMapIndex;
+
+ pScreenPriv->dwModeKeyStates |=
+ (GetKeyState (VK_SCROLL) & 0x0001) << ScrollLockMapIndex;
+
+ pScreenPriv->dwModeKeyStates |=
+ (GetKeyState (VK_CAPITAL) & 0x0001) << LockMapIndex;
+
+ pScreenPriv->dwModeKeyStates |=
+ (GetKeyState (VK_KANA) & 0x0001) << KanaMapIndex;
+#endif
+}
+
+
+/*
+ * Upon regaining the keyboard focus we must
+ * resynchronize our internal mode key states
+ * with the actual state of the keys.
+ */
+
+void
+winRestoreModeKeyStates (ScreenPtr pScreen)
+{
+#if !WIN_NEW_KEYBOARD_SUPPORT
+ winScreenPriv(pScreen);
+ DWORD dwKeyState;
+
+ /*
+ * NOTE: The C XOR operator, ^, will not work here because it is
+ * a bitwise operator, not a logical operator. C does not
+ * have a logical XOR operator, so we use a macro instead.
+ */
+
+ /* Has the key state changed? */
+ dwKeyState = GetKeyState (VK_NUMLOCK) & 0x0001;
+ if (WIN_XOR (pScreenPriv->dwModeKeyStates & NumLockMask, dwKeyState))
+ {
+ winSendKeyEvent (KEY_NumLock, TRUE);
+ winSendKeyEvent (KEY_NumLock, FALSE);
+ }
+
+ /* Has the key state changed? */
+ dwKeyState = GetKeyState (VK_CAPITAL) & 0x0001;
+ if (WIN_XOR (pScreenPriv->dwModeKeyStates & LockMask, dwKeyState))
+ {
+ winSendKeyEvent (KEY_CapsLock, TRUE);
+ winSendKeyEvent (KEY_CapsLock, FALSE);
+ }
+
+ /* Has the key state changed? */
+ dwKeyState = GetKeyState (VK_SCROLL) & 0x0001;
+ if (WIN_XOR (pScreenPriv->dwModeKeyStates & ScrollLockMask, dwKeyState))
+ {
+ winSendKeyEvent (KEY_ScrollLock, TRUE);
+ winSendKeyEvent (KEY_ScrollLock, FALSE);
+ }
+
+ /* Has the key state changed? */
+ dwKeyState = GetKeyState (VK_KANA) & 0x0001;
+ if (WIN_XOR (pScreenPriv->dwModeKeyStates & KanaMask, dwKeyState))
+ {
+ winSendKeyEvent (KEY_HKTG, TRUE);
+ winSendKeyEvent (KEY_HKTG, FALSE);
+ }
+#endif
+}
+
+
+#if !WIN_NEW_KEYBOARD_SUPPORT
+/*
+ * Look for the lovely fake Control_L press/release generated by Windows
+ * when AltGr is pressed/released on a non-U.S. keyboard.
+ */
+
+Bool
+winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam)
+{
+ MSG msgNext;
+ LONG lTime;
+ Bool fReturn;
+
+ /*
+ * Fake Ctrl_L presses will be followed by an Alt_R keypress
+ * with the same timestamp as the Ctrl_L press.
+ */
+ if (message == WM_KEYDOWN
+ && wParam == VK_CONTROL
+ && (HIWORD (lParam) & KF_EXTENDED) == 0)
+ {
+ /* Got a Ctrl_L press */
+
+ /* Get time of current message */
+ lTime = GetMessageTime ();
+
+ /* Look for fake Ctrl_L preceeding an Alt_R press. */
+ fReturn = PeekMessage (&msgNext, NULL,
+ WM_KEYDOWN, WM_KEYDOWN,
+ PM_NOREMOVE);
+
+ /* Is next press an Alt_R with the same timestamp? */
+ if (fReturn && msgNext.wParam == VK_MENU
+ && msgNext.time == lTime
+ && (HIWORD (msgNext.lParam) & KF_EXTENDED))
+ {
+ /*
+ * Next key press is Alt_R with same timestamp as current
+ * Ctrl_L message. Therefore, this Ctrl_L press is a fake
+ * event, so discard it.
+ */
+ return TRUE;
+ }
+ }
+
+ /*
+ * Fake Ctrl_L releases will be followed by an Alt_R release
+ * with the same timestamp as the Ctrl_L release.
+ */
+ if ((message == WM_KEYUP || message == WM_SYSKEYUP)
+ && wParam == VK_CONTROL
+ && (HIWORD (lParam) & KF_EXTENDED) == 0)
+ {
+ /* Got a Ctrl_L release */
+
+ /* Get time of current message */
+ lTime = GetMessageTime ();
+
+ /* Look for fake Ctrl_L release preceeding an Alt_R release. */
+ fReturn = PeekMessage (&msgNext, NULL,
+ WM_KEYUP, WM_SYSKEYUP,
+ PM_NOREMOVE);
+
+ /* Is next press an Alt_R with the same timestamp? */
+ if (fReturn
+ && (msgNext.message == WM_KEYUP
+ || msgNext.message == WM_SYSKEYUP)
+ && msgNext.wParam == VK_MENU
+ && msgNext.time == lTime
+ && (HIWORD (msgNext.lParam) & KF_EXTENDED))
+ {
+ /*
+ * Next key release is Alt_R with same timestamp as current
+ * Ctrl_L message. Therefore, this Ctrl_L release is a fake
+ * event, so discard it.
+ */
+ return TRUE;
+ }
+ }
+
+ /* Not a fake control left press/release */
+ return FALSE;
+}
+#endif /* WIN_NEW_KEYBOARD_SUPPORT */
+
+
+/*
+ * Lift any modifier keys that are pressed
+ */
+
+void
+winKeybdReleaseKeys ()
+{
+#if !WIN_NEW_KEYBOARD_SUPPORT
+#if 0 /* Old function that just pops modifiers */
+ /* Verify that the mi input system has been initialized */
+ if (g_fdMessageQueue == WIN_FD_INVALID)
+ return;
+
+ winSendKeyEvent (KEY_Alt, FALSE);
+ winSendKeyEvent (KEY_AltLang, FALSE);
+ winSendKeyEvent (KEY_LCtrl, FALSE);
+ winSendKeyEvent (KEY_RCtrl, FALSE);
+ winSendKeyEvent (KEY_ShiftL, FALSE);
+ winSendKeyEvent (KEY_ShiftR, FALSE);
+#else /* New function that pops all keys */
+ int i;
+
+ /* Verify that the mi input system has been initialized */
+ if (g_fdMessageQueue == WIN_FD_INVALID)
+ return;
+
+ /* Pop any pressed keys */
+ for (i = 0; i < NUM_KEYCODES; ++i)
+ {
+ if (g_winKeyState[i]) winSendKeyEvent (i, FALSE);
+ }
+#endif
+#endif
+}
+
+
+/*
+ * Take a raw X key code and send an up or down event for it.
+ *
+ * Thanks to VNC for inspiration, though it is a simple function.
+ */
+
+void
+winSendKeyEvent (DWORD dwKey, Bool fDown)
+{
+ xEvent xCurrentEvent;
+
+ /*
+ * When alt-tabing between screens we can get phantom key up messages
+ * Here we only pass them through it we think we should!
+ */
+ if (g_winKeyState[dwKey] == FALSE && fDown == FALSE) return;
+
+ /* Update the keyState map */
+ g_winKeyState[dwKey] = fDown;
+
+ ZeroMemory (&xCurrentEvent, sizeof (xCurrentEvent));
+
+ xCurrentEvent.u.u.type = fDown ? KeyPress : KeyRelease;
+ xCurrentEvent.u.keyButtonPointer.time =
+ g_c32LastInputEventTime = GetTickCount ();
+ xCurrentEvent.u.u.detail = dwKey + MIN_KEYCODE;
+ mieqEnqueue (&xCurrentEvent);
+}
diff --git a/hw/xwin/winkeybd.h b/hw/xwin/winkeybd.h
new file mode 100644
index 000000000..0822b0e5f
--- /dev/null
+++ b/hw/xwin/winkeybd.h
@@ -0,0 +1,398 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.h,v 1.3 2002/07/05 09:19:26 alanh Exp $ */
+
+/*
+ * We need symbols for the scan codes of keys.
+ */
+#include "../xfree86/common/atKeynames.h"
+
+
+/*
+ * Include the standard XFree86 ASCII keymap.
+ *
+ * This header declares a static KeySym array called 'map'.
+ */
+#include "../xfree86/common/xf86Keymap.h"
+
+
+#if WIN_NEW_KEYBOARD_SUPPORT
+
+/* Define the keymap structure */
+typedef struct
+{
+ DWORD dwVirtualKey;
+ DWORD dwXKey;
+} winKeymappingRec, *winKeymappingPtr;
+
+static const winKeymappingRec
+winKeymap[] = {
+ {VK_BACK, XK_BackSpace},
+ {VK_TAB, XK_Tab},
+ {VK_CLEAR, XK_Clear},
+ {VK_RETURN, XK_Return},
+ {VK_LSHIFT, XK_Shift_L},
+ {VK_RSHIFT, XK_Shift_R},
+ {VK_SHIFT, XK_Shift_L},
+ {VK_LCONTROL, XK_Control_L},
+ {VK_RCONTROL, XK_Control_R},
+ {VK_CONTROL, XK_Control_L},
+ {VK_LMENU, XK_Alt_L},
+ {VK_RMENU, XK_Alt_R},
+ {VK_MENU, XK_Alt_L},
+ {VK_PAUSE, XK_Pause},
+ {VK_CAPITAL, XK_Caps_Lock},
+ {VK_ESCAPE, XK_Escape},
+ {VK_SPACE, XK_space},
+ {VK_PRIOR, XK_Page_Up},
+ {VK_NEXT, XK_Page_Down},
+ {VK_END, XK_End},
+ {VK_HOME, XK_Home},
+ {VK_LEFT, XK_Left},
+ {VK_UP, XK_Up},
+ {VK_RIGHT, XK_Right},
+ {VK_DOWN, XK_Down},
+ {VK_SELECT, XK_Select},
+ {VK_EXECUTE, XK_Execute},
+ {VK_SNAPSHOT, XK_Print},
+ {VK_INSERT, XK_Insert},
+ {VK_DELETE, XK_Delete},
+ {VK_HELP, XK_Help},
+ {VK_NUMPAD0, XK_KP_0},
+ {VK_NUMPAD1, XK_KP_1},
+ {VK_NUMPAD2, XK_KP_2},
+ {VK_NUMPAD3, XK_KP_3},
+ {VK_NUMPAD4, XK_KP_4},
+ {VK_NUMPAD5, XK_KP_5},
+ {VK_NUMPAD6, XK_KP_6},
+ {VK_NUMPAD7, XK_KP_7},
+ {VK_NUMPAD8, XK_KP_8},
+ {VK_NUMPAD9, XK_KP_9},
+ {VK_MULTIPLY, XK_KP_Multiply},
+ {VK_ADD, XK_KP_Add},
+ {VK_SEPARATOR, XK_KP_Separator}, // often comma
+ {VK_SUBTRACT, XK_KP_Subtract},
+ {VK_DECIMAL, XK_KP_Decimal},
+ {VK_DIVIDE, XK_KP_Divide},
+ {VK_F1, XK_F1},
+ {VK_F2, XK_F2},
+ {VK_F3, XK_F3},
+ {VK_F4, XK_F4},
+ {VK_F5, XK_F5},
+ {VK_F6, XK_F6},
+ {VK_F7, XK_F7},
+ {VK_F8, XK_F8},
+ {VK_F9, XK_F9},
+ {VK_F10, XK_F10},
+ {VK_F11, XK_F11},
+ {VK_F12, XK_F12},
+ {VK_F13, XK_F13},
+ {VK_F14, XK_F14},
+ {VK_F15, XK_F15},
+ {VK_F16, XK_F16},
+ {VK_F17, XK_F17},
+ {VK_F18, XK_F18},
+ {VK_F19, XK_F19},
+ {VK_F20, XK_F20},
+ {VK_F21, XK_F21},
+ {VK_F22, XK_F22},
+ {VK_F23, XK_F23},
+ {VK_F24, XK_F24},
+ {VK_NUMLOCK, XK_Num_Lock},
+ {VK_SCROLL, XK_Scroll_Lock}
+};
+
+static int g_winKeymapEntries = sizeof (winKeymap) / sizeof (winKeymappingRec);
+
+#else /* WIN_NEW_KEYBOARD_SUPPORT */
+
+#define WIN_KEYMAP_COLS 3
+
+const int
+g_iKeyMap [] = {
+ /* count Windows VK, ASCII, ASCII when extended VK */
+ /* 0 */ 0, 0, 0,
+ /* 1 */ 0, 0, 0,
+ /* 2 */ 0, 0, 0,
+ /* 3 */ VK_CANCEL, 0, KEY_Break,
+ /* 4 */ 0, 0, 0,
+ /* 5 */ 0, 0, 0,
+ /* 6 */ 0, 0, 0,
+ /* 7 */ 0, 0, 0,
+ /* 8 */ 0, 0, 0,
+ /* 9 */ 0, 0, 0,
+ /* 10 */ 0, 0, 0,
+ /* 11 */ 0, 0, 0,
+ /* 12 */ 0, 0, 0,
+ /* 13 */ VK_RETURN, 0, KEY_KP_Enter,
+ /* 14 */ 0, 0, 0,
+ /* 15 */ 0, 0, 0,
+ /* 16 */ VK_SHIFT, KEY_ShiftL, KEY_ShiftR,
+ /* 17 */ VK_CONTROL, 0, KEY_RCtrl,
+ /* 18 */ VK_MENU, 0, KEY_AltLang,
+ /* 19 */ VK_PAUSE, KEY_Pause, 0,
+ /* 20 */ 0, 0, 0,
+ /* 21 */ 0, 0, 0,
+ /* 22 */ 0, 0, 0,
+ /* 23 */ 0, 0, 0,
+ /* 24 */ 0, 0, 0,
+ /* 25 */ 0, 0, 0,
+ /* 26 */ 0, 0, 0,
+ /* 27 */ 0, 0, 0,
+ /* 28 */ 0, 0, 0,
+ /* 29 */ 0, 0, 0,
+ /* 30 */ 0, 0, 0,
+ /* 31 */ 0, 0, 0,
+ /* 32 */ 0, 0, 0,
+ /* 33 */ VK_PRIOR, 0, KEY_PgUp,
+ /* 34 */ VK_NEXT, 0, KEY_PgDown,
+ /* 35 */ VK_END, 0, KEY_End,
+ /* 36 */ VK_HOME, 0, KEY_Home,
+ /* 37 */ VK_LEFT, 0, KEY_Left,
+ /* 38 */ VK_UP, 0, KEY_Up,
+ /* 39 */ VK_RIGHT, 0, KEY_Right,
+ /* 40 */ VK_DOWN, 0, KEY_Down,
+ /* 41 */ 0, 0, 0,
+ /* 42 */ 0, 0, 0,
+ /* 43 */ 0, 0, 0,
+ /* 44 */ VK_SNAPSHOT, 0, KEY_Print,
+ /* 45 */ VK_INSERT, 0, KEY_Insert,
+ /* 46 */ VK_DELETE, 0, KEY_Delete,
+ /* 47 */ 0, 0, 0,
+ /* 48 */ 0, 0, 0,
+ /* 49 */ 0, 0, 0,
+ /* 50 */ 0, 0, 0,
+ /* 51 */ 0, 0, 0,
+ /* 52 */ 0, 0, 0,
+ /* 53 */ 0, 0, 0,
+ /* 54 */ 0, 0, 0,
+ /* 55 */ 0, 0, 0,
+ /* 56 */ 0, 0, 0,
+ /* 57 */ 0, 0, 0,
+ /* 58 */ 0, 0, 0,
+ /* 59 */ 0, 0, 0,
+ /* 60 */ 0, 0, 0,
+ /* 61 */ 0, 0, 0,
+ /* 62 */ 0, 0, 0,
+ /* 63 */ 0, 0, 0,
+ /* 64 */ 0, 0, 0,
+ /* 65 */ 0, 0, 0,
+ /* 66 */ 0, 0, 0,
+ /* 67 */ 0, 0, 0,
+ /* 68 */ 0, 0, 0,
+ /* 69 */ 0, 0, 0,
+ /* 70 */ 0, 0, 0,
+ /* 71 */ 0, 0, 0,
+ /* 72 */ 0, 0, 0,
+ /* 73 */ 0, 0, 0,
+ /* 74 */ 0, 0, 0,
+ /* 75 */ 0, 0, 0,
+ /* 76 */ 0, 0, 0,
+ /* 77 */ 0, 0, 0,
+ /* 78 */ 0, 0, 0,
+ /* 79 */ 0, 0, 0,
+ /* 80 */ 0, 0, 0,
+ /* 81 */ 0, 0, 0,
+ /* 82 */ 0, 0, 0,
+ /* 83 */ 0, 0, 0,
+ /* 84 */ 0, 0, 0,
+ /* 85 */ 0, 0, 0,
+ /* 86 */ 0, 0, 0,
+ /* 87 */ 0, 0, 0,
+ /* 88 */ 0, 0, 0,
+ /* 89 */ 0, 0, 0,
+ /* 90 */ 0, 0, 0,
+ /* 91 */ 0, 0, 0,
+ /* 92 */ 0, 0, 0,
+ /* 93 */ 0, 0, 0,
+ /* 94 */ 0, 0, 0,
+ /* 95 */ 0, 0, 0,
+ /* 96 */ 0, 0, 0,
+ /* 97 */ 0, 0, 0,
+ /* 98 */ 0, 0, 0,
+ /* 99 */ 0, 0, 0,
+ /* 100 */ 0, 0, 0,
+ /* 101 */ 0, 0, 0,
+ /* 102 */ 0, 0, 0,
+ /* 103 */ 0, 0, 0,
+ /* 104 */ 0, 0, 0,
+ /* 105 */ 0, 0, 0,
+ /* 106 */ 0, 0, 0,
+ /* 107 */ 0, 0, 0,
+ /* 108 */ 0, 0, 0,
+ /* 109 */ 0, 0, 0,
+ /* 110 */ 0, 0, 0,
+ /* 111 */ VK_DIVIDE, 0, KEY_KP_Divide,
+ /* 112 */ 0, 0, 0,
+ /* 113 */ 0, 0, 0,
+ /* 114 */ 0, 0, 0,
+ /* 115 */ 0, 0, 0,
+ /* 116 */ 0, 0, 0,
+ /* 117 */ 0, 0, 0,
+ /* 118 */ 0, 0, 0,
+ /* 119 */ 0, 0, 0,
+ /* 120 */ 0, 0, 0,
+ /* 121 */ 0, 0, 0,
+ /* 122 */ 0, 0, 0,
+ /* 123 */ 0, 0, 0,
+ /* 124 */ 0, 0, 0,
+ /* 125 */ 0, 0, 0,
+ /* 126 */ 0, 0, 0,
+ /* 127 */ 0, 0, 0,
+ /* 128 */ 0, 0, 0,
+ /* 129 */ 0, 0, 0,
+ /* 130 */ 0, 0, 0,
+ /* 131 */ 0, 0, 0,
+ /* 132 */ 0, 0, 0,
+ /* 133 */ 0, 0, 0,
+ /* 134 */ 0, 0, 0,
+ /* 135 */ 0, 0, 0,
+ /* 136 */ 0, 0, 0,
+ /* 137 */ 0, 0, 0,
+ /* 138 */ 0, 0, 0,
+ /* 139 */ 0, 0, 0,
+ /* 140 */ 0, 0, 0,
+ /* 141 */ 0, 0, 0,
+ /* 142 */ 0, 0, 0,
+ /* 143 */ 0, 0, 0,
+ /* 144 */ 0, 0, 0,
+ /* 145 */ 0, 0, 0,
+ /* 146 */ 0, 0, 0,
+ /* 147 */ 0, 0, 0,
+ /* 148 */ 0, 0, 0,
+ /* 149 */ 0, 0, 0,
+ /* 150 */ 0, 0, 0,
+ /* 151 */ 0, 0, 0,
+ /* 152 */ 0, 0, 0,
+ /* 153 */ 0, 0, 0,
+ /* 154 */ 0, 0, 0,
+ /* 155 */ 0, 0, 0,
+ /* 156 */ 0, 0, 0,
+ /* 157 */ 0, 0, 0,
+ /* 158 */ 0, 0, 0,
+ /* 159 */ 0, 0, 0,
+ /* 160 */ 0, 0, 0,
+ /* 161 */ 0, 0, 0,
+ /* 162 */ 0, 0, 0,
+ /* 163 */ 0, 0, 0,
+ /* 164 */ 0, 0, 0,
+ /* 165 */ 0, 0, 0,
+ /* 166 */ 0, 0, 0,
+ /* 167 */ 0, 0, 0,
+ /* 168 */ 0, 0, 0,
+ /* 169 */ 0, 0, 0,
+ /* 170 */ 0, 0, 0,
+ /* 171 */ 0, 0, 0,
+ /* 172 */ 0, 0, 0,
+ /* 173 */ 0, 0, 0,
+ /* 174 */ 0, 0, 0,
+ /* 175 */ 0, 0, 0,
+ /* 176 */ 0, 0, 0,
+ /* 177 */ 0, 0, 0,
+ /* 178 */ 0, 0, 0,
+ /* 179 */ 0, 0, 0,
+ /* 180 */ 0, 0, 0,
+ /* 181 */ 0, 0, 0,
+ /* 182 */ 0, 0, 0,
+ /* 183 */ 0, 0, 0,
+ /* 184 */ 0, 0, 0,
+ /* 185 */ 0, 0, 0,
+ /* 186 */ 0, 0, 0,
+ /* 187 */ 0, 0, 0,
+ /* 188 */ 0, 0, 0,
+ /* 189 */ 0, 0, 0,
+ /* 190 */ 0, 0, 0,
+ /* 191 */ 0, 0, 0,
+ /* 192 */ 0, 0, 0,
+ /* 193 */ 0, 0, 0,
+ /* 194 */ 0, 0, 0,
+ /* 195 */ 0, 0, 0,
+ /* 196 */ 0, 0, 0,
+ /* 197 */ 0, 0, 0,
+ /* 198 */ 0, 0, 0,
+ /* 199 */ 0, 0, 0,
+ /* 200 */ 0, 0, 0,
+ /* 201 */ 0, 0, 0,
+ /* 202 */ 0, 0, 0,
+ /* 203 */ 0, 0, 0,
+ /* 204 */ 0, 0, 0,
+ /* 205 */ 0, 0, 0,
+ /* 206 */ 0, 0, 0,
+ /* 207 */ 0, 0, 0,
+ /* 208 */ 0, 0, 0,
+ /* 209 */ 0, 0, 0,
+ /* 210 */ 0, 0, 0,
+ /* 211 */ 0, 0, 0,
+ /* 212 */ 0, 0, 0,
+ /* 213 */ 0, 0, 0,
+ /* 214 */ 0, 0, 0,
+ /* 215 */ 0, 0, 0,
+ /* 216 */ 0, 0, 0,
+ /* 217 */ 0, 0, 0,
+ /* 218 */ 0, 0, 0,
+ /* 219 */ 0, 0, 0,
+ /* 220 */ 0, 0, 0,
+ /* 221 */ 0, 0, 0,
+ /* 222 */ 0, 0, 0,
+ /* 223 */ 0, 0, 0,
+ /* 224 */ 0, 0, 0,
+ /* 225 */ 0, 0, 0,
+ /* 226 */ 0, 0, 0,
+ /* 227 */ 0, 0, 0,
+ /* 228 */ 0, 0, 0,
+ /* 229 */ 0, 0, 0,
+ /* 230 */ 0, 0, 0,
+ /* 231 */ 0, 0, 0,
+ /* 232 */ 0, 0, 0,
+ /* 233 */ 0, 0, 0,
+ /* 234 */ 0, 0, 0,
+ /* 235 */ 0, 0, 0,
+ /* 236 */ 0, 0, 0,
+ /* 237 */ 0, 0, 0,
+ /* 238 */ 0, 0, 0,
+ /* 239 */ 0, 0, 0,
+ /* 240 */ 0, 0, 0,
+ /* 241 */ 0, 0, 0,
+ /* 242 */ 0, 0, 0,
+ /* 243 */ 0, 0, 0,
+ /* 244 */ 0, 0, 0,
+ /* 245 */ 0, 0, 0,
+ /* 246 */ 0, 0, 0,
+ /* 247 */ 0, 0, 0,
+ /* 248 */ 0, 0, 0,
+ /* 249 */ 0, 0, 0,
+ /* 250 */ 0, 0, 0,
+ /* 251 */ 0, 0, 0,
+ /* 252 */ 0, 0, 0,
+ /* 253 */ 0, 0, 0,
+ /* 254 */ 0, 0, 0,
+ /* 255 */ 0, 0, 0
+};
+#endif /* WIN_NEW_KEYBOARD_SUPPORT */
diff --git a/hw/xwin/winmisc.c b/hw/xwin/winmisc.c
new file mode 100644
index 000000000..ea8303ea9
--- /dev/null
+++ b/hw/xwin/winmisc.c
@@ -0,0 +1,147 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmisc.c,v 1.6 2002/07/05 09:19:26 alanh Exp $ */
+
+#include "win.h"
+
+
+/* See Porting Layer Definition - p. 33 */
+/*
+ * Called by clients, returns the best size for a cursor, tile, or
+ * stipple, specified by class (sometimes called kind)
+ */
+
+void
+winQueryBestSizeNativeGDI (int class, unsigned short *pWidth,
+ unsigned short *pHeight, ScreenPtr pScreen)
+{
+ ErrorF ("winQueryBestSizeNativeGDI\n");
+}
+
+
+/*
+ * Count the number of one bits in a color mask.
+ */
+
+CARD8
+winCountBits (DWORD dw)
+{
+ DWORD dwBits = 0;
+
+ while (dw)
+ {
+ dwBits += (dw & 1);
+ dw >>= 1;
+ }
+
+ return dwBits;
+}
+
+
+/*
+ * Modify the screen pixmap to point to the new framebuffer address
+ */
+
+Bool
+winUpdateFBPointer (ScreenPtr pScreen, void *pbits)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Location of shadow framebuffer has changed */
+ pScreenInfo->pfb = pbits;
+
+ /* Update the screen pixmap */
+ if (!(*pScreen->ModifyPixmapHeader) (pScreen->devPrivate,
+ pScreen->width,
+ pScreen->height,
+ pScreen->rootDepth,
+ BitsPerPixel (pScreen->rootDepth),
+ PixmapBytePad (pScreenInfo->dwStride,
+ pScreenInfo->dwBPP),
+ pScreenInfo->pfb))
+ {
+ FatalError ("winUpdateFramebufferPointer - Failed modifying "\
+ "screen pixmap\n");
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Paint the window background with the specified color
+ */
+
+BOOL
+winPaintBackground (HWND hwnd, COLORREF colorref)
+{
+ HDC hdc;
+ HBRUSH hbrush;
+ RECT rect;
+
+ /* Create an hdc */
+ hdc = GetDC (hwnd);
+ if (hdc == NULL)
+ {
+ printf ("gdiWindowProc - GetDC failed\n");
+ exit (1);
+ }
+
+ /* Create and select blue brush */
+ hbrush = CreateSolidBrush (colorref);
+ if (hbrush == NULL)
+ {
+ printf ("gdiWindowProc - CreateSolidBrush failed\n");
+ exit (1);
+ }
+
+ /* Get window extents */
+ if (GetClientRect (hwnd, &rect) == FALSE)
+ {
+ printf ("gdiWindowProc - GetClientRect failed\n");
+ exit (1);
+ }
+
+ /* Fill window with blue brush */
+ if (FillRect (hdc, &rect, hbrush) == 0)
+ {
+ printf ("gdiWindowProc - FillRect failed\n");
+ exit (1);
+ }
+
+ /* Delete blue brush */
+ DeleteObject (hbrush);
+
+ /* Release the hdc */
+ ReleaseDC (hwnd, hdc);
+
+ return TRUE;
+}
diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c
new file mode 100644
index 000000000..8c9439bfd
--- /dev/null
+++ b/hw/xwin/winmouse.c
@@ -0,0 +1,295 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmouse.c,v 1.4 2001/10/29 21:10:24 alanh Exp $ */
+
+#include "win.h"
+
+void
+winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl)
+{
+}
+
+
+/*
+ * See Porting Layer Definition - p. 18
+ * This is known as a DeviceProc
+ */
+
+int
+winMouseProc (DeviceIntPtr pDeviceInt, int iState)
+{
+ CARD8 map[6];
+ DevicePtr pDevice = (DevicePtr) pDeviceInt;
+
+ switch (iState)
+ {
+ case DEVICE_INIT:
+ map[1] = 1;
+ map[2] = 2;
+ map[3] = 3;
+ map[4] = 4;
+ map[5] = 5;
+ InitPointerDeviceStruct (pDevice,
+ map,
+ 5, /* Buttons 4 and 5 are mouse wheel events */
+ miPointerGetMotionEvents,
+ winMouseCtrl,
+ miPointerGetMotionBufferSize ());
+ break;
+
+ case DEVICE_ON:
+ pDevice->on = TRUE;
+ break;
+
+ case DEVICE_CLOSE:
+ case DEVICE_OFF:
+ pDevice->on = FALSE;
+ break;
+ }
+ return Success;
+}
+
+
+/* Handle the mouse wheel */
+int
+winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
+{
+ winScreenPriv(pScreen);
+ xEvent xCurrentEvent;
+
+ /* Button4 = WheelUp */
+ /* Button5 = WheelDown */
+
+ /* Do we have any previous delta stored? */
+ if ((pScreenPriv->iDeltaZ > 0
+ && iDeltaZ > 0)
+ || (pScreenPriv->iDeltaZ < 0
+ && iDeltaZ < 0))
+ {
+ /* Previous delta and of same sign as current delta */
+ iDeltaZ += pScreenPriv->iDeltaZ;
+ pScreenPriv->iDeltaZ = 0;
+ }
+ else
+ {
+ /*
+ * Previous delta of different sign, or zero.
+ * We will set it to zero for either case,
+ * as blindly setting takes just as much time
+ * as checking, then setting if necessary :)
+ */
+ pScreenPriv->iDeltaZ = 0;
+ }
+
+ /*
+ * Only process this message if the wheel has moved further than
+ * WHEEL_DELTA
+ */
+ if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA)
+ {
+ pScreenPriv->iDeltaZ = 0;
+
+ /* Figure out how many whole deltas of the wheel we have */
+ iDeltaZ /= WHEEL_DELTA;
+ }
+ else
+ {
+ /*
+ * Wheel has not moved past WHEEL_DELTA threshold;
+ * we will store the wheel delta until the threshold
+ * has been reached.
+ */
+ pScreenPriv->iDeltaZ = iDeltaZ;
+ return 0;
+ }
+
+ /* Set the button to indicate up or down wheel delta */
+ if (iDeltaZ > 0)
+ {
+ xCurrentEvent.u.u.detail = Button4;
+ }
+ else
+ {
+ xCurrentEvent.u.u.detail = Button5;
+ }
+
+ /*
+ * Flip iDeltaZ to positive, if negative,
+ * because always need to generate a *positive* number of
+ * button clicks for the Z axis.
+ */
+ if (iDeltaZ < 0)
+ {
+ iDeltaZ *= -1;
+ }
+
+ /* Generate X input messages for each wheel delta we have seen */
+ while (iDeltaZ--)
+ {
+ /* Push the wheel button */
+ xCurrentEvent.u.u.type = ButtonPress;
+ xCurrentEvent.u.keyButtonPointer.time
+ = g_c32LastInputEventTime = GetTickCount ();
+ mieqEnqueue (&xCurrentEvent);
+
+ /* Release the wheel button */
+ xCurrentEvent.u.u.type = ButtonRelease;
+ xCurrentEvent.u.keyButtonPointer.time
+ = g_c32LastInputEventTime = GetTickCount ();
+ mieqEnqueue (&xCurrentEvent);
+ }
+
+ return 0;
+}
+
+
+/*
+ * Enqueue a mouse button event
+ */
+
+void
+winMouseButtonsSendEvent (int iEventType, int iButton)
+{
+ xEvent xCurrentEvent;
+
+ /* Load an xEvent and enqueue the event */
+ xCurrentEvent.u.u.type = iEventType;
+ xCurrentEvent.u.u.detail = iButton;
+ xCurrentEvent.u.keyButtonPointer.time
+ = g_c32LastInputEventTime = GetTickCount ();
+ mieqEnqueue (&xCurrentEvent);
+}
+
+
+/*
+ * Decide what to do with a Windows mouse message
+ */
+
+int
+winMouseButtonsHandle (ScreenPtr pScreen,
+ int iEventType, int iButton,
+ WPARAM wParam)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Send button events right away if emulate 3 buttons is off */
+ if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF)
+ {
+ /* Emulate 3 buttons is off, send the button event */
+ winMouseButtonsSendEvent (iEventType, iButton);
+ return 0;
+ }
+
+ /* Emulate 3 buttons is on, let the fun begin */
+ if (iEventType == ButtonPress
+ && pScreenPriv->iE3BCachedPress == 0
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button was pressed, no press is cached,
+ * and there is no fake button 2 release pending.
+ */
+
+ /* Store button press type */
+ pScreenPriv->iE3BCachedPress = iButton;
+
+ /*
+ * Set a timer to send this button press if the other button
+ * is not pressed within the timeout time.
+ */
+ SetTimer (pScreenPriv->hwndScreen,
+ WIN_E3B_TIMER_ID,
+ pScreenInfo->iE3BTimeout,
+ NULL);
+ }
+ else if (iEventType == ButtonPress
+ && pScreenPriv->iE3BCachedPress != 0
+ && pScreenPriv->iE3BCachedPress != iButton
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button press is cached, other button was pressed,
+ * and there is no fake button 2 release pending.
+ */
+
+ /* Mouse button was cached and other button was pressed */
+ KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
+ pScreenPriv->iE3BCachedPress = 0;
+
+ /* Send fake middle button */
+ winMouseButtonsSendEvent (ButtonPress, Button2);
+
+ /* Indicate that a fake middle button event was sent */
+ pScreenPriv->fE3BFakeButton2Sent = TRUE;
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->iE3BCachedPress == iButton)
+ {
+ /*
+ * Cached button was released before timer ran out,
+ * and before the other mouse button was pressed.
+ */
+ KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
+ pScreenPriv->iE3BCachedPress = 0;
+
+ /* Send cached press, then send release */
+ winMouseButtonsSendEvent (ButtonPress, iButton);
+ winMouseButtonsSendEvent (ButtonRelease, iButton);
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->fE3BFakeButton2Sent
+ && !(wParam & MK_LBUTTON)
+ && !(wParam & MK_RBUTTON))
+ {
+ /*
+ * Fake button 2 was sent and both mouse buttons have now been released
+ */
+ pScreenPriv->fE3BFakeButton2Sent = FALSE;
+
+ /* Send middle mouse button release */
+ winMouseButtonsSendEvent (ButtonRelease, Button2);
+ }
+ else if (iEventType == ButtonRelease
+ && pScreenPriv->iE3BCachedPress == 0
+ && !pScreenPriv->fE3BFakeButton2Sent)
+ {
+ /*
+ * Button was release, no button is cached,
+ * and there is no fake button 2 release is pending.
+ */
+ winMouseButtonsSendEvent (ButtonRelease, iButton);
+ }
+
+ return 0;
+}
diff --git a/hw/xwin/winms.h b/hw/xwin/winms.h
new file mode 100644
index 000000000..17454487d
--- /dev/null
+++ b/hw/xwin/winms.h
@@ -0,0 +1,61 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winms.h,v 1.2 2001/04/18 17:14:06 dawes Exp $ */
+
+#ifndef _WINMS_H_
+#define _WINMS_H_
+
+#undef MINSHORT
+#undef MAXSHORT
+#undef CARD8
+#undef INT32
+#undef ATOM
+
+#define NONAMELESSUNION
+#define DIRECTDRAW_VERSION 0x0300
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+
+#include <windows.h>
+#include <windowsx.h>
+
+#include "obj_base.h"
+#include "ddraw.h"
+
+/*
+ * Undefine unneeded Windows symbols that conflict
+ * with X symbols
+ */
+
+#undef CreateWindow
+#undef FreeResource
+
+#endif /* _WINMS_H_ */
diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c
new file mode 100644
index 000000000..35342c359
--- /dev/null
+++ b/hw/xwin/winmsg.c
@@ -0,0 +1,119 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Alexander Gottwald
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.c,v 1.1 2002/10/17 08:18:22 alanh Exp $ */
+
+#include "win.h"
+#include "winmsg.h"
+#include <stdarg.h>
+
+#ifndef VERBOSE_LEVEL
+#define VERBOSE_LEVEL 4
+#endif
+
+
+void winVMsg (int, MessageType, int verb, const char *, va_list);
+
+
+void
+winVMsg (int scrnIndex, MessageType type, int verb, const char *format,
+ va_list ap)
+{
+ const char *prefix = NULL;
+
+ if (verb && verb > VERBOSE_LEVEL)
+ return;
+
+#undef __msg
+#define __msg(name,string) case name: prefix = string; break;
+#undef _msg
+#define _msg(name,string) __msg(name,string)
+ switch (type)
+ {
+ MESSAGE_STRINGS default:prefix = NULL;
+ break;
+ }
+#undef __msg
+#undef _msg
+
+ if (prefix != NULL)
+ ErrorF ("%s ", prefix);
+ VErrorF (format, ap);
+}
+
+
+void
+winDrvMsg (int scrnIndex, MessageType type, const char *format, ...)
+{
+ va_list ap;
+ va_start (ap, format);
+ winVMsg (scrnIndex, type, 0, format, ap);
+ va_end (ap);
+}
+
+
+void
+winMsg (MessageType type, const char *format, ...)
+{
+ va_list ap;
+ va_start (ap, format);
+ winVMsg (0, type, 0, format, ap);
+ va_end (ap);
+}
+
+
+void
+winDrvMsgVerb (int scrnIndex, MessageType type, int verb, const char *format,
+ ...)
+{
+ va_list ap;
+ va_start (ap, format);
+ winVMsg (scrnIndex, type, verb, format, ap);
+ va_end (ap);
+}
+
+
+void
+winMsgVerb (MessageType type, int verb, const char *format, ...)
+{
+ va_list ap;
+ va_start (ap, format);
+ winVMsg (0, type, verb, format, ap);
+ va_end (ap);
+}
+
+
+void
+winErrorFVerb (int verb, const char *format, ...)
+{
+ va_list ap;
+ va_start (ap, format);
+ winVMsg (0, X_NONE, verb, format, ap);
+ va_end (ap);
+}
diff --git a/hw/xwin/winmsg.h b/hw/xwin/winmsg.h
new file mode 100644
index 000000000..c873d4beb
--- /dev/null
+++ b/hw/xwin/winmsg.h
@@ -0,0 +1,72 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Alexander Gottwald
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmsg.h,v 1.1 2002/10/17 08:18:22 alanh Exp $ */
+
+#ifndef __WIN_MSG_H__
+#define __WIN_MSG_H__
+
+
+#define __msg_name(name,string) name
+#define __msg(name,string) __msg_name(name,string)
+#define _msg(name,string) __msg(name,string),
+
+#define MESSAGE_STRINGS \
+ _msg(X_PROBED,"(--)" /* Value was probed */)\
+ _msg(X_CONFIG,"(**)" /* Value was given in the config file */)\
+ _msg(X_DEFAULT,"(==)" /* Value is a default */)\
+ _msg(X_CMDLINE,"(++)" /* Value was given on the command line */)\
+ _msg(X_NOTICE,"(!!)" /* Notice */) \
+ _msg(X_ERROR,"(EE)" /* Error message */) \
+ _msg(X_WARNING,"(WW)" /* Warning message */) \
+ _msg(X_INFO,"(II)" /* Informational message */) \
+ _msg(X_UNKNOWN,"(?""?)" /* Unknown, trigraph fix */) \
+ _msg(X_NONE,NULL /* No prefix */) \
+ __msg(X_NOT_IMPLEMENTED,"(NI)" /* Not implemented */)
+
+typedef enum
+{
+ MESSAGE_STRINGS
+}
+MessageType;
+
+
+/*
+ * Function prototypes
+ */
+
+void winDrvMsgVerb (int scrnIndex,
+ MessageType type, int verb, const char *format, ...);
+void winDrvMsg (int scrnIndex, MessageType type, const char *format, ...);
+void winMsgVerb (MessageType type, int verb, const char *format, ...);
+void winMsg (MessageType type, const char *format, ...);
+
+void winErrorFVerb (int verb, const char *format, ...);
+
+#endif
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
new file mode 100644
index 000000000..57d209e2a
--- /dev/null
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -0,0 +1,1574 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Kensuke Matsuzaki
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwindow.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+#include "dixevents.h"
+
+
+/*
+ * Prototypes for local functions
+ */
+
+static void
+winCreateWindowsWindow (WindowPtr pWin);
+
+static void
+winDestroyWindowsWindow (WindowPtr pWin);
+
+static void
+winUpdateWindowsWindow (WindowPtr pWin);
+
+static XID
+winGetWindowID (WindowPtr pWin);
+
+static void
+SendConfigureNotify (WindowPtr pWin);
+
+static
+void
+winUpdateRgn (WindowPtr pWindow);
+
+#ifdef SHAPE
+static
+void
+winReshape (WindowPtr pWin);
+#endif
+
+
+/*
+ * Local globals
+ */
+
+static UINT s_nIDPollingMouse = 2;
+
+#if 0
+static BOOL s_fMoveByX = FALSE;
+#endif
+
+
+/*
+ * Constant defines
+ */
+
+
+#define MOUSE_POLLING_INTERVAL 500
+#define WIN_MULTIWINDOW_SHAPE YES
+
+/*
+ * Macros
+ */
+
+#define SubSend(pWin) \
+ ((pWin->eventMask|wOtherEventMasks(pWin)) & SubstructureNotifyMask)
+
+#define StrSend(pWin) \
+ ((pWin->eventMask|wOtherEventMasks(pWin)) & StructureNotifyMask)
+
+#define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent))
+
+
+/*
+ * CreateWindow - See Porting Layer Definition - p. 37
+ */
+
+Bool
+winCreateWindowMultiWindow (WindowPtr pWin)
+{
+ Bool fResult = TRUE;
+ winWindowPriv(pWin);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winCreateWindowMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ /* Call any wrapped CreateWindow function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow)
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow (pWin);
+
+ /* Initialize some privates values */
+ pWinPriv->hRgn = NULL;
+ pWinPriv->hWnd = NULL;
+ pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen);
+ pWinPriv->fXKilled = FALSE;
+
+ return fResult;
+}
+
+
+/*
+ * DestroyWindow - See Porting Layer Definition - p. 37
+ */
+
+Bool
+winDestroyWindowMultiWindow (WindowPtr pWin)
+{
+ Bool fResult = TRUE;
+ winWindowPriv(pWin);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winDestroyWindowMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ /* Call any wrapped DestroyWindow function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow)
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow (pWin);
+
+ /* Flag that the window has been destroyed */
+ pWinPriv->fXKilled = TRUE;
+
+ /* Kill the MS Windows window associated with this window */
+ winDestroyWindowsWindow (pWin);
+
+ return fResult;
+}
+
+
+/*
+ * PositionWindow - See Porting Layer Definition - p. 37
+ */
+
+Bool
+winPositionWindowMultiWindow (WindowPtr pWin, int x, int y)
+{
+ Bool fResult = TRUE;
+ int iX, iY, iWidth, iHeight, iBorder;
+ winWindowPriv(pWin);
+ HWND hWnd = pWinPriv->hWnd;
+ RECT rcNew;
+ RECT rcOld;
+#if CYGMULTIWINDOW_DEBUG
+ RECT rcClient;
+ RECT *lpRc;
+#endif
+ DWORD dwExStyle;
+ DWORD dwStyle;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winPositionWindowMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ /* Call any wrapped PositionWindow function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow)
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow (pWin, x, y);
+
+ /* Bail out if the Windows window handle is bad */
+ if (!hWnd)
+ return fResult;
+
+ /* Get the Windows window style and extended style */
+ dwExStyle = GetWindowLongPtr (hWnd, GWL_EXSTYLE);
+ dwStyle = GetWindowLongPtr (hWnd, GWL_STYLE);
+
+ /* Get the width of the X window border */
+ iBorder = wBorderWidth (pWin);
+
+ /* Get the X and Y location of the X window */
+ iX = pWin->drawable.x;
+ iY = pWin->drawable.y;
+
+ /* Get the height and width of the X window */
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
+
+ /* Store the origin, height, and width in a rectangle structure */
+ SetRect (&rcNew, iX, iY, iX + iWidth, iY + iHeight);
+
+#if CYGMULTIWINDOW_DEBUG
+ lpRc = &rcNew;
+ ErrorF ("winPositionWindowMultiWindow - (%d ms)drawable (%d, %d)-(%d, %d)\n",
+ GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+#endif
+
+ /*
+ * Calculate the required size of the Windows window rectangle,
+ * given the size of the Windows window client area.
+ */
+ AdjustWindowRectEx (&rcNew, dwStyle, FALSE, dwExStyle);
+
+ /* Get a rectangle describing the old Windows window */
+ GetWindowRect (hWnd, &rcOld);
+
+#if CYGMULTIWINDOW_DEBUG
+ /* Get a rectangle describing the Windows window client area */
+ GetClientRect (hWnd, &rcClient);
+
+ lpRc = &rcNew;
+ ErrorF ("winPositionWindowMultiWindow - (%d ms)rcNew (%d, %d)-(%d, %d)\n",
+ GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+
+ lpRc = &rcOld;
+ ErrorF ("winPositionWindowMultiWindow - (%d ms)rcOld (%d, %d)-(%d, %d)\n",
+ GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+
+ lpRc = &rcClient;
+ ErrorF ("(%d ms)rcClient (%d, %d)-(%d, %d)\n",
+ GetTickCount (), lpRc->left, lpRc->top, lpRc->right, lpRc->bottom);
+#endif
+
+ /* Check if the old rectangle and new rectangle are the same */
+ if (!EqualRect (&rcNew, &rcOld))
+ {
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winPositionWindowMultiWindow - Need to move\n");
+#endif
+
+ /* Change the position and dimensions of the Windows window */
+ MoveWindow (hWnd,
+ rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
+ TRUE);
+ }
+ else
+ {
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winPositionWindowMultiWindow - Not need to move\n");
+#endif
+ }
+
+ return fResult;
+}
+
+
+/*
+ * ChangeWindowAttributes - See Porting Layer Definition - p. 37
+ */
+
+Bool
+winChangeWindowAttributesMultiWindow (WindowPtr pWin, unsigned long mask)
+{
+ Bool fResult = TRUE;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winChangeWindowAttributesMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ /* Call any wrapped ChangeWindowAttributes function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes)
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes (pWin, mask);
+
+ /*
+ * NOTE: We do not currently need to do anything here.
+ */
+
+ return fResult;
+}
+
+
+/*
+ * UnmapWindow - See Porting Layer Definition - p. 37
+ * Also referred to as UnrealizeWindow
+ */
+
+Bool
+winUnmapWindowMultiWindow (WindowPtr pWin)
+{
+ Bool fResult = TRUE;
+ winWindowPriv(pWin);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winUnmapWindowMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ /* Call any wrapped UnrealizeWindow function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow)
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow (pWin);
+
+ /* Flag that the window has been killed */
+ pWinPriv->fXKilled = TRUE;
+
+ /* Destroy the Windows window associated with this X window */
+ winDestroyWindowsWindow (pWin);
+
+ return fResult;
+}
+
+
+/*
+ * MapWindow - See Porting Layer Definition - p. 37
+ * Also referred to as RealizeWindow
+ */
+
+Bool
+winMapWindowMultiWindow (WindowPtr pWin)
+{
+ Bool fResult = TRUE;
+ winWindowPriv(pWin);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winMapWindowMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ /* Call any wrapped RealizeWindow function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow)
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow (pWin);
+
+ /* Flag that this window has not been destroyed */
+ pWinPriv->fXKilled = FALSE;
+
+ /* Refresh/redisplay the Windows window associated with this X window */
+ winUpdateWindowsWindow (pWin);
+
+#if WIN_MULTIWINDOW_SHAPE
+ winReshape (pWin);
+ winUpdateRgn (pWin);
+#endif
+
+ return fResult;
+}
+
+
+/*
+ * ReparentWindow - See Porting Layer Definition - p. 42
+ */
+
+void
+winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
+{
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winReparentMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ /* Call any wrapped ReparentWindow function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->ReparentWindow)
+ winGetScreenPriv(pWin->drawable.pScreen)->ReparentWindow (pWin,
+ pPriorParent);
+
+ /* Update the Windows window associated with this X window */
+ winUpdateWindowsWindow (pWin);
+}
+
+
+/*
+ * RestackWindow - Shuffle the z-order of a window
+ */
+
+void
+winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
+{
+ WindowPtr pPrevWin;
+ UINT uFlags;
+ HWND hInsertAfter;
+ winWindowPriv(pWin);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winRestackMultiWindow - %08x\n", pWin);
+#endif
+
+ /* Call any wrapped RestackWindow function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->RestackWindow)
+ winGetScreenPriv(pWin->drawable.pScreen)->RestackWindow (pWin,
+ pOldNextSib);
+
+ /* Bail out if no window privates or window handle is invalid */
+ if (!pWinPriv || !pWinPriv->hWnd)
+ return;
+
+ /* Get a pointer to our previous sibling window */
+ pPrevWin = pWin->prevSib;
+
+ /*
+ * Look for a sibling window with
+ * valid privates and window handle
+ */
+ while (pPrevWin
+ && !winGetWindowPriv(pPrevWin)
+ && !winGetWindowPriv(pPrevWin)->hWnd)
+ pPrevWin = pPrevWin->prevSib;
+
+ /* Check if we found a valid sibling */
+ if (pPrevWin)
+ {
+ /* Valid sibling - get handle to insert window after */
+ hInsertAfter = winGetWindowPriv(pPrevWin)->hWnd;
+ uFlags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE;
+ }
+ else
+ {
+ /* No valid sibling - make this window the top window */
+ hInsertAfter = HWND_TOP;
+ uFlags = SWP_NOMOVE | SWP_NOSIZE;
+ }
+
+ /* Perform the restacking operation in Windows */
+ SetWindowPos (pWinPriv->hWnd,
+ hInsertAfter,
+ 0, 0,
+ 0, 0,
+ uFlags);
+}
+
+
+/*
+ * SetShape - See Porting Layer Definition - p. 42
+ */
+
+#ifdef SHAPE
+void
+winSetShapeMultiWindow (WindowPtr pWin)
+{
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winSetShapeMultiWindow - pWin: %08x\n", pWin);
+#endif
+
+ /* Call any wrapped SetShape function */
+ if (winGetScreenPriv(pWin->drawable.pScreen)->SetShape)
+ winGetScreenPriv(pWin->drawable.pScreen)->SetShape (pWin);
+
+ /*
+ * NOTE: We do not currently do anything here.
+ */
+
+#if WIN_MULTIWINDOW_SHAPE
+ winReshape (pWin);
+ winUpdateRgn (pWin);
+#endif
+
+ return;
+}
+#endif
+
+
+/*
+ * winUpdateRgn - Local function to update a Windows window region
+ */
+
+static
+void
+winUpdateRgn (WindowPtr pWin)
+{
+#if 1
+ SetWindowRgn (winGetWindowPriv(pWin)->hWnd,
+ winGetWindowPriv(pWin)->hRgn, TRUE);
+#endif
+}
+
+
+/*
+ * winReshape - Computes the composite clipping region for a window
+ */
+
+#ifdef SHAPE
+static
+void
+winReshape (WindowPtr pWin)
+{
+ int nRects;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ RegionRec rrNewShape;
+ BoxPtr pShape, pRects, pEnd;
+ HRGN hRgn, hRgnRect;
+ winWindowPriv(pWin);
+
+#if CYGDEBUG
+ ErrorF ("winReshape ()\n");
+#endif
+
+ /* Bail if the window is the root window */
+ if (pWin->parent == NULL)
+ return;
+
+ /* Bail if the window is not top level */
+ if (pWin->parent->parent != NULL)
+ return;
+
+ /* Bail if Windows window handle is invalid */
+ if (pWinPriv->hWnd == NULL)
+ return;
+
+ /* Free any existing window region stored in the window privates */
+ if (pWinPriv->hRgn != NULL)
+ {
+ DeleteObject (pWinPriv->hRgn);
+ pWinPriv->hRgn = NULL;
+ }
+
+ /* Bail if the window has no bounding region defined */
+ if (!wBoundingShape (pWin))
+ return;
+
+ REGION_INIT(pScreen, &rrNewShape, NullBox, 0);
+ REGION_COPY(pScreen, &rrNewShape, wBoundingShape(pWin));
+ REGION_TRANSLATE(pScreen,
+ &rrNewShape,
+ pWin->borderWidth,
+ pWin->borderWidth);
+
+ nRects = REGION_NUM_RECTS(&rrNewShape);
+ pShape = REGION_RECTS(&rrNewShape);
+
+ /* Don't do anything if there are no rectangles in the region */
+ if (nRects > 0)
+ {
+ RECT rcClient;
+ RECT rcWindow;
+ int iOffsetX, iOffsetY;
+
+ /* Get client rectangle */
+ if (!GetClientRect (pWinPriv->hWnd, &rcClient))
+ {
+ ErrorF ("winReshape - GetClientRect failed, bailing: %d\n",
+ GetLastError ());
+ return;
+ }
+
+ /* Translate client rectangle coords to screen coords */
+ /* NOTE: Only transforms top and left members */
+ ClientToScreen (pWinPriv->hWnd, (LPPOINT) &rcClient);
+
+ /* Get window rectangle */
+ if (!GetWindowRect (pWinPriv->hWnd, &rcWindow))
+ {
+ ErrorF ("winReshape - GetWindowRect failed, bailing: %d\n",
+ GetLastError ());
+ return;
+ }
+
+ /* Calculate offset from window upper-left to client upper-left */
+ iOffsetX = rcClient.left - rcWindow.left;
+ iOffsetY = rcClient.top - rcWindow.top;
+
+ /* Create initial Windows region for title bar */
+ /* FIXME: Mean, nasty, ugly hack!!! */
+ hRgn = CreateRectRgn (0, 0, rcWindow.right, iOffsetY);
+ if (hRgn == NULL)
+ {
+ ErrorF ("winReshape - Initial CreateRectRgn (%d, %d, %d, %d) "
+ "failed: %d\n",
+ 0, 0, rcWindow.right, iOffsetY, GetLastError ());
+ }
+
+ /* Loop through all rectangles in the X region */
+ for (pRects = pShape, pEnd = pShape + nRects; pRects < pEnd; pRects++)
+ {
+ /* Create a Windows region for the X rectangle */
+ hRgnRect = CreateRectRgn (pRects->x1 + iOffsetX - 1,
+ pRects->y1 + iOffsetY - 1,
+ pRects->x2 + iOffsetX - 1,
+ pRects->y2 + iOffsetY - 1);
+ if (hRgnRect == NULL)
+ {
+ ErrorF ("winReshape - Loop CreateRectRgn (%d, %d, %d, %d) "
+ "failed: %d\n"
+ "\tx1: %d x2: %d xOff: %d y1: %d y2: %d yOff: %d\n",
+ pRects->x1 + iOffsetX - 1,
+ pRects->y1 + iOffsetY - 1,
+ pRects->x2 + iOffsetX - 1,
+ pRects->y2 + iOffsetY - 1,
+ GetLastError (),
+ pRects->x1, pRects->x2, iOffsetX,
+ pRects->y1, pRects->y2, iOffsetY);
+ }
+
+ /* Merge the Windows region with the accumulated region */
+ if (CombineRgn (hRgn, hRgn, hRgnRect, RGN_OR) == ERROR)
+ {
+ ErrorF ("winReshape - CombineRgn () failed: %d\n",
+ GetLastError ());
+ }
+
+ /* Delete the temporary Windows region */
+ DeleteObject (hRgnRect);
+ }
+
+ /* Save a handle to the composite region in the window privates */
+ pWinPriv->hRgn = hRgn;
+ }
+
+ REGION_UNINIT(pScreen, &rrNewShape);
+
+ return;
+}
+#endif
+
+
+/*
+ * winTopLevelWindowProc - Window procedure for all top-level Windows windows.
+ */
+
+LRESULT CALLBACK
+winTopLevelWindowProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ POINT ptMouse;
+ HDC hdcUpdate;
+ PAINTSTRUCT ps;
+ WindowPtr pWin = NULL;
+ winPrivWinPtr pWinPriv = NULL;
+ ScreenPtr s_pScreen = NULL;
+ winPrivScreenPtr s_pScreenPriv = NULL;
+ winScreenInfo *s_pScreenInfo = NULL;
+ HWND hwndScreen = NULL;
+ DrawablePtr pDraw = NULL;
+ int iX, iY, iWidth, iHeight, iBorder;
+ winWMMessageRec wmMsg;
+ static Bool s_fTracking = FALSE;
+ static Bool s_fCursor = TRUE;
+
+ /* Check if the Windows window property for our X window pointer is valid */
+ if ((pWin = GetProp (hwnd, WIN_WINDOW_PROP)) != NULL)
+ {
+ /* Our X window pointer is valid */
+
+ /* Get pointers to the drawable and the screen */
+ pDraw = &pWin->drawable;
+ s_pScreen = pWin->drawable.pScreen;
+
+ /* Get a pointer to our window privates */
+ pWinPriv = winGetWindowPriv(pWin);
+
+ /* Get pointers to our screen privates and screen info */
+ s_pScreenPriv = pWinPriv->pScreenPriv;
+ s_pScreenInfo = s_pScreenPriv->pScreenInfo;
+
+ /* Get the handle for our screen-sized window */
+ /* NOTE: This will be going away at some point, right? Harold Hunt - 2003/01/15 */
+ hwndScreen = s_pScreenPriv->hwndScreen;
+
+ /* */
+ wmMsg.msg = 0;
+ wmMsg.hwndWindow = hwnd;
+ wmMsg.iWindow = (Window)GetProp (hwnd, WIN_WID_PROP);
+
+#if 1
+ wmMsg.iX = pWinPriv->iX;
+ wmMsg.iY = pWinPriv->iY;
+ wmMsg.iWidth = pWinPriv->iWidth;
+ wmMsg.iHeight = pWinPriv->iHeight;
+#else
+ wmMsg.iX = pDraw.x;
+ wmMsg.iY = pDraw.y;
+ wmMsg.iWidth = pDraw.width;
+ wmMsg.iHeight = pDraw.height;
+#endif
+
+
+#if 0
+ /*
+ * Print some debugging information
+ */
+
+ ErrorF ("hWnd %08X\n", hwnd);
+ ErrorF ("pWin %08X\n", pWin);
+ ErrorF ("pDraw %08X\n", pDraw);
+ ErrorF ("\ttype %08X\n", pWin->drawable.type);
+ ErrorF ("\tclass %08X\n", pWin->drawable.class);
+ ErrorF ("\tdepth %08X\n", pWin->drawable.depth);
+ ErrorF ("\tbitsPerPixel %08X\n", pWin->drawable.bitsPerPixel);
+ ErrorF ("\tid %08X\n", pWin->drawable.id);
+ ErrorF ("\tx %08X\n", pWin->drawable.x);
+ ErrorF ("\ty %08X\n", pWin->drawable.y);
+ ErrorF ("\twidth %08X\n", pWin->drawable.width);
+ ErrorF ("\thenght %08X\n", pWin->drawable.height);
+ ErrorF ("\tpScreen %08X\n", pWin->drawable.pScreen);
+ ErrorF ("\tserialNumber %08X\n", pWin->drawable.serialNumber);
+ ErrorF ("g_iWindowPrivateIndex %d\n", g_iWindowPrivateIndex);
+ ErrorF ("pWinPriv %08X\n", pWinPriv);
+ ErrorF ("s_pScreenPriv %08X\n", s_pScreenPriv);
+ ErrorF ("s_pScreenInfo %08X\n", s_pScreenInfo);
+ ErrorF ("hwndScreen %08X\n", hwndScreen);
+#endif
+ }
+
+
+
+ /* Branch on message type */
+ switch (message)
+ {
+ case WM_CREATE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_CREATE\n");
+#endif
+
+ /* */
+ SetProp (hwnd,
+ WIN_WINDOW_PROP,
+ (HANDLE)((LPCREATESTRUCT) lParam)->lpCreateParams);
+
+ /* */
+ SetProp (hwnd,
+ WIN_WID_PROP,
+ (HANDLE)winGetWindowID (((LPCREATESTRUCT) lParam)->lpCreateParams));
+ return 0;
+
+ case WM_PAINT:
+ /* Only paint if our window handle is valid */
+ if (hwndScreen == NULL)
+ break;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (hwnd, &ps);
+
+#if 0
+ /* NOTE: Doesn't appear to be used - Harold Hunt - 2003/01/15 */
+ /* Get the dimensions of the client area */
+ GetClientRect (hwnd, &rcClient);
+#endif
+
+ /* Get the position and dimensions of the window */
+ iBorder = wBorderWidth (pWin);
+ iX = pWin->drawable.x;
+ iY = pWin->drawable.y;
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
+
+ /* Try to copy from the shadow buffer */
+ if (!BitBlt (hdcUpdate,
+ 0, 0,
+ iWidth, iHeight,
+ s_pScreenPriv->hdcShadow,
+ iX, iY,
+ SRCCOPY))
+ {
+ LPVOID lpMsgBuf;
+
+ /* Display a fancy error message */
+ FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ GetLastError (),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf,
+ 0, NULL);
+
+ ErrorF ("winTopLevelWindowProc - BitBlt failed: %s\n",
+ (LPSTR)lpMsgBuf);
+ LocalFree (lpMsgBuf);
+ }
+
+ /* EndPaint frees the DC */
+ EndPaint (hwndScreen, &ps);
+ return 0;
+
+
+#if 1
+ case WM_MOUSEMOVE:
+ /* Unpack the client area mouse coordinates */
+ ptMouse.x = GET_X_LPARAM(lParam);
+ ptMouse.y = GET_Y_LPARAM(lParam);
+
+ /* Translate the client area mouse coordinates to screen coordinates */
+ ClientToScreen (hwnd, &ptMouse);
+
+ /* We can't do anything without privates */
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* Has the mouse pointer crossed screens? */
+ if (s_pScreen != miPointerCurrentScreen ())
+ miPointerSetNewScreen (s_pScreenInfo->dwScreen,
+ ptMouse.x - s_pScreenInfo->dwXOffset,
+ ptMouse.y - s_pScreenInfo->dwYOffset);
+
+ /* Are we tracking yet? */
+ if (!s_fTracking)
+ {
+ TRACKMOUSEEVENT tme;
+
+ /* Setup data structure */
+ ZeroMemory (&tme, sizeof (tme));
+ tme.cbSize = sizeof (tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = hwnd;
+
+ /* Call the tracking function */
+ if (!(*g_fpTrackMouseEvent) (&tme))
+ ErrorF ("winTopLevelWindowProc - _TrackMouseEvent failed\n");
+
+ /* Flag that we are tracking now */
+ s_fTracking = TRUE;
+ }
+
+ /* Hide or show the Windows mouse cursor */
+ if (s_fCursor)
+ {
+ /* Hide Windows cursor */
+ s_fCursor = FALSE;
+ ShowCursor (FALSE);
+ KillTimer (hwnd, s_nIDPollingMouse);
+ }
+
+ /* Deliver absolute cursor position to X Server */
+ miPointerAbsoluteCursor (ptMouse.x - s_pScreenInfo->dwXOffset,
+ ptMouse.y - s_pScreenInfo->dwYOffset,
+ g_c32LastInputEventTime = GetTickCount ());
+ return 0;
+
+ case WM_NCMOUSEMOVE:
+ /*
+ * We break instead of returning 0 since we need to call
+ * DefWindowProc to get the mouse cursor changes
+ * and min/max/close button highlighting in Windows XP.
+ * The Platform SDK says that you should return 0 if you
+ * process this message, but it fails to mention that you
+ * will give up any default functionality if you do return 0.
+ */
+
+ /* We can't do anything without privates */
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* Non-client mouse movement, show Windows cursor */
+ if (!s_fCursor)
+ {
+ s_fCursor = TRUE;
+ ShowCursor (TRUE);
+ SetTimer (hwnd, s_nIDPollingMouse, MOUSE_POLLING_INTERVAL, NULL);
+ }
+ break;
+
+ case WM_MOUSELEAVE:
+ /* Mouse has left our client area */
+
+ /* Flag that we are no longer tracking */
+ s_fTracking = FALSE;
+
+ /* Show the mouse cursor, if necessary */
+ if (!s_fCursor)
+ {
+ s_fCursor = TRUE;
+ ShowCursor (TRUE);
+ SetTimer (hwnd, s_nIDPollingMouse, MOUSE_POLLING_INTERVAL, NULL);
+ }
+ return 0;
+
+ case WM_LBUTTONDBLCLK:
+ case WM_LBUTTONDOWN:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
+
+ case WM_LBUTTONUP:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
+
+ case WM_MBUTTONDBLCLK:
+ case WM_MBUTTONDOWN:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
+
+ case WM_MBUTTONUP:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
+
+ case WM_RBUTTONDBLCLK:
+ case WM_RBUTTONDOWN:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
+
+ case WM_RBUTTONUP:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
+
+#else
+
+ case WM_MOUSEMOVE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_MOUSEMOVE*\n");
+#endif
+
+ /* Unpack the client area mouse coordinates */
+ ptMouse.x = GET_X_LPARAM(lParam);
+ ptMouse.y = GET_Y_LPARAM(lParam);
+
+ /* Translate the client area mouse coordinates to screen coordinates */
+ ClientToScreen (hwnd, &ptMouse);
+
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, MAKELONG(ptMouse.x, ptMouse.y));
+ return 0;
+
+ case WM_NCMOUSEMOVE:
+ case WM_LBUTTONDBLCLK:
+ case WM_LBUTTONDOWN:
+ case WM_LBUTTONUP:
+ case WM_MBUTTONDBLCLK:
+ case WM_MBUTTONDOWN:
+ case WM_MBUTTONUP:
+ case WM_RBUTTONDBLCLK:
+ case WM_RBUTTONDOWN:
+ case WM_RBUTTONUP:
+ case WM_MOUSELEAVE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_*BUTTON*\n");
+#endif
+
+ /* Pass the message to the root window */
+ SendMessage(hwndScreen, message, wParam, MAKELONG(ptMouse.x, ptMouse.y));
+ return 0;
+#endif
+
+ case WM_MOUSEWHEEL:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_MOUSEWHEEL\n");
+#endif
+
+ /* Pass the message to the root window */
+ SendMessage(hwndScreen, message, wParam, lParam);
+ return 0;
+
+ case WM_SYSKEYDOWN:
+ case WM_SYSKEYUP:
+ case WM_SYSDEADCHAR:
+ case WM_KEYDOWN:
+ case WM_KEYUP:
+ case WM_DEADCHAR:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_*KEY*\n");
+#endif
+
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+ return 0;
+
+ case WM_HOTKEY:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_HOTKEY\n");
+#endif
+
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+ return 0;
+
+
+#if 1
+ case WM_ACTIVATE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_ACTIVATE\n");
+#endif
+
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+
+ /* Bail if inactivating */
+ if (LOWORD(wParam) == WA_INACTIVE)
+ return 0;
+
+ /* Check if the current window is the active window in Windows */
+ if (GetActiveWindow () == hwnd)
+ {
+ /* Tell our Window Manager thread to raise the window */
+ wmMsg.msg = WM_WM_RAISE;
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+ }
+
+ /* Tell our Window Manager thread to activate the window */
+ wmMsg.msg = WM_WM_ACTIVATE;
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+
+ return 0;
+
+ case WM_ACTIVATEAPP:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_ACTIVATEAPP\n");
+#endif
+
+ /* Pass the message to the root window */
+ SendMessage (hwndScreen, message, wParam, lParam);
+ return 0;
+#endif
+
+
+ case WM_CLOSE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_CLOSE\n");
+#endif
+ /* Branch on if the window was killed in X already */
+ if (pWinPriv->fXKilled)
+ {
+ /* Window was killed, go ahead and destroy the window */
+ DestroyWindow (hwnd);
+ }
+ else
+ {
+ /* Tell our Window Manager thread to kill the window */
+ wmMsg.msg = WM_WM_KILL;
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+ }
+ return 0;
+
+ case WM_DESTROY:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_DESTROY\n");
+#endif
+
+ /* Branch on if the window was killed in X already */
+ if (pWinPriv && !pWinPriv->fXKilled)
+ {
+ ErrorF ("winTopLevelWindowProc - WM_DESTROY - WM_WM_KILL\n");
+
+ /* Tell our Window Manager thread to kill the window */
+ wmMsg.msg = WM_WM_KILL;
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+ }
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_DESTROY\n");
+#endif
+ break;
+
+ case WM_MOVE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_MOVE - %d ms\n", GetTickCount ());
+#endif
+
+ /* Bail if Windows window is not actually moving */
+ if (pWinPriv->iX == (short) LOWORD(lParam)
+ && pWinPriv->iY == (short) HIWORD(lParam))
+ break;
+
+ /* Get new position */
+ pWinPriv->iX = (short) LOWORD(lParam);
+ pWinPriv->iY = (short) HIWORD(lParam);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\t(%d, %d)\n", pWinPriv->iX, pWinPriv->iY);
+#endif
+
+ /* Notify the X client that its window is moving */
+ if (SubStrSend(pWin, pWin->parent))
+ SendConfigureNotify (pWin);
+
+ /* Tell X that the window is moving */
+ (s_pScreen->MoveWindow) (pWin,
+ (int)(short) LOWORD(lParam) - wBorderWidth (pWin),
+ (int)(short) HIWORD(lParam) - wBorderWidth (pWin),
+ pWin->nextSib,
+ VTMove);
+ return 0;
+
+ case WM_SHOWWINDOW:
+ /* Bail out if the window is being hidden */
+ if (!wParam)
+ return 0;
+
+ /* Tell X to map the window */
+ MapWindow (pWin, wClient(pWin));
+
+ /* */
+ if (!pWin->overrideRedirect)
+ {
+ DWORD dwExStyle;
+ DWORD dwStyle;
+ RECT rcNew;
+ int iDx, iDy;
+
+ /* Flag that this window needs to be made active when clicked */
+ SetProp (hwnd, WIN_NEEDMANAGE_PROP, (HANDLE) 1);
+
+ /* Get the standard and extended window style information */
+ dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE);
+ dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE);
+
+ /* */
+ if (dwExStyle != WS_EX_APPWINDOW)
+ {
+ /* Setup a rectangle with the X window position and size */
+ SetRect (&rcNew,
+ pWinPriv->iX,
+ pWinPriv->iY,
+ pWinPriv->iX + pWinPriv->iWidth,
+ pWinPriv->iY + pWinPriv->iHeight);
+
+#if 0
+ ErrorF ("winTopLevelWindowProc - (%d, %d)-(%d, %d)\n",
+ rcNew.left, rcNew.top,
+ rcNew.right, rcNew.bottom);
+#endif
+
+ /* */
+ AdjustWindowRectEx (&rcNew,
+ WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW,
+ FALSE,
+ WS_EX_APPWINDOW);
+
+ /* Calculate position deltas */
+ iDx = pWinPriv->iX - rcNew.left;
+ iDy = pWinPriv->iY - rcNew.top;
+
+ /* Calculate new rectangle */
+ rcNew.left += iDx;
+ rcNew.right += iDx;
+ rcNew.top += iDy;
+ rcNew.bottom += iDy;
+
+#if 0
+ ErrorF ("winTopLevelWindowProc - (%d, %d)-(%d, %d)\n",
+ rcNew.left, rcNew.top,
+ rcNew.right, rcNew.bottom);
+#endif
+
+ /* Set the window extended style flags */
+ SetWindowLongPtr (hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW);
+
+ /* Set the window standard style flags */
+ SetWindowLongPtr (hwnd, GWL_STYLE, WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW);
+
+ /* Positon the Windows window */
+ SetWindowPos (hwnd, HWND_TOP,
+ rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
+ SWP_NOMOVE | SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOACTIVATE);
+
+ /* Bring the Window window to the foreground */
+ SetForegroundWindow (hwnd);
+ }
+ }
+
+ /* Setup the Window Manager message */
+ wmMsg.msg = WM_WM_MAP;
+ wmMsg.iWidth = pWinPriv->iWidth;
+ wmMsg.iHeight = pWinPriv->iHeight;
+
+ /* Tell our Window Manager thread to map the window */
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+
+ /* Setup the Window Manager message */
+ wmMsg.msg = WM_WM_RAISE;
+
+ /* Tell our Window Manager thread to raise the window */
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+ return 0;
+
+ case WM_SIZE:
+ /* see dix/window.c */
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_SIZE - %d ms\n", GetTickCount ());
+#endif
+
+ switch (wParam)
+ {
+ case SIZE_MINIMIZED:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tSIZE_MINIMIZED\n");
+#endif
+
+ wmMsg.msg = WM_WM_LOWER;
+
+ /* Tell our Window Manager thread to lower the window */
+ winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
+ break;
+
+ case SIZE_RESTORED:
+ case SIZE_MAXIMIZED:
+ if (pWinPriv->iWidth == (short) LOWORD(lParam)
+ && pWinPriv->iHeight == (short) HIWORD(lParam))
+ break;
+
+ /* Get the dimensions of the Windows window */
+ pWinPriv->iWidth = (short) LOWORD(lParam);
+ pWinPriv->iHeight = (short) HIWORD(lParam);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\t(%d, %d)\n", pWinPriv->iWidth, pWinPriv->iHeight);
+#endif
+
+ /* Check if resize events are redirected */
+ if ((pWin->eventMask | wOtherEventMasks (pWin)) & ResizeRedirectMask)
+ {
+ xEvent eventT;
+
+ /* Setup the X event structure */
+ eventT.u.u.type = ResizeRequest;
+ eventT.u.resizeRequest.window = pWin->drawable.id;
+ eventT.u.resizeRequest.width = pWinPriv->iWidth;
+ eventT.u.resizeRequest.height = pWinPriv->iHeight;
+
+ /* */
+ if (MaybeDeliverEventsToClient (pWin, &eventT, 1,
+ ResizeRedirectMask,
+ wClient(pWin)) == 1)
+ break;
+ }
+
+ /* Notify the X client that its window is being resized */
+ if (SubStrSend (pWin, pWin->parent))
+ SendConfigureNotify (pWin);
+
+ /* Tell the X server that the window is being resized */
+ (s_pScreen->ResizeWindow) (pWin,
+ pWinPriv->iX - wBorderWidth (pWin),
+ pWinPriv->iY - wBorderWidth (pWin),
+ pWinPriv->iWidth,
+ pWinPriv->iHeight,
+ pWin->nextSib);
+
+ /* Tell X to redraw the exposed portions of the window */
+ {
+ RegionRec temp;
+
+ /* Get the region describing the X window clip list */
+ REGION_INIT(s_pScreen, &temp, NullBox, 0);
+ REGION_COPY(s_pScreen, &temp, &pWin->clipList);
+
+ /* Expose the clipped region */
+ (*s_pScreen->WindowExposures) (pWin, &temp, NullRegion);
+
+ /* Free the region */
+ REGION_UNINIT(s_pScreen, &temp);
+ }
+ break;
+
+#if 0
+ case SIZE_MAXIMIZED:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tSIZE_MAXIMIZED\n");
+#endif
+
+ /* Get the dimensions of the window */
+ pWinPriv->iWidth = (int)(short) LOWORD(lParam);
+ pWinPriv->iHeight = (int)(short) HIWORD(lParam);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\t(%d, %d)\n", pWinPriv->iWidth, pWinPriv->iHeight);
+#endif
+
+ /* */
+ if ((pWin->eventMask|wOtherEventMasks(pWin)) & ResizeRedirectMask)
+ {
+ xEvent eventT;
+
+ eventT.u.u.type = ResizeRequest;
+ eventT.u.resizeRequest.window = pWin->drawable.id;
+ eventT.u.resizeRequest.width = pWinPriv->iWidth;
+ eventT.u.resizeRequest.height = pWinPriv->iHeight;
+ if (MaybeDeliverEventsToClient (pWin, &eventT, 1,
+ ResizeRedirectMask,
+ wClient(pWin)) == 1);
+ }
+
+
+ (s_pScreen->ResizeWindow) (pWin,
+ pWinPriv->iX - wBorderWidth (pWin),
+ pWinPriv->iY - wBorderWidth (pWin),
+ pWinPriv->iWidth,
+ pWinPriv->iHeight,
+ pWin->nextSib);
+ break;
+#endif
+
+ default:
+ break;
+ }
+ return 0;
+
+ case WM_MOUSEACTIVATE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_MOUSEACTIVATE\n");
+#endif
+
+ /* Check if this window needs to be made active when clicked */
+ if (!GetProp (pWinPriv->hWnd, WIN_NEEDMANAGE_PROP))
+ {
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_MOUSEACTIVATE - MA_NOACTIVATE\n");
+#endif
+
+ /* */
+ return MA_NOACTIVATE;
+ }
+ break;
+
+ case WM_TIMER:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winTopLevelWindowProc - WM_TIMER - %d ms\n", GetTickCount ());
+#endif
+
+ /* Branch on the type of timer event that fired */
+ if (wParam == s_nIDPollingMouse)
+ {
+ POINT point;
+
+ /* Get the current position of the mouse cursor */
+ GetCursorPos (&point);
+
+ /* Deliver absolute cursor position to X Server */
+ miPointerAbsoluteCursor (point.x, point.y,
+ g_c32LastInputEventTime = GetTickCount ());
+ }
+ else
+ {
+ ErrorF ("winTopLevelWindowProc - Unknown WM_TIMER\n");
+ }
+ return 0;
+
+ default:
+ break;
+ }
+
+ return DefWindowProc (hwnd, message, wParam, lParam);
+}
+
+
+/*
+ * winCreateWindowsWindow - Create a Windows window associated with an X window
+ */
+
+static void
+winCreateWindowsWindow (WindowPtr pWin)
+{
+ int iX, iY;
+ int iWidth;
+ int iHeight;
+ int iBorder;
+ HWND hWnd;
+ WNDCLASS wc;
+ winWindowPriv(pWin);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
+#endif
+
+ iBorder = wBorderWidth (pWin);
+
+ iX = pWin->drawable.x;
+ iY = pWin->drawable.y;
+
+ iWidth = pWin->drawable.width;
+ iHeight = pWin->drawable.height;
+
+ /* Setup our window class */
+ wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.lpfnWndProc = winTopLevelWindowProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = g_hInstance;
+ wc.hIcon = LoadIcon (g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
+ wc.hCursor = 0;
+ wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = WINDOW_CLASS_X;
+ RegisterClass (&wc);
+
+ /* Create the window */
+ hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */
+ WINDOW_CLASS_X, /* Class name */
+ WINDOW_TITLE_X, /* Window name */
+ WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
+ iX, /* Horizontal position */
+ iY, /* Vertical position */
+ iWidth, /* Right edge */
+ iHeight, /* Bottom edge */
+ (HWND) NULL, /* No parent or owner window */
+ (HMENU) NULL, /* No menu */
+ GetModuleHandle (NULL), /* Instance handle */
+ pWin); /* ScreenPrivates */
+ if (hWnd == NULL)
+ {
+ ErrorF ("winCreateWindowsWindow - CreateWindowExA () failed: %d\n",
+ GetLastError ());
+ }
+
+ pWinPriv->hWnd = hWnd;
+
+
+ SetProp (pWinPriv->hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin));
+
+ /* Flag that this Windows window handles its own activation */
+ SetProp (pWinPriv->hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0);
+}
+
+
+/*
+ * winDestroyWindowsWindow - Destroy a Windows window associated with an X window
+ */
+
+static void
+winDestroyWindowsWindow (WindowPtr pWin)
+{
+ MSG msg;
+ winWindowPriv(pWin);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winDestroyWindowsWindow\n");
+#endif
+
+
+ /* Bail out if the Windows window handle is invalid */
+ if (pWinPriv->hWnd == NULL)
+ return;
+
+
+ SetProp (pWinPriv->hWnd, WIN_WINDOW_PROP, 0);
+
+ DestroyWindow (pWinPriv->hWnd);
+
+ pWinPriv->hWnd = NULL;
+
+ /* Process all messages on our queue */
+ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ if (g_hDlgDepthChange == 0 || !IsDialogMessage (g_hDlgDepthChange, &msg))
+ {
+ DispatchMessage (&msg);
+ }
+ }
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("-winDestroyWindowsWindow\n");
+#endif
+}
+
+
+/*
+ * winUpdateWindowsWindow - Redisplay/redraw a Windows window associated with an X window
+ */
+
+static void
+winUpdateWindowsWindow (WindowPtr pWin)
+{
+ winWindowPriv(pWin);
+ HWND hWnd = pWinPriv->hWnd;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winUpdateWindowsWindow\n");
+#endif
+
+ /* Check if the Windows window's parents have been destroyed */
+ if (pWin->parent != NULL
+ && pWin->parent->parent == NULL
+ && pWin->mapped)
+ {
+ /* Create the Windows window if it has been destroyed */
+ if (hWnd == NULL)
+ {
+ winCreateWindowsWindow (pWin);
+ assert (pWinPriv->hWnd != NULL);
+ }
+
+ /* Display the window without activating it */
+ ShowWindow (pWinPriv->hWnd, SW_SHOWNOACTIVATE);
+
+ /* Send first paint message */
+ UpdateWindow (pWinPriv->hWnd);
+ }
+ else if (hWnd != NULL)
+ {
+ /* Destroy the Windows window if its parents are destroyed */
+ winDestroyWindowsWindow (pWin);
+ assert (pWinPriv->hWnd == NULL);
+ }
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("-winUpdateWindowsWindow\n");
+#endif
+}
+
+
+
+
+
+
+
+
+typedef struct {
+ pointer value;
+ XID id;
+} WindowIDPairRec, *WindowIDPairPtr;
+
+
+
+
+
+/*
+ * winFindWindow -
+ */
+
+static void
+winFindWindow (pointer value, XID id, pointer cdata)
+{
+ WindowIDPairPtr wi = (WindowIDPairPtr)cdata;
+
+ if (value == wi->value)
+ {
+ wi->id = id;
+ }
+}
+
+
+/*
+ * winGetWindowID -
+ */
+
+static XID
+winGetWindowID (WindowPtr pWin)
+{
+ WindowIDPairRec wi = {pWin, 0};
+ ClientPtr c = wClient(pWin);
+
+ /* */
+ FindClientResourcesByType (c, RT_WINDOW, winFindWindow, &wi);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winGetWindowID - Window ID: %d\n", wi.id);
+#endif
+
+ return wi.id;
+}
+
+
+/*
+ * SendConfigureNotify -
+ */
+
+static void
+SendConfigureNotify(WindowPtr pWin)
+{
+ xEvent event;
+ winWindowPriv(pWin);
+
+ event.u.u.type = ConfigureNotify;
+ event.u.configureNotify.window = pWin->drawable.id;
+
+ if (pWin->nextSib)
+ event.u.configureNotify.aboveSibling = pWin->nextSib->drawable.id;
+ else
+ event.u.configureNotify.aboveSibling = None;
+
+ event.u.configureNotify.x = pWinPriv->iX - wBorderWidth (pWin);
+ event.u.configureNotify.y = pWinPriv->iY - wBorderWidth (pWin);
+
+ event.u.configureNotify.width = pWinPriv->iWidth;
+ event.u.configureNotify.height = pWinPriv->iHeight;
+
+ event.u.configureNotify.borderWidth = wBorderWidth (pWin);
+
+ event.u.configureNotify.override = pWin->overrideRedirect;
+
+ /* */
+ DeliverEvents (pWin, &event, 1, NullWindow);
+}
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
new file mode 100644
index 000000000..ab4dd27f6
--- /dev/null
+++ b/hw/xwin/winmultiwindowwm.c
@@ -0,0 +1,907 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Kensuke Matsuzaki
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winmultiwindowwm.c,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+/* X headers */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/select.h>
+#include <fcntl.h>
+#include <setjmp.h>
+#include <pthread.h>
+#include <X11/X.h>
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#include <X11/Xlocale.h>
+#include <X11/Xproto.h>
+#include <X11/Xutil.h>
+
+/* Fixups to prevent collisions between Windows and X headers */
+#define ATOM DWORD
+
+/* Windows headers */
+#include <windows.h>
+
+/* Local headers */
+#include "winwindow.h"
+
+
+/*
+ * Constant defines
+ */
+
+#define WIN_CONNECT_RETRIES 5
+#define WIN_CONNECT_DELAY 5
+#define WIN_MSG_QUEUE_FNAME "/dev/windows"
+#define WM_WM_X_EVENT 1
+#define WIN_JMP_OKAY 0
+#define WIN_JMP_ERROR_IO 2
+
+
+/*
+ * Local structures
+ */
+
+typedef struct _WMMsgNodeRec {
+ winWMMessageRec msg;
+ struct _WMMsgNodeRec *pNext;
+} WMMsgNodeRec, *WMMsgNodePtr;
+
+typedef struct _WMMsgQueueRec {
+ struct _WMMsgNodeRec *pHead;
+ struct _WMMsgNodeRec *pTail;
+ pthread_mutex_t pmMutex;
+ pthread_cond_t pcNotEmpty;
+} WMMsgQueueRec, *WMMsgQueuePtr;
+
+typedef struct _WMInfo {
+ Display *pDisplay;
+ WMMsgQueueRec wmMsgQueue;
+ Atom atmWmProtos;
+ Atom atmWmDelete;
+} WMInfoRec, *WMInfoPtr;
+
+typedef struct _WMProcArgRec {
+ DWORD dwScreen;
+ WMInfoPtr pWMInfo;
+ pthread_mutex_t *ppmServerStarted;
+} WMProcArgRec, *WMProcArgPtr;
+
+
+/*
+ * References to external symbols
+ */
+
+extern char *display;
+extern void ErrorF (const char* /*f*/, ...);
+extern Bool g_fCalledSetLocale;
+
+
+/*
+ * Prototypes for local functions
+ */
+
+static void
+PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode);
+
+static WMMsgNodePtr
+PopMessage (WMMsgQueuePtr pQueue);
+
+static Bool
+InitQueue (WMMsgQueuePtr pQueue);
+
+static void
+GetWindowName (Display * pDpy, Window iWin, char **ppName);
+
+static int
+SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData);
+
+static void*
+winMultiWindowWMProc (void* pArg);
+
+static Bool
+FlushXEvents (WMInfoPtr pWMInfo);
+
+static int
+winMultiWindowWMErrorHandler (Display *pDisp, XErrorEvent *e);
+
+static void
+winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg);
+
+static int
+winMutliWindowWMIOErrorHandler (Display *pDisplay);
+
+
+/*
+ * Local globals
+ */
+
+static int g_nQueueSize;
+static jmp_buf g_jmpEntry;
+
+
+
+/*
+ * PushMessage - Push a message onto the queue
+ */
+
+static void
+PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
+{
+
+ /* Lock the queue mutex */
+ pthread_mutex_lock (&pQueue->pmMutex);
+
+ pNode->pNext = NULL;
+
+ if (pQueue->pTail != NULL)
+ {
+ pQueue->pTail->pNext = pNode;
+ }
+ pQueue->pTail = pNode;
+
+ if (pQueue->pHead == NULL)
+ {
+ pQueue->pHead = pNode;
+ }
+
+
+#if 0
+ switch (pNode->msg.msg)
+ {
+ case WM_WM_MOVE:
+ ErrorF ("\tWM_WM_MOVE\n");
+ break;
+ case WM_WM_RAISE:
+ ErrorF ("\tWM_WM_RAISE\n");
+ break;
+ case WM_WM_LOWER:
+ ErrorF ("\tWM_WM_RAISE\n");
+ break;
+ case WM_WM_MAP:
+ ErrorF ("\tWM_WM_MAP\n");
+ break;
+ case WM_WM_UNMAP:
+ ErrorF ("\tWM_WM_UNMAP\n");
+ break;
+ case WM_WM_KILL:
+ ErrorF ("\tWM_WM_KILL\n");
+ break;
+ default:
+ ErrorF ("Unknown Message.\n");
+ break;
+ }
+#endif
+
+ /* Increase the count of elements in the queue by one */
+ ++g_nQueueSize;
+
+ /* Release the queue mutex */
+ pthread_mutex_unlock (&pQueue->pmMutex);
+
+ /* Signal that the queue is not empty */
+ pthread_cond_signal (&pQueue->pcNotEmpty);
+}
+
+
+#if 0
+/*
+ * QueueSize - Return the size of the queue
+ */
+
+static int
+QueueSize (WMMsgQueuePtr pQueue)
+{
+ WMMsgNodePtr pNode;
+ int nSize = 0;
+
+ /* Loop through all elements in the queue */
+ for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext)
+ ++nSize;
+
+ return nSize;
+}
+#endif
+
+
+/*
+ * PopMessage -
+ */
+
+static WMMsgNodePtr
+PopMessage (WMMsgQueuePtr pQueue)
+{
+ WMMsgNodePtr pNode;
+
+ /* Lock the queue mutex */
+ pthread_mutex_lock (&pQueue->pmMutex);
+
+ /* Wait for --- */
+ while (pQueue->pHead == NULL)
+ {
+ pthread_cond_wait (&pQueue->pcNotEmpty, &pQueue->pmMutex);
+ }
+
+ pNode = pQueue->pHead;
+ if (pQueue->pHead != NULL)
+ {
+ pQueue->pHead = pQueue->pHead->pNext;
+ }
+
+ if (pQueue->pTail == pNode)
+ {
+ pQueue->pTail = NULL;
+ }
+
+ /* Drop the number of elements in the queue by one */
+ --g_nQueueSize;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("Queue Size %d %d\n", g_nQueueSize, QueueSize(pQueue));
+#endif
+
+ /* Release the queue mutex */
+ pthread_mutex_unlock (&pQueue->pmMutex);
+
+ return pNode;
+}
+
+
+#if 0
+/*
+ * HaveMessage -
+ */
+
+static Bool
+HaveMessage (WMMsgQueuePtr pQueue, UINT msg, Window iWindow)
+{
+ WMMsgNodePtr pNode;
+
+ for (pNode = pQueue->pHead; pNode != NULL; pNode = pNode->pNext)
+ {
+ if (pNode->msg.msg==msg && pNode->msg.iWindow==iWindow)
+ return True;
+ }
+
+ return False;
+}
+#endif
+
+
+/*
+ * InitQueue - Initialize the Window Manager message queue
+ */
+
+static
+Bool
+InitQueue (WMMsgQueuePtr pQueue)
+{
+ /* Check if the pQueue pointer is NULL */
+ if (pQueue == NULL)
+ {
+ ErrorF ("InitQueue - pQueue is NULL. Exiting.\n");
+ return FALSE;
+ }
+
+ /* Set the head and tail to NULL */
+ pQueue->pHead = NULL;
+ pQueue->pTail = NULL;
+
+ /* There are no elements initially */
+ g_nQueueSize = 0;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("InitQueue - Queue Size %d %d\n", g_nQueueSize, QueueSize(pQueue));
+#endif
+
+ ErrorF ("InitQueue - Calling pthread_mutex_init\n");
+
+ /* Create synchronization objects */
+ pthread_mutex_init (&pQueue->pmMutex, NULL);
+
+ ErrorF ("InitQueue - pthread_mutex_init returned\n");
+ ErrorF ("InitQueue - Calling pthread_cond_init\n");
+
+ pthread_cond_init (&pQueue->pcNotEmpty, NULL);
+
+ ErrorF ("InitQueue - pthread_cond_init returned\n");
+
+ return TRUE;
+}
+
+
+/*
+ * GetWindowName -
+ */
+
+static void
+GetWindowName (Display *pDisplay, Window iWin, char **ppName)
+{
+ int nResult, nNum;
+ char **ppList;
+ XTextProperty xtpName;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("GetWindowName\n");
+#endif
+
+ /* Intialize ppName to NULL */
+ *ppName = NULL;
+
+ /* Try to get --- */
+ nResult = XGetWMName (pDisplay, iWin, &xtpName);
+ if (!nResult || !xtpName.value || !xtpName.nitems)
+ {
+ ErrorF ("GetWindowName - XGetWMName failed. No name.\n");
+ return;
+ }
+
+ /* */
+ if (xtpName.encoding == XA_STRING)
+ {
+ /* */
+ if (xtpName.value)
+ {
+ *ppName = strdup ((char*)xtpName.value);
+ XFree (xtpName.value);
+ }
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("XA_STRING %s\n", *ppName);
+#endif
+ }
+ else
+ {
+ XmbTextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum);
+
+ /* */
+ if (nNum && *ppList)
+ {
+ XFree (xtpName.value);
+ *ppName = strdup (*ppList);
+ XFreeStringList (ppList);
+ }
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("%s %s\n", XGetAtomName (pDisplay, xtpName.encoding), *ppName);
+#endif
+ }
+
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("-GetWindowName\n");
+#endif
+}
+
+
+/*
+ * Send a message to the X server from the WM thread
+ */
+
+static int
+SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData)
+{
+ XEvent e;
+
+ /* Prepare the X event structure */
+ e.type = ClientMessage;
+ e.xclient.window = iWin;
+ e.xclient.message_type = atmType;
+ e.xclient.format = 32;
+ e.xclient.data.l[0] = nData;
+ e.xclient.data.l[1] = CurrentTime;
+
+ /* Send the event to X */
+ return XSendEvent (pDisplay, iWin, False, NoEventMask, &e);
+}
+
+
+/*
+ * winMultiWindowWMProc
+ */
+
+static void *
+winMultiWindowWMProc (void *pArg)
+{
+ WMProcArgPtr pProcArg = (WMProcArgPtr)pArg;
+ WMInfoPtr pWMInfo = pProcArg->pWMInfo;
+
+ /* Initialize the Window Manager */
+ winInitMultiWindowWM (pWMInfo, pProcArg);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winMultiWindowWMProc ()\n");
+#endif
+
+ /* Loop until we explicity break out */
+ for (;;)
+ {
+ WMMsgNodePtr pNode;
+
+ /* Pop a message off of our queue */
+ pNode = PopMessage (&pWMInfo->wmMsgQueue);
+ if (pNode == NULL)
+ {
+ /* Bail if PopMessage returns without a message */
+ /* NOTE: Remember that PopMessage is a blocking function. */
+ ErrorF ("winMultiWindowWMProc - Queue is Empty?\n");
+ pthread_exit (NULL);
+ }
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winMultiWindowWMProc - %d ms MSG: %d ID: %d\n",
+ GetTickCount (), (int)pNode->msg.msg, (int)pNode->msg.dwID);
+#endif
+
+ /* Branch on the message type */
+ switch (pNode->msg.msg)
+ {
+#if 0
+ case WM_WM_MOVE:
+ ErrorF ("\tWM_WM_MOVE\n");
+ break;
+
+ case WM_WM_SIZE:
+ ErrorF ("\tWM_WM_SIZE\n");
+ break;
+#endif
+
+ case WM_WM_RAISE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tWM_WM_RAISE\n");
+#endif
+
+ /* Raise the window */
+ XRaiseWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
+ break;
+
+ case WM_WM_LOWER:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tWM_WM_LOWER\n");
+#endif
+
+ /* Lower the window */
+ XLowerWindow (pWMInfo->pDisplay, pNode->msg.iWindow);
+ break;
+
+ case WM_WM_MAP:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tWM_WM_MAP\n");
+#endif
+ {
+ XWindowAttributes attr;
+ char *pszName;
+#if 0
+ XWMHints *pHints;
+#endif
+
+ /* Get the window attributes */
+ XGetWindowAttributes (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ &attr);
+ if (!attr.override_redirect)
+ {
+ /* Set the Windows window name */
+ GetWindowName(pWMInfo->pDisplay, pNode->msg.iWindow, &pszName);
+ SetWindowText (pNode->msg.hwndWindow, pszName);
+ free (pszName);
+ }
+ }
+ break;
+
+ case WM_WM_UNMAP:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tWM_WM_UNMAP\n");
+#endif
+
+ /* Unmap the window */
+ XUnmapWindow(pWMInfo->pDisplay, pNode->msg.iWindow);
+ break;
+
+ case WM_WM_KILL:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tWM_WM_KILL\n");
+#endif
+ {
+ int i, n, found = 0;
+ Atom *protocols;
+
+ /* --- */
+ if (XGetWMProtocols (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ &protocols,
+ &n))
+ {
+ for (i = 0; i < n; ++i)
+ if (protocols[i] == pWMInfo->atmWmDelete)
+ ++found;
+
+ XFree (protocols);
+ }
+
+ /* --- */
+ if (found)
+ SendXMessage (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmWmProtos,
+ pWMInfo->atmWmDelete);
+ else
+ XKillClient (pWMInfo->pDisplay,
+ pNode->msg.iWindow);
+ }
+ break;
+
+ case WM_WM_ACTIVATE:
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("\tWM_WM_ACTIVATE\n");
+#endif
+
+ /* Set the input focus */
+ XSetInputFocus (pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ RevertToPointerRoot,
+ CurrentTime);
+ break;
+
+ case WM_WM_X_EVENT:
+ /* Process all X events in the Window Manager event queue */
+ FlushXEvents (pWMInfo);
+ break;
+
+ default:
+ ErrorF ("winMultiWindowWMProc - Unknown Message.\n");
+ pthread_exit (NULL);
+ break;
+ }
+
+ /* Free the retrieved message */
+ free (pNode);
+
+ /* Flush any pending events on our display */
+ XFlush (pWMInfo->pDisplay);
+ }
+
+ /* Free the condition variable */
+ pthread_cond_destroy (&pWMInfo->wmMsgQueue.pcNotEmpty);
+
+ /* Free the mutex variable */
+ pthread_mutex_destroy (&pWMInfo->wmMsgQueue.pmMutex);
+
+ /* Free the passed-in argument */
+ free (pProcArg);
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF("-winMultiWindowWMProc ()\n");
+#endif
+}
+
+
+/*
+ * FlushXEvents - Process any pending X events
+ */
+
+static Bool
+FlushXEvents (WMInfoPtr pWMInfo)
+{
+ XEvent event;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("FlushXEvents ()\n");
+#endif
+
+ /* Process all pending events */
+ while (XPending (pWMInfo->pDisplay))
+ {
+ /* Get the next event - will not block because one is ready */
+ XNextEvent (pWMInfo->pDisplay, &event);
+
+#if 0
+ /* Branch on the event type */
+ switch (event.type)
+ {
+ }
+#endif
+ }
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("-FlushXEvents ()\n");
+#endif
+
+ return True;
+}
+
+
+/*
+ * winMultiWindowWMErrorHandler - Our application specific error handler
+ */
+
+static int
+winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr)
+{
+ char pszErrorMsg[100];
+
+ if (pErr->request_code == X_ChangeWindowAttributes
+ && pErr->error_code == BadAccess)
+ {
+ ErrorF ("ChangeWindowAttributes BadAccess.\n");
+ pthread_exit (NULL);
+ }
+
+ XGetErrorText (pDisplay,
+ pErr->error_code,
+ pszErrorMsg,
+ sizeof (pszErrorMsg));
+ ErrorF ("ERROR: %s\n", pszErrorMsg);
+
+ if (pErr->error_code==BadWindow
+ || pErr->error_code==BadMatch
+ || pErr->error_code==BadDrawable)
+ {
+ pthread_exit (NULL);
+ }
+
+ pthread_exit (NULL);
+ return 0;
+}
+
+
+/*
+ * winInitWM - Entry point for the X server to spawn
+ * the Window Manager thread. Called from
+ * winscrinit.c/winFinishScreenInitFB ().
+ */
+
+Bool
+winInitWM (void **ppWMInfo,
+ pthread_t *ptWMProc,
+ pthread_mutex_t *ppmServerStarted,
+ int dwScreen)
+{
+ WMProcArgPtr pArg = (WMProcArgPtr)malloc (sizeof(WMProcArgRec));
+ WMInfoPtr pWMInfo = (WMInfoPtr)malloc (sizeof(WMInfoRec));
+
+ /* Bail if the input parameters are bad */
+ if (pArg == NULL || pWMInfo == NULL)
+ {
+ ErrorF ("winInitWM - malloc fail.\n");
+ return FALSE;
+ }
+
+ /* Set a return pointer to the Window Manager info structure */
+ *ppWMInfo = pWMInfo;
+
+ /* Setup the argument structure for the thread function */
+ pArg->dwScreen = dwScreen;
+ pArg->pWMInfo = pWMInfo;
+ pArg->ppmServerStarted = ppmServerStarted;
+
+ /* Intialize the message queue */
+ if (!InitQueue (&pWMInfo->wmMsgQueue))
+ {
+ ErrorF ("winInitWM - InitQueue () failed.\n");
+ return FALSE;
+ }
+
+ /* Spawn a thread for the Window Manager */
+ if (pthread_create (ptWMProc, NULL, winMultiWindowWMProc, pArg))
+ {
+ /* Bail if thread creation failed */
+ ErrorF ("winInitWM - pthread_create failed.\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG || YES
+ ErrorF ("winInitWM - Returning.\n");
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * winInitMultiWindowWM -
+ */
+
+Bool
+winClipboardDetectUnicodeSupport ();
+
+static void
+winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
+{
+ int iRetries = 0;
+ char pszDisplay[512];
+ int iReturn;
+ Bool fUnicodeSupport;
+
+ ErrorF ("winInitMultiWindowWM - Hello\n");
+
+ /* Check that argument pointer is not invalid */
+ if (pProcArg == NULL)
+ {
+ ErrorF ("winInitMultiWindowWM - pProcArg is NULL, bailing.\n");
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winInitMultiWindowWM - Calling pthread_mutex_lock ()\n");
+
+ /* Grab our garbage mutex to satisfy pthread_cond_wait */
+ iReturn = pthread_mutex_lock (pProcArg->ppmServerStarted);
+ if (iReturn != 0)
+ {
+ ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () failed: %d\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winInitMultiWindowWM - pthread_mutex_lock () returned.\n");
+
+ /* Do we have Unicode support? */
+ fUnicodeSupport = winClipboardDetectUnicodeSupport ();
+
+ /* Set the current locale? What does this do? */
+ if (fUnicodeSupport && !g_fCalledSetLocale)
+ {
+ ErrorF ("winInitMultiWindowWM - Calling setlocale ()\n");
+ if (!setlocale (LC_ALL, ""))
+ {
+ ErrorF ("winInitMultiWindowWM - setlocale () error\n");
+ pthread_exit (NULL);
+ }
+ ErrorF ("winInitMultiWindowWM - setlocale () returned\n");
+
+ /* See if X supports the current locale */
+ if (XSupportsLocale () == False)
+ {
+ ErrorF ("winInitMultiWindowWM - Locale not supported by X\n");
+ pthread_exit (NULL);
+ }
+ }
+
+ /* Flag that we have called setlocale */
+ g_fCalledSetLocale = TRUE;
+
+ /* Release the garbage mutex */
+ pthread_mutex_unlock (pProcArg->ppmServerStarted);
+
+ ErrorF ("winInitMultiWindowWM - pthread_mutex_unlock () returned.\n");
+
+ /* Allow multiple threads to access Xlib */
+ if (XInitThreads () == 0)
+ {
+ ErrorF ("winInitMultiWindowWM - XInitThreads () failed.\n");
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winInitMultiWindowWM - XInitThreads () returned.\n");
+
+ /* Set jump point for Error exits */
+ iReturn = setjmp (g_jmpEntry);
+
+ /* Check if we should continue operations */
+ if (iReturn != WIN_JMP_ERROR_IO
+ && iReturn != WIN_JMP_OKAY)
+ {
+ /* setjmp returned an unknown value, exit */
+ ErrorF ("winInitMultiWindowWM - setjmp returned: %d exiting\n",
+ iReturn);
+ pthread_exit (NULL);
+ }
+ else if (iReturn == WIN_JMP_ERROR_IO)
+ {
+ ErrorF ("winInitMultiWindowWM - setjmp returned WIN_JMP_ERROR_IO\n");
+ }
+
+ /* Setup the display connection string x */
+ snprintf (pszDisplay, 512, "127.0.0.1:%s.%d", display, pProcArg->dwScreen);
+
+ /* Print the display connection string */
+ ErrorF ("winInitMultiWindowWM - DISPLAY=%s\n", pszDisplay);
+
+ /* Open the X display */
+ do
+ {
+ /* Try to open the display */
+ pWMInfo->pDisplay = XOpenDisplay (pszDisplay);
+ if (pWMInfo->pDisplay == NULL)
+ {
+ ErrorF ("winInitMultiWindowWM - Could not open display, try: %d, "
+ "sleeping: %d\n\f",
+ iRetries + 1, WIN_CONNECT_DELAY);
+ ++iRetries;
+ sleep (WIN_CONNECT_DELAY);
+ continue;
+ }
+ else
+ break;
+ }
+ while (pWMInfo->pDisplay == NULL && iRetries < WIN_CONNECT_RETRIES);
+
+ /* Make sure that the display opened */
+ if (pWMInfo->pDisplay == NULL)
+ {
+ ErrorF ("winInitMultiWindowWM - Failed opening the display, "
+ "giving up.\n\f");
+ pthread_exit (NULL);
+ }
+
+ ErrorF ("winInitMultiWindowWM - XOpenDisplay () returned and "
+ "successfully opened the display.\n");
+
+ /* Install our error handler */
+ XSetErrorHandler (winMultiWindowWMErrorHandler);
+ XSetIOErrorHandler (winMutliWindowWMIOErrorHandler);
+
+ /* Create some atoms */
+ pWMInfo->atmWmProtos = XInternAtom (pWMInfo->pDisplay,
+ "WM_PROTOCOLS",
+ False);
+ pWMInfo->atmWmDelete = XInternAtom (pWMInfo->pDisplay,
+ "WM_DELETE_WINDOW",
+ False);
+}
+
+
+/*
+ * winSendMessageToWM - Send a message from the X thread to the WM thread
+ */
+
+void
+winSendMessageToWM (void *pWMInfo, winWMMessagePtr pMsg)
+{
+ WMMsgNodePtr pNode;
+
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winSendMessageToWM ()\n");
+#endif
+
+ pNode = (WMMsgNodePtr)malloc(sizeof(WMMsgNodeRec));
+ if (pNode != NULL)
+ {
+ memcpy (&pNode->msg, pMsg, sizeof(winWMMessageRec));
+ PushMessage (&((WMInfoPtr)pWMInfo)->wmMsgQueue, pNode);
+ }
+}
+
+
+/*
+ * winMutliWindowWMIOErrorHandler - Our application specific IO error handler
+ */
+
+static int
+winMutliWindowWMIOErrorHandler (Display *pDisplay)
+{
+ printf ("\nwinMutliWindowWMIOErrorHandler!\n\n");
+
+ /* Restart at the main entry point */
+ longjmp (g_jmpEntry, WIN_JMP_ERROR_IO);
+
+ return 0;
+}
diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c
new file mode 100644
index 000000000..5fe8b4f38
--- /dev/null
+++ b/hw/xwin/winnativegdi.c
@@ -0,0 +1,454 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winnativegdi.c,v 1.13 2002/10/17 08:18:22 alanh Exp $ */
+
+#include "win.h"
+
+Bool
+winAllocateFBNativeGDI (ScreenPtr pScreen)
+{
+ FatalError ("winAllocateFBNativeGDI\n");
+
+ return TRUE;
+}
+
+/*
+ * We wrap whatever CloseScreen procedure was specified by fb;
+ * a pointer to said procedure is stored in our privates.
+ */
+Bool
+winCloseScreenNativeGDI (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ ErrorF ("winCloseScreenNativeGDI - Freeing screen resources\n");
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /*
+ * NOTE: mi doesn't use a CloseScreen procedure, so we do not
+ * need to call a wrapped procedure here.
+ */
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ ErrorF ("winCloseScreenNativeGDI - Destroying window\n");
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+ /* Invalidate our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Free the screen privates for this screen */
+ free (pScreenPriv);
+
+ ErrorF ("winCloseScreenNativeGDI - Returning\n");
+
+ return TRUE;
+}
+
+
+void
+winShadowUpdateNativeGDI (ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ FatalError ("winShadowUpdateNativeGDI\n");
+ return;
+}
+
+
+Bool
+winInitVisualsNativeGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set the bitsPerRGB and bit masks */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ pScreenPriv->dwBitsPerRGB = 8;
+ pScreenPriv->dwRedMask = 0x00FF0000;
+ pScreenPriv->dwGreenMask = 0x0000FF00;
+ pScreenPriv->dwBlueMask = 0x000000FF;
+ break;
+
+ case 16:
+ pScreenPriv->dwBitsPerRGB = 6;
+ pScreenPriv->dwRedMask = 0xF800;
+ pScreenPriv->dwGreenMask = 0x07E0;
+ pScreenPriv->dwBlueMask = 0x001F;
+ break;
+
+ case 15:
+ pScreenPriv->dwBitsPerRGB = 5;
+ pScreenPriv->dwRedMask = 0x7C00;
+ pScreenPriv->dwGreenMask = 0x03E0;
+ pScreenPriv->dwBlueMask = 0x001F;
+ break;
+
+ case 8:
+ pScreenPriv->dwBitsPerRGB = 8;
+ pScreenPriv->dwRedMask = 0;
+ pScreenPriv->dwGreenMask = 0;
+ pScreenPriv->dwBlueMask = 0;
+ break;
+
+ default:
+ ErrorF ("winInitVisualsNativeGDI - Unknown screen depth\n");
+ return FALSE;
+ break;
+ }
+
+ /* Tell the user how many bits per RGB we are using */
+ ErrorF ("winInitVisualsNativeGDI - Using dwBitsPerRGB: %d\n",
+ pScreenPriv->dwBitsPerRGB);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ TrueColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisuals - miSetVisualTypesAndMasks failed\n");
+ return FALSE;
+ }
+ break;
+
+ case 8:
+ ErrorF ("winInitVisuals - Calling miSetVisualTypesAndMasks\n");
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ StaticColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ StaticColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisuals - miSetVisualTypesAndMasks failed\n");
+ return FALSE;
+ }
+ break;
+
+ default:
+ ErrorF ("winInitVisualsNativeGDI - Unknown screen depth\n");
+ return FALSE;
+ }
+
+#if 1
+ ErrorF ("winInitVisualsNativeGDI - Returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/* Adjust the video mode */
+Bool
+winAdjustVideoModeNativeGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc = NULL;
+ DWORD dwBPP;
+
+ hdc = GetDC (NULL);
+
+ /* We're in serious trouble if we can't get a DC */
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModeNativeGDI - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* GDI cannot change the screen depth */
+ if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
+ {
+ /* No -depth parameter passed, let the user know the depth being used */
+ ErrorF ("winAdjustVideoModeNativeGDI - Using Windows display "
+ "depth of %d bits per pixel\n", dwBPP);
+
+ /* Use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+ else if (dwBPP != pScreenInfo->dwBPP)
+ {
+ /* Warn user if GDI depth is different than -depth parameter */
+ ErrorF ("winAdjustVideoModeNativeGDI - Command line bpp: %d, "\
+ "using bpp: %d\n", pScreenInfo->dwBPP, dwBPP);
+
+ /* We'll use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+
+ return TRUE;
+}
+
+
+Bool
+winActivateAppNativeGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /*
+ * Are we active?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->fActive
+ && pScreenInfo->fFullScreen)
+ {
+ /*
+ * Activating, attempt to bring our window
+ * to the top of the display
+ */
+ ShowWindow (pScreenPriv->hwndScreen, SW_RESTORE);
+ }
+
+ /*
+ * Are we inactive?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv != NULL
+ && !pScreenPriv->fActive
+ && pScreenInfo->fFullScreen)
+ {
+ /*
+ * Deactivating, stuff our window onto the
+ * task bar.
+ */
+ ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE);
+ }
+
+ return TRUE;
+}
+
+
+HBITMAP
+winCreateDIBNativeGDI (int iWidth, int iHeight, int iDepth,
+ BYTE **ppbBits, BITMAPINFO **ppbmi)
+{
+ BITMAPINFOHEADER *pbmih = NULL;
+ HBITMAP hBitmap = NULL;
+ BITMAPINFO *pbmi = NULL;
+
+ /* Don't create an invalid bitmap */
+ if (iWidth == 0
+ || iHeight == 0
+ || iDepth == 0)
+ {
+ ErrorF ("\nwinCreateDIBNativeGDI - Invalid specs w %d h %d d %d\n\n",
+ iWidth, iHeight, iDepth);
+ return NULL;
+ }
+
+ /* Allocate bitmap info header */
+ pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
+ + 256 * sizeof (RGBQUAD));
+ if (pbmih == NULL)
+ {
+ ErrorF ("winCreateDIBNativeGDI - malloc () failed\n");
+ return FALSE;
+ }
+ ZeroMemory (pbmih, sizeof(BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD));
+
+ /* Describe bitmap to be created */
+ pbmih->biSize = sizeof (BITMAPINFOHEADER);
+ pbmih->biWidth = iWidth;
+ pbmih->biHeight = -iHeight;
+ pbmih->biPlanes = 1;
+ pbmih->biBitCount = iDepth;
+ pbmih->biCompression = BI_RGB;
+ pbmih->biSizeImage = 0;
+ pbmih->biXPelsPerMeter = 0;
+ pbmih->biYPelsPerMeter = 0;
+ pbmih->biClrUsed = 0;
+ pbmih->biClrImportant = 0;
+
+ /* Setup color table for mono DIBs */
+ if (iDepth == 1)
+ {
+ pbmi = (BITMAPINFO*) pbmih;
+ pbmi->bmiColors[1].rgbBlue = 255;
+ pbmi->bmiColors[1].rgbGreen = 255;
+ pbmi->bmiColors[1].rgbRed = 255;
+ }
+
+ /* Create a DIB with a bit pointer */
+ hBitmap = CreateDIBSection (NULL,
+ (BITMAPINFO *) pbmih,
+ DIB_RGB_COLORS,
+ (void **) ppbBits,
+ NULL,
+ 0);
+ if (hBitmap == NULL)
+ {
+ ErrorF ("winCreateDIBNativeGDI - CreateDIBSection () failed\n");
+ return NULL;
+ }
+
+ /* Free the bitmap info header memory */
+ if (ppbmi != NULL)
+ {
+ /* Store the address of the BMIH in the ppbmih parameter */
+ *ppbmi = (BITMAPINFO *) pbmih;
+ }
+ else
+ {
+ free (pbmih);
+ pbmih = NULL;
+ }
+
+ return hBitmap;
+}
+
+
+Bool
+winBltExposedRegionsNativeGDI (ScreenPtr pScreen)
+{
+
+ return TRUE;
+}
+
+
+Bool
+winRedrawScreenNativeGDI (ScreenPtr pScreen)
+{
+ FatalError ("winRedrawScreenNativeGDI\n");
+ return TRUE;
+}
+
+
+Bool
+winRealizeInstalledPaletteNativeGDI (ScreenPtr pScreen)
+{
+ FatalError ("winRealizeInstalledPaletteNativeGDI\n");
+ return TRUE;
+}
+
+
+Bool
+winInstallColormapNativeGDI (ColormapPtr pColormap)
+{
+ FatalError ("winInstallColormapNativeGDI\n");
+ return TRUE;
+}
+
+
+Bool
+winStoreColorsNativeGDI (ColormapPtr pmap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ FatalError ("winStoreColorsNativeGDI\n");
+ return TRUE;
+}
+
+
+Bool
+winCreateColormapNativeGDI (ColormapPtr pColormap)
+{
+ FatalError ("winCreateColormapNativeGDI\n");
+ return TRUE;
+}
+
+
+Bool
+winDestroyColormapNativeGDI (ColormapPtr pColormap)
+{
+ FatalError ("winDestroyColormapNativeGDI\n");
+ return TRUE;
+}
+
+
+/* Set engine specific funtions */
+Bool
+winSetEngineFunctionsNativeGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBNativeGDI;
+ pScreenPriv->pwinShadowUpdate = winShadowUpdateNativeGDI;
+ pScreenPriv->pwinCloseScreen = winCloseScreenNativeGDI;
+ pScreenPriv->pwinInitVisuals = winInitVisualsNativeGDI;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeNativeGDI;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitNativeGDI;
+ /*
+ * WARNING: Do not set the BltExposedRegions procedure pointer to anything
+ * other than NULL until a working painting procedure is in place.
+ * Else, winWindowProc will get stuck in an infinite loop because
+ * Windows expects the BeginPaint and EndPaint functions to be called
+ * before a WM_PAINT message can be removed from the queue. We are
+ * using NULL here as a signal for winWindowProc that it should
+ * not signal that the WM_PAINT message has been processed.
+ */
+ pScreenPriv->pwinBltExposedRegions = NULL;
+ pScreenPriv->pwinActivateApp = winActivateAppNativeGDI;
+ pScreenPriv->pwinRedrawScreen = winRedrawScreenNativeGDI;
+ pScreenPriv->pwinRealizeInstalledPalette =
+ winRealizeInstalledPaletteNativeGDI;
+ pScreenPriv->pwinInstallColormap = winInstallColormapNativeGDI;
+ pScreenPriv->pwinStoreColors = winStoreColorsNativeGDI;
+ pScreenPriv->pwinCreateColormap = winCreateColormapNativeGDI;
+ pScreenPriv->pwinDestroyColormap = winDestroyColormapNativeGDI;
+ pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
+
+ return TRUE;
+}
diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c
new file mode 100644
index 000000000..59d22247e
--- /dev/null
+++ b/hw/xwin/winpfbdd.c
@@ -0,0 +1,636 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpfbdd.c,v 1.17 2002/10/17 08:18:22 alanh Exp $ */
+
+#include "win.h"
+
+
+/*
+ * Create a DirectDraw primary surface
+ */
+
+Bool
+winAllocateFBPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC ddsd;
+ DDSURFACEDESC *pddsdPrimary = NULL;
+ DDSURFACEDESC *pddsdOffscreen = NULL;
+ RECT rcClient;
+
+ ErrorF ("winAllocateFBPrimaryDD\n");
+
+ /* Get client area location in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Create a DirectDraw object, store the address at lpdd */
+ ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL);
+ if (ddrval != DD_OK)
+ FatalError ("winAllocateFBPrimaryDD - Could not start DirectDraw\n");
+
+ /* Get a DirectDraw2 interface pointer */
+ ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
+ &IID_IDirectDraw2,
+ (LPVOID*) &pScreenPriv->pdd2);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+
+ ErrorF ("winAllocateFBPrimaryDD - Created and initialized DD\n");
+
+ /* Are we windowed or fullscreen? */
+ if (pScreenInfo->fFullScreen)
+ {
+ /* Full screen mode */
+ ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
+ pScreenPriv->hwndScreen,
+ DDSCL_FULLSCREEN
+ | DDSCL_EXCLUSIVE);
+ if (FAILED (ddrval))
+ FatalError ("winAllocateFBPrimaryDD - Could not set "
+ "cooperative level\n");
+
+ /* Change the video mode to the mode requested */
+ ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ pScreenInfo->dwRefreshRate,
+ 0);
+ if (FAILED (ddrval))
+ FatalError ("winAllocateFBPrimaryDD - Could not set "
+ "full screen display mode\n");
+ }
+ else
+ {
+ /* Windowed mode */
+ ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
+ pScreenPriv->hwndScreen,
+ DDSCL_NORMAL);
+ if (FAILED (ddrval))
+ FatalError ("winAllocateFBPrimaryDD - Could not set "
+ "cooperative level\n");
+ }
+
+ /* Describe the primary surface */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ /* Create the primary surface */
+ ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
+ &ddsd,
+ &pScreenPriv->pddsPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ FatalError ("winAllocateFBPrimaryDD - Could not create primary "
+ "surface %08x\n", ddrval);
+
+ ErrorF ("winAllocateFBPrimaryDD - Created primary\n");
+
+ /* Allocate a DD surface description for our screen privates */
+ pddsdPrimary = pScreenPriv->pddsdPrimary
+ = malloc (sizeof (DDSURFACEDESC));
+ if (pddsdPrimary == NULL)
+ FatalError ("winAllocateFBPrimaryDD - Could not allocate surface "
+ "description memory\n");
+ ZeroMemory (pddsdPrimary, sizeof (*pddsdPrimary));
+ pddsdPrimary->dwSize = sizeof (*pddsdPrimary);
+
+ /* Describe the offscreen surface to be created */
+ /*
+ * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
+ ddsd.dwHeight = pScreenInfo->dwHeight;
+ ddsd.dwWidth = pScreenInfo->dwWidth;
+
+ /* Create the shadow surface */
+ ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
+ &ddsd,
+ &pScreenPriv->pddsOffscreen,
+ NULL);
+ if (ddrval != DD_OK)
+ FatalError ("winAllocateFBPrimaryDD - Could not create shadow "
+ "surface\n");
+
+ ErrorF ("winAllocateFBPrimaryDD - Created offscreen\n");
+
+ /* Allocate a DD surface description for our screen privates */
+ pddsdOffscreen = pScreenPriv->pddsdOffscreen
+ = malloc (sizeof (DDSURFACEDESC));
+ if (pddsdOffscreen == NULL)
+ FatalError ("winAllocateFBPrimaryDD - Could not allocate surface "
+ "description memory\n");
+ ZeroMemory (pddsdOffscreen, sizeof (*pddsdOffscreen));
+ pddsdOffscreen->dwSize = sizeof (*pddsdOffscreen);
+
+ ErrorF ("winAllocateFBPrimaryDD - Locking primary\n");
+
+ /* Lock the primary surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary,
+ pScreenInfo->fFullScreen ? NULL:&rcClient,
+ pddsdPrimary,
+ DDLOCK_WAIT,
+ NULL);
+ if (ddrval != DD_OK || pddsdPrimary->lpSurface == NULL)
+ FatalError ("winAllocateFBPrimaryDD - Could not lock "
+ "primary surface\n");
+
+ ErrorF ("winAllocateFBPrimaryDD - Locked primary\n");
+
+ /* We don't know how to deal with anything other than RGB */
+ if (!(pddsdPrimary->ddpfPixelFormat.dwFlags & DDPF_RGB))
+ FatalError ("winAllocateFBPrimaryDD - Color format other than RGB\n");
+
+ /* Grab the pitch from the surface desc */
+ pScreenInfo->dwStride = (pddsdPrimary->u1.lPitch * 8)
+ / pScreenInfo->dwBPP;
+
+ /* Save the pointer to our surface memory */
+ pScreenInfo->pfb = pddsdPrimary->lpSurface;
+
+ /* Grab the color depth and masks from the surface description */
+ pScreenPriv->dwRedMask = pddsdPrimary->ddpfPixelFormat.u2.dwRBitMask;
+ pScreenPriv->dwGreenMask = pddsdPrimary->ddpfPixelFormat.u3.dwGBitMask;
+ pScreenPriv->dwBlueMask = pddsdPrimary->ddpfPixelFormat.u4.dwBBitMask;
+
+ ErrorF ("winAllocateFBPrimaryDD - Returning\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
+
+Bool
+winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ Bool fReturn;
+
+ ErrorF ("winCloseScreenPrimaryDD - Freeing screen resources\n");
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /* Call the wrapped CloseScreen procedure */
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ /* Free the offscreen surface, if there is one */
+ if (pScreenPriv->pddsOffscreen)
+ {
+ IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen, NULL);
+ IDirectDrawSurface2_Release (pScreenPriv->pddsOffscreen);
+ pScreenPriv->pddsOffscreen = NULL;
+ }
+
+ /* Release the primary surface, if there is one */
+ if (pScreenPriv->pddsPrimary)
+ {
+ IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary, NULL);
+ IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary);
+ pScreenPriv->pddsPrimary = NULL;
+ }
+
+ /* Free the DirectDraw object, if there is one */
+ if (pScreenPriv->pdd)
+ {
+ IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd);
+ IDirectDraw2_Release (pScreenPriv->pdd);
+ pScreenPriv->pdd = NULL;
+ }
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+ /* Kill our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Invalidate the ScreenInfo's fb pointer */
+ pScreenInfo->pfb = NULL;
+
+ /* Free the screen privates for this screen */
+ free ((pointer) pScreenPriv);
+
+ return fReturn;
+}
+
+
+/*
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
+
+Bool
+winInitVisualsPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
+
+ /* Count the number of ones in each color mask */
+ dwRedBits = winCountBits (pScreenPriv->dwRedMask);
+ dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
+ dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
+
+ /* Store the maximum number of ones in a color mask as the bitsPerRGB */
+ if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ ErrorF ("winInitVisualsPrimaryDD - Masks: %08x %08x %08x bpRGB: %d\n",
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask,
+ pScreenPriv->dwBitsPerRGB);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ TrueColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsPrimaryDD - "
+ "miSetVisualTypesAndMasks failed\n");
+ return FALSE;
+ }
+ break;
+
+ case 8:
+#if CYGDEBUG
+ ErrorF ("winInitVisuals - Calling miSetVisualTypesAndMasks\n");
+#endif /* CYGDEBUG */
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ PseudoColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ PseudoColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsPrimaryDD - "
+ "miSetVisualTypesAndMasks failed\n");
+ return FALSE;
+ }
+#if CYGDEBUG
+ ErrorF ("winInitVisualsPrimaryDD - Returned from "
+ "miSetVisualTypesAndMasks\n");
+#endif /* CYGDEBUG */
+ break;
+
+ default:
+ ErrorF ("winInitVisualsPrimaryDD - Unknown screen depth\n");
+ return FALSE;
+ }
+
+ ErrorF ("winInitVisualsPrimaryDD - Returning\n");
+
+ return TRUE;
+}
+
+
+Bool
+winAdjustVideoModePrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc = NULL;
+ DWORD dwBPP;
+
+ /* We're in serious trouble if we can't get a DC */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModePrimaryDD - GetDC failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* DirectDraw can only change the depth in fullscreen mode */
+ if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
+ {
+ /* No -depth parameter passed, let the user know the depth being used */
+ ErrorF ("winAdjustVideoModePrimaryDD - Using Windows display "
+ "depth of %d bits per pixel\n", dwBPP);
+
+ /* Use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+ else if (pScreenInfo->fFullScreen
+ && pScreenInfo->dwBPP != dwBPP)
+ {
+ /* FullScreen, and GDI depth differs from -depth parameter */
+ ErrorF ("winAdjustVideoModePrimaryDD - FullScreen, using command "
+ "line depth: %d\n", pScreenInfo->dwBPP);
+ }
+ else if (dwBPP != pScreenInfo->dwBPP)
+ {
+ /* Windowed, and GDI depth differs from -depth parameter */
+ ErrorF ("winAdjustVideoModePrimaryDD - Windowed, command line "
+ "depth: %d, using depth: %d\n",
+ pScreenInfo->dwBPP, dwBPP);
+
+ /* We'll use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+
+ return TRUE;
+}
+
+
+/*
+ * We need to blit our offscreen fb to
+ * the screen when we are activated, and we need to point
+ * the fb code back to the primary surface memory.
+ */
+
+Bool
+winActivateAppPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcSrc, rcClient;
+ HRESULT ddrval = DD_OK;
+
+ /* Check for errors */
+ if (pScreenPriv == NULL
+ || pScreenPriv->pddsPrimary == NULL
+ || pScreenPriv->pddsOffscreen == NULL)
+ return FALSE;
+
+ /* Check for do-nothing */
+ if (!pScreenPriv->fActive)
+ return TRUE;
+
+ /* We are activating */
+ ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsOffscreen);
+ if (ddrval == DD_OK)
+ {
+ IDirectDrawSurface2_Unlock (pScreenPriv->pddsOffscreen,
+ NULL);
+ /*
+ * We don't check for an error from Unlock, because it
+ * doesn't matter if the Unlock failed.
+ */
+ }
+
+ /* Restore both surfaces, just cause I like it that way */
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen);
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
+
+ /* Get client area in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Setup a source rectangle */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcClient,
+ pScreenPriv->pddsOffscreen,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (ddrval != DD_OK)
+ FatalError ("winActivateAppPrimaryDD () - Failed blitting offscreen "
+ "surface to primary surface %08x\n", ddrval);
+
+ /* Lock the primary surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsPrimary,
+ &rcClient,
+ pScreenPriv->pddsdPrimary,
+ DDLOCK_WAIT,
+ NULL);
+ if (ddrval != DD_OK
+ || pScreenPriv->pddsdPrimary->lpSurface == NULL)
+ FatalError ("winActivateAppPrimaryDD () - Could not lock "
+ "primary surface\n");
+
+ /* Notify FB of the new memory pointer */
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdPrimary->lpSurface);
+
+ /*
+ * Register the Alt-Tab combo as a hotkey so we can copy
+ * the primary framebuffer before the display mode changes
+ */
+ RegisterHotKey (pScreenPriv->hwndScreen, 1, MOD_ALT, 9);
+
+ return TRUE;
+}
+
+
+/*
+ * Handle the Alt+Tab hotkey.
+ *
+ * We need to save the primary fb to an offscreen fb when
+ * we get deactivated, and point the fb code at the offscreen
+ * fb for the duration of the deactivation.
+ */
+
+Bool
+winHotKeyAltTabPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcClient, rcSrc;
+ HRESULT ddrval = DD_OK;
+
+ ErrorF ("\nwinHotKeyAltTabPrimaryDD\n\n");
+
+ /* Alt+Tab was pressed, we will lose focus very soon */
+ pScreenPriv->fActive = FALSE;
+
+ /* Check for error conditions */
+ if (pScreenPriv->pddsPrimary == NULL
+ || pScreenPriv->pddsOffscreen == NULL)
+ return FALSE;
+
+ /* Get client area in screen coords */
+ GetClientRect (pScreenPriv->hwndScreen, &rcClient);
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&rcClient, 2);
+
+ /* Did we loose the primary surface? */
+ ddrval = IDirectDrawSurface2_IsLost (pScreenPriv->pddsPrimary);
+ if (ddrval == DD_OK)
+ {
+ ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ FatalError ("winHotKeyAltTabPrimaryDD - Failed unlocking primary "
+ "surface\n");
+ }
+
+ /* Setup a source rectangle */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Blit the primary surface to the offscreen surface */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen,
+ NULL, /* should be rcDest */
+ pScreenPriv->pddsPrimary,
+ NULL,
+ DDBLT_WAIT,
+ NULL);
+ if (ddrval == DDERR_SURFACELOST)
+ {
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsOffscreen);
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
+
+ /* Blit the primary surface to the offscreen surface */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsOffscreen,
+ NULL,
+ pScreenPriv->pddsPrimary,
+ NULL,
+ DDBLT_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ FatalError ("winHotKeyAltTabPrimaryDD - Failed blitting primary "
+ "surface to offscreen surface: %08x\n",
+ ddrval);
+ }
+ else
+ {
+ FatalError ("winHotKeyAltTabPrimaryDD - Unknown error from "
+ "Blt: %08dx\n", ddrval);
+ }
+
+ /* Lock the offscreen surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsOffscreen,
+ NULL,
+ pScreenPriv->pddsdOffscreen,
+ DDLOCK_WAIT,
+ NULL);
+ if (ddrval != DD_OK
+ || pScreenPriv->pddsdPrimary->lpSurface == NULL)
+ FatalError ("winHotKeyAltTabPrimaryDD - Could not lock "
+ "offscreen surface\n");
+
+ /* Notify FB of the new memory pointer */
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdOffscreen->lpSurface);
+
+ /* Unregister our hotkey */
+ UnregisterHotKey (pScreenPriv->hwndScreen, 1);
+
+ return TRUE;
+}
+
+
+/* Set engine specific functions */
+Bool
+winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBPrimaryDD;
+ pScreenPriv->pwinShadowUpdate
+ = (winShadowUpdateProcPtr) (void (*)())NoopDDA;
+ pScreenPriv->pwinCloseScreen = winCloseScreenPrimaryDD;
+ pScreenPriv->pwinInitVisuals = winInitVisualsPrimaryDD;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModePrimaryDD;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions
+ = (winBltExposedRegionsProcPtr) (void (*)())NoopDDA;
+ pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD;
+ pScreenPriv->pwinHotKeyAltTab = winHotKeyAltTabPrimaryDD;
+
+ return TRUE;
+}
diff --git a/hw/xwin/winpixmap.c b/hw/xwin/winpixmap.c
new file mode 100644
index 000000000..519acedf5
--- /dev/null
+++ b/hw/xwin/winpixmap.c
@@ -0,0 +1,206 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: drewry, september 1986
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpixmap.c,v 1.10 2002/10/17 08:18:24 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 34 */
+/* See mfb/mfbpixmap.c - mfbCreatePixmap() */
+PixmapPtr
+winCreatePixmapNativeGDI (ScreenPtr pScreen,
+ int iWidth, int iHeight,
+ int iDepth)
+{
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ PixmapPtr pPixmap = NULL;
+
+ /* Allocate pixmap memory */
+ pPixmap = AllocatePixmap (pScreen, 0);
+ if (!pPixmap)
+ {
+ ErrorF ("winCreatePixmapNativeGDI () - Couldn't allocate a pixmap\n");
+ return NullPixmap;
+ }
+
+ ErrorF ("winCreatePixmap () - w %d h %d d %d bw %d\n",
+ iWidth, iHeight, iDepth,
+ PixmapBytePad (iWidth, iDepth));
+
+ /* Setup pixmap values */
+ pPixmap->drawable.type = DRAWABLE_PIXMAP;
+ pPixmap->drawable.class = 0;
+ pPixmap->drawable.pScreen = pScreen;
+ pPixmap->drawable.depth = iDepth;
+ pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
+ pPixmap->drawable.id = 0;
+ pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ pPixmap->drawable.x = 0;
+ pPixmap->drawable.y = 0;
+ pPixmap->drawable.width = iWidth;
+ pPixmap->drawable.height = iHeight;
+ pPixmap->devKind = 0;
+ pPixmap->refcnt = 1;
+ pPixmap->devPrivate.ptr = NULL;
+
+ /* Pixmap privates are allocated by AllocatePixmap */
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ /* Initialize pixmap privates */
+ pPixmapPriv->hBitmap = NULL;
+ pPixmapPriv->hdcSelected = NULL;
+ pPixmapPriv->pbBits = NULL;
+ pPixmapPriv->dwScanlineBytes = PixmapBytePad (iWidth, iDepth);
+
+ /* Check for zero width or height pixmaps */
+ if (iWidth == 0 || iHeight == 0)
+ {
+ /* Don't allocate a real pixmap, just set fields and return */
+ return pPixmap;
+ }
+
+ /* Create a DIB for the pixmap */
+ pPixmapPriv->hBitmap = winCreateDIBNativeGDI (iWidth, iHeight, iDepth,
+ &pPixmapPriv->pbBits,
+ (BITMAPINFO **) &pPixmapPriv->pbmih);
+
+#if CYGDEBUG
+ ErrorF ("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " \
+ "screen: %08x\n",
+ pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen);
+#endif
+
+ return pPixmap;
+}
+
+
+/*
+ * See Porting Layer Definition - p. 35
+ *
+ * See mfb/mfbpixmap.c - mfbDestroyPixmap()
+ */
+
+Bool
+winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
+{
+ winPrivPixmapPtr pPixmapPriv = NULL;
+
+ ErrorF ("winDestroyPixmapNativeGDI ()\n");
+
+ /* Bail early if there is not a pixmap to destroy */
+ if (pPixmap == NULL)
+ {
+ ErrorF ("winDestroyPixmapNativeGDI () - No pixmap to destroy\n");
+ return TRUE;
+ }
+
+ /* Get a handle to the pixmap privates */
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ ErrorF ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n",
+ pPixmapPriv->hBitmap);
+
+ /* Decrement reference count, return if nonzero */
+ --pPixmap->refcnt;
+ if (pPixmap->refcnt != 0)
+ return TRUE;
+
+ /* Free GDI bitmap */
+ if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap);
+
+ /* Free the bitmap info header memory */
+ if (pPixmapPriv->pbmih != NULL)
+ {
+ free (pPixmapPriv->pbmih);
+ pPixmapPriv->pbmih = NULL;
+ }
+
+ /* Free the pixmap memory */
+ free (pPixmap);
+ pPixmap = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Not used yet
+ */
+
+Bool
+winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap,
+ int iWidth, int iHeight,
+ int iDepth,
+ int iBitsPerPixel,
+ int devKind,
+ pointer pPixData)
+{
+ FatalError ("winModifyPixmapHeaderNativeGDI ()\n");
+ return TRUE;
+}
+
+
+/*
+ * Not used yet.
+ * See cfb/cfbpixmap.c
+ */
+
+void
+winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw)
+{
+ ErrorF ("winXRotatePixmap()\n");
+ /* fill in this function, look at CFB */
+}
+
+
+/*
+ * Not used yet.
+ * See cfb/cfbpixmap.c
+ */
+void
+winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh)
+{
+ ErrorF ("winYRotatePixmap()\n");
+ /* fill in this function, look at CFB */
+}
+
+
+/*
+ * Not used yet.
+ * See cfb/cfbpixmap.c
+ */
+
+void
+winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
+ int xrot, int yrot)
+{
+ ErrorF ("winCopyRotatePixmap()\n");
+ /* fill in this function, look at CFB */
+}
diff --git a/hw/xwin/winpntwin.c b/hw/xwin/winpntwin.c
new file mode 100644
index 000000000..d28929d67
--- /dev/null
+++ b/hw/xwin/winpntwin.c
@@ -0,0 +1,45 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpntwin.c,v 1.2 2001/06/04 13:04:41 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 39
+ * Sometimes implemented as two functions:
+ * PaintWindowBackground (nKind = PW_BACKGROUND)
+ * PaintWindowBorder (nKind = PW_BORDER)
+ */
+void
+winPaintWindowNativeGDI (WindowPtr pWin,
+ RegionPtr pRegion,
+ int nKind)
+{
+ ErrorF ("winPaintWindow()\n");
+}
diff --git a/hw/xwin/winpolyline.c b/hw/xwin/winpolyline.c
new file mode 100644
index 000000000..194ecfe46
--- /dev/null
+++ b/hw/xwin/winpolyline.c
@@ -0,0 +1,43 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winpolyline.c,v 1.3 2001/09/13 08:25:45 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 50 */
+void
+winPolyLineNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr ppt)
+{
+ FatalError ("winPolyLine()\n");
+}
diff --git a/hw/xwin/winregistry.c b/hw/xwin/winregistry.c
new file mode 100644
index 000000000..b31fcf641
--- /dev/null
+++ b/hw/xwin/winregistry.c
@@ -0,0 +1,66 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winregistry.c,v 1.1 2002/07/05 09:19:26 alanh Exp $ */
+
+#include "win.h"
+
+
+DWORD
+winGetRegistryDWORD (HKEY hkey, char *pszRegistryKey)
+{
+ HKEY hkResult;
+ DWORD dwDisposition;
+
+ RegCreateKeyEx (hkey,
+ pszRegistryKey,
+ 0,
+ '\0',
+ REG_OPTION_NON_VOLATILE,
+ KEY_READ,
+ NULL,
+ &hkResult,
+ &dwDisposition);
+
+ if (dwDisposition == REG_CREATED_NEW_KEY)
+ {
+ ErrorF ("winGetRegistryDWORD - Created new key: %s\n", pszRegistryKey);
+ }
+ else if (dwDisposition == REG_OPENED_EXISTING_KEY)
+ {
+ ErrorF ("winGetRegistryDWORD - Opened existing key: %s\n",
+ pszRegistryKey);
+ }
+
+ /* Free the registry key handle */
+ RegCloseKey (hkResult);
+ hkResult = NULL;
+
+ return 0;
+}
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
new file mode 100644
index 000000000..41811d253
--- /dev/null
+++ b/hw/xwin/winscrinit.c
@@ -0,0 +1,739 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ * Kensuke Matsuzaki
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winscrinit.c,v 1.26 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+
+/*
+ * Determine what type of screen we are initializing
+ * and call the appropriate procedure to intiailize
+ * that type of screen.
+ */
+
+Bool
+winScreenInit (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv)
+{
+ winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
+ winPrivScreenPtr pScreenPriv;
+ HDC hdc;
+
+#if CYGDEBUG
+ ErrorF ("winScreenInit - dwWidth: %d dwHeight: %d\n",
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight);
+#endif
+
+ /* Allocate privates for this screen */
+ if (!winAllocatePrivates (pScreen))
+ {
+ ErrorF ("winScreenInit - Couldn't allocate screen privates\n");
+ return FALSE;
+ }
+
+ /* Get a pointer to the privates structure that was allocated */
+ pScreenPriv = winGetScreenPriv (pScreen);
+
+ /* Save a pointer to this screen in the screen info structure */
+ pScreenInfo->pScreen = pScreen;
+
+ /* Save a pointer to the screen info in the screen privates structure */
+ /* This allows us to get back to the screen info from a screen pointer */
+ pScreenPriv->pScreenInfo = pScreenInfo;
+
+ /*
+ * Determine which engine to use.
+ *
+ * NOTE: This is done once per screen because each screen possibly has
+ * a preferred engine specified on the command line.
+ */
+ if (!winSetEngine (pScreen))
+ {
+ ErrorF ("winScreenInit - winSetEngine () failed\n");
+ return FALSE;
+ }
+
+ /* Adjust the video mode for our engine type */
+ if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen))
+ {
+ ErrorF ("winScreenInit - winAdjustVideoMode () failed\n");
+ return FALSE;
+ }
+
+ /* Check for supported display depth */
+ if (!(WIN_SUPPORTED_BPPS & (1 << (pScreenInfo->dwBPP - 1))))
+ {
+ ErrorF ("winScreenInit - Unsupported display depth: %d\n" \
+ "Change your Windows display depth to 15, 16, 24, or 32 bits "
+ "per pixel.\n",
+ pScreenInfo->dwBPP);
+ ErrorF ("winScreenInit - Supported depths: %08x\n",
+ WIN_SUPPORTED_BPPS);
+#if WIN_CHECK_DEPTH
+ return FALSE;
+#endif
+ }
+
+ /*
+ * Check that all monitors have the same display depth if we are using
+ * multiple monitors
+ */
+ if (pScreenInfo->fMultipleMonitors
+ && !GetSystemMetrics (SM_SAMEDISPLAYFORMAT))
+ {
+ ErrorF ("winScreenInit - Monitors do not all have same pixel format / "
+ "display depth.\n"
+ "Using primary display only.\n");
+ pScreenInfo->fMultipleMonitors = FALSE;
+ }
+
+ /* Create display window */
+ if (!(*pScreenPriv->pwinCreateBoundingWindow) (pScreen))
+ {
+ ErrorF ("winScreenInit - pwinCreateBoundingWindow () "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Get a device context */
+ hdc = GetDC (pScreenPriv->hwndScreen);
+
+ /* Store the initial height, width, and depth of the display */
+ /* Are we using multiple monitors? */
+ if (pScreenInfo->fMultipleMonitors)
+ {
+ pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
+ pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
+
+ /*
+ * In this case, some of the defaults set in
+ * winInitializeDefaultScreens () are not correct ...
+ */
+ if (!pScreenInfo->fUserGaveHeightAndWidth)
+ {
+ pScreenInfo->dwWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN);
+ pScreenInfo->dwHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN);
+ pScreenInfo->dwWidth_mm = (pScreenInfo->dwWidth /
+ WIN_DEFAULT_DPI) * 25.4;
+ pScreenInfo->dwHeight_mm = (pScreenInfo->dwHeight /
+ WIN_DEFAULT_DPI) * 25.4;
+ }
+ }
+ else
+ {
+ pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXSCREEN);
+ pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYSCREEN);
+ }
+
+ /* Save the original bits per pixel */
+ pScreenPriv->dwLastWindowsBitsPixel = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* Release the device context */
+ ReleaseDC (pScreenPriv->hwndScreen, hdc);
+
+ /* Clear the visuals list */
+ miClearVisualTypes ();
+
+ /* Set the padded screen width */
+ pScreenInfo->dwPaddedWidth = PixmapBytePad (pScreenInfo->dwWidth,
+ pScreenInfo->dwBPP);
+
+ /* Call the engine dependent screen initialization procedure */
+ if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv)))
+ {
+ ErrorF ("winScreenInit - winFinishScreenInit () failed\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG || YES
+ ErrorF ("winScreenInit - returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 20 */
+Bool
+winFinishScreenInitFB (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ VisualPtr pVisual = NULL;
+ char *pbits = NULL;
+ int iReturn;
+
+#if WIN_LAYER_SUPPORT
+ pScreenPriv->dwLayerKind = LAYER_SHADOW;
+#endif
+
+ /* Create framebuffer */
+ if (!(*pScreenPriv->pwinAllocateFB) (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - Could not allocate framebuffer\n");
+ return FALSE;
+ }
+
+ /*
+ * Grab the number of bits that are used to represent color in each pixel.
+ */
+ if (pScreenInfo->dwBPP == 8)
+ pScreenInfo->dwDepth = 8;
+ else
+ pScreenInfo->dwDepth = winCountBits (pScreenPriv->dwRedMask)
+ + winCountBits (pScreenPriv->dwGreenMask)
+ + winCountBits (pScreenPriv->dwBlueMask);
+
+ ErrorF ("winFinishScreenInitFB - Masks: %08x %08x %08x\n",
+ pScreenPriv->dwRedMask, pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask);
+
+ /* Init visuals */
+ if (!(*pScreenPriv->pwinInitVisuals) (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - winInitVisuals failed\n");
+ return FALSE;
+ }
+
+ /* Setup a local variable to point to the framebuffer */
+ pbits = pScreenInfo->pfb;
+
+ /* Apparently we need this for the render extension */
+ miSetPixmapDepths ();
+
+ /* Start fb initialization */
+ if (!fbSetupScreen (pScreen,
+ pScreenInfo->pfb,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ monitorResolution, monitorResolution,
+ pScreenInfo->dwStride,
+ pScreenInfo->dwBPP))
+ {
+ ErrorF ("winFinishScreenInitFB - fbSetupScreen failed\n");
+ return FALSE;
+ }
+
+ /* Override default colormap routines if visual class is dynamic */
+ if (pScreenInfo->dwDepth == 8
+ && (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
+ || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL
+ && pScreenInfo->fFullScreen)
+ || (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
+ && pScreenInfo->fFullScreen)))
+ {
+ pScreen->CreateColormap = winCreateColormap;
+ pScreen->DestroyColormap = winDestroyColormap;
+ pScreen->InstallColormap = winInstallColormap;
+ pScreen->UninstallColormap = winUninstallColormap;
+ pScreen->ListInstalledColormaps = winListInstalledColormaps;
+ pScreen->StoreColors = winStoreColors;
+ pScreen->ResolveColor = winResolveColor;
+
+ /*
+ * NOTE: Setting whitePixel to 255 causes Magic 7.1 to allocate its
+ * own colormap, as it cannot allocate 7 planes in the default
+ * colormap. Setting whitePixel to 1 allows Magic to get 7
+ * planes in the default colormap, so it doesn't create its
+ * own colormap. This latter situation is highly desireable,
+ * as it keeps the Magic window viewable when switching to
+ * other X clients that use the default colormap.
+ */
+ pScreen->blackPixel = 0;
+ pScreen->whitePixel = 1;
+ }
+
+ /* Place our save screen function */
+ pScreen->SaveScreen = winSaveScreen;
+
+ /* Backing store functions */
+ /*
+ * FIXME: Backing store support still doesn't seem to be working.
+ */
+ pScreen->BackingStoreFuncs.SaveAreas = fbSaveAreas;
+ pScreen->BackingStoreFuncs.RestoreAreas = fbRestoreAreas;
+
+ /* Finish fb initialization */
+ if (!fbFinishScreenInit (pScreen,
+ pScreenInfo->pfb,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ monitorResolution, monitorResolution,
+ pScreenInfo->dwStride,
+ pScreenInfo->dwBPP))
+ {
+ ErrorF ("winFinishScreenInitFB - fbFinishScreenInit failed\n");
+ return FALSE;
+ }
+
+ /* Save a pointer to the root visual */
+ for (pVisual = pScreen->visuals;
+ pVisual->vid != pScreen->rootVisual;
+ pVisual++);
+ pScreenPriv->pRootVisual = pVisual;
+
+ /*
+ * Setup points to the block and wakeup handlers. Pass a pointer
+ * to the current screen as pWakeupdata.
+ */
+ pScreen->BlockHandler = winBlockHandler;
+ pScreen->WakeupHandler = winWakeupHandler;
+ pScreen->blockData = pScreen;
+ pScreen->wakeupData = pScreen;
+
+#ifdef RENDER
+ /* Render extension initialization, calls miPictureInit */
+ if (!fbPictureInit (pScreen, NULL, 0))
+ {
+ ErrorF ("winFinishScreenInitFB - fbPictureInit () failed\n");
+ return FALSE;
+ }
+#endif
+
+#if WIN_LAYER_SUPPORT
+ /* KDrive does LayerStartInit right after fbPictureInit */
+ if (!LayerStartInit (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - LayerStartInit () failed\n");
+ return FALSE;
+ }
+
+ /* Not sure what we're adding to shadow, but add it anyway */
+ if (!shadowAdd (pScreen, 0, pScreenPriv->pwinShadowUpdate, NULL, 0, 0))
+ {
+ ErrorF ("winFinishScreenInitFB - shadowAdd () failed\n");
+ return FALSE;
+ }
+
+ /* KDrive does LayerFinishInit right after LayerStartInit */
+ if (!LayerFinishInit (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - LayerFinishInit () failed\n");
+ return FALSE;
+ }
+
+ /* KDrive does LayerCreate right after LayerFinishInit */
+ pScreenPriv->pLayer = winLayerCreate (pScreen);
+ if (!pScreenPriv->pLayer)
+ {
+ ErrorF ("winFinishScreenInitFB - winLayerCreate () failed\n");
+ return FALSE;
+ }
+
+ /* KDrive does RandRInit right after LayerCreate */
+#ifdef RANDR
+ if (pScreenInfo->dwDepth != 8 && !winRandRInit (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - winRandRInit () failed\n");
+ return FALSE;
+ }
+#endif
+#endif
+
+ /*
+ * Backing store support should reduce network traffic and increase
+ * performance.
+ */
+ miInitializeBackingStore (pScreen);
+
+ /* KDrive does miDCInitialize right after miInitializeBackingStore */
+ /* Setup the cursor routines */
+#if CYGDEBUG
+ ErrorF ("winFinishScreenInitFB - Calling miDCInitialize ()\n");
+#endif
+ miDCInitialize (pScreen, &g_winPointerCursorFuncs);
+
+ /* KDrive does winCreateDefColormap right after miDCInitialize */
+ /* Create a default colormap */
+#if CYGDEBUG
+ ErrorF ("winFinishScreenInitFB - Calling winCreateDefColormap ()\n");
+#endif
+ if (!winCreateDefColormap (pScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - Could not create colormap\n");
+ return FALSE;
+ }
+
+#if !WIN_LAYER_SUPPORT
+ /* Initialize the shadow framebuffer layer */
+ if (pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
+ || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
+ || pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)
+ {
+#if CYGDEBUG
+ ErrorF ("winFinishScreenInitFB - Calling shadowInit ()\n");
+#endif
+ if (!shadowInit (pScreen,
+ pScreenPriv->pwinShadowUpdate,
+ NULL))
+ {
+ ErrorF ("winFinishScreenInitFB - shadowInit () failed\n");
+ return FALSE;
+ }
+ }
+#endif
+
+
+ /* Handle pseudo-rootless mode */
+ if (pScreenInfo->fRootless)
+ {
+ /* Define the WRAP macro temporarily for local use */
+#define WRAP(a) \
+ if (pScreen->a) { \
+ pScreenPriv->a = pScreen->a; \
+ } else { \
+ ErrorF("null screen fn " #a "\n"); \
+ pScreenPriv->a = NULL; \
+ }
+
+ /* Save a pointer to each lower-level window procedure */
+ WRAP(CreateWindow);
+ WRAP(DestroyWindow);
+ WRAP(RealizeWindow);
+ WRAP(UnrealizeWindow);
+ WRAP(PositionWindow);
+ WRAP(ChangeWindowAttributes);
+#ifdef SHAPE
+ WRAP(SetShape);
+#endif
+
+ /* Assign pseudo-rootless window procedures to be top level procedures */
+ pScreen->CreateWindow = winCreateWindowPRootless;
+ pScreen->DestroyWindow = winDestroyWindowPRootless;
+ pScreen->PositionWindow = winPositionWindowPRootless;
+ pScreen->ChangeWindowAttributes = winChangeWindowAttributesPRootless;
+ pScreen->RealizeWindow = winMapWindowPRootless;
+ pScreen->UnrealizeWindow = winUnmapWindowPRootless;
+#ifdef SHAPE
+ pScreen->SetShape = winSetShapePRootless;
+#endif
+
+ /* Undefine the WRAP macro, as it is not needed elsewhere */
+#undef WRAP
+ }
+ /* Handle multi window mode */
+ else if (pScreenInfo->fMultiWindow)
+ {
+ /* Define the WRAP macro temporarily for local use */
+#define WRAP(a) \
+ if (pScreen->a) { \
+ pScreenPriv->a = pScreen->a; \
+ } else { \
+ ErrorF("null screen fn " #a "\n"); \
+ pScreenPriv->a = NULL; \
+ }
+
+ /* Save a pointer to each lower-level window procedure */
+ WRAP(CreateWindow);
+ WRAP(DestroyWindow);
+ WRAP(RealizeWindow);
+ WRAP(UnrealizeWindow);
+ WRAP(PositionWindow);
+ WRAP(ChangeWindowAttributes);
+ WRAP(ReparentWindow);
+ WRAP(RestackWindow);
+#ifdef SHAPE
+ WRAP(SetShape);
+#endif
+
+ /* Assign multi-window window procedures to be top level procedures */
+ pScreen->CreateWindow = winCreateWindowMultiWindow;
+ pScreen->DestroyWindow = winDestroyWindowMultiWindow;
+ pScreen->PositionWindow = winPositionWindowMultiWindow;
+ pScreen->ChangeWindowAttributes = winChangeWindowAttributesMultiWindow;
+ pScreen->RealizeWindow = winMapWindowMultiWindow;
+ pScreen->UnrealizeWindow = winUnmapWindowMultiWindow;
+ pScreen->ReparentWindow = winReparentWindowMultiWindow;
+ pScreen->RestackWindow = winRestackWindowMultiWindow;
+#ifdef SHAPE
+ pScreen->SetShape = winSetShapeMultiWindow;
+#endif
+
+ /* Undefine the WRAP macro, as it is not needed elsewhere */
+#undef WRAP
+ }
+
+ /* Wrap either fb's or shadow's CloseScreen with our CloseScreen */
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = pScreenPriv->pwinCloseScreen;
+
+ /* Create a mutex for modules in seperate threads to wait for */
+ iReturn = pthread_mutex_init (&pScreenPriv->pmServerStarted, NULL);
+ if (iReturn != 0)
+ {
+ ErrorF ("winFinishScreenInitFB - pthread_mutex_init () failed: %d\n",
+ iReturn);
+ return FALSE;
+ }
+
+ /* Own the mutex for modules in seperate threads */
+ iReturn = pthread_mutex_lock (&pScreenPriv->pmServerStarted);
+ if (iReturn != 0)
+ {
+ ErrorF ("winFinishScreenInitFB - pthread_mutex_lock () failed: %d\n",
+ iReturn);
+ return FALSE;
+ }
+
+ /* Set the ServerStarted flag to false */
+ pScreenPriv->fServerStarted = FALSE;
+
+#if CYGDEBUG || YES
+ if (pScreenInfo->fMultiWindow)
+ ErrorF ("winFinishScreenInitFB - Calling winInitWM.\n");
+#endif
+
+ /* Initialize multi window mode */
+ if (pScreenInfo->fMultiWindow
+ && !winInitWM (&pScreenPriv->pWMInfo,
+ &pScreenPriv->ptWMProc,
+ &pScreenPriv->pmServerStarted,
+ pScreenInfo->dwScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - winInitWM () failed.\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG || YES
+ if (pScreenInfo->fClipboard)
+ ErrorF ("winFinishScreenInitFB - Calling winInitClipboard.\n");
+#endif
+
+ /* Initialize the clipboard manager */
+ if (pScreenInfo->fClipboard
+ && !winInitClipboard (&pScreenPriv->ptClipboardProc,
+ &pScreenPriv->pmServerStarted,
+ pScreenInfo->dwScreen))
+ {
+ ErrorF ("winFinishScreenInitFB - winClipboardInit () failed.\n");
+ return FALSE;
+ }
+
+ /* Tell the server that we are enabled */
+ pScreenPriv->fEnabled = TRUE;
+
+ /* Tell the server that we have a valid depth */
+ pScreenPriv->fBadDepth = FALSE;
+
+#if CYGDEBUG || YES
+ ErrorF ("winFinishScreenInitFB - returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ *
+ *
+ *
+ *
+ * TEST CODE BELOW - NOT USED IN NORMAL COMPILATION
+ *
+ *
+ *
+ *
+ *
+ */
+
+
+/* See Porting Layer Definition - p. 20 */
+
+Bool
+winFinishScreenInitNativeGDI (int index,
+ ScreenPtr pScreen,
+ int argc, char **argv)
+{
+ winScreenPriv(pScreen);
+ winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
+ VisualPtr pVisuals = NULL;
+ DepthPtr pDepths = NULL;
+ VisualID rootVisual = 0;
+ int nVisuals = 0, nDepths = 0, nRootDepth = 0;
+
+ /* Ignore user input (mouse, keyboard) */
+ pScreenInfo->fIgnoreInput = TRUE;
+
+ /* Get device contexts for the screen and shadow bitmap */
+ pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
+ if (pScreenPriv->hdcScreen == NULL)
+ FatalError ("winFinishScreenInitNativeGDI - Couldn't get a DC\n");
+
+ /* Init visuals */
+ if (!(*pScreenPriv->pwinInitVisuals) (pScreen))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - pwinInitVisuals failed\n");
+ return FALSE;
+ }
+
+ /* Initialize the mi visuals */
+ if (!miInitVisuals (&pVisuals, &pDepths, &nVisuals, &nDepths, &nRootDepth,
+ &rootVisual,
+ ((unsigned long)1 << (pScreenInfo->dwDepth - 1)), 8,
+ TrueColor))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - miInitVisuals () failed\n");
+ return FALSE;
+ }
+
+ /* Initialize the CloseScreen procedure pointer */
+ pScreen->CloseScreen = NULL;
+
+ /* Initialize the mi code */
+ if (!miScreenInit (pScreen,
+ NULL, /* No framebuffer */
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ monitorResolution, monitorResolution,
+ pScreenInfo->dwWidth,
+ nRootDepth, nDepths, pDepths, rootVisual,
+ nVisuals, pVisuals))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - miScreenInit failed\n");
+ return FALSE;
+ }
+
+ /*
+ * Register our block and wakeup handlers; these procedures
+ * process messages in our Windows message queue; specifically,
+ * they process mouse and keyboard input.
+ */
+ pScreen->BlockHandler = winBlockHandler;
+ pScreen->WakeupHandler = winWakeupHandler;
+ pScreen->blockData = pScreen;
+ pScreen->wakeupData = pScreen;
+
+ /* Place our save screen function */
+ pScreen->SaveScreen = winSaveScreen;
+
+ /* Pixmaps */
+ pScreen->CreatePixmap = winCreatePixmapNativeGDI;
+ pScreen->DestroyPixmap = winDestroyPixmapNativeGDI;
+
+ /* Other Screen Routines */
+ pScreen->QueryBestSize = winQueryBestSizeNativeGDI;
+ pScreen->SaveScreen = winSaveScreen;
+ pScreen->GetImage = miGetImage;
+ pScreen->GetSpans = winGetSpansNativeGDI;
+
+ /* Window Procedures */
+ pScreen->CreateWindow = winCreateWindowNativeGDI;
+ pScreen->DestroyWindow = winDestroyWindowNativeGDI;
+ pScreen->PositionWindow = winPositionWindowNativeGDI;
+ pScreen->ChangeWindowAttributes = winChangeWindowAttributesNativeGDI;
+ pScreen->RealizeWindow = winMapWindowNativeGDI;
+ pScreen->UnrealizeWindow = winUnmapWindowNativeGDI;
+
+ /* Paint window */
+ pScreen->PaintWindowBackground = miPaintWindow;
+ pScreen->PaintWindowBorder = miPaintWindow;
+ pScreen->CopyWindow = winCopyWindowNativeGDI;
+
+ /* Fonts */
+ pScreen->RealizeFont = winRealizeFontNativeGDI;
+ pScreen->UnrealizeFont = winUnrealizeFontNativeGDI;
+
+ /* GC */
+ pScreen->CreateGC = winCreateGCNativeGDI;
+
+ /* Colormap Routines */
+ pScreen->CreateColormap = miInitializeColormap;
+ pScreen->DestroyColormap = (DestroyColormapProcPtr) (void (*)()) NoopDDA;
+ pScreen->InstallColormap = miInstallColormap;
+ pScreen->UninstallColormap = miUninstallColormap;
+ pScreen->ListInstalledColormaps = miListInstalledColormaps;
+ pScreen->StoreColors = (StoreColorsProcPtr) (void (*)()) NoopDDA;
+ pScreen->ResolveColor = miResolveColor;
+
+ /* Bitmap */
+ pScreen->BitmapToRegion = winPixmapToRegionNativeGDI;
+
+ ErrorF ("winFinishScreenInitNativeGDI - calling miDCInitialize\n");
+
+ /* Set the default white and black pixel positions */
+ pScreen->whitePixel = pScreen->blackPixel = (Pixel) 0;
+
+ /* Initialize the cursor */
+ if (!miDCInitialize (pScreen, &g_winPointerCursorFuncs))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - miDCInitialize failed\n");
+ return FALSE;
+ }
+
+ /* Create a default colormap */
+ if (!miCreateDefColormap (pScreen))
+ {
+ ErrorF ("winFinishScreenInitNativeGDI - miCreateDefColormap () "
+ "failed\n");
+ return FALSE;
+ }
+
+ ErrorF ("winFinishScreenInitNativeGDI - miCreateDefColormap () "
+ "returned\n");
+
+ /* mi doesn't use a CloseScreen procedure, so no need to wrap */
+ pScreen->CloseScreen = pScreenPriv->pwinCloseScreen;
+
+ /* Tell the server that we are enabled */
+ pScreenPriv->fEnabled = TRUE;
+
+ ErrorF ("winFinishScreenInitNativeGDI - Successful addition of "
+ "screen %08x\n",
+ pScreen);
+
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 33 */
+Bool
+winSaveScreen (ScreenPtr pScreen, int on)
+{
+ return TRUE;
+}
+
+
+PixmapPtr
+winGetWindowPixmap (WindowPtr pwin)
+{
+ ErrorF ("winGetWindowPixmap ()\n");
+ return NULL;
+}
+
+
+void
+winSetWindowPixmap (WindowPtr pwin, PixmapPtr pPix)
+{
+ ErrorF ("winSetWindowPixmap ()\n");
+}
diff --git a/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c
new file mode 100644
index 000000000..657a7af50
--- /dev/null
+++ b/hw/xwin/winsetsp.c
@@ -0,0 +1,344 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winsetsp.c,v 1.7 2001/11/01 12:19:42 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 55 */
+void
+winSetSpansNativeGDI (DrawablePtr pDrawable,
+ GCPtr pGC,
+ char *pSrcs,
+ DDXPointPtr pPoints,
+ int *piWidths,
+ int iSpans,
+ int fSorted)
+{
+ winGCPriv(pGC);
+ PixmapPtr pPixmap = NULL;
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ int iSpan;
+ int *piWidth = NULL;
+ DDXPointPtr pPoint = NULL;
+ char *pSrc = pSrcs;
+ HDC hdcMem;
+ BITMAPINFOHEADER *pbmih;
+ HBITMAP hBitmap = NULL;
+ HBITMAP hbmpOrig = NULL;
+ DEBUG_FN_NAME("winSetSpans");
+ DEBUGVARS;
+ DEBUGPROC_MSG;
+
+ /* Branch on the drawable type */
+ switch (pDrawable->type)
+ {
+ case DRAWABLE_PIXMAP:
+ pPixmap = (PixmapPtr) pDrawable;
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ /* Select the drawable pixmap into a DC */
+ hbmpOrig = SelectObject (pGCPriv->hdcMem, pPixmapPriv->hBitmap);
+ if (hbmpOrig == NULL)
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - SelectObject () "
+ "failed on pPixmapPriv->hBitmap\n");
+
+ /* Branch on the raster operation type */
+ switch (pGC->alu)
+ {
+ case GXclear:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXclear\n");
+ break;
+
+ case GXand:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXand\n");
+ break;
+
+ case GXandReverse:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXandReverse\n");
+ break;
+
+ case GXcopy:
+ ErrorF ("winSetSpans - DRAWABLE_PIXMAP - GXcopy %08x\n",
+ pDrawable);
+
+ /* Loop through spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ piWidth = piWidths + iSpan;
+ pPoint = pPoints + iSpan;
+
+ /* Blast the bits to the drawable */
+ SetDIBits (pGCPriv->hdcMem,
+ pPixmapPriv->hBitmap,
+ pPoint->y, 1,
+ pSrc,
+ (BITMAPINFO *) pPixmapPriv->pbmih,
+ 0);
+
+ /* Display some useful information */
+ ErrorF ("(%dx%dx%d) (%d,%d) w: %d ps: %08x\n",
+ pDrawable->width, pDrawable->height, pDrawable->depth,
+ pPoint->x, pPoint->y, *piWidth, pSrc);
+
+ /* Calculate offset of next bit source */
+ pSrc += 4 * ((*piWidth + 31) / 32);
+ }
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width * 2, pDrawable->height,
+ pDrawable->width, pDrawable->height,
+ pGCPriv->hdcMem,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG ("DRAWABLE_PIXMAP - GXcopy");
+ break;
+
+ case GXandInverted:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXandInverted\n");
+ break;
+
+ case GXnoop:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXnoop\n");
+ break;
+
+ case GXxor:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXxor\n");
+ break;
+
+ case GXor:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXor\n");
+ break;
+
+ case GXnor:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXnor\n");
+ break;
+
+ case GXequiv:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXequiv\n");
+ break;
+
+ case GXinvert:
+ ErrorF ("winSetSpans - DRAWABLE_PIXMAP - GXinvert %08x\n",
+ pDrawable);
+
+ /* Create a temporary DC */
+ hdcMem = CreateCompatibleDC (NULL);
+
+ /* Loop through spans */
+ for (iSpan = 0; iSpan < iSpans; ++iSpan)
+ {
+ piWidth = piWidths + iSpan;
+ pPoint = pPoints + iSpan;
+
+ /* Create a one-line DIB for the bit data */
+ hBitmap = winCreateDIBNativeGDI (*piWidth, 1, pDrawable->depth,
+ NULL, (BITMAPINFO **) &pbmih);
+
+ /* Select the span line line bitmap into the temporary DC */
+ hbmpOrig = SelectObject (hdcMem, hBitmap);
+
+ /* Blast bit data to the one-line DIB */
+ SetDIBits (hdcMem, hBitmap,
+ 0, 1,
+ pSrc,
+ (BITMAPINFO *) pbmih,
+ DIB_RGB_COLORS);
+
+ /* Blit the span line to the drawable */
+ BitBlt (pGCPriv->hdcMem,
+ pPoint->x, pPoint->y,
+ *piWidth, 1,
+ hdcMem,
+ 0, 0,
+ NOTSRCCOPY);
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width, pDrawable->height + pPoint->y,
+ *piWidth, 1,
+ hdcMem,
+ 0, 0,
+ SRCCOPY);
+
+ /* Display some useful information */
+ ErrorF ("(%dx%dx%d) (%d,%d) w: %d ps: %08x\n",
+ pDrawable->width, pDrawable->height, pDrawable->depth,
+ pPoint->x, pPoint->y, *piWidth, pSrc);
+
+ /* Calculate offset of next bit source */
+ pSrc += 4 * ((*piWidth + 31) / 32);
+
+ /* Pop the span line bitmap out of the memory DC */
+ SelectObject (hdcMem, hbmpOrig);
+
+ /* Free the temporary bitmap */
+ DeleteObject (hBitmap);
+ hBitmap = NULL;
+ }
+
+ /*
+ * REMOVE - Visual verification only.
+ */
+ DEBUG_MSG ("DRAWABLE_PIXMAP - GXinvert - Prior to invert");
+ BitBlt (pGCPriv->hdc,
+ pDrawable->width * 2, pDrawable->height,
+ pDrawable->width, pDrawable->height,
+ pGCPriv->hdcMem,
+ 0, 0,
+ SRCCOPY);
+ DEBUG_MSG ("DRAWABLE_PIXMAP - GXinvert - Finished invert");
+
+ /* Release the scratch DC */
+ DeleteDC (hdcMem);
+ break;
+
+ case GXorReverse:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXorReverse\n");
+ break;
+
+ case GXcopyInverted:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXcopyInverted\n");
+ break;
+
+ case GXorInverted:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXorInverted\n");
+ break;
+
+ case GXnand:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXnand\n");
+ break;
+
+ case GXset:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - GXset\n");
+ break;
+
+ default:
+ FatalError ("winSetSpans - DRAWABLE_PIXMAP - Unknown ROP\n");
+ break;
+ }
+
+ /* Push the drawable pixmap out of the GC HDC */
+ SelectObject (pGCPriv->hdcMem, hbmpOrig);
+ break;
+
+ case DRAWABLE_WINDOW:
+ FatalError ("\nwinSetSpansNativeGDI - DRAWABLE_WINDOW\n\n");
+
+ /* Branch on the raster operation type */
+ switch (pGC->alu)
+ {
+ case GXclear:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXclear\n");
+ break;
+
+ case GXand:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXand\n");
+ break;
+
+ case GXandReverse:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXandReverse\n");
+ break;
+
+ case GXcopy:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXcopy\n");
+ break;
+
+ case GXandInverted:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXandInverted\n");
+ break;
+
+ case GXnoop:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXnoop\n");
+ break;
+
+ case GXxor:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXxor\n");
+ break;
+
+ case GXor:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXor\n");
+ break;
+
+ case GXnor:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXnor\n");
+ break;
+
+ case GXequiv:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXequiv\n");
+ break;
+
+ case GXinvert:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXinvert\n");
+ break;
+
+ case GXorReverse:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXorReverse\n");
+ break;
+
+ case GXcopyInverted:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXcopyInverted\n");
+ break;
+
+ case GXorInverted:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXorInverted\n");
+ break;
+
+ case GXnand:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXnand\n");
+ break;
+
+ case GXset:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - GXset\n");
+ break;
+
+ default:
+ ErrorF ("winSetSpans () - DRAWABLE_WINDOW - Unknown ROP\n");
+ break;
+ }
+ break;
+
+ case UNDRAWABLE_WINDOW:
+ FatalError ("\nwinSetSpansNativeGDI - UNDRAWABLE_WINDOW\n\n");
+ break;
+
+ case DRAWABLE_BUFFER:
+ FatalError ("\nwinSetSpansNativeGDI - DRAWABLE_BUFFER\n\n");
+ break;
+
+ default:
+ FatalError ("\nwinSetSpansNativeGDI - Unknown drawable type\n\n");
+ break;
+ }
+}
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
new file mode 100644
index 000000000..9c14ebf34
--- /dev/null
+++ b/hw/xwin/winshaddd.c
@@ -0,0 +1,1362 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshaddd.c,v 1.23 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+/*
+ * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
+ * so we have to redefine it here.
+ */
+#ifdef DEFINE_GUID
+#undef DEFINE_GUID
+#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+#endif /* DEFINE_GUID */
+
+
+/*
+ * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
+ * here manually. Should be handled by ddraw.h
+ */
+#ifndef IID_IDirectDraw2
+DEFINE_GUID( IID_IDirectDraw2,0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
+#endif /* IID_IDirectDraw2 */
+
+
+/*
+ * Create the primary surface and attach the clipper.
+ * Used for both the initial surface creation and during
+ * WM_DISPLAYCHANGE messages.
+ */
+
+Bool
+winCreatePrimarySurfaceShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC ddsd;
+
+ /* Describe the primary surface */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ /* Create the primary surface */
+ ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
+ &ddsd,
+ &pScreenPriv->pddsPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreatePrimarySurfaceShadowDD - Could not create primary "
+ "surface: %08x\n", ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winCreatePrimarySurfaceShadowDD - Created primary surface\n");
+#endif
+
+ /*
+ * Attach a clipper to the primary surface that will clip our blits to our
+ * display window.
+ */
+ ddrval = IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary,
+ pScreenPriv->pddcPrimary);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreatePrimarySurfaceShadowDD - Primary attach clipper "
+ "failed: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winCreatePrimarySurfaceShadowDD - Attached clipper to "
+ "primary surface\n");
+#endif
+
+ /* Everything was correct */
+ return TRUE;
+}
+
+
+/*
+ * Detach the clipper and release the primary surface.
+ * Called from WM_DISPLAYCHANGE.
+ */
+
+Bool
+winReleasePrimarySurfaceShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ ErrorF ("winReleasePrimarySurfaceShadowDD - Hello\n");
+
+ /* Release the primary surface and clipper, if they exist */
+ if (pScreenPriv->pddsPrimary)
+ {
+ /*
+ * Detach the clipper from the primary surface.
+ * NOTE: We do this explicity for clarity. The Clipper is not released.
+ */
+ IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary,
+ NULL);
+
+ ErrorF ("winReleasePrimarySurfaceShadowDD - Detached clipper\n");
+
+ /* Release the primary surface */
+ IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary);
+ pScreenPriv->pddsPrimary = NULL;
+ }
+
+ ErrorF ("winReleasePrimarySurfaceShadowDD - Released primary surface\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Create a DirectDraw surface for the shadow framebuffer; also create
+ * a primary surface object so we can blit to the display.
+ *
+ * Install a DirectDraw clipper on our primary surface object
+ * that clips our blits to the unobscured client area of our display window.
+ */
+
+Bool
+winAllocateFBShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC ddsd;
+ DDSURFACEDESC *pddsdShadow = NULL;
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDD\n");
+#endif
+
+ /* Create a clipper */
+ ddrval = (*g_fpDirectDrawCreateClipper) (0,
+ &pScreenPriv->pddcPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not create clipper: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDD - Created a clipper\n");
+#endif
+
+ /* Get a device context for the screen */
+ pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
+
+ /* Attach the clipper to our display window */
+ ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary,
+ 0,
+ pScreenPriv->hwndScreen);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Clipper not attached to "
+ "window: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDD - Attached clipper to window\n");
+#endif
+
+ /* Create a DirectDraw object, store the address at lpdd */
+ ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not start DirectDraw: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDD () - Created and initialized DD\n");
+#endif
+
+ /* Get a DirectDraw2 interface pointer */
+ ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
+ &IID_IDirectDraw2,
+ (LPVOID*) &pScreenPriv->pdd2);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Failed DD2 query: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+ /* Are we full screen? */
+ if (pScreenInfo->fFullScreen)
+ {
+ DDSURFACEDESC ddsdCurrent;
+ DWORD dwRefreshRateCurrent = 0;
+ HDC hdc = NULL;
+
+ /* Set the cooperative level to full screen */
+ ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
+ pScreenPriv->hwndScreen,
+ DDSCL_EXCLUSIVE
+ | DDSCL_FULLSCREEN);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set "
+ "cooperative level: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+ /*
+ * We only need to get the current refresh rate for comparison
+ * if a refresh rate has been passed on the command line.
+ */
+ if (pScreenInfo->dwRefreshRate != 0)
+ {
+ ZeroMemory (&ddsdCurrent, sizeof (ddsdCurrent));
+ ddsdCurrent.dwSize = sizeof (ddsdCurrent);
+
+ /* Get information about current display settings */
+ ddrval = IDirectDraw2_GetDisplayMode (pScreenPriv->pdd2,
+ &ddsdCurrent);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not get current "
+ "refresh rate: %08x. Continuing.\n",
+ ddrval);
+ dwRefreshRateCurrent = 0;
+ }
+ else
+ {
+ /* Grab the current refresh rate */
+ dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate;
+ }
+ }
+
+ /* Clean up the refresh rate */
+ if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate)
+ {
+ /*
+ * Refresh rate is non-specified or equal to current.
+ */
+ pScreenInfo->dwRefreshRate = 0;
+ }
+
+ /* Grab a device context for the screen */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDD - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Only change the video mode when different than current mode */
+ if (!pScreenInfo->fMultipleMonitors
+ && (pScreenInfo->dwWidth != GetSystemMetrics (SM_CXSCREEN)
+ || pScreenInfo->dwHeight != GetSystemMetrics (SM_CYSCREEN)
+ || pScreenInfo->dwBPP != GetDeviceCaps (hdc, BITSPIXEL)
+ || pScreenInfo->dwRefreshRate != 0))
+ {
+ ErrorF ("winAllocateFBShadowDD - Changing video mode\n");
+
+ /* Change the video mode to the mode requested */
+ ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ pScreenInfo->dwRefreshRate,
+ 0);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set "\
+ "full screen display mode: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+ }
+ else
+ {
+ ErrorF ("winAllocateFBShadowDD - Not changing video mode\n");
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+ }
+ else
+ {
+ /* Set the cooperative level for windowed mode */
+ ddrval = IDirectDraw2_SetCooperativeLevel (pScreenPriv->pdd2,
+ pScreenPriv->hwndScreen,
+ DDSCL_NORMAL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not set "\
+ "cooperative level: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+ }
+
+ /* Create the primary surface */
+ if (!winCreatePrimarySurfaceShadowDD (pScreen))
+ {
+ ErrorF ("winAllocateFBShadowDD - winCreatePrimarySurfaceShadowDD "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Describe the shadow surface to be created */
+ /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
+ ddsd.dwHeight = pScreenInfo->dwHeight;
+ ddsd.dwWidth = pScreenInfo->dwWidth;
+
+ /* Create the shadow surface */
+ ddrval = IDirectDraw2_CreateSurface (pScreenPriv->pdd2,
+ &ddsd,
+ &pScreenPriv->pddsShadow,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not create shadow "\
+ "surface: %08x\n", ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDD - Created shadow\n");
+#endif
+
+ /* Allocate a DD surface description for our screen privates */
+ pddsdShadow = pScreenPriv->pddsdShadow = malloc (sizeof (DDSURFACEDESC));
+ if (pddsdShadow == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not allocate surface "\
+ "description memory\n");
+ return FALSE;
+ }
+ ZeroMemory (pddsdShadow, sizeof (*pddsdShadow));
+ pddsdShadow->dwSize = sizeof (*pddsdShadow);
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDD - Locking shadow\n");
+#endif
+
+ /* Lock the shadow surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+ if (FAILED (ddrval) || pddsdShadow->lpSurface == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDD - Could not lock shadow "\
+ "surface: %08x\n", ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDD - Locked shadow\n");
+#endif
+
+ /* We don't know how to deal with anything other than RGB */
+ if (!(pddsdShadow->ddpfPixelFormat.dwFlags & DDPF_RGB))
+ {
+ ErrorF ("winAllocateFBShadowDD - Color format other than RGB\n");
+ return FALSE;
+ }
+
+ /* Grab the pitch from the surface desc */
+ pScreenInfo->dwStride = (pddsdShadow->u1.lPitch * 8)
+ / pScreenInfo->dwBPP;
+
+ /* Save the pointer to our surface memory */
+ pScreenInfo->pfb = pddsdShadow->lpSurface;
+
+ /* Grab the color depth and masks from the surface description */
+ pScreenPriv->dwRedMask = pddsdShadow->ddpfPixelFormat.u2.dwRBitMask;
+ pScreenPriv->dwGreenMask = pddsdShadow->ddpfPixelFormat.u3.dwGBitMask;
+ pScreenPriv->dwBlueMask = pddsdShadow->ddpfPixelFormat.u4.dwBBitMask;
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDD - Returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Transfer the damaged regions of the shadow framebuffer to the display.
+ */
+
+void
+winShadowUpdateDD (ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RegionPtr damage = &pBuf->damage;
+ HRESULT ddrval = DD_OK;
+ RECT rcDest, rcSrc;
+ POINT ptOrigin;
+ DWORD dwBox = REGION_NUM_RECTS (damage);
+ BoxPtr pBox = REGION_RECTS (damage);
+ HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+
+ /*
+ * Return immediately if the app is not active
+ * and we are fullscreen, or if we have a bad display depth
+ */
+ if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
+ || pScreenPriv->fBadDepth) return;
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+
+ /* Unlock the shadow surface, so we can blit */
+ ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winShadowUpdateProcDD - Unlock failed\n");
+ return;
+ }
+
+ /*
+ * Handle small regions with multiple blits,
+ * handle large regions by creating a clipping region and
+ * doing a single blit constrained to that clipping region.
+ */
+ if (pScreenInfo->dwClipUpdatesNBoxes == 0
+ || dwBox < pScreenInfo->dwClipUpdatesNBoxes)
+ {
+ /* Loop through all boxes in the damaged region */
+ while (dwBox--)
+ {
+ /* Assign damage box to source rectangle */
+ rcSrc.left = pBox->x1;
+ rcSrc.top = pBox->y1;
+ rcSrc.right = pBox->x2;
+ rcSrc.bottom = pBox->y2;
+
+ /* Calculate destination rectange */
+ rcDest.left = ptOrigin.x + rcSrc.left;
+ rcDest.top = ptOrigin.y + rcSrc.top;
+ rcDest.right = ptOrigin.x + rcSrc.right;
+ rcDest.bottom = ptOrigin.y + rcSrc.bottom;
+
+ /* Blit the damaged areas */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcDest,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+
+ /* Get a pointer to the next box */
+ ++pBox;
+ }
+ }
+ else
+ {
+ BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
+
+ /* Compute a GDI region from the damaged region */
+ hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ dwBox--;
+ pBox++;
+ while (dwBox--)
+ {
+ hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
+ DeleteObject (hrgnTemp);
+ pBox++;
+ }
+
+ /* Install the GDI region as a clipping region */
+ SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
+ DeleteObject (hrgnCombined);
+ hrgnCombined = NULL;
+
+ /* Calculating a bounding box for the source is easy */
+ rcSrc.left = pBoxExtents->x1;
+ rcSrc.top = pBoxExtents->y1;
+ rcSrc.right = pBoxExtents->x2;
+ rcSrc.bottom = pBoxExtents->y2;
+
+ /* Calculating a bounding box for the destination is trickier */
+ rcDest.left = ptOrigin.x + rcSrc.left;
+ rcDest.top = ptOrigin.y + rcSrc.top;
+ rcDest.right = ptOrigin.x + rcSrc.right;
+ rcDest.bottom = ptOrigin.y + rcSrc.bottom;
+
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcDest,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+
+ /* Reset the clip region */
+ SelectClipRgn (pScreenPriv->hdcScreen, NULL);
+ }
+
+ /* Relock the shadow surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pScreenPriv->pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winShadowUpdateProcDD - Lock failed\n");
+ return;
+ }
+
+ /* Has our memory pointer changed? */
+ if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
+ {
+ ErrorF ("winShadowUpdateProcDD - Memory location of the shadow "
+ "surface has changed, trying to update the root window "
+ "pixmap header to point to the new address. If you get "
+ "this message and Cygwin/XFree86 freezes or crashes "
+ "after this message then send a problem report and your "
+ "/tmp/XWin.log file to cygwin-xfree@cygwin.com\n");
+
+ /* Location of shadow framebuffer has changed */
+ pScreenInfo->pfb = pScreenPriv->pddsdShadow->lpSurface;
+
+ /* Update the screen pixmap */
+ if (!(*pScreen->ModifyPixmapHeader)(pScreen->devPrivate,
+ pScreen->width,
+ pScreen->height,
+ pScreen->rootDepth,
+ BitsPerPixel (pScreen->rootDepth),
+ PixmapBytePad (pScreenInfo->dwStride,
+ pScreenInfo->dwBPP),
+ pScreenInfo->pfb))
+ {
+ ErrorF ("winShadowUpdateProcDD - Bits changed, could not "
+ "notify fb.\n");
+ return;
+ }
+ }
+}
+
+
+/*
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
+
+Bool
+winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ Bool fReturn;
+
+#if CYGDEBUG
+ ErrorF ("winCloseScreenShadowDD - Freeing screen resources\n");
+#endif
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /* Call the wrapped CloseScreen procedure */
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+
+ /* Free the screen DC */
+ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ /* Free the shadow surface, if there is one */
+ if (pScreenPriv->pddsShadow)
+ {
+ IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
+ IDirectDrawSurface2_Release (pScreenPriv->pddsShadow);
+ pScreenPriv->pddsShadow = NULL;
+ }
+
+ /* Detach the clipper from the primary surface and release the clipper. */
+ if (pScreenPriv->pddcPrimary)
+ {
+ /* Detach the clipper */
+ IDirectDrawSurface2_SetClipper (pScreenPriv->pddsPrimary,
+ NULL);
+
+ /* Release the clipper object */
+ IDirectDrawClipper_Release (pScreenPriv->pddcPrimary);
+ pScreenPriv->pddcPrimary = NULL;
+ }
+
+ /* Release the primary surface, if there is one */
+ if (pScreenPriv->pddsPrimary)
+ {
+ IDirectDrawSurface2_Release (pScreenPriv->pddsPrimary);
+ pScreenPriv->pddsPrimary = NULL;
+ }
+
+ /* Free the DirectDraw2 object, if there is one */
+ if (pScreenPriv->pdd2)
+ {
+ IDirectDraw2_RestoreDisplayMode (pScreenPriv->pdd2);
+ IDirectDraw2_Release (pScreenPriv->pdd2);
+ pScreenPriv->pdd2 = NULL;
+ }
+
+ /* Free the DirectDraw object, if there is one */
+ if (pScreenPriv->pdd)
+ {
+ IDirectDraw_Release (pScreenPriv->pdd);
+ pScreenPriv->pdd = NULL;
+ }
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+ /* Destroy the thread startup mutex */
+ pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
+
+ /* Kill our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Invalidate the ScreenInfo's fb pointer */
+ pScreenInfo->pfb = NULL;
+
+ /* Free the screen privates for this screen */
+ free ((pointer) pScreenPriv);
+
+ return fReturn;
+}
+
+
+/*
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
+
+Bool
+winInitVisualsShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
+
+ /* Count the number of ones in each color mask */
+ dwRedBits = winCountBits (pScreenPriv->dwRedMask);
+ dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
+ dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
+
+ /* Store the maximum number of ones in a color mask as the bitsPerRGB */
+ if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0)
+ pScreenPriv->dwBitsPerRGB = 8;
+ else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ ErrorF ("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d "
+ "bpp %d\n",
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenInfo->dwDepth,
+ pScreenInfo->dwBPP);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+#if defined(XFree86Server)
+ /* Create the real visual */
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ TrueColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
+ "failed for TrueColor\n");
+ return FALSE;
+ }
+
+#if WIN_EMULATE_PSEUDO_SUPPORT
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!miSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ -1,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+#else /* XFree86Server */
+ /* Create the real visual */
+ if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
+ "failed for TrueColor\n");
+ return FALSE;
+ }
+
+#if WIN_EMULATE_PSEUDO_SUPPORT
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!fbSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+#endif /* XFree86Server */
+ break;
+
+ case 8:
+#if defined(XFree86Server)
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ pScreenInfo->fFullScreen
+ ? PseudoColorMask : StaticColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenInfo->fFullScreen
+ ? PseudoColor : StaticColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDD - miSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+#else /* XFree86Server */
+ if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ pScreenInfo->fFullScreen
+ ? PseudoColorMask : StaticColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDD - fbSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+#endif /* XFree86Server */
+ break;
+
+ default:
+ ErrorF ("winInitVisualsShadowDD - Unknown screen depth\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winInitVisualsShadowDD - Returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Adjust the user proposed video mode
+ */
+
+Bool
+winAdjustVideoModeShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc = NULL;
+ DWORD dwBPP;
+
+ /* We're in serious trouble if we can't get a DC */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModeShadowDD - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* DirectDraw can only change the depth in fullscreen mode */
+ if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
+ {
+ /* No -depth parameter passed, let the user know the depth being used */
+ ErrorF ("winAdjustVideoModeShadowDD - Using Windows display "
+ "depth of %d bits per pixel\n", dwBPP);
+
+ /* Use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+ else if (pScreenInfo->fFullScreen
+ && pScreenInfo->dwBPP != dwBPP)
+ {
+ /* FullScreen, and GDI depth differs from -depth parameter */
+ ErrorF ("winAdjustVideoModeShadowDD - FullScreen, using command line "
+ "bpp: %d\n", pScreenInfo->dwBPP);
+ }
+ else if (dwBPP != pScreenInfo->dwBPP)
+ {
+ /* Windowed, and GDI depth differs from -depth parameter */
+ ErrorF ("winAdjustVideoModeShadowDD - Windowed, command line bpp: "
+ "%d, using bpp: %d\n", pScreenInfo->dwBPP, dwBPP);
+
+ /* We'll use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+
+ /* See if the shadow bitmap will be larger than the DIB size limit */
+ if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP
+ >= WIN_DIB_MAXIMUM_SIZE)
+ {
+ ErrorF ("winAdjustVideoModeShadowDD - Requested DirectDraw surface "
+ "will be larger than %d MB. The surface may fail to be "
+ "allocated on Windows 95, 98, or Me, due to a %d MB limit in "
+ "DIB size. This limit does not apply to Windows NT/2000, and "
+ "this message may be ignored on those platforms.\n",
+ WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB);
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+ return TRUE;
+}
+
+
+/*
+ * Blt exposed regions to the screen
+ */
+
+Bool
+winBltExposedRegionsShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcSrc, rcDest;
+ POINT ptOrigin;
+ HDC hdcUpdate = NULL;
+ PAINTSTRUCT ps;
+ HRESULT ddrval = DD_OK;
+ Bool fReturn = TRUE;
+ Bool fLocked = TRUE;
+ int i;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+ if (hdcUpdate == NULL)
+ {
+ ErrorF ("winBltExposedRegionsShadowDD - BeginPaint () returned "
+ "a NULL device context handle. Aborting blit attempt.\n");
+ return FALSE;
+ }
+
+ /* Unlock the shadow surface, so we can blit */
+ ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
+ if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ goto winBltExposedRegionsShadowDD_Exit;
+ }
+ else
+ {
+ /* Flag that we have unlocked the shadow surface */
+ fLocked = FALSE;
+ }
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+ rcDest.left = ptOrigin.x;
+ rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
+ rcDest.top = ptOrigin.y;
+ rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
+
+ /* Source can be enter shadow surface, as Blt should clip */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Try to regain the primary surface and blit again if we've lost it */
+ for (i = 0; i <= WIN_REGAIN_SURFACE_RETRIES; ++i)
+ {
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcDest,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (ddrval == DDERR_SURFACELOST)
+ {
+ /* Surface was lost */
+ ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt "
+ "reported that the primary surface was lost, "
+ "trying to restore, retry: %d\n", i + 1);
+
+ /* Try to restore the surface, once */
+ ddrval = IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
+ ErrorF ("winBltExposedRegionsShadowDDNL - "
+ "IDirectDrawSurface2_Restore returned: ");
+ if (ddrval == DD_OK)
+ continue;
+ else if (ddrval == DDERR_WRONGMODE)
+ ErrorF ("DDERR_WRONGMODE\n");
+ else if (ddrval == DDERR_INCOMPATIBLEPRIMARY)
+ ErrorF ("DDERR_INCOMPATIBLEPRIMARY\n");
+ else if (ddrval == DDERR_UNSUPPORTED)
+ ErrorF ("DDERR_UNSUPPORTED\n");
+ else if (ddrval == DDERR_INVALIDPARAMS)
+ ErrorF ("DDERR_INVALIDPARAMS\n");
+ else if (ddrval == DDERR_INVALIDOBJECT)
+ ErrorF ("DDERR_INVALIDOBJECT\n");
+ else
+ ErrorF ("unknown error: %08x\n", ddrval);
+
+ /* Loop around to try the blit one more time */
+ continue;
+ }
+ else if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Blt "
+ "failed, but surface not lost: %08x %d\n", ddrval, ddrval);
+ goto winBltExposedRegionsShadowDD_Exit;
+ }
+ else
+ {
+ /* Success, stop looping */
+ break;
+ }
+ }
+
+ /* Relock the shadow surface */
+ ddrval = IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pScreenPriv->pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ ErrorF ("winBltExposedRegionsShadowDD - IDirectDrawSurface2_Lock "
+ "failed\n");
+ goto winBltExposedRegionsShadowDD_Exit;
+ }
+ else
+ {
+ /* Indicate that we have relocked the shadow surface */
+ fLocked = TRUE;
+ }
+
+ /* Has our memory pointer changed? */
+ if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdShadow->lpSurface);
+
+ winBltExposedRegionsShadowDD_Exit:
+ /* EndPaint frees the DC */
+ if (hdcUpdate != NULL)
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+
+ /*
+ * Relock the surface if it is not locked. We don't care if locking fails,
+ * as it will cause the server to shutdown within a few more operations.
+ */
+ if (!fLocked)
+ {
+ IDirectDrawSurface2_Lock (pScreenPriv->pddsShadow,
+ NULL,
+ pScreenPriv->pddsdShadow,
+ DDLOCK_WAIT,
+ NULL);
+
+ /* Has our memory pointer changed? */
+ if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
+ winUpdateFBPointer (pScreen,
+ pScreenPriv->pddsdShadow->lpSurface);
+
+ fLocked = TRUE;
+ }
+ return fReturn;
+}
+
+
+/*
+ * Do any engine-specific appliation-activation processing
+ */
+
+Bool
+winActivateAppShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /*
+ * Do we have a surface?
+ * Are we active?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->pddsPrimary != NULL
+ && pScreenPriv->fActive)
+ {
+ /* Primary surface was lost, restore it */
+ IDirectDrawSurface2_Restore (pScreenPriv->pddsPrimary);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Reblit the shadow framebuffer to the screen.
+ */
+
+Bool
+winRedrawScreenShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ RECT rcSrc, rcDest;
+ POINT ptOrigin;
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+ rcDest.left = ptOrigin.x;
+ rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
+ rcDest.top = ptOrigin.y;
+ rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
+
+ /* Source can be entire shadow surface, as Blt should clip for us */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Redraw the whole window, to take account for the new colors */
+ ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary,
+ &rcDest,
+ pScreenPriv->pddsShadow,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winRedrawScreenShadowDD - IDirectDrawSurface_Blt () "
+ "failed: %08x\n",
+ ddrval);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Realize the currently installed colormap
+ */
+
+Bool
+winRealizeInstalledPaletteShadowDD (ScreenPtr pScreen)
+{
+ return TRUE;
+}
+
+
+/*
+ * Install the specified colormap
+ */
+
+Bool
+winInstallColormapShadowDD (ColormapPtr pColormap)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ HRESULT ddrval = DD_OK;
+
+ /* Install the DirectDraw palette on the primary surface */
+ ddrval = IDirectDrawSurface2_SetPalette (pScreenPriv->pddsPrimary,
+ pCmapPriv->lpDDPalette);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winInstallColormapShadowDD - Failed installing the "
+ "DirectDraw palette.\n");
+ return FALSE;
+ }
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+
+ return TRUE;
+}
+
+
+/*
+ * Store the specified colors in the specified colormap
+ */
+
+Bool
+winStoreColorsShadowDD (ColormapPtr pColormap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
+ HRESULT ddrval = DD_OK;
+
+ /* Put the X colormap entries into the Windows logical palette */
+ ddrval = IDirectDrawPalette_SetEntries (pCmapPriv->lpDDPalette,
+ 0,
+ pdefs[0].pixel,
+ ndef,
+ pCmapPriv->peColors
+ + pdefs[0].pixel);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed\n");
+ return FALSE;
+ }
+
+ /* Don't install the DirectDraw palette if the colormap is not installed */
+ if (pColormap != curpmap)
+ {
+ return TRUE;
+ }
+
+ if (!winInstallColormapShadowDD (pColormap))
+ {
+ ErrorF ("winStoreColorsShadowDDNL - Failed installing colormap\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap initialization procedure
+ */
+
+Bool
+winCreateColormapShadowDD (ColormapPtr pColormap)
+{
+ HRESULT ddrval = DD_OK;
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+
+ /* Create a DirectDraw palette */
+ ddrval = IDirectDraw2_CreatePalette (pScreenPriv->pdd,
+ DDPCAPS_8BIT | DDPCAPS_ALLOW256,
+ pCmapPriv->peColors,
+ &pCmapPriv->lpDDPalette,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreateColormapShadowDDNL - CreatePalette failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap destruction procedure
+ */
+
+Bool
+winDestroyColormapShadowDD (ColormapPtr pColormap)
+{
+ winScreenPriv(pColormap->pScreen);
+ winCmapPriv(pColormap);
+ HRESULT ddrval = DD_OK;
+
+ /*
+ * Is colormap to be destroyed the default?
+ *
+ * Non-default colormaps should have had winUninstallColormap
+ * called on them before we get here. The default colormap
+ * will not have had winUninstallColormap called on it. Thus,
+ * we need to handle the default colormap in a special way.
+ */
+ if (pColormap->flags & IsDefault)
+ {
+#if CYGDEBUG
+ ErrorF ("winDestroyColormapShadowDDNL - Destroying default "
+ "colormap\n");
+#endif
+
+ /*
+ * FIXME: Walk the list of all screens, popping the default
+ * palette out of each screen device context.
+ */
+
+ /* Pop the palette out of the primary surface */
+ ddrval = IDirectDrawSurface2_SetPalette (pScreenPriv->pddsPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winDestroyColormapShadowDDNL - Failed freeing the "
+ "default colormap DirectDraw palette.\n");
+ return FALSE;
+ }
+
+ /* Clear our private installed colormap pointer */
+ pScreenPriv->pcmapInstalled = NULL;
+ }
+
+ /* Release the palette */
+ IDirectDrawPalette_Release (pCmapPriv->lpDDPalette);
+
+ /* Invalidate the colormap privates */
+ pCmapPriv->lpDDPalette = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Set engine specific functions
+ */
+
+Bool
+winSetEngineFunctionsShadowDD (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBShadowDD;
+ pScreenPriv->pwinShadowUpdate = winShadowUpdateDD;
+ pScreenPriv->pwinCloseScreen = winCloseScreenShadowDD;
+ pScreenPriv->pwinInitVisuals = winInitVisualsShadowDD;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDD;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDD;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowDD;
+ pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDD;
+ pScreenPriv->pwinRealizeInstalledPalette
+ = winRealizeInstalledPaletteShadowDD;
+ pScreenPriv->pwinInstallColormap = winInstallColormapShadowDD;
+ pScreenPriv->pwinStoreColors = winStoreColorsShadowDD;
+ pScreenPriv->pwinCreateColormap = winCreateColormapShadowDD;
+ pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDD;
+ pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
+ pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDD;
+ pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDD;
+
+ return TRUE;
+}
+
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
new file mode 100644
index 000000000..69396a79b
--- /dev/null
+++ b/hw/xwin/winshadddnl.c
@@ -0,0 +1,1288 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshadddnl.c,v 1.24 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+/*
+ * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly,
+ * so we have to redefine it here.
+ */
+#ifdef DEFINE_GUID
+#undef DEFINE_GUID
+#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+#endif /* DEFINE_GUID */
+
+/*
+ * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined
+ * here manually. Should be handled by ddraw.h
+ */
+#ifndef IID_IDirectDraw4
+DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
+#endif /* IID_IDirectDraw4 */
+
+
+/*
+ * Create the primary surface and attach the clipper.
+ * Used for both the initial surface creation and during
+ * WM_DISPLAYCHANGE messages.
+ */
+
+Bool
+winCreatePrimarySurfaceShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC2 ddsd;
+
+ ErrorF ("winCreatePrimarySurfaceShadowDDNL - Creating primary surface\n");
+
+ /* Describe the primary surface */
+ ZeroMemory (&ddsd, sizeof (ddsd));
+ ddsd.dwSize = sizeof (ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+
+ /* Create the primary surface */
+ ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4,
+ &ddsd,
+ &pScreenPriv->pddsPrimary4,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreatePrimarySurfaceShadowDDNL - Could not create primary "
+ "surface: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if 1
+ ErrorF ("winCreatePrimarySurfaceShadowDDNL - Created primary surface\n");
+#endif
+
+ /* Attach our clipper to our primary surface handle */
+ ddrval = IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4,
+ pScreenPriv->pddcPrimary);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreatePrimarySurfaceShadowDDNL - Primary attach clipper "
+ "failed: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if 1
+ ErrorF ("winCreatePrimarySurfaceShadowDDNL - Attached clipper to primary "
+ "surface\n");
+#endif
+
+ /* Everything was correct */
+ return TRUE;
+}
+
+
+/*
+ * Detach the clipper and release the primary surface.
+ * Called from WM_DISPLAYCHANGE.
+ */
+
+Bool
+winReleasePrimarySurfaceShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ ErrorF ("winReleasePrimarySurfaceShadowDDNL - Hello\n");
+
+ /* Release the primary surface and clipper, if they exist */
+ if (pScreenPriv->pddsPrimary4)
+ {
+ /*
+ * Detach the clipper from the primary surface.
+ * NOTE: We do this explicity for clarity. The Clipper is not released.
+ */
+ IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4,
+ NULL);
+
+ ErrorF ("winReleasePrimarySurfaceShadowDDNL - Detached clipper\n");
+
+ /* Release the primary surface */
+ IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4);
+ pScreenPriv->pddsPrimary4 = NULL;
+ }
+
+ ErrorF ("winReleasePrimarySurfaceShadowDDNL - Released primary surface\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Create a DirectDraw surface for the shadow framebuffer; also create
+ * a primary surface object so we can blit to the display.
+ *
+ * Install a DirectDraw clipper on our primary surface object
+ * that clips our blits to the unobscured client area of our display window.
+ */
+
+Bool
+winAllocateFBShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ DDSURFACEDESC2 ddsdShadow;
+ char *lpSurface = NULL;
+ DDPIXELFORMAT ddpfPrimary;
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDDNL - w %d h %d d %d\n",
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight, pScreenInfo->dwDepth);
+#endif
+
+ /* Allocate memory for our shadow surface */
+ lpSurface = malloc (pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight);
+ if (lpSurface == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not allocate bits\n");
+ return FALSE;
+ }
+
+ /*
+ * Initialize the framebuffer memory so we don't get a
+ * strange display at startup
+ */
+ ZeroMemory (lpSurface, pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight);
+
+ /* Create a clipper */
+ ddrval = (*g_fpDirectDrawCreateClipper) (0,
+ &pScreenPriv->pddcPrimary,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not attach clipper: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDDNL - Created a clipper\n");
+#endif
+
+ /* Get a device context for the screen */
+ pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
+
+ /* Attach the clipper to our display window */
+ ddrval = IDirectDrawClipper_SetHWnd (pScreenPriv->pddcPrimary,
+ 0,
+ pScreenPriv->hwndScreen);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Clipper not attached "
+ "to window: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDDNL - Attached clipper to window\n");
+#endif
+
+ /* Create a DirectDraw object, store the address at lpdd */
+ ddrval = (*g_fpDirectDrawCreate) (NULL,
+ (LPDIRECTDRAW*) &pScreenPriv->pdd,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not start "
+ "DirectDraw: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDDNL - Created and initialized DD\n");
+#endif
+
+ /* Get a DirectDraw4 interface pointer */
+ ddrval = IDirectDraw_QueryInterface (pScreenPriv->pdd,
+ &IID_IDirectDraw4,
+ (LPVOID*) &pScreenPriv->pdd4);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Failed DD4 query: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+ /* Are we full screen? */
+ if (pScreenInfo->fFullScreen)
+ {
+ DDSURFACEDESC2 ddsdCurrent;
+ DWORD dwRefreshRateCurrent = 0;
+ HDC hdc = NULL;
+
+ /* Set the cooperative level to full screen */
+ ddrval = IDirectDraw4_SetCooperativeLevel (pScreenPriv->pdd4,
+ pScreenPriv->hwndScreen,
+ DDSCL_EXCLUSIVE
+ | DDSCL_FULLSCREEN);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set "
+ "cooperative level: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+ /*
+ * We only need to get the current refresh rate for comparison
+ * if a refresh rate has been passed on the command line.
+ */
+ if (pScreenInfo->dwRefreshRate != 0)
+ {
+ ZeroMemory (&ddsdCurrent, sizeof (ddsdCurrent));
+ ddsdCurrent.dwSize = sizeof (ddsdCurrent);
+
+ /* Get information about current display settings */
+ ddrval = IDirectDraw4_GetDisplayMode (pScreenPriv->pdd4,
+ &ddsdCurrent);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not get current "
+ "refresh rate: %08x. Continuing.\n",
+ ddrval);
+ dwRefreshRateCurrent = 0;
+ }
+ else
+ {
+ /* Grab the current refresh rate */
+ dwRefreshRateCurrent = ddsdCurrent.u2.dwRefreshRate;
+ }
+ }
+
+ /* Clean up the refresh rate */
+ if (dwRefreshRateCurrent == pScreenInfo->dwRefreshRate)
+ {
+ /*
+ * Refresh rate is non-specified or equal to current.
+ */
+ pScreenInfo->dwRefreshRate = 0;
+ }
+
+ /* Grab a device context for the screen */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAllocateFBShadowDDNL - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Only change the video mode when different than current mode */
+ if (!pScreenInfo->fMultipleMonitors
+ && (pScreenInfo->dwWidth != GetSystemMetrics (SM_CXSCREEN)
+ || pScreenInfo->dwHeight != GetSystemMetrics (SM_CYSCREEN)
+ || pScreenInfo->dwBPP != GetDeviceCaps (hdc, BITSPIXEL)
+ || pScreenInfo->dwRefreshRate != 0))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Changing video mode\n");
+
+ /* Change the video mode to the mode requested */
+ ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
+ pScreenInfo->dwWidth,
+ pScreenInfo->dwHeight,
+ pScreenInfo->dwBPP,
+ pScreenInfo->dwRefreshRate,
+ 0);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set "
+ "full screen display mode: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+ }
+ else
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Not changing video mode\n");
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+ }
+ else
+ {
+ /* Set the cooperative level for windowed mode */
+ ddrval = IDirectDraw4_SetCooperativeLevel (pScreenPriv->pdd4,
+ pScreenPriv->hwndScreen,
+ DDSCL_NORMAL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not set "
+ "cooperative level: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+ }
+
+ /* Create the primary surface */
+ if (!winCreatePrimarySurfaceShadowDDNL (pScreen))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - winCreatePrimarySurfaceShadowDDNL "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Get primary surface's pixel format */
+ ZeroMemory (&ddpfPrimary, sizeof (ddpfPrimary));
+ ddpfPrimary.dwSize = sizeof (ddpfPrimary);
+ ddrval = IDirectDrawSurface4_GetPixelFormat (pScreenPriv->pddsPrimary4,
+ &ddpfPrimary);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not get primary "
+ "pixformat: %08x\n",
+ ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDDNL - Primary masks: %08x %08x %08x "
+ "dwRGBBitCount: %d\n",
+ ddpfPrimary.u2.dwRBitMask,
+ ddpfPrimary.u3.dwGBitMask,
+ ddpfPrimary.u4.dwBBitMask,
+ ddpfPrimary.u1.dwRGBBitCount);
+#endif
+
+ /* Describe the shadow surface to be created */
+ /*
+ * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface,
+ * as drawing, locking, and unlocking take forever
+ * with video memory surfaces. In addition,
+ * video memory is a somewhat scarce resource,
+ * so you shouldn't be allocating video memory when
+ * you have the option of using system memory instead.
+ */
+ ZeroMemory (&ddsdShadow, sizeof (ddsdShadow));
+ ddsdShadow.dwSize = sizeof (ddsdShadow);
+ ddsdShadow.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH
+ | DDSD_LPSURFACE | DDSD_PITCH | DDSD_PIXELFORMAT;
+ ddsdShadow.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
+ ddsdShadow.dwHeight = pScreenInfo->dwHeight;
+ ddsdShadow.dwWidth = pScreenInfo->dwWidth;
+ ddsdShadow.u1.lPitch = pScreenInfo->dwPaddedWidth;
+ ddsdShadow.lpSurface = lpSurface;
+ ddsdShadow.u4.ddpfPixelFormat = ddpfPrimary;
+
+ ErrorF ("winAllocateFBShadowDDNL - lPitch: %d\n",
+ pScreenInfo->dwPaddedWidth);
+
+ /* Create the shadow surface */
+ ddrval = IDirectDraw4_CreateSurface (pScreenPriv->pdd4,
+ &ddsdShadow,
+ &pScreenPriv->pddsShadow4,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winAllocateFBShadowDDNL - Could not create shadow "
+ "surface: %08x\n", ddrval);
+ return FALSE;
+ }
+
+#if CYGDEBUG || YES
+ ErrorF ("winAllocateFBShadowDDNL - Created shadow pitch: %d\n",
+ ddsdShadow.u1.lPitch);
+#endif
+
+ /* Grab the pitch from the surface desc */
+ pScreenInfo->dwStride = (ddsdShadow.u1.lPitch * 8)
+ / pScreenInfo->dwBPP;
+
+#if CYGDEBUG || YES
+ ErrorF ("winAllocateFBShadowDDNL - Created shadow stride: %d\n",
+ pScreenInfo->dwStride);
+#endif
+
+ /* Save the pointer to our surface memory */
+ pScreenInfo->pfb = lpSurface;
+
+ /* Grab the masks from the surface description */
+ pScreenPriv->dwRedMask = ddsdShadow.u4.ddpfPixelFormat.u2.dwRBitMask;
+ pScreenPriv->dwGreenMask = ddsdShadow.u4.ddpfPixelFormat.u3.dwGBitMask;
+ pScreenPriv->dwBlueMask = ddsdShadow.u4.ddpfPixelFormat.u4.dwBBitMask;
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowDDNL - Returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Transfer the damaged regions of the shadow framebuffer to the display.
+ */
+
+void
+winShadowUpdateDDNL (ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RegionPtr damage = &pBuf->damage;
+ HRESULT ddrval = DD_OK;
+ RECT rcDest, rcSrc;
+ POINT ptOrigin;
+ DWORD dwBox = REGION_NUM_RECTS (damage);
+ BoxPtr pBox = REGION_RECTS (damage);
+ HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+
+ /*
+ * Return immediately if the app is not active
+ * and we are fullscreen, or if we have a bad display depth
+ */
+ if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
+ || pScreenPriv->fBadDepth) return;
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+
+ /*
+ * Handle small regions with multiple blits,
+ * handle large regions by creating a clipping region and
+ * doing a single blit constrained to that clipping region.
+ */
+ if (pScreenInfo->dwClipUpdatesNBoxes == 0
+ || dwBox < pScreenInfo->dwClipUpdatesNBoxes)
+ {
+ /* Loop through all boxes in the damaged region */
+ while (dwBox--)
+ {
+ /* Assign damage box to source rectangle */
+ rcSrc.left = pBox->x1;
+ rcSrc.top = pBox->y1;
+ rcSrc.right = pBox->x2;
+ rcSrc.bottom = pBox->y2;
+
+ /* Calculate destination rectangle */
+ rcDest.left = ptOrigin.x + rcSrc.left;
+ rcDest.top = ptOrigin.y + rcSrc.top;
+ rcDest.right = ptOrigin.x + rcSrc.right;
+ rcDest.bottom = ptOrigin.y + rcSrc.bottom;
+
+ /* Blit the damaged areas */
+ ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4,
+ &rcDest,
+ pScreenPriv->pddsShadow4,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winShadowUpdateDDNL - IDirectDrawSurface4_Blt () "
+ "failed: %08x\n",
+ ddrval);
+ }
+
+ /* Get a pointer to the next box */
+ ++pBox;
+ }
+ }
+ else
+ {
+ BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
+
+ /* Compute a GDI region from the damaged region */
+ hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ dwBox--;
+ pBox++;
+ while (dwBox--)
+ {
+ hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
+ DeleteObject (hrgnTemp);
+ pBox++;
+ }
+
+ /* Install the GDI region as a clipping region */
+ SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
+ DeleteObject (hrgnCombined);
+ hrgnCombined = NULL;
+
+#if CYGDEBUG
+ ErrorF ("winShadowUpdateDDNL - be x1 %d y1 %d x2 %d y2 %d\n",
+ pBoxExtents->x1, pBoxExtents->y1,
+ pBoxExtents->x2, pBoxExtents->y2);
+#endif
+
+ /* Calculating a bounding box for the source is easy */
+ rcSrc.left = pBoxExtents->x1;
+ rcSrc.top = pBoxExtents->y1;
+ rcSrc.right = pBoxExtents->x2;
+ rcSrc.bottom = pBoxExtents->y2;
+
+ /* Calculating a bounding box for the destination is trickier */
+ rcDest.left = ptOrigin.x + rcSrc.left;
+ rcDest.top = ptOrigin.y + rcSrc.top;
+ rcDest.right = ptOrigin.x + rcSrc.right;
+ rcDest.bottom = ptOrigin.y + rcSrc.bottom;
+
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4,
+ &rcDest,
+ pScreenPriv->pddsShadow4,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+
+ /* Reset the clip region */
+ SelectClipRgn (pScreenPriv->hdcScreen, NULL);
+ }
+}
+
+
+/*
+ * Call the wrapped CloseScreen function.
+ *
+ * Free our resources and private structures.
+ */
+
+Bool
+winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ Bool fReturn;
+
+#if CYGDEBUG
+ ErrorF ("winCloseScreenShadowDDNL - Freeing screen resources\n");
+#endif
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /* Call the wrapped CloseScreen procedure */
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+
+ /* Free the screen DC */
+ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ /* Free the shadow surface, if there is one */
+ if (pScreenPriv->pddsShadow4)
+ {
+ IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4);
+ free (pScreenInfo->pfb);
+ pScreenInfo->pfb = NULL;
+ pScreenPriv->pddsShadow4 = NULL;
+ }
+
+ /* Detach the clipper from the primary surface and release the clipper. */
+ if (pScreenPriv->pddcPrimary)
+ {
+ /* Detach the clipper */
+ IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4,
+ NULL);
+
+ /* Release the clipper object */
+ IDirectDrawClipper_Release (pScreenPriv->pddcPrimary);
+ pScreenPriv->pddcPrimary = NULL;
+ }
+
+ /* Release the primary surface, if there is one */
+ if (pScreenPriv->pddsPrimary4)
+ {
+ IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4);
+ pScreenPriv->pddsPrimary4 = NULL;
+ }
+
+ /* Free the DirectDraw4 object, if there is one */
+ if (pScreenPriv->pdd4)
+ {
+ IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4);
+ IDirectDraw4_Release (pScreenPriv->pdd4);
+ pScreenPriv->pdd4 = NULL;
+ }
+
+ /* Free the DirectDraw object, if there is one */
+ if (pScreenPriv->pdd)
+ {
+ IDirectDraw_Release (pScreenPriv->pdd);
+ pScreenPriv->pdd = NULL;
+ }
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+ /* Destroy the thread startup mutex */
+ pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
+
+ /* Kill our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Invalidate the ScreenInfo's fb pointer */
+ pScreenInfo->pfb = NULL;
+
+ /* Free the screen privates for this screen */
+ free ((pointer) pScreenPriv);
+
+ return fReturn;
+}
+
+
+/*
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
+
+Bool
+winInitVisualsShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
+
+ /* Count the number of ones in each color mask */
+ dwRedBits = winCountBits (pScreenPriv->dwRedMask);
+ dwGreenBits = winCountBits (pScreenPriv->dwGreenMask);
+ dwBlueBits = winCountBits (pScreenPriv->dwBlueMask);
+
+ /* Store the maximum number of ones in a color mask as the bitsPerRGB */
+ if (dwRedBits == 0 || dwGreenBits == 0 || dwBlueBits == 0)
+ pScreenPriv->dwBitsPerRGB = 8;
+ else if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ ErrorF ("winInitVisualsShadowDDNL - Masks %08x %08x %08x BPRGB %d d %d "
+ "bpp %d\n",
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenInfo->dwDepth,
+ pScreenInfo->dwBPP);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+#if defined(XFree86Server)
+ /* Setup the real visual */
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ -1,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
+ "failed for TrueColor\n");
+ return FALSE;
+ }
+
+#if WIN_EMULATE_PSEUDO_SUPPORT
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!miSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ -1,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+#else /* XFree86Server */
+ /* Setup the real visual */
+ if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
+ "failed for TrueColor\n");
+ return FALSE;
+ }
+
+#if WIN_EMULATE_PSEUDO_SUPPORT
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!fbSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+#endif /* XFree86Server */
+ break;
+
+ case 8:
+#if defined(XFree86Server)
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ pScreenInfo->fFullScreen
+ ? PseudoColorMask : StaticColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenInfo->fFullScreen
+ ? PseudoColor : StaticColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - miSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+#else /* XFree86Server */
+ if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ pScreenInfo->fFullScreen
+ ? PseudoColorMask : StaticColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowDDNL - fbSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+#endif /* XFree86Server */
+ break;
+
+ default:
+ ErrorF ("winInitVisualsShadowDDNL - Unknown screen depth\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winInitVisualsShadowDDNL - Returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Adjust the user proposed video mode
+ */
+
+Bool
+winAdjustVideoModeShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc = NULL;
+ DWORD dwBPP;
+
+ /* We're in serious trouble if we can't get a DC */
+ hdc = GetDC (NULL);
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModeShadowDDNL - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* DirectDraw can only change the depth in fullscreen mode */
+ if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
+ {
+ /* No -depth parameter passed, let the user know the depth being used */
+ ErrorF ("winAdjustVideoModeShadowDDNL - Using Windows display "
+ "depth of %d bits per pixel\n", dwBPP);
+
+ /* Use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+ else if (pScreenInfo->fFullScreen
+ && pScreenInfo->dwBPP != dwBPP)
+ {
+ /* FullScreen, and GDI depth differs from -depth parameter */
+ ErrorF ("winAdjustVideoModeShadowDDNL - FullScreen, using command "
+ "line bpp: %d\n", pScreenInfo->dwBPP);
+ }
+ else if (dwBPP != pScreenInfo->dwBPP)
+ {
+ /* Windowed, and GDI depth differs from -depth parameter */
+ ErrorF ("winAdjustVideoModeShadowDDNL - Windowed, command line "
+ "bpp: %d, using bpp: %d\n",
+ pScreenInfo->dwBPP, dwBPP);
+
+ /* We'll use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+
+ /* See if the shadow bitmap will be larger than the DIB size limit */
+ if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP
+ >= WIN_DIB_MAXIMUM_SIZE)
+ {
+ ErrorF ("winAdjustVideoModeShadowDDNL - Requested DirectDraw surface "
+ "will be larger than %d MB. The surface may fail to be "
+ "allocated on Windows 95, 98, or Me, due to a %d MB limit in "
+ "DIB size. This limit does not apply to Windows NT/2000, and "
+ "this message may be ignored on those platforms.\n",
+ WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB);
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+
+ return TRUE;
+}
+
+
+/*
+ * Blt exposed regions to the screen
+ */
+
+Bool
+winBltExposedRegionsShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RECT rcSrc, rcDest;
+ POINT ptOrigin;
+ HDC hdcUpdate;
+ PAINTSTRUCT ps;
+ HRESULT ddrval = DD_OK;
+ Bool fReturn = TRUE;
+ int i;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+ if (hdcUpdate == NULL)
+ {
+ fReturn = FALSE;
+ ErrorF ("winBltExposedRegionsShadowDDNL - BeginPaint () returned "
+ "a NULL device context handle. Aborting blit attempt.\n");
+ goto winBltExposedRegionsShadowDDNL_Exit;
+ }
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+ rcDest.left = ptOrigin.x;
+ rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
+ rcDest.top = ptOrigin.y;
+ rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
+
+ /* Source can be entire shadow surface, as Blt should clip for us */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Try to regain the primary surface and blit again if we've lost it */
+ for (i = 0; i <= WIN_REGAIN_SURFACE_RETRIES; ++i)
+ {
+ /* Our Blt should be clipped to the invalidated region */
+ ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4,
+ &rcDest,
+ pScreenPriv->pddsShadow4,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (ddrval == DDERR_SURFACELOST)
+ {
+ /* Surface was lost */
+ ErrorF ("winBltExposedRegionsShadowDDNL - IDirectDrawSurface4_Blt "
+ "reported that the primary surface was lost, "
+ "trying to restore, retry: %d\n", i + 1);
+
+ /* Try to restore the surface, once */
+
+ ddrval = IDirectDrawSurface4_Restore (pScreenPriv->pddsPrimary4);
+ ErrorF ("winBltExposedRegionsShadowDDNL - "
+ "IDirectDrawSurface4_Restore returned: ");
+ if (ddrval == DD_OK)
+ continue;
+ else if (ddrval == DDERR_WRONGMODE)
+ ErrorF ("DDERR_WRONGMODE\n");
+ else if (ddrval == DDERR_INCOMPATIBLEPRIMARY)
+ ErrorF ("DDERR_INCOMPATIBLEPRIMARY\n");
+ else if (ddrval == DDERR_UNSUPPORTED)
+ ErrorF ("DDERR_UNSUPPORTED\n");
+ else if (ddrval == DDERR_INVALIDPARAMS)
+ ErrorF ("DDERR_INVALIDPARAMS\n");
+ else if (ddrval == DDERR_INVALIDOBJECT)
+ ErrorF ("DDERR_INVALIDOBJECT\n");
+ else
+ ErrorF ("unknown error: %08x\n", ddrval);
+
+ /* Loop around to try the blit one more time */
+ continue;
+ }
+ else if (FAILED (ddrval))
+ {
+ fReturn = FALSE;
+ ErrorF ("winBltExposedRegionsShadowDDNL - IDirectDrawSurface4_Blt "
+ "failed, but surface not lost: %08x %d\n", ddrval, ddrval);
+ goto winBltExposedRegionsShadowDDNL_Exit;
+ }
+ else
+ {
+ /* Success, stop looping */
+ break;
+ }
+ }
+
+ winBltExposedRegionsShadowDDNL_Exit:
+ /* EndPaint frees the DC */
+ if (hdcUpdate != NULL)
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+ return fReturn;
+}
+
+
+/*
+ * Do any engine-specific appliation-activation processing
+ */
+
+Bool
+winActivateAppShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+
+ /*
+ * Do we have a surface?
+ * Are we active?
+ * Are we full screen?
+ */
+ if (pScreenPriv != NULL
+ && pScreenPriv->pddsPrimary4 != NULL
+ && pScreenPriv->fActive)
+ {
+ /* Primary surface was lost, restore it */
+ IDirectDrawSurface4_Restore (pScreenPriv->pddsPrimary4);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Reblit the shadow framebuffer to the screen.
+ */
+
+Bool
+winRedrawScreenShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HRESULT ddrval = DD_OK;
+ RECT rcSrc, rcDest;
+ POINT ptOrigin;
+
+ /* Get the origin of the window in the screen coords */
+ ptOrigin.x = pScreenInfo->dwXOffset;
+ ptOrigin.y = pScreenInfo->dwYOffset;
+ MapWindowPoints (pScreenPriv->hwndScreen,
+ HWND_DESKTOP,
+ (LPPOINT)&ptOrigin, 1);
+ rcDest.left = ptOrigin.x;
+ rcDest.right = ptOrigin.x + pScreenInfo->dwWidth;
+ rcDest.top = ptOrigin.y;
+ rcDest.bottom = ptOrigin.y + pScreenInfo->dwHeight;
+
+ /* Source can be entire shadow surface, as Blt should clip for us */
+ rcSrc.left = 0;
+ rcSrc.top = 0;
+ rcSrc.right = pScreenInfo->dwWidth;
+ rcSrc.bottom = pScreenInfo->dwHeight;
+
+ /* Redraw the whole window, to take account for the new colors */
+ ddrval = IDirectDrawSurface4_Blt (pScreenPriv->pddsPrimary4,
+ &rcDest,
+ pScreenPriv->pddsShadow4,
+ &rcSrc,
+ DDBLT_WAIT,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winRedrawScreenShadowDDNL - IDirectDrawSurface4_Blt () "
+ "failed: %08x\n",
+ ddrval);
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Realize the currently installed colormap
+ */
+
+Bool
+winRealizeInstalledPaletteShadowDDNL (ScreenPtr pScreen)
+{
+ return TRUE;
+}
+
+
+/*
+ * Install the specified colormap
+ */
+
+Bool
+winInstallColormapShadowDDNL (ColormapPtr pColormap)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ HRESULT ddrval = DD_OK;
+
+ /* Install the DirectDraw palette on the primary surface */
+ ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4,
+ pCmapPriv->lpDDPalette);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winInstallColormapShadowDDNL - Failed installing the "
+ "DirectDraw palette.\n");
+ return FALSE;
+ }
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+
+ return TRUE;
+}
+
+
+/*
+ * Store the specified colors in the specified colormap
+ */
+
+Bool
+winStoreColorsShadowDDNL (ColormapPtr pColormap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
+ HRESULT ddrval = DD_OK;
+
+ /* Put the X colormap entries into the Windows logical palette */
+ ddrval = IDirectDrawPalette_SetEntries (pCmapPriv->lpDDPalette,
+ 0,
+ pdefs[0].pixel,
+ ndef,
+ pCmapPriv->peColors
+ + pdefs[0].pixel);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed\n");
+ return FALSE;
+ }
+
+ /* Don't install the DirectDraw palette if the colormap is not installed */
+ if (pColormap != curpmap)
+ {
+ return TRUE;
+ }
+
+ if (!winInstallColormapShadowDDNL (pColormap))
+ {
+ ErrorF ("winStoreColorsShadowDDNL - Failed installing colormap\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap initialization procedure
+ */
+
+Bool
+winCreateColormapShadowDDNL (ColormapPtr pColormap)
+{
+ HRESULT ddrval = DD_OK;
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+
+ /* Create a DirectDraw palette */
+ ddrval = IDirectDraw4_CreatePalette (pScreenPriv->pdd4,
+ DDPCAPS_8BIT | DDPCAPS_ALLOW256,
+ pCmapPriv->peColors,
+ &pCmapPriv->lpDDPalette,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winCreateColormapShadowDDNL - CreatePalette failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap destruction procedure
+ */
+
+Bool
+winDestroyColormapShadowDDNL (ColormapPtr pColormap)
+{
+ winScreenPriv(pColormap->pScreen);
+ winCmapPriv(pColormap);
+ HRESULT ddrval = DD_OK;
+
+ /*
+ * Is colormap to be destroyed the default?
+ *
+ * Non-default colormaps should have had winUninstallColormap
+ * called on them before we get here. The default colormap
+ * will not have had winUninstallColormap called on it. Thus,
+ * we need to handle the default colormap in a special way.
+ */
+ if (pColormap->flags & IsDefault)
+ {
+#if CYGDEBUG
+ ErrorF ("winDestroyColormapShadowDDNL - Destroying default "
+ "colormap\n");
+#endif
+
+ /*
+ * FIXME: Walk the list of all screens, popping the default
+ * palette out of each screen device context.
+ */
+
+ /* Pop the palette out of the primary surface */
+ ddrval = IDirectDrawSurface4_SetPalette (pScreenPriv->pddsPrimary4,
+ NULL);
+ if (FAILED (ddrval))
+ {
+ ErrorF ("winDestroyColormapShadowDDNL - Failed freeing the "
+ "default colormap DirectDraw palette.\n");
+ return FALSE;
+ }
+
+ /* Clear our private installed colormap pointer */
+ pScreenPriv->pcmapInstalled = NULL;
+ }
+
+ /* Release the palette */
+ IDirectDrawPalette_Release (pCmapPriv->lpDDPalette);
+
+ /* Invalidate the colormap privates */
+ pCmapPriv->lpDDPalette = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Set pointers to our engine specific functions
+ */
+
+Bool
+winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBShadowDDNL;
+ pScreenPriv->pwinShadowUpdate = winShadowUpdateDDNL;
+ pScreenPriv->pwinCloseScreen = winCloseScreenShadowDDNL;
+ pScreenPriv->pwinInitVisuals = winInitVisualsShadowDDNL;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowDDNL;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDDNL;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowDDNL;
+ pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowDDNL;
+ pScreenPriv->pwinRealizeInstalledPalette
+ = winRealizeInstalledPaletteShadowDDNL;
+ pScreenPriv->pwinInstallColormap = winInstallColormapShadowDDNL;
+ pScreenPriv->pwinStoreColors = winStoreColorsShadowDDNL;
+ pScreenPriv->pwinCreateColormap = winCreateColormapShadowDDNL;
+ pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowDDNL;
+ pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
+ pScreenPriv->pwinCreatePrimarySurface = winCreatePrimarySurfaceShadowDDNL;
+ pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL;
+
+ return TRUE;
+}
+
+
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
new file mode 100644
index 000000000..d2f72f20d
--- /dev/null
+++ b/hw/xwin/winshadgdi.c
@@ -0,0 +1,1158 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winshadgdi.c,v 1.22 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+/*
+ * Local function prototypes
+ */
+
+BOOL CALLBACK
+winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam);
+
+
+/*
+ * Internal function to get the DIB format that is compatible with the screen
+ */
+
+static
+Bool
+winQueryScreenDIBFormat (ScreenPtr pScreen, BITMAPINFOHEADER *pbmih)
+{
+ winScreenPriv(pScreen);
+ HBITMAP hbmp;
+#if CYGDEBUG
+ LPDWORD pdw = NULL;
+#endif
+
+ /* Create a memory bitmap compatible with the screen */
+ hbmp = CreateCompatibleBitmap (pScreenPriv->hdcScreen, 1, 1);
+ if (hbmp == NULL)
+ {
+ ErrorF ("winQueryScreenDIBFormat - CreateCompatibleBitmap failed\n");
+ return FALSE;
+ }
+
+ /* Initialize our bitmap info header */
+ ZeroMemory (pbmih, sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD));
+ pbmih->biSize = sizeof (BITMAPINFOHEADER);
+
+ /* Get the biBitCount */
+ if (!GetDIBits (pScreenPriv->hdcScreen,
+ hbmp,
+ 0, 1,
+ NULL,
+ (BITMAPINFO*) pbmih,
+ DIB_RGB_COLORS))
+ {
+ ErrorF ("winQueryScreenDIBFormat - First call to GetDIBits failed\n");
+ DeleteObject (hbmp);
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ /* Get a pointer to bitfields */
+ pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
+
+ ErrorF ("winQueryScreenDIBFormat - First call masks: %08x %08x %08x\n",
+ pdw[0], pdw[1], pdw[2]);
+#endif
+
+ /* Get optimal color table, or the optimal bitfields */
+ if (!GetDIBits (pScreenPriv->hdcScreen,
+ hbmp,
+ 0, 1,
+ NULL,
+ (BITMAPINFO*)pbmih,
+ DIB_RGB_COLORS))
+ {
+ ErrorF ("winQueryScreenDIBFormat - Second call to GetDIBits "
+ "failed\n");
+ DeleteObject (hbmp);
+ return FALSE;
+ }
+
+ /* Free memory */
+ DeleteObject (hbmp);
+
+ return TRUE;
+}
+
+
+/*
+ * Internal function to determine the GDI bits per rgb and bit masks
+ */
+
+static
+Bool
+winQueryRGBBitsAndMasks (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ BITMAPINFOHEADER *pbmih = NULL;
+ Bool fReturn = TRUE;
+ LPDWORD pdw = NULL;
+ DWORD dwRedBits, dwGreenBits, dwBlueBits;
+
+ /* Color masks for 8 bpp are standardized */
+ if (GetDeviceCaps (pScreenPriv->hdcScreen, RASTERCAPS) & RC_PALETTE)
+ {
+ /*
+ * RGB BPP for 8 bit palletes is always 8
+ * and the color masks are always 0.
+ */
+ pScreenPriv->dwBitsPerRGB = 8;
+ pScreenPriv->dwRedMask = 0x0L;
+ pScreenPriv->dwGreenMask = 0x0L;
+ pScreenPriv->dwBlueMask = 0x0L;
+ return TRUE;
+ }
+
+ /* Color masks for 24 bpp are standardized */
+ if (GetDeviceCaps (pScreenPriv->hdcScreen, PLANES)
+ * GetDeviceCaps (pScreenPriv->hdcScreen, BITSPIXEL) == 24)
+ {
+ ErrorF ("winQueryRGBBitsAndMasks - GetDeviceCaps (BITSPIXEL) "
+ "returned 24 for the screen. Using default 24bpp masks.\n");
+
+ /* 8 bits per primary color */
+ pScreenPriv->dwBitsPerRGB = 8;
+
+ /* Set screen privates masks */
+ pScreenPriv->dwRedMask = WIN_24BPP_MASK_RED;
+ pScreenPriv->dwGreenMask = WIN_24BPP_MASK_GREEN;
+ pScreenPriv->dwBlueMask = WIN_24BPP_MASK_BLUE;
+
+ return TRUE;
+ }
+
+ /* Allocate a bitmap header and color table */
+ pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
+ + 256 * sizeof (RGBQUAD));
+ if (pbmih == NULL)
+ {
+ ErrorF ("winQueryRGBBitsAndMasks - malloc failed\n");
+ return FALSE;
+ }
+
+ /* Get screen description */
+ if (winQueryScreenDIBFormat (pScreen, pbmih))
+ {
+ /* Get a pointer to bitfields */
+ pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
+
+#if CYGDEBUG
+ ErrorF ("winQueryRGBBitsAndMasks - Masks: %08x %08x %08x\n",
+ pdw[0], pdw[1], pdw[2]);
+#endif
+
+ /* Count the number of bits in each mask */
+ dwRedBits = winCountBits (pdw[0]);
+ dwGreenBits = winCountBits (pdw[1]);
+ dwBlueBits = winCountBits (pdw[2]);
+
+ /* Find maximum bits per red, green, blue */
+ if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ /* Set screen privates masks */
+ pScreenPriv->dwRedMask = pdw[0];
+ pScreenPriv->dwGreenMask = pdw[1];
+ pScreenPriv->dwBlueMask = pdw[2];
+ }
+ else
+ {
+ ErrorF ("winQueryRGBBitsAndMasks - winQueryScreenDIBFormat failed\n");
+ free (pbmih);
+ fReturn = FALSE;
+ }
+
+ /* Free memory */
+ free (pbmih);
+
+ return fReturn;
+}
+
+
+/*
+ * Redraw all ---?
+ */
+
+BOOL CALLBACK
+winRedrawAllProcShadowGDI (HWND hwnd, LPARAM lParam)
+{
+ char strClassName[100];
+
+ if (GetClassName (hwnd, strClassName, 100))
+ {
+ if(strcmp (WINDOW_CLASS_X, strClassName) == 0)
+ {
+ InvalidateRect (hwnd, NULL, FALSE);
+ UpdateWindow (hwnd);
+ }
+ }
+ return TRUE;
+}
+
+
+/*
+ * Allocate a DIB for the shadow framebuffer GDI server
+ */
+
+Bool
+winAllocateFBShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ BITMAPINFOHEADER *pbmih = NULL;
+ DIBSECTION dibsection;
+ Bool fReturn = TRUE;
+
+ /* Get device contexts for the screen and shadow bitmap */
+ pScreenPriv->hdcScreen = GetDC (pScreenPriv->hwndScreen);
+ pScreenPriv->hdcShadow = CreateCompatibleDC (pScreenPriv->hdcScreen);
+
+ /* Allocate bitmap info header */
+ pbmih = (BITMAPINFOHEADER*) malloc (sizeof (BITMAPINFOHEADER)
+ + 256 * sizeof (RGBQUAD));
+ if (pbmih == NULL)
+ {
+ ErrorF ("winAllocateFBShadowGDI - malloc () failed\n");
+ return FALSE;
+ }
+
+ /* Query the screen format */
+ fReturn = winQueryScreenDIBFormat (pScreen, pbmih);
+
+ /* Describe shadow bitmap to be created */
+ pbmih->biWidth = pScreenInfo->dwWidth;
+ pbmih->biHeight = -pScreenInfo->dwHeight;
+
+ ErrorF ("winAllocateFBShadowGDI - Creating DIB with width: %d height: %d "
+ "depth: %d\n",
+ pbmih->biWidth, -pbmih->biHeight, pbmih->biBitCount);
+
+ /* Create a DI shadow bitmap with a bit pointer */
+ pScreenPriv->hbmpShadow = CreateDIBSection (pScreenPriv->hdcScreen,
+ (BITMAPINFO *) pbmih,
+ DIB_RGB_COLORS,
+ (VOID**) &pScreenInfo->pfb,
+ NULL,
+ 0);
+ if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL)
+ {
+ ErrorF ("winAllocateFBShadowGDI - CreateDIBSection failed\n");
+ return FALSE;
+ }
+ else
+ {
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowGDI - Shadow buffer allocated\n");
+#endif
+ }
+
+ /* Get information about the bitmap that was allocated */
+ GetObject (pScreenPriv->hbmpShadow,
+ sizeof (dibsection),
+ &dibsection);
+
+#if CYGDEBUG || YES
+ /* Print information about bitmap allocated */
+ ErrorF ("winAllocateFBShadowGDI - Dibsection width: %d height: %d "
+ "depth: %d size image: %d\n",
+ dibsection.dsBmih.biWidth, dibsection.dsBmih.biHeight,
+ dibsection.dsBmih.biBitCount,
+ dibsection.dsBmih.biSizeImage);
+#endif
+
+ /* Select the shadow bitmap into the shadow DC */
+ SelectObject (pScreenPriv->hdcShadow,
+ pScreenPriv->hbmpShadow);
+
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowGDI - Attempting a shadow blit\n");
+#endif
+
+ /* Do a test blit from the shadow to the screen, I think */
+ fReturn = BitBlt (pScreenPriv->hdcScreen,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+ if (fReturn)
+ {
+#if CYGDEBUG
+ ErrorF ("winAllocateFBShadowGDI - Shadow blit success\n");
+#endif
+ }
+ else
+ {
+ ErrorF ("winAllocateFBShadowGDI - Shadow blit failure\n");
+ return FALSE;
+ }
+
+ /* Set screeninfo stride */
+ pScreenInfo->dwStride = ((dibsection.dsBmih.biSizeImage
+ / dibsection.dsBmih.biHeight)
+ * 8) / pScreenInfo->dwBPP;
+
+#if CYGDEBUG || YES
+ ErrorF ("winAllocateFBShadowGDI - Created shadow stride: %d\n",
+ pScreenInfo->dwStride);
+#endif
+
+ /* See if the shadow bitmap will be larger than the DIB size limit */
+ if (pScreenInfo->dwWidth * pScreenInfo->dwHeight * pScreenInfo->dwBPP
+ >= WIN_DIB_MAXIMUM_SIZE)
+ {
+ ErrorF ("winAllocateFBShadowGDI - Requested DIB (bitmap) "
+ "will be larger than %d MB. The surface may fail to be "
+ "allocated on Windows 95, 98, or Me, due to a %d MB limit in "
+ "DIB size. This limit does not apply to Windows NT/2000, and "
+ "this message may be ignored on those platforms.\n",
+ WIN_DIB_MAXIMUM_SIZE_MB, WIN_DIB_MAXIMUM_SIZE_MB);
+ }
+
+ /* Determine our color masks */
+ if (!winQueryRGBBitsAndMasks (pScreen))
+ {
+ ErrorF ("winAllocateFBShadowGDI - winQueryRGBBitsAndMasks failed\n");
+ return FALSE;
+ }
+
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
+
+ return fReturn;
+}
+
+
+/*
+ * Blit the damaged regions of the shadow fb to the screen
+ */
+
+void
+winShadowUpdateGDI (ScreenPtr pScreen,
+ shadowBufPtr pBuf)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ RegionPtr damage = &pBuf->damage;
+ DWORD dwBox = REGION_NUM_RECTS (damage);
+ BoxPtr pBox = REGION_RECTS (damage);
+ int x, y, w, h;
+ HRGN hrgnTemp = NULL, hrgnCombined = NULL;
+#if WIN_UPDATE_STATS
+ static DWORD s_dwNonUnitRegions = 0;
+ static DWORD s_dwTotalUpdates = 0;
+ static DWORD s_dwTotalBoxes = 0;
+#endif
+
+ /*
+ * Return immediately if the app is not active
+ * and we are fullscreen, or if we have a bad display depth
+ */
+ if ((!pScreenPriv->fActive && pScreenInfo->fFullScreen)
+ || pScreenPriv->fBadDepth) return;
+
+#if WIN_UPDATE_STATS
+ ++s_dwTotalUpdates;
+ s_dwTotalBoxes += dwBox;
+
+ if (dwBox != 1)
+ {
+ ++s_dwNonUnitRegions;
+ ErrorF ("winShadowUpdatGDI - dwBox: %d\n", dwBox);
+ }
+
+ if ((s_dwTotalUpdates % 100) == 0)
+ ErrorF ("winShadowUpdateGDI - %d%% non-unity regions, avg boxes: %d "
+ "nu: %d tu: %d\n",
+ (s_dwNonUnitRegions * 100) / s_dwTotalUpdates,
+ s_dwTotalBoxes / s_dwTotalUpdates,
+ s_dwNonUnitRegions, s_dwTotalUpdates);
+#endif /* WIN_UPDATE_STATS */
+
+ /*
+ * Handle small regions with multiple blits,
+ * handle large regions by creating a clipping region and
+ * doing a single blit constrained to that clipping region.
+ */
+ if (pScreenInfo->dwClipUpdatesNBoxes == 0
+ || dwBox < pScreenInfo->dwClipUpdatesNBoxes)
+ {
+ /* Loop through all boxes in the damaged region */
+ while (dwBox--)
+ {
+ /*
+ * Calculate x offset, y offset, width, and height for
+ * current damage box
+ */
+ x = pBox->x1;
+ y = pBox->y1;
+ w = pBox->x2 - pBox->x1;
+ h = pBox->y2 - pBox->y1;
+
+ BitBlt (pScreenPriv->hdcScreen,
+ x, y,
+ w, h,
+ pScreenPriv->hdcShadow,
+ x, y,
+ SRCCOPY);
+
+ /* Get a pointer to the next box */
+ ++pBox;
+ }
+ }
+ else
+ {
+ BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
+
+ /* Compute a GDI region from the damaged region */
+ hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ dwBox--;
+ pBox++;
+ while (dwBox--)
+ {
+ hrgnTemp = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
+ CombineRgn (hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR);
+ DeleteObject (hrgnTemp);
+ pBox++;
+ }
+
+ /* Install the GDI region as a clipping region */
+ SelectClipRgn (pScreenPriv->hdcScreen, hrgnCombined);
+ DeleteObject (hrgnCombined);
+ hrgnCombined = NULL;
+
+ /*
+ * Blit the shadow buffer to the screen,
+ * constrained to the clipping region.
+ */
+ BitBlt (pScreenPriv->hdcScreen,
+ pBoxExtents->x1, pBoxExtents->y1,
+ pBoxExtents->x2 - pBoxExtents->x1,
+ pBoxExtents->y2 - pBoxExtents->y1,
+ pScreenPriv->hdcShadow,
+ pBoxExtents->x1, pBoxExtents->y1,
+ SRCCOPY);
+
+ /* Reset the clip region */
+ SelectClipRgn (pScreenPriv->hdcScreen, NULL);
+ }
+
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
+}
+
+
+/* See Porting Layer Definition - p. 33 */
+/*
+ * We wrap whatever CloseScreen procedure was specified by fb;
+ * a pointer to said procedure is stored in our privates.
+ */
+
+Bool
+winCloseScreenShadowGDI (int nIndex, ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ Bool fReturn;
+
+#if CYGDEBUG
+ ErrorF ("winCloseScreenShadowGDI - Freeing screen resources\n");
+#endif
+
+ /* Flag that the screen is closed */
+ pScreenPriv->fClosed = TRUE;
+ pScreenPriv->fActive = FALSE;
+
+ /* Call the wrapped CloseScreen procedure */
+ pScreen->CloseScreen = pScreenPriv->CloseScreen;
+ fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+
+ /* Delete the window property */
+ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP);
+
+ /* Free the shadow DC; which allows the bitmap to be freed */
+ DeleteDC (pScreenPriv->hdcShadow);
+
+ /* Free the shadow bitmap */
+ DeleteObject (pScreenPriv->hbmpShadow);
+
+ /* Free the screen DC */
+ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen);
+
+ /* Kill our window */
+ if (pScreenPriv->hwndScreen)
+ {
+ DestroyWindow (pScreenPriv->hwndScreen);
+ pScreenPriv->hwndScreen = NULL;
+ }
+
+ /* Destroy the thread startup mutex */
+ pthread_mutex_destroy (&pScreenPriv->pmServerStarted);
+
+ /* Invalidate our screeninfo's pointer to the screen */
+ pScreenInfo->pScreen = NULL;
+
+ /* Invalidate the ScreenInfo's fb pointer */
+ pScreenInfo->pfb = NULL;
+
+ /* Free the screen privates for this screen */
+ free ((pointer) pScreenPriv);
+
+ return fReturn;
+}
+
+
+/*
+ * Tell mi what sort of visuals we need.
+ *
+ * Generally we only need one visual, as our screen can only
+ * handle one format at a time, I believe. You may want
+ * to verify that last sentence.
+ */
+
+Bool
+winInitVisualsShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Display debugging information */
+ ErrorF ("winInitVisualsShadowGDI - Masks %08x %08x %08x BPRGB %d d %d "
+ "bpp %d\n",
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenInfo->dwDepth,
+ pScreenInfo->dwBPP);
+
+ /* Create a single visual according to the Windows screen depth */
+ switch (pScreenInfo->dwDepth)
+ {
+ case 24:
+ case 16:
+ case 15:
+#if defined(XFree86Server)
+ /* Setup the real visual */
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ -1,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+
+#if WIN_EMULATE_PSEUDO_SUPPORT
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!miSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ -1,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+#else /* XFree86Server */
+ /* Setup the real visual */
+ if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ TrueColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
+ "failed for TrueColor\n");
+ return FALSE;
+ }
+
+#if WIN_EMULATE_PSEUDO_SUPPORT
+ if (!pScreenInfo->fEmulatePseudo)
+ break;
+
+ /* Setup a pseudocolor visual */
+ if (!fbSetVisualTypesAndMasks (8,
+ PseudoColorMask,
+ 8,
+ 0,
+ 0,
+ 0))
+ {
+ ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
+ "failed for PseudoColor\n");
+ return FALSE;
+ }
+#endif
+#endif /* XFree86Server */
+ break;
+
+ case 8:
+#if defined(XFree86Server)
+ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ PseudoColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ PseudoColor,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowGDI - miSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+#else /* XFree86Server */
+ if (!fbSetVisualTypesAndMasks (pScreenInfo->dwDepth,
+ PseudoColorMask,
+ pScreenPriv->dwBitsPerRGB,
+ pScreenPriv->dwRedMask,
+ pScreenPriv->dwGreenMask,
+ pScreenPriv->dwBlueMask))
+ {
+ ErrorF ("winInitVisualsShadowGDI - fbSetVisualTypesAndMasks "
+ "failed\n");
+ return FALSE;
+ }
+#endif
+ break;
+
+ default:
+ ErrorF ("winInitVisualsShadowGDI - Unknown screen depth\n");
+ return FALSE;
+ }
+
+#if CYGDEBUG
+ ErrorF ("winInitVisualsShadowGDI - Returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Adjust the proposed video mode
+ */
+
+Bool
+winAdjustVideoModeShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ HDC hdc;
+ DWORD dwBPP;
+
+ hdc = GetDC (NULL);
+
+ /* We're in serious trouble if we can't get a DC */
+ if (hdc == NULL)
+ {
+ ErrorF ("winAdjustVideoModeShadowGDI - GetDC () failed\n");
+ return FALSE;
+ }
+
+ /* Query GDI for current display depth */
+ dwBPP = GetDeviceCaps (hdc, BITSPIXEL);
+
+ /* GDI cannot change the screen depth */
+ if (pScreenInfo->dwBPP == WIN_DEFAULT_BPP)
+ {
+ /* No -depth parameter passed, let the user know the depth being used */
+ ErrorF ("winAdjustVideoModeShadowGDI - Using Windows display "
+ "depth of %d bits per pixel\n", dwBPP);
+
+ /* Use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+ else if (dwBPP != pScreenInfo->dwBPP)
+ {
+ /* Warn user if GDI depth is different than -depth parameter */
+ ErrorF ("winAdjustVideoModeShadowGDI - Command line bpp: %d, "\
+ "using bpp: %d\n", pScreenInfo->dwBPP, dwBPP);
+
+ /* We'll use GDI's depth */
+ pScreenInfo->dwBPP = dwBPP;
+ }
+
+ /* Release our DC */
+ ReleaseDC (NULL, hdc);
+ hdc = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Blt exposed regions to the screen
+ */
+
+Bool
+winBltExposedRegionsShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ winPrivCmapPtr pCmapPriv = NULL;
+ HDC hdcUpdate;
+ PAINTSTRUCT ps;
+
+ /* BeginPaint gives us an hdc that clips to the invalidated region */
+ hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps);
+
+ /* Realize the palette, if we have one */
+ if (pScreenPriv->pcmapInstalled != NULL)
+ {
+ pCmapPriv = winGetCmapPriv (pScreenPriv->pcmapInstalled);
+
+ SelectPalette (hdcUpdate, pCmapPriv->hPalette, FALSE);
+ RealizePalette (hdcUpdate);
+ }
+
+ /* Our BitBlt will be clipped to the invalidated region */
+ BitBlt (hdcUpdate,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+
+ /* EndPaint frees the DC */
+ EndPaint (pScreenPriv->hwndScreen, &ps);
+
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
+
+ return TRUE;
+}
+
+
+/*
+ * Do any engine-specific appliation-activation processing
+ */
+
+Bool
+winActivateAppShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+#if CYGDEBUG
+ ErrorF ("winActivateAppShadowGDI\n");
+#endif
+
+ /*
+ * Are we active?
+ * Are we fullscreen?
+ */
+ if (pScreenPriv->fActive
+ && pScreenInfo->fFullScreen)
+ {
+ /*
+ * Activating, attempt to bring our window
+ * to the top of the display
+ */
+ ShowWindow (pScreenPriv->hwndScreen, SW_RESTORE);
+ }
+ else if (!pScreenPriv->fActive
+ && pScreenInfo->fFullScreen)
+ {
+ /*
+ * Deactivating, stuff our window onto the
+ * task bar.
+ */
+ ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE);
+ }
+
+#if CYGDEBUG
+ ErrorF ("winActivateAppShadowGDI - Returning\n");
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Reblit the shadow framebuffer to the screen.
+ */
+
+Bool
+winRedrawScreenShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Redraw the whole window, to take account for the new colors */
+ BitBlt (pScreenPriv->hdcScreen,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
+ return TRUE;
+}
+
+
+/*
+ * Realize the currently installed colormap
+ */
+
+Bool
+winRealizeInstalledPaletteShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winPrivCmapPtr pCmapPriv = NULL;
+
+#if CYGDEBUG
+ ErrorF ("winRealizeInstalledPaletteShadowGDI\n");
+#endif
+
+ /* Don't do anything if there is not a colormap */
+ if (pScreenPriv->pcmapInstalled == NULL)
+ {
+#if CYGDEBUG
+ ErrorF ("winRealizeInstalledPaletteShadowGDI - No colormap "
+ "installed\n");
+#endif
+ return TRUE;
+ }
+
+ pCmapPriv = winGetCmapPriv (pScreenPriv->pcmapInstalled);
+
+ /* Realize our palette for the screen */
+ if (RealizePalette (pScreenPriv->hdcScreen) == GDI_ERROR)
+ {
+ ErrorF ("winRealizeInstalledPaletteShadowGDI - RealizePalette () "
+ "failed\n");
+ return FALSE;
+ }
+
+ /* Set the DIB color table */
+ if (SetDIBColorTable (pScreenPriv->hdcShadow,
+ 0,
+ WIN_NUM_PALETTE_ENTRIES,
+ pCmapPriv->rgbColors) == 0)
+ {
+ ErrorF ("winRealizeInstalledPaletteShadowGDI - SetDIBColorTable () "
+ "failed\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Install the specified colormap
+ */
+
+Bool
+winInstallColormapShadowGDI (ColormapPtr pColormap)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+ winCmapPriv(pColormap);
+
+ /*
+ * Tell Windows to install the new colormap
+ */
+ if (SelectPalette (pScreenPriv->hdcScreen,
+ pCmapPriv->hPalette,
+ FALSE) == NULL)
+ {
+ ErrorF ("winInstallColormapShadowGDI - SelectPalette () failed\n");
+ return FALSE;
+ }
+
+ /* Realize the palette */
+ if (GDI_ERROR == RealizePalette (pScreenPriv->hdcScreen))
+ {
+ ErrorF ("winInstallColormapShadowGDI - RealizePalette () failed\n");
+ return FALSE;
+ }
+
+ /* Set the DIB color table */
+ if (SetDIBColorTable (pScreenPriv->hdcShadow,
+ 0,
+ WIN_NUM_PALETTE_ENTRIES,
+ pCmapPriv->rgbColors) == 0)
+ {
+ ErrorF ("winInstallColormapShadowGDI - SetDIBColorTable () failed\n");
+ return FALSE;
+ }
+
+ /* Redraw the whole window, to take account for the new colors */
+ BitBlt (pScreenPriv->hdcScreen,
+ 0, 0,
+ pScreenInfo->dwWidth, pScreenInfo->dwHeight,
+ pScreenPriv->hdcShadow,
+ 0, 0,
+ SRCCOPY);
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+
+ /* Redraw all windows */
+ if (pScreenInfo->fMultiWindow) EnumWindows(winRedrawAllProcShadowGDI, 0);
+
+ return TRUE;
+}
+
+
+/*
+ * Store the specified colors in the specified colormap
+ */
+
+Bool
+winStoreColorsShadowGDI (ColormapPtr pColormap,
+ int ndef,
+ xColorItem *pdefs)
+{
+ ScreenPtr pScreen = pColormap->pScreen;
+ winScreenPriv(pScreen);
+ winCmapPriv(pColormap);
+ ColormapPtr curpmap = pScreenPriv->pcmapInstalled;
+
+ /* Put the X colormap entries into the Windows logical palette */
+ if (SetPaletteEntries (pCmapPriv->hPalette,
+ pdefs[0].pixel,
+ ndef,
+ pCmapPriv->peColors + pdefs[0].pixel) == 0)
+ {
+ ErrorF ("winStoreColorsShadowGDI - SetPaletteEntries () failed\n");
+ return FALSE;
+ }
+
+ /* Don't install the Windows palette if the colormap is not installed */
+ if (pColormap != curpmap)
+ {
+ return TRUE;
+ }
+
+ /* Try to install the newly modified colormap */
+ if (!winInstallColormapShadowGDI (pColormap))
+ {
+ ErrorF ("winInstallColormapShadowGDI - winInstallColormapShadowGDI "
+ "failed\n");
+ return FALSE;
+ }
+
+#if 0
+ /* Tell Windows that the palette has changed */
+ RealizePalette (pScreenPriv->hdcScreen);
+
+ /* Set the DIB color table */
+ if (SetDIBColorTable (pScreenPriv->hdcShadow,
+ pdefs[0].pixel,
+ ndef,
+ pCmapPriv->rgbColors + pdefs[0].pixel) == 0)
+ {
+ ErrorF ("winInstallColormapShadowGDI - SetDIBColorTable () failed\n");
+ return FALSE;
+ }
+
+ /* Save a pointer to the newly installed colormap */
+ pScreenPriv->pcmapInstalled = pColormap;
+#endif
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap initialization procedure
+ */
+
+Bool
+winCreateColormapShadowGDI (ColormapPtr pColormap)
+{
+ LPLOGPALETTE lpPaletteNew = NULL;
+ DWORD dwEntriesMax;
+ VisualPtr pVisual;
+ HPALETTE hpalNew = NULL;
+ winCmapPriv(pColormap);
+
+ /* Get a pointer to the visual that the colormap belongs to */
+ pVisual = pColormap->pVisual;
+
+ /* Get the maximum number of palette entries for this visual */
+ dwEntriesMax = pVisual->ColormapEntries;
+
+ /* Allocate a Windows logical color palette with max entries */
+ lpPaletteNew = malloc (sizeof (LOGPALETTE)
+ + (dwEntriesMax - 1) * sizeof (PALETTEENTRY));
+ if (lpPaletteNew == NULL)
+ {
+ ErrorF ("winCreateColormapShadowGDI - Couldn't allocate palette "
+ "with %d entries\n",
+ dwEntriesMax);
+ return FALSE;
+ }
+
+ /* Zero out the colormap */
+ ZeroMemory (lpPaletteNew, sizeof (LOGPALETTE)
+ + (dwEntriesMax - 1) * sizeof (PALETTEENTRY));
+
+ /* Set the logical palette structure */
+ lpPaletteNew->palVersion = 0x0300;
+ lpPaletteNew->palNumEntries = dwEntriesMax;
+
+ /* Tell Windows to create the palette */
+ hpalNew = CreatePalette (lpPaletteNew);
+ if (hpalNew == NULL)
+ {
+ ErrorF ("winCreateColormapShadowGDI - CreatePalette () failed\n");
+ free (lpPaletteNew);
+ return FALSE;
+ }
+
+ /* Save the Windows logical palette handle in the X colormaps' privates */
+ pCmapPriv->hPalette = hpalNew;
+
+ /* Free the palette initialization memory */
+ free (lpPaletteNew);
+
+ return TRUE;
+}
+
+
+/*
+ * Colormap destruction procedure
+ */
+
+Bool
+winDestroyColormapShadowGDI (ColormapPtr pColormap)
+{
+ winScreenPriv(pColormap->pScreen);
+ winCmapPriv(pColormap);
+
+ /*
+ * Is colormap to be destroyed the default?
+ *
+ * Non-default colormaps should have had winUninstallColormap
+ * called on them before we get here. The default colormap
+ * will not have had winUninstallColormap called on it. Thus,
+ * we need to handle the default colormap in a special way.
+ */
+ if (pColormap->flags & IsDefault)
+ {
+#if CYGDEBUG
+ ErrorF ("winDestroyColormapShadowGDI - Destroying default "
+ "colormap\n");
+#endif
+
+ /*
+ * FIXME: Walk the list of all screens, popping the default
+ * palette out of each screen device context.
+ */
+
+ /* Pop the palette out of the device context */
+ SelectPalette (pScreenPriv->hdcScreen,
+ GetStockObject (DEFAULT_PALETTE),
+ FALSE);
+
+ /* Clear our private installed colormap pointer */
+ pScreenPriv->pcmapInstalled = NULL;
+ }
+
+ /* Try to delete the logical palette */
+ if (DeleteObject (pCmapPriv->hPalette) == 0)
+ {
+ ErrorF ("winDestroyColormap - DeleteObject () failed\n");
+ return FALSE;
+ }
+
+ /* Invalidate the colormap privates */
+ pCmapPriv->hPalette = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Set engine specific funtions
+ */
+
+Bool
+winSetEngineFunctionsShadowGDI (ScreenPtr pScreen)
+{
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Set our pointers */
+ pScreenPriv->pwinAllocateFB = winAllocateFBShadowGDI;
+ pScreenPriv->pwinShadowUpdate = winShadowUpdateGDI;
+ pScreenPriv->pwinCloseScreen = winCloseScreenShadowGDI;
+ pScreenPriv->pwinInitVisuals = winInitVisualsShadowGDI;
+ pScreenPriv->pwinAdjustVideoMode = winAdjustVideoModeShadowGDI;
+ if (pScreenInfo->fFullScreen)
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowFullScreen;
+ else
+ pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed;
+ pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB;
+ pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowGDI;
+ pScreenPriv->pwinActivateApp = winActivateAppShadowGDI;
+ pScreenPriv->pwinRedrawScreen = winRedrawScreenShadowGDI;
+ pScreenPriv->pwinRealizeInstalledPalette =
+ winRealizeInstalledPaletteShadowGDI;
+ pScreenPriv->pwinInstallColormap = winInstallColormapShadowGDI;
+ pScreenPriv->pwinStoreColors = winStoreColorsShadowGDI;
+ pScreenPriv->pwinCreateColormap = winCreateColormapShadowGDI;
+ pScreenPriv->pwinDestroyColormap = winDestroyColormapShadowGDI;
+ pScreenPriv->pwinHotKeyAltTab = (winHotKeyAltTabProcPtr) (void (*)())NoopDDA;
+ pScreenPriv->pwinCreatePrimarySurface
+ = (winCreatePrimarySurfaceProcPtr) (void (*)())NoopDDA;
+ pScreenPriv->pwinReleasePrimarySurface
+ = (winReleasePrimarySurfaceProcPtr) (void (*)())NoopDDA;
+
+ return TRUE;
+}
diff --git a/hw/xwin/winwakeup.c b/hw/xwin/winwakeup.c
new file mode 100644
index 000000000..37e062fa6
--- /dev/null
+++ b/hw/xwin/winwakeup.c
@@ -0,0 +1,57 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwakeup.c,v 1.6 2002/10/17 08:18:25 alanh Exp $ */
+
+#include "win.h"
+
+/* See Porting Layer Definition - p. 7 */
+void
+winWakeupHandler (int nScreen,
+ pointer pWakeupData,
+ unsigned long ulResult,
+ pointer pReadmask)
+{
+ winScreenPriv((ScreenPtr)pWakeupData);
+ MSG msg;
+
+ /* Process all messages on our queue */
+ while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
+ {
+ if (g_hDlgDepthChange == 0 || !IsDialogMessage (g_hDlgDepthChange, &msg))
+ {
+ DispatchMessage (&msg);
+ }
+ }
+}
+
+
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
new file mode 100644
index 000000000..b2469c30a
--- /dev/null
+++ b/hw/xwin/winwindow.c
@@ -0,0 +1,463 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Harold L Hunt II
+ * Kensuke Matsuzaki
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwindow.c,v 1.6 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+
+/*
+ * Prototypes for local functions
+ */
+
+static int
+winAddRgn (WindowPtr pWindow, pointer data);
+
+static
+void
+winUpdateRgn (WindowPtr pWindow);
+
+#ifdef SHAPE
+static
+void
+winReshape (WindowPtr pWin);
+#endif
+
+
+/* See Porting Layer Definition - p. 37 */
+/* See mfb/mfbwindow.c - mfbCreateWindow() */
+
+Bool
+winCreateWindowNativeGDI (WindowPtr pWin)
+{
+ ErrorF ("winCreateWindowNativeGDI ()\n");
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 37 */
+/* See mfb/mfbwindow.c - mfbDestroyWindow() */
+
+Bool
+winDestroyWindowNativeGDI (WindowPtr pWin)
+{
+ ErrorF ("winDestroyWindowNativeGDI ()\n");
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 37 */
+/* See mfb/mfbwindow.c - mfbPositionWindow() */
+
+Bool
+winPositionWindowNativeGDI (WindowPtr pWin, int x, int y)
+{
+ ErrorF ("winPositionWindowNativeGDI ()\n");
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 39 */
+/* See mfb/mfbwindow.c - mfbCopyWindow() */
+
+void
+winCopyWindowNativeGDI (WindowPtr pWin,
+ DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc)
+{
+ ErrorF ("winCopyWindowNativeGDI ()\n");
+}
+
+
+/* See Porting Layer Definition - p. 37 */
+/* See mfb/mfbwindow.c - mfbChangeWindowAttributes() */
+
+Bool
+winChangeWindowAttributesNativeGDI (WindowPtr pWin, unsigned long mask)
+{
+ ErrorF ("winChangeWindowAttributesNativeGDI ()\n");
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 37
+ * Also referred to as UnrealizeWindow
+ */
+
+Bool
+winUnmapWindowNativeGDI (WindowPtr pWindow)
+{
+ ErrorF ("winUnmapWindowNativeGDI ()\n");
+ /* This functions is empty in the CFB,
+ * we probably won't need to do anything
+ */
+ return TRUE;
+}
+
+
+/* See Porting Layer Definition - p. 37
+ * Also referred to as RealizeWindow
+ */
+
+Bool
+winMapWindowNativeGDI (WindowPtr pWindow)
+{
+ ErrorF ("winMapWindowNativeGDI ()\n");
+ /* This function is empty in the CFB,
+ * we probably won't need to do anything
+ */
+ return TRUE;
+
+}
+
+
+/* See Porting Layer Definition - p. 37 */
+/* See mfb/mfbwindow.c - mfbCreateWindow() */
+
+Bool
+winCreateWindowPRootless (WindowPtr pWin)
+{
+ Bool fResult = FALSE;
+ winWindowPriv(pWin);
+
+#if CYGDEBUG
+ ErrorF ("winCreateWindowPRootless ()\n");
+#endif
+
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->CreateWindow(pWin);
+
+ pWinPriv->hRgn = NULL;
+ /*winUpdateRgn (pWin);*/
+
+ return fResult;
+}
+
+
+/* See Porting Layer Definition - p. 37 */
+/* See mfb/mfbwindow.c - mfbDestroyWindow() */
+
+Bool
+winDestroyWindowPRootless (WindowPtr pWin)
+{
+ Bool fResult = FALSE;
+ winWindowPriv(pWin);
+
+#if CYGDEBUG
+ ErrorF ("winDestroyWindowPRootless ()\n");
+#endif
+
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->DestroyWindow(pWin);
+
+ if (pWinPriv->hRgn != NULL)
+ {
+ DeleteObject(pWinPriv->hRgn);
+ pWinPriv->hRgn = NULL;
+ }
+
+ winUpdateRgn (pWin);
+
+ return fResult;
+}
+
+
+/* See Porting Layer Definition - p. 37 */
+/* See mfb/mfbwindow.c - mfbPositionWindow() */
+
+Bool
+winPositionWindowPRootless (WindowPtr pWin, int x, int y)
+{
+ Bool fResult = FALSE;
+
+#if CYGDEBUG
+ ErrorF ("winPositionWindowPRootless ()\n");
+#endif
+
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->PositionWindow(pWin, x, y);
+
+ winUpdateRgn (pWin);
+
+ return fResult;
+}
+
+
+/* See Porting Layer Definition - p. 37 */
+/* See mfb/mfbwindow.c - mfbChangeWindowAttributes() */
+
+Bool
+winChangeWindowAttributesPRootless (WindowPtr pWin, unsigned long mask)
+{
+ Bool fResult = FALSE;
+
+#if CYGDEBUG
+ ErrorF ("winChangeWindowAttributesPRootless ()\n");
+#endif
+
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->ChangeWindowAttributes(pWin, mask);
+
+ winUpdateRgn (pWin);
+
+ return fResult;
+}
+
+
+/* See Porting Layer Definition - p. 37
+ * Also referred to as UnrealizeWindow
+ */
+
+Bool
+winUnmapWindowPRootless (WindowPtr pWin)
+{
+ Bool fResult = FALSE;
+ winWindowPriv(pWin);
+
+#if CYGDEBUG
+ ErrorF ("winUnmapWindowPRootless ()\n");
+#endif
+
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->UnrealizeWindow(pWin);
+
+ if (pWinPriv->hRgn != NULL)
+ {
+ DeleteObject(pWinPriv->hRgn);
+ pWinPriv->hRgn = NULL;
+ }
+
+ winUpdateRgn (pWin);
+
+ return fResult;
+}
+
+
+/* See Porting Layer Definition - p. 37
+ * Also referred to as RealizeWindow
+ */
+
+Bool
+winMapWindowPRootless (WindowPtr pWin)
+{
+ Bool fResult = FALSE;
+
+#if CYGDEBUG
+ ErrorF ("winMapWindowPRootless ()\n");
+#endif
+
+ fResult = winGetScreenPriv(pWin->drawable.pScreen)->RealizeWindow(pWin);
+
+ winReshape (pWin);
+
+ winUpdateRgn (pWin);
+
+ return fResult;
+}
+
+
+#ifdef SHAPE
+void
+winSetShapePRootless (WindowPtr pWin)
+{
+#if CYGDEBUG
+ ErrorF ("winSetShapePRootless ()\n");
+#endif
+
+ winGetScreenPriv(pWin->drawable.pScreen)->SetShape(pWin);
+
+ winReshape (pWin);
+ winUpdateRgn (pWin);
+
+ return;
+}
+#endif
+
+
+/*
+ * Local function for adding a region to the Windows window region
+ */
+
+static
+int
+winAddRgn (WindowPtr pWin, pointer data)
+{
+ int iX, iY, iWidth, iHeight, iBorder;
+ HRGN hRgn = *(HRGN*)data;
+ HRGN hRgnWin;
+ winWindowPriv(pWin);
+
+ /* If pWin is not Root */
+ if (pWin->parent != NULL)
+ {
+#if CYGDEBUG
+ ErrorF ("winAddRgn ()\n");
+#endif
+ if (pWin->mapped)
+ {
+ iBorder = wBorderWidth (pWin);
+
+ iX = pWin->drawable.x - iBorder;
+ iY = pWin->drawable.y - iBorder;
+
+ iWidth = pWin->drawable.width + iBorder * 2;
+ iHeight = pWin->drawable.height + iBorder * 2;
+
+ hRgnWin = CreateRectRgn (0, 0, iWidth, iHeight);
+
+ if (hRgnWin == NULL)
+ {
+ ErrorF ("winAddRgn - CreateRectRgn () failed\n");
+ ErrorF (" Rect %d %d %d %d\n",
+ iX, iY, iX + iWidth, iY + iHeight);
+ }
+
+ if (pWinPriv->hRgn)
+ {
+ if (CombineRgn (hRgnWin, hRgnWin, pWinPriv->hRgn, RGN_AND)
+ == ERROR)
+ {
+ ErrorF ("winAddRgn - CombineRgn () failed\n");
+ }
+ }
+
+ OffsetRgn (hRgnWin, iX, iY);
+
+ if (CombineRgn (hRgn, hRgn, hRgnWin, RGN_OR) == ERROR)
+ {
+ ErrorF ("winAddRgn - CombineRgn () failed\n");
+ }
+
+ DeleteObject (hRgnWin);
+ }
+ return WT_DONTWALKCHILDREN;
+ }
+ else
+ {
+ return WT_WALKCHILDREN;
+ }
+}
+
+
+/*
+ * Local function to update the Windows window's region
+ */
+
+static
+void
+winUpdateRgn (WindowPtr pWin)
+{
+ HRGN hRgn = CreateRectRgn (0, 0, 0, 0);
+
+ if (hRgn != NULL)
+ {
+ WalkTree (pWin->drawable.pScreen, winAddRgn, &hRgn);
+ SetWindowRgn (winGetScreenPriv(pWin->drawable.pScreen)->hwndScreen,
+ hRgn, TRUE);
+ }
+ else
+ {
+ ErrorF ("winUpdateRgn - CreateRectRgn failed.\n");
+ }
+}
+
+
+#ifdef SHAPE
+static
+void
+winReshape (WindowPtr pWin)
+{
+ int nRects;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ RegionRec rrNewShape;
+ BoxPtr pShape, pRects, pEnd;
+ HRGN hRgn, hRgnRect;
+ winWindowPriv(pWin);
+
+#if CYGDEBUG
+ ErrorF ("winReshape ()\n");
+#endif
+
+ /* Bail if the window is the root window */
+ if (pWin->parent == NULL)
+ return;
+
+ /* Bail if the window is not top level */
+ if (pWin->parent->parent != NULL)
+ return;
+
+ /* Free any existing window region stored in the window privates */
+ if (pWinPriv->hRgn != NULL)
+ {
+ DeleteObject (pWinPriv->hRgn);
+ pWinPriv->hRgn = NULL;
+ }
+
+ /* Bail if the window has no bounding region defined */
+ if (!wBoundingShape (pWin))
+ return;
+
+ REGION_INIT(pScreen, &rrNewShape, NullBox, 0);
+ REGION_COPY(pScreen, &rrNewShape, wBoundingShape(pWin));
+ REGION_TRANSLATE(pScreen, &rrNewShape, pWin->borderWidth,
+ pWin->borderWidth);
+
+ nRects = REGION_NUM_RECTS(&rrNewShape);
+ pShape = REGION_RECTS(&rrNewShape);
+
+ if (nRects > 0)
+ {
+ /* Create initial empty Windows region */
+ hRgn = CreateRectRgn (0, 0, 0, 0);
+
+ /* Loop through all rectangles in the X region */
+ for (pRects = pShape, pEnd = pShape + nRects; pRects < pEnd; pRects++)
+ {
+ /* Create a Windows region for the X rectangle */
+ hRgnRect = CreateRectRgn (pRects->x1, pRects->y1,
+ pRects->x2, pRects->y2);
+ if (hRgnRect == NULL)
+ {
+ ErrorF("winReshape - CreateRectRgn() failed\n");
+ }
+
+ /* Merge the Windows region with the accumulated region */
+ if (CombineRgn (hRgn, hRgn, hRgnRect, RGN_OR) == ERROR)
+ {
+ ErrorF("winReshape - CombineRgn() failed\n");
+ }
+
+ /* Delete the temporary Windows region */
+ DeleteObject (hRgnRect);
+ }
+
+ /* Save a handle to the composite region in the window privates */
+ pWinPriv->hRgn = hRgn;
+ }
+
+ REGION_UNINIT(pScreen, &rrNewShape);
+
+ return;
+}
+#endif
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
new file mode 100644
index 000000000..d828b4c70
--- /dev/null
+++ b/hw/xwin/winwindow.h
@@ -0,0 +1,118 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Kensuke Matsuzaki
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwindow.h,v 1.1 2003/02/12 15:01:38 alanh Exp $ */
+
+
+#ifndef _WINWINDOW_H_
+#define _WINWINDOW_H_
+
+#ifndef NO
+#define NO 0
+#endif
+#ifndef YES
+#define YES 1
+#endif
+
+/* Constant strings */
+#define WINDOW_CLASS "cygwin/xfree86 rl"
+#define WINDOW_TITLE "Cygwin/XFree86 rl"
+#define WIN_SCR_PROP "cyg_screen_prop_rl"
+#define WINDOW_CLASS_X "cygwin/xfree86 X rl"
+#define WINDOW_TITLE_X "Cygwin/XFree86 X rl"
+#define WIN_WINDOW_PROP "cyg_window_prop_rl"
+#define WIN_MSG_QUEUE_FNAME "/dev/windows"
+#define WIN_LOG_FNAME "/tmp/XWinrl.log"
+#define WIN_WID_PROP "cyg_wid_prop_rl"
+#define WIN_NEEDMANAGE_PROP "cyg_override_redirect_prop_rl"
+#define CYGMULTIWINDOW_DEBUG NO
+
+typedef struct _winPrivScreenRec *winPrivScreenPtr;
+
+/*
+ * Window privates
+ */
+
+typedef struct
+{
+ DWORD dwDummy;
+ HRGN hRgn;
+ HWND hWnd;
+ winPrivScreenPtr pScreenPriv;
+ int iX;
+ int iY;
+ int iWidth;
+ int iHeight;
+ Bool fXKilled;
+} winPrivWinRec, *winPrivWinPtr;
+
+typedef struct _winWMMessageRec{
+ DWORD dwID;
+ DWORD msg;
+ int iWindow;
+ HWND hwndWindow;
+ int iX, iY;
+ int iWidth, iHeight;
+} winWMMessageRec, *winWMMessagePtr;
+
+/*
+ * winrootlesswm.c
+ */
+#define WM_WM_MOVE (WM_USER + 1)
+#define WM_WM_SIZE (WM_USER + 2)
+#define WM_WM_RAISE (WM_USER + 3)
+#define WM_WM_LOWER (WM_USER + 4)
+#define WM_WM_MAP (WM_USER + 5)
+#define WM_WM_UNMAP (WM_USER + 6)
+#define WM_WM_KILL (WM_USER + 7)
+#define WM_WM_ACTIVATE (WM_USER + 8)
+
+#define WMMSG_MSG 10
+
+
+/*
+ * winmultiwindowwm.c
+ */
+
+void
+winSendMessageToWM (void *pWMInfo, winWMMessagePtr msg);
+
+Bool
+winInitWM (void **ppWMInfo,
+ pthread_t *ptWMProc,
+#if 0
+ pthread_cond_t *ppcServerStarted,
+#endif
+ pthread_mutex_t *ppmServerStarted,
+#if 0
+ Bool *pfServerStarted,
+#endif
+ int dwScreen);
+
+#endif
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
new file mode 100644
index 000000000..6aa29316d
--- /dev/null
+++ b/hw/xwin/winwndproc.c
@@ -0,0 +1,1131 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, 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, 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: Dakshinamurthy Karra
+ * Suhaib M Siddiqi
+ * Peter Busch
+ * Harold L Hunt II
+ * MATSUZAKI Kensuke
+ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winwndproc.c,v 1.24 2003/02/12 15:01:38 alanh Exp $ */
+
+#include "win.h"
+#include <commctrl.h>
+
+BOOL CALLBACK
+winChangeDepthDlgProc (HWND hDialog, UINT message,
+ WPARAM wParam, LPARAM lParam);
+
+
+/*
+ * Called by winWakeupHandler
+ * Processes current Windows message
+ */
+
+LRESULT CALLBACK
+winWindowProc (HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ static winPrivScreenPtr s_pScreenPriv = NULL;
+ static winScreenInfo *s_pScreenInfo = NULL;
+ static ScreenPtr s_pScreen = NULL;
+ static HWND s_hwndLastPrivates = NULL;
+ static HINSTANCE s_hInstance;
+ static Bool s_fCursor = TRUE;
+ static Bool s_fTracking = FALSE;
+ static unsigned long s_ulServerGeneration = 0;
+ int iScanCode;
+ int i;
+
+ /* Watch for server regeneration */
+ if (g_ulServerGeneration != s_ulServerGeneration)
+ {
+ /* Store new server generation */
+ s_ulServerGeneration = g_ulServerGeneration;
+ }
+
+ /* Only retrieve new privates pointers if window handle is null or changed */
+ if ((s_pScreenPriv == NULL || hwnd != s_hwndLastPrivates)
+ && (s_pScreenPriv = GetProp (hwnd, WIN_SCR_PROP)) != NULL)
+ {
+#if CYGDEBUG
+ ErrorF ("winWindowProc - Setting privates handle\n");
+#endif
+ s_pScreenInfo = s_pScreenPriv->pScreenInfo;
+ s_pScreen = s_pScreenInfo->pScreen;
+ s_hwndLastPrivates = hwnd;
+ }
+ else if (s_pScreenPriv == NULL)
+ {
+ /* For safety, handle case that should never happen */
+ s_pScreenInfo = NULL;
+ s_pScreen = NULL;
+ s_hwndLastPrivates = NULL;
+ }
+
+ /* Branch on message type */
+ switch (message)
+ {
+ case WM_CREATE:
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_CREATE\n");
+#endif
+
+ /*
+ * Add a property to our display window that references
+ * this screens' privates.
+ *
+ * This allows the window procedure to refer to the
+ * appropriate window DC and shadow DC for the window that
+ * it is processing. We use this to repaint exposed
+ * areas of our display window.
+ */
+ s_pScreenPriv = ((LPCREATESTRUCT) lParam)->lpCreateParams;
+ s_hInstance = ((LPCREATESTRUCT) lParam)->hInstance;
+ s_pScreenInfo = s_pScreenPriv->pScreenInfo;
+ s_pScreen = s_pScreenInfo->pScreen;
+ s_hwndLastPrivates = hwnd;
+ SetProp (hwnd, WIN_SCR_PROP, s_pScreenPriv);
+
+ /* Store the mode key states so restore doesn't try to restore them */
+ winStoreModeKeyStates (s_pScreen);
+ return 0;
+
+ case WM_DISPLAYCHANGE:
+ /* We cannot handle a display mode change during initialization */
+ if (s_pScreenInfo == NULL)
+ FatalError ("winWindowProc - WM_DISPLAYCHANGE - The display "
+ "mode changed while we were intializing. This is "
+ "very bad and unexpected. Exiting.\n");
+
+ /*
+ * We do not care about display changes with
+ * fullscreen DirectDraw engines, because those engines set
+ * their own mode when they become active.
+ */
+ if (s_pScreenInfo->fFullScreen
+ && (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
+ || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL
+ || s_pScreenInfo->dwEngine == WIN_SERVER_PRIMARY_DD))
+ {
+ /*
+ * Store the new display dimensions and depth.
+ * We do this here for future compatibility in case we
+ * ever allow switching from fullscreen to windowed mode.
+ */
+ s_pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXSCREEN);
+ s_pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYSCREEN);
+ s_pScreenPriv->dwLastWindowsBitsPixel
+ = GetDeviceCaps (s_pScreenPriv->hdcScreen, BITSPIXEL);
+ break;
+ }
+
+ ErrorF ("winWindowProc - WM_DISPLAYCHANGE - orig bpp: %d, last bpp: %d, "
+ "new bpp: %d\n",
+ s_pScreenInfo->dwBPP,
+ s_pScreenPriv->dwLastWindowsBitsPixel,
+ wParam);
+
+ ErrorF ("winWindowProc - WM_DISPLAYCHANGE - new width: %d "
+ "new height: %d\n",
+ LOWORD (lParam), HIWORD (lParam));
+
+ /*
+ * TrueColor --> TrueColor depth changes are disruptive for:
+ * Windowed:
+ * Shadow DirectDraw
+ * Shadow DirectDraw Non-Locking
+ * Primary DirectDraw
+ *
+ * TrueColor --> TrueColor depth changs are non-optimal for:
+ * Windowed:
+ * Shadow GDI
+ *
+ * FullScreen:
+ * Shadow GDI
+ *
+ * TrueColor --> PseudoColor or vice versa are disruptive for:
+ * Windowed:
+ * Shadow DirectDraw
+ * Shadow DirectDraw Non-Locking
+ * Primary DirectDraw
+ * Shadow GDI
+ */
+
+ /*
+ * Check for a disruptive change in depth.
+ * We can only display a message for a disruptive depth change,
+ * we cannot do anything to correct the situation.
+ */
+ if ((s_pScreenInfo->dwBPP != wParam)
+ && (s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DD
+ || s_pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL
+ || s_pScreenInfo->dwEngine == WIN_SERVER_PRIMARY_DD))
+ {
+ /* Cannot display the visual until the depth is restored */
+ ErrorF ("winWindowProc - Disruptive change in depth\n");
+
+ /* Check if the dialog box already exists */
+ if (g_hDlgDepthChange != NULL)
+ {
+ ErrorF ("winWindowProc - Dialog box already exists\n");
+
+ /* Dialog box already exists, just display it */
+ ShowWindow (g_hDlgDepthChange, SW_SHOWDEFAULT);
+ }
+ else
+ {
+ /*
+ * Display a notification to the user that the visual
+ * will not be displayed until the Windows display depth
+ * is restored to the original value.
+ */
+ g_hDlgDepthChange = CreateDialogParam (s_hInstance,
+ "DEPTH_CHANGE_BOX",
+ hwnd,
+ winChangeDepthDlgProc,
+ (int) s_pScreenPriv);
+
+ /* Show the dialog box */
+ ShowWindow (g_hDlgDepthChange, SW_SHOW);
+
+ ErrorF ("winWindowProc - DialogBox returned: %d\n",
+ g_hDlgDepthChange);
+ ErrorF ("winWindowProc - GetLastError: %d\n", GetLastError ());
+
+ /* Minimize the display window */
+ ShowWindow (hwnd, SW_MINIMIZE);
+
+ /* Flag that we have an invalid screen depth */
+ s_pScreenPriv->fBadDepth = TRUE;
+
+ /*
+ * TODO: Redisplay the dialog box if it is not
+ * currently displayed.
+ */
+ }
+ }
+ else
+ {
+ /* Flag that we have a valid screen depth */
+ s_pScreenPriv->fBadDepth = FALSE;
+ }
+
+ /*
+ * Check for a change in display dimensions.
+ * We can simply recreate the same-sized primary surface when
+ * the display dimensions change.
+ */
+ if (s_pScreenPriv->dwLastWindowsWidth != LOWORD (lParam)
+ || s_pScreenPriv->dwLastWindowsHeight != HIWORD (lParam))
+ {
+ /*
+ * NOTE: The non-DirectDraw engines set the ReleasePrimarySurface
+ * and CreatePrimarySurface function pointers to point
+ * to the no operation function, NoopDDA. This allows us
+ * to blindly call these functions, even if they are not
+ * relevant to the current engine (e.g., Shadow GDI).
+ */
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Dimensions changed\n");
+#endif
+
+ /* Release the old primary surface */
+ (*s_pScreenPriv->pwinReleasePrimarySurface) (s_pScreen);
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Released "
+ "primary surface\n");
+#endif
+
+ /* Create the new primary surface */
+ (*s_pScreenPriv->pwinCreatePrimarySurface) (s_pScreen);
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Recreated "
+ "primary surface\n");
+#endif
+ }
+ else
+ {
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_DISPLAYCHANGE - Dimensions did not "
+ "change\n");
+#endif
+ }
+
+ /* Store the new display dimensions and depth */
+ s_pScreenPriv->dwLastWindowsWidth = GetSystemMetrics (SM_CXSCREEN);
+ s_pScreenPriv->dwLastWindowsHeight = GetSystemMetrics (SM_CYSCREEN);
+ s_pScreenPriv->dwLastWindowsBitsPixel
+ = GetDeviceCaps (s_pScreenPriv->hdcScreen, BITSPIXEL);
+ break;
+
+ case WM_SIZE:
+ {
+ SCROLLINFO si;
+ RECT rcWindow;
+ int iWidth, iHeight;
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_SIZE\n");
+#endif
+
+ /* Break if we do not use scrollbars */
+ if (!s_pScreenInfo->fScrollbars
+ || !s_pScreenInfo->fDecoration
+ || s_pScreenInfo->fRootless
+ || s_pScreenInfo->fMultiWindow
+ || s_pScreenInfo->fFullScreen)
+ break;
+
+ /* No need to resize if we get minimized */
+ if (wParam == SIZE_MINIMIZED)
+ return 0;
+
+ /*
+ * Get the size of the whole window, including client area,
+ * scrollbars, and non-client area decorations (caption, borders).
+ * We do this because we need to check if the client area
+ * without scrollbars is large enough to display the whole visual.
+ * The new client area size passed by lParam already subtracts
+ * the size of the scrollbars if they are currently displayed.
+ * So checking is LOWORD(lParam) == visual_width and
+ * HIWORD(lParam) == visual_height will never tell us to hide
+ * the scrollbars because the client area would always be too small.
+ * GetClientRect returns the same sizes given by lParam, so we
+ * cannot use GetClientRect either.
+ */
+ GetWindowRect (hwnd, &rcWindow);
+ iWidth = rcWindow.right - rcWindow.left;
+ iHeight = rcWindow.bottom - rcWindow.top;
+
+ ErrorF ("winWindowProc - WM_SIZE - window w: %d h: %d, "
+ "new client area w: %d h: %d\n",
+ iWidth, iHeight, LOWORD (lParam), HIWORD (lParam));
+
+ /* Subtract the frame size from the window size. */
+ iWidth -= 2 * GetSystemMetrics (SM_CXSIZEFRAME);
+ iHeight -= (2 * GetSystemMetrics (SM_CYSIZEFRAME)
+ + GetSystemMetrics (SM_CYCAPTION));
+
+ /*
+ * Update scrollbar page sizes.
+ * NOTE: If page size == range, then the scrollbar is
+ * automatically hidden.
+ */
+
+ /* Is the naked client area large enough to show the whole visual? */
+ if (iWidth < s_pScreenInfo->dwWidth
+ || iHeight < s_pScreenInfo->dwHeight)
+ {
+ /* Client area too small to display visual, use scrollbars */
+ iWidth -= GetSystemMetrics (SM_CXVSCROLL);
+ iHeight -= GetSystemMetrics (SM_CYHSCROLL);
+ }
+
+ /* Set the horizontal scrollbar page size */
+ si.cbSize = sizeof (si);
+ si.fMask = SIF_PAGE | SIF_RANGE;
+ si.nMin = 0;
+ si.nMax = s_pScreenInfo->dwWidth - 1;
+ si.nPage = iWidth;
+ SetScrollInfo (hwnd, SB_HORZ, &si, TRUE);
+
+ /* Set the vertical scrollbar page size */
+ si.cbSize = sizeof (si);
+ si.fMask = SIF_PAGE | SIF_RANGE;
+ si.nMin = 0;
+ si.nMax = s_pScreenInfo->dwHeight - 1;
+ si.nPage = iHeight;
+ SetScrollInfo (hwnd, SB_VERT, &si, TRUE);
+
+ /*
+ * NOTE: Scrollbars may have moved if they were at the
+ * far right/bottom, so we query their current position.
+ */
+
+ /* Get the horizontal scrollbar position and set the offset */
+ si.cbSize = sizeof (si);
+ si.fMask = SIF_POS;
+ GetScrollInfo (hwnd, SB_HORZ, &si);
+ s_pScreenInfo->dwXOffset = -si.nPos;
+
+ /* Get the vertical scrollbar position and set the offset */
+ si.cbSize = sizeof (si);
+ si.fMask = SIF_POS;
+ GetScrollInfo (hwnd, SB_VERT, &si);
+ s_pScreenInfo->dwYOffset = -si.nPos;
+ }
+ return 0;
+
+ case WM_VSCROLL:
+ {
+ SCROLLINFO si;
+ int iVertPos;
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_VSCROLL\n");
+#endif
+
+ /* Get vertical scroll bar info */
+ si.cbSize = sizeof (si);
+ si.fMask = SIF_ALL;
+ GetScrollInfo (hwnd, SB_VERT, &si);
+
+ /* Save the vertical position for comparison later */
+ iVertPos = si.nPos;
+
+ /*
+ * Don't forget:
+ * moving the scrollbar to the DOWN, scroll the content UP
+ */
+ switch (LOWORD(wParam))
+ {
+ case SB_TOP:
+ si.nPos = si.nMin;
+ break;
+
+ case SB_BOTTOM:
+ si.nPos = si.nMax - si.nPage + 1;
+ break;
+
+ case SB_LINEUP:
+ si.nPos -= 1;
+ break;
+
+ case SB_LINEDOWN:
+ si.nPos += 1;
+ break;
+
+ case SB_PAGEUP:
+ si.nPos -= si.nPage;
+ break;
+
+ case SB_PAGEDOWN:
+ si.nPos += si.nPage;
+ break;
+
+ case SB_THUMBTRACK:
+ si.nPos = si.nTrackPos;
+ break;
+
+ default:
+ break;
+ }
+
+ /*
+ * We retrieve the position after setting it,
+ * because Windows may adjust it.
+ */
+ si.fMask = SIF_POS;
+ SetScrollInfo (hwnd, SB_VERT, &si, TRUE);
+ GetScrollInfo (hwnd, SB_VERT, &si);
+
+ /* Scroll the window if the position has changed */
+ if (si.nPos != iVertPos)
+ {
+ /* Save the new offset for bit block transfers, etc. */
+ s_pScreenInfo->dwYOffset = -si.nPos;
+
+ /* Change displayed region in the window */
+ ScrollWindowEx (hwnd,
+ 0,
+ iVertPos - si.nPos,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ SW_INVALIDATE);
+
+ /* Redraw the window contents */
+ UpdateWindow (hwnd);
+ }
+ }
+ return 0;
+
+ case WM_HSCROLL:
+ {
+ SCROLLINFO si;
+ int iHorzPos;
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_HSCROLL\n");
+#endif
+
+ /* Get horizontal scroll bar info */
+ si.cbSize = sizeof (si);
+ si.fMask = SIF_ALL;
+ GetScrollInfo (hwnd, SB_HORZ, &si);
+
+ /* Save the horizontal position for comparison later */
+ iHorzPos = si.nPos;
+
+ /*
+ * Don't forget:
+ * moving the scrollbar to the RIGHT, scroll the content LEFT
+ */
+ switch (LOWORD(wParam))
+ {
+ case SB_LEFT:
+ si.nPos = si.nMin;
+ break;
+
+ case SB_RIGHT:
+ si.nPos = si.nMax - si.nPage + 1;
+ break;
+
+ case SB_LINELEFT:
+ si.nPos -= 1;
+ break;
+
+ case SB_LINERIGHT:
+ si.nPos += 1;
+ break;
+
+ case SB_PAGELEFT:
+ si.nPos -= si.nPage;
+ break;
+
+ case SB_PAGERIGHT:
+ si.nPos += si.nPage;
+ break;
+
+ case SB_THUMBTRACK:
+ si.nPos = si.nTrackPos;
+ break;
+
+ default:
+ break;
+ }
+
+ /*
+ * We retrieve the position after setting it,
+ * because Windows may adjust it.
+ */
+ si.fMask = SIF_POS;
+ SetScrollInfo (hwnd, SB_HORZ, &si, TRUE);
+ GetScrollInfo (hwnd, SB_HORZ, &si);
+
+ /* Scroll the window if the position has changed */
+ if (si.nPos != iHorzPos)
+ {
+ /* Save the new offset for bit block transfers, etc. */
+ s_pScreenInfo->dwXOffset = -si.nPos;
+
+ /* Change displayed region in the window */
+ ScrollWindowEx (hwnd,
+ iHorzPos - si.nPos,
+ 0,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ SW_INVALIDATE);
+
+ /* Redraw the window contents */
+ UpdateWindow (hwnd);
+ }
+ }
+ return 0;
+
+ case WM_GETMINMAXINFO:
+ {
+ MINMAXINFO *pMinMaxInfo = (MINMAXINFO *) lParam;
+ int iCaptionHeight;
+ int iBorderHeight, iBorderWidth;
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_GETMINMAXINFO - pScreenInfo: %08x\n",
+ s_pScreenInfo);
+#endif
+
+ /* Can't do anything without screen info */
+ if (s_pScreenInfo == NULL
+ || !s_pScreenInfo->fScrollbars
+ || s_pScreenInfo->fFullScreen
+ || !s_pScreenInfo->fDecoration
+ || s_pScreenInfo->fRootless
+ || s_pScreenInfo->fMultiWindow)
+ break;
+
+ /*
+ * Here we can override the maximum tracking size, which
+ * is the largest size that can be assigned to our window
+ * via the sizing border.
+ */
+
+ /*
+ * FIXME: Do we only need to do this once, since our visual size
+ * does not change? Does Windows store this value statically
+ * once we have set it once?
+ */
+
+ /* Get the border and caption sizes */
+ iCaptionHeight = GetSystemMetrics (SM_CYCAPTION);
+ iBorderWidth = 2 * GetSystemMetrics (SM_CXSIZEFRAME);
+ iBorderHeight = 2 * GetSystemMetrics (SM_CYSIZEFRAME);
+
+ /* Allow the full visual to be displayed */
+ pMinMaxInfo->ptMaxTrackSize.x
+ = s_pScreenInfo->dwWidth + iBorderWidth;
+ pMinMaxInfo->ptMaxTrackSize.y
+ = s_pScreenInfo->dwHeight + iBorderHeight + iCaptionHeight;
+ }
+ return 0;
+
+ case WM_ERASEBKGND:
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_ERASEBKGND\n");
+#endif
+ /*
+ * Pretend that we did erase the background but we don't care,
+ * the application uses the full window estate. This avoids some
+ * flickering when resizing.
+ */
+ return TRUE;
+
+ case WM_PAINT:
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_PAINT\n");
+#endif
+ /* Only paint if we have privates and the server is enabled */
+ if (s_pScreenPriv == NULL
+ || !s_pScreenPriv->fEnabled
+ || (s_pScreenInfo->fFullScreen && !s_pScreenPriv->fActive)
+ || s_pScreenPriv->fBadDepth)
+ {
+ /* We don't want to paint */
+ break;
+ }
+
+ /* Break out here if we don't have a valid paint routine */
+ if (s_pScreenPriv->pwinBltExposedRegions == NULL)
+ break;
+
+ /* Call the engine dependent repainter */
+ (*s_pScreenPriv->pwinBltExposedRegions) (s_pScreen);
+ return 0;
+
+ case WM_PALETTECHANGED:
+ {
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_PALETTECHANGED\n");
+#endif
+ /*
+ * Don't process if we don't have privates or a colormap,
+ * or if we have an invalid depth.
+ */
+ if (s_pScreenPriv == NULL
+ || s_pScreenPriv->pcmapInstalled == NULL
+ || s_pScreenPriv->fBadDepth)
+ break;
+
+ /* Return if we caused the palette to change */
+ if ((HWND) wParam == hwnd)
+ {
+ /* Redraw the screen */
+ (*s_pScreenPriv->pwinRedrawScreen) (s_pScreen);
+ return 0;
+ }
+
+ /* Reinstall the windows palette */
+ (*s_pScreenPriv->pwinRealizeInstalledPalette) (s_pScreen);
+
+ /* Redraw the screen */
+ (*s_pScreenPriv->pwinRedrawScreen) (s_pScreen);
+ return 0;
+ }
+
+ case WM_MOUSEMOVE:
+ /* We can't do anything without privates */
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* Has the mouse pointer crossed screens? */
+ if (s_pScreen != miPointerCurrentScreen ())
+ miPointerSetNewScreen (s_pScreenInfo->dwScreen,
+ GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
+ GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset);
+
+ /* Are we tracking yet? */
+ if (!s_fTracking)
+ {
+ TRACKMOUSEEVENT tme;
+
+ /* Setup data structure */
+ ZeroMemory (&tme, sizeof (tme));
+ tme.cbSize = sizeof (tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = hwnd;
+
+ /* Call the tracking function */
+ if (!(*g_fpTrackMouseEvent) (&tme))
+ ErrorF ("winWindowProc - _TrackMouseEvent failed\n");
+
+ /* Flag that we are tracking now */
+ s_fTracking = TRUE;
+ }
+
+ /* Hide or show the Windows mouse cursor */
+ if (s_fCursor && (s_pScreenPriv->fActive || s_pScreenInfo->fLessPointer))
+ {
+ /* Hide Windows cursor */
+ s_fCursor = FALSE;
+ ShowCursor (FALSE);
+ }
+ else if (!s_fCursor && !s_pScreenPriv->fActive
+ && !s_pScreenInfo->fLessPointer)
+ {
+ /* Show Windows cursor */
+ s_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+
+ /* Deliver absolute cursor position to X Server */
+ miPointerAbsoluteCursor (GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset,
+ GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset,
+ g_c32LastInputEventTime = GetTickCount ());
+ return 0;
+
+ case WM_NCMOUSEMOVE:
+ /*
+ * We break instead of returning 0 since we need to call
+ * DefWindowProc to get the mouse cursor changes
+ * and min/max/close button highlighting in Windows XP.
+ * The Platform SDK says that you should return 0 if you
+ * process this message, but it fails to mention that you
+ * will give up any default functionality if you do return 0.
+ */
+
+ /* We can't do anything without privates */
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* Non-client mouse movement, show Windows cursor */
+ if (!s_fCursor)
+ {
+ s_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+ break;
+
+ case WM_MOUSELEAVE:
+ /* Mouse has left our client area */
+
+ /* Flag that we are no longer tracking */
+ s_fTracking = FALSE;
+
+ /* Show the mouse cursor, if necessary */
+ if (!s_fCursor)
+ {
+ s_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+ return 0;
+
+ case WM_LBUTTONDBLCLK:
+ case WM_LBUTTONDOWN:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ if (s_pScreenInfo->fRootless) SetCapture (hwnd);
+ return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
+
+ case WM_LBUTTONUP:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ if (s_pScreenInfo->fRootless) ReleaseCapture ();
+ return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
+
+ case WM_MBUTTONDBLCLK:
+ case WM_MBUTTONDOWN:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ if (s_pScreenInfo->fRootless) SetCapture (hwnd);
+ return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
+
+ case WM_MBUTTONUP:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ if (s_pScreenInfo->fRootless) ReleaseCapture ();
+ return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
+
+ case WM_RBUTTONDBLCLK:
+ case WM_RBUTTONDOWN:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ if (s_pScreenInfo->fRootless) SetCapture (hwnd);
+ return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
+
+ case WM_RBUTTONUP:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+ if (s_pScreenInfo->fRootless) ReleaseCapture ();
+ return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
+
+ case WM_TIMER:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* Branch on the timer id */
+ switch (wParam)
+ {
+ case WIN_E3B_TIMER_ID:
+ /* Send delayed button press */
+ winMouseButtonsSendEvent (ButtonPress,
+ s_pScreenPriv->iE3BCachedPress);
+
+ /* Kill this timer */
+ KillTimer (s_pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID);
+
+ /* Clear screen privates flags */
+ s_pScreenPriv->iE3BCachedPress = 0;
+ break;
+ }
+ return 0;
+
+ case WM_CTLCOLORSCROLLBAR:
+ FatalError ("winWindowProc - WM_CTLCOLORSCROLLBAR - We are not "
+ "supposed to get this message. Exiting.\n");
+ return 0;
+
+ case WM_MOUSEWHEEL:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_MOUSEWHEEL\n");
+#endif
+ winMouseWheel (s_pScreen, GET_WHEEL_DELTA_WPARAM(wParam));
+ break;
+
+ case WM_SETFOCUS:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* Restore the state of all mode keys */
+ winRestoreModeKeyStates (s_pScreen);
+ return 0;
+
+ case WM_KILLFOCUS:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* Store the state of all mode keys */
+ winStoreModeKeyStates (s_pScreen);
+
+ /* Release any pressed keys */
+ winKeybdReleaseKeys ();
+ return 0;
+
+#if WIN_NEW_KEYBOARD_SUPPORT
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ case WM_SYSKEYUP:
+ case WM_KEYUP:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* Don't process keys if we are not active */
+ if (!s_pScreenPriv->fActive)
+ return 0;
+
+ winProcessKeyEvent ((DWORD)wParam, (DWORD) lParam);
+ return 0;
+
+ case WM_DEADCHAR:
+ case WM_SYSDEADCHAR:
+ return 0;
+
+#else /* WIN_NEW_KEYBOARD_SUPPORT */
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /*
+ * FIXME: Catching Alt-F4 like this is really terrible. This should
+ * be generalized to handle other Windows keyboard signals. Actually,
+ * the list keys to catch and the actions to perform when caught should
+ * be configurable; that way user's can customize the keys that they
+ * need to have passed through to their window manager or apps, or they
+ * can remap certain actions to new key codes that do not conflict
+ * with the X apps that they are using. Yeah, that'll take awhile.
+ */
+ if ((s_pScreenInfo->fUseWinKillKey && wParam == VK_F4
+ && (GetKeyState (VK_MENU) & 0x8000))
+ || (s_pScreenInfo->fUseUnixKillKey && wParam == VK_BACK
+ && (GetKeyState (VK_MENU) & 0x8000)
+ && (GetKeyState (VK_CONTROL) & 0x8000)))
+ {
+ /*
+ * Better leave this message here, just in case some unsuspecting
+ * user enters Alt + F4 and is surprised when the application
+ * quits.
+ */
+ ErrorF ("winWindowProc - WM_*KEYDOWN - Closekey hit, quitting\n");
+
+ /* Tell our message queue to give up */
+ PostMessage (hwnd, WM_CLOSE, 0, 0);
+ return 0;
+ }
+
+ /*
+ * Don't do anything for the Windows keys, as focus will soon
+ * be returned to Windows. We may be able to trap the Windows keys,
+ * but we should determine if that is desirable before doing so.
+ */
+ if (wParam == VK_LWIN || wParam == VK_RWIN)
+ break;
+
+ /* Discard fake Ctrl_L presses that precede AltGR on non-US keyboards */
+ if (winIsFakeCtrl_L (message, wParam, lParam))
+ return 0;
+
+ /* Send the key event(s) */
+ winTranslateKey (wParam, lParam, &iScanCode);
+ for (i = 0; i < LOWORD(lParam); ++i)
+ winSendKeyEvent (iScanCode, TRUE);
+ return 0;
+
+ case WM_SYSKEYUP:
+ case WM_KEYUP:
+ if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /*
+ * Don't do anything for the Windows keys, as focus will soon
+ * be returned to Windows. We may be able to trap the Windows keys,
+ * but we should determine if that is desirable before doing so.
+ */
+ if (wParam == VK_LWIN || wParam == VK_RWIN)
+ break;
+
+ /* Ignore the fake Ctrl_L that follows an AltGr release */
+ if (winIsFakeCtrl_L (message, wParam, lParam))
+ return 0;
+
+ /* Enqueue a keyup event */
+ winTranslateKey (wParam, lParam, &iScanCode);
+ winSendKeyEvent (iScanCode, FALSE);
+ return 0;
+#endif /* WIN_NEW_KEYBOARD_SUPPORT */
+
+ case WM_HOTKEY:
+ if (s_pScreenPriv == NULL)
+ break;
+
+ /* Call the engine-specific hot key handler */
+ (*s_pScreenPriv->pwinHotKeyAltTab) (s_pScreen);
+ return 0;
+
+ case WM_ACTIVATE:
+ if (s_pScreenPriv == NULL
+ || s_pScreenInfo->fIgnoreInput)
+ break;
+
+ /* TODO: Override display of window when we have a bad depth */
+ if (LOWORD(wParam) != WA_INACTIVE && s_pScreenPriv->fBadDepth)
+ {
+ ErrorF ("winWindowProc - WM_ACTIVATE - Bad depth, trying "
+ "to override window activation\n");
+
+ /* Minimize the window */
+ ShowWindow (hwnd, SW_MINIMIZE);
+
+ /* Display dialog box */
+ if (g_hDlgDepthChange != NULL)
+ {
+ /* Make the existing dialog box active */
+ SetActiveWindow (g_hDlgDepthChange);
+ }
+ else
+ {
+ /* TODO: Recreate the dialog box and bring to the top */
+ ShowWindow (g_hDlgDepthChange, SW_SHOWDEFAULT);
+ }
+
+ /* Don't do any other processing of this message */
+ return 0;
+ }
+
+
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_ACTIVATE\n");
+#endif
+
+ /*
+ * Focus is being changed to another window.
+ * The other window may or may not belong to
+ * our process.
+ */
+
+ /* Clear any lingering wheel delta */
+ s_pScreenPriv->iDeltaZ = 0;
+
+ /* Reshow the Windows mouse cursor if we are being deactivated */
+ if (LOWORD(wParam) == WA_INACTIVE
+ && !s_fCursor)
+ {
+ /* Show Windows cursor */
+ s_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+ return 0;
+
+ case WM_ACTIVATEAPP:
+ if (s_pScreenPriv == NULL
+ || s_pScreenInfo->fIgnoreInput)
+ break;
+
+#if CYGDEBUG
+ ErrorF ("winWindowProc - WM_ACTIVATEAPP\n");
+#endif
+
+ /* Activate or deactivate */
+ s_pScreenPriv->fActive = wParam;
+
+ /* Reshow the Windows mouse cursor if we are being deactivated */
+ if (!s_pScreenPriv->fActive
+ && !s_fCursor)
+ {
+ /* Show Windows cursor */
+ s_fCursor = TRUE;
+ ShowCursor (TRUE);
+ }
+
+ /* Call engine specific screen activation/deactivation function */
+ (*s_pScreenPriv->pwinActivateApp) (s_pScreen);
+ return 0;
+
+ case WM_CLOSE:
+ /* Tell X that we are giving up */
+ GiveUp (0);
+ return 0;
+ }
+
+ return DefWindowProc (hwnd, message, wParam, lParam);
+}
+
+
+/*
+ * Process messages for the dialog that is displayed for
+ * disruptive screen depth changes.
+ */
+
+BOOL CALLBACK
+winChangeDepthDlgProc (HWND hwndDialog, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ static winPrivScreenPtr s_pScreenPriv = NULL;
+ static winScreenInfo *s_pScreenInfo = NULL;
+ static ScreenPtr s_pScreen = NULL;
+
+#if CYGDEBUG
+ ErrorF ("winChangeDepthDlgProc\n");
+#endif
+
+ /* Branch on message type */
+ switch (message)
+ {
+ case WM_INITDIALOG:
+#if CYGDEBUG
+ ErrorF ("winChangeDepthDlgProc - WM_INITDIALOG\n");
+#endif
+
+ /* Store pointers to private structures for future use */
+ s_pScreenPriv = (winPrivScreenPtr) lParam;
+ s_pScreenInfo = s_pScreenPriv->pScreenInfo;
+ s_pScreen = s_pScreenInfo->pScreen;
+
+#if CYGDEBUG
+ ErrorF ("winChangeDepthDlgProc - WM_INITDIALG - s_pScreenPriv: %08x, "
+ "s_pScreenInfo: %08x, s_pScreen: %08x\n",
+ s_pScreenPriv, s_pScreenInfo, s_pScreen);
+#endif
+
+#if CYGDEBUG
+ ErrorF ("winChangeDepthDlgProc - WM_INITDIALOG - orig bpp: %d, "
+ "last bpp: %d\n",
+ s_pScreenInfo->dwBPP,
+ s_pScreenPriv->dwLastWindowsBitsPixel);
+#endif
+ return TRUE;
+
+ case WM_DISPLAYCHANGE:
+#if CYGDEBUG
+ ErrorF ("winChangeDepthDlgProc - WM_DISPLAYCHANGE - orig bpp: %d, "
+ "last bpp: %d, new bpp: %d\n",
+ s_pScreenInfo->dwBPP,
+ s_pScreenPriv->dwLastWindowsBitsPixel,
+ wParam);
+#endif
+
+ /* Dismiss the dialog if the display returns to the original depth */
+ if (wParam == s_pScreenInfo->dwBPP)
+ {
+ ErrorF ("winChangeDelthDlgProc - wParam == s_pScreenInfo->dwBPP\n");
+
+ /* Depth has been restored, dismiss dialog */
+ DestroyWindow (g_hDlgDepthChange);
+ g_hDlgDepthChange = NULL;
+
+ /* Flag that we have a valid screen depth */
+ s_pScreenPriv->fBadDepth = FALSE;
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD (wParam))
+ {
+ case IDOK:
+ case IDCANCEL:
+ ErrorF ("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
+
+ /*
+ * User dismissed the dialog, hide it until the
+ * display mode is restored.
+ */
+ ShowWindow (g_hDlgDepthChange, SW_HIDE);
+ return TRUE;
+ }
+ break;
+
+ case WM_CLOSE:
+ ErrorF ("winChangeDepthDlgProc - WM_CLOSE\n");
+
+ /*
+ * User dismissed the dialog, hide it until the
+ * display mode is restored.
+ */
+ ShowWindow (g_hDlgDepthChange, SW_HIDE);
+ return TRUE;
+ }
+
+ return FALSE;
+}